From 200144dd009d33ff8334be24d0fb2cc91b3a87ab Mon Sep 17 00:00:00 2001 From: murphy Date: Wed, 14 Apr 2010 23:59:03 +0000 Subject: Moving scanner tests into separate repository. The repository can be reached at http://svn.rubychan.de/coderay-scanner-tests/trunk. --- test/scanners/c/elvis.expected.raydebug | 26 - test/scanners/c/elvis.in.c | 26 - test/scanners/c/empty.expected.raydebug | 0 test/scanners/c/empty.in.c | 0 test/scanners/c/error.expected.raydebug | 1 - test/scanners/c/error.in.c | 1 - test/scanners/c/error2.expected.raydebug | 1 - test/scanners/c/error2.in.c | 1 - test/scanners/c/open-string.expected.raydebug | 1 - test/scanners/c/open-string.in.c | 1 - test/scanners/c/ruby.expected.raydebug | 96308 ------------------- test/scanners/c/ruby.in.c | 96308 ------------------- test/scanners/c/strange.expected.raydebug | 90 - test/scanners/c/strange.in.c | 90 - test/scanners/c/suite.rb | 2 - test/scanners/coderay_suite.rb | 510 - test/scanners/cpp/elvis.expected.raydebug | 26 - test/scanners/cpp/elvis.in.cpp | 26 - test/scanners/cpp/eventmachine.expected.raydebug | 7035 -- test/scanners/cpp/eventmachine.in.cpp | 7035 -- test/scanners/cpp/pleac.expected.raydebug | 2041 - test/scanners/cpp/pleac.in.cpp | 2041 - test/scanners/cpp/suite.rb | 2 - test/scanners/cpp/wedekind.expected.raydebug | 12 - test/scanners/cpp/wedekind.in.cpp | 12 - test/scanners/css/S5.expected.raydebug | 241 - test/scanners/css/S5.in.css | 217 - test/scanners/css/coderay.expected.raydebug | 124 - test/scanners/css/coderay.in.css | 124 - test/scanners/css/demo.expected.raydebug | 55 - test/scanners/css/demo.in.css | 55 - test/scanners/css/ignos-draconis.expected.raydebug | 1236 - test/scanners/css/ignos-draconis.in.css | 1236 - test/scanners/css/redmine.expected.raydebug | 685 - test/scanners/css/redmine.in.css | 685 - test/scanners/css/standard.expected.raydebug | 8 - test/scanners/css/standard.in.css | 8 - test/scanners/css/suite.rb | 2 - test/scanners/css/yui.expected.raydebug | 7620 -- test/scanners/css/yui.in.css | 7402 -- test/scanners/debug/class.expected.raydebug | 15 - test/scanners/debug/class.in.raydebug | 14 - test/scanners/debug/kate.expected.raydebug | 76 - test/scanners/debug/kate.in.raydebug | 76 - test/scanners/debug/lines.expected.raydebug | 27 - test/scanners/debug/lines.in.raydebug | 27 - test/scanners/debug/suite.rb | 2 - test/scanners/delphi/pluto.expected.raydebug | 10829 --- test/scanners/delphi/pluto.in.pas | 10829 --- test/scanners/delphi/suite.rb | 3 - test/scanners/delphi/ytools.expected.raydebug | 2708 - test/scanners/delphi/ytools.in.pas | 2708 - .../diff/coderay200vs250.expected.raydebug | 2241 - test/scanners/diff/coderay200vs250.in.diff | 2241 - test/scanners/diff/const_missing.expected.raydebug | 75 - test/scanners/diff/const_missing.in.diff | 75 - test/scanners/diff/example.expected.raydebug | 27 - test/scanners/diff/example.in.diff | 27 - test/scanners/diff/suite.rb | 2 - test/scanners/groovy/pleac.expected.raydebug | 10953 --- test/scanners/groovy/pleac.in.groovy | 10953 --- test/scanners/groovy/raistlin77.expected.raydebug | 483 - test/scanners/groovy/raistlin77.in.groovy | 483 - test/scanners/groovy/strange.expected.raydebug | 1 - test/scanners/groovy/strange.in.groovy | 1 - test/scanners/groovy/strings.expected.raydebug | 34 - test/scanners/groovy/strings.in.groovy | 34 - test/scanners/groovy/suite.rb | 4 - test/scanners/html/ampersand.expected.raydebug | 1 - test/scanners/html/ampersand.in.html | 1 - .../scanners/html/coderay-output.expected.raydebug | 469 - test/scanners/html/coderay-output.in.html | 469 - test/scanners/html/suite.rb | 2 - test/scanners/html/tolkien.expected.raydebug | 169 - test/scanners/html/tolkien.in.html | 169 - test/scanners/java/example.expected.raydebug | 12 - test/scanners/java/example.in.java | 12 - test/scanners/java/jruby.expected.raydebug | 51193 ---------- test/scanners/java/jruby.in.java | 51193 ---------- test/scanners/java/suite.rb | 4 - .../javascript/prototype.expected.raydebug | 4320 - test/scanners/javascript/prototype.in.js | 4320 - .../javascript/script.aculo.us.expected.raydebug | 7282 -- test/scanners/javascript/script.aculo.us.in.js | 7282 -- test/scanners/javascript/suite.rb | 2 - .../javascript/sun-spider.expected.raydebug | 16714 ---- test/scanners/javascript/sun-spider.in.js | 16714 ---- .../javascript/trace-test.expected.raydebug | 5930 -- test/scanners/javascript/trace-test.in.js | 5930 -- test/scanners/javascript/xml.expected.raydebug | 2 - test/scanners/javascript/xml.in.js | 2 - test/scanners/javascript/xml.known-issue.yaml | 2 - test/scanners/json/big.expected.raydebug | 295 - test/scanners/json/big.in.json | 295 - test/scanners/json/big2.expected.raydebug | 267 - test/scanners/json/big2.in.json | 267 - test/scanners/json/example.expected.raydebug | 22 - test/scanners/json/example.in.json | 22 - test/scanners/json/json-lib.expected.raydebug | 73 - test/scanners/json/json-lib.in.json | 73 - test/scanners/json/suite.rb | 2 - test/scanners/nitro/suite.rb | 2 - test/scanners/nitro/tags.expected.raydebug | 87 - test/scanners/nitro/tags.in.xhtml | 87 - test/scanners/php/class.expected.raydebug | 83 - test/scanners/php/class.in.php | 83 - test/scanners/php/elvis.expected.raydebug | 27 - test/scanners/php/elvis.in.php | 27 - .../scanners/php/html+php_faulty.expected.raydebug | 1 - test/scanners/php/html+php_faulty.in.php | 1 - test/scanners/php/labels.expected.raydebug | 34 - test/scanners/php/labels.in.php | 34 - test/scanners/php/namespaces.expected.raydebug | 9 - test/scanners/php/namespaces.in.php | 9 - test/scanners/php/pleac.expected.raydebug | 5516 -- test/scanners/php/pleac.in.php | 5516 -- test/scanners/php/strings.expected.raydebug | 360 - test/scanners/php/strings.in.php | 360 - test/scanners/php/suite.rb | 2 - test/scanners/php/test.expected.raydebug | 498 - test/scanners/php/test.in.php | 498 - test/scanners/python/import.expected.raydebug | 26 - test/scanners/python/import.in.py | 26 - test/scanners/python/literals.expected.raydebug | 16 - test/scanners/python/literals.in.py | 16 - test/scanners/python/pleac.expected.raydebug | 11119 --- test/scanners/python/pleac.in.py | 11119 --- test/scanners/python/pygments.expected.raydebug | 25595 ----- test/scanners/python/pygments.in.py | 25595 ----- test/scanners/python/python3.expected.raydebug | 19 - test/scanners/python/python3.in.py | 19 - test/scanners/python/suite.rb | 2 - test/scanners/python/unistring.expected.raydebug | 131 - test/scanners/python/unistring.in.py | 131 - test/scanners/rhtml/day.expected.raydebug | 26 - test/scanners/rhtml/day.in.rhtml | 26 - test/scanners/rhtml/suite.rb | 2 - test/scanners/ruby/1.expected.raydebug | 731 - test/scanners/ruby/1.in.rb | 731 - test/scanners/ruby/besetzung.expected.raydebug | Bin 4642 -> 0 bytes test/scanners/ruby/besetzung.in.rb | Bin 1472 -> 0 bytes test/scanners/ruby/class.expected.raydebug | 83 - test/scanners/ruby/class.in.rb | 83 - test/scanners/ruby/comment.expected.raydebug | 17 - test/scanners/ruby/comment.in.rb | 17 - test/scanners/ruby/def.expected.raydebug | 92 - test/scanners/ruby/def.in.rb | 92 - test/scanners/ruby/def.known-issue.yaml | 2 - test/scanners/ruby/diffed.expected.raydebug | 30 - test/scanners/ruby/diffed.in.rb | 30 - test/scanners/ruby/evil.expected.raydebug | 1123 - test/scanners/ruby/evil.in.rb | 1123 - test/scanners/ruby/example.expected.raydebug | 3789 - test/scanners/ruby/example.in.rb | 3789 - test/scanners/ruby/jarh.expected.raydebug | 371 - test/scanners/ruby/jarh.in.rb | 371 - .../scanners/ruby/nested-heredoc.expected.raydebug | 27 - test/scanners/ruby/nested-heredoc.in.rb | 27 - test/scanners/ruby/open-heredoc.expected.raydebug | 2 - test/scanners/ruby/open-heredoc.in.rb | 1 - test/scanners/ruby/open-inline.expected.raydebug | 2 - test/scanners/ruby/open-inline.in.rb | 1 - test/scanners/ruby/open-string.expected.raydebug | 2 - test/scanners/ruby/open-string.in.rb | 1 - test/scanners/ruby/operators.expected.raydebug | 51 - test/scanners/ruby/operators.in.rb | 51 - test/scanners/ruby/pleac.expected.raydebug | 6368 -- test/scanners/ruby/pleac.in.rb | 6368 -- test/scanners/ruby/quotes.expected.raydebug | 3 - test/scanners/ruby/quotes.in.rb | 3 - test/scanners/ruby/rails.expected.raydebug | 74259 -------------- test/scanners/ruby/rails.in.rb | 74259 -------------- test/scanners/ruby/regexp.expected.raydebug | 18 - test/scanners/ruby/regexp.in.rb | 18 - test/scanners/ruby/ruby19.expected.raydebug | 1 - test/scanners/ruby/ruby19.in.rb | 1 - test/scanners/ruby/sidebarize.expected.raydebug | 145 - test/scanners/ruby/sidebarize.in.rb | 145 - test/scanners/ruby/simple.expected.raydebug | 2 - test/scanners/ruby/simple.in.rb | 2 - test/scanners/ruby/strange.expected.raydebug | 356 - test/scanners/ruby/strange.in.rb | 356 - test/scanners/ruby/suite.rb | 2 - test/scanners/ruby/test-fitter.expected.raydebug | 46 - test/scanners/ruby/test-fitter.in.rb | 45 - test/scanners/ruby/tk-calc.expected.raydebug | 5 - test/scanners/ruby/tk-calc.in.rb | 5 - test/scanners/ruby/undef.expected.raydebug | 18 - test/scanners/ruby/undef.in.rb | 18 - test/scanners/ruby/unicode.expected.raydebug | 30 - test/scanners/ruby/unicode.in.rb | 30 - test/scanners/ruby/unicode.known-issue.yaml | 2 - test/scanners/ruby/zero.expected.raydebug | 0 test/scanners/ruby/zero.in.rb | 0 test/scanners/scheme/pleac.expected.raydebug | 5141 - test/scanners/scheme/pleac.in.scm | 5141 - test/scanners/scheme/strange.expected.raydebug | 38 - test/scanners/scheme/strange.in.scm | 38 - test/scanners/scheme/suite.rb | 2 - test/scanners/set-scanner-ignore-properties.sh | 4 - test/scanners/sql/create_tables.expected.raydebug | 94 - test/scanners/sql/create_tables.in.sql | 94 - test/scanners/sql/maintenance.expected.raydebug | 24 - test/scanners/sql/maintenance.in.sql | 24 - test/scanners/sql/mysql-comments.expected.raydebug | 2 - test/scanners/sql/mysql-comments.in.sql | 2 - .../sql/mysql-long-queries.expected.raydebug | 254 - test/scanners/sql/mysql-long-queries.in.sql | 254 - test/scanners/sql/norwegian.expected.raydebug | 48 - test/scanners/sql/norwegian.in.sql | 48 - test/scanners/sql/reference.expected.raydebug | 109 - test/scanners/sql/reference.in.sql | 109 - test/scanners/sql/selects.expected.raydebug | 46 - test/scanners/sql/selects.in.sql | 46 - test/scanners/sql/suite.rb | 2 - test/scanners/suite.rb | 6 - test/scanners/xml/kate.expected.raydebug | 76 - test/scanners/xml/kate.in.xml | 76 - test/scanners/xml/suite.rb | 2 - test/scanners/yaml/basic.expected.raydebug | 871 - test/scanners/yaml/basic.in.yml | 871 - test/scanners/yaml/database.expected.raydebug | 52 - test/scanners/yaml/database.in.yml | 52 - test/scanners/yaml/faq.expected.raydebug | 492 - test/scanners/yaml/faq.in.yml | 492 - test/scanners/yaml/gemspec.expected.raydebug | 111 - test/scanners/yaml/gemspec.in.yml | 111 - .../scanners/yaml/latex_entities.expected.raydebug | 2414 - test/scanners/yaml/latex_entities.in.yml | 2414 - test/scanners/yaml/multiline.expected.raydebug | 21 - test/scanners/yaml/multiline.in.yml | 21 - test/scanners/yaml/suite.rb | 3 - test/scanners/yaml/threshold.expected.raydebug | 772 - test/scanners/yaml/threshold.in.yml | 772 - test/scanners/yaml/website.expected.raydebug | 70 - test/scanners/yaml/website.in.yml | 70 - 236 files changed, 743287 deletions(-) delete mode 100644 test/scanners/c/elvis.expected.raydebug delete mode 100644 test/scanners/c/elvis.in.c delete mode 100644 test/scanners/c/empty.expected.raydebug delete mode 100644 test/scanners/c/empty.in.c delete mode 100644 test/scanners/c/error.expected.raydebug delete mode 100644 test/scanners/c/error.in.c delete mode 100644 test/scanners/c/error2.expected.raydebug delete mode 100644 test/scanners/c/error2.in.c delete mode 100644 test/scanners/c/open-string.expected.raydebug delete mode 100644 test/scanners/c/open-string.in.c delete mode 100644 test/scanners/c/ruby.expected.raydebug delete mode 100644 test/scanners/c/ruby.in.c delete mode 100644 test/scanners/c/strange.expected.raydebug delete mode 100644 test/scanners/c/strange.in.c delete mode 100644 test/scanners/c/suite.rb delete mode 100644 test/scanners/coderay_suite.rb delete mode 100644 test/scanners/cpp/elvis.expected.raydebug delete mode 100644 test/scanners/cpp/elvis.in.cpp delete mode 100644 test/scanners/cpp/eventmachine.expected.raydebug delete mode 100644 test/scanners/cpp/eventmachine.in.cpp delete mode 100644 test/scanners/cpp/pleac.expected.raydebug delete mode 100644 test/scanners/cpp/pleac.in.cpp delete mode 100644 test/scanners/cpp/suite.rb delete mode 100644 test/scanners/cpp/wedekind.expected.raydebug delete mode 100644 test/scanners/cpp/wedekind.in.cpp delete mode 100644 test/scanners/css/S5.expected.raydebug delete mode 100644 test/scanners/css/S5.in.css delete mode 100644 test/scanners/css/coderay.expected.raydebug delete mode 100644 test/scanners/css/coderay.in.css delete mode 100644 test/scanners/css/demo.expected.raydebug delete mode 100644 test/scanners/css/demo.in.css delete mode 100644 test/scanners/css/ignos-draconis.expected.raydebug delete mode 100644 test/scanners/css/ignos-draconis.in.css delete mode 100644 test/scanners/css/redmine.expected.raydebug delete mode 100644 test/scanners/css/redmine.in.css delete mode 100644 test/scanners/css/standard.expected.raydebug delete mode 100644 test/scanners/css/standard.in.css delete mode 100644 test/scanners/css/suite.rb delete mode 100644 test/scanners/css/yui.expected.raydebug delete mode 100644 test/scanners/css/yui.in.css delete mode 100644 test/scanners/debug/class.expected.raydebug delete mode 100644 test/scanners/debug/class.in.raydebug delete mode 100644 test/scanners/debug/kate.expected.raydebug delete mode 100644 test/scanners/debug/kate.in.raydebug delete mode 100644 test/scanners/debug/lines.expected.raydebug delete mode 100644 test/scanners/debug/lines.in.raydebug delete mode 100644 test/scanners/debug/suite.rb delete mode 100644 test/scanners/delphi/pluto.expected.raydebug delete mode 100644 test/scanners/delphi/pluto.in.pas delete mode 100644 test/scanners/delphi/suite.rb delete mode 100644 test/scanners/delphi/ytools.expected.raydebug delete mode 100644 test/scanners/delphi/ytools.in.pas delete mode 100644 test/scanners/diff/coderay200vs250.expected.raydebug delete mode 100644 test/scanners/diff/coderay200vs250.in.diff delete mode 100644 test/scanners/diff/const_missing.expected.raydebug delete mode 100644 test/scanners/diff/const_missing.in.diff delete mode 100644 test/scanners/diff/example.expected.raydebug delete mode 100644 test/scanners/diff/example.in.diff delete mode 100644 test/scanners/diff/suite.rb delete mode 100644 test/scanners/groovy/pleac.expected.raydebug delete mode 100644 test/scanners/groovy/pleac.in.groovy delete mode 100644 test/scanners/groovy/raistlin77.expected.raydebug delete mode 100644 test/scanners/groovy/raistlin77.in.groovy delete mode 100644 test/scanners/groovy/strange.expected.raydebug delete mode 100644 test/scanners/groovy/strange.in.groovy delete mode 100644 test/scanners/groovy/strings.expected.raydebug delete mode 100644 test/scanners/groovy/strings.in.groovy delete mode 100644 test/scanners/groovy/suite.rb delete mode 100644 test/scanners/html/ampersand.expected.raydebug delete mode 100644 test/scanners/html/ampersand.in.html delete mode 100644 test/scanners/html/coderay-output.expected.raydebug delete mode 100644 test/scanners/html/coderay-output.in.html delete mode 100644 test/scanners/html/suite.rb delete mode 100644 test/scanners/html/tolkien.expected.raydebug delete mode 100644 test/scanners/html/tolkien.in.html delete mode 100644 test/scanners/java/example.expected.raydebug delete mode 100644 test/scanners/java/example.in.java delete mode 100644 test/scanners/java/jruby.expected.raydebug delete mode 100644 test/scanners/java/jruby.in.java delete mode 100644 test/scanners/java/suite.rb delete mode 100644 test/scanners/javascript/prototype.expected.raydebug delete mode 100644 test/scanners/javascript/prototype.in.js delete mode 100644 test/scanners/javascript/script.aculo.us.expected.raydebug delete mode 100644 test/scanners/javascript/script.aculo.us.in.js delete mode 100644 test/scanners/javascript/suite.rb delete mode 100644 test/scanners/javascript/sun-spider.expected.raydebug delete mode 100644 test/scanners/javascript/sun-spider.in.js delete mode 100644 test/scanners/javascript/trace-test.expected.raydebug delete mode 100644 test/scanners/javascript/trace-test.in.js delete mode 100644 test/scanners/javascript/xml.expected.raydebug delete mode 100644 test/scanners/javascript/xml.in.js delete mode 100644 test/scanners/javascript/xml.known-issue.yaml delete mode 100644 test/scanners/json/big.expected.raydebug delete mode 100644 test/scanners/json/big.in.json delete mode 100644 test/scanners/json/big2.expected.raydebug delete mode 100644 test/scanners/json/big2.in.json delete mode 100644 test/scanners/json/example.expected.raydebug delete mode 100644 test/scanners/json/example.in.json delete mode 100644 test/scanners/json/json-lib.expected.raydebug delete mode 100644 test/scanners/json/json-lib.in.json delete mode 100644 test/scanners/json/suite.rb delete mode 100644 test/scanners/nitro/suite.rb delete mode 100644 test/scanners/nitro/tags.expected.raydebug delete mode 100644 test/scanners/nitro/tags.in.xhtml delete mode 100644 test/scanners/php/class.expected.raydebug delete mode 100644 test/scanners/php/class.in.php delete mode 100644 test/scanners/php/elvis.expected.raydebug delete mode 100644 test/scanners/php/elvis.in.php delete mode 100644 test/scanners/php/html+php_faulty.expected.raydebug delete mode 100644 test/scanners/php/html+php_faulty.in.php delete mode 100644 test/scanners/php/labels.expected.raydebug delete mode 100644 test/scanners/php/labels.in.php delete mode 100644 test/scanners/php/namespaces.expected.raydebug delete mode 100644 test/scanners/php/namespaces.in.php delete mode 100644 test/scanners/php/pleac.expected.raydebug delete mode 100644 test/scanners/php/pleac.in.php delete mode 100644 test/scanners/php/strings.expected.raydebug delete mode 100644 test/scanners/php/strings.in.php delete mode 100644 test/scanners/php/suite.rb delete mode 100644 test/scanners/php/test.expected.raydebug delete mode 100644 test/scanners/php/test.in.php delete mode 100644 test/scanners/python/import.expected.raydebug delete mode 100644 test/scanners/python/import.in.py delete mode 100644 test/scanners/python/literals.expected.raydebug delete mode 100644 test/scanners/python/literals.in.py delete mode 100644 test/scanners/python/pleac.expected.raydebug delete mode 100644 test/scanners/python/pleac.in.py delete mode 100644 test/scanners/python/pygments.expected.raydebug delete mode 100644 test/scanners/python/pygments.in.py delete mode 100644 test/scanners/python/python3.expected.raydebug delete mode 100644 test/scanners/python/python3.in.py delete mode 100644 test/scanners/python/suite.rb delete mode 100644 test/scanners/python/unistring.expected.raydebug delete mode 100644 test/scanners/python/unistring.in.py delete mode 100644 test/scanners/rhtml/day.expected.raydebug delete mode 100644 test/scanners/rhtml/day.in.rhtml delete mode 100644 test/scanners/rhtml/suite.rb delete mode 100644 test/scanners/ruby/1.expected.raydebug delete mode 100644 test/scanners/ruby/1.in.rb delete mode 100644 test/scanners/ruby/besetzung.expected.raydebug delete mode 100644 test/scanners/ruby/besetzung.in.rb delete mode 100644 test/scanners/ruby/class.expected.raydebug delete mode 100644 test/scanners/ruby/class.in.rb delete mode 100644 test/scanners/ruby/comment.expected.raydebug delete mode 100644 test/scanners/ruby/comment.in.rb delete mode 100644 test/scanners/ruby/def.expected.raydebug delete mode 100644 test/scanners/ruby/def.in.rb delete mode 100644 test/scanners/ruby/def.known-issue.yaml delete mode 100644 test/scanners/ruby/diffed.expected.raydebug delete mode 100644 test/scanners/ruby/diffed.in.rb delete mode 100644 test/scanners/ruby/evil.expected.raydebug delete mode 100644 test/scanners/ruby/evil.in.rb delete mode 100644 test/scanners/ruby/example.expected.raydebug delete mode 100644 test/scanners/ruby/example.in.rb delete mode 100644 test/scanners/ruby/jarh.expected.raydebug delete mode 100644 test/scanners/ruby/jarh.in.rb delete mode 100644 test/scanners/ruby/nested-heredoc.expected.raydebug delete mode 100755 test/scanners/ruby/nested-heredoc.in.rb delete mode 100644 test/scanners/ruby/open-heredoc.expected.raydebug delete mode 100644 test/scanners/ruby/open-heredoc.in.rb delete mode 100644 test/scanners/ruby/open-inline.expected.raydebug delete mode 100644 test/scanners/ruby/open-inline.in.rb delete mode 100644 test/scanners/ruby/open-string.expected.raydebug delete mode 100644 test/scanners/ruby/open-string.in.rb delete mode 100644 test/scanners/ruby/operators.expected.raydebug delete mode 100644 test/scanners/ruby/operators.in.rb delete mode 100644 test/scanners/ruby/pleac.expected.raydebug delete mode 100644 test/scanners/ruby/pleac.in.rb delete mode 100644 test/scanners/ruby/quotes.expected.raydebug delete mode 100644 test/scanners/ruby/quotes.in.rb delete mode 100644 test/scanners/ruby/rails.expected.raydebug delete mode 100644 test/scanners/ruby/rails.in.rb delete mode 100644 test/scanners/ruby/regexp.expected.raydebug delete mode 100644 test/scanners/ruby/regexp.in.rb delete mode 100644 test/scanners/ruby/ruby19.expected.raydebug delete mode 100644 test/scanners/ruby/ruby19.in.rb delete mode 100644 test/scanners/ruby/sidebarize.expected.raydebug delete mode 100644 test/scanners/ruby/sidebarize.in.rb delete mode 100644 test/scanners/ruby/simple.expected.raydebug delete mode 100644 test/scanners/ruby/simple.in.rb delete mode 100644 test/scanners/ruby/strange.expected.raydebug delete mode 100644 test/scanners/ruby/strange.in.rb delete mode 100644 test/scanners/ruby/suite.rb delete mode 100644 test/scanners/ruby/test-fitter.expected.raydebug delete mode 100644 test/scanners/ruby/test-fitter.in.rb delete mode 100644 test/scanners/ruby/tk-calc.expected.raydebug delete mode 100644 test/scanners/ruby/tk-calc.in.rb delete mode 100644 test/scanners/ruby/undef.expected.raydebug delete mode 100644 test/scanners/ruby/undef.in.rb delete mode 100644 test/scanners/ruby/unicode.expected.raydebug delete mode 100644 test/scanners/ruby/unicode.in.rb delete mode 100644 test/scanners/ruby/unicode.known-issue.yaml delete mode 100644 test/scanners/ruby/zero.expected.raydebug delete mode 100644 test/scanners/ruby/zero.in.rb delete mode 100644 test/scanners/scheme/pleac.expected.raydebug delete mode 100644 test/scanners/scheme/pleac.in.scm delete mode 100644 test/scanners/scheme/strange.expected.raydebug delete mode 100644 test/scanners/scheme/strange.in.scm delete mode 100644 test/scanners/scheme/suite.rb delete mode 100755 test/scanners/set-scanner-ignore-properties.sh delete mode 100644 test/scanners/sql/create_tables.expected.raydebug delete mode 100644 test/scanners/sql/create_tables.in.sql delete mode 100644 test/scanners/sql/maintenance.expected.raydebug delete mode 100644 test/scanners/sql/maintenance.in.sql delete mode 100644 test/scanners/sql/mysql-comments.expected.raydebug delete mode 100644 test/scanners/sql/mysql-comments.in.sql delete mode 100644 test/scanners/sql/mysql-long-queries.expected.raydebug delete mode 100644 test/scanners/sql/mysql-long-queries.in.sql delete mode 100644 test/scanners/sql/norwegian.expected.raydebug delete mode 100644 test/scanners/sql/norwegian.in.sql delete mode 100644 test/scanners/sql/reference.expected.raydebug delete mode 100644 test/scanners/sql/reference.in.sql delete mode 100644 test/scanners/sql/selects.expected.raydebug delete mode 100644 test/scanners/sql/selects.in.sql delete mode 100644 test/scanners/sql/suite.rb delete mode 100644 test/scanners/suite.rb delete mode 100644 test/scanners/xml/kate.expected.raydebug delete mode 100644 test/scanners/xml/kate.in.xml delete mode 100644 test/scanners/xml/suite.rb delete mode 100644 test/scanners/yaml/basic.expected.raydebug delete mode 100644 test/scanners/yaml/basic.in.yml delete mode 100644 test/scanners/yaml/database.expected.raydebug delete mode 100644 test/scanners/yaml/database.in.yml delete mode 100644 test/scanners/yaml/faq.expected.raydebug delete mode 100644 test/scanners/yaml/faq.in.yml delete mode 100644 test/scanners/yaml/gemspec.expected.raydebug delete mode 100644 test/scanners/yaml/gemspec.in.yml delete mode 100644 test/scanners/yaml/latex_entities.expected.raydebug delete mode 100644 test/scanners/yaml/latex_entities.in.yml delete mode 100644 test/scanners/yaml/multiline.expected.raydebug delete mode 100644 test/scanners/yaml/multiline.in.yml delete mode 100644 test/scanners/yaml/suite.rb delete mode 100644 test/scanners/yaml/threshold.expected.raydebug delete mode 100644 test/scanners/yaml/threshold.in.yml delete mode 100644 test/scanners/yaml/website.expected.raydebug delete mode 100644 test/scanners/yaml/website.in.yml (limited to 'test') diff --git a/test/scanners/c/elvis.expected.raydebug b/test/scanners/c/elvis.expected.raydebug deleted file mode 100644 index 81743d0..0000000 --- a/test/scanners/c/elvis.expected.raydebug +++ /dev/null @@ -1,26 +0,0 @@ -ident(This)operator(?)ident(is)operator(+)ident(no)operator(:)ident(label)operator(;) - -comment(// This is only one label:) -label(label:) reserved(switch) operator(()ident(TYPE)operator(()ident(v)operator(\)\)) operator({) - reserved(case) ident(T_CLASS)operator(:) reserved(case) ident(T_MODULE)operator(:) - ident(rb_str_append)operator(()ident(s)operator(,) ident(rb_inspect)operator(()ident(v)operator(\)\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_str_append)operator(()ident(s)operator(,) ident(rb_any_to_s)operator(()ident(v)operator(\)\);) - reserved(break)operator(;) -operator(}) -comment(// These are two labels.) -ident(function)operator(()ident(call)operator(\);) -label(label2:) label(label3:) ident(a) operator(=) ident(b) operator(+) ident(c)operator(;) - -comment(// Another label.) -reserved(if) operator(()integer(1)operator(\)) operator({) - label(label4:) ident(a) operator(=) ident(b) operator(+) ident(c)operator(;) -operator(}) - -comment(// Not a label.) -ident(test)operator(() - ident(a)operator(?) - ident(b)operator(:) - ident(c) -operator(\)) \ No newline at end of file diff --git a/test/scanners/c/elvis.in.c b/test/scanners/c/elvis.in.c deleted file mode 100644 index 9cdd574..0000000 --- a/test/scanners/c/elvis.in.c +++ /dev/null @@ -1,26 +0,0 @@ -This?is+no:label; - -// This is only one label: -label: switch (TYPE(v)) { - case T_CLASS: case T_MODULE: - rb_str_append(s, rb_inspect(v)); - break; - default: - rb_str_append(s, rb_any_to_s(v)); - break; -} -// These are two labels. -function(call); -label2: label3: a = b + c; - -// Another label. -if (1) { - label4: a = b + c; -} - -// Not a label. -test( - a? - b: - c -) \ No newline at end of file diff --git a/test/scanners/c/empty.expected.raydebug b/test/scanners/c/empty.expected.raydebug deleted file mode 100644 index e69de29..0000000 diff --git a/test/scanners/c/empty.in.c b/test/scanners/c/empty.in.c deleted file mode 100644 index e69de29..0000000 diff --git a/test/scanners/c/error.expected.raydebug b/test/scanners/c/error.expected.raydebug deleted file mode 100644 index a52becb..0000000 --- a/test/scanners/c/error.expected.raydebug +++ /dev/null @@ -1 +0,0 @@ -error(\\)\ diff --git a/test/scanners/c/error.in.c b/test/scanners/c/error.in.c deleted file mode 100644 index 9cad53e..0000000 --- a/test/scanners/c/error.in.c +++ /dev/null @@ -1 +0,0 @@ -\\ diff --git a/test/scanners/c/error2.expected.raydebug b/test/scanners/c/error2.expected.raydebug deleted file mode 100644 index ccd2125..0000000 --- a/test/scanners/c/error2.expected.raydebug +++ /dev/null @@ -1 +0,0 @@ -ident(foo) \ No newline at end of file diff --git a/test/scanners/c/error2.in.c b/test/scanners/c/error2.in.c deleted file mode 100644 index 1910281..0000000 --- a/test/scanners/c/error2.in.c +++ /dev/null @@ -1 +0,0 @@ -foo \ No newline at end of file diff --git a/test/scanners/c/open-string.expected.raydebug b/test/scanners/c/open-string.expected.raydebug deleted file mode 100644 index a6afd22..0000000 --- a/test/scanners/c/open-string.expected.raydebug +++ /dev/null @@ -1 +0,0 @@ -string \ No newline at end of file diff --git a/test/scanners/c/open-string.in.c b/test/scanners/c/open-string.in.c deleted file mode 100644 index 9d68933..0000000 --- a/test/scanners/c/open-string.in.c +++ /dev/null @@ -1 +0,0 @@ -" \ No newline at end of file diff --git a/test/scanners/c/ruby.expected.raydebug b/test/scanners/c/ruby.expected.raydebug deleted file mode 100644 index 9eef3a6..0000000 --- a/test/scanners/c/ruby.expected.raydebug +++ /dev/null @@ -1,96308 +0,0 @@ -comment(/********************************************************************** - - array.c - - - $Author: shyouhei $ - $Date: 2009-02-05 00:55:01 +0100 (Thu, 05 Feb 2009\) $ - created at: Fri Aug 6 09:46:12 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("util.h") -preprocessor(#include) include("st.h") - -ident(VALUE) ident(rb_cArray)operator(;) -directive(static) ident(ID) ident(id_cmp)operator(;) - -preprocessor(#define) ident(ARY_DEFAULT_SIZE) integer(16) -preprocessor(#define) ident(ARY_MAX_SIZE) operator(()ident(LONG_MAX) operator(/) reserved(sizeof)operator(()ident(VALUE)operator(\)\)) - -directive(void) -ident(rb_mem_clear)operator(()ident(mem)operator(,) ident(size)operator(\)) - directive(register) ident(VALUE) operator(*)ident(mem)operator(;) - directive(register) pre_type(long) ident(size)operator(;) -operator({) - reserved(while) operator(()ident(size)operator(--\)) operator({) - operator(*)ident(mem)operator(++) operator(=) ident(Qnil)operator(;) - operator(}) -operator(}) - -directive(static) directive(inline) directive(void) -ident(memfill)operator(()ident(mem)operator(,) ident(size)operator(,) ident(val)operator(\)) - directive(register) ident(VALUE) operator(*)ident(mem)operator(;) - directive(register) pre_type(long) ident(size)operator(;) - directive(register) ident(VALUE) ident(val)operator(;) -operator({) - reserved(while) operator(()ident(size)operator(--\)) operator({) - operator(*)ident(mem)operator(++) operator(=) ident(val)operator(;) - operator(}) -operator(}) - -preprocessor(#define) ident(ARY_TMPLOCK) ident(FL_USER1) - -directive(static) directive(inline) directive(void) -ident(rb_ary_modify_check)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(ary)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(ary)operator(,) ident(ARY_TMPLOCK)operator(\)\)) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(ary)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) -operator(}) - -directive(static) directive(void) -ident(rb_ary_modify)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) operator(*)ident(ptr)operator(;) - - ident(rb_ary_modify_check)operator(()ident(ary)operator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(ary)operator(,) ident(ELTS_SHARED)operator(\)\)) operator({) - ident(ptr) operator(=) ident(ALLOC_N)operator(()ident(VALUE)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - ident(FL_UNSET)operator(()ident(ary)operator(,) ident(ELTS_SHARED)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - ident(MEMCPY)operator(()ident(ptr)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(=) ident(ptr)operator(;) - operator(}) -operator(}) - -ident(VALUE) -ident(rb_ary_freeze)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(rb_obj_freeze)operator(()ident(ary)operator(\);) -operator(}) - -comment(/* - * call-seq: - * array.frozen? -> true or false - * - * Return true if this array is frozen (or temporarily frozen - * while being sorted\). - */) - -directive(static) ident(VALUE) -ident(rb_ary_frozen_p)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(ary)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(FL_TEST)operator(()ident(ary)operator(,) ident(ARY_TMPLOCK)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(ary_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(ary_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(ary)operator(,) reserved(struct) ident(RArray)operator(\);) - ident(OBJSETUP)operator(()ident(ary)operator(,) ident(klass)operator(,) ident(T_ARRAY)operator(\);) - - ident(ary)operator(->)ident(len) operator(=) integer(0)operator(;) - ident(ary)operator(->)ident(ptr) operator(=) integer(0)operator(;) - ident(ary)operator(->)ident(aux)operator(.)ident(capa) operator(=) integer(0)operator(;) - - reserved(return) operator(()ident(VALUE)operator(\))ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(ary_new)operator(()ident(klass)operator(,) ident(len)operator(\)) - ident(VALUE) ident(klass)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - ident(VALUE) ident(ary) operator(=) ident(ary_alloc)operator(()ident(klass)operator(\);) - - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(len) operator(>) ident(ARY_MAX_SIZE)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) ident(len)operator(++;) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(=) ident(ALLOC_N)operator(()ident(VALUE)operator(,) ident(len)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(len)operator(;) - - reserved(return) ident(ary)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ary_new2)operator(()ident(len)operator(\)) - pre_type(long) ident(len)operator(;) -operator({) - reserved(return) ident(ary_new)operator(()ident(rb_cArray)operator(,) ident(len)operator(\);) -operator(}) - - -ident(VALUE) -ident(rb_ary_new)operator((\)) -operator({) - reserved(return) ident(rb_ary_new2)operator(()ident(ARY_DEFAULT_SIZE)operator(\);) -operator(}) - -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -preprocessor(#include) include() -preprocessor(#define) ident(va_init_list)operator(()ident(a)operator(,)ident(b)operator(\)) ident(va_start)operator(()ident(a)operator(,)ident(b)operator(\)) -preprocessor(#else) -preprocessor(#include) include() -preprocessor(#define) ident(va_init_list)operator(()ident(a)operator(,)ident(b)operator(\)) ident(va_start)operator(()ident(a)operator(\)) -preprocessor(#endif) - -ident(VALUE) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_ary_new3)operator(()pre_type(long) ident(n)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_ary_new3)operator(()ident(n)operator(,) ident(va_alist)operator(\)) - pre_type(long) ident(n)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(va_list) ident(ar)operator(;) - ident(VALUE) ident(ary)operator(;) - pre_type(long) ident(i)operator(;) - - ident(ary) operator(=) ident(rb_ary_new2)operator(()ident(n)operator(\);) - - ident(va_init_list)operator(()ident(ar)operator(,) ident(n)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(n)operator(;) ident(i)operator(++\)) operator({) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(=) ident(va_arg)operator(()ident(ar)operator(,) ident(VALUE)operator(\);) - operator(}) - ident(va_end)operator(()ident(ar)operator(\);) - - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(n)operator(;) - reserved(return) ident(ary)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ary_new4)operator(()ident(n)operator(,) ident(elts)operator(\)) - pre_type(long) ident(n)operator(;) - directive(const) ident(VALUE) operator(*)ident(elts)operator(;) -operator({) - ident(VALUE) ident(ary)operator(;) - - ident(ary) operator(=) ident(rb_ary_new2)operator(()ident(n)operator(\);) - reserved(if) operator(()ident(n) operator(>) integer(0) operator(&&) ident(elts)operator(\)) operator({) - ident(MEMCPY)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(elts)operator(,) ident(VALUE)operator(,) ident(n)operator(\);) - operator(}) - - comment(/* This assignment to len will be moved to the above "if" block in Ruby 1.9 */) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(n)operator(;) - - reserved(return) ident(ary)operator(;) -operator(}) - -ident(VALUE) -ident(rb_assoc_new)operator(()ident(car)operator(,) ident(cdr)operator(\)) - ident(VALUE) ident(car)operator(,) ident(cdr)operator(;) -operator({) - ident(VALUE) ident(ary)operator(;) - - ident(ary) operator(=) ident(rb_ary_new2)operator(()integer(2)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(=) ident(car)operator(;) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)integer(1)operator(]) operator(=) ident(cdr)operator(;) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) integer(2)operator(;) - - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(to_ary)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(rb_convert_type)operator(()ident(ary)operator(,) ident(T_ARRAY)operator(,) stringoperator(,) stringoperator(\);) -operator(}) - -ident(VALUE) -ident(rb_check_array_type)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(rb_check_convert_type)operator(()ident(ary)operator(,) ident(T_ARRAY)operator(,) stringoperator(,) stringoperator(\);) -operator(}) - -directive(static) ident(VALUE) ident(rb_ary_replace) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) - -comment(/* - * call-seq: - * Array.new(size=0, obj=nil\) - * Array.new(array\) - * Array.new(size\) {|index| block } - * - * Returns a new array. In the first form, the new array is - * empty. In the second it is created with _size_ copies of _obj_ - * (that is, _size_ references to the same - * _obj_\). The third form creates a copy of the array - * passed as a parameter (the array is generated by calling - * to_ary on the parameter\). In the last form, an array - * of the given size is created. Each element in this array is - * calculated by passing the element's index to the given block and - * storing the return value. - * - * Array.new - * Array.new(2\) - * Array.new(5, "A"\) - * - * # only one copy of the object is created - * a = Array.new(2, Hash.new\) - * a[0]['cat'] = 'feline' - * a - * a[1]['cat'] = 'Felix' - * a - * - * # here multiple copies are created - * a = Array.new(2\) { Hash.new } - * a[0]['cat'] = 'feline' - * a - * - * squares = Array.new(5\) {|i| i*i} - * squares - * - * copy = Array.new(squares\) - */) - -directive(static) ident(VALUE) -ident(rb_ary_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(len)operator(;) - ident(VALUE) ident(size)operator(,) ident(val)operator(;) - - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(size)operator(,) operator(&)ident(val)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(rb_warning)operator(()stringoperator(\);) - operator(}) - reserved(return) ident(ary)operator(;) - operator(}) - - reserved(if) operator(()ident(argc) operator(==) integer(1) operator(&&) operator(!)ident(FIXNUM_P)operator(()ident(size)operator(\)\)) operator({) - ident(val) operator(=) ident(rb_check_array_type)operator(()ident(size)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(val)operator(\)\)) operator({) - ident(rb_ary_replace)operator(()ident(ary)operator(,) ident(val)operator(\);) - reserved(return) ident(ary)operator(;) - operator(}) - operator(}) - - ident(len) operator(=) ident(NUM2LONG)operator(()ident(size)operator(\);) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(len) operator(>) ident(ARY_MAX_SIZE)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(len) operator(>) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa)operator(\)) operator({) - ident(REALLOC_N)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(len)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(len)operator(;) - operator(}) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(2)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_ary_store)operator(()ident(ary)operator(,) ident(i)operator(,) ident(rb_yield)operator(()ident(LONG2NUM)operator(()ident(i)operator(\)\)\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(i) operator(+) integer(1)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(memfill)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(len)operator(,) ident(val)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(len)operator(;) - operator(}) - - reserved(return) ident(ary)operator(;) -operator(}) - - -comment(/* -* Returns a new array populated with the given objects. -* -* Array.[]( 1, 'a', /^A/ \) -* Array[ 1, 'a', /^A/ ] -* [ 1, 'a', /^A/ ] -*/) - -directive(static) ident(VALUE) -ident(rb_ary_s_create)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(ary) operator(=) ident(ary_alloc)operator(()ident(klass)operator(\);) - - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(=) ident(ALLOC_N)operator(()ident(VALUE)operator(,) ident(argc)operator(\);) - ident(MEMCPY)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(argv)operator(,) ident(VALUE)operator(,) ident(argc)operator(\);) - operator(}) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(argc)operator(;) - - reserved(return) ident(ary)operator(;) -operator(}) - -directive(void) -ident(rb_ary_store)operator(()ident(ary)operator(,) ident(idx)operator(,) ident(val)operator(\)) - ident(VALUE) ident(ary)operator(;) - pre_type(long) ident(idx)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(if) operator(()ident(idx) operator(<) integer(0)operator(\)) operator({) - ident(idx) operator(+=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(idx) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) - ident(idx) operator(-) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(idx) operator(>=) ident(ARY_MAX_SIZE)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(idx)operator(\);) - operator(}) - - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - reserved(if) operator(()ident(idx) operator(>=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa)operator(\)) operator({) - pre_type(long) ident(new_capa) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(/) integer(2)operator(;) - - reserved(if) operator(()ident(new_capa) operator(<) ident(ARY_DEFAULT_SIZE)operator(\)) operator({) - ident(new_capa) operator(=) ident(ARY_DEFAULT_SIZE)operator(;) - operator(}) - reserved(if) operator(()ident(new_capa) operator(>=) ident(ARY_MAX_SIZE) operator(-) ident(idx)operator(\)) operator({) - ident(new_capa) operator(=) operator(()ident(ARY_MAX_SIZE) operator(-) ident(idx)operator(\)) operator(/) integer(2)operator(;) - operator(}) - ident(new_capa) operator(+=) ident(idx)operator(;) - ident(REALLOC_N)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(new_capa)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(new_capa)operator(;) - operator(}) - reserved(if) operator(()ident(idx) operator(>) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_mem_clear)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(+) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) - ident(idx)operator(-)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(+) integer(1)operator(\);) - operator(}) - - reserved(if) operator(()ident(idx) operator(>=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) operator({) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(idx) operator(+) integer(1)operator(;) - operator(}) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(idx)operator(]) operator(=) ident(val)operator(;) -operator(}) - -comment(/* - * call-seq: - * array << obj -> array - * - * Append---Pushes the given object on to the end of this array. This - * expression returns the array itself, so several appends - * may be chained together. - * - * [ 1, 2 ] << "c" << "d" << [ 3, 4 ] - * #=> [ 1, 2, "c", "d", [ 3, 4 ] ] - * - */) - -ident(VALUE) -ident(rb_ary_push)operator(()ident(ary)operator(,) ident(item)operator(\)) - ident(VALUE) ident(ary)operator(;) - ident(VALUE) ident(item)operator(;) -operator({) - ident(rb_ary_store)operator(()ident(ary)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) ident(item)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.push(obj, ... \) -> array - * - * Append---Pushes the given object(s\) on to the end of this array. This - * expression returns the array itself, so several appends - * may be chained together. - * - * a = [ "a", "b", "c" ] - * a.push("d", "e", "f"\) - * #=> ["a", "b", "c", "d", "e", "f"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_push_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(while) operator(()ident(argc)operator(--\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) operator(*)ident(argv)operator(++\);) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.pop -> obj or nil - * - * Removes the last element from self and returns it, or - * nil if the array is empty. - * - * a = [ "a", "m", "z" ] - * a.pop #=> "z" - * a #=> ["a", "m"] - */) - -ident(VALUE) -ident(rb_ary_pop)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(rb_ary_modify_check)operator(()ident(ary)operator(\);) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(ary)operator(,) ident(ELTS_SHARED)operator(\)) operator(&&) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(*) integer(2) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(&&) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(>) ident(ARY_DEFAULT_SIZE)operator(\)) operator({) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(*) integer(2)operator(;) - ident(REALLOC_N)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa)operator(\);) - operator(}) - reserved(return) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([--)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(];) -operator(}) - -directive(static) ident(VALUE) -ident(ary_make_shared)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(ary)operator(,) ident(ELTS_SHARED)operator(\)\)) operator({) - ident(NEWOBJ)operator(()ident(shared)operator(,) reserved(struct) ident(RArray)operator(\);) - ident(OBJSETUP)operator(()ident(shared)operator(,) ident(rb_cArray)operator(,) ident(T_ARRAY)operator(\);) - - ident(shared)operator(->)ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - ident(shared)operator(->)ident(ptr) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(;) - ident(shared)operator(->)ident(aux)operator(.)ident(capa) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa)operator(;) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(shared) operator(=) operator(()ident(VALUE)operator(\))ident(shared)operator(;) - ident(FL_SET)operator(()ident(ary)operator(,) ident(ELTS_SHARED)operator(\);) - ident(OBJ_FREEZE)operator(()ident(shared)operator(\);) - reserved(return) operator(()ident(VALUE)operator(\))ident(shared)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(shared)operator(;) - operator(}) -operator(}) - -comment(/* - * call-seq: - * array.shift -> obj or nil - * - * Returns the first element of self and removes it (shifting all - * other elements down by one\). Returns nil if the array - * is empty. - * - * args = [ "-m", "-q", "filename" ] - * args.shift #=> "-m" - * args #=> ["-q", "filename"] - */) - -ident(VALUE) -ident(rb_ary_shift)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) ident(top)operator(;) - - ident(rb_ary_modify_check)operator(()ident(ary)operator(\);) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(top) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - reserved(if) operator(()ident(RARRAY_LEN)operator(()ident(ary)operator(\)) operator(<) ident(ARY_DEFAULT_SIZE) operator(&&) operator(!)ident(FL_TEST)operator(()ident(ary)operator(,) ident(ELTS_SHARED)operator(\)\)) operator({) - ident(MEMMOVE)operator(()ident(RARRAY_PTR)operator(()ident(ary)operator(\),) ident(RARRAY_PTR)operator(()ident(ary)operator(\)+)integer(1)operator(,) ident(VALUE)operator(,) ident(RARRAY_LEN)operator(()ident(ary)operator(\)-)integer(1)operator(\);) - operator(}) - reserved(else) operator({) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(ary)operator(,) ident(ELTS_SHARED)operator(\)\)) operator({) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(=) ident(Qnil)operator(;) - operator(}) - ident(ary_make_shared)operator(()ident(ary)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(++;) comment(/* shift ptr */) - operator(}) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(--;) - - reserved(return) ident(top)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ary_unshift)operator(()ident(ary)operator(,) ident(item)operator(\)) - ident(VALUE) ident(ary)operator(,) ident(item)operator(;) -operator({) - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa)operator(\)) operator({) - pre_type(long) ident(capa_inc) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(/) integer(2)operator(;) - reserved(if) operator(()ident(capa_inc) operator(<) ident(ARY_DEFAULT_SIZE)operator(\)) operator({) - ident(capa_inc) operator(=) ident(ARY_DEFAULT_SIZE)operator(;) - operator(}) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(+=) ident(capa_inc)operator(;) - ident(REALLOC_N)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa)operator(\);) - operator(}) - - comment(/* sliding items */) - ident(MEMMOVE)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(+) integer(1)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(++;) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(=) ident(item)operator(;) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.unshift(obj, ...\) -> array - * - * Prepends objects to the front of array. - * other elements up one. - * - * a = [ "b", "c", "d" ] - * a.unshift("a"\) #=> ["a", "b", "c", "d"] - * a.unshift(1, 2\) #=> [ 1, 2, "a", "b", "c", "d"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_unshift_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) reserved(return) ident(ary)operator(;) - - comment(/* make rooms by setting the last item */) - ident(rb_ary_store)operator(()ident(ary)operator(,) ident(len) operator(+) ident(argc) operator(-) integer(1)operator(,) ident(Qnil)operator(\);) - - comment(/* sliding items */) - ident(MEMMOVE)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(+) ident(argc)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(len)operator(\);) - ident(MEMCPY)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(argv)operator(,) ident(VALUE)operator(,) ident(argc)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* faster version - use this if you don't need to treat negative offset */) -directive(static) directive(inline) ident(VALUE) -ident(rb_ary_elt)operator(()ident(ary)operator(,) ident(offset)operator(\)) - ident(VALUE) ident(ary)operator(;) - pre_type(long) ident(offset)operator(;) -operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(offset) operator(<) integer(0) operator(||) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(<=) ident(offset)operator(\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(offset)operator(];) -operator(}) - -ident(VALUE) -ident(rb_ary_entry)operator(()ident(ary)operator(,) ident(offset)operator(\)) - ident(VALUE) ident(ary)operator(;) - pre_type(long) ident(offset)operator(;) -operator({) - reserved(if) operator(()ident(offset) operator(<) integer(0)operator(\)) operator({) - ident(offset) operator(+=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - operator(}) - reserved(return) ident(rb_ary_elt)operator(()ident(ary)operator(,) ident(offset)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_ary_subseq)operator(()ident(ary)operator(,) ident(beg)operator(,) ident(len)operator(\)) - ident(VALUE) ident(ary)operator(;) - pre_type(long) ident(beg)operator(,) ident(len)operator(;) -operator({) - ident(VALUE) ident(klass)operator(,) ident(ary2)operator(,) ident(shared)operator(;) - ident(VALUE) operator(*)ident(ptr)operator(;) - - reserved(if) operator(()ident(beg) operator(>) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(beg) operator(<) integer(0) operator(||) ident(len) operator(<) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(<) ident(len) operator(||) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(<) ident(beg) operator(+) ident(len)operator(\)) operator({) - ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(-) ident(beg)operator(;) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) - ident(len) operator(=) integer(0)operator(;) - operator(}) - ident(klass) operator(=) ident(rb_obj_class)operator(()ident(ary)operator(\);) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(ary_new)operator(()ident(klass)operator(,) integer(0)operator(\);) - - ident(shared) operator(=) ident(ary_make_shared)operator(()ident(ary)operator(\);) - ident(ptr) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(;) - ident(ary2) operator(=) ident(ary_alloc)operator(()ident(klass)operator(\);) - ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(ptr) operator(=) ident(ptr) operator(+) ident(beg)operator(;) - ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len) operator(=) ident(len)operator(;) - ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(aux)operator(.)ident(shared) operator(=) ident(shared)operator(;) - ident(FL_SET)operator(()ident(ary2)operator(,) ident(ELTS_SHARED)operator(\);) - - reserved(return) ident(ary2)operator(;) -operator(}) - -comment(/* - * call-seq: - * array[index] -> obj or nil - * array[start, length] -> an_array or nil - * array[range] -> an_array or nil - * array.slice(index\) -> obj or nil - * array.slice(start, length\) -> an_array or nil - * array.slice(range\) -> an_array or nil - * - * Element Reference---Returns the element at _index_, - * or returns a subarray starting at _start_ and - * continuing for _length_ elements, or returns a subarray - * specified by _range_. - * Negative indices count backward from the end of the - * array (-1 is the last element\). Returns nil if the index - * (or starting index\) are out of range. - * - * a = [ "a", "b", "c", "d", "e" ] - * a[2] + a[0] + a[1] #=> "cab" - * a[6] #=> nil - * a[1, 2] #=> [ "b", "c" ] - * a[1..3] #=> [ "b", "c", "d" ] - * a[4..7] #=> [ "e" ] - * a[6..10] #=> nil - * a[-3, 3] #=> [ "c", "d", "e" ] - * # special cases - * a[5] #=> nil - * a[5, 1] #=> [] - * a[5..10] #=> [] - * - */) - -ident(VALUE) -ident(rb_ary_aref)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) ident(arg)operator(;) - pre_type(long) ident(beg)operator(,) ident(len)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(2)operator(\)) operator({) - reserved(if) operator(()ident(SYMBOL_P)operator(()ident(argv)operator([)integer(0)operator(]\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(beg) operator(=) ident(NUM2LONG)operator(()ident(argv)operator([)integer(0)operator(]\);) - ident(len) operator(=) ident(NUM2LONG)operator(()ident(argv)operator([)integer(1)operator(]\);) - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) operator({) - ident(beg) operator(+=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - operator(}) - reserved(return) ident(rb_ary_subseq)operator(()ident(ary)operator(,) ident(beg)operator(,) ident(len)operator(\);) - operator(}) - reserved(if) operator(()ident(argc) operator(!=) integer(1)operator(\)) operator({) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - ident(arg) operator(=) ident(argv)operator([)integer(0)operator(];) - comment(/* special case - speeding up */) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(arg)operator(\)\)) operator({) - reserved(return) ident(rb_ary_entry)operator(()ident(ary)operator(,) ident(FIX2LONG)operator(()ident(arg)operator(\)\);) - operator(}) - reserved(if) operator(()ident(SYMBOL_P)operator(()ident(arg)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - comment(/* check if idx is Range */) - reserved(switch) operator(()ident(rb_range_beg_len)operator(()ident(arg)operator(,) operator(&)ident(beg)operator(,) operator(&)ident(len)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) integer(0)operator(\)\)) operator({) - reserved(case) ident(Qfalse)operator(:) - reserved(break)operator(;) - reserved(case) ident(Qnil)operator(:) - reserved(return) ident(Qnil)operator(;) - reserved(default)operator(:) - reserved(return) ident(rb_ary_subseq)operator(()ident(ary)operator(,) ident(beg)operator(,) ident(len)operator(\);) - operator(}) - reserved(return) ident(rb_ary_entry)operator(()ident(ary)operator(,) ident(NUM2LONG)operator(()ident(arg)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * array.at(index\) -> obj or nil - * - * Returns the element at _index_. A - * negative index counts from the end of _self_. Returns +nil+ - * if the index is out of range. See also Array#[]. - * (Array#at is slightly faster than Array#[], - * as it does not accept ranges and so on.\) - * - * a = [ "a", "b", "c", "d", "e" ] - * a.at(0\) #=> "a" - * a.at(-1\) #=> "e" - */) - -directive(static) ident(VALUE) -ident(rb_ary_at)operator(()ident(ary)operator(,) ident(pos)operator(\)) - ident(VALUE) ident(ary)operator(,) ident(pos)operator(;) -operator({) - reserved(return) ident(rb_ary_entry)operator(()ident(ary)operator(,) ident(NUM2LONG)operator(()ident(pos)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * array.first -> obj or nil - * array.first(n\) -> an_array - * - * Returns the first element, or the first +n+ elements, of the array. - * If the array is empty, the first form returns nil, and the - * second form returns an empty array. - * - * a = [ "q", "r", "s", "t" ] - * a.first #=> "q" - * a.first(1\) #=> ["q"] - * a.first(3\) #=> ["q", "r", "s"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_first)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(nv)operator(,) ident(result)operator(;) - pre_type(long) ident(n)operator(,) ident(i)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(nv)operator(\);) - ident(n) operator(=) ident(NUM2LONG)operator(()ident(nv)operator(\);) - reserved(if) operator(()ident(n) operator(>) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) ident(n) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - ident(result) operator(=) ident(rb_ary_new2)operator(()ident(n)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(n)operator(;) ident(i)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - operator(}) - reserved(return) ident(result)operator(;) - operator(}) -operator(}) - -comment(/* - * call-seq: - * array.last -> obj or nil - * array.last(n\) -> an_array - * - * Returns the last element(s\) of self. If the array is empty, - * the first form returns nil. - * - * [ "w", "x", "y", "z" ].last #=> "z" - */) - -directive(static) ident(VALUE) -ident(rb_ary_last)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(-)integer(1)operator(];) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(nv)operator(,) ident(result)operator(;) - pre_type(long) ident(n)operator(,) ident(i)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(nv)operator(\);) - ident(n) operator(=) ident(NUM2LONG)operator(()ident(nv)operator(\);) - reserved(if) operator(()ident(n) operator(>) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) ident(n) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - ident(result) operator(=) ident(rb_ary_new2)operator(()ident(n)operator(\);) - reserved(for) operator(()ident(i)operator(=)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(-)ident(n)operator(;) ident(n)operator(--;) ident(i)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - operator(}) - reserved(return) ident(result)operator(;) - operator(}) -operator(}) - -comment(/* - * call-seq: - * array.fetch(index\) -> obj - * array.fetch(index, default \) -> obj - * array.fetch(index\) {|index| block } -> obj - * - * Tries to return the element at position index. If the index - * lies outside the array, the first form throws an - * IndexError exception, the second form returns - * default, and the third form returns the value of invoking - * the block, passing in the index. Negative values of index - * count from the end of the array. - * - * a = [ 11, 22, 33, 44 ] - * a.fetch(1\) #=> 22 - * a.fetch(-1\) #=> 44 - * a.fetch(4, 'cat'\) #=> "cat" - * a.fetch(4\) { |i| i*i } #=> 16 - */) - -directive(static) ident(VALUE) -ident(rb_ary_fetch)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) ident(pos)operator(,) ident(ifnone)operator(;) - pre_type(long) ident(block_given)operator(;) - pre_type(long) ident(idx)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(pos)operator(,) operator(&)ident(ifnone)operator(\);) - ident(block_given) operator(=) ident(rb_block_given_p)operator((\);) - reserved(if) operator(()ident(block_given) operator(&&) ident(argc) operator(==) integer(2)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - ident(idx) operator(=) ident(NUM2LONG)operator(()ident(pos)operator(\);) - - reserved(if) operator(()ident(idx) operator(<) integer(0)operator(\)) operator({) - ident(idx) operator(+=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - operator(}) - reserved(if) operator(()ident(idx) operator(<) integer(0) operator(||) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(<=) ident(idx)operator(\)) operator({) - reserved(if) operator(()ident(block_given)operator(\)) reserved(return) ident(rb_yield)operator(()ident(pos)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(idx)operator(\);) - operator(}) - reserved(return) ident(ifnone)operator(;) - operator(}) - reserved(return) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(idx)operator(];) -operator(}) - -comment(/* - * call-seq: - * array.index(obj\) -> int or nil - * - * Returns the index of the first object in self such that is - * == to obj. Returns nil if - * no match is found. - * - * a = [ "a", "b", "c" ] - * a.index("b"\) #=> 1 - * a.index("z"\) #=> nil - */) - -directive(static) ident(VALUE) -ident(rb_ary_index)operator(()ident(ary)operator(,) ident(val)operator(\)) - ident(VALUE) ident(ary)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(rb_equal)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(val)operator(\)\)) - reserved(return) ident(LONG2NUM)operator(()ident(i)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.rindex(obj\) -> int or nil - * - * Returns the index of the last object in array - * == to obj. Returns nil if - * no match is found. - * - * a = [ "a", "b", "b", "b", "c" ] - * a.rindex("b"\) #=> 3 - * a.rindex("z"\) #=> nil - */) - -directive(static) ident(VALUE) -ident(rb_ary_rindex)operator(()ident(ary)operator(,) ident(val)operator(\)) - ident(VALUE) ident(ary)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - pre_type(long) ident(i) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - - reserved(while) operator(()ident(i)operator(--\)) operator({) - reserved(if) operator(()ident(i) operator(>) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) operator({) - ident(i) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(if) operator(()ident(rb_equal)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(val)operator(\)\)) - reserved(return) ident(LONG2NUM)operator(()ident(i)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.indexes( i1, i2, ... iN \) -> an_array - * array.indices( i1, i2, ... iN \) -> an_array - * - * Deprecated; use Array#values_at. - */) - -directive(static) ident(VALUE) -ident(rb_ary_indexes)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) ident(new_ary)operator(;) - pre_type(long) ident(i)operator(;) - - ident(rb_warn)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(rb_frame_last_func)operator((\)\)\);) - ident(new_ary) operator(=) ident(rb_ary_new2)operator(()ident(argc)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(new_ary)operator(,) ident(rb_ary_aref)operator(()integer(1)operator(,) ident(argv)operator(+)ident(i)operator(,) ident(ary)operator(\)\);) - operator(}) - - reserved(return) ident(new_ary)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ary_to_ary)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(obj)operator(\)) operator(==) ident(T_ARRAY)operator(\)) operator({) - reserved(return) ident(obj)operator(;) - operator(}) - reserved(if) operator(()ident(rb_respond_to)operator(()ident(obj)operator(,) ident(rb_intern)operator(()stringoperator(\)\)\)) operator({) - reserved(return) ident(rb_convert_type)operator(()ident(obj)operator(,) ident(T_ARRAY)operator(,) stringoperator(,) stringoperator(\);) - operator(}) - reserved(return) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(obj)operator(\);) -operator(}) - -directive(static) directive(void) -ident(rb_ary_splice)operator(()ident(ary)operator(,) ident(beg)operator(,) ident(len)operator(,) ident(rpl)operator(\)) - ident(VALUE) ident(ary)operator(;) - pre_type(long) ident(beg)operator(,) ident(len)operator(;) - ident(VALUE) ident(rpl)operator(;) -operator({) - pre_type(long) ident(rlen)operator(;) - - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(len)operator(\);) - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) operator({) - ident(beg) operator(+=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) operator({) - ident(beg) operator(-=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(beg)operator(\);) - operator(}) - operator(}) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(<) ident(len) operator(||) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(<) ident(beg) operator(+) ident(len)operator(\)) operator({) - ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(-) ident(beg)operator(;) - operator(}) - - reserved(if) operator(()ident(NIL_P)operator(()ident(rpl)operator(\)\)) operator({) - ident(rlen) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(rpl) operator(=) ident(rb_ary_to_ary)operator(()ident(rpl)operator(\);) - ident(rlen) operator(=) ident(RARRAY)operator(()ident(rpl)operator(\)->)ident(len)operator(;) - operator(}) - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - - reserved(if) operator(()ident(beg) operator(>=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) operator({) - reserved(if) operator(()ident(beg) operator(>) ident(ARY_MAX_SIZE) operator(-) ident(rlen)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(beg)operator(\);) - operator(}) - ident(len) operator(=) ident(beg) operator(+) ident(rlen)operator(;) - reserved(if) operator(()ident(len) operator(>=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa)operator(\)) operator({) - ident(REALLOC_N)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(len)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(len)operator(;) - operator(}) - ident(rb_mem_clear)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(+) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) ident(beg) operator(-) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - reserved(if) operator(()ident(rlen) operator(>) integer(0)operator(\)) operator({) - ident(MEMCPY)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(+) ident(beg)operator(,) ident(RARRAY)operator(()ident(rpl)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(rlen)operator(\);) - operator(}) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(len)operator(;) - operator(}) - reserved(else) operator({) - pre_type(long) ident(alen)operator(;) - - reserved(if) operator(()ident(beg) operator(+) ident(len) operator(>) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) operator({) - ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(-) ident(beg)operator(;) - operator(}) - - ident(alen) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(+) ident(rlen) operator(-) ident(len)operator(;) - reserved(if) operator(()ident(alen) operator(>=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa)operator(\)) operator({) - ident(REALLOC_N)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(alen)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(alen)operator(;) - operator(}) - - reserved(if) operator(()ident(len) operator(!=) ident(rlen)operator(\)) operator({) - ident(MEMMOVE)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(+) ident(beg) operator(+) ident(rlen)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(+) ident(beg) operator(+) ident(len)operator(,) - ident(VALUE)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(-) operator(()ident(beg) operator(+) ident(len)operator(\)\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(alen)operator(;) - operator(}) - reserved(if) operator(()ident(rlen) operator(>) integer(0)operator(\)) operator({) - ident(MEMMOVE)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(+) ident(beg)operator(,) ident(RARRAY)operator(()ident(rpl)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(rlen)operator(\);) - operator(}) - operator(}) -operator(}) - -comment(/* - * call-seq: - * array[index] = obj -> obj - * array[start, length] = obj or an_array or nil -> obj or an_array or nil - * array[range] = obj or an_array or nil -> obj or an_array or nil - * - * Element Assignment---Sets the element at _index_, - * or replaces a subarray starting at _start_ and - * continuing for _length_ elements, or replaces a subarray - * specified by _range_. If indices are greater than - * the current capacity of the array, the array grows - * automatically. A negative indices will count backward - * from the end of the array. Inserts elements if _length_ is - * zero. If +nil+ is used in the second and third form, - * deletes elements from _self_. An +IndexError+ is raised if a - * negative index points past the beginning of the array. See also - * Array#push, and Array#unshift. - * - * a = Array.new - * a[4] = "4"; #=> [nil, nil, nil, nil, "4"] - * a[0, 3] = [ 'a', 'b', 'c' ] #=> ["a", "b", "c", nil, "4"] - * a[1..2] = [ 1, 2 ] #=> ["a", 1, 2, nil, "4"] - * a[0, 2] = "?" #=> ["?", 2, nil, "4"] - * a[0..2] = "A" #=> ["A", "4"] - * a[-1] = "Z" #=> ["A", "Z"] - * a[1..-1] = nil #=> ["A"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_aset)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(offset)operator(,) ident(beg)operator(,) ident(len)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(3)operator(\)) operator({) - reserved(if) operator(()ident(SYMBOL_P)operator(()ident(argv)operator([)integer(0)operator(]\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(SYMBOL_P)operator(()ident(argv)operator([)integer(1)operator(]\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(rb_ary_splice)operator(()ident(ary)operator(,) ident(NUM2LONG)operator(()ident(argv)operator([)integer(0)operator(]\),) ident(NUM2LONG)operator(()ident(argv)operator([)integer(1)operator(]\),) ident(argv)operator([)integer(2)operator(]\);) - reserved(return) ident(argv)operator([)integer(2)operator(];) - operator(}) - reserved(if) operator(()ident(argc) operator(!=) integer(2)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(argv)operator([)integer(0)operator(]\)\)) operator({) - ident(offset) operator(=) ident(FIX2LONG)operator(()ident(argv)operator([)integer(0)operator(]\);) - reserved(goto) ident(fixnum)operator(;) - operator(}) - reserved(if) operator(()ident(SYMBOL_P)operator(()ident(argv)operator([)integer(0)operator(]\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(rb_range_beg_len)operator(()ident(argv)operator([)integer(0)operator(],) operator(&)ident(beg)operator(,) operator(&)ident(len)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) integer(1)operator(\)\)) operator({) - comment(/* check if idx is Range */) - ident(rb_ary_splice)operator(()ident(ary)operator(,) ident(beg)operator(,) ident(len)operator(,) ident(argv)operator([)integer(1)operator(]\);) - reserved(return) ident(argv)operator([)integer(1)operator(];) - operator(}) - - ident(offset) operator(=) ident(NUM2LONG)operator(()ident(argv)operator([)integer(0)operator(]\);) -label(fixnum:) - ident(rb_ary_store)operator(()ident(ary)operator(,) ident(offset)operator(,) ident(argv)operator([)integer(1)operator(]\);) - reserved(return) ident(argv)operator([)integer(1)operator(];) -operator(}) - -comment(/* - * call-seq: - * array.insert(index, obj...\) -> array - * - * Inserts the given values before the element with the given index - * (which may be negative\). - * - * a = %w{ a b c d } - * a.insert(2, 99\) #=> ["a", "b", 99, "c", "d"] - * a.insert(-2, 1, 2, 3\) #=> ["a", "b", 99, "c", 1, 2, 3, "d"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_insert)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(pos)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) reserved(return) ident(ary)operator(;) - reserved(if) operator(()ident(argc) operator(<) integer(1)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(pos) operator(=) ident(NUM2LONG)operator(()ident(argv)operator([)integer(0)operator(]\);) - reserved(if) operator(()ident(pos) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(pos) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - operator(}) - reserved(if) operator(()ident(pos) operator(<) integer(0)operator(\)) operator({) - ident(pos)operator(++;) - operator(}) - ident(rb_ary_splice)operator(()ident(ary)operator(,) ident(pos)operator(,) integer(0)operator(,) ident(rb_ary_new4)operator(()ident(argc) operator(-) integer(1)operator(,) ident(argv) operator(+) integer(1)operator(\)\);) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.each {|item| block } -> array - * - * Calls block once for each element in self, passing that - * element as a parameter. - * - * a = [ "a", "b", "c" ] - * a.each {|x| print x, " -- " } - * - * produces: - * - * a -- b -- c -- - */) - -ident(VALUE) -ident(rb_ary_each)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_yield)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.each_index {|index| block } -> array - * - * Same as Array#each, but passes the index of the element - * instead of the element itself. - * - * a = [ "a", "b", "c" ] - * a.each_index {|x| print x, " -- " } - * - * produces: - * - * 0 -- 1 -- 2 -- - */) - -directive(static) ident(VALUE) -ident(rb_ary_each_index)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_yield)operator(()ident(LONG2NUM)operator(()ident(i)operator(\)\);) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.reverse_each {|item| block } - * - * Same as Array#each, but traverses self in reverse - * order. - * - * a = [ "a", "b", "c" ] - * a.reverse_each {|x| print x, " " } - * - * produces: - * - * c b a - */) - -directive(static) ident(VALUE) -ident(rb_ary_reverse_each)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(rb_yield)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(len)operator(]\);) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(<) ident(len)operator(\)) operator({) - ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - operator(}) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.length -> int - * - * Returns the number of elements in self. May be zero. - * - * [ 1, 2, 3, 4, 5 ].length #=> 5 - */) - -directive(static) ident(VALUE) -ident(rb_ary_length)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(LONG2NUM)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) -operator(}) - -comment(/* - * call-seq: - * array.empty? -> true or false - * - * Returns true if self array contains no elements. - * - * [].empty? #=> true - */) - -directive(static) ident(VALUE) -ident(rb_ary_empty_p)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) integer(0)operator(\)) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ary_dup)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) ident(dup) operator(=) ident(rb_ary_new2)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - - ident(DUPSETUP)operator(()ident(dup)operator(,) ident(ary)operator(\);) - ident(MEMCPY)operator(()ident(RARRAY)operator(()ident(dup)operator(\)->)ident(ptr)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - ident(RARRAY)operator(()ident(dup)operator(\)->)ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - reserved(return) ident(dup)operator(;) -operator(}) - -directive(extern) ident(VALUE) ident(rb_output_fs)operator(;) - -directive(static) ident(VALUE) -ident(inspect_join)operator(()ident(ary)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(ary)operator(;) - ident(VALUE) operator(*)ident(arg)operator(;) -operator({) - reserved(return) ident(rb_ary_join)operator(()ident(arg)operator([)integer(0)operator(],) ident(arg)operator([)integer(1)operator(]\);) -operator(}) - -ident(VALUE) -ident(rb_ary_join)operator(()ident(ary)operator(,) ident(sep)operator(\)) - ident(VALUE) ident(ary)operator(,) ident(sep)operator(;) -operator({) - pre_type(long) ident(len) operator(=) integer(1)operator(,) ident(i)operator(;) - pre_type(int) ident(taint) operator(=) ident(Qfalse)operator(;) - ident(VALUE) ident(result)operator(,) ident(tmp)operator(;) - - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(ary)operator(\)) operator(||) ident(OBJ_TAINTED)operator(()ident(sep)operator(\)\)) ident(taint) operator(=) ident(Qtrue)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(tmp) operator(=) ident(rb_check_string_type)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - ident(len) operator(+=) ident(NIL_P)operator(()ident(tmp)operator(\)) operator(?) integer(10) operator(:) ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(len)operator(;) - operator(}) - reserved(if) operator((!)ident(NIL_P)operator(()ident(sep)operator(\)\)) operator({) - ident(StringValue)operator(()ident(sep)operator(\);) - ident(len) operator(+=) ident(RSTRING)operator(()ident(sep)operator(\)->)ident(len) operator(*) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(-) integer(1)operator(\);) - operator(}) - ident(result) operator(=) ident(rb_str_buf_new)operator(()ident(len)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(tmp) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - reserved(switch) operator(()ident(TYPE)operator(()ident(tmp)operator(\)\)) operator({) - reserved(case) ident(T_STRING)operator(:) - reserved(break)operator(;) - reserved(case) ident(T_ARRAY)operator(:) - reserved(if) operator(()ident(tmp) operator(==) ident(ary) operator(||) ident(rb_inspecting_p)operator(()ident(tmp)operator(\)\)) operator({) - ident(tmp) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(args)operator([)integer(2)operator(];) - - ident(args)operator([)integer(0)operator(]) operator(=) ident(tmp)operator(;) - ident(args)operator([)integer(1)operator(]) operator(=) ident(sep)operator(;) - ident(tmp) operator(=) ident(rb_protect_inspect)operator(()ident(inspect_join)operator(,) ident(ary)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(\);) - operator(}) - reserved(break)operator(;) - reserved(default)operator(:) - ident(tmp) operator(=) ident(rb_obj_as_string)operator(()ident(tmp)operator(\);) - operator(}) - reserved(if) operator(()ident(i) operator(>) integer(0) operator(&&) operator(!)ident(NIL_P)operator(()ident(sep)operator(\)\)) - ident(rb_str_buf_append)operator(()ident(result)operator(,) ident(sep)operator(\);) - ident(rb_str_buf_append)operator(()ident(result)operator(,) ident(tmp)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(tmp)operator(\)\)) ident(taint) operator(=) ident(Qtrue)operator(;) - operator(}) - - reserved(if) operator(()ident(taint)operator(\)) ident(OBJ_TAINT)operator(()ident(result)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.join(sep=$,\) -> str - * - * Returns a string created by converting each element of the array to - * a string, separated by sep. - * - * [ "a", "b", "c" ].join #=> "abc" - * [ "a", "b", "c" ].join("-"\) #=> "a-b-c" - */) - -directive(static) ident(VALUE) -ident(rb_ary_join_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) ident(sep)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(sep)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(sep)operator(\)\)) ident(sep) operator(=) ident(rb_output_fs)operator(;) - - reserved(return) ident(rb_ary_join)operator(()ident(ary)operator(,) ident(sep)operator(\);) -operator(}) - -comment(/* - * call-seq: - * array.to_s -> string - * - * Returns _self_.join. - * - * [ "a", "e", "i", "o" ].to_s #=> "aeio" - * - */) - -ident(VALUE) -ident(rb_ary_to_s)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\);) - - reserved(return) ident(rb_ary_join)operator(()ident(ary)operator(,) ident(rb_output_fs)operator(\);) -operator(}) - -directive(static) ident(ID) ident(inspect_key)operator(;) - -reserved(struct) ident(inspect_arg) operator({) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - ident(VALUE) ident(arg1)operator(,) ident(arg2)operator(;) -operator(};) - -directive(static) ident(VALUE) -ident(inspect_call)operator(()ident(arg)operator(\)) - reserved(struct) ident(inspect_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(return) operator((*)ident(arg)operator(->)ident(func)operator(\)()ident(arg)operator(->)ident(arg1)operator(,) ident(arg)operator(->)ident(arg2)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(get_inspect_tbl)operator(()ident(create)operator(\)) - pre_type(int) ident(create)operator(;) -operator({) - ident(VALUE) ident(inspect_tbl) operator(=) ident(rb_thread_local_aref)operator(()ident(rb_thread_current)operator((\),) ident(inspect_key)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(inspect_tbl)operator(\)\)) operator({) - reserved(if) operator(()ident(create)operator(\)) operator({) - label(tbl_init:) - ident(inspect_tbl) operator(=) ident(rb_ary_new)operator((\);) - ident(rb_thread_local_aset)operator(()ident(rb_thread_current)operator((\),) ident(inspect_key)operator(,) ident(inspect_tbl)operator(\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(TYPE)operator(()ident(inspect_tbl)operator(\)) operator(!=) ident(T_ARRAY)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - reserved(if) operator(()ident(create)operator(\)) reserved(goto) ident(tbl_init)operator(;) - ident(rb_thread_local_aset)operator(()ident(rb_thread_current)operator((\),) ident(inspect_key)operator(,) ident(Qnil)operator(\);) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(inspect_tbl)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(inspect_ensure)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(inspect_tbl)operator(;) - - ident(inspect_tbl) operator(=) ident(get_inspect_tbl)operator(()ident(Qfalse)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(inspect_tbl)operator(\)\)) operator({) - ident(rb_ary_pop)operator(()ident(inspect_tbl)operator(\);) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -ident(VALUE) -ident(rb_protect_inspect)operator(()ident(func)operator(,) ident(obj)operator(,) ident(arg)operator(\)) - ident(VALUE) operator((*)ident(func)operator(\)()ident(ANYARGS)operator(\);) - ident(VALUE) ident(obj)operator(,) ident(arg)operator(;) -operator({) - reserved(struct) ident(inspect_arg) ident(iarg)operator(;) - ident(VALUE) ident(inspect_tbl)operator(;) - ident(VALUE) ident(id)operator(;) - - ident(inspect_tbl) operator(=) ident(get_inspect_tbl)operator(()ident(Qtrue)operator(\);) - ident(id) operator(=) ident(rb_obj_id)operator(()ident(obj)operator(\);) - reserved(if) operator(()ident(rb_ary_includes)operator(()ident(inspect_tbl)operator(,) ident(id)operator(\)\)) operator({) - reserved(return) operator((*)ident(func)operator(\)()ident(obj)operator(,) ident(arg)operator(\);) - operator(}) - ident(rb_ary_push)operator(()ident(inspect_tbl)operator(,) ident(id)operator(\);) - ident(iarg)operator(.)ident(func) operator(=) ident(func)operator(;) - ident(iarg)operator(.)ident(arg1) operator(=) ident(obj)operator(;) - ident(iarg)operator(.)ident(arg2) operator(=) ident(arg)operator(;) - - reserved(return) ident(rb_ensure)operator(()ident(inspect_call)operator(,) operator(()ident(VALUE)operator(\)&)ident(iarg)operator(,) ident(inspect_ensure)operator(,) ident(obj)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_inspecting_p)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(inspect_tbl)operator(;) - - ident(inspect_tbl) operator(=) ident(get_inspect_tbl)operator(()ident(Qfalse)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(inspect_tbl)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(rb_ary_includes)operator(()ident(inspect_tbl)operator(,) ident(rb_obj_id)operator(()ident(obj)operator(\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(inspect_ary)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(int) ident(tainted) operator(=) ident(OBJ_TAINTED)operator(()ident(ary)operator(\);) - pre_type(long) ident(i)operator(;) - ident(VALUE) ident(s)operator(,) ident(str)operator(;) - - ident(str) operator(=) ident(rb_str_buf_new2)operator(()stringoperator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(s) operator(=) ident(rb_inspect)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(s)operator(\)\)) ident(tainted) operator(=) ident(Qtrue)operator(;) - reserved(if) operator(()ident(i) operator(>) integer(0)operator(\)) ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(s)operator(\);) - operator(}) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(if) operator(()ident(tainted)operator(\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.inspect -> string - * - * Create a printable version of array. - */) - -directive(static) ident(VALUE) -ident(rb_ary_inspect)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(if) operator(()ident(rb_inspecting_p)operator(()ident(ary)operator(\)\)) reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(return) ident(rb_protect_inspect)operator(()ident(inspect_ary)operator(,) ident(ary)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * array.to_a -> array - * - * Returns _self_. If called on a subclass of Array, converts - * the receiver to an Array object. - */) - -directive(static) ident(VALUE) -ident(rb_ary_to_a)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(rb_obj_class)operator(()ident(ary)operator(\)) operator(!=) ident(rb_cArray)operator(\)) operator({) - ident(VALUE) ident(dup) operator(=) ident(rb_ary_new2)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - ident(rb_ary_replace)operator(()ident(dup)operator(,) ident(ary)operator(\);) - reserved(return) ident(dup)operator(;) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.to_ary -> array - * - * Returns _self_. - */) - -directive(static) ident(VALUE) -ident(rb_ary_to_ary_m)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(ary)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ary_reverse)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) operator(*)ident(p1)operator(,) operator(*)ident(p2)operator(;) - ident(VALUE) ident(tmp)operator(;) - - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(>) integer(1)operator(\)) operator({) - ident(p1) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(;) - ident(p2) operator(=) ident(p1) operator(+) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(-) integer(1)operator(;) comment(/* points last item */) - - reserved(while) operator(()ident(p1) operator(<) ident(p2)operator(\)) operator({) - ident(tmp) operator(=) operator(*)ident(p1)operator(;) - operator(*)ident(p1)operator(++) operator(=) operator(*)ident(p2)operator(;) - operator(*)ident(p2)operator(--) operator(=) ident(tmp)operator(;) - operator(}) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.reverse! -> array - * - * Reverses _self_ in place. - * - * a = [ "a", "b", "c" ] - * a.reverse! #=> ["c", "b", "a"] - * a #=> ["c", "b", "a"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_reverse_bang)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(rb_ary_reverse)operator(()ident(ary)operator(\);) -operator(}) - -comment(/* - * call-seq: - * array.reverse -> an_array - * - * Returns a new array containing self's elements in reverse order. - * - * [ "a", "b", "c" ].reverse #=> ["c", "b", "a"] - * [ 1 ].reverse #=> [1] - */) - -directive(static) ident(VALUE) -ident(rb_ary_reverse_m)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(rb_ary_reverse)operator(()ident(rb_ary_dup)operator(()ident(ary)operator(\)\);) -operator(}) - -reserved(struct) ident(ary_sort_data) operator({) - ident(VALUE) ident(ary)operator(;) - ident(VALUE) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) -operator(};) - -directive(static) directive(void) -ident(ary_sort_check)operator(()ident(data)operator(\)) - reserved(struct) ident(ary_sort_data) operator(*)ident(data)operator(;) -operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(data)operator(->)ident(ary)operator(\)->)ident(ptr) operator(!=) ident(data)operator(->)ident(ptr) operator(||) ident(RARRAY)operator(()ident(data)operator(->)ident(ary)operator(\)->)ident(len) operator(!=) ident(data)operator(->)ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(sort_1)operator(()ident(a)operator(,) ident(b)operator(,) ident(data)operator(\)) - ident(VALUE) operator(*)ident(a)operator(,) operator(*)ident(b)operator(;) - reserved(struct) ident(ary_sort_data) operator(*)ident(data)operator(;) -operator({) - ident(VALUE) ident(retval) operator(=) ident(rb_yield_values)operator(()integer(2)operator(,) operator(*)ident(a)operator(,) operator(*)ident(b)operator(\);) - pre_type(int) ident(n)operator(;) - - ident(n) operator(=) ident(rb_cmpint)operator(()ident(retval)operator(,) operator(*)ident(a)operator(,) operator(*)ident(b)operator(\);) - ident(ary_sort_check)operator(()ident(data)operator(\);) - reserved(return) ident(n)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(sort_2)operator(()ident(ap)operator(,) ident(bp)operator(,) ident(data)operator(\)) - ident(VALUE) operator(*)ident(ap)operator(,) operator(*)ident(bp)operator(;) - reserved(struct) ident(ary_sort_data) operator(*)ident(data)operator(;) -operator({) - ident(VALUE) ident(retval)operator(;) - ident(VALUE) ident(a) operator(=) operator(*)ident(ap)operator(,) ident(b) operator(=) operator(*)ident(bp)operator(;) - pre_type(int) ident(n)operator(;) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(a)operator(\)) operator(&&) ident(FIXNUM_P)operator(()ident(b)operator(\)\)) operator({) - reserved(if) operator((()pre_type(long)operator(\))ident(a) operator(>) operator(()pre_type(long)operator(\))ident(b)operator(\)) reserved(return) integer(1)operator(;) - reserved(if) operator((()pre_type(long)operator(\))ident(a) operator(<) operator(()pre_type(long)operator(\))ident(b)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(return) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(a)operator(\)) operator(==) ident(T_STRING)operator(\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(b)operator(\)) operator(==) ident(T_STRING)operator(\)) reserved(return) ident(rb_str_cmp)operator(()ident(a)operator(,) ident(b)operator(\);) - operator(}) - - ident(retval) operator(=) ident(rb_funcall)operator(()ident(a)operator(,) ident(id_cmp)operator(,) integer(1)operator(,) ident(b)operator(\);) - ident(n) operator(=) ident(rb_cmpint)operator(()ident(retval)operator(,) ident(a)operator(,) ident(b)operator(\);) - ident(ary_sort_check)operator(()ident(data)operator(\);) - - reserved(return) ident(n)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(sort_internal)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(struct) ident(ary_sort_data) ident(data)operator(;) - - ident(data)operator(.)ident(ary) operator(=) ident(ary)operator(;) - ident(data)operator(.)ident(ptr) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(;) ident(data)operator(.)ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - ident(qsort)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) reserved(sizeof)operator(()ident(VALUE)operator(\),) - ident(rb_block_given_p)operator((\)?)ident(sort_1)operator(:)ident(sort_2)operator(,) operator(&)ident(data)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(sort_unlock)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(FL_UNSET)operator(()ident(ary)operator(,) ident(ARY_TMPLOCK)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.sort! -> array - * array.sort! {| a,b | block } -> array - * - * Sorts _self_. Comparisons for - * the sort will be done using the <=> operator or using - * an optional code block. The block implements a comparison between - * a and b, returning -1, 0, or +1. See also - * Enumerable#sort_by. - * - * a = [ "d", "a", "e", "c", "b" ] - * a.sort #=> ["a", "b", "c", "d", "e"] - * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"] - */) - -ident(VALUE) -ident(rb_ary_sort_bang)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(>) integer(1)operator(\)) operator({) - ident(FL_SET)operator(()ident(ary)operator(,) ident(ARY_TMPLOCK)operator(\);) comment(/* prohibit modification during sort */) - ident(rb_ensure)operator(()ident(sort_internal)operator(,) ident(ary)operator(,) ident(sort_unlock)operator(,) ident(ary)operator(\);) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.sort -> an_array - * array.sort {| a,b | block } -> an_array - * - * Returns a new array created by sorting self. Comparisons for - * the sort will be done using the <=> operator or using - * an optional code block. The block implements a comparison between - * a and b, returning -1, 0, or +1. See also - * Enumerable#sort_by. - * - * a = [ "d", "a", "e", "c", "b" ] - * a.sort #=> ["a", "b", "c", "d", "e"] - * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"] - */) - -ident(VALUE) -ident(rb_ary_sort)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(ary) operator(=) ident(rb_ary_dup)operator(()ident(ary)operator(\);) - ident(rb_ary_sort_bang)operator(()ident(ary)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.collect {|item| block } -> an_array - * array.map {|item| block } -> an_array - * - * Invokes block once for each element of self. Creates a - * new array containing the values returned by the block. - * See also Enumerable#collect. - * - * a = [ "a", "b", "c", "d" ] - * a.collect {|x| x + "!" } #=> ["a!", "b!", "c!", "d!"] - * a #=> ["a", "b", "c", "d"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_collect)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - ident(VALUE) ident(collect)operator(;) - - reserved(if) operator((!)ident(rb_block_given_p)operator((\)\)) operator({) - reserved(return) ident(rb_ary_new4)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(\);) - operator(}) - - ident(collect) operator(=) ident(rb_ary_new2)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(collect)operator(,) ident(rb_yield)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)\);) - operator(}) - reserved(return) ident(collect)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.collect! {|item| block } -> array - * array.map! {|item| block } -> array - * - * Invokes the block once for each element of _self_, replacing the - * element with the value returned by _block_. - * See also Enumerable#collect. - * - * a = [ "a", "b", "c", "d" ] - * a.collect! {|x| x + "!" } - * a #=> [ "a!", "b!", "c!", "d!" ] - */) - -directive(static) ident(VALUE) -ident(rb_ary_collect_bang)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_ary_store)operator(()ident(ary)operator(,) ident(i)operator(,) ident(rb_yield)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)\);) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -ident(VALUE) -ident(rb_values_at)operator(()ident(obj)operator(,) ident(olen)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(func)operator(\)) - ident(VALUE) ident(obj)operator(;) - pre_type(long) ident(olen)operator(;) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) operator((*)ident(func)operator(\)) ident(_)operator((()ident(VALUE)operator(,)pre_type(long)operator(\)\);) -operator({) - ident(VALUE) ident(result) operator(=) ident(rb_ary_new2)operator(()ident(argc)operator(\);) - pre_type(long) ident(beg)operator(,) ident(len)operator(,) ident(i)operator(,) ident(j)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(argv)operator([)ident(i)operator(]\)\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) operator((*)ident(func)operator(\)()ident(obj)operator(,) ident(FIX2LONG)operator(()ident(argv)operator([)ident(i)operator(]\)\)\);) - reserved(continue)operator(;) - operator(}) - comment(/* check if idx is Range */) - reserved(switch) operator(()ident(rb_range_beg_len)operator(()ident(argv)operator([)ident(i)operator(],) operator(&)ident(beg)operator(,) operator(&)ident(len)operator(,) ident(olen)operator(,) integer(0)operator(\)\)) operator({) - reserved(case) ident(Qfalse)operator(:) - reserved(break)operator(;) - reserved(case) ident(Qnil)operator(:) - reserved(continue)operator(;) - reserved(default)operator(:) - reserved(for) operator(()ident(j)operator(=)integer(0)operator(;) ident(j)operator(<)ident(len)operator(;) ident(j)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) operator((*)ident(func)operator(\)()ident(obj)operator(,) ident(j)operator(+)ident(beg)operator(\)\);) - operator(}) - reserved(continue)operator(;) - operator(}) - ident(rb_ary_push)operator(()ident(result)operator(,) operator((*)ident(func)operator(\)()ident(obj)operator(,) ident(NUM2LONG)operator(()ident(argv)operator([)ident(i)operator(]\)\)\);) - operator(}) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.values_at(selector,... \) -> an_array - * - * Returns an array containing the elements in - * _self_ corresponding to the given selector(s\). The selectors - * may be either integer indices or ranges. - * See also Array#select. - * - * a = %w{ a b c d e f } - * a.values_at(1, 3, 5\) - * a.values_at(1, 3, 5, 7\) - * a.values_at(-1, -3, -5, -7\) - * a.values_at(1..3, 2...5\) - */) - -directive(static) ident(VALUE) -ident(rb_ary_values_at)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(rb_values_at)operator(()ident(ary)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(rb_ary_entry)operator(\);) -operator(}) - -comment(/* - * call-seq: - * array.select {|item| block } -> an_array - * - * Invokes the block passing in successive elements from array, - * returning an array containing those elements for which the block - * returns a true value (equivalent to Enumerable#select\). - * - * a = %w{ a b c d e f } - * a.select {|v| v =~ /[aeiou]/} #=> ["a", "e"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_select)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) ident(result)operator(;) - pre_type(long) ident(i)operator(;) - - ident(result) operator(=) ident(rb_ary_new2)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)\)\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_ary_elt)operator(()ident(ary)operator(,) ident(i)operator(\)\);) - operator(}) - operator(}) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.delete(obj\) -> obj or nil - * array.delete(obj\) { block } -> obj or nil - * - * Deletes items from self that are equal to obj. If - * the item is not found, returns nil. If the optional - * code block is given, returns the result of block if the item - * is not found. - * - * a = [ "a", "b", "b", "b", "c" ] - * a.delete("b"\) #=> "b" - * a #=> ["a", "c"] - * a.delete("z"\) #=> nil - * a.delete("z"\) { "not found" } #=> "not found" - */) - -ident(VALUE) -ident(rb_ary_delete)operator(()ident(ary)operator(,) ident(item)operator(\)) - ident(VALUE) ident(ary)operator(;) - ident(VALUE) ident(item)operator(;) -operator({) - pre_type(long) ident(i1)operator(,) ident(i2)operator(;) - - reserved(for) operator(()ident(i1) operator(=) ident(i2) operator(=) integer(0)operator(;) ident(i1) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i1)operator(++\)) operator({) - ident(VALUE) ident(e) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i1)operator(];) - - reserved(if) operator(()ident(rb_equal)operator(()ident(e)operator(,) ident(item)operator(\)\)) reserved(continue)operator(;) - reserved(if) operator(()ident(i1) operator(!=) ident(i2)operator(\)) operator({) - ident(rb_ary_store)operator(()ident(ary)operator(,) ident(i2)operator(,) ident(e)operator(\);) - operator(}) - ident(i2)operator(++;) - operator(}) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) ident(i2)operator(\)) operator({) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - reserved(return) ident(rb_yield)operator(()ident(item)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) - operator(}) - - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(>) ident(i2)operator(\)) operator({) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(i2)operator(;) - reserved(if) operator(()ident(i2) operator(*) integer(2) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(&&) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(>) ident(ARY_DEFAULT_SIZE)operator(\)) operator({) - ident(REALLOC_N)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(i2) operator(*) integer(2)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(i2) operator(*) integer(2)operator(;) - operator(}) - operator(}) - - reserved(return) ident(item)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ary_delete_at)operator(()ident(ary)operator(,) ident(pos)operator(\)) - ident(VALUE) ident(ary)operator(;) - pre_type(long) ident(pos)operator(;) -operator({) - pre_type(long) ident(i)operator(,) ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - ident(VALUE) ident(del)operator(;) - - reserved(if) operator(()ident(pos) operator(>=) ident(len)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(pos) operator(<) integer(0)operator(\)) operator({) - ident(pos) operator(+=) ident(len)operator(;) - reserved(if) operator(()ident(pos) operator(<) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - operator(}) - - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - ident(del) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(pos)operator(];) - reserved(for) operator(()ident(i) operator(=) ident(pos) operator(+) integer(1)operator(;) ident(i) operator(<) ident(len)operator(;) ident(i)operator(++,) ident(pos)operator(++\)) operator({) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(pos)operator(]) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - operator(}) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(pos)operator(;) - - reserved(return) ident(del)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.delete_at(index\) -> obj or nil - * - * Deletes the element at the specified index, returning that element, - * or nil if the index is out of range. See also - * Array#slice!. - * - * a = %w( ant bat cat dog \) - * a.delete_at(2\) #=> "cat" - * a #=> ["ant", "bat", "dog"] - * a.delete_at(99\) #=> nil - */) - -directive(static) ident(VALUE) -ident(rb_ary_delete_at_m)operator(()ident(ary)operator(,) ident(pos)operator(\)) - ident(VALUE) ident(ary)operator(,) ident(pos)operator(;) -operator({) - reserved(return) ident(rb_ary_delete_at)operator(()ident(ary)operator(,) ident(NUM2LONG)operator(()ident(pos)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * array.slice!(index\) -> obj or nil - * array.slice!(start, length\) -> sub_array or nil - * array.slice!(range\) -> sub_array or nil - * - * Deletes the element(s\) given by an index (optionally with a length\) - * or by a range. Returns the deleted object, subarray, or - * nil if the index is out of range. Equivalent to: - * - * def slice!(*args\) - * result = self[*args] - * self[*args] = nil - * result - * end - * - * a = [ "a", "b", "c" ] - * a.slice!(1\) #=> "b" - * a #=> ["a", "c"] - * a.slice!(-1\) #=> "c" - * a #=> ["a"] - * a.slice!(100\) #=> nil - * a #=> ["a"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_slice_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) ident(arg1)operator(,) ident(arg2)operator(;) - pre_type(long) ident(pos)operator(,) ident(len)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(arg1)operator(,) operator(&)ident(arg2)operator(\)) operator(==) integer(2)operator(\)) operator({) - ident(pos) operator(=) ident(NUM2LONG)operator(()ident(arg1)operator(\);) - ident(len) operator(=) ident(NUM2LONG)operator(()ident(arg2)operator(\);) - label(delete_pos_len:) - reserved(if) operator(()ident(pos) operator(<) integer(0)operator(\)) operator({) - ident(pos) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(+) ident(pos)operator(;) - operator(}) - ident(arg2) operator(=) ident(rb_ary_subseq)operator(()ident(ary)operator(,) ident(pos)operator(,) ident(len)operator(\);) - ident(rb_ary_splice)operator(()ident(ary)operator(,) ident(pos)operator(,) ident(len)operator(,) ident(Qnil)operator(\);) comment(/* Qnil/rb_ary_new2(0\) */) - reserved(return) ident(arg2)operator(;) - operator(}) - - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(arg1)operator(\)) operator(&&) ident(rb_range_beg_len)operator(()ident(arg1)operator(,) operator(&)ident(pos)operator(,) operator(&)ident(len)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) integer(1)operator(\)\)) operator({) - reserved(goto) ident(delete_pos_len)operator(;) - operator(}) - - reserved(return) ident(rb_ary_delete_at)operator(()ident(ary)operator(,) ident(NUM2LONG)operator(()ident(arg1)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * array.reject! {|item| block } -> array or nil - * - * Equivalent to Array#delete_if, deleting elements from - * _self_ for which the block evaluates to true, but returns - * nil if no changes were made. Also see - * Enumerable#reject. - */) - -directive(static) ident(VALUE) -ident(rb_ary_reject_bang)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(i1)operator(,) ident(i2)operator(;) - - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - reserved(for) operator(()ident(i1) operator(=) ident(i2) operator(=) integer(0)operator(;) ident(i1) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i1)operator(++\)) operator({) - ident(VALUE) ident(v) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i1)operator(];) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield)operator(()ident(v)operator(\)\)\)) reserved(continue)operator(;) - reserved(if) operator(()ident(i1) operator(!=) ident(i2)operator(\)) operator({) - ident(rb_ary_store)operator(()ident(ary)operator(,) ident(i2)operator(,) ident(v)operator(\);) - operator(}) - ident(i2)operator(++;) - operator(}) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) ident(i2)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(i2) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(i2)operator(;) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.reject {|item| block } -> an_array - * - * Returns a new array containing the items in _self_ - * for which the block is not true. - */) - -directive(static) ident(VALUE) -ident(rb_ary_reject)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(ary) operator(=) ident(rb_ary_dup)operator(()ident(ary)operator(\);) - ident(rb_ary_reject_bang)operator(()ident(ary)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.delete_if {|item| block } -> array - * - * Deletes every element of self for which block evaluates - * to true. - * - * a = [ "a", "b", "c" ] - * a.delete_if {|x| x >= "b" } #=> ["a"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_delete_if)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(rb_ary_reject_bang)operator(()ident(ary)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.zip(arg, ...\) -> an_array - * array.zip(arg, ...\) {| arr | block } -> nil - * - * Converts any arguments to arrays, then merges elements of - * self with corresponding elements from each argument. This - * generates a sequence of self.size n-element - * arrays, where n is one more that the count of arguments. If - * the size of any argument is less than enumObj.size, - * nil values are supplied. If a block given, it is - * invoked for each output array, otherwise an array of arrays is - * returned. - * - * a = [ 4, 5, 6 ] - * b = [ 7, 8, 9 ] - * - * [1,2,3].zip(a, b\) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]] - * [1,2].zip(a,b\) #=> [[1, 4, 7], [2, 5, 8]] - * a.zip([1,2],[8]\) #=> [[4,1,8], [5,2,nil], [6,nil,nil]] - */) - -directive(static) ident(VALUE) -ident(rb_ary_zip)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(int) ident(i)operator(,) ident(j)operator(;) - pre_type(long) ident(len)operator(;) - ident(VALUE) ident(result)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(argv)operator([)ident(i)operator(]) operator(=) ident(to_ary)operator(()ident(argv)operator([)ident(i)operator(]\);) - operator(}) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(tmp) operator(=) ident(rb_ary_new2)operator(()ident(argc)operator(+)integer(1)operator(\);) - - ident(rb_ary_push)operator(()ident(tmp)operator(,) ident(rb_ary_elt)operator(()ident(ary)operator(,) ident(i)operator(\)\);) - reserved(for) operator(()ident(j)operator(=)integer(0)operator(;) ident(j)operator(<)ident(argc)operator(;) ident(j)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(tmp)operator(,) ident(rb_ary_elt)operator(()ident(argv)operator([)ident(j)operator(],) ident(i)operator(\)\);) - operator(}) - ident(rb_yield)operator(()ident(tmp)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) - operator(}) - ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - ident(result) operator(=) ident(rb_ary_new2)operator(()ident(len)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(tmp) operator(=) ident(rb_ary_new2)operator(()ident(argc)operator(+)integer(1)operator(\);) - - ident(rb_ary_push)operator(()ident(tmp)operator(,) ident(rb_ary_elt)operator(()ident(ary)operator(,) ident(i)operator(\)\);) - reserved(for) operator(()ident(j)operator(=)integer(0)operator(;) ident(j)operator(<)ident(argc)operator(;) ident(j)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(tmp)operator(,) ident(rb_ary_elt)operator(()ident(argv)operator([)ident(j)operator(],) ident(i)operator(\)\);) - operator(}) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(tmp)operator(\);) - operator(}) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.transpose -> an_array - * - * Assumes that self is an array of arrays and transposes the - * rows and columns. - * - * a = [[1,2], [3,4], [5,6]] - * a.transpose #=> [[1, 3, 5], [2, 4, 6]] - */) - -directive(static) ident(VALUE) -ident(rb_ary_transpose)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(elen) operator(=) operator(-)integer(1)operator(,) ident(alen)operator(,) ident(i)operator(,) ident(j)operator(;) - ident(VALUE) ident(tmp)operator(,) ident(result) operator(=) integer(0)operator(;) - - ident(alen) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(alen) operator(==) integer(0)operator(\)) reserved(return) ident(rb_ary_dup)operator(()ident(ary)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(alen)operator(;) ident(i)operator(++\)) operator({) - ident(tmp) operator(=) ident(to_ary)operator(()ident(rb_ary_elt)operator(()ident(ary)operator(,) ident(i)operator(\)\);) - reserved(if) operator(()ident(elen) operator(<) integer(0)operator(\)) operator({) comment(/* first element */) - ident(elen) operator(=) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len)operator(;) - ident(result) operator(=) ident(rb_ary_new2)operator(()ident(elen)operator(\);) - reserved(for) operator(()ident(j)operator(=)integer(0)operator(;) ident(j)operator(<)ident(elen)operator(;) ident(j)operator(++\)) operator({) - ident(rb_ary_store)operator(()ident(result)operator(,) ident(j)operator(,) ident(rb_ary_new2)operator(()ident(alen)operator(\)\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(elen) operator(!=) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) - ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len)operator(,) ident(elen)operator(\);) - operator(}) - reserved(for) operator(()ident(j)operator(=)integer(0)operator(;) ident(j)operator(<)ident(elen)operator(;) ident(j)operator(++\)) operator({) - ident(rb_ary_store)operator(()ident(rb_ary_elt)operator(()ident(result)operator(,) ident(j)operator(\),) ident(i)operator(,) ident(rb_ary_elt)operator(()ident(tmp)operator(,) ident(j)operator(\)\);) - operator(}) - operator(}) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.replace(other_array\) -> array - * - * Replaces the contents of self with the contents of - * other_array, truncating or expanding if necessary. - * - * a = [ "a", "b", "c", "d", "e" ] - * a.replace([ "x", "y", "z" ]\) #=> ["x", "y", "z"] - * a #=> ["x", "y", "z"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_replace)operator(()ident(copy)operator(,) ident(orig)operator(\)) - ident(VALUE) ident(copy)operator(,) ident(orig)operator(;) -operator({) - ident(VALUE) ident(shared)operator(;) - - ident(rb_ary_modify)operator(()ident(copy)operator(\);) - ident(orig) operator(=) ident(to_ary)operator(()ident(orig)operator(\);) - reserved(if) operator(()ident(copy) operator(==) ident(orig)operator(\)) reserved(return) ident(copy)operator(;) - ident(shared) operator(=) ident(ary_make_shared)operator(()ident(orig)operator(\);) - reserved(if) operator(()ident(RARRAY)operator(()ident(copy)operator(\)->)ident(ptr) operator(&&) operator(!)ident(FL_TEST)operator(()ident(copy)operator(,) ident(ELTS_SHARED)operator(\)\)) - ident(free)operator(()ident(RARRAY)operator(()ident(copy)operator(\)->)ident(ptr)operator(\);) - ident(RARRAY)operator(()ident(copy)operator(\)->)ident(ptr) operator(=) ident(RARRAY)operator(()ident(orig)operator(\)->)ident(ptr)operator(;) - ident(RARRAY)operator(()ident(copy)operator(\)->)ident(len) operator(=) ident(RARRAY)operator(()ident(orig)operator(\)->)ident(len)operator(;) - ident(RARRAY)operator(()ident(copy)operator(\)->)ident(aux)operator(.)ident(shared) operator(=) ident(shared)operator(;) - ident(FL_SET)operator(()ident(copy)operator(,) ident(ELTS_SHARED)operator(\);) - - reserved(return) ident(copy)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.clear -> array - * - * Removes all elements from _self_. - * - * a = [ "a", "b", "c", "d", "e" ] - * a.clear #=> [ ] - */) - -ident(VALUE) -ident(rb_ary_clear)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(ARY_DEFAULT_SIZE) operator(*) integer(2) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa)operator(\)) operator({) - ident(REALLOC_N)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(ARY_DEFAULT_SIZE) operator(*) integer(2)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(ARY_DEFAULT_SIZE) operator(*) integer(2)operator(;) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.fill(obj\) -> array - * array.fill(obj, start [, length]\) -> array - * array.fill(obj, range \) -> array - * array.fill {|index| block } -> array - * array.fill(start [, length] \) {|index| block } -> array - * array.fill(range\) {|index| block } -> array - * - * The first three forms set the selected elements of self (which - * may be the entire array\) to obj. A start of - * nil is equivalent to zero. A length of - * nil is equivalent to self.length. The last three - * forms fill the array with the value of the block. The block is - * passed the absolute index of each element to be filled. - * - * a = [ "a", "b", "c", "d" ] - * a.fill("x"\) #=> ["x", "x", "x", "x"] - * a.fill("z", 2, 2\) #=> ["x", "x", "z", "z"] - * a.fill("y", 0..1\) #=> ["y", "y", "z", "z"] - * a.fill {|i| i*i} #=> [0, 1, 4, 9] - * a.fill(-2\) {|i| i*i*i} #=> [0, 1, 8, 27] - */) - -directive(static) ident(VALUE) -ident(rb_ary_fill)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ary)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) ident(item)operator(,) ident(arg1)operator(,) ident(arg2)operator(;) - pre_type(long) ident(beg) operator(=) integer(0)operator(,) ident(end) operator(=) integer(0)operator(,) ident(len) operator(=) integer(0)operator(;) - ident(VALUE) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - pre_type(int) ident(block_p) operator(=) ident(Qfalse)operator(;) - - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(block_p) operator(=) ident(Qtrue)operator(;) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(arg1)operator(,) operator(&)ident(arg2)operator(\);) - ident(argc) operator(+=) integer(1)operator(;) comment(/* hackish */) - operator(}) - reserved(else) operator({) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(item)operator(,) operator(&)ident(arg1)operator(,) operator(&)ident(arg2)operator(\);) - operator(}) - reserved(switch) operator(()ident(argc)operator(\)) operator({) - reserved(case) integer(1)operator(:) - ident(beg) operator(=) integer(0)operator(;) - ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - reserved(break)operator(;) - reserved(case) integer(2)operator(:) - reserved(if) operator(()ident(rb_range_beg_len)operator(()ident(arg1)operator(,) operator(&)ident(beg)operator(,) operator(&)ident(len)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) integer(1)operator(\)\)) operator({) - reserved(break)operator(;) - operator(}) - comment(/* fall through */) - reserved(case) integer(3)operator(:) - ident(beg) operator(=) ident(NIL_P)operator(()ident(arg1)operator(\)) operator(?) integer(0) operator(:) ident(NUM2LONG)operator(()ident(arg1)operator(\);) - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) operator({) - ident(beg) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(+) ident(beg)operator(;) - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) ident(beg) operator(=) integer(0)operator(;) - operator(}) - ident(len) operator(=) ident(NIL_P)operator(()ident(arg2)operator(\)) operator(?) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(-) ident(beg) operator(:) ident(NUM2LONG)operator(()ident(arg2)operator(\);) - reserved(break)operator(;) - operator(}) - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) operator({) - reserved(return) ident(ary)operator(;) - operator(}) - reserved(if) operator(()ident(beg) operator(>=) ident(ARY_MAX_SIZE) operator(||) ident(len) operator(>) ident(ARY_MAX_SIZE) operator(-) ident(beg)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(end) operator(=) ident(beg) operator(+) ident(len)operator(;) - reserved(if) operator(()ident(end) operator(>) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) operator({) - reserved(if) operator(()ident(end) operator(>=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa)operator(\)) operator({) - ident(REALLOC_N)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(end)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(end)operator(;) - operator(}) - ident(rb_mem_clear)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(+) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) ident(end) operator(-) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(end)operator(;) - operator(}) - - reserved(if) operator(()ident(block_p)operator(\)) operator({) - ident(VALUE) ident(v)operator(;) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)ident(beg)operator(;) ident(i)operator(<)ident(end)operator(;) ident(i)operator(++\)) operator({) - ident(v) operator(=) ident(rb_yield)operator(()ident(LONG2NUM)operator(()ident(i)operator(\)\);) - reserved(if) operator(()ident(i)operator(>=)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) reserved(break)operator(;) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(=) ident(v)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(p) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr) operator(+) ident(beg)operator(;) - ident(pend) operator(=) ident(p) operator(+) ident(len)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - operator(*)ident(p)operator(++) operator(=) ident(item)operator(;) - operator(}) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array + other_array -> an_array - * - * Concatenation---Returns a new array built by concatenating the - * two arrays together to produce a third array. - * - * [ 1, 2, 3 ] + [ 4, 5 ] #=> [ 1, 2, 3, 4, 5 ] - */) - -ident(VALUE) -ident(rb_ary_plus)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(z)operator(;) - pre_type(long) ident(len)operator(;) - - ident(y) operator(=) ident(to_ary)operator(()ident(y)operator(\);) - ident(len) operator(=) ident(RARRAY)operator(()ident(x)operator(\)->)ident(len) operator(+) ident(RARRAY)operator(()ident(y)operator(\)->)ident(len)operator(;) - ident(z) operator(=) ident(rb_ary_new2)operator(()ident(len)operator(\);) - ident(MEMCPY)operator(()ident(RARRAY)operator(()ident(z)operator(\)->)ident(ptr)operator(,) ident(RARRAY)operator(()ident(x)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(x)operator(\)->)ident(len)operator(\);) - ident(MEMCPY)operator(()ident(RARRAY)operator(()ident(z)operator(\)->)ident(ptr) operator(+) ident(RARRAY)operator(()ident(x)operator(\)->)ident(len)operator(,) ident(RARRAY)operator(()ident(y)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(y)operator(\)->)ident(len)operator(\);) - ident(RARRAY)operator(()ident(z)operator(\)->)ident(len) operator(=) ident(len)operator(;) - reserved(return) ident(z)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.concat(other_array\) -> array - * - * Appends the elements in other_array to _self_. - * - * [ "a", "b" ].concat( ["c", "d"] \) #=> [ "a", "b", "c", "d" ] - */) - - -ident(VALUE) -ident(rb_ary_concat)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(y) operator(=) ident(to_ary)operator(()ident(y)operator(\);) - reserved(if) operator(()ident(RARRAY)operator(()ident(y)operator(\)->)ident(len) operator(>) integer(0)operator(\)) operator({) - ident(rb_ary_splice)operator(()ident(x)operator(,) ident(RARRAY)operator(()ident(x)operator(\)->)ident(len)operator(,) integer(0)operator(,) ident(y)operator(\);) - operator(}) - reserved(return) ident(x)operator(;) -operator(}) - - -comment(/* - * call-seq: - * array * int -> an_array - * array * str -> a_string - * - * Repetition---With a String argument, equivalent to - * self.join(str\). Otherwise, returns a new array - * built by concatenating the _int_ copies of _self_. - * - * - * [ 1, 2, 3 ] * 3 #=> [ 1, 2, 3, 1, 2, 3, 1, 2, 3 ] - * [ 1, 2, 3 ] * "," #=> "1,2,3" - * - */) - -directive(static) ident(VALUE) -ident(rb_ary_times)operator(()ident(ary)operator(,) ident(times)operator(\)) - ident(VALUE) ident(ary)operator(,) ident(times)operator(;) -operator({) - ident(VALUE) ident(ary2)operator(,) ident(tmp)operator(;) - pre_type(long) ident(i)operator(,) ident(len)operator(;) - - ident(tmp) operator(=) ident(rb_check_string_type)operator(()ident(times)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - reserved(return) ident(rb_ary_join)operator(()ident(ary)operator(,) ident(tmp)operator(\);) - operator(}) - - ident(len) operator(=) ident(NUM2LONG)operator(()ident(times)operator(\);) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(ary_new)operator(()ident(rb_obj_class)operator(()ident(ary)operator(\),) integer(0)operator(\);) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(ARY_MAX_SIZE)operator(/)ident(len) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(len) operator(*=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - - ident(ary2) operator(=) ident(ary_new)operator(()ident(rb_obj_class)operator(()ident(ary)operator(\),) ident(len)operator(\);) - ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len) operator(=) ident(len)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(+=)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) operator({) - ident(MEMCPY)operator(()ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(ptr)operator(+)ident(i)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - operator(}) - ident(OBJ_INFECT)operator(()ident(ary2)operator(,) ident(ary)operator(\);) - - reserved(return) ident(ary2)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.assoc(obj\) -> an_array or nil - * - * Searches through an array whose elements are also arrays - * comparing _obj_ with the first element of each contained array - * using obj.==. - * Returns the first contained array that matches (that - * is, the first associated array\), - * or +nil+ if no match is found. - * See also Array#rassoc. - * - * s1 = [ "colors", "red", "blue", "green" ] - * s2 = [ "letters", "a", "b", "c" ] - * s3 = "foo" - * a = [ s1, s2, s3 ] - * a.assoc("letters"\) #=> [ "letters", "a", "b", "c" ] - * a.assoc("foo"\) #=> nil - */) - -ident(VALUE) -ident(rb_ary_assoc)operator(()ident(ary)operator(,) ident(key)operator(\)) - ident(VALUE) ident(ary)operator(,) ident(key)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - ident(VALUE) ident(v)operator(;) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) operator(++)ident(i)operator(\)) operator({) - ident(v) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(==) ident(T_ARRAY) operator(&&) - ident(RARRAY)operator(()ident(v)operator(\)->)ident(len) operator(>) integer(0) operator(&&) - ident(rb_equal)operator(()ident(RARRAY)operator(()ident(v)operator(\)->)ident(ptr)operator([)integer(0)operator(],) ident(key)operator(\)\)) - reserved(return) ident(v)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.rassoc(key\) -> an_array or nil - * - * Searches through the array whose elements are also arrays. Compares - * key with the second element of each contained array using - * ==. Returns the first contained array that matches. See - * also Array#assoc. - * - * a = [ [ 1, "one"], [2, "two"], [3, "three"], ["ii", "two"] ] - * a.rassoc("two"\) #=> [2, "two"] - * a.rassoc("four"\) #=> nil - */) - -ident(VALUE) -ident(rb_ary_rassoc)operator(()ident(ary)operator(,) ident(value)operator(\)) - ident(VALUE) ident(ary)operator(,) ident(value)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - ident(VALUE) ident(v)operator(;) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) operator(++)ident(i)operator(\)) operator({) - ident(v) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(==) ident(T_ARRAY) operator(&&) - ident(RARRAY)operator(()ident(v)operator(\)->)ident(len) operator(>) integer(1) operator(&&) - ident(rb_equal)operator(()ident(RARRAY)operator(()ident(v)operator(\)->)ident(ptr)operator([)integer(1)operator(],) ident(value)operator(\)\)) - reserved(return) ident(v)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(recursive_equal)operator(()ident(ary1)operator(,) ident(ary2)operator(\)) - ident(VALUE) ident(ary1)operator(,) ident(ary2)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator((!)ident(rb_equal)operator(()ident(rb_ary_elt)operator(()ident(ary1)operator(,) ident(i)operator(\),) ident(rb_ary_elt)operator(()ident(ary2)operator(,) ident(i)operator(\)\)\)) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * array == other_array -> bool - * - * Equality---Two arrays are equal if they contain the same number - * of elements and if each element is equal to (according to - * Object.==\) the corresponding element in the other array. - * - * [ "a", "c" ] == [ "a", "c", 7 ] #=> false - * [ "a", "c", 7 ] == [ "a", "c", 7 ] #=> true - * [ "a", "c", 7 ] == [ "a", "d", "f" ] #=> false - * - */) - -directive(static) ident(VALUE) -ident(rb_ary_equal)operator(()ident(ary1)operator(,) ident(ary2)operator(\)) - ident(VALUE) ident(ary1)operator(,) ident(ary2)operator(;) -operator({) - reserved(if) operator(()ident(ary1) operator(==) ident(ary2)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(ary2)operator(\)) operator(!=) ident(T_ARRAY)operator(\)) operator({) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(ary2)operator(,) ident(rb_intern)operator(()stringoperator(\)\)\)) operator({) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(rb_equal)operator(()ident(ary2)operator(,) ident(ary1)operator(\);) - operator(}) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len) operator(!=) ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(rb_inspecting_p)operator(()ident(ary1)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(rb_protect_inspect)operator(()ident(recursive_equal)operator(,) ident(ary1)operator(,) ident(ary2)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(recursive_eql)operator(()ident(ary1)operator(,) ident(ary2)operator(\)) - ident(VALUE) ident(ary1)operator(,) ident(ary2)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator((!)ident(rb_eql)operator(()ident(rb_ary_elt)operator(()ident(ary1)operator(,) ident(i)operator(\),) ident(rb_ary_elt)operator(()ident(ary2)operator(,) ident(i)operator(\)\)\)) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.eql?(other\) -> true or false - * - * Returns true if _array_ and _other_ are the same object, - * or are both arrays with the same content. - */) - -directive(static) ident(VALUE) -ident(rb_ary_eql)operator(()ident(ary1)operator(,) ident(ary2)operator(\)) - ident(VALUE) ident(ary1)operator(,) ident(ary2)operator(;) -operator({) - reserved(if) operator(()ident(ary1) operator(==) ident(ary2)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(ary2)operator(\)) operator(!=) ident(T_ARRAY)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len) operator(!=) ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(rb_inspecting_p)operator(()ident(ary1)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(rb_protect_inspect)operator(()ident(recursive_eql)operator(,) ident(ary1)operator(,) ident(ary2)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(recursive_hash) ident(_)operator((()ident(VALUE) ident(ary)operator(\)\);) - -directive(static) ident(VALUE) -ident(recursive_hash)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(i)operator(,) ident(h)operator(;) - ident(VALUE) ident(n)operator(;) - - ident(h) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(h) operator(=) operator(()ident(h) operator(<<) integer(1)operator(\)) operator(|) operator(()ident(h)operator(<)integer(0) operator(?) integer(1) operator(:) integer(0)operator(\);) - ident(n) operator(=) ident(rb_hash)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - ident(h) operator(^=) ident(NUM2LONG)operator(()ident(n)operator(\);) - operator(}) - reserved(return) ident(LONG2FIX)operator(()ident(h)operator(\);) -operator(}) - -comment(/* - * call-seq: - * array.hash -> fixnum - * - * Compute a hash-code for this array. Two arrays with the same content - * will have the same hash code (and will compare using eql?\). - */) - -directive(static) ident(VALUE) -ident(rb_ary_hash)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(rb_inspecting_p)operator(()ident(ary)operator(\)\)) operator({) - reserved(return) ident(LONG2FIX)operator(()integer(0)operator(\);) - operator(}) - reserved(return) ident(rb_protect_inspect)operator(()ident(recursive_hash)operator(,) ident(ary)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * array.include?(obj\) -> true or false - * - * Returns true if the given object is present in - * self (that is, if any object == anObject\), - * false otherwise. - * - * a = [ "a", "b", "c" ] - * a.include?("b"\) #=> true - * a.include?("z"\) #=> false - */) - -ident(VALUE) -ident(rb_ary_includes)operator(()ident(ary)operator(,) ident(item)operator(\)) - ident(VALUE) ident(ary)operator(;) - ident(VALUE) ident(item)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(rb_equal)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(item)operator(\)\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -ident(VALUE) -ident(recursive_cmp)operator(()ident(ary1)operator(,) ident(ary2)operator(\)) - ident(VALUE) ident(ary1)operator(,) ident(ary2)operator(;) -operator({) - pre_type(long) ident(i)operator(,) ident(len)operator(;) - - ident(len) operator(=) ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(len) operator(>) ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len)operator(\)) operator({) - ident(len) operator(=) ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(v) operator(=) ident(rb_funcall)operator(()ident(rb_ary_elt)operator(()ident(ary1)operator(,) ident(i)operator(\),) ident(id_cmp)operator(,) integer(1)operator(,) ident(rb_ary_elt)operator(()ident(ary2)operator(,) ident(i)operator(\)\);) - reserved(if) operator(()ident(v) operator(!=) ident(INT2FIX)operator(()integer(0)operator(\)\)) operator({) - reserved(return) ident(v)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qundef)operator(;) -operator(}) - -comment(/* - * call-seq: - * array <=> other_array -> -1, 0, +1 - * - * Comparison---Returns an integer (-1, 0, - * or +1\) if this array is less than, equal to, or greater than - * other_array. Each object in each array is compared - * (using <=>\). If any value isn't - * equal, then that inequality is the return value. If all the - * values found are equal, then the return is based on a - * comparison of the array lengths. Thus, two arrays are - * ``equal'' according to Array#<=> if and only if they have - * the same length and the value of each element is equal to the - * value of the corresponding element in the other array. - * - * [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1 - * [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1 - * - */) - -ident(VALUE) -ident(rb_ary_cmp)operator(()ident(ary1)operator(,) ident(ary2)operator(\)) - ident(VALUE) ident(ary1)operator(,) ident(ary2)operator(;) -operator({) - pre_type(long) ident(len)operator(;) - ident(VALUE) ident(v)operator(;) - - ident(ary2) operator(=) ident(to_ary)operator(()ident(ary2)operator(\);) - reserved(if) operator(()ident(ary1) operator(==) ident(ary2)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(rb_inspecting_p)operator(()ident(ary1)operator(\)\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - ident(v) operator(=) ident(rb_protect_inspect)operator(()ident(recursive_cmp)operator(,) ident(ary1)operator(,) ident(ary2)operator(\);) - reserved(if) operator(()ident(v) operator(!=) ident(Qundef)operator(\)) reserved(return) ident(v)operator(;) - ident(len) operator(=) ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len) operator(-) ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(len) operator(>) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(ary_make_hash)operator(()ident(ary1)operator(,) ident(ary2)operator(\)) - ident(VALUE) ident(ary1)operator(,) ident(ary2)operator(;) -operator({) - ident(VALUE) ident(hash) operator(=) ident(rb_hash_new)operator((\);) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_hash_aset)operator(()ident(hash)operator(,) ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(Qtrue)operator(\);) - operator(}) - reserved(if) operator(()ident(ary2)operator(\)) operator({) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_hash_aset)operator(()ident(hash)operator(,) ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(Qtrue)operator(\);) - operator(}) - operator(}) - reserved(return) ident(hash)operator(;) -operator(}) - -comment(/* - * call-seq: - * array - other_array -> an_array - * - * Array Difference---Returns a new array that is a copy of - * the original array, removing any items that also appear in - * other_array. (If you need set-like behavior, see the - * library class Set.\) - * - * [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ] - */) - -directive(static) ident(VALUE) -ident(rb_ary_diff)operator(()ident(ary1)operator(,) ident(ary2)operator(\)) - ident(VALUE) ident(ary1)operator(,) ident(ary2)operator(;) -operator({) - ident(VALUE) ident(ary3)operator(;) - directive(volatile) ident(VALUE) ident(hash)operator(;) - pre_type(long) ident(i)operator(;) - - ident(hash) operator(=) ident(ary_make_hash)operator(()ident(to_ary)operator(()ident(ary2)operator(\),) integer(0)operator(\);) - ident(ary3) operator(=) ident(rb_ary_new)operator((\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(st_lookup)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(ptr)operator([)ident(i)operator(],) integer(0)operator(\)\)) reserved(continue)operator(;) - ident(rb_ary_push)operator(()ident(ary3)operator(,) ident(rb_ary_elt)operator(()ident(ary1)operator(,) ident(i)operator(\)\);) - operator(}) - reserved(return) ident(ary3)operator(;) -operator(}) - -comment(/* - * call-seq: - * array & other_array - * - * Set Intersection---Returns a new array - * containing elements common to the two arrays, with no duplicates. - * - * [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ] - */) - - -directive(static) ident(VALUE) -ident(rb_ary_and)operator(()ident(ary1)operator(,) ident(ary2)operator(\)) - ident(VALUE) ident(ary1)operator(,) ident(ary2)operator(;) -operator({) - ident(VALUE) ident(hash)operator(,) ident(ary3)operator(,) ident(v)operator(,) ident(vv)operator(;) - pre_type(long) ident(i)operator(;) - - ident(ary2) operator(=) ident(to_ary)operator(()ident(ary2)operator(\);) - ident(ary3) operator(=) ident(rb_ary_new2)operator(()ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len) operator(<) ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len) operator(?) - ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len) operator(:) ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len)operator(\);) - ident(hash) operator(=) ident(ary_make_hash)operator(()ident(ary2)operator(,) integer(0)operator(\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(v) operator(=) ident(vv) operator(=) ident(rb_ary_elt)operator(()ident(ary1)operator(,) ident(i)operator(\);) - reserved(if) operator(()ident(st_delete)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(vv)operator(,) integer(0)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary3)operator(,) ident(v)operator(\);) - operator(}) - operator(}) - - reserved(return) ident(ary3)operator(;) -operator(}) - -comment(/* - * call-seq: - * array | other_array -> an_array - * - * Set Union---Returns a new array by joining this array with - * other_array, removing duplicates. - * - * [ "a", "b", "c" ] | [ "c", "d", "a" ] - * #=> [ "a", "b", "c", "d" ] - */) - -directive(static) ident(VALUE) -ident(rb_ary_or)operator(()ident(ary1)operator(,) ident(ary2)operator(\)) - ident(VALUE) ident(ary1)operator(,) ident(ary2)operator(;) -operator({) - ident(VALUE) ident(hash)operator(,) ident(ary3)operator(;) - ident(VALUE) ident(v)operator(,) ident(vv)operator(;) - pre_type(long) ident(i)operator(;) - - ident(ary2) operator(=) ident(to_ary)operator(()ident(ary2)operator(\);) - ident(ary3) operator(=) ident(rb_ary_new2)operator(()ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len)operator(+)ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len)operator(\);) - ident(hash) operator(=) ident(ary_make_hash)operator(()ident(ary1)operator(,) ident(ary2)operator(\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary1)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(v) operator(=) ident(vv) operator(=) ident(rb_ary_elt)operator(()ident(ary1)operator(,) ident(i)operator(\);) - reserved(if) operator(()ident(st_delete)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(vv)operator(,) integer(0)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary3)operator(,) ident(v)operator(\);) - operator(}) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(v) operator(=) ident(vv) operator(=) ident(rb_ary_elt)operator(()ident(ary2)operator(,) ident(i)operator(\);) - reserved(if) operator(()ident(st_delete)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(vv)operator(,) integer(0)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary3)operator(,) ident(v)operator(\);) - operator(}) - operator(}) - reserved(return) ident(ary3)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.uniq! -> array or nil - * - * Removes duplicate elements from _self_. - * Returns nil if no changes are made (that is, no - * duplicates are found\). - * - * a = [ "a", "a", "b", "b", "c" ] - * a.uniq! #=> ["a", "b", "c"] - * b = [ "a", "b", "c" ] - * b.uniq! #=> nil - */) - -directive(static) ident(VALUE) -ident(rb_ary_uniq_bang)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) ident(hash)operator(,) ident(v)operator(,) ident(vv)operator(;) - pre_type(long) ident(i)operator(,) ident(j)operator(;) - - ident(hash) operator(=) ident(ary_make_hash)operator(()ident(ary)operator(,) integer(0)operator(\);) - - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(->)ident(num_entries)operator(\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)ident(j)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(v) operator(=) ident(vv) operator(=) ident(rb_ary_elt)operator(()ident(ary)operator(,) ident(i)operator(\);) - reserved(if) operator(()ident(st_delete)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(vv)operator(,) integer(0)operator(\)\)) operator({) - ident(rb_ary_store)operator(()ident(ary)operator(,) ident(j)operator(++,) ident(v)operator(\);) - operator(}) - operator(}) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(j)operator(;) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.uniq -> an_array - * - * Returns a new array by removing duplicate values in self. - * - * a = [ "a", "a", "b", "b", "c" ] - * a.uniq #=> ["a", "b", "c"] - */) - -directive(static) ident(VALUE) -ident(rb_ary_uniq)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(ary) operator(=) ident(rb_ary_dup)operator(()ident(ary)operator(\);) - ident(rb_ary_uniq_bang)operator(()ident(ary)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.compact! -> array or nil - * - * Removes +nil+ elements from array. - * Returns +nil+ if no changes were made. - * - * [ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ] - * [ "a", "b", "c" ].compact! #=> nil - */) - -directive(static) ident(VALUE) -ident(rb_ary_compact_bang)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(VALUE) operator(*)ident(p)operator(,) operator(*)ident(t)operator(,) operator(*)ident(end)operator(;) - - ident(rb_ary_modify)operator(()ident(ary)operator(\);) - ident(p) operator(=) ident(t) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(;) - ident(end) operator(=) ident(p) operator(+) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - - reserved(while) operator(()ident(t) operator(<) ident(end)operator(\)) operator({) - reserved(if) operator(()ident(NIL_P)operator((*)ident(t)operator(\)\)) ident(t)operator(++;) - reserved(else) operator(*)ident(p)operator(++) operator(=) operator(*)ident(t)operator(++;) - operator(}) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) operator(()ident(p) operator(-) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(\)\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) operator(()ident(p) operator(-) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(\);) - ident(REALLOC_N)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.compact -> an_array - * - * Returns a copy of _self_ with all +nil+ elements removed. - * - * [ "a", nil, "b", nil, "c", nil ].compact - * #=> [ "a", "b", "c" ] - */) - -directive(static) ident(VALUE) -ident(rb_ary_compact)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(ary) operator(=) ident(rb_ary_dup)operator(()ident(ary)operator(\);) - ident(rb_ary_compact_bang)operator(()ident(ary)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.nitems -> int - * - * Returns the number of non-nil elements in _self_. - * May be zero. - * - * [ 1, nil, 3, nil, 5 ].nitems #=> 3 - */) - -directive(static) ident(VALUE) -ident(rb_ary_nitems)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(n) operator(=) integer(0)operator(;) - ident(VALUE) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - - ident(p) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(;) - ident(pend) operator(=) ident(p) operator(+) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator((*)ident(p)operator(\)\)) ident(n)operator(++;) - ident(p)operator(++;) - operator(}) - reserved(return) ident(LONG2NUM)operator(()ident(n)operator(\);) -operator(}) - -directive(static) pre_type(long) -ident(flatten)operator(()ident(ary)operator(,) ident(idx)operator(,) ident(ary2)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(ary)operator(;) - pre_type(long) ident(idx)operator(;) - ident(VALUE) ident(ary2)operator(,) ident(memo)operator(;) -operator({) - ident(VALUE) ident(id)operator(;) - pre_type(long) ident(i) operator(=) ident(idx)operator(;) - pre_type(long) ident(n)operator(,) ident(lim) operator(=) ident(idx) operator(+) ident(RARRAY)operator(()ident(ary2)operator(\)->)ident(len)operator(;) - - ident(id) operator(=) ident(rb_obj_id)operator(()ident(ary2)operator(\);) - reserved(if) operator(()ident(rb_ary_includes)operator(()ident(memo)operator(,) ident(id)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(rb_ary_push)operator(()ident(memo)operator(,) ident(id)operator(\);) - ident(rb_ary_splice)operator(()ident(ary)operator(,) ident(idx)operator(,) integer(1)operator(,) ident(ary2)operator(\);) - reserved(while) operator(()ident(i) operator(<) ident(lim)operator(\)) operator({) - ident(VALUE) ident(tmp)operator(;) - - ident(tmp) operator(=) ident(rb_check_array_type)operator(()ident(rb_ary_elt)operator(()ident(ary)operator(,) ident(i)operator(\)\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - ident(n) operator(=) ident(flatten)operator(()ident(ary)operator(,) ident(i)operator(,) ident(tmp)operator(,) ident(memo)operator(\);) - ident(i) operator(+=) ident(n)operator(;) ident(lim) operator(+=) ident(n)operator(;) - operator(}) - ident(i)operator(++;) - operator(}) - ident(rb_ary_pop)operator(()ident(memo)operator(\);) - - reserved(return) ident(lim) operator(-) ident(idx) operator(-) integer(1)operator(;) comment(/* returns number of increased items */) -operator(}) - -comment(/* - * call-seq: - * array.flatten! -> array or nil - * - * Flattens _self_ in place. - * Returns nil if no modifications were made (i.e., - * array contains no subarrays.\) - * - * a = [ 1, 2, [3, [4, 5] ] ] - * a.flatten! #=> [1, 2, 3, 4, 5] - * a.flatten! #=> nil - * a #=> [1, 2, 3, 4, 5] - */) - -directive(static) ident(VALUE) -ident(rb_ary_flatten_bang)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - pre_type(long) ident(i) operator(=) integer(0)operator(;) - pre_type(int) ident(mod) operator(=) integer(0)operator(;) - ident(VALUE) ident(memo) operator(=) ident(Qnil)operator(;) - - reserved(while) operator(()ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(\)) operator({) - ident(VALUE) ident(ary2) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - ident(VALUE) ident(tmp)operator(;) - - ident(tmp) operator(=) ident(rb_check_array_type)operator(()ident(ary2)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - reserved(if) operator(()ident(NIL_P)operator(()ident(memo)operator(\)\)) operator({) - ident(memo) operator(=) ident(rb_ary_new)operator((\);) - operator(}) - ident(i) operator(+=) ident(flatten)operator(()ident(ary)operator(,) ident(i)operator(,) ident(tmp)operator(,) ident(memo)operator(\);) - ident(mod) operator(=) integer(1)operator(;) - operator(}) - ident(i)operator(++;) - operator(}) - reserved(if) operator(()ident(mod) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * array.flatten -> an_array - * - * Returns a new array that is a one-dimensional flattening of this - * array (recursively\). That is, for every element that is an array, - * extract its elements into the new array. - * - * s = [ 1, 2, 3 ] #=> [1, 2, 3] - * t = [ 4, 5, 6, [7, 8] ] #=> [4, 5, 6, [7, 8]] - * a = [ s, t, 9, 10 ] #=> [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10] - * a.flatten #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 - */) - -directive(static) ident(VALUE) -ident(rb_ary_flatten)operator(()ident(ary)operator(\)) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(ary) operator(=) ident(rb_ary_dup)operator(()ident(ary)operator(\);) - ident(rb_ary_flatten_bang)operator(()ident(ary)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - - -comment(/* Arrays are ordered, integer-indexed collections of any object. - * Array indexing starts at 0, as in C or Java. A negative index is - * assumed to be relative to the end of the array---that is, an index of -1 - * indicates the last element of the array, -2 is the next to last - * element in the array, and so on. - */) - -directive(void) -ident(Init_Array)operator((\)) -operator({) - ident(rb_cArray) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_include_module)operator(()ident(rb_cArray)operator(,) ident(rb_mEnumerable)operator(\);) - - ident(rb_define_alloc_func)operator(()ident(rb_cArray)operator(,) ident(ary_alloc)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_s_create)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_initialize)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_replace)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_to_a)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_to_ary_m)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_frozen_p)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_eql)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_hash)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_aref)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_aset)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_at)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_fetch)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_first)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_last)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_concat)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_push)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_push_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_pop)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_shift)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_unshift_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_insert)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_each)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_each_index)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_reverse_each)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_length)operator(,) integer(0)operator(\);) - ident(rb_define_alias)operator(()ident(rb_cArray)operator(,) stringoperator(,) stringoperator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_empty_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_index)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_rindex)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_indexes)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_indexes)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_join_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_reverse_m)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_reverse_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_sort)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_sort_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_collect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_collect_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_collect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_collect_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_select)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_values_at)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_delete)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_delete_at_m)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_delete_if)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_reject)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_reject_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_zip)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_transpose)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_replace)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_clear)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_fill)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_includes)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) string)delimiter(")>operator(,) ident(rb_ary_cmp)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_aref)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_slice_bang)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_assoc)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_rassoc)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_plus)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_times)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_diff)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_and)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_or)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_uniq)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_uniq_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_compact)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_compact_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_flatten)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_flatten_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(rb_ary_nitems)operator(,) integer(0)operator(\);) - - ident(id_cmp) operator(=) ident(rb_intern)operator(()string)delimiter(")>operator(\);) - ident(inspect_key) operator(=) ident(rb_intern)operator(()stringoperator(\);) -operator(}) -comment(/********************************************************************** - - bignum.c - - - $Author: wyhaines $ - $Date: 2009-07-14 17:05:27 +0200 (Tue, 14 Jul 2009\) $ - created at: Fri Jun 10 00:48:55 JST 1994 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("rubysig.h") - -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#ifdef) ident(HAVE_IEEEFP_H) -preprocessor(#include) include() -preprocessor(#endif) - -ident(VALUE) ident(rb_cBignum)operator(;) - -preprocessor(#if) ident(defined) ident(__MINGW32__) -preprocessor(#define) ident(USHORT) ident(_USHORT) -preprocessor(#endif) - -preprocessor(#define) ident(BDIGITS)operator(()ident(x)operator(\)) operator((()ident(BDIGIT)operator(*\))ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(digits)operator(\)) -preprocessor(#define) ident(BITSPERDIG) operator(()ident(SIZEOF_BDIGITS)operator(*)ident(CHAR_BIT)operator(\)) -preprocessor(#define) ident(BIGRAD) operator((()ident(BDIGIT_DBL)operator(\))integer(1) operator(<<) ident(BITSPERDIG)operator(\)) -preprocessor(#define) ident(DIGSPERLONG) operator((()pre_type(unsigned) pre_type(int)operator(\)()ident(SIZEOF_LONG)operator(/)ident(SIZEOF_BDIGITS)operator(\)\)) -preprocessor(#if) ident(HAVE_LONG_LONG) -preprocessor(# define) ident(DIGSPERLL) operator((()pre_type(unsigned) pre_type(int)operator(\)()ident(SIZEOF_LONG_LONG)operator(/)ident(SIZEOF_BDIGITS)operator(\)\)) -preprocessor(#endif) -preprocessor(#define) ident(BIGUP)operator(()ident(x)operator(\)) operator((()ident(BDIGIT_DBL)operator(\)()ident(x)operator(\)) operator(<<) ident(BITSPERDIG)operator(\)) -preprocessor(#define) ident(BIGDN)operator(()ident(x)operator(\)) ident(RSHIFT)operator(()ident(x)operator(,)ident(BITSPERDIG)operator(\)) -preprocessor(#define) ident(BIGLO)operator(()ident(x)operator(\)) operator((()ident(BDIGIT)operator(\)(()ident(x)operator(\)) operator(&) operator(()ident(BIGRAD)operator(-)integer(1)operator(\)\)\)) -preprocessor(#define) ident(BDIGMAX) operator((()ident(BDIGIT)operator(\)-)integer(1)operator(\)) - -preprocessor(#define) ident(BIGZEROP)operator(()ident(x)operator(\)) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(==) integer(0) operator(||) \ - operator(()ident(BDIGITS)operator(()ident(x)operator(\)[)integer(0)operator(]) operator(==) integer(0) operator(&&) \ - operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(==) integer(1) operator(||) ident(bigzero_p)operator(()ident(x)operator(\)\)\)\)) - -directive(static) pre_type(int) ident(bigzero_p)operator(()ident(VALUE)operator(\);) -directive(static) pre_type(int) -ident(bigzero_p)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) operator(++)ident(i)operator(\)) operator({) - reserved(if) operator(()ident(BDIGITS)operator(()ident(x)operator(\)[)ident(i)operator(]\)) reserved(return) integer(0)operator(;) - operator(}) - reserved(return) integer(1)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(bignew_1)operator(()ident(klass)operator(,) ident(len)operator(,) ident(sign)operator(\)) - ident(VALUE) ident(klass)operator(;) - pre_type(long) ident(len)operator(;) - pre_type(int) ident(sign)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(big)operator(,) reserved(struct) ident(RBignum)operator(\);) - ident(OBJSETUP)operator(()ident(big)operator(,) ident(klass)operator(,) ident(T_BIGNUM)operator(\);) - ident(big)operator(->)ident(sign) operator(=) ident(sign)operator(?)integer(1)operator(:)integer(0)operator(;) - ident(big)operator(->)ident(len) operator(=) ident(len)operator(;) - ident(big)operator(->)ident(digits) operator(=) ident(ALLOC_N)operator(()ident(BDIGIT)operator(,) ident(len)operator(\);) - - reserved(return) operator(()ident(VALUE)operator(\))ident(big)operator(;) -operator(}) - -preprocessor(#define) ident(bignew)operator(()ident(len)operator(,)ident(sign)operator(\)) ident(bignew_1)operator(()ident(rb_cBignum)operator(,)ident(len)operator(,)ident(sign)operator(\)) - -ident(VALUE) -ident(rb_big_clone)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - ident(VALUE) ident(z) operator(=) ident(bignew_1)operator(()ident(CLASS_OF)operator(()ident(x)operator(\),) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(,) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\);) - - ident(MEMCPY)operator(()ident(BDIGITS)operator(()ident(z)operator(\),) ident(BDIGITS)operator(()ident(x)operator(\),) ident(BDIGIT)operator(,) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(\);) - reserved(return) ident(z)operator(;) -operator(}) - -comment(/* modify a bignum by 2's complement */) -directive(static) directive(void) -ident(get2comp)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - pre_type(long) ident(i) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(BDIGIT) operator(*)ident(ds) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(BDIGIT_DBL) ident(num)operator(;) - - reserved(if) operator((!)ident(i)operator(\)) reserved(return)operator(;) - reserved(while) operator(()ident(i)operator(--\)) ident(ds)operator([)ident(i)operator(]) operator(=) operator(~)ident(ds)operator([)ident(i)operator(];) - ident(i) operator(=) integer(0)operator(;) ident(num) operator(=) integer(1)operator(;) - reserved(do) operator({) - ident(num) operator(+=) ident(ds)operator([)ident(i)operator(];) - ident(ds)operator([)ident(i)operator(++]) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - operator(}) reserved(while) operator(()ident(i) operator(<) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(\);) - reserved(if) operator(()ident(num) operator(!=) integer(0)operator(\)) operator({) - ident(REALLOC_N)operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(digits)operator(,) ident(BDIGIT)operator(,) operator(++)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(\);) - ident(ds) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(ds)operator([)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(-)integer(1)operator(]) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(?) operator(~)integer(0) operator(:) integer(1)operator(;) - operator(}) -operator(}) - -directive(void) -ident(rb_big_2comp)operator(()ident(x)operator(\)) comment(/* get 2's complement */) - ident(VALUE) ident(x)operator(;) -operator({) - ident(get2comp)operator(()ident(x)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(bigtrunc)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - pre_type(long) ident(len) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(BDIGIT) operator(*)ident(ds) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(x)operator(;) - reserved(while) operator((--)ident(len) operator(&&) operator(!)ident(ds)operator([)ident(len)operator(]\);) - ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(=) operator(++)ident(len)operator(;) - reserved(return) ident(x)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(bigfixize)operator(()ident(VALUE) ident(x)operator(\)) -operator({) - pre_type(long) ident(len) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(BDIGIT) operator(*)ident(ds) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - - reserved(if) operator(()ident(len)operator(*)ident(SIZEOF_BDIGITS) operator(<=) reserved(sizeof)operator(()ident(VALUE)operator(\)\)) operator({) - pre_type(long) ident(num) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(num) operator(=) ident(BIGUP)operator(()ident(num)operator(\)) operator(+) ident(ds)operator([)ident(len)operator(];) - operator(}) - reserved(if) operator(()ident(num) operator(>=) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - reserved(if) operator(()ident(POSFIXABLE)operator(()ident(num)operator(\)\)) reserved(return) ident(LONG2FIX)operator(()ident(num)operator(\);) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(NEGFIXABLE)operator((-()pre_type(long)operator(\))ident(num)operator(\)\)) reserved(return) ident(LONG2FIX)operator((-()pre_type(long)operator(\))ident(num)operator(\);) - operator(}) - operator(}) - operator(}) - reserved(return) ident(x)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(bignorm)operator(()ident(VALUE) ident(x)operator(\)) -operator({) - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(x)operator(\)) operator(&&) ident(TYPE)operator(()ident(x)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) operator({) - ident(x) operator(=) ident(bigfixize)operator(()ident(bigtrunc)operator(()ident(x)operator(\)\);) - operator(}) - reserved(return) ident(x)operator(;) -operator(}) - -ident(VALUE) -ident(rb_big_norm)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - reserved(return) ident(bignorm)operator(()ident(x)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_uint2big)operator(()ident(n)operator(\)) - pre_type(unsigned) pre_type(long) ident(n)operator(;) -operator({) - ident(BDIGIT_DBL) ident(num) operator(=) ident(n)operator(;) - pre_type(long) ident(i) operator(=) integer(0)operator(;) - ident(BDIGIT) operator(*)ident(digits)operator(;) - ident(VALUE) ident(big)operator(;) - - ident(big) operator(=) ident(bignew)operator(()ident(DIGSPERLONG)operator(,) integer(1)operator(\);) - ident(digits) operator(=) ident(BDIGITS)operator(()ident(big)operator(\);) - reserved(while) operator(()ident(i) operator(<) ident(DIGSPERLONG)operator(\)) operator({) - ident(digits)operator([)ident(i)operator(++]) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - operator(}) - - ident(i) operator(=) ident(DIGSPERLONG)operator(;) - reserved(while) operator((--)ident(i) operator(&&) operator(!)ident(digits)operator([)ident(i)operator(]\)) operator(;) - ident(RBIGNUM)operator(()ident(big)operator(\)->)ident(len) operator(=) ident(i)operator(+)integer(1)operator(;) - reserved(return) ident(big)operator(;) -operator(}) - -ident(VALUE) -ident(rb_int2big)operator(()ident(n)operator(\)) - pre_type(long) ident(n)operator(;) -operator({) - pre_type(long) ident(neg) operator(=) integer(0)operator(;) - ident(VALUE) ident(big)operator(;) - - reserved(if) operator(()ident(n) operator(<) integer(0)operator(\)) operator({) - ident(n) operator(=) operator(-)ident(n)operator(;) - ident(neg) operator(=) integer(1)operator(;) - operator(}) - ident(big) operator(=) ident(rb_uint2big)operator(()ident(n)operator(\);) - reserved(if) operator(()ident(neg)operator(\)) operator({) - ident(RBIGNUM)operator(()ident(big)operator(\)->)ident(sign) operator(=) integer(0)operator(;) - operator(}) - reserved(return) ident(big)operator(;) -operator(}) - -ident(VALUE) -ident(rb_uint2inum)operator(()ident(n)operator(\)) - pre_type(unsigned) pre_type(long) ident(n)operator(;) -operator({) - reserved(if) operator(()ident(POSFIXABLE)operator(()ident(n)operator(\)\)) reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) - reserved(return) ident(rb_uint2big)operator(()ident(n)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_int2inum)operator(()ident(n)operator(\)) - pre_type(long) ident(n)operator(;) -operator({) - reserved(if) operator(()ident(FIXABLE)operator(()ident(n)operator(\)\)) reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) - reserved(return) ident(rb_int2big)operator(()ident(n)operator(\);) -operator(}) - -preprocessor(#ifdef) ident(HAVE_LONG_LONG) - -directive(void) -ident(rb_quad_pack)operator(()ident(buf)operator(,) ident(val)operator(\)) - pre_type(char) operator(*)ident(buf)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(LONG_LONG) ident(q)operator(;) - - ident(val) operator(=) ident(rb_to_int)operator(()ident(val)operator(\);) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(val)operator(\)\)) operator({) - ident(q) operator(=) ident(FIX2LONG)operator(()ident(val)operator(\);) - operator(}) - reserved(else) operator({) - pre_type(long) ident(len) operator(=) ident(RBIGNUM)operator(()ident(val)operator(\)->)ident(len)operator(;) - ident(BDIGIT) operator(*)ident(ds)operator(;) - - reserved(if) operator(()ident(len) operator(>) ident(SIZEOF_LONG_LONG)operator(/)ident(SIZEOF_BDIGITS)operator(\)) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(\);) - ident(ds) operator(=) ident(BDIGITS)operator(()ident(val)operator(\);) - ident(q) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(q) operator(=) ident(BIGUP)operator(()ident(q)operator(\);) - ident(q) operator(+=) ident(ds)operator([)ident(len)operator(];) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(val)operator(\)->)ident(sign)operator(\)) ident(q) operator(=) operator(-)ident(q)operator(;) - operator(}) - ident(memcpy)operator(()ident(buf)operator(,) operator(()pre_type(char)operator(*\)&)ident(q)operator(,) ident(SIZEOF_LONG_LONG)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_quad_unpack)operator(()ident(buf)operator(,) ident(sign)operator(\)) - directive(const) pre_type(char) operator(*)ident(buf)operator(;) - pre_type(int) ident(sign)operator(;) -operator({) - pre_type(unsigned) ident(LONG_LONG) ident(q)operator(;) - pre_type(long) ident(neg) operator(=) integer(0)operator(;) - pre_type(long) ident(i)operator(;) - ident(BDIGIT) operator(*)ident(digits)operator(;) - ident(VALUE) ident(big)operator(;) - - ident(memcpy)operator((&)ident(q)operator(,) ident(buf)operator(,) ident(SIZEOF_LONG_LONG)operator(\);) - reserved(if) operator(()ident(sign)operator(\)) operator({) - reserved(if) operator(()ident(FIXABLE)operator((()ident(LONG_LONG)operator(\))ident(q)operator(\)\)) reserved(return) ident(LONG2FIX)operator((()ident(LONG_LONG)operator(\))ident(q)operator(\);) - reserved(if) operator((()ident(LONG_LONG)operator(\))ident(q) operator(<) integer(0)operator(\)) operator({) - ident(q) operator(=) operator(-()ident(LONG_LONG)operator(\))ident(q)operator(;) - ident(neg) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(POSFIXABLE)operator(()ident(q)operator(\)\)) reserved(return) ident(LONG2FIX)operator(()ident(q)operator(\);) - operator(}) - - ident(i) operator(=) integer(0)operator(;) - ident(big) operator(=) ident(bignew)operator(()ident(DIGSPERLL)operator(,) integer(1)operator(\);) - ident(digits) operator(=) ident(BDIGITS)operator(()ident(big)operator(\);) - reserved(while) operator(()ident(i) operator(<) ident(DIGSPERLL)operator(\)) operator({) - ident(digits)operator([)ident(i)operator(++]) operator(=) ident(BIGLO)operator(()ident(q)operator(\);) - ident(q) operator(=) ident(BIGDN)operator(()ident(q)operator(\);) - operator(}) - - ident(i) operator(=) ident(DIGSPERLL)operator(;) - reserved(while) operator(()ident(i)operator(--) operator(&&) operator(!)ident(digits)operator([)ident(i)operator(]\)) operator(;) - ident(RBIGNUM)operator(()ident(big)operator(\)->)ident(len) operator(=) ident(i)operator(+)integer(1)operator(;) - - reserved(if) operator(()ident(neg)operator(\)) operator({) - ident(RBIGNUM)operator(()ident(big)operator(\)->)ident(sign) operator(=) integer(0)operator(;) - operator(}) - reserved(return) ident(bignorm)operator(()ident(big)operator(\);) -operator(}) - -preprocessor(#else) - -preprocessor(#define) ident(QUAD_SIZE) integer(8) - -directive(void) -ident(rb_quad_pack)operator(()ident(buf)operator(,) ident(val)operator(\)) - pre_type(char) operator(*)ident(buf)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - pre_type(long) ident(len)operator(;) - - ident(memset)operator(()ident(buf)operator(,) integer(0)operator(,) ident(QUAD_SIZE)operator(\);) - ident(val) operator(=) ident(rb_to_int)operator(()ident(val)operator(\);) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(val)operator(\)\)) operator({) - ident(val) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(val)operator(\)\);) - operator(}) - ident(len) operator(=) ident(RBIGNUM)operator(()ident(val)operator(\)->)ident(len) operator(*) ident(SIZEOF_BDIGITS)operator(;) - reserved(if) operator(()ident(len) operator(>) ident(QUAD_SIZE)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(\);) - operator(}) - ident(memcpy)operator(()ident(buf)operator(,) operator(()pre_type(char)operator(*\))ident(BDIGITS)operator(()ident(val)operator(\),) ident(len)operator(\);) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(val)operator(\)->)ident(sign)operator(\)) operator({) - ident(len) operator(=) ident(QUAD_SIZE)operator(;) - reserved(while) operator(()ident(len)operator(--\)) operator({) - operator(*)ident(buf) operator(=) operator(~*)ident(buf)operator(;) - ident(buf)operator(++;) - operator(}) - operator(}) -operator(}) - -preprocessor(#define) ident(BNEG)operator(()ident(b)operator(\)) operator(()ident(RSHIFT)operator(((()ident(BDIGIT)operator(*\))ident(b)operator(\)[)ident(QUAD_SIZE)operator(/)ident(SIZEOF_BDIGITS)operator(-)integer(1)operator(],)ident(BITSPERDIG)operator(-)integer(1)operator(\)) operator(!=) integer(0)operator(\)) - -ident(VALUE) -ident(rb_quad_unpack)operator(()ident(buf)operator(,) ident(sign)operator(\)) - directive(const) pre_type(char) operator(*)ident(buf)operator(;) - pre_type(int) ident(sign)operator(;) -operator({) - ident(VALUE) ident(big) operator(=) ident(bignew)operator(()ident(QUAD_SIZE)operator(/)ident(SIZEOF_BDIGITS)operator(,) integer(1)operator(\);) - - ident(memcpy)operator((()pre_type(char)operator(*\))ident(BDIGITS)operator(()ident(big)operator(\),) ident(buf)operator(,) ident(QUAD_SIZE)operator(\);) - reserved(if) operator(()ident(sign) operator(&&) ident(BNEG)operator(()ident(buf)operator(\)\)) operator({) - pre_type(long) ident(len) operator(=) ident(QUAD_SIZE)operator(;) - pre_type(char) operator(*)ident(tmp) operator(=) operator(()pre_type(char)operator(*\))ident(BDIGITS)operator(()ident(big)operator(\);) - - ident(RBIGNUM)operator(()ident(big)operator(\)->)ident(sign) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(len)operator(--\)) operator({) - operator(*)ident(tmp) operator(=) operator(~*)ident(tmp)operator(;) - ident(tmp)operator(++;) - operator(}) - operator(}) - - reserved(return) ident(bignorm)operator(()ident(big)operator(\);) -operator(}) - -preprocessor(#endif) - -ident(VALUE) -ident(rb_cstr_to_inum)operator(()ident(str)operator(,) ident(base)operator(,) ident(badcheck)operator(\)) - directive(const) pre_type(char) operator(*)ident(str)operator(;) - pre_type(int) ident(base)operator(;) - pre_type(int) ident(badcheck)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(s) operator(=) ident(str)operator(;) - pre_type(char) operator(*)ident(end)operator(;) - pre_type(char) ident(sign) operator(=) integer(1)operator(,) ident(nondigit) operator(=) integer(0)operator(;) - pre_type(int) ident(c)operator(;) - ident(BDIGIT_DBL) ident(num)operator(;) - pre_type(long) ident(len)operator(,) ident(blen) operator(=) integer(1)operator(;) - pre_type(long) ident(i)operator(;) - ident(VALUE) ident(z)operator(;) - ident(BDIGIT) operator(*)ident(zds)operator(;) - -preprocessor(#define) ident(conv_digit)operator(()ident(c)operator(\)) \ - operator((!)ident(ISASCII)operator(()ident(c)operator(\)) operator(?) operator(-)integer(1) operator(:) \ - ident(isdigit)operator(()ident(c)operator(\)) operator(?) operator((()ident(c)operator(\)) operator(-) char('0')operator(\)) operator(:) \ - ident(islower)operator(()ident(c)operator(\)) operator(?) operator((()ident(c)operator(\)) operator(-) char('a') operator(+) integer(10)operator(\)) operator(:) \ - ident(isupper)operator(()ident(c)operator(\)) operator(?) operator((()ident(c)operator(\)) operator(-) char('A') operator(+) integer(10)operator(\)) operator(:) \ - operator(-)integer(1)operator(\)) - - reserved(if) operator((!)ident(str)operator(\)) operator({) - reserved(if) operator(()ident(badcheck)operator(\)) reserved(goto) ident(bad)operator(;) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(badcheck)operator(\)) operator({) - reserved(while) operator(()ident(ISSPACE)operator((*)ident(str)operator(\)\)) ident(str)operator(++;) - operator(}) - reserved(else) operator({) - reserved(while) operator(()ident(ISSPACE)operator((*)ident(str)operator(\)) operator(||) operator(*)ident(str) operator(==) char('_')operator(\)) ident(str)operator(++;) - operator(}) - - reserved(if) operator(()ident(str)operator([)integer(0)operator(]) operator(==) char('+')operator(\)) operator({) - ident(str)operator(++;) - operator(}) - reserved(else) reserved(if) operator(()ident(str)operator([)integer(0)operator(]) operator(==) char('-')operator(\)) operator({) - ident(str)operator(++;) - ident(sign) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(str)operator([)integer(0)operator(]) operator(==) char('+') operator(||) ident(str)operator([)integer(0)operator(]) operator(==) char('-')operator(\)) operator({) - reserved(if) operator(()ident(badcheck)operator(\)) reserved(goto) ident(bad)operator(;) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(base) operator(<=) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(str)operator([)integer(0)operator(]) operator(==) char('0')operator(\)) operator({) - reserved(switch) operator(()ident(str)operator([)integer(1)operator(]\)) operator({) - reserved(case) char('x')operator(:) reserved(case) char('X')operator(:) - ident(base) operator(=) integer(16)operator(;) - reserved(break)operator(;) - reserved(case) char('b')operator(:) reserved(case) char('B')operator(:) - ident(base) operator(=) integer(2)operator(;) - reserved(break)operator(;) - reserved(case) char('o')operator(:) reserved(case) char('O')operator(:) - ident(base) operator(=) integer(8)operator(;) - reserved(break)operator(;) - reserved(case) char('d')operator(:) reserved(case) char('D')operator(:) - ident(base) operator(=) integer(10)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(base) operator(=) integer(8)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(base) operator(<) operator(-)integer(1)operator(\)) operator({) - ident(base) operator(=) operator(-)ident(base)operator(;) - operator(}) - reserved(else) operator({) - ident(base) operator(=) integer(10)operator(;) - operator(}) - operator(}) - reserved(switch) operator(()ident(base)operator(\)) operator({) - reserved(case) integer(2)operator(:) - ident(len) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(str)operator([)integer(0)operator(]) operator(==) char('0') operator(&&) operator(()ident(str)operator([)integer(1)operator(]) operator(==) char('b')operator(||)ident(str)operator([)integer(1)operator(]) operator(==) char('B')operator(\)\)) operator({) - ident(str) operator(+=) integer(2)operator(;) - operator(}) - reserved(break)operator(;) - reserved(case) integer(3)operator(:) - ident(len) operator(=) integer(2)operator(;) - reserved(break)operator(;) - reserved(case) integer(8)operator(:) - reserved(if) operator(()ident(str)operator([)integer(0)operator(]) operator(==) char('0') operator(&&) operator(()ident(str)operator([)integer(1)operator(]) operator(==) char('o')operator(||)ident(str)operator([)integer(1)operator(]) operator(==) char('O')operator(\)\)) operator({) - ident(str) operator(+=) integer(2)operator(;) - operator(}) - reserved(case) integer(4)operator(:) reserved(case) integer(5)operator(:) reserved(case) integer(6)operator(:) reserved(case) integer(7)operator(:) - ident(len) operator(=) integer(3)operator(;) - reserved(break)operator(;) - reserved(case) integer(10)operator(:) - reserved(if) operator(()ident(str)operator([)integer(0)operator(]) operator(==) char('0') operator(&&) operator(()ident(str)operator([)integer(1)operator(]) operator(==) char('d')operator(||)ident(str)operator([)integer(1)operator(]) operator(==) char('D')operator(\)\)) operator({) - ident(str) operator(+=) integer(2)operator(;) - operator(}) - reserved(case) integer(9)operator(:) reserved(case) integer(11)operator(:) reserved(case) integer(12)operator(:) reserved(case) integer(13)operator(:) reserved(case) integer(14)operator(:) reserved(case) integer(15)operator(:) - ident(len) operator(=) integer(4)operator(;) - reserved(break)operator(;) - reserved(case) integer(16)operator(:) - ident(len) operator(=) integer(4)operator(;) - reserved(if) operator(()ident(str)operator([)integer(0)operator(]) operator(==) char('0') operator(&&) operator(()ident(str)operator([)integer(1)operator(]) operator(==) char('x')operator(||)ident(str)operator([)integer(1)operator(]) operator(==) char('X')operator(\)\)) operator({) - ident(str) operator(+=) integer(2)operator(;) - operator(}) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(if) operator(()ident(base) operator(<) integer(2) operator(||) integer(36) operator(<) ident(base)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(base)operator(\);) - operator(}) - reserved(if) operator(()ident(base) operator(<=) integer(32)operator(\)) operator({) - ident(len) operator(=) integer(5)operator(;) - operator(}) - reserved(else) operator({) - ident(len) operator(=) integer(6)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - reserved(if) operator((*)ident(str) operator(==) char('0')operator(\)) operator({) comment(/* squeeze preceeding 0s */) - reserved(while) operator((*++)ident(str) operator(==) char('0')operator(\);) - reserved(if) operator((!()ident(c) operator(=) operator(*)ident(str)operator(\)) operator(||) ident(ISSPACE)operator(()ident(c)operator(\)\)) operator(--)ident(str)operator(;) - operator(}) - ident(c) operator(=) operator(*)ident(str)operator(;) - ident(c) operator(=) ident(conv_digit)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(c) operator(<) integer(0) operator(||) ident(c) operator(>=) ident(base)operator(\)) operator({) - reserved(if) operator(()ident(badcheck)operator(\)) reserved(goto) ident(bad)operator(;) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - operator(}) - ident(len) operator(*=) ident(strlen)operator(()ident(str)operator(\)*)reserved(sizeof)operator(()pre_type(char)operator(\);) - - reserved(if) operator(()ident(len) operator(<=) operator(()reserved(sizeof)operator(()ident(VALUE)operator(\)*)ident(CHAR_BIT)operator(\)\)) operator({) - pre_type(unsigned) pre_type(long) ident(val) operator(=) ident(strtoul)operator((()pre_type(char)operator(*\))ident(str)operator(,) operator(&)ident(end)operator(,) ident(base)operator(\);) - - reserved(if) operator((*)ident(end) operator(==) char('_')operator(\)) reserved(goto) ident(bigparse)operator(;) - reserved(if) operator(()ident(badcheck)operator(\)) operator({) - reserved(if) operator(()ident(end) operator(==) ident(str)operator(\)) reserved(goto) ident(bad)operator(;) comment(/* no number */) - reserved(while) operator((*)ident(end) operator(&&) ident(ISSPACE)operator((*)ident(end)operator(\)\)) ident(end)operator(++;) - reserved(if) operator((*)ident(end)operator(\)) reserved(goto) ident(bad)operator(;) comment(/* trailing garbage */) - operator(}) - - reserved(if) operator(()ident(POSFIXABLE)operator(()ident(val)operator(\)\)) operator({) - reserved(if) operator(()ident(sign)operator(\)) reserved(return) ident(LONG2FIX)operator(()ident(val)operator(\);) - reserved(else) operator({) - pre_type(long) ident(result) operator(=) operator(-()pre_type(long)operator(\))ident(val)operator(;) - reserved(return) ident(LONG2FIX)operator(()ident(result)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(big) operator(=) ident(rb_uint2big)operator(()ident(val)operator(\);) - ident(RBIGNUM)operator(()ident(big)operator(\)->)ident(sign) operator(=) ident(sign)operator(;) - reserved(return) ident(bignorm)operator(()ident(big)operator(\);) - operator(}) - operator(}) - label(bigparse:) - ident(len) operator(=) operator(()ident(len)operator(/)ident(BITSPERDIG)operator(\)+)integer(1)operator(;) - reserved(if) operator(()ident(badcheck) operator(&&) operator(*)ident(str) operator(==) char('_')operator(\)) reserved(goto) ident(bad)operator(;) - - ident(z) operator(=) ident(bignew)operator(()ident(len)operator(,) ident(sign)operator(\);) - ident(zds) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - reserved(for) operator(()ident(i)operator(=)ident(len)operator(;)ident(i)operator(--;\)) ident(zds)operator([)ident(i)operator(]=)integer(0)operator(;) - reserved(while) operator((()ident(c) operator(=) operator(*)ident(str)operator(++\)) operator(!=) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(c) operator(==) char('_')operator(\)) operator({) - reserved(if) operator(()ident(badcheck)operator(\)) operator({) - reserved(if) operator(()ident(nondigit)operator(\)) reserved(goto) ident(bad)operator(;) - ident(nondigit) operator(=) ident(c)operator(;) - operator(}) - reserved(continue)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(c) operator(=) ident(conv_digit)operator(()ident(c)operator(\)\)) operator(<) integer(0)operator(\)) operator({) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(>=) ident(base)operator(\)) reserved(break)operator(;) - ident(nondigit) operator(=) integer(0)operator(;) - ident(i) operator(=) integer(0)operator(;) - ident(num) operator(=) ident(c)operator(;) - reserved(for) operator((;;\)) operator({) - reserved(while) operator(()ident(i)operator(<)ident(blen)operator(\)) operator({) - ident(num) operator(+=) operator(()ident(BDIGIT_DBL)operator(\))ident(zds)operator([)ident(i)operator(]*)ident(base)operator(;) - ident(zds)operator([)ident(i)operator(++]) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - operator(}) - reserved(if) operator(()ident(num)operator(\)) operator({) - ident(blen)operator(++;) - reserved(continue)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(badcheck)operator(\)) operator({) - ident(str)operator(--;) - reserved(if) operator(()ident(s)operator(+)integer(1) operator(<) ident(str) operator(&&) ident(str)operator([-)integer(1)operator(]) operator(==) char('_')operator(\)) reserved(goto) ident(bad)operator(;) - reserved(while) operator((*)ident(str) operator(&&) ident(ISSPACE)operator((*)ident(str)operator(\)\)) ident(str)operator(++;) - reserved(if) operator((*)ident(str)operator(\)) operator({) - label(bad:) - ident(rb_invalid_str)operator(()ident(s)operator(,) stringoperator(\);) - operator(}) - operator(}) - - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_str_to_inum)operator(()ident(str)operator(,) ident(base)operator(,) ident(badcheck)operator(\)) - ident(VALUE) ident(str)operator(;) - pre_type(int) ident(base)operator(;) - pre_type(int) ident(badcheck)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(;) - pre_type(long) ident(len)operator(;) - - ident(StringValue)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(badcheck)operator(\)) operator({) - ident(s) operator(=) ident(StringValueCStr)operator(()ident(str)operator(\);) - operator(}) - reserved(else) operator({) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - operator(}) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(s)operator([)ident(len)operator(]\)) operator({) comment(/* no sentinel somehow */) - pre_type(char) operator(*)ident(p) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(len)operator(+)integer(1)operator(\);) - - ident(MEMCPY)operator(()ident(p)operator(,) ident(s)operator(,) pre_type(char)operator(,) ident(len)operator(\);) - ident(p)operator([)ident(len)operator(]) operator(=) char('\\0')operator(;) - ident(s) operator(=) ident(p)operator(;) - operator(}) - operator(}) - reserved(return) ident(rb_cstr_to_inum)operator(()ident(s)operator(,) ident(base)operator(,) ident(badcheck)operator(\);) -operator(}) - -preprocessor(#if) ident(HAVE_LONG_LONG) - -ident(VALUE) -ident(rb_ull2big)operator(()ident(n)operator(\)) - pre_type(unsigned) ident(LONG_LONG) ident(n)operator(;) -operator({) - ident(BDIGIT_DBL) ident(num) operator(=) ident(n)operator(;) - pre_type(long) ident(i) operator(=) integer(0)operator(;) - ident(BDIGIT) operator(*)ident(digits)operator(;) - ident(VALUE) ident(big)operator(;) - - ident(big) operator(=) ident(bignew)operator(()ident(DIGSPERLL)operator(,) integer(1)operator(\);) - ident(digits) operator(=) ident(BDIGITS)operator(()ident(big)operator(\);) - reserved(while) operator(()ident(i) operator(<) ident(DIGSPERLL)operator(\)) operator({) - ident(digits)operator([)ident(i)operator(++]) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - operator(}) - - ident(i) operator(=) ident(DIGSPERLL)operator(;) - reserved(while) operator(()ident(i)operator(--) operator(&&) operator(!)ident(digits)operator([)ident(i)operator(]\)) operator(;) - ident(RBIGNUM)operator(()ident(big)operator(\)->)ident(len) operator(=) ident(i)operator(+)integer(1)operator(;) - reserved(return) ident(big)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ll2big)operator(()ident(n)operator(\)) - ident(LONG_LONG) ident(n)operator(;) -operator({) - pre_type(long) ident(neg) operator(=) integer(0)operator(;) - ident(VALUE) ident(big)operator(;) - - reserved(if) operator(()ident(n) operator(<) integer(0)operator(\)) operator({) - ident(n) operator(=) operator(-)ident(n)operator(;) - ident(neg) operator(=) integer(1)operator(;) - operator(}) - ident(big) operator(=) ident(rb_ull2big)operator(()ident(n)operator(\);) - reserved(if) operator(()ident(neg)operator(\)) operator({) - ident(RBIGNUM)operator(()ident(big)operator(\)->)ident(sign) operator(=) integer(0)operator(;) - operator(}) - reserved(return) ident(big)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ull2inum)operator(()ident(n)operator(\)) - pre_type(unsigned) ident(LONG_LONG) ident(n)operator(;) -operator({) - reserved(if) operator(()ident(POSFIXABLE)operator(()ident(n)operator(\)\)) reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) - reserved(return) ident(rb_ull2big)operator(()ident(n)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_ll2inum)operator(()ident(n)operator(\)) - ident(LONG_LONG) ident(n)operator(;) -operator({) - reserved(if) operator(()ident(FIXABLE)operator(()ident(n)operator(\)\)) reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) - reserved(return) ident(rb_ll2big)operator(()ident(n)operator(\);) -operator(}) - -preprocessor(#endif) comment(/* HAVE_LONG_LONG */) - -ident(VALUE) -ident(rb_cstr2inum)operator(()ident(str)operator(,) ident(base)operator(\)) - directive(const) pre_type(char) operator(*)ident(str)operator(;) - pre_type(int) ident(base)operator(;) -operator({) - reserved(return) ident(rb_cstr_to_inum)operator(()ident(str)operator(,) ident(base)operator(,) ident(base)operator(==)integer(0)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_str2inum)operator(()ident(str)operator(,) ident(base)operator(\)) - ident(VALUE) ident(str)operator(;) - pre_type(int) ident(base)operator(;) -operator({) - reserved(return) ident(rb_str_to_inum)operator(()ident(str)operator(,) ident(base)operator(,) ident(base)operator(==)integer(0)operator(\);) -operator(}) - -directive(const) pre_type(char) ident(ruby_digitmap)operator([]) operator(=) stringoperator(;) -ident(VALUE) -ident(rb_big2str0)operator(()ident(x)operator(,) ident(base)operator(,) ident(trim)operator(\)) - ident(VALUE) ident(x)operator(;) - pre_type(int) ident(base)operator(;) - pre_type(int) ident(trim)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(t)operator(;) - ident(BDIGIT) operator(*)ident(ds)operator(;) - pre_type(long) ident(i)operator(,) ident(j)operator(,) ident(hbase)operator(;) - ident(VALUE) ident(ss)operator(;) - pre_type(char) operator(*)ident(s)operator(;) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(x)operator(\)\)) operator({) - reserved(return) ident(rb_fix2str)operator(()ident(x)operator(,) ident(base)operator(\);) - operator(}) - ident(i) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(BIGZEROP)operator(()ident(x)operator(\)\)) operator({) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) - operator(}) - reserved(if) operator(()ident(i) operator(>=) ident(LONG_MAX)operator(/)ident(SIZEOF_BDIGITS)operator(/)ident(CHAR_BIT)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(\);) - operator(}) - ident(j) operator(=) ident(SIZEOF_BDIGITS)operator(*)ident(CHAR_BIT)operator(*)ident(i)operator(;) - reserved(switch) operator(()ident(base)operator(\)) operator({) - reserved(case) integer(2)operator(:) reserved(break)operator(;) - reserved(case) integer(3)operator(:) - ident(j) operator(=) ident(j) operator(*) integer(53L) operator(/) integer(84) operator(+) integer(1)operator(;) - reserved(break)operator(;) - reserved(case) integer(4)operator(:) reserved(case) integer(5)operator(:) reserved(case) integer(6)operator(:) reserved(case) integer(7)operator(:) - ident(j) operator(=) operator(()ident(j) operator(+) integer(1)operator(\)) operator(/) integer(2)operator(;) - reserved(break)operator(;) - reserved(case) integer(8)operator(:) reserved(case) integer(9)operator(:) - ident(j) operator(=) operator(()ident(j) operator(+) integer(2)operator(\)) operator(/) integer(3)operator(;) - reserved(break)operator(;) - reserved(case) integer(10)operator(:) reserved(case) integer(11)operator(:) reserved(case) integer(12)operator(:) reserved(case) integer(13)operator(:) reserved(case) integer(14)operator(:) reserved(case) integer(15)operator(:) - ident(j) operator(=) ident(j) operator(*) integer(28L) operator(/) integer(93) operator(+) integer(1)operator(;) - reserved(break)operator(;) - reserved(case) integer(16)operator(:) reserved(case) integer(17)operator(:) reserved(case) integer(18)operator(:) reserved(case) integer(19)operator(:) reserved(case) integer(20)operator(:) reserved(case) integer(21)operator(:) - reserved(case) integer(22)operator(:) reserved(case) integer(23)operator(:) reserved(case) integer(24)operator(:) reserved(case) integer(25)operator(:) reserved(case) integer(26)operator(:) reserved(case) integer(27)operator(:) - reserved(case) integer(28)operator(:) reserved(case) integer(29)operator(:) reserved(case) integer(30)operator(:) reserved(case) integer(31)operator(:) - ident(j) operator(=) operator(()ident(j) operator(+) integer(3)operator(\)) operator(/) integer(4)operator(;) - reserved(break)operator(;) - reserved(case) integer(32)operator(:) reserved(case) integer(33)operator(:) reserved(case) integer(34)operator(:) reserved(case) integer(35)operator(:) reserved(case) integer(36)operator(:) - ident(j) operator(=) operator(()ident(j) operator(+) integer(4)operator(\)) operator(/) integer(5)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(base)operator(\);) - reserved(break)operator(;) - operator(}) - ident(j)operator(++;) comment(/* space for sign */) - - ident(hbase) operator(=) ident(base) operator(*) ident(base)operator(;) -preprocessor(#if) ident(SIZEOF_BDIGITS) operator(>) integer(2) - ident(hbase) operator(*=) ident(hbase)operator(;) -preprocessor(#endif) - - ident(t) operator(=) ident(rb_big_clone)operator(()ident(x)operator(\);) - ident(ds) operator(=) ident(BDIGITS)operator(()ident(t)operator(\);) - ident(ss) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(j)operator(+)integer(1)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(ss)operator(\)->)ident(ptr)operator(;) - - ident(s)operator([)integer(0)operator(]) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(?) char('+') operator(:) char('-')operator(;) - ident(TRAP_BEG)operator(;) - reserved(while) operator(()ident(i) operator(&&) ident(j) operator(>) integer(1)operator(\)) operator({) - pre_type(long) ident(k) operator(=) ident(i)operator(;) - ident(BDIGIT_DBL) ident(num) operator(=) integer(0)operator(;) - - reserved(while) operator(()ident(k)operator(--\)) operator({) - ident(num) operator(=) ident(BIGUP)operator(()ident(num)operator(\)) operator(+) ident(ds)operator([)ident(k)operator(];) - ident(ds)operator([)ident(k)operator(]) operator(=) operator(()ident(BDIGIT)operator(\)()ident(num) operator(/) ident(hbase)operator(\);) - ident(num) operator(%=) ident(hbase)operator(;) - operator(}) - reserved(if) operator(()ident(trim) operator(&&) ident(ds)operator([)ident(i)operator(-)integer(1)operator(]) operator(==) integer(0)operator(\)) ident(i)operator(--;) - ident(k) operator(=) ident(SIZEOF_BDIGITS)operator(;) - reserved(while) operator(()ident(k)operator(--\)) operator({) - ident(s)operator([--)ident(j)operator(]) operator(=) ident(ruby_digitmap)operator([)ident(num) operator(%) ident(base)operator(];) - ident(num) operator(/=) ident(base)operator(;) - reserved(if) operator((!)ident(trim) operator(&&) ident(j) operator(<=) integer(1)operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(trim) operator(&&) ident(i) operator(==) integer(0) operator(&&) ident(num) operator(==) integer(0)operator(\)) reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(trim)operator(\)) operator({)reserved(while) operator(()ident(s)operator([)ident(j)operator(]) operator(==) char('0')operator(\)) ident(j)operator(++;}) - ident(i) operator(=) ident(RSTRING)operator(()ident(ss)operator(\)->)ident(len) operator(-) ident(j)operator(;) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - ident(memmove)operator(()ident(s)operator(,) ident(s)operator(+)ident(j)operator(,) ident(i)operator(\);) - ident(RSTRING)operator(()ident(ss)operator(\)->)ident(len) operator(=) ident(i)operator(-)integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(memmove)operator(()ident(s)operator(+)integer(1)operator(,) ident(s)operator(+)ident(j)operator(,) ident(i)operator(\);) - ident(RSTRING)operator(()ident(ss)operator(\)->)ident(len) operator(=) ident(i)operator(;) - operator(}) - ident(s)operator([)ident(RSTRING)operator(()ident(ss)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) - ident(TRAP_END)operator(;) - - reserved(return) ident(ss)operator(;) -operator(}) - -ident(VALUE) -ident(rb_big2str)operator(()ident(VALUE) ident(x)operator(,) pre_type(int) ident(base)operator(\)) -operator({) - reserved(return) ident(rb_big2str0)operator(()ident(x)operator(,) ident(base)operator(,) ident(Qtrue)operator(\);) -operator(}) - -comment(/* - * call-seq: - * big.to_s(base=10\) => string - * - * Returns a string containing the representation of big radix - * base (2 through 36\). - * - * 12345654321.to_s #=> "12345654321" - * 12345654321.to_s(2\) #=> "1011011111110110111011110000110001" - * 12345654321.to_s(8\) #=> "133766736061" - * 12345654321.to_s(16\) #=> "2dfdbbc31" - * 78546939656932.to_s(36\) #=> "rubyrules" - */) - -directive(static) ident(VALUE) -ident(rb_big_to_s)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(x)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(x)operator(;) -operator({) - ident(VALUE) ident(b)operator(;) - pre_type(int) ident(base)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(b)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) ident(base) operator(=) integer(10)operator(;) - reserved(else) ident(base) operator(=) ident(NUM2INT)operator(()ident(b)operator(\);) - reserved(return) ident(rb_big2str)operator(()ident(x)operator(,) ident(base)operator(\);) -operator(}) - -directive(static) pre_type(unsigned) pre_type(long) -ident(big2ulong)operator(()ident(x)operator(,) ident(type)operator(\)) - ident(VALUE) ident(x)operator(;) - pre_type(char) operator(*)ident(type)operator(;) -operator({) - pre_type(long) ident(len) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(BDIGIT_DBL) ident(num)operator(;) - ident(BDIGIT) operator(*)ident(ds)operator(;) - - reserved(if) operator(()ident(len) operator(>) ident(SIZEOF_LONG)operator(/)ident(SIZEOF_BDIGITS)operator(\)) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(type)operator(\);) - ident(ds) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(num) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(num) operator(=) ident(BIGUP)operator(()ident(num)operator(\);) - ident(num) operator(+=) ident(ds)operator([)ident(len)operator(];) - operator(}) - reserved(return) ident(num)operator(;) -operator(}) - -pre_type(unsigned) pre_type(long) -ident(rb_big2ulong_pack)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - pre_type(unsigned) pre_type(long) ident(num) operator(=) ident(big2ulong)operator(()ident(x)operator(,) stringoperator(\);) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - reserved(return) operator(-)ident(num)operator(;) - operator(}) - reserved(return) ident(num)operator(;) -operator(}) - -pre_type(unsigned) pre_type(long) -ident(rb_big2ulong)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - pre_type(unsigned) pre_type(long) ident(num) operator(=) ident(big2ulong)operator(()ident(x)operator(,) stringoperator(\);) - - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - reserved(if) operator((()pre_type(long)operator(\))ident(num) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(\);) - operator(}) - reserved(return) operator(-)ident(num)operator(;) - operator(}) - reserved(return) ident(num)operator(;) -operator(}) - -pre_type(long) -ident(rb_big2long)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - pre_type(unsigned) pre_type(long) ident(num) operator(=) ident(big2ulong)operator(()ident(x)operator(,) stringoperator(\);) - - reserved(if) operator((()pre_type(long)operator(\))ident(num) operator(<) integer(0) operator(&&) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(||) operator(()pre_type(long)operator(\))ident(num) operator(!=) ident(LONG_MIN)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) reserved(return) operator(-()pre_type(long)operator(\))ident(num)operator(;) - reserved(return) ident(num)operator(;) -operator(}) - -preprocessor(#if) ident(HAVE_LONG_LONG) - -directive(static) pre_type(unsigned) ident(LONG_LONG) -ident(big2ull)operator(()ident(x)operator(,) ident(type)operator(\)) - ident(VALUE) ident(x)operator(;) - pre_type(char) operator(*)ident(type)operator(;) -operator({) - pre_type(long) ident(len) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(BDIGIT_DBL) ident(num)operator(;) - ident(BDIGIT) operator(*)ident(ds)operator(;) - - reserved(if) operator(()ident(len) operator(>) ident(SIZEOF_LONG_LONG)operator(/)ident(SIZEOF_BDIGITS)operator(\)) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(type)operator(\);) - ident(ds) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(num) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(num) operator(=) ident(BIGUP)operator(()ident(num)operator(\);) - ident(num) operator(+=) ident(ds)operator([)ident(len)operator(];) - operator(}) - reserved(return) ident(num)operator(;) -operator(}) - -pre_type(unsigned) ident(LONG_LONG) -ident(rb_big2ull)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - pre_type(unsigned) ident(LONG_LONG) ident(num) operator(=) ident(big2ull)operator(()ident(x)operator(,) stringoperator(\);) - - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) reserved(return) operator(-)ident(num)operator(;) - reserved(return) ident(num)operator(;) -operator(}) - -ident(LONG_LONG) -ident(rb_big2ll)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - pre_type(unsigned) ident(LONG_LONG) ident(num) operator(=) ident(big2ull)operator(()ident(x)operator(,) stringoperator(\);) - - reserved(if) operator((()ident(LONG_LONG)operator(\))ident(num) operator(<) integer(0) operator(&&) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) - operator(||) operator(()ident(LONG_LONG)operator(\))ident(num) operator(!=) ident(LLONG_MIN)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) reserved(return) operator(-()ident(LONG_LONG)operator(\))ident(num)operator(;) - reserved(return) ident(num)operator(;) -operator(}) - -preprocessor(#endif) comment(/* HAVE_LONG_LONG */) - -directive(static) ident(VALUE) -ident(dbl2big)operator(()ident(d)operator(\)) - pre_type(double) ident(d)operator(;) -operator({) - pre_type(long) ident(i) operator(=) integer(0)operator(;) - ident(BDIGIT) ident(c)operator(;) - ident(BDIGIT) operator(*)ident(digits)operator(;) - ident(VALUE) ident(z)operator(;) - pre_type(double) ident(u) operator(=) operator(()ident(d) operator(<) integer(0)operator(\)?-)ident(d)operator(:)ident(d)operator(;) - - reserved(if) operator(()ident(isinf)operator(()ident(d)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eFloatDomainError)operator(,) ident(d) operator(<) integer(0) operator(?) string operator(:) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(isnan)operator(()ident(d)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eFloatDomainError)operator(,) stringoperator(\);) - operator(}) - - reserved(while) operator((!)ident(POSFIXABLE)operator(()ident(u)operator(\)) operator(||) integer(0) operator(!=) operator(()pre_type(long)operator(\))ident(u)operator(\)) operator({) - ident(u) operator(/=) operator(()pre_type(double)operator(\)()ident(BIGRAD)operator(\);) - ident(i)operator(++;) - operator(}) - ident(z) operator(=) ident(bignew)operator(()ident(i)operator(,) ident(d)operator(>=)integer(0)operator(\);) - ident(digits) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - reserved(while) operator(()ident(i)operator(--\)) operator({) - ident(u) operator(*=) ident(BIGRAD)operator(;) - ident(c) operator(=) operator(()ident(BDIGIT)operator(\))ident(u)operator(;) - ident(u) operator(-=) ident(c)operator(;) - ident(digits)operator([)ident(i)operator(]) operator(=) ident(c)operator(;) - operator(}) - - reserved(return) ident(z)operator(;) -operator(}) - -ident(VALUE) -ident(rb_dbl2big)operator(()ident(d)operator(\)) - pre_type(double) ident(d)operator(;) -operator({) - reserved(return) ident(bignorm)operator(()ident(dbl2big)operator(()ident(d)operator(\)\);) -operator(}) - -pre_type(double) -ident(rb_big2dbl)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - pre_type(double) ident(d) operator(=) float(0)float(.0)operator(;) - pre_type(long) ident(i) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(BDIGIT) operator(*)ident(ds) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - - reserved(while) operator(()ident(i)operator(--\)) operator({) - ident(d) operator(=) ident(ds)operator([)ident(i)operator(]) operator(+) ident(BIGRAD)operator(*)ident(d)operator(;) - operator(}) - reserved(if) operator(()ident(isinf)operator(()ident(d)operator(\)\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - ident(d) operator(=) ident(HUGE_VAL)operator(;) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) ident(d) operator(=) operator(-)ident(d)operator(;) - reserved(return) ident(d)operator(;) -operator(}) - -comment(/* - * call-seq: - * big.to_f -> float - * - * Converts big to a Float. If big doesn't - * fit in a Float, the result is infinity. - * - */) - -directive(static) ident(VALUE) -ident(rb_big_to_f)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - reserved(return) ident(rb_float_new)operator(()ident(rb_big2dbl)operator(()ident(x)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * big <=> numeric => -1, 0, +1 - * - * Comparison---Returns -1, 0, or +1 depending on whether big is - * less than, equal to, or greater than numeric. This is the - * basis for the tests in Comparable. - * - */) - -directive(static) ident(VALUE) -ident(rb_big_cmp)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(long) ident(xlen) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - operator({) - pre_type(double) ident(a) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - - reserved(if) operator(()ident(isinf)operator(()ident(a)operator(\)\)) operator({) - reserved(if) operator(()ident(a) operator(>) float(0)float(.0)operator(\)) reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - reserved(else) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - operator(}) - reserved(return) ident(rb_dbl_cmp)operator(()ident(rb_big2dbl)operator(()ident(x)operator(\),) ident(a)operator(\);) - operator(}) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_cmp)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(>) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(<) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\)) reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - reserved(if) operator(()ident(xlen) operator(<) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) - reserved(return) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator(?) ident(INT2FIX)operator((-)integer(1)operator(\)) operator(:) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(if) operator(()ident(xlen) operator(>) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) - reserved(return) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator(?) ident(INT2FIX)operator(()integer(1)operator(\)) operator(:) ident(INT2FIX)operator((-)integer(1)operator(\);) - - reserved(while)operator(()ident(xlen)operator(--) operator(&&) operator(()ident(BDIGITS)operator(()ident(x)operator(\)[)ident(xlen)operator(]==)ident(BDIGITS)operator(()ident(y)operator(\)[)ident(xlen)operator(]\)\);) - reserved(if) operator((-)integer(1) operator(==) ident(xlen)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(return) operator(()ident(BDIGITS)operator(()ident(x)operator(\)[)ident(xlen)operator(]) operator(>) ident(BDIGITS)operator(()ident(y)operator(\)[)ident(xlen)operator(]\)) operator(?) - operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(?) ident(INT2FIX)operator(()integer(1)operator(\)) operator(:) ident(INT2FIX)operator((-)integer(1)operator(\)\)) operator(:) - operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(?) ident(INT2FIX)operator((-)integer(1)operator(\)) operator(:) ident(INT2FIX)operator(()integer(1)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * big == obj => true or false - * - * Returns true only if obj has the same value - * as big. Contrast this with Bignum#eql?, which - * requires obj to be a Bignum. - * - * 68719476736 == 68719476736.0 #=> true - */) - -directive(static) ident(VALUE) -ident(rb_big_eq)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - reserved(break)operator(;) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(break)operator(;) - reserved(case) ident(T_FLOAT)operator(:) - operator({) - directive(volatile) pre_type(double) ident(a)operator(,) ident(b)operator(;) - - ident(a) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - reserved(if) operator(()ident(isnan)operator(()ident(a)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - ident(b) operator(=) ident(rb_big2dbl)operator(()ident(x)operator(\);) - reserved(return) operator(()ident(a) operator(==) ident(b)operator(\)?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) - operator(}) - reserved(default)operator(:) - reserved(return) ident(rb_equal)operator(()ident(y)operator(,) ident(x)operator(\);) - operator(}) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(!=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(!=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(MEMCMP)operator(()ident(BDIGITS)operator(()ident(x)operator(\),)ident(BDIGITS)operator(()ident(y)operator(\),)ident(BDIGIT)operator(,)ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) operator(!=) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * big.eql?(obj\) => true or false - * - * Returns true only if obj is a - * Bignum with the same value as big. Contrast this - * with Bignum#==, which performs type conversions. - * - * 68719476736.eql?(68719476736.0\) #=> false - */) - -directive(static) ident(VALUE) -ident(rb_big_eql)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(y)operator(\)) operator(!=) ident(T_BIGNUM)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(!=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(!=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(MEMCMP)operator(()ident(BDIGITS)operator(()ident(x)operator(\),)ident(BDIGITS)operator(()ident(y)operator(\),)ident(BDIGIT)operator(,)ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) operator(!=) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * -big => other_big - * - * Unary minus (returns a new Bignum whose value is 0-big\) - */) - -directive(static) ident(VALUE) -ident(rb_big_uminus)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - ident(VALUE) ident(z) operator(=) ident(rb_big_clone)operator(()ident(x)operator(\);) - - ident(RBIGNUM)operator(()ident(z)operator(\)->)ident(sign) operator(=) operator(!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(;) - - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ~big => integer - * - * Inverts the bits in big. As Bignums are conceptually infinite - * length, the result acts as if it had an infinite number of one - * bits to the left. In hex representations, this is displayed - * as two periods to the left of the digits. - * - * sprintf("%X", ~0x1122334455\) #=> "..FEEDDCCBBAA" - */) - -directive(static) ident(VALUE) -ident(rb_big_neg)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - ident(VALUE) ident(z) operator(=) ident(rb_big_clone)operator(()ident(x)operator(\);) - pre_type(long) ident(i)operator(;) - ident(BDIGIT) operator(*)ident(ds)operator(;) - - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) ident(get2comp)operator(()ident(z)operator(\);) - ident(ds) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - ident(i) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - reserved(if) operator((!)ident(i)operator(\)) reserved(return) ident(INT2FIX)operator((~)integer(0)operator(\);) - reserved(while) operator(()ident(i)operator(--\)) ident(ds)operator([)ident(i)operator(]) operator(=) operator(~)ident(ds)operator([)ident(i)operator(];) - ident(RBIGNUM)operator(()ident(z)operator(\)->)ident(sign) operator(=) operator(!)ident(RBIGNUM)operator(()ident(z)operator(\)->)ident(sign)operator(;) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) ident(get2comp)operator(()ident(z)operator(\);) - - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(bigsub)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(z) operator(=) integer(0)operator(;) - ident(BDIGIT) operator(*)ident(zds)operator(;) - ident(BDIGIT_DBL_SIGNED) ident(num)operator(;) - pre_type(long) ident(i) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - - comment(/* if x is larger than y, swap */) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(<) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) operator({) - ident(z) operator(=) ident(x)operator(;) ident(x) operator(=) ident(y)operator(;) ident(y) operator(=) ident(z)operator(;) comment(/* swap x y */) - operator(}) - reserved(else) reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(==) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) operator({) - reserved(while) operator(()ident(i) operator(>) integer(0)operator(\)) operator({) - ident(i)operator(--;) - reserved(if) operator(()ident(BDIGITS)operator(()ident(x)operator(\)[)ident(i)operator(]) operator(>) ident(BDIGITS)operator(()ident(y)operator(\)[)ident(i)operator(]\)) operator({) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(BDIGITS)operator(()ident(x)operator(\)[)ident(i)operator(]) operator(<) ident(BDIGITS)operator(()ident(y)operator(\)[)ident(i)operator(]\)) operator({) - ident(z) operator(=) ident(x)operator(;) ident(x) operator(=) ident(y)operator(;) ident(y) operator(=) ident(z)operator(;) comment(/* swap x y */) - reserved(break)operator(;) - operator(}) - operator(}) - operator(}) - - ident(z) operator(=) ident(bignew)operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(,) ident(z)operator(==)integer(0)operator(\);) - ident(zds) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(,) ident(num) operator(=) integer(0)operator(;) ident(i) operator(<) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(num) operator(+=) operator(()ident(BDIGIT_DBL_SIGNED)operator(\))ident(BDIGITS)operator(()ident(x)operator(\)[)ident(i)operator(]) operator(-) ident(BDIGITS)operator(()ident(y)operator(\)[)ident(i)operator(];) - ident(zds)operator([)ident(i)operator(]) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - operator(}) - reserved(while) operator(()ident(num) operator(&&) ident(i) operator(<) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(\)) operator({) - ident(num) operator(+=) ident(BDIGITS)operator(()ident(x)operator(\)[)ident(i)operator(];) - ident(zds)operator([)ident(i)operator(++]) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - operator(}) - reserved(while) operator(()ident(i) operator(<) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(\)) operator({) - ident(zds)operator([)ident(i)operator(]) operator(=) ident(BDIGITS)operator(()ident(x)operator(\)[)ident(i)operator(];) - ident(i)operator(++;) - operator(}) - - reserved(return) ident(z)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(bigadd)operator(()ident(x)operator(,) ident(y)operator(,) ident(sign)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) - pre_type(int) ident(sign)operator(;) -operator({) - ident(VALUE) ident(z)operator(;) - ident(BDIGIT_DBL) ident(num)operator(;) - pre_type(long) ident(i)operator(,) ident(len)operator(;) - - ident(sign) operator(=) operator(()ident(sign) operator(==) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\);) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(!=) ident(sign)operator(\)) operator({) - reserved(if) operator(()ident(sign)operator(\)) reserved(return) ident(bigsub)operator(()ident(y)operator(,) ident(x)operator(\);) - reserved(return) ident(bigsub)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(>) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) operator({) - ident(len) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(+) integer(1)operator(;) - ident(z) operator(=) ident(x)operator(;) ident(x) operator(=) ident(y)operator(;) ident(y) operator(=) ident(z)operator(;) - operator(}) - reserved(else) operator({) - ident(len) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len) operator(+) integer(1)operator(;) - operator(}) - ident(z) operator(=) ident(bignew)operator(()ident(len)operator(,) ident(sign)operator(\);) - - ident(len) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(,) ident(num) operator(=) integer(0)operator(;) ident(i) operator(<) ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(num) operator(+=) operator(()ident(BDIGIT_DBL)operator(\))ident(BDIGITS)operator(()ident(x)operator(\)[)ident(i)operator(]) operator(+) ident(BDIGITS)operator(()ident(y)operator(\)[)ident(i)operator(];) - ident(BDIGITS)operator(()ident(z)operator(\)[)ident(i)operator(]) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - operator(}) - ident(len) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(;) - reserved(while) operator(()ident(num) operator(&&) ident(i) operator(<) ident(len)operator(\)) operator({) - ident(num) operator(+=) ident(BDIGITS)operator(()ident(y)operator(\)[)ident(i)operator(];) - ident(BDIGITS)operator(()ident(z)operator(\)[)ident(i)operator(++]) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - operator(}) - reserved(while) operator(()ident(i) operator(<) ident(len)operator(\)) operator({) - ident(BDIGITS)operator(()ident(z)operator(\)[)ident(i)operator(]) operator(=) ident(BDIGITS)operator(()ident(y)operator(\)[)ident(i)operator(];) - ident(i)operator(++;) - operator(}) - ident(BDIGITS)operator(()ident(z)operator(\)[)ident(i)operator(]) operator(=) operator(()ident(BDIGIT)operator(\))ident(num)operator(;) - - reserved(return) ident(z)operator(;) -operator(}) - -comment(/* - * call-seq: - * big + other => Numeric - * - * Adds big and other, returning the result. - */) - -ident(VALUE) -ident(rb_big_plus)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - comment(/* fall through */) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(bignorm)operator(()ident(bigadd)operator(()ident(x)operator(,) ident(y)operator(,) integer(1)operator(\)\);) - - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(rb_big2dbl)operator(()ident(x)operator(\)) operator(+) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\);) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * big - other => Numeric - * - * Subtracts other from big, returning the result. - */) - -ident(VALUE) -ident(rb_big_minus)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - comment(/* fall through */) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(bignorm)operator(()ident(bigadd)operator(()ident(x)operator(,) ident(y)operator(,) integer(0)operator(\)\);) - - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(rb_big2dbl)operator(()ident(x)operator(\)) operator(-) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\);) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -ident(VALUE) -ident(rb_big_mul0)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(long) ident(i)operator(,) ident(j)operator(;) - ident(BDIGIT_DBL) ident(n) operator(=) integer(0)operator(;) - ident(VALUE) ident(z)operator(;) - ident(BDIGIT) operator(*)ident(zds)operator(;) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(x)operator(\)\)) ident(x) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(x)operator(\)\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(rb_big2dbl)operator(()ident(x)operator(\)) operator(*) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\);) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - - ident(j) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(+) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len) operator(+) integer(1)operator(;) - ident(z) operator(=) ident(bignew)operator(()ident(j)operator(,) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(==)ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\);) - ident(zds) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - reserved(while) operator(()ident(j)operator(--\)) ident(zds)operator([)ident(j)operator(]) operator(=) integer(0)operator(;) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(BDIGIT_DBL) ident(dd) operator(=) ident(BDIGITS)operator(()ident(x)operator(\)[)ident(i)operator(];) - reserved(if) operator(()ident(dd) operator(==) integer(0)operator(\)) reserved(continue)operator(;) - ident(n) operator(=) integer(0)operator(;) - reserved(for) operator(()ident(j) operator(=) integer(0)operator(;) ident(j) operator(<) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(;) ident(j)operator(++\)) operator({) - ident(BDIGIT_DBL) ident(ee) operator(=) ident(n) operator(+) operator(()ident(BDIGIT_DBL)operator(\))ident(dd) operator(*) ident(BDIGITS)operator(()ident(y)operator(\)[)ident(j)operator(];) - ident(n) operator(=) ident(zds)operator([)ident(i) operator(+) ident(j)operator(]) operator(+) ident(ee)operator(;) - reserved(if) operator(()ident(ee)operator(\)) ident(zds)operator([)ident(i) operator(+) ident(j)operator(]) operator(=) ident(BIGLO)operator(()ident(n)operator(\);) - ident(n) operator(=) ident(BIGDN)operator(()ident(n)operator(\);) - operator(}) - reserved(if) operator(()ident(n)operator(\)) operator({) - ident(zds)operator([)ident(i) operator(+) ident(j)operator(]) operator(=) ident(n)operator(;) - operator(}) - operator(}) - - reserved(return) ident(z)operator(;) -operator(}) - -comment(/* - * call-seq: - * big * other => Numeric - * - * Multiplies big and other, returning the result. - */) - -ident(VALUE) -ident(rb_big_mul)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(return) ident(bignorm)operator(()ident(rb_big_mul0)operator(()ident(x)operator(,) ident(y)operator(\)\);) -operator(}) - -directive(static) directive(void) -ident(bigdivrem)operator(()ident(x)operator(,) ident(y)operator(,) ident(divp)operator(,) ident(modp)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) - ident(VALUE) operator(*)ident(divp)operator(,) operator(*)ident(modp)operator(;) -operator({) - pre_type(long) ident(nx) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(,) ident(ny) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(;) - pre_type(long) ident(i)operator(,) ident(j)operator(;) - ident(VALUE) ident(yy)operator(,) ident(z)operator(;) - ident(BDIGIT) operator(*)ident(xds)operator(,) operator(*)ident(yds)operator(,) operator(*)ident(zds)operator(,) operator(*)ident(tds)operator(;) - ident(BDIGIT_DBL) ident(t2)operator(;) - ident(BDIGIT_DBL_SIGNED) ident(num)operator(;) - ident(BDIGIT) ident(dd)operator(,) ident(q)operator(;) - - reserved(if) operator(()ident(BIGZEROP)operator(()ident(y)operator(\)\)) ident(rb_num_zerodiv)operator((\);) - ident(yds) operator(=) ident(BDIGITS)operator(()ident(y)operator(\);) - reserved(if) operator(()ident(nx) operator(<) ident(ny) operator(||) operator(()ident(nx) operator(==) ident(ny) operator(&&) ident(BDIGITS)operator(()ident(x)operator(\)[)ident(nx) operator(-) integer(1)operator(]) operator(<) ident(BDIGITS)operator(()ident(y)operator(\)[)ident(ny) operator(-) integer(1)operator(]\)\)) operator({) - reserved(if) operator(()ident(divp)operator(\)) operator(*)ident(divp) operator(=) ident(rb_int2big)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(modp)operator(\)) operator(*)ident(modp) operator(=) ident(x)operator(;) - reserved(return)operator(;) - operator(}) - ident(xds) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - reserved(if) operator(()ident(ny) operator(==) integer(1)operator(\)) operator({) - ident(dd) operator(=) ident(yds)operator([)integer(0)operator(];) - ident(z) operator(=) ident(rb_big_clone)operator(()ident(x)operator(\);) - ident(zds) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - ident(t2) operator(=) integer(0)operator(;) ident(i) operator(=) ident(nx)operator(;) - reserved(while) operator(()ident(i)operator(--\)) operator({) - ident(t2) operator(=) ident(BIGUP)operator(()ident(t2)operator(\)) operator(+) ident(zds)operator([)ident(i)operator(];) - ident(zds)operator([)ident(i)operator(]) operator(=) operator(()ident(BDIGIT)operator(\)()ident(t2) operator(/) ident(dd)operator(\);) - ident(t2) operator(%=) ident(dd)operator(;) - operator(}) - ident(RBIGNUM)operator(()ident(z)operator(\)->)ident(sign) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(==)ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(;) - reserved(if) operator(()ident(modp)operator(\)) operator({) - operator(*)ident(modp) operator(=) ident(rb_uint2big)operator((()pre_type(unsigned) pre_type(long)operator(\))ident(t2)operator(\);) - ident(RBIGNUM)operator((*)ident(modp)operator(\)->)ident(sign) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(;) - operator(}) - reserved(if) operator(()ident(divp)operator(\)) operator(*)ident(divp) operator(=) ident(z)operator(;) - reserved(return)operator(;) - operator(}) - ident(z) operator(=) ident(bignew)operator(()ident(nx)operator(==)ident(ny)operator(?)ident(nx)operator(+)integer(2)operator(:)ident(nx)operator(+)integer(1)operator(,) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(==)ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\);) - ident(zds) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - reserved(if) operator(()ident(nx)operator(==)ident(ny)operator(\)) ident(zds)operator([)ident(nx)operator(+)integer(1)operator(]) operator(=) integer(0)operator(;) - reserved(while) operator((!)ident(yds)operator([)ident(ny)operator(-)integer(1)operator(]\)) ident(ny)operator(--;) - - ident(dd) operator(=) integer(0)operator(;) - ident(q) operator(=) ident(yds)operator([)ident(ny)operator(-)integer(1)operator(];) - reserved(while) operator((()ident(q) operator(&) operator(()integer(1)operator(<<()ident(BITSPERDIG)operator(-)integer(1)operator(\)\)\)) operator(==) integer(0)operator(\)) operator({) - ident(q) operator(<<=) integer(1)operator(;) - ident(dd)operator(++;) - operator(}) - reserved(if) operator(()ident(dd)operator(\)) operator({) - ident(yy) operator(=) ident(rb_big_clone)operator(()ident(y)operator(\);) - ident(tds) operator(=) ident(BDIGITS)operator(()ident(yy)operator(\);) - ident(j) operator(=) integer(0)operator(;) - ident(t2) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(j)operator(<)ident(ny)operator(\)) operator({) - ident(t2) operator(+=) operator(()ident(BDIGIT_DBL)operator(\))ident(yds)operator([)ident(j)operator(]<<)ident(dd)operator(;) - ident(tds)operator([)ident(j)operator(++]) operator(=) ident(BIGLO)operator(()ident(t2)operator(\);) - ident(t2) operator(=) ident(BIGDN)operator(()ident(t2)operator(\);) - operator(}) - ident(yds) operator(=) ident(tds)operator(;) - ident(j) operator(=) integer(0)operator(;) - ident(t2) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(j)operator(<)ident(nx)operator(\)) operator({) - ident(t2) operator(+=) operator(()ident(BDIGIT_DBL)operator(\))ident(xds)operator([)ident(j)operator(]<<)ident(dd)operator(;) - ident(zds)operator([)ident(j)operator(++]) operator(=) ident(BIGLO)operator(()ident(t2)operator(\);) - ident(t2) operator(=) ident(BIGDN)operator(()ident(t2)operator(\);) - operator(}) - ident(zds)operator([)ident(j)operator(]) operator(=) operator(()ident(BDIGIT)operator(\))ident(t2)operator(;) - operator(}) - reserved(else) operator({) - ident(zds)operator([)ident(nx)operator(]) operator(=) integer(0)operator(;) - ident(j) operator(=) ident(nx)operator(;) - reserved(while) operator(()ident(j)operator(--\)) ident(zds)operator([)ident(j)operator(]) operator(=) ident(xds)operator([)ident(j)operator(];) - operator(}) - - ident(j) operator(=) ident(nx)operator(==)ident(ny)operator(?)ident(nx)operator(+)integer(1)operator(:)ident(nx)operator(;) - reserved(do) operator({) - reserved(if) operator(()ident(zds)operator([)ident(j)operator(]) operator(==) ident(yds)operator([)ident(ny)operator(-)integer(1)operator(]\)) ident(q) operator(=) ident(BIGRAD)operator(-)integer(1)operator(;) - reserved(else) ident(q) operator(=) operator(()ident(BDIGIT)operator(\)(()ident(BIGUP)operator(()ident(zds)operator([)ident(j)operator(]\)) operator(+) ident(zds)operator([)ident(j)operator(-)integer(1)operator(]\))operator(/)ident(yds)operator([)ident(ny)operator(-)integer(1)operator(]\);) - reserved(if) operator(()ident(q)operator(\)) operator({) - ident(i) operator(=) integer(0)operator(;) ident(num) operator(=) integer(0)operator(;) ident(t2) operator(=) integer(0)operator(;) - reserved(do) operator({) comment(/* multiply and subtract */) - ident(BDIGIT_DBL) ident(ee)operator(;) - ident(t2) operator(+=) operator(()ident(BDIGIT_DBL)operator(\))ident(yds)operator([)ident(i)operator(]) operator(*) ident(q)operator(;) - ident(ee) operator(=) ident(num) operator(-) ident(BIGLO)operator(()ident(t2)operator(\);) - ident(num) operator(=) operator(()ident(BDIGIT_DBL)operator(\))ident(zds)operator([)ident(j) operator(-) ident(ny) operator(+) ident(i)operator(]) operator(+) ident(ee)operator(;) - reserved(if) operator(()ident(ee)operator(\)) ident(zds)operator([)ident(j) operator(-) ident(ny) operator(+) ident(i)operator(]) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - ident(t2) operator(=) ident(BIGDN)operator(()ident(t2)operator(\);) - operator(}) reserved(while) operator((++)ident(i) operator(<) ident(ny)operator(\);) - ident(num) operator(+=) ident(zds)operator([)ident(j) operator(-) ident(ny) operator(+) ident(i)operator(]) operator(-) ident(t2)operator(;)comment(/* borrow from high digit; don't update */) - reserved(while) operator(()ident(num)operator(\)) operator({) comment(/* "add back" required */) - ident(i) operator(=) integer(0)operator(;) ident(num) operator(=) integer(0)operator(;) ident(q)operator(--;) - reserved(do) operator({) - ident(BDIGIT_DBL) ident(ee) operator(=) ident(num) operator(+) ident(yds)operator([)ident(i)operator(];) - ident(num) operator(=) operator(()ident(BDIGIT_DBL)operator(\))ident(zds)operator([)ident(j) operator(-) ident(ny) operator(+) ident(i)operator(]) operator(+) ident(ee)operator(;) - reserved(if) operator(()ident(ee)operator(\)) ident(zds)operator([)ident(j) operator(-) ident(ny) operator(+) ident(i)operator(]) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - operator(}) reserved(while) operator((++)ident(i) operator(<) ident(ny)operator(\);) - ident(num)operator(--;) - operator(}) - operator(}) - ident(zds)operator([)ident(j)operator(]) operator(=) ident(q)operator(;) - operator(}) reserved(while) operator((--)ident(j) operator(>=) ident(ny)operator(\);) - reserved(if) operator(()ident(divp)operator(\)) operator({) comment(/* move quotient down in z */) - operator(*)ident(divp) operator(=) ident(rb_big_clone)operator(()ident(z)operator(\);) - ident(zds) operator(=) ident(BDIGITS)operator((*)ident(divp)operator(\);) - ident(j) operator(=) operator(()ident(nx)operator(==)ident(ny) operator(?) ident(nx)operator(+)integer(2) operator(:) ident(nx)operator(+)integer(1)operator(\)) operator(-) ident(ny)operator(;) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;)ident(i) operator(<) ident(j)operator(;)ident(i)operator(++\)) ident(zds)operator([)ident(i)operator(]) operator(=) ident(zds)operator([)ident(i)operator(+)ident(ny)operator(];) - ident(RBIGNUM)operator((*)ident(divp)operator(\)->)ident(len) operator(=) ident(i)operator(;) - operator(}) - reserved(if) operator(()ident(modp)operator(\)) operator({) comment(/* normalize remainder */) - operator(*)ident(modp) operator(=) ident(rb_big_clone)operator(()ident(z)operator(\);) - ident(zds) operator(=) ident(BDIGITS)operator((*)ident(modp)operator(\);) - reserved(while) operator((--)ident(ny) operator(&&) operator(!)ident(zds)operator([)ident(ny)operator(]\);) operator(++)ident(ny)operator(;) - reserved(if) operator(()ident(dd)operator(\)) operator({) - ident(t2) operator(=) integer(0)operator(;) ident(i) operator(=) ident(ny)operator(;) - reserved(while)operator(()ident(i)operator(--\)) operator({) - ident(t2) operator(=) operator(()ident(t2) operator(|) ident(zds)operator([)ident(i)operator(]\)) operator(>>) ident(dd)operator(;) - ident(q) operator(=) ident(zds)operator([)ident(i)operator(];) - ident(zds)operator([)ident(i)operator(]) operator(=) ident(BIGLO)operator(()ident(t2)operator(\);) - ident(t2) operator(=) ident(BIGUP)operator(()ident(q)operator(\);) - operator(}) - operator(}) - ident(RBIGNUM)operator((*)ident(modp)operator(\)->)ident(len) operator(=) ident(ny)operator(;) - ident(RBIGNUM)operator((*)ident(modp)operator(\)->)ident(sign) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(bigdivmod)operator(()ident(x)operator(,) ident(y)operator(,) ident(divp)operator(,) ident(modp)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) - ident(VALUE) operator(*)ident(divp)operator(,) operator(*)ident(modp)operator(;) -operator({) - ident(VALUE) ident(mod)operator(;) - - ident(bigdivrem)operator(()ident(x)operator(,) ident(y)operator(,) ident(divp)operator(,) operator(&)ident(mod)operator(\);) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(!=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign) operator(&&) operator(!)ident(BIGZEROP)operator(()ident(mod)operator(\)\)) operator({) - reserved(if) operator(()ident(divp)operator(\)) operator(*)ident(divp) operator(=) ident(bigadd)operator((*)ident(divp)operator(,) ident(rb_int2big)operator(()integer(1)operator(\),) integer(0)operator(\);) - reserved(if) operator(()ident(modp)operator(\)) operator(*)ident(modp) operator(=) ident(bigadd)operator(()ident(mod)operator(,) ident(y)operator(,) integer(1)operator(\);) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(divp)operator(\)) operator(*)ident(divp) operator(=) operator(*)ident(divp)operator(;) - reserved(if) operator(()ident(modp)operator(\)) operator(*)ident(modp) operator(=) ident(mod)operator(;) - operator(}) -operator(}) - -comment(/* - * call-seq: - * big / other => Numeric - * big.div(other\) => Numeric - * - * Divides big by other, returning the result. - */) - -directive(static) ident(VALUE) -ident(rb_big_div)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(z)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(rb_big2dbl)operator(()ident(x)operator(\)) operator(/) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\);) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - ident(bigdivmod)operator(()ident(x)operator(,) ident(y)operator(,) operator(&)ident(z)operator(,) integer(0)operator(\);) - - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) -operator(}) - -comment(/* - * call-seq: - * big % other => Numeric - * big.modulo(other\) => Numeric - * - * Returns big modulo other. See Numeric.divmod for more - * information. - */) - -directive(static) ident(VALUE) -ident(rb_big_modulo)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(z)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - ident(bigdivmod)operator(()ident(x)operator(,) ident(y)operator(,) integer(0)operator(,) operator(&)ident(z)operator(\);) - - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) -operator(}) - -comment(/* - * call-seq: - * big.remainder(numeric\) => number - * - * Returns the remainder after dividing big by numeric. - * - * -1234567890987654321.remainder(13731\) #=> -6966 - * -1234567890987654321.remainder(13731.24\) #=> -9906.22531493148 - */) -directive(static) ident(VALUE) -ident(rb_big_remainder)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(z)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - ident(bigdivrem)operator(()ident(x)operator(,) ident(y)operator(,) integer(0)operator(,) operator(&)ident(z)operator(\);) - - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(big_lshift) ident(_)operator((()ident(VALUE)operator(,) pre_type(unsigned) pre_type(long)operator(\)\);) -directive(static) ident(VALUE) ident(big_rshift) ident(_)operator((()ident(VALUE)operator(,) pre_type(unsigned) pre_type(long)operator(\)\);) - -directive(static) ident(VALUE) ident(big_shift)operator(()ident(x)operator(,) ident(n)operator(\)) - ident(VALUE) ident(x)operator(;) - pre_type(int) ident(n)operator(;) -operator({) - reserved(if) operator(()ident(n) operator(<) integer(0)operator(\)) - reserved(return) ident(big_lshift)operator(()ident(x)operator(,) operator(()pre_type(unsigned) pre_type(int)operator(\))ident(n)operator(\);) - reserved(else) reserved(if) operator(()ident(n) operator(>) integer(0)operator(\)) - reserved(return) ident(big_rshift)operator(()ident(x)operator(,) operator(()pre_type(unsigned) pre_type(int)operator(\))ident(n)operator(\);) - reserved(return) ident(x)operator(;) -operator(}) - -comment(/* - * call-seq: - * big.divmod(numeric\) => array - * - * See Numeric#divmod. - * - */) -ident(VALUE) -ident(rb_big_divmod)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(div)operator(,) ident(mod)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - ident(bigdivmod)operator(()ident(x)operator(,) ident(y)operator(,) operator(&)ident(div)operator(,) operator(&)ident(mod)operator(\);) - - reserved(return) ident(rb_assoc_new)operator(()ident(bignorm)operator(()ident(div)operator(\),) ident(bignorm)operator(()ident(mod)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * big.quo(numeric\) -> float - * - * Returns the floating point result of dividing big by - * numeric. - * - * -1234567890987654321.quo(13731\) #=> -89910996357705.5 - * -1234567890987654321.quo(13731.24\) #=> -89909424858035.7 - * - */) - -directive(static) ident(VALUE) -ident(rb_big_quo)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(double) ident(dx) operator(=) ident(rb_big2dbl)operator(()ident(x)operator(\);) - pre_type(double) ident(dy)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(dy) operator(=) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - ident(dy) operator(=) ident(rb_big2dbl)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - ident(dy) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - reserved(return) ident(rb_float_new)operator(()ident(dx) operator(/) ident(dy)operator(\);) -operator(}) - -comment(/* - * call-seq: - * big ** exponent #=> numeric - * - * Raises _big_ to the _exponent_ power (which may be an integer, float, - * or anything that will coerce to a number\). The result may be - * a Fixnum, Bignum, or Float - * - * 123456789 ** 2 #=> 15241578750190521 - * 123456789 ** 1.2 #=> 5126464716.09932 - * 123456789 ** -2 #=> 6.5610001194102e-17 - */) - -ident(VALUE) -ident(rb_big_pow)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(double) ident(d)operator(;) - pre_type(long) ident(yy)operator(;) - - reserved(if) operator(()ident(y) operator(==) ident(INT2FIX)operator(()integer(0)operator(\)\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FLOAT)operator(:) - ident(d) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - ident(rb_warn)operator(()stringoperator(\);) - ident(d) operator(=) ident(rb_big2dbl)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_FIXNUM)operator(:) - ident(yy) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(if) operator(()ident(yy) operator(>) integer(0)operator(\)) operator({) - ident(VALUE) ident(z) operator(=) ident(x)operator(;) - directive(const) pre_type(long) ident(BIGLEN_LIMIT) operator(=) integer(1024)operator(*)integer(1024) operator(/) ident(SIZEOF_BDIGITS)operator(;) - - reserved(if) operator((()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(>) ident(BIGLEN_LIMIT)operator(\)) operator(||) - operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(>) ident(BIGLEN_LIMIT) operator(/) ident(yy)operator(\)\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - ident(d) operator(=) operator(()pre_type(double)operator(\))ident(yy)operator(;) - reserved(break)operator(;) - operator(}) - reserved(for) operator((;;\)) operator({) - ident(yy) operator(-=) integer(1)operator(;) - reserved(if) operator(()ident(yy) operator(==) integer(0)operator(\)) reserved(break)operator(;) - reserved(while) operator(()ident(yy) operator(%) integer(2) operator(==) integer(0)operator(\)) operator({) - ident(yy) operator(/=) integer(2)operator(;) - ident(x) operator(=) ident(rb_big_mul0)operator(()ident(x)operator(,) ident(x)operator(\);) - ident(bigtrunc)operator(()ident(x)operator(\);) - operator(}) - ident(z) operator(=) ident(rb_big_mul0)operator(()ident(z)operator(,) ident(x)operator(\);) - ident(bigtrunc)operator(()ident(z)operator(\);) - operator(}) - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) - operator(}) - ident(d) operator(=) operator(()pre_type(double)operator(\))ident(yy)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - reserved(return) ident(rb_float_new)operator(()ident(pow)operator(()ident(rb_big2dbl)operator(()ident(x)operator(\),) ident(d)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * big & numeric => integer - * - * Performs bitwise +and+ between _big_ and _numeric_. - */) - -ident(VALUE) -ident(rb_big_and)operator(()ident(xx)operator(,) ident(yy)operator(\)) - ident(VALUE) ident(xx)operator(,) ident(yy)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(x)operator(,) ident(y)operator(,) ident(z)operator(;) - ident(BDIGIT) operator(*)ident(ds1)operator(,) operator(*)ident(ds2)operator(,) operator(*)ident(zds)operator(;) - pre_type(long) ident(i)operator(,) ident(l1)operator(,) ident(l2)operator(;) - pre_type(char) ident(sign)operator(;) - - ident(x) operator(=) ident(xx)operator(;) - ident(y) operator(=) ident(rb_to_int)operator(()ident(yy)operator(\);) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\)) operator({) - ident(y) operator(=) ident(rb_big_clone)operator(()ident(y)operator(\);) - ident(get2comp)operator(()ident(y)operator(\);) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - ident(x) operator(=) ident(rb_big_clone)operator(()ident(x)operator(\);) - ident(get2comp)operator(()ident(x)operator(\);) - operator(}) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(>) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) operator({) - ident(l1) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(;) - ident(l2) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(ds1) operator(=) ident(BDIGITS)operator(()ident(y)operator(\);) - ident(ds2) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(sign) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(;) - operator(}) - reserved(else) operator({) - ident(l1) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(l2) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(;) - ident(ds1) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(ds2) operator(=) ident(BDIGITS)operator(()ident(y)operator(\);) - ident(sign) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(;) - operator(}) - ident(z) operator(=) ident(bignew)operator(()ident(l2)operator(,) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(||) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\);) - ident(zds) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(l1)operator(;) ident(i)operator(++\)) operator({) - ident(zds)operator([)ident(i)operator(]) operator(=) ident(ds1)operator([)ident(i)operator(]) operator(&) ident(ds2)operator([)ident(i)operator(];) - operator(}) - reserved(for) operator((;) ident(i)operator(<)ident(l2)operator(;) ident(i)operator(++\)) operator({) - ident(zds)operator([)ident(i)operator(]) operator(=) ident(sign)operator(?)integer(0)operator(:)ident(ds2)operator([)ident(i)operator(];) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(z)operator(\)->)ident(sign)operator(\)) ident(get2comp)operator(()ident(z)operator(\);) - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) -operator(}) - -comment(/* - * call-seq: - * big | numeric => integer - * - * Performs bitwise +or+ between _big_ and _numeric_. - */) - -ident(VALUE) -ident(rb_big_or)operator(()ident(xx)operator(,) ident(yy)operator(\)) - ident(VALUE) ident(xx)operator(,) ident(yy)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(x)operator(,) ident(y)operator(,) ident(z)operator(;) - ident(BDIGIT) operator(*)ident(ds1)operator(,) operator(*)ident(ds2)operator(,) operator(*)ident(zds)operator(;) - pre_type(long) ident(i)operator(,) ident(l1)operator(,) ident(l2)operator(;) - pre_type(char) ident(sign)operator(;) - - ident(x) operator(=) ident(xx)operator(;) - ident(y) operator(=) ident(rb_to_int)operator(()ident(yy)operator(\);) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\)) operator({) - ident(y) operator(=) ident(rb_big_clone)operator(()ident(y)operator(\);) - ident(get2comp)operator(()ident(y)operator(\);) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - ident(x) operator(=) ident(rb_big_clone)operator(()ident(x)operator(\);) - ident(get2comp)operator(()ident(x)operator(\);) - operator(}) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(>) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) operator({) - ident(l1) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(;) - ident(l2) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(ds1) operator(=) ident(BDIGITS)operator(()ident(y)operator(\);) - ident(ds2) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(sign) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(;) - operator(}) - reserved(else) operator({) - ident(l1) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(l2) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(;) - ident(ds1) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(ds2) operator(=) ident(BDIGITS)operator(()ident(y)operator(\);) - ident(sign) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(;) - operator(}) - ident(z) operator(=) ident(bignew)operator(()ident(l2)operator(,) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(&&) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\);) - ident(zds) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(l1)operator(;) ident(i)operator(++\)) operator({) - ident(zds)operator([)ident(i)operator(]) operator(=) ident(ds1)operator([)ident(i)operator(]) operator(|) ident(ds2)operator([)ident(i)operator(];) - operator(}) - reserved(for) operator((;) ident(i)operator(<)ident(l2)operator(;) ident(i)operator(++\)) operator({) - ident(zds)operator([)ident(i)operator(]) operator(=) ident(sign)operator(?)ident(ds2)operator([)ident(i)operator(]:()ident(BIGRAD)operator(-)integer(1)operator(\);) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(z)operator(\)->)ident(sign)operator(\)) ident(get2comp)operator(()ident(z)operator(\);) - - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) -operator(}) - -comment(/* - * call-seq: - * big ^ numeric => integer - * - * Performs bitwise +exclusive or+ between _big_ and _numeric_. - */) - -ident(VALUE) -ident(rb_big_xor)operator(()ident(xx)operator(,) ident(yy)operator(\)) - ident(VALUE) ident(xx)operator(,) ident(yy)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(x)operator(,) ident(y)operator(;) - ident(VALUE) ident(z)operator(;) - ident(BDIGIT) operator(*)ident(ds1)operator(,) operator(*)ident(ds2)operator(,) operator(*)ident(zds)operator(;) - pre_type(long) ident(i)operator(,) ident(l1)operator(,) ident(l2)operator(;) - pre_type(char) ident(sign)operator(;) - - ident(x) operator(=) ident(xx)operator(;) - ident(y) operator(=) ident(rb_to_int)operator(()ident(yy)operator(\);) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - ident(y) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\);) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\)) operator({) - ident(y) operator(=) ident(rb_big_clone)operator(()ident(y)operator(\);) - ident(get2comp)operator(()ident(y)operator(\);) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - ident(x) operator(=) ident(rb_big_clone)operator(()ident(x)operator(\);) - ident(get2comp)operator(()ident(x)operator(\);) - operator(}) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len) operator(>) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(\)) operator({) - ident(l1) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(;) - ident(l2) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(ds1) operator(=) ident(BDIGITS)operator(()ident(y)operator(\);) - ident(ds2) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(sign) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(;) - operator(}) - reserved(else) operator({) - ident(l1) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(l2) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len)operator(;) - ident(ds1) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(ds2) operator(=) ident(BDIGITS)operator(()ident(y)operator(\);) - ident(sign) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(;) - operator(}) - ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(?)integer(1)operator(:)integer(0)operator(;) - ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign) operator(=) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(?)integer(1)operator(:)integer(0)operator(;) - ident(z) operator(=) ident(bignew)operator(()ident(l2)operator(,) operator(!()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(^) ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\)\);) - ident(zds) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(l1)operator(;) ident(i)operator(++\)) operator({) - ident(zds)operator([)ident(i)operator(]) operator(=) ident(ds1)operator([)ident(i)operator(]) operator(^) ident(ds2)operator([)ident(i)operator(];) - operator(}) - reserved(for) operator((;) ident(i)operator(<)ident(l2)operator(;) ident(i)operator(++\)) operator({) - ident(zds)operator([)ident(i)operator(]) operator(=) ident(sign)operator(?)ident(ds2)operator([)ident(i)operator(]:~)ident(ds2)operator([)ident(i)operator(];) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(z)operator(\)->)ident(sign)operator(\)) ident(get2comp)operator(()ident(z)operator(\);) - - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(check_shiftdown)operator(()ident(VALUE) ident(y)operator(,) ident(VALUE) ident(x)operator(\)) -operator({) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(len) operator(>) ident(SIZEOF_LONG) operator(/) ident(SIZEOF_BDIGITS)operator(\)) operator({) - reserved(return) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(?) ident(INT2FIX)operator(()integer(0)operator(\)) operator(:) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * big << numeric => integer - * - * Shifts big left _numeric_ positions (right if _numeric_ is negative\). - */) - -ident(VALUE) -ident(rb_big_lshift)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(long) ident(shift)operator(;) - pre_type(int) ident(neg) operator(=) integer(0)operator(;) - - reserved(for) operator((;;\)) operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - ident(shift) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(if) operator(()ident(shift) operator(<) integer(0)operator(\)) operator({) - ident(neg) operator(=) integer(1)operator(;) - ident(shift) operator(=) operator(-)ident(shift)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(TYPE)operator(()ident(y)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) operator({) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\)) operator({) - ident(VALUE) ident(t) operator(=) ident(check_shiftdown)operator(()ident(y)operator(,) ident(x)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(t)operator(\)\)) reserved(return) ident(t)operator(;) - ident(neg) operator(=) integer(1)operator(;) - operator(}) - ident(shift) operator(=) ident(big2ulong)operator(()ident(y)operator(,) stringoperator(,) ident(Qtrue)operator(\);) - reserved(break)operator(;) - operator(}) - ident(y) operator(=) ident(rb_to_int)operator(()ident(y)operator(\);) - operator(}) - - reserved(if) operator(()ident(neg)operator(\)) reserved(return) ident(big_rshift)operator(()ident(x)operator(,) ident(shift)operator(\);) - reserved(return) ident(big_lshift)operator(()ident(x)operator(,) ident(shift)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(big_lshift)operator(()ident(x)operator(,) ident(shift)operator(\)) - ident(VALUE) ident(x)operator(;) - pre_type(unsigned) pre_type(long) ident(shift)operator(;) -operator({) - ident(BDIGIT) operator(*)ident(xds)operator(,) operator(*)ident(zds)operator(;) - pre_type(long) ident(s1) operator(=) ident(shift)operator(/)ident(BITSPERDIG)operator(;) - pre_type(int) ident(s2) operator(=) ident(shift)operator(%)ident(BITSPERDIG)operator(;) - ident(VALUE) ident(z)operator(;) - ident(BDIGIT_DBL) ident(num) operator(=) integer(0)operator(;) - pre_type(long) ident(len)operator(,) ident(i)operator(;) - - ident(len) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - ident(z) operator(=) ident(bignew)operator(()ident(len)operator(+)ident(s1)operator(+)integer(1)operator(,) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\);) - ident(zds) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(s1)operator(;) ident(i)operator(++\)) operator({) - operator(*)ident(zds)operator(++) operator(=) integer(0)operator(;) - operator(}) - ident(xds) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(num) operator(=) ident(num) operator(|) operator(()ident(BDIGIT_DBL)operator(\)*)ident(xds)operator(++<<)ident(s2)operator(;) - operator(*)ident(zds)operator(++) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - operator(}) - operator(*)ident(zds) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) -operator(}) - -comment(/* - * call-seq: - * big >> numeric => integer - * - * Shifts big right _numeric_ positions (left if _numeric_ is negative\). - */) - -ident(VALUE) -ident(rb_big_rshift)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(long) ident(shift)operator(;) - pre_type(int) ident(neg) operator(=) integer(0)operator(;) - - reserved(for) operator((;;\)) operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - ident(shift) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(if) operator(()ident(shift) operator(<) integer(0)operator(\)) operator({) - ident(neg) operator(=) integer(1)operator(;) - ident(shift) operator(=) operator(-)ident(shift)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(TYPE)operator(()ident(y)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) operator({) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\)) operator({) - ident(VALUE) ident(t) operator(=) ident(check_shiftdown)operator(()ident(y)operator(,) ident(x)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(t)operator(\)\)) reserved(return) ident(t)operator(;) - operator(}) - reserved(else) operator({) - ident(neg) operator(=) integer(1)operator(;) - operator(}) - ident(shift) operator(=) ident(big2ulong)operator(()ident(y)operator(,) stringoperator(,) ident(Qtrue)operator(\);) - reserved(break)operator(;) - operator(}) - ident(y) operator(=) ident(rb_to_int)operator(()ident(y)operator(\);) - operator(}) - - reserved(if) operator(()ident(neg)operator(\)) reserved(return) ident(big_lshift)operator(()ident(x)operator(,) ident(shift)operator(\);) - reserved(return) ident(big_rshift)operator(()ident(x)operator(,) ident(shift)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(big_rshift)operator(()ident(x)operator(,) ident(shift)operator(\)) - ident(VALUE) ident(x)operator(;) - pre_type(unsigned) pre_type(long) ident(shift)operator(;) -operator({) - ident(BDIGIT) operator(*)ident(xds)operator(,) operator(*)ident(zds)operator(;) - pre_type(long) ident(s1) operator(=) ident(shift)operator(/)ident(BITSPERDIG)operator(;) - pre_type(int) ident(s2) operator(=) ident(shift)operator(%)ident(BITSPERDIG)operator(;) - ident(VALUE) ident(z)operator(;) - ident(BDIGIT_DBL) ident(num) operator(=) integer(0)operator(;) - pre_type(long) ident(i)operator(,) ident(j)operator(;) - directive(volatile) ident(VALUE) ident(save_x)operator(;) - - reserved(if) operator(()ident(s1) operator(>) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(\)) operator({) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(else) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - ident(save_x) operator(=) ident(x) operator(=) ident(rb_big_clone)operator(()ident(x)operator(\);) - ident(get2comp)operator(()ident(x)operator(\);) - operator(}) - ident(xds) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(i) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) ident(j) operator(=) ident(i) operator(-) ident(s1)operator(;) - reserved(if) operator(()ident(j) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(else) reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - ident(z) operator(=) ident(bignew)operator(()ident(j)operator(,) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\);) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - ident(num) operator(=) operator((()ident(BDIGIT_DBL)operator(\)~)integer(0)operator(\)) operator(<<) ident(BITSPERDIG)operator(;) - operator(}) - ident(zds) operator(=) ident(BDIGITS)operator(()ident(z)operator(\);) - reserved(while) operator(()ident(i)operator(--,) ident(j)operator(--\)) operator({) - ident(num) operator(=) operator(()ident(num) operator(|) ident(xds)operator([)ident(i)operator(]\)) operator(>>) ident(s2)operator(;) - ident(zds)operator([)ident(j)operator(]) operator(=) ident(BIGLO)operator(()ident(num)operator(\);) - ident(num) operator(=) ident(BIGUP)operator(()ident(xds)operator([)ident(i)operator(]\);) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - ident(get2comp)operator(()ident(z)operator(\);) - operator(}) - reserved(return) ident(bignorm)operator(()ident(z)operator(\);) -operator(}) - -comment(/* - * call-seq: - * big[n] -> 0, 1 - * - * Bit Reference---Returns the nth bit in the (assumed\) binary - * representation of big, where big[0] is the least - * significant bit. - * - * a = 9**15 - * 50.downto(0\) do |n| - * print a[n] - * end - * - * produces: - * - * 000101110110100000111000011110010100111100010111001 - * - */) - -directive(static) ident(VALUE) -ident(rb_big_aref)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(BDIGIT) operator(*)ident(xds)operator(;) - ident(BDIGIT_DBL) ident(num)operator(;) - pre_type(unsigned) pre_type(long) ident(shift)operator(;) - pre_type(long) ident(i)operator(,) ident(s1)operator(,) ident(s2)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(y)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) operator({) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(y)operator(\)->)ident(sign)operator(\)) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(bigtrunc)operator(()ident(y)operator(\)\)->)ident(len) operator(>) ident(SIZEOF_LONG)operator(/)ident(SIZEOF_BDIGITS)operator(\)) operator({) - label(out_of_range:) - reserved(return) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(?) ident(INT2FIX)operator(()integer(0)operator(\)) operator(:) ident(INT2FIX)operator(()integer(1)operator(\);) - operator(}) - ident(shift) operator(=) ident(big2ulong)operator(()ident(y)operator(,) stringoperator(,) ident(Qfalse)operator(\);) - operator(}) - reserved(else) operator({) - ident(i) operator(=) ident(NUM2LONG)operator(()ident(y)operator(\);) - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - ident(shift) operator(=) operator(()ident(VALUE)operator(\))ident(i)operator(;) - operator(}) - ident(s1) operator(=) ident(shift)operator(/)ident(BITSPERDIG)operator(;) - ident(s2) operator(=) ident(shift)operator(%)ident(BITSPERDIG)operator(;) - - reserved(if) operator(()ident(s1) operator(>=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(\)) reserved(goto) ident(out_of_range)operator(;) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - ident(xds) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) - ident(i) operator(=) integer(0)operator(;) ident(num) operator(=) integer(1)operator(;) - reserved(while) operator(()ident(num) operator(+=) operator(~)ident(xds)operator([)ident(i)operator(],) operator(++)ident(i) operator(<=) ident(s1)operator(\)) operator({) - ident(num) operator(=) ident(BIGDN)operator(()ident(num)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(num) operator(=) ident(BDIGITS)operator(()ident(x)operator(\)[)ident(s1)operator(];) - operator(}) - reserved(if) operator(()ident(num) operator(&) operator((()ident(BDIGIT_DBL)operator(\))integer(1)operator(<<)ident(s2)operator(\)\)) - reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * big.hash => fixnum - * - * Compute a hash based on the value of _big_. - */) - -directive(static) ident(VALUE) -ident(rb_big_hash)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - pre_type(long) ident(i)operator(,) ident(len)operator(,) ident(key)operator(;) - ident(BDIGIT) operator(*)ident(digits)operator(;) - - ident(key) operator(=) integer(0)operator(;) ident(digits) operator(=) ident(BDIGITS)operator(()ident(x)operator(\);) ident(len) operator(=) ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(len)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(key) operator(^=) operator(*)ident(digits)operator(++;) - operator(}) - reserved(return) ident(LONG2FIX)operator(()ident(key)operator(\);) -operator(}) - -comment(/* - * MISSING: documentation - */) - -directive(static) ident(VALUE) -ident(rb_big_coerce)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - reserved(return) ident(rb_assoc_new)operator(()ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(y)operator(\)\),) ident(x)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(TYPE)operator(()ident(y)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) operator({) - reserved(return) ident(rb_assoc_new)operator(()ident(y)operator(,) ident(x)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(y)operator(\)\);) - operator(}) - comment(/* not reached */) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * big.abs -> aBignum - * - * Returns the absolute value of big. - * - * -1234567890987654321.abs #=> 1234567890987654321 - */) - -directive(static) ident(VALUE) -ident(rb_big_abs)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign)operator(\)) operator({) - ident(x) operator(=) ident(rb_big_clone)operator(()ident(x)operator(\);) - ident(RBIGNUM)operator(()ident(x)operator(\)->)ident(sign) operator(=) integer(1)operator(;) - operator(}) - reserved(return) ident(x)operator(;) -operator(}) - -ident(VALUE) -ident(rb_big_rand)operator(()ident(max)operator(,) ident(rand_buf)operator(\)) - ident(VALUE) ident(max)operator(;) - pre_type(double) operator(*)ident(rand_buf)operator(;) -operator({) - ident(VALUE) ident(v)operator(;) - pre_type(long) ident(len) operator(=) ident(RBIGNUM)operator(()ident(max)operator(\)->)ident(len)operator(;) - - reserved(if) operator(()ident(BIGZEROP)operator(()ident(max)operator(\)\)) operator({) - reserved(return) ident(rb_float_new)operator(()ident(rand_buf)operator([)integer(0)operator(]\);) - operator(}) - ident(v) operator(=) ident(bignew)operator(()ident(len)operator(,)integer(1)operator(\);) - ident(len)operator(--;) - ident(BDIGITS)operator(()ident(v)operator(\)[)ident(len)operator(]) operator(=) ident(BDIGITS)operator(()ident(max)operator(\)[)ident(len)operator(]) operator(*) ident(rand_buf)operator([)ident(len)operator(];) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(BDIGITS)operator(()ident(v)operator(\)[)ident(len)operator(]) operator(=) operator((()ident(BDIGIT)operator(\)~)integer(0)operator(\)) operator(*) ident(rand_buf)operator([)ident(len)operator(];) - operator(}) - - reserved(return) ident(v)operator(;) -operator(}) - -comment(/* - * call-seq: - * big.size -> integer - * - * Returns the number of bytes in the machine representation of - * big. - * - * (256**10 - 1\).size #=> 12 - * (256**20 - 1\).size #=> 20 - * (256**40 - 1\).size #=> 40 - */) - -directive(static) ident(VALUE) -ident(rb_big_size)operator(()ident(big)operator(\)) - ident(VALUE) ident(big)operator(;) -operator({) - reserved(return) ident(LONG2FIX)operator(()ident(RBIGNUM)operator(()ident(big)operator(\)->)ident(len)operator(*)ident(SIZEOF_BDIGITS)operator(\);) -operator(}) - -comment(/* - * Bignum objects hold integers outside the range of - * Fixnum. Bignum objects are created - * automatically when integer calculations would otherwise overflow a - * Fixnum. When a calculation involving - * Bignum objects returns a result that will fit in a - * Fixnum, the result is automatically converted. - * - * For the purposes of the bitwise operations and [], a - * Bignum is treated as if it were an infinite-length - * bitstring with 2's complement representation. - * - * While Fixnum values are immediate, Bignum - * objects are not---assignment and parameter passing work with - * references to objects, not the objects themselves. - * - */) - -directive(void) -ident(Init_Bignum)operator((\)) -operator({) - ident(rb_cBignum) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cInteger)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_to_s)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_coerce)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_uminus)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_plus)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_minus)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_mul)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_div)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_modulo)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_div)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_divmod)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_modulo)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_remainder)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_quo)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_pow)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_and)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_or)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_xor)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_neg)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_lshift)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) string>)delimiter(")>operator(,) ident(rb_big_rshift)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_aref)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) string)delimiter(")>operator(,) ident(rb_big_cmp)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_eq)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_eql)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_hash)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_to_f)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_abs)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBignum)operator(,) stringoperator(,) ident(rb_big_size)operator(,) integer(0)operator(\);) -operator(}) -comment(/********************************************************************** - - class.c - - - $Author: shyouhei $ - $Date: 2009-01-16 02:58:45 +0100 (Fri, 16 Jan 2009\) $ - created at: Tue Aug 10 15:05:44 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("rubysig.h") -preprocessor(#include) include("node.h") -preprocessor(#include) include("st.h") -preprocessor(#include) include() - -directive(extern) ident(st_table) operator(*)ident(rb_class_tbl)operator(;) - -ident(VALUE) -ident(rb_class_boot)operator(()ident(super)operator(\)) - ident(VALUE) ident(super)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(klass)operator(,) reserved(struct) ident(RClass)operator(\);) - ident(OBJSETUP)operator(()ident(klass)operator(,) ident(rb_cClass)operator(,) ident(T_CLASS)operator(\);) - - ident(klass)operator(->)ident(super) operator(=) ident(super)operator(;) - ident(klass)operator(->)ident(iv_tbl) operator(=) integer(0)operator(;) - ident(klass)operator(->)ident(m_tbl) operator(=) integer(0)operator(;) comment(/* safe GC */) - ident(klass)operator(->)ident(m_tbl) operator(=) ident(st_init_numtable)operator((\);) - - ident(OBJ_INFECT)operator(()ident(klass)operator(,) ident(super)operator(\);) - reserved(return) operator(()ident(VALUE)operator(\))ident(klass)operator(;) -operator(}) - -ident(VALUE) -ident(rb_class_new)operator(()ident(super)operator(\)) - ident(VALUE) ident(super)operator(;) -operator({) - ident(Check_Type)operator(()ident(super)operator(,) ident(T_CLASS)operator(\);) - reserved(if) operator(()ident(super) operator(==) ident(rb_cClass)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(FL_TEST)operator(()ident(super)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(rb_class_boot)operator(()ident(super)operator(\);) -operator(}) - -reserved(struct) ident(clone_method_data) operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - ident(VALUE) ident(klass)operator(;) -operator(};) - -directive(static) pre_type(int) -ident(clone_method)operator(()ident(mid)operator(,) ident(body)operator(,) ident(data)operator(\)) - ident(ID) ident(mid)operator(;) - ident(NODE) operator(*)ident(body)operator(;) - reserved(struct) ident(clone_method_data) operator(*)ident(data)operator(;) -operator({) - ident(NODE) operator(*)ident(fbody) operator(=) ident(body)operator(->)ident(nd_body)operator(;) - - reserved(if) operator(()ident(fbody) operator(&&) ident(nd_type)operator(()ident(fbody)operator(\)) operator(==) ident(NODE_SCOPE)operator(\)) operator({) - ident(NODE) operator(*)ident(cref) operator(=) operator(()ident(NODE)operator(*\))ident(fbody)operator(->)ident(nd_rval)operator(;) - - reserved(if) operator(()ident(cref)operator(\)) ident(cref) operator(=) ident(cref)operator(->)ident(nd_next)operator(;) - ident(fbody) operator(=) ident(rb_copy_node_scope)operator(()ident(fbody)operator(,) ident(NEW_CREF)operator(()ident(data)operator(->)ident(klass)operator(,) ident(cref)operator(\)\);) - operator(}) - ident(st_insert)operator(()ident(data)operator(->)ident(tbl)operator(,) ident(mid)operator(,) operator(()ident(st_data_t)operator(\))ident(NEW_METHOD)operator(()ident(fbody)operator(,) ident(body)operator(->)ident(nd_noex)operator(\)\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* :nodoc: */) -ident(VALUE) -ident(rb_mod_init_copy)operator(()ident(clone)operator(,) ident(orig)operator(\)) - ident(VALUE) ident(clone)operator(,) ident(orig)operator(;) -operator({) - ident(rb_obj_init_copy)operator(()ident(clone)operator(,) ident(orig)operator(\);) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(CLASS_OF)operator(()ident(clone)operator(\),) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(RBASIC)operator(()ident(clone)operator(\)->)ident(klass) operator(=) ident(RBASIC)operator(()ident(orig)operator(\)->)ident(klass)operator(;) - ident(RBASIC)operator(()ident(clone)operator(\)->)ident(klass) operator(=) ident(rb_singleton_class_clone)operator(()ident(clone)operator(\);) - operator(}) - ident(RCLASS)operator(()ident(clone)operator(\)->)ident(super) operator(=) ident(RCLASS)operator(()ident(orig)operator(\)->)ident(super)operator(;) - reserved(if) operator(()ident(RCLASS)operator(()ident(orig)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(ID) ident(id)operator(;) - - ident(RCLASS)operator(()ident(clone)operator(\)->)ident(iv_tbl) operator(=) ident(st_copy)operator(()ident(RCLASS)operator(()ident(orig)operator(\)->)ident(iv_tbl)operator(\);) - ident(id) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(st_delete)operator(()ident(RCLASS)operator(()ident(clone)operator(\)->)ident(iv_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(id)operator(,) integer(0)operator(\);) - ident(id) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(st_delete)operator(()ident(RCLASS)operator(()ident(clone)operator(\)->)ident(iv_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(id)operator(,) integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(RCLASS)operator(()ident(orig)operator(\)->)ident(m_tbl)operator(\)) operator({) - reserved(struct) ident(clone_method_data) ident(data)operator(;) - - ident(data)operator(.)ident(tbl) operator(=) ident(RCLASS)operator(()ident(clone)operator(\)->)ident(m_tbl) operator(=) ident(st_init_numtable)operator((\);) - ident(data)operator(.)ident(klass) operator(=) operator(()ident(VALUE)operator(\))ident(clone)operator(;) - - ident(st_foreach)operator(()ident(RCLASS)operator(()ident(orig)operator(\)->)ident(m_tbl)operator(,) ident(clone_method)operator(,) operator(()ident(st_data_t)operator(\)&)ident(data)operator(\);) - operator(}) - - reserved(return) ident(clone)operator(;) -operator(}) - -comment(/* :nodoc: */) -ident(VALUE) -ident(rb_class_init_copy)operator(()ident(clone)operator(,) ident(orig)operator(\)) - ident(VALUE) ident(clone)operator(,) ident(orig)operator(;) -operator({) - reserved(if) operator(()ident(RCLASS)operator(()ident(clone)operator(\)->)ident(super) operator(!=) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(FL_TEST)operator(()ident(orig)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(rb_mod_init_copy)operator(()ident(clone)operator(,) ident(orig)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_singleton_class_clone)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(klass) operator(=) ident(RBASIC)operator(()ident(obj)operator(\)->)ident(klass)operator(;) - - reserved(if) operator((!)ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) - reserved(return) ident(klass)operator(;) - reserved(else) operator({) - comment(/* copy singleton(unnamed\) class */) - ident(NEWOBJ)operator(()ident(clone)operator(,) reserved(struct) ident(RClass)operator(\);) - ident(OBJSETUP)operator(()ident(clone)operator(,) integer(0)operator(,) ident(RBASIC)operator(()ident(klass)operator(\)->)ident(flags)operator(\);) - - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(obj)operator(\)) operator(==) ident(T_CLASS)operator(\)) operator({) - ident(RBASIC)operator(()ident(clone)operator(\)->)ident(klass) operator(=) operator(()ident(VALUE)operator(\))ident(clone)operator(;) - operator(}) - reserved(else) operator({) - ident(RBASIC)operator(()ident(clone)operator(\)->)ident(klass) operator(=) ident(rb_singleton_class_clone)operator(()ident(klass)operator(\);) - operator(}) - - ident(clone)operator(->)ident(super) operator(=) ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(;) - ident(clone)operator(->)ident(iv_tbl) operator(=) integer(0)operator(;) - ident(clone)operator(->)ident(m_tbl) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(clone)operator(->)ident(iv_tbl) operator(=) ident(st_copy)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(\);) - operator(}) - operator({) - reserved(struct) ident(clone_method_data) ident(data)operator(;) - - ident(data)operator(.)ident(tbl) operator(=) ident(clone)operator(->)ident(m_tbl) operator(=) ident(st_init_numtable)operator((\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - ident(data)operator(.)ident(klass) operator(=) ident(obj)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(data)operator(.)ident(klass) operator(=) integer(0)operator(;) - reserved(break)operator(;) - operator(}) - - ident(st_foreach)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(,) ident(clone_method)operator(,) operator(()ident(st_data_t)operator(\)&)ident(data)operator(\);) - operator(}) - ident(rb_singleton_class_attached)operator(()ident(RBASIC)operator(()ident(clone)operator(\)->)ident(klass)operator(,) operator(()ident(VALUE)operator(\))ident(clone)operator(\);) - ident(FL_SET)operator(()ident(clone)operator(,) ident(FL_SINGLETON)operator(\);) - reserved(return) operator(()ident(VALUE)operator(\))ident(clone)operator(;) - operator(}) -operator(}) - -directive(void) -ident(rb_singleton_class_attached)operator(()ident(klass)operator(,) ident(obj)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - reserved(if) operator((!)ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl) operator(=) ident(st_init_numtable)operator((\);) - operator(}) - ident(st_insert)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(,) ident(rb_intern)operator(()stringoperator(\),) ident(obj)operator(\);) - operator(}) -operator(}) - -ident(VALUE) -ident(rb_make_metaclass)operator(()ident(obj)operator(,) ident(super)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(super)operator(;) -operator({) - ident(VALUE) ident(klass) operator(=) ident(rb_class_boot)operator(()ident(super)operator(\);) - ident(FL_SET)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\);) - ident(RBASIC)operator(()ident(obj)operator(\)->)ident(klass) operator(=) ident(klass)operator(;) - ident(rb_singleton_class_attached)operator(()ident(klass)operator(,) ident(obj)operator(\);) - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(obj)operator(\)) operator(==) ident(T_CLASS) operator(&&) ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(RBASIC)operator(()ident(klass)operator(\)->)ident(klass) operator(=) ident(klass)operator(;) - ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super) operator(=) ident(RBASIC)operator(()ident(rb_class_real)operator(()ident(RCLASS)operator(()ident(obj)operator(\)->)ident(super)operator(\)\)->)ident(klass)operator(;) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(metasuper) operator(=) ident(RBASIC)operator(()ident(rb_class_real)operator(()ident(super)operator(\)\)->)ident(klass)operator(;) - - comment(/* metaclass of a superclass may be NULL at boot time */) - reserved(if) operator(()ident(metasuper)operator(\)) operator({) - ident(RBASIC)operator(()ident(klass)operator(\)->)ident(klass) operator(=) ident(metasuper)operator(;) - operator(}) - operator(}) - - reserved(return) ident(klass)operator(;) -operator(}) - -ident(VALUE) -ident(rb_define_class_id)operator(()ident(id)operator(,) ident(super)operator(\)) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(super)operator(;) -operator({) - ident(VALUE) ident(klass)operator(;) - - reserved(if) operator((!)ident(super)operator(\)) ident(super) operator(=) ident(rb_cObject)operator(;) - ident(klass) operator(=) ident(rb_class_new)operator(()ident(super)operator(\);) - ident(rb_make_metaclass)operator(()ident(klass)operator(,) ident(RBASIC)operator(()ident(super)operator(\)->)ident(klass)operator(\);) - - reserved(return) ident(klass)operator(;) -operator(}) - -directive(void) -ident(rb_check_inheritable)operator(()ident(super)operator(\)) - ident(VALUE) ident(super)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(super)operator(\)) operator(!=) ident(T_CLASS)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(super)operator(\)\);) - operator(}) - reserved(if) operator(()ident(RBASIC)operator(()ident(super)operator(\)->)ident(flags) operator(&) ident(FL_SINGLETON)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) -operator(}) - -ident(VALUE) -ident(rb_class_inherited)operator(()ident(super)operator(,) ident(klass)operator(\)) - ident(VALUE) ident(super)operator(,) ident(klass)operator(;) -operator({) - reserved(if) operator((!)ident(super)operator(\)) ident(super) operator(=) ident(rb_cObject)operator(;) - reserved(return) ident(rb_funcall)operator(()ident(super)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(klass)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_define_class)operator(()ident(name)operator(,) ident(super)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) ident(super)operator(;) -operator({) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) - - ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - reserved(if) operator(()ident(rb_const_defined)operator(()ident(rb_cObject)operator(,) ident(id)operator(\)\)) operator({) - ident(klass) operator(=) ident(rb_const_get)operator(()ident(rb_cObject)operator(,) ident(id)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(klass)operator(\)) operator(!=) ident(T_CLASS)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(name)operator(\);) - operator(}) - reserved(if) operator(()ident(rb_class_real)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(\)) operator(!=) ident(super)operator(\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(name)operator(\);) - operator(}) - reserved(return) ident(klass)operator(;) - operator(}) - reserved(if) operator((!)ident(super)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) ident(name)operator(\);) - operator(}) - ident(klass) operator(=) ident(rb_define_class_id)operator(()ident(id)operator(,) ident(super)operator(\);) - ident(st_add_direct)operator(()ident(rb_class_tbl)operator(,) ident(id)operator(,) ident(klass)operator(\);) - ident(rb_name_class)operator(()ident(klass)operator(,) ident(id)operator(\);) - ident(rb_const_set)operator(()ident(rb_cObject)operator(,) ident(id)operator(,) ident(klass)operator(\);) - ident(rb_class_inherited)operator(()ident(super)operator(,) ident(klass)operator(\);) - - reserved(return) ident(klass)operator(;) -operator(}) - -ident(VALUE) -ident(rb_define_class_under)operator(()ident(outer)operator(,) ident(name)operator(,) ident(super)operator(\)) - ident(VALUE) ident(outer)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) ident(super)operator(;) -operator({) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) - - ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - reserved(if) operator(()ident(rb_const_defined_at)operator(()ident(outer)operator(,) ident(id)operator(\)\)) operator({) - ident(klass) operator(=) ident(rb_const_get_at)operator(()ident(outer)operator(,) ident(id)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(klass)operator(\)) operator(!=) ident(T_CLASS)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(name)operator(\);) - operator(}) - reserved(if) operator(()ident(rb_class_real)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(\)) operator(!=) ident(super)operator(\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(name)operator(\);) - operator(}) - reserved(return) ident(klass)operator(;) - operator(}) - reserved(if) operator((!)ident(super)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) - ident(rb_class2name)operator(()ident(outer)operator(\),) ident(name)operator(\);) - operator(}) - ident(klass) operator(=) ident(rb_define_class_id)operator(()ident(id)operator(,) ident(super)operator(\);) - ident(rb_set_class_path)operator(()ident(klass)operator(,) ident(outer)operator(,) ident(name)operator(\);) - ident(rb_const_set)operator(()ident(outer)operator(,) ident(id)operator(,) ident(klass)operator(\);) - ident(rb_class_inherited)operator(()ident(super)operator(,) ident(klass)operator(\);) - - reserved(return) ident(klass)operator(;) -operator(}) - -ident(VALUE) -ident(rb_module_new)operator((\)) -operator({) - ident(NEWOBJ)operator(()ident(mdl)operator(,) reserved(struct) ident(RClass)operator(\);) - ident(OBJSETUP)operator(()ident(mdl)operator(,) ident(rb_cModule)operator(,) ident(T_MODULE)operator(\);) - - ident(mdl)operator(->)ident(super) operator(=) integer(0)operator(;) - ident(mdl)operator(->)ident(iv_tbl) operator(=) integer(0)operator(;) - ident(mdl)operator(->)ident(m_tbl) operator(=) integer(0)operator(;) - ident(mdl)operator(->)ident(m_tbl) operator(=) ident(st_init_numtable)operator((\);) - - reserved(return) operator(()ident(VALUE)operator(\))ident(mdl)operator(;) -operator(}) - -ident(VALUE) -ident(rb_define_module_id)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(mdl)operator(;) - - ident(mdl) operator(=) ident(rb_module_new)operator((\);) - ident(rb_name_class)operator(()ident(mdl)operator(,) ident(id)operator(\);) - - reserved(return) ident(mdl)operator(;) -operator(}) - -ident(VALUE) -ident(rb_define_module)operator(()ident(name)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(VALUE) ident(module)operator(;) - ident(ID) ident(id)operator(;) - - ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - reserved(if) operator(()ident(rb_const_defined)operator(()ident(rb_cObject)operator(,) ident(id)operator(\)\)) operator({) - ident(module) operator(=) ident(rb_const_get)operator(()ident(rb_cObject)operator(,) ident(id)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(module)operator(\)) operator(==) ident(T_MODULE)operator(\)) - reserved(return) ident(module)operator(;) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(rb_obj_classname)operator(()ident(module)operator(\)\);) - operator(}) - ident(module) operator(=) ident(rb_define_module_id)operator(()ident(id)operator(\);) - ident(st_add_direct)operator(()ident(rb_class_tbl)operator(,) ident(id)operator(,) ident(module)operator(\);) - ident(rb_const_set)operator(()ident(rb_cObject)operator(,) ident(id)operator(,) ident(module)operator(\);) - - reserved(return) ident(module)operator(;) -operator(}) - -ident(VALUE) -ident(rb_define_module_under)operator(()ident(outer)operator(,) ident(name)operator(\)) - ident(VALUE) ident(outer)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(VALUE) ident(module)operator(;) - ident(ID) ident(id)operator(;) - - ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - reserved(if) operator(()ident(rb_const_defined_at)operator(()ident(outer)operator(,) ident(id)operator(\)\)) operator({) - ident(module) operator(=) ident(rb_const_get_at)operator(()ident(outer)operator(,) ident(id)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(module)operator(\)) operator(==) ident(T_MODULE)operator(\)) - reserved(return) ident(module)operator(;) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_class2name)operator(()ident(outer)operator(\),) ident(rb_obj_classname)operator(()ident(module)operator(\)\);) - operator(}) - ident(module) operator(=) ident(rb_define_module_id)operator(()ident(id)operator(\);) - ident(rb_const_set)operator(()ident(outer)operator(,) ident(id)operator(,) ident(module)operator(\);) - ident(rb_set_class_path)operator(()ident(module)operator(,) ident(outer)operator(,) ident(name)operator(\);) - - reserved(return) ident(module)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(include_class_new)operator(()ident(module)operator(,) ident(super)operator(\)) - ident(VALUE) ident(module)operator(,) ident(super)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(klass)operator(,) reserved(struct) ident(RClass)operator(\);) - ident(OBJSETUP)operator(()ident(klass)operator(,) ident(rb_cClass)operator(,) ident(T_ICLASS)operator(\);) - - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(module)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(module) operator(=) ident(RBASIC)operator(()ident(module)operator(\)->)ident(klass)operator(;) - operator(}) - reserved(if) operator((!)ident(RCLASS)operator(()ident(module)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(RCLASS)operator(()ident(module)operator(\)->)ident(iv_tbl) operator(=) ident(st_init_numtable)operator((\);) - operator(}) - ident(klass)operator(->)ident(iv_tbl) operator(=) ident(RCLASS)operator(()ident(module)operator(\)->)ident(iv_tbl)operator(;) - ident(klass)operator(->)ident(m_tbl) operator(=) ident(RCLASS)operator(()ident(module)operator(\)->)ident(m_tbl)operator(;) - ident(klass)operator(->)ident(super) operator(=) ident(super)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(module)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(RBASIC)operator(()ident(klass)operator(\)->)ident(klass) operator(=) ident(RBASIC)operator(()ident(module)operator(\)->)ident(klass)operator(;) - operator(}) - reserved(else) operator({) - ident(RBASIC)operator(()ident(klass)operator(\)->)ident(klass) operator(=) ident(module)operator(;) - operator(}) - ident(OBJ_INFECT)operator(()ident(klass)operator(,) ident(module)operator(\);) - ident(OBJ_INFECT)operator(()ident(klass)operator(,) ident(super)operator(\);) - - reserved(return) operator(()ident(VALUE)operator(\))ident(klass)operator(;) -operator(}) - -directive(void) -ident(rb_include_module)operator(()ident(klass)operator(,) ident(module)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(module)operator(;) -operator({) - ident(VALUE) ident(p)operator(,) ident(c)operator(;) - pre_type(int) ident(changed) operator(=) integer(0)operator(;) - - ident(rb_frozen_class_p)operator(()ident(klass)operator(\);) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(klass)operator(\)\)) operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - operator(}) - - reserved(if) operator(()ident(TYPE)operator(()ident(module)operator(\)) operator(!=) ident(T_MODULE)operator(\)) operator({) - ident(Check_Type)operator(()ident(module)operator(,) ident(T_MODULE)operator(\);) - operator(}) - - ident(OBJ_INFECT)operator(()ident(klass)operator(,) ident(module)operator(\);) - ident(c) operator(=) ident(klass)operator(;) - reserved(while) operator(()ident(module)operator(\)) operator({) - pre_type(int) ident(superclass_seen) operator(=) ident(Qfalse)operator(;) - - reserved(if) operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl) operator(==) ident(RCLASS)operator(()ident(module)operator(\)->)ident(m_tbl)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - comment(/* ignore if the module included already in superclasses */) - reserved(for) operator(()ident(p) operator(=) ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(;) ident(p)operator(;) ident(p) operator(=) ident(RCLASS)operator(()ident(p)operator(\)->)ident(super)operator(\)) operator({) - reserved(switch) operator(()ident(BUILTIN_TYPE)operator(()ident(p)operator(\)\)) operator({) - reserved(case) ident(T_ICLASS)operator(:) - reserved(if) operator(()ident(RCLASS)operator(()ident(p)operator(\)->)ident(m_tbl) operator(==) ident(RCLASS)operator(()ident(module)operator(\)->)ident(m_tbl)operator(\)) operator({) - reserved(if) operator((!)ident(superclass_seen)operator(\)) operator({) - ident(c) operator(=) ident(p)operator(;) comment(/* move insertion point */) - operator(}) - reserved(goto) ident(skip)operator(;) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_CLASS)operator(:) - ident(superclass_seen) operator(=) ident(Qtrue)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - ident(c) operator(=) ident(RCLASS)operator(()ident(c)operator(\)->)ident(super) operator(=) ident(include_class_new)operator(()ident(module)operator(,) ident(RCLASS)operator(()ident(c)operator(\)->)ident(super)operator(\);) - ident(changed) operator(=) integer(1)operator(;) - label(skip:) - ident(module) operator(=) ident(RCLASS)operator(()ident(module)operator(\)->)ident(super)operator(;) - operator(}) - reserved(if) operator(()ident(changed)operator(\)) ident(rb_clear_cache)operator((\);) -operator(}) - -comment(/* - * call-seq: - * mod.included_modules -> array - * - * Returns the list of modules included in mod. - * - * module Mixin - * end - * - * module Outer - * include Mixin - * end - * - * Mixin.included_modules #=> [] - * Outer.included_modules #=> [Mixin] - */) - -ident(VALUE) -ident(rb_mod_included_modules)operator(()ident(mod)operator(\)) - ident(VALUE) ident(mod)operator(;) -operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - ident(VALUE) ident(p)operator(;) - - reserved(for) operator(()ident(p) operator(=) ident(RCLASS)operator(()ident(mod)operator(\)->)ident(super)operator(;) ident(p)operator(;) ident(p) operator(=) ident(RCLASS)operator(()ident(p)operator(\)->)ident(super)operator(\)) operator({) - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(p)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(RBASIC)operator(()ident(p)operator(\)->)ident(klass)operator(\);) - operator(}) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.include?(module\) => true or false - * - * Returns true if module is included in - * mod or one of mod's ancestors. - * - * module A - * end - * class B - * include A - * end - * class C < B - * end - * B.include?(A\) #=> true - * C.include?(A\) #=> true - * A.include?(A\) #=> false - */) - -ident(VALUE) -ident(rb_mod_include_p)operator(()ident(mod)operator(,) ident(mod2)operator(\)) - ident(VALUE) ident(mod)operator(;) - ident(VALUE) ident(mod2)operator(;) -operator({) - ident(VALUE) ident(p)operator(;) - - ident(Check_Type)operator(()ident(mod2)operator(,) ident(T_MODULE)operator(\);) - reserved(for) operator(()ident(p) operator(=) ident(RCLASS)operator(()ident(mod)operator(\)->)ident(super)operator(;) ident(p)operator(;) ident(p) operator(=) ident(RCLASS)operator(()ident(p)operator(\)->)ident(super)operator(\)) operator({) - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(p)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - reserved(if) operator(()ident(RBASIC)operator(()ident(p)operator(\)->)ident(klass) operator(==) ident(mod2)operator(\)) reserved(return) ident(Qtrue)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.ancestors -> array - * - * Returns a list of modules included in mod (including - * mod itself\). - * - * module Mod - * include Math - * include Comparable - * end - * - * Mod.ancestors #=> [Mod, Comparable, Math] - * Math.ancestors #=> [Math] - */) - -ident(VALUE) -ident(rb_mod_ancestors)operator(()ident(mod)operator(\)) - ident(VALUE) ident(mod)operator(;) -operator({) - ident(VALUE) ident(p)operator(,) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - reserved(for) operator(()ident(p) operator(=) ident(mod)operator(;) ident(p)operator(;) ident(p) operator(=) ident(RCLASS)operator(()ident(p)operator(\)->)ident(super)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(p)operator(,) ident(FL_SINGLETON)operator(\)\)) - reserved(continue)operator(;) - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(p)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(RBASIC)operator(()ident(p)operator(\)->)ident(klass)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(p)operator(\);) - operator(}) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -preprocessor(#define) ident(VISI)operator(()ident(x)operator(\)) operator((()ident(x)operator(\)&)ident(NOEX_MASK)operator(\)) -preprocessor(#define) ident(VISI_CHECK)operator(()ident(x)operator(,)ident(f)operator(\)) operator(()ident(VISI)operator(()ident(x)operator(\)) operator(==) operator(()ident(f)operator(\)\)) - -directive(static) pre_type(int) -ident(ins_methods_push)operator(()ident(name)operator(,) ident(type)operator(,) ident(ary)operator(,) ident(visi)operator(\)) - ident(ID) ident(name)operator(;) - pre_type(long) ident(type)operator(;) - ident(VALUE) ident(ary)operator(;) - pre_type(long) ident(visi)operator(;) -operator({) - reserved(if) operator(()ident(type) operator(==) operator(-)integer(1)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(switch) operator(()ident(visi)operator(\)) operator({) - reserved(case) ident(NOEX_PRIVATE)operator(:) - reserved(case) ident(NOEX_PROTECTED)operator(:) - reserved(case) ident(NOEX_PUBLIC)operator(:) - ident(visi) operator(=) operator(()ident(type) operator(==) ident(visi)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(visi) operator(=) operator(()ident(type) operator(!=) ident(NOEX_PRIVATE)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(visi)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(name)operator(\)\)\);) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(ins_methods_i)operator(()ident(name)operator(,) ident(type)operator(,) ident(ary)operator(\)) - ident(ID) ident(name)operator(;) - pre_type(long) ident(type)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(ins_methods_push)operator(()ident(name)operator(,) ident(type)operator(,) ident(ary)operator(,) operator(-)integer(1)operator(\);) comment(/* everything but private */) -operator(}) - -directive(static) pre_type(int) -ident(ins_methods_prot_i)operator(()ident(name)operator(,) ident(type)operator(,) ident(ary)operator(\)) - ident(ID) ident(name)operator(;) - pre_type(long) ident(type)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(ins_methods_push)operator(()ident(name)operator(,) ident(type)operator(,) ident(ary)operator(,) ident(NOEX_PROTECTED)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(ins_methods_priv_i)operator(()ident(name)operator(,) ident(type)operator(,) ident(ary)operator(\)) - ident(ID) ident(name)operator(;) - pre_type(long) ident(type)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(ins_methods_push)operator(()ident(name)operator(,) ident(type)operator(,) ident(ary)operator(,) ident(NOEX_PRIVATE)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(ins_methods_pub_i)operator(()ident(name)operator(,) ident(type)operator(,) ident(ary)operator(\)) - ident(ID) ident(name)operator(;) - pre_type(long) ident(type)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(return) ident(ins_methods_push)operator(()ident(name)operator(,) ident(type)operator(,) ident(ary)operator(,) ident(NOEX_PUBLIC)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(method_entry)operator(()ident(key)operator(,) ident(body)operator(,) ident(list)operator(\)) - ident(ID) ident(key)operator(;) - ident(NODE) operator(*)ident(body)operator(;) - ident(st_table) operator(*)ident(list)operator(;) -operator({) - pre_type(long) ident(type)operator(;) - - reserved(if) operator(()ident(key) operator(==) ident(ID_ALLOCATOR)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(if) operator((!)ident(st_lookup)operator(()ident(list)operator(,) ident(key)operator(,) integer(0)operator(\)\)) operator({) - reserved(if) operator((!)ident(body)operator(->)ident(nd_body)operator(\)) ident(type) operator(=) operator(-)integer(1)operator(;) comment(/* none */) - reserved(else) ident(type) operator(=) ident(VISI)operator(()ident(body)operator(->)ident(nd_noex)operator(\);) - ident(st_add_direct)operator(()ident(list)operator(,) ident(key)operator(,) ident(type)operator(\);) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(class_instance_method_list)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(,) ident(func)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(mod)operator(;) - pre_type(int) operator((*)ident(func)operator(\)) ident(_)operator((()ident(ID)operator(,) pre_type(long)operator(,) ident(VALUE)operator(\)\);) -operator({) - ident(VALUE) ident(ary)operator(;) - pre_type(int) ident(recur)operator(;) - ident(st_table) operator(*)ident(list)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(recur) operator(=) ident(Qtrue)operator(;) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(r)operator(;) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(r)operator(\);) - ident(recur) operator(=) ident(RTEST)operator(()ident(r)operator(\);) - operator(}) - - ident(list) operator(=) ident(st_init_numtable)operator((\);) - reserved(for) operator((;) ident(mod)operator(;) ident(mod) operator(=) ident(RCLASS)operator(()ident(mod)operator(\)->)ident(super)operator(\)) operator({) - ident(st_foreach)operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(m_tbl)operator(,) ident(method_entry)operator(,) operator(()ident(st_data_t)operator(\))ident(list)operator(\);) - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(mod)operator(\)) operator(==) ident(T_ICLASS)operator(\)) reserved(continue)operator(;) - reserved(if) operator(()ident(FL_TEST)operator(()ident(mod)operator(,) ident(FL_SINGLETON)operator(\)\)) reserved(continue)operator(;) - reserved(if) operator((!)ident(recur)operator(\)) reserved(break)operator(;) - operator(}) - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - ident(st_foreach)operator(()ident(list)operator(,) ident(func)operator(,) ident(ary)operator(\);) - ident(st_free_table)operator(()ident(list)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.instance_methods(include_super=true\) => array - * - * Returns an array containing the names of public instance methods in - * the receiver. For a module, these are the public methods; for a - * class, they are the instance (not singleton\) methods. With no - * argument, or with an argument that is false, the - * instance methods in mod are returned, otherwise the methods - * in mod and mod's superclasses are returned. - * - * module A - * def method1(\) end - * end - * class B - * def method2(\) end - * end - * class C < B - * def method3(\) end - * end - * - * A.instance_methods #=> ["method1"] - * B.instance_methods(false\) #=> ["method2"] - * C.instance_methods(false\) #=> ["method3"] - * C.instance_methods(true\).length #=> 43 - */) - -ident(VALUE) -ident(rb_class_instance_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(mod)operator(;) -operator({) - reserved(return) ident(class_instance_method_list)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(,) ident(ins_methods_i)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod.protected_instance_methods(include_super=true\) => array - * - * Returns a list of the protected instance methods defined in - * mod. If the optional parameter is not false, the - * methods of any ancestors are included. - */) - -ident(VALUE) -ident(rb_class_protected_instance_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(mod)operator(;) -operator({) - reserved(return) ident(class_instance_method_list)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(,) ident(ins_methods_prot_i)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod.private_instance_methods(include_super=true\) => array - * - * Returns a list of the private instance methods defined in - * mod. If the optional parameter is not false, the - * methods of any ancestors are included. - * - * module Mod - * def method1(\) end - * private :method1 - * def method2(\) end - * end - * Mod.instance_methods #=> ["method2"] - * Mod.private_instance_methods #=> ["method1"] - */) - -ident(VALUE) -ident(rb_class_private_instance_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(mod)operator(;) -operator({) - reserved(return) ident(class_instance_method_list)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(,) ident(ins_methods_priv_i)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod.public_instance_methods(include_super=true\) => array - * - * Returns a list of the public instance methods defined in mod. - * If the optional parameter is not false, the methods of - * any ancestors are included. - */) - -ident(VALUE) -ident(rb_class_public_instance_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(mod)operator(;) -operator({) - reserved(return) ident(class_instance_method_list)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(,) ident(ins_methods_pub_i)operator(\);) -operator(}) - -comment(/* - * call-seq: - * obj.singleton_methods(all=true\) => array - * - * Returns an array of the names of singleton methods for obj. - * If the optional all parameter is true, the list will include - * methods in modules included in obj. - * - * module Other - * def three(\) end - * end - * - * class Single - * def Single.four(\) end - * end - * - * a = Single.new - * - * def a.one(\) - * end - * - * class << a - * include Other - * def two(\) - * end - * end - * - * Single.singleton_methods #=> ["four"] - * a.singleton_methods(false\) #=> ["two", "one"] - * a.singleton_methods #=> ["two", "one", "three"] - */) - -ident(VALUE) -ident(rb_obj_singleton_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(recur)operator(,) ident(ary)operator(,) ident(klass)operator(;) - ident(st_table) operator(*)ident(list)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(recur)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(recur) operator(=) ident(Qtrue)operator(;) - operator(}) - ident(klass) operator(=) ident(CLASS_OF)operator(()ident(obj)operator(\);) - ident(list) operator(=) ident(st_init_numtable)operator((\);) - reserved(if) operator(()ident(klass) operator(&&) ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(st_foreach)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(,) ident(method_entry)operator(,) operator(()ident(st_data_t)operator(\))ident(list)operator(\);) - ident(klass) operator(=) ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(;) - operator(}) - reserved(if) operator(()ident(RTEST)operator(()ident(recur)operator(\)\)) operator({) - reserved(while) operator(()ident(klass) operator(&&) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)) operator(||) ident(TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_ICLASS)operator(\)\)) operator({) - ident(st_foreach)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(,) ident(method_entry)operator(,) operator(()ident(st_data_t)operator(\))ident(list)operator(\);) - ident(klass) operator(=) ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(;) - operator(}) - operator(}) - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - ident(st_foreach)operator(()ident(list)operator(,) ident(ins_methods_i)operator(,) ident(ary)operator(\);) - ident(st_free_table)operator(()ident(list)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -directive(void) -ident(rb_define_method_id)operator(()ident(klass)operator(,) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(name)operator(;) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - pre_type(int) ident(argc)operator(;) -operator({) - ident(rb_add_method)operator(()ident(klass)operator(,) ident(name)operator(,) ident(NEW_CFUNC)operator(()ident(func)operator(,)ident(argc)operator(\),) ident(NOEX_PUBLIC)operator(\);) -operator(}) - -directive(void) -ident(rb_define_method)operator(()ident(klass)operator(,) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - pre_type(int) ident(argc)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - pre_type(int) ident(ex) operator(=) ident(NOEX_PUBLIC)operator(;) - - - ident(rb_add_method)operator(()ident(klass)operator(,) ident(id)operator(,) ident(NEW_CFUNC)operator(()ident(func)operator(,) ident(argc)operator(\),) ident(ex)operator(\);) -operator(}) - -directive(void) -ident(rb_define_protected_method)operator(()ident(klass)operator(,) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - pre_type(int) ident(argc)operator(;) -operator({) - ident(rb_add_method)operator(()ident(klass)operator(,) ident(rb_intern)operator(()ident(name)operator(\),) ident(NEW_CFUNC)operator(()ident(func)operator(,) ident(argc)operator(\),) ident(NOEX_PROTECTED)operator(\);) -operator(}) - -directive(void) -ident(rb_define_private_method)operator(()ident(klass)operator(,) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - pre_type(int) ident(argc)operator(;) -operator({) - ident(rb_add_method)operator(()ident(klass)operator(,) ident(rb_intern)operator(()ident(name)operator(\),) ident(NEW_CFUNC)operator(()ident(func)operator(,) ident(argc)operator(\),) ident(NOEX_PRIVATE)operator(\);) -operator(}) - -directive(void) -ident(rb_undef_method)operator(()ident(klass)operator(,) ident(name)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(rb_add_method)operator(()ident(klass)operator(,) ident(rb_intern)operator(()ident(name)operator(\),) integer(0)operator(,) ident(NOEX_UNDEF)operator(\);) -operator(}) - -preprocessor(#define) ident(SPECIAL_SINGLETON)operator(()ident(x)operator(,)ident(c)operator(\)) reserved(do) operator({)\ - reserved(if) operator(()ident(obj) operator(==) operator(()ident(x)operator(\)\)) operator({)\ - reserved(return) ident(c)operator(;)\ - operator(})\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -ident(VALUE) -ident(rb_singleton_class)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(klass)operator(;) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(obj)operator(\)) operator(||) ident(SYMBOL_P)operator(()ident(obj)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(rb_special_const_p)operator(()ident(obj)operator(\)\)) operator({) - ident(SPECIAL_SINGLETON)operator(()ident(Qnil)operator(,) ident(rb_cNilClass)operator(\);) - ident(SPECIAL_SINGLETON)operator(()ident(Qfalse)operator(,) ident(rb_cFalseClass)operator(\);) - ident(SPECIAL_SINGLETON)operator(()ident(Qtrue)operator(,) ident(rb_cTrueClass)operator(\);) - ident(rb_bug)operator(()stringoperator(,) ident(obj)operator(\);) - operator(}) - - ident(DEFER_INTS)operator(;) - reserved(if) operator(()ident(FL_TEST)operator(()ident(RBASIC)operator(()ident(obj)operator(\)->)ident(klass)operator(,) ident(FL_SINGLETON)operator(\)) operator(&&) - ident(rb_iv_get)operator(()ident(RBASIC)operator(()ident(obj)operator(\)->)ident(klass)operator(,) stringoperator(\)) operator(==) ident(obj)operator(\)) operator({) - ident(klass) operator(=) ident(RBASIC)operator(()ident(obj)operator(\)->)ident(klass)operator(;) - operator(}) - reserved(else) operator({) - ident(klass) operator(=) ident(rb_make_metaclass)operator(()ident(obj)operator(,) ident(RBASIC)operator(()ident(obj)operator(\)->)ident(klass)operator(\);) - operator(}) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(obj)operator(\)\)) operator({) - ident(OBJ_TAINT)operator(()ident(klass)operator(\);) - operator(}) - reserved(else) operator({) - ident(FL_UNSET)operator(()ident(klass)operator(,) ident(FL_TAINT)operator(\);) - operator(}) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(obj)operator(\)\)) ident(OBJ_FREEZE)operator(()ident(klass)operator(\);) - ident(ALLOW_INTS)operator(;) - - reserved(return) ident(klass)operator(;) -operator(}) - -directive(void) -ident(rb_define_singleton_method)operator(()ident(obj)operator(,) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\)) - ident(VALUE) ident(obj)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - pre_type(int) ident(argc)operator(;) -operator({) - ident(rb_define_method)operator(()ident(rb_singleton_class)operator(()ident(obj)operator(\),) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\);) -operator(}) - -directive(void) -ident(rb_define_module_function)operator(()ident(module)operator(,) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\)) - ident(VALUE) ident(module)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - pre_type(int) ident(argc)operator(;) -operator({) - ident(rb_define_private_method)operator(()ident(module)operator(,) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\);) - ident(rb_define_singleton_method)operator(()ident(module)operator(,) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\);) -operator(}) - -directive(void) -ident(rb_define_global_function)operator(()ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - pre_type(int) ident(argc)operator(;) -operator({) - ident(rb_define_module_function)operator(()ident(rb_mKernel)operator(,) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\);) -operator(}) - -directive(void) -ident(rb_define_alias)operator(()ident(klass)operator(,) ident(name1)operator(,) ident(name2)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name1)operator(,) operator(*)ident(name2)operator(;) -operator({) - ident(rb_alias)operator(()ident(klass)operator(,) ident(rb_intern)operator(()ident(name1)operator(\),) ident(rb_intern)operator(()ident(name2)operator(\)\);) -operator(}) - -directive(void) -ident(rb_define_attr)operator(()ident(klass)operator(,) ident(name)operator(,) ident(read)operator(,) ident(write)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - pre_type(int) ident(read)operator(,) ident(write)operator(;) -operator({) - ident(rb_attr)operator(()ident(klass)operator(,) ident(rb_intern)operator(()ident(name)operator(\),) ident(read)operator(,) ident(write)operator(,) ident(Qfalse)operator(\);) -operator(}) - -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -preprocessor(#include) include() -preprocessor(#define) ident(va_init_list)operator(()ident(a)operator(,)ident(b)operator(\)) ident(va_start)operator(()ident(a)operator(,)ident(b)operator(\)) -preprocessor(#else) -preprocessor(#include) include() -preprocessor(#define) ident(va_init_list)operator(()ident(a)operator(,)ident(b)operator(\)) ident(va_start)operator(()ident(a)operator(\)) -preprocessor(#endif) - -pre_type(int) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_scan_args)operator(()pre_type(int) ident(argc)operator(,) directive(const) ident(VALUE) operator(*)ident(argv)operator(,) directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(fmt)operator(,) ident(va_alist)operator(\)) - pre_type(int) ident(argc)operator(;) - directive(const) ident(VALUE) operator(*)ident(argv)operator(;) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - pre_type(int) ident(n)operator(,) ident(i) operator(=) integer(0)operator(;) - directive(const) pre_type(char) operator(*)ident(p) operator(=) ident(fmt)operator(;) - ident(VALUE) operator(*)ident(var)operator(;) - ident(va_list) ident(vargs)operator(;) - - ident(va_init_list)operator(()ident(vargs)operator(,) ident(fmt)operator(\);) - - reserved(if) operator((*)ident(p) operator(==) char('*')operator(\)) reserved(goto) ident(rest_arg)operator(;) - - reserved(if) operator(()ident(ISDIGIT)operator((*)ident(p)operator(\)\)) operator({) - ident(n) operator(=) operator(*)ident(p) operator(-) char('0')operator(;) - reserved(if) operator(()ident(n) operator(>) ident(argc)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(,) ident(n)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(n)operator(;) ident(i)operator(++\)) operator({) - ident(var) operator(=) ident(va_arg)operator(()ident(vargs)operator(,) ident(VALUE)operator(*\);) - reserved(if) operator(()ident(var)operator(\)) operator(*)ident(var) operator(=) ident(argv)operator([)ident(i)operator(];) - operator(}) - ident(p)operator(++;) - operator(}) - reserved(else) operator({) - reserved(goto) ident(error)operator(;) - operator(}) - - reserved(if) operator(()ident(ISDIGIT)operator((*)ident(p)operator(\)\)) operator({) - ident(n) operator(=) ident(i) operator(+) operator(*)ident(p) operator(-) char('0')operator(;) - reserved(for) operator((;) ident(i)operator(<)ident(n)operator(;) ident(i)operator(++\)) operator({) - ident(var) operator(=) ident(va_arg)operator(()ident(vargs)operator(,) ident(VALUE)operator(*\);) - reserved(if) operator(()ident(argc) operator(>) ident(i)operator(\)) operator({) - reserved(if) operator(()ident(var)operator(\)) operator(*)ident(var) operator(=) ident(argv)operator([)ident(i)operator(];) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(var)operator(\)) operator(*)ident(var) operator(=) ident(Qnil)operator(;) - operator(}) - operator(}) - ident(p)operator(++;) - operator(}) - - reserved(if)operator((*)ident(p) operator(==) char('*')operator(\)) operator({) - label(rest_arg:) - ident(var) operator(=) ident(va_arg)operator(()ident(vargs)operator(,) ident(VALUE)operator(*\);) - reserved(if) operator(()ident(argc) operator(>) ident(i)operator(\)) operator({) - reserved(if) operator(()ident(var)operator(\)) operator(*)ident(var) operator(=) ident(rb_ary_new4)operator(()ident(argc)operator(-)ident(i)operator(,) ident(argv)operator(+)ident(i)operator(\);) - ident(i) operator(=) ident(argc)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(var)operator(\)) operator(*)ident(var) operator(=) ident(rb_ary_new)operator((\);) - operator(}) - ident(p)operator(++;) - operator(}) - - reserved(if) operator((*)ident(p) operator(==) char('&')operator(\)) operator({) - ident(var) operator(=) ident(va_arg)operator(()ident(vargs)operator(,) ident(VALUE)operator(*\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - operator(*)ident(var) operator(=) ident(rb_block_proc)operator((\);) - operator(}) - reserved(else) operator({) - operator(*)ident(var) operator(=) ident(Qnil)operator(;) - operator(}) - ident(p)operator(++;) - operator(}) - ident(va_end)operator(()ident(vargs)operator(\);) - - reserved(if) operator((*)ident(p) operator(!=) char('\\0')operator(\)) operator({) - reserved(goto) ident(error)operator(;) - operator(}) - - reserved(if) operator(()ident(argc) operator(>) ident(i)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(,) ident(i)operator(\);) - operator(}) - - reserved(return) ident(argc)operator(;) - - label(error:) - ident(rb_fatal)operator(()stringoperator(,) ident(fmt)operator(\);) - reserved(return) integer(0)operator(;) -operator(}) -comment(/********************************************************************** - - compar.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007\) $ - created at: Thu Aug 26 14:39:48 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") - -ident(VALUE) ident(rb_mComparable)operator(;) - -directive(static) ident(ID) ident(cmp)operator(;) - -pre_type(int) -ident(rb_cmpint)operator(()ident(val)operator(,) ident(a)operator(,) ident(b)operator(\)) - ident(VALUE) ident(val)operator(,) ident(a)operator(,) ident(b)operator(;) -operator({) - reserved(if) operator(()ident(NIL_P)operator(()ident(val)operator(\)\)) operator({) - ident(rb_cmperr)operator(()ident(a)operator(,) ident(b)operator(\);) - operator(}) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(val)operator(\)\)) reserved(return) ident(FIX2INT)operator(()ident(val)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(val)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) operator({) - reserved(if) operator(()ident(RBIGNUM)operator(()ident(val)operator(\)->)ident(sign)operator(\)) reserved(return) integer(1)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_funcall)operator(()ident(val)operator(,) char('>')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)\)) reserved(return) integer(1)operator(;) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_funcall)operator(()ident(val)operator(,) char('<')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)\)) reserved(return) operator(-)integer(1)operator(;) - reserved(return) integer(0)operator(;) -operator(}) - -directive(void) -ident(rb_cmperr)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(classname)operator(;) - - reserved(if) operator(()ident(SPECIAL_CONST_P)operator(()ident(y)operator(\)\)) operator({) - ident(y) operator(=) ident(rb_inspect)operator(()ident(y)operator(\);) - ident(classname) operator(=) ident(StringValuePtr)operator(()ident(y)operator(\);) - operator(}) - reserved(else) operator({) - ident(classname) operator(=) ident(rb_obj_classname)operator(()ident(y)operator(\);) - operator(}) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(x)operator(\),) ident(classname)operator(\);) -operator(}) - -preprocessor(#define) ident(cmperr)operator((\)) operator(()ident(rb_cmperr)operator(()ident(x)operator(,) ident(y)operator(\),) ident(Qnil)operator(\)) - -directive(static) ident(VALUE) -ident(cmp_eq)operator(()ident(a)operator(\)) - ident(VALUE) operator(*)ident(a)operator(;) -operator({) - ident(VALUE) ident(c) operator(=) ident(rb_funcall)operator(()ident(a)operator([)integer(0)operator(],) ident(cmp)operator(,) integer(1)operator(,) ident(a)operator([)integer(1)operator(]\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(c)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(rb_cmpint)operator(()ident(c)operator(,) ident(a)operator([)integer(0)operator(],) ident(a)operator([)integer(1)operator(]\)) operator(==) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(cmp_failed)operator((\)) -operator({) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj == other => true or false - * - * Compares two objects based on the receiver's <=> - * method, returning true if it returns 0. Also returns true if - * _obj_ and _other_ are the same object. - */) - -directive(static) ident(VALUE) -ident(cmp_equal)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(a)operator([)integer(2)operator(];) - - reserved(if) operator(()ident(x) operator(==) ident(y)operator(\)) reserved(return) ident(Qtrue)operator(;) - - ident(a)operator([)integer(0)operator(]) operator(=) ident(x)operator(;) ident(a)operator([)integer(1)operator(]) operator(=) ident(y)operator(;) - reserved(return) ident(rb_rescue)operator(()ident(cmp_eq)operator(,) operator(()ident(VALUE)operator(\))ident(a)operator(,) ident(cmp_failed)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * obj > other => true or false - * - * Compares two objects based on the receiver's <=> - * method, returning true if it returns 1. - */) - -directive(static) ident(VALUE) -ident(cmp_gt)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(c) operator(=) ident(rb_funcall)operator(()ident(x)operator(,) ident(cmp)operator(,) integer(1)operator(,) ident(y)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(c)operator(\)\)) reserved(return) ident(cmperr)operator((\);) - reserved(if) operator(()ident(rb_cmpint)operator(()ident(c)operator(,) ident(x)operator(,) ident(y)operator(\)) operator(>) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj >= other => true or false - * - * Compares two objects based on the receiver's <=> - * method, returning true if it returns 0 or 1. - */) - -directive(static) ident(VALUE) -ident(cmp_ge)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(c) operator(=) ident(rb_funcall)operator(()ident(x)operator(,) ident(cmp)operator(,) integer(1)operator(,) ident(y)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(c)operator(\)\)) reserved(return) ident(cmperr)operator((\);) - reserved(if) operator(()ident(rb_cmpint)operator(()ident(c)operator(,) ident(x)operator(,) ident(y)operator(\)) operator(>=) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj < other => true or false - * - * Compares two objects based on the receiver's <=> - * method, returning true if it returns -1. - */) - -directive(static) ident(VALUE) -ident(cmp_lt)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(c) operator(=) ident(rb_funcall)operator(()ident(x)operator(,) ident(cmp)operator(,) integer(1)operator(,) ident(y)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(c)operator(\)\)) reserved(return) ident(cmperr)operator((\);) - reserved(if) operator(()ident(rb_cmpint)operator(()ident(c)operator(,) ident(x)operator(,) ident(y)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * obj <= other => true or false - * - * Compares two objects based on the receiver's <=> - * method, returning true if it returns -1 or 0. - */) - -directive(static) ident(VALUE) -ident(cmp_le)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(c) operator(=) ident(rb_funcall)operator(()ident(x)operator(,) ident(cmp)operator(,) integer(1)operator(,) ident(y)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(c)operator(\)\)) reserved(return) ident(cmperr)operator((\);) - reserved(if) operator(()ident(rb_cmpint)operator(()ident(c)operator(,) ident(x)operator(,) ident(y)operator(\)) operator(<=) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.between?(min, max\) => true or false - * - * Returns false if obj <=> - * min is less than zero or if anObject <=> - * max is greater than zero, true otherwise. - * - * 3.between?(1, 5\) #=> true - * 6.between?(1, 5\) #=> false - * 'cat'.between?('ant', 'dog'\) #=> true - * 'gnu'.between?('ant', 'dog'\) #=> false - * - */) - -directive(static) ident(VALUE) -ident(cmp_between)operator(()ident(x)operator(,) ident(min)operator(,) ident(max)operator(\)) - ident(VALUE) ident(x)operator(,) ident(min)operator(,) ident(max)operator(;) -operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(cmp_lt)operator(()ident(x)operator(,) ident(min)operator(\)\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(RTEST)operator(()ident(cmp_gt)operator(()ident(x)operator(,) ident(max)operator(\)\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * The Comparable mixin is used by classes whose objects - * may be ordered. The class must define the <=> operator, - * which compares the receiver against another object, returning -1, 0, - * or +1 depending on whether the receiver is less than, equal to, or - * greater than the other object. Comparable uses - * <=> to implement the conventional comparison operators - * (<, <=, ==, >=, - * and >\) and the method between?. - * - * class SizeMatters - * include Comparable - * attr :str - * def <=>(anOther\) - * str.size <=> anOther.str.size - * end - * def initialize(str\) - * @str = str - * end - * def inspect - * @str - * end - * end - * - * s1 = SizeMatters.new("Z"\) - * s2 = SizeMatters.new("YY"\) - * s3 = SizeMatters.new("XXX"\) - * s4 = SizeMatters.new("WWWW"\) - * s5 = SizeMatters.new("VVVVV"\) - * - * s1 < s2 #=> true - * s4.between?(s1, s3\) #=> false - * s4.between?(s3, s5\) #=> true - * [ s3, s2, s5, s4, s1 ].sort #=> [Z, YY, XXX, WWWW, VVVVV] - * - */) - -directive(void) -ident(Init_Comparable)operator((\)) -operator({) - ident(rb_mComparable) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - ident(rb_define_method)operator(()ident(rb_mComparable)operator(,) stringoperator(,) ident(cmp_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mComparable)operator(,) string)delimiter(")>operator(,) ident(cmp_gt)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mComparable)operator(,) string=)delimiter(")>operator(,) ident(cmp_ge)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mComparable)operator(,) stringoperator(,) ident(cmp_lt)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mComparable)operator(,) stringoperator(,) ident(cmp_le)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mComparable)operator(,) stringoperator(,) ident(cmp_between)operator(,) integer(2)operator(\);) - - ident(cmp) operator(=) ident(rb_intern)operator(()string)delimiter(")>operator(\);) -operator(}) -comment(/********************************************************************** - - dir.c - - - $Author: shyouhei $ - $Date: 2009-02-04 06:26:31 +0100 (Wed, 04 Feb 2009\) $ - created at: Wed Jan 5 09:51:01 JST 1994 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") - -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#ifdef) ident(HAVE_UNISTD_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(HAVE_DIRENT_H) operator(&&) operator(!)ident(defined) ident(_WIN32) -preprocessor(# include) include() -preprocessor(# define) ident(NAMLEN)operator(()ident(dirent)operator(\)) ident(strlen)operator((()ident(dirent)operator(\)->)ident(d_name)operator(\)) -preprocessor(#elif) ident(defined) ident(HAVE_DIRECT_H) operator(&&) operator(!)ident(defined) ident(_WIN32) -preprocessor(# include) include() -preprocessor(# define) ident(NAMLEN)operator(()ident(dirent)operator(\)) ident(strlen)operator((()ident(dirent)operator(\)->)ident(d_name)operator(\)) -preprocessor(#else) -preprocessor(# define) ident(dirent) ident(direct) -preprocessor(# if) operator(!)ident(defined) ident(__NeXT__) -preprocessor(# define) ident(NAMLEN)operator(()ident(dirent)operator(\)) operator(()ident(dirent)operator(\)->)ident(d_namlen) -preprocessor(# else) -preprocessor(# )comment(/* On some versions of NextStep, d_namlen is always zero, so avoid it. */) -preprocessor(# define) ident(NAMLEN)operator(()ident(dirent)operator(\)) ident(strlen)operator((()ident(dirent)operator(\)->)ident(d_name)operator(\)) -preprocessor(# endif) -preprocessor(# if) ident(HAVE_SYS_NDIR_H) -preprocessor(# include) include() -preprocessor(# endif) -preprocessor(# if) ident(HAVE_SYS_DIR_H) -preprocessor(# include) include() -preprocessor(# endif) -preprocessor(# if) ident(HAVE_NDIR_H) -preprocessor(# include) include() -preprocessor(# endif) -preprocessor(# ifdef) ident(_WIN32) -preprocessor(# include) include("win32/dir.h") -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#include) include() - -preprocessor(#ifndef) ident(HAVE_STDLIB_H) -pre_type(char) operator(*)ident(getenv)operator((\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_STRING_H) -pre_type(char) operator(*)ident(strchr) ident(_)operator((()pre_type(char)operator(*,)pre_type(char)operator(\)\);) -preprocessor(#endif) - -preprocessor(#include) include() - -preprocessor(#include) include("util.h") - -preprocessor(#if) operator(!)ident(defined) ident(HAVE_LSTAT) operator(&&) operator(!)ident(defined) ident(lstat) -preprocessor(#define) ident(lstat) ident(stat) -preprocessor(#endif) - -preprocessor(#ifndef) ident(CASEFOLD_FILESYSTEM) -preprocessor(# if) ident(defined) ident(DOSISH) operator(||) ident(defined) ident(__VMS) -preprocessor(# define) ident(CASEFOLD_FILESYSTEM) integer(1) -preprocessor(# else) -preprocessor(# define) ident(CASEFOLD_FILESYSTEM) integer(0) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#define) ident(FNM_NOESCAPE) hex(0x01) -preprocessor(#define) ident(FNM_PATHNAME) hex(0x02) -preprocessor(#define) ident(FNM_DOTMATCH) hex(0x04) -preprocessor(#define) ident(FNM_CASEFOLD) hex(0x08) -preprocessor(#if) ident(CASEFOLD_FILESYSTEM) -preprocessor(#define) ident(FNM_SYSCASE) ident(FNM_CASEFOLD) -preprocessor(#else) -preprocessor(#define) ident(FNM_SYSCASE) integer(0) -preprocessor(#endif) - -preprocessor(#define) ident(FNM_NOMATCH) integer(1) -preprocessor(#define) ident(FNM_ERROR) integer(2) - -preprocessor(#define) ident(downcase)operator(()ident(c)operator(\)) operator(()ident(nocase) operator(&&) ident(ISUPPER)operator(()ident(c)operator(\)) operator(?) ident(tolower)operator(()ident(c)operator(\)) operator(:) operator(()ident(c)operator(\)\)) -preprocessor(#define) ident(compare)operator(()ident(c1)operator(,) ident(c2)operator(\)) operator(((()pre_type(unsigned) pre_type(char)operator(\)()ident(c1)operator(\)\)) operator(-) operator((()pre_type(unsigned) pre_type(char)operator(\)()ident(c2)operator(\)\)\)) - -comment(/* caution: in case *p == '\\0' - Next(p\) == p + 1 in single byte environment - Next(p\) == p in multi byte environment -*/) -preprocessor(#if) ident(defined)operator(()ident(CharNext)operator(\)) -preprocessor(# define) ident(Next)operator(()ident(p)operator(\)) ident(CharNext)operator(()ident(p)operator(\)) -preprocessor(#elif) ident(defined)operator(()ident(DJGPP)operator(\)) -preprocessor(# define) ident(Next)operator(()ident(p)operator(\)) operator((()ident(p)operator(\)) operator(+) ident(mblen)operator(()ident(p)operator(,) ident(RUBY_MBCHAR_MAXSIZE)operator(\)\)) -preprocessor(#elif) ident(defined)operator(()ident(__EMX__)operator(\)) -preprocessor(# define) ident(Next)operator(()ident(p)operator(\)) operator((()ident(p)operator(\)) operator(+) ident(emx_mblen)operator(()ident(p)operator(\)\)) -directive(static) directive(inline) pre_type(int) -ident(emx_mblen)operator(()directive(const) pre_type(char) operator(*)ident(p)operator(\)) -operator({) - pre_type(int) ident(n) operator(=) ident(mblen)operator(()ident(p)operator(,) ident(RUBY_MBCHAR_MAXSIZE)operator(\);) - reserved(return) operator(()ident(n) operator(<) integer(0)operator(\)) operator(?) integer(1) operator(:) ident(n)operator(;) -operator(}) -preprocessor(#endif) - -preprocessor(#ifndef) ident(Next) comment(/* single byte environment */) -preprocessor(# define) ident(Next)operator(()ident(p)operator(\)) operator((()ident(p)operator(\)) operator(+) integer(1)operator(\)) -preprocessor(# define) ident(Inc)operator(()ident(p)operator(\)) operator((++()ident(p)operator(\)\)) -preprocessor(# define) ident(Compare)operator(()ident(p1)operator(,) ident(p2)operator(\)) operator(()ident(compare)operator(()ident(downcase)operator((*()ident(p1)operator(\)\),) ident(downcase)operator((*()ident(p2)operator(\)\)\)\)) -preprocessor(#else) comment(/* multi byte environment */) -preprocessor(# define) ident(Inc)operator(()ident(p)operator(\)) operator((()ident(p)operator(\)) operator(=) ident(Next)operator(()ident(p)operator(\)\)) -preprocessor(# define) ident(Compare)operator(()ident(p1)operator(,) ident(p2)operator(\)) operator(()ident(CompareImpl)operator(()ident(p1)operator(,) ident(p2)operator(,) ident(nocase)operator(\)\)) -directive(static) pre_type(int) -ident(CompareImpl)operator(()directive(const) pre_type(char) operator(*)ident(p1)operator(,) directive(const) pre_type(char) operator(*)ident(p2)operator(,) pre_type(int) ident(nocase)operator(\)) -operator({) - directive(const) pre_type(int) ident(len1) operator(=) ident(Next)operator(()ident(p1)operator(\)) operator(-) ident(p1)operator(;) - directive(const) pre_type(int) ident(len2) operator(=) ident(Next)operator(()ident(p2)operator(\)) operator(-) ident(p2)operator(;) -preprocessor(#ifdef) ident(_WIN32) - pre_type(char) ident(buf1)operator([)integer(10)operator(],) ident(buf2)operator([)integer(10)operator(];) comment(/* large enough? */) -preprocessor(#endif) - - reserved(if) operator(()ident(len1) operator(<) integer(0) operator(||) ident(len2) operator(<) integer(0)operator(\)) operator({) - ident(rb_fatal)operator(()stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(len1) operator(==) integer(0)operator(\)) reserved(return) ident(len2)operator(;) - reserved(if) operator(()ident(len2) operator(==) integer(0)operator(\)) reserved(return) operator(-)ident(len1)operator(;) - -preprocessor(#ifdef) ident(_WIN32) - reserved(if) operator(()ident(nocase) operator(&&) ident(rb_w32_iswinnt)operator((\)\)) operator({) - reserved(if) operator(()ident(len1) operator(>) integer(1)operator(\)) operator({) - reserved(if) operator(()ident(len1) operator(>=) reserved(sizeof)operator(()ident(buf1)operator(\)\)) operator({) - ident(rb_fatal)operator(()stringoperator(\);) - operator(}) - ident(memcpy)operator(()ident(buf1)operator(,) ident(p1)operator(,) ident(len1)operator(\);) - ident(buf1)operator([)ident(len1)operator(]) operator(=) char('\\0')operator(;) - ident(CharLower)operator(()ident(buf1)operator(\);) - ident(p1) operator(=) ident(buf1)operator(;) comment(/* trick */) - operator(}) - reserved(if) operator(()ident(len2) operator(>) integer(1)operator(\)) operator({) - reserved(if) operator(()ident(len2) operator(>=) reserved(sizeof)operator(()ident(buf2)operator(\)\)) operator({) - ident(rb_fatal)operator(()stringoperator(\);) - operator(}) - ident(memcpy)operator(()ident(buf2)operator(,) ident(p2)operator(,) ident(len2)operator(\);) - ident(buf2)operator([)ident(len2)operator(]) operator(=) char('\\0')operator(;) - ident(CharLower)operator(()ident(buf2)operator(\);) - ident(p2) operator(=) ident(buf2)operator(;) comment(/* trick */) - operator(}) - operator(}) -preprocessor(#endif) - reserved(if) operator(()ident(len1) operator(==) integer(1)operator(\)) - reserved(if) operator(()ident(len2) operator(==) integer(1)operator(\)) - reserved(return) ident(compare)operator(()ident(downcase)operator((*)ident(p1)operator(\),) ident(downcase)operator((*)ident(p2)operator(\)\);) - reserved(else) operator({) - directive(const) pre_type(int) ident(ret) operator(=) ident(compare)operator(()ident(downcase)operator((*)ident(p1)operator(\),) operator(*)ident(p2)operator(\);) - reserved(return) ident(ret) operator(?) ident(ret) operator(:) operator(-)integer(1)operator(;) - operator(}) - reserved(else) - reserved(if) operator(()ident(len2) operator(==) integer(1)operator(\)) operator({) - directive(const) pre_type(int) ident(ret) operator(=) ident(compare)operator((*)ident(p1)operator(,) ident(downcase)operator((*)ident(p2)operator(\)\);) - reserved(return) ident(ret) operator(?) ident(ret) operator(:) integer(1)operator(;) - operator(}) - reserved(else) operator({) - directive(const) pre_type(int) ident(ret) operator(=) ident(memcmp)operator(()ident(p1)operator(,) ident(p2)operator(,) ident(len1) operator(<) ident(len2) operator(?) ident(len1) operator(:) ident(len2)operator(\);) - reserved(return) ident(ret) operator(?) ident(ret) operator(:) ident(len1) operator(-) ident(len2)operator(;) - operator(}) -operator(}) -preprocessor(#endif) comment(/* environment */) - -directive(static) pre_type(char) operator(*) -ident(bracket)operator(()ident(p)operator(,) ident(s)operator(,) ident(flags)operator(\)) - directive(const) pre_type(char) operator(*)ident(p)operator(;) comment(/* pattern (next to '['\) */) - directive(const) pre_type(char) operator(*)ident(s)operator(;) comment(/* string */) - pre_type(int) ident(flags)operator(;) -operator({) - directive(const) pre_type(int) ident(nocase) operator(=) ident(flags) operator(&) ident(FNM_CASEFOLD)operator(;) - directive(const) pre_type(int) ident(escape) operator(=) operator(!()ident(flags) operator(&) ident(FNM_NOESCAPE)operator(\);) - - pre_type(int) ident(ok) operator(=) integer(0)operator(,) ident(not) operator(=) integer(0)operator(;) - - reserved(if) operator((*)ident(p) operator(==) char('!') operator(||) operator(*)ident(p) operator(==) char('^')operator(\)) operator({) - ident(not) operator(=) integer(1)operator(;) - ident(p)operator(++;) - operator(}) - - reserved(while) operator((*)ident(p) operator(!=) char(']')operator(\)) operator({) - directive(const) pre_type(char) operator(*)ident(t1) operator(=) ident(p)operator(;) - reserved(if) operator(()ident(escape) operator(&&) operator(*)ident(t1) operator(==) char('\\\\')operator(\)) - ident(t1)operator(++;) - reserved(if) operator((!*)ident(t1)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - ident(p) operator(=) ident(Next)operator(()ident(t1)operator(\);) - reserved(if) operator(()ident(p)operator([)integer(0)operator(]) operator(==) char('-') operator(&&) ident(p)operator([)integer(1)operator(]) operator(!=) char(']')operator(\)) operator({) - directive(const) pre_type(char) operator(*)ident(t2) operator(=) ident(p) operator(+) integer(1)operator(;) - reserved(if) operator(()ident(escape) operator(&&) operator(*)ident(t2) operator(==) char('\\\\')operator(\)) - ident(t2)operator(++;) - reserved(if) operator((!*)ident(t2)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - ident(p) operator(=) ident(Next)operator(()ident(t2)operator(\);) - reserved(if) operator((!)ident(ok) operator(&&) ident(Compare)operator(()ident(t1)operator(,) ident(s)operator(\)) operator(<=) integer(0) operator(&&) ident(Compare)operator(()ident(s)operator(,) ident(t2)operator(\)) operator(<=) integer(0)operator(\)) - ident(ok) operator(=) integer(1)operator(;) - operator(}) - reserved(else) - reserved(if) operator((!)ident(ok) operator(&&) ident(Compare)operator(()ident(t1)operator(,) ident(s)operator(\)) operator(==) integer(0)operator(\)) - ident(ok) operator(=) integer(1)operator(;) - operator(}) - - reserved(return) ident(ok) operator(==) ident(not) operator(?) pre_constant(NULL) operator(:) operator(()pre_type(char) operator(*\))ident(p) operator(+) integer(1)operator(;) -operator(}) - -comment(/* If FNM_PATHNAME is set, only path element will be matched. (upto '/' or '\\0'\) - Otherwise, entire string will be matched. - End marker itself won't be compared. - And if function succeeds, *pcur reaches end marker. -*/) -preprocessor(#define) ident(UNESCAPE)operator(()ident(p)operator(\)) operator(()ident(escape) operator(&&) operator(*()ident(p)operator(\)) operator(==) char('\\\\') operator(?) operator(()ident(p)operator(\)) operator(+) integer(1) operator(:) operator(()ident(p)operator(\)\)) -preprocessor(#define) ident(ISEND)operator(()ident(p)operator(\)) operator((!*()ident(p)operator(\)) operator(||) operator(()ident(pathname) operator(&&) operator(*()ident(p)operator(\)) operator(==) char('/')operator(\)\)) -preprocessor(#define) ident(RETURN)operator(()ident(val)operator(\)) reserved(return) operator(*)ident(pcur) operator(=) ident(p)operator(,) operator(*)ident(scur) operator(=) ident(s)operator(,) operator(()ident(val)operator(\);) - -directive(static) pre_type(int) -ident(fnmatch_helper)operator(()ident(pcur)operator(,) ident(scur)operator(,) ident(flags)operator(\)) - directive(const) pre_type(char) operator(**)ident(pcur)operator(;) comment(/* pattern */) - directive(const) pre_type(char) operator(**)ident(scur)operator(;) comment(/* string */) - pre_type(int) ident(flags)operator(;) -operator({) - directive(const) pre_type(int) ident(period) operator(=) operator(!()ident(flags) operator(&) ident(FNM_DOTMATCH)operator(\);) - directive(const) pre_type(int) ident(pathname) operator(=) ident(flags) operator(&) ident(FNM_PATHNAME)operator(;) - directive(const) pre_type(int) ident(escape) operator(=) operator(!()ident(flags) operator(&) ident(FNM_NOESCAPE)operator(\);) - directive(const) pre_type(int) ident(nocase) operator(=) ident(flags) operator(&) ident(FNM_CASEFOLD)operator(;) - - directive(const) pre_type(char) operator(*)ident(ptmp) operator(=) integer(0)operator(;) - directive(const) pre_type(char) operator(*)ident(stmp) operator(=) integer(0)operator(;) - - directive(const) pre_type(char) operator(*)ident(p) operator(=) operator(*)ident(pcur)operator(;) - directive(const) pre_type(char) operator(*)ident(s) operator(=) operator(*)ident(scur)operator(;) - - reserved(if) operator(()ident(period) operator(&&) operator(*)ident(s) operator(==) char('.') operator(&&) operator(*)ident(UNESCAPE)operator(()ident(p)operator(\)) operator(!=) char('.')operator(\)) comment(/* leading period */) - ident(RETURN)operator(()ident(FNM_NOMATCH)operator(\);) - - reserved(while) operator(()integer(1)operator(\)) operator({) - reserved(switch) operator((*)ident(p)operator(\)) operator({) - reserved(case) char('*')operator(:) - reserved(do) operator({) ident(p)operator(++;) operator(}) reserved(while) operator((*)ident(p) operator(==) char('*')operator(\);) - reserved(if) operator(()ident(ISEND)operator(()ident(UNESCAPE)operator(()ident(p)operator(\)\)\)) operator({) - ident(p) operator(=) ident(UNESCAPE)operator(()ident(p)operator(\);) - ident(RETURN)operator(()integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(ISEND)operator(()ident(s)operator(\)\)) - ident(RETURN)operator(()ident(FNM_NOMATCH)operator(\);) - ident(ptmp) operator(=) ident(p)operator(;) - ident(stmp) operator(=) ident(s)operator(;) - reserved(continue)operator(;) - - reserved(case) char('?')operator(:) - reserved(if) operator(()ident(ISEND)operator(()ident(s)operator(\)\)) - ident(RETURN)operator(()ident(FNM_NOMATCH)operator(\);) - ident(p)operator(++;) - ident(Inc)operator(()ident(s)operator(\);) - reserved(continue)operator(;) - - reserved(case) char('[')operator(:) operator({) - directive(const) pre_type(char) operator(*)ident(t)operator(;) - reserved(if) operator(()ident(ISEND)operator(()ident(s)operator(\)\)) - ident(RETURN)operator(()ident(FNM_NOMATCH)operator(\);) - reserved(if) operator(()ident(t) operator(=) ident(bracket)operator(()ident(p) operator(+) integer(1)operator(,) ident(s)operator(,) ident(flags)operator(\)\)) operator({) - ident(p) operator(=) ident(t)operator(;) - ident(Inc)operator(()ident(s)operator(\);) - reserved(continue)operator(;) - operator(}) - reserved(goto) ident(failed)operator(;) - operator(}) - operator(}) - - comment(/* ordinary */) - ident(p) operator(=) ident(UNESCAPE)operator(()ident(p)operator(\);) - reserved(if) operator(()ident(ISEND)operator(()ident(s)operator(\)\)) - ident(RETURN)operator(()ident(ISEND)operator(()ident(p)operator(\)) operator(?) integer(0) operator(:) ident(FNM_NOMATCH)operator(\);) - reserved(if) operator(()ident(ISEND)operator(()ident(p)operator(\)\)) - reserved(goto) ident(failed)operator(;) - reserved(if) operator(()ident(Compare)operator(()ident(p)operator(,) ident(s)operator(\)) operator(!=) integer(0)operator(\)) - reserved(goto) ident(failed)operator(;) - ident(Inc)operator(()ident(p)operator(\);) - ident(Inc)operator(()ident(s)operator(\);) - reserved(continue)operator(;) - - label(failed:) comment(/* try next '*' position */) - reserved(if) operator(()ident(ptmp) operator(&&) ident(stmp)operator(\)) operator({) - ident(p) operator(=) ident(ptmp)operator(;) - ident(Inc)operator(()ident(stmp)operator(\);) comment(/* !ISEND(*stmp\) */) - ident(s) operator(=) ident(stmp)operator(;) - reserved(continue)operator(;) - operator(}) - ident(RETURN)operator(()ident(FNM_NOMATCH)operator(\);) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(fnmatch)operator(()ident(p)operator(,) ident(s)operator(,) ident(flags)operator(\)) - directive(const) pre_type(char) operator(*)ident(p)operator(;) comment(/* pattern */) - directive(const) pre_type(char) operator(*)ident(s)operator(;) comment(/* string */) - pre_type(int) ident(flags)operator(;) -operator({) - directive(const) pre_type(int) ident(period) operator(=) operator(!()ident(flags) operator(&) ident(FNM_DOTMATCH)operator(\);) - directive(const) pre_type(int) ident(pathname) operator(=) ident(flags) operator(&) ident(FNM_PATHNAME)operator(;) - - directive(const) pre_type(char) operator(*)ident(ptmp) operator(=) integer(0)operator(;) - directive(const) pre_type(char) operator(*)ident(stmp) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(pathname)operator(\)) operator({) - reserved(while) operator(()integer(1)operator(\)) operator({) - reserved(if) operator(()ident(p)operator([)integer(0)operator(]) operator(==) char('*') operator(&&) ident(p)operator([)integer(1)operator(]) operator(==) char('*') operator(&&) ident(p)operator([)integer(2)operator(]) operator(==) char('/')operator(\)) operator({) - reserved(do) operator({) ident(p) operator(+=) integer(3)operator(;) operator(}) reserved(while) operator(()ident(p)operator([)integer(0)operator(]) operator(==) char('*') operator(&&) ident(p)operator([)integer(1)operator(]) operator(==) char('*') operator(&&) ident(p)operator([)integer(2)operator(]) operator(==) char('/')operator(\);) - ident(ptmp) operator(=) ident(p)operator(;) - ident(stmp) operator(=) ident(s)operator(;) - operator(}) - reserved(if) operator(()ident(fnmatch_helper)operator((&)ident(p)operator(,) operator(&)ident(s)operator(,) ident(flags)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(while) operator((*)ident(s) operator(&&) operator(*)ident(s) operator(!=) char('/')operator(\)) ident(Inc)operator(()ident(s)operator(\);) - reserved(if) operator((*)ident(p) operator(&&) operator(*)ident(s)operator(\)) operator({) - ident(p)operator(++;) - ident(s)operator(++;) - reserved(continue)operator(;) - operator(}) - reserved(if) operator((!*)ident(p) operator(&&) operator(!*)ident(s)operator(\)) - reserved(return) integer(0)operator(;) - operator(}) - comment(/* failed : try next recursion */) - reserved(if) operator(()ident(ptmp) operator(&&) ident(stmp) operator(&&) operator(!()ident(period) operator(&&) operator(*)ident(stmp) operator(==) char('.')operator(\)\)) operator({) - reserved(while) operator((*)ident(stmp) operator(&&) operator(*)ident(stmp) operator(!=) char('/')operator(\)) ident(Inc)operator(()ident(stmp)operator(\);) - reserved(if) operator((*)ident(stmp)operator(\)) operator({) - ident(p) operator(=) ident(ptmp)operator(;) - ident(stmp)operator(++;) - ident(s) operator(=) ident(stmp)operator(;) - reserved(continue)operator(;) - operator(}) - operator(}) - reserved(return) ident(FNM_NOMATCH)operator(;) - operator(}) - operator(}) - reserved(else) - reserved(return) ident(fnmatch_helper)operator((&)ident(p)operator(,) operator(&)ident(s)operator(,) ident(flags)operator(\);) -operator(}) - -ident(VALUE) ident(rb_cDir)operator(;) - -reserved(struct) ident(dir_data) operator({) - ident(DIR) operator(*)ident(dir)operator(;) - pre_type(char) operator(*)ident(path)operator(;) -operator(};) - -directive(static) directive(void) -ident(free_dir)operator(()ident(dir)operator(\)) - reserved(struct) ident(dir_data) operator(*)ident(dir)operator(;) -operator({) - reserved(if) operator(()ident(dir)operator(\)) operator({) - reserved(if) operator(()ident(dir)operator(->)ident(dir)operator(\)) ident(closedir)operator(()ident(dir)operator(->)ident(dir)operator(\);) - reserved(if) operator(()ident(dir)operator(->)ident(path)operator(\)) ident(free)operator(()ident(dir)operator(->)ident(path)operator(\);) - operator(}) - ident(free)operator(()ident(dir)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(dir_close) ident(_)operator((()ident(VALUE)operator(\)\);) - -directive(static) ident(VALUE) ident(dir_s_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(dir_s_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(struct) ident(dir_data) operator(*)ident(dirp)operator(;) - ident(VALUE) ident(obj) operator(=) ident(Data_Make_Struct)operator(()ident(klass)operator(,) reserved(struct) ident(dir_data)operator(,) integer(0)operator(,) ident(free_dir)operator(,) ident(dirp)operator(\);) - - ident(dirp)operator(->)ident(dir) operator(=) pre_constant(NULL)operator(;) - ident(dirp)operator(->)ident(path) operator(=) pre_constant(NULL)operator(;) - - reserved(return) ident(obj)operator(;) -operator(}) - -comment(/* - * call-seq: - * Dir.new( string \) -> aDir - * - * Returns a new directory object for the named directory. - */) -directive(static) ident(VALUE) -ident(dir_initialize)operator(()ident(dir)operator(,) ident(dirname)operator(\)) - ident(VALUE) ident(dir)operator(,) ident(dirname)operator(;) -operator({) - reserved(struct) ident(dir_data) operator(*)ident(dp)operator(;) - - ident(SafeStringValue)operator(()ident(dirname)operator(\);) - ident(Data_Get_Struct)operator(()ident(dir)operator(,) reserved(struct) ident(dir_data)operator(,) ident(dp)operator(\);) - reserved(if) operator(()ident(dp)operator(->)ident(dir)operator(\)) ident(closedir)operator(()ident(dp)operator(->)ident(dir)operator(\);) - reserved(if) operator(()ident(dp)operator(->)ident(path)operator(\)) ident(free)operator(()ident(dp)operator(->)ident(path)operator(\);) - ident(dp)operator(->)ident(dir) operator(=) pre_constant(NULL)operator(;) - ident(dp)operator(->)ident(path) operator(=) pre_constant(NULL)operator(;) - ident(dp)operator(->)ident(dir) operator(=) ident(opendir)operator(()ident(RSTRING)operator(()ident(dirname)operator(\)->)ident(ptr)operator(\);) - reserved(if) operator(()ident(dp)operator(->)ident(dir) operator(==) pre_constant(NULL)operator(\)) operator({) - reserved(if) operator(()ident(errno) operator(==) ident(EMFILE) operator(||) ident(errno) operator(==) ident(ENFILE)operator(\)) operator({) - ident(rb_gc)operator((\);) - ident(dp)operator(->)ident(dir) operator(=) ident(opendir)operator(()ident(RSTRING)operator(()ident(dirname)operator(\)->)ident(ptr)operator(\);) - operator(}) - reserved(if) operator(()ident(dp)operator(->)ident(dir) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(dirname)operator(\)->)ident(ptr)operator(\);) - operator(}) - operator(}) - ident(dp)operator(->)ident(path) operator(=) ident(strdup)operator(()ident(RSTRING)operator(()ident(dirname)operator(\)->)ident(ptr)operator(\);) - - reserved(return) ident(dir)operator(;) -operator(}) - -comment(/* - * call-seq: - * Dir.open( string \) => aDir - * Dir.open( string \) {| aDir | block } => anObject - * - * With no block, open is a synonym for - * Dir::new. If a block is present, it is passed - * aDir as a parameter. The directory is closed at the end of - * the block, and Dir::open returns the value of the - * block. - */) - -directive(static) ident(VALUE) -ident(dir_s_open)operator(()ident(klass)operator(,) ident(dirname)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(dirname)operator(;) -operator({) - reserved(struct) ident(dir_data) operator(*)ident(dp)operator(;) - ident(VALUE) ident(dir) operator(=) ident(Data_Make_Struct)operator(()ident(klass)operator(,) reserved(struct) ident(dir_data)operator(,) integer(0)operator(,) ident(free_dir)operator(,) ident(dp)operator(\);) - - ident(dir_initialize)operator(()ident(dir)operator(,) ident(dirname)operator(\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - reserved(return) ident(rb_ensure)operator(()ident(rb_yield)operator(,) ident(dir)operator(,) ident(dir_close)operator(,) ident(dir)operator(\);) - operator(}) - - reserved(return) ident(dir)operator(;) -operator(}) - -directive(static) directive(void) -ident(dir_closed)operator((\)) -operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) -operator(}) - -directive(static) directive(void) -ident(dir_check)operator(()ident(dir)operator(\)) - ident(VALUE) ident(dir)operator(;) -operator({) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(dir)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - ident(rb_check_frozen)operator(()ident(dir)operator(\);) -operator(}) - -preprocessor(#define) ident(GetDIR)operator(()ident(obj)operator(,) ident(dirp)operator(\)) reserved(do) operator({)\ - ident(dir_check)operator(()ident(dir)operator(\);)\ - ident(Data_Get_Struct)operator(()ident(obj)operator(,) reserved(struct) ident(dir_data)operator(,) ident(dirp)operator(\);)\ - reserved(if) operator(()ident(dirp)operator(->)ident(dir) operator(==) pre_constant(NULL)operator(\)) ident(dir_closed)operator((\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -comment(/* - * call-seq: - * dir.inspect => string - * - * Return a string describing this Dir object. - */) -directive(static) ident(VALUE) -ident(dir_inspect)operator(()ident(dir)operator(\)) - ident(VALUE) ident(dir)operator(;) -operator({) - reserved(struct) ident(dir_data) operator(*)ident(dirp)operator(;) - - ident(GetDIR)operator(()ident(dir)operator(,) ident(dirp)operator(\);) - reserved(if) operator(()ident(dirp)operator(->)ident(path)operator(\)) operator({) - pre_type(char) operator(*)ident(c) operator(=) ident(rb_obj_classname)operator(()ident(dir)operator(\);) - pre_type(int) ident(len) operator(=) ident(strlen)operator(()ident(c)operator(\)) operator(+) ident(strlen)operator(()ident(dirp)operator(->)ident(path)operator(\)) operator(+) integer(4)operator(;) - ident(VALUE) ident(s) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) - ident(snprintf)operator(()ident(RSTRING_PTR)operator(()ident(s)operator(\),) ident(len)operator(+)integer(1)operator(,) string)delimiter(")>operator(,) ident(c)operator(,) ident(dirp)operator(->)ident(path)operator(\);) - reserved(return) ident(s)operator(;) - operator(}) - reserved(return) ident(rb_funcall)operator(()ident(dir)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * dir.path => string or nil - * - * Returns the path parameter passed to dir's constructor. - * - * d = Dir.new(".."\) - * d.path #=> ".." - */) -directive(static) ident(VALUE) -ident(dir_path)operator(()ident(dir)operator(\)) - ident(VALUE) ident(dir)operator(;) -operator({) - reserved(struct) ident(dir_data) operator(*)ident(dirp)operator(;) - - ident(GetDIR)operator(()ident(dir)operator(,) ident(dirp)operator(\);) - reserved(if) operator((!)ident(dirp)operator(->)ident(path)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(rb_str_new2)operator(()ident(dirp)operator(->)ident(path)operator(\);) -operator(}) - -comment(/* - * call-seq: - * dir.read => string or nil - * - * Reads the next entry from dir and returns it as a string. - * Returns nil at the end of the stream. - * - * d = Dir.new("testdir"\) - * d.read #=> "." - * d.read #=> ".." - * d.read #=> "config.h" - */) -directive(static) ident(VALUE) -ident(dir_read)operator(()ident(dir)operator(\)) - ident(VALUE) ident(dir)operator(;) -operator({) - reserved(struct) ident(dir_data) operator(*)ident(dirp)operator(;) - reserved(struct) ident(dirent) operator(*)ident(dp)operator(;) - - ident(GetDIR)operator(()ident(dir)operator(,) ident(dirp)operator(\);) - ident(errno) operator(=) integer(0)operator(;) - ident(dp) operator(=) ident(readdir)operator(()ident(dirp)operator(->)ident(dir)operator(\);) - reserved(if) operator(()ident(dp)operator(\)) operator({) - reserved(return) ident(rb_tainted_str_new)operator(()ident(dp)operator(->)ident(d_name)operator(,) ident(NAMLEN)operator(()ident(dp)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(errno) operator(==) integer(0)operator(\)) operator({) comment(/* end of stream */) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -comment(/* - * call-seq: - * dir.each { |filename| block } => dir - * - * Calls the block once for each entry in this directory, passing the - * filename of each entry as a parameter to the block. - * - * d = Dir.new("testdir"\) - * d.each {|x| puts "Got #{x}" } - * - * produces: - * - * Got . - * Got .. - * Got config.h - * Got main.rb - */) -directive(static) ident(VALUE) -ident(dir_each)operator(()ident(dir)operator(\)) - ident(VALUE) ident(dir)operator(;) -operator({) - reserved(struct) ident(dir_data) operator(*)ident(dirp)operator(;) - reserved(struct) ident(dirent) operator(*)ident(dp)operator(;) - - ident(GetDIR)operator(()ident(dir)operator(,) ident(dirp)operator(\);) - ident(rewinddir)operator(()ident(dirp)operator(->)ident(dir)operator(\);) - reserved(for) operator(()ident(dp) operator(=) ident(readdir)operator(()ident(dirp)operator(->)ident(dir)operator(\);) ident(dp) operator(!=) pre_constant(NULL)operator(;) ident(dp) operator(=) ident(readdir)operator(()ident(dirp)operator(->)ident(dir)operator(\)\)) operator({) - ident(rb_yield)operator(()ident(rb_tainted_str_new)operator(()ident(dp)operator(->)ident(d_name)operator(,) ident(NAMLEN)operator(()ident(dp)operator(\)\)\);) - reserved(if) operator(()ident(dirp)operator(->)ident(dir) operator(==) pre_constant(NULL)operator(\)) ident(dir_closed)operator((\);) - operator(}) - reserved(return) ident(dir)operator(;) -operator(}) - -comment(/* - * call-seq: - * dir.pos => integer - * dir.tell => integer - * - * Returns the current position in dir. See also - * Dir#seek. - * - * d = Dir.new("testdir"\) - * d.tell #=> 0 - * d.read #=> "." - * d.tell #=> 12 - */) -directive(static) ident(VALUE) -ident(dir_tell)operator(()ident(dir)operator(\)) - ident(VALUE) ident(dir)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_TELLDIR) - reserved(struct) ident(dir_data) operator(*)ident(dirp)operator(;) - pre_type(long) ident(pos)operator(;) - - ident(GetDIR)operator(()ident(dir)operator(,) ident(dirp)operator(\);) - ident(pos) operator(=) ident(telldir)operator(()ident(dirp)operator(->)ident(dir)operator(\);) - reserved(return) ident(rb_int2inum)operator(()ident(pos)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * dir.seek( integer \) => dir - * - * Seeks to a particular location in dir. integer - * must be a value returned by Dir#tell. - * - * d = Dir.new("testdir"\) #=> # - * d.read #=> "." - * i = d.tell #=> 12 - * d.read #=> ".." - * d.seek(i\) #=> # - * d.read #=> ".." - */) -directive(static) ident(VALUE) -ident(dir_seek)operator(()ident(dir)operator(,) ident(pos)operator(\)) - ident(VALUE) ident(dir)operator(,) ident(pos)operator(;) -operator({) - reserved(struct) ident(dir_data) operator(*)ident(dirp)operator(;) - ident(off_t) ident(p) operator(=) ident(NUM2OFFT)operator(()ident(pos)operator(\);) - - ident(GetDIR)operator(()ident(dir)operator(,) ident(dirp)operator(\);) -preprocessor(#ifdef) ident(HAVE_SEEKDIR) - ident(seekdir)operator(()ident(dirp)operator(->)ident(dir)operator(,) ident(p)operator(\);) - reserved(return) ident(dir)operator(;) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * dir.pos( integer \) => integer - * - * Synonym for Dir#seek, but returns the position - * parameter. - * - * d = Dir.new("testdir"\) #=> # - * d.read #=> "." - * i = d.pos #=> 12 - * d.read #=> ".." - * d.pos = i #=> 12 - * d.read #=> ".." - */) -directive(static) ident(VALUE) -ident(dir_set_pos)operator(()ident(dir)operator(,) ident(pos)operator(\)) - ident(VALUE) ident(dir)operator(,) ident(pos)operator(;) -operator({) - ident(dir_seek)operator(()ident(dir)operator(,) ident(pos)operator(\);) - reserved(return) ident(pos)operator(;) -operator(}) - -comment(/* - * call-seq: - * dir.rewind => dir - * - * Repositions dir to the first entry. - * - * d = Dir.new("testdir"\) - * d.read #=> "." - * d.rewind #=> # - * d.read #=> "." - */) -directive(static) ident(VALUE) -ident(dir_rewind)operator(()ident(dir)operator(\)) - ident(VALUE) ident(dir)operator(;) -operator({) - reserved(struct) ident(dir_data) operator(*)ident(dirp)operator(;) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4) operator(&&) operator(!)ident(OBJ_TAINTED)operator(()ident(dir)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - ident(GetDIR)operator(()ident(dir)operator(,) ident(dirp)operator(\);) - ident(rewinddir)operator(()ident(dirp)operator(->)ident(dir)operator(\);) - reserved(return) ident(dir)operator(;) -operator(}) - -comment(/* - * call-seq: - * dir.close => nil - * - * Closes the directory stream. Any further attempts to access - * dir will raise an IOError. - * - * d = Dir.new("testdir"\) - * d.close #=> nil - */) -directive(static) ident(VALUE) -ident(dir_close)operator(()ident(dir)operator(\)) - ident(VALUE) ident(dir)operator(;) -operator({) - reserved(struct) ident(dir_data) operator(*)ident(dirp)operator(;) - - ident(GetDIR)operator(()ident(dir)operator(,) ident(dirp)operator(\);) - ident(closedir)operator(()ident(dirp)operator(->)ident(dir)operator(\);) - ident(dirp)operator(->)ident(dir) operator(=) pre_constant(NULL)operator(;) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) directive(void) -ident(dir_chdir)operator(()ident(path)operator(\)) - ident(VALUE) ident(path)operator(;) -operator({) - reserved(if) operator(()ident(chdir)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\);) -operator(}) - -directive(static) pre_type(int) ident(chdir_blocking) operator(=) integer(0)operator(;) -directive(static) ident(VALUE) ident(chdir_thread) operator(=) ident(Qnil)operator(;) - -reserved(struct) ident(chdir_data) operator({) - ident(VALUE) ident(old_path)operator(,) ident(new_path)operator(;) - pre_type(int) ident(done)operator(;) -operator(};) - -directive(static) ident(VALUE) -ident(chdir_yield)operator(()ident(args)operator(\)) - reserved(struct) ident(chdir_data) operator(*)ident(args)operator(;) -operator({) - ident(dir_chdir)operator(()ident(args)operator(->)ident(new_path)operator(\);) - ident(args)operator(->)ident(done) operator(=) ident(Qtrue)operator(;) - ident(chdir_blocking)operator(++;) - reserved(if) operator(()ident(chdir_thread) operator(==) ident(Qnil)operator(\)) - ident(chdir_thread) operator(=) ident(rb_thread_current)operator((\);) - reserved(return) ident(rb_yield)operator(()ident(args)operator(->)ident(new_path)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(chdir_restore)operator(()ident(args)operator(\)) - reserved(struct) ident(chdir_data) operator(*)ident(args)operator(;) -operator({) - reserved(if) operator(()ident(args)operator(->)ident(done)operator(\)) operator({) - ident(chdir_blocking)operator(--;) - reserved(if) operator(()ident(chdir_blocking) operator(==) integer(0)operator(\)) - ident(chdir_thread) operator(=) ident(Qnil)operator(;) - ident(dir_chdir)operator(()ident(args)operator(->)ident(old_path)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * Dir.chdir( [ string] \) => 0 - * Dir.chdir( [ string] \) {| path | block } => anObject - * - * Changes the current working directory of the process to the given - * string. When called without an argument, changes the directory to - * the value of the environment variable HOME, or - * LOGDIR. SystemCallError (probably - * Errno::ENOENT\) if the target directory does not exist. - * - * If a block is given, it is passed the name of the new current - * directory, and the block is executed with that as the current - * directory. The original working directory is restored when the block - * exits. The return value of chdir is the value of the - * block. chdir blocks can be nested, but in a - * multi-threaded program an error will be raised if a thread attempts - * to open a chdir block while another thread has one - * open. - * - * Dir.chdir("/var/spool/mail"\) - * puts Dir.pwd - * Dir.chdir("/tmp"\) do - * puts Dir.pwd - * Dir.chdir("/usr"\) do - * puts Dir.pwd - * end - * puts Dir.pwd - * end - * puts Dir.pwd - * - * produces: - * - * /var/spool/mail - * /tmp - * /usr - * /tmp - * /var/spool/mail - */) -directive(static) ident(VALUE) -ident(dir_s_chdir)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(path) operator(=) ident(Qnil)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(path)operator(\)) operator(==) integer(1)operator(\)) operator({) - ident(SafeStringValue)operator(()ident(path)operator(\);) - operator(}) - reserved(else) operator({) - directive(const) pre_type(char) operator(*)ident(dist) operator(=) ident(getenv)operator(()stringoperator(\);) - reserved(if) operator((!)ident(dist)operator(\)) operator({) - ident(dist) operator(=) ident(getenv)operator(()stringoperator(\);) - reserved(if) operator((!)ident(dist)operator(\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(path) operator(=) ident(rb_str_new2)operator(()ident(dist)operator(\);) - operator(}) - - reserved(if) operator(()ident(chdir_blocking) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator((!)ident(rb_block_given_p)operator((\)) operator(||) ident(rb_thread_current)operator((\)) operator(!=) ident(chdir_thread)operator(\)) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - reserved(struct) ident(chdir_data) ident(args)operator(;) - pre_type(char) operator(*)ident(cwd) operator(=) ident(my_getcwd)operator((\);) - - ident(args)operator(.)ident(old_path) operator(=) ident(rb_tainted_str_new2)operator(()ident(cwd)operator(\);) ident(free)operator(()ident(cwd)operator(\);) - ident(args)operator(.)ident(new_path) operator(=) ident(path)operator(;) - ident(args)operator(.)ident(done) operator(=) ident(Qfalse)operator(;) - reserved(return) ident(rb_ensure)operator(()ident(chdir_yield)operator(,) operator(()ident(VALUE)operator(\)&)ident(args)operator(,) ident(chdir_restore)operator(,) operator(()ident(VALUE)operator(\)&)ident(args)operator(\);) - operator(}) - ident(dir_chdir)operator(()ident(path)operator(\);) - - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Dir.getwd => string - * Dir.pwd => string - * - * Returns the path to the current working directory of this process as - * a string. - * - * Dir.chdir("/tmp"\) #=> 0 - * Dir.getwd #=> "/tmp" - */) -directive(static) ident(VALUE) -ident(dir_s_getwd)operator(()ident(dir)operator(\)) - ident(VALUE) ident(dir)operator(;) -operator({) - pre_type(char) operator(*)ident(path)operator(;) - ident(VALUE) ident(cwd)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - ident(path) operator(=) ident(my_getcwd)operator((\);) - ident(cwd) operator(=) ident(rb_tainted_str_new2)operator(()ident(path)operator(\);) - - ident(free)operator(()ident(path)operator(\);) - reserved(return) ident(cwd)operator(;) -operator(}) - -directive(static) directive(void) ident(check_dirname) ident(_)operator((()directive(volatile) ident(VALUE) operator(*\)\);) -directive(static) directive(void) -ident(check_dirname)operator(()ident(dir)operator(\)) - directive(volatile) ident(VALUE) operator(*)ident(dir)operator(;) -operator({) - pre_type(char) operator(*)ident(path)operator(,) operator(*)ident(pend)operator(;) - - ident(SafeStringValue)operator((*)ident(dir)operator(\);) - ident(rb_secure)operator(()integer(2)operator(\);) - ident(path) operator(=) ident(RSTRING)operator((*)ident(dir)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(path) operator(&&) operator(*()ident(pend) operator(=) ident(rb_path_end)operator(()ident(rb_path_skip_prefix)operator(()ident(path)operator(\)\)\)\)) operator({) - operator(*)ident(dir) operator(=) ident(rb_str_new)operator(()ident(path)operator(,) ident(pend) operator(-) ident(path)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * Dir.chroot( string \) => 0 - * - * Changes this process's idea of the file system root. Only a - * privileged process may make this call. Not available on all - * platforms. On Unix systems, see chroot(2\) for more - * information. - */) -directive(static) ident(VALUE) -ident(dir_s_chroot)operator(()ident(dir)operator(,) ident(path)operator(\)) - ident(VALUE) ident(dir)operator(,) ident(path)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_CHROOT)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - ident(check_dirname)operator((&)ident(path)operator(\);) - - reserved(if) operator(()ident(chroot)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\)) operator(==) operator(-)integer(1)operator(\)) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\);) - - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * Dir.mkdir( string [, integer] \) => 0 - * - * Makes a new directory named by string, with permissions - * specified by the optional parameter anInteger. The - * permissions may be modified by the value of - * File::umask, and are ignored on NT. Raises a - * SystemCallError if the directory cannot be created. See - * also the discussion of permissions in the class documentation for - * File. - * - */) -directive(static) ident(VALUE) -ident(dir_s_mkdir)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(path)operator(,) ident(vmode)operator(;) - pre_type(int) ident(mode)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(path)operator(,) operator(&)ident(vmode)operator(\)) operator(==) integer(2)operator(\)) operator({) - ident(mode) operator(=) ident(NUM2INT)operator(()ident(vmode)operator(\);) - operator(}) - reserved(else) operator({) - ident(mode) operator(=) oct(0777)operator(;) - operator(}) - - ident(check_dirname)operator((&)ident(path)operator(\);) - reserved(if) operator(()ident(mkdir)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(,) ident(mode)operator(\)) operator(==) operator(-)integer(1)operator(\)) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\);) - - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Dir.delete( string \) => 0 - * Dir.rmdir( string \) => 0 - * Dir.unlink( string \) => 0 - * - * Deletes the named directory. Raises a subclass of - * SystemCallError if the directory isn't empty. - */) -directive(static) ident(VALUE) -ident(dir_s_rmdir)operator(()ident(obj)operator(,) ident(dir)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(dir)operator(;) -operator({) - ident(check_dirname)operator((&)ident(dir)operator(\);) - reserved(if) operator(()ident(rmdir)operator(()ident(RSTRING)operator(()ident(dir)operator(\)->)ident(ptr)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(dir)operator(\)->)ident(ptr)operator(\);) - - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -directive(static) directive(void) -ident(sys_warning_1)operator(()ident(mesg)operator(\)) - directive(const) pre_type(char)operator(*) ident(mesg)operator(;) -operator({) - ident(rb_sys_warning)operator(()stringoperator(,) ident(mesg)operator(\);) -operator(}) - -preprocessor(#define) ident(GLOB_VERBOSE) operator(()integer(1)ident(UL) operator(<<) operator(()reserved(sizeof)operator(()pre_type(int)operator(\)) operator(*) ident(CHAR_BIT) operator(-) integer(1)operator(\)\)) -preprocessor(#define) ident(sys_warning)operator(()ident(val)operator(\)) \ - operator(()directive(void)operator(\)(()ident(flags) operator(&) ident(GLOB_VERBOSE)operator(\)) operator(&&) ident(rb_protect)operator((()ident(VALUE) operator((*\))ident(_)operator((()ident(VALUE)operator(\)\)\))ident(sys_warning_1)operator(,) operator(()ident(VALUE)operator(\)()ident(val)operator(\),) integer(0)operator(\)\)) - -preprocessor(#define) ident(GLOB_ALLOC)operator(()ident(type)operator(\)) operator(()ident(type) operator(*\))ident(malloc)operator(()reserved(sizeof)operator(()ident(type)operator(\)\)) -preprocessor(#define) ident(GLOB_ALLOC_N)operator(()ident(type)operator(,) ident(n)operator(\)) operator(()ident(type) operator(*\))ident(malloc)operator(()reserved(sizeof)operator(()ident(type)operator(\)) operator(*) operator(()ident(n)operator(\)\)) -preprocessor(#define) ident(GLOB_JUMP_TAG)operator(()ident(status)operator(\)) operator((()ident(status) operator(==) operator(-)integer(1)operator(\)) operator(?) ident(rb_memerror)operator((\)) operator(:) ident(rb_jump_tag)operator(()ident(status)operator(\)\)) - -comment(/* - * ENOTDIR can be returned by stat(2\) if a non-leaf element of the path - * is not a directory. - */) -preprocessor(#define) ident(to_be_ignored)operator(()ident(e)operator(\)) operator((()ident(e)operator(\)) operator(==) ident(ENOENT) operator(||) operator(()ident(e)operator(\)) operator(==) ident(ENOTDIR)operator(\)) - -comment(/* System call with warning */) -directive(static) pre_type(int) -ident(do_stat)operator(()directive(const) pre_type(char) operator(*)ident(path)operator(,) reserved(struct) ident(stat) operator(*)ident(pst)operator(,) pre_type(int) ident(flags)operator(\)) - -operator({) - pre_type(int) ident(ret) operator(=) ident(stat)operator(()ident(path)operator(,) ident(pst)operator(\);) - reserved(if) operator(()ident(ret) operator(<) integer(0) operator(&&) operator(!)ident(to_be_ignored)operator(()ident(errno)operator(\)\)) - ident(sys_warning)operator(()ident(path)operator(\);) - - reserved(return) ident(ret)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(do_lstat)operator(()directive(const) pre_type(char) operator(*)ident(path)operator(,) reserved(struct) ident(stat) operator(*)ident(pst)operator(,) pre_type(int) ident(flags)operator(\)) -operator({) - pre_type(int) ident(ret) operator(=) ident(lstat)operator(()ident(path)operator(,) ident(pst)operator(\);) - reserved(if) operator(()ident(ret) operator(<) integer(0) operator(&&) operator(!)ident(to_be_ignored)operator(()ident(errno)operator(\)\)) - ident(sys_warning)operator(()ident(path)operator(\);) - - reserved(return) ident(ret)operator(;) -operator(}) - -directive(static) ident(DIR) operator(*) -ident(do_opendir)operator(()directive(const) pre_type(char) operator(*)ident(path)operator(,) pre_type(int) ident(flags)operator(\)) -operator({) - ident(DIR) operator(*)ident(dirp) operator(=) ident(opendir)operator(()ident(path)operator(\);) - reserved(if) operator(()ident(dirp) operator(==) pre_constant(NULL) operator(&&) operator(!)ident(to_be_ignored)operator(()ident(errno)operator(\)\)) - ident(sys_warning)operator(()ident(path)operator(\);) - - reserved(return) ident(dirp)operator(;) -operator(}) - -comment(/* Return nonzero if S has any special globbing chars in it. */) -directive(static) pre_type(int) -ident(has_magic)operator(()ident(s)operator(,) ident(flags)operator(\)) - directive(const) pre_type(char) operator(*)ident(s)operator(;) - pre_type(int) ident(flags)operator(;) -operator({) - directive(const) pre_type(int) ident(escape) operator(=) operator(!()ident(flags) operator(&) ident(FNM_NOESCAPE)operator(\);) - directive(const) pre_type(int) ident(nocase) operator(=) ident(flags) operator(&) ident(FNM_CASEFOLD)operator(;) - - directive(register) directive(const) pre_type(char) operator(*)ident(p) operator(=) ident(s)operator(;) - directive(register) pre_type(char) ident(c)operator(;) - - reserved(while) operator(()ident(c) operator(=) operator(*)ident(p)operator(++\)) operator({) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('*')operator(:) - reserved(case) char('?')operator(:) - reserved(case) char('[')operator(:) - reserved(return) integer(1)operator(;) - - reserved(case) char('\\\\')operator(:) - reserved(if) operator(()ident(escape) operator(&&) operator(!()ident(c) operator(=) operator(*)ident(p)operator(++\)\)) - reserved(return) integer(0)operator(;) - reserved(continue)operator(;) - - reserved(default)operator(:) - reserved(if) operator((!)ident(FNM_SYSCASE) operator(&&) ident(ISALPHA)operator(()ident(c)operator(\)) operator(&&) ident(nocase)operator(\)) - reserved(return) integer(1)operator(;) - operator(}) - - ident(p) operator(=) ident(Next)operator(()ident(p)operator(-)integer(1)operator(\);) - operator(}) - - reserved(return) integer(0)operator(;) -operator(}) - -comment(/* Find separator in globbing pattern. */) -directive(static) pre_type(char) operator(*) -ident(find_dirsep)operator(()directive(const) pre_type(char) operator(*)ident(s)operator(,) pre_type(int) ident(flags)operator(\)) -operator({) - directive(const) pre_type(int) ident(escape) operator(=) operator(!()ident(flags) operator(&) ident(FNM_NOESCAPE)operator(\);) - - directive(register) directive(const) pre_type(char) operator(*)ident(p) operator(=) ident(s)operator(;) - directive(register) pre_type(char) ident(c)operator(;) - pre_type(int) ident(open) operator(=) integer(0)operator(;) - - reserved(while) operator(()ident(c) operator(=) operator(*)ident(p)operator(++\)) operator({) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('[')operator(:) - ident(open) operator(=) integer(1)operator(;) - reserved(continue)operator(;) - reserved(case) char(']')operator(:) - ident(open) operator(=) integer(0)operator(;) - reserved(continue)operator(;) - - reserved(case) char('/')operator(:) - reserved(if) operator((!)ident(open)operator(\)) - reserved(return) operator(()pre_type(char) operator(*\))ident(p)operator(-)integer(1)operator(;) - reserved(continue)operator(;) - - reserved(case) char('\\\\')operator(:) - reserved(if) operator(()ident(escape) operator(&&) operator(!()ident(c) operator(=) operator(*)ident(p)operator(++\)\)) - reserved(return) operator(()pre_type(char) operator(*\))ident(p)operator(-)integer(1)operator(;) - reserved(continue)operator(;) - operator(}) - - ident(p) operator(=) ident(Next)operator(()ident(p)operator(-)integer(1)operator(\);) - operator(}) - - reserved(return) operator(()pre_type(char) operator(*\))ident(p)operator(-)integer(1)operator(;) -operator(}) - -comment(/* Remove escaping backslashes */) -directive(static) directive(void) -ident(remove_backslashes)operator(()ident(p)operator(\)) - pre_type(char) operator(*)ident(p)operator(;) -operator({) - pre_type(char) operator(*)ident(t) operator(=) ident(p)operator(;) - pre_type(char) operator(*)ident(s) operator(=) ident(p)operator(;) - - reserved(while) operator((*)ident(p)operator(\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('\\\\')operator(\)) operator({) - reserved(if) operator(()ident(t) operator(!=) ident(s)operator(\)) - ident(memmove)operator(()ident(t)operator(,) ident(s)operator(,) ident(p) operator(-) ident(s)operator(\);) - ident(t) operator(+=) ident(p) operator(-) ident(s)operator(;) - ident(s) operator(=) operator(++)ident(p)operator(;) - reserved(if) operator((!*)ident(p)operator(\)) reserved(break)operator(;) - operator(}) - ident(Inc)operator(()ident(p)operator(\);) - operator(}) - - reserved(while) operator((*)ident(p)operator(++\);) - - reserved(if) operator(()ident(t) operator(!=) ident(s)operator(\)) - ident(memmove)operator(()ident(t)operator(,) ident(s)operator(,) ident(p) operator(-) ident(s)operator(\);) comment(/* move '\\0' too */) -operator(}) - -comment(/* Globing pattern */) -reserved(enum) ident(glob_pattern_type) operator({) ident(PLAIN)operator(,) ident(MAGICAL)operator(,) ident(RECURSIVE)operator(,) ident(MATCH_ALL)operator(,) ident(MATCH_DIR) operator(};) - -reserved(struct) ident(glob_pattern) operator({) - pre_type(char) operator(*)ident(str)operator(;) - reserved(enum) ident(glob_pattern_type) ident(type)operator(;) - reserved(struct) ident(glob_pattern) operator(*)ident(next)operator(;) -operator(};) - -directive(static) directive(void) ident(glob_free_pattern)operator(()reserved(struct) ident(glob_pattern) operator(*)ident(list)operator(\);) - -directive(static) reserved(struct) ident(glob_pattern) operator(*) -ident(glob_make_pattern)operator(()directive(const) pre_type(char) operator(*)ident(p)operator(,) pre_type(int) ident(flags)operator(\)) -operator({) - reserved(struct) ident(glob_pattern) operator(*)ident(list)operator(,) operator(*)ident(tmp)operator(,) operator(**)ident(tail) operator(=) operator(&)ident(list)operator(;) - pre_type(int) ident(dirsep) operator(=) integer(0)operator(;) comment(/* pattern is terminated with '/' */) - - reserved(while) operator((*)ident(p)operator(\)) operator({) - ident(tmp) operator(=) ident(GLOB_ALLOC)operator(()reserved(struct) ident(glob_pattern)operator(\);) - reserved(if) operator((!)ident(tmp)operator(\)) reserved(goto) ident(error)operator(;) - reserved(if) operator(()ident(p)operator([)integer(0)operator(]) operator(==) char('*') operator(&&) ident(p)operator([)integer(1)operator(]) operator(==) char('*') operator(&&) ident(p)operator([)integer(2)operator(]) operator(==) char('/')operator(\)) operator({) - comment(/* fold continuous RECURSIVEs (needed in glob_helper\) */) - reserved(do) operator({) ident(p) operator(+=) integer(3)operator(;) operator(}) reserved(while) operator(()ident(p)operator([)integer(0)operator(]) operator(==) char('*') operator(&&) ident(p)operator([)integer(1)operator(]) operator(==) char('*') operator(&&) ident(p)operator([)integer(2)operator(]) operator(==) char('/')operator(\);) - ident(tmp)operator(->)ident(type) operator(=) ident(RECURSIVE)operator(;) - ident(tmp)operator(->)ident(str) operator(=) integer(0)operator(;) - ident(dirsep) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) - directive(const) pre_type(char) operator(*)ident(m) operator(=) ident(find_dirsep)operator(()ident(p)operator(,) ident(flags)operator(\);) - pre_type(char) operator(*)ident(buf) operator(=) ident(GLOB_ALLOC_N)operator(()pre_type(char)operator(,) ident(m)operator(-)ident(p)operator(+)integer(1)operator(\);) - reserved(if) operator((!)ident(buf)operator(\)) operator({) - ident(free)operator(()ident(tmp)operator(\);) - reserved(goto) ident(error)operator(;) - operator(}) - ident(memcpy)operator(()ident(buf)operator(,) ident(p)operator(,) ident(m)operator(-)ident(p)operator(\);) - ident(buf)operator([)ident(m)operator(-)ident(p)operator(]) operator(=) char('\\0')operator(;) - ident(tmp)operator(->)ident(type) operator(=) ident(has_magic)operator(()ident(buf)operator(,) ident(flags)operator(\)) operator(?) ident(MAGICAL) operator(:) ident(PLAIN)operator(;) - ident(tmp)operator(->)ident(str) operator(=) ident(buf)operator(;) - reserved(if) operator((*)ident(m)operator(\)) operator({) - ident(dirsep) operator(=) integer(1)operator(;) - ident(p) operator(=) ident(m) operator(+) integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(dirsep) operator(=) integer(0)operator(;) - ident(p) operator(=) ident(m)operator(;) - operator(}) - operator(}) - operator(*)ident(tail) operator(=) ident(tmp)operator(;) - ident(tail) operator(=) operator(&)ident(tmp)operator(->)ident(next)operator(;) - operator(}) - - ident(tmp) operator(=) ident(GLOB_ALLOC)operator(()reserved(struct) ident(glob_pattern)operator(\);) - reserved(if) operator((!)ident(tmp)operator(\)) operator({) - label(error:) - operator(*)ident(tail) operator(=) integer(0)operator(;) - ident(glob_free_pattern)operator(()ident(list)operator(\);) - reserved(return) integer(0)operator(;) - operator(}) - ident(tmp)operator(->)ident(type) operator(=) ident(dirsep) operator(?) ident(MATCH_DIR) operator(:) ident(MATCH_ALL)operator(;) - ident(tmp)operator(->)ident(str) operator(=) integer(0)operator(;) - operator(*)ident(tail) operator(=) ident(tmp)operator(;) - ident(tmp)operator(->)ident(next) operator(=) integer(0)operator(;) - - reserved(return) ident(list)operator(;) -operator(}) - -directive(static) directive(void) -ident(glob_free_pattern)operator(()reserved(struct) ident(glob_pattern) operator(*)ident(list)operator(\)) -operator({) - reserved(while) operator(()ident(list)operator(\)) operator({) - reserved(struct) ident(glob_pattern) operator(*)ident(tmp) operator(=) ident(list)operator(;) - ident(list) operator(=) ident(list)operator(->)ident(next)operator(;) - reserved(if) operator(()ident(tmp)operator(->)ident(str)operator(\)) - ident(free)operator(()ident(tmp)operator(->)ident(str)operator(\);) - ident(free)operator(()ident(tmp)operator(\);) - operator(}) -operator(}) - -directive(static) pre_type(char) operator(*) -ident(join_path)operator(()directive(const) pre_type(char) operator(*)ident(path)operator(,) pre_type(int) ident(dirsep)operator(,) directive(const) pre_type(char) operator(*)ident(name)operator(\)) -operator({) - pre_type(long) ident(len) operator(=) ident(strlen)operator(()ident(path)operator(\);) - pre_type(char) operator(*)ident(buf) operator(=) ident(GLOB_ALLOC_N)operator(()pre_type(char)operator(,) ident(len)operator(+)ident(strlen)operator(()ident(name)operator(\)+()ident(dirsep)operator(?)integer(1)operator(:)integer(0)operator(\)+)integer(1)operator(\);) - - reserved(if) operator((!)ident(buf)operator(\)) reserved(return) integer(0)operator(;) - ident(memcpy)operator(()ident(buf)operator(,) ident(path)operator(,) ident(len)operator(\);) - reserved(if) operator(()ident(dirsep)operator(\)) operator({) - ident(strcpy)operator(()ident(buf)operator(+)ident(len)operator(,) stringoperator(\);) - ident(len)operator(++;) - operator(}) - ident(strcpy)operator(()ident(buf)operator(+)ident(len)operator(,) ident(name)operator(\);) - reserved(return) ident(buf)operator(;) -operator(}) - -reserved(enum) ident(answer) operator({) ident(YES)operator(,) ident(NO)operator(,) ident(UNKNOWN) operator(};) - -preprocessor(#ifndef) ident(S_ISLNK) -preprocessor(# ifndef) ident(S_IFLNK) -preprocessor(# define) ident(S_ISLNK)operator(()ident(m)operator(\)) operator(()integer(0)operator(\)) -preprocessor(# else) -preprocessor(# define) ident(S_ISLNK)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFLNK)operator(\)) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#ifndef) ident(S_ISDIR) -preprocessor(# define) ident(S_ISDIR)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFDIR)operator(\)) -preprocessor(#endif) - -reserved(struct) ident(glob_args) operator({) - directive(void) operator((*)ident(func)operator(\)) ident(_)operator((()directive(const) pre_type(char)operator(*,) ident(VALUE)operator(\)\);) - directive(const) pre_type(char) operator(*)ident(c)operator(;) - ident(VALUE) ident(v)operator(;) -operator(};) - -directive(static) ident(VALUE) ident(glob_func_caller) ident(_)operator((()ident(VALUE)operator(\)\);) - -directive(static) ident(VALUE) -ident(glob_func_caller)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(struct) ident(glob_args) operator(*)ident(args) operator(=) operator(()reserved(struct) ident(glob_args) operator(*\))ident(val)operator(;) - - operator((*)ident(args)operator(->)ident(func)operator(\)()ident(args)operator(->)ident(c)operator(,) ident(args)operator(->)ident(v)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -preprocessor(#define) ident(glob_call_func)operator(()ident(func)operator(,) ident(path)operator(,) ident(arg)operator(\)) operator((*)ident(func)operator(\)()ident(path)operator(,) ident(arg)operator(\)) - -directive(static) pre_type(int) ident(glob_helper) ident(_)operator((()directive(const) pre_type(char) operator(*,) pre_type(int)operator(,) reserved(enum) ident(answer)operator(,) reserved(enum) ident(answer)operator(,) reserved(struct) ident(glob_pattern) operator(**,) reserved(struct) ident(glob_pattern) operator(**,) pre_type(int)operator(,) ident(ruby_glob_func) operator(*,) ident(VALUE)operator(\)\);) - -directive(static) pre_type(int) -ident(glob_helper)operator(()ident(path)operator(,) ident(dirsep)operator(,) ident(exist)operator(,) ident(isdir)operator(,) ident(beg)operator(,) ident(end)operator(,) ident(flags)operator(,) ident(func)operator(,) ident(arg)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - pre_type(int) ident(dirsep)operator(;) comment(/* '/' should be placed before appending child entry's name to 'path'. */) - reserved(enum) ident(answer) ident(exist)operator(;) comment(/* Does 'path' indicate an existing entry? */) - reserved(enum) ident(answer) ident(isdir)operator(;) comment(/* Does 'path' indicate a directory or a symlink to a directory? */) - reserved(struct) ident(glob_pattern) operator(**)ident(beg)operator(;) - reserved(struct) ident(glob_pattern) operator(**)ident(end)operator(;) - pre_type(int) ident(flags)operator(;) - ident(ruby_glob_func) operator(*)ident(func)operator(;) - ident(VALUE) ident(arg)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - pre_type(int) ident(status) operator(=) integer(0)operator(;) - reserved(struct) ident(glob_pattern) operator(**)ident(cur)operator(,) operator(**)ident(new_beg)operator(,) operator(**)ident(new_end)operator(;) - pre_type(int) ident(plain) operator(=) integer(0)operator(,) ident(magical) operator(=) integer(0)operator(,) ident(recursive) operator(=) integer(0)operator(,) ident(match_all) operator(=) integer(0)operator(,) ident(match_dir) operator(=) integer(0)operator(;) - pre_type(int) ident(escape) operator(=) operator(!()ident(flags) operator(&) ident(FNM_NOESCAPE)operator(\);) - - reserved(for) operator(()ident(cur) operator(=) ident(beg)operator(;) ident(cur) operator(<) ident(end)operator(;) operator(++)ident(cur)operator(\)) operator({) - reserved(struct) ident(glob_pattern) operator(*)ident(p) operator(=) operator(*)ident(cur)operator(;) - reserved(if) operator(()ident(p)operator(->)ident(type) operator(==) ident(RECURSIVE)operator(\)) operator({) - ident(recursive) operator(=) integer(1)operator(;) - ident(p) operator(=) ident(p)operator(->)ident(next)operator(;) - operator(}) - reserved(switch) operator(()ident(p)operator(->)ident(type)operator(\)) operator({) - reserved(case) ident(PLAIN)operator(:) - ident(plain) operator(=) integer(1)operator(;) - reserved(break)operator(;) - reserved(case) ident(MAGICAL)operator(:) - ident(magical) operator(=) integer(1)operator(;) - reserved(break)operator(;) - reserved(case) ident(MATCH_ALL)operator(:) - ident(match_all) operator(=) integer(1)operator(;) - reserved(break)operator(;) - reserved(case) ident(MATCH_DIR)operator(:) - ident(match_dir) operator(=) integer(1)operator(;) - reserved(break)operator(;) - reserved(case) ident(RECURSIVE)operator(:) - ident(rb_bug)operator(()stringoperator(\);) - operator(}) - operator(}) - - reserved(if) operator((*)ident(path)operator(\)) operator({) - reserved(if) operator(()ident(match_all) operator(&&) ident(exist) operator(==) ident(UNKNOWN)operator(\)) operator({) - reserved(if) operator(()ident(do_lstat)operator(()ident(path)operator(,) operator(&)ident(st)operator(,) ident(flags)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(exist) operator(=) ident(YES)operator(;) - ident(isdir) operator(=) ident(S_ISDIR)operator(()ident(st)operator(.)ident(st_mode)operator(\)) operator(?) ident(YES) operator(:) ident(S_ISLNK)operator(()ident(st)operator(.)ident(st_mode)operator(\)) operator(?) ident(UNKNOWN) operator(:) ident(NO)operator(;) - operator(}) - reserved(else) operator({) - ident(exist) operator(=) ident(NO)operator(;) - ident(isdir) operator(=) ident(NO)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(match_dir) operator(&&) ident(isdir) operator(==) ident(UNKNOWN)operator(\)) operator({) - reserved(if) operator(()ident(do_stat)operator(()ident(path)operator(,) operator(&)ident(st)operator(,) ident(flags)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(exist) operator(=) ident(YES)operator(;) - ident(isdir) operator(=) ident(S_ISDIR)operator(()ident(st)operator(.)ident(st_mode)operator(\)) operator(?) ident(YES) operator(:) ident(NO)operator(;) - operator(}) - reserved(else) operator({) - ident(exist) operator(=) ident(NO)operator(;) - ident(isdir) operator(=) ident(NO)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(match_all) operator(&&) ident(exist) operator(==) ident(YES)operator(\)) operator({) - ident(status) operator(=) ident(glob_call_func)operator(()ident(func)operator(,) ident(path)operator(,) ident(arg)operator(\);) - reserved(if) operator(()ident(status)operator(\)) reserved(return) ident(status)operator(;) - operator(}) - reserved(if) operator(()ident(match_dir) operator(&&) ident(isdir) operator(==) ident(YES)operator(\)) operator({) - pre_type(char) operator(*)ident(tmp) operator(=) ident(join_path)operator(()ident(path)operator(,) ident(dirsep)operator(,) stringoperator(\);) - reserved(if) operator((!)ident(tmp)operator(\)) reserved(return) operator(-)integer(1)operator(;) - ident(status) operator(=) ident(glob_call_func)operator(()ident(func)operator(,) ident(tmp)operator(,) ident(arg)operator(\);) - ident(free)operator(()ident(tmp)operator(\);) - reserved(if) operator(()ident(status)operator(\)) reserved(return) ident(status)operator(;) - operator(}) - operator(}) - - reserved(if) operator(()ident(exist) operator(==) ident(NO) operator(||) ident(isdir) operator(==) ident(NO)operator(\)) reserved(return) integer(0)operator(;) - - reserved(if) operator(()ident(magical) operator(||) ident(recursive)operator(\)) operator({) - reserved(struct) ident(dirent) operator(*)ident(dp)operator(;) - ident(DIR) operator(*)ident(dirp) operator(=) ident(do_opendir)operator((*)ident(path) operator(?) ident(path) operator(:) stringoperator(,) ident(flags)operator(\);) - reserved(if) operator(()ident(dirp) operator(==) pre_constant(NULL)operator(\)) reserved(return) integer(0)operator(;) - - reserved(for) operator(()ident(dp) operator(=) ident(readdir)operator(()ident(dirp)operator(\);) ident(dp) operator(!=) pre_constant(NULL)operator(;) ident(dp) operator(=) ident(readdir)operator(()ident(dirp)operator(\)\)) operator({) - pre_type(char) operator(*)ident(buf) operator(=) ident(join_path)operator(()ident(path)operator(,) ident(dirsep)operator(,) ident(dp)operator(->)ident(d_name)operator(\);) - reserved(enum) ident(answer) ident(new_isdir) operator(=) ident(UNKNOWN)operator(;) - - reserved(if) operator((!)ident(buf)operator(\)) operator({) - ident(status) operator(=) operator(-)integer(1)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(recursive) operator(&&) ident(strcmp)operator(()ident(dp)operator(->)ident(d_name)operator(,) stringoperator(\)) operator(!=) integer(0) operator(&&) ident(strcmp)operator(()ident(dp)operator(->)ident(d_name)operator(,) stringoperator(\)) operator(!=) integer(0) - operator(&&) ident(fnmatch)operator(()stringoperator(,) ident(dp)operator(->)ident(d_name)operator(,) ident(flags)operator(\)) operator(==) integer(0)operator(\)) operator({) -preprocessor(#ifndef) ident(_WIN32) - reserved(if) operator(()ident(do_lstat)operator(()ident(buf)operator(,) operator(&)ident(st)operator(,) ident(flags)operator(\)) operator(==) integer(0)operator(\)) - ident(new_isdir) operator(=) ident(S_ISDIR)operator(()ident(st)operator(.)ident(st_mode)operator(\)) operator(?) ident(YES) operator(:) ident(S_ISLNK)operator(()ident(st)operator(.)ident(st_mode)operator(\)) operator(?) ident(UNKNOWN) operator(:) ident(NO)operator(;) - reserved(else) - ident(new_isdir) operator(=) ident(NO)operator(;) -preprocessor(#else) - ident(new_isdir) operator(=) ident(dp)operator(->)ident(d_isdir) operator(?) operator((!)ident(dp)operator(->)ident(d_isrep) operator(?) ident(YES) operator(:) ident(UNKNOWN)operator(\)) operator(:) ident(NO)operator(;) -preprocessor(#endif) - operator(}) - - ident(new_beg) operator(=) ident(new_end) operator(=) ident(GLOB_ALLOC_N)operator(()reserved(struct) ident(glob_pattern) operator(*,) operator(()ident(end) operator(-) ident(beg)operator(\)) operator(*) integer(2)operator(\);) - reserved(if) operator((!)ident(new_beg)operator(\)) operator({) - ident(status) operator(=) operator(-)integer(1)operator(;) - reserved(break)operator(;) - operator(}) - - reserved(for) operator(()ident(cur) operator(=) ident(beg)operator(;) ident(cur) operator(<) ident(end)operator(;) operator(++)ident(cur)operator(\)) operator({) - reserved(struct) ident(glob_pattern) operator(*)ident(p) operator(=) operator(*)ident(cur)operator(;) - reserved(if) operator(()ident(p)operator(->)ident(type) operator(==) ident(RECURSIVE)operator(\)) operator({) - reserved(if) operator(()ident(new_isdir) operator(==) ident(YES)operator(\)) comment(/* not symlink but real directory */) - operator(*)ident(new_end)operator(++) operator(=) ident(p)operator(;) comment(/* append recursive pattern */) - ident(p) operator(=) ident(p)operator(->)ident(next)operator(;) comment(/* 0 times recursion */) - operator(}) - reserved(if) operator(()ident(p)operator(->)ident(type) operator(==) ident(PLAIN) operator(||) ident(p)operator(->)ident(type) operator(==) ident(MAGICAL)operator(\)) operator({) - reserved(if) operator(()ident(fnmatch)operator(()ident(p)operator(->)ident(str)operator(,) ident(dp)operator(->)ident(d_name)operator(,) ident(flags)operator(\)) operator(==) integer(0)operator(\)) - operator(*)ident(new_end)operator(++) operator(=) ident(p)operator(->)ident(next)operator(;) - operator(}) - operator(}) - - ident(status) operator(=) ident(glob_helper)operator(()ident(buf)operator(,) integer(1)operator(,) ident(YES)operator(,) ident(new_isdir)operator(,) ident(new_beg)operator(,) ident(new_end)operator(,) ident(flags)operator(,) ident(func)operator(,) ident(arg)operator(\);) - ident(free)operator(()ident(buf)operator(\);) - ident(free)operator(()ident(new_beg)operator(\);) - reserved(if) operator(()ident(status)operator(\)) reserved(break)operator(;) - operator(}) - - ident(closedir)operator(()ident(dirp)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(plain)operator(\)) operator({) - reserved(struct) ident(glob_pattern) operator(**)ident(copy_beg)operator(,) operator(**)ident(copy_end)operator(,) operator(**)ident(cur2)operator(;) - - ident(copy_beg) operator(=) ident(copy_end) operator(=) ident(GLOB_ALLOC_N)operator(()reserved(struct) ident(glob_pattern) operator(*,) ident(end) operator(-) ident(beg)operator(\);) - reserved(if) operator((!)ident(copy_beg)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(for) operator(()ident(cur) operator(=) ident(beg)operator(;) ident(cur) operator(<) ident(end)operator(;) operator(++)ident(cur)operator(\)) - operator(*)ident(copy_end)operator(++) operator(=) operator((*)ident(cur)operator(\)->)ident(type) operator(==) ident(PLAIN) operator(?) operator(*)ident(cur) operator(:) integer(0)operator(;) - - reserved(for) operator(()ident(cur) operator(=) ident(copy_beg)operator(;) ident(cur) operator(<) ident(copy_end)operator(;) operator(++)ident(cur)operator(\)) operator({) - reserved(if) operator((*)ident(cur)operator(\)) operator({) - pre_type(char) operator(*)ident(buf)operator(;) - pre_type(char) operator(*)ident(name)operator(;) - ident(name) operator(=) ident(GLOB_ALLOC_N)operator(()pre_type(char)operator(,) ident(strlen)operator(((*)ident(cur)operator(\)->)ident(str)operator(\)) operator(+) integer(1)operator(\);) - reserved(if) operator((!)ident(name)operator(\)) operator({) - ident(status) operator(=) operator(-)integer(1)operator(;) - reserved(break)operator(;) - operator(}) - ident(strcpy)operator(()ident(name)operator(,) operator((*)ident(cur)operator(\)->)ident(str)operator(\);) - reserved(if) operator(()ident(escape)operator(\)) ident(remove_backslashes)operator(()ident(name)operator(\);) - - ident(new_beg) operator(=) ident(new_end) operator(=) ident(GLOB_ALLOC_N)operator(()reserved(struct) ident(glob_pattern) operator(*,) ident(end) operator(-) ident(beg)operator(\);) - reserved(if) operator((!)ident(new_beg)operator(\)) operator({) - ident(free)operator(()ident(name)operator(\);) - ident(status) operator(=) operator(-)integer(1)operator(;) - reserved(break)operator(;) - operator(}) - operator(*)ident(new_end)operator(++) operator(=) operator((*)ident(cur)operator(\)->)ident(next)operator(;) - reserved(for) operator(()ident(cur2) operator(=) ident(cur) operator(+) integer(1)operator(;) ident(cur2) operator(<) ident(copy_end)operator(;) operator(++)ident(cur2)operator(\)) operator({) - reserved(if) operator((*)ident(cur2) operator(&&) ident(fnmatch)operator(((*)ident(cur2)operator(\)->)ident(str)operator(,) ident(name)operator(,) ident(flags)operator(\)) operator(==) integer(0)operator(\)) operator({) - operator(*)ident(new_end)operator(++) operator(=) operator((*)ident(cur2)operator(\)->)ident(next)operator(;) - operator(*)ident(cur2) operator(=) integer(0)operator(;) - operator(}) - operator(}) - - ident(buf) operator(=) ident(join_path)operator(()ident(path)operator(,) ident(dirsep)operator(,) ident(name)operator(\);) - ident(free)operator(()ident(name)operator(\);) - reserved(if) operator((!)ident(buf)operator(\)) operator({) - ident(free)operator(()ident(new_beg)operator(\);) - ident(status) operator(=) operator(-)integer(1)operator(;) - reserved(break)operator(;) - operator(}) - ident(status) operator(=) ident(glob_helper)operator(()ident(buf)operator(,) integer(1)operator(,) ident(UNKNOWN)operator(,) ident(UNKNOWN)operator(,) ident(new_beg)operator(,) ident(new_end)operator(,) ident(flags)operator(,) ident(func)operator(,) ident(arg)operator(\);) - ident(free)operator(()ident(buf)operator(\);) - ident(free)operator(()ident(new_beg)operator(\);) - reserved(if) operator(()ident(status)operator(\)) reserved(break)operator(;) - operator(}) - operator(}) - - ident(free)operator(()ident(copy_beg)operator(\);) - operator(}) - - reserved(return) ident(status)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(ruby_glob0)operator(()ident(path)operator(,) ident(flags)operator(,) ident(func)operator(,) ident(arg)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - pre_type(int) ident(flags)operator(;) - ident(ruby_glob_func) operator(*)ident(func)operator(;) - ident(VALUE) ident(arg)operator(;) -operator({) - reserved(struct) ident(glob_pattern) operator(*)ident(list)operator(;) - directive(const) pre_type(char) operator(*)ident(root)operator(,) operator(*)ident(start)operator(;) - pre_type(char) operator(*)ident(buf)operator(;) - pre_type(int) ident(n)operator(;) - pre_type(int) ident(status)operator(;) - - ident(start) operator(=) ident(root) operator(=) ident(path)operator(;) - ident(flags) operator(|=) ident(FNM_SYSCASE)operator(;) -preprocessor(#if) ident(defined) ident(DOSISH) - ident(root) operator(=) ident(rb_path_skip_prefix)operator(()ident(root)operator(\);) -preprocessor(#endif) - - reserved(if) operator(()ident(root) operator(&&) operator(*)ident(root) operator(==) char('/')operator(\)) ident(root)operator(++;) - - ident(n) operator(=) ident(root) operator(-) ident(start)operator(;) - ident(buf) operator(=) ident(GLOB_ALLOC_N)operator(()pre_type(char)operator(,) ident(n) operator(+) integer(1)operator(\);) - reserved(if) operator((!)ident(buf)operator(\)) reserved(return) operator(-)integer(1)operator(;) - ident(MEMCPY)operator(()ident(buf)operator(,) ident(start)operator(,) pre_type(char)operator(,) ident(n)operator(\);) - ident(buf)operator([)ident(n)operator(]) operator(=) char('\\0')operator(;) - - ident(list) operator(=) ident(glob_make_pattern)operator(()ident(root)operator(,) ident(flags)operator(\);) - reserved(if) operator((!)ident(list)operator(\)) operator({) - ident(free)operator(()ident(buf)operator(\);) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - ident(status) operator(=) ident(glob_helper)operator(()ident(buf)operator(,) integer(0)operator(,) ident(UNKNOWN)operator(,) ident(UNKNOWN)operator(,) operator(&)ident(list)operator(,) operator(&)ident(list) operator(+) integer(1)operator(,) ident(flags)operator(,) ident(func)operator(,) ident(arg)operator(\);) - ident(glob_free_pattern)operator(()ident(list)operator(\);) - ident(free)operator(()ident(buf)operator(\);) - - reserved(return) ident(status)operator(;) -operator(}) - -pre_type(int) -ident(ruby_glob)operator(()ident(path)operator(,) ident(flags)operator(,) ident(func)operator(,) ident(arg)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - pre_type(int) ident(flags)operator(;) - ident(ruby_glob_func) operator(*)ident(func)operator(;) - ident(VALUE) ident(arg)operator(;) -operator({) - reserved(return) ident(ruby_glob0)operator(()ident(path)operator(,) ident(flags) operator(&) operator(~)ident(GLOB_VERBOSE)operator(,) ident(func)operator(,) ident(arg)operator(\);) -operator(}) - -directive(static) pre_type(int) ident(rb_glob_caller) ident(_)operator((()directive(const) pre_type(char) operator(*,) ident(VALUE)operator(\)\);) - -directive(static) pre_type(int) -ident(rb_glob_caller)operator(()ident(path)operator(,) ident(a)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - ident(VALUE) ident(a)operator(;) -operator({) - pre_type(int) ident(status)operator(;) - reserved(struct) ident(glob_args) operator(*)ident(args) operator(=) operator(()reserved(struct) ident(glob_args) operator(*\))ident(a)operator(;) - - ident(args)operator(->)ident(c) operator(=) ident(path)operator(;) - ident(rb_protect)operator(()ident(glob_func_caller)operator(,) ident(a)operator(,) operator(&)ident(status)operator(\);) - reserved(return) ident(status)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(rb_glob2)operator(()ident(path)operator(,) ident(flags)operator(,) ident(func)operator(,) ident(arg)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - pre_type(int) ident(flags)operator(;) - directive(void) operator((*)ident(func)operator(\)) ident(_)operator((()directive(const) pre_type(char) operator(*,) ident(VALUE)operator(\)\);) - ident(VALUE) ident(arg)operator(;) -operator({) - reserved(struct) ident(glob_args) ident(args)operator(;) - - ident(args)operator(.)ident(func) operator(=) ident(func)operator(;) - ident(args)operator(.)ident(v) operator(=) ident(arg)operator(;) - - reserved(if) operator(()ident(flags) operator(&) ident(FNM_SYSCASE)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(\);) - operator(}) - - reserved(return) ident(ruby_glob0)operator(()ident(path)operator(,) ident(flags) operator(|) ident(GLOB_VERBOSE)operator(,) ident(rb_glob_caller)operator(,) operator(()ident(VALUE)operator(\)&)ident(args)operator(\);) -operator(}) - -directive(void) -ident(rb_glob)operator(()ident(path)operator(,) ident(func)operator(,) ident(arg)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - directive(void) operator((*)ident(func)operator(\)) ident(_)operator((()directive(const) pre_type(char)operator(*,) ident(VALUE)operator(\)\);) - ident(VALUE) ident(arg)operator(;) -operator({) - pre_type(int) ident(status) operator(=) ident(rb_glob2)operator(()ident(path)operator(,) integer(0)operator(,) ident(func)operator(,) ident(arg)operator(\);) - reserved(if) operator(()ident(status)operator(\)) ident(GLOB_JUMP_TAG)operator(()ident(status)operator(\);) -operator(}) - -directive(static) directive(void) ident(push_pattern) ident(_)operator((()directive(const) pre_type(char)operator(*) ident(path)operator(,) ident(VALUE) ident(ary)operator(\)\);) -directive(static) directive(void) -ident(push_pattern)operator(()ident(path)operator(,) ident(ary)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_tainted_str_new2)operator(()ident(path)operator(\)\);) -operator(}) - -pre_type(int) -ident(ruby_brace_expand)operator(()ident(str)operator(,) ident(flags)operator(,) ident(func)operator(,) ident(arg)operator(\)) - directive(const) pre_type(char) operator(*)ident(str)operator(;) - pre_type(int) ident(flags)operator(;) - ident(ruby_glob_func) operator(*)ident(func)operator(;) - ident(VALUE) ident(arg)operator(;) -operator({) - directive(const) pre_type(int) ident(escape) operator(=) operator(!()ident(flags) operator(&) ident(FNM_NOESCAPE)operator(\);) - directive(const) pre_type(char) operator(*)ident(p) operator(=) ident(str)operator(;) - directive(const) pre_type(char) operator(*)ident(s) operator(=) ident(p)operator(;) - directive(const) pre_type(char) operator(*)ident(lbrace) operator(=) integer(0)operator(,) operator(*)ident(rbrace) operator(=) integer(0)operator(;) - pre_type(int) ident(nest) operator(=) integer(0)operator(,) ident(status) operator(=) integer(0)operator(;) - - reserved(while) operator((*)ident(p)operator(\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('{') operator(&&) ident(nest)operator(++) operator(==) integer(0)operator(\)) operator({) - ident(lbrace) operator(=) ident(p)operator(;) - operator(}) - reserved(if) operator((*)ident(p) operator(==) char('}') operator(&&) operator(--)ident(nest) operator(<=) integer(0)operator(\)) operator({) - ident(rbrace) operator(=) ident(p)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator((*)ident(p) operator(==) char('\\\\') operator(&&) ident(escape)operator(\)) operator({) - reserved(if) operator((!*++)ident(p)operator(\)) reserved(break)operator(;) - operator(}) - ident(Inc)operator(()ident(p)operator(\);) - operator(}) - - reserved(if) operator(()ident(lbrace) operator(&&) ident(rbrace)operator(\)) operator({) - pre_type(char) operator(*)ident(buf) operator(=) ident(GLOB_ALLOC_N)operator(()pre_type(char)operator(,) ident(strlen)operator(()ident(s)operator(\)) operator(+) integer(1)operator(\);) - pre_type(long) ident(shift)operator(;) - - reserved(if) operator((!)ident(buf)operator(\)) reserved(return) operator(-)integer(1)operator(;) - ident(memcpy)operator(()ident(buf)operator(,) ident(s)operator(,) ident(lbrace)operator(-)ident(s)operator(\);) - ident(shift) operator(=) operator(()ident(lbrace)operator(-)ident(s)operator(\);) - ident(p) operator(=) ident(lbrace)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(rbrace)operator(\)) operator({) - directive(const) pre_type(char) operator(*)ident(t) operator(=) operator(++)ident(p)operator(;) - ident(nest) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(rbrace) operator(&&) operator(!(*)ident(p) operator(==) char(',') operator(&&) ident(nest) operator(==) integer(0)operator(\)\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('{')operator(\)) ident(nest)operator(++;) - reserved(if) operator((*)ident(p) operator(==) char('}')operator(\)) ident(nest)operator(--;) - reserved(if) operator((*)ident(p) operator(==) char('\\\\') operator(&&) ident(escape)operator(\)) operator({) - reserved(if) operator((++)ident(p) operator(==) ident(rbrace)operator(\)) reserved(break)operator(;) - operator(}) - ident(Inc)operator(()ident(p)operator(\);) - operator(}) - ident(memcpy)operator(()ident(buf)operator(+)ident(shift)operator(,) ident(t)operator(,) ident(p)operator(-)ident(t)operator(\);) - ident(strcpy)operator(()ident(buf)operator(+)ident(shift)operator(+()ident(p)operator(-)ident(t)operator(\),) ident(rbrace)operator(+)integer(1)operator(\);) - ident(status) operator(=) ident(ruby_brace_expand)operator(()ident(buf)operator(,) ident(flags)operator(,) ident(func)operator(,) ident(arg)operator(\);) - reserved(if) operator(()ident(status)operator(\)) reserved(break)operator(;) - operator(}) - ident(free)operator(()ident(buf)operator(\);) - operator(}) - reserved(else) reserved(if) operator((!)ident(lbrace) operator(&&) operator(!)ident(rbrace)operator(\)) operator({) - ident(status) operator(=) operator((*)ident(func)operator(\)()ident(s)operator(,) ident(arg)operator(\);) - operator(}) - - reserved(return) ident(status)operator(;) -operator(}) - -reserved(struct) ident(brace_args) operator({) - ident(ruby_glob_func) operator(*)ident(func)operator(;) - ident(VALUE) ident(value)operator(;) - pre_type(int) ident(flags)operator(;) -operator(};) - -directive(static) pre_type(int) ident(glob_brace) ident(_)operator((()directive(const) pre_type(char) operator(*,) ident(VALUE)operator(\)\);) -directive(static) pre_type(int) -ident(glob_brace)operator(()ident(path)operator(,) ident(val)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(struct) ident(brace_args) operator(*)ident(arg) operator(=) operator(()reserved(struct) ident(brace_args) operator(*\))ident(val)operator(;) - - reserved(return) ident(ruby_glob0)operator(()ident(path)operator(,) ident(arg)operator(->)ident(flags)operator(,) ident(arg)operator(->)ident(func)operator(,) ident(arg)operator(->)ident(value)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(ruby_brace_glob0)operator(()ident(str)operator(,) ident(flags)operator(,) ident(func)operator(,) ident(arg)operator(\)) - directive(const) pre_type(char) operator(*)ident(str)operator(;) - pre_type(int) ident(flags)operator(;) - ident(ruby_glob_func) operator(*)ident(func)operator(;) - ident(VALUE) ident(arg)operator(;) -operator({) - reserved(struct) ident(brace_args) ident(args)operator(;) - - ident(args)operator(.)ident(func) operator(=) ident(func)operator(;) - ident(args)operator(.)ident(value) operator(=) ident(arg)operator(;) - ident(args)operator(.)ident(flags) operator(=) ident(flags)operator(;) - reserved(return) ident(ruby_brace_expand)operator(()ident(str)operator(,) ident(flags)operator(,) ident(glob_brace)operator(,) operator(()ident(VALUE)operator(\)&)ident(args)operator(\);) -operator(}) - -pre_type(int) -ident(ruby_brace_glob)operator(()ident(str)operator(,) ident(flags)operator(,) ident(func)operator(,) ident(arg)operator(\)) - directive(const) pre_type(char) operator(*)ident(str)operator(;) - pre_type(int) ident(flags)operator(;) - ident(ruby_glob_func) operator(*)ident(func)operator(;) - ident(VALUE) ident(arg)operator(;) -operator({) - reserved(return) ident(ruby_brace_glob0)operator(()ident(str)operator(,) ident(flags) operator(&) operator(~)ident(GLOB_VERBOSE)operator(,) ident(func)operator(,) ident(arg)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(push_glob)operator(()ident(VALUE) ident(ary)operator(,) directive(const) pre_type(char) operator(*)ident(str)operator(,) pre_type(int) ident(flags)operator(\)) -operator({) - reserved(struct) ident(glob_args) ident(args)operator(;) - - ident(args)operator(.)ident(func) operator(=) ident(push_pattern)operator(;) - ident(args)operator(.)ident(v) operator(=) ident(ary)operator(;) - reserved(return) ident(ruby_brace_glob0)operator(()ident(str)operator(,) ident(flags) operator(|) ident(GLOB_VERBOSE)operator(,) ident(rb_glob_caller)operator(,) operator(()ident(VALUE)operator(\)&)ident(args)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_push_glob)operator(()ident(str)operator(,) ident(flags)operator(\)) comment(/* '\\0' is delimiter */) - ident(VALUE) ident(str)operator(;) - pre_type(int) ident(flags)operator(;) -operator({) - pre_type(long) ident(offset) operator(=) integer(0)operator(;) - ident(VALUE) ident(ary)operator(;) - - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - ident(SafeStringValue)operator(()ident(str)operator(\);) - - reserved(while) operator(()ident(offset) operator(<) ident(RSTRING_LEN)operator(()ident(str)operator(\)\)) operator({) - pre_type(int) ident(status) operator(=) ident(push_glob)operator(()ident(ary)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(offset)operator(,) ident(flags)operator(\);) - pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - reserved(if) operator(()ident(status)operator(\)) ident(GLOB_JUMP_TAG)operator(()ident(status)operator(\);) - reserved(if) operator(()ident(offset) operator(>=) ident(RSTRING_LEN)operator(()ident(str)operator(\)\)) reserved(break)operator(;) - ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(offset)operator(;) - ident(p) operator(+=) ident(strlen)operator(()ident(p)operator(\)) operator(+) integer(1)operator(;) - ident(pend) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(RSTRING_LEN)operator(()ident(str)operator(\);) - reserved(while) operator(()ident(p) operator(<) ident(pend) operator(&&) operator(!*)ident(p)operator(\)) - ident(p)operator(++;) - ident(offset) operator(=) ident(p) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - operator(}) - - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(dir_globs)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(flags)operator(\)) - pre_type(long) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - pre_type(int) ident(flags)operator(;) -operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(argc)operator(;) operator(++)ident(i)operator(\)) operator({) - pre_type(int) ident(status)operator(;) - ident(VALUE) ident(str) operator(=) ident(argv)operator([)ident(i)operator(];) - ident(SafeStringValue)operator(()ident(str)operator(\);) - ident(status) operator(=) ident(push_glob)operator(()ident(ary)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(flags)operator(\);) - reserved(if) operator(()ident(status)operator(\)) ident(GLOB_JUMP_TAG)operator(()ident(status)operator(\);) - operator(}) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * Dir[ array ] => array - * Dir[ string [, string ...] ] => array - * - * Equivalent to calling - * Dir.glob(array,0\) and - * Dir.glob([string,...],0\). - * - */) -directive(static) ident(VALUE) -ident(dir_s_aref)operator(()pre_type(int) ident(argc)operator(,) ident(VALUE) operator(*)ident(argv)operator(,) ident(VALUE) ident(obj)operator(\)) - operator({) - reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - reserved(return) ident(rb_push_glob)operator(()ident(argv)operator([)integer(0)operator(],) integer(0)operator(\);) - operator(}) - reserved(return) ident(dir_globs)operator(()ident(argc)operator(,) ident(argv)operator(,) integer(0)operator(\);) - operator(}) - -comment(/* - * call-seq: - * Dir.glob( pattern, [flags] \) => array - * Dir.glob( pattern, [flags] \) {| filename | block } => nil - * - * Returns the filenames found by expanding pattern which is - * an +Array+ of the patterns or the pattern +String+, either as an - * array or as parameters to the block. Note that this pattern - * is not a regexp (it's closer to a shell glob\). See - * File::fnmatch for the meaning of the flags - * parameter. Note that case sensitivity depends on your system (so - * File::FNM_CASEFOLD is ignored\) - * - * *:: Matches any file. Can be restricted by - * other values in the glob. * - * will match all files; c* will - * match all files beginning with - * c; *c will match - * all files ending with c; and - * *c* will match all files that - * have c in them (including at - * the beginning or end\). Equivalent to - * / .* /x in regexp. - * **:: Matches directories recursively. - * ?:: Matches any one character. Equivalent to - * /.{1}/ in regexp. - * [set]:: Matches any one character in +set+. - * Behaves exactly like character sets in - * Regexp, including set negation - * ([^a-z]\). - * {p,q}:: Matches either literal p or - * literal q. Matching literals - * may be more than one character in length. - * More than two literals may be specified. - * Equivalent to pattern alternation in - * regexp. - * \\:: Escapes the next metacharacter. - * - * Dir["config.?"] #=> ["config.h"] - * Dir.glob("config.?"\) #=> ["config.h"] - * Dir.glob("*.[a-z][a-z]"\) #=> ["main.rb"] - * Dir.glob("*.[^r]*"\) #=> ["config.h"] - * Dir.glob("*.{rb,h}"\) #=> ["main.rb", "config.h"] - * Dir.glob("*"\) #=> ["config.h", "main.rb"] - * Dir.glob("*", File::FNM_DOTMATCH\) #=> [".", "..", "config.h", "main.rb"] - * - * rbfiles = File.join("**", "*.rb"\) - * Dir.glob(rbfiles\) #=> ["main.rb", - * "lib/song.rb", - * "lib/song/karaoke.rb"] - * libdirs = File.join("**", "lib"\) - * Dir.glob(libdirs\) #=> ["lib"] - * - * librbfiles = File.join("**", "lib", "**", "*.rb"\) - * Dir.glob(librbfiles\) #=> ["lib/song.rb", - * "lib/song/karaoke.rb"] - * - * librbfiles = File.join("**", "lib", "*.rb"\) - * Dir.glob(librbfiles\) #=> ["lib/song.rb"] - */) -directive(static) ident(VALUE) -ident(dir_s_glob)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(str)operator(,) ident(rflags)operator(,) ident(ary)operator(;) - pre_type(int) ident(flags)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(str)operator(,) operator(&)ident(rflags)operator(\)) operator(==) integer(2)operator(\)) - ident(flags) operator(=) ident(NUM2INT)operator(()ident(rflags)operator(\);) - reserved(else) - ident(flags) operator(=) integer(0)operator(;) - - ident(ary) operator(=) ident(rb_check_array_type)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(ary)operator(\)\)) operator({) - ident(ary) operator(=) ident(rb_push_glob)operator(()ident(str)operator(,) ident(flags)operator(\);) - operator(}) - reserved(else) operator({) - directive(volatile) ident(VALUE) ident(v) operator(=) ident(ary)operator(;) - ident(ary) operator(=) ident(dir_globs)operator(()ident(RARRAY_LEN)operator(()ident(v)operator(\),) ident(RARRAY_PTR)operator(()ident(v)operator(\),) ident(flags)operator(\);) - operator(}) - - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(rb_ary_each)operator(()ident(ary)operator(\);) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(dir_open_dir)operator(()ident(path)operator(\)) - ident(VALUE) ident(path)operator(;) -operator({) - ident(VALUE) ident(dir) operator(=) ident(rb_funcall)operator(()ident(rb_cDir)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(path)operator(\);) - - reserved(if) operator(()ident(TYPE)operator(()ident(dir)operator(\)) operator(!=) ident(T_DATA) operator(||) - ident(RDATA)operator(()ident(dir)operator(\)->)ident(dfree) operator(!=) operator(()ident(RUBY_DATA_FUNC)operator(\))ident(free_dir)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(dir)operator(\)\);) - operator(}) - reserved(return) ident(dir)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Dir.foreach( dirname \) {| filename | block } => nil - * - * Calls the block once for each entry in the named directory, passing - * the filename of each entry as a parameter to the block. - * - * Dir.foreach("testdir"\) {|x| puts "Got #{x}" } - * - * produces: - * - * Got . - * Got .. - * Got config.h - * Got main.rb - * - */) -directive(static) ident(VALUE) -ident(dir_foreach)operator(()ident(io)operator(,) ident(dirname)operator(\)) - ident(VALUE) ident(io)operator(,) ident(dirname)operator(;) -operator({) - ident(VALUE) ident(dir)operator(;) - - ident(dir) operator(=) ident(dir_open_dir)operator(()ident(dirname)operator(\);) - ident(rb_ensure)operator(()ident(dir_each)operator(,) ident(dir)operator(,) ident(dir_close)operator(,) ident(dir)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * Dir.entries( dirname \) => array - * - * Returns an array containing all of the filenames in the given - * directory. Will raise a SystemCallError if the named - * directory doesn't exist. - * - * Dir.entries("testdir"\) #=> [".", "..", "config.h", "main.rb"] - * - */) -directive(static) ident(VALUE) -ident(dir_entries)operator(()ident(io)operator(,) ident(dirname)operator(\)) - ident(VALUE) ident(io)operator(,) ident(dirname)operator(;) -operator({) - ident(VALUE) ident(dir)operator(;) - - ident(dir) operator(=) ident(dir_open_dir)operator(()ident(dirname)operator(\);) - reserved(return) ident(rb_ensure)operator(()ident(rb_Array)operator(,) ident(dir)operator(,) ident(dir_close)operator(,) ident(dir)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.fnmatch( pattern, path, [flags] \) => (true or false\) - * File.fnmatch?( pattern, path, [flags] \) => (true or false\) - * - * Returns true if path matches against pattern The - * pattern is not a regular expression; instead it follows rules - * similar to shell filename globbing. It may contain the following - * metacharacters: - * - * *:: Matches any file. Can be restricted by - * other values in the glob. * - * will match all files; c* will - * match all files beginning with - * c; *c will match - * all files ending with c; and - * *c* will match all files that - * have c in them (including at - * the beginning or end\). Equivalent to - * / .* /x in regexp. - * **:: Matches directories recursively or files - * expansively. - * ?:: Matches any one character. Equivalent to - * /.{1}/ in regexp. - * [set]:: Matches any one character in +set+. - * Behaves exactly like character sets in - * Regexp, including set negation - * ([^a-z]\). - * \\:: Escapes the next metacharacter. - * - * flags is a bitwise OR of the FNM_xxx - * parameters. The same glob pattern and flags are used by - * Dir::glob. - * - * File.fnmatch('cat', 'cat'\) #=> true : match entire string - * File.fnmatch('cat', 'category'\) #=> false : only match partial string - * File.fnmatch('c{at,ub}s', 'cats'\) #=> false : { } isn't supported - * - * File.fnmatch('c?t', 'cat'\) #=> true : '?' match only 1 character - * File.fnmatch('c??t', 'cat'\) #=> false : ditto - * File.fnmatch('c*', 'cats'\) #=> true : '*' match 0 or more characters - * File.fnmatch('c*t', 'c/a/b/t'\) #=> true : ditto - * File.fnmatch('ca[a-z]', 'cat'\) #=> true : inclusive bracket expression - * File.fnmatch('ca[^t]', 'cat'\) #=> false : exclusive bracket expression ('^' or '!'\) - * - * File.fnmatch('cat', 'CAT'\) #=> false : case sensitive - * File.fnmatch('cat', 'CAT', File::FNM_CASEFOLD\) #=> true : case insensitive - * - * File.fnmatch('?', '/', File::FNM_PATHNAME\) #=> false : wildcard doesn't match '/' on FNM_PATHNAME - * File.fnmatch('*', '/', File::FNM_PATHNAME\) #=> false : ditto - * File.fnmatch('[/]', '/', File::FNM_PATHNAME\) #=> false : ditto - * - * File.fnmatch('\\?', '?'\) #=> true : escaped wildcard becomes ordinary - * File.fnmatch('\\a', 'a'\) #=> true : escaped ordinary remains ordinary - * File.fnmatch('\\a', '\\a', File::FNM_NOESCAPE\) #=> true : FNM_NOESACPE makes '\\' ordinary - * File.fnmatch('[\\?]', '?'\) #=> true : can escape inside bracket expression - * - * File.fnmatch('*', '.profile'\) #=> false : wildcard doesn't match leading - * File.fnmatch('*', '.profile', File::FNM_DOTMATCH\) #=> true period by default. - * File.fnmatch('.*', '.profile'\) #=> true - * - * rbfiles = '**' '/' '*.rb' # you don't have to do like this. just write in single string. - * File.fnmatch(rbfiles, 'main.rb'\) #=> false - * File.fnmatch(rbfiles, './main.rb'\) #=> false - * File.fnmatch(rbfiles, 'lib/song.rb'\) #=> true - * File.fnmatch('**.rb', 'main.rb'\) #=> true - * File.fnmatch('**.rb', './main.rb'\) #=> false - * File.fnmatch('**.rb', 'lib/song.rb'\) #=> true - * File.fnmatch('*', 'dave/.profile'\) #=> true - * - * pattern = '*' '/' '*' - * File.fnmatch(pattern, 'dave/.profile', File::FNM_PATHNAME\) #=> false - * File.fnmatch(pattern, 'dave/.profile', File::FNM_PATHNAME | File::FNM_DOTMATCH\) #=> true - * - * pattern = '**' '/' 'foo' - * File.fnmatch(pattern, 'a/b/c/foo', File::FNM_PATHNAME\) #=> true - * File.fnmatch(pattern, '/a/b/c/foo', File::FNM_PATHNAME\) #=> true - * File.fnmatch(pattern, 'c:/a/b/c/foo', File::FNM_PATHNAME\) #=> true - * File.fnmatch(pattern, 'a/.b/c/foo', File::FNM_PATHNAME\) #=> false - * File.fnmatch(pattern, 'a/.b/c/foo', File::FNM_PATHNAME | File::FNM_DOTMATCH\) #=> true - */) -directive(static) ident(VALUE) -ident(file_s_fnmatch)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(pattern)operator(,) ident(path)operator(;) - ident(VALUE) ident(rflags)operator(;) - pre_type(int) ident(flags)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(pattern)operator(,) operator(&)ident(path)operator(,) operator(&)ident(rflags)operator(\)) operator(==) integer(3)operator(\)) - ident(flags) operator(=) ident(NUM2INT)operator(()ident(rflags)operator(\);) - reserved(else) - ident(flags) operator(=) integer(0)operator(;) - - ident(StringValue)operator(()ident(pattern)operator(\);) - ident(StringValue)operator(()ident(path)operator(\);) - - reserved(if) operator(()ident(fnmatch)operator(()ident(RSTRING)operator(()ident(pattern)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(,) ident(flags)operator(\)) operator(==) integer(0)operator(\)) - reserved(return) ident(Qtrue)operator(;) - - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * Objects of class Dir are directory streams representing - * directories in the underlying file system. They provide a variety of - * ways to list directories and their contents. See also - * File. - * - * The directory used in these examples contains the two regular files - * (config.h and main.rb\), the parent - * directory (..\), and the directory itself - * (.\). - */) -directive(void) -ident(Init_Dir)operator((\)) -operator({) - ident(rb_cDir) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - - ident(rb_include_module)operator(()ident(rb_cDir)operator(,) ident(rb_mEnumerable)operator(\);) - - ident(rb_define_alloc_func)operator(()ident(rb_cDir)operator(,) ident(dir_s_alloc)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,) stringoperator(,) ident(dir_s_open)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,) stringoperator(,) ident(dir_foreach)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,) stringoperator(,) ident(dir_entries)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_initialize)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_path)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_read)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_each)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_rewind)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_tell)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_seek)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_tell)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_set_pos)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_close)operator(,) integer(0)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_s_chdir)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_s_getwd)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_s_getwd)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_s_chroot)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_s_mkdir)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_s_rmdir)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_s_rmdir)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_s_rmdir)operator(,) integer(1)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_s_glob)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cDir)operator(,)stringoperator(,) ident(dir_s_aref)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,)stringoperator(,) ident(file_s_fnmatch)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,)stringoperator(,) ident(file_s_fnmatch)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(FNM_NOESCAPE)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(FNM_PATHNAME)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(FNM_DOTMATCH)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(FNM_CASEFOLD)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(FNM_SYSCASE)operator(\)\);) -operator(}) -comment(/********************************************************************** - - dln.c - - - $Author: shyouhei $ - $Date: 2008-06-15 15:25:08 +0200 (Sun, 15 Jun 2008\) $ - created at: Tue Jan 18 17:05:06 JST 1994 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("dln.h") - -preprocessor(#ifdef) ident(HAVE_STDLIB_H) -preprocessor(# include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(__CHECKER__) -preprocessor(#undef) ident(HAVE_DLOPEN) -preprocessor(#undef) ident(USE_DLN_A_OUT) -preprocessor(#undef) ident(USE_DLN_DLOPEN) -preprocessor(#endif) - -preprocessor(#ifdef) ident(USE_DLN_A_OUT) -pre_type(char) operator(*)ident(dln_argv0)operator(;) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_ALLOCA_H)operator(\)) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_STRING_H) -preprocessor(# include) include() -preprocessor(#else) -preprocessor(# include) include() -preprocessor(#endif) - -preprocessor(#ifndef) ident(xmalloc) -directive(void) operator(*)ident(xmalloc)operator((\);) -directive(void) operator(*)ident(xcalloc)operator((\);) -directive(void) operator(*)ident(xrealloc)operator((\);) -preprocessor(#endif) - -preprocessor(#include) include() -preprocessor(#if) ident(defined)operator(()ident(_WIN32)operator(\)) operator(||) ident(defined)operator(()ident(__VMS)operator(\)) -preprocessor(#include) include("missing/file.h") -preprocessor(#endif) -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#ifndef) ident(S_ISDIR) -preprocessor(# define) ident(S_ISDIR)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFDIR)operator(\)) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_SYS_PARAM_H) -preprocessor(# include) include() -preprocessor(#endif) -preprocessor(#ifndef) ident(MAXPATHLEN) -preprocessor(# define) ident(MAXPATHLEN) integer(1024) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_UNISTD_H) -preprocessor(# include) include() -preprocessor(#endif) - -preprocessor(#ifndef) ident(_WIN32) -pre_type(char) operator(*)ident(getenv)operator((\);) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__VMS)operator(\)) -preprocessor(#pragma) ident(builtins) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(__MACOS__) -preprocessor(# include) include() -preprocessor(# include) include() -preprocessor(# include) include() -preprocessor(# include) include("macruby_private.h") -preprocessor(#endif) - -preprocessor(#ifdef) ident(__BEOS__) -preprocessor(# include) include() -preprocessor(#endif) - -preprocessor(#ifndef) ident(NO_DLN_LOAD) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_DLOPEN)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(USE_DLN_A_OUT)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(_AIX)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__APPLE__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(_UNICOSMP)operator(\)) -comment(/* dynamic load with dlopen(\) */) -preprocessor(# define) ident(USE_DLN_DLOPEN) -preprocessor(#endif) - -preprocessor(#ifndef) ident(FUNCNAME_PATTERN) -preprocessor(# if) ident(defined)operator(()ident(__hp9000s300)operator(\)) operator(||) operator(()ident(defined)operator(()ident(__NetBSD__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__ELF__)operator(\)\)) operator(||) ident(defined)operator(()ident(__BORLANDC__)operator(\)) operator(||) operator(()ident(defined)operator(()ident(__FreeBSD__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__ELF__)operator(\)\)) operator(||) operator(()ident(defined)operator(()ident(__OpenBSD__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__ELF__)operator(\)\)) operator(||) ident(defined)operator(()ident(NeXT)operator(\)) operator(||) ident(defined)operator(()ident(__WATCOMC__)operator(\)) operator(||) ident(defined)operator(()ident(__APPLE__)operator(\)) -preprocessor(# define) ident(FUNCNAME_PATTERN) string -preprocessor(# else) -preprocessor(# define) ident(FUNCNAME_PATTERN) string -preprocessor(# endif) -preprocessor(#endif) - -directive(static) pre_type(int) -ident(init_funcname_len)operator(()ident(buf)operator(,) ident(file)operator(\)) - pre_type(char) operator(**)ident(buf)operator(;) - directive(const) pre_type(char) operator(*)ident(file)operator(;) -operator({) - pre_type(char) operator(*)ident(p)operator(;) - directive(const) pre_type(char) operator(*)ident(slash)operator(;) - pre_type(int) ident(len)operator(;) - - comment(/* Load the file as an object one */) - reserved(for) operator(()ident(slash) operator(=) ident(file)operator(-)integer(1)operator(;) operator(*)ident(file)operator(;) ident(file)operator(++\)) comment(/* Find position of last '/' */) -preprocessor(#ifdef) ident(__MACOS__) - reserved(if) operator((*)ident(file) operator(==) char(':')operator(\)) ident(slash) operator(=) ident(file)operator(;) -preprocessor(#else) - reserved(if) operator((*)ident(file) operator(==) char('/')operator(\)) ident(slash) operator(=) ident(file)operator(;) -preprocessor(#endif) - - ident(len) operator(=) ident(strlen)operator(()ident(FUNCNAME_PATTERN)operator(\)) operator(+) ident(strlen)operator(()ident(slash) operator(+) integer(1)operator(\);) - operator(*)ident(buf) operator(=) ident(xmalloc)operator(()ident(len)operator(\);) - ident(snprintf)operator((*)ident(buf)operator(,) ident(len)operator(,) ident(FUNCNAME_PATTERN)operator(,) ident(slash) operator(+) integer(1)operator(\);) - reserved(for) operator(()ident(p) operator(=) operator(*)ident(buf)operator(;) operator(*)ident(p)operator(;) ident(p)operator(++\)) operator({) comment(/* Delete suffix if it exists */) - reserved(if) operator((*)ident(p) operator(==) char('.')operator(\)) operator({) - operator(*)ident(p) operator(=) char('\\0')operator(;) reserved(break)operator(;) - operator(}) - operator(}) - reserved(return) ident(p) operator(-) operator(*)ident(buf)operator(;) -operator(}) - -preprocessor(#define) ident(init_funcname)operator(()ident(buf)operator(,) ident(file)operator(\)) reserved(do) operator({)\ - pre_type(int) ident(len) operator(=) ident(init_funcname_len)operator(()ident(buf)operator(,) ident(file)operator(\);)\ - pre_type(char) operator(*)ident(tmp) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(len)operator(+)integer(1)operator(\);)\ - reserved(if) operator((!)ident(tmp)operator(\)) operator({)\ - ident(free)operator((*)ident(buf)operator(\);)\ - ident(rb_memerror)operator((\);)\ - operator(})\ - ident(strcpy)operator(()ident(tmp)operator(,) operator(*)ident(buf)operator(\);)\ - ident(free)operator((*)ident(buf)operator(\);)\ - operator(*)ident(buf) operator(=) ident(tmp)operator(;)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#ifdef) ident(USE_DLN_A_OUT) - -preprocessor(#ifndef) ident(LIBC_NAME) -preprocessor(# define) ident(LIBC_NAME) string -preprocessor(#endif) - -preprocessor(#ifndef) ident(DLN_DEFAULT_LIB_PATH) -preprocessor(# define) ident(DLN_DEFAULT_LIB_PATH) string -preprocessor(#endif) - -preprocessor(#include) include() - -directive(static) pre_type(int) ident(dln_errno)operator(;) - -preprocessor(#define) ident(DLN_ENOEXEC) ident(ENOEXEC) comment(/* Exec format error */) -preprocessor(#define) ident(DLN_ECONFL) integer(1201) comment(/* Symbol name conflict */) -preprocessor(#define) ident(DLN_ENOINIT) integer(1202) comment(/* No initializer given */) -preprocessor(#define) ident(DLN_EUNDEF) integer(1203) comment(/* Undefine symbol remains */) -preprocessor(#define) ident(DLN_ENOTLIB) integer(1204) comment(/* Not a library file */) -preprocessor(#define) ident(DLN_EBADLIB) integer(1205) comment(/* Malformed library file */) -preprocessor(#define) ident(DLN_EINIT) integer(1206) comment(/* Not initialized */) - -directive(static) pre_type(int) ident(dln_init_p) operator(=) integer(0)operator(;) - -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#ifndef) ident(N_COMM) -preprocessor(# define) ident(N_COMM) hex(0x12) -preprocessor(#endif) -preprocessor(#ifndef) ident(N_MAGIC) -preprocessor(# define) ident(N_MAGIC)operator(()ident(x)operator(\)) operator(()ident(x)operator(\))operator(.)ident(a_magic) -preprocessor(#endif) - -preprocessor(#define) ident(INVALID_OBJECT)operator(()ident(h)operator(\)) operator(()ident(N_MAGIC)operator(()ident(h)operator(\)) operator(!=) ident(OMAGIC)operator(\)) - -preprocessor(#include) include("util.h") -preprocessor(#include) include("st.h") - -directive(static) ident(st_table) operator(*)ident(sym_tbl)operator(;) -directive(static) ident(st_table) operator(*)ident(undef_tbl)operator(;) - -directive(static) pre_type(int) ident(load_lib)operator((\);) - -directive(static) pre_type(int) -ident(load_header)operator(()ident(fd)operator(,) ident(hdrp)operator(,) ident(disp)operator(\)) - pre_type(int) ident(fd)operator(;) - reserved(struct) ident(exec) operator(*)ident(hdrp)operator(;) - pre_type(long) ident(disp)operator(;) -operator({) - pre_type(int) ident(size)operator(;) - - ident(lseek)operator(()ident(fd)operator(,) ident(disp)operator(,) integer(0)operator(\);) - ident(size) operator(=) ident(read)operator(()ident(fd)operator(,) ident(hdrp)operator(,) reserved(sizeof)operator(()reserved(struct) ident(exec)operator(\)\);) - reserved(if) operator(()ident(size) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(dln_errno) operator(=) ident(errno)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(size) operator(!=) reserved(sizeof)operator(()reserved(struct) ident(exec)operator(\)) operator(||) ident(N_BADMAG)operator((*)ident(hdrp)operator(\)\)) operator({) - ident(dln_errno) operator(=) ident(DLN_ENOEXEC)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(sequent)operator(\)) -preprocessor(#define) ident(RELOC_SYMBOL)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_symbolnum)operator(\)) -preprocessor(#define) ident(RELOC_MEMORY_SUB_P)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_bsr)operator(\)) -preprocessor(#define) ident(RELOC_PCREL_P)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_pcrel) operator(||) operator(()ident(r)operator(\)->)ident(r_bsr)operator(\)) -preprocessor(#define) ident(RELOC_TARGET_SIZE)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_length)operator(\)) -preprocessor(#endif) - -comment(/* Default macros */) -preprocessor(#ifndef) ident(RELOC_ADDRESS) -preprocessor(#define) ident(RELOC_ADDRESS)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_address)operator(\)) -preprocessor(#define) ident(RELOC_EXTERN_P)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_extern)operator(\)) -preprocessor(#define) ident(RELOC_SYMBOL)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_symbolnum)operator(\)) -preprocessor(#define) ident(RELOC_MEMORY_SUB_P)operator(()ident(r)operator(\)) integer(0) -preprocessor(#define) ident(RELOC_PCREL_P)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_pcrel)operator(\)) -preprocessor(#define) ident(RELOC_TARGET_SIZE)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_length)operator(\)) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(sun)operator(\)) operator(&&) ident(defined)operator(()ident(sparc)operator(\)) -comment(/* Sparc (Sun 4\) macros */) -preprocessor(# undef) ident(relocation_info) -preprocessor(# define) ident(relocation_info) ident(reloc_info_sparc) -preprocessor(# define) ident(R_RIGHTSHIFT)operator(()ident(r)operator(\)) operator(()ident(reloc_r_rightshift)operator([()ident(r)operator(\)->)ident(r_type)operator(]\)) -preprocessor(# define) ident(R_BITSIZE)operator(()ident(r)operator(\)) operator(()ident(reloc_r_bitsize)operator([()ident(r)operator(\)->)ident(r_type)operator(]\)) -preprocessor(# define) ident(R_LENGTH)operator(()ident(r)operator(\)) operator(()ident(reloc_r_length)operator([()ident(r)operator(\)->)ident(r_type)operator(]\)) -directive(static) pre_type(int) ident(reloc_r_rightshift)operator([]) operator(=) operator({) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(2)operator(,) integer(2)operator(,) integer(10)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) -operator(};) -directive(static) pre_type(int) ident(reloc_r_bitsize)operator([]) operator(=) operator({) - integer(8)operator(,) integer(16)operator(,) integer(32)operator(,) integer(8)operator(,) integer(16)operator(,) integer(32)operator(,) integer(30)operator(,) integer(22)operator(,) integer(22)operator(,) integer(22)operator(,) integer(13)operator(,) integer(10)operator(,) integer(32)operator(,) integer(32)operator(,) integer(16)operator(,) -operator(};) -directive(static) pre_type(int) ident(reloc_r_length)operator([]) operator(=) operator({) - integer(0)operator(,) integer(1)operator(,) integer(2)operator(,) integer(0)operator(,) integer(1)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) -operator(};) -preprocessor(# define) ident(R_PCREL)operator(()ident(r)operator(\)) \ - operator((()ident(r)operator(\)->)ident(r_type) operator(>=) ident(RELOC_DISP8) operator(&&) operator(()ident(r)operator(\)->)ident(r_type) operator(<=) ident(RELOC_WDISP22)operator(\)) -preprocessor(# define) ident(R_SYMBOL)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_index)operator(\)) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(sequent)operator(\)) -preprocessor(#define) ident(R_SYMBOL)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_symbolnum)operator(\)) -preprocessor(#define) ident(R_MEMORY_SUB)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_bsr)operator(\)) -preprocessor(#define) ident(R_PCREL)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_pcrel) operator(||) operator(()ident(r)operator(\)->)ident(r_bsr)operator(\)) -preprocessor(#define) ident(R_LENGTH)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_length)operator(\)) -preprocessor(#endif) - -preprocessor(#ifndef) ident(R_SYMBOL) -preprocessor(# define) ident(R_SYMBOL)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_symbolnum)operator(\)) -preprocessor(# define) ident(R_MEMORY_SUB)operator(()ident(r)operator(\)) integer(0) -preprocessor(# define) ident(R_PCREL)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_pcrel)operator(\)) -preprocessor(# define) ident(R_LENGTH)operator(()ident(r)operator(\)) operator((()ident(r)operator(\)->)ident(r_length)operator(\)) -preprocessor(#endif) - -directive(static) reserved(struct) ident(relocation_info) operator(*) -ident(load_reloc)operator(()ident(fd)operator(,) ident(hdrp)operator(,) ident(disp)operator(\)) - pre_type(int) ident(fd)operator(;) - reserved(struct) ident(exec) operator(*)ident(hdrp)operator(;) - pre_type(long) ident(disp)operator(;) -operator({) - reserved(struct) ident(relocation_info) operator(*)ident(reloc)operator(;) - pre_type(int) ident(size)operator(;) - - ident(lseek)operator(()ident(fd)operator(,) ident(disp) operator(+) ident(N_TXTOFF)operator((*)ident(hdrp)operator(\)) operator(+) ident(hdrp)operator(->)ident(a_text) operator(+) ident(hdrp)operator(->)ident(a_data)operator(,) integer(0)operator(\);) - ident(size) operator(=) ident(hdrp)operator(->)ident(a_trsize) operator(+) ident(hdrp)operator(->)ident(a_drsize)operator(;) - ident(reloc) operator(=) operator(()reserved(struct) ident(relocation_info)operator(*\))ident(xmalloc)operator(()ident(size)operator(\);) - reserved(if) operator(()ident(reloc) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(dln_errno) operator(=) ident(errno)operator(;) - reserved(return) pre_constant(NULL)operator(;) - operator(}) - - reserved(if) operator(()ident(read)operator(()ident(fd)operator(,) ident(reloc)operator(,) ident(size)operator(\)) operator(!=) ident(size)operator(\)) operator({) - ident(dln_errno) operator(=) ident(errno)operator(;) - ident(free)operator(()ident(reloc)operator(\);) - reserved(return) pre_constant(NULL)operator(;) - operator(}) - - reserved(return) ident(reloc)operator(;) -operator(}) - -directive(static) reserved(struct) ident(nlist) operator(*) -ident(load_sym)operator(()ident(fd)operator(,) ident(hdrp)operator(,) ident(disp)operator(\)) - pre_type(int) ident(fd)operator(;) - reserved(struct) ident(exec) operator(*)ident(hdrp)operator(;) - pre_type(long) ident(disp)operator(;) -operator({) - reserved(struct) ident(nlist) operator(*) ident(buffer)operator(;) - reserved(struct) ident(nlist) operator(*) ident(sym)operator(;) - reserved(struct) ident(nlist) operator(*) ident(end)operator(;) - pre_type(long) ident(displ)operator(;) - pre_type(int) ident(size)operator(;) - - ident(lseek)operator(()ident(fd)operator(,) ident(N_SYMOFF)operator((*)ident(hdrp)operator(\)) operator(+) ident(hdrp)operator(->)ident(a_syms) operator(+) ident(disp)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(read)operator(()ident(fd)operator(,) operator(&)ident(size)operator(,) reserved(sizeof)operator(()pre_type(int)operator(\)\)) operator(!=) reserved(sizeof)operator(()pre_type(int)operator(\)\)) operator({) - reserved(goto) ident(err_noexec)operator(;) - operator(}) - - ident(buffer) operator(=) operator(()reserved(struct) ident(nlist)operator(*\))ident(xmalloc)operator(()ident(hdrp)operator(->)ident(a_syms) operator(+) ident(size)operator(\);) - reserved(if) operator(()ident(buffer) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(dln_errno) operator(=) ident(errno)operator(;) - reserved(return) pre_constant(NULL)operator(;) - operator(}) - - ident(lseek)operator(()ident(fd)operator(,) ident(disp) operator(+) ident(N_SYMOFF)operator((*)ident(hdrp)operator(\),) integer(0)operator(\);) - reserved(if) operator(()ident(read)operator(()ident(fd)operator(,) ident(buffer)operator(,) ident(hdrp)operator(->)ident(a_syms) operator(+) ident(size)operator(\)) operator(!=) ident(hdrp)operator(->)ident(a_syms) operator(+) ident(size)operator(\)) operator({) - ident(free)operator(()ident(buffer)operator(\);) - reserved(goto) ident(err_noexec)operator(;) - operator(}) - - ident(sym) operator(=) ident(buffer)operator(;) - ident(end) operator(=) ident(sym) operator(+) ident(hdrp)operator(->)ident(a_syms) operator(/) reserved(sizeof)operator(()reserved(struct) ident(nlist)operator(\);) - ident(displ) operator(=) operator(()pre_type(long)operator(\))ident(buffer) operator(+) operator(()pre_type(long)operator(\)()ident(hdrp)operator(->)ident(a_syms)operator(\);) - - reserved(while) operator(()ident(sym) operator(<) ident(end)operator(\)) operator({) - ident(sym)operator(->)ident(n_un)operator(.)ident(n_name) operator(=) operator(()pre_type(char)operator(*\))ident(sym)operator(->)ident(n_un)operator(.)ident(n_strx) operator(+) ident(displ)operator(;) - ident(sym)operator(++;) - operator(}) - reserved(return) ident(buffer)operator(;) - - label(err_noexec:) - ident(dln_errno) operator(=) ident(DLN_ENOEXEC)operator(;) - reserved(return) pre_constant(NULL)operator(;) -operator(}) - -directive(static) ident(st_table) operator(*) -ident(sym_hash)operator(()ident(hdrp)operator(,) ident(syms)operator(\)) - reserved(struct) ident(exec) operator(*)ident(hdrp)operator(;) - reserved(struct) ident(nlist) operator(*)ident(syms)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - reserved(struct) ident(nlist) operator(*)ident(sym) operator(=) ident(syms)operator(;) - reserved(struct) ident(nlist) operator(*)ident(end) operator(=) ident(syms) operator(+) operator(()ident(hdrp)operator(->)ident(a_syms) operator(/) reserved(sizeof)operator(()reserved(struct) ident(nlist)operator(\)\);) - - ident(tbl) operator(=) ident(st_init_strtable)operator((\);) - reserved(if) operator(()ident(tbl) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(dln_errno) operator(=) ident(errno)operator(;) - reserved(return) pre_constant(NULL)operator(;) - operator(}) - - reserved(while) operator(()ident(sym) operator(<) ident(end)operator(\)) operator({) - ident(st_insert)operator(()ident(tbl)operator(,) ident(sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(,) ident(sym)operator(\);) - ident(sym)operator(++;) - operator(}) - reserved(return) ident(tbl)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(dln_init)operator(()ident(prog)operator(\)) - directive(const) pre_type(char) operator(*)ident(prog)operator(;) -operator({) - pre_type(char) operator(*)ident(file)operator(;) - pre_type(int) ident(fd)operator(;) - reserved(struct) ident(exec) ident(hdr)operator(;) - reserved(struct) ident(nlist) operator(*)ident(syms)operator(;) - - reserved(if) operator(()ident(dln_init_p) operator(==) integer(1)operator(\)) reserved(return) integer(0)operator(;) - - ident(file) operator(=) ident(dln_find_exe)operator(()ident(prog)operator(,) pre_constant(NULL)operator(\);) - reserved(if) operator(()ident(file) operator(==) pre_constant(NULL) operator(||) operator(()ident(fd) operator(=) ident(open)operator(()ident(file)operator(,) ident(O_RDONLY)operator(\)\)) operator(<) integer(0)operator(\)) operator({) - ident(dln_errno) operator(=) ident(errno)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - - reserved(if) operator(()ident(load_header)operator(()ident(fd)operator(,) operator(&)ident(hdr)operator(,) integer(0)operator(\)) operator(==) operator(-)integer(1)operator(\)) reserved(return) operator(-)integer(1)operator(;) - ident(syms) operator(=) ident(load_sym)operator(()ident(fd)operator(,) operator(&)ident(hdr)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(syms) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(close)operator(()ident(fd)operator(\);) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - ident(sym_tbl) operator(=) ident(sym_hash)operator((&)ident(hdr)operator(,) ident(syms)operator(\);) - reserved(if) operator(()ident(sym_tbl) operator(==) pre_constant(NULL)operator(\)) operator({) comment(/* file may be start with #! */) - pre_type(char) ident(c) operator(=) char('\\0')operator(;) - pre_type(char) ident(buf)operator([)ident(MAXPATHLEN)operator(];) - pre_type(char) operator(*)ident(p)operator(;) - - ident(free)operator(()ident(syms)operator(\);) - ident(lseek)operator(()ident(fd)operator(,) integer(0L)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(read)operator(()ident(fd)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(dln_errno) operator(=) ident(errno)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(!=) char('#')operator(\)) reserved(goto) ident(err_noexec)operator(;) - reserved(if) operator(()ident(read)operator(()ident(fd)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(dln_errno) operator(=) ident(errno)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(!=) char('!')operator(\)) reserved(goto) ident(err_noexec)operator(;) - - ident(p) operator(=) ident(buf)operator(;) - comment(/* skip forwarding spaces */) - reserved(while) operator(()ident(read)operator(()ident(fd)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\)) operator(==) integer(1)operator(\)) operator({) - reserved(if) operator(()ident(c) operator(==) char('\\n')operator(\)) reserved(goto) ident(err_noexec)operator(;) - reserved(if) operator(()ident(c) operator(!=) char('\\t') operator(&&) ident(c) operator(!=) char(' ')operator(\)) operator({) - operator(*)ident(p)operator(++) operator(=) ident(c)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - comment(/* read in command name */) - reserved(while) operator(()ident(read)operator(()ident(fd)operator(,) ident(p)operator(,) integer(1)operator(\)) operator(==) integer(1)operator(\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('\\n') operator(||) operator(*)ident(p) operator(==) char('\\t') operator(||) operator(*)ident(p) operator(==) char(' ')operator(\)) reserved(break)operator(;) - ident(p)operator(++;) - reserved(if) operator(()ident(p)operator(-)ident(buf) operator(>=) ident(MAXPATHLEN)operator(\)) operator({) - ident(dln_errno) operator(=) ident(ENAMETOOLONG)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - operator(}) - operator(*)ident(p) operator(=) char('\\0')operator(;) - - reserved(return) ident(dln_init)operator(()ident(buf)operator(\);) - operator(}) - ident(dln_init_p) operator(=) integer(1)operator(;) - ident(undef_tbl) operator(=) ident(st_init_strtable)operator((\);) - ident(close)operator(()ident(fd)operator(\);) - reserved(return) integer(0)operator(;) - - label(err_noexec:) - ident(close)operator(()ident(fd)operator(\);) - ident(dln_errno) operator(=) ident(DLN_ENOEXEC)operator(;) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - -directive(static) pre_type(long) -ident(load_text_data)operator(()ident(fd)operator(,) ident(hdrp)operator(,) ident(bss)operator(,) ident(disp)operator(\)) - pre_type(int) ident(fd)operator(;) - reserved(struct) ident(exec) operator(*)ident(hdrp)operator(;) - pre_type(int) ident(bss)operator(;) - pre_type(long) ident(disp)operator(;) -operator({) - pre_type(int) ident(size)operator(;) - pre_type(unsigned) pre_type(char)operator(*) ident(addr)operator(;) - - ident(lseek)operator(()ident(fd)operator(,) ident(disp) operator(+) ident(N_TXTOFF)operator((*)ident(hdrp)operator(\),) integer(0)operator(\);) - ident(size) operator(=) ident(hdrp)operator(->)ident(a_text) operator(+) ident(hdrp)operator(->)ident(a_data)operator(;) - - reserved(if) operator(()ident(bss) operator(==) operator(-)integer(1)operator(\)) ident(size) operator(+=) ident(hdrp)operator(->)ident(a_bss)operator(;) - reserved(else) reserved(if) operator(()ident(bss) operator(>) integer(1)operator(\)) ident(size) operator(+=) ident(bss)operator(;) - - ident(addr) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(xmalloc)operator(()ident(size)operator(\);) - reserved(if) operator(()ident(addr) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(dln_errno) operator(=) ident(errno)operator(;) - reserved(return) integer(0)operator(;) - operator(}) - - reserved(if) operator(()ident(read)operator(()ident(fd)operator(,) ident(addr)operator(,) ident(size)operator(\)) operator(!=) ident(size)operator(\)) operator({) - ident(dln_errno) operator(=) ident(errno)operator(;) - ident(free)operator(()ident(addr)operator(\);) - reserved(return) integer(0)operator(;) - operator(}) - - reserved(if) operator(()ident(bss) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(memset)operator(()ident(addr) operator(+) ident(hdrp)operator(->)ident(a_text) operator(+) ident(hdrp)operator(->)ident(a_data)operator(,) integer(0)operator(,) ident(hdrp)operator(->)ident(a_bss)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(bss) operator(>) integer(0)operator(\)) operator({) - ident(memset)operator(()ident(addr) operator(+) ident(hdrp)operator(->)ident(a_text) operator(+) ident(hdrp)operator(->)ident(a_data)operator(,) integer(0)operator(,) ident(bss)operator(\);) - operator(}) - - reserved(return) operator(()pre_type(long)operator(\))ident(addr)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(undef_print)operator(()ident(key)operator(,) ident(value)operator(\)) - pre_type(char) operator(*)ident(key)operator(,) operator(*)ident(value)operator(;) -operator({) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(,) ident(key)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) directive(void) -ident(dln_print_undef)operator((\)) -operator({) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(\);) - ident(st_foreach)operator(()ident(undef_tbl)operator(,) ident(undef_print)operator(,) pre_constant(NULL)operator(\);) -operator(}) - -directive(static) directive(void) -ident(dln_undefined)operator((\)) -operator({) - reserved(if) operator(()ident(undef_tbl)operator(->)ident(num_entries) operator(>) integer(0)operator(\)) operator({) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(\);) - ident(dln_print_undef)operator((\);) - ident(rb_exit)operator(()integer(1)operator(\);) - operator(}) -operator(}) - -reserved(struct) ident(undef) operator({) - pre_type(char) operator(*)ident(name)operator(;) - reserved(struct) ident(relocation_info) ident(reloc)operator(;) - pre_type(long) ident(base)operator(;) - pre_type(char) operator(*)ident(addr)operator(;) - reserved(union) operator({) - pre_type(char) ident(c)operator(;) - pre_type(short) ident(s)operator(;) - pre_type(long) ident(l)operator(;) - operator(}) ident(u)operator(;) -operator(};) - -directive(static) ident(st_table) operator(*)ident(reloc_tbl) operator(=) pre_constant(NULL)operator(;) -directive(static) directive(void) -ident(link_undef)operator(()ident(name)operator(,) ident(base)operator(,) ident(reloc)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - pre_type(long) ident(base)operator(;) - reserved(struct) ident(relocation_info) operator(*)ident(reloc)operator(;) -operator({) - directive(static) pre_type(int) ident(u_no) operator(=) integer(0)operator(;) - reserved(struct) ident(undef) operator(*)ident(obj)operator(;) - pre_type(char) operator(*)ident(addr) operator(=) operator(()pre_type(char)operator(*\)()ident(reloc)operator(->)ident(r_address) operator(+) ident(base)operator(\);) - - ident(obj) operator(=) operator(()reserved(struct) ident(undef)operator(*\))ident(xmalloc)operator(()reserved(sizeof)operator(()reserved(struct) ident(undef)operator(\)\);) - ident(obj)operator(->)ident(name) operator(=) ident(strdup)operator(()ident(name)operator(\);) - ident(obj)operator(->)ident(reloc) operator(=) operator(*)ident(reloc)operator(;) - ident(obj)operator(->)ident(base) operator(=) ident(base)operator(;) - reserved(switch) operator(()ident(R_LENGTH)operator(()ident(reloc)operator(\)\)) operator({) - reserved(case) integer(0)operator(:) comment(/* byte */) - ident(obj)operator(->)ident(u)operator(.)ident(c) operator(=) operator(*)ident(addr)operator(;) - reserved(break)operator(;) - reserved(case) integer(1)operator(:) comment(/* word */) - ident(obj)operator(->)ident(u)operator(.)ident(s) operator(=) operator(*()pre_type(short)operator(*\))ident(addr)operator(;) - reserved(break)operator(;) - reserved(case) integer(2)operator(:) comment(/* long */) - ident(obj)operator(->)ident(u)operator(.)ident(l) operator(=) operator(*()pre_type(long)operator(*\))ident(addr)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(reloc_tbl) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(reloc_tbl) operator(=) ident(st_init_numtable)operator((\);) - operator(}) - ident(st_insert)operator(()ident(reloc_tbl)operator(,) ident(u_no)operator(++,) ident(obj)operator(\);) -operator(}) - -reserved(struct) ident(reloc_arg) operator({) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - pre_type(long) ident(value)operator(;) -operator(};) - -directive(static) pre_type(int) -ident(reloc_undef)operator(()ident(no)operator(,) ident(undef)operator(,) ident(arg)operator(\)) - pre_type(int) ident(no)operator(;) - reserved(struct) ident(undef) operator(*)ident(undef)operator(;) - reserved(struct) ident(reloc_arg) operator(*)ident(arg)operator(;) -operator({) - pre_type(int) ident(datum)operator(;) - pre_type(char) operator(*)ident(address)operator(;) -preprocessor(#if) ident(defined)operator(()ident(sun)operator(\)) operator(&&) ident(defined)operator(()ident(sparc)operator(\)) - pre_type(unsigned) pre_type(int) ident(mask) operator(=) integer(0)operator(;) -preprocessor(#endif) - - reserved(if) operator(()ident(strcmp)operator(()ident(arg)operator(->)ident(name)operator(,) ident(undef)operator(->)ident(name)operator(\)) operator(!=) integer(0)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(address) operator(=) operator(()pre_type(char)operator(*\)()ident(undef)operator(->)ident(base) operator(+) ident(undef)operator(->)ident(reloc)operator(.)ident(r_address)operator(\);) - ident(datum) operator(=) ident(arg)operator(->)ident(value)operator(;) - - reserved(if) operator(()ident(R_PCREL)operator((&()ident(undef)operator(->)ident(reloc)operator(\)\)\)) ident(datum) operator(-=) ident(undef)operator(->)ident(base)operator(;) -preprocessor(#if) ident(defined)operator(()ident(sun)operator(\)) operator(&&) ident(defined)operator(()ident(sparc)operator(\)) - ident(datum) operator(+=) ident(undef)operator(->)ident(reloc)operator(.)ident(r_addend)operator(;) - ident(datum) operator(>>=) ident(R_RIGHTSHIFT)operator((&()ident(undef)operator(->)ident(reloc)operator(\)\);) - ident(mask) operator(=) operator(()integer(1) operator(<<) ident(R_BITSIZE)operator((&()ident(undef)operator(->)ident(reloc)operator(\)\)\)) operator(-) integer(1)operator(;) - ident(mask) operator(|=) ident(mask) operator(-)integer(1)operator(;) - ident(datum) operator(&=) ident(mask)operator(;) - reserved(switch) operator(()ident(R_LENGTH)operator((&()ident(undef)operator(->)ident(reloc)operator(\)\)\)) operator({) - reserved(case) integer(0)operator(:) - operator(*)ident(address) operator(=) ident(undef)operator(->)ident(u)operator(.)ident(c)operator(;) - operator(*)ident(address) operator(&=) operator(~)ident(mask)operator(;) - operator(*)ident(address) operator(|=) ident(datum)operator(;) - reserved(break)operator(;) - reserved(case) integer(1)operator(:) - operator(*()pre_type(short) operator(*\))ident(address) operator(=) ident(undef)operator(->)ident(u)operator(.)ident(s)operator(;) - operator(*()pre_type(short) operator(*\))ident(address) operator(&=) operator(~)ident(mask)operator(;) - operator(*()pre_type(short) operator(*\))ident(address) operator(|=) ident(datum)operator(;) - reserved(break)operator(;) - reserved(case) integer(2)operator(:) - operator(*()pre_type(long) operator(*\))ident(address) operator(=) ident(undef)operator(->)ident(u)operator(.)ident(l)operator(;) - operator(*()pre_type(long) operator(*\))ident(address) operator(&=) operator(~)ident(mask)operator(;) - operator(*()pre_type(long) operator(*\))ident(address) operator(|=) ident(datum)operator(;) - reserved(break)operator(;) - operator(}) -preprocessor(#else) - reserved(switch) operator(()ident(R_LENGTH)operator((&()ident(undef)operator(->)ident(reloc)operator(\)\)\)) operator({) - reserved(case) integer(0)operator(:) comment(/* byte */) - reserved(if) operator(()ident(R_MEMORY_SUB)operator((&()ident(undef)operator(->)ident(reloc)operator(\)\)\)) - operator(*)ident(address) operator(=) ident(datum) operator(-) operator(*)ident(address)operator(;) - reserved(else) operator(*)ident(address) operator(=) ident(undef)operator(->)ident(u)operator(.)ident(c) operator(+) ident(datum)operator(;) - reserved(break)operator(;) - reserved(case) integer(1)operator(:) comment(/* word */) - reserved(if) operator(()ident(R_MEMORY_SUB)operator((&()ident(undef)operator(->)ident(reloc)operator(\)\)\)) - operator(*()pre_type(short)operator(*\))ident(address) operator(=) ident(datum) operator(-) operator(*()pre_type(short)operator(*\))ident(address)operator(;) - reserved(else) operator(*()pre_type(short)operator(*\))ident(address) operator(=) ident(undef)operator(->)ident(u)operator(.)ident(s) operator(+) ident(datum)operator(;) - reserved(break)operator(;) - reserved(case) integer(2)operator(:) comment(/* long */) - reserved(if) operator(()ident(R_MEMORY_SUB)operator((&()ident(undef)operator(->)ident(reloc)operator(\)\)\)) - operator(*()pre_type(long)operator(*\))ident(address) operator(=) ident(datum) operator(-) operator(*()pre_type(long)operator(*\))ident(address)operator(;) - reserved(else) operator(*()pre_type(long)operator(*\))ident(address) operator(=) ident(undef)operator(->)ident(u)operator(.)ident(l) operator(+) ident(datum)operator(;) - reserved(break)operator(;) - operator(}) -preprocessor(#endif) - ident(free)operator(()ident(undef)operator(->)ident(name)operator(\);) - ident(free)operator(()ident(undef)operator(\);) - reserved(return) ident(ST_DELETE)operator(;) -operator(}) - -directive(static) directive(void) -ident(unlink_undef)operator(()ident(name)operator(,) ident(value)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - pre_type(long) ident(value)operator(;) -operator({) - reserved(struct) ident(reloc_arg) ident(arg)operator(;) - - ident(arg)operator(.)ident(name) operator(=) ident(name)operator(;) - ident(arg)operator(.)ident(value) operator(=) ident(value)operator(;) - ident(st_foreach)operator(()ident(reloc_tbl)operator(,) ident(reloc_undef)operator(,) operator(&)ident(arg)operator(\);) -operator(}) - -preprocessor(#ifdef) ident(N_INDR) -reserved(struct) ident(indr_data) operator({) - pre_type(char) operator(*)ident(name0)operator(,) operator(*)ident(name1)operator(;) -operator(};) - -directive(static) pre_type(int) -ident(reloc_repl)operator(()ident(no)operator(,) ident(undef)operator(,) ident(data)operator(\)) - pre_type(int) ident(no)operator(;) - reserved(struct) ident(undef) operator(*)ident(undef)operator(;) - reserved(struct) ident(indr_data) operator(*)ident(data)operator(;) -operator({) - reserved(if) operator(()ident(strcmp)operator(()ident(data)operator(->)ident(name0)operator(,) ident(undef)operator(->)ident(name)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(free)operator(()ident(undef)operator(->)ident(name)operator(\);) - ident(undef)operator(->)ident(name) operator(=) ident(strdup)operator(()ident(data)operator(->)ident(name1)operator(\);) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) -preprocessor(#endif) - -directive(static) pre_type(int) -ident(load_1)operator(()ident(fd)operator(,) ident(disp)operator(,) ident(need_init)operator(\)) - pre_type(int) ident(fd)operator(;) - pre_type(long) ident(disp)operator(;) - directive(const) pre_type(char) operator(*)ident(need_init)operator(;) -operator({) - directive(static) pre_type(char) operator(*)ident(libc) operator(=) ident(LIBC_NAME)operator(;) - reserved(struct) ident(exec) ident(hdr)operator(;) - reserved(struct) ident(relocation_info) operator(*)ident(reloc) operator(=) pre_constant(NULL)operator(;) - pre_type(long) ident(block) operator(=) integer(0)operator(;) - pre_type(long) ident(new_common) operator(=) integer(0)operator(;) comment(/* Length of new common */) - reserved(struct) ident(nlist) operator(*)ident(syms) operator(=) pre_constant(NULL)operator(;) - reserved(struct) ident(nlist) operator(*)ident(sym)operator(;) - reserved(struct) ident(nlist) operator(*)ident(end)operator(;) - pre_type(int) ident(init_p) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(load_header)operator(()ident(fd)operator(,) operator(&)ident(hdr)operator(,) ident(disp)operator(\)) operator(==) operator(-)integer(1)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(if) operator(()ident(INVALID_OBJECT)operator(()ident(hdr)operator(\)\)) operator({) - ident(dln_errno) operator(=) ident(DLN_ENOEXEC)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - ident(reloc) operator(=) ident(load_reloc)operator(()ident(fd)operator(,) operator(&)ident(hdr)operator(,) ident(disp)operator(\);) - reserved(if) operator(()ident(reloc) operator(==) pre_constant(NULL)operator(\)) reserved(return) operator(-)integer(1)operator(;) - - ident(syms) operator(=) ident(load_sym)operator(()ident(fd)operator(,) operator(&)ident(hdr)operator(,) ident(disp)operator(\);) - reserved(if) operator(()ident(syms) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(free)operator(()ident(reloc)operator(\);) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - - ident(sym) operator(=) ident(syms)operator(;) - ident(end) operator(=) ident(syms) operator(+) operator(()ident(hdr)operator(.)ident(a_syms) operator(/) reserved(sizeof)operator(()reserved(struct) ident(nlist)operator(\)\);) - reserved(while) operator(()ident(sym) operator(<) ident(end)operator(\)) operator({) - reserved(struct) ident(nlist) operator(*)ident(old_sym)operator(;) - pre_type(int) ident(value) operator(=) ident(sym)operator(->)ident(n_value)operator(;) - -preprocessor(#ifdef) ident(N_INDR) - reserved(if) operator(()ident(sym)operator(->)ident(n_type) operator(==) operator(()ident(N_INDR) operator(|) ident(N_EXT)operator(\)\)) operator({) - pre_type(char) operator(*)ident(key) operator(=) ident(sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(;) - - reserved(if) operator(()ident(st_lookup)operator(()ident(sym_tbl)operator(,) ident(sym)operator([)integer(1)operator(])operator(.)ident(n_un)operator(.)ident(n_name)operator(,) operator(&)ident(old_sym)operator(\)\)) operator({) - reserved(if) operator(()ident(st_delete)operator(()ident(undef_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(key)operator(,) pre_constant(NULL)operator(\)\)) operator({) - ident(unlink_undef)operator(()ident(key)operator(,) ident(old_sym)operator(->)ident(n_value)operator(\);) - ident(free)operator(()ident(key)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - reserved(struct) ident(indr_data) ident(data)operator(;) - - ident(data)operator(.)ident(name0) operator(=) ident(sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(;) - ident(data)operator(.)ident(name1) operator(=) ident(sym)operator([)integer(1)operator(])operator(.)ident(n_un)operator(.)ident(n_name)operator(;) - ident(st_foreach)operator(()ident(reloc_tbl)operator(,) ident(reloc_repl)operator(,) operator(&)ident(data)operator(\);) - - ident(st_insert)operator(()ident(undef_tbl)operator(,) ident(strdup)operator(()ident(sym)operator([)integer(1)operator(])operator(.)ident(n_un)operator(.)ident(n_name)operator(\),) pre_constant(NULL)operator(\);) - reserved(if) operator(()ident(st_delete)operator(()ident(undef_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(key)operator(,) pre_constant(NULL)operator(\)\)) operator({) - ident(free)operator(()ident(key)operator(\);) - operator(}) - operator(}) - ident(sym) operator(+=) integer(2)operator(;) - reserved(continue)operator(;) - operator(}) -preprocessor(#endif) - reserved(if) operator(()ident(sym)operator(->)ident(n_type) operator(==) operator(()ident(N_UNDF) operator(|) ident(N_EXT)operator(\)\)) operator({) - reserved(if) operator(()ident(st_lookup)operator(()ident(sym_tbl)operator(,) ident(sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(,) operator(&)ident(old_sym)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(old_sym) operator(=) pre_constant(NULL)operator(;) - operator(}) - - reserved(if) operator(()ident(value)operator(\)) operator({) - reserved(if) operator(()ident(old_sym)operator(\)) operator({) - ident(sym)operator(->)ident(n_type) operator(=) ident(N_EXT) operator(|) ident(N_COMM)operator(;) - ident(sym)operator(->)ident(n_value) operator(=) ident(old_sym)operator(->)ident(n_value)operator(;) - operator(}) - reserved(else) operator({) - pre_type(int) ident(rnd) operator(=) - ident(value) operator(>=) reserved(sizeof)operator(()pre_type(double)operator(\)) operator(?) reserved(sizeof)operator(()pre_type(double)operator(\)) operator(-) integer(1) - operator(:) ident(value) operator(>=) reserved(sizeof)operator(()pre_type(long)operator(\)) operator(?) reserved(sizeof)operator(()pre_type(long)operator(\)) operator(-) integer(1) - operator(:) reserved(sizeof)operator(()pre_type(short)operator(\)) operator(-) integer(1)operator(;) - - ident(sym)operator(->)ident(n_type) operator(=) ident(N_COMM)operator(;) - ident(new_common) operator(+=) ident(rnd)operator(;) - ident(new_common) operator(&=) operator(~()pre_type(long)operator(\))ident(rnd)operator(;) - ident(sym)operator(->)ident(n_value) operator(=) ident(new_common)operator(;) - ident(new_common) operator(+=) ident(value)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(old_sym)operator(\)) operator({) - ident(sym)operator(->)ident(n_type) operator(=) ident(N_EXT) operator(|) ident(N_COMM)operator(;) - ident(sym)operator(->)ident(n_value) operator(=) ident(old_sym)operator(->)ident(n_value)operator(;) - operator(}) - reserved(else) operator({) - ident(sym)operator(->)ident(n_value) operator(=) operator(()pre_type(long)operator(\))ident(dln_undefined)operator(;) - ident(st_insert)operator(()ident(undef_tbl)operator(,) ident(strdup)operator(()ident(sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(\),) pre_constant(NULL)operator(\);) - operator(}) - operator(}) - operator(}) - ident(sym)operator(++;) - operator(}) - - ident(block) operator(=) ident(load_text_data)operator(()ident(fd)operator(,) operator(&)ident(hdr)operator(,) ident(hdr)operator(.)ident(a_bss) operator(+) ident(new_common)operator(,) ident(disp)operator(\);) - reserved(if) operator(()ident(block) operator(==) integer(0)operator(\)) reserved(goto) ident(err_exit)operator(;) - - ident(sym) operator(=) ident(syms)operator(;) - reserved(while) operator(()ident(sym) operator(<) ident(end)operator(\)) operator({) - reserved(struct) ident(nlist) operator(*)ident(new_sym)operator(;) - pre_type(char) operator(*)ident(key)operator(;) - - reserved(switch) operator(()ident(sym)operator(->)ident(n_type)operator(\)) operator({) - reserved(case) ident(N_COMM)operator(:) - ident(sym)operator(->)ident(n_value) operator(+=) ident(hdr)operator(.)ident(a_text) operator(+) ident(hdr)operator(.)ident(a_data)operator(;) - reserved(case) ident(N_TEXT)operator(|)ident(N_EXT)operator(:) - reserved(case) ident(N_DATA)operator(|)ident(N_EXT)operator(:) - - ident(sym)operator(->)ident(n_value) operator(+=) ident(block)operator(;) - - reserved(if) operator(()ident(st_lookup)operator(()ident(sym_tbl)operator(,) ident(sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(,) operator(&)ident(new_sym)operator(\)) operator(!=) integer(0) - operator(&&) ident(new_sym)operator(->)ident(n_value) operator(!=) operator(()pre_type(long)operator(\))ident(dln_undefined)operator(\)) operator({) - ident(dln_errno) operator(=) ident(DLN_ECONFL)operator(;) - reserved(goto) ident(err_exit)operator(;) - operator(}) - - ident(key) operator(=) ident(sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(;) - reserved(if) operator(()ident(st_delete)operator(()ident(undef_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(key)operator(,) pre_constant(NULL)operator(\)) operator(!=) integer(0)operator(\)) operator({) - ident(unlink_undef)operator(()ident(key)operator(,) ident(sym)operator(->)ident(n_value)operator(\);) - ident(free)operator(()ident(key)operator(\);) - operator(}) - - ident(new_sym) operator(=) operator(()reserved(struct) ident(nlist)operator(*\))ident(xmalloc)operator(()reserved(sizeof)operator(()reserved(struct) ident(nlist)operator(\)\);) - operator(*)ident(new_sym) operator(=) operator(*)ident(sym)operator(;) - ident(new_sym)operator(->)ident(n_un)operator(.)ident(n_name) operator(=) ident(strdup)operator(()ident(sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(\);) - ident(st_insert)operator(()ident(sym_tbl)operator(,) ident(new_sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(,) ident(new_sym)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(N_TEXT)operator(:) - reserved(case) ident(N_DATA)operator(:) - ident(sym)operator(->)ident(n_value) operator(+=) ident(block)operator(;) - reserved(break)operator(;) - operator(}) - ident(sym)operator(++;) - operator(}) - - comment(/* - * First comes the text-relocation - */) - operator({) - reserved(struct) ident(relocation_info) operator(*) ident(rel) operator(=) ident(reloc)operator(;) - reserved(struct) ident(relocation_info) operator(*) ident(rel_beg) operator(=) ident(reloc) operator(+) - operator(()ident(hdr)operator(.)ident(a_trsize)operator(/)reserved(sizeof)operator(()reserved(struct) ident(relocation_info)operator(\)\);) - reserved(struct) ident(relocation_info) operator(*) ident(rel_end) operator(=) ident(reloc) operator(+) - operator(()ident(hdr)operator(.)ident(a_trsize)operator(+)ident(hdr)operator(.)ident(a_drsize)operator(\))operator(/)reserved(sizeof)operator(()reserved(struct) ident(relocation_info)operator(\);) - - reserved(while) operator(()ident(rel) operator(<) ident(rel_end)operator(\)) operator({) - pre_type(char) operator(*)ident(address) operator(=) operator(()pre_type(char)operator(*\)()ident(rel)operator(->)ident(r_address) operator(+) ident(block)operator(\);) - pre_type(long) ident(datum) operator(=) integer(0)operator(;) -preprocessor(#if) ident(defined)operator(()ident(sun)operator(\)) operator(&&) ident(defined)operator(()ident(sparc)operator(\)) - pre_type(unsigned) pre_type(int) ident(mask) operator(=) integer(0)operator(;) -preprocessor(#endif) - - reserved(if)operator(()ident(rel) operator(>=) ident(rel_beg)operator(\)) - ident(address) operator(+=) ident(hdr)operator(.)ident(a_text)operator(;) - - reserved(if) operator(()ident(rel)operator(->)ident(r_extern)operator(\)) operator({) comment(/* Look it up in symbol-table */) - ident(sym) operator(=) operator(&()ident(syms)operator([)ident(R_SYMBOL)operator(()ident(rel)operator(\)]\);) - reserved(switch) operator(()ident(sym)operator(->)ident(n_type)operator(\)) operator({) - reserved(case) ident(N_EXT)operator(|)ident(N_UNDF)operator(:) - ident(link_undef)operator(()ident(sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(,) ident(block)operator(,) ident(rel)operator(\);) - reserved(case) ident(N_EXT)operator(|)ident(N_COMM)operator(:) - reserved(case) ident(N_COMM)operator(:) - ident(datum) operator(=) ident(sym)operator(->)ident(n_value)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(goto) ident(err_exit)operator(;) - operator(}) - operator(}) comment(/* end.. look it up */) - reserved(else) operator({) comment(/* is static */) - reserved(switch) operator(()ident(R_SYMBOL)operator(()ident(rel)operator(\)\)) operator({) - reserved(case) ident(N_TEXT)operator(:) - reserved(case) ident(N_DATA)operator(:) - ident(datum) operator(=) ident(block)operator(;) - reserved(break)operator(;) - reserved(case) ident(N_BSS)operator(:) - ident(datum) operator(=) ident(block) operator(+) ident(new_common)operator(;) - reserved(break)operator(;) - reserved(case) ident(N_ABS)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) comment(/* end .. is static */) - reserved(if) operator(()ident(R_PCREL)operator(()ident(rel)operator(\)\)) ident(datum) operator(-=) ident(block)operator(;) - -preprocessor(#if) ident(defined)operator(()ident(sun)operator(\)) operator(&&) ident(defined)operator(()ident(sparc)operator(\)) - ident(datum) operator(+=) ident(rel)operator(->)ident(r_addend)operator(;) - ident(datum) operator(>>=) ident(R_RIGHTSHIFT)operator(()ident(rel)operator(\);) - ident(mask) operator(=) operator(()integer(1) operator(<<) ident(R_BITSIZE)operator(()ident(rel)operator(\)\)) operator(-) integer(1)operator(;) - ident(mask) operator(|=) ident(mask) operator(-)integer(1)operator(;) - ident(datum) operator(&=) ident(mask)operator(;) - - reserved(switch) operator(()ident(R_LENGTH)operator(()ident(rel)operator(\)\)) operator({) - reserved(case) integer(0)operator(:) - operator(*)ident(address) operator(&=) operator(~)ident(mask)operator(;) - operator(*)ident(address) operator(|=) ident(datum)operator(;) - reserved(break)operator(;) - reserved(case) integer(1)operator(:) - operator(*()pre_type(short) operator(*\))ident(address) operator(&=) operator(~)ident(mask)operator(;) - operator(*()pre_type(short) operator(*\))ident(address) operator(|=) ident(datum)operator(;) - reserved(break)operator(;) - reserved(case) integer(2)operator(:) - operator(*()pre_type(long) operator(*\))ident(address) operator(&=) operator(~)ident(mask)operator(;) - operator(*()pre_type(long) operator(*\))ident(address) operator(|=) ident(datum)operator(;) - reserved(break)operator(;) - operator(}) -preprocessor(#else) - reserved(switch) operator(()ident(R_LENGTH)operator(()ident(rel)operator(\)\)) operator({) - reserved(case) integer(0)operator(:) comment(/* byte */) - reserved(if) operator(()ident(datum) operator(<) operator(-)integer(128) operator(||) ident(datum) operator(>) integer(127)operator(\)) reserved(goto) ident(err_exit)operator(;) - operator(*)ident(address) operator(+=) ident(datum)operator(;) - reserved(break)operator(;) - reserved(case) integer(1)operator(:) comment(/* word */) - operator(*()pre_type(short) operator(*\))ident(address) operator(+=) ident(datum)operator(;) - reserved(break)operator(;) - reserved(case) integer(2)operator(:) comment(/* long */) - operator(*()pre_type(long) operator(*\))ident(address) operator(+=) ident(datum)operator(;) - reserved(break)operator(;) - operator(}) -preprocessor(#endif) - ident(rel)operator(++;) - operator(}) - operator(}) - - reserved(if) operator(()ident(need_init)operator(\)) operator({) - pre_type(int) ident(len)operator(;) - pre_type(char) operator(**)ident(libs_to_be_linked) operator(=) integer(0)operator(;) - pre_type(char) operator(*)ident(buf)operator(;) - - reserved(if) operator(()ident(undef_tbl)operator(->)ident(num_entries) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(load_lib)operator(()ident(libc)operator(\)) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(err_exit)operator(;) - operator(}) - - ident(init_funcname)operator((&)ident(buf)operator(,) ident(need_init)operator(\);) - ident(len) operator(=) ident(strlen)operator(()ident(buf)operator(\);) - - reserved(for) operator(()ident(sym) operator(=) ident(syms)operator(;) ident(sym)operator(<)ident(end)operator(;) ident(sym)operator(++\)) operator({) - pre_type(char) operator(*)ident(name) operator(=) ident(sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(;) - reserved(if) operator(()ident(name)operator([)integer(0)operator(]) operator(==) char('_') operator(&&) ident(sym)operator(->)ident(n_value) operator(>=) ident(block)operator(\)) operator({) - reserved(if) operator(()ident(strcmp)operator(()ident(name)operator(+)integer(1)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) operator({) - ident(libs_to_be_linked) operator(=) operator(()pre_type(char)operator(**\))ident(sym)operator(->)ident(n_value)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(strcmp)operator(()ident(name)operator(+)integer(1)operator(,) ident(buf)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(init_p) operator(=) integer(1)operator(;) - operator((()pre_type(int) operator((*\)(\)\))ident(sym)operator(->)ident(n_value)operator(\)(\);) - operator(}) - operator(}) - operator(}) - reserved(if) operator(()ident(libs_to_be_linked) operator(&&) ident(undef_tbl)operator(->)ident(num_entries) operator(>) integer(0)operator(\)) operator({) - reserved(while) operator((*)ident(libs_to_be_linked)operator(\)) operator({) - ident(load_lib)operator((*)ident(libs_to_be_linked)operator(\);) - ident(libs_to_be_linked)operator(++;) - operator(}) - operator(}) - operator(}) - ident(free)operator(()ident(reloc)operator(\);) - ident(free)operator(()ident(syms)operator(\);) - reserved(if) operator(()ident(need_init)operator(\)) operator({) - reserved(if) operator(()ident(init_p) operator(==) integer(0)operator(\)) operator({) - ident(dln_errno) operator(=) ident(DLN_ENOINIT)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(undef_tbl)operator(->)ident(num_entries) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(load_lib)operator(()ident(libc)operator(\)) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(err_exit)operator(;) - reserved(if) operator(()ident(undef_tbl)operator(->)ident(num_entries) operator(>) integer(0)operator(\)) operator({) - ident(dln_errno) operator(=) ident(DLN_EUNDEF)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - operator(}) - operator(}) - reserved(return) integer(0)operator(;) - - label(err_exit:) - reserved(if) operator(()ident(syms)operator(\)) ident(free)operator(()ident(syms)operator(\);) - reserved(if) operator(()ident(reloc)operator(\)) ident(free)operator(()ident(reloc)operator(\);) - reserved(if) operator(()ident(block)operator(\)) ident(free)operator((()pre_type(char)operator(*\))ident(block)operator(\);) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - -directive(static) pre_type(int) ident(target_offset)operator(;) -directive(static) pre_type(int) -ident(search_undef)operator(()ident(key)operator(,) ident(value)operator(,) ident(lib_tbl)operator(\)) - directive(const) pre_type(char) operator(*)ident(key)operator(;) - pre_type(int) ident(value)operator(;) - ident(st_table) operator(*)ident(lib_tbl)operator(;) -operator({) - pre_type(long) ident(offset)operator(;) - - reserved(if) operator(()ident(st_lookup)operator(()ident(lib_tbl)operator(,) ident(key)operator(,) operator(&)ident(offset)operator(\)) operator(==) integer(0)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(target_offset) operator(=) ident(offset)operator(;) - reserved(return) ident(ST_STOP)operator(;) -operator(}) - -reserved(struct) ident(symdef) operator({) - pre_type(int) ident(rb_str_index)operator(;) - pre_type(int) ident(lib_offset)operator(;) -operator(};) - -pre_type(char) operator(*)ident(dln_librrb_ary_path) operator(=) ident(DLN_DEFAULT_LIB_PATH)operator(;) - -directive(static) pre_type(int) -ident(load_lib)operator(()ident(lib)operator(\)) - directive(const) pre_type(char) operator(*)ident(lib)operator(;) -operator({) - pre_type(char) operator(*)ident(path)operator(,) operator(*)ident(file)operator(;) - pre_type(char) ident(armagic)operator([)ident(SARMAG)operator(];) - pre_type(int) ident(fd)operator(,) ident(size)operator(;) - reserved(struct) ident(ar_hdr) ident(ahdr)operator(;) - ident(st_table) operator(*)ident(lib_tbl) operator(=) pre_constant(NULL)operator(;) - pre_type(int) operator(*)ident(data)operator(,) ident(nsym)operator(;) - reserved(struct) ident(symdef) operator(*)ident(base)operator(;) - pre_type(char) operator(*)ident(name_base)operator(;) - - reserved(if) operator(()ident(dln_init_p) operator(==) integer(0)operator(\)) operator({) - ident(dln_errno) operator(=) ident(DLN_ENOINIT)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - - reserved(if) operator(()ident(undef_tbl)operator(->)ident(num_entries) operator(==) integer(0)operator(\)) reserved(return) integer(0)operator(;) - ident(dln_errno) operator(=) ident(DLN_EBADLIB)operator(;) - - reserved(if) operator(()ident(lib)operator([)integer(0)operator(]) operator(==) char('-') operator(&&) ident(lib)operator([)integer(1)operator(]) operator(==) char('l')operator(\)) operator({) - pre_type(long) ident(len) operator(=) ident(strlen)operator(()ident(lib)operator(\)) operator(+) integer(4)operator(;) - pre_type(char) operator(*)ident(p) operator(=) ident(alloca)operator(()ident(len)operator(\);) - ident(snprintf)operator(()ident(p)operator(,) ident(len)operator(,) stringoperator(,) ident(lib)operator(+)integer(2)operator(\);) - ident(lib) operator(=) ident(p)operator(;) - operator(}) - - comment(/* library search path: */) - comment(/* look for environment variable DLN_LIBRARY_PATH first. */) - comment(/* then variable dln_librrb_ary_path. */) - comment(/* if path is still NULL, use "." for path. */) - ident(path) operator(=) ident(getenv)operator(()stringoperator(\);) - reserved(if) operator(()ident(path) operator(==) pre_constant(NULL)operator(\)) ident(path) operator(=) ident(dln_librrb_ary_path)operator(;) - - ident(file) operator(=) ident(dln_find_file)operator(()ident(lib)operator(,) ident(path)operator(\);) - ident(fd) operator(=) ident(open)operator(()ident(file)operator(,) ident(O_RDONLY)operator(\);) - reserved(if) operator(()ident(fd) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(syserr)operator(;) - ident(size) operator(=) ident(read)operator(()ident(fd)operator(,) ident(armagic)operator(,) ident(SARMAG)operator(\);) - reserved(if) operator(()ident(size) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(syserr)operator(;) - - reserved(if) operator(()ident(size) operator(!=) ident(SARMAG)operator(\)) operator({) - ident(dln_errno) operator(=) ident(DLN_ENOTLIB)operator(;) - reserved(goto) ident(badlib)operator(;) - operator(}) - ident(size) operator(=) ident(read)operator(()ident(fd)operator(,) operator(&)ident(ahdr)operator(,) reserved(sizeof)operator(()ident(ahdr)operator(\)\);) - reserved(if) operator(()ident(size) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(syserr)operator(;) - reserved(if) operator(()ident(size) operator(!=) reserved(sizeof)operator(()ident(ahdr)operator(\)) operator(||) ident(sscanf)operator(()ident(ahdr)operator(.)ident(ar_size)operator(,) stringoperator(,) operator(&)ident(size)operator(\)) operator(!=) integer(1)operator(\)) operator({) - reserved(goto) ident(badlib)operator(;) - operator(}) - - reserved(if) operator(()ident(strncmp)operator(()ident(ahdr)operator(.)ident(ar_name)operator(,) stringoperator(,) integer(9)operator(\)) operator(==) integer(0)operator(\)) operator({) - comment(/* make hash table from __.SYMDEF */) - - ident(lib_tbl) operator(=) ident(st_init_strtable)operator((\);) - ident(data) operator(=) operator(()pre_type(int)operator(*\))ident(xmalloc)operator(()ident(size)operator(\);) - reserved(if) operator(()ident(data) operator(==) pre_constant(NULL)operator(\)) reserved(goto) ident(syserr)operator(;) - ident(size) operator(=) ident(read)operator(()ident(fd)operator(,) ident(data)operator(,) ident(size)operator(\);) - ident(nsym) operator(=) operator(*)ident(data) operator(/) reserved(sizeof)operator(()reserved(struct) ident(symdef)operator(\);) - ident(base) operator(=) operator(()reserved(struct) ident(symdef)operator(*\)()ident(data) operator(+) integer(1)operator(\);) - ident(name_base) operator(=) operator(()pre_type(char)operator(*\)()ident(base) operator(+) ident(nsym)operator(\)) operator(+) reserved(sizeof)operator(()pre_type(int)operator(\);) - reserved(while) operator(()ident(nsym) operator(>) integer(0)operator(\)) operator({) - pre_type(char) operator(*)ident(name) operator(=) ident(name_base) operator(+) ident(base)operator(->)ident(rb_str_index)operator(;) - - ident(st_insert)operator(()ident(lib_tbl)operator(,) ident(name)operator(,) ident(base)operator(->)ident(lib_offset) operator(+) reserved(sizeof)operator(()ident(ahdr)operator(\)\);) - ident(nsym)operator(--;) - ident(base)operator(++;) - operator(}) - reserved(for) operator((;;\)) operator({) - ident(target_offset) operator(=) operator(-)integer(1)operator(;) - ident(st_foreach)operator(()ident(undef_tbl)operator(,) ident(search_undef)operator(,) ident(lib_tbl)operator(\);) - reserved(if) operator(()ident(target_offset) operator(==) operator(-)integer(1)operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(load_1)operator(()ident(fd)operator(,) ident(target_offset)operator(,) integer(0)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(st_free_table)operator(()ident(lib_tbl)operator(\);) - ident(free)operator(()ident(data)operator(\);) - reserved(goto) ident(badlib)operator(;) - operator(}) - reserved(if) operator(()ident(undef_tbl)operator(->)ident(num_entries) operator(==) integer(0)operator(\)) reserved(break)operator(;) - operator(}) - ident(free)operator(()ident(data)operator(\);) - ident(st_free_table)operator(()ident(lib_tbl)operator(\);) - operator(}) - reserved(else) operator({) - comment(/* linear library, need to scan (FUTURE\) */) - - reserved(for) operator((;;\)) operator({) - pre_type(int) ident(offset) operator(=) ident(SARMAG)operator(;) - pre_type(int) ident(found) operator(=) integer(0)operator(;) - reserved(struct) ident(exec) ident(hdr)operator(;) - reserved(struct) ident(nlist) operator(*)ident(syms)operator(,) operator(*)ident(sym)operator(,) operator(*)ident(end)operator(;) - - reserved(while) operator(()ident(undef_tbl)operator(->)ident(num_entries) operator(>) integer(0)operator(\)) operator({) - ident(found) operator(=) integer(0)operator(;) - ident(lseek)operator(()ident(fd)operator(,) ident(offset)operator(,) integer(0)operator(\);) - ident(size) operator(=) ident(read)operator(()ident(fd)operator(,) operator(&)ident(ahdr)operator(,) reserved(sizeof)operator(()ident(ahdr)operator(\)\);) - reserved(if) operator(()ident(size) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(syserr)operator(;) - reserved(if) operator(()ident(size) operator(==) integer(0)operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(size) operator(!=) reserved(sizeof)operator(()ident(ahdr)operator(\)) - operator(||) ident(sscanf)operator(()ident(ahdr)operator(.)ident(ar_size)operator(,) stringoperator(,) operator(&)ident(size)operator(\)) operator(!=) integer(1)operator(\)) operator({) - reserved(goto) ident(badlib)operator(;) - operator(}) - ident(offset) operator(+=) reserved(sizeof)operator(()ident(ahdr)operator(\);) - reserved(if) operator(()ident(load_header)operator(()ident(fd)operator(,) operator(&)ident(hdr)operator(,) ident(offset)operator(\)) operator(==) operator(-)integer(1)operator(\)) - reserved(goto) ident(badlib)operator(;) - ident(syms) operator(=) ident(load_sym)operator(()ident(fd)operator(,) operator(&)ident(hdr)operator(,) ident(offset)operator(\);) - reserved(if) operator(()ident(syms) operator(==) pre_constant(NULL)operator(\)) reserved(goto) ident(badlib)operator(;) - ident(sym) operator(=) ident(syms)operator(;) - ident(end) operator(=) ident(syms) operator(+) operator(()ident(hdr)operator(.)ident(a_syms) operator(/) reserved(sizeof)operator(()reserved(struct) ident(nlist)operator(\)\);) - reserved(while) operator(()ident(sym) operator(<) ident(end)operator(\)) operator({) - reserved(if) operator(()ident(sym)operator(->)ident(n_type) operator(==) ident(N_EXT)operator(|)ident(N_TEXT) - operator(&&) ident(st_lookup)operator(()ident(undef_tbl)operator(,) ident(sym)operator(->)ident(n_un)operator(.)ident(n_name)operator(,) pre_constant(NULL)operator(\)\)) operator({) - reserved(break)operator(;) - operator(}) - ident(sym)operator(++;) - operator(}) - reserved(if) operator(()ident(sym) operator(<) ident(end)operator(\)) operator({) - ident(found)operator(++;) - ident(free)operator(()ident(syms)operator(\);) - reserved(if) operator(()ident(load_1)operator(()ident(fd)operator(,) ident(offset)operator(,) integer(0)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - reserved(goto) ident(badlib)operator(;) - operator(}) - operator(}) - ident(offset) operator(+=) ident(size)operator(;) - reserved(if) operator(()ident(offset) operator(&) integer(1)operator(\)) ident(offset)operator(++;) - operator(}) - reserved(if) operator(()ident(found)operator(\)) reserved(break)operator(;) - operator(}) - operator(}) - ident(close)operator(()ident(fd)operator(\);) - reserved(return) integer(0)operator(;) - - label(syserr:) - ident(dln_errno) operator(=) ident(errno)operator(;) - label(badlib:) - reserved(if) operator(()ident(fd) operator(>=) integer(0)operator(\)) ident(close)operator(()ident(fd)operator(\);) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(load)operator(()ident(file)operator(\)) - directive(const) pre_type(char) operator(*)ident(file)operator(;) -operator({) - pre_type(int) ident(fd)operator(;) - pre_type(int) ident(result)operator(;) - - reserved(if) operator(()ident(dln_init_p) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(dln_init)operator(()ident(dln_argv0)operator(\)) operator(==) operator(-)integer(1)operator(\)) reserved(return) operator(-)integer(1)operator(;) - operator(}) - ident(result) operator(=) ident(strlen)operator(()ident(file)operator(\);) - reserved(if) operator(()ident(file)operator([)ident(result)operator(-)integer(1)operator(]) operator(==) char('a')operator(\)) operator({) - reserved(return) ident(load_lib)operator(()ident(file)operator(\);) - operator(}) - - ident(fd) operator(=) ident(open)operator(()ident(file)operator(,) ident(O_RDONLY)operator(\);) - reserved(if) operator(()ident(fd) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(dln_errno) operator(=) ident(errno)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - ident(result) operator(=) ident(load_1)operator(()ident(fd)operator(,) integer(0)operator(,) ident(file)operator(\);) - ident(close)operator(()ident(fd)operator(\);) - - reserved(return) ident(result)operator(;) -operator(}) - -directive(void)operator(*) -ident(dln_sym)operator(()ident(name)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - reserved(struct) ident(nlist) operator(*)ident(sym)operator(;) - - reserved(if) operator(()ident(st_lookup)operator(()ident(sym_tbl)operator(,) ident(name)operator(,) operator(&)ident(sym)operator(\)\)) - reserved(return) operator(()directive(void)operator(*\))ident(sym)operator(->)ident(n_value)operator(;) - reserved(return) pre_constant(NULL)operator(;) -operator(}) - -preprocessor(#endif) comment(/* USE_DLN_A_OUT */) - -preprocessor(#ifdef) ident(USE_DLN_DLOPEN) -preprocessor(# if) ident(defined)operator(()ident(__NetBSD__)operator(\)) operator(&&) ident(defined)operator(()ident(__NetBSD_Version__)operator(\)) operator(&&) ident(__NetBSD_Version__) operator(<) integer(105000000) -preprocessor(# include) include() -preprocessor(# include) include() -preprocessor(# else) -preprocessor(# include) include() -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#ifdef) ident(__hpux) -preprocessor(#include) include() -preprocessor(#include) include("dl.h") -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(_AIX)operator(\)) -preprocessor(#include) include() comment(/* for isdigit(\) */) -preprocessor(#include) include() comment(/* for global errno */) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(NeXT) -preprocessor(#if) ident(NS_TARGET_MAJOR) operator(<) integer(4) -preprocessor(#include) include() -preprocessor(#else) -preprocessor(#include) include() -preprocessor(#ifndef) ident(NSLINKMODULE_OPTION_BINDNOW) -preprocessor(#define) ident(NSLINKMODULE_OPTION_BINDNOW) integer(1) -preprocessor(#endif) -preprocessor(#endif) -preprocessor(#else) -preprocessor(#ifdef) ident(__APPLE__) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(_WIN32) operator(&&) operator(!)ident(defined) ident(__CYGWIN__) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(_WIN32_WCE) -preprocessor(#undef) ident(FormatMessage) -preprocessor(#define) ident(FormatMessage) ident(FormatMessageA) -preprocessor(#undef) ident(LoadLibrary) -preprocessor(#define) ident(LoadLibrary) ident(LoadLibraryA) -preprocessor(#undef) ident(GetProcAddress) -preprocessor(#define) ident(GetProcAddress) ident(GetProcAddressA) -preprocessor(#endif) - -directive(static) directive(const) pre_type(char) operator(*) -ident(dln_strerror)operator((\)) -operator({) -preprocessor(#ifdef) ident(USE_DLN_A_OUT) - pre_type(char) operator(*)ident(strerror)operator((\);) - - reserved(switch) operator(()ident(dln_errno)operator(\)) operator({) - reserved(case) ident(DLN_ECONFL)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(DLN_ENOINIT)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(DLN_EUNDEF)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(DLN_ENOTLIB)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(DLN_EBADLIB)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(DLN_EINIT)operator(:) - reserved(return) stringoperator(;) - reserved(default)operator(:) - reserved(return) ident(strerror)operator(()ident(dln_errno)operator(\);) - operator(}) -preprocessor(#endif) - -preprocessor(#ifdef) ident(USE_DLN_DLOPEN) - reserved(return) operator(()pre_type(char)operator(*\))ident(dlerror)operator((\);) -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(_WIN32) operator(&&) operator(!)ident(defined) ident(__CYGWIN__) - directive(static) pre_type(char) ident(message)operator([)integer(1024)operator(];) - pre_type(int) ident(error) operator(=) ident(GetLastError)operator((\);) - pre_type(char) operator(*)ident(p) operator(=) ident(message)operator(;) - ident(p) operator(+=) ident(sprintf)operator(()ident(message)operator(,) stringoperator(,) ident(error)operator(\);) - ident(FormatMessage)operator(() - ident(FORMAT_MESSAGE_FROM_SYSTEM) operator(|) ident(FORMAT_MESSAGE_IGNORE_INSERTS)operator(,) - pre_constant(NULL)operator(,) - ident(error)operator(,) - ident(MAKELANGID)operator(()ident(LANG_NEUTRAL)operator(,) ident(SUBLANG_DEFAULT)operator(\),) - ident(p)operator(,) - reserved(sizeof) ident(message) operator(-) ident(strlen)operator(()ident(message)operator(\),) - pre_constant(NULL)operator(\);) - - reserved(for) operator(()ident(p) operator(=) ident(message)operator(;) operator(*)ident(p)operator(;) ident(p)operator(++\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('\\n') operator(||) operator(*)ident(p) operator(==) char('\\r')operator(\)) - operator(*)ident(p) operator(=) char(' ')operator(;) - operator(}) - reserved(return) ident(message)operator(;) -preprocessor(#endif) -operator(}) - - -preprocessor(#if) ident(defined)operator(()ident(_AIX)operator(\)) operator(&&) operator(!) ident(defined)operator(()ident(_IA64)operator(\)) -directive(static) directive(void) -ident(aix_loaderror)operator(()directive(const) pre_type(char) operator(*)ident(pathname)operator(\)) -operator({) - pre_type(char) operator(*)ident(message)operator([)integer(8)operator(],) ident(errbuf)operator([)integer(1024)operator(];) - pre_type(int) ident(i)operator(,)ident(j)operator(;) - - reserved(struct) ident(errtab) operator({) - pre_type(int) ident(errnum)operator(;) - pre_type(char) operator(*)ident(errstr)operator(;) - operator(}) ident(load_errtab)operator([]) operator(=) operator({) - operator({)ident(L_ERROR_TOOMANY)operator(,) stringoperator(},) - operator({)ident(L_ERROR_NOLIB)operator(,) stringoperator(},) - operator({)ident(L_ERROR_UNDEF)operator(,) stringoperator(},) - operator({)ident(L_ERROR_RLDBAD)operator(,) - stringoperator(},) - operator({)ident(L_ERROR_FORMAT)operator(,) stringoperator(},) - operator({)ident(L_ERROR_MEMBER)operator(,) - stringoperator(},) - operator({)ident(L_ERROR_TYPE)operator(,) stringoperator(},) - operator({)ident(L_ERROR_ALIGN)operator(,) stringoperator(},) - operator({)ident(L_ERROR_SYSTEM)operator(,) stringoperator(},) - operator({)ident(L_ERROR_ERRNO)operator(,) pre_constant(NULL)operator(}) - operator(};) - -preprocessor(#define) ident(LOAD_ERRTAB_LEN) operator(()reserved(sizeof)operator(()ident(load_errtab)operator(\))operator(/)reserved(sizeof)operator(()ident(load_errtab)operator([)integer(0)operator(]\)\)) -preprocessor(#define) ident(ERRBUF_APPEND)operator(()ident(s)operator(\)) ident(strncat)operator(()ident(errbuf)operator(,) ident(s)operator(,) reserved(sizeof)operator(()ident(errbuf)operator(\)-)ident(strlen)operator(()ident(errbuf)operator(\)-)integer(1)operator(\)) - - ident(snprintf)operator(()ident(errbuf)operator(,) integer(1024)operator(,) stringoperator(,) ident(pathname)operator(\);) - - reserved(if) operator((!)ident(loadquery)operator(()integer(1)operator(,) operator(&)ident(message)operator([)integer(0)operator(],) reserved(sizeof)operator(()ident(message)operator(\)\)\)) - ident(ERRBUF_APPEND)operator(()ident(strerror)operator(()ident(errno)operator(\)\);) - reserved(for)operator(()ident(i) operator(=) integer(0)operator(;) ident(message)operator([)ident(i)operator(]) operator(&&) operator(*)ident(message)operator([)ident(i)operator(];) ident(i)operator(++\)) operator({) - pre_type(int) ident(nerr) operator(=) ident(atoi)operator(()ident(message)operator([)ident(i)operator(]\);) - reserved(for) operator(()ident(j)operator(=)integer(0)operator(;) ident(j)operator(<)ident(LOAD_ERRTAB_LEN)operator(;) ident(j)operator(++\)) operator({) - reserved(if) operator(()ident(nerr) operator(==) ident(load_errtab)operator([)ident(i)operator(])operator(.)ident(errnum) operator(&&) ident(load_errtab)operator([)ident(i)operator(])operator(.)ident(errstr)operator(\)) - ident(ERRBUF_APPEND)operator(()ident(load_errtab)operator([)ident(i)operator(])operator(.)ident(errstr)operator(\);) - operator(}) - reserved(while) operator(()ident(isdigit)operator((*)ident(message)operator([)ident(i)operator(]\)\)) ident(message)operator([)ident(i)operator(]++;) - ident(ERRBUF_APPEND)operator(()ident(message)operator([)ident(i)operator(]\);) - ident(ERRBUF_APPEND)operator(()stringoperator(\);) - operator(}) - ident(errbuf)operator([)ident(strlen)operator(()ident(errbuf)operator(\)-)integer(1)operator(]) operator(=) char('\\0')operator(;) comment(/* trim off last newline */) - ident(rb_loaderror)operator(()ident(errbuf)operator(\);) - reserved(return)operator(;) -operator(}) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__VMS)operator(\)) -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -directive(static) pre_type(char) operator(*)ident(vms_filespec)operator(;) -directive(static) pre_type(int) ident(vms_fileact)operator(()pre_type(char) operator(*)ident(filespec)operator(,) pre_type(int) ident(type)operator(\);) -directive(static) pre_type(long) ident(vms_fisexh)operator(()pre_type(long) operator(*)ident(sigarr)operator(,) pre_type(long) operator(*)ident(mecarr)operator(\);) -preprocessor(#endif) - -preprocessor(#endif) comment(/* NO_DLN_LOAD */) - -directive(void)operator(*) -ident(dln_load)operator(()ident(file)operator(\)) - directive(const) pre_type(char) operator(*)ident(file)operator(;) -operator({) -preprocessor(#ifdef) ident(NO_DLN_LOAD) - ident(rb_raise)operator(()ident(rb_eLoadError)operator(,) stringoperator(\);) -preprocessor(#else) - -preprocessor(#if) operator(!)ident(defined)operator(()ident(_AIX)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(NeXT)operator(\)) - directive(const) pre_type(char) operator(*)ident(error) operator(=) integer(0)operator(;) -preprocessor(#define) ident(DLN_ERROR)operator((\)) operator(()ident(error) operator(=) ident(dln_strerror)operator((\),) ident(strcpy)operator(()ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(strlen)operator(()ident(error)operator(\)) operator(+) integer(1)operator(\),) ident(error)operator(\)\)) -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(_WIN32) operator(&&) operator(!)ident(defined) ident(__CYGWIN__) - ident(HINSTANCE) ident(handle)operator(;) - pre_type(char) ident(winfile)operator([)ident(MAXPATHLEN)operator(];) - directive(void) operator((*)ident(init_fct)operator(\)(\);) - pre_type(char) operator(*)ident(buf)operator(;) - - reserved(if) operator(()ident(strlen)operator(()ident(file)operator(\)) operator(>=) ident(MAXPATHLEN)operator(\)) ident(rb_loaderror)operator(()stringoperator(\);) - - comment(/* Load the file as an object one */) - ident(init_funcname)operator((&)ident(buf)operator(,) ident(file)operator(\);) - - ident(strcpy)operator(()ident(winfile)operator(,) ident(file)operator(\);) - - comment(/* Load file */) - reserved(if) operator((()ident(handle) operator(=) ident(LoadLibrary)operator(()ident(winfile)operator(\)\)) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(error) operator(=) ident(dln_strerror)operator((\);) - reserved(goto) ident(failed)operator(;) - operator(}) - - reserved(if) operator((()ident(init_fct) operator(=) operator(()directive(void)operator((*\)(\)\))ident(GetProcAddress)operator(()ident(handle)operator(,) ident(buf)operator(\)\)) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(rb_loaderror)operator(()stringoperator(,) ident(dln_strerror)operator((\),) ident(buf)operator(,) ident(file)operator(\);) - operator(}) - - comment(/* Call the init code */) - operator((*)ident(init_fct)operator(\)(\);) - reserved(return) ident(handle)operator(;) -preprocessor(#else) -preprocessor(#ifdef) ident(USE_DLN_A_OUT) - reserved(if) operator(()ident(load)operator(()ident(file)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(error) operator(=) ident(dln_strerror)operator((\);) - reserved(goto) ident(failed)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -preprocessor(#else) - - pre_type(char) operator(*)ident(buf)operator(;) - comment(/* Load the file as an object one */) - ident(init_funcname)operator((&)ident(buf)operator(,) ident(file)operator(\);) - -preprocessor(#ifdef) ident(USE_DLN_DLOPEN) -preprocessor(#define) ident(DLN_DEFINED) - operator({) - directive(void) operator(*)ident(handle)operator(;) - directive(void) operator((*)ident(init_fct)operator(\)(\);) - -preprocessor(#ifndef) ident(RTLD_LAZY) -preprocessor(# define) ident(RTLD_LAZY) integer(1) -preprocessor(#endif) -preprocessor(#ifdef) ident(__INTERIX) -preprocessor(# undef) ident(RTLD_GLOBAL) -preprocessor(#endif) -preprocessor(#ifndef) ident(RTLD_GLOBAL) -preprocessor(# define) ident(RTLD_GLOBAL) integer(0) -preprocessor(#endif) - - comment(/* Load file */) - reserved(if) operator((()ident(handle) operator(=) operator(()directive(void)operator(*\))ident(dlopen)operator(()ident(file)operator(,) ident(RTLD_LAZY)operator(|)ident(RTLD_GLOBAL)operator(\)\)) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(error) operator(=) ident(dln_strerror)operator((\);) - reserved(goto) ident(failed)operator(;) - operator(}) - - ident(init_fct) operator(=) operator(()directive(void)operator((*\)(\)\))ident(dlsym)operator(()ident(handle)operator(,) ident(buf)operator(\);) - reserved(if) operator(()ident(init_fct) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(error) operator(=) ident(DLN_ERROR)operator((\);) - ident(dlclose)operator(()ident(handle)operator(\);) - reserved(goto) ident(failed)operator(;) - operator(}) - comment(/* Call the init code */) - operator((*)ident(init_fct)operator(\)(\);) - - reserved(return) ident(handle)operator(;) - operator(}) -preprocessor(#endif) comment(/* USE_DLN_DLOPEN */) - -preprocessor(#ifdef) ident(__hpux) -preprocessor(#define) ident(DLN_DEFINED) - operator({) - ident(shl_t) ident(lib) operator(=) pre_constant(NULL)operator(;) - pre_type(int) ident(flags)operator(;) - directive(void) operator((*)ident(init_fct)operator(\)(\);) - - ident(flags) operator(=) ident(BIND_DEFERRED)operator(;) - ident(lib) operator(=) ident(shl_load)operator(()ident(file)operator(,) ident(flags)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(lib) operator(==) pre_constant(NULL)operator(\)) operator({) - directive(extern) pre_type(int) ident(errno)operator(;) - ident(rb_loaderror)operator(()stringoperator(,) ident(strerror)operator(()ident(errno)operator(\),) ident(file)operator(\);) - operator(}) - ident(shl_findsym)operator((&)ident(lib)operator(,) ident(buf)operator(,) ident(TYPE_PROCEDURE)operator(,) operator(()directive(void)operator(*\)&)ident(init_fct)operator(\);) - reserved(if) operator(()ident(init_fct) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(shl_findsym)operator((&)ident(lib)operator(,) ident(buf)operator(,) ident(TYPE_UNDEFINED)operator(,) operator(()directive(void)operator(*\)&)ident(init_fct)operator(\);) - reserved(if) operator(()ident(init_fct) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(errno) operator(=) ident(ENOSYM)operator(;) - ident(rb_loaderror)operator(()stringoperator(,) ident(strerror)operator(()ident(ENOSYM)operator(\),) ident(file)operator(\);) - operator(}) - operator(}) - operator((*)ident(init_fct)operator(\)(\);) - reserved(return) operator(()directive(void)operator(*\))ident(lib)operator(;) - operator(}) -preprocessor(#endif) comment(/* hpux */) - -preprocessor(#if) ident(defined)operator(()ident(_AIX)operator(\)) operator(&&) operator(!) ident(defined)operator(()ident(_IA64)operator(\)) -preprocessor(#define) ident(DLN_DEFINED) - operator({) - directive(void) operator((*)ident(init_fct)operator(\)(\);) - - ident(init_fct) operator(=) operator(()directive(void)operator((*\)(\)\))ident(load)operator((()pre_type(char)operator(*\))ident(file)operator(,) integer(1)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(init_fct) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(aix_loaderror)operator(()ident(file)operator(\);) - operator(}) - reserved(if) operator(()ident(loadbind)operator(()integer(0)operator(,) operator(()directive(void)operator(*\))ident(dln_load)operator(,) operator(()directive(void)operator(*\))ident(init_fct)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(aix_loaderror)operator(()ident(file)operator(\);) - operator(}) - operator((*)ident(init_fct)operator(\)(\);) - reserved(return) operator(()directive(void)operator(*\))ident(init_fct)operator(;) - operator(}) -preprocessor(#endif) comment(/* _AIX */) - -preprocessor(#if) ident(defined)operator(()ident(NeXT)operator(\)) operator(||) ident(defined)operator(()ident(__APPLE__)operator(\)) -preprocessor(#define) ident(DLN_DEFINED) -comment(/*---------------------------------------------------- - By SHIROYAMA Takayuki Psi@fortune.nest.or.jp - - Special Thanks... - Yu tomoak-i@is.aist-nara.ac.jp, - Mi hisho@tasihara.nest.or.jp, - sunshine@sunshineco.com, - and... Miss ARAI Akino(^^;\) - ----------------------------------------------------*/) -preprocessor(#if) ident(defined)operator(()ident(NeXT)operator(\)) operator(&&) operator(()ident(NS_TARGET_MAJOR) operator(<) integer(4)operator(\))comment(/* NeXTSTEP rld functions */) - - operator({) - ident(NXStream)operator(*) ident(s)operator(;) - pre_type(unsigned) pre_type(long) ident(init_address)operator(;) - pre_type(char) operator(*)ident(object_files)operator([)integer(2)operator(]) operator(=) operator({)pre_constant(NULL)operator(,) pre_constant(NULL)operator(};) - - directive(void) operator((*)ident(init_fct)operator(\)(\);) - - ident(object_files)operator([)integer(0)operator(]) operator(=) operator(()pre_type(char)operator(*\))ident(file)operator(;) - - ident(s) operator(=) ident(NXOpenFile)operator(()integer(2)operator(,)ident(NX_WRITEONLY)operator(\);) - - comment(/* Load object file, if return value ==0 , load failed*/) - reserved(if)operator(()ident(rld_load)operator(()ident(s)operator(,) pre_constant(NULL)operator(,) ident(object_files)operator(,) pre_constant(NULL)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(NXFlush)operator(()ident(s)operator(\);) - ident(NXClose)operator(()ident(s)operator(\);) - ident(rb_loaderror)operator(()stringoperator(,) ident(file)operator(\);) - operator(}) - - comment(/* lookup the initial function */) - reserved(if)operator(()ident(rld_lookup)operator(()ident(s)operator(,) ident(buf)operator(,) operator(&)ident(init_address)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(NXFlush)operator(()ident(s)operator(\);) - ident(NXClose)operator(()ident(s)operator(\);) - ident(rb_loaderror)operator(()stringoperator(,) ident(file)operator(\);) - operator(}) - - ident(NXFlush)operator(()ident(s)operator(\);) - ident(NXClose)operator(()ident(s)operator(\);) - - comment(/* Cannot call *init_address directory, so copy this value to - funtion pointer */) - ident(init_fct) operator(=) operator(()directive(void)operator((*\)(\)\))ident(init_address)operator(;) - operator((*)ident(init_fct)operator(\)(\);) - reserved(return) operator(()directive(void)operator(*\))ident(init_address)operator(;) - operator(}) -preprocessor(#else)comment(/* OPENSTEP dyld functions */) - operator({) - pre_type(int) ident(dyld_result)operator(;) - ident(NSObjectFileImage) ident(obj_file)operator(;) comment(/* handle, but not use it */) - comment(/* "file" is module file name . - "buf" is pointer to initial function name with "_" . */) - - directive(void) operator((*)ident(init_fct)operator(\)(\);) - - - ident(dyld_result) operator(=) ident(NSCreateObjectFileImageFromFile)operator(()ident(file)operator(,) operator(&)ident(obj_file)operator(\);) - - reserved(if) operator(()ident(dyld_result) operator(!=) ident(NSObjectFileImageSuccess)operator(\)) operator({) - ident(rb_loaderror)operator(()stringoperator(,) ident(file)operator(\);) - operator(}) - - ident(NSLinkModule)operator(()ident(obj_file)operator(,) ident(file)operator(,) ident(NSLINKMODULE_OPTION_BINDNOW)operator(\);) - - comment(/* lookup the initial function */) - reserved(if)operator((!)ident(NSIsSymbolNameDefined)operator(()ident(buf)operator(\)\)) operator({) - ident(rb_loaderror)operator(()stringoperator(,)ident(file)operator(\);) - operator(}) - ident(init_fct) operator(=) ident(NSAddressOfSymbol)operator(()ident(NSLookupAndBindSymbol)operator(()ident(buf)operator(\)\);) - operator((*)ident(init_fct)operator(\)(\);) - - reserved(return) operator(()directive(void)operator(*\))ident(init_fct)operator(;) - operator(}) -preprocessor(#endif) comment(/* rld or dyld */) -preprocessor(#endif) - -preprocessor(#ifdef) ident(__BEOS__) -preprocessor(# define) ident(DLN_DEFINED) - operator({) - ident(status_t) ident(err_stat)operator(;) comment(/* BeOS error status code */) - ident(image_id) ident(img_id)operator(;) comment(/* extention module unique id */) - directive(void) operator((*)ident(init_fct)operator(\)(\);) comment(/* initialize function for extention module */) - - comment(/* load extention module */) - ident(img_id) operator(=) ident(load_add_on)operator(()ident(file)operator(\);) - reserved(if) operator(()ident(img_id) operator(<=) integer(0)operator(\)) operator({) - ident(rb_loaderror)operator(()stringoperator(,) ident(file)operator(\);) - operator(}) - - comment(/* find symbol for module initialize function. */) - comment(/* The Be Book KernelKit Images section described to use - B_SYMBOL_TYPE_TEXT for symbol of function, not - B_SYMBOL_TYPE_CODE. Why ? */) - comment(/* strcat(init_fct_symname, "__Fv"\); */) comment(/* parameter nothing. */) - comment(/* "__Fv" dont need! The Be Book Bug ? */) - ident(err_stat) operator(=) ident(get_image_symbol)operator(()ident(img_id)operator(,) ident(buf)operator(,) - ident(B_SYMBOL_TYPE_TEXT)operator(,) operator(()directive(void) operator(**\)&)ident(init_fct)operator(\);) - - reserved(if) operator(()ident(err_stat) operator(!=) ident(B_NO_ERROR)operator(\)) operator({) - pre_type(char) ident(real_name)operator([)ident(MAXPATHLEN)operator(];) - - ident(strcpy)operator(()ident(real_name)operator(,) ident(buf)operator(\);) - ident(strcat)operator(()ident(real_name)operator(,) stringoperator(\);) - ident(err_stat) operator(=) ident(get_image_symbol)operator(()ident(img_id)operator(,) ident(real_name)operator(,) - ident(B_SYMBOL_TYPE_TEXT)operator(,) operator(()directive(void) operator(**\)&)ident(init_fct)operator(\);) - operator(}) - - reserved(if) operator((()ident(B_BAD_IMAGE_ID) operator(==) ident(err_stat)operator(\)) operator(||) operator(()ident(B_BAD_INDEX) operator(==) ident(err_stat)operator(\)\)) operator({) - ident(unload_add_on)operator(()ident(img_id)operator(\);) - ident(rb_loaderror)operator(()stringoperator(,) ident(file)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(B_NO_ERROR) operator(!=) ident(err_stat)operator(\)) operator({) - pre_type(char) ident(errmsg)operator([]) operator(=) stringoperator(;) - ident(unload_add_on)operator(()ident(img_id)operator(\);) - ident(rb_loaderror)operator(()ident(errmsg)operator(,) ident(strerror)operator(()ident(err_stat)operator(\),) ident(buf)operator(\);) - operator(}) - - comment(/* call module initialize function. */) - operator((*)ident(init_fct)operator(\)(\);) - reserved(return) operator(()directive(void)operator(*\))ident(img_id)operator(;) - operator(}) -preprocessor(#endif) comment(/* __BEOS__*/) - -preprocessor(#ifdef) ident(__MACOS__) -preprocessor(# define) ident(DLN_DEFINED) - operator({) - ident(OSErr) ident(err)operator(;) - ident(FSSpec) ident(libspec)operator(;) - ident(CFragConnectionID) ident(connID)operator(;) - ident(Ptr) ident(mainAddr)operator(;) - pre_type(char) ident(errMessage)operator([)integer(1024)operator(];) - ident(Boolean) ident(isfolder)operator(,) ident(didsomething)operator(;) - ident(Str63) ident(fragname)operator(;) - ident(Ptr) ident(symAddr)operator(;) - ident(CFragSymbolClass) ident(class)operator(;) - directive(void) operator((*)ident(init_fct)operator(\)(\);) - pre_type(char) ident(fullpath)operator([)ident(MAXPATHLEN)operator(];) - - ident(strcpy)operator(()ident(fullpath)operator(,) ident(file)operator(\);) - - comment(/* resolve any aliases to find the real file */) - ident(c2pstr)operator(()ident(fullpath)operator(\);) - operator(()directive(void)operator(\))ident(FSMakeFSSpec)operator(()integer(0)operator(,) integer(0)operator(,) ident(fullpath)operator(,) operator(&)ident(libspec)operator(\);) - ident(err) operator(=) ident(ResolveAliasFile)operator((&)ident(libspec)operator(,) integer(1)operator(,) operator(&)ident(isfolder)operator(,) operator(&)ident(didsomething)operator(\);) - reserved(if) operator(()ident(err)operator(\)) operator({) - ident(rb_loaderror)operator(()stringoperator(,) ident(file)operator(\);) - operator(}) - - comment(/* Load the fragment (or return the connID if it is already loaded */) - ident(fragname)operator([)integer(0)operator(]) operator(=) integer(0)operator(;) - ident(err) operator(=) ident(GetDiskFragment)operator((&)ident(libspec)operator(,) integer(0)operator(,) integer(0)operator(,) ident(fragname)operator(,) - ident(kLoadCFrag)operator(,) operator(&)ident(connID)operator(,) operator(&)ident(mainAddr)operator(,) - ident(errMessage)operator(\);) - reserved(if) operator(()ident(err)operator(\)) operator({) - ident(p2cstr)operator(()ident(errMessage)operator(\);) - ident(rb_loaderror)operator(()stringoperator(,)ident(errMessage) operator(,) ident(file)operator(\);) - operator(}) - - comment(/* Locate the address of the correct init function */) - ident(c2pstr)operator(()ident(buf)operator(\);) - ident(err) operator(=) ident(FindSymbol)operator(()ident(connID)operator(,) ident(buf)operator(,) operator(&)ident(symAddr)operator(,) operator(&)ident(class)operator(\);) - reserved(if) operator(()ident(err)operator(\)) operator({) - ident(rb_loaderror)operator(()string operator(,) ident(file)operator(\);) - operator(}) - ident(init_fct) operator(=) operator(()directive(void) operator((*\)(\)\))ident(symAddr)operator(;) - operator((*)ident(init_fct)operator(\)(\);) - reserved(return) operator(()directive(void)operator(*\))ident(init_fct)operator(;) - operator(}) -preprocessor(#endif) comment(/* __MACOS__ */) - -preprocessor(#if) ident(defined)operator(()ident(__VMS)operator(\)) -preprocessor(#define) ident(DLN_DEFINED) - operator({) - pre_type(long) ident(status)operator(;) - directive(void) operator((*)ident(init_fct)operator(\)(\);) - pre_type(char) operator(*)ident(fname)operator(,) operator(*)ident(p1)operator(,) operator(*)ident(p2)operator(;) - - ident($)ident(DESCRIPTOR)operator(()ident(fname_d)operator(,) stringoperator(\);) - ident($)ident(DESCRIPTOR)operator(()ident(image_d)operator(,) stringoperator(\);) - ident($)ident(DESCRIPTOR)operator(()ident(buf_d)operator(,) stringoperator(\);) - - ident(decc)ident($)ident(to_vms)operator(()ident(file)operator(,) ident(vms_fileact)operator(,) integer(0)operator(,) integer(0)operator(\);) - - ident(fname) operator(=) operator(()pre_type(char) operator(*\))ident(__alloca)operator(()ident(strlen)operator(()ident(file)operator(\)+)integer(1)operator(\);) - ident(strcpy)operator(()ident(fname)operator(,)ident(file)operator(\);) - reserved(if) operator(()ident(p1) operator(=) ident(strrchr)operator(()ident(fname)operator(,)char('/')operator(\)\)) - ident(fname) operator(=) ident(p1) operator(+) integer(1)operator(;) - reserved(if) operator(()ident(p2) operator(=) ident(strrchr)operator(()ident(fname)operator(,)char('.')operator(\)\)) - operator(*)ident(p2) operator(=) char('\\0')operator(;) - - ident(fname_d)operator(.)ident(dsc)ident($)ident(w_length) operator(=) ident(strlen)operator(()ident(fname)operator(\);) - ident(fname_d)operator(.)ident(dsc)ident($)ident(a_pointer) operator(=) ident(fname)operator(;) - ident(image_d)operator(.)ident(dsc)ident($)ident(w_length) operator(=) ident(strlen)operator(()ident(vms_filespec)operator(\);) - ident(image_d)operator(.)ident(dsc)ident($)ident(a_pointer) operator(=) ident(vms_filespec)operator(;) - ident(buf_d)operator(.)ident(dsc)ident($)ident(w_length) operator(=) ident(strlen)operator(()ident(buf)operator(\);) - ident(buf_d)operator(.)ident(dsc)ident($)ident(a_pointer) operator(=) ident(buf)operator(;) - - ident(lib)ident($)ident(establish)operator(()ident(vms_fisexh)operator(\);) - - ident(status) operator(=) ident(lib)ident($)ident(find_image_symbol) operator(() - operator(&)ident(fname_d)operator(,) - operator(&)ident(buf_d)operator(,) - operator(&)ident(init_fct)operator(,) - operator(&)ident(image_d)operator(\);) - - ident(lib)ident($)ident(establish)operator(()integer(0)operator(\);) - - reserved(if) operator(()ident(status) operator(==) ident(RMS)ident($)ident(_FNF)operator(\)) operator({) - ident(error) operator(=) ident(dln_strerror)operator((\);) - reserved(goto) ident(failed)operator(;) - operator(}) reserved(else) reserved(if) operator((!)ident($)ident(VMS_STATUS_SUCCESS)operator(()ident(status)operator(\)\)) operator({) - ident(error) operator(=) ident(DLN_ERROR)operator((\);) - reserved(goto) ident(failed)operator(;) - operator(}) - - comment(/* Call the init code */) - operator((*)ident(init_fct)operator(\)(\);) - - reserved(return) integer(1)operator(;) - operator(}) -preprocessor(#endif) comment(/* __VMS */) - -preprocessor(#ifndef) ident(DLN_DEFINED) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - -preprocessor(#endif) comment(/* USE_DLN_A_OUT */) -preprocessor(#endif) -preprocessor(#if) operator(!)ident(defined)operator(()ident(_AIX)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(NeXT)operator(\)) - label(failed:) - ident(rb_loaderror)operator(()stringoperator(,) ident(error)operator(,) ident(file)operator(\);) -preprocessor(#endif) - -preprocessor(#endif) comment(/* NO_DLN_LOAD */) - reserved(return) integer(0)operator(;) comment(/* dummy return */) -operator(}) - -directive(static) pre_type(char) operator(*)ident(dln_find_1)operator((\);) - -pre_type(char) operator(*) -ident(dln_find_exe)operator(()ident(fname)operator(,) ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(fname)operator(;) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) - reserved(if) operator((!)ident(path)operator(\)) operator({) - ident(path) operator(=) ident(getenv)operator(()ident(PATH_ENV)operator(\);) - operator(}) - - reserved(if) operator((!)ident(path)operator(\)) operator({) -preprocessor(#if) ident(defined)operator(()ident(MSDOS)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__MACOS__)operator(\)) - ident(path) operator(=) stringoperator(;) -preprocessor(#else) - ident(path) operator(=) stringoperator(;) -preprocessor(#endif) - operator(}) - reserved(return) ident(dln_find_1)operator(()ident(fname)operator(,) ident(path)operator(,) integer(1)operator(\);) -operator(}) - -pre_type(char) operator(*) -ident(dln_find_file)operator(()ident(fname)operator(,) ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(fname)operator(;) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) -preprocessor(#ifndef) ident(__MACOS__) - reserved(if) operator((!)ident(path)operator(\)) ident(path) operator(=) stringoperator(;) - reserved(return) ident(dln_find_1)operator(()ident(fname)operator(,) ident(path)operator(,) integer(0)operator(\);) -preprocessor(#else) - reserved(if) operator((!)ident(path)operator(\)) ident(path) operator(=) stringoperator(;) - reserved(return) ident(_macruby_path_conv_posix_to_macos)operator(()ident(dln_find_1)operator(()ident(fname)operator(,) ident(path)operator(,) integer(0)operator(\)\);) -preprocessor(#endif) -operator(}) - -directive(static) pre_type(char) ident(fbuf)operator([)ident(MAXPATHLEN)operator(];) - -directive(static) pre_type(char) operator(*) -ident(dln_find_1)operator(()ident(fname)operator(,) ident(path)operator(,) ident(exe_flag)operator(\)) - pre_type(char) operator(*)ident(fname)operator(;) - pre_type(char) operator(*)ident(path)operator(;) - pre_type(int) ident(exe_flag)operator(;) comment(/* non 0 if looking for executable. */) -operator({) - directive(register) pre_type(char) operator(*)ident(dp)operator(;) - directive(register) pre_type(char) operator(*)ident(ep)operator(;) - directive(register) pre_type(char) operator(*)ident(bp)operator(;) - reserved(struct) ident(stat) ident(st)operator(;) -preprocessor(#ifdef) ident(__MACOS__) - directive(const) pre_type(char)operator(*) ident(mac_fullpath)operator(;) -preprocessor(#endif) - - reserved(if) operator((!)ident(fname)operator(\)) reserved(return) ident(fname)operator(;) - reserved(if) operator(()ident(fname)operator([)integer(0)operator(]) operator(==) char('/')operator(\)) reserved(return) ident(fname)operator(;) - reserved(if) operator(()ident(strncmp)operator(()stringoperator(,) ident(fname)operator(,) integer(2)operator(\)) operator(==) integer(0) operator(||) ident(strncmp)operator(()stringoperator(,) ident(fname)operator(,) integer(3)operator(\)) operator(==) integer(0)operator(\)) - reserved(return) ident(fname)operator(;) - reserved(if) operator(()ident(exe_flag) operator(&&) ident(strchr)operator(()ident(fname)operator(,) char('/')operator(\)\)) reserved(return) ident(fname)operator(;) -preprocessor(#ifdef) ident(DOSISH) - reserved(if) operator(()ident(fname)operator([)integer(0)operator(]) operator(==) char('\\\\')operator(\)) reserved(return) ident(fname)operator(;) -preprocessor(# ifdef) ident(DOSISH_DRIVE_LETTER) - reserved(if) operator(()ident(strlen)operator(()ident(fname)operator(\)) operator(>) integer(2) operator(&&) ident(fname)operator([)integer(1)operator(]) operator(==) char(':')operator(\)) reserved(return) ident(fname)operator(;) -preprocessor(# endif) - reserved(if) operator(()ident(strncmp)operator(()stringoperator(,) ident(fname)operator(,) integer(2)operator(\)) operator(==) integer(0) operator(||) ident(strncmp)operator(()stringoperator(,) ident(fname)operator(,) integer(3)operator(\)) operator(==) integer(0)operator(\)) - reserved(return) ident(fname)operator(;) - reserved(if) operator(()ident(exe_flag) operator(&&) ident(strchr)operator(()ident(fname)operator(,) char('\\\\')operator(\)\)) reserved(return) ident(fname)operator(;) -preprocessor(#endif) - - reserved(for) operator(()ident(dp) operator(=) ident(path)operator(;;) ident(dp) operator(=) operator(++)ident(ep)operator(\)) operator({) - directive(register) pre_type(int) ident(l)operator(;) - pre_type(int) ident(i)operator(;) - pre_type(int) ident(fspace)operator(;) - - comment(/* extract a component */) - ident(ep) operator(=) ident(strchr)operator(()ident(dp)operator(,) ident(PATH_SEP)operator([)integer(0)operator(]\);) - reserved(if) operator(()ident(ep) operator(==) pre_constant(NULL)operator(\)) - ident(ep) operator(=) ident(dp)operator(+)ident(strlen)operator(()ident(dp)operator(\);) - - comment(/* find the length of that component */) - ident(l) operator(=) ident(ep) operator(-) ident(dp)operator(;) - ident(bp) operator(=) ident(fbuf)operator(;) - ident(fspace) operator(=) reserved(sizeof) ident(fbuf) operator(-) integer(2)operator(;) - reserved(if) operator(()ident(l) operator(>) integer(0)operator(\)) operator({) - comment(/* - ** If the length of the component is zero length, - ** start from the current directory. If the - ** component begins with "~", start from the - ** user's $HOME environment variable. Otherwise - ** take the path literally. - */) - - reserved(if) operator((*)ident(dp) operator(==) char('~') operator(&&) operator(()ident(l) operator(==) integer(1) operator(||) -preprocessor(#if) ident(defined)operator(()ident(DOSISH)operator(\)) - ident(dp)operator([)integer(1)operator(]) operator(==) char('\\\\') operator(||) -preprocessor(#endif) - ident(dp)operator([)integer(1)operator(]) operator(==) char('/')operator(\)\)) operator({) - pre_type(char) operator(*)ident(home)operator(;) - - ident(home) operator(=) ident(getenv)operator(()stringoperator(\);) - reserved(if) operator(()ident(home) operator(!=) pre_constant(NULL)operator(\)) operator({) - ident(i) operator(=) ident(strlen)operator(()ident(home)operator(\);) - reserved(if) operator((()ident(fspace) operator(-=) ident(i)operator(\)) operator(<) integer(0)operator(\)) - reserved(goto) ident(toolong)operator(;) - ident(memcpy)operator(()ident(bp)operator(,) ident(home)operator(,) ident(i)operator(\);) - ident(bp) operator(+=) ident(i)operator(;) - operator(}) - ident(dp)operator(++;) - ident(l)operator(--;) - operator(}) - reserved(if) operator(()ident(l) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator((()ident(fspace) operator(-=) ident(l)operator(\)) operator(<) integer(0)operator(\)) - reserved(goto) ident(toolong)operator(;) - ident(memcpy)operator(()ident(bp)operator(,) ident(dp)operator(,) ident(l)operator(\);) - ident(bp) operator(+=) ident(l)operator(;) - operator(}) - - comment(/* add a "/" between directory and filename */) - reserved(if) operator(()ident(ep)operator([-)integer(1)operator(]) operator(!=) char('/')operator(\)) - operator(*)ident(bp)operator(++) operator(=) char('/')operator(;) - operator(}) - - comment(/* now append the file name */) - ident(i) operator(=) ident(strlen)operator(()ident(fname)operator(\);) - reserved(if) operator((()ident(fspace) operator(-=) ident(i)operator(\)) operator(<) integer(0)operator(\)) operator({) - label(toolong:) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(\);) - operator(*)ident(bp) operator(=) char('\\0')operator(;) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(,) ident(fbuf)operator(\);) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(,) ident(fname)operator(\);) - reserved(goto) ident(next)operator(;) - operator(}) - ident(memcpy)operator(()ident(bp)operator(,) ident(fname)operator(,) ident(i) operator(+) integer(1)operator(\);) - -preprocessor(#if) ident(defined)operator(()ident(DOSISH)operator(\)) - reserved(if) operator(()ident(exe_flag)operator(\)) operator({) - directive(static) directive(const) pre_type(char) ident(extension)operator([][)integer(5)operator(]) operator(=) operator({) -preprocessor(#if) ident(defined)operator(()ident(MSDOS)operator(\)) - stringoperator(,) stringoperator(,) stringoperator(,) -preprocessor(#if) ident(defined)operator(()ident(DJGPP)operator(\)) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) -preprocessor(#endif) -preprocessor(#elif) ident(defined)operator(()ident(__EMX__)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) -comment(/* end of __EMX__ or _WIN32 */) -preprocessor(#else) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) -comment(/* __human68k__ */) -preprocessor(#endif) - operator(};) - pre_type(int) ident(j)operator(;) - - reserved(for) operator(()ident(j) operator(=) integer(0)operator(;) ident(j) operator(<) reserved(sizeof)operator(()ident(extension)operator(\)) operator(/) reserved(sizeof)operator(()ident(extension)operator([)integer(0)operator(]\);) ident(j)operator(++\)) operator({) - reserved(if) operator(()ident(fspace) operator(<) ident(strlen)operator(()ident(extension)operator([)ident(j)operator(]\)\)) operator({) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(\);) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(,) operator(()pre_type(int)operator(\)) operator(()ident(bp) operator(-) ident(fbuf)operator(\),) ident(fbuf)operator(\);) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(,) ident(fname)operator(,) ident(extension)operator([)ident(j)operator(]\);) - reserved(continue)operator(;) - operator(}) - ident(strcpy)operator(()ident(bp) operator(+) ident(i)operator(,) ident(extension)operator([)ident(j)operator(]\);) -preprocessor(#ifndef) ident(__MACOS__) - reserved(if) operator(()ident(stat)operator(()ident(fbuf)operator(,) operator(&)ident(st)operator(\)) operator(==) integer(0)operator(\)) - reserved(return) ident(fbuf)operator(;) -preprocessor(#else) - reserved(if) operator(()ident(mac_fullpath) operator(=) ident(_macruby_exist_file_in_libdir_as_posix_name)operator(()ident(fbuf)operator(\)\)) - reserved(return) ident(mac_fullpath)operator(;) - -preprocessor(#endif) - operator(}) - reserved(goto) ident(next)operator(;) - operator(}) -preprocessor(#endif) comment(/* MSDOS or _WIN32 or __human68k__ or __EMX__ */) - -preprocessor(#ifndef) ident(__MACOS__) - reserved(if) operator(()ident(stat)operator(()ident(fbuf)operator(,) operator(&)ident(st)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(exe_flag) operator(==) integer(0)operator(\)) reserved(return) ident(fbuf)operator(;) - comment(/* looking for executable */) - reserved(if) operator((!)ident(S_ISDIR)operator(()ident(st)operator(.)ident(st_mode)operator(\)) operator(&&) ident(eaccess)operator(()ident(fbuf)operator(,) ident(X_OK)operator(\)) operator(==) integer(0)operator(\)) - reserved(return) ident(fbuf)operator(;) - operator(}) -preprocessor(#else) - reserved(if) operator(()ident(mac_fullpath) operator(=) ident(_macruby_exist_file_in_libdir_as_posix_name)operator(()ident(fbuf)operator(\)\)) operator({) - reserved(if) operator(()ident(exe_flag) operator(==) integer(0)operator(\)) reserved(return) ident(mac_fullpath)operator(;) - comment(/* looking for executable */) - reserved(if) operator(()ident(stat)operator(()ident(mac_fullpath)operator(,) operator(&)ident(st)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator((!)ident(S_ISDIR)operator(()ident(st)operator(.)ident(st_mode)operator(\)) operator(&&) ident(eaccess)operator(()ident(mac_fullpath)operator(,) ident(X_OK)operator(\)) operator(==) integer(0)operator(\)) - reserved(return) ident(mac_fullpath)operator(;) - operator(}) - operator(}) -preprocessor(#endif) - - label(next:) - comment(/* if not, and no other alternatives, life is bleak */) - reserved(if) operator((*)ident(ep) operator(==) char('\\0')operator(\)) operator({) - reserved(return) pre_constant(NULL)operator(;) - operator(}) - - comment(/* otherwise try the next component in the search path */) - operator(}) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(__VMS)operator(\)) - -comment(/* action routine for decc$to_vms */) -directive(static) pre_type(int) ident(vms_fileact)operator(()pre_type(char) operator(*)ident(filespec)operator(,) pre_type(int) ident(type)operator(\)) -operator({) - reserved(if) operator(()ident(vms_filespec)operator(\)) - ident(free)operator(()ident(vms_filespec)operator(\);) - ident(vms_filespec) operator(=) ident(malloc)operator(()ident(strlen)operator(()ident(filespec)operator(\)+)integer(1)operator(\);) - ident(strcpy)operator(()ident(vms_filespec)operator(,) ident(filespec)operator(\);) - reserved(return) integer(1)operator(;) -operator(}) - -comment(/* exception handler for LIB$FIND_IMAGE_SYMBOL */) -directive(static) pre_type(long) ident(vms_fisexh)operator(()pre_type(long) operator(*)ident(sigarr)operator(,) pre_type(long) operator(*)ident(mecarr)operator(\)) -operator({) - ident(sys)ident($)ident(unwind)operator(()integer(1)operator(,) integer(0)operator(\);) - reserved(return) integer(1)operator(;) -operator(}) - -preprocessor(#endif) comment(/* __VMS */) -preprocessor(#define) ident(NO_DLN_LOAD) integer(1) -preprocessor(#include) include("dln.c") -directive(void) -ident(Init_ext)operator((\)) -operator({) -operator(}) -comment(/********************************************************************** - - enum.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007\) $ - created at: Fri Oct 1 15:15:19 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("node.h") -preprocessor(#include) include("util.h") - -ident(VALUE) ident(rb_mEnumerable)operator(;) -directive(static) ident(ID) ident(id_each)operator(,) ident(id_eqq)operator(,) ident(id_cmp)operator(;) - -ident(VALUE) -ident(rb_each)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(obj)operator(,) ident(id_each)operator(,) integer(0)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(grep_i)operator(()ident(i)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(i)operator(,) operator(*)ident(arg)operator(;) -operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_funcall)operator(()ident(arg)operator([)integer(0)operator(],) ident(id_eqq)operator(,) integer(1)operator(,) ident(i)operator(\)\)\)) operator({) - ident(rb_ary_push)operator(()ident(arg)operator([)integer(1)operator(],) ident(i)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(grep_iter_i)operator(()ident(i)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(i)operator(,) operator(*)ident(arg)operator(;) -operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_funcall)operator(()ident(arg)operator([)integer(0)operator(],) ident(id_eqq)operator(,) integer(1)operator(,) ident(i)operator(\)\)\)) operator({) - ident(rb_ary_push)operator(()ident(arg)operator([)integer(1)operator(],) ident(rb_yield)operator(()ident(i)operator(\)\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.grep(pattern\) => array - * enum.grep(pattern\) {| obj | block } => array - * - * Returns an array of every element in enum for which - * Pattern === element. If the optional block is - * supplied, each matching element is passed to it, and the block's - * result is stored in the output array. - * - * (1..100\).grep 38..44 #=> [38, 39, 40, 41, 42, 43, 44] - * c = IO.constants - * c.grep(/SEEK/\) #=> ["SEEK_END", "SEEK_SET", "SEEK_CUR"] - * res = c.grep(/SEEK/\) {|v| IO.const_get(v\) } - * res #=> [2, 0, 1] - * - */) - -directive(static) ident(VALUE) -ident(enum_grep)operator(()ident(obj)operator(,) ident(pat)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(pat)operator(;) -operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - ident(VALUE) ident(arg)operator([)integer(2)operator(];) - - ident(arg)operator([)integer(0)operator(]) operator(=) ident(pat)operator(;) - ident(arg)operator([)integer(1)operator(]) operator(=) ident(ary)operator(;) - - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(rb_block_given_p)operator((\)) operator(?) ident(grep_iter_i) operator(:) ident(grep_i)operator(,) operator(()ident(VALUE)operator(\))ident(arg)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(find_i)operator(()ident(i)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(i)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield)operator(()ident(i)operator(\)\)\)) operator({) - operator(*)ident(memo) operator(=) ident(i)operator(;) - ident(rb_iter_break)operator((\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.detect(ifnone = nil\) {| obj | block } => obj or nil - * enum.find(ifnone = nil\) {| obj | block } => obj or nil - * - * Passes each entry in enum to block. Returns the - * first for which block is not false. If no - * object matches, calls ifnone and returns its result when it - * is specified, or returns nil - * - * (1..10\).detect {|i| i % 5 == 0 and i % 7 == 0 } #=> nil - * (1..100\).detect {|i| i % 5 == 0 and i % 7 == 0 } #=> 35 - * - */) - -directive(static) ident(VALUE) -ident(enum_find)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE)operator(*) ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(memo) operator(=) ident(Qundef)operator(;) - ident(VALUE) ident(if_none)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(if_none)operator(\);) - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(find_i)operator(,) operator(()ident(VALUE)operator(\)&)ident(memo)operator(\);) - reserved(if) operator(()ident(memo) operator(!=) ident(Qundef)operator(\)) operator({) - reserved(return) ident(memo)operator(;) - operator(}) - reserved(if) operator((!)ident(NIL_P)operator(()ident(if_none)operator(\)\)) operator({) - reserved(return) ident(rb_funcall)operator(()ident(if_none)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(,) integer(0)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(find_all_i)operator(()ident(i)operator(,) ident(ary)operator(\)) - ident(VALUE) ident(i)operator(,) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield)operator(()ident(i)operator(\)\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(i)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.find_all {| obj | block } => array - * enum.select {| obj | block } => array - * - * Returns an array containing all elements of enum for which - * block is not false (see also - * Enumerable#reject\). - * - * (1..10\).find_all {|i| i % 3 == 0 } #=> [3, 6, 9] - * - */) - -directive(static) ident(VALUE) -ident(enum_find_all)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(find_all_i)operator(,) ident(ary)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(reject_i)operator(()ident(i)operator(,) ident(ary)operator(\)) - ident(VALUE) ident(i)operator(,) ident(ary)operator(;) -operator({) - reserved(if) operator((!)ident(RTEST)operator(()ident(rb_yield)operator(()ident(i)operator(\)\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(i)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.reject {| obj | block } => array - * - * Returns an array for all elements of enum for which - * block is false (see also Enumerable#find_all\). - * - * (1..10\).reject {|i| i % 3 == 0 } #=> [1, 2, 4, 5, 7, 8, 10] - * - */) - -directive(static) ident(VALUE) -ident(enum_reject)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(reject_i)operator(,) ident(ary)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(collect_i)operator(()ident(i)operator(,) ident(ary)operator(\)) - ident(VALUE) ident(i)operator(,) ident(ary)operator(;) -operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_yield)operator(()ident(i)operator(\)\);) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(collect_all)operator(()ident(i)operator(,) ident(ary)operator(\)) - ident(VALUE) ident(i)operator(,) ident(ary)operator(;) -operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(i)operator(\);) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.collect {| obj | block } => array - * enum.map {| obj | block } => array - * - * Returns a new array with the results of running block once - * for every element in enum. - * - * (1..4\).collect {|i| i*i } #=> [1, 4, 9, 16] - * (1..4\).collect { "cat" } #=> ["cat", "cat", "cat", "cat"] - * - */) - -directive(static) ident(VALUE) -ident(enum_collect)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(rb_block_given_p)operator((\)) operator(?) ident(collect_i) operator(:) ident(collect_all)operator(,) ident(ary)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.to_a => array - * enum.entries => array - * - * Returns an array containing the items in enum. - * - * (1..7\).to_a #=> [1, 2, 3, 4, 5, 6, 7] - * { 'a'=>1, 'b'=>2, 'c'=>3 }.to_a #=> [["a", 1], ["b", 2], ["c", 3]] - */) -directive(static) ident(VALUE) -ident(enum_to_a)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(collect_all)operator(,) ident(ary)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(inject_i)operator(()ident(i)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(i)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - reserved(if) operator((*)ident(memo) operator(==) ident(Qundef)operator(\)) operator({) - operator(*)ident(memo) operator(=) ident(i)operator(;) - operator(}) - reserved(else) operator({) - operator(*)ident(memo) operator(=) ident(rb_yield_values)operator(()integer(2)operator(,) operator(*)ident(memo)operator(,) ident(i)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.inject(initial\) {| memo, obj | block } => obj - * enum.inject {| memo, obj | block } => obj - * - * Combines the elements of enum by applying the block to an - * accumulator value (memo\) and each element in turn. At each - * step, memo is set to the value returned by the block. The - * first form lets you supply an initial value for memo. The - * second form uses the first element of the collection as a the - * initial value (and skips that element while iterating\). - * - * # Sum some numbers - * (5..10\).inject {|sum, n| sum + n } #=> 45 - * # Multiply some numbers - * (5..10\).inject(1\) {|product, n| product * n } #=> 151200 - * - * # find the longest word - * longest = %w{ cat sheep bear }.inject do |memo,word| - * memo.length > word.length ? memo : word - * end - * longest #=> "sheep" - * - * # find the length of the longest word - * longest = %w{ cat sheep bear }.inject(0\) do |memo,word| - * memo >= word.length ? memo : word.length - * end - * longest #=> 5 - * - */) - -directive(static) ident(VALUE) -ident(enum_inject)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(,) ident(obj)operator(;) -operator({) - ident(VALUE) ident(memo) operator(=) ident(Qundef)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(memo)operator(\)) operator(==) integer(0)operator(\)) - ident(memo) operator(=) ident(Qundef)operator(;) - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(inject_i)operator(,) operator(()ident(VALUE)operator(\)&)ident(memo)operator(\);) - reserved(if) operator(()ident(memo) operator(==) ident(Qundef)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(memo)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(partition_i)operator(()ident(i)operator(,) ident(ary)operator(\)) - ident(VALUE) ident(i)operator(,) operator(*)ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield)operator(()ident(i)operator(\)\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator([)integer(0)operator(],) ident(i)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_ary_push)operator(()ident(ary)operator([)integer(1)operator(],) ident(i)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.partition {| obj | block } => [ true_array, false_array ] - * - * Returns two arrays, the first containing the elements of - * enum for which the block evaluates to true, the second - * containing the rest. - * - * (1..6\).partition {|i| (i&1\).zero?} #=> [[2, 4, 6], [1, 3, 5]] - * - */) - -directive(static) ident(VALUE) -ident(enum_partition)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(ary)operator([)integer(2)operator(];) - - ident(ary)operator([)integer(0)operator(]) operator(=) ident(rb_ary_new)operator((\);) - ident(ary)operator([)integer(1)operator(]) operator(=) ident(rb_ary_new)operator((\);) - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(partition_i)operator(,) operator(()ident(VALUE)operator(\))ident(ary)operator(\);) - - reserved(return) ident(rb_assoc_new)operator(()ident(ary)operator([)integer(0)operator(],) ident(ary)operator([)integer(1)operator(]\);) -operator(}) - -comment(/* - * call-seq: - * enum.sort => array - * enum.sort {| a, b | block } => array - * - * Returns an array containing the items in enum sorted, - * either according to their own <=> method, or by using - * the results of the supplied block. The block should return -1, 0, or - * +1 depending on the comparison between a and b. As of - * Ruby 1.8, the method Enumerable#sort_by implements a - * built-in Schwartzian Transform, useful when key computation or - * comparison is expensive.. - * - * %w(rhea kea flea\).sort #=> ["flea", "kea", "rhea"] - * (1..10\).sort {|a,b| b <=> a} #=> [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] - */) - -directive(static) ident(VALUE) -ident(enum_sort)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_ary_sort)operator(()ident(enum_to_a)operator(()ident(obj)operator(\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(sort_by_i)operator(()ident(i)operator(,) ident(ary)operator(\)) - ident(VALUE) ident(i)operator(,) ident(ary)operator(;) -operator({) - ident(VALUE) ident(v)operator(;) - ident(NODE) operator(*)ident(memo)operator(;) - - ident(v) operator(=) ident(rb_yield)operator(()ident(i)operator(\);) - reserved(if) operator(()ident(RBASIC)operator(()ident(ary)operator(\)->)ident(klass)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - ident(memo) operator(=) ident(rb_node_newnode)operator(()ident(NODE_MEMO)operator(,) ident(v)operator(,) ident(i)operator(,) integer(0)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) operator(()ident(VALUE)operator(\))ident(memo)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(sort_by_cmp)operator(()ident(aa)operator(,) ident(bb)operator(\)) - ident(NODE) operator(**)ident(aa)operator(,) operator(**)ident(bb)operator(;) -operator({) - ident(VALUE) ident(a) operator(=) ident(aa)operator([)integer(0)operator(]->)ident(u1)operator(.)ident(value)operator(;) - ident(VALUE) ident(b) operator(=) ident(bb)operator([)integer(0)operator(]->)ident(u1)operator(.)ident(value)operator(;) - - reserved(return) ident(rb_cmpint)operator(()ident(rb_funcall)operator(()ident(a)operator(,) ident(id_cmp)operator(,) integer(1)operator(,) ident(b)operator(\),) ident(a)operator(,) ident(b)operator(\);) -operator(}) - -comment(/* - * call-seq: - * enum.sort_by {| obj | block } => array - * - * Sorts enum using a set of keys generated by mapping the - * values in enum through the given block. - * - * %w{ apple pear fig }.sort_by {|word| word.length} - #=> ["fig", "pear", "apple"] - * - * The current implementation of sort_by generates an - * array of tuples containing the original collection element and the - * mapped value. This makes sort_by fairly expensive when - * the keysets are simple - * - * require 'benchmark' - * include Benchmark - * - * a = (1..100000\).map {rand(100000\)} - * - * bm(10\) do |b| - * b.report("Sort"\) { a.sort } - * b.report("Sort by"\) { a.sort_by {|a| a} } - * end - * - * produces: - * - * user system total real - * Sort 0.180000 0.000000 0.180000 ( 0.175469\) - * Sort by 1.980000 0.040000 2.020000 ( 2.013586\) - * - * However, consider the case where comparing the keys is a non-trivial - * operation. The following code sorts some files on modification time - * using the basic sort method. - * - * files = Dir["*"] - * sorted = files.sort {|a,b| File.new(a\).mtime <=> File.new(b\).mtime} - * sorted #=> ["mon", "tues", "wed", "thurs"] - * - * This sort is inefficient: it generates two new File - * objects during every comparison. A slightly better technique is to - * use the Kernel#test method to generate the modification - * times directly. - * - * files = Dir["*"] - * sorted = files.sort { |a,b| - * test(?M, a\) <=> test(?M, b\) - * } - * sorted #=> ["mon", "tues", "wed", "thurs"] - * - * This still generates many unnecessary Time objects. A - * more efficient technique is to cache the sort keys (modification - * times in this case\) before the sort. Perl users often call this - * approach a Schwartzian Transform, after Randal Schwartz. We - * construct a temporary array, where each element is an array - * containing our sort key along with the filename. We sort this array, - * and then extract the filename from the result. - * - * sorted = Dir["*"].collect { |f| - * [test(?M, f\), f] - * }.sort.collect { |f| f[1] } - * sorted #=> ["mon", "tues", "wed", "thurs"] - * - * This is exactly what sort_by does internally. - * - * sorted = Dir["*"].sort_by {|f| test(?M, f\)} - * sorted #=> ["mon", "tues", "wed", "thurs"] - */) - -directive(static) ident(VALUE) -ident(enum_sort_by)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(ary)operator(;) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(obj)operator(\)) operator(==) ident(T_ARRAY)operator(\)) operator({) - ident(ary) operator(=) ident(rb_ary_new2)operator(()ident(RARRAY)operator(()ident(obj)operator(\)->)ident(len)operator(\);) - operator(}) - reserved(else) operator({) - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - operator(}) - ident(RBASIC)operator(()ident(ary)operator(\)->)ident(klass) operator(=) integer(0)operator(;) - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(sort_by_i)operator(,) ident(ary)operator(\);) - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(>) integer(1)operator(\)) operator({) - ident(qsort)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(,) reserved(sizeof)operator(()ident(VALUE)operator(\),) ident(sort_by_cmp)operator(,) integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(RBASIC)operator(()ident(ary)operator(\)->)ident(klass)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(=) ident(RNODE)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)->)ident(u2)operator(.)ident(value)operator(;) - operator(}) - ident(RBASIC)operator(()ident(ary)operator(\)->)ident(klass) operator(=) ident(rb_cArray)operator(;) - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(all_iter_i)operator(()ident(i)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(i)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - reserved(if) operator((!)ident(RTEST)operator(()ident(rb_yield)operator(()ident(i)operator(\)\)\)) operator({) - operator(*)ident(memo) operator(=) ident(Qfalse)operator(;) - ident(rb_iter_break)operator((\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(all_i)operator(()ident(i)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(i)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - reserved(if) operator((!)ident(RTEST)operator(()ident(i)operator(\)\)) operator({) - operator(*)ident(memo) operator(=) ident(Qfalse)operator(;) - ident(rb_iter_break)operator((\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.all? [{|obj| block } ] => true or false - * - * Passes each element of the collection to the given block. The method - * returns true if the block never returns - * false or nil. If the block is not given, - * Ruby adds an implicit block of {|obj| obj} (that is - * all? will return true only if none of the - * collection members are false or nil.\) - * - * %w{ ant bear cat}.all? {|word| word.length >= 3} #=> true - * %w{ ant bear cat}.all? {|word| word.length >= 4} #=> false - * [ nil, true, 99 ].all? #=> false - * - */) - -directive(static) ident(VALUE) -ident(enum_all)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(Qtrue)operator(;) - - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(rb_block_given_p)operator((\)) operator(?) ident(all_iter_i) operator(:) ident(all_i)operator(,) operator(()ident(VALUE)operator(\)&)ident(result)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(any_iter_i)operator(()ident(i)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(i)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield)operator(()ident(i)operator(\)\)\)) operator({) - operator(*)ident(memo) operator(=) ident(Qtrue)operator(;) - ident(rb_iter_break)operator((\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(any_i)operator(()ident(i)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(i)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(i)operator(\)\)) operator({) - operator(*)ident(memo) operator(=) ident(Qtrue)operator(;) - ident(rb_iter_break)operator((\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.any? [{|obj| block } ] => true or false - * - * Passes each element of the collection to the given block. The method - * returns true if the block ever returns a value other - * than false or nil. If the block is not - * given, Ruby adds an implicit block of {|obj| obj} (that - * is any? will return true if at least one - * of the collection members is not false or - * nil. - * - * %w{ ant bear cat}.any? {|word| word.length >= 3} #=> true - * %w{ ant bear cat}.any? {|word| word.length >= 4} #=> true - * [ nil, true, 99 ].any? #=> true - * - */) - -directive(static) ident(VALUE) -ident(enum_any)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(Qfalse)operator(;) - - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(rb_block_given_p)operator((\)) operator(?) ident(any_iter_i) operator(:) ident(any_i)operator(,) operator(()ident(VALUE)operator(\)&)ident(result)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(min_i)operator(()ident(i)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(i)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - ident(VALUE) ident(cmp)operator(;) - - reserved(if) operator((*)ident(memo) operator(==) ident(Qundef)operator(\)) operator({) - operator(*)ident(memo) operator(=) ident(i)operator(;) - operator(}) - reserved(else) operator({) - ident(cmp) operator(=) ident(rb_funcall)operator(()ident(i)operator(,) ident(id_cmp)operator(,) integer(1)operator(,) operator(*)ident(memo)operator(\);) - reserved(if) operator(()ident(rb_cmpint)operator(()ident(cmp)operator(,) ident(i)operator(,) operator(*)ident(memo)operator(\)) operator(<) integer(0)operator(\)) operator({) - operator(*)ident(memo) operator(=) ident(i)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(min_ii)operator(()ident(i)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(i)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - ident(VALUE) ident(cmp)operator(;) - - reserved(if) operator((*)ident(memo) operator(==) ident(Qundef)operator(\)) operator({) - operator(*)ident(memo) operator(=) ident(i)operator(;) - operator(}) - reserved(else) operator({) - ident(cmp) operator(=) ident(rb_yield_values)operator(()integer(2)operator(,) ident(i)operator(,) operator(*)ident(memo)operator(\);) - reserved(if) operator(()ident(rb_cmpint)operator(()ident(cmp)operator(,) ident(i)operator(,) operator(*)ident(memo)operator(\)) operator(<) integer(0)operator(\)) operator({) - operator(*)ident(memo) operator(=) ident(i)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * enum.min => obj - * enum.min {| a,b | block } => obj - * - * Returns the object in enum with the minimum value. The - * first form assumes all objects implement Comparable; - * the second uses the block to return a <=> b. - * - * a = %w(albatross dog horse\) - * a.min #=> "albatross" - * a.min {|a,b| a.length <=> b.length } #=> "dog" - */) - -directive(static) ident(VALUE) -ident(enum_min)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(Qundef)operator(;) - - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(rb_block_given_p)operator((\)) operator(?) ident(min_ii) operator(:) ident(min_i)operator(,) operator(()ident(VALUE)operator(\)&)ident(result)operator(\);) - reserved(if) operator(()ident(result) operator(==) ident(Qundef)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.max => obj - * enum.max {| a,b | block } => obj - * - * Returns the object in enum with the maximum value. The - * first form assumes all objects implement Comparable; - * the second uses the block to return a <=> b. - * - * a = %w(albatross dog horse\) - * a.max #=> "horse" - * a.max {|a,b| a.length <=> b.length } #=> "albatross" - */) - -directive(static) ident(VALUE) -ident(max_i)operator(()ident(i)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(i)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - ident(VALUE) ident(cmp)operator(;) - - reserved(if) operator((*)ident(memo) operator(==) ident(Qundef)operator(\)) operator({) - operator(*)ident(memo) operator(=) ident(i)operator(;) - operator(}) - reserved(else) operator({) - ident(cmp) operator(=) ident(rb_funcall)operator(()ident(i)operator(,) ident(id_cmp)operator(,) integer(1)operator(,) operator(*)ident(memo)operator(\);) - reserved(if) operator(()ident(rb_cmpint)operator(()ident(cmp)operator(,) ident(i)operator(,) operator(*)ident(memo)operator(\)) operator(>) integer(0)operator(\)) operator({) - operator(*)ident(memo) operator(=) ident(i)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(max_ii)operator(()ident(i)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(i)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - ident(VALUE) ident(cmp)operator(;) - - reserved(if) operator((*)ident(memo) operator(==) ident(Qundef)operator(\)) operator({) - operator(*)ident(memo) operator(=) ident(i)operator(;) - operator(}) - reserved(else) operator({) - ident(cmp) operator(=) ident(rb_yield_values)operator(()integer(2)operator(,) ident(i)operator(,) operator(*)ident(memo)operator(\);) - reserved(if) operator(()ident(rb_cmpint)operator(()ident(cmp)operator(,) ident(i)operator(,) operator(*)ident(memo)operator(\)) operator(>) integer(0)operator(\)) operator({) - operator(*)ident(memo) operator(=) ident(i)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.max => obj - * enum.max {|a,b| block } => obj - * - * Returns the object in _enum_ with the maximum value. The - * first form assumes all objects implement Comparable; - * the second uses the block to return a <=> b. - * - * a = %w(albatross dog horse\) - * a.max #=> "horse" - * a.max {|a,b| a.length <=> b.length } #=> "albatross" - */) - -directive(static) ident(VALUE) -ident(enum_max)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(Qundef)operator(;) - - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(rb_block_given_p)operator((\)) operator(?) ident(max_ii) operator(:) ident(max_i)operator(,) operator(()ident(VALUE)operator(\)&)ident(result)operator(\);) - reserved(if) operator(()ident(result) operator(==) ident(Qundef)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(member_i)operator(()ident(item)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(item)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - reserved(if) operator(()ident(rb_equal)operator(()ident(item)operator(,) ident(memo)operator([)integer(0)operator(]\)\)) operator({) - ident(memo)operator([)integer(1)operator(]) operator(=) ident(Qtrue)operator(;) - ident(rb_iter_break)operator((\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.include?(obj\) => true or false - * enum.member?(obj\) => true or false - * - * Returns true if any member of enum equals - * obj. Equality is tested using ==. - * - * IO.constants.include? "SEEK_SET" #=> true - * IO.constants.include? "SEEK_NO_FURTHER" #=> false - * - */) - -directive(static) ident(VALUE) -ident(enum_member)operator(()ident(obj)operator(,) ident(val)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(val)operator(;) -operator({) - ident(VALUE) ident(memo)operator([)integer(2)operator(];) - - ident(memo)operator([)integer(0)operator(]) operator(=) ident(val)operator(;) - ident(memo)operator([)integer(1)operator(]) operator(=) ident(Qfalse)operator(;) - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(member_i)operator(,) operator(()ident(VALUE)operator(\))ident(memo)operator(\);) - reserved(return) ident(memo)operator([)integer(1)operator(];) -operator(}) - -directive(static) ident(VALUE) -ident(each_with_index_i)operator(()ident(val)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - ident(rb_yield_values)operator(()integer(2)operator(,) ident(val)operator(,) ident(INT2FIX)operator((*)ident(memo)operator(\)\);) - operator(++*)ident(memo)operator(;) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.each_with_index {|obj, i| block } -> enum - * - * Calls block with two arguments, the item and its index, for - * each item in enum. - * - * hash = Hash.new - * %w(cat dog wombat\).each_with_index {|item, index| - * hash[item] = index - * } - * hash #=> {"cat"=>0, "wombat"=>2, "dog"=>1} - * - */) - -directive(static) ident(VALUE) -ident(enum_each_with_index)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(memo) operator(=) integer(0)operator(;) - - ident(rb_need_block)operator((\);) - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(each_with_index_i)operator(,) operator(()ident(VALUE)operator(\)&)ident(memo)operator(\);) - reserved(return) ident(obj)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(zip_i)operator(()ident(val)operator(,) ident(memo)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(VALUE) operator(*)ident(memo)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(memo)operator([)integer(0)operator(];) - ident(VALUE) ident(args) operator(=) ident(memo)operator([)integer(1)operator(];) - pre_type(int) ident(idx) operator(=) ident(memo)operator([)integer(2)operator(]++;) - ident(VALUE) ident(tmp)operator(;) - pre_type(int) ident(i)operator(;) - - ident(tmp) operator(=) ident(rb_ary_new2)operator(()ident(RARRAY)operator(()ident(args)operator(\)->)ident(len) operator(+) integer(1)operator(\);) - ident(rb_ary_store)operator(()ident(tmp)operator(,) integer(0)operator(,) ident(val)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(args)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(tmp)operator(,) ident(rb_ary_entry)operator(()ident(RARRAY)operator(()ident(args)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(idx)operator(\)\);) - operator(}) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(rb_yield)operator(()ident(tmp)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(tmp)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * enum.zip(arg, ...\) => array - * enum.zip(arg, ...\) {|arr| block } => nil - * - * Converts any arguments to arrays, then merges elements of - * enum with corresponding elements from each argument. This - * generates a sequence of enum#size n-element - * arrays, where n is one more that the count of arguments. If - * the size of any argument is less than enum#size, - * nil values are supplied. If a block given, it is - * invoked for each output array, otherwise an array of arrays is - * returned. - * - * a = [ 4, 5, 6 ] - * b = [ 7, 8, 9 ] - * - * (1..3\).zip(a, b\) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]] - * "cat\\ndog".zip([1]\) #=> [["cat\\n", 1], ["dog", nil]] - * (1..3\).zip #=> [[1], [2], [3]] - * - */) - -directive(static) ident(VALUE) -ident(enum_zip)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - ident(VALUE) ident(result)operator(;) - ident(VALUE) ident(memo)operator([)integer(3)operator(];) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(argv)operator([)ident(i)operator(]) operator(=) ident(rb_convert_type)operator(()ident(argv)operator([)ident(i)operator(],) ident(T_ARRAY)operator(,) stringoperator(,) stringoperator(\);) - operator(}) - ident(result) operator(=) ident(rb_block_given_p)operator((\)) operator(?) ident(Qnil) operator(:) ident(rb_ary_new)operator((\);) - ident(memo)operator([)integer(0)operator(]) operator(=) ident(result)operator(;) - ident(memo)operator([)integer(1)operator(]) operator(=) ident(rb_ary_new4)operator(()ident(argc)operator(,) ident(argv)operator(\);) - ident(memo)operator([)integer(2)operator(]) operator(=) integer(0)operator(;) - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(obj)operator(,) ident(zip_i)operator(,) operator(()ident(VALUE)operator(\))ident(memo)operator(\);) - - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * The Enumerable mixin provides collection classes with - * several traversal and searching methods, and with the ability to - * sort. The class must provide a method each, which - * yields successive members of the collection. If - * Enumerable#max, #min, or - * #sort is used, the objects in the collection must also - * implement a meaningful <=> operator, as these methods - * rely on an ordering between members of the collection. - */) - -directive(void) -ident(Init_Enumerable)operator((\)) -operator({) - ident(rb_mEnumerable) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_to_a)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_to_a)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_sort)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_sort_by)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_grep)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_find)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_find)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_find_all)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_find_all)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_reject)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_collect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_collect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_inject)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_partition)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_all)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_any)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_min)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_max)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_member)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_member)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,)stringoperator(,) ident(enum_each_with_index)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mEnumerable)operator(,) stringoperator(,) ident(enum_zip)operator(,) operator(-)integer(1)operator(\);) - - ident(id_eqq) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_each) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_cmp) operator(=) ident(rb_intern)operator(()string)delimiter(")>operator(\);) -operator(}) - -comment(/********************************************************************** - - error.c - - - $Author: shyouhei $ - $Date: 2008-08-04 05:16:55 +0200 (Mon, 04 Aug 2008\) $ - created at: Mon Aug 9 16:11:34 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("env.h") -preprocessor(#include) include("st.h") - -preprocessor(#include) include() -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -preprocessor(#include) include() -preprocessor(#define) ident(va_init_list)operator(()ident(a)operator(,)ident(b)operator(\)) ident(va_start)operator(()ident(a)operator(,)ident(b)operator(\)) -preprocessor(#else) -preprocessor(#include) include() -preprocessor(#define) ident(va_init_list)operator(()ident(a)operator(,)ident(b)operator(\)) ident(va_start)operator(()ident(a)operator(\)) -preprocessor(#endif) -preprocessor(#ifdef) ident(HAVE_STDLIB_H) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#ifndef) ident(EXIT_SUCCESS) -preprocessor(#define) ident(EXIT_SUCCESS) integer(0) -preprocessor(#endif) - -directive(extern) directive(const) pre_type(char) ident(ruby_version)operator([],) ident(ruby_release_date)operator([],) ident(ruby_platform)operator([];) - -pre_type(int) ident(ruby_nerrs)operator(;) - -directive(static) pre_type(int) -ident(err_position)operator(()ident(buf)operator(,) ident(len)operator(\)) - pre_type(char) operator(*)ident(buf)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - ident(ruby_set_current_source)operator((\);) - reserved(if) operator((!)ident(ruby_sourcefile)operator(\)) operator({) - reserved(return) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ruby_sourceline) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(snprintf)operator(()ident(buf)operator(,) ident(len)operator(,) stringoperator(,) ident(ruby_sourcefile)operator(\);) - operator(}) - reserved(else) operator({) - reserved(return) ident(snprintf)operator(()ident(buf)operator(,) ident(len)operator(,) stringoperator(,) ident(ruby_sourcefile)operator(,) ident(ruby_sourceline)operator(\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(err_snprintf)operator(()ident(buf)operator(,) ident(len)operator(,) ident(fmt)operator(,) ident(args)operator(\)) - pre_type(char) operator(*)ident(buf)operator(;) - pre_type(long) ident(len)operator(;) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_list) ident(args)operator(;) -operator({) - pre_type(long) ident(n)operator(;) - - ident(n) operator(=) ident(err_position)operator(()ident(buf)operator(,) ident(len)operator(\);) - reserved(if) operator(()ident(len) operator(>) ident(n)operator(\)) operator({) - ident(vsnprintf)operator((()pre_type(char)operator(*\))ident(buf)operator(+)ident(n)operator(,) ident(len)operator(-)ident(n)operator(,) ident(fmt)operator(,) ident(args)operator(\);) - operator(}) -operator(}) - -directive(static) directive(void) ident(err_append) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -directive(static) directive(void) -ident(err_print)operator(()ident(fmt)operator(,) ident(args)operator(\)) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_list) ident(args)operator(;) -operator({) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - - ident(err_snprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) ident(fmt)operator(,) ident(args)operator(\);) - ident(err_append)operator(()ident(buf)operator(\);) -operator(}) - -directive(void) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_compile_error)operator(()directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_compile_error)operator(()ident(fmt)operator(,) ident(va_alist)operator(\)) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(va_list) ident(args)operator(;) - - ident(va_init_list)operator(()ident(args)operator(,) ident(fmt)operator(\);) - ident(err_print)operator(()ident(fmt)operator(,) ident(args)operator(\);) - ident(va_end)operator(()ident(args)operator(\);) - ident(ruby_nerrs)operator(++;) -operator(}) - -directive(void) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_compile_error_append)operator(()directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_compile_error_append)operator(()ident(fmt)operator(,) ident(va_alist)operator(\)) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(va_list) ident(args)operator(;) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - - ident(va_init_list)operator(()ident(args)operator(,) ident(fmt)operator(\);) - ident(vsnprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) ident(fmt)operator(,) ident(args)operator(\);) - ident(va_end)operator(()ident(args)operator(\);) - ident(err_append)operator(()ident(buf)operator(\);) -operator(}) - -directive(static) directive(void) -ident(warn_print)operator(()ident(fmt)operator(,) ident(args)operator(\)) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_list) ident(args)operator(;) -operator({) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - pre_type(int) ident(len)operator(;) - - ident(err_snprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) ident(fmt)operator(,) ident(args)operator(\);) - ident(len) operator(=) ident(strlen)operator(()ident(buf)operator(\);) - ident(buf)operator([)ident(len)operator(++]) operator(=) char('\\n')operator(;) - ident(rb_write_error2)operator(()ident(buf)operator(,) ident(len)operator(\);) -operator(}) - -directive(void) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_warn)operator(()directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_warn)operator(()ident(fmt)operator(,) ident(va_alist)operator(\)) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - ident(va_list) ident(args)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_verbose)operator(\)\)) reserved(return)operator(;) - - ident(snprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) stringoperator(,) ident(fmt)operator(\);) - - ident(va_init_list)operator(()ident(args)operator(,) ident(fmt)operator(\);) - ident(warn_print)operator(()ident(buf)operator(,) ident(args)operator(\);) - ident(va_end)operator(()ident(args)operator(\);) -operator(}) - -comment(/* rb_warning(\) reports only in verbose mode */) -directive(void) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_warning)operator(()directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_warning)operator(()ident(fmt)operator(,) ident(va_alist)operator(\)) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - ident(va_list) ident(args)operator(;) - - reserved(if) operator((!)ident(RTEST)operator(()ident(ruby_verbose)operator(\)\)) reserved(return)operator(;) - - ident(snprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) stringoperator(,) ident(fmt)operator(\);) - - ident(va_init_list)operator(()ident(args)operator(,) ident(fmt)operator(\);) - ident(warn_print)operator(()ident(buf)operator(,) ident(args)operator(\);) - ident(va_end)operator(()ident(args)operator(\);) -operator(}) - -comment(/* - * call-seq: - * warn(msg\) => nil - * - * Display the given message (followed by a newline\) on STDERR unless - * warnings are disabled (for example with the -W0 flag\). - */) - -directive(static) ident(VALUE) -ident(rb_warn_m)operator(()ident(self)operator(,) ident(mesg)operator(\)) - ident(VALUE) ident(self)operator(,) ident(mesg)operator(;) -operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(ruby_verbose)operator(\)\)) operator({) - ident(rb_io_write)operator(()ident(rb_stderr)operator(,) ident(mesg)operator(\);) - ident(rb_io_write)operator(()ident(rb_stderr)operator(,) ident(rb_default_rs)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(void) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_bug)operator(()directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_bug)operator(()ident(fmt)operator(,) ident(va_alist)operator(\)) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - ident(va_list) ident(args)operator(;) - ident(FILE) operator(*)ident(out) operator(=) ident(stderr)operator(;) - pre_type(int) ident(len) operator(=) ident(err_position)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(\);) - - reserved(if) operator(()ident(fwrite)operator(()ident(buf)operator(,) integer(1)operator(,) ident(len)operator(,) ident(out)operator(\)) operator(==) ident(len) operator(||) - ident(fwrite)operator(()ident(buf)operator(,) integer(1)operator(,) ident(len)operator(,) operator(()ident(out) operator(=) ident(stdout)operator(\)\)) operator(==) ident(len)operator(\)) operator({) - ident(fputs)operator(()stringoperator(,) ident(out)operator(\);) - ident(va_init_list)operator(()ident(args)operator(,) ident(fmt)operator(\);) - ident(vfprintf)operator(()ident(out)operator(,) ident(fmt)operator(,) ident(args)operator(\);) - ident(va_end)operator(()ident(args)operator(\);) - ident(fprintf)operator(()ident(out)operator(,) stringoperator(,) - ident(ruby_version)operator(,) ident(ruby_release_date)operator(,) ident(ruby_platform)operator(\);) - operator(}) - ident(abort)operator((\);) -operator(}) - -directive(static) reserved(struct) ident(types) operator({) - pre_type(int) ident(type)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator(}) ident(builtin_types)operator([]) operator(=) operator({) - operator({)ident(T_NIL)operator(,) stringoperator(},) - operator({)ident(T_OBJECT)operator(,) stringoperator(},) - operator({)ident(T_CLASS)operator(,) stringoperator(},) - operator({)ident(T_ICLASS)operator(,) stringoperator(},) comment(/* internal use: mixed-in module holder */) - operator({)ident(T_MODULE)operator(,) stringoperator(},) - operator({)ident(T_FLOAT)operator(,) stringoperator(},) - operator({)ident(T_STRING)operator(,) stringoperator(},) - operator({)ident(T_REGEXP)operator(,) stringoperator(},) - operator({)ident(T_ARRAY)operator(,) stringoperator(},) - operator({)ident(T_FIXNUM)operator(,) stringoperator(},) - operator({)ident(T_HASH)operator(,) stringoperator(},) - operator({)ident(T_STRUCT)operator(,) stringoperator(},) - operator({)ident(T_BIGNUM)operator(,) stringoperator(},) - operator({)ident(T_FILE)operator(,) stringoperator(},) - operator({)ident(T_TRUE)operator(,) stringoperator(},) - operator({)ident(T_FALSE)operator(,) stringoperator(},) - operator({)ident(T_SYMBOL)operator(,) stringoperator(},) comment(/* :symbol */) - operator({)ident(T_DATA)operator(,) stringoperator(},) comment(/* internal use: wrapped C pointers */) - operator({)ident(T_MATCH)operator(,) stringoperator(},) comment(/* data of $~ */) - operator({)ident(T_VARMAP)operator(,) stringoperator(},) comment(/* internal use: dynamic variables */) - operator({)ident(T_SCOPE)operator(,) stringoperator(},) comment(/* internal use: variable scope */) - operator({)ident(T_NODE)operator(,) stringoperator(},) comment(/* internal use: syntax tree node */) - operator({)ident(T_UNDEF)operator(,) stringoperator(},) comment(/* internal use: #undef; should not happen */) - operator({-)integer(1)operator(,) integer(0)operator(}) -operator(};) - -directive(void) -ident(rb_check_type)operator(()ident(x)operator(,) ident(t)operator(\)) - ident(VALUE) ident(x)operator(;) - pre_type(int) ident(t)operator(;) -operator({) - reserved(struct) ident(types) operator(*)ident(type) operator(=) ident(builtin_types)operator(;) - - reserved(if) operator(()ident(x) operator(==) ident(Qundef)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(TYPE)operator(()ident(x)operator(\)) operator(!=) ident(t)operator(\)) operator({) - reserved(while) operator(()ident(type)operator(->)ident(type) operator(>=) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(type)operator(->)ident(type) operator(==) ident(t)operator(\)) operator({) - pre_type(char) operator(*)ident(etype)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(x)operator(\)\)) operator({) - ident(etype) operator(=) stringoperator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(FIXNUM_P)operator(()ident(x)operator(\)\)) operator({) - ident(etype) operator(=) stringoperator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(SYMBOL_P)operator(()ident(x)operator(\)\)) operator({) - ident(etype) operator(=) stringoperator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(rb_special_const_p)operator(()ident(x)operator(\)\)) operator({) - ident(etype) operator(=) ident(RSTRING)operator(()ident(rb_obj_as_string)operator(()ident(x)operator(\)\)->)ident(ptr)operator(;) - operator(}) - reserved(else) operator({) - ident(etype) operator(=) ident(rb_obj_classname)operator(()ident(x)operator(\);) - operator(}) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(etype)operator(,) ident(type)operator(->)ident(name)operator(\);) - operator(}) - ident(type)operator(++;) - operator(}) - ident(rb_bug)operator(()stringoperator(,) ident(t)operator(\);) - operator(}) -operator(}) - -comment(/* exception classes */) -preprocessor(#include) include() - -ident(VALUE) ident(rb_eException)operator(;) -ident(VALUE) ident(rb_eSystemExit)operator(;) -ident(VALUE) ident(rb_eInterrupt)operator(;) -ident(VALUE) ident(rb_eSignal)operator(;) -ident(VALUE) ident(rb_eFatal)operator(;) -ident(VALUE) ident(rb_eStandardError)operator(;) -ident(VALUE) ident(rb_eRuntimeError)operator(;) -ident(VALUE) ident(rb_eTypeError)operator(;) -ident(VALUE) ident(rb_eArgError)operator(;) -ident(VALUE) ident(rb_eIndexError)operator(;) -ident(VALUE) ident(rb_eRangeError)operator(;) -ident(VALUE) ident(rb_eNameError)operator(;) -ident(VALUE) ident(rb_eNoMethodError)operator(;) -ident(VALUE) ident(rb_eSecurityError)operator(;) -ident(VALUE) ident(rb_eNotImpError)operator(;) -ident(VALUE) ident(rb_eNoMemError)operator(;) -ident(VALUE) ident(rb_cNameErrorMesg)operator(;) - -ident(VALUE) ident(rb_eScriptError)operator(;) -ident(VALUE) ident(rb_eSyntaxError)operator(;) -ident(VALUE) ident(rb_eLoadError)operator(;) - -ident(VALUE) ident(rb_eSystemCallError)operator(;) -ident(VALUE) ident(rb_mErrno)operator(;) - -ident(VALUE) -ident(rb_exc_new)operator(()ident(etype)operator(,) ident(ptr)operator(,) ident(len)operator(\)) - ident(VALUE) ident(etype)operator(;) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(etype)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(rb_str_new)operator(()ident(ptr)operator(,) ident(len)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_exc_new2)operator(()ident(etype)operator(,) ident(s)operator(\)) - ident(VALUE) ident(etype)operator(;) - directive(const) pre_type(char) operator(*)ident(s)operator(;) -operator({) - reserved(return) ident(rb_exc_new)operator(()ident(etype)operator(,) ident(s)operator(,) ident(strlen)operator(()ident(s)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_exc_new3)operator(()ident(etype)operator(,) ident(str)operator(\)) - ident(VALUE) ident(etype)operator(,) ident(str)operator(;) -operator({) - ident(StringValue)operator(()ident(str)operator(\);) - reserved(return) ident(rb_funcall)operator(()ident(etype)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(str)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Exception.new(msg = nil\) => exception - * - * Construct a new Exception object, optionally passing in - * a message. - */) - -directive(static) ident(VALUE) -ident(exc_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(exc)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(exc)operator(;) -operator({) - ident(VALUE) ident(arg)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(arg)operator(\);) - ident(rb_iv_set)operator(()ident(exc)operator(,) stringoperator(,) ident(arg)operator(\);) - ident(rb_iv_set)operator(()ident(exc)operator(,) stringoperator(,) ident(Qnil)operator(\);) - - reserved(return) ident(exc)operator(;) -operator(}) - -comment(/* - * Document-method: exception - * - * call-seq: - * exc.exception(string\) -> an_exception or exc - * - * With no argument, or if the argument is the same as the receiver, - * return the receiver. Otherwise, create a new - * exception object of the same class as the receiver, but with a - * message equal to string.to_str. - * - */) - -directive(static) ident(VALUE) -ident(exc_exception)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - ident(VALUE) ident(exc)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) reserved(return) ident(self)operator(;) - reserved(if) operator(()ident(argc) operator(==) integer(1) operator(&&) ident(self) operator(==) ident(argv)operator([)integer(0)operator(]\)) reserved(return) ident(self)operator(;) - ident(exc) operator(=) ident(rb_obj_clone)operator(()ident(self)operator(\);) - ident(exc_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(exc)operator(\);) - - reserved(return) ident(exc)operator(;) -operator(}) - -comment(/* - * call-seq: - * exception.to_s => string - * - * Returns exception's message (or the name of the exception if - * no message is set\). - */) - -directive(static) ident(VALUE) -ident(exc_to_s)operator(()ident(exc)operator(\)) - ident(VALUE) ident(exc)operator(;) -operator({) - ident(VALUE) ident(mesg) operator(=) ident(rb_attr_get)operator(()ident(exc)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(mesg)operator(\)\)) reserved(return) ident(rb_class_name)operator(()ident(CLASS_OF)operator(()ident(exc)operator(\)\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(exc)operator(\)\)) ident(OBJ_TAINT)operator(()ident(mesg)operator(\);) - reserved(return) ident(mesg)operator(;) -operator(}) - -comment(/* - * call-seq: - * exception.message => string - * exception.to_str => string - * - * Returns the result of invoking exception.to_s. - * Normally this returns the exception's message or name. By - * supplying a to_str method, exceptions are agreeing to - * be used where Strings are expected. - */) - -directive(static) ident(VALUE) -ident(exc_to_str)operator(()ident(exc)operator(\)) - ident(VALUE) ident(exc)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(exc)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * exception.inspect => string - * - * Return this exception's class name an message - */) - -directive(static) ident(VALUE) -ident(exc_inspect)operator(()ident(exc)operator(\)) - ident(VALUE) ident(exc)operator(;) -operator({) - ident(VALUE) ident(str)operator(,) ident(klass)operator(;) - - ident(klass) operator(=) ident(CLASS_OF)operator(()ident(exc)operator(\);) - ident(exc) operator(=) ident(rb_obj_as_string)operator(()ident(exc)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(exc)operator(\)->)ident(len) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(rb_str_dup)operator(()ident(rb_class_name)operator(()ident(klass)operator(\)\);) - operator(}) - - ident(str) operator(=) ident(rb_str_buf_new2)operator(()stringoperator(\);) - ident(klass) operator(=) ident(rb_class_name)operator(()ident(klass)operator(\);) - ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(klass)operator(\);) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) stringoperator(,) integer(2)operator(\);) - ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(exc)operator(\);) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) string)delimiter(")>operator(,) integer(1)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * exception.backtrace => array - * - * Returns any backtrace associated with the exception. The backtrace - * is an array of strings, each containing either ``filename:lineNo: in - * `method''' or ``filename:lineNo.'' - * - * def a - * raise "boom" - * end - * - * def b - * a(\) - * end - * - * begin - * b(\) - * rescue => detail - * print detail.backtrace.join("\\n"\) - * end - * - * produces: - * - * prog.rb:2:in `a' - * prog.rb:6:in `b' - * prog.rb:10 -*/) - -directive(static) ident(VALUE) -ident(exc_backtrace)operator(()ident(exc)operator(\)) - ident(VALUE) ident(exc)operator(;) -operator({) - directive(static) ident(ID) ident(bt)operator(;) - - reserved(if) operator((!)ident(bt)operator(\)) ident(bt) operator(=) ident(rb_intern)operator(()stringoperator(\);) - reserved(return) ident(rb_attr_get)operator(()ident(exc)operator(,) ident(bt)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_check_backtrace)operator(()ident(bt)operator(\)) - ident(VALUE) ident(bt)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - directive(static) pre_type(char) operator(*)ident(err) operator(=) stringoperator(;) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(bt)operator(\)\)) operator({) - pre_type(int) ident(t) operator(=) ident(TYPE)operator(()ident(bt)operator(\);) - - reserved(if) operator(()ident(t) operator(==) ident(T_STRING)operator(\)) reserved(return) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(bt)operator(\);) - reserved(if) operator(()ident(t) operator(!=) ident(T_ARRAY)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) ident(err)operator(\);) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;)ident(i)operator(<)ident(RARRAY)operator(()ident(bt)operator(\)->)ident(len)operator(;)ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(RARRAY)operator(()ident(bt)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)) operator(!=) ident(T_STRING)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) ident(err)operator(\);) - operator(}) - operator(}) - operator(}) - reserved(return) ident(bt)operator(;) -operator(}) - -comment(/* - * call-seq: - * exc.set_backtrace(array\) => array - * - * Sets the backtrace information associated with exc. The - * argument must be an array of String objects in the - * format described in Exception#backtrace. - * - */) - -directive(static) ident(VALUE) -ident(exc_set_backtrace)operator(()ident(exc)operator(,) ident(bt)operator(\)) - ident(VALUE) ident(exc)operator(;) - ident(VALUE) ident(bt)operator(;) -operator({) - reserved(return) ident(rb_iv_set)operator(()ident(exc)operator(,) stringoperator(,) ident(rb_check_backtrace)operator(()ident(bt)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * SystemExit.new(status=0\) => system_exit - * - * Create a new +SystemExit+ exception with the given status. - */) - -directive(static) ident(VALUE) -ident(exit_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(exc)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(exc)operator(;) -operator({) - ident(VALUE) ident(status) operator(=) ident(INT2FIX)operator(()ident(EXIT_SUCCESS)operator(\);) - reserved(if) operator(()ident(argc) operator(>) integer(0) operator(&&) ident(FIXNUM_P)operator(()ident(argv)operator([)integer(0)operator(]\)\)) operator({) - ident(status) operator(=) operator(*)ident(argv)operator(++;) - operator(--)ident(argc)operator(;) - operator(}) - ident(rb_call_super)operator(()ident(argc)operator(,) ident(argv)operator(\);) - ident(rb_iv_set)operator(()ident(exc)operator(,) stringoperator(,) ident(status)operator(\);) - reserved(return) ident(exc)operator(;) -operator(}) - - -comment(/* - * call-seq: - * system_exit.status => fixnum - * - * Return the status value associated with this system exit. - */) - -directive(static) ident(VALUE) -ident(exit_status)operator(()ident(exc)operator(\)) - ident(VALUE) ident(exc)operator(;) -operator({) - reserved(return) ident(rb_attr_get)operator(()ident(exc)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * system_exit.success? => true or false - * - * Returns +true+ if exiting successful, +false+ if not. - */) - -directive(static) ident(VALUE) -ident(exit_success_p)operator(()ident(exc)operator(\)) - ident(VALUE) ident(exc)operator(;) -operator({) - ident(VALUE) ident(status) operator(=) ident(rb_attr_get)operator(()ident(exc)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(status)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(status) operator(==) ident(INT2FIX)operator(()ident(EXIT_SUCCESS)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(void) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_name_error)operator(()ident(ID) ident(id)operator(,) directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_name_error)operator(()ident(id)operator(,) ident(fmt)operator(,) ident(va_alist)operator(\)) - ident(ID) ident(id)operator(;) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(VALUE) ident(exc)operator(,) ident(argv)operator([)integer(2)operator(];) - ident(va_list) ident(args)operator(;) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - - ident(va_init_list)operator(()ident(args)operator(,) ident(fmt)operator(\);) - ident(vsnprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) ident(fmt)operator(,) ident(args)operator(\);) - ident(va_end)operator(()ident(args)operator(\);) - - ident(argv)operator([)integer(0)operator(]) operator(=) ident(rb_str_new2)operator(()ident(buf)operator(\);) - ident(argv)operator([)integer(1)operator(]) operator(=) ident(ID2SYM)operator(()ident(id)operator(\);) - ident(exc) operator(=) ident(rb_class_new_instance)operator(()integer(2)operator(,) ident(argv)operator(,) ident(rb_eNameError)operator(\);) - ident(rb_exc_raise)operator(()ident(exc)operator(\);) -operator(}) - -comment(/* - * call-seq: - * NameError.new(msg [, name]\) => name_error - * - * Construct a new NameError exception. If given the name - * parameter may subsequently be examined using the NameError.name - * method. - */) - -directive(static) ident(VALUE) -ident(name_err_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - ident(VALUE) ident(name)operator(;) - - ident(name) operator(=) operator(()ident(argc) operator(>) integer(1)operator(\)) operator(?) ident(argv)operator([--)ident(argc)operator(]) operator(:) ident(Qnil)operator(;) - ident(rb_call_super)operator(()ident(argc)operator(,) ident(argv)operator(\);) - ident(rb_iv_set)operator(()ident(self)operator(,) stringoperator(,) ident(name)operator(\);) - reserved(return) ident(self)operator(;) -operator(}) - -comment(/* - * call-seq: - * name_error.name => string or nil - * - * Return the name associated with this NameError exception. - */) - -directive(static) ident(VALUE) -ident(name_err_name)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(rb_attr_get)operator(()ident(self)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) -operator(}) - -comment(/* - * call-seq: - * name_error.to_s => string - * - * Produce a nicely-formated string representing the +NameError+. - */) - -directive(static) ident(VALUE) -ident(name_err_to_s)operator(()ident(exc)operator(\)) - ident(VALUE) ident(exc)operator(;) -operator({) - ident(VALUE) ident(mesg) operator(=) ident(rb_attr_get)operator(()ident(exc)operator(,) ident(rb_intern)operator(()stringoperator(\)\),) ident(str) operator(=) ident(mesg)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(mesg)operator(\)\)) reserved(return) ident(rb_class_name)operator(()ident(CLASS_OF)operator(()ident(exc)operator(\)\);) - ident(StringValue)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(str) operator(!=) ident(mesg)operator(\)) operator({) - ident(rb_iv_set)operator(()ident(exc)operator(,) stringoperator(,) ident(mesg) operator(=) ident(str)operator(\);) - operator(}) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(exc)operator(\)\)) ident(OBJ_TAINT)operator(()ident(mesg)operator(\);) - reserved(return) ident(mesg)operator(;) -operator(}) - -comment(/* - * call-seq: - * NoMethodError.new(msg, name [, args]\) => no_method_error - * - * Construct a NoMethodError exception for a method of the given name - * called with the given arguments. The name may be accessed using - * the #name method on the resulting object, and the - * arguments using the #args method. - */) - -directive(static) ident(VALUE) -ident(nometh_err_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - ident(VALUE) ident(args) operator(=) operator(()ident(argc) operator(>) integer(2)operator(\)) operator(?) ident(argv)operator([--)ident(argc)operator(]) operator(:) ident(Qnil)operator(;) - ident(name_err_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\);) - ident(rb_iv_set)operator(()ident(self)operator(,) stringoperator(,) ident(args)operator(\);) - reserved(return) ident(self)operator(;) -operator(}) - -comment(/* :nodoc: */) -directive(static) directive(void) -ident(name_err_mesg_mark)operator(()ident(ptr)operator(\)) - ident(VALUE) operator(*)ident(ptr)operator(;) -operator({) - ident(rb_gc_mark_locations)operator(()ident(ptr)operator(,) ident(ptr)operator(+)integer(3)operator(\);) -operator(}) - -comment(/* :nodoc: */) -directive(static) ident(VALUE) -ident(name_err_mesg_new)operator(()ident(obj)operator(,) ident(mesg)operator(,) ident(recv)operator(,) ident(method)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(mesg)operator(,) ident(recv)operator(,) ident(method)operator(;) -operator({) - ident(VALUE) operator(*)ident(ptr) operator(=) ident(ALLOC_N)operator(()ident(VALUE)operator(,) integer(3)operator(\);) - - ident(ptr)operator([)integer(0)operator(]) operator(=) ident(mesg)operator(;) - ident(ptr)operator([)integer(1)operator(]) operator(=) ident(recv)operator(;) - ident(ptr)operator([)integer(2)operator(]) operator(=) ident(method)operator(;) - reserved(return) ident(Data_Wrap_Struct)operator(()ident(rb_cNameErrorMesg)operator(,) ident(name_err_mesg_mark)operator(,) operator(-)integer(1)operator(,) ident(ptr)operator(\);) -operator(}) - -comment(/* :nodoc: */) -directive(static) ident(VALUE) -ident(name_err_mesg_to_str)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) operator(*)ident(ptr)operator(,) ident(mesg)operator(;) - ident(Data_Get_Struct)operator(()ident(obj)operator(,) ident(VALUE)operator(,) ident(ptr)operator(\);) - - ident(mesg) operator(=) ident(ptr)operator([)integer(0)operator(];) - reserved(if) operator(()ident(NIL_P)operator(()ident(mesg)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(else) operator({) - pre_type(char) operator(*)ident(desc) operator(=) integer(0)operator(;) - ident(VALUE) ident(d) operator(=) integer(0)operator(,) ident(args)operator([)integer(3)operator(];) - - ident(obj) operator(=) ident(ptr)operator([)integer(1)operator(];) - reserved(switch) operator(()ident(TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_NIL)operator(:) - ident(desc) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(T_TRUE)operator(:) - ident(desc) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(T_FALSE)operator(:) - ident(desc) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(d) operator(=) ident(rb_protect)operator(()ident(rb_inspect)operator(,) ident(obj)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(d)operator(\)) operator(||) ident(RSTRING)operator(()ident(d)operator(\)->)ident(len) operator(>) integer(65)operator(\)) operator({) - ident(d) operator(=) ident(rb_any_to_s)operator(()ident(obj)operator(\);) - operator(}) - ident(desc) operator(=) ident(RSTRING)operator(()ident(d)operator(\)->)ident(ptr)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(desc) operator(&&) ident(desc)operator([)integer(0)operator(]) operator(!=) char('#')operator(\)) operator({) - ident(d) operator(=) ident(rb_str_new2)operator(()ident(desc)operator(\);) - ident(rb_str_cat2)operator(()ident(d)operator(,) stringoperator(\);) - ident(rb_str_cat2)operator(()ident(d)operator(,) ident(rb_obj_classname)operator(()ident(obj)operator(\)\);) - operator(}) - ident(args)operator([)integer(0)operator(]) operator(=) ident(mesg)operator(;) - ident(args)operator([)integer(1)operator(]) operator(=) ident(ptr)operator([)integer(2)operator(];) - ident(args)operator([)integer(2)operator(]) operator(=) ident(d)operator(;) - ident(mesg) operator(=) ident(rb_f_sprintf)operator(()integer(3)operator(,) ident(args)operator(\);) - operator(}) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(obj)operator(\)\)) ident(OBJ_TAINT)operator(()ident(mesg)operator(\);) - reserved(return) ident(mesg)operator(;) -operator(}) - -comment(/* :nodoc: */) -directive(static) ident(VALUE) -ident(name_err_mesg_load)operator(()ident(klass)operator(,) ident(str)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(str)operator(;) -operator({) - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * no_method_error.args => obj - * - * Return the arguments passed in as the third parameter to - * the constructor. - */) - -directive(static) ident(VALUE) -ident(nometh_err_args)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(rb_attr_get)operator(()ident(self)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) -operator(}) - -directive(void) -ident(rb_invalid_str)operator(()ident(str)operator(,) ident(type)operator(\)) - directive(const) pre_type(char) operator(*)ident(str)operator(,) operator(*)ident(type)operator(;) -operator({) - ident(VALUE) ident(s) operator(=) ident(rb_str_inspect)operator(()ident(rb_str_new2)operator(()ident(str)operator(\)\);) - - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(type)operator(,) ident(RSTRING)operator(()ident(s)operator(\)->)ident(ptr)operator(\);) -operator(}) - -comment(/* - * Document-module: Errno - * - * Ruby exception objects are subclasses of Exception. - * However, operating systems typically report errors using plain - * integers. Module Errno is created dynamically to map - * these operating system errors to Ruby classes, with each error - * number generating its own subclass of SystemCallError. - * As the subclass is created in module Errno, its name - * will start Errno::. - * - * The names of the Errno:: classes depend on - * the environment in which Ruby runs. On a typical Unix or Windows - * platform, there are Errno classes such as - * Errno::EACCES, Errno::EAGAIN, - * Errno::EINTR, and so on. - * - * The integer operating system error number corresponding to a - * particular error is available as the class constant - * Errno::error::Errno. - * - * Errno::EACCES::Errno #=> 13 - * Errno::EAGAIN::Errno #=> 11 - * Errno::EINTR::Errno #=> 4 - * - * The full list of operating system errors on your particular platform - * are available as the constants of Errno. - * - * Errno.constants #=> E2BIG, EACCES, EADDRINUSE, EADDRNOTAVAIL, ... - */) - -directive(static) ident(st_table) operator(*)ident(syserr_tbl)operator(;) - -directive(static) ident(VALUE) -ident(set_syserr)operator(()ident(n)operator(,) ident(name)operator(\)) - pre_type(int) ident(n)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(VALUE) ident(error)operator(;) - - reserved(if) operator((!)ident(st_lookup)operator(()ident(syserr_tbl)operator(,) ident(n)operator(,) operator(&)ident(error)operator(\)\)) operator({) - ident(error) operator(=) ident(rb_define_class_under)operator(()ident(rb_mErrno)operator(,) ident(name)operator(,) ident(rb_eSystemCallError)operator(\);) - ident(rb_define_const)operator(()ident(error)operator(,) stringoperator(,) ident(INT2NUM)operator(()ident(n)operator(\)\);) - ident(st_add_direct)operator(()ident(syserr_tbl)operator(,) ident(n)operator(,) ident(error)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_define_const)operator(()ident(rb_mErrno)operator(,) ident(name)operator(,) ident(error)operator(\);) - operator(}) - reserved(return) ident(error)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(get_syserr)operator(()ident(n)operator(\)) - pre_type(int) ident(n)operator(;) -operator({) - ident(VALUE) ident(error)operator(;) - - reserved(if) operator((!)ident(st_lookup)operator(()ident(syserr_tbl)operator(,) ident(n)operator(,) operator(&)ident(error)operator(\)\)) operator({) - pre_type(char) ident(name)operator([)integer(8)operator(];) comment(/* some Windows' errno have 5 digits. */) - - ident(snprintf)operator(()ident(name)operator(,) reserved(sizeof)operator(()ident(name)operator(\),) stringoperator(,) ident(n)operator(\);) - ident(error) operator(=) ident(set_syserr)operator(()ident(n)operator(,) ident(name)operator(\);) - operator(}) - reserved(return) ident(error)operator(;) -operator(}) - -comment(/* - * call-seq: - * SystemCallError.new(msg, errno\) => system_call_error_subclass - * - * If _errno_ corresponds to a known system error code, constructs - * the appropriate Errno class for that error, otherwise - * constructs a generic SystemCallError object. The - * error number is subsequently available via the errno - * method. - */) - -directive(static) ident(VALUE) -ident(syserr_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) -preprocessor(#if) operator(!)ident(defined)operator(()ident(_WIN32)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__VMS)operator(\)) - pre_type(char) operator(*)ident(strerror)operator((\);) -preprocessor(#endif) - pre_type(char) operator(*)ident(err)operator(;) - ident(VALUE) ident(mesg)operator(,) ident(error)operator(;) - ident(VALUE) ident(klass) operator(=) ident(rb_obj_class)operator(()ident(self)operator(\);) - - reserved(if) operator(()ident(klass) operator(==) ident(rb_eSystemCallError)operator(\)) operator({) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(mesg)operator(,) operator(&)ident(error)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(1) operator(&&) ident(FIXNUM_P)operator(()ident(mesg)operator(\)\)) operator({) - ident(error) operator(=) ident(mesg)operator(;) ident(mesg) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(if) operator((!)ident(NIL_P)operator(()ident(error)operator(\)) operator(&&) ident(st_lookup)operator(()ident(syserr_tbl)operator(,) ident(NUM2LONG)operator(()ident(error)operator(\),) operator(&)ident(klass)operator(\)\)) operator({) - comment(/* change class */) - reserved(if) operator(()ident(TYPE)operator(()ident(self)operator(\)) operator(!=) ident(T_OBJECT)operator(\)) operator({) comment(/* insurance to avoid type crash */) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(RBASIC)operator(()ident(self)operator(\)->)ident(klass) operator(=) ident(klass)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(mesg)operator(\);) - ident(error) operator(=) ident(rb_const_get)operator(()ident(klass)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) - operator(}) - reserved(if) operator((!)ident(NIL_P)operator(()ident(error)operator(\)\)) ident(err) operator(=) ident(strerror)operator(()ident(NUM2LONG)operator(()ident(error)operator(\)\);) - reserved(else) ident(err) operator(=) stringoperator(;) - reserved(if) operator((!)ident(NIL_P)operator(()ident(mesg)operator(\)\)) operator({) - ident(VALUE) ident(str) operator(=) ident(mesg)operator(;) - ident(size_t) ident(len)operator(;) - - ident(StringValue)operator(()ident(str)operator(\);) - ident(len) operator(=) ident(strlen)operator(()ident(err)operator(\)+)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(+)integer(3)operator(;) - ident(mesg) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) - ident(snprintf)operator(()ident(RSTRING)operator(()ident(mesg)operator(\)->)ident(ptr)operator(,) ident(len)operator(+)integer(1)operator(,) stringoperator(,) ident(err)operator(,) - operator(()pre_type(int)operator(\))ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - ident(rb_str_resize)operator(()ident(mesg)operator(,) ident(strlen)operator(()ident(RSTRING)operator(()ident(mesg)operator(\)->)ident(ptr)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(mesg) operator(=) ident(rb_str_new2)operator(()ident(err)operator(\);) - operator(}) - ident(rb_call_super)operator(()integer(1)operator(,) operator(&)ident(mesg)operator(\);) - ident(rb_iv_set)operator(()ident(self)operator(,) stringoperator(,) ident(error)operator(\);) - reserved(return) ident(self)operator(;) -operator(}) - -comment(/* - * call-seq: - * system_call_error.errno => fixnum - * - * Return this SystemCallError's error number. - */) - -directive(static) ident(VALUE) -ident(syserr_errno)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(rb_attr_get)operator(()ident(self)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) -operator(}) - -comment(/* - * call-seq: - * system_call_error === other => true or false - * - * Return +true+ if the receiver is a generic +SystemCallError+, or - * if the error numbers _self_ and _other_ are the same. - */) - - -directive(static) ident(VALUE) -ident(syserr_eqq)operator(()ident(self)operator(,) ident(exc)operator(\)) - ident(VALUE) ident(self)operator(,) ident(exc)operator(;) -operator({) - ident(VALUE) ident(num)operator(,) ident(e)operator(;) - - reserved(if) operator((!)ident(rb_obj_is_kind_of)operator(()ident(exc)operator(,) ident(rb_eSystemCallError)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(self) operator(==) ident(rb_eSystemCallError)operator(\)) reserved(return) ident(Qtrue)operator(;) - - ident(num) operator(=) ident(rb_attr_get)operator(()ident(exc)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(num)operator(\)\)) operator({) - ident(VALUE) ident(klass) operator(=) ident(CLASS_OF)operator(()ident(exc)operator(\);) - - reserved(while) operator(()ident(TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_ICLASS) operator(||) ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(klass) operator(=) operator(()ident(VALUE)operator(\))ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(;) - operator(}) - ident(num) operator(=) ident(rb_const_get)operator(()ident(klass)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) - operator(}) - ident(e) operator(=) ident(rb_const_get)operator(()ident(self)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(num)operator(\)) operator(?) ident(num) operator(==) ident(e) operator(:) ident(rb_equal)operator(()ident(num)operator(,) ident(e)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * Descendents of class Exception are used to communicate - * between raise methods and rescue - * statements in begin/end blocks. Exception - * objects carry information about the exception---its type (the - * exception's class name\), an optional descriptive string, and - * optional traceback information. Programs may subclass - * Exception to add additional information. - */) - -directive(void) -ident(Init_Exception)operator((\)) -operator({) - ident(rb_eException) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_eException)operator(,) stringoperator(,) ident(rb_class_new_instance)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_eException)operator(,) stringoperator(,) ident(exc_exception)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_eException)operator(,) stringoperator(,) ident(exc_initialize)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_eException)operator(,) stringoperator(,) ident(exc_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_eException)operator(,) stringoperator(,) ident(exc_to_str)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_eException)operator(,) stringoperator(,) ident(exc_to_str)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_eException)operator(,) stringoperator(,) ident(exc_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_eException)operator(,) stringoperator(,) ident(exc_backtrace)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_eException)operator(,) stringoperator(,) ident(exc_set_backtrace)operator(,) integer(1)operator(\);) - - ident(rb_eSystemExit) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eException)operator(\);) - ident(rb_define_method)operator(()ident(rb_eSystemExit)operator(,) stringoperator(,) ident(exit_initialize)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_eSystemExit)operator(,) stringoperator(,) ident(exit_status)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_eSystemExit)operator(,) stringoperator(,) ident(exit_success_p)operator(,) integer(0)operator(\);) - - ident(rb_eFatal) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eException)operator(\);) - ident(rb_eSignal) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eException)operator(\);) - ident(rb_eInterrupt) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eSignal)operator(\);) - - ident(rb_eStandardError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eException)operator(\);) - ident(rb_eTypeError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_eArgError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_eIndexError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_eRangeError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_eNameError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_define_method)operator(()ident(rb_eNameError)operator(,) stringoperator(,) ident(name_err_initialize)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_eNameError)operator(,) stringoperator(,) ident(name_err_name)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_eNameError)operator(,) stringoperator(,) ident(name_err_to_s)operator(,) integer(0)operator(\);) - ident(rb_cNameErrorMesg) operator(=) ident(rb_define_class_under)operator(()ident(rb_eNameError)operator(,) stringoperator(,) ident(rb_cData)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cNameErrorMesg)operator(,) stringoperator(,) ident(name_err_mesg_new)operator(,) integer(3)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNameErrorMesg)operator(,) stringoperator(,) ident(name_err_mesg_to_str)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNameErrorMesg)operator(,) stringoperator(,) ident(name_err_mesg_to_str)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cNameErrorMesg)operator(,) stringoperator(,) ident(name_err_mesg_load)operator(,) integer(1)operator(\);) - ident(rb_eNoMethodError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eNameError)operator(\);) - ident(rb_define_method)operator(()ident(rb_eNoMethodError)operator(,) stringoperator(,) ident(nometh_err_initialize)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_eNoMethodError)operator(,) stringoperator(,) ident(nometh_err_args)operator(,) integer(0)operator(\);) - - ident(rb_eScriptError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eException)operator(\);) - ident(rb_eSyntaxError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eScriptError)operator(\);) - ident(rb_eLoadError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eScriptError)operator(\);) - ident(rb_eNotImpError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eScriptError)operator(\);) - - ident(rb_eRuntimeError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_eSecurityError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_eNoMemError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eException)operator(\);) - - ident(syserr_tbl) operator(=) ident(st_init_numtable)operator((\);) - ident(rb_eSystemCallError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_define_method)operator(()ident(rb_eSystemCallError)operator(,) stringoperator(,) ident(syserr_initialize)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_eSystemCallError)operator(,) stringoperator(,) ident(syserr_errno)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_eSystemCallError)operator(,) stringoperator(,) ident(syserr_eqq)operator(,) integer(1)operator(\);) - - ident(rb_mErrno) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_warn_m)operator(,) integer(1)operator(\);) -operator(}) - -directive(void) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_raise)operator(()ident(VALUE) ident(exc)operator(,) directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_raise)operator(()ident(exc)operator(,) ident(fmt)operator(,) ident(va_alist)operator(\)) - ident(VALUE) ident(exc)operator(;) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(va_list) ident(args)operator(;) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - - ident(va_init_list)operator(()ident(args)operator(,)ident(fmt)operator(\);) - ident(vsnprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) ident(fmt)operator(,) ident(args)operator(\);) - ident(va_end)operator(()ident(args)operator(\);) - ident(rb_exc_raise)operator(()ident(rb_exc_new2)operator(()ident(exc)operator(,) ident(buf)operator(\)\);) -operator(}) - -directive(void) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_loaderror)operator(()directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_loaderror)operator(()ident(fmt)operator(,) ident(va_alist)operator(\)) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(va_list) ident(args)operator(;) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - - ident(va_init_list)operator(()ident(args)operator(,) ident(fmt)operator(\);) - ident(vsnprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) ident(fmt)operator(,) ident(args)operator(\);) - ident(va_end)operator(()ident(args)operator(\);) - ident(rb_exc_raise)operator(()ident(rb_exc_new2)operator(()ident(rb_eLoadError)operator(,) ident(buf)operator(\)\);) -operator(}) - -directive(void) -ident(rb_notimplement)operator((\)) -operator({) - ident(rb_raise)operator(()ident(rb_eNotImpError)operator(,) - stringoperator(,) - ident(rb_id2name)operator(()ident(ruby_frame)operator(->)ident(last_func)operator(\)\);) -operator(}) - -directive(void) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_fatal)operator(()directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_fatal)operator(()ident(fmt)operator(,) ident(va_alist)operator(\)) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(va_list) ident(args)operator(;) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - - ident(va_init_list)operator(()ident(args)operator(,) ident(fmt)operator(\);) - ident(vsnprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) ident(fmt)operator(,) ident(args)operator(\);) - ident(va_end)operator(()ident(args)operator(\);) - - ident(ruby_in_eval) operator(=) integer(0)operator(;) - ident(rb_exc_fatal)operator(()ident(rb_exc_new2)operator(()ident(rb_eFatal)operator(,) ident(buf)operator(\)\);) -operator(}) - -directive(void) -ident(rb_sys_fail)operator(()ident(mesg)operator(\)) - directive(const) pre_type(char) operator(*)ident(mesg)operator(;) -operator({) - pre_type(int) ident(n) operator(=) ident(errno)operator(;) - ident(VALUE) ident(arg)operator(;) - - ident(errno) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(n) operator(==) integer(0)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(,) ident(mesg) operator(?) ident(mesg) operator(:) stringoperator(\);) - operator(}) - - ident(arg) operator(=) ident(mesg) operator(?) ident(rb_str_new2)operator(()ident(mesg)operator(\)) operator(:) ident(Qnil)operator(;) - ident(rb_exc_raise)operator(()ident(rb_class_new_instance)operator(()integer(1)operator(,) operator(&)ident(arg)operator(,) ident(get_syserr)operator(()ident(n)operator(\)\)\);) -operator(}) - -directive(void) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_sys_warning)operator(()directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_sys_warning)operator(()ident(fmt)operator(,) ident(va_alist)operator(\)) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - ident(va_list) ident(args)operator(;) - pre_type(int) ident(errno_save)operator(;) - - ident(errno_save) operator(=) ident(errno)operator(;) - - reserved(if) operator((!)ident(RTEST)operator(()ident(ruby_verbose)operator(\)\)) reserved(return)operator(;) - - ident(snprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) stringoperator(,) ident(fmt)operator(\);) - ident(snprintf)operator(()ident(buf)operator(+)ident(strlen)operator(()ident(buf)operator(\),) ident(BUFSIZ)operator(-)ident(strlen)operator(()ident(buf)operator(\),) stringoperator(,) ident(strerror)operator(()ident(errno_save)operator(\)\);) - - ident(va_init_list)operator(()ident(args)operator(,) ident(fmt)operator(\);) - ident(warn_print)operator(()ident(buf)operator(,) ident(args)operator(\);) - ident(va_end)operator(()ident(args)operator(\);) - ident(errno) operator(=) ident(errno_save)operator(;) -operator(}) - -directive(void) -ident(rb_load_fail)operator(()ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) - ident(rb_loaderror)operator(()stringoperator(,) ident(strerror)operator(()ident(errno)operator(\),) ident(path)operator(\);) -operator(}) - -directive(void) -ident(rb_error_frozen)operator(()ident(what)operator(\)) - directive(const) pre_type(char) operator(*)ident(what)operator(;) -operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(what)operator(\);) -operator(}) - -directive(void) -ident(rb_check_frozen)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(obj)operator(\)\)) ident(rb_error_frozen)operator(()ident(rb_obj_classname)operator(()ident(obj)operator(\)\);) -operator(}) - -directive(void) -ident(Init_syserr)operator((\)) -operator({) -preprocessor(#ifdef) ident(EPERM) - ident(set_syserr)operator(()ident(EPERM)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOENT) - ident(set_syserr)operator(()ident(ENOENT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ESRCH) - ident(set_syserr)operator(()ident(ESRCH)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EINTR) - ident(set_syserr)operator(()ident(EINTR)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EIO) - ident(set_syserr)operator(()ident(EIO)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENXIO) - ident(set_syserr)operator(()ident(ENXIO)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(E2BIG) - ident(set_syserr)operator(()ident(E2BIG)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOEXEC) - ident(set_syserr)operator(()ident(ENOEXEC)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EBADF) - ident(set_syserr)operator(()ident(EBADF)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ECHILD) - ident(set_syserr)operator(()ident(ECHILD)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EAGAIN) - ident(set_syserr)operator(()ident(EAGAIN)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOMEM) - ident(set_syserr)operator(()ident(ENOMEM)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EACCES) - ident(set_syserr)operator(()ident(EACCES)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EFAULT) - ident(set_syserr)operator(()ident(EFAULT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOTBLK) - ident(set_syserr)operator(()ident(ENOTBLK)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EBUSY) - ident(set_syserr)operator(()ident(EBUSY)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EEXIST) - ident(set_syserr)operator(()ident(EEXIST)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EXDEV) - ident(set_syserr)operator(()ident(EXDEV)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENODEV) - ident(set_syserr)operator(()ident(ENODEV)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOTDIR) - ident(set_syserr)operator(()ident(ENOTDIR)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EISDIR) - ident(set_syserr)operator(()ident(EISDIR)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EINVAL) - ident(set_syserr)operator(()ident(EINVAL)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENFILE) - ident(set_syserr)operator(()ident(ENFILE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EMFILE) - ident(set_syserr)operator(()ident(EMFILE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOTTY) - ident(set_syserr)operator(()ident(ENOTTY)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ETXTBSY) - ident(set_syserr)operator(()ident(ETXTBSY)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EFBIG) - ident(set_syserr)operator(()ident(EFBIG)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOSPC) - ident(set_syserr)operator(()ident(ENOSPC)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ESPIPE) - ident(set_syserr)operator(()ident(ESPIPE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EROFS) - ident(set_syserr)operator(()ident(EROFS)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EMLINK) - ident(set_syserr)operator(()ident(EMLINK)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EPIPE) - ident(set_syserr)operator(()ident(EPIPE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EDOM) - ident(set_syserr)operator(()ident(EDOM)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ERANGE) - ident(set_syserr)operator(()ident(ERANGE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EDEADLK) - ident(set_syserr)operator(()ident(EDEADLK)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENAMETOOLONG) - ident(set_syserr)operator(()ident(ENAMETOOLONG)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOLCK) - ident(set_syserr)operator(()ident(ENOLCK)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOSYS) - ident(set_syserr)operator(()ident(ENOSYS)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOTEMPTY) - ident(set_syserr)operator(()ident(ENOTEMPTY)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ELOOP) - ident(set_syserr)operator(()ident(ELOOP)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EWOULDBLOCK) - ident(set_syserr)operator(()ident(EWOULDBLOCK)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOMSG) - ident(set_syserr)operator(()ident(ENOMSG)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EIDRM) - ident(set_syserr)operator(()ident(EIDRM)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ECHRNG) - ident(set_syserr)operator(()ident(ECHRNG)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EL2NSYNC) - ident(set_syserr)operator(()ident(EL2NSYNC)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EL3HLT) - ident(set_syserr)operator(()ident(EL3HLT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EL3RST) - ident(set_syserr)operator(()ident(EL3RST)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ELNRNG) - ident(set_syserr)operator(()ident(ELNRNG)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EUNATCH) - ident(set_syserr)operator(()ident(EUNATCH)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOCSI) - ident(set_syserr)operator(()ident(ENOCSI)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EL2HLT) - ident(set_syserr)operator(()ident(EL2HLT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EBADE) - ident(set_syserr)operator(()ident(EBADE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EBADR) - ident(set_syserr)operator(()ident(EBADR)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EXFULL) - ident(set_syserr)operator(()ident(EXFULL)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOANO) - ident(set_syserr)operator(()ident(ENOANO)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EBADRQC) - ident(set_syserr)operator(()ident(EBADRQC)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EBADSLT) - ident(set_syserr)operator(()ident(EBADSLT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EDEADLOCK) - ident(set_syserr)operator(()ident(EDEADLOCK)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EBFONT) - ident(set_syserr)operator(()ident(EBFONT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOSTR) - ident(set_syserr)operator(()ident(ENOSTR)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENODATA) - ident(set_syserr)operator(()ident(ENODATA)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ETIME) - ident(set_syserr)operator(()ident(ETIME)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOSR) - ident(set_syserr)operator(()ident(ENOSR)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENONET) - ident(set_syserr)operator(()ident(ENONET)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOPKG) - ident(set_syserr)operator(()ident(ENOPKG)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EREMOTE) - ident(set_syserr)operator(()ident(EREMOTE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOLINK) - ident(set_syserr)operator(()ident(ENOLINK)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EADV) - ident(set_syserr)operator(()ident(EADV)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ESRMNT) - ident(set_syserr)operator(()ident(ESRMNT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ECOMM) - ident(set_syserr)operator(()ident(ECOMM)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EPROTO) - ident(set_syserr)operator(()ident(EPROTO)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EMULTIHOP) - ident(set_syserr)operator(()ident(EMULTIHOP)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EDOTDOT) - ident(set_syserr)operator(()ident(EDOTDOT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EBADMSG) - ident(set_syserr)operator(()ident(EBADMSG)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EOVERFLOW) - ident(set_syserr)operator(()ident(EOVERFLOW)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOTUNIQ) - ident(set_syserr)operator(()ident(ENOTUNIQ)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EBADFD) - ident(set_syserr)operator(()ident(EBADFD)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EREMCHG) - ident(set_syserr)operator(()ident(EREMCHG)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ELIBACC) - ident(set_syserr)operator(()ident(ELIBACC)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ELIBBAD) - ident(set_syserr)operator(()ident(ELIBBAD)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ELIBSCN) - ident(set_syserr)operator(()ident(ELIBSCN)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ELIBMAX) - ident(set_syserr)operator(()ident(ELIBMAX)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ELIBEXEC) - ident(set_syserr)operator(()ident(ELIBEXEC)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EILSEQ) - ident(set_syserr)operator(()ident(EILSEQ)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ERESTART) - ident(set_syserr)operator(()ident(ERESTART)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ESTRPIPE) - ident(set_syserr)operator(()ident(ESTRPIPE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EUSERS) - ident(set_syserr)operator(()ident(EUSERS)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOTSOCK) - ident(set_syserr)operator(()ident(ENOTSOCK)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EDESTADDRREQ) - ident(set_syserr)operator(()ident(EDESTADDRREQ)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EMSGSIZE) - ident(set_syserr)operator(()ident(EMSGSIZE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EPROTOTYPE) - ident(set_syserr)operator(()ident(EPROTOTYPE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOPROTOOPT) - ident(set_syserr)operator(()ident(ENOPROTOOPT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EPROTONOSUPPORT) - ident(set_syserr)operator(()ident(EPROTONOSUPPORT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ESOCKTNOSUPPORT) - ident(set_syserr)operator(()ident(ESOCKTNOSUPPORT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EOPNOTSUPP) - ident(set_syserr)operator(()ident(EOPNOTSUPP)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EPFNOSUPPORT) - ident(set_syserr)operator(()ident(EPFNOSUPPORT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EAFNOSUPPORT) - ident(set_syserr)operator(()ident(EAFNOSUPPORT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EADDRINUSE) - ident(set_syserr)operator(()ident(EADDRINUSE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EADDRNOTAVAIL) - ident(set_syserr)operator(()ident(EADDRNOTAVAIL)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENETDOWN) - ident(set_syserr)operator(()ident(ENETDOWN)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENETUNREACH) - ident(set_syserr)operator(()ident(ENETUNREACH)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENETRESET) - ident(set_syserr)operator(()ident(ENETRESET)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ECONNABORTED) - ident(set_syserr)operator(()ident(ECONNABORTED)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ECONNRESET) - ident(set_syserr)operator(()ident(ECONNRESET)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOBUFS) - ident(set_syserr)operator(()ident(ENOBUFS)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EISCONN) - ident(set_syserr)operator(()ident(EISCONN)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOTCONN) - ident(set_syserr)operator(()ident(ENOTCONN)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ESHUTDOWN) - ident(set_syserr)operator(()ident(ESHUTDOWN)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ETOOMANYREFS) - ident(set_syserr)operator(()ident(ETOOMANYREFS)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ETIMEDOUT) - ident(set_syserr)operator(()ident(ETIMEDOUT)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ECONNREFUSED) - ident(set_syserr)operator(()ident(ECONNREFUSED)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EHOSTDOWN) - ident(set_syserr)operator(()ident(EHOSTDOWN)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EHOSTUNREACH) - ident(set_syserr)operator(()ident(EHOSTUNREACH)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EALREADY) - ident(set_syserr)operator(()ident(EALREADY)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EINPROGRESS) - ident(set_syserr)operator(()ident(EINPROGRESS)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ESTALE) - ident(set_syserr)operator(()ident(ESTALE)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EUCLEAN) - ident(set_syserr)operator(()ident(EUCLEAN)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENOTNAM) - ident(set_syserr)operator(()ident(ENOTNAM)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(ENAVAIL) - ident(set_syserr)operator(()ident(ENAVAIL)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EISNAM) - ident(set_syserr)operator(()ident(EISNAM)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EREMOTEIO) - ident(set_syserr)operator(()ident(EREMOTEIO)operator(,) stringoperator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(EDQUOT) - ident(set_syserr)operator(()ident(EDQUOT)operator(,) stringoperator(\);) -preprocessor(#endif) -operator(}) - -directive(static) directive(void) -ident(err_append)operator(()ident(s)operator(\)) - directive(const) pre_type(char) operator(*)ident(s)operator(;) -operator({) - directive(extern) ident(VALUE) ident(ruby_errinfo)operator(;) - - reserved(if) operator(()ident(ruby_in_eval)operator(\)) operator({) - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_errinfo)operator(\)\)) operator({) - ident(ruby_errinfo) operator(=) ident(rb_exc_new2)operator(()ident(rb_eSyntaxError)operator(,) ident(s)operator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(str) operator(=) ident(rb_obj_as_string)operator(()ident(ruby_errinfo)operator(\);) - - ident(rb_str_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(rb_str_cat2)operator(()ident(str)operator(,) ident(s)operator(\);) - ident(ruby_errinfo) operator(=) ident(rb_exc_new3)operator(()ident(rb_eSyntaxError)operator(,) ident(str)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(rb_write_error)operator(()ident(s)operator(\);) - ident(rb_write_error)operator(()stringoperator(\);) - operator(}) -operator(}) -comment(/********************************************************************** - - eval.c - - - $Author: wyhaines $ - $Date: 2009-08-20 19:22:00 +0200 (Thu, 20 Aug 2009\) $ - created at: Thu Jun 10 14:22:17 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("node.h") -preprocessor(#include) include("env.h") -preprocessor(#include) include("util.h") -preprocessor(#include) include("rubysig.h") - -preprocessor(#ifdef) ident(HAVE_STDLIB_H) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#ifndef) ident(EXIT_SUCCESS) -preprocessor(#define) ident(EXIT_SUCCESS) integer(0) -preprocessor(#endif) -preprocessor(#ifndef) ident(EXIT_FAILURE) -preprocessor(#define) ident(EXIT_FAILURE) integer(1) -preprocessor(#endif) - -preprocessor(#include) include() - -preprocessor(#include) include("st.h") -preprocessor(#include) include("dln.h") - -preprocessor(#ifdef) ident(__APPLE__) -preprocessor(#include) include() -preprocessor(#endif) - -comment(/* Make alloca work the best possible way. */) -preprocessor(#ifdef) ident(__GNUC__) -preprocessor(# ifndef) ident(atarist) -preprocessor(# ifndef) ident(alloca) -preprocessor(# define) ident(alloca) ident(__builtin_alloca) -preprocessor(# endif) -preprocessor(# endif) comment(/* atarist */) -preprocessor(#else) -preprocessor(# ifdef) ident(HAVE_ALLOCA_H) -preprocessor(# include) include() -preprocessor(# else) -preprocessor(# ifndef) ident(_AIX) -preprocessor(# ifndef) ident(alloca) comment(/* predefined by HP cc +Olibcalls */) -directive(void) operator(*)ident(alloca) operator((\);) -preprocessor(# endif) -preprocessor(# endif) comment(/* AIX */) -preprocessor(# endif) comment(/* HAVE_ALLOCA_H */) -preprocessor(#endif) comment(/* __GNUC__ */) - -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -preprocessor(#include) include() -preprocessor(#define) ident(va_init_list)operator(()ident(a)operator(,)ident(b)operator(\)) ident(va_start)operator(()ident(a)operator(,)ident(b)operator(\)) -preprocessor(#else) -preprocessor(#include) include() -preprocessor(#define) ident(va_init_list)operator(()ident(a)operator(,)ident(b)operator(\)) ident(va_start)operator(()ident(a)operator(\)) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_STRING_H) -pre_type(char) operator(*)ident(strrchr) ident(_)operator((()directive(const) pre_type(char)operator(*,)directive(const) pre_type(char)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_UNISTD_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#include) include() - -preprocessor(#if) ident(defined)operator(()ident(HAVE_FCNTL_H)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) -preprocessor(#include) include() -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SYS_FCNTL_H)operator(\)) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#ifdef) ident(__CYGWIN__) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__BEOS__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(BONE)operator(\)) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(__MACOS__) -preprocessor(#include) include("macruby_private.h") -preprocessor(#endif) - -preprocessor(#ifdef) ident(__VMS) -preprocessor(#include) include("vmsruby_private.h") -preprocessor(#endif) - -preprocessor(#ifdef) ident(USE_CONTEXT) - -ident(NORETURN)operator(()directive(static) directive(void) ident(rb_jump_context)operator(()ident(rb_jmpbuf_t)operator(,) pre_type(int)operator(\)\);) -directive(static) directive(inline) directive(void) -ident(rb_jump_context)operator(()ident(env)operator(,) ident(val)operator(\)) - ident(rb_jmpbuf_t) ident(env)operator(;) - pre_type(int) ident(val)operator(;) -operator({) - ident(env)operator(->)ident(status) operator(=) ident(val)operator(;) - ident(setcontext)operator((&)ident(env)operator(->)ident(context)operator(\);) - ident(abort)operator((\);) comment(/* ensure noreturn */) -operator(}) -comment(/* - * PRE_GETCONTEXT and POST_GETCONTEXT is a magic for getcontext, gcc, - * IA64 register stack and SPARC register window combination problem. - * - * Assume following code sequence. - * - * 1. set a register in the register stack/window such as r32/l0. - * 2. call getcontext. - * 3. use the register. - * 4. update the register for other use. - * 5. call setcontext indirectly (or directly\). - * - * This code should be run as 1->2->3->4->5->3->4. - * But after second getcontext return (second 3\), - * the register is broken (updated\). - * It's because getcontext/setcontext doesn't preserve the content of the - * register stack/window. - * - * setjmp also doesn't preserve the content of the register stack/window. - * But it has not the problem because gcc knows setjmp may return twice. - * gcc detects setjmp and generates setjmp safe code. - * - * So setjmp calls before and after the getcontext call makes the code - * somewhat safe. - * It fix the problem on IA64. - * It is not required that setjmp is called at run time, since the problem is - * register usage. - * - * Since the magic setjmp is not enough for SPARC, - * inline asm is used to prohibit registers in register windows. - * - * Since the problem is fixed at gcc 4.0.3, the magic is applied only for - * prior versions of gcc. - * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21957 - * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22127 - */) -preprocessor(# define) ident(GCC_VERSION_BEFORE)operator(()ident(major)operator(,) ident(minor)operator(,) ident(patchlevel)operator(\)) \ - operator(()ident(defined)operator(()ident(__GNUC__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__INTEL_COMPILER)operator(\)) operator(&&) \ - operator((()ident(__GNUC__) operator(<) operator(()ident(major)operator(\)\)) operator(||) \ - operator(()ident(__GNUC__) operator(==) operator(()ident(major)operator(\)) operator(&&) ident(__GNUC_MINOR__) operator(<) operator(()ident(minor)operator(\)\)) operator(||) \ - operator(()ident(__GNUC__) operator(==) operator(()ident(major)operator(\)) operator(&&) ident(__GNUC_MINOR__) operator(==) operator(()ident(minor)operator(\)) operator(&&) ident(__GNUC_PATCHLEVEL__) operator(<) operator(()ident(patchlevel)operator(\)\)\)\)) -preprocessor(# if) ident(GCC_VERSION_BEFORE)operator(()integer(4)operator(,)integer(0)operator(,)integer(3)operator(\)) operator(&&) operator(()ident(defined)operator(()ident(sparc)operator(\)) operator(||) ident(defined)operator(()ident(__sparc__)operator(\)\)) -preprocessor(# ifdef) ident(__pic__) -comment(/* - * %l7 is excluded for PIC because it is PIC register. - * http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html - */) -preprocessor(# define) ident(PRE_GETCONTEXT) \ - operator(({) ident(__asm__) directive(volatile) operator(()string operator(:) operator(:) operator(:) \ - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) \ - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) \ - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\);) operator(}\)) -preprocessor(# else) -preprocessor(# define) ident(PRE_GETCONTEXT) \ - operator(({) ident(__asm__) directive(volatile) operator(()string operator(:) operator(:) operator(:) \ - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) \ - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) \ - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\);) operator(}\)) -preprocessor(# endif) -preprocessor(# define) ident(POST_GETCONTEXT) ident(PRE_GETCONTEXT) -preprocessor(# elif) ident(GCC_VERSION_BEFORE)operator(()integer(4)operator(,)integer(0)operator(,)integer(3)operator(\)) operator(&&) ident(defined)operator(()ident(__ia64)operator(\)) -directive(static) ident(jmp_buf) ident(function_call_may_return_twice_jmp_buf)operator(;) -pre_type(int) ident(function_call_may_return_twice_false_1) operator(=) integer(0)operator(;) -pre_type(int) ident(function_call_may_return_twice_false_2) operator(=) integer(0)operator(;) -preprocessor(# define) ident(PRE_GETCONTEXT) \ - operator(()ident(function_call_may_return_twice_false_1) operator(?) \ - ident(setjmp)operator(()ident(function_call_may_return_twice_jmp_buf)operator(\)) operator(:) \ - integer(0)operator(\)) -preprocessor(# define) ident(POST_GETCONTEXT) \ - operator(()ident(function_call_may_return_twice_false_2) operator(?) \ - ident(setjmp)operator(()ident(function_call_may_return_twice_jmp_buf)operator(\)) operator(:) \ - integer(0)operator(\)) -preprocessor(# elif) ident(defined)operator(()ident(__FreeBSD__)operator(\)) operator(&&) ident(__FreeBSD__) operator(<) integer(7) -comment(/* - * workaround for FreeBSD/i386 getcontext/setcontext bug. - * clear the carry flag by (0 ? ... : ...\). - * FreeBSD PR 92110 http://www.freebsd.org/cgi/query-pr.cgi?pr=92110 - * [ruby-dev:28263] - */) -directive(static) pre_type(int) directive(volatile) ident(freebsd_clear_carry_flag) operator(=) integer(0)operator(;) -preprocessor(# define) ident(PRE_GETCONTEXT) \ - operator(()ident(freebsd_clear_carry_flag) operator(?) operator(()ident(freebsd_clear_carry_flag) operator(=) integer(0)operator(\)) operator(:) integer(0)operator(\)) -preprocessor(# endif) -preprocessor(# ifndef) ident(PRE_GETCONTEXT) -preprocessor(# define) ident(PRE_GETCONTEXT) integer(0) -preprocessor(# endif) -preprocessor(# ifndef) ident(POST_GETCONTEXT) -preprocessor(# define) ident(POST_GETCONTEXT) integer(0) -preprocessor(# endif) -preprocessor(# define) ident(ruby_longjmp)operator(()ident(env)operator(,) ident(val)operator(\)) ident(rb_jump_context)operator(()ident(env)operator(,) ident(val)operator(\)) -preprocessor(# define) ident(ruby_setjmp)operator(()ident(just_before_setjmp)operator(,) ident(j)operator(\)) operator((()ident(j)operator(\)->)ident(status) operator(=) integer(0)operator(,) \ - operator(()ident(just_before_setjmp)operator(\),) \ - ident(PRE_GETCONTEXT)operator(,) \ - ident(getcontext)operator((&()ident(j)operator(\)->)ident(context)operator(\),) \ - ident(POST_GETCONTEXT)operator(,) \ - operator(()ident(j)operator(\)->)ident(status)operator(\)) -preprocessor(#else) -preprocessor(# if) operator(!)ident(defined)operator(()ident(setjmp)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE__SETJMP)operator(\)) -preprocessor(# define) ident(ruby_setjmp)operator(()ident(just_before_setjmp)operator(,) ident(env)operator(\)) \ - operator((()ident(just_before_setjmp)operator(\),) ident(_setjmp)operator(()ident(env)operator(\)\)) -preprocessor(# define) ident(ruby_longjmp)operator(()ident(env)operator(,)ident(val)operator(\)) ident(_longjmp)operator(()ident(env)operator(,)ident(val)operator(\)) -preprocessor(# else) -preprocessor(# define) ident(ruby_setjmp)operator(()ident(just_before_setjmp)operator(,) ident(env)operator(\)) \ - operator((()ident(just_before_setjmp)operator(\),) ident(setjmp)operator(()ident(env)operator(\)\)) -preprocessor(# define) ident(ruby_longjmp)operator(()ident(env)operator(,)ident(val)operator(\)) ident(longjmp)operator(()ident(env)operator(,)ident(val)operator(\)) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#if) ident(defined)operator(()ident(__VMS)operator(\)) -preprocessor(#pragma) ident(nostandard) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_SYS_SELECT_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#include) include() - -ident(VALUE) ident(rb_cProc)operator(;) -ident(VALUE) ident(rb_cBinding)operator(;) -directive(static) ident(VALUE) ident(proc_invoke) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(,)ident(VALUE)operator(,)ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_f_binding) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) directive(void) ident(rb_f_END) ident(_)operator((()directive(void)operator(\)\);) -directive(static) ident(VALUE) ident(rb_f_block_given_p) ident(_)operator((()directive(void)operator(\)\);) -directive(static) ident(VALUE) ident(block_pass) ident(_)operator((()ident(VALUE)operator(,)ident(NODE)operator(*\)\);) - -ident(VALUE) ident(rb_cMethod)operator(;) -directive(static) ident(VALUE) ident(method_call) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_cUnboundMethod)operator(;) -directive(static) ident(VALUE) ident(umethod_bind) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_mod_define_method) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -ident(NORETURN)operator(()directive(static) directive(void) ident(rb_raise_jump) ident(_)operator((()ident(VALUE)operator(\)\)\);) -directive(static) ident(VALUE) ident(rb_make_exception) ident(_)operator((()pre_type(int) ident(argc)operator(,) ident(VALUE) operator(*)ident(argv)operator(\)\);) - -directive(static) pre_type(int) ident(scope_vmode)operator(;) -preprocessor(#define) ident(SCOPE_PUBLIC) integer(0) -preprocessor(#define) ident(SCOPE_PRIVATE) integer(1) -preprocessor(#define) ident(SCOPE_PROTECTED) integer(2) -preprocessor(#define) ident(SCOPE_MODFUNC) integer(5) -preprocessor(#define) ident(SCOPE_MASK) integer(7) -preprocessor(#define) ident(SCOPE_SET)operator(()ident(f)operator(\)) operator(()ident(scope_vmode)operator(=()ident(f)operator(\)\)) -preprocessor(#define) ident(SCOPE_TEST)operator(()ident(f)operator(\)) operator(()ident(scope_vmode)operator(&()ident(f)operator(\)\)) - -ident(VALUE) operator((*)ident(ruby_sandbox_save)operator(\))ident(_)operator((()ident(rb_thread_t)operator(\)\);) -ident(VALUE) operator((*)ident(ruby_sandbox_restore)operator(\))ident(_)operator((()ident(rb_thread_t)operator(\)\);) -ident(NODE)operator(*) ident(ruby_current_node)operator(;) -pre_type(int) ident(ruby_safe_level) operator(=) integer(0)operator(;) -comment(/* safe-level: - 0 - strings from streams/environment/ARGV are tainted (default\) - 1 - no dangerous operation by tainted value - 2 - process/file operations prohibited - 3 - all generated objects are tainted - 4 - no global (non-tainted\) variable modification/no direct output -*/) - -directive(static) ident(VALUE) ident(safe_getter) ident(_)operator((()directive(void)operator(\)\);) -directive(static) directive(void) ident(safe_setter) ident(_)operator((()ident(VALUE) ident(val)operator(\)\);) - -directive(void) -ident(rb_secure)operator(()ident(level)operator(\)) - pre_type(int) ident(level)operator(;) -operator({) - reserved(if) operator(()ident(level) operator(<=) ident(ruby_safe_level)operator(\)) operator({) - reserved(if) operator(()ident(ruby_frame)operator(->)ident(last_func)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(ruby_frame)operator(->)ident(last_func)operator(\),) ident(ruby_safe_level)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(ruby_safe_level)operator(\);) - operator(}) - operator(}) -operator(}) - -directive(void) -ident(rb_secure_update)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(obj)operator(\)\)) ident(rb_secure)operator(()integer(4)operator(\);) -operator(}) - -directive(void) -ident(rb_check_safe_obj)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - reserved(if) operator(()ident(ruby_safe_level) operator(>) integer(0) operator(&&) ident(OBJ_TAINTED)operator(()ident(x)operator(\)\){) - reserved(if) operator(()ident(ruby_frame)operator(->)ident(last_func)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(ruby_frame)operator(->)ident(last_func)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - operator(}) - ident(rb_secure)operator(()integer(4)operator(\);) -operator(}) - -directive(void) -ident(rb_check_safe_str)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - ident(rb_check_safe_obj)operator(()ident(x)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(x)operator(\)!=) ident(T_STRING)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(x)operator(\)\);) - operator(}) -operator(}) - -ident(NORETURN)operator(()directive(static) directive(void) ident(print_undef) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\)\);) -directive(static) directive(void) -ident(print_undef)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(id)operator(\),) - operator(()ident(TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_MODULE)operator(\)) operator(?) string operator(:) stringoperator(,) - ident(rb_class2name)operator(()ident(klass)operator(\)\);) -operator(}) - -directive(static) ident(ID) ident(removed)operator(,) ident(singleton_removed)operator(,) ident(undefined)operator(,) ident(singleton_undefined)operator(;) - -preprocessor(#define) ident(CACHE_SIZE) hex(0x800) -preprocessor(#define) ident(CACHE_MASK) hex(0x7ff) -preprocessor(#define) ident(EXPR1)operator(()ident(c)operator(,)ident(m)operator(\)) operator((((()ident(c)operator(\)>>)integer(3)operator(\)^()ident(m)operator(\)\)&)ident(CACHE_MASK)operator(\)) - -reserved(struct) ident(cache_entry) operator({) comment(/* method hash table. */) - ident(ID) ident(mid)operator(;) comment(/* method's id */) - ident(ID) ident(mid0)operator(;) comment(/* method's original id */) - ident(VALUE) ident(klass)operator(;) comment(/* receiver's class */) - ident(VALUE) ident(origin)operator(;) comment(/* where method defined */) - ident(NODE) operator(*)ident(method)operator(;) - pre_type(int) ident(noex)operator(;) -operator(};) - -directive(static) reserved(struct) ident(cache_entry) ident(cache)operator([)ident(CACHE_SIZE)operator(];) -directive(static) pre_type(int) ident(ruby_running) operator(=) integer(0)operator(;) - -directive(void) -ident(rb_clear_cache)operator((\)) -operator({) - reserved(struct) ident(cache_entry) operator(*)ident(ent)operator(,) operator(*)ident(end)operator(;) - - reserved(if) operator((!)ident(ruby_running)operator(\)) reserved(return)operator(;) - ident(ent) operator(=) ident(cache)operator(;) ident(end) operator(=) ident(ent) operator(+) ident(CACHE_SIZE)operator(;) - reserved(while) operator(()ident(ent) operator(<) ident(end)operator(\)) operator({) - ident(ent)operator(->)ident(mid) operator(=) integer(0)operator(;) - ident(ent)operator(++;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(rb_clear_cache_for_undef)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(struct) ident(cache_entry) operator(*)ident(ent)operator(,) operator(*)ident(end)operator(;) - - reserved(if) operator((!)ident(ruby_running)operator(\)) reserved(return)operator(;) - ident(ent) operator(=) ident(cache)operator(;) ident(end) operator(=) ident(ent) operator(+) ident(CACHE_SIZE)operator(;) - reserved(while) operator(()ident(ent) operator(<) ident(end)operator(\)) operator({) - reserved(if) operator(()ident(ent)operator(->)ident(mid) operator(==) ident(id) operator(&&) - ident(RCLASS)operator(()ident(ent)operator(->)ident(origin)operator(\)->)ident(m_tbl) operator(==) ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(\)) operator({) - ident(ent)operator(->)ident(mid) operator(=) integer(0)operator(;) - operator(}) - ident(ent)operator(++;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(rb_clear_cache_by_id)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(struct) ident(cache_entry) operator(*)ident(ent)operator(,) operator(*)ident(end)operator(;) - - reserved(if) operator((!)ident(ruby_running)operator(\)) reserved(return)operator(;) - ident(ent) operator(=) ident(cache)operator(;) ident(end) operator(=) ident(ent) operator(+) ident(CACHE_SIZE)operator(;) - reserved(while) operator(()ident(ent) operator(<) ident(end)operator(\)) operator({) - reserved(if) operator(()ident(ent)operator(->)ident(mid) operator(==) ident(id)operator(\)) operator({) - ident(ent)operator(->)ident(mid) operator(=) integer(0)operator(;) - operator(}) - ident(ent)operator(++;) - operator(}) -operator(}) - -directive(void) -ident(rb_clear_cache_by_class)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(struct) ident(cache_entry) operator(*)ident(ent)operator(,) operator(*)ident(end)operator(;) - - reserved(if) operator((!)ident(ruby_running)operator(\)) reserved(return)operator(;) - ident(ent) operator(=) ident(cache)operator(;) ident(end) operator(=) ident(ent) operator(+) ident(CACHE_SIZE)operator(;) - reserved(while) operator(()ident(ent) operator(<) ident(end)operator(\)) operator({) - reserved(if) operator(()ident(ent)operator(->)ident(klass) operator(==) ident(klass) operator(||) ident(ent)operator(->)ident(origin) operator(==) ident(klass)operator(\)) operator({) - ident(ent)operator(->)ident(mid) operator(=) integer(0)operator(;) - operator(}) - ident(ent)operator(++;) - operator(}) -operator(}) - -directive(static) ident(ID) ident(init)operator(,) ident(eqq)operator(,) ident(each)operator(,) ident(aref)operator(,) ident(aset)operator(,) ident(match)operator(,) ident(missing)operator(;) -directive(static) ident(ID) ident(added)operator(,) ident(singleton_added)operator(;) -directive(static) ident(ID) ident(__id__)operator(,) ident(__send__)operator(,) ident(respond_to)operator(;) - -preprocessor(#define) ident(NOEX_TAINTED) integer(8) -preprocessor(#define) ident(NOEX_SAFE)operator(()ident(n)operator(\)) operator((()ident(n)operator(\)) operator(>>) integer(4)operator(\)) -preprocessor(#define) ident(NOEX_WITH)operator(()ident(n)operator(,) ident(v)operator(\)) operator((()ident(n)operator(\)) operator(|) operator(()ident(v)operator(\)) operator(<<) integer(4)operator(\)) -preprocessor(#define) ident(NOEX_WITH_SAFE)operator(()ident(n)operator(\)) ident(NOEX_WITH)operator(()ident(n)operator(,) ident(ruby_safe_level)operator(\)) - -directive(void) -ident(rb_add_method)operator(()ident(klass)operator(,) ident(mid)operator(,) ident(node)operator(,) ident(noex)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(mid)operator(;) - ident(NODE) operator(*)ident(node)operator(;) - pre_type(int) ident(noex)operator(;) -operator({) - ident(NODE) operator(*)ident(body)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(klass)operator(\)\)) ident(klass) operator(=) ident(rb_cObject)operator(;) - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4) operator(&&) operator(()ident(klass) operator(==) ident(rb_cObject) operator(||) operator(!)ident(OBJ_TAINTED)operator(()ident(klass)operator(\)\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)) operator(&&) - ident(node) operator(&&) ident(nd_type)operator(()ident(node)operator(\)) operator(!=) ident(NODE_ZSUPER) operator(&&) - operator(()ident(mid) operator(==) ident(rb_intern)operator(()string operator(\)||) ident(mid) operator(==) ident(rb_intern)operator(()stringoperator(\)\)\)) operator({) - ident(noex) operator(=) ident(NOEX_PRIVATE) operator(|) ident(noex)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)) operator(&&) ident(node) operator(&&) ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_CFUNC) operator(&&) - ident(mid) operator(==) ident(rb_intern)operator(()stringoperator(\)\)) operator({) - ident(rb_warn)operator(()stringoperator(,) - ident(rb_class2name)operator(()ident(rb_iv_get)operator(()ident(klass)operator(,) stringoperator(\)\)\);) - ident(mid) operator(=) ident(ID_ALLOCATOR)operator(;) - operator(}) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(klass)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - ident(rb_clear_cache_by_id)operator(()ident(mid)operator(\);) - ident(body) operator(=) ident(NEW_METHOD)operator(()ident(node)operator(,) ident(NOEX_WITH_SAFE)operator(()ident(noex)operator(\)\);) - ident(st_insert)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(,) ident(mid)operator(,) operator(()ident(st_data_t)operator(\))ident(body)operator(\);) - reserved(if) operator(()ident(node) operator(&&) ident(mid) operator(!=) ident(ID_ALLOCATOR) operator(&&) ident(ruby_running)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(rb_funcall)operator(()ident(rb_iv_get)operator(()ident(klass)operator(,) stringoperator(\),) ident(singleton_added)operator(,) integer(1)operator(,) ident(ID2SYM)operator(()ident(mid)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(rb_funcall)operator(()ident(klass)operator(,) ident(added)operator(,) integer(1)operator(,) ident(ID2SYM)operator(()ident(mid)operator(\)\);) - operator(}) - operator(}) -operator(}) - -directive(void) -ident(rb_define_alloc_func)operator(()ident(klass)operator(,) ident(func)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(VALUE) operator((*)ident(func)operator(\)) ident(_)operator((()ident(VALUE)operator(\)\);) -operator({) - ident(Check_Type)operator(()ident(klass)operator(,) ident(T_CLASS)operator(\);) - ident(rb_add_method)operator(()ident(rb_singleton_class)operator(()ident(klass)operator(\),) ident(ID_ALLOCATOR)operator(,) ident(NEW_CFUNC)operator(()ident(func)operator(,) integer(0)operator(\),) - ident(NOEX_PRIVATE)operator(\);) -operator(}) - -directive(void) -ident(rb_undef_alloc_func)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(Check_Type)operator(()ident(klass)operator(,) ident(T_CLASS)operator(\);) - ident(rb_add_method)operator(()ident(rb_singleton_class)operator(()ident(klass)operator(\),) ident(ID_ALLOCATOR)operator(,) integer(0)operator(,) ident(NOEX_UNDEF)operator(\);) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(search_method)operator(()ident(klass)operator(,) ident(id)operator(,) ident(origin)operator(\)) - ident(VALUE) ident(klass)operator(,) operator(*)ident(origin)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(st_data_t) ident(body)operator(;) - - reserved(if) operator((!)ident(klass)operator(\)) reserved(return) integer(0)operator(;) - reserved(while) operator((!)ident(st_lookup)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(,) ident(id)operator(,) operator(&)ident(body)operator(\)\)) operator({) - ident(klass) operator(=) ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(;) - reserved(if) operator((!)ident(klass)operator(\)) reserved(return) integer(0)operator(;) - operator(}) - - reserved(if) operator(()ident(origin)operator(\)) operator(*)ident(origin) operator(=) ident(klass)operator(;) - reserved(return) operator(()ident(NODE) operator(*\))ident(body)operator(;) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(rb_get_method_body)operator(()ident(klassp)operator(,) ident(idp)operator(,) ident(noexp)operator(\)) - ident(VALUE) operator(*)ident(klassp)operator(;) - ident(ID) operator(*)ident(idp)operator(;) - pre_type(int) operator(*)ident(noexp)operator(;) -operator({) - ident(ID) ident(id) operator(=) operator(*)ident(idp)operator(;) - ident(VALUE) ident(klass) operator(=) operator(*)ident(klassp)operator(;) - ident(VALUE) ident(origin)operator(;) - ident(NODE) operator(*) directive(volatile) ident(body)operator(;) - reserved(struct) ident(cache_entry) operator(*)ident(ent)operator(;) - - reserved(if) operator((()ident(body) operator(=) ident(search_method)operator(()ident(klass)operator(,) ident(id)operator(,) operator(&)ident(origin)operator(\)\)) operator(==) integer(0) operator(||) operator(!)ident(body)operator(->)ident(nd_body)operator(\)) operator({) - comment(/* store empty info in cache */) - ident(ent) operator(=) ident(cache) operator(+) ident(EXPR1)operator(()ident(klass)operator(,) ident(id)operator(\);) - ident(ent)operator(->)ident(klass) operator(=) ident(klass)operator(;) - ident(ent)operator(->)ident(origin) operator(=) ident(klass)operator(;) - ident(ent)operator(->)ident(mid) operator(=) ident(ent)operator(->)ident(mid0) operator(=) ident(id)operator(;) - ident(ent)operator(->)ident(noex) operator(=) integer(0)operator(;) - ident(ent)operator(->)ident(method) operator(=) integer(0)operator(;) - - reserved(return) integer(0)operator(;) - operator(}) - - reserved(if) operator(()ident(ruby_running)operator(\)) operator({) - comment(/* store in cache */) - ident(ent) operator(=) ident(cache) operator(+) ident(EXPR1)operator(()ident(klass)operator(,) ident(id)operator(\);) - ident(ent)operator(->)ident(klass) operator(=) ident(klass)operator(;) - ident(ent)operator(->)ident(noex) operator(=) ident(body)operator(->)ident(nd_noex)operator(;) - reserved(if) operator(()ident(noexp)operator(\)) operator(*)ident(noexp) operator(=) ident(body)operator(->)ident(nd_noex)operator(;) - ident(body) operator(=) ident(body)operator(->)ident(nd_body)operator(;) - reserved(if) operator(()ident(nd_type)operator(()ident(body)operator(\)) operator(==) ident(NODE_FBODY)operator(\)) operator({) - ident(ent)operator(->)ident(mid) operator(=) ident(id)operator(;) - operator(*)ident(klassp) operator(=) ident(body)operator(->)ident(nd_orig)operator(;) - ident(ent)operator(->)ident(origin) operator(=) ident(body)operator(->)ident(nd_orig)operator(;) - operator(*)ident(idp) operator(=) ident(ent)operator(->)ident(mid0) operator(=) ident(body)operator(->)ident(nd_mid)operator(;) - ident(body) operator(=) ident(ent)operator(->)ident(method) operator(=) ident(body)operator(->)ident(nd_head)operator(;) - operator(}) - reserved(else) operator({) - operator(*)ident(klassp) operator(=) ident(origin)operator(;) - ident(ent)operator(->)ident(origin) operator(=) ident(origin)operator(;) - ident(ent)operator(->)ident(mid) operator(=) ident(ent)operator(->)ident(mid0) operator(=) ident(id)operator(;) - ident(ent)operator(->)ident(method) operator(=) ident(body)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(noexp)operator(\)) operator(*)ident(noexp) operator(=) ident(body)operator(->)ident(nd_noex)operator(;) - ident(body) operator(=) ident(body)operator(->)ident(nd_body)operator(;) - reserved(if) operator(()ident(nd_type)operator(()ident(body)operator(\)) operator(==) ident(NODE_FBODY)operator(\)) operator({) - operator(*)ident(klassp) operator(=) ident(body)operator(->)ident(nd_orig)operator(;) - operator(*)ident(idp) operator(=) ident(body)operator(->)ident(nd_mid)operator(;) - ident(body) operator(=) ident(body)operator(->)ident(nd_head)operator(;) - operator(}) - reserved(else) operator({) - operator(*)ident(klassp) operator(=) ident(origin)operator(;) - operator(}) - operator(}) - - reserved(return) ident(body)operator(;) -operator(}) - -ident(NODE)operator(*) -ident(rb_method_node)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - pre_type(int) ident(noex)operator(;) - - reserved(return) ident(rb_get_method_body)operator((&)ident(klass)operator(,) operator(&)ident(id)operator(,) operator(&)ident(noex)operator(\);) -operator(}) - -directive(static) directive(void) -ident(remove_method)operator(()ident(klass)operator(,) ident(mid)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(mid)operator(;) -operator({) - ident(st_data_t) ident(data)operator(;) - ident(NODE) operator(*)ident(body) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(klass) operator(==) ident(rb_cObject)operator(\)) operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - operator(}) - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4) operator(&&) operator(!)ident(OBJ_TAINTED)operator(()ident(klass)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(klass)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - reserved(if) operator(()ident(mid) operator(==) ident(__id__) operator(||) ident(mid) operator(==) ident(__send__) operator(||) ident(mid) operator(==) ident(init)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(mid)operator(\)\);) - operator(}) - reserved(if) operator(()ident(st_lookup)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(,) ident(mid)operator(,) operator(&)ident(data)operator(\)\)) operator({) - ident(body) operator(=) operator(()ident(NODE) operator(*\))ident(data)operator(;) - reserved(if) operator((!)ident(body) operator(||) operator(!)ident(body)operator(->)ident(nd_body)operator(\)) ident(body) operator(=) integer(0)operator(;) - reserved(else) operator({) - ident(st_delete)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(,) operator(&)ident(mid)operator(,) operator(&)ident(data)operator(\);) - operator(}) - operator(}) - reserved(if) operator((!)ident(body)operator(\)) operator({) - ident(rb_name_error)operator(()ident(mid)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(mid)operator(\),) ident(rb_class2name)operator(()ident(klass)operator(\)\);) - operator(}) - ident(rb_clear_cache_for_undef)operator(()ident(klass)operator(,) ident(mid)operator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(rb_funcall)operator(()ident(rb_iv_get)operator(()ident(klass)operator(,) stringoperator(\),) ident(singleton_removed)operator(,) integer(1)operator(,) ident(ID2SYM)operator(()ident(mid)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(rb_funcall)operator(()ident(klass)operator(,) ident(removed)operator(,) integer(1)operator(,) ident(ID2SYM)operator(()ident(mid)operator(\)\);) - operator(}) -operator(}) - -directive(void) -ident(rb_remove_method)operator(()ident(klass)operator(,) ident(name)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(remove_method)operator(()ident(klass)operator(,) ident(rb_intern)operator(()ident(name)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * remove_method(symbol\) => self - * - * Removes the method identified by _symbol_ from the current - * class. For an example, see Module.undef_method. - */) - -directive(static) ident(VALUE) -ident(rb_mod_remove_method)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(mod)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(remove_method)operator(()ident(mod)operator(,) ident(rb_to_id)operator(()ident(argv)operator([)ident(i)operator(]\)\);) - operator(}) - reserved(return) ident(mod)operator(;) -operator(}) - -preprocessor(#undef) ident(rb_disable_super) -preprocessor(#undef) ident(rb_enable_super) - -directive(void) -ident(rb_disable_super)operator(()ident(klass)operator(,) ident(name)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - comment(/* obsolete - no use */) -operator(}) - -directive(void) -ident(rb_enable_super)operator(()ident(klass)operator(,) ident(name)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(rb_warn)operator(()stringoperator(\);) -operator(}) - -directive(static) directive(void) -ident(rb_export_method)operator(()ident(klass)operator(,) ident(name)operator(,) ident(noex)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(name)operator(;) - ident(ID) ident(noex)operator(;) -operator({) - ident(NODE) operator(*)ident(body)operator(;) - ident(VALUE) ident(origin)operator(;) - - reserved(if) operator(()ident(klass) operator(==) ident(rb_cObject)operator(\)) operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - operator(}) - ident(body) operator(=) ident(search_method)operator(()ident(klass)operator(,) ident(name)operator(,) operator(&)ident(origin)operator(\);) - reserved(if) operator((!)ident(body) operator(&&) ident(TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_MODULE)operator(\)) operator({) - ident(body) operator(=) ident(search_method)operator(()ident(rb_cObject)operator(,) ident(name)operator(,) operator(&)ident(origin)operator(\);) - operator(}) - reserved(if) operator((!)ident(body) operator(||) operator(!)ident(body)operator(->)ident(nd_body)operator(\)) operator({) - ident(print_undef)operator(()ident(klass)operator(,) ident(name)operator(\);) - operator(}) - reserved(if) operator(()ident(body)operator(->)ident(nd_noex) operator(!=) ident(noex)operator(\)) operator({) - reserved(if) operator(()ident(klass) operator(==) ident(origin)operator(\)) operator({) - ident(body)operator(->)ident(nd_noex) operator(=) ident(noex)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_add_method)operator(()ident(klass)operator(,) ident(name)operator(,) ident(NEW_ZSUPER)operator((\),) ident(noex)operator(\);) - operator(}) - operator(}) -operator(}) - -pre_type(int) -ident(rb_method_boundp)operator(()ident(klass)operator(,) ident(id)operator(,) ident(ex)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) - pre_type(int) ident(ex)operator(;) -operator({) - reserved(struct) ident(cache_entry) operator(*)ident(ent)operator(;) - pre_type(int) ident(noex)operator(;) - - comment(/* is it in the method cache? */) - ident(ent) operator(=) ident(cache) operator(+) ident(EXPR1)operator(()ident(klass)operator(,) ident(id)operator(\);) - reserved(if) operator(()ident(ent)operator(->)ident(mid) operator(==) ident(id) operator(&&) ident(ent)operator(->)ident(klass) operator(==) ident(klass)operator(\)) operator({) - reserved(if) operator(()ident(ex) operator(&&) operator(()ident(ent)operator(->)ident(noex) operator(&) ident(NOEX_PRIVATE)operator(\)\)) - reserved(return) ident(Qfalse)operator(;) - reserved(if) operator((!)ident(ent)operator(->)ident(method)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(if) operator(()ident(rb_get_method_body)operator((&)ident(klass)operator(,) operator(&)ident(id)operator(,) operator(&)ident(noex)operator(\)\)) operator({) - reserved(if) operator(()ident(ex) operator(&&) operator(()ident(noex) operator(&) ident(NOEX_PRIVATE)operator(\)\)) - reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(void) -ident(rb_attr)operator(()ident(klass)operator(,) ident(id)operator(,) ident(read)operator(,) ident(write)operator(,) ident(ex)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) - pre_type(int) ident(read)operator(,) ident(write)operator(,) ident(ex)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - pre_type(char) operator(*)ident(buf)operator(;) - ident(ID) ident(attriv)operator(;) - pre_type(int) ident(noex)operator(;) - ident(size_t) ident(len)operator(;) - - reserved(if) operator((!)ident(ex)operator(\)) ident(noex) operator(=) ident(NOEX_PUBLIC)operator(;) - reserved(else) operator({) - reserved(if) operator(()ident(SCOPE_TEST)operator(()ident(SCOPE_PRIVATE)operator(\)\)) operator({) - ident(noex) operator(=) ident(NOEX_PRIVATE)operator(;) - ident(rb_warning)operator((()ident(scope_vmode) operator(==) ident(SCOPE_MODFUNC)operator(\)) operator(?) - string operator(:) - stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(SCOPE_TEST)operator(()ident(SCOPE_PROTECTED)operator(\)\)) operator({) - ident(noex) operator(=) ident(NOEX_PROTECTED)operator(;) - operator(}) - reserved(else) operator({) - ident(noex) operator(=) ident(NOEX_PUBLIC)operator(;) - operator(}) - operator(}) - - reserved(if) operator((!)ident(rb_is_local_id)operator(()ident(id)operator(\)) operator(&&) operator(!)ident(rb_is_const_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - ident(name) operator(=) ident(rb_id2name)operator(()ident(id)operator(\);) - reserved(if) operator((!)ident(name)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(len) operator(=) ident(strlen)operator(()ident(name)operator(\)+)integer(2)operator(;) - ident(buf) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,)ident(len)operator(\);) - ident(snprintf)operator(()ident(buf)operator(,) ident(len)operator(,) stringoperator(,) ident(name)operator(\);) - ident(attriv) operator(=) ident(rb_intern)operator(()ident(buf)operator(\);) - reserved(if) operator(()ident(read)operator(\)) operator({) - ident(rb_add_method)operator(()ident(klass)operator(,) ident(id)operator(,) ident(NEW_IVAR)operator(()ident(attriv)operator(\),) ident(noex)operator(\);) - operator(}) - reserved(if) operator(()ident(write)operator(\)) operator({) - ident(rb_add_method)operator(()ident(klass)operator(,) ident(rb_id_attrset)operator(()ident(id)operator(\),) ident(NEW_ATTRSET)operator(()ident(attriv)operator(\),) ident(noex)operator(\);) - operator(}) -operator(}) - -directive(extern) pre_type(int) ident(ruby_in_compile)operator(;) - -ident(VALUE) ident(ruby_errinfo) operator(=) ident(Qnil)operator(;) -directive(extern) ident(NODE) operator(*)ident(ruby_eval_tree_begin)operator(;) -directive(extern) ident(NODE) operator(*)ident(ruby_eval_tree)operator(;) -directive(extern) pre_type(int) ident(ruby_nerrs)operator(;) - -ident(VALUE) ident(rb_eLocalJumpError)operator(;) -ident(VALUE) ident(rb_eSysStackError)operator(;) - -directive(extern) ident(VALUE) ident(ruby_top_self)operator(;) - -reserved(struct) ident(FRAME) operator(*)ident(ruby_frame)operator(;) -reserved(struct) ident(SCOPE) operator(*)ident(ruby_scope)operator(;) -directive(static) reserved(struct) ident(FRAME) operator(*)ident(top_frame)operator(;) -directive(static) reserved(struct) ident(SCOPE) operator(*)ident(top_scope)operator(;) - -directive(static) pre_type(unsigned) pre_type(long) ident(frame_unique) operator(=) integer(0)operator(;) - -preprocessor(#define) ident(PUSH_FRAME)operator((\)) reserved(do) operator({) \ - directive(volatile) reserved(struct) ident(FRAME) ident(_frame)operator(;) \ - ident(_frame)operator(.)ident(prev) operator(=) ident(ruby_frame)operator(;) \ - ident(_frame)operator(.)ident(tmp) operator(=) integer(0)operator(;) \ - ident(_frame)operator(.)ident(node) operator(=) ident(ruby_current_node)operator(;) \ - ident(_frame)operator(.)ident(iter) operator(=) ident(ruby_iter)operator(->)ident(iter)operator(;) \ - ident(_frame)operator(.)ident(argc) operator(=) integer(0)operator(;) \ - ident(_frame)operator(.)ident(flags) operator(=) integer(0)operator(;) \ - ident(_frame)operator(.)ident(uniq) operator(=) ident(frame_unique)operator(++;) \ - ident(ruby_frame) operator(=) operator(&)ident(_frame) - -preprocessor(#define) ident(POP_FRAME)operator((\)) \ - ident(ruby_current_node) operator(=) ident(_frame)operator(.)ident(node)operator(;) \ - ident(ruby_frame) operator(=) ident(_frame)operator(.)ident(prev)operator(;) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -reserved(struct) ident(BLOCK) operator({) - ident(NODE) operator(*)ident(var)operator(;) - ident(NODE) operator(*)ident(body)operator(;) - ident(VALUE) ident(self)operator(;) - reserved(struct) ident(FRAME) ident(frame)operator(;) - reserved(struct) ident(SCOPE) operator(*)ident(scope)operator(;) - ident(VALUE) ident(klass)operator(;) - ident(NODE) operator(*)ident(cref)operator(;) - pre_type(int) ident(iter)operator(;) - pre_type(int) ident(vmode)operator(;) - pre_type(int) ident(flags)operator(;) - pre_type(int) ident(uniq)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(dyna_vars)operator(;) - ident(VALUE) ident(orig_thread)operator(;) - ident(VALUE) ident(wrapper)operator(;) - ident(VALUE) ident(block_obj)operator(;) - reserved(struct) ident(BLOCK) operator(*)ident(outer)operator(;) - reserved(struct) ident(BLOCK) operator(*)ident(prev)operator(;) -operator(};) - -preprocessor(#define) ident(BLOCK_D_SCOPE) integer(1) -preprocessor(#define) ident(BLOCK_LAMBDA) integer(2) - -directive(static) reserved(struct) ident(BLOCK) operator(*)ident(ruby_block)operator(;) -directive(static) pre_type(unsigned) pre_type(long) ident(block_unique) operator(=) integer(1)operator(;) - -preprocessor(#define) ident(PUSH_BLOCK)operator(()ident(v)operator(,)ident(b)operator(\)) reserved(do) operator({) \ - reserved(struct) ident(BLOCK) ident(_block)operator(;) \ - ident(_block)operator(.)ident(var) operator(=) operator(()ident(v)operator(\);) \ - ident(_block)operator(.)ident(body) operator(=) operator(()ident(b)operator(\);) \ - ident(_block)operator(.)ident(self) operator(=) ident(self)operator(;) \ - ident(_block)operator(.)ident(frame) operator(=) operator(*)ident(ruby_frame)operator(;) \ - ident(_block)operator(.)ident(klass) operator(=) ident(ruby_class)operator(;) \ - ident(_block)operator(.)ident(cref) operator(=) ident(ruby_cref)operator(;) \ - ident(_block)operator(.)ident(frame)operator(.)ident(node) operator(=) ident(ruby_current_node)operator(;)\ - ident(_block)operator(.)ident(scope) operator(=) ident(ruby_scope)operator(;) \ - ident(_block)operator(.)ident(prev) operator(=) ident(ruby_block)operator(;) \ - ident(_block)operator(.)ident(outer) operator(=) ident(ruby_block)operator(;) \ - ident(_block)operator(.)ident(iter) operator(=) ident(ruby_iter)operator(->)ident(iter)operator(;) \ - ident(_block)operator(.)ident(vmode) operator(=) ident(scope_vmode)operator(;) \ - ident(_block)operator(.)ident(flags) operator(=) ident(BLOCK_D_SCOPE)operator(;) \ - ident(_block)operator(.)ident(dyna_vars) operator(=) ident(ruby_dyna_vars)operator(;) \ - ident(_block)operator(.)ident(wrapper) operator(=) ident(ruby_wrapper)operator(;) \ - ident(_block)operator(.)ident(block_obj) operator(=) integer(0)operator(;) \ - ident(_block)operator(.)ident(uniq) operator(=) operator(()ident(b)operator(\)?)ident(block_unique)operator(++:)integer(0)operator(;) \ - reserved(if) operator(()ident(b)operator(\)) operator({) \ - ident(prot_tag)operator(->)ident(blkid) operator(=) ident(_block)operator(.)ident(uniq)operator(;) \ - operator(}) \ - ident(ruby_block) operator(=) operator(&)ident(_block) - -preprocessor(#define) ident(POP_BLOCK)operator((\)) \ - ident(ruby_block) operator(=) ident(_block)operator(.)ident(prev)operator(;) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -reserved(struct) ident(RVarmap) operator(*)ident(ruby_dyna_vars)operator(;) -preprocessor(#define) ident(PUSH_VARS)operator((\)) reserved(do) operator({) \ - reserved(struct) ident(RVarmap) operator(*) directive(volatile) ident(_old)operator(;) \ - ident(_old) operator(=) ident(ruby_dyna_vars)operator(;) \ - ident(ruby_dyna_vars) operator(=) integer(0) - -preprocessor(#define) ident(POP_VARS)operator((\)) \ - reserved(if) operator(()ident(_old) operator(&&) operator(()ident(ruby_scope)operator(->)ident(flags) operator(&) ident(SCOPE_DONT_RECYCLE)operator(\)\)) operator({)\ - reserved(if) operator(()ident(RBASIC)operator(()ident(_old)operator(\)->)ident(flags)operator(\)) comment(/* unless it's already recycled */) \ - ident(FL_SET)operator(()ident(_old)operator(,) ident(DVAR_DONT_RECYCLE)operator(\);) \ - operator(})\ - ident(ruby_dyna_vars) operator(=) ident(_old)operator(;) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(DVAR_DONT_RECYCLE) ident(FL_USER2) - -preprocessor(#define) ident(DMETHOD_P)operator((\)) operator(()ident(ruby_frame)operator(->)ident(flags) operator(&) ident(FRAME_DMETH)operator(\)) - -directive(static) reserved(struct) ident(RVarmap)operator(*) -ident(new_dvar)operator(()ident(id)operator(,) ident(value)operator(,) ident(prev)operator(\)) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(value)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(prev)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(vars)operator(,) reserved(struct) ident(RVarmap)operator(\);) - ident(OBJSETUP)operator(()ident(vars)operator(,) integer(0)operator(,) ident(T_VARMAP)operator(\);) - ident(vars)operator(->)ident(id) operator(=) ident(id)operator(;) - ident(vars)operator(->)ident(val) operator(=) ident(value)operator(;) - ident(vars)operator(->)ident(next) operator(=) ident(prev)operator(;) - - reserved(return) ident(vars)operator(;) -operator(}) - -ident(VALUE) -ident(rb_dvar_defined)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(struct) ident(RVarmap) operator(*)ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) - - reserved(while) operator(()ident(vars)operator(\)) operator({) - reserved(if) operator(()ident(vars)operator(->)ident(id) operator(==) ident(id)operator(\)) reserved(return) ident(Qtrue)operator(;) - ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -ident(VALUE) -ident(rb_dvar_curr)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(struct) ident(RVarmap) operator(*)ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) - - reserved(while) operator(()ident(vars)operator(\)) operator({) - reserved(if) operator(()ident(vars)operator(->)ident(id) operator(==) integer(0)operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(vars)operator(->)ident(id) operator(==) ident(id)operator(\)) reserved(return) ident(Qtrue)operator(;) - ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -ident(VALUE) -ident(rb_dvar_ref)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(struct) ident(RVarmap) operator(*)ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) - - reserved(while) operator(()ident(vars)operator(\)) operator({) - reserved(if) operator(()ident(vars)operator(->)ident(id) operator(==) ident(id)operator(\)) operator({) - reserved(return) ident(vars)operator(->)ident(val)operator(;) - operator(}) - ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(void) -ident(rb_dvar_push)operator(()ident(id)operator(,) ident(value)operator(\)) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(value)operator(;) -operator({) - ident(ruby_dyna_vars) operator(=) ident(new_dvar)operator(()ident(id)operator(,) ident(value)operator(,) ident(ruby_dyna_vars)operator(\);) -operator(}) - -directive(static) directive(void) -ident(dvar_asgn_internal)operator(()ident(id)operator(,) ident(value)operator(,) ident(curr)operator(\)) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(value)operator(;) - pre_type(int) ident(curr)operator(;) -operator({) - pre_type(int) ident(n) operator(=) integer(0)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) - - reserved(while) operator(()ident(vars)operator(\)) operator({) - reserved(if) operator(()ident(curr) operator(&&) ident(vars)operator(->)ident(id) operator(==) integer(0)operator(\)) operator({) - comment(/* first null is a dvar header */) - ident(n)operator(++;) - reserved(if) operator(()ident(n) operator(==) integer(2)operator(\)) reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(vars)operator(->)ident(id) operator(==) ident(id)operator(\)) operator({) - ident(vars)operator(->)ident(val) operator(=) ident(value)operator(;) - reserved(return)operator(;) - operator(}) - ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(;) - operator(}) - reserved(if) operator((!)ident(ruby_dyna_vars)operator(\)) operator({) - ident(ruby_dyna_vars) operator(=) ident(new_dvar)operator(()ident(id)operator(,) ident(value)operator(,) integer(0)operator(\);) - operator(}) - reserved(else) operator({) - ident(vars) operator(=) ident(new_dvar)operator(()ident(id)operator(,) ident(value)operator(,) ident(ruby_dyna_vars)operator(->)ident(next)operator(\);) - ident(ruby_dyna_vars)operator(->)ident(next) operator(=) ident(vars)operator(;) - operator(}) -operator(}) - -directive(static) directive(inline) directive(void) -ident(dvar_asgn)operator(()ident(id)operator(,) ident(value)operator(\)) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(value)operator(;) -operator({) - ident(dvar_asgn_internal)operator(()ident(id)operator(,) ident(value)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) directive(inline) directive(void) -ident(dvar_asgn_curr)operator(()ident(id)operator(,) ident(value)operator(\)) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(value)operator(;) -operator({) - ident(dvar_asgn_internal)operator(()ident(id)operator(,) ident(value)operator(,) integer(1)operator(\);) -operator(}) - -ident(VALUE) operator(*) -ident(rb_svar)operator(()ident(cnt)operator(\)) - pre_type(int) ident(cnt)operator(;) -operator({) - reserved(struct) ident(RVarmap) operator(*)ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) - ident(ID) ident(id)operator(;) - - reserved(if) operator((!)ident(ruby_scope)operator(->)ident(local_tbl)operator(\)) reserved(return) pre_constant(NULL)operator(;) - reserved(if) operator(()ident(cnt) operator(>=) ident(ruby_scope)operator(->)ident(local_tbl)operator([)integer(0)operator(]\)) reserved(return) pre_constant(NULL)operator(;) - ident(id) operator(=) ident(ruby_scope)operator(->)ident(local_tbl)operator([)ident(cnt)operator(+)integer(1)operator(];) - reserved(while) operator(()ident(vars)operator(\)) operator({) - reserved(if) operator(()ident(vars)operator(->)ident(id) operator(==) ident(id)operator(\)) reserved(return) operator(&)ident(vars)operator(->)ident(val)operator(;) - ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(;) - operator(}) - reserved(if) operator(()ident(ruby_scope)operator(->)ident(local_vars) operator(==) integer(0)operator(\)) reserved(return) pre_constant(NULL)operator(;) - reserved(return) operator(&)ident(ruby_scope)operator(->)ident(local_vars)operator([)ident(cnt)operator(];) -operator(}) - -reserved(struct) ident(iter) operator({) - pre_type(int) ident(iter)operator(;) - reserved(struct) ident(iter) operator(*)ident(prev)operator(;) -operator(};) -directive(static) reserved(struct) ident(iter) operator(*)ident(ruby_iter)operator(;) - -preprocessor(#define) ident(ITER_NOT) integer(0) -preprocessor(#define) ident(ITER_PRE) integer(1) -preprocessor(#define) ident(ITER_CUR) integer(2) -preprocessor(#define) ident(ITER_PAS) integer(3) - -preprocessor(#define) ident(PUSH_ITER)operator(()ident(i)operator(\)) reserved(do) operator({) \ - reserved(struct) ident(iter) ident(_iter)operator(;) \ - ident(_iter)operator(.)ident(prev) operator(=) ident(ruby_iter)operator(;) \ - ident(_iter)operator(.)ident(iter) operator(=) operator(()ident(i)operator(\);) \ - ident(ruby_iter) operator(=) operator(&)ident(_iter) - -preprocessor(#define) ident(POP_ITER)operator((\)) \ - ident(ruby_iter) operator(=) ident(_iter)operator(.)ident(prev)operator(;) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -reserved(struct) ident(tag) operator({) - ident(rb_jmpbuf_t) ident(buf)operator(;) - reserved(struct) ident(FRAME) operator(*)ident(frame)operator(;) - reserved(struct) ident(iter) operator(*)ident(iter)operator(;) - ident(VALUE) ident(tag)operator(;) - ident(VALUE) ident(retval)operator(;) - reserved(struct) ident(SCOPE) operator(*)ident(scope)operator(;) - ident(VALUE) ident(dst)operator(;) - reserved(struct) ident(tag) operator(*)ident(prev)operator(;) - pre_type(int) ident(blkid)operator(;) -operator(};) -directive(static) reserved(struct) ident(tag) operator(*)ident(prot_tag)operator(;) - -preprocessor(#define) ident(PUSH_TAG)operator(()ident(ptag)operator(\)) reserved(do) operator({) \ - reserved(struct) ident(tag) ident(_tag)operator(;) \ - ident(_tag)operator(.)ident(retval) operator(=) ident(Qnil)operator(;) \ - ident(_tag)operator(.)ident(frame) operator(=) ident(ruby_frame)operator(;) \ - ident(_tag)operator(.)ident(iter) operator(=) ident(ruby_iter)operator(;) \ - ident(_tag)operator(.)ident(prev) operator(=) ident(prot_tag)operator(;) \ - ident(_tag)operator(.)ident(scope) operator(=) ident(ruby_scope)operator(;) \ - ident(_tag)operator(.)ident(tag) operator(=) ident(ptag)operator(;) \ - ident(_tag)operator(.)ident(dst) operator(=) integer(0)operator(;) \ - ident(_tag)operator(.)ident(blkid) operator(=) integer(0)operator(;) \ - ident(prot_tag) operator(=) operator(&)ident(_tag) - -preprocessor(#define) ident(PROT_NONE) ident(Qfalse) comment(/* 0 */) -preprocessor(#define) ident(PROT_THREAD) ident(Qtrue) comment(/* 2 */) -preprocessor(#define) ident(PROT_FUNC) ident(INT2FIX)operator(()integer(0)operator(\)) comment(/* 1 */) -preprocessor(#define) ident(PROT_LOOP) ident(INT2FIX)operator(()integer(1)operator(\)) comment(/* 3 */) -preprocessor(#define) ident(PROT_LAMBDA) ident(INT2FIX)operator(()integer(2)operator(\)) comment(/* 5 */) -preprocessor(#define) ident(PROT_YIELD) ident(INT2FIX)operator(()integer(3)operator(\)) comment(/* 7 */) - -preprocessor(#define) ident(EXEC_TAG)operator((\)) operator(()ident(FLUSH_REGISTER_WINDOWS)operator(,) ident(ruby_setjmp)operator(((()directive(void)operator(\))integer(0)operator(\),) ident(prot_tag)operator(->)ident(buf)operator(\)\)) - -preprocessor(#define) ident(JUMP_TAG)operator(()ident(st)operator(\)) reserved(do) operator({) \ - ident(ruby_frame) operator(=) ident(prot_tag)operator(->)ident(frame)operator(;) \ - ident(ruby_iter) operator(=) ident(prot_tag)operator(->)ident(iter)operator(;) \ - ident(ruby_longjmp)operator(()ident(prot_tag)operator(->)ident(buf)operator(,()ident(st)operator(\)\);) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(POP_TAG)operator((\)) \ - ident(prot_tag) operator(=) ident(_tag)operator(.)ident(prev)operator(;) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(TAG_DST)operator((\)) operator(()ident(_tag)operator(.)ident(dst) operator(==) operator(()ident(VALUE)operator(\))ident(ruby_frame)operator(->)ident(uniq)operator(\)) - -preprocessor(#define) ident(TAG_RETURN) hex(0x1) -preprocessor(#define) ident(TAG_BREAK) hex(0x2) -preprocessor(#define) ident(TAG_NEXT) hex(0x3) -preprocessor(#define) ident(TAG_RETRY) hex(0x4) -preprocessor(#define) ident(TAG_REDO) hex(0x5) -preprocessor(#define) ident(TAG_RAISE) hex(0x6) -preprocessor(#define) ident(TAG_THROW) hex(0x7) -preprocessor(#define) ident(TAG_FATAL) hex(0x8) -preprocessor(#define) ident(TAG_MASK) hex(0xf) - -ident(VALUE) ident(ruby_class)operator(;) -directive(static) ident(VALUE) ident(ruby_wrapper)operator(;) comment(/* security wrapper */) - -preprocessor(#define) ident(PUSH_CLASS)operator(()ident(c)operator(\)) reserved(do) operator({) \ - directive(volatile) ident(VALUE) ident(_class) operator(=) ident(ruby_class)operator(;) \ - ident(ruby_class) operator(=) operator(()ident(c)operator(\)) - -preprocessor(#define) ident(POP_CLASS)operator((\)) ident(ruby_class) operator(=) ident(_class)operator(;) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -ident(NODE) operator(*)ident(ruby_cref) operator(=) integer(0)operator(;) -ident(NODE) operator(*)ident(ruby_top_cref)operator(;) -preprocessor(#define) ident(PUSH_CREF)operator(()ident(c)operator(\)) ident(ruby_cref) operator(=) ident(NEW_CREF)operator(()ident(c)operator(,)ident(ruby_cref)operator(\)) -preprocessor(#define) ident(POP_CREF)operator((\)) ident(ruby_cref) operator(=) ident(ruby_cref)operator(->)ident(nd_next) - -preprocessor(#define) ident(PUSH_SCOPE)operator((\)) reserved(do) operator({) \ - directive(volatile) pre_type(int) ident(_vmode) operator(=) ident(scope_vmode)operator(;) \ - reserved(struct) ident(SCOPE) operator(*) directive(volatile) ident(_old)operator(;) \ - ident(NEWOBJ)operator(()ident(_scope)operator(,) reserved(struct) ident(SCOPE)operator(\);) \ - ident(OBJSETUP)operator(()ident(_scope)operator(,) integer(0)operator(,) ident(T_SCOPE)operator(\);) \ - ident(_scope)operator(->)ident(local_tbl) operator(=) integer(0)operator(;) \ - ident(_scope)operator(->)ident(local_vars) operator(=) integer(0)operator(;) \ - ident(_scope)operator(->)ident(flags) operator(=) integer(0)operator(;) \ - ident(_old) operator(=) ident(ruby_scope)operator(;) \ - ident(ruby_scope) operator(=) ident(_scope)operator(;) \ - ident(scope_vmode) operator(=) ident(SCOPE_PUBLIC) - -ident(rb_thread_t) ident(rb_curr_thread)operator(;) -ident(rb_thread_t) ident(rb_main_thread)operator(;) -preprocessor(#define) ident(main_thread) ident(rb_main_thread) -preprocessor(#define) ident(curr_thread) ident(rb_curr_thread) - -directive(static) directive(void) ident(scope_dup) ident(_)operator((()reserved(struct) ident(SCOPE) operator(*\)\);) - -preprocessor(#define) ident(POP_SCOPE)operator((\)) \ - reserved(if) operator(()ident(ruby_scope)operator(->)ident(flags) operator(&) ident(SCOPE_DONT_RECYCLE)operator(\)) operator({)\ - reserved(if) operator(()ident(_old)operator(\)) ident(scope_dup)operator(()ident(_old)operator(\);) \ - operator(}) \ - reserved(if) operator((!()ident(ruby_scope)operator(->)ident(flags) operator(&) ident(SCOPE_MALLOC)operator(\)\)) operator({)\ - ident(ruby_scope)operator(->)ident(local_vars) operator(=) integer(0)operator(;) \ - ident(ruby_scope)operator(->)ident(local_tbl) operator(=) integer(0)operator(;) \ - reserved(if) operator((!()ident(ruby_scope)operator(->)ident(flags) operator(&) ident(SCOPE_DONT_RECYCLE)operator(\)) operator(&&) \ - ident(ruby_scope) operator(!=) ident(top_scope)operator(\)) operator({) \ - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(ruby_scope)operator(\);)\ - operator(}) \ - operator(}) \ - ident(ruby_scope)operator(->)ident(flags) operator(|=) ident(SCOPE_NOSTACK)operator(;) \ - ident(ruby_scope) operator(=) ident(_old)operator(;) \ - ident(scope_vmode) operator(=) ident(_vmode)operator(;) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -directive(static) ident(VALUE) ident(rb_eval) ident(_)operator((()ident(VALUE)operator(,)ident(NODE)operator(*\)\);) -directive(static) ident(VALUE) ident(eval) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(,)ident(VALUE)operator(,)pre_type(char)operator(*,)pre_type(int)operator(\)\);) -directive(static) ident(NODE) operator(*)ident(compile) ident(_)operator((()ident(VALUE)operator(,) pre_type(char)operator(*,) pre_type(int)operator(\)\);) - -directive(static) ident(VALUE) ident(rb_yield_0) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(,) ident(VALUE)operator(,) pre_type(int)operator(,) pre_type(int)operator(\)\);) - -preprocessor(#define) ident(YIELD_LAMBDA_CALL) integer(1) -preprocessor(#define) ident(YIELD_PROC_CALL) integer(2) -preprocessor(#define) ident(YIELD_PUBLIC_DEF) integer(4) -preprocessor(#define) ident(YIELD_FUNC_AVALUE) integer(1) -preprocessor(#define) ident(YIELD_FUNC_SVALUE) integer(2) - -directive(static) ident(VALUE) ident(rb_call) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(,)ident(ID)operator(,)pre_type(int)operator(,)directive(const) ident(VALUE)operator(*,)pre_type(int)operator(,)ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(module_setup) ident(_)operator((()ident(VALUE)operator(,)ident(NODE)operator(*\)\);) - -directive(static) ident(VALUE) ident(massign) ident(_)operator((()ident(VALUE)operator(,)ident(NODE)operator(*,)ident(VALUE)operator(,)pre_type(int)operator(\)\);) -directive(static) directive(void) ident(assign) ident(_)operator((()ident(VALUE)operator(,)ident(NODE)operator(*,)ident(VALUE)operator(,)pre_type(int)operator(\)\);) - -reserved(typedef) reserved(struct) ident(event_hook) operator({) - ident(rb_event_hook_func_t) ident(func)operator(;) - ident(rb_event_t) ident(events)operator(;) - reserved(struct) ident(event_hook) operator(*)ident(next)operator(;) -operator(}) ident(rb_event_hook_t)operator(;) - -directive(static) ident(rb_event_hook_t) operator(*)ident(event_hooks)operator(;) - -preprocessor(#define) ident(EXEC_EVENT_HOOK)operator(()ident(event)operator(,) ident(node)operator(,) ident(self)operator(,) ident(id)operator(,) ident(klass)operator(\)) \ - reserved(do) operator({) \ - ident(rb_event_hook_t) operator(*)ident(hook) operator(=) ident(event_hooks)operator(;) \ - ident(rb_event_hook_func_t) ident(hook_func)operator(;) \ - ident(rb_event_t) ident(events)operator(;) \ - \ - reserved(while) operator(()ident(hook)operator(\)) operator({) \ - ident(hook_func) operator(=) ident(hook)operator(->)ident(func)operator(;) \ - ident(events) operator(=) ident(hook)operator(->)ident(events)operator(;) \ - ident(hook) operator(=) ident(hook)operator(->)ident(next)operator(;) \ - reserved(if) operator(()ident(events) operator(&) ident(event)operator(\)) \ - operator((*)ident(hook_func)operator(\)()ident(event)operator(,) ident(node)operator(,) ident(self)operator(,) ident(id)operator(,) ident(klass)operator(\);) \ - operator(}) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -directive(static) ident(VALUE) ident(trace_func) operator(=) integer(0)operator(;) -directive(static) pre_type(int) ident(tracing) operator(=) integer(0)operator(;) -directive(static) directive(void) ident(call_trace_func) ident(_)operator((()ident(rb_event_t)operator(,)ident(NODE)operator(*,)ident(VALUE)operator(,)ident(ID)operator(,)ident(VALUE)operator(\)\);) - -comment(#if 0 -#define SET_CURRENT_SOURCE(\) (ruby_sourcefile = ruby_current_node->nd_file, \\ - ruby_sourceline = nd_line(ruby_current_node\)\) -#else) -preprocessor(#define) ident(SET_CURRENT_SOURCE)operator((\)) operator((()directive(void)operator(\))integer(0)operator(\)) -preprocessor(#endif) - -directive(void) -ident(ruby_set_current_source)operator((\)) -operator({) - reserved(if) operator(()ident(ruby_current_node)operator(\)) operator({) - ident(ruby_sourcefile) operator(=) ident(ruby_current_node)operator(->)ident(nd_file)operator(;) - ident(ruby_sourceline) operator(=) ident(nd_line)operator(()ident(ruby_current_node)operator(\);) - operator(}) -operator(}) - -directive(static) directive(void) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(warn_printf)operator(()directive(const) pre_type(char) operator(*)ident(fmt)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(warn_printf)operator(()ident(fmt)operator(,) ident(va_alist)operator(\)) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - ident(va_list) ident(args)operator(;) - - ident(va_init_list)operator(()ident(args)operator(,) ident(fmt)operator(\);) - ident(vsnprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) ident(fmt)operator(,) ident(args)operator(\);) - ident(va_end)operator(()ident(args)operator(\);) - ident(rb_write_error)operator(()ident(buf)operator(\);) -operator(}) - -preprocessor(#define) ident(warn_print)operator(()ident(x)operator(\)) ident(rb_write_error)operator(()ident(x)operator(\)) -preprocessor(#define) ident(warn_print2)operator(()ident(x)operator(,)ident(l)operator(\)) ident(rb_write_error2)operator(()ident(x)operator(,)ident(l)operator(\)) - -directive(static) directive(void) -ident(error_pos)operator((\)) -operator({) - ident(ruby_set_current_source)operator((\);) - reserved(if) operator(()ident(ruby_sourcefile)operator(\)) operator({) - reserved(if) operator(()ident(ruby_frame)operator(->)ident(last_func)operator(\)) operator({) - ident(warn_printf)operator(()stringoperator(,) ident(ruby_sourcefile)operator(,) ident(ruby_sourceline)operator(,) - ident(rb_id2name)operator(()ident(ruby_frame)operator(->)ident(orig_func)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(ruby_sourceline) operator(==) integer(0)operator(\)) operator({) - ident(warn_printf)operator(()stringoperator(,) ident(ruby_sourcefile)operator(\);) - operator(}) - reserved(else) operator({) - ident(warn_printf)operator(()stringoperator(,) ident(ruby_sourcefile)operator(,) ident(ruby_sourceline)operator(\);) - operator(}) - operator(}) -operator(}) - -ident(VALUE) ident(rb_check_backtrace)operator(()ident(VALUE)operator(\);) - -directive(static) ident(VALUE) -ident(get_backtrace)operator(()ident(info)operator(\)) - ident(VALUE) ident(info)operator(;) -operator({) - reserved(if) operator(()ident(NIL_P)operator(()ident(info)operator(\)\)) reserved(return) ident(Qnil)operator(;) - ident(info) operator(=) ident(rb_funcall)operator(()ident(info)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(info)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(rb_check_backtrace)operator(()ident(info)operator(\);) -operator(}) - -directive(static) directive(void) -ident(set_backtrace)operator(()ident(info)operator(,) ident(bt)operator(\)) - ident(VALUE) ident(info)operator(,) ident(bt)operator(;) -operator({) - ident(rb_funcall)operator(()ident(info)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(bt)operator(\);) -operator(}) - -directive(static) directive(void) -ident(error_print)operator((\)) -operator({) - ident(VALUE) ident(errat) operator(=) ident(Qnil)operator(;) comment(/* OK */) - directive(volatile) ident(VALUE) ident(eclass)operator(,) ident(e)operator(;) - pre_type(char) operator(*)ident(einfo)operator(;) - pre_type(long) ident(elen)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_errinfo)operator(\)\)) reserved(return)operator(;) - - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator(()ident(EXEC_TAG)operator((\)) operator(==) integer(0)operator(\)) operator({) - ident(errat) operator(=) ident(get_backtrace)operator(()ident(ruby_errinfo)operator(\);) - operator(}) - reserved(else) operator({) - ident(errat) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(if) operator(()ident(EXEC_TAG)operator((\)\)) reserved(goto) ident(error)operator(;) - reserved(if) operator(()ident(NIL_P)operator(()ident(errat)operator(\)\){) - ident(ruby_set_current_source)operator((\);) - reserved(if) operator(()ident(ruby_sourcefile)operator(\)) - ident(warn_printf)operator(()stringoperator(,) ident(ruby_sourcefile)operator(,) ident(ruby_sourceline)operator(\);) - reserved(else) - ident(warn_printf)operator(()stringoperator(,) ident(ruby_sourceline)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(RARRAY)operator(()ident(errat)operator(\)->)ident(len) operator(==) integer(0)operator(\)) operator({) - ident(error_pos)operator((\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(mesg) operator(=) ident(RARRAY)operator(()ident(errat)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - - reserved(if) operator(()ident(NIL_P)operator(()ident(mesg)operator(\)\)) ident(error_pos)operator((\);) - reserved(else) operator({) - ident(warn_print2)operator(()ident(RSTRING)operator(()ident(mesg)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(mesg)operator(\)->)ident(len)operator(\);) - operator(}) - operator(}) - - ident(eclass) operator(=) ident(CLASS_OF)operator(()ident(ruby_errinfo)operator(\);) - reserved(if) operator(()ident(EXEC_TAG)operator((\)) operator(==) integer(0)operator(\)) operator({) - ident(e) operator(=) ident(rb_funcall)operator(()ident(ruby_errinfo)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(,) integer(0)operator(\);) - ident(StringValue)operator(()ident(e)operator(\);) - ident(einfo) operator(=) ident(RSTRING)operator(()ident(e)operator(\)->)ident(ptr)operator(;) - ident(elen) operator(=) ident(RSTRING)operator(()ident(e)operator(\)->)ident(len)operator(;) - operator(}) - reserved(else) operator({) - ident(einfo) operator(=) stringoperator(;) - ident(elen) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(EXEC_TAG)operator((\)\)) reserved(goto) ident(error)operator(;) - reserved(if) operator(()ident(eclass) operator(==) ident(rb_eRuntimeError) operator(&&) ident(elen) operator(==) integer(0)operator(\)) operator({) - ident(warn_print)operator(()stringoperator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(epath)operator(;) - - ident(epath) operator(=) ident(rb_class_name)operator(()ident(eclass)operator(\);) - reserved(if) operator(()ident(elen) operator(==) integer(0)operator(\)) operator({) - ident(warn_print)operator(()stringoperator(\);) - ident(warn_print2)operator(()ident(RSTRING)operator(()ident(epath)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(epath)operator(\)->)ident(len)operator(\);) - ident(warn_print)operator(()stringoperator(\);) - operator(}) - reserved(else) operator({) - pre_type(char) operator(*)ident(tail) operator(=) integer(0)operator(;) - pre_type(long) ident(len) operator(=) ident(elen)operator(;) - - reserved(if) operator(()ident(RSTRING)operator(()ident(epath)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(==) char('#')operator(\)) ident(epath) operator(=) integer(0)operator(;) - reserved(if) operator((()ident(tail) operator(=) ident(memchr)operator(()ident(einfo)operator(,) char('\\n')operator(,) ident(elen)operator(\)\)) operator(!=) integer(0)operator(\)) operator({) - ident(len) operator(=) ident(tail) operator(-) ident(einfo)operator(;) - ident(tail)operator(++;) comment(/* skip newline */) - operator(}) - ident(warn_print)operator(()stringoperator(\);) - ident(warn_print2)operator(()ident(einfo)operator(,) ident(len)operator(\);) - reserved(if) operator(()ident(epath)operator(\)) operator({) - ident(warn_print)operator(()stringoperator(\);) - ident(warn_print2)operator(()ident(RSTRING)operator(()ident(epath)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(epath)operator(\)->)ident(len)operator(\);) - ident(warn_print)operator(()stringoperator(\);) - operator(}) - reserved(if) operator(()ident(tail) operator(&&) ident(elen)operator(>)ident(len)operator(+)integer(1)operator(\)) operator({) - ident(warn_print2)operator(()ident(tail)operator(,) ident(elen)operator(-)ident(len)operator(-)integer(1)operator(\);) - reserved(if) operator(()ident(einfo)operator([)ident(elen)operator(-)integer(1)operator(]) operator(!=) char('\\n')operator(\)) ident(warn_print2)operator(()stringoperator(,) integer(1)operator(\);) - operator(}) - operator(}) - operator(}) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(errat)operator(\)\)) operator({) - pre_type(long) ident(i)operator(;) - reserved(struct) ident(RArray) operator(*)ident(ep) operator(=) ident(RARRAY)operator(()ident(errat)operator(\);) - -preprocessor(#define) ident(TRACE_MAX) operator(()ident(TRACE_HEAD)operator(+)ident(TRACE_TAIL)operator(+)integer(5)operator(\)) -preprocessor(#define) ident(TRACE_HEAD) integer(8) -preprocessor(#define) ident(TRACE_TAIL) integer(5) - - ident(ep) operator(=) ident(RARRAY)operator(()ident(errat)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(1)operator(;) ident(i)operator(<)ident(ep)operator(->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(ep)operator(->)ident(ptr)operator([)ident(i)operator(]\)) operator(==) ident(T_STRING)operator(\)) operator({) - ident(warn_printf)operator(()stringoperator(,) ident(RSTRING)operator(()ident(ep)operator(->)ident(ptr)operator([)ident(i)operator(]\)->)ident(ptr)operator(\);) - operator(}) - reserved(if) operator(()ident(i) operator(==) ident(TRACE_HEAD) operator(&&) ident(ep)operator(->)ident(len) operator(>) ident(TRACE_MAX)operator(\)) operator({) - ident(warn_printf)operator(()stringoperator(,) - ident(ep)operator(->)ident(len) operator(-) ident(TRACE_HEAD) operator(-) ident(TRACE_TAIL)operator(\);) - ident(i) operator(=) ident(ep)operator(->)ident(len) operator(-) ident(TRACE_TAIL)operator(;) - operator(}) - operator(}) - operator(}) - label(error:) - ident(POP_TAG)operator((\);) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(__APPLE__)operator(\)) -preprocessor(#define) ident(environ) operator((*)ident(_NSGetEnviron)operator((\)\)) -preprocessor(#elif) operator(!)ident(defined)operator(()ident(_WIN32)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__MACOS__)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32_WCE)operator(\)) -directive(extern) pre_type(char) operator(**)ident(environ)operator(;) -preprocessor(#endif) -pre_type(char) operator(**)ident(rb_origenviron)operator(;) - -directive(void) ident(rb_call_inits) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_stack) ident(_)operator((()ident(VALUE)operator(*\)\);) -directive(void) ident(Init_heap) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_ext) ident(_)operator((()directive(void)operator(\)\);) - -preprocessor(#ifdef) ident(HAVE_NATIVETHREAD) -directive(static) ident(rb_nativethread_t) ident(ruby_thid)operator(;) -pre_type(int) -ident(is_ruby_native_thread)operator((\)) operator({) - reserved(return) ident(NATIVETHREAD_EQUAL)operator(()ident(ruby_thid)operator(,) ident(NATIVETHREAD_CURRENT)operator((\)\);) -operator(}) - -preprocessor(# ifdef) ident(HAVE_NATIVETHREAD_KILL) -directive(void) -ident(ruby_native_thread_kill)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) - ident(NATIVETHREAD_KILL)operator(()ident(ruby_thid)operator(,) ident(sig)operator(\);) -operator(}) -preprocessor(# endif) -preprocessor(#endif) - -directive(void) -ident(ruby_init)operator((\)) -operator({) - directive(static) pre_type(int) ident(initialized) operator(=) integer(0)operator(;) - directive(static) reserved(struct) ident(FRAME) ident(frame)operator(;) - directive(static) reserved(struct) ident(iter) ident(iter)operator(;) - pre_type(int) ident(state)operator(;) - - reserved(if) operator(()ident(initialized)operator(\)) - reserved(return)operator(;) - ident(initialized) operator(=) integer(1)operator(;) -preprocessor(#ifdef) ident(HAVE_NATIVETHREAD) - ident(ruby_thid) operator(=) ident(NATIVETHREAD_CURRENT)operator((\);) -preprocessor(#endif) - - ident(ruby_frame) operator(=) ident(top_frame) operator(=) operator(&)ident(frame)operator(;) - ident(ruby_iter) operator(=) operator(&)ident(iter)operator(;) - -preprocessor(#ifdef) ident(__MACOS__) - ident(rb_origenviron) operator(=) integer(0)operator(;) -preprocessor(#else) - ident(rb_origenviron) operator(=) ident(environ)operator(;) -preprocessor(#endif) - - ident(Init_stack)operator((()directive(void)operator(*\)&)ident(state)operator(\);) - ident(Init_heap)operator((\);) - ident(PUSH_SCOPE)operator((\);) - ident(ruby_scope)operator(->)ident(local_vars) operator(=) integer(0)operator(;) - ident(ruby_scope)operator(->)ident(local_tbl) operator(=) integer(0)operator(;) - ident(top_scope) operator(=) ident(ruby_scope)operator(;) - comment(/* default visibility is private at toplevel */) - ident(SCOPE_SET)operator(()ident(SCOPE_PRIVATE)operator(\);) - - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(rb_call_inits)operator((\);) - ident(ruby_class) operator(=) ident(rb_cObject)operator(;) - ident(ruby_frame)operator(->)ident(self) operator(=) ident(ruby_top_self)operator(;) - ident(ruby_top_cref) operator(=) ident(rb_node_newnode)operator(()ident(NODE_CREF)operator(,)ident(rb_cObject)operator(,)integer(0)operator(,)integer(0)operator(\);) - ident(ruby_cref) operator(=) ident(ruby_top_cref)operator(;) - ident(rb_define_global_const)operator(()stringoperator(,) ident(rb_f_binding)operator(()ident(ruby_top_self)operator(\)\);) -preprocessor(#ifdef) ident(__MACOS__) - ident(_macruby_init)operator((\);) -preprocessor(#elif) ident(defined)operator(()ident(__VMS)operator(\)) - ident(_vmsruby_init)operator((\);) -preprocessor(#endif) - ident(ruby_prog_init)operator((\);) - ident(ALLOW_INTS)operator(;) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state)operator(\)) operator({) - ident(error_print)operator((\);) - ident(exit)operator(()ident(EXIT_FAILURE)operator(\);) - operator(}) - ident(POP_SCOPE)operator((\);) - ident(ruby_scope) operator(=) ident(top_scope)operator(;) - ident(top_scope)operator(->)ident(flags) operator(&=) operator(~)ident(SCOPE_NOSTACK)operator(;) - ident(ruby_running) operator(=) integer(1)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(eval_node)operator(()ident(self)operator(,) ident(node)operator(\)) - ident(VALUE) ident(self)operator(;) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - ident(NODE) operator(*)ident(beg_tree) operator(=) ident(ruby_eval_tree_begin)operator(;) - - ident(ruby_eval_tree_begin) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(beg_tree)operator(\)) operator({) - ident(rb_eval)operator(()ident(self)operator(,) ident(beg_tree)operator(\);) - operator(}) - - reserved(if) operator((!)ident(node)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(\);) -operator(}) - -pre_type(int) ident(ruby_in_eval)operator(;) - -directive(static) directive(void) ident(rb_thread_cleanup) ident(_)operator((()directive(void)operator(\)\);) -directive(static) directive(void) ident(rb_thread_wait_other_threads) ident(_)operator((()directive(void)operator(\)\);) - -directive(static) pre_type(int) ident(thread_no_ensure) ident(_)operator((()directive(void)operator(\)\);) - -directive(static) ident(VALUE) ident(exception_error)operator(;) -directive(static) ident(VALUE) ident(sysstack_error)operator(;) - -directive(static) pre_type(int) -ident(sysexit_status)operator(()ident(err)operator(\)) - ident(VALUE) ident(err)operator(;) -operator({) - ident(VALUE) ident(st) operator(=) ident(rb_iv_get)operator(()ident(err)operator(,) stringoperator(\);) - reserved(return) ident(NUM2INT)operator(()ident(st)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(error_handle)operator(()ident(ex)operator(\)) - pre_type(int) ident(ex)operator(;) -operator({) - pre_type(int) ident(status) operator(=) ident(EXIT_FAILURE)operator(;) - ident(rb_thread_t) ident(th) operator(=) ident(curr_thread)operator(;) - - reserved(if) operator(()ident(rb_thread_set_raised)operator(()ident(th)operator(\)\)) - reserved(return) ident(EXIT_FAILURE)operator(;) - reserved(switch) operator(()ident(ex) operator(&) ident(TAG_MASK)operator(\)) operator({) - reserved(case) integer(0)operator(:) - ident(status) operator(=) ident(EXIT_SUCCESS)operator(;) - reserved(break)operator(;) - - reserved(case) ident(TAG_RETURN)operator(:) - ident(error_pos)operator((\);) - ident(warn_print)operator(()stringoperator(\);) - reserved(break)operator(;) - reserved(case) ident(TAG_NEXT)operator(:) - ident(error_pos)operator((\);) - ident(warn_print)operator(()stringoperator(\);) - reserved(break)operator(;) - reserved(case) ident(TAG_BREAK)operator(:) - ident(error_pos)operator((\);) - ident(warn_print)operator(()stringoperator(\);) - reserved(break)operator(;) - reserved(case) ident(TAG_REDO)operator(:) - ident(error_pos)operator((\);) - ident(warn_print)operator(()stringoperator(\);) - reserved(break)operator(;) - reserved(case) ident(TAG_RETRY)operator(:) - ident(error_pos)operator((\);) - ident(warn_print)operator(()stringoperator(\);) - reserved(break)operator(;) - reserved(case) ident(TAG_THROW)operator(:) - reserved(if) operator(()ident(prot_tag) operator(&&) ident(prot_tag)operator(->)ident(frame) operator(&&) ident(prot_tag)operator(->)ident(frame)operator(->)ident(node)operator(\)) operator({) - ident(NODE) operator(*)ident(tag) operator(=) ident(prot_tag)operator(->)ident(frame)operator(->)ident(node)operator(;) - ident(warn_printf)operator(()stringoperator(,) - ident(tag)operator(->)ident(nd_file)operator(,) ident(nd_line)operator(()ident(tag)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(error_pos)operator((\);) - ident(warn_printf)operator(()stringoperator(\);) - operator(}) - reserved(break)operator(;) - reserved(case) ident(TAG_RAISE)operator(:) - reserved(case) ident(TAG_FATAL)operator(:) - reserved(if) operator(()ident(rb_obj_is_kind_of)operator(()ident(ruby_errinfo)operator(,) ident(rb_eSystemExit)operator(\)\)) operator({) - ident(status) operator(=) ident(sysexit_status)operator(()ident(ruby_errinfo)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(rb_obj_is_instance_of)operator(()ident(ruby_errinfo)operator(,) ident(rb_eSignal)operator(\)\)) operator({) - comment(/* no message when exiting by signal */) - operator(}) - reserved(else) operator({) - ident(error_print)operator((\);) - operator(}) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_bug)operator(()stringoperator(,) ident(ex)operator(\);) - reserved(break)operator(;) - operator(}) - ident(rb_thread_reset_raised)operator(()ident(th)operator(\);) - reserved(return) ident(status)operator(;) -operator(}) - -directive(void) -ident(ruby_options)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - pre_type(char) operator(**)ident(argv)operator(;) -operator({) - pre_type(int) ident(state)operator(;) - - ident(Init_stack)operator((()directive(void)operator(*\)&)ident(state)operator(\);) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(ruby_process_options)operator(()ident(argc)operator(,) ident(argv)operator(\);) - operator(}) - reserved(else) operator({) - ident(trace_func) operator(=) integer(0)operator(;) - ident(tracing) operator(=) integer(0)operator(;) - ident(exit)operator(()ident(error_handle)operator(()ident(state)operator(\)\);) - operator(}) - ident(POP_TAG)operator((\);) -operator(}) - -directive(void) ident(rb_exec_end_proc) ident(_)operator((()directive(void)operator(\)\);) - -directive(static) directive(void) -ident(ruby_finalize_0)operator((\)) -operator({) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator(()ident(EXEC_TAG)operator((\)) operator(==) integer(0)operator(\)) operator({) - ident(rb_trap_exit)operator((\);) - operator(}) - ident(POP_TAG)operator((\);) - ident(rb_exec_end_proc)operator((\);) -operator(}) - -directive(static) directive(void) -ident(ruby_finalize_1)operator((\)) -operator({) - ident(signal)operator(()ident(SIGINT)operator(,) ident(SIG_DFL)operator(\);) - ident(ruby_errinfo) operator(=) integer(0)operator(;) - ident(rb_gc_call_finalizer_at_exit)operator((\);) - ident(trace_func) operator(=) integer(0)operator(;) - ident(tracing) operator(=) integer(0)operator(;) -operator(}) - -directive(void) -ident(ruby_finalize)operator((\)) -operator({) - ident(ruby_finalize_0)operator((\);) - ident(ruby_finalize_1)operator((\);) -operator(}) - -pre_type(int) -ident(ruby_cleanup)operator(()ident(ex)operator(\)) - pre_type(int) ident(ex)operator(;) -operator({) - pre_type(int) ident(state)operator(;) - directive(volatile) ident(VALUE) ident(errs)operator([)integer(2)operator(];) - pre_type(int) ident(nerr)operator(;) - - ident(errs)operator([)integer(1)operator(]) operator(=) ident(ruby_errinfo)operator(;) - ident(ruby_safe_level) operator(=) integer(0)operator(;) - ident(Init_stack)operator((()directive(void) operator(*\)&)ident(state)operator(\);) - ident(ruby_finalize_0)operator((\);) - ident(errs)operator([)integer(0)operator(]) operator(=) ident(ruby_errinfo)operator(;) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - ident(PUSH_ITER)operator(()ident(ITER_NOT)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(rb_thread_cleanup)operator((\);) - ident(rb_thread_wait_other_threads)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(ex) operator(==) integer(0)operator(\)) operator({) - ident(ex) operator(=) ident(state)operator(;) - operator(}) - ident(POP_ITER)operator((\);) - ident(ruby_errinfo) operator(=) ident(errs)operator([)integer(1)operator(];) - ident(ex) operator(=) ident(error_handle)operator(()ident(ex)operator(\);) - ident(ruby_finalize_1)operator((\);) - ident(POP_TAG)operator((\);) - - reserved(for) operator(()ident(nerr) operator(=) integer(0)operator(;) ident(nerr) operator(<) reserved(sizeof)operator(()ident(errs)operator(\)) operator(/) reserved(sizeof)operator(()ident(errs)operator([)integer(0)operator(]\);) operator(++)ident(nerr)operator(\)) operator({) - ident(VALUE) ident(err) operator(=) ident(errs)operator([)ident(nerr)operator(];) - - reserved(if) operator((!)ident(RTEST)operator(()ident(err)operator(\)\)) reserved(continue)operator(;) - - reserved(if) operator(()ident(rb_obj_is_kind_of)operator(()ident(err)operator(,) ident(rb_eSystemExit)operator(\)\)) operator({) - reserved(return) ident(sysexit_status)operator(()ident(err)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(rb_obj_is_kind_of)operator(()ident(err)operator(,) ident(rb_eSignal)operator(\)\)) operator({) - ident(VALUE) ident(sig) operator(=) ident(rb_iv_get)operator(()ident(err)operator(,) stringoperator(\);) - ident(ruby_default_signal)operator(()ident(NUM2INT)operator(()ident(sig)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(ex) operator(==) integer(0)operator(\)) operator({) - ident(ex) operator(=) integer(1)operator(;) - operator(}) - operator(}) - -preprocessor(#if) ident(EXIT_SUCCESS) operator(!=) integer(0) operator(||) ident(EXIT_FAILURE) operator(!=) integer(1) - reserved(switch) operator(()ident(ex)operator(\)) operator({) -preprocessor(#if) ident(EXIT_SUCCESS) operator(!=) integer(0) - reserved(case) integer(0)operator(:) reserved(return) ident(EXIT_SUCCESS)operator(;) -preprocessor(#endif) -preprocessor(#if) ident(EXIT_FAILURE) operator(!=) integer(1) - reserved(case) integer(1)operator(:) reserved(return) ident(EXIT_FAILURE)operator(;) -preprocessor(#endif) - operator(}) -preprocessor(#endif) - - reserved(return) ident(ex)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(ruby_exec_internal)operator((\)) -operator({) - pre_type(int) ident(state)operator(;) - - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - ident(PUSH_ITER)operator(()ident(ITER_NOT)operator(\);) - comment(/* default visibility is private at toplevel */) - ident(SCOPE_SET)operator(()ident(SCOPE_PRIVATE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(eval_node)operator(()ident(ruby_top_self)operator(,) ident(ruby_eval_tree)operator(\);) - operator(}) - ident(POP_ITER)operator((\);) - ident(POP_TAG)operator((\);) - reserved(return) ident(state)operator(;) -operator(}) - -directive(void) -ident(ruby_stop)operator(()ident(ex)operator(\)) - pre_type(int) ident(ex)operator(;) -operator({) - ident(exit)operator(()ident(ruby_cleanup)operator(()ident(ex)operator(\)\);) -operator(}) - -pre_type(int) -ident(ruby_exec)operator((\)) -operator({) - directive(volatile) ident(NODE) operator(*)ident(tmp)operator(;) - - ident(Init_stack)operator((()directive(void)operator(*\)&)ident(tmp)operator(\);) - reserved(return) ident(ruby_exec_internal)operator((\);) -operator(}) - -directive(void) -ident(ruby_run)operator((\)) -operator({) - pre_type(int) ident(state)operator(;) - directive(static) pre_type(int) ident(ex)operator(;) - - reserved(if) operator(()ident(ruby_nerrs) operator(>) integer(0)operator(\)) ident(exit)operator(()ident(EXIT_FAILURE)operator(\);) - ident(state) operator(=) ident(ruby_exec)operator((\);) - reserved(if) operator(()ident(state) operator(&&) operator(!)ident(ex)operator(\)) ident(ex) operator(=) ident(state)operator(;) - ident(ruby_stop)operator(()ident(ex)operator(\);) -operator(}) - -directive(static) directive(void) -ident(compile_error)operator(()ident(at)operator(\)) - directive(const) pre_type(char) operator(*)ident(at)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - - ident(ruby_nerrs) operator(=) integer(0)operator(;) - ident(str) operator(=) ident(rb_str_buf_new2)operator(()stringoperator(\);) - reserved(if) operator(()ident(at)operator(\)) operator({) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) ident(at)operator(\);) - operator(}) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) stringoperator(,) integer(1)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(ruby_errinfo)operator(\)\)) operator({) - ident(rb_str_append)operator(()ident(str)operator(,) ident(rb_obj_as_string)operator(()ident(ruby_errinfo)operator(\)\);) - operator(}) - ident(rb_exc_raise)operator(()ident(rb_exc_new3)operator(()ident(rb_eSyntaxError)operator(,) ident(str)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_eval_string)operator(()ident(str)operator(\)) - directive(const) pre_type(char) operator(*)ident(str)operator(;) -operator({) - ident(VALUE) ident(v)operator(;) - ident(NODE) operator(*)ident(oldsrc) operator(=) ident(ruby_current_node)operator(;) - - ident(ruby_current_node) operator(=) integer(0)operator(;) - ident(ruby_sourcefile) operator(=) ident(rb_source_filename)operator(()stringoperator(\);) - ident(v) operator(=) ident(eval)operator(()ident(ruby_top_self)operator(,) ident(rb_str_new2)operator(()ident(str)operator(\),) ident(Qnil)operator(,) integer(0)operator(,) integer(0)operator(\);) - ident(ruby_current_node) operator(=) ident(oldsrc)operator(;) - - reserved(return) ident(v)operator(;) -operator(}) - -ident(VALUE) -ident(rb_eval_string_protect)operator(()ident(str)operator(,) ident(state)operator(\)) - directive(const) pre_type(char) operator(*)ident(str)operator(;) - pre_type(int) operator(*)ident(state)operator(;) -operator({) - reserved(return) ident(rb_protect)operator((()ident(VALUE) operator((*\))ident(_)operator((()ident(VALUE)operator(\)\)\))ident(rb_eval_string)operator(,) operator(()ident(VALUE)operator(\))ident(str)operator(,) ident(state)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_eval_string_wrap)operator(()ident(str)operator(,) ident(state)operator(\)) - directive(const) pre_type(char) operator(*)ident(str)operator(;) - pre_type(int) operator(*)ident(state)operator(;) -operator({) - pre_type(int) ident(status)operator(;) - ident(VALUE) ident(self) operator(=) ident(ruby_top_self)operator(;) - ident(VALUE) ident(wrapper) operator(=) ident(ruby_wrapper)operator(;) - ident(VALUE) ident(val)operator(;) - - ident(PUSH_CLASS)operator(()ident(ruby_wrapper) operator(=) ident(rb_module_new)operator((\)\);) - ident(ruby_top_self) operator(=) ident(rb_obj_clone)operator(()ident(ruby_top_self)operator(\);) - ident(rb_extend_object)operator(()ident(ruby_top_self)operator(,) ident(ruby_wrapper)operator(\);) - ident(PUSH_FRAME)operator((\);) - ident(ruby_frame)operator(->)ident(last_func) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(last_class) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(self) operator(=) ident(self)operator(;) - ident(PUSH_CREF)operator(()ident(ruby_wrapper)operator(\);) - ident(PUSH_SCOPE)operator((\);) - - ident(val) operator(=) ident(rb_eval_string_protect)operator(()ident(str)operator(,) operator(&)ident(status)operator(\);) - ident(ruby_top_self) operator(=) ident(self)operator(;) - - ident(POP_SCOPE)operator((\);) - ident(POP_FRAME)operator((\);) - ident(POP_CLASS)operator((\);) - ident(ruby_wrapper) operator(=) ident(wrapper)operator(;) - reserved(if) operator(()ident(state)operator(\)) operator({) - operator(*)ident(state) operator(=) ident(status)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(status)operator(\)) operator({) - ident(JUMP_TAG)operator(()ident(status)operator(\);) - operator(}) - reserved(return) ident(val)operator(;) -operator(}) - -ident(NORETURN)operator(()directive(static) directive(void) ident(localjump_error)operator(()directive(const) pre_type(char)operator(*,) ident(VALUE)operator(,) pre_type(int)operator(\)\);) -directive(static) directive(void) -ident(localjump_error)operator(()ident(mesg)operator(,) ident(value)operator(,) ident(reason)operator(\)) - directive(const) pre_type(char) operator(*)ident(mesg)operator(;) - ident(VALUE) ident(value)operator(;) - pre_type(int) ident(reason)operator(;) -operator({) - ident(VALUE) ident(exc) operator(=) ident(rb_exc_new2)operator(()ident(rb_eLocalJumpError)operator(,) ident(mesg)operator(\);) - ident(ID) ident(id)operator(;) - - ident(rb_iv_set)operator(()ident(exc)operator(,) stringoperator(,) ident(value)operator(\);) - reserved(switch) operator(()ident(reason)operator(\)) operator({) - reserved(case) ident(TAG_BREAK)operator(:) - ident(id) operator(=) ident(rb_intern)operator(()stringoperator(\);) reserved(break)operator(;) - reserved(case) ident(TAG_REDO)operator(:) - ident(id) operator(=) ident(rb_intern)operator(()stringoperator(\);) reserved(break)operator(;) - reserved(case) ident(TAG_RETRY)operator(:) - ident(id) operator(=) ident(rb_intern)operator(()stringoperator(\);) reserved(break)operator(;) - reserved(case) ident(TAG_NEXT)operator(:) - ident(id) operator(=) ident(rb_intern)operator(()stringoperator(\);) reserved(break)operator(;) - reserved(case) ident(TAG_RETURN)operator(:) - ident(id) operator(=) ident(rb_intern)operator(()stringoperator(\);) reserved(break)operator(;) - reserved(default)operator(:) - ident(id) operator(=) ident(rb_intern)operator(()stringoperator(\);) reserved(break)operator(;) - operator(}) - ident(rb_iv_set)operator(()ident(exc)operator(,) stringoperator(,) ident(ID2SYM)operator(()ident(id)operator(\)\);) - ident(rb_exc_raise)operator(()ident(exc)operator(\);) -operator(}) - -comment(/* - * call_seq: - * local_jump_error.exit_value => obj - * - * Returns the exit value associated with this +LocalJumpError+. - */) -directive(static) ident(VALUE) -ident(localjump_xvalue)operator(()ident(exc)operator(\)) - ident(VALUE) ident(exc)operator(;) -operator({) - reserved(return) ident(rb_iv_get)operator(()ident(exc)operator(,) stringoperator(\);) -operator(}) - -comment(/* - * call-seq: - * local_jump_error.reason => symbol - * - * The reason this block was terminated: - * :break, :redo, :retry, :next, :return, or :noreason. - */) - -directive(static) ident(VALUE) -ident(localjump_reason)operator(()ident(exc)operator(\)) - ident(VALUE) ident(exc)operator(;) -operator({) - reserved(return) ident(rb_iv_get)operator(()ident(exc)operator(,) stringoperator(\);) -operator(}) - -ident(NORETURN)operator(()directive(static) directive(void) ident(jump_tag_but_local_jump) ident(_)operator((()pre_type(int)operator(,)ident(VALUE)operator(\)\)\);) -directive(static) directive(void) -ident(jump_tag_but_local_jump)operator(()ident(state)operator(,) ident(val)operator(\)) - pre_type(int) ident(state)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - - reserved(if) operator(()ident(val) operator(==) ident(Qundef)operator(\)) ident(val) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - reserved(switch) operator(()ident(state)operator(\)) operator({) - reserved(case) integer(0)operator(:) - reserved(break)operator(;) - reserved(case) ident(TAG_RETURN)operator(:) - ident(localjump_error)operator(()stringoperator(,) ident(val)operator(,) ident(state)operator(\);) - reserved(break)operator(;) - reserved(case) ident(TAG_BREAK)operator(:) - ident(localjump_error)operator(()stringoperator(,) ident(val)operator(,) ident(state)operator(\);) - reserved(break)operator(;) - reserved(case) ident(TAG_NEXT)operator(:) - ident(localjump_error)operator(()stringoperator(,) ident(val)operator(,) ident(state)operator(\);) - reserved(break)operator(;) - reserved(case) ident(TAG_REDO)operator(:) - ident(localjump_error)operator(()stringoperator(,) ident(Qnil)operator(,) ident(state)operator(\);) - reserved(break)operator(;) - reserved(case) ident(TAG_RETRY)operator(:) - ident(localjump_error)operator(()stringoperator(,) ident(Qnil)operator(,) ident(state)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - ident(JUMP_TAG)operator(()ident(state)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_eval_cmd)operator(()ident(cmd)operator(,) ident(arg)operator(,) ident(level)operator(\)) - ident(VALUE) ident(cmd)operator(,) ident(arg)operator(;) - pre_type(int) ident(level)operator(;) -operator({) - pre_type(int) ident(state)operator(;) - ident(VALUE) ident(val) operator(=) ident(Qnil)operator(;) comment(/* OK */) - reserved(struct) ident(SCOPE) operator(*)ident(saved_scope)operator(;) - directive(volatile) pre_type(int) ident(safe) operator(=) ident(ruby_safe_level)operator(;) - - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(cmd)operator(\)\)) operator({) - ident(level) operator(=) integer(4)operator(;) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(cmd)operator(\)) operator(!=) ident(T_STRING)operator(\)) operator({) - ident(PUSH_ITER)operator(()ident(ITER_NOT)operator(\);) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - ident(ruby_safe_level) operator(=) ident(level)operator(;) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(val) operator(=) ident(rb_funcall2)operator(()ident(cmd)operator(,) ident(rb_intern)operator(()stringoperator(\),) ident(RARRAY)operator(()ident(arg)operator(\)->)ident(len)operator(,) ident(RARRAY)operator(()ident(arg)operator(\)->)ident(ptr)operator(\);) - operator(}) - ident(ruby_safe_level) operator(=) ident(safe)operator(;) - ident(POP_TAG)operator((\);) - ident(POP_ITER)operator((\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - reserved(return) ident(val)operator(;) - operator(}) - - ident(saved_scope) operator(=) ident(ruby_scope)operator(;) - ident(ruby_scope) operator(=) ident(top_scope)operator(;) - ident(PUSH_FRAME)operator((\);) - ident(ruby_frame)operator(->)ident(last_func) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(last_class) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(self) operator(=) ident(ruby_top_self)operator(;) - ident(PUSH_CREF)operator(()ident(ruby_wrapper) operator(?) ident(ruby_wrapper) operator(:) ident(rb_cObject)operator(\);) - - ident(ruby_safe_level) operator(=) ident(level)operator(;) - - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(val) operator(=) ident(eval)operator(()ident(ruby_top_self)operator(,) ident(cmd)operator(,) ident(Qnil)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(ruby_scope)operator(->)ident(flags) operator(&) ident(SCOPE_DONT_RECYCLE)operator(\)) - ident(scope_dup)operator(()ident(saved_scope)operator(\);) - ident(ruby_scope) operator(=) ident(saved_scope)operator(;) - ident(ruby_safe_level) operator(=) ident(safe)operator(;) - ident(POP_TAG)operator((\);) - ident(POP_FRAME)operator((\);) - - reserved(if) operator(()ident(state)operator(\)) ident(jump_tag_but_local_jump)operator(()ident(state)operator(,) ident(val)operator(\);) - reserved(return) ident(val)operator(;) -operator(}) - -preprocessor(#define) ident(ruby_cbase) operator(()ident(ruby_cref)operator(->)ident(nd_clss)operator(\)) - -directive(static) ident(VALUE) -ident(ev_const_defined)operator(()ident(cref)operator(,) ident(id)operator(,) ident(self)operator(\)) - ident(NODE) operator(*)ident(cref)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - ident(NODE) operator(*)ident(cbase) operator(=) ident(cref)operator(;) - ident(VALUE) ident(result)operator(;) - - reserved(while) operator(()ident(cbase) operator(&&) ident(cbase)operator(->)ident(nd_next)operator(\)) operator({) - reserved(struct) ident(RClass) operator(*)ident(klass) operator(=) ident(RCLASS)operator(()ident(cbase)operator(->)ident(nd_clss)operator(\);) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(klass)operator(\)\)) operator({) - reserved(if) operator(()ident(klass)operator(->)ident(iv_tbl) operator(&&) ident(st_lookup)operator(()ident(klass)operator(->)ident(iv_tbl)operator(,) ident(id)operator(,) operator(&)ident(result)operator(\)\)) operator({) - reserved(if) operator(()ident(result) operator(==) ident(Qundef) operator(&&) ident(NIL_P)operator(()ident(rb_autoload_p)operator((()ident(VALUE)operator(\))ident(klass)operator(,) ident(id)operator(\)\)\)) operator({) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(Qtrue)operator(;) - operator(}) - operator(}) - ident(cbase) operator(=) ident(cbase)operator(->)ident(nd_next)operator(;) - operator(}) - reserved(return) ident(rb_const_defined)operator(()ident(cref)operator(->)ident(nd_clss)operator(,) ident(id)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(ev_const_get)operator(()ident(cref)operator(,) ident(id)operator(,) ident(self)operator(\)) - ident(NODE) operator(*)ident(cref)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - ident(NODE) operator(*)ident(cbase) operator(=) ident(cref)operator(;) - ident(VALUE) ident(result)operator(;) - - reserved(while) operator(()ident(cbase) operator(&&) ident(cbase)operator(->)ident(nd_next)operator(\)) operator({) - ident(VALUE) ident(klass) operator(=) ident(cbase)operator(->)ident(nd_clss)operator(;) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(klass)operator(\)\)) operator({) - reserved(while) operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl) operator(&&) - ident(st_lookup)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(,) ident(id)operator(,) operator(&)ident(result)operator(\)\)) operator({) - reserved(if) operator(()ident(result) operator(==) ident(Qundef)operator(\)) operator({) - reserved(if) operator((!)ident(RTEST)operator(()ident(rb_autoload_load)operator(()ident(klass)operator(,) ident(id)operator(\)\)\)) reserved(break)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(return) ident(result)operator(;) - operator(}) - operator(}) - ident(cbase) operator(=) ident(cbase)operator(->)ident(nd_next)operator(;) - operator(}) - reserved(return) ident(rb_const_get)operator(()ident(NIL_P)operator(()ident(cref)operator(->)ident(nd_clss)operator(\)) operator(?) ident(CLASS_OF)operator(()ident(self)operator(\):) ident(cref)operator(->)ident(nd_clss)operator(,) ident(id)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(cvar_cbase)operator((\)) -operator({) - ident(NODE) operator(*)ident(cref) operator(=) ident(ruby_cref)operator(;) - - reserved(while) operator(()ident(cref) operator(&&) ident(cref)operator(->)ident(nd_next) operator(&&) operator(()ident(NIL_P)operator(()ident(cref)operator(->)ident(nd_clss)operator(\)) operator(||) ident(FL_TEST)operator(()ident(cref)operator(->)ident(nd_clss)operator(,) ident(FL_SINGLETON)operator(\)\)\)) operator({) - ident(cref) operator(=) ident(cref)operator(->)ident(nd_next)operator(;) - reserved(if) operator((!)ident(cref)operator(->)ident(nd_next)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(cref)operator(->)ident(nd_clss)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(cref)operator(->)ident(nd_clss)operator(;) -operator(}) - -comment(/* - * call-seq: - * Module.nesting => array - * - * Returns the list of +Modules+ nested at the point of call. - * - * module M1 - * module M2 - * $a = Module.nesting - * end - * end - * $a #=> [M1::M2, M1] - * $a[0].name #=> "M1::M2" - */) - -directive(static) ident(VALUE) -ident(rb_mod_nesting)operator((\)) -operator({) - ident(NODE) operator(*)ident(cbase) operator(=) ident(ruby_cref)operator(;) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - reserved(while) operator(()ident(cbase) operator(&&) ident(cbase)operator(->)ident(nd_next)operator(\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(cbase)operator(->)ident(nd_clss)operator(\)\)) ident(rb_ary_push)operator(()ident(ary)operator(,) ident(cbase)operator(->)ident(nd_clss)operator(\);) - ident(cbase) operator(=) ident(cbase)operator(->)ident(nd_next)operator(;) - operator(}) - reserved(if) operator(()ident(ruby_wrapper) operator(&&) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) integer(0)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(ruby_wrapper)operator(\);) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * Module.constants => array - * - * Returns an array of the names of all constants defined in the - * system. This list includes the names of all modules and classes. - * - * p Module.constants.sort[1..5] - * - * produces: - * - * ["ARGV", "ArgumentError", "Array", "Bignum", "Binding"] - */) - -directive(static) ident(VALUE) -ident(rb_mod_s_constants)operator((\)) -operator({) - ident(NODE) operator(*)ident(cbase) operator(=) ident(ruby_cref)operator(;) - directive(void) operator(*)ident(data) operator(=) integer(0)operator(;) - - reserved(while) operator(()ident(cbase)operator(\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(cbase)operator(->)ident(nd_clss)operator(\)\)) operator({) - ident(data) operator(=) ident(rb_mod_const_at)operator(()ident(cbase)operator(->)ident(nd_clss)operator(,) ident(data)operator(\);) - operator(}) - ident(cbase) operator(=) ident(cbase)operator(->)ident(nd_next)operator(;) - operator(}) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(ruby_cbase)operator(\)\)) operator({) - ident(data) operator(=) ident(rb_mod_const_of)operator(()ident(ruby_cbase)operator(,) ident(data)operator(\);) - operator(}) - reserved(return) ident(rb_const_list)operator(()ident(data)operator(\);) -operator(}) - -directive(void) -ident(rb_frozen_class_p)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - pre_type(char) operator(*)ident(desc) operator(=) stringoperator(;) - - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(klass)operator(\)\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) - ident(desc) operator(=) stringoperator(;) - reserved(else) operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(klass)operator(\)\)) operator({) - reserved(case) ident(T_MODULE)operator(:) - reserved(case) ident(T_ICLASS)operator(:) - ident(desc) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) ident(T_CLASS)operator(:) - ident(desc) operator(=) stringoperator(;) reserved(break)operator(;) - operator(}) - operator(}) - ident(rb_error_frozen)operator(()ident(desc)operator(\);) - operator(}) -operator(}) - -directive(void) -ident(rb_undef)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(origin)operator(;) - ident(NODE) operator(*)ident(body)operator(;) - - reserved(if) operator(()ident(ruby_cbase) operator(==) ident(rb_cObject) operator(&&) ident(klass) operator(==) ident(rb_cObject)operator(\)) operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - operator(}) - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4) operator(&&) operator(!)ident(OBJ_TAINTED)operator(()ident(klass)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - ident(rb_frozen_class_p)operator(()ident(klass)operator(\);) - reserved(if) operator(()ident(id) operator(==) ident(__id__) operator(||) ident(id) operator(==) ident(__send__) operator(||) ident(id) operator(==) ident(init)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - ident(body) operator(=) ident(search_method)operator(()ident(klass)operator(,) ident(id)operator(,) operator(&)ident(origin)operator(\);) - reserved(if) operator((!)ident(body) operator(||) operator(!)ident(body)operator(->)ident(nd_body)operator(\)) operator({) - pre_type(char) operator(*)ident(s0) operator(=) stringoperator(;) - ident(VALUE) ident(c) operator(=) ident(klass)operator(;) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(c)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(VALUE) ident(obj) operator(=) ident(rb_iv_get)operator(()ident(klass)operator(,) stringoperator(\);) - - reserved(switch) operator(()ident(TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_MODULE)operator(:) - reserved(case) ident(T_CLASS)operator(:) - ident(c) operator(=) ident(obj)operator(;) - ident(s0) operator(=) stringoperator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(TYPE)operator(()ident(c)operator(\)) operator(==) ident(T_MODULE)operator(\)) operator({) - ident(s0) operator(=) stringoperator(;) - operator(}) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(id)operator(\),)ident(s0)operator(,)ident(rb_class2name)operator(()ident(c)operator(\)\);) - operator(}) - ident(rb_add_method)operator(()ident(klass)operator(,) ident(id)operator(,) integer(0)operator(,) ident(NOEX_PUBLIC)operator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(rb_funcall)operator(()ident(rb_iv_get)operator(()ident(klass)operator(,) stringoperator(\),) - ident(singleton_undefined)operator(,) integer(1)operator(,) ident(ID2SYM)operator(()ident(id)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(rb_funcall)operator(()ident(klass)operator(,) ident(undefined)operator(,) integer(1)operator(,) ident(ID2SYM)operator(()ident(id)operator(\)\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * undef_method(symbol\) => self - * - * Prevents the current class from responding to calls to the named - * method. Contrast this with remove_method, which deletes - * the method from the particular class; Ruby will still search - * superclasses and mixed-in modules for a possible receiver. - * - * class Parent - * def hello - * puts "In parent" - * end - * end - * class Child < Parent - * def hello - * puts "In child" - * end - * end - * - * - * c = Child.new - * c.hello - * - * - * class Child - * remove_method :hello # remove from child, still in parent - * end - * c.hello - * - * - * class Child - * undef_method :hello # prevent any calls to 'hello' - * end - * c.hello - * - * produces: - * - * In child - * In parent - * prog.rb:23: undefined method `hello' for # (NoMethodError\) - */) - -directive(static) ident(VALUE) -ident(rb_mod_undef_method)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(mod)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(rb_undef)operator(()ident(mod)operator(,) ident(rb_to_id)operator(()ident(argv)operator([)ident(i)operator(]\)\);) - operator(}) - reserved(return) ident(mod)operator(;) -operator(}) - -directive(void) -ident(rb_alias)operator(()ident(klass)operator(,) ident(name)operator(,) ident(def)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(name)operator(,) ident(def)operator(;) -operator({) - ident(VALUE) ident(origin)operator(;) - ident(NODE) operator(*)ident(orig)operator(,) operator(*)ident(body)operator(,) operator(*)ident(node)operator(;) - ident(VALUE) ident(singleton) operator(=) integer(0)operator(;) - ident(st_data_t) ident(data)operator(;) - - ident(rb_frozen_class_p)operator(()ident(klass)operator(\);) - reserved(if) operator(()ident(name) operator(==) ident(def)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(klass) operator(==) ident(rb_cObject)operator(\)) operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - operator(}) - ident(orig) operator(=) ident(search_method)operator(()ident(klass)operator(,) ident(def)operator(,) operator(&)ident(origin)operator(\);) - reserved(if) operator((!)ident(orig) operator(||) operator(!)ident(orig)operator(->)ident(nd_body)operator(\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_MODULE)operator(\)) operator({) - ident(orig) operator(=) ident(search_method)operator(()ident(rb_cObject)operator(,) ident(def)operator(,) operator(&)ident(origin)operator(\);) - operator(}) - operator(}) - reserved(if) operator((!)ident(orig) operator(||) operator(!)ident(orig)operator(->)ident(nd_body)operator(\)) operator({) - ident(print_undef)operator(()ident(klass)operator(,) ident(def)operator(\);) - operator(}) - reserved(if) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(singleton) operator(=) ident(rb_iv_get)operator(()ident(klass)operator(,) stringoperator(\);) - operator(}) - ident(body) operator(=) ident(orig)operator(->)ident(nd_body)operator(;) - ident(orig)operator(->)ident(nd_cnt)operator(++;) - reserved(if) operator(()ident(nd_type)operator(()ident(body)operator(\)) operator(==) ident(NODE_FBODY)operator(\)) operator({) comment(/* was alias */) - ident(def) operator(=) ident(body)operator(->)ident(nd_mid)operator(;) - ident(origin) operator(=) ident(body)operator(->)ident(nd_orig)operator(;) - ident(body) operator(=) ident(body)operator(->)ident(nd_head)operator(;) - operator(}) - - ident(rb_clear_cache_by_id)operator(()ident(name)operator(\);) - reserved(if) operator(()ident(RTEST)operator(()ident(ruby_verbose)operator(\)) operator(&&) ident(st_lookup)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(,) ident(name)operator(,) operator(&)ident(data)operator(\)\)) operator({) - ident(node) operator(=) operator(()ident(NODE) operator(*\))ident(data)operator(;) - reserved(if) operator(()ident(node)operator(->)ident(nd_cnt) operator(==) integer(0) operator(&&) ident(node)operator(->)ident(nd_body)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(name)operator(\)\);) - operator(}) - operator(}) - ident(st_insert)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(,) ident(name)operator(,) - operator(()ident(st_data_t)operator(\))ident(NEW_METHOD)operator(()ident(NEW_FBODY)operator(()ident(body)operator(,) ident(def)operator(,) ident(origin)operator(\),) - ident(NOEX_WITH_SAFE)operator(()ident(orig)operator(->)ident(nd_noex)operator(\)\)\);) - - reserved(if) operator((!)ident(ruby_running)operator(\)) reserved(return)operator(;) - - reserved(if) operator(()ident(singleton)operator(\)) operator({) - ident(rb_funcall)operator(()ident(singleton)operator(,) ident(singleton_added)operator(,) integer(1)operator(,) ident(ID2SYM)operator(()ident(name)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(rb_funcall)operator(()ident(klass)operator(,) ident(added)operator(,) integer(1)operator(,) ident(ID2SYM)operator(()ident(name)operator(\)\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * alias_method(new_name, old_name\) => self - * - * Makes new_name a new copy of the method old_name. This can - * be used to retain access to methods that are overridden. - * - * module Mod - * alias_method :orig_exit, :exit - * def exit(code=0\) - * puts "Exiting with code #{code}" - * orig_exit(code\) - * end - * end - * include Mod - * exit(99\) - * - * produces: - * - * Exiting with code 99 - */) - -directive(static) ident(VALUE) -ident(rb_mod_alias_method)operator(()ident(mod)operator(,) ident(newname)operator(,) ident(oldname)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(newname)operator(,) ident(oldname)operator(;) -operator({) - ident(rb_alias)operator(()ident(mod)operator(,) ident(rb_to_id)operator(()ident(newname)operator(\),) ident(rb_to_id)operator(()ident(oldname)operator(\)\);) - reserved(return) ident(mod)operator(;) -operator(}) - -ident(NODE) operator(*) -ident(rb_copy_node_scope)operator(()ident(node)operator(,) ident(rval)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) - ident(NODE) operator(*)ident(rval)operator(;) -operator({) - ident(NODE) operator(*)ident(copy) operator(=) ident(NEW_NODE)operator(()ident(NODE_SCOPE)operator(,)integer(0)operator(,)ident(rval)operator(,)ident(node)operator(->)ident(nd_next)operator(\);) - - reserved(if) operator(()ident(node)operator(->)ident(nd_tbl)operator(\)) operator({) - ident(copy)operator(->)ident(nd_tbl) operator(=) ident(ALLOC_N)operator(()ident(ID)operator(,) ident(node)operator(->)ident(nd_tbl)operator([)integer(0)operator(]+)integer(1)operator(\);) - ident(MEMCPY)operator(()ident(copy)operator(->)ident(nd_tbl)operator(,) ident(node)operator(->)ident(nd_tbl)operator(,) ident(ID)operator(,) ident(node)operator(->)ident(nd_tbl)operator([)integer(0)operator(]+)integer(1)operator(\);) - operator(}) - reserved(else) operator({) - ident(copy)operator(->)ident(nd_tbl) operator(=) integer(0)operator(;) - operator(}) - reserved(return) ident(copy)operator(;) -operator(}) - -preprocessor(#ifdef) ident(C_ALLOCA) -preprocessor(# define) ident(TMP_PROTECT) ident(NODE) operator(*) directive(volatile) ident(tmp__protect_tmp)operator(=)integer(0) -preprocessor(# define) ident(TMP_ALLOC)operator(()ident(n)operator(\)) \ - operator(()ident(tmp__protect_tmp) operator(=) ident(NEW_NODE)operator(()ident(NODE_ALLOCA)operator(,) \ - ident(ALLOC_N)operator(()ident(VALUE)operator(,)ident(n)operator(\),)ident(tmp__protect_tmp)operator(,)ident(n)operator(\),) \ - operator(()directive(void)operator(*\))ident(tmp__protect_tmp)operator(->)ident(nd_head)operator(\)) -preprocessor(#else) -preprocessor(# define) ident(TMP_PROTECT) reserved(typedef) pre_type(int) ident(foobazzz) -preprocessor(# define) ident(TMP_ALLOC)operator(()ident(n)operator(\)) ident(ALLOCA_N)operator(()ident(VALUE)operator(,)ident(n)operator(\)) -preprocessor(#endif) - -preprocessor(#define) ident(SETUP_ARGS0)operator(()ident(anode)operator(,)ident(extra)operator(\)) reserved(do) operator({)\ - ident(NODE) operator(*)ident(n) operator(=) ident(anode)operator(;)\ - reserved(if) operator((!)ident(n)operator(\)) operator({)\ - ident(argc) operator(=) integer(0)operator(;)\ - ident(argv) operator(=) integer(0)operator(;)\ - operator(})\ - reserved(else) reserved(if) operator(()ident(nd_type)operator(()ident(n)operator(\)) operator(==) ident(NODE_ARRAY)operator(\)) operator({)\ - ident(argc)operator(=)ident(anode)operator(->)ident(nd_alen)operator(;)\ - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({)\ - pre_type(int) ident(i)operator(;)\ - ident(n) operator(=) ident(anode)operator(;)\ - ident(argv) operator(=) ident(TMP_ALLOC)operator(()ident(argc)operator(+)ident(extra)operator(\);)\ - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;)ident(i)operator(<)ident(argc)operator(;)ident(i)operator(++\)) operator({)\ - ident(argv)operator([)ident(i)operator(]) operator(=) ident(rb_eval)operator(()ident(self)operator(,)ident(n)operator(->)ident(nd_head)operator(\);)\ - ident(n)operator(=)ident(n)operator(->)ident(nd_next)operator(;)\ - operator(})\ - operator(})\ - reserved(else) operator({)\ - ident(argc) operator(=) integer(0)operator(;)\ - ident(argv) operator(=) integer(0)operator(;)\ - operator(})\ - operator(})\ - reserved(else) operator({)\ - ident(VALUE) ident(args) operator(=) ident(rb_eval)operator(()ident(self)operator(,)ident(n)operator(\);)\ - reserved(if) operator(()ident(TYPE)operator(()ident(args)operator(\)) operator(!=) ident(T_ARRAY)operator(\))\ - ident(args) operator(=) ident(rb_ary_to_ary)operator(()ident(args)operator(\);)\ - ident(argc) operator(=) ident(RARRAY)operator(()ident(args)operator(\)->)ident(len)operator(;)\ - ident(argv) operator(=) ident(TMP_ALLOC)operator(()ident(argc)operator(+)ident(extra)operator(\);)\ - ident(MEMCPY)operator(()ident(argv)operator(,) ident(RARRAY)operator(()ident(args)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(argc)operator(\);)\ - operator(})\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(SETUP_ARGS)operator(()ident(anode)operator(\)) ident(SETUP_ARGS0)operator(()ident(anode)operator(,)integer(0)operator(\)) - -preprocessor(#define) ident(BEGIN_CALLARGS) reserved(do) operator({)\ - reserved(struct) ident(BLOCK) operator(*)ident(tmp_block) operator(=) ident(ruby_block)operator(;)\ - pre_type(int) ident(tmp_iter) operator(=) ident(ruby_iter)operator(->)ident(iter)operator(;)\ - reserved(switch) operator(()ident(tmp_iter)operator(\)) operator({)\ - reserved(case) ident(ITER_PRE)operator(:)\ - reserved(if) operator(()ident(ruby_block)operator(\)) ident(ruby_block) operator(=) ident(ruby_block)operator(->)ident(outer)operator(;)\ - reserved(case) ident(ITER_PAS)operator(:)\ - ident(tmp_iter) operator(=) ident(ITER_NOT)operator(;)\ - operator(})\ - ident(PUSH_ITER)operator(()ident(tmp_iter)operator(\)) - -preprocessor(#define) ident(END_CALLARGS) \ - ident(ruby_block) operator(=) ident(tmp_block)operator(;)\ - ident(POP_ITER)operator((\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(MATCH_DATA) operator(*)ident(rb_svar)operator(()ident(node)operator(->)ident(nd_cnt)operator(\)) - -directive(static) pre_type(char)operator(*) ident(is_defined) ident(_)operator((()ident(VALUE)operator(,) ident(NODE)operator(*,) pre_type(char)operator(*\)\);) - -directive(static) pre_type(char)operator(*) -ident(arg_defined)operator(()ident(self)operator(,) ident(node)operator(,) ident(buf)operator(,) ident(type)operator(\)) - ident(VALUE) ident(self)operator(;) - ident(NODE) operator(*)ident(node)operator(;) - pre_type(char) operator(*)ident(buf)operator(;) - pre_type(char) operator(*)ident(type)operator(;) -operator({) - pre_type(int) ident(argc)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(if) operator((!)ident(node)operator(\)) reserved(return) ident(type)operator(;) comment(/* no args */) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_ARRAY)operator(\)) operator({) - ident(argc)operator(=)ident(node)operator(->)ident(nd_alen)operator(;) - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;)ident(i)operator(<)ident(argc)operator(;)ident(i)operator(++\)) operator({) - reserved(if) operator((!)ident(is_defined)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(,) ident(buf)operator(\)\)) - reserved(return) integer(0)operator(;) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - operator(}) - operator(}) - operator(}) - reserved(else) reserved(if) operator((!)ident(is_defined)operator(()ident(self)operator(,) ident(node)operator(,) ident(buf)operator(\)\)) operator({) - reserved(return) integer(0)operator(;) - operator(}) - reserved(return) ident(type)operator(;) -operator(}) - -directive(static) pre_type(char)operator(*) -ident(is_defined)operator(()ident(self)operator(,) ident(node)operator(,) ident(buf)operator(\)) - ident(VALUE) ident(self)operator(;) - ident(NODE) operator(*)ident(node)operator(;) comment(/* OK */) - pre_type(char) operator(*)ident(buf)operator(;) -operator({) - ident(VALUE) ident(val)operator(;) comment(/* OK */) - pre_type(int) ident(state)operator(;) - - label(again:) - reserved(if) operator((!)ident(node)operator(\)) reserved(return) stringoperator(;) - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_SUPER)operator(:) - reserved(case) ident(NODE_ZSUPER)operator(:) - reserved(if) operator(()ident(ruby_frame)operator(->)ident(last_func) operator(==) integer(0)operator(\)) reserved(return) integer(0)operator(;) - reserved(else) reserved(if) operator(()ident(ruby_frame)operator(->)ident(last_class) operator(==) integer(0)operator(\)) reserved(return) integer(0)operator(;) - ident(val) operator(=) ident(ruby_frame)operator(->)ident(last_class)operator(;) - reserved(if) operator(()ident(rb_method_boundp)operator(()ident(RCLASS)operator(()ident(val)operator(\)->)ident(super)operator(,) ident(ruby_frame)operator(->)ident(orig_func)operator(,) integer(0)operator(\)\)) operator({) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_SUPER)operator(\)) operator({) - reserved(return) ident(arg_defined)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_args)operator(,) ident(buf)operator(,) stringoperator(\);) - operator(}) - reserved(return) stringoperator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_VCALL)operator(:) - reserved(case) ident(NODE_FCALL)operator(:) - ident(val) operator(=) ident(self)operator(;) - reserved(goto) ident(check_bound)operator(;) - - reserved(case) ident(NODE_ATTRASGN)operator(:) - ident(val) operator(=) ident(self)operator(;) - reserved(if) operator(()ident(node)operator(->)ident(nd_recv) operator(==) operator(()ident(NODE) operator(*\))integer(1)operator(\)) reserved(goto) ident(check_bound)operator(;) - reserved(case) ident(NODE_CALL)operator(:) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(val) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_recv)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state)operator(\)) operator({) - ident(ruby_errinfo) operator(=) ident(Qnil)operator(;) - reserved(return) integer(0)operator(;) - operator(}) - label(check_bound:) - operator({) - pre_type(int) ident(call) operator(=) ident(nd_type)operator(()ident(node)operator(\)==)ident(NODE_CALL)operator(;) - - ident(val) operator(=) ident(CLASS_OF)operator(()ident(val)operator(\);) - reserved(if) operator(()ident(call)operator(\)) operator({) - pre_type(int) ident(noex)operator(;) - ident(ID) ident(id) operator(=) ident(node)operator(->)ident(nd_mid)operator(;) - - reserved(if) operator((!)ident(rb_get_method_body)operator((&)ident(val)operator(,) operator(&)ident(id)operator(,) operator(&)ident(noex)operator(\)\)) - reserved(break)operator(;) - reserved(if) operator((()ident(noex) operator(&) ident(NOEX_PRIVATE)operator(\)\)) - reserved(break)operator(;) - reserved(if) operator((()ident(noex) operator(&) ident(NOEX_PROTECTED)operator(\)) operator(&&) - operator(!)ident(rb_obj_is_kind_of)operator(()ident(self)operator(,) ident(rb_class_real)operator(()ident(val)operator(\)\)\)) - reserved(break)operator(;) - operator(}) - reserved(else) reserved(if) operator((!)ident(rb_method_boundp)operator(()ident(val)operator(,) ident(node)operator(->)ident(nd_mid)operator(,) ident(call)operator(\)\)) - reserved(break)operator(;) - reserved(return) ident(arg_defined)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_args)operator(,) ident(buf)operator(,) - ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_ATTRASGN) operator(?) - string operator(:) stringoperator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_MATCH2)operator(:) - reserved(case) ident(NODE_MATCH3)operator(:) - reserved(return) stringoperator(;) - - reserved(case) ident(NODE_YIELD)operator(:) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - reserved(return) stringoperator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_SELF)operator(:) - reserved(return) stringoperator(;) - - reserved(case) ident(NODE_NIL)operator(:) - reserved(return) stringoperator(;) - - reserved(case) ident(NODE_TRUE)operator(:) - reserved(return) stringoperator(;) - - reserved(case) ident(NODE_FALSE)operator(:) - reserved(return) stringoperator(;) - - reserved(case) ident(NODE_ATTRSET)operator(:) - reserved(case) ident(NODE_OP_ASGN1)operator(:) - reserved(case) ident(NODE_OP_ASGN2)operator(:) - reserved(case) ident(NODE_OP_ASGN_OR)operator(:) - reserved(case) ident(NODE_OP_ASGN_AND)operator(:) - reserved(case) ident(NODE_MASGN)operator(:) - reserved(case) ident(NODE_LASGN)operator(:) - reserved(case) ident(NODE_DASGN)operator(:) - reserved(case) ident(NODE_DASGN_CURR)operator(:) - reserved(case) ident(NODE_GASGN)operator(:) - reserved(case) ident(NODE_IASGN)operator(:) - reserved(case) ident(NODE_CDECL)operator(:) - reserved(case) ident(NODE_CVDECL)operator(:) - reserved(case) ident(NODE_CVASGN)operator(:) - reserved(return) stringoperator(;) - - reserved(case) ident(NODE_LVAR)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(NODE_DVAR)operator(:) - reserved(return) stringoperator(;) - - reserved(case) ident(NODE_GVAR)operator(:) - reserved(if) operator(()ident(rb_gvar_defined)operator(()ident(node)operator(->)ident(nd_entry)operator(\)\)) operator({) - reserved(return) stringoperator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_IVAR)operator(:) - reserved(if) operator(()ident(rb_ivar_defined)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_vid)operator(\)\)) operator({) - reserved(return) stringoperator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_CONST)operator(:) - reserved(if) operator(()ident(ev_const_defined)operator(()ident(ruby_cref)operator(,) ident(node)operator(->)ident(nd_vid)operator(,) ident(self)operator(\)\)) operator({) - reserved(return) stringoperator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_CVAR)operator(:) - reserved(if) operator(()ident(rb_cvar_defined)operator(()ident(cvar_cbase)operator((\),) ident(node)operator(->)ident(nd_vid)operator(\)\)) operator({) - reserved(return) stringoperator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_COLON2)operator(:) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(val) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state)operator(\)) operator({) - ident(ruby_errinfo) operator(=) ident(Qnil)operator(;) - reserved(return) integer(0)operator(;) - operator(}) - reserved(else) operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(val)operator(\)\)) operator({) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - reserved(if) operator(()ident(rb_const_defined_from)operator(()ident(val)operator(,) ident(node)operator(->)ident(nd_mid)operator(\)\)) - reserved(return) stringoperator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(if) operator(()ident(rb_method_boundp)operator(()ident(CLASS_OF)operator(()ident(val)operator(\),) ident(node)operator(->)ident(nd_mid)operator(,) integer(1)operator(\)\)) operator({) - reserved(return) stringoperator(;) - operator(}) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_COLON3)operator(:) - reserved(if) operator(()ident(rb_const_defined_from)operator(()ident(rb_cObject)operator(,) ident(node)operator(->)ident(nd_mid)operator(\)\)) operator({) - reserved(return) stringoperator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_NTH_REF)operator(:) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_reg_nth_defined)operator(()ident(node)operator(->)ident(nd_nth)operator(,) ident(MATCH_DATA)operator(\)\)\)) operator({) - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) operator(()pre_type(int)operator(\))ident(node)operator(->)ident(nd_nth)operator(\);) - reserved(return) ident(buf)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_BACK_REF)operator(:) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_reg_nth_defined)operator(()integer(0)operator(,) ident(MATCH_DATA)operator(\)\)\)) operator({) - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) operator(()pre_type(char)operator(\))ident(node)operator(->)ident(nd_nth)operator(\);) - reserved(return) ident(buf)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_NEWLINE)operator(:) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(default)operator(:) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator((!)ident(state)operator(\)) operator({) - reserved(return) stringoperator(;) - operator(}) - ident(ruby_errinfo) operator(=) ident(Qnil)operator(;) - reserved(break)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) pre_type(int) ident(handle_rescue) ident(_)operator((()ident(VALUE)operator(,)ident(NODE)operator(*\)\);) - -directive(static) directive(void) ident(blk_free)operator((\);) - -directive(static) ident(VALUE) -ident(rb_obj_is_proc)operator(()ident(proc)operator(\)) - ident(VALUE) ident(proc)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(proc)operator(\)) operator(==) ident(T_DATA) operator(&&) ident(RDATA)operator(()ident(proc)operator(\)->)ident(dfree) operator(==) operator(()ident(RUBY_DATA_FUNC)operator(\))ident(blk_free)operator(\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(void) -ident(rb_add_event_hook)operator(()ident(func)operator(,) ident(events)operator(\)) - ident(rb_event_hook_func_t) ident(func)operator(;) - ident(rb_event_t) ident(events)operator(;) -operator({) - ident(rb_event_hook_t) operator(*)ident(hook)operator(;) - - ident(hook) operator(=) ident(ALLOC)operator(()ident(rb_event_hook_t)operator(\);) - ident(hook)operator(->)ident(func) operator(=) ident(func)operator(;) - ident(hook)operator(->)ident(events) operator(=) ident(events)operator(;) - ident(hook)operator(->)ident(next) operator(=) ident(event_hooks)operator(;) - ident(event_hooks) operator(=) ident(hook)operator(;) -operator(}) - -pre_type(int) -ident(rb_remove_event_hook)operator(()ident(func)operator(\)) - ident(rb_event_hook_func_t) ident(func)operator(;) -operator({) - ident(rb_event_hook_t) operator(*)ident(prev)operator(,) operator(*)ident(hook)operator(;) - - ident(prev) operator(=) pre_constant(NULL)operator(;) - ident(hook) operator(=) ident(event_hooks)operator(;) - reserved(while) operator(()ident(hook)operator(\)) operator({) - reserved(if) operator(()ident(hook)operator(->)ident(func) operator(==) ident(func)operator(\)) operator({) - reserved(if) operator(()ident(prev)operator(\)) operator({) - ident(prev)operator(->)ident(next) operator(=) ident(hook)operator(->)ident(next)operator(;) - operator(}) - reserved(else) operator({) - ident(event_hooks) operator(=) ident(hook)operator(->)ident(next)operator(;) - operator(}) - ident(xfree)operator(()ident(hook)operator(\);) - reserved(return) integer(0)operator(;) - operator(}) - ident(prev) operator(=) ident(hook)operator(;) - ident(hook) operator(=) ident(hook)operator(->)ident(next)operator(;) - operator(}) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - -comment(/* - * call-seq: - * set_trace_func(proc\) => proc - * set_trace_func(nil\) => nil - * - * Establishes _proc_ as the handler for tracing, or disables - * tracing if the parameter is +nil+. _proc_ takes up - * to six parameters: an event name, a filename, a line number, an - * object id, a binding, and the name of a class. _proc_ is - * invoked whenever an event occurs. Events are: c-call - * (call a C-language routine\), c-return (return from a - * C-language routine\), call (call a Ruby method\), - * class (start a class or module definition\), - * end (finish a class or module definition\), - * line (execute code on a new line\), raise - * (raise an exception\), and return (return from a Ruby - * method\). Tracing is disabled within the context of _proc_. - * - * class Test - * def test - * a = 1 - * b = 2 - * end - * end - * - * set_trace_func proc { |event, file, line, id, binding, classname| - * printf "%8s %s:%-2d %10s %8s\\n", event, file, line, id, classname - * } - * t = Test.new - * t.test - * - * line prog.rb:11 false - * c-call prog.rb:11 new Class - * c-call prog.rb:11 initialize Object - * c-return prog.rb:11 initialize Object - * c-return prog.rb:11 new Class - * line prog.rb:12 false - * call prog.rb:2 test Test - * line prog.rb:3 test Test - * line prog.rb:4 test Test - * return prog.rb:4 test Test - */) - - -directive(static) ident(VALUE) -ident(set_trace_func)operator(()ident(obj)operator(,) ident(trace)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(trace)operator(;) -operator({) - ident(rb_event_hook_t) operator(*)ident(hook)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(trace)operator(\)\)) operator({) - ident(trace_func) operator(=) integer(0)operator(;) - ident(rb_remove_event_hook)operator(()ident(call_trace_func)operator(\);) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(if) operator((!)ident(rb_obj_is_proc)operator(()ident(trace)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(trace_func) operator(=) ident(trace)operator(;) - reserved(for) operator(()ident(hook) operator(=) ident(event_hooks)operator(;) ident(hook)operator(;) ident(hook) operator(=) ident(hook)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator(()ident(hook)operator(->)ident(func) operator(==) ident(call_trace_func)operator(\)) - reserved(return) ident(trace)operator(;) - operator(}) - ident(rb_add_event_hook)operator(()ident(call_trace_func)operator(,) ident(RUBY_EVENT_ALL)operator(\);) - reserved(return) ident(trace)operator(;) -operator(}) - -directive(static) pre_type(char) operator(*) -ident(get_event_name)operator(()ident(rb_event_t) ident(event)operator(\)) -operator({) - reserved(switch) operator(()ident(event)operator(\)) operator({) - reserved(case) ident(RUBY_EVENT_LINE)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(RUBY_EVENT_CLASS)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(RUBY_EVENT_END)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(RUBY_EVENT_CALL)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(RUBY_EVENT_RETURN)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(RUBY_EVENT_C_CALL)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(RUBY_EVENT_C_RETURN)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(RUBY_EVENT_RAISE)operator(:) - reserved(return) stringoperator(;) - reserved(default)operator(:) - reserved(return) stringoperator(;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(call_trace_func)operator(()ident(event)operator(,) ident(node)operator(,) ident(self)operator(,) ident(id)operator(,) ident(klass)operator(\)) - ident(rb_event_t) ident(event)operator(;) - ident(NODE) operator(*)ident(node)operator(;) - ident(VALUE) ident(self)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(klass)operator(;) comment(/* OK */) -operator({) - pre_type(int) ident(state)operator(,) ident(raised)operator(;) - reserved(struct) ident(FRAME) operator(*)ident(prev)operator(;) - ident(NODE) operator(*)ident(node_save)operator(;) - ident(VALUE) ident(srcfile)operator(;) - pre_type(char) operator(*)ident(event_name)operator(;) - ident(rb_thread_t) ident(th) operator(=) ident(curr_thread)operator(;) - - reserved(if) operator((!)ident(trace_func)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(tracing)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(ruby_in_compile)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(id) operator(==) ident(ID_ALLOCATOR)operator(\)) reserved(return)operator(;) - - reserved(if) operator((!()ident(node_save) operator(=) ident(ruby_current_node)operator(\)\)) operator({) - ident(node_save) operator(=) ident(NEW_NEWLINE)operator(()integer(0)operator(\);) - operator(}) - ident(tracing) operator(=) integer(1)operator(;) - ident(prev) operator(=) ident(ruby_frame)operator(;) - ident(PUSH_FRAME)operator((\);) - operator(*)ident(ruby_frame) operator(=) operator(*)ident(prev)operator(;) - ident(ruby_frame)operator(->)ident(prev) operator(=) ident(prev)operator(;) - ident(ruby_frame)operator(->)ident(iter) operator(=) integer(0)operator(;) comment(/* blocks not available anyway */) - - reserved(if) operator(()ident(node)operator(\)) operator({) - ident(ruby_current_node) operator(=) ident(node)operator(;) - ident(ruby_frame)operator(->)ident(node) operator(=) ident(node)operator(;) - ident(ruby_sourcefile) operator(=) ident(node)operator(->)ident(nd_file)operator(;) - ident(ruby_sourceline) operator(=) ident(nd_line)operator(()ident(node)operator(\);) - operator(}) - reserved(if) operator(()ident(klass)operator(\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(klass) operator(=) ident(RBASIC)operator(()ident(klass)operator(\)->)ident(klass)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(klass) operator(=) ident(rb_iv_get)operator(()ident(klass)operator(,) stringoperator(\);) - operator(}) - operator(}) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - ident(raised) operator(=) ident(rb_thread_reset_raised)operator(()ident(th)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(srcfile) operator(=) ident(rb_str_new2)operator(()ident(ruby_sourcefile)operator(?)ident(ruby_sourcefile)operator(:)stringoperator(\);) - ident(event_name) operator(=) ident(get_event_name)operator(()ident(event)operator(\);) - ident(proc_invoke)operator(()ident(trace_func)operator(,) ident(rb_ary_new3)operator(()integer(6)operator(,) ident(rb_str_new2)operator(()ident(event_name)operator(\),) - ident(srcfile)operator(,) - ident(INT2FIX)operator(()ident(ruby_sourceline)operator(\),) - ident(id)operator(?)ident(ID2SYM)operator(()ident(id)operator(\):)ident(Qnil)operator(,) - ident(self)operator(?)ident(rb_f_binding)operator(()ident(self)operator(\):)ident(Qnil)operator(,) - ident(klass)operator(\),) - ident(Qundef)operator(,) integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(raised)operator(\)) ident(rb_thread_set_raised)operator(()ident(th)operator(\);) - ident(POP_TAG)operator((\);) - ident(POP_FRAME)operator((\);) - - ident(tracing) operator(=) integer(0)operator(;) - ident(ruby_current_node) operator(=) ident(node_save)operator(;) - ident(SET_CURRENT_SOURCE)operator((\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(avalue_to_svalue)operator(()ident(v)operator(\)) - ident(VALUE) ident(v)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(,) ident(top)operator(;) - - ident(tmp) operator(=) ident(rb_check_array_type)operator(()ident(v)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - reserved(return) ident(v)operator(;) - operator(}) - reserved(if) operator(()ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(Qundef)operator(;) - operator(}) - reserved(if) operator(()ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len) operator(==) integer(1)operator(\)) operator({) - ident(top) operator(=) ident(rb_check_array_type)operator(()ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(ptr)operator([)integer(0)operator(]\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(top)operator(\)\)) operator({) - reserved(return) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - operator(}) - reserved(if) operator(()ident(RARRAY)operator(()ident(top)operator(\)->)ident(len) operator(>) integer(1)operator(\)) operator({) - reserved(return) ident(v)operator(;) - operator(}) - reserved(return) ident(top)operator(;) - operator(}) - reserved(return) ident(tmp)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(svalue_to_avalue)operator(()ident(v)operator(\)) - ident(VALUE) ident(v)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(,) ident(top)operator(;) - - reserved(if) operator(()ident(v) operator(==) ident(Qundef)operator(\)) reserved(return) ident(rb_ary_new2)operator(()integer(0)operator(\);) - ident(tmp) operator(=) ident(rb_check_array_type)operator(()ident(v)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - reserved(return) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(v)operator(\);) - operator(}) - reserved(if) operator(()ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len) operator(==) integer(1)operator(\)) operator({) - ident(top) operator(=) ident(rb_check_array_type)operator(()ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(ptr)operator([)integer(0)operator(]\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(top)operator(\)) operator(&&) ident(RARRAY)operator(()ident(top)operator(\)->)ident(len) operator(>) integer(1)operator(\)) operator({) - reserved(return) ident(tmp)operator(;) - operator(}) - reserved(return) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(v)operator(\);) - operator(}) - reserved(return) ident(tmp)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(svalue_to_mrhs)operator(()ident(v)operator(,) ident(lhs)operator(\)) - ident(VALUE) ident(v)operator(;) - ident(NODE) operator(*)ident(lhs)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(;) - - reserved(if) operator(()ident(v) operator(==) ident(Qundef)operator(\)) reserved(return) ident(rb_ary_new2)operator(()integer(0)operator(\);) - ident(tmp) operator(=) ident(rb_check_array_type)operator(()ident(v)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - reserved(return) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(v)operator(\);) - operator(}) - comment(/* no lhs means splat lhs only */) - reserved(if) operator((!)ident(lhs)operator(\)) operator({) - reserved(return) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(v)operator(\);) - operator(}) - reserved(return) ident(tmp)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(avalue_splat)operator(()ident(v)operator(\)) - ident(VALUE) ident(v)operator(;) -operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(v)operator(\)->)ident(len) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(Qundef)operator(;) - operator(}) - reserved(if) operator(()ident(RARRAY)operator(()ident(v)operator(\)->)ident(len) operator(==) integer(1)operator(\)) operator({) - reserved(return) ident(RARRAY)operator(()ident(v)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - operator(}) - reserved(return) ident(v)operator(;) -operator(}) - -preprocessor(#if) integer(1) -ident(VALUE) -ident(rb_Array)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - ident(VALUE) ident(tmp) operator(=) ident(rb_check_array_type)operator(()ident(val)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - comment(/* hack to avoid invoke Object#to_a */) - ident(VALUE) ident(origin)operator(;) - ident(ID) ident(id) operator(=) ident(rb_intern)operator(()stringoperator(\);) - - reserved(if) operator(()ident(search_method)operator(()ident(CLASS_OF)operator(()ident(val)operator(\),) ident(id)operator(,) operator(&)ident(origin)operator(\)) operator(&&) - ident(RCLASS)operator(()ident(origin)operator(\)->)ident(m_tbl) operator(!=) ident(RCLASS)operator(()ident(rb_mKernel)operator(\)->)ident(m_tbl)operator(\)) operator({) comment(/* exclude Kernel#to_a */) - ident(val) operator(=) ident(rb_funcall)operator(()ident(val)operator(,) ident(id)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(val)operator(\)) operator(!=) ident(T_ARRAY)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(val)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(val)operator(\);) - operator(}) - operator(}) - reserved(return) ident(tmp)operator(;) -operator(}) -preprocessor(#endif) - -directive(static) ident(VALUE) -ident(splat_value)operator(()ident(v)operator(\)) - ident(VALUE) ident(v)operator(;) -operator({) - reserved(if) operator(()ident(NIL_P)operator(()ident(v)operator(\)\)) reserved(return) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(Qnil)operator(\);) - reserved(return) ident(rb_Array)operator(()ident(v)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(class_prefix)operator(()ident(self)operator(,) ident(cpath)operator(\)) - ident(VALUE) ident(self)operator(;) - ident(NODE) operator(*)ident(cpath)operator(;) -operator({) - reserved(if) operator((!)ident(cpath)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(\);) - operator(}) - reserved(if) operator(()ident(cpath)operator(->)ident(nd_head)operator(\)) operator({) - ident(VALUE) ident(c) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(cpath)operator(->)ident(nd_head)operator(\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(c)operator(\)\)) operator({) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(RSTRING)operator(()ident(rb_obj_as_string)operator(()ident(c)operator(\)\)->)ident(ptr)operator(\);) - operator(}) - reserved(return) ident(c)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(nd_type)operator(()ident(cpath)operator(\)) operator(==) ident(NODE_COLON2)operator(\)) operator({) - reserved(return) ident(ruby_cbase)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ruby_wrapper)operator(\)) operator({) - reserved(return) ident(ruby_wrapper)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) ident(rb_cObject)operator(;) - operator(}) -operator(}) - -preprocessor(#define) ident(return_value)operator(()ident(v)operator(\)) reserved(do) operator({)\ - reserved(if) operator((()ident(prot_tag)operator(->)ident(retval) operator(=) operator(()ident(v)operator(\)\)) operator(==) ident(Qundef)operator(\)) operator({)\ - ident(prot_tag)operator(->)ident(retval) operator(=) ident(Qnil)operator(;)\ - operator(})\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -ident(NORETURN)operator(()directive(static) directive(void) ident(return_jump) ident(_)operator((()ident(VALUE)operator(\)\)\);) -ident(NORETURN)operator(()directive(static) directive(void) ident(break_jump) ident(_)operator((()ident(VALUE)operator(\)\)\);) -ident(NORETURN)operator(()directive(static) directive(void) ident(next_jump) ident(_)operator((()ident(VALUE)operator(\)\)\);) -ident(NORETURN)operator(()directive(static) directive(void) ident(unknown_node) ident(_)operator((()ident(NODE) operator(*) directive(volatile)operator(\)\)\);) - -directive(static) directive(void) -ident(unknown_node)operator(()ident(node)operator(\)) - ident(NODE) operator(*)directive(volatile) ident(node)operator(;) -operator({) - ident(ruby_current_node) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(node)operator(->)ident(flags) operator(==) integer(0)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(,) ident(node)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(node)operator(\)) operator(!=) ident(T_NODE)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(,) ident(BUILTIN_TYPE)operator(()ident(node)operator(\),) ident(node)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_bug)operator(()stringoperator(,) ident(nd_type)operator(()ident(node)operator(\),) ident(node)operator(\);) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(rb_eval)operator(()ident(self)operator(,) ident(n)operator(\)) - ident(VALUE) ident(self)operator(;) - ident(NODE) operator(*)ident(n)operator(;) -operator({) - ident(NODE) operator(*) directive(volatile) ident(contnode) operator(=) integer(0)operator(;) - ident(NODE) operator(*) directive(volatile) ident(node) operator(=) ident(n)operator(;) - pre_type(int) ident(state)operator(;) - directive(volatile) ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) - ident(st_data_t) ident(data)operator(;) - -preprocessor(#define) ident(RETURN)operator(()ident(v)operator(\)) reserved(do) operator({) \ - ident(result) operator(=) operator(()ident(v)operator(\);) \ - reserved(goto) ident(finish)operator(;) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - - label(again:) - reserved(if) operator((!)ident(node)operator(\)) ident(RETURN)operator(()ident(Qnil)operator(\);) - - ident(ruby_current_node) operator(=) ident(node)operator(;) - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_BLOCK)operator(:) - reserved(if) operator(()ident(contnode)operator(\)) operator({) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(\);) - reserved(break)operator(;) - operator(}) - ident(contnode) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - ident(node) operator(=) ident(node)operator(->)ident(nd_head)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(NODE_POSTEXE)operator(:) - ident(rb_f_END)operator((\);) - ident(nd_set_type)operator(()ident(node)operator(,) ident(NODE_NIL)operator(\);) comment(/* exec just once */) - ident(result) operator(=) ident(Qnil)operator(;) - reserved(break)operator(;) - - comment(/* begin .. end without clauses */) - reserved(case) ident(NODE_BEGIN)operator(:) - ident(node) operator(=) ident(node)operator(->)ident(nd_body)operator(;) - reserved(goto) ident(again)operator(;) - - comment(/* nodes for speed-up(default match\) */) - reserved(case) ident(NODE_MATCH)operator(:) - ident(result) operator(=) ident(rb_reg_match2)operator(()ident(node)operator(->)ident(nd_lit)operator(\);) - reserved(break)operator(;) - - comment(/* nodes for speed-up(literal match\) */) - reserved(case) ident(NODE_MATCH2)operator(:) - operator({) - ident(VALUE) ident(l) operator(=) ident(rb_eval)operator(()ident(self)operator(,)ident(node)operator(->)ident(nd_recv)operator(\);) - ident(VALUE) ident(r) operator(=) ident(rb_eval)operator(()ident(self)operator(,)ident(node)operator(->)ident(nd_value)operator(\);) - ident(result) operator(=) ident(rb_reg_match)operator(()ident(l)operator(,) ident(r)operator(\);) - operator(}) - reserved(break)operator(;) - - comment(/* nodes for speed-up(literal match\) */) - reserved(case) ident(NODE_MATCH3)operator(:) - operator({) - ident(VALUE) ident(r) operator(=) ident(rb_eval)operator(()ident(self)operator(,)ident(node)operator(->)ident(nd_recv)operator(\);) - ident(VALUE) ident(l) operator(=) ident(rb_eval)operator(()ident(self)operator(,)ident(node)operator(->)ident(nd_value)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(l)operator(\)) operator(==) ident(T_STRING)operator(\)) operator({) - ident(result) operator(=) ident(rb_reg_match)operator(()ident(r)operator(,) ident(l)operator(\);) - operator(}) - reserved(else) operator({) - ident(result) operator(=) ident(rb_funcall)operator(()ident(l)operator(,) ident(match)operator(,) integer(1)operator(,) ident(r)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - comment(/* node for speed-up(top-level loop for -n/-p\) */) - reserved(case) ident(NODE_OPT_N)operator(:) - ident(PUSH_TAG)operator(()ident(PROT_LOOP)operator(\);) - reserved(switch) operator(()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator({) - reserved(case) integer(0)operator(:) - label(opt_n_next:) - reserved(while) operator((!)ident(NIL_P)operator(()ident(rb_gets)operator((\)\)\)) operator({) - label(opt_n_redo:) - ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_body)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TAG_REDO)operator(:) - ident(state) operator(=) integer(0)operator(;) - reserved(goto) ident(opt_n_redo)operator(;) - reserved(case) ident(TAG_NEXT)operator(:) - ident(state) operator(=) integer(0)operator(;) - reserved(goto) ident(opt_n_next)operator(;) - reserved(case) ident(TAG_BREAK)operator(:) - ident(state) operator(=) integer(0)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - ident(RETURN)operator(()ident(Qnil)operator(\);) - - reserved(case) ident(NODE_SELF)operator(:) - ident(RETURN)operator(()ident(self)operator(\);) - - reserved(case) ident(NODE_NIL)operator(:) - ident(RETURN)operator(()ident(Qnil)operator(\);) - - reserved(case) ident(NODE_TRUE)operator(:) - ident(RETURN)operator(()ident(Qtrue)operator(\);) - - reserved(case) ident(NODE_FALSE)operator(:) - ident(RETURN)operator(()ident(Qfalse)operator(\);) - - reserved(case) ident(NODE_IF)operator(:) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_LINE)operator(,) ident(node)operator(,) ident(self)operator(,) - ident(ruby_frame)operator(->)ident(last_func)operator(,) - ident(ruby_frame)operator(->)ident(last_class)operator(\);) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_cond)operator(\)\)\)) operator({) - ident(node) operator(=) ident(node)operator(->)ident(nd_body)operator(;) - operator(}) - reserved(else) operator({) - ident(node) operator(=) ident(node)operator(->)ident(nd_else)operator(;) - operator(}) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(NODE_WHEN)operator(:) - reserved(while) operator(()ident(node)operator(\)) operator({) - ident(NODE) operator(*)ident(tag)operator(;) - - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(!=) ident(NODE_WHEN)operator(\)) reserved(goto) ident(again)operator(;) - ident(tag) operator(=) ident(node)operator(->)ident(nd_head)operator(;) - reserved(while) operator(()ident(tag)operator(\)) operator({) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_LINE)operator(,) ident(tag)operator(,) ident(self)operator(,) - ident(ruby_frame)operator(->)ident(last_func)operator(,) - ident(ruby_frame)operator(->)ident(last_class)operator(\);) - reserved(if) operator(()ident(tag)operator(->)ident(nd_head) operator(&&) ident(nd_type)operator(()ident(tag)operator(->)ident(nd_head)operator(\)) operator(==) ident(NODE_WHEN)operator(\)) operator({) - ident(VALUE) ident(v) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(tag)operator(->)ident(nd_head)operator(->)ident(nd_head)operator(\);) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(!=) ident(T_ARRAY)operator(\)) ident(v) operator(=) ident(rb_ary_to_ary)operator(()ident(v)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(v)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(RARRAY)operator(()ident(v)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)\)) operator({) - ident(node) operator(=) ident(node)operator(->)ident(nd_body)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - operator(}) - ident(tag) operator(=) ident(tag)operator(->)ident(nd_next)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(tag)operator(->)ident(nd_head)operator(\)\)\)) operator({) - ident(node) operator(=) ident(node)operator(->)ident(nd_body)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - ident(tag) operator(=) ident(tag)operator(->)ident(nd_next)operator(;) - operator(}) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - operator(}) - ident(RETURN)operator(()ident(Qnil)operator(\);) - - reserved(case) ident(NODE_CASE)operator(:) - operator({) - ident(VALUE) ident(val)operator(;) - - ident(val) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\);) - ident(node) operator(=) ident(node)operator(->)ident(nd_body)operator(;) - reserved(while) operator(()ident(node)operator(\)) operator({) - ident(NODE) operator(*)ident(tag)operator(;) - - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(!=) ident(NODE_WHEN)operator(\)) operator({) - reserved(goto) ident(again)operator(;) - operator(}) - ident(tag) operator(=) ident(node)operator(->)ident(nd_head)operator(;) - reserved(while) operator(()ident(tag)operator(\)) operator({) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_LINE)operator(,) ident(tag)operator(,) ident(self)operator(,) - ident(ruby_frame)operator(->)ident(last_func)operator(,) - ident(ruby_frame)operator(->)ident(last_class)operator(\);) - reserved(if) operator(()ident(tag)operator(->)ident(nd_head) operator(&&) ident(nd_type)operator(()ident(tag)operator(->)ident(nd_head)operator(\)) operator(==) ident(NODE_WHEN)operator(\)) operator({) - ident(VALUE) ident(v) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(tag)operator(->)ident(nd_head)operator(->)ident(nd_head)operator(\);) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(!=) ident(T_ARRAY)operator(\)) ident(v) operator(=) ident(rb_ary_to_ary)operator(()ident(v)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(v)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_funcall2)operator(()ident(RARRAY)operator(()ident(v)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(eqq)operator(,) integer(1)operator(,) operator(&)ident(val)operator(\)\)\){) - ident(node) operator(=) ident(node)operator(->)ident(nd_body)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - operator(}) - ident(tag) operator(=) ident(tag)operator(->)ident(nd_next)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_funcall2)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(tag)operator(->)ident(nd_head)operator(\),) ident(eqq)operator(,) integer(1)operator(,) operator(&)ident(val)operator(\)\)\)) operator({) - ident(node) operator(=) ident(node)operator(->)ident(nd_body)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - ident(tag) operator(=) ident(tag)operator(->)ident(nd_next)operator(;) - operator(}) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - operator(}) - operator(}) - ident(RETURN)operator(()ident(Qnil)operator(\);) - - reserved(case) ident(NODE_WHILE)operator(:) - ident(PUSH_TAG)operator(()ident(PROT_LOOP)operator(\);) - ident(result) operator(=) ident(Qnil)operator(;) - reserved(switch) operator(()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator({) - reserved(case) integer(0)operator(:) - reserved(if) operator(()ident(node)operator(->)ident(nd_state) operator(&&) operator(!)ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_cond)operator(\)\)\)) - reserved(goto) ident(while_out)operator(;) - reserved(do) operator({) - label(while_redo:) - ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_body)operator(\);) - label(while_next:) - operator(;) - operator(}) reserved(while) operator(()ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_cond)operator(\)\)\);) - reserved(break)operator(;) - - reserved(case) ident(TAG_REDO)operator(:) - ident(state) operator(=) integer(0)operator(;) - reserved(goto) ident(while_redo)operator(;) - reserved(case) ident(TAG_NEXT)operator(:) - ident(state) operator(=) integer(0)operator(;) - reserved(goto) ident(while_next)operator(;) - reserved(case) ident(TAG_BREAK)operator(:) - reserved(if) operator(()ident(TAG_DST)operator((\)\)) operator({) - ident(state) operator(=) integer(0)operator(;) - ident(result) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - operator(}) - comment(/* fall through */) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - label(while_out:) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - ident(RETURN)operator(()ident(result)operator(\);) - - reserved(case) ident(NODE_UNTIL)operator(:) - ident(PUSH_TAG)operator(()ident(PROT_LOOP)operator(\);) - ident(result) operator(=) ident(Qnil)operator(;) - reserved(switch) operator(()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator({) - reserved(case) integer(0)operator(:) - reserved(if) operator(()ident(node)operator(->)ident(nd_state) operator(&&) ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_cond)operator(\)\)\)) - reserved(goto) ident(until_out)operator(;) - reserved(do) operator({) - label(until_redo:) - ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_body)operator(\);) - label(until_next:) - operator(;) - operator(}) reserved(while) operator((!)ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_cond)operator(\)\)\);) - reserved(break)operator(;) - - reserved(case) ident(TAG_REDO)operator(:) - ident(state) operator(=) integer(0)operator(;) - reserved(goto) ident(until_redo)operator(;) - reserved(case) ident(TAG_NEXT)operator(:) - ident(state) operator(=) integer(0)operator(;) - reserved(goto) ident(until_next)operator(;) - reserved(case) ident(TAG_BREAK)operator(:) - reserved(if) operator(()ident(TAG_DST)operator((\)\)) operator({) - ident(state) operator(=) integer(0)operator(;) - ident(result) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - operator(}) - comment(/* fall through */) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - label(until_out:) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - ident(RETURN)operator(()ident(result)operator(\);) - - reserved(case) ident(NODE_BLOCK_PASS)operator(:) - ident(result) operator(=) ident(block_pass)operator(()ident(self)operator(,) ident(node)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_ITER)operator(:) - reserved(case) ident(NODE_FOR)operator(:) - operator({) - ident(PUSH_TAG)operator(()ident(PROT_LOOP)operator(\);) - ident(PUSH_BLOCK)operator(()ident(node)operator(->)ident(nd_var)operator(,) ident(node)operator(->)ident(nd_body)operator(\);) - - ident(state) operator(=) ident(EXEC_TAG)operator((\);) - reserved(if) operator(()ident(state) operator(==) integer(0)operator(\)) operator({) - label(iter_retry:) - ident(PUSH_ITER)operator(()ident(ITER_PRE)operator(\);) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_ITER)operator(\)) operator({) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_iter)operator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(recv)operator(;) - - ident(_block)operator(.)ident(flags) operator(&=) operator(~)ident(BLOCK_D_SCOPE)operator(;) - ident(BEGIN_CALLARGS)operator(;) - ident(recv) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_iter)operator(\);) - ident(END_CALLARGS)operator(;) - ident(ruby_current_node) operator(=) ident(node)operator(;) - ident(SET_CURRENT_SOURCE)operator((\);) - ident(result) operator(=) ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(recv)operator(\),)ident(recv)operator(,)ident(each)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(,)ident(self)operator(\);) - operator(}) - ident(POP_ITER)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(state) operator(==) ident(TAG_BREAK) operator(&&) ident(TAG_DST)operator((\)\)) operator({) - ident(result) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - ident(state) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(state) operator(==) ident(TAG_RETRY)operator(\)) operator({) - ident(state) operator(=) integer(0)operator(;) - reserved(goto) ident(iter_retry)operator(;) - operator(}) - ident(POP_BLOCK)operator((\);) - ident(POP_TAG)operator((\);) - reserved(switch) operator(()ident(state)operator(\)) operator({) - reserved(case) integer(0)operator(:) - reserved(break)operator(;) - reserved(default)operator(:) - ident(JUMP_TAG)operator(()ident(state)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_BREAK)operator(:) - ident(break_jump)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_stts)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_NEXT)operator(:) - ident(CHECK_INTS)operator(;) - ident(next_jump)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_stts)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_REDO)operator(:) - ident(CHECK_INTS)operator(;) - ident(JUMP_TAG)operator(()ident(TAG_REDO)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_RETRY)operator(:) - ident(CHECK_INTS)operator(;) - ident(JUMP_TAG)operator(()ident(TAG_RETRY)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_SPLAT)operator(:) - ident(result) operator(=) ident(splat_value)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_TO_ARY)operator(:) - ident(result) operator(=) ident(rb_ary_to_ary)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_SVALUE)operator(:) - ident(result) operator(=) ident(avalue_splat)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\)\);) - reserved(if) operator(()ident(result) operator(==) ident(Qundef)operator(\)) ident(result) operator(=) ident(Qnil)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_YIELD)operator(:) - reserved(if) operator(()ident(node)operator(->)ident(nd_head)operator(\)) operator({) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\);) - ident(ruby_current_node) operator(=) ident(node)operator(;) - operator(}) - reserved(else) operator({) - ident(result) operator(=) ident(Qundef)operator(;) comment(/* no arg */) - operator(}) - ident(SET_CURRENT_SOURCE)operator((\);) - ident(result) operator(=) ident(rb_yield_0)operator(()ident(result)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) ident(node)operator(->)ident(nd_state)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_RESCUE)operator(:) - operator({) - directive(volatile) ident(VALUE) ident(e_info) operator(=) ident(ruby_errinfo)operator(;) - directive(volatile) pre_type(int) ident(rescuing) operator(=) integer(0)operator(;) - - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - label(retry_entry:) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(rescuing)operator(\)) operator({) - reserved(if) operator(()ident(rescuing) operator(<) integer(0)operator(\)) operator({) - comment(/* in rescue argument, just reraise */) - operator(}) - reserved(else) reserved(if) operator(()ident(state) operator(==) ident(TAG_RETRY)operator(\)) operator({) - ident(rescuing) operator(=) ident(state) operator(=) integer(0)operator(;) - ident(ruby_errinfo) operator(=) ident(e_info)operator(;) - reserved(goto) ident(retry_entry)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(state) operator(!=) ident(TAG_RAISE)operator(\)) operator({) - ident(result) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(state) operator(==) ident(TAG_RAISE)operator(\)) operator({) - ident(NODE) operator(*)ident(resq) operator(=) ident(node)operator(->)ident(nd_resq)operator(;) - - ident(rescuing) operator(=) operator(-)integer(1)operator(;) - reserved(while) operator(()ident(resq)operator(\)) operator({) - ident(ruby_current_node) operator(=) ident(resq)operator(;) - reserved(if) operator(()ident(handle_rescue)operator(()ident(self)operator(,) ident(resq)operator(\)\)) operator({) - ident(state) operator(=) integer(0)operator(;) - ident(rescuing) operator(=) integer(1)operator(;) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(resq)operator(->)ident(nd_body)operator(\);) - reserved(break)operator(;) - operator(}) - ident(resq) operator(=) ident(resq)operator(->)ident(nd_head)operator(;) comment(/* next rescue */) - operator(}) - operator(}) - reserved(else) operator({) - ident(result) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state) operator(!=) ident(TAG_RAISE)operator(\)) ident(ruby_errinfo) operator(=) ident(e_info)operator(;) - reserved(if) operator(()ident(state)operator(\)) operator({) - ident(JUMP_TAG)operator(()ident(state)operator(\);) - operator(}) - comment(/* no exception raised */) - reserved(if) operator((!)ident(rescuing) operator(&&) operator(()ident(node) operator(=) ident(node)operator(->)ident(nd_else)operator(\)\)) operator({) comment(/* else clause given */) - reserved(goto) ident(again)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_ENSURE)operator(:) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(node)operator(->)ident(nd_ensr) operator(&&) operator(!)ident(thread_no_ensure)operator((\)\)) operator({) - ident(VALUE) ident(retval) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) comment(/* save retval */) - ident(VALUE) ident(errinfo) operator(=) ident(ruby_errinfo)operator(;) - - ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_ensr)operator(\);) - ident(return_value)operator(()ident(retval)operator(\);) - ident(ruby_errinfo) operator(=) ident(errinfo)operator(;) - operator(}) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_AND)operator(:) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_1st)operator(\);) - reserved(if) operator((!)ident(RTEST)operator(()ident(result)operator(\)\)) reserved(break)operator(;) - ident(node) operator(=) ident(node)operator(->)ident(nd_2nd)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(NODE_OR)operator(:) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_1st)operator(\);) - reserved(if) operator(()ident(RTEST)operator(()ident(result)operator(\)\)) reserved(break)operator(;) - ident(node) operator(=) ident(node)operator(->)ident(nd_2nd)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(NODE_NOT)operator(:) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_body)operator(\)\)\)) ident(result) operator(=) ident(Qfalse)operator(;) - reserved(else) ident(result) operator(=) ident(Qtrue)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_DOT2)operator(:) - reserved(case) ident(NODE_DOT3)operator(:) - operator({) - ident(VALUE) ident(beg) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_beg)operator(\);) - ident(VALUE) ident(end) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_end)operator(\);) - ident(result) operator(=) ident(rb_range_new)operator(()ident(beg)operator(,) ident(end)operator(,) ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_DOT3)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_FLIP2)operator(:) comment(/* like AWK */) - operator({) - ident(VALUE) operator(*)ident(flip) operator(=) ident(rb_svar)operator(()ident(node)operator(->)ident(nd_cnt)operator(\);) - reserved(if) operator((!)ident(flip)operator(\)) ident(rb_bug)operator(()stringoperator(\);) - reserved(if) operator((!)ident(RTEST)operator((*)ident(flip)operator(\)\)) operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_beg)operator(\)\)\)) operator({) - operator(*)ident(flip) operator(=) ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_end)operator(\)\)?)ident(Qfalse)operator(:)ident(Qtrue)operator(;) - ident(result) operator(=) ident(Qtrue)operator(;) - operator(}) - reserved(else) operator({) - ident(result) operator(=) ident(Qfalse)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_end)operator(\)\)\)) operator({) - operator(*)ident(flip) operator(=) ident(Qfalse)operator(;) - operator(}) - ident(result) operator(=) ident(Qtrue)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_FLIP3)operator(:) comment(/* like SED */) - operator({) - ident(VALUE) operator(*)ident(flip) operator(=) ident(rb_svar)operator(()ident(node)operator(->)ident(nd_cnt)operator(\);) - reserved(if) operator((!)ident(flip)operator(\)) ident(rb_bug)operator(()stringoperator(\);) - reserved(if) operator((!)ident(RTEST)operator((*)ident(flip)operator(\)\)) operator({) - ident(result) operator(=) ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_beg)operator(\)\)) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) - operator(*)ident(flip) operator(=) ident(result)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_end)operator(\)\)\)) operator({) - operator(*)ident(flip) operator(=) ident(Qfalse)operator(;) - operator(}) - ident(result) operator(=) ident(Qtrue)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_RETURN)operator(:) - ident(return_jump)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_stts)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_ARGSCAT)operator(:) - operator({) - ident(VALUE) ident(args) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\);) - ident(result) operator(=) ident(rb_ary_concat)operator(()ident(args)operator(,) ident(splat_value)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_body)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_ARGSPUSH)operator(:) - operator({) - ident(VALUE) ident(args) operator(=) ident(rb_ary_dup)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\)\);) - ident(result) operator(=) ident(rb_ary_push)operator(()ident(args)operator(,) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_body)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_ATTRASGN)operator(:) - operator({) - ident(VALUE) ident(recv)operator(;) - pre_type(int) ident(argc)operator(;) ident(VALUE) operator(*)ident(argv)operator(;) comment(/* used in SETUP_ARGS */) - pre_type(int) ident(scope)operator(;) - ident(TMP_PROTECT)operator(;) - - ident(BEGIN_CALLARGS)operator(;) - reserved(if) operator(()ident(node)operator(->)ident(nd_recv) operator(==) operator(()ident(NODE) operator(*\))integer(1)operator(\)) operator({) - ident(recv) operator(=) ident(self)operator(;) - ident(scope) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(recv) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_recv)operator(\);) - ident(scope) operator(=) integer(0)operator(;) - operator(}) - ident(SETUP_ARGS)operator(()ident(node)operator(->)ident(nd_args)operator(\);) - ident(END_CALLARGS)operator(;) - - ident(ruby_current_node) operator(=) ident(node)operator(;) - ident(SET_CURRENT_SOURCE)operator((\);) - ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(recv)operator(\),)ident(recv)operator(,)ident(node)operator(->)ident(nd_mid)operator(,)ident(argc)operator(,)ident(argv)operator(,)ident(scope)operator(,)ident(self)operator(\);) - ident(result) operator(=) ident(argv)operator([)ident(argc)operator(-)integer(1)operator(];) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_CALL)operator(:) - operator({) - ident(VALUE) ident(recv)operator(;) - pre_type(int) ident(argc)operator(;) ident(VALUE) operator(*)ident(argv)operator(;) comment(/* used in SETUP_ARGS */) - ident(TMP_PROTECT)operator(;) - - ident(BEGIN_CALLARGS)operator(;) - ident(recv) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_recv)operator(\);) - ident(SETUP_ARGS)operator(()ident(node)operator(->)ident(nd_args)operator(\);) - ident(END_CALLARGS)operator(;) - - ident(ruby_current_node) operator(=) ident(node)operator(;) - ident(SET_CURRENT_SOURCE)operator((\);) - ident(result) operator(=) ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(recv)operator(\),)ident(recv)operator(,)ident(node)operator(->)ident(nd_mid)operator(,)ident(argc)operator(,)ident(argv)operator(,)integer(0)operator(,)ident(self)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_FCALL)operator(:) - operator({) - pre_type(int) ident(argc)operator(;) ident(VALUE) operator(*)ident(argv)operator(;) comment(/* used in SETUP_ARGS */) - ident(TMP_PROTECT)operator(;) - - ident(BEGIN_CALLARGS)operator(;) - ident(SETUP_ARGS)operator(()ident(node)operator(->)ident(nd_args)operator(\);) - ident(END_CALLARGS)operator(;) - - ident(ruby_current_node) operator(=) ident(node)operator(;) - ident(SET_CURRENT_SOURCE)operator((\);) - ident(result) operator(=) ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(self)operator(\),)ident(self)operator(,)ident(node)operator(->)ident(nd_mid)operator(,)ident(argc)operator(,)ident(argv)operator(,)integer(1)operator(,)ident(self)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_VCALL)operator(:) - ident(SET_CURRENT_SOURCE)operator((\);) - ident(result) operator(=) ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(self)operator(\),)ident(self)operator(,)ident(node)operator(->)ident(nd_mid)operator(,)integer(0)operator(,)integer(0)operator(,)integer(2)operator(,)ident(self)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_SUPER)operator(:) - reserved(case) ident(NODE_ZSUPER)operator(:) - operator({) - pre_type(int) ident(argc)operator(;) ident(VALUE) operator(*)ident(argv)operator(;) comment(/* used in SETUP_ARGS */) - ident(TMP_PROTECT)operator(;) - - reserved(if) operator(()ident(ruby_frame)operator(->)ident(last_class) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(ruby_frame)operator(->)ident(last_func)operator(\)) operator({) - ident(rb_name_error)operator(()ident(ruby_frame)operator(->)ident(last_func)operator(,) - stringoperator(,) - ident(rb_id2name)operator(()ident(ruby_frame)operator(->)ident(orig_func)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eNoMethodError)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_ZSUPER)operator(\)) operator({) - ident(argc) operator(=) ident(ruby_frame)operator(->)ident(argc)operator(;) - reserved(if) operator(()ident(argc) operator(&&) ident(DMETHOD_P)operator((\)\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(RBASIC)operator(()ident(ruby_scope)operator(\)->)ident(klass)operator(\)) operator(!=) ident(T_ARRAY) operator(||) - ident(RARRAY)operator(()ident(RBASIC)operator(()ident(ruby_scope)operator(\)->)ident(klass)operator(\)->)ident(len) operator(!=) ident(argc)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) - stringoperator(\);) - operator(}) - ident(argv) operator(=) ident(RARRAY)operator(()ident(RBASIC)operator(()ident(ruby_scope)operator(\)->)ident(klass)operator(\)->)ident(ptr)operator(;) - operator(}) - reserved(else) reserved(if) operator((!)ident(ruby_scope)operator(->)ident(local_vars)operator(\)) operator({) - ident(argc) operator(=) integer(0)operator(;) - ident(argv) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(argv) operator(=) ident(ruby_scope)operator(->)ident(local_vars) operator(+) integer(2)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(BEGIN_CALLARGS)operator(;) - ident(SETUP_ARGS)operator(()ident(node)operator(->)ident(nd_args)operator(\);) - ident(END_CALLARGS)operator(;) - ident(ruby_current_node) operator(=) ident(node)operator(;) - operator(}) - - ident(SET_CURRENT_SOURCE)operator((\);) - ident(result) operator(=) ident(rb_call_super)operator(()ident(argc)operator(,) ident(argv)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_SCOPE)operator(:) - operator({) - reserved(struct) ident(FRAME) ident(frame)operator(;) - ident(NODE) operator(*)ident(saved_cref) operator(=) integer(0)operator(;) - - ident(frame) operator(=) operator(*)ident(ruby_frame)operator(;) - ident(frame)operator(.)ident(tmp) operator(=) ident(ruby_frame)operator(;) - ident(ruby_frame) operator(=) operator(&)ident(frame)operator(;) - - ident(PUSH_SCOPE)operator((\);) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator(()ident(node)operator(->)ident(nd_rval)operator(\)) operator({) - ident(saved_cref) operator(=) ident(ruby_cref)operator(;) - ident(ruby_cref) operator(=) operator(()ident(NODE)operator(*\))ident(node)operator(->)ident(nd_rval)operator(;) - operator(}) - reserved(if) operator(()ident(node)operator(->)ident(nd_tbl)operator(\)) operator({) - ident(VALUE) operator(*)ident(vars) operator(=) ident(ALLOCA_N)operator(()ident(VALUE)operator(,) ident(node)operator(->)ident(nd_tbl)operator([)integer(0)operator(]+)integer(1)operator(\);) - operator(*)ident(vars)operator(++) operator(=) operator(()ident(VALUE)operator(\))ident(node)operator(;) - ident(ruby_scope)operator(->)ident(local_vars) operator(=) ident(vars)operator(;) - ident(rb_mem_clear)operator(()ident(ruby_scope)operator(->)ident(local_vars)operator(,) ident(node)operator(->)ident(nd_tbl)operator([)integer(0)operator(]\);) - ident(ruby_scope)operator(->)ident(local_tbl) operator(=) ident(node)operator(->)ident(nd_tbl)operator(;) - operator(}) - reserved(else) operator({) - ident(ruby_scope)operator(->)ident(local_vars) operator(=) integer(0)operator(;) - ident(ruby_scope)operator(->)ident(local_tbl) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_next)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - ident(POP_SCOPE)operator((\);) - ident(ruby_frame) operator(=) ident(frame)operator(.)ident(tmp)operator(;) - reserved(if) operator(()ident(saved_cref)operator(\)) - ident(ruby_cref) operator(=) ident(saved_cref)operator(;) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_OP_ASGN1)operator(:) - operator({) - pre_type(int) ident(argc)operator(;) ident(VALUE) operator(*)ident(argv)operator(;) comment(/* used in SETUP_ARGS */) - ident(VALUE) ident(recv)operator(,) ident(val)operator(,) ident(tmp)operator(;) - ident(NODE) operator(*)ident(rval)operator(;) - ident(TMP_PROTECT)operator(;) - - ident(recv) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_recv)operator(\);) - ident(rval) operator(=) ident(node)operator(->)ident(nd_args)operator(->)ident(nd_head)operator(;) - ident(SETUP_ARGS0)operator(()ident(node)operator(->)ident(nd_args)operator(->)ident(nd_body)operator(,) integer(1)operator(\);) - ident(val) operator(=) ident(rb_funcall3)operator(()ident(recv)operator(,) ident(aref)operator(,) ident(argc)operator(,) ident(argv)operator(\);) - reserved(switch) operator(()ident(node)operator(->)ident(nd_mid)operator(\)) operator({) - reserved(case) integer(0)operator(:) comment(/* OR */) - reserved(if) operator(()ident(RTEST)operator(()ident(val)operator(\)\)) ident(RETURN)operator(()ident(val)operator(\);) - ident(val) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(rval)operator(\);) - reserved(break)operator(;) - reserved(case) integer(1)operator(:) comment(/* AND */) - reserved(if) operator((!)ident(RTEST)operator(()ident(val)operator(\)\)) ident(RETURN)operator(()ident(val)operator(\);) - ident(val) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(rval)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(tmp) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(rval)operator(\);) - ident(val) operator(=) ident(rb_funcall3)operator(()ident(val)operator(,) ident(node)operator(->)ident(nd_mid)operator(,) integer(1)operator(,) operator(&)ident(tmp)operator(\);) - operator(}) - ident(argv)operator([)ident(argc)operator(]) operator(=) ident(val)operator(;) - ident(rb_funcall2)operator(()ident(recv)operator(,) ident(aset)operator(,) ident(argc)operator(+)integer(1)operator(,) ident(argv)operator(\);) - ident(result) operator(=) ident(val)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_OP_ASGN2)operator(:) - operator({) - ident(ID) ident(id) operator(=) ident(node)operator(->)ident(nd_next)operator(->)ident(nd_vid)operator(;) - ident(VALUE) ident(recv)operator(,) ident(val)operator(,) ident(tmp)operator(;) - - ident(recv) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_recv)operator(\);) - ident(val) operator(=) ident(rb_funcall3)operator(()ident(recv)operator(,) ident(id)operator(,) integer(0)operator(,) integer(0)operator(\);) - reserved(switch) operator(()ident(node)operator(->)ident(nd_next)operator(->)ident(nd_mid)operator(\)) operator({) - reserved(case) integer(0)operator(:) comment(/* OR */) - reserved(if) operator(()ident(RTEST)operator(()ident(val)operator(\)\)) ident(RETURN)operator(()ident(val)operator(\);) - ident(val) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\);) - reserved(break)operator(;) - reserved(case) integer(1)operator(:) comment(/* AND */) - reserved(if) operator((!)ident(RTEST)operator(()ident(val)operator(\)\)) ident(RETURN)operator(()ident(val)operator(\);) - ident(val) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(tmp) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\);) - ident(val) operator(=) ident(rb_funcall3)operator(()ident(val)operator(,) ident(node)operator(->)ident(nd_next)operator(->)ident(nd_mid)operator(,) integer(1)operator(,) operator(&)ident(tmp)operator(\);) - operator(}) - - ident(rb_funcall2)operator(()ident(recv)operator(,) ident(node)operator(->)ident(nd_next)operator(->)ident(nd_aid)operator(,) integer(1)operator(,) operator(&)ident(val)operator(\);) - ident(result) operator(=) ident(val)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_OP_ASGN_AND)operator(:) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\);) - reserved(if) operator((!)ident(RTEST)operator(()ident(result)operator(\)\)) reserved(break)operator(;) - ident(node) operator(=) ident(node)operator(->)ident(nd_value)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(NODE_OP_ASGN_OR)operator(:) - reserved(if) operator((()ident(node)operator(->)ident(nd_aid) operator(&&) operator(!)ident(is_defined)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(,) integer(0)operator(\)\)) operator(||) - operator(!)ident(RTEST)operator(()ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\)\)\)) operator({) - ident(node) operator(=) ident(node)operator(->)ident(nd_value)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_MASGN)operator(:) - ident(result) operator(=) ident(massign)operator(()ident(self)operator(,) ident(node)operator(,) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\),) integer(0)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_LASGN)operator(:) - reserved(if) operator(()ident(ruby_scope)operator(->)ident(local_vars) operator(==) integer(0)operator(\)) - ident(rb_bug)operator(()stringoperator(\);) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\);) - ident(ruby_scope)operator(->)ident(local_vars)operator([)ident(node)operator(->)ident(nd_cnt)operator(]) operator(=) ident(result)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_DASGN)operator(:) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\);) - ident(dvar_asgn)operator(()ident(node)operator(->)ident(nd_vid)operator(,) ident(result)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_DASGN_CURR)operator(:) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\);) - ident(dvar_asgn_curr)operator(()ident(node)operator(->)ident(nd_vid)operator(,) ident(result)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_GASGN)operator(:) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\);) - ident(rb_gvar_set)operator(()ident(node)operator(->)ident(nd_entry)operator(,) ident(result)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_IASGN)operator(:) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\);) - ident(rb_ivar_set)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_vid)operator(,) ident(result)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_CDECL)operator(:) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\);) - reserved(if) operator(()ident(node)operator(->)ident(nd_vid) operator(==) integer(0)operator(\)) operator({) - ident(rb_const_set)operator(()ident(class_prefix)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_else)operator(\),) ident(node)operator(->)ident(nd_else)operator(->)ident(nd_mid)operator(,) ident(result)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_const_set)operator(()ident(ruby_cbase)operator(,) ident(node)operator(->)ident(nd_vid)operator(,) ident(result)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_CVDECL)operator(:) - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_cbase)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\);) - ident(rb_cvar_set)operator(()ident(cvar_cbase)operator((\),) ident(node)operator(->)ident(nd_vid)operator(,) ident(result)operator(,) ident(Qtrue)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_CVASGN)operator(:) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_value)operator(\);) - ident(rb_cvar_set)operator(()ident(cvar_cbase)operator((\),) ident(node)operator(->)ident(nd_vid)operator(,) ident(result)operator(,) ident(Qfalse)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_LVAR)operator(:) - reserved(if) operator(()ident(ruby_scope)operator(->)ident(local_vars) operator(==) integer(0)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(\);) - operator(}) - ident(result) operator(=) ident(ruby_scope)operator(->)ident(local_vars)operator([)ident(node)operator(->)ident(nd_cnt)operator(];) - reserved(break)operator(;) - - reserved(case) ident(NODE_DVAR)operator(:) - ident(result) operator(=) ident(rb_dvar_ref)operator(()ident(node)operator(->)ident(nd_vid)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_GVAR)operator(:) - ident(result) operator(=) ident(rb_gvar_get)operator(()ident(node)operator(->)ident(nd_entry)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_IVAR)operator(:) - ident(result) operator(=) ident(rb_ivar_get)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_vid)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_CONST)operator(:) - ident(result) operator(=) ident(ev_const_get)operator(()ident(ruby_cref)operator(,) ident(node)operator(->)ident(nd_vid)operator(,) ident(self)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_CVAR)operator(:) - ident(result) operator(=) ident(rb_cvar_get)operator(()ident(cvar_cbase)operator((\),) ident(node)operator(->)ident(nd_vid)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_BLOCK_ARG)operator(:) - reserved(if) operator(()ident(ruby_scope)operator(->)ident(local_vars) operator(==) integer(0)operator(\)) - ident(rb_bug)operator(()stringoperator(\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(result) operator(=) ident(rb_block_proc)operator((\);) - ident(ruby_scope)operator(->)ident(local_vars)operator([)ident(node)operator(->)ident(nd_cnt)operator(]) operator(=) ident(result)operator(;) - operator(}) - reserved(else) operator({) - ident(result) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_COLON2)operator(:) - operator({) - ident(VALUE) ident(klass)operator(;) - - ident(klass) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\);) - reserved(if) operator(()ident(rb_is_const_id)operator(()ident(node)operator(->)ident(nd_mid)operator(\)\)) operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(klass)operator(\)\)) operator({) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - ident(result) operator(=) ident(rb_const_get_from)operator(()ident(klass)operator(,) ident(node)operator(->)ident(nd_mid)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(RSTRING)operator(()ident(rb_obj_as_string)operator(()ident(klass)operator(\)\)->)ident(ptr)operator(\);) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(result) operator(=) ident(rb_funcall)operator(()ident(klass)operator(,) ident(node)operator(->)ident(nd_mid)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_COLON3)operator(:) - ident(result) operator(=) ident(rb_const_get_from)operator(()ident(rb_cObject)operator(,) ident(node)operator(->)ident(nd_mid)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_NTH_REF)operator(:) - ident(result) operator(=) ident(rb_reg_nth_match)operator(()ident(node)operator(->)ident(nd_nth)operator(,) ident(MATCH_DATA)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_BACK_REF)operator(:) - reserved(switch) operator(()ident(node)operator(->)ident(nd_nth)operator(\)) operator({) - reserved(case) char('&')operator(:) - ident(result) operator(=) ident(rb_reg_last_match)operator(()ident(MATCH_DATA)operator(\);) - reserved(break)operator(;) - reserved(case) char('`')operator(:) - ident(result) operator(=) ident(rb_reg_match_pre)operator(()ident(MATCH_DATA)operator(\);) - reserved(break)operator(;) - reserved(case) char('\\'')operator(:) - ident(result) operator(=) ident(rb_reg_match_post)operator(()ident(MATCH_DATA)operator(\);) - reserved(break)operator(;) - reserved(case) char('+')operator(:) - ident(result) operator(=) ident(rb_reg_match_last)operator(()ident(MATCH_DATA)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_bug)operator(()stringoperator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_HASH)operator(:) - operator({) - ident(NODE) operator(*)ident(list)operator(;) - ident(VALUE) ident(hash) operator(=) ident(rb_hash_new)operator((\);) - ident(VALUE) ident(key)operator(,) ident(val)operator(;) - - ident(list) operator(=) ident(node)operator(->)ident(nd_head)operator(;) - reserved(while) operator(()ident(list)operator(\)) operator({) - ident(key) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(list)operator(->)ident(nd_head)operator(\);) - ident(list) operator(=) ident(list)operator(->)ident(nd_next)operator(;) - reserved(if) operator(()ident(list) operator(==) integer(0)operator(\)) - ident(rb_bug)operator(()stringoperator(\);) - ident(val) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(list)operator(->)ident(nd_head)operator(\);) - ident(list) operator(=) ident(list)operator(->)ident(nd_next)operator(;) - ident(rb_hash_aset)operator(()ident(hash)operator(,) ident(key)operator(,) ident(val)operator(\);) - operator(}) - ident(result) operator(=) ident(hash)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_ZARRAY)operator(:) comment(/* zero length list */) - ident(result) operator(=) ident(rb_ary_new)operator((\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_ARRAY)operator(:) - operator({) - ident(VALUE) ident(ary)operator(;) - pre_type(long) ident(i)operator(;) - - ident(i) operator(=) ident(node)operator(->)ident(nd_alen)operator(;) - ident(ary) operator(=) ident(rb_ary_new2)operator(()ident(i)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;)ident(node)operator(;)ident(node)operator(=)ident(node)operator(->)ident(nd_next)operator(\)) operator({) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(++]) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(\);) - ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(=) ident(i)operator(;) - operator(}) - - ident(result) operator(=) ident(ary)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_STR)operator(:) - ident(result) operator(=) ident(rb_str_new3)operator(()ident(node)operator(->)ident(nd_lit)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_EVSTR)operator(:) - ident(result) operator(=) ident(rb_obj_as_string)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_body)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_DSTR)operator(:) - reserved(case) ident(NODE_DXSTR)operator(:) - reserved(case) ident(NODE_DREGX)operator(:) - reserved(case) ident(NODE_DREGX_ONCE)operator(:) - reserved(case) ident(NODE_DSYM)operator(:) - operator({) - ident(VALUE) ident(str)operator(,) ident(str2)operator(;) - ident(NODE) operator(*)ident(list) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - - ident(str) operator(=) ident(rb_str_new3)operator(()ident(node)operator(->)ident(nd_lit)operator(\);) - reserved(while) operator(()ident(list)operator(\)) operator({) - reserved(if) operator(()ident(list)operator(->)ident(nd_head)operator(\)) operator({) - reserved(switch) operator(()ident(nd_type)operator(()ident(list)operator(->)ident(nd_head)operator(\)\)) operator({) - reserved(case) ident(NODE_STR)operator(:) - ident(str2) operator(=) ident(list)operator(->)ident(nd_head)operator(->)ident(nd_lit)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(str2) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(list)operator(->)ident(nd_head)operator(\);) - reserved(break)operator(;) - operator(}) - ident(rb_str_append)operator(()ident(str)operator(,) ident(str2)operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(str2)operator(\);) - operator(}) - ident(list) operator(=) ident(list)operator(->)ident(nd_next)operator(;) - operator(}) - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_DREGX)operator(:) - ident(result) operator(=) ident(rb_reg_new)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) - ident(node)operator(->)ident(nd_cflag)operator(\);) - reserved(break)operator(;) - reserved(case) ident(NODE_DREGX_ONCE)operator(:) comment(/* regexp expand once */) - ident(result) operator(=) ident(rb_reg_new)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) - ident(node)operator(->)ident(nd_cflag)operator(\);) - ident(nd_set_type)operator(()ident(node)operator(,) ident(NODE_LIT)operator(\);) - ident(node)operator(->)ident(nd_lit) operator(=) ident(result)operator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_LIT)operator(:) - comment(/* other thread may replace NODE_DREGX_ONCE to NODE_LIT */) - reserved(goto) ident(again)operator(;) - reserved(case) ident(NODE_DXSTR)operator(:) - ident(result) operator(=) ident(rb_funcall)operator(()ident(self)operator(,) char('`')operator(,) integer(1)operator(,) ident(str)operator(\);) - reserved(break)operator(;) - reserved(case) ident(NODE_DSYM)operator(:) - ident(result) operator(=) ident(rb_str_intern)operator(()ident(str)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(result) operator(=) ident(str)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_XSTR)operator(:) - ident(result) operator(=) ident(rb_funcall)operator(()ident(self)operator(,) char('`')operator(,) integer(1)operator(,) ident(rb_str_new3)operator(()ident(node)operator(->)ident(nd_lit)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_LIT)operator(:) - ident(result) operator(=) ident(node)operator(->)ident(nd_lit)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_DEFN)operator(:) - reserved(if) operator(()ident(node)operator(->)ident(nd_defn)operator(\)) operator({) - ident(NODE) operator(*)ident(body)operator(,) operator(*)ident(defn)operator(;) - ident(VALUE) ident(origin)operator(;) - pre_type(int) ident(noex)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_class)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(ruby_class) operator(==) ident(rb_cObject) operator(&&) ident(node)operator(->)ident(nd_mid) operator(==) ident(init)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - reserved(if) operator(()ident(node)operator(->)ident(nd_mid) operator(==) ident(__id__) operator(||) ident(node)operator(->)ident(nd_mid) operator(==) ident(__send__)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) - ident(rb_id2name)operator(()ident(node)operator(->)ident(nd_mid)operator(\)\);) - operator(}) - ident(rb_frozen_class_p)operator(()ident(ruby_class)operator(\);) - ident(body) operator(=) ident(search_method)operator(()ident(ruby_class)operator(,) ident(node)operator(->)ident(nd_mid)operator(,) operator(&)ident(origin)operator(\);) - reserved(if) operator(()ident(body)operator(\){) - reserved(if) operator(()ident(RTEST)operator(()ident(ruby_verbose)operator(\)) operator(&&) ident(ruby_class) operator(==) ident(origin) operator(&&) ident(body)operator(->)ident(nd_cnt) operator(==) integer(0) operator(&&) ident(body)operator(->)ident(nd_body)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(node)operator(->)ident(nd_mid)operator(\)\);) - operator(}) - operator(}) - - reserved(if) operator(()ident(SCOPE_TEST)operator(()ident(SCOPE_PRIVATE)operator(\)) operator(||) ident(node)operator(->)ident(nd_mid) operator(==) ident(init)operator(\)) operator({) - ident(noex) operator(=) ident(NOEX_PRIVATE)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(SCOPE_TEST)operator(()ident(SCOPE_PROTECTED)operator(\)\)) operator({) - ident(noex) operator(=) ident(NOEX_PROTECTED)operator(;) - operator(}) - reserved(else) operator({) - ident(noex) operator(=) ident(NOEX_PUBLIC)operator(;) - operator(}) - reserved(if) operator(()ident(body) operator(&&) ident(origin) operator(==) ident(ruby_class) operator(&&) ident(body)operator(->)ident(nd_body) operator(==) integer(0)operator(\)) operator({) - ident(noex) operator(|=) ident(NOEX_NOSUPER)operator(;) - operator(}) - - ident(defn) operator(=) ident(rb_copy_node_scope)operator(()ident(node)operator(->)ident(nd_defn)operator(,) ident(ruby_cref)operator(\);) - ident(rb_add_method)operator(()ident(ruby_class)operator(,) ident(node)operator(->)ident(nd_mid)operator(,) ident(defn)operator(,) ident(noex)operator(\);) - reserved(if) operator(()ident(scope_vmode) operator(==) ident(SCOPE_MODFUNC)operator(\)) operator({) - ident(rb_add_method)operator(()ident(rb_singleton_class)operator(()ident(ruby_class)operator(\),) - ident(node)operator(->)ident(nd_mid)operator(,) ident(defn)operator(,) ident(NOEX_PUBLIC)operator(\);) - operator(}) - ident(result) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_DEFS)operator(:) - reserved(if) operator(()ident(node)operator(->)ident(nd_defn)operator(\)) operator({) - ident(VALUE) ident(recv) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_recv)operator(\);) - ident(VALUE) ident(klass)operator(;) - ident(NODE) operator(*)ident(body) operator(=) integer(0)operator(,) operator(*)ident(defn)operator(;) - - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4) operator(&&) operator(!)ident(OBJ_TAINTED)operator(()ident(recv)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(recv)operator(\)) operator(||) ident(SYMBOL_P)operator(()ident(recv)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) - stringoperator(,) - ident(rb_id2name)operator(()ident(node)operator(->)ident(nd_mid)operator(\),) - ident(rb_obj_classname)operator(()ident(recv)operator(\)\);) - operator(}) - - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(recv)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - ident(klass) operator(=) ident(rb_singleton_class)operator(()ident(recv)operator(\);) - reserved(if) operator(()ident(st_lookup)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(,) ident(node)operator(->)ident(nd_mid)operator(,) operator(&)ident(data)operator(\)\)) operator({) - ident(body) operator(=) operator(()ident(NODE) operator(*\))ident(data)operator(;) - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(RTEST)operator(()ident(ruby_verbose)operator(\)\)) operator({) - ident(rb_warning)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(node)operator(->)ident(nd_mid)operator(\)\);) - operator(}) - operator(}) - ident(defn) operator(=) ident(rb_copy_node_scope)operator(()ident(node)operator(->)ident(nd_defn)operator(,) ident(ruby_cref)operator(\);) - ident(rb_add_method)operator(()ident(klass)operator(,) ident(node)operator(->)ident(nd_mid)operator(,) ident(defn)operator(,) - ident(NOEX_PUBLIC)operator(|()ident(body)operator(?)ident(body)operator(->)ident(nd_noex)operator(&)ident(NOEX_UNDEF)operator(:)integer(0)operator(\)\);) - ident(result) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_UNDEF)operator(:) - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_class)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(rb_undef)operator(()ident(ruby_class)operator(,) ident(rb_to_id)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(u2)operator(.)ident(node)operator(\)\)\);) - ident(result) operator(=) ident(Qnil)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_ALIAS)operator(:) - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_class)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(rb_alias)operator(()ident(ruby_class)operator(,) ident(rb_to_id)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(u1)operator(.)ident(node)operator(\)\),) - ident(rb_to_id)operator(()ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(u2)operator(.)ident(node)operator(\)\)\);) - ident(result) operator(=) ident(Qnil)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_VALIAS)operator(:) - ident(rb_alias_variable)operator(()ident(node)operator(->)ident(u1)operator(.)ident(id)operator(,) ident(node)operator(->)ident(u2)operator(.)ident(id)operator(\);) - ident(result) operator(=) ident(Qnil)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_CLASS)operator(:) - operator({) - ident(VALUE) ident(super)operator(,) ident(klass)operator(,) ident(tmp)operator(,) ident(cbase)operator(;) - ident(ID) ident(cname)operator(;) - pre_type(int) ident(gen) operator(=) ident(Qfalse)operator(;) - - ident(cbase) operator(=) ident(class_prefix)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_cpath)operator(\);) - ident(cname) operator(=) ident(node)operator(->)ident(nd_cpath)operator(->)ident(nd_mid)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_cbase)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(node)operator(->)ident(nd_super)operator(\)) operator({) - ident(super) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_super)operator(\);) - ident(rb_check_inheritable)operator(()ident(super)operator(\);) - operator(}) - reserved(else) operator({) - ident(super) operator(=) integer(0)operator(;) - operator(}) - - reserved(if) operator(()ident(rb_const_defined_at)operator(()ident(cbase)operator(,) ident(cname)operator(\)\)) operator({) - ident(klass) operator(=) ident(rb_const_get_at)operator(()ident(cbase)operator(,) ident(cname)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(klass)operator(\)) operator(!=) ident(T_CLASS)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(cname)operator(\)\);) - operator(}) - reserved(if) operator(()ident(super)operator(\)) operator({) - ident(tmp) operator(=) ident(rb_class_real)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(\);) - reserved(if) operator(()ident(tmp) operator(!=) ident(super)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(cname)operator(\)\);) - operator(}) - ident(super) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator((!)ident(super)operator(\)) ident(super) operator(=) ident(rb_cObject)operator(;) - ident(klass) operator(=) ident(rb_define_class_id)operator(()ident(cname)operator(,) ident(super)operator(\);) - ident(rb_set_class_path)operator(()ident(klass)operator(,) ident(cbase)operator(,) ident(rb_id2name)operator(()ident(cname)operator(\)\);) - ident(rb_const_set)operator(()ident(cbase)operator(,) ident(cname)operator(,) ident(klass)operator(\);) - ident(gen) operator(=) ident(Qtrue)operator(;) - operator(}) - reserved(if) operator(()ident(ruby_wrapper)operator(\)) operator({) - ident(rb_extend_object)operator(()ident(klass)operator(,) ident(ruby_wrapper)operator(\);) - ident(rb_include_module)operator(()ident(klass)operator(,) ident(ruby_wrapper)operator(\);) - operator(}) - reserved(if) operator(()ident(super) operator(&&) ident(gen)operator(\)) operator({) - ident(rb_class_inherited)operator(()ident(super)operator(,) ident(klass)operator(\);) - operator(}) - ident(result) operator(=) ident(module_setup)operator(()ident(klass)operator(,) ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_MODULE)operator(:) - operator({) - ident(VALUE) ident(module)operator(,) ident(cbase)operator(;) - ident(ID) ident(cname)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_cbase)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(cbase) operator(=) ident(class_prefix)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_cpath)operator(\);) - ident(cname) operator(=) ident(node)operator(->)ident(nd_cpath)operator(->)ident(nd_mid)operator(;) - reserved(if) operator(()ident(rb_const_defined_at)operator(()ident(cbase)operator(,) ident(cname)operator(\)\)) operator({) - ident(module) operator(=) ident(rb_const_get_at)operator(()ident(cbase)operator(,) ident(cname)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(module)operator(\)) operator(!=) ident(T_MODULE)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(cname)operator(\)\);) - operator(}) - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(module) operator(=) ident(rb_define_module_id)operator(()ident(cname)operator(\);) - ident(rb_set_class_path)operator(()ident(module)operator(,) ident(cbase)operator(,) ident(rb_id2name)operator(()ident(cname)operator(\)\);) - ident(rb_const_set)operator(()ident(cbase)operator(,) ident(cname)operator(,) ident(module)operator(\);) - operator(}) - reserved(if) operator(()ident(ruby_wrapper)operator(\)) operator({) - ident(rb_extend_object)operator(()ident(module)operator(,) ident(ruby_wrapper)operator(\);) - ident(rb_include_module)operator(()ident(module)operator(,) ident(ruby_wrapper)operator(\);) - operator(}) - - ident(result) operator(=) ident(module_setup)operator(()ident(module)operator(,) ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_SCLASS)operator(:) - operator({) - ident(VALUE) ident(klass)operator(;) - - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_recv)operator(\);) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(result)operator(\)) operator(||) ident(SYMBOL_P)operator(()ident(result)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(result)operator(\)\);) - operator(}) - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4) operator(&&) operator(!)ident(OBJ_TAINTED)operator(()ident(result)operator(\)\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - ident(klass) operator(=) ident(rb_singleton_class)operator(()ident(result)operator(\);) - - reserved(if) operator(()ident(ruby_wrapper)operator(\)) operator({) - ident(rb_extend_object)operator(()ident(klass)operator(,) ident(ruby_wrapper)operator(\);) - ident(rb_include_module)operator(()ident(klass)operator(,) ident(ruby_wrapper)operator(\);) - operator(}) - - ident(result) operator(=) ident(module_setup)operator(()ident(klass)operator(,) ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_DEFINED)operator(:) - operator({) - pre_type(char) ident(buf)operator([)integer(20)operator(];) - pre_type(char) operator(*)ident(desc) operator(=) ident(is_defined)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_head)operator(,) ident(buf)operator(\);) - - reserved(if) operator(()ident(desc)operator(\)) ident(result) operator(=) ident(rb_str_new2)operator(()ident(desc)operator(\);) - reserved(else) ident(result) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_NEWLINE)operator(:) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_LINE)operator(,) ident(node)operator(,) ident(self)operator(,) - ident(ruby_frame)operator(->)ident(last_func)operator(,) - ident(ruby_frame)operator(->)ident(last_class)operator(\);) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(default)operator(:) - ident(unknown_node)operator(()ident(node)operator(\);) - operator(}) - label(finish:) - ident(CHECK_INTS)operator(;) - reserved(if) operator(()ident(contnode)operator(\)) operator({) - ident(node) operator(=) ident(contnode)operator(;) - ident(contnode) operator(=) integer(0)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(module_setup)operator(()ident(module)operator(,) ident(n)operator(\)) - ident(VALUE) ident(module)operator(;) - ident(NODE) operator(*)ident(n)operator(;) -operator({) - ident(NODE) operator(*) directive(volatile) ident(node) operator(=) ident(n)operator(->)ident(nd_body)operator(;) - pre_type(int) ident(state)operator(;) - reserved(struct) ident(FRAME) ident(frame)operator(;) - ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) comment(/* OK */) - ident(TMP_PROTECT)operator(;) - - ident(frame) operator(=) operator(*)ident(ruby_frame)operator(;) - ident(frame)operator(.)ident(tmp) operator(=) ident(ruby_frame)operator(;) - ident(ruby_frame) operator(=) operator(&)ident(frame)operator(;) - - ident(PUSH_CLASS)operator(()ident(module)operator(\);) - ident(PUSH_SCOPE)operator((\);) - ident(PUSH_VARS)operator((\);) - - reserved(if) operator(()ident(node)operator(->)ident(nd_tbl)operator(\)) operator({) - ident(VALUE) operator(*)ident(vars) operator(=) ident(TMP_ALLOC)operator(()ident(node)operator(->)ident(nd_tbl)operator([)integer(0)operator(]+)integer(1)operator(\);) - operator(*)ident(vars)operator(++) operator(=) operator(()ident(VALUE)operator(\))ident(node)operator(;) - ident(ruby_scope)operator(->)ident(local_vars) operator(=) ident(vars)operator(;) - ident(rb_mem_clear)operator(()ident(ruby_scope)operator(->)ident(local_vars)operator(,) ident(node)operator(->)ident(nd_tbl)operator([)integer(0)operator(]\);) - ident(ruby_scope)operator(->)ident(local_tbl) operator(=) ident(node)operator(->)ident(nd_tbl)operator(;) - operator(}) - reserved(else) operator({) - ident(ruby_scope)operator(->)ident(local_vars) operator(=) integer(0)operator(;) - ident(ruby_scope)operator(->)ident(local_tbl) operator(=) integer(0)operator(;) - operator(}) - - ident(PUSH_CREF)operator(()ident(module)operator(\);) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_CLASS)operator(,) ident(n)operator(,) ident(ruby_cbase)operator(,) - ident(ruby_frame)operator(->)ident(last_func)operator(,) ident(ruby_frame)operator(->)ident(last_class)operator(\);) - ident(result) operator(=) ident(rb_eval)operator(()ident(ruby_cbase)operator(,) ident(node)operator(->)ident(nd_next)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - ident(POP_CREF)operator((\);) - ident(POP_VARS)operator((\);) - ident(POP_SCOPE)operator((\);) - ident(POP_CLASS)operator((\);) - - ident(ruby_frame) operator(=) ident(frame)operator(.)ident(tmp)operator(;) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_END)operator(,) ident(n)operator(,) integer(0)operator(,) - ident(ruby_frame)operator(->)ident(last_func)operator(,) ident(ruby_frame)operator(->)ident(last_class)operator(\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) ident(NODE) operator(*)ident(basic_respond_to) operator(=) integer(0)operator(;) - -pre_type(int) -ident(rb_obj_respond_to)operator(()ident(obj)operator(,) ident(id)operator(,) ident(priv)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) - pre_type(int) ident(priv)operator(;) -operator({) - ident(VALUE) ident(klass) operator(=) ident(CLASS_OF)operator(()ident(obj)operator(\);) - - reserved(if) operator(()ident(rb_method_node)operator(()ident(klass)operator(,) ident(respond_to)operator(\)) operator(==) ident(basic_respond_to)operator(\)) operator({) - reserved(return) ident(rb_method_boundp)operator(()ident(klass)operator(,) ident(id)operator(,) operator(!)ident(priv)operator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(args)operator([)integer(2)operator(];) - pre_type(int) ident(n) operator(=) integer(0)operator(;) - ident(args)operator([)ident(n)operator(++]) operator(=) ident(ID2SYM)operator(()ident(id)operator(\);) - reserved(if) operator(()ident(priv)operator(\)) ident(args)operator([)ident(n)operator(++]) operator(=) ident(Qtrue)operator(;) - reserved(return) ident(RTEST)operator(()ident(rb_funcall2)operator(()ident(obj)operator(,) ident(respond_to)operator(,) ident(n)operator(,) ident(args)operator(\)\);) - operator(}) -operator(}) - -pre_type(int) -ident(rb_respond_to)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(return) ident(rb_obj_respond_to)operator(()ident(obj)operator(,) ident(id)operator(,) ident(Qfalse)operator(\);) -operator(}) - -comment(/* - * call-seq: - * obj.respond_to?(symbol, include_private=false\) => true or false - * - * Returns +true+> if _obj_ responds to the given - * method. Private methods are included in the search only if the - * optional second parameter evaluates to +true+. - */) - -directive(static) ident(VALUE) -ident(obj_respond_to)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(mid)operator(,) ident(priv)operator(;) - ident(ID) ident(id)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(mid)operator(,) operator(&)ident(priv)operator(\);) - ident(id) operator(=) ident(rb_to_id)operator(()ident(mid)operator(\);) - reserved(if) operator(()ident(rb_method_boundp)operator(()ident(CLASS_OF)operator(()ident(obj)operator(\),) ident(id)operator(,) operator(!)ident(RTEST)operator(()ident(priv)operator(\)\)\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.method_defined?(symbol\) => true or false - * - * Returns +true+ if the named method is defined by - * _mod_ (or its included modules and, if _mod_ is a class, - * its ancestors\). Public and protected methods are matched. - * - * module A - * def method1(\) end - * end - * class B - * def method2(\) end - * end - * class C < B - * include A - * def method3(\) end - * end - * - * A.method_defined? :method1 #=> true - * C.method_defined? "method1" #=> true - * C.method_defined? "method2" #=> true - * C.method_defined? "method3" #=> true - * C.method_defined? "method4" #=> false - */) - -directive(static) ident(VALUE) -ident(rb_mod_method_defined)operator(()ident(mod)operator(,) ident(mid)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(mid)operator(;) -operator({) - reserved(return) ident(rb_method_boundp)operator(()ident(mod)operator(,) ident(rb_to_id)operator(()ident(mid)operator(\),) integer(1)operator(\);) -operator(}) - -preprocessor(#define) ident(VISI_CHECK)operator(()ident(x)operator(,)ident(f)operator(\)) operator(((()ident(x)operator(\)&)ident(NOEX_MASK)operator(\)) operator(==) operator(()ident(f)operator(\)\)) - -comment(/* - * call-seq: - * mod.public_method_defined?(symbol\) => true or false - * - * Returns +true+ if the named public method is defined by - * _mod_ (or its included modules and, if _mod_ is a class, - * its ancestors\). - * - * module A - * def method1(\) end - * end - * class B - * protected - * def method2(\) end - * end - * class C < B - * include A - * def method3(\) end - * end - * - * A.method_defined? :method1 #=> true - * C.public_method_defined? "method1" #=> true - * C.public_method_defined? "method2" #=> false - * C.method_defined? "method2" #=> true - */) - -directive(static) ident(VALUE) -ident(rb_mod_public_method_defined)operator(()ident(mod)operator(,) ident(mid)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(mid)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(mid)operator(\);) - pre_type(int) ident(noex)operator(;) - - reserved(if) operator(()ident(rb_get_method_body)operator((&)ident(mod)operator(,) operator(&)ident(id)operator(,) operator(&)ident(noex)operator(\)\)) operator({) - reserved(if) operator(()ident(VISI_CHECK)operator(()ident(noex)operator(,) ident(NOEX_PUBLIC)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.private_method_defined?(symbol\) => true or false - * - * Returns +true+ if the named private method is defined by - * _ mod_ (or its included modules and, if _mod_ is a class, - * its ancestors\). - * - * module A - * def method1(\) end - * end - * class B - * private - * def method2(\) end - * end - * class C < B - * include A - * def method3(\) end - * end - * - * A.method_defined? :method1 #=> true - * C.private_method_defined? "method1" #=> false - * C.private_method_defined? "method2" #=> true - * C.method_defined? "method2" #=> false - */) - -directive(static) ident(VALUE) -ident(rb_mod_private_method_defined)operator(()ident(mod)operator(,) ident(mid)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(mid)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(mid)operator(\);) - pre_type(int) ident(noex)operator(;) - - reserved(if) operator(()ident(rb_get_method_body)operator((&)ident(mod)operator(,) operator(&)ident(id)operator(,) operator(&)ident(noex)operator(\)\)) operator({) - reserved(if) operator(()ident(VISI_CHECK)operator(()ident(noex)operator(,) ident(NOEX_PRIVATE)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.protected_method_defined?(symbol\) => true or false - * - * Returns +true+ if the named protected method is defined - * by _mod_ (or its included modules and, if _mod_ is a - * class, its ancestors\). - * - * module A - * def method1(\) end - * end - * class B - * protected - * def method2(\) end - * end - * class C < B - * include A - * def method3(\) end - * end - * - * A.method_defined? :method1 #=> true - * C.protected_method_defined? "method1" #=> false - * C.protected_method_defined? "method2" #=> true - * C.method_defined? "method2" #=> true - */) - -directive(static) ident(VALUE) -ident(rb_mod_protected_method_defined)operator(()ident(mod)operator(,) ident(mid)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(mid)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(mid)operator(\);) - pre_type(int) ident(noex)operator(;) - - reserved(if) operator(()ident(rb_get_method_body)operator((&)ident(mod)operator(,) operator(&)ident(id)operator(,) operator(&)ident(noex)operator(\)\)) operator({) - reserved(if) operator(()ident(VISI_CHECK)operator(()ident(noex)operator(,) ident(NOEX_PROTECTED)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -ident(NORETURN)operator(()directive(static) ident(VALUE) ident(terminate_process) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(\)\)\);) -directive(static) ident(VALUE) -ident(terminate_process)operator(()ident(status)operator(,) ident(mesg)operator(\)) - pre_type(int) ident(status)operator(;) - ident(VALUE) ident(mesg)operator(;) -operator({) - ident(VALUE) ident(args)operator([)integer(2)operator(];) - ident(args)operator([)integer(0)operator(]) operator(=) ident(INT2NUM)operator(()ident(status)operator(\);) - ident(args)operator([)integer(1)operator(]) operator(=) ident(mesg)operator(;) - - ident(rb_exc_raise)operator(()ident(rb_class_new_instance)operator(()integer(2)operator(,) ident(args)operator(,) ident(rb_eSystemExit)operator(\)\);) -operator(}) - -directive(void) -ident(rb_exit)operator(()ident(status)operator(\)) - pre_type(int) ident(status)operator(;) -operator({) - reserved(if) operator(()ident(prot_tag)operator(\)) operator({) - ident(terminate_process)operator(()ident(status)operator(,) ident(rb_str_new)operator(()stringoperator(,) integer(4)operator(\)\);) - operator(}) - ident(ruby_finalize)operator((\);) - ident(exit)operator(()ident(status)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * exit(integer=0\) - * Kernel::exit(integer=0\) - * Process::exit(integer=0\) - * - * Initiates the termination of the Ruby script by raising the - * SystemExit exception. This exception may be caught. The - * optional parameter is used to return a status code to the invoking - * environment. - * - * begin - * exit - * puts "never get here" - * rescue SystemExit - * puts "rescued a SystemExit exception" - * end - * puts "after begin block" - * - * produces: - * - * rescued a SystemExit exception - * after begin block - * - * Just prior to termination, Ruby executes any at_exit functions - * (see Kernel::at_exit\) and runs any object finalizers (see - * ObjectSpace::define_finalizer\). - * - * at_exit { puts "at_exit function" } - * ObjectSpace.define_finalizer("string", proc { puts "in finalizer" }\) - * exit - * - * produces: - * - * at_exit function - * in finalizer - */) - -ident(VALUE) -ident(rb_f_exit)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(status)operator(;) - pre_type(int) ident(istatus)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(status)operator(\)) operator(==) integer(1)operator(\)) operator({) - reserved(switch) operator(()ident(status)operator(\)) operator({) - reserved(case) ident(Qtrue)operator(:) - ident(istatus) operator(=) ident(EXIT_SUCCESS)operator(;) - reserved(break)operator(;) - reserved(case) ident(Qfalse)operator(:) - ident(istatus) operator(=) ident(EXIT_FAILURE)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(istatus) operator(=) ident(NUM2INT)operator(()ident(status)operator(\);) -preprocessor(#if) ident(EXIT_SUCCESS) operator(!=) integer(0) - reserved(if) operator(()ident(istatus) operator(==) integer(0)operator(\)) ident(istatus) operator(=) ident(EXIT_SUCCESS)operator(;) -preprocessor(#endif) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(istatus) operator(=) ident(EXIT_SUCCESS)operator(;) - operator(}) - ident(rb_exit)operator(()ident(istatus)operator(\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - - -comment(/* - * call-seq: - * abort - * Kernel::abort - * Process::abort - * - * Terminate execution immediately, effectively by calling - * Kernel.exit(1\). If _msg_ is given, it is written - * to STDERR prior to terminating. - */) - -ident(VALUE) -ident(rb_f_abort)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(ruby_errinfo)operator(\)\)) operator({) - ident(error_print)operator((\);) - operator(}) - ident(rb_exit)operator(()ident(EXIT_FAILURE)operator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(mesg)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(mesg)operator(\);) - ident(StringValue)operator(()ident(mesg)operator(\);) - ident(rb_io_puts)operator(()integer(1)operator(,) operator(&)ident(mesg)operator(,) ident(rb_stderr)operator(\);) - ident(terminate_process)operator(()ident(EXIT_FAILURE)operator(,) ident(mesg)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -directive(void) -ident(rb_iter_break)operator((\)) -operator({) - ident(break_jump)operator(()ident(Qnil)operator(\);) -operator(}) - -ident(NORETURN)operator(()directive(static) directive(void) ident(rb_longjmp) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(\)\)\);) -directive(static) ident(VALUE) ident(make_backtrace) ident(_)operator((()directive(void)operator(\)\);) - -directive(static) directive(void) -ident(rb_longjmp)operator(()ident(tag)operator(,) ident(mesg)operator(\)) - pre_type(int) ident(tag)operator(;) - ident(VALUE) ident(mesg)operator(;) -operator({) - ident(VALUE) ident(at)operator(;) - ident(rb_thread_t) ident(th) operator(=) ident(curr_thread)operator(;) - - reserved(if) operator(()ident(rb_thread_set_raised)operator(()ident(th)operator(\)\)) operator({) - ident(ruby_errinfo) operator(=) ident(exception_error)operator(;) - ident(JUMP_TAG)operator(()ident(TAG_FATAL)operator(\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(mesg)operator(\)\)) ident(mesg) operator(=) ident(ruby_errinfo)operator(;) - reserved(if) operator(()ident(NIL_P)operator(()ident(mesg)operator(\)\)) operator({) - ident(mesg) operator(=) ident(rb_exc_new)operator(()ident(rb_eRuntimeError)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - - ident(ruby_set_current_source)operator((\);) - reserved(if) operator(()ident(ruby_sourcefile) operator(&&) operator(!)ident(NIL_P)operator(()ident(mesg)operator(\)\)) operator({) - ident(at) operator(=) ident(get_backtrace)operator(()ident(mesg)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(at)operator(\)\)) operator({) - ident(at) operator(=) ident(make_backtrace)operator((\);) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(mesg)operator(\)\)) operator({) - ident(mesg) operator(=) ident(rb_obj_dup)operator(()ident(mesg)operator(\);) - operator(}) - ident(set_backtrace)operator(()ident(mesg)operator(,) ident(at)operator(\);) - operator(}) - operator(}) - reserved(if) operator((!)ident(NIL_P)operator(()ident(mesg)operator(\)\)) operator({) - ident(ruby_errinfo) operator(=) ident(mesg)operator(;) - operator(}) - - reserved(if) operator(()ident(RTEST)operator(()ident(ruby_debug)operator(\)) operator(&&) operator(!)ident(NIL_P)operator(()ident(ruby_errinfo)operator(\)) - operator(&&) operator(!)ident(rb_obj_is_kind_of)operator(()ident(ruby_errinfo)operator(,) ident(rb_eSystemExit)operator(\)\)) operator({) - ident(VALUE) ident(e) operator(=) ident(ruby_errinfo)operator(;) - pre_type(int) ident(status)operator(;) - - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(status) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(StringValue)operator(()ident(e)operator(\);) - ident(warn_printf)operator(()stringoperator(,) - ident(rb_obj_classname)operator(()ident(ruby_errinfo)operator(\),) - ident(ruby_sourcefile)operator(,) ident(ruby_sourceline)operator(,) - ident(RSTRING)operator(()ident(e)operator(\)->)ident(ptr)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(status) operator(==) ident(TAG_FATAL) operator(&&) ident(ruby_errinfo) operator(==) ident(exception_error)operator(\)) operator({) - ident(ruby_errinfo) operator(=) ident(mesg)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(status)operator(\)) operator({) - ident(rb_thread_reset_raised)operator(()ident(th)operator(\);) - ident(JUMP_TAG)operator(()ident(status)operator(\);) - operator(}) - operator(}) - - ident(rb_trap_restore_mask)operator((\);) - reserved(if) operator(()ident(tag) operator(!=) ident(TAG_FATAL)operator(\)) operator({) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_RAISE)operator(,) ident(ruby_current_node)operator(,) - ident(ruby_frame)operator(->)ident(self)operator(,) - ident(ruby_frame)operator(->)ident(last_func)operator(,) - ident(ruby_frame)operator(->)ident(last_class)operator(\);) - operator(}) - reserved(if) operator((!)ident(prot_tag)operator(\)) operator({) - ident(error_print)operator((\);) - operator(}) - ident(rb_thread_raised_clear)operator(()ident(th)operator(\);) - ident(JUMP_TAG)operator(()ident(tag)operator(\);) -operator(}) - -directive(void) -ident(rb_exc_jump)operator(()ident(mesg)operator(\)) - ident(VALUE) ident(mesg)operator(;) -operator({) - ident(rb_thread_raised_clear)operator(()ident(rb_curr_thread)operator(\);) - ident(ruby_errinfo) operator(=) ident(mesg)operator(;) - ident(JUMP_TAG)operator(()ident(TAG_RAISE)operator(\);) -operator(}) - -directive(void) -ident(rb_exc_raise)operator(()ident(mesg)operator(\)) - ident(VALUE) ident(mesg)operator(;) -operator({) - ident(rb_longjmp)operator(()ident(TAG_RAISE)operator(,) ident(mesg)operator(\);) -operator(}) - -directive(void) -ident(rb_exc_fatal)operator(()ident(mesg)operator(\)) - ident(VALUE) ident(mesg)operator(;) -operator({) - ident(rb_longjmp)operator(()ident(TAG_FATAL)operator(,) ident(mesg)operator(\);) -operator(}) - -directive(void) -ident(rb_interrupt)operator((\)) -operator({) - ident(rb_raise)operator(()ident(rb_eInterrupt)operator(,) stringoperator(\);) -operator(}) - -comment(/* - * call-seq: - * raise - * raise(string\) - * raise(exception [, string [, array]]\) - * fail - * fail(string\) - * fail(exception [, string [, array]]\) - * - * With no arguments, raises the exception in $! or raises - * a RuntimeError if $! is +nil+. - * With a single +String+ argument, raises a - * +RuntimeError+ with the string as a message. Otherwise, - * the first parameter should be the name of an +Exception+ - * class (or an object that returns an +Exception+ object when sent - * an +exception+ message\). The optional second parameter sets the - * message associated with the exception, and the third parameter is an - * array of callback information. Exceptions are caught by the - * +rescue+ clause of begin...end blocks. - * - * raise "Failed to create socket" - * raise ArgumentError, "No parameters", caller - */) - -directive(static) ident(VALUE) -ident(rb_f_raise)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(rb_raise_jump)operator(()ident(rb_make_exception)operator(()ident(argc)operator(,) ident(argv)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -directive(static) ident(VALUE) -ident(rb_make_exception)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(mesg)operator(;) - ident(ID) ident(exception)operator(;) - pre_type(int) ident(n)operator(;) - - ident(mesg) operator(=) ident(Qnil)operator(;) - reserved(switch) operator(()ident(argc)operator(\)) operator({) - reserved(case) integer(0)operator(:) - ident(mesg) operator(=) ident(Qnil)operator(;) - reserved(break)operator(;) - reserved(case) integer(1)operator(:) - reserved(if) operator(()ident(NIL_P)operator(()ident(argv)operator([)integer(0)operator(]\)\)) reserved(break)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(==) ident(T_STRING)operator(\)) operator({) - ident(mesg) operator(=) ident(rb_exc_new3)operator(()ident(rb_eRuntimeError)operator(,) ident(argv)operator([)integer(0)operator(]\);) - reserved(break)operator(;) - operator(}) - ident(n) operator(=) integer(0)operator(;) - reserved(goto) ident(exception_call)operator(;) - - reserved(case) integer(2)operator(:) - reserved(case) integer(3)operator(:) - ident(n) operator(=) integer(1)operator(;) - label(exception_call:) - ident(exception) operator(=) ident(rb_intern)operator(()stringoperator(\);) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(argv)operator([)integer(0)operator(],) ident(exception)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(mesg) operator(=) ident(rb_funcall)operator(()ident(argv)operator([)integer(0)operator(],) ident(exception)operator(,) ident(n)operator(,) ident(argv)operator([)integer(1)operator(]\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator((!)ident(rb_obj_is_kind_of)operator(()ident(mesg)operator(,) ident(rb_eException)operator(\)\)) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(argc)operator(>)integer(2)operator(\)) - ident(set_backtrace)operator(()ident(mesg)operator(,) ident(argv)operator([)integer(2)operator(]\);) - operator(}) - - reserved(return) ident(mesg)operator(;) -operator(}) - -directive(static) directive(void) -ident(rb_raise_jump)operator(()ident(mesg)operator(\)) - ident(VALUE) ident(mesg)operator(;) -operator({) - reserved(if) operator(()ident(ruby_frame) operator(!=) ident(top_frame)operator(\)) operator({) - ident(PUSH_FRAME)operator((\);) comment(/* fake frame */) - operator(*)ident(ruby_frame) operator(=) operator(*)ident(_frame)operator(.)ident(prev)operator(->)ident(prev)operator(;) - ident(rb_longjmp)operator(()ident(TAG_RAISE)operator(,) ident(mesg)operator(\);) - ident(POP_FRAME)operator((\);) - operator(}) - ident(rb_longjmp)operator(()ident(TAG_RAISE)operator(,) ident(mesg)operator(\);) -operator(}) - -directive(void) -ident(rb_jump_tag)operator(()ident(tag)operator(\)) - pre_type(int) ident(tag)operator(;) -operator({) - ident(JUMP_TAG)operator(()ident(tag)operator(\);) -operator(}) - -pre_type(int) -ident(rb_block_given_p)operator((\)) -operator({) - reserved(if) operator(()ident(ruby_frame)operator(->)ident(iter) operator(==) ident(ITER_CUR) operator(&&) ident(ruby_block)operator(\)) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -pre_type(int) -ident(rb_iterator_p)operator((\)) -operator({) - reserved(return) ident(rb_block_given_p)operator((\);) -operator(}) - -comment(/* - * call-seq: - * block_given? => true or false - * iterator? => true or false - * - * Returns true if yield would execute a - * block in the current context. The iterator? form - * is mildly deprecated. - * - * def try - * if block_given? - * yield - * else - * "no block" - * end - * end - * try #=> "no block" - * try { "hello" } #=> "hello" - * try do "hello" end #=> "hello" - */) - - -directive(static) ident(VALUE) -ident(rb_f_block_given_p)operator((\)) -operator({) - reserved(if) operator(()ident(ruby_frame)operator(->)ident(prev) operator(&&) ident(ruby_frame)operator(->)ident(prev)operator(->)ident(iter) operator(==) ident(ITER_CUR) operator(&&) ident(ruby_block)operator(\)) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -ident(VALUE) ident(rb_eThreadError)operator(;) - -ident(NORETURN)operator(()directive(static) directive(void) ident(proc_jump_error)operator(()pre_type(int)operator(,) ident(VALUE)operator(\)\);) -directive(static) directive(void) -ident(proc_jump_error)operator(()ident(state)operator(,) ident(result)operator(\)) - pre_type(int) ident(state)operator(;) - ident(VALUE) ident(result)operator(;) -operator({) - pre_type(char) ident(mesg)operator([)integer(32)operator(];) - pre_type(char) operator(*)ident(statement)operator(;) - - reserved(switch) operator(()ident(state)operator(\)) operator({) - reserved(case) ident(TAG_BREAK)operator(:) - ident(statement) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) ident(TAG_RETURN)operator(:) - ident(statement) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) ident(TAG_RETRY)operator(:) - ident(statement) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(statement) operator(=) stringoperator(;) reserved(break)operator(;) comment(/* should not happen */) - operator(}) - ident(snprintf)operator(()ident(mesg)operator(,) reserved(sizeof) ident(mesg)operator(,) stringoperator(,) ident(statement)operator(\);) - ident(localjump_error)operator(()ident(mesg)operator(,) ident(result)operator(,) ident(state)operator(\);) -operator(}) - -directive(static) directive(void) -ident(return_jump)operator(()ident(retval)operator(\)) - ident(VALUE) ident(retval)operator(;) -operator({) - reserved(struct) ident(tag) operator(*)ident(tt) operator(=) ident(prot_tag)operator(;) - pre_type(int) ident(yield) operator(=) ident(Qfalse)operator(;) - - reserved(if) operator(()ident(retval) operator(==) ident(Qundef)operator(\)) ident(retval) operator(=) ident(Qnil)operator(;) - reserved(while) operator(()ident(tt)operator(\)) operator({) - reserved(if) operator(()ident(tt)operator(->)ident(tag) operator(==) ident(PROT_YIELD)operator(\)) operator({) - ident(yield) operator(=) ident(Qtrue)operator(;) - ident(tt) operator(=) ident(tt)operator(->)ident(prev)operator(;) - operator(}) - reserved(if) operator(()ident(tt)operator(->)ident(tag) operator(==) ident(PROT_FUNC) operator(&&) ident(tt)operator(->)ident(frame)operator(->)ident(uniq) operator(==) ident(ruby_frame)operator(->)ident(uniq)operator(\)) operator({) - ident(tt)operator(->)ident(dst) operator(=) operator(()ident(VALUE)operator(\))ident(ruby_frame)operator(->)ident(uniq)operator(;) - ident(tt)operator(->)ident(retval) operator(=) ident(retval)operator(;) - ident(JUMP_TAG)operator(()ident(TAG_RETURN)operator(\);) - operator(}) - reserved(if) operator(()ident(tt)operator(->)ident(tag) operator(==) ident(PROT_LAMBDA) operator(&&) operator(!)ident(yield)operator(\)) operator({) - ident(tt)operator(->)ident(dst) operator(=) operator(()ident(VALUE)operator(\))ident(tt)operator(->)ident(frame)operator(->)ident(uniq)operator(;) - ident(tt)operator(->)ident(retval) operator(=) ident(retval)operator(;) - ident(JUMP_TAG)operator(()ident(TAG_RETURN)operator(\);) - operator(}) - reserved(if) operator(()ident(tt)operator(->)ident(tag) operator(==) ident(PROT_THREAD)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(\);) - operator(}) - ident(tt) operator(=) ident(tt)operator(->)ident(prev)operator(;) - operator(}) - ident(localjump_error)operator(()stringoperator(,) ident(retval)operator(,) ident(TAG_RETURN)operator(\);) -operator(}) - -directive(static) directive(void) -ident(break_jump)operator(()ident(retval)operator(\)) - ident(VALUE) ident(retval)operator(;) -operator({) - reserved(struct) ident(tag) operator(*)ident(tt) operator(=) ident(prot_tag)operator(;) - - reserved(if) operator(()ident(retval) operator(==) ident(Qundef)operator(\)) ident(retval) operator(=) ident(Qnil)operator(;) - reserved(while) operator(()ident(tt)operator(\)) operator({) - reserved(switch) operator(()ident(tt)operator(->)ident(tag)operator(\)) operator({) - reserved(case) ident(PROT_THREAD)operator(:) - reserved(case) ident(PROT_YIELD)operator(:) - reserved(case) ident(PROT_LOOP)operator(:) - reserved(case) ident(PROT_LAMBDA)operator(:) - ident(tt)operator(->)ident(dst) operator(=) operator(()ident(VALUE)operator(\))ident(tt)operator(->)ident(frame)operator(->)ident(uniq)operator(;) - ident(tt)operator(->)ident(retval) operator(=) ident(retval)operator(;) - ident(JUMP_TAG)operator(()ident(TAG_BREAK)operator(\);) - reserved(break)operator(;) - reserved(case) ident(PROT_FUNC)operator(:) - ident(tt) operator(=) integer(0)operator(;) - reserved(continue)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - ident(tt) operator(=) ident(tt)operator(->)ident(prev)operator(;) - operator(}) - ident(localjump_error)operator(()stringoperator(,) ident(retval)operator(,) ident(TAG_BREAK)operator(\);) -operator(}) - -directive(static) directive(void) -ident(next_jump)operator(()ident(retval)operator(\)) - ident(VALUE) ident(retval)operator(;) -operator({) - reserved(struct) ident(tag) operator(*)ident(tt) operator(=) ident(prot_tag)operator(;) - - reserved(if) operator(()ident(retval) operator(==) ident(Qundef)operator(\)) ident(retval) operator(=) ident(Qnil)operator(;) - reserved(while) operator(()ident(tt)operator(\)) operator({) - reserved(switch) operator(()ident(tt)operator(->)ident(tag)operator(\)) operator({) - reserved(case) ident(PROT_THREAD)operator(:) - reserved(case) ident(PROT_YIELD)operator(:) - reserved(case) ident(PROT_LOOP)operator(:) - reserved(case) ident(PROT_LAMBDA)operator(:) - reserved(case) ident(PROT_FUNC)operator(:) - ident(tt)operator(->)ident(dst) operator(=) operator(()ident(VALUE)operator(\))ident(tt)operator(->)ident(frame)operator(->)ident(uniq)operator(;) - ident(tt)operator(->)ident(retval) operator(=) ident(retval)operator(;) - ident(JUMP_TAG)operator(()ident(TAG_NEXT)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - ident(tt) operator(=) ident(tt)operator(->)ident(prev)operator(;) - operator(}) - ident(localjump_error)operator(()stringoperator(,) ident(retval)operator(,) ident(TAG_NEXT)operator(\);) -operator(}) - -directive(void) -ident(rb_need_block)operator((\)) -operator({) - reserved(if) operator((!)ident(rb_block_given_p)operator((\)\)) operator({) - ident(localjump_error)operator(()stringoperator(,) ident(Qnil)operator(,) integer(0)operator(\);) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(rb_yield_0)operator(()ident(val)operator(,) ident(self)operator(,) ident(klass)operator(,) ident(flags)operator(,) ident(avalue)operator(\)) - ident(VALUE) ident(val)operator(,) ident(self)operator(,) ident(klass)operator(;) comment(/* OK */) - pre_type(int) ident(flags)operator(,) ident(avalue)operator(;) -operator({) - ident(NODE) operator(*)ident(node)operator(;) - directive(volatile) ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) - directive(volatile) ident(VALUE) ident(old_cref)operator(;) - directive(volatile) ident(VALUE) ident(old_wrapper)operator(;) - reserved(struct) ident(BLOCK) operator(*) directive(volatile) ident(block)operator(;) - reserved(struct) ident(SCOPE) operator(*) directive(volatile) ident(old_scope)operator(;) - pre_type(int) ident(old_vmode)operator(;) - reserved(struct) ident(FRAME) ident(frame)operator(;) - ident(NODE) operator(*)ident(cnode) operator(=) ident(ruby_current_node)operator(;) - pre_type(int) ident(lambda) operator(=) ident(flags) operator(&) ident(YIELD_LAMBDA_CALL)operator(;) - pre_type(int) ident(state)operator(;) - - ident(rb_need_block)operator((\);) - - ident(PUSH_VARS)operator((\);) - ident(block) operator(=) ident(ruby_block)operator(;) - ident(frame) operator(=) ident(block)operator(->)ident(frame)operator(;) - ident(frame)operator(.)ident(prev) operator(=) ident(ruby_frame)operator(;) - ident(frame)operator(.)ident(node) operator(=) ident(cnode)operator(;) - ident(ruby_frame) operator(=) operator(&()ident(frame)operator(\);) - ident(old_cref) operator(=) operator(()ident(VALUE)operator(\))ident(ruby_cref)operator(;) - ident(ruby_cref) operator(=) ident(block)operator(->)ident(cref)operator(;) - ident(old_wrapper) operator(=) ident(ruby_wrapper)operator(;) - ident(ruby_wrapper) operator(=) ident(block)operator(->)ident(wrapper)operator(;) - ident(old_scope) operator(=) ident(ruby_scope)operator(;) - ident(ruby_scope) operator(=) ident(block)operator(->)ident(scope)operator(;) - ident(old_vmode) operator(=) ident(scope_vmode)operator(;) - ident(scope_vmode) operator(=) operator(()ident(flags) operator(&) ident(YIELD_PUBLIC_DEF)operator(\)) operator(?) ident(SCOPE_PUBLIC) operator(:) ident(block)operator(->)ident(vmode)operator(;) - ident(ruby_block) operator(=) ident(block)operator(->)ident(prev)operator(;) - reserved(if) operator(()ident(block)operator(->)ident(flags) operator(&) ident(BLOCK_D_SCOPE)operator(\)) operator({) - comment(/* put place holder for dynamic (in-block\) local variables */) - ident(ruby_dyna_vars) operator(=) ident(new_dvar)operator(()integer(0)operator(,) integer(0)operator(,) ident(block)operator(->)ident(dyna_vars)operator(\);) - operator(}) - reserved(else) operator({) - comment(/* FOR does not introduce new scope */) - ident(ruby_dyna_vars) operator(=) ident(block)operator(->)ident(dyna_vars)operator(;) - operator(}) - ident(PUSH_CLASS)operator(()ident(klass) operator(?) ident(klass) operator(:) ident(block)operator(->)ident(klass)operator(\);) - reserved(if) operator((!)ident(klass)operator(\)) operator({) - ident(self) operator(=) ident(block)operator(->)ident(self)operator(;) - operator(}) - ident(node) operator(=) ident(block)operator(->)ident(body)operator(;) - - reserved(if) operator(()ident(block)operator(->)ident(var)operator(\)) operator({) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(block)operator(->)ident(var) operator(==) operator(()ident(NODE)operator(*\))integer(1)operator(\)) operator({) comment(/* no parameter || */) - reserved(if) operator(()ident(lambda) operator(&&) ident(RARRAY)operator(()ident(val)operator(\)->)ident(len) operator(!=) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(RARRAY)operator(()ident(val)operator(\)->)ident(len)operator(\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(block)operator(->)ident(var) operator(==) operator(()ident(NODE)operator(*\))integer(2)operator(\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(val)operator(\)) operator(==) ident(T_ARRAY) operator(&&) ident(RARRAY)operator(()ident(val)operator(\)->)ident(len) operator(!=) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(RARRAY)operator(()ident(val)operator(\)->)ident(len)operator(\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(nd_type)operator(()ident(block)operator(->)ident(var)operator(\)) operator(==) ident(NODE_MASGN)operator(\)) operator({) - reserved(if) operator((!)ident(avalue)operator(\)) operator({) - ident(val) operator(=) ident(svalue_to_mrhs)operator(()ident(val)operator(,) ident(block)operator(->)ident(var)operator(->)ident(nd_head)operator(\);) - operator(}) - ident(massign)operator(()ident(self)operator(,) ident(block)operator(->)ident(var)operator(,) ident(val)operator(,) ident(lambda)operator(\);) - operator(}) - reserved(else) operator({) - pre_type(int) ident(len) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(avalue)operator(\)) operator({) - ident(len) operator(=) ident(RARRAY)operator(()ident(val)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) operator({) - reserved(goto) ident(zero_arg)operator(;) - operator(}) - reserved(if) operator(()ident(len) operator(==) integer(1)operator(\)) operator({) - ident(val) operator(=) ident(RARRAY)operator(()ident(val)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - operator(}) - reserved(else) operator({) - reserved(goto) ident(multi_values)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(val) operator(==) ident(Qundef)operator(\)) operator({) - label(zero_arg:) - ident(val) operator(=) ident(Qnil)operator(;) - label(multi_values:) - operator({) - ident(ruby_current_node) operator(=) ident(block)operator(->)ident(var)operator(;) - ident(rb_warn)operator(()stringoperator(,) - ident(len)operator(,) ident(cnode)operator(->)ident(nd_file)operator(,) ident(nd_line)operator(()ident(cnode)operator(\)\);) - ident(ruby_current_node) operator(=) ident(cnode)operator(;) - operator(}) - operator(}) - ident(assign)operator(()ident(self)operator(,) ident(block)operator(->)ident(var)operator(,) ident(val)operator(,) ident(lambda)operator(\);) - operator(}) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state)operator(\)) reserved(goto) ident(pop_state)operator(;) - operator(}) - reserved(if) operator((!)ident(node)operator(\)) operator({) - ident(state) operator(=) integer(0)operator(;) - reserved(goto) ident(pop_state)operator(;) - operator(}) - ident(ruby_current_node) operator(=) ident(node)operator(;) - - ident(PUSH_ITER)operator(()ident(block)operator(->)ident(iter)operator(\);) - ident(PUSH_TAG)operator(()ident(lambda) operator(?) ident(PROT_NONE) operator(:) ident(PROT_YIELD)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - label(redo:) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_CFUNC) operator(||) ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_IFUNC)operator(\)) operator({) - reserved(if) operator(()ident(node)operator(->)ident(nd_state) operator(==) ident(YIELD_FUNC_AVALUE)operator(\)) operator({) - reserved(if) operator((!)ident(avalue)operator(\)) operator({) - ident(val) operator(=) ident(svalue_to_avalue)operator(()ident(val)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(avalue)operator(\)) operator({) - ident(val) operator(=) ident(avalue_to_svalue)operator(()ident(val)operator(\);) - operator(}) - reserved(if) operator(()ident(val) operator(==) ident(Qundef) operator(&&) ident(node)operator(->)ident(nd_state) operator(!=) ident(YIELD_FUNC_SVALUE)operator(\)) - ident(val) operator(=) ident(Qnil)operator(;) - operator(}) - ident(result) operator(=) operator((*)ident(node)operator(->)ident(nd_cfnc)operator(\)()ident(val)operator(,) ident(node)operator(->)ident(nd_tval)operator(,) ident(self)operator(\);) - operator(}) - reserved(else) operator({) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - reserved(switch) operator(()ident(state)operator(\)) operator({) - reserved(case) ident(TAG_REDO)operator(:) - ident(state) operator(=) integer(0)operator(;) - ident(CHECK_INTS)operator(;) - reserved(goto) ident(redo)operator(;) - reserved(case) ident(TAG_NEXT)operator(:) - reserved(if) operator((!)ident(lambda)operator(\)) operator({) - ident(state) operator(=) integer(0)operator(;) - ident(result) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - operator(}) - reserved(break)operator(;) - reserved(case) ident(TAG_BREAK)operator(:) - reserved(if) operator(()ident(TAG_DST)operator((\)\)) operator({) - ident(result) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - operator(}) - reserved(else) operator({) - ident(lambda) operator(=) ident(Qtrue)operator(;) comment(/* just pass TAG_BREAK */) - operator(}) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) - ident(POP_TAG)operator((\);) - ident(POP_ITER)operator((\);) - label(pop_state:) - ident(POP_CLASS)operator((\);) - reserved(if) operator(()ident(ruby_dyna_vars) operator(&&) operator(()ident(block)operator(->)ident(flags) operator(&) ident(BLOCK_D_SCOPE)operator(\)) operator(&&) - operator(!)ident(FL_TEST)operator(()ident(ruby_dyna_vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\)\)) operator({) - reserved(struct) ident(RVarmap) operator(*)ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) - - reserved(if) operator(()ident(ruby_dyna_vars)operator(->)ident(id) operator(==) integer(0)operator(\)) operator({) - ident(vars) operator(=) ident(ruby_dyna_vars)operator(->)ident(next)operator(;) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(ruby_dyna_vars)operator(\);) - reserved(while) operator(()ident(vars) operator(&&) ident(vars)operator(->)ident(id) operator(!=) integer(0) operator(&&) ident(vars) operator(!=) ident(block)operator(->)ident(dyna_vars)operator(\)) operator({) - reserved(struct) ident(RVarmap) operator(*)ident(tmp) operator(=) ident(vars)operator(->)ident(next)operator(;) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(vars)operator(\);) - ident(vars) operator(=) ident(tmp)operator(;) - operator(}) - operator(}) - operator(}) - ident(POP_VARS)operator((\);) - ident(ruby_block) operator(=) ident(block)operator(;) - ident(ruby_frame) operator(=) ident(ruby_frame)operator(->)ident(prev)operator(;) - ident(ruby_cref) operator(=) operator(()ident(NODE)operator(*\))ident(old_cref)operator(;) - ident(ruby_wrapper) operator(=) ident(old_wrapper)operator(;) - reserved(if) operator(()ident(ruby_scope)operator(->)ident(flags) operator(&) ident(SCOPE_DONT_RECYCLE)operator(\)) - ident(scope_dup)operator(()ident(old_scope)operator(\);) - ident(ruby_scope) operator(=) ident(old_scope)operator(;) - ident(scope_vmode) operator(=) ident(old_vmode)operator(;) - reserved(switch) operator(()ident(state)operator(\)) operator({) - reserved(case) integer(0)operator(:) - reserved(break)operator(;) - reserved(case) ident(TAG_BREAK)operator(:) - reserved(if) operator((!)ident(lambda)operator(\)) operator({) - reserved(struct) ident(tag) operator(*)ident(tt) operator(=) ident(prot_tag)operator(;) - - reserved(while) operator(()ident(tt)operator(\)) operator({) - reserved(if) operator(()ident(tt)operator(->)ident(tag) operator(==) ident(PROT_LOOP) operator(&&) ident(tt)operator(->)ident(blkid) operator(==) ident(ruby_block)operator(->)ident(uniq)operator(\)) operator({) - ident(tt)operator(->)ident(dst) operator(=) operator(()ident(VALUE)operator(\))ident(tt)operator(->)ident(frame)operator(->)ident(uniq)operator(;) - ident(tt)operator(->)ident(retval) operator(=) ident(result)operator(;) - ident(JUMP_TAG)operator(()ident(TAG_BREAK)operator(\);) - operator(}) - ident(tt) operator(=) ident(tt)operator(->)ident(prev)operator(;) - operator(}) - ident(proc_jump_error)operator(()ident(TAG_BREAK)operator(,) ident(result)operator(\);) - operator(}) - comment(/* fall through */) - reserved(default)operator(:) - ident(JUMP_TAG)operator(()ident(state)operator(\);) - reserved(break)operator(;) - operator(}) - ident(ruby_current_node) operator(=) ident(cnode)operator(;) - reserved(return) ident(result)operator(;) -operator(}) - -ident(VALUE) -ident(rb_yield)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(return) ident(rb_yield_0)operator(()ident(val)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) ident(Qfalse)operator(\);) -operator(}) - -ident(VALUE) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_yield_values)operator(()pre_type(int) ident(n)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_yield_values)operator(()ident(n)operator(,) ident(va_alist)operator(\)) - pre_type(int) ident(n)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(va_list) ident(args)operator(;) - ident(VALUE) ident(ary)operator(;) - - reserved(if) operator(()ident(n) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(rb_yield_0)operator(()ident(Qundef)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) ident(Qfalse)operator(\);) - operator(}) - ident(ary) operator(=) ident(rb_ary_new2)operator(()ident(n)operator(\);) - ident(va_init_list)operator(()ident(args)operator(,) ident(n)operator(\);) - reserved(while) operator(()ident(n)operator(--\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(va_arg)operator(()ident(args)operator(,) ident(VALUE)operator(\)\);) - operator(}) - ident(va_end)operator(()ident(args)operator(\);) - reserved(return) ident(rb_yield_0)operator(()ident(ary)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) ident(Qtrue)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_yield_splat)operator(()ident(values)operator(\)) - ident(VALUE) ident(values)operator(;) -operator({) - pre_type(int) ident(avalue) operator(=) ident(Qfalse)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(values)operator(\)) operator(==) ident(T_ARRAY)operator(\)) operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(values)operator(\)->)ident(len) operator(==) integer(0)operator(\)) operator({) - ident(values) operator(=) ident(Qundef)operator(;) - operator(}) - reserved(else) operator({) - ident(avalue) operator(=) ident(Qtrue)operator(;) - operator(}) - operator(}) - reserved(return) ident(rb_yield_0)operator(()ident(values)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) ident(avalue)operator(\);) -operator(}) - -comment(/* - * call-seq: - * loop {|| block } - * - * Repeatedly executes the block. - * - * loop do - * print "Input: " - * line = gets - * break if !line or line =~ /^qQ/ - * # ... - * end - */) - -directive(static) ident(VALUE) -ident(rb_f_loop)operator((\)) -operator({) - reserved(for) operator((;;\)) operator({) - ident(rb_yield_0)operator(()ident(Qundef)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) ident(Qfalse)operator(\);) - ident(CHECK_INTS)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) comment(/* dummy */) -operator(}) - -directive(static) ident(VALUE) -ident(massign)operator(()ident(self)operator(,) ident(node)operator(,) ident(val)operator(,) ident(pcall)operator(\)) - ident(VALUE) ident(self)operator(;) - ident(NODE) operator(*)ident(node)operator(;) - ident(VALUE) ident(val)operator(;) - pre_type(int) ident(pcall)operator(;) -operator({) - ident(NODE) operator(*)ident(list)operator(;) - pre_type(long) ident(i) operator(=) integer(0)operator(,) ident(len)operator(;) - - ident(len) operator(=) ident(RARRAY)operator(()ident(val)operator(\)->)ident(len)operator(;) - ident(list) operator(=) ident(node)operator(->)ident(nd_head)operator(;) - reserved(for) operator((;) ident(list) operator(&&) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(assign)operator(()ident(self)operator(,) ident(list)operator(->)ident(nd_head)operator(,) ident(RARRAY)operator(()ident(val)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(pcall)operator(\);) - ident(list) operator(=) ident(list)operator(->)ident(nd_next)operator(;) - operator(}) - reserved(if) operator(()ident(pcall) operator(&&) ident(list)operator(\)) reserved(goto) ident(arg_error)operator(;) - reserved(if) operator(()ident(node)operator(->)ident(nd_args)operator(\)) operator({) - reserved(if) operator((()pre_type(long)operator(\)()ident(node)operator(->)ident(nd_args)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - comment(/* no check for mere `*' */) - operator(}) - reserved(else) reserved(if) operator((!)ident(list) operator(&&) ident(i)operator(<)ident(len)operator(\)) operator({) - ident(assign)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_args)operator(,) ident(rb_ary_new4)operator(()ident(len)operator(-)ident(i)operator(,) ident(RARRAY)operator(()ident(val)operator(\)->)ident(ptr)operator(+)ident(i)operator(\),) ident(pcall)operator(\);) - operator(}) - reserved(else) operator({) - ident(assign)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_args)operator(,) ident(rb_ary_new2)operator(()integer(0)operator(\),) ident(pcall)operator(\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(pcall) operator(&&) ident(i) operator(<) ident(len)operator(\)) operator({) - reserved(goto) ident(arg_error)operator(;) - operator(}) - - reserved(while) operator(()ident(list)operator(\)) operator({) - ident(i)operator(++;) - ident(assign)operator(()ident(self)operator(,) ident(list)operator(->)ident(nd_head)operator(,) ident(Qnil)operator(,) ident(pcall)operator(\);) - ident(list) operator(=) ident(list)operator(->)ident(nd_next)operator(;) - operator(}) - reserved(return) ident(val)operator(;) - - label(arg_error:) - reserved(while) operator(()ident(list)operator(\)) operator({) - ident(i)operator(++;) - ident(list) operator(=) ident(list)operator(->)ident(nd_next)operator(;) - operator(}) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(len)operator(,) ident(i)operator(\);) -operator(}) - -directive(static) directive(void) -ident(assign)operator(()ident(self)operator(,) ident(lhs)operator(,) ident(val)operator(,) ident(pcall)operator(\)) - ident(VALUE) ident(self)operator(;) - ident(NODE) operator(*)ident(lhs)operator(;) - ident(VALUE) ident(val)operator(;) - pre_type(int) ident(pcall)operator(;) -operator({) - ident(ruby_current_node) operator(=) ident(lhs)operator(;) - reserved(if) operator(()ident(val) operator(==) ident(Qundef)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(\);) - ident(val) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(switch) operator(()ident(nd_type)operator(()ident(lhs)operator(\)\)) operator({) - reserved(case) ident(NODE_GASGN)operator(:) - ident(rb_gvar_set)operator(()ident(lhs)operator(->)ident(nd_entry)operator(,) ident(val)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_IASGN)operator(:) - ident(rb_ivar_set)operator(()ident(self)operator(,) ident(lhs)operator(->)ident(nd_vid)operator(,) ident(val)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_LASGN)operator(:) - reserved(if) operator(()ident(ruby_scope)operator(->)ident(local_vars) operator(==) integer(0)operator(\)) - ident(rb_bug)operator(()stringoperator(\);) - ident(ruby_scope)operator(->)ident(local_vars)operator([)ident(lhs)operator(->)ident(nd_cnt)operator(]) operator(=) ident(val)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_DASGN)operator(:) - ident(dvar_asgn)operator(()ident(lhs)operator(->)ident(nd_vid)operator(,) ident(val)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_DASGN_CURR)operator(:) - ident(dvar_asgn_curr)operator(()ident(lhs)operator(->)ident(nd_vid)operator(,) ident(val)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_CDECL)operator(:) - reserved(if) operator(()ident(lhs)operator(->)ident(nd_vid) operator(==) integer(0)operator(\)) operator({) - ident(rb_const_set)operator(()ident(class_prefix)operator(()ident(self)operator(,) ident(lhs)operator(->)ident(nd_else)operator(\),) ident(lhs)operator(->)ident(nd_else)operator(->)ident(nd_mid)operator(,) ident(val)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_const_set)operator(()ident(ruby_cbase)operator(,) ident(lhs)operator(->)ident(nd_vid)operator(,) ident(val)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_CVDECL)operator(:) - reserved(if) operator(()ident(RTEST)operator(()ident(ruby_verbose)operator(\)) operator(&&) ident(FL_TEST)operator(()ident(ruby_cbase)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - ident(rb_cvar_set)operator(()ident(cvar_cbase)operator((\),) ident(lhs)operator(->)ident(nd_vid)operator(,) ident(val)operator(,) ident(Qtrue)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_CVASGN)operator(:) - ident(rb_cvar_set)operator(()ident(cvar_cbase)operator((\),) ident(lhs)operator(->)ident(nd_vid)operator(,) ident(val)operator(,) ident(Qfalse)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_MASGN)operator(:) - ident(massign)operator(()ident(self)operator(,) ident(lhs)operator(,) ident(svalue_to_mrhs)operator(()ident(val)operator(,) ident(lhs)operator(->)ident(nd_head)operator(\),) ident(pcall)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_CALL)operator(:) - reserved(case) ident(NODE_ATTRASGN)operator(:) - operator({) - ident(VALUE) ident(recv)operator(;) - pre_type(int) ident(scope)operator(;) - reserved(if) operator(()ident(lhs)operator(->)ident(nd_recv) operator(==) operator(()ident(NODE) operator(*\))integer(1)operator(\)) operator({) - ident(recv) operator(=) ident(self)operator(;) - ident(scope) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(recv) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(lhs)operator(->)ident(nd_recv)operator(\);) - ident(scope) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator((!)ident(lhs)operator(->)ident(nd_args)operator(\)) operator({) - comment(/* attr set */) - ident(ruby_current_node) operator(=) ident(lhs)operator(;) - ident(SET_CURRENT_SOURCE)operator((\);) - ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(recv)operator(\),) ident(recv)operator(,) ident(lhs)operator(->)ident(nd_mid)operator(,) integer(1)operator(,) operator(&)ident(val)operator(,) ident(scope)operator(,) ident(self)operator(\);) - operator(}) - reserved(else) operator({) - comment(/* array set */) - ident(VALUE) ident(args)operator(;) - - ident(args) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(lhs)operator(->)ident(nd_args)operator(\);) - ident(rb_ary_push)operator(()ident(args)operator(,) ident(val)operator(\);) - ident(ruby_current_node) operator(=) ident(lhs)operator(;) - ident(SET_CURRENT_SOURCE)operator((\);) - ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(recv)operator(\),) ident(recv)operator(,) ident(lhs)operator(->)ident(nd_mid)operator(,) - ident(RARRAY)operator(()ident(args)operator(\)->)ident(len)operator(,) ident(RARRAY)operator(()ident(args)operator(\)->)ident(ptr)operator(,) ident(scope)operator(,) ident(self)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(rb_bug)operator(()stringoperator(\);) - reserved(break)operator(;) - operator(}) -operator(}) - -ident(VALUE) -ident(rb_iterate)operator(()ident(it_proc)operator(,) ident(data1)operator(,) ident(bl_proc)operator(,) ident(data2)operator(\)) - ident(VALUE) operator((*)ident(it_proc)operator(\)) ident(_)operator((()ident(VALUE)operator(\)\),) operator((*)ident(bl_proc)operator(\)()ident(ANYARGS)operator(\);) - ident(VALUE) ident(data1)operator(,) ident(data2)operator(;) -operator({) - pre_type(int) ident(state)operator(;) - directive(volatile) ident(VALUE) ident(retval) operator(=) ident(Qnil)operator(;) - ident(NODE) operator(*)ident(node) operator(=) ident(NEW_IFUNC)operator(()ident(bl_proc)operator(,) ident(data2)operator(\);) - ident(VALUE) ident(self) operator(=) ident(ruby_top_self)operator(;) - - ident(PUSH_TAG)operator(()ident(PROT_LOOP)operator(\);) - ident(PUSH_BLOCK)operator(()integer(0)operator(,) ident(node)operator(\);) - ident(PUSH_ITER)operator(()ident(ITER_PRE)operator(\);) - ident(state) operator(=) ident(EXEC_TAG)operator((\);) - reserved(if) operator(()ident(state) operator(==) integer(0)operator(\)) operator({) - label(iter_retry:) - ident(retval) operator(=) operator((*)ident(it_proc)operator(\)()ident(data1)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(state) operator(==) ident(TAG_BREAK) operator(&&) ident(TAG_DST)operator((\)\)) operator({) - ident(retval) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - ident(state) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(state) operator(==) ident(TAG_RETRY)operator(\)) operator({) - ident(state) operator(=) integer(0)operator(;) - reserved(goto) ident(iter_retry)operator(;) - operator(}) - ident(POP_ITER)operator((\);) - ident(POP_BLOCK)operator((\);) - ident(POP_TAG)operator((\);) - - reserved(switch) operator(()ident(state)operator(\)) operator({) - reserved(case) integer(0)operator(:) - reserved(break)operator(;) - reserved(default)operator(:) - ident(JUMP_TAG)operator(()ident(state)operator(\);) - operator(}) - reserved(return) ident(retval)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(handle_rescue)operator(()ident(self)operator(,) ident(node)operator(\)) - ident(VALUE) ident(self)operator(;) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - pre_type(int) ident(argc)operator(;) ident(VALUE) operator(*)ident(argv)operator(;) comment(/* used in SETUP_ARGS */) - ident(TMP_PROTECT)operator(;) - - reserved(if) operator((!)ident(node)operator(->)ident(nd_args)operator(\)) operator({) - reserved(return) ident(rb_obj_is_kind_of)operator(()ident(ruby_errinfo)operator(,) ident(rb_eStandardError)operator(\);) - operator(}) - - ident(BEGIN_CALLARGS)operator(;) - ident(SETUP_ARGS)operator(()ident(node)operator(->)ident(nd_args)operator(\);) - ident(END_CALLARGS)operator(;) - - reserved(while) operator(()ident(argc)operator(--\)) operator({) - reserved(if) operator((!)ident(rb_obj_is_kind_of)operator(()ident(argv)operator([)integer(0)operator(],) ident(rb_cModule)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_funcall)operator((*)ident(argv)operator(,) ident(eqq)operator(,) integer(1)operator(,) ident(ruby_errinfo)operator(\)\)\)) reserved(return) integer(1)operator(;) - ident(argv)operator(++;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -ident(VALUE) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_rescue2)operator(()ident(VALUE) operator((*)ident(b_proc)operator(\)()ident(ANYARGS)operator(\),) ident(VALUE) ident(data1)operator(,) ident(VALUE) operator((*)ident(r_proc)operator(\)()ident(ANYARGS)operator(\),) ident(VALUE) ident(data2)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_rescue2)operator(()ident(b_proc)operator(,) ident(data1)operator(,) ident(r_proc)operator(,) ident(data2)operator(,) ident(va_alist)operator(\)) - ident(VALUE) operator((*)ident(b_proc)operator(\)()ident(ANYARGS)operator(\),) operator((*)ident(r_proc)operator(\)()ident(ANYARGS)operator(\);) - ident(VALUE) ident(data1)operator(,) ident(data2)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - pre_type(int) ident(state)operator(;) - directive(volatile) ident(VALUE) ident(result)operator(;) - directive(volatile) ident(VALUE) ident(e_info) operator(=) ident(ruby_errinfo)operator(;) - directive(volatile) pre_type(int) ident(handle) operator(=) ident(Qfalse)operator(;) - ident(VALUE) ident(eclass)operator(;) - ident(va_list) ident(args)operator(;) - - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(switch) operator(()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator({) - reserved(case) ident(TAG_RETRY)operator(:) - reserved(if) operator((!)ident(handle)operator(\)) reserved(break)operator(;) - ident(handle) operator(=) ident(Qfalse)operator(;) - ident(state) operator(=) integer(0)operator(;) - ident(ruby_errinfo) operator(=) ident(Qnil)operator(;) - reserved(case) integer(0)operator(:) - ident(result) operator(=) operator((*)ident(b_proc)operator(\)()ident(data1)operator(\);) - reserved(break)operator(;) - reserved(case) ident(TAG_RAISE)operator(:) - reserved(if) operator(()ident(handle)operator(\)) reserved(break)operator(;) - ident(handle) operator(=) ident(Qfalse)operator(;) - ident(va_init_list)operator(()ident(args)operator(,) ident(data2)operator(\);) - reserved(while) operator((()ident(eclass) operator(=) ident(va_arg)operator(()ident(args)operator(,) ident(VALUE)operator(\)\)) operator(!=) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(rb_obj_is_kind_of)operator(()ident(ruby_errinfo)operator(,) ident(eclass)operator(\)\)) operator({) - ident(handle) operator(=) ident(Qtrue)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - ident(va_end)operator(()ident(args)operator(\);) - - reserved(if) operator(()ident(handle)operator(\)) operator({) - ident(state) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(r_proc)operator(\)) operator({) - ident(result) operator(=) operator((*)ident(r_proc)operator(\)()ident(data2)operator(,) ident(ruby_errinfo)operator(\);) - operator(}) - reserved(else) operator({) - ident(result) operator(=) ident(Qnil)operator(;) - operator(}) - ident(ruby_errinfo) operator(=) ident(e_info)operator(;) - operator(}) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - - reserved(return) ident(result)operator(;) -operator(}) - -ident(VALUE) -ident(rb_rescue)operator(()ident(b_proc)operator(,) ident(data1)operator(,) ident(r_proc)operator(,) ident(data2)operator(\)) - ident(VALUE) operator((*)ident(b_proc)operator(\)(\),) operator((*)ident(r_proc)operator(\)(\);) - ident(VALUE) ident(data1)operator(,) ident(data2)operator(;) -operator({) - reserved(return) ident(rb_rescue2)operator(()ident(b_proc)operator(,) ident(data1)operator(,) ident(r_proc)operator(,) ident(data2)operator(,) ident(rb_eStandardError)operator(,) operator(()ident(VALUE)operator(\))integer(0)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(cont_protect)operator(;) - -ident(VALUE) -ident(rb_protect)operator(()ident(proc)operator(,) ident(data)operator(,) ident(state)operator(\)) - ident(VALUE) operator((*)ident(proc)operator(\)) ident(_)operator((()ident(VALUE)operator(\)\);) - ident(VALUE) ident(data)operator(;) - pre_type(int) operator(*)ident(state)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) comment(/* OK */) - pre_type(int) ident(status)operator(;) - - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - ident(cont_protect) operator(=) operator(()ident(VALUE)operator(\))ident(rb_node_newnode)operator(()ident(NODE_MEMO)operator(,) ident(cont_protect)operator(,) integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator((()ident(status) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(result) operator(=) operator((*)ident(proc)operator(\)()ident(data)operator(\);) - operator(}) - ident(cont_protect) operator(=) operator((()ident(NODE) operator(*\))ident(cont_protect)operator(\)->)ident(u1)operator(.)ident(value)operator(;) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state)operator(\)) operator({) - operator(*)ident(state) operator(=) ident(status)operator(;) - operator(}) - reserved(if) operator(()ident(status) operator(!=) integer(0)operator(\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - - reserved(return) ident(result)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ensure)operator(()ident(b_proc)operator(,) ident(data1)operator(,) ident(e_proc)operator(,) ident(data2)operator(\)) - ident(VALUE) operator((*)ident(b_proc)operator(\)(\);) - ident(VALUE) ident(data1)operator(;) - ident(VALUE) operator((*)ident(e_proc)operator(\)(\);) - ident(VALUE) ident(data2)operator(;) -operator({) - pre_type(int) ident(state)operator(;) - directive(volatile) ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) - ident(VALUE) ident(retval)operator(;) - - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(result) operator(=) operator((*)ident(b_proc)operator(\)()ident(data1)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - ident(retval) operator(=) ident(prot_tag) operator(?) ident(prot_tag)operator(->)ident(retval) operator(:) ident(Qnil)operator(;) comment(/* save retval */) - reserved(if) operator((!)ident(thread_no_ensure)operator((\)\)) operator({) - operator((*)ident(e_proc)operator(\)()ident(data2)operator(\);) - operator(}) - reserved(if) operator(()ident(prot_tag)operator(\)) ident(return_value)operator(()ident(retval)operator(\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - -ident(VALUE) -ident(rb_with_disable_interrupt)operator(()ident(proc)operator(,) ident(data)operator(\)) - ident(VALUE) operator((*)ident(proc)operator(\)(\);) - ident(VALUE) ident(data)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) comment(/* OK */) - pre_type(int) ident(status)operator(;) - - ident(DEFER_INTS)operator(;) - operator({) - pre_type(int) ident(thr_critical) operator(=) ident(rb_thread_critical)operator(;) - - ident(rb_thread_critical) operator(=) ident(Qtrue)operator(;) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(status) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(result) operator(=) operator((*)ident(proc)operator(\)()ident(data)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - ident(rb_thread_critical) operator(=) ident(thr_critical)operator(;) - operator(}) - ident(ENABLE_INTS)operator(;) - reserved(if) operator(()ident(status)operator(\)) ident(JUMP_TAG)operator(()ident(status)operator(\);) - - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) directive(void) -ident(stack_check)operator((\)) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_curr_thread)operator(;) - - reserved(if) operator((!)ident(rb_thread_raised_p)operator(()ident(th)operator(,) ident(RAISED_STACKOVERFLOW)operator(\)) operator(&&) ident(ruby_stack_check)operator((\)\)) operator({) - ident(rb_thread_raised_set)operator(()ident(th)operator(,) ident(RAISED_STACKOVERFLOW)operator(\);) - ident(rb_exc_raise)operator(()ident(sysstack_error)operator(\);) - operator(}) -operator(}) - -directive(static) pre_type(int) ident(last_call_status)operator(;) - -preprocessor(#define) ident(CSTAT_PRIV) integer(1) -preprocessor(#define) ident(CSTAT_PROT) integer(2) -preprocessor(#define) ident(CSTAT_VCALL) integer(4) -preprocessor(#define) ident(CSTAT_SUPER) integer(8) - -comment(/* - * call-seq: - * obj.method_missing(symbol [, *args] \) => result - * - * Invoked by Ruby when obj is sent a message it cannot handle. - * symbol is the symbol for the method called, and args - * are any arguments that were passed to it. By default, the interpreter - * raises an error when this method is called. However, it is possible - * to override the method to provide more dynamic behavior. - * The example below creates - * a class Roman, which responds to methods with names - * consisting of roman numerals, returning the corresponding integer - * values. - * - * class Roman - * def romanToInt(str\) - * # ... - * end - * def method_missing(methId\) - * str = methId.id2name - * romanToInt(str\) - * end - * end - * - * r = Roman.new - * r.iv #=> 4 - * r.xxiii #=> 23 - * r.mm #=> 2000 - */) - -directive(static) ident(VALUE) -ident(rb_method_missing)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(exc) operator(=) ident(rb_eNoMethodError)operator(;) - pre_type(char) operator(*)ident(format) operator(=) integer(0)operator(;) - ident(NODE) operator(*)ident(cnode) operator(=) ident(ruby_current_node)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0) operator(||) operator(!)ident(SYMBOL_P)operator(()ident(argv)operator([)integer(0)operator(]\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - ident(stack_check)operator((\);) - - ident(id) operator(=) ident(SYM2ID)operator(()ident(argv)operator([)integer(0)operator(]\);) - - reserved(if) operator(()ident(last_call_status) operator(&) ident(CSTAT_PRIV)operator(\)) operator({) - ident(format) operator(=) stringoperator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(last_call_status) operator(&) ident(CSTAT_PROT)operator(\)) operator({) - ident(format) operator(=) stringoperator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(last_call_status) operator(&) ident(CSTAT_VCALL)operator(\)) operator({) - ident(format) operator(=) stringoperator(;) - ident(exc) operator(=) ident(rb_eNameError)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(last_call_status) operator(&) ident(CSTAT_SUPER)operator(\)) operator({) - ident(format) operator(=) stringoperator(;) - operator(}) - reserved(if) operator((!)ident(format)operator(\)) operator({) - ident(format) operator(=) stringoperator(;) - operator(}) - - ident(ruby_current_node) operator(=) ident(cnode)operator(;) - operator({) - pre_type(int) ident(n) operator(=) integer(0)operator(;) - ident(VALUE) ident(args)operator([)integer(3)operator(];) - - ident(args)operator([)ident(n)operator(++]) operator(=) ident(rb_funcall)operator(()ident(rb_const_get)operator(()ident(exc)operator(,) ident(rb_intern)operator(()stringoperator(\)\),) char('!')operator(,) - integer(3)operator(,) ident(rb_str_new2)operator(()ident(format)operator(\),) ident(obj)operator(,) ident(argv)operator([)integer(0)operator(]\);) - ident(args)operator([)ident(n)operator(++]) operator(=) ident(argv)operator([)integer(0)operator(];) - reserved(if) operator(()ident(exc) operator(==) ident(rb_eNoMethodError)operator(\)) operator({) - ident(args)operator([)ident(n)operator(++]) operator(=) ident(rb_ary_new4)operator(()ident(argc)operator(-)integer(1)operator(,) ident(argv)operator(+)integer(1)operator(\);) - operator(}) - ident(exc) operator(=) ident(rb_class_new_instance)operator(()ident(n)operator(,) ident(args)operator(,) ident(exc)operator(\);) - ident(ruby_frame) operator(=) ident(ruby_frame)operator(->)ident(prev)operator(;) comment(/* pop frame for "method_missing" */) - ident(rb_exc_raise)operator(()ident(exc)operator(\);) - operator(}) - - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -directive(static) ident(VALUE) -ident(method_missing)operator(()ident(obj)operator(,) ident(id)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(call_status)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) - pre_type(int) ident(argc)operator(;) - directive(const) ident(VALUE) operator(*)ident(argv)operator(;) - pre_type(int) ident(call_status)operator(;) -operator({) - ident(VALUE) operator(*)ident(nargv)operator(;) - - ident(last_call_status) operator(=) ident(call_status)operator(;) - - reserved(if) operator(()ident(id) operator(==) ident(missing)operator(\)) operator({) - ident(PUSH_FRAME)operator((\);) - ident(rb_method_missing)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\);) - ident(POP_FRAME)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(id) operator(==) ident(ID_ALLOCATOR)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(rb_class2name)operator(()ident(obj)operator(\)\);) - operator(}) - reserved(if) operator(()ident(argc) operator(<) integer(0)operator(\)) operator({) - ident(VALUE) ident(tmp)operator(;) - - ident(argc) operator(=) operator(-)ident(argc)operator(-)integer(1)operator(;) - ident(tmp) operator(=) ident(splat_value)operator(()ident(argv)operator([)ident(argc)operator(]\);) - ident(nargv) operator(=) ident(ALLOCA_N)operator(()ident(VALUE)operator(,) ident(argc) operator(+) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len) operator(+) integer(1)operator(\);) - ident(MEMCPY)operator(()ident(nargv)operator(+)integer(1)operator(,) ident(argv)operator(,) ident(VALUE)operator(,) ident(argc)operator(\);) - ident(MEMCPY)operator(()ident(nargv)operator(+)integer(1)operator(+)ident(argc)operator(,) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len)operator(\);) - ident(argc) operator(+=) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len)operator(;) - operator(}) - reserved(else) operator({) - ident(nargv) operator(=) ident(ALLOCA_N)operator(()ident(VALUE)operator(,) ident(argc)operator(+)integer(1)operator(\);) - ident(MEMCPY)operator(()ident(nargv)operator(+)integer(1)operator(,) ident(argv)operator(,) ident(VALUE)operator(,) ident(argc)operator(\);) - operator(}) - ident(nargv)operator([)integer(0)operator(]) operator(=) ident(ID2SYM)operator(()ident(id)operator(\);) - reserved(return) ident(rb_funcall2)operator(()ident(obj)operator(,) ident(missing)operator(,) ident(argc)operator(+)integer(1)operator(,) ident(nargv)operator(\);) -operator(}) - -directive(static) directive(inline) ident(VALUE) -ident(call_cfunc)operator(()ident(func)operator(,) ident(recv)operator(,) ident(len)operator(,) ident(argc)operator(,) ident(argv)operator(\)) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - ident(VALUE) ident(recv)operator(;) - pre_type(int) ident(len)operator(,) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(if) operator(()ident(len) operator(>=) integer(0) operator(&&) ident(argc) operator(!=) ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(argc)operator(,) ident(len)operator(\);) - operator(}) - - reserved(switch) operator(()ident(len)operator(\)) operator({) - reserved(case) operator(-)integer(2)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(rb_ary_new4)operator(()ident(argc)operator(,) ident(argv)operator(\)\);) - reserved(break)operator(;) - reserved(case) operator(-)integer(1)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(argc)operator(,) ident(argv)operator(,) ident(recv)operator(\);) - reserved(break)operator(;) - reserved(case) integer(0)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(\);) - reserved(break)operator(;) - reserved(case) integer(1)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(2)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(3)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(4)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(5)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(],) ident(argv)operator([)integer(4)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(6)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(],) ident(argv)operator([)integer(4)operator(],) - ident(argv)operator([)integer(5)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(7)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(],) ident(argv)operator([)integer(4)operator(],) - ident(argv)operator([)integer(5)operator(],) ident(argv)operator([)integer(6)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(8)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(],) ident(argv)operator([)integer(4)operator(],) - ident(argv)operator([)integer(5)operator(],) ident(argv)operator([)integer(6)operator(],) ident(argv)operator([)integer(7)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(9)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(],) ident(argv)operator([)integer(4)operator(],) - ident(argv)operator([)integer(5)operator(],) ident(argv)operator([)integer(6)operator(],) ident(argv)operator([)integer(7)operator(],) ident(argv)operator([)integer(8)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(10)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(],) ident(argv)operator([)integer(4)operator(],) - ident(argv)operator([)integer(5)operator(],) ident(argv)operator([)integer(6)operator(],) ident(argv)operator([)integer(7)operator(],) ident(argv)operator([)integer(8)operator(],) ident(argv)operator([)integer(9)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(11)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(],) ident(argv)operator([)integer(4)operator(],) - ident(argv)operator([)integer(5)operator(],) ident(argv)operator([)integer(6)operator(],) ident(argv)operator([)integer(7)operator(],) ident(argv)operator([)integer(8)operator(],) ident(argv)operator([)integer(9)operator(],) ident(argv)operator([)integer(10)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(12)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(],) ident(argv)operator([)integer(4)operator(],) - ident(argv)operator([)integer(5)operator(],) ident(argv)operator([)integer(6)operator(],) ident(argv)operator([)integer(7)operator(],) ident(argv)operator([)integer(8)operator(],) ident(argv)operator([)integer(9)operator(],) - ident(argv)operator([)integer(10)operator(],) ident(argv)operator([)integer(11)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(13)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(],) ident(argv)operator([)integer(4)operator(],) - ident(argv)operator([)integer(5)operator(],) ident(argv)operator([)integer(6)operator(],) ident(argv)operator([)integer(7)operator(],) ident(argv)operator([)integer(8)operator(],) ident(argv)operator([)integer(9)operator(],) ident(argv)operator([)integer(10)operator(],) - ident(argv)operator([)integer(11)operator(],) ident(argv)operator([)integer(12)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(14)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(],) ident(argv)operator([)integer(4)operator(],) - ident(argv)operator([)integer(5)operator(],) ident(argv)operator([)integer(6)operator(],) ident(argv)operator([)integer(7)operator(],) ident(argv)operator([)integer(8)operator(],) ident(argv)operator([)integer(9)operator(],) ident(argv)operator([)integer(10)operator(],) - ident(argv)operator([)integer(11)operator(],) ident(argv)operator([)integer(12)operator(],) ident(argv)operator([)integer(13)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(15)operator(:) - reserved(return) operator((*)ident(func)operator(\)()ident(recv)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(],) ident(argv)operator([)integer(3)operator(],) ident(argv)operator([)integer(4)operator(],) - ident(argv)operator([)integer(5)operator(],) ident(argv)operator([)integer(6)operator(],) ident(argv)operator([)integer(7)operator(],) ident(argv)operator([)integer(8)operator(],) ident(argv)operator([)integer(9)operator(],) ident(argv)operator([)integer(10)operator(],) - ident(argv)operator([)integer(11)operator(],) ident(argv)operator([)integer(12)operator(],) ident(argv)operator([)integer(13)operator(],) ident(argv)operator([)integer(14)operator(]\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(len)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -directive(static) ident(VALUE) -ident(rb_call0)operator(()ident(klass)operator(,) ident(recv)operator(,) ident(id)operator(,) ident(oid)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(body)operator(,) ident(flags)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(recv)operator(;) - ident(ID) ident(id)operator(;) - ident(ID) ident(oid)operator(;) - pre_type(int) ident(argc)operator(;) comment(/* OK */) - ident(VALUE) operator(*)ident(argv)operator(;) comment(/* OK */) - ident(NODE) operator(*) directive(volatile) ident(body)operator(;) - pre_type(int) ident(flags)operator(;) -operator({) - ident(NODE) operator(*)ident(b2)operator(;) comment(/* OK */) - directive(volatile) ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) - pre_type(int) ident(itr)operator(;) - directive(static) pre_type(int) ident(tick)operator(;) - ident(TMP_PROTECT)operator(;) - directive(volatile) pre_type(int) ident(safe) operator(=) operator(-)integer(1)operator(;) - - reserved(if) operator(()ident(NOEX_SAFE)operator(()ident(flags)operator(\)) operator(>) ident(ruby_safe_level) operator(&&) ident(NOEX_SAFE)operator(()ident(flags)operator(\)) operator(>) integer(2)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(switch) operator(()ident(ruby_iter)operator(->)ident(iter)operator(\)) operator({) - reserved(case) ident(ITER_PRE)operator(:) - reserved(case) ident(ITER_PAS)operator(:) - ident(itr) operator(=) ident(ITER_CUR)operator(;) - reserved(break)operator(;) - reserved(case) ident(ITER_CUR)operator(:) - reserved(default)operator(:) - ident(itr) operator(=) ident(ITER_NOT)operator(;) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(((++)ident(tick) operator(&) hex(0xff)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(CHECK_INTS)operator(;) comment(/* better than nothing */) - ident(stack_check)operator((\);) - ident(rb_gc_finalize_deferred)operator((\);) - operator(}) - reserved(if) operator(()ident(argc) operator(<) integer(0)operator(\)) operator({) - ident(VALUE) ident(tmp)operator(;) - ident(VALUE) operator(*)ident(nargv)operator(;) - - ident(argc) operator(=) operator(-)ident(argc)operator(-)integer(1)operator(;) - ident(tmp) operator(=) ident(splat_value)operator(()ident(argv)operator([)ident(argc)operator(]\);) - ident(nargv) operator(=) ident(TMP_ALLOC)operator(()ident(argc) operator(+) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len)operator(\);) - ident(MEMCPY)operator(()ident(nargv)operator(,) ident(argv)operator(,) ident(VALUE)operator(,) ident(argc)operator(\);) - ident(MEMCPY)operator(()ident(nargv)operator(+)ident(argc)operator(,) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len)operator(\);) - ident(argc) operator(+=) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len)operator(;) - ident(argv) operator(=) ident(nargv)operator(;) - operator(}) - ident(PUSH_ITER)operator(()ident(itr)operator(\);) - ident(PUSH_FRAME)operator((\);) - - ident(ruby_frame)operator(->)ident(last_func) operator(=) ident(id)operator(;) - ident(ruby_frame)operator(->)ident(orig_func) operator(=) ident(oid)operator(;) - ident(ruby_frame)operator(->)ident(last_class) operator(=) operator(()ident(flags) operator(&) ident(NOEX_NOSUPER)operator(\)?)integer(0)operator(:)ident(klass)operator(;) - ident(ruby_frame)operator(->)ident(self) operator(=) ident(recv)operator(;) - ident(ruby_frame)operator(->)ident(argc) operator(=) ident(argc)operator(;) - ident(ruby_frame)operator(->)ident(flags) operator(=) integer(0)operator(;) - - reserved(switch) operator(()ident(nd_type)operator(()ident(body)operator(\)\)) operator({) - reserved(case) ident(NODE_CFUNC)operator(:) - operator({) - pre_type(int) ident(len) operator(=) ident(body)operator(->)ident(nd_argc)operator(;) - - reserved(if) operator(()ident(len) operator(<) operator(-)integer(2)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(,) - ident(len)operator(,) ident(rb_class2name)operator(()ident(klass)operator(\),) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(if) operator(()ident(event_hooks)operator(\)) operator({) - pre_type(int) ident(state)operator(;) - - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_C_CALL)operator(,) ident(ruby_current_node)operator(,) - ident(recv)operator(,) ident(id)operator(,) ident(klass)operator(\);) - ident(PUSH_TAG)operator(()ident(PROT_FUNC)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(result) operator(=) ident(call_cfunc)operator(()ident(body)operator(->)ident(nd_cfnc)operator(,) ident(recv)operator(,) ident(len)operator(,) ident(argc)operator(,) ident(argv)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - ident(ruby_current_node) operator(=) ident(ruby_frame)operator(->)ident(node)operator(;) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_C_RETURN)operator(,) ident(ruby_current_node)operator(,) - ident(recv)operator(,) ident(id)operator(,) ident(klass)operator(\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - operator(}) - reserved(else) operator({) - ident(result) operator(=) ident(call_cfunc)operator(()ident(body)operator(->)ident(nd_cfnc)operator(,) ident(recv)operator(,) ident(len)operator(,) ident(argc)operator(,) ident(argv)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - comment(/* for attr get/set */) - reserved(case) ident(NODE_IVAR)operator(:) - reserved(if) operator(()ident(argc) operator(!=) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - ident(result) operator(=) ident(rb_attr_get)operator(()ident(recv)operator(,) ident(body)operator(->)ident(nd_vid)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_ATTRSET)operator(:) - reserved(if) operator(()ident(argc) operator(!=) integer(1)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - ident(result) operator(=) ident(rb_ivar_set)operator(()ident(recv)operator(,) ident(body)operator(->)ident(nd_vid)operator(,) ident(argv)operator([)integer(0)operator(]\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_ZSUPER)operator(:) - ident(result) operator(=) ident(rb_call_super)operator(()ident(argc)operator(,) ident(argv)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_DMETHOD)operator(:) - ident(result) operator(=) ident(method_call)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(umethod_bind)operator(()ident(body)operator(->)ident(nd_cval)operator(,) ident(recv)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_BMETHOD)operator(:) - ident(ruby_frame)operator(->)ident(flags) operator(|=) ident(FRAME_DMETH)operator(;) - reserved(if) operator(()ident(event_hooks)operator(\)) operator({) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(;) - ident(Data_Get_Struct)operator(()ident(body)operator(->)ident(nd_cval)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(data)operator(\);) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_CALL)operator(,) ident(data)operator(->)ident(body)operator(,) ident(recv)operator(,) ident(id)operator(,) ident(klass)operator(\);) - operator(}) - ident(result) operator(=) ident(proc_invoke)operator(()ident(body)operator(->)ident(nd_cval)operator(,) ident(rb_ary_new4)operator(()ident(argc)operator(,) ident(argv)operator(\),) ident(recv)operator(,) ident(klass)operator(\);) - reserved(if) operator(()ident(event_hooks)operator(\)) operator({) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_RETURN)operator(,) ident(body)operator(,) ident(recv)operator(,) ident(id)operator(,) ident(klass)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_SCOPE)operator(:) - operator({) - pre_type(int) ident(state)operator(;) - ident(VALUE) operator(*)ident(local_vars)operator(;) comment(/* OK */) - ident(NODE) operator(*)ident(saved_cref) operator(=) integer(0)operator(;) - - ident(PUSH_SCOPE)operator((\);) - reserved(if) operator(()ident(body)operator(->)ident(nd_rval)operator(\)) operator({) - ident(saved_cref) operator(=) ident(ruby_cref)operator(;) - ident(ruby_cref) operator(=) operator(()ident(NODE)operator(*\))ident(body)operator(->)ident(nd_rval)operator(;) - operator(}) - ident(PUSH_CLASS)operator(()ident(ruby_cbase)operator(\);) - reserved(if) operator(()ident(body)operator(->)ident(nd_tbl)operator(\)) operator({) - ident(local_vars) operator(=) ident(TMP_ALLOC)operator(()ident(body)operator(->)ident(nd_tbl)operator([)integer(0)operator(]+)integer(1)operator(\);) - operator(*)ident(local_vars)operator(++) operator(=) operator(()ident(VALUE)operator(\))ident(body)operator(;) - ident(rb_mem_clear)operator(()ident(local_vars)operator(,) ident(body)operator(->)ident(nd_tbl)operator([)integer(0)operator(]\);) - ident(ruby_scope)operator(->)ident(local_tbl) operator(=) ident(body)operator(->)ident(nd_tbl)operator(;) - ident(ruby_scope)operator(->)ident(local_vars) operator(=) ident(local_vars)operator(;) - operator(}) - reserved(else) operator({) - ident(local_vars) operator(=) ident(ruby_scope)operator(->)ident(local_vars) operator(=) integer(0)operator(;) - ident(ruby_scope)operator(->)ident(local_tbl) operator(=) integer(0)operator(;) - operator(}) - ident(b2) operator(=) ident(body) operator(=) ident(body)operator(->)ident(nd_next)operator(;) - - reserved(if) operator(()ident(NOEX_SAFE)operator(()ident(flags)operator(\)) operator(>) ident(ruby_safe_level)operator(\)) operator({) - ident(safe) operator(=) ident(ruby_safe_level)operator(;) - ident(ruby_safe_level) operator(=) ident(NOEX_SAFE)operator(()ident(flags)operator(\);) - operator(}) - ident(PUSH_VARS)operator((\);) - ident(PUSH_TAG)operator(()ident(PROT_FUNC)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(NODE) operator(*)ident(node) operator(=) integer(0)operator(;) - pre_type(int) ident(i)operator(,) ident(nopt) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(nd_type)operator(()ident(body)operator(\)) operator(==) ident(NODE_ARGS)operator(\)) operator({) - ident(node) operator(=) ident(body)operator(;) - ident(body) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(nd_type)operator(()ident(body)operator(\)) operator(==) ident(NODE_BLOCK)operator(\)) operator({) - ident(node) operator(=) ident(body)operator(->)ident(nd_head)operator(;) - ident(body) operator(=) ident(body)operator(->)ident(nd_next)operator(;) - operator(}) - reserved(if) operator(()ident(node)operator(\)) operator({) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(!=) ident(NODE_ARGS)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(\);) - operator(}) - - ident(i) operator(=) ident(node)operator(->)ident(nd_cnt)operator(;) - reserved(if) operator(()ident(i) operator(>) ident(argc)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(argc)operator(,) ident(i)operator(\);) - operator(}) - reserved(if) operator((!)ident(node)operator(->)ident(nd_rest)operator(\)) operator({) - ident(NODE) operator(*)ident(optnode) operator(=) ident(node)operator(->)ident(nd_opt)operator(;) - - ident(nopt) operator(=) ident(i)operator(;) - reserved(while) operator(()ident(optnode)operator(\)) operator({) - ident(nopt)operator(++;) - ident(optnode) operator(=) ident(optnode)operator(->)ident(nd_next)operator(;) - operator(}) - reserved(if) operator(()ident(nopt) operator(<) ident(argc)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) - stringoperator(,) - ident(argc)operator(,) ident(nopt)operator(\);) - operator(}) - operator(}) - reserved(if) operator(()ident(local_vars)operator(\)) operator({) - reserved(if) operator(()ident(i) operator(>) integer(0)operator(\)) operator({) - comment(/* +2 for $_ and $~ */) - ident(MEMCPY)operator(()ident(local_vars)operator(+)integer(2)operator(,) ident(argv)operator(,) ident(VALUE)operator(,) ident(i)operator(\);) - operator(}) - operator(}) - ident(argv) operator(+=) ident(i)operator(;) ident(argc) operator(-=) ident(i)operator(;) - reserved(if) operator(()ident(node)operator(->)ident(nd_opt)operator(\)) operator({) - ident(NODE) operator(*)ident(opt) operator(=) ident(node)operator(->)ident(nd_opt)operator(;) - - reserved(while) operator(()ident(opt) operator(&&) ident(argc)operator(\)) operator({) - ident(assign)operator(()ident(recv)operator(,) ident(opt)operator(->)ident(nd_head)operator(,) operator(*)ident(argv)operator(,) integer(1)operator(\);) - ident(argv)operator(++;) ident(argc)operator(--;) - operator(++)ident(i)operator(;) - ident(opt) operator(=) ident(opt)operator(->)ident(nd_next)operator(;) - operator(}) - reserved(if) operator(()ident(opt)operator(\)) operator({) - ident(rb_eval)operator(()ident(recv)operator(,) ident(opt)operator(\);) - reserved(while) operator(()ident(opt)operator(\)) operator({) - ident(opt) operator(=) ident(opt)operator(->)ident(nd_next)operator(;) - operator(++)ident(i)operator(;) - operator(}) - operator(}) - operator(}) - reserved(if) operator((!)ident(node)operator(->)ident(nd_rest)operator(\)) operator({) - ident(i) operator(=) ident(nopt)operator(;) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(v)operator(;) - - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({) - ident(v) operator(=) ident(rb_ary_new4)operator(()ident(argc)operator(,)ident(argv)operator(\);) - ident(i) operator(=) operator(-)ident(i) operator(-) integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(v) operator(=) ident(rb_ary_new2)operator(()integer(0)operator(\);) - operator(}) - ident(assign)operator(()ident(recv)operator(,) ident(node)operator(->)ident(nd_rest)operator(,) ident(v)operator(,) integer(1)operator(\);) - operator(}) - ident(ruby_frame)operator(->)ident(argc) operator(=) ident(i)operator(;) - operator(}) - reserved(if) operator(()ident(event_hooks)operator(\)) operator({) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_CALL)operator(,) ident(b2)operator(,) ident(recv)operator(,) ident(id)operator(,) ident(klass)operator(\);) - operator(}) - ident(result) operator(=) ident(rb_eval)operator(()ident(recv)operator(,) ident(body)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(state) operator(==) ident(TAG_RETURN) operator(&&) ident(TAG_DST)operator((\)\)) operator({) - ident(result) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - ident(state) operator(=) integer(0)operator(;) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(event_hooks)operator(\)) operator({) - ident(EXEC_EVENT_HOOK)operator(()ident(RUBY_EVENT_RETURN)operator(,) ident(body)operator(,) ident(recv)operator(,) ident(id)operator(,) ident(klass)operator(\);) - operator(}) - ident(POP_VARS)operator((\);) - ident(POP_CLASS)operator((\);) - ident(POP_SCOPE)operator((\);) - ident(ruby_cref) operator(=) ident(saved_cref)operator(;) - reserved(if) operator(()ident(safe) operator(>=) integer(0)operator(\)) ident(ruby_safe_level) operator(=) ident(safe)operator(;) - reserved(switch) operator(()ident(state)operator(\)) operator({) - reserved(case) integer(0)operator(:) - reserved(break)operator(;) - - reserved(case) ident(TAG_BREAK)operator(:) - reserved(case) ident(TAG_RETURN)operator(:) - ident(JUMP_TAG)operator(()ident(state)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(TAG_RETRY)operator(:) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - comment(/* fall through */) - reserved(default)operator(:) - ident(jump_tag_but_local_jump)operator(()ident(state)operator(,) ident(result)operator(\);) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(unknown_node)operator(()ident(body)operator(\);) - reserved(break)operator(;) - operator(}) - ident(POP_FRAME)operator((\);) - ident(POP_ITER)operator((\);) - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_call)operator(()ident(klass)operator(,) ident(recv)operator(,) ident(mid)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(scope)operator(,) ident(self)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(recv)operator(;) - ident(ID) ident(mid)operator(;) - pre_type(int) ident(argc)operator(;) comment(/* OK */) - directive(const) ident(VALUE) operator(*)ident(argv)operator(;) comment(/* OK */) - pre_type(int) ident(scope)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - ident(NODE) operator(*)ident(body)operator(;) comment(/* OK */) - pre_type(int) ident(noex)operator(;) - ident(ID) ident(id) operator(=) ident(mid)operator(;) - reserved(struct) ident(cache_entry) operator(*)ident(ent)operator(;) - - reserved(if) operator((!)ident(klass)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eNotImpError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(mid)operator(\),) ident(recv)operator(\);) - operator(}) - comment(/* is it in the method cache? */) - ident(ent) operator(=) ident(cache) operator(+) ident(EXPR1)operator(()ident(klass)operator(,) ident(mid)operator(\);) - reserved(if) operator(()ident(ent)operator(->)ident(mid) operator(==) ident(mid) operator(&&) ident(ent)operator(->)ident(klass) operator(==) ident(klass)operator(\)) operator({) - reserved(if) operator((!)ident(ent)operator(->)ident(method)operator(\)) - reserved(return) ident(method_missing)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(scope)operator(==)integer(2)operator(?)ident(CSTAT_VCALL)operator(:)integer(0)operator(\);) - ident(klass) operator(=) ident(ent)operator(->)ident(origin)operator(;) - ident(id) operator(=) ident(ent)operator(->)ident(mid0)operator(;) - ident(noex) operator(=) ident(ent)operator(->)ident(noex)operator(;) - ident(body) operator(=) ident(ent)operator(->)ident(method)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(body) operator(=) ident(rb_get_method_body)operator((&)ident(klass)operator(,) operator(&)ident(id)operator(,) operator(&)ident(noex)operator(\)\)) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(scope) operator(==) integer(3)operator(\)) operator({) - reserved(return) ident(method_missing)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(CSTAT_SUPER)operator(\);) - operator(}) - reserved(return) ident(method_missing)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(scope)operator(==)integer(2)operator(?)ident(CSTAT_VCALL)operator(:)integer(0)operator(\);) - operator(}) - - reserved(if) operator(()ident(mid) operator(!=) ident(missing) operator(&&) ident(scope) operator(==) integer(0)operator(\)) operator({) - comment(/* receiver specified form for private method */) - reserved(if) operator(()ident(noex) operator(&) ident(NOEX_PRIVATE)operator(\)) - reserved(return) ident(method_missing)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(CSTAT_PRIV)operator(\);) - - comment(/* self must be kind of a specified form for protected method */) - reserved(if) operator(()ident(noex) operator(&) ident(NOEX_PROTECTED)operator(\)) operator({) - ident(VALUE) ident(defined_class) operator(=) ident(klass)operator(;) - - reserved(if) operator(()ident(self) operator(==) ident(Qundef)operator(\)) ident(self) operator(=) ident(ruby_frame)operator(->)ident(self)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(defined_class)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(defined_class) operator(=) ident(RBASIC)operator(()ident(defined_class)operator(\)->)ident(klass)operator(;) - operator(}) - reserved(if) operator((!)ident(rb_obj_is_kind_of)operator(()ident(self)operator(,) ident(rb_class_real)operator(()ident(defined_class)operator(\)\)\)) - reserved(return) ident(method_missing)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(CSTAT_PROT)operator(\);) - operator(}) - operator(}) - - reserved(return) ident(rb_call0)operator(()ident(klass)operator(,) ident(recv)operator(,) ident(mid)operator(,) ident(id)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(body)operator(,) ident(noex)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_apply)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(args)operator(\)) - ident(VALUE) ident(recv)operator(;) - ident(ID) ident(mid)operator(;) - ident(VALUE) ident(args)operator(;) -operator({) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - - ident(argc) operator(=) ident(RARRAY)operator(()ident(args)operator(\)->)ident(len)operator(;) comment(/* Assigns LONG, but argc is INT */) - ident(argv) operator(=) ident(ALLOCA_N)operator(()ident(VALUE)operator(,) ident(argc)operator(\);) - ident(MEMCPY)operator(()ident(argv)operator(,) ident(RARRAY)operator(()ident(args)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(argc)operator(\);) - reserved(return) ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(recv)operator(\),) ident(recv)operator(,) ident(mid)operator(,) ident(argc)operator(,) ident(argv)operator(,) integer(1)operator(,) ident(Qundef)operator(\);) -operator(}) - -comment(/* - * call-seq: - * obj.send(symbol [, args...]\) => obj - * obj.__send__(symbol [, args...]\) => obj - * - * Invokes the method identified by _symbol_, passing it any - * arguments specified. You can use \\_\\_send__ if the name - * +send+ clashes with an existing method in _obj_. - * - * class Klass - * def hello(*args\) - * "Hello " + args.join(' '\) - * end - * end - * k = Klass.new - * k.send :hello, "gentle", "readers" #=> "Hello gentle readers" - */) - -directive(static) ident(VALUE) -ident(rb_f_send)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(recv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(recv)operator(;) -operator({) - ident(VALUE) ident(vid)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - - ident(vid) operator(=) operator(*)ident(argv)operator(++;) ident(argc)operator(--;) - ident(PUSH_ITER)operator(()ident(rb_block_given_p)operator((\)?)ident(ITER_PRE)operator(:)ident(ITER_NOT)operator(\);) - ident(vid) operator(=) ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(recv)operator(\),) ident(recv)operator(,) ident(rb_to_id)operator(()ident(vid)operator(\),) ident(argc)operator(,) ident(argv)operator(,) integer(1)operator(,) ident(Qundef)operator(\);) - ident(POP_ITER)operator((\);) - - reserved(return) ident(vid)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(vafuncall)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(n)operator(,) ident(ar)operator(\)) - ident(VALUE) ident(recv)operator(;) - ident(ID) ident(mid)operator(;) - pre_type(int) ident(n)operator(;) - ident(va_list) operator(*)ident(ar)operator(;) -operator({) - ident(VALUE) operator(*)ident(argv)operator(;) - - reserved(if) operator(()ident(n) operator(>) integer(0)operator(\)) operator({) - pre_type(long) ident(i)operator(;) - - ident(argv) operator(=) ident(ALLOCA_N)operator(()ident(VALUE)operator(,) ident(n)operator(\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;)ident(i)operator(<)ident(n)operator(;)ident(i)operator(++\)) operator({) - ident(argv)operator([)ident(i)operator(]) operator(=) ident(va_arg)operator((*)ident(ar)operator(,) ident(VALUE)operator(\);) - operator(}) - ident(va_end)operator((*)ident(ar)operator(\);) - operator(}) - reserved(else) operator({) - ident(argv) operator(=) integer(0)operator(;) - operator(}) - - reserved(return) ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(recv)operator(\),) ident(recv)operator(,) ident(mid)operator(,) ident(n)operator(,) ident(argv)operator(,) integer(1)operator(,) ident(Qundef)operator(\);) -operator(}) - -ident(VALUE) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_funcall)operator(()ident(VALUE) ident(recv)operator(,) ident(ID) ident(mid)operator(,) pre_type(int) ident(n)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_funcall)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(n)operator(,) ident(va_alist)operator(\)) - ident(VALUE) ident(recv)operator(;) - ident(ID) ident(mid)operator(;) - pre_type(int) ident(n)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(va_list) ident(ar)operator(;) - ident(va_init_list)operator(()ident(ar)operator(,) ident(n)operator(\);) - - reserved(return) ident(vafuncall)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(n)operator(,) operator(&)ident(ar)operator(\);) -operator(}) - -ident(VALUE) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_funcall_rescue)operator(()ident(VALUE) ident(recv)operator(,) ident(ID) ident(mid)operator(,) pre_type(int) ident(n)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_funcall_rescue)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(n)operator(,) ident(va_alist)operator(\)) - ident(VALUE) ident(recv)operator(;) - ident(ID) ident(mid)operator(;) - pre_type(int) ident(n)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) comment(/* OK */) - pre_type(int) ident(status)operator(;) - ident(va_list) ident(ar)operator(;) - - ident(va_init_list)operator(()ident(ar)operator(,) ident(n)operator(\);) - - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(status) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(result) operator(=) ident(vafuncall)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(n)operator(,) operator(&)ident(ar)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - reserved(switch) operator(()ident(status)operator(\)) operator({) - reserved(case) integer(0)operator(:) - reserved(return) ident(result)operator(;) - reserved(case) ident(TAG_RAISE)operator(:) - reserved(return) ident(Qundef)operator(;) - reserved(default)operator(:) - ident(JUMP_TAG)operator(()ident(status)operator(\);) - operator(}) -operator(}) - -ident(VALUE) -ident(rb_funcall2)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(argc)operator(,) ident(argv)operator(\)) - ident(VALUE) ident(recv)operator(;) - ident(ID) ident(mid)operator(;) - pre_type(int) ident(argc)operator(;) - directive(const) ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(return) ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(recv)operator(\),) ident(recv)operator(,) ident(mid)operator(,) ident(argc)operator(,) ident(argv)operator(,) integer(1)operator(,) ident(Qundef)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_funcall3)operator(()ident(recv)operator(,) ident(mid)operator(,) ident(argc)operator(,) ident(argv)operator(\)) - ident(VALUE) ident(recv)operator(;) - ident(ID) ident(mid)operator(;) - pre_type(int) ident(argc)operator(;) - directive(const) ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(return) ident(rb_call)operator(()ident(CLASS_OF)operator(()ident(recv)operator(\),) ident(recv)operator(,) ident(mid)operator(,) ident(argc)operator(,) ident(argv)operator(,) integer(0)operator(,) ident(Qundef)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_call_super)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - directive(const) ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(result)operator(,) ident(self)operator(,) ident(klass)operator(;) - - reserved(if) operator(()ident(ruby_frame)operator(->)ident(last_class) operator(==) integer(0)operator(\)) operator({) - ident(rb_name_error)operator(()ident(ruby_frame)operator(->)ident(last_func)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(ruby_frame)operator(->)ident(orig_func)operator(\)\);) - operator(}) - - ident(self) operator(=) ident(ruby_frame)operator(->)ident(self)operator(;) - ident(klass) operator(=) ident(ruby_frame)operator(->)ident(last_class)operator(;) - reserved(if) operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(method_missing)operator(()ident(self)operator(,) ident(ruby_frame)operator(->)ident(orig_func)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(CSTAT_SUPER)operator(\);) - operator(}) - - ident(PUSH_ITER)operator(()ident(ruby_iter)operator(->)ident(iter) operator(?) ident(ITER_PRE) operator(:) ident(ITER_NOT)operator(\);) - ident(result) operator(=) ident(rb_call)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(,) ident(self)operator(,) ident(ruby_frame)operator(->)ident(orig_func)operator(,) ident(argc)operator(,) ident(argv)operator(,) integer(3)operator(,) ident(Qundef)operator(\);) - ident(POP_ITER)operator((\);) - - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(backtrace)operator(()ident(lev)operator(\)) - pre_type(int) ident(lev)operator(;) -operator({) - reserved(struct) ident(FRAME) operator(*)ident(frame) operator(=) ident(ruby_frame)operator(;) - pre_type(char) ident(buf)operator([)ident(BUFSIZ)operator(];) - ident(VALUE) ident(ary)operator(;) - ident(NODE) operator(*)ident(n)operator(;) - - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - reserved(if) operator(()ident(frame)operator(->)ident(last_func) operator(==) ident(ID_ALLOCATOR)operator(\)) operator({) - ident(frame) operator(=) ident(frame)operator(->)ident(prev)operator(;) - operator(}) - reserved(if) operator(()ident(lev) operator(<) integer(0)operator(\)) operator({) - ident(ruby_set_current_source)operator((\);) - reserved(if) operator(()ident(frame)operator(->)ident(last_func)operator(\)) operator({) - ident(snprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) stringoperator(,) - ident(ruby_sourcefile)operator(,) ident(ruby_sourceline)operator(,) - ident(rb_id2name)operator(()ident(frame)operator(->)ident(last_func)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(ruby_sourceline) operator(==) integer(0)operator(\)) operator({) - ident(snprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) stringoperator(,) ident(ruby_sourcefile)operator(\);) - operator(}) - reserved(else) operator({) - ident(snprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) stringoperator(,) ident(ruby_sourcefile)operator(,) ident(ruby_sourceline)operator(\);) - operator(}) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_str_new2)operator(()ident(buf)operator(\)\);) - reserved(if) operator(()ident(lev) operator(<) operator(-)integer(1)operator(\)) reserved(return) ident(ary)operator(;) - operator(}) - reserved(else) operator({) - reserved(while) operator(()ident(lev)operator(--) operator(>) integer(0)operator(\)) operator({) - ident(frame) operator(=) ident(frame)operator(->)ident(prev)operator(;) - reserved(if) operator((!)ident(frame)operator(\)) operator({) - ident(ary) operator(=) ident(Qnil)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - operator(}) - reserved(for) operator((;) ident(frame) operator(&&) operator(()ident(n) operator(=) ident(frame)operator(->)ident(node)operator(\);) ident(frame) operator(=) ident(frame)operator(->)ident(prev)operator(\)) operator({) - reserved(if) operator(()ident(frame)operator(->)ident(prev) operator(&&) ident(frame)operator(->)ident(prev)operator(->)ident(last_func)operator(\)) operator({) - reserved(if) operator(()ident(frame)operator(->)ident(prev)operator(->)ident(node) operator(==) ident(n)operator(\)) operator({) - reserved(if) operator(()ident(frame)operator(->)ident(prev)operator(->)ident(last_func) operator(==) ident(frame)operator(->)ident(last_func)operator(\)) reserved(continue)operator(;) - operator(}) - ident(snprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) stringoperator(,) - ident(n)operator(->)ident(nd_file)operator(,) ident(nd_line)operator(()ident(n)operator(\),) - ident(rb_id2name)operator(()ident(frame)operator(->)ident(prev)operator(->)ident(last_func)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(snprintf)operator(()ident(buf)operator(,) ident(BUFSIZ)operator(,) stringoperator(,) ident(n)operator(->)ident(nd_file)operator(,) ident(nd_line)operator(()ident(n)operator(\)\);) - operator(}) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_str_new2)operator(()ident(buf)operator(\)\);) - operator(}) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * caller(start=1\) => array - * - * Returns the current execution stack---an array containing strings in - * the form ``file:line'' or ``file:line: in - * `method'''. The optional _start_ parameter - * determines the number of initial stack entries to omit from the - * result. - * - * def a(skip\) - * caller(skip\) - * end - * def b(skip\) - * a(skip\) - * end - * def c(skip\) - * b(skip\) - * end - * c(0\) #=> ["prog:2:in `a'", "prog:5:in `b'", "prog:8:in `c'", "prog:10"] - * c(1\) #=> ["prog:5:in `b'", "prog:8:in `c'", "prog:11"] - * c(2\) #=> ["prog:8:in `c'", "prog:12"] - * c(3\) #=> ["prog:13"] - */) - -directive(static) ident(VALUE) -ident(rb_f_caller)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(level)operator(;) - pre_type(int) ident(lev)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(level)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(level)operator(\)\)) ident(lev) operator(=) integer(1)operator(;) - reserved(else) ident(lev) operator(=) ident(NUM2INT)operator(()ident(level)operator(\);) - reserved(if) operator(()ident(lev) operator(<) integer(0)operator(\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(lev)operator(\);) - - reserved(return) ident(backtrace)operator(()ident(lev)operator(\);) -operator(}) - -directive(void) -ident(rb_backtrace)operator((\)) -operator({) - pre_type(long) ident(i)operator(;) - ident(VALUE) ident(ary)operator(;) - - ident(ary) operator(=) ident(backtrace)operator((-)integer(1)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(printf)operator(()stringoperator(,) ident(RSTRING)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)->)ident(ptr)operator(\);) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(make_backtrace)operator((\)) -operator({) - reserved(return) ident(backtrace)operator((-)integer(1)operator(\);) -operator(}) - -ident(ID) -ident(rb_frame_last_func)operator((\)) -operator({) - reserved(return) ident(ruby_frame)operator(->)ident(last_func)operator(;) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(compile)operator(()ident(src)operator(,) ident(file)operator(,) ident(line)operator(\)) - ident(VALUE) ident(src)operator(;) - pre_type(char) operator(*)ident(file)operator(;) - pre_type(int) ident(line)operator(;) -operator({) - ident(NODE) operator(*)ident(node)operator(;) - pre_type(int) ident(critical)operator(;) - - ident(ruby_nerrs) operator(=) integer(0)operator(;) - ident(StringValue)operator(()ident(src)operator(\);) - ident(critical) operator(=) ident(rb_thread_critical)operator(;) - ident(rb_thread_critical) operator(=) ident(Qtrue)operator(;) - ident(node) operator(=) ident(rb_compile_string)operator(()ident(file)operator(,) ident(src)operator(,) ident(line)operator(\);) - ident(rb_thread_critical) operator(=) ident(critical)operator(;) - - reserved(if) operator(()ident(ruby_nerrs) operator(==) integer(0)operator(\)) reserved(return) ident(node)operator(;) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(eval)operator(()ident(self)operator(,) ident(src)operator(,) ident(scope)operator(,) ident(file)operator(,) ident(line)operator(\)) - ident(VALUE) ident(self)operator(,) ident(src)operator(,) ident(scope)operator(;) - pre_type(char) operator(*)ident(file)operator(;) - pre_type(int) ident(line)operator(;) -operator({) - reserved(struct) ident(BLOCK) operator(*)ident(data) operator(=) pre_constant(NULL)operator(;) - directive(volatile) ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) - reserved(struct) ident(SCOPE) operator(*) directive(volatile) ident(old_scope)operator(;) - reserved(struct) ident(BLOCK) operator(*) directive(volatile) ident(old_block)operator(;) - reserved(struct) ident(RVarmap) operator(*) directive(volatile) ident(old_dyna_vars)operator(;) - ident(VALUE) directive(volatile) ident(old_cref)operator(;) - pre_type(int) directive(volatile) ident(old_vmode)operator(;) - directive(volatile) ident(VALUE) ident(old_wrapper)operator(;) - reserved(struct) ident(FRAME) ident(frame)operator(;) - ident(NODE) operator(*)ident(nodesave) operator(=) ident(ruby_current_node)operator(;) - directive(volatile) pre_type(int) ident(iter) operator(=) ident(ruby_frame)operator(->)ident(iter)operator(;) - directive(volatile) pre_type(int) ident(safe) operator(=) ident(ruby_safe_level)operator(;) - pre_type(int) ident(state)operator(;) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(scope)operator(\)\)) operator({) - reserved(if) operator((!)ident(rb_obj_is_proc)operator(()ident(scope)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(scope)operator(\)\);) - operator(}) - - ident(Data_Get_Struct)operator(()ident(scope)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(data)operator(\);) - comment(/* PUSH BLOCK from data */) - ident(frame) operator(=) ident(data)operator(->)ident(frame)operator(;) - ident(frame)operator(.)ident(tmp) operator(=) ident(ruby_frame)operator(;) comment(/* gc protection */) - ident(ruby_frame) operator(=) operator(&()ident(frame)operator(\);) - ident(old_scope) operator(=) ident(ruby_scope)operator(;) - ident(ruby_scope) operator(=) ident(data)operator(->)ident(scope)operator(;) - ident(old_block) operator(=) ident(ruby_block)operator(;) - ident(ruby_block) operator(=) ident(data)operator(->)ident(prev)operator(;) - ident(old_dyna_vars) operator(=) ident(ruby_dyna_vars)operator(;) - ident(ruby_dyna_vars) operator(=) ident(data)operator(->)ident(dyna_vars)operator(;) - ident(old_vmode) operator(=) ident(scope_vmode)operator(;) - ident(scope_vmode) operator(=) ident(data)operator(->)ident(vmode)operator(;) - ident(old_cref) operator(=) operator(()ident(VALUE)operator(\))ident(ruby_cref)operator(;) - ident(ruby_cref) operator(=) ident(data)operator(->)ident(cref)operator(;) - ident(old_wrapper) operator(=) ident(ruby_wrapper)operator(;) - ident(ruby_wrapper) operator(=) ident(data)operator(->)ident(wrapper)operator(;) - reserved(if) operator((()ident(file) operator(==) integer(0) operator(||) operator(()ident(line) operator(==) integer(1) operator(&&) ident(strcmp)operator(()ident(file)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)\)) operator(&&) ident(data)operator(->)ident(frame)operator(.)ident(node)operator(\)) operator({) - ident(file) operator(=) ident(data)operator(->)ident(frame)operator(.)ident(node)operator(->)ident(nd_file)operator(;) - reserved(if) operator((!)ident(file)operator(\)) ident(file) operator(=) stringoperator(;) - ident(line) operator(=) ident(nd_line)operator(()ident(data)operator(->)ident(frame)operator(.)ident(node)operator(\);) - operator(}) - - ident(self) operator(=) ident(data)operator(->)ident(self)operator(;) - ident(ruby_frame)operator(->)ident(iter) operator(=) ident(data)operator(->)ident(iter)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(ruby_frame)operator(->)ident(prev)operator(\)) operator({) - ident(ruby_frame)operator(->)ident(iter) operator(=) ident(ruby_frame)operator(->)ident(prev)operator(->)ident(iter)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(file) operator(==) integer(0)operator(\)) operator({) - ident(ruby_set_current_source)operator((\);) - ident(file) operator(=) ident(ruby_sourcefile)operator(;) - ident(line) operator(=) ident(ruby_sourceline)operator(;) - operator(}) - ident(PUSH_CLASS)operator(()ident(data) operator(?) ident(data)operator(->)ident(klass) operator(:) ident(ruby_class)operator(\);) - ident(ruby_in_eval)operator(++;) - reserved(if) operator(()ident(TYPE)operator(()ident(ruby_class)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(ruby_class) operator(=) ident(RBASIC)operator(()ident(ruby_class)operator(\)->)ident(klass)operator(;) - operator(}) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(NODE) operator(*)ident(node)operator(;) - - ident(ruby_safe_level) operator(=) integer(0)operator(;) - ident(result) operator(=) ident(ruby_errinfo)operator(;) - ident(ruby_errinfo) operator(=) ident(Qnil)operator(;) - ident(node) operator(=) ident(compile)operator(()ident(src)operator(,) ident(file)operator(,) ident(line)operator(\);) - ident(ruby_safe_level) operator(=) ident(safe)operator(;) - reserved(if) operator(()ident(ruby_nerrs) operator(>) integer(0)operator(\)) operator({) - ident(compile_error)operator(()integer(0)operator(\);) - operator(}) - reserved(if) operator((!)ident(NIL_P)operator(()ident(result)operator(\)\)) ident(ruby_errinfo) operator(=) ident(result)operator(;) - ident(result) operator(=) ident(eval_node)operator(()ident(self)operator(,) ident(node)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - ident(POP_CLASS)operator((\);) - ident(ruby_in_eval)operator(--;) - reserved(if) operator((!)ident(NIL_P)operator(()ident(scope)operator(\)\)) operator({) - pre_type(int) ident(dont_recycle) operator(=) ident(ruby_scope)operator(->)ident(flags) operator(&) ident(SCOPE_DONT_RECYCLE)operator(;) - - ident(ruby_wrapper) operator(=) ident(old_wrapper)operator(;) - ident(ruby_cref) operator(=) operator(()ident(NODE)operator(*\))ident(old_cref)operator(;) - ident(ruby_frame) operator(=) ident(frame)operator(.)ident(tmp)operator(;) - ident(ruby_scope) operator(=) ident(old_scope)operator(;) - ident(ruby_block) operator(=) ident(old_block)operator(;) - ident(ruby_dyna_vars) operator(=) ident(old_dyna_vars)operator(;) - ident(data)operator(->)ident(vmode) operator(=) ident(scope_vmode)operator(;) comment(/* write back visibility mode */) - ident(scope_vmode) operator(=) ident(old_vmode)operator(;) - reserved(if) operator(()ident(dont_recycle)operator(\)) operator({) - reserved(struct) ident(tag) operator(*)ident(tag)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(vars)operator(;) - - ident(scope_dup)operator(()ident(ruby_scope)operator(\);) - reserved(for) operator(()ident(tag)operator(=)ident(prot_tag)operator(;) ident(tag)operator(;) ident(tag)operator(=)ident(tag)operator(->)ident(prev)operator(\)) operator({) - ident(scope_dup)operator(()ident(tag)operator(->)ident(scope)operator(\);) - operator(}) - reserved(for) operator(()ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) ident(vars)operator(;) ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(\)) operator({) - ident(FL_SET)operator(()ident(vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\);) - operator(}) - operator(}) - operator(}) - reserved(else) operator({) - ident(ruby_frame)operator(->)ident(iter) operator(=) ident(iter)operator(;) - operator(}) - ident(ruby_current_node) operator(=) ident(nodesave)operator(;) - ident(ruby_set_current_source)operator((\);) - reserved(if) operator(()ident(state)operator(\)) operator({) - reserved(if) operator(()ident(state) operator(==) ident(TAG_RAISE)operator(\)) operator({) - reserved(if) operator(()ident(strcmp)operator(()ident(file)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) operator({) - ident(VALUE) ident(mesg)operator(,) ident(errat)operator(,) ident(bt2)operator(;) - - ident(errat) operator(=) ident(get_backtrace)operator(()ident(ruby_errinfo)operator(\);) - ident(mesg) operator(=) ident(rb_attr_get)operator(()ident(ruby_errinfo)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(errat)operator(\)) operator(&&) ident(TYPE)operator(()ident(errat)operator(\)) operator(==) ident(T_ARRAY) operator(&&) - operator(()ident(bt2) operator(=) ident(backtrace)operator((-)integer(2)operator(\),) ident(RARRAY)operator(()ident(bt2)operator(\)->)ident(len) operator(>) integer(0)operator(\)\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(mesg)operator(\)) operator(&&) ident(TYPE)operator(()ident(mesg)operator(\)) operator(==) ident(T_STRING)operator(\)) operator({) - ident(rb_str_update)operator(()ident(mesg)operator(,) integer(0)operator(,) integer(0)operator(,) ident(rb_str_new2)operator(()stringoperator(\)\);) - ident(rb_str_update)operator(()ident(mesg)operator(,) integer(0)operator(,) integer(0)operator(,) ident(RARRAY)operator(()ident(errat)operator(\)->)ident(ptr)operator([)integer(0)operator(]\);) - operator(}) - ident(RARRAY)operator(()ident(errat)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(=) ident(RARRAY)operator(()ident(bt2)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - operator(}) - operator(}) - ident(rb_exc_raise)operator(()ident(ruby_errinfo)operator(\);) - operator(}) - ident(JUMP_TAG)operator(()ident(state)operator(\);) - operator(}) - - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * eval(string [, binding [, filename [,lineno]]]\) => obj - * - * Evaluates the Ruby expression(s\) in string. If - * binding is given, the evaluation is performed in its - * context. The binding may be a Binding object or a - * Proc object. If the optional filename and - * lineno parameters are present, they will be used when - * reporting syntax errors. - * - * def getBinding(str\) - * return binding - * end - * str = "hello" - * eval "str + ' Fred'" #=> "hello Fred" - * eval "str + ' Fred'", getBinding("bye"\) #=> "bye Fred" - */) - -directive(static) ident(VALUE) -ident(rb_f_eval)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - ident(VALUE) ident(src)operator(,) ident(scope)operator(,) ident(vfile)operator(,) ident(vline)operator(;) - pre_type(char) operator(*)ident(file) operator(=) stringoperator(;) - pre_type(int) ident(line) operator(=) integer(1)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(src)operator(,) operator(&)ident(scope)operator(,) operator(&)ident(vfile)operator(,) operator(&)ident(vline)operator(\);) - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4)operator(\)) operator({) - ident(StringValue)operator(()ident(src)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(scope)operator(\)) operator(&&) operator(!)ident(OBJ_TAINTED)operator(()ident(scope)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(SafeStringValue)operator(()ident(src)operator(\);) - operator(}) - reserved(if) operator(()ident(argc) operator(>=) integer(3)operator(\)) operator({) - ident(StringValue)operator(()ident(vfile)operator(\);) - operator(}) - reserved(if) operator(()ident(argc) operator(>=) integer(4)operator(\)) operator({) - ident(line) operator(=) ident(NUM2INT)operator(()ident(vline)operator(\);) - operator(}) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(vfile)operator(\)\)) ident(file) operator(=) ident(RSTRING)operator(()ident(vfile)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(NIL_P)operator(()ident(scope)operator(\)) operator(&&) ident(ruby_frame)operator(->)ident(prev)operator(\)) operator({) - reserved(struct) ident(FRAME) operator(*)ident(prev)operator(;) - ident(VALUE) ident(val)operator(;) - - ident(prev) operator(=) ident(ruby_frame)operator(;) - ident(PUSH_FRAME)operator((\);) - operator(*)ident(ruby_frame) operator(=) operator(*)ident(prev)operator(->)ident(prev)operator(;) - ident(ruby_frame)operator(->)ident(prev) operator(=) ident(prev)operator(;) - ident(val) operator(=) ident(eval)operator(()ident(self)operator(,) ident(src)operator(,) ident(scope)operator(,) ident(file)operator(,) ident(line)operator(\);) - ident(POP_FRAME)operator((\);) - - reserved(return) ident(val)operator(;) - operator(}) - reserved(return) ident(eval)operator(()ident(self)operator(,) ident(src)operator(,) ident(scope)operator(,) ident(file)operator(,) ident(line)operator(\);) -operator(}) - -comment(/* function to call func under the specified class/module context */) -directive(static) ident(VALUE) -ident(exec_under)operator(()ident(func)operator(,) ident(under)operator(,) ident(cbase)operator(,) ident(args)operator(\)) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - ident(VALUE) ident(under)operator(,) ident(cbase)operator(;) - directive(void) operator(*)ident(args)operator(;) -operator({) - ident(VALUE) ident(val) operator(=) ident(Qnil)operator(;) comment(/* OK */) - pre_type(int) ident(state)operator(;) - pre_type(int) ident(mode)operator(;) - reserved(struct) ident(FRAME) operator(*)ident(f) operator(=) ident(ruby_frame)operator(;) - - ident(PUSH_CLASS)operator(()ident(under)operator(\);) - ident(PUSH_FRAME)operator((\);) - ident(ruby_frame)operator(->)ident(self) operator(=) ident(f)operator(->)ident(self)operator(;) - ident(ruby_frame)operator(->)ident(last_func) operator(=) ident(f)operator(->)ident(last_func)operator(;) - ident(ruby_frame)operator(->)ident(orig_func) operator(=) ident(f)operator(->)ident(orig_func)operator(;) - ident(ruby_frame)operator(->)ident(last_class) operator(=) ident(f)operator(->)ident(last_class)operator(;) - ident(ruby_frame)operator(->)ident(argc) operator(=) ident(f)operator(->)ident(argc)operator(;) - reserved(if) operator(()ident(cbase)operator(\)) operator({) - ident(PUSH_CREF)operator(()ident(cbase)operator(\);) - operator(}) - - ident(mode) operator(=) ident(scope_vmode)operator(;) - ident(SCOPE_SET)operator(()ident(SCOPE_PUBLIC)operator(\);) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(val) operator(=) operator((*)ident(func)operator(\)()ident(args)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(cbase)operator(\)) ident(POP_CREF)operator((\);) - ident(SCOPE_SET)operator(()ident(mode)operator(\);) - ident(POP_FRAME)operator((\);) - ident(POP_CLASS)operator((\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - - reserved(return) ident(val)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(eval_under_i)operator(()ident(args)operator(\)) - ident(VALUE) operator(*)ident(args)operator(;) -operator({) - reserved(struct) ident(FRAME) operator(*)ident(f) operator(=) ident(ruby_frame)operator(;) - - reserved(if) operator(()ident(f) operator(&&) operator(()ident(f) operator(=) ident(f)operator(->)ident(prev)operator(\)) operator(&&) operator(()ident(f) operator(=) ident(f)operator(->)ident(prev)operator(\)\)) operator({) - ident(ruby_frame) operator(=) ident(f)operator(;) - operator(}) - reserved(return) ident(eval)operator(()ident(args)operator([)integer(0)operator(],) ident(args)operator([)integer(1)operator(],) ident(Qnil)operator(,) operator(()pre_type(char)operator(*\))ident(args)operator([)integer(2)operator(],) operator(()pre_type(int)operator(\))ident(args)operator([)integer(3)operator(]\);) -operator(}) - -comment(/* string eval under the class/module context */) -directive(static) ident(VALUE) -ident(eval_under)operator(()ident(under)operator(,) ident(self)operator(,) ident(src)operator(,) ident(file)operator(,) ident(line)operator(\)) - ident(VALUE) ident(under)operator(,) ident(self)operator(,) ident(src)operator(;) - directive(const) pre_type(char) operator(*)ident(file)operator(;) - pre_type(int) ident(line)operator(;) -operator({) - ident(VALUE) ident(args)operator([)integer(4)operator(];) - - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4)operator(\)) operator({) - ident(StringValue)operator(()ident(src)operator(\);) - operator(}) - reserved(else) operator({) - ident(SafeStringValue)operator(()ident(src)operator(\);) - operator(}) - ident(args)operator([)integer(0)operator(]) operator(=) ident(self)operator(;) - ident(args)operator([)integer(1)operator(]) operator(=) ident(src)operator(;) - ident(args)operator([)integer(2)operator(]) operator(=) operator(()ident(VALUE)operator(\))ident(file)operator(;) - ident(args)operator([)integer(3)operator(]) operator(=) operator(()ident(VALUE)operator(\))ident(line)operator(;) - reserved(return) ident(exec_under)operator(()ident(eval_under_i)operator(,) ident(under)operator(,) ident(under)operator(,) ident(args)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(yield_under_i)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(rb_yield_0)operator(()ident(self)operator(,) ident(self)operator(,) ident(ruby_class)operator(,) ident(YIELD_PUBLIC_DEF)operator(,) ident(Qfalse)operator(\);) -operator(}) - -comment(/* block eval under the class/module context */) -directive(static) ident(VALUE) -ident(yield_under)operator(()ident(under)operator(,) ident(self)operator(\)) - ident(VALUE) ident(under)operator(,) ident(self)operator(;) -operator({) - reserved(return) ident(exec_under)operator(()ident(yield_under_i)operator(,) ident(under)operator(,) integer(0)operator(,) ident(self)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(specific_eval)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(,) ident(self)operator(;) -operator({) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - reserved(return) ident(yield_under)operator(()ident(klass)operator(,) ident(self)operator(\);) - operator(}) - reserved(else) operator({) - pre_type(char) operator(*)ident(file) operator(=) stringoperator(;) - pre_type(int) ident(line) operator(=) integer(1)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4)operator(\)) operator({) - ident(StringValue)operator(()ident(argv)operator([)integer(0)operator(]\);) - operator(}) - reserved(else) operator({) - ident(SafeStringValue)operator(()ident(argv)operator([)integer(0)operator(]\);) - operator(}) - reserved(if) operator(()ident(argc) operator(>) integer(3)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(ruby_frame)operator(->)ident(last_func)operator(\),) - ident(rb_id2name)operator(()ident(ruby_frame)operator(->)ident(last_func)operator(\)\);) - operator(}) - reserved(if) operator(()ident(argc) operator(>) integer(2)operator(\)) ident(line) operator(=) ident(NUM2INT)operator(()ident(argv)operator([)integer(2)operator(]\);) - reserved(if) operator(()ident(argc) operator(>) integer(1)operator(\)) operator({) - ident(file) operator(=) ident(StringValuePtr)operator(()ident(argv)operator([)integer(1)operator(]\);) - operator(}) - operator(}) - reserved(return) ident(eval_under)operator(()ident(klass)operator(,) ident(self)operator(,) ident(argv)operator([)integer(0)operator(],) ident(file)operator(,) ident(line)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * obj.instance_eval(string [, filename [, lineno]] \) => obj - * obj.instance_eval {| | block } => obj - * - * Evaluates a string containing Ruby source code, or the given block, - * within the context of the receiver (_obj_\). In order to set the - * context, the variable +self+ is set to _obj_ while - * the code is executing, giving the code access to _obj_'s - * instance variables. In the version of instance_eval - * that takes a +String+, the optional second and third - * parameters supply a filename and starting line number that are used - * when reporting compilation errors. - * - * class Klass - * def initialize - * @secret = 99 - * end - * end - * k = Klass.new - * k.instance_eval { @secret } #=> 99 - */) - -ident(VALUE) -ident(rb_obj_instance_eval)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - ident(VALUE) ident(klass)operator(;) - - reserved(if) operator(()ident(SPECIAL_CONST_P)operator(()ident(self)operator(\)\)) operator({) - ident(klass) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(else) operator({) - ident(klass) operator(=) ident(rb_singleton_class)operator(()ident(self)operator(\);) - operator(}) - reserved(return) ident(specific_eval)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(,) ident(self)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod.class_eval(string [, filename [, lineno]]\) => obj - * mod.module_eval {|| block } => obj - * - * Evaluates the string or block in the context of _mod_. This can - * be used to add methods to a class. module_eval returns - * the result of evaluating its argument. The optional _filename_ - * and _lineno_ parameters set the text for error messages. - * - * class Thing - * end - * a = %q{def hello(\) "Hello there!" end} - * Thing.module_eval(a\) - * puts Thing.new.hello(\) - * Thing.module_eval("invalid code", "dummy", 123\) - * - * produces: - * - * Hello there! - * dummy:123:in `module_eval': undefined local variable - * or method `code' for Thing:Class - */) - -ident(VALUE) -ident(rb_mod_module_eval)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(mod)operator(;) -operator({) - reserved(return) ident(specific_eval)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(,) ident(mod)operator(\);) -operator(}) - -ident(VALUE) ident(rb_load_path)operator(;) - -ident(NORETURN)operator(()directive(static) directive(void) ident(load_failed) ident(_)operator((()ident(VALUE)operator(\)\)\);) - -directive(void) -ident(rb_load)operator(()ident(fname)operator(,) ident(wrap)operator(\)) - ident(VALUE) ident(fname)operator(;) - pre_type(int) ident(wrap)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(;) - pre_type(int) ident(state)operator(;) - directive(volatile) pre_type(int) ident(prohibit_int) operator(=) ident(rb_prohibit_interrupt)operator(;) - directive(volatile) ident(ID) ident(last_func)operator(;) - directive(volatile) ident(VALUE) ident(wrapper) operator(=) ident(ruby_wrapper)operator(;) - directive(volatile) ident(VALUE) ident(self) operator(=) ident(ruby_top_self)operator(;) - ident(NODE) operator(*)directive(volatile) ident(last_node)operator(;) - ident(NODE) operator(*)ident(saved_cref) operator(=) ident(ruby_cref)operator(;) - - reserved(if) operator(()ident(wrap) operator(&&) ident(ruby_safe_level) operator(>=) integer(4)operator(\)) operator({) - ident(StringValue)operator(()ident(fname)operator(\);) - operator(}) - reserved(else) operator({) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - operator(}) - ident(fname) operator(=) ident(rb_str_new4)operator(()ident(fname)operator(\);) - ident(tmp) operator(=) ident(rb_find_file)operator(()ident(fname)operator(\);) - reserved(if) operator((!)ident(tmp)operator(\)) operator({) - ident(load_failed)operator(()ident(fname)operator(\);) - operator(}) - ident(fname) operator(=) ident(tmp)operator(;) - - ident(ruby_errinfo) operator(=) ident(Qnil)operator(;) comment(/* ensure */) - ident(PUSH_VARS)operator((\);) - ident(PUSH_CLASS)operator(()ident(ruby_wrapper)operator(\);) - ident(ruby_cref) operator(=) ident(ruby_top_cref)operator(;) - reserved(if) operator((!)ident(wrap)operator(\)) operator({) - ident(rb_secure)operator(()integer(4)operator(\);) comment(/* should alter global state */) - ident(ruby_class) operator(=) ident(rb_cObject)operator(;) - ident(ruby_wrapper) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - comment(/* load in anonymous module as toplevel */) - ident(ruby_class) operator(=) ident(ruby_wrapper) operator(=) ident(rb_module_new)operator((\);) - ident(self) operator(=) ident(rb_obj_clone)operator(()ident(ruby_top_self)operator(\);) - ident(rb_extend_object)operator(()ident(self)operator(,) ident(ruby_wrapper)operator(\);) - ident(PUSH_CREF)operator(()ident(ruby_wrapper)operator(\);) - operator(}) - ident(PUSH_ITER)operator(()ident(ITER_NOT)operator(\);) - ident(PUSH_FRAME)operator((\);) - ident(ruby_frame)operator(->)ident(last_func) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(last_class) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(self) operator(=) ident(self)operator(;) - ident(PUSH_SCOPE)operator((\);) - comment(/* default visibility is private at loading toplevel */) - ident(SCOPE_SET)operator(()ident(SCOPE_PRIVATE)operator(\);) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - ident(state) operator(=) ident(EXEC_TAG)operator((\);) - ident(last_func) operator(=) ident(ruby_frame)operator(->)ident(last_func)operator(;) - ident(last_node) operator(=) ident(ruby_current_node)operator(;) - reserved(if) operator((!)ident(ruby_current_node) operator(&&) ident(ruby_sourcefile)operator(\)) operator({) - ident(last_node) operator(=) ident(NEW_NEWLINE)operator(()integer(0)operator(\);) - operator(}) - ident(ruby_current_node) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(state) operator(==) integer(0)operator(\)) operator({) - ident(NODE) operator(*)ident(node)operator(;) - directive(volatile) pre_type(int) ident(critical)operator(;) - - ident(DEFER_INTS)operator(;) - ident(ruby_in_eval)operator(++;) - ident(critical) operator(=) ident(rb_thread_critical)operator(;) - ident(rb_thread_critical) operator(=) ident(Qtrue)operator(;) - ident(rb_load_file)operator(()ident(RSTRING)operator(()ident(fname)operator(\)->)ident(ptr)operator(\);) - ident(ruby_in_eval)operator(--;) - ident(node) operator(=) ident(ruby_eval_tree)operator(;) - ident(rb_thread_critical) operator(=) ident(critical)operator(;) - ident(ALLOW_INTS)operator(;) - reserved(if) operator(()ident(ruby_nerrs) operator(==) integer(0)operator(\)) operator({) - ident(eval_node)operator(()ident(self)operator(,) ident(node)operator(\);) - operator(}) - operator(}) - ident(ruby_frame)operator(->)ident(last_func) operator(=) ident(last_func)operator(;) - ident(ruby_current_node) operator(=) ident(last_node)operator(;) - ident(ruby_sourcefile) operator(=) integer(0)operator(;) - ident(ruby_set_current_source)operator((\);) - reserved(if) operator(()ident(ruby_scope)operator(->)ident(flags) operator(==) ident(SCOPE_ALLOCA) operator(&&) ident(ruby_class) operator(==) ident(rb_cObject)operator(\)) operator({) - reserved(if) operator(()ident(ruby_scope)operator(->)ident(local_tbl)operator(\)) comment(/* toplevel was empty */) - ident(free)operator(()ident(ruby_scope)operator(->)ident(local_tbl)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - ident(rb_prohibit_interrupt) operator(=) ident(prohibit_int)operator(;) - ident(ruby_cref) operator(=) ident(saved_cref)operator(;) - ident(POP_SCOPE)operator((\);) - ident(POP_FRAME)operator((\);) - ident(POP_ITER)operator((\);) - ident(POP_CLASS)operator((\);) - ident(POP_VARS)operator((\);) - ident(ruby_wrapper) operator(=) ident(wrapper)operator(;) - reserved(if) operator(()ident(ruby_nerrs) operator(>) integer(0)operator(\)) operator({) - ident(ruby_nerrs) operator(=) integer(0)operator(;) - ident(rb_exc_raise)operator(()ident(ruby_errinfo)operator(\);) - operator(}) - reserved(if) operator(()ident(state)operator(\)) ident(jump_tag_but_local_jump)operator(()ident(state)operator(,) ident(Qundef)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(ruby_errinfo)operator(\)\)) comment(/* exception during load */) - ident(rb_exc_raise)operator(()ident(ruby_errinfo)operator(\);) -operator(}) - -directive(void) -ident(rb_load_protect)operator(()ident(fname)operator(,) ident(wrap)operator(,) ident(state)operator(\)) - ident(VALUE) ident(fname)operator(;) - pre_type(int) ident(wrap)operator(;) - pre_type(int) operator(*)ident(state)operator(;) -operator({) - pre_type(int) ident(status)operator(;) - - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(status) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(rb_load)operator(()ident(fname)operator(,) ident(wrap)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state)operator(\)) operator(*)ident(state) operator(=) ident(status)operator(;) -operator(}) - -comment(/* - * call-seq: - * load(filename, wrap=false\) => true - * - * Loads and executes the Ruby - * program in the file _filename_. If the filename does not - * resolve to an absolute path, the file is searched for in the library - * directories listed in $:. If the optional _wrap_ - * parameter is +true+, the loaded script will be executed - * under an anonymous module, protecting the calling program's global - * namespace. In no circumstance will any local variables in the loaded - * file be propagated to the loading environment. - */) - - -directive(static) ident(VALUE) -ident(rb_f_load)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(fname)operator(,) ident(wrap)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(fname)operator(,) operator(&)ident(wrap)operator(\);) - ident(rb_load)operator(()ident(fname)operator(,) ident(RTEST)operator(()ident(wrap)operator(\)\);) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -ident(VALUE) ident(ruby_dln_librefs)operator(;) -directive(static) ident(VALUE) ident(rb_features)operator(;) -directive(static) ident(st_table) operator(*)ident(loading_tbl)operator(;) - -preprocessor(#define) ident(IS_SOEXT)operator(()ident(e)operator(\)) operator(()ident(strcmp)operator(()ident(e)operator(,) stringoperator(\)) operator(==) integer(0) operator(||) ident(strcmp)operator(()ident(e)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) -preprocessor(#ifdef) ident(DLEXT2) -preprocessor(#define) ident(IS_DLEXT)operator(()ident(e)operator(\)) operator(()ident(strcmp)operator(()ident(e)operator(,) ident(DLEXT)operator(\)) operator(==) integer(0) operator(||) ident(strcmp)operator(()ident(e)operator(,) ident(DLEXT2)operator(\)) operator(==) integer(0)operator(\)) -preprocessor(#else) -preprocessor(#define) ident(IS_DLEXT)operator(()ident(e)operator(\)) operator(()ident(strcmp)operator(()ident(e)operator(,) ident(DLEXT)operator(\)) operator(==) integer(0)operator(\)) -preprocessor(#endif) - - -directive(static) directive(const) pre_type(char) operator(*)directive(const) ident(loadable_ext)operator([]) operator(=) operator({) - stringoperator(,) ident(DLEXT)operator(,) -preprocessor(#ifdef) ident(DLEXT2) - ident(DLEXT2)operator(,) -preprocessor(#endif) - integer(0) -operator(};) - -directive(static) pre_type(int) ident(rb_feature_p) ident(_)operator((()directive(const) pre_type(char) operator(**,) directive(const) pre_type(char) operator(*,) pre_type(int)operator(\)\);) -directive(static) pre_type(int) ident(search_required) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE) operator(*,) ident(VALUE) operator(*\)\);) - -directive(static) pre_type(int) -ident(rb_feature_p)operator(()ident(ftptr)operator(,) ident(ext)operator(,) ident(rb)operator(\)) - directive(const) pre_type(char) operator(**)ident(ftptr)operator(,) operator(*)ident(ext)operator(;) - pre_type(int) ident(rb)operator(;) -operator({) - ident(VALUE) ident(v)operator(;) - directive(const) pre_type(char) operator(*)ident(f)operator(,) operator(*)ident(e)operator(,) operator(*)ident(feature) operator(=) operator(*)ident(ftptr)operator(;) - pre_type(long) ident(i)operator(,) ident(len)operator(,) ident(elen)operator(;) - - reserved(if) operator(()ident(ext)operator(\)) operator({) - ident(len) operator(=) ident(ext) operator(-) ident(feature)operator(;) - ident(elen) operator(=) ident(strlen)operator(()ident(ext)operator(\);) - operator(}) - reserved(else) operator({) - ident(len) operator(=) ident(strlen)operator(()ident(feature)operator(\);) - ident(elen) operator(=) integer(0)operator(;) - operator(}) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(RARRAY_LEN)operator(()ident(rb_features)operator(\);) operator(++)ident(i)operator(\)) operator({) - ident(v) operator(=) ident(RARRAY_PTR)operator(()ident(rb_features)operator(\)[)ident(i)operator(];) - ident(f) operator(=) ident(StringValuePtr)operator(()ident(v)operator(\);) - reserved(if) operator(()ident(RSTRING_LEN)operator(()ident(v)operator(\)) operator(<) ident(len) operator(||) ident(strncmp)operator(()ident(f)operator(,) ident(feature)operator(,) ident(len)operator(\)) operator(!=) integer(0)operator(\)) - reserved(continue)operator(;) - reserved(if) operator((!*()ident(e) operator(=) ident(f) operator(+) ident(len)operator(\)\)) operator({) - reserved(if) operator(()ident(ext)operator(\)) reserved(continue)operator(;) - operator(*)ident(ftptr) operator(=) integer(0)operator(;) - reserved(return) char('u')operator(;) - operator(}) - reserved(if) operator((*)ident(e) operator(!=) char('.')operator(\)) reserved(continue)operator(;) - reserved(if) operator(((!)ident(rb) operator(||) operator(!)ident(ext)operator(\)) operator(&&) operator(()ident(IS_SOEXT)operator(()ident(e)operator(\)) operator(||) ident(IS_DLEXT)operator(()ident(e)operator(\)\)\)) operator({) - operator(*)ident(ftptr) operator(=) integer(0)operator(;) - reserved(return) char('s')operator(;) - operator(}) - reserved(if) operator((()ident(rb) operator(||) operator(!)ident(ext)operator(\)) operator(&&) operator(()ident(strcmp)operator(()ident(e)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)\)) operator({) - operator(*)ident(ftptr) operator(=) integer(0)operator(;) - reserved(return) char('r')operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(loading_tbl)operator(\)) operator({) - reserved(if) operator(()ident(st_lookup)operator(()ident(loading_tbl)operator(,) operator(()ident(st_data_t)operator(\))ident(feature)operator(,) operator(()ident(st_data_t) operator(*\))ident(ftptr)operator(\)\)) operator({) - reserved(if) operator((!)ident(ext)operator(\)) reserved(return) char('u')operator(;) - reserved(return) ident(strcmp)operator(()ident(ext)operator(,) stringoperator(\)) operator(?) char('s') operator(:) char('r')operator(;) - operator(}) - reserved(else) operator({) - pre_type(char) operator(*)ident(buf)operator(;) - - reserved(if) operator(()ident(ext) operator(&&) operator(*)ident(ext)operator(\)) reserved(return) integer(0)operator(;) - ident(buf) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(len) operator(+) ident(DLEXT_MAXLEN) operator(+) integer(1)operator(\);) - ident(MEMCPY)operator(()ident(buf)operator(,) ident(feature)operator(,) pre_type(char)operator(,) ident(len)operator(\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) operator(()ident(e) operator(=) ident(loadable_ext)operator([)ident(i)operator(]\)) operator(!=) integer(0)operator(;) ident(i)operator(++\)) operator({) - ident(strncpy)operator(()ident(buf) operator(+) ident(len)operator(,) ident(e)operator(,) ident(DLEXT_MAXLEN) operator(+) integer(1)operator(\);) - reserved(if) operator(()ident(st_lookup)operator(()ident(loading_tbl)operator(,) operator(()ident(st_data_t)operator(\))ident(buf)operator(,) operator(()ident(st_data_t) operator(*\))ident(ftptr)operator(\)\)) operator({) - reserved(return) ident(i) operator(?) char('s') operator(:) char('r')operator(;) - operator(}) - operator(}) - operator(}) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) -preprocessor(#define) ident(rb_feature_p)operator(()ident(feature)operator(,) ident(ext)operator(,) ident(rb)operator(\)) ident(rb_feature_p)operator((&)ident(feature)operator(,) ident(ext)operator(,) ident(rb)operator(\)) - -pre_type(int) -ident(rb_provided)operator(()ident(feature)operator(\)) - directive(const) pre_type(char) operator(*)ident(feature)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(ext) operator(=) ident(strrchr)operator(()ident(feature)operator(,) char('.')operator(\);) - - reserved(if) operator(()ident(ext) operator(&&) operator(!)ident(strchr)operator(()ident(ext)operator(,) char('/')operator(\)\)) operator({) - reserved(if) operator(()ident(strcmp)operator(()stringoperator(,) ident(ext)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(rb_feature_p)operator(()ident(feature)operator(,) ident(ext)operator(,) ident(Qtrue)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(IS_SOEXT)operator(()ident(ext)operator(\)) operator(||) ident(IS_DLEXT)operator(()ident(ext)operator(\)\)) operator({) - reserved(if) operator(()ident(rb_feature_p)operator(()ident(feature)operator(,) ident(ext)operator(,) ident(Qfalse)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(rb_feature_p)operator(()ident(feature)operator(,) ident(feature) operator(+) ident(strlen)operator(()ident(feature)operator(\),) ident(Qtrue)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) directive(void) -ident(rb_provide_feature)operator(()ident(feature)operator(\)) - ident(VALUE) ident(feature)operator(;) -operator({) - ident(rb_ary_push)operator(()ident(rb_features)operator(,) ident(feature)operator(\);) -operator(}) - -directive(void) -ident(rb_provide)operator(()ident(feature)operator(\)) - directive(const) pre_type(char) operator(*)ident(feature)operator(;) -operator({) - ident(rb_provide_feature)operator(()ident(rb_str_new2)operator(()ident(feature)operator(\)\);) -operator(}) - -directive(static) pre_type(char) operator(*) -ident(load_lock)operator(()ident(ftptr)operator(\)) - directive(const) pre_type(char) operator(*)ident(ftptr)operator(;) -operator({) - ident(st_data_t) ident(th)operator(;) - - reserved(if) operator((!)ident(loading_tbl) operator(||) - operator(!)ident(st_lookup)operator(()ident(loading_tbl)operator(,) operator(()ident(st_data_t)operator(\))ident(ftptr)operator(,) operator(&)ident(th)operator(\)\)) - operator({) - comment(/* loading ruby library should be serialized. */) - reserved(if) operator((!)ident(loading_tbl)operator(\)) operator({) - ident(loading_tbl) operator(=) ident(st_init_strtable)operator((\);) - operator(}) - comment(/* partial state */) - ident(ftptr) operator(=) ident(ruby_strdup)operator(()ident(ftptr)operator(\);) - ident(st_insert)operator(()ident(loading_tbl)operator(,) operator(()ident(st_data_t)operator(\))ident(ftptr)operator(,) operator(()ident(st_data_t)operator(\))ident(curr_thread)operator(\);) - reserved(return) operator(()pre_type(char) operator(*\))ident(ftptr)operator(;) - operator(}) - reserved(do) operator({) - ident(rb_thread_t) ident(owner) operator(=) operator(()ident(rb_thread_t)operator(\))ident(th)operator(;) - reserved(if) operator(()ident(owner) operator(==) ident(curr_thread)operator(\)) reserved(return) integer(0)operator(;) - ident(rb_thread_join)operator(()ident(owner)operator(->)ident(thread)operator(,) operator(-)float(1)float(.0)operator(\);) - operator(}) reserved(while) operator(()ident(st_lookup)operator(()ident(loading_tbl)operator(,) operator(()ident(st_data_t)operator(\))ident(ftptr)operator(,) operator(&)ident(th)operator(\)\);) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) directive(void) -ident(load_unlock)operator(()directive(const) pre_type(char) operator(*)ident(ftptr)operator(\)) -operator({) - reserved(if) operator(()ident(ftptr)operator(\)) operator({) - ident(st_data_t) ident(key) operator(=) operator(()ident(st_data_t)operator(\))ident(ftptr)operator(;) - - reserved(if) operator(()ident(st_delete)operator(()ident(loading_tbl)operator(,) operator(&)ident(key)operator(,) integer(0)operator(\)\)) operator({) - ident(free)operator((()pre_type(char) operator(*\))ident(key)operator(\);) - operator(}) - operator(}) -operator(}) - -comment(/* - * call-seq: - * require(string\) => true or false - * - * Ruby tries to load the library named _string_, returning - * +true+ if successful. If the filename does not resolve to - * an absolute path, it will be searched for in the directories listed - * in $:. If the file has the extension ``.rb'', it is - * loaded as a source file; if the extension is ``.so'', ``.o'', or - * ``.dll'', or whatever the default shared library extension is on - * the current platform, Ruby loads the shared library as a Ruby - * extension. Otherwise, Ruby tries adding ``.rb'', ``.so'', and so on - * to the name. The name of the loaded feature is added to the array in - * $". A feature will not be loaded if it's name already - * appears in $". However, the file name is not converted - * to an absolute path, so that ``require 'a';require - * './a''' will load a.rb twice. - * - * require "my-library.rb" - * require "db-driver" - */) - -ident(VALUE) -ident(rb_f_require)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - reserved(return) ident(rb_require_safe)operator(()ident(fname)operator(,) ident(ruby_safe_level)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(search_required)operator(()ident(fname)operator(,) ident(featurep)operator(,) ident(path)operator(\)) - ident(VALUE) ident(fname)operator(,) operator(*)ident(featurep)operator(,) operator(*)ident(path)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(;) - directive(const) pre_type(char) operator(*)ident(ext)operator(,) operator(*)ident(ftptr)operator(;) - pre_type(int) ident(type)operator(;) - - operator(*)ident(featurep) operator(=) ident(fname)operator(;) - operator(*)ident(path) operator(=) integer(0)operator(;) - ident(ext) operator(=) ident(strrchr)operator(()ident(ftptr) operator(=) ident(RSTRING_PTR)operator(()ident(fname)operator(\),) char('.')operator(\);) - reserved(if) operator(()ident(ext) operator(&&) operator(!)ident(strchr)operator(()ident(ext)operator(,) char('/')operator(\)\)) operator({) - reserved(if) operator(()ident(strcmp)operator(()stringoperator(,) ident(ext)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(rb_feature_p)operator(()ident(ftptr)operator(,) ident(ext)operator(,) ident(Qtrue)operator(\)\)) operator({) - reserved(if) operator(()ident(ftptr)operator(\)) operator(*)ident(path) operator(=) ident(rb_str_new2)operator(()ident(ftptr)operator(\);) - reserved(return) char('r')operator(;) - operator(}) - reserved(if) operator(((*)ident(path) operator(=) ident(rb_find_file)operator(()ident(fname)operator(\)\)) operator(!=) integer(0)operator(\)) reserved(return) char('r')operator(;) - reserved(return) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(IS_SOEXT)operator(()ident(ext)operator(\)\)) operator({) - reserved(if) operator(()ident(rb_feature_p)operator(()ident(ftptr)operator(,) ident(ext)operator(,) ident(Qfalse)operator(\)\)) operator({) - reserved(if) operator(()ident(ftptr)operator(\)) operator(*)ident(path) operator(=) ident(rb_str_new2)operator(()ident(ftptr)operator(\);) - reserved(return) char('s')operator(;) - operator(}) - ident(tmp) operator(=) ident(rb_str_new)operator(()ident(RSTRING_PTR)operator(()ident(fname)operator(\),) ident(ext)operator(-)ident(RSTRING_PTR)operator(()ident(fname)operator(\)\);) - operator(*)ident(featurep) operator(=) ident(tmp)operator(;) -preprocessor(#ifdef) ident(DLEXT2) - ident(OBJ_FREEZE)operator(()ident(tmp)operator(\);) - reserved(if) operator(()ident(rb_find_file_ext)operator((&)ident(tmp)operator(,) ident(loadable_ext)operator(+)integer(1)operator(\)\)) operator({) - operator(*)ident(featurep) operator(=) ident(tmp)operator(;) - operator(*)ident(path) operator(=) ident(rb_find_file)operator(()ident(tmp)operator(\);) - reserved(return) char('s')operator(;) - operator(}) -preprocessor(#else) - ident(rb_str_cat2)operator(()ident(tmp)operator(,) ident(DLEXT)operator(\);) - ident(OBJ_FREEZE)operator(()ident(tmp)operator(\);) - reserved(if) operator(((*)ident(path) operator(=) ident(rb_find_file)operator(()ident(tmp)operator(\)\)) operator(!=) integer(0)operator(\)) operator({) - reserved(return) char('s')operator(;) - operator(}) -preprocessor(#endif) - operator(}) - reserved(else) reserved(if) operator(()ident(IS_DLEXT)operator(()ident(ext)operator(\)\)) operator({) - reserved(if) operator(()ident(rb_feature_p)operator(()ident(ftptr)operator(,) ident(ext)operator(,) ident(Qfalse)operator(\)\)) operator({) - reserved(if) operator(()ident(ftptr)operator(\)) operator(*)ident(path) operator(=) ident(rb_str_new2)operator(()ident(ftptr)operator(\);) - reserved(return) char('s')operator(;) - operator(}) - reserved(if) operator(((*)ident(path) operator(=) ident(rb_find_file)operator(()ident(fname)operator(\)\)) operator(!=) integer(0)operator(\)) reserved(return) char('s')operator(;) - operator(}) - operator(}) - ident(tmp) operator(=) ident(fname)operator(;) - ident(type) operator(=) ident(rb_find_file_ext)operator((&)ident(tmp)operator(,) ident(loadable_ext)operator(\);) - operator(*)ident(featurep) operator(=) ident(tmp)operator(;) - reserved(switch) operator(()ident(type)operator(\)) operator({) - reserved(case) integer(0)operator(:) - ident(type) operator(=) ident(rb_feature_p)operator(()ident(ftptr)operator(,) integer(0)operator(,) ident(Qfalse)operator(\);) - reserved(if) operator(()ident(type) operator(&&) ident(ftptr)operator(\)) operator(*)ident(path) operator(=) ident(rb_str_new2)operator(()ident(ftptr)operator(\);) - reserved(return) ident(type)operator(;) - - reserved(default)operator(:) - ident(ext) operator(=) ident(strrchr)operator(()ident(ftptr) operator(=) ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator(,) char('.')operator(\);) - reserved(if) operator((!)ident(rb_feature_p)operator(()ident(ftptr)operator(,) ident(ext)operator(,) operator(!--)ident(type)operator(\)\)) - operator(*)ident(path) operator(=) ident(rb_find_file)operator(()ident(tmp)operator(\);) - reserved(else) reserved(if) operator(()ident(ftptr)operator(\)) - operator(*)ident(path) operator(=) ident(rb_str_new2)operator(()ident(ftptr)operator(\);) - operator(}) - reserved(return) ident(type) operator(?) char('s') operator(:) char('r')operator(;) -operator(}) - -directive(static) directive(void) -ident(load_failed)operator(()ident(fname)operator(\)) - ident(VALUE) ident(fname)operator(;) -operator({) - ident(rb_raise)operator(()ident(rb_eLoadError)operator(,) stringoperator(,) ident(RSTRING)operator(()ident(fname)operator(\)->)ident(ptr)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_require_safe)operator(()ident(fname)operator(,) ident(safe)operator(\)) - ident(VALUE) ident(fname)operator(;) - pre_type(int) ident(safe)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) - directive(volatile) ident(VALUE) ident(errinfo) operator(=) ident(ruby_errinfo)operator(;) - pre_type(int) ident(state)operator(;) - reserved(struct) operator({) - ident(NODE) operator(*)ident(node)operator(;) - ident(ID) ident(func)operator(;) - pre_type(int) ident(vmode)operator(,) ident(safe)operator(;) - operator(}) directive(volatile) ident(saved)operator(;) - pre_type(char) operator(*)directive(volatile) ident(ftptr) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(fname)operator(\)\)) operator({) - ident(rb_check_safe_obj)operator(()ident(fname)operator(\);) - operator(}) - ident(StringValue)operator(()ident(fname)operator(\);) - ident(fname) operator(=) ident(rb_str_new4)operator(()ident(fname)operator(\);) - ident(saved)operator(.)ident(vmode) operator(=) ident(scope_vmode)operator(;) - ident(saved)operator(.)ident(node) operator(=) ident(ruby_current_node)operator(;) - ident(saved)operator(.)ident(func) operator(=) ident(ruby_frame)operator(->)ident(last_func)operator(;) - ident(saved)operator(.)ident(safe) operator(=) ident(ruby_safe_level)operator(;) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(VALUE) ident(feature)operator(,) ident(path)operator(;) - pre_type(long) ident(handle)operator(;) - pre_type(int) ident(found)operator(;) - - ident(ruby_safe_level) operator(=) ident(safe)operator(;) - ident(found) operator(=) ident(search_required)operator(()ident(fname)operator(,) operator(&)ident(feature)operator(,) operator(&)ident(path)operator(\);) - reserved(if) operator(()ident(found)operator(\)) operator({) - reserved(if) operator((!)ident(path) operator(||) operator(!()ident(ftptr) operator(=) ident(load_lock)operator(()ident(RSTRING_PTR)operator(()ident(feature)operator(\)\)\)\)) operator({) - ident(result) operator(=) ident(Qfalse)operator(;) - operator(}) - reserved(else) operator({) - ident(ruby_safe_level) operator(=) integer(0)operator(;) - reserved(switch) operator(()ident(found)operator(\)) operator({) - reserved(case) char('r')operator(:) - ident(rb_load)operator(()ident(path)operator(,) integer(0)operator(\);) - reserved(break)operator(;) - - reserved(case) char('s')operator(:) - ident(ruby_current_node) operator(=) integer(0)operator(;) - ident(ruby_sourcefile) operator(=) ident(rb_source_filename)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\);) - ident(ruby_sourceline) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(last_func) operator(=) integer(0)operator(;) - ident(SCOPE_SET)operator(()ident(SCOPE_PUBLIC)operator(\);) - ident(handle) operator(=) operator(()pre_type(long)operator(\))ident(dln_load)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\);) - ident(rb_ary_push)operator(()ident(ruby_dln_librefs)operator(,) ident(LONG2NUM)operator(()ident(handle)operator(\)\);) - reserved(break)operator(;) - operator(}) - ident(rb_provide_feature)operator(()ident(feature)operator(\);) - ident(result) operator(=) ident(Qtrue)operator(;) - operator(}) - operator(}) - operator(}) - ident(POP_TAG)operator((\);) - ident(ruby_current_node) operator(=) ident(saved)operator(.)ident(node)operator(;) - ident(ruby_set_current_source)operator((\);) - ident(ruby_frame)operator(->)ident(last_func) operator(=) ident(saved)operator(.)ident(func)operator(;) - ident(SCOPE_SET)operator(()ident(saved)operator(.)ident(vmode)operator(\);) - ident(ruby_safe_level) operator(=) ident(saved)operator(.)ident(safe)operator(;) - ident(load_unlock)operator(()ident(ftptr)operator(\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(result)operator(\)\)) operator({) - ident(load_failed)operator(()ident(fname)operator(\);) - operator(}) - ident(ruby_errinfo) operator(=) ident(errinfo)operator(;) - - reserved(return) ident(result)operator(;) -operator(}) - -ident(VALUE) -ident(rb_require)operator(()ident(fname)operator(\)) - directive(const) pre_type(char) operator(*)ident(fname)operator(;) -operator({) - ident(VALUE) ident(fn) operator(=) ident(rb_str_new2)operator(()ident(fname)operator(\);) - ident(OBJ_FREEZE)operator(()ident(fn)operator(\);) - reserved(return) ident(rb_require_safe)operator(()ident(fn)operator(,) ident(ruby_safe_level)operator(\);) -operator(}) - -directive(void) -ident(ruby_init_ext)operator(()ident(name)operator(,) ident(init)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - directive(void) operator((*)ident(init)operator(\)) ident(_)operator((()directive(void)operator(\)\);) -operator({) - ident(ruby_current_node) operator(=) integer(0)operator(;) - ident(ruby_sourcefile) operator(=) ident(rb_source_filename)operator(()ident(name)operator(\);) - ident(ruby_sourceline) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(last_func) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(orig_func) operator(=) integer(0)operator(;) - ident(SCOPE_SET)operator(()ident(SCOPE_PUBLIC)operator(\);) - reserved(if) operator(()ident(load_lock)operator(()ident(name)operator(\)\)) operator({) - operator((*)ident(init)operator(\)(\);) - ident(rb_provide)operator(()ident(name)operator(\);) - ident(load_unlock)operator(()ident(name)operator(\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(secure_visibility)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4) operator(&&) operator(!)ident(OBJ_TAINTED)operator(()ident(self)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(set_method_visibility)operator(()ident(self)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(ex)operator(\)) - ident(VALUE) ident(self)operator(;) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(ID) ident(ex)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - ident(secure_visibility)operator(()ident(self)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(rb_export_method)operator(()ident(self)operator(,) ident(rb_to_id)operator(()ident(argv)operator([)ident(i)operator(]\),) ident(ex)operator(\);) - operator(}) - ident(rb_clear_cache_by_class)operator(()ident(self)operator(\);) -operator(}) - -comment(/* - * call-seq: - * public => self - * public(symbol, ...\) => self - * - * With no arguments, sets the default visibility for subsequently - * defined methods to public. With arguments, sets the named methods to - * have public visibility. - */) - -directive(static) ident(VALUE) -ident(rb_mod_public)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(module)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(module)operator(;) -operator({) - ident(secure_visibility)operator(()ident(module)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(SCOPE_SET)operator(()ident(SCOPE_PUBLIC)operator(\);) - operator(}) - reserved(else) operator({) - ident(set_method_visibility)operator(()ident(module)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(NOEX_PUBLIC)operator(\);) - operator(}) - reserved(return) ident(module)operator(;) -operator(}) - -comment(/* - * call-seq: - * protected => self - * protected(symbol, ...\) => self - * - * With no arguments, sets the default visibility for subsequently - * defined methods to protected. With arguments, sets the named methods - * to have protected visibility. - */) - -directive(static) ident(VALUE) -ident(rb_mod_protected)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(module)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(module)operator(;) -operator({) - ident(secure_visibility)operator(()ident(module)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(SCOPE_SET)operator(()ident(SCOPE_PROTECTED)operator(\);) - operator(}) - reserved(else) operator({) - ident(set_method_visibility)operator(()ident(module)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(NOEX_PROTECTED)operator(\);) - operator(}) - reserved(return) ident(module)operator(;) -operator(}) - -comment(/* - * call-seq: - * private => self - * private(symbol, ...\) => self - * - * With no arguments, sets the default visibility for subsequently - * defined methods to private. With arguments, sets the named methods - * to have private visibility. - * - * module Mod - * def a(\) end - * def b(\) end - * private - * def c(\) end - * private :a - * end - * Mod.private_instance_methods #=> ["a", "c"] - */) - -directive(static) ident(VALUE) -ident(rb_mod_private)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(module)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(module)operator(;) -operator({) - ident(secure_visibility)operator(()ident(module)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(SCOPE_SET)operator(()ident(SCOPE_PRIVATE)operator(\);) - operator(}) - reserved(else) operator({) - ident(set_method_visibility)operator(()ident(module)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(NOEX_PRIVATE)operator(\);) - operator(}) - reserved(return) ident(module)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.public_class_method(symbol, ...\) => mod - * - * Makes a list of existing class methods public. - */) - -directive(static) ident(VALUE) -ident(rb_mod_public_method)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(set_method_visibility)operator(()ident(CLASS_OF)operator(()ident(obj)operator(\),) ident(argc)operator(,) ident(argv)operator(,) ident(NOEX_PUBLIC)operator(\);) - reserved(return) ident(obj)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.private_class_method(symbol, ...\) => mod - * - * Makes existing class methods private. Often used to hide the default - * constructor new. - * - * class SimpleSingleton # Not thread safe - * private_class_method :new - * def SimpleSingleton.create(*args, &block\) - * @me = new(*args, &block\) if ! @me - * @me - * end - * end - */) - -directive(static) ident(VALUE) -ident(rb_mod_private_method)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(set_method_visibility)operator(()ident(CLASS_OF)operator(()ident(obj)operator(\),) ident(argc)operator(,) ident(argv)operator(,) ident(NOEX_PRIVATE)operator(\);) - reserved(return) ident(obj)operator(;) -operator(}) - -comment(/* - * call-seq: - * public - * public(symbol, ...\) - * - * With no arguments, sets the default visibility for subsequently - * defined methods to public. With arguments, sets the named methods to - * have public visibility. - */) - -directive(static) ident(VALUE) -ident(top_public)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(return) ident(rb_mod_public)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(rb_cObject)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(top_private)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(return) ident(rb_mod_private)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(rb_cObject)operator(\);) -operator(}) - -comment(/* - * call-seq: - * module_function(symbol, ...\) => self - * - * Creates module functions for the named methods. These functions may - * be called with the module as a receiver, and also become available - * as instance methods to classes that mix in the module. Module - * functions are copies of the original, and so may be changed - * independently. The instance-method versions are made private. If - * used with no arguments, subsequently defined methods become module - * functions. - * - * module Mod - * def one - * "This is one" - * end - * module_function :one - * end - * class Cls - * include Mod - * def callOne - * one - * end - * end - * Mod.one #=> "This is one" - * c = Cls.new - * c.callOne #=> "This is one" - * module Mod - * def one - * "This is the new one" - * end - * end - * Mod.one #=> "This is one" - * c.callOne #=> "This is the new one" - */) - -directive(static) ident(VALUE) -ident(rb_mod_modfunc)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(module)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(module)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - ident(ID) ident(id)operator(;) - ident(NODE) operator(*)ident(body)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(module)operator(\)) operator(!=) ident(T_MODULE)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - - ident(secure_visibility)operator(()ident(module)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(SCOPE_SET)operator(()ident(SCOPE_MODFUNC)operator(\);) - reserved(return) ident(module)operator(;) - operator(}) - - ident(set_method_visibility)operator(()ident(module)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(NOEX_PRIVATE)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(m) operator(=) ident(module)operator(;) - - ident(id) operator(=) ident(rb_to_id)operator(()ident(argv)operator([)ident(i)operator(]\);) - reserved(for) operator((;;\)) operator({) - ident(body) operator(=) ident(search_method)operator(()ident(m)operator(,) ident(id)operator(,) operator(&)ident(m)operator(\);) - reserved(if) operator(()ident(body) operator(==) integer(0)operator(\)) operator({) - ident(body) operator(=) ident(search_method)operator(()ident(rb_cObject)operator(,) ident(id)operator(,) operator(&)ident(m)operator(\);) - operator(}) - reserved(if) operator(()ident(body) operator(==) integer(0) operator(||) ident(body)operator(->)ident(nd_body) operator(==) integer(0)operator(\)) operator({) - ident(print_undef)operator(()ident(module)operator(,) ident(id)operator(\);) - operator(}) - reserved(if) operator(()ident(nd_type)operator(()ident(body)operator(->)ident(nd_body)operator(\)) operator(!=) ident(NODE_ZSUPER)operator(\)) operator({) - reserved(break)operator(;) comment(/* normal case: need not to follow 'super' link */) - operator(}) - ident(m) operator(=) ident(RCLASS)operator(()ident(m)operator(\)->)ident(super)operator(;) - reserved(if) operator((!)ident(m)operator(\)) reserved(break)operator(;) - operator(}) - ident(rb_add_method)operator(()ident(rb_singleton_class)operator(()ident(module)operator(\),) ident(id)operator(,) ident(body)operator(->)ident(nd_body)operator(,) ident(NOEX_PUBLIC)operator(\);) - operator(}) - reserved(return) ident(module)operator(;) -operator(}) - -comment(/* - * call-seq: - * append_features(mod\) => mod - * - * When this module is included in another, Ruby calls - * append_features in this module, passing it the - * receiving module in _mod_. Ruby's default implementation is - * to add the constants, methods, and module variables of this module - * to _mod_ if this module has not already been added to - * _mod_ or one of its ancestors. See also Module#include. - */) - -directive(static) ident(VALUE) -ident(rb_mod_append_features)operator(()ident(module)operator(,) ident(include)operator(\)) - ident(VALUE) ident(module)operator(,) ident(include)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(include)operator(\)\)) operator({) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - reserved(break)operator(;) - reserved(default)operator(:) - ident(Check_Type)operator(()ident(include)operator(,) ident(T_CLASS)operator(\);) - reserved(break)operator(;) - operator(}) - ident(rb_include_module)operator(()ident(include)operator(,) ident(module)operator(\);) - - reserved(return) ident(module)operator(;) -operator(}) - -comment(/* - * call-seq: - * include(module, ...\) => self - * - * Invokes Module.append_features on each parameter in turn. - */) - -directive(static) ident(VALUE) -ident(rb_mod_include)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(module)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(module)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) ident(Check_Type)operator(()ident(argv)operator([)ident(i)operator(],) ident(T_MODULE)operator(\);) - reserved(while) operator(()ident(argc)operator(--\)) operator({) - ident(rb_funcall)operator(()ident(argv)operator([)ident(argc)operator(],) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(module)operator(\);) - ident(rb_funcall)operator(()ident(argv)operator([)ident(argc)operator(],) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(module)operator(\);) - operator(}) - reserved(return) ident(module)operator(;) -operator(}) - -directive(void) -ident(rb_obj_call_init)operator(()ident(obj)operator(,) ident(argc)operator(,) ident(argv)operator(\)) - ident(VALUE) ident(obj)operator(;) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(PUSH_ITER)operator(()ident(rb_block_given_p)operator((\)?)ident(ITER_PRE)operator(:)ident(ITER_NOT)operator(\);) - ident(rb_funcall2)operator(()ident(obj)operator(,) ident(init)operator(,) ident(argc)operator(,) ident(argv)operator(\);) - ident(POP_ITER)operator((\);) -operator(}) - -directive(void) -ident(rb_extend_object)operator(()ident(obj)operator(,) ident(module)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(module)operator(;) -operator({) - ident(rb_include_module)operator(()ident(rb_singleton_class)operator(()ident(obj)operator(\),) ident(module)operator(\);) -operator(}) - -comment(/* - * call-seq: - * extend_object(obj\) => obj - * - * Extends the specified object by adding this module's constants and - * methods (which are added as singleton methods\). This is the callback - * method used by Object#extend. - * - * module Picky - * def Picky.extend_object(o\) - * if String === o - * puts "Can't add Picky to a String" - * else - * puts "Picky added to #{o.class}" - * super - * end - * end - * end - * (s = Array.new\).extend Picky # Call Object.extend - * (s = "quick brown fox"\).extend Picky - * - * produces: - * - * Picky added to Array - * Can't add Picky to a String - */) - -directive(static) ident(VALUE) -ident(rb_mod_extend_object)operator(()ident(mod)operator(,) ident(obj)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(obj)operator(;) -operator({) - ident(rb_extend_object)operator(()ident(obj)operator(,) ident(mod)operator(\);) - reserved(return) ident(obj)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.extend(module, ...\) => obj - * - * Adds to _obj_ the instance methods from each module given as a - * parameter. - * - * module Mod - * def hello - * "Hello from Mod.\\n" - * end - * end - * - * class Klass - * def hello - * "Hello from Klass.\\n" - * end - * end - * - * k = Klass.new - * k.hello #=> "Hello from Klass.\\n" - * k.extend(Mod\) #=> # - * k.hello #=> "Hello from Mod.\\n" - */) - -directive(static) ident(VALUE) -ident(rb_obj_extend)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) ident(Check_Type)operator(()ident(argv)operator([)ident(i)operator(],) ident(T_MODULE)operator(\);) - reserved(while) operator(()ident(argc)operator(--\)) operator({) - ident(rb_funcall)operator(()ident(argv)operator([)ident(argc)operator(],) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(obj)operator(\);) - ident(rb_funcall)operator(()ident(argv)operator([)ident(argc)operator(],) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(obj)operator(\);) - operator(}) - reserved(return) ident(obj)operator(;) -operator(}) - -comment(/* - * call-seq: - * include(module, ...\) => self - * - * Invokes Module.append_features - * on each parameter in turn. Effectively adds the methods and constants - * in each module to the receiver. - */) - -directive(static) ident(VALUE) -ident(top_include)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(ruby_wrapper)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(\);) - reserved(return) ident(rb_mod_include)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(ruby_wrapper)operator(\);) - operator(}) - reserved(return) ident(rb_mod_include)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(rb_cObject)operator(\);) -operator(}) - -ident(VALUE) ident(rb_f_trace_var)operator((\);) -ident(VALUE) ident(rb_f_untrace_var)operator((\);) - -directive(static) directive(void) -ident(errinfo_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(var)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) operator(*)ident(var)operator(;) -operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(val)operator(\)) operator(&&) operator(!)ident(rb_obj_is_kind_of)operator(()ident(val)operator(,) ident(rb_eException)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - operator(*)ident(var) operator(=) ident(val)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(errat_getter)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(return) ident(get_backtrace)operator(()ident(ruby_errinfo)operator(\);) -operator(}) - -directive(static) directive(void) -ident(errat_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(var)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) operator(*)ident(var)operator(;) -operator({) - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_errinfo)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(set_backtrace)operator(()ident(ruby_errinfo)operator(,) ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * local_variables => array - * - * Returns the names of the current local variables. - * - * fred = 1 - * for i in 1..10 - * # ... - * end - * local_variables #=> ["fred", "i"] - */) - -directive(static) ident(VALUE) -ident(rb_f_local_variables)operator((\)) -operator({) - ident(ID) operator(*)ident(tbl)operator(;) - pre_type(int) ident(n)operator(,) ident(i)operator(;) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - reserved(struct) ident(RVarmap) operator(*)ident(vars)operator(;) - - ident(tbl) operator(=) ident(ruby_scope)operator(->)ident(local_tbl)operator(;) - reserved(if) operator(()ident(tbl)operator(\)) operator({) - ident(n) operator(=) operator(*)ident(tbl)operator(++;) - reserved(for) operator(()ident(i)operator(=)integer(2)operator(;) ident(i)operator(<)ident(n)operator(;) ident(i)operator(++\)) operator({) comment(/* skip first 2 ($_ and $~\) */) - reserved(if) operator((!)ident(rb_is_local_id)operator(()ident(tbl)operator([)ident(i)operator(]\)\)) reserved(continue)operator(;) comment(/* skip flip states */) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(tbl)operator([)ident(i)operator(]\)\)\);) - operator(}) - operator(}) - - ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) - reserved(while) operator(()ident(vars)operator(\)) operator({) - reserved(if) operator(()ident(vars)operator(->)ident(id) operator(&&) ident(rb_is_local_id)operator(()ident(vars)operator(->)ident(id)operator(\)\)) operator({) comment(/* skip $_, $~ and flip states */) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(vars)operator(->)ident(id)operator(\)\)\);) - operator(}) - ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(;) - operator(}) - - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(rb_f_catch) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) -ident(NORETURN)operator(()directive(static) ident(VALUE) ident(rb_f_throw) ident(_)operator((()pre_type(int)operator(,)ident(VALUE)operator(*\)\)\);) - -reserved(struct) ident(end_proc_data) operator({) - directive(void) operator((*)ident(func)operator(\)(\);) - ident(VALUE) ident(data)operator(;) - pre_type(int) ident(safe)operator(;) - reserved(struct) ident(end_proc_data) operator(*)ident(next)operator(;) -operator(};) - -directive(static) reserved(struct) ident(end_proc_data) operator(*)ident(end_procs)operator(,) operator(*)ident(ephemeral_end_procs)operator(,) operator(*)ident(tmp_end_procs)operator(;) - -directive(void) -ident(rb_set_end_proc)operator(()ident(func)operator(,) ident(data)operator(\)) - directive(void) operator((*)ident(func)operator(\)) ident(_)operator((()ident(VALUE)operator(\)\);) - ident(VALUE) ident(data)operator(;) -operator({) - reserved(struct) ident(end_proc_data) operator(*)ident(link) operator(=) ident(ALLOC)operator(()reserved(struct) ident(end_proc_data)operator(\);) - reserved(struct) ident(end_proc_data) operator(**)ident(list)operator(;) - - reserved(if) operator(()ident(ruby_wrapper)operator(\)) ident(list) operator(=) operator(&)ident(ephemeral_end_procs)operator(;) - reserved(else) ident(list) operator(=) operator(&)ident(end_procs)operator(;) - ident(link)operator(->)ident(next) operator(=) operator(*)ident(list)operator(;) - ident(link)operator(->)ident(func) operator(=) ident(func)operator(;) - ident(link)operator(->)ident(data) operator(=) ident(data)operator(;) - ident(link)operator(->)ident(safe) operator(=) ident(ruby_safe_level)operator(;) - operator(*)ident(list) operator(=) ident(link)operator(;) -operator(}) - -directive(void) -ident(rb_mark_end_proc)operator((\)) -operator({) - reserved(struct) ident(end_proc_data) operator(*)ident(link)operator(;) - - ident(link) operator(=) ident(end_procs)operator(;) - reserved(while) operator(()ident(link)operator(\)) operator({) - ident(rb_gc_mark)operator(()ident(link)operator(->)ident(data)operator(\);) - ident(link) operator(=) ident(link)operator(->)ident(next)operator(;) - operator(}) - ident(link) operator(=) ident(ephemeral_end_procs)operator(;) - reserved(while) operator(()ident(link)operator(\)) operator({) - ident(rb_gc_mark)operator(()ident(link)operator(->)ident(data)operator(\);) - ident(link) operator(=) ident(link)operator(->)ident(next)operator(;) - operator(}) - ident(link) operator(=) ident(tmp_end_procs)operator(;) - reserved(while) operator(()ident(link)operator(\)) operator({) - ident(rb_gc_mark)operator(()ident(link)operator(->)ident(data)operator(\);) - ident(link) operator(=) ident(link)operator(->)ident(next)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) ident(call_end_proc) ident(_)operator((()ident(VALUE) ident(data)operator(\)\);) - -directive(static) directive(void) -ident(call_end_proc)operator(()ident(data)operator(\)) - ident(VALUE) ident(data)operator(;) -operator({) - ident(PUSH_ITER)operator(()ident(ITER_NOT)operator(\);) - ident(PUSH_FRAME)operator((\);) - ident(ruby_frame)operator(->)ident(self) operator(=) ident(ruby_frame)operator(->)ident(prev)operator(->)ident(self)operator(;) - ident(ruby_frame)operator(->)ident(node) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(last_func) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(last_class) operator(=) integer(0)operator(;) - ident(proc_invoke)operator(()ident(data)operator(,) ident(rb_ary_new2)operator(()integer(0)operator(\),) ident(Qundef)operator(,) integer(0)operator(\);) - ident(POP_FRAME)operator((\);) - ident(POP_ITER)operator((\);) -operator(}) - -directive(static) directive(void) -ident(rb_f_END)operator((\)) -operator({) - ident(PUSH_FRAME)operator((\);) - ident(ruby_frame)operator(->)ident(argc) operator(=) integer(0)operator(;) - ident(ruby_frame)operator(->)ident(iter) operator(=) ident(ITER_CUR)operator(;) - ident(rb_set_end_proc)operator(()ident(call_end_proc)operator(,) ident(rb_block_proc)operator((\)\);) - ident(POP_FRAME)operator((\);) -operator(}) - -comment(/* - * call-seq: - * at_exit { block } -> proc - * - * Converts _block_ to a +Proc+ object (and therefore - * binds it at the point of call\) and registers it for execution when - * the program exits. If multiple handlers are registered, they are - * executed in reverse order of registration. - * - * def do_at_exit(str1\) - * at_exit { print str1 } - * end - * at_exit { puts "cruel world" } - * do_at_exit("goodbye "\) - * exit - * - * produces: - * - * goodbye cruel world - */) - -directive(static) ident(VALUE) -ident(rb_f_at_exit)operator((\)) -operator({) - ident(VALUE) ident(proc)operator(;) - - reserved(if) operator((!)ident(rb_block_given_p)operator((\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(proc) operator(=) ident(rb_block_proc)operator((\);) - ident(rb_set_end_proc)operator(()ident(call_end_proc)operator(,) ident(proc)operator(\);) - reserved(return) ident(proc)operator(;) -operator(}) - -directive(void) -ident(rb_exec_end_proc)operator((\)) -operator({) - reserved(struct) ident(end_proc_data) operator(*)ident(link)operator(,) operator(*)ident(tmp)operator(;) - pre_type(int) ident(status)operator(;) - directive(volatile) pre_type(int) ident(safe) operator(=) ident(ruby_safe_level)operator(;) - - reserved(while) operator(()ident(ephemeral_end_procs)operator(\)) operator({) - ident(tmp_end_procs) operator(=) ident(link) operator(=) ident(ephemeral_end_procs)operator(;) - ident(ephemeral_end_procs) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(link)operator(\)) operator({) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(status) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(ruby_safe_level) operator(=) ident(link)operator(->)ident(safe)operator(;) - operator((*)ident(link)operator(->)ident(func)operator(\)()ident(link)operator(->)ident(data)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(status)operator(\)) operator({) - ident(error_handle)operator(()ident(status)operator(\);) - operator(}) - ident(tmp) operator(=) ident(link)operator(;) - ident(tmp_end_procs) operator(=) ident(link) operator(=) ident(link)operator(->)ident(next)operator(;) - ident(free)operator(()ident(tmp)operator(\);) - operator(}) - operator(}) - reserved(while) operator(()ident(end_procs)operator(\)) operator({) - ident(tmp_end_procs) operator(=) ident(link) operator(=) ident(end_procs)operator(;) - ident(end_procs) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(link)operator(\)) operator({) - ident(PUSH_TAG)operator(()ident(PROT_NONE)operator(\);) - reserved(if) operator((()ident(status) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(ruby_safe_level) operator(=) ident(link)operator(->)ident(safe)operator(;) - operator((*)ident(link)operator(->)ident(func)operator(\)()ident(link)operator(->)ident(data)operator(\);) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(status)operator(\)) operator({) - ident(error_handle)operator(()ident(status)operator(\);) - operator(}) - ident(tmp) operator(=) ident(link)operator(;) - ident(tmp_end_procs) operator(=) ident(link) operator(=) ident(link)operator(->)ident(next)operator(;) - ident(free)operator(()ident(tmp)operator(\);) - operator(}) - operator(}) - ident(ruby_safe_level) operator(=) ident(safe)operator(;) -operator(}) - -directive(void) -ident(Init_eval)operator((\)) -operator({) - ident(init) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(eqq) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(each) operator(=) ident(rb_intern)operator(()stringoperator(\);) - - ident(aref) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(aset) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(match) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(missing) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(added) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(singleton_added) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(removed) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(singleton_removed) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(undefined) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(singleton_undefined) operator(=) ident(rb_intern)operator(()stringoperator(\);) - - ident(__id__) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(__send__) operator(=) ident(rb_intern)operator(()stringoperator(\);) - - ident(rb_global_variable)operator((()directive(void) operator(*\)&)ident(top_scope)operator(\);) - ident(rb_global_variable)operator((()directive(void) operator(*\)&)ident(ruby_eval_tree_begin)operator(\);) - - ident(rb_global_variable)operator((()directive(void) operator(*\)&)ident(ruby_eval_tree)operator(\);) - ident(rb_global_variable)operator((()directive(void) operator(*\)&)ident(ruby_dyna_vars)operator(\);) - - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(errat_getter)operator(,) ident(errat_setter)operator(\);) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(ruby_errinfo)operator(,) integer(0)operator(,) ident(errinfo_setter)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_eval)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_block_given_p)operator(,) integer(0)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_block_given_p)operator(,) integer(0)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_method_missing)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_loop)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(obj_respond_to)operator(,) operator(-)integer(1)operator(\);) - ident(respond_to) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(rb_global_variable)operator((()directive(void) operator(*\)&)ident(basic_respond_to)operator(\);) - ident(basic_respond_to) operator(=) ident(rb_method_node)operator(()ident(rb_cObject)operator(,) ident(respond_to)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_raise)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_raise)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_caller)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_exit)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_abort)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_at_exit)operator(,) integer(0)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_catch)operator(,) integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_throw)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_global_variables)operator(,) integer(0)operator(\);) comment(/* in variable.c */) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_local_variables)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_f_send)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_f_send)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_instance_eval)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_append_features)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_extend_object)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_include)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_public)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_protected)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_private)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_modfunc)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_method_defined)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_public_method_defined)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_private_method_defined)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_protected_method_defined)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_public_method)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_private_method)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_module_eval)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_module_eval)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_undef_method)operator(()ident(rb_cClass)operator(,) stringoperator(\);) - - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_remove_method)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_undef_method)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_alias_method)operator(,) integer(2)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_define_method)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_nesting)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_s_constants)operator(,) integer(0)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(ruby_top_self)operator(,) stringoperator(,) ident(top_include)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(ruby_top_self)operator(,) stringoperator(,) ident(top_public)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(ruby_top_self)operator(,) stringoperator(,) ident(top_private)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_extend)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_trace_var)operator(,) operator(-)integer(1)operator(\);) comment(/* in variable.c */) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_untrace_var)operator(,) operator(-)integer(1)operator(\);) comment(/* in variable.c */) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(set_trace_func)operator(,) integer(1)operator(\);) - ident(rb_global_variable)operator((&)ident(trace_func)operator(\);) - - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(safe_getter)operator(,) ident(safe_setter)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod.autoload(name, filename\) => nil - * - * Registers _filename_ to be loaded (using Kernel::require\) - * the first time that _name_ (which may be a String or - * a symbol\) is accessed in the namespace of _mod_. - * - * module A - * end - * A.autoload(:B, "b"\) - * A::B.doit # autoloads "b" - */) - -directive(static) ident(VALUE) -ident(rb_mod_autoload)operator(()ident(mod)operator(,) ident(sym)operator(,) ident(file)operator(\)) - ident(VALUE) ident(mod)operator(;) - ident(VALUE) ident(sym)operator(;) - ident(VALUE) ident(file)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(sym)operator(\);) - - ident(Check_SafeStr)operator(()ident(file)operator(\);) - ident(rb_autoload)operator(()ident(mod)operator(,) ident(id)operator(,) ident(RSTRING)operator(()ident(file)operator(\)->)ident(ptr)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.autoload?(name\) => String or nil - * - * Returns _filename_ to be loaded if _name_ is registered as - * +autoload+ in the namespace of _mod_. - * - * module A - * end - * A.autoload(:B, "b"\) - * A.autoload?(:B\) # => "b" - */) - -directive(static) ident(VALUE) -ident(rb_mod_autoload_p)operator(()ident(mod)operator(,) ident(sym)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(sym)operator(;) -operator({) - reserved(return) ident(rb_autoload_p)operator(()ident(mod)operator(,) ident(rb_to_id)operator(()ident(sym)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * autoload(module, filename\) => nil - * - * Registers _filename_ to be loaded (using Kernel::require\) - * the first time that _module_ (which may be a String or - * a symbol\) is accessed. - * - * autoload(:MyModule, "/usr/local/lib/modules/my_module.rb"\) - */) - -directive(static) ident(VALUE) -ident(rb_f_autoload)operator(()ident(obj)operator(,) ident(sym)operator(,) ident(file)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(VALUE) ident(sym)operator(;) - ident(VALUE) ident(file)operator(;) -operator({) - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_cbase)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(rb_mod_autoload)operator(()ident(ruby_cbase)operator(,) ident(sym)operator(,) ident(file)operator(\);) -operator(}) - -comment(/* - * call-seq: - * autoload(module, filename\) => nil - * - * Registers _filename_ to be loaded (using Kernel::require\) - * the first time that _module_ (which may be a String or - * a symbol\) is accessed. - * - * autoload(:MyModule, "/usr/local/lib/modules/my_module.rb"\) - */) - -directive(static) ident(VALUE) -ident(rb_f_autoload_p)operator(()ident(obj)operator(,) ident(sym)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(VALUE) ident(sym)operator(;) -operator({) - comment(/* use ruby_cbase as same as rb_f_autoload. */) - reserved(if) operator(()ident(NIL_P)operator(()ident(ruby_cbase)operator(\)\)) operator({) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(rb_mod_autoload_p)operator(()ident(ruby_cbase)operator(,) ident(sym)operator(\);) -operator(}) - -directive(void) -ident(Init_load)operator((\)) -operator({) - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(rb_load_path)operator(\);) - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(rb_load_path)operator(\);) - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(rb_load_path)operator(\);) - ident(rb_load_path) operator(=) ident(rb_ary_new)operator((\);) - - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(rb_features)operator(\);) - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(rb_features)operator(\);) - ident(rb_features) operator(=) ident(rb_ary_new)operator((\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_load)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_require)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_autoload)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_autoload_p)operator(,) integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_autoload)operator(,) integer(2)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_autoload_p)operator(,) integer(1)operator(\);) - ident(rb_global_variable)operator((&)ident(ruby_wrapper)operator(\);) - - ident(rb_global_variable)operator((&)ident(ruby_dln_librefs)operator(\);) - ident(ruby_dln_librefs) operator(=) ident(rb_ary_new)operator((\);) -operator(}) - -directive(static) directive(void) -ident(scope_dup)operator(()ident(scope)operator(\)) - reserved(struct) ident(SCOPE) operator(*)ident(scope)operator(;) -operator({) - ident(ID) operator(*)ident(tbl)operator(;) - ident(VALUE) operator(*)ident(vars)operator(;) - - ident(scope)operator(->)ident(flags) operator(|=) ident(SCOPE_DONT_RECYCLE)operator(;) - reserved(if) operator(()ident(scope)operator(->)ident(flags) operator(&) ident(SCOPE_MALLOC)operator(\)) reserved(return)operator(;) - - reserved(if) operator(()ident(scope)operator(->)ident(local_tbl)operator(\)) operator({) - ident(tbl) operator(=) ident(scope)operator(->)ident(local_tbl)operator(;) - ident(vars) operator(=) ident(ALLOC_N)operator(()ident(VALUE)operator(,) ident(tbl)operator([)integer(0)operator(]+)integer(1)operator(\);) - operator(*)ident(vars)operator(++) operator(=) ident(scope)operator(->)ident(local_vars)operator([-)integer(1)operator(];) - ident(MEMCPY)operator(()ident(vars)operator(,) ident(scope)operator(->)ident(local_vars)operator(,) ident(VALUE)operator(,) ident(tbl)operator([)integer(0)operator(]\);) - ident(scope)operator(->)ident(local_vars) operator(=) ident(vars)operator(;) - ident(scope)operator(->)ident(flags) operator(|=) ident(SCOPE_MALLOC)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(blk_mark)operator(()ident(data)operator(\)) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(;) -operator({) - reserved(while) operator(()ident(data)operator(\)) operator({) - ident(rb_gc_mark_frame)operator((&)ident(data)operator(->)ident(frame)operator(\);) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(data)operator(->)ident(scope)operator(\);) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(data)operator(->)ident(var)operator(\);) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(data)operator(->)ident(body)operator(\);) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(data)operator(->)ident(self)operator(\);) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(data)operator(->)ident(dyna_vars)operator(\);) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(data)operator(->)ident(cref)operator(\);) - ident(rb_gc_mark)operator(()ident(data)operator(->)ident(wrapper)operator(\);) - ident(rb_gc_mark)operator(()ident(data)operator(->)ident(block_obj)operator(\);) - ident(data) operator(=) ident(data)operator(->)ident(prev)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(frame_free)operator(()ident(frame)operator(\)) - reserved(struct) ident(FRAME) operator(*)ident(frame)operator(;) -operator({) - reserved(struct) ident(FRAME) operator(*)ident(tmp)operator(;) - - ident(frame) operator(=) ident(frame)operator(->)ident(prev)operator(;) - reserved(while) operator(()ident(frame)operator(\)) operator({) - ident(tmp) operator(=) ident(frame)operator(;) - ident(frame) operator(=) ident(frame)operator(->)ident(prev)operator(;) - ident(free)operator(()ident(tmp)operator(\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(blk_free)operator(()ident(data)operator(\)) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(;) -operator({) - directive(void) operator(*)ident(tmp)operator(;) - - reserved(while) operator(()ident(data)operator(\)) operator({) - ident(frame_free)operator((&)ident(data)operator(->)ident(frame)operator(\);) - ident(tmp) operator(=) ident(data)operator(;) - ident(data) operator(=) ident(data)operator(->)ident(prev)operator(;) - ident(free)operator(()ident(tmp)operator(\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(frame_dup)operator(()ident(frame)operator(\)) - reserved(struct) ident(FRAME) operator(*)ident(frame)operator(;) -operator({) - reserved(struct) ident(FRAME) operator(*)ident(tmp)operator(;) - - reserved(for) operator((;;\)) operator({) - ident(frame)operator(->)ident(tmp) operator(=) integer(0)operator(;) comment(/* should not preserve tmp */) - reserved(if) operator((!)ident(frame)operator(->)ident(prev)operator(\)) reserved(break)operator(;) - ident(tmp) operator(=) ident(ALLOC)operator(()reserved(struct) ident(FRAME)operator(\);) - operator(*)ident(tmp) operator(=) operator(*)ident(frame)operator(->)ident(prev)operator(;) - ident(frame)operator(->)ident(prev) operator(=) ident(tmp)operator(;) - ident(frame) operator(=) ident(tmp)operator(;) - operator(}) -operator(}) - - -directive(static) directive(void) -ident(blk_copy_prev)operator(()ident(block)operator(\)) - reserved(struct) ident(BLOCK) operator(*)ident(block)operator(;) -operator({) - reserved(struct) ident(BLOCK) operator(*)ident(tmp)operator(;) - reserved(struct) ident(RVarmap)operator(*) ident(vars)operator(;) - - reserved(while) operator(()ident(block)operator(->)ident(prev)operator(\)) operator({) - ident(tmp) operator(=) ident(ALLOC_N)operator(()reserved(struct) ident(BLOCK)operator(,) integer(1)operator(\);) - ident(MEMCPY)operator(()ident(tmp)operator(,) ident(block)operator(->)ident(prev)operator(,) reserved(struct) ident(BLOCK)operator(,) integer(1)operator(\);) - ident(scope_dup)operator(()ident(tmp)operator(->)ident(scope)operator(\);) - ident(frame_dup)operator((&)ident(tmp)operator(->)ident(frame)operator(\);) - - reserved(for) operator(()ident(vars) operator(=) ident(tmp)operator(->)ident(dyna_vars)operator(;) ident(vars)operator(;) ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\)\)) reserved(break)operator(;) - ident(FL_SET)operator(()ident(vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\);) - operator(}) - - ident(block)operator(->)ident(prev) operator(=) ident(tmp)operator(;) - ident(block) operator(=) ident(tmp)operator(;) - operator(}) -operator(}) - - -directive(static) directive(void) -ident(blk_dup)operator(()ident(dup)operator(,) ident(orig)operator(\)) - reserved(struct) ident(BLOCK) operator(*)ident(dup)operator(,) operator(*)ident(orig)operator(;) -operator({) - ident(MEMCPY)operator(()ident(dup)operator(,) ident(orig)operator(,) reserved(struct) ident(BLOCK)operator(,) integer(1)operator(\);) - ident(frame_dup)operator((&)ident(dup)operator(->)ident(frame)operator(\);) - - reserved(if) operator(()ident(dup)operator(->)ident(iter)operator(\)) operator({) - ident(blk_copy_prev)operator(()ident(dup)operator(\);) - operator(}) - reserved(else) operator({) - ident(dup)operator(->)ident(prev) operator(=) integer(0)operator(;) - operator(}) -operator(}) - -comment(/* - * MISSING: documentation - */) - -directive(static) ident(VALUE) -ident(proc_clone)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(struct) ident(BLOCK) operator(*)ident(orig)operator(,) operator(*)ident(data)operator(;) - ident(VALUE) ident(bind)operator(;) - - ident(Data_Get_Struct)operator(()ident(self)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(orig)operator(\);) - ident(bind) operator(=) ident(Data_Make_Struct)operator(()ident(rb_obj_class)operator(()ident(self)operator(\),)reserved(struct) ident(BLOCK)operator(,)ident(blk_mark)operator(,)ident(blk_free)operator(,)ident(data)operator(\);) - ident(CLONESETUP)operator(()ident(bind)operator(,) ident(self)operator(\);) - ident(blk_dup)operator(()ident(data)operator(,) ident(orig)operator(\);) - - reserved(return) ident(bind)operator(;) -operator(}) - -comment(/* - * MISSING: documentation - */) - -preprocessor(#define) ident(PROC_TSHIFT) operator(()ident(FL_USHIFT)operator(+)integer(1)operator(\)) -preprocessor(#define) ident(PROC_TMASK) operator(()ident(FL_USER1)operator(|)ident(FL_USER2)operator(|)ident(FL_USER3)operator(\)) -preprocessor(#define) ident(PROC_TMAX) operator(()ident(PROC_TMASK) operator(>>) ident(PROC_TSHIFT)operator(\)) - -directive(static) pre_type(int) ident(proc_get_safe_level)operator(()ident(VALUE)operator(\);) - -directive(static) ident(VALUE) -ident(proc_dup)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(struct) ident(BLOCK) operator(*)ident(orig)operator(,) operator(*)ident(data)operator(;) - ident(VALUE) ident(bind)operator(;) - pre_type(int) ident(safe) operator(=) ident(proc_get_safe_level)operator(()ident(self)operator(\);) - - ident(Data_Get_Struct)operator(()ident(self)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(orig)operator(\);) - ident(bind) operator(=) ident(Data_Make_Struct)operator(()ident(rb_obj_class)operator(()ident(self)operator(\),)reserved(struct) ident(BLOCK)operator(,)ident(blk_mark)operator(,)ident(blk_free)operator(,)ident(data)operator(\);) - ident(blk_dup)operator(()ident(data)operator(,) ident(orig)operator(\);) - reserved(if) operator(()ident(safe) operator(>) ident(PROC_TMAX)operator(\)) ident(safe) operator(=) ident(PROC_TMAX)operator(;) - ident(FL_SET)operator(()ident(bind)operator(,) operator(()ident(safe) operator(<<) ident(PROC_TSHIFT)operator(\)) operator(&) ident(PROC_TMASK)operator(\);) - - reserved(return) ident(bind)operator(;) -operator(}) - -comment(/* - * call-seq: - * binding -> a_binding - * - * Returns a +Binding+ object, describing the variable and - * method bindings at the point of call. This object can be used when - * calling +eval+ to execute the evaluated command in this - * environment. Also see the description of class +Binding+. - * - * def getBinding(param\) - * return binding - * end - * b = getBinding("hello"\) - * eval("param", b\) #=> "hello" - */) - -directive(static) ident(VALUE) -ident(rb_f_binding)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(,) operator(*)ident(p)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(vars)operator(;) - ident(VALUE) ident(bind)operator(;) - - ident(PUSH_BLOCK)operator(()integer(0)operator(,)integer(0)operator(\);) - ident(bind) operator(=) ident(Data_Make_Struct)operator(()ident(rb_cBinding)operator(,)reserved(struct) ident(BLOCK)operator(,)ident(blk_mark)operator(,)ident(blk_free)operator(,)ident(data)operator(\);) - operator(*)ident(data) operator(=) operator(*)ident(ruby_block)operator(;) - - ident(data)operator(->)ident(orig_thread) operator(=) ident(rb_thread_current)operator((\);) - ident(data)operator(->)ident(wrapper) operator(=) ident(ruby_wrapper)operator(;) - ident(data)operator(->)ident(iter) operator(=) ident(rb_f_block_given_p)operator((\);) - ident(frame_dup)operator((&)ident(data)operator(->)ident(frame)operator(\);) - reserved(if) operator(()ident(ruby_frame)operator(->)ident(prev)operator(\)) operator({) - ident(data)operator(->)ident(frame)operator(.)ident(last_func) operator(=) ident(ruby_frame)operator(->)ident(prev)operator(->)ident(last_func)operator(;) - ident(data)operator(->)ident(frame)operator(.)ident(last_class) operator(=) ident(ruby_frame)operator(->)ident(prev)operator(->)ident(last_class)operator(;) - ident(data)operator(->)ident(frame)operator(.)ident(orig_func) operator(=) ident(ruby_frame)operator(->)ident(prev)operator(->)ident(orig_func)operator(;) - operator(}) - - reserved(if) operator(()ident(data)operator(->)ident(iter)operator(\)) operator({) - ident(blk_copy_prev)operator(()ident(data)operator(\);) - operator(}) - reserved(else) operator({) - ident(data)operator(->)ident(prev) operator(=) integer(0)operator(;) - operator(}) - - reserved(for) operator(()ident(p) operator(=) ident(data)operator(;) ident(p)operator(;) ident(p) operator(=) ident(p)operator(->)ident(prev)operator(\)) operator({) - reserved(for) operator(()ident(vars) operator(=) ident(p)operator(->)ident(dyna_vars)operator(;) ident(vars)operator(;) ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\)\)) reserved(break)operator(;) - ident(FL_SET)operator(()ident(vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\);) - operator(}) - operator(}) - ident(scope_dup)operator(()ident(data)operator(->)ident(scope)operator(\);) - ident(POP_BLOCK)operator((\);) - - reserved(return) ident(bind)operator(;) -operator(}) - -preprocessor(#define) ident(SAFE_LEVEL_MAX) ident(PROC_TMASK) - -directive(static) directive(void) -ident(proc_save_safe_level)operator(()ident(data)operator(\)) - ident(VALUE) ident(data)operator(;) -operator({) - pre_type(int) ident(safe) operator(=) ident(ruby_safe_level)operator(;) - reserved(if) operator(()ident(safe) operator(>) ident(PROC_TMAX)operator(\)) ident(safe) operator(=) ident(PROC_TMAX)operator(;) - ident(FL_SET)operator(()ident(data)operator(,) operator(()ident(safe) operator(<<) ident(PROC_TSHIFT)operator(\)) operator(&) ident(PROC_TMASK)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(proc_get_safe_level)operator(()ident(data)operator(\)) - ident(VALUE) ident(data)operator(;) -operator({) - reserved(return) operator(()ident(RBASIC)operator(()ident(data)operator(\)->)ident(flags) operator(&) ident(PROC_TMASK)operator(\)) operator(>>) ident(PROC_TSHIFT)operator(;) -operator(}) - -directive(static) directive(void) -ident(proc_set_safe_level)operator(()ident(data)operator(\)) - ident(VALUE) ident(data)operator(;) -operator({) - ident(ruby_safe_level) operator(=) ident(proc_get_safe_level)operator(()ident(data)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(proc_alloc)operator(()ident(klass)operator(,) ident(proc)operator(\)) - ident(VALUE) ident(klass)operator(;) - pre_type(int) ident(proc)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(block)operator(;) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(,) operator(*)ident(p)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(vars)operator(;) - - reserved(if) operator((!)ident(rb_block_given_p)operator((\)) operator(&&) operator(!)ident(rb_f_block_given_p)operator((\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(proc) operator(&&) operator(!)ident(rb_block_given_p)operator((\)\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - - reserved(if) operator((!)ident(proc) operator(&&) ident(ruby_block)operator(->)ident(block_obj) operator(&&) ident(CLASS_OF)operator(()ident(ruby_block)operator(->)ident(block_obj)operator(\)) operator(==) ident(klass)operator(\)) operator({) - reserved(return) ident(ruby_block)operator(->)ident(block_obj)operator(;) - operator(}) - ident(block) operator(=) ident(Data_Make_Struct)operator(()ident(klass)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(blk_mark)operator(,) ident(blk_free)operator(,) ident(data)operator(\);) - operator(*)ident(data) operator(=) operator(*)ident(ruby_block)operator(;) - - ident(data)operator(->)ident(orig_thread) operator(=) ident(rb_thread_current)operator((\);) - ident(data)operator(->)ident(wrapper) operator(=) ident(ruby_wrapper)operator(;) - ident(data)operator(->)ident(iter) operator(=) ident(data)operator(->)ident(prev)operator(?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) - ident(data)operator(->)ident(block_obj) operator(=) ident(block)operator(;) - ident(frame_dup)operator((&)ident(data)operator(->)ident(frame)operator(\);) - reserved(if) operator(()ident(data)operator(->)ident(iter)operator(\)) operator({) - ident(blk_copy_prev)operator(()ident(data)operator(\);) - operator(}) - reserved(else) operator({) - ident(data)operator(->)ident(prev) operator(=) integer(0)operator(;) - operator(}) - - reserved(for) operator(()ident(p) operator(=) ident(data)operator(;) ident(p)operator(;) ident(p) operator(=) ident(p)operator(->)ident(prev)operator(\)) operator({) - reserved(for) operator(()ident(vars) operator(=) ident(p)operator(->)ident(dyna_vars)operator(;) ident(vars)operator(;) ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\)\)) reserved(break)operator(;) - ident(FL_SET)operator(()ident(vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\);) - operator(}) - operator(}) - ident(scope_dup)operator(()ident(data)operator(->)ident(scope)operator(\);) - ident(proc_save_safe_level)operator(()ident(block)operator(\);) - reserved(if) operator(()ident(proc)operator(\)) operator({) - ident(data)operator(->)ident(flags) operator(|=) ident(BLOCK_LAMBDA)operator(;) - operator(}) - reserved(else) operator({) - ident(ruby_block)operator(->)ident(block_obj) operator(=) ident(block)operator(;) - operator(}) - - reserved(return) ident(block)operator(;) -operator(}) - -comment(/* - * call-seq: - * Proc.new {|...| block } => a_proc - * Proc.new => a_proc - * - * Creates a new Proc object, bound to the current - * context. Proc::new may be called without a block only - * within a method with an attached block, in which case that block is - * converted to the Proc object. - * - * def proc_from - * Proc.new - * end - * proc = proc_from { "hello" } - * proc.call #=> "hello" - */) - -directive(static) ident(VALUE) -ident(proc_s_new)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(block) operator(=) ident(proc_alloc)operator(()ident(klass)operator(,) ident(Qfalse)operator(\);) - - ident(rb_obj_call_init)operator(()ident(block)operator(,) ident(argc)operator(,) ident(argv)operator(\);) - reserved(return) ident(block)operator(;) -operator(}) - -ident(VALUE) -ident(rb_block_proc)operator((\)) -operator({) - reserved(return) ident(proc_alloc)operator(()ident(rb_cProc)operator(,) ident(Qfalse)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_f_lambda)operator((\)) -operator({) - ident(rb_warn)operator(()stringoperator(\);) - reserved(return) ident(proc_alloc)operator(()ident(rb_cProc)operator(,) ident(Qtrue)operator(\);) -operator(}) - -comment(/* - * call-seq: - * proc { |...| block } => a_proc - * lambda { |...| block } => a_proc - * - * Equivalent to Proc.new, except the resulting Proc objects - * check the number of parameters passed when called. - */) - -directive(static) ident(VALUE) -ident(proc_lambda)operator((\)) -operator({) - reserved(return) ident(proc_alloc)operator(()ident(rb_cProc)operator(,) ident(Qtrue)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(block_orphan)operator(()ident(data)operator(\)) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(;) -operator({) - reserved(if) operator(()ident(data)operator(->)ident(scope)operator(->)ident(flags) operator(&) ident(SCOPE_NOSTACK)operator(\)) operator({) - reserved(return) integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(data)operator(->)ident(orig_thread) operator(!=) ident(rb_thread_current)operator((\)\)) operator({) - reserved(return) integer(1)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(proc_invoke)operator(()ident(proc)operator(,) ident(args)operator(,) ident(self)operator(,) ident(klass)operator(\)) - ident(VALUE) ident(proc)operator(,) ident(args)operator(;) comment(/* OK */) - ident(VALUE) ident(self)operator(,) ident(klass)operator(;) -operator({) - reserved(struct) ident(BLOCK) operator(*) directive(volatile) ident(old_block)operator(;) - reserved(struct) ident(BLOCK) ident(_block)operator(;) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(;) - directive(volatile) ident(VALUE) ident(result) operator(=) ident(Qundef)operator(;) - pre_type(int) ident(state)operator(;) - directive(volatile) pre_type(int) ident(safe) operator(=) ident(ruby_safe_level)operator(;) - directive(volatile) ident(VALUE) ident(old_wrapper) operator(=) ident(ruby_wrapper)operator(;) - directive(volatile) pre_type(int) ident(pcall)operator(,) ident(avalue) operator(=) ident(Qtrue)operator(;) - directive(volatile) ident(VALUE) ident(tmp) operator(=) ident(args)operator(;) - - reserved(if) operator(()ident(rb_block_given_p)operator((\)) operator(&&) ident(ruby_frame)operator(->)ident(last_func)operator(\)) operator({) - reserved(if) operator(()ident(klass) operator(!=) ident(ruby_frame)operator(->)ident(last_class)operator(\)) - ident(klass) operator(=) ident(rb_obj_class)operator(()ident(proc)operator(\);) - ident(rb_warning)operator(()stringoperator(,) - ident(rb_class2name)operator(()ident(klass)operator(\),) - ident(rb_id2name)operator(()ident(ruby_frame)operator(->)ident(last_func)operator(\)\);) - operator(}) - - ident(Data_Get_Struct)operator(()ident(proc)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(data)operator(\);) - ident(pcall) operator(=) operator(()ident(data)operator(->)ident(flags) operator(&) ident(BLOCK_LAMBDA)operator(\)) operator(?) ident(YIELD_LAMBDA_CALL) operator(:) integer(0)operator(;) - reserved(if) operator((!)ident(pcall) operator(&&) ident(RARRAY)operator(()ident(args)operator(\)->)ident(len) operator(==) integer(1)operator(\)) operator({) - ident(avalue) operator(=) ident(Qfalse)operator(;) - ident(args) operator(=) ident(RARRAY)operator(()ident(args)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - operator(}) - - ident(PUSH_VARS)operator((\);) - ident(ruby_wrapper) operator(=) ident(data)operator(->)ident(wrapper)operator(;) - ident(ruby_dyna_vars) operator(=) ident(data)operator(->)ident(dyna_vars)operator(;) - comment(/* PUSH BLOCK from data */) - ident(old_block) operator(=) ident(ruby_block)operator(;) - ident(_block) operator(=) operator(*)ident(data)operator(;) - reserved(if) operator(()ident(self) operator(!=) ident(Qundef)operator(\)) ident(_block)operator(.)ident(frame)operator(.)ident(self) operator(=) ident(self)operator(;) - reserved(if) operator(()ident(klass)operator(\)) ident(_block)operator(.)ident(frame)operator(.)ident(last_class) operator(=) ident(klass)operator(;) - ident(_block)operator(.)ident(frame)operator(.)ident(argc) operator(=) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len)operator(;) - ident(_block)operator(.)ident(frame)operator(.)ident(flags) operator(=) ident(ruby_frame)operator(->)ident(flags)operator(;) - reserved(if) operator(()ident(_block)operator(.)ident(frame)operator(.)ident(argc) operator(&&) ident(DMETHOD_P)operator((\)\)) operator({) - ident(NEWOBJ)operator(()ident(scope)operator(,) reserved(struct) ident(SCOPE)operator(\);) - ident(OBJSETUP)operator(()ident(scope)operator(,) ident(tmp)operator(,) ident(T_SCOPE)operator(\);) - ident(scope)operator(->)ident(local_tbl) operator(=) ident(_block)operator(.)ident(scope)operator(->)ident(local_tbl)operator(;) - ident(scope)operator(->)ident(local_vars) operator(=) ident(_block)operator(.)ident(scope)operator(->)ident(local_vars)operator(;) - ident(scope)operator(->)ident(flags) operator(|=) ident(SCOPE_CLONE) operator(|) operator(()ident(_block)operator(.)ident(scope)operator(->)ident(flags) operator(&) ident(SCOPE_MALLOC)operator(\);) - ident(_block)operator(.)ident(scope) operator(=) ident(scope)operator(;) - operator(}) - comment(/* modify current frame */) - ident(ruby_block) operator(=) operator(&)ident(_block)operator(;) - ident(PUSH_ITER)operator(()ident(ITER_CUR)operator(\);) - ident(ruby_frame)operator(->)ident(iter) operator(=) ident(ITER_CUR)operator(;) - ident(PUSH_TAG)operator(()ident(pcall) operator(?) ident(PROT_LAMBDA) operator(:) ident(PROT_NONE)operator(\);) - ident(state) operator(=) ident(EXEC_TAG)operator((\);) - reserved(if) operator(()ident(state) operator(==) integer(0)operator(\)) operator({) - ident(proc_set_safe_level)operator(()ident(proc)operator(\);) - ident(result) operator(=) ident(rb_yield_0)operator(()ident(args)operator(,) ident(self)operator(,) operator(()ident(self)operator(!=)ident(Qundef)operator(\)?)ident(CLASS_OF)operator(()ident(self)operator(\):)integer(0)operator(,) ident(pcall)operator(,) ident(avalue)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(TAG_DST)operator((\)\)) operator({) - ident(result) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - operator(}) - ident(POP_TAG)operator((\);) - ident(POP_ITER)operator((\);) - ident(ruby_block) operator(=) ident(old_block)operator(;) - ident(ruby_wrapper) operator(=) ident(old_wrapper)operator(;) - ident(POP_VARS)operator((\);) - ident(ruby_safe_level) operator(=) ident(safe)operator(;) - - reserved(switch) operator(()ident(state)operator(\)) operator({) - reserved(case) integer(0)operator(:) - reserved(break)operator(;) - reserved(case) ident(TAG_RETRY)operator(:) - ident(proc_jump_error)operator(()ident(TAG_RETRY)operator(,) ident(Qnil)operator(\);) comment(/* xxx */) - ident(JUMP_TAG)operator(()ident(state)operator(\);) - reserved(break)operator(;) - reserved(case) ident(TAG_NEXT)operator(:) - reserved(case) ident(TAG_BREAK)operator(:) - reserved(if) operator((!)ident(pcall) operator(&&) ident(result) operator(!=) ident(Qundef)operator(\)) operator({) - ident(proc_jump_error)operator(()ident(state)operator(,) ident(result)operator(\);) - operator(}) - reserved(case) ident(TAG_RETURN)operator(:) - reserved(if) operator(()ident(result) operator(!=) ident(Qundef)operator(\)) operator({) - reserved(if) operator(()ident(pcall)operator(\)) reserved(break)operator(;) - ident(return_jump)operator(()ident(result)operator(\);) - operator(}) - reserved(default)operator(:) - ident(JUMP_TAG)operator(()ident(state)operator(\);) - operator(}) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* CHECKME: are the argument checking semantics correct? */) - -comment(/* - * call-seq: - * prc.call(params,...\) => obj - * prc[params,...] => obj - * - * Invokes the block, setting the block's parameters to the values in - * params using something close to method calling semantics. - * Generates a warning if multiple values are passed to a proc that - * expects just one (previously this silently converted the parameters - * to an array\). - * - * For procs created using Kernel.proc, generates an - * error if the wrong number of parameters - * are passed to a proc with multiple parameters. For procs created using - * Proc.new, extra parameters are silently discarded. - * - * Returns the value of the last expression evaluated in the block. See - * also Proc#yield. - * - * a_proc = Proc.new {|a, *b| b.collect {|i| i*a }} - * a_proc.call(9, 1, 2, 3\) #=> [9, 18, 27] - * a_proc[9, 1, 2, 3] #=> [9, 18, 27] - * a_proc = Proc.new {|a,b| a} - * a_proc.call(1,2,3\) - * - * produces: - * - * prog.rb:5: wrong number of arguments (3 for 2\) (ArgumentError\) - * from prog.rb:4:in `call' - * from prog.rb:5 - */) - -directive(static) ident(VALUE) -ident(proc_call)operator(()ident(proc)operator(,) ident(args)operator(\)) - ident(VALUE) ident(proc)operator(,) ident(args)operator(;) comment(/* OK */) -operator({) - reserved(return) ident(proc_invoke)operator(()ident(proc)operator(,) ident(args)operator(,) ident(Qundef)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(bmcall) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(method_arity) ident(_)operator((()ident(VALUE)operator(\)\);) - -comment(/* - * call-seq: - * prc.arity -> fixnum - * - * Returns the number of arguments that would not be ignored. If the block - * is declared to take no arguments, returns 0. If the block is known - * to take exactly n arguments, returns n. If the block has optional - * arguments, return -n-1, where n is the number of mandatory - * arguments. A proc with no argument declarations - * is the same a block declaring || as its arguments. - * - * Proc.new {}.arity #=> 0 - * Proc.new {||}.arity #=> 0 - * Proc.new {|a|}.arity #=> 1 - * Proc.new {|a,b|}.arity #=> 2 - * Proc.new {|a,b,c|}.arity #=> 3 - * Proc.new {|*a|}.arity #=> -1 - * Proc.new {|a,*b|}.arity #=> -2 - */) - -directive(static) ident(VALUE) -ident(proc_arity)operator(()ident(proc)operator(\)) - ident(VALUE) ident(proc)operator(;) -operator({) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(;) - ident(NODE) operator(*)ident(list)operator(;) - pre_type(int) ident(n)operator(;) - - ident(Data_Get_Struct)operator(()ident(proc)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(data)operator(\);) - reserved(if) operator(()ident(data)operator(->)ident(var) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(data)operator(->)ident(body) operator(&&) ident(nd_type)operator(()ident(data)operator(->)ident(body)operator(\)) operator(==) ident(NODE_IFUNC) operator(&&) - ident(data)operator(->)ident(body)operator(->)ident(nd_cfnc) operator(==) ident(bmcall)operator(\)) operator({) - reserved(return) ident(method_arity)operator(()ident(data)operator(->)ident(body)operator(->)ident(nd_tval)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - reserved(if) operator(()ident(data)operator(->)ident(var) operator(==) operator(()ident(NODE)operator(*\))integer(1)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(data)operator(->)ident(var) operator(==) operator(()ident(NODE)operator(*\))integer(2)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(switch) operator(()ident(nd_type)operator(()ident(data)operator(->)ident(var)operator(\)\)) operator({) - reserved(default)operator(:) - reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(case) ident(NODE_MASGN)operator(:) - ident(list) operator(=) ident(data)operator(->)ident(var)operator(->)ident(nd_head)operator(;) - ident(n) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(list)operator(\)) operator({) - ident(n)operator(++;) - ident(list) operator(=) ident(list)operator(->)ident(nd_next)operator(;) - operator(}) - reserved(if) operator(()ident(data)operator(->)ident(var)operator(->)ident(nd_args)operator(\)) reserved(return) ident(INT2FIX)operator((-)ident(n)operator(-)integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator(()ident(n)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * prc == other_proc => true or false - * - * Return true if prc is the same object as - * other_proc, or if they are both procs with the same body. - */) - -directive(static) ident(VALUE) -ident(proc_eq)operator(()ident(self)operator(,) ident(other)operator(\)) - ident(VALUE) ident(self)operator(,) ident(other)operator(;) -operator({) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(,) operator(*)ident(data2)operator(;) - - reserved(if) operator(()ident(self) operator(==) ident(other)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(other)operator(\)) operator(!=) ident(T_DATA)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(RDATA)operator(()ident(other)operator(\)->)ident(dmark) operator(!=) operator(()ident(RUBY_DATA_FUNC)operator(\))ident(blk_mark)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(CLASS_OF)operator(()ident(self)operator(\)) operator(!=) ident(CLASS_OF)operator(()ident(other)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - ident(Data_Get_Struct)operator(()ident(self)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(data)operator(\);) - ident(Data_Get_Struct)operator(()ident(other)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(data2)operator(\);) - reserved(if) operator(()ident(data)operator(->)ident(body) operator(!=) ident(data2)operator(->)ident(body)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(data)operator(->)ident(var) operator(!=) ident(data2)operator(->)ident(var)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(data)operator(->)ident(scope) operator(!=) ident(data2)operator(->)ident(scope)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(data)operator(->)ident(dyna_vars) operator(!=) ident(data2)operator(->)ident(dyna_vars)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(data)operator(->)ident(flags) operator(!=) ident(data2)operator(->)ident(flags)operator(\)) reserved(return) ident(Qfalse)operator(;) - - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * prc.to_s => string - * - * Shows the unique identifier for this proc, along with - * an indication of where the proc was defined. - */) - -directive(static) ident(VALUE) -ident(proc_to_s)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(;) - ident(NODE) operator(*)ident(node)operator(;) - pre_type(char) operator(*)ident(cname) operator(=) ident(rb_obj_classname)operator(()ident(self)operator(\);) - directive(const) pre_type(int) ident(w) operator(=) operator(()reserved(sizeof)operator(()ident(VALUE)operator(\)) operator(*) ident(CHAR_BIT)operator(\)) operator(/) integer(4)operator(;) - pre_type(long) ident(len) operator(=) ident(strlen)operator(()ident(cname)operator(\)+)integer(6)operator(+)ident(w)operator(;) comment(/* 6:tags 16:addr */) - ident(VALUE) ident(str)operator(;) - - ident(Data_Get_Struct)operator(()ident(self)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(data)operator(\);) - reserved(if) operator((()ident(node) operator(=) ident(data)operator(->)ident(frame)operator(.)ident(node)operator(\)) operator(||) operator(()ident(node) operator(=) ident(data)operator(->)ident(body)operator(\)\)) operator({) - ident(len) operator(+=) ident(strlen)operator(()ident(node)operator(->)ident(nd_file)operator(\)) operator(+) integer(2) operator(+) operator(()ident(SIZEOF_LONG)operator(*)ident(CHAR_BIT)operator(-)ident(NODE_LSHIFT)operator(\))operator(/)integer(3)operator(;) - ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) - ident(snprintf)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(+)integer(1)operator(,) - string)delimiter(")>operator(,) ident(cname)operator(,) ident(w)operator(,) operator(()ident(VALUE)operator(\))ident(data)operator(->)ident(body)operator(,) - ident(node)operator(->)ident(nd_file)operator(,) ident(nd_line)operator(()ident(node)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) - ident(snprintf)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(+)integer(1)operator(,) - string)delimiter(")>operator(,) ident(cname)operator(,) ident(w)operator(,) operator(()ident(VALUE)operator(\))ident(data)operator(->)ident(body)operator(\);) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(strlen)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(self)operator(\)\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * prc.to_proc -> prc - * - * Part of the protocol for converting objects to Proc - * objects. Instances of class Proc simply return - * themselves. - */) - -directive(static) ident(VALUE) -ident(proc_to_self)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(self)operator(;) -operator(}) - -comment(/* - * call-seq: - * prc.binding => binding - * - * Returns the binding associated with prc. Note that - * Kernel#eval accepts either a Proc or a - * Binding object as its second parameter. - * - * def fred(param\) - * proc {} - * end - * - * b = fred(99\) - * eval("param", b.binding\) #=> 99 - * eval("param", b\) #=> 99 - */) - -directive(static) ident(VALUE) -ident(proc_binding)operator(()ident(proc)operator(\)) - ident(VALUE) ident(proc)operator(;) -operator({) - reserved(struct) ident(BLOCK) operator(*)ident(orig)operator(,) operator(*)ident(data)operator(;) - ident(VALUE) ident(bind)operator(;) - - ident(Data_Get_Struct)operator(()ident(proc)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(orig)operator(\);) - ident(bind) operator(=) ident(Data_Make_Struct)operator(()ident(rb_cBinding)operator(,)reserved(struct) ident(BLOCK)operator(,)ident(blk_mark)operator(,)ident(blk_free)operator(,)ident(data)operator(\);) - ident(MEMCPY)operator(()ident(data)operator(,) ident(orig)operator(,) reserved(struct) ident(BLOCK)operator(,) integer(1)operator(\);) - ident(frame_dup)operator((&)ident(data)operator(->)ident(frame)operator(\);) - - reserved(if) operator(()ident(data)operator(->)ident(iter)operator(\)) operator({) - ident(blk_copy_prev)operator(()ident(data)operator(\);) - operator(}) - reserved(else) operator({) - ident(data)operator(->)ident(prev) operator(=) integer(0)operator(;) - operator(}) - - reserved(return) ident(bind)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(block_pass)operator(()ident(self)operator(,) ident(node)operator(\)) - ident(VALUE) ident(self)operator(;) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - ident(VALUE) ident(proc) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_body)operator(\);) comment(/* OK */) - ident(VALUE) ident(b)operator(;) - reserved(struct) ident(BLOCK) operator(*) directive(volatile) ident(old_block)operator(;) - reserved(struct) ident(BLOCK) ident(_block)operator(;) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(;) - directive(volatile) ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) - pre_type(int) ident(state)operator(;) - directive(volatile) pre_type(int) ident(orphan)operator(;) - directive(volatile) pre_type(int) ident(safe) operator(=) ident(ruby_safe_level)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(proc)operator(\)\)) operator({) - ident(PUSH_ITER)operator(()ident(ITER_NOT)operator(\);) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_iter)operator(\);) - ident(POP_ITER)operator((\);) - reserved(return) ident(result)operator(;) - operator(}) - reserved(if) operator((!)ident(rb_obj_is_proc)operator(()ident(proc)operator(\)\)) operator({) - ident(b) operator(=) ident(rb_check_convert_type)operator(()ident(proc)operator(,) ident(T_DATA)operator(,) stringoperator(,) stringoperator(\);) - reserved(if) operator((!)ident(rb_obj_is_proc)operator(()ident(b)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(proc)operator(\)\);) - operator(}) - ident(proc) operator(=) ident(b)operator(;) - operator(}) - - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(1) operator(&&) ident(OBJ_TAINTED)operator(()ident(proc)operator(\)) operator(&&) - ident(ruby_safe_level) operator(>) ident(proc_get_safe_level)operator(()ident(proc)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(ruby_block) operator(&&) ident(ruby_block)operator(->)ident(block_obj) operator(==) ident(proc)operator(\)) operator({) - ident(PUSH_ITER)operator(()ident(ITER_PAS)operator(\);) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_iter)operator(\);) - ident(POP_ITER)operator((\);) - reserved(return) ident(result)operator(;) - operator(}) - - ident(Data_Get_Struct)operator(()ident(proc)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(data)operator(\);) - ident(orphan) operator(=) ident(block_orphan)operator(()ident(data)operator(\);) - - comment(/* PUSH BLOCK from data */) - ident(old_block) operator(=) ident(ruby_block)operator(;) - ident(_block) operator(=) operator(*)ident(data)operator(;) - ident(_block)operator(.)ident(outer) operator(=) ident(ruby_block)operator(;) - reserved(if) operator(()ident(orphan)operator(\)) ident(_block)operator(.)ident(uniq) operator(=) ident(block_unique)operator(++;) - ident(ruby_block) operator(=) operator(&)ident(_block)operator(;) - ident(PUSH_ITER)operator(()ident(ITER_PRE)operator(\);) - reserved(if) operator(()ident(ruby_frame)operator(->)ident(iter) operator(==) ident(ITER_NOT)operator(\)) - ident(ruby_frame)operator(->)ident(iter) operator(=) ident(ITER_PRE)operator(;) - - ident(PUSH_TAG)operator(()ident(PROT_LOOP)operator(\);) - ident(state) operator(=) ident(EXEC_TAG)operator((\);) - reserved(if) operator(()ident(state) operator(==) integer(0)operator(\)) operator({) - label(retry:) - ident(proc_set_safe_level)operator(()ident(proc)operator(\);) - reserved(if) operator(()ident(safe) operator(>) ident(ruby_safe_level)operator(\)) - ident(ruby_safe_level) operator(=) ident(safe)operator(;) - ident(result) operator(=) ident(rb_eval)operator(()ident(self)operator(,) ident(node)operator(->)ident(nd_iter)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(state) operator(==) ident(TAG_BREAK) operator(&&) ident(TAG_DST)operator((\)\)) operator({) - ident(result) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - ident(state) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(state) operator(==) ident(TAG_RETRY)operator(\)) operator({) - ident(state) operator(=) integer(0)operator(;) - reserved(goto) ident(retry)operator(;) - operator(}) - ident(POP_TAG)operator((\);) - ident(POP_ITER)operator((\);) - ident(ruby_block) operator(=) ident(old_block)operator(;) - ident(ruby_safe_level) operator(=) ident(safe)operator(;) - - reserved(switch) operator(()ident(state)operator(\)) operator({)comment(/* escape from orphan block */) - reserved(case) integer(0)operator(:) - reserved(break)operator(;) - reserved(case) ident(TAG_RETURN)operator(:) - reserved(if) operator(()ident(orphan)operator(\)) operator({) - ident(proc_jump_error)operator(()ident(state)operator(,) ident(prot_tag)operator(->)ident(retval)operator(\);) - operator(}) - reserved(default)operator(:) - ident(JUMP_TAG)operator(()ident(state)operator(\);) - operator(}) - - reserved(return) ident(result)operator(;) -operator(}) - -reserved(struct) ident(METHOD) operator({) - ident(VALUE) ident(klass)operator(,) ident(rklass)operator(;) - ident(VALUE) ident(recv)operator(;) - ident(ID) ident(id)operator(,) ident(oid)operator(;) - pre_type(int) ident(safe_level)operator(;) - ident(NODE) operator(*)ident(body)operator(;) -operator(};) - -directive(static) directive(void) -ident(bm_mark)operator(()ident(data)operator(\)) - reserved(struct) ident(METHOD) operator(*)ident(data)operator(;) -operator({) - ident(rb_gc_mark)operator(()ident(data)operator(->)ident(rklass)operator(\);) - ident(rb_gc_mark)operator(()ident(data)operator(->)ident(klass)operator(\);) - ident(rb_gc_mark)operator(()ident(data)operator(->)ident(recv)operator(\);) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(data)operator(->)ident(body)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(mnew)operator(()ident(klass)operator(,) ident(obj)operator(,) ident(id)operator(,) ident(mklass)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(obj)operator(,) ident(mklass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(method)operator(;) - ident(NODE) operator(*)ident(body)operator(;) - pre_type(int) ident(noex)operator(;) - reserved(struct) ident(METHOD) operator(*)ident(data)operator(;) - ident(VALUE) ident(rklass) operator(=) ident(klass)operator(;) - ident(ID) ident(oid) operator(=) ident(id)operator(;) - - label(again:) - reserved(if) operator((()ident(body) operator(=) ident(rb_get_method_body)operator((&)ident(klass)operator(,) operator(&)ident(id)operator(,) operator(&)ident(noex)operator(\)\)) operator(==) integer(0)operator(\)) operator({) - ident(print_undef)operator(()ident(rklass)operator(,) ident(oid)operator(\);) - operator(}) - - reserved(if) operator(()ident(nd_type)operator(()ident(body)operator(\)) operator(==) ident(NODE_ZSUPER)operator(\)) operator({) - ident(klass) operator(=) ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - - reserved(while) operator(()ident(rklass) operator(!=) ident(klass) operator(&&) - operator(()ident(FL_TEST)operator(()ident(rklass)operator(,) ident(FL_SINGLETON)operator(\)) operator(||) ident(TYPE)operator(()ident(rklass)operator(\)) operator(==) ident(T_ICLASS)operator(\)\)) operator({) - ident(rklass) operator(=) ident(RCLASS)operator(()ident(rklass)operator(\)->)ident(super)operator(;) - operator(}) - ident(method) operator(=) ident(Data_Make_Struct)operator(()ident(mklass)operator(,) reserved(struct) ident(METHOD)operator(,) ident(bm_mark)operator(,) ident(free)operator(,) ident(data)operator(\);) - ident(data)operator(->)ident(klass) operator(=) ident(klass)operator(;) - ident(data)operator(->)ident(recv) operator(=) ident(obj)operator(;) - ident(data)operator(->)ident(id) operator(=) ident(id)operator(;) - ident(data)operator(->)ident(body) operator(=) ident(body)operator(;) - ident(data)operator(->)ident(rklass) operator(=) ident(rklass)operator(;) - ident(data)operator(->)ident(oid) operator(=) ident(oid)operator(;) - ident(data)operator(->)ident(safe_level) operator(=) ident(NOEX_WITH_SAFE)operator(()ident(noex)operator(\);) - ident(OBJ_INFECT)operator(()ident(method)operator(,) ident(klass)operator(\);) - - reserved(return) ident(method)operator(;) -operator(}) - - -comment(/********************************************************************** - * - * Document-class : Method - * - * Method objects are created by Object#method, and are - * associated with a particular object (not just with a class\). They - * may be used to invoke the method within the object, and as a block - * associated with an iterator. They may also be unbound from one - * object (creating an UnboundMethod\) and bound to - * another. - * - * class Thing - * def square(n\) - * n*n - * end - * end - * thing = Thing.new - * meth = thing.method(:square\) - * - * meth.call(9\) #=> 81 - * [ 1, 2, 3 ].collect(&meth\) #=> [1, 4, 9] - * - */) - -comment(/* - * call-seq: - * meth == other_meth => true or false - * - * Two method objects are equal if that are bound to the same - * object and contain the same body. - */) - - -directive(static) ident(VALUE) -ident(method_eq)operator(()ident(method)operator(,) ident(other)operator(\)) - ident(VALUE) ident(method)operator(,) ident(other)operator(;) -operator({) - reserved(struct) ident(METHOD) operator(*)ident(m1)operator(,) operator(*)ident(m2)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(other)operator(\)) operator(!=) ident(T_DATA) operator(||) ident(RDATA)operator(()ident(other)operator(\)->)ident(dmark) operator(!=) operator(()ident(RUBY_DATA_FUNC)operator(\))ident(bm_mark)operator(\)) - reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(CLASS_OF)operator(()ident(method)operator(\)) operator(!=) ident(CLASS_OF)operator(()ident(other)operator(\)\)) - reserved(return) ident(Qfalse)operator(;) - - ident(Data_Get_Struct)operator(()ident(method)operator(,) reserved(struct) ident(METHOD)operator(,) ident(m1)operator(\);) - ident(Data_Get_Struct)operator(()ident(other)operator(,) reserved(struct) ident(METHOD)operator(,) ident(m2)operator(\);) - - reserved(if) operator(()ident(m1)operator(->)ident(klass) operator(!=) ident(m2)operator(->)ident(klass) operator(||) ident(m1)operator(->)ident(rklass) operator(!=) ident(m2)operator(->)ident(rklass) operator(||) - ident(m1)operator(->)ident(recv) operator(!=) ident(m2)operator(->)ident(recv) operator(||) ident(m1)operator(->)ident(body) operator(!=) ident(m2)operator(->)ident(body)operator(\)) - reserved(return) ident(Qfalse)operator(;) - - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * meth.unbind => unbound_method - * - * Dissociates meth from it's current receiver. The resulting - * UnboundMethod can subsequently be bound to a new object - * of the same class (see UnboundMethod\). - */) - -directive(static) ident(VALUE) -ident(method_unbind)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(method)operator(;) - reserved(struct) ident(METHOD) operator(*)ident(orig)operator(,) operator(*)ident(data)operator(;) - - ident(Data_Get_Struct)operator(()ident(obj)operator(,) reserved(struct) ident(METHOD)operator(,) ident(orig)operator(\);) - ident(method) operator(=) ident(Data_Make_Struct)operator(()ident(rb_cUnboundMethod)operator(,) reserved(struct) ident(METHOD)operator(,) ident(bm_mark)operator(,) ident(free)operator(,) ident(data)operator(\);) - ident(data)operator(->)ident(klass) operator(=) ident(orig)operator(->)ident(klass)operator(;) - ident(data)operator(->)ident(recv) operator(=) ident(Qundef)operator(;) - ident(data)operator(->)ident(id) operator(=) ident(orig)operator(->)ident(id)operator(;) - ident(data)operator(->)ident(body) operator(=) ident(orig)operator(->)ident(body)operator(;) - ident(data)operator(->)ident(rklass) operator(=) ident(orig)operator(->)ident(rklass)operator(;) - ident(data)operator(->)ident(oid) operator(=) ident(orig)operator(->)ident(oid)operator(;) - ident(OBJ_INFECT)operator(()ident(method)operator(,) ident(obj)operator(\);) - - reserved(return) ident(method)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.method(sym\) => method - * - * Looks up the named method as a receiver in obj, returning a - * Method object (or raising NameError\). The - * Method object acts as a closure in obj's object - * instance, so instance variables and the value of self - * remain available. - * - * class Demo - * def initialize(n\) - * @iv = n - * end - * def hello(\) - * "Hello, @iv = #{@iv}" - * end - * end - * - * k = Demo.new(99\) - * m = k.method(:hello\) - * m.call #=> "Hello, @iv = 99" - * - * l = Demo.new('Fred'\) - * m = l.method("hello"\) - * m.call #=> "Hello, @iv = Fred" - */) - -directive(static) ident(VALUE) -ident(rb_obj_method)operator(()ident(obj)operator(,) ident(vid)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(VALUE) ident(vid)operator(;) -operator({) - reserved(return) ident(mnew)operator(()ident(CLASS_OF)operator(()ident(obj)operator(\),) ident(obj)operator(,) ident(rb_to_id)operator(()ident(vid)operator(\),) ident(rb_cMethod)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod.instance_method(symbol\) => unbound_method - * - * Returns an +UnboundMethod+ representing the given - * instance method in _mod_. - * - * class Interpreter - * def do_a(\) print "there, "; end - * def do_d(\) print "Hello "; end - * def do_e(\) print "!\\n"; end - * def do_v(\) print "Dave"; end - * Dispatcher = { - * ?a => instance_method(:do_a\), - * ?d => instance_method(:do_d\), - * ?e => instance_method(:do_e\), - * ?v => instance_method(:do_v\) - * } - * def interpret(string\) - * string.each_byte {|b| Dispatcher[b].bind(self\).call } - * end - * end - * - * - * interpreter = Interpreter.new - * interpreter.interpret('dave'\) - * - * produces: - * - * Hello there, Dave! - */) - -directive(static) ident(VALUE) -ident(rb_mod_method)operator(()ident(mod)operator(,) ident(vid)operator(\)) - ident(VALUE) ident(mod)operator(;) - ident(VALUE) ident(vid)operator(;) -operator({) - reserved(return) ident(mnew)operator(()ident(mod)operator(,) ident(Qundef)operator(,) ident(rb_to_id)operator(()ident(vid)operator(\),) ident(rb_cUnboundMethod)operator(\);) -operator(}) - -comment(/* - * MISSING: documentation - */) - -directive(static) ident(VALUE) -ident(method_clone)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - ident(VALUE) ident(clone)operator(;) - reserved(struct) ident(METHOD) operator(*)ident(orig)operator(,) operator(*)ident(data)operator(;) - - ident(Data_Get_Struct)operator(()ident(self)operator(,) reserved(struct) ident(METHOD)operator(,) ident(orig)operator(\);) - ident(clone) operator(=) ident(Data_Make_Struct)operator(()ident(CLASS_OF)operator(()ident(self)operator(\),)reserved(struct) ident(METHOD)operator(,) ident(bm_mark)operator(,) ident(free)operator(,) ident(data)operator(\);) - ident(CLONESETUP)operator(()ident(clone)operator(,) ident(self)operator(\);) - operator(*)ident(data) operator(=) operator(*)ident(orig)operator(;) - - reserved(return) ident(clone)operator(;) -operator(}) - -comment(/* - * call-seq: - * meth.call(args, ...\) => obj - * meth[args, ...] => obj - * - * Invokes the meth with the specified arguments, returning the - * method's return value. - * - * m = 12.method("+"\) - * m.call(3\) #=> 15 - * m.call(20\) #=> 32 - */) - -directive(static) ident(VALUE) -ident(method_call)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(method)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(method)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(Qnil)operator(;) comment(/* OK */) - reserved(struct) ident(METHOD) operator(*)ident(data)operator(;) - pre_type(int) ident(safe)operator(;) - - ident(Data_Get_Struct)operator(()ident(method)operator(,) reserved(struct) ident(METHOD)operator(,) ident(data)operator(\);) - reserved(if) operator(()ident(data)operator(->)ident(recv) operator(==) ident(Qundef)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(method)operator(\)\)) operator({) - ident(safe) operator(=) ident(NOEX_WITH)operator(()ident(data)operator(->)ident(safe_level)operator(,) integer(4)operator(\)|)ident(NOEX_TAINTED)operator(;) - operator(}) - reserved(else) operator({) - ident(safe) operator(=) ident(data)operator(->)ident(safe_level)operator(;) - operator(}) - ident(PUSH_ITER)operator(()ident(rb_block_given_p)operator((\)?)ident(ITER_PRE)operator(:)ident(ITER_NOT)operator(\);) - ident(result) operator(=) ident(rb_call0)operator(()ident(data)operator(->)ident(klass)operator(,)ident(data)operator(->)ident(recv)operator(,)ident(data)operator(->)ident(id)operator(,)ident(data)operator(->)ident(oid)operator(,)ident(argc)operator(,)ident(argv)operator(,)ident(data)operator(->)ident(body)operator(,)ident(safe)operator(\);) - ident(POP_ITER)operator((\);) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/********************************************************************** - * - * Document-class: UnboundMethod - * - * Ruby supports two forms of objectified methods. Class - * Method is used to represent methods that are associated - * with a particular object: these method objects are bound to that - * object. Bound method objects for an object can be created using - * Object#method. - * - * Ruby also supports unbound methods; methods objects that are not - * associated with a particular object. These can be created either by - * calling Module#instance_method or by calling - * unbind on a bound method object. The result of both of - * these is an UnboundMethod object. - * - * Unbound methods can only be called after they are bound to an - * object. That object must be be a kind_of? the method's original - * class. - * - * class Square - * def area - * @side * @side - * end - * def initialize(side\) - * @side = side - * end - * end - * - * area_un = Square.instance_method(:area\) - * - * s = Square.new(12\) - * area = area_un.bind(s\) - * area.call #=> 144 - * - * Unbound methods are a reference to the method at the time it was - * objectified: subsequent changes to the underlying class will not - * affect the unbound method. - * - * class Test - * def test - * :original - * end - * end - * um = Test.instance_method(:test\) - * class Test - * def test - * :modified - * end - * end - * t = Test.new - * t.test #=> :modified - * um.bind(t\).call #=> :original - * - */) - -comment(/* - * call-seq: - * umeth.bind(obj\) -> method - * - * Bind umeth to obj. If Klass was the class - * from which umeth was obtained, - * obj.kind_of?(Klass\) must be true. - * - * class A - * def test - * puts "In test, class = #{self.class}" - * end - * end - * class B < A - * end - * class C < B - * end - * - * - * um = B.instance_method(:test\) - * bm = um.bind(C.new\) - * bm.call - * bm = um.bind(B.new\) - * bm.call - * bm = um.bind(A.new\) - * bm.call - * - * produces: - * - * In test, class = C - * In test, class = B - * prog.rb:16:in `bind': bind argument must be an instance of B (TypeError\) - * from prog.rb:16 - */) - -directive(static) ident(VALUE) -ident(umethod_bind)operator(()ident(method)operator(,) ident(recv)operator(\)) - ident(VALUE) ident(method)operator(,) ident(recv)operator(;) -operator({) - reserved(struct) ident(METHOD) operator(*)ident(data)operator(,) operator(*)ident(bound)operator(;) - ident(VALUE) ident(rklass) operator(=) ident(CLASS_OF)operator(()ident(recv)operator(\);) - - ident(Data_Get_Struct)operator(()ident(method)operator(,) reserved(struct) ident(METHOD)operator(,) ident(data)operator(\);) - reserved(if) operator(()ident(data)operator(->)ident(rklass) operator(!=) ident(rklass)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(data)operator(->)ident(rklass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(data)operator(->)ident(rklass)operator(\)) operator(==) ident(T_MODULE)operator(\)) operator({) - ident(st_table) operator(*)ident(m_tbl) operator(=) ident(RCLASS)operator(()ident(data)operator(->)ident(rklass)operator(\)->)ident(m_tbl)operator(;) - reserved(while) operator(()ident(RCLASS)operator(()ident(rklass)operator(\)->)ident(m_tbl) operator(!=) ident(m_tbl)operator(\)) operator({) - ident(rklass) operator(=) ident(RCLASS)operator(()ident(rklass)operator(\)->)ident(super)operator(;) - reserved(if) operator((!)ident(rklass)operator(\)) reserved(goto) ident(not_instace)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator((!)ident(rb_obj_is_kind_of)operator(()ident(recv)operator(,) ident(data)operator(->)ident(rklass)operator(\)\)) operator({) - label(not_instace:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_class2name)operator(()ident(data)operator(->)ident(rklass)operator(\)\);) - operator(}) - operator(}) - - ident(method) operator(=) ident(Data_Make_Struct)operator(()ident(rb_cMethod)operator(,)reserved(struct) ident(METHOD)operator(,)ident(bm_mark)operator(,)ident(free)operator(,)ident(bound)operator(\);) - operator(*)ident(bound) operator(=) operator(*)ident(data)operator(;) - ident(bound)operator(->)ident(recv) operator(=) ident(recv)operator(;) - ident(bound)operator(->)ident(rklass) operator(=) ident(rklass)operator(;) - - reserved(return) ident(method)operator(;) -operator(}) - -comment(/* - * call-seq: - * meth.arity => fixnum - * - * Returns an indication of the number of arguments accepted by a - * method. Returns a nonnegative integer for methods that take a fixed - * number of arguments. For Ruby methods that take a variable number of - * arguments, returns -n-1, where n is the number of required - * arguments. For methods written in C, returns -1 if the call takes a - * variable number of arguments. - * - * class C - * def one; end - * def two(a\); end - * def three(*a\); end - * def four(a, b\); end - * def five(a, b, *c\); end - * def six(a, b, *c, &d\); end - * end - * c = C.new - * c.method(:one\).arity #=> 0 - * c.method(:two\).arity #=> 1 - * c.method(:three\).arity #=> -1 - * c.method(:four\).arity #=> 2 - * c.method(:five\).arity #=> -3 - * c.method(:six\).arity #=> -3 - * - * "cat".method(:size\).arity #=> 0 - * "cat".method(:replace\).arity #=> 1 - * "cat".method(:squeeze\).arity #=> -1 - * "cat".method(:count\).arity #=> -1 - */) - -directive(static) ident(VALUE) -ident(method_arity)operator(()ident(method)operator(\)) - ident(VALUE) ident(method)operator(;) -operator({) - reserved(struct) ident(METHOD) operator(*)ident(data)operator(;) - ident(NODE) operator(*)ident(body)operator(;) - pre_type(int) ident(n)operator(;) - - ident(Data_Get_Struct)operator(()ident(method)operator(,) reserved(struct) ident(METHOD)operator(,) ident(data)operator(\);) - - ident(body) operator(=) ident(data)operator(->)ident(body)operator(;) - reserved(switch) operator(()ident(nd_type)operator(()ident(body)operator(\)\)) operator({) - reserved(case) ident(NODE_CFUNC)operator(:) - reserved(if) operator(()ident(body)operator(->)ident(nd_argc) operator(<) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator(()ident(body)operator(->)ident(nd_argc)operator(\);) - reserved(case) ident(NODE_ZSUPER)operator(:) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - reserved(case) ident(NODE_ATTRSET)operator(:) - reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(case) ident(NODE_IVAR)operator(:) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(case) ident(NODE_BMETHOD)operator(:) - reserved(return) ident(proc_arity)operator(()ident(body)operator(->)ident(nd_cval)operator(\);) - reserved(case) ident(NODE_DMETHOD)operator(:) - reserved(return) ident(method_arity)operator(()ident(body)operator(->)ident(nd_cval)operator(\);) - reserved(case) ident(NODE_SCOPE)operator(:) - ident(body) operator(=) ident(body)operator(->)ident(nd_next)operator(;) comment(/* skip NODE_SCOPE */) - reserved(if) operator(()ident(nd_type)operator(()ident(body)operator(\)) operator(==) ident(NODE_BLOCK)operator(\)) - ident(body) operator(=) ident(body)operator(->)ident(nd_head)operator(;) - reserved(if) operator((!)ident(body)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - ident(n) operator(=) ident(body)operator(->)ident(nd_cnt)operator(;) - reserved(if) operator(()ident(body)operator(->)ident(nd_opt) operator(||) ident(body)operator(->)ident(nd_rest)operator(\)) - ident(n) operator(=) operator(-)ident(n)operator(-)integer(1)operator(;) - reserved(return) ident(INT2FIX)operator(()ident(n)operator(\);) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(nd_type)operator(()ident(body)operator(\)\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * meth.to_s => string - * meth.inspect => string - * - * Show the name of the underlying method. - * - * "cat".method(:count\).inspect #=> "#" - */) - -directive(static) ident(VALUE) -ident(method_inspect)operator(()ident(method)operator(\)) - ident(VALUE) ident(method)operator(;) -operator({) - reserved(struct) ident(METHOD) operator(*)ident(data)operator(;) - ident(VALUE) ident(str)operator(;) - directive(const) pre_type(char) operator(*)ident(s)operator(;) - pre_type(char) operator(*)ident(sharp) operator(=) stringoperator(;) - - ident(Data_Get_Struct)operator(()ident(method)operator(,) reserved(struct) ident(METHOD)operator(,) ident(data)operator(\);) - ident(str) operator(=) ident(rb_str_buf_new2)operator(()stringoperator(\);) - ident(s) operator(=) ident(rb_obj_classname)operator(()ident(method)operator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) ident(s)operator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(data)operator(->)ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(VALUE) ident(v) operator(=) ident(rb_iv_get)operator(()ident(data)operator(->)ident(klass)operator(,) stringoperator(\);) - - reserved(if) operator(()ident(data)operator(->)ident(recv) operator(==) ident(Qundef)operator(\)) operator({) - ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(rb_inspect)operator(()ident(data)operator(->)ident(klass)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(data)operator(->)ident(recv) operator(==) ident(v)operator(\)) operator({) - ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(rb_inspect)operator(()ident(v)operator(\)\);) - ident(sharp) operator(=) stringoperator(;) - operator(}) - reserved(else) operator({) - ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(rb_inspect)operator(()ident(data)operator(->)ident(recv)operator(\)\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(rb_inspect)operator(()ident(v)operator(\)\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(sharp) operator(=) stringoperator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) ident(rb_class2name)operator(()ident(data)operator(->)ident(rklass)operator(\)\);) - reserved(if) operator(()ident(data)operator(->)ident(rklass) operator(!=) ident(data)operator(->)ident(klass)operator(\)) operator({) - ident(VALUE) ident(klass) operator(=) ident(data) operator(->) ident(klass)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(klass) operator(=) ident(RBASIC)operator(()ident(klass)operator(\)->)ident(klass)operator(;) - operator(}) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) ident(rb_class2name)operator(()ident(klass)operator(\)\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - operator(}) - operator(}) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) ident(sharp)operator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) ident(rb_id2name)operator(()ident(data)operator(->)ident(oid)operator(\)\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) string)delimiter(")>operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(mproc)operator(()ident(method)operator(\)) - ident(VALUE) ident(method)operator(;) -operator({) - ident(VALUE) ident(proc)operator(;) - - comment(/* emulate ruby's method call */) - ident(PUSH_ITER)operator(()ident(ITER_CUR)operator(\);) - ident(PUSH_FRAME)operator((\);) - ident(proc) operator(=) ident(rb_block_proc)operator((\);) - ident(POP_FRAME)operator((\);) - ident(POP_ITER)operator((\);) - - reserved(return) ident(proc)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(bmcall)operator(()ident(args)operator(,) ident(method)operator(\)) - ident(VALUE) ident(args)operator(,) ident(method)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(a)operator(;) - ident(VALUE) ident(ret)operator(;) - - ident(a) operator(=) ident(svalue_to_avalue)operator(()ident(args)operator(\);) - ident(ret) operator(=) ident(method_call)operator(()ident(RARRAY)operator(()ident(a)operator(\)->)ident(len)operator(,) ident(RARRAY)operator(()ident(a)operator(\)->)ident(ptr)operator(,) ident(method)operator(\);) - ident(a) operator(=) ident(Qnil)operator(;) comment(/* prevent tail call */) - reserved(return) ident(ret)operator(;) -operator(}) - -ident(VALUE) -ident(rb_proc_new)operator(()ident(func)operator(,) ident(val)operator(\)) - ident(VALUE) operator((*)ident(func)operator(\)()ident(ANYARGS)operator(\);) comment(/* VALUE yieldarg[, VALUE procarg] */) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(struct) ident(BLOCK) operator(*)ident(data)operator(;) - ident(VALUE) ident(proc) operator(=) ident(rb_iterate)operator((()ident(VALUE)operator((*\))ident(_)operator((()ident(VALUE)operator(\)\)\))ident(mproc)operator(,) integer(0)operator(,) ident(func)operator(,) ident(val)operator(\);) - - ident(Data_Get_Struct)operator(()ident(proc)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(data)operator(\);) - ident(data)operator(->)ident(body)operator(->)ident(nd_state) operator(=) ident(YIELD_FUNC_AVALUE)operator(;) - reserved(return) ident(proc)operator(;) -operator(}) - -comment(/* - * call-seq: - * meth.to_proc => prc - * - * Returns a Proc object corresponding to this method. - */) - -directive(static) ident(VALUE) -ident(method_proc)operator(()ident(method)operator(\)) - ident(VALUE) ident(method)operator(;) -operator({) - ident(VALUE) ident(proc)operator(;) - reserved(struct) ident(METHOD) operator(*)ident(mdata)operator(;) - reserved(struct) ident(BLOCK) operator(*)ident(bdata)operator(;) - - ident(proc) operator(=) ident(rb_iterate)operator((()ident(VALUE)operator((*\))ident(_)operator((()ident(VALUE)operator(\)\)\))ident(mproc)operator(,) integer(0)operator(,) ident(bmcall)operator(,) ident(method)operator(\);) - ident(Data_Get_Struct)operator(()ident(method)operator(,) reserved(struct) ident(METHOD)operator(,) ident(mdata)operator(\);) - ident(Data_Get_Struct)operator(()ident(proc)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(bdata)operator(\);) - ident(bdata)operator(->)ident(body)operator(->)ident(nd_file) operator(=) ident(mdata)operator(->)ident(body)operator(->)ident(nd_file)operator(;) - ident(nd_set_line)operator(()ident(bdata)operator(->)ident(body)operator(,) ident(nd_line)operator(()ident(mdata)operator(->)ident(body)operator(\)\);) - ident(bdata)operator(->)ident(body)operator(->)ident(nd_state) operator(=) ident(YIELD_FUNC_SVALUE)operator(;) - - reserved(return) ident(proc)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_obj_is_method)operator(()ident(m)operator(\)) - ident(VALUE) ident(m)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(m)operator(\)) operator(==) ident(T_DATA) operator(&&) ident(RDATA)operator(()ident(m)operator(\)->)ident(dmark) operator(==) operator(()ident(RUBY_DATA_FUNC)operator(\))ident(bm_mark)operator(\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * define_method(symbol, method\) => new_method - * define_method(symbol\) { block } => proc - * - * Defines an instance method in the receiver. The _method_ - * parameter can be a +Proc+ or +Method+ object. - * If a block is specified, it is used as the method body. This block - * is evaluated using instance_eval, a point that is - * tricky to demonstrate because define_method is private. - * (This is why we resort to the +send+ hack in this example.\) - * - * class A - * def fred - * puts "In Fred" - * end - * def create_method(name, &block\) - * self.class.send(:define_method, name, &block\) - * end - * define_method(:wilma\) { puts "Charge it!" } - * end - * class B < A - * define_method(:barney, instance_method(:fred\)\) - * end - * a = B.new - * a.barney - * a.wilma - * a.create_method(:betty\) { p self } - * a.betty - * - * produces: - * - * In Fred - * Charge it! - * # - */) - -directive(static) ident(VALUE) -ident(rb_mod_define_method)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(mod)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(mod)operator(;) -operator({) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(body)operator(;) - ident(NODE) operator(*)ident(node)operator(;) - pre_type(int) ident(noex)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - ident(id) operator(=) ident(rb_to_id)operator(()ident(argv)operator([)integer(0)operator(]\);) - ident(body) operator(=) ident(proc_lambda)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(argc) operator(==) integer(2)operator(\)) operator({) - ident(id) operator(=) ident(rb_to_id)operator(()ident(argv)operator([)integer(0)operator(]\);) - ident(body) operator(=) ident(argv)operator([)integer(1)operator(];) - reserved(if) operator((!)ident(rb_obj_is_method)operator(()ident(body)operator(\)) operator(&&) operator(!)ident(rb_obj_is_proc)operator(()ident(body)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(body)operator(\)\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - reserved(if) operator(()ident(RDATA)operator(()ident(body)operator(\)->)ident(dmark) operator(==) operator(()ident(RUBY_DATA_FUNC)operator(\))ident(bm_mark)operator(\)) operator({) - ident(node) operator(=) ident(NEW_DMETHOD)operator(()ident(method_unbind)operator(()ident(body)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(RDATA)operator(()ident(body)operator(\)->)ident(dmark) operator(==) operator(()ident(RUBY_DATA_FUNC)operator(\))ident(blk_mark)operator(\)) operator({) - reserved(struct) ident(BLOCK) operator(*)ident(block)operator(;) - - ident(body) operator(=) ident(proc_clone)operator(()ident(body)operator(\);) - ident(Data_Get_Struct)operator(()ident(body)operator(,) reserved(struct) ident(BLOCK)operator(,) ident(block)operator(\);) - ident(block)operator(->)ident(frame)operator(.)ident(last_func) operator(=) ident(id)operator(;) - ident(block)operator(->)ident(frame)operator(.)ident(orig_func) operator(=) ident(id)operator(;) - ident(block)operator(->)ident(frame)operator(.)ident(last_class) operator(=) ident(mod)operator(;) - ident(node) operator(=) ident(NEW_BMETHOD)operator(()ident(body)operator(\);) - operator(}) - reserved(else) operator({) - comment(/* type error */) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - - ident(noex) operator(=) ident(NOEX_PUBLIC)operator(;) - reserved(if) operator(()ident(ruby_cbase) operator(==) ident(mod)operator(\)) operator({) - reserved(if) operator(()ident(SCOPE_TEST)operator(()ident(SCOPE_PRIVATE)operator(\)\)) operator({) - ident(noex) operator(=) ident(NOEX_PRIVATE)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(SCOPE_TEST)operator(()ident(SCOPE_PROTECTED)operator(\)\)) operator({) - ident(noex) operator(=) ident(NOEX_PROTECTED)operator(;) - operator(}) - operator(}) - ident(rb_add_method)operator(()ident(mod)operator(,) ident(id)operator(,) ident(node)operator(,) ident(noex)operator(\);) - reserved(return) ident(body)operator(;) -operator(}) - -comment(/* - * Proc objects are blocks of code that have been bound to - * a set of local variables. Once bound, the code may be called in - * different contexts and still access those variables. - * - * def gen_times(factor\) - * return Proc.new {|n| n*factor } - * end - * - * times3 = gen_times(3\) - * times5 = gen_times(5\) - * - * times3.call(12\) #=> 36 - * times5.call(5\) #=> 25 - * times3.call(times5.call(4\)\) #=> 60 - * - */) - -directive(void) -ident(Init_Proc)operator((\)) -operator({) - ident(rb_eLocalJumpError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_define_method)operator(()ident(rb_eLocalJumpError)operator(,) stringoperator(,) ident(localjump_xvalue)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_eLocalJumpError)operator(,) stringoperator(,) ident(localjump_reason)operator(,) integer(0)operator(\);) - - ident(rb_global_variable)operator((&)ident(exception_error)operator(\);) - ident(exception_error) operator(=) ident(rb_exc_new3)operator(()ident(rb_eFatal)operator(,) - ident(rb_obj_freeze)operator(()ident(rb_str_new2)operator(()stringoperator(\)\)\);) - ident(OBJ_TAINT)operator(()ident(exception_error)operator(\);) - ident(OBJ_FREEZE)operator(()ident(exception_error)operator(\);) - - ident(rb_eSysStackError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_global_variable)operator((&)ident(sysstack_error)operator(\);) - ident(sysstack_error) operator(=) ident(rb_exc_new3)operator(()ident(rb_eSysStackError)operator(,) - ident(rb_obj_freeze)operator(()ident(rb_str_new2)operator(()stringoperator(\)\)\);) - ident(OBJ_TAINT)operator(()ident(sysstack_error)operator(\);) - ident(OBJ_FREEZE)operator(()ident(sysstack_error)operator(\);) - - ident(rb_cProc) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_undef_alloc_func)operator(()ident(rb_cProc)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cProc)operator(,) stringoperator(,) ident(proc_s_new)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cProc)operator(,) stringoperator(,) ident(proc_clone)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProc)operator(,) stringoperator(,) ident(proc_dup)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProc)operator(,) stringoperator(,) ident(proc_call)operator(,) operator(-)integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProc)operator(,) stringoperator(,) ident(proc_arity)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProc)operator(,) stringoperator(,) ident(proc_call)operator(,) operator(-)integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProc)operator(,) stringoperator(,) ident(proc_eq)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProc)operator(,) stringoperator(,) ident(proc_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProc)operator(,) stringoperator(,) ident(proc_to_self)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProc)operator(,) stringoperator(,) ident(proc_binding)operator(,) integer(0)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(proc_lambda)operator(,) integer(0)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(proc_lambda)operator(,) integer(0)operator(\);) - - ident(rb_cMethod) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_undef_alloc_func)operator(()ident(rb_cMethod)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cMethod)operator(\),) stringoperator(\);) - ident(rb_define_method)operator(()ident(rb_cMethod)operator(,) stringoperator(,) ident(method_eq)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMethod)operator(,) stringoperator(,) ident(method_clone)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMethod)operator(,) stringoperator(,) ident(method_call)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMethod)operator(,) stringoperator(,) ident(method_call)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMethod)operator(,) stringoperator(,) ident(method_arity)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMethod)operator(,) stringoperator(,) ident(method_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMethod)operator(,) stringoperator(,) ident(method_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMethod)operator(,) stringoperator(,) ident(method_proc)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMethod)operator(,) stringoperator(,) ident(method_unbind)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_method)operator(,) integer(1)operator(\);) - - ident(rb_cUnboundMethod) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_undef_alloc_func)operator(()ident(rb_cUnboundMethod)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cUnboundMethod)operator(\),) stringoperator(\);) - ident(rb_define_method)operator(()ident(rb_cUnboundMethod)operator(,) stringoperator(,) ident(method_eq)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cUnboundMethod)operator(,) stringoperator(,) ident(method_clone)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cUnboundMethod)operator(,) stringoperator(,) ident(method_arity)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cUnboundMethod)operator(,) stringoperator(,) ident(method_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cUnboundMethod)operator(,) stringoperator(,) ident(method_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cUnboundMethod)operator(,) stringoperator(,) ident(umethod_bind)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_method)operator(,) integer(1)operator(\);) -operator(}) - -comment(/* - * Objects of class Binding encapsulate the execution - * context at some particular place in the code and retain this context - * for future use. The variables, methods, value of self, - * and possibly an iterator block that can be accessed in this context - * are all retained. Binding objects can be created using - * Kernel#binding, and are made available to the callback - * of Kernel#set_trace_func. - * - * These binding objects can be passed as the second argument of the - * Kernel#eval method, establishing an environment for the - * evaluation. - * - * class Demo - * def initialize(n\) - * @secret = n - * end - * def getBinding - * return binding(\) - * end - * end - * - * k1 = Demo.new(99\) - * b1 = k1.getBinding - * k2 = Demo.new(-3\) - * b2 = k2.getBinding - * - * eval("@secret", b1\) #=> 99 - * eval("@secret", b2\) #=> -3 - * eval("@secret"\) #=> nil - * - * Binding objects have no class-specific methods. - * - */) - -directive(void) -ident(Init_Binding)operator((\)) -operator({) - ident(rb_cBinding) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_undef_alloc_func)operator(()ident(rb_cBinding)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cBinding)operator(\),) stringoperator(\);) - ident(rb_define_method)operator(()ident(rb_cBinding)operator(,) stringoperator(,) ident(proc_clone)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cBinding)operator(,) stringoperator(,) ident(proc_dup)operator(,) integer(0)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_binding)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* Windows SEH refers data on the stack. */) -preprocessor(#undef) ident(SAVE_WIN32_EXCEPTION_LIST) -preprocessor(#if) ident(defined) ident(_WIN32) operator(||) ident(defined) ident(__CYGWIN__) -preprocessor(#if) ident(defined) ident(__CYGWIN__) -reserved(typedef) pre_type(unsigned) pre_type(long) ident(DWORD)operator(;) -preprocessor(#endif) - -directive(static) directive(inline) ident(DWORD) -ident(win32_get_exception_list)operator((\)) -operator({) - ident(DWORD) ident(p)operator(;) -preprocessor(# if) ident(defined) ident(_MSC_VER) -preprocessor(# ifdef) ident(_M_IX86) -preprocessor(# define) ident(SAVE_WIN32_EXCEPTION_LIST) -preprocessor(# if) ident(_MSC_VER) operator(>=) integer(1310) - comment(/* warning: unsafe assignment to fs:0 ... this is ok */) -preprocessor(# pragma) ident(warning)operator(()ident(disable)operator(:) integer(4733)operator(\)) -preprocessor(# endif) - ident(__asm) ident(mov) ident(eax)operator(,) ident(fs)operator(:[)integer(0)operator(];) - ident(__asm) ident(mov) ident(p)operator(,) ident(eax)operator(;) -preprocessor(# endif) -preprocessor(# elif) ident(defined) ident(__GNUC__) -preprocessor(# ifdef) ident(__i386__) -preprocessor(# define) ident(SAVE_WIN32_EXCEPTION_LIST) - ident(__asm__)operator(()string operator(:) stringoperator(()ident(p)operator(\)\);) -preprocessor(# endif) -preprocessor(# elif) ident(defined) ident(__BORLANDC__) -preprocessor(# define) ident(SAVE_WIN32_EXCEPTION_LIST) - ident(__emit__)operator(()hex(0x64)operator(,) hex(0xA1)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(\);) comment(/* mov eax, fs:[0] */) - ident(p) operator(=) ident(_EAX)operator(;) -preprocessor(# endif) - reserved(return) ident(p)operator(;) -operator(}) - -directive(static) directive(inline) directive(void) -ident(win32_set_exception_list)operator(()ident(p)operator(\)) - ident(DWORD) ident(p)operator(;) -operator({) -preprocessor(# if) ident(defined) ident(_MSC_VER) -preprocessor(# ifdef) ident(_M_IX86) - ident(__asm) ident(mov) ident(eax)operator(,) ident(p)operator(;) - ident(__asm) ident(mov) ident(fs)operator(:[)integer(0)operator(],) ident(eax)operator(;) -preprocessor(# endif) -preprocessor(# elif) ident(defined) ident(__GNUC__) -preprocessor(# ifdef) ident(__i386__) - ident(__asm__)operator(()string operator(::) stringoperator(()ident(p)operator(\)\);) -preprocessor(# endif) -preprocessor(# elif) ident(defined) ident(__BORLANDC__) - ident(_EAX) operator(=) ident(p)operator(;) - ident(__emit__)operator(()hex(0x64)operator(,) hex(0xA3)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(\);) comment(/* mov fs:[0], eax */) -preprocessor(# endif) -operator(}) - -preprocessor(#if) operator(!)ident(defined) ident(SAVE_WIN32_EXCEPTION_LIST) operator(&&) operator(!)ident(defined) ident(_WIN32_WCE) -preprocessor(# error) ident(unsupported) ident(platform) -preprocessor(#endif) -preprocessor(#endif) - -pre_type(int) ident(rb_thread_pending) operator(=) integer(0)operator(;) - -ident(VALUE) ident(rb_cThread)operator(;) - -directive(extern) ident(VALUE) ident(rb_last_status)operator(;) - -preprocessor(#define) ident(WAIT_FD) operator(()integer(1)operator(<<)integer(0)operator(\)) -preprocessor(#define) ident(WAIT_SELECT) operator(()integer(1)operator(<<)integer(1)operator(\)) -preprocessor(#define) ident(WAIT_TIME) operator(()integer(1)operator(<<)integer(2)operator(\)) -preprocessor(#define) ident(WAIT_JOIN) operator(()integer(1)operator(<<)integer(3)operator(\)) -preprocessor(#define) ident(WAIT_PID) operator(()integer(1)operator(<<)integer(4)operator(\)) - -comment(/* +infty, for this purpose */) -preprocessor(#define) ident(DELAY_INFTY) float(1)ident(E30) - -preprocessor(#if) operator(!)ident(defined) ident(HAVE_PAUSE) -preprocessor(# if) ident(defined) ident(_WIN32) operator(&&) operator(!)ident(defined) ident(__CYGWIN__) -preprocessor(# define) ident(pause)operator((\)) ident(Sleep)operator(()ident(INFINITE)operator(\)) -preprocessor(# else) -preprocessor(# define) ident(pause)operator((\)) ident(sleep)operator(()hex(0x7fffffff)operator(\)) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#define) ident(THREAD_TERMINATING) hex(0x400) comment(/* persistent flag */) -preprocessor(#define) ident(THREAD_NO_ENSURE) hex(0x800) comment(/* persistent flag */) -preprocessor(#define) ident(THREAD_FLAGS_MASK) hex(0xfc00) comment(/* mask for persistent flags */) - -preprocessor(#define) ident(FOREACH_THREAD_FROM)operator(()ident(f)operator(,)ident(x)operator(\)) ident(x) operator(=) ident(f)operator(;) reserved(do) operator({) ident(x) operator(=) ident(x)operator(->)ident(next)operator(;) -preprocessor(#define) ident(END_FOREACH_FROM)operator(()ident(f)operator(,)ident(x)operator(\)) operator(}) reserved(while) operator(()ident(x) operator(!=) ident(f)operator(\)) - -preprocessor(#define) ident(FOREACH_THREAD)operator(()ident(x)operator(\)) ident(FOREACH_THREAD_FROM)operator(()ident(curr_thread)operator(,)ident(x)operator(\)) -preprocessor(#define) ident(END_FOREACH)operator(()ident(x)operator(\)) ident(END_FOREACH_FROM)operator(()ident(curr_thread)operator(,)ident(x)operator(\)) - -reserved(struct) ident(thread_status_t) operator({) - ident(NODE) operator(*)ident(node)operator(;) - - pre_type(int) ident(tracing)operator(;) - ident(VALUE) ident(errinfo)operator(;) - ident(VALUE) ident(last_status)operator(;) - ident(VALUE) ident(last_line)operator(;) - ident(VALUE) ident(last_match)operator(;) - - pre_type(int) ident(safe)operator(;) - - reserved(enum) ident(rb_thread_status) ident(status)operator(;) - pre_type(int) ident(wait_for)operator(;) - pre_type(int) ident(fd)operator(;) - ident(fd_set) ident(readfds)operator(;) - ident(fd_set) ident(writefds)operator(;) - ident(fd_set) ident(exceptfds)operator(;) - pre_type(int) ident(select_value)operator(;) - pre_type(double) ident(delay)operator(;) - ident(rb_thread_t) ident(join)operator(;) -operator(};) - -preprocessor(#define) ident(THREAD_COPY_STATUS)operator(()ident(src)operator(,) ident(dst)operator(\)) operator(()directive(void)operator(\)() \ - operator(()ident(dst)operator(\)->)ident(node) operator(=) operator(()ident(src)operator(\)->)ident(node)operator(,) \ - \ - operator(()ident(dst)operator(\)->)ident(tracing) operator(=) operator(()ident(src)operator(\)->)ident(tracing)operator(,) \ - operator(()ident(dst)operator(\)->)ident(errinfo) operator(=) operator(()ident(src)operator(\)->)ident(errinfo)operator(,) \ - operator(()ident(dst)operator(\)->)ident(last_status) operator(=) operator(()ident(src)operator(\)->)ident(last_status)operator(,) \ - operator(()ident(dst)operator(\)->)ident(last_line) operator(=) operator(()ident(src)operator(\)->)ident(last_line)operator(,) \ - operator(()ident(dst)operator(\)->)ident(last_match) operator(=) operator(()ident(src)operator(\)->)ident(last_match)operator(,) \ - \ - operator(()ident(dst)operator(\)->)ident(safe) operator(=) operator(()ident(src)operator(\)->)ident(safe)operator(,) \ - \ - operator(()ident(dst)operator(\)->)ident(status) operator(=) operator(()ident(src)operator(\)->)ident(status)operator(,) \ - operator(()ident(dst)operator(\)->)ident(wait_for) operator(=) operator(()ident(src)operator(\)->)ident(wait_for)operator(,) \ - operator(()ident(dst)operator(\)->)ident(fd) operator(=) operator(()ident(src)operator(\)->)ident(fd)operator(,) \ - operator(()ident(dst)operator(\)->)ident(readfds) operator(=) operator(()ident(src)operator(\)->)ident(readfds)operator(,) \ - operator(()ident(dst)operator(\)->)ident(writefds) operator(=) operator(()ident(src)operator(\)->)ident(writefds)operator(,) \ - operator(()ident(dst)operator(\)->)ident(exceptfds) operator(=) operator(()ident(src)operator(\)->)ident(exceptfds)operator(,) \ - operator(()ident(dst)operator(\)->)ident(select_value) operator(=) operator(()ident(src)operator(\)->)ident(select_value)operator(,) \ - operator(()ident(dst)operator(\)->)ident(delay) operator(=) operator(()ident(src)operator(\)->)ident(delay)operator(,) \ - operator(()ident(dst)operator(\)->)ident(join) operator(=) operator(()ident(src)operator(\)->)ident(join)operator(,) \ - integer(0)operator(\)) - -pre_type(int) -ident(rb_thread_set_raised)operator(()ident(th)operator(\)) - ident(rb_thread_t) ident(th)operator(;) -operator({) - reserved(if) operator(()ident(th)operator(->)ident(flags) operator(&) ident(RAISED_EXCEPTION)operator(\)) operator({) - reserved(return) integer(1)operator(;) - operator(}) - ident(th)operator(->)ident(flags) operator(|=) ident(RAISED_EXCEPTION)operator(;) - reserved(return) integer(0)operator(;) -operator(}) - -pre_type(int) -ident(rb_thread_reset_raised)operator(()ident(th)operator(\)) - ident(rb_thread_t) ident(th)operator(;) -operator({) - reserved(if) operator((!()ident(th)operator(->)ident(flags) operator(&) ident(RAISED_EXCEPTION)operator(\)\)) operator({) - reserved(return) integer(0)operator(;) - operator(}) - ident(th)operator(->)ident(flags) operator(&=) operator(~)ident(RAISED_EXCEPTION)operator(;) - reserved(return) integer(1)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(thread_no_ensure)operator((\)) -operator({) - reserved(return) operator((()ident(curr_thread)operator(->)ident(flags) operator(&) ident(THREAD_NO_ENSURE)operator(\)) operator(==) ident(THREAD_NO_ENSURE)operator(\);) -operator(}) - -directive(static) directive(void) ident(rb_thread_ready) ident(_)operator((()ident(rb_thread_t)operator(\)\);) - -directive(static) ident(VALUE) ident(run_trap_eval) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(run_trap_eval)operator(()ident(arg)operator(\)) - ident(VALUE) ident(arg)operator(;) -operator({) - ident(VALUE) operator(*)ident(p) operator(=) operator(()ident(VALUE) operator(*\))ident(arg)operator(;) - reserved(return) ident(rb_eval_cmd)operator(()ident(p)operator([)integer(0)operator(],) ident(p)operator([)integer(1)operator(],) operator(()pre_type(int)operator(\))ident(p)operator([)integer(2)operator(]\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_trap_eval)operator(()ident(cmd)operator(,) ident(sig)operator(,) ident(safe)operator(\)) - ident(VALUE) ident(cmd)operator(;) - pre_type(int) ident(sig)operator(,) ident(safe)operator(;) -operator({) - pre_type(int) ident(state)operator(;) - ident(VALUE) ident(val) operator(=) ident(Qnil)operator(;) comment(/* OK */) - directive(volatile) reserved(struct) ident(thread_status_t) ident(save)operator(;) - ident(VALUE) ident(arg)operator([)integer(3)operator(];) - - ident(arg)operator([)integer(0)operator(]) operator(=) ident(cmd)operator(;) - ident(arg)operator([)integer(1)operator(]) operator(=) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(INT2FIX)operator(()ident(sig)operator(\)\);) - ident(arg)operator([)integer(2)operator(]) operator(=) operator(()ident(VALUE)operator(\))ident(safe)operator(;) - ident(THREAD_COPY_STATUS)operator(()ident(curr_thread)operator(,) operator(&)ident(save)operator(\);) - ident(rb_thread_ready)operator(()ident(curr_thread)operator(\);) - ident(PUSH_ITER)operator(()ident(ITER_NOT)operator(\);) - ident(val) operator(=) ident(rb_protect)operator(()ident(run_trap_eval)operator(,) operator(()ident(VALUE)operator(\)&)ident(arg)operator(,) operator(&)ident(state)operator(\);) - ident(POP_ITER)operator((\);) - ident(THREAD_COPY_STATUS)operator((&)ident(save)operator(,) ident(curr_thread)operator(\);) - - reserved(if) operator(()ident(state)operator(\)) operator({) - ident(rb_trap_immediate) operator(=) integer(0)operator(;) - ident(rb_thread_ready)operator(()ident(curr_thread)operator(\);) - ident(JUMP_TAG)operator(()ident(state)operator(\);) - operator(}) - - reserved(if) operator(()ident(curr_thread)operator(->)ident(status) operator(==) ident(THREAD_STOPPED)operator(\)) operator({) - ident(rb_thread_schedule)operator((\);) - operator(}) - ident(errno) operator(=) ident(EINTR)operator(;) - - reserved(return) ident(val)operator(;) -operator(}) - -directive(static) directive(const) pre_type(char) operator(*) -ident(thread_status_name)operator(()ident(status)operator(\)) - reserved(enum) ident(rb_thread_status) ident(status)operator(;) -operator({) - reserved(switch) operator(()ident(status)operator(\)) operator({) - reserved(case) ident(THREAD_RUNNABLE)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(THREAD_STOPPED)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(THREAD_TO_KILL)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(THREAD_KILLED)operator(:) - reserved(return) stringoperator(;) - reserved(default)operator(:) - reserved(return) stringoperator(;) - operator(}) -operator(}) - -comment(/* $SAFE accessor */) -directive(void) -ident(rb_set_safe_level)operator(()ident(level)operator(\)) - pre_type(int) ident(level)operator(;) -operator({) - reserved(if) operator(()ident(level) operator(>) ident(ruby_safe_level)operator(\)) operator({) - reserved(if) operator(()ident(level) operator(>) ident(SAFE_LEVEL_MAX)operator(\)) ident(level) operator(=) ident(SAFE_LEVEL_MAX)operator(;) - ident(ruby_safe_level) operator(=) ident(level)operator(;) - ident(curr_thread)operator(->)ident(safe) operator(=) ident(level)operator(;) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(safe_getter)operator((\)) -operator({) - reserved(return) ident(INT2NUM)operator(()ident(ruby_safe_level)operator(\);) -operator(}) - -directive(static) directive(void) -ident(safe_setter)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - pre_type(int) ident(level) operator(=) ident(NUM2INT)operator(()ident(val)operator(\);) - - reserved(if) operator(()ident(level) operator(<) ident(ruby_safe_level)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) - ident(ruby_safe_level)operator(,) ident(level)operator(\);) - operator(}) - reserved(if) operator(()ident(level) operator(>) ident(SAFE_LEVEL_MAX)operator(\)) ident(level) operator(=) ident(SAFE_LEVEL_MAX)operator(;) - ident(ruby_safe_level) operator(=) ident(level)operator(;) - ident(curr_thread)operator(->)ident(safe) operator(=) ident(level)operator(;) -operator(}) - -comment(/* Return the current time as a floating-point number */) -directive(static) pre_type(double) -ident(timeofday)operator((\)) -operator({) - reserved(struct) ident(timeval) ident(tv)operator(;) -preprocessor(#ifdef) ident(CLOCK_MONOTONIC) - reserved(struct) ident(timespec) ident(tp)operator(;) - - reserved(if) operator(()ident(clock_gettime)operator(()ident(CLOCK_MONOTONIC)operator(,) operator(&)ident(tp)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(return) operator(()pre_type(double)operator(\))ident(tp)operator(.)ident(tv_sec) operator(+) operator(()pre_type(double)operator(\))ident(tp)operator(.)ident(tv_nsec) operator(*) float(1)ident(e)operator(-)integer(9)operator(;) - operator(}) -preprocessor(#endif) - ident(gettimeofday)operator((&)ident(tv)operator(,) pre_constant(NULL)operator(\);) - reserved(return) operator(()pre_type(double)operator(\))ident(tv)operator(.)ident(tv_sec) operator(+) operator(()pre_type(double)operator(\))ident(tv)operator(.)ident(tv_usec) operator(*) float(1)ident(e)operator(-)integer(6)operator(;) -operator(}) - -preprocessor(#define) ident(STACK)operator(()ident(addr)operator(\)) operator(()ident(th)operator(->)ident(stk_pos)operator(<()ident(VALUE)operator(*\)()ident(addr)operator(\)) operator(&&) operator(()ident(VALUE)operator(*\)()ident(addr)operator(\)<)ident(th)operator(->)ident(stk_pos)operator(+)ident(th)operator(->)ident(stk_len)operator(\)) -preprocessor(#define) ident(ADJ)operator(()ident(addr)operator(\)) operator(()directive(void)operator(*\)()ident(STACK)operator(()ident(addr)operator(\)?((()ident(VALUE)operator(*\)()ident(addr)operator(\)-)ident(th)operator(->)ident(stk_pos)operator(\)+)ident(th)operator(->)ident(stk_ptr)operator(\):()ident(VALUE)operator(*\)()ident(addr)operator(\)\)) -directive(static) directive(void) -ident(thread_mark)operator(()ident(th)operator(\)) - ident(rb_thread_t) ident(th)operator(;) -operator({) - reserved(struct) ident(FRAME) operator(*)ident(frame)operator(;) - reserved(struct) ident(BLOCK) operator(*)ident(block)operator(;) - - ident(rb_gc_mark)operator(()ident(th)operator(->)ident(result)operator(\);) - ident(rb_gc_mark)operator(()ident(th)operator(->)ident(thread)operator(\);) - reserved(if) operator(()ident(th)operator(->)ident(join)operator(\)) ident(rb_gc_mark)operator(()ident(th)operator(->)ident(join)operator(->)ident(thread)operator(\);) - - ident(rb_gc_mark)operator(()ident(th)operator(->)ident(klass)operator(\);) - ident(rb_gc_mark)operator(()ident(th)operator(->)ident(wrapper)operator(\);) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(th)operator(->)ident(cref)operator(\);) - - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(th)operator(->)ident(scope)operator(\);) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(th)operator(->)ident(dyna_vars)operator(\);) - ident(rb_gc_mark)operator(()ident(th)operator(->)ident(errinfo)operator(\);) - ident(rb_gc_mark)operator(()ident(th)operator(->)ident(last_status)operator(\);) - ident(rb_gc_mark)operator(()ident(th)operator(->)ident(last_line)operator(\);) - ident(rb_gc_mark)operator(()ident(th)operator(->)ident(last_match)operator(\);) - ident(rb_mark_tbl)operator(()ident(th)operator(->)ident(locals)operator(\);) - ident(rb_gc_mark)operator(()ident(th)operator(->)ident(thgroup)operator(\);) - ident(rb_gc_mark_maybe)operator(()ident(th)operator(->)ident(sandbox)operator(\);) - - comment(/* mark data in copied stack */) - reserved(if) operator(()ident(th) operator(==) ident(curr_thread)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(th)operator(->)ident(status) operator(==) ident(THREAD_KILLED)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(th)operator(->)ident(stk_len) operator(==) integer(0)operator(\)) reserved(return)operator(;) comment(/* stack not active, no need to mark. */) - reserved(if) operator(()ident(th)operator(->)ident(stk_ptr)operator(\)) operator({) - ident(rb_gc_mark_locations)operator(()ident(th)operator(->)ident(stk_ptr)operator(,) ident(th)operator(->)ident(stk_ptr)operator(+)ident(th)operator(->)ident(stk_len)operator(\);) -preprocessor(#if) ident(defined)operator(()ident(THINK_C)operator(\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) - ident(rb_gc_mark_locations)operator(()ident(th)operator(->)ident(stk_ptr)operator(+)integer(2)operator(,) ident(th)operator(->)ident(stk_ptr)operator(+)ident(th)operator(->)ident(stk_len)operator(+)integer(2)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(__ia64) - reserved(if) operator(()ident(th)operator(->)ident(bstr_ptr)operator(\)) operator({) - ident(rb_gc_mark_locations)operator(()ident(th)operator(->)ident(bstr_ptr)operator(,) ident(th)operator(->)ident(bstr_ptr)operator(+)ident(th)operator(->)ident(bstr_len)operator(\);) - operator(}) -preprocessor(#endif) - operator(}) - ident(frame) operator(=) ident(th)operator(->)ident(frame)operator(;) - reserved(while) operator(()ident(frame) operator(&&) ident(frame) operator(!=) ident(top_frame)operator(\)) operator({) - ident(frame) operator(=) ident(ADJ)operator(()ident(frame)operator(\);) - ident(rb_gc_mark_frame)operator(()ident(frame)operator(\);) - reserved(if) operator(()ident(frame)operator(->)ident(tmp)operator(\)) operator({) - reserved(struct) ident(FRAME) operator(*)ident(tmp) operator(=) ident(frame)operator(->)ident(tmp)operator(;) - - reserved(while) operator(()ident(tmp) operator(&&) ident(tmp) operator(!=) ident(top_frame)operator(\)) operator({) - ident(tmp) operator(=) ident(ADJ)operator(()ident(tmp)operator(\);) - ident(rb_gc_mark_frame)operator(()ident(tmp)operator(\);) - ident(tmp) operator(=) ident(tmp)operator(->)ident(prev)operator(;) - operator(}) - operator(}) - ident(frame) operator(=) ident(frame)operator(->)ident(prev)operator(;) - operator(}) - ident(block) operator(=) ident(th)operator(->)ident(block)operator(;) - reserved(while) operator(()ident(block)operator(\)) operator({) - ident(block) operator(=) ident(ADJ)operator(()ident(block)operator(\);) - ident(rb_gc_mark_frame)operator((&)ident(block)operator(->)ident(frame)operator(\);) - ident(block) operator(=) ident(block)operator(->)ident(prev)operator(;) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(mark_loading_thread)operator(()ident(key)operator(,) ident(value)operator(,) ident(lev)operator(\)) - ident(ID) ident(key)operator(;) - ident(VALUE) ident(value)operator(;) - pre_type(int) ident(lev)operator(;) -operator({) - ident(rb_gc_mark)operator(((()ident(rb_thread_t)operator(\))ident(value)operator(\)->)ident(thread)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(void) -ident(rb_gc_mark_threads)operator((\)) -operator({) - ident(rb_thread_t) ident(th)operator(;) - - comment(/* static global mark */) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(ruby_cref)operator(\);) - - reserved(if) operator((!)ident(curr_thread)operator(\)) reserved(return)operator(;) - ident(rb_gc_mark)operator(()ident(main_thread)operator(->)ident(thread)operator(\);) - ident(rb_gc_mark)operator(()ident(curr_thread)operator(->)ident(thread)operator(\);) - ident(FOREACH_THREAD_FROM)operator(()ident(main_thread)operator(,) ident(th)operator(\)) operator({) - reserved(switch) operator(()ident(th)operator(->)ident(status)operator(\)) operator({) - reserved(case) ident(THREAD_TO_KILL)operator(:) - reserved(case) ident(THREAD_RUNNABLE)operator(:) - reserved(break)operator(;) - reserved(case) ident(THREAD_STOPPED)operator(:) - reserved(if) operator(()ident(th)operator(->)ident(wait_for)operator(\)) reserved(break)operator(;) - reserved(default)operator(:) - reserved(continue)operator(;) - operator(}) - ident(rb_gc_mark)operator(()ident(th)operator(->)ident(thread)operator(\);) - operator(}) ident(END_FOREACH_FROM)operator(()ident(main_thread)operator(,) ident(th)operator(\);) - reserved(if) operator(()ident(loading_tbl)operator(\)) ident(st_foreach)operator(()ident(loading_tbl)operator(,) ident(mark_loading_thread)operator(,) integer(0)operator(\);) -operator(}) - -directive(void) -ident(rb_gc_abort_threads)operator((\)) -operator({) - ident(rb_thread_t) ident(th)operator(;) - - reserved(if) operator((!)ident(main_thread)operator(\)) - reserved(return)operator(;) - - ident(FOREACH_THREAD_FROM)operator(()ident(main_thread)operator(,) ident(th)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(th)operator(->)ident(thread)operator(,) ident(FL_MARK)operator(\)\)) reserved(continue)operator(;) - reserved(if) operator(()ident(th)operator(->)ident(status) operator(==) ident(THREAD_STOPPED)operator(\)) operator({) - ident(th)operator(->)ident(status) operator(=) ident(THREAD_TO_KILL)operator(;) - ident(rb_gc_mark)operator(()ident(th)operator(->)ident(thread)operator(\);) - operator(}) - operator(}) ident(END_FOREACH_FROM)operator(()ident(main_thread)operator(,) ident(th)operator(\);) -operator(}) - -directive(static) directive(inline) directive(void) -ident(stack_free)operator(()ident(th)operator(\)) - ident(rb_thread_t) ident(th)operator(;) -operator({) - reserved(if) operator(()ident(th)operator(->)ident(stk_ptr)operator(\)) ident(free)operator(()ident(th)operator(->)ident(stk_ptr)operator(\);) - ident(th)operator(->)ident(stk_ptr) operator(=) integer(0)operator(;) -preprocessor(#ifdef) ident(__ia64) - reserved(if) operator(()ident(th)operator(->)ident(bstr_ptr)operator(\)) ident(free)operator(()ident(th)operator(->)ident(bstr_ptr)operator(\);) - ident(th)operator(->)ident(bstr_ptr) operator(=) integer(0)operator(;) -preprocessor(#endif) -operator(}) - -directive(static) directive(void) -ident(thread_free)operator(()ident(th)operator(\)) - ident(rb_thread_t) ident(th)operator(;) -operator({) - ident(stack_free)operator(()ident(th)operator(\);) - reserved(if) operator(()ident(th)operator(->)ident(locals)operator(\)) ident(st_free_table)operator(()ident(th)operator(->)ident(locals)operator(\);) - reserved(if) operator(()ident(th)operator(->)ident(status) operator(!=) ident(THREAD_KILLED)operator(\)) operator({) - reserved(if) operator(()ident(th)operator(->)ident(prev)operator(\)) ident(th)operator(->)ident(prev)operator(->)ident(next) operator(=) ident(th)operator(->)ident(next)operator(;) - reserved(if) operator(()ident(th)operator(->)ident(next)operator(\)) ident(th)operator(->)ident(next)operator(->)ident(prev) operator(=) ident(th)operator(->)ident(prev)operator(;) - operator(}) - reserved(if) operator(()ident(th) operator(!=) ident(main_thread)operator(\)) ident(free)operator(()ident(th)operator(\);) -operator(}) - -directive(static) ident(rb_thread_t) -ident(rb_thread_check)operator(()ident(data)operator(\)) - ident(VALUE) ident(data)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(data)operator(\)) operator(!=) ident(T_DATA) operator(||) ident(RDATA)operator(()ident(data)operator(\)->)ident(dmark) operator(!=) operator(()ident(RUBY_DATA_FUNC)operator(\))ident(thread_mark)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(data)operator(\)\);) - operator(}) - reserved(return) operator(()ident(rb_thread_t)operator(\))ident(RDATA)operator(()ident(data)operator(\)->)ident(data)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(rb_thread_raise) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(rb_thread_t)operator(\)\);) - -directive(static) ident(VALUE) ident(th_raise_exception)operator(;) -directive(static) ident(NODE) operator(*)ident(th_raise_node)operator(;) -directive(static) ident(VALUE) ident(th_cmd)operator(;) -directive(static) pre_type(int) ident(th_sig)operator(,) ident(th_safe)operator(;) - -preprocessor(#define) ident(RESTORE_NORMAL) integer(1) -preprocessor(#define) ident(RESTORE_FATAL) integer(2) -preprocessor(#define) ident(RESTORE_INTERRUPT) integer(3) -preprocessor(#define) ident(RESTORE_TRAP) integer(4) -preprocessor(#define) ident(RESTORE_RAISE) integer(5) -preprocessor(#define) ident(RESTORE_SIGNAL) integer(6) -preprocessor(#define) ident(RESTORE_EXIT) integer(7) - -directive(extern) ident(VALUE) operator(*)ident(rb_gc_stack_start)operator(;) -preprocessor(#ifdef) ident(__ia64) -directive(extern) ident(VALUE) operator(*)ident(rb_gc_register_stack_start)operator(;) -preprocessor(#endif) - -directive(static) directive(void) -ident(rb_thread_save_context)operator(()ident(th)operator(\)) - ident(rb_thread_t) ident(th)operator(;) -operator({) - ident(VALUE) operator(*)ident(pos)operator(;) - ident(size_t) ident(len)operator(;) - directive(static) ident(VALUE) ident(tval)operator(;) - - ident(len) operator(=) ident(ruby_stack_length)operator((&)ident(pos)operator(\);) - ident(th)operator(->)ident(stk_len) operator(=) integer(0)operator(;) - ident(th)operator(->)ident(stk_pos) operator(=) ident(pos)operator(;) - reserved(if) operator(()ident(len) operator(>) ident(th)operator(->)ident(stk_max)operator(\)) operator({) - ident(VALUE) operator(*)ident(ptr) operator(=) ident(realloc)operator(()ident(th)operator(->)ident(stk_ptr)operator(,) reserved(sizeof)operator(()ident(VALUE)operator(\)) operator(*) ident(len)operator(\);) - reserved(if) operator((!)ident(ptr)operator(\)) ident(rb_memerror)operator((\);) - ident(th)operator(->)ident(stk_ptr) operator(=) ident(ptr)operator(;) - ident(th)operator(->)ident(stk_max) operator(=) ident(len)operator(;) - operator(}) - ident(th)operator(->)ident(stk_len) operator(=) ident(len)operator(;) - ident(FLUSH_REGISTER_WINDOWS)operator(;) - ident(MEMCPY)operator(()ident(th)operator(->)ident(stk_ptr)operator(,) ident(th)operator(->)ident(stk_pos)operator(,) ident(VALUE)operator(,) ident(th)operator(->)ident(stk_len)operator(\);) -preprocessor(#ifdef) ident(__ia64) - ident(th)operator(->)ident(bstr_pos) operator(=) ident(rb_gc_register_stack_start)operator(;) - ident(len) operator(=) operator(()ident(VALUE)operator(*\))ident(rb_ia64_bsp)operator((\)) operator(-) ident(th)operator(->)ident(bstr_pos)operator(;) - ident(th)operator(->)ident(bstr_len) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(len) operator(>) ident(th)operator(->)ident(bstr_max)operator(\)) operator({) - ident(VALUE) operator(*)ident(ptr) operator(=) ident(realloc)operator(()ident(th)operator(->)ident(bstr_ptr)operator(,) reserved(sizeof)operator(()ident(VALUE)operator(\)) operator(*) ident(len)operator(\);) - reserved(if) operator((!)ident(ptr)operator(\)) ident(rb_memerror)operator((\);) - ident(th)operator(->)ident(bstr_ptr) operator(=) ident(ptr)operator(;) - ident(th)operator(->)ident(bstr_max) operator(=) ident(len)operator(;) - operator(}) - ident(th)operator(->)ident(bstr_len) operator(=) ident(len)operator(;) - ident(rb_ia64_flushrs)operator((\);) - ident(MEMCPY)operator(()ident(th)operator(->)ident(bstr_ptr)operator(,) ident(th)operator(->)ident(bstr_pos)operator(,) ident(VALUE)operator(,) ident(th)operator(->)ident(bstr_len)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(SAVE_WIN32_EXCEPTION_LIST) - ident(th)operator(->)ident(win32_exception_list) operator(=) ident(win32_get_exception_list)operator((\);) -preprocessor(#endif) - - ident(th)operator(->)ident(frame) operator(=) ident(ruby_frame)operator(;) - ident(th)operator(->)ident(scope) operator(=) ident(ruby_scope)operator(;) - ident(ruby_scope)operator(->)ident(flags) operator(|=) ident(SCOPE_DONT_RECYCLE)operator(;) - ident(th)operator(->)ident(klass) operator(=) ident(ruby_class)operator(;) - ident(th)operator(->)ident(wrapper) operator(=) ident(ruby_wrapper)operator(;) - ident(th)operator(->)ident(cref) operator(=) ident(ruby_cref)operator(;) - ident(th)operator(->)ident(dyna_vars) operator(=) ident(ruby_dyna_vars)operator(;) - ident(th)operator(->)ident(block) operator(=) ident(ruby_block)operator(;) - ident(th)operator(->)ident(flags) operator(&=) ident(THREAD_FLAGS_MASK)operator(;) - ident(th)operator(->)ident(flags) operator(|=) operator(()ident(rb_trap_immediate)operator(<<)integer(8)operator(\)) operator(|) ident(scope_vmode)operator(;) - ident(th)operator(->)ident(iter) operator(=) ident(ruby_iter)operator(;) - ident(th)operator(->)ident(tag) operator(=) ident(prot_tag)operator(;) - ident(th)operator(->)ident(tracing) operator(=) ident(tracing)operator(;) - ident(th)operator(->)ident(errinfo) operator(=) ident(ruby_errinfo)operator(;) - ident(th)operator(->)ident(last_status) operator(=) ident(rb_last_status)operator(;) - ident(tval) operator(=) ident(rb_lastline_get)operator((\);) - ident(rb_lastline_set)operator(()ident(th)operator(->)ident(last_line)operator(\);) - ident(th)operator(->)ident(last_line) operator(=) ident(tval)operator(;) - ident(tval) operator(=) ident(rb_backref_get)operator((\);) - ident(rb_backref_set)operator(()ident(th)operator(->)ident(last_match)operator(\);) - ident(th)operator(->)ident(last_match) operator(=) ident(tval)operator(;) - ident(th)operator(->)ident(safe) operator(=) ident(ruby_safe_level)operator(;) - - ident(th)operator(->)ident(node) operator(=) ident(ruby_current_node)operator(;) - reserved(if) operator(()ident(ruby_sandbox_save) operator(!=) pre_constant(NULL)operator(\)) operator({) - ident(ruby_sandbox_save)operator(()ident(th)operator(\);) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(rb_thread_switch)operator(()ident(n)operator(\)) - pre_type(int) ident(n)operator(;) -operator({) - ident(rb_trap_immediate) operator(=) operator(()ident(curr_thread)operator(->)ident(flags)operator(&)hex(0x100)operator(\)?)integer(1)operator(:)integer(0)operator(;) - reserved(switch) operator(()ident(n)operator(\)) operator({) - reserved(case) integer(0)operator(:) - reserved(return) integer(0)operator(;) - reserved(case) ident(RESTORE_FATAL)operator(:) - ident(JUMP_TAG)operator(()ident(TAG_FATAL)operator(\);) - reserved(break)operator(;) - reserved(case) ident(RESTORE_INTERRUPT)operator(:) - ident(rb_interrupt)operator((\);) - reserved(break)operator(;) - reserved(case) ident(RESTORE_TRAP)operator(:) - ident(rb_trap_eval)operator(()ident(th_cmd)operator(,) ident(th_sig)operator(,) ident(th_safe)operator(\);) - reserved(break)operator(;) - reserved(case) ident(RESTORE_RAISE)operator(:) - ident(ruby_frame)operator(->)ident(last_func) operator(=) integer(0)operator(;) - ident(ruby_current_node) operator(=) ident(th_raise_node)operator(;) - ident(rb_raise_jump)operator(()ident(th_raise_exception)operator(\);) - reserved(break)operator(;) - reserved(case) ident(RESTORE_SIGNAL)operator(:) - ident(rb_thread_signal_raise)operator(()ident(th_sig)operator(\);) - reserved(break)operator(;) - reserved(case) ident(RESTORE_EXIT)operator(:) - ident(ruby_errinfo) operator(=) ident(th_raise_exception)operator(;) - ident(ruby_current_node) operator(=) ident(th_raise_node)operator(;) - reserved(if) operator((!)ident(rb_obj_is_kind_of)operator(()ident(ruby_errinfo)operator(,) ident(rb_eSystemExit)operator(\)\)) operator({) - ident(terminate_process)operator(()ident(EXIT_FAILURE)operator(,) ident(ruby_errinfo)operator(\);) - operator(}) - ident(rb_exc_raise)operator(()ident(th_raise_exception)operator(\);) - reserved(break)operator(;) - reserved(case) ident(RESTORE_NORMAL)operator(:) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - reserved(return) integer(1)operator(;) -operator(}) - -preprocessor(#define) ident(THREAD_SAVE_CONTEXT)operator(()ident(th)operator(\)) \ - operator(()ident(rb_thread_switch)operator((()ident(FLUSH_REGISTER_WINDOWS)operator(,) ident(ruby_setjmp)operator(()ident(rb_thread_save_context)operator(()ident(th)operator(\),) operator(()ident(th)operator(\)->)ident(context)operator(\)\)\)\)) - -ident(NORETURN)operator(()directive(static) directive(void) ident(rb_thread_restore_context) ident(_)operator((()ident(rb_thread_t)operator(,)pre_type(int)operator(\)\)\);) -ident(NORETURN)operator(()ident(NOINLINE)operator(()directive(static) directive(void) ident(rb_thread_restore_context_0)operator(()ident(rb_thread_t)operator(,)pre_type(int)operator(\)\)\);) -ident(NORETURN)operator(()ident(NOINLINE)operator(()directive(static) directive(void) ident(stack_extend)operator(()ident(rb_thread_t)operator(,) pre_type(int)operator(\)\)\);) - -directive(static) directive(void) -ident(rb_thread_restore_context_0)operator(()ident(rb_thread_t) ident(th)operator(,) pre_type(int) ident(exit)operator(\)) -operator({) - directive(static) ident(rb_thread_t) ident(tmp)operator(;) - directive(static) pre_type(int) ident(ex)operator(;) - directive(static) ident(VALUE) ident(tval)operator(;) - - ident(rb_trap_immediate) operator(=) integer(0)operator(;) comment(/* inhibit interrupts from here */) - reserved(if) operator(()ident(ruby_sandbox_restore) operator(!=) pre_constant(NULL)operator(\)) operator({) - ident(ruby_sandbox_restore)operator(()ident(th)operator(\);) - operator(}) - ident(ruby_frame) operator(=) ident(th)operator(->)ident(frame)operator(;) - ident(ruby_scope) operator(=) ident(th)operator(->)ident(scope)operator(;) - ident(ruby_class) operator(=) ident(th)operator(->)ident(klass)operator(;) - ident(ruby_wrapper) operator(=) ident(th)operator(->)ident(wrapper)operator(;) - ident(ruby_cref) operator(=) ident(th)operator(->)ident(cref)operator(;) - ident(ruby_dyna_vars) operator(=) ident(th)operator(->)ident(dyna_vars)operator(;) - ident(ruby_block) operator(=) ident(th)operator(->)ident(block)operator(;) - ident(scope_vmode) operator(=) ident(th)operator(->)ident(flags)operator(&)ident(SCOPE_MASK)operator(;) - ident(ruby_iter) operator(=) ident(th)operator(->)ident(iter)operator(;) - ident(prot_tag) operator(=) ident(th)operator(->)ident(tag)operator(;) - ident(tracing) operator(=) ident(th)operator(->)ident(tracing)operator(;) - ident(ruby_errinfo) operator(=) ident(th)operator(->)ident(errinfo)operator(;) - ident(rb_last_status) operator(=) ident(th)operator(->)ident(last_status)operator(;) - ident(ruby_safe_level) operator(=) ident(th)operator(->)ident(safe)operator(;) - - ident(ruby_current_node) operator(=) ident(th)operator(->)ident(node)operator(;) - -preprocessor(#ifdef) ident(SAVE_WIN32_EXCEPTION_LIST) - ident(win32_set_exception_list)operator(()ident(th)operator(->)ident(win32_exception_list)operator(\);) -preprocessor(#endif) - ident(tmp) operator(=) ident(th)operator(;) - ident(ex) operator(=) ident(exit)operator(;) - ident(FLUSH_REGISTER_WINDOWS)operator(;) - ident(MEMCPY)operator(()ident(tmp)operator(->)ident(stk_pos)operator(,) ident(tmp)operator(->)ident(stk_ptr)operator(,) ident(VALUE)operator(,) ident(tmp)operator(->)ident(stk_len)operator(\);) -preprocessor(#ifdef) ident(__ia64) - ident(MEMCPY)operator(()ident(tmp)operator(->)ident(bstr_pos)operator(,) ident(tmp)operator(->)ident(bstr_ptr)operator(,) ident(VALUE)operator(,) ident(tmp)operator(->)ident(bstr_len)operator(\);) -preprocessor(#endif) - - ident(tval) operator(=) ident(rb_lastline_get)operator((\);) - ident(rb_lastline_set)operator(()ident(tmp)operator(->)ident(last_line)operator(\);) - ident(tmp)operator(->)ident(last_line) operator(=) ident(tval)operator(;) - ident(tval) operator(=) ident(rb_backref_get)operator((\);) - ident(rb_backref_set)operator(()ident(tmp)operator(->)ident(last_match)operator(\);) - ident(tmp)operator(->)ident(last_match) operator(=) ident(tval)operator(;) - - ident(ruby_longjmp)operator(()ident(tmp)operator(->)ident(context)operator(,) ident(ex)operator(\);) -operator(}) - -preprocessor(#ifdef) ident(__ia64) -preprocessor(#define) ident(C)operator(()ident(a)operator(\)) ident(rse_)preprocessor(#)preprocessor(#a)preprocessor(#)preprocessor(#0)operator(,) ident(rse_)preprocessor(#)preprocessor(#a)preprocessor(#)preprocessor(#1)operator(,) ident(rse_)preprocessor(#)preprocessor(#a)preprocessor(#)preprocessor(#2)operator(,) ident(rse_)preprocessor(#)preprocessor(#a)preprocessor(#)preprocessor(#3)operator(,) ident(rse_)preprocessor(#)preprocessor(#a)preprocessor(#)preprocessor(#4) -preprocessor(#define) ident(E)operator(()ident(a)operator(\)) ident(rse_)preprocessor(#)preprocessor(#a)preprocessor(#)preprocessor(#0)operator(=) ident(rse_)preprocessor(#)preprocessor(#a)preprocessor(#)preprocessor(#1)operator(=) ident(rse_)preprocessor(#)preprocessor(#a)preprocessor(#)preprocessor(#2)operator(=) ident(rse_)preprocessor(#)preprocessor(#a)preprocessor(#)preprocessor(#3)operator(=) ident(rse_)preprocessor(#)preprocessor(#a)preprocessor(#)preprocessor(#4) -directive(static) directive(volatile) pre_type(int) ident(C)operator(()ident(a)operator(\),) ident(C)operator(()ident(b)operator(\),) ident(C)operator(()ident(c)operator(\),) ident(C)operator(()ident(d)operator(\),) ident(C)operator(()ident(e)operator(\);) -directive(static) directive(volatile) pre_type(int) ident(C)operator(()ident(f)operator(\),) ident(C)operator(()ident(g)operator(\),) ident(C)operator(()ident(h)operator(\),) ident(C)operator(()ident(i)operator(\),) ident(C)operator(()ident(j)operator(\);) -directive(static) directive(volatile) pre_type(int) ident(C)operator(()ident(k)operator(\),) ident(C)operator(()ident(l)operator(\),) ident(C)operator(()ident(m)operator(\),) ident(C)operator(()ident(n)operator(\),) ident(C)operator(()ident(o)operator(\);) -directive(static) directive(volatile) pre_type(int) ident(C)operator(()ident(p)operator(\),) ident(C)operator(()ident(q)operator(\),) ident(C)operator(()ident(r)operator(\),) ident(C)operator(()ident(s)operator(\),) ident(C)operator(()ident(t)operator(\);) -pre_type(int) ident(rb_dummy_false) operator(=) integer(0)operator(;) -ident(NORETURN)operator(()ident(NOINLINE)operator(()directive(static) directive(void) ident(register_stack_extend)operator(()ident(rb_thread_t)operator(,) pre_type(int)operator(,) ident(VALUE) operator(*\)\)\);) -directive(static) directive(void) -ident(register_stack_extend)operator(()ident(rb_thread_t) ident(th)operator(,) pre_type(int) ident(exit)operator(,) ident(VALUE) operator(*)ident(curr_bsp)operator(\)) -operator({) - reserved(if) operator(()ident(rb_dummy_false)operator(\)) operator({) - comment(/* use registers as much as possible */) - ident(E)operator(()ident(a)operator(\)) operator(=) ident(E)operator(()ident(b)operator(\)) operator(=) ident(E)operator(()ident(c)operator(\)) operator(=) ident(E)operator(()ident(d)operator(\)) operator(=) ident(E)operator(()ident(e)operator(\)) operator(=) - ident(E)operator(()ident(f)operator(\)) operator(=) ident(E)operator(()ident(g)operator(\)) operator(=) ident(E)operator(()ident(h)operator(\)) operator(=) ident(E)operator(()ident(i)operator(\)) operator(=) ident(E)operator(()ident(j)operator(\)) operator(=) - ident(E)operator(()ident(k)operator(\)) operator(=) ident(E)operator(()ident(l)operator(\)) operator(=) ident(E)operator(()ident(m)operator(\)) operator(=) ident(E)operator(()ident(n)operator(\)) operator(=) ident(E)operator(()ident(o)operator(\)) operator(=) - ident(E)operator(()ident(p)operator(\)) operator(=) ident(E)operator(()ident(q)operator(\)) operator(=) ident(E)operator(()ident(r)operator(\)) operator(=) ident(E)operator(()ident(s)operator(\)) operator(=) ident(E)operator(()ident(t)operator(\)) operator(=) integer(0)operator(;) - ident(E)operator(()ident(a)operator(\)) operator(=) ident(E)operator(()ident(b)operator(\)) operator(=) ident(E)operator(()ident(c)operator(\)) operator(=) ident(E)operator(()ident(d)operator(\)) operator(=) ident(E)operator(()ident(e)operator(\)) operator(=) - ident(E)operator(()ident(f)operator(\)) operator(=) ident(E)operator(()ident(g)operator(\)) operator(=) ident(E)operator(()ident(h)operator(\)) operator(=) ident(E)operator(()ident(i)operator(\)) operator(=) ident(E)operator(()ident(j)operator(\)) operator(=) - ident(E)operator(()ident(k)operator(\)) operator(=) ident(E)operator(()ident(l)operator(\)) operator(=) ident(E)operator(()ident(m)operator(\)) operator(=) ident(E)operator(()ident(n)operator(\)) operator(=) ident(E)operator(()ident(o)operator(\)) operator(=) - ident(E)operator(()ident(p)operator(\)) operator(=) ident(E)operator(()ident(q)operator(\)) operator(=) ident(E)operator(()ident(r)operator(\)) operator(=) ident(E)operator(()ident(s)operator(\)) operator(=) ident(E)operator(()ident(t)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(curr_bsp) operator(<) ident(th)operator(->)ident(bstr_pos)operator(+)ident(th)operator(->)ident(bstr_len)operator(\)) operator({) - ident(register_stack_extend)operator(()ident(th)operator(,) ident(exit)operator(,) operator(()ident(VALUE)operator(*\))ident(rb_ia64_bsp)operator((\)\);) - operator(}) - ident(stack_extend)operator(()ident(th)operator(,) ident(exit)operator(\);) -operator(}) -preprocessor(#undef) ident(C) -preprocessor(#undef) ident(E) -preprocessor(#endif) - -directive(static) directive(void) -ident(stack_extend)operator(()ident(rb_thread_t) ident(th)operator(,) pre_type(int) ident(exit)operator(\)) -operator({) -preprocessor(#define) ident(STACK_PAD_SIZE) integer(1024) - directive(volatile) ident(VALUE) ident(space)operator([)ident(STACK_PAD_SIZE)operator(],) operator(*)ident(sp) operator(=) ident(space)operator(;) - -preprocessor(#if) operator(!)ident(STACK_GROW_DIRECTION) - reserved(if) operator(()ident(space) operator(<) ident(rb_gc_stack_start)operator(\)) operator({) - comment(/* Stack grows downward */) -preprocessor(#endif) -preprocessor(#if) ident(STACK_GROW_DIRECTION) operator(<=) integer(0) - reserved(if) operator(()ident(space) operator(>) ident(th)operator(->)ident(stk_pos)operator(\)) operator({) -preprocessor(# ifdef) ident(HAVE_ALLOCA) - ident(sp) operator(=) ident(ALLOCA_N)operator(()ident(VALUE)operator(,) operator(&)ident(space)operator([)integer(0)operator(]) operator(-) ident(th)operator(->)ident(stk_pos)operator(\);) -preprocessor(# else) - ident(stack_extend)operator(()ident(th)operator(,) ident(exit)operator(\);) -preprocessor(# endif) - operator(}) -preprocessor(#endif) -preprocessor(#if) operator(!)ident(STACK_GROW_DIRECTION) - operator(}) - reserved(else) operator({) - comment(/* Stack grows upward */) -preprocessor(#endif) -preprocessor(#if) ident(STACK_GROW_DIRECTION) operator(>=) integer(0) - reserved(if) operator((&)ident(space)operator([)ident(STACK_PAD_SIZE)operator(]) operator(<) ident(th)operator(->)ident(stk_pos) operator(+) ident(th)operator(->)ident(stk_len)operator(\)) operator({) -preprocessor(# ifdef) ident(HAVE_ALLOCA) - ident(sp) operator(=) ident(ALLOCA_N)operator(()ident(VALUE)operator(,) ident(th)operator(->)ident(stk_pos) operator(+) ident(th)operator(->)ident(stk_len) operator(-) operator(&)ident(space)operator([)ident(STACK_PAD_SIZE)operator(]\);) -preprocessor(# else) - ident(stack_extend)operator(()ident(th)operator(,) ident(exit)operator(\);) -preprocessor(# endif) - operator(}) -preprocessor(#endif) -preprocessor(#if) operator(!)ident(STACK_GROW_DIRECTION) - operator(}) -preprocessor(#endif) - ident(rb_thread_restore_context_0)operator(()ident(th)operator(,) ident(exit)operator(\);) -operator(}) -preprocessor(#ifdef) ident(__ia64) -preprocessor(#define) ident(stack_extend)operator(()ident(th)operator(,) ident(exit)operator(\)) ident(register_stack_extend)operator(()ident(th)operator(,) ident(exit)operator(,) operator(()ident(VALUE)operator(*\))ident(rb_ia64_bsp)operator((\)\)) -preprocessor(#endif) - -directive(static) directive(void) -ident(rb_thread_restore_context)operator(()ident(th)operator(,) ident(exit)operator(\)) - ident(rb_thread_t) ident(th)operator(;) - pre_type(int) ident(exit)operator(;) -operator({) - reserved(if) operator((!)ident(th)operator(->)ident(stk_ptr)operator(\)) ident(rb_bug)operator(()stringoperator(\);) - ident(stack_extend)operator(()ident(th)operator(,) ident(exit)operator(\);) -operator(}) - -directive(static) directive(void) -ident(rb_thread_ready)operator(()ident(th)operator(\)) - ident(rb_thread_t) ident(th)operator(;) -operator({) - ident(th)operator(->)ident(wait_for) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(th)operator(->)ident(status) operator(!=) ident(THREAD_TO_KILL)operator(\)) operator({) - ident(th)operator(->)ident(status) operator(=) ident(THREAD_RUNNABLE)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(rb_thread_die)operator(()ident(th)operator(\)) - ident(rb_thread_t) ident(th)operator(;) -operator({) - ident(th)operator(->)ident(thgroup) operator(=) integer(0)operator(;) - ident(th)operator(->)ident(status) operator(=) ident(THREAD_KILLED)operator(;) - ident(stack_free)operator(()ident(th)operator(\);) -operator(}) - -directive(static) directive(void) -ident(rb_thread_remove)operator(()ident(th)operator(\)) - ident(rb_thread_t) ident(th)operator(;) -operator({) - reserved(if) operator(()ident(th)operator(->)ident(status) operator(==) ident(THREAD_KILLED)operator(\)) reserved(return)operator(;) - - ident(rb_thread_ready)operator(()ident(th)operator(\);) - ident(rb_thread_die)operator(()ident(th)operator(\);) - ident(th)operator(->)ident(prev)operator(->)ident(next) operator(=) ident(th)operator(->)ident(next)operator(;) - ident(th)operator(->)ident(next)operator(->)ident(prev) operator(=) ident(th)operator(->)ident(prev)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(rb_thread_dead)operator(()ident(th)operator(\)) - ident(rb_thread_t) ident(th)operator(;) -operator({) - reserved(return) ident(th)operator(->)ident(status) operator(==) ident(THREAD_KILLED)operator(;) -operator(}) - -directive(void) -ident(rb_thread_fd_close)operator(()ident(fd)operator(\)) - pre_type(int) ident(fd)operator(;) -operator({) - ident(rb_thread_t) ident(th)operator(;) - - ident(FOREACH_THREAD)operator(()ident(th)operator(\)) operator({) - reserved(if) operator(((()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_FD)operator(\)) operator(&&) ident(fd) operator(==) ident(th)operator(->)ident(fd)operator(\)) operator(||) - operator((()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_SELECT)operator(\)) operator(&&) operator(()ident(fd) operator(<) ident(th)operator(->)ident(fd)operator(\)) operator(&&) - operator(()ident(FD_ISSET)operator(()ident(fd)operator(,) operator(&)ident(th)operator(->)ident(readfds)operator(\)) operator(||) - ident(FD_ISSET)operator(()ident(fd)operator(,) operator(&)ident(th)operator(->)ident(writefds)operator(\)) operator(||) - ident(FD_ISSET)operator(()ident(fd)operator(,) operator(&)ident(th)operator(->)ident(exceptfds)operator(\)\)\)\)) operator({) - ident(VALUE) ident(exc) operator(=) ident(rb_exc_new2)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - ident(rb_thread_raise)operator(()integer(1)operator(,) operator(&)ident(exc)operator(,) ident(th)operator(\);) - operator(}) - operator(}) - ident(END_FOREACH)operator(()ident(th)operator(\);) -operator(}) - -ident(NORETURN)operator(()directive(static) directive(void) ident(rb_thread_main_jump) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(\)\)\);) -directive(static) directive(void) -ident(rb_thread_main_jump)operator(()ident(err)operator(,) ident(tag)operator(\)) - ident(VALUE) ident(err)operator(;) - pre_type(int) ident(tag)operator(;) -operator({) - ident(curr_thread) operator(=) ident(main_thread)operator(;) - ident(th_raise_exception) operator(=) ident(err)operator(;) - ident(th_raise_node) operator(=) ident(ruby_current_node)operator(;) - ident(rb_thread_restore_context)operator(()ident(main_thread)operator(,) ident(tag)operator(\);) -operator(}) - -ident(NORETURN)operator(()directive(static) directive(void) ident(rb_thread_deadlock) ident(_)operator((()directive(void)operator(\)\)\);) -directive(static) directive(void) -ident(rb_thread_deadlock)operator((\)) -operator({) - pre_type(char) ident(msg)operator([)integer(21)operator(+)ident(SIZEOF_LONG)operator(*)integer(2)operator(];) - ident(VALUE) ident(e)operator(;) - - ident(sprintf)operator(()ident(msg)operator(,) stringoperator(,) ident(curr_thread)operator(->)ident(thread)operator(\);) - ident(e) operator(=) ident(rb_exc_new2)operator(()ident(rb_eFatal)operator(,) ident(msg)operator(\);) - reserved(if) operator(()ident(curr_thread) operator(==) ident(main_thread)operator(\)) operator({) - ident(rb_exc_raise)operator(()ident(e)operator(\);) - operator(}) - ident(rb_thread_main_jump)operator(()ident(e)operator(,) ident(RESTORE_RAISE)operator(\);) -operator(}) - -directive(static) directive(void) -ident(copy_fds)operator(()ident(dst)operator(,) ident(src)operator(,) ident(max)operator(\)) - ident(fd_set) operator(*)ident(dst)operator(,) operator(*)ident(src)operator(;) - pre_type(int) ident(max)operator(;) -operator({) - pre_type(int) ident(n) operator(=) integer(0)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<=)ident(max)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(FD_ISSET)operator(()ident(i)operator(,) ident(src)operator(\)\)) operator({) - ident(n) operator(=) ident(i)operator(;) - ident(FD_SET)operator(()ident(i)operator(,) ident(dst)operator(\);) - operator(}) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(match_fds)operator(()ident(dst)operator(,) ident(src)operator(,) ident(max)operator(\)) - ident(fd_set) operator(*)ident(dst)operator(,) operator(*)ident(src)operator(;) - pre_type(int) ident(max)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<=)ident(max)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(FD_ISSET)operator(()ident(i)operator(,) ident(src)operator(\)) operator(&&) ident(FD_ISSET)operator(()ident(i)operator(,) ident(dst)operator(\)\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(intersect_fds)operator(()ident(src)operator(,) ident(dst)operator(,) ident(max)operator(\)) - ident(fd_set) operator(*)ident(src)operator(,) operator(*)ident(dst)operator(;) - pre_type(int) ident(max)operator(;) -operator({) - pre_type(int) ident(i)operator(,) ident(n) operator(=) integer(0)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<=)ident(max)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(FD_ISSET)operator(()ident(i)operator(,) ident(dst)operator(\)\)) operator({) - reserved(if) operator(()ident(FD_ISSET)operator(()ident(i)operator(,) ident(src)operator(\)\)) operator({) - comment(/* Wake up only one thread per fd. */) - ident(FD_CLR)operator(()ident(i)operator(,) ident(src)operator(\);) - ident(n)operator(++;) - operator(}) - reserved(else) operator({) - ident(FD_CLR)operator(()ident(i)operator(,) ident(dst)operator(\);) - operator(}) - operator(}) - operator(}) - reserved(return) ident(n)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(find_bad_fds)operator(()ident(dst)operator(,) ident(src)operator(,) ident(max)operator(\)) - ident(fd_set) operator(*)ident(dst)operator(,) operator(*)ident(src)operator(;) - pre_type(int) ident(max)operator(;) -operator({) - pre_type(int) ident(i)operator(,) ident(test) operator(=) ident(Qfalse)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<=)ident(max)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(FD_ISSET)operator(()ident(i)operator(,) ident(src)operator(\)) operator(&&) operator(!)ident(FD_ISSET)operator(()ident(i)operator(,) ident(dst)operator(\)\)) operator({) - ident(FD_CLR)operator(()ident(i)operator(,) ident(src)operator(\);) - ident(test) operator(=) ident(Qtrue)operator(;) - operator(}) - operator(}) - reserved(return) ident(test)operator(;) -operator(}) - -directive(void) -ident(rb_thread_schedule)operator((\)) -operator({) - ident(rb_thread_t) ident(next)operator(;) comment(/* OK */) - ident(rb_thread_t) ident(th)operator(;) - ident(rb_thread_t) ident(curr)operator(;) - ident(rb_thread_t) ident(th_found) operator(=) integer(0)operator(;) - pre_type(int) ident(found) operator(=) integer(0)operator(;) - - ident(fd_set) ident(readfds)operator(;) - ident(fd_set) ident(writefds)operator(;) - ident(fd_set) ident(exceptfds)operator(;) - reserved(struct) ident(timeval) ident(delay_tv)operator(,) operator(*)ident(delay_ptr)operator(;) - pre_type(double) ident(delay)operator(,) ident(now)operator(;) comment(/* OK */) - pre_type(int) ident(n)operator(,) ident(max)operator(;) - pre_type(int) ident(need_select) operator(=) integer(0)operator(;) - pre_type(int) ident(select_timeout) operator(=) integer(0)operator(;) - -preprocessor(#ifdef) ident(HAVE_NATIVETHREAD) - reserved(if) operator((!)ident(is_ruby_native_thread)operator((\)\)) operator({) - ident(rb_bug)operator(()stringoperator(\);) - operator(}) -preprocessor(#endif) - ident(rb_thread_pending) operator(=) integer(0)operator(;) - ident(rb_gc_finalize_deferred)operator((\);) - reserved(if) operator(()ident(curr_thread) operator(==) ident(curr_thread)operator(->)ident(next) - operator(&&) ident(curr_thread)operator(->)ident(status) operator(==) ident(THREAD_RUNNABLE)operator(\)) - reserved(return)operator(;) - - ident(next) operator(=) integer(0)operator(;) - ident(curr) operator(=) ident(curr_thread)operator(;) comment(/* starting thread */) - - reserved(while) operator(()ident(curr)operator(->)ident(status) operator(==) ident(THREAD_KILLED)operator(\)) operator({) - ident(curr) operator(=) ident(curr)operator(->)ident(prev)operator(;) - operator(}) - - label(again:) - ident(max) operator(=) operator(-)integer(1)operator(;) - ident(FD_ZERO)operator((&)ident(readfds)operator(\);) - ident(FD_ZERO)operator((&)ident(writefds)operator(\);) - ident(FD_ZERO)operator((&)ident(exceptfds)operator(\);) - ident(delay) operator(=) ident(DELAY_INFTY)operator(;) - ident(now) operator(=) operator(-)float(1)float(.0)operator(;) - - ident(FOREACH_THREAD_FROM)operator(()ident(curr)operator(,) ident(th)operator(\)) operator({) - reserved(if) operator((!)ident(found) operator(&&) ident(th)operator(->)ident(status) operator(<=) ident(THREAD_RUNNABLE)operator(\)) operator({) - ident(found) operator(=) integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(th)operator(->)ident(status) operator(!=) ident(THREAD_STOPPED)operator(\)) reserved(continue)operator(;) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_JOIN)operator(\)) operator({) - reserved(if) operator(()ident(rb_thread_dead)operator(()ident(th)operator(->)ident(join)operator(\)\)) operator({) - ident(th)operator(->)ident(status) operator(=) ident(THREAD_RUNNABLE)operator(;) - ident(found) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_FD)operator(\)) operator({) - ident(FD_SET)operator(()ident(th)operator(->)ident(fd)operator(,) operator(&)ident(readfds)operator(\);) - reserved(if) operator(()ident(max) operator(<) ident(th)operator(->)ident(fd)operator(\)) ident(max) operator(=) ident(th)operator(->)ident(fd)operator(;) - ident(need_select) operator(=) integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_SELECT)operator(\)) operator({) - ident(copy_fds)operator((&)ident(readfds)operator(,) operator(&)ident(th)operator(->)ident(readfds)operator(,) ident(th)operator(->)ident(fd)operator(\);) - ident(copy_fds)operator((&)ident(writefds)operator(,) operator(&)ident(th)operator(->)ident(writefds)operator(,) ident(th)operator(->)ident(fd)operator(\);) - ident(copy_fds)operator((&)ident(exceptfds)operator(,) operator(&)ident(th)operator(->)ident(exceptfds)operator(,) ident(th)operator(->)ident(fd)operator(\);) - reserved(if) operator(()ident(max) operator(<) ident(th)operator(->)ident(fd)operator(\)) ident(max) operator(=) ident(th)operator(->)ident(fd)operator(;) - ident(need_select) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_TIME)operator(\)) operator({) - ident(select_timeout) operator(=) integer(1)operator(;) - operator(}) - ident(th)operator(->)ident(select_value) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_TIME)operator(\)) operator({) - pre_type(double) ident(th_delay)operator(;) - - reserved(if) operator(()ident(now) operator(<) float(0)float(.0)operator(\)) ident(now) operator(=) ident(timeofday)operator((\);) - ident(th_delay) operator(=) ident(th)operator(->)ident(delay) operator(-) ident(now)operator(;) - reserved(if) operator(()ident(th_delay) operator(<=) float(0)float(.0)operator(\)) operator({) - ident(th)operator(->)ident(status) operator(=) ident(THREAD_RUNNABLE)operator(;) - ident(found) operator(=) integer(1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(th_delay) operator(<) ident(delay)operator(\)) operator({) - ident(delay) operator(=) ident(th_delay)operator(;) - ident(need_select) operator(=) integer(1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(th)operator(->)ident(delay) operator(==) ident(DELAY_INFTY)operator(\)) operator({) - ident(need_select) operator(=) integer(1)operator(;) - operator(}) - operator(}) - operator(}) - ident(END_FOREACH_FROM)operator(()ident(curr)operator(,) ident(th)operator(\);) - - comment(/* Do the select if needed */) - reserved(if) operator(()ident(need_select)operator(\)) operator({) - comment(/* Convert delay to a timeval */) - comment(/* If a thread is runnable, just poll */) - reserved(if) operator(()ident(found)operator(\)) operator({) - ident(delay_tv)operator(.)ident(tv_sec) operator(=) integer(0)operator(;) - ident(delay_tv)operator(.)ident(tv_usec) operator(=) integer(0)operator(;) - ident(delay_ptr) operator(=) operator(&)ident(delay_tv)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(delay) operator(==) ident(DELAY_INFTY)operator(\)) operator({) - ident(delay_ptr) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(delay_tv)operator(.)ident(tv_sec) operator(=) ident(delay)operator(;) - ident(delay_tv)operator(.)ident(tv_usec) operator(=) operator(()ident(delay) operator(-) operator(()pre_type(double)operator(\))ident(delay_tv)operator(.)ident(tv_sec)operator(\)*)float(1)ident(e6)operator(;) - ident(delay_ptr) operator(=) operator(&)ident(delay_tv)operator(;) - operator(}) - - ident(n) operator(=) ident(select)operator(()ident(max)operator(+)integer(1)operator(,) operator(&)ident(readfds)operator(,) operator(&)ident(writefds)operator(,) operator(&)ident(exceptfds)operator(,) ident(delay_ptr)operator(\);) - reserved(if) operator(()ident(n) operator(<) integer(0)operator(\)) operator({) - pre_type(int) ident(e) operator(=) ident(errno)operator(;) - - reserved(if) operator(()ident(rb_trap_pending)operator(\)) ident(rb_trap_exec)operator((\);) - reserved(if) operator(()ident(e) operator(==) ident(EINTR)operator(\)) reserved(goto) ident(again)operator(;) -preprocessor(#ifdef) ident(ERESTART) - reserved(if) operator(()ident(e) operator(==) ident(ERESTART)operator(\)) reserved(goto) ident(again)operator(;) -preprocessor(#endif) - reserved(if) operator(()ident(e) operator(==) ident(EBADF)operator(\)) operator({) - pre_type(int) ident(badfd) operator(=) operator(-)integer(1)operator(;) - pre_type(int) ident(fd)operator(;) - pre_type(int) ident(dummy)operator(;) - reserved(for) operator(()ident(fd) operator(=) integer(0)operator(;) ident(fd) operator(<=) ident(max)operator(;) ident(fd)operator(++\)) operator({) - reserved(if) operator((()ident(FD_ISSET)operator(()ident(fd)operator(,) operator(&)ident(readfds)operator(\)) operator(||) - ident(FD_ISSET)operator(()ident(fd)operator(,) operator(&)ident(writefds)operator(\)) operator(||) - ident(FD_ISSET)operator(()ident(fd)operator(,) operator(&)ident(exceptfds)operator(\)\)) operator(&&) - ident(fcntl)operator(()ident(fd)operator(,) ident(F_GETFD)operator(,) operator(&)ident(dummy)operator(\)) operator(==) operator(-)integer(1) operator(&&) - ident(errno) operator(==) ident(EBADF)operator(\)) operator({) - ident(badfd) operator(=) ident(fd)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(badfd) operator(!=) operator(-)integer(1)operator(\)) operator({) - ident(FOREACH_THREAD_FROM)operator(()ident(curr)operator(,) ident(th)operator(\)) operator({) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_FD)operator(\)) operator({) - reserved(if) operator(()ident(th)operator(->)ident(fd) operator(==) ident(badfd)operator(\)) operator({) - ident(found) operator(=) integer(1)operator(;) - ident(th)operator(->)ident(status) operator(=) ident(THREAD_RUNNABLE)operator(;) - ident(th)operator(->)ident(fd) operator(=) integer(0)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_SELECT)operator(\)) operator({) - reserved(if) operator(()ident(FD_ISSET)operator(()ident(badfd)operator(,) operator(&)ident(th)operator(->)ident(readfds)operator(\)) operator(||) - ident(FD_ISSET)operator(()ident(badfd)operator(,) operator(&)ident(th)operator(->)ident(writefds)operator(\)) operator(||) - ident(FD_ISSET)operator(()ident(badfd)operator(,) operator(&)ident(th)operator(->)ident(exceptfds)operator(\)\)) operator({) - ident(found) operator(=) integer(1)operator(;) - ident(th)operator(->)ident(status) operator(=) ident(THREAD_RUNNABLE)operator(;) - ident(th)operator(->)ident(select_value) operator(=) operator(-)ident(EBADF)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - operator(}) - ident(END_FOREACH_FROM)operator(()ident(curr)operator(,) ident(th)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(FOREACH_THREAD_FROM)operator(()ident(curr)operator(,) ident(th)operator(\)) operator({) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_SELECT)operator(\)) operator({) - pre_type(int) ident(v) operator(=) integer(0)operator(;) - - ident(v) operator(|=) ident(find_bad_fds)operator((&)ident(readfds)operator(,) operator(&)ident(th)operator(->)ident(readfds)operator(,) ident(th)operator(->)ident(fd)operator(\);) - ident(v) operator(|=) ident(find_bad_fds)operator((&)ident(writefds)operator(,) operator(&)ident(th)operator(->)ident(writefds)operator(,) ident(th)operator(->)ident(fd)operator(\);) - ident(v) operator(|=) ident(find_bad_fds)operator((&)ident(exceptfds)operator(,) operator(&)ident(th)operator(->)ident(exceptfds)operator(,) ident(th)operator(->)ident(fd)operator(\);) - reserved(if) operator(()ident(v)operator(\)) operator({) - ident(th)operator(->)ident(select_value) operator(=) ident(n)operator(;) - ident(n) operator(=) ident(max)operator(;) - operator(}) - operator(}) - operator(}) - ident(END_FOREACH_FROM)operator(()ident(curr)operator(,) ident(th)operator(\);) - operator(}) - operator(}) - reserved(if) operator(()ident(select_timeout) operator(&&) ident(n) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(now) operator(<) float(0)float(.0)operator(\)) ident(now) operator(=) ident(timeofday)operator((\);) - ident(FOREACH_THREAD_FROM)operator(()ident(curr)operator(,) ident(th)operator(\)) operator({) - reserved(if) operator(((()ident(th)operator(->)ident(wait_for)operator(&()ident(WAIT_SELECT)operator(|)ident(WAIT_TIME)operator(\)\)) operator(==) operator(()ident(WAIT_SELECT)operator(|)ident(WAIT_TIME)operator(\)\)) operator(&&) - ident(th)operator(->)ident(delay) operator(<=) ident(now)operator(\)) operator({) - ident(th)operator(->)ident(status) operator(=) ident(THREAD_RUNNABLE)operator(;) - ident(th)operator(->)ident(wait_for) operator(=) integer(0)operator(;) - ident(th)operator(->)ident(select_value) operator(=) integer(0)operator(;) - ident(found) operator(=) integer(1)operator(;) - ident(intersect_fds)operator((&)ident(readfds)operator(,) operator(&)ident(th)operator(->)ident(readfds)operator(,) ident(max)operator(\);) - ident(intersect_fds)operator((&)ident(writefds)operator(,) operator(&)ident(th)operator(->)ident(writefds)operator(,) ident(max)operator(\);) - ident(intersect_fds)operator((&)ident(exceptfds)operator(,) operator(&)ident(th)operator(->)ident(exceptfds)operator(,) ident(max)operator(\);) - operator(}) - operator(}) - ident(END_FOREACH_FROM)operator(()ident(curr)operator(,) ident(th)operator(\);) - operator(}) - reserved(if) operator(()ident(n) operator(>) integer(0)operator(\)) operator({) - ident(now) operator(=) operator(-)float(1)float(.0)operator(;) - comment(/* Some descriptors are ready. - * Choose a thread which may run next. - * Don't change the status of threads which don't run next. - */) - ident(FOREACH_THREAD_FROM)operator(()ident(curr)operator(,) ident(th)operator(\)) operator({) - reserved(if) operator((()ident(th)operator(->)ident(wait_for)operator(&)ident(WAIT_FD)operator(\)) operator(&&) ident(FD_ISSET)operator(()ident(th)operator(->)ident(fd)operator(,) operator(&)ident(readfds)operator(\)\)) operator({) - ident(th_found) operator(=) ident(th)operator(;) - ident(found) operator(=) integer(1)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator((()ident(th)operator(->)ident(wait_for)operator(&)ident(WAIT_SELECT)operator(\)) operator(&&) - operator(()ident(match_fds)operator((&)ident(readfds)operator(,) operator(&)ident(th)operator(->)ident(readfds)operator(,) ident(max)operator(\)) operator(||) - ident(match_fds)operator((&)ident(writefds)operator(,) operator(&)ident(th)operator(->)ident(writefds)operator(,) ident(max)operator(\)) operator(||) - ident(match_fds)operator((&)ident(exceptfds)operator(,) operator(&)ident(th)operator(->)ident(exceptfds)operator(,) ident(max)operator(\)\)\)) operator({) - ident(th_found) operator(=) ident(th)operator(;) - ident(found) operator(=) integer(1)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - ident(END_FOREACH_FROM)operator(()ident(curr)operator(,) ident(th)operator(\);) - operator(}) - comment(/* The delays for some of the threads should have expired. - Go through the loop once more, to check the delays. */) - reserved(if) operator((!)ident(found) operator(&&) ident(delay) operator(!=) ident(DELAY_INFTY)operator(\)) - reserved(goto) ident(again)operator(;) - operator(}) - - ident(FOREACH_THREAD_FROM)operator(()ident(curr)operator(,) ident(th)operator(\)) operator({) - reserved(if) operator(()ident(th)operator(->)ident(status) operator(==) ident(THREAD_TO_KILL)operator(\)) operator({) - ident(next) operator(=) ident(th)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator((()ident(th)operator(->)ident(status) operator(==) ident(THREAD_RUNNABLE) operator(||) ident(th) operator(==) ident(th_found)operator(\)) operator(&&) ident(th)operator(->)ident(stk_ptr)operator(\)) operator({) - reserved(if) operator((!)ident(next) operator(||) ident(next)operator(->)ident(priority) operator(<) ident(th)operator(->)ident(priority)operator(\)) operator({) - reserved(if) operator(()ident(th) operator(==) ident(th_found)operator(\)) operator({) - ident(th_found)operator(->)ident(status) operator(=) ident(THREAD_RUNNABLE)operator(;) - ident(th_found)operator(->)ident(wait_for) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(th)operator(->)ident(wait_for)operator(&)ident(WAIT_FD)operator(\)) operator({) - ident(th_found)operator(->)ident(fd) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) comment(/* th->wait_for&WAIT_SELECT */) - ident(n) operator(=) ident(intersect_fds)operator((&)ident(readfds)operator(,) operator(&)ident(th_found)operator(->)ident(readfds)operator(,) ident(max)operator(\)) operator(+) - ident(intersect_fds)operator((&)ident(writefds)operator(,) operator(&)ident(th_found)operator(->)ident(writefds)operator(,) ident(max)operator(\)) operator(+) - ident(intersect_fds)operator((&)ident(exceptfds)operator(,) operator(&)ident(th_found)operator(->)ident(exceptfds)operator(,) ident(max)operator(\);) - ident(th_found)operator(->)ident(select_value) operator(=) ident(n)operator(;) - operator(}) - operator(}) - ident(next) operator(=) ident(th)operator(;) - operator(}) - operator(}) - operator(}) - ident(END_FOREACH_FROM)operator(()ident(curr)operator(,) ident(th)operator(\);) - - reserved(if) operator((!)ident(next)operator(\)) operator({) - comment(/* raise fatal error to main thread */) - ident(curr_thread)operator(->)ident(node) operator(=) ident(ruby_current_node)operator(;) - reserved(if) operator(()ident(curr)operator(->)ident(next) operator(==) ident(curr)operator(\)) operator({) - ident(TRAP_BEG)operator(;) - ident(pause)operator((\);) - ident(TRAP_END)operator(;) - operator(}) - ident(FOREACH_THREAD_FROM)operator(()ident(curr)operator(,) ident(th)operator(\)) operator({) - ident(warn_printf)operator(()stringoperator(,) - ident(th)operator(->)ident(thread)operator(,) ident(thread_status_name)operator(()ident(th)operator(->)ident(status)operator(\)\);) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_FD)operator(\)) ident(warn_printf)operator(()stringoperator(,) ident(th)operator(->)ident(fd)operator(\);) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_SELECT)operator(\)) ident(warn_printf)operator(()stringoperator(\);) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_TIME)operator(\)) ident(warn_printf)operator(()stringoperator(,) ident(th)operator(->)ident(delay)operator(\);) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_JOIN)operator(\)) - ident(warn_printf)operator(()stringoperator(,) ident(th)operator(->)ident(join) operator(?) ident(th)operator(->)ident(join)operator(->)ident(thread) operator(:) integer(0)operator(\);) - reserved(if) operator(()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_PID)operator(\)) ident(warn_printf)operator(()stringoperator(\);) - reserved(if) operator((!)ident(th)operator(->)ident(wait_for)operator(\)) ident(warn_printf)operator(()stringoperator(\);) - ident(warn_printf)operator(()stringoperator(,) - ident(th)operator(==)ident(main_thread) operator(?) string operator(:) stringoperator(,) - ident(th)operator(->)ident(node)operator(->)ident(nd_file)operator(,) ident(nd_line)operator(()ident(th)operator(->)ident(node)operator(\)\);) - operator(}) - ident(END_FOREACH_FROM)operator(()ident(curr)operator(,) ident(th)operator(\);) - ident(next) operator(=) ident(main_thread)operator(;) - ident(rb_thread_ready)operator(()ident(next)operator(\);) - ident(next)operator(->)ident(status) operator(=) ident(THREAD_TO_KILL)operator(;) - reserved(if) operator((!)ident(rb_thread_dead)operator(()ident(curr_thread)operator(\)\)) operator({) - ident(rb_thread_save_context)operator(()ident(curr_thread)operator(\);) - operator(}) - ident(rb_thread_deadlock)operator((\);) - operator(}) - ident(next)operator(->)ident(wait_for) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(next)operator(->)ident(status) operator(==) ident(THREAD_RUNNABLE) operator(&&) ident(next) operator(==) ident(curr_thread)operator(\)) operator({) - reserved(return)operator(;) - operator(}) - - comment(/* context switch */) - reserved(if) operator(()ident(curr) operator(==) ident(curr_thread)operator(\)) operator({) - reserved(if) operator(()ident(THREAD_SAVE_CONTEXT)operator(()ident(curr)operator(\)\)) operator({) - reserved(return)operator(;) - operator(}) - operator(}) - - ident(curr_thread) operator(=) ident(next)operator(;) - reserved(if) operator(()ident(next)operator(->)ident(status) operator(==) ident(THREAD_TO_KILL)operator(\)) operator({) - reserved(if) operator((!()ident(next)operator(->)ident(flags) operator(&) ident(THREAD_TERMINATING)operator(\)\)) operator({) - ident(next)operator(->)ident(flags) operator(|=) ident(THREAD_TERMINATING)operator(;) - comment(/* terminate; execute ensure-clause if any */) - ident(rb_thread_restore_context)operator(()ident(next)operator(,) ident(RESTORE_FATAL)operator(\);) - operator(}) - operator(}) - ident(rb_thread_restore_context)operator(()ident(next)operator(,) ident(RESTORE_NORMAL)operator(\);) -operator(}) - -directive(void) -ident(rb_thread_wait_fd)operator(()ident(fd)operator(\)) - pre_type(int) ident(fd)operator(;) -operator({) - reserved(if) operator(()ident(rb_thread_critical)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(ruby_in_compile)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(curr_thread) operator(==) ident(curr_thread)operator(->)ident(next)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(curr_thread)operator(->)ident(status) operator(==) ident(THREAD_TO_KILL)operator(\)) reserved(return)operator(;) - - ident(curr_thread)operator(->)ident(status) operator(=) ident(THREAD_STOPPED)operator(;) - ident(curr_thread)operator(->)ident(fd) operator(=) ident(fd)operator(;) - ident(curr_thread)operator(->)ident(wait_for) operator(=) ident(WAIT_FD)operator(;) - ident(rb_thread_schedule)operator((\);) -operator(}) - -pre_type(int) -ident(rb_thread_fd_writable)operator(()ident(fd)operator(\)) - pre_type(int) ident(fd)operator(;) -operator({) - reserved(if) operator(()ident(rb_thread_critical)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(curr_thread) operator(==) ident(curr_thread)operator(->)ident(next)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(curr_thread)operator(->)ident(status) operator(==) ident(THREAD_TO_KILL)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(curr_thread)operator(->)ident(status) operator(==) ident(THREAD_KILLED)operator(\)) reserved(return) ident(Qtrue)operator(;) - - ident(curr_thread)operator(->)ident(status) operator(=) ident(THREAD_STOPPED)operator(;) - ident(FD_ZERO)operator((&)ident(curr_thread)operator(->)ident(readfds)operator(\);) - ident(FD_ZERO)operator((&)ident(curr_thread)operator(->)ident(writefds)operator(\);) - ident(FD_SET)operator(()ident(fd)operator(,) operator(&)ident(curr_thread)operator(->)ident(writefds)operator(\);) - ident(FD_ZERO)operator((&)ident(curr_thread)operator(->)ident(exceptfds)operator(\);) - ident(curr_thread)operator(->)ident(fd) operator(=) ident(fd)operator(+)integer(1)operator(;) - ident(curr_thread)operator(->)ident(wait_for) operator(=) ident(WAIT_SELECT)operator(;) - ident(rb_thread_schedule)operator((\);) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(void) -ident(rb_thread_wait_for)operator(()ident(time)operator(\)) - reserved(struct) ident(timeval) ident(time)operator(;) -operator({) - pre_type(double) ident(date)operator(;) - - reserved(if) operator(()ident(rb_thread_critical) operator(||) - ident(curr_thread) operator(==) ident(curr_thread)operator(->)ident(next) operator(||) - ident(curr_thread)operator(->)ident(status) operator(==) ident(THREAD_TO_KILL)operator(\)) operator({) - pre_type(int) ident(n)operator(;) - pre_type(int) ident(thr_critical) operator(=) ident(rb_thread_critical)operator(;) -preprocessor(#ifndef) ident(linux) - pre_type(double) ident(d)operator(,) ident(limit)operator(;) - ident(limit) operator(=) ident(timeofday)operator((\)+()pre_type(double)operator(\))ident(time)operator(.)ident(tv_sec)operator(+()pre_type(double)operator(\))ident(time)operator(.)ident(tv_usec)operator(*)float(1)ident(e)operator(-)integer(6)operator(;) -preprocessor(#endif) - reserved(for) operator((;;\)) operator({) - ident(rb_thread_critical) operator(=) ident(Qtrue)operator(;) - ident(TRAP_BEG)operator(;) - ident(n) operator(=) ident(select)operator(()integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(&)ident(time)operator(\);) - ident(rb_thread_critical) operator(=) ident(thr_critical)operator(;) - ident(TRAP_END)operator(;) - reserved(if) operator(()ident(n) operator(==) integer(0)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(n) operator(<) integer(0)operator(\)) operator({) - reserved(switch) operator(()ident(errno)operator(\)) operator({) - reserved(case) ident(EINTR)operator(:) -preprocessor(#ifdef) ident(ERESTART) - reserved(case) ident(ERESTART)operator(:) -preprocessor(#endif) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_sys_fail)operator(()stringoperator(\);) - operator(}) - operator(}) -preprocessor(#ifndef) ident(linux) - ident(d) operator(=) ident(limit) operator(-) ident(timeofday)operator((\);) - - ident(time)operator(.)ident(tv_sec) operator(=) operator(()pre_type(int)operator(\))ident(d)operator(;) - ident(time)operator(.)ident(tv_usec) operator(=) operator(()pre_type(int)operator(\)(()ident(d) operator(-) operator(()pre_type(int)operator(\))ident(d)operator(\)*)float(1)ident(e6)operator(\);) - reserved(if) operator(()ident(time)operator(.)ident(tv_usec) operator(<) integer(0)operator(\)) operator({) - ident(time)operator(.)ident(tv_usec) operator(+=) operator(()pre_type(long)operator(\))float(1)ident(e6)operator(;) - ident(time)operator(.)ident(tv_sec) operator(-=) integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(time)operator(.)ident(tv_sec) operator(<) integer(0)operator(\)) reserved(return)operator(;) -preprocessor(#endif) - operator(}) - operator(}) - - ident(date) operator(=) ident(timeofday)operator((\)) operator(+) operator(()pre_type(double)operator(\))ident(time)operator(.)ident(tv_sec) operator(+) operator(()pre_type(double)operator(\))ident(time)operator(.)ident(tv_usec)operator(*)float(1)ident(e)operator(-)integer(6)operator(;) - ident(curr_thread)operator(->)ident(status) operator(=) ident(THREAD_STOPPED)operator(;) - ident(curr_thread)operator(->)ident(delay) operator(=) ident(date)operator(;) - ident(curr_thread)operator(->)ident(wait_for) operator(=) ident(WAIT_TIME)operator(;) - ident(rb_thread_schedule)operator((\);) -operator(}) - -directive(void) ident(rb_thread_sleep_forever) ident(_)operator((()directive(void)operator(\)\);) - -pre_type(int) -ident(rb_thread_alone)operator((\)) -operator({) - reserved(return) ident(curr_thread) operator(==) ident(curr_thread)operator(->)ident(next)operator(;) -operator(}) - -pre_type(int) -ident(rb_thread_select)operator(()ident(max)operator(,) ident(read)operator(,) ident(write)operator(,) ident(except)operator(,) ident(timeout)operator(\)) - pre_type(int) ident(max)operator(;) - ident(fd_set) operator(*)ident(read)operator(,) operator(*)ident(write)operator(,) operator(*)ident(except)operator(;) - reserved(struct) ident(timeval) operator(*)ident(timeout)operator(;) -operator({) -preprocessor(#ifndef) ident(linux) - pre_type(double) ident(limit)operator(;) -preprocessor(#endif) - pre_type(int) ident(n)operator(;) - - reserved(if) operator((!)ident(read) operator(&&) operator(!)ident(write) operator(&&) operator(!)ident(except)operator(\)) operator({) - reserved(if) operator((!)ident(timeout)operator(\)) operator({) - ident(rb_thread_sleep_forever)operator((\);) - reserved(return) integer(0)operator(;) - operator(}) - ident(rb_thread_wait_for)operator((*)ident(timeout)operator(\);) - reserved(return) integer(0)operator(;) - operator(}) - -preprocessor(#ifndef) ident(linux) - reserved(if) operator(()ident(timeout)operator(\)) operator({) - ident(limit) operator(=) ident(timeofday)operator((\)+) - operator(()pre_type(double)operator(\))ident(timeout)operator(->)ident(tv_sec)operator(+()pre_type(double)operator(\))ident(timeout)operator(->)ident(tv_usec)operator(*)float(1)ident(e)operator(-)integer(6)operator(;) - operator(}) -preprocessor(#endif) - - reserved(if) operator(()ident(rb_thread_critical) operator(||) - ident(curr_thread) operator(==) ident(curr_thread)operator(->)ident(next) operator(||) - ident(curr_thread)operator(->)ident(status) operator(==) ident(THREAD_TO_KILL)operator(\)) operator({) -preprocessor(#ifndef) ident(linux) - reserved(struct) ident(timeval) ident(tv)operator(,) operator(*)ident(tvp) operator(=) ident(timeout)operator(;) - - reserved(if) operator(()ident(timeout)operator(\)) operator({) - ident(tv) operator(=) operator(*)ident(timeout)operator(;) - ident(tvp) operator(=) operator(&)ident(tv)operator(;) - operator(}) -preprocessor(#else) - reserved(struct) ident(timeval) operator(*)directive(const) ident(tvp) operator(=) ident(timeout)operator(;) -preprocessor(#endif) - reserved(for) operator((;;\)) operator({) - ident(TRAP_BEG)operator(;) - ident(n) operator(=) ident(select)operator(()ident(max)operator(,) ident(read)operator(,) ident(write)operator(,) ident(except)operator(,) ident(tvp)operator(\);) - ident(TRAP_END)operator(;) - reserved(if) operator(()ident(n) operator(<) integer(0)operator(\)) operator({) - reserved(switch) operator(()ident(errno)operator(\)) operator({) - reserved(case) ident(EINTR)operator(:) -preprocessor(#ifdef) ident(ERESTART) - reserved(case) ident(ERESTART)operator(:) -preprocessor(#endif) -preprocessor(#ifndef) ident(linux) - reserved(if) operator(()ident(timeout)operator(\)) operator({) - pre_type(double) ident(d) operator(=) ident(limit) operator(-) ident(timeofday)operator((\);) - - ident(tv)operator(.)ident(tv_sec) operator(=) operator(()pre_type(unsigned) pre_type(int)operator(\))ident(d)operator(;) - ident(tv)operator(.)ident(tv_usec) operator(=) operator(()pre_type(long)operator(\)(()ident(d)operator(-()pre_type(double)operator(\))ident(tv)operator(.)ident(tv_sec)operator(\)*)float(1)ident(e6)operator(\);) - reserved(if) operator(()ident(tv)operator(.)ident(tv_sec) operator(<) integer(0)operator(\)) ident(tv)operator(.)ident(tv_sec) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(tv)operator(.)ident(tv_usec) operator(<) integer(0)operator(\)) ident(tv)operator(.)ident(tv_usec) operator(=) integer(0)operator(;) - operator(}) -preprocessor(#endif) - reserved(continue)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(return) ident(n)operator(;) - operator(}) - operator(}) - - ident(curr_thread)operator(->)ident(status) operator(=) ident(THREAD_STOPPED)operator(;) - reserved(if) operator(()ident(read)operator(\)) ident(curr_thread)operator(->)ident(readfds) operator(=) operator(*)ident(read)operator(;) - reserved(else) ident(FD_ZERO)operator((&)ident(curr_thread)operator(->)ident(readfds)operator(\);) - reserved(if) operator(()ident(write)operator(\)) ident(curr_thread)operator(->)ident(writefds) operator(=) operator(*)ident(write)operator(;) - reserved(else) ident(FD_ZERO)operator((&)ident(curr_thread)operator(->)ident(writefds)operator(\);) - reserved(if) operator(()ident(except)operator(\)) ident(curr_thread)operator(->)ident(exceptfds) operator(=) operator(*)ident(except)operator(;) - reserved(else) ident(FD_ZERO)operator((&)ident(curr_thread)operator(->)ident(exceptfds)operator(\);) - ident(curr_thread)operator(->)ident(fd) operator(=) ident(max)operator(;) - ident(curr_thread)operator(->)ident(wait_for) operator(=) ident(WAIT_SELECT)operator(;) - reserved(if) operator(()ident(timeout)operator(\)) operator({) - ident(curr_thread)operator(->)ident(delay) operator(=) ident(timeofday)operator((\)) operator(+) - operator(()pre_type(double)operator(\))ident(timeout)operator(->)ident(tv_sec) operator(+) operator(()pre_type(double)operator(\))ident(timeout)operator(->)ident(tv_usec)operator(*)float(1)ident(e)operator(-)integer(6)operator(;) - ident(curr_thread)operator(->)ident(wait_for) operator(|=) ident(WAIT_TIME)operator(;) - operator(}) - ident(rb_thread_schedule)operator((\);) - reserved(if) operator(()ident(read)operator(\)) operator(*)ident(read) operator(=) ident(curr_thread)operator(->)ident(readfds)operator(;) - reserved(if) operator(()ident(write)operator(\)) operator(*)ident(write) operator(=) ident(curr_thread)operator(->)ident(writefds)operator(;) - reserved(if) operator(()ident(except)operator(\)) operator(*)ident(except) operator(=) ident(curr_thread)operator(->)ident(exceptfds)operator(;) - reserved(if) operator(()ident(curr_thread)operator(->)ident(select_value) operator(<) integer(0)operator(\)) operator({) - ident(errno) operator(=) operator(-)ident(curr_thread)operator(->)ident(select_value)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(return) ident(curr_thread)operator(->)ident(select_value)operator(;) -operator(}) - -directive(static) pre_type(int) ident(rb_thread_join0) ident(_)operator((()ident(rb_thread_t)operator(,) pre_type(double)operator(\)\);) -pre_type(int) ident(rb_thread_join) ident(_)operator((()ident(VALUE)operator(,) pre_type(double)operator(\)\);) - -directive(static) pre_type(int) -ident(rb_thread_join0)operator(()ident(th)operator(,) ident(limit)operator(\)) - ident(rb_thread_t) ident(th)operator(;) - pre_type(double) ident(limit)operator(;) -operator({) - reserved(enum) ident(rb_thread_status) ident(last_status) operator(=) ident(THREAD_RUNNABLE)operator(;) - - reserved(if) operator(()ident(rb_thread_critical)operator(\)) ident(rb_thread_deadlock)operator((\);) - reserved(if) operator((!)ident(rb_thread_dead)operator(()ident(th)operator(\)\)) operator({) - reserved(if) operator(()ident(th) operator(==) ident(curr_thread)operator(\)) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(,) - ident(th)operator(->)ident(thread)operator(\);) - reserved(if) operator((()ident(th)operator(->)ident(wait_for) operator(&) ident(WAIT_JOIN)operator(\)) operator(&&) ident(th)operator(->)ident(join) operator(==) ident(curr_thread)operator(\)) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(,) - ident(curr_thread)operator(->)ident(thread)operator(,) ident(th)operator(->)ident(thread)operator(\);) - reserved(if) operator(()ident(curr_thread)operator(->)ident(status) operator(==) ident(THREAD_TO_KILL)operator(\)) - ident(last_status) operator(=) ident(THREAD_TO_KILL)operator(;) - reserved(if) operator(()ident(limit) operator(==) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - ident(curr_thread)operator(->)ident(status) operator(=) ident(THREAD_STOPPED)operator(;) - ident(curr_thread)operator(->)ident(join) operator(=) ident(th)operator(;) - ident(curr_thread)operator(->)ident(wait_for) operator(=) ident(WAIT_JOIN)operator(;) - ident(curr_thread)operator(->)ident(delay) operator(=) ident(timeofday)operator((\)) operator(+) ident(limit)operator(;) - reserved(if) operator(()ident(limit) operator(<) ident(DELAY_INFTY)operator(\)) ident(curr_thread)operator(->)ident(wait_for) operator(|=) ident(WAIT_TIME)operator(;) - ident(rb_thread_schedule)operator((\);) - ident(curr_thread)operator(->)ident(status) operator(=) ident(last_status)operator(;) - reserved(if) operator((!)ident(rb_thread_dead)operator(()ident(th)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - operator(}) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(th)operator(->)ident(errinfo)operator(\)) operator(&&) operator(()ident(th)operator(->)ident(flags) operator(&) ident(RAISED_EXCEPTION)operator(\)\)) operator({) - ident(VALUE) ident(oldbt) operator(=) ident(get_backtrace)operator(()ident(th)operator(->)ident(errinfo)operator(\);) - ident(VALUE) ident(errat) operator(=) ident(make_backtrace)operator((\);) - ident(VALUE) ident(errinfo) operator(=) ident(rb_obj_dup)operator(()ident(th)operator(->)ident(errinfo)operator(\);) - - reserved(if) operator(()ident(TYPE)operator(()ident(oldbt)operator(\)) operator(==) ident(T_ARRAY) operator(&&) ident(RARRAY)operator(()ident(oldbt)operator(\)->)ident(len) operator(>) integer(0)operator(\)) operator({) - ident(rb_ary_unshift)operator(()ident(errat)operator(,) ident(rb_ary_entry)operator(()ident(oldbt)operator(,) integer(0)operator(\)\);) - operator(}) - ident(set_backtrace)operator(()ident(errinfo)operator(,) ident(errat)operator(\);) - ident(rb_exc_raise)operator(()ident(errinfo)operator(\);) - operator(}) - - reserved(return) ident(Qtrue)operator(;) -operator(}) - -pre_type(int) -ident(rb_thread_join)operator(()ident(thread)operator(,) ident(limit)operator(\)) - ident(VALUE) ident(thread)operator(;) - pre_type(double) ident(limit)operator(;) -operator({) - reserved(if) operator(()ident(limit) operator(<) integer(0)operator(\)) ident(limit) operator(=) ident(DELAY_INFTY)operator(;) - reserved(return) ident(rb_thread_join0)operator(()ident(rb_thread_check)operator(()ident(thread)operator(\),) ident(limit)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * thr.join => thr - * thr.join(limit\) => thr - * - * The calling thread will suspend execution and run thr. Does not - * return until thr exits or until limit seconds have passed. If - * the time limit expires, nil will be returned, otherwise - * thr is returned. - * - * Any threads not joined will be killed when the main program exits. If - * thr had previously raised an exception and the - * abort_on_exception and $DEBUG flags are not set - * (so the exception has not yet been processed\) it will be processed at this - * time. - * - * a = Thread.new { print "a"; sleep(10\); print "b"; print "c" } - * x = Thread.new { print "x"; Thread.pass; print "y"; print "z" } - * x.join # Let x thread finish, a will be killed on exit. - * - * produces: - * - * axyz - * - * The following example illustrates the limit parameter. - * - * y = Thread.new { 4.times { sleep 0.1; puts 'tick... ' }} - * puts "Waiting" until y.join(0.15\) - * - * produces: - * - * tick... - * Waiting - * tick... - * Waitingtick... - * - * - * tick... - */) - -directive(static) ident(VALUE) -ident(rb_thread_join_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(thread)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(VALUE) ident(limit)operator(;) - pre_type(double) ident(delay) operator(=) ident(DELAY_INFTY)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(limit)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(limit)operator(\)\)) ident(delay) operator(=) ident(rb_num2dbl)operator(()ident(limit)operator(\);) - reserved(if) operator((!)ident(rb_thread_join0)operator(()ident(rb_thread_check)operator(()ident(thread)operator(\),) ident(delay)operator(\)\)) - reserved(return) ident(Qnil)operator(;) - reserved(return) ident(thread)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Thread.current => thread - * - * Returns the currently executing thread. - * - * Thread.current #=> # - */) - -ident(VALUE) -ident(rb_thread_current)operator((\)) -operator({) - reserved(return) ident(curr_thread)operator(->)ident(thread)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Thread.main => thread - * - * Returns the main thread for the process. - * - * Thread.main #=> # - */) - -ident(VALUE) -ident(rb_thread_main)operator((\)) -operator({) - reserved(return) ident(main_thread)operator(->)ident(thread)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Thread.list => array - * - * Returns an array of Thread objects for all threads that are - * either runnable or stopped. - * - * Thread.new { sleep(200\) } - * Thread.new { 1000000.times {|i| i*i } } - * Thread.new { Thread.stop } - * Thread.list.each {|t| p t} - * - * produces: - * - * # - * # - * # - * # - */) - -ident(VALUE) -ident(rb_thread_list)operator((\)) -operator({) - ident(rb_thread_t) ident(th)operator(;) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - ident(FOREACH_THREAD)operator(()ident(th)operator(\)) operator({) - reserved(switch) operator(()ident(th)operator(->)ident(status)operator(\)) operator({) - reserved(case) ident(THREAD_RUNNABLE)operator(:) - reserved(case) ident(THREAD_STOPPED)operator(:) - reserved(case) ident(THREAD_TO_KILL)operator(:) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(th)operator(->)ident(thread)operator(\);) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) - ident(END_FOREACH)operator(()ident(th)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr.wakeup => thr - * - * Marks thr as eligible for scheduling (it may still remain blocked on - * I/O, however\). Does not invoke the scheduler (see Thread#run\). - * - * c = Thread.new { Thread.stop; puts "hey!" } - * c.wakeup - * - * produces: - * - * hey! - */) - -ident(VALUE) -ident(rb_thread_wakeup)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - reserved(if) operator((!)ident(RTEST)operator(()ident(rb_thread_wakeup_alive)operator(()ident(thread)operator(\)\)\)) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(\);) - reserved(return) ident(thread)operator(;) -operator(}) - -ident(VALUE) -ident(rb_thread_wakeup_alive)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - - reserved(if) operator(()ident(th)operator(->)ident(status) operator(==) ident(THREAD_KILLED)operator(\)) - reserved(return) ident(Qnil)operator(;) - ident(rb_thread_ready)operator(()ident(th)operator(\);) - - reserved(return) ident(thread)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr.run => thr - * - * Wakes up thr, making it eligible for scheduling. If not in a critical - * section, then invokes the scheduler. - * - * a = Thread.new { puts "a"; Thread.stop; puts "c" } - * Thread.pass - * puts "Got here" - * a.run - * a.join - * - * produces: - * - * a - * Got here - * c - */) - -ident(VALUE) -ident(rb_thread_run)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_wakeup)operator(()ident(thread)operator(\);) - reserved(if) operator((!)ident(rb_thread_critical)operator(\)) ident(rb_thread_schedule)operator((\);) - - reserved(return) ident(thread)operator(;) -operator(}) - - -directive(static) directive(void) -ident(rb_kill_thread)operator(()ident(th)operator(,) ident(flags)operator(\)) - ident(rb_thread_t) ident(th)operator(;) - pre_type(int) ident(flags)operator(;) -operator({) - reserved(if) operator(()ident(th) operator(!=) ident(curr_thread) operator(&&) ident(th)operator(->)ident(safe) operator(<) integer(4)operator(\)) operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - operator(}) - reserved(if) operator(()ident(th)operator(->)ident(status) operator(==) ident(THREAD_TO_KILL) operator(||) ident(th)operator(->)ident(status) operator(==) ident(THREAD_KILLED)operator(\)) - reserved(return)operator(;) - reserved(if) operator(()ident(th) operator(==) ident(th)operator(->)ident(next) operator(||) ident(th) operator(==) ident(main_thread)operator(\)) ident(rb_exit)operator(()ident(EXIT_SUCCESS)operator(\);) - - ident(rb_thread_ready)operator(()ident(th)operator(\);) - ident(th)operator(->)ident(flags) operator(|=) ident(flags)operator(;) - ident(th)operator(->)ident(status) operator(=) ident(THREAD_TO_KILL)operator(;) - reserved(if) operator((!)ident(rb_thread_critical)operator(\)) ident(rb_thread_schedule)operator((\);) -operator(}) - - -comment(/* - * call-seq: - * thr.exit => thr - * thr.kill => thr - * thr.terminate => thr - * - * Terminates thr and schedules another thread to be run, returning - * the terminated Thread. If this is the main thread, or the - * last thread, exits the process. - */) - -ident(VALUE) -ident(rb_thread_kill)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - - ident(rb_kill_thread)operator(()ident(th)operator(,) integer(0)operator(\);) - reserved(return) ident(thread)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr.exit! => thr - * thr.kill! => thr - * thr.terminate! => thr - * - * Terminates thr without calling ensure clauses and schedules - * another thread to be run, returning the terminated Thread. - * If this is the main thread, or the last thread, exits the process. - * - * See Thread#exit for the safer version. - */) - -directive(static) ident(VALUE) -ident(rb_thread_kill_bang)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - ident(rb_kill_thread)operator(()ident(th)operator(,) ident(THREAD_NO_ENSURE)operator(\);) - reserved(return) ident(thread)operator(;) -operator(}) - -comment(/* - * call-seq: - * Thread.kill(thread\) => thread - * - * Causes the given thread to exit (see Thread::exit\). - * - * count = 0 - * a = Thread.new { loop { count += 1 } } - * sleep(0.1\) #=> 0 - * Thread.kill(a\) #=> # - * count #=> 93947 - * a.alive? #=> false - */) - -directive(static) ident(VALUE) -ident(rb_thread_s_kill)operator(()ident(obj)operator(,) ident(th)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(th)operator(;) -operator({) - reserved(return) ident(rb_thread_kill)operator(()ident(th)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Thread.exit => thread - * - * Terminates the currently running thread and schedules another thread to be - * run. If this thread is already marked to be killed, exit - * returns the Thread. If this is the main thread, or the last - * thread, exit the process. - */) - -directive(static) ident(VALUE) -ident(rb_thread_exit)operator((\)) -operator({) - reserved(return) ident(rb_thread_kill)operator(()ident(curr_thread)operator(->)ident(thread)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Thread.pass => nil - * - * Invokes the thread scheduler to pass execution to another thread. - * - * a = Thread.new { print "a"; Thread.pass; - * print "b"; Thread.pass; - * print "c" } - * b = Thread.new { print "x"; Thread.pass; - * print "y"; Thread.pass; - * print "z" } - * a.join - * b.join - * - * produces: - * - * axbycz - */) - -directive(static) ident(VALUE) -ident(rb_thread_pass)operator((\)) -operator({) - ident(rb_thread_schedule)operator((\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Thread.stop => nil - * - * Stops execution of the current thread, putting it into a ``sleep'' state, - * and schedules execution of another thread. Resets the ``critical'' condition - * to false. - * - * a = Thread.new { print "a"; Thread.stop; print "c" } - * Thread.pass - * print "b" - * a.run - * a.join - * - * produces: - * - * abc - */) - -ident(VALUE) -ident(rb_thread_stop)operator((\)) -operator({) - reserved(enum) ident(rb_thread_status) ident(last_status) operator(=) ident(THREAD_RUNNABLE)operator(;) - - ident(rb_thread_critical) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(curr_thread) operator(==) ident(curr_thread)operator(->)ident(next)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(curr_thread)operator(->)ident(status) operator(==) ident(THREAD_TO_KILL)operator(\)) - ident(last_status) operator(=) ident(THREAD_TO_KILL)operator(;) - ident(curr_thread)operator(->)ident(status) operator(=) ident(THREAD_STOPPED)operator(;) - ident(rb_thread_schedule)operator((\);) - ident(curr_thread)operator(->)ident(status) operator(=) ident(last_status)operator(;) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -reserved(struct) ident(timeval) ident(rb_time_timeval)operator((\);) - -directive(void) -ident(rb_thread_polling)operator((\)) -operator({) - reserved(if) operator(()ident(curr_thread) operator(!=) ident(curr_thread)operator(->)ident(next)operator(\)) operator({) - ident(curr_thread)operator(->)ident(status) operator(=) ident(THREAD_STOPPED)operator(;) - ident(curr_thread)operator(->)ident(delay) operator(=) ident(timeofday)operator((\)) operator(+) operator(()pre_type(double)operator(\))float(0)float(.06)operator(;) - ident(curr_thread)operator(->)ident(wait_for) operator(=) ident(WAIT_TIME)operator(;) - ident(rb_thread_schedule)operator((\);) - operator(}) -operator(}) - -directive(void) -ident(rb_thread_sleep)operator(()ident(sec)operator(\)) - pre_type(int) ident(sec)operator(;) -operator({) - reserved(if) operator(()ident(curr_thread) operator(==) ident(curr_thread)operator(->)ident(next)operator(\)) operator({) - ident(TRAP_BEG)operator(;) - ident(sleep)operator(()ident(sec)operator(\);) - ident(TRAP_END)operator(;) - reserved(return)operator(;) - operator(}) - ident(rb_thread_wait_for)operator(()ident(rb_time_timeval)operator(()ident(INT2FIX)operator(()ident(sec)operator(\)\)\);) -operator(}) - -directive(void) -ident(rb_thread_sleep_forever)operator((\)) -operator({) - pre_type(int) ident(thr_critical) operator(=) ident(rb_thread_critical)operator(;) - reserved(if) operator(()ident(curr_thread) operator(==) ident(curr_thread)operator(->)ident(next) operator(||) - ident(curr_thread)operator(->)ident(status) operator(==) ident(THREAD_TO_KILL)operator(\)) operator({) - ident(rb_thread_critical) operator(=) ident(Qtrue)operator(;) - ident(TRAP_BEG)operator(;) - ident(pause)operator((\);) - ident(rb_thread_critical) operator(=) ident(thr_critical)operator(;) - ident(TRAP_END)operator(;) - reserved(return)operator(;) - operator(}) - - ident(curr_thread)operator(->)ident(delay) operator(=) ident(DELAY_INFTY)operator(;) - ident(curr_thread)operator(->)ident(wait_for) operator(=) ident(WAIT_TIME)operator(;) - ident(curr_thread)operator(->)ident(status) operator(=) ident(THREAD_STOPPED)operator(;) - ident(rb_thread_schedule)operator((\);) -operator(}) - - -comment(/* - * call-seq: - * thr.priority => integer - * - * Returns the priority of thr. Default is inherited from the - * current thread which creating the new thread, or zero for the - * initial main thread; higher-priority threads will run before - * lower-priority threads. - * - * Thread.current.priority #=> 0 - */) - -directive(static) ident(VALUE) -ident(rb_thread_priority)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - reserved(return) ident(INT2NUM)operator(()ident(rb_thread_check)operator(()ident(thread)operator(\)->)ident(priority)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * thr.priority= integer => thr - * - * Sets the priority of thr to integer. Higher-priority threads - * will run before lower-priority threads. - * - * count1 = count2 = 0 - * a = Thread.new do - * loop { count1 += 1 } - * end - * a.priority = -1 - * - * b = Thread.new do - * loop { count2 += 1 } - * end - * b.priority = -2 - * sleep 1 #=> 1 - * Thread.critical = 1 - * count1 #=> 622504 - * count2 #=> 5832 - */) - -directive(static) ident(VALUE) -ident(rb_thread_priority_set)operator(()ident(thread)operator(,) ident(prio)operator(\)) - ident(VALUE) ident(thread)operator(,) ident(prio)operator(;) -operator({) - ident(rb_thread_t) ident(th)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - - ident(th)operator(->)ident(priority) operator(=) ident(NUM2INT)operator(()ident(prio)operator(\);) - ident(rb_thread_schedule)operator((\);) - reserved(return) ident(prio)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr.safe_level => integer - * - * Returns the safe level in effect for thr. Setting thread-local safe - * levels can help when implementing sandboxes which run insecure code. - * - * thr = Thread.new { $SAFE = 3; sleep } - * Thread.current.safe_level #=> 0 - * thr.safe_level #=> 3 - */) - -directive(static) ident(VALUE) -ident(rb_thread_safe_level)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th)operator(;) - - ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - reserved(if) operator(()ident(th) operator(==) ident(curr_thread)operator(\)) operator({) - reserved(return) ident(INT2NUM)operator(()ident(ruby_safe_level)operator(\);) - operator(}) - reserved(return) ident(INT2NUM)operator(()ident(th)operator(->)ident(safe)operator(\);) -operator(}) - -directive(static) pre_type(int) ident(ruby_thread_abort)operator(;) -directive(static) ident(VALUE) ident(thgroup_default)operator(;) - - -comment(/* - * call-seq: - * Thread.abort_on_exception => true or false - * - * Returns the status of the global ``abort on exception'' condition. The - * default is false. When set to true, or if the - * global $DEBUG flag is true (perhaps because the - * command line option -d was specified\) all threads will abort - * (the process will exit(0\)\) if an exception is raised in any - * thread. See also Thread::abort_on_exception=. - */) - -directive(static) ident(VALUE) -ident(rb_thread_s_abort_exc)operator((\)) -operator({) - reserved(return) ident(ruby_thread_abort)operator(?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Thread.abort_on_exception= boolean => true or false - * - * When set to true, all threads will abort if an exception is - * raised. Returns the new state. - * - * Thread.abort_on_exception = true - * t1 = Thread.new do - * puts "In new thread" - * raise "Exception from thread" - * end - * sleep(1\) - * puts "not reached" - * - * produces: - * - * In new thread - * prog.rb:4: Exception from thread (RuntimeError\) - * from prog.rb:2:in `initialize' - * from prog.rb:2:in `new' - * from prog.rb:2 - */) - -directive(static) ident(VALUE) -ident(rb_thread_s_abort_exc_set)operator(()ident(self)operator(,) ident(val)operator(\)) - ident(VALUE) ident(self)operator(,) ident(val)operator(;) -operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - ident(ruby_thread_abort) operator(=) ident(RTEST)operator(()ident(val)operator(\);) - reserved(return) ident(val)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr.abort_on_exception => true or false - * - * Returns the status of the thread-local ``abort on exception'' condition for - * thr. The default is false. See also - * Thread::abort_on_exception=. - */) - -directive(static) ident(VALUE) -ident(rb_thread_abort_exc)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - reserved(return) ident(rb_thread_check)operator(()ident(thread)operator(\)->)ident(abort)operator(?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr.abort_on_exception= boolean => true or false - * - * When set to true, causes all threads (including the main - * program\) to abort if an exception is raised in thr. The process will - * effectively exit(0\). - */) - -directive(static) ident(VALUE) -ident(rb_thread_abort_exc_set)operator(()ident(thread)operator(,) ident(val)operator(\)) - ident(VALUE) ident(thread)operator(,) ident(val)operator(;) -operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - ident(rb_thread_check)operator(()ident(thread)operator(\)->)ident(abort) operator(=) ident(RTEST)operator(()ident(val)operator(\);) - reserved(return) ident(val)operator(;) -operator(}) - - -reserved(enum) ident(rb_thread_status) -ident(rb_thread_status)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - reserved(return) ident(th)operator(->)ident(status)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr.group => thgrp or nil - * - * Returns the ThreadGroup which contains thr, or nil if - * the thread is not a member of any group. - * - * Thread.main.group #=> # - */) - -ident(VALUE) -ident(rb_thread_group)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(VALUE) ident(group) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\)->)ident(thgroup)operator(;) - reserved(if) operator((!)ident(group)operator(\)) operator({) - ident(group) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(group)operator(;) -operator(}) - -preprocessor(#ifdef) ident(__ia64) -preprocessor(# define) ident(IA64_INIT)operator(()ident(x)operator(\)) ident(x) -preprocessor(#else) -preprocessor(# define) ident(IA64_INIT)operator(()ident(x)operator(\)) -preprocessor(#endif) - -preprocessor(#define) ident(THREAD_ALLOC)operator(()ident(th)operator(\)) reserved(do) operator({)\ - ident(th) operator(=) ident(ALLOC)operator(()reserved(struct) ident(rb_thread)operator(\);)\ -\ - ident(th)operator(->)ident(next) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(prev) operator(=) integer(0)operator(;)\ -\ - ident(th)operator(->)ident(status) operator(=) ident(THREAD_RUNNABLE)operator(;)\ - ident(th)operator(->)ident(result) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(flags) operator(=) integer(0)operator(;)\ -\ - ident(th)operator(->)ident(stk_ptr) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(stk_len) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(stk_max) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(wait_for) operator(=) integer(0)operator(;)\ - ident(IA64_INIT)operator(()ident(th)operator(->)ident(bstr_ptr) operator(=) integer(0)operator(\);)\ - ident(IA64_INIT)operator(()ident(th)operator(->)ident(bstr_len) operator(=) integer(0)operator(\);)\ - ident(IA64_INIT)operator(()ident(th)operator(->)ident(bstr_max) operator(=) integer(0)operator(\);)\ - ident(FD_ZERO)operator((&)ident(th)operator(->)ident(readfds)operator(\);)\ - ident(FD_ZERO)operator((&)ident(th)operator(->)ident(writefds)operator(\);)\ - ident(FD_ZERO)operator((&)ident(th)operator(->)ident(exceptfds)operator(\);)\ - ident(th)operator(->)ident(delay) operator(=) float(0)float(.0)operator(;)\ - ident(th)operator(->)ident(join) operator(=) integer(0)operator(;)\ -\ - ident(th)operator(->)ident(frame) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(scope) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(klass) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(wrapper) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(cref) operator(=) ident(ruby_cref)operator(;)\ - ident(th)operator(->)ident(dyna_vars) operator(=) ident(ruby_dyna_vars)operator(;)\ - ident(th)operator(->)ident(block) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(iter) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(tag) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(tracing) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(errinfo) operator(=) ident(Qnil)operator(;)\ - ident(th)operator(->)ident(last_status) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(last_line) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(last_match) operator(=) ident(Qnil)operator(;)\ - ident(th)operator(->)ident(abort) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(priority) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(thgroup) operator(=) ident(thgroup_default)operator(;)\ - ident(th)operator(->)ident(locals) operator(=) integer(0)operator(;)\ - ident(th)operator(->)ident(thread) operator(=) integer(0)operator(;)\ - reserved(if) operator(()ident(curr_thread) operator(==) integer(0)operator(\)) operator({)\ - ident(th)operator(->)ident(sandbox) operator(=) ident(Qnil)operator(;)\ - operator(}) reserved(else) operator({)\ - ident(th)operator(->)ident(sandbox) operator(=) ident(curr_thread)operator(->)ident(sandbox)operator(;)\ - operator(})\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -directive(static) ident(rb_thread_t) -ident(rb_thread_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(rb_thread_t) ident(th)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(vars)operator(;) - - ident(THREAD_ALLOC)operator(()ident(th)operator(\);) - ident(th)operator(->)ident(thread) operator(=) ident(Data_Wrap_Struct)operator(()ident(klass)operator(,) ident(thread_mark)operator(,) ident(thread_free)operator(,) ident(th)operator(\);) - - reserved(for) operator(()ident(vars) operator(=) ident(th)operator(->)ident(dyna_vars)operator(;) ident(vars)operator(;) ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\)\)) reserved(break)operator(;) - ident(FL_SET)operator(()ident(vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\);) - operator(}) - reserved(return) ident(th)operator(;) -operator(}) - -directive(static) pre_type(int) ident(thread_init)operator(;) - -preprocessor(#if) ident(defined)operator(()ident(_THREAD_SAFE)operator(\)) -directive(static) directive(void) -ident(catch_timer)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) -preprocessor(#if) operator(!)ident(defined)operator(()ident(POSIX_SIGNAL)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(BSD_SIGNAL)operator(\)) - ident(signal)operator(()ident(sig)operator(,) ident(catch_timer)operator(\);) -preprocessor(#endif) - comment(/* cause EINTR */) -operator(}) - -directive(static) pre_type(int) ident(time_thread_alive_p) operator(=) integer(0)operator(;) -directive(static) ident(pthread_t) ident(time_thread)operator(;) - -directive(static) directive(void)operator(*) -ident(thread_timer)operator(()ident(dummy)operator(\)) - directive(void) operator(*)ident(dummy)operator(;) -operator({) -preprocessor(#ifdef) ident(_THREAD_SAFE) -preprocessor(#define) ident(test_cancel)operator((\)) ident(pthread_testcancel)operator((\)) -preprocessor(#else) -preprocessor(#define) ident(test_cancel)operator((\)) comment(/* void */) -preprocessor(#endif) - - ident(sigset_t) ident(all_signals)operator(;) - - ident(sigfillset)operator((&)ident(all_signals)operator(\);) - ident(pthread_sigmask)operator(()ident(SIG_BLOCK)operator(,) operator(&)ident(all_signals)operator(,) integer(0)operator(\);) - - reserved(for) operator((;;\)) operator({) -preprocessor(#ifdef) ident(HAVE_NANOSLEEP) - reserved(struct) ident(timespec) ident(req)operator(,) ident(rem)operator(;) - - ident(test_cancel)operator((\);) - ident(req)operator(.)ident(tv_sec) operator(=) integer(0)operator(;) - ident(req)operator(.)ident(tv_nsec) operator(=) integer(10000000)operator(;) - ident(nanosleep)operator((&)ident(req)operator(,) operator(&)ident(rem)operator(\);) -preprocessor(#else) - reserved(struct) ident(timeval) ident(tv)operator(;) - - ident(test_cancel)operator((\);) - ident(tv)operator(.)ident(tv_sec) operator(=) integer(0)operator(;) - ident(tv)operator(.)ident(tv_usec) operator(=) integer(10000)operator(;) - ident(select)operator(()integer(0)operator(,) pre_constant(NULL)operator(,) pre_constant(NULL)operator(,) pre_constant(NULL)operator(,) operator(&)ident(tv)operator(\);) -preprocessor(#endif) - reserved(if) operator((!)ident(rb_thread_critical)operator(\)) operator({) - ident(rb_thread_pending) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(rb_trap_immediate)operator(\)) operator({) - ident(pthread_kill)operator(()ident(ruby_thid)operator(,) ident(SIGVTALRM)operator(\);) - operator(}) - operator(}) - operator(}) -preprocessor(#undef) ident(test_cancel) -operator(}) - -directive(void) -ident(rb_thread_start_timer)operator((\)) -operator({) -operator(}) - -directive(void) -ident(rb_thread_stop_timer)operator((\)) -operator({) -operator(}) - -directive(void) -ident(rb_child_atfork)operator((\)) -operator({) - ident(time_thread_alive_p) operator(=) integer(0)operator(;) -operator(}) - -directive(void) -ident(rb_thread_cancel_timer)operator((\)) -operator({) -preprocessor(#ifdef) ident(_THREAD_SAFE) - reserved(if)operator(() ident(time_thread_alive_p) operator(\)) - operator({) - ident(pthread_cancel)operator(() ident(time_thread) operator(\);) - ident(pthread_join)operator(() ident(time_thread)operator(,) pre_constant(NULL) operator(\);) - ident(time_thread_alive_p) operator(=) integer(0)operator(;) - operator(}) - ident(thread_init) operator(=) integer(0)operator(;) -preprocessor(#endif) -operator(}) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETITIMER)operator(\)) -directive(static) directive(void) -ident(catch_timer)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) -preprocessor(#if) operator(!)ident(defined)operator(()ident(POSIX_SIGNAL)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(BSD_SIGNAL)operator(\)) - ident(signal)operator(()ident(sig)operator(,) ident(catch_timer)operator(\);) -preprocessor(#endif) - reserved(if) operator((!)ident(rb_thread_critical)operator(\)) operator({) - ident(rb_thread_pending) operator(=) integer(1)operator(;) - operator(}) - comment(/* cause EINTR */) -operator(}) - -directive(void) -ident(rb_thread_start_timer)operator((\)) -operator({) - reserved(struct) ident(itimerval) ident(tval)operator(;) - - reserved(if) operator((!)ident(thread_init)operator(\)) reserved(return)operator(;) - ident(tval)operator(.)ident(it_interval)operator(.)ident(tv_sec) operator(=) integer(0)operator(;) - ident(tval)operator(.)ident(it_interval)operator(.)ident(tv_usec) operator(=) integer(10000)operator(;) - ident(tval)operator(.)ident(it_value) operator(=) ident(tval)operator(.)ident(it_interval)operator(;) - ident(setitimer)operator(()ident(ITIMER_VIRTUAL)operator(,) operator(&)ident(tval)operator(,) pre_constant(NULL)operator(\);) -operator(}) - -directive(void) -ident(rb_thread_stop_timer)operator((\)) -operator({) - reserved(struct) ident(itimerval) ident(tval)operator(;) - - reserved(if) operator((!)ident(thread_init)operator(\)) reserved(return)operator(;) - ident(tval)operator(.)ident(it_interval)operator(.)ident(tv_sec) operator(=) integer(0)operator(;) - ident(tval)operator(.)ident(it_interval)operator(.)ident(tv_usec) operator(=) integer(0)operator(;) - ident(tval)operator(.)ident(it_value) operator(=) ident(tval)operator(.)ident(it_interval)operator(;) - ident(setitimer)operator(()ident(ITIMER_VIRTUAL)operator(,) operator(&)ident(tval)operator(,) pre_constant(NULL)operator(\);) -operator(}) - -directive(void) -ident(rb_thread_cancel_timer)operator((\)) -operator({) -operator(}) - -preprocessor(#else) comment(/* !(_THREAD_SAFE || HAVE_SETITIMER\) */) -pre_type(int) ident(rb_thread_tick) operator(=) ident(THREAD_TICK)operator(;) - -directive(void) -ident(rb_thread_cancel_timer)operator((\)) -operator({) -operator(}) -preprocessor(#endif) - -directive(static) ident(VALUE) -ident(rb_thread_start_0)operator(()ident(fn)operator(,) ident(arg)operator(,) ident(th)operator(\)) - ident(VALUE) operator((*)ident(fn)operator(\)(\);) - directive(void) operator(*)ident(arg)operator(;) - ident(rb_thread_t) ident(th)operator(;) -operator({) - directive(volatile) ident(rb_thread_t) ident(th_save) operator(=) ident(th)operator(;) - directive(volatile) ident(VALUE) ident(thread) operator(=) ident(th)operator(->)ident(thread)operator(;) - reserved(struct) ident(BLOCK) operator(*)directive(volatile) ident(saved_block) operator(=) integer(0)operator(;) - reserved(enum) ident(rb_thread_status) ident(status)operator(;) - pre_type(int) ident(state)operator(;) - - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(curr_thread)operator(->)ident(thgroup)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) - stringoperator(\);) - operator(}) - - reserved(if) operator((!)ident(thread_init)operator(\)) operator({) - ident(thread_init) operator(=) integer(1)operator(;) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETITIMER)operator(\)) operator(||) ident(defined)operator(()ident(_THREAD_SAFE)operator(\)) -preprocessor(#if) ident(defined)operator(()ident(POSIX_SIGNAL)operator(\)) - ident(posix_signal)operator(()ident(SIGVTALRM)operator(,) ident(catch_timer)operator(\);) -preprocessor(#else) - ident(signal)operator(()ident(SIGVTALRM)operator(,) ident(catch_timer)operator(\);) -preprocessor(#endif) - -preprocessor(#ifdef) ident(_THREAD_SAFE) - ident(pthread_create)operator((&)ident(time_thread)operator(,) integer(0)operator(,) ident(thread_timer)operator(,) integer(0)operator(\);) - ident(time_thread_alive_p) operator(=) integer(1)operator(;) - ident(pthread_atfork)operator(()integer(0)operator(,) integer(0)operator(,) ident(rb_child_atfork)operator(\);) -preprocessor(#else) - ident(rb_thread_start_timer)operator((\);) -preprocessor(#endif) -preprocessor(#endif) - operator(}) - - reserved(if) operator(()ident(THREAD_SAVE_CONTEXT)operator(()ident(curr_thread)operator(\)\)) operator({) - reserved(return) ident(thread)operator(;) - operator(}) - - reserved(if) operator(()ident(ruby_block)operator(\)) operator({) comment(/* should nail down higher blocks */) - reserved(struct) ident(BLOCK) ident(dummy)operator(;) - - ident(dummy)operator(.)ident(prev) operator(=) ident(ruby_block)operator(;) - ident(blk_copy_prev)operator((&)ident(dummy)operator(\);) - ident(saved_block) operator(=) ident(ruby_block) operator(=) ident(dummy)operator(.)ident(prev)operator(;) - operator(}) - ident(scope_dup)operator(()ident(ruby_scope)operator(\);) - - reserved(if) operator((!)ident(th)operator(->)ident(next)operator(\)) operator({) - comment(/* merge in thread list */) - ident(th)operator(->)ident(prev) operator(=) ident(curr_thread)operator(;) - ident(curr_thread)operator(->)ident(next)operator(->)ident(prev) operator(=) ident(th)operator(;) - ident(th)operator(->)ident(next) operator(=) ident(curr_thread)operator(->)ident(next)operator(;) - ident(curr_thread)operator(->)ident(next) operator(=) ident(th)operator(;) - ident(th)operator(->)ident(priority) operator(=) ident(curr_thread)operator(->)ident(priority)operator(;) - ident(th)operator(->)ident(thgroup) operator(=) ident(curr_thread)operator(->)ident(thgroup)operator(;) - operator(}) - - ident(PUSH_TAG)operator(()ident(PROT_THREAD)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(THREAD_SAVE_CONTEXT)operator(()ident(th)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(curr_thread) operator(=) ident(th)operator(;) - ident(th)operator(->)ident(result) operator(=) operator((*)ident(fn)operator(\)()ident(arg)operator(,) ident(th)operator(\);) - operator(}) - ident(th) operator(=) ident(th_save)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(TAG_DST)operator((\)\)) operator({) - ident(th) operator(=) ident(th_save)operator(;) - ident(th)operator(->)ident(result) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - operator(}) - ident(POP_TAG)operator((\);) - ident(status) operator(=) ident(th)operator(->)ident(status)operator(;) - - reserved(if) operator(()ident(th) operator(==) ident(main_thread)operator(\)) ident(ruby_stop)operator(()ident(state)operator(\);) - ident(rb_thread_remove)operator(()ident(th)operator(\);) - - reserved(if) operator(()ident(saved_block)operator(\)) operator({) - ident(blk_free)operator(()ident(saved_block)operator(\);) - operator(}) - - reserved(if) operator(()ident(state) operator(&&) ident(status) operator(!=) ident(THREAD_TO_KILL) operator(&&) operator(!)ident(NIL_P)operator(()ident(ruby_errinfo)operator(\)\)) operator({) - ident(th)operator(->)ident(flags) operator(|=) ident(RAISED_EXCEPTION)operator(;) - reserved(if) operator(()ident(state) operator(==) ident(TAG_FATAL)operator(\)) operator({) - comment(/* fatal error within this thread, need to stop whole script */) - ident(main_thread)operator(->)ident(errinfo) operator(=) ident(ruby_errinfo)operator(;) - ident(rb_thread_cleanup)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(rb_obj_is_kind_of)operator(()ident(ruby_errinfo)operator(,) ident(rb_eSystemExit)operator(\)\)) operator({) - reserved(if) operator(()ident(th)operator(->)ident(safe) operator(>=) integer(4)operator(\)) operator({) - pre_type(char) ident(buf)operator([)integer(32)operator(];) - - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) ident(th)operator(->)ident(safe)operator(\);) - ident(th)operator(->)ident(errinfo) operator(=) ident(rb_exc_new2)operator(()ident(rb_eSecurityError)operator(,) ident(buf)operator(\);) - operator(}) - reserved(else) operator({) - comment(/* delegate exception to main_thread */) - ident(rb_thread_main_jump)operator(()ident(ruby_errinfo)operator(,) ident(RESTORE_RAISE)operator(\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(th)operator(->)ident(safe) operator(<) integer(4) operator(&&) operator(()ident(ruby_thread_abort) operator(||) ident(th)operator(->)ident(abort) operator(||) ident(RTEST)operator(()ident(ruby_debug)operator(\)\)\)) operator({) - comment(/* exit on main_thread */) - ident(error_print)operator((\);) - ident(rb_thread_main_jump)operator(()ident(ruby_errinfo)operator(,) ident(RESTORE_EXIT)operator(\);) - operator(}) - reserved(else) operator({) - ident(th)operator(->)ident(errinfo) operator(=) ident(ruby_errinfo)operator(;) - operator(}) - operator(}) - ident(rb_thread_schedule)operator((\);) - ident(ruby_stop)operator(()integer(0)operator(\);) comment(/* last thread termination */) - reserved(return) integer(0)operator(;) comment(/* not reached */) -operator(}) - -ident(VALUE) -ident(rb_thread_create)operator(()ident(fn)operator(,) ident(arg)operator(\)) - ident(VALUE) operator((*)ident(fn)operator(\)(\);) - directive(void) operator(*)ident(arg)operator(;) -operator({) - ident(Init_stack)operator((()directive(void) operator(*\)&)ident(arg)operator(\);) - reserved(return) ident(rb_thread_start_0)operator(()ident(fn)operator(,) ident(arg)operator(,) ident(rb_thread_alloc)operator(()ident(rb_cThread)operator(\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_thread_yield)operator(()ident(arg)operator(,) ident(th)operator(\)) - ident(VALUE) ident(arg)operator(;) - ident(rb_thread_t) ident(th)operator(;) -operator({) - directive(const) ident(ID) operator(*)ident(tbl)operator(;) - - ident(scope_dup)operator(()ident(ruby_block)operator(->)ident(scope)operator(\);) - - ident(tbl) operator(=) ident(ruby_scope)operator(->)ident(local_tbl)operator(;) - reserved(if) operator(()ident(tbl)operator(\)) operator({) - pre_type(int) ident(n) operator(=) operator(*)ident(tbl)operator(++;) - reserved(for) operator(()ident(tbl) operator(+=) integer(2)operator(,) ident(n) operator(-=) integer(2)operator(;) ident(n) operator(>) integer(0)operator(;) operator(--)ident(n)operator(\)) operator({) comment(/* skip first 2 ($_ and $~\) */) - ident(ID) ident(id) operator(=) operator(*)ident(tbl)operator(++;) - reserved(if) operator(()ident(id) operator(!=) integer(0) operator(&&) operator(!)ident(rb_is_local_id)operator(()ident(id)operator(\)\)) comment(/* push flip states */) - ident(rb_dvar_push)operator(()ident(id)operator(,) ident(Qfalse)operator(\);) - operator(}) - operator(}) - ident(rb_dvar_push)operator(()char('_')operator(,) ident(Qnil)operator(\);) - ident(rb_dvar_push)operator(()char('~')operator(,) ident(Qnil)operator(\);) - ident(ruby_block)operator(->)ident(dyna_vars) operator(=) ident(ruby_dyna_vars)operator(;) - - reserved(return) ident(rb_yield_0)operator(()ident(arg)operator(,) integer(0)operator(,) integer(0)operator(,) ident(YIELD_LAMBDA_CALL)operator(,) ident(Qtrue)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Thread.new([arg]*\) {|args| block } => thread - * - * Creates and runs a new thread to execute the instructions given in - * block. Any arguments passed to Thread::new are passed - * into the block. - * - * x = Thread.new { sleep 0.1; print "x"; print "y"; print "z" } - * a = Thread.new { print "a"; print "b"; sleep 0.2; print "c" } - * x.join # Let the threads finish before - * a.join # main thread exits... - * - * produces: - * - * abxyzc - */) - -directive(static) ident(VALUE) -ident(rb_thread_s_new)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_alloc)operator(()ident(klass)operator(\);) - directive(volatile) ident(VALUE) operator(*)ident(pos)operator(;) - - ident(pos) operator(=) ident(th)operator(->)ident(stk_pos)operator(;) - ident(rb_obj_call_init)operator(()ident(th)operator(->)ident(thread)operator(,) ident(argc)operator(,) ident(argv)operator(\);) - reserved(if) operator(()ident(th)operator(->)ident(stk_pos) operator(==) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(,) - ident(rb_class2name)operator(()ident(klass)operator(\)\);) - operator(}) - - reserved(return) ident(th)operator(->)ident(thread)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Thread.new([arg]*\) {|args| block } => thread - * - * Creates and runs a new thread to execute the instructions given in - * block. Any arguments passed to Thread::new are passed - * into the block. - * - * x = Thread.new { sleep 0.1; print "x"; print "y"; print "z" } - * a = Thread.new { print "a"; print "b"; sleep 0.2; print "c" } - * x.join # Let the threads finish before - * a.join # main thread exits... - * - * produces: - * - * abxyzc - */) - -directive(static) ident(VALUE) -ident(rb_thread_initialize)operator(()ident(thread)operator(,) ident(args)operator(\)) - ident(VALUE) ident(thread)operator(,) ident(args)operator(;) -operator({) - ident(rb_thread_t) ident(th)operator(;) - - reserved(if) operator((!)ident(rb_block_given_p)operator((\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(\);) - operator(}) - ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - reserved(if) operator(()ident(th)operator(->)ident(stk_max)operator(\)) operator({) - ident(NODE) operator(*)ident(node) operator(=) ident(th)operator(->)ident(node)operator(;) - reserved(if) operator((!)ident(node)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(\);) - operator(}) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(,) - ident(node)operator(->)ident(nd_file)operator(,) ident(nd_line)operator(()ident(node)operator(\)\);) - operator(}) - reserved(return) ident(rb_thread_start_0)operator(()ident(rb_thread_yield)operator(,) ident(args)operator(,) ident(th)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Thread.start([args]*\) {|args| block } => thread - * Thread.fork([args]*\) {|args| block } => thread - * - * Basically the same as Thread::new. However, if class - * Thread is subclassed, then calling start in that - * subclass will not invoke the subclass's initialize method. - */) - -directive(static) ident(VALUE) -ident(rb_thread_start)operator(()ident(klass)operator(,) ident(args)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(args)operator(;) -operator({) - reserved(if) operator((!)ident(rb_block_given_p)operator((\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(rb_thread_start_0)operator(()ident(rb_thread_yield)operator(,) ident(args)operator(,) ident(rb_thread_alloc)operator(()ident(klass)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * thr.value => obj - * - * Waits for thr to complete (via Thread#join\) and returns - * its value. - * - * a = Thread.new { 2 + 2 } - * a.value #=> 4 - */) - -directive(static) ident(VALUE) -ident(rb_thread_value)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - - reserved(while) operator((!)ident(rb_thread_join0)operator(()ident(th)operator(,) ident(DELAY_INFTY)operator(\)\);) - - reserved(return) ident(th)operator(->)ident(result)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr.status => string, false or nil - * - * Returns the status of thr: ``sleep'' if thr is - * sleeping or waiting on I/O, ``run'' if thr is executing, - * ``aborting'' if thr is aborting, false if - * thr terminated normally, and nil if thr - * terminated with an exception. - * - * a = Thread.new { raise("die now"\) } - * b = Thread.new { Thread.stop } - * c = Thread.new { Thread.exit } - * d = Thread.new { sleep } - * Thread.critical = true - * d.kill #=> # - * a.status #=> nil - * b.status #=> "sleep" - * c.status #=> false - * d.status #=> "aborting" - * Thread.current.status #=> "run" - */) - -directive(static) ident(VALUE) -ident(rb_thread_status_name)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - - reserved(if) operator(()ident(rb_thread_dead)operator(()ident(th)operator(\)\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(th)operator(->)ident(errinfo)operator(\)) operator(&&) operator(()ident(th)operator(->)ident(flags) operator(&) ident(RAISED_EXCEPTION)operator(\)\)) - reserved(return) ident(Qnil)operator(;) - reserved(return) ident(Qfalse)operator(;) - operator(}) - - reserved(return) ident(rb_str_new2)operator(()ident(thread_status_name)operator(()ident(th)operator(->)ident(status)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * thr.alive? => true or false - * - * Returns true if thr is running or sleeping. - * - * thr = Thread.new { } - * thr.join #=> # - * Thread.current.alive? #=> true - * thr.alive? #=> false - */) - -ident(VALUE) -ident(rb_thread_alive_p)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - - reserved(if) operator(()ident(rb_thread_dead)operator(()ident(th)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr.stop? => true or false - * - * Returns true if thr is dead or sleeping. - * - * a = Thread.new { Thread.stop } - * b = Thread.current - * a.stop? #=> true - * b.stop? #=> false - */) - -directive(static) ident(VALUE) -ident(rb_thread_stop_p)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - - reserved(if) operator(()ident(rb_thread_dead)operator(()ident(th)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(th)operator(->)ident(status) operator(==) ident(THREAD_STOPPED)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) directive(void) -ident(rb_thread_wait_other_threads)operator((\)) -operator({) - ident(rb_thread_t) ident(th)operator(;) - pre_type(int) ident(found)operator(;) - - comment(/* wait other threads to terminate */) - reserved(while) operator(()ident(curr_thread) operator(!=) ident(curr_thread)operator(->)ident(next)operator(\)) operator({) - ident(found) operator(=) integer(0)operator(;) - ident(FOREACH_THREAD)operator(()ident(th)operator(\)) operator({) - reserved(if) operator(()ident(th) operator(!=) ident(curr_thread) operator(&&) ident(th)operator(->)ident(status) operator(!=) ident(THREAD_STOPPED)operator(\)) operator({) - ident(found) operator(=) integer(1)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - ident(END_FOREACH)operator(()ident(th)operator(\);) - reserved(if) operator((!)ident(found)operator(\)) reserved(return)operator(;) - ident(rb_thread_schedule)operator((\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(rb_thread_cleanup)operator((\)) -operator({) - ident(rb_thread_t) ident(curr)operator(,) ident(th)operator(;) - - ident(curr) operator(=) ident(curr_thread)operator(;) - reserved(while) operator(()ident(curr)operator(->)ident(status) operator(==) ident(THREAD_KILLED)operator(\)) operator({) - ident(curr) operator(=) ident(curr)operator(->)ident(prev)operator(;) - operator(}) - - ident(FOREACH_THREAD_FROM)operator(()ident(curr)operator(,) ident(th)operator(\)) operator({) - reserved(if) operator(()ident(th)operator(->)ident(status) operator(!=) ident(THREAD_KILLED)operator(\)) operator({) - ident(rb_thread_ready)operator(()ident(th)operator(\);) - reserved(if) operator(()ident(th) operator(!=) ident(main_thread)operator(\)) operator({) - ident(th)operator(->)ident(thgroup) operator(=) integer(0)operator(;) - ident(th)operator(->)ident(priority) operator(=) integer(0)operator(;) - ident(th)operator(->)ident(status) operator(=) ident(THREAD_TO_KILL)operator(;) - ident(RDATA)operator(()ident(th)operator(->)ident(thread)operator(\)->)ident(dfree) operator(=) pre_constant(NULL)operator(;) - operator(}) - operator(}) - operator(}) - ident(END_FOREACH_FROM)operator(()ident(curr)operator(,) ident(th)operator(\);) -operator(}) - -pre_type(int) ident(rb_thread_critical)operator(;) - - -comment(/* - * call-seq: - * Thread.critical => true or false - * - * Returns the status of the global ``thread critical'' condition. - */) - -directive(static) ident(VALUE) -ident(rb_thread_critical_get)operator((\)) -operator({) - reserved(return) ident(rb_thread_critical)operator(?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Thread.critical= boolean => true or false - * - * Sets the status of the global ``thread critical'' condition and returns - * it. When set to true, prohibits scheduling of any existing - * thread. Does not block new threads from being created and run. Certain - * thread operations (such as stopping or killing a thread, sleeping in the - * current thread, and raising an exception\) may cause a thread to be scheduled - * even when in a critical section. Thread::critical is not - * intended for daily use: it is primarily there to support folks writing - * threading libraries. - */) - -directive(static) ident(VALUE) -ident(rb_thread_critical_set)operator(()ident(obj)operator(,) ident(val)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(val)operator(;) -operator({) - ident(rb_thread_critical) operator(=) ident(RTEST)operator(()ident(val)operator(\);) - reserved(return) ident(val)operator(;) -operator(}) - -directive(void) -ident(rb_thread_interrupt)operator((\)) -operator({) - ident(rb_thread_critical) operator(=) integer(0)operator(;) - ident(rb_thread_ready)operator(()ident(main_thread)operator(\);) - reserved(if) operator(()ident(curr_thread) operator(==) ident(main_thread)operator(\)) operator({) - ident(rb_interrupt)operator((\);) - operator(}) - reserved(if) operator((!)ident(rb_thread_dead)operator(()ident(curr_thread)operator(\)\)) operator({) - reserved(if) operator(()ident(THREAD_SAVE_CONTEXT)operator(()ident(curr_thread)operator(\)\)) operator({) - reserved(return)operator(;) - operator(}) - operator(}) - ident(curr_thread) operator(=) ident(main_thread)operator(;) - ident(rb_thread_restore_context)operator(()ident(curr_thread)operator(,) ident(RESTORE_INTERRUPT)operator(\);) -operator(}) - -directive(void) -ident(rb_thread_signal_raise)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) - ident(rb_thread_critical) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(curr_thread) operator(==) ident(main_thread)operator(\)) operator({) - ident(VALUE) ident(argv)operator([)integer(1)operator(];) - - ident(rb_thread_ready)operator(()ident(curr_thread)operator(\);) - ident(argv)operator([)integer(0)operator(]) operator(=) ident(INT2FIX)operator(()ident(sig)operator(\);) - ident(rb_exc_raise)operator(()ident(rb_class_new_instance)operator(()integer(1)operator(,) ident(argv)operator(,) ident(rb_eSignal)operator(\)\);) - operator(}) - ident(rb_thread_ready)operator(()ident(main_thread)operator(\);) - reserved(if) operator((!)ident(rb_thread_dead)operator(()ident(curr_thread)operator(\)\)) operator({) - reserved(if) operator(()ident(THREAD_SAVE_CONTEXT)operator(()ident(curr_thread)operator(\)\)) operator({) - reserved(return)operator(;) - operator(}) - operator(}) - ident(th_sig) operator(=) ident(sig)operator(;) - ident(curr_thread) operator(=) ident(main_thread)operator(;) - ident(rb_thread_restore_context)operator(()ident(curr_thread)operator(,) ident(RESTORE_SIGNAL)operator(\);) -operator(}) - -directive(void) -ident(rb_thread_trap_eval)operator(()ident(cmd)operator(,) ident(sig)operator(,) ident(safe)operator(\)) - ident(VALUE) ident(cmd)operator(;) - pre_type(int) ident(sig)operator(,) ident(safe)operator(;) -operator({) - ident(rb_thread_critical) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(curr_thread) operator(==) ident(main_thread)operator(\)) operator({) - ident(rb_trap_eval)operator(()ident(cmd)operator(,) ident(sig)operator(,) ident(safe)operator(\);) - reserved(return)operator(;) - operator(}) - reserved(if) operator((!)ident(rb_thread_dead)operator(()ident(curr_thread)operator(\)\)) operator({) - reserved(if) operator(()ident(THREAD_SAVE_CONTEXT)operator(()ident(curr_thread)operator(\)\)) operator({) - reserved(return)operator(;) - operator(}) - operator(}) - ident(th_cmd) operator(=) ident(cmd)operator(;) - ident(th_sig) operator(=) ident(sig)operator(;) - ident(th_safe) operator(=) ident(safe)operator(;) - ident(curr_thread) operator(=) ident(main_thread)operator(;) - ident(rb_thread_restore_context)operator(()ident(curr_thread)operator(,) ident(RESTORE_TRAP)operator(\);) -operator(}) - -directive(void) -ident(rb_thread_signal_exit)operator((\)) -operator({) - ident(VALUE) ident(args)operator([)integer(2)operator(];) - - ident(rb_thread_critical) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(curr_thread) operator(==) ident(main_thread)operator(\)) operator({) - ident(rb_thread_ready)operator(()ident(curr_thread)operator(\);) - ident(rb_exit)operator(()ident(EXIT_SUCCESS)operator(\);) - operator(}) - ident(args)operator([)integer(0)operator(]) operator(=) ident(INT2NUM)operator(()ident(EXIT_SUCCESS)operator(\);) - ident(args)operator([)integer(1)operator(]) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - ident(rb_thread_ready)operator(()ident(main_thread)operator(\);) - reserved(if) operator((!)ident(rb_thread_dead)operator(()ident(curr_thread)operator(\)\)) operator({) - reserved(if) operator(()ident(THREAD_SAVE_CONTEXT)operator(()ident(curr_thread)operator(\)\)) operator({) - reserved(return)operator(;) - operator(}) - operator(}) - ident(rb_thread_main_jump)operator(()ident(rb_class_new_instance)operator(()integer(2)operator(,) ident(args)operator(,) ident(rb_eSystemExit)operator(\),) - ident(RESTORE_EXIT)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_thread_raise)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(th)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(rb_thread_t) ident(th)operator(;) -operator({) - directive(volatile) ident(rb_thread_t) ident(th_save) operator(=) ident(th)operator(;) - ident(VALUE) ident(exc)operator(;) - - reserved(if) operator((!)ident(th)operator(->)ident(next)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(rb_thread_dead)operator(()ident(th)operator(\)\)) reserved(return) ident(Qnil)operator(;) - ident(exc) operator(=) ident(rb_make_exception)operator(()ident(argc)operator(,) ident(argv)operator(\);) - reserved(if) operator(()ident(curr_thread) operator(==) ident(th)operator(\)) operator({) - ident(rb_raise_jump)operator(()ident(exc)operator(\);) - operator(}) - - reserved(if) operator((!)ident(rb_thread_dead)operator(()ident(curr_thread)operator(\)\)) operator({) - reserved(if) operator(()ident(THREAD_SAVE_CONTEXT)operator(()ident(curr_thread)operator(\)\)) operator({) - reserved(return) ident(th_save)operator(->)ident(thread)operator(;) - operator(}) - operator(}) - - ident(rb_thread_ready)operator(()ident(th)operator(\);) - ident(curr_thread) operator(=) ident(th)operator(;) - - ident(th_raise_exception) operator(=) ident(exc)operator(;) - ident(th_raise_node) operator(=) ident(ruby_current_node)operator(;) - ident(rb_thread_restore_context)operator(()ident(curr_thread)operator(,) ident(RESTORE_RAISE)operator(\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - - -comment(/* - * call-seq: - * thr.raise(exception\) - * - * Raises an exception (see Kernel::raise\) from thr. The - * caller does not have to be thr. - * - * Thread.abort_on_exception = true - * a = Thread.new { sleep(200\) } - * a.raise("Gotcha"\) - * - * produces: - * - * prog.rb:3: Gotcha (RuntimeError\) - * from prog.rb:2:in `initialize' - * from prog.rb:2:in `new' - * from prog.rb:2 - */) - -directive(static) ident(VALUE) -ident(rb_thread_raise_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(thread)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - - reserved(if) operator(()ident(ruby_safe_level) operator(>) ident(th)operator(->)ident(safe)operator(\)) operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - operator(}) - ident(rb_thread_raise)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(th)operator(\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -ident(VALUE) -ident(rb_thread_local_aref)operator(()ident(thread)operator(,) ident(id)operator(\)) - ident(VALUE) ident(thread)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(rb_thread_t) ident(th)operator(;) - ident(VALUE) ident(val)operator(;) - - ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4) operator(&&) ident(th) operator(!=) ident(curr_thread)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator((!)ident(th)operator(->)ident(locals)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(st_lookup)operator(()ident(th)operator(->)ident(locals)operator(,) ident(id)operator(,) operator(&)ident(val)operator(\)\)) operator({) - reserved(return) ident(val)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr[sym] => obj or nil - * - * Attribute Reference---Returns the value of a thread-local variable, using - * either a symbol or a string name. If the specified variable does not exist, - * returns nil. - * - * a = Thread.new { Thread.current["name"] = "A"; Thread.stop } - * b = Thread.new { Thread.current[:name] = "B"; Thread.stop } - * c = Thread.new { Thread.current["name"] = "C"; Thread.stop } - * Thread.list.each {|x| puts "#{x.inspect}: #{x[:name]}" } - * - * produces: - * - * #: C - * #: B - * #: A - * #: - */) - -directive(static) ident(VALUE) -ident(rb_thread_aref)operator(()ident(thread)operator(,) ident(id)operator(\)) - ident(VALUE) ident(thread)operator(,) ident(id)operator(;) -operator({) - reserved(return) ident(rb_thread_local_aref)operator(()ident(thread)operator(,) ident(rb_to_id)operator(()ident(id)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_thread_local_aset)operator(()ident(thread)operator(,) ident(id)operator(,) ident(val)operator(\)) - ident(VALUE) ident(thread)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - - reserved(if) operator(()ident(ruby_safe_level) operator(>=) integer(4) operator(&&) ident(th) operator(!=) ident(curr_thread)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(thread)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - - reserved(if) operator((!)ident(th)operator(->)ident(locals)operator(\)) operator({) - ident(th)operator(->)ident(locals) operator(=) ident(st_init_numtable)operator((\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(val)operator(\)\)) operator({) - ident(st_delete)operator(()ident(th)operator(->)ident(locals)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(id)operator(,) integer(0)operator(\);) - reserved(return) ident(Qnil)operator(;) - operator(}) - ident(st_insert)operator(()ident(th)operator(->)ident(locals)operator(,) ident(id)operator(,) ident(val)operator(\);) - - reserved(return) ident(val)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr[sym] = obj => obj - * - * Attribute Assignment---Sets or creates the value of a thread-local variable, - * using either a symbol or a string. See also Thread#[]. - */) - -directive(static) ident(VALUE) -ident(rb_thread_aset)operator(()ident(thread)operator(,) ident(id)operator(,) ident(val)operator(\)) - ident(VALUE) ident(thread)operator(,) ident(id)operator(,) ident(val)operator(;) -operator({) - reserved(return) ident(rb_thread_local_aset)operator(()ident(thread)operator(,) ident(rb_to_id)operator(()ident(id)operator(\),) ident(val)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * thr.key?(sym\) => true or false - * - * Returns true if the given string (or symbol\) exists as a - * thread-local variable. - * - * me = Thread.current - * me[:oliver] = "a" - * me.key?(:oliver\) #=> true - * me.key?(:stanley\) #=> false - */) - -directive(static) ident(VALUE) -ident(rb_thread_key_p)operator(()ident(thread)operator(,) ident(id)operator(\)) - ident(VALUE) ident(thread)operator(,) ident(id)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - - reserved(if) operator((!)ident(th)operator(->)ident(locals)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(st_lookup)operator(()ident(th)operator(->)ident(locals)operator(,) ident(rb_to_id)operator(()ident(id)operator(\),) integer(0)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(thread_keys_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(ary)operator(\)) - ident(ID) ident(key)operator(;) - ident(VALUE) ident(value)operator(,) ident(ary)operator(;) -operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(ID2SYM)operator(()ident(key)operator(\)\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thr.keys => array - * - * Returns an an array of the names of the thread-local variables (as Symbols\). - * - * thr = Thread.new do - * Thread.current[:cat] = 'meow' - * Thread.current["dog"] = 'woof' - * end - * thr.join #=> # - * thr.keys #=> [:dog, :cat] - */) - -directive(static) ident(VALUE) -ident(rb_thread_keys)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - reserved(if) operator(()ident(th)operator(->)ident(locals)operator(\)) operator({) - ident(st_foreach)operator(()ident(th)operator(->)ident(locals)operator(,) ident(thread_keys_i)operator(,) ident(ary)operator(\);) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * thr.inspect => string - * - * Dump the name, id, and status of _thr_ to a string. - */) - -directive(static) ident(VALUE) -ident(rb_thread_inspect)operator(()ident(thread)operator(\)) - ident(VALUE) ident(thread)operator(;) -operator({) - pre_type(char) operator(*)ident(cname) operator(=) ident(rb_obj_classname)operator(()ident(thread)operator(\);) - ident(rb_thread_t) ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - directive(const) pre_type(char) operator(*)ident(status) operator(=) ident(thread_status_name)operator(()ident(th)operator(->)ident(status)operator(\);) - ident(VALUE) ident(str)operator(;) - ident(size_t) ident(len) operator(=) ident(strlen)operator(()ident(cname)operator(\)+)integer(7)operator(+)integer(16)operator(+)integer(9)operator(+)integer(1)operator(;) - - ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) comment(/* 7:tags 16:addr 9:status 1:nul */) - ident(snprintf)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(,) string)delimiter(")>operator(,) ident(cname)operator(,) ident(thread)operator(,) ident(status)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(strlen)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(thread)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -directive(void) -ident(rb_thread_atfork)operator((\)) -operator({) - ident(rb_thread_t) ident(th)operator(;) - - reserved(if) operator(()ident(rb_thread_alone)operator((\)\)) reserved(return)operator(;) - ident(FOREACH_THREAD)operator(()ident(th)operator(\)) operator({) - reserved(if) operator(()ident(th) operator(!=) ident(curr_thread)operator(\)) operator({) - ident(rb_thread_die)operator(()ident(th)operator(\);) - operator(}) - operator(}) - ident(END_FOREACH)operator(()ident(th)operator(\);) - ident(main_thread) operator(=) ident(curr_thread)operator(;) - ident(curr_thread)operator(->)ident(next) operator(=) ident(curr_thread)operator(;) - ident(curr_thread)operator(->)ident(prev) operator(=) ident(curr_thread)operator(;) -operator(}) - - -directive(static) directive(void) -ident(cc_purge)operator(()ident(cc)operator(\)) - ident(rb_thread_t) ident(cc)operator(;) -operator({) - comment(/* free continuation's stack if it has just died */) - reserved(if) operator(()ident(NIL_P)operator(()ident(cc)operator(->)ident(thread)operator(\)\)) reserved(return)operator(;) - reserved(if) operator(()ident(rb_thread_check)operator(()ident(cc)operator(->)ident(thread)operator(\)->)ident(status) operator(==) ident(THREAD_KILLED)operator(\)) operator({) - ident(cc)operator(->)ident(thread) operator(=) ident(Qnil)operator(;) - ident(rb_thread_die)operator(()ident(cc)operator(\);) comment(/* can't possibly activate this stack */) - operator(}) -operator(}) - -directive(static) directive(void) -ident(cc_mark)operator(()ident(cc)operator(\)) - ident(rb_thread_t) ident(cc)operator(;) -operator({) - comment(/* mark this continuation's stack only if its parent thread is still alive */) - ident(cc_purge)operator(()ident(cc)operator(\);) - ident(thread_mark)operator(()ident(cc)operator(\);) -operator(}) - -directive(static) ident(rb_thread_t) -ident(rb_cont_check)operator(()ident(data)operator(\)) - ident(VALUE) ident(data)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(data)operator(\)) operator(!=) ident(T_DATA) operator(||) ident(RDATA)operator(()ident(data)operator(\)->)ident(dmark) operator(!=) operator(()ident(RUBY_DATA_FUNC)operator(\))ident(cc_mark)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(data)operator(\)\);) - operator(}) - reserved(return) operator(()ident(rb_thread_t)operator(\))ident(RDATA)operator(()ident(data)operator(\)->)ident(data)operator(;) -operator(}) - -comment(/* - * Document-class: Continuation - * - * Continuation objects are generated by - * Kernel#callcc. They hold a return address and execution - * context, allowing a nonlocal return to the end of the - * callcc block from anywhere within a program. - * Continuations are somewhat analogous to a structured version of C's - * setjmp/longjmp (although they contain more state, so - * you might consider them closer to threads\). - * - * For instance: - * - * arr = [ "Freddie", "Herbie", "Ron", "Max", "Ringo" ] - * callcc{|$cc|} - * puts(message = arr.shift\) - * $cc.call unless message =~ /Max/ - * - * produces: - * - * Freddie - * Herbie - * Ron - * Max - * - * This (somewhat contrived\) example allows the inner loop to abandon - * processing early: - * - * callcc {|cont| - * for i in 0..4 - * print "\\n#{i}: " - * for j in i*5...(i+1\)*5 - * cont.call(\) if j == 17 - * printf "%3d", j - * end - * end - * } - * print "\\n" - * - * produces: - * - * 0: 0 1 2 3 4 - * 1: 5 6 7 8 9 - * 2: 10 11 12 13 14 - * 3: 15 16 - */) - -ident(VALUE) ident(rb_cCont)operator(;) - -comment(/* - * call-seq: - * callcc {|cont| block } => obj - * - * Generates a Continuation object, which it passes to the - * associated block. Performing a cont.call will - * cause the callcc to return (as will falling through the - * end of the block\). The value returned by the callcc is - * the value of the block, or the value passed to - * cont.call. See class Continuation - * for more details. Also see Kernel::throw for - * an alternative mechanism for unwinding a call stack. - */) - -directive(static) ident(VALUE) -ident(rb_callcc)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(cont)operator(;) - ident(rb_thread_t) ident(th)operator(;) - directive(volatile) ident(rb_thread_t) ident(th_save)operator(;) - reserved(struct) ident(tag) operator(*)ident(tag)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(vars)operator(;) - - ident(THREAD_ALLOC)operator(()ident(th)operator(\);) - comment(/* must finish th initialization before any possible gc. - * brent@mbari.org */) - ident(th)operator(->)ident(thread) operator(=) ident(curr_thread)operator(->)ident(thread)operator(;) - ident(th)operator(->)ident(thgroup) operator(=) ident(cont_protect)operator(;) - ident(cont) operator(=) ident(Data_Wrap_Struct)operator(()ident(rb_cCont)operator(,) ident(cc_mark)operator(,) ident(thread_free)operator(,) ident(th)operator(\);) - - ident(scope_dup)operator(()ident(ruby_scope)operator(\);) - reserved(for) operator(()ident(tag)operator(=)ident(prot_tag)operator(;) ident(tag)operator(;) ident(tag)operator(=)ident(tag)operator(->)ident(prev)operator(\)) operator({) - ident(scope_dup)operator(()ident(tag)operator(->)ident(scope)operator(\);) - operator(}) - - reserved(for) operator(()ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) ident(vars)operator(;) ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\)\)) reserved(break)operator(;) - ident(FL_SET)operator(()ident(vars)operator(,) ident(DVAR_DONT_RECYCLE)operator(\);) - operator(}) - ident(th_save) operator(=) ident(th)operator(;) - reserved(if) operator(()ident(THREAD_SAVE_CONTEXT)operator(()ident(th)operator(\)\)) operator({) - reserved(return) ident(th_save)operator(->)ident(result)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) ident(rb_yield)operator(()ident(cont)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * cont.call(args, ...\) - * cont[args, ...] - * - * Invokes the continuation. The program continues from the end of the - * callcc block. If no arguments are given, the original - * callcc returns nil. If one argument is - * given, callcc returns it. Otherwise, an array - * containing args is returned. - * - * callcc {|cont| cont.call } #=> nil - * callcc {|cont| cont.call 1 } #=> 1 - * callcc {|cont| cont.call 1, 2, 3 } #=> [1, 2, 3] - */) - -directive(static) ident(VALUE) -ident(rb_cont_call)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(cont)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(cont)operator(;) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_cont_check)operator(()ident(cont)operator(\);) - - reserved(if) operator(()ident(th)operator(->)ident(thread) operator(!=) ident(curr_thread)operator(->)ident(thread)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(th)operator(->)ident(thgroup) operator(!=) ident(cont_protect)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - reserved(switch) operator(()ident(argc)operator(\)) operator({) - reserved(case) integer(0)operator(:) - ident(th)operator(->)ident(result) operator(=) ident(Qnil)operator(;) - reserved(break)operator(;) - reserved(case) integer(1)operator(:) - ident(th)operator(->)ident(result) operator(=) ident(argv)operator([)integer(0)operator(];) - reserved(break)operator(;) - reserved(default)operator(:) - ident(th)operator(->)ident(result) operator(=) ident(rb_ary_new4)operator(()ident(argc)operator(,) ident(argv)operator(\);) - reserved(break)operator(;) - operator(}) - - ident(rb_thread_restore_context)operator(()ident(th)operator(,) ident(RESTORE_NORMAL)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -reserved(struct) ident(thgroup) operator({) - pre_type(int) ident(enclosed)operator(;) - ident(VALUE) ident(group)operator(;) -operator(};) - - -comment(/* - * Document-class: ThreadGroup - * - * ThreadGroup provides a means of keeping track of a number of - * threads as a group. A Thread can belong to only one - * ThreadGroup at a time; adding a thread to a new group will - * remove it from any previous group. - * - * Newly created threads belong to the same group as the thread from which they - * were created. - */) - -directive(static) ident(VALUE) ident(thgroup_s_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(thgroup_s_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(group)operator(;) - reserved(struct) ident(thgroup) operator(*)ident(data)operator(;) - - ident(group) operator(=) ident(Data_Make_Struct)operator(()ident(klass)operator(,) reserved(struct) ident(thgroup)operator(,) integer(0)operator(,) ident(free)operator(,) ident(data)operator(\);) - ident(data)operator(->)ident(enclosed) operator(=) integer(0)operator(;) - ident(data)operator(->)ident(group) operator(=) ident(group)operator(;) - - reserved(return) ident(group)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thgrp.list => array - * - * Returns an array of all existing Thread objects that belong to - * this group. - * - * ThreadGroup::Default.list #=> [#] - */) - -directive(static) ident(VALUE) -ident(thgroup_list)operator(()ident(group)operator(\)) - ident(VALUE) ident(group)operator(;) -operator({) - reserved(struct) ident(thgroup) operator(*)ident(data)operator(;) - ident(rb_thread_t) ident(th)operator(;) - ident(VALUE) ident(ary)operator(;) - - ident(Data_Get_Struct)operator(()ident(group)operator(,) reserved(struct) ident(thgroup)operator(,) ident(data)operator(\);) - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - ident(FOREACH_THREAD)operator(()ident(th)operator(\)) operator({) - reserved(if) operator(()ident(th)operator(->)ident(thgroup) operator(==) ident(data)operator(->)ident(group)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(th)operator(->)ident(thread)operator(\);) - operator(}) - operator(}) - ident(END_FOREACH)operator(()ident(th)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thgrp.enclose => thgrp - * - * Prevents threads from being added to or removed from the receiving - * ThreadGroup. New threads can still be started in an enclosed - * ThreadGroup. - * - * ThreadGroup::Default.enclose #=> # - * thr = Thread::new { Thread.stop } #=> # - * tg = ThreadGroup::new #=> # - * tg.add thr - * - * produces: - * - * ThreadError: can't move from the enclosed thread group - */) - -directive(static) ident(VALUE) -ident(thgroup_enclose)operator(()ident(group)operator(\)) - ident(VALUE) ident(group)operator(;) -operator({) - reserved(struct) ident(thgroup) operator(*)ident(data)operator(;) - - ident(Data_Get_Struct)operator(()ident(group)operator(,) reserved(struct) ident(thgroup)operator(,) ident(data)operator(\);) - ident(data)operator(->)ident(enclosed) operator(=) integer(1)operator(;) - - reserved(return) ident(group)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thgrp.enclosed? => true or false - * - * Returns true if thgrp is enclosed. See also - * ThreadGroup#enclose. - */) - -directive(static) ident(VALUE) -ident(thgroup_enclosed_p)operator(()ident(group)operator(\)) - ident(VALUE) ident(group)operator(;) -operator({) - reserved(struct) ident(thgroup) operator(*)ident(data)operator(;) - - ident(Data_Get_Struct)operator(()ident(group)operator(,) reserved(struct) ident(thgroup)operator(,) ident(data)operator(\);) - reserved(if) operator(()ident(data)operator(->)ident(enclosed)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * thgrp.add(thread\) => thgrp - * - * Adds the given thread to this group, removing it from any other - * group to which it may have previously belonged. - * - * puts "Initial group is #{ThreadGroup::Default.list}" - * tg = ThreadGroup.new - * t1 = Thread.new { sleep } - * t2 = Thread.new { sleep } - * puts "t1 is #{t1}" - * puts "t2 is #{t2}" - * tg.add(t1\) - * puts "Initial group now #{ThreadGroup::Default.list}" - * puts "tg group now #{tg.list}" - * - * produces: - * - * Initial group is # - * t1 is # - * t2 is # - * Initial group now ## - * tg group now # - */) - -directive(static) ident(VALUE) -ident(thgroup_add)operator(()ident(group)operator(,) ident(thread)operator(\)) - ident(VALUE) ident(group)operator(,) ident(thread)operator(;) -operator({) - ident(rb_thread_t) ident(th)operator(;) - reserved(struct) ident(thgroup) operator(*)ident(data)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - ident(th) operator(=) ident(rb_thread_check)operator(()ident(thread)operator(\);) - - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(group)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(\);) - operator(}) - ident(Data_Get_Struct)operator(()ident(group)operator(,) reserved(struct) ident(thgroup)operator(,) ident(data)operator(\);) - reserved(if) operator(()ident(data)operator(->)ident(enclosed)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator((!)ident(th)operator(->)ident(thgroup)operator(\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(th)operator(->)ident(thgroup)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(\);) - operator(}) - ident(Data_Get_Struct)operator(()ident(th)operator(->)ident(thgroup)operator(,) reserved(struct) ident(thgroup)operator(,) ident(data)operator(\);) - reserved(if) operator(()ident(data)operator(->)ident(enclosed)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(\);) - operator(}) - - ident(th)operator(->)ident(thgroup) operator(=) ident(group)operator(;) - reserved(return) ident(group)operator(;) -operator(}) - - -comment(/* - * +Thread+ encapsulates the behavior of a thread of - * execution, including the main thread of the Ruby script. - * - * In the descriptions of the methods in this class, the parameter _sym_ - * refers to a symbol, which is either a quoted string or a - * +Symbol+ (such as :name\). - */) - -directive(void) -ident(Init_Thread)operator((\)) -operator({) - ident(VALUE) ident(cThGroup)operator(;) - - ident(rb_eThreadError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_cThread) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_undef_alloc_func)operator(()ident(rb_cThread)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_s_new)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_initialize)operator(,) operator(-)integer(2)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_start)operator(,) operator(-)integer(2)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_start)operator(,) operator(-)integer(2)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_stop)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_s_kill)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_exit)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_pass)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_current)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_main)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_list)operator(,) integer(0)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_critical_get)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_critical_set)operator(,) integer(1)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_s_abort_exc)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_s_abort_exc_set)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_run)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_wakeup)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_kill)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_kill)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_kill)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_kill_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_kill_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_kill_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_value)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_status_name)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_join_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_alive_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_stop_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_raise_m)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_abort_exc)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_abort_exc_set)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_priority)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_priority_set)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_safe_level)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_group)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_aref)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_aset)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_key_p)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_keys)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cThread)operator(,) stringoperator(,) ident(rb_thread_inspect)operator(,) integer(0)operator(\);) - - ident(rb_cCont) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_undef_alloc_func)operator(()ident(rb_cCont)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cCont)operator(\),) stringoperator(\);) - ident(rb_define_method)operator(()ident(rb_cCont)operator(,) stringoperator(,) ident(rb_cont_call)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cCont)operator(,) stringoperator(,) ident(rb_cont_call)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_callcc)operator(,) integer(0)operator(\);) - ident(rb_global_variable)operator((&)ident(cont_protect)operator(\);) - - ident(cThGroup) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_define_alloc_func)operator(()ident(cThGroup)operator(,) ident(thgroup_s_alloc)operator(\);) - ident(rb_define_method)operator(()ident(cThGroup)operator(,) stringoperator(,) ident(thgroup_list)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(cThGroup)operator(,) stringoperator(,) ident(thgroup_enclose)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(cThGroup)operator(,) stringoperator(,) ident(thgroup_enclosed_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(cThGroup)operator(,) stringoperator(,) ident(thgroup_add)operator(,) integer(1)operator(\);) - ident(rb_global_variable)operator((&)ident(thgroup_default)operator(\);) - ident(thgroup_default) operator(=) ident(rb_obj_alloc)operator(()ident(cThGroup)operator(\);) - ident(rb_define_const)operator(()ident(cThGroup)operator(,) stringoperator(,) ident(thgroup_default)operator(\);) - - comment(/* allocate main thread */) - ident(main_thread) operator(=) ident(rb_thread_alloc)operator(()ident(rb_cThread)operator(\);) - ident(curr_thread) operator(=) ident(main_thread)operator(->)ident(prev) operator(=) ident(main_thread)operator(->)ident(next) operator(=) ident(main_thread)operator(;) -operator(}) - -comment(/* - * call-seq: - * catch(symbol\) {| | block } > obj - * - * +catch+ executes its block. If a +throw+ is - * executed, Ruby searches up its stack for a +catch+ block - * with a tag corresponding to the +throw+'s - * _symbol_. If found, that block is terminated, and - * +catch+ returns the value given to +throw+. If - * +throw+ is not called, the block terminates normally, and - * the value of +catch+ is the value of the last expression - * evaluated. +catch+ expressions may be nested, and the - * +throw+ call need not be in lexical scope. - * - * def routine(n\) - * puts n - * throw :done if n <= 0 - * routine(n-1\) - * end - * - * - * catch(:done\) { routine(3\) } - * - * produces: - * - * 3 - * 2 - * 1 - * 0 - */) - -directive(static) ident(VALUE) -ident(rb_f_catch)operator(()ident(dmy)operator(,) ident(tag)operator(\)) - ident(VALUE) ident(dmy)operator(,) ident(tag)operator(;) -operator({) - pre_type(int) ident(state)operator(;) - ident(VALUE) ident(val) operator(=) ident(Qnil)operator(;) comment(/* OK */) - - ident(tag) operator(=) ident(ID2SYM)operator(()ident(rb_to_id)operator(()ident(tag)operator(\)\);) - ident(PUSH_TAG)operator(()ident(tag)operator(\);) - reserved(if) operator((()ident(state) operator(=) ident(EXEC_TAG)operator((\)\)) operator(==) integer(0)operator(\)) operator({) - ident(val) operator(=) ident(rb_yield_0)operator(()ident(tag)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) ident(Qfalse)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(state) operator(==) ident(TAG_THROW) operator(&&) ident(tag) operator(==) ident(prot_tag)operator(->)ident(dst)operator(\)) operator({) - ident(val) operator(=) ident(prot_tag)operator(->)ident(retval)operator(;) - ident(state) operator(=) integer(0)operator(;) - operator(}) - ident(POP_TAG)operator((\);) - reserved(if) operator(()ident(state)operator(\)) ident(JUMP_TAG)operator(()ident(state)operator(\);) - - reserved(return) ident(val)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(catch_i)operator(()ident(tag)operator(\)) - ident(VALUE) ident(tag)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(Qnil)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(tag)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_catch)operator(()ident(tag)operator(,) ident(func)operator(,) ident(data)operator(\)) - directive(const) pre_type(char) operator(*)ident(tag)operator(;) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - ident(VALUE) ident(data)operator(;) -operator({) - reserved(return) ident(rb_iterate)operator((()ident(VALUE)operator((*\))ident(_)operator((()ident(VALUE)operator(\)\)\))ident(catch_i)operator(,) ident(ID2SYM)operator(()ident(rb_intern)operator(()ident(tag)operator(\)\),) ident(func)operator(,) ident(data)operator(\);) -operator(}) - -comment(/* - * call-seq: - * throw(symbol [, obj]\) - * - * Transfers control to the end of the active +catch+ block - * waiting for _symbol_. Raises +NameError+ if there - * is no +catch+ block for the symbol. The optional second - * parameter supplies a return value for the +catch+ block, - * which otherwise defaults to +nil+. For examples, see - * Kernel::catch. - */) - -directive(static) ident(VALUE) -ident(rb_f_throw)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(tag)operator(,) ident(value)operator(;) - reserved(struct) ident(tag) operator(*)ident(tt) operator(=) ident(prot_tag)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(tag)operator(,) operator(&)ident(value)operator(\);) - ident(tag) operator(=) ident(ID2SYM)operator(()ident(rb_to_id)operator(()ident(tag)operator(\)\);) - - reserved(while) operator(()ident(tt)operator(\)) operator({) - reserved(if) operator(()ident(tt)operator(->)ident(tag) operator(==) ident(tag)operator(\)) operator({) - ident(tt)operator(->)ident(dst) operator(=) ident(tag)operator(;) - ident(tt)operator(->)ident(retval) operator(=) ident(value)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(tt)operator(->)ident(tag) operator(==) ident(PROT_THREAD)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eThreadError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(SYM2ID)operator(()ident(tag)operator(\)\),) - ident(curr_thread)operator(\);) - operator(}) - ident(tt) operator(=) ident(tt)operator(->)ident(prev)operator(;) - operator(}) - reserved(if) operator((!)ident(tt)operator(\)) operator({) - ident(rb_name_error)operator(()ident(SYM2ID)operator(()ident(tag)operator(\),) stringoperator(,) ident(rb_id2name)operator(()ident(SYM2ID)operator(()ident(tag)operator(\)\)\);) - operator(}) - ident(rb_trap_restore_mask)operator((\);) - ident(JUMP_TAG)operator(()ident(TAG_THROW)operator(\);) -preprocessor(#ifndef) ident(__GNUC__) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -preprocessor(#endif) -operator(}) - -directive(void) -ident(rb_throw)operator(()ident(tag)operator(,) ident(val)operator(\)) - directive(const) pre_type(char) operator(*)ident(tag)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(VALUE) ident(argv)operator([)integer(2)operator(];) - - ident(argv)operator([)integer(0)operator(]) operator(=) ident(ID2SYM)operator(()ident(rb_intern)operator(()ident(tag)operator(\)\);) - ident(argv)operator([)integer(1)operator(]) operator(=) ident(val)operator(;) - ident(rb_f_throw)operator(()integer(2)operator(,) ident(argv)operator(\);) -operator(}) -comment(/********************************************************************** - - file.c - - - $Author: wyhaines $ - $Date: 2009-08-25 20:37:21 +0200 (Tue, 25 Aug 2009\) $ - created at: Mon Nov 15 12:24:34 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#ifdef) ident(_WIN32) -preprocessor(#include) include("missing/file.h") -preprocessor(#endif) -preprocessor(#ifdef) ident(__CYGWIN__) -preprocessor(#define) ident(OpenFile) ident(WINAPI_OpenFile) -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#undef) ident(OpenFile) -preprocessor(#endif) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("rubyio.h") -preprocessor(#include) include("rubysig.h") -preprocessor(#include) include("util.h") -preprocessor(#include) include("dln.h") -preprocessor(#include) include() - -preprocessor(#ifdef) ident(HAVE_UNISTD_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_SYS_FILE_H) -preprocessor(# include) include() -preprocessor(#else) -pre_type(int) ident(flock) ident(_)operator((()pre_type(int)operator(,) pre_type(int)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_SYS_PARAM_H) -preprocessor(# include) include() -preprocessor(#endif) -preprocessor(#ifndef) ident(MAXPATHLEN) -preprocessor(# define) ident(MAXPATHLEN) integer(1024) -preprocessor(#endif) - -preprocessor(#include) include() - -ident(VALUE) ident(rb_time_new) ident(_)operator((()ident(time_t)operator(,) ident(time_t)operator(\)\);) - -preprocessor(#ifdef) ident(HAVE_UTIME_H) -preprocessor(#include) include() -preprocessor(#elif) ident(defined) ident(HAVE_SYS_UTIME_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_PWD_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_STRING_H) -pre_type(char) operator(*)ident(strrchr) ident(_)operator((()directive(const) pre_type(char)operator(*,)directive(const) pre_type(char)operator(\)\);) -preprocessor(#endif) - -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#ifdef) ident(HAVE_SYS_MKDEV_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_FCNTL_H)operator(\)) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#if) operator(!)ident(defined) ident(HAVE_LSTAT) operator(&&) operator(!)ident(defined) ident(lstat) -preprocessor(#define) ident(lstat) ident(stat) -preprocessor(#endif) -preprocessor(#if) operator(!)ident(HAVE_FSEEKO) operator(&&) operator(!)ident(defined)operator(()ident(fseeko)operator(\)) -preprocessor(# define) ident(fseeko) ident(fseek) -preprocessor(#endif) - -preprocessor(#ifdef) ident(__BEOS__) comment(/* should not change ID if -1 */) -directive(static) pre_type(int) -ident(be_chown)operator(()directive(const) pre_type(char) operator(*)ident(path)operator(,) ident(uid_t) ident(owner)operator(,) ident(gid_t) ident(group)operator(\)) -operator({) - reserved(if) operator(()ident(owner) operator(==) operator(-)integer(1) operator(||) ident(group) operator(==) operator(-)integer(1)operator(\)) operator({) - reserved(struct) ident(stat) ident(st)operator(;) - reserved(if) operator(()ident(stat)operator(()ident(path)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(if) operator(()ident(owner) operator(==) operator(-)integer(1)operator(\)) ident(owner) operator(=) ident(st)operator(.)ident(st_uid)operator(;) - reserved(if) operator(()ident(group) operator(==) operator(-)integer(1)operator(\)) ident(group) operator(=) ident(st)operator(.)ident(st_gid)operator(;) - operator(}) - reserved(return) ident(chown)operator(()ident(path)operator(,) ident(owner)operator(,) ident(group)operator(\);) -operator(}) -preprocessor(#define) ident(chown) ident(be_chown) -directive(static) pre_type(int) -ident(be_fchown)operator(()pre_type(int) ident(fd)operator(,) ident(uid_t) ident(owner)operator(,) ident(gid_t) ident(group)operator(\)) -operator({) - reserved(if) operator(()ident(owner) operator(==) operator(-)integer(1) operator(||) ident(group) operator(==) operator(-)integer(1)operator(\)) operator({) - reserved(struct) ident(stat) ident(st)operator(;) - reserved(if) operator(()ident(fstat)operator(()ident(fd)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(if) operator(()ident(owner) operator(==) operator(-)integer(1)operator(\)) ident(owner) operator(=) ident(st)operator(.)ident(st_uid)operator(;) - reserved(if) operator(()ident(group) operator(==) operator(-)integer(1)operator(\)) ident(group) operator(=) ident(st)operator(.)ident(st_gid)operator(;) - operator(}) - reserved(return) ident(fchown)operator(()ident(fd)operator(,) ident(owner)operator(,) ident(group)operator(\);) -operator(}) -preprocessor(#define) ident(fchown) ident(be_fchown) -preprocessor(#endif) comment(/* __BEOS__ */) - -ident(VALUE) ident(rb_cFile)operator(;) -ident(VALUE) ident(rb_mFileTest)operator(;) -ident(VALUE) ident(rb_cStat)operator(;) - -directive(static) pre_type(long) ident(apply2files) ident(_)operator((()directive(void) operator((*\)()directive(const) pre_type(char) operator(*,) directive(void) operator(*\),) ident(VALUE)operator(,) directive(void) operator(*\)\);) -directive(static) pre_type(long) -ident(apply2files)operator(()ident(func)operator(,) ident(vargs)operator(,) ident(arg)operator(\)) - directive(void) operator((*)ident(func)operator(\))ident(_)operator((()directive(const) pre_type(char) operator(*,) directive(void) operator(*\)\);) - ident(VALUE) ident(vargs)operator(;) - directive(void) operator(*)ident(arg)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - ident(VALUE) ident(path)operator(;) - reserved(struct) ident(RArray) operator(*)ident(args) operator(=) ident(RARRAY)operator(()ident(vargs)operator(\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(args)operator(->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(path) operator(=) ident(args)operator(->)ident(ptr)operator([)ident(i)operator(];) - ident(SafeStringValue)operator(()ident(path)operator(\);) - operator((*)ident(func)operator(\)()ident(StringValueCStr)operator(()ident(path)operator(\),) ident(arg)operator(\);) - operator(}) - - reserved(return) ident(args)operator(->)ident(len)operator(;) -operator(}) - -comment(/* - * call-seq: - * file.path -> filename - * - * Returns the pathname used to create file as a string. Does - * not normalize the name. - * - * File.new("testfile"\).path #=> "testfile" - * File.new("/tmp/../tmp/xxx", "w"\).path #=> "/tmp/../tmp/xxx" - * - */) - -directive(static) ident(VALUE) -ident(rb_file_path)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(fptr) operator(=) ident(RFILE)operator(()ident(rb_io_taint_check)operator(()ident(obj)operator(\)\)->)ident(fptr)operator(;) - ident(rb_io_check_initialized)operator(()ident(fptr)operator(\);) - reserved(if) operator((!)ident(fptr)operator(->)ident(path)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(rb_tainted_str_new2)operator(()ident(fptr)operator(->)ident(path)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(stat_new_0)operator(()ident(klass)operator(,) ident(st)operator(\)) - ident(VALUE) ident(klass)operator(;) - reserved(struct) ident(stat) operator(*)ident(st)operator(;) -operator({) - reserved(struct) ident(stat) operator(*)ident(nst) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(st)operator(\)) operator({) - ident(nst) operator(=) ident(ALLOC)operator(()reserved(struct) ident(stat)operator(\);) - operator(*)ident(nst) operator(=) operator(*)ident(st)operator(;) - operator(}) - reserved(return) ident(Data_Wrap_Struct)operator(()ident(klass)operator(,) pre_constant(NULL)operator(,) ident(free)operator(,) ident(nst)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(stat_new)operator(()ident(st)operator(\)) - reserved(struct) ident(stat) operator(*)ident(st)operator(;) -operator({) - reserved(return) ident(stat_new_0)operator(()ident(rb_cStat)operator(,) ident(st)operator(\);) -operator(}) - -directive(static) reserved(struct) ident(stat)operator(*) -ident(get_stat)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(struct) ident(stat)operator(*) ident(st)operator(;) - ident(Data_Get_Struct)operator(()ident(self)operator(,) reserved(struct) ident(stat)operator(,) ident(st)operator(\);) - reserved(if) operator((!)ident(st)operator(\)) ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - reserved(return) ident(st)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat <=> other_stat => -1, 0, 1 - * - * Compares File::Stat objects by comparing their - * respective modification times. - * - * f1 = File.new("f1", "w"\) - * sleep 1 - * f2 = File.new("f2", "w"\) - * f1.stat <=> f2.stat #=> -1 - */) - -directive(static) ident(VALUE) -ident(rb_stat_cmp)operator(()ident(self)operator(,) ident(other)operator(\)) - ident(VALUE) ident(self)operator(,) ident(other)operator(;) -operator({) - reserved(if) operator(()ident(rb_obj_is_kind_of)operator(()ident(other)operator(,) ident(rb_obj_class)operator(()ident(self)operator(\)\)\)) operator({) - ident(time_t) ident(t1) operator(=) ident(get_stat)operator(()ident(self)operator(\)->)ident(st_mtime)operator(;) - ident(time_t) ident(t2) operator(=) ident(get_stat)operator(()ident(other)operator(\)->)ident(st_mtime)operator(;) - reserved(if) operator(()ident(t1) operator(==) ident(t2)operator(\)) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(else) reserved(if) operator(()ident(t1) operator(<) ident(t2)operator(\)) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - reserved(else) - reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(rb_stat_dev) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_ino) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_mode) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_nlink) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_uid) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_gid) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_rdev) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_size) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_blksize) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_blocks) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_atime) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_mtime) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_stat_ctime) ident(_)operator((()ident(VALUE)operator(\)\);) - -comment(/* - * call-seq: - * stat.dev => fixnum - * - * Returns an integer representing the device on which stat - * resides. - * - * File.stat("testfile"\).dev #=> 774 - */) - -directive(static) ident(VALUE) -ident(rb_stat_dev)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(INT2NUM)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_dev)operator(\);) -operator(}) - -comment(/* - * call-seq: - * stat.dev_major => fixnum - * - * Returns the major part of File_Stat#dev or - * nil. - * - * File.stat("/dev/fd1"\).dev_major #=> 2 - * File.stat("/dev/tty"\).dev_major #=> 5 - */) - -directive(static) ident(VALUE) -ident(rb_stat_dev_major)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(major)operator(\)) - pre_type(long) ident(dev) operator(=) ident(get_stat)operator(()ident(self)operator(\)->)ident(st_dev)operator(;) - reserved(return) ident(ULONG2NUM)operator(()ident(major)operator(()ident(dev)operator(\)\);) -preprocessor(#else) - reserved(return) ident(Qnil)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * stat.dev_minor => fixnum - * - * Returns the minor part of File_Stat#dev or - * nil. - * - * File.stat("/dev/fd1"\).dev_minor #=> 1 - * File.stat("/dev/tty"\).dev_minor #=> 0 - */) - -directive(static) ident(VALUE) -ident(rb_stat_dev_minor)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(minor)operator(\)) - pre_type(long) ident(dev) operator(=) ident(get_stat)operator(()ident(self)operator(\)->)ident(st_dev)operator(;) - reserved(return) ident(ULONG2NUM)operator(()ident(minor)operator(()ident(dev)operator(\)\);) -preprocessor(#else) - reserved(return) ident(Qnil)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * stat.ino => fixnum - * - * Returns the inode number for stat. - * - * File.stat("testfile"\).ino #=> 1083669 - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_ino)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) -preprocessor(#ifdef) ident(HUGE_ST_INO) - reserved(return) ident(ULL2NUM)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_ino)operator(\);) -preprocessor(#else) - reserved(return) ident(ULONG2NUM)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_ino)operator(\);) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * stat.mode => fixnum - * - * Returns an integer representing the permission bits of - * stat. The meaning of the bits is platform dependent; on - * Unix systems, see stat(2\). - * - * File.chmod(0644, "testfile"\) #=> 1 - * s = File.stat("testfile"\) - * sprintf("%o", s.mode\) #=> "100644" - */) - -directive(static) ident(VALUE) -ident(rb_stat_mode)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) -preprocessor(#ifdef) ident(__BORLANDC__) - reserved(return) ident(UINT2NUM)operator((()pre_type(unsigned) pre_type(short)operator(\)()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_mode)operator(\)\);) -preprocessor(#else) - reserved(return) ident(UINT2NUM)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_mode)operator(\);) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * stat.nlink => fixnum - * - * Returns the number of hard links to stat. - * - * File.stat("testfile"\).nlink #=> 1 - * File.link("testfile", "testfile.bak"\) #=> 0 - * File.stat("testfile"\).nlink #=> 2 - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_nlink)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(UINT2NUM)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_nlink)operator(\);) -operator(}) - -comment(/* - * call-seq: - * stat.uid => fixnum - * - * Returns the numeric user id of the owner of stat. - * - * File.stat("testfile"\).uid #=> 501 - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_uid)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(UINT2NUM)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_uid)operator(\);) -operator(}) - -comment(/* - * call-seq: - * stat.gid => fixnum - * - * Returns the numeric group id of the owner of stat. - * - * File.stat("testfile"\).gid #=> 500 - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_gid)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(UINT2NUM)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_gid)operator(\);) -operator(}) - -comment(/* - * call-seq: - * stat.rdev => fixnum or nil - * - * Returns an integer representing the device type on which - * stat resides. Returns nil if the operating - * system doesn't support this feature. - * - * File.stat("/dev/fd1"\).rdev #=> 513 - * File.stat("/dev/tty"\).rdev #=> 1280 - */) - -directive(static) ident(VALUE) -ident(rb_stat_rdev)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_ST_RDEV) - reserved(return) ident(ULONG2NUM)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_rdev)operator(\);) -preprocessor(#else) - reserved(return) ident(Qnil)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * stat.rdev_major => fixnum - * - * Returns the major part of File_Stat#rdev or - * nil. - * - * File.stat("/dev/fd1"\).rdev_major #=> 2 - * File.stat("/dev/tty"\).rdev_major #=> 5 - */) - -directive(static) ident(VALUE) -ident(rb_stat_rdev_major)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_ST_RDEV)operator(\)) operator(&&) ident(defined)operator(()ident(major)operator(\)) - pre_type(long) ident(rdev) operator(=) ident(get_stat)operator(()ident(self)operator(\)->)ident(st_rdev)operator(;) - reserved(return) ident(ULONG2NUM)operator(()ident(major)operator(()ident(rdev)operator(\)\);) -preprocessor(#else) - reserved(return) ident(Qnil)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * stat.rdev_minor => fixnum - * - * Returns the minor part of File_Stat#rdev or - * nil. - * - * File.stat("/dev/fd1"\).rdev_minor #=> 1 - * File.stat("/dev/tty"\).rdev_minor #=> 0 - */) - -directive(static) ident(VALUE) -ident(rb_stat_rdev_minor)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_ST_RDEV)operator(\)) operator(&&) ident(defined)operator(()ident(minor)operator(\)) - pre_type(long) ident(rdev) operator(=) ident(get_stat)operator(()ident(self)operator(\)->)ident(st_rdev)operator(;) - reserved(return) ident(ULONG2NUM)operator(()ident(minor)operator(()ident(rdev)operator(\)\);) -preprocessor(#else) - reserved(return) ident(Qnil)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * stat.size => fixnum - * - * Returns the size of stat in bytes. - * - * File.stat("testfile"\).size #=> 66 - */) - -directive(static) ident(VALUE) -ident(rb_stat_size)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(OFFT2NUM)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_size)operator(\);) -operator(}) - -comment(/* - * call-seq: - * stat.blksize => integer or nil - * - * Returns the native file system's block size. Will return nil - * on platforms that don't support this information. - * - * File.stat("testfile"\).blksize #=> 4096 - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_blksize)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_ST_BLKSIZE) - reserved(return) ident(ULONG2NUM)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_blksize)operator(\);) -preprocessor(#else) - reserved(return) ident(Qnil)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * stat.blocks => integer or nil - * - * Returns the number of native file system blocks allocated for this - * file, or nil if the operating system doesn't - * support this feature. - * - * File.stat("testfile"\).blocks #=> 2 - */) - -directive(static) ident(VALUE) -ident(rb_stat_blocks)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_ST_BLOCKS) - reserved(return) ident(ULONG2NUM)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_blocks)operator(\);) -preprocessor(#else) - reserved(return) ident(Qnil)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * stat.atime => time - * - * Returns the last access time for this file as an object of class - * Time. - * - * File.stat("testfile"\).atime #=> Wed Dec 31 18:00:00 CST 1969 - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_atime)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(rb_time_new)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_atime)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * stat.mtime -> aTime - * - * Returns the modification time of stat. - * - * File.stat("testfile"\).mtime #=> Wed Apr 09 08:53:14 CDT 2003 - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_mtime)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(rb_time_new)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_mtime)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * stat.ctime -> aTime - * - * Returns the change time for stat (that is, the time - * directory information about the file was changed, not the file - * itself\). - * - * File.stat("testfile"\).ctime #=> Wed Apr 09 08:53:14 CDT 2003 - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_ctime)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(return) ident(rb_time_new)operator(()ident(get_stat)operator(()ident(self)operator(\)->)ident(st_ctime)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * stat.inspect => string - * - * Produce a nicely formatted description of stat. - * - * File.stat("/etc/passwd"\).inspect - * #=> "#" - */) - -directive(static) ident(VALUE) -ident(rb_stat_inspect)operator(()ident(self)operator(\)) - ident(VALUE) ident(self)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - pre_type(int) ident(i)operator(;) - directive(static) directive(const) reserved(struct) operator({) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator((*)ident(func)operator(\))ident(_)operator((()ident(VALUE)operator(\)\);) - operator(}) ident(member)operator([]) operator(=) operator({) - operator({)stringoperator(,) ident(rb_stat_dev)operator(},) - operator({)stringoperator(,) ident(rb_stat_ino)operator(},) - operator({)stringoperator(,) ident(rb_stat_mode)operator(},) - operator({)stringoperator(,) ident(rb_stat_nlink)operator(},) - operator({)stringoperator(,) ident(rb_stat_uid)operator(},) - operator({)stringoperator(,) ident(rb_stat_gid)operator(},) - operator({)stringoperator(,) ident(rb_stat_rdev)operator(},) - operator({)stringoperator(,) ident(rb_stat_size)operator(},) - operator({)stringoperator(,) ident(rb_stat_blksize)operator(},) - operator({)stringoperator(,) ident(rb_stat_blocks)operator(},) - operator({)stringoperator(,) ident(rb_stat_atime)operator(},) - operator({)stringoperator(,) ident(rb_stat_mtime)operator(},) - operator({)stringoperator(,) ident(rb_stat_ctime)operator(},) - operator(};) - - ident(str) operator(=) ident(rb_str_buf_new2)operator(()stringoperator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) ident(rb_obj_classname)operator(()ident(self)operator(\)\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) reserved(sizeof)operator(()ident(member)operator(\))operator(/)reserved(sizeof)operator(()ident(member)operator([)integer(0)operator(]\);) ident(i)operator(++\)) operator({) - ident(VALUE) ident(v)operator(;) - - reserved(if) operator(()ident(i) operator(>) integer(0)operator(\)) operator({) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - operator(}) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) ident(member)operator([)ident(i)operator(])operator(.)ident(name)operator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(v) operator(=) operator((*)ident(member)operator([)ident(i)operator(])operator(.)ident(func)operator(\)()ident(self)operator(\);) - reserved(if) operator(()ident(i) operator(==) integer(2)operator(\)) operator({) comment(/* mode */) - pre_type(char) ident(buf)operator([)integer(32)operator(];) - - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) ident(NUM2ULONG)operator(()ident(v)operator(\)\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) ident(buf)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(i) operator(==) integer(0) operator(||) ident(i) operator(==) integer(6)operator(\)) operator({) comment(/* dev/rdev */) - pre_type(char) ident(buf)operator([)integer(32)operator(];) - - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) ident(NUM2ULONG)operator(()ident(v)operator(\)\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) ident(buf)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_str_append)operator(()ident(str)operator(,) ident(rb_inspect)operator(()ident(v)operator(\)\);) - operator(}) - operator(}) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) string)delimiter(")>operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(self)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(rb_stat)operator(()ident(file)operator(,) ident(st)operator(\)) - ident(VALUE) ident(file)operator(;) - reserved(struct) ident(stat) operator(*)ident(st)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(;) - - ident(tmp) operator(=) ident(rb_check_convert_type)operator(()ident(file)operator(,) ident(T_FILE)operator(,) stringoperator(,) stringoperator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(GetOpenFile)operator(()ident(tmp)operator(,) ident(fptr)operator(\);) - reserved(return) ident(fstat)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(st)operator(\);) - operator(}) - ident(SafeStringValue)operator(()ident(file)operator(\);) - reserved(return) ident(stat)operator(()ident(StringValueCStr)operator(()ident(file)operator(\),) ident(st)operator(\);) -operator(}) - -preprocessor(#ifdef) ident(_WIN32) -directive(static) ident(HANDLE) -ident(w32_io_info)operator(()ident(file)operator(,) ident(st)operator(\)) - ident(VALUE) operator(*)ident(file)operator(;) - ident(BY_HANDLE_FILE_INFORMATION) operator(*)ident(st)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(;) - ident(HANDLE) ident(f)operator(,) ident(ret) operator(=) integer(0)operator(;) - - ident(tmp) operator(=) ident(rb_check_convert_type)operator((*)ident(file)operator(,) ident(T_FILE)operator(,) stringoperator(,) stringoperator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(tmp)operator(,) ident(fptr)operator(\);) - ident(f) operator(=) operator(()ident(HANDLE)operator(\))ident(rb_w32_get_osfhandle)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\)\);) - reserved(if) operator(()ident(f) operator(==) operator(()ident(HANDLE)operator(\)-)integer(1)operator(\)) reserved(return) ident(INVALID_HANDLE_VALUE)operator(;) - operator(}) - reserved(else) operator({) - ident(SafeStringValue)operator((*)ident(file)operator(\);) - ident(f) operator(=) ident(CreateFile)operator(()ident(StringValueCStr)operator((*)ident(file)operator(\),) integer(0)operator(,) - ident(FILE_SHARE_READ) operator(|) ident(FILE_SHARE_WRITE)operator(,) pre_constant(NULL)operator(,) ident(OPEN_EXISTING)operator(,) - ident(rb_w32_iswin95)operator((\)) operator(?) integer(0) operator(:) ident(FILE_FLAG_BACKUP_SEMANTICS)operator(,) pre_constant(NULL)operator(\);) - reserved(if) operator(()ident(f) operator(==) ident(INVALID_HANDLE_VALUE)operator(\)) reserved(return) ident(f)operator(;) - ident(ret) operator(=) ident(f)operator(;) - operator(}) - reserved(if) operator(()ident(GetFileType)operator(()ident(f)operator(\)) operator(==) ident(FILE_TYPE_DISK)operator(\)) operator({) - ident(ZeroMemory)operator(()ident(st)operator(,) reserved(sizeof)operator((*)ident(st)operator(\)\);) - reserved(if) operator(()ident(GetFileInformationByHandle)operator(()ident(f)operator(,) ident(st)operator(\)\)) reserved(return) ident(ret)operator(;) - operator(}) - reserved(if) operator(()ident(ret)operator(\)) ident(CloseHandle)operator(()ident(ret)operator(\);) - reserved(return) ident(INVALID_HANDLE_VALUE)operator(;) -operator(}) -preprocessor(#endif) - -comment(/* - * call-seq: - * File.stat(file_name\) => stat - * - * Returns a File::Stat object for the named file (see - * File::Stat\). - * - * File.stat("testfile"\).mtime #=> Tue Apr 08 12:58:04 CDT 2003 - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_stat)operator(()ident(klass)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - ident(SafeStringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\)\);) - operator(}) - reserved(return) ident(stat_new)operator((&)ident(st)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.stat => stat - * - * Returns status information for ios as an object of type - * File::Stat. - * - * f = File.new("testfile"\) - * s = f.stat - * "%o" % s.mode #=> "100644" - * s.blksize #=> 4096 - * s.atime #=> Wed Apr 09 08:53:54 CDT 2003 - * - */) - -directive(static) ident(VALUE) -ident(rb_io_stat)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - reserved(struct) ident(stat) ident(st)operator(;) - - ident(GetOpenFile)operator(()ident(obj)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(fstat)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) operator(&)ident(st)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - reserved(return) ident(stat_new)operator((&)ident(st)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.lstat(file_name\) => stat - * - * Same as File::stat, but does not follow the last symbolic - * link. Instead, reports on the link itself. - * - * File.symlink("testfile", "link2test"\) #=> 0 - * File.stat("testfile"\).size #=> 66 - * File.lstat("link2test"\).size #=> 8 - * File.stat("link2test"\).size #=> 66 - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_lstat)operator(()ident(klass)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(fname)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_LSTAT) - reserved(struct) ident(stat) ident(st)operator(;) - - ident(SafeStringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(lstat)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) operator(&)ident(st)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(fname)operator(\)->)ident(ptr)operator(\);) - operator(}) - reserved(return) ident(stat_new)operator((&)ident(st)operator(\);) -preprocessor(#else) - reserved(return) ident(rb_file_s_stat)operator(()ident(klass)operator(,) ident(fname)operator(\);) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * file.lstat => stat - * - * Same as IO#stat, but does not follow the last symbolic - * link. Instead, reports on the link itself. - * - * File.symlink("testfile", "link2test"\) #=> 0 - * File.stat("testfile"\).size #=> 66 - * f = File.new("link2test"\) - * f.lstat.size #=> 8 - * f.stat.size #=> 66 - */) - -directive(static) ident(VALUE) -ident(rb_file_lstat)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_LSTAT) - ident(OpenFile) operator(*)ident(fptr)operator(;) - reserved(struct) ident(stat) ident(st)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(GetOpenFile)operator(()ident(obj)operator(,) ident(fptr)operator(\);) - reserved(if) operator((!)ident(fptr)operator(->)ident(path)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(lstat)operator(()ident(fptr)operator(->)ident(path)operator(,) operator(&)ident(st)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - reserved(return) ident(stat_new)operator((&)ident(st)operator(\);) -preprocessor(#else) - reserved(return) ident(rb_io_stat)operator(()ident(obj)operator(\);) -preprocessor(#endif) -operator(}) - -preprocessor(#ifndef) ident(HAVE_GROUP_MEMBER) -directive(static) pre_type(int) -ident(group_member)operator(()ident(gid)operator(\)) - ident(GETGROUPS_T) ident(gid)operator(;) -operator({) -preprocessor(#ifndef) ident(_WIN32) - reserved(if) operator(()ident(getgid)operator((\)) operator(==) ident(gid) operator(||) ident(getegid)operator((\)) operator(==) ident(gid)operator(\)) - reserved(return) ident(Qtrue)operator(;) - -preprocessor(# ifdef) ident(HAVE_GETGROUPS) -preprocessor(# ifndef) ident(NGROUPS) -preprocessor(# ifdef) ident(NGROUPS_MAX) -preprocessor(# define) ident(NGROUPS) ident(NGROUPS_MAX) -preprocessor(# else) -preprocessor(# define) ident(NGROUPS) integer(32) -preprocessor(# endif) -preprocessor(# endif) - operator({) - ident(GETGROUPS_T) ident(gary)operator([)ident(NGROUPS)operator(];) - pre_type(int) ident(anum)operator(;) - - ident(anum) operator(=) ident(getgroups)operator(()ident(NGROUPS)operator(,) ident(gary)operator(\);) - reserved(while) operator((--)ident(anum) operator(>=) integer(0)operator(\)) - reserved(if) operator(()ident(gary)operator([)ident(anum)operator(]) operator(==) ident(gid)operator(\)) - reserved(return) ident(Qtrue)operator(;) - operator(}) -preprocessor(# endif) -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) -preprocessor(#endif) - -preprocessor(#ifndef) ident(S_IXUGO) -preprocessor(# define) ident(S_IXUGO) operator(()ident(S_IXUSR) operator(|) ident(S_IXGRP) operator(|) ident(S_IXOTH)operator(\)) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(S_IXGRP)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(_WIN32)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CYGWIN__)operator(\)) -preprocessor(#define) ident(USE_GETEUID) integer(1) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_EACCESS) -pre_type(int) -ident(eaccess)operator(()ident(path)operator(,) ident(mode)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - pre_type(int) ident(mode)operator(;) -operator({) -preprocessor(#ifdef) ident(USE_GETEUID) - reserved(struct) ident(stat) ident(st)operator(;) - pre_type(int) ident(euid)operator(;) - - reserved(if) operator(()ident(stat)operator(()ident(path)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) operator(-)integer(1)operator(;) - - ident(euid) operator(=) ident(geteuid)operator((\);) - - reserved(if) operator(()ident(euid) operator(==) integer(0)operator(\)) operator({) - comment(/* Root can read or write any file. */) - reserved(if) operator((!()ident(mode) operator(&) ident(X_OK)operator(\)\)) - reserved(return) integer(0)operator(;) - - comment(/* Root can execute any file that has any one of the execute - bits set. */) - reserved(if) operator(()ident(st)operator(.)ident(st_mode) operator(&) ident(S_IXUGO)operator(\)) - reserved(return) integer(0)operator(;) - - reserved(return) operator(-)integer(1)operator(;) - operator(}) - - reserved(if) operator(()ident(st)operator(.)ident(st_uid) operator(==) ident(euid)operator(\)) comment(/* owner */) - ident(mode) operator(<<=) integer(6)operator(;) - reserved(else) reserved(if) operator(()ident(group_member)operator(()ident(st)operator(.)ident(st_gid)operator(\)\)) - ident(mode) operator(<<=) integer(3)operator(;) - - reserved(if) operator((()ident(st)operator(.)ident(st_mode) operator(&) ident(mode)operator(\)) operator(==) ident(mode)operator(\)) reserved(return) integer(0)operator(;) - - reserved(return) operator(-)integer(1)operator(;) -preprocessor(#else) -preprocessor(# if) ident(_MSC_VER) operator(>=) integer(1400) - ident(mode) operator(&=) integer(6)operator(;) -preprocessor(# endif) - reserved(return) ident(access)operator(()ident(path)operator(,) ident(mode)operator(\);) -preprocessor(#endif) -operator(}) -preprocessor(#endif) - - -comment(/* - * Document-class: FileTest - * - * FileTest implements file test operations similar to - * those used in File::Stat. It exists as a standalone - * module, and its methods are also insinuated into the File - * class. (Note that this is not done by inclusion: the interpreter cheats\). - * - */) - -comment(/* - * call-seq: - * File.directory?(file_name\) => true or false - * - * Returns true if the named file is a directory, - * false otherwise. - * - * File.directory?("."\) - */) - -directive(static) ident(VALUE) -ident(test_d)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) -preprocessor(#ifndef) ident(S_ISDIR) -preprocessor(# define) ident(S_ISDIR)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFDIR)operator(\)) -preprocessor(#endif) - - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(S_ISDIR)operator(()ident(st)operator(.)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.pipe?(file_name\) => true or false - * - * Returns true if the named file is a pipe. - */) - -directive(static) ident(VALUE) -ident(test_p)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) -preprocessor(#ifdef) ident(S_IFIFO) -preprocessor(# ifndef) ident(S_ISFIFO) -preprocessor(# define) ident(S_ISFIFO)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFIFO)operator(\)) -preprocessor(# endif) - - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(S_ISFIFO)operator(()ident(st)operator(.)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.symlink?(file_name\) => true or false - * - * Returns true if the named file is a symbolic link. - */) - -directive(static) ident(VALUE) -ident(test_l)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) -preprocessor(#ifndef) ident(S_ISLNK) -preprocessor(# ifdef) ident(_S_ISLNK) -preprocessor(# define) ident(S_ISLNK)operator(()ident(m)operator(\)) ident(_S_ISLNK)operator(()ident(m)operator(\)) -preprocessor(# elif) ident(defined) ident(__BORLANDC__) -preprocessor(# ifdef) ident(_S_IFLNK) -preprocessor(# define) ident(S_ISLNK)operator(()ident(m)operator(\)) operator(((()pre_type(unsigned) pre_type(short)operator(\)()ident(m)operator(\)) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(_S_IFLNK)operator(\)) -preprocessor(# else) -preprocessor(# ifdef) ident(S_IFLNK) -preprocessor(# define) ident(S_ISLNK)operator(()ident(m)operator(\)) operator(((()pre_type(unsigned) pre_type(short)operator(\)()ident(m)operator(\)) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFLNK)operator(\)) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# else) -preprocessor(# ifdef) ident(_S_IFLNK) -preprocessor(# define) ident(S_ISLNK)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(_S_IFLNK)operator(\)) -preprocessor(# else) -preprocessor(# ifdef) ident(S_IFLNK) -preprocessor(# define) ident(S_ISLNK)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFLNK)operator(\)) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#ifdef) ident(S_ISLNK) - reserved(struct) ident(stat) ident(st)operator(;) - - ident(SafeStringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(lstat)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(S_ISLNK)operator(()ident(st)operator(.)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) - - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.socket?(file_name\) => true or false - * - * Returns true if the named file is a socket. - */) - -directive(static) ident(VALUE) -ident(test_S)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) -preprocessor(#ifndef) ident(S_ISSOCK) -preprocessor(# ifdef) ident(_S_ISSOCK) -preprocessor(# define) ident(S_ISSOCK)operator(()ident(m)operator(\)) ident(_S_ISSOCK)operator(()ident(m)operator(\)) -preprocessor(# elif) ident(defined) ident(__BORLANDC__) -preprocessor(# ifdef) ident(_S_IFSOCK) -preprocessor(# define) ident(S_ISSOCK)operator(()ident(m)operator(\)) operator(((()pre_type(unsigned) pre_type(short)operator(\)()ident(m)operator(\)) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(_S_IFSOCK)operator(\)) -preprocessor(# else) -preprocessor(# ifdef) ident(S_IFSOCK) -preprocessor(# define) ident(S_ISSOCK)operator(()ident(m)operator(\)) operator(((()pre_type(unsigned) pre_type(short)operator(\)()ident(m)operator(\)) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFSOCK)operator(\)) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# else) -preprocessor(# ifdef) ident(_S_IFSOCK) -preprocessor(# define) ident(S_ISSOCK)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(_S_IFSOCK)operator(\)) -preprocessor(# else) -preprocessor(# ifdef) ident(S_IFSOCK) -preprocessor(# define) ident(S_ISSOCK)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFSOCK)operator(\)) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#ifdef) ident(S_ISSOCK) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(S_ISSOCK)operator(()ident(st)operator(.)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.blockdev?(file_name\) => true or false - * - * Returns true if the named file is a block device. - */) - -directive(static) ident(VALUE) -ident(test_b)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) -preprocessor(#ifndef) ident(S_ISBLK) -preprocessor(# ifdef) ident(S_IFBLK) -preprocessor(# define) ident(S_ISBLK)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFBLK)operator(\)) -preprocessor(# else) -preprocessor(# define) ident(S_ISBLK)operator(()ident(m)operator(\)) operator(()integer(0)operator(\)) comment(/* anytime false */) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#ifdef) ident(S_ISBLK) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(S_ISBLK)operator(()ident(st)operator(.)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.chardev?(file_name\) => true or false - * - * Returns true if the named file is a character device. - */) -directive(static) ident(VALUE) -ident(test_c)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) -preprocessor(#ifndef) ident(S_ISCHR) -preprocessor(# define) ident(S_ISCHR)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFCHR)operator(\)) -preprocessor(#endif) - - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(S_ISCHR)operator(()ident(st)operator(.)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.exist?(file_name\) => true or false - * File.exists?(file_name\) => true or false (obsolete\) - * - * Return true if the named file exists. - */) - -directive(static) ident(VALUE) -ident(test_e)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.readable?(file_name\) => true or false - * - * Returns true if the named file is readable by the effective - * user id of this process. - */) - -directive(static) ident(VALUE) -ident(test_r)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(eaccess)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) ident(R_OK)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.readable_real?(file_name\) => true or false - * - * Returns true if the named file is readable by the real - * user id of this process. - */) - -directive(static) ident(VALUE) -ident(test_R)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(access)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) ident(R_OK)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.writable?(file_name\) => true or false - * - * Returns true if the named file is writable by the effective - * user id of this process. - */) - -directive(static) ident(VALUE) -ident(test_w)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(eaccess)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) ident(W_OK)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.writable_real?(file_name\) => true or false - * - * Returns true if the named file is writable by the real - * user id of this process. - */) - -directive(static) ident(VALUE) -ident(test_W)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(access)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) ident(W_OK)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.executable?(file_name\) => true or false - * - * Returns true if the named file is executable by the effective - * user id of this process. - */) - -directive(static) ident(VALUE) -ident(test_x)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(eaccess)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) ident(X_OK)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.executable_real?(file_name\) => true or false - * - * Returns true if the named file is executable by the real - * user id of this process. - */) - -directive(static) ident(VALUE) -ident(test_X)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(access)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) ident(X_OK)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -preprocessor(#ifndef) ident(S_ISREG) -preprocessor(# define) ident(S_ISREG)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFREG)operator(\)) -preprocessor(#endif) - -comment(/* - * call-seq: - * File.file?(file_name\) => true or false - * - * Returns true if the named file exists and is a - * regular file. - */) - -directive(static) ident(VALUE) -ident(test_f)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(S_ISREG)operator(()ident(st)operator(.)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.zero?(file_name\) => true or false - * - * Returns true if the named file exists and has - * a zero size. - */) - -directive(static) ident(VALUE) -ident(test_z)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(st)operator(.)ident(st_size) operator(==) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.size?(file_name\) => Integer or nil - * - * Returns +nil+ if +file_name+ doesn't exist or has zero size, the size of the - * file otherwise. - */) - -directive(static) ident(VALUE) -ident(test_s)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(st)operator(.)ident(st_size) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(OFFT2NUM)operator(()ident(st)operator(.)ident(st_size)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.owned?(file_name\) => true or false - * - * Returns true if the named file exists and the - * effective used id of the calling process is the owner of - * the file. - */) - -directive(static) ident(VALUE) -ident(test_owned)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(st)operator(.)ident(st_uid) operator(==) ident(geteuid)operator((\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(test_rowned)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(st)operator(.)ident(st_uid) operator(==) ident(getuid)operator((\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.grpowned?(file_name\) => true or false - * - * Returns true if the named file exists and the - * effective group id of the calling process is the owner of - * the file. Returns false on Windows. - */) - -directive(static) ident(VALUE) -ident(test_grpowned)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) -preprocessor(#ifndef) ident(_WIN32) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(group_member)operator(()ident(st)operator(.)ident(st_gid)operator(\)\)) reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(S_ISUID)operator(\)) operator(||) ident(defined)operator(()ident(S_ISGID)operator(\)) operator(||) ident(defined)operator(()ident(S_ISVTX)operator(\)) -directive(static) ident(VALUE) -ident(check3rdbyte)operator(()ident(fname)operator(,) ident(mode)operator(\)) - ident(VALUE) ident(fname)operator(;) - pre_type(int) ident(mode)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - ident(SafeStringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(stat)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(st)operator(.)ident(st_mode) operator(&) ident(mode)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) -preprocessor(#endif) - -comment(/* - * call-seq: - * File.setuid?(file_name\) => true or false - * - * Returns true if the named file has the setuid bit set. - */) - -directive(static) ident(VALUE) -ident(test_suid)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) -preprocessor(#ifdef) ident(S_ISUID) - reserved(return) ident(check3rdbyte)operator(()ident(fname)operator(,) ident(S_ISUID)operator(\);) -preprocessor(#else) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * File.setgid?(file_name\) => true or false - * - * Returns true if the named file has the setgid bit set. - */) - -directive(static) ident(VALUE) -ident(test_sgid)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) -preprocessor(#ifdef) ident(S_ISGID) - reserved(return) ident(check3rdbyte)operator(()ident(fname)operator(,) ident(S_ISGID)operator(\);) -preprocessor(#else) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * File.sticky?(file_name\) => true or false - * - * Returns true if the named file has the sticky bit set. - */) - -directive(static) ident(VALUE) -ident(test_sticky)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) -preprocessor(#ifdef) ident(S_ISVTX) - reserved(return) ident(check3rdbyte)operator(()ident(fname)operator(,) ident(S_ISVTX)operator(\);) -preprocessor(#else) - reserved(return) ident(Qnil)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * File.identical?(file_1, file_2\) => true or false - * - * Returns true if the named files are identical. - * - * open("a", "w"\) {} - * p File.identical?("a", "a"\) #=> true - * p File.identical?("a", "./a"\) #=> true - * File.link("a", "b"\) - * p File.identical?("a", "b"\) #=> true - * File.symlink("a", "c"\) - * p File.identical?("a", "c"\) #=> true - * open("d", "w"\) {} - * p File.identical?("a", "d"\) #=> false - */) - -directive(static) ident(VALUE) -ident(test_identical)operator(()ident(obj)operator(,) ident(fname1)operator(,) ident(fname2)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname1)operator(,) ident(fname2)operator(;) -operator({) -preprocessor(#ifndef) ident(DOSISH) - reserved(struct) ident(stat) ident(st1)operator(,) ident(st2)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname1)operator(,) operator(&)ident(st1)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(rb_stat)operator(()ident(fname2)operator(,) operator(&)ident(st2)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(st1)operator(.)ident(st_dev) operator(!=) ident(st2)operator(.)ident(st_dev)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(st1)operator(.)ident(st_ino) operator(!=) ident(st2)operator(.)ident(st_ino)operator(\)) reserved(return) ident(Qfalse)operator(;) -preprocessor(#else) -preprocessor(#ifdef) ident(_WIN32) - ident(BY_HANDLE_FILE_INFORMATION) ident(st1)operator(,) ident(st2)operator(;) - ident(HANDLE) ident(f1) operator(=) integer(0)operator(,) ident(f2) operator(=) integer(0)operator(;) -preprocessor(#endif) - - ident(rb_secure)operator(()integer(2)operator(\);) -preprocessor(#ifdef) ident(_WIN32) - ident(f1) operator(=) ident(w32_io_info)operator((&)ident(fname1)operator(,) operator(&)ident(st1)operator(\);) - reserved(if) operator(()ident(f1) operator(==) ident(INVALID_HANDLE_VALUE)operator(\)) reserved(return) ident(Qfalse)operator(;) - ident(f2) operator(=) ident(w32_io_info)operator((&)ident(fname2)operator(,) operator(&)ident(st2)operator(\);) - reserved(if) operator(()ident(f1)operator(\)) ident(CloseHandle)operator(()ident(f1)operator(\);) - reserved(if) operator(()ident(f2) operator(==) ident(INVALID_HANDLE_VALUE)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(f2)operator(\)) ident(CloseHandle)operator(()ident(f2)operator(\);) - - reserved(if) operator(()ident(st1)operator(.)ident(dwVolumeSerialNumber) operator(==) ident(st2)operator(.)ident(dwVolumeSerialNumber) operator(&&) - ident(st1)operator(.)ident(nFileIndexHigh) operator(==) ident(st2)operator(.)ident(nFileIndexHigh) operator(&&) - ident(st1)operator(.)ident(nFileIndexLow) operator(==) ident(st2)operator(.)ident(nFileIndexLow)operator(\)) - reserved(return) ident(Qtrue)operator(;) - reserved(if) operator((!)ident(f1) operator(||) operator(!)ident(f2)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(rb_w32_iswin95)operator((\)\)) reserved(return) ident(Qfalse)operator(;) -preprocessor(#else) - ident(SafeStringValue)operator(()ident(fname1)operator(\);) - ident(fname1) operator(=) ident(rb_str_new4)operator(()ident(fname1)operator(\);) - ident(SafeStringValue)operator(()ident(fname2)operator(\);) - reserved(if) operator(()ident(access)operator(()ident(RSTRING)operator(()ident(fname1)operator(\)->)ident(ptr)operator(,) integer(0)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(access)operator(()ident(RSTRING)operator(()ident(fname2)operator(\)->)ident(ptr)operator(,) integer(0)operator(\)\)) reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) - ident(fname1) operator(=) ident(rb_file_expand_path)operator(()ident(fname1)operator(,) ident(Qnil)operator(\);) - ident(fname2) operator(=) ident(rb_file_expand_path)operator(()ident(fname2)operator(,) ident(Qnil)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(fname1)operator(\)->)ident(len) operator(!=) ident(RSTRING)operator(()ident(fname2)operator(\)->)ident(len)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(rb_memcicmp)operator(()ident(RSTRING)operator(()ident(fname1)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(fname2)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(fname1)operator(\)->)ident(len)operator(\)\)) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.size(file_name\) => integer - * - * Returns the size of file_name. - */) - -directive(static) ident(VALUE) -ident(rb_file_s_size)operator(()ident(klass)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\)\);) - reserved(return) ident(OFFT2NUM)operator(()ident(st)operator(.)ident(st_size)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_file_ftype)operator(()ident(st)operator(\)) - reserved(struct) ident(stat) operator(*)ident(st)operator(;) -operator({) - pre_type(char) operator(*)ident(t)operator(;) - - reserved(if) operator(()ident(S_ISREG)operator(()ident(st)operator(->)ident(st_mode)operator(\)\)) operator({) - ident(t) operator(=) stringoperator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(S_ISDIR)operator(()ident(st)operator(->)ident(st_mode)operator(\)\)) operator({) - ident(t) operator(=) stringoperator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(S_ISCHR)operator(()ident(st)operator(->)ident(st_mode)operator(\)\)) operator({) - ident(t) operator(=) stringoperator(;) - operator(}) -preprocessor(#ifdef) ident(S_ISBLK) - reserved(else) reserved(if) operator(()ident(S_ISBLK)operator(()ident(st)operator(->)ident(st_mode)operator(\)\)) operator({) - ident(t) operator(=) stringoperator(;) - operator(}) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_ISFIFO) - reserved(else) reserved(if) operator(()ident(S_ISFIFO)operator(()ident(st)operator(->)ident(st_mode)operator(\)\)) operator({) - ident(t) operator(=) stringoperator(;) - operator(}) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_ISLNK) - reserved(else) reserved(if) operator(()ident(S_ISLNK)operator(()ident(st)operator(->)ident(st_mode)operator(\)\)) operator({) - ident(t) operator(=) stringoperator(;) - operator(}) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_ISSOCK) - reserved(else) reserved(if) operator(()ident(S_ISSOCK)operator(()ident(st)operator(->)ident(st_mode)operator(\)\)) operator({) - ident(t) operator(=) stringoperator(;) - operator(}) -preprocessor(#endif) - reserved(else) operator({) - ident(t) operator(=) stringoperator(;) - operator(}) - - reserved(return) ident(rb_str_new2)operator(()ident(t)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.ftype(file_name\) => string - * - * Identifies the type of the named file; the return string is one of - * ``file'', ``directory'', - * ``characterSpecial'', ``blockSpecial'', - * ``fifo'', ``link'', - * ``socket'', or ``unknown''. - * - * File.ftype("testfile"\) #=> "file" - * File.ftype("/dev/tty"\) #=> "characterSpecial" - * File.ftype("/tmp/.X11-unix/X0"\) #=> "socket" - */) - -directive(static) ident(VALUE) -ident(rb_file_s_ftype)operator(()ident(klass)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - ident(SafeStringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(lstat)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) operator(&)ident(st)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(fname)operator(\)->)ident(ptr)operator(\);) - operator(}) - - reserved(return) ident(rb_file_ftype)operator((&)ident(st)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.atime(file_name\) => time - * - * Returns the last access time for the named file as a Time object\). - * - * File.atime("testfile"\) #=> Wed Apr 09 08:51:48 CDT 2003 - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_atime)operator(()ident(klass)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\)\);) - reserved(return) ident(rb_time_new)operator(()ident(st)operator(.)ident(st_atime)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * file.atime => time - * - * Returns the last access time (a Time object\) - * for file, or epoch if file has not been accessed. - * - * File.new("testfile"\).atime #=> Wed Dec 31 18:00:00 CST 1969 - * - */) - -directive(static) ident(VALUE) -ident(rb_file_atime)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - reserved(struct) ident(stat) ident(st)operator(;) - - ident(GetOpenFile)operator(()ident(obj)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(fstat)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) operator(&)ident(st)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - reserved(return) ident(rb_time_new)operator(()ident(st)operator(.)ident(st_atime)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.mtime(file_name\) => time - * - * Returns the modification time for the named file as a Time object. - * - * File.mtime("testfile"\) #=> Tue Apr 08 12:58:04 CDT 2003 - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_mtime)operator(()ident(klass)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(fname)operator(\)->)ident(ptr)operator(\);) - reserved(return) ident(rb_time_new)operator(()ident(st)operator(.)ident(st_mtime)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * file.mtime -> time - * - * Returns the modification time for file. - * - * File.new("testfile"\).mtime #=> Wed Apr 09 08:53:14 CDT 2003 - * - */) - -directive(static) ident(VALUE) -ident(rb_file_mtime)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - reserved(struct) ident(stat) ident(st)operator(;) - - ident(GetOpenFile)operator(()ident(obj)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(fstat)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) operator(&)ident(st)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - reserved(return) ident(rb_time_new)operator(()ident(st)operator(.)ident(st_mtime)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.ctime(file_name\) => time - * - * Returns the change time for the named file (the time at which - * directory information about the file was changed, not the file - * itself\). - * - * File.ctime("testfile"\) #=> Wed Apr 09 08:53:13 CDT 2003 - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_ctime)operator(()ident(klass)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - reserved(if) operator(()ident(rb_stat)operator(()ident(fname)operator(,) operator(&)ident(st)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(fname)operator(\)->)ident(ptr)operator(\);) - reserved(return) ident(rb_time_new)operator(()ident(st)operator(.)ident(st_ctime)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * file.ctime -> time - * - * Returns the change time for file (that is, the time directory - * information about the file was changed, not the file itself\). - * - * File.new("testfile"\).ctime #=> Wed Apr 09 08:53:14 CDT 2003 - * - */) - -directive(static) ident(VALUE) -ident(rb_file_ctime)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - reserved(struct) ident(stat) ident(st)operator(;) - - ident(GetOpenFile)operator(()ident(obj)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(fstat)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) operator(&)ident(st)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - reserved(return) ident(rb_time_new)operator(()ident(st)operator(.)ident(st_ctime)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) directive(void) ident(chmod_internal) ident(_)operator((()directive(const) pre_type(char) operator(*,) directive(void) operator(*\)\);) -directive(static) directive(void) -ident(chmod_internal)operator(()ident(path)operator(,) ident(mode)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - directive(void) operator(*)ident(mode)operator(;) -operator({) - reserved(if) operator(()ident(chmod)operator(()ident(path)operator(,) operator(*()pre_type(int) operator(*\))ident(mode)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(path)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.chmod(mode_int, file_name, ... \) -> integer - * - * Changes permission bits on the named file(s\) to the bit pattern - * represented by mode_int. Actual effects are operating system - * dependent (see the beginning of this section\). On Unix systems, see - * chmod(2\) for details. Returns the number of files - * processed. - * - * File.chmod(0644, "testfile", "out"\) #=> 2 - */) - -directive(static) ident(VALUE) -ident(rb_file_s_chmod)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(vmode)operator(;) - ident(VALUE) ident(rest)operator(;) - pre_type(int) ident(mode)operator(;) - pre_type(long) ident(n)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(vmode)operator(,) operator(&)ident(rest)operator(\);) - ident(mode) operator(=) ident(NUM2INT)operator(()ident(vmode)operator(\);) - - ident(n) operator(=) ident(apply2files)operator(()ident(chmod_internal)operator(,) ident(rest)operator(,) operator(&)ident(mode)operator(\);) - reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) -operator(}) - -comment(/* - * call-seq: - * file.chmod(mode_int\) => 0 - * - * Changes permission bits on file to the bit pattern - * represented by mode_int. Actual effects are platform - * dependent; on Unix systems, see chmod(2\) for details. - * Follows symbolic links. Also see File#lchmod. - * - * f = File.new("out", "w"\); - * f.chmod(0644\) #=> 0 - */) - -directive(static) ident(VALUE) -ident(rb_file_chmod)operator(()ident(obj)operator(,) ident(vmode)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(vmode)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(mode)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(mode) operator(=) ident(NUM2INT)operator(()ident(vmode)operator(\);) - - ident(GetOpenFile)operator(()ident(obj)operator(,) ident(fptr)operator(\);) -preprocessor(#ifdef) ident(HAVE_FCHMOD) - reserved(if) operator(()ident(fchmod)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(mode)operator(\)) operator(==) operator(-)integer(1)operator(\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) -preprocessor(#else) - reserved(if) operator((!)ident(fptr)operator(->)ident(path)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(chmod)operator(()ident(fptr)operator(->)ident(path)operator(,) ident(mode)operator(\)) operator(==) operator(-)integer(1)operator(\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) -preprocessor(#endif) - - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_LCHMOD)operator(\)) -directive(static) directive(void) ident(lchmod_internal) ident(_)operator((()directive(const) pre_type(char) operator(*,) directive(void) operator(*\)\);) -directive(static) directive(void) -ident(lchmod_internal)operator(()ident(path)operator(,) ident(mode)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - directive(void) operator(*)ident(mode)operator(;) -operator({) - reserved(if) operator(()ident(lchmod)operator(()ident(path)operator(,) operator(()pre_type(int)operator(\))ident(mode)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(path)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.lchmod(mode_int, file_name, ...\) => integer - * - * Equivalent to File::chmod, but does not follow symbolic - * links (so it will change the permissions associated with the link, - * not the file referenced by the link\). Often not available. - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_lchmod)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(vmode)operator(;) - ident(VALUE) ident(rest)operator(;) - pre_type(long) ident(mode)operator(,) ident(n)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(vmode)operator(,) operator(&)ident(rest)operator(\);) - ident(mode) operator(=) ident(NUM2INT)operator(()ident(vmode)operator(\);) - - ident(n) operator(=) ident(apply2files)operator(()ident(lchmod_internal)operator(,) ident(rest)operator(,) operator(()directive(void) operator(*\)()pre_type(long)operator(\))ident(mode)operator(\);) - reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) -operator(}) -preprocessor(#else) -directive(static) ident(VALUE) -ident(rb_file_s_lchmod)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) -preprocessor(#endif) - -reserved(struct) ident(chown_args) operator({) - pre_type(int) ident(owner)operator(,) ident(group)operator(;) -operator(};) - -directive(static) directive(void) ident(chown_internal) ident(_)operator((()directive(const) pre_type(char) operator(*,) directive(void) operator(*\)\);) -directive(static) directive(void) -ident(chown_internal)operator(()ident(path)operator(,) ident(argp)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - directive(void) operator(*)ident(argp)operator(;) -operator({) - reserved(struct) ident(chown_args) operator(*)ident(args) operator(=) operator(()reserved(struct) ident(chown_args) operator(*\))ident(argp)operator(;) - reserved(if) operator(()ident(chown)operator(()ident(path)operator(,) ident(args)operator(->)ident(owner)operator(,) ident(args)operator(->)ident(group)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(path)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.chown(owner_int, group_int, file_name,... \) -> integer - * - * Changes the owner and group of the named file(s\) to the given - * numeric owner and group id's. Only a process with superuser - * privileges may change the owner of a file. The current owner of a - * file may change the file's group to any group to which the owner - * belongs. A nil or -1 owner or group id is ignored. - * Returns the number of files processed. - * - * File.chown(nil, 100, "testfile"\) - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_chown)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(o)operator(,) ident(g)operator(,) ident(rest)operator(;) - reserved(struct) ident(chown_args) ident(arg)operator(;) - pre_type(long) ident(n)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(o)operator(,) operator(&)ident(g)operator(,) operator(&)ident(rest)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(o)operator(\)\)) operator({) - ident(arg)operator(.)ident(owner) operator(=) operator(-)integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(arg)operator(.)ident(owner) operator(=) ident(NUM2INT)operator(()ident(o)operator(\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(g)operator(\)\)) operator({) - ident(arg)operator(.)ident(group) operator(=) operator(-)integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(arg)operator(.)ident(group) operator(=) ident(NUM2INT)operator(()ident(g)operator(\);) - operator(}) - - ident(n) operator(=) ident(apply2files)operator(()ident(chown_internal)operator(,) ident(rest)operator(,) operator(&)ident(arg)operator(\);) - reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) -operator(}) - -comment(/* - * call-seq: - * file.chown(owner_int, group_int \) => 0 - * - * Changes the owner and group of file to the given numeric - * owner and group id's. Only a process with superuser privileges may - * change the owner of a file. The current owner of a file may change - * the file's group to any group to which the owner belongs. A - * nil or -1 owner or group id is ignored. Follows - * symbolic links. See also File#lchown. - * - * File.new("testfile"\).chown(502, 1000\) - * - */) - -directive(static) ident(VALUE) -ident(rb_file_chown)operator(()ident(obj)operator(,) ident(owner)operator(,) ident(group)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(owner)operator(,) ident(group)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(o)operator(,) ident(g)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(o) operator(=) ident(NIL_P)operator(()ident(owner)operator(\)) operator(?) operator(-)integer(1) operator(:) ident(NUM2INT)operator(()ident(owner)operator(\);) - ident(g) operator(=) ident(NIL_P)operator(()ident(group)operator(\)) operator(?) operator(-)integer(1) operator(:) ident(NUM2INT)operator(()ident(group)operator(\);) - ident(GetOpenFile)operator(()ident(obj)operator(,) ident(fptr)operator(\);) -preprocessor(#if) ident(defined)operator(()ident(DJGPP)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN32__)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) operator(||) ident(defined)operator(()ident(__EMX__)operator(\)) - reserved(if) operator((!)ident(fptr)operator(->)ident(path)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(chown)operator(()ident(fptr)operator(->)ident(path)operator(,) ident(o)operator(,) ident(g)operator(\)) operator(==) operator(-)integer(1)operator(\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) -preprocessor(#else) - reserved(if) operator(()ident(fchown)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(o)operator(,) ident(g)operator(\)) operator(==) operator(-)integer(1)operator(\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) -preprocessor(#endif) - - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_LCHOWN)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) -directive(static) directive(void) ident(lchown_internal) ident(_)operator((()directive(const) pre_type(char) operator(*,) directive(void) operator(*\)\);) -directive(static) directive(void) -ident(lchown_internal)operator(()ident(path)operator(,) ident(argp)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - directive(void) operator(*)ident(argp)operator(;) -operator({) - reserved(struct) ident(chown_args) operator(*)ident(args) operator(=) operator(()reserved(struct) ident(chown_args) operator(*\))ident(argp)operator(;) - reserved(if) operator(()ident(lchown)operator(()ident(path)operator(,) ident(args)operator(->)ident(owner)operator(,) ident(args)operator(->)ident(group)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(path)operator(\);) -operator(}) - -comment(/* - * call-seq: - * file.lchown(owner_int, group_int, file_name,..\) => integer - * - * Equivalent to File::chown, but does not follow symbolic - * links (so it will change the owner associated with the link, not the - * file referenced by the link\). Often not available. Returns number - * of files in the argument list. - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_lchown)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(o)operator(,) ident(g)operator(,) ident(rest)operator(;) - reserved(struct) ident(chown_args) ident(arg)operator(;) - pre_type(long) ident(n)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(o)operator(,) operator(&)ident(g)operator(,) operator(&)ident(rest)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(o)operator(\)\)) operator({) - ident(arg)operator(.)ident(owner) operator(=) operator(-)integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(arg)operator(.)ident(owner) operator(=) ident(NUM2INT)operator(()ident(o)operator(\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(g)operator(\)\)) operator({) - ident(arg)operator(.)ident(group) operator(=) operator(-)integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(arg)operator(.)ident(group) operator(=) ident(NUM2INT)operator(()ident(g)operator(\);) - operator(}) - - ident(n) operator(=) ident(apply2files)operator(()ident(lchown_internal)operator(,) ident(rest)operator(,) operator(&)ident(arg)operator(\);) - reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) -operator(}) -preprocessor(#else) -directive(static) ident(VALUE) -ident(rb_file_s_lchown)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(rb_notimplement)operator((\);) -operator(}) -preprocessor(#endif) - -reserved(struct) ident(timeval) ident(rb_time_timeval)operator((\);) - -directive(static) directive(void) ident(utime_internal) ident(_)operator((()directive(const) pre_type(char) operator(*,) directive(void) operator(*\)\);) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_UTIMES)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - -directive(static) directive(void) -ident(utime_internal)operator(()ident(path)operator(,) ident(arg)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - directive(void) operator(*)ident(arg)operator(;) -operator({) - reserved(struct) ident(timeval) operator(*)ident(tvp) operator(=) ident(arg)operator(;) - reserved(if) operator(()ident(utimes)operator(()ident(path)operator(,) ident(tvp)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(path)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.utime(atime, mtime, file_name,...\) => integer - * - * Sets the access and modification times of each - * named file to the first two arguments. Returns - * the number of file names in the argument list. - */) - -directive(static) ident(VALUE) -ident(rb_file_s_utime)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(atime)operator(,) ident(mtime)operator(,) ident(rest)operator(;) - reserved(struct) ident(timeval) ident(tvs)operator([)integer(2)operator(],) operator(*)ident(tvp) operator(=) pre_constant(NULL)operator(;) - pre_type(long) ident(n)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(atime)operator(,) operator(&)ident(mtime)operator(,) operator(&)ident(rest)operator(\);) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(atime)operator(\)) operator(||) operator(!)ident(NIL_P)operator(()ident(mtime)operator(\)\)) operator({) - ident(tvp) operator(=) ident(tvs)operator(;) - ident(tvp)operator([)integer(0)operator(]) operator(=) ident(rb_time_timeval)operator(()ident(atime)operator(\);) - ident(tvp)operator([)integer(1)operator(]) operator(=) ident(rb_time_timeval)operator(()ident(mtime)operator(\);) - operator(}) - - ident(n) operator(=) ident(apply2files)operator(()ident(utime_internal)operator(,) ident(rest)operator(,) ident(tvp)operator(\);) - reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) -operator(}) - -preprocessor(#else) - -preprocessor(#if) operator(!)ident(defined) ident(HAVE_UTIME_H) operator(&&) operator(!)ident(defined) ident(HAVE_SYS_UTIME_H) -reserved(struct) ident(utimbuf) operator({) - pre_type(long) ident(actime)operator(;) - pre_type(long) ident(modtime)operator(;) -operator(};) -preprocessor(#endif) - -directive(static) directive(void) -ident(utime_internal)operator(()ident(path)operator(,) ident(arg)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - directive(void) operator(*)ident(arg)operator(;) -operator({) - reserved(struct) ident(utimbuf) operator(*)ident(utp) operator(=) ident(arg)operator(;) - reserved(if) operator(()ident(utime)operator(()ident(path)operator(,) ident(utp)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(path)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_file_s_utime)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(atime)operator(,) ident(mtime)operator(,) ident(rest)operator(;) - pre_type(long) ident(n)operator(;) - reserved(struct) ident(timeval) ident(tv)operator(;) - reserved(struct) ident(utimbuf) ident(utbuf)operator(,) operator(*)ident(utp) operator(=) pre_constant(NULL)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(atime)operator(,) operator(&)ident(mtime)operator(,) operator(&)ident(rest)operator(\);) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(atime)operator(\)) operator(||) operator(!)ident(NIL_P)operator(()ident(mtime)operator(\)\)) operator({) - ident(utp) operator(=) operator(&)ident(utbuf)operator(;) - ident(tv) operator(=) ident(rb_time_timeval)operator(()ident(atime)operator(\);) - ident(utp)operator(->)ident(actime) operator(=) ident(tv)operator(.)ident(tv_sec)operator(;) - ident(tv) operator(=) ident(rb_time_timeval)operator(()ident(mtime)operator(\);) - ident(utp)operator(->)ident(modtime) operator(=) ident(tv)operator(.)ident(tv_sec)operator(;) - operator(}) - - ident(n) operator(=) ident(apply2files)operator(()ident(utime_internal)operator(,) ident(rest)operator(,) ident(utp)operator(\);) - reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) -operator(}) - -preprocessor(#endif) - -ident(NORETURN)operator(()directive(static) directive(void) ident(sys_fail2) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\)\);) -directive(static) directive(void) -ident(sys_fail2)operator(()ident(s1)operator(,) ident(s2)operator(\)) - ident(VALUE) ident(s1)operator(,) ident(s2)operator(;) -operator({) - pre_type(char) operator(*)ident(buf)operator(;) - pre_type(int) ident(len)operator(;) - - ident(len) operator(=) ident(RSTRING)operator(()ident(s1)operator(\)->)ident(len) operator(+) ident(RSTRING)operator(()ident(s2)operator(\)->)ident(len) operator(+) integer(5)operator(;) - ident(buf) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(len)operator(\);) - ident(snprintf)operator(()ident(buf)operator(,) ident(len)operator(,) stringoperator(,) ident(RSTRING)operator(()ident(s1)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(s2)operator(\)->)ident(ptr)operator(\);) - ident(rb_sys_fail)operator(()ident(buf)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.link(old_name, new_name\) => 0 - * - * Creates a new name for an existing file using a hard link. Will not - * overwrite new_name if it already exists (raising a subclass - * of SystemCallError\). Not available on all platforms. - * - * File.link("testfile", ".testfile"\) #=> 0 - * IO.readlines(".testfile"\)[0] #=> "This is line one\\n" - */) - -directive(static) ident(VALUE) -ident(rb_file_s_link)operator(()ident(klass)operator(,) ident(from)operator(,) ident(to)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(from)operator(,) ident(to)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_LINK) - ident(SafeStringValue)operator(()ident(from)operator(\);) - ident(SafeStringValue)operator(()ident(to)operator(\);) - - reserved(if) operator(()ident(link)operator(()ident(StringValueCStr)operator(()ident(from)operator(\),) ident(StringValueCStr)operator(()ident(to)operator(\)\)) operator(<) integer(0)operator(\)) operator({) - ident(sys_fail2)operator(()ident(from)operator(,) ident(to)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * File.symlink(old_name, new_name\) => 0 - * - * Creates a symbolic link called new_name for the existing file - * old_name. Raises a NotImplemented exception on - * platforms that do not support symbolic links. - * - * File.symlink("testfile", "link2test"\) #=> 0 - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_symlink)operator(()ident(klass)operator(,) ident(from)operator(,) ident(to)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(from)operator(,) ident(to)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_SYMLINK) - ident(SafeStringValue)operator(()ident(from)operator(\);) - ident(SafeStringValue)operator(()ident(to)operator(\);) - - reserved(if) operator(()ident(symlink)operator(()ident(StringValueCStr)operator(()ident(from)operator(\),) ident(StringValueCStr)operator(()ident(to)operator(\)\)) operator(<) integer(0)operator(\)) operator({) - ident(sys_fail2)operator(()ident(from)operator(,) ident(to)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * File.readlink(link_name\) -> file_name - * - * Returns the name of the file referenced by the given link. - * Not available on all platforms. - * - * File.symlink("testfile", "link2test"\) #=> 0 - * File.readlink("link2test"\) #=> "testfile" - */) - -directive(static) ident(VALUE) -ident(rb_file_s_readlink)operator(()ident(klass)operator(,) ident(path)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(path)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_READLINK) - pre_type(char) operator(*)ident(buf)operator(;) - pre_type(int) ident(size) operator(=) integer(100)operator(;) - pre_type(int) ident(rv)operator(;) - ident(VALUE) ident(v)operator(;) - - ident(SafeStringValue)operator(()ident(path)operator(\);) - ident(buf) operator(=) ident(xmalloc)operator(()ident(size)operator(\);) - reserved(while) operator((()ident(rv) operator(=) ident(readlink)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(,) ident(buf)operator(,) ident(size)operator(\)\)) operator(==) ident(size) -preprocessor(#ifdef) ident(_AIX) - operator(||) operator(()ident(rv) operator(<) integer(0) operator(&&) ident(errno) operator(==) ident(ERANGE)operator(\)) comment(/* quirky behavior of GPFS */) -preprocessor(#endif) - operator(\)) operator({) - ident(size) operator(*=) integer(2)operator(;) - ident(buf) operator(=) ident(xrealloc)operator(()ident(buf)operator(,) ident(size)operator(\);) - operator(}) - reserved(if) operator(()ident(rv) operator(<) integer(0)operator(\)) operator({) - ident(free)operator(()ident(buf)operator(\);) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\);) - operator(}) - ident(v) operator(=) ident(rb_tainted_str_new)operator(()ident(buf)operator(,) ident(rv)operator(\);) - ident(free)operator(()ident(buf)operator(\);) - - reserved(return) ident(v)operator(;) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -preprocessor(#endif) -operator(}) - -directive(static) directive(void) ident(unlink_internal) ident(_)operator((()directive(const) pre_type(char) operator(*,) directive(void) operator(*\)\);) -directive(static) directive(void) -ident(unlink_internal)operator(()ident(path)operator(,) ident(arg)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) - directive(void) operator(*)ident(arg)operator(;) -operator({) - reserved(if) operator(()ident(unlink)operator(()ident(path)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(path)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.delete(file_name, ...\) => integer - * File.unlink(file_name, ...\) => integer - * - * Deletes the named files, returning the number of names - * passed as arguments. Raises an exception on any error. - * See also Dir::rmdir. - */) - -directive(static) ident(VALUE) -ident(rb_file_s_unlink)operator(()ident(klass)operator(,) ident(args)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(args)operator(;) -operator({) - pre_type(long) ident(n)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(n) operator(=) ident(apply2files)operator(()ident(unlink_internal)operator(,) ident(args)operator(,) integer(0)operator(\);) - reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.rename(old_name, new_name\) => 0 - * - * Renames the given file to the new name. Raises a - * SystemCallError if the file cannot be renamed. - * - * File.rename("afile", "afile.bak"\) #=> 0 - */) - -directive(static) ident(VALUE) -ident(rb_file_s_rename)operator(()ident(klass)operator(,) ident(from)operator(,) ident(to)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(from)operator(,) ident(to)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(src)operator(,) operator(*)ident(dst)operator(;) - ident(SafeStringValue)operator(()ident(from)operator(\);) - ident(SafeStringValue)operator(()ident(to)operator(\);) - - ident(src) operator(=) ident(StringValueCStr)operator(()ident(from)operator(\);) - ident(dst) operator(=) ident(StringValueCStr)operator(()ident(to)operator(\);) -preprocessor(#if) ident(defined) ident(__CYGWIN__) - ident(errno) operator(=) integer(0)operator(;) -preprocessor(#endif) - reserved(if) operator(()ident(rename)operator(()ident(src)operator(,) ident(dst)operator(\)) operator(<) integer(0)operator(\)) operator({) -preprocessor(#if) ident(defined) ident(DOSISH) operator(&&) operator(!)ident(defined) ident(_WIN32) - reserved(switch) operator(()ident(errno)operator(\)) operator({) - reserved(case) ident(EEXIST)operator(:) -preprocessor(#if) ident(defined) operator(()ident(__EMX__)operator(\)) - reserved(case) ident(EACCES)operator(:) -preprocessor(#endif) - reserved(if) operator(()ident(chmod)operator(()ident(dst)operator(,) oct(0666)operator(\)) operator(==) integer(0) operator(&&) - ident(unlink)operator(()ident(dst)operator(\)) operator(==) integer(0) operator(&&) - ident(rename)operator(()ident(src)operator(,) ident(dst)operator(\)) operator(==) integer(0)operator(\)) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#endif) - ident(sys_fail2)operator(()ident(from)operator(,) ident(to)operator(\);) - operator(}) - - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.umask(\) => integer - * File.umask(integer\) => integer - * - * Returns the current umask value for this process. If the optional - * argument is given, set the umask to that value and return the - * previous value. Umask values are subtracted from the - * default permissions, so a umask of 0222 would make a - * file read-only for everyone. - * - * File.umask(0006\) #=> 18 - * File.umask #=> 6 - */) - -directive(static) ident(VALUE) -ident(rb_file_s_umask)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - pre_type(int) ident(omask) operator(=) integer(0)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(omask) operator(=) ident(umask)operator(()integer(0)operator(\);) - ident(umask)operator(()ident(omask)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - ident(omask) operator(=) ident(umask)operator(()ident(NUM2INT)operator(()ident(argv)operator([)integer(0)operator(]\)\);) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(omask)operator(\);) -operator(}) - -preprocessor(#ifdef) ident(__CYGWIN__) -preprocessor(#undef) ident(DOSISH) -preprocessor(#endif) -preprocessor(#if) ident(defined) ident(__CYGWIN__) operator(||) ident(defined) ident(DOSISH) -preprocessor(#define) ident(DOSISH_UNC) -preprocessor(#define) ident(DOSISH_DRIVE_LETTER) -preprocessor(#define) ident(isdirsep)operator(()ident(x)operator(\)) operator((()ident(x)operator(\)) operator(==) char('/') operator(||) operator(()ident(x)operator(\)) operator(==) char('\\\\')operator(\)) -preprocessor(#else) -preprocessor(#define) ident(isdirsep)operator(()ident(x)operator(\)) operator((()ident(x)operator(\)) operator(==) char('/')operator(\)) -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(_WIN32) operator(||) ident(defined) ident(__CYGWIN__) -preprocessor(#define) ident(USE_NTFS) integer(1) -preprocessor(#else) -preprocessor(#define) ident(USE_NTFS) integer(0) -preprocessor(#endif) - -preprocessor(#if) ident(USE_NTFS) -preprocessor(#define) ident(istrailinggabage)operator(()ident(x)operator(\)) operator((()ident(x)operator(\)) operator(==) char('.') operator(||) operator(()ident(x)operator(\)) operator(==) char(' ')operator(\)) -preprocessor(#else) -preprocessor(#define) ident(istrailinggabage)operator(()ident(x)operator(\)) integer(0) -preprocessor(#endif) - -preprocessor(#ifndef) ident(CharNext) comment(/* defined as CharNext[AW] on Windows. */) -preprocessor(# if) ident(defined)operator(()ident(DJGPP)operator(\)) -preprocessor(# define) ident(CharNext)operator(()ident(p)operator(\)) operator((()ident(p)operator(\)) operator(+) ident(mblen)operator(()ident(p)operator(,) ident(MB_CUR_MAX)operator(\)\)) -preprocessor(# else) -preprocessor(# define) ident(CharNext)operator(()ident(p)operator(\)) operator((()ident(p)operator(\)) operator(+) integer(1)operator(\)) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#ifdef) ident(DOSISH_DRIVE_LETTER) -directive(static) directive(inline) pre_type(int) -ident(has_drive_letter)operator(()ident(buf)operator(\)) - directive(const) pre_type(char) operator(*)ident(buf)operator(;) -operator({) - reserved(if) operator(()ident(ISALPHA)operator(()ident(buf)operator([)integer(0)operator(]\)) operator(&&) ident(buf)operator([)integer(1)operator(]) operator(==) char(':')operator(\)) operator({) - reserved(return) integer(1)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) integer(0)operator(;) - operator(}) -operator(}) - -directive(static) pre_type(char)operator(*) -ident(getcwdofdrv)operator(()ident(drv)operator(\)) - pre_type(int) ident(drv)operator(;) -operator({) - pre_type(char) ident(drive)operator([)integer(4)operator(];) - pre_type(char) operator(*)ident(drvcwd)operator(,) operator(*)ident(oldcwd)operator(;) - - ident(drive)operator([)integer(0)operator(]) operator(=) ident(drv)operator(;) - ident(drive)operator([)integer(1)operator(]) operator(=) char(':')operator(;) - ident(drive)operator([)integer(2)operator(]) operator(=) char('\\0')operator(;) - - comment(/* the only way that I know to get the current directory - of a particular drive is to change chdir(\) to that drive, - so save the old cwd before chdir(\) - */) - ident(oldcwd) operator(=) ident(my_getcwd)operator((\);) - reserved(if) operator(()ident(chdir)operator(()ident(drive)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(drvcwd) operator(=) ident(my_getcwd)operator((\);) - ident(chdir)operator(()ident(oldcwd)operator(\);) - ident(free)operator(()ident(oldcwd)operator(\);) - operator(}) - reserved(else) operator({) - comment(/* perhaps the drive is not exist. we return only drive letter */) - ident(drvcwd) operator(=) ident(strdup)operator(()ident(drive)operator(\);) - operator(}) - reserved(return) ident(drvcwd)operator(;) -operator(}) -preprocessor(#endif) - -directive(static) directive(inline) pre_type(char) operator(*) -ident(skiproot)operator(()ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) -preprocessor(#ifdef) ident(DOSISH_DRIVE_LETTER) - reserved(if) operator(()ident(has_drive_letter)operator(()ident(path)operator(\)\)) ident(path) operator(+=) integer(2)operator(;) -preprocessor(#endif) - reserved(while) operator(()ident(isdirsep)operator((*)ident(path)operator(\)\)) ident(path)operator(++;) - reserved(return) operator(()pre_type(char) operator(*\))ident(path)operator(;) -operator(}) - -preprocessor(#define) ident(nextdirsep) ident(rb_path_next) -pre_type(char) operator(*) -ident(rb_path_next)operator(()ident(s)operator(\)) - directive(const) pre_type(char) operator(*)ident(s)operator(;) -operator({) - reserved(while) operator((*)ident(s) operator(&&) operator(!)ident(isdirsep)operator((*)ident(s)operator(\)\)) operator({) - ident(s) operator(=) ident(CharNext)operator(()ident(s)operator(\);) - operator(}) - reserved(return) operator(()pre_type(char) operator(*\))ident(s)operator(;) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(DOSISH_UNC)operator(\)) operator(||) ident(defined)operator(()ident(DOSISH_DRIVE_LETTER)operator(\)) -preprocessor(#define) ident(skipprefix) ident(rb_path_skip_prefix) -preprocessor(#else) -preprocessor(#define) ident(skipprefix)operator(()ident(path)operator(\)) operator(()ident(path)operator(\)) -preprocessor(#endif) -pre_type(char) operator(*) -ident(rb_path_skip_prefix)operator(()ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(DOSISH_UNC)operator(\)) operator(||) ident(defined)operator(()ident(DOSISH_DRIVE_LETTER)operator(\)) -preprocessor(#ifdef) ident(DOSISH_UNC) - reserved(if) operator(()ident(isdirsep)operator(()ident(path)operator([)integer(0)operator(]\)) operator(&&) ident(isdirsep)operator(()ident(path)operator([)integer(1)operator(]\)\)) operator({) - ident(path) operator(+=) integer(2)operator(;) - reserved(while) operator(()ident(isdirsep)operator((*)ident(path)operator(\)\)) ident(path)operator(++;) - reserved(if) operator((*()ident(path) operator(=) ident(nextdirsep)operator(()ident(path)operator(\)\)) operator(&&) ident(path)operator([)integer(1)operator(]) operator(&&) operator(!)ident(isdirsep)operator(()ident(path)operator([)integer(1)operator(]\)\)) - ident(path) operator(=) ident(nextdirsep)operator(()ident(path) operator(+) integer(1)operator(\);) - reserved(return) operator(()pre_type(char) operator(*\))ident(path)operator(;) - operator(}) -preprocessor(#endif) -preprocessor(#ifdef) ident(DOSISH_DRIVE_LETTER) - reserved(if) operator(()ident(has_drive_letter)operator(()ident(path)operator(\)\)) - reserved(return) operator(()pre_type(char) operator(*\)()ident(path) operator(+) integer(2)operator(\);) -preprocessor(#endif) -preprocessor(#endif) - reserved(return) operator(()pre_type(char) operator(*\))ident(path)operator(;) -operator(}) - -preprocessor(#define) ident(strrdirsep) ident(rb_path_last_separator) -pre_type(char) operator(*) -ident(rb_path_last_separator)operator(()ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) - pre_type(char) operator(*)ident(last) operator(=) pre_constant(NULL)operator(;) - reserved(while) operator((*)ident(path)operator(\)) operator({) - reserved(if) operator(()ident(isdirsep)operator((*)ident(path)operator(\)\)) operator({) - directive(const) pre_type(char) operator(*)ident(tmp) operator(=) ident(path)operator(++;) - reserved(while) operator(()ident(isdirsep)operator((*)ident(path)operator(\)\)) ident(path)operator(++;) - reserved(if) operator((!*)ident(path)operator(\)) reserved(break)operator(;) - ident(last) operator(=) operator(()pre_type(char) operator(*\))ident(tmp)operator(;) - operator(}) - reserved(else) operator({) - ident(path) operator(=) ident(CharNext)operator(()ident(path)operator(\);) - operator(}) - operator(}) - reserved(return) ident(last)operator(;) -operator(}) - -directive(static) pre_type(char) operator(*) -ident(chompdirsep)operator(()ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) - reserved(while) operator((*)ident(path)operator(\)) operator({) - reserved(if) operator(()ident(isdirsep)operator((*)ident(path)operator(\)\)) operator({) - directive(const) pre_type(char) operator(*)ident(last) operator(=) ident(path)operator(++;) - reserved(while) operator(()ident(isdirsep)operator((*)ident(path)operator(\)\)) ident(path)operator(++;) - reserved(if) operator((!*)ident(path)operator(\)) reserved(return) operator(()pre_type(char) operator(*\))ident(last)operator(;) - operator(}) - reserved(else) operator({) - ident(path) operator(=) ident(CharNext)operator(()ident(path)operator(\);) - operator(}) - operator(}) - reserved(return) operator(()pre_type(char) operator(*\))ident(path)operator(;) -operator(}) - -pre_type(char) operator(*) -ident(rb_path_end)operator(()ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) - reserved(if) operator(()ident(isdirsep)operator((*)ident(path)operator(\)\)) ident(path)operator(++;) - reserved(return) ident(chompdirsep)operator(()ident(path)operator(\);) -operator(}) - -preprocessor(#if) ident(USE_NTFS) -directive(static) pre_type(char) operator(*) -ident(ntfs_tail)operator(()directive(const) pre_type(char) operator(*)ident(path)operator(\)) -operator({) - reserved(while) operator((*)ident(path) operator(==) char('.')operator(\)) ident(path)operator(++;) - reserved(while) operator((*)ident(path) operator(&&) operator(*)ident(path) operator(!=) char(':')operator(\)) operator({) - reserved(if) operator(()ident(istrailinggabage)operator((*)ident(path)operator(\)\)) operator({) - directive(const) pre_type(char) operator(*)ident(last) operator(=) ident(path)operator(++;) - reserved(while) operator(()ident(istrailinggabage)operator((*)ident(path)operator(\)\)) ident(path)operator(++;) - reserved(if) operator((!*)ident(path) operator(||) operator(*)ident(path) operator(==) char(':')operator(\)) reserved(return) operator(()pre_type(char) operator(*\))ident(last)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(isdirsep)operator((*)ident(path)operator(\)\)) operator({) - directive(const) pre_type(char) operator(*)ident(last) operator(=) ident(path)operator(++;) - reserved(while) operator(()ident(isdirsep)operator((*)ident(path)operator(\)\)) ident(path)operator(++;) - reserved(if) operator((!*)ident(path)operator(\)) reserved(return) operator(()pre_type(char) operator(*\))ident(last)operator(;) - reserved(if) operator((*)ident(path) operator(==) char(':')operator(\)) ident(path)operator(++;) - operator(}) - reserved(else) operator({) - ident(path) operator(=) ident(CharNext)operator(()ident(path)operator(\);) - operator(}) - operator(}) - reserved(return) operator(()pre_type(char) operator(*\))ident(path)operator(;) -operator(}) -preprocessor(#endif) - -preprocessor(#define) ident(BUFCHECK)operator(()ident(cond)operator(\)) reserved(do) operator({)\ - pre_type(long) ident(bdiff) operator(=) ident(p) operator(-) ident(buf)operator(;)\ - reserved(if) operator(()ident(cond)operator(\)) operator({)\ - reserved(do) operator({)ident(buflen) operator(*=) integer(2)operator(;}) reserved(while) operator(()ident(cond)operator(\);)\ - ident(rb_str_resize)operator(()ident(result)operator(,) ident(buflen)operator(\);)\ - ident(buf) operator(=) ident(RSTRING)operator(()ident(result)operator(\)->)ident(ptr)operator(;)\ - ident(p) operator(=) ident(buf) operator(+) ident(bdiff)operator(;)\ - ident(pend) operator(=) ident(buf) operator(+) ident(buflen)operator(;)\ - operator(})\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(BUFINIT)operator((\)) operator(()\ - ident(p) operator(=) ident(buf) operator(=) ident(RSTRING)operator(()ident(result)operator(\)->)ident(ptr)operator(,)\ - ident(buflen) operator(=) ident(RSTRING)operator(()ident(result)operator(\)->)ident(len)operator(,)\ - ident(pend) operator(=) ident(p) operator(+) ident(buflen)operator(\)) - -preprocessor(#if) operator(!)ident(defined)operator(()ident(TOLOWER)operator(\)) -preprocessor(#define) ident(TOLOWER)operator(()ident(c)operator(\)) operator(()ident(ISUPPER)operator(()ident(c)operator(\)) operator(?) ident(tolower)operator(()ident(c)operator(\)) operator(:) operator(()ident(c)operator(\)\)) -preprocessor(#endif) - -directive(static) pre_type(int) ident(is_absolute_path) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) - -directive(static) ident(VALUE) -ident(file_expand_path)operator(()ident(fname)operator(,) ident(dname)operator(,) ident(result)operator(\)) - ident(VALUE) ident(fname)operator(,) ident(dname)operator(,) ident(result)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(b)operator(;) - pre_type(char) operator(*)ident(buf)operator(,) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(,) operator(*)ident(root)operator(;) - pre_type(long) ident(buflen)operator(,) ident(dirlen)operator(;) - pre_type(int) ident(tainted)operator(;) - - ident(s) operator(=) ident(StringValuePtr)operator(()ident(fname)operator(\);) - ident(BUFINIT)operator((\);) - ident(tainted) operator(=) ident(OBJ_TAINTED)operator(()ident(fname)operator(\);) - - reserved(if) operator(()ident(s)operator([)integer(0)operator(]) operator(==) char('~')operator(\)) operator({) - reserved(if) operator(()ident(isdirsep)operator(()ident(s)operator([)integer(1)operator(]\)) operator(||) ident(s)operator([)integer(1)operator(]) operator(==) char('\\0')operator(\)) operator({) - pre_type(char) operator(*)ident(dir) operator(=) ident(getenv)operator(()stringoperator(\);) - - reserved(if) operator((!)ident(dir)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(s)operator(\);) - operator(}) - ident(dirlen) operator(=) ident(strlen)operator(()ident(dir)operator(\);) - ident(BUFCHECK)operator(()ident(dirlen) operator(>) ident(buflen)operator(\);) - ident(strcpy)operator(()ident(buf)operator(,) ident(dir)operator(\);) -preprocessor(#if) ident(defined) ident(DOSISH) operator(||) ident(defined) ident(__CYGWIN__) - reserved(for) operator(()ident(p) operator(=) ident(buf)operator(;) operator(*)ident(p)operator(;) ident(p) operator(=) ident(CharNext)operator(()ident(p)operator(\)\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('\\\\')operator(\)) operator({) - operator(*)ident(p) operator(=) char('/')operator(;) - operator(}) - operator(}) -preprocessor(#else) - ident(p) operator(=) ident(buf) operator(+) ident(strlen)operator(()ident(dir)operator(\);) -preprocessor(#endif) - ident(s)operator(++;) - ident(tainted) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) -preprocessor(#ifdef) ident(HAVE_PWD_H) - reserved(struct) ident(passwd) operator(*)ident(pwPtr)operator(;) - ident(s)operator(++;) -preprocessor(#endif) - ident(s) operator(=) ident(nextdirsep)operator(()ident(b) operator(=) ident(s)operator(\);) - ident(BUFCHECK)operator(()ident(bdiff) operator(+) operator(()ident(s)operator(-)ident(b)operator(\)) operator(>=) ident(buflen)operator(\);) - ident(memcpy)operator(()ident(p)operator(,) ident(b)operator(,) ident(s)operator(-)ident(b)operator(\);) - ident(p) operator(+=) ident(s)operator(-)ident(b)operator(;) - operator(*)ident(p) operator(=) char('\\0')operator(;) -preprocessor(#ifdef) ident(HAVE_PWD_H) - ident(pwPtr) operator(=) ident(getpwnam)operator(()ident(buf)operator(\);) - reserved(if) operator((!)ident(pwPtr)operator(\)) operator({) - ident(endpwent)operator((\);) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(buf)operator(\);) - operator(}) - ident(dirlen) operator(=) ident(strlen)operator(()ident(pwPtr)operator(->)ident(pw_dir)operator(\);) - ident(BUFCHECK)operator(()ident(dirlen) operator(>) ident(buflen)operator(\);) - ident(strcpy)operator(()ident(buf)operator(,) ident(pwPtr)operator(->)ident(pw_dir)operator(\);) - ident(p) operator(=) ident(buf) operator(+) ident(strlen)operator(()ident(pwPtr)operator(->)ident(pw_dir)operator(\);) - ident(endpwent)operator((\);) -preprocessor(#endif) - operator(}) - operator(}) -preprocessor(#ifdef) ident(DOSISH_DRIVE_LETTER) - comment(/* skip drive letter */) - reserved(else) reserved(if) operator(()ident(has_drive_letter)operator(()ident(s)operator(\)\)) operator({) - reserved(if) operator(()ident(isdirsep)operator(()ident(s)operator([)integer(2)operator(]\)\)) operator({) - comment(/* specified drive letter, and full path */) - comment(/* skip drive letter */) - ident(BUFCHECK)operator(()ident(bdiff) operator(+) integer(2) operator(>=) ident(buflen)operator(\);) - ident(memcpy)operator(()ident(p)operator(,) ident(s)operator(,) integer(2)operator(\);) - ident(p) operator(+=) integer(2)operator(;) - ident(s) operator(+=) integer(2)operator(;) - operator(}) - reserved(else) operator({) - comment(/* specified drive, but not full path */) - pre_type(int) ident(same) operator(=) integer(0)operator(;) - reserved(if) operator((!)ident(NIL_P)operator(()ident(dname)operator(\)\)) operator({) - ident(file_expand_path)operator(()ident(dname)operator(,) ident(Qnil)operator(,) ident(result)operator(\);) - ident(BUFINIT)operator((\);) - reserved(if) operator(()ident(has_drive_letter)operator(()ident(p)operator(\)) operator(&&) ident(TOLOWER)operator(()ident(p)operator([)integer(0)operator(]\)) operator(==) ident(TOLOWER)operator(()ident(s)operator([)integer(0)operator(]\)\)) operator({) - comment(/* ok, same drive */) - ident(same) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(if) operator((!)ident(same)operator(\)) operator({) - pre_type(char) operator(*)ident(dir) operator(=) ident(getcwdofdrv)operator((*)ident(s)operator(\);) - - ident(tainted) operator(=) integer(1)operator(;) - ident(dirlen) operator(=) ident(strlen)operator(()ident(dir)operator(\);) - ident(BUFCHECK)operator(()ident(dirlen) operator(>) ident(buflen)operator(\);) - ident(strcpy)operator(()ident(buf)operator(,) ident(dir)operator(\);) - ident(free)operator(()ident(dir)operator(\);) - operator(}) - ident(p) operator(=) ident(chompdirsep)operator(()ident(skiproot)operator(()ident(buf)operator(\)\);) - ident(s) operator(+=) integer(2)operator(;) - operator(}) - operator(}) -preprocessor(#endif) - reserved(else) reserved(if) operator((!)ident(is_absolute_path)operator(()ident(s)operator(\)\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(dname)operator(\)\)) operator({) - ident(file_expand_path)operator(()ident(dname)operator(,) ident(Qnil)operator(,) ident(result)operator(\);) - ident(BUFINIT)operator((\);) - operator(}) - reserved(else) operator({) - pre_type(char) operator(*)ident(dir) operator(=) ident(my_getcwd)operator((\);) - - ident(tainted) operator(=) integer(1)operator(;) - ident(dirlen) operator(=) ident(strlen)operator(()ident(dir)operator(\);) - ident(BUFCHECK)operator(()ident(dirlen) operator(>) ident(buflen)operator(\);) - ident(strcpy)operator(()ident(buf)operator(,) ident(dir)operator(\);) - ident(free)operator(()ident(dir)operator(\);) - operator(}) -preprocessor(#if) ident(defined) ident(DOSISH) operator(||) ident(defined) ident(__CYGWIN__) - reserved(if) operator(()ident(isdirsep)operator((*)ident(s)operator(\)\)) operator({) - comment(/* specified full path, but not drive letter nor UNC */) - comment(/* we need to get the drive letter or UNC share name */) - ident(p) operator(=) ident(skipprefix)operator(()ident(buf)operator(\);) - operator(}) - reserved(else) -preprocessor(#endif) - ident(p) operator(=) ident(chompdirsep)operator(()ident(skiproot)operator(()ident(buf)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(b) operator(=) ident(s)operator(;) - reserved(do) ident(s)operator(++;) reserved(while) operator(()ident(isdirsep)operator((*)ident(s)operator(\)\);) - ident(p) operator(=) ident(buf) operator(+) operator(()ident(s) operator(-) ident(b)operator(\);) - ident(BUFCHECK)operator(()ident(bdiff) operator(>=) ident(buflen)operator(\);) - ident(memset)operator(()ident(buf)operator(,) char('/')operator(,) ident(p) operator(-) ident(buf)operator(\);) - operator(}) - reserved(if) operator(()ident(p) operator(>) ident(buf) operator(&&) ident(p)operator([-)integer(1)operator(]) operator(==) char('/')operator(\)) - operator(--)ident(p)operator(;) - reserved(else) - operator(*)ident(p) operator(=) char('/')operator(;) - - ident(p)operator([)integer(1)operator(]) operator(=) integer(0)operator(;) - ident(root) operator(=) ident(skipprefix)operator(()ident(buf)operator(\);) - - ident(b) operator(=) ident(s)operator(;) - reserved(while) operator((*)ident(s)operator(\)) operator({) - reserved(switch) operator((*)ident(s)operator(\)) operator({) - reserved(case) char('.')operator(:) - reserved(if) operator(()ident(b) operator(==) ident(s)operator(++\)) operator({) comment(/* beginning of path element */) - reserved(switch) operator((*)ident(s)operator(\)) operator({) - reserved(case) char('\\0')operator(:) - ident(b) operator(=) ident(s)operator(;) - reserved(break)operator(;) - reserved(case) char('.')operator(:) - reserved(if) operator((*()ident(s)operator(+)integer(1)operator(\)) operator(==) char('\\0') operator(||) ident(isdirsep)operator((*()ident(s)operator(+)integer(1)operator(\)\)\)) operator({) - comment(/* We must go back to the parent */) - pre_type(char) operator(*)ident(n)operator(;) - operator(*)ident(p) operator(=) char('\\0')operator(;) - reserved(if) operator((!()ident(n) operator(=) ident(strrdirsep)operator(()ident(root)operator(\)\)\)) operator({) - operator(*)ident(p) operator(=) char('/')operator(;) - operator(}) - reserved(else) operator({) - ident(p) operator(=) ident(n)operator(;) - operator(}) - ident(b) operator(=) operator(++)ident(s)operator(;) - operator(}) -preprocessor(#if) ident(USE_NTFS) - reserved(else) operator({) - reserved(do) operator(*++)ident(s)operator(;) reserved(while) operator(()ident(istrailinggabage)operator((*)ident(s)operator(\)\);) - operator(}) -preprocessor(#endif) - reserved(break)operator(;) - reserved(case) char('/')operator(:) -preprocessor(#if) ident(defined) ident(DOSISH) operator(||) ident(defined) ident(__CYGWIN__) - reserved(case) char('\\\\')operator(:) -preprocessor(#endif) - ident(b) operator(=) operator(++)ident(s)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - comment(/* ordinary path element, beginning don't move */) - reserved(break)operator(;) - operator(}) - operator(}) -preprocessor(#if) ident(USE_NTFS) - reserved(else) operator({) - operator(--)ident(s)operator(;) - reserved(case) char(' ')operator(:) operator({) - directive(const) pre_type(char) operator(*)ident(e) operator(=) ident(s)operator(;) - reserved(while) operator(()ident(istrailinggabage)operator((*)ident(s)operator(\)\)) ident(s)operator(++;) - reserved(if) operator((!*)ident(s)operator(\)) operator({) - ident(s) operator(=) ident(e)operator(;) - reserved(goto) ident(endpath)operator(;) - operator(}) - operator(}) - operator(}) -preprocessor(#endif) - reserved(break)operator(;) - reserved(case) char('/')operator(:) -preprocessor(#if) ident(defined) ident(DOSISH) operator(||) ident(defined) ident(__CYGWIN__) - reserved(case) char('\\\\')operator(:) -preprocessor(#endif) - reserved(if) operator(()ident(s) operator(>) ident(b)operator(\)) operator({) - pre_type(long) ident(rootdiff) operator(=) ident(root) operator(-) ident(buf)operator(;) - ident(BUFCHECK)operator(()ident(bdiff) operator(+) operator(()ident(s)operator(-)ident(b)operator(+)integer(1)operator(\)) operator(>=) ident(buflen)operator(\);) - ident(root) operator(=) ident(buf) operator(+) ident(rootdiff)operator(;) - ident(memcpy)operator((++)ident(p)operator(,) ident(b)operator(,) ident(s)operator(-)ident(b)operator(\);) - ident(p) operator(+=) ident(s)operator(-)ident(b)operator(;) - operator(*)ident(p) operator(=) char('/')operator(;) - operator(}) - ident(b) operator(=) operator(++)ident(s)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(s) operator(=) ident(CharNext)operator(()ident(s)operator(\);) - reserved(break)operator(;) - operator(}) - operator(}) - - reserved(if) operator(()ident(s) operator(>) ident(b)operator(\)) operator({) -preprocessor(#if) ident(USE_NTFS) - label(endpath:) - reserved(if) operator(()ident(s) operator(>) ident(b) operator(+) integer(6) operator(&&) ident(strncasecmp)operator(()ident(s) operator(-) integer(6)operator(,) stringoperator(,) integer(6)operator(\)) operator(==) integer(0)operator(\)) operator({) - comment(/* alias of stream */) - comment(/* get rid of a bug of x64 VC++ */) - reserved(if) operator((*()ident(s)operator(-)integer(7)operator(\)) operator(==) char(':')operator(\)) ident(s) operator(-=) integer(7)operator(;) comment(/* prime */) - reserved(else) reserved(if) operator(()ident(memchr)operator(()ident(b)operator(,) char(':')operator(,) ident(s) operator(-) integer(6) operator(-) ident(b)operator(\)\)) ident(s) operator(-=) integer(6)operator(;) comment(/* alternative */) - operator(}) -preprocessor(#endif) - ident(BUFCHECK)operator(()ident(bdiff) operator(+) operator(()ident(s)operator(-)ident(b)operator(\)) operator(>=) ident(buflen)operator(\);) - ident(memcpy)operator((++)ident(p)operator(,) ident(b)operator(,) ident(s)operator(-)ident(b)operator(\);) - ident(p) operator(+=) ident(s)operator(-)ident(b)operator(;) - operator(}) - reserved(if) operator(()ident(p) operator(==) ident(skiproot)operator(()ident(buf)operator(\)) operator(-) integer(1)operator(\)) ident(p)operator(++;) - -preprocessor(#if) ident(USE_NTFS) - operator(*)ident(p) operator(=) char('\\0')operator(;) - reserved(if) operator((()ident(s) operator(=) ident(strrdirsep)operator(()ident(b) operator(=) ident(buf)operator(\)\)) operator(!=) integer(0) operator(&&) operator(!)ident(strpbrk)operator(()ident(s)operator(,) stringoperator(\)\)) operator({) - ident(size_t) ident(len)operator(;) - ident(WIN32_FIND_DATA) ident(wfd)operator(;) -preprocessor(#ifdef) ident(__CYGWIN__) - pre_type(int) ident(lnk_added) operator(=) integer(0)operator(,) ident(is_symlink) operator(=) integer(0)operator(;) - reserved(struct) ident(stat) ident(st)operator(;) - pre_type(char) ident(w32buf)operator([)ident(MAXPATHLEN)operator(];) - ident(p) operator(=) operator(()pre_type(char) operator(*\))ident(s)operator(;) - reserved(if) operator(()ident(lstat)operator(()ident(buf)operator(,) operator(&)ident(st)operator(\)) operator(==) integer(0) operator(&&) ident(S_ISLNK)operator(()ident(st)operator(.)ident(st_mode)operator(\)\)) operator({) - ident(is_symlink) operator(=) integer(1)operator(;) - operator(*)ident(p) operator(=) char('\\0')operator(;) - operator(}) - reserved(if) operator(()ident(cygwin_conv_to_win32_path)operator(((*)ident(buf) operator(?) ident(buf) operator(:) stringoperator(\),) ident(w32buf)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(b) operator(=) ident(w32buf)operator(;) - operator(}) - reserved(if) operator(()ident(is_symlink) operator(&&) ident(b) operator(==) ident(w32buf)operator(\)) operator({) - operator(*)ident(p) operator(=) char('\\\\')operator(;) - ident(strlcat)operator(()ident(w32buf)operator(,) ident(p)operator(,) reserved(sizeof)operator(()ident(w32buf)operator(\)\);) - ident(len) operator(=) ident(strlen)operator(()ident(p)operator(\);) - reserved(if) operator(()ident(len) operator(>) integer(4) operator(&&) ident(strcasecmp)operator(()ident(p) operator(+) ident(len) operator(-) integer(4)operator(,) stringoperator(\)) operator(!=) integer(0)operator(\)) operator({) - ident(lnk_added) operator(=) integer(1)operator(;) - ident(strlcat)operator(()ident(w32buf)operator(,) stringoperator(,) reserved(sizeof)operator(()ident(w32buf)operator(\)\);) - operator(}) - operator(}) - operator(*)ident(p) operator(=) char('/')operator(;) -preprocessor(#endif) - ident(HANDLE) ident(h) operator(=) ident(FindFirstFile)operator(()ident(b)operator(,) operator(&)ident(wfd)operator(\);) - reserved(if) operator(()ident(h) operator(!=) ident(INVALID_HANDLE_VALUE)operator(\)) operator({) - ident(FindClose)operator(()ident(h)operator(\);) - ident(len) operator(=) ident(strlen)operator(()ident(wfd)operator(.)ident(cFileName)operator(\);) -preprocessor(#ifdef) ident(__CYGWIN__) - reserved(if) operator(()ident(lnk_added) operator(&&) ident(len) operator(>) integer(4) operator(&&) - ident(strcasecmp)operator(()ident(wfd)operator(.)ident(cFileName) operator(+) ident(len) operator(-) integer(4)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) operator({) - ident(wfd)operator(.)ident(cFileName)operator([)ident(len) operator(-=) integer(4)operator(]) operator(=) char('\\0')operator(;) - operator(}) -preprocessor(#else) - ident(p) operator(=) operator(()pre_type(char) operator(*\))ident(s)operator(;) -preprocessor(#endif) - operator(++)ident(p)operator(;) - ident(BUFCHECK)operator(()ident(bdiff) operator(+) ident(len) operator(>=) ident(buflen)operator(\);) - ident(memcpy)operator(()ident(p)operator(,) ident(wfd)operator(.)ident(cFileName)operator(,) ident(len) operator(+) integer(1)operator(\);) - ident(p) operator(+=) ident(len)operator(;) - operator(}) -preprocessor(#ifdef) ident(__CYGWIN__) - reserved(else) operator({) - ident(p) operator(+=) ident(strlen)operator(()ident(p)operator(\);) - operator(}) -preprocessor(#endif) - operator(}) -preprocessor(#endif) - - reserved(if) operator(()ident(tainted)operator(\)) ident(OBJ_TAINT)operator(()ident(result)operator(\);) - ident(RSTRING)operator(()ident(result)operator(\)->)ident(len) operator(=) ident(p) operator(-) ident(buf)operator(;) - ident(RSTRING)operator(()ident(result)operator(\)->)ident(ptr)operator([)ident(p) operator(-) ident(buf)operator(]) operator(=) char('\\0')operator(;) - reserved(return) ident(result)operator(;) -operator(}) - -ident(VALUE) -ident(rb_file_expand_path)operator(()ident(fname)operator(,) ident(dname)operator(\)) - ident(VALUE) ident(fname)operator(,) ident(dname)operator(;) -operator({) - reserved(return) ident(file_expand_path)operator(()ident(fname)operator(,) ident(dname)operator(,) ident(rb_str_new)operator(()integer(0)operator(,) ident(MAXPATHLEN) operator(+) integer(2)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * File.expand_path(file_name [, dir_string] \) -> abs_file_name - * - * Converts a pathname to an absolute pathname. Relative paths are - * referenced from the current working directory of the process unless - * dir_string is given, in which case it will be used as the - * starting point. The given pathname may start with a - * ``~'', which expands to the process owner's home - * directory (the environment variable HOME must be set - * correctly\). ``~user'' expands to the named - * user's home directory. - * - * File.expand_path("~oracle/bin"\) #=> "/home/oracle/bin" - * File.expand_path("../../bin", "/tmp/x"\) #=> "/bin" - */) - -ident(VALUE) -ident(rb_file_s_expand_path)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(fname)operator(,) ident(dname)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - reserved(return) ident(rb_file_expand_path)operator(()ident(argv)operator([)integer(0)operator(],) ident(Qnil)operator(\);) - operator(}) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(fname)operator(,) operator(&)ident(dname)operator(\);) - - reserved(return) ident(rb_file_expand_path)operator(()ident(fname)operator(,) ident(dname)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(rmext)operator(()ident(p)operator(,) ident(l1)operator(,) ident(e)operator(\)) - directive(const) pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(e)operator(;) - pre_type(int) ident(l1)operator(;) -operator({) - pre_type(int) ident(l2)operator(;) - - reserved(if) operator((!)ident(e)operator(\)) reserved(return) integer(0)operator(;) - - ident(l2) operator(=) ident(strlen)operator(()ident(e)operator(\);) - reserved(if) operator(()ident(l2) operator(==) integer(2) operator(&&) ident(e)operator([)integer(1)operator(]) operator(==) char('*')operator(\)) operator({) - pre_type(unsigned) pre_type(char) ident(c) operator(=) operator(*)ident(e)operator(;) - ident(e) operator(=) ident(p) operator(+) ident(l1)operator(;) - reserved(do) operator({) - reserved(if) operator(()ident(e) operator(<=) ident(p)operator(\)) reserved(return) integer(0)operator(;) - operator(}) reserved(while) operator((*--)ident(e) operator(!=) ident(c)operator(\);) - reserved(return) ident(e) operator(-) ident(p)operator(;) - operator(}) - reserved(if) operator(()ident(l1) operator(<) ident(l2)operator(\)) reserved(return) ident(l1)operator(;) - -preprocessor(#if) ident(CASEFOLD_FILESYSTEM) -preprocessor(#define) ident(fncomp) ident(strncasecmp) -preprocessor(#else) -preprocessor(#define) ident(fncomp) ident(strncmp) -preprocessor(#endif) - reserved(if) operator(()ident(fncomp)operator(()ident(p)operator(+)ident(l1)operator(-)ident(l2)operator(,) ident(e)operator(,) ident(l2)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(l1)operator(-)ident(l2)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.basename(file_name [, suffix] \) -> base_name - * - * Returns the last component of the filename given in file_name, - * which must be formed using forward slashes (``/''\) - * regardless of the separator used on the local file system. If - * suffix is given and present at the end of file_name, - * it is removed. - * - * File.basename("/home/gumby/work/ruby.rb"\) #=> "ruby.rb" - * File.basename("/home/gumby/work/ruby.rb", ".rb"\) #=> "ruby" - */) - -directive(static) ident(VALUE) -ident(rb_file_s_basename)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(fname)operator(,) ident(fext)operator(,) ident(basename)operator(;) - pre_type(char) operator(*)ident(name)operator(,) operator(*)ident(p)operator(;) -preprocessor(#if) ident(defined) ident(DOSISH_DRIVE_LETTER) operator(||) ident(defined) ident(DOSISH_UNC) - pre_type(char) operator(*)ident(root)operator(;) -preprocessor(#endif) - pre_type(int) ident(f)operator(,) ident(n)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(fname)operator(,) operator(&)ident(fext)operator(\)) operator(==) integer(2)operator(\)) operator({) - ident(StringValue)operator(()ident(fext)operator(\);) - operator(}) - ident(StringValue)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(fname)operator(\)->)ident(len) operator(==) integer(0) operator(||) operator(!*()ident(name) operator(=) ident(RSTRING)operator(()ident(fname)operator(\)->)ident(ptr)operator(\)\)) - reserved(return) ident(fname)operator(;) - ident(name) operator(=) ident(skipprefix)operator(()ident(name)operator(\);) -preprocessor(#if) ident(defined) ident(DOSISH_DRIVE_LETTER) operator(||) ident(defined) ident(DOSISH_UNC) - ident(root) operator(=) ident(name)operator(;) -preprocessor(#endif) - reserved(while) operator(()ident(isdirsep)operator((*)ident(name)operator(\)\)) - ident(name)operator(++;) - reserved(if) operator((!*)ident(name)operator(\)) operator({) - ident(p) operator(=) ident(name) operator(-) integer(1)operator(;) - ident(f) operator(=) integer(1)operator(;) -preprocessor(#if) ident(defined) ident(DOSISH_DRIVE_LETTER) operator(||) ident(defined) ident(DOSISH_UNC) - reserved(if) operator(()ident(name) operator(!=) ident(root)operator(\)) operator({) - comment(/* has slashes */) - operator(}) -preprocessor(#ifdef) ident(DOSISH_DRIVE_LETTER) - reserved(else) reserved(if) operator((*)ident(p) operator(==) char(':')operator(\)) operator({) - ident(p)operator(++;) - ident(f) operator(=) integer(0)operator(;) - operator(}) -preprocessor(#endif) -preprocessor(#ifdef) ident(DOSISH_UNC) - reserved(else) operator({) - ident(p) operator(=) stringoperator(;) - operator(}) -preprocessor(#endif) -preprocessor(#endif) - operator(}) - reserved(else) operator({) - reserved(if) operator((!()ident(p) operator(=) ident(strrdirsep)operator(()ident(name)operator(\)\)\)) operator({) - ident(p) operator(=) ident(name)operator(;) - operator(}) - reserved(else) operator({) - reserved(while) operator(()ident(isdirsep)operator((*)ident(p)operator(\)\)) ident(p)operator(++;) comment(/* skip last / */) - operator(}) -preprocessor(#if) ident(USE_NTFS) - ident(n) operator(=) ident(ntfs_tail)operator(()ident(p)operator(\)) operator(-) ident(p)operator(;) -preprocessor(#else) - ident(n) operator(=) ident(chompdirsep)operator(()ident(p)operator(\)) operator(-) ident(p)operator(;) -preprocessor(#endif) - reserved(if) operator(()ident(NIL_P)operator(()ident(fext)operator(\)) operator(||) operator(!()ident(f) operator(=) ident(rmext)operator(()ident(p)operator(,) ident(n)operator(,) ident(StringValueCStr)operator(()ident(fext)operator(\)\)\)\)) operator({) - ident(f) operator(=) ident(n)operator(;) - operator(}) - reserved(if) operator(()ident(f) operator(==) ident(RSTRING_LEN)operator(()ident(fname)operator(\)\)) reserved(return) ident(fname)operator(;) - operator(}) - ident(basename) operator(=) ident(rb_str_new)operator(()ident(p)operator(,) ident(f)operator(\);) - ident(OBJ_INFECT)operator(()ident(basename)operator(,) ident(fname)operator(\);) - reserved(return) ident(basename)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.dirname(file_name \) -> dir_name - * - * Returns all components of the filename given in file_name - * except the last one. The filename must be formed using forward - * slashes (``/''\) regardless of the separator used on the - * local file system. - * - * File.dirname("/home/gumby/work/ruby.rb"\) #=> "/home/gumby/work" - */) - -directive(static) ident(VALUE) -ident(rb_file_s_dirname)operator(()ident(klass)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(fname)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(name)operator(,) operator(*)ident(root)operator(,) operator(*)ident(p)operator(;) - ident(VALUE) ident(dirname)operator(;) - - ident(name) operator(=) ident(StringValueCStr)operator(()ident(fname)operator(\);) - ident(root) operator(=) ident(skiproot)operator(()ident(name)operator(\);) -preprocessor(#ifdef) ident(DOSISH_UNC) - reserved(if) operator(()ident(root) operator(>) ident(name) operator(+) integer(1) operator(&&) ident(isdirsep)operator((*)ident(name)operator(\)\)) - ident(root) operator(=) ident(skipprefix)operator(()ident(name) operator(=) ident(root) operator(-) integer(2)operator(\);) -preprocessor(#else) - reserved(if) operator(()ident(root) operator(>) ident(name) operator(+) integer(1)operator(\)) - ident(name) operator(=) ident(root) operator(-) integer(1)operator(;) -preprocessor(#endif) - ident(p) operator(=) ident(strrdirsep)operator(()ident(root)operator(\);) - reserved(if) operator((!)ident(p)operator(\)) operator({) - ident(p) operator(=) ident(root)operator(;) - operator(}) - reserved(if) operator(()ident(p) operator(==) ident(name)operator(\)) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) -preprocessor(#ifdef) ident(DOSISH_DRIVE_LETTER) - reserved(if) operator(()ident(has_drive_letter)operator(()ident(name)operator(\)) operator(&&) ident(isdirsep)operator((*()ident(name) operator(+) integer(2)operator(\)\)\)) operator({) - directive(const) pre_type(char) operator(*)ident(top) operator(=) ident(skiproot)operator(()ident(name) operator(+) integer(2)operator(\);) - ident(dirname) operator(=) ident(rb_str_new)operator(()ident(name)operator(,) integer(3)operator(\);) - ident(rb_str_cat)operator(()ident(dirname)operator(,) ident(top)operator(,) ident(p) operator(-) ident(top)operator(\);) - operator(}) - reserved(else) -preprocessor(#endif) - ident(dirname) operator(=) ident(rb_str_new)operator(()ident(name)operator(,) ident(p) operator(-) ident(name)operator(\);) -preprocessor(#ifdef) ident(DOSISH_DRIVE_LETTER) - reserved(if) operator(()ident(has_drive_letter)operator(()ident(name)operator(\)) operator(&&) ident(root) operator(==) ident(name) operator(+) integer(2) operator(&&) ident(p) operator(-) ident(name) operator(==) integer(2)operator(\)) - ident(rb_str_cat)operator(()ident(dirname)operator(,) stringoperator(,) integer(1)operator(\);) -preprocessor(#endif) - ident(OBJ_INFECT)operator(()ident(dirname)operator(,) ident(fname)operator(\);) - reserved(return) ident(dirname)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.extname(path\) -> string - * - * Returns the extension (the portion of file name in path - * after the period\). - * - * File.extname("test.rb"\) #=> ".rb" - * File.extname("a/b/d/test.rb"\) #=> ".rb" - * File.extname("test"\) #=> "" - * File.extname(".profile"\) #=> "" - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_extname)operator(()ident(klass)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(fname)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(name)operator(,) operator(*)ident(p)operator(,) operator(*)ident(e)operator(;) - ident(VALUE) ident(extname)operator(;) - - ident(name) operator(=) ident(StringValueCStr)operator(()ident(fname)operator(\);) - ident(p) operator(=) ident(strrdirsep)operator(()ident(name)operator(\);) comment(/* get the last path component */) - reserved(if) operator((!)ident(p)operator(\)) - ident(p) operator(=) ident(name)operator(;) - reserved(else) - ident(name) operator(=) operator(++)ident(p)operator(;) - - ident(e) operator(=) integer(0)operator(;) - reserved(while) operator((*)ident(p)operator(\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('.') operator(||) ident(istrailinggabage)operator((*)ident(p)operator(\)\)) operator({) -preprocessor(#if) ident(USE_NTFS) - directive(const) pre_type(char) operator(*)ident(last) operator(=) ident(p)operator(++,) operator(*)ident(dot) operator(=) ident(last)operator(;) - reserved(while) operator(()ident(istrailinggabage)operator((*)ident(p)operator(\)\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('.')operator(\)) ident(dot) operator(=) ident(p)operator(;) - ident(p)operator(++;) - operator(}) - reserved(if) operator((!*)ident(p) operator(||) operator(*)ident(p) operator(==) char(':')operator(\)) operator({) - ident(p) operator(=) ident(last)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator((*)ident(last) operator(==) char('.') operator(||) ident(dot) operator(>) ident(last)operator(\)) ident(e) operator(=) ident(dot)operator(;) - reserved(continue)operator(;) -preprocessor(#else) - ident(e) operator(=) ident(p)operator(;) comment(/* get the last dot of the last component */) -preprocessor(#endif) - operator(}) -preprocessor(#if) ident(USE_NTFS) - reserved(else) reserved(if) operator((*)ident(p) operator(==) char(':')operator(\)) operator({) - reserved(break)operator(;) - operator(}) -preprocessor(#endif) - reserved(else) reserved(if) operator(()ident(isdirsep)operator((*)ident(p)operator(\)\)) - reserved(break)operator(;) - ident(p) operator(=) ident(CharNext)operator(()ident(p)operator(\);) - operator(}) - reserved(if) operator((!)ident(e) operator(||) ident(e) operator(==) ident(name) operator(||) ident(e)operator(+)integer(1) operator(==) ident(p)operator(\)) comment(/* no dot, or the only dot is first or end? */) - reserved(return) ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\);) - ident(extname) operator(=) ident(rb_str_new)operator(()ident(e)operator(,) ident(p) operator(-) ident(e)operator(\);) comment(/* keep the dot, too! */) - ident(OBJ_INFECT)operator(()ident(extname)operator(,) ident(fname)operator(\);) - reserved(return) ident(extname)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.split(file_name\) => array - * - * Splits the given string into a directory and a file component and - * returns them in a two-element array. See also - * File::dirname and File::basename. - * - * File.split("/home/gumby/.profile"\) #=> ["/home/gumby", ".profile"] - */) - -directive(static) ident(VALUE) -ident(rb_file_s_split)operator(()ident(klass)operator(,) ident(path)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(path)operator(;) -operator({) - ident(StringValue)operator(()ident(path)operator(\);) comment(/* get rid of converting twice */) - reserved(return) ident(rb_assoc_new)operator(()ident(rb_file_s_dirname)operator(()ident(Qnil)operator(,) ident(path)operator(\),) ident(rb_file_s_basename)operator(()integer(1)operator(,&)ident(path)operator(\)\);) -operator(}) - -directive(static) ident(VALUE) ident(separator)operator(;) - -directive(static) ident(VALUE) ident(rb_file_join) ident(_)operator((()ident(VALUE) ident(ary)operator(,) ident(VALUE) ident(sep)operator(\)\);) - -directive(static) ident(VALUE) -ident(file_inspect_join)operator(()ident(ary)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(ary)operator(;) - ident(VALUE) operator(*)ident(arg)operator(;) -operator({) - reserved(return) ident(rb_file_join)operator(()ident(arg)operator([)integer(0)operator(],) ident(arg)operator([)integer(1)operator(]\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_file_join)operator(()ident(ary)operator(,) ident(sep)operator(\)) - ident(VALUE) ident(ary)operator(,) ident(sep)operator(;) -operator({) - pre_type(long) ident(len)operator(,) ident(i)operator(;) - pre_type(int) ident(taint) operator(=) integer(0)operator(;) - ident(VALUE) ident(result)operator(,) ident(tmp)operator(;) - pre_type(char) operator(*)ident(name)operator(,) operator(*)ident(tail)operator(;) - - reserved(if) operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(ary)operator(\)\)) ident(taint) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(sep)operator(\)\)) ident(taint) operator(=) integer(1)operator(;) - - ident(len) operator(=) integer(1)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)) operator(==) ident(T_STRING)operator(\)) operator({) - ident(len) operator(+=) ident(RSTRING)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)->)ident(len)operator(;) - operator(}) - reserved(else) operator({) - ident(len) operator(+=) integer(10)operator(;) - operator(}) - operator(}) - reserved(if) operator((!)ident(NIL_P)operator(()ident(sep)operator(\)) operator(&&) ident(TYPE)operator(()ident(sep)operator(\)) operator(==) ident(T_STRING)operator(\)) operator({) - ident(len) operator(+=) ident(RSTRING)operator(()ident(sep)operator(\)->)ident(len) operator(*) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(-) integer(1)operator(;) - operator(}) - ident(result) operator(=) ident(rb_str_buf_new)operator(()ident(len)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(tmp) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - reserved(switch) operator(()ident(TYPE)operator(()ident(tmp)operator(\)\)) operator({) - reserved(case) ident(T_STRING)operator(:) - reserved(break)operator(;) - reserved(case) ident(T_ARRAY)operator(:) - reserved(if) operator(()ident(rb_inspecting_p)operator(()ident(tmp)operator(\)\)) operator({) - ident(tmp) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(args)operator([)integer(2)operator(];) - - ident(args)operator([)integer(0)operator(]) operator(=) ident(tmp)operator(;) - ident(args)operator([)integer(1)operator(]) operator(=) ident(sep)operator(;) - ident(tmp) operator(=) ident(rb_protect_inspect)operator(()ident(file_inspect_join)operator(,) ident(ary)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(\);) - operator(}) - reserved(break)operator(;) - reserved(default)operator(:) - ident(StringValueCStr)operator(()ident(tmp)operator(\);) - operator(}) - ident(name) operator(=) ident(StringValueCStr)operator(()ident(result)operator(\);) - reserved(if) operator(()ident(i) operator(>) integer(0) operator(&&) operator(!)ident(NIL_P)operator(()ident(sep)operator(\)\)) operator({) - ident(tail) operator(=) ident(chompdirsep)operator(()ident(name)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr) operator(&&) ident(isdirsep)operator(()ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator([)integer(0)operator(]\)\)) operator({) - ident(RSTRING)operator(()ident(result)operator(\)->)ident(len) operator(=) ident(tail) operator(-) ident(name)operator(;) - operator(}) - reserved(else) reserved(if) operator((!*)ident(tail)operator(\)) operator({) - ident(rb_str_buf_append)operator(()ident(result)operator(,) ident(sep)operator(\);) - operator(}) - operator(}) - ident(rb_str_buf_append)operator(()ident(result)operator(,) ident(tmp)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(tmp)operator(\)\)) ident(taint) operator(=) integer(1)operator(;) - operator(}) - - reserved(if) operator(()ident(taint)operator(\)) ident(OBJ_TAINT)operator(()ident(result)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.join(string, ...\) -> path - * - * Returns a new string formed by joining the strings using - * File::SEPARATOR. - * - * File.join("usr", "mail", "gumby"\) #=> "usr/mail/gumby" - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_join)operator(()ident(klass)operator(,) ident(args)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(args)operator(;) -operator({) - reserved(return) ident(rb_file_join)operator(()ident(args)operator(,) ident(separator)operator(\);) -operator(}) - -comment(/* - * call-seq: - * File.truncate(file_name, integer\) => 0 - * - * Truncates the file file_name to be at most integer - * bytes long. Not available on all platforms. - * - * f = File.new("out", "w"\) - * f.write("1234567890"\) #=> 10 - * f.close #=> nil - * File.truncate("out", 5\) #=> 0 - * File.size("out"\) #=> 5 - * - */) - -directive(static) ident(VALUE) -ident(rb_file_s_truncate)operator(()ident(klass)operator(,) ident(path)operator(,) ident(len)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(path)operator(,) ident(len)operator(;) -operator({) - ident(off_t) ident(pos)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(pos) operator(=) ident(NUM2OFFT)operator(()ident(len)operator(\);) - ident(SafeStringValue)operator(()ident(path)operator(\);) - -preprocessor(#ifdef) ident(HAVE_TRUNCATE) - reserved(if) operator(()ident(truncate)operator(()ident(StringValueCStr)operator(()ident(path)operator(\),) ident(pos)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\);) -preprocessor(#else) -preprocessor(# ifdef) ident(HAVE_CHSIZE) - operator({) - pre_type(int) ident(tmpfd)operator(;) - -preprocessor(# ifdef) ident(_WIN32) - reserved(if) operator((()ident(tmpfd) operator(=) ident(open)operator(()ident(StringValueCStr)operator(()ident(path)operator(\),) ident(O_RDWR)operator(\)\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\);) - operator(}) -preprocessor(# else) - reserved(if) operator((()ident(tmpfd) operator(=) ident(open)operator(()ident(StringValueCStr)operator(()ident(path)operator(\),) integer(0)operator(\)\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\);) - operator(}) -preprocessor(# endif) - reserved(if) operator(()ident(chsize)operator(()ident(tmpfd)operator(,) ident(pos)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(close)operator(()ident(tmpfd)operator(\);) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\);) - operator(}) - ident(close)operator(()ident(tmpfd)operator(\);) - operator(}) -preprocessor(# else) - ident(rb_notimplement)operator((\);) -preprocessor(# endif) -preprocessor(#endif) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * file.truncate(integer\) => 0 - * - * Truncates file to at most integer bytes. The file - * must be opened for writing. Not available on all platforms. - * - * f = File.new("out", "w"\) - * f.syswrite("1234567890"\) #=> 10 - * f.truncate(5\) #=> 0 - * f.close(\) #=> nil - * File.size("out"\) #=> 5 - */) - -directive(static) ident(VALUE) -ident(rb_file_truncate)operator(()ident(obj)operator(,) ident(len)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(len)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(FILE) operator(*)ident(f)operator(;) - ident(off_t) ident(pos)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(pos) operator(=) ident(NUM2OFFT)operator(()ident(len)operator(\);) - ident(GetOpenFile)operator(()ident(obj)operator(,) ident(fptr)operator(\);) - reserved(if) operator((!()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WRITABLE)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - operator(}) - ident(f) operator(=) ident(GetWriteFile)operator(()ident(fptr)operator(\);) - ident(fflush)operator(()ident(f)operator(\);) - ident(fseeko)operator(()ident(f)operator(,) operator(()ident(off_t)operator(\))integer(0)operator(,) ident(SEEK_CUR)operator(\);) -preprocessor(#ifdef) ident(HAVE_FTRUNCATE) - reserved(if) operator(()ident(ftruncate)operator(()ident(fileno)operator(()ident(f)operator(\),) ident(pos)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) -preprocessor(#else) -preprocessor(# ifdef) ident(HAVE_CHSIZE) - reserved(if) operator(()ident(chsize)operator(()ident(fileno)operator(()ident(f)operator(\),) ident(pos)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) -preprocessor(# else) - ident(rb_notimplement)operator((\);) -preprocessor(# endif) -preprocessor(#endif) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -preprocessor(# ifndef) ident(LOCK_SH) -preprocessor(# define) ident(LOCK_SH) integer(1) -preprocessor(# endif) -preprocessor(# ifndef) ident(LOCK_EX) -preprocessor(# define) ident(LOCK_EX) integer(2) -preprocessor(# endif) -preprocessor(# ifndef) ident(LOCK_NB) -preprocessor(# define) ident(LOCK_NB) integer(4) -preprocessor(# endif) -preprocessor(# ifndef) ident(LOCK_UN) -preprocessor(# define) ident(LOCK_UN) integer(8) -preprocessor(# endif) - -preprocessor(#ifdef) ident(__CYGWIN__) -preprocessor(#include) include() -directive(extern) pre_type(unsigned) pre_type(long) ident(__attribute__)operator((()ident(stdcall)operator(\)\)) ident(GetLastError)operator(()directive(void)operator(\);) - -directive(static) pre_type(int) -ident(cygwin_flock)operator(()pre_type(int) ident(fd)operator(,) pre_type(int) ident(op)operator(\)) -operator({) - pre_type(int) ident(old_errno) operator(=) ident(errno)operator(;) - pre_type(int) ident(ret) operator(=) ident(flock)operator(()ident(fd)operator(,) ident(op)operator(\);) - reserved(if) operator(()ident(GetLastError)operator((\)) operator(==) ident(ERROR_NOT_LOCKED)operator(\)) operator({) - ident(ret) operator(=) integer(0)operator(;) - ident(errno) operator(=) ident(old_errno)operator(;) - operator(}) - reserved(return) ident(ret)operator(;) -operator(}) -preprocessor(# define) ident(flock)operator(()ident(fd)operator(,) ident(op)operator(\)) ident(cygwin_flock)operator(()ident(fd)operator(,) ident(op)operator(\)) -preprocessor(#endif) - -directive(static) pre_type(int) -ident(rb_thread_flock)operator(()ident(fd)operator(,) ident(op)operator(,) ident(fptr)operator(\)) - pre_type(int) ident(fd)operator(,) ident(op)operator(;) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - reserved(if) operator(()ident(rb_thread_alone)operator((\)) operator(||) operator(()ident(op) operator(&) ident(LOCK_NB)operator(\)\)) operator({) - pre_type(int) ident(ret)operator(;) - ident(TRAP_BEG)operator(;) - ident(ret) operator(=) ident(flock)operator(()ident(fd)operator(,) ident(op)operator(\);) - ident(TRAP_END)operator(;) - reserved(return) ident(ret)operator(;) - operator(}) - ident(op) operator(|=) ident(LOCK_NB)operator(;) - reserved(while) operator(()ident(flock)operator(()ident(fd)operator(,) ident(op)operator(\)) operator(<) integer(0)operator(\)) operator({) - reserved(switch) operator(()ident(errno)operator(\)) operator({) - reserved(case) ident(EAGAIN)operator(:) - reserved(case) ident(EACCES)operator(:) -preprocessor(#if) ident(defined)operator(()ident(EWOULDBLOCK)operator(\)) operator(&&) ident(EWOULDBLOCK) operator(!=) ident(EAGAIN) - reserved(case) ident(EWOULDBLOCK)operator(:) -preprocessor(#endif) - ident(rb_thread_polling)operator((\);) comment(/* busy wait */) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) - reserved(continue)operator(;) - reserved(default)operator(:) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) -preprocessor(#ifdef) ident(__CYGWIN__) -preprocessor(# undef) ident(flock) -preprocessor(#endif) -preprocessor(#define) ident(flock)operator(()ident(fd)operator(,) ident(op)operator(\)) ident(rb_thread_flock)operator(()ident(fd)operator(,) ident(op)operator(,) ident(fptr)operator(\)) - -comment(/* - * call-seq: - * file.flock (locking_constant \) => 0 or false - * - * Locks or unlocks a file according to locking_constant (a - * logical or of the values in the table below\). - * Returns false if File::LOCK_NB is - * specified and the operation would otherwise have blocked. Not - * available on all platforms. - * - * Locking constants (in class File\): - * - * LOCK_EX | Exclusive lock. Only one process may hold an - * | exclusive lock for a given file at a time. - * ----------+------------------------------------------------ - * LOCK_NB | Don't block when locking. May be combined - * | with other lock options using logical or. - * ----------+------------------------------------------------ - * LOCK_SH | Shared lock. Multiple processes may each hold a - * | shared lock for a given file at the same time. - * ----------+------------------------------------------------ - * LOCK_UN | Unlock. - * - * Example: - * - * File.new("testfile"\).flock(File::LOCK_UN\) #=> 0 - * - */) - -directive(static) ident(VALUE) -ident(rb_file_flock)operator(()ident(obj)operator(,) ident(operation)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(VALUE) ident(operation)operator(;) -operator({) -preprocessor(#ifndef) ident(__CHECKER__) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(op)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(op) operator(=) ident(NUM2INT)operator(()ident(operation)operator(\);) - ident(GetOpenFile)operator(()ident(obj)operator(,) ident(fptr)operator(\);) - - reserved(if) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WRITABLE)operator(\)) operator({) - ident(fflush)operator(()ident(GetWriteFile)operator(()ident(fptr)operator(\)\);) - operator(}) - label(retry:) - reserved(if) operator(()ident(flock)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(op)operator(\)) operator(<) integer(0)operator(\)) operator({) - reserved(switch) operator(()ident(errno)operator(\)) operator({) - reserved(case) ident(EAGAIN)operator(:) - reserved(case) ident(EACCES)operator(:) -preprocessor(#if) ident(defined)operator(()ident(EWOULDBLOCK)operator(\)) operator(&&) ident(EWOULDBLOCK) operator(!=) ident(EAGAIN) - reserved(case) ident(EWOULDBLOCK)operator(:) -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) - reserved(case) ident(EINTR)operator(:) -preprocessor(#if) ident(defined)operator(()ident(ERESTART)operator(\)) - reserved(case) ident(ERESTART)operator(:) -preprocessor(#endif) - reserved(goto) ident(retry)operator(;) - operator(}) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) -preprocessor(#endif) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) -preprocessor(#undef) ident(flock) - -directive(static) directive(void) -ident(test_check)operator(()ident(n)operator(,) ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(n)operator(,) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - ident(n)operator(+=)integer(1)operator(;) - reserved(if) operator(()ident(n) operator(!=) ident(argc)operator(\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(,) ident(n)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(1)operator(;) ident(i)operator(<)ident(n)operator(;) ident(i)operator(++\)) operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(argv)operator([)ident(i)operator(]\)\)) operator({) - reserved(case) ident(T_STRING)operator(:) - reserved(default)operator(:) - ident(SafeStringValue)operator(()ident(argv)operator([)ident(i)operator(]\);) - reserved(break)operator(;) - reserved(case) ident(T_FILE)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) -operator(}) - -preprocessor(#define) ident(CHECK)operator(()ident(n)operator(\)) ident(test_check)operator((()ident(n)operator(\),) ident(argc)operator(,) ident(argv)operator(\)) - -comment(/* - * call-seq: - * test(int_cmd, file1 [, file2] \) => obj - * - * Uses the integer aCmd to perform various tests on - * file1 (first table below\) or on file1 and - * file2 (second table\). - * - * File tests on a single file: - * - * Test Returns Meaning - * ?A | Time | Last access time for file1 - * ?b | boolean | True if file1 is a block device - * ?c | boolean | True if file1 is a character device - * ?C | Time | Last change time for file1 - * ?d | boolean | True if file1 exists and is a directory - * ?e | boolean | True if file1 exists - * ?f | boolean | True if file1 exists and is a regular file - * ?g | boolean | True if file1 has the \\CF{setgid} bit - * | | set (false under NT\) - * ?G | boolean | True if file1 exists and has a group - * | | ownership equal to the caller's group - * ?k | boolean | True if file1 exists and has the sticky bit set - * ?l | boolean | True if file1 exists and is a symbolic link - * ?M | Time | Last modification time for file1 - * ?o | boolean | True if file1 exists and is owned by - * | | the caller's effective uid - * ?O | boolean | True if file1 exists and is owned by - * | | the caller's real uid - * ?p | boolean | True if file1 exists and is a fifo - * ?r | boolean | True if file1 is readable by the effective - * | | uid/gid of the caller - * ?R | boolean | True if file is readable by the real - * | | uid/gid of the caller - * ?s | int/nil | If file1 has nonzero size, return the size, - * | | otherwise return nil - * ?S | boolean | True if file1 exists and is a socket - * ?u | boolean | True if file1 has the setuid bit set - * ?w | boolean | True if file1 exists and is writable by - * | | the effective uid/gid - * ?W | boolean | True if file1 exists and is writable by - * | | the real uid/gid - * ?x | boolean | True if file1 exists and is executable by - * | | the effective uid/gid - * ?X | boolean | True if file1 exists and is executable by - * | | the real uid/gid - * ?z | boolean | True if file1 exists and has a zero length - * - * Tests that take two files: - * - * ?- | boolean | True if file1 and file2 are identical - * ?= | boolean | True if the modification times of file1 - * | | and file2 are equal - * ?< | boolean | True if the modification time of file1 - * | | is prior to that of file2 - * ?> | boolean | True if the modification time of file1 - * | | is after that of file2 - */) - -directive(static) ident(VALUE) -ident(rb_f_test)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - pre_type(int) ident(cmd)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) -comment(#if 0 /* 1.7 behavior? */ - if (argc == 1\) { - return RTEST(argv[0]\) ? Qtrue : Qfalse; - } -#endif) - ident(cmd) operator(=) ident(NUM2CHR)operator(()ident(argv)operator([)integer(0)operator(]\);) - reserved(if) operator(()ident(cmd) operator(==) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(strchr)operator(()stringoperator(,) ident(cmd)operator(\)\)) operator({) - ident(CHECK)operator(()integer(1)operator(\);) - reserved(switch) operator(()ident(cmd)operator(\)) operator({) - reserved(case) char('b')operator(:) - reserved(return) ident(test_b)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('c')operator(:) - reserved(return) ident(test_c)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('d')operator(:) - reserved(return) ident(test_d)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('a')operator(:) - reserved(case) char('e')operator(:) - reserved(return) ident(test_e)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('f')operator(:) - reserved(return) ident(test_f)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('g')operator(:) - reserved(return) ident(test_sgid)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('G')operator(:) - reserved(return) ident(test_grpowned)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('k')operator(:) - reserved(return) ident(test_sticky)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('l')operator(:) - reserved(return) ident(test_l)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('o')operator(:) - reserved(return) ident(test_owned)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('O')operator(:) - reserved(return) ident(test_rowned)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('p')operator(:) - reserved(return) ident(test_p)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('r')operator(:) - reserved(return) ident(test_r)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('R')operator(:) - reserved(return) ident(test_R)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('s')operator(:) - reserved(return) ident(test_s)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('S')operator(:) - reserved(return) ident(test_S)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('u')operator(:) - reserved(return) ident(test_suid)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('w')operator(:) - reserved(return) ident(test_w)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('W')operator(:) - reserved(return) ident(test_W)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('x')operator(:) - reserved(return) ident(test_x)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('X')operator(:) - reserved(return) ident(test_X)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - - reserved(case) char('z')operator(:) - reserved(return) ident(test_z)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(]\);) - operator(}) - operator(}) - - reserved(if) operator(()ident(strchr)operator(()stringoperator(,) ident(cmd)operator(\)\)) operator({) - reserved(struct) ident(stat) ident(st)operator(;) - - ident(CHECK)operator(()integer(1)operator(\);) - reserved(if) operator(()ident(rb_stat)operator(()ident(argv)operator([)integer(1)operator(],) operator(&)ident(st)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(argv)operator([)integer(1)operator(]\)->)ident(ptr)operator(\);) - operator(}) - - reserved(switch) operator(()ident(cmd)operator(\)) operator({) - reserved(case) char('A')operator(:) - reserved(return) ident(rb_time_new)operator(()ident(st)operator(.)ident(st_atime)operator(,) integer(0)operator(\);) - reserved(case) char('M')operator(:) - reserved(return) ident(rb_time_new)operator(()ident(st)operator(.)ident(st_mtime)operator(,) integer(0)operator(\);) - reserved(case) char('C')operator(:) - reserved(return) ident(rb_time_new)operator(()ident(st)operator(.)ident(st_ctime)operator(,) integer(0)operator(\);) - operator(}) - operator(}) - - reserved(if) operator(()ident(cmd) operator(==) char('-')operator(\)) operator({) - ident(CHECK)operator(()integer(2)operator(\);) - reserved(return) ident(test_identical)operator(()integer(0)operator(,) ident(argv)operator([)integer(1)operator(],) ident(argv)operator([)integer(2)operator(]\);) - operator(}) - - reserved(if) operator(()ident(strchr)operator(()string)delimiter(")>operator(,) ident(cmd)operator(\)\)) operator({) - reserved(struct) ident(stat) ident(st1)operator(,) ident(st2)operator(;) - - ident(CHECK)operator(()integer(2)operator(\);) - reserved(if) operator(()ident(rb_stat)operator(()ident(argv)operator([)integer(1)operator(],) operator(&)ident(st1)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(rb_stat)operator(()ident(argv)operator([)integer(2)operator(],) operator(&)ident(st2)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - - reserved(switch) operator(()ident(cmd)operator(\)) operator({) - reserved(case) char('=')operator(:) - reserved(if) operator(()ident(st1)operator(.)ident(st_mtime) operator(==) ident(st2)operator(.)ident(st_mtime)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) - - reserved(case) char('>')operator(:) - reserved(if) operator(()ident(st1)operator(.)ident(st_mtime) operator(>) ident(st2)operator(.)ident(st_mtime)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) - - reserved(case) char('<')operator(:) - reserved(if) operator(()ident(st1)operator(.)ident(st_mtime) operator(<) ident(st2)operator(.)ident(st_mtime)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) - operator(}) - operator(}) - comment(/* unknown command */) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(cmd)operator(\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - - -comment(/* - * Document-class: File::Stat - * - * Objects of class File::Stat encapsulate common status - * information for File objects. The information is - * recorded at the moment the File::Stat object is - * created; changes made to the file after that point will not be - * reflected. File::Stat objects are returned by - * IO#stat, File::stat, - * File#lstat, and File::lstat. Many of these - * methods return platform-specific values, and not all values are - * meaningful on all systems. See also Kernel#test. - */) - -directive(static) ident(VALUE) ident(rb_stat_s_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(rb_stat_s_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(return) ident(stat_new_0)operator(()ident(klass)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * - * File::Stat.new(file_name\) => stat - * - * Create a File::Stat object for the given file name (raising an - * exception if the file doesn't exist\). - */) - -directive(static) ident(VALUE) -ident(rb_stat_init)operator(()ident(obj)operator(,) ident(fname)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(fname)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(,) operator(*)ident(nst)operator(;) - - ident(SafeStringValue)operator(()ident(fname)operator(\);) - - reserved(if) operator(()ident(stat)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) operator(&)ident(st)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(fname)operator(\)->)ident(ptr)operator(\);) - operator(}) - reserved(if) operator(()ident(DATA_PTR)operator(()ident(obj)operator(\)\)) operator({) - ident(free)operator(()ident(DATA_PTR)operator(()ident(obj)operator(\)\);) - ident(DATA_PTR)operator(()ident(obj)operator(\)) operator(=) pre_constant(NULL)operator(;) - operator(}) - ident(nst) operator(=) ident(ALLOC)operator(()reserved(struct) ident(stat)operator(\);) - operator(*)ident(nst) operator(=) ident(st)operator(;) - ident(DATA_PTR)operator(()ident(obj)operator(\)) operator(=) ident(nst)operator(;) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* :nodoc: */) -directive(static) ident(VALUE) -ident(rb_stat_init_copy)operator(()ident(copy)operator(,) ident(orig)operator(\)) - ident(VALUE) ident(copy)operator(,) ident(orig)operator(;) -operator({) - reserved(struct) ident(stat) operator(*)ident(nst)operator(;) - - reserved(if) operator(()ident(copy) operator(==) ident(orig)operator(\)) reserved(return) ident(orig)operator(;) - ident(rb_check_frozen)operator(()ident(copy)operator(\);) - comment(/* need better argument type check */) - reserved(if) operator((!)ident(rb_obj_is_instance_of)operator(()ident(orig)operator(,) ident(rb_obj_class)operator(()ident(copy)operator(\)\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(DATA_PTR)operator(()ident(copy)operator(\)\)) operator({) - ident(free)operator(()ident(DATA_PTR)operator(()ident(copy)operator(\)\);) - ident(DATA_PTR)operator(()ident(copy)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(DATA_PTR)operator(()ident(orig)operator(\)\)) operator({) - ident(nst) operator(=) ident(ALLOC)operator(()reserved(struct) ident(stat)operator(\);) - operator(*)ident(nst) operator(=) operator(*()reserved(struct) ident(stat)operator(*\))ident(DATA_PTR)operator(()ident(orig)operator(\);) - ident(DATA_PTR)operator(()ident(copy)operator(\)) operator(=) ident(nst)operator(;) - operator(}) - - reserved(return) ident(copy)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.ftype => string - * - * Identifies the type of stat. The return string is one of: - * ``file'', ``directory'', - * ``characterSpecial'', ``blockSpecial'', - * ``fifo'', ``link'', - * ``socket'', or ``unknown''. - * - * File.stat("/dev/tty"\).ftype #=> "characterSpecial" - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_ftype)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_file_ftype)operator(()ident(get_stat)operator(()ident(obj)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * stat.directory? => true or false - * - * Returns true if stat is a directory, - * false otherwise. - * - * File.stat("testfile"\).directory? #=> false - * File.stat("."\).directory? #=> true - */) - -directive(static) ident(VALUE) -ident(rb_stat_d)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(S_ISDIR)operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.pipe? => true or false - * - * Returns true if the operating system supports pipes and - * stat is a pipe; false otherwise. - */) - -directive(static) ident(VALUE) -ident(rb_stat_p)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#ifdef) ident(S_IFIFO) - reserved(if) operator(()ident(S_ISFIFO)operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.symlink? => true or false - * - * Returns true if stat is a symbolic link, - * false if it isn't or if the operating system doesn't - * support this feature. As File::stat automatically - * follows symbolic links, symlink? will always be - * false for an object returned by - * File::stat. - * - * File.symlink("testfile", "alink"\) #=> 0 - * File.stat("alink"\).symlink? #=> false - * File.lstat("alink"\).symlink? #=> true - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_l)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#ifdef) ident(S_ISLNK) - reserved(if) operator(()ident(S_ISLNK)operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.socket? => true or false - * - * Returns true if stat is a socket, - * false if it isn't or if the operating system doesn't - * support this feature. - * - * File.stat("testfile"\).socket? #=> false - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_S)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#ifdef) ident(S_ISSOCK) - reserved(if) operator(()ident(S_ISSOCK)operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.blockdev? => true or false - * - * Returns true if the file is a block device, - * false if it isn't or if the operating system doesn't - * support this feature. - * - * File.stat("testfile"\).blockdev? #=> false - * File.stat("/dev/hda1"\).blockdev? #=> true - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_b)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#ifdef) ident(S_ISBLK) - reserved(if) operator(()ident(S_ISBLK)operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.chardev? => true or false - * - * Returns true if the file is a character device, - * false if it isn't or if the operating system doesn't - * support this feature. - * - * File.stat("/dev/tty"\).chardev? #=> true - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_c)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(S_ISCHR)operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.owned? => true or false - * - * Returns true if the effective user id of the process is - * the same as the owner of stat. - * - * File.stat("testfile"\).owned? #=> true - * File.stat("/etc/passwd"\).owned? #=> false - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_owned)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_uid) operator(==) ident(geteuid)operator((\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_stat_rowned)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_uid) operator(==) ident(getuid)operator((\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.grpowned? => true or false - * - * Returns true if the effective group id of the process is the same as - * the group id of stat. On Windows NT, returns false. - * - * File.stat("testfile"\).grpowned? #=> true - * File.stat("/etc/passwd"\).grpowned? #=> false - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_grpowned)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#ifndef) ident(_WIN32) - reserved(if) operator(()ident(group_member)operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_gid)operator(\)\)) reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.readable? => true or false - * - * Returns true if stat is readable by the - * effective user id of this process. - * - * File.stat("testfile"\).readable? #=> true - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_r)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(struct) ident(stat) operator(*)ident(st) operator(=) ident(get_stat)operator(()ident(obj)operator(\);) - -preprocessor(#ifdef) ident(USE_GETEUID) - reserved(if) operator(()ident(geteuid)operator((\)) operator(==) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IRUSR) - reserved(if) operator(()ident(rb_stat_owned)operator(()ident(obj)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IRUSR) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IRGRP) - reserved(if) operator(()ident(rb_stat_grpowned)operator(()ident(obj)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IRGRP) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IROTH) - reserved(if) operator((!()ident(st)operator(->)ident(st_mode) operator(&) ident(S_IROTH)operator(\)\)) reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.readable_real? -> true or false - * - * Returns true if stat is readable by the real - * user id of this process. - * - * File.stat("testfile"\).readable_real? #=> true - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_R)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(struct) ident(stat) operator(*)ident(st) operator(=) ident(get_stat)operator(()ident(obj)operator(\);) - -preprocessor(#ifdef) ident(USE_GETEUID) - reserved(if) operator(()ident(getuid)operator((\)) operator(==) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IRUSR) - reserved(if) operator(()ident(rb_stat_rowned)operator(()ident(obj)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IRUSR) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IRGRP) - reserved(if) operator(()ident(group_member)operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_gid)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IRGRP) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IROTH) - reserved(if) operator((!()ident(st)operator(->)ident(st_mode) operator(&) ident(S_IROTH)operator(\)\)) reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.writable? -> true or false - * - * Returns true if stat is writable by the - * effective user id of this process. - * - * File.stat("testfile"\).writable? #=> true - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_w)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(struct) ident(stat) operator(*)ident(st) operator(=) ident(get_stat)operator(()ident(obj)operator(\);) - -preprocessor(#ifdef) ident(USE_GETEUID) - reserved(if) operator(()ident(geteuid)operator((\)) operator(==) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IWUSR) - reserved(if) operator(()ident(rb_stat_owned)operator(()ident(obj)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IWUSR) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IWGRP) - reserved(if) operator(()ident(rb_stat_grpowned)operator(()ident(obj)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IWGRP) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IWOTH) - reserved(if) operator((!()ident(st)operator(->)ident(st_mode) operator(&) ident(S_IWOTH)operator(\)\)) reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.writable_real? -> true or false - * - * Returns true if stat is writable by the real - * user id of this process. - * - * File.stat("testfile"\).writable_real? #=> true - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_W)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(struct) ident(stat) operator(*)ident(st) operator(=) ident(get_stat)operator(()ident(obj)operator(\);) - -preprocessor(#ifdef) ident(USE_GETEUID) - reserved(if) operator(()ident(getuid)operator((\)) operator(==) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IWUSR) - reserved(if) operator(()ident(rb_stat_rowned)operator(()ident(obj)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IWUSR) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IWGRP) - reserved(if) operator(()ident(group_member)operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_gid)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IWGRP) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IWOTH) - reserved(if) operator((!()ident(st)operator(->)ident(st_mode) operator(&) ident(S_IWOTH)operator(\)\)) reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.executable? => true or false - * - * Returns true if stat is executable or if the - * operating system doesn't distinguish executable files from - * nonexecutable files. The tests are made using the effective owner of - * the process. - * - * File.stat("testfile"\).executable? #=> false - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_x)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(struct) ident(stat) operator(*)ident(st) operator(=) ident(get_stat)operator(()ident(obj)operator(\);) - -preprocessor(#ifdef) ident(USE_GETEUID) - reserved(if) operator(()ident(geteuid)operator((\)) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IXUGO) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) - operator(}) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IXUSR) - reserved(if) operator(()ident(rb_stat_owned)operator(()ident(obj)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IXUSR) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IXGRP) - reserved(if) operator(()ident(rb_stat_grpowned)operator(()ident(obj)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IXGRP) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IXOTH) - reserved(if) operator((!()ident(st)operator(->)ident(st_mode) operator(&) ident(S_IXOTH)operator(\)\)) reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.executable_real? => true or false - * - * Same as executable?, but tests using the real owner of - * the process. - */) - -directive(static) ident(VALUE) -ident(rb_stat_X)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(struct) ident(stat) operator(*)ident(st) operator(=) ident(get_stat)operator(()ident(obj)operator(\);) - -preprocessor(#ifdef) ident(USE_GETEUID) - reserved(if) operator(()ident(getuid)operator((\)) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IXUGO) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) - operator(}) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IXUSR) - reserved(if) operator(()ident(rb_stat_rowned)operator(()ident(obj)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IXUSR) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IXGRP) - reserved(if) operator(()ident(group_member)operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_gid)operator(\)\)) - reserved(return) ident(st)operator(->)ident(st_mode) operator(&) ident(S_IXGRP) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(S_IXOTH) - reserved(if) operator((!()ident(st)operator(->)ident(st_mode) operator(&) ident(S_IXOTH)operator(\)\)) reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.file? => true or false - * - * Returns true if stat is a regular file (not - * a device file, pipe, socket, etc.\). - * - * File.stat("testfile"\).file? #=> true - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_f)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(S_ISREG)operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_mode)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.zero? => true or false - * - * Returns true if stat is a zero-length file; - * false otherwise. - * - * File.stat("testfile"\).zero? #=> false - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_z)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_size) operator(==) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * state.size => integer - * - * Returns the size of stat in bytes. - * - * File.stat("testfile"\).size #=> 66 - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_s)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(off_t) ident(size) operator(=) ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_size)operator(;) - - reserved(if) operator(()ident(size) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(OFFT2NUM)operator(()ident(size)operator(\);) -operator(}) - -comment(/* - * call-seq: - * stat.setuid? => true or false - * - * Returns true if stat has the set-user-id - * permission bit set, false if it doesn't or if the - * operating system doesn't support this feature. - * - * File.stat("/bin/su"\).setuid? #=> true - */) - -directive(static) ident(VALUE) -ident(rb_stat_suid)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#ifdef) ident(S_ISUID) - reserved(if) operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_mode) operator(&) ident(S_ISUID)operator(\)) reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.setgid? => true or false - * - * Returns true if stat has the set-group-id - * permission bit set, false if it doesn't or if the - * operating system doesn't support this feature. - * - * File.stat("/usr/sbin/lpc"\).setgid? #=> true - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_sgid)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#ifdef) ident(S_ISGID) - reserved(if) operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_mode) operator(&) ident(S_ISGID)operator(\)) reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * stat.sticky? => true or false - * - * Returns true if stat has its sticky bit set, - * false if it doesn't or if the operating system doesn't - * support this feature. - * - * File.stat("testfile"\).sticky? #=> false - * - */) - -directive(static) ident(VALUE) -ident(rb_stat_sticky)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#ifdef) ident(S_ISVTX) - reserved(if) operator(()ident(get_stat)operator(()ident(obj)operator(\)->)ident(st_mode) operator(&) ident(S_ISVTX)operator(\)) reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -ident(VALUE) ident(rb_mFConst)operator(;) - -directive(void) -ident(rb_file_const)operator(()ident(name)operator(,) ident(value)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) ident(value)operator(;) -operator({) - ident(rb_define_const)operator(()ident(rb_mFConst)operator(,) ident(name)operator(,) ident(value)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(is_absolute_path)operator(()ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) -preprocessor(#ifdef) ident(DOSISH_DRIVE_LETTER) - reserved(if) operator(()ident(has_drive_letter)operator(()ident(path)operator(\)) operator(&&) ident(isdirsep)operator(()ident(path)operator([)integer(2)operator(]\)\)) reserved(return) integer(1)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(DOSISH_UNC) - reserved(if) operator(()ident(isdirsep)operator(()ident(path)operator([)integer(0)operator(]\)) operator(&&) ident(isdirsep)operator(()ident(path)operator([)integer(1)operator(]\)\)) reserved(return) integer(1)operator(;) -preprocessor(#endif) -preprocessor(#ifndef) ident(DOSISH) - reserved(if) operator(()ident(path)operator([)integer(0)operator(]) operator(==) char('/')operator(\)) reserved(return) integer(1)operator(;) -preprocessor(#endif) - reserved(return) integer(0)operator(;) -operator(}) - -preprocessor(#ifndef) ident(ENABLE_PATH_CHECK) -preprocessor(# if) ident(defined) ident(DOSISH) operator(||) ident(defined) ident(__CYGWIN__) -preprocessor(# define) ident(ENABLE_PATH_CHECK) integer(0) -preprocessor(# else) -preprocessor(# define) ident(ENABLE_PATH_CHECK) integer(1) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#if) ident(ENABLE_PATH_CHECK) -directive(static) pre_type(int) -ident(path_check_0)operator(()ident(fpath)operator(,) ident(execpath)operator(\)) - ident(VALUE) ident(fpath)operator(;) - pre_type(int) ident(execpath)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - pre_type(char) operator(*)ident(p0) operator(=) ident(StringValueCStr)operator(()ident(fpath)operator(\);) - pre_type(char) operator(*)ident(p) operator(=) integer(0)operator(,) operator(*)ident(s)operator(;) - - reserved(if) operator((!)ident(is_absolute_path)operator(()ident(p0)operator(\)\)) operator({) - pre_type(char) operator(*)ident(buf) operator(=) ident(my_getcwd)operator((\);) - ident(VALUE) ident(newpath)operator(;) - - ident(newpath) operator(=) ident(rb_str_new2)operator(()ident(buf)operator(\);) - ident(free)operator(()ident(buf)operator(\);) - - ident(rb_str_cat2)operator(()ident(newpath)operator(,) stringoperator(\);) - ident(rb_str_cat2)operator(()ident(newpath)operator(,) ident(p0)operator(\);) - ident(p0) operator(=) ident(RSTRING)operator(()ident(fpath) operator(=) ident(newpath)operator(\)->)ident(ptr)operator(;) - operator(}) - reserved(for) operator((;;\)) operator({) -preprocessor(#ifndef) ident(S_IWOTH) -preprocessor(# define) ident(S_IWOTH) oct(002) -preprocessor(#endif) - reserved(if) operator(()ident(stat)operator(()ident(p0)operator(,) operator(&)ident(st)operator(\)) operator(==) integer(0) operator(&&) ident(S_ISDIR)operator(()ident(st)operator(.)ident(st_mode)operator(\)) operator(&&) operator(()ident(st)operator(.)ident(st_mode) operator(&) ident(S_IWOTH)operator(\)) -preprocessor(#ifdef) ident(S_ISVTX) - operator(&&) operator(!()ident(p) operator(&&) ident(execpath) operator(&&) operator(()ident(st)operator(.)ident(st_mode) operator(&) ident(S_ISVTX)operator(\)\)) -preprocessor(#endif) - operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) - ident(p0)operator(,) operator(()ident(execpath) operator(?) string operator(:) stringoperator(\),) ident(st)operator(.)ident(st_mode)operator(\);) - reserved(if) operator(()ident(p)operator(\)) operator(*)ident(p) operator(=) char('/')operator(;) - reserved(return) integer(0)operator(;) - operator(}) - ident(s) operator(=) ident(strrdirsep)operator(()ident(p0)operator(\);) - reserved(if) operator(()ident(p)operator(\)) operator(*)ident(p) operator(=) char('/')operator(;) - reserved(if) operator((!)ident(s) operator(||) ident(s) operator(==) ident(p0)operator(\)) reserved(return) integer(1)operator(;) - ident(p) operator(=) ident(s)operator(;) - operator(*)ident(p) operator(=) char('\\0')operator(;) - operator(}) -operator(}) -preprocessor(#endif) - -directive(static) pre_type(int) -ident(fpath_check)operator(()ident(path)operator(\)) - pre_type(char) operator(*)ident(path)operator(;) -operator({) -preprocessor(#if) ident(ENABLE_PATH_CHECK) - reserved(return) ident(path_check_0)operator(()ident(rb_str_new2)operator(()ident(path)operator(\),) ident(Qfalse)operator(\);) -preprocessor(#else) - reserved(return) integer(1)operator(;) -preprocessor(#endif) -operator(}) - -pre_type(int) -ident(rb_path_check)operator(()ident(path)operator(\)) - pre_type(char) operator(*)ident(path)operator(;) -operator({) -preprocessor(#if) ident(ENABLE_PATH_CHECK) - pre_type(char) operator(*)ident(p0)operator(,) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - directive(const) pre_type(char) ident(sep) operator(=) ident(PATH_SEP_CHAR)operator(;) - - reserved(if) operator((!)ident(path)operator(\)) reserved(return) integer(1)operator(;) - - ident(pend) operator(=) ident(path) operator(+) ident(strlen)operator(()ident(path)operator(\);) - ident(p0) operator(=) ident(path)operator(;) - ident(p) operator(=) ident(strchr)operator(()ident(path)operator(,) ident(sep)operator(\);) - reserved(if) operator((!)ident(p)operator(\)) ident(p) operator(=) ident(pend)operator(;) - - reserved(for) operator((;;\)) operator({) - reserved(if) operator((!)ident(path_check_0)operator(()ident(rb_str_new)operator(()ident(p0)operator(,) ident(p) operator(-) ident(p0)operator(\),) ident(Qtrue)operator(\)\)) operator({) - reserved(return) integer(0)operator(;) comment(/* not safe */) - operator(}) - ident(p0) operator(=) ident(p) operator(+) integer(1)operator(;) - reserved(if) operator(()ident(p0) operator(>) ident(pend)operator(\)) reserved(break)operator(;) - ident(p) operator(=) ident(strchr)operator(()ident(p0)operator(,) ident(sep)operator(\);) - reserved(if) operator((!)ident(p)operator(\)) ident(p) operator(=) ident(pend)operator(;) - operator(}) -preprocessor(#endif) - reserved(return) integer(1)operator(;) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(__MACOS__)operator(\)) operator(||) ident(defined)operator(()ident(riscos)operator(\)) -directive(static) pre_type(int) -ident(is_macos_native_path)operator(()ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) - reserved(if) operator(()ident(strchr)operator(()ident(path)operator(,) char(':')operator(\)\)) reserved(return) integer(1)operator(;) - reserved(return) integer(0)operator(;) -operator(}) -preprocessor(#endif) - -directive(static) pre_type(int) -ident(file_load_ok)operator(()ident(file)operator(\)) - pre_type(char) operator(*)ident(file)operator(;) -operator({) - pre_type(int) ident(ret) operator(=) integer(1)operator(;) - pre_type(int) ident(fd) operator(=) ident(open)operator(()ident(file)operator(,) ident(O_RDONLY)operator(\);) - reserved(if) operator(()ident(fd) operator(==) operator(-)integer(1)operator(\)) reserved(return) integer(0)operator(;) -preprocessor(#if) operator(!)ident(defined) ident(DOSISH) - operator({) - reserved(struct) ident(stat) ident(st)operator(;) - reserved(if) operator(()ident(fstat)operator(()ident(fd)operator(,) operator(&)ident(st)operator(\)) operator(||) operator(!)ident(S_ISREG)operator(()ident(st)operator(.)ident(st_mode)operator(\)\)) operator({) - ident(ret) operator(=) integer(0)operator(;) - operator(}) - operator(}) -preprocessor(#endif) - operator(()directive(void)operator(\))ident(close)operator(()ident(fd)operator(\);) - reserved(return) ident(ret)operator(;) -operator(}) - -directive(extern) ident(VALUE) ident(rb_load_path)operator(;) - -pre_type(int) -ident(rb_find_file_ext)operator(()ident(filep)operator(,) ident(ext)operator(\)) - ident(VALUE) operator(*)ident(filep)operator(;) - directive(const) pre_type(char) operator(*) directive(const) operator(*)ident(ext)operator(;) -operator({) - pre_type(char) operator(*)ident(path)operator(,) operator(*)ident(found)operator(;) - pre_type(char) operator(*)ident(f) operator(=) ident(RSTRING)operator((*)ident(filep)operator(\)->)ident(ptr)operator(;) - ident(VALUE) ident(fname)operator(;) - pre_type(long) ident(i)operator(,) ident(j)operator(;) - - reserved(if) operator(()ident(f)operator([)integer(0)operator(]) operator(==) char('~')operator(\)) operator({) - ident(fname) operator(=) ident(rb_file_expand_path)operator((*)ident(filep)operator(,) ident(Qnil)operator(\);) - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(2) operator(&&) ident(OBJ_TAINTED)operator(()ident(fname)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(f)operator(\);) - operator(}) - ident(OBJ_FREEZE)operator(()ident(fname)operator(\);) - ident(f) operator(=) ident(StringValueCStr)operator(()ident(fname)operator(\);) - operator(*)ident(filep) operator(=) ident(fname)operator(;) - operator(}) - - reserved(if) operator(()ident(is_absolute_path)operator(()ident(f)operator(\)\)) operator({) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(ext)operator([)ident(i)operator(];) ident(i)operator(++\)) operator({) - ident(fname) operator(=) ident(rb_str_dup)operator((*)ident(filep)operator(\);) - ident(rb_str_cat2)operator(()ident(fname)operator(,) ident(ext)operator([)ident(i)operator(]\);) - ident(OBJ_FREEZE)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(file_load_ok)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\)\)\)) operator({) - operator(*)ident(filep) operator(=) ident(fname)operator(;) - reserved(return) ident(i)operator(+)integer(1)operator(;) - operator(}) - operator(}) - reserved(return) integer(0)operator(;) - operator(}) - - reserved(if) operator((!)ident(rb_load_path)operator(\)) reserved(return) integer(0)operator(;) - - ident(Check_Type)operator(()ident(rb_load_path)operator(,) ident(T_ARRAY)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;)ident(i)operator(<)ident(RARRAY)operator(()ident(rb_load_path)operator(\)->)ident(len)operator(;)ident(i)operator(++\)) operator({) - ident(VALUE) ident(str) operator(=) ident(RARRAY)operator(()ident(rb_load_path)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - - ident(SafeStringValue)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(continue)operator(;) - ident(path) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - reserved(for) operator(()ident(j)operator(=)integer(0)operator(;) ident(ext)operator([)ident(j)operator(];) ident(j)operator(++\)) operator({) - ident(fname) operator(=) ident(rb_str_dup)operator((*)ident(filep)operator(\);) - ident(rb_str_cat2)operator(()ident(fname)operator(,) ident(ext)operator([)ident(j)operator(]\);) - ident(OBJ_FREEZE)operator(()ident(fname)operator(\);) - ident(found) operator(=) ident(dln_find_file)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) ident(path)operator(\);) - reserved(if) operator(()ident(found) operator(&&) ident(file_load_ok)operator(()ident(found)operator(\)\)) operator({) - operator(*)ident(filep) operator(=) ident(fname)operator(;) - reserved(return) ident(j)operator(+)integer(1)operator(;) - operator(}) - operator(}) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -ident(VALUE) -ident(rb_find_file)operator(()ident(path)operator(\)) - ident(VALUE) ident(path)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(;) - pre_type(char) operator(*)ident(f) operator(=) ident(StringValueCStr)operator(()ident(path)operator(\);) - pre_type(char) operator(*)ident(lpath)operator(;) - - reserved(if) operator(()ident(f)operator([)integer(0)operator(]) operator(==) char('~')operator(\)) operator({) - ident(path) operator(=) ident(rb_file_expand_path)operator(()ident(path)operator(,) ident(Qnil)operator(\);) - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(1) operator(&&) ident(OBJ_TAINTED)operator(()ident(path)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(f)operator(\);) - operator(}) - ident(OBJ_FREEZE)operator(()ident(path)operator(\);) - ident(f) operator(=) ident(StringValueCStr)operator(()ident(path)operator(\);) - operator(}) - -preprocessor(#if) ident(defined)operator(()ident(__MACOS__)operator(\)) operator(||) ident(defined)operator(()ident(riscos)operator(\)) - reserved(if) operator(()ident(is_macos_native_path)operator(()ident(f)operator(\)\)) operator({) - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(1) operator(&&) operator(!)ident(fpath_check)operator(()ident(f)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(f)operator(\);) - operator(}) - reserved(if) operator(()ident(file_load_ok)operator(()ident(f)operator(\)\)) reserved(return) ident(path)operator(;) - operator(}) -preprocessor(#endif) - - reserved(if) operator(()ident(is_absolute_path)operator(()ident(f)operator(\)\)) operator({) - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(1) operator(&&) operator(!)ident(fpath_check)operator(()ident(f)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(f)operator(\);) - operator(}) - reserved(if) operator(()ident(file_load_ok)operator(()ident(f)operator(\)\)) reserved(return) ident(path)operator(;) - operator(}) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(f)operator(\);) - operator(}) - - reserved(if) operator(()ident(rb_load_path)operator(\)) operator({) - pre_type(long) ident(i)operator(;) - - ident(Check_Type)operator(()ident(rb_load_path)operator(,) ident(T_ARRAY)operator(\);) - ident(tmp) operator(=) ident(rb_ary_new)operator((\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;)ident(i)operator(<)ident(RARRAY)operator(()ident(rb_load_path)operator(\)->)ident(len)operator(;)ident(i)operator(++\)) operator({) - ident(VALUE) ident(str) operator(=) ident(RARRAY)operator(()ident(rb_load_path)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - ident(SafeStringValue)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) integer(0)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(tmp)operator(,) ident(str)operator(\);) - operator(}) - operator(}) - ident(tmp) operator(=) ident(rb_ary_join)operator(()ident(tmp)operator(,) ident(rb_str_new2)operator(()ident(PATH_SEP)operator(\)\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(len) operator(==) integer(0)operator(\)) operator({) - ident(lpath) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(lpath) operator(=) ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(lpath) operator(=) integer(0)operator(;) - operator(}) - - reserved(if) operator((!)ident(lpath)operator(\)) operator({) - reserved(return) integer(0)operator(;) comment(/* no path, no load */) - operator(}) - reserved(if) operator((!()ident(f) operator(=) ident(dln_find_file)operator(()ident(f)operator(,) ident(lpath)operator(\)\)\)) operator({) - reserved(return) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(1) operator(&&) operator(!)ident(fpath_check)operator(()ident(f)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(f)operator(\);) - operator(}) - reserved(if) operator(()ident(file_load_ok)operator(()ident(f)operator(\)\)) operator({) - ident(tmp) operator(=) ident(rb_str_new2)operator(()ident(f)operator(\);) - ident(OBJ_FREEZE)operator(()ident(tmp)operator(\);) - reserved(return) ident(tmp)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) directive(void) -ident(define_filetest_function)operator(()ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator((*)ident(func)operator(\)(\);) - pre_type(int) ident(argc)operator(;) -operator({) - ident(rb_define_module_function)operator(()ident(rb_mFileTest)operator(,) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) ident(name)operator(,) ident(func)operator(,) ident(argc)operator(\);) -operator(}) - - -comment(/* - * A File is an abstraction of any file object accessible - * by the program and is closely associated with class IO - * File includes the methods of module - * FileTest as class methods, allowing you to write (for - * example\) File.exist?("foo"\). - * - * In the description of File methods, - * permission bits are a platform-specific - * set of bits that indicate permissions of a file. On Unix-based - * systems, permissions are viewed as a set of three octets, for the - * owner, the group, and the rest of the world. For each of these - * entities, permissions may be set to read, write, or execute the - * file: - * - * The permission bits 0644 (in octal\) would thus be - * interpreted as read/write for owner, and read-only for group and - * other. Higher-order bits may also be used to indicate the type of - * file (plain, directory, pipe, socket, and so on\) and various other - * special features. If the permissions are for a directory, the - * meaning of the execute bit changes; when set the directory can be - * searched. - * - * On non-Posix operating systems, there may be only the ability to - * make a file read-only or read-write. In this case, the remaining - * permission bits will be synthesized to resemble typical values. For - * instance, on Windows NT the default permission bits are - * 0644, which means read/write for owner, read-only for - * all others. The only change that can be made is to make the file - * read-only, which is reported as 0444. - */) - -directive(void) -ident(Init_File)operator((\)) -operator({) - ident(rb_mFileTest) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - ident(rb_cFile) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cIO)operator(\);) - - ident(define_filetest_function)operator(()stringoperator(,) ident(test_d)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_e)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_e)operator(,) integer(1)operator(\);) comment(/* temporary */) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_r)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_R)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_w)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_W)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_x)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_X)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_f)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_z)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_s)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(rb_file_s_size)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_owned)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_grpowned)operator(,) integer(1)operator(\);) - - ident(define_filetest_function)operator(()stringoperator(,) ident(test_p)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_l)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_S)operator(,) integer(1)operator(\);) - - ident(define_filetest_function)operator(()stringoperator(,) ident(test_b)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_c)operator(,) integer(1)operator(\);) - - ident(define_filetest_function)operator(()stringoperator(,) ident(test_suid)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_sgid)operator(,) integer(1)operator(\);) - ident(define_filetest_function)operator(()stringoperator(,) ident(test_sticky)operator(,) integer(1)operator(\);) - - ident(define_filetest_function)operator(()stringoperator(,) ident(test_identical)operator(,) integer(2)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_stat)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_lstat)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_ftype)operator(,) integer(1)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_atime)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_mtime)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_ctime)operator(,) integer(1)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_utime)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_chmod)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_chown)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_lchmod)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_lchown)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_link)operator(,) integer(2)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_symlink)operator(,) integer(2)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_readlink)operator(,) integer(1)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_unlink)operator(,) operator(-)integer(2)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_unlink)operator(,) operator(-)integer(2)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_rename)operator(,) integer(2)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_umask)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_truncate)operator(,) integer(2)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_expand_path)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_basename)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_dirname)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_extname)operator(,) integer(1)operator(\);) - - ident(separator) operator(=) ident(rb_obj_freeze)operator(()ident(rb_str_new2)operator(()stringoperator(\)\);) - ident(rb_define_const)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(separator)operator(\);) - ident(rb_define_const)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(separator)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_split)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_s_join)operator(,) operator(-)integer(2)operator(\);) - -preprocessor(#ifdef) ident(DOSISH) - ident(rb_define_const)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_obj_freeze)operator(()ident(rb_str_new2)operator(()stringoperator(\)\)\);) -preprocessor(#else) - ident(rb_define_const)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(Qnil)operator(\);) -preprocessor(#endif) - ident(rb_define_const)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_obj_freeze)operator(()ident(rb_str_new2)operator(()ident(PATH_SEP)operator(\)\)\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_stat)operator(,) integer(0)operator(\);) comment(/* this is IO's method */) - ident(rb_define_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_lstat)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_atime)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_mtime)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_ctime)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_chmod)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_chown)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_truncate)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_flock)operator(,) integer(1)operator(\);) - - ident(rb_mFConst) operator(=) ident(rb_define_module_under)operator(()ident(rb_cFile)operator(,) stringoperator(\);) - ident(rb_include_module)operator(()ident(rb_cIO)operator(,) ident(rb_mFConst)operator(\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(LOCK_SH)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(LOCK_EX)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(LOCK_UN)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(LOCK_NB)operator(\)\);) - - ident(rb_define_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_path)operator(,) integer(0)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_test)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_cStat) operator(=) ident(rb_define_class_under)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_define_alloc_func)operator(()ident(rb_cStat)operator(,) ident(rb_stat_s_alloc)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_init)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_init_copy)operator(,) integer(1)operator(\);) - - ident(rb_include_module)operator(()ident(rb_cStat)operator(,) ident(rb_mComparable)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) string)delimiter(")>operator(,) ident(rb_stat_cmp)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_dev)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_dev_major)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_dev_minor)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_ino)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_mode)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_nlink)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_uid)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_gid)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_rdev)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_rdev_major)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_rdev_minor)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_size)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_blksize)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_blocks)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_atime)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_mtime)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_ctime)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_inspect)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_ftype)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_d)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_r)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_R)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_w)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_W)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_x)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_X)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_f)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_z)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_owned)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_grpowned)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_l)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_S)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_b)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_c)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_suid)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_sgid)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStat)operator(,) stringoperator(,) ident(rb_stat_sticky)operator(,) integer(0)operator(\);) -operator(}) -comment(/********************************************************************** - - gc.c - - - $Author: wyhaines $ - $Date: 2009-07-10 20:31:58 +0200 (Fri, 10 Jul 2009\) $ - created at: Tue Oct 5 09:44:46 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("rubysig.h") -preprocessor(#include) include("st.h") -preprocessor(#include) include("node.h") -preprocessor(#include) include("env.h") -preprocessor(#include) include("re.h") -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#ifdef) ident(HAVE_SYS_TIME_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_SYS_RESOURCE_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(_WIN32) operator(||) ident(defined) ident(__CYGWIN__) -preprocessor(#include) include() -preprocessor(#endif) - -directive(void) ident(re_free_registers) ident(_)operator((()reserved(struct) ident(re_registers)operator(*\)\);) -directive(void) ident(rb_io_fptr_finalize) ident(_)operator((()reserved(struct) ident(OpenFile)operator(*\)\);) - -preprocessor(#if) operator(!)ident(defined)operator(()ident(setjmp)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE__SETJMP)operator(\)) -preprocessor(#define) ident(setjmp)operator(()ident(env)operator(\)) ident(_setjmp)operator(()ident(env)operator(\)) -preprocessor(#endif) - -comment(/* Make alloca work the best possible way. */) -preprocessor(#ifdef) ident(__GNUC__) -preprocessor(# ifndef) ident(atarist) -preprocessor(# ifndef) ident(alloca) -preprocessor(# define) ident(alloca) ident(__builtin_alloca) -preprocessor(# endif) -preprocessor(# endif) comment(/* atarist */) -preprocessor(#else) -preprocessor(# ifdef) ident(HAVE_ALLOCA_H) -preprocessor(# include) include() -preprocessor(# else) -preprocessor(# ifndef) ident(_AIX) -preprocessor(# ifndef) ident(alloca) comment(/* predefined by HP cc +Olibcalls */) -directive(void) operator(*)ident(alloca) operator((\);) -preprocessor(# endif) -preprocessor(# endif) comment(/* AIX */) -preprocessor(# endif) comment(/* HAVE_ALLOCA_H */) -preprocessor(#endif) comment(/* __GNUC__ */) - -preprocessor(#ifndef) ident(GC_MALLOC_LIMIT) -preprocessor(#if) ident(defined)operator(()ident(MSDOS)operator(\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) -preprocessor(#define) ident(GC_MALLOC_LIMIT) integer(200000) -preprocessor(#else) -preprocessor(#define) ident(GC_MALLOC_LIMIT) integer(8000000) -preprocessor(#endif) -preprocessor(#endif) - -directive(static) pre_type(unsigned) pre_type(long) ident(malloc_increase) operator(=) integer(0)operator(;) -directive(static) pre_type(unsigned) pre_type(long) ident(malloc_limit) operator(=) ident(GC_MALLOC_LIMIT)operator(;) -directive(static) directive(void) ident(run_final)operator((\);) -directive(static) ident(VALUE) ident(nomem_error)operator(;) -directive(static) directive(void) ident(garbage_collect)operator((\);) - -ident(NORETURN)operator(()directive(void) ident(rb_exc_jump) ident(_)operator((()ident(VALUE)operator(\)\)\);) - -directive(void) -ident(rb_memerror)operator((\)) -operator({) - ident(rb_thread_t) ident(th) operator(=) ident(rb_curr_thread)operator(;) - - reserved(if) operator((!)ident(nomem_error) operator(||) - operator(()ident(rb_thread_raised_p)operator(()ident(th)operator(,) ident(RAISED_NOMEMORY)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(<) integer(4)operator(\)\)) operator({) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(\);) - ident(exit)operator(()integer(1)operator(\);) - operator(}) - reserved(if) operator(()ident(rb_thread_raised_p)operator(()ident(th)operator(,) ident(RAISED_NOMEMORY)operator(\)\)) operator({) - ident(rb_exc_jump)operator(()ident(nomem_error)operator(\);) - operator(}) - ident(rb_thread_raised_set)operator(()ident(th)operator(,) ident(RAISED_NOMEMORY)operator(\);) - ident(rb_exc_raise)operator(()ident(nomem_error)operator(\);) -operator(}) - -directive(void) operator(*) -ident(ruby_xmalloc)operator(()ident(size)operator(\)) - pre_type(long) ident(size)operator(;) -operator({) - directive(void) operator(*)ident(mem)operator(;) - - reserved(if) operator(()ident(size) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eNoMemError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(size) operator(==) integer(0)operator(\)) ident(size) operator(=) integer(1)operator(;) - - reserved(if) operator((()ident(malloc_increase)operator(+)ident(size)operator(\)) operator(>) ident(malloc_limit)operator(\)) operator({) - ident(garbage_collect)operator((\);) - operator(}) - ident(RUBY_CRITICAL)operator(()ident(mem) operator(=) ident(malloc)operator(()ident(size)operator(\)\);) - reserved(if) operator((!)ident(mem)operator(\)) operator({) - ident(garbage_collect)operator((\);) - ident(RUBY_CRITICAL)operator(()ident(mem) operator(=) ident(malloc)operator(()ident(size)operator(\)\);) - reserved(if) operator((!)ident(mem)operator(\)) operator({) - ident(rb_memerror)operator((\);) - operator(}) - operator(}) - ident(malloc_increase) operator(+=) ident(size)operator(;) - - reserved(return) ident(mem)operator(;) -operator(}) - -directive(void) operator(*) -ident(ruby_xcalloc)operator(()ident(n)operator(,) ident(size)operator(\)) - pre_type(long) ident(n)operator(,) ident(size)operator(;) -operator({) - directive(void) operator(*)ident(mem)operator(;) - - ident(mem) operator(=) ident(xmalloc)operator(()ident(n) operator(*) ident(size)operator(\);) - ident(memset)operator(()ident(mem)operator(,) integer(0)operator(,) ident(n) operator(*) ident(size)operator(\);) - - reserved(return) ident(mem)operator(;) -operator(}) - -directive(void) operator(*) -ident(ruby_xrealloc)operator(()ident(ptr)operator(,) ident(size)operator(\)) - directive(void) operator(*)ident(ptr)operator(;) - pre_type(long) ident(size)operator(;) -operator({) - directive(void) operator(*)ident(mem)operator(;) - - reserved(if) operator(()ident(size) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator((!)ident(ptr)operator(\)) reserved(return) ident(xmalloc)operator(()ident(size)operator(\);) - reserved(if) operator(()ident(size) operator(==) integer(0)operator(\)) ident(size) operator(=) integer(1)operator(;) - ident(RUBY_CRITICAL)operator(()ident(mem) operator(=) ident(realloc)operator(()ident(ptr)operator(,) ident(size)operator(\)\);) - reserved(if) operator((!)ident(mem)operator(\)) operator({) - ident(garbage_collect)operator((\);) - ident(RUBY_CRITICAL)operator(()ident(mem) operator(=) ident(realloc)operator(()ident(ptr)operator(,) ident(size)operator(\)\);) - reserved(if) operator((!)ident(mem)operator(\)) operator({) - ident(rb_memerror)operator((\);) - operator(}) - operator(}) - ident(malloc_increase) operator(+=) ident(size)operator(;) - - reserved(return) ident(mem)operator(;) -operator(}) - -directive(void) -ident(ruby_xfree)operator(()ident(x)operator(\)) - directive(void) operator(*)ident(x)operator(;) -operator({) - reserved(if) operator(()ident(x)operator(\)) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(x)operator(\)\);) -operator(}) - -directive(extern) pre_type(int) ident(ruby_in_compile)operator(;) -directive(static) pre_type(int) ident(dont_gc)operator(;) -directive(static) pre_type(int) ident(during_gc)operator(;) -directive(static) pre_type(int) ident(need_call_final) operator(=) integer(0)operator(;) -directive(static) ident(st_table) operator(*)ident(finalizer_table) operator(=) integer(0)operator(;) - - -comment(/* - * call-seq: - * GC.enable => true or false - * - * Enables garbage collection, returning true if garbage - * collection was previously disabled. - * - * GC.disable #=> false - * GC.enable #=> true - * GC.enable #=> false - * - */) - -ident(VALUE) -ident(rb_gc_enable)operator((\)) -operator({) - pre_type(int) ident(old) operator(=) ident(dont_gc)operator(;) - - ident(dont_gc) operator(=) ident(Qfalse)operator(;) - reserved(return) ident(old)operator(;) -operator(}) - -comment(/* - * call-seq: - * GC.disable => true or false - * - * Disables garbage collection, returning true if garbage - * collection was already disabled. - * - * GC.disable #=> false - * GC.disable #=> true - * - */) - -ident(VALUE) -ident(rb_gc_disable)operator((\)) -operator({) - pre_type(int) ident(old) operator(=) ident(dont_gc)operator(;) - - ident(dont_gc) operator(=) ident(Qtrue)operator(;) - reserved(return) ident(old)operator(;) -operator(}) - -ident(VALUE) ident(rb_mGC)operator(;) - -directive(static) reserved(struct) ident(gc_list) operator({) - ident(VALUE) operator(*)ident(varptr)operator(;) - reserved(struct) ident(gc_list) operator(*)ident(next)operator(;) -operator(}) operator(*)ident(global_List) operator(=) integer(0)operator(;) - -directive(void) -ident(rb_gc_register_address)operator(()ident(addr)operator(\)) - ident(VALUE) operator(*)ident(addr)operator(;) -operator({) - reserved(struct) ident(gc_list) operator(*)ident(tmp)operator(;) - - ident(tmp) operator(=) ident(ALLOC)operator(()reserved(struct) ident(gc_list)operator(\);) - ident(tmp)operator(->)ident(next) operator(=) ident(global_List)operator(;) - ident(tmp)operator(->)ident(varptr) operator(=) ident(addr)operator(;) - ident(global_List) operator(=) ident(tmp)operator(;) -operator(}) - -directive(void) -ident(rb_gc_unregister_address)operator(()ident(addr)operator(\)) - ident(VALUE) operator(*)ident(addr)operator(;) -operator({) - reserved(struct) ident(gc_list) operator(*)ident(tmp) operator(=) ident(global_List)operator(;) - - reserved(if) operator(()ident(tmp)operator(->)ident(varptr) operator(==) ident(addr)operator(\)) operator({) - ident(global_List) operator(=) ident(tmp)operator(->)ident(next)operator(;) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(tmp)operator(\)\);) - reserved(return)operator(;) - operator(}) - reserved(while) operator(()ident(tmp)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator(()ident(tmp)operator(->)ident(next)operator(->)ident(varptr) operator(==) ident(addr)operator(\)) operator({) - reserved(struct) ident(gc_list) operator(*)ident(t) operator(=) ident(tmp)operator(->)ident(next)operator(;) - - ident(tmp)operator(->)ident(next) operator(=) ident(tmp)operator(->)ident(next)operator(->)ident(next)operator(;) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(t)operator(\)\);) - reserved(break)operator(;) - operator(}) - ident(tmp) operator(=) ident(tmp)operator(->)ident(next)operator(;) - operator(}) -operator(}) - -preprocessor(#undef) ident(GC_DEBUG) - -directive(void) -ident(rb_global_variable)operator(()ident(var)operator(\)) - ident(VALUE) operator(*)ident(var)operator(;) -operator({) - ident(rb_gc_register_address)operator(()ident(var)operator(\);) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(_MSC_VER)operator(\)) operator(||) ident(defined)operator(()ident(__BORLANDC__)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN__)operator(\)) -preprocessor(#pragma) ident(pack)operator(()ident(push)operator(,) integer(1)operator(\)) comment(/* magic for reducing sizeof(RVALUE\): 24 -> 20 */) -preprocessor(#endif) - -reserved(typedef) reserved(struct) ident(RVALUE) operator({) - reserved(union) operator({) - reserved(struct) operator({) - pre_type(unsigned) pre_type(long) ident(flags)operator(;) comment(/* always 0 for freed obj */) - reserved(struct) ident(RVALUE) operator(*)ident(next)operator(;) - operator(}) ident(free)operator(;) - reserved(struct) ident(RBasic) ident(basic)operator(;) - reserved(struct) ident(RObject) ident(object)operator(;) - reserved(struct) ident(RClass) ident(klass)operator(;) - reserved(struct) ident(RFloat) ident(flonum)operator(;) - reserved(struct) ident(RString) ident(string)operator(;) - reserved(struct) ident(RArray) ident(array)operator(;) - reserved(struct) ident(RRegexp) ident(regexp)operator(;) - reserved(struct) ident(RHash) ident(hash)operator(;) - reserved(struct) ident(RData) ident(data)operator(;) - reserved(struct) ident(RStruct) ident(rstruct)operator(;) - reserved(struct) ident(RBignum) ident(bignum)operator(;) - reserved(struct) ident(RFile) ident(file)operator(;) - reserved(struct) ident(RNode) ident(node)operator(;) - reserved(struct) ident(RMatch) ident(match)operator(;) - reserved(struct) ident(RVarmap) ident(varmap)operator(;) - reserved(struct) ident(SCOPE) ident(scope)operator(;) - operator(}) ident(as)operator(;) -preprocessor(#ifdef) ident(GC_DEBUG) - pre_type(char) operator(*)ident(file)operator(;) - pre_type(int) ident(line)operator(;) -preprocessor(#endif) -operator(}) ident(RVALUE)operator(;) - -preprocessor(#if) ident(defined)operator(()ident(_MSC_VER)operator(\)) operator(||) ident(defined)operator(()ident(__BORLANDC__)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN__)operator(\)) -preprocessor(#pragma) ident(pack)operator(()ident(pop)operator(\)) -preprocessor(#endif) - -directive(static) ident(RVALUE) operator(*)ident(freelist) operator(=) integer(0)operator(;) -directive(static) ident(RVALUE) operator(*)ident(deferred_final_list) operator(=) integer(0)operator(;) - -preprocessor(#define) ident(HEAPS_INCREMENT) integer(10) -directive(static) reserved(struct) ident(heaps_slot) operator({) - directive(void) operator(*)ident(membase)operator(;) - ident(RVALUE) operator(*)ident(slot)operator(;) - pre_type(int) ident(limit)operator(;) -operator(}) operator(*)ident(heaps)operator(;) -directive(static) pre_type(int) ident(heaps_length) operator(=) integer(0)operator(;) -directive(static) pre_type(int) ident(heaps_used) operator(=) integer(0)operator(;) - -preprocessor(#define) ident(HEAP_MIN_SLOTS) integer(10000) -directive(static) pre_type(int) ident(heap_slots) operator(=) ident(HEAP_MIN_SLOTS)operator(;) - -preprocessor(#define) ident(FREE_MIN) integer(4096) - -directive(static) ident(RVALUE) operator(*)ident(himem)operator(,) operator(*)ident(lomem)operator(;) - -directive(static) directive(void) -ident(add_heap)operator((\)) -operator({) - ident(RVALUE) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - - reserved(if) operator(()ident(heaps_used) operator(==) ident(heaps_length)operator(\)) operator({) - comment(/* Realloc heaps */) - reserved(struct) ident(heaps_slot) operator(*)ident(p)operator(;) - pre_type(int) ident(length)operator(;) - - ident(heaps_length) operator(+=) ident(HEAPS_INCREMENT)operator(;) - ident(length) operator(=) ident(heaps_length)operator(*)reserved(sizeof)operator(()reserved(struct) ident(heaps_slot)operator(\);) - ident(RUBY_CRITICAL)operator(() - reserved(if) operator(()ident(heaps_used) operator(>) integer(0)operator(\)) operator({) - ident(p) operator(=) operator(()reserved(struct) ident(heaps_slot) operator(*\))ident(realloc)operator(()ident(heaps)operator(,) ident(length)operator(\);) - reserved(if) operator(()ident(p)operator(\)) ident(heaps) operator(=) ident(p)operator(;) - operator(}) - reserved(else) operator({) - ident(p) operator(=) ident(heaps) operator(=) operator(()reserved(struct) ident(heaps_slot) operator(*\))ident(malloc)operator(()ident(length)operator(\);) - operator(}\);) - reserved(if) operator(()ident(p) operator(==) integer(0)operator(\)) ident(rb_memerror)operator((\);) - operator(}) - - reserved(for) operator((;;\)) operator({) - ident(RUBY_CRITICAL)operator(()ident(p) operator(=) operator(()ident(RVALUE)operator(*\))ident(malloc)operator(()reserved(sizeof)operator(()ident(RVALUE)operator(\)*()ident(heap_slots)operator(+)integer(1)operator(\)\)\);) - reserved(if) operator(()ident(p) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(heap_slots) operator(==) ident(HEAP_MIN_SLOTS)operator(\)) operator({) - ident(rb_memerror)operator((\);) - operator(}) - ident(heap_slots) operator(=) ident(HEAP_MIN_SLOTS)operator(;) - reserved(continue)operator(;) - operator(}) - ident(heaps)operator([)ident(heaps_used)operator(])operator(.)ident(membase) operator(=) ident(p)operator(;) - reserved(if) operator((()ident(VALUE)operator(\))ident(p) operator(%) reserved(sizeof)operator(()ident(RVALUE)operator(\)) operator(==) integer(0)operator(\)) - ident(heap_slots) operator(+=) integer(1)operator(;) - reserved(else) - ident(p) operator(=) operator(()ident(RVALUE)operator(*\)(()ident(VALUE)operator(\))ident(p) operator(+) reserved(sizeof)operator(()ident(RVALUE)operator(\)) operator(-) operator((()ident(VALUE)operator(\))ident(p) operator(%) reserved(sizeof)operator(()ident(RVALUE)operator(\)\)\);) - ident(heaps)operator([)ident(heaps_used)operator(])operator(.)ident(slot) operator(=) ident(p)operator(;) - ident(heaps)operator([)ident(heaps_used)operator(])operator(.)ident(limit) operator(=) ident(heap_slots)operator(;) - reserved(break)operator(;) - operator(}) - ident(pend) operator(=) ident(p) operator(+) ident(heap_slots)operator(;) - reserved(if) operator(()ident(lomem) operator(==) integer(0) operator(||) ident(lomem) operator(>) ident(p)operator(\)) ident(lomem) operator(=) ident(p)operator(;) - reserved(if) operator(()ident(himem) operator(<) ident(pend)operator(\)) ident(himem) operator(=) ident(pend)operator(;) - ident(heaps_used)operator(++;) - ident(heap_slots) operator(*=) float(1)float(.8)operator(;) - reserved(if) operator(()ident(heap_slots) operator(<=) integer(0)operator(\)) ident(heap_slots) operator(=) ident(HEAP_MIN_SLOTS)operator(;) - - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(flags) operator(=) integer(0)operator(;) - ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(next) operator(=) ident(freelist)operator(;) - ident(freelist) operator(=) ident(p)operator(;) - ident(p)operator(++;) - operator(}) -operator(}) -preprocessor(#define) ident(RANY)operator(()ident(o)operator(\)) operator((()ident(RVALUE)operator(*\)()ident(o)operator(\)\)) - -pre_type(int) -ident(rb_during_gc)operator((\)) -operator({) - reserved(return) ident(during_gc)operator(;) -operator(}) - -ident(VALUE) -ident(rb_newobj)operator((\)) -operator({) - ident(VALUE) ident(obj)operator(;) - - reserved(if) operator(()ident(during_gc)operator(\)) - ident(rb_bug)operator(()stringoperator(\);) - - reserved(if) operator((!)ident(freelist)operator(\)) ident(garbage_collect)operator((\);) - - ident(obj) operator(=) operator(()ident(VALUE)operator(\))ident(freelist)operator(;) - ident(freelist) operator(=) ident(freelist)operator(->)ident(as)operator(.)ident(free)operator(.)ident(next)operator(;) - ident(MEMZERO)operator((()directive(void)operator(*\))ident(obj)operator(,) ident(RVALUE)operator(,) integer(1)operator(\);) -preprocessor(#ifdef) ident(GC_DEBUG) - ident(RANY)operator(()ident(obj)operator(\)->)ident(file) operator(=) ident(ruby_sourcefile)operator(;) - ident(RANY)operator(()ident(obj)operator(\)->)ident(line) operator(=) ident(ruby_sourceline)operator(;) -preprocessor(#endif) - reserved(return) ident(obj)operator(;) -operator(}) - -ident(VALUE) -ident(rb_data_object_alloc)operator(()ident(klass)operator(,) ident(datap)operator(,) ident(dmark)operator(,) ident(dfree)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(void) operator(*)ident(datap)operator(;) - ident(RUBY_DATA_FUNC) ident(dmark)operator(;) - ident(RUBY_DATA_FUNC) ident(dfree)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(data)operator(,) reserved(struct) ident(RData)operator(\);) - reserved(if) operator(()ident(klass)operator(\)) ident(Check_Type)operator(()ident(klass)operator(,) ident(T_CLASS)operator(\);) - ident(OBJSETUP)operator(()ident(data)operator(,) ident(klass)operator(,) ident(T_DATA)operator(\);) - ident(data)operator(->)ident(data) operator(=) ident(datap)operator(;) - ident(data)operator(->)ident(dfree) operator(=) ident(dfree)operator(;) - ident(data)operator(->)ident(dmark) operator(=) ident(dmark)operator(;) - - reserved(return) operator(()ident(VALUE)operator(\))ident(data)operator(;) -operator(}) - -directive(extern) ident(st_table) operator(*)ident(rb_class_tbl)operator(;) -ident(VALUE) operator(*)ident(rb_gc_stack_start) operator(=) integer(0)operator(;) -preprocessor(#ifdef) ident(__ia64) -ident(VALUE) operator(*)ident(rb_gc_register_stack_start) operator(=) integer(0)operator(;) -preprocessor(#endif) - -preprocessor(#ifdef) ident(DJGPP) -comment(/* set stack size (http://www.delorie.com/djgpp/v2faq/faq15_9.html\) */) -pre_type(unsigned) pre_type(int) ident(_stklen) operator(=) hex(0x180000)operator(;) comment(/* 1.5 kB */) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(DJGPP)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32_WCE)operator(\)) -directive(static) pre_type(unsigned) pre_type(int) ident(STACK_LEVEL_MAX) operator(=) integer(65535)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(__human68k__)operator(\)) -pre_type(unsigned) pre_type(int) ident(_stacksize) operator(=) integer(262144)operator(;) -preprocessor(# define) ident(STACK_LEVEL_MAX) operator(()ident(_stacksize) operator(-) integer(4096)operator(\)) -preprocessor(# undef) ident(HAVE_GETRLIMIT) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_GETRLIMIT)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) -directive(static) ident(size_t) ident(STACK_LEVEL_MAX) operator(=) integer(655300)operator(;) -preprocessor(#else) -preprocessor(# define) ident(STACK_LEVEL_MAX) integer(655300) -preprocessor(#endif) - -preprocessor(#ifdef) ident(C_ALLOCA) -preprocessor(# define) ident(SET_STACK_END) ident(VALUE) ident(stack_end)operator(;) ident(alloca)operator(()integer(0)operator(\);) -preprocessor(# define) ident(STACK_END) operator((&)ident(stack_end)operator(\)) -preprocessor(#else) -preprocessor(# if) ident(defined)operator(()ident(__GNUC__)operator(\)) operator(&&) ident(defined)operator(()ident(USE_BUILTIN_FRAME_ADDRESS)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__ia64)operator(\)) -preprocessor(# if) operator(() ident(__GNUC__) operator(==) integer(3) operator(&&) ident(__GNUC_MINOR__) operator(>) integer(0) operator(\)) operator(||) ident(__GNUC__) operator(>) integer(3) -ident(__attribute__) operator((()ident(noinline)operator(\)\)) -preprocessor(# endif) -directive(static) directive(void) -ident(stack_end_address)operator(()ident(VALUE) operator(**)ident(stack_end_p)operator(\)) -operator({) - ident(VALUE) ident(stack_end)operator(;) - operator(*)ident(stack_end_p) operator(=) operator(&)ident(stack_end)operator(;) -operator(}) -preprocessor(# define) ident(SET_STACK_END) ident(VALUE) operator(*)ident(stack_end)operator(;) ident(stack_end_address)operator((&)ident(stack_end)operator(\)) -preprocessor(# else) -preprocessor(# define) ident(SET_STACK_END) ident(VALUE) operator(*)ident(stack_end) operator(=) ident(alloca)operator(()integer(1)operator(\)) -preprocessor(# endif) -preprocessor(# define) ident(STACK_END) operator(()ident(stack_end)operator(\)) -preprocessor(#endif) -preprocessor(#if) ident(STACK_GROW_DIRECTION) operator(<) integer(0) -preprocessor(# define) ident(STACK_LENGTH) operator(()ident(rb_gc_stack_start) operator(-) ident(STACK_END)operator(\)) -preprocessor(#elif) ident(STACK_GROW_DIRECTION) operator(>) integer(0) -preprocessor(# define) ident(STACK_LENGTH) operator(()ident(STACK_END) operator(-) ident(rb_gc_stack_start) operator(+) integer(1)operator(\)) -preprocessor(#else) -preprocessor(# define) ident(STACK_LENGTH) operator((()ident(STACK_END) operator(<) ident(rb_gc_stack_start)operator(\)) operator(?) ident(rb_gc_stack_start) operator(-) ident(STACK_END)\ - operator(:) ident(STACK_END) operator(-) ident(rb_gc_stack_start) operator(+) integer(1)operator(\)) -preprocessor(#endif) -preprocessor(#if) ident(STACK_GROW_DIRECTION) operator(>) integer(0) -preprocessor(# define) ident(STACK_UPPER)operator(()ident(x)operator(,) ident(a)operator(,) ident(b)operator(\)) ident(a) -preprocessor(#elif) ident(STACK_GROW_DIRECTION) operator(<) integer(0) -preprocessor(# define) ident(STACK_UPPER)operator(()ident(x)operator(,) ident(a)operator(,) ident(b)operator(\)) ident(b) -preprocessor(#else) -directive(static) pre_type(int) ident(grow_direction)operator(;) -directive(static) pre_type(int) -ident(stack_grow_direction)operator(()ident(addr)operator(\)) - ident(VALUE) operator(*)ident(addr)operator(;) -operator({) - ident(SET_STACK_END)operator(;) - - reserved(if) operator(()ident(STACK_END) operator(>) ident(addr)operator(\)) reserved(return) ident(grow_direction) operator(=) integer(1)operator(;) - reserved(return) ident(grow_direction) operator(=) operator(-)integer(1)operator(;) -operator(}) -preprocessor(# define) ident(stack_growup_p)operator(()ident(x)operator(\)) operator((()ident(grow_direction) operator(?) ident(grow_direction) operator(:) ident(stack_grow_direction)operator(()ident(x)operator(\)\)) operator(>) integer(0)operator(\)) -preprocessor(# define) ident(STACK_UPPER)operator(()ident(x)operator(,) ident(a)operator(,) ident(b)operator(\)) operator(()ident(stack_growup_p)operator(()ident(x)operator(\)) operator(?) ident(a) operator(:) ident(b)operator(\)) -preprocessor(#endif) - -preprocessor(#define) ident(GC_WATER_MARK) integer(512) - -preprocessor(#define) ident(CHECK_STACK)operator(()ident(ret)operator(\)) reserved(do) operator({)\ - ident(SET_STACK_END)operator(;)\ - operator(()ident(ret)operator(\)) operator(=) operator(()ident(STACK_LENGTH) operator(>) ident(STACK_LEVEL_MAX) operator(+) ident(GC_WATER_MARK)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -ident(size_t) -ident(ruby_stack_length)operator(()ident(p)operator(\)) - ident(VALUE) operator(**)ident(p)operator(;) -operator({) - ident(SET_STACK_END)operator(;) - reserved(if) operator(()ident(p)operator(\)) operator(*)ident(p) operator(=) ident(STACK_UPPER)operator(()ident(STACK_END)operator(,) ident(rb_gc_stack_start)operator(,) ident(STACK_END)operator(\);) - reserved(return) ident(STACK_LENGTH)operator(;) -operator(}) - -pre_type(int) -ident(ruby_stack_check)operator((\)) -operator({) - pre_type(int) ident(ret)operator(;) - - ident(CHECK_STACK)operator(()ident(ret)operator(\);) - reserved(return) ident(ret)operator(;) -operator(}) - -preprocessor(#define) ident(MARK_STACK_MAX) integer(1024) -directive(static) ident(VALUE) ident(mark_stack)operator([)ident(MARK_STACK_MAX)operator(];) -directive(static) ident(VALUE) operator(*)ident(mark_stack_ptr)operator(;) -directive(static) pre_type(int) ident(mark_stack_overflow)operator(;) - -directive(static) directive(void) -ident(init_mark_stack)operator((\)) -operator({) - ident(mark_stack_overflow) operator(=) integer(0)operator(;) - ident(mark_stack_ptr) operator(=) ident(mark_stack)operator(;) -operator(}) - -preprocessor(#define) ident(MARK_STACK_EMPTY) operator(()ident(mark_stack_ptr) operator(==) ident(mark_stack)operator(\)) - -directive(static) ident(st_table) operator(*)ident(source_filenames)operator(;) - -pre_type(char) operator(*) -ident(rb_source_filename)operator(()ident(f)operator(\)) - directive(const) pre_type(char) operator(*)ident(f)operator(;) -operator({) - ident(st_data_t) ident(name)operator(;) - - reserved(if) operator((!)ident(st_lookup)operator(()ident(source_filenames)operator(,) operator(()ident(st_data_t)operator(\))ident(f)operator(,) operator(&)ident(name)operator(\)\)) operator({) - pre_type(long) ident(len) operator(=) ident(strlen)operator(()ident(f)operator(\)) operator(+) integer(1)operator(;) - pre_type(char) operator(*)ident(ptr) operator(=) ident(ALLOC_N)operator(()pre_type(char)operator(,) ident(len) operator(+) integer(1)operator(\);) - ident(name) operator(=) operator(()ident(st_data_t)operator(\))ident(ptr)operator(;) - operator(*)ident(ptr)operator(++) operator(=) integer(0)operator(;) - ident(MEMCPY)operator(()ident(ptr)operator(,) ident(f)operator(,) pre_type(char)operator(,) ident(len)operator(\);) - ident(st_add_direct)operator(()ident(source_filenames)operator(,) operator(()ident(st_data_t)operator(\))ident(ptr)operator(,) ident(name)operator(\);) - reserved(return) ident(ptr)operator(;) - operator(}) - reserved(return) operator(()pre_type(char) operator(*\))ident(name) operator(+) integer(1)operator(;) -operator(}) - -directive(static) directive(void) -ident(mark_source_filename)operator(()ident(f)operator(\)) - pre_type(char) operator(*)ident(f)operator(;) -operator({) - reserved(if) operator(()ident(f)operator(\)) operator({) - ident(f)operator([-)integer(1)operator(]) operator(=) integer(1)operator(;) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(sweep_source_filename)operator(()ident(key)operator(,) ident(value)operator(\)) - pre_type(char) operator(*)ident(key)operator(,) operator(*)ident(value)operator(;) -operator({) - reserved(if) operator((*)ident(value)operator(\)) operator({) - operator(*)ident(value) operator(=) integer(0)operator(;) - reserved(return) ident(ST_CONTINUE)operator(;) - operator(}) - reserved(else) operator({) - ident(free)operator(()ident(value)operator(\);) - reserved(return) ident(ST_DELETE)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) ident(gc_mark) ident(_)operator((()ident(VALUE) ident(ptr)operator(,) pre_type(int) ident(lev)operator(\)\);) -directive(static) directive(void) ident(gc_mark_children) ident(_)operator((()ident(VALUE) ident(ptr)operator(,) pre_type(int) ident(lev)operator(\)\);) - -directive(static) directive(void) -ident(gc_mark_all)operator((\)) -operator({) - ident(RVALUE) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - pre_type(int) ident(i)operator(;) - - ident(init_mark_stack)operator((\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(heaps_used)operator(;) ident(i)operator(++\)) operator({) - ident(p) operator(=) ident(heaps)operator([)ident(i)operator(])operator(.)ident(slot)operator(;) ident(pend) operator(=) ident(p) operator(+) ident(heaps)operator([)ident(i)operator(])operator(.)ident(limit)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator((()ident(p)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(&) ident(FL_MARK)operator(\)) operator(&&) - operator(()ident(p)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(!=) ident(FL_MARK)operator(\)\)) operator({) - ident(gc_mark_children)operator((()ident(VALUE)operator(\))ident(p)operator(,) integer(0)operator(\);) - operator(}) - ident(p)operator(++;) - operator(}) - operator(}) -operator(}) - -directive(static) directive(void) -ident(gc_mark_rest)operator((\)) -operator({) - ident(VALUE) ident(tmp_arry)operator([)ident(MARK_STACK_MAX)operator(];) - ident(VALUE) operator(*)ident(p)operator(;) - - ident(p) operator(=) operator(()ident(mark_stack_ptr) operator(-) ident(mark_stack)operator(\)) operator(+) ident(tmp_arry)operator(;) - ident(MEMCPY)operator(()ident(tmp_arry)operator(,) ident(mark_stack)operator(,) ident(VALUE)operator(,) ident(MARK_STACK_MAX)operator(\);) - - ident(init_mark_stack)operator((\);) - reserved(while)operator(()ident(p) operator(!=) ident(tmp_arry)operator(\){) - ident(p)operator(--;) - ident(gc_mark_children)operator((*)ident(p)operator(,) integer(0)operator(\);) - operator(}) -operator(}) - -directive(static) directive(inline) pre_type(int) -ident(is_pointer_to_heap)operator(()ident(ptr)operator(\)) - directive(void) operator(*)ident(ptr)operator(;) -operator({) - directive(register) ident(RVALUE) operator(*)ident(p) operator(=) ident(RANY)operator(()ident(ptr)operator(\);) - directive(register) ident(RVALUE) operator(*)ident(heap_org)operator(;) - directive(register) pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(p) operator(<) ident(lomem) operator(||) ident(p) operator(>) ident(himem)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator((()ident(VALUE)operator(\))ident(p) operator(%) reserved(sizeof)operator(()ident(RVALUE)operator(\)) operator(!=) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - - comment(/* check if p looks like a pointer */) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(heaps_used)operator(;) ident(i)operator(++\)) operator({) - ident(heap_org) operator(=) ident(heaps)operator([)ident(i)operator(])operator(.)ident(slot)operator(;) - reserved(if) operator(()ident(heap_org) operator(<=) ident(p) operator(&&) ident(p) operator(<) ident(heap_org) operator(+) ident(heaps)operator([)ident(i)operator(])operator(.)ident(limit)operator(\)) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) directive(void) -ident(mark_locations_array)operator(()ident(x)operator(,) ident(n)operator(\)) - directive(register) ident(VALUE) operator(*)ident(x)operator(;) - directive(register) pre_type(long) ident(n)operator(;) -operator({) - ident(VALUE) ident(v)operator(;) - reserved(while) operator(()ident(n)operator(--\)) operator({) - ident(v) operator(=) operator(*)ident(x)operator(;) - reserved(if) operator(()ident(is_pointer_to_heap)operator((()directive(void) operator(*\))ident(v)operator(\)\)) operator({) - ident(gc_mark)operator(()ident(v)operator(,) integer(0)operator(\);) - operator(}) - ident(x)operator(++;) - operator(}) -operator(}) - -directive(void) -ident(rb_gc_mark_locations)operator(()ident(start)operator(,) ident(end)operator(\)) - ident(VALUE) operator(*)ident(start)operator(,) operator(*)ident(end)operator(;) -operator({) - pre_type(long) ident(n)operator(;) - - ident(n) operator(=) ident(end) operator(-) ident(start)operator(;) - ident(mark_locations_array)operator(()ident(start)operator(,)ident(n)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(mark_entry)operator(()ident(key)operator(,) ident(value)operator(,) ident(lev)operator(\)) - ident(ID) ident(key)operator(;) - ident(VALUE) ident(value)operator(;) - pre_type(int) ident(lev)operator(;) -operator({) - ident(gc_mark)operator(()ident(value)operator(,) ident(lev)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) directive(void) -ident(mark_tbl)operator(()ident(tbl)operator(,) ident(lev)operator(\)) - ident(st_table) operator(*)ident(tbl)operator(;) - pre_type(int) ident(lev)operator(;) -operator({) - reserved(if) operator((!)ident(tbl)operator(\)) reserved(return)operator(;) - ident(st_foreach)operator(()ident(tbl)operator(,) ident(mark_entry)operator(,) ident(lev)operator(\);) -operator(}) - -directive(void) -ident(rb_mark_tbl)operator(()ident(tbl)operator(\)) - ident(st_table) operator(*)ident(tbl)operator(;) -operator({) - ident(mark_tbl)operator(()ident(tbl)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(mark_key)operator(()ident(key)operator(,) ident(value)operator(,) ident(lev)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) - pre_type(int) ident(lev)operator(;) -operator({) - ident(gc_mark)operator(()ident(key)operator(,) ident(lev)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) directive(void) -ident(mark_set)operator(()ident(tbl)operator(,) ident(lev)operator(\)) - ident(st_table) operator(*)ident(tbl)operator(;) - pre_type(int) ident(lev)operator(;) -operator({) - reserved(if) operator((!)ident(tbl)operator(\)) reserved(return)operator(;) - ident(st_foreach)operator(()ident(tbl)operator(,) ident(mark_key)operator(,) ident(lev)operator(\);) -operator(}) - -directive(void) -ident(rb_mark_set)operator(()ident(tbl)operator(\)) - ident(st_table) operator(*)ident(tbl)operator(;) -operator({) - ident(mark_set)operator(()ident(tbl)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(mark_keyvalue)operator(()ident(key)operator(,) ident(value)operator(,) ident(lev)operator(\)) - ident(VALUE) ident(key)operator(;) - ident(VALUE) ident(value)operator(;) - pre_type(int) ident(lev)operator(;) -operator({) - ident(gc_mark)operator(()ident(key)operator(,) ident(lev)operator(\);) - ident(gc_mark)operator(()ident(value)operator(,) ident(lev)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) directive(void) -ident(mark_hash)operator(()ident(tbl)operator(,) ident(lev)operator(\)) - ident(st_table) operator(*)ident(tbl)operator(;) - pre_type(int) ident(lev)operator(;) -operator({) - reserved(if) operator((!)ident(tbl)operator(\)) reserved(return)operator(;) - ident(st_foreach)operator(()ident(tbl)operator(,) ident(mark_keyvalue)operator(,) ident(lev)operator(\);) -operator(}) - -directive(void) -ident(rb_mark_hash)operator(()ident(tbl)operator(\)) - ident(st_table) operator(*)ident(tbl)operator(;) -operator({) - ident(mark_hash)operator(()ident(tbl)operator(,) integer(0)operator(\);) -operator(}) - -directive(void) -ident(rb_gc_mark_maybe)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(is_pointer_to_heap)operator((()directive(void) operator(*\))ident(obj)operator(\)\)) operator({) - ident(gc_mark)operator(()ident(obj)operator(,) integer(0)operator(\);) - operator(}) -operator(}) - -preprocessor(#define) ident(GC_LEVEL_MAX) integer(250) - -directive(static) directive(void) -ident(gc_mark)operator(()ident(ptr)operator(,) ident(lev)operator(\)) - ident(VALUE) ident(ptr)operator(;) - pre_type(int) ident(lev)operator(;) -operator({) - directive(register) ident(RVALUE) operator(*)ident(obj)operator(;) - - ident(obj) operator(=) ident(RANY)operator(()ident(ptr)operator(\);) - reserved(if) operator(()ident(rb_special_const_p)operator(()ident(ptr)operator(\)\)) reserved(return)operator(;) comment(/* special const not marked */) - reserved(if) operator(()ident(obj)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(==) integer(0)operator(\)) reserved(return)operator(;) comment(/* free cell */) - reserved(if) operator(()ident(obj)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(&) ident(FL_MARK)operator(\)) reserved(return)operator(;) comment(/* already marked */) - ident(obj)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(|=) ident(FL_MARK)operator(;) - - reserved(if) operator(()ident(lev) operator(>) ident(GC_LEVEL_MAX) operator(||) operator(()ident(lev) operator(==) integer(0) operator(&&) ident(ruby_stack_check)operator((\)\)\)) operator({) - reserved(if) operator((!)ident(mark_stack_overflow)operator(\)) operator({) - reserved(if) operator(()ident(mark_stack_ptr) operator(-) ident(mark_stack) operator(<) ident(MARK_STACK_MAX)operator(\)) operator({) - operator(*)ident(mark_stack_ptr) operator(=) ident(ptr)operator(;) - ident(mark_stack_ptr)operator(++;) - operator(}) - reserved(else) operator({) - ident(mark_stack_overflow) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(return)operator(;) - operator(}) - ident(gc_mark_children)operator(()ident(ptr)operator(,) ident(lev)operator(+)integer(1)operator(\);) -operator(}) - -directive(void) -ident(rb_gc_mark)operator(()ident(ptr)operator(\)) - ident(VALUE) ident(ptr)operator(;) -operator({) - ident(gc_mark)operator(()ident(ptr)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) directive(void) -ident(gc_mark_children)operator(()ident(ptr)operator(,) ident(lev)operator(\)) - ident(VALUE) ident(ptr)operator(;) - pre_type(int) ident(lev)operator(;) -operator({) - directive(register) ident(RVALUE) operator(*)ident(obj) operator(=) ident(RANY)operator(()ident(ptr)operator(\);) - - reserved(goto) ident(marking)operator(;) comment(/* skip */) - - label(again:) - ident(obj) operator(=) ident(RANY)operator(()ident(ptr)operator(\);) - reserved(if) operator(()ident(rb_special_const_p)operator(()ident(ptr)operator(\)\)) reserved(return)operator(;) comment(/* special const not marked */) - reserved(if) operator(()ident(obj)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(==) integer(0)operator(\)) reserved(return)operator(;) comment(/* free cell */) - reserved(if) operator(()ident(obj)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(&) ident(FL_MARK)operator(\)) reserved(return)operator(;) comment(/* already marked */) - ident(obj)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(|=) ident(FL_MARK)operator(;) - - label(marking:) - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_EXIVAR)operator(\)\)) operator({) - ident(rb_mark_generic_ivar)operator(()ident(ptr)operator(\);) - operator(}) - - reserved(switch) operator(()ident(obj)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(&) ident(T_MASK)operator(\)) operator({) - reserved(case) ident(T_NIL)operator(:) - reserved(case) ident(T_FIXNUM)operator(:) - ident(rb_bug)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_NODE)operator(:) - ident(mark_source_filename)operator(()ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(nd_file)operator(\);) - reserved(switch) operator(()ident(nd_type)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(NODE_IF)operator(:) comment(/* 1,2,3 */) - reserved(case) ident(NODE_FOR)operator(:) - reserved(case) ident(NODE_ITER)operator(:) - reserved(case) ident(NODE_CREF)operator(:) - reserved(case) ident(NODE_WHEN)operator(:) - reserved(case) ident(NODE_MASGN)operator(:) - reserved(case) ident(NODE_RESCUE)operator(:) - reserved(case) ident(NODE_RESBODY)operator(:) - reserved(case) ident(NODE_CLASS)operator(:) - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u2)operator(.)ident(node)operator(,) ident(lev)operator(\);) - comment(/* fall through */) - reserved(case) ident(NODE_BLOCK)operator(:) comment(/* 1,3 */) - reserved(case) ident(NODE_ARRAY)operator(:) - reserved(case) ident(NODE_DSTR)operator(:) - reserved(case) ident(NODE_DXSTR)operator(:) - reserved(case) ident(NODE_DREGX)operator(:) - reserved(case) ident(NODE_DREGX_ONCE)operator(:) - reserved(case) ident(NODE_FBODY)operator(:) - reserved(case) ident(NODE_ENSURE)operator(:) - reserved(case) ident(NODE_CALL)operator(:) - reserved(case) ident(NODE_DEFS)operator(:) - reserved(case) ident(NODE_OP_ASGN1)operator(:) - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u1)operator(.)ident(node)operator(,) ident(lev)operator(\);) - comment(/* fall through */) - reserved(case) ident(NODE_SUPER)operator(:) comment(/* 3 */) - reserved(case) ident(NODE_FCALL)operator(:) - reserved(case) ident(NODE_DEFN)operator(:) - reserved(case) ident(NODE_NEWLINE)operator(:) - ident(ptr) operator(=) operator(()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u3)operator(.)ident(node)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(NODE_WHILE)operator(:) comment(/* 1,2 */) - reserved(case) ident(NODE_UNTIL)operator(:) - reserved(case) ident(NODE_AND)operator(:) - reserved(case) ident(NODE_OR)operator(:) - reserved(case) ident(NODE_CASE)operator(:) - reserved(case) ident(NODE_SCLASS)operator(:) - reserved(case) ident(NODE_DOT2)operator(:) - reserved(case) ident(NODE_DOT3)operator(:) - reserved(case) ident(NODE_FLIP2)operator(:) - reserved(case) ident(NODE_FLIP3)operator(:) - reserved(case) ident(NODE_MATCH2)operator(:) - reserved(case) ident(NODE_MATCH3)operator(:) - reserved(case) ident(NODE_OP_ASGN_OR)operator(:) - reserved(case) ident(NODE_OP_ASGN_AND)operator(:) - reserved(case) ident(NODE_MODULE)operator(:) - reserved(case) ident(NODE_ALIAS)operator(:) - reserved(case) ident(NODE_VALIAS)operator(:) - reserved(case) ident(NODE_ARGS)operator(:) - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u1)operator(.)ident(node)operator(,) ident(lev)operator(\);) - comment(/* fall through */) - reserved(case) ident(NODE_METHOD)operator(:) comment(/* 2 */) - reserved(case) ident(NODE_NOT)operator(:) - reserved(case) ident(NODE_GASGN)operator(:) - reserved(case) ident(NODE_LASGN)operator(:) - reserved(case) ident(NODE_DASGN)operator(:) - reserved(case) ident(NODE_DASGN_CURR)operator(:) - reserved(case) ident(NODE_IASGN)operator(:) - reserved(case) ident(NODE_CVDECL)operator(:) - reserved(case) ident(NODE_CVASGN)operator(:) - reserved(case) ident(NODE_COLON3)operator(:) - reserved(case) ident(NODE_OPT_N)operator(:) - reserved(case) ident(NODE_EVSTR)operator(:) - reserved(case) ident(NODE_UNDEF)operator(:) - ident(ptr) operator(=) operator(()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u2)operator(.)ident(node)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(NODE_HASH)operator(:) comment(/* 1 */) - reserved(case) ident(NODE_LIT)operator(:) - reserved(case) ident(NODE_STR)operator(:) - reserved(case) ident(NODE_XSTR)operator(:) - reserved(case) ident(NODE_DEFINED)operator(:) - reserved(case) ident(NODE_MATCH)operator(:) - reserved(case) ident(NODE_RETURN)operator(:) - reserved(case) ident(NODE_BREAK)operator(:) - reserved(case) ident(NODE_NEXT)operator(:) - reserved(case) ident(NODE_YIELD)operator(:) - reserved(case) ident(NODE_COLON2)operator(:) - reserved(case) ident(NODE_SPLAT)operator(:) - reserved(case) ident(NODE_TO_ARY)operator(:) - reserved(case) ident(NODE_SVALUE)operator(:) - ident(ptr) operator(=) operator(()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u1)operator(.)ident(node)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(NODE_SCOPE)operator(:) comment(/* 2,3 */) - reserved(case) ident(NODE_BLOCK_PASS)operator(:) - reserved(case) ident(NODE_CDECL)operator(:) - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u3)operator(.)ident(node)operator(,) ident(lev)operator(\);) - ident(ptr) operator(=) operator(()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u2)operator(.)ident(node)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(NODE_ZARRAY)operator(:) comment(/* - */) - reserved(case) ident(NODE_ZSUPER)operator(:) - reserved(case) ident(NODE_CFUNC)operator(:) - reserved(case) ident(NODE_VCALL)operator(:) - reserved(case) ident(NODE_GVAR)operator(:) - reserved(case) ident(NODE_LVAR)operator(:) - reserved(case) ident(NODE_DVAR)operator(:) - reserved(case) ident(NODE_IVAR)operator(:) - reserved(case) ident(NODE_CVAR)operator(:) - reserved(case) ident(NODE_NTH_REF)operator(:) - reserved(case) ident(NODE_BACK_REF)operator(:) - reserved(case) ident(NODE_REDO)operator(:) - reserved(case) ident(NODE_RETRY)operator(:) - reserved(case) ident(NODE_SELF)operator(:) - reserved(case) ident(NODE_NIL)operator(:) - reserved(case) ident(NODE_TRUE)operator(:) - reserved(case) ident(NODE_FALSE)operator(:) - reserved(case) ident(NODE_ATTRSET)operator(:) - reserved(case) ident(NODE_BLOCK_ARG)operator(:) - reserved(case) ident(NODE_POSTEXE)operator(:) - reserved(break)operator(;) - reserved(case) ident(NODE_ALLOCA)operator(:) - ident(mark_locations_array)operator((()ident(VALUE)operator(*\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u1)operator(.)ident(value)operator(,) - ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u3)operator(.)ident(cnt)operator(\);) - ident(ptr) operator(=) operator(()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u2)operator(.)ident(node)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(default)operator(:) comment(/* unlisted NODE */) - reserved(if) operator(()ident(is_pointer_to_heap)operator(()ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u1)operator(.)ident(node)operator(\)\)) operator({) - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u1)operator(.)ident(node)operator(,) ident(lev)operator(\);) - operator(}) - reserved(if) operator(()ident(is_pointer_to_heap)operator(()ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u2)operator(.)ident(node)operator(\)\)) operator({) - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u2)operator(.)ident(node)operator(,) ident(lev)operator(\);) - operator(}) - reserved(if) operator(()ident(is_pointer_to_heap)operator(()ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u3)operator(.)ident(node)operator(\)\)) operator({) - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(node)operator(.)ident(u3)operator(.)ident(node)operator(,) ident(lev)operator(\);) - operator(}) - operator(}) - reserved(return)operator(;) comment(/* no need to mark class. */) - operator(}) - - ident(gc_mark)operator(()ident(obj)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(klass)operator(,) ident(lev)operator(\);) - reserved(switch) operator(()ident(obj)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(&) ident(T_MASK)operator(\)) operator({) - reserved(case) ident(T_ICLASS)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - ident(mark_tbl)operator(()ident(obj)operator(->)ident(as)operator(.)ident(klass)operator(.)ident(m_tbl)operator(,) ident(lev)operator(\);) - ident(mark_tbl)operator(()ident(obj)operator(->)ident(as)operator(.)ident(klass)operator(.)ident(iv_tbl)operator(,) ident(lev)operator(\);) - ident(ptr) operator(=) ident(obj)operator(->)ident(as)operator(.)ident(klass)operator(.)ident(super)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(T_ARRAY)operator(:) - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(ELTS_SHARED)operator(\)\)) operator({) - ident(ptr) operator(=) ident(obj)operator(->)ident(as)operator(.)ident(array)operator(.)ident(aux)operator(.)ident(shared)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - reserved(else) operator({) - pre_type(long) ident(i)operator(,) ident(len) operator(=) ident(obj)operator(->)ident(as)operator(.)ident(array)operator(.)ident(len)operator(;) - ident(VALUE) operator(*)ident(ptr) operator(=) ident(obj)operator(->)ident(as)operator(.)ident(array)operator(.)ident(ptr)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(gc_mark)operator((*)ident(ptr)operator(++,) ident(lev)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_HASH)operator(:) - ident(mark_hash)operator(()ident(obj)operator(->)ident(as)operator(.)ident(hash)operator(.)ident(tbl)operator(,) ident(lev)operator(\);) - ident(ptr) operator(=) ident(obj)operator(->)ident(as)operator(.)ident(hash)operator(.)ident(ifnone)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(T_STRING)operator(:) -preprocessor(#define) ident(STR_ASSOC) ident(FL_USER3) comment(/* copied from string.c */) - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(ELTS_SHARED)operator(|)ident(STR_ASSOC)operator(\)\)) operator({) - ident(ptr) operator(=) ident(obj)operator(->)ident(as)operator(.)ident(string)operator(.)ident(aux)operator(.)ident(shared)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_DATA)operator(:) - reserved(if) operator(()ident(obj)operator(->)ident(as)operator(.)ident(data)operator(.)ident(dmark)operator(\)) operator((*)ident(obj)operator(->)ident(as)operator(.)ident(data)operator(.)ident(dmark)operator(\)()ident(DATA_PTR)operator(()ident(obj)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(T_OBJECT)operator(:) - ident(mark_tbl)operator(()ident(obj)operator(->)ident(as)operator(.)ident(object)operator(.)ident(iv_tbl)operator(,) ident(lev)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_FILE)operator(:) - reserved(case) ident(T_REGEXP)operator(:) - reserved(case) ident(T_FLOAT)operator(:) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(case) ident(T_BLKTAG)operator(:) - reserved(break)operator(;) - - reserved(case) ident(T_MATCH)operator(:) - reserved(if) operator(()ident(obj)operator(->)ident(as)operator(.)ident(match)operator(.)ident(str)operator(\)) operator({) - ident(ptr) operator(=) ident(obj)operator(->)ident(as)operator(.)ident(match)operator(.)ident(str)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_VARMAP)operator(:) - ident(gc_mark)operator(()ident(obj)operator(->)ident(as)operator(.)ident(varmap)operator(.)ident(val)operator(,) ident(lev)operator(\);) - ident(ptr) operator(=) operator(()ident(VALUE)operator(\))ident(obj)operator(->)ident(as)operator(.)ident(varmap)operator(.)ident(next)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(T_SCOPE)operator(:) - reserved(if) operator(()ident(obj)operator(->)ident(as)operator(.)ident(scope)operator(.)ident(local_vars) operator(&&) operator(()ident(obj)operator(->)ident(as)operator(.)ident(scope)operator(.)ident(flags) operator(&) ident(SCOPE_MALLOC)operator(\)\)) operator({) - pre_type(int) ident(n) operator(=) ident(obj)operator(->)ident(as)operator(.)ident(scope)operator(.)ident(local_tbl)operator([)integer(0)operator(]+)integer(1)operator(;) - ident(VALUE) operator(*)ident(vars) operator(=) operator(&)ident(obj)operator(->)ident(as)operator(.)ident(scope)operator(.)ident(local_vars)operator([-)integer(1)operator(];) - - reserved(while) operator(()ident(n)operator(--\)) operator({) - ident(gc_mark)operator((*)ident(vars)operator(++,) ident(lev)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_STRUCT)operator(:) - operator({) - pre_type(long) ident(len) operator(=) ident(obj)operator(->)ident(as)operator(.)ident(rstruct)operator(.)ident(len)operator(;) - ident(VALUE) operator(*)ident(ptr) operator(=) ident(obj)operator(->)ident(as)operator(.)ident(rstruct)operator(.)ident(ptr)operator(;) - - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(gc_mark)operator((*)ident(ptr)operator(++,) ident(lev)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(rb_bug)operator(()stringoperator(,) - ident(obj)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(&) ident(T_MASK)operator(,) ident(obj)operator(,) - ident(is_pointer_to_heap)operator(()ident(obj)operator(\)) operator(?) string operator(:) stringoperator(\);) - operator(}) -operator(}) - -directive(static) pre_type(int) ident(obj_free) ident(_)operator((()ident(VALUE)operator(\)\);) - -directive(static) directive(inline) directive(void) -ident(add_freelist)operator(()ident(p)operator(\)) - ident(RVALUE) operator(*)ident(p)operator(;) -operator({) - ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(flags) operator(=) integer(0)operator(;) - ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(next) operator(=) ident(freelist)operator(;) - ident(freelist) operator(=) ident(p)operator(;) -operator(}) - -directive(static) directive(void) -ident(finalize_list)operator(()ident(p)operator(\)) - ident(RVALUE) operator(*)ident(p)operator(;) -operator({) - reserved(while) operator(()ident(p)operator(\)) operator({) - ident(RVALUE) operator(*)ident(tmp) operator(=) ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(next)operator(;) - ident(run_final)operator((()ident(VALUE)operator(\))ident(p)operator(\);) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(p)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) comment(/* not freeing page */) - ident(add_freelist)operator(()ident(p)operator(\);) - operator(}) - ident(p) operator(=) ident(tmp)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(free_unused_heaps)operator((\)) -operator({) - pre_type(int) ident(i)operator(,) ident(j)operator(;) - - reserved(for) operator(()ident(i) operator(=) ident(j) operator(=) integer(1)operator(;) ident(j) operator(<) ident(heaps_used)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(heaps)operator([)ident(i)operator(])operator(.)ident(limit) operator(==) integer(0)operator(\)) operator({) - ident(free)operator(()ident(heaps)operator([)ident(i)operator(])operator(.)ident(membase)operator(\);) - ident(heaps_used)operator(--;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(i) operator(!=) ident(j)operator(\)) operator({) - ident(heaps)operator([)ident(j)operator(]) operator(=) ident(heaps)operator([)ident(i)operator(];) - operator(}) - ident(j)operator(++;) - operator(}) - operator(}) -operator(}) - -preprocessor(#define) ident(T_DEFERRED) hex(0x3a) - -directive(void) ident(rb_gc_abort_threads)operator(()directive(void)operator(\);) - -directive(static) directive(void) -ident(gc_sweep)operator((\)) -operator({) - ident(RVALUE) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(,) operator(*)ident(final_list)operator(;) - pre_type(int) ident(freed) operator(=) integer(0)operator(;) - pre_type(int) ident(i)operator(;) - pre_type(unsigned) pre_type(long) ident(live) operator(=) integer(0)operator(;) - pre_type(unsigned) pre_type(long) ident(free_min) operator(=) integer(0)operator(;) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(heaps_used)operator(;) ident(i)operator(++\)) operator({) - ident(free_min) operator(+=) ident(heaps)operator([)ident(i)operator(])operator(.)ident(limit)operator(;) - operator(}) - ident(free_min) operator(=) ident(free_min) operator(*) float(0)float(.2)operator(;) - reserved(if) operator(()ident(free_min) operator(<) ident(FREE_MIN)operator(\)) - ident(free_min) operator(=) ident(FREE_MIN)operator(;) - - reserved(if) operator(()ident(ruby_in_compile) operator(&&) ident(ruby_parser_stack_on_heap)operator((\)\)) operator({) - comment(/* should not reclaim nodes during compilation - if yacc's semantic stack is not allocated on machine stack */) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(heaps_used)operator(;) ident(i)operator(++\)) operator({) - ident(p) operator(=) ident(heaps)operator([)ident(i)operator(])operator(.)ident(slot)operator(;) ident(pend) operator(=) ident(p) operator(+) ident(heaps)operator([)ident(i)operator(])operator(.)ident(limit)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator((!()ident(p)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags)operator(&)ident(FL_MARK)operator(\)) operator(&&) ident(BUILTIN_TYPE)operator(()ident(p)operator(\)) operator(==) ident(T_NODE)operator(\)) - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(p)operator(,) integer(0)operator(\);) - ident(p)operator(++;) - operator(}) - operator(}) - operator(}) - - ident(mark_source_filename)operator(()ident(ruby_sourcefile)operator(\);) - reserved(if) operator(()ident(source_filenames)operator(\)) operator({) - ident(st_foreach)operator(()ident(source_filenames)operator(,) ident(sweep_source_filename)operator(,) integer(0)operator(\);) - operator(}) - - ident(freelist) operator(=) integer(0)operator(;) - ident(final_list) operator(=) ident(deferred_final_list)operator(;) - ident(deferred_final_list) operator(=) integer(0)operator(;) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(heaps_used)operator(;) ident(i)operator(++\)) operator({) - pre_type(int) ident(n) operator(=) integer(0)operator(;) - ident(RVALUE) operator(*)ident(free) operator(=) ident(freelist)operator(;) - ident(RVALUE) operator(*)ident(final) operator(=) ident(final_list)operator(;) - pre_type(int) ident(deferred)operator(;) - - ident(p) operator(=) ident(heaps)operator([)ident(i)operator(])operator(.)ident(slot)operator(;) ident(pend) operator(=) ident(p) operator(+) ident(heaps)operator([)ident(i)operator(])operator(.)ident(limit)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator((!()ident(p)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(&) ident(FL_MARK)operator(\)\)) operator({) - reserved(if) operator(()ident(p)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(&&) - operator((()ident(deferred) operator(=) ident(obj_free)operator((()ident(VALUE)operator(\))ident(p)operator(\)\)) operator(||) - operator((()ident(FL_TEST)operator(()ident(p)operator(,) ident(FL_FINALIZE)operator(\)\)) operator(&&) ident(need_call_final)operator(\)\)\)) operator({) - reserved(if) operator((!)ident(deferred)operator(\)) operator({) - ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(flags) operator(=) ident(T_DEFERRED)operator(;) - ident(RDATA)operator(()ident(p)operator(\)->)ident(dfree) operator(=) integer(0)operator(;) - operator(}) - ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(flags) operator(|=) ident(FL_MARK)operator(;) - ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(next) operator(=) ident(final_list)operator(;) - ident(final_list) operator(=) ident(p)operator(;) - operator(}) - reserved(else) operator({) - ident(add_freelist)operator(()ident(p)operator(\);) - operator(}) - ident(n)operator(++;) - operator(}) - reserved(else) reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(p)operator(\)) operator(==) ident(T_DEFERRED)operator(\)) operator({) - comment(/* objects to be finalized */) - comment(/* do nothing remain marked */) - operator(}) - reserved(else) operator({) - ident(RBASIC)operator(()ident(p)operator(\)->)ident(flags) operator(&=) operator(~)ident(FL_MARK)operator(;) - ident(live)operator(++;) - operator(}) - ident(p)operator(++;) - operator(}) - reserved(if) operator(()ident(n) operator(==) ident(heaps)operator([)ident(i)operator(])operator(.)ident(limit) operator(&&) ident(freed) operator(>) ident(free_min)operator(\)) operator({) - ident(RVALUE) operator(*)ident(pp)operator(;) - - ident(heaps)operator([)ident(i)operator(])operator(.)ident(limit) operator(=) integer(0)operator(;) - reserved(for) operator(()ident(pp) operator(=) ident(final_list)operator(;) ident(pp) operator(!=) ident(final)operator(;) ident(pp) operator(=) ident(pp)operator(->)ident(as)operator(.)ident(free)operator(.)ident(next)operator(\)) operator({) - ident(pp)operator(->)ident(as)operator(.)ident(free)operator(.)ident(flags) operator(|=) ident(FL_SINGLETON)operator(;) comment(/* freeing page mark */) - operator(}) - ident(freelist) operator(=) ident(free)operator(;) comment(/* cancel this page from freelist */) - operator(}) - reserved(else) operator({) - ident(freed) operator(+=) ident(n)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(malloc_increase) operator(>) ident(malloc_limit)operator(\)) operator({) - ident(malloc_limit) operator(+=) operator(()ident(malloc_increase) operator(-) ident(malloc_limit)operator(\)) operator(*) operator(()pre_type(double)operator(\))ident(live) operator(/) operator(()ident(live) operator(+) ident(freed)operator(\);) - reserved(if) operator(()ident(malloc_limit) operator(<) ident(GC_MALLOC_LIMIT)operator(\)) ident(malloc_limit) operator(=) ident(GC_MALLOC_LIMIT)operator(;) - operator(}) - ident(malloc_increase) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(freed) operator(<) ident(free_min)operator(\)) operator({) - ident(add_heap)operator((\);) - operator(}) - ident(during_gc) operator(=) integer(0)operator(;) - - comment(/* clear finalization list */) - reserved(if) operator(()ident(final_list)operator(\)) operator({) - ident(deferred_final_list) operator(=) ident(final_list)operator(;) - ident(rb_thread_pending) operator(=) integer(1)operator(;) - reserved(return)operator(;) - operator(}) - ident(free_unused_heaps)operator((\);) -operator(}) - -directive(void) -ident(rb_gc_force_recycle)operator(()ident(p)operator(\)) - ident(VALUE) ident(p)operator(;) -operator({) - ident(add_freelist)operator((()ident(RVALUE)operator(*\))ident(p)operator(\);) -operator(}) - -directive(static) directive(inline) directive(void) -ident(make_deferred)operator(()ident(p)operator(\)) - ident(RVALUE) operator(*)ident(p)operator(;) -operator({) - ident(p)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(=) operator(()ident(p)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(&) operator(~)ident(T_MASK)operator(\)) operator(|) ident(T_DEFERRED)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(obj_free)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(switch) operator(()ident(BUILTIN_TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_NIL)operator(:) - reserved(case) ident(T_FIXNUM)operator(:) - reserved(case) ident(T_TRUE)operator(:) - reserved(case) ident(T_FALSE)operator(:) - ident(rb_bug)operator(()stringoperator(\);) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_EXIVAR)operator(\)\)) operator({) - ident(rb_free_generic_ivar)operator((()ident(VALUE)operator(\))ident(obj)operator(\);) - operator(}) - - reserved(switch) operator(()ident(BUILTIN_TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_OBJECT)operator(:) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(object)operator(.)ident(iv_tbl)operator(\)) operator({) - ident(st_free_table)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(object)operator(.)ident(iv_tbl)operator(\);) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_MODULE)operator(:) - reserved(case) ident(T_CLASS)operator(:) - ident(rb_clear_cache_by_class)operator((()ident(VALUE)operator(\))ident(obj)operator(\);) - ident(st_free_table)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(klass)operator(.)ident(m_tbl)operator(\);) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(object)operator(.)ident(iv_tbl)operator(\)) operator({) - ident(st_free_table)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(object)operator(.)ident(iv_tbl)operator(\);) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_STRING)operator(:) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(string)operator(.)ident(ptr) operator(&&) operator(!)ident(FL_TEST)operator(()ident(obj)operator(,) ident(ELTS_SHARED)operator(\)\)) operator({) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(string)operator(.)ident(ptr)operator(\)\);) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_ARRAY)operator(:) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(array)operator(.)ident(ptr) operator(&&) operator(!)ident(FL_TEST)operator(()ident(obj)operator(,) ident(ELTS_SHARED)operator(\)\)) operator({) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(array)operator(.)ident(ptr)operator(\)\);) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_HASH)operator(:) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(hash)operator(.)ident(tbl)operator(\)) operator({) - ident(st_free_table)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(hash)operator(.)ident(tbl)operator(\);) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_REGEXP)operator(:) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(regexp)operator(.)ident(ptr)operator(\)) operator({) - ident(re_free_pattern)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(regexp)operator(.)ident(ptr)operator(\);) - operator(}) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(regexp)operator(.)ident(str)operator(\)) operator({) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(regexp)operator(.)ident(str)operator(\)\);) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_DATA)operator(:) - reserved(if) operator(()ident(DATA_PTR)operator(()ident(obj)operator(\)\)) operator({) - reserved(if) operator((()pre_type(long)operator(\))ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(data)operator(.)ident(dfree) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(DATA_PTR)operator(()ident(obj)operator(\)\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(data)operator(.)ident(dfree)operator(\)) operator({) - ident(make_deferred)operator(()ident(RANY)operator(()ident(obj)operator(\)\);) - reserved(return) integer(1)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_MATCH)operator(:) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(match)operator(.)ident(regs)operator(\)) operator({) - ident(re_free_registers)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(match)operator(.)ident(regs)operator(\);) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(match)operator(.)ident(regs)operator(\)\);) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_FILE)operator(:) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(file)operator(.)ident(fptr)operator(\)) operator({) - reserved(struct) ident(rb_io_t) operator(*)ident(fptr) operator(=) ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(file)operator(.)ident(fptr)operator(;) - ident(make_deferred)operator(()ident(RANY)operator(()ident(obj)operator(\)\);) - ident(RDATA)operator(()ident(obj)operator(\)->)ident(dfree) operator(=) operator(()directive(void) operator((*\)()directive(void)operator(*\)\))ident(rb_io_fptr_finalize)operator(;) - ident(RDATA)operator(()ident(obj)operator(\)->)ident(data) operator(=) ident(fptr)operator(;) - reserved(return) integer(1)operator(;) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_ICLASS)operator(:) - comment(/* iClass shares table with the module */) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - reserved(case) ident(T_VARMAP)operator(:) - reserved(case) ident(T_BLKTAG)operator(:) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(bignum)operator(.)ident(digits)operator(\)) operator({) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(bignum)operator(.)ident(digits)operator(\)\);) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_NODE)operator(:) - reserved(switch) operator(()ident(nd_type)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(NODE_SCOPE)operator(:) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(node)operator(.)ident(u1)operator(.)ident(tbl)operator(\)) operator({) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(node)operator(.)ident(u1)operator(.)ident(tbl)operator(\)\);) - operator(}) - reserved(break)operator(;) - reserved(case) ident(NODE_ALLOCA)operator(:) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(node)operator(.)ident(u1)operator(.)ident(node)operator(\)\);) - reserved(break)operator(;) - operator(}) - reserved(break)operator(;) comment(/* no need to free iv_tbl */) - - reserved(case) ident(T_SCOPE)operator(:) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(scope)operator(.)ident(local_vars) operator(&&) - ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(scope)operator(.)ident(flags) operator(!=) ident(SCOPE_ALLOCA)operator(\)) operator({) - ident(VALUE) operator(*)ident(vars) operator(=) ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(scope)operator(.)ident(local_vars)operator(-)integer(1)operator(;) - reserved(if) operator((!()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(scope)operator(.)ident(flags) operator(&) ident(SCOPE_CLONE)operator(\)) operator(&&) ident(vars)operator([)integer(0)operator(]) operator(==) integer(0)operator(\)) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(scope)operator(.)ident(local_tbl)operator(\)\);) - reserved(if) operator((()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(scope)operator(.)ident(flags) operator(&) operator(()ident(SCOPE_MALLOC)operator(|)ident(SCOPE_CLONE)operator(\)\)) operator(==) ident(SCOPE_MALLOC)operator(\)) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(vars)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_STRUCT)operator(:) - reserved(if) operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(rstruct)operator(.)ident(ptr)operator(\)) operator({) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(rstruct)operator(.)ident(ptr)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(rb_bug)operator(()stringoperator(,) - ident(RANY)operator(()ident(obj)operator(\)->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(&) ident(T_MASK)operator(,) ident(obj)operator(\);) - operator(}) - - reserved(return) integer(0)operator(;) -operator(}) - -directive(void) -ident(rb_gc_mark_frame)operator(()ident(frame)operator(\)) - reserved(struct) ident(FRAME) operator(*)ident(frame)operator(;) -operator({) - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(frame)operator(->)ident(node)operator(,) integer(0)operator(\);) -operator(}) - -preprocessor(#ifdef) ident(__GNUC__) -preprocessor(#if) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(DJGPP)operator(\)) -preprocessor(#if) ident(defined)operator(()ident(__human68k__)operator(\)) -reserved(typedef) pre_type(unsigned) pre_type(long) ident(rb_jmp_buf)operator([)integer(8)operator(];) -ident(__asm__) operator(()stringoperator(\);) -preprocessor(#ifdef) ident(setjmp) -preprocessor(#undef) ident(setjmp) -preprocessor(#endif) -preprocessor(#else) -preprocessor(#if) ident(defined)operator(()ident(DJGPP)operator(\)) -reserved(typedef) pre_type(unsigned) pre_type(long) ident(rb_jmp_buf)operator([)integer(6)operator(];) -ident(__asm__) operator(()stringoperator(\);) -preprocessor(#endif) -preprocessor(#endif) -pre_type(int) ident(rb_setjmp) operator(()ident(rb_jmp_buf)operator(\);) -preprocessor(#define) ident(jmp_buf) ident(rb_jmp_buf) -preprocessor(#define) ident(setjmp) ident(rb_setjmp) -preprocessor(#endif) comment(/* __human68k__ or DJGPP */) -preprocessor(#endif) comment(/* __GNUC__ */) - -directive(static) directive(void) -ident(garbage_collect)operator((\)) -operator({) - reserved(struct) ident(gc_list) operator(*)ident(list)operator(;) - reserved(struct) ident(FRAME) operator(*) directive(volatile) ident(frame)operator(;) comment(/* gcc 2.7.2.3 -O2 bug?? */) - ident(jmp_buf) ident(save_regs_gc_mark)operator(;) - ident(SET_STACK_END)operator(;) - -preprocessor(#ifdef) ident(HAVE_NATIVETHREAD) - reserved(if) operator((!)ident(is_ruby_native_thread)operator((\)\)) operator({) - ident(rb_bug)operator(()stringoperator(\);) - operator(}) -preprocessor(#endif) - reserved(if) operator(()ident(dont_gc) operator(||) ident(during_gc)operator(\)) operator({) - reserved(if) operator((!)ident(freelist)operator(\)) operator({) - ident(add_heap)operator((\);) - operator(}) - reserved(return)operator(;) - operator(}) - reserved(if) operator(()ident(during_gc)operator(\)) reserved(return)operator(;) - ident(during_gc)operator(++;) - - ident(init_mark_stack)operator((\);) - - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(ruby_current_node)operator(,) integer(0)operator(\);) - - comment(/* mark frame stack */) - reserved(for) operator(()ident(frame) operator(=) ident(ruby_frame)operator(;) ident(frame)operator(;) ident(frame) operator(=) ident(frame)operator(->)ident(prev)operator(\)) operator({) - ident(rb_gc_mark_frame)operator(()ident(frame)operator(\);) - reserved(if) operator(()ident(frame)operator(->)ident(tmp)operator(\)) operator({) - reserved(struct) ident(FRAME) operator(*)ident(tmp) operator(=) ident(frame)operator(->)ident(tmp)operator(;) - reserved(while) operator(()ident(tmp)operator(\)) operator({) - ident(rb_gc_mark_frame)operator(()ident(tmp)operator(\);) - ident(tmp) operator(=) ident(tmp)operator(->)ident(prev)operator(;) - operator(}) - operator(}) - operator(}) - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(ruby_scope)operator(,) integer(0)operator(\);) - ident(gc_mark)operator((()ident(VALUE)operator(\))ident(ruby_dyna_vars)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(finalizer_table)operator(\)) operator({) - ident(mark_tbl)operator(()ident(finalizer_table)operator(,) integer(0)operator(\);) - operator(}) - - ident(FLUSH_REGISTER_WINDOWS)operator(;) - comment(/* This assumes that all registers are saved into the jmp_buf (and stack\) */) - ident(setjmp)operator(()ident(save_regs_gc_mark)operator(\);) - ident(mark_locations_array)operator((()ident(VALUE)operator(*\))ident(save_regs_gc_mark)operator(,) reserved(sizeof)operator(()ident(save_regs_gc_mark)operator(\)) operator(/) reserved(sizeof)operator(()ident(VALUE) operator(*\)\);) -preprocessor(#if) ident(STACK_GROW_DIRECTION) operator(<) integer(0) - ident(rb_gc_mark_locations)operator((()ident(VALUE)operator(*\))ident(STACK_END)operator(,) ident(rb_gc_stack_start)operator(\);) -preprocessor(#elif) ident(STACK_GROW_DIRECTION) operator(>) integer(0) - ident(rb_gc_mark_locations)operator(()ident(rb_gc_stack_start)operator(,) operator(()ident(VALUE)operator(*\))ident(STACK_END) operator(+) integer(1)operator(\);) -preprocessor(#else) - reserved(if) operator((()ident(VALUE)operator(*\))ident(STACK_END) operator(<) ident(rb_gc_stack_start)operator(\)) - ident(rb_gc_mark_locations)operator((()ident(VALUE)operator(*\))ident(STACK_END)operator(,) ident(rb_gc_stack_start)operator(\);) - reserved(else) - ident(rb_gc_mark_locations)operator(()ident(rb_gc_stack_start)operator(,) operator(()ident(VALUE)operator(*\))ident(STACK_END) operator(+) integer(1)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(__ia64) - comment(/* mark backing store (flushed register window on the stack\) */) - comment(/* the basic idea from guile GC code */) - ident(rb_gc_mark_locations)operator(()ident(rb_gc_register_stack_start)operator(,) operator(()ident(VALUE)operator(*\))ident(rb_ia64_bsp)operator((\)\);) -preprocessor(#endif) -preprocessor(#if) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__mc68000__)operator(\)) - ident(rb_gc_mark_locations)operator((()ident(VALUE)operator(*\)(()pre_type(char)operator(*\))ident(STACK_END) operator(+) integer(2)operator(\),) - operator(()ident(VALUE)operator(*\)(()pre_type(char)operator(*\))ident(rb_gc_stack_start) operator(+) integer(2)operator(\)\);) -preprocessor(#endif) - ident(rb_gc_mark_threads)operator((\);) - - comment(/* mark protected global variables */) - reserved(for) operator(()ident(list) operator(=) ident(global_List)operator(;) ident(list)operator(;) ident(list) operator(=) ident(list)operator(->)ident(next)operator(\)) operator({) - ident(rb_gc_mark_maybe)operator((*)ident(list)operator(->)ident(varptr)operator(\);) - operator(}) - ident(rb_mark_end_proc)operator((\);) - ident(rb_gc_mark_global_tbl)operator((\);) - - ident(rb_mark_tbl)operator(()ident(rb_class_tbl)operator(\);) - ident(rb_gc_mark_trap_list)operator((\);) - - comment(/* mark generic instance variables for special constants */) - ident(rb_mark_generic_ivar_tbl)operator((\);) - - ident(rb_gc_mark_parser)operator((\);) - - comment(/* gc_mark objects whose marking are not completed*/) - reserved(do) operator({) - reserved(while) operator((!)ident(MARK_STACK_EMPTY)operator(\)) operator({) - reserved(if) operator(()ident(mark_stack_overflow)operator(\){) - ident(gc_mark_all)operator((\);) - operator(}) - reserved(else) operator({) - ident(gc_mark_rest)operator((\);) - operator(}) - operator(}) - ident(rb_gc_abort_threads)operator((\);) - operator(}) reserved(while) operator((!)ident(MARK_STACK_EMPTY)operator(\);) - - ident(gc_sweep)operator((\);) -operator(}) - -directive(void) -ident(rb_gc)operator((\)) -operator({) - ident(garbage_collect)operator((\);) - ident(rb_gc_finalize_deferred)operator((\);) -operator(}) - -comment(/* - * call-seq: - * GC.start => nil - * gc.garbage_collect => nil - * ObjectSpace.garbage_collect => nil - * - * Initiates garbage collection, unless manually disabled. - * - */) - -ident(VALUE) -ident(rb_gc_start)operator((\)) -operator({) - ident(rb_gc)operator((\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(void) -ident(ruby_set_stack_size)operator(()ident(size)operator(\)) - ident(size_t) ident(size)operator(;) -operator({) -preprocessor(#ifndef) ident(STACK_LEVEL_MAX) - ident(STACK_LEVEL_MAX) operator(=) ident(size) operator(/) reserved(sizeof)operator(()ident(VALUE)operator(\);) -preprocessor(#endif) -operator(}) - -directive(void) -ident(Init_stack)operator(()ident(addr)operator(\)) - ident(VALUE) operator(*)ident(addr)operator(;) -operator({) -preprocessor(#ifdef) ident(__ia64) - reserved(if) operator(()ident(rb_gc_register_stack_start) operator(==) integer(0)operator(\)) operator({) -preprocessor(# if) ident(defined)operator(()ident(__FreeBSD__)operator(\)) - comment(/* - * FreeBSD/ia64 currently does not have a way for a process to get the - * base address for the RSE backing store, so hardcode it. - */) - ident(rb_gc_register_stack_start) operator(=) operator(()integer(4)ident(ULL)operator(<<)integer(61)operator(\);) -preprocessor(# elif) ident(defined)operator(()ident(HAVE___LIBC_IA64_REGISTER_BACKING_STORE_BASE)operator(\)) -preprocessor(# pragma) ident(weak) ident(__libc_ia64_register_backing_store_base) - directive(extern) pre_type(unsigned) pre_type(long) ident(__libc_ia64_register_backing_store_base)operator(;) - ident(rb_gc_register_stack_start) operator(=) operator(()ident(VALUE)operator(*\))ident(__libc_ia64_register_backing_store_base)operator(;) -preprocessor(# endif) - operator(}) - operator({) - ident(VALUE) operator(*)ident(bsp) operator(=) operator(()ident(VALUE)operator(*\))ident(rb_ia64_bsp)operator((\);) - reserved(if) operator(()ident(rb_gc_register_stack_start) operator(==) integer(0) operator(||) - ident(bsp) operator(<) ident(rb_gc_register_stack_start)operator(\)) operator({) - ident(rb_gc_register_stack_start) operator(=) ident(bsp)operator(;) - operator(}) - operator(}) -preprocessor(#endif) -preprocessor(#if) ident(defined)operator(()ident(_WIN32)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN__)operator(\)) - ident(MEMORY_BASIC_INFORMATION) ident(m)operator(;) - ident(memset)operator((&)ident(m)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(m)operator(\)\);) - ident(VirtualQuery)operator((&)ident(m)operator(,) operator(&)ident(m)operator(,) reserved(sizeof)operator(()ident(m)operator(\)\);) - ident(rb_gc_stack_start) operator(=) - ident(STACK_UPPER)operator((()ident(VALUE) operator(*\)&)ident(m)operator(,) operator(()ident(VALUE) operator(*\))ident(m)operator(.)ident(BaseAddress)operator(,) - operator(()ident(VALUE) operator(*\)(()pre_type(char) operator(*\))ident(m)operator(.)ident(BaseAddress) operator(+) ident(m)operator(.)ident(RegionSize)operator(\)) operator(-) integer(1)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(STACK_END_ADDRESS)operator(\)) - operator({) - directive(extern) directive(void) operator(*)ident(STACK_END_ADDRESS)operator(;) - ident(rb_gc_stack_start) operator(=) ident(STACK_END_ADDRESS)operator(;) - operator(}) -preprocessor(#else) - reserved(if) operator((!)ident(addr)operator(\)) ident(addr) operator(=) operator(()directive(void) operator(*\)&)ident(addr)operator(;) - ident(STACK_UPPER)operator((&)ident(addr)operator(,) ident(addr)operator(,) operator(++)ident(addr)operator(\);) - reserved(if) operator(()ident(rb_gc_stack_start)operator(\)) operator({) - reserved(if) operator(()ident(STACK_UPPER)operator((&)ident(addr)operator(,) - ident(rb_gc_stack_start) operator(>) ident(addr)operator(,) - ident(rb_gc_stack_start) operator(<) ident(addr)operator(\)\)) - ident(rb_gc_stack_start) operator(=) ident(addr)operator(;) - reserved(return)operator(;) - operator(}) - ident(rb_gc_stack_start) operator(=) ident(addr)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(HAVE_GETRLIMIT) - operator({) - reserved(struct) ident(rlimit) ident(rlim)operator(;) - - reserved(if) operator(()ident(getrlimit)operator(()ident(RLIMIT_STACK)operator(,) operator(&)ident(rlim)operator(\)) operator(==) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(int) ident(space) operator(=) ident(rlim)operator(.)ident(rlim_cur)operator(/)integer(5)operator(;) - - reserved(if) operator(()ident(space) operator(>) integer(1024)operator(*)integer(1024)operator(\)) ident(space) operator(=) integer(1024)operator(*)integer(1024)operator(;) - ident(STACK_LEVEL_MAX) operator(=) operator(()ident(rlim)operator(.)ident(rlim_cur) operator(-) ident(space)operator(\)) operator(/) reserved(sizeof)operator(()ident(VALUE)operator(\);) - operator(}) - operator(}) -preprocessor(#endif) -operator(}) - -directive(void) ident(ruby_init_stack)operator(()ident(VALUE) operator(*)ident(addr) -preprocessor(#ifdef) ident(__ia64) - operator(,) directive(void) operator(*)ident(bsp) -preprocessor(#endif) - operator(\)) -operator({) - reserved(if) operator((!)ident(rb_gc_stack_start) operator(||) - ident(STACK_UPPER)operator((&)ident(addr)operator(,) - ident(rb_gc_stack_start) operator(>) ident(addr)operator(,) - ident(rb_gc_stack_start) operator(<) ident(addr)operator(\)\)) operator({) - ident(rb_gc_stack_start) operator(=) ident(addr)operator(;) - operator(}) -preprocessor(#ifdef) ident(__ia64) - reserved(if) operator((!)ident(rb_gc_register_stack_start) operator(||) - operator(()ident(VALUE)operator(*\))ident(bsp) operator(<) ident(rb_gc_register_stack_start)operator(\)) operator({) - ident(rb_gc_register_stack_start) operator(=) operator(()ident(VALUE)operator(*\))ident(bsp)operator(;) - operator(}) -preprocessor(#endif) -preprocessor(#ifdef) ident(HAVE_GETRLIMIT) - operator({) - reserved(struct) ident(rlimit) ident(rlim)operator(;) - - reserved(if) operator(()ident(getrlimit)operator(()ident(RLIMIT_STACK)operator(,) operator(&)ident(rlim)operator(\)) operator(==) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(int) ident(space) operator(=) ident(rlim)operator(.)ident(rlim_cur)operator(/)integer(5)operator(;) - - reserved(if) operator(()ident(space) operator(>) integer(1024)operator(*)integer(1024)operator(\)) ident(space) operator(=) integer(1024)operator(*)integer(1024)operator(;) - ident(STACK_LEVEL_MAX) operator(=) operator(()ident(rlim)operator(.)ident(rlim_cur) operator(-) ident(space)operator(\)) operator(/) reserved(sizeof)operator(()ident(VALUE)operator(\);) - operator(}) - operator(}) -preprocessor(#elif) ident(defined) ident(_WIN32) - operator({) - ident(MEMORY_BASIC_INFORMATION) ident(mi)operator(;) - ident(DWORD) ident(size)operator(;) - ident(DWORD) ident(space)operator(;) - - reserved(if) operator(()ident(VirtualQuery)operator((&)ident(mi)operator(,) operator(&)ident(mi)operator(,) reserved(sizeof)operator(()ident(mi)operator(\)\)\)) operator({) - ident(size) operator(=) operator(()pre_type(char) operator(*\))ident(mi)operator(.)ident(BaseAddress) operator(-) operator(()pre_type(char) operator(*\))ident(mi)operator(.)ident(AllocationBase)operator(;) - ident(space) operator(=) ident(size) operator(/) integer(5)operator(;) - reserved(if) operator(()ident(space) operator(>) integer(1024)operator(*)integer(1024)operator(\)) ident(space) operator(=) integer(1024)operator(*)integer(1024)operator(;) - ident(STACK_LEVEL_MAX) operator(=) operator(()ident(size) operator(-) ident(space)operator(\)) operator(/) reserved(sizeof)operator(()ident(VALUE)operator(\);) - operator(}) - operator(}) -preprocessor(#endif) -operator(}) - -comment(/* - * Document-class: ObjectSpace - * - * The ObjectSpace module contains a number of routines - * that interact with the garbage collection facility and allow you to - * traverse all living objects with an iterator. - * - * ObjectSpace also provides support for object - * finalizers, procs that will be called when a specific object is - * about to be destroyed by garbage collection. - * - * include ObjectSpace - * - * - * a = "A" - * b = "B" - * c = "C" - * - * - * define_finalizer(a, proc {|id| puts "Finalizer one on #{id}" }\) - * define_finalizer(a, proc {|id| puts "Finalizer two on #{id}" }\) - * define_finalizer(b, proc {|id| puts "Finalizer three on #{id}" }\) - * - * produces: - * - * Finalizer three on 537763470 - * Finalizer one on 537763480 - * Finalizer two on 537763480 - * - */) - -directive(void) -ident(Init_heap)operator((\)) -operator({) - reserved(if) operator((!)ident(rb_gc_stack_start)operator(\)) operator({) - ident(Init_stack)operator(()integer(0)operator(\);) - operator(}) - ident(add_heap)operator((\);) -operator(}) - -directive(static) ident(VALUE) -ident(os_obj_of)operator(()ident(of)operator(\)) - ident(VALUE) ident(of)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - pre_type(int) ident(n) operator(=) integer(0)operator(;) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(heaps_used)operator(;) ident(i)operator(++\)) operator({) - ident(RVALUE) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - - ident(p) operator(=) ident(heaps)operator([)ident(i)operator(])operator(.)ident(slot)operator(;) ident(pend) operator(=) ident(p) operator(+) ident(heaps)operator([)ident(i)operator(])operator(.)ident(limit)operator(;) - reserved(for) operator((;)ident(p) operator(<) ident(pend)operator(;) ident(p)operator(++\)) operator({) - reserved(if) operator(()ident(p)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags)operator(\)) operator({) - reserved(switch) operator(()ident(BUILTIN_TYPE)operator(()ident(p)operator(\)\)) operator({) - reserved(case) ident(T_NONE)operator(:) - reserved(case) ident(T_ICLASS)operator(:) - reserved(case) ident(T_VARMAP)operator(:) - reserved(case) ident(T_SCOPE)operator(:) - reserved(case) ident(T_NODE)operator(:) - reserved(case) ident(T_DEFERRED)operator(:) - reserved(continue)operator(;) - reserved(case) ident(T_CLASS)operator(:) - reserved(if) operator(()ident(FL_TEST)operator(()ident(p)operator(,) ident(FL_SINGLETON)operator(\)\)) reserved(continue)operator(;) - reserved(default)operator(:) - reserved(if) operator((!)ident(p)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(klass)operator(\)) reserved(continue)operator(;) - reserved(if) operator((!)ident(of) operator(||) ident(rb_obj_is_kind_of)operator((()ident(VALUE)operator(\))ident(p)operator(,) ident(of)operator(\)\)) operator({) - ident(rb_yield)operator((()ident(VALUE)operator(\))ident(p)operator(\);) - ident(n)operator(++;) - operator(}) - operator(}) - operator(}) - operator(}) - operator(}) - - reserved(return) ident(INT2FIX)operator(()ident(n)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ObjectSpace.each_object([module]\) {|obj| ... } => fixnum - * - * Calls the block once for each living, nonimmediate object in this - * Ruby process. If module is specified, calls the block - * for only those classes or modules that match (or are a subclass of\) - * module. Returns the number of objects found. Immediate - * objects (Fixnums, Symbols - * true, false, and nil\) are - * never returned. In the example below, each_object - * returns both the numbers we defined and several constants defined in - * the Math module. - * - * a = 102.7 - * b = 95 # Won't be returned - * c = 12345678987654321 - * count = ObjectSpace.each_object(Numeric\) {|x| p x } - * puts "Total count: #{count}" - * - * produces: - * - * 12345678987654321 - * 102.7 - * 2.71828182845905 - * 3.14159265358979 - * 2.22044604925031e-16 - * 1.7976931348623157e+308 - * 2.2250738585072e-308 - * Total count: 7 - * - */) - -directive(static) ident(VALUE) -ident(os_each_obj)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(of)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(of)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(of) operator(=) integer(0)operator(;) - operator(}) - reserved(return) ident(os_obj_of)operator(()ident(of)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(finalizers)operator(;) - -comment(/* deprecated - */) - -directive(static) ident(VALUE) -ident(add_final)operator(()ident(os)operator(,) ident(block)operator(\)) - ident(VALUE) ident(os)operator(,) ident(block)operator(;) -operator({) - ident(rb_warn)operator(()stringoperator(\);) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(block)operator(,) ident(rb_intern)operator(()stringoperator(\)\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(block)operator(\)\);) - operator(}) - ident(rb_ary_push)operator(()ident(finalizers)operator(,) ident(block)operator(\);) - reserved(return) ident(block)operator(;) -operator(}) - -comment(/* - * deprecated - */) -directive(static) ident(VALUE) -ident(rm_final)operator(()ident(os)operator(,) ident(block)operator(\)) - ident(VALUE) ident(os)operator(,) ident(block)operator(;) -operator({) - ident(rb_warn)operator(()stringoperator(\);) - ident(rb_ary_delete)operator(()ident(finalizers)operator(,) ident(block)operator(\);) - reserved(return) ident(block)operator(;) -operator(}) - -comment(/* - * deprecated - */) -directive(static) ident(VALUE) -ident(finals)operator((\)) -operator({) - ident(rb_warn)operator(()stringoperator(\);) - reserved(return) ident(finalizers)operator(;) -operator(}) - -comment(/* - * deprecated - */) - -directive(static) ident(VALUE) -ident(call_final)operator(()ident(os)operator(,) ident(obj)operator(\)) - ident(VALUE) ident(os)operator(,) ident(obj)operator(;) -operator({) - ident(rb_warn)operator(()stringoperator(\);) - ident(need_call_final) operator(=) integer(1)operator(;) - ident(FL_SET)operator(()ident(obj)operator(,) ident(FL_FINALIZE)operator(\);) - reserved(return) ident(obj)operator(;) -operator(}) - -comment(/* - * call-seq: - * ObjectSpace.undefine_finalizer(obj\) - * - * Removes all finalizers for obj. - * - */) - -directive(static) ident(VALUE) -ident(undefine_final)operator(()ident(os)operator(,) ident(obj)operator(\)) - ident(VALUE) ident(os)operator(,) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(finalizer_table)operator(\)) operator({) - ident(st_delete)operator(()ident(finalizer_table)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(obj)operator(,) integer(0)operator(\);) - operator(}) - reserved(return) ident(obj)operator(;) -operator(}) - -comment(/* - * call-seq: - * ObjectSpace.define_finalizer(obj, aProc=proc(\)\) - * - * Adds aProc as a finalizer, to be called after obj - * was destroyed. - * - */) - -directive(static) ident(VALUE) -ident(define_final)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(os)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(os)operator(;) -operator({) - ident(VALUE) ident(obj)operator(,) ident(block)operator(,) ident(table)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(obj)operator(,) operator(&)ident(block)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - ident(block) operator(=) ident(rb_block_proc)operator((\);) - operator(}) - reserved(else) reserved(if) operator((!)ident(rb_respond_to)operator(()ident(block)operator(,) ident(rb_intern)operator(()stringoperator(\)\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(block)operator(\)\);) - operator(}) - ident(need_call_final) operator(=) integer(1)operator(;) - reserved(if) operator((!)ident(FL_ABLE)operator(()ident(obj)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(obj)operator(\)\);) - operator(}) - ident(RBASIC)operator(()ident(obj)operator(\)->)ident(flags) operator(|=) ident(FL_FINALIZE)operator(;) - - ident(block) operator(=) ident(rb_ary_new3)operator(()integer(2)operator(,) ident(INT2FIX)operator(()ident(ruby_safe_level)operator(\),) ident(block)operator(\);) - ident(OBJ_FREEZE)operator(()ident(block)operator(\);) - - reserved(if) operator((!)ident(finalizer_table)operator(\)) operator({) - ident(finalizer_table) operator(=) ident(st_init_numtable)operator((\);) - operator(}) - reserved(if) operator(()ident(st_lookup)operator(()ident(finalizer_table)operator(,) ident(obj)operator(,) operator(&)ident(table)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(table)operator(,) ident(block)operator(\);) - operator(}) - reserved(else) operator({) - ident(table) operator(=) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(block)operator(\);) - ident(RBASIC)operator(()ident(table)operator(\)->)ident(klass) operator(=) integer(0)operator(;) - ident(st_add_direct)operator(()ident(finalizer_table)operator(,) ident(obj)operator(,) ident(table)operator(\);) - operator(}) - reserved(return) ident(block)operator(;) -operator(}) - -directive(void) -ident(rb_gc_copy_finalizer)operator(()ident(dest)operator(,) ident(obj)operator(\)) - ident(VALUE) ident(dest)operator(,) ident(obj)operator(;) -operator({) - ident(VALUE) ident(table)operator(;) - - reserved(if) operator((!)ident(finalizer_table)operator(\)) reserved(return)operator(;) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_FINALIZE)operator(\)\)) reserved(return)operator(;) - reserved(if) operator(()ident(st_lookup)operator(()ident(finalizer_table)operator(,) ident(obj)operator(,) operator(&)ident(table)operator(\)\)) operator({) - ident(st_insert)operator(()ident(finalizer_table)operator(,) ident(dest)operator(,) ident(table)operator(\);) - operator(}) - ident(RBASIC)operator(()ident(dest)operator(\)->)ident(flags) operator(|=) ident(FL_FINALIZE)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(run_single_final)operator(()ident(args)operator(\)) - ident(VALUE) operator(*)ident(args)operator(;) -operator({) - ident(rb_eval_cmd)operator(()ident(args)operator([)integer(0)operator(],) ident(args)operator([)integer(1)operator(],) operator(()pre_type(int)operator(\))ident(args)operator([)integer(2)operator(]\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) directive(void) -ident(run_final)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - pre_type(int) ident(status)operator(,) ident(critical_save) operator(=) ident(rb_thread_critical)operator(;) - ident(VALUE) ident(args)operator([)integer(3)operator(],) ident(table)operator(,) ident(objid)operator(;) - - ident(objid) operator(=) ident(rb_obj_id)operator(()ident(obj)operator(\);) comment(/* make obj into id */) - ident(rb_thread_critical) operator(=) ident(Qtrue)operator(;) - comment(/* NOTE: This change below, adding DATA_PTR(obj\) to the if line, is a stopgap fix for segfaults; the reason for DATA_PTR(obj\) == 0 needs to be found and fixed. */) - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(obj)operator(\)) operator(==) ident(T_DEFERRED) operator(&&) ident(RDATA)operator(()ident(obj)operator(\)->)ident(dfree) operator(&&) ident(DATA_PTR)operator(()ident(obj)operator(\)\)) operator({) - operator((*)ident(RDATA)operator(()ident(obj)operator(\)->)ident(dfree)operator(\)()ident(DATA_PTR)operator(()ident(obj)operator(\)\);) - operator(}) - ident(args)operator([)integer(1)operator(]) operator(=) integer(0)operator(;) - ident(args)operator([)integer(2)operator(]) operator(=) operator(()ident(VALUE)operator(\))ident(ruby_safe_level)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(finalizers)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(args)operator([)integer(0)operator(]) operator(=) ident(RARRAY)operator(()ident(finalizers)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - reserved(if) operator((!)ident(args)operator([)integer(1)operator(]\)) ident(args)operator([)integer(1)operator(]) operator(=) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(objid)operator(\);) - ident(rb_protect)operator((()ident(VALUE)operator((*\))ident(_)operator((()ident(VALUE)operator(\)\)\))ident(run_single_final)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(,) operator(&)ident(status)operator(\);) - operator(}) - reserved(if) operator(()ident(finalizer_table) operator(&&) ident(st_delete)operator(()ident(finalizer_table)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(obj)operator(,) operator(&)ident(table)operator(\)\)) operator({) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(table)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(final) operator(=) ident(RARRAY)operator(()ident(table)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - ident(args)operator([)integer(0)operator(]) operator(=) ident(RARRAY)operator(()ident(final)operator(\)->)ident(ptr)operator([)integer(1)operator(];) - reserved(if) operator((!)ident(args)operator([)integer(1)operator(]\)) ident(args)operator([)integer(1)operator(]) operator(=) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(objid)operator(\);) - ident(args)operator([)integer(2)operator(]) operator(=) ident(FIX2INT)operator(()ident(RARRAY)operator(()ident(final)operator(\)->)ident(ptr)operator([)integer(0)operator(]\);) - ident(rb_protect)operator((()ident(VALUE)operator((*\))ident(_)operator((()ident(VALUE)operator(\)\)\))ident(run_single_final)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(,) operator(&)ident(status)operator(\);) - operator(}) - operator(}) - ident(rb_thread_critical) operator(=) ident(critical_save)operator(;) -operator(}) - -directive(void) -ident(rb_gc_finalize_deferred)operator((\)) -operator({) - ident(RVALUE) operator(*)ident(p) operator(=) ident(deferred_final_list)operator(;) - - ident(deferred_final_list) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(p)operator(\)) operator({) - ident(finalize_list)operator(()ident(p)operator(\);) - ident(free_unused_heaps)operator((\);) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(chain_finalized_object)operator(()ident(st_data_t) ident(key)operator(,) ident(st_data_t) ident(val)operator(,) ident(st_data_t) ident(arg)operator(\)) -operator({) - ident(RVALUE) operator(*)ident(p) operator(=) operator(()ident(RVALUE) operator(*\))ident(key)operator(,) operator(**)ident(final_list) operator(=) operator(()ident(RVALUE) operator(**\))ident(arg)operator(;) - reserved(if) operator((()ident(p)operator(->)ident(as)operator(.)ident(basic)operator(.)ident(flags) operator(&) operator(()ident(FL_FINALIZE)operator(|)ident(FL_MARK)operator(\)\)) operator(==) ident(FL_FINALIZE)operator(\)) operator({) - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(p)operator(\)) operator(!=) ident(T_DEFERRED)operator(\)) operator({) - ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(flags) operator(=) ident(FL_MARK) operator(|) ident(T_DEFERRED)operator(;) comment(/* remain marked */) - ident(RDATA)operator(()ident(p)operator(\)->)ident(dfree) operator(=) integer(0)operator(;) - operator(}) - ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(next) operator(=) operator(*)ident(final_list)operator(;) - operator(*)ident(final_list) operator(=) ident(p)operator(;) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(void) -ident(rb_gc_call_finalizer_at_exit)operator((\)) -operator({) - ident(RVALUE) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - pre_type(int) ident(i)operator(;) - - comment(/* run finalizers */) - reserved(if) operator(()ident(need_call_final)operator(\)) operator({) - reserved(do) operator({) - ident(p) operator(=) ident(deferred_final_list)operator(;) - ident(deferred_final_list) operator(=) integer(0)operator(;) - ident(finalize_list)operator(()ident(p)operator(\);) - ident(mark_tbl)operator(()ident(finalizer_table)operator(,) integer(0)operator(\);) - ident(st_foreach)operator(()ident(finalizer_table)operator(,) ident(chain_finalized_object)operator(,) - operator(()ident(st_data_t)operator(\)&)ident(deferred_final_list)operator(\);) - operator(}) reserved(while) operator(()ident(deferred_final_list)operator(\);) - operator(}) - comment(/* run data object's finalizers */) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(heaps_used)operator(;) ident(i)operator(++\)) operator({) - ident(p) operator(=) ident(heaps)operator([)ident(i)operator(])operator(.)ident(slot)operator(;) ident(pend) operator(=) ident(p) operator(+) ident(heaps)operator([)ident(i)operator(])operator(.)ident(limit)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(p)operator(\)) operator(==) ident(T_DATA) operator(&&) - ident(DATA_PTR)operator(()ident(p)operator(\)) operator(&&) ident(RANY)operator(()ident(p)operator(\)->)ident(as)operator(.)ident(data)operator(.)ident(dfree) operator(&&) - ident(RANY)operator(()ident(p)operator(\)->)ident(as)operator(.)ident(basic)operator(.)ident(klass) operator(!=) ident(rb_cThread)operator(\)) operator({) - ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(flags) operator(=) integer(0)operator(;) - reserved(if) operator((()pre_type(long)operator(\))ident(RANY)operator(()ident(p)operator(\)->)ident(as)operator(.)ident(data)operator(.)ident(dfree) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(RUBY_CRITICAL)operator(()ident(free)operator(()ident(DATA_PTR)operator(()ident(p)operator(\)\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(RANY)operator(()ident(p)operator(\)->)ident(as)operator(.)ident(data)operator(.)ident(dfree)operator(\)) operator({) - operator((*)ident(RANY)operator(()ident(p)operator(\)->)ident(as)operator(.)ident(data)operator(.)ident(dfree)operator(\)()ident(DATA_PTR)operator(()ident(p)operator(\)\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(p)operator(\)) operator(==) ident(T_FILE)operator(\)) operator({) - ident(p)operator(->)ident(as)operator(.)ident(free)operator(.)ident(flags) operator(=) integer(0)operator(;) - ident(rb_io_fptr_finalize)operator(()ident(RANY)operator(()ident(p)operator(\)->)ident(as)operator(.)ident(file)operator(.)ident(fptr)operator(\);) - operator(}) - ident(p)operator(++;) - operator(}) - operator(}) -operator(}) - -comment(/* - * call-seq: - * ObjectSpace._id2ref(object_id\) -> an_object - * - * Converts an object id to a reference to the object. May not be - * called on an object id passed as a parameter to a finalizer. - * - * s = "I am a string" #=> "I am a string" - * r = ObjectSpace._id2ref(s.object_id\) #=> "I am a string" - * r == s #=> true - * - */) - -directive(static) ident(VALUE) -ident(id2ref)operator(()ident(obj)operator(,) ident(objid)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(objid)operator(;) -operator({) - pre_type(unsigned) pre_type(long) ident(ptr)operator(,) ident(p0)operator(;) - pre_type(int) ident(type)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - ident(p0) operator(=) ident(ptr) operator(=) ident(NUM2ULONG)operator(()ident(objid)operator(\);) - reserved(if) operator(()ident(ptr) operator(==) ident(Qtrue)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(ptr) operator(==) ident(Qfalse)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(ptr) operator(==) ident(Qnil)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(ptr)operator(\)\)) reserved(return) operator(()ident(VALUE)operator(\))ident(ptr)operator(;) - ident(ptr) operator(=) ident(objid) operator(^) ident(FIXNUM_FLAG)operator(;) comment(/* unset FIXNUM_FLAG */) - - reserved(if) operator((()ident(ptr) operator(%) reserved(sizeof)operator(()ident(RVALUE)operator(\)\)) operator(==) operator(()integer(4) operator(<<) integer(2)operator(\)\)) operator({) - ident(ID) ident(symid) operator(=) ident(ptr) operator(/) reserved(sizeof)operator(()ident(RVALUE)operator(\);) - reserved(if) operator(()ident(rb_id2name)operator(()ident(symid)operator(\)) operator(==) integer(0)operator(\)) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(p0)operator(\);) - reserved(return) ident(ID2SYM)operator(()ident(symid)operator(\);) - operator(}) - - reserved(if) operator((!)ident(is_pointer_to_heap)operator((()directive(void) operator(*\))ident(ptr)operator(\)||) - operator(()ident(type) operator(=) ident(BUILTIN_TYPE)operator(()ident(ptr)operator(\)\)) operator(>) ident(T_SYMBOL) operator(||) ident(type) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(p0)operator(\);) - operator(}) - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(ptr)operator(\)) operator(==) integer(0) operator(||) ident(RBASIC)operator(()ident(ptr)operator(\)->)ident(klass) operator(==) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(p0)operator(\);) - operator(}) - reserved(return) operator(()ident(VALUE)operator(\))ident(ptr)operator(;) -operator(}) - -comment(/* - * Document-method: __id__ - * Document-method: object_id - * - * call-seq: - * obj.__id__ => fixnum - * obj.object_id => fixnum - * - * Returns an integer identifier for obj. The same number will - * be returned on all calls to id for a given object, and - * no two active objects will share an id. - * Object#object_id is a different concept from the - * :name notation, which returns the symbol id of - * name. Replaces the deprecated Object#id. - */) - -comment(/* - * call-seq: - * obj.hash => fixnum - * - * Generates a Fixnum hash value for this object. This - * function must have the property that a.eql?(b\) implies - * a.hash == b.hash. The hash value is used by class - * Hash. Any hash value that exceeds the capacity of a - * Fixnum will be truncated before being used. - */) - -ident(VALUE) -ident(rb_obj_id)operator(()ident(VALUE) ident(obj)operator(\)) -operator({) - comment(/* - * 32-bit VALUE space - * MSB ------------------------ LSB - * false 00000000000000000000000000000000 - * true 00000000000000000000000000000010 - * nil 00000000000000000000000000000100 - * undef 00000000000000000000000000000110 - * symbol ssssssssssssssssssssssss00001110 - * object oooooooooooooooooooooooooooooo00 = 0 (mod sizeof(RVALUE\)\) - * fixnum fffffffffffffffffffffffffffffff1 - * - * object_id space - * LSB - * false 00000000000000000000000000000000 - * true 00000000000000000000000000000010 - * nil 00000000000000000000000000000100 - * undef 00000000000000000000000000000110 - * symbol 000SSSSSSSSSSSSSSSSSSSSSSSSSSS0 S...S % A = 4 (S...S = s...s * A + 4\) - * object oooooooooooooooooooooooooooooo0 o...o % A = 0 - * fixnum fffffffffffffffffffffffffffffff1 bignum if required - * - * where A = sizeof(RVALUE\)/4 - * - * sizeof(RVALUE\) is - * 20 if 32-bit, double is 4-byte aligned - * 24 if 32-bit, double is 8-byte aligned - * 40 if 64-bit - */) - reserved(if) operator(()ident(TYPE)operator(()ident(obj)operator(\)) operator(==) ident(T_SYMBOL)operator(\)) operator({) - reserved(return) operator(()ident(SYM2ID)operator(()ident(obj)operator(\)) operator(*) reserved(sizeof)operator(()ident(RVALUE)operator(\)) operator(+) operator(()integer(4) operator(<<) integer(2)operator(\)\)) operator(|) ident(FIXNUM_FLAG)operator(;) - operator(}) - reserved(if) operator(()ident(SPECIAL_CONST_P)operator(()ident(obj)operator(\)\)) operator({) - reserved(return) ident(LONG2NUM)operator((()pre_type(long)operator(\))ident(obj)operator(\);) - operator(}) - reserved(return) operator(()ident(VALUE)operator(\)(()pre_type(long)operator(\))ident(obj)operator(|)ident(FIXNUM_FLAG)operator(\);) -operator(}) - -comment(/* - * The GC module provides an interface to Ruby's mark and - * sweep garbage collection mechanism. Some of the underlying methods - * are also available via the ObjectSpace module. - */) - -directive(void) -ident(Init_GC)operator((\)) -operator({) - ident(VALUE) ident(rb_mObSpace)operator(;) - - ident(rb_mGC) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_mGC)operator(,) stringoperator(,) ident(rb_gc_start)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_mGC)operator(,) stringoperator(,) ident(rb_gc_enable)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_mGC)operator(,) stringoperator(,) ident(rb_gc_disable)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mGC)operator(,) stringoperator(,) ident(rb_gc_start)operator(,) integer(0)operator(\);) - - ident(rb_mObSpace) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - ident(rb_define_module_function)operator(()ident(rb_mObSpace)operator(,) stringoperator(,) ident(os_each_obj)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mObSpace)operator(,) stringoperator(,) ident(rb_gc_start)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mObSpace)operator(,) stringoperator(,) ident(add_final)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mObSpace)operator(,) stringoperator(,) ident(rm_final)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mObSpace)operator(,) stringoperator(,) ident(finals)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mObSpace)operator(,) stringoperator(,) ident(call_final)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mObSpace)operator(,) stringoperator(,) ident(define_final)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mObSpace)operator(,) stringoperator(,) ident(undefine_final)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mObSpace)operator(,) stringoperator(,) ident(id2ref)operator(,) integer(1)operator(\);) - - ident(rb_gc_register_address)operator((&)ident(rb_mObSpace)operator(\);) - ident(rb_global_variable)operator((&)ident(finalizers)operator(\);) - ident(rb_gc_unregister_address)operator((&)ident(rb_mObSpace)operator(\);) - ident(finalizers) operator(=) ident(rb_ary_new)operator((\);) - - ident(source_filenames) operator(=) ident(st_init_strtable)operator((\);) - - ident(rb_global_variable)operator((&)ident(nomem_error)operator(\);) - ident(nomem_error) operator(=) ident(rb_exc_new3)operator(()ident(rb_eNoMemError)operator(,) - ident(rb_obj_freeze)operator(()ident(rb_str_new2)operator(()stringoperator(\)\)\);) - ident(OBJ_TAINT)operator(()ident(nomem_error)operator(\);) - ident(OBJ_FREEZE)operator(()ident(nomem_error)operator(\);) - - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_id)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_id)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_id)operator(,) integer(0)operator(\);) -operator(}) -comment(/********************************************************************** - - hash.c - - - $Author: shyouhei $ - $Date: 2007-08-22 05:42:36 +0200 (Wed, 22 Aug 2007\) $ - created at: Mon Nov 22 18:51:18 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("st.h") -preprocessor(#include) include("util.h") -preprocessor(#include) include("rubysig.h") - -preprocessor(#ifdef) ident(__APPLE__) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#define) ident(HASH_DELETED) ident(FL_USER1) -preprocessor(#define) ident(HASH_PROC_DEFAULT) ident(FL_USER2) - -directive(static) directive(void) -ident(rb_hash_modify)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(if) operator((!)ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(\)) ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(hash)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(hash)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) -operator(}) - -ident(VALUE) -ident(rb_hash_freeze)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(return) ident(rb_obj_freeze)operator(()ident(hash)operator(\);) -operator(}) - -ident(VALUE) ident(rb_cHash)operator(;) - -directive(static) ident(VALUE) ident(envtbl)operator(;) -directive(static) ident(ID) ident(id_hash)operator(,) ident(id_call)operator(,) ident(id_default)operator(;) - -directive(static) ident(VALUE) -ident(eql)operator(()ident(args)operator(\)) - ident(VALUE) operator(*)ident(args)operator(;) -operator({) - reserved(return) operator(()ident(VALUE)operator(\))ident(rb_eql)operator(()ident(args)operator([)integer(0)operator(],) ident(args)operator([)integer(1)operator(]\);) -operator(}) - -directive(static) pre_type(int) -ident(rb_any_cmp)operator(()ident(a)operator(,) ident(b)operator(\)) - ident(VALUE) ident(a)operator(,) ident(b)operator(;) -operator({) - ident(VALUE) ident(args)operator([)integer(2)operator(];) - - reserved(if) operator(()ident(a) operator(==) ident(b)operator(\)) reserved(return) integer(0)operator(;) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(a)operator(\)) operator(&&) ident(FIXNUM_P)operator(()ident(b)operator(\)\)) operator({) - reserved(return) ident(a) operator(!=) ident(b)operator(;) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(a)operator(\)) operator(==) ident(T_STRING) operator(&&) ident(RBASIC)operator(()ident(a)operator(\)->)ident(klass) operator(==) ident(rb_cString) operator(&&) - ident(TYPE)operator(()ident(b)operator(\)) operator(==) ident(T_STRING) operator(&&) ident(RBASIC)operator(()ident(b)operator(\)->)ident(klass) operator(==) ident(rb_cString)operator(\)) operator({) - reserved(return) ident(rb_str_cmp)operator(()ident(a)operator(,) ident(b)operator(\);) - operator(}) - reserved(if) operator(()ident(a) operator(==) ident(Qundef) operator(||) ident(b) operator(==) ident(Qundef)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(if) operator(()ident(SYMBOL_P)operator(()ident(a)operator(\)) operator(&&) ident(SYMBOL_P)operator(()ident(b)operator(\)\)) operator({) - reserved(return) ident(a) operator(!=) ident(b)operator(;) - operator(}) - - ident(args)operator([)integer(0)operator(]) operator(=) ident(a)operator(;) - ident(args)operator([)integer(1)operator(]) operator(=) ident(b)operator(;) - reserved(return) operator(!)ident(rb_with_disable_interrupt)operator(()ident(eql)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_hash)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(obj)operator(,) ident(id_hash)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(rb_any_hash)operator(()ident(a)operator(\)) - ident(VALUE) ident(a)operator(;) -operator({) - ident(VALUE) ident(hval)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(a)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - reserved(case) ident(T_SYMBOL)operator(:) - reserved(return) operator(()pre_type(int)operator(\))ident(a)operator(;) - reserved(break)operator(;) - - reserved(case) ident(T_STRING)operator(:) - reserved(return) ident(rb_str_hash)operator(()ident(a)operator(\);) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(hval) operator(=) ident(rb_funcall)operator(()ident(a)operator(,) ident(id_hash)operator(,) integer(0)operator(\);) - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(hval)operator(\)\)) operator({) - ident(hval) operator(=) ident(rb_funcall)operator(()ident(hval)operator(,) char('%')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(536870923)operator(\)\);) - operator(}) - reserved(return) operator(()pre_type(int)operator(\))ident(FIX2LONG)operator(()ident(hval)operator(\);) - operator(}) -operator(}) - -directive(static) reserved(struct) ident(st_hash_type) ident(objhash) operator(=) operator({) - ident(rb_any_cmp)operator(,) - ident(rb_any_hash)operator(,) -operator(};) - -reserved(struct) ident(foreach_safe_arg) operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - pre_type(int) operator((*)ident(func)operator(\)(\);) - ident(st_data_t) ident(arg)operator(;) -operator(};) - -directive(static) pre_type(int) -ident(foreach_safe_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(arg)operator(\)) - ident(st_data_t) ident(key)operator(,) ident(value)operator(;) - reserved(struct) ident(foreach_safe_arg) operator(*)ident(arg)operator(;) -operator({) - pre_type(int) ident(status)operator(;) - - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(status) operator(=) operator((*)ident(arg)operator(->)ident(func)operator(\)()ident(key)operator(,) ident(value)operator(,) ident(arg)operator(->)ident(arg)operator(\);) - reserved(if) operator(()ident(status) operator(==) ident(ST_CONTINUE)operator(\)) operator({) - reserved(return) ident(ST_CHECK)operator(;) - operator(}) - reserved(return) ident(status)operator(;) -operator(}) - -directive(void) -ident(st_foreach_safe)operator(()ident(table)operator(,) ident(func)operator(,) ident(a)operator(\)) - ident(st_table) operator(*)ident(table)operator(;) - pre_type(int) operator((*)ident(func)operator(\)(\);) - ident(st_data_t) ident(a)operator(;) -operator({) - reserved(struct) ident(foreach_safe_arg) ident(arg)operator(;) - - ident(arg)operator(.)ident(tbl) operator(=) ident(table)operator(;) - ident(arg)operator(.)ident(func) operator(=) ident(func)operator(;) - ident(arg)operator(.)ident(arg) operator(=) ident(a)operator(;) - reserved(if) operator(()ident(st_foreach)operator(()ident(table)operator(,) ident(foreach_safe_i)operator(,) operator(()ident(st_data_t)operator(\)&)ident(arg)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) -operator(}) - -reserved(struct) ident(hash_foreach_arg) operator({) - ident(VALUE) ident(hash)operator(;) - pre_type(int) operator((*)ident(func)operator(\)(\);) - ident(VALUE) ident(arg)operator(;) -operator(};) - -directive(static) pre_type(int) -ident(hash_foreach_iter)operator(()ident(key)operator(,) ident(value)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) - reserved(struct) ident(hash_foreach_arg) operator(*)ident(arg)operator(;) -operator({) - pre_type(int) ident(status)operator(;) - ident(st_table) operator(*)ident(tbl)operator(;) - - ident(tbl) operator(=) ident(RHASH)operator(()ident(arg)operator(->)ident(hash)operator(\)->)ident(tbl)operator(;) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(status) operator(=) operator((*)ident(arg)operator(->)ident(func)operator(\)()ident(key)operator(,) ident(value)operator(,) ident(arg)operator(->)ident(arg)operator(\);) - reserved(if) operator(()ident(RHASH)operator(()ident(arg)operator(->)ident(hash)operator(\)->)ident(tbl) operator(!=) ident(tbl)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - reserved(switch) operator(()ident(status)operator(\)) operator({) - reserved(case) ident(ST_DELETE)operator(:) - ident(st_delete_safe)operator(()ident(tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(key)operator(,) integer(0)operator(,) ident(Qundef)operator(\);) - ident(FL_SET)operator(()ident(arg)operator(->)ident(hash)operator(,) ident(HASH_DELETED)operator(\);) - reserved(case) ident(ST_CONTINUE)operator(:) - reserved(break)operator(;) - reserved(case) ident(ST_STOP)operator(:) - reserved(return) ident(ST_STOP)operator(;) - operator(}) - reserved(return) ident(ST_CHECK)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(hash_foreach_ensure)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(RHASH)operator(()ident(hash)operator(\)->)ident(iter_lev)operator(--;) - - reserved(if) operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(iter_lev) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(hash)operator(,) ident(HASH_DELETED)operator(\)\)) operator({) - ident(st_cleanup_safe)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) ident(Qundef)operator(\);) - ident(FL_UNSET)operator(()ident(hash)operator(,) ident(HASH_DELETED)operator(\);) - operator(}) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(hash_foreach_call)operator(()ident(arg)operator(\)) - reserved(struct) ident(hash_foreach_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(if) operator(()ident(st_foreach)operator(()ident(RHASH)operator(()ident(arg)operator(->)ident(hash)operator(\)->)ident(tbl)operator(,) ident(hash_foreach_iter)operator(,) operator(()ident(st_data_t)operator(\))ident(arg)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(void) -ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(func)operator(,) ident(farg)operator(\)) - ident(VALUE) ident(hash)operator(;) - pre_type(int) operator((*)ident(func)operator(\)(\);) - ident(VALUE) ident(farg)operator(;) -operator({) - reserved(struct) ident(hash_foreach_arg) ident(arg)operator(;) - - ident(RHASH)operator(()ident(hash)operator(\)->)ident(iter_lev)operator(++;) - ident(arg)operator(.)ident(hash) operator(=) ident(hash)operator(;) - ident(arg)operator(.)ident(func) operator(=) ident(func)operator(;) - ident(arg)operator(.)ident(arg) operator(=) ident(farg)operator(;) - ident(rb_ensure)operator(()ident(hash_foreach_call)operator(,) operator(()ident(VALUE)operator(\)&)ident(arg)operator(,) ident(hash_foreach_ensure)operator(,) ident(hash)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(hash_alloc0) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(hash_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(hash_alloc0)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(hash)operator(,) reserved(struct) ident(RHash)operator(\);) - ident(OBJSETUP)operator(()ident(hash)operator(,) ident(klass)operator(,) ident(T_HASH)operator(\);) - - ident(hash)operator(->)ident(ifnone) operator(=) ident(Qnil)operator(;) - - reserved(return) operator(()ident(VALUE)operator(\))ident(hash)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(hash_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(hash) operator(=) ident(hash_alloc0)operator(()ident(klass)operator(\);) - - ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl) operator(=) ident(st_init_table)operator((&)ident(objhash)operator(\);) - - reserved(return) ident(hash)operator(;) -operator(}) - -ident(VALUE) -ident(rb_hash_new)operator((\)) -operator({) - reserved(return) ident(hash_alloc)operator(()ident(rb_cHash)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Hash.new => hash - * Hash.new(obj\) => aHash - * Hash.new {|hash, key| block } => aHash - * - * Returns a new, empty hash. If this hash is subsequently accessed by - * a key that doesn't correspond to a hash entry, the value returned - * depends on the style of new used to create the hash. In - * the first form, the access returns nil. If - * obj is specified, this single object will be used for - * all default values. If a block is specified, it will be - * called with the hash object and the key, and should return the - * default value. It is the block's responsibility to store the value - * in the hash if required. - * - * h = Hash.new("Go Fish"\) - * h["a"] = 100 - * h["b"] = 200 - * h["a"] #=> 100 - * h["c"] #=> "Go Fish" - * # The following alters the single default object - * h["c"].upcase! #=> "GO FISH" - * h["d"] #=> "GO FISH" - * h.keys #=> ["a", "b"] - * - * # While this creates a new default object each time - * h = Hash.new { |hash, key| hash[key] = "Go Fish: #{key}" } - * h["c"] #=> "Go Fish: c" - * h["c"].upcase! #=> "GO FISH: C" - * h["d"] #=> "Go Fish: d" - * h.keys #=> ["c", "d"] - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(hash)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(ifnone)operator(;) - - ident(rb_hash_modify)operator(()ident(hash)operator(\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(RHASH)operator(()ident(hash)operator(\)->)ident(ifnone) operator(=) ident(rb_block_proc)operator((\);) - ident(FL_SET)operator(()ident(hash)operator(,) ident(HASH_PROC_DEFAULT)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(ifnone)operator(\);) - ident(RHASH)operator(()ident(hash)operator(\)->)ident(ifnone) operator(=) ident(ifnone)operator(;) - operator(}) - - reserved(return) ident(hash)operator(;) -operator(}) - -comment(/* - * call-seq: - * Hash[ [key =>|, value]* ] => hash - * - * Creates a new hash populated with the given objects. Equivalent to - * the literal { key, value, ... }. Keys and - * values occur in pairs, so there must be an even number of arguments. - * - * Hash["a", 100, "b", 200] #=> {"a"=>100, "b"=>200} - * Hash["a" => 100, "b" => 200] #=> {"a"=>100, "b"=>200} - * { "a" => 100, "b" => 200 } #=> {"a"=>100, "b"=>200} - */) - -directive(static) ident(VALUE) -ident(rb_hash_s_create)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(hash)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(1) operator(&&) ident(TYPE)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(==) ident(T_HASH)operator(\)) operator({) - ident(hash) operator(=) ident(hash_alloc0)operator(()ident(klass)operator(\);) - ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl) operator(=) ident(st_copy)operator(()ident(RHASH)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(tbl)operator(\);) - - reserved(return) ident(hash)operator(;) - operator(}) - - reserved(if) operator(()ident(argc) operator(%) integer(2) operator(!=) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - ident(hash) operator(=) ident(hash_alloc)operator(()ident(klass)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(+=)integer(2)operator(\)) operator({) - ident(rb_hash_aset)operator(()ident(hash)operator(,) ident(argv)operator([)ident(i)operator(],) ident(argv)operator([)ident(i) operator(+) integer(1)operator(]\);) - operator(}) - - reserved(return) ident(hash)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(to_hash)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(return) ident(rb_convert_type)operator(()ident(hash)operator(,) ident(T_HASH)operator(,) stringoperator(,) stringoperator(\);) -operator(}) - -directive(static) pre_type(int) -ident(rb_hash_rehash_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(tbl)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) - ident(st_table) operator(*)ident(tbl)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(!=) ident(Qundef)operator(\)) ident(st_insert)operator(()ident(tbl)operator(,) ident(key)operator(,) ident(value)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.rehash -> hsh - * - * Rebuilds the hash based on the current hash values for each key. If - * values of key objects have changed since they were inserted, this - * method will reindex hsh. If Hash#rehash is - * called while an iterator is traversing the hash, an - * IndexError will be raised in the iterator. - * - * a = [ "a", "b" ] - * c = [ "c", "d" ] - * h = { a => 100, c => 300 } - * h[a] #=> 100 - * a[0] = "z" - * h[a] #=> nil - * h.rehash #=> {["z", "b"]=>100, ["c", "d"]=>300} - * h[a] #=> 100 - */) - -directive(static) ident(VALUE) -ident(rb_hash_rehash)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - - ident(rb_hash_modify)operator(()ident(hash)operator(\);) - ident(tbl) operator(=) ident(st_init_table_with_size)operator((&)ident(objhash)operator(,) ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(->)ident(num_entries)operator(\);) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(rb_hash_rehash_i)operator(,) operator(()ident(st_data_t)operator(\))ident(tbl)operator(\);) - ident(st_free_table)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(\);) - ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl) operator(=) ident(tbl)operator(;) - - reserved(return) ident(hash)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh[key] => value - * - * Element Reference---Retrieves the value object corresponding - * to the key object. If not found, returns the a default value (see - * Hash::new for details\). - * - * h = { "a" => 100, "b" => 200 } - * h["a"] #=> 100 - * h["c"] #=> nil - * - */) - -ident(VALUE) -ident(rb_hash_aref)operator(()ident(hash)operator(,) ident(key)operator(\)) - ident(VALUE) ident(hash)operator(,) ident(key)operator(;) -operator({) - ident(VALUE) ident(val)operator(;) - - reserved(if) operator((!)ident(st_lookup)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) ident(key)operator(,) operator(&)ident(val)operator(\)\)) operator({) - reserved(return) ident(rb_funcall)operator(()ident(hash)operator(,) ident(id_default)operator(,) integer(1)operator(,) ident(key)operator(\);) - operator(}) - reserved(return) ident(val)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.fetch(key [, default] \) => obj - * hsh.fetch(key\) {| key | block } => obj - * - * Returns a value from the hash for the given key. If the key can't be - * found, there are several options: With no other arguments, it will - * raise an IndexError exception; if default is - * given, then that will be returned; if the optional code block is - * specified, then that will be run and its result returned. - * - * h = { "a" => 100, "b" => 200 } - * h.fetch("a"\) #=> 100 - * h.fetch("z", "go fish"\) #=> "go fish" - * h.fetch("z"\) { |el| "go fish, #{el}"} #=> "go fish, z" - * - * The following example shows that an exception is raised if the key - * is not found and a default value is not supplied. - * - * h = { "a" => 100, "b" => 200 } - * h.fetch("z"\) - * - * produces: - * - * prog.rb:2:in `fetch': key not found (IndexError\) - * from prog.rb:2 - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_fetch)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(hash)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(key)operator(,) ident(if_none)operator(;) - ident(VALUE) ident(val)operator(;) - pre_type(long) ident(block_given)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(key)operator(,) operator(&)ident(if_none)operator(\);) - - ident(block_given) operator(=) ident(rb_block_given_p)operator((\);) - reserved(if) operator(()ident(block_given) operator(&&) ident(argc) operator(==) integer(2)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - reserved(if) operator((!)ident(st_lookup)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) ident(key)operator(,) operator(&)ident(val)operator(\)\)) operator({) - reserved(if) operator(()ident(block_given)operator(\)) reserved(return) ident(rb_yield)operator(()ident(key)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(if_none)operator(;) - operator(}) - reserved(return) ident(val)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.default(key=nil\) => obj - * - * Returns the default value, the value that would be returned by - * hsh[key] if key did not exist in hsh. - * See also Hash::new and Hash#default=. - * - * h = Hash.new #=> {} - * h.default #=> nil - * h.default(2\) #=> nil - * - * h = Hash.new("cat"\) #=> {} - * h.default #=> "cat" - * h.default(2\) #=> "cat" - * - * h = Hash.new {|h,k| h[k] = k.to_i*10} #=> {} - * h.default #=> 0 - * h.default(2\) #=> 20 - */) - -directive(static) ident(VALUE) -ident(rb_hash_default)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(hash)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(key)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(key)operator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(hash)operator(,) ident(HASH_PROC_DEFAULT)operator(\)\)) operator({) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(rb_funcall)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(ifnone)operator(,) ident(id_call)operator(,) integer(2)operator(,) ident(hash)operator(,) ident(key)operator(\);) - operator(}) - reserved(return) ident(RHASH)operator(()ident(hash)operator(\)->)ident(ifnone)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.default = obj => hsh - * - * Sets the default value, the value returned for a key that does not - * exist in the hash. It is not possible to set the a default to a - * Proc that will be executed on each key lookup. - * - * h = { "a" => 100, "b" => 200 } - * h.default = "Go fish" - * h["a"] #=> 100 - * h["z"] #=> "Go fish" - * # This doesn't do what you might hope... - * h.default = proc do |hash, key| - * hash[key] = key + key - * end - * h[2] #=> # - * h["cat"] #=> # - */) - -directive(static) ident(VALUE) -ident(rb_hash_set_default)operator(()ident(hash)operator(,) ident(ifnone)operator(\)) - ident(VALUE) ident(hash)operator(,) ident(ifnone)operator(;) -operator({) - ident(rb_hash_modify)operator(()ident(hash)operator(\);) - ident(RHASH)operator(()ident(hash)operator(\)->)ident(ifnone) operator(=) ident(ifnone)operator(;) - ident(FL_UNSET)operator(()ident(hash)operator(,) ident(HASH_PROC_DEFAULT)operator(\);) - reserved(return) ident(ifnone)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.default_proc -> anObject - * - * If Hash::new was invoked with a block, return that - * block, otherwise return nil. - * - * h = Hash.new {|h,k| h[k] = k*k } #=> {} - * p = h.default_proc #=> # - * a = [] #=> [] - * p.call(a, 2\) - * a #=> [nil, nil, 4] - */) - - -directive(static) ident(VALUE) -ident(rb_hash_default_proc)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(hash)operator(,) ident(HASH_PROC_DEFAULT)operator(\)\)) operator({) - reserved(return) ident(RHASH)operator(()ident(hash)operator(\)->)ident(ifnone)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(index_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(args)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) - ident(VALUE) operator(*)ident(args)operator(;) -operator({) - reserved(if) operator(()ident(rb_equal)operator(()ident(value)operator(,) ident(args)operator([)integer(0)operator(]\)\)) operator({) - ident(args)operator([)integer(1)operator(]) operator(=) ident(key)operator(;) - reserved(return) ident(ST_STOP)operator(;) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_hash_delete_key)operator(()ident(hash)operator(,) ident(key)operator(\)) - ident(VALUE) ident(hash)operator(,) ident(key)operator(;) -operator({) - ident(st_data_t) ident(ktmp) operator(=) operator(()ident(st_data_t)operator(\))ident(key)operator(,) ident(val)operator(;) - - reserved(if) operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(iter_lev) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(st_delete_safe)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) operator(&)ident(ktmp)operator(,) operator(&)ident(val)operator(,) ident(Qundef)operator(\)\)) operator({) - ident(FL_SET)operator(()ident(hash)operator(,) ident(HASH_DELETED)operator(\);) - reserved(return) operator(()ident(VALUE)operator(\))ident(val)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(st_delete)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) operator(&)ident(ktmp)operator(,) operator(&)ident(val)operator(\)\)) - reserved(return) operator(()ident(VALUE)operator(\))ident(val)operator(;) - reserved(return) ident(Qundef)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.index(value\) => key - * - * Returns the key for a given value. If not found, returns nil. - * - * h = { "a" => 100, "b" => 200 } - * h.index(200\) #=> "b" - * h.index(999\) #=> nil - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_index)operator(()ident(hash)operator(,) ident(value)operator(\)) - ident(VALUE) ident(hash)operator(,) ident(value)operator(;) -operator({) - ident(VALUE) ident(args)operator([)integer(2)operator(];) - - ident(args)operator([)integer(0)operator(]) operator(=) ident(value)operator(;) - ident(args)operator([)integer(1)operator(]) operator(=) ident(Qnil)operator(;) - - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(index_i)operator(,) operator(()ident(st_data_t)operator(\))ident(args)operator(\);) - - reserved(return) ident(args)operator([)integer(1)operator(];) -operator(}) - -comment(/* - * call-seq: - * hsh.indexes(key, ...\) => array - * hsh.indices(key, ...\) => array - * - * Deprecated in favor of Hash#select. - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_indexes)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(hash)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(indexes)operator(;) - pre_type(int) ident(i)operator(;) - - ident(rb_warn)operator(()stringoperator(,) - ident(rb_id2name)operator(()ident(rb_frame_last_func)operator((\)\)\);) - ident(indexes) operator(=) ident(rb_ary_new2)operator(()ident(argc)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(RARRAY)operator(()ident(indexes)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(=) ident(rb_hash_aref)operator(()ident(hash)operator(,) ident(argv)operator([)ident(i)operator(]\);) - ident(RARRAY)operator(()ident(indexes)operator(\)->)ident(len)operator(++;) - operator(}) - reserved(return) ident(indexes)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.delete(key\) => value - * hsh.delete(key\) {| key | block } => value - * - * Deletes and returns a key-value pair from hsh whose key is - * equal to key. If the key is not found, returns the - * default value. If the optional code block is given and the - * key is not found, pass in the key and return the result of - * block. - * - * h = { "a" => 100, "b" => 200 } - * h.delete("a"\) #=> 100 - * h.delete("z"\) #=> nil - * h.delete("z"\) { |el| "#{el} not found" } #=> "z not found" - * - */) - -ident(VALUE) -ident(rb_hash_delete)operator(()ident(hash)operator(,) ident(key)operator(\)) - ident(VALUE) ident(hash)operator(,) ident(key)operator(;) -operator({) - ident(VALUE) ident(val)operator(;) - - ident(rb_hash_modify)operator(()ident(hash)operator(\);) - ident(val) operator(=) ident(rb_hash_delete_key)operator(()ident(hash)operator(,) ident(key)operator(\);) - reserved(if) operator(()ident(val) operator(!=) ident(Qundef)operator(\)) reserved(return) ident(val)operator(;) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - reserved(return) ident(rb_yield)operator(()ident(key)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -reserved(struct) ident(shift_var) operator({) - ident(VALUE) ident(key)operator(;) - ident(VALUE) ident(val)operator(;) -operator(};) - -directive(static) pre_type(int) -ident(shift_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(var)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) - reserved(struct) ident(shift_var) operator(*)ident(var)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(if) operator(()ident(var)operator(->)ident(key) operator(!=) ident(Qundef)operator(\)) reserved(return) ident(ST_STOP)operator(;) - ident(var)operator(->)ident(key) operator(=) ident(key)operator(;) - ident(var)operator(->)ident(val) operator(=) ident(value)operator(;) - reserved(return) ident(ST_DELETE)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(shift_i_safe)operator(()ident(key)operator(,) ident(value)operator(,) ident(var)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) - reserved(struct) ident(shift_var) operator(*)ident(var)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(var)operator(->)ident(key) operator(=) ident(key)operator(;) - ident(var)operator(->)ident(val) operator(=) ident(value)operator(;) - reserved(return) ident(ST_STOP)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.shift -> anArray or obj - * - * Removes a key-value pair from hsh and returns it as the - * two-item array [ key, value ], or - * the hash's default value if the hash is empty. - * - * h = { 1 => "a", 2 => "b", 3 => "c" } - * h.shift #=> [1, "a"] - * h #=> {2=>"b", 3=>"c"} - */) - -directive(static) ident(VALUE) -ident(rb_hash_shift)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(struct) ident(shift_var) ident(var)operator(;) - - ident(rb_hash_modify)operator(()ident(hash)operator(\);) - ident(var)operator(.)ident(key) operator(=) ident(Qundef)operator(;) - reserved(if) operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(iter_lev) operator(>) integer(0)operator(\)) operator({) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(shift_i_safe)operator(,) operator(()ident(st_data_t)operator(\)&)ident(var)operator(\);) - reserved(if) operator(()ident(var)operator(.)ident(key) operator(!=) ident(Qundef)operator(\)) operator({) - ident(st_data_t) ident(key) operator(=) ident(var)operator(.)ident(key)operator(;) - reserved(if) operator(()ident(st_delete_safe)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) operator(&)ident(key)operator(,) integer(0)operator(,) ident(Qundef)operator(\)\)) operator({) - ident(FL_SET)operator(()ident(hash)operator(,) ident(HASH_DELETED)operator(\);) - operator(}) - operator(}) - operator(}) - reserved(else) operator({) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(shift_i)operator(,) operator(()ident(st_data_t)operator(\)&)ident(var)operator(\);) - operator(}) - - reserved(if) operator(()ident(var)operator(.)ident(key) operator(!=) ident(Qundef)operator(\)) operator({) - reserved(return) ident(rb_assoc_new)operator(()ident(var)operator(.)ident(key)operator(,) ident(var)operator(.)ident(val)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(FL_TEST)operator(()ident(hash)operator(,) ident(HASH_PROC_DEFAULT)operator(\)\)) operator({) - reserved(return) ident(rb_funcall)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(ifnone)operator(,) ident(id_call)operator(,) integer(2)operator(,) ident(hash)operator(,) ident(Qnil)operator(\);) - operator(}) - reserved(else) operator({) - reserved(return) ident(RHASH)operator(()ident(hash)operator(\)->)ident(ifnone)operator(;) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(delete_if_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(hash)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(,) ident(hash)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield_values)operator(()integer(2)operator(,) ident(key)operator(,) ident(value)operator(\)\)\)) operator({) - ident(rb_hash_delete_key)operator(()ident(hash)operator(,) ident(key)operator(\);) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.delete_if {| key, value | block } -> hsh - * - * Deletes every key-value pair from hsh for which block - * evaluates to true. - * - * h = { "a" => 100, "b" => 200, "c" => 300 } - * h.delete_if {|key, value| key >= "b" } #=> {"a"=>100} - * - */) - -ident(VALUE) -ident(rb_hash_delete_if)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(rb_hash_modify)operator(()ident(hash)operator(\);) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(delete_if_i)operator(,) ident(hash)operator(\);) - reserved(return) ident(hash)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.reject! {| key, value | block } -> hsh or nil - * - * Equivalent to Hash#delete_if, but returns - * nil if no changes were made. - */) - -ident(VALUE) -ident(rb_hash_reject_bang)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - pre_type(int) ident(n) operator(=) ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(->)ident(num_entries)operator(;) - ident(rb_hash_delete_if)operator(()ident(hash)operator(\);) - reserved(if) operator(()ident(n) operator(==) ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(->)ident(num_entries)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(hash)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.reject {| key, value | block } -> a_hash - * - * Same as Hash#delete_if, but works on (and returns\) a - * copy of the hsh. Equivalent to - * hsh.dup.delete_if. - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_reject)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(return) ident(rb_hash_delete_if)operator(()ident(rb_obj_dup)operator(()ident(hash)operator(\)\);) -operator(}) - -directive(static) pre_type(int) -ident(select_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(result)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(,) ident(result)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield_values)operator(()integer(2)operator(,) ident(key)operator(,) ident(value)operator(\)\)\)) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_assoc_new)operator(()ident(key)operator(,) ident(value)operator(\)\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.values_at(key, ...\) => array - * - * Return an array containing the values associated with the given keys. - * Also see Hash.select. - * - * h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" } - * h.values_at("cow", "cat"\) #=> ["bovine", "feline"] -*/) - -ident(VALUE) -ident(rb_hash_values_at)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(hash)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(rb_ary_new)operator((\);) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_hash_aref)operator(()ident(hash)operator(,) ident(argv)operator([)ident(i)operator(]\)\);) - operator(}) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.select {|key, value| block} => array - * - * Returns a new array consisting of [key,value] - * pairs for which the block returns true. - * Also see Hash.values_at. - * - * h = { "a" => 100, "b" => 200, "c" => 300 } - * h.select {|k,v| k > "a"} #=> [["b", 200], ["c", 300]] - * h.select {|k,v| v < 200} #=> [["a", 100]] - */) - -ident(VALUE) -ident(rb_hash_select)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(hash)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(result)operator(;) - - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - ident(result) operator(=) ident(rb_ary_new)operator((\);) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(select_i)operator(,) ident(result)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(clear_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(dummy)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(,) ident(dummy)operator(;) -operator({) - reserved(return) ident(ST_DELETE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.clear -> hsh - * - * Removes all key-value pairs from hsh. - * - * h = { "a" => 100, "b" => 200 } #=> {"a"=>100, "b"=>200} - * h.clear #=> {} - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_clear)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(rb_hash_modify)operator(()ident(hash)operator(\);) - reserved(if) operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(->)ident(num_entries) operator(>) integer(0)operator(\)) operator({) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(clear_i)operator(,) integer(0)operator(\);) - operator(}) - - reserved(return) ident(hash)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh[key] = value => value - * hsh.store(key, value\) => value - * - * Element Assignment---Associates the value given by - * value with the key given by key. - * key should not have its value changed while it is in - * use as a key (a String passed as a key will be - * duplicated and frozen\). - * - * h = { "a" => 100, "b" => 200 } - * h["a"] = 9 - * h["c"] = 4 - * h #=> {"a"=>9, "b"=>200, "c"=>4} - * - */) - -ident(VALUE) -ident(rb_hash_aset)operator(()ident(hash)operator(,) ident(key)operator(,) ident(val)operator(\)) - ident(VALUE) ident(hash)operator(,) ident(key)operator(,) ident(val)operator(;) -operator({) - ident(rb_hash_modify)operator(()ident(hash)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(key)operator(\)) operator(!=) ident(T_STRING) operator(||) ident(st_lookup)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) ident(key)operator(,) integer(0)operator(\)\)) operator({) - ident(st_insert)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) ident(key)operator(,) ident(val)operator(\);) - operator(}) - reserved(else) operator({) - ident(st_add_direct)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) ident(rb_str_new4)operator(()ident(key)operator(\),) ident(val)operator(\);) - operator(}) - reserved(return) ident(val)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(replace_i)operator(()ident(key)operator(,) ident(val)operator(,) ident(hash)operator(\)) - ident(VALUE) ident(key)operator(,) ident(val)operator(,) ident(hash)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(!=) ident(Qundef)operator(\)) operator({) - ident(rb_hash_aset)operator(()ident(hash)operator(,) ident(key)operator(,) ident(val)operator(\);) - operator(}) - - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.replace(other_hash\) -> hsh - * - * Replaces the contents of hsh with the contents of - * other_hash. - * - * h = { "a" => 100, "b" => 200 } - * h.replace({ "c" => 300, "d" => 400 }\) #=> {"c"=>300, "d"=>400} - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_replace)operator(()ident(hash)operator(,) ident(hash2)operator(\)) - ident(VALUE) ident(hash)operator(,) ident(hash2)operator(;) -operator({) - ident(hash2) operator(=) ident(to_hash)operator(()ident(hash2)operator(\);) - reserved(if) operator(()ident(hash) operator(==) ident(hash2)operator(\)) reserved(return) ident(hash)operator(;) - ident(rb_hash_clear)operator(()ident(hash)operator(\);) - ident(rb_hash_foreach)operator(()ident(hash2)operator(,) ident(replace_i)operator(,) ident(hash)operator(\);) - ident(RHASH)operator(()ident(hash)operator(\)->)ident(ifnone) operator(=) ident(RHASH)operator(()ident(hash2)operator(\)->)ident(ifnone)operator(;) - reserved(if) operator(()ident(FL_TEST)operator(()ident(hash2)operator(,) ident(HASH_PROC_DEFAULT)operator(\)\)) operator({) - ident(FL_SET)operator(()ident(hash)operator(,) ident(HASH_PROC_DEFAULT)operator(\);) - operator(}) - reserved(else) operator({) - ident(FL_UNSET)operator(()ident(hash)operator(,) ident(HASH_PROC_DEFAULT)operator(\);) - operator(}) - - reserved(return) ident(hash)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.length => fixnum - * hsh.size => fixnum - * - * Returns the number of key-value pairs in the hash. - * - * h = { "d" => 100, "a" => 200, "v" => 300, "e" => 400 } - * h.length #=> 4 - * h.delete("a"\) #=> 200 - * h.length #=> 3 - */) - -directive(static) ident(VALUE) -ident(rb_hash_size)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(return) ident(INT2FIX)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(->)ident(num_entries)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * hsh.empty? => true or false - * - * Returns true if hsh contains no key-value pairs. - * - * {}.empty? #=> true - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_empty_p)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(if) operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(->)ident(num_entries) operator(==) integer(0)operator(\)) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(each_value_i)operator(()ident(key)operator(,) ident(value)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(rb_yield)operator(()ident(value)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.each_value {| value | block } -> hsh - * - * Calls block once for each key in hsh, passing the - * value as a parameter. - * - * h = { "a" => 100, "b" => 200 } - * h.each_value {|value| puts value } - * - * produces: - * - * 100 - * 200 - */) - -directive(static) ident(VALUE) -ident(rb_hash_each_value)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(each_value_i)operator(,) integer(0)operator(\);) - reserved(return) ident(hash)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(each_key_i)operator(()ident(key)operator(,) ident(value)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(rb_yield)operator(()ident(key)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.each_key {| key | block } -> hsh - * - * Calls block once for each key in hsh, passing the key - * as a parameter. - * - * h = { "a" => 100, "b" => 200 } - * h.each_key {|key| puts key } - * - * produces: - * - * a - * b - */) -directive(static) ident(VALUE) -ident(rb_hash_each_key)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(each_key_i)operator(,) integer(0)operator(\);) - reserved(return) ident(hash)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(each_pair_i)operator(()ident(key)operator(,) ident(value)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(rb_yield_values)operator(()integer(2)operator(,) ident(key)operator(,) ident(value)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.each_pair {| key_value_array | block } -> hsh - * - * Calls block once for each key in hsh, passing the key - * and value as parameters. - * - * h = { "a" => 100, "b" => 200 } - * h.each_pair {|key, value| puts "#{key} is #{value}" } - * - * produces: - * - * a is 100 - * b is 200 - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_each_pair)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(each_pair_i)operator(,) integer(0)operator(\);) - reserved(return) ident(hash)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(each_i)operator(()ident(key)operator(,) ident(value)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(rb_yield)operator(()ident(rb_assoc_new)operator(()ident(key)operator(,) ident(value)operator(\)\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.each {| key, value | block } -> hsh - * - * Calls block once for each key in hsh, passing the key - * and value to the block as a two-element array. Because of the assignment - * semantics of block parameters, these elements will be split out if the - * block has two formal parameters. Also see Hash.each_pair, which - * will be marginally more efficient for blocks with two parameters. - * - * h = { "a" => 100, "b" => 200 } - * h.each {|key, value| puts "#{key} is #{value}" } - * - * produces: - * - * a is 100 - * b is 200 - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_each)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(each_i)operator(,) integer(0)operator(\);) - reserved(return) ident(hash)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(to_a_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(ary)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(,) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_assoc_new)operator(()ident(key)operator(,) ident(value)operator(\)\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.to_a -> array - * - * Converts hsh to a nested array of [ key, - * value ] arrays. - * - * h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 } - * h.to_a #=> [["a", 100], ["c", 300], ["d", 400]] - */) - -directive(static) ident(VALUE) -ident(rb_hash_to_a)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(ary)operator(;) - - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(to_a_i)operator(,) ident(ary)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(hash)operator(\)\)) ident(OBJ_TAINT)operator(()ident(ary)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.sort => array - * hsh.sort {| a, b | block } => array - * - * Converts hsh to a nested array of [ key, - * value ] arrays and sorts it, using - * Array#sort. - * - * h = { "a" => 20, "b" => 30, "c" => 10 } - * h.sort #=> [["a", 20], ["b", 30], ["c", 10]] - * h.sort {|a,b| a[1]<=>b[1]} #=> [["c", 10], ["a", 20], ["b", 30]] - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_sort)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(entries) operator(=) ident(rb_hash_to_a)operator(()ident(hash)operator(\);) - ident(rb_ary_sort_bang)operator(()ident(entries)operator(\);) - reserved(return) ident(entries)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(inspect_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(str)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(,) ident(str)operator(;) -operator({) - ident(VALUE) ident(str2)operator(;) - - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) integer(1)operator(\)) operator({) - ident(rb_str_cat2)operator(()ident(str)operator(,) stringoperator(\);) - operator(}) - ident(str2) operator(=) ident(rb_inspect)operator(()ident(key)operator(\);) - ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(str2)operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(str2)operator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) string)delimiter(")>operator(\);) - ident(str2) operator(=) ident(rb_inspect)operator(()ident(value)operator(\);) - ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(str2)operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(str2)operator(\);) - - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(inspect_hash)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - - ident(str) operator(=) ident(rb_str_buf_new2)operator(()stringoperator(\);) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(inspect_i)operator(,) ident(str)operator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(hash)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.inspect => string - * - * Return the contents of this hash as a string. - */) - -directive(static) ident(VALUE) -ident(rb_hash_inspect)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(if) operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl) operator(==) integer(0) operator(||) ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(->)ident(num_entries) operator(==) integer(0)operator(\)) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(if) operator(()ident(rb_inspecting_p)operator(()ident(hash)operator(\)\)) reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(return) ident(rb_protect_inspect)operator(()ident(inspect_hash)operator(,) ident(hash)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(to_s_hash)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(return) ident(rb_ary_to_s)operator(()ident(rb_hash_to_a)operator(()ident(hash)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * hsh.to_s => string - * - * Converts hsh to a string by converting the hash to an array - * of [ key, value ] pairs and then - * converting that array to a string using Array#join with - * the default separator. - * - * h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 } - * h.to_s #=> "a100c300d400" - */) - -directive(static) ident(VALUE) -ident(rb_hash_to_s)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(if) operator(()ident(rb_inspecting_p)operator(()ident(hash)operator(\)\)) reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(return) ident(rb_protect_inspect)operator(()ident(to_s_hash)operator(,) ident(hash)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * hsh.to_hash => hsh - * - * Returns self. - */) - -directive(static) ident(VALUE) -ident(rb_hash_to_hash)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(return) ident(hash)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(keys_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(ary)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(,) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(key)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.keys => array - * - * Returns a new array populated with the keys from this hash. See also - * Hash#values. - * - * h = { "a" => 100, "b" => 200, "c" => 300, "d" => 400 } - * h.keys #=> ["a", "b", "c", "d"] - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_keys)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(ary)operator(;) - - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(keys_i)operator(,) ident(ary)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(values_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(ary)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(,) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(value)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.values => array - * - * Returns a new array populated with the values from hsh. See - * also Hash#keys. - * - * h = { "a" => 100, "b" => 200, "c" => 300 } - * h.values #=> [100, 200, 300] - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_values)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(ary)operator(;) - - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(values_i)operator(,) ident(ary)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.has_key?(key\) => true or false - * hsh.include?(key\) => true or false - * hsh.key?(key\) => true or false - * hsh.member?(key\) => true or false - * - * Returns true if the given key is present in hsh. - * - * h = { "a" => 100, "b" => 200 } - * h.has_key?("a"\) #=> true - * h.has_key?("z"\) #=> false - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_has_key)operator(()ident(hash)operator(,) ident(key)operator(\)) - ident(VALUE) ident(hash)operator(;) - ident(VALUE) ident(key)operator(;) -operator({) - reserved(if) operator(()ident(st_lookup)operator(()ident(RHASH)operator(()ident(hash)operator(\)->)ident(tbl)operator(,) ident(key)operator(,) integer(0)operator(\)\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(rb_hash_search_value)operator(()ident(key)operator(,) ident(value)operator(,) ident(data)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(,) operator(*)ident(data)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(if) operator(()ident(rb_equal)operator(()ident(value)operator(,) ident(data)operator([)integer(1)operator(]\)\)) operator({) - ident(data)operator([)integer(0)operator(]) operator(=) ident(Qtrue)operator(;) - reserved(return) ident(ST_STOP)operator(;) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.has_value?(value\) => true or false - * hsh.value?(value\) => true or false - * - * Returns true if the given value is present for some key - * in hsh. - * - * h = { "a" => 100, "b" => 200 } - * h.has_value?(100\) #=> true - * h.has_value?(999\) #=> false - */) - -directive(static) ident(VALUE) -ident(rb_hash_has_value)operator(()ident(hash)operator(,) ident(val)operator(\)) - ident(VALUE) ident(hash)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(VALUE) ident(data)operator([)integer(2)operator(];) - - ident(data)operator([)integer(0)operator(]) operator(=) ident(Qfalse)operator(;) - ident(data)operator([)integer(1)operator(]) operator(=) ident(val)operator(;) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(rb_hash_search_value)operator(,) operator(()ident(st_data_t)operator(\))ident(data)operator(\);) - reserved(return) ident(data)operator([)integer(0)operator(];) -operator(}) - -reserved(struct) ident(equal_data) operator({) - pre_type(int) ident(result)operator(;) - ident(st_table) operator(*)ident(tbl)operator(;) -operator(};) - -directive(static) pre_type(int) -ident(equal_i)operator(()ident(key)operator(,) ident(val1)operator(,) ident(data)operator(\)) - ident(VALUE) ident(key)operator(,) ident(val1)operator(;) - reserved(struct) ident(equal_data) operator(*)ident(data)operator(;) -operator({) - ident(VALUE) ident(val2)operator(;) - - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(if) operator((!)ident(st_lookup)operator(()ident(data)operator(->)ident(tbl)operator(,) ident(key)operator(,) operator(&)ident(val2)operator(\)\)) operator({) - ident(data)operator(->)ident(result) operator(=) ident(Qfalse)operator(;) - reserved(return) ident(ST_STOP)operator(;) - operator(}) - reserved(if) operator((!)ident(rb_equal)operator(()ident(val1)operator(,) ident(val2)operator(\)\)) operator({) - ident(data)operator(->)ident(result) operator(=) ident(Qfalse)operator(;) - reserved(return) ident(ST_STOP)operator(;) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(hash_equal)operator(()ident(hash1)operator(,) ident(hash2)operator(,) ident(eql)operator(\)) - ident(VALUE) ident(hash1)operator(,) ident(hash2)operator(;) - pre_type(int) ident(eql)operator(;) comment(/* compare default value if true */) -operator({) - reserved(struct) ident(equal_data) ident(data)operator(;) - - reserved(if) operator(()ident(hash1) operator(==) ident(hash2)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(hash2)operator(\)) operator(!=) ident(T_HASH)operator(\)) operator({) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(hash2)operator(,) ident(rb_intern)operator(()stringoperator(\)\)\)) operator({) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(rb_equal)operator(()ident(hash2)operator(,) ident(hash1)operator(\);) - operator(}) - reserved(if) operator(()ident(RHASH)operator(()ident(hash1)operator(\)->)ident(tbl)operator(->)ident(num_entries) operator(!=) ident(RHASH)operator(()ident(hash2)operator(\)->)ident(tbl)operator(->)ident(num_entries)operator(\)) - reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(eql)operator(\)) operator({) - reserved(if) operator((!()ident(rb_equal)operator(()ident(RHASH)operator(()ident(hash1)operator(\)->)ident(ifnone)operator(,) ident(RHASH)operator(()ident(hash2)operator(\)->)ident(ifnone)operator(\)) operator(&&) - ident(FL_TEST)operator(()ident(hash1)operator(,) ident(HASH_PROC_DEFAULT)operator(\)) operator(==) ident(FL_TEST)operator(()ident(hash2)operator(,) ident(HASH_PROC_DEFAULT)operator(\)\)\)) - reserved(return) ident(Qfalse)operator(;) - operator(}) - - ident(data)operator(.)ident(tbl) operator(=) ident(RHASH)operator(()ident(hash2)operator(\)->)ident(tbl)operator(;) - ident(data)operator(.)ident(result) operator(=) ident(Qtrue)operator(;) - ident(rb_hash_foreach)operator(()ident(hash1)operator(,) ident(equal_i)operator(,) operator(()ident(st_data_t)operator(\)&)ident(data)operator(\);) - - reserved(return) ident(data)operator(.)ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh == other_hash => true or false - * - * Equality---Two hashes are equal if they each contain the same number - * of keys and if each key-value pair is equal to (according to - * Object#==\) the corresponding elements in the other - * hash. - * - * h1 = { "a" => 1, "c" => 2 } - * h2 = { 7 => 35, "c" => 2, "a" => 1 } - * h3 = { "a" => 1, "c" => 2, 7 => 35 } - * h4 = { "a" => 1, "d" => 2, "f" => 35 } - * h1 == h2 #=> false - * h2 == h3 #=> true - * h3 == h4 #=> false - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_equal)operator(()ident(hash1)operator(,) ident(hash2)operator(\)) - ident(VALUE) ident(hash1)operator(,) ident(hash2)operator(;) -operator({) - reserved(return) ident(hash_equal)operator(()ident(hash1)operator(,) ident(hash2)operator(,) ident(Qfalse)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(rb_hash_invert_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(hash)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(rb_hash_aset)operator(()ident(hash)operator(,) ident(value)operator(,) ident(key)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.invert -> aHash - * - * Returns a new hash created by using hsh's values as keys, and - * the keys as values. - * - * h = { "n" => 100, "m" => 100, "y" => 300, "d" => 200, "a" => 0 } - * h.invert #=> {0=>"a", 100=>"n", 200=>"d", 300=>"y"} - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_invert)operator(()ident(hash)operator(\)) - ident(VALUE) ident(hash)operator(;) -operator({) - ident(VALUE) ident(h) operator(=) ident(rb_hash_new)operator((\);) - - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(rb_hash_invert_i)operator(,) ident(h)operator(\);) - reserved(return) ident(h)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(rb_hash_update_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(hash)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(rb_hash_aset)operator(()ident(hash)operator(,) ident(key)operator(,) ident(value)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(rb_hash_update_block_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(hash)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) - ident(VALUE) ident(hash)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(==) ident(Qundef)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(if) operator(()ident(rb_hash_has_key)operator(()ident(hash)operator(,) ident(key)operator(\)\)) operator({) - ident(value) operator(=) ident(rb_yield_values)operator(()integer(3)operator(,) ident(key)operator(,) ident(rb_hash_aref)operator(()ident(hash)operator(,) ident(key)operator(\),) ident(value)operator(\);) - operator(}) - ident(rb_hash_aset)operator(()ident(hash)operator(,) ident(key)operator(,) ident(value)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.merge!(other_hash\) => hsh - * hsh.update(other_hash\) => hsh - * hsh.merge!(other_hash\){|key, oldval, newval| block} => hsh - * hsh.update(other_hash\){|key, oldval, newval| block} => hsh - * - * Adds the contents of other_hash to hsh, overwriting - * entries with duplicate keys with those from other_hash. - * - * h1 = { "a" => 100, "b" => 200 } - * h2 = { "b" => 254, "c" => 300 } - * h1.merge!(h2\) #=> {"a"=>100, "b"=>254, "c"=>300} - */) - -directive(static) ident(VALUE) -ident(rb_hash_update)operator(()ident(hash1)operator(,) ident(hash2)operator(\)) - ident(VALUE) ident(hash1)operator(,) ident(hash2)operator(;) -operator({) - ident(hash2) operator(=) ident(to_hash)operator(()ident(hash2)operator(\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(rb_hash_foreach)operator(()ident(hash2)operator(,) ident(rb_hash_update_block_i)operator(,) ident(hash1)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_hash_foreach)operator(()ident(hash2)operator(,) ident(rb_hash_update_i)operator(,) ident(hash1)operator(\);) - operator(}) - reserved(return) ident(hash1)operator(;) -operator(}) - -comment(/* - * call-seq: - * hsh.merge(other_hash\) -> a_hash - * hsh.merge(other_hash\){|key, oldval, newval| block} -> a_hash - * - * Returns a new hash containing the contents of other_hash and - * the contents of hsh, overwriting entries in hsh with - * duplicate keys with those from other_hash. - * - * h1 = { "a" => 100, "b" => 200 } - * h2 = { "b" => 254, "c" => 300 } - * h1.merge(h2\) #=> {"a"=>100, "b"=>254, "c"=>300} - * h1 #=> {"a"=>100, "b"=>200} - * - */) - -directive(static) ident(VALUE) -ident(rb_hash_merge)operator(()ident(hash1)operator(,) ident(hash2)operator(\)) - ident(VALUE) ident(hash1)operator(,) ident(hash2)operator(;) -operator({) - reserved(return) ident(rb_hash_update)operator(()ident(rb_obj_dup)operator(()ident(hash1)operator(\),) ident(hash2)operator(\);) -operator(}) - -directive(static) pre_type(int) ident(path_tainted) operator(=) operator(-)integer(1)operator(;) - -directive(static) pre_type(char) operator(**)ident(origenviron)operator(;) -preprocessor(#ifdef) ident(_WIN32) -preprocessor(#define) ident(GET_ENVIRON)operator(()ident(e)operator(\)) operator(()ident(e) operator(=) ident(rb_w32_get_environ)operator((\)\)) -preprocessor(#define) ident(FREE_ENVIRON)operator(()ident(e)operator(\)) ident(rb_w32_free_environ)operator(()ident(e)operator(\)) -directive(static) pre_type(char) operator(**)ident(my_environ)operator(;) -preprocessor(#undef) ident(environ) -preprocessor(#define) ident(environ) ident(my_environ) -preprocessor(#elif) ident(defined)operator(()ident(__APPLE__)operator(\)) -preprocessor(#undef) ident(environ) -preprocessor(#define) ident(environ) operator((*)ident(_NSGetEnviron)operator((\)\)) -preprocessor(#define) ident(GET_ENVIRON)operator(()ident(e)operator(\)) operator(()ident(e)operator(\)) -preprocessor(#define) ident(FREE_ENVIRON)operator(()ident(e)operator(\)) -preprocessor(#else) -directive(extern) pre_type(char) operator(**)ident(environ)operator(;) -preprocessor(#define) ident(GET_ENVIRON)operator(()ident(e)operator(\)) operator(()ident(e)operator(\)) -preprocessor(#define) ident(FREE_ENVIRON)operator(()ident(e)operator(\)) -preprocessor(#endif) - -directive(static) ident(VALUE) -ident(env_str_new)operator(()ident(ptr)operator(,) ident(len)operator(\)) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(rb_tainted_str_new)operator(()ident(ptr)operator(,) ident(len)operator(\);) - - ident(rb_obj_freeze)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_str_new2)operator(()ident(ptr)operator(\)) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) -operator({) - reserved(if) operator((!)ident(ptr)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(env_str_new)operator(()ident(ptr)operator(,) ident(strlen)operator(()ident(ptr)operator(\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(env_delete)operator(()ident(obj)operator(,) ident(name)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(name)operator(;) -operator({) - pre_type(char) operator(*)ident(nam)operator(,) operator(*)ident(val)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - ident(SafeStringValue)operator(()ident(name)operator(\);) - ident(nam) operator(=) ident(RSTRING)operator(()ident(name)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(strlen)operator(()ident(nam)operator(\)) operator(!=) ident(RSTRING)operator(()ident(name)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(val) operator(=) ident(getenv)operator(()ident(nam)operator(\);) - reserved(if) operator(()ident(val)operator(\)) operator({) - ident(VALUE) ident(value) operator(=) ident(env_str_new2)operator(()ident(val)operator(\);) - - ident(ruby_setenv)operator(()ident(nam)operator(,) integer(0)operator(\);) -preprocessor(#ifdef) ident(ENV_IGNORECASE) - reserved(if) operator(()ident(strcasecmp)operator(()ident(nam)operator(,) ident(PATH_ENV)operator(\)) operator(==) integer(0)operator(\)) -preprocessor(#else) - reserved(if) operator(()ident(strcmp)operator(()ident(nam)operator(,) ident(PATH_ENV)operator(\)) operator(==) integer(0)operator(\)) -preprocessor(#endif) - operator({) - ident(path_tainted) operator(=) integer(0)operator(;) - operator(}) - reserved(return) ident(value)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_delete_m)operator(()ident(obj)operator(,) ident(name)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(name)operator(;) -operator({) - ident(VALUE) ident(val)operator(;) - - ident(val) operator(=) ident(env_delete)operator(()ident(obj)operator(,) ident(name)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(val)operator(\)) operator(&&) ident(rb_block_given_p)operator((\)\)) ident(rb_yield)operator(()ident(name)operator(\);) - reserved(return) ident(val)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_f_getenv)operator(()ident(obj)operator(,) ident(name)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(name)operator(;) -operator({) - pre_type(char) operator(*)ident(nam)operator(,) operator(*)ident(env)operator(;) - - ident(StringValue)operator(()ident(name)operator(\);) - ident(nam) operator(=) ident(RSTRING)operator(()ident(name)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(strlen)operator(()ident(nam)operator(\)) operator(!=) ident(RSTRING)operator(()ident(name)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(env) operator(=) ident(getenv)operator(()ident(nam)operator(\);) - reserved(if) operator(()ident(env)operator(\)) operator({) -preprocessor(#ifdef) ident(ENV_IGNORECASE) - reserved(if) operator(()ident(strcasecmp)operator(()ident(nam)operator(,) ident(PATH_ENV)operator(\)) operator(==) integer(0) operator(&&) operator(!)ident(rb_env_path_tainted)operator((\)\)) -preprocessor(#else) - reserved(if) operator(()ident(strcmp)operator(()ident(nam)operator(,) ident(PATH_ENV)operator(\)) operator(==) integer(0) operator(&&) operator(!)ident(rb_env_path_tainted)operator((\)\)) -preprocessor(#endif) - operator({) - ident(VALUE) ident(str) operator(=) ident(rb_str_new2)operator(()ident(env)operator(\);) - - ident(rb_obj_freeze)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) - operator(}) - reserved(return) ident(env_str_new2)operator(()ident(env)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_fetch)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(key)operator(,) ident(if_none)operator(;) - pre_type(long) ident(block_given)operator(;) - pre_type(char) operator(*)ident(nam)operator(,) operator(*)ident(env)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(key)operator(,) operator(&)ident(if_none)operator(\);) - ident(block_given) operator(=) ident(rb_block_given_p)operator((\);) - reserved(if) operator(()ident(block_given) operator(&&) ident(argc) operator(==) integer(2)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - ident(StringValue)operator(()ident(key)operator(\);) - ident(nam) operator(=) ident(RSTRING)operator(()ident(key)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(strlen)operator(()ident(nam)operator(\)) operator(!=) ident(RSTRING)operator(()ident(key)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(env) operator(=) ident(getenv)operator(()ident(nam)operator(\);) - reserved(if) operator((!)ident(env)operator(\)) operator({) - reserved(if) operator(()ident(block_given)operator(\)) reserved(return) ident(rb_yield)operator(()ident(key)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(if_none)operator(;) - operator(}) -preprocessor(#ifdef) ident(ENV_IGNORECASE) - reserved(if) operator(()ident(strcasecmp)operator(()ident(nam)operator(,) ident(PATH_ENV)operator(\)) operator(==) integer(0) operator(&&) operator(!)ident(rb_env_path_tainted)operator((\)\)) -preprocessor(#else) - reserved(if) operator(()ident(strcmp)operator(()ident(nam)operator(,) ident(PATH_ENV)operator(\)) operator(==) integer(0) operator(&&) operator(!)ident(rb_env_path_tainted)operator((\)\)) -preprocessor(#endif) - reserved(return) ident(rb_str_new2)operator(()ident(env)operator(\);) - reserved(return) ident(env_str_new2)operator(()ident(env)operator(\);) -operator(}) - -directive(static) directive(void) -ident(path_tainted_p)operator(()ident(path)operator(\)) - pre_type(char) operator(*)ident(path)operator(;) -operator({) - ident(path_tainted) operator(=) ident(rb_path_check)operator(()ident(path)operator(\)?)integer(0)operator(:)integer(1)operator(;) -operator(}) - -pre_type(int) -ident(rb_env_path_tainted)operator((\)) -operator({) - reserved(if) operator(()ident(path_tainted) operator(<) integer(0)operator(\)) operator({) - ident(path_tainted_p)operator(()ident(getenv)operator(()ident(PATH_ENV)operator(\)\);) - operator(}) - reserved(return) ident(path_tainted)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(envix)operator(()ident(nam)operator(\)) - directive(const) pre_type(char) operator(*)ident(nam)operator(;) -operator({) - directive(register) pre_type(int) ident(i)operator(,) ident(len) operator(=) ident(strlen)operator(()ident(nam)operator(\);) - pre_type(char) operator(**)ident(env)operator(;) - - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(env)operator([)ident(i)operator(];) ident(i)operator(++\)) operator({) - reserved(if) operator(() -preprocessor(#ifdef) ident(ENV_IGNORECASE) - ident(strncasecmp)operator(()ident(env)operator([)ident(i)operator(],)ident(nam)operator(,)ident(len)operator(\)) operator(==) integer(0) -preprocessor(#else) - ident(memcmp)operator(()ident(env)operator([)ident(i)operator(],)ident(nam)operator(,)ident(len)operator(\)) operator(==) integer(0) -preprocessor(#endif) - operator(&&) ident(env)operator([)ident(i)operator(][)ident(len)operator(]) operator(==) char('=')operator(\)) - reserved(break)operator(;) comment(/* memcmp must come first to avoid */) - operator(}) comment(/* potential SEGV's */) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(i)operator(;) -operator(}) - -directive(void) -ident(ruby_setenv)operator(()ident(name)operator(,) ident(value)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - directive(const) pre_type(char) operator(*)ident(value)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(_WIN32)operator(\)) - comment(/* The sane way to deal with the environment. - * Has these advantages over putenv(\) & co.: - * * enables us to store a truly empty value in the - * environment (like in UNIX\). - * * we don't have to deal with RTL globals, bugs and leaks. - * * Much faster. - * Why you may want to enable USE_WIN32_RTL_ENV: - * * environ[] and RTL functions will not reflect changes, - * which might be an issue if extensions want to access - * the env. via RTL. This cuts both ways, since RTL will - * not see changes made by extensions that call the Win32 - * functions directly, either. - * GSAR 97-06-07 - * - * REMARK: USE_WIN32_RTL_ENV is already obsoleted since we don't use - * RTL's environ global variable directly yet. - */) - ident(SetEnvironmentVariable)operator(()ident(name)operator(,)ident(value)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETENV)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_UNSETENV)operator(\)) -preprocessor(#undef) ident(setenv) -preprocessor(#undef) ident(unsetenv) - reserved(if) operator(()ident(value)operator(\)) - ident(setenv)operator(()ident(name)operator(,)ident(value)operator(,)integer(1)operator(\);) - reserved(else) - ident(unsetenv)operator(()ident(name)operator(\);) -preprocessor(#else) comment(/* WIN32 */) - ident(size_t) ident(len)operator(;) - pre_type(int) ident(i)operator(=)ident(envix)operator(()ident(name)operator(\);) comment(/* where does it go? */) - - reserved(if) operator(()ident(environ) operator(==) ident(origenviron)operator(\)) operator({) comment(/* need we copy environment? */) - pre_type(int) ident(j)operator(;) - pre_type(int) ident(max)operator(;) - pre_type(char) operator(**)ident(tmpenv)operator(;) - - reserved(for) operator(()ident(max) operator(=) ident(i)operator(;) ident(environ)operator([)ident(max)operator(];) ident(max)operator(++\)) operator(;) - ident(tmpenv) operator(=) ident(ALLOC_N)operator(()pre_type(char)operator(*,) ident(max)operator(+)integer(2)operator(\);) - reserved(for) operator(()ident(j)operator(=)integer(0)operator(;) ident(j)operator(<)ident(max)operator(;) ident(j)operator(++\)) comment(/* copy environment */) - ident(tmpenv)operator([)ident(j)operator(]) operator(=) ident(strdup)operator(()ident(environ)operator([)ident(j)operator(]\);) - ident(tmpenv)operator([)ident(max)operator(]) operator(=) integer(0)operator(;) - ident(environ) operator(=) ident(tmpenv)operator(;) comment(/* tell exec where it is now */) - operator(}) - reserved(if) operator(()ident(environ)operator([)ident(i)operator(]\)) operator({) - pre_type(char) operator(**)ident(envp) operator(=) ident(origenviron)operator(;) - reserved(while) operator((*)ident(envp) operator(&&) operator(*)ident(envp) operator(!=) ident(environ)operator([)ident(i)operator(]\)) ident(envp)operator(++;) - reserved(if) operator((!*)ident(envp)operator(\)) - ident(free)operator(()ident(environ)operator([)ident(i)operator(]\);) - reserved(if) operator((!)ident(value)operator(\)) operator({) - reserved(while) operator(()ident(environ)operator([)ident(i)operator(]\)) operator({) - ident(environ)operator([)ident(i)operator(]) operator(=) ident(environ)operator([)ident(i)operator(+)integer(1)operator(];) - ident(i)operator(++;) - operator(}) - reserved(return)operator(;) - operator(}) - operator(}) - reserved(else) operator({) comment(/* does not exist yet */) - reserved(if) operator((!)ident(value)operator(\)) reserved(return)operator(;) - ident(REALLOC_N)operator(()ident(environ)operator(,) pre_type(char)operator(*,) ident(i)operator(+)integer(2)operator(\);) comment(/* just expand it a bit */) - ident(environ)operator([)ident(i)operator(+)integer(1)operator(]) operator(=) integer(0)operator(;) comment(/* make sure it's null terminated */) - operator(}) - ident(len) operator(=) ident(strlen)operator(()ident(name)operator(\)) operator(+) ident(strlen)operator(()ident(value)operator(\)) operator(+) integer(2)operator(;) - ident(environ)operator([)ident(i)operator(]) operator(=) ident(ALLOC_N)operator(()pre_type(char)operator(,) ident(len)operator(\);) -preprocessor(#ifndef) ident(MSDOS) - ident(snprintf)operator(()ident(environ)operator([)ident(i)operator(],)ident(len)operator(,)stringoperator(,)ident(name)operator(,)ident(value)operator(\);) comment(/* all that work just for this */) -preprocessor(#else) - comment(/* MS-DOS requires environment variable names to be in uppercase */) - comment(/* [Tom Dinger, 27 August 1990: Well, it doesn't _require_ it, but - * some utilities and applications may break because they only look - * for upper case strings. (Fixed strupr(\) bug here.\)] - */) - ident(strcpy)operator(()ident(environ)operator([)ident(i)operator(],)ident(name)operator(\);) ident(strupr)operator(()ident(environ)operator([)ident(i)operator(]\);) - ident(sprintf)operator(()ident(environ)operator([)ident(i)operator(]) operator(+) ident(strlen)operator(()ident(name)operator(\),)stringoperator(,) ident(value)operator(\);) -preprocessor(#endif) comment(/* MSDOS */) - -preprocessor(#endif) comment(/* WIN32 */) -operator(}) - -directive(void) -ident(ruby_unsetenv)operator(()ident(name)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(ruby_setenv)operator(()ident(name)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(env_aset)operator(()ident(obj)operator(,) ident(nm)operator(,) ident(val)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(nm)operator(,) ident(val)operator(;) -operator({) - pre_type(char) operator(*)ident(name)operator(,) operator(*)ident(value)operator(;) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(NIL_P)operator(()ident(val)operator(\)\)) operator({) - ident(env_delete)operator(()ident(obj)operator(,) ident(nm)operator(\);) - reserved(return) ident(Qnil)operator(;) - operator(}) - - ident(StringValue)operator(()ident(nm)operator(\);) - ident(StringValue)operator(()ident(val)operator(\);) - ident(name) operator(=) ident(RSTRING)operator(()ident(nm)operator(\)->)ident(ptr)operator(;) - ident(value) operator(=) ident(RSTRING)operator(()ident(val)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(strlen)operator(()ident(name)operator(\)) operator(!=) ident(RSTRING)operator(()ident(nm)operator(\)->)ident(len)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(strlen)operator(()ident(value)operator(\)) operator(!=) ident(RSTRING)operator(()ident(val)operator(\)->)ident(len)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - - ident(ruby_setenv)operator(()ident(name)operator(,) ident(value)operator(\);) -preprocessor(#ifdef) ident(ENV_IGNORECASE) - reserved(if) operator(()ident(strcasecmp)operator(()ident(name)operator(,) ident(PATH_ENV)operator(\)) operator(==) integer(0)operator(\)) operator({) -preprocessor(#else) - reserved(if) operator(()ident(strcmp)operator(()ident(name)operator(,) ident(PATH_ENV)operator(\)) operator(==) integer(0)operator(\)) operator({) -preprocessor(#endif) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(val)operator(\)\)) operator({) - comment(/* already tainted, no check */) - ident(path_tainted) operator(=) integer(1)operator(;) - reserved(return) ident(val)operator(;) - operator(}) - reserved(else) operator({) - ident(path_tainted_p)operator(()ident(value)operator(\);) - operator(}) - operator(}) - reserved(return) ident(val)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_keys)operator((\)) -operator({) - pre_type(char) operator(**)ident(env)operator(;) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(while) operator((*)ident(env)operator(\)) operator({) - pre_type(char) operator(*)ident(s) operator(=) ident(strchr)operator((*)ident(env)operator(,) char('=')operator(\);) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(env_str_new)operator((*)ident(env)operator(,) ident(s)operator(-*)ident(env)operator(\)\);) - operator(}) - ident(env)operator(++;) - operator(}) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_each_key)operator(()ident(ehash)operator(\)) - ident(VALUE) ident(ehash)operator(;) -operator({) - ident(VALUE) ident(keys) operator(=) ident(env_keys)operator((\);) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(keys)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_yield)operator(()ident(RARRAY)operator(()ident(keys)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - operator(}) - reserved(return) ident(ehash)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_values)operator((\)) -operator({) - pre_type(char) operator(**)ident(env)operator(;) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(while) operator((*)ident(env)operator(\)) operator({) - pre_type(char) operator(*)ident(s) operator(=) ident(strchr)operator((*)ident(env)operator(,) char('=')operator(\);) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(env_str_new2)operator(()ident(s)operator(+)integer(1)operator(\)\);) - operator(}) - ident(env)operator(++;) - operator(}) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_each_value)operator(()ident(ehash)operator(\)) - ident(VALUE) ident(ehash)operator(;) -operator({) - ident(VALUE) ident(values) operator(=) ident(env_values)operator((\);) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(values)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_yield)operator(()ident(RARRAY)operator(()ident(values)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - operator(}) - reserved(return) ident(ehash)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_each_i)operator(()ident(ehash)operator(,) ident(values)operator(\)) - ident(VALUE) ident(ehash)operator(;) - pre_type(int) ident(values)operator(;) -operator({) - pre_type(char) operator(**)ident(env)operator(;) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - pre_type(long) ident(i)operator(;) - - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(while) operator((*)ident(env)operator(\)) operator({) - pre_type(char) operator(*)ident(s) operator(=) ident(strchr)operator((*)ident(env)operator(,) char('=')operator(\);) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(env_str_new)operator((*)ident(env)operator(,) ident(s)operator(-*)ident(env)operator(\)\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(env_str_new2)operator(()ident(s)operator(+)integer(1)operator(\)\);) - operator(}) - ident(env)operator(++;) - operator(}) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(+=)integer(2)operator(\)) operator({) - reserved(if) operator(()ident(values)operator(\)) operator({) - ident(rb_yield_values)operator(()integer(2)operator(,) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(+)integer(1)operator(]\);) - operator(}) - reserved(else) operator({) - ident(rb_yield)operator(()ident(rb_assoc_new)operator(()ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(+)integer(1)operator(]\)\);) - operator(}) - operator(}) - reserved(return) ident(ehash)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_each)operator(()ident(ehash)operator(\)) - ident(VALUE) ident(ehash)operator(;) -operator({) - reserved(return) ident(env_each_i)operator(()ident(ehash)operator(,) ident(Qfalse)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(env_each_pair)operator(()ident(ehash)operator(\)) - ident(VALUE) ident(ehash)operator(;) -operator({) - reserved(return) ident(env_each_i)operator(()ident(ehash)operator(,) ident(Qtrue)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(env_reject_bang)operator((\)) -operator({) - directive(volatile) ident(VALUE) ident(keys)operator(;) - pre_type(long) ident(i)operator(;) - pre_type(int) ident(del) operator(=) integer(0)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - ident(keys) operator(=) ident(env_keys)operator((\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(keys)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(val) operator(=) ident(rb_f_getenv)operator(()ident(Qnil)operator(,) ident(RARRAY)operator(()ident(keys)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(val)operator(\)\)) operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield_values)operator(()integer(2)operator(,) ident(RARRAY)operator(()ident(keys)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(val)operator(\)\)\)) operator({) - ident(FL_UNSET)operator(()ident(RARRAY)operator(()ident(keys)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(FL_TAINT)operator(\);) - ident(env_delete)operator(()ident(Qnil)operator(,) ident(RARRAY)operator(()ident(keys)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - ident(del)operator(++;) - operator(}) - operator(}) - operator(}) - reserved(if) operator(()ident(del) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(envtbl)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_delete_if)operator((\)) -operator({) - ident(env_reject_bang)operator((\);) - reserved(return) ident(envtbl)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_values_at)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(rb_ary_new)operator((\);) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_f_getenv)operator(()ident(Qnil)operator(,) ident(argv)operator([)ident(i)operator(]\)\);) - operator(}) - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_select)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(result)operator(;) - pre_type(char) operator(**)ident(env)operator(;) - - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - ident(result) operator(=) ident(rb_ary_new)operator((\);) - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(while) operator((*)ident(env)operator(\)) operator({) - pre_type(char) operator(*)ident(s) operator(=) ident(strchr)operator((*)ident(env)operator(,) char('=')operator(\);) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(VALUE) ident(k) operator(=) ident(env_str_new)operator((*)ident(env)operator(,) ident(s)operator(-*)ident(env)operator(\);) - ident(VALUE) ident(v) operator(=) ident(env_str_new2)operator(()ident(s)operator(+)integer(1)operator(\);) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield_values)operator(()integer(2)operator(,) ident(k)operator(,) ident(v)operator(\)\)\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_assoc_new)operator(()ident(k)operator(,) ident(v)operator(\)\);) - operator(}) - operator(}) - ident(env)operator(++;) - operator(}) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_clear)operator((\)) -operator({) - directive(volatile) ident(VALUE) ident(keys)operator(;) - pre_type(long) ident(i)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - ident(keys) operator(=) ident(env_keys)operator((\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(keys)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(val) operator(=) ident(rb_f_getenv)operator(()ident(Qnil)operator(,) ident(RARRAY)operator(()ident(keys)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(val)operator(\)\)) operator({) - ident(env_delete)operator(()ident(Qnil)operator(,) ident(RARRAY)operator(()ident(keys)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - operator(}) - operator(}) - reserved(return) ident(envtbl)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_to_s)operator((\)) -operator({) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(env_inspect)operator((\)) -operator({) - pre_type(char) operator(**)ident(env)operator(;) - ident(VALUE) ident(str) operator(=) ident(rb_str_buf_new2)operator(()stringoperator(\);) - ident(VALUE) ident(i)operator(;) - - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(while) operator((*)ident(env)operator(\)) operator({) - pre_type(char) operator(*)ident(s) operator(=) ident(strchr)operator((*)ident(env)operator(,) char('=')operator(\);) - - reserved(if) operator(()ident(env) operator(!=) ident(environ)operator(\)) operator({) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) operator(*)ident(env)operator(,) ident(s)operator(-*)ident(env)operator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) string)delimiter(")>operator(\);) - ident(i) operator(=) ident(rb_inspect)operator(()ident(rb_str_new2)operator(()ident(s)operator(+)integer(1)operator(\)\);) - ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(i)operator(\);) - operator(}) - ident(env)operator(++;) - operator(}) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(OBJ_TAINT)operator(()ident(str)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_to_a)operator((\)) -operator({) - pre_type(char) operator(**)ident(env)operator(;) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(while) operator((*)ident(env)operator(\)) operator({) - pre_type(char) operator(*)ident(s) operator(=) ident(strchr)operator((*)ident(env)operator(,) char('=')operator(\);) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_assoc_new)operator(()ident(env_str_new)operator((*)ident(env)operator(,) ident(s)operator(-*)ident(env)operator(\),) - ident(env_str_new2)operator(()ident(s)operator(+)integer(1)operator(\)\)\);) - operator(}) - ident(env)operator(++;) - operator(}) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_none)operator((\)) -operator({) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_size)operator((\)) -operator({) - pre_type(int) ident(i)operator(;) - pre_type(char) operator(**)ident(env)operator(;) - - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(for)operator(()ident(i)operator(=)integer(0)operator(;) ident(env)operator([)ident(i)operator(];) ident(i)operator(++\)) - operator(;) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(INT2FIX)operator(()ident(i)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(env_empty_p)operator((\)) -operator({) - pre_type(char) operator(**)ident(env)operator(;) - - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(if) operator(()ident(env)operator([)integer(0)operator(]) operator(==) integer(0)operator(\)) operator({) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(Qtrue)operator(;) - operator(}) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_has_key)operator(()ident(env)operator(,) ident(key)operator(\)) - ident(VALUE) ident(env)operator(,) ident(key)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(;) - - ident(s) operator(=) ident(StringValuePtr)operator(()ident(key)operator(\);) - reserved(if) operator(()ident(strlen)operator(()ident(s)operator(\)) operator(!=) ident(RSTRING)operator(()ident(key)operator(\)->)ident(len)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(getenv)operator(()ident(s)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_has_value)operator(()ident(dmy)operator(,) ident(value)operator(\)) - ident(VALUE) ident(dmy)operator(,) ident(value)operator(;) -operator({) - pre_type(char) operator(**)ident(env)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(value)operator(\)) operator(!=) ident(T_STRING)operator(\)) reserved(return) ident(Qfalse)operator(;) - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(while) operator((*)ident(env)operator(\)) operator({) - pre_type(char) operator(*)ident(s) operator(=) ident(strchr)operator((*)ident(env)operator(,) char('=')operator(\);) - reserved(if) operator(()ident(s)operator(++\)) operator({) - pre_type(long) ident(len) operator(=) ident(strlen)operator(()ident(s)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(value)operator(\)->)ident(len) operator(==) ident(len) operator(&&) ident(strncmp)operator(()ident(s)operator(,) ident(RSTRING)operator(()ident(value)operator(\)->)ident(ptr)operator(,) ident(len)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(Qtrue)operator(;) - operator(}) - operator(}) - ident(env)operator(++;) - operator(}) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_index)operator(()ident(dmy)operator(,) ident(value)operator(\)) - ident(VALUE) ident(dmy)operator(,) ident(value)operator(;) -operator({) - pre_type(char) operator(**)ident(env)operator(;) - ident(VALUE) ident(str)operator(;) - - ident(StringValue)operator(()ident(value)operator(\);) - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(while) operator((*)ident(env)operator(\)) operator({) - pre_type(char) operator(*)ident(s) operator(=) ident(strchr)operator((*)ident(env)operator(,) char('=')operator(\);) - reserved(if) operator(()ident(s)operator(++\)) operator({) - pre_type(long) ident(len) operator(=) ident(strlen)operator(()ident(s)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(value)operator(\)->)ident(len) operator(==) ident(len) operator(&&) ident(strncmp)operator(()ident(s)operator(,) ident(RSTRING)operator(()ident(value)operator(\)->)ident(ptr)operator(,) ident(len)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(str) operator(=) ident(env_str_new)operator((*)ident(env)operator(,) ident(s)operator(-*)ident(env)operator(-)integer(1)operator(\);) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(str)operator(;) - operator(}) - operator(}) - ident(env)operator(++;) - operator(}) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_indexes)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - ident(VALUE) ident(indexes) operator(=) ident(rb_ary_new2)operator(()ident(argc)operator(\);) - - ident(rb_warn)operator(()stringoperator(,) - ident(rb_id2name)operator(()ident(rb_frame_last_func)operator((\)\)\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;)ident(i)operator(<)ident(argc)operator(;)ident(i)operator(++\)) operator({) - ident(VALUE) ident(tmp) operator(=) ident(rb_check_string_type)operator(()ident(argv)operator([)ident(i)operator(]\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - ident(RARRAY)operator(()ident(indexes)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(else) operator({) - ident(RARRAY)operator(()ident(indexes)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(=) ident(env_str_new2)operator(()ident(getenv)operator(()ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator(\)\);) - operator(}) - ident(RARRAY)operator(()ident(indexes)operator(\)->)ident(len) operator(=) ident(i)operator(+)integer(1)operator(;) - operator(}) - - reserved(return) ident(indexes)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_to_hash)operator((\)) -operator({) - pre_type(char) operator(**)ident(env)operator(;) - ident(VALUE) ident(hash) operator(=) ident(rb_hash_new)operator((\);) - - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(while) operator((*)ident(env)operator(\)) operator({) - pre_type(char) operator(*)ident(s) operator(=) ident(strchr)operator((*)ident(env)operator(,) char('=')operator(\);) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(rb_hash_aset)operator(()ident(hash)operator(,) ident(env_str_new)operator((*)ident(env)operator(,) ident(s)operator(-*)ident(env)operator(\),) - ident(env_str_new2)operator(()ident(s)operator(+)integer(1)operator(\)\);) - operator(}) - ident(env)operator(++;) - operator(}) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(hash)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_reject)operator((\)) -operator({) - reserved(return) ident(rb_hash_delete_if)operator(()ident(env_to_hash)operator((\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(env_shift)operator((\)) -operator({) - pre_type(char) operator(**)ident(env)operator(;) - - ident(env) operator(=) ident(GET_ENVIRON)operator(()ident(environ)operator(\);) - reserved(if) operator((*)ident(env)operator(\)) operator({) - pre_type(char) operator(*)ident(s) operator(=) ident(strchr)operator((*)ident(env)operator(,) char('=')operator(\);) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(VALUE) ident(key) operator(=) ident(env_str_new)operator((*)ident(env)operator(,) ident(s)operator(-*)ident(env)operator(\);) - ident(VALUE) ident(val) operator(=) ident(env_str_new2)operator(()ident(getenv)operator(()ident(RSTRING)operator(()ident(key)operator(\)->)ident(ptr)operator(\)\);) - ident(env_delete)operator(()ident(Qnil)operator(,) ident(key)operator(\);) - reserved(return) ident(rb_assoc_new)operator(()ident(key)operator(,) ident(val)operator(\);) - operator(}) - operator(}) - ident(FREE_ENVIRON)operator(()ident(environ)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_invert)operator((\)) -operator({) - reserved(return) ident(rb_hash_invert)operator(()ident(env_to_hash)operator((\)\);) -operator(}) - -directive(static) pre_type(int) -ident(env_replace_i)operator(()ident(key)operator(,) ident(val)operator(,) ident(keys)operator(\)) - ident(VALUE) ident(key)operator(,) ident(val)operator(,) ident(keys)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(!=) ident(Qundef)operator(\)) operator({) - ident(env_aset)operator(()ident(Qnil)operator(,) ident(key)operator(,) ident(val)operator(\);) - reserved(if) operator(()ident(rb_ary_includes)operator(()ident(keys)operator(,) ident(key)operator(\)\)) operator({) - ident(rb_ary_delete)operator(()ident(keys)operator(,) ident(key)operator(\);) - operator(}) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_replace)operator(()ident(env)operator(,) ident(hash)operator(\)) - ident(VALUE) ident(env)operator(,) ident(hash)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(keys) operator(=) ident(env_keys)operator((\);) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(env) operator(==) ident(hash)operator(\)) reserved(return) ident(env)operator(;) - ident(hash) operator(=) ident(to_hash)operator(()ident(hash)operator(\);) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(env_replace_i)operator(,) ident(keys)operator(\);) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(keys)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(env_delete)operator(()ident(env)operator(,) ident(RARRAY)operator(()ident(keys)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - operator(}) - reserved(return) ident(env)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(env_update_i)operator(()ident(key)operator(,) ident(val)operator(\)) - ident(VALUE) ident(key)operator(,) ident(val)operator(;) -operator({) - reserved(if) operator(()ident(key) operator(!=) ident(Qundef)operator(\)) operator({) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(val) operator(=) ident(rb_yield_values)operator(()integer(3)operator(,) ident(key)operator(,) ident(rb_f_getenv)operator(()ident(Qnil)operator(,) ident(key)operator(\),) ident(val)operator(\);) - operator(}) - ident(env_aset)operator(()ident(Qnil)operator(,) ident(key)operator(,) ident(val)operator(\);) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(env_update)operator(()ident(env)operator(,) ident(hash)operator(\)) - ident(VALUE) ident(env)operator(,) ident(hash)operator(;) -operator({) - reserved(if) operator(()ident(env) operator(==) ident(hash)operator(\)) reserved(return) ident(env)operator(;) - ident(hash) operator(=) ident(to_hash)operator(()ident(hash)operator(\);) - ident(rb_hash_foreach)operator(()ident(hash)operator(,) ident(env_update_i)operator(,) integer(0)operator(\);) - reserved(return) ident(env)operator(;) -operator(}) - -comment(/* - * A Hash is a collection of key-value pairs. It is - * similar to an Array, except that indexing is done via - * arbitrary keys of any object type, not an integer index. The order - * in which you traverse a hash by either key or value may seem - * arbitrary, and will generally not be in the insertion order. - * - * Hashes have a default value that is returned when accessing - * keys that do not exist in the hash. By default, that value is - * nil. - * - * Hash uses key.eql? to test keys for equality. - * If you need to use instances of your own classes as keys in a Hash, - * it is recommended that you define both the eql? and hash - * methods. The hash method must have the property that - * a.eql?(b\) implies a.hash == b.hash. - * - * class MyClass - * attr_reader :str - * def initialize(str\) - * @str = str - * end - * def eql?(o\) - * o.is_a?(MyClass\) && str == o.str - * end - * def hash - * @str.hash - * end - * end - * - * a = MyClass.new("some string"\) - * b = MyClass.new("some string"\) - * a.eql? b #=> true - * - * h = {} - * - * h[a] = 1 - * h[a] #=> 1 - * h[b] #=> 1 - * - * h[b] = 2 - * h[a] #=> 2 - * h[b] #=> 2 - */) - -directive(void) -ident(Init_Hash)operator((\)) -operator({) - ident(id_hash) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_call) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_default) operator(=) ident(rb_intern)operator(()stringoperator(\);) - - ident(rb_cHash) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - - ident(rb_include_module)operator(()ident(rb_cHash)operator(,) ident(rb_mEnumerable)operator(\);) - - ident(rb_define_alloc_func)operator(()ident(rb_cHash)operator(,) ident(hash_alloc)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cHash)operator(,) stringoperator(,) ident(rb_hash_s_create)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_initialize)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_replace)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_rehash)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_to_hash)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_to_a)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_inspect)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_aref)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_fetch)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_aset)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_aset)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_default)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_set_default)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_default_proc)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_index)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_indexes)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_indexes)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_size)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_size)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_empty_p)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_each)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_each_value)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_each_key)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_each_pair)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_sort)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_keys)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_values)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_values_at)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_shift)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_delete)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_delete_if)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_select)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_reject)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_reject_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_clear)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_invert)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_update)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_replace)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_update)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_merge)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_has_key)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_has_key)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_has_key)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_has_value)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_has_key)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cHash)operator(,)stringoperator(,) ident(rb_hash_has_value)operator(,) integer(1)operator(\);) - -preprocessor(#ifndef) ident(__MACOS__) comment(/* environment variables nothing on MacOS. */) - ident(origenviron) operator(=) ident(environ)operator(;) - ident(envtbl) operator(=) ident(rb_obj_alloc)operator(()ident(rb_cObject)operator(\);) - ident(rb_extend_object)operator(()ident(envtbl)operator(,) ident(rb_mEnumerable)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(rb_f_getenv)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_fetch)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_aset)operator(,) integer(2)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_aset)operator(,) integer(2)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_each)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_each_pair)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_each_key)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_each_value)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_delete_m)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_delete_if)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_clear)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_reject)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_reject_bang)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_select)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_shift)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_invert)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_replace)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_update)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_none)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_to_a)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_index)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_indexes)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_indexes)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_size)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_size)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_empty_p)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_keys)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_values)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_values_at)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_has_key)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_has_key)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_has_key)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_has_value)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_has_key)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_has_value)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(envtbl)operator(,)stringoperator(,) ident(env_to_hash)operator(,) integer(0)operator(\);) - - ident(rb_define_global_const)operator(()stringoperator(,) ident(envtbl)operator(\);) -preprocessor(#else) comment(/* __MACOS__ */) - ident(envtbl) operator(=) ident(rb_hash_s_new)operator(()integer(0)operator(,) pre_constant(NULL)operator(,) ident(rb_cHash)operator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(envtbl)operator(\);) -preprocessor(#endif) comment(/* ifndef __MACOS__ environment variables nothing on MacOS. */) -operator(}) -comment(/********************************************************************** - - inits.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007\) $ - created at: Tue Dec 28 16:01:58 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") - -directive(void) ident(Init_Array) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Bignum) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Binding) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Comparable) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Dir) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Enumerable) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Exception) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_syserr) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_eval) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_load) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Proc) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Thread) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_File) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_GC) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Hash) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_IO) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Math) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_marshal) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Numeric) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Object) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_pack) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Precision) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_sym) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_process) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Random) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Range) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Regexp) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_signal) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_String) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Struct) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_Time) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_var_tables) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(Init_version) ident(_)operator((()directive(void)operator(\)\);) - -directive(void) -ident(rb_call_inits)operator((\)) -operator({) - ident(Init_sym)operator((\);) - ident(Init_var_tables)operator((\);) - ident(Init_Object)operator((\);) - ident(Init_Comparable)operator((\);) - ident(Init_Enumerable)operator((\);) - ident(Init_Precision)operator((\);) - ident(Init_eval)operator((\);) - ident(Init_String)operator((\);) - ident(Init_Exception)operator((\);) - ident(Init_Thread)operator((\);) - ident(Init_Numeric)operator((\);) - ident(Init_Bignum)operator((\);) - ident(Init_syserr)operator((\);) - ident(Init_Array)operator((\);) - ident(Init_Hash)operator((\);) - ident(Init_Struct)operator((\);) - ident(Init_Regexp)operator((\);) - ident(Init_pack)operator((\);) - ident(Init_Range)operator((\);) - ident(Init_IO)operator((\);) - ident(Init_Dir)operator((\);) - ident(Init_Time)operator((\);) - ident(Init_Random)operator((\);) - ident(Init_signal)operator((\);) - ident(Init_process)operator((\);) - ident(Init_load)operator((\);) - ident(Init_Proc)operator((\);) - ident(Init_Binding)operator((\);) - ident(Init_Math)operator((\);) - ident(Init_GC)operator((\);) - ident(Init_marshal)operator((\);) - ident(Init_version)operator((\);) -operator(}) -comment(/********************************************************************** - - io.c - - - $Author: shyouhei $ - $Date: 2009-03-09 01:52:15 +0100 (Mon, 09 Mar 2009\) $ - created at: Fri Oct 15 18:08:59 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#if) ident(defined)operator(()ident(__VMS)operator(\)) -preprocessor(#define) ident(_XOPEN_SOURCE) -preprocessor(#define) ident(_POSIX_C_SOURCE) integer(2) -preprocessor(#endif) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("rubyio.h") -preprocessor(#include) include("rubysig.h") -preprocessor(#include) include("env.h") -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#if) ident(defined)operator(()ident(MSDOS)operator(\)) operator(||) ident(defined)operator(()ident(__BOW__)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN__)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__EMX__)operator(\)) operator(||) ident(defined)operator(()ident(__BEOS__)operator(\)) -preprocessor(# define) ident(NO_SAFE_RENAME) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(MSDOS)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN__)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) -preprocessor(# define) ident(NO_LONG_FNAME) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__FreeBSD__)operator(\)) operator(||) ident(defined)operator(()ident(__NetBSD__)operator(\)) operator(||) ident(defined)operator(()ident(__OpenBSD__)operator(\)) operator(||) ident(defined)operator(()ident(__DragonFly__)operator(\)) operator(||) ident(defined)operator(()ident(sun)operator(\)) operator(||) ident(defined)operator(()ident(_nec_ews)operator(\)) -preprocessor(# define) ident(USE_SETVBUF) -preprocessor(#endif) - -preprocessor(#ifdef) ident(__QNXNTO__) -preprocessor(#include) include("unix.h") -preprocessor(#endif) - -preprocessor(#include) include() -preprocessor(#if) ident(defined)operator(()ident(HAVE_SYS_IOCTL_H)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(DJGPP)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(_WIN32)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__human68k__)operator(\)) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#if) ident(defined)operator(()ident(HAVE_FCNTL_H)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) -preprocessor(#include) include() -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SYS_FCNTL_H)operator(\)) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#if) operator(!)ident(HAVE_OFF_T) operator(&&) operator(!)ident(defined)operator(()ident(off_t)operator(\)) -preprocessor(# define) ident(off_t) pre_type(long) -preprocessor(#endif) -preprocessor(#if) operator(!)ident(HAVE_FSEEKO) operator(&&) operator(!)ident(defined)operator(()ident(fseeko)operator(\)) -preprocessor(# define) ident(fseeko) ident(fseek) -preprocessor(#endif) -preprocessor(#if) operator(!)ident(HAVE_FTELLO) operator(&&) operator(!)ident(defined)operator(()ident(ftello)operator(\)) -preprocessor(# define) ident(ftello) ident(ftell) -preprocessor(#endif) - -preprocessor(#include) include() - -comment(/* EMX has sys/param.h, but.. */) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SYS_PARAM_H)operator(\)) operator(&&) operator(!()ident(defined)operator(()ident(__EMX__)operator(\)) operator(||) ident(defined)operator(()ident(__HIUX_MPP__)operator(\)\)) -preprocessor(# include) include() -preprocessor(#endif) - -preprocessor(#if) operator(!)ident(defined) ident(NOFILE) -preprocessor(# define) ident(NOFILE) integer(64) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_UNISTD_H) -preprocessor(#ifdef) ident(HAVE_SYSCALL_H) -preprocessor(#include) include() -preprocessor(#elif) ident(defined) ident(HAVE_SYS_SYSCALL_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#include) include() -preprocessor(#endif) - -directive(extern) directive(void) ident(Init_File) ident(_)operator((()directive(void)operator(\)\);) - -preprocessor(#ifdef) ident(__BEOS__) -preprocessor(# ifndef) ident(NOFILE) -preprocessor(# define) ident(NOFILE) operator(()ident(OPEN_MAX)operator(\)) -preprocessor(# endif) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#include) include("util.h") - -preprocessor(#ifndef) ident(O_ACCMODE) -preprocessor(#define) ident(O_ACCMODE) operator(()ident(O_RDONLY) operator(|) ident(O_WRONLY) operator(|) ident(O_RDWR)operator(\)) -preprocessor(#endif) - -preprocessor(#if) ident(SIZEOF_OFF_T) operator(>) ident(SIZEOF_LONG) operator(&&) operator(!)ident(defined)operator(()ident(HAVE_LONG_LONG)operator(\)) -preprocessor(# error) ident(off_t) ident(is) ident(bigger) ident(than) pre_type(long)operator(,) ident(but) ident(you) ident(have) ident(no) pre_type(long) pre_type(long)operator(.)operator(.)operator(.) -preprocessor(#endif) - -preprocessor(#ifndef) ident(PIPE_BUF) -preprocessor(# ifdef) ident(_POSIX_PIPE_BUF) -preprocessor(# define) ident(PIPE_BUF) ident(_POSIX_PIPE_BUF) -preprocessor(# else) -preprocessor(# define) ident(PIPE_BUF) integer(512) comment(/* is this ok? */) -preprocessor(# endif) -preprocessor(#endif) - -ident(VALUE) ident(rb_cIO)operator(;) -ident(VALUE) ident(rb_eEOFError)operator(;) -ident(VALUE) ident(rb_eIOError)operator(;) - -ident(VALUE) ident(rb_stdin)operator(,) ident(rb_stdout)operator(,) ident(rb_stderr)operator(;) -ident(VALUE) ident(rb_deferr)operator(;) comment(/* rescue VIM plugin */) -directive(static) ident(VALUE) ident(orig_stdout)operator(,) ident(orig_stderr)operator(;) - -ident(VALUE) ident(rb_output_fs)operator(;) -ident(VALUE) ident(rb_rs)operator(;) -ident(VALUE) ident(rb_output_rs)operator(;) -ident(VALUE) ident(rb_default_rs)operator(;) - -directive(static) ident(VALUE) ident(argf)operator(;) - -directive(static) ident(ID) ident(id_write)operator(,) ident(id_read)operator(,) ident(id_getc)operator(;) - -directive(extern) pre_type(char) operator(*)ident(ruby_inplace_mode)operator(;) - -reserved(struct) ident(timeval) ident(rb_time_interval) ident(_)operator((()ident(VALUE)operator(\)\);) - -directive(static) ident(VALUE) ident(filename)operator(,) ident(current_file)operator(;) -directive(static) pre_type(int) ident(gets_lineno)operator(;) -directive(static) pre_type(int) ident(init_p) operator(=) integer(0)operator(,) ident(next_p) operator(=) integer(0)operator(;) -directive(static) ident(VALUE) ident(lineno) operator(=) ident(INT2FIX)operator(()integer(0)operator(\);) - -preprocessor(#ifdef) ident(_STDIO_USES_IOSTREAM) comment(/* GNU libc */) -preprocessor(# ifdef) ident(_IO_fpos_t) -preprocessor(# define) ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)) operator((()ident(fp)operator(\)->)ident(_IO_read_ptr) operator(!=) operator(()ident(fp)operator(\)->)ident(_IO_read_end)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING_COUNT)operator(()ident(fp)operator(\)) operator((()ident(fp)operator(\)->)ident(_IO_read_end) operator(-) operator(()ident(fp)operator(\)->)ident(_IO_read_ptr)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING_PTR)operator(()ident(fp)operator(\)) operator((()ident(fp)operator(\)->)ident(_IO_read_ptr)operator(\)) -preprocessor(# else) -preprocessor(# define) ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)) operator((()ident(fp)operator(\)->)ident(_gptr) operator(<) operator(()ident(fp)operator(\)->)ident(_egptr)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING_COUNT)operator(()ident(fp)operator(\)) operator((()ident(fp)operator(\)->)ident(_egptr) operator(-) operator(()ident(fp)operator(\)->)ident(_gptr)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING_PTR)operator(()ident(fp)operator(\)) operator((()ident(fp)operator(\)->)ident(_gptr)operator(\)) -preprocessor(# endif) -preprocessor(#elif) ident(defined)operator(()ident(_LP64)operator(\)) operator(&&) operator(()ident(defined)operator(()ident(__sun__)operator(\)) operator(||) ident(defined)operator(()ident(__sun)operator(\)\)) -reserved(typedef) reserved(struct) ident(_FILE64) operator({) - pre_type(unsigned) pre_type(char) operator(*)ident(_ptr)operator(;) comment(/* next character from/to here in buffer */) - pre_type(unsigned) pre_type(char) operator(*)ident(_base)operator(;) comment(/* the buffer */) - pre_type(unsigned) pre_type(char) operator(*)ident(_end)operator(;) comment(/* the end of the buffer */) - ident(ssize_t) ident(_cnt)operator(;) comment(/* number of available characters in buffer */) - pre_type(int) ident(_file)operator(;) comment(/* UNIX System file descriptor */) - pre_type(unsigned) pre_type(int) ident(_flag)operator(;) comment(/* the state of the stream */) - pre_type(char) ident(__fill)operator([)integer(80)operator(];) comment(/* filler to bring size to 128 bytes */) -operator(}) ident(FILE64)operator(;) -preprocessor(# define) ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)) operator(((()ident(FILE64)operator(*\)()ident(fp)operator(\)\)->)ident(_cnt) operator(>) integer(0)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING_COUNT)operator(()ident(fp)operator(\)) operator(((()ident(FILE64)operator(*\)()ident(fp)operator(\)\)->)ident(_cnt)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING_PTR)operator(()ident(fp)operator(\)) operator((()pre_type(char) operator(*\)(()ident(FILE64)operator(*\)()ident(fp)operator(\)\)->)ident(_ptr)operator(\)) -preprocessor(#elif) ident(defined)operator(()ident(FILE_COUNT)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)) operator((()ident(fp)operator(\)->)ident(FILE_COUNT) operator(>) integer(0)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING_COUNT)operator(()ident(fp)operator(\)) operator((()ident(fp)operator(\)->)ident(FILE_COUNT)operator(\)) -preprocessor(#elif) ident(defined)operator(()ident(FILE_READEND)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)) operator((()ident(fp)operator(\)->)ident(FILE_READPTR) operator(<) operator(()ident(fp)operator(\)->)ident(FILE_READEND)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING_COUNT)operator(()ident(fp)operator(\)) operator((()ident(fp)operator(\)->)ident(FILE_READEND) operator(-) operator(()ident(fp)operator(\)->)ident(FILE_READPTR)operator(\)) -preprocessor(#elif) ident(defined)operator(()ident(__BEOS__)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)) operator(()ident(fp)operator(->)ident(_state)operator(.)ident(_eof) operator(==) integer(0)operator(\)) -preprocessor(#elif) ident(defined)operator(()ident(__VMS)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING_COUNT)operator(()ident(fp)operator(\)) operator((()pre_type(unsigned) pre_type(int)operator(\)(*()ident(fp)operator(\)\)->)ident(_cnt)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)) operator(((()pre_type(unsigned) pre_type(int)operator(\)(*()ident(fp)operator(\)\)->)ident(_cnt)operator(\)) operator(>) integer(0)operator(\)) -preprocessor(# define) ident(READ_DATA_BUFFERED)operator(()ident(fp)operator(\)) integer(0) -preprocessor(#elif) ident(defined)operator(()ident(__DragonFly__)operator(\)) -comment(/* FILE is an incomplete struct type since DragonFly BSD 1.4.0 */) -preprocessor(# define) ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)) operator(((()reserved(struct) ident(__FILE_public) operator(*\)()ident(fp)operator(\)\)->)ident(_r) operator(>) integer(0)operator(\)) -preprocessor(# define) ident(READ_DATA_PENDING_COUNT)operator(()ident(fp)operator(\)) operator(((()reserved(struct) ident(__FILE_public) operator(*\)()ident(fp)operator(\)\)->)ident(_r)operator(\)) -preprocessor(#else) -comment(/* requires systems own version of the ReadDataPending(\) */) -directive(extern) pre_type(int) ident(ReadDataPending)operator((\);) -preprocessor(# define) ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)) operator((!)ident(feof)operator(()ident(fp)operator(\)\)) -preprocessor(# define) ident(READ_DATA_BUFFERED)operator(()ident(fp)operator(\)) integer(0) -preprocessor(#endif) -preprocessor(#ifndef) ident(READ_DATA_BUFFERED) -preprocessor(# define) ident(READ_DATA_BUFFERED)operator(()ident(fp)operator(\)) ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)) -preprocessor(#endif) - -preprocessor(#ifndef) ident(READ_DATA_PENDING_PTR) -preprocessor(# ifdef) ident(FILE_READPTR) -preprocessor(# define) ident(READ_DATA_PENDING_PTR)operator(()ident(fp)operator(\)) operator((()pre_type(char) operator(*\)()ident(fp)operator(\)->)ident(FILE_READPTR)operator(\)) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(__DJGPP__) -preprocessor(# undef) ident(READ_DATA_PENDING_COUNT) -preprocessor(# undef) ident(READ_DATA_PENDING_PTR) -preprocessor(#endif) - -preprocessor(#define) ident(READ_CHECK)operator(()ident(fp)operator(\)) reserved(do) operator({)\ - reserved(if) operator((!)ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)\)) operator({)\ - ident(rb_thread_wait_fd)operator(()ident(fileno)operator(()ident(fp)operator(\)\);)\ - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);)\ - operator(})\ -operator(}) reserved(while)operator(()integer(0)operator(\)) - -directive(void) -ident(rb_eof_error)operator((\)) -operator({) - ident(rb_raise)operator(()ident(rb_eEOFError)operator(,) stringoperator(\);) -operator(}) - -ident(VALUE) -ident(rb_io_taint_check)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(io)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - ident(rb_check_frozen)operator(()ident(io)operator(\);) - reserved(return) ident(io)operator(;) -operator(}) - -directive(void) -ident(rb_io_check_initialized)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - reserved(if) operator((!)ident(fptr)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - operator(}) -operator(}) - -directive(void) -ident(rb_io_check_closed)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - ident(rb_io_check_initialized)operator(()ident(fptr)operator(\);) - reserved(if) operator((!)ident(fptr)operator(->)ident(f) operator(&&) operator(!)ident(fptr)operator(->)ident(f2)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - operator(}) -operator(}) - -directive(static) directive(void) ident(io_fflush) ident(_)operator((()ident(FILE) operator(*,) ident(OpenFile) operator(*\)\);) - -directive(static) ident(OpenFile) operator(*) -ident(flush_before_seek)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - reserved(if) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WBUF)operator(\)) operator({) - ident(io_fflush)operator(()ident(GetWriteFile)operator(()ident(fptr)operator(\),) ident(fptr)operator(\);) - operator(}) - ident(errno) operator(=) integer(0)operator(;) - reserved(return) ident(fptr)operator(;) -operator(}) - -preprocessor(#define) ident(io_seek)operator(()ident(fptr)operator(,) ident(ofs)operator(,) ident(whence)operator(\)) ident(fseeko)operator(()ident(flush_before_seek)operator(()ident(fptr)operator(\)->)ident(f)operator(,) ident(ofs)operator(,) ident(whence)operator(\)) -preprocessor(#define) ident(io_tell)operator(()ident(fptr)operator(\)) ident(ftello)operator(()ident(flush_before_seek)operator(()ident(fptr)operator(\)->)ident(f)operator(\)) - -preprocessor(#ifndef) ident(SEEK_CUR) -preprocessor(# define) ident(SEEK_SET) integer(0) -preprocessor(# define) ident(SEEK_CUR) integer(1) -preprocessor(# define) ident(SEEK_END) integer(2) -preprocessor(#endif) - -preprocessor(#define) ident(FMODE_SYNCWRITE) operator(()ident(FMODE_SYNC)operator(|)ident(FMODE_WRITABLE)operator(\)) - -directive(void) -ident(rb_io_check_readable)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) - reserved(if) operator((!()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_READABLE)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - operator(}) -preprocessor(#ifdef) ident(NEED_IO_SEEK_BETWEEN_RW) - reserved(if) operator(((()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WBUF)operator(\)) operator(||) - operator(()ident(fptr)operator(->)ident(mode) operator(&) operator(()ident(FMODE_SYNCWRITE)operator(|)ident(FMODE_RBUF)operator(\)\)) operator(==) ident(FMODE_SYNCWRITE)operator(\)) operator(&&) - operator(!)ident(feof)operator(()ident(fptr)operator(->)ident(f)operator(\)) operator(&&) - operator(!)ident(fptr)operator(->)ident(f2)operator(\)) operator({) - ident(io_seek)operator(()ident(fptr)operator(,) integer(0)operator(,) ident(SEEK_CUR)operator(\);) - operator(}) -preprocessor(#endif) - ident(fptr)operator(->)ident(mode) operator(|=) ident(FMODE_RBUF)operator(;) -operator(}) - -directive(void) -ident(rb_io_check_writable)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) - reserved(if) operator((!()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WRITABLE)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator((()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_RBUF)operator(\)) operator(&&) operator(!)ident(feof)operator(()ident(fptr)operator(->)ident(f)operator(\)) operator(&&) operator(!)ident(fptr)operator(->)ident(f2)operator(\)) operator({) - ident(io_seek)operator(()ident(fptr)operator(,) integer(0)operator(,) ident(SEEK_CUR)operator(\);) - operator(}) - reserved(if) operator((!)ident(fptr)operator(->)ident(f2)operator(\)) operator({) - ident(fptr)operator(->)ident(mode) operator(&=) operator(~)ident(FMODE_RBUF)operator(;) - operator(}) -operator(}) - -pre_type(int) -ident(rb_read_pending)operator(()ident(fp)operator(\)) - ident(FILE) operator(*)ident(fp)operator(;) -operator({) - reserved(return) ident(READ_DATA_PENDING)operator(()ident(fp)operator(\);) -operator(}) - -directive(void) -ident(rb_read_check)operator(()ident(fp)operator(\)) - ident(FILE) operator(*)ident(fp)operator(;) -operator({) - reserved(if) operator((!)ident(READ_DATA_PENDING)operator(()ident(fp)operator(\)\)) operator({) - ident(rb_thread_wait_fd)operator(()ident(fileno)operator(()ident(fp)operator(\)\);) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(ruby_dup)operator(()ident(orig)operator(\)) - pre_type(int) ident(orig)operator(;) -operator({) - pre_type(int) ident(fd)operator(;) - - ident(fd) operator(=) ident(dup)operator(()ident(orig)operator(\);) - reserved(if) operator(()ident(fd) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(errno) operator(==) ident(EMFILE) operator(||) ident(errno) operator(==) ident(ENFILE) operator(||) ident(errno) operator(==) ident(ENOMEM)operator(\)) operator({) - ident(rb_gc)operator((\);) - ident(fd) operator(=) ident(dup)operator(()ident(orig)operator(\);) - operator(}) - reserved(if) operator(()ident(fd) operator(<) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - operator(}) - reserved(return) ident(fd)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(io_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(io_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(io)operator(,) reserved(struct) ident(RFile)operator(\);) - ident(OBJSETUP)operator(()ident(io)operator(,) ident(klass)operator(,) ident(T_FILE)operator(\);) - - ident(io)operator(->)ident(fptr) operator(=) integer(0)operator(;) - - reserved(return) operator(()ident(VALUE)operator(\))ident(io)operator(;) -operator(}) - -directive(static) directive(void) -ident(io_fflush)operator(()ident(f)operator(,) ident(fptr)operator(\)) - ident(FILE) operator(*)ident(f)operator(;) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - pre_type(int) ident(n)operator(;) - - reserved(if) operator((!)ident(rb_thread_fd_writable)operator(()ident(fileno)operator(()ident(f)operator(\)\)\)) operator({) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) - operator(}) - reserved(for) operator((;;\)) operator({) - ident(TRAP_BEG)operator(;) - ident(n) operator(=) ident(fflush)operator(()ident(f)operator(\);) - ident(TRAP_END)operator(;) - reserved(if) operator(()ident(n) operator(!=) pre_constant(EOF)operator(\)) reserved(break)operator(;) - reserved(if) operator((!)ident(rb_io_wait_writable)operator(()ident(fileno)operator(()ident(f)operator(\)\)\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - ident(fptr)operator(->)ident(mode) operator(&=) operator(~)ident(FMODE_WBUF)operator(;) -operator(}) - -pre_type(int) -ident(rb_io_wait_readable)operator(()ident(f)operator(\)) - pre_type(int) ident(f)operator(;) -operator({) - ident(fd_set) ident(rfds)operator(;) - - reserved(switch) operator(()ident(errno)operator(\)) operator({) - reserved(case) ident(EINTR)operator(:) -preprocessor(#if) ident(defined)operator(()ident(ERESTART)operator(\)) - reserved(case) ident(ERESTART)operator(:) -preprocessor(#endif) - ident(rb_thread_wait_fd)operator(()ident(f)operator(\);) - reserved(return) ident(Qtrue)operator(;) - - reserved(case) ident(EAGAIN)operator(:) -preprocessor(#if) ident(defined)operator(()ident(EWOULDBLOCK)operator(\)) operator(&&) ident(EWOULDBLOCK) operator(!=) ident(EAGAIN) - reserved(case) ident(EWOULDBLOCK)operator(:) -preprocessor(#endif) - ident(FD_ZERO)operator((&)ident(rfds)operator(\);) - ident(FD_SET)operator(()ident(f)operator(,) operator(&)ident(rfds)operator(\);) - ident(rb_thread_select)operator(()ident(f) operator(+) integer(1)operator(,) operator(&)ident(rfds)operator(,) pre_constant(NULL)operator(,) pre_constant(NULL)operator(,) pre_constant(NULL)operator(\);) - reserved(return) ident(Qtrue)operator(;) - - reserved(default)operator(:) - reserved(return) ident(Qfalse)operator(;) - operator(}) -operator(}) - -pre_type(int) -ident(rb_io_wait_writable)operator(()ident(f)operator(\)) - pre_type(int) ident(f)operator(;) -operator({) - ident(fd_set) ident(wfds)operator(;) - - reserved(switch) operator(()ident(errno)operator(\)) operator({) - reserved(case) ident(EINTR)operator(:) -preprocessor(#if) ident(defined)operator(()ident(ERESTART)operator(\)) - reserved(case) ident(ERESTART)operator(:) -preprocessor(#endif) - ident(rb_thread_fd_writable)operator(()ident(f)operator(\);) - reserved(return) ident(Qtrue)operator(;) - - reserved(case) ident(EAGAIN)operator(:) -preprocessor(#if) ident(defined)operator(()ident(EWOULDBLOCK)operator(\)) operator(&&) ident(EWOULDBLOCK) operator(!=) ident(EAGAIN) - reserved(case) ident(EWOULDBLOCK)operator(:) -preprocessor(#endif) - ident(FD_ZERO)operator((&)ident(wfds)operator(\);) - ident(FD_SET)operator(()ident(f)operator(,) operator(&)ident(wfds)operator(\);) - ident(rb_thread_select)operator(()ident(f) operator(+) integer(1)operator(,) pre_constant(NULL)operator(,) operator(&)ident(wfds)operator(,) pre_constant(NULL)operator(,) pre_constant(NULL)operator(\);) - reserved(return) ident(Qtrue)operator(;) - - reserved(default)operator(:) - reserved(return) ident(Qfalse)operator(;) - operator(}) -operator(}) - -preprocessor(#ifndef) ident(S_ISREG) -preprocessor(# define) ident(S_ISREG)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFREG)operator(\)) -preprocessor(#endif) - -directive(static) pre_type(int) -ident(wsplit_p)operator(()ident(OpenFile) operator(*)ident(fptr)operator(\)) -operator({) - ident(FILE) operator(*)ident(f) operator(=) ident(GetWriteFile)operator(()ident(fptr)operator(\);) - pre_type(int) ident(r)operator(;) - reserved(if) operator((!()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WSPLIT_INITIALIZED)operator(\)\)) operator({) - reserved(struct) ident(stat) ident(buf)operator(;) - reserved(if) operator(()ident(fstat)operator(()ident(fileno)operator(()ident(f)operator(\),) operator(&)ident(buf)operator(\)) operator(==) integer(0) operator(&&) - operator(!)ident(S_ISREG)operator(()ident(buf)operator(.)ident(st_mode)operator(\)) -preprocessor(#if) ident(defined)operator(()ident(HAVE_FCNTL)operator(\)) operator(&&) ident(defined)operator(()ident(F_GETFL)operator(\)) operator(&&) ident(defined)operator(()ident(O_NONBLOCK)operator(\)) - operator(&&) operator(()ident(r) operator(=) ident(fcntl)operator(()ident(fileno)operator(()ident(f)operator(\),) ident(F_GETFL)operator(\)\)) operator(!=) operator(-)integer(1) operator(&&) - operator(!()ident(r) operator(&) ident(O_NONBLOCK)operator(\)) -preprocessor(#endif) - operator(\)) operator({) - ident(fptr)operator(->)ident(mode) operator(|=) ident(FMODE_WSPLIT)operator(;) - operator(}) - ident(fptr)operator(->)ident(mode) operator(|=) ident(FMODE_WSPLIT_INITIALIZED)operator(;) - operator(}) - reserved(return) ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WSPLIT)operator(;) -operator(}) - -comment(/* writing functions */) -directive(static) pre_type(long) -ident(io_fwrite)operator(()ident(str)operator(,) ident(fptr)operator(\)) - ident(VALUE) ident(str)operator(;) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - pre_type(long) ident(len)operator(,) ident(n)operator(,) ident(r)operator(,) ident(l)operator(,) ident(offset) operator(=) integer(0)operator(;) - ident(FILE) operator(*)ident(f) operator(=) ident(GetWriteFile)operator(()ident(fptr)operator(\);) - - ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator((()ident(n) operator(=) ident(len)operator(\)) operator(<=) integer(0)operator(\)) reserved(return) ident(n)operator(;) - reserved(if) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_SYNC)operator(\)) operator({) - ident(io_fflush)operator(()ident(f)operator(,) ident(fptr)operator(\);) - reserved(if) operator((!)ident(rb_thread_fd_writable)operator(()ident(fileno)operator(()ident(f)operator(\)\)\)) operator({) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) - operator(}) - label(retry:) - ident(l) operator(=) ident(n)operator(;) - reserved(if) operator(()ident(PIPE_BUF) operator(<) ident(l) operator(&&) - operator(!)ident(rb_thread_critical) operator(&&) - operator(!)ident(rb_thread_alone)operator((\)) operator(&&) - ident(wsplit_p)operator(()ident(fptr)operator(\)\)) operator({) - ident(l) operator(=) ident(PIPE_BUF)operator(;) - operator(}) - ident(TRAP_BEG)operator(;) - ident(r) operator(=) ident(write)operator(()ident(fileno)operator(()ident(f)operator(\),) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(+)ident(offset)operator(,) ident(l)operator(\);) - ident(TRAP_END)operator(;) - reserved(if) operator(()ident(r) operator(==) ident(n)operator(\)) reserved(return) ident(len)operator(;) - reserved(if) operator(()integer(0) operator(<=) ident(r)operator(\)) operator({) - ident(offset) operator(+=) ident(r)operator(;) - ident(n) operator(-=) ident(r)operator(;) - ident(errno) operator(=) ident(EAGAIN)operator(;) - operator(}) - reserved(if) operator(()ident(rb_io_wait_writable)operator(()ident(fileno)operator(()ident(f)operator(\)\)\)) operator({) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) - reserved(if) operator(()ident(offset) operator(<) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) - reserved(goto) ident(retry)operator(;) - operator(}) - reserved(return) operator(-)integer(1L)operator(;) - operator(}) -preprocessor(#if) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__vms)operator(\)) - reserved(do) operator({) - reserved(if) operator(()ident(fputc)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(offset)operator(++],) ident(f)operator(\)) operator(==) pre_constant(EOF)operator(\)) operator({) - reserved(if) operator(()ident(ferror)operator(()ident(f)operator(\)\)) reserved(return) operator(-)integer(1L)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) reserved(while) operator((--)ident(n) operator(>) integer(0)operator(\);) -preprocessor(#else) - reserved(while) operator(()ident(errno) operator(=) integer(0)operator(,) ident(offset) operator(+=) operator(()ident(r) operator(=) ident(fwrite)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(+)ident(offset)operator(,) integer(1)operator(,) ident(n)operator(,) ident(f)operator(\)\),) operator(()ident(n) operator(-=) ident(r)operator(\)) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(ferror)operator(()ident(f)operator(\)) -preprocessor(#if) ident(defined) ident(__BORLANDC__) - operator(||) ident(errno) -preprocessor(#endif) - operator(\)) operator({) -preprocessor(#ifdef) ident(__hpux) - reserved(if) operator((!)ident(errno)operator(\)) ident(errno) operator(=) ident(EAGAIN)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(_WIN32)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__BORLANDC__)operator(\)) - comment(/* workaround for MSVCRT's bug */) - reserved(if) operator((!)ident(errno)operator(\)) operator({) - reserved(if) operator(()ident(GetLastError)operator((\)) operator(==) ident(ERROR_NO_DATA)operator(\)) - ident(errno) operator(=) ident(EPIPE)operator(;) - reserved(else) - ident(errno) operator(=) ident(EBADF)operator(;) - operator(}) -preprocessor(#endif) - reserved(if) operator(()ident(rb_io_wait_writable)operator(()ident(fileno)operator(()ident(f)operator(\)\)\)) operator({) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) - ident(clearerr)operator(()ident(f)operator(\);) - reserved(if) operator(()ident(offset) operator(<) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) - reserved(continue)operator(;) - operator(}) - reserved(return) operator(-)integer(1L)operator(;) - operator(}) - operator(}) -preprocessor(#endif) - reserved(return) ident(len) operator(-) ident(n)operator(;) -operator(}) - -pre_type(long) -ident(rb_io_fwrite)operator(()ident(ptr)operator(,) ident(len)operator(,) ident(f)operator(\)) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) - ident(FILE) operator(*)ident(f)operator(;) -operator({) - ident(OpenFile) ident(of)operator(;) - - ident(of)operator(.)ident(f) operator(=) ident(f)operator(;) - ident(of)operator(.)ident(f2) operator(=) pre_constant(NULL)operator(;) - ident(of)operator(.)ident(mode) operator(=) ident(FMODE_WRITABLE)operator(;) - ident(of)operator(.)ident(path) operator(=) pre_constant(NULL)operator(;) - reserved(return) ident(io_fwrite)operator(()ident(rb_str_new)operator(()ident(ptr)operator(,) ident(len)operator(\),) operator(&)ident(of)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.write(string\) => integer - * - * Writes the given string to ios. The stream must be opened - * for writing. If the argument is not a string, it will be converted - * to a string using to_s. Returns the number of bytes - * written. - * - * count = $stdout.write( "This is a test\\n" \) - * puts "That was #{count} bytes of data" - * - * produces: - * - * This is a test - * That was 15 bytes of data - */) - -directive(static) ident(VALUE) -ident(io_write)operator(()ident(io)operator(,) ident(str)operator(\)) - ident(VALUE) ident(io)operator(,) ident(str)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(long) ident(n)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(str)operator(\)) operator(!=) ident(T_STRING)operator(\)) - ident(str) operator(=) ident(rb_obj_as_string)operator(()ident(str)operator(\);) - - reserved(if) operator(()ident(TYPE)operator(()ident(io)operator(\)) operator(!=) ident(T_FILE)operator(\)) operator({) - comment(/* port is not IO, call write method for it. */) - reserved(return) ident(rb_funcall)operator(()ident(io)operator(,) ident(id_write)operator(,) integer(1)operator(,) ident(str)operator(\);) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_writable)operator(()ident(fptr)operator(\);) - - ident(n) operator(=) ident(io_fwrite)operator(()ident(str)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(n) operator(==) operator(-)integer(1L)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - reserved(if) operator((!()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_SYNC)operator(\)\)) operator({) - ident(fptr)operator(->)ident(mode) operator(|=) ident(FMODE_WBUF)operator(;) - operator(}) - - reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_io_write)operator(()ident(io)operator(,) ident(str)operator(\)) - ident(VALUE) ident(io)operator(,) ident(str)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(io)operator(,) ident(id_write)operator(,) integer(1)operator(,) ident(str)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios << obj => ios - * - * String Output---Writes obj to ios. - * obj will be converted to a string using - * to_s. - * - * $stdout << "Hello " << "world!\\n" - * - * produces: - * - * Hello world! - */) - -ident(VALUE) -ident(rb_io_addstr)operator(()ident(io)operator(,) ident(str)operator(\)) - ident(VALUE) ident(io)operator(,) ident(str)operator(;) -operator({) - ident(rb_io_write)operator(()ident(io)operator(,) ident(str)operator(\);) - reserved(return) ident(io)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.flush => ios - * - * Flushes any buffered data within ios to the underlying - * operating system (note that this is Ruby internal buffering only; - * the OS may buffer the data as well\). - * - * $stdout.print "no newline" - * $stdout.flush - * - * produces: - * - * no newline - */) - -directive(static) ident(VALUE) -ident(rb_io_flush)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(FILE) operator(*)ident(f)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_writable)operator(()ident(fptr)operator(\);) - ident(f) operator(=) ident(GetWriteFile)operator(()ident(fptr)operator(\);) - - ident(io_fflush)operator(()ident(f)operator(,) ident(fptr)operator(\);) - - reserved(return) ident(io)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.pos => integer - * ios.tell => integer - * - * Returns the current offset (in bytes\) of ios. - * - * f = File.new("testfile"\) - * f.pos #=> 0 - * f.gets #=> "This is line one\\n" - * f.pos #=> 17 - */) - -directive(static) ident(VALUE) -ident(rb_io_tell)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(off_t) ident(pos)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(pos) operator(=) ident(io_tell)operator(()ident(fptr)operator(\);) - reserved(if) operator(()ident(pos) operator(<) integer(0) operator(&&) ident(errno)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - reserved(return) ident(OFFT2NUM)operator(()ident(pos)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_io_seek)operator(()ident(io)operator(,) ident(offset)operator(,) ident(whence)operator(\)) - ident(VALUE) ident(io)operator(,) ident(offset)operator(;) - pre_type(int) ident(whence)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(off_t) ident(pos)operator(;) - - ident(pos) operator(=) ident(NUM2OFFT)operator(()ident(offset)operator(\);) - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(pos) operator(=) ident(io_seek)operator(()ident(fptr)operator(,) ident(pos)operator(,) ident(whence)operator(\);) - reserved(if) operator(()ident(pos) operator(<) integer(0) operator(&&) ident(errno)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - ident(clearerr)operator(()ident(fptr)operator(->)ident(f)operator(\);) - - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.seek(amount, whence=SEEK_SET\) -> 0 - * - * Seeks to a given offset anInteger in the stream according to - * the value of whence: - * - * IO::SEEK_CUR | Seeks to _amount_ plus current position - * --------------+---------------------------------------------------- - * IO::SEEK_END | Seeks to _amount_ plus end of stream (you probably - * | want a negative value for _amount_\) - * --------------+---------------------------------------------------- - * IO::SEEK_SET | Seeks to the absolute location given by _amount_ - * - * Example: - * - * f = File.new("testfile"\) - * f.seek(-13, IO::SEEK_END\) #=> 0 - * f.readline #=> "And so on...\\n" - */) - -directive(static) ident(VALUE) -ident(rb_io_seek_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(offset)operator(,) ident(ptrname)operator(;) - pre_type(int) ident(whence) operator(=) ident(SEEK_SET)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(offset)operator(,) operator(&)ident(ptrname)operator(\)) operator(==) integer(2)operator(\)) operator({) - ident(whence) operator(=) ident(NUM2INT)operator(()ident(ptrname)operator(\);) - operator(}) - - reserved(return) ident(rb_io_seek)operator(()ident(io)operator(,) ident(offset)operator(,) ident(whence)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.pos = integer => integer - * - * Seeks to the given position (in bytes\) in ios. - * - * f = File.new("testfile"\) - * f.pos = 17 - * f.gets #=> "This is line two\\n" - */) - -directive(static) ident(VALUE) -ident(rb_io_set_pos)operator(()ident(io)operator(,) ident(offset)operator(\)) - ident(VALUE) ident(io)operator(,) ident(offset)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(off_t) ident(pos)operator(;) - - ident(pos) operator(=) ident(NUM2OFFT)operator(()ident(offset)operator(\);) - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(pos) operator(=) ident(io_seek)operator(()ident(fptr)operator(,) ident(pos)operator(,) ident(SEEK_SET)operator(\);) - reserved(if) operator(()ident(pos) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - ident(clearerr)operator(()ident(fptr)operator(->)ident(f)operator(\);) - - reserved(return) ident(OFFT2NUM)operator(()ident(pos)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.rewind => 0 - * - * Positions ios to the beginning of input, resetting - * lineno to zero. - * - * f = File.new("testfile"\) - * f.readline #=> "This is line one\\n" - * f.rewind #=> 0 - * f.lineno #=> 0 - * f.readline #=> "This is line one\\n" - */) - -directive(static) ident(VALUE) -ident(rb_io_rewind)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(io_seek)operator(()ident(fptr)operator(,) integer(0L)operator(,) integer(0)operator(\)) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - ident(clearerr)operator(()ident(fptr)operator(->)ident(f)operator(\);) - reserved(if) operator(()ident(io) operator(==) ident(current_file)operator(\)) operator({) - ident(gets_lineno) operator(-=) ident(fptr)operator(->)ident(lineno)operator(;) - operator(}) - ident(fptr)operator(->)ident(lineno) operator(=) integer(0)operator(;) - - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.eof => true or false - * ios.eof? => true or false - * - * Returns true if ios is at end of file that means - * there are no more data to read. - * The stream must be opened for reading or an IOError will be - * raised. - * - * f = File.new("testfile"\) - * dummy = f.readlines - * f.eof #=> true - * - * If ios is a stream such as pipe or socket, IO#eof? - * blocks until the other end sends some data or closes it. - * - * r, w = IO.pipe - * Thread.new { sleep 1; w.close } - * r.eof? #=> true after 1 second blocking - * - * r, w = IO.pipe - * Thread.new { sleep 1; w.puts "a" } - * r.eof? #=> false after 1 second blocking - * - * r, w = IO.pipe - * r.eof? # blocks forever - * - * Note that IO#eof? reads data to a input buffer. - * So IO#sysread doesn't work with IO#eof?. - */) - -ident(VALUE) -ident(rb_io_eof)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(ch)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - - reserved(if) operator(()ident(feof)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(READ_DATA_PENDING)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - ident(READ_CHECK)operator(()ident(fptr)operator(->)ident(f)operator(\);) - ident(clearerr)operator(()ident(fptr)operator(->)ident(f)operator(\);) - ident(TRAP_BEG)operator(;) - ident(ch) operator(=) ident(getc)operator(()ident(fptr)operator(->)ident(f)operator(\);) - ident(TRAP_END)operator(;) - - reserved(if) operator(()ident(ch) operator(!=) pre_constant(EOF)operator(\)) operator({) - ident(ungetc)operator(()ident(ch)operator(,) ident(fptr)operator(->)ident(f)operator(\);) - reserved(return) ident(Qfalse)operator(;) - operator(}) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) - ident(clearerr)operator(()ident(fptr)operator(->)ident(f)operator(\);) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.sync => true or false - * - * Returns the current ``sync mode'' of ios. When sync mode is - * true, all output is immediately flushed to the underlying operating - * system and is not buffered by Ruby internally. See also - * IO#fsync. - * - * f = File.new("testfile"\) - * f.sync #=> false - */) - -directive(static) ident(VALUE) -ident(rb_io_sync)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - reserved(return) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_SYNC)operator(\)) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.sync = boolean => boolean - * - * Sets the ``sync mode'' to true or false. - * When sync mode is true, all output is immediately flushed to the - * underlying operating system and is not buffered internally. Returns - * the new state. See also IO#fsync. - * - * f = File.new("testfile"\) - * f.sync = true - * - * (produces no output\) - */) - -directive(static) ident(VALUE) -ident(rb_io_set_sync)operator(()ident(io)operator(,) ident(mode)operator(\)) - ident(VALUE) ident(io)operator(,) ident(mode)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(RTEST)operator(()ident(mode)operator(\)\)) operator({) - ident(fptr)operator(->)ident(mode) operator(|=) ident(FMODE_SYNC)operator(;) - operator(}) - reserved(else) operator({) - ident(fptr)operator(->)ident(mode) operator(&=) operator(~)ident(FMODE_SYNC)operator(;) - operator(}) - reserved(return) ident(mode)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.fsync => 0 or nil - * - * Immediately writes all buffered data in ios to disk. - * Returns nil if the underlying operating system does not - * support fsync(2\). Note that fsync differs from - * using IO#sync=. The latter ensures that data is flushed - * from Ruby's buffers, but doesn't not guarantee that the underlying - * operating system actually writes it to disk. - */) - -directive(static) ident(VALUE) -ident(rb_io_fsync)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_FSYNC) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(FILE) operator(*)ident(f)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(f) operator(=) ident(GetWriteFile)operator(()ident(fptr)operator(\);) - - ident(io_fflush)operator(()ident(f)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(fsync)operator(()ident(fileno)operator(()ident(f)operator(\)\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * ios.fileno => fixnum - * ios.to_i => fixnum - * - * Returns an integer representing the numeric file descriptor for - * ios. - * - * $stdin.fileno #=> 0 - * $stdout.fileno #=> 1 - */) - -directive(static) ident(VALUE) -ident(rb_io_fileno)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(fd)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(fd) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\);) - reserved(return) ident(INT2FIX)operator(()ident(fd)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.pid => fixnum - * - * Returns the process ID of a child process associated with - * ios. This will be set by IO::popen. - * - * pipe = IO.popen("-"\) - * if pipe - * $stderr.puts "In parent, child pid is #{pipe.pid}" - * else - * $stderr.puts "In child, pid is #{$$}" - * end - * - * produces: - * - * In child, pid is 26209 - * In parent, child pid is 26209 - */) - -directive(static) ident(VALUE) -ident(rb_io_pid)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - reserved(if) operator((!)ident(fptr)operator(->)ident(pid)operator(\)) - reserved(return) ident(Qnil)operator(;) - reserved(return) ident(INT2FIX)operator(()ident(fptr)operator(->)ident(pid)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.inspect => string - * - * Return a string describing this IO object. - */) - -directive(static) ident(VALUE) -ident(rb_io_inspect)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(char) operator(*)ident(buf)operator(,) operator(*)ident(cname)operator(,) operator(*)ident(st) operator(=) stringoperator(;) - pre_type(long) ident(len)operator(;) - - ident(fptr) operator(=) ident(RFILE)operator(()ident(rb_io_taint_check)operator(()ident(obj)operator(\)\)->)ident(fptr)operator(;) - reserved(if) operator((!)ident(fptr) operator(||) operator(!)ident(fptr)operator(->)ident(path)operator(\)) reserved(return) ident(rb_any_to_s)operator(()ident(obj)operator(\);) - ident(cname) operator(=) ident(rb_obj_classname)operator(()ident(obj)operator(\);) - ident(len) operator(=) ident(strlen)operator(()ident(cname)operator(\)) operator(+) ident(strlen)operator(()ident(fptr)operator(->)ident(path)operator(\)) operator(+) integer(5)operator(;) - reserved(if) operator((!()ident(fptr)operator(->)ident(f) operator(||) ident(fptr)operator(->)ident(f2)operator(\)\)) operator({) - ident(st) operator(=) stringoperator(;) - ident(len) operator(+=) integer(9)operator(;) - operator(}) - ident(buf) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(len)operator(\);) - ident(snprintf)operator(()ident(buf)operator(,) ident(len)operator(,) string)delimiter(")>operator(,) ident(cname)operator(,) ident(fptr)operator(->)ident(path)operator(,) ident(st)operator(\);) - reserved(return) ident(rb_str_new2)operator(()ident(buf)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.to_io -> ios - * - * Returns ios. - */) - -directive(static) ident(VALUE) -ident(rb_io_to_io)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - reserved(return) ident(io)operator(;) -operator(}) - -comment(/* reading functions */) -directive(static) pre_type(long) -ident(read_buffered_data)operator(()ident(ptr)operator(,) ident(len)operator(,) ident(f)operator(\)) - pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) - ident(FILE) operator(*)ident(f)operator(;) -operator({) - pre_type(long) ident(n)operator(;) - -preprocessor(#ifdef) ident(READ_DATA_PENDING_COUNT) - ident(n) operator(=) ident(READ_DATA_PENDING_COUNT)operator(()ident(f)operator(\);) - reserved(if) operator(()ident(n) operator(<=) integer(0)operator(\)) reserved(return) integer(0)operator(;) - reserved(if) operator(()ident(n) operator(>) ident(len)operator(\)) ident(n) operator(=) ident(len)operator(;) - reserved(return) ident(fread)operator(()ident(ptr)operator(,) integer(1)operator(,) ident(n)operator(,) ident(f)operator(\);) -preprocessor(#else) - pre_type(int) ident(c)operator(;) - - reserved(for) operator(()ident(n) operator(=) integer(0)operator(;) ident(n) operator(<) ident(len) operator(&&) ident(READ_DATA_PENDING)operator(()ident(f)operator(\)) operator(&&) operator(()ident(c) operator(=) ident(getc)operator(()ident(f)operator(\)\)) operator(!=) pre_constant(EOF)operator(;) operator(++)ident(n)operator(\)) operator({) - operator(*)ident(ptr)operator(++) operator(=) ident(c)operator(;) - operator(}) - reserved(return) ident(n)operator(;) -preprocessor(#endif) -operator(}) - -directive(static) pre_type(long) -ident(io_fread)operator(()ident(ptr)operator(,) ident(len)operator(,) ident(fptr)operator(\)) - pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - pre_type(long) ident(n) operator(=) ident(len)operator(;) - pre_type(int) ident(c)operator(;) - pre_type(int) ident(saved_errno)operator(;) - - reserved(while) operator(()ident(n) operator(>) integer(0)operator(\)) operator({) - ident(c) operator(=) ident(read_buffered_data)operator(()ident(ptr)operator(,) ident(n)operator(,) ident(fptr)operator(->)ident(f)operator(\);) - reserved(if) operator(()ident(c) operator(<) integer(0)operator(\)) reserved(goto) ident(eof)operator(;) - reserved(if) operator(()ident(c) operator(>) integer(0)operator(\)) operator({) - ident(ptr) operator(+=) ident(c)operator(;) - reserved(if) operator((()ident(n) operator(-=) ident(c)operator(\)) operator(<=) integer(0)operator(\)) reserved(break)operator(;) - operator(}) - ident(rb_thread_wait_fd)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\)\);) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) - ident(clearerr)operator(()ident(fptr)operator(->)ident(f)operator(\);) - ident(TRAP_BEG)operator(;) - ident(c) operator(=) ident(getc)operator(()ident(fptr)operator(->)ident(f)operator(\);) - ident(TRAP_END)operator(;) - reserved(if) operator(()ident(c) operator(==) pre_constant(EOF)operator(\)) operator({) - label(eof:) - reserved(if) operator(()ident(ferror)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) operator({) - reserved(switch) operator(()ident(errno)operator(\)) operator({) - reserved(case) ident(EINTR)operator(:) -preprocessor(#if) ident(defined)operator(()ident(ERESTART)operator(\)) - reserved(case) ident(ERESTART)operator(:) -preprocessor(#endif) - ident(clearerr)operator(()ident(fptr)operator(->)ident(f)operator(\);) - reserved(continue)operator(;) - reserved(case) ident(EAGAIN)operator(:) -preprocessor(#if) ident(defined)operator(()ident(EWOULDBLOCK)operator(\)) operator(&&) ident(EWOULDBLOCK) operator(!=) ident(EAGAIN) - reserved(case) ident(EWOULDBLOCK)operator(:) -preprocessor(#endif) - reserved(if) operator(()ident(len) operator(>) ident(n)operator(\)) operator({) - ident(clearerr)operator(()ident(fptr)operator(->)ident(f)operator(\);) - operator(}) - ident(saved_errno) operator(=) ident(errno)operator(;) - ident(rb_warning)operator(()stringoperator(\);) - ident(errno) operator(=) ident(saved_errno)operator(;) - operator(}) - reserved(if) operator(()ident(len) operator(==) ident(n)operator(\)) reserved(return) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - operator(*)ident(ptr)operator(++) operator(=) ident(c)operator(;) - ident(n)operator(--;) - operator(}) - reserved(return) ident(len) operator(-) ident(n)operator(;) -operator(}) - -pre_type(long) -ident(rb_io_fread)operator(()ident(ptr)operator(,) ident(len)operator(,) ident(f)operator(\)) - pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) - ident(FILE) operator(*)ident(f)operator(;) -operator({) - ident(OpenFile) ident(of)operator(;) - - ident(of)operator(.)ident(f) operator(=) ident(f)operator(;) - ident(of)operator(.)ident(f2) operator(=) pre_constant(NULL)operator(;) - reserved(return) ident(io_fread)operator(()ident(ptr)operator(,) ident(len)operator(,) operator(&)ident(of)operator(\);) -operator(}) - -preprocessor(#define) ident(SMALLBUF) integer(100) - -directive(static) pre_type(long) -ident(remain_size)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - reserved(struct) ident(stat) ident(st)operator(;) - ident(off_t) ident(siz) operator(=) ident(BUFSIZ)operator(;) - ident(off_t) ident(pos)operator(;) - - reserved(if) operator(()ident(feof)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) reserved(return) integer(0)operator(;) - reserved(if) operator(()ident(fstat)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) operator(&)ident(st)operator(\)) operator(==) integer(0) operator(&&) ident(S_ISREG)operator(()ident(st)operator(.)ident(st_mode)operator(\)) -preprocessor(#ifdef) ident(__BEOS__) - operator(&&) operator(()ident(st)operator(.)ident(st_dev) operator(>) integer(3)operator(\)) -preprocessor(#endif) - operator(\)) - operator({) - ident(pos) operator(=) ident(io_tell)operator(()ident(fptr)operator(\);) - reserved(if) operator(()ident(st)operator(.)ident(st_size) operator(>=) ident(pos) operator(&&) ident(pos) operator(>=) integer(0)operator(\)) operator({) - ident(siz) operator(=) ident(st)operator(.)ident(st_size) operator(-) ident(pos) operator(+) integer(1)operator(;) - reserved(if) operator(()ident(siz) operator(>) ident(LONG_MAX)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - operator(}) - operator(}) - operator(}) - reserved(return) operator(()pre_type(long)operator(\))ident(siz)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(read_all)operator(()ident(fptr)operator(,) ident(siz)operator(,) ident(str)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(long) ident(siz)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(long) ident(bytes) operator(=) integer(0)operator(;) - pre_type(long) ident(n)operator(;) - - reserved(if) operator(()ident(siz) operator(==) integer(0)operator(\)) ident(siz) operator(=) ident(BUFSIZ)operator(;) - reserved(if) operator(()ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(siz)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_str_resize)operator(()ident(str)operator(,) ident(siz)operator(\);) - operator(}) - reserved(for) operator((;;\)) operator({) - ident(rb_str_locktmp)operator(()ident(str)operator(\);) - ident(READ_CHECK)operator(()ident(fptr)operator(->)ident(f)operator(\);) - ident(n) operator(=) ident(io_fread)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(+)ident(bytes)operator(,) ident(siz)operator(-)ident(bytes)operator(,) ident(fptr)operator(\);) - ident(rb_str_unlocktmp)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(n) operator(==) integer(0) operator(&&) ident(bytes) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator((!)ident(fptr)operator(->)ident(f)operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(feof)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) reserved(break)operator(;) - reserved(if) operator((!)ident(ferror)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) reserved(break)operator(;) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - ident(bytes) operator(+=) ident(n)operator(;) - reserved(if) operator(()ident(bytes) operator(<) ident(siz)operator(\)) reserved(break)operator(;) - ident(siz) operator(+=) ident(BUFSIZ)operator(;) - ident(rb_str_resize)operator(()ident(str)operator(,) ident(siz)operator(\);) - operator(}) - reserved(if) operator(()ident(bytes) operator(!=) ident(siz)operator(\)) ident(rb_str_resize)operator(()ident(str)operator(,) ident(bytes)operator(\);) - ident(OBJ_TAINT)operator(()ident(str)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -directive(void) ident(rb_io_set_nonblock)operator(()ident(OpenFile) operator(*)ident(fptr)operator(\)) -operator({) - pre_type(int) ident(flags)operator(;) -preprocessor(#ifdef) ident(F_GETFL) - ident(flags) operator(=) ident(fcntl)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(F_GETFL)operator(\);) - reserved(if) operator(()ident(flags) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) -preprocessor(#else) - ident(flags) operator(=) integer(0)operator(;) -preprocessor(#endif) - reserved(if) operator((()ident(flags) operator(&) ident(O_NONBLOCK)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(flags) operator(|=) ident(O_NONBLOCK)operator(;) - reserved(if) operator(()ident(fcntl)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(F_SETFL)operator(,) ident(flags)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - operator(}) - reserved(if) operator(()ident(fptr)operator(->)ident(f2)operator(\)) operator({) -preprocessor(#ifdef) ident(F_GETFL) - ident(flags) operator(=) ident(fcntl)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\),) ident(F_GETFL)operator(\);) - reserved(if) operator(()ident(flags) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) -preprocessor(#else) - ident(flags) operator(=) integer(0)operator(;) -preprocessor(#endif) - reserved(if) operator((()ident(flags) operator(&) ident(O_NONBLOCK)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(flags) operator(|=) ident(O_NONBLOCK)operator(;) - reserved(if) operator(()ident(fcntl)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\),) ident(F_SETFL)operator(,) ident(flags)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - operator(}) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(io_getpartial)operator(()pre_type(int) ident(argc)operator(,) ident(VALUE) operator(*)ident(argv)operator(,) ident(VALUE) ident(io)operator(,) pre_type(int) ident(nonblock)operator(\)) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(VALUE) ident(length)operator(,) ident(str)operator(;) - pre_type(long) ident(n)operator(,) ident(len)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(length)operator(,) operator(&)ident(str)operator(\);) - - reserved(if) operator((()ident(len) operator(=) ident(NUM2LONG)operator(()ident(length)operator(\)\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(len)operator(\);) - operator(}) - - reserved(if) operator(()ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) - operator(}) - reserved(else) operator({) - ident(StringValue)operator(()ident(str)operator(\);) - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(rb_str_resize)operator(()ident(str)operator(,) ident(len)operator(\);) - operator(}) - ident(OBJ_TAINT)operator(()ident(str)operator(\);) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) - reserved(return) ident(str)operator(;) - - reserved(if) operator((!)ident(nonblock)operator(\)) operator({) - ident(READ_CHECK)operator(()ident(fptr)operator(->)ident(f)operator(\);) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(!=) ident(len)operator(\)) operator({) - label(modified:) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - ident(n) operator(=) ident(read_buffered_data)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(,) ident(fptr)operator(->)ident(f)operator(\);) - reserved(if) operator(()ident(n) operator(<=) integer(0)operator(\)) operator({) - label(again:) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(!=) ident(len)operator(\)) reserved(goto) ident(modified)operator(;) - reserved(if) operator(()ident(nonblock)operator(\)) operator({) - ident(rb_io_set_nonblock)operator(()ident(fptr)operator(\);) - ident(n) operator(=) ident(read)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(\);) - operator(}) - reserved(else) operator({) - ident(TRAP_BEG)operator(;) - ident(n) operator(=) ident(read)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(\);) - ident(TRAP_END)operator(;) - operator(}) - reserved(if) operator(()ident(n) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator((!)ident(nonblock) operator(&&) ident(rb_io_wait_readable)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\)\)\)) - reserved(goto) ident(again)operator(;) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - reserved(if) operator(()ident(fptr)operator(->)ident(f)operator(\)) comment(/* update pos in FILE structure [ruby-core:21561] */) - ident(fflush)operator(()ident(fptr)operator(->)ident(f)operator(\);) - operator(}) - ident(rb_str_resize)operator(()ident(str)operator(,) ident(n)operator(\);) - - reserved(if) operator(()ident(n) operator(==) integer(0)operator(\)) - reserved(return) ident(Qnil)operator(;) - reserved(else) - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.readpartial(maxlen\) => string - * ios.readpartial(maxlen, outbuf\) => outbuf - * - * Reads at most maxlen bytes from the I/O stream. - * It blocks only if ios has no data immediately available. - * It doesn't block if some data available. - * If the optional outbuf argument is present, - * it must reference a String, which will receive the data. - * It raises EOFError on end of file. - * - * readpartial is designed for streams such as pipe, socket, tty, etc. - * It blocks only when no data immediately available. - * This means that it blocks only when following all conditions hold. - * * the buffer in the IO object is empty. - * * the content of the stream is empty. - * * the stream is not reached to EOF. - * - * When readpartial blocks, it waits data or EOF on the stream. - * If some data is reached, readpartial returns with the data. - * If EOF is reached, readpartial raises EOFError. - * - * When readpartial doesn't blocks, it returns or raises immediately. - * If the buffer is not empty, it returns the data in the buffer. - * Otherwise if the stream has some content, - * it returns the data in the stream. - * Otherwise if the stream is reached to EOF, it raises EOFError. - * - * r, w = IO.pipe # buffer pipe content - * w << "abc" # "" "abc". - * r.readpartial(4096\) #=> "abc" "" "" - * r.readpartial(4096\) # blocks because buffer and pipe is empty. - * - * r, w = IO.pipe # buffer pipe content - * w << "abc" # "" "abc" - * w.close # "" "abc" EOF - * r.readpartial(4096\) #=> "abc" "" EOF - * r.readpartial(4096\) # raises EOFError - * - * r, w = IO.pipe # buffer pipe content - * w << "abc\\ndef\\n" # "" "abc\\ndef\\n" - * r.gets #=> "abc\\n" "def\\n" "" - * w << "ghi\\n" # "def\\n" "ghi\\n" - * r.readpartial(4096\) #=> "def\\n" "" "ghi\\n" - * r.readpartial(4096\) #=> "ghi\\n" "" "" - * - * Note that readpartial behaves similar to sysread. - * The differences are: - * * If the buffer is not empty, read from the buffer instead of "sysread for buffered IO (IOError\)". - * * It doesn't cause Errno::EAGAIN and Errno::EINTR. When readpartial meets EAGAIN and EINTR by read system call, readpartial retry the system call. - * - * The later means that readpartial is nonblocking-flag insensitive. - * It blocks on the situation IO#sysread causes Errno::EAGAIN as if the fd is blocking mode. - * - */) - -directive(static) ident(VALUE) -ident(io_readpartial)operator(()pre_type(int) ident(argc)operator(,) ident(VALUE) operator(*)ident(argv)operator(,) ident(VALUE) ident(io)operator(\)) -operator({) - ident(VALUE) ident(ret)operator(;) - - ident(ret) operator(=) ident(io_getpartial)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(ret)operator(\)\)) - ident(rb_eof_error)operator((\);) - reserved(else) - reserved(return) ident(ret)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.read_nonblock(maxlen\) => string - * ios.read_nonblock(maxlen, outbuf\) => outbuf - * - * Reads at most maxlen bytes from ios using - * read(2\) system call after O_NONBLOCK is set for - * the underlying file descriptor. - * - * If the optional outbuf argument is present, - * it must reference a String, which will receive the data. - * - * read_nonblock just calls read(2\). - * It causes all errors read(2\) causes: EAGAIN, EINTR, etc. - * The caller should care such errors. - * - * read_nonblock causes EOFError on EOF. - * - * If the read buffer is not empty, - * read_nonblock reads from the buffer like readpartial. - * In this case, read(2\) is not called. - * - */) - -directive(static) ident(VALUE) -ident(io_read_nonblock)operator(()pre_type(int) ident(argc)operator(,) ident(VALUE) operator(*)ident(argv)operator(,) ident(VALUE) ident(io)operator(\)) -operator({) - ident(VALUE) ident(ret)operator(;) - - ident(ret) operator(=) ident(io_getpartial)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(,) integer(1)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(ret)operator(\)\)) - ident(rb_eof_error)operator((\);) - reserved(else) - reserved(return) ident(ret)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.write_nonblock(string\) => integer - * - * Writes the given string to ios using - * write(2\) system call after O_NONBLOCK is set for - * the underlying file descriptor. - * - * write_nonblock just calls write(2\). - * It causes all errors write(2\) causes: EAGAIN, EINTR, etc. - * The result may also be smaller than string.length (partial write\). - * The caller should care such errors and partial write. - * - */) - -directive(static) ident(VALUE) -ident(rb_io_write_nonblock)operator(()ident(VALUE) ident(io)operator(,) ident(VALUE) ident(str)operator(\)) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(FILE) operator(*)ident(f)operator(;) - pre_type(long) ident(n)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(str)operator(\)) operator(!=) ident(T_STRING)operator(\)) - ident(str) operator(=) ident(rb_obj_as_string)operator(()ident(str)operator(\);) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_writable)operator(()ident(fptr)operator(\);) - - ident(f) operator(=) ident(GetWriteFile)operator(()ident(fptr)operator(\);) - - ident(rb_io_set_nonblock)operator(()ident(fptr)operator(\);) - ident(n) operator(=) ident(write)operator(()ident(fileno)operator(()ident(f)operator(\),) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) - - reserved(if) operator(()ident(n) operator(==) operator(-)integer(1)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - - reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.read([length [, buffer]]\) => string, buffer, or nil - * - * Reads at most length bytes from the I/O stream, or to the - * end of file if length is omitted or is nil. - * length must be a non-negative integer or nil. - * If the optional buffer argument is present, it must reference - * a String, which will receive the data. - * - * At end of file, it returns nil or "" - * depend on length. - * ios.read(\) and - * ios.read(nil\) returns "". - * ios.read(positive-integer\) returns nil. - * - * f = File.new("testfile"\) - * f.read(16\) #=> "This is line one" - */) - -directive(static) ident(VALUE) -ident(io_read)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(long) ident(n)operator(,) ident(len)operator(;) - ident(VALUE) ident(length)operator(,) ident(str)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(length)operator(,) operator(&)ident(str)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(length)operator(\)\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(str)operator(\)\)) ident(StringValue)operator(()ident(str)operator(\);) - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - reserved(return) ident(read_all)operator(()ident(fptr)operator(,) ident(remain_size)operator(()ident(fptr)operator(\),) ident(str)operator(\);) - operator(}) - ident(len) operator(=) ident(NUM2LONG)operator(()ident(length)operator(\);) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(len)operator(\);) - operator(}) - - reserved(if) operator(()ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(str) operator(=) ident(rb_tainted_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) - operator(}) - reserved(else) operator({) - ident(StringValue)operator(()ident(str)operator(\);) - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(rb_str_resize)operator(()ident(str)operator(,)ident(len)operator(\);) - operator(}) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - reserved(if) operator(()ident(feof)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(str)operator(;) - - ident(rb_str_locktmp)operator(()ident(str)operator(\);) - ident(READ_CHECK)operator(()ident(fptr)operator(->)ident(f)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(!=) ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - ident(n) operator(=) ident(io_fread)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(,) ident(fptr)operator(\);) - ident(rb_str_unlocktmp)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(n) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator((!)ident(fptr)operator(->)ident(f)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(feof)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) operator({) - ident(rb_str_resize)operator(()ident(str)operator(,) integer(0)operator(\);) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(if) operator(()ident(len) operator(>) integer(0)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - ident(rb_str_resize)operator(()ident(str)operator(,) ident(n)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(n)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(n)operator(]) operator(=) char('\\0')operator(;) - ident(OBJ_TAINT)operator(()ident(str)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(appendline)operator(()ident(fptr)operator(,) ident(delim)operator(,) ident(strp)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(delim)operator(;) - ident(VALUE) operator(*)ident(strp)operator(;) -operator({) - ident(FILE) operator(*)ident(f) operator(=) ident(fptr)operator(->)ident(f)operator(;) - ident(VALUE) ident(str) operator(=) operator(*)ident(strp)operator(;) - pre_type(int) ident(c) operator(=) pre_constant(EOF)operator(;) -preprocessor(#ifndef) ident(READ_DATA_PENDING_PTR) - pre_type(char) ident(buf)operator([)integer(8192)operator(];) - pre_type(char) operator(*)ident(bp) operator(=) ident(buf)operator(,) operator(*)ident(bpe) operator(=) ident(buf) operator(+) reserved(sizeof) ident(buf) operator(-) integer(3)operator(;) - pre_type(int) ident(update) operator(=) ident(Qfalse)operator(;) -preprocessor(#endif) - - reserved(do) operator({) -preprocessor(#ifdef) ident(READ_DATA_PENDING_PTR) - pre_type(long) ident(pending) operator(=) ident(READ_DATA_PENDING_COUNT)operator(()ident(f)operator(\);) - reserved(if) operator(()ident(pending) operator(>) integer(0)operator(\)) operator({) - directive(const) pre_type(char) operator(*)ident(p) operator(=) ident(READ_DATA_PENDING_PTR)operator(()ident(f)operator(\);) - directive(const) pre_type(char) operator(*)ident(e) operator(=) ident(memchr)operator(()ident(p)operator(,) ident(delim)operator(,) ident(pending)operator(\);) - pre_type(long) ident(last) operator(=) integer(0)operator(,) ident(len) operator(=) operator(()ident(c) operator(!=) pre_constant(EOF)operator(\);) - reserved(if) operator(()ident(e)operator(\)) ident(pending) operator(=) ident(e) operator(-) ident(p) operator(+) integer(1)operator(;) - ident(len) operator(+=) ident(pending)operator(;) - reserved(if) operator((!)ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(last) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(rb_str_resize)operator(()ident(str)operator(,) ident(last) operator(+) ident(len)operator(\);) - operator(}) - reserved(else) operator({) - operator(*)ident(strp) operator(=) ident(str) operator(=) ident(rb_str_buf_new)operator(()ident(len)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(len)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(len)operator(]) operator(=) char('\\0')operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(!=) pre_constant(EOF)operator(\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(last)operator(++]) operator(=) ident(c)operator(;) - operator(}) - ident(fread)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(last)operator(,) integer(1)operator(,) ident(pending)operator(,) ident(f)operator(\);) comment(/* must not fail */) - reserved(if) operator(()ident(e)operator(\)) reserved(return) ident(delim)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(!=) pre_constant(EOF)operator(\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - pre_type(char) ident(ch) operator(=) ident(c)operator(;) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) operator(&)ident(ch)operator(,) integer(1)operator(\);) - operator(}) - reserved(else) operator({) - operator(*)ident(strp) operator(=) ident(str) operator(=) ident(rb_str_buf_new)operator(()integer(1)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(++]) operator(=) ident(c)operator(;) - operator(}) - operator(}) - ident(rb_thread_wait_fd)operator(()ident(fileno)operator(()ident(f)operator(\)\);) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) -preprocessor(#else) - ident(READ_CHECK)operator(()ident(f)operator(\);) -preprocessor(#endif) - ident(clearerr)operator(()ident(f)operator(\);) - ident(TRAP_BEG)operator(;) - ident(c) operator(=) ident(getc)operator(()ident(f)operator(\);) - ident(TRAP_END)operator(;) - reserved(if) operator(()ident(c) operator(==) pre_constant(EOF)operator(\)) operator({) - reserved(if) operator(()ident(ferror)operator(()ident(f)operator(\)\)) operator({) - ident(clearerr)operator(()ident(f)operator(\);) - reserved(if) operator((!)ident(rb_io_wait_readable)operator(()ident(fileno)operator(()ident(f)operator(\)\)\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - reserved(continue)operator(;) - operator(}) -preprocessor(#ifdef) ident(READ_DATA_PENDING_PTR) - reserved(return) ident(c)operator(;) -preprocessor(#endif) - operator(}) -preprocessor(#ifndef) ident(READ_DATA_PENDING_PTR) - reserved(if) operator(()ident(c) operator(==) pre_constant(EOF) operator(||) operator((*)ident(bp)operator(++) operator(=) ident(c)operator(\)) operator(==) ident(delim) operator(||) ident(bp) operator(==) ident(bpe)operator(\)) operator({) - pre_type(int) ident(cnt) operator(=) ident(bp) operator(-) ident(buf)operator(;) - - reserved(if) operator(()ident(cnt) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(str)operator(\)\)) - ident(rb_str_cat)operator(()ident(str)operator(,) ident(buf)operator(,) ident(cnt)operator(\);) - reserved(else) - operator(*)ident(strp) operator(=) ident(str) operator(=) ident(rb_str_new)operator(()ident(buf)operator(,) ident(cnt)operator(\);) - operator(}) - reserved(if) operator(()ident(c) operator(==) pre_constant(EOF)operator(\)) operator({) - reserved(if) operator(()ident(update)operator(\)) - reserved(return) operator(()pre_type(int)operator(\))ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(-)integer(1)operator(];) - reserved(return) ident(c)operator(;) - operator(}) - ident(bp) operator(=) ident(buf)operator(;) - operator(}) - ident(update) operator(=) ident(Qtrue)operator(;) -preprocessor(#endif) - operator(}) reserved(while) operator(()ident(c) operator(!=) ident(delim)operator(\);) - -preprocessor(#ifdef) ident(READ_DATA_PENDING_PTR) - operator({) - pre_type(char) ident(ch) operator(=) ident(c)operator(;) - reserved(if) operator((!)ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(rb_str_cat)operator(()ident(str)operator(,) operator(&)ident(ch)operator(,) integer(1)operator(\);) - operator(}) - reserved(else) operator({) - operator(*)ident(strp) operator(=) ident(str) operator(=) ident(rb_str_new)operator((&)ident(ch)operator(,) integer(1)operator(\);) - operator(}) - operator(}) -preprocessor(#endif) - - reserved(return) ident(c)operator(;) -operator(}) - -directive(static) directive(inline) pre_type(int) -ident(swallow)operator(()ident(fptr)operator(,) ident(term)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(term)operator(;) -operator({) - ident(FILE) operator(*)ident(f) operator(=) ident(fptr)operator(->)ident(f)operator(;) - pre_type(int) ident(c)operator(;) - - reserved(do) operator({) -preprocessor(#ifdef) ident(READ_DATA_PENDING_PTR) - pre_type(long) ident(cnt)operator(;) - reserved(while) operator((()ident(cnt) operator(=) ident(READ_DATA_PENDING_COUNT)operator(()ident(f)operator(\)\)) operator(>) integer(0)operator(\)) operator({) - pre_type(char) ident(buf)operator([)integer(1024)operator(];) - directive(const) pre_type(char) operator(*)ident(p) operator(=) ident(READ_DATA_PENDING_PTR)operator(()ident(f)operator(\);) - pre_type(int) ident(i)operator(;) - reserved(if) operator(()ident(cnt) operator(>) reserved(sizeof) ident(buf)operator(\)) ident(cnt) operator(=) reserved(sizeof) ident(buf)operator(;) - reserved(if) operator((*)ident(p) operator(!=) ident(term)operator(\)) reserved(return) ident(Qtrue)operator(;) - ident(i) operator(=) ident(cnt)operator(;) - reserved(while) operator((--)ident(i) operator(&&) operator(*++)ident(p) operator(==) ident(term)operator(\);) - reserved(if) operator((!)ident(fread)operator(()ident(buf)operator(,) integer(1)operator(,) ident(cnt) operator(-) ident(i)operator(,) ident(f)operator(\)\)) comment(/* must not fail */) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - ident(rb_thread_wait_fd)operator(()ident(fileno)operator(()ident(f)operator(\)\);) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) -preprocessor(#else) - ident(READ_CHECK)operator(()ident(f)operator(\);) -preprocessor(#endif) - ident(clearerr)operator(()ident(f)operator(\);) - ident(TRAP_BEG)operator(;) - ident(c) operator(=) ident(getc)operator(()ident(f)operator(\);) - ident(TRAP_END)operator(;) - reserved(if) operator(()ident(c) operator(!=) ident(term)operator(\)) operator({) - ident(ungetc)operator(()ident(c)operator(,) ident(f)operator(\);) - reserved(return) ident(Qtrue)operator(;) - operator(}) - operator(}) reserved(while) operator(()ident(c) operator(!=) pre_constant(EOF)operator(\);) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_io_getline_fast)operator(()ident(fptr)operator(,) ident(delim)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(unsigned) pre_type(char) ident(delim)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(Qnil)operator(;) - pre_type(int) ident(c)operator(;) - - reserved(while) operator((()ident(c) operator(=) ident(appendline)operator(()ident(fptr)operator(,) ident(delim)operator(,) operator(&)ident(str)operator(\)\)) operator(!=) pre_constant(EOF) operator(&&) ident(c) operator(!=) ident(delim)operator(\);) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(fptr)operator(->)ident(lineno)operator(++;) - ident(lineno) operator(=) ident(INT2FIX)operator(()ident(fptr)operator(->)ident(lineno)operator(\);) - ident(OBJ_TAINT)operator(()ident(str)operator(\);) - operator(}) - - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(rscheck)operator(()ident(rsptr)operator(,) ident(rslen)operator(,) ident(rs)operator(\)) - pre_type(char) operator(*)ident(rsptr)operator(;) - pre_type(long) ident(rslen)operator(;) - ident(VALUE) ident(rs)operator(;) -operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(rs)operator(\)->)ident(ptr) operator(!=) ident(rsptr) operator(&&) ident(RSTRING)operator(()ident(rs)operator(\)->)ident(len) operator(!=) ident(rslen)operator(\)) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(return) integer(1)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(rb_io_getline)operator(()ident(VALUE) ident(rs)operator(,) ident(VALUE) ident(io)operator(\);) - -directive(static) ident(VALUE) -ident(rb_io_getline)operator(()ident(rs)operator(,) ident(io)operator(\)) - ident(VALUE) ident(rs)operator(,) ident(io)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(Qnil)operator(;) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(rs)operator(\)\)) operator({) - ident(str) operator(=) ident(read_all)operator(()ident(fptr)operator(,) integer(0)operator(,) ident(Qnil)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(rs) operator(==) ident(rb_default_rs)operator(\)) operator({) - reserved(return) ident(rb_io_getline_fast)operator(()ident(fptr)operator(,) char('\\n')operator(\);) - operator(}) - reserved(else) operator({) - pre_type(int) ident(c)operator(,) ident(newline)operator(;) - pre_type(char) operator(*)ident(rsptr)operator(;) - pre_type(long) ident(rslen)operator(;) - pre_type(int) ident(rspara) operator(=) integer(0)operator(;) - - ident(rslen) operator(=) ident(RSTRING)operator(()ident(rs)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(rslen) operator(==) integer(0)operator(\)) operator({) - ident(rsptr) operator(=) stringoperator(;) - ident(rslen) operator(=) integer(2)operator(;) - ident(rspara) operator(=) integer(1)operator(;) - ident(swallow)operator(()ident(fptr)operator(,) char('\\n')operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(rslen) operator(==) integer(1)operator(\)) operator({) - reserved(return) ident(rb_io_getline_fast)operator(()ident(fptr)operator(,) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(RSTRING)operator(()ident(rs)operator(\)->)ident(ptr)operator([)integer(0)operator(]\);) - operator(}) - reserved(else) operator({) - ident(rsptr) operator(=) ident(RSTRING)operator(()ident(rs)operator(\)->)ident(ptr)operator(;) - operator(}) - ident(newline) operator(=) ident(rsptr)operator([)ident(rslen) operator(-) integer(1)operator(];) - - reserved(while) operator((()ident(c) operator(=) ident(appendline)operator(()ident(fptr)operator(,) ident(newline)operator(,) operator(&)ident(str)operator(\)\)) operator(!=) pre_constant(EOF) operator(&&) - operator(()ident(c) operator(!=) ident(newline) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<) ident(rslen) operator(||) - operator((()ident(rspara) operator(||) ident(rscheck)operator(()ident(rsptr)operator(,)ident(rslen)operator(,)ident(rs)operator(\)\)) operator(&&) integer(0)operator(\)) operator(||) - ident(memcmp)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(+)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(-)ident(rslen)operator(,)ident(rsptr)operator(,)ident(rslen)operator(\)\)\);) - - reserved(if) operator(()ident(rspara)operator(\)) operator({) - reserved(if) operator(()ident(c) operator(!=) pre_constant(EOF)operator(\)) operator({) - ident(swallow)operator(()ident(fptr)operator(,) char('\\n')operator(\);) - operator(}) - operator(}) - operator(}) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(fptr)operator(->)ident(lineno)operator(++;) - ident(lineno) operator(=) ident(INT2FIX)operator(()ident(fptr)operator(->)ident(lineno)operator(\);) - ident(OBJ_TAINT)operator(()ident(str)operator(\);) - operator(}) - - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_io_gets)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - reserved(return) ident(rb_io_getline_fast)operator(()ident(fptr)operator(,) char('\\n')operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.gets(sep_string=$/\) => string or nil - * - * Reads the next ``line'' from the I/O stream; lines are separated by - * sep_string. A separator of nil reads the entire - * contents, and a zero-length separator reads the input a paragraph at - * a time (two successive newlines in the input separate paragraphs\). - * The stream must be opened for reading or an IOError - * will be raised. The line read in will be returned and also assigned - * to $_. Returns nil if called at end of - * file. - * - * File.new("testfile"\).gets #=> "This is line one\\n" - * $_ #=> "This is line one\\n" - */) - -directive(static) ident(VALUE) -ident(rb_io_gets_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(rs)operator(,) ident(str)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rs) operator(=) ident(rb_rs)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(rs)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(rs)operator(\)\)) ident(StringValue)operator(()ident(rs)operator(\);) - operator(}) - ident(str) operator(=) ident(rb_io_getline)operator(()ident(rs)operator(,) ident(io)operator(\);) - ident(rb_lastline_set)operator(()ident(str)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.lineno => integer - * - * Returns the current line number in ios. The stream must be - * opened for reading. lineno counts the number of times - * gets is called, rather than the number of newlines - * encountered. The two values will differ if gets is - * called with a separator other than newline. See also the - * $. variable. - * - * f = File.new("testfile"\) - * f.lineno #=> 0 - * f.gets #=> "This is line one\\n" - * f.lineno #=> 1 - * f.gets #=> "This is line two\\n" - * f.lineno #=> 2 - */) - -directive(static) ident(VALUE) -ident(rb_io_lineno)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - reserved(return) ident(INT2NUM)operator(()ident(fptr)operator(->)ident(lineno)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.lineno = integer => integer - * - * Manually sets the current line number to the given value. - * $. is updated only on the next read. - * - * f = File.new("testfile"\) - * f.gets #=> "This is line one\\n" - * $. #=> 1 - * f.lineno = 1000 - * f.lineno #=> 1000 - * $. # lineno of last read #=> 1 - * f.gets #=> "This is line two\\n" - * $. # lineno of last read #=> 1001 - */) - -directive(static) ident(VALUE) -ident(rb_io_set_lineno)operator(()ident(io)operator(,) ident(lineno)operator(\)) - ident(VALUE) ident(io)operator(,) ident(lineno)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - ident(fptr)operator(->)ident(lineno) operator(=) ident(NUM2INT)operator(()ident(lineno)operator(\);) - reserved(return) ident(lineno)operator(;) -operator(}) - -directive(static) directive(void) -ident(lineno_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(var)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) operator(*)ident(var)operator(;) -operator({) - ident(gets_lineno) operator(=) ident(NUM2INT)operator(()ident(val)operator(\);) - operator(*)ident(var) operator(=) ident(INT2FIX)operator(()ident(gets_lineno)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(argf_set_lineno)operator(()ident(argf)operator(,) ident(val)operator(\)) - ident(VALUE) ident(argf)operator(,) ident(val)operator(;) -operator({) - ident(gets_lineno) operator(=) ident(NUM2INT)operator(()ident(val)operator(\);) - ident(lineno) operator(=) ident(INT2FIX)operator(()ident(gets_lineno)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_lineno)operator((\)) -operator({) - reserved(return) ident(lineno)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.readline(sep_string=$/\) => string - * - * Reads a line as with IO#gets, but raises an - * EOFError on end of file. - */) - -directive(static) ident(VALUE) -ident(rb_io_readline)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(line) operator(=) ident(rb_io_gets_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(line)operator(\)\)) operator({) - ident(rb_eof_error)operator((\);) - operator(}) - reserved(return) ident(line)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.readlines(sep_string=$/\) => array - * - * Reads all of the lines in ios, and returns them in - * anArray. Lines are separated by the optional - * sep_string. If sep_string is nil, the - * rest of the stream is returned as a single record. - * The stream must be opened for reading or an - * IOError will be raised. - * - * f = File.new("testfile"\) - * f.readlines[0] #=> "This is line one\\n" - */) - -directive(static) ident(VALUE) -ident(rb_io_readlines)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(line)operator(,) ident(ary)operator(;) - ident(VALUE) ident(rs)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rs) operator(=) ident(rb_rs)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(rs)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(rs)operator(\)\)) ident(StringValue)operator(()ident(rs)operator(\);) - operator(}) - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - reserved(while) operator((!)ident(NIL_P)operator(()ident(line) operator(=) ident(rb_io_getline)operator(()ident(rs)operator(,) ident(io)operator(\)\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(line)operator(\);) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.each(sep_string=$/\) {|line| block } => ios - * ios.each_line(sep_string=$/\) {|line| block } => ios - * - * Executes the block for every line in ios, where lines are - * separated by sep_string. ios must be opened for - * reading or an IOError will be raised. - * - * f = File.new("testfile"\) - * f.each {|line| puts "#{f.lineno}: #{line}" } - * - * produces: - * - * 1: This is line one - * 2: This is line two - * 3: This is line three - * 4: And so on... - */) - -directive(static) ident(VALUE) -ident(rb_io_each_line)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - ident(VALUE) ident(rs)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rs) operator(=) ident(rb_rs)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(rs)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(rs)operator(\)\)) ident(StringValue)operator(()ident(rs)operator(\);) - operator(}) - reserved(while) operator((!)ident(NIL_P)operator(()ident(str) operator(=) ident(rb_io_getline)operator(()ident(rs)operator(,) ident(io)operator(\)\)\)) operator({) - ident(rb_yield)operator(()ident(str)operator(\);) - operator(}) - reserved(return) ident(io)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.each_byte {|byte| block } => nil - * - * Calls the given block once for each byte (0..255\) in ios, - * passing the byte as an argument. The stream must be opened for - * reading or an IOError will be raised. - * - * f = File.new("testfile"\) - * checksum = 0 - * f.each_byte {|x| checksum ^= x } #=> # - * checksum #=> 12 - */) - -directive(static) ident(VALUE) -ident(rb_io_each_byte)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(FILE) operator(*)ident(f)operator(;) - pre_type(int) ident(c)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - - reserved(for) operator((;;\)) operator({) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - ident(f) operator(=) ident(fptr)operator(->)ident(f)operator(;) - ident(READ_CHECK)operator(()ident(f)operator(\);) - ident(clearerr)operator(()ident(f)operator(\);) - ident(TRAP_BEG)operator(;) - ident(c) operator(=) ident(getc)operator(()ident(f)operator(\);) - ident(TRAP_END)operator(;) - reserved(if) operator(()ident(c) operator(==) pre_constant(EOF)operator(\)) operator({) - reserved(if) operator(()ident(ferror)operator(()ident(f)operator(\)\)) operator({) - ident(clearerr)operator(()ident(f)operator(\);) - reserved(if) operator((!)ident(rb_io_wait_readable)operator(()ident(fileno)operator(()ident(f)operator(\)\)\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - reserved(continue)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - ident(rb_yield)operator(()ident(INT2FIX)operator(()ident(c) operator(&) hex(0xff)operator(\)\);) - operator(}) - reserved(if) operator(()ident(ferror)operator(()ident(f)operator(\)\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - reserved(return) ident(io)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.getc => fixnum or nil - * - * Gets the next 8-bit byte (0..255\) from ios. Returns - * nil if called at end of file. - * - * f = File.new("testfile"\) - * f.getc #=> 84 - * f.getc #=> 104 - */) - -ident(VALUE) -ident(rb_io_getc)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(FILE) operator(*)ident(f)operator(;) - pre_type(int) ident(c)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - ident(f) operator(=) ident(fptr)operator(->)ident(f)operator(;) - - label(retry:) - ident(READ_CHECK)operator(()ident(f)operator(\);) - ident(clearerr)operator(()ident(f)operator(\);) - ident(TRAP_BEG)operator(;) - ident(c) operator(=) ident(getc)operator(()ident(f)operator(\);) - ident(TRAP_END)operator(;) - - reserved(if) operator(()ident(c) operator(==) pre_constant(EOF)operator(\)) operator({) - reserved(if) operator(()ident(ferror)operator(()ident(f)operator(\)\)) operator({) - ident(clearerr)operator(()ident(f)operator(\);) - reserved(if) operator((!)ident(rb_io_wait_readable)operator(()ident(fileno)operator(()ident(f)operator(\)\)\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - reserved(goto) ident(retry)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(c) operator(&) hex(0xff)operator(\);) -operator(}) - -pre_type(int) -ident(rb_getc)operator(()ident(f)operator(\)) - ident(FILE) operator(*)ident(f)operator(;) -operator({) - pre_type(int) ident(c)operator(;) - - reserved(if) operator((!)ident(READ_DATA_PENDING)operator(()ident(f)operator(\)\)) operator({) - ident(rb_thread_wait_fd)operator(()ident(fileno)operator(()ident(f)operator(\)\);) - operator(}) - ident(clearerr)operator(()ident(f)operator(\);) - ident(TRAP_BEG)operator(;) - ident(c) operator(=) ident(getc)operator(()ident(f)operator(\);) - ident(TRAP_END)operator(;) - - reserved(return) ident(c)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.readchar => fixnum - * - * Reads a character as with IO#getc, but raises an - * EOFError on end of file. - */) - -directive(static) ident(VALUE) -ident(rb_io_readchar)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(c) operator(=) ident(rb_io_getc)operator(()ident(io)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(c)operator(\)\)) operator({) - ident(rb_eof_error)operator((\);) - operator(}) - reserved(return) ident(c)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.ungetc(integer\) => nil - * - * Pushes back one character (passed as a parameter\) onto ios, - * such that a subsequent buffered read will return it. Only one character - * may be pushed back before a subsequent read operation (that is, - * you will be able to read only the last of several characters that have been pushed - * back\). Has no effect with unbuffered reads (such as IO#sysread\). - * - * f = File.new("testfile"\) #=> # - * c = f.getc #=> 84 - * f.ungetc(c\) #=> nil - * f.getc #=> 84 - */) - -ident(VALUE) -ident(rb_io_ungetc)operator(()ident(io)operator(,) ident(c)operator(\)) - ident(VALUE) ident(io)operator(,) ident(c)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(cc) operator(=) ident(NUM2INT)operator(()ident(c)operator(\);) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - reserved(if) operator((!()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_RBUF)operator(\)\)) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - - reserved(if) operator(()ident(ungetc)operator(()ident(cc)operator(,) ident(fptr)operator(->)ident(f)operator(\)) operator(==) pre_constant(EOF) operator(&&) ident(cc) operator(!=) pre_constant(EOF)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.isatty => true or false - * ios.tty? => true or false - * - * Returns true if ios is associated with a - * terminal device (tty\), false otherwise. - * - * File.new("testfile"\).isatty #=> false - * File.new("/dev/tty"\).isatty #=> true - */) - -directive(static) ident(VALUE) -ident(rb_io_isatty)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(isatty)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) operator(==) integer(0)operator(\)) - reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -directive(static) directive(void) -ident(fptr_finalize)operator(()ident(fptr)operator(,) ident(noraise)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(noraise)operator(;) -operator({) - pre_type(int) ident(n1) operator(=) integer(0)operator(,) ident(n2) operator(=) integer(0)operator(,) ident(f1)operator(,) ident(f2) operator(=) operator(-)integer(1)operator(;) - - ident(errno) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(fptr)operator(->)ident(f2)operator(\)) operator({) - ident(f2) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\);) - reserved(while) operator(()ident(n2) operator(=) integer(0)operator(,) ident(fflush)operator(()ident(fptr)operator(->)ident(f2)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(n2) operator(=) ident(errno)operator(;) - reserved(if) operator((!)ident(rb_io_wait_writable)operator(()ident(f2)operator(\)\)) operator({) - reserved(break)operator(;) - operator(}) - reserved(if) operator((!)ident(fptr)operator(->)ident(f2)operator(\)) reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(fclose)operator(()ident(fptr)operator(->)ident(f2)operator(\)) operator(<) integer(0) operator(&&) ident(n2) operator(==) integer(0)operator(\)) operator({) - ident(n2) operator(=) ident(errno)operator(;) - operator(}) - ident(fptr)operator(->)ident(f2) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(fptr)operator(->)ident(f)operator(\)) operator({) - ident(f1) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\);) - reserved(if) operator((()ident(f2) operator(==) operator(-)integer(1)operator(\)) operator(&&) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WBUF)operator(\)\)) operator({) - reserved(while) operator(()ident(n1) operator(=) integer(0)operator(,) ident(fflush)operator(()ident(fptr)operator(->)ident(f)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(n1) operator(=) ident(errno)operator(;) - reserved(if) operator((!)ident(rb_io_wait_writable)operator(()ident(f1)operator(\)\)) reserved(break)operator(;) - reserved(if) operator((!)ident(fptr)operator(->)ident(f)operator(\)) reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(fclose)operator(()ident(fptr)operator(->)ident(f)operator(\)) operator(<) integer(0) operator(&&) ident(n1) operator(==) integer(0)operator(\)) operator({) - ident(n1) operator(=) ident(errno)operator(;) - operator(}) - ident(fptr)operator(->)ident(f) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(n1) operator(==) ident(EBADF) operator(&&) ident(f1) operator(==) ident(f2)operator(\)) operator({) - ident(n1) operator(=) integer(0)operator(;) - operator(}) - operator(}) - reserved(if) operator((!)ident(noraise) operator(&&) operator(()ident(n1) operator(||) ident(n2)operator(\)\)) operator({) - ident(errno) operator(=) operator(()ident(n1) operator(?) ident(n1) operator(:) ident(n2)operator(\);) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(rb_io_fptr_cleanup)operator(()ident(fptr)operator(,) ident(noraise)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(noraise)operator(;) -operator({) - reserved(if) operator(()ident(fptr)operator(->)ident(finalize)operator(\)) operator({) - operator((*)ident(fptr)operator(->)ident(finalize)operator(\)()ident(fptr)operator(,) ident(noraise)operator(\);) - operator(}) - reserved(else) operator({) - ident(fptr_finalize)operator(()ident(fptr)operator(,) ident(noraise)operator(\);) - operator(}) -operator(}) - -directive(void) -ident(rb_io_fptr_finalize)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - reserved(if) operator((!)ident(fptr)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(fptr)operator(->)ident(path)operator(\)) operator({) - ident(free)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - reserved(if) operator((!)ident(fptr)operator(->)ident(f) operator(&&) operator(!)ident(fptr)operator(->)ident(f2)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\)) operator(<) integer(3)operator(\)) reserved(return)operator(;) - - ident(rb_io_fptr_cleanup)operator(()ident(fptr)operator(,) ident(Qtrue)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_io_close)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(fd)operator(,) ident(fd2)operator(;) - - ident(fptr) operator(=) ident(RFILE)operator(()ident(io)operator(\)->)ident(fptr)operator(;) - reserved(if) operator((!)ident(fptr)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(fptr)operator(->)ident(f2)operator(\)) operator({) - ident(fd2) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\);) - operator(}) - reserved(else) operator({) - reserved(if) operator((!)ident(fptr)operator(->)ident(f)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(fd2) operator(=) operator(-)integer(1)operator(;) - operator(}) - - ident(fd) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\);) - ident(rb_io_fptr_cleanup)operator(()ident(fptr)operator(,) ident(Qfalse)operator(\);) - ident(rb_thread_fd_close)operator(()ident(fd)operator(\);) - reserved(if) operator(()ident(fd2) operator(>=) integer(0)operator(\)) ident(rb_thread_fd_close)operator(()ident(fd2)operator(\);) - - reserved(if) operator(()ident(fptr)operator(->)ident(pid)operator(\)) operator({) - ident(rb_syswait)operator(()ident(fptr)operator(->)ident(pid)operator(\);) - ident(fptr)operator(->)ident(pid) operator(=) integer(0)operator(;) - operator(}) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.close => nil - * - * Closes ios and flushes any pending writes to the operating - * system. The stream is unavailable for any further data operations; - * an IOError is raised if such an attempt is made. I/O - * streams are automatically closed when they are claimed by the - * garbage collector. - * - * If ios is opened by IO.popen, - * close sets $?. - */) - -directive(static) ident(VALUE) -ident(rb_io_close_m)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4) operator(&&) operator(!)ident(OBJ_TAINTED)operator(()ident(io)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - ident(rb_io_check_closed)operator(()ident(RFILE)operator(()ident(io)operator(\)->)ident(fptr)operator(\);) - ident(rb_io_close)operator(()ident(io)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(io_call_close)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(io)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(io_close)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - reserved(return) ident(rb_rescue)operator(()ident(io_call_close)operator(,) ident(io)operator(,) integer(0)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.closed? => true or false - * - * Returns true if ios is completely closed (for - * duplex streams, both reader and writer\), false - * otherwise. - * - * f = File.new("testfile"\) - * f.close #=> nil - * f.closed? #=> true - * f = IO.popen("/bin/sh","r+"\) - * f.close_write #=> nil - * f.closed? #=> false - * f.close_read #=> nil - * f.closed? #=> true - */) - -directive(static) ident(VALUE) -ident(rb_io_closed)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(fptr) operator(=) ident(RFILE)operator(()ident(io)operator(\)->)ident(fptr)operator(;) - ident(rb_io_check_initialized)operator(()ident(fptr)operator(\);) - reserved(return) operator(()ident(fptr)operator(->)ident(f) operator(||) ident(fptr)operator(->)ident(f2)operator(\)?)ident(Qfalse)operator(:)ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.close_read => nil - * - * Closes the read end of a duplex I/O stream (i.e., one that contains - * both a read and a write stream, such as a pipe\). Will raise an - * IOError if the stream is not duplexed. - * - * f = IO.popen("/bin/sh","r+"\) - * f.close_read - * f.readlines - * - * produces: - * - * prog.rb:3:in `readlines': not opened for reading (IOError\) - * from prog.rb:3 - */) - -directive(static) ident(VALUE) -ident(rb_io_close_read)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(n)operator(;) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4) operator(&&) operator(!)ident(OBJ_TAINTED)operator(()ident(io)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(fptr)operator(->)ident(f2) operator(==) integer(0) operator(&&) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WRITABLE)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(fptr)operator(->)ident(f2) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(rb_io_close)operator(()ident(io)operator(\);) - operator(}) - ident(n) operator(=) ident(fclose)operator(()ident(fptr)operator(->)ident(f)operator(\);) - ident(fptr)operator(->)ident(mode) operator(&=) operator(~)ident(FMODE_READABLE)operator(;) - ident(fptr)operator(->)ident(f) operator(=) ident(fptr)operator(->)ident(f2)operator(;) - ident(fptr)operator(->)ident(f2) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(n) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.close_write => nil - * - * Closes the write end of a duplex I/O stream (i.e., one that contains - * both a read and a write stream, such as a pipe\). Will raise an - * IOError if the stream is not duplexed. - * - * f = IO.popen("/bin/sh","r+"\) - * f.close_write - * f.print "nowhere" - * - * produces: - * - * prog.rb:3:in `write': not opened for writing (IOError\) - * from prog.rb:3:in `print' - * from prog.rb:3 - */) - -directive(static) ident(VALUE) -ident(rb_io_close_write)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(n)operator(;) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4) operator(&&) operator(!)ident(OBJ_TAINTED)operator(()ident(io)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(fptr)operator(->)ident(f2) operator(==) integer(0) operator(&&) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_READABLE)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(fptr)operator(->)ident(f2) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(rb_io_close)operator(()ident(io)operator(\);) - operator(}) - ident(n) operator(=) ident(fclose)operator(()ident(fptr)operator(->)ident(f2)operator(\);) - ident(fptr)operator(->)ident(f2) operator(=) integer(0)operator(;) - ident(fptr)operator(->)ident(mode) operator(&=) operator(~)ident(FMODE_WRITABLE)operator(;) - reserved(if) operator(()ident(n) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.sysseek(offset, whence=SEEK_SET\) => integer - * - * Seeks to a given offset in the stream according to the value - * of whence (see IO#seek for values of - * whence\). Returns the new offset into the file. - * - * f = File.new("testfile"\) - * f.sysseek(-13, IO::SEEK_END\) #=> 53 - * f.sysread(10\) #=> "And so on." - */) - -directive(static) ident(VALUE) -ident(rb_io_sysseek)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(offset)operator(,) ident(ptrname)operator(;) - pre_type(int) ident(whence) operator(=) ident(SEEK_SET)operator(;) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(off_t) ident(pos)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(offset)operator(,) operator(&)ident(ptrname)operator(\)) operator(==) integer(2)operator(\)) operator({) - ident(whence) operator(=) ident(NUM2INT)operator(()ident(ptrname)operator(\);) - operator(}) - ident(pos) operator(=) ident(NUM2OFFT)operator(()ident(offset)operator(\);) - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - reserved(if) operator((()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_READABLE)operator(\)) operator(&&) ident(READ_DATA_BUFFERED)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator((()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WRITABLE)operator(\)) operator(&&) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WBUF)operator(\)\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - ident(pos) operator(=) ident(lseek)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(pos)operator(,) ident(whence)operator(\);) - reserved(if) operator(()ident(pos) operator(==) operator(-)integer(1)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - ident(clearerr)operator(()ident(fptr)operator(->)ident(f)operator(\);) - - reserved(return) ident(OFFT2NUM)operator(()ident(pos)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.syswrite(string\) => integer - * - * Writes the given string to ios using a low-level write. - * Returns the number of bytes written. Do not mix with other methods - * that write to ios or you may get unpredictable results. - * Raises SystemCallError on error. - * - * f = File.new("out", "w"\) - * f.syswrite("ABCDEF"\) #=> 6 - */) - -directive(static) ident(VALUE) -ident(rb_io_syswrite)operator(()ident(io)operator(,) ident(str)operator(\)) - ident(VALUE) ident(io)operator(,) ident(str)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - ident(FILE) operator(*)ident(f)operator(;) - pre_type(long) ident(n)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(str)operator(\)) operator(!=) ident(T_STRING)operator(\)) - ident(str) operator(=) ident(rb_obj_as_string)operator(()ident(str)operator(\);) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_writable)operator(()ident(fptr)operator(\);) - ident(f) operator(=) ident(GetWriteFile)operator(()ident(fptr)operator(\);) - - reserved(if) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WBUF)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - reserved(if) operator((!)ident(rb_thread_fd_writable)operator(()ident(fileno)operator(()ident(f)operator(\)\)\)) operator({) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) - operator(}) - ident(TRAP_BEG)operator(;) - ident(n) operator(=) ident(write)operator(()ident(fileno)operator(()ident(f)operator(\),) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) - ident(TRAP_END)operator(;) - - reserved(if) operator(()ident(n) operator(==) operator(-)integer(1)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - - reserved(return) ident(LONG2FIX)operator(()ident(n)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.sysread(integer \) => string - * - * Reads integer bytes from ios using a low-level - * read and returns them as a string. Do not mix with other methods - * that read from ios or you may get unpredictable results. - * Raises SystemCallError on error and - * EOFError at end of file. - * - * f = File.new("testfile"\) - * f.sysread(16\) #=> "This is line one" - */) - -directive(static) ident(VALUE) -ident(rb_io_sysread)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(len)operator(,) ident(str)operator(;) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(long) ident(n)operator(,) ident(ilen)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(len)operator(,) operator(&)ident(str)operator(\);) - ident(ilen) operator(=) ident(NUM2LONG)operator(()ident(len)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(ilen)operator(\);) - operator(}) - reserved(else) operator({) - ident(StringValue)operator(()ident(str)operator(\);) - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(rb_str_resize)operator(()ident(str)operator(,) ident(ilen)operator(\);) - operator(}) - reserved(if) operator(()ident(ilen) operator(==) integer(0)operator(\)) reserved(return) ident(str)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(rb_io_check_readable)operator(()ident(fptr)operator(\);) - - reserved(if) operator(()ident(READ_DATA_BUFFERED)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eIOError)operator(,) stringoperator(\);) - operator(}) - ident(rb_str_locktmp)operator(()ident(str)operator(\);) - - ident(n) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\);) - ident(rb_thread_wait_fd)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\)\);) - ident(rb_io_check_closed)operator(()ident(fptr)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(!=) ident(ilen)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - ident(TRAP_BEG)operator(;) - ident(n) operator(=) ident(read)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(ilen)operator(\);) - ident(TRAP_END)operator(;) - - ident(rb_str_unlocktmp)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(n) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - ident(rb_str_resize)operator(()ident(str)operator(,) ident(n)operator(\);) - reserved(if) operator(()ident(n) operator(==) integer(0) operator(&&) ident(ilen) operator(>) integer(0)operator(\)) operator({) - ident(rb_eof_error)operator((\);) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(n)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(n)operator(]) operator(=) char('\\0')operator(;) - ident(OBJ_TAINT)operator(()ident(str)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.binmode => ios - * - * Puts ios into binary mode. This is useful only in - * MS-DOS/Windows environments. Once a stream is in binary mode, it - * cannot be reset to nonbinary mode. - */) - -ident(VALUE) -ident(rb_io_binmode)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(_WIN32)operator(\)) operator(||) ident(defined)operator(()ident(DJGPP)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN__)operator(\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__EMX__)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) -preprocessor(#ifdef) ident(__human68k__) - reserved(if) operator(()ident(fptr)operator(->)ident(f)operator(\)) - ident(fmode)operator(()ident(fptr)operator(->)ident(f)operator(,) ident(_IOBIN)operator(\);) - reserved(if) operator(()ident(fptr)operator(->)ident(f2)operator(\)) - ident(fmode)operator(()ident(fptr)operator(->)ident(f2)operator(,) ident(_IOBIN)operator(\);) -preprocessor(#else) - reserved(if) operator(()ident(fptr)operator(->)ident(f) operator(&&) ident(setmode)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(O_BINARY)operator(\)) operator(==) operator(-)integer(1)operator(\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - reserved(if) operator(()ident(fptr)operator(->)ident(f2) operator(&&) ident(setmode)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\),) ident(O_BINARY)operator(\)) operator(==) operator(-)integer(1)operator(\)) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) -preprocessor(#endif) - - ident(fptr)operator(->)ident(mode) operator(|=) ident(FMODE_BINMODE)operator(;) -preprocessor(#endif) - reserved(return) ident(io)operator(;) -operator(}) - -pre_type(char)operator(*) -ident(rb_io_flags_mode)operator(()ident(flags)operator(\)) - pre_type(int) ident(flags)operator(;) -operator({) -preprocessor(#ifdef) ident(O_BINARY) -preprocessor(# define) ident(MODE_BINMODE)operator(()ident(a)operator(,)ident(b)operator(\)) operator((()ident(flags) operator(&) ident(FMODE_BINMODE)operator(\)) operator(?) operator(()ident(b)operator(\)) operator(:) operator(()ident(a)operator(\)\)) -preprocessor(#else) -preprocessor(# define) ident(MODE_BINMODE)operator(()ident(a)operator(,)ident(b)operator(\)) operator(()ident(a)operator(\)) -preprocessor(#endif) - reserved(if) operator(()ident(flags) operator(&) ident(FMODE_APPEND)operator(\)) operator({) - reserved(if) operator((()ident(flags) operator(&) ident(FMODE_READWRITE)operator(\)) operator(==) ident(FMODE_READWRITE)operator(\)) operator({) - reserved(return) ident(MODE_BINMODE)operator(()stringoperator(,) stringoperator(\);) - operator(}) - reserved(return) ident(MODE_BINMODE)operator(()stringoperator(,) stringoperator(\);) - operator(}) - reserved(switch) operator(()ident(flags) operator(&) ident(FMODE_READWRITE)operator(\)) operator({) - reserved(case) ident(FMODE_READABLE)operator(:) - reserved(return) ident(MODE_BINMODE)operator(()stringoperator(,) stringoperator(\);) - reserved(case) ident(FMODE_WRITABLE)operator(:) - reserved(return) ident(MODE_BINMODE)operator(()stringoperator(,) stringoperator(\);) - reserved(case) ident(FMODE_READWRITE)operator(:) - reserved(if) operator(()ident(flags) operator(&) ident(FMODE_CREATE)operator(\)) operator({) - reserved(return) ident(MODE_BINMODE)operator(()stringoperator(,) stringoperator(\);) - operator(}) - reserved(return) ident(MODE_BINMODE)operator(()stringoperator(,) stringoperator(\);) - operator(}) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(flags)operator(\);) - reserved(return) pre_constant(NULL)operator(;) comment(/* not reached */) -operator(}) - -pre_type(int) -ident(rb_io_mode_flags)operator(()ident(mode)operator(\)) - directive(const) pre_type(char) operator(*)ident(mode)operator(;) -operator({) - pre_type(int) ident(flags) operator(=) integer(0)operator(;) - directive(const) pre_type(char) operator(*)ident(m) operator(=) ident(mode)operator(;) - - reserved(switch) operator((*)ident(m)operator(++\)) operator({) - reserved(case) char('r')operator(:) - ident(flags) operator(|=) ident(FMODE_READABLE)operator(;) - reserved(break)operator(;) - reserved(case) char('w')operator(:) - ident(flags) operator(|=) ident(FMODE_WRITABLE) operator(|) ident(FMODE_CREATE)operator(;) - reserved(break)operator(;) - reserved(case) char('a')operator(:) - ident(flags) operator(|=) ident(FMODE_WRITABLE) operator(|) ident(FMODE_APPEND) operator(|) ident(FMODE_CREATE)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - label(error:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(mode)operator(\);) - operator(}) - - reserved(while) operator((*)ident(m)operator(\)) operator({) - reserved(switch) operator((*)ident(m)operator(++\)) operator({) - reserved(case) char('b')operator(:) - ident(flags) operator(|=) ident(FMODE_BINMODE)operator(;) - reserved(break)operator(;) - reserved(case) char('+')operator(:) - ident(flags) operator(|=) ident(FMODE_READWRITE)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(goto) ident(error)operator(;) - operator(}) - operator(}) - - reserved(return) ident(flags)operator(;) -operator(}) - -pre_type(int) -ident(rb_io_modenum_flags)operator(()ident(mode)operator(\)) - pre_type(int) ident(mode)operator(;) -operator({) - pre_type(int) ident(flags) operator(=) integer(0)operator(;) - - reserved(switch) operator(()ident(mode) operator(&) operator(()ident(O_RDONLY)operator(|)ident(O_WRONLY)operator(|)ident(O_RDWR)operator(\)\)) operator({) - reserved(case) ident(O_RDONLY)operator(:) - ident(flags) operator(=) ident(FMODE_READABLE)operator(;) - reserved(break)operator(;) - reserved(case) ident(O_WRONLY)operator(:) - ident(flags) operator(=) ident(FMODE_WRITABLE)operator(;) - reserved(break)operator(;) - reserved(case) ident(O_RDWR)operator(:) - ident(flags) operator(=) ident(FMODE_READWRITE)operator(;) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(()ident(mode) operator(&) ident(O_APPEND)operator(\)) operator({) - ident(flags) operator(|=) ident(FMODE_APPEND)operator(;) - operator(}) - reserved(if) operator(()ident(mode) operator(&) ident(O_CREAT)operator(\)) operator({) - ident(flags) operator(|=) ident(FMODE_CREATE)operator(;) - operator(}) -preprocessor(#ifdef) ident(O_BINARY) - reserved(if) operator(()ident(mode) operator(&) ident(O_BINARY)operator(\)) operator({) - ident(flags) operator(|=) ident(FMODE_BINMODE)operator(;) - operator(}) -preprocessor(#endif) - - reserved(return) ident(flags)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(rb_io_mode_modenum)operator(()ident(mode)operator(\)) - directive(const) pre_type(char) operator(*)ident(mode)operator(;) -operator({) - pre_type(int) ident(flags) operator(=) integer(0)operator(;) - directive(const) pre_type(char) operator(*)ident(m) operator(=) ident(mode)operator(;) - - reserved(switch) operator((*)ident(m)operator(++\)) operator({) - reserved(case) char('r')operator(:) - ident(flags) operator(|=) ident(O_RDONLY)operator(;) - reserved(break)operator(;) - reserved(case) char('w')operator(:) - ident(flags) operator(|=) ident(O_WRONLY) operator(|) ident(O_CREAT) operator(|) ident(O_TRUNC)operator(;) - reserved(break)operator(;) - reserved(case) char('a')operator(:) - ident(flags) operator(|=) ident(O_WRONLY) operator(|) ident(O_CREAT) operator(|) ident(O_APPEND)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - label(error:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(mode)operator(\);) - operator(}) - - reserved(while) operator((*)ident(m)operator(\)) operator({) - reserved(switch) operator((*)ident(m)operator(++\)) operator({) - reserved(case) char('b')operator(:) -preprocessor(#ifdef) ident(O_BINARY) - ident(flags) operator(|=) ident(O_BINARY)operator(;) -preprocessor(#endif) - reserved(break)operator(;) - reserved(case) char('+')operator(:) - ident(flags) operator(=) operator(()ident(flags) operator(&) operator(~)ident(O_ACCMODE)operator(\)) operator(|) ident(O_RDWR)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(goto) ident(error)operator(;) - operator(}) - operator(}) - - reserved(return) ident(flags)operator(;) -operator(}) - -preprocessor(#define) ident(MODENUM_MAX) integer(4) - -directive(static) pre_type(char)operator(*) -ident(rb_io_modenum_mode)operator(()ident(flags)operator(\)) - pre_type(int) ident(flags)operator(;) -operator({) -preprocessor(#ifdef) ident(O_BINARY) -preprocessor(# define) ident(MODE_BINARY)operator(()ident(a)operator(,)ident(b)operator(\)) operator((()ident(flags) operator(&) ident(O_BINARY)operator(\)) operator(?) operator(()ident(b)operator(\)) operator(:) operator(()ident(a)operator(\)\)) -preprocessor(#else) -preprocessor(# define) ident(MODE_BINARY)operator(()ident(a)operator(,)ident(b)operator(\)) operator(()ident(a)operator(\)) -preprocessor(#endif) - reserved(if) operator(()ident(flags) operator(&) ident(O_APPEND)operator(\)) operator({) - reserved(if) operator((()ident(flags) operator(&) ident(O_RDWR)operator(\)) operator(==) ident(O_RDWR)operator(\)) operator({) - reserved(return) ident(MODE_BINARY)operator(()stringoperator(,) stringoperator(\);) - operator(}) - reserved(return) ident(MODE_BINARY)operator(()stringoperator(,) stringoperator(\);) - operator(}) - reserved(switch) operator(()ident(flags) operator(&) operator(()ident(O_RDONLY)operator(|)ident(O_WRONLY)operator(|)ident(O_RDWR)operator(\)\)) operator({) - reserved(case) ident(O_RDONLY)operator(:) - reserved(return) ident(MODE_BINARY)operator(()stringoperator(,) stringoperator(\);) - reserved(case) ident(O_WRONLY)operator(:) - reserved(return) ident(MODE_BINARY)operator(()stringoperator(,) stringoperator(\);) - reserved(case) ident(O_RDWR)operator(:) - reserved(return) ident(MODE_BINARY)operator(()stringoperator(,) stringoperator(\);) - operator(}) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(flags)operator(\);) - reserved(return) pre_constant(NULL)operator(;) comment(/* not reached */) -operator(}) - -directive(static) pre_type(int) -ident(rb_sysopen)operator(()ident(fname)operator(,) ident(flags)operator(,) ident(mode)operator(\)) - pre_type(char) operator(*)ident(fname)operator(;) - pre_type(int) ident(flags)operator(;) - pre_type(unsigned) pre_type(int) ident(mode)operator(;) -operator({) - pre_type(int) ident(fd)operator(;) - - ident(fd) operator(=) ident(open)operator(()ident(fname)operator(,) ident(flags)operator(,) ident(mode)operator(\);) - reserved(if) operator(()ident(fd) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(errno) operator(==) ident(EMFILE) operator(||) ident(errno) operator(==) ident(ENFILE)operator(\)) operator({) - ident(rb_gc)operator((\);) - ident(fd) operator(=) ident(open)operator(()ident(fname)operator(,) ident(flags)operator(,) ident(mode)operator(\);) - operator(}) - reserved(if) operator(()ident(fd) operator(<) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fname)operator(\);) - operator(}) - operator(}) - reserved(return) ident(fd)operator(;) -operator(}) - -ident(FILE) operator(*) -ident(rb_fopen)operator(()ident(fname)operator(,) ident(mode)operator(\)) - directive(const) pre_type(char) operator(*)ident(fname)operator(;) - directive(const) pre_type(char) operator(*)ident(mode)operator(;) -operator({) - ident(FILE) operator(*)ident(file)operator(;) - - ident(file) operator(=) ident(fopen)operator(()ident(fname)operator(,) ident(mode)operator(\);) - reserved(if) operator((!)ident(file)operator(\)) operator({) - reserved(if) operator(()ident(errno) operator(==) ident(EMFILE) operator(||) ident(errno) operator(==) ident(ENFILE)operator(\)) operator({) - ident(rb_gc)operator((\);) - ident(file) operator(=) ident(fopen)operator(()ident(fname)operator(,) ident(mode)operator(\);) - operator(}) - reserved(if) operator((!)ident(file)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fname)operator(\);) - operator(}) - operator(}) -preprocessor(#ifdef) ident(USE_SETVBUF) - reserved(if) operator(()ident(setvbuf)operator(()ident(file)operator(,) pre_constant(NULL)operator(,) ident(_IOFBF)operator(,) integer(0)operator(\)) operator(!=) integer(0)operator(\)) - ident(rb_warn)operator(()stringoperator(,) ident(fname)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(__human68k__) - ident(fmode)operator(()ident(file)operator(,) ident(_IOTEXT)operator(\);) -preprocessor(#endif) - reserved(return) ident(file)operator(;) -operator(}) - -ident(FILE) operator(*) -ident(rb_fdopen)operator(()ident(fd)operator(,) ident(mode)operator(\)) - pre_type(int) ident(fd)operator(;) - directive(const) pre_type(char) operator(*)ident(mode)operator(;) -operator({) - ident(FILE) operator(*)ident(file)operator(;) - -preprocessor(#if) ident(defined)operator(()ident(sun)operator(\)) - ident(errno) operator(=) integer(0)operator(;) -preprocessor(#endif) - ident(file) operator(=) ident(fdopen)operator(()ident(fd)operator(,) ident(mode)operator(\);) - reserved(if) operator((!)ident(file)operator(\)) operator({) -preprocessor(#if) ident(defined)operator(()ident(sun)operator(\)) - reserved(if) operator(()ident(errno) operator(==) integer(0) operator(||) ident(errno) operator(==) ident(EMFILE) operator(||) ident(errno) operator(==) ident(ENFILE)operator(\)) operator({) -preprocessor(#else) - reserved(if) operator(()ident(errno) operator(==) ident(EMFILE) operator(||) ident(errno) operator(==) ident(ENFILE)operator(\)) operator({) -preprocessor(#endif) - ident(rb_gc)operator((\);) -preprocessor(#if) ident(defined)operator(()ident(sun)operator(\)) - ident(errno) operator(=) integer(0)operator(;) -preprocessor(#endif) - ident(file) operator(=) ident(fdopen)operator(()ident(fd)operator(,) ident(mode)operator(\);) - operator(}) - reserved(if) operator((!)ident(file)operator(\)) operator({) -preprocessor(#ifdef) ident(_WIN32) - reserved(if) operator(()ident(errno) operator(==) integer(0)operator(\)) ident(errno) operator(=) ident(EINVAL)operator(;) -preprocessor(#endif) -preprocessor(#if) ident(defined)operator(()ident(sun)operator(\)) - reserved(if) operator(()ident(errno) operator(==) integer(0)operator(\)) ident(errno) operator(=) ident(EMFILE)operator(;) -preprocessor(#endif) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - operator(}) - -preprocessor(#ifdef) ident(USE_SETVBUF) - reserved(if) operator(()ident(setvbuf)operator(()ident(file)operator(,) pre_constant(NULL)operator(,) ident(_IOFBF)operator(,) integer(0)operator(\)) operator(!=) integer(0)operator(\)) - ident(rb_warn)operator(()stringoperator(,) ident(fd)operator(\);) -preprocessor(#endif) - reserved(return) ident(file)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_file_open_internal)operator(()ident(io)operator(,) ident(fname)operator(,) ident(mode)operator(\)) - ident(VALUE) ident(io)operator(;) - directive(const) pre_type(char) operator(*)ident(fname)operator(,) operator(*)ident(mode)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(MakeOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - - ident(fptr)operator(->)ident(mode) operator(=) ident(rb_io_mode_flags)operator(()ident(mode)operator(\);) - ident(fptr)operator(->)ident(path) operator(=) ident(strdup)operator(()ident(fname)operator(\);) - ident(fptr)operator(->)ident(f) operator(=) ident(rb_fopen)operator(()ident(fptr)operator(->)ident(path)operator(,) ident(rb_io_flags_mode)operator(()ident(fptr)operator(->)ident(mode)operator(\)\);) - - reserved(return) ident(io)operator(;) -operator(}) - -ident(VALUE) -ident(rb_file_open)operator(()ident(fname)operator(,) ident(mode)operator(\)) - directive(const) pre_type(char) operator(*)ident(fname)operator(,) operator(*)ident(mode)operator(;) -operator({) - reserved(return) ident(rb_file_open_internal)operator(()ident(io_alloc)operator(()ident(rb_cFile)operator(\),) ident(fname)operator(,) ident(mode)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_file_sysopen_internal)operator(()ident(io)operator(,) ident(fname)operator(,) ident(flags)operator(,) ident(mode)operator(\)) - ident(VALUE) ident(io)operator(;) - pre_type(char) operator(*)ident(fname)operator(;) - pre_type(int) ident(flags)operator(,) ident(mode)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(fd)operator(;) - pre_type(char) operator(*)ident(m)operator(;) - - ident(MakeOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - - ident(fptr)operator(->)ident(path) operator(=) ident(strdup)operator(()ident(fname)operator(\);) - ident(m) operator(=) ident(rb_io_modenum_mode)operator(()ident(flags)operator(\);) - ident(fptr)operator(->)ident(mode) operator(=) ident(rb_io_modenum_flags)operator(()ident(flags)operator(\);) - ident(fd) operator(=) ident(rb_sysopen)operator(()ident(fptr)operator(->)ident(path)operator(,) ident(flags)operator(,) ident(mode)operator(\);) - ident(fptr)operator(->)ident(f) operator(=) ident(rb_fdopen)operator(()ident(fd)operator(,) ident(m)operator(\);) - - reserved(return) ident(io)operator(;) -operator(}) - -ident(VALUE) -ident(rb_file_sysopen)operator(()ident(fname)operator(,) ident(flags)operator(,) ident(mode)operator(\)) - directive(const) pre_type(char) operator(*)ident(fname)operator(;) - pre_type(int) ident(flags)operator(,) ident(mode)operator(;) -operator({) - reserved(return) ident(rb_file_sysopen_internal)operator(()ident(io_alloc)operator(()ident(rb_cFile)operator(\),) ident(fname)operator(,) ident(flags)operator(,) ident(mode)operator(\);) -operator(}) - -preprocessor(#if) ident(defined) operator(()ident(_WIN32)operator(\)) operator(||) ident(defined)operator(()ident(DJGPP)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN__)operator(\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__VMS)operator(\)) -directive(static) reserved(struct) ident(pipe_list) operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - reserved(struct) ident(pipe_list) operator(*)ident(next)operator(;) -operator(}) operator(*)ident(pipe_list)operator(;) - -directive(static) directive(void) -ident(pipe_add_fptr)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - reserved(struct) ident(pipe_list) operator(*)ident(list)operator(;) - - ident(list) operator(=) ident(ALLOC)operator(()reserved(struct) ident(pipe_list)operator(\);) - ident(list)operator(->)ident(fptr) operator(=) ident(fptr)operator(;) - ident(list)operator(->)ident(next) operator(=) ident(pipe_list)operator(;) - ident(pipe_list) operator(=) ident(list)operator(;) -operator(}) - -directive(static) directive(void) -ident(pipe_del_fptr)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - reserved(struct) ident(pipe_list) operator(*)ident(list) operator(=) ident(pipe_list)operator(;) - reserved(struct) ident(pipe_list) operator(*)ident(tmp)operator(;) - - reserved(if) operator(()ident(list)operator(->)ident(fptr) operator(==) ident(fptr)operator(\)) operator({) - ident(pipe_list) operator(=) ident(list)operator(->)ident(next)operator(;) - ident(free)operator(()ident(list)operator(\);) - reserved(return)operator(;) - operator(}) - - reserved(while) operator(()ident(list)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator(()ident(list)operator(->)ident(next)operator(->)ident(fptr) operator(==) ident(fptr)operator(\)) operator({) - ident(tmp) operator(=) ident(list)operator(->)ident(next)operator(;) - ident(list)operator(->)ident(next) operator(=) ident(list)operator(->)ident(next)operator(->)ident(next)operator(;) - ident(free)operator(()ident(tmp)operator(\);) - reserved(return)operator(;) - operator(}) - ident(list) operator(=) ident(list)operator(->)ident(next)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(pipe_atexit) ident(_)operator((()directive(void)operator(\)\)) -operator({) - reserved(struct) ident(pipe_list) operator(*)ident(list) operator(=) ident(pipe_list)operator(;) - reserved(struct) ident(pipe_list) operator(*)ident(tmp)operator(;) - - reserved(while) operator(()ident(list)operator(\)) operator({) - ident(tmp) operator(=) ident(list)operator(->)ident(next)operator(;) - ident(rb_io_fptr_finalize)operator(()ident(list)operator(->)ident(fptr)operator(\);) - ident(list) operator(=) ident(tmp)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) ident(pipe_finalize) ident(_)operator((()ident(OpenFile) operator(*)ident(fptr)operator(,)pre_type(int)operator(\)\);) - -directive(static) directive(void) -ident(pipe_finalize)operator(()ident(fptr)operator(,) ident(noraise)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(noraise)operator(;) -operator({) -preprocessor(#if) operator(!)ident(defined) operator(()ident(__CYGWIN__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(_WIN32)operator(\)) - directive(extern) ident(VALUE) ident(rb_last_status)operator(;) - pre_type(int) ident(status)operator(;) - reserved(if) operator(()ident(fptr)operator(->)ident(f)operator(\)) operator({) - ident(status) operator(=) ident(pclose)operator(()ident(fptr)operator(->)ident(f)operator(\);) - operator(}) - reserved(if) operator(()ident(fptr)operator(->)ident(f2)operator(\)) operator({) - ident(status) operator(=) ident(pclose)operator(()ident(fptr)operator(->)ident(f2)operator(\);) - operator(}) - ident(fptr)operator(->)ident(f) operator(=) ident(fptr)operator(->)ident(f2) operator(=) integer(0)operator(;) -preprocessor(#if) ident(defined) ident(DJGPP) - ident(status) operator(<<=) integer(8)operator(;) -preprocessor(#endif) - ident(rb_last_status) operator(=) ident(INT2FIX)operator(()ident(status)operator(\);) -preprocessor(#else) - ident(fptr_finalize)operator(()ident(fptr)operator(,) ident(noraise)operator(\);) -preprocessor(#endif) - ident(pipe_del_fptr)operator(()ident(fptr)operator(\);) -operator(}) -preprocessor(#endif) - -directive(void) -ident(rb_io_synchronized)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - ident(fptr)operator(->)ident(mode) operator(|=) ident(FMODE_SYNC)operator(;) -operator(}) - -directive(void) -ident(rb_io_unbuffered)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - ident(rb_io_synchronized)operator(()ident(fptr)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(pipe_open)operator(()ident(VALUE) ident(pstr)operator(,) pre_type(char) operator(*)ident(pname)operator(,) pre_type(char) operator(*)ident(mode)operator(\);) - -directive(static) ident(VALUE) -ident(pipe_open)operator(()ident(pstr)operator(,) ident(pname)operator(,) ident(mode)operator(\)) - ident(VALUE) ident(pstr)operator(;) - pre_type(char) operator(*)ident(pname)operator(,) operator(*)ident(mode)operator(;) -operator({) - pre_type(int) ident(modef) operator(=) ident(rb_io_mode_flags)operator(()ident(mode)operator(\);) - ident(OpenFile) operator(*)ident(fptr)operator(;) -preprocessor(#if) ident(defined)operator(()ident(DJGPP)operator(\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__VMS)operator(\)) - ident(FILE) operator(*)ident(f)operator(;) -preprocessor(#else) - pre_type(int) ident(pid)operator(;) -preprocessor(#ifdef) ident(_WIN32) - ident(FILE) operator(*)ident(fpr)operator(,) operator(*)ident(fpw)operator(;) -preprocessor(#else) - pre_type(int) ident(pr)operator([)integer(2)operator(],) ident(pw)operator([)integer(2)operator(];) -preprocessor(#endif) -preprocessor(#endif) - directive(volatile) pre_type(int) ident(doexec)operator(;) - - reserved(if) operator((!)ident(pname)operator(\)) ident(pname) operator(=) ident(StringValueCStr)operator(()ident(pstr)operator(\);) - ident(doexec) operator(=) operator(()ident(strcmp)operator(()stringoperator(,) ident(pname)operator(\)) operator(!=) integer(0)operator(\);) - -preprocessor(#if) ident(defined)operator(()ident(DJGPP)operator(\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__VMS)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) - reserved(if) operator((!)ident(doexec)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eNotImpError)operator(,) - stringoperator(\);) - operator(}) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(DJGPP)operator(\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__VMS)operator(\)) - ident(f) operator(=) ident(popen)operator(()ident(pname)operator(,) ident(mode)operator(\);) - - reserved(if) operator((!)ident(f)operator(\)) ident(rb_sys_fail)operator(()ident(pname)operator(\);) - reserved(else) operator({) - ident(VALUE) ident(port) operator(=) ident(io_alloc)operator(()ident(rb_cIO)operator(\);) - - ident(MakeOpenFile)operator(()ident(port)operator(,) ident(fptr)operator(\);) - ident(fptr)operator(->)ident(finalize) operator(=) ident(pipe_finalize)operator(;) - ident(fptr)operator(->)ident(mode) operator(=) ident(modef)operator(;) - - ident(pipe_add_fptr)operator(()ident(fptr)operator(\);) - reserved(if) operator(()ident(modef) operator(&) ident(FMODE_READABLE)operator(\)) ident(fptr)operator(->)ident(f) operator(=) ident(f)operator(;) - reserved(if) operator(()ident(modef) operator(&) ident(FMODE_WRITABLE)operator(\)) operator({) - reserved(if) operator(()ident(fptr)operator(->)ident(f)operator(\)) ident(fptr)operator(->)ident(f2) operator(=) ident(f)operator(;) - reserved(else) ident(fptr)operator(->)ident(f) operator(=) ident(f)operator(;) - ident(rb_io_synchronized)operator(()ident(fptr)operator(\);) - operator(}) - reserved(return) operator(()ident(VALUE)operator(\))ident(port)operator(;) - operator(}) -preprocessor(#else) -preprocessor(#ifdef) ident(_WIN32) -label(retry:) - ident(pid) operator(=) ident(pipe_exec)operator(()ident(pname)operator(,) ident(rb_io_mode_modenum)operator(()ident(mode)operator(\),) operator(&)ident(fpr)operator(,) operator(&)ident(fpw)operator(\);) - reserved(if) operator(()ident(pid) operator(==) operator(-)integer(1)operator(\)) operator({) comment(/* exec failed */) - reserved(if) operator(()ident(errno) operator(==) ident(EAGAIN)operator(\)) operator({) - ident(rb_thread_sleep)operator(()integer(1)operator(\);) - reserved(goto) ident(retry)operator(;) - operator(}) - ident(rb_sys_fail)operator(()ident(pname)operator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(port) operator(=) ident(io_alloc)operator(()ident(rb_cIO)operator(\);) - - ident(MakeOpenFile)operator(()ident(port)operator(,) ident(fptr)operator(\);) - ident(fptr)operator(->)ident(mode) operator(=) ident(modef)operator(;) - ident(fptr)operator(->)ident(mode) operator(|=) ident(FMODE_SYNC)operator(;) - ident(fptr)operator(->)ident(pid) operator(=) ident(pid)operator(;) - - reserved(if) operator(()ident(modef) operator(&) ident(FMODE_READABLE)operator(\)) operator({) - ident(fptr)operator(->)ident(f) operator(=) ident(fpr)operator(;) - operator(}) - reserved(if) operator(()ident(modef) operator(&) ident(FMODE_WRITABLE)operator(\)) operator({) - reserved(if) operator(()ident(fptr)operator(->)ident(f)operator(\)) ident(fptr)operator(->)ident(f2) operator(=) ident(fpw)operator(;) - reserved(else) ident(fptr)operator(->)ident(f) operator(=) ident(fpw)operator(;) - operator(}) - ident(fptr)operator(->)ident(finalize) operator(=) ident(pipe_finalize)operator(;) - ident(pipe_add_fptr)operator(()ident(fptr)operator(\);) - reserved(return) operator(()ident(VALUE)operator(\))ident(port)operator(;) - operator(}) -preprocessor(#else) - reserved(if) operator(((()ident(modef) operator(&) ident(FMODE_READABLE)operator(\)) operator(&&) ident(pipe)operator(()ident(pr)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator(||) - operator((()ident(modef) operator(&) ident(FMODE_WRITABLE)operator(\)) operator(&&) ident(pipe)operator(()ident(pw)operator(\)) operator(==) operator(-)integer(1)operator(\)\)) - ident(rb_sys_fail)operator(()ident(pname)operator(\);) - - reserved(if) operator((!)ident(doexec)operator(\)) operator({) - ident(fflush)operator(()ident(stdin)operator(\);) comment(/* is it really needed? */) - ident(fflush)operator(()ident(stdout)operator(\);) - ident(fflush)operator(()ident(stderr)operator(\);) - operator(}) - - label(retry:) - reserved(switch) operator((()ident(pid) operator(=) ident(fork)operator((\)\)\)) operator({) - reserved(case) integer(0)operator(:) comment(/* child */) - reserved(if) operator(()ident(modef) operator(&) ident(FMODE_READABLE)operator(\)) operator({) - ident(close)operator(()ident(pr)operator([)integer(0)operator(]\);) - reserved(if) operator(()ident(pr)operator([)integer(1)operator(]) operator(!=) integer(1)operator(\)) operator({) - ident(dup2)operator(()ident(pr)operator([)integer(1)operator(],) integer(1)operator(\);) - ident(close)operator(()ident(pr)operator([)integer(1)operator(]\);) - operator(}) - operator(}) - reserved(if) operator(()ident(modef) operator(&) ident(FMODE_WRITABLE)operator(\)) operator({) - ident(close)operator(()ident(pw)operator([)integer(1)operator(]\);) - reserved(if) operator(()ident(pw)operator([)integer(0)operator(]) operator(!=) integer(0)operator(\)) operator({) - ident(dup2)operator(()ident(pw)operator([)integer(0)operator(],) integer(0)operator(\);) - ident(close)operator(()ident(pw)operator([)integer(0)operator(]\);) - operator(}) - operator(}) - - reserved(if) operator(()ident(doexec)operator(\)) operator({) - pre_type(int) ident(fd)operator(;) - - reserved(for) operator(()ident(fd) operator(=) integer(3)operator(;) ident(fd) operator(<) ident(NOFILE)operator(;) ident(fd)operator(++\)) - ident(close)operator(()ident(fd)operator(\);) - ident(rb_proc_exec)operator(()ident(pname)operator(\);) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(,) - ident(ruby_sourcefile)operator(,) ident(ruby_sourceline)operator(,) ident(pname)operator(\);) - ident(_exit)operator(()integer(127)operator(\);) - operator(}) - ident(rb_io_synchronized)operator(()ident(RFILE)operator(()ident(orig_stdout)operator(\)->)ident(fptr)operator(\);) - ident(rb_io_synchronized)operator(()ident(RFILE)operator(()ident(orig_stderr)operator(\)->)ident(fptr)operator(\);) - reserved(return) ident(Qnil)operator(;) - - reserved(case) operator(-)integer(1)operator(:) comment(/* fork failed */) - reserved(if) operator(()ident(errno) operator(==) ident(EAGAIN)operator(\)) operator({) - ident(rb_thread_sleep)operator(()integer(1)operator(\);) - reserved(goto) ident(retry)operator(;) - operator(}) - reserved(else) operator({) - pre_type(int) ident(e) operator(=) ident(errno)operator(;) - reserved(if) operator((()ident(modef) operator(&) ident(FMODE_READABLE)operator(\)\)) operator({) - ident(close)operator(()ident(pr)operator([)integer(0)operator(]\);) - ident(close)operator(()ident(pr)operator([)integer(1)operator(]\);) - operator(}) - reserved(if) operator((()ident(modef) operator(&) ident(FMODE_WRITABLE)operator(\)\)) operator({) - ident(close)operator(()ident(pw)operator([)integer(0)operator(]\);) - ident(close)operator(()ident(pw)operator([)integer(1)operator(]\);) - operator(}) - ident(errno) operator(=) ident(e)operator(;) - ident(rb_sys_fail)operator(()ident(pname)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(default)operator(:) comment(/* parent */) - reserved(if) operator(()ident(pid) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()ident(pname)operator(\);) - reserved(else) operator({) - ident(VALUE) ident(port) operator(=) ident(io_alloc)operator(()ident(rb_cIO)operator(\);) - - ident(MakeOpenFile)operator(()ident(port)operator(,) ident(fptr)operator(\);) - ident(fptr)operator(->)ident(mode) operator(=) ident(modef)operator(;) - ident(fptr)operator(->)ident(mode) operator(|=) ident(FMODE_SYNC)operator(;) - ident(fptr)operator(->)ident(pid) operator(=) ident(pid)operator(;) - - reserved(if) operator(()ident(modef) operator(&) ident(FMODE_READABLE)operator(\)) operator({) - ident(close)operator(()ident(pr)operator([)integer(1)operator(]\);) - ident(fptr)operator(->)ident(f) operator(=) ident(rb_fdopen)operator(()ident(pr)operator([)integer(0)operator(],) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(modef) operator(&) ident(FMODE_WRITABLE)operator(\)) operator({) - ident(FILE) operator(*)ident(f) operator(=) ident(rb_fdopen)operator(()ident(pw)operator([)integer(1)operator(],) stringoperator(\);) - - ident(close)operator(()ident(pw)operator([)integer(0)operator(]\);) - reserved(if) operator(()ident(fptr)operator(->)ident(f)operator(\)) ident(fptr)operator(->)ident(f2) operator(=) ident(f)operator(;) - reserved(else) ident(fptr)operator(->)ident(f) operator(=) ident(f)operator(;) - operator(}) -preprocessor(#if) ident(defined) operator(()ident(__CYGWIN__)operator(\)) - ident(fptr)operator(->)ident(finalize) operator(=) ident(pipe_finalize)operator(;) - ident(pipe_add_fptr)operator(()ident(fptr)operator(\);) -preprocessor(#endif) - reserved(return) ident(port)operator(;) - operator(}) - operator(}) -preprocessor(#endif) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * IO.popen(cmd_string, mode="r" \) => io - * IO.popen(cmd_string, mode="r" \) {|io| block } => obj - * - * Runs the specified command string as a subprocess; the subprocess's - * standard input and output will be connected to the returned - * IO object. If cmd_string starts with a - * ``-'', then a new instance of Ruby is started as the - * subprocess. The default mode for the new file object is ``r'', but - * mode may be set to any of the modes listed in the description - * for class IO. - * - * If a block is given, Ruby will run the command as a child connected - * to Ruby with a pipe. Ruby's end of the pipe will be passed as a - * parameter to the block. - * At the end of block, Ruby close the pipe and sets $?. - * In this case IO::popen returns - * the value of the block. - * - * If a block is given with a cmd_string of ``-'', - * the block will be run in two separate processes: once in the parent, - * and once in a child. The parent process will be passed the pipe - * object as a parameter to the block, the child version of the block - * will be passed nil, and the child's standard in and - * standard out will be connected to the parent through the pipe. Not - * available on all platforms. - * - * f = IO.popen("uname"\) - * p f.readlines - * puts "Parent is #{Process.pid}" - * IO.popen ("date"\) { |f| puts f.gets } - * IO.popen("-"\) {|f| $stderr.puts "#{Process.pid} is here, f is #{f}"} - * p $? - * - * produces: - * - * ["Linux\\n"] - * Parent is 26166 - * Wed Apr 9 08:53:52 CDT 2003 - * 26169 is here, f is - * 26166 is here, f is # - * # - */) - -directive(static) ident(VALUE) -ident(rb_io_s_popen)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - pre_type(char) operator(*)ident(mode)operator(;) - ident(VALUE) ident(pname)operator(,) ident(pmode)operator(,) ident(port)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(pname)operator(,) operator(&)ident(pmode)operator(\)) operator(==) integer(1)operator(\)) operator({) - ident(mode) operator(=) stringoperator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(FIXNUM_P)operator(()ident(pmode)operator(\)\)) operator({) - ident(mode) operator(=) ident(rb_io_modenum_mode)operator(()ident(FIX2INT)operator(()ident(pmode)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(mode) operator(=) ident(rb_io_flags_mode)operator(()ident(rb_io_mode_flags)operator(()ident(StringValueCStr)operator(()ident(pmode)operator(\)\)\);) - operator(}) - ident(SafeStringValue)operator(()ident(pname)operator(\);) - ident(port) operator(=) ident(pipe_open)operator(()ident(pname)operator(,) integer(0)operator(,) ident(mode)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(port)operator(\)\)) operator({) - comment(/* child */) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(rb_yield)operator(()ident(Qnil)operator(\);) - ident(fflush)operator(()ident(stdout)operator(\);) - ident(fflush)operator(()ident(stderr)operator(\);) - ident(_exit)operator(()integer(0)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) - operator(}) - ident(RBASIC)operator(()ident(port)operator(\)->)ident(klass) operator(=) ident(klass)operator(;) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - reserved(return) ident(rb_ensure)operator(()ident(rb_yield)operator(,) ident(port)operator(,) ident(io_close)operator(,) ident(port)operator(\);) - operator(}) - reserved(return) ident(port)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_open_file)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(fname)operator(,) ident(vmode)operator(,) ident(perm)operator(;) - pre_type(char) operator(*)ident(path)operator(,) operator(*)ident(mode)operator(;) - pre_type(int) ident(flags)operator(;) - pre_type(unsigned) pre_type(int) ident(fmode)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(fname)operator(,) operator(&)ident(vmode)operator(,) operator(&)ident(perm)operator(\);) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - - ident(path) operator(=) ident(StringValueCStr)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(vmode)operator(\)) operator(||) operator(!)ident(NIL_P)operator(()ident(perm)operator(\)\)) operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(vmode)operator(\)\)) operator({) - ident(flags) operator(=) ident(FIX2INT)operator(()ident(vmode)operator(\);) - operator(}) - reserved(else) operator({) - ident(SafeStringValue)operator(()ident(vmode)operator(\);) - ident(flags) operator(=) ident(rb_io_mode_modenum)operator(()ident(RSTRING)operator(()ident(vmode)operator(\)->)ident(ptr)operator(\);) - operator(}) - ident(fmode) operator(=) ident(NIL_P)operator(()ident(perm)operator(\)) operator(?) oct(0666) operator(:) ident(NUM2UINT)operator(()ident(perm)operator(\);) - - ident(rb_file_sysopen_internal)operator(()ident(io)operator(,) ident(path)operator(,) ident(flags)operator(,) ident(fmode)operator(\);) - operator(}) - reserved(else) operator({) - ident(mode) operator(=) ident(NIL_P)operator(()ident(vmode)operator(\)) operator(?) string operator(:) ident(StringValueCStr)operator(()ident(vmode)operator(\);) - ident(rb_file_open_internal)operator(()ident(io)operator(,) ident(path)operator(,) ident(mode)operator(\);) - operator(}) - reserved(return) ident(io)operator(;) -operator(}) - -comment(/* - * call-seq: - * IO.open(fd, mode_string="r" \) => io - * IO.open(fd, mode_string="r" \) {|io| block } => obj - * - * With no associated block, open is a synonym for - * IO::new. If the optional code block is given, it will - * be passed io as an argument, and the IO object will - * automatically be closed when the block terminates. In this instance, - * IO::open returns the value of the block. - * - */) - -directive(static) ident(VALUE) -ident(rb_io_s_open)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(io) operator(=) ident(rb_class_new_instance)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\);) - - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - reserved(return) ident(rb_ensure)operator(()ident(rb_yield)operator(,) ident(io)operator(,) ident(io_close)operator(,) ident(io)operator(\);) - operator(}) - - reserved(return) ident(io)operator(;) -operator(}) - -comment(/* - * call-seq: - * IO.sysopen(path, [mode, [perm]]\) => fixnum - * - * Opens the given path, returning the underlying file descriptor as a - * Fixnum. - * - * IO.sysopen("testfile"\) #=> 3 - * - */) - -directive(static) ident(VALUE) -ident(rb_io_s_sysopen)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(fname)operator(,) ident(vmode)operator(,) ident(perm)operator(;) - pre_type(int) ident(flags)operator(,) ident(fd)operator(;) - pre_type(unsigned) pre_type(int) ident(fmode)operator(;) - pre_type(char) operator(*)ident(path)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(fname)operator(,) operator(&)ident(vmode)operator(,) operator(&)ident(perm)operator(\);) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(vmode)operator(\)\)) ident(flags) operator(=) ident(O_RDONLY)operator(;) - reserved(else) reserved(if) operator(()ident(FIXNUM_P)operator(()ident(vmode)operator(\)\)) ident(flags) operator(=) ident(FIX2INT)operator(()ident(vmode)operator(\);) - reserved(else) operator({) - ident(SafeStringValue)operator(()ident(vmode)operator(\);) - ident(flags) operator(=) ident(rb_io_mode_modenum)operator(()ident(RSTRING)operator(()ident(vmode)operator(\)->)ident(ptr)operator(\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(perm)operator(\)\)) ident(fmode) operator(=) oct(0666)operator(;) - reserved(else) ident(fmode) operator(=) ident(NUM2UINT)operator(()ident(perm)operator(\);) - - ident(path) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(strlen)operator(()ident(RSTRING)operator(()ident(fname)operator(\)->)ident(ptr)operator(\)+)integer(1)operator(\);) - ident(strcpy)operator(()ident(path)operator(,) ident(RSTRING)operator(()ident(fname)operator(\)->)ident(ptr)operator(\);) - ident(fd) operator(=) ident(rb_sysopen)operator(()ident(path)operator(,) ident(flags)operator(,) ident(fmode)operator(\);) - reserved(return) ident(INT2NUM)operator(()ident(fd)operator(\);) -operator(}) - -comment(/* - * call-seq: - * open(path [, mode [, perm]] \) => io or nil - * open(path [, mode [, perm]] \) {|io| block } => obj - * - * Creates an IO object connected to the given stream, - * file, or subprocess. - * - * If path does not start with a pipe character - * (``|''\), treat it as the name of a file to open using - * the specified mode (defaulting to ``r''\). (See the table - * of valid modes on page 331.\) If a file is being created, its initial - * permissions may be set using the integer third parameter. - * - * If a block is specified, it will be invoked with the - * File object as a parameter, and the file will be - * automatically closed when the block terminates. The call - * returns the value of the block. - * - * If path starts with a pipe character, a subprocess is - * created, connected to the caller by a pair of pipes. The returned - * IO object may be used to write to the standard input - * and read from the standard output of this subprocess. If the command - * following the ``|'' is a single minus sign, Ruby forks, - * and this subprocess is connected to the parent. In the subprocess, - * the open call returns nil. If the command - * is not ``-'', the subprocess runs the command. If a - * block is associated with an open("|-"\) call, that block - * will be run twice---once in the parent and once in the child. The - * block parameter will be an IO object in the parent and - * nil in the child. The parent's IO object - * will be connected to the child's $stdin and - * $stdout. The subprocess will be terminated at the end - * of the block. - * - * open("testfile"\) do |f| - * print f.gets - * end - * - * produces: - * - * This is line one - * - * Open a subprocess and read its output: - * - * cmd = open("|date"\) - * print cmd.gets - * cmd.close - * - * produces: - * - * Wed Apr 9 08:56:31 CDT 2003 - * - * Open a subprocess running the same Ruby program: - * - * f = open("|-", "w+"\) - * if f == nil - * puts "in Child" - * exit - * else - * puts "Got: #{f.gets}" - * end - * - * produces: - * - * Got: in Child - * - * Open a subprocess using a block to receive the I/O object: - * - * open("|-"\) do |f| - * if f == nil - * puts "in Child" - * else - * puts "Got: #{f.gets}" - * end - * end - * - * produces: - * - * Got: in Child - */) - -directive(static) ident(VALUE) -ident(rb_f_open)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(if) operator(()ident(argc) operator(>=) integer(1)operator(\)) operator({) - pre_type(char) operator(*)ident(str) operator(=) ident(StringValuePtr)operator(()ident(argv)operator([)integer(0)operator(]\);) - - reserved(if) operator(()ident(str)operator([)integer(0)operator(]) operator(==) char('|')operator(\)) operator({) - ident(VALUE) ident(tmp) operator(=) ident(rb_str_new)operator(()ident(str)operator(+)integer(1)operator(,) ident(RSTRING)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(len)operator(-)integer(1)operator(\);) - ident(OBJ_INFECT)operator(()ident(tmp)operator(,) ident(argv)operator([)integer(0)operator(]\);) - ident(argv)operator([)integer(0)operator(]) operator(=) ident(tmp)operator(;) - reserved(return) ident(rb_io_s_popen)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(rb_cIO)operator(\);) - operator(}) - operator(}) - reserved(return) ident(rb_io_s_open)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(rb_cFile)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_io_open)operator(()ident(fname)operator(,) ident(mode)operator(\)) - pre_type(char) operator(*)ident(fname)operator(,) operator(*)ident(mode)operator(;) -operator({) - reserved(if) operator(()ident(fname)operator([)integer(0)operator(]) operator(==) char('|')operator(\)) operator({) - reserved(return) ident(pipe_open)operator(()integer(0)operator(,) ident(fname)operator(+)integer(1)operator(,) ident(mode)operator(\);) - operator(}) - reserved(else) operator({) - reserved(return) ident(rb_file_open)operator(()ident(fname)operator(,) ident(mode)operator(\);) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(rb_io_get_io)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - reserved(return) ident(rb_convert_type)operator(()ident(io)operator(,) ident(T_FILE)operator(,) stringoperator(,) stringoperator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_io_check_io)operator(()ident(io)operator(\)) - ident(VALUE) ident(io)operator(;) -operator({) - reserved(return) ident(rb_check_convert_type)operator(()ident(io)operator(,) ident(T_FILE)operator(,) stringoperator(,) stringoperator(\);) -operator(}) - -directive(static) pre_type(char)operator(*) -ident(rb_io_mode_string)operator(()ident(fptr)operator(\)) - ident(OpenFile) operator(*)ident(fptr)operator(;) -operator({) - reserved(switch) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_READWRITE)operator(\)) operator({) - reserved(case) ident(FMODE_READABLE)operator(:) - reserved(default)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(FMODE_WRITABLE)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(FMODE_READWRITE)operator(:) - reserved(return) stringoperator(;) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(io_reopen)operator(()ident(io)operator(,) ident(nfile)operator(\)) - ident(VALUE) ident(io)operator(,) ident(nfile)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(,) operator(*)ident(orig)operator(;) - pre_type(char) operator(*)ident(mode)operator(;) - pre_type(int) ident(fd)operator(,) ident(fd2)operator(;) - ident(off_t) ident(pos) operator(=) integer(0)operator(;) - - ident(nfile) operator(=) ident(rb_io_get_io)operator(()ident(nfile)operator(\);) - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4) operator(&&) operator((!)ident(OBJ_TAINTED)operator(()ident(io)operator(\)) operator(||) operator(!)ident(OBJ_TAINTED)operator(()ident(nfile)operator(\)\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(GetOpenFile)operator(()ident(nfile)operator(,) ident(orig)operator(\);) - - reserved(if) operator(()ident(fptr) operator(==) ident(orig)operator(\)) reserved(return) ident(io)operator(;) - reserved(if) operator(()ident(orig)operator(->)ident(mode) operator(&) ident(FMODE_READABLE)operator(\)) operator({) - ident(pos) operator(=) ident(io_tell)operator(()ident(orig)operator(\);) - operator(}) - reserved(if) operator(()ident(orig)operator(->)ident(f2)operator(\)) operator({) - ident(io_fflush)operator(()ident(orig)operator(->)ident(f2)operator(,) ident(orig)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(orig)operator(->)ident(mode) operator(&) ident(FMODE_WRITABLE)operator(\)) operator({) - ident(io_fflush)operator(()ident(orig)operator(->)ident(f)operator(,) ident(orig)operator(\);) - operator(}) - reserved(if) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_WRITABLE)operator(\)) operator({) - ident(io_fflush)operator(()ident(GetWriteFile)operator(()ident(fptr)operator(\),) ident(fptr)operator(\);) - operator(}) - - comment(/* copy OpenFile structure */) - ident(fptr)operator(->)ident(mode) operator(=) ident(orig)operator(->)ident(mode)operator(;) - ident(fptr)operator(->)ident(pid) operator(=) ident(orig)operator(->)ident(pid)operator(;) - ident(fptr)operator(->)ident(lineno) operator(=) ident(orig)operator(->)ident(lineno)operator(;) - reserved(if) operator(()ident(fptr)operator(->)ident(path)operator(\)) ident(free)operator(()ident(fptr)operator(->)ident(path)operator(\);) - reserved(if) operator(()ident(orig)operator(->)ident(path)operator(\)) ident(fptr)operator(->)ident(path) operator(=) ident(strdup)operator(()ident(orig)operator(->)ident(path)operator(\);) - reserved(else) ident(fptr)operator(->)ident(path) operator(=) integer(0)operator(;) - ident(fptr)operator(->)ident(finalize) operator(=) ident(orig)operator(->)ident(finalize)operator(;) - - ident(mode) operator(=) ident(rb_io_mode_string)operator(()ident(fptr)operator(\);) - ident(fd) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\);) - ident(fd2) operator(=) ident(fileno)operator(()ident(orig)operator(->)ident(f)operator(\);) - reserved(if) operator(()ident(fd) operator(!=) ident(fd2)operator(\)) operator({) - reserved(if) operator(()ident(fptr)operator(->)ident(f) operator(==) ident(stdin) operator(||) ident(fptr)operator(->)ident(f) operator(==) ident(stdout) operator(||) ident(fptr)operator(->)ident(f) operator(==) ident(stderr)operator(\)) operator({) - ident(clearerr)operator(()ident(fptr)operator(->)ident(f)operator(\);) - comment(/* need to keep stdio objects */) - reserved(if) operator(()ident(dup2)operator(()ident(fd2)operator(,) ident(fd)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(orig)operator(->)ident(path)operator(\);) - operator(}) - reserved(else) operator({) - ident(FILE) operator(*)ident(f2) operator(=) ident(fptr)operator(->)ident(f2)operator(;) - pre_type(int) ident(m) operator(=) ident(fptr)operator(->)ident(mode)operator(;) - ident(fclose)operator(()ident(fptr)operator(->)ident(f)operator(\);) - ident(fptr)operator(->)ident(f) operator(=) ident(f2)operator(;) - ident(fptr)operator(->)ident(f2) operator(=) pre_constant(NULL)operator(;) - ident(fptr)operator(->)ident(mode) operator(&=) operator(()ident(m) operator(&) ident(FMODE_READABLE)operator(\)) operator(?) operator(~)ident(FMODE_READABLE) operator(:) operator(~)ident(FMODE_WRITABLE)operator(;) - reserved(if) operator(()ident(dup2)operator(()ident(fd2)operator(,) ident(fd)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(orig)operator(->)ident(path)operator(\);) - reserved(if) operator(()ident(f2)operator(\)) operator({) - ident(fptr)operator(->)ident(f) operator(=) ident(rb_fdopen)operator(()ident(fd)operator(,) stringoperator(\);) - ident(fptr)operator(->)ident(f2) operator(=) ident(f2)operator(;) - operator(}) - reserved(else) operator({) - ident(fptr)operator(->)ident(f) operator(=) ident(rb_fdopen)operator(()ident(fd)operator(,) ident(mode)operator(\);) - operator(}) - ident(fptr)operator(->)ident(mode) operator(=) ident(m)operator(;) - operator(}) - ident(rb_thread_fd_close)operator(()ident(fd)operator(\);) - reserved(if) operator((()ident(orig)operator(->)ident(mode) operator(&) ident(FMODE_READABLE)operator(\)) operator(&&) ident(pos) operator(>=) integer(0)operator(\)) operator({) - ident(io_seek)operator(()ident(fptr)operator(,) ident(pos)operator(,) ident(SEEK_SET)operator(\);) - ident(io_seek)operator(()ident(orig)operator(,) ident(pos)operator(,) ident(SEEK_SET)operator(\);) - operator(}) - operator(}) - - reserved(if) operator(()ident(fptr)operator(->)ident(f2) operator(&&) ident(fd) operator(!=) ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\)\)) operator({) - ident(fd) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\);) - reserved(if) operator((!)ident(orig)operator(->)ident(f2)operator(\)) operator({) - ident(fclose)operator(()ident(fptr)operator(->)ident(f2)operator(\);) - ident(rb_thread_fd_close)operator(()ident(fd)operator(\);) - ident(fptr)operator(->)ident(f2) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(fd) operator(!=) operator(()ident(fd2) operator(=) ident(fileno)operator(()ident(orig)operator(->)ident(f2)operator(\)\)\)) operator({) - ident(fclose)operator(()ident(fptr)operator(->)ident(f2)operator(\);) - ident(rb_thread_fd_close)operator(()ident(fd)operator(\);) - reserved(if) operator(()ident(dup2)operator(()ident(fd2)operator(,) ident(fd)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()ident(orig)operator(->)ident(path)operator(\);) - ident(fptr)operator(->)ident(f2) operator(=) ident(rb_fdopen)operator(()ident(fd)operator(,) stringoperator(\);) - operator(}) - operator(}) - - reserved(if) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_BINMODE)operator(\)) operator({) - ident(rb_io_binmode)operator(()ident(io)operator(\);) - operator(}) - - ident(RBASIC)operator(()ident(io)operator(\)->)ident(klass) operator(=) ident(RBASIC)operator(()ident(nfile)operator(\)->)ident(klass)operator(;) - reserved(return) ident(io)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.reopen(other_IO\) => ios - * ios.reopen(path, mode_str\) => ios - * - * Reassociates ios with the I/O stream given in - * other_IO or to a new stream opened on path. This may - * dynamically change the actual class of this stream. - * - * f1 = File.new("testfile"\) - * f2 = File.new("testfile"\) - * f2.readlines[0] #=> "This is line one\\n" - * f2.reopen(f1\) #=> # - * f2.readlines[0] #=> "This is line one\\n" - */) - -directive(static) ident(VALUE) -ident(rb_io_reopen)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(file)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(file)operator(;) -operator({) - ident(VALUE) ident(fname)operator(,) ident(nmode)operator(;) - pre_type(char) operator(*)ident(mode)operator(;) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(fname)operator(,) operator(&)ident(nmode)operator(\)) operator(==) integer(1)operator(\)) operator({) - ident(VALUE) ident(tmp) operator(=) ident(rb_io_check_io)operator(()ident(fname)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - reserved(return) ident(io_reopen)operator(()ident(file)operator(,) ident(tmp)operator(\);) - operator(}) - operator(}) - - ident(SafeStringValue)operator(()ident(fname)operator(\);) - ident(rb_io_taint_check)operator(()ident(file)operator(\);) - ident(fptr) operator(=) ident(RFILE)operator(()ident(file)operator(\)->)ident(fptr)operator(;) - reserved(if) operator((!)ident(fptr)operator(\)) operator({) - ident(fptr) operator(=) ident(RFILE)operator(()ident(file)operator(\)->)ident(fptr) operator(=) ident(ALLOC)operator(()ident(OpenFile)operator(\);) - ident(MEMZERO)operator(()ident(fptr)operator(,) ident(OpenFile)operator(,) integer(1)operator(\);) - operator(}) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(nmode)operator(\)\)) operator({) - ident(fptr)operator(->)ident(mode) operator(=) ident(rb_io_mode_flags)operator(()ident(StringValueCStr)operator(()ident(nmode)operator(\)\);) - operator(}) - - reserved(if) operator(()ident(fptr)operator(->)ident(path)operator(\)) operator({) - ident(free)operator(()ident(fptr)operator(->)ident(path)operator(\);) - ident(fptr)operator(->)ident(path) operator(=) integer(0)operator(;) - operator(}) - - ident(fptr)operator(->)ident(path) operator(=) ident(strdup)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\)\);) - ident(mode) operator(=) ident(rb_io_flags_mode)operator(()ident(fptr)operator(->)ident(mode)operator(\);) - reserved(if) operator((!)ident(fptr)operator(->)ident(f)operator(\)) operator({) - ident(fptr)operator(->)ident(f) operator(=) ident(rb_fopen)operator(()ident(fptr)operator(->)ident(path)operator(,) ident(mode)operator(\);) - reserved(if) operator(()ident(fptr)operator(->)ident(f2)operator(\)) operator({) - ident(fclose)operator(()ident(fptr)operator(->)ident(f2)operator(\);) - ident(fptr)operator(->)ident(f2) operator(=) integer(0)operator(;) - operator(}) - reserved(return) ident(file)operator(;) - operator(}) - - reserved(if) operator(()ident(freopen)operator(()ident(fptr)operator(->)ident(path)operator(,) ident(mode)operator(,) ident(fptr)operator(->)ident(f)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) -preprocessor(#ifdef) ident(USE_SETVBUF) - reserved(if) operator(()ident(setvbuf)operator(()ident(fptr)operator(->)ident(f)operator(,) pre_constant(NULL)operator(,) ident(_IOFBF)operator(,) integer(0)operator(\)) operator(!=) integer(0)operator(\)) - ident(rb_warn)operator(()stringoperator(,) ident(fptr)operator(->)ident(path)operator(\);) -preprocessor(#endif) - - reserved(if) operator(()ident(fptr)operator(->)ident(f2)operator(\)) operator({) - reserved(if) operator(()ident(freopen)operator(()ident(fptr)operator(->)ident(path)operator(,) stringoperator(,) ident(fptr)operator(->)ident(f2)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - operator(}) - operator(}) - - reserved(return) ident(file)operator(;) -operator(}) - -comment(/* :nodoc: */) -directive(static) ident(VALUE) -ident(rb_io_init_copy)operator(()ident(dest)operator(,) ident(io)operator(\)) - ident(VALUE) ident(dest)operator(,) ident(io)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(,) operator(*)ident(orig)operator(;) - pre_type(int) ident(fd)operator(;) - pre_type(char) operator(*)ident(mode)operator(;) - - ident(io) operator(=) ident(rb_io_get_io)operator(()ident(io)operator(\);) - reserved(if) operator(()ident(dest) operator(==) ident(io)operator(\)) reserved(return) ident(dest)operator(;) - ident(GetOpenFile)operator(()ident(io)operator(,) ident(orig)operator(\);) - ident(MakeOpenFile)operator(()ident(dest)operator(,) ident(fptr)operator(\);) - - reserved(if) operator(()ident(orig)operator(->)ident(f2)operator(\)) operator({) - ident(io_fflush)operator(()ident(orig)operator(->)ident(f2)operator(,) ident(orig)operator(\);) - ident(fseeko)operator(()ident(orig)operator(->)ident(f)operator(,) integer(0L)operator(,) ident(SEEK_CUR)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(orig)operator(->)ident(mode) operator(&) ident(FMODE_WRITABLE)operator(\)) operator({) - ident(io_fflush)operator(()ident(orig)operator(->)ident(f)operator(,) ident(orig)operator(\);) - operator(}) - reserved(else) operator({) - ident(fseeko)operator(()ident(orig)operator(->)ident(f)operator(,) integer(0L)operator(,) ident(SEEK_CUR)operator(\);) - operator(}) - - comment(/* copy OpenFile structure */) - ident(fptr)operator(->)ident(mode) operator(=) ident(orig)operator(->)ident(mode)operator(;) - ident(fptr)operator(->)ident(pid) operator(=) ident(orig)operator(->)ident(pid)operator(;) - ident(fptr)operator(->)ident(lineno) operator(=) ident(orig)operator(->)ident(lineno)operator(;) - reserved(if) operator(()ident(orig)operator(->)ident(path)operator(\)) ident(fptr)operator(->)ident(path) operator(=) ident(strdup)operator(()ident(orig)operator(->)ident(path)operator(\);) - ident(fptr)operator(->)ident(finalize) operator(=) ident(orig)operator(->)ident(finalize)operator(;) - - reserved(switch) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_READWRITE)operator(\)) operator({) - reserved(case) ident(FMODE_READABLE)operator(:) - reserved(default)operator(:) - ident(mode) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) ident(FMODE_WRITABLE)operator(:) - ident(mode) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) ident(FMODE_READWRITE)operator(:) - reserved(if) operator(()ident(orig)operator(->)ident(f2)operator(\)) ident(mode) operator(=) stringoperator(;) - reserved(else) ident(mode) operator(=) stringoperator(;) - reserved(break)operator(;) - operator(}) - ident(fd) operator(=) ident(ruby_dup)operator(()ident(fileno)operator(()ident(orig)operator(->)ident(f)operator(\)\);) - ident(fptr)operator(->)ident(f) operator(=) ident(rb_fdopen)operator(()ident(fd)operator(,) ident(mode)operator(\);) - ident(fseeko)operator(()ident(fptr)operator(->)ident(f)operator(,) ident(ftello)operator(()ident(orig)operator(->)ident(f)operator(\),) ident(SEEK_SET)operator(\);) - reserved(if) operator(()ident(orig)operator(->)ident(f2)operator(\)) operator({) - reserved(if) operator(()ident(fileno)operator(()ident(orig)operator(->)ident(f)operator(\)) operator(!=) ident(fileno)operator(()ident(orig)operator(->)ident(f2)operator(\)\)) operator({) - ident(fd) operator(=) ident(ruby_dup)operator(()ident(fileno)operator(()ident(orig)operator(->)ident(f2)operator(\)\);) - operator(}) - ident(fptr)operator(->)ident(f2) operator(=) ident(rb_fdopen)operator(()ident(fd)operator(,) stringoperator(\);) - ident(fseeko)operator(()ident(fptr)operator(->)ident(f2)operator(,) ident(ftello)operator(()ident(orig)operator(->)ident(f2)operator(\),) ident(SEEK_SET)operator(\);) - operator(}) - reserved(if) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_BINMODE)operator(\)) operator({) - ident(rb_io_binmode)operator(()ident(dest)operator(\);) - operator(}) - - reserved(return) ident(dest)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.printf(format_string [, obj, ...] \) => nil - * - * Formats and writes to ios, converting parameters under - * control of the format string. See Kernel#sprintf - * for details. - */) - -ident(VALUE) -ident(rb_io_printf)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(out)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) ident(argv)operator([];) - ident(VALUE) ident(out)operator(;) -operator({) - ident(rb_io_write)operator(()ident(out)operator(,) ident(rb_f_sprintf)operator(()ident(argc)operator(,) ident(argv)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * printf(io, string [, obj ... ] \) => nil - * printf(string [, obj ... ] \) => nil - * - * Equivalent to: - * io.write(sprintf(string, obj, ...\) - * or - * $stdout.write(sprintf(string, obj, ...\) - */) - -directive(static) ident(VALUE) -ident(rb_f_printf)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) ident(argv)operator([];) -operator({) - ident(VALUE) ident(out)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(==) ident(T_STRING)operator(\)) operator({) - ident(out) operator(=) ident(rb_stdout)operator(;) - operator(}) - reserved(else) operator({) - ident(out) operator(=) ident(argv)operator([)integer(0)operator(];) - ident(argv)operator(++;) - ident(argc)operator(--;) - operator(}) - ident(rb_io_write)operator(()ident(out)operator(,) ident(rb_f_sprintf)operator(()ident(argc)operator(,) ident(argv)operator(\)\);) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.print(\) => nil - * ios.print(obj, ...\) => nil - * - * Writes the given object(s\) to ios. The stream must be - * opened for writing. If the output record separator ($\\\\\) - * is not nil, it will be appended to the output. If no - * arguments are given, prints $_. Objects that aren't - * strings will be converted by calling their to_s method. - * With no argument, prints the contents of the variable $_. - * Returns nil. - * - * $stdout.print("This is ", 100, " percent.\\n"\) - * - * produces: - * - * This is 100 percent. - */) - -ident(VALUE) -ident(rb_io_print)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(out)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(out)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - ident(VALUE) ident(line)operator(;) - - comment(/* if no argument given, print `$_' */) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(argc) operator(=) integer(1)operator(;) - ident(line) operator(=) ident(rb_lastline_get)operator((\);) - ident(argv) operator(=) operator(&)ident(line)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(rb_output_fs)operator(\)) operator(&&) ident(i)operator(>)integer(0)operator(\)) operator({) - ident(rb_io_write)operator(()ident(out)operator(,) ident(rb_output_fs)operator(\);) - operator(}) - reserved(switch) operator(()ident(TYPE)operator(()ident(argv)operator([)ident(i)operator(]\)\)) operator({) - reserved(case) ident(T_NIL)operator(:) - ident(rb_io_write)operator(()ident(out)operator(,) ident(rb_str_new2)operator(()stringoperator(\)\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_io_write)operator(()ident(out)operator(,) ident(argv)operator([)ident(i)operator(]\);) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator((!)ident(NIL_P)operator(()ident(rb_output_rs)operator(\)\)) operator({) - ident(rb_io_write)operator(()ident(out)operator(,) ident(rb_output_rs)operator(\);) - operator(}) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * print(obj, ...\) => nil - * - * Prints each object in turn to $stdout. If the output - * field separator ($,\) is not +nil+, its - * contents will appear between each field. If the output record - * separator ($\\\\\) is not +nil+, it will be - * appended to the output. If no arguments are given, prints - * $_. Objects that aren't strings will be converted by - * calling their to_s method. - * - * print "cat", [1,2,3], 99, "\\n" - * $, = ", " - * $\\ = "\\n" - * print "cat", [1,2,3], 99 - * - * produces: - * - * cat12399 - * cat, 1, 2, 3, 99 - */) - -directive(static) ident(VALUE) -ident(rb_f_print)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(rb_io_print)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(rb_stdout)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.putc(obj\) => obj - * - * If obj is Numeric, write the character whose - * code is obj, otherwise write the first character of the - * string representation of obj to ios. - * - * $stdout.putc "A" - * $stdout.putc 65 - * - * produces: - * - * AA - */) - -directive(static) ident(VALUE) -ident(rb_io_putc)operator(()ident(io)operator(,) ident(ch)operator(\)) - ident(VALUE) ident(io)operator(,) ident(ch)operator(;) -operator({) - pre_type(char) ident(c) operator(=) ident(NUM2CHR)operator(()ident(ch)operator(\);) - - ident(rb_io_write)operator(()ident(io)operator(,) ident(rb_str_new)operator((&)ident(c)operator(,) integer(1)operator(\)\);) - reserved(return) ident(ch)operator(;) -operator(}) - -comment(/* - * call-seq: - * putc(int\) => int - * - * Equivalent to: - * - * $stdout.putc(int\) - */) - -directive(static) ident(VALUE) -ident(rb_f_putc)operator(()ident(recv)operator(,) ident(ch)operator(\)) - ident(VALUE) ident(recv)operator(,) ident(ch)operator(;) -operator({) - reserved(return) ident(rb_io_putc)operator(()ident(rb_stdout)operator(,) ident(ch)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(io_puts_ary)operator(()ident(ary)operator(,) ident(out)operator(\)) - ident(VALUE) ident(ary)operator(,) ident(out)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(;) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(tmp) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - reserved(if) operator(()ident(rb_inspecting_p)operator(()ident(tmp)operator(\)\)) operator({) - ident(tmp) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - operator(}) - ident(rb_io_puts)operator(()integer(1)operator(,) operator(&)ident(tmp)operator(,) ident(out)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * ios.puts(obj, ...\) => nil - * - * Writes the given objects to ios as with - * IO#print. Writes a record separator (typically a - * newline\) after any that do not already end with a newline sequence. - * If called with an array argument, writes each element on a new line. - * If called without arguments, outputs a single record separator. - * - * $stdout.puts("this", "is", "a", "test"\) - * - * produces: - * - * this - * is - * a - * test - */) - -ident(VALUE) -ident(rb_io_puts)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(out)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(out)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - ident(VALUE) ident(line)operator(;) - - comment(/* if no argument given, print newline. */) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rb_io_write)operator(()ident(out)operator(,) ident(rb_default_rs)operator(\);) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(NIL_P)operator(()ident(argv)operator([)ident(i)operator(]\)\)) operator({) - ident(line) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - operator(}) - reserved(else) operator({) - ident(line) operator(=) ident(rb_check_array_type)operator(()ident(argv)operator([)ident(i)operator(]\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(line)operator(\)\)) operator({) - ident(rb_protect_inspect)operator(()ident(io_puts_ary)operator(,) ident(line)operator(,) ident(out)operator(\);) - reserved(continue)operator(;) - operator(}) - ident(line) operator(=) ident(rb_obj_as_string)operator(()ident(argv)operator([)ident(i)operator(]\);) - operator(}) - ident(rb_io_write)operator(()ident(out)operator(,) ident(line)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(line)operator(\)->)ident(len) operator(==) integer(0) operator(||) - ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(line)operator(\)->)ident(len)operator(-)integer(1)operator(]) operator(!=) char('\\n')operator(\)) operator({) - ident(rb_io_write)operator(()ident(out)operator(,) ident(rb_default_rs)operator(\);) - operator(}) - operator(}) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * puts(obj, ...\) => nil - * - * Equivalent to - * - * $stdout.puts(obj, ...\) - */) - -directive(static) ident(VALUE) -ident(rb_f_puts)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(rb_io_puts)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(rb_stdout)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(void) -ident(rb_p)operator(()ident(obj)operator(\)) comment(/* for debug print within C code */) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(rb_io_write)operator(()ident(rb_stdout)operator(,) ident(rb_obj_as_string)operator(()ident(rb_inspect)operator(()ident(obj)operator(\)\)\);) - ident(rb_io_write)operator(()ident(rb_stdout)operator(,) ident(rb_default_rs)operator(\);) -operator(}) - -comment(/* - * call-seq: - * p(obj, ...\) => nil - * - * For each object, directly writes - * _obj_.+inspect+ followed by the current output - * record separator to the program's standard output. - * - * S = Struct.new(:name, :state\) - * s = S['dave', 'TX'] - * p s - * - * produces: - * - * # - */) - -directive(static) ident(VALUE) -ident(rb_f_p)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(rb_p)operator(()ident(argv)operator([)ident(i)operator(]\);) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(rb_stdout)operator(\)) operator(==) ident(T_FILE)operator(\)) operator({) - ident(rb_io_flush)operator(()ident(rb_stdout)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.display(port=$>\) => nil - * - * Prints obj on the given port (default $>\). - * Equivalent to: - * - * def display(port=$>\) - * port.write self - * end - * - * For example: - * - * 1.display - * "cat".display - * [ 4, 5, 6 ].display - * puts - * - * produces: - * - * 1cat456 - */) - -directive(static) ident(VALUE) -ident(rb_obj_display)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - ident(VALUE) ident(out)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(out)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(out) operator(=) ident(rb_stdout)operator(;) - operator(}) - - ident(rb_io_write)operator(()ident(out)operator(,) ident(self)operator(\);) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(void) -ident(rb_write_error2)operator(()ident(mesg)operator(,) ident(len)operator(\)) - directive(const) pre_type(char) operator(*)ident(mesg)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - ident(rb_io_write)operator(()ident(rb_stderr)operator(,) ident(rb_str_new)operator(()ident(mesg)operator(,) ident(len)operator(\)\);) -operator(}) - -directive(void) -ident(rb_write_error)operator(()ident(mesg)operator(\)) - directive(const) pre_type(char) operator(*)ident(mesg)operator(;) -operator({) - ident(rb_write_error2)operator(()ident(mesg)operator(,) ident(strlen)operator(()ident(mesg)operator(\)\);) -operator(}) - -directive(static) directive(void) -ident(must_respond_to)operator(()ident(mid)operator(,) ident(val)operator(,) ident(id)operator(\)) - ident(ID) ident(mid)operator(;) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(val)operator(,) ident(mid)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(id)operator(\),) ident(rb_id2name)operator(()ident(mid)operator(\),) - ident(rb_obj_classname)operator(()ident(val)operator(\)\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(stdout_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(variable)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) operator(*)ident(variable)operator(;) -operator({) - ident(must_respond_to)operator(()ident(id_write)operator(,) ident(val)operator(,) ident(id)operator(\);) - operator(*)ident(variable) operator(=) ident(val)operator(;) -operator(}) - -directive(static) directive(void) -ident(defout_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(variable)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) operator(*)ident(variable)operator(;) -operator({) - ident(stdout_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(variable)operator(\);) - ident(rb_warn)operator(()stringoperator(\);) -operator(}) - -directive(static) directive(void) -ident(deferr_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(variable)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) operator(*)ident(variable)operator(;) -operator({) - ident(stdout_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(variable)operator(\);) - ident(rb_warn)operator(()stringoperator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(prep_stdio)operator(()ident(f)operator(,) ident(mode)operator(,) ident(klass)operator(\)) - ident(FILE) operator(*)ident(f)operator(;) - pre_type(int) ident(mode)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fp)operator(;) - ident(VALUE) ident(io) operator(=) ident(io_alloc)operator(()ident(klass)operator(\);) - - ident(MakeOpenFile)operator(()ident(io)operator(,) ident(fp)operator(\);) -preprocessor(#ifdef) ident(__CYGWIN__) - reserved(if) operator((!)ident(isatty)operator(()ident(fileno)operator(()ident(f)operator(\)\)\)) operator({) - ident(mode) operator(|=) ident(O_BINARY)operator(;) - ident(setmode)operator(()ident(fileno)operator(()ident(f)operator(\),) ident(O_BINARY)operator(\);) - operator(}) -preprocessor(#endif) - ident(fp)operator(->)ident(f) operator(=) ident(f)operator(;) - ident(fp)operator(->)ident(mode) operator(=) ident(mode)operator(;) - - reserved(return) ident(io)operator(;) -operator(}) - -directive(static) directive(void) -ident(prep_path)operator(()ident(io)operator(,) ident(path)operator(\)) - ident(VALUE) ident(io)operator(;) - pre_type(char) operator(*)ident(path)operator(;) -operator({) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(fptr)operator(->)ident(path)operator(\)) ident(rb_bug)operator(()stringoperator(\);) - ident(fptr)operator(->)ident(path) operator(=) ident(strdup)operator(()ident(path)operator(\);) -operator(}) - -comment(/* - * call-seq: - * IO.new(fd, mode\) => io - * - * Returns a new IO object (a stream\) for the given - * integer file descriptor and mode string. See also - * IO#fileno and IO::for_fd. - * - * a = IO.new(2,"w"\) # '2' is standard error - * $stderr.puts "Hello" - * a.puts "World" - * - * produces: - * - * Hello - * World - */) - -directive(static) ident(VALUE) -ident(rb_io_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(fnum)operator(,) ident(mode)operator(;) - ident(OpenFile) operator(*)ident(fp)operator(;) - pre_type(int) ident(fd)operator(,) ident(flags)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(fnum)operator(,) operator(&)ident(mode)operator(\);) - ident(fd) operator(=) ident(NUM2INT)operator(()ident(fnum)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(2)operator(\)) operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(mode)operator(\)\)) operator({) - ident(flags) operator(=) ident(FIX2LONG)operator(()ident(mode)operator(\);) - operator(}) - reserved(else) operator({) - ident(SafeStringValue)operator(()ident(mode)operator(\);) - ident(flags) operator(=) ident(rb_io_mode_modenum)operator(()ident(StringValueCStr)operator(()ident(mode)operator(\)\);) - operator(}) - operator(}) - reserved(else) operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_FCNTL)operator(\)) operator(&&) ident(defined)operator(()ident(F_GETFL)operator(\)) - ident(flags) operator(=) ident(fcntl)operator(()ident(fd)operator(,) ident(F_GETFL)operator(\);) - reserved(if) operator(()ident(flags) operator(==) operator(-)integer(1)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(flags) operator(=) ident(O_RDONLY)operator(;) -preprocessor(#endif) - operator(}) - ident(MakeOpenFile)operator(()ident(io)operator(,) ident(fp)operator(\);) - ident(fp)operator(->)ident(mode) operator(=) ident(rb_io_modenum_flags)operator(()ident(flags)operator(\);) - ident(fp)operator(->)ident(f) operator(=) ident(rb_fdopen)operator(()ident(fd)operator(,) ident(rb_io_modenum_mode)operator(()ident(flags)operator(\)\);) - - reserved(return) ident(io)operator(;) -operator(}) - -comment(/* - * call-seq: - * File.new(filename, mode="r"\) => file - * File.new(filename [, mode [, perm]]\) => file - * - - * Opens the file named by _filename_ according to - * _mode_ (default is ``r''\) and returns a new - * File object. See the description of class +IO+ for - * a description of _mode_. The file mode may optionally be - * specified as a +Fixnum+ by _or_-ing together the - * flags (O_RDONLY etc, again described under +IO+\). Optional - * permission bits may be given in _perm_. These mode and permission - * bits are platform dependent; on Unix systems, see - * open(2\) for details. - * - * f = File.new("testfile", "r"\) - * f = File.new("newfile", "w+"\) - * f = File.new("newfile", File::CREAT|File::TRUNC|File::RDWR, 0644\) - */) - -directive(static) ident(VALUE) -ident(rb_file_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - reserved(if) operator(()ident(RFILE)operator(()ident(io)operator(\)->)ident(fptr)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()integer(0) operator(<) ident(argc) operator(&&) ident(argc) operator(<) integer(3)operator(\)) operator({) - ident(VALUE) ident(fd) operator(=) ident(rb_check_convert_type)operator(()ident(argv)operator([)integer(0)operator(],) ident(T_FIXNUM)operator(,) stringoperator(,) stringoperator(\);) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(fd)operator(\)\)) operator({) - ident(argv)operator([)integer(0)operator(]) operator(=) ident(fd)operator(;) - reserved(return) ident(rb_io_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\);) - operator(}) - operator(}) - ident(rb_open_file)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\);) - - reserved(return) ident(io)operator(;) -operator(}) - -comment(/* - * call-seq: - * IO.new(fd, mode_string\) => io - * - * Returns a new IO object (a stream\) for the given - * integer file descriptor and mode string. See also - * IO#fileno and IO::for_fd. - * - * a = IO.new(2,"w"\) # '2' is standard error - * $stderr.puts "Hello" - * a.puts "World" - * - * produces: - * - * Hello - * World - */) - -directive(static) ident(VALUE) -ident(rb_io_s_new)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - pre_type(char) operator(*)ident(cname) operator(=) ident(rb_class2name)operator(()ident(klass)operator(\);) - - ident(rb_warn)operator(()stringoperator(,) - ident(cname)operator(,) ident(cname)operator(\);) - operator(}) - reserved(return) ident(rb_class_new_instance)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\);) -operator(}) - -comment(/* - * call-seq: - * IO.for_fd(fd, mode\) => io - * - * Synonym for IO::new. - * - */) - -directive(static) ident(VALUE) -ident(rb_io_s_for_fd)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(io) operator(=) ident(rb_obj_alloc)operator(()ident(klass)operator(\);) - ident(rb_io_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\);) - reserved(return) ident(io)operator(;) -operator(}) - -directive(static) pre_type(int) ident(binmode) operator(=) integer(0)operator(;) - -directive(static) ident(VALUE) -ident(argf_forward)operator(()pre_type(int) ident(argc)operator(,) ident(VALUE) operator(*)ident(argv)operator(\)) -operator({) - reserved(return) ident(rb_funcall3)operator(()ident(current_file)operator(,) ident(ruby_frame)operator(->)ident(last_func)operator(,) ident(argc)operator(,) ident(argv)operator(\);) -operator(}) - -preprocessor(#define) ident(ARGF_FORWARD)operator(()ident(argc)operator(,) ident(argv)operator(\)) reserved(do) operator({)\ - reserved(if) operator(()ident(TYPE)operator(()ident(current_file)operator(\)) operator(!=) ident(T_FILE)operator(\))\ - reserved(return) ident(argf_forward)operator(()ident(argc)operator(,) ident(argv)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#define) ident(NEXT_ARGF_FORWARD)operator(()ident(argc)operator(,) ident(argv)operator(\)) reserved(do) operator({)\ - reserved(if) operator((!)ident(next_argv)operator((\)\)) reserved(return) ident(Qnil)operator(;)\ - ident(ARGF_FORWARD)operator(()ident(argc)operator(,) ident(argv)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -directive(static) directive(void) -ident(argf_close)operator(()ident(file)operator(\)) - ident(VALUE) ident(file)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(file)operator(\)) operator(==) ident(T_FILE)operator(\)) - ident(rb_io_close)operator(()ident(file)operator(\);) - reserved(else) - ident(rb_funcall3)operator(()ident(file)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(next_argv)operator((\)) -operator({) - directive(extern) ident(VALUE) ident(rb_argv)operator(;) - pre_type(char) operator(*)ident(fn)operator(;) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(int) ident(stdout_binmode) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(rb_stdout)operator(\)) operator(==) ident(T_FILE)operator(\)) operator({) - ident(GetOpenFile)operator(()ident(rb_stdout)operator(,) ident(fptr)operator(\);) - reserved(if) operator(()ident(fptr)operator(->)ident(mode) operator(&) ident(FMODE_BINMODE)operator(\)) - ident(stdout_binmode) operator(=) integer(1)operator(;) - operator(}) - - reserved(if) operator(()ident(init_p) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(rb_argv)operator(\)->)ident(len) operator(>) integer(0)operator(\)) operator({) - ident(next_p) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(next_p) operator(=) operator(-)integer(1)operator(;) - operator(}) - ident(init_p) operator(=) integer(1)operator(;) - ident(gets_lineno) operator(=) integer(0)operator(;) - operator(}) - - reserved(if) operator(()ident(next_p) operator(==) integer(1)operator(\)) operator({) - ident(next_p) operator(=) integer(0)operator(;) - label(retry:) - reserved(if) operator(()ident(RARRAY)operator(()ident(rb_argv)operator(\)->)ident(len) operator(>) integer(0)operator(\)) operator({) - ident(filename) operator(=) ident(rb_ary_shift)operator(()ident(rb_argv)operator(\);) - ident(fn) operator(=) ident(StringValueCStr)operator(()ident(filename)operator(\);) - reserved(if) operator(()ident(strlen)operator(()ident(fn)operator(\)) operator(==) integer(1) operator(&&) ident(fn)operator([)integer(0)operator(]) operator(==) char('-')operator(\)) operator({) - ident(current_file) operator(=) ident(rb_stdin)operator(;) - reserved(if) operator(()ident(ruby_inplace_mode)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - reserved(goto) ident(retry)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(FILE) operator(*)ident(fr) operator(=) ident(rb_fopen)operator(()ident(fn)operator(,) stringoperator(\);) - - reserved(if) operator(()ident(ruby_inplace_mode)operator(\)) operator({) - reserved(struct) ident(stat) ident(st)operator(,) ident(st2)operator(;) - ident(VALUE) ident(str)operator(;) - ident(FILE) operator(*)ident(fw)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(rb_stdout)operator(\)) operator(==) ident(T_FILE) operator(&&) ident(rb_stdout) operator(!=) ident(orig_stdout)operator(\)) operator({) - ident(rb_io_close)operator(()ident(rb_stdout)operator(\);) - operator(}) - ident(fstat)operator(()ident(fileno)operator(()ident(fr)operator(\),) operator(&)ident(st)operator(\);) - reserved(if) operator((*)ident(ruby_inplace_mode)operator(\)) operator({) - ident(str) operator(=) ident(rb_str_new2)operator(()ident(fn)operator(\);) -preprocessor(#ifdef) ident(NO_LONG_FNAME) - ident(ruby_add_suffix)operator(()ident(str)operator(,) ident(ruby_inplace_mode)operator(\);) -preprocessor(#else) - ident(rb_str_cat2)operator(()ident(str)operator(,) ident(ruby_inplace_mode)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(NO_SAFE_RENAME) - operator(()directive(void)operator(\))ident(fclose)operator(()ident(fr)operator(\);) - operator(()directive(void)operator(\))ident(unlink)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - operator(()directive(void)operator(\))ident(rename)operator(()ident(fn)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - ident(fr) operator(=) ident(rb_fopen)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) stringoperator(\);) -preprocessor(#else) - reserved(if) operator(()ident(rename)operator(()ident(fn)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) - ident(fn)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(strerror)operator(()ident(errno)operator(\)\);) - ident(fclose)operator(()ident(fr)operator(\);) - reserved(goto) ident(retry)operator(;) - operator(}) -preprocessor(#endif) - operator(}) - reserved(else) operator({) -preprocessor(#ifdef) ident(NO_SAFE_RENAME) - ident(rb_fatal)operator(()stringoperator(\);) -preprocessor(#else) - reserved(if) operator(()ident(unlink)operator(()ident(fn)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) - ident(fn)operator(,) ident(strerror)operator(()ident(errno)operator(\)\);) - ident(fclose)operator(()ident(fr)operator(\);) - reserved(goto) ident(retry)operator(;) - operator(}) -preprocessor(#endif) - operator(}) - ident(fw) operator(=) ident(rb_fopen)operator(()ident(fn)operator(,) stringoperator(\);) -preprocessor(#ifndef) ident(NO_SAFE_RENAME) - ident(fstat)operator(()ident(fileno)operator(()ident(fw)operator(\),) operator(&)ident(st2)operator(\);) -preprocessor(#ifdef) ident(HAVE_FCHMOD) - ident(fchmod)operator(()ident(fileno)operator(()ident(fw)operator(\),) ident(st)operator(.)ident(st_mode)operator(\);) -preprocessor(#else) - ident(chmod)operator(()ident(fn)operator(,) ident(st)operator(.)ident(st_mode)operator(\);) -preprocessor(#endif) - reserved(if) operator(()ident(st)operator(.)ident(st_uid)operator(!=)ident(st2)operator(.)ident(st_uid) operator(||) ident(st)operator(.)ident(st_gid)operator(!=)ident(st2)operator(.)ident(st_gid)operator(\)) operator({) - ident(fchown)operator(()ident(fileno)operator(()ident(fw)operator(\),) ident(st)operator(.)ident(st_uid)operator(,) ident(st)operator(.)ident(st_gid)operator(\);) - operator(}) -preprocessor(#endif) - ident(rb_stdout) operator(=) ident(prep_stdio)operator(()ident(fw)operator(,) ident(FMODE_WRITABLE)operator(,) ident(rb_cFile)operator(\);) - ident(prep_path)operator(()ident(rb_stdout)operator(,) ident(fn)operator(\);) - reserved(if) operator(()ident(stdout_binmode)operator(\)) ident(rb_io_binmode)operator(()ident(rb_stdout)operator(\);) - operator(}) - ident(current_file) operator(=) ident(prep_stdio)operator(()ident(fr)operator(,) ident(FMODE_READABLE)operator(,) ident(rb_cFile)operator(\);) - ident(prep_path)operator(()ident(current_file)operator(,) ident(fn)operator(\);) - operator(}) - reserved(if) operator(()ident(binmode)operator(\)) ident(rb_io_binmode)operator(()ident(current_file)operator(\);) - operator(}) - reserved(else) operator({) - ident(next_p) operator(=) integer(1)operator(;) - reserved(return) ident(Qfalse)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(next_p) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(current_file) operator(=) ident(rb_stdin)operator(;) - ident(filename) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(if) operator(()ident(ruby_inplace_mode)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - ident(rb_stdout) operator(=) ident(orig_stdout)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_getline)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(line)operator(;) - - label(retry:) - reserved(if) operator((!)ident(next_argv)operator((\)\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(argc) operator(==) integer(0) operator(&&) ident(rb_rs) operator(==) ident(rb_default_rs)operator(\)) operator({) - ident(line) operator(=) ident(rb_io_gets)operator(()ident(current_file)operator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(rs)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rs) operator(=) ident(rb_rs)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(rs)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(rs)operator(\)\)) ident(StringValue)operator(()ident(rs)operator(\);) - operator(}) - ident(line) operator(=) ident(rb_io_getline)operator(()ident(rs)operator(,) ident(current_file)operator(\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(line)operator(\)) operator(&&) ident(next_p) operator(!=) operator(-)integer(1)operator(\)) operator({) - ident(argf_close)operator(()ident(current_file)operator(\);) - ident(next_p) operator(=) integer(1)operator(;) - reserved(goto) ident(retry)operator(;) - operator(}) - reserved(if) operator((!)ident(NIL_P)operator(()ident(line)operator(\)\)) operator({) - ident(gets_lineno)operator(++;) - ident(lineno) operator(=) ident(INT2FIX)operator(()ident(gets_lineno)operator(\);) - operator(}) - reserved(return) ident(line)operator(;) -operator(}) - -comment(/* - * call-seq: - * gets(separator=$/\) => string or nil - * - * Returns (and assigns to $_\) the next line from the list - * of files in +ARGV+ (or $*\), or from standard - * input if no files are present on the command line. Returns - * +nil+ at end of file. The optional argument specifies the - * record separator. The separator is included with the contents of - * each record. A separator of +nil+ reads the entire - * contents, and a zero-length separator reads the input one paragraph - * at a time, where paragraphs are divided by two consecutive newlines. - * If multiple filenames are present in +ARGV+, - * +gets(nil\)+ will read the contents one file at a time. - * - * ARGV << "testfile" - * print while gets - * - * produces: - * - * This is line one - * This is line two - * This is line three - * And so on... - * - * The style of programming using $_ as an implicit - * parameter is gradually losing favor in the Ruby community. - */) - -directive(static) ident(VALUE) -ident(rb_f_gets)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(line)operator(;) - - reserved(if) operator((!)ident(next_argv)operator((\)\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(current_file)operator(\)) operator(!=) ident(T_FILE)operator(\)) operator({) - ident(line) operator(=) ident(rb_funcall3)operator(()ident(current_file)operator(,) ident(rb_intern)operator(()stringoperator(\),) ident(argc)operator(,) ident(argv)operator(\);) - operator(}) - reserved(else) operator({) - ident(line) operator(=) ident(argf_getline)operator(()ident(argc)operator(,) ident(argv)operator(\);) - operator(}) - ident(rb_lastline_set)operator(()ident(line)operator(\);) - reserved(return) ident(line)operator(;) -operator(}) - -ident(VALUE) -ident(rb_gets)operator((\)) -operator({) - ident(VALUE) ident(line)operator(;) - - reserved(if) operator(()ident(rb_rs) operator(!=) ident(rb_default_rs)operator(\)) operator({) - reserved(return) ident(rb_f_gets)operator(()integer(0)operator(,) integer(0)operator(\);) - operator(}) - - label(retry:) - reserved(if) operator((!)ident(next_argv)operator((\)\)) reserved(return) ident(Qnil)operator(;) - ident(line) operator(=) ident(rb_io_gets)operator(()ident(current_file)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(line)operator(\)) operator(&&) ident(next_p) operator(!=) operator(-)integer(1)operator(\)) operator({) - ident(argf_close)operator(()ident(current_file)operator(\);) - ident(next_p) operator(=) integer(1)operator(;) - reserved(goto) ident(retry)operator(;) - operator(}) - ident(rb_lastline_set)operator(()ident(line)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(line)operator(\)\)) operator({) - ident(gets_lineno)operator(++;) - ident(lineno) operator(=) ident(INT2FIX)operator(()ident(gets_lineno)operator(\);) - operator(}) - - reserved(return) ident(line)operator(;) -operator(}) - -comment(/* - * call-seq: - * readline(separator=$/\) => string - * - * Equivalent to Kernel::gets, except - * +readline+ raises +EOFError+ at end of file. - */) - -directive(static) ident(VALUE) -ident(rb_f_readline)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(line)operator(;) - - reserved(if) operator((!)ident(next_argv)operator((\)\)) ident(rb_eof_error)operator((\);) - ident(ARGF_FORWARD)operator(()ident(argc)operator(,) ident(argv)operator(\);) - ident(line) operator(=) ident(rb_f_gets)operator(()ident(argc)operator(,) ident(argv)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(line)operator(\)\)) operator({) - ident(rb_eof_error)operator((\);) - operator(}) - - reserved(return) ident(line)operator(;) -operator(}) - -comment(/* - * obsolete - */) - -directive(static) ident(VALUE) -ident(rb_f_getc)operator((\)) -operator({) - ident(rb_warn)operator(()stringoperator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(rb_stdin)operator(\)) operator(!=) ident(T_FILE)operator(\)) operator({) - reserved(return) ident(rb_funcall3)operator(()ident(rb_stdin)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(,) integer(0)operator(\);) - operator(}) - reserved(return) ident(rb_io_getc)operator(()ident(rb_stdin)operator(\);) -operator(}) - -comment(/* - * call-seq: - * readlines(separator=$/\) => array - * - * Returns an array containing the lines returned by calling - * Kernel.gets(separator\) until the end of file. - */) - -directive(static) ident(VALUE) -ident(rb_f_readlines)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(line)operator(,) ident(ary)operator(;) - - ident(NEXT_ARGF_FORWARD)operator(()ident(argc)operator(,) ident(argv)operator(\);) - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - reserved(while) operator((!)ident(NIL_P)operator(()ident(line) operator(=) ident(argf_getline)operator(()ident(argc)operator(,) ident(argv)operator(\)\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(line)operator(\);) - operator(}) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * `cmd` => string - * - * Returns the standard output of running _cmd_ in a subshell. - * The built-in syntax %x{...} uses - * this method. Sets $? to the process status. - * - * `date` #=> "Wed Apr 9 08:56:30 CDT 2003\\n" - * `ls testdir`.split[1] #=> "main.rb" - * `echo oops && exit 99` #=> "oops\\n" - * $?.exitstatus #=> 99 - */) - -directive(static) ident(VALUE) -ident(rb_f_backquote)operator(()ident(obj)operator(,) ident(str)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(str)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(port)operator(;) - ident(VALUE) ident(result)operator(;) - ident(OpenFile) operator(*)ident(fptr)operator(;) - - ident(SafeStringValue)operator(()ident(str)operator(\);) - ident(port) operator(=) ident(pipe_open)operator(()ident(str)operator(,) integer(0)operator(,) stringoperator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(port)operator(\)\)) reserved(return) ident(rb_str_new)operator(()integer(0)operator(,)integer(0)operator(\);) - - ident(GetOpenFile)operator(()ident(port)operator(,) ident(fptr)operator(\);) - ident(result) operator(=) ident(read_all)operator(()ident(fptr)operator(,) ident(remain_size)operator(()ident(fptr)operator(\),) ident(Qnil)operator(\);) - ident(rb_io_close)operator(()ident(port)operator(\);) - - reserved(return) ident(result)operator(;) -operator(}) - -preprocessor(#ifdef) ident(HAVE_SYS_SELECT_H) -preprocessor(#include) include() -preprocessor(#endif) - -comment(/* - * call-seq: - * IO.select(read_array - * [, write_array - * [, error_array - * [, timeout]]] \) => array or nil - * - * See Kernel#select. - */) - -directive(static) ident(VALUE) -ident(rb_f_select)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(read)operator(,) ident(write)operator(,) ident(except)operator(,) ident(timeout)operator(,) ident(res)operator(,) ident(list)operator(;) - ident(fd_set) ident(rset)operator(,) ident(wset)operator(,) ident(eset)operator(,) ident(pset)operator(;) - ident(fd_set) operator(*)ident(rp)operator(,) operator(*)ident(wp)operator(,) operator(*)ident(ep)operator(;) - reserved(struct) ident(timeval) operator(*)ident(tp)operator(,) ident(timerec)operator(;) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(long) ident(i)operator(;) - pre_type(int) ident(max) operator(=) integer(0)operator(,) ident(n)operator(;) - pre_type(int) ident(interrupt_flag) operator(=) integer(0)operator(;) - pre_type(int) ident(pending) operator(=) integer(0)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(read)operator(,) operator(&)ident(write)operator(,) operator(&)ident(except)operator(,) operator(&)ident(timeout)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(timeout)operator(\)\)) operator({) - ident(tp) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(timerec) operator(=) ident(rb_time_interval)operator(()ident(timeout)operator(\);) - ident(tp) operator(=) operator(&)ident(timerec)operator(;) - operator(}) - - ident(FD_ZERO)operator((&)ident(pset)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(read)operator(\)\)) operator({) - ident(Check_Type)operator(()ident(read)operator(,) ident(T_ARRAY)operator(\);) - ident(rp) operator(=) operator(&)ident(rset)operator(;) - ident(FD_ZERO)operator(()ident(rp)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(read)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(GetOpenFile)operator(()ident(rb_io_get_io)operator(()ident(RARRAY)operator(()ident(read)operator(\)->)ident(ptr)operator([)ident(i)operator(]\),) ident(fptr)operator(\);) - ident(FD_SET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(rp)operator(\);) - reserved(if) operator(()ident(READ_DATA_PENDING)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) operator({) comment(/* check for buffered data */) - ident(pending)operator(++;) - ident(FD_SET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) operator(&)ident(pset)operator(\);) - operator(}) - reserved(if) operator(()ident(max) operator(<) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) ident(max) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\);) - operator(}) - reserved(if) operator(()ident(pending)operator(\)) operator({) comment(/* no blocking if there's buffered data */) - ident(timerec)operator(.)ident(tv_sec) operator(=) ident(timerec)operator(.)ident(tv_usec) operator(=) integer(0)operator(;) - ident(tp) operator(=) operator(&)ident(timerec)operator(;) - operator(}) - operator(}) - reserved(else) - ident(rp) operator(=) integer(0)operator(;) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(write)operator(\)\)) operator({) - ident(Check_Type)operator(()ident(write)operator(,) ident(T_ARRAY)operator(\);) - ident(wp) operator(=) operator(&)ident(wset)operator(;) - ident(FD_ZERO)operator(()ident(wp)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(write)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(GetOpenFile)operator(()ident(rb_io_get_io)operator(()ident(RARRAY)operator(()ident(write)operator(\)->)ident(ptr)operator([)ident(i)operator(]\),) ident(fptr)operator(\);) - ident(FD_SET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(wp)operator(\);) - reserved(if) operator(()ident(max) operator(<) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) ident(max) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\);) - reserved(if) operator(()ident(fptr)operator(->)ident(f2)operator(\)) operator({) - ident(FD_SET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\),) ident(wp)operator(\);) - reserved(if) operator(()ident(max) operator(<) ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\)\)) ident(max) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\);) - operator(}) - operator(}) - operator(}) - reserved(else) - ident(wp) operator(=) integer(0)operator(;) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(except)operator(\)\)) operator({) - ident(Check_Type)operator(()ident(except)operator(,) ident(T_ARRAY)operator(\);) - ident(ep) operator(=) operator(&)ident(eset)operator(;) - ident(FD_ZERO)operator(()ident(ep)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(except)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(GetOpenFile)operator(()ident(rb_io_get_io)operator(()ident(RARRAY)operator(()ident(except)operator(\)->)ident(ptr)operator([)ident(i)operator(]\),) ident(fptr)operator(\);) - ident(FD_SET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(ep)operator(\);) - reserved(if) operator(()ident(max) operator(<) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\)\)) ident(max) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\);) - reserved(if) operator(()ident(fptr)operator(->)ident(f2)operator(\)) operator({) - ident(FD_SET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\),) ident(ep)operator(\);) - reserved(if) operator(()ident(max) operator(<) ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\)\)) ident(max) operator(=) ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\);) - operator(}) - operator(}) - operator(}) - reserved(else) operator({) - ident(ep) operator(=) integer(0)operator(;) - operator(}) - - ident(max)operator(++;) - - ident(n) operator(=) ident(rb_thread_select)operator(()ident(max)operator(,) ident(rp)operator(,) ident(wp)operator(,) ident(ep)operator(,) ident(tp)operator(\);) - reserved(if) operator(()ident(n) operator(<) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - reserved(if) operator((!)ident(pending) operator(&&) ident(n) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) comment(/* returns nil on timeout */) - - ident(res) operator(=) ident(rb_ary_new2)operator(()integer(3)operator(\);) - ident(rb_ary_push)operator(()ident(res)operator(,) ident(rp)operator(?)ident(rb_ary_new)operator((\):)ident(rb_ary_new2)operator(()integer(0)operator(\)\);) - ident(rb_ary_push)operator(()ident(res)operator(,) ident(wp)operator(?)ident(rb_ary_new)operator((\):)ident(rb_ary_new2)operator(()integer(0)operator(\)\);) - ident(rb_ary_push)operator(()ident(res)operator(,) ident(ep)operator(?)ident(rb_ary_new)operator((\):)ident(rb_ary_new2)operator(()integer(0)operator(\)\);) - - reserved(if) operator(()ident(interrupt_flag) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(rp)operator(\)) operator({) - ident(list) operator(=) ident(RARRAY)operator(()ident(res)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<) ident(RARRAY)operator(()ident(read)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(GetOpenFile)operator(()ident(rb_io_get_io)operator(()ident(RARRAY)operator(()ident(read)operator(\)->)ident(ptr)operator([)ident(i)operator(]\),) ident(fptr)operator(\);) - reserved(if) operator(()ident(FD_ISSET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(rp)operator(\)) - operator(||) ident(FD_ISSET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) operator(&)ident(pset)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(list)operator(,) ident(rb_ary_entry)operator(()ident(read)operator(,) ident(i)operator(\)\);) - operator(}) - operator(}) - operator(}) - - reserved(if) operator(()ident(wp)operator(\)) operator({) - ident(list) operator(=) ident(RARRAY)operator(()ident(res)operator(\)->)ident(ptr)operator([)integer(1)operator(];) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<) ident(RARRAY)operator(()ident(write)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(GetOpenFile)operator(()ident(rb_io_get_io)operator(()ident(RARRAY)operator(()ident(write)operator(\)->)ident(ptr)operator([)ident(i)operator(]\),) ident(fptr)operator(\);) - reserved(if) operator(()ident(FD_ISSET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(wp)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(list)operator(,) ident(rb_ary_entry)operator(()ident(write)operator(,) ident(i)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(fptr)operator(->)ident(f2) operator(&&) ident(FD_ISSET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\),) ident(wp)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(list)operator(,) ident(rb_ary_entry)operator(()ident(write)operator(,) ident(i)operator(\)\);) - operator(}) - operator(}) - operator(}) - - reserved(if) operator(()ident(ep)operator(\)) operator({) - ident(list) operator(=) ident(RARRAY)operator(()ident(res)operator(\)->)ident(ptr)operator([)integer(2)operator(];) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<) ident(RARRAY)operator(()ident(except)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(GetOpenFile)operator(()ident(rb_io_get_io)operator(()ident(RARRAY)operator(()ident(except)operator(\)->)ident(ptr)operator([)ident(i)operator(]\),) ident(fptr)operator(\);) - reserved(if) operator(()ident(FD_ISSET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(ep)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(list)operator(,) ident(rb_ary_entry)operator(()ident(except)operator(,) ident(i)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(fptr)operator(->)ident(f2) operator(&&) ident(FD_ISSET)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\),) ident(ep)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(list)operator(,) ident(rb_ary_entry)operator(()ident(except)operator(,) ident(i)operator(\)\);) - operator(}) - operator(}) - operator(}) - operator(}) - - reserved(return) ident(res)operator(;) comment(/* returns an empty array on interrupt */) -operator(}) - -preprocessor(#if) operator(!)ident(defined)operator(()ident(MSDOS)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__human68k__)operator(\)) -directive(static) pre_type(int) -ident(io_cntl)operator(()ident(fd)operator(,) ident(cmd)operator(,) ident(narg)operator(,) ident(io_p)operator(\)) - pre_type(int) ident(fd)operator(,) ident(cmd)operator(,) ident(io_p)operator(;) - pre_type(long) ident(narg)operator(;) -operator({) - pre_type(int) ident(retval)operator(;) - -preprocessor(#ifdef) ident(HAVE_FCNTL) - ident(TRAP_BEG)operator(;) -preprocessor(# if) ident(defined)operator(()ident(__CYGWIN__)operator(\)) - ident(retval) operator(=) ident(io_p)operator(?)ident(ioctl)operator(()ident(fd)operator(,) ident(cmd)operator(,) operator(()directive(void)operator(*\))ident(narg)operator(\):)ident(fcntl)operator(()ident(fd)operator(,) ident(cmd)operator(,) ident(narg)operator(\);) -preprocessor(# else) - ident(retval) operator(=) ident(io_p)operator(?)ident(ioctl)operator(()ident(fd)operator(,) ident(cmd)operator(,) ident(narg)operator(\):)ident(fcntl)operator(()ident(fd)operator(,) ident(cmd)operator(,) ident(narg)operator(\);) -preprocessor(# endif) - ident(TRAP_END)operator(;) -preprocessor(#else) - reserved(if) operator((!)ident(io_p)operator(\)) operator({) - ident(rb_notimplement)operator((\);) - operator(}) - ident(TRAP_BEG)operator(;) - ident(retval) operator(=) ident(ioctl)operator(()ident(fd)operator(,) ident(cmd)operator(,) ident(narg)operator(\);) - ident(TRAP_END)operator(;) -preprocessor(#endif) - reserved(return) ident(retval)operator(;) -operator(}) -preprocessor(#endif) - -directive(static) ident(VALUE) -ident(rb_io_ctl)operator(()ident(io)operator(,) ident(req)operator(,) ident(arg)operator(,) ident(io_p)operator(\)) - ident(VALUE) ident(io)operator(,) ident(req)operator(,) ident(arg)operator(;) - pre_type(int) ident(io_p)operator(;) -operator({) -preprocessor(#if) operator(!)ident(defined)operator(()ident(MSDOS)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__human68k__)operator(\)) - pre_type(int) ident(cmd) operator(=) ident(NUM2ULONG)operator(()ident(req)operator(\);) - ident(OpenFile) operator(*)ident(fptr)operator(;) - pre_type(long) ident(len) operator(=) integer(0)operator(;) - pre_type(long) ident(narg) operator(=) integer(0)operator(;) - pre_type(int) ident(retval)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(arg)operator(\)) operator(||) ident(arg) operator(==) ident(Qfalse)operator(\)) operator({) - ident(narg) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(FIXNUM_P)operator(()ident(arg)operator(\)\)) operator({) - ident(narg) operator(=) ident(FIX2LONG)operator(()ident(arg)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(arg) operator(==) ident(Qtrue)operator(\)) operator({) - ident(narg) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(tmp) operator(=) ident(rb_check_string_type)operator(()ident(arg)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - ident(narg) operator(=) ident(NUM2LONG)operator(()ident(arg)operator(\);) - operator(}) - reserved(else) operator({) - ident(arg) operator(=) ident(tmp)operator(;) -preprocessor(#ifdef) ident(IOCPARM_MASK) -preprocessor(#ifndef) ident(IOCPARM_LEN) -preprocessor(#define) ident(IOCPARM_LEN)operator(()ident(x)operator(\)) operator(((()ident(x)operator(\)) operator(>>) integer(16)operator(\)) operator(&) ident(IOCPARM_MASK)operator(\)) -preprocessor(#endif) -preprocessor(#endif) -preprocessor(#ifdef) ident(IOCPARM_LEN) - ident(len) operator(=) ident(IOCPARM_LEN)operator(()ident(cmd)operator(\);) comment(/* on BSDish systems we're safe */) -preprocessor(#else) - ident(len) operator(=) integer(256)operator(;) comment(/* otherwise guess at what's safe */) -preprocessor(#endif) - ident(rb_str_modify)operator(()ident(arg)operator(\);) - - reserved(if) operator(()ident(len) operator(<=) ident(RSTRING)operator(()ident(arg)operator(\)->)ident(len)operator(\)) operator({) - ident(len) operator(=) ident(RSTRING)operator(()ident(arg)operator(\)->)ident(len)operator(;) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(arg)operator(\)->)ident(len) operator(<) ident(len)operator(\)) operator({) - ident(rb_str_resize)operator(()ident(arg)operator(,) ident(len)operator(+)integer(1)operator(\);) - operator(}) - ident(RSTRING)operator(()ident(arg)operator(\)->)ident(ptr)operator([)ident(len)operator(]) operator(=) integer(17)operator(;) comment(/* a little sanity check here */) - ident(narg) operator(=) operator(()pre_type(long)operator(\))ident(RSTRING)operator(()ident(arg)operator(\)->)ident(ptr)operator(;) - operator(}) - operator(}) - ident(GetOpenFile)operator(()ident(io)operator(,) ident(fptr)operator(\);) - ident(retval) operator(=) ident(io_cntl)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\),) ident(cmd)operator(,) ident(narg)operator(,) ident(io_p)operator(\);) - reserved(if) operator(()ident(retval) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()ident(fptr)operator(->)ident(path)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(arg)operator(\)) operator(==) ident(T_STRING) operator(&&) ident(RSTRING)operator(()ident(arg)operator(\)->)ident(ptr)operator([)ident(len)operator(]) operator(!=) integer(17)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(fptr)operator(->)ident(f2) operator(&&) ident(fileno)operator(()ident(fptr)operator(->)ident(f)operator(\)) operator(!=) ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\)\)) operator({) - comment(/* call on f2 too; ignore result */) - ident(io_cntl)operator(()ident(fileno)operator(()ident(fptr)operator(->)ident(f2)operator(\),) ident(cmd)operator(,) ident(narg)operator(,) ident(io_p)operator(\);) - operator(}) - - reserved(if) operator((!)ident(io_p) operator(&&) ident(cmd) operator(==) ident(F_SETFL)operator(\)) operator({) - reserved(if) operator(()ident(narg) operator(&) ident(O_NONBLOCK)operator(\)) operator({) - ident(fptr)operator(->)ident(mode) operator(|=) ident(FMODE_WSPLIT_INITIALIZED)operator(;) - ident(fptr)operator(->)ident(mode) operator(&=) operator(~)ident(FMODE_WSPLIT)operator(;) - operator(}) - reserved(else) operator({) - ident(fptr)operator(->)ident(mode) operator(&=) operator(~()ident(FMODE_WSPLIT_INITIALIZED)operator(|)ident(FMODE_WSPLIT)operator(\);) - operator(}) - operator(}) - - reserved(return) ident(INT2NUM)operator(()ident(retval)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * ios.ioctl(integer_cmd, arg\) => integer - * - * Provides a mechanism for issuing low-level commands to control or - * query I/O devices. Arguments and results are platform dependent. If - * arg is a number, its value is passed directly. If it is a - * string, it is interpreted as a binary sequence of bytes. On Unix - * platforms, see ioctl(2\) for details. Not implemented on - * all platforms. - */) - -directive(static) ident(VALUE) -ident(rb_io_ioctl)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(req)operator(,) ident(arg)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(req)operator(,) operator(&)ident(arg)operator(\);) - reserved(return) ident(rb_io_ctl)operator(()ident(io)operator(,) ident(req)operator(,) ident(arg)operator(,) integer(1)operator(\);) -operator(}) - -comment(/* - * call-seq: - * ios.fcntl(integer_cmd, arg\) => integer - * - * Provides a mechanism for issuing low-level commands to control or - * query file-oriented I/O streams. Arguments and results are platform - * dependent. If arg is a number, its value is passed - * directly. If it is a string, it is interpreted as a binary sequence - * of bytes (Array#pack might be a useful way to build this - * string\). On Unix platforms, see fcntl(2\) for details. - * Not implemented on all platforms. - */) - -directive(static) ident(VALUE) -ident(rb_io_fcntl)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_FCNTL) - ident(VALUE) ident(req)operator(,) ident(arg)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(req)operator(,) operator(&)ident(arg)operator(\);) - reserved(return) ident(rb_io_ctl)operator(()ident(io)operator(,) ident(req)operator(,) ident(arg)operator(,) integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * syscall(fixnum [, args...]\) => integer - * - * Calls the operating system function identified by _fixnum_, - * passing in the arguments, which must be either +String+ - * objects, or +Integer+ objects that ultimately fit within - * a native +long+. Up to nine parameters may be passed (14 - * on the Atari-ST\). The function identified by _fixnum_ is system - * dependent. On some Unix systems, the numbers may be obtained from a - * header file called syscall.h. - * - * syscall 4, 1, "hello\\n", 6 # '4' is write(2\) on our box - * - * produces: - * - * hello - */) - -directive(static) ident(VALUE) -ident(rb_f_syscall)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SYSCALL)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) -preprocessor(#ifdef) ident(atarist) - pre_type(unsigned) pre_type(long) ident(arg)operator([)integer(14)operator(];) comment(/* yes, we really need that many ! */) -preprocessor(#else) - pre_type(unsigned) pre_type(long) ident(arg)operator([)integer(8)operator(];) -preprocessor(#endif) - pre_type(int) ident(retval) operator(=) operator(-)integer(1)operator(;) - pre_type(int) ident(i) operator(=) integer(1)operator(;) - pre_type(int) ident(items) operator(=) ident(argc) operator(-) integer(1)operator(;) - - comment(/* This probably won't work on machines where sizeof(long\) != sizeof(int\) - * or where sizeof(long\) != sizeof(char*\). But such machines will - * not likely have syscall implemented either, so who cares? - */) - - ident(rb_secure)operator(()integer(2)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(argc) operator(>) reserved(sizeof)operator(()ident(arg)operator(\)) operator(/) reserved(sizeof)operator(()ident(arg)operator([)integer(0)operator(]\)\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - ident(arg)operator([)integer(0)operator(]) operator(=) ident(NUM2LONG)operator(()ident(argv)operator([)integer(0)operator(]\);) ident(argv)operator(++;) - reserved(while) operator(()ident(items)operator(--\)) operator({) - ident(VALUE) ident(v) operator(=) ident(rb_check_string_type)operator((*)ident(argv)operator(\);) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(v)operator(\)\)) operator({) - ident(StringValue)operator(()ident(v)operator(\);) - ident(rb_str_modify)operator(()ident(v)operator(\);) - ident(arg)operator([)ident(i)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(long)operator(\))ident(StringValueCStr)operator(()ident(v)operator(\);) - operator(}) - reserved(else) operator({) - ident(arg)operator([)ident(i)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(long)operator(\))ident(NUM2LONG)operator((*)ident(argv)operator(\);) - operator(}) - ident(argv)operator(++;) - ident(i)operator(++;) - operator(}) - ident(TRAP_BEG)operator(;) - reserved(switch) operator(()ident(argc)operator(\)) operator({) - reserved(case) integer(1)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(2)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(3)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(4)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(],)ident(arg)operator([)integer(3)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(5)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(],)ident(arg)operator([)integer(3)operator(],)ident(arg)operator([)integer(4)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(6)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(],)ident(arg)operator([)integer(3)operator(],)ident(arg)operator([)integer(4)operator(],)ident(arg)operator([)integer(5)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(7)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(],)ident(arg)operator([)integer(3)operator(],)ident(arg)operator([)integer(4)operator(],)ident(arg)operator([)integer(5)operator(],)ident(arg)operator([)integer(6)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(8)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(],)ident(arg)operator([)integer(3)operator(],)ident(arg)operator([)integer(4)operator(],)ident(arg)operator([)integer(5)operator(],)ident(arg)operator([)integer(6)operator(],) - ident(arg)operator([)integer(7)operator(]\);) - reserved(break)operator(;) -preprocessor(#ifdef) ident(atarist) - reserved(case) integer(9)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(],)ident(arg)operator([)integer(3)operator(],)ident(arg)operator([)integer(4)operator(],)ident(arg)operator([)integer(5)operator(],)ident(arg)operator([)integer(6)operator(],) - ident(arg)operator([)integer(7)operator(],) ident(arg)operator([)integer(8)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(10)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(],)ident(arg)operator([)integer(3)operator(],)ident(arg)operator([)integer(4)operator(],)ident(arg)operator([)integer(5)operator(],)ident(arg)operator([)integer(6)operator(],) - ident(arg)operator([)integer(7)operator(],) ident(arg)operator([)integer(8)operator(],) ident(arg)operator([)integer(9)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(11)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(],)ident(arg)operator([)integer(3)operator(],)ident(arg)operator([)integer(4)operator(],)ident(arg)operator([)integer(5)operator(],)ident(arg)operator([)integer(6)operator(],) - ident(arg)operator([)integer(7)operator(],) ident(arg)operator([)integer(8)operator(],) ident(arg)operator([)integer(9)operator(],) ident(arg)operator([)integer(10)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(12)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(],)ident(arg)operator([)integer(3)operator(],)ident(arg)operator([)integer(4)operator(],)ident(arg)operator([)integer(5)operator(],)ident(arg)operator([)integer(6)operator(],) - ident(arg)operator([)integer(7)operator(],) ident(arg)operator([)integer(8)operator(],) ident(arg)operator([)integer(9)operator(],) ident(arg)operator([)integer(10)operator(],) ident(arg)operator([)integer(11)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(13)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(],)ident(arg)operator([)integer(3)operator(],)ident(arg)operator([)integer(4)operator(],)ident(arg)operator([)integer(5)operator(],)ident(arg)operator([)integer(6)operator(],) - ident(arg)operator([)integer(7)operator(],) ident(arg)operator([)integer(8)operator(],) ident(arg)operator([)integer(9)operator(],) ident(arg)operator([)integer(10)operator(],) ident(arg)operator([)integer(11)operator(],) ident(arg)operator([)integer(12)operator(]\);) - reserved(break)operator(;) - reserved(case) integer(14)operator(:) - ident(retval) operator(=) ident(syscall)operator(()ident(arg)operator([)integer(0)operator(],)ident(arg)operator([)integer(1)operator(],)ident(arg)operator([)integer(2)operator(],)ident(arg)operator([)integer(3)operator(],)ident(arg)operator([)integer(4)operator(],)ident(arg)operator([)integer(5)operator(],)ident(arg)operator([)integer(6)operator(],) - ident(arg)operator([)integer(7)operator(],) ident(arg)operator([)integer(8)operator(],) ident(arg)operator([)integer(9)operator(],) ident(arg)operator([)integer(10)operator(],) ident(arg)operator([)integer(11)operator(],) ident(arg)operator([)integer(12)operator(],) ident(arg)operator([)integer(13)operator(]\);) - reserved(break)operator(;) -preprocessor(#endif) comment(/* atarist */) - operator(}) - ident(TRAP_END)operator(;) - reserved(if) operator(()ident(retval) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(return) ident(INT2NUM)operator(()ident(retval)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -preprocessor(#endif) -operator(}) - -directive(static) ident(VALUE) ident(io_new_instance) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(io_new_instance)operator(()ident(args)operator(\)) - ident(VALUE) ident(args)operator(;) -operator({) - reserved(return) ident(rb_class_new_instance)operator(()integer(2)operator(,) operator(()ident(VALUE)operator(*\))ident(args)operator(+)integer(1)operator(,) operator(*()ident(VALUE)operator(*\))ident(args)operator(\);) -operator(}) - -comment(/* - * call-seq: - * IO.pipe -> array - * - * Creates a pair of pipe endpoints (connected to each other\) and - * returns them as a two-element array of IO objects: - * [ read_file, write_file ]. Not - * available on all platforms. - * - * In the example below, the two processes close the ends of the pipe - * that they are not using. This is not just a cosmetic nicety. The - * read end of a pipe will not generate an end of file condition if - * there are any writers with the pipe still open. In the case of the - * parent process, the rd.read will never return if it - * does not first issue a wr.close. - * - * rd, wr = IO.pipe - * - * if fork - * wr.close - * puts "Parent got: <#{rd.read}>" - * rd.close - * Process.wait - * else - * rd.close - * puts "Sending message to parent" - * wr.write "Hi Dad" - * wr.close - * end - * - * produces: - * - * Sending message to parent - * Parent got: - */) - -directive(static) ident(VALUE) -ident(rb_io_s_pipe)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) -preprocessor(#ifndef) ident(__human68k__) - pre_type(int) ident(pipes)operator([)integer(2)operator(],) ident(state)operator(;) - ident(VALUE) ident(r)operator(,) ident(w)operator(,) ident(args)operator([)integer(3)operator(];) - -preprocessor(#ifdef) ident(_WIN32) - reserved(if) operator(()ident(_pipe)operator(()ident(pipes)operator(,) integer(1024)operator(,) ident(O_BINARY)operator(\)) operator(==) operator(-)integer(1)operator(\)) -preprocessor(#else) - reserved(if) operator(()ident(pipe)operator(()ident(pipes)operator(\)) operator(==) operator(-)integer(1)operator(\)) -preprocessor(#endif) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - - ident(args)operator([)integer(0)operator(]) operator(=) ident(klass)operator(;) - ident(args)operator([)integer(1)operator(]) operator(=) ident(INT2NUM)operator(()ident(pipes)operator([)integer(0)operator(]\);) - ident(args)operator([)integer(2)operator(]) operator(=) ident(INT2FIX)operator(()ident(O_RDONLY)operator(\);) - ident(r) operator(=) ident(rb_protect)operator(()ident(io_new_instance)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(,) operator(&)ident(state)operator(\);) - reserved(if) operator(()ident(state)operator(\)) operator({) - ident(close)operator(()ident(pipes)operator([)integer(0)operator(]\);) - ident(close)operator(()ident(pipes)operator([)integer(1)operator(]\);) - ident(rb_jump_tag)operator(()ident(state)operator(\);) - operator(}) - ident(args)operator([)integer(1)operator(]) operator(=) ident(INT2NUM)operator(()ident(pipes)operator([)integer(1)operator(]\);) - ident(args)operator([)integer(2)operator(]) operator(=) ident(INT2FIX)operator(()ident(O_WRONLY)operator(\);) - ident(w) operator(=) ident(rb_protect)operator(()ident(io_new_instance)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(,) operator(&)ident(state)operator(\);) - reserved(if) operator(()ident(state)operator(\)) operator({) - ident(close)operator(()ident(pipes)operator([)integer(1)operator(]\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(r)operator(\)\)) ident(rb_io_close)operator(()ident(r)operator(\);) - ident(rb_jump_tag)operator(()ident(state)operator(\);) - operator(}) - ident(rb_io_synchronized)operator(()ident(RFILE)operator(()ident(w)operator(\)->)ident(fptr)operator(\);) - - reserved(return) ident(rb_assoc_new)operator(()ident(r)operator(,) ident(w)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -preprocessor(#endif) -operator(}) - -reserved(struct) ident(foreach_arg) operator({) - pre_type(int) ident(argc)operator(;) - ident(VALUE) ident(sep)operator(;) - ident(VALUE) ident(io)operator(;) -operator(};) - -directive(static) ident(VALUE) -ident(io_s_foreach)operator(()ident(arg)operator(\)) - reserved(struct) ident(foreach_arg) operator(*)ident(arg)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - - reserved(while) operator((!)ident(NIL_P)operator(()ident(str) operator(=) ident(rb_io_getline)operator(()ident(arg)operator(->)ident(sep)operator(,) ident(arg)operator(->)ident(io)operator(\)\)\)) operator({) - ident(rb_yield)operator(()ident(str)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * IO.foreach(name, sep_string=$/\) {|line| block } => nil - * - * Executes the block for every line in the named I/O port, where lines - * are separated by sep_string. - * - * IO.foreach("testfile"\) {|x| print "GOT ", x } - * - * produces: - * - * GOT This is line one - * GOT This is line two - * GOT This is line three - * GOT And so on... - */) - -directive(static) ident(VALUE) -ident(rb_io_s_foreach)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(fname)operator(;) - reserved(struct) ident(foreach_arg) ident(arg)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(fname)operator(,) operator(&)ident(arg)operator(.)ident(sep)operator(\);) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - - reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - ident(arg)operator(.)ident(sep) operator(=) ident(rb_default_rs)operator(;) - operator(}) - reserved(else) reserved(if) operator((!)ident(NIL_P)operator(()ident(arg)operator(.)ident(sep)operator(\)\)) operator({) - ident(StringValue)operator(()ident(arg)operator(.)ident(sep)operator(\);) - operator(}) - ident(arg)operator(.)ident(io) operator(=) ident(rb_io_open)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) stringoperator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(arg)operator(.)ident(io)operator(\)\)) reserved(return) ident(Qnil)operator(;) - - reserved(return) ident(rb_ensure)operator(()ident(io_s_foreach)operator(,) operator(()ident(VALUE)operator(\)&)ident(arg)operator(,) ident(rb_io_close)operator(,) ident(arg)operator(.)ident(io)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(io_s_readlines)operator(()ident(arg)operator(\)) - reserved(struct) ident(foreach_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(return) ident(rb_io_readlines)operator(()ident(arg)operator(->)ident(argc)operator(,) operator(&)ident(arg)operator(->)ident(sep)operator(,) ident(arg)operator(->)ident(io)operator(\);) -operator(}) - -comment(/* - * call-seq: - * IO.readlines(name, sep_string=$/\) => array - * - * Reads the entire file specified by name as individual - * lines, and returns those lines in an array. Lines are separated by - * sep_string. - * - * a = IO.readlines("testfile"\) - * a[0] #=> "This is line one\\n" - * - */) - -directive(static) ident(VALUE) -ident(rb_io_s_readlines)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(fname)operator(;) - reserved(struct) ident(foreach_arg) ident(arg)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(fname)operator(,) operator(&)ident(arg)operator(.)ident(sep)operator(\);) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - - ident(arg)operator(.)ident(argc) operator(=) ident(argc) operator(-) integer(1)operator(;) - ident(arg)operator(.)ident(io) operator(=) ident(rb_io_open)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) stringoperator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(arg)operator(.)ident(io)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(rb_ensure)operator(()ident(io_s_readlines)operator(,) operator(()ident(VALUE)operator(\)&)ident(arg)operator(,) ident(rb_io_close)operator(,) ident(arg)operator(.)ident(io)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(io_s_read)operator(()ident(arg)operator(\)) - reserved(struct) ident(foreach_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(return) ident(io_read)operator(()ident(arg)operator(->)ident(argc)operator(,) operator(&)ident(arg)operator(->)ident(sep)operator(,) ident(arg)operator(->)ident(io)operator(\);) -operator(}) - -comment(/* - * call-seq: - * IO.read(name, [length [, offset]] \) => string - * - * Opens the file, optionally seeks to the given offset, then returns - * length bytes (defaulting to the rest of the file\). - * read ensures the file is closed before returning. - * - * IO.read("testfile"\) #=> "This is line one\\nThis is line two\\nThis is line three\\nAnd so on...\\n" - * IO.read("testfile", 20\) #=> "This is line one\\nThi" - * IO.read("testfile", 20, 10\) #=> "ne one\\nThis is line " - */) - -directive(static) ident(VALUE) -ident(rb_io_s_read)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(io)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(io)operator(;) -operator({) - ident(VALUE) ident(fname)operator(,) ident(offset)operator(;) - reserved(struct) ident(foreach_arg) ident(arg)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(fname)operator(,) operator(&)ident(arg)operator(.)ident(sep)operator(,) operator(&)ident(offset)operator(\);) - ident(SafeStringValue)operator(()ident(fname)operator(\);) - - ident(arg)operator(.)ident(argc) operator(=) ident(argc) operator(?) integer(1) operator(:) integer(0)operator(;) - ident(arg)operator(.)ident(io) operator(=) ident(rb_io_open)operator(()ident(StringValueCStr)operator(()ident(fname)operator(\),) stringoperator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(arg)operator(.)ident(io)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator((!)ident(NIL_P)operator(()ident(offset)operator(\)\)) operator({) - ident(rb_io_seek)operator(()ident(arg)operator(.)ident(io)operator(,) ident(offset)operator(,) ident(SEEK_SET)operator(\);) - operator(}) - reserved(return) ident(rb_ensure)operator(()ident(io_s_read)operator(,) operator(()ident(VALUE)operator(\)&)ident(arg)operator(,) ident(rb_io_close)operator(,) ident(arg)operator(.)ident(io)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(argf_tell)operator((\)) -operator({) - reserved(if) operator((!)ident(next_argv)operator((\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(ARGF_FORWARD)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(return) ident(rb_io_tell)operator(()ident(current_file)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(argf_seek_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - reserved(if) operator((!)ident(next_argv)operator((\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(ARGF_FORWARD)operator(()ident(argc)operator(,) ident(argv)operator(\);) - reserved(return) ident(rb_io_seek_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(current_file)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(argf_set_pos)operator(()ident(self)operator(,) ident(offset)operator(\)) - ident(VALUE) ident(self)operator(,) ident(offset)operator(;) -operator({) - reserved(if) operator((!)ident(next_argv)operator((\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(ARGF_FORWARD)operator(()integer(1)operator(,) operator(&)ident(offset)operator(\);) - reserved(return) ident(rb_io_set_pos)operator(()ident(current_file)operator(,) ident(offset)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(argf_rewind)operator((\)) -operator({) - reserved(if) operator((!)ident(next_argv)operator((\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(ARGF_FORWARD)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(return) ident(rb_io_rewind)operator(()ident(current_file)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(argf_fileno)operator((\)) -operator({) - reserved(if) operator((!)ident(next_argv)operator((\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(ARGF_FORWARD)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(return) ident(rb_io_fileno)operator(()ident(current_file)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(argf_to_io)operator((\)) -operator({) - ident(next_argv)operator((\);) - ident(ARGF_FORWARD)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(return) ident(current_file)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_eof)operator((\)) -operator({) - reserved(if) operator(()ident(current_file)operator(\)) operator({) - reserved(if) operator(()ident(init_p) operator(==) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) - ident(ARGF_FORWARD)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(rb_io_eof)operator(()ident(current_file)operator(\)\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_read)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(,) ident(str)operator(,) ident(length)operator(;) - pre_type(long) ident(len) operator(=) integer(0)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(length)operator(,) operator(&)ident(str)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(length)operator(\)\)) operator({) - ident(len) operator(=) ident(NUM2LONG)operator(()ident(argv)operator([)integer(0)operator(]\);) - operator(}) - reserved(if) operator((!)ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(StringValue)operator(()ident(str)operator(\);) - ident(rb_str_resize)operator(()ident(str)operator(,)integer(0)operator(\);) - ident(argv)operator([)integer(1)operator(]) operator(=) ident(Qnil)operator(;) - operator(}) - - label(retry:) - reserved(if) operator((!)ident(next_argv)operator((\)\)) operator({) - reserved(return) ident(str)operator(;) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(current_file)operator(\)) operator(!=) ident(T_FILE)operator(\)) operator({) - ident(tmp) operator(=) ident(argf_forward)operator(()ident(argc)operator(,) ident(argv)operator(\);) - operator(}) - reserved(else) operator({) - ident(tmp) operator(=) ident(io_read)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(current_file)operator(\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(str)operator(\)\)) ident(str) operator(=) ident(tmp)operator(;) - reserved(else) reserved(if) operator((!)ident(NIL_P)operator(()ident(tmp)operator(\)\)) ident(rb_str_append)operator(()ident(str)operator(,) ident(tmp)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(tmp)operator(\)) operator(||) ident(NIL_P)operator(()ident(length)operator(\)\)) operator({) - reserved(if) operator(()ident(next_p) operator(!=) operator(-)integer(1)operator(\)) operator({) - ident(argf_close)operator(()ident(current_file)operator(\);) - ident(next_p) operator(=) integer(1)operator(;) - reserved(goto) ident(retry)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(argc) operator(>=) integer(1)operator(\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<) ident(len)operator(\)) operator({) - ident(len) operator(-=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(argv)operator([)integer(0)operator(]) operator(=) ident(INT2NUM)operator(()ident(len)operator(\);) - reserved(goto) ident(retry)operator(;) - operator(}) - operator(}) - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_getc)operator((\)) -operator({) - ident(VALUE) ident(byte)operator(;) - - label(retry:) - reserved(if) operator((!)ident(next_argv)operator((\)\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(current_file)operator(\)) operator(!=) ident(T_FILE)operator(\)) operator({) - ident(byte) operator(=) ident(rb_funcall3)operator(()ident(current_file)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(,) integer(0)operator(\);) - operator(}) - reserved(else) operator({) - ident(byte) operator(=) ident(rb_io_getc)operator(()ident(current_file)operator(\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(byte)operator(\)) operator(&&) ident(next_p) operator(!=) operator(-)integer(1)operator(\)) operator({) - ident(argf_close)operator(()ident(current_file)operator(\);) - ident(next_p) operator(=) integer(1)operator(;) - reserved(goto) ident(retry)operator(;) - operator(}) - - reserved(return) ident(byte)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_readchar)operator((\)) -operator({) - ident(VALUE) ident(c)operator(;) - - ident(NEXT_ARGF_FORWARD)operator(()integer(0)operator(,) integer(0)operator(\);) - ident(c) operator(=) ident(argf_getc)operator((\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(c)operator(\)\)) operator({) - ident(rb_eof_error)operator((\);) - operator(}) - reserved(return) ident(c)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_each_line)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - - reserved(if) operator((!)ident(next_argv)operator((\)\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(current_file)operator(\)) operator(!=) ident(T_FILE)operator(\)) operator({) - reserved(for) operator((;;\)) operator({) - reserved(if) operator((!)ident(next_argv)operator((\)\)) reserved(return) ident(argf)operator(;) - ident(rb_iterate)operator(()ident(rb_each)operator(,) ident(current_file)operator(,) ident(rb_yield)operator(,) integer(0)operator(\);) - ident(next_p) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(while) operator((!)ident(NIL_P)operator(()ident(str) operator(=) ident(argf_getline)operator(()ident(argc)operator(,) ident(argv)operator(\)\)\)) operator({) - ident(rb_yield)operator(()ident(str)operator(\);) - operator(}) - reserved(return) ident(argf)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_each_byte)operator((\)) -operator({) - ident(VALUE) ident(byte)operator(;) - - reserved(while) operator((!)ident(NIL_P)operator(()ident(byte) operator(=) ident(argf_getc)operator((\)\)\)) operator({) - ident(rb_yield)operator(()ident(byte)operator(\);) - operator(}) - reserved(return) ident(argf)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_filename)operator((\)) -operator({) - ident(next_argv)operator((\);) - reserved(return) ident(filename)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_file)operator((\)) -operator({) - ident(next_argv)operator((\);) - reserved(return) ident(current_file)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_binmode)operator((\)) -operator({) - ident(binmode) operator(=) integer(1)operator(;) - ident(next_argv)operator((\);) - ident(ARGF_FORWARD)operator(()integer(0)operator(,) integer(0)operator(\);) - ident(rb_io_binmode)operator(()ident(current_file)operator(\);) - reserved(return) ident(argf)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_skip)operator((\)) -operator({) - reserved(if) operator(()ident(next_p) operator(!=) operator(-)integer(1)operator(\)) operator({) - ident(argf_close)operator(()ident(current_file)operator(\);) - ident(next_p) operator(=) integer(1)operator(;) - operator(}) - reserved(return) ident(argf)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_close_m)operator((\)) -operator({) - ident(next_argv)operator((\);) - ident(argf_close)operator(()ident(current_file)operator(\);) - reserved(if) operator(()ident(next_p) operator(!=) operator(-)integer(1)operator(\)) operator({) - ident(next_p) operator(=) integer(1)operator(;) - operator(}) - ident(gets_lineno) operator(=) integer(0)operator(;) - reserved(return) ident(argf)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(argf_closed)operator((\)) -operator({) - ident(next_argv)operator((\);) - ident(ARGF_FORWARD)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(return) ident(rb_io_closed)operator(()ident(current_file)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(argf_to_s)operator((\)) -operator({) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(opt_i_get)operator((\)) -operator({) - reserved(if) operator((!)ident(ruby_inplace_mode)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(rb_str_new2)operator(()ident(ruby_inplace_mode)operator(\);) -operator(}) - -directive(static) directive(void) -ident(opt_i_set)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(if) operator((!)ident(RTEST)operator(()ident(val)operator(\)\)) operator({) - reserved(if) operator(()ident(ruby_inplace_mode)operator(\)) ident(free)operator(()ident(ruby_inplace_mode)operator(\);) - ident(ruby_inplace_mode) operator(=) integer(0)operator(;) - reserved(return)operator(;) - operator(}) - ident(StringValue)operator(()ident(val)operator(\);) - reserved(if) operator(()ident(ruby_inplace_mode)operator(\)) ident(free)operator(()ident(ruby_inplace_mode)operator(\);) - ident(ruby_inplace_mode) operator(=) integer(0)operator(;) - ident(ruby_inplace_mode) operator(=) ident(strdup)operator(()ident(StringValueCStr)operator(()ident(val)operator(\)\);) -operator(}) - -comment(/* - * Class IO is the basis for all input and output in Ruby. - * An I/O stream may be duplexed (that is, bidirectional\), and - * so may use more than one native operating system stream. - * - * Many of the examples in this section use class File, - * the only standard subclass of IO. The two classes are - * closely associated. - * - * As used in this section, portname may take any of the - * following forms. - * - * * A plain string represents a filename suitable for the underlying - * operating system. - * - * * A string starting with ``|'' indicates a subprocess. - * The remainder of the string following the ``|'' is - * invoked as a process with appropriate input/output channels - * connected to it. - * - * * A string equal to ``|-'' will create another Ruby - * instance as a subprocess. - * - * Ruby will convert pathnames between different operating system - * conventions if possible. For instance, on a Windows system the - * filename ``/gumby/ruby/test.rb'' will be opened as - * ``\\gumby\\ruby\\test.rb''. When specifying a - * Windows-style filename in a Ruby string, remember to escape the - * backslashes: - * - * "c:\\\\gumby\\\\ruby\\\\test.rb" - * - * Our examples here will use the Unix-style forward slashes; - * File::SEPARATOR can be used to get the - * platform-specific separator character. - * - * I/O ports may be opened in any one of several different modes, which - * are shown in this section as mode. The mode may - * either be a Fixnum or a String. If numeric, it should be - * one of the operating system specific constants (O_RDONLY, - * O_WRONLY, O_RDWR, O_APPEND and so on\). See man open(2\) for - * more information. - * - * If the mode is given as a String, it must be one of the - * values listed in the following table. - * - * Mode | Meaning - * -----+-------------------------------------------------------- - * "r" | Read-only, starts at beginning of file (default mode\). - * -----+-------------------------------------------------------- - * "r+" | Read-write, starts at beginning of file. - * -----+-------------------------------------------------------- - * "w" | Write-only, truncates existing file - * | to zero length or creates a new file for writing. - * -----+-------------------------------------------------------- - * "w+" | Read-write, truncates existing file to zero length - * | or creates a new file for reading and writing. - * -----+-------------------------------------------------------- - * "a" | Write-only, starts at end of file if file exists, - * | otherwise creates a new file for writing. - * -----+-------------------------------------------------------- - * "a+" | Read-write, starts at end of file if file exists, - * | otherwise creates a new file for reading and - * | writing. - * -----+-------------------------------------------------------- - * "b" | (DOS/Windows only\) Binary file mode (may appear with - * | any of the key letters listed above\). - * - * - * The global constant ARGF (also accessible as $<\) provides an - * IO-like stream which allows access to all files mentioned on the - * command line (or STDIN if no files are mentioned\). ARGF provides - * the methods #path and #filename to access - * the name of the file currently being read. - */) - -directive(void) -ident(Init_IO)operator((\)) -operator({) -preprocessor(#ifdef) ident(__CYGWIN__) -preprocessor(#include) include() - directive(static) reserved(struct) ident(__cygwin_perfile) ident(pf)operator([]) operator(=) - operator({) - operator({)stringoperator(,) ident(O_RDONLY) operator(|) ident(O_BINARY)operator(},) - operator({)stringoperator(,) ident(O_WRONLY) operator(|) ident(O_BINARY)operator(},) - operator({)stringoperator(,) ident(O_RDWR) operator(|) ident(O_BINARY)operator(},) - operator({)stringoperator(,) ident(O_APPEND) operator(|) ident(O_BINARY)operator(},) - operator({)pre_constant(NULL)operator(,) integer(0)operator(}) - operator(};) - ident(cygwin_internal)operator(()ident(CW_PERFILE)operator(,) ident(pf)operator(\);) -preprocessor(#endif) - - ident(rb_eIOError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_eEOFError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eIOError)operator(\);) - - ident(id_write) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_read) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_getc) operator(=) ident(rb_intern)operator(()stringoperator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_syscall)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_open)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_printf)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_print)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_putc)operator(,) integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_puts)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_gets)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_readline)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_getc)operator(,) integer(0)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_select)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_readlines)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_backquote)operator(,) integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_p)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_display)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_cIO) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_include_module)operator(()ident(rb_cIO)operator(,) ident(rb_mEnumerable)operator(\);) - - ident(rb_define_alloc_func)operator(()ident(rb_cIO)operator(,) ident(io_alloc)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_s_new)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_s_open)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_s_sysopen)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_s_for_fd)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_s_popen)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_s_foreach)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_s_readlines)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_s_read)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_f_select)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_s_pipe)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_initialize)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_output_fs) operator(=) ident(Qnil)operator(;) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(rb_output_fs)operator(,) integer(0)operator(,) ident(rb_str_setter)operator(\);) - - ident(rb_global_variable)operator((&)ident(rb_default_rs)operator(\);) - ident(rb_rs) operator(=) ident(rb_default_rs) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - ident(rb_output_rs) operator(=) ident(Qnil)operator(;) - ident(OBJ_FREEZE)operator(()ident(rb_default_rs)operator(\);) comment(/* avoid modifying RS_default */) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(rb_rs)operator(,) integer(0)operator(,) ident(rb_str_setter)operator(\);) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(rb_rs)operator(,) integer(0)operator(,) ident(rb_str_setter)operator(\);) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(rb_output_rs)operator(,) integer(0)operator(,) ident(rb_str_setter)operator(\);) - - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(lineno)operator(,) integer(0)operator(,) ident(lineno_setter)operator(\);) - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(rb_lastline_get)operator(,) ident(rb_lastline_set)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_init_copy)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_reopen)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_print)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_putc)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_puts)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_printf)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_each_line)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_each_line)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_each_byte)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_syswrite)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_sysread)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_fileno)operator(,) integer(0)operator(\);) - ident(rb_define_alias)operator(()ident(rb_cIO)operator(,) stringoperator(,) stringoperator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_to_io)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_fsync)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_sync)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_set_sync)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_lineno)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_set_lineno)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_readlines)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(io_read_nonblock)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_write_nonblock)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(io_readpartial)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(io_read)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(io_write)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_gets_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_readline)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_getc)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_readchar)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,)ident(rb_io_ungetc)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_addstr)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_flush)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_tell)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_seek_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_const)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(SEEK_SET)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(SEEK_CUR)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(SEEK_END)operator(\)\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_rewind)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_tell)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_set_pos)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_eof)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_eof)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_close_m)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_closed)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_close_read)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_close_write)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_isatty)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_isatty)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_binmode)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_sysseek)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_ioctl)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_fcntl)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_pid)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cIO)operator(,) stringoperator(,) ident(rb_io_inspect)operator(,) integer(0)operator(\);) - - ident(rb_define_variable)operator(()stringoperator(,) operator(&)ident(rb_stdin)operator(\);) - ident(rb_stdin) operator(=) ident(prep_stdio)operator(()ident(stdin)operator(,) ident(FMODE_READABLE)operator(,) ident(rb_cIO)operator(\);) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(rb_stdout)operator(,) integer(0)operator(,) ident(stdout_setter)operator(\);) - ident(rb_stdout) operator(=) ident(prep_stdio)operator(()ident(stdout)operator(,) ident(FMODE_WRITABLE)operator(,) ident(rb_cIO)operator(\);) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(rb_stderr)operator(,) integer(0)operator(,) ident(stdout_setter)operator(\);) - ident(rb_stderr) operator(=) ident(prep_stdio)operator(()ident(stderr)operator(,) ident(FMODE_WRITABLE)operator(,) ident(rb_cIO)operator(\);) - ident(rb_define_hooked_variable)operator(()string)delimiter(")>operator(,) operator(&)ident(rb_stdout)operator(,) integer(0)operator(,) ident(stdout_setter)operator(\);) - ident(orig_stdout) operator(=) ident(rb_stdout)operator(;) - ident(rb_deferr) operator(=) ident(orig_stderr) operator(=) ident(rb_stderr)operator(;) - - comment(/* variables to be removed in 1.8.1 */) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(rb_stdout)operator(,) integer(0)operator(,) ident(defout_setter)operator(\);) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(rb_stderr)operator(,) integer(0)operator(,) ident(deferr_setter)operator(\);) - - comment(/* constants to hold original stdin/stdout/stderr */) - ident(rb_define_global_const)operator(()stringoperator(,) ident(rb_stdin)operator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(rb_stdout)operator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(rb_stderr)operator(\);) - - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(argf)operator(\);) - ident(argf) operator(=) ident(rb_obj_alloc)operator(()ident(rb_cObject)operator(\);) - ident(rb_extend_object)operator(()ident(argf)operator(,) ident(rb_mEnumerable)operator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(argf)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_to_s)operator(,) integer(0)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_fileno)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_fileno)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_to_io)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_each_line)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_each_line)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_each_byte)operator(,) integer(0)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_read)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(rb_f_readlines)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(rb_f_readlines)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(rb_f_gets)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(rb_f_readline)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_getc)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_readchar)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_tell)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_seek_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_rewind)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_tell)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_set_pos)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_eof)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_eof)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_binmode)operator(,) integer(0)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_filename)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_filename)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_file)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_skip)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_close_m)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_closed)operator(,) integer(0)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_lineno)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(argf)operator(,) stringoperator(,) ident(argf_set_lineno)operator(,) integer(1)operator(\);) - - ident(rb_global_variable)operator((&)ident(current_file)operator(\);) - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(filename)operator(\);) - ident(filename) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(opt_i_get)operator(,) ident(opt_i_set)operator(\);) - -preprocessor(#if) ident(defined) operator(()ident(_WIN32)operator(\)) operator(||) ident(defined)operator(()ident(DJGPP)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN__)operator(\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) - ident(atexit)operator(()ident(pipe_atexit)operator(\);) -preprocessor(#endif) - - ident(Init_File)operator((\);) - - ident(rb_define_method)operator(()ident(rb_cFile)operator(,) stringoperator(,) ident(rb_file_initialize)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_RDONLY)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_WRONLY)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_RDWR)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_APPEND)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_CREAT)operator(\)\);) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_EXCL)operator(\)\);) -preprocessor(#if) ident(defined)operator(()ident(O_NDELAY)operator(\)) operator(||) ident(defined)operator(()ident(O_NONBLOCK)operator(\)) -preprocessor(# ifdef) ident(O_NONBLOCK) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_NONBLOCK)operator(\)\);) -preprocessor(# else) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_NDELAY)operator(\)\);) -preprocessor(# endif) -preprocessor(#endif) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_TRUNC)operator(\)\);) -preprocessor(#ifdef) ident(O_NOCTTY) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_NOCTTY)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(O_BINARY) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_BINARY)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(O_SYNC) - ident(rb_file_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(O_SYNC)operator(\)\);) -preprocessor(#endif) -operator(}) -comment(/* C code produced by gperf version 2.7.2 */) -comment(/* Command-line: gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' ./keywords */) -reserved(struct) ident(kwtable) operator({)pre_type(char) operator(*)ident(name)operator(;) pre_type(int) ident(id)operator([)integer(2)operator(];) reserved(enum) ident(lex_state) ident(state)operator(;};) - -preprocessor(#define) ident(TOTAL_KEYWORDS) integer(40) -preprocessor(#define) ident(MIN_WORD_LENGTH) integer(2) -preprocessor(#define) ident(MAX_WORD_LENGTH) integer(8) -preprocessor(#define) ident(MIN_HASH_VALUE) integer(6) -preprocessor(#define) ident(MAX_HASH_VALUE) integer(55) -comment(/* maximum key range = 50, duplicates = 0 */) - -preprocessor(#ifdef) ident(__GNUC__) -ident(__inline) -preprocessor(#else) -preprocessor(#ifdef) ident(__cplusplus) -directive(inline) -preprocessor(#endif) -preprocessor(#endif) -directive(static) pre_type(unsigned) pre_type(int) -ident(hash) operator(()ident(str)operator(,) ident(len)operator(\)) - directive(register) directive(const) pre_type(char) operator(*)ident(str)operator(;) - directive(register) pre_type(unsigned) pre_type(int) ident(len)operator(;) -operator({) - directive(static) pre_type(unsigned) pre_type(char) ident(asso_values)operator([]) operator(=) - operator({) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(11)operator(,) integer(56)operator(,) integer(56)operator(,) integer(36)operator(,) integer(56)operator(,) integer(1)operator(,) integer(37)operator(,) - integer(31)operator(,) integer(1)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(29)operator(,) integer(56)operator(,) integer(1)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(1)operator(,) integer(56)operator(,) integer(32)operator(,) integer(1)operator(,) integer(2)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(4)operator(,) integer(23)operator(,) integer(56)operator(,) integer(17)operator(,) integer(56)operator(,) integer(20)operator(,) integer(9)operator(,) integer(2)operator(,) - integer(9)operator(,) integer(26)operator(,) integer(14)operator(,) integer(56)operator(,) integer(5)operator(,) integer(1)operator(,) integer(1)operator(,) integer(16)operator(,) integer(56)operator(,) integer(21)operator(,) - integer(20)operator(,) integer(9)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) - integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56)operator(,) integer(56) - operator(};) - directive(register) pre_type(int) ident(hval) operator(=) ident(len)operator(;) - - reserved(switch) operator(()ident(hval)operator(\)) - operator({) - reserved(default)operator(:) - reserved(case) integer(3)operator(:) - ident(hval) operator(+=) ident(asso_values)operator([()pre_type(unsigned) pre_type(char)operator(\))ident(str)operator([)integer(2)operator(]];) - reserved(case) integer(2)operator(:) - reserved(case) integer(1)operator(:) - ident(hval) operator(+=) ident(asso_values)operator([()pre_type(unsigned) pre_type(char)operator(\))ident(str)operator([)integer(0)operator(]];) - reserved(break)operator(;) - operator(}) - reserved(return) ident(hval) operator(+) ident(asso_values)operator([()pre_type(unsigned) pre_type(char)operator(\))ident(str)operator([)ident(len) operator(-) integer(1)operator(]];) -operator(}) - -preprocessor(#ifdef) ident(__GNUC__) -ident(__inline) -preprocessor(#endif) -reserved(struct) ident(kwtable) operator(*) -ident(rb_reserved_word) operator(()ident(str)operator(,) ident(len)operator(\)) - directive(register) directive(const) pre_type(char) operator(*)ident(str)operator(;) - directive(register) pre_type(unsigned) pre_type(int) ident(len)operator(;) -operator({) - directive(static) reserved(struct) ident(kwtable) ident(wordlist)operator([]) operator(=) - operator({) - operator({)stringoperator(},) operator({)stringoperator(},) operator({)stringoperator(},) operator({)stringoperator(},) operator({)stringoperator(},) operator({)stringoperator(},) - operator({)stringoperator(,) operator({)ident(kEND)operator(,) ident(kEND)operator(},) ident(EXPR_END)operator(},) - operator({)stringoperator(,) operator({)ident(kELSE)operator(,) ident(kELSE)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kCASE)operator(,) ident(kCASE)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kENSURE)operator(,) ident(kENSURE)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kMODULE)operator(,) ident(kMODULE)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kELSIF)operator(,) ident(kELSIF)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kDEF)operator(,) ident(kDEF)operator(},) ident(EXPR_FNAME)operator(},) - operator({)stringoperator(,) operator({)ident(kRESCUE)operator(,) ident(kRESCUE_MOD)operator(},) ident(EXPR_MID)operator(},) - operator({)stringoperator(,) operator({)ident(kNOT)operator(,) ident(kNOT)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kTHEN)operator(,) ident(kTHEN)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kYIELD)operator(,) ident(kYIELD)operator(},) ident(EXPR_ARG)operator(},) - operator({)stringoperator(,) operator({)ident(kFOR)operator(,) ident(kFOR)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kSELF)operator(,) ident(kSELF)operator(},) ident(EXPR_END)operator(},) - operator({)stringoperator(,) operator({)ident(kFALSE)operator(,) ident(kFALSE)operator(},) ident(EXPR_END)operator(},) - operator({)stringoperator(,) operator({)ident(kRETRY)operator(,) ident(kRETRY)operator(},) ident(EXPR_END)operator(},) - operator({)stringoperator(,) operator({)ident(kRETURN)operator(,) ident(kRETURN)operator(},) ident(EXPR_MID)operator(},) - operator({)stringoperator(,) operator({)ident(kTRUE)operator(,) ident(kTRUE)operator(},) ident(EXPR_END)operator(},) - operator({)stringoperator(,) operator({)ident(kIF)operator(,) ident(kIF_MOD)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kDEFINED)operator(,) ident(kDEFINED)operator(},) ident(EXPR_ARG)operator(},) - operator({)stringoperator(,) operator({)ident(kSUPER)operator(,) ident(kSUPER)operator(},) ident(EXPR_ARG)operator(},) - operator({)stringoperator(,) operator({)ident(kUNDEF)operator(,) ident(kUNDEF)operator(},) ident(EXPR_FNAME)operator(},) - operator({)stringoperator(,) operator({)ident(kBREAK)operator(,) ident(kBREAK)operator(},) ident(EXPR_MID)operator(},) - operator({)stringoperator(,) operator({)ident(kIN)operator(,) ident(kIN)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kDO)operator(,) ident(kDO)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kNIL)operator(,) ident(kNIL)operator(},) ident(EXPR_END)operator(},) - operator({)stringoperator(,) operator({)ident(kUNTIL)operator(,) ident(kUNTIL_MOD)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kUNLESS)operator(,) ident(kUNLESS_MOD)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kOR)operator(,) ident(kOR)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kNEXT)operator(,) ident(kNEXT)operator(},) ident(EXPR_MID)operator(},) - operator({)stringoperator(,) operator({)ident(kWHEN)operator(,) ident(kWHEN)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kREDO)operator(,) ident(kREDO)operator(},) ident(EXPR_END)operator(},) - operator({)stringoperator(,) operator({)ident(kAND)operator(,) ident(kAND)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(kBEGIN)operator(,) ident(kBEGIN)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(,) operator({)ident(k__LINE__)operator(,) ident(k__LINE__)operator(},) ident(EXPR_END)operator(},) - operator({)stringoperator(,) operator({)ident(kCLASS)operator(,) ident(kCLASS)operator(},) ident(EXPR_CLASS)operator(},) - operator({)stringoperator(,) operator({)ident(k__FILE__)operator(,) ident(k__FILE__)operator(},) ident(EXPR_END)operator(},) - operator({)stringoperator(,) operator({)ident(klEND)operator(,) ident(klEND)operator(},) ident(EXPR_END)operator(},) - operator({)stringoperator(,) operator({)ident(klBEGIN)operator(,) ident(klBEGIN)operator(},) ident(EXPR_END)operator(},) - operator({)stringoperator(,) operator({)ident(kWHILE)operator(,) ident(kWHILE_MOD)operator(},) ident(EXPR_BEG)operator(},) - operator({)stringoperator(},) operator({)stringoperator(},) operator({)stringoperator(},) operator({)stringoperator(},) operator({)stringoperator(},) operator({)stringoperator(},) operator({)stringoperator(},) operator({)stringoperator(},) operator({)stringoperator(},) - operator({)stringoperator(},) - operator({)stringoperator(,) operator({)ident(kALIAS)operator(,) ident(kALIAS)operator(},) ident(EXPR_FNAME)operator(}) - operator(};) - - reserved(if) operator(()ident(len) operator(<=) ident(MAX_WORD_LENGTH) operator(&&) ident(len) operator(>=) ident(MIN_WORD_LENGTH)operator(\)) - operator({) - directive(register) pre_type(int) ident(key) operator(=) ident(hash) operator(()ident(str)operator(,) ident(len)operator(\);) - - reserved(if) operator(()ident(key) operator(<=) ident(MAX_HASH_VALUE) operator(&&) ident(key) operator(>=) integer(0)operator(\)) - operator({) - directive(register) directive(const) pre_type(char) operator(*)ident(s) operator(=) ident(wordlist)operator([)ident(key)operator(])operator(.)ident(name)operator(;) - - reserved(if) operator((*)ident(str) operator(==) operator(*)ident(s) operator(&&) operator(!)ident(strcmp) operator(()ident(str) operator(+) integer(1)operator(,) ident(s) operator(+) integer(1)operator(\)\)) - reserved(return) operator(&)ident(wordlist)operator([)ident(key)operator(];) - operator(}) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) -comment(/********************************************************************** - - main.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007\) $ - created at: Fri Aug 19 13:19:58 JST 1994 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") - -preprocessor(#ifdef) ident(__human68k__) -pre_type(int) ident(_stacksize) operator(=) integer(262144)operator(;) -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(__MINGW32__) -pre_type(int) ident(_CRT_glob) operator(=) integer(0)operator(;) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__MACOS__)operator(\)) operator(&&) ident(defined)operator(()ident(__MWERKS__)operator(\)) -preprocessor(#include) include() -preprocessor(#endif) - -comment(/* to link startup code with ObjC support */) -preprocessor(#if) operator(()ident(defined)operator(()ident(__APPLE__)operator(\)) operator(||) ident(defined)operator(()ident(__NeXT__)operator(\)\)) operator(&&) ident(defined)operator(()ident(__MACH__)operator(\)) -directive(static) directive(void) ident(objcdummyfunction)operator(() directive(void) operator(\)) operator({) ident(objc_msgSend)operator((\);) operator(}) -preprocessor(#endif) - -pre_type(int) -ident(main)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(envp)operator(\)) - pre_type(int) ident(argc)operator(;) - pre_type(char) operator(**)ident(argv)operator(,) operator(**)ident(envp)operator(;) -operator({) -preprocessor(#ifdef) ident(_WIN32) - ident(NtInitialize)operator((&)ident(argc)operator(,) operator(&)ident(argv)operator(\);) -preprocessor(#endif) -preprocessor(#if) ident(defined)operator(()ident(__MACOS__)operator(\)) operator(&&) ident(defined)operator(()ident(__MWERKS__)operator(\)) - ident(argc) operator(=) ident(ccommand)operator((&)ident(argv)operator(\);) -preprocessor(#endif) - - operator({) - ident(RUBY_INIT_STACK) - ident(ruby_init)operator((\);) - ident(ruby_options)operator(()ident(argc)operator(,) ident(argv)operator(\);) - ident(ruby_run)operator((\);) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) -comment(/********************************************************************** - - marshal.c - - - $Author: shyouhei $ - $Date: 2009-01-28 12:59:58 +0100 (Wed, 28 Jan 2009\) $ - created at: Thu Apr 27 16:30:01 JST 1995 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("rubyio.h") -preprocessor(#include) include("st.h") -preprocessor(#include) include("util.h") - -preprocessor(#include) include() -preprocessor(#ifdef) ident(HAVE_FLOAT_H) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#ifdef) ident(HAVE_IEEEFP_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#define) ident(BITSPERSHORT) operator(()integer(2)operator(*)ident(CHAR_BIT)operator(\)) -preprocessor(#define) ident(SHORTMASK) operator((()integer(1)operator(<<)ident(BITSPERSHORT)operator(\)-)integer(1)operator(\)) -preprocessor(#define) ident(SHORTDN)operator(()ident(x)operator(\)) ident(RSHIFT)operator(()ident(x)operator(,)ident(BITSPERSHORT)operator(\)) - -preprocessor(#if) ident(SIZEOF_SHORT) operator(==) ident(SIZEOF_BDIGITS) -preprocessor(#define) ident(SHORTLEN)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#else) -directive(static) pre_type(int) -ident(shortlen)operator(()ident(len)operator(,) ident(ds)operator(\)) - pre_type(long) ident(len)operator(;) - ident(BDIGIT) operator(*)ident(ds)operator(;) -operator({) - ident(BDIGIT) ident(num)operator(;) - pre_type(int) ident(offset) operator(=) integer(0)operator(;) - - ident(num) operator(=) ident(ds)operator([)ident(len)operator(-)integer(1)operator(];) - reserved(while) operator(()ident(num)operator(\)) operator({) - ident(num) operator(=) ident(SHORTDN)operator(()ident(num)operator(\);) - ident(offset)operator(++;) - operator(}) - reserved(return) operator(()ident(len) operator(-) integer(1)operator(\)*)reserved(sizeof)operator(()ident(BDIGIT)operator(\))operator(/)integer(2) operator(+) ident(offset)operator(;) -operator(}) -preprocessor(#define) ident(SHORTLEN)operator(()ident(x)operator(\)) ident(shortlen)operator((()ident(x)operator(\),)ident(d)operator(\)) -preprocessor(#endif) - -preprocessor(#define) ident(MARSHAL_MAJOR) integer(4) -preprocessor(#define) ident(MARSHAL_MINOR) integer(8) - -preprocessor(#define) ident(TYPE_NIL) char('0') -preprocessor(#define) ident(TYPE_TRUE) char('T') -preprocessor(#define) ident(TYPE_FALSE) char('F') -preprocessor(#define) ident(TYPE_FIXNUM) char('i') - -preprocessor(#define) ident(TYPE_EXTENDED) char('e') -preprocessor(#define) ident(TYPE_UCLASS) char('C') -preprocessor(#define) ident(TYPE_OBJECT) char('o') -preprocessor(#define) ident(TYPE_DATA) char('d') -preprocessor(#define) ident(TYPE_USERDEF) char('u') -preprocessor(#define) ident(TYPE_USRMARSHAL) char('U') -preprocessor(#define) ident(TYPE_FLOAT) char('f') -preprocessor(#define) ident(TYPE_BIGNUM) char('l') -preprocessor(#define) ident(TYPE_STRING) char('"') -preprocessor(#define) ident(TYPE_REGEXP) char('/') -preprocessor(#define) ident(TYPE_ARRAY) char('[') -preprocessor(#define) ident(TYPE_HASH) char('{') -preprocessor(#define) ident(TYPE_HASH_DEF) char('}') -preprocessor(#define) ident(TYPE_STRUCT) char('S') -preprocessor(#define) ident(TYPE_MODULE_OLD) char('M') -preprocessor(#define) ident(TYPE_CLASS) char('c') -preprocessor(#define) ident(TYPE_MODULE) char('m') - -preprocessor(#define) ident(TYPE_SYMBOL) char(':') -preprocessor(#define) ident(TYPE_SYMLINK) char(';') - -preprocessor(#define) ident(TYPE_IVAR) char('I') -preprocessor(#define) ident(TYPE_LINK) char('@') - -directive(static) ident(ID) ident(s_dump)operator(,) ident(s_load)operator(,) ident(s_mdump)operator(,) ident(s_mload)operator(;) -directive(static) ident(ID) ident(s_dump_data)operator(,) ident(s_load_data)operator(,) ident(s_alloc)operator(,) ident(s_call)operator(;) -directive(static) ident(ID) ident(s_getc)operator(,) ident(s_read)operator(,) ident(s_write)operator(,) ident(s_binmode)operator(;) - -reserved(struct) ident(dump_arg) operator({) - ident(VALUE) ident(obj)operator(;) - ident(VALUE) ident(str)operator(,) ident(dest)operator(;) - ident(st_table) operator(*)ident(symbols)operator(;) - ident(st_table) operator(*)ident(data)operator(;) - pre_type(int) ident(taint)operator(;) - ident(VALUE) ident(wrapper)operator(;) -operator(};) - -reserved(struct) ident(dump_call_arg) operator({) - ident(VALUE) ident(obj)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) - pre_type(int) ident(limit)operator(;) -operator(};) - -directive(static) directive(void) -ident(check_dump_arg)operator(()ident(arg)operator(,) ident(sym)operator(\)) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) - ident(ID) ident(sym)operator(;) -operator({) - reserved(if) operator((!)ident(DATA_PTR)operator(()ident(arg)operator(->)ident(wrapper)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(sym)operator(\)\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(mark_dump_arg)operator(()ident(ptr)operator(\)) - directive(void) operator(*)ident(ptr)operator(;) -operator({) - reserved(struct) ident(dump_arg) operator(*)ident(p) operator(=) ident(ptr)operator(;) - reserved(if) operator((!)ident(ptr)operator(\)) - reserved(return)operator(;) - ident(rb_mark_set)operator(()ident(p)operator(->)ident(data)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(class2path)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(path) operator(=) ident(rb_class_path)operator(()ident(klass)operator(\);) - pre_type(char) operator(*)ident(n) operator(=) ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(;) - - reserved(if) operator(()ident(n)operator([)integer(0)operator(]) operator(==) char('#')operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - operator(()ident(TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_CLASS) operator(?) string operator(:) stringoperator(\),) - ident(n)operator(\);) - operator(}) - reserved(if) operator(()ident(rb_path2class)operator(()ident(n)operator(\)) operator(!=) ident(rb_class_real)operator(()ident(klass)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(n)operator(\);) - operator(}) - reserved(return) ident(path)operator(;) -operator(}) - -directive(static) directive(void) ident(w_long) ident(_)operator((()pre_type(long)operator(,) reserved(struct) ident(dump_arg)operator(*\)\);) - -directive(static) directive(void) -ident(w_nbyte)operator(()ident(s)operator(,) ident(n)operator(,) ident(arg)operator(\)) - pre_type(char) operator(*)ident(s)operator(;) - pre_type(int) ident(n)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) -operator({) - ident(VALUE) ident(buf) operator(=) ident(arg)operator(->)ident(str)operator(;) - ident(rb_str_buf_cat)operator(()ident(buf)operator(,) ident(s)operator(,) ident(n)operator(\);) - reserved(if) operator(()ident(arg)operator(->)ident(dest) operator(&&) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(len) operator(>=) ident(BUFSIZ)operator(\)) operator({) - reserved(if) operator(()ident(arg)operator(->)ident(taint)operator(\)) ident(OBJ_TAINT)operator(()ident(buf)operator(\);) - ident(rb_io_write)operator(()ident(arg)operator(->)ident(dest)operator(,) ident(buf)operator(\);) - ident(rb_str_resize)operator(()ident(buf)operator(,) integer(0)operator(\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(w_byte)operator(()ident(c)operator(,) ident(arg)operator(\)) - pre_type(char) ident(c)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) -operator({) - ident(w_nbyte)operator((&)ident(c)operator(,) integer(1)operator(,) ident(arg)operator(\);) -operator(}) - -directive(static) directive(void) -ident(w_bytes)operator(()ident(s)operator(,) ident(n)operator(,) ident(arg)operator(\)) - pre_type(char) operator(*)ident(s)operator(;) - pre_type(int) ident(n)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) -operator({) - ident(w_long)operator(()ident(n)operator(,) ident(arg)operator(\);) - ident(w_nbyte)operator(()ident(s)operator(,) ident(n)operator(,) ident(arg)operator(\);) -operator(}) - -directive(static) directive(void) -ident(w_short)operator(()ident(x)operator(,) ident(arg)operator(\)) - pre_type(int) ident(x)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) -operator({) - ident(w_byte)operator((()ident(x) operator(>>) integer(0)operator(\)) operator(&) hex(0xff)operator(,) ident(arg)operator(\);) - ident(w_byte)operator((()ident(x) operator(>>) integer(8)operator(\)) operator(&) hex(0xff)operator(,) ident(arg)operator(\);) -operator(}) - -directive(static) directive(void) -ident(w_long)operator(()ident(x)operator(,) ident(arg)operator(\)) - pre_type(long) ident(x)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) -operator({) - pre_type(char) ident(buf)operator([)reserved(sizeof)operator(()pre_type(long)operator(\)+)integer(1)operator(];) - pre_type(int) ident(i)operator(,) ident(len) operator(=) integer(0)operator(;) - -preprocessor(#if) ident(SIZEOF_LONG) operator(>) integer(4) - reserved(if) operator((!()ident(RSHIFT)operator(()ident(x)operator(,) integer(31)operator(\)) operator(==) integer(0) operator(||) ident(RSHIFT)operator(()ident(x)operator(,) integer(31)operator(\)) operator(==) operator(-)integer(1)operator(\)\)) operator({) - comment(/* big long does not fit in 4 bytes */) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) -preprocessor(#endif) - - reserved(if) operator(()ident(x) operator(==) integer(0)operator(\)) operator({) - ident(w_byte)operator(()integer(0)operator(,) ident(arg)operator(\);) - reserved(return)operator(;) - operator(}) - reserved(if) operator(()integer(0) operator(<) ident(x) operator(&&) ident(x) operator(<) integer(123)operator(\)) operator({) - ident(w_byte)operator(()ident(x) operator(+) integer(5)operator(,) ident(arg)operator(\);) - reserved(return)operator(;) - operator(}) - reserved(if) operator((-)integer(124) operator(<) ident(x) operator(&&) ident(x) operator(<) integer(0)operator(\)) operator({) - ident(w_byte)operator((()ident(x) operator(-) integer(5)operator(\)&)hex(0xff)operator(,) ident(arg)operator(\);) - reserved(return)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(1)operator(;)ident(i)operator(<)reserved(sizeof)operator(()pre_type(long)operator(\)+)integer(1)operator(;)ident(i)operator(++\)) operator({) - ident(buf)operator([)ident(i)operator(]) operator(=) ident(x) operator(&) hex(0xff)operator(;) - ident(x) operator(=) ident(RSHIFT)operator(()ident(x)operator(,)integer(8)operator(\);) - reserved(if) operator(()ident(x) operator(==) integer(0)operator(\)) operator({) - ident(buf)operator([)integer(0)operator(]) operator(=) ident(i)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(x) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(buf)operator([)integer(0)operator(]) operator(=) operator(-)ident(i)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - ident(len) operator(=) ident(i)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;)ident(i)operator(<=)ident(len)operator(;)ident(i)operator(++\)) operator({) - ident(w_byte)operator(()ident(buf)operator([)ident(i)operator(],) ident(arg)operator(\);) - operator(}) -operator(}) - -preprocessor(#ifdef) ident(DBL_MANT_DIG) -preprocessor(#define) ident(DECIMAL_MANT) operator(()integer(53)operator(-)integer(16)operator(\)) comment(/* from IEEE754 double precision */) - -preprocessor(#if) ident(DBL_MANT_DIG) operator(>) integer(32) -preprocessor(#define) ident(MANT_BITS) integer(32) -preprocessor(#elif) ident(DBL_MANT_DIG) operator(>) integer(24) -preprocessor(#define) ident(MANT_BITS) integer(24) -preprocessor(#elif) ident(DBL_MANT_DIG) operator(>) integer(16) -preprocessor(#define) ident(MANT_BITS) integer(16) -preprocessor(#else) -preprocessor(#define) ident(MANT_BITS) integer(8) -preprocessor(#endif) - -directive(static) pre_type(int) -ident(save_mantissa)operator(()ident(d)operator(,) ident(buf)operator(\)) - pre_type(double) ident(d)operator(;) - pre_type(char) operator(*)ident(buf)operator(;) -operator({) - pre_type(int) ident(e)operator(,) ident(i) operator(=) integer(0)operator(;) - pre_type(unsigned) pre_type(long) ident(m)operator(;) - pre_type(double) ident(n)operator(;) - - ident(d) operator(=) ident(modf)operator(()ident(ldexp)operator(()ident(frexp)operator(()ident(fabs)operator(()ident(d)operator(\),) operator(&)ident(e)operator(\),) ident(DECIMAL_MANT)operator(\),) operator(&)ident(d)operator(\);) - reserved(if) operator(()ident(d) operator(>) integer(0)operator(\)) operator({) - ident(buf)operator([)ident(i)operator(++]) operator(=) integer(0)operator(;) - reserved(do) operator({) - ident(d) operator(=) ident(modf)operator(()ident(ldexp)operator(()ident(d)operator(,) ident(MANT_BITS)operator(\),) operator(&)ident(n)operator(\);) - ident(m) operator(=) operator(()pre_type(unsigned) pre_type(long)operator(\))ident(n)operator(;) -preprocessor(#if) ident(MANT_BITS) operator(>) integer(24) - ident(buf)operator([)ident(i)operator(++]) operator(=) ident(m) operator(>>) integer(24)operator(;) -preprocessor(#endif) -preprocessor(#if) ident(MANT_BITS) operator(>) integer(16) - ident(buf)operator([)ident(i)operator(++]) operator(=) ident(m) operator(>>) integer(16)operator(;) -preprocessor(#endif) -preprocessor(#if) ident(MANT_BITS) operator(>) integer(8) - ident(buf)operator([)ident(i)operator(++]) operator(=) ident(m) operator(>>) integer(8)operator(;) -preprocessor(#endif) - ident(buf)operator([)ident(i)operator(++]) operator(=) ident(m)operator(;) - operator(}) reserved(while) operator(()ident(d) operator(>) integer(0)operator(\);) - reserved(while) operator((!)ident(buf)operator([)ident(i) operator(-) integer(1)operator(]\)) operator(--)ident(i)operator(;) - operator(}) - reserved(return) ident(i)operator(;) -operator(}) - -directive(static) pre_type(double) -ident(load_mantissa)operator(()ident(d)operator(,) ident(buf)operator(,) ident(len)operator(\)) - pre_type(double) ident(d)operator(;) - directive(const) pre_type(char) operator(*)ident(buf)operator(;) - pre_type(int) ident(len)operator(;) -operator({) - reserved(if) operator((--)ident(len) operator(>) integer(0) operator(&&) operator(!*)ident(buf)operator(++\)) operator({) comment(/* binary mantissa mark */) - pre_type(int) ident(e)operator(,) ident(s) operator(=) ident(d) operator(<) integer(0)operator(,) ident(dig) operator(=) integer(0)operator(;) - pre_type(unsigned) pre_type(long) ident(m)operator(;) - - ident(modf)operator(()ident(ldexp)operator(()ident(frexp)operator(()ident(fabs)operator(()ident(d)operator(\),) operator(&)ident(e)operator(\),) ident(DECIMAL_MANT)operator(\),) operator(&)ident(d)operator(\);) - reserved(do) operator({) - ident(m) operator(=) integer(0)operator(;) - reserved(switch) operator(()ident(len)operator(\)) operator({) - reserved(default)operator(:) ident(m) operator(=) operator(*)ident(buf)operator(++) operator(&) hex(0xff)operator(;) -preprocessor(#if) ident(MANT_BITS) operator(>) integer(24) - reserved(case) integer(3)operator(:) ident(m) operator(=) operator(()ident(m) operator(<<) integer(8)operator(\)) operator(|) operator((*)ident(buf)operator(++) operator(&) hex(0xff)operator(\);) -preprocessor(#endif) -preprocessor(#if) ident(MANT_BITS) operator(>) integer(16) - reserved(case) integer(2)operator(:) ident(m) operator(=) operator(()ident(m) operator(<<) integer(8)operator(\)) operator(|) operator((*)ident(buf)operator(++) operator(&) hex(0xff)operator(\);) -preprocessor(#endif) -preprocessor(#if) ident(MANT_BITS) operator(>) integer(8) - reserved(case) integer(1)operator(:) ident(m) operator(=) operator(()ident(m) operator(<<) integer(8)operator(\)) operator(|) operator((*)ident(buf)operator(++) operator(&) hex(0xff)operator(\);) -preprocessor(#endif) - operator(}) - ident(dig) operator(-=) ident(len) operator(<) ident(MANT_BITS) operator(/) integer(8) operator(?) integer(8) operator(*) operator(()pre_type(unsigned)operator(\))ident(len) operator(:) ident(MANT_BITS)operator(;) - ident(d) operator(+=) ident(ldexp)operator((()pre_type(double)operator(\))ident(m)operator(,) ident(dig)operator(\);) - operator(}) reserved(while) operator((()ident(len) operator(-=) ident(MANT_BITS) operator(/) integer(8)operator(\)) operator(>) integer(0)operator(\);) - ident(d) operator(=) ident(ldexp)operator(()ident(d)operator(,) ident(e) operator(-) ident(DECIMAL_MANT)operator(\);) - reserved(if) operator(()ident(s)operator(\)) ident(d) operator(=) operator(-)ident(d)operator(;) - operator(}) - reserved(return) ident(d)operator(;) -operator(}) -preprocessor(#else) -preprocessor(#define) ident(load_mantissa)operator(()ident(d)operator(,) ident(buf)operator(,) ident(len)operator(\)) operator(()ident(d)operator(\)) -preprocessor(#define) ident(save_mantissa)operator(()ident(d)operator(,) ident(buf)operator(\)) integer(0) -preprocessor(#endif) - -preprocessor(#ifdef) ident(DBL_DIG) -preprocessor(#define) ident(FLOAT_DIG) operator(()ident(DBL_DIG)operator(+)integer(2)operator(\)) -preprocessor(#else) -preprocessor(#define) ident(FLOAT_DIG) integer(17) -preprocessor(#endif) - -directive(static) directive(void) -ident(w_float)operator(()ident(d)operator(,) ident(arg)operator(\)) - pre_type(double) ident(d)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) -operator({) - pre_type(char) ident(buf)operator([)integer(100)operator(];) - - reserved(if) operator(()ident(isinf)operator(()ident(d)operator(\)\)) operator({) - reserved(if) operator(()ident(d) operator(<) integer(0)operator(\)) ident(strcpy)operator(()ident(buf)operator(,) stringoperator(\);) - reserved(else) ident(strcpy)operator(()ident(buf)operator(,) stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(isnan)operator(()ident(d)operator(\)\)) operator({) - ident(strcpy)operator(()ident(buf)operator(,) stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(d) operator(==) float(0)float(.0)operator(\)) operator({) - reserved(if) operator(()float(1)float(.0)operator(/)ident(d) operator(<) integer(0)operator(\)) ident(strcpy)operator(()ident(buf)operator(,) stringoperator(\);) - reserved(else) ident(strcpy)operator(()ident(buf)operator(,) stringoperator(\);) - operator(}) - reserved(else) operator({) - pre_type(int) ident(len)operator(;) - - comment(/* xxx: should not use system's sprintf(3\) */) - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) ident(FLOAT_DIG)operator(,) ident(d)operator(\);) - ident(len) operator(=) ident(strlen)operator(()ident(buf)operator(\);) - ident(w_bytes)operator(()ident(buf)operator(,) ident(len) operator(+) ident(save_mantissa)operator(()ident(d)operator(,) ident(buf) operator(+) ident(len)operator(\),) ident(arg)operator(\);) - reserved(return)operator(;) - operator(}) - ident(w_bytes)operator(()ident(buf)operator(,) ident(strlen)operator(()ident(buf)operator(\),) ident(arg)operator(\);) -operator(}) - -directive(static) directive(void) -ident(w_symbol)operator(()ident(id)operator(,) ident(arg)operator(\)) - ident(ID) ident(id)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) -operator({) - pre_type(char) operator(*)ident(sym) operator(=) ident(rb_id2name)operator(()ident(id)operator(\);) - ident(st_data_t) ident(num)operator(;) - - reserved(if) operator(()ident(st_lookup)operator(()ident(arg)operator(->)ident(symbols)operator(,) ident(id)operator(,) operator(&)ident(num)operator(\)\)) operator({) - ident(w_byte)operator(()ident(TYPE_SYMLINK)operator(,) ident(arg)operator(\);) - ident(w_long)operator((()pre_type(long)operator(\))ident(num)operator(,) ident(arg)operator(\);) - operator(}) - reserved(else) operator({) - ident(w_byte)operator(()ident(TYPE_SYMBOL)operator(,) ident(arg)operator(\);) - ident(w_bytes)operator(()ident(sym)operator(,) ident(strlen)operator(()ident(sym)operator(\),) ident(arg)operator(\);) - ident(st_add_direct)operator(()ident(arg)operator(->)ident(symbols)operator(,) ident(id)operator(,) ident(arg)operator(->)ident(symbols)operator(->)ident(num_entries)operator(\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(w_unique)operator(()ident(s)operator(,) ident(arg)operator(\)) - pre_type(char) operator(*)ident(s)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(if) operator(()ident(s)operator([)integer(0)operator(]) operator(==) char('#')operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(s)operator(\);) - operator(}) - ident(w_symbol)operator(()ident(rb_intern)operator(()ident(s)operator(\),) ident(arg)operator(\);) -operator(}) - -directive(static) directive(void) ident(w_object) ident(_)operator((()ident(VALUE)operator(,)reserved(struct) ident(dump_arg)operator(*,)pre_type(int)operator(\)\);) - -directive(static) pre_type(int) -ident(hash_each)operator(()ident(key)operator(,) ident(value)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(key)operator(,) ident(value)operator(;) - reserved(struct) ident(dump_call_arg) operator(*)ident(arg)operator(;) -operator({) - ident(w_object)operator(()ident(key)operator(,) ident(arg)operator(->)ident(arg)operator(,) ident(arg)operator(->)ident(limit)operator(\);) - ident(w_object)operator(()ident(value)operator(,) ident(arg)operator(->)ident(arg)operator(,) ident(arg)operator(->)ident(limit)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) directive(void) -ident(w_extended)operator(()ident(klass)operator(,) ident(arg)operator(,) ident(check)operator(\)) - ident(VALUE) ident(klass)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) - pre_type(int) ident(check)operator(;) -operator({) - pre_type(char) operator(*)ident(path)operator(;) - - reserved(if) operator(()ident(check) operator(&&) ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - reserved(if) operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(m_tbl)operator(->)ident(num_entries) operator(||) - operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl) operator(&&) ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(->)ident(num_entries) operator(>) integer(1)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(klass) operator(=) ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(;) - operator(}) - reserved(while) operator(()ident(BUILTIN_TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(path) operator(=) ident(rb_class2name)operator(()ident(RBASIC)operator(()ident(klass)operator(\)->)ident(klass)operator(\);) - ident(w_byte)operator(()ident(TYPE_EXTENDED)operator(,) ident(arg)operator(\);) - ident(w_unique)operator(()ident(path)operator(,) ident(arg)operator(\);) - ident(klass) operator(=) ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(w_class)operator(()ident(type)operator(,) ident(obj)operator(,) ident(arg)operator(,) ident(check)operator(\)) - pre_type(int) ident(type)operator(;) - ident(VALUE) ident(obj)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) - pre_type(int) ident(check)operator(;) -operator({) - pre_type(char) operator(*)ident(path)operator(;) - - ident(VALUE) ident(klass) operator(=) ident(CLASS_OF)operator(()ident(obj)operator(\);) - ident(w_extended)operator(()ident(klass)operator(,) ident(arg)operator(,) ident(check)operator(\);) - ident(w_byte)operator(()ident(type)operator(,) ident(arg)operator(\);) - ident(path) operator(=) ident(RSTRING)operator(()ident(class2path)operator(()ident(rb_class_real)operator(()ident(klass)operator(\)\)\)->)ident(ptr)operator(;) - ident(w_unique)operator(()ident(path)operator(,) ident(arg)operator(\);) -operator(}) - -directive(static) directive(void) -ident(w_uclass)operator(()ident(obj)operator(,) ident(base_klass)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(base_klass)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) -operator({) - ident(VALUE) ident(klass) operator(=) ident(CLASS_OF)operator(()ident(obj)operator(\);) - - ident(w_extended)operator(()ident(klass)operator(,) ident(arg)operator(,) ident(Qtrue)operator(\);) - ident(klass) operator(=) ident(rb_class_real)operator(()ident(klass)operator(\);) - reserved(if) operator(()ident(klass) operator(!=) ident(base_klass)operator(\)) operator({) - ident(w_byte)operator(()ident(TYPE_UCLASS)operator(,) ident(arg)operator(\);) - ident(w_unique)operator(()ident(RSTRING)operator(()ident(class2path)operator(()ident(klass)operator(\)\)->)ident(ptr)operator(,) ident(arg)operator(\);) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(w_obj_each)operator(()ident(id)operator(,) ident(value)operator(,) ident(arg)operator(\)) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(value)operator(;) - reserved(struct) ident(dump_call_arg) operator(*)ident(arg)operator(;) -operator({) - ident(w_symbol)operator(()ident(id)operator(,) ident(arg)operator(->)ident(arg)operator(\);) - ident(w_object)operator(()ident(value)operator(,) ident(arg)operator(->)ident(arg)operator(,) ident(arg)operator(->)ident(limit)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) directive(void) -ident(w_ivar)operator(()ident(tbl)operator(,) ident(arg)operator(\)) - ident(st_table) operator(*)ident(tbl)operator(;) - reserved(struct) ident(dump_call_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(if) operator(()ident(tbl)operator(\)) operator({) - ident(w_long)operator(()ident(tbl)operator(->)ident(num_entries)operator(,) ident(arg)operator(->)ident(arg)operator(\);) - ident(st_foreach_safe)operator(()ident(tbl)operator(,) ident(w_obj_each)operator(,) operator(()ident(st_data_t)operator(\))ident(arg)operator(\);) - operator(}) - reserved(else) operator({) - ident(w_long)operator(()integer(0)operator(,) ident(arg)operator(->)ident(arg)operator(\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(w_object)operator(()ident(obj)operator(,) ident(arg)operator(,) ident(limit)operator(\)) - ident(VALUE) ident(obj)operator(;) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) - pre_type(int) ident(limit)operator(;) -operator({) - reserved(struct) ident(dump_call_arg) ident(c_arg)operator(;) - ident(st_table) operator(*)ident(ivtbl) operator(=) integer(0)operator(;) - ident(st_data_t) ident(num)operator(;) - - reserved(if) operator(()ident(limit) operator(==) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - ident(limit)operator(--;) - ident(c_arg)operator(.)ident(limit) operator(=) ident(limit)operator(;) - ident(c_arg)operator(.)ident(arg) operator(=) ident(arg)operator(;) - - reserved(if) operator(()ident(st_lookup)operator(()ident(arg)operator(->)ident(data)operator(,) ident(obj)operator(,) operator(&)ident(num)operator(\)\)) operator({) - ident(w_byte)operator(()ident(TYPE_LINK)operator(,) ident(arg)operator(\);) - ident(w_long)operator((()pre_type(long)operator(\))ident(num)operator(,) ident(arg)operator(\);) - reserved(return)operator(;) - operator(}) - - reserved(if) operator((()ident(ivtbl) operator(=) ident(rb_generic_ivar_table)operator(()ident(obj)operator(\)\)) operator(!=) integer(0)operator(\)) operator({) - ident(w_byte)operator(()ident(TYPE_IVAR)operator(,) ident(arg)operator(\);) - operator(}) - reserved(if) operator(()ident(obj) operator(==) ident(Qnil)operator(\)) operator({) - ident(w_byte)operator(()ident(TYPE_NIL)operator(,) ident(arg)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(obj) operator(==) ident(Qtrue)operator(\)) operator({) - ident(w_byte)operator(()ident(TYPE_TRUE)operator(,) ident(arg)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(obj) operator(==) ident(Qfalse)operator(\)) operator({) - ident(w_byte)operator(()ident(TYPE_FALSE)operator(,) ident(arg)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(FIXNUM_P)operator(()ident(obj)operator(\)\)) operator({) -preprocessor(#if) ident(SIZEOF_LONG) operator(<=) integer(4) - ident(w_byte)operator(()ident(TYPE_FIXNUM)operator(,) ident(arg)operator(\);) - ident(w_long)operator(()ident(FIX2INT)operator(()ident(obj)operator(\),) ident(arg)operator(\);) -preprocessor(#else) - reserved(if) operator(()ident(RSHIFT)operator((()pre_type(long)operator(\))ident(obj)operator(,) integer(31)operator(\)) operator(==) integer(0) operator(||) ident(RSHIFT)operator((()pre_type(long)operator(\))ident(obj)operator(,) integer(31)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(w_byte)operator(()ident(TYPE_FIXNUM)operator(,) ident(arg)operator(\);) - ident(w_long)operator(()ident(FIX2LONG)operator(()ident(obj)operator(\),) ident(arg)operator(\);) - operator(}) - reserved(else) operator({) - ident(w_object)operator(()ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(obj)operator(\)\),) ident(arg)operator(,) ident(limit)operator(\);) - operator(}) -preprocessor(#endif) - operator(}) - reserved(else) reserved(if) operator(()ident(SYMBOL_P)operator(()ident(obj)operator(\)\)) operator({) - ident(w_symbol)operator(()ident(SYM2ID)operator(()ident(obj)operator(\),) ident(arg)operator(\);) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(obj)operator(\)\)) ident(arg)operator(->)ident(taint) operator(=) ident(Qtrue)operator(;) - - ident(st_add_direct)operator(()ident(arg)operator(->)ident(data)operator(,) ident(obj)operator(,) ident(arg)operator(->)ident(data)operator(->)ident(num_entries)operator(\);) - reserved(if) operator(()ident(rb_respond_to)operator(()ident(obj)operator(,) ident(s_mdump)operator(\)\)) operator({) - directive(volatile) ident(VALUE) ident(v)operator(;) - - ident(v) operator(=) ident(rb_funcall)operator(()ident(obj)operator(,) ident(s_mdump)operator(,) integer(0)operator(,) integer(0)operator(\);) - ident(check_dump_arg)operator(()ident(arg)operator(,) ident(s_mdump)operator(\);) - ident(w_class)operator(()ident(TYPE_USRMARSHAL)operator(,) ident(obj)operator(,) ident(arg)operator(,) ident(Qfalse)operator(\);) - ident(w_object)operator(()ident(v)operator(,) ident(arg)operator(,) ident(limit)operator(\);) - reserved(if) operator(()ident(ivtbl)operator(\)) ident(w_ivar)operator(()integer(0)operator(,) operator(&)ident(c_arg)operator(\);) - reserved(return)operator(;) - operator(}) - reserved(if) operator(()ident(rb_respond_to)operator(()ident(obj)operator(,) ident(s_dump)operator(\)\)) operator({) - ident(VALUE) ident(v)operator(;) - - ident(v) operator(=) ident(rb_funcall)operator(()ident(obj)operator(,) ident(s_dump)operator(,) integer(1)operator(,) ident(INT2NUM)operator(()ident(limit)operator(\)\);) - ident(check_dump_arg)operator(()ident(arg)operator(,) ident(s_dump)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(!=) ident(T_STRING)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator((!)ident(ivtbl) operator(&&) operator(()ident(ivtbl) operator(=) ident(rb_generic_ivar_table)operator(()ident(v)operator(\)\)\)) operator({) - ident(w_byte)operator(()ident(TYPE_IVAR)operator(,) ident(arg)operator(\);) - operator(}) - ident(w_class)operator(()ident(TYPE_USERDEF)operator(,) ident(obj)operator(,) ident(arg)operator(,) ident(Qfalse)operator(\);) - ident(w_bytes)operator(()ident(RSTRING)operator(()ident(v)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(v)operator(\)->)ident(len)operator(,) ident(arg)operator(\);) - reserved(if) operator(()ident(ivtbl)operator(\)) operator({) - ident(w_ivar)operator(()ident(ivtbl)operator(,) operator(&)ident(c_arg)operator(\);) - operator(}) - reserved(return)operator(;) - operator(}) - - reserved(switch) operator(()ident(BUILTIN_TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_CLASS)operator(:) - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(w_byte)operator(()ident(TYPE_CLASS)operator(,) ident(arg)operator(\);) - operator({) - ident(VALUE) ident(path) operator(=) ident(class2path)operator(()ident(obj)operator(\);) - ident(w_bytes)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(path)operator(\)->)ident(len)operator(,) ident(arg)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_MODULE)operator(:) - ident(w_byte)operator(()ident(TYPE_MODULE)operator(,) ident(arg)operator(\);) - operator({) - ident(VALUE) ident(path) operator(=) ident(class2path)operator(()ident(obj)operator(\);) - ident(w_bytes)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(path)operator(\)->)ident(len)operator(,) ident(arg)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - ident(w_byte)operator(()ident(TYPE_FLOAT)operator(,) ident(arg)operator(\);) - ident(w_float)operator(()ident(RFLOAT)operator(()ident(obj)operator(\)->)ident(value)operator(,) ident(arg)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - ident(w_byte)operator(()ident(TYPE_BIGNUM)operator(,) ident(arg)operator(\);) - operator({) - pre_type(char) ident(sign) operator(=) ident(RBIGNUM)operator(()ident(obj)operator(\)->)ident(sign) operator(?) char('+') operator(:) char('-')operator(;) - pre_type(long) ident(len) operator(=) ident(RBIGNUM)operator(()ident(obj)operator(\)->)ident(len)operator(;) - ident(BDIGIT) operator(*)ident(d) operator(=) ident(RBIGNUM)operator(()ident(obj)operator(\)->)ident(digits)operator(;) - - ident(w_byte)operator(()ident(sign)operator(,) ident(arg)operator(\);) - ident(w_long)operator(()ident(SHORTLEN)operator(()ident(len)operator(\),) ident(arg)operator(\);) comment(/* w_short? */) - reserved(while) operator(()ident(len)operator(--\)) operator({) -preprocessor(#if) ident(SIZEOF_BDIGITS) operator(>) ident(SIZEOF_SHORT) - ident(BDIGIT) ident(num) operator(=) operator(*)ident(d)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(SIZEOF_BDIGITS)operator(;) ident(i)operator(+=)ident(SIZEOF_SHORT)operator(\)) operator({) - ident(w_short)operator(()ident(num) operator(&) ident(SHORTMASK)operator(,) ident(arg)operator(\);) - ident(num) operator(=) ident(SHORTDN)operator(()ident(num)operator(\);) - reserved(if) operator(()ident(len) operator(==) integer(0) operator(&&) ident(num) operator(==) integer(0)operator(\)) reserved(break)operator(;) - operator(}) -preprocessor(#else) - ident(w_short)operator((*)ident(d)operator(,) ident(arg)operator(\);) -preprocessor(#endif) - ident(d)operator(++;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_STRING)operator(:) - ident(w_uclass)operator(()ident(obj)operator(,) ident(rb_cString)operator(,) ident(arg)operator(\);) - ident(w_byte)operator(()ident(TYPE_STRING)operator(,) ident(arg)operator(\);) - ident(w_bytes)operator(()ident(RSTRING)operator(()ident(obj)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(obj)operator(\)->)ident(len)operator(,) ident(arg)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_REGEXP)operator(:) - ident(w_uclass)operator(()ident(obj)operator(,) ident(rb_cRegexp)operator(,) ident(arg)operator(\);) - ident(w_byte)operator(()ident(TYPE_REGEXP)operator(,) ident(arg)operator(\);) - ident(w_bytes)operator(()ident(RREGEXP)operator(()ident(obj)operator(\)->)ident(str)operator(,) ident(RREGEXP)operator(()ident(obj)operator(\)->)ident(len)operator(,) ident(arg)operator(\);) - ident(w_byte)operator(()ident(rb_reg_options)operator(()ident(obj)operator(\),) ident(arg)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_ARRAY)operator(:) - ident(w_uclass)operator(()ident(obj)operator(,) ident(rb_cArray)operator(,) ident(arg)operator(\);) - ident(w_byte)operator(()ident(TYPE_ARRAY)operator(,) ident(arg)operator(\);) - operator({) - pre_type(long) ident(len) operator(=) ident(RARRAY)operator(()ident(obj)operator(\)->)ident(len)operator(;) - ident(VALUE) operator(*)ident(ptr) operator(=) ident(RARRAY)operator(()ident(obj)operator(\)->)ident(ptr)operator(;) - - ident(w_long)operator(()ident(len)operator(,) ident(arg)operator(\);) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(w_object)operator((*)ident(ptr)operator(,) ident(arg)operator(,) ident(limit)operator(\);) - ident(ptr)operator(++;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_HASH)operator(:) - ident(w_uclass)operator(()ident(obj)operator(,) ident(rb_cHash)operator(,) ident(arg)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(RHASH)operator(()ident(obj)operator(\)->)ident(ifnone)operator(\)\)) operator({) - ident(w_byte)operator(()ident(TYPE_HASH)operator(,) ident(arg)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_USER2)operator(\)\)) operator({) - comment(/* FL_USER2 means HASH_PROC_DEFAULT (see hash.c\) */) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(else) operator({) - ident(w_byte)operator(()ident(TYPE_HASH_DEF)operator(,) ident(arg)operator(\);) - operator(}) - ident(w_long)operator(()ident(RHASH)operator(()ident(obj)operator(\)->)ident(tbl)operator(->)ident(num_entries)operator(,) ident(arg)operator(\);) - ident(rb_hash_foreach)operator(()ident(obj)operator(,) ident(hash_each)operator(,) operator(()ident(st_data_t)operator(\)&)ident(c_arg)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(RHASH)operator(()ident(obj)operator(\)->)ident(ifnone)operator(\)\)) operator({) - ident(w_object)operator(()ident(RHASH)operator(()ident(obj)operator(\)->)ident(ifnone)operator(,) ident(arg)operator(,) ident(limit)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_STRUCT)operator(:) - ident(w_class)operator(()ident(TYPE_STRUCT)operator(,) ident(obj)operator(,) ident(arg)operator(,) ident(Qtrue)operator(\);) - operator({) - pre_type(long) ident(len) operator(=) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(len)operator(;) - ident(VALUE) ident(mem)operator(;) - pre_type(long) ident(i)operator(;) - - ident(w_long)operator(()ident(len)operator(,) ident(arg)operator(\);) - ident(mem) operator(=) ident(rb_struct_members)operator(()ident(obj)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(w_symbol)operator(()ident(SYM2ID)operator(()ident(RARRAY)operator(()ident(mem)operator(\)->)ident(ptr)operator([)ident(i)operator(]\),) ident(arg)operator(\);) - ident(w_object)operator(()ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(arg)operator(,) ident(limit)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_OBJECT)operator(:) - ident(w_class)operator(()ident(TYPE_OBJECT)operator(,) ident(obj)operator(,) ident(arg)operator(,) ident(Qtrue)operator(\);) - ident(w_ivar)operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(,) operator(&)ident(c_arg)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_DATA)operator(:) - operator({) - ident(VALUE) ident(v)operator(;) - - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(obj)operator(,) ident(s_dump_data)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) - stringoperator(,) - ident(rb_obj_classname)operator(()ident(obj)operator(\)\);) - operator(}) - ident(v) operator(=) ident(rb_funcall)operator(()ident(obj)operator(,) ident(s_dump_data)operator(,) integer(0)operator(\);) - ident(check_dump_arg)operator(()ident(arg)operator(,) ident(s_dump_data)operator(\);) - ident(w_class)operator(()ident(TYPE_DATA)operator(,) ident(obj)operator(,) ident(arg)operator(,) ident(Qtrue)operator(\);) - ident(w_object)operator(()ident(v)operator(,) ident(arg)operator(,) ident(limit)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(obj)operator(\)\);) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(ivtbl)operator(\)) operator({) - ident(w_ivar)operator(()ident(ivtbl)operator(,) operator(&)ident(c_arg)operator(\);) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(dump)operator(()ident(arg)operator(\)) - reserved(struct) ident(dump_call_arg) operator(*)ident(arg)operator(;) -operator({) - ident(w_object)operator(()ident(arg)operator(->)ident(obj)operator(,) ident(arg)operator(->)ident(arg)operator(,) ident(arg)operator(->)ident(limit)operator(\);) - reserved(if) operator(()ident(arg)operator(->)ident(arg)operator(->)ident(dest)operator(\)) operator({) - ident(rb_io_write)operator(()ident(arg)operator(->)ident(arg)operator(->)ident(dest)operator(,) ident(arg)operator(->)ident(arg)operator(->)ident(str)operator(\);) - ident(rb_str_resize)operator(()ident(arg)operator(->)ident(arg)operator(->)ident(str)operator(,) integer(0)operator(\);) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(dump_ensure)operator(()ident(arg)operator(\)) - reserved(struct) ident(dump_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(if) operator((!)ident(DATA_PTR)operator(()ident(arg)operator(->)ident(wrapper)operator(\)\)) reserved(return) integer(0)operator(;) - ident(st_free_table)operator(()ident(arg)operator(->)ident(symbols)operator(\);) - ident(st_free_table)operator(()ident(arg)operator(->)ident(data)operator(\);) - ident(DATA_PTR)operator(()ident(arg)operator(->)ident(wrapper)operator(\)) operator(=) integer(0)operator(;) - ident(arg)operator(->)ident(wrapper) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(arg)operator(->)ident(taint)operator(\)) operator({) - ident(OBJ_TAINT)operator(()ident(arg)operator(->)ident(str)operator(\);) - operator(}) - - reserved(return) integer(0)operator(;) -operator(}) - -comment(/* - * call-seq: - * dump( obj [, anIO] , limit=--1 \) => anIO - * - * Serializes obj and all descendent objects. If anIO is - * specified, the serialized data will be written to it, otherwise the - * data will be returned as a String. If limit is specified, the - * traversal of subobjects will be limited to that depth. If limit is - * negative, no checking of depth will be performed. - * - * class Klass - * def initialize(str\) - * @str = str - * end - * def sayHello - * @str - * end - * end - * - * (produces no output\) - * - * o = Klass.new("hello\\n"\) - * data = Marshal.dump(o\) - * obj = Marshal.load(data\) - * obj.sayHello #=> "hello\\n" - */) -directive(static) ident(VALUE) -ident(marshal_dump)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE)operator(*) ident(argv)operator(;) -operator({) - ident(VALUE) ident(obj)operator(,) ident(port)operator(,) ident(a1)operator(,) ident(a2)operator(;) - pre_type(int) ident(limit) operator(=) operator(-)integer(1)operator(;) - reserved(struct) ident(dump_arg) ident(arg)operator(;) - reserved(struct) ident(dump_call_arg) ident(c_arg)operator(;) - - ident(port) operator(=) ident(Qnil)operator(;) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(obj)operator(,) operator(&)ident(a1)operator(,) operator(&)ident(a2)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(3)operator(\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(a2)operator(\)\)) ident(limit) operator(=) ident(NUM2INT)operator(()ident(a2)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(a1)operator(\)\)) reserved(goto) ident(type_error)operator(;) - ident(port) operator(=) ident(a1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(argc) operator(==) integer(2)operator(\)) operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(a1)operator(\)\)) ident(limit) operator(=) ident(FIX2INT)operator(()ident(a1)operator(\);) - reserved(else) reserved(if) operator(()ident(NIL_P)operator(()ident(a1)operator(\)\)) reserved(goto) ident(type_error)operator(;) - reserved(else) ident(port) operator(=) ident(a1)operator(;) - operator(}) - ident(arg)operator(.)ident(dest) operator(=) integer(0)operator(;) - ident(arg)operator(.)ident(symbols) operator(=) ident(st_init_numtable)operator((\);) - ident(arg)operator(.)ident(data) operator(=) ident(st_init_numtable)operator((\);) - ident(arg)operator(.)ident(taint) operator(=) ident(Qfalse)operator(;) - ident(arg)operator(.)ident(str) operator(=) ident(rb_str_buf_new)operator(()integer(0)operator(\);) - ident(RBASIC)operator(()ident(arg)operator(.)ident(str)operator(\)->)ident(klass) operator(=) integer(0)operator(;) - ident(arg)operator(.)ident(wrapper) operator(=) ident(Data_Wrap_Struct)operator(()ident(rb_cData)operator(,) ident(mark_dump_arg)operator(,) integer(0)operator(,) operator(&)ident(arg)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(port)operator(\)\)) operator({) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(port)operator(,) ident(s_write)operator(\)\)) operator({) - label(type_error:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(arg)operator(.)ident(dest) operator(=) ident(port)operator(;) - reserved(if) operator(()ident(rb_respond_to)operator(()ident(port)operator(,) ident(s_binmode)operator(\)\)) operator({) - ident(rb_funcall2)operator(()ident(port)operator(,) ident(s_binmode)operator(,) integer(0)operator(,) integer(0)operator(\);) - ident(check_dump_arg)operator((&)ident(arg)operator(,) ident(s_binmode)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(port) operator(=) ident(arg)operator(.)ident(str)operator(;) - operator(}) - - ident(c_arg)operator(.)ident(obj) operator(=) ident(obj)operator(;) - ident(c_arg)operator(.)ident(arg) operator(=) operator(&)ident(arg)operator(;) - ident(c_arg)operator(.)ident(limit) operator(=) ident(limit)operator(;) - - ident(w_byte)operator(()ident(MARSHAL_MAJOR)operator(,) operator(&)ident(arg)operator(\);) - ident(w_byte)operator(()ident(MARSHAL_MINOR)operator(,) operator(&)ident(arg)operator(\);) - - ident(rb_ensure)operator(()ident(dump)operator(,) operator(()ident(VALUE)operator(\)&)ident(c_arg)operator(,) ident(dump_ensure)operator(,) operator(()ident(VALUE)operator(\)&)ident(arg)operator(\);) - ident(RBASIC)operator(()ident(arg)operator(.)ident(str)operator(\)->)ident(klass) operator(=) ident(rb_cString)operator(;) - - reserved(return) ident(port)operator(;) -operator(}) - -reserved(struct) ident(load_arg) operator({) - ident(VALUE) ident(src)operator(;) - pre_type(long) ident(offset)operator(;) - ident(st_table) operator(*)ident(symbols)operator(;) - ident(st_table) operator(*)ident(data)operator(;) - ident(VALUE) ident(proc)operator(;) - pre_type(int) ident(taint)operator(;) - ident(VALUE) ident(wrapper)operator(;) -operator(};) - -directive(static) directive(void) -ident(check_load_arg)operator(()ident(arg)operator(,) ident(sym)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) - ident(ID) ident(sym)operator(;) -operator({) - reserved(if) operator((!)ident(DATA_PTR)operator(()ident(arg)operator(->)ident(wrapper)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(sym)operator(\)\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(mark_load_arg)operator(()ident(ptr)operator(\)) - directive(void) operator(*)ident(ptr)operator(;) -operator({) - reserved(struct) ident(load_arg) operator(*)ident(p) operator(=) ident(ptr)operator(;) - reserved(if) operator((!)ident(ptr)operator(\)) - reserved(return)operator(;) - ident(rb_mark_tbl)operator(()ident(p)operator(->)ident(data)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(r_object) ident(_)operator((()reserved(struct) ident(load_arg) operator(*)ident(arg)operator(\)\);) - -directive(static) pre_type(int) -ident(r_byte)operator(()ident(arg)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - pre_type(int) ident(c)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(arg)operator(->)ident(src)operator(\)) operator(==) ident(T_STRING)operator(\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(arg)operator(->)ident(src)operator(\)->)ident(len) operator(>) ident(arg)operator(->)ident(offset)operator(\)) operator({) - ident(c) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(RSTRING)operator(()ident(arg)operator(->)ident(src)operator(\)->)ident(ptr)operator([)ident(arg)operator(->)ident(offset)operator(++];) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(src) operator(=) ident(arg)operator(->)ident(src)operator(;) - ident(VALUE) ident(v) operator(=) ident(rb_funcall2)operator(()ident(src)operator(,) ident(s_getc)operator(,) integer(0)operator(,) integer(0)operator(\);) - ident(check_load_arg)operator(()ident(arg)operator(,) ident(s_getc)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(v)operator(\)\)) ident(rb_eof_error)operator((\);) - ident(c) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(FIX2INT)operator(()ident(v)operator(\);) - operator(}) - reserved(return) ident(c)operator(;) -operator(}) - -directive(static) directive(void) -ident(long_toobig)operator(()ident(size)operator(\)) - pre_type(int) ident(size)operator(;) -operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - reserved(sizeof)operator(()pre_type(long)operator(\),) ident(size)operator(\);) -operator(}) - -preprocessor(#undef) ident(SIGN_EXTEND_CHAR) -preprocessor(#if) ident(__STDC__) -preprocessor(# define) ident(SIGN_EXTEND_CHAR)operator(()ident(c)operator(\)) operator((()pre_type(signed) pre_type(char)operator(\)()ident(c)operator(\)\)) -preprocessor(#else) comment(/* not __STDC__ */) -comment(/* As in Harbison and Steele. */) -preprocessor(# define) ident(SIGN_EXTEND_CHAR)operator(()ident(c)operator(\)) operator((((()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)) operator(^) integer(128)operator(\)) operator(-) integer(128)operator(\)) -preprocessor(#endif) - -directive(static) pre_type(long) -ident(r_long)operator(()ident(arg)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - directive(register) pre_type(long) ident(x)operator(;) - pre_type(int) ident(c) operator(=) ident(SIGN_EXTEND_CHAR)operator(()ident(r_byte)operator(()ident(arg)operator(\)\);) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(c) operator(==) integer(0)operator(\)) reserved(return) integer(0)operator(;) - reserved(if) operator(()ident(c) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()integer(4) operator(<) ident(c) operator(&&) ident(c) operator(<) integer(128)operator(\)) operator({) - reserved(return) ident(c) operator(-) integer(5)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(>) reserved(sizeof)operator(()pre_type(long)operator(\)\)) ident(long_toobig)operator(()ident(c)operator(\);) - ident(x) operator(=) integer(0)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;)ident(i)operator(<)ident(c)operator(;)ident(i)operator(++\)) operator({) - ident(x) operator(|=) operator(()pre_type(long)operator(\))ident(r_byte)operator(()ident(arg)operator(\)) operator(<<) operator(()integer(8)operator(*)ident(i)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator((-)integer(129) operator(<) ident(c) operator(&&) ident(c) operator(<) operator(-)integer(4)operator(\)) operator({) - reserved(return) ident(c) operator(+) integer(5)operator(;) - operator(}) - ident(c) operator(=) operator(-)ident(c)operator(;) - reserved(if) operator(()ident(c) operator(>) reserved(sizeof)operator(()pre_type(long)operator(\)\)) ident(long_toobig)operator(()ident(c)operator(\);) - ident(x) operator(=) operator(-)integer(1)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;)ident(i)operator(<)ident(c)operator(;)ident(i)operator(++\)) operator({) - ident(x) operator(&=) operator(~(()pre_type(long)operator(\))hex(0xff) operator(<<) operator(()integer(8)operator(*)ident(i)operator(\)\);) - ident(x) operator(|=) operator(()pre_type(long)operator(\))ident(r_byte)operator(()ident(arg)operator(\)) operator(<<) operator(()integer(8)operator(*)ident(i)operator(\);) - operator(}) - operator(}) - reserved(return) ident(x)operator(;) -operator(}) - -preprocessor(#define) ident(r_bytes)operator(()ident(arg)operator(\)) ident(r_bytes0)operator(()ident(r_long)operator(()ident(arg)operator(\),) operator(()ident(arg)operator(\)\)) - -directive(static) ident(VALUE) -ident(r_bytes0)operator(()ident(len)operator(,) ident(arg)operator(\)) - pre_type(long) ident(len)operator(;) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(arg)operator(->)ident(src)operator(\)) operator(==) ident(T_STRING)operator(\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(arg)operator(->)ident(src)operator(\)->)ident(len) operator(-) ident(arg)operator(->)ident(offset) operator(>=) ident(len)operator(\)) operator({) - ident(str) operator(=) ident(rb_str_new)operator(()ident(RSTRING)operator(()ident(arg)operator(->)ident(src)operator(\)->)ident(ptr)operator(+)ident(arg)operator(->)ident(offset)operator(,) ident(len)operator(\);) - ident(arg)operator(->)ident(offset) operator(+=) ident(len)operator(;) - operator(}) - reserved(else) operator({) - label(too_short:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(src) operator(=) ident(arg)operator(->)ident(src)operator(;) - ident(VALUE) ident(n) operator(=) ident(LONG2NUM)operator(()ident(len)operator(\);) - ident(str) operator(=) ident(rb_funcall2)operator(()ident(src)operator(,) ident(s_read)operator(,) integer(1)operator(,) operator(&)ident(n)operator(\);) - ident(check_load_arg)operator(()ident(arg)operator(,) ident(s_read)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(str)operator(\)\)) reserved(goto) ident(too_short)operator(;) - ident(StringValue)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(!=) ident(len)operator(\)) reserved(goto) ident(too_short)operator(;) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(str)operator(\)\)) ident(arg)operator(->)ident(taint) operator(=) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) ident(ID) -ident(r_symlink)operator(()ident(arg)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - ident(ID) ident(id)operator(;) - pre_type(long) ident(num) operator(=) ident(r_long)operator(()ident(arg)operator(\);) - - reserved(if) operator(()ident(st_lookup)operator(()ident(arg)operator(->)ident(symbols)operator(,) ident(num)operator(,) operator(&)ident(id)operator(\)\)) operator({) - reserved(return) ident(id)operator(;) - operator(}) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) -operator(}) - -directive(static) ident(ID) -ident(r_symreal)operator(()ident(arg)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - ident(ID) ident(id)operator(;) - - ident(id) operator(=) ident(rb_intern)operator(()ident(RSTRING)operator(()ident(r_bytes)operator(()ident(arg)operator(\)\)->)ident(ptr)operator(\);) - ident(st_insert)operator(()ident(arg)operator(->)ident(symbols)operator(,) ident(arg)operator(->)ident(symbols)operator(->)ident(num_entries)operator(,) ident(id)operator(\);) - - reserved(return) ident(id)operator(;) -operator(}) - -directive(static) ident(ID) -ident(r_symbol)operator(()ident(arg)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(if) operator(()ident(r_byte)operator(()ident(arg)operator(\)) operator(==) ident(TYPE_SYMLINK)operator(\)) operator({) - reserved(return) ident(r_symlink)operator(()ident(arg)operator(\);) - operator(}) - reserved(return) ident(r_symreal)operator(()ident(arg)operator(\);) -operator(}) - -directive(static) pre_type(char)operator(*) -ident(r_unique)operator(()ident(arg)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(return) ident(rb_id2name)operator(()ident(r_symbol)operator(()ident(arg)operator(\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(r_string)operator(()ident(arg)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(return) ident(r_bytes)operator(()ident(arg)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(v)operator(;) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - ident(st_insert)operator(()ident(arg)operator(->)ident(data)operator(,) ident(arg)operator(->)ident(data)operator(->)ident(num_entries)operator(,) operator(()ident(st_data_t)operator(\))ident(v)operator(\);) - reserved(if) operator(()ident(arg)operator(->)ident(taint)operator(\)) ident(OBJ_TAINT)operator(()ident(v)operator(\);) - reserved(return) ident(v)operator(;) -operator(}) - -directive(static) directive(void) -ident(r_ivar)operator(()ident(obj)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(obj)operator(;) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - pre_type(long) ident(len)operator(;) - - ident(len) operator(=) ident(r_long)operator(()ident(arg)operator(\);) - reserved(if) operator(()ident(len) operator(>) integer(0)operator(\)) operator({) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(ID) ident(id) operator(=) ident(r_symbol)operator(()ident(arg)operator(\);) - ident(VALUE) ident(val) operator(=) ident(r_object)operator(()ident(arg)operator(\);) - ident(rb_ivar_set)operator(()ident(obj)operator(,) ident(id)operator(,) ident(val)operator(\);) - operator(}) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(path2class)operator(()ident(path)operator(\)) - pre_type(char) operator(*)ident(path)operator(;) -operator({) - ident(VALUE) ident(v) operator(=) ident(rb_path2class)operator(()ident(path)operator(\);) - - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(!=) ident(T_CLASS)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(path)operator(\);) - operator(}) - reserved(return) ident(v)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(path2module)operator(()ident(path)operator(\)) - pre_type(char) operator(*)ident(path)operator(;) -operator({) - ident(VALUE) ident(v) operator(=) ident(rb_path2class)operator(()ident(path)operator(\);) - - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(!=) ident(T_MODULE)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(path)operator(\);) - operator(}) - reserved(return) ident(v)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(r_object0)operator(()ident(arg)operator(,) ident(proc)operator(,) ident(ivp)operator(,) ident(extmod)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) - ident(VALUE) ident(proc)operator(;) - pre_type(int) operator(*)ident(ivp)operator(;) - ident(VALUE) ident(extmod)operator(;) -operator({) - ident(VALUE) ident(v) operator(=) ident(Qnil)operator(;) - pre_type(int) ident(type) operator(=) ident(r_byte)operator(()ident(arg)operator(\);) - pre_type(long) ident(id)operator(;) - ident(st_data_t) ident(link)operator(;) - - reserved(switch) operator(()ident(type)operator(\)) operator({) - reserved(case) ident(TYPE_LINK)operator(:) - ident(id) operator(=) ident(r_long)operator(()ident(arg)operator(\);) - reserved(if) operator((!)ident(st_lookup)operator(()ident(arg)operator(->)ident(data)operator(,) operator(()ident(st_data_t)operator(\))ident(id)operator(,) operator(&)ident(link)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(v) operator(=) operator(()ident(st_data_t)operator(\))ident(link)operator(;) - reserved(return) ident(v)operator(;) - - reserved(case) ident(TYPE_IVAR)operator(:) - operator({) - pre_type(int) ident(ivar) operator(=) ident(Qtrue)operator(;) - - ident(v) operator(=) ident(r_object0)operator(()ident(arg)operator(,) integer(0)operator(,) operator(&)ident(ivar)operator(,) ident(extmod)operator(\);) - reserved(if) operator(()ident(ivar)operator(\)) ident(r_ivar)operator(()ident(v)operator(,) ident(arg)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_EXTENDED)operator(:) - operator({) - ident(VALUE) ident(m) operator(=) ident(path2module)operator(()ident(r_unique)operator(()ident(arg)operator(\)\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(extmod)operator(\)\)) ident(extmod) operator(=) ident(rb_ary_new2)operator(()integer(0)operator(\);) - ident(rb_ary_push)operator(()ident(extmod)operator(,) ident(m)operator(\);) - - ident(v) operator(=) ident(r_object0)operator(()ident(arg)operator(,) integer(0)operator(,) integer(0)operator(,) ident(extmod)operator(\);) - reserved(while) operator(()ident(RARRAY)operator(()ident(extmod)operator(\)->)ident(len) operator(>) integer(0)operator(\)) operator({) - ident(m) operator(=) ident(rb_ary_pop)operator(()ident(extmod)operator(\);) - ident(rb_extend_object)operator(()ident(v)operator(,) ident(m)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_UCLASS)operator(:) - operator({) - ident(VALUE) ident(c) operator(=) ident(path2class)operator(()ident(r_unique)operator(()ident(arg)operator(\)\);) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(c)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(v) operator(=) ident(r_object0)operator(()ident(arg)operator(,) integer(0)operator(,) integer(0)operator(,) ident(extmod)operator(\);) - reserved(if) operator(()ident(rb_special_const_p)operator(()ident(v)operator(\)) operator(||) ident(TYPE)operator(()ident(v)operator(\)) operator(==) ident(T_OBJECT) operator(||) ident(TYPE)operator(()ident(v)operator(\)) operator(==) ident(T_CLASS)operator(\)) operator({) - label(format_error:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(==) ident(T_MODULE) operator(||) operator(!)ident(RTEST)operator(()ident(rb_class_inherited_p)operator(()ident(c)operator(,) ident(RBASIC)operator(()ident(v)operator(\)->)ident(klass)operator(\)\)\)) operator({) - ident(VALUE) ident(tmp) operator(=) ident(rb_obj_alloc)operator(()ident(c)operator(\);) - - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(!=) ident(TYPE)operator(()ident(tmp)operator(\)\)) reserved(goto) ident(format_error)operator(;) - operator(}) - ident(RBASIC)operator(()ident(v)operator(\)->)ident(klass) operator(=) ident(c)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_NIL)operator(:) - ident(v) operator(=) ident(Qnil)operator(;) - reserved(break)operator(;) - - reserved(case) ident(TYPE_TRUE)operator(:) - ident(v) operator(=) ident(Qtrue)operator(;) - reserved(break)operator(;) - - reserved(case) ident(TYPE_FALSE)operator(:) - ident(v) operator(=) ident(Qfalse)operator(;) - reserved(break)operator(;) - - reserved(case) ident(TYPE_FIXNUM)operator(:) - operator({) - pre_type(long) ident(i) operator(=) ident(r_long)operator(()ident(arg)operator(\);) - ident(v) operator(=) ident(LONG2FIX)operator(()ident(i)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_FLOAT)operator(:) - operator({) - pre_type(double) ident(d)operator(,) ident(t) operator(=) float(0)float(.0)operator(;) - ident(VALUE) ident(str) operator(=) ident(r_bytes)operator(()ident(arg)operator(\);) - directive(const) pre_type(char) operator(*)ident(ptr) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - - reserved(if) operator(()ident(strcmp)operator(()ident(ptr)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) operator({) - ident(d) operator(=) ident(t) operator(/) ident(t)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(strcmp)operator(()ident(ptr)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) operator({) - ident(d) operator(=) float(1)float(.0) operator(/) ident(t)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(strcmp)operator(()ident(ptr)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) operator({) - ident(d) operator(=) operator(-)float(1)float(.0) operator(/) ident(t)operator(;) - operator(}) - reserved(else) operator({) - pre_type(char) operator(*)ident(e)operator(;) - ident(d) operator(=) ident(strtod)operator(()ident(ptr)operator(,) operator(&)ident(e)operator(\);) - ident(d) operator(=) ident(load_mantissa)operator(()ident(d)operator(,) ident(e)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) operator(()ident(e) operator(-) ident(ptr)operator(\)\);) - operator(}) - ident(v) operator(=) ident(rb_float_new)operator(()ident(d)operator(\);) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_BIGNUM)operator(:) - operator({) - pre_type(long) ident(len)operator(;) - ident(BDIGIT) operator(*)ident(digits)operator(;) - directive(volatile) ident(VALUE) ident(data)operator(;) - - ident(NEWOBJ)operator(()ident(big)operator(,) reserved(struct) ident(RBignum)operator(\);) - ident(OBJSETUP)operator(()ident(big)operator(,) ident(rb_cBignum)operator(,) ident(T_BIGNUM)operator(\);) - ident(big)operator(->)ident(sign) operator(=) operator(()ident(r_byte)operator(()ident(arg)operator(\)) operator(==) char('+')operator(\);) - ident(len) operator(=) ident(r_long)operator(()ident(arg)operator(\);) - ident(data) operator(=) ident(r_bytes0)operator(()ident(len) operator(*) integer(2)operator(,) ident(arg)operator(\);) -preprocessor(#if) ident(SIZEOF_BDIGITS) operator(==) ident(SIZEOF_SHORT) - ident(big)operator(->)ident(len) operator(=) ident(len)operator(;) -preprocessor(#else) - ident(big)operator(->)ident(len) operator(=) operator(()ident(len) operator(+) integer(1)operator(\)) operator(*) integer(2) operator(/) reserved(sizeof)operator(()ident(BDIGIT)operator(\);) -preprocessor(#endif) - ident(big)operator(->)ident(digits) operator(=) ident(digits) operator(=) ident(ALLOC_N)operator(()ident(BDIGIT)operator(,) ident(big)operator(->)ident(len)operator(\);) - ident(MEMCPY)operator(()ident(digits)operator(,) ident(RSTRING)operator(()ident(data)operator(\)->)ident(ptr)operator(,) pre_type(char)operator(,) ident(len) operator(*) integer(2)operator(\);) -preprocessor(#if) ident(SIZEOF_BDIGITS) operator(>) ident(SIZEOF_SHORT) - ident(MEMZERO)operator((()pre_type(char) operator(*\))ident(digits) operator(+) ident(len) operator(*) integer(2)operator(,) pre_type(char)operator(,) - ident(big)operator(->)ident(len) operator(*) reserved(sizeof)operator(()ident(BDIGIT)operator(\)) operator(-) ident(len) operator(*) integer(2)operator(\);) -preprocessor(#endif) - ident(len) operator(=) ident(big)operator(->)ident(len)operator(;) - reserved(while) operator(()ident(len) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(char) operator(*)ident(p) operator(=) operator(()pre_type(unsigned) pre_type(char) operator(*\))ident(digits)operator(;) - ident(BDIGIT) ident(num) operator(=) integer(0)operator(;) -preprocessor(#if) ident(SIZEOF_BDIGITS) operator(>) ident(SIZEOF_SHORT) - pre_type(int) ident(shift) operator(=) integer(0)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(SIZEOF_BDIGITS)operator(;) ident(i)operator(++\)) operator({) - ident(num) operator(|=) operator(()pre_type(int)operator(\))ident(p)operator([)ident(i)operator(]) operator(<<) ident(shift)operator(;) - ident(shift) operator(+=) integer(8)operator(;) - operator(}) -preprocessor(#else) - ident(num) operator(=) ident(p)operator([)integer(0)operator(]) operator(|) operator(()ident(p)operator([)integer(1)operator(]) operator(<<) integer(8)operator(\);) -preprocessor(#endif) - operator(*)ident(digits)operator(++) operator(=) ident(num)operator(;) - ident(len)operator(--;) - operator(}) - ident(v) operator(=) ident(rb_big_norm)operator((()ident(VALUE)operator(\))ident(big)operator(\);) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_STRING)operator(:) - ident(v) operator(=) ident(r_entry)operator(()ident(r_string)operator(()ident(arg)operator(\),) ident(arg)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(TYPE_REGEXP)operator(:) - operator({) - directive(volatile) ident(VALUE) ident(str) operator(=) ident(r_bytes)operator(()ident(arg)operator(\);) - pre_type(int) ident(options) operator(=) ident(r_byte)operator(()ident(arg)operator(\);) - ident(v) operator(=) ident(r_entry)operator(()ident(rb_reg_new)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) ident(options)operator(\),) ident(arg)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_ARRAY)operator(:) - operator({) - directive(volatile) pre_type(long) ident(len) operator(=) ident(r_long)operator(()ident(arg)operator(\);) comment(/* gcc 2.7.2.3 -O2 bug?? */) - - ident(v) operator(=) ident(rb_ary_new2)operator(()ident(len)operator(\);) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(rb_ary_push)operator(()ident(v)operator(,) ident(r_object)operator(()ident(arg)operator(\)\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_HASH)operator(:) - reserved(case) ident(TYPE_HASH_DEF)operator(:) - operator({) - pre_type(long) ident(len) operator(=) ident(r_long)operator(()ident(arg)operator(\);) - - ident(v) operator(=) ident(rb_hash_new)operator((\);) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(VALUE) ident(key) operator(=) ident(r_object)operator(()ident(arg)operator(\);) - ident(VALUE) ident(value) operator(=) ident(r_object)operator(()ident(arg)operator(\);) - ident(rb_hash_aset)operator(()ident(v)operator(,) ident(key)operator(,) ident(value)operator(\);) - operator(}) - reserved(if) operator(()ident(type) operator(==) ident(TYPE_HASH_DEF)operator(\)) operator({) - ident(RHASH)operator(()ident(v)operator(\)->)ident(ifnone) operator(=) ident(r_object)operator(()ident(arg)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_STRUCT)operator(:) - operator({) - ident(VALUE) ident(klass)operator(,) ident(mem)operator(,) ident(values)operator(;) - directive(volatile) pre_type(long) ident(i)operator(;) comment(/* gcc 2.7.2.3 -O2 bug?? */) - pre_type(long) ident(len)operator(;) - ident(ID) ident(slot)operator(;) - - ident(klass) operator(=) ident(path2class)operator(()ident(r_unique)operator(()ident(arg)operator(\)\);) - ident(mem) operator(=) ident(rb_struct_s_members)operator(()ident(klass)operator(\);) - reserved(if) operator(()ident(mem) operator(==) ident(Qnil)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(len) operator(=) ident(r_long)operator(()ident(arg)operator(\);) - - ident(values) operator(=) ident(rb_ary_new2)operator(()ident(len)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(values)operator(,) ident(Qnil)operator(\);) - operator(}) - ident(v) operator(=) ident(rb_struct_alloc)operator(()ident(klass)operator(,) ident(values)operator(\);) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(slot) operator(=) ident(r_symbol)operator(()ident(arg)operator(\);) - - reserved(if) operator(()ident(RARRAY)operator(()ident(mem)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(!=) ident(ID2SYM)operator(()ident(slot)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_class2name)operator(()ident(klass)operator(\),) - ident(rb_id2name)operator(()ident(slot)operator(\),) - ident(rb_id2name)operator(()ident(SYM2ID)operator(()ident(RARRAY)operator(()ident(mem)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)\)\);) - operator(}) - ident(rb_struct_aset)operator(()ident(v)operator(,) ident(LONG2FIX)operator(()ident(i)operator(\),) ident(r_object)operator(()ident(arg)operator(\)\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_USERDEF)operator(:) - operator({) - ident(VALUE) ident(klass) operator(=) ident(path2class)operator(()ident(r_unique)operator(()ident(arg)operator(\)\);) - ident(VALUE) ident(data)operator(;) - - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(klass)operator(,) ident(s_load)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_class2name)operator(()ident(klass)operator(\)\);) - operator(}) - ident(data) operator(=) ident(r_string)operator(()ident(arg)operator(\);) - reserved(if) operator(()ident(ivp)operator(\)) operator({) - ident(r_ivar)operator(()ident(data)operator(,) ident(arg)operator(\);) - operator(*)ident(ivp) operator(=) ident(Qfalse)operator(;) - operator(}) - ident(v) operator(=) ident(rb_funcall)operator(()ident(klass)operator(,) ident(s_load)operator(,) integer(1)operator(,) ident(data)operator(\);) - ident(check_load_arg)operator(()ident(arg)operator(,) ident(s_load)operator(\);) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_USRMARSHAL)operator(:) - operator({) - ident(VALUE) ident(klass) operator(=) ident(path2class)operator(()ident(r_unique)operator(()ident(arg)operator(\)\);) - ident(VALUE) ident(data)operator(;) - - ident(v) operator(=) ident(rb_obj_alloc)operator(()ident(klass)operator(\);) - reserved(if) operator((!) ident(NIL_P)operator(()ident(extmod)operator(\)\)) operator({) - reserved(while) operator(()ident(RARRAY)operator(()ident(extmod)operator(\)->)ident(len) operator(>) integer(0)operator(\)) operator({) - ident(VALUE) ident(m) operator(=) ident(rb_ary_pop)operator(()ident(extmod)operator(\);) - ident(rb_extend_object)operator(()ident(v)operator(,) ident(m)operator(\);) - operator(}) - operator(}) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(v)operator(,) ident(s_mload)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_class2name)operator(()ident(klass)operator(\)\);) - operator(}) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - ident(data) operator(=) ident(r_object)operator(()ident(arg)operator(\);) - ident(rb_funcall)operator(()ident(v)operator(,) ident(s_mload)operator(,) integer(1)operator(,) ident(data)operator(\);) - ident(check_load_arg)operator(()ident(arg)operator(,) ident(s_mload)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_OBJECT)operator(:) - operator({) - ident(VALUE) ident(klass) operator(=) ident(path2class)operator(()ident(r_unique)operator(()ident(arg)operator(\)\);) - - ident(v) operator(=) ident(rb_obj_alloc)operator(()ident(klass)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(!=) ident(T_OBJECT)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - ident(r_ivar)operator(()ident(v)operator(,) ident(arg)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_DATA)operator(:) - operator({) - ident(VALUE) ident(klass) operator(=) ident(path2class)operator(()ident(r_unique)operator(()ident(arg)operator(\)\);) - reserved(if) operator(()ident(rb_respond_to)operator(()ident(klass)operator(,) ident(s_alloc)operator(\)\)) operator({) - directive(static) pre_type(int) ident(warn) operator(=) ident(Qtrue)operator(;) - reserved(if) operator(()ident(warn)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - ident(warn) operator(=) ident(Qfalse)operator(;) - operator(}) - ident(v) operator(=) ident(rb_funcall)operator(()ident(klass)operator(,) ident(s_alloc)operator(,) integer(0)operator(\);) - ident(check_load_arg)operator(()ident(arg)operator(,) ident(s_alloc)operator(\);) - operator(}) - reserved(else) operator({) - ident(v) operator(=) ident(rb_obj_alloc)operator(()ident(klass)operator(\);) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(!=) ident(T_DATA)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(v)operator(,) ident(s_load_data)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) - stringoperator(,) - ident(rb_class2name)operator(()ident(klass)operator(\)\);) - operator(}) - ident(rb_funcall)operator(()ident(v)operator(,) ident(s_load_data)operator(,) integer(1)operator(,) ident(r_object0)operator(()ident(arg)operator(,) integer(0)operator(,) integer(0)operator(,) ident(extmod)operator(\)\);) - ident(check_load_arg)operator(()ident(arg)operator(,) ident(s_load_data)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_MODULE_OLD)operator(:) - operator({) - directive(volatile) ident(VALUE) ident(str) operator(=) ident(r_bytes)operator(()ident(arg)operator(\);) - - ident(v) operator(=) ident(rb_path2class)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_CLASS)operator(:) - operator({) - directive(volatile) ident(VALUE) ident(str) operator(=) ident(r_bytes)operator(()ident(arg)operator(\);) - - ident(v) operator(=) ident(path2class)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_MODULE)operator(:) - operator({) - directive(volatile) ident(VALUE) ident(str) operator(=) ident(r_bytes)operator(()ident(arg)operator(\);) - - ident(v) operator(=) ident(path2module)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - ident(r_entry)operator(()ident(v)operator(,) ident(arg)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(TYPE_SYMBOL)operator(:) - ident(v) operator(=) ident(ID2SYM)operator(()ident(r_symreal)operator(()ident(arg)operator(\)\);) - reserved(break)operator(;) - - reserved(case) ident(TYPE_SYMLINK)operator(:) - reserved(return) ident(ID2SYM)operator(()ident(r_symlink)operator(()ident(arg)operator(\)\);) - - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(type)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(proc)operator(\)) operator({) - ident(rb_funcall)operator(()ident(proc)operator(,) ident(s_call)operator(,) integer(1)operator(,) ident(v)operator(\);) - ident(check_load_arg)operator(()ident(arg)operator(,) ident(s_call)operator(\);) - operator(}) - reserved(return) ident(v)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(r_object)operator(()ident(arg)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(return) ident(r_object0)operator(()ident(arg)operator(,) ident(arg)operator(->)ident(proc)operator(,) integer(0)operator(,) ident(Qnil)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(load)operator(()ident(arg)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(return) ident(r_object)operator(()ident(arg)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(load_ensure)operator(()ident(arg)operator(\)) - reserved(struct) ident(load_arg) operator(*)ident(arg)operator(;) -operator({) - reserved(if) operator((!)ident(DATA_PTR)operator(()ident(arg)operator(->)ident(wrapper)operator(\)\)) reserved(return) integer(0)operator(;) - ident(st_free_table)operator(()ident(arg)operator(->)ident(symbols)operator(\);) - ident(st_free_table)operator(()ident(arg)operator(->)ident(data)operator(\);) - ident(DATA_PTR)operator(()ident(arg)operator(->)ident(wrapper)operator(\)) operator(=) integer(0)operator(;) - ident(arg)operator(->)ident(wrapper) operator(=) integer(0)operator(;) - reserved(return) integer(0)operator(;) -operator(}) - -comment(/* - * call-seq: - * load( source [, proc] \) => obj - * restore( source [, proc] \) => obj - * - * Returns the result of converting the serialized data in source into a - * Ruby object (possibly with associated subordinate objects\). source - * may be either an instance of IO or an object that responds to - * to_str. If proc is specified, it will be passed each object as it - * is deserialized. - */) -directive(static) ident(VALUE) -ident(marshal_load)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(port)operator(,) ident(proc)operator(;) - pre_type(int) ident(major)operator(,) ident(minor)operator(;) - ident(VALUE) ident(v)operator(;) - reserved(struct) ident(load_arg) ident(arg)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(port)operator(,) operator(&)ident(proc)operator(\);) - ident(v) operator(=) ident(rb_check_string_type)operator(()ident(port)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(v)operator(\)\)) operator({) - ident(arg)operator(.)ident(taint) operator(=) ident(OBJ_TAINTED)operator(()ident(port)operator(\);) comment(/* original taintedness */) - ident(port) operator(=) ident(v)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(rb_respond_to)operator(()ident(port)operator(,) ident(s_getc)operator(\)) operator(&&) ident(rb_respond_to)operator(()ident(port)operator(,) ident(s_read)operator(\)\)) operator({) - reserved(if) operator(()ident(rb_respond_to)operator(()ident(port)operator(,) ident(s_binmode)operator(\)\)) operator({) - ident(rb_funcall2)operator(()ident(port)operator(,) ident(s_binmode)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - ident(arg)operator(.)ident(taint) operator(=) ident(Qtrue)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(arg)operator(.)ident(src) operator(=) ident(port)operator(;) - ident(arg)operator(.)ident(offset) operator(=) integer(0)operator(;) - ident(arg)operator(.)ident(symbols) operator(=) ident(st_init_numtable)operator((\);) - ident(arg)operator(.)ident(data) operator(=) ident(st_init_numtable)operator((\);) - ident(arg)operator(.)ident(proc) operator(=) integer(0)operator(;) - ident(arg)operator(.)ident(wrapper) operator(=) ident(Data_Wrap_Struct)operator(()ident(rb_cData)operator(,) ident(mark_load_arg)operator(,) integer(0)operator(,) operator(&)ident(arg)operator(\);) - - ident(major) operator(=) ident(r_byte)operator((&)ident(arg)operator(\);) - ident(minor) operator(=) ident(r_byte)operator((&)ident(arg)operator(\);) - reserved(if) operator(()ident(major) operator(!=) ident(MARSHAL_MAJOR) operator(||) ident(minor) operator(>) ident(MARSHAL_MINOR)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(MARSHAL_MAJOR)operator(,) ident(MARSHAL_MINOR)operator(,) ident(major)operator(,) ident(minor)operator(\);) - operator(}) - reserved(if) operator(()ident(RTEST)operator(()ident(ruby_verbose)operator(\)) operator(&&) ident(minor) operator(!=) ident(MARSHAL_MINOR)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) - ident(MARSHAL_MAJOR)operator(,) ident(MARSHAL_MINOR)operator(,) ident(major)operator(,) ident(minor)operator(\);) - operator(}) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(proc)operator(\)\)) ident(arg)operator(.)ident(proc) operator(=) ident(proc)operator(;) - ident(v) operator(=) ident(rb_ensure)operator(()ident(load)operator(,) operator(()ident(VALUE)operator(\)&)ident(arg)operator(,) ident(load_ensure)operator(,) operator(()ident(VALUE)operator(\)&)ident(arg)operator(\);) - - reserved(return) ident(v)operator(;) -operator(}) - -comment(/* - * The marshaling library converts collections of Ruby objects into a - * byte stream, allowing them to be stored outside the currently - * active script. This data may subsequently be read and the original - * objects reconstituted. - * Marshaled data has major and minor version numbers stored along - * with the object information. In normal use, marshaling can only - * load data written with the same major version number and an equal - * or lower minor version number. If Ruby's ``verbose'' flag is set - * (normally using -d, -v, -w, or --verbose\) the major and minor - * numbers must match exactly. Marshal versioning is independent of - * Ruby's version numbers. You can extract the version by reading the - * first two bytes of marshaled data. - * - * str = Marshal.dump("thing"\) - * RUBY_VERSION #=> "1.8.0" - * str[0] #=> 4 - * str[1] #=> 8 - * - * Some objects cannot be dumped: if the objects to be dumped include - * bindings, procedure or method objects, instances of class IO, or - * singleton objects, a TypeError will be raised. - * If your class has special serialization needs (for example, if you - * want to serialize in some specific format\), or if it contains - * objects that would otherwise not be serializable, you can implement - * your own serialization strategy by defining two methods, _dump and - * _load: - * The instance method _dump should return a String object containing - * all the information necessary to reconstitute objects of this class - * and all referenced objects up to a maximum depth given as an integer - * parameter (a value of -1 implies that you should disable depth checking\). - * The class method _load should take a String and return an object of this class. - */) -directive(void) -ident(Init_marshal)operator((\)) -operator({) - ident(VALUE) ident(rb_mMarshal) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - - ident(s_dump) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(s_load) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(s_mdump) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(s_mload) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(s_dump_data) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(s_load_data) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(s_alloc) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(s_call) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(s_getc) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(s_read) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(s_write) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(s_binmode) operator(=) ident(rb_intern)operator(()stringoperator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mMarshal)operator(,) stringoperator(,) ident(marshal_dump)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMarshal)operator(,) stringoperator(,) ident(marshal_load)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMarshal)operator(,) stringoperator(,) ident(marshal_load)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_const)operator(()ident(rb_mMarshal)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(MARSHAL_MAJOR)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_mMarshal)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(MARSHAL_MINOR)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_marshal_dump)operator(()ident(obj)operator(,) ident(port)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(port)operator(;) -operator({) - pre_type(int) ident(argc) operator(=) integer(1)operator(;) - ident(VALUE) ident(argv)operator([)integer(2)operator(];) - - ident(argv)operator([)integer(0)operator(]) operator(=) ident(obj)operator(;) - ident(argv)operator([)integer(1)operator(]) operator(=) ident(port)operator(;) - reserved(if) operator((!)ident(NIL_P)operator(()ident(port)operator(\)\)) ident(argc) operator(=) integer(2)operator(;) - reserved(return) ident(marshal_dump)operator(()ident(argc)operator(,) ident(argv)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_marshal_load)operator(()ident(port)operator(\)) - ident(VALUE) ident(port)operator(;) -operator({) - reserved(return) ident(marshal_load)operator(()integer(1)operator(,) operator(&)ident(port)operator(\);) -operator(}) -comment(/********************************************************************** - - math.c - - - $Author: shyouhei $ - $Date: 2008-07-02 11:25:48 +0200 (Wed, 02 Jul 2008\) $ - created at: Tue Jan 25 14:12:56 JST 1994 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include() -preprocessor(#include) include() - -ident(VALUE) ident(rb_mMath)operator(;) - -preprocessor(#define) ident(Need_Float)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) operator(=) ident(rb_Float)operator(()ident(x)operator(\)) -preprocessor(#define) ident(Need_Float2)operator(()ident(x)operator(,)ident(y)operator(\)) reserved(do) operator({)\ - ident(Need_Float)operator(()ident(x)operator(\);)\ - ident(Need_Float)operator(()ident(y)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -directive(static) directive(void) -ident(domain_check)operator(()ident(x)operator(,) ident(msg)operator(\)) - pre_type(double) ident(x)operator(;) - pre_type(char) operator(*)ident(msg)operator(;) -operator({) - reserved(while)operator(()integer(1)operator(\)) operator({) - reserved(if) operator(()ident(errno)operator(\)) operator({) - ident(rb_sys_fail)operator(()ident(msg)operator(\);) - operator(}) - reserved(if) operator(()ident(isnan)operator(()ident(x)operator(\)\)) operator({) -preprocessor(#if) ident(defined)operator(()ident(EDOM)operator(\)) - ident(errno) operator(=) ident(EDOM)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(ERANGE)operator(\)) - ident(errno) operator(=) ident(ERANGE)operator(;) -preprocessor(#endif) - reserved(continue)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) -operator(}) - - -comment(/* - * call-seq: - * Math.atan2(y, x\) => float - * - * Computes the arc tangent given y and x. Returns - * -PI..PI. - * - */) - -directive(static) ident(VALUE) -ident(math_atan2)operator(()ident(obj)operator(,) ident(y)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(Need_Float2)operator(()ident(y)operator(,) ident(x)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(atan2)operator(()ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(,) ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * Math.cos(x\) => float - * - * Computes the cosine of x (expressed in radians\). Returns - * -1..1. - */) - -directive(static) ident(VALUE) -ident(math_cos)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(cos)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * Math.sin(x\) => float - * - * Computes the sine of x (expressed in radians\). Returns - * -1..1. - */) - -directive(static) ident(VALUE) -ident(math_sin)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - - reserved(return) ident(rb_float_new)operator(()ident(sin)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * Math.tan(x\) => float - * - * Returns the tangent of x (expressed in radians\). - */) - -directive(static) ident(VALUE) -ident(math_tan)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - - reserved(return) ident(rb_float_new)operator(()ident(tan)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * Math.acos(x\) => float - * - * Computes the arc cosine of x. Returns 0..PI. - */) - -directive(static) ident(VALUE) -ident(math_acos)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - pre_type(double) ident(d)operator(;) - - ident(Need_Float)operator(()ident(x)operator(\);) - ident(errno) operator(=) integer(0)operator(;) - ident(d) operator(=) ident(acos)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\);) - ident(domain_check)operator(()ident(d)operator(,) stringoperator(\);) - reserved(return) ident(rb_float_new)operator(()ident(d)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Math.asin(x\) => float - * - * Computes the arc sine of x. Returns 0..PI. - */) - -directive(static) ident(VALUE) -ident(math_asin)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - pre_type(double) ident(d)operator(;) - - ident(Need_Float)operator(()ident(x)operator(\);) - ident(errno) operator(=) integer(0)operator(;) - ident(d) operator(=) ident(asin)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\);) - ident(domain_check)operator(()ident(d)operator(,) stringoperator(\);) - reserved(return) ident(rb_float_new)operator(()ident(d)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Math.atan(x\) => float - * - * Computes the arc tangent of x. Returns -{PI/2} .. {PI/2}. - */) - -directive(static) ident(VALUE) -ident(math_atan)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(atan)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - -preprocessor(#ifndef) ident(HAVE_COSH) -pre_type(double) -ident(cosh)operator(()ident(x)operator(\)) - pre_type(double) ident(x)operator(;) -operator({) - reserved(return) operator(()ident(exp)operator(()ident(x)operator(\)) operator(+) ident(exp)operator((-)ident(x)operator(\)\)) operator(/) integer(2)operator(;) -operator(}) -preprocessor(#endif) - -comment(/* - * call-seq: - * Math.cosh(x\) => float - * - * Computes the hyperbolic cosine of x (expressed in radians\). - */) - -directive(static) ident(VALUE) -ident(math_cosh)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - - reserved(return) ident(rb_float_new)operator(()ident(cosh)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - -preprocessor(#ifndef) ident(HAVE_SINH) -pre_type(double) -ident(sinh)operator(()ident(x)operator(\)) - pre_type(double) ident(x)operator(;) -operator({) - reserved(return) operator(()ident(exp)operator(()ident(x)operator(\)) operator(-) ident(exp)operator((-)ident(x)operator(\)\)) operator(/) integer(2)operator(;) -operator(}) -preprocessor(#endif) - -comment(/* - * call-seq: - * Math.sinh(x\) => float - * - * Computes the hyperbolic sine of x (expressed in - * radians\). - */) - -directive(static) ident(VALUE) -ident(math_sinh)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(sinh)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - -preprocessor(#ifndef) ident(HAVE_TANH) -pre_type(double) -ident(tanh)operator(()ident(x)operator(\)) - pre_type(double) ident(x)operator(;) -operator({) - reserved(return) ident(sinh)operator(()ident(x)operator(\)) operator(/) ident(cosh)operator(()ident(x)operator(\);) -operator(}) -preprocessor(#endif) - -comment(/* - * call-seq: - * Math.tanh(\) => float - * - * Computes the hyperbolic tangent of x (expressed in - * radians\). - */) - -directive(static) ident(VALUE) -ident(math_tanh)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(tanh)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * Math.acosh(x\) => float - * - * Computes the inverse hyperbolic cosine of x. - */) - -directive(static) ident(VALUE) -ident(math_acosh)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - pre_type(double) ident(d)operator(;) - - ident(Need_Float)operator(()ident(x)operator(\);) - ident(errno) operator(=) integer(0)operator(;) - ident(d) operator(=) ident(acosh)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\);) - ident(domain_check)operator(()ident(d)operator(,) stringoperator(\);) - reserved(return) ident(rb_float_new)operator(()ident(d)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Math.asinh(x\) => float - * - * Computes the inverse hyperbolic sine of x. - */) - -directive(static) ident(VALUE) -ident(math_asinh)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(asinh)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * Math.atanh(x\) => float - * - * Computes the inverse hyperbolic tangent of x. - */) - -directive(static) ident(VALUE) -ident(math_atanh)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - pre_type(double) ident(d)operator(;) - - ident(Need_Float)operator(()ident(x)operator(\);) - ident(errno) operator(=) integer(0)operator(;) - ident(d) operator(=) ident(atanh)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\);) - ident(domain_check)operator(()ident(d)operator(,) stringoperator(\);) - reserved(return) ident(rb_float_new)operator(()ident(d)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Math.exp(x\) => float - * - * Returns e**x. - */) - -directive(static) ident(VALUE) -ident(math_exp)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(exp)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - -preprocessor(#if) ident(defined) ident(__CYGWIN__) -preprocessor(# include) include() -preprocessor(# if) ident(CYGWIN_VERSION_DLL_MAJOR) operator(<) integer(1005) -preprocessor(# define) ident(nan)operator(()ident(x)operator(\)) ident(nan)operator((\)) -preprocessor(# endif) -preprocessor(# define) ident(log)operator(()ident(x)operator(\)) operator((()ident(x)operator(\)) operator(<) float(0)float(.0) operator(?) ident(nan)operator(()stringoperator(\)) operator(:) ident(log)operator(()ident(x)operator(\)\)) -preprocessor(# define) ident(log10)operator(()ident(x)operator(\)) operator((()ident(x)operator(\)) operator(<) float(0)float(.0) operator(?) ident(nan)operator(()stringoperator(\)) operator(:) ident(log10)operator(()ident(x)operator(\)\)) -preprocessor(#endif) - -comment(/* - * call-seq: - * Math.log(numeric\) => float - * - * Returns the natural logarithm of numeric. - */) - -directive(static) ident(VALUE) -ident(math_log)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - pre_type(double) ident(d)operator(;) - - ident(Need_Float)operator(()ident(x)operator(\);) - ident(errno) operator(=) integer(0)operator(;) - ident(d) operator(=) ident(log)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\);) - ident(domain_check)operator(()ident(d)operator(,) stringoperator(\);) - reserved(return) ident(rb_float_new)operator(()ident(d)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Math.log10(numeric\) => float - * - * Returns the base 10 logarithm of numeric. - */) - -directive(static) ident(VALUE) -ident(math_log10)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - pre_type(double) ident(d)operator(;) - - ident(Need_Float)operator(()ident(x)operator(\);) - ident(errno) operator(=) integer(0)operator(;) - ident(d) operator(=) ident(log10)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\);) - ident(domain_check)operator(()ident(d)operator(,) stringoperator(\);) - reserved(return) ident(rb_float_new)operator(()ident(d)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Math.sqrt(numeric\) => float - * - * Returns the non-negative square root of numeric. - */) - -directive(static) ident(VALUE) -ident(math_sqrt)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - pre_type(double) ident(d)operator(;) - - ident(Need_Float)operator(()ident(x)operator(\);) - ident(errno) operator(=) integer(0)operator(;) - ident(d) operator(=) ident(sqrt)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\);) - ident(domain_check)operator(()ident(d)operator(,) stringoperator(\);) - reserved(return) ident(rb_float_new)operator(()ident(d)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Math.frexp(numeric\) => [ fraction, exponent ] - * - * Returns a two-element array containing the normalized fraction (a - * Float\) and exponent (a Fixnum\) of - * numeric. - * - * fraction, exponent = Math.frexp(1234\) #=> [0.6025390625, 11] - * fraction * 2**exponent #=> 1234.0 - */) - -directive(static) ident(VALUE) -ident(math_frexp)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - pre_type(double) ident(d)operator(;) - pre_type(int) ident(exp)operator(;) - - ident(Need_Float)operator(()ident(x)operator(\);) - - ident(d) operator(=) ident(frexp)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(,) operator(&)ident(exp)operator(\);) - reserved(return) ident(rb_assoc_new)operator(()ident(rb_float_new)operator(()ident(d)operator(\),) ident(INT2NUM)operator(()ident(exp)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * Math.ldexp(flt, int\) -> float - * - * Returns the value of flt*(2**int\). - * - * fraction, exponent = Math.frexp(1234\) - * Math.ldexp(fraction, exponent\) #=> 1234.0 - */) - -directive(static) ident(VALUE) -ident(math_ldexp)operator(()ident(obj)operator(,) ident(x)operator(,) ident(n)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(,) ident(n)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(ldexp)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(,) ident(NUM2INT)operator(()ident(n)operator(\)\)\);) -operator(}) - -comment(/* - * call-seq: - * Math.hypot(x, y\) => float - * - * Returns sqrt(x**2 + y**2\), the hypotenuse of a right-angled triangle - * with sides x and y. - * - * Math.hypot(3, 4\) #=> 5.0 - */) - -directive(static) ident(VALUE) -ident(math_hypot)operator(()ident(obj)operator(,) ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(Need_Float2)operator(()ident(x)operator(,) ident(y)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(hypot)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(,) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * Math.erf(x\) => float - * - * Calculates the error function of x. - */) - -directive(static) ident(VALUE) -ident(math_erf)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(erf)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * Math.erfc(x\) => float - * - * Calculates the complementary error function of x. - */) - -directive(static) ident(VALUE) -ident(math_erfc)operator(()ident(obj)operator(,) ident(x)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(x)operator(;) -operator({) - ident(Need_Float)operator(()ident(x)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(erfc)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(\)\);) -operator(}) - -comment(/* - * The Math module contains module functions for basic - * trigonometric and transcendental functions. See class - * Float for a list of constants that - * define Ruby's floating point accuracy. - */) - - -directive(void) -ident(Init_Math)operator((\)) -operator({) - ident(rb_mMath) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - -preprocessor(#ifdef) ident(M_PI) - ident(rb_define_const)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(rb_float_new)operator(()ident(M_PI)operator(\)\);) -preprocessor(#else) - ident(rb_define_const)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(rb_float_new)operator(()ident(atan)operator(()float(1)float(.0)operator(\)*)float(4)float(.0)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifdef) ident(M_E) - ident(rb_define_const)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(rb_float_new)operator(()ident(M_E)operator(\)\);) -preprocessor(#else) - ident(rb_define_const)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(rb_float_new)operator(()ident(exp)operator(()float(1)float(.0)operator(\)\)\);) -preprocessor(#endif) - - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_atan2)operator(,) integer(2)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_cos)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_sin)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_tan)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_acos)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_asin)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_atan)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_cosh)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_sinh)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_tanh)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_acosh)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_asinh)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_atanh)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_exp)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_log)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_log10)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_sqrt)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_frexp)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_ldexp)operator(,) integer(2)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_hypot)operator(,) integer(2)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_erf)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mMath)operator(,) stringoperator(,) ident(math_erfc)operator(,) integer(1)operator(\);) -operator(}) -comment(/********************************************************************** - - numeric.c - - - $Author: wyhaines $ - $Date: 2009-07-14 17:05:27 +0200 (Tue, 14 Jul 2009\) $ - created at: Fri Aug 13 18:33:09 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("env.h") -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#if) ident(defined)operator(()ident(__FreeBSD__)operator(\)) operator(&&) ident(__FreeBSD__) operator(<) integer(4) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_FLOAT_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_IEEEFP_H) -preprocessor(#include) include() -preprocessor(#endif) - -comment(/* use IEEE 64bit values if not defined */) -preprocessor(#ifndef) ident(FLT_RADIX) -preprocessor(#define) ident(FLT_RADIX) integer(2) -preprocessor(#endif) -preprocessor(#ifndef) ident(FLT_ROUNDS) -preprocessor(#define) ident(FLT_ROUNDS) integer(1) -preprocessor(#endif) -preprocessor(#ifndef) ident(DBL_MIN) -preprocessor(#define) ident(DBL_MIN) float(2)float(.2250738585072014e-308) -preprocessor(#endif) -preprocessor(#ifndef) ident(DBL_MAX) -preprocessor(#define) ident(DBL_MAX) float(1)float(.7976931348623157e+308) -preprocessor(#endif) -preprocessor(#ifndef) ident(DBL_MIN_EXP) -preprocessor(#define) ident(DBL_MIN_EXP) operator((-)integer(1021)operator(\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(DBL_MAX_EXP) -preprocessor(#define) ident(DBL_MAX_EXP) integer(1024) -preprocessor(#endif) -preprocessor(#ifndef) ident(DBL_MIN_10_EXP) -preprocessor(#define) ident(DBL_MIN_10_EXP) operator((-)integer(307)operator(\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(DBL_MAX_10_EXP) -preprocessor(#define) ident(DBL_MAX_10_EXP) integer(308) -preprocessor(#endif) -preprocessor(#ifndef) ident(DBL_DIG) -preprocessor(#define) ident(DBL_DIG) integer(15) -preprocessor(#endif) -preprocessor(#ifndef) ident(DBL_MANT_DIG) -preprocessor(#define) ident(DBL_MANT_DIG) integer(53) -preprocessor(#endif) -preprocessor(#ifndef) ident(DBL_EPSILON) -preprocessor(#define) ident(DBL_EPSILON) float(2)float(.2204460492503131e-16) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_ROUND) -pre_type(double) -ident(round)operator(()ident(x)operator(\)) - pre_type(double) ident(x)operator(;) -operator({) - pre_type(double) ident(f)operator(;) - - reserved(if) operator(()ident(x) operator(>) float(0)float(.0)operator(\)) operator({) - ident(f) operator(=) ident(floor)operator(()ident(x)operator(\);) - ident(x) operator(=) ident(f) operator(+) operator(()ident(x) operator(-) ident(f) operator(>=) float(0)float(.5)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(x) operator(<) float(0)float(.0)operator(\)) operator({) - ident(f) operator(=) ident(ceil)operator(()ident(x)operator(\);) - ident(x) operator(=) ident(f) operator(-) operator(()ident(f) operator(-) ident(x) operator(>=) float(0)float(.5)operator(\);) - operator(}) - reserved(return) ident(x)operator(;) -operator(}) -preprocessor(#endif) - -directive(static) ident(ID) ident(id_coerce)operator(,) ident(id_to_i)operator(,) ident(id_eq)operator(;) - -ident(VALUE) ident(rb_cNumeric)operator(;) -ident(VALUE) ident(rb_cFloat)operator(;) -ident(VALUE) ident(rb_cInteger)operator(;) -ident(VALUE) ident(rb_cFixnum)operator(;) - -ident(VALUE) ident(rb_eZeroDivError)operator(;) -ident(VALUE) ident(rb_eFloatDomainError)operator(;) - -directive(void) -ident(rb_num_zerodiv)operator((\)) -operator({) - ident(rb_raise)operator(()ident(rb_eZeroDivError)operator(,) stringoperator(\);) -operator(}) - - -comment(/* - * call-seq: - * num.coerce(numeric\) => array - * - * If aNumeric is the same type as num, returns an array - * containing aNumeric and num. Otherwise, returns an - * array with both aNumeric and num represented as - * Float objects. This coercion mechanism is used by - * Ruby to handle mixed-type numeric operations: it is intended to - * find a compatible common type between the two operands of the operator. - * - * 1.coerce(2.5\) #=> [2.5, 1.0] - * 1.2.coerce(3\) #=> [3.0, 1.2] - * 1.coerce(2\) #=> [2, 1] - */) - -directive(static) ident(VALUE) -ident(num_coerce)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(CLASS_OF)operator(()ident(x)operator(\)) operator(==) ident(CLASS_OF)operator(()ident(y)operator(\)\)) - reserved(return) ident(rb_assoc_new)operator(()ident(y)operator(,) ident(x)operator(\);) - ident(x) operator(=) ident(rb_Float)operator(()ident(x)operator(\);) - ident(y) operator(=) ident(rb_Float)operator(()ident(y)operator(\);) - reserved(return) ident(rb_assoc_new)operator(()ident(y)operator(,) ident(x)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(coerce_body)operator(()ident(x)operator(\)) - ident(VALUE) operator(*)ident(x)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(x)operator([)integer(1)operator(],) ident(id_coerce)operator(,) integer(1)operator(,) ident(x)operator([)integer(0)operator(]\);) -operator(}) - -directive(static) ident(VALUE) -ident(coerce_rescue)operator(()ident(x)operator(\)) - ident(VALUE) operator(*)ident(x)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(v) operator(=) ident(rb_inspect)operator(()ident(x)operator([)integer(1)operator(]\);) - - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_special_const_p)operator(()ident(x)operator([)integer(1)operator(]\)?) - ident(RSTRING)operator(()ident(v)operator(\)->)ident(ptr)operator(:) - ident(rb_obj_classname)operator(()ident(x)operator([)integer(1)operator(]\),) - ident(rb_obj_classname)operator(()ident(x)operator([)integer(0)operator(]\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* dummy */) -operator(}) - -directive(static) pre_type(int) -ident(do_coerce)operator(()ident(x)operator(,) ident(y)operator(,) ident(err)operator(\)) - ident(VALUE) operator(*)ident(x)operator(,) operator(*)ident(y)operator(;) - pre_type(int) ident(err)operator(;) -operator({) - ident(VALUE) ident(ary)operator(;) - ident(VALUE) ident(a)operator([)integer(2)operator(];) - - ident(a)operator([)integer(0)operator(]) operator(=) operator(*)ident(x)operator(;) ident(a)operator([)integer(1)operator(]) operator(=) operator(*)ident(y)operator(;) - - ident(ary) operator(=) ident(rb_rescue)operator(()ident(coerce_body)operator(,) operator(()ident(VALUE)operator(\))ident(a)operator(,) ident(err)operator(?)ident(coerce_rescue)operator(:)integer(0)operator(,) operator(()ident(VALUE)operator(\))ident(a)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(ary)operator(\)) operator(!=) ident(T_ARRAY) operator(||) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len) operator(!=) integer(2)operator(\)) operator({) - reserved(if) operator(()ident(err)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(Qfalse)operator(;) - operator(}) - - operator(*)ident(x) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - operator(*)ident(y) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)integer(1)operator(];) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -ident(VALUE) -ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(do_coerce)operator((&)ident(x)operator(,) operator(&)ident(y)operator(,) ident(Qtrue)operator(\);) - reserved(return) ident(rb_funcall)operator(()ident(x)operator(,) ident(ruby_frame)operator(->)ident(orig_func)operator(,) integer(1)operator(,) ident(y)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_num_coerce_cmp)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(do_coerce)operator((&)ident(x)operator(,) operator(&)ident(y)operator(,) ident(Qfalse)operator(\)\)) - reserved(return) ident(rb_funcall)operator(()ident(x)operator(,) ident(ruby_frame)operator(->)ident(orig_func)operator(,) integer(1)operator(,) ident(y)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -ident(VALUE) -ident(rb_num_coerce_relop)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(c)operator(,) ident(x0) operator(=) ident(x)operator(,) ident(y0) operator(=) ident(y)operator(;) - - reserved(if) operator((!)ident(do_coerce)operator((&)ident(x)operator(,) operator(&)ident(y)operator(,) ident(Qfalse)operator(\)) operator(||) - ident(NIL_P)operator(()ident(c) operator(=) ident(rb_funcall)operator(()ident(x)operator(,) ident(ruby_frame)operator(->)ident(orig_func)operator(,) integer(1)operator(,) ident(y)operator(\)\)\)) operator({) - ident(rb_cmperr)operator(()ident(x0)operator(,) ident(y0)operator(\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) - operator(}) - reserved(return) ident(c)operator(;) -operator(}) - -comment(/* - * Trap attempts to add methods to Numeric objects. Always - * raises a TypeError - */) - -directive(static) ident(VALUE) -ident(num_sadded)operator(()ident(x)operator(,) ident(name)operator(\)) - ident(VALUE) ident(x)operator(,) ident(name)operator(;) -operator({) - ident(ruby_frame) operator(=) ident(ruby_frame)operator(->)ident(prev)operator(;) comment(/* pop frame for "singleton_method_added" */) - comment(/* Numerics should be values; singleton_methods should not be added to them */) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) - stringoperator(,) - ident(rb_id2name)operator(()ident(rb_to_id)operator(()ident(name)operator(\)\),) - ident(rb_obj_classname)operator(()ident(x)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -comment(/* :nodoc: */) -directive(static) ident(VALUE) -ident(num_init_copy)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - comment(/* Numerics are immutable values, which should not be copied */) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(rb_obj_classname)operator(()ident(x)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -comment(/* - * call-seq: - * +num => num - * - * Unary Plus---Returns the receiver's value. - */) - -directive(static) ident(VALUE) -ident(num_uplus)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(return) ident(num)operator(;) -operator(}) - -comment(/* - * call-seq: - * -num => numeric - * - * Unary Minus---Returns the receiver's value, negated. - */) - -directive(static) ident(VALUE) -ident(num_uminus)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - ident(VALUE) ident(zero)operator(;) - - ident(zero) operator(=) ident(INT2FIX)operator(()integer(0)operator(\);) - ident(do_coerce)operator((&)ident(zero)operator(,) operator(&)ident(num)operator(,) ident(Qtrue)operator(\);) - - reserved(return) ident(rb_funcall)operator(()ident(zero)operator(,) char('-')operator(,) integer(1)operator(,) ident(num)operator(\);) -operator(}) - -comment(/* - * call-seq: - * num.quo(numeric\) => result - * - * Equivalent to Numeric#/, but overridden in subclasses. - */) - -directive(static) ident(VALUE) -ident(num_quo)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(x)operator(,) char('/')operator(,) integer(1)operator(,) ident(y)operator(\);) -operator(}) - - -directive(static) ident(VALUE) ident(num_floor)operator(()ident(VALUE) ident(num)operator(\);) - -comment(/* - * call-seq: - * num.div(numeric\) => integer - * - * Uses / to perform division, then converts the result to - * an integer. Numeric does not define the / - * operator; this is left to subclasses. - */) - -directive(static) ident(VALUE) -ident(num_div)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(return) ident(num_floor)operator(()ident(rb_funcall)operator(()ident(x)operator(,) char('/')operator(,) integer(1)operator(,) ident(y)operator(\)\);) -operator(}) - - - -comment(/* - * call-seq: - * num.divmod( aNumeric \) -> anArray - * - * Returns an array containing the quotient and modulus obtained by - * dividing num by aNumeric. If q, r = - * x.divmod(y\), then - * - * q = floor(float(x\)/float(y\)\) - * x = q*y + r - * - * The quotient is rounded toward -infinity, as shown in the following table: - * - * a | b | a.divmod(b\) | a/b | a.modulo(b\) | a.remainder(b\) - * ------+-----+---------------+---------+-------------+--------------- - * 13 | 4 | 3, 1 | 3 | 1 | 1 - * ------+-----+---------------+---------+-------------+--------------- - * 13 | -4 | -4, -3 | -3 | -3 | 1 - * ------+-----+---------------+---------+-------------+--------------- - * -13 | 4 | -4, 3 | -4 | 3 | -1 - * ------+-----+---------------+---------+-------------+--------------- - * -13 | -4 | 3, -1 | 3 | -1 | -1 - * ------+-----+---------------+---------+-------------+--------------- - * 11.5 | 4 | 2, 3.5 | 2.875 | 3.5 | 3.5 - * ------+-----+---------------+---------+-------------+--------------- - * 11.5 | -4 | -3, -0.5 | -2.875 | -0.5 | 3.5 - * ------+-----+---------------+---------+-------------+--------------- - * -11.5 | 4 | -3, 0.5 | -2.875 | 0.5 | -3.5 - * ------+-----+---------------+---------+-------------+--------------- - * -11.5 | -4 | 2 -3.5 | 2.875 | -3.5 | -3.5 - * - * - * Examples - * 11.divmod(3\) #=> [3, 2] - * 11.divmod(-3\) #=> [-4, -1] - * 11.divmod(3.5\) #=> [3, 0.5] - * (-11\).divmod(3.5\) #=> [-4, 3.0] - * (11.5\).divmod(3.5\) #=> [3, 1.0] - */) - -directive(static) ident(VALUE) -ident(num_divmod)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(return) ident(rb_assoc_new)operator(()ident(num_div)operator(()ident(x)operator(,) ident(y)operator(\),) ident(rb_funcall)operator(()ident(x)operator(,) char('%')operator(,) integer(1)operator(,) ident(y)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * num.modulo(numeric\) => result - * - * Equivalent to - * num.divmod(aNumeric\)[1]. - */) - -directive(static) ident(VALUE) -ident(num_modulo)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(x)operator(,) char('%')operator(,) integer(1)operator(,) ident(y)operator(\);) -operator(}) - -comment(/* - * call-seq: - * num.remainder(numeric\) => result - * - * If num and numeric have different signs, returns - * mod-numeric; otherwise, returns mod. In - * both cases mod is the value - * num.modulo(numeric\). The - * differences between remainder and modulo - * (%\) are shown in the table under Numeric#divmod. - */) - -directive(static) ident(VALUE) -ident(num_remainder)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - ident(VALUE) ident(z) operator(=) ident(rb_funcall)operator(()ident(x)operator(,) char('%')operator(,) integer(1)operator(,) ident(y)operator(\);) - - reserved(if) operator(((!)ident(rb_equal)operator(()ident(z)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)) operator(&&) - operator((()ident(RTEST)operator(()ident(rb_funcall)operator(()ident(x)operator(,) char('<')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)) operator(&&) - ident(RTEST)operator(()ident(rb_funcall)operator(()ident(y)operator(,) char('>')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)\)) operator(||) - operator(()ident(RTEST)operator(()ident(rb_funcall)operator(()ident(x)operator(,) char('>')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)) operator(&&) - ident(RTEST)operator(()ident(rb_funcall)operator(()ident(y)operator(,) char('<')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)\)\)\)) operator({) - reserved(return) ident(rb_funcall)operator(()ident(z)operator(,) char('-')operator(,) integer(1)operator(,) ident(y)operator(\);) - operator(}) - reserved(return) ident(z)operator(;) -operator(}) - -comment(/* - * call-seq: - * num.integer? -> true or false - * - * Returns true if num is an Integer - * (including Fixnum and Bignum\). - */) - -directive(static) ident(VALUE) -ident(num_int_p)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * num.abs => num or numeric - * - * Returns the absolute value of num. - * - * 12.abs #=> 12 - * (-34.56\).abs #=> 34.56 - * -34.56.abs #=> 34.56 - */) - -directive(static) ident(VALUE) -ident(num_abs)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_funcall)operator(()ident(num)operator(,) char('<')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)\)) operator({) - reserved(return) ident(rb_funcall)operator(()ident(num)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(\);) - operator(}) - reserved(return) ident(num)operator(;) -operator(}) - - -comment(/* - * call-seq: - * num.zero? => true or false - * - * Returns true if num has a zero value. - */) - -directive(static) ident(VALUE) -ident(num_zero_p)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(if) operator(()ident(rb_equal)operator(()ident(num)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * num.nonzero? => num or nil - * - * Returns num if num is not zero, nil - * otherwise. This behavior is useful when chaining comparisons: - * - * a = %w( z Bb bB bb BB a aA Aa AA A \) - * b = a.sort {|a,b| (a.downcase <=> b.downcase\).nonzero? || a <=> b } - * b #=> ["A", "a", "AA", "Aa", "aA", "BB", "Bb", "bB", "bb", "z"] - */) - -directive(static) ident(VALUE) -ident(num_nonzero_p)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_funcall)operator(()ident(num)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(,) integer(0)operator(\)\)\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(num)operator(;) -operator(}) - -comment(/* - * call-seq: - * num.to_int => integer - * - * Invokes the child class's to_i method to convert - * num to an integer. - */) - -directive(static) ident(VALUE) -ident(num_to_int)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(num)operator(,) ident(id_to_i)operator(,) integer(0)operator(,) integer(0)operator(\);) -operator(}) - - -comment(/******************************************************************** - * - * Document-class: Float - * - * Float objects represent real numbers using the native - * architecture's double-precision floating point representation. - */) - -ident(VALUE) -ident(rb_float_new)operator(()ident(d)operator(\)) - pre_type(double) ident(d)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(flt)operator(,) reserved(struct) ident(RFloat)operator(\);) - ident(OBJSETUP)operator(()ident(flt)operator(,) ident(rb_cFloat)operator(,) ident(T_FLOAT)operator(\);) - - ident(flt)operator(->)ident(value) operator(=) ident(d)operator(;) - reserved(return) operator(()ident(VALUE)operator(\))ident(flt)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt.to_s => string - * - * Returns a string containing a representation of self. As well as a - * fixed or exponential form of the number, the call may return - * ``NaN'', ``Infinity'', and - * ``-Infinity''. - */) - -directive(static) ident(VALUE) -ident(flo_to_s)operator(()ident(flt)operator(\)) - ident(VALUE) ident(flt)operator(;) -operator({) - pre_type(char) ident(buf)operator([)integer(32)operator(];) - pre_type(double) ident(value) operator(=) ident(RFLOAT)operator(()ident(flt)operator(\)->)ident(value)operator(;) - pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(e)operator(;) - - reserved(if) operator(()ident(isinf)operator(()ident(value)operator(\)\)) - reserved(return) ident(rb_str_new2)operator(()ident(value) operator(<) integer(0) operator(?) string operator(:) stringoperator(\);) - reserved(else) reserved(if)operator(()ident(isnan)operator(()ident(value)operator(\)\)) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) - - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) ident(value)operator(\);) comment(/* ensure to print decimal point */) - reserved(if) operator((!()ident(e) operator(=) ident(strchr)operator(()ident(buf)operator(,) char('e')operator(\)\)\)) operator({) - ident(e) operator(=) ident(buf) operator(+) ident(strlen)operator(()ident(buf)operator(\);) - operator(}) - reserved(if) operator((!)ident(ISDIGIT)operator(()ident(e)operator([-)integer(1)operator(]\)\)) operator({) comment(/* reformat if ended with decimal point (ex 111111111111111.\) */) - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) ident(value)operator(\);) - reserved(if) operator((!()ident(e) operator(=) ident(strchr)operator(()ident(buf)operator(,) char('e')operator(\)\)\)) operator({) - ident(e) operator(=) ident(buf) operator(+) ident(strlen)operator(()ident(buf)operator(\);) - operator(}) - operator(}) - ident(p) operator(=) ident(e)operator(;) - reserved(while) operator(()ident(p)operator([-)integer(1)operator(]==)char('0') operator(&&) ident(ISDIGIT)operator(()ident(p)operator([-)integer(2)operator(]\)\)) - ident(p)operator(--;) - ident(memmove)operator(()ident(p)operator(,) ident(e)operator(,) ident(strlen)operator(()ident(e)operator(\)+)integer(1)operator(\);) - reserved(return) ident(rb_str_new2)operator(()ident(buf)operator(\);) -operator(}) - -comment(/* - * MISSING: documentation - */) - -directive(static) ident(VALUE) -ident(flo_coerce)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(return) ident(rb_assoc_new)operator(()ident(rb_Float)operator(()ident(y)operator(\),) ident(x)operator(\);) -operator(}) - -comment(/* - * call-seq: - * -float => float - * - * Returns float, negated. - */) - -directive(static) ident(VALUE) -ident(flo_uminus)operator(()ident(flt)operator(\)) - ident(VALUE) ident(flt)operator(;) -operator({) - reserved(return) ident(rb_float_new)operator((-)ident(RFLOAT)operator(()ident(flt)operator(\)->)ident(value)operator(\);) -operator(}) - -comment(/* - * call-seq: - * float + other => float - * - * Returns a new float which is the sum of float - * and other. - */) - -directive(static) ident(VALUE) -ident(flo_plus)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(+) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\)\);) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(+) ident(rb_big2dbl)operator(()ident(y)operator(\)\);) - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(+) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\);) - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * float + other => float - * - * Returns a new float which is the difference of float - * and other. - */) - -directive(static) ident(VALUE) -ident(flo_minus)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(-) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\)\);) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(-) ident(rb_big2dbl)operator(()ident(y)operator(\)\);) - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(-) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\);) - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * float * other => float - * - * Returns a new float which is the product of float - * and other. - */) - -directive(static) ident(VALUE) -ident(flo_mul)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(*) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\)\);) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(*) ident(rb_big2dbl)operator(()ident(y)operator(\)\);) - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(*) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\);) - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * float / other => float - * - * Returns a new float which is the result of dividing - * float by other. - */) - -directive(static) ident(VALUE) -ident(flo_div)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(long) ident(f_y)operator(;) - pre_type(double) ident(d)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(f_y) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(/) operator(()pre_type(double)operator(\))ident(f_y)operator(\);) - reserved(case) ident(T_BIGNUM)operator(:) - ident(d) operator(=) ident(rb_big2dbl)operator(()ident(y)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(/) ident(d)operator(\);) - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value) operator(/) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\);) - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - - -directive(static) directive(void) -ident(flodivmod)operator(()ident(x)operator(,) ident(y)operator(,) ident(divp)operator(,) ident(modp)operator(\)) - pre_type(double) ident(x)operator(,) ident(y)operator(;) - pre_type(double) operator(*)ident(divp)operator(,) operator(*)ident(modp)operator(;) -operator({) - pre_type(double) ident(div)operator(,) ident(mod)operator(;) - -preprocessor(#ifdef) ident(HAVE_FMOD) - ident(mod) operator(=) ident(fmod)operator(()ident(x)operator(,) ident(y)operator(\);) -preprocessor(#else) - operator({) - pre_type(double) ident(z)operator(;) - - ident(modf)operator(()ident(x)operator(/)ident(y)operator(,) operator(&)ident(z)operator(\);) - ident(mod) operator(=) ident(x) operator(-) ident(z) operator(*) ident(y)operator(;) - operator(}) -preprocessor(#endif) - reserved(if) operator(()ident(isinf)operator(()ident(x)operator(\)) operator(&&) operator(!)ident(isinf)operator(()ident(y)operator(\)) operator(&&) operator(!)ident(isnan)operator(()ident(y)operator(\)\)) - ident(div) operator(=) ident(x)operator(;) - reserved(else) - ident(div) operator(=) operator(()ident(x) operator(-) ident(mod)operator(\)) operator(/) ident(y)operator(;) - reserved(if) operator(()ident(y)operator(*)ident(mod) operator(<) integer(0)operator(\)) operator({) - ident(mod) operator(+=) ident(y)operator(;) - ident(div) operator(-=) float(1)float(.0)operator(;) - operator(}) - reserved(if) operator(()ident(modp)operator(\)) operator(*)ident(modp) operator(=) ident(mod)operator(;) - reserved(if) operator(()ident(divp)operator(\)) operator(*)ident(divp) operator(=) ident(div)operator(;) -operator(}) - - -comment(/* - * call-seq: - * flt % other => float - * flt.modulo(other\) => float - * - * Return the modulo after division of flt by other. - * - * 6543.21.modulo(137\) #=> 104.21 - * 6543.21.modulo(137.24\) #=> 92.9299999999996 - */) - -directive(static) ident(VALUE) -ident(flo_mod)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(double) ident(fy)operator(,) ident(mod)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(fy) operator(=) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(break)operator(;) - reserved(case) ident(T_BIGNUM)operator(:) - ident(fy) operator(=) ident(rb_big2dbl)operator(()ident(y)operator(\);) - reserved(break)operator(;) - reserved(case) ident(T_FLOAT)operator(:) - ident(fy) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - ident(flodivmod)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(,) ident(fy)operator(,) integer(0)operator(,) operator(&)ident(mod)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(mod)operator(\);) -operator(}) - -comment(/* - * call-seq: - * flt.divmod(numeric\) => array - * - * See Numeric#divmod. - */) - -directive(static) ident(VALUE) -ident(flo_divmod)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(double) ident(fy)operator(,) ident(div)operator(,) ident(mod)operator(,) ident(val)operator(;) - directive(volatile) ident(VALUE) ident(a)operator(,) ident(b)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(fy) operator(=) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(break)operator(;) - reserved(case) ident(T_BIGNUM)operator(:) - ident(fy) operator(=) ident(rb_big2dbl)operator(()ident(y)operator(\);) - reserved(break)operator(;) - reserved(case) ident(T_FLOAT)operator(:) - ident(fy) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - ident(flodivmod)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(,) ident(fy)operator(,) operator(&)ident(div)operator(,) operator(&)ident(mod)operator(\);) - reserved(if) operator(()ident(FIXABLE)operator(()ident(div)operator(\)\)) operator({) - ident(val) operator(=) ident(round)operator(()ident(div)operator(\);) - ident(a) operator(=) ident(LONG2FIX)operator(()ident(val)operator(\);) - operator(}) - reserved(else) operator({) - ident(a) operator(=) ident(rb_dbl2big)operator(()ident(div)operator(\);) - operator(}) - ident(b) operator(=) ident(rb_float_new)operator(()ident(mod)operator(\);) - reserved(return) ident(rb_assoc_new)operator(()ident(a)operator(,) ident(b)operator(\);) -operator(}) - -comment(/* - * call-seq: - * - * flt ** other => float - * - * Raises float the other power. - */) - -directive(static) ident(VALUE) -ident(flo_pow)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(pow)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(,) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\)\)\);) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(pow)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(,) ident(rb_big2dbl)operator(()ident(y)operator(\)\)\);) - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(pow)operator(()ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(,) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\)\);) - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * num.eql?(numeric\) => true or false - * - * Returns true if num and numeric are the - * same type and have equal values. - * - * 1 == 1.0 #=> true - * 1.eql?(1.0\) #=> false - * (1.0\).eql?(1.0\) #=> true - */) - -directive(static) ident(VALUE) -ident(num_eql)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(x)operator(\)) operator(!=) ident(TYPE)operator(()ident(y)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - - reserved(return) ident(rb_equal)operator(()ident(x)operator(,) ident(y)operator(\);) -operator(}) - -comment(/* - * call-seq: - * num <=> other -> 0 or nil - * - * Returns zero if num equals other, nil - * otherwise. - */) - -directive(static) ident(VALUE) -ident(num_cmp)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(x) operator(==) ident(y)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(num_equal)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(x) operator(==) ident(y)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(rb_funcall)operator(()ident(y)operator(,) ident(id_eq)operator(,) integer(1)operator(,) ident(x)operator(\);) -operator(}) - -comment(/* - * call-seq: - * flt == obj => true or false - * - * Returns true only if obj has the same value - * as flt. Contrast this with Float#eql?, which - * requires obj to be a Float. - * - * 1.0 == 1 #=> true - * - */) - -directive(static) ident(VALUE) -ident(flo_eq)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - directive(volatile) pre_type(double) ident(a)operator(,) ident(b)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(b) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(break)operator(;) - reserved(case) ident(T_BIGNUM)operator(:) - ident(b) operator(=) ident(rb_big2dbl)operator(()ident(y)operator(\);) - reserved(break)operator(;) - reserved(case) ident(T_FLOAT)operator(:) - ident(b) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - reserved(if) operator(()ident(isnan)operator(()ident(b)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(return) ident(num_equal)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - ident(a) operator(=) ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(;) - reserved(if) operator(()ident(isnan)operator(()ident(a)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) operator(()ident(a) operator(==) ident(b)operator(\)?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt.hash => integer - * - * Returns a hash code for this float. - */) - -directive(static) ident(VALUE) -ident(flo_hash)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - pre_type(double) ident(d)operator(;) - pre_type(char) operator(*)ident(c)operator(;) - pre_type(int) ident(i)operator(,) ident(hash)operator(;) - - ident(d) operator(=) ident(RFLOAT)operator(()ident(num)operator(\)->)ident(value)operator(;) - reserved(if) operator(()ident(d) operator(==) integer(0)operator(\)) ident(d) operator(=) ident(fabs)operator(()ident(d)operator(\);) - ident(c) operator(=) operator(()pre_type(char)operator(*\)&)ident(d)operator(;) - reserved(for) operator(()ident(hash)operator(=)integer(0)operator(,) ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)reserved(sizeof)operator(()pre_type(double)operator(\);)ident(i)operator(++\)) operator({) - ident(hash) operator(=) operator(()ident(hash) operator(*) integer(971)operator(\)) operator(^) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(c)operator([)ident(i)operator(];) - operator(}) - reserved(if) operator(()ident(hash) operator(<) integer(0)operator(\)) ident(hash) operator(=) operator(-)ident(hash)operator(;) - reserved(return) ident(INT2FIX)operator(()ident(hash)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_dbl_cmp)operator(()ident(a)operator(,) ident(b)operator(\)) - pre_type(double) ident(a)operator(,) ident(b)operator(;) -operator({) - reserved(if) operator(()ident(isnan)operator(()ident(a)operator(\)) operator(||) ident(isnan)operator(()ident(b)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(a) operator(==) ident(b)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(a) operator(>) ident(b)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(if) operator(()ident(a) operator(<) ident(b)operator(\)) reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt <=> numeric => -1, 0, +1 - * - * Returns -1, 0, or +1 depending on whether flt is less than, - * equal to, or greater than numeric. This is the basis for the - * tests in Comparable. - */) - -directive(static) ident(VALUE) -ident(flo_cmp)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(double) ident(a)operator(,) ident(b)operator(;) - - ident(a) operator(=) ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(;) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(b) operator(=) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - reserved(if) operator(()ident(isinf)operator(()ident(a)operator(\)\)) operator({) - reserved(if) operator(()ident(a) operator(>) float(0)float(.0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(else) reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - ident(b) operator(=) ident(rb_big2dbl)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - ident(b) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_cmp)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - reserved(return) ident(rb_dbl_cmp)operator(()ident(a)operator(,) ident(b)operator(\);) -operator(}) - -comment(/* - * call-seq: - * flt > other => true or false - * - * true if flt is greater than other. - */) - -directive(static) ident(VALUE) -ident(flo_gt)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(double) ident(a)operator(,) ident(b)operator(;) - - ident(a) operator(=) ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(;) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(b) operator(=) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - ident(b) operator(=) ident(rb_big2dbl)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - ident(b) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - reserved(if) operator(()ident(isnan)operator(()ident(b)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_relop)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - reserved(if) operator(()ident(isnan)operator(()ident(a)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) operator(()ident(a) operator(>) ident(b)operator(\)?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt >= other => true or false - * - * true if flt is greater than - * or equal to other. - */) - -directive(static) ident(VALUE) -ident(flo_ge)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(double) ident(a)operator(,) ident(b)operator(;) - - ident(a) operator(=) ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(;) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(b) operator(=) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - ident(b) operator(=) ident(rb_big2dbl)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - ident(b) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - reserved(if) operator(()ident(isnan)operator(()ident(b)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_relop)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - reserved(if) operator(()ident(isnan)operator(()ident(a)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) operator(()ident(a) operator(>=) ident(b)operator(\)?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt < other => true or false - * - * true if flt is less than other. - */) - -directive(static) ident(VALUE) -ident(flo_lt)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(double) ident(a)operator(,) ident(b)operator(;) - - ident(a) operator(=) ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(;) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(b) operator(=) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - ident(b) operator(=) ident(rb_big2dbl)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - ident(b) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - reserved(if) operator(()ident(isnan)operator(()ident(b)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_relop)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - reserved(if) operator(()ident(isnan)operator(()ident(a)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) operator(()ident(a) operator(<) ident(b)operator(\)?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt <= other => true or false - * - * true if flt is less than - * or equal to other. - */) - -directive(static) ident(VALUE) -ident(flo_le)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(double) ident(a)operator(,) ident(b)operator(;) - - ident(a) operator(=) ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(;) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(b) operator(=) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - ident(b) operator(=) ident(rb_big2dbl)operator(()ident(y)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - ident(b) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - reserved(if) operator(()ident(isnan)operator(()ident(b)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_relop)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) - reserved(if) operator(()ident(isnan)operator(()ident(a)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) operator(()ident(a) operator(<=) ident(b)operator(\)?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt.eql?(obj\) => true or false - * - * Returns true only if obj is a - * Float with the same value as flt. Contrast this - * with Float#==, which performs type conversions. - * - * 1.0.eql?(1\) #=> false - */) - -directive(static) ident(VALUE) -ident(flo_eql)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(y)operator(\)) operator(==) ident(T_FLOAT)operator(\)) operator({) - pre_type(double) ident(a) operator(=) ident(RFLOAT)operator(()ident(x)operator(\)->)ident(value)operator(;) - pre_type(double) ident(b) operator(=) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(;) - - reserved(if) operator(()ident(isnan)operator(()ident(a)operator(\)) operator(||) ident(isnan)operator(()ident(b)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(a) operator(==) ident(b)operator(\)) reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt.to_f => flt - * - * As flt is already a float, returns self. - */) - -directive(static) ident(VALUE) -ident(flo_to_f)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(return) ident(num)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt.abs => float - * - * Returns the absolute value of flt. - * - * (-34.56\).abs #=> 34.56 - * -34.56.abs #=> 34.56 - * - */) - -directive(static) ident(VALUE) -ident(flo_abs)operator(()ident(flt)operator(\)) - ident(VALUE) ident(flt)operator(;) -operator({) - pre_type(double) ident(val) operator(=) ident(fabs)operator(()ident(RFLOAT)operator(()ident(flt)operator(\)->)ident(value)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * flt.zero? -> true or false - * - * Returns true if flt is 0.0. - * - */) - -directive(static) ident(VALUE) -ident(flo_zero_p)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(if) operator(()ident(RFLOAT)operator(()ident(num)operator(\)->)ident(value) operator(==) float(0)float(.0)operator(\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt.nan? -> true or false - * - * Returns true if flt is an invalid IEEE floating - * point number. - * - * a = -1.0 #=> -1.0 - * a.nan? #=> false - * a = 0.0/0.0 #=> NaN - * a.nan? #=> true - */) - -directive(static) ident(VALUE) -ident(flo_is_nan_p)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - pre_type(double) ident(value) operator(=) ident(RFLOAT)operator(()ident(num)operator(\)->)ident(value)operator(;) - - reserved(return) ident(isnan)operator(()ident(value)operator(\)) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt.infinite? -> nil, -1, +1 - * - * Returns nil, -1, or +1 depending on whether flt - * is finite, -infinity, or +infinity. - * - * (0.0\).infinite? #=> nil - * (-1.0/0.0\).infinite? #=> -1 - * (+1.0/0.0\).infinite? #=> 1 - */) - -directive(static) ident(VALUE) -ident(flo_is_infinite_p)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - pre_type(double) ident(value) operator(=) ident(RFLOAT)operator(()ident(num)operator(\)->)ident(value)operator(;) - - reserved(if) operator(()ident(isinf)operator(()ident(value)operator(\)\)) operator({) - reserved(return) ident(INT2FIX)operator(() ident(value) operator(<) integer(0) operator(?) operator(-)integer(1) operator(:) integer(1) operator(\);) - operator(}) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt.finite? -> true or false - * - * Returns true if flt is a valid IEEE floating - * point number (it is not infinite, and nan? is - * false\). - * - */) - -directive(static) ident(VALUE) -ident(flo_is_finite_p)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - pre_type(double) ident(value) operator(=) ident(RFLOAT)operator(()ident(num)operator(\)->)ident(value)operator(;) - -preprocessor(#if) ident(HAVE_FINITE) - reserved(if) operator((!)ident(finite)operator(()ident(value)operator(\)\)) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#else) - reserved(if) operator(()ident(isinf)operator(()ident(value)operator(\)) operator(||) ident(isnan)operator(()ident(value)operator(\)\)) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) - - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * flt.floor => integer - * - * Returns the largest integer less than or equal to flt. - * - * 1.2.floor #=> 1 - * 2.0.floor #=> 2 - * (-1.2\).floor #=> -2 - * (-2.0\).floor #=> -2 - */) - -directive(static) ident(VALUE) -ident(flo_floor)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - pre_type(double) ident(f) operator(=) ident(floor)operator(()ident(RFLOAT)operator(()ident(num)operator(\)->)ident(value)operator(\);) - pre_type(long) ident(val)operator(;) - - reserved(if) operator((!)ident(FIXABLE)operator(()ident(f)operator(\)\)) operator({) - reserved(return) ident(rb_dbl2big)operator(()ident(f)operator(\);) - operator(}) - ident(val) operator(=) ident(f)operator(;) - reserved(return) ident(LONG2FIX)operator(()ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * flt.ceil => integer - * - * Returns the smallest Integer greater than or equal to - * flt. - * - * 1.2.ceil #=> 2 - * 2.0.ceil #=> 2 - * (-1.2\).ceil #=> -1 - * (-2.0\).ceil #=> -2 - */) - -directive(static) ident(VALUE) -ident(flo_ceil)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - pre_type(double) ident(f) operator(=) ident(ceil)operator(()ident(RFLOAT)operator(()ident(num)operator(\)->)ident(value)operator(\);) - pre_type(long) ident(val)operator(;) - - reserved(if) operator((!)ident(FIXABLE)operator(()ident(f)operator(\)\)) operator({) - reserved(return) ident(rb_dbl2big)operator(()ident(f)operator(\);) - operator(}) - ident(val) operator(=) ident(f)operator(;) - reserved(return) ident(LONG2FIX)operator(()ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * flt.round => integer - * - * Rounds flt to the nearest integer. Equivalent to: - * - * def round - * return (self+0.5\).floor if self > 0.0 - * return (self-0.5\).ceil if self < 0.0 - * return 0 - * end - * - * 1.5.round #=> 2 - * (-1.5\).round #=> -2 - * - */) - -directive(static) ident(VALUE) -ident(flo_round)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - pre_type(double) ident(f) operator(=) ident(RFLOAT)operator(()ident(num)operator(\)->)ident(value)operator(;) - pre_type(long) ident(val)operator(;) - - ident(f) operator(=) ident(round)operator(()ident(f)operator(\);) - - reserved(if) operator((!)ident(FIXABLE)operator(()ident(f)operator(\)\)) operator({) - reserved(return) ident(rb_dbl2big)operator(()ident(f)operator(\);) - operator(}) - ident(val) operator(=) ident(f)operator(;) - reserved(return) ident(LONG2FIX)operator(()ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * flt.to_i => integer - * flt.to_int => integer - * flt.truncate => integer - * - * Returns flt truncated to an Integer. - */) - -directive(static) ident(VALUE) -ident(flo_truncate)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - pre_type(double) ident(f) operator(=) ident(RFLOAT)operator(()ident(num)operator(\)->)ident(value)operator(;) - pre_type(long) ident(val)operator(;) - - reserved(if) operator(()ident(f) operator(>) float(0)float(.0)operator(\)) ident(f) operator(=) ident(floor)operator(()ident(f)operator(\);) - reserved(if) operator(()ident(f) operator(<) float(0)float(.0)operator(\)) ident(f) operator(=) ident(ceil)operator(()ident(f)operator(\);) - - reserved(if) operator((!)ident(FIXABLE)operator(()ident(f)operator(\)\)) operator({) - reserved(return) ident(rb_dbl2big)operator(()ident(f)operator(\);) - operator(}) - ident(val) operator(=) ident(f)operator(;) - reserved(return) ident(LONG2FIX)operator(()ident(val)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * num.floor => integer - * - * Returns the largest integer less than or equal to num. - * Numeric implements this by converting anInteger - * to a Float and invoking Float#floor. - * - * 1.floor #=> 1 - * (-1\).floor #=> -1 - */) - -directive(static) ident(VALUE) -ident(num_floor)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(return) ident(flo_floor)operator(()ident(rb_Float)operator(()ident(num)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * num.ceil => integer - * - * Returns the smallest Integer greater than or equal to - * num. Class Numeric achieves this by converting - * itself to a Float then invoking - * Float#ceil. - * - * 1.ceil #=> 1 - * 1.2.ceil #=> 2 - * (-1.2\).ceil #=> -1 - * (-1.0\).ceil #=> -1 - */) - -directive(static) ident(VALUE) -ident(num_ceil)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(return) ident(flo_ceil)operator(()ident(rb_Float)operator(()ident(num)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * num.round => integer - * - * Rounds num to the nearest integer. Numeric - * implements this by converting itself to a - * Float and invoking Float#round. - */) - -directive(static) ident(VALUE) -ident(num_round)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(return) ident(flo_round)operator(()ident(rb_Float)operator(()ident(num)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * num.truncate => integer - * - * Returns num truncated to an integer. Numeric - * implements this by converting its value to a float and invoking - * Float#truncate. - */) - -directive(static) ident(VALUE) -ident(num_truncate)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(return) ident(flo_truncate)operator(()ident(rb_Float)operator(()ident(num)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * num.step(limit, step \) {|i| block } => num - * - * Invokes block with the sequence of numbers starting at - * num, incremented by step on each call. The loop - * finishes when the value to be passed to the block is greater than - * limit (if step is positive\) or less than - * limit (if step is negative\). If all the arguments are - * integers, the loop operates using an integer counter. If any of the - * arguments are floating point numbers, all are converted to floats, - * and the loop is executed floor(n + n*epsilon\)+ 1 times, - * where n = (limit - num\)/step. Otherwise, the loop - * starts at num, uses either the < or - * > operator to compare the counter against - * limit, and increments itself using the + - * operator. - * - * 1.step(10, 2\) { |i| print i, " " } - * Math::E.step(Math::PI, 0.2\) { |f| print f, " " } - * - * produces: - * - * 1 3 5 7 9 - * 2.71828182845905 2.91828182845905 3.11828182845905 - */) - -directive(static) ident(VALUE) -ident(num_step)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(from)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(from)operator(;) -operator({) - ident(VALUE) ident(to)operator(,) ident(step)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - ident(to) operator(=) ident(argv)operator([)integer(0)operator(];) - ident(step) operator(=) ident(INT2FIX)operator(()integer(1)operator(\);) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(argc) operator(==) integer(2)operator(\)) operator({) - ident(to) operator(=) ident(argv)operator([)integer(0)operator(];) - ident(step) operator(=) ident(argv)operator([)integer(1)operator(];) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(rb_equal)operator(()ident(step)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - operator(}) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(from)operator(\)) operator(&&) ident(FIXNUM_P)operator(()ident(to)operator(\)) operator(&&) ident(FIXNUM_P)operator(()ident(step)operator(\)\)) operator({) - pre_type(long) ident(i)operator(,) ident(end)operator(,) ident(diff)operator(;) - - ident(i) operator(=) ident(FIX2LONG)operator(()ident(from)operator(\);) - ident(end) operator(=) ident(FIX2LONG)operator(()ident(to)operator(\);) - ident(diff) operator(=) ident(FIX2LONG)operator(()ident(step)operator(\);) - - reserved(if) operator(()ident(diff) operator(>) integer(0)operator(\)) operator({) - reserved(while) operator(()ident(i) operator(<=) ident(end)operator(\)) operator({) - ident(rb_yield)operator(()ident(LONG2FIX)operator(()ident(i)operator(\)\);) - ident(i) operator(+=) ident(diff)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(while) operator(()ident(i) operator(>=) ident(end)operator(\)) operator({) - ident(rb_yield)operator(()ident(LONG2FIX)operator(()ident(i)operator(\)\);) - ident(i) operator(+=) ident(diff)operator(;) - operator(}) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(TYPE)operator(()ident(from)operator(\)) operator(==) ident(T_FLOAT) operator(||) ident(TYPE)operator(()ident(to)operator(\)) operator(==) ident(T_FLOAT) operator(||) ident(TYPE)operator(()ident(step)operator(\)) operator(==) ident(T_FLOAT)operator(\)) operator({) - directive(const) pre_type(double) ident(epsilon) operator(=) ident(DBL_EPSILON)operator(;) - pre_type(double) ident(beg) operator(=) ident(NUM2DBL)operator(()ident(from)operator(\);) - pre_type(double) ident(end) operator(=) ident(NUM2DBL)operator(()ident(to)operator(\);) - pre_type(double) ident(unit) operator(=) ident(NUM2DBL)operator(()ident(step)operator(\);) - pre_type(double) ident(n) operator(=) operator(()ident(end) operator(-) ident(beg)operator(\))operator(/)ident(unit)operator(;) - pre_type(double) ident(err) operator(=) operator(()ident(fabs)operator(()ident(beg)operator(\)) operator(+) ident(fabs)operator(()ident(end)operator(\)) operator(+) ident(fabs)operator(()ident(end)operator(-)ident(beg)operator(\)\)) operator(/) ident(fabs)operator(()ident(unit)operator(\)) operator(*) ident(epsilon)operator(;) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(err)operator(>)float(0)float(.5)operator(\)) ident(err)operator(=)float(0)float(.5)operator(;) - ident(n) operator(=) ident(floor)operator(()ident(n) operator(+) ident(err)operator(\)) operator(+) integer(1)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(n)operator(;) ident(i)operator(++\)) operator({) - ident(rb_yield)operator(()ident(rb_float_new)operator(()ident(i)operator(*)ident(unit)operator(+)ident(beg)operator(\)\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(i) operator(=) ident(from)operator(;) - ident(ID) ident(cmp)operator(;) - - reserved(if) operator(()ident(RTEST)operator(()ident(rb_funcall)operator(()ident(step)operator(,) char('>')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)\)) operator({) - ident(cmp) operator(=) char('>')operator(;) - operator(}) - reserved(else) operator({) - ident(cmp) operator(=) char('<')operator(;) - operator(}) - reserved(for) operator((;;\)) operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_funcall)operator(()ident(i)operator(,) ident(cmp)operator(,) integer(1)operator(,) ident(to)operator(\)\)\)) reserved(break)operator(;) - ident(rb_yield)operator(()ident(i)operator(\);) - ident(i) operator(=) ident(rb_funcall)operator(()ident(i)operator(,) char('+')operator(,) integer(1)operator(,) ident(step)operator(\);) - operator(}) - operator(}) - reserved(return) ident(from)operator(;) -operator(}) - -pre_type(long) -ident(rb_num2long)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - label(again:) - reserved(if) operator(()ident(NIL_P)operator(()ident(val)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(val)operator(\)\)) reserved(return) ident(FIX2LONG)operator(()ident(val)operator(\);) - - reserved(switch) operator(()ident(TYPE)operator(()ident(val)operator(\)\)) operator({) - reserved(case) ident(T_FLOAT)operator(:) - reserved(if) operator(()ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value) operator(<=) operator(()pre_type(double)operator(\))ident(LONG_MAX) - operator(&&) ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value) operator(>=) operator(()pre_type(double)operator(\))ident(LONG_MIN)operator(\)) operator({) - reserved(return) operator(()pre_type(long)operator(\)()ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value)operator(\);) - operator(}) - reserved(else) operator({) - pre_type(char) ident(buf)operator([)integer(24)operator(];) - pre_type(char) operator(*)ident(s)operator(;) - - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value)operator(\);) - reserved(if) operator((()ident(s) operator(=) ident(strchr)operator(()ident(buf)operator(,) char(' ')operator(\)\)) operator(!=) integer(0)operator(\)) operator(*)ident(s) operator(=) char('\\0')operator(;) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(buf)operator(\);) - operator(}) - - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(rb_big2long)operator(()ident(val)operator(\);) - - reserved(default)operator(:) - ident(val) operator(=) ident(rb_to_int)operator(()ident(val)operator(\);) - reserved(goto) ident(again)operator(;) - operator(}) -operator(}) - -pre_type(unsigned) pre_type(long) -ident(rb_num2ulong)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(val)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) operator({) - reserved(return) ident(rb_big2ulong)operator(()ident(val)operator(\);) - operator(}) - reserved(return) operator(()pre_type(unsigned) pre_type(long)operator(\))ident(rb_num2long)operator(()ident(val)operator(\);) -operator(}) - -preprocessor(#if) ident(SIZEOF_INT) operator(<) ident(SIZEOF_LONG) -directive(static) directive(void) -ident(check_int)operator(()ident(num)operator(\)) - pre_type(long) ident(num)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(s)operator(;) - - reserved(if) operator(()ident(num) operator(<) ident(INT_MIN)operator(\)) operator({) - ident(s) operator(=) stringoperator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(num) operator(>) ident(INT_MAX)operator(\)) operator({) - ident(s) operator(=) stringoperator(;) - operator(}) - reserved(else) operator({) - reserved(return)operator(;) - operator(}) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(num)operator(,) ident(s)operator(\);) -operator(}) - -directive(static) directive(void) -ident(check_uint)operator(()ident(num)operator(,) ident(sign)operator(\)) - pre_type(unsigned) pre_type(long) ident(num)operator(;) - ident(VALUE) ident(sign)operator(;) -operator({) - directive(static) directive(const) pre_type(unsigned) pre_type(long) ident(mask) operator(=) operator(~()pre_type(unsigned) pre_type(long)operator(\))ident(UINT_MAX)operator(;) - - reserved(if) operator(()ident(RTEST)operator(()ident(sign)operator(\)\)) operator({) - comment(/* minus */) - reserved(if) operator((()ident(num) operator(&) ident(mask)operator(\)) operator(!=) ident(mask) operator(||) operator(()ident(num) operator(&) operator(~)ident(mask)operator(\)) operator(<=) ident(INT_MAX) operator(+) integer(1)ident(UL)operator(\)) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(num)operator(\);) - operator(}) - reserved(else) operator({) - comment(/* plus */) - reserved(if) operator((()ident(num) operator(&) ident(mask)operator(\)) operator(!=) integer(0)operator(\)) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(num)operator(\);) - operator(}) -operator(}) - -pre_type(long) -ident(rb_num2int)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - pre_type(long) ident(num) operator(=) ident(rb_num2long)operator(()ident(val)operator(\);) - - ident(check_int)operator(()ident(num)operator(\);) - reserved(return) ident(num)operator(;) -operator(}) - -pre_type(long) -ident(rb_fix2int)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - pre_type(long) ident(num) operator(=) ident(FIXNUM_P)operator(()ident(val)operator(\)?)ident(FIX2LONG)operator(()ident(val)operator(\):)ident(rb_num2long)operator(()ident(val)operator(\);) - - ident(check_int)operator(()ident(num)operator(\);) - reserved(return) ident(num)operator(;) -operator(}) - -pre_type(unsigned) pre_type(long) -ident(rb_num2uint)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - pre_type(unsigned) pre_type(long) ident(num) operator(=) ident(rb_num2ulong)operator(()ident(val)operator(\);) - - ident(check_uint)operator(()ident(num)operator(,) ident(rb_funcall)operator(()ident(val)operator(,) char('<')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\);) - reserved(return) ident(num)operator(;) -operator(}) - -pre_type(unsigned) pre_type(long) -ident(rb_fix2uint)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - pre_type(unsigned) pre_type(long) ident(num)operator(;) - - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(val)operator(\)\)) operator({) - reserved(return) ident(rb_num2uint)operator(()ident(val)operator(\);) - operator(}) - ident(num) operator(=) ident(FIX2ULONG)operator(()ident(val)operator(\);) - - ident(check_uint)operator(()ident(num)operator(,) ident(rb_funcall)operator(()ident(val)operator(,) char('<')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\);) - reserved(return) ident(num)operator(;) -operator(}) -preprocessor(#else) -pre_type(long) -ident(rb_num2int)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(return) ident(rb_num2long)operator(()ident(val)operator(\);) -operator(}) - -pre_type(long) -ident(rb_fix2int)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(return) ident(FIX2INT)operator(()ident(val)operator(\);) -operator(}) -preprocessor(#endif) - -ident(VALUE) -ident(rb_num2fix)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - pre_type(long) ident(v)operator(;) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(val)operator(\)\)) reserved(return) ident(val)operator(;) - - ident(v) operator(=) ident(rb_num2long)operator(()ident(val)operator(\);) - reserved(if) operator((!)ident(FIXABLE)operator(()ident(v)operator(\)\)) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(v)operator(\);) - reserved(return) ident(LONG2FIX)operator(()ident(v)operator(\);) -operator(}) - -preprocessor(#if) ident(HAVE_LONG_LONG) - -ident(LONG_LONG) -ident(rb_num2ll)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(if) operator(()ident(NIL_P)operator(()ident(val)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(val)operator(\)\)) reserved(return) operator(()ident(LONG_LONG)operator(\))ident(FIX2LONG)operator(()ident(val)operator(\);) - - reserved(switch) operator(()ident(TYPE)operator(()ident(val)operator(\)\)) operator({) - reserved(case) ident(T_FLOAT)operator(:) - reserved(if) operator(()ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value) operator(<=) operator(()pre_type(double)operator(\))ident(LLONG_MAX) - operator(&&) ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value) operator(>=) operator(()pre_type(double)operator(\))ident(LLONG_MIN)operator(\)) operator({) - reserved(return) operator(()ident(LONG_LONG)operator(\)()ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value)operator(\);) - operator(}) - reserved(else) operator({) - pre_type(char) ident(buf)operator([)integer(24)operator(];) - pre_type(char) operator(*)ident(s)operator(;) - - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value)operator(\);) - reserved(if) operator((()ident(s) operator(=) ident(strchr)operator(()ident(buf)operator(,) char(' ')operator(\)\)) operator(!=) integer(0)operator(\)) operator(*)ident(s) operator(=) char('\\0')operator(;) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(buf)operator(\);) - operator(}) - - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(rb_big2ll)operator(()ident(val)operator(\);) - - reserved(case) ident(T_STRING)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) - - reserved(case) ident(T_TRUE)operator(:) - reserved(case) ident(T_FALSE)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) - - reserved(default)operator(:) - ident(val) operator(=) ident(rb_to_int)operator(()ident(val)operator(\);) - reserved(return) ident(NUM2LL)operator(()ident(val)operator(\);) - operator(}) -operator(}) - -pre_type(unsigned) ident(LONG_LONG) -ident(rb_num2ull)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(val)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) operator({) - reserved(return) ident(rb_big2ull)operator(()ident(val)operator(\);) - operator(}) - reserved(return) operator(()pre_type(unsigned) ident(LONG_LONG)operator(\))ident(rb_num2ll)operator(()ident(val)operator(\);) -operator(}) - -preprocessor(#endif) comment(/* HAVE_LONG_LONG */) - - -comment(/* - * Document-class: Integer - * - * Integer is the basis for the two concrete classes that - * hold whole numbers, Bignum and Fixnum. - * - */) - - -comment(/* - * call-seq: - * int.to_i => int - * int.to_int => int - * int.floor => int - * int.ceil => int - * int.round => int - * int.truncate => int - * - * As int is already an Integer, all these - * methods simply return the receiver. - */) - -directive(static) ident(VALUE) -ident(int_to_i)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(return) ident(num)operator(;) -operator(}) - -comment(/* - * call-seq: - * int.integer? -> true - * - * Always returns true. - */) - -directive(static) ident(VALUE) -ident(int_int_p)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * int.next => integer - * int.succ => integer - * - * Returns the Integer equal to int + 1. - * - * 1.next #=> 2 - * (-1\).next #=> 0 - */) - -directive(static) ident(VALUE) -ident(int_succ)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(num)operator(\)\)) operator({) - pre_type(long) ident(i) operator(=) ident(FIX2LONG)operator(()ident(num)operator(\)) operator(+) integer(1)operator(;) - reserved(return) ident(LONG2NUM)operator(()ident(i)operator(\);) - operator(}) - reserved(return) ident(rb_funcall)operator(()ident(num)operator(,) char('+')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(1)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * int.chr => string - * - * Returns a string containing the ASCII character represented by the - * receiver's value. - * - * 65.chr #=> "A" - * ?a.chr #=> "a" - * 230.chr #=> "\\346" - */) - -directive(static) ident(VALUE) -ident(int_chr)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - pre_type(char) ident(c)operator(;) - pre_type(long) ident(i) operator(=) ident(NUM2LONG)operator(()ident(num)operator(\);) - - reserved(if) operator(()ident(i) operator(<) integer(0) operator(||) hex(0xff) operator(<) ident(i)operator(\)) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(i)operator(\);) - ident(c) operator(=) ident(i)operator(;) - reserved(return) ident(rb_str_new)operator((&)ident(c)operator(,) integer(1)operator(\);) -operator(}) - -comment(/******************************************************************** - * - * Document-class: Fixnum - * - * A Fixnum holds Integer values that can be - * represented in a native machine word (minus 1 bit\). If any operation - * on a Fixnum exceeds this range, the value is - * automatically converted to a Bignum. - * - * Fixnum objects have immediate value. This means that - * when they are assigned or passed as parameters, the actual object is - * passed, rather than a reference to that object. Assignment does not - * alias Fixnum objects. There is effectively only one - * Fixnum object instance for any given integer value, so, - * for example, you cannot add a singleton method to a - * Fixnum. - */) - - -comment(/* - * call-seq: - * Fixnum.induced_from(obj\) => fixnum - * - * Convert obj to a Fixnum. Works with numeric parameters. - * Also works with Symbols, but this is deprecated. - */) - -directive(static) ident(VALUE) -ident(rb_fix_induced_from)operator(()ident(klass)operator(,) ident(x)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(x)operator(;) -operator({) - reserved(return) ident(rb_num2fix)operator(()ident(x)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Integer.induced_from(obj\) => fixnum, bignum - * - * Convert obj to an Integer. - */) - -directive(static) ident(VALUE) -ident(rb_int_induced_from)operator(()ident(klass)operator(,) ident(x)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(x)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(x)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(x)operator(;) - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(rb_funcall)operator(()ident(x)operator(,) ident(id_to_i)operator(,) integer(0)operator(\);) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(x)operator(\)\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * Float.induced_from(obj\) => float - * - * Convert obj to a float. - */) - -directive(static) ident(VALUE) -ident(rb_flo_induced_from)operator(()ident(klass)operator(,) ident(x)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(x)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(x)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(rb_funcall)operator(()ident(x)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(\);) - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(x)operator(;) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(x)operator(\)\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * -fix => integer - * - * Negates fix (which might return a Bignum\). - */) - -directive(static) ident(VALUE) -ident(fix_uminus)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(return) ident(LONG2NUM)operator((-)ident(FIX2LONG)operator(()ident(num)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_fix2str)operator(()ident(x)operator(,) ident(base)operator(\)) - ident(VALUE) ident(x)operator(;) - pre_type(int) ident(base)operator(;) -operator({) - directive(extern) directive(const) pre_type(char) ident(ruby_digitmap)operator([];) - pre_type(char) ident(buf)operator([)ident(SIZEOF_LONG)operator(*)ident(CHAR_BIT) operator(+) integer(2)operator(],) operator(*)ident(b) operator(=) ident(buf) operator(+) reserved(sizeof) ident(buf)operator(;) - pre_type(long) ident(val) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\);) - pre_type(int) ident(neg) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(base) operator(<) integer(2) operator(||) integer(36) operator(<) ident(base)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(base)operator(\);) - operator(}) - reserved(if) operator(()ident(val) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) - operator(}) - reserved(if) operator(()ident(val) operator(<) integer(0)operator(\)) operator({) - ident(val) operator(=) operator(-)ident(val)operator(;) - ident(neg) operator(=) integer(1)operator(;) - operator(}) - operator(*--)ident(b) operator(=) char('\\0')operator(;) - reserved(do) operator({) - operator(*--)ident(b) operator(=) ident(ruby_digitmap)operator([()pre_type(int)operator(\)()ident(val) operator(%) ident(base)operator(\)];) - operator(}) reserved(while) operator(()ident(val) operator(/=) ident(base)operator(\);) - reserved(if) operator(()ident(neg)operator(\)) operator({) - operator(*--)ident(b) operator(=) char('-')operator(;) - operator(}) - - reserved(return) ident(rb_str_new2)operator(()ident(b)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix.to_s( base=10 \) -> aString - * - * Returns a string containing the representation of fix radix - * base (between 2 and 36\). - * - * 12345.to_s #=> "12345" - * 12345.to_s(2\) #=> "11000000111001" - * 12345.to_s(8\) #=> "30071" - * 12345.to_s(10\) #=> "12345" - * 12345.to_s(16\) #=> "3039" - * 12345.to_s(36\) #=> "9ix" - * - */) -directive(static) ident(VALUE) -ident(fix_to_s)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(x)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(x)operator(;) -operator({) - ident(VALUE) ident(b)operator(;) - pre_type(int) ident(base)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(b)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) ident(base) operator(=) integer(10)operator(;) - reserved(else) ident(base) operator(=) ident(NUM2INT)operator(()ident(b)operator(\);) - - reserved(return) ident(rb_fix2str)operator(()ident(x)operator(,) ident(base)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix + numeric => numeric_result - * - * Performs addition: the class of the resulting object depends on - * the class of numeric and on the magnitude of the - * result. - */) - -directive(static) ident(VALUE) -ident(fix_plus)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - pre_type(long) ident(a)operator(,) ident(b)operator(,) ident(c)operator(;) - ident(VALUE) ident(r)operator(;) - - ident(a) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\);) - ident(b) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - ident(c) operator(=) ident(a) operator(+) ident(b)operator(;) - ident(r) operator(=) ident(LONG2NUM)operator(()ident(c)operator(\);) - - reserved(return) ident(r)operator(;) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(y)operator(\)) operator(==) ident(T_FLOAT)operator(\)) operator({) - reserved(return) ident(rb_float_new)operator((()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(x)operator(\)) operator(+) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\);) - operator(}) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix - numeric => numeric_result - * - * Performs subtraction: the class of the resulting object depends on - * the class of numeric and on the magnitude of the - * result. - */) - -directive(static) ident(VALUE) -ident(fix_minus)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - pre_type(long) ident(a)operator(,) ident(b)operator(,) ident(c)operator(;) - ident(VALUE) ident(r)operator(;) - - ident(a) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\);) - ident(b) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - ident(c) operator(=) ident(a) operator(-) ident(b)operator(;) - ident(r) operator(=) ident(LONG2NUM)operator(()ident(c)operator(\);) - - reserved(return) ident(r)operator(;) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(y)operator(\)) operator(==) ident(T_FLOAT)operator(\)) operator({) - reserved(return) ident(rb_float_new)operator((()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(x)operator(\)) operator(-) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\);) - operator(}) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix * numeric => numeric_result - * - * Performs multiplication: the class of the resulting object depends on - * the class of numeric and on the magnitude of the - * result. - */) - -directive(static) ident(VALUE) -ident(fix_mul)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) -preprocessor(#ifdef) ident(__HP_cc) - comment(/* avoids an optimization bug of HP aC++/ANSI C B3910B A.06.05 [Jul 25 2005] */) - directive(volatile) -preprocessor(#endif) - pre_type(long) ident(a)operator(,) ident(b)operator(,) ident(c)operator(;) - ident(VALUE) ident(r)operator(;) - - ident(a) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\);) - reserved(if) operator(()ident(a) operator(==) integer(0)operator(\)) reserved(return) ident(x)operator(;) - - ident(b) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - ident(c) operator(=) ident(a) operator(*) ident(b)operator(;) - ident(r) operator(=) ident(LONG2FIX)operator(()ident(c)operator(\);) - - reserved(if) operator(()ident(FIX2LONG)operator(()ident(r)operator(\)) operator(!=) ident(c) operator(||) ident(c)operator(/)ident(a) operator(!=) ident(b)operator(\)) operator({) - ident(r) operator(=) ident(rb_big_mul)operator(()ident(rb_int2big)operator(()ident(a)operator(\),) ident(rb_int2big)operator(()ident(b)operator(\)\);) - operator(}) - reserved(return) ident(r)operator(;) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(y)operator(\)) operator(==) ident(T_FLOAT)operator(\)) operator({) - reserved(return) ident(rb_float_new)operator((()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(x)operator(\)) operator(*) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\);) - operator(}) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) -operator(}) - -directive(static) directive(void) -ident(fixdivmod)operator(()ident(x)operator(,) ident(y)operator(,) ident(divp)operator(,) ident(modp)operator(\)) - pre_type(long) ident(x)operator(,) ident(y)operator(;) - pre_type(long) operator(*)ident(divp)operator(,) operator(*)ident(modp)operator(;) -operator({) - pre_type(long) ident(div)operator(,) ident(mod)operator(;) - - reserved(if) operator(()ident(y) operator(==) integer(0)operator(\)) ident(rb_num_zerodiv)operator((\);) - reserved(if) operator(()ident(y) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(x) operator(<) integer(0)operator(\)) - ident(div) operator(=) operator(-)ident(x) operator(/) operator(-)ident(y)operator(;) - reserved(else) - ident(div) operator(=) operator(-) operator(()ident(x) operator(/) operator(-)ident(y)operator(\);) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(x) operator(<) integer(0)operator(\)) - ident(div) operator(=) operator(-) operator((-)ident(x) operator(/) ident(y)operator(\);) - reserved(else) - ident(div) operator(=) ident(x) operator(/) ident(y)operator(;) - operator(}) - ident(mod) operator(=) ident(x) operator(-) ident(div)operator(*)ident(y)operator(;) - reserved(if) operator((()ident(mod) operator(<) integer(0) operator(&&) ident(y) operator(>) integer(0)operator(\)) operator(||) operator(()ident(mod) operator(>) integer(0) operator(&&) ident(y) operator(<) integer(0)operator(\)\)) operator({) - ident(mod) operator(+=) ident(y)operator(;) - ident(div) operator(-=) integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(divp)operator(\)) operator(*)ident(divp) operator(=) ident(div)operator(;) - reserved(if) operator(()ident(modp)operator(\)) operator(*)ident(modp) operator(=) ident(mod)operator(;) -operator(}) - -comment(/* - * call-seq: - * fix.quo(numeric\) => float - * - * Returns the floating point result of dividing fix by - * numeric. - * - * 654321.quo(13731\) #=> 47.6528293642124 - * 654321.quo(13731.24\) #=> 47.6519964693647 - * - */) - -directive(static) ident(VALUE) -ident(fix_quo)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - reserved(return) ident(rb_float_new)operator((()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(x)operator(\)) operator(/) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(y)operator(\)\);) - operator(}) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix / numeric => numeric_result - * fix.div(numeric\) => numeric_result - * - * Performs division: the class of the resulting object depends on - * the class of numeric and on the magnitude of the - * result. - */) - -directive(static) ident(VALUE) -ident(fix_div)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - pre_type(long) ident(div)operator(;) - - ident(fixdivmod)operator(()ident(FIX2LONG)operator(()ident(x)operator(\),) ident(FIX2LONG)operator(()ident(y)operator(\),) operator(&)ident(div)operator(,) integer(0)operator(\);) - reserved(return) ident(LONG2NUM)operator(()ident(div)operator(\);) - operator(}) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix % other => Numeric - * fix.modulo(other\) => Numeric - * - * Returns fix modulo other. - * See Numeric.divmod for more information. - */) - -directive(static) ident(VALUE) -ident(fix_mod)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - pre_type(long) ident(mod)operator(;) - - ident(fixdivmod)operator(()ident(FIX2LONG)operator(()ident(x)operator(\),) ident(FIX2LONG)operator(()ident(y)operator(\),) integer(0)operator(,) operator(&)ident(mod)operator(\);) - reserved(return) ident(LONG2NUM)operator(()ident(mod)operator(\);) - operator(}) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix.divmod(numeric\) => array - * - * See Numeric#divmod. - */) -directive(static) ident(VALUE) -ident(fix_divmod)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - pre_type(long) ident(div)operator(,) ident(mod)operator(;) - - ident(fixdivmod)operator(()ident(FIX2LONG)operator(()ident(x)operator(\),) ident(FIX2LONG)operator(()ident(y)operator(\),) operator(&)ident(div)operator(,) operator(&)ident(mod)operator(\);) - - reserved(return) ident(rb_assoc_new)operator(()ident(LONG2NUM)operator(()ident(div)operator(\),) ident(LONG2NUM)operator(()ident(mod)operator(\)\);) - operator(}) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(int_even_p)operator(()ident(VALUE) ident(num)operator(\)) -operator({) - reserved(if) operator(()ident(rb_funcall)operator(()ident(num)operator(,) char('%')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(2)operator(\)\)) operator(==) ident(INT2FIX)operator(()integer(0)operator(\)\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * fix ** other => Numeric - * - * Raises fix to the other power, which may - * be negative or fractional. - * - * 2 ** 3 #=> 8 - * 2 ** -1 #=> 0.5 - * 2 ** 0.5 #=> 1.4142135623731 - */) - -directive(static) ident(VALUE) -ident(fix_pow)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - directive(static) directive(const) pre_type(double) ident(zero) operator(=) float(0)float(.0)operator(;) - pre_type(long) ident(a) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\);) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - pre_type(long) ident(b)operator(;) - - ident(b) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(if) operator(()ident(b) operator(==) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(if) operator(()ident(b) operator(==) integer(1)operator(\)) reserved(return) ident(x)operator(;) - ident(a) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\);) - reserved(if) operator(()ident(a) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(b) operator(>) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(return) ident(rb_float_new)operator(()float(1)float(.0) operator(/) ident(zero)operator(\);) - operator(}) - reserved(if) operator(()ident(a) operator(==) integer(1)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(if) operator(()ident(a) operator(==) operator(-)integer(1)operator(\)) operator({) - reserved(if) operator(()ident(b) operator(%) integer(2) operator(==) integer(0)operator(\)) - reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(else) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - reserved(if) operator(()ident(b) operator(>) integer(0)operator(\)) operator({) - reserved(return) ident(rb_big_pow)operator(()ident(rb_int2big)operator(()ident(a)operator(\),) ident(y)operator(\);) - operator(}) - reserved(return) ident(rb_float_new)operator(()ident(pow)operator((()pre_type(double)operator(\))ident(a)operator(,) operator(()pre_type(double)operator(\))ident(b)operator(\)\);) - operator(}) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(if) operator(()ident(a) operator(==) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(a) operator(==) integer(1)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(if) operator(()ident(a) operator(==) operator(-)integer(1)operator(\)) operator({) - reserved(if) operator(()ident(int_even_p)operator(()ident(y)operator(\)\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(else) reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - ident(x) operator(=) ident(rb_int2big)operator(()ident(FIX2LONG)operator(()ident(x)operator(\)\);) - reserved(return) ident(rb_big_pow)operator(()ident(x)operator(,) ident(y)operator(\);) - reserved(case) ident(T_FLOAT)operator(:) - reserved(if) operator(()ident(a) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(rb_float_new)operator(()ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value) operator(<) integer(0) operator(?) operator(()float(1)float(.0) operator(/) ident(zero)operator(\)) operator(:) float(0)float(.0)operator(\);) - operator(}) - reserved(if) operator(()ident(a) operator(==) integer(1)operator(\)) reserved(return) ident(rb_float_new)operator(()float(1)float(.0)operator(\);) - reserved(return) ident(rb_float_new)operator(()ident(pow)operator((()pre_type(double)operator(\))ident(a)operator(,) ident(RFLOAT)operator(()ident(y)operator(\)->)ident(value)operator(\)\);) - reserved(default)operator(:) - reserved(return) ident(rb_num_coerce_bin)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * fix == other - * - * Return true if fix equals other - * numerically. - * - * 1 == 2 #=> false - * 1 == 1.0 #=> true - */) - -directive(static) ident(VALUE) -ident(fix_equal)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(x) operator(==) ident(y)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(num_equal)operator(()ident(x)operator(,) ident(y)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix <=> numeric => -1, 0, +1 - * - * Comparison---Returns -1, 0, or +1 depending on whether fix is - * less than, equal to, or greater than numeric. This is the - * basis for the tests in Comparable. - */) - -directive(static) ident(VALUE) -ident(fix_cmp)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(x) operator(==) ident(y)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - pre_type(long) ident(a) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\),) ident(b) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - - reserved(if) operator(()ident(a) operator(>) ident(b)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - reserved(else) operator({) - reserved(return) ident(rb_num_coerce_cmp)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * fix > other => true or false - * - * Returns true if the value of fix is - * greater than that of other. - */) - -directive(static) ident(VALUE) -ident(fix_gt)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - pre_type(long) ident(a) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\),) ident(b) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - - reserved(if) operator(()ident(a) operator(>) ident(b)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) ident(rb_num_coerce_relop)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * fix >= other => true or false - * - * Returns true if the value of fix is - * greater than or equal to that of other. - */) - -directive(static) ident(VALUE) -ident(fix_ge)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - pre_type(long) ident(a) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\),) ident(b) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - - reserved(if) operator(()ident(a) operator(>=) ident(b)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) ident(rb_num_coerce_relop)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * fix < other => true or false - * - * Returns true if the value of fix is - * less than that of other. - */) - -directive(static) ident(VALUE) -ident(fix_lt)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - pre_type(long) ident(a) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\),) ident(b) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - - reserved(if) operator(()ident(a) operator(<) ident(b)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) ident(rb_num_coerce_relop)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * fix <= other => true or false - * - * Returns true if the value of fix is - * less thanor equal to that of other. - */) - -directive(static) ident(VALUE) -ident(fix_le)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(y)operator(\)\)) operator({) - pre_type(long) ident(a) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\),) ident(b) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - - reserved(if) operator(()ident(a) operator(<=) ident(b)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) ident(rb_num_coerce_relop)operator(()ident(x)operator(,) ident(y)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * ~fix => integer - * - * One's complement: returns a number where each bit is flipped. - */) - -directive(static) ident(VALUE) -ident(fix_rev)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - pre_type(long) ident(val) operator(=) ident(FIX2LONG)operator(()ident(num)operator(\);) - - ident(val) operator(=) operator(~)ident(val)operator(;) - reserved(return) ident(LONG2NUM)operator(()ident(val)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(fix_coerce)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - reserved(while) operator((!)ident(FIXNUM_P)operator(()ident(x)operator(\)) operator(&&) ident(TYPE)operator(()ident(x)operator(\)) operator(!=) ident(T_BIGNUM)operator(\)) operator({) - ident(x) operator(=) ident(rb_to_int)operator(()ident(x)operator(\);) - operator(}) - reserved(return) ident(x)operator(;) -operator(}) - -comment(/* - * call-seq: - * fix & other => integer - * - * Bitwise AND. - */) - -directive(static) ident(VALUE) -ident(fix_and)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(long) ident(val)operator(;) - - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(y) operator(=) ident(fix_coerce)operator(()ident(y)operator(\)\)\)) operator({) - reserved(return) ident(rb_big_and)operator(()ident(y)operator(,) ident(x)operator(\);) - operator(}) - ident(val) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\)) operator(&) ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(return) ident(LONG2NUM)operator(()ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix | other => integer - * - * Bitwise OR. - */) - -directive(static) ident(VALUE) -ident(fix_or)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(long) ident(val)operator(;) - - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(y) operator(=) ident(fix_coerce)operator(()ident(y)operator(\)\)\)) operator({) - reserved(return) ident(rb_big_or)operator(()ident(y)operator(,) ident(x)operator(\);) - operator(}) - ident(val) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\)) operator(|) ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(return) ident(LONG2NUM)operator(()ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix ^ other => integer - * - * Bitwise EXCLUSIVE OR. - */) - -directive(static) ident(VALUE) -ident(fix_xor)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(long) ident(val)operator(;) - - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(y) operator(=) ident(fix_coerce)operator(()ident(y)operator(\)\)\)) operator({) - reserved(return) ident(rb_big_xor)operator(()ident(y)operator(,) ident(x)operator(\);) - operator(}) - ident(val) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\)) operator(^) ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(return) ident(LONG2NUM)operator(()ident(val)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(fix_lshift) ident(_)operator((()pre_type(long)operator(,) pre_type(unsigned) pre_type(long)operator(\)\);) -directive(static) ident(VALUE) ident(fix_rshift) ident(_)operator((()pre_type(long)operator(,) pre_type(unsigned) pre_type(long)operator(\)\);) - -comment(/* - * call-seq: - * fix << count => integer - * - * Shifts _fix_ left _count_ positions (right if _count_ is negative\). - */) - -directive(static) ident(VALUE) -ident(rb_fix_lshift)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(long) ident(val)operator(,) ident(width)operator(;) - - ident(val) operator(=) ident(NUM2LONG)operator(()ident(x)operator(\);) - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(y)operator(\)\)) - reserved(return) ident(rb_big_lshift)operator(()ident(rb_int2big)operator(()ident(val)operator(\),) ident(y)operator(\);) - ident(width) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(if) operator(()ident(width) operator(<) integer(0)operator(\)) - reserved(return) ident(fix_rshift)operator(()ident(val)operator(,) operator(()pre_type(unsigned) pre_type(long)operator(\)-)ident(width)operator(\);) - reserved(return) ident(fix_lshift)operator(()ident(val)operator(,) ident(width)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(fix_lshift)operator(()ident(val)operator(,) ident(width)operator(\)) - pre_type(long) ident(val)operator(;) - pre_type(unsigned) pre_type(long) ident(width)operator(;) -operator({) - reserved(if) operator(()ident(width) operator(>) operator(()reserved(sizeof)operator(()ident(VALUE)operator(\)*)ident(CHAR_BIT)operator(-)integer(1)operator(\)) - operator(||) operator((()pre_type(unsigned) pre_type(long)operator(\))ident(val)operator(\)>>()reserved(sizeof)operator(()ident(VALUE)operator(\)*)ident(CHAR_BIT)operator(-)integer(1)operator(-)ident(width)operator(\)) operator(>) integer(0)operator(\)) operator({) - reserved(return) ident(rb_big_lshift)operator(()ident(rb_int2big)operator(()ident(val)operator(\),) ident(ULONG2NUM)operator(()ident(width)operator(\)\);) - operator(}) - ident(val) operator(=) ident(val) operator(<<) ident(width)operator(;) - reserved(return) ident(LONG2NUM)operator(()ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix >> count => integer - * - * Shifts _fix_ right _count_ positions (left if _count_ is negative\). - */) - -directive(static) ident(VALUE) -ident(rb_fix_rshift)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - pre_type(long) ident(i)operator(,) ident(val)operator(;) - - ident(val) operator(=) ident(FIX2LONG)operator(()ident(x)operator(\);) - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(y)operator(\)\)) - reserved(return) ident(rb_big_rshift)operator(()ident(rb_int2big)operator(()ident(val)operator(\),) ident(y)operator(\);) - ident(i) operator(=) ident(FIX2LONG)operator(()ident(y)operator(\);) - reserved(if) operator(()ident(i) operator(==) integer(0)operator(\)) reserved(return) ident(x)operator(;) - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) - reserved(return) ident(fix_lshift)operator(()ident(val)operator(,) operator(()pre_type(unsigned) pre_type(long)operator(\)-)ident(i)operator(\);) - reserved(return) ident(fix_rshift)operator(()ident(val)operator(,) ident(i)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(fix_rshift)operator(()pre_type(long) ident(val)operator(,) pre_type(unsigned) pre_type(long) ident(i)operator(\)) -operator({) - reserved(if) operator(()ident(i) operator(>=) reserved(sizeof)operator(()pre_type(long)operator(\)*)ident(CHAR_BIT)operator(-)integer(1)operator(\)) operator({) - reserved(if) operator(()ident(val) operator(<) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - operator(}) - ident(val) operator(=) ident(RSHIFT)operator(()ident(val)operator(,) ident(i)operator(\);) - reserved(return) ident(LONG2FIX)operator(()ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix[n] => 0, 1 - * - * Bit Reference---Returns the nth bit in the binary - * representation of fix, where fix[0] is the least - * significant bit. - * - * a = 0b11001100101010 - * 30.downto(0\) do |n| print a[n] end - * - * produces: - * - * 0000000000000000011001100101010 - */) - -directive(static) ident(VALUE) -ident(fix_aref)operator(()ident(fix)operator(,) ident(idx)operator(\)) - ident(VALUE) ident(fix)operator(,) ident(idx)operator(;) -operator({) - pre_type(long) ident(val) operator(=) ident(FIX2LONG)operator(()ident(fix)operator(\);) - pre_type(long) ident(i)operator(;) - - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(idx) operator(=) ident(fix_coerce)operator(()ident(idx)operator(\)\)\)) operator({) - ident(idx) operator(=) ident(rb_big_norm)operator(()ident(idx)operator(\);) - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(idx)operator(\)\)) operator({) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(idx)operator(\)->)ident(sign) operator(||) ident(val) operator(>=) integer(0)operator(\)) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - operator(}) - operator(}) - ident(i) operator(=) ident(FIX2LONG)operator(()ident(idx)operator(\);) - - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()reserved(sizeof)operator(()ident(VALUE)operator(\)*)ident(CHAR_BIT)operator(-)integer(1) operator(<) ident(i)operator(\)) operator({) - reserved(if) operator(()ident(val) operator(<) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(val) operator(&) operator(()integer(1L)operator(<<)ident(i)operator(\)\)) - reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix.to_f -> float - * - * Converts fix to a Float. - * - */) - -directive(static) ident(VALUE) -ident(fix_to_f)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - pre_type(double) ident(val)operator(;) - - ident(val) operator(=) operator(()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(num)operator(\);) - - reserved(return) ident(rb_float_new)operator(()ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix.abs -> aFixnum - * - * Returns the absolute value of fix. - * - * -12345.abs #=> 12345 - * 12345.abs #=> 12345 - * - */) - -directive(static) ident(VALUE) -ident(fix_abs)operator(()ident(fix)operator(\)) - ident(VALUE) ident(fix)operator(;) -operator({) - pre_type(long) ident(i) operator(=) ident(FIX2LONG)operator(()ident(fix)operator(\);) - - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) ident(i) operator(=) operator(-)ident(i)operator(;) - - reserved(return) ident(LONG2NUM)operator(()ident(i)operator(\);) -operator(}) - -comment(/* - * call-seq: - * fix.id2name -> string or nil - * - * Returns the name of the object whose symbol id is fix. If - * there is no symbol in the symbol table with this value, returns - * nil. id2name has nothing to do with the - * Object.id method. See also Fixnum#to_sym, - * String#intern, and class Symbol. - * - * symbol = :@inst_var #=> :@inst_var - * id = symbol.to_i #=> 9818 - * id.id2name #=> "@inst_var" - */) - -directive(static) ident(VALUE) -ident(fix_id2name)operator(()ident(fix)operator(\)) - ident(VALUE) ident(fix)operator(;) -operator({) - pre_type(char) operator(*)ident(name) operator(=) ident(rb_id2name)operator(()ident(FIX2UINT)operator(()ident(fix)operator(\)\);) - reserved(if) operator(()ident(name)operator(\)) reserved(return) ident(rb_str_new2)operator(()ident(name)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * fix.to_sym -> aSymbol - * - * Returns the symbol whose integer value is fix. See also - * Fixnum#id2name. - * - * fred = :fred.to_i - * fred.id2name #=> "fred" - * fred.to_sym #=> :fred - */) - -directive(static) ident(VALUE) -ident(fix_to_sym)operator(()ident(fix)operator(\)) - ident(VALUE) ident(fix)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(FIX2UINT)operator(()ident(fix)operator(\);) - - reserved(if) operator(()ident(rb_id2name)operator(()ident(id)operator(\)\)) operator({) - reserved(return) ident(ID2SYM)operator(()ident(id)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * fix.size -> fixnum - * - * Returns the number of bytes in the machine representation - * of a Fixnum. - * - * 1.size #=> 4 - * -1.size #=> 4 - * 2147483647.size #=> 4 - */) - -directive(static) ident(VALUE) -ident(fix_size)operator(()ident(fix)operator(\)) - ident(VALUE) ident(fix)operator(;) -operator({) - reserved(return) ident(INT2FIX)operator(()reserved(sizeof)operator(()pre_type(long)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * int.upto(limit\) {|i| block } => int - * - * Iterates block, passing in integer values from int - * up to and including limit. - * - * 5.upto(10\) { |i| print i, " " } - * - * produces: - * - * 5 6 7 8 9 10 - */) - -directive(static) ident(VALUE) -ident(int_upto)operator(()ident(from)operator(,) ident(to)operator(\)) - ident(VALUE) ident(from)operator(,) ident(to)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(from)operator(\)) operator(&&) ident(FIXNUM_P)operator(()ident(to)operator(\)\)) operator({) - pre_type(long) ident(i)operator(,) ident(end)operator(;) - - ident(end) operator(=) ident(FIX2LONG)operator(()ident(to)operator(\);) - reserved(for) operator(()ident(i) operator(=) ident(FIX2LONG)operator(()ident(from)operator(\);) ident(i) operator(<=) ident(end)operator(;) ident(i)operator(++\)) operator({) - ident(rb_yield)operator(()ident(LONG2FIX)operator(()ident(i)operator(\)\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(i) operator(=) ident(from)operator(,) ident(c)operator(;) - - reserved(while) operator((!()ident(c) operator(=) ident(rb_funcall)operator(()ident(i)operator(,) char('>')operator(,) integer(1)operator(,) ident(to)operator(\)\)\)) operator({) - ident(rb_yield)operator(()ident(i)operator(\);) - ident(i) operator(=) ident(rb_funcall)operator(()ident(i)operator(,) char('+')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(1)operator(\)\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(c)operator(\)\)) ident(rb_cmperr)operator(()ident(i)operator(,) ident(to)operator(\);) - operator(}) - reserved(return) ident(from)operator(;) -operator(}) - -comment(/* - * call-seq: - * int.downto(limit\) {|i| block } => int - * - * Iterates block, passing decreasing values from int - * down to and including limit. - * - * 5.downto(1\) { |n| print n, ".. " } - * print " Liftoff!\\n" - * - * produces: - * - * 5.. 4.. 3.. 2.. 1.. Liftoff! - */) - -directive(static) ident(VALUE) -ident(int_downto)operator(()ident(from)operator(,) ident(to)operator(\)) - ident(VALUE) ident(from)operator(,) ident(to)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(from)operator(\)) operator(&&) ident(FIXNUM_P)operator(()ident(to)operator(\)\)) operator({) - pre_type(long) ident(i)operator(,) ident(end)operator(;) - - ident(end) operator(=) ident(FIX2LONG)operator(()ident(to)operator(\);) - reserved(for) operator(()ident(i)operator(=)ident(FIX2LONG)operator(()ident(from)operator(\);) ident(i) operator(>=) ident(end)operator(;) ident(i)operator(--\)) operator({) - ident(rb_yield)operator(()ident(LONG2FIX)operator(()ident(i)operator(\)\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(i) operator(=) ident(from)operator(,) ident(c)operator(;) - - reserved(while) operator((!()ident(c) operator(=) ident(rb_funcall)operator(()ident(i)operator(,) char('<')operator(,) integer(1)operator(,) ident(to)operator(\)\)\)) operator({) - ident(rb_yield)operator(()ident(i)operator(\);) - ident(i) operator(=) ident(rb_funcall)operator(()ident(i)operator(,) char('-')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(1)operator(\)\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(c)operator(\)\)) ident(rb_cmperr)operator(()ident(i)operator(,) ident(to)operator(\);) - operator(}) - reserved(return) ident(from)operator(;) -operator(}) - -comment(/* - * call-seq: - * int.times {|i| block } => int - * - * Iterates block int times, passing in values from zero to - * int - 1. - * - * 5.times do |i| - * print i, " " - * end - * - * produces: - * - * 0 1 2 3 4 - */) - -directive(static) ident(VALUE) -ident(int_dotimes)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(num)operator(\)\)) operator({) - pre_type(long) ident(i)operator(,) ident(end)operator(;) - - ident(end) operator(=) ident(FIX2LONG)operator(()ident(num)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(end)operator(;) ident(i)operator(++\)) operator({) - ident(rb_yield)operator(()ident(LONG2FIX)operator(()ident(i)operator(\)\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(i) operator(=) ident(INT2FIX)operator(()integer(0)operator(\);) - - reserved(for) operator((;;\)) operator({) - reserved(if) operator((!)ident(RTEST)operator(()ident(rb_funcall)operator(()ident(i)operator(,) char('<')operator(,) integer(1)operator(,) ident(num)operator(\)\)\)) reserved(break)operator(;) - ident(rb_yield)operator(()ident(i)operator(\);) - ident(i) operator(=) ident(rb_funcall)operator(()ident(i)operator(,) char('+')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(1)operator(\)\);) - operator(}) - operator(}) - reserved(return) ident(num)operator(;) -operator(}) - -comment(/* - * call-seq: - * fix.zero? => true or false - * - * Returns true if fix is zero. - * - */) - -directive(static) ident(VALUE) -ident(fix_zero_p)operator(()ident(num)operator(\)) - ident(VALUE) ident(num)operator(;) -operator({) - reserved(if) operator(()ident(FIX2LONG)operator(()ident(num)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(void) -ident(Init_Numeric)operator((\)) -operator({) -preprocessor(#if) ident(defined)operator(()ident(__FreeBSD__)operator(\)) operator(&&) ident(__FreeBSD__) operator(<) integer(4) - comment(/* allow divide by zero -- Inf */) - ident(fpsetmask)operator(()ident(fpgetmask)operator((\)) operator(&) operator(~()ident(FP_X_DZ)operator(|)ident(FP_X_INV)operator(|)ident(FP_X_OFL)operator(\)\);) -preprocessor(#elif) ident(defined)operator(()ident(_UNICOSMP)operator(\)) - comment(/* Turn off floating point exceptions for divide by zero, etc. */) - ident(_set_Creg)operator(()integer(0)operator(,) integer(0)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(__BORLANDC__)operator(\)) - comment(/* Turn off floating point exceptions for overflow, etc. */) - ident(_control87)operator(()ident(MCW_EM)operator(,) ident(MCW_EM)operator(\);) -preprocessor(#endif) - ident(id_coerce) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_to_i) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_eq) operator(=) ident(rb_intern)operator(()stringoperator(\);) - - ident(rb_eZeroDivError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - ident(rb_eFloatDomainError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eRangeError)operator(\);) - ident(rb_cNumeric) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_sadded)operator(,) integer(1)operator(\);) - ident(rb_include_module)operator(()ident(rb_cNumeric)operator(,) ident(rb_mComparable)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_init_copy)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_coerce)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_uplus)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_uminus)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) string)delimiter(")>operator(,) ident(num_cmp)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_eql)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_quo)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_div)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_divmod)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_modulo)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_remainder)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_abs)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_to_int)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_int_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_zero_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_nonzero_p)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_floor)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_ceil)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_round)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_truncate)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNumeric)operator(,) stringoperator(,) ident(num_step)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_cInteger) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cNumeric)operator(\);) - ident(rb_undef_alloc_func)operator(()ident(rb_cInteger)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cInteger)operator(\),) stringoperator(\);) - - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_int_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_upto)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_downto)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_dotimes)operator(,) integer(0)operator(\);) - ident(rb_include_module)operator(()ident(rb_cInteger)operator(,) ident(rb_mPrecision)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_succ)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_succ)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_chr)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_to_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_to_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_to_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_to_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_to_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(int_to_i)operator(,) integer(0)operator(\);) - - ident(rb_cFixnum) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cInteger)operator(\);) - ident(rb_include_module)operator(()ident(rb_cFixnum)operator(,) ident(rb_mPrecision)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(rb_fix_induced_from)operator(,) integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cInteger)operator(,) stringoperator(,) ident(rb_int_induced_from)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_to_s)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_id2name)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_to_sym)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_uminus)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_plus)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_minus)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_mul)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_div)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_div)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_mod)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_mod)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_divmod)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_quo)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_pow)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_abs)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) string)delimiter(")>operator(,) ident(fix_cmp)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) string)delimiter(")>operator(,) ident(fix_gt)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) string=)delimiter(")>operator(,) ident(fix_ge)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_lt)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_le)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_rev)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_and)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_or)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_xor)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_aref)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(rb_fix_lshift)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) string>)delimiter(")>operator(,) ident(rb_fix_rshift)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_to_f)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_size)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFixnum)operator(,) stringoperator(,) ident(fix_zero_p)operator(,) integer(0)operator(\);) - - ident(rb_cFloat) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cNumeric)operator(\);) - - ident(rb_undef_alloc_func)operator(()ident(rb_cFloat)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cFloat)operator(\),) stringoperator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(rb_flo_induced_from)operator(,) integer(1)operator(\);) - ident(rb_include_module)operator(()ident(rb_cFloat)operator(,) ident(rb_mPrecision)operator(\);) - - ident(rb_define_const)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(FLT_ROUNDS)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(FLT_RADIX)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(DBL_MANT_DIG)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(DBL_DIG)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(DBL_MIN_EXP)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(DBL_MAX_EXP)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(DBL_MIN_10_EXP)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(DBL_MAX_10_EXP)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(rb_float_new)operator(()ident(DBL_MIN)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(rb_float_new)operator(()ident(DBL_MAX)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(rb_float_new)operator(()ident(DBL_EPSILON)operator(\)\);) - - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_coerce)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_uminus)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_plus)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_minus)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_mul)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_div)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_mod)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_mod)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_divmod)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_pow)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_eq)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) string)delimiter(")>operator(,) ident(flo_cmp)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) string)delimiter(")>operator(,) ident(flo_gt)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) string=)delimiter(")>operator(,) ident(flo_ge)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_lt)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_le)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_eql)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_hash)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_to_f)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_abs)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_zero_p)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_truncate)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_truncate)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_floor)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_ceil)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_round)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_truncate)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_is_nan_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_is_infinite_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFloat)operator(,) stringoperator(,) ident(flo_is_finite_p)operator(,) integer(0)operator(\);) -operator(}) -comment(/********************************************************************** - - object.c - - - $Author: shyouhei $ - $Date: 2008-06-18 08:21:30 +0200 (Wed, 18 Jun 2008\) $ - created at: Thu Jul 15 12:01:24 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("st.h") -preprocessor(#include) include("util.h") -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -ident(VALUE) ident(rb_mKernel)operator(;) -ident(VALUE) ident(rb_cObject)operator(;) -ident(VALUE) ident(rb_cModule)operator(;) -ident(VALUE) ident(rb_cClass)operator(;) -ident(VALUE) ident(rb_cData)operator(;) - -ident(VALUE) ident(rb_cNilClass)operator(;) -ident(VALUE) ident(rb_cTrueClass)operator(;) -ident(VALUE) ident(rb_cFalseClass)operator(;) -ident(VALUE) ident(rb_cSymbol)operator(;) - -directive(static) ident(ID) ident(id_eq)operator(,) ident(id_eql)operator(,) ident(id_inspect)operator(,) ident(id_init_copy)operator(;) - -comment(/* - * call-seq: - * obj === other => true or false - * - * Case Equality---For class Object, effectively the same - * as calling #==, but typically overridden by descendents - * to provide meaningful semantics in case statements. - */) - -ident(VALUE) -ident(rb_equal)operator(()ident(obj1)operator(,) ident(obj2)operator(\)) - ident(VALUE) ident(obj1)operator(,) ident(obj2)operator(;) -operator({) - ident(VALUE) ident(result)operator(;) - - reserved(if) operator(()ident(obj1) operator(==) ident(obj2)operator(\)) reserved(return) ident(Qtrue)operator(;) - ident(result) operator(=) ident(rb_funcall)operator(()ident(obj1)operator(,) ident(id_eq)operator(,) integer(1)operator(,) ident(obj2)operator(\);) - reserved(if) operator(()ident(RTEST)operator(()ident(result)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -pre_type(int) -ident(rb_eql)operator(()ident(obj1)operator(,) ident(obj2)operator(\)) - ident(VALUE) ident(obj1)operator(,) ident(obj2)operator(;) -operator({) - reserved(return) ident(RTEST)operator(()ident(rb_funcall)operator(()ident(obj1)operator(,) ident(id_eql)operator(,) integer(1)operator(,) ident(obj2)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * obj == other => true or false - * obj.equal?(other\) => true or false - * obj.eql?(other\) => true or false - * - * Equality---At the Object level, == returns - * true only if obj and other are the - * same object. Typically, this method is overridden in descendent - * classes to provide class-specific meaning. - * - * Unlike ==, the equal? method should never be - * overridden by subclasses: it is used to determine object identity - * (that is, a.equal?(b\) iff a is the same - * object as b\). - * - * The eql? method returns true if - obj and anObject have the - * same value. Used by Hash to test members for equality. - * For objects of class Object, eql? is - * synonymous with ==. Subclasses normally continue this - * tradition, but there are exceptions. Numeric types, for - * example, perform type conversion across ==, but not - * across eql?, so: - * - * 1 == 1.0 #=> true - * 1.eql? 1.0 #=> false - */) - -directive(static) ident(VALUE) -ident(rb_obj_equal)operator(()ident(obj1)operator(,) ident(obj2)operator(\)) - ident(VALUE) ident(obj1)operator(,) ident(obj2)operator(;) -operator({) - reserved(if) operator(()ident(obj1) operator(==) ident(obj2)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.id => fixnum - * - * Soon-to-be deprecated version of Object#object_id. - */) - -ident(VALUE) -ident(rb_obj_id_obsolete)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(rb_warn)operator(()stringoperator(\);) - reserved(return) ident(rb_obj_id)operator(()ident(obj)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_class_real)operator(()ident(cl)operator(\)) - ident(VALUE) ident(cl)operator(;) -operator({) - reserved(while) operator(()ident(FL_TEST)operator(()ident(cl)operator(,) ident(FL_SINGLETON)operator(\)) operator(||) ident(TYPE)operator(()ident(cl)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(cl) operator(=) ident(RCLASS)operator(()ident(cl)operator(\)->)ident(super)operator(;) - operator(}) - reserved(return) ident(cl)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.type => class - * - * Deprecated synonym for Object#class. - */) - -ident(VALUE) -ident(rb_obj_type)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(rb_warn)operator(()stringoperator(\);) - reserved(return) ident(rb_class_real)operator(()ident(CLASS_OF)operator(()ident(obj)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * obj.class => class - * - * Returns the class of obj, now preferred over - * Object#type, as an object's type in Ruby is only - * loosely tied to that object's class. This method must always be - * called with an explicit receiver, as class is also a - * reserved word in Ruby. - * - * 1.class #=> Fixnum - * self.class #=> Object - */) - -ident(VALUE) -ident(rb_obj_class)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_class_real)operator(()ident(CLASS_OF)operator(()ident(obj)operator(\)\);) -operator(}) - -directive(static) directive(void) -ident(init_copy)operator(()ident(dest)operator(,) ident(obj)operator(\)) - ident(VALUE) ident(dest)operator(,) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(dest)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(rb_obj_classname)operator(()ident(dest)operator(\)\);) - operator(}) - ident(RBASIC)operator(()ident(dest)operator(\)->)ident(flags) operator(&=) operator(~()ident(T_MASK)operator(|)ident(FL_EXIVAR)operator(\);) - ident(RBASIC)operator(()ident(dest)operator(\)->)ident(flags) operator(|=) ident(RBASIC)operator(()ident(obj)operator(\)->)ident(flags) operator(&) operator(()ident(T_MASK)operator(|)ident(FL_EXIVAR)operator(|)ident(FL_TAINT)operator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_EXIVAR)operator(\)\)) operator({) - ident(rb_copy_generic_ivar)operator(()ident(dest)operator(,) ident(obj)operator(\);) - operator(}) - ident(rb_gc_copy_finalizer)operator(()ident(dest)operator(,) ident(obj)operator(\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_OBJECT)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - reserved(if) operator(()ident(ROBJECT)operator(()ident(dest)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(st_free_table)operator(()ident(ROBJECT)operator(()ident(dest)operator(\)->)ident(iv_tbl)operator(\);) - ident(ROBJECT)operator(()ident(dest)operator(\)->)ident(iv_tbl) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(ROBJECT)operator(()ident(dest)operator(\)->)ident(iv_tbl) operator(=) ident(st_copy)operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(\);) - operator(}) - operator(}) - ident(rb_funcall)operator(()ident(dest)operator(,) ident(id_init_copy)operator(,) integer(1)operator(,) ident(obj)operator(\);) -operator(}) - -comment(/* - * call-seq: - * obj.clone -> an_object - * - * Produces a shallow copy of obj---the instance variables of - * obj are copied, but not the objects they reference. Copies - * the frozen and tainted state of obj. See also the discussion - * under Object#dup. - * - * class Klass - * attr_accessor :str - * end - * s1 = Klass.new #=> # - * s1.str = "Hello" #=> "Hello" - * s2 = s1.clone #=> # - * s2.str[1,4] = "i" #=> "i" - * s1.inspect #=> "#" - * s2.inspect #=> "#" - * - * This method may have class-specific behavior. If so, that - * behavior will be documented under the #+initialize_copy+ method of - * the class. - */) - -ident(VALUE) -ident(rb_obj_clone)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(clone)operator(;) - - reserved(if) operator(()ident(rb_special_const_p)operator(()ident(obj)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(rb_obj_classname)operator(()ident(obj)operator(\)\);) - operator(}) - ident(clone) operator(=) ident(rb_obj_alloc)operator(()ident(rb_obj_class)operator(()ident(obj)operator(\)\);) - ident(RBASIC)operator(()ident(clone)operator(\)->)ident(klass) operator(=) ident(rb_singleton_class_clone)operator(()ident(obj)operator(\);) - ident(RBASIC)operator(()ident(clone)operator(\)->)ident(flags) operator(=) operator(()ident(RBASIC)operator(()ident(obj)operator(\)->)ident(flags) operator(|) ident(FL_TEST)operator(()ident(clone)operator(,) ident(FL_TAINT)operator(\)\)) operator(&) operator(~()ident(FL_FREEZE)operator(|)ident(FL_FINALIZE)operator(\);) - ident(init_copy)operator(()ident(clone)operator(,) ident(obj)operator(\);) - ident(RBASIC)operator(()ident(clone)operator(\)->)ident(flags) operator(|=) ident(RBASIC)operator(()ident(obj)operator(\)->)ident(flags) operator(&) ident(FL_FREEZE)operator(;) - - reserved(return) ident(clone)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.dup -> an_object - * - * Produces a shallow copy of obj---the instance variables of - * obj are copied, but not the objects they reference. - * dup copies the tainted state of obj. See also - * the discussion under Object#clone. In general, - * clone and dup may have different semantics - * in descendent classes. While clone is used to duplicate - * an object, including its internal state, dup typically - * uses the class of the descendent object to create the new instance. - * - * This method may have class-specific behavior. If so, that - * behavior will be documented under the #+initialize_copy+ method of - * the class. - */) - -ident(VALUE) -ident(rb_obj_dup)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(dup)operator(;) - - reserved(if) operator(()ident(rb_special_const_p)operator(()ident(obj)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(rb_obj_classname)operator(()ident(obj)operator(\)\);) - operator(}) - ident(dup) operator(=) ident(rb_obj_alloc)operator(()ident(rb_obj_class)operator(()ident(obj)operator(\)\);) - ident(init_copy)operator(()ident(dup)operator(,) ident(obj)operator(\);) - - reserved(return) ident(dup)operator(;) -operator(}) - -comment(/* :nodoc: */) -ident(VALUE) -ident(rb_obj_init_copy)operator(()ident(obj)operator(,) ident(orig)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(orig)operator(;) -operator({) - reserved(if) operator(()ident(obj) operator(==) ident(orig)operator(\)) reserved(return) ident(obj)operator(;) - ident(rb_check_frozen)operator(()ident(obj)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(obj)operator(\)) operator(!=) ident(TYPE)operator(()ident(orig)operator(\)) operator(||) ident(rb_obj_class)operator(()ident(obj)operator(\)) operator(!=) ident(rb_obj_class)operator(()ident(orig)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(obj)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.to_a -> anArray - * - * Returns an array representation of obj. For objects of class - * Object and others that don't explicitly override the - * method, the return value is an array containing self. - * However, this latter behavior will soon be obsolete. - * - * self.to_a #=> -:1: warning: default `to_a' will be obsolete - * "hello".to_a #=> ["hello"] - * Time.new.to_a #=> [39, 54, 8, 9, 4, 2003, 3, 99, true, "CDT"] - */) - - -directive(static) ident(VALUE) -ident(rb_any_to_a)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(rb_warn)operator(()stringoperator(\);) - reserved(return) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(obj)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * obj.to_s => string - * - * Returns a string representing obj. The default - * to_s prints the object's class and an encoding of the - * object id. As a special case, the top-level object that is the - * initial execution context of Ruby programs returns ``main.'' - */) - -ident(VALUE) -ident(rb_any_to_s)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(char) operator(*)ident(cname) operator(=) ident(rb_obj_classname)operator(()ident(obj)operator(\);) - ident(size_t) ident(len)operator(;) - ident(VALUE) ident(str)operator(;) - - ident(len) operator(=) ident(strlen)operator(()ident(cname)operator(\)+)integer(6)operator(+)integer(16)operator(;) - ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) comment(/* 6:tags 16:addr */) - ident(snprintf)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(+)integer(1)operator(,) string)delimiter(")>operator(,) ident(cname)operator(,) ident(obj)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(strlen)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(obj)operator(\)\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_inspect)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_obj_as_string)operator(()ident(rb_funcall)operator(()ident(obj)operator(,) ident(id_inspect)operator(,) integer(0)operator(,) integer(0)operator(\)\);) -operator(}) - -directive(static) pre_type(int) -ident(inspect_i)operator(()ident(id)operator(,) ident(value)operator(,) ident(str)operator(\)) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(value)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(str2)operator(;) - pre_type(char) operator(*)ident(ivname)operator(;) - - comment(/* need not to show internal data */) - reserved(if) operator(()ident(CLASS_OF)operator(()ident(value)operator(\)) operator(==) integer(0)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(if) operator((!)ident(rb_is_instance_id)operator(()ident(id)operator(\)\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(==) char('-')operator(\)) operator({) comment(/* first element */) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(=) char('#')operator(;) - ident(rb_str_cat2)operator(()ident(str)operator(,) stringoperator(\);) - operator(}) - reserved(else) operator({) - ident(rb_str_cat2)operator(()ident(str)operator(,) stringoperator(\);) - operator(}) - ident(ivname) operator(=) ident(rb_id2name)operator(()ident(id)operator(\);) - ident(rb_str_cat2)operator(()ident(str)operator(,) ident(ivname)operator(\);) - ident(rb_str_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(str2) operator(=) ident(rb_inspect)operator(()ident(value)operator(\);) - ident(rb_str_append)operator(()ident(str)operator(,) ident(str2)operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(str2)operator(\);) - - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(inspect_obj)operator(()ident(obj)operator(,) ident(str)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(str)operator(;) -operator({) - ident(st_foreach_safe)operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(,) ident(inspect_i)operator(,) ident(str)operator(\);) - ident(rb_str_cat2)operator(()ident(str)operator(,) string)delimiter(")>operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(=) char('#')operator(;) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(obj)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.inspect => string - * - * Returns a string containing a human-readable representation of - * obj. If not overridden, uses the to_s method to - * generate the string. - * - * [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \\"five\\"]" - * Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003" - */) - - -directive(static) ident(VALUE) -ident(rb_obj_inspect)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(obj)operator(\)) operator(==) ident(T_OBJECT) - operator(&&) ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl) - operator(&&) ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(->)ident(num_entries) operator(>) integer(0)operator(\)) operator({) - ident(VALUE) ident(str)operator(;) - ident(size_t) ident(len)operator(;) - pre_type(char) operator(*)ident(c)operator(;) - - ident(c) operator(=) ident(rb_obj_classname)operator(()ident(obj)operator(\);) - reserved(if) operator(()ident(rb_inspecting_p)operator(()ident(obj)operator(\)\)) operator({) - ident(len) operator(=) ident(strlen)operator(()ident(c)operator(\)+)integer(10)operator(+)integer(16)operator(+)integer(1)operator(;) - ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) comment(/* 10:tags 16:addr 1:nul */) - ident(snprintf)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(,) string)delimiter(")>operator(,) ident(c)operator(,) ident(obj)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(strlen)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - reserved(return) ident(str)operator(;) - operator(}) - ident(len) operator(=) ident(strlen)operator(()ident(c)operator(\)+)integer(6)operator(+)integer(16)operator(+)integer(1)operator(;) - ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) comment(/* 6:tags 16:addr 1:nul */) - ident(snprintf)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(,) stringoperator(,) ident(c)operator(,) ident(obj)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(strlen)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - reserved(return) ident(rb_protect_inspect)operator(()ident(inspect_obj)operator(,) ident(obj)operator(,) ident(str)operator(\);) - operator(}) - reserved(return) ident(rb_funcall)operator(()ident(obj)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(,) integer(0)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * obj.instance_of?(class\) => true or false - * - * Returns true if obj is an instance of the given - * class. See also Object#kind_of?. - */) - -ident(VALUE) -ident(rb_obj_is_instance_of)operator(()ident(obj)operator(,) ident(c)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(c)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(c)operator(\)\)) operator({) - reserved(case) ident(T_MODULE)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_ICLASS)operator(:) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(rb_obj_class)operator(()ident(obj)operator(\)) operator(==) ident(c)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * obj.is_a?(class\) => true or false - * obj.kind_of?(class\) => true or false - * - * Returns true if class is the class of - * obj, or if class is one of the superclasses of - * obj or modules included in obj. - * - * module M; end - * class A - * include M - * end - * class B < A; end - * class C < B; end - * b = B.new - * b.instance_of? A #=> false - * b.instance_of? B #=> true - * b.instance_of? C #=> false - * b.instance_of? M #=> false - * b.kind_of? A #=> true - * b.kind_of? B #=> true - * b.kind_of? C #=> false - * b.kind_of? M #=> true - */) - -ident(VALUE) -ident(rb_obj_is_kind_of)operator(()ident(obj)operator(,) ident(c)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(c)operator(;) -operator({) - ident(VALUE) ident(cl) operator(=) ident(CLASS_OF)operator(()ident(obj)operator(\);) - - reserved(switch) operator(()ident(TYPE)operator(()ident(c)operator(\)\)) operator({) - reserved(case) ident(T_MODULE)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_ICLASS)operator(:) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - - reserved(while) operator(()ident(cl)operator(\)) operator({) - reserved(if) operator(()ident(cl) operator(==) ident(c) operator(||) ident(RCLASS)operator(()ident(cl)operator(\)->)ident(m_tbl) operator(==) ident(RCLASS)operator(()ident(c)operator(\)->)ident(m_tbl)operator(\)) - reserved(return) ident(Qtrue)operator(;) - ident(cl) operator(=) ident(RCLASS)operator(()ident(cl)operator(\)->)ident(super)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * Document-method: inherited - * - * call-seq: - * inherited(subclass\) - * - * Callback invoked whenever a subclass of the current class is created. - * - * Example: - * - * class Foo - * def self.inherited(subclass\) - * puts "New subclass: #{subclass}" - * end - * end - * - * class Bar < Foo - * end - * - * class Baz < Bar - * end - * - * produces: - * - * New subclass: Bar - * New subclass: Baz - */) - -comment(/* - * Document-method: singleton_method_added - * - * call-seq: - * singleton_method_added(symbol\) - * - * Invoked as a callback whenever a singleton method is added to the - * receiver. - * - * module Chatty - * def Chatty.singleton_method_added(id\) - * puts "Adding #{id.id2name}" - * end - * def self.one(\) end - * def two(\) end - * def Chatty.three(\) end - * end - * - * produces: - * - * Adding singleton_method_added - * Adding one - * Adding three - * - */) - -comment(/* - * Document-method: singleton_method_removed - * - * call-seq: - * singleton_method_removed(symbol\) - * - * Invoked as a callback whenever a singleton method is removed from - * the receiver. - * - * module Chatty - * def Chatty.singleton_method_removed(id\) - * puts "Removing #{id.id2name}" - * end - * def self.one(\) end - * def two(\) end - * def Chatty.three(\) end - * class <produces: - * - * Removing three - * Removing one - */) - -comment(/* - * Document-method: singleton_method_undefined - * - * call-seq: - * singleton_method_undefined(symbol\) - * - * Invoked as a callback whenever a singleton method is undefined in - * the receiver. - * - * module Chatty - * def Chatty.singleton_method_undefined(id\) - * puts "Undefining #{id.id2name}" - * end - * def Chatty.one(\) end - * class << self - * undef_method(:one\) - * end - * end - * - * produces: - * - * Undefining one - */) - - -comment(/* - * Document-method: included - * - * call-seq: - * included( othermod \) - * - * Callback invoked whenever the receiver is included in another - * module or class. This should be used in preference to - * Module.append_features if your code wants to perform some - * action when a module is included in another. - * - * module A - * def A.included(mod\) - * puts "#{self} included in #{mod}" - * end - * end - * module Enumerable - * include A - * end - */) - - -comment(/* - * Not documented - */) - -directive(static) ident(VALUE) -ident(rb_obj_dummy)operator((\)) -operator({) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.tainted? => true or false - * - * Returns true if the object is tainted. - */) - -ident(VALUE) -ident(rb_obj_tainted)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(obj)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.taint -> obj - * - * Marks obj as tainted---if the $SAFE level is - * set appropriately, many method calls which might alter the running - * programs environment will refuse to accept tainted strings. - */) - -ident(VALUE) -ident(rb_obj_taint)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(obj)operator(\)\)) operator({) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(obj)operator(\)\)) operator({) - ident(rb_error_frozen)operator(()stringoperator(\);) - operator(}) - ident(OBJ_TAINT)operator(()ident(obj)operator(\);) - operator(}) - reserved(return) ident(obj)operator(;) -operator(}) - - -comment(/* - * call-seq: - * obj.untaint => obj - * - * Removes the taint from obj. - */) - -ident(VALUE) -ident(rb_obj_untaint)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(rb_secure)operator(()integer(3)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(obj)operator(\)\)) operator({) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(obj)operator(\)\)) operator({) - ident(rb_error_frozen)operator(()stringoperator(\);) - operator(}) - ident(FL_UNSET)operator(()ident(obj)operator(,) ident(FL_TAINT)operator(\);) - operator(}) - reserved(return) ident(obj)operator(;) -operator(}) - -directive(void) -ident(rb_obj_infect)operator(()ident(obj1)operator(,) ident(obj2)operator(\)) - ident(VALUE) ident(obj1)operator(,) ident(obj2)operator(;) -operator({) - ident(OBJ_INFECT)operator(()ident(obj1)operator(,) ident(obj2)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * obj.freeze => obj - * - * Prevents further modifications to obj. A - * TypeError will be raised if modification is attempted. - * There is no way to unfreeze a frozen object. See also - * Object#frozen?. - * - * a = [ "a", "b", "c" ] - * a.freeze - * a << "z" - * - * produces: - * - * prog.rb:3:in `<<': can't modify frozen array (TypeError\) - * from prog.rb:3 - */) - -ident(VALUE) -ident(rb_obj_freeze)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator((!)ident(OBJ_FROZEN)operator(()ident(obj)operator(\)\)) operator({) - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4) operator(&&) operator(!)ident(OBJ_TAINTED)operator(()ident(obj)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - ident(OBJ_FREEZE)operator(()ident(obj)operator(\);) - operator(}) - reserved(return) ident(obj)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.frozen? => true or false - * - * Returns the freeze status of obj. - * - * a = [ "a", "b", "c" ] - * a.freeze #=> ["a", "b", "c"] - * a.frozen? #=> true - */) - -directive(static) ident(VALUE) -ident(rb_obj_frozen_p)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(obj)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * Document-class: NilClass - * - * The class of the singleton object nil. - */) - -comment(/* - * call-seq: - * nil.to_i => 0 - * - * Always returns zero. - * - * nil.to_i #=> 0 - */) - - -directive(static) ident(VALUE) -ident(nil_to_i)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * nil.to_f => 0.0 - * - * Always returns zero. - * - * nil.to_f #=> 0.0 - */) - -directive(static) ident(VALUE) -ident(nil_to_f)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_float_new)operator(()float(0)float(.0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * nil.to_s => "" - * - * Always returns the empty string. - * - * nil.to_s #=> "" - */) - -directive(static) ident(VALUE) -ident(nil_to_s)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) -operator(}) - -comment(/* - * call-seq: - * nil.to_a => [] - * - * Always returns an empty array. - * - * nil.to_a #=> [] - */) - -directive(static) ident(VALUE) -ident(nil_to_a)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_ary_new2)operator(()integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * nil.inspect => "nil" - * - * Always returns the string "nil". - */) - -directive(static) ident(VALUE) -ident(nil_inspect)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(main_to_s)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) -operator(}) - - -comment(/*********************************************************************** - * Document-class: TrueClass - * - * The global value true is the only instance of class - * TrueClass and represents a logically true value in - * boolean expressions. The class provides operators allowing - * true to be used in logical expressions. - */) - - -comment(/* - * call-seq: - * true.to_s => "true" - * - * The string representation of true is "true". - */) - -directive(static) ident(VALUE) -ident(true_to_s)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) -operator(}) - - -comment(/* - * call-seq: - * true & obj => true or false - * - * And---Returns false if obj is - * nil or false, true otherwise. - */) - -directive(static) ident(VALUE) -ident(true_and)operator(()ident(obj)operator(,) ident(obj2)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(obj2)operator(;) -operator({) - reserved(return) ident(RTEST)operator(()ident(obj2)operator(\)?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * true | obj => true - * - * Or---Returns true. As anObject is an argument to - * a method call, it is always evaluated; there is no short-circuit - * evaluation in this case. - * - * true | puts("or"\) - * true || puts("logical or"\) - * - * produces: - * - * or - */) - -directive(static) ident(VALUE) -ident(true_or)operator(()ident(obj)operator(,) ident(obj2)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(obj2)operator(;) -operator({) - reserved(return) ident(Qtrue)operator(;) -operator(}) - - -comment(/* - * call-seq: - * true ^ obj => !obj - * - * Exclusive Or---Returns true if obj is - * nil or false, false - * otherwise. - */) - -directive(static) ident(VALUE) -ident(true_xor)operator(()ident(obj)operator(,) ident(obj2)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(obj2)operator(;) -operator({) - reserved(return) ident(RTEST)operator(()ident(obj2)operator(\)?)ident(Qfalse)operator(:)ident(Qtrue)operator(;) -operator(}) - - -comment(/* - * Document-class: FalseClass - * - * The global value false is the only instance of class - * FalseClass and represents a logically false value in - * boolean expressions. The class provides operators allowing - * false to participate correctly in logical expressions. - * - */) - -comment(/* - * call-seq: - * false.to_s => "false" - * - * 'nuf said... - */) - -directive(static) ident(VALUE) -ident(false_to_s)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) -operator(}) - -comment(/* - * call-seq: - * false & obj => false - * nil & obj => false - * - * And---Returns false. obj is always - * evaluated as it is the argument to a method call---there is no - * short-circuit evaluation in this case. - */) - -directive(static) ident(VALUE) -ident(false_and)operator(()ident(obj)operator(,) ident(obj2)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(obj2)operator(;) -operator({) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * false | obj => true or false - * nil | obj => true or false - * - * Or---Returns false if obj is - * nil or false; true otherwise. - */) - -directive(static) ident(VALUE) -ident(false_or)operator(()ident(obj)operator(,) ident(obj2)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(obj2)operator(;) -operator({) - reserved(return) ident(RTEST)operator(()ident(obj2)operator(\)?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - - - -comment(/* - * call-seq: - * false ^ obj => true or false - * nil ^ obj => true or false - * - * Exclusive Or---If obj is nil or - * false, returns false; otherwise, returns - * true. - * - */) - -directive(static) ident(VALUE) -ident(false_xor)operator(()ident(obj)operator(,) ident(obj2)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(obj2)operator(;) -operator({) - reserved(return) ident(RTEST)operator(()ident(obj2)operator(\)?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call_seq: - * nil.nil? => true - * - * Only the object nil responds true to nil?. - */) - -directive(static) ident(VALUE) -ident(rb_true)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call_seq: - * nil.nil? => true - * .nil? => false - * - * Only the object nil responds true to nil?. - */) - - -directive(static) ident(VALUE) -ident(rb_false)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * obj =~ other => false - * - * Pattern Match---Overridden by descendents (notably - * Regexp and String\) to provide meaningful - * pattern-match semantics. - */) - -directive(static) ident(VALUE) -ident(rb_obj_pattern_match)operator(()ident(obj1)operator(,) ident(obj2)operator(\)) - ident(VALUE) ident(obj1)operator(,) ident(obj2)operator(;) -operator({) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/********************************************************************** - * Document-class: Symbol - * - * Symbol objects represent names and some strings - * inside the Ruby - * interpreter. They are generated using the :name and - * :"string" literals - * syntax, and by the various to_sym methods. The same - * Symbol object will be created for a given name or string - * for the duration of a program's execution, regardless of the context - * or meaning of that name. Thus if Fred is a constant in - * one context, a method in another, and a class in a third, the - * Symbol :Fred will be the same object in - * all three contexts. - * - * module One - * class Fred - * end - * $f1 = :Fred - * end - * module Two - * Fred = 1 - * $f2 = :Fred - * end - * def Fred(\) - * end - * $f3 = :Fred - * $f1.id #=> 2514190 - * $f2.id #=> 2514190 - * $f3.id #=> 2514190 - * - */) - -comment(/* - * call-seq: - * sym.to_i => fixnum - * - * Returns an integer that is unique for each symbol within a - * particular execution of a program. - * - * :fred.to_i #=> 9809 - * "fred".to_sym.to_i #=> 9809 - */) - -directive(static) ident(VALUE) -ident(sym_to_i)operator(()ident(sym)operator(\)) - ident(VALUE) ident(sym)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(SYM2ID)operator(()ident(sym)operator(\);) - - reserved(return) ident(LONG2FIX)operator(()ident(id)operator(\);) -operator(}) - - -comment(/* :nodoc: */) - -directive(static) ident(VALUE) -ident(sym_to_int)operator(()ident(sym)operator(\)) - ident(VALUE) ident(sym)operator(;) -operator({) - ident(rb_warning)operator(()stringoperator(\);) - reserved(return) ident(sym_to_i)operator(()ident(sym)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * sym.inspect => string - * - * Returns the representation of sym as a symbol literal. - * - * :fred.inspect #=> ":fred" - */) - -directive(static) ident(VALUE) -ident(sym_inspect)operator(()ident(sym)operator(\)) - ident(VALUE) ident(sym)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - pre_type(char) operator(*)ident(name)operator(;) - ident(ID) ident(id) operator(=) ident(SYM2ID)operator(()ident(sym)operator(\);) - - ident(name) operator(=) ident(rb_id2name)operator(()ident(id)operator(\);) - ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(strlen)operator(()ident(name)operator(\)+)integer(1)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(=) char(':')operator(;) - ident(strcpy)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(+)integer(1)operator(,) ident(name)operator(\);) - reserved(if) operator((!)ident(rb_symname_p)operator(()ident(name)operator(\)\)) operator({) - ident(str) operator(=) ident(rb_str_dump)operator(()ident(str)operator(\);) - ident(strncpy)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) stringoperator(,) integer(2)operator(\);) - operator(}) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * sym.id2name => string - * sym.to_s => string - * - * Returns the name or string corresponding to sym. - * - * :fred.id2name #=> "fred" - */) - - -directive(static) ident(VALUE) -ident(sym_to_s)operator(()ident(sym)operator(\)) - ident(VALUE) ident(sym)operator(;) -operator({) - reserved(return) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(SYM2ID)operator(()ident(sym)operator(\)\)\);) -operator(}) - - -comment(/* - * call-seq: - * sym.to_sym => sym - * - * In general, to_sym returns the Symbol corresponding - * to an object. As sym is already a symbol, self is returned - * in this case. - */) - -directive(static) ident(VALUE) -ident(sym_to_sym)operator(()ident(sym)operator(\)) - ident(VALUE) ident(sym)operator(;) -operator({) - reserved(return) ident(sym)operator(;) -operator(}) - - -comment(/*********************************************************************** - * - * Document-class: Module - * - * A Module is a collection of methods and constants. The - * methods in a module may be instance methods or module methods. - * Instance methods appear as methods in a class when the module is - * included, module methods do not. Conversely, module methods may be - * called without creating an encapsulating object, while instance - * methods may not. (See Module#module_function\) - * - * In the descriptions that follow, the parameter syml refers - * to a symbol, which is either a quoted string or a - * Symbol (such as :name\). - * - * module Mod - * include Math - * CONST = 1 - * def meth - * # ... - * end - * end - * Mod.class #=> Module - * Mod.constants #=> ["E", "PI", "CONST"] - * Mod.instance_methods #=> ["meth"] - * - */) - -comment(/* - * call-seq: - * mod.to_s => string - * - * Return a string representing this module or class. For basic - * classes and modules, this is the name. For singletons, we - * show information on the thing we're attached to as well. - */) - -directive(static) ident(VALUE) -ident(rb_mod_to_s)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) - -operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(VALUE) ident(s) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - ident(VALUE) ident(v) operator(=) ident(rb_iv_get)operator(()ident(klass)operator(,) stringoperator(\);) - - ident(rb_str_cat2)operator(()ident(s)operator(,) stringoperator(\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(v)operator(\)\)) operator({) - reserved(case) ident(T_CLASS)operator(:) reserved(case) ident(T_MODULE)operator(:) - ident(rb_str_append)operator(()ident(s)operator(,) ident(rb_inspect)operator(()ident(v)operator(\)\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_str_append)operator(()ident(s)operator(,) ident(rb_any_to_s)operator(()ident(v)operator(\)\);) - reserved(break)operator(;) - operator(}) - ident(rb_str_cat2)operator(()ident(s)operator(,) string)delimiter(")>operator(\);) - - reserved(return) ident(s)operator(;) - operator(}) - reserved(return) ident(rb_str_dup)operator(()ident(rb_class_name)operator(()ident(klass)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * mod.freeze - * - * Prevents further modifications to mod. - */) - -directive(static) ident(VALUE) -ident(rb_mod_freeze)operator(()ident(mod)operator(\)) - ident(VALUE) ident(mod)operator(;) -operator({) - ident(rb_mod_to_s)operator(()ident(mod)operator(\);) - reserved(return) ident(rb_obj_freeze)operator(()ident(mod)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod === obj => true or false - * - * Case Equality---Returns true if anObject is an - * instance of mod or one of mod's descendents. Of - * limited use for modules, but can be used in case - * statements to classify objects by class. - */) - -directive(static) ident(VALUE) -ident(rb_mod_eqq)operator(()ident(mod)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(arg)operator(;) -operator({) - reserved(return) ident(rb_obj_is_kind_of)operator(()ident(arg)operator(,) ident(mod)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod <= other => true, false, or nil - * - * Returns true if mod is a subclass of other or - * is the same as other. Returns - * nil if there's no relationship between the two. - * (Think of the relationship in terms of the class definition: - * "class Aoperator(\);) - operator(}) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(mod)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - reserved(if) operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(m_tbl) operator(==) ident(RCLASS)operator(()ident(arg)operator(\)->)ident(m_tbl)operator(\)) - reserved(return) ident(Qtrue)operator(;) - ident(mod) operator(=) ident(RBASIC)operator(()ident(mod)operator(\)->)ident(klass)operator(;) - operator(}) - reserved(while) operator(()ident(mod)operator(\)) operator({) - reserved(if) operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(m_tbl) operator(==) ident(RCLASS)operator(()ident(arg)operator(\)->)ident(m_tbl)operator(\)) - reserved(return) ident(Qtrue)operator(;) - ident(mod) operator(=) ident(RCLASS)operator(()ident(mod)operator(\)->)ident(super)operator(;) - operator(}) - comment(/* not mod < arg; check if mod > arg */) - reserved(while) operator(()ident(arg)operator(\)) operator({) - reserved(if) operator(()ident(RCLASS)operator(()ident(arg)operator(\)->)ident(m_tbl) operator(==) ident(RCLASS)operator(()ident(start)operator(\)->)ident(m_tbl)operator(\)) - reserved(return) ident(Qfalse)operator(;) - ident(arg) operator(=) ident(RCLASS)operator(()ident(arg)operator(\)->)ident(super)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod < other => true, false, or nil - * - * Returns true if mod is a subclass of other. Returns - * nil if there's no relationship between the two. - * (Think of the relationship in terms of the class definition: - * "class A= other => true, false, or nil - * - * Returns true if mod is an ancestor of other, or the - * two modules are the same. Returns - * nil if there's no relationship between the two. - * (Think of the relationship in terms of the class definition: - * "class AA"\). - * - */) - -directive(static) ident(VALUE) -ident(rb_mod_ge)operator(()ident(mod)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(arg)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(arg)operator(\)\)) operator({) - reserved(case) ident(T_MODULE)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - - reserved(return) ident(rb_class_inherited_p)operator(()ident(arg)operator(,) ident(mod)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod > other => true, false, or nil - * - * Returns true if mod is an ancestor of other. Returns - * nil if there's no relationship between the two. - * (Think of the relationship in terms of the class definition: - * "class AA"\). - * - */) - -directive(static) ident(VALUE) -ident(rb_mod_gt)operator(()ident(mod)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(arg)operator(;) -operator({) - reserved(if) operator(()ident(mod) operator(==) ident(arg)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(rb_mod_ge)operator(()ident(mod)operator(,) ident(arg)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod <=> other_mod => -1, 0, +1, or nil - * - * Comparison---Returns -1 if mod includes other_mod, 0 if - * mod is the same as other_mod, and +1 if mod is - * included by other_mod or if mod has no relationship with - * other_mod. Returns nil if other_mod is - * not a module. - */) - -directive(static) ident(VALUE) -ident(rb_mod_cmp)operator(()ident(mod)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(arg)operator(;) -operator({) - ident(VALUE) ident(cmp)operator(;) - - reserved(if) operator(()ident(mod) operator(==) ident(arg)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(arg)operator(\)\)) operator({) - reserved(case) ident(T_MODULE)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(return) ident(Qnil)operator(;) - operator(}) - - ident(cmp) operator(=) ident(rb_class_inherited_p)operator(()ident(mod)operator(,) ident(arg)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(cmp)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(cmp)operator(\)) operator({) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(rb_module_s_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(rb_module_s_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(mod) operator(=) ident(rb_module_new)operator((\);) - - ident(RBASIC)operator(()ident(mod)operator(\)->)ident(klass) operator(=) ident(klass)operator(;) - reserved(return) ident(mod)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(rb_class_s_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(rb_class_s_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(return) ident(rb_class_boot)operator(()integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Module.new => mod - * Module.new {|mod| block } => mod - * - * Creates a new anonymous module. If a block is given, it is passed - * the module object, and the block is evaluated in the context of this - * module using module_eval. - * - * Fred = Module.new do - * def meth1 - * "hello" - * end - * def meth2 - * "bye" - * end - * end - * a = "my string" - * a.extend(Fred\) #=> "my string" - * a.meth1 #=> "hello" - * a.meth2 #=> "bye" - */) - -directive(static) ident(VALUE) -ident(rb_mod_initialize)operator(()ident(module)operator(\)) - ident(VALUE) ident(module)operator(;) -operator({) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(rb_mod_module_eval)operator(()integer(0)operator(,) integer(0)operator(,) ident(module)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * Class.new(super_class=Object\) => a_class - * - * Creates a new anonymous (unnamed\) class with the given superclass - * (or Object if no parameter is given\). You can give a - * class a name by assigning the class object to a constant. - * - */) - -directive(static) ident(VALUE) -ident(rb_class_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(super)operator(;) - - reserved(if) operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super) operator(!=) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(super)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(super) operator(=) ident(rb_cObject)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_check_inheritable)operator(()ident(super)operator(\);) - operator(}) - ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super) operator(=) ident(super)operator(;) - ident(rb_make_metaclass)operator(()ident(klass)operator(,) ident(RBASIC)operator(()ident(super)operator(\)->)ident(klass)operator(\);) - ident(rb_mod_initialize)operator(()ident(klass)operator(\);) - ident(rb_class_inherited)operator(()ident(super)operator(,) ident(klass)operator(\);) - - reserved(return) ident(klass)operator(;) -operator(}) - -comment(/* - * call-seq: - * class.allocate(\) => obj - * - * Allocates space for a new object of class's class. The - * returned object must be an instance of class. - * - */) - -ident(VALUE) -ident(rb_obj_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(obj)operator(;) - - reserved(if) operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super) operator(==) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(obj) operator(=) ident(rb_funcall)operator(()ident(klass)operator(,) ident(ID_ALLOCATOR)operator(,) integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(rb_obj_class)operator(()ident(obj)operator(\)) operator(!=) ident(rb_class_real)operator(()ident(klass)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(obj)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(rb_class_allocate_instance) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(rb_class_allocate_instance)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(obj)operator(,) reserved(struct) ident(RObject)operator(\);) - ident(OBJSETUP)operator(()ident(obj)operator(,) ident(klass)operator(,) ident(T_OBJECT)operator(\);) - reserved(return) operator(()ident(VALUE)operator(\))ident(obj)operator(;) -operator(}) - -comment(/* - * call-seq: - * class.new(args, ...\) => obj - * - * Calls allocate to create a new object of - * class's class, then invokes that object's - * initialize method, passing it args. - * This is the method that ends up getting called whenever - * an object is constructed using .new. - * - */) - -ident(VALUE) -ident(rb_class_new_instance)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(obj)operator(;) - - ident(obj) operator(=) ident(rb_obj_alloc)operator(()ident(klass)operator(\);) - ident(rb_obj_call_init)operator(()ident(obj)operator(,) ident(argc)operator(,) ident(argv)operator(\);) - - reserved(return) ident(obj)operator(;) -operator(}) - -comment(/* - * call-seq: - * class.superclass -> a_super_class or nil - * - * Returns the superclass of class, or nil. - * - * File.superclass #=> IO - * IO.superclass #=> Object - * Object.superclass #=> nil - * - */) - -directive(static) ident(VALUE) -ident(rb_class_superclass)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(super) operator(=) ident(RCLASS)operator(()ident(klass)operator(\)->)ident(super)operator(;) - - reserved(if) operator((!)ident(super)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(FL_TEST)operator(()ident(klass)operator(,) ident(FL_SINGLETON)operator(\)\)) operator({) - ident(super) operator(=) ident(RBASIC)operator(()ident(klass)operator(\)->)ident(klass)operator(;) - operator(}) - reserved(while) operator(()ident(TYPE)operator(()ident(super)operator(\)) operator(==) ident(T_ICLASS)operator(\)) operator({) - ident(super) operator(=) ident(RCLASS)operator(()ident(super)operator(\)->)ident(super)operator(;) - operator(}) - reserved(if) operator((!)ident(super)operator(\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(super)operator(;) -operator(}) - -directive(static) ident(ID) -ident(str_to_id)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(sym) operator(=) ident(rb_str_intern)operator(()ident(str)operator(\);) - - reserved(return) ident(SYM2ID)operator(()ident(sym)operator(\);) -operator(}) - -ident(ID) -ident(rb_to_id)operator(()ident(name)operator(\)) - ident(VALUE) ident(name)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(;) - ident(ID) ident(id)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(name)operator(\)\)) operator({) - reserved(case) ident(T_STRING)operator(:) - reserved(return) ident(str_to_id)operator(()ident(name)operator(\);) - reserved(case) ident(T_FIXNUM)operator(:) - ident(rb_warn)operator(()stringoperator(\);) - ident(id) operator(=) ident(FIX2LONG)operator(()ident(name)operator(\);) - reserved(if) operator((!)ident(rb_id2name)operator(()ident(id)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(id)operator(\);) - operator(}) - reserved(break)operator(;) - reserved(case) ident(T_SYMBOL)operator(:) - ident(id) operator(=) ident(SYM2ID)operator(()ident(name)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(tmp) operator(=) ident(rb_check_string_type)operator(()ident(name)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - reserved(return) ident(str_to_id)operator(()ident(tmp)operator(\);) - operator(}) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(RSTRING)operator(()ident(rb_inspect)operator(()ident(name)operator(\)\)->)ident(ptr)operator(\);) - operator(}) - reserved(return) ident(id)operator(;) -operator(}) - -comment(/* - * call-seq: - * attr(symbol, writable=false\) => nil - * - * Defines a named attribute for this module, where the name is - * symbol.id2name, creating an instance variable - * (@name\) and a corresponding access method to read it. - * If the optional writable argument is true, also - * creates a method called name= to set the attribute. - * - * module Mod - * attr :size, true - * end - * - * is equivalent to: - * - * module Mod - * def size - * @size - * end - * def size=(val\) - * @size = val - * end - * end - */) - -directive(static) ident(VALUE) -ident(rb_mod_attr)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(name)operator(,) ident(pub)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(name)operator(,) operator(&)ident(pub)operator(\);) - ident(rb_attr)operator(()ident(klass)operator(,) ident(rb_to_id)operator(()ident(name)operator(\),) integer(1)operator(,) ident(RTEST)operator(()ident(pub)operator(\),) ident(Qtrue)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * attr_reader(symbol, ...\) => nil - * - * Creates instance variables and corresponding methods that return the - * value of each instance variable. Equivalent to calling - * ``attr:name'' on each name in turn. - */) - -directive(static) ident(VALUE) -ident(rb_mod_attr_reader)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(rb_attr)operator(()ident(klass)operator(,) ident(rb_to_id)operator(()ident(argv)operator([)ident(i)operator(]\),) integer(1)operator(,) integer(0)operator(,) ident(Qtrue)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * attr_writer(symbol, ...\) => nil - * - * Creates an accessor method to allow assignment to the attribute - * aSymbol.id2name. - */) - -directive(static) ident(VALUE) -ident(rb_mod_attr_writer)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(rb_attr)operator(()ident(klass)operator(,) ident(rb_to_id)operator(()ident(argv)operator([)ident(i)operator(]\),) integer(0)operator(,) integer(1)operator(,) ident(Qtrue)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * attr_accessor(symbol, ...\) => nil - * - * Equivalent to calling ``attrsymbol, - * true'' on each symbol in turn. - * - * module Mod - * attr_accessor(:one, :two\) - * end - * Mod.instance_methods.sort #=> ["one", "one=", "two", "two="] - */) - -directive(static) ident(VALUE) -ident(rb_mod_attr_accessor)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(rb_attr)operator(()ident(klass)operator(,) ident(rb_to_id)operator(()ident(argv)operator([)ident(i)operator(]\),) integer(1)operator(,) integer(1)operator(,) ident(Qtrue)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.const_get(sym\) => obj - * - * Returns the value of the named constant in mod. - * - * Math.const_get(:PI\) #=> 3.14159265358979 - */) - -directive(static) ident(VALUE) -ident(rb_mod_const_get)operator(()ident(mod)operator(,) ident(name)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(name)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(name)operator(\);) - - reserved(if) operator((!)ident(rb_is_const_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(return) ident(rb_const_get)operator(()ident(mod)operator(,) ident(id)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod.const_set(sym, obj\) => obj - * - * Sets the named constant to the given object, returning that object. - * Creates a new constant if no constant with the given name previously - * existed. - * - * Math.const_set("HIGH_SCHOOL_PI", 22.0/7.0\) #=> 3.14285714285714 - * Math::HIGH_SCHOOL_PI - Math::PI #=> 0.00126448926734968 - */) - -directive(static) ident(VALUE) -ident(rb_mod_const_set)operator(()ident(mod)operator(,) ident(name)operator(,) ident(value)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(name)operator(,) ident(value)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(name)operator(\);) - - reserved(if) operator((!)ident(rb_is_const_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - ident(rb_const_set)operator(()ident(mod)operator(,) ident(id)operator(,) ident(value)operator(\);) - reserved(return) ident(value)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.const_defined?(sym\) => true or false - * - * Returns true if a constant with the given name is - * defined by mod. - * - * Math.const_defined? "PI" #=> true - */) - -directive(static) ident(VALUE) -ident(rb_mod_const_defined)operator(()ident(mod)operator(,) ident(name)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(name)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(name)operator(\);) - - reserved(if) operator((!)ident(rb_is_const_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(return) ident(rb_const_defined_at)operator(()ident(mod)operator(,) ident(id)operator(\);) -operator(}) - -comment(/* - * call-seq: - * obj.methods => array - * - * Returns a list of the names of methods publicly accessible in - * obj. This will include all the methods accessible in - * obj's ancestors. - * - * class Klass - * def kMethod(\) - * end - * end - * k = Klass.new - * k.methods[0..9] #=> ["kMethod", "freeze", "nil?", "is_a?", - * "class", "instance_variable_set", - * "methods", "extend", "__send__", "instance_eval"] - * k.methods.length #=> 42 - */) - -directive(static) ident(VALUE) -ident(rb_obj_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - label(retry:) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(VALUE) ident(args)operator([)integer(1)operator(];) - - ident(args)operator([)integer(0)operator(]) operator(=) ident(Qtrue)operator(;) - reserved(return) ident(rb_class_instance_methods)operator(()integer(1)operator(,) ident(args)operator(,) ident(CLASS_OF)operator(()ident(obj)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(recur)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(recur)operator(\);) - reserved(if) operator(()ident(RTEST)operator(()ident(recur)operator(\)\)) operator({) - ident(argc) operator(=) integer(0)operator(;) - reserved(goto) ident(retry)operator(;) - operator(}) - reserved(return) ident(rb_obj_singleton_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * obj.protected_methods(all=true\) => array - * - * Returns the list of protected methods accessible to obj. If - * the all parameter is set to false, only those methods - * in the receiver will be listed. - */) - -directive(static) ident(VALUE) -ident(rb_obj_protected_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) comment(/* hack to stop warning */) - ident(VALUE) ident(args)operator([)integer(1)operator(];) - - ident(args)operator([)integer(0)operator(]) operator(=) ident(Qtrue)operator(;) - reserved(return) ident(rb_class_protected_instance_methods)operator(()integer(1)operator(,) ident(args)operator(,) ident(CLASS_OF)operator(()ident(obj)operator(\)\);) - operator(}) - reserved(return) ident(rb_class_protected_instance_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(CLASS_OF)operator(()ident(obj)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * obj.private_methods(all=true\) => array - * - * Returns the list of private methods accessible to obj. If - * the all parameter is set to false, only those methods - * in the receiver will be listed. - */) - -directive(static) ident(VALUE) -ident(rb_obj_private_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) comment(/* hack to stop warning */) - ident(VALUE) ident(args)operator([)integer(1)operator(];) - - ident(args)operator([)integer(0)operator(]) operator(=) ident(Qtrue)operator(;) - reserved(return) ident(rb_class_private_instance_methods)operator(()integer(1)operator(,) ident(args)operator(,) ident(CLASS_OF)operator(()ident(obj)operator(\)\);) - operator(}) - reserved(return) ident(rb_class_private_instance_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(CLASS_OF)operator(()ident(obj)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * obj.public_methods(all=true\) => array - * - * Returns the list of public methods accessible to obj. If - * the all parameter is set to false, only those methods - * in the receiver will be listed. - */) - -directive(static) ident(VALUE) -ident(rb_obj_public_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) comment(/* hack to stop warning */) - ident(VALUE) ident(args)operator([)integer(1)operator(];) - - ident(args)operator([)integer(0)operator(]) operator(=) ident(Qtrue)operator(;) - reserved(return) ident(rb_class_public_instance_methods)operator(()integer(1)operator(,) ident(args)operator(,) ident(CLASS_OF)operator(()ident(obj)operator(\)\);) - operator(}) - reserved(return) ident(rb_class_public_instance_methods)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(CLASS_OF)operator(()ident(obj)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * obj.instance_variable_get(symbol\) => obj - * - * Returns the value of the given instance variable, or nil if the - * instance variable is not set. The @ part of the - * variable name should be included for regular instance - * variables. Throws a NameError exception if the - * supplied symbol is not valid as an instance variable name. - * - * class Fred - * def initialize(p1, p2\) - * @a, @b = p1, p2 - * end - * end - * fred = Fred.new('cat', 99\) - * fred.instance_variable_get(:@a\) #=> "cat" - * fred.instance_variable_get("@b"\) #=> 99 - */) - -directive(static) ident(VALUE) -ident(rb_obj_ivar_get)operator(()ident(obj)operator(,) ident(iv)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(iv)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(iv)operator(\);) - - reserved(if) operator((!)ident(rb_is_instance_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(return) ident(rb_ivar_get)operator(()ident(obj)operator(,) ident(id)operator(\);) -operator(}) - -comment(/* - * call-seq: - * obj.instance_variable_set(symbol, obj\) => obj - * - * Sets the instance variable names by symbol to - * object, thereby frustrating the efforts of the class's - * author to attempt to provide proper encapsulation. The variable - * did not have to exist prior to this call. - * - * class Fred - * def initialize(p1, p2\) - * @a, @b = p1, p2 - * end - * end - * fred = Fred.new('cat', 99\) - * fred.instance_variable_set(:@a, 'dog'\) #=> "dog" - * fred.instance_variable_set(:@c, 'cat'\) #=> "cat" - * fred.inspect #=> "#" - */) - -directive(static) ident(VALUE) -ident(rb_obj_ivar_set)operator(()ident(obj)operator(,) ident(iv)operator(,) ident(val)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(iv)operator(,) ident(val)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(iv)operator(\);) - - reserved(if) operator((!)ident(rb_is_instance_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(return) ident(rb_ivar_set)operator(()ident(obj)operator(,) ident(id)operator(,) ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * obj.instance_variable_defined?(symbol\) => true or false - * - * Returns true if the given instance variable is - * defined in obj. - * - * class Fred - * def initialize(p1, p2\) - * @a, @b = p1, p2 - * end - * end - * fred = Fred.new('cat', 99\) - * fred.instance_variable_defined?(:@a\) #=> true - * fred.instance_variable_defined?("@b"\) #=> true - * fred.instance_variable_defined?("@c"\) #=> false - */) - -directive(static) ident(VALUE) -ident(rb_obj_ivar_defined)operator(()ident(obj)operator(,) ident(iv)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(iv)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(iv)operator(\);) - - reserved(if) operator((!)ident(rb_is_instance_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(return) ident(rb_ivar_defined)operator(()ident(obj)operator(,) ident(id)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod.class_variable_get(symbol\) => obj - * - * Returns the value of the given class variable (or throws a - * NameError exception\). The @@ part of the - * variable name should be included for regular class variables - * - * class Fred - * @@foo = 99 - * end - * - * def Fred.foo - * class_variable_get(:@@foo\) #=> 99 - * end - */) - -directive(static) ident(VALUE) -ident(rb_mod_cvar_get)operator(()ident(obj)operator(,) ident(iv)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(iv)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(iv)operator(\);) - - reserved(if) operator((!)ident(rb_is_class_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(return) ident(rb_cvar_get)operator(()ident(obj)operator(,) ident(id)operator(\);) -operator(}) - -comment(/* - * call-seq: - * obj.class_variable_set(symbol, obj\) => obj - * - * Sets the class variable names by symbol to - * object. - * - * class Fred - * @@foo = 99 - * def foo - * @@foo - * end - * end - * - * def Fred.foo - * class_variable_set(:@@foo, 101\) #=> 101 - * end - * Fred.foo - * Fred.new.foo #=> 101 - */) - -directive(static) ident(VALUE) -ident(rb_mod_cvar_set)operator(()ident(obj)operator(,) ident(iv)operator(,) ident(val)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(iv)operator(,) ident(val)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(iv)operator(\);) - - reserved(if) operator((!)ident(rb_is_class_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - ident(rb_cvar_set)operator(()ident(obj)operator(,) ident(id)operator(,) ident(val)operator(,) ident(Qfalse)operator(\);) - reserved(return) ident(val)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.class_variable_defined?(symbol\) => true or false - * - * Returns true if the given class variable is defined - * in obj. - * - * class Fred - * @@foo = 99 - * end - * Fred.class_variable_defined?(:@@foo\) #=> true - * Fred.class_variable_defined?(:@@bar\) #=> false - */) - -directive(static) ident(VALUE) -ident(rb_mod_cvar_defined)operator(()ident(obj)operator(,) ident(iv)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(iv)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(iv)operator(\);) - - reserved(if) operator((!)ident(rb_is_class_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(return) ident(rb_cvar_defined)operator(()ident(obj)operator(,) ident(id)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(convert_type)operator(()ident(val)operator(,) ident(tname)operator(,) ident(method)operator(,) ident(raise)operator(\)) - ident(VALUE) ident(val)operator(;) - directive(const) pre_type(char) operator(*)ident(tname)operator(,) operator(*)ident(method)operator(;) - pre_type(int) ident(raise)operator(;) -operator({) - ident(ID) ident(m)operator(;) - - ident(m) operator(=) ident(rb_intern)operator(()ident(method)operator(\);) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(val)operator(,) ident(m)operator(\)\)) operator({) - reserved(if) operator(()ident(raise)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(NIL_P)operator(()ident(val)operator(\)) operator(?) string operator(:) - ident(val) operator(==) ident(Qtrue) operator(?) string operator(:) - ident(val) operator(==) ident(Qfalse) operator(?) string operator(:) - ident(rb_obj_classname)operator(()ident(val)operator(\),) - ident(tname)operator(\);) - operator(}) - reserved(else) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - operator(}) - reserved(return) ident(rb_funcall)operator(()ident(val)operator(,) ident(m)operator(,) integer(0)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_convert_type)operator(()ident(val)operator(,) ident(type)operator(,) ident(tname)operator(,) ident(method)operator(\)) - ident(VALUE) ident(val)operator(;) - pre_type(int) ident(type)operator(;) - directive(const) pre_type(char) operator(*)ident(tname)operator(,) operator(*)ident(method)operator(;) -operator({) - ident(VALUE) ident(v)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(val)operator(\)) operator(==) ident(type)operator(\)) reserved(return) ident(val)operator(;) - ident(v) operator(=) ident(convert_type)operator(()ident(val)operator(,) ident(tname)operator(,) ident(method)operator(,) ident(Qtrue)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(!=) ident(type)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(val)operator(\),) ident(method)operator(,) ident(tname)operator(\);) - operator(}) - reserved(return) ident(v)operator(;) -operator(}) - -ident(VALUE) -ident(rb_check_convert_type)operator(()ident(val)operator(,) ident(type)operator(,) ident(tname)operator(,) ident(method)operator(\)) - ident(VALUE) ident(val)operator(;) - pre_type(int) ident(type)operator(;) - directive(const) pre_type(char) operator(*)ident(tname)operator(,) operator(*)ident(method)operator(;) -operator({) - ident(VALUE) ident(v)operator(;) - - comment(/* always convert T_DATA */) - reserved(if) operator(()ident(TYPE)operator(()ident(val)operator(\)) operator(==) ident(type) operator(&&) ident(type) operator(!=) ident(T_DATA)operator(\)) reserved(return) ident(val)operator(;) - ident(v) operator(=) ident(convert_type)operator(()ident(val)operator(,) ident(tname)operator(,) ident(method)operator(,) ident(Qfalse)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(v)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(v)operator(\)) operator(!=) ident(type)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(val)operator(\),) ident(method)operator(,) ident(tname)operator(\);) - operator(}) - reserved(return) ident(v)operator(;) -operator(}) - - -directive(static) ident(VALUE) -ident(rb_to_integer)operator(()ident(val)operator(,) ident(method)operator(\)) - ident(VALUE) ident(val)operator(;) - directive(const) pre_type(char) operator(*)ident(method)operator(;) -operator({) - ident(VALUE) ident(v) operator(=) ident(convert_type)operator(()ident(val)operator(,) stringoperator(,) ident(method)operator(,) ident(Qtrue)operator(\);) - reserved(if) operator((!)ident(rb_obj_is_kind_of)operator(()ident(v)operator(,) ident(rb_cInteger)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(val)operator(\),) ident(method)operator(\);) - operator(}) - reserved(return) ident(v)operator(;) -operator(}) - -ident(VALUE) -ident(rb_to_int)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(return) ident(rb_to_integer)operator(()ident(val)operator(,) stringoperator(\);) -operator(}) - -ident(VALUE) -ident(rb_Integer)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(val)operator(\)\)) operator({) - reserved(case) ident(T_FLOAT)operator(:) - reserved(if) operator(()ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value) operator(<=) operator(()pre_type(double)operator(\))ident(FIXNUM_MAX) - operator(&&) ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value) operator(>=) operator(()pre_type(double)operator(\))ident(FIXNUM_MIN)operator(\)) operator({) - reserved(break)operator(;) - operator(}) - reserved(return) ident(rb_dbl2big)operator(()ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value)operator(\);) - - reserved(case) ident(T_FIXNUM)operator(:) - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(val)operator(;) - - reserved(case) ident(T_STRING)operator(:) - reserved(return) ident(rb_str_to_inum)operator(()ident(val)operator(,) integer(0)operator(,) ident(Qtrue)operator(\);) - - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - ident(tmp) operator(=) ident(convert_type)operator(()ident(val)operator(,) stringoperator(,) stringoperator(,) ident(Qfalse)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - reserved(return) ident(rb_to_integer)operator(()ident(val)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(tmp)operator(;) -operator(}) - -comment(/* - * call-seq: - * Integer(arg\) => integer - * - * Converts arg to a Fixnum or Bignum. - * Numeric types are converted directly (with floating point numbers - * being truncated\). If arg is a String, leading - * radix indicators (0, 0b, and - * 0x\) are honored. Others are converted using - * to_int and to_i. This behavior is - * different from that of String#to_i. - * - * Integer(123.999\) #=> 123 - * Integer("0x1a"\) #=> 26 - * Integer(Time.new\) #=> 1049896590 - */) - -directive(static) ident(VALUE) -ident(rb_f_integer)operator(()ident(obj)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(arg)operator(;) -operator({) - reserved(return) ident(rb_Integer)operator(()ident(arg)operator(\);) -operator(}) - -pre_type(double) -ident(rb_cstr_to_dbl)operator(()ident(p)operator(,) ident(badcheck)operator(\)) - directive(const) pre_type(char) operator(*)ident(p)operator(;) - pre_type(int) ident(badcheck)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(q)operator(;) - pre_type(char) operator(*)ident(end)operator(;) - pre_type(double) ident(d)operator(;) - directive(const) pre_type(char) operator(*)ident(ellipsis) operator(=) stringoperator(;) - pre_type(int) ident(w)operator(;) -preprocessor(#define) ident(OutOfRange)operator((\)) operator(((()ident(w) operator(=) ident(end) operator(-) ident(p)operator(\)) operator(>) integer(20)operator(\)) operator(?) operator(()ident(w) operator(=) integer(20)operator(,) ident(ellipsis) operator(=) stringoperator(\)) operator(:) operator(()ident(ellipsis) operator(=) stringoperator(\)\)) - - reserved(if) operator((!)ident(p)operator(\)) reserved(return) float(0)float(.0)operator(;) - ident(q) operator(=) ident(p)operator(;) - reserved(if) operator(()ident(badcheck)operator(\)) operator({) - reserved(while) operator(()ident(ISSPACE)operator((*)ident(p)operator(\)\)) ident(p)operator(++;) - operator(}) - reserved(else) operator({) - reserved(while) operator(()ident(ISSPACE)operator((*)ident(p)operator(\)) operator(||) operator(*)ident(p) operator(==) char('_')operator(\)) ident(p)operator(++;) - operator(}) - ident(errno) operator(=) integer(0)operator(;) - ident(d) operator(=) ident(strtod)operator(()ident(p)operator(,) operator(&)ident(end)operator(\);) - reserved(if) operator(()ident(errno) operator(==) ident(ERANGE)operator(\)) operator({) - ident(OutOfRange)operator((\);) - ident(rb_warn)operator(()stringoperator(,) ident(w)operator(,) ident(p)operator(,) ident(ellipsis)operator(\);) - ident(errno) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(p) operator(==) ident(end)operator(\)) operator({) - reserved(if) operator(()ident(badcheck)operator(\)) operator({) - label(bad:) - ident(rb_invalid_str)operator(()ident(q)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(d)operator(;) - operator(}) - reserved(if) operator((*)ident(end)operator(\)) operator({) - pre_type(char) operator(*)ident(buf) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(strlen)operator(()ident(p)operator(\)+)integer(1)operator(\);) - pre_type(char) operator(*)ident(n) operator(=) ident(buf)operator(;) - - reserved(while) operator(()ident(p) operator(<) ident(end)operator(\)) operator(*)ident(n)operator(++) operator(=) operator(*)ident(p)operator(++;) - reserved(while) operator((*)ident(p)operator(\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('_')operator(\)) operator({) - comment(/* remove underscores between digits */) - reserved(if) operator(()ident(badcheck)operator(\)) operator({) - reserved(if) operator(()ident(n) operator(==) ident(buf) operator(||) operator(!)ident(ISDIGIT)operator(()ident(n)operator([-)integer(1)operator(]\)\)) reserved(goto) ident(bad)operator(;) - operator(++)ident(p)operator(;) - reserved(if) operator((!)ident(ISDIGIT)operator((*)ident(p)operator(\)\)) reserved(goto) ident(bad)operator(;) - operator(}) - reserved(else) operator({) - reserved(while) operator((*++)ident(p) operator(==) char('_')operator(\);) - reserved(continue)operator(;) - operator(}) - operator(}) - operator(*)ident(n)operator(++) operator(=) operator(*)ident(p)operator(++;) - operator(}) - operator(*)ident(n) operator(=) char('\\0')operator(;) - ident(p) operator(=) ident(buf)operator(;) - ident(d) operator(=) ident(strtod)operator(()ident(p)operator(,) operator(&)ident(end)operator(\);) - reserved(if) operator(()ident(errno) operator(==) ident(ERANGE)operator(\)) operator({) - ident(OutOfRange)operator((\);) - ident(rb_warn)operator(()stringoperator(,) ident(w)operator(,) ident(p)operator(,) ident(ellipsis)operator(\);) - ident(errno) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(badcheck)operator(\)) operator({) - reserved(if) operator((!)ident(end) operator(||) ident(p) operator(==) ident(end)operator(\)) reserved(goto) ident(bad)operator(;) - reserved(while) operator((*)ident(end) operator(&&) ident(ISSPACE)operator((*)ident(end)operator(\)\)) ident(end)operator(++;) - reserved(if) operator((*)ident(end)operator(\)) reserved(goto) ident(bad)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(errno) operator(==) ident(ERANGE)operator(\)) operator({) - ident(errno) operator(=) integer(0)operator(;) - ident(OutOfRange)operator((\);) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(w)operator(,) ident(q)operator(,) ident(ellipsis)operator(\);) - operator(}) - reserved(return) ident(d)operator(;) -operator(}) - -pre_type(double) -ident(rb_str_to_dbl)operator(()ident(str)operator(,) ident(badcheck)operator(\)) - ident(VALUE) ident(str)operator(;) - pre_type(int) ident(badcheck)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(;) - pre_type(long) ident(len)operator(;) - - ident(StringValue)operator(()ident(str)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(s)operator(\)) operator({) - reserved(if) operator(()ident(s)operator([)ident(len)operator(]\)) operator({) comment(/* no sentinel somehow */) - pre_type(char) operator(*)ident(p) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(len)operator(+)integer(1)operator(\);) - - ident(MEMCPY)operator(()ident(p)operator(,) ident(s)operator(,) pre_type(char)operator(,) ident(len)operator(\);) - ident(p)operator([)ident(len)operator(]) operator(=) char('\\0')operator(;) - ident(s) operator(=) ident(p)operator(;) - operator(}) - reserved(if) operator(()ident(badcheck) operator(&&) ident(len) operator(!=) ident(strlen)operator(()ident(s)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(return) ident(rb_cstr_to_dbl)operator(()ident(s)operator(,) ident(badcheck)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_Float)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(val)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - reserved(return) ident(rb_float_new)operator((()pre_type(double)operator(\))ident(FIX2LONG)operator(()ident(val)operator(\)\);) - - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(val)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(rb_big2dbl)operator(()ident(val)operator(\)\);) - - reserved(case) ident(T_STRING)operator(:) - reserved(return) ident(rb_float_new)operator(()ident(rb_str_to_dbl)operator(()ident(val)operator(,) ident(Qtrue)operator(\)\);) - - reserved(case) ident(T_NIL)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - reserved(break)operator(;) - - reserved(default)operator(:) - operator({) - ident(VALUE) ident(f) operator(=) ident(rb_convert_type)operator(()ident(val)operator(,) ident(T_FLOAT)operator(,) stringoperator(,) stringoperator(\);) - reserved(if) operator(()ident(isnan)operator(()ident(RFLOAT)operator(()ident(f)operator(\)->)ident(value)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(f)operator(;) - operator(}) - operator(}) -operator(}) - -comment(/* - * call-seq: - * Float(arg\) => float - * - * Returns arg converted to a float. Numeric types are converted - * directly, the rest are converted using arg.to_f. As of Ruby - * 1.8, converting nil generates a TypeError. - * - * Float(1\) #=> 1.0 - * Float("123.456"\) #=> 123.456 - */) - -directive(static) ident(VALUE) -ident(rb_f_float)operator(()ident(obj)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(arg)operator(;) -operator({) - reserved(return) ident(rb_Float)operator(()ident(arg)operator(\);) -operator(}) - -pre_type(double) -ident(rb_num2dbl)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(val)operator(\)\)) operator({) - reserved(case) ident(T_FLOAT)operator(:) - reserved(return) ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value)operator(;) - - reserved(case) ident(T_STRING)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_NIL)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - - reserved(return) ident(RFLOAT)operator(()ident(rb_Float)operator(()ident(val)operator(\)\)->)ident(value)operator(;) -operator(}) - -pre_type(char)operator(*) -ident(rb_str2cstr)operator(()ident(str)operator(,) ident(len)operator(\)) - ident(VALUE) ident(str)operator(;) - pre_type(long) operator(*)ident(len)operator(;) -operator({) - ident(StringValue)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(len)operator(\)) operator(*)ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(else) reserved(if) operator(()ident(RTEST)operator(()ident(ruby_verbose)operator(\)) operator(&&) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(!=) ident(strlen)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - reserved(return) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) -operator(}) - -ident(VALUE) -ident(rb_String)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(return) ident(rb_convert_type)operator(()ident(val)operator(,) ident(T_STRING)operator(,) stringoperator(,) stringoperator(\);) -operator(}) - - -comment(/* - * call-seq: - * String(arg\) => string - * - * Converts arg to a String by calling its - * to_s method. - * - * String(self\) #=> "main" - * String(self.class #=> "Object" - * String(123456\) #=> "123456" - */) - -directive(static) ident(VALUE) -ident(rb_f_string)operator(()ident(obj)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(arg)operator(;) -operator({) - reserved(return) ident(rb_String)operator(()ident(arg)operator(\);) -operator(}) - -comment(#if 0 -VALUE -rb_Array(val\) - VALUE val; -{ - VALUE tmp = rb_check_array_type(val\); - - if (NIL_P(tmp\)\) { - tmp = rb_check_convert_type(val, T_ARRAY, "Array", "to_a"\); - if (NIL_P(tmp\)\) { - return rb_ary_new3(1, val\); - } - } - return tmp; -} -#endif) - -comment(/* - * call-seq: - * Array(arg\) => array - * - * Returns arg as an Array. First tries to call - * arg.to_ary, then arg.to_a. - * If both fail, creates a single element array containing arg - * (unless arg is nil\). - * - * Array(1..5\) #=> [1, 2, 3, 4, 5] - */) - -directive(static) ident(VALUE) -ident(rb_f_array)operator(()ident(obj)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(arg)operator(;) -operator({) - reserved(return) ident(rb_Array)operator(()ident(arg)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(boot_defclass)operator(()ident(name)operator(,) ident(super)operator(\)) - pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) ident(super)operator(;) -operator({) - directive(extern) ident(st_table) operator(*)ident(rb_class_tbl)operator(;) - ident(VALUE) ident(obj) operator(=) ident(rb_class_boot)operator(()ident(super)operator(\);) - ident(ID) ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - - ident(rb_name_class)operator(()ident(obj)operator(,) ident(id)operator(\);) - ident(st_add_direct)operator(()ident(rb_class_tbl)operator(,) ident(id)operator(,) ident(obj)operator(\);) - ident(rb_const_set)operator((()ident(rb_cObject) operator(?) ident(rb_cObject) operator(:) ident(obj)operator(\),) ident(id)operator(,) ident(obj)operator(\);) - reserved(return) ident(obj)operator(;) -operator(}) - -ident(VALUE) ident(ruby_top_self)operator(;) - -comment(/* - * Document-class: Class - * - * Classes in Ruby are first-class objects---each is an instance of - * class Class. - * - * When a new class is created (typically using class Name ... - * end\), an object of type Class is created and - * assigned to a global constant (Name in this case\). When - * Name.new is called to create a new object, the - * new method in Class is run by default. - * This can be demonstrated by overriding new in - * Class: - * - * class Class - * alias oldNew new - * def new(*args\) - * print "Creating a new ", self.name, "\\n" - * oldNew(*args\) - * end - * end - * - * - * class Name - * end - * - * - * n = Name.new - * - * produces: - * - * Creating a new Name - * - * Classes, modules, and objects are interrelated. In the diagram - * that follows, the vertical arrows represent inheritance, and the - * parentheses meta-classes. All metaclasses are instances - * of the class `Class'. - * - * +------------------+ - * | | - * Object---->(Object\) | - * ^ ^ ^ ^ | - * | | | | | - * | | +-----+ +---------+ | - * | | | | | - * | +-----------+ | | - * | | | | | - * +------+ | Module--->(Module\) | - * | | ^ ^ | - * OtherClass-->(OtherClass\) | | | - * | | | - * Class---->(Class\) | - * ^ | - * | | - * +----------------+ - */) - - -comment(/* - * Object is the parent class of all classes in Ruby. Its - * methods are therefore available to all objects unless explicitly - * overridden. - * - * Object mixes in the Kernel module, making - * the built-in kernel functions globally accessible. Although the - * instance methods of Object are defined by the - * Kernel module, we have chosen to document them here for - * clarity. - * - * In the descriptions of Object's methods, the parameter symbol refers - * to a symbol, which is either a quoted string or a - * Symbol (such as :name\). - */) - -directive(void) -ident(Init_Object)operator((\)) -operator({) - ident(VALUE) ident(metaclass)operator(;) - - ident(rb_cObject) operator(=) ident(boot_defclass)operator(()stringoperator(,) integer(0)operator(\);) - ident(rb_cModule) operator(=) ident(boot_defclass)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_cClass) operator(=) ident(boot_defclass)operator(()stringoperator(,) ident(rb_cModule)operator(\);) - - ident(metaclass) operator(=) ident(rb_make_metaclass)operator(()ident(rb_cObject)operator(,) ident(rb_cClass)operator(\);) - ident(metaclass) operator(=) ident(rb_make_metaclass)operator(()ident(rb_cModule)operator(,) ident(metaclass)operator(\);) - ident(metaclass) operator(=) ident(rb_make_metaclass)operator(()ident(rb_cClass)operator(,) ident(metaclass)operator(\);) - - ident(rb_mKernel) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - ident(rb_include_module)operator(()ident(rb_cObject)operator(,) ident(rb_mKernel)operator(\);) - ident(rb_define_alloc_func)operator(()ident(rb_cObject)operator(,) ident(rb_class_allocate_instance)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cObject)operator(,) stringoperator(,) ident(rb_obj_dummy)operator(,) integer(0)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cClass)operator(,) stringoperator(,) ident(rb_obj_dummy)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_obj_dummy)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_obj_dummy)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_obj_dummy)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_obj_dummy)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_obj_dummy)operator(,) integer(1)operator(\);) - - - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_false)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_pattern_match)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_equal)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_id_obsolete)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_type)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_class)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_clone)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_dup)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_init_copy)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_taint)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_tainted)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_untaint)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_freeze)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_frozen_p)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_any_to_a)operator(,) integer(0)operator(\);) comment(/* to be removed */) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_any_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_methods)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) - ident(rb_obj_singleton_methods)operator(,) operator(-)integer(1)operator(\);) comment(/* in class.c */) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) - ident(rb_obj_protected_methods)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_private_methods)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_public_methods)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) - ident(rb_obj_instance_variables)operator(,) integer(0)operator(\);) comment(/* in variable.c */) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_ivar_get)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_ivar_set)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_ivar_defined)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) - ident(rb_obj_remove_instance_variable)operator(,) integer(1)operator(\);) comment(/* in variable.c */) - - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_is_instance_of)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_is_kind_of)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_is_kind_of)operator(,) integer(1)operator(\);) - - ident(rb_define_private_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_dummy)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_dummy)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_mKernel)operator(,) stringoperator(,) ident(rb_obj_dummy)operator(,) integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_sprintf)operator(,) operator(-)integer(1)operator(\);) comment(/* in sprintf.c */) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_sprintf)operator(,) operator(-)integer(1)operator(\);) comment(/* in sprintf.c */) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_integer)operator(,) integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_float)operator(,) integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_string)operator(,) integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_array)operator(,) integer(1)operator(\);) - - ident(rb_cNilClass) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNilClass)operator(,) stringoperator(,) ident(nil_to_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNilClass)operator(,) stringoperator(,) ident(nil_to_f)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNilClass)operator(,) stringoperator(,) ident(nil_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNilClass)operator(,) stringoperator(,) ident(nil_to_a)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNilClass)operator(,) stringoperator(,) ident(nil_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNilClass)operator(,) stringoperator(,) ident(false_and)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNilClass)operator(,) stringoperator(,) ident(false_or)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cNilClass)operator(,) stringoperator(,) ident(false_xor)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cNilClass)operator(,) stringoperator(,) ident(rb_true)operator(,) integer(0)operator(\);) - ident(rb_undef_alloc_func)operator(()ident(rb_cNilClass)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cNilClass)operator(\),) stringoperator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(Qnil)operator(\);) - - ident(rb_cSymbol) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cSymbol)operator(,) stringoperator(,) - ident(rb_sym_all_symbols)operator(,) integer(0)operator(\);) comment(/* in parse.y */) - ident(rb_undef_alloc_func)operator(()ident(rb_cSymbol)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cSymbol)operator(\),) stringoperator(\);) - - ident(rb_define_method)operator(()ident(rb_cSymbol)operator(,) stringoperator(,) ident(sym_to_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cSymbol)operator(,) stringoperator(,) ident(sym_to_int)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cSymbol)operator(,) stringoperator(,) ident(sym_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cSymbol)operator(,) stringoperator(,) ident(sym_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cSymbol)operator(,) stringoperator(,) ident(sym_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cSymbol)operator(,) stringoperator(,) ident(sym_to_sym)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cSymbol)operator(,) stringoperator(,) ident(rb_obj_equal)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_freeze)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_eqq)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_obj_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) string)delimiter(")>operator(,) ident(rb_mod_cmp)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_lt)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_class_inherited_p)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) string)delimiter(")>operator(,) ident(rb_mod_gt)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) string=)delimiter(")>operator(,) ident(rb_mod_ge)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_init_copy)operator(,) integer(1)operator(\);) comment(/* in class.c */) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) - ident(rb_mod_included_modules)operator(,) integer(0)operator(\);) comment(/* in class.c */) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_include_p)operator(,) integer(1)operator(\);) comment(/* in class.c */) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_name)operator(,) integer(0)operator(\);) comment(/* in variable.c */) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_ancestors)operator(,) integer(0)operator(\);) comment(/* in class.c */) - - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_attr)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_attr_reader)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_attr_writer)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_attr_accessor)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_alloc_func)operator(()ident(rb_cModule)operator(,) ident(rb_module_s_alloc)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_initialize)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) - ident(rb_class_instance_methods)operator(,) operator(-)integer(1)operator(\);) comment(/* in class.c */) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) - ident(rb_class_public_instance_methods)operator(,) operator(-)integer(1)operator(\);) comment(/* in class.c */) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) - ident(rb_class_protected_instance_methods)operator(,) operator(-)integer(1)operator(\);) comment(/* in class.c */) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) - ident(rb_class_private_instance_methods)operator(,) operator(-)integer(1)operator(\);) comment(/* in class.c */) - - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_cvar_defined)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_constants)operator(,) integer(0)operator(\);) comment(/* in variable.c */) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_const_get)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_const_set)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_const_defined)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) - ident(rb_mod_remove_const)operator(,) integer(1)operator(\);) comment(/* in variable.c */) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) - ident(rb_mod_const_missing)operator(,) integer(1)operator(\);) comment(/* in variable.c */) - ident(rb_define_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) - ident(rb_mod_class_variables)operator(,) integer(0)operator(\);) comment(/* in variable.c */) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) - ident(rb_mod_remove_cvar)operator(,) integer(1)operator(\);) comment(/* in variable.c */) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_cvar_get)operator(,) integer(1)operator(\);) - ident(rb_define_private_method)operator(()ident(rb_cModule)operator(,) stringoperator(,) ident(rb_mod_cvar_set)operator(,) integer(2)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cClass)operator(,) stringoperator(,) ident(rb_obj_alloc)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cClass)operator(,) stringoperator(,) ident(rb_class_new_instance)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cClass)operator(,) stringoperator(,) ident(rb_class_initialize)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cClass)operator(,) stringoperator(,) ident(rb_class_init_copy)operator(,) integer(1)operator(\);) comment(/* in class.c */) - ident(rb_define_method)operator(()ident(rb_cClass)operator(,) stringoperator(,) ident(rb_class_superclass)operator(,) integer(0)operator(\);) - ident(rb_define_alloc_func)operator(()ident(rb_cClass)operator(,) ident(rb_class_s_alloc)operator(\);) - ident(rb_undef_method)operator(()ident(rb_cClass)operator(,) stringoperator(\);) - ident(rb_undef_method)operator(()ident(rb_cClass)operator(,) stringoperator(\);) - - ident(rb_cData) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_undef_alloc_func)operator(()ident(rb_cData)operator(\);) - - ident(rb_global_variable)operator((&)ident(ruby_top_self)operator(\);) - ident(ruby_top_self) operator(=) ident(rb_obj_alloc)operator(()ident(rb_cObject)operator(\);) - ident(rb_define_singleton_method)operator(()ident(ruby_top_self)operator(,) stringoperator(,) ident(main_to_s)operator(,) integer(0)operator(\);) - - ident(rb_cTrueClass) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTrueClass)operator(,) stringoperator(,) ident(true_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTrueClass)operator(,) stringoperator(,) ident(true_and)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTrueClass)operator(,) stringoperator(,) ident(true_or)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTrueClass)operator(,) stringoperator(,) ident(true_xor)operator(,) integer(1)operator(\);) - ident(rb_undef_alloc_func)operator(()ident(rb_cTrueClass)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cTrueClass)operator(\),) stringoperator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(Qtrue)operator(\);) - - ident(rb_cFalseClass) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFalseClass)operator(,) stringoperator(,) ident(false_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFalseClass)operator(,) stringoperator(,) ident(false_and)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFalseClass)operator(,) stringoperator(,) ident(false_or)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cFalseClass)operator(,) stringoperator(,) ident(false_xor)operator(,) integer(1)operator(\);) - ident(rb_undef_alloc_func)operator(()ident(rb_cFalseClass)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cFalseClass)operator(\),) stringoperator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(Qfalse)operator(\);) - - ident(id_eq) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_eql) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_inspect) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_init_copy) operator(=) ident(rb_intern)operator(()stringoperator(\);) -operator(}) -comment(/********************************************************************** - - pack.c - - - $Author: shyouhei $ - $Date: 2009-02-19 10:01:35 +0100 (Thu, 19 Feb 2009\) $ - created at: Thu Feb 10 15:17:05 JST 1994 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#define) ident(SIZE16) integer(2) -preprocessor(#define) ident(SIZE32) integer(4) - -preprocessor(#if) ident(SIZEOF_SHORT) operator(!=) integer(2) operator(||) ident(SIZEOF_LONG) operator(!=) integer(4) -preprocessor(# define) ident(NATINT_PACK) -preprocessor(#endif) - -preprocessor(#ifdef) ident(NATINT_PACK) -preprocessor(# define) ident(OFF16B)operator(()ident(p)operator(\)) operator((()pre_type(char)operator(*\)()ident(p)operator(\)) operator(+) operator(()ident(natint)operator(?)integer(0)operator(:()reserved(sizeof)operator(()pre_type(short)operator(\)) operator(-) ident(SIZE16)operator(\)\)\)) -preprocessor(# define) ident(OFF32B)operator(()ident(p)operator(\)) operator((()pre_type(char)operator(*\)()ident(p)operator(\)) operator(+) operator(()ident(natint)operator(?)integer(0)operator(:()reserved(sizeof)operator(()pre_type(long)operator(\)) operator(-) ident(SIZE32)operator(\)\)\)) -preprocessor(# define) ident(NATINT_LEN)operator(()ident(type)operator(,)ident(len)operator(\)) operator(()ident(natint)operator(?)reserved(sizeof)operator(()ident(type)operator(\):()ident(len)operator(\)\)) -preprocessor(# ifdef) ident(WORDS_BIGENDIAN) -preprocessor(# define) ident(OFF16)operator(()ident(p)operator(\)) ident(OFF16B)operator(()ident(p)operator(\)) -preprocessor(# define) ident(OFF32)operator(()ident(p)operator(\)) ident(OFF32B)operator(()ident(p)operator(\)) -preprocessor(# endif) -preprocessor(# define) ident(NATINT_HTOVS)operator(()ident(x)operator(\)) operator(()ident(natint)operator(?)ident(htovs)operator(()ident(x)operator(\):)ident(htov16)operator(()ident(x)operator(\)\)) -preprocessor(# define) ident(NATINT_HTOVL)operator(()ident(x)operator(\)) operator(()ident(natint)operator(?)ident(htovl)operator(()ident(x)operator(\):)ident(htov32)operator(()ident(x)operator(\)\)) -preprocessor(# define) ident(NATINT_HTONS)operator(()ident(x)operator(\)) operator(()ident(natint)operator(?)ident(htons)operator(()ident(x)operator(\):)ident(hton16)operator(()ident(x)operator(\)\)) -preprocessor(# define) ident(NATINT_HTONL)operator(()ident(x)operator(\)) operator(()ident(natint)operator(?)ident(htonl)operator(()ident(x)operator(\):)ident(hton32)operator(()ident(x)operator(\)\)) -preprocessor(#else) -preprocessor(# define) ident(NATINT_LEN)operator(()ident(type)operator(,)ident(len)operator(\)) reserved(sizeof)operator(()ident(type)operator(\)) -preprocessor(# define) ident(NATINT_HTOVS)operator(()ident(x)operator(\)) ident(htovs)operator(()ident(x)operator(\)) -preprocessor(# define) ident(NATINT_HTOVL)operator(()ident(x)operator(\)) ident(htovl)operator(()ident(x)operator(\)) -preprocessor(# define) ident(NATINT_HTONS)operator(()ident(x)operator(\)) ident(htons)operator(()ident(x)operator(\)) -preprocessor(# define) ident(NATINT_HTONL)operator(()ident(x)operator(\)) ident(htonl)operator(()ident(x)operator(\)) -preprocessor(#endif) - -preprocessor(#ifndef) ident(OFF16) -preprocessor(# define) ident(OFF16)operator(()ident(p)operator(\)) operator(()pre_type(char)operator(*\)()ident(p)operator(\)) -preprocessor(# define) ident(OFF32)operator(()ident(p)operator(\)) operator(()pre_type(char)operator(*\)()ident(p)operator(\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(OFF16B) -preprocessor(# define) ident(OFF16B)operator(()ident(p)operator(\)) operator(()pre_type(char)operator(*\)()ident(p)operator(\)) -preprocessor(# define) ident(OFF32B)operator(()ident(p)operator(\)) operator(()pre_type(char)operator(*\)()ident(p)operator(\)) -preprocessor(#endif) - -preprocessor(#define) ident(define_swapx)operator(()ident(x)operator(,) ident(xtype)operator(\)) \ -directive(static) ident(xtype) \ -ident(TOKEN_PASTE)operator(()ident(swap)operator(,)ident(x)operator(\)()ident(z)operator(\)) \ - ident(xtype) ident(z)operator(;) \ -operator({) \ - ident(xtype) ident(r)operator(;) \ - ident(xtype) operator(*)ident(zp)operator(;) \ - pre_type(unsigned) pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(t)operator(;) \ - pre_type(int) ident(i)operator(;) \ - \ - ident(zp) operator(=) ident(xmalloc)operator(()reserved(sizeof)operator(()ident(xtype)operator(\)\);) \ - operator(*)ident(zp) operator(=) ident(z)operator(;) \ - ident(s) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(zp)operator(;) \ - ident(t) operator(=) ident(xmalloc)operator(()reserved(sizeof)operator(()ident(xtype)operator(\)\);) \ - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)reserved(sizeof)operator(()ident(xtype)operator(\);) ident(i)operator(++\)) operator({) \ - ident(t)operator([)reserved(sizeof)operator(()ident(xtype)operator(\)-)ident(i)operator(-)integer(1)operator(]) operator(=) ident(s)operator([)ident(i)operator(];) \ - operator(}) \ - ident(r) operator(=) operator(*()ident(xtype) operator(*\))ident(t)operator(;) \ - ident(free)operator(()ident(t)operator(\);) \ - ident(free)operator(()ident(zp)operator(\);) \ - reserved(return) ident(r)operator(;) \ -operator(}) - -preprocessor(#ifndef) ident(swap16) -preprocessor(#define) ident(swap16)operator(()ident(x)operator(\)) operator((((()ident(x)operator(\)&)hex(0xFF)operator(\)<<)integer(8)operator(\)) operator(|) operator(((()ident(x)operator(\)>>)integer(8)operator(\)&)hex(0xFF)operator(\)\)) -preprocessor(#endif) -preprocessor(#if) ident(SIZEOF_SHORT) operator(==) integer(2) -preprocessor(#define) ident(swaps)operator(()ident(x)operator(\)) ident(swap16)operator(()ident(x)operator(\)) -preprocessor(#else) -preprocessor(#if) ident(SIZEOF_SHORT) operator(==) integer(4) -preprocessor(#define) ident(swaps)operator(()ident(x)operator(\)) operator((((()ident(x)operator(\)&)hex(0xFF)operator(\)<<)integer(24)operator(\)) \ - operator(|((()ident(x)operator(\)>>)integer(24)operator(\)&)hex(0xFF)operator(\)) \ - operator(|((()ident(x)operator(\)&)hex(0x0000FF00)operator(\)<<)integer(8)operator(\)) \ - operator(|((()ident(x)operator(\)&)hex(0x00FF0000)operator(\)>>)integer(8)operator(\)) operator(\)) -preprocessor(#else) -ident(define_swapx)operator(()ident(s)operator(,)pre_type(short)operator(\)) -preprocessor(#endif) -preprocessor(#endif) - -preprocessor(#ifndef) ident(swap32) -preprocessor(#define) ident(swap32)operator(()ident(x)operator(\)) operator((((()ident(x)operator(\)&)hex(0xFF)operator(\)<<)integer(24)operator(\)) \ - operator(|((()ident(x)operator(\)>>)integer(24)operator(\)&)hex(0xFF)operator(\)) \ - operator(|((()ident(x)operator(\)&)hex(0x0000FF00)operator(\)<<)integer(8)operator(\)) \ - operator(|((()ident(x)operator(\)&)hex(0x00FF0000)operator(\)>>)integer(8)operator(\)) operator(\)) -preprocessor(#endif) -preprocessor(#if) ident(SIZEOF_LONG) operator(==) integer(4) -preprocessor(#define) ident(swapl)operator(()ident(x)operator(\)) ident(swap32)operator(()ident(x)operator(\)) -preprocessor(#else) -preprocessor(#if) ident(SIZEOF_LONG) operator(==) integer(8) -preprocessor(#define) ident(swapl)operator(()ident(x)operator(\)) operator((((()ident(x)operator(\)&)hex(0x00000000000000FF)operator(\)<<)integer(56)operator(\)) \ - operator(|((()ident(x)operator(\)&)hex(0xFF00000000000000)operator(\)>>)integer(56)operator(\)) \ - operator(|((()ident(x)operator(\)&)hex(0x000000000000FF00)operator(\)<<)integer(40)operator(\)) \ - operator(|((()ident(x)operator(\)&)hex(0x00FF000000000000)operator(\)>>)integer(40)operator(\)) \ - operator(|((()ident(x)operator(\)&)hex(0x0000000000FF0000)operator(\)<<)integer(24)operator(\)) \ - operator(|((()ident(x)operator(\)&)hex(0x0000FF0000000000)operator(\)>>)integer(24)operator(\)) \ - operator(|((()ident(x)operator(\)&)hex(0x00000000FF000000)operator(\)<<)integer(8)operator(\)) \ - operator(|((()ident(x)operator(\)&)hex(0x000000FF00000000)operator(\)>>)integer(8)operator(\)\)) -preprocessor(#else) -ident(define_swapx)operator(()ident(l)operator(,)pre_type(long)operator(\)) -preprocessor(#endif) -preprocessor(#endif) - -preprocessor(#if) ident(SIZEOF_FLOAT) operator(==) integer(4) -preprocessor(#if) ident(SIZEOF_LONG) operator(==) integer(4) comment(/* SIZEOF_FLOAT == 4 == SIZEOF_LONG */) -preprocessor(#define) ident(swapf)operator(()ident(x)operator(\)) ident(swapl)operator(()ident(x)operator(\)) -preprocessor(#define) ident(FLOAT_SWAPPER) pre_type(unsigned) pre_type(long) -preprocessor(#else) -preprocessor(#if) ident(SIZEOF_SHORT) operator(==) integer(4) comment(/* SIZEOF_FLOAT == 4 == SIZEOF_SHORT */) -preprocessor(#define) ident(swapf)operator(()ident(x)operator(\)) ident(swaps)operator(()ident(x)operator(\)) -preprocessor(#define) ident(FLOAT_SWAPPER) pre_type(unsigned) pre_type(short) -preprocessor(#else) comment(/* SIZEOF_FLOAT == 4 but undivide by known size of int */) -ident(define_swapx)operator(()ident(f)operator(,)pre_type(float)operator(\)) -preprocessor(#endif) comment(/* #if SIZEOF_SHORT == 4 */) -preprocessor(#endif) comment(/* #if SIZEOF_LONG == 4 */) -preprocessor(#else) comment(/* SIZEOF_FLOAT != 4 */) -ident(define_swapx)operator(()ident(f)operator(,)pre_type(float)operator(\)) -preprocessor(#endif) comment(/* #if SIZEOF_FLOAT == 4 */) - -preprocessor(#if) ident(SIZEOF_DOUBLE) operator(==) integer(8) -preprocessor(#if) ident(SIZEOF_LONG) operator(==) integer(8) comment(/* SIZEOF_DOUBLE == 8 == SIZEOF_LONG */) -preprocessor(#define) ident(swapd)operator(()ident(x)operator(\)) ident(swapl)operator(()ident(x)operator(\)) -preprocessor(#define) ident(DOUBLE_SWAPPER) pre_type(unsigned) pre_type(long) -preprocessor(#else) -preprocessor(#if) ident(SIZEOF_LONG) operator(==) integer(4) comment(/* SIZEOF_DOUBLE == 8 && 4 == SIZEOF_LONG */) -directive(static) pre_type(double) -ident(swapd)operator(()ident(d)operator(\)) - directive(const) pre_type(double) ident(d)operator(;) -operator({) - pre_type(double) ident(dtmp) operator(=) ident(d)operator(;) - pre_type(unsigned) pre_type(long) ident(utmp)operator([)integer(2)operator(];) - pre_type(unsigned) pre_type(long) ident(utmp0)operator(;) - - ident(utmp)operator([)integer(0)operator(]) operator(=) integer(0)operator(;) ident(utmp)operator([)integer(1)operator(]) operator(=) integer(0)operator(;) - ident(memcpy)operator(()ident(utmp)operator(,&)ident(dtmp)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\);) - ident(utmp0) operator(=) ident(utmp)operator([)integer(0)operator(];) - ident(utmp)operator([)integer(0)operator(]) operator(=) ident(swapl)operator(()ident(utmp)operator([)integer(1)operator(]\);) - ident(utmp)operator([)integer(1)operator(]) operator(=) ident(swapl)operator(()ident(utmp0)operator(\);) - ident(memcpy)operator((&)ident(dtmp)operator(,)ident(utmp)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\);) - reserved(return) ident(dtmp)operator(;) -operator(}) -preprocessor(#else) -preprocessor(#if) ident(SIZEOF_SHORT) operator(==) integer(4) comment(/* SIZEOF_DOUBLE == 8 && 4 == SIZEOF_SHORT */) -directive(static) pre_type(double) -ident(swapd)operator(()ident(d)operator(\)) - directive(const) pre_type(double) ident(d)operator(;) -operator({) - pre_type(double) ident(dtmp) operator(=) ident(d)operator(;) - pre_type(unsigned) pre_type(short) ident(utmp)operator([)integer(2)operator(];) - pre_type(unsigned) pre_type(short) ident(utmp0)operator(;) - - ident(utmp)operator([)integer(0)operator(]) operator(=) integer(0)operator(;) ident(utmp)operator([)integer(1)operator(]) operator(=) integer(0)operator(;) - ident(memcpy)operator(()ident(utmp)operator(,&)ident(dtmp)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\);) - ident(utmp0) operator(=) ident(utmp)operator([)integer(0)operator(];) - ident(utmp)operator([)integer(0)operator(]) operator(=) ident(swaps)operator(()ident(utmp)operator([)integer(1)operator(]\);) - ident(utmp)operator([)integer(1)operator(]) operator(=) ident(swaps)operator(()ident(utmp0)operator(\);) - ident(memcpy)operator((&)ident(dtmp)operator(,)ident(utmp)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\);) - reserved(return) ident(dtmp)operator(;) -operator(}) -preprocessor(#else) comment(/* SIZEOF_DOUBLE == 8 but undivied by known size of int */) -ident(define_swapx)operator(()ident(d)operator(,) pre_type(double)operator(\)) -preprocessor(#endif) comment(/* #if SIZEOF_SHORT == 4 */) -preprocessor(#endif) comment(/* #if SIZEOF_LONG == 4 */) -preprocessor(#endif) comment(/* #if SIZEOF_LONG == 8 */) -preprocessor(#else) comment(/* SIZEOF_DOUBLE != 8 */) -ident(define_swapx)operator(()ident(d)operator(,) pre_type(double)operator(\)) -preprocessor(#endif) comment(/* #if SIZEOF_DOUBLE == 8 */) - -preprocessor(#undef) ident(define_swapx) - -preprocessor(#ifdef) ident(DYNAMIC_ENDIAN) -preprocessor(#ifdef) ident(ntohs) -preprocessor(#undef) ident(ntohs) -preprocessor(#undef) ident(ntohl) -preprocessor(#undef) ident(htons) -preprocessor(#undef) ident(htonl) -preprocessor(#endif) -directive(static) pre_type(int) -ident(endian)operator((\)) -operator({) - directive(static) pre_type(int) ident(init) operator(=) integer(0)operator(;) - directive(static) pre_type(int) ident(endian_value)operator(;) - pre_type(char) operator(*)ident(p)operator(;) - - reserved(if) operator(()ident(init)operator(\)) reserved(return) ident(endian_value)operator(;) - ident(init) operator(=) integer(1)operator(;) - ident(p) operator(=) operator(()pre_type(char)operator(*\)&)ident(init)operator(;) - reserved(return) ident(endian_value) operator(=) ident(p)operator([)integer(0)operator(]?)integer(0)operator(:)integer(1)operator(;) -operator(}) - -preprocessor(#define) ident(ntohs)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?()ident(x)operator(\):)ident(swaps)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(ntohl)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?()ident(x)operator(\):)ident(swapl)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(ntohf)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?()ident(x)operator(\):)ident(swapf)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(ntohd)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?()ident(x)operator(\):)ident(swapd)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(htons)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?()ident(x)operator(\):)ident(swaps)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(htonl)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?()ident(x)operator(\):)ident(swapl)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(htonf)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?()ident(x)operator(\):)ident(swapf)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(htond)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?()ident(x)operator(\):)ident(swapd)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(htovs)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?)ident(swaps)operator(()ident(x)operator(\):()ident(x)operator(\)\)) -preprocessor(#define) ident(htovl)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?)ident(swapl)operator(()ident(x)operator(\):()ident(x)operator(\)\)) -preprocessor(#define) ident(htovf)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?)ident(swapf)operator(()ident(x)operator(\):()ident(x)operator(\)\)) -preprocessor(#define) ident(htovd)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?)ident(swapd)operator(()ident(x)operator(\):()ident(x)operator(\)\)) -preprocessor(#define) ident(vtohs)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?)ident(swaps)operator(()ident(x)operator(\):()ident(x)operator(\)\)) -preprocessor(#define) ident(vtohl)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?)ident(swapl)operator(()ident(x)operator(\):()ident(x)operator(\)\)) -preprocessor(#define) ident(vtohf)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?)ident(swapf)operator(()ident(x)operator(\):()ident(x)operator(\)\)) -preprocessor(#define) ident(vtohd)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?)ident(swapd)operator(()ident(x)operator(\):()ident(x)operator(\)\)) -preprocessor(# ifdef) ident(NATINT_PACK) -preprocessor(#define) ident(htov16)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?)ident(swap16)operator(()ident(x)operator(\):()ident(x)operator(\)\)) -preprocessor(#define) ident(htov32)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?)ident(swap32)operator(()ident(x)operator(\):()ident(x)operator(\)\)) -preprocessor(#define) ident(hton16)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?()ident(x)operator(\):)ident(swap16)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(hton32)operator(()ident(x)operator(\)) operator(()ident(endian)operator((\)?()ident(x)operator(\):)ident(swap32)operator(()ident(x)operator(\)\)) -preprocessor(# endif) -preprocessor(#else) -preprocessor(#ifdef) ident(WORDS_BIGENDIAN) -preprocessor(#ifndef) ident(ntohs) -preprocessor(#define) ident(ntohs)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(ntohl)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(htons)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(htonl)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#endif) -preprocessor(#define) ident(ntohf)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(ntohd)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(htonf)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(htond)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(htovs)operator(()ident(x)operator(\)) ident(swaps)operator(()ident(x)operator(\)) -preprocessor(#define) ident(htovl)operator(()ident(x)operator(\)) ident(swapl)operator(()ident(x)operator(\)) -preprocessor(#define) ident(htovf)operator(()ident(x)operator(\)) ident(swapf)operator(()ident(x)operator(\)) -preprocessor(#define) ident(htovd)operator(()ident(x)operator(\)) ident(swapd)operator(()ident(x)operator(\)) -preprocessor(#define) ident(vtohs)operator(()ident(x)operator(\)) ident(swaps)operator(()ident(x)operator(\)) -preprocessor(#define) ident(vtohl)operator(()ident(x)operator(\)) ident(swapl)operator(()ident(x)operator(\)) -preprocessor(#define) ident(vtohf)operator(()ident(x)operator(\)) ident(swapf)operator(()ident(x)operator(\)) -preprocessor(#define) ident(vtohd)operator(()ident(x)operator(\)) ident(swapd)operator(()ident(x)operator(\)) -preprocessor(# ifdef) ident(NATINT_PACK) -preprocessor(#define) ident(htov16)operator(()ident(x)operator(\)) ident(swap16)operator(()ident(x)operator(\)) -preprocessor(#define) ident(htov32)operator(()ident(x)operator(\)) ident(swap32)operator(()ident(x)operator(\)) -preprocessor(#define) ident(hton16)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(hton32)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(# endif) -preprocessor(#else) comment(/* LITTLE ENDIAN */) -preprocessor(#ifdef) ident(ntohs) -preprocessor(#undef) ident(ntohs) -preprocessor(#undef) ident(ntohl) -preprocessor(#undef) ident(htons) -preprocessor(#undef) ident(htonl) -preprocessor(#endif) -preprocessor(#define) ident(ntohs)operator(()ident(x)operator(\)) ident(swaps)operator(()ident(x)operator(\)) -preprocessor(#define) ident(ntohl)operator(()ident(x)operator(\)) ident(swapl)operator(()ident(x)operator(\)) -preprocessor(#define) ident(htons)operator(()ident(x)operator(\)) ident(swaps)operator(()ident(x)operator(\)) -preprocessor(#define) ident(htonl)operator(()ident(x)operator(\)) ident(swapl)operator(()ident(x)operator(\)) -preprocessor(#define) ident(ntohf)operator(()ident(x)operator(\)) ident(swapf)operator(()ident(x)operator(\)) -preprocessor(#define) ident(ntohd)operator(()ident(x)operator(\)) ident(swapd)operator(()ident(x)operator(\)) -preprocessor(#define) ident(htonf)operator(()ident(x)operator(\)) ident(swapf)operator(()ident(x)operator(\)) -preprocessor(#define) ident(htond)operator(()ident(x)operator(\)) ident(swapd)operator(()ident(x)operator(\)) -preprocessor(#define) ident(htovs)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(htovl)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(htovf)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(htovd)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(vtohs)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(vtohl)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(vtohf)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(vtohd)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(# ifdef) ident(NATINT_PACK) -preprocessor(#define) ident(htov16)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(htov32)operator(()ident(x)operator(\)) operator(()ident(x)operator(\)) -preprocessor(#define) ident(hton16)operator(()ident(x)operator(\)) ident(swap16)operator(()ident(x)operator(\)) -preprocessor(#define) ident(hton32)operator(()ident(x)operator(\)) ident(swap32)operator(()ident(x)operator(\)) -preprocessor(# endif) -preprocessor(#endif) -preprocessor(#endif) - -preprocessor(#ifdef) ident(FLOAT_SWAPPER) -preprocessor(#define) ident(FLOAT_CONVWITH)operator(()ident(y)operator(\)) ident(FLOAT_SWAPPER) ident(y)operator(;) -preprocessor(#define) ident(HTONF)operator(()ident(x)operator(,)ident(y)operator(\)) operator(()ident(memcpy)operator((&)ident(y)operator(,&)ident(x)operator(,)reserved(sizeof)operator(()pre_type(float)operator(\)\),) \ - ident(y) operator(=) ident(htonf)operator((()ident(FLOAT_SWAPPER)operator(\))ident(y)operator(\),) \ - ident(memcpy)operator((&)ident(x)operator(,&)ident(y)operator(,)reserved(sizeof)operator(()pre_type(float)operator(\)\),) \ - ident(x)operator(\)) -preprocessor(#define) ident(HTOVF)operator(()ident(x)operator(,)ident(y)operator(\)) operator(()ident(memcpy)operator((&)ident(y)operator(,&)ident(x)operator(,)reserved(sizeof)operator(()pre_type(float)operator(\)\),) \ - ident(y) operator(=) ident(htovf)operator((()ident(FLOAT_SWAPPER)operator(\))ident(y)operator(\),) \ - ident(memcpy)operator((&)ident(x)operator(,&)ident(y)operator(,)reserved(sizeof)operator(()pre_type(float)operator(\)\),) \ - ident(x)operator(\)) -preprocessor(#define) ident(NTOHF)operator(()ident(x)operator(,)ident(y)operator(\)) operator(()ident(memcpy)operator((&)ident(y)operator(,&)ident(x)operator(,)reserved(sizeof)operator(()pre_type(float)operator(\)\),) \ - ident(y) operator(=) ident(ntohf)operator((()ident(FLOAT_SWAPPER)operator(\))ident(y)operator(\),) \ - ident(memcpy)operator((&)ident(x)operator(,&)ident(y)operator(,)reserved(sizeof)operator(()pre_type(float)operator(\)\),) \ - ident(x)operator(\)) -preprocessor(#define) ident(VTOHF)operator(()ident(x)operator(,)ident(y)operator(\)) operator(()ident(memcpy)operator((&)ident(y)operator(,&)ident(x)operator(,)reserved(sizeof)operator(()pre_type(float)operator(\)\),) \ - ident(y) operator(=) ident(vtohf)operator((()ident(FLOAT_SWAPPER)operator(\))ident(y)operator(\),) \ - ident(memcpy)operator((&)ident(x)operator(,&)ident(y)operator(,)reserved(sizeof)operator(()pre_type(float)operator(\)\),) \ - ident(x)operator(\)) -preprocessor(#else) -preprocessor(#define) ident(FLOAT_CONVWITH)operator(()ident(y)operator(\)) -preprocessor(#define) ident(HTONF)operator(()ident(x)operator(,)ident(y)operator(\)) ident(htonf)operator(()ident(x)operator(\)) -preprocessor(#define) ident(HTOVF)operator(()ident(x)operator(,)ident(y)operator(\)) ident(htovf)operator(()ident(x)operator(\)) -preprocessor(#define) ident(NTOHF)operator(()ident(x)operator(,)ident(y)operator(\)) ident(ntohf)operator(()ident(x)operator(\)) -preprocessor(#define) ident(VTOHF)operator(()ident(x)operator(,)ident(y)operator(\)) ident(vtohf)operator(()ident(x)operator(\)) -preprocessor(#endif) - -preprocessor(#ifdef) ident(DOUBLE_SWAPPER) -preprocessor(#define) ident(DOUBLE_CONVWITH)operator(()ident(y)operator(\)) ident(DOUBLE_SWAPPER) ident(y)operator(;) -preprocessor(#define) ident(HTOND)operator(()ident(x)operator(,)ident(y)operator(\)) operator(()ident(memcpy)operator((&)ident(y)operator(,&)ident(x)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\),) \ - ident(y) operator(=) ident(htond)operator((()ident(DOUBLE_SWAPPER)operator(\))ident(y)operator(\),) \ - ident(memcpy)operator((&)ident(x)operator(,&)ident(y)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\),) \ - ident(x)operator(\)) -preprocessor(#define) ident(HTOVD)operator(()ident(x)operator(,)ident(y)operator(\)) operator(()ident(memcpy)operator((&)ident(y)operator(,&)ident(x)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\),) \ - ident(y) operator(=) ident(htovd)operator((()ident(DOUBLE_SWAPPER)operator(\))ident(y)operator(\),) \ - ident(memcpy)operator((&)ident(x)operator(,&)ident(y)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\),) \ - ident(x)operator(\)) -preprocessor(#define) ident(NTOHD)operator(()ident(x)operator(,)ident(y)operator(\)) operator(()ident(memcpy)operator((&)ident(y)operator(,&)ident(x)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\),) \ - ident(y) operator(=) ident(ntohd)operator((()ident(DOUBLE_SWAPPER)operator(\))ident(y)operator(\),) \ - ident(memcpy)operator((&)ident(x)operator(,&)ident(y)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\),) \ - ident(x)operator(\)) -preprocessor(#define) ident(VTOHD)operator(()ident(x)operator(,)ident(y)operator(\)) operator(()ident(memcpy)operator((&)ident(y)operator(,&)ident(x)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\),) \ - ident(y) operator(=) ident(vtohd)operator((()ident(DOUBLE_SWAPPER)operator(\))ident(y)operator(\),) \ - ident(memcpy)operator((&)ident(x)operator(,&)ident(y)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\),) \ - ident(x)operator(\)) -preprocessor(#else) -preprocessor(#define) ident(DOUBLE_CONVWITH)operator(()ident(y)operator(\)) -preprocessor(#define) ident(HTOND)operator(()ident(x)operator(,)ident(y)operator(\)) ident(htond)operator(()ident(x)operator(\)) -preprocessor(#define) ident(HTOVD)operator(()ident(x)operator(,)ident(y)operator(\)) ident(htovd)operator(()ident(x)operator(\)) -preprocessor(#define) ident(NTOHD)operator(()ident(x)operator(,)ident(y)operator(\)) ident(ntohd)operator(()ident(x)operator(\)) -preprocessor(#define) ident(VTOHD)operator(()ident(x)operator(,)ident(y)operator(\)) ident(vtohd)operator(()ident(x)operator(\)) -preprocessor(#endif) - -pre_type(unsigned) pre_type(long) ident(rb_big2ulong_pack) ident(_)operator((()ident(VALUE) ident(x)operator(\)\);) - -directive(static) pre_type(unsigned) pre_type(long) -ident(num2i32)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - ident(x) operator(=) ident(rb_to_int)operator(()ident(x)operator(\);) comment(/* is nil OK? (should not\) */) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(x)operator(\)\)) reserved(return) ident(FIX2LONG)operator(()ident(x)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(x)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) operator({) - reserved(return) ident(rb_big2ulong_pack)operator(()ident(x)operator(\);) - operator(}) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(rb_obj_classname)operator(()ident(x)operator(\)\);) - reserved(return) integer(0)operator(;) comment(/* not reached */) -operator(}) - -preprocessor(#if) ident(SIZEOF_LONG) operator(==) ident(SIZE32) -preprocessor(# define) ident(EXTEND32)operator(()ident(x)operator(\)) -preprocessor(#else) -comment(/* invariant in modulo 1<<31 */) -preprocessor(# define) ident(EXTEND32)operator(()ident(x)operator(\)) reserved(do) operator({) reserved(if) operator((!)ident(natint)operator(\)) operator({()ident(x)operator(\)) operator(=) operator(((()integer(1L)operator(<<)integer(31)operator(\)-)integer(1)operator(-()ident(x)operator(\)\)^~(~)integer(0L)operator(<<)integer(31)operator(\)\);}}) reserved(while)operator(()integer(0)operator(\)) -preprocessor(#endif) -preprocessor(#if) ident(SIZEOF_SHORT) operator(==) ident(SIZE16) -preprocessor(# define) ident(EXTEND16)operator(()ident(x)operator(\)) -preprocessor(#else) -preprocessor(# define) ident(EXTEND16)operator(()ident(x)operator(\)) reserved(do) operator({) reserved(if) operator((!)ident(natint)operator(\)) operator({()ident(x)operator(\)) operator(=) operator(()pre_type(short)operator(\)((()integer(1)operator(<<)integer(15)operator(\)-)integer(1)operator(-()ident(x)operator(\)\)^~(~)integer(0)operator(<<)integer(15)operator(\)\);}}) reserved(while)operator(()integer(0)operator(\)) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_LONG_LONG) -preprocessor(# define) ident(QUAD_SIZE) reserved(sizeof)operator(()ident(LONG_LONG)operator(\)) -preprocessor(#else) -preprocessor(# define) ident(QUAD_SIZE) integer(8) -preprocessor(#endif) -directive(static) directive(const) pre_type(char) ident(toofew)operator([]) operator(=) stringoperator(;) - -directive(static) directive(void) ident(encodes) ident(_)operator((()ident(VALUE)operator(,)pre_type(char)operator(*,)pre_type(long)operator(,)pre_type(int)operator(\)\);) -directive(static) directive(void) ident(qpencode) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(,)pre_type(long)operator(\)\);) - -directive(static) pre_type(int) ident(uv_to_utf8) ident(_)operator((()pre_type(char)operator(*,)pre_type(unsigned) pre_type(long)operator(\)\);) -directive(static) pre_type(unsigned) pre_type(long) ident(utf8_to_uv) ident(_)operator((()pre_type(char)operator(*,)pre_type(long)operator(*\)\);) - -comment(/* - * call-seq: - * arr.pack ( aTemplateString \) -> aBinaryString - * - * Packs the contents of arr into a binary sequence according to - * the directives in aTemplateString (see the table below\) - * Directives ``A,'' ``a,'' and ``Z'' may be followed by a count, - * which gives the width of the resulting field. The remaining - * directives also may take a count, indicating the number of array - * elements to convert. If the count is an asterisk - * (``*''\), all remaining array elements will be - * converted. Any of the directives ``sSiIlL'' may be - * followed by an underscore (``_''\) to use the underlying - * platform's native size for the specified type; otherwise, they use a - * platform-independent size. Spaces are ignored in the template - * string. See also String#unpack. - * - * a = [ "a", "b", "c" ] - * n = [ 65, 66, 67 ] - * a.pack("A3A3A3"\) #=> "a b c " - * a.pack("a3a3a3"\) #=> "a\\000\\000b\\000\\000c\\000\\000" - * n.pack("ccc"\) #=> "ABC" - * - * Directives for +pack+. - * - * Directive Meaning - * --------------------------------------------------------------- - * @ | Moves to absolute position - * A | ASCII string (space padded, count is width\) - * a | ASCII string (null padded, count is width\) - * B | Bit string (descending bit order\) - * b | Bit string (ascending bit order\) - * C | Unsigned char - * c | Char - * D, d | Double-precision float, native format - * E | Double-precision float, little-endian byte order - * e | Single-precision float, little-endian byte order - * F, f | Single-precision float, native format - * G | Double-precision float, network (big-endian\) byte order - * g | Single-precision float, network (big-endian\) byte order - * H | Hex string (high nibble first\) - * h | Hex string (low nibble first\) - * I | Unsigned integer - * i | Integer - * L | Unsigned long - * l | Long - * M | Quoted printable, MIME encoding (see RFC2045\) - * m | Base64 encoded string - * N | Long, network (big-endian\) byte order - * n | Short, network (big-endian\) byte-order - * P | Pointer to a structure (fixed-length string\) - * p | Pointer to a null-terminated string - * Q, q | 64-bit number - * S | Unsigned short - * s | Short - * U | UTF-8 - * u | UU-encoded string - * V | Long, little-endian byte order - * v | Short, little-endian byte order - * w | BER-compressed integer\\fnm - * X | Back up a byte - * x | Null byte - * Z | Same as ``a'', except that null is added with * - */) - -directive(static) ident(VALUE) -ident(pack_pack)operator(()ident(ary)operator(,) ident(fmt)operator(\)) - ident(VALUE) ident(ary)operator(,) ident(fmt)operator(;) -operator({) - directive(static) pre_type(char) operator(*)ident(nul10) operator(=) stringoperator(;) - directive(static) pre_type(char) operator(*)ident(spc10) operator(=) stringoperator(;) - pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - ident(VALUE) ident(res)operator(,) ident(from)operator(,) ident(associates) operator(=) integer(0)operator(;) - pre_type(char) ident(type)operator(;) - pre_type(long) ident(items)operator(,) ident(len)operator(,) ident(idx)operator(,) ident(plen)operator(;) - pre_type(char) operator(*)ident(ptr)operator(;) -preprocessor(#ifdef) ident(NATINT_PACK) - pre_type(int) ident(natint)operator(;) comment(/* native integer */) -preprocessor(#endif) - - ident(StringValue)operator(()ident(fmt)operator(\);) - ident(p) operator(=) ident(RSTRING)operator(()ident(fmt)operator(\)->)ident(ptr)operator(;) - ident(pend) operator(=) ident(p) operator(+) ident(RSTRING)operator(()ident(fmt)operator(\)->)ident(len)operator(;) - ident(res) operator(=) ident(rb_str_buf_new)operator(()integer(0)operator(\);) - - ident(items) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - ident(idx) operator(=) integer(0)operator(;) - -preprocessor(#define) ident(TOO_FEW) operator(()ident(rb_raise)operator(()ident(rb_eArgError)operator(,) ident(toofew)operator(\),) integer(0)operator(\)) -preprocessor(#define) ident(THISFROM) operator(()ident(items) operator(>) integer(0) operator(?) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(idx)operator(]) operator(:) ident(TOO_FEW)operator(\)) -preprocessor(#define) ident(NEXTFROM) operator(()ident(items)operator(--) operator(>) integer(0) operator(?) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(idx)operator(++]) operator(:) ident(TOO_FEW)operator(\)) - - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(fmt)operator(\)->)ident(ptr) operator(+) ident(RSTRING)operator(()ident(fmt)operator(\)->)ident(len) operator(!=) ident(pend)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - ident(type) operator(=) operator(*)ident(p)operator(++;) comment(/* get data type */) -preprocessor(#ifdef) ident(NATINT_PACK) - ident(natint) operator(=) integer(0)operator(;) -preprocessor(#endif) - - reserved(if) operator(()ident(ISSPACE)operator(()ident(type)operator(\)\)) reserved(continue)operator(;) - reserved(if) operator(()ident(type) operator(==) char('#')operator(\)) operator({) - reserved(while) operator((()ident(p) operator(<) ident(pend)operator(\)) operator(&&) operator((*)ident(p) operator(!=) char('\\n')operator(\)\)) operator({) - ident(p)operator(++;) - operator(}) - reserved(continue)operator(;) - operator(}) - reserved(if) operator((*)ident(p) operator(==) char('_') operator(||) operator(*)ident(p) operator(==) char('!')operator(\)) operator({) - directive(const) pre_type(char) operator(*)ident(natstr) operator(=) stringoperator(;) - - reserved(if) operator(()ident(strchr)operator(()ident(natstr)operator(,) ident(type)operator(\)\)) operator({) -preprocessor(#ifdef) ident(NATINT_PACK) - ident(natint) operator(=) integer(1)operator(;) -preprocessor(#endif) - ident(p)operator(++;) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) operator(*)ident(p)operator(,) ident(natstr)operator(\);) - operator(}) - operator(}) - reserved(if) operator((*)ident(p) operator(==) char('*')operator(\)) operator({) comment(/* set data length */) - ident(len) operator(=) ident(strchr)operator(()stringoperator(,) ident(type)operator(\)) operator(?) integer(0) - operator(:) ident(strchr)operator(()stringoperator(,) ident(type)operator(\)) operator(?) integer(1) - operator(:) ident(items)operator(;) - ident(p)operator(++;) - operator(}) - reserved(else) reserved(if) operator(()ident(ISDIGIT)operator((*)ident(p)operator(\)\)) operator({) - ident(len) operator(=) ident(strtoul)operator(()ident(p)operator(,) operator(()pre_type(char)operator(**\)&)ident(p)operator(,) integer(10)operator(\);) - operator(}) - reserved(else) operator({) - ident(len) operator(=) integer(1)operator(;) - operator(}) - - reserved(switch) operator(()ident(type)operator(\)) operator({) - reserved(case) char('A')operator(:) reserved(case) char('a')operator(:) reserved(case) char('Z')operator(:) - reserved(case) char('B')operator(:) reserved(case) char('b')operator(:) - reserved(case) char('H')operator(:) reserved(case) char('h')operator(:) - ident(from) operator(=) ident(NEXTFROM)operator(;) - reserved(if) operator(()ident(NIL_P)operator(()ident(from)operator(\)\)) operator({) - ident(ptr) operator(=) stringoperator(;) - ident(plen) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(StringValue)operator(()ident(from)operator(\);) - ident(ptr) operator(=) ident(RSTRING)operator(()ident(from)operator(\)->)ident(ptr)operator(;) - ident(plen) operator(=) ident(RSTRING)operator(()ident(from)operator(\)->)ident(len)operator(;) - ident(OBJ_INFECT)operator(()ident(res)operator(,) ident(from)operator(\);) - operator(}) - - reserved(if) operator(()ident(p)operator([-)integer(1)operator(]) operator(==) char('*')operator(\)) - ident(len) operator(=) ident(plen)operator(;) - - reserved(switch) operator(()ident(type)operator(\)) operator({) - reserved(case) char('a')operator(:) comment(/* arbitrary binary string (null padded\) */) - reserved(case) char('A')operator(:) comment(/* ASCII string (space padded\) */) - reserved(case) char('Z')operator(:) comment(/* null terminated ASCII string */) - reserved(if) operator(()ident(plen) operator(>=) ident(len)operator(\)) operator({) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(ptr)operator(,) ident(len)operator(\);) - reserved(if) operator(()ident(p)operator([-)integer(1)operator(]) operator(==) char('*') operator(&&) ident(type) operator(==) char('Z')operator(\)) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(nul10)operator(,) integer(1)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(ptr)operator(,) ident(plen)operator(\);) - ident(len) operator(-=) ident(plen)operator(;) - reserved(while) operator(()ident(len) operator(>=) integer(10)operator(\)) operator({) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(()ident(type) operator(==) char('A')operator(\)?)ident(spc10)operator(:)ident(nul10)operator(,) integer(10)operator(\);) - ident(len) operator(-=) integer(10)operator(;) - operator(}) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(()ident(type) operator(==) char('A')operator(\)?)ident(spc10)operator(:)ident(nul10)operator(,) ident(len)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('b')operator(:) comment(/* bit string (ascending\) */) - operator({) - pre_type(int) ident(byte) operator(=) integer(0)operator(;) - pre_type(long) ident(i)operator(,) ident(j) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(len) operator(>) ident(plen)operator(\)) operator({) - ident(j) operator(=) operator(()ident(len) operator(-) ident(plen) operator(+) integer(1)operator(\))operator(/)integer(2)operator(;) - ident(len) operator(=) ident(plen)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(++) operator(<) ident(len)operator(;) ident(ptr)operator(++\)) operator({) - reserved(if) operator((*)ident(ptr) operator(&) integer(1)operator(\)) - ident(byte) operator(|=) integer(128)operator(;) - reserved(if) operator(()ident(i) operator(&) integer(7)operator(\)) - ident(byte) operator(>>=) integer(1)operator(;) - reserved(else) operator({) - pre_type(char) ident(c) operator(=) ident(byte) operator(&) hex(0xff)operator(;) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\);) - ident(byte) operator(=) integer(0)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(len) operator(&) integer(7)operator(\)) operator({) - pre_type(char) ident(c)operator(;) - ident(byte) operator(>>=) integer(7) operator(-) operator(()ident(len) operator(&) integer(7)operator(\);) - ident(c) operator(=) ident(byte) operator(&) hex(0xff)operator(;) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\);) - operator(}) - ident(len) operator(=) ident(j)operator(;) - reserved(goto) ident(grow)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('B')operator(:) comment(/* bit string (descending\) */) - operator({) - pre_type(int) ident(byte) operator(=) integer(0)operator(;) - pre_type(long) ident(i)operator(,) ident(j) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(len) operator(>) ident(plen)operator(\)) operator({) - ident(j) operator(=) operator(()ident(len) operator(-) ident(plen) operator(+) integer(1)operator(\))operator(/)integer(2)operator(;) - ident(len) operator(=) ident(plen)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(++) operator(<) ident(len)operator(;) ident(ptr)operator(++\)) operator({) - ident(byte) operator(|=) operator(*)ident(ptr) operator(&) integer(1)operator(;) - reserved(if) operator(()ident(i) operator(&) integer(7)operator(\)) - ident(byte) operator(<<=) integer(1)operator(;) - reserved(else) operator({) - pre_type(char) ident(c) operator(=) ident(byte) operator(&) hex(0xff)operator(;) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\);) - ident(byte) operator(=) integer(0)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(len) operator(&) integer(7)operator(\)) operator({) - pre_type(char) ident(c)operator(;) - ident(byte) operator(<<=) integer(7) operator(-) operator(()ident(len) operator(&) integer(7)operator(\);) - ident(c) operator(=) ident(byte) operator(&) hex(0xff)operator(;) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\);) - operator(}) - ident(len) operator(=) ident(j)operator(;) - reserved(goto) ident(grow)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('h')operator(:) comment(/* hex string (low nibble first\) */) - operator({) - pre_type(int) ident(byte) operator(=) integer(0)operator(;) - pre_type(long) ident(i)operator(,) ident(j) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(len) operator(>) ident(plen)operator(\)) operator({) - ident(j) operator(=) operator(()ident(len) operator(+) integer(1)operator(\)) operator(/) integer(2) operator(-) operator(()ident(plen) operator(+) integer(1)operator(\)) operator(/) integer(2)operator(;) - ident(len) operator(=) ident(plen)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(++) operator(<) ident(len)operator(;) ident(ptr)operator(++\)) operator({) - reserved(if) operator(()ident(ISALPHA)operator((*)ident(ptr)operator(\)\)) - ident(byte) operator(|=) operator((((*)ident(ptr) operator(&) integer(15)operator(\)) operator(+) integer(9)operator(\)) operator(&) integer(15)operator(\)) operator(<<) integer(4)operator(;) - reserved(else) - ident(byte) operator(|=) operator((*)ident(ptr) operator(&) integer(15)operator(\)) operator(<<) integer(4)operator(;) - reserved(if) operator(()ident(i) operator(&) integer(1)operator(\)) - ident(byte) operator(>>=) integer(4)operator(;) - reserved(else) operator({) - pre_type(char) ident(c) operator(=) ident(byte) operator(&) hex(0xff)operator(;) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\);) - ident(byte) operator(=) integer(0)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(len) operator(&) integer(1)operator(\)) operator({) - pre_type(char) ident(c) operator(=) ident(byte) operator(&) hex(0xff)operator(;) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\);) - operator(}) - ident(len) operator(=) ident(j)operator(;) - reserved(goto) ident(grow)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('H')operator(:) comment(/* hex string (high nibble first\) */) - operator({) - pre_type(int) ident(byte) operator(=) integer(0)operator(;) - pre_type(long) ident(i)operator(,) ident(j) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(len) operator(>) ident(plen)operator(\)) operator({) - ident(j) operator(=) operator(()ident(len) operator(+) integer(1)operator(\)) operator(/) integer(2) operator(-) operator(()ident(plen) operator(+) integer(1)operator(\)) operator(/) integer(2)operator(;) - ident(len) operator(=) ident(plen)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(++) operator(<) ident(len)operator(;) ident(ptr)operator(++\)) operator({) - reserved(if) operator(()ident(ISALPHA)operator((*)ident(ptr)operator(\)\)) - ident(byte) operator(|=) operator(((*)ident(ptr) operator(&) integer(15)operator(\)) operator(+) integer(9)operator(\)) operator(&) integer(15)operator(;) - reserved(else) - ident(byte) operator(|=) operator(*)ident(ptr) operator(&) integer(15)operator(;) - reserved(if) operator(()ident(i) operator(&) integer(1)operator(\)) - ident(byte) operator(<<=) integer(4)operator(;) - reserved(else) operator({) - pre_type(char) ident(c) operator(=) ident(byte) operator(&) hex(0xff)operator(;) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\);) - ident(byte) operator(=) integer(0)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(len) operator(&) integer(1)operator(\)) operator({) - pre_type(char) ident(c) operator(=) ident(byte) operator(&) hex(0xff)operator(;) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\);) - operator(}) - ident(len) operator(=) ident(j)operator(;) - reserved(goto) ident(grow)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('c')operator(:) comment(/* signed char */) - reserved(case) char('C')operator(:) comment(/* unsigned char */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(char) ident(c)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(c) operator(=) ident(num2i32)operator(()ident(from)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(&)ident(c)operator(,) reserved(sizeof)operator(()pre_type(char)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('s')operator(:) comment(/* signed short */) - reserved(case) char('S')operator(:) comment(/* unsigned short */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(short) ident(s)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(s) operator(=) ident(num2i32)operator(()ident(from)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(OFF16)operator((&)ident(s)operator(\),) ident(NATINT_LEN)operator(()pre_type(short)operator(,)integer(2)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('i')operator(:) comment(/* signed int */) - reserved(case) char('I')operator(:) comment(/* unsigned int */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(long) ident(i)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(i) operator(=) ident(num2i32)operator(()ident(from)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(OFF32)operator((&)ident(i)operator(\),) ident(NATINT_LEN)operator(()pre_type(int)operator(,)integer(4)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('l')operator(:) comment(/* signed long */) - reserved(case) char('L')operator(:) comment(/* unsigned long */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(long) ident(l)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(l) operator(=) ident(num2i32)operator(()ident(from)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(OFF32)operator((&)ident(l)operator(\),) ident(NATINT_LEN)operator(()pre_type(long)operator(,)integer(4)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('q')operator(:) comment(/* signed quad (64bit\) int */) - reserved(case) char('Q')operator(:) comment(/* unsigned quad (64bit\) int */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(char) ident(tmp)operator([)ident(QUAD_SIZE)operator(];) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(rb_quad_pack)operator(()ident(tmp)operator(,) ident(from)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(()pre_type(char)operator(*\)&)ident(tmp)operator(,) ident(QUAD_SIZE)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('n')operator(:) comment(/* unsigned short (network byte-order\) */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(short) ident(s)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(s) operator(=) ident(num2i32)operator(()ident(from)operator(\);) - ident(s) operator(=) ident(NATINT_HTONS)operator(()ident(s)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(OFF16)operator((&)ident(s)operator(\),) ident(NATINT_LEN)operator(()pre_type(short)operator(,)integer(2)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('N')operator(:) comment(/* unsigned long (network byte-order\) */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(long) ident(l)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(l) operator(=) ident(num2i32)operator(()ident(from)operator(\);) - ident(l) operator(=) ident(NATINT_HTONL)operator(()ident(l)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(OFF32)operator((&)ident(l)operator(\),) ident(NATINT_LEN)operator(()pre_type(long)operator(,)integer(4)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('v')operator(:) comment(/* unsigned short (VAX byte-order\) */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(short) ident(s)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(s) operator(=) ident(num2i32)operator(()ident(from)operator(\);) - ident(s) operator(=) ident(NATINT_HTOVS)operator(()ident(s)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(OFF16)operator((&)ident(s)operator(\),) ident(NATINT_LEN)operator(()pre_type(short)operator(,)integer(2)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('V')operator(:) comment(/* unsigned long (VAX byte-order\) */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(long) ident(l)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(l) operator(=) ident(num2i32)operator(()ident(from)operator(\);) - ident(l) operator(=) ident(NATINT_HTOVL)operator(()ident(l)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(OFF32)operator((&)ident(l)operator(\),) ident(NATINT_LEN)operator(()pre_type(long)operator(,)integer(4)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('f')operator(:) comment(/* single precision float in native format */) - reserved(case) char('F')operator(:) comment(/* ditto */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(float) ident(f)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(f) operator(=) ident(RFLOAT)operator(()ident(rb_Float)operator(()ident(from)operator(\)\)->)ident(value)operator(;) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(()pre_type(char)operator(*\)&)ident(f)operator(,) reserved(sizeof)operator(()pre_type(float)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('e')operator(:) comment(/* single precision float in VAX byte-order */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(float) ident(f)operator(;) - ident(FLOAT_CONVWITH)operator(()ident(ftmp)operator(\);) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(f) operator(=) ident(RFLOAT)operator(()ident(rb_Float)operator(()ident(from)operator(\)\)->)ident(value)operator(;) - ident(f) operator(=) ident(HTOVF)operator(()ident(f)operator(,)ident(ftmp)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(()pre_type(char)operator(*\)&)ident(f)operator(,) reserved(sizeof)operator(()pre_type(float)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('E')operator(:) comment(/* double precision float in VAX byte-order */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(double) ident(d)operator(;) - ident(DOUBLE_CONVWITH)operator(()ident(dtmp)operator(\);) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(d) operator(=) ident(RFLOAT)operator(()ident(rb_Float)operator(()ident(from)operator(\)\)->)ident(value)operator(;) - ident(d) operator(=) ident(HTOVD)operator(()ident(d)operator(,)ident(dtmp)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(()pre_type(char)operator(*\)&)ident(d)operator(,) reserved(sizeof)operator(()pre_type(double)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('d')operator(:) comment(/* double precision float in native format */) - reserved(case) char('D')operator(:) comment(/* ditto */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(double) ident(d)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(d) operator(=) ident(RFLOAT)operator(()ident(rb_Float)operator(()ident(from)operator(\)\)->)ident(value)operator(;) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(()pre_type(char)operator(*\)&)ident(d)operator(,) reserved(sizeof)operator(()pre_type(double)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('g')operator(:) comment(/* single precision float in network byte-order */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(float) ident(f)operator(;) - ident(FLOAT_CONVWITH)operator(()ident(ftmp)operator(\);) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(f) operator(=) ident(RFLOAT)operator(()ident(rb_Float)operator(()ident(from)operator(\)\)->)ident(value)operator(;) - ident(f) operator(=) ident(HTONF)operator(()ident(f)operator(,)ident(ftmp)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(()pre_type(char)operator(*\)&)ident(f)operator(,) reserved(sizeof)operator(()pre_type(float)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('G')operator(:) comment(/* double precision float in network byte-order */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(double) ident(d)operator(;) - ident(DOUBLE_CONVWITH)operator(()ident(dtmp)operator(\);) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(d) operator(=) ident(RFLOAT)operator(()ident(rb_Float)operator(()ident(from)operator(\)\)->)ident(value)operator(;) - ident(d) operator(=) ident(HTOND)operator(()ident(d)operator(,)ident(dtmp)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(()pre_type(char)operator(*\)&)ident(d)operator(,) reserved(sizeof)operator(()pre_type(double)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('x')operator(:) comment(/* null byte */) - label(grow:) - reserved(while) operator(()ident(len) operator(>=) integer(10)operator(\)) operator({) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(nul10)operator(,) integer(10)operator(\);) - ident(len) operator(-=) integer(10)operator(;) - operator(}) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(nul10)operator(,) ident(len)operator(\);) - reserved(break)operator(;) - - reserved(case) char('X')operator(:) comment(/* back up byte */) - label(shrink:) - ident(plen) operator(=) ident(RSTRING)operator(()ident(res)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(plen) operator(<) ident(len)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - ident(RSTRING)operator(()ident(res)operator(\)->)ident(len) operator(=) ident(plen) operator(-) ident(len)operator(;) - ident(RSTRING)operator(()ident(res)operator(\)->)ident(ptr)operator([)ident(plen) operator(-) ident(len)operator(]) operator(=) char('\\0')operator(;) - reserved(break)operator(;) - - reserved(case) char('@')operator(:) comment(/* null fill to absolute position */) - ident(len) operator(-=) ident(RSTRING)operator(()ident(res)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(len) operator(>) integer(0)operator(\)) reserved(goto) ident(grow)operator(;) - ident(len) operator(=) operator(-)ident(len)operator(;) - reserved(if) operator(()ident(len) operator(>) integer(0)operator(\)) reserved(goto) ident(shrink)operator(;) - reserved(break)operator(;) - - reserved(case) char('%')operator(:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(break)operator(;) - - reserved(case) char('U')operator(:) comment(/* Unicode character */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(long) ident(l)operator(;) - pre_type(char) ident(buf)operator([)integer(8)operator(];) - pre_type(int) ident(le)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(from) operator(=) ident(rb_to_int)operator(()ident(from)operator(\);) - ident(l) operator(=) ident(NUM2INT)operator(()ident(from)operator(\);) - reserved(if) operator(()ident(l) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(\);) - operator(}) - ident(le) operator(=) ident(uv_to_utf8)operator(()ident(buf)operator(,) ident(l)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(()pre_type(char)operator(*\))ident(buf)operator(,) ident(le)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('u')operator(:) comment(/* uuencoded string */) - reserved(case) char('m')operator(:) comment(/* base64 encoded string */) - ident(from) operator(=) ident(NEXTFROM)operator(;) - ident(StringValue)operator(()ident(from)operator(\);) - ident(ptr) operator(=) ident(RSTRING)operator(()ident(from)operator(\)->)ident(ptr)operator(;) - ident(plen) operator(=) ident(RSTRING)operator(()ident(from)operator(\)->)ident(len)operator(;) - - reserved(if) operator(()ident(len) operator(<=) integer(2)operator(\)) - ident(len) operator(=) integer(45)operator(;) - reserved(else) - ident(len) operator(=) ident(len) operator(/) integer(3) operator(*) integer(3)operator(;) - reserved(while) operator(()ident(plen) operator(>) integer(0)operator(\)) operator({) - pre_type(long) ident(todo)operator(;) - - reserved(if) operator(()ident(plen) operator(>) ident(len)operator(\)) - ident(todo) operator(=) ident(len)operator(;) - reserved(else) - ident(todo) operator(=) ident(plen)operator(;) - ident(encodes)operator(()ident(res)operator(,) ident(ptr)operator(,) ident(todo)operator(,) ident(type)operator(\);) - ident(plen) operator(-=) ident(todo)operator(;) - ident(ptr) operator(+=) ident(todo)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('M')operator(:) comment(/* quoted-printable encoded string */) - ident(from) operator(=) ident(rb_obj_as_string)operator(()ident(NEXTFROM)operator(\);) - reserved(if) operator(()ident(len) operator(<=) integer(1)operator(\)) - ident(len) operator(=) integer(72)operator(;) - ident(qpencode)operator(()ident(res)operator(,) ident(from)operator(,) ident(len)operator(\);) - reserved(break)operator(;) - - reserved(case) char('P')operator(:) comment(/* pointer to packed byte string */) - ident(from) operator(=) ident(THISFROM)operator(;) - reserved(if) operator((!)ident(NIL_P)operator(()ident(from)operator(\)\)) operator({) - ident(StringValue)operator(()ident(from)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(from)operator(\)->)ident(len) operator(<) ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(RSTRING)operator(()ident(from)operator(\)->)ident(len)operator(,) ident(len)operator(\);) - operator(}) - operator(}) - ident(len) operator(=) integer(1)operator(;) - comment(/* FALL THROUGH */) - reserved(case) char('p')operator(:) comment(/* pointer to string */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(char) operator(*)ident(t)operator(;) - ident(from) operator(=) ident(NEXTFROM)operator(;) - reserved(if) operator(()ident(NIL_P)operator(()ident(from)operator(\)\)) operator({) - ident(t) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(t) operator(=) ident(StringValuePtr)operator(()ident(from)operator(\);) - operator(}) - reserved(if) operator((!)ident(associates)operator(\)) operator({) - ident(associates) operator(=) ident(rb_ary_new)operator((\);) - operator(}) - ident(rb_ary_push)operator(()ident(associates)operator(,) ident(from)operator(\);) - ident(rb_obj_taint)operator(()ident(from)operator(\);) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(()pre_type(char)operator(*\)&)ident(t)operator(,) reserved(sizeof)operator(()pre_type(char)operator(*\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('w')operator(:) comment(/* BER compressed integer */) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(long) ident(ul)operator(;) - ident(VALUE) ident(buf) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\);) - pre_type(char) ident(c)operator(,) operator(*)ident(bufs)operator(,) operator(*)ident(bufe)operator(;) - - ident(from) operator(=) ident(NEXTFROM)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(from)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) operator({) - ident(VALUE) ident(big128) operator(=) ident(rb_uint2big)operator(()integer(128)operator(\);) - reserved(while) operator(()ident(TYPE)operator(()ident(from)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) operator({) - ident(from) operator(=) ident(rb_big_divmod)operator(()ident(from)operator(,) ident(big128)operator(\);) - ident(c) operator(=) ident(NUM2INT)operator(()ident(RARRAY)operator(()ident(from)operator(\)->)ident(ptr)operator([)integer(1)operator(]\)) operator(|) hex(0x80)operator(;) comment(/* mod */) - ident(rb_str_buf_cat)operator(()ident(buf)operator(,) operator(&)ident(c)operator(,) reserved(sizeof)operator(()pre_type(char)operator(\)\);) - ident(from) operator(=) ident(RARRAY)operator(()ident(from)operator(\)->)ident(ptr)operator([)integer(0)operator(];) comment(/* div */) - operator(}) - operator(}) - - operator({) - pre_type(long) ident(l) operator(=) ident(NUM2LONG)operator(()ident(from)operator(\);) - reserved(if) operator(()ident(l) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(ul) operator(=) ident(l)operator(;) - operator(}) - - reserved(while) operator(()ident(ul)operator(\)) operator({) - ident(c) operator(=) operator((()ident(ul) operator(&) hex(0x7f)operator(\)) operator(|) hex(0x80)operator(\);) - ident(rb_str_buf_cat)operator(()ident(buf)operator(,) operator(&)ident(c)operator(,) reserved(sizeof)operator(()pre_type(char)operator(\)\);) - ident(ul) operator(>>=) integer(7)operator(;) - operator(}) - - reserved(if) operator(()ident(RSTRING)operator(()ident(buf)operator(\)->)ident(len)operator(\)) operator({) - ident(bufs) operator(=) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(ptr)operator(;) - ident(bufe) operator(=) ident(bufs) operator(+) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(len) operator(-) integer(1)operator(;) - operator(*)ident(bufs) operator(&=) hex(0x7f)operator(;) comment(/* clear continue bit */) - reserved(while) operator(()ident(bufs) operator(<) ident(bufe)operator(\)) operator({) comment(/* reverse */) - ident(c) operator(=) operator(*)ident(bufs)operator(;) - operator(*)ident(bufs)operator(++) operator(=) operator(*)ident(bufe)operator(;) - operator(*)ident(bufe)operator(--) operator(=) ident(c)operator(;) - operator(}) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(len)operator(\);) - operator(}) - reserved(else) operator({) - ident(c) operator(=) integer(0)operator(;) - ident(rb_str_buf_cat)operator(()ident(res)operator(,) operator(&)ident(c)operator(,) reserved(sizeof)operator(()pre_type(char)operator(\)\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) - - reserved(if) operator(()ident(associates)operator(\)) operator({) - ident(rb_str_associate)operator(()ident(res)operator(,) ident(associates)operator(\);) - operator(}) - ident(OBJ_INFECT)operator(()ident(res)operator(,) ident(fmt)operator(\);) - reserved(return) ident(res)operator(;) -operator(}) - -directive(static) pre_type(char) ident(uu_table)operator([]) operator(=) -string?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[)char(\\\\)content(]^_)delimiter(")>operator(;) -directive(static) pre_type(char) ident(b64_table)operator([]) operator(=) -stringoperator(;) - -directive(static) directive(void) -ident(encodes)operator(()ident(str)operator(,) ident(s)operator(,) ident(len)operator(,) ident(type)operator(\)) - ident(VALUE) ident(str)operator(;) - pre_type(char) operator(*)ident(s)operator(;) - pre_type(long) ident(len)operator(;) - pre_type(int) ident(type)operator(;) -operator({) - pre_type(char) operator(*)ident(buff) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(len) operator(*) integer(4) operator(/) integer(3) operator(+) integer(6)operator(\);) - pre_type(long) ident(i) operator(=) integer(0)operator(;) - pre_type(char) operator(*)ident(trans) operator(=) ident(type) operator(==) char('u') operator(?) ident(uu_table) operator(:) ident(b64_table)operator(;) - pre_type(int) ident(padding)operator(;) - - reserved(if) operator(()ident(type) operator(==) char('u')operator(\)) operator({) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(len) operator(+) char(' ')operator(;) - ident(padding) operator(=) char('`')operator(;) - operator(}) - reserved(else) operator({) - ident(padding) operator(=) char('=')operator(;) - operator(}) - reserved(while) operator(()ident(len) operator(>=) integer(3)operator(\)) operator({) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(trans)operator([)oct(077) operator(&) operator((*)ident(s) operator(>>) integer(2)operator(\)];) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(trans)operator([)oct(077) operator(&) operator((((*)ident(s) operator(<<) integer(4)operator(\)) operator(&) oct(060)operator(\)) operator(|) operator((()ident(s)operator([)integer(1)operator(]) operator(>>) integer(4)operator(\)) operator(&) oct(017)operator(\)\)];) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(trans)operator([)oct(077) operator(&) operator(((()ident(s)operator([)integer(1)operator(]) operator(<<) integer(2)operator(\)) operator(&) oct(074)operator(\)) operator(|) operator((()ident(s)operator([)integer(2)operator(]) operator(>>) integer(6)operator(\)) operator(&) oct(03)operator(\)\)];) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(trans)operator([)oct(077) operator(&) ident(s)operator([)integer(2)operator(]];) - ident(s) operator(+=) integer(3)operator(;) - ident(len) operator(-=) integer(3)operator(;) - operator(}) - reserved(if) operator(()ident(len) operator(==) integer(2)operator(\)) operator({) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(trans)operator([)oct(077) operator(&) operator((*)ident(s) operator(>>) integer(2)operator(\)];) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(trans)operator([)oct(077) operator(&) operator((((*)ident(s) operator(<<) integer(4)operator(\)) operator(&) oct(060)operator(\)) operator(|) operator((()ident(s)operator([)integer(1)operator(]) operator(>>) integer(4)operator(\)) operator(&) oct(017)operator(\)\)];) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(trans)operator([)oct(077) operator(&) operator(((()ident(s)operator([)integer(1)operator(]) operator(<<) integer(2)operator(\)) operator(&) oct(074)operator(\)) operator(|) operator((()char('\\0') operator(>>) integer(6)operator(\)) operator(&) oct(03)operator(\)\)];) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(padding)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(len) operator(==) integer(1)operator(\)) operator({) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(trans)operator([)oct(077) operator(&) operator((*)ident(s) operator(>>) integer(2)operator(\)];) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(trans)operator([)oct(077) operator(&) operator((((*)ident(s) operator(<<) integer(4)operator(\)) operator(&) oct(060)operator(\)) operator(|) operator((()char('\\0') operator(>>) integer(4)operator(\)) operator(&) oct(017)operator(\)\)];) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(padding)operator(;) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(padding)operator(;) - operator(}) - ident(buff)operator([)ident(i)operator(++]) operator(=) char('\\n')operator(;) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(buff)operator(,) ident(i)operator(\);) -operator(}) - -directive(static) pre_type(char) ident(hex_table)operator([]) operator(=) stringoperator(;) - -directive(static) directive(void) -ident(qpencode)operator(()ident(str)operator(,) ident(from)operator(,) ident(len)operator(\)) - ident(VALUE) ident(str)operator(,) ident(from)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - pre_type(char) ident(buff)operator([)integer(1024)operator(];) - pre_type(long) ident(i) operator(=) integer(0)operator(,) ident(n) operator(=) integer(0)operator(,) ident(prev) operator(=) pre_constant(EOF)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(s) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(RSTRING)operator(()ident(from)operator(\)->)ident(ptr)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(send) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(from)operator(\)->)ident(len)operator(;) - - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - reserved(if) operator(((*)ident(s) operator(>) integer(126)operator(\)) operator(||) - operator((*)ident(s) operator(<) integer(32) operator(&&) operator(*)ident(s) operator(!=) char('\\n') operator(&&) operator(*)ident(s) operator(!=) char('\\t')operator(\)) operator(||) - operator((*)ident(s) operator(==) char('=')operator(\)\)) operator({) - ident(buff)operator([)ident(i)operator(++]) operator(=) char('=')operator(;) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(hex_table)operator([*)ident(s) operator(>>) integer(4)operator(];) - ident(buff)operator([)ident(i)operator(++]) operator(=) ident(hex_table)operator([*)ident(s) operator(&) hex(0x0f)operator(];) - ident(n) operator(+=) integer(3)operator(;) - ident(prev) operator(=) pre_constant(EOF)operator(;) - operator(}) - reserved(else) reserved(if) operator((*)ident(s) operator(==) char('\\n')operator(\)) operator({) - reserved(if) operator(()ident(prev) operator(==) char(' ') operator(||) ident(prev) operator(==) char('\\t')operator(\)) operator({) - ident(buff)operator([)ident(i)operator(++]) operator(=) char('=')operator(;) - ident(buff)operator([)ident(i)operator(++]) operator(=) operator(*)ident(s)operator(;) - operator(}) - ident(buff)operator([)ident(i)operator(++]) operator(=) operator(*)ident(s)operator(;) - ident(n) operator(=) integer(0)operator(;) - ident(prev) operator(=) operator(*)ident(s)operator(;) - operator(}) - reserved(else) operator({) - ident(buff)operator([)ident(i)operator(++]) operator(=) operator(*)ident(s)operator(;) - ident(n)operator(++;) - ident(prev) operator(=) operator(*)ident(s)operator(;) - operator(}) - reserved(if) operator(()ident(n) operator(>) ident(len)operator(\)) operator({) - ident(buff)operator([)ident(i)operator(++]) operator(=) char('=')operator(;) - ident(buff)operator([)ident(i)operator(++]) operator(=) char('\\n')operator(;) - ident(n) operator(=) integer(0)operator(;) - ident(prev) operator(=) char('\\n')operator(;) - operator(}) - reserved(if) operator(()ident(i) operator(>) integer(1024) operator(-) integer(5)operator(\)) operator({) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(buff)operator(,) ident(i)operator(\);) - ident(i) operator(=) integer(0)operator(;) - operator(}) - ident(s)operator(++;) - operator(}) - reserved(if) operator(()ident(n) operator(>) integer(0)operator(\)) operator({) - ident(buff)operator([)ident(i)operator(++]) operator(=) char('=')operator(;) - ident(buff)operator([)ident(i)operator(++]) operator(=) char('\\n')operator(;) - operator(}) - reserved(if) operator(()ident(i) operator(>) integer(0)operator(\)) operator({) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(buff)operator(,) ident(i)operator(\);) - operator(}) -operator(}) - -directive(static) directive(inline) pre_type(int) -ident(hex2num)operator(()ident(c)operator(\)) - pre_type(char) ident(c)operator(;) -operator({) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('0')operator(:) reserved(case) char('1')operator(:) reserved(case) char('2')operator(:) reserved(case) char('3')operator(:) reserved(case) char('4')operator(:) - reserved(case) char('5')operator(:) reserved(case) char('6')operator(:) reserved(case) char('7')operator(:) reserved(case) char('8')operator(:) reserved(case) char('9')operator(:) - reserved(return) ident(c) operator(-) char('0')operator(;) - reserved(case) char('a')operator(:) reserved(case) char('b')operator(:) reserved(case) char('c')operator(:) - reserved(case) char('d')operator(:) reserved(case) char('e')operator(:) reserved(case) char('f')operator(:) - reserved(return) ident(c) operator(-) char('a') operator(+) integer(10)operator(;) - reserved(case) char('A')operator(:) reserved(case) char('B')operator(:) reserved(case) char('C')operator(:) - reserved(case) char('D')operator(:) reserved(case) char('E')operator(:) reserved(case) char('F')operator(:) - reserved(return) ident(c) operator(-) char('A') operator(+) integer(10)operator(;) - reserved(default)operator(:) - reserved(return) operator(-)integer(1)operator(;) - operator(}) -operator(}) - -preprocessor(#define) ident(PACK_LENGTH_ADJUST_SIZE)operator(()ident(sz)operator(\)) reserved(do) operator({) \ - ident(tmp) operator(=) integer(0)operator(;) \ - reserved(if) operator(()ident(len) operator(>) operator(()ident(send)operator(-)ident(s)operator(\))operator(/)ident(sz)operator(\)) operator({) \ - reserved(if) operator((!)ident(star)operator(\)) operator({) \ - ident(tmp) operator(=) ident(len)operator(-()ident(send)operator(-)ident(s)operator(\))operator(/)ident(sz)operator(;) \ - operator(}) \ - ident(len) operator(=) operator(()ident(send)operator(-)ident(s)operator(\))operator(/)ident(sz)operator(;) \ - operator(}) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#ifdef) ident(NATINT_PACK) -preprocessor(#define) ident(PACK_LENGTH_ADJUST)operator(()ident(type)operator(,)ident(sz)operator(\)) reserved(do) operator({) \ - pre_type(int) ident(t__len) operator(=) ident(NATINT_LEN)operator(()ident(type)operator(,()ident(sz)operator(\)\);) \ - ident(PACK_LENGTH_ADJUST_SIZE)operator(()ident(t__len)operator(\);) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#else) -preprocessor(#define) ident(PACK_LENGTH_ADJUST)operator(()ident(type)operator(,)ident(sz)operator(\)) \ - ident(PACK_LENGTH_ADJUST_SIZE)operator(()reserved(sizeof)operator(()ident(type)operator(\)\)) -preprocessor(#endif) - -preprocessor(#define) ident(PACK_ITEM_ADJUST)operator((\)) reserved(while) operator(()ident(tmp)operator(--\)) ident(rb_ary_push)operator(()ident(ary)operator(,) ident(Qnil)operator(\)) - -directive(static) ident(VALUE) -ident(infected_str_new)operator(()ident(ptr)operator(,) ident(len)operator(,) ident(str)operator(\)) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(s) operator(=) ident(rb_str_new)operator(()ident(ptr)operator(,) ident(len)operator(\);) - - ident(OBJ_INFECT)operator(()ident(s)operator(,) ident(str)operator(\);) - reserved(return) ident(s)operator(;) -operator(}) - -comment(/* - * call-seq: - * str.unpack(format\) => anArray - * - * Decodes str (which may contain binary data\) according to the - * format string, returning an array of each value extracted. The - * format string consists of a sequence of single-character directives, - * summarized in the table at the end of this entry. - * Each directive may be followed - * by a number, indicating the number of times to repeat with this - * directive. An asterisk (``*''\) will use up all - * remaining elements. The directives sSiIlL may each be - * followed by an underscore (``_''\) to use the underlying - * platform's native size for the specified type; otherwise, it uses a - * platform-independent consistent size. Spaces are ignored in the - * format string. See also Array#pack. - * - * "abc \\0\\0abc \\0\\0".unpack('A6Z6'\) #=> ["abc", "abc "] - * "abc \\0\\0".unpack('a3a3'\) #=> ["abc", " \\000\\000"] - * "abc \\0abc \\0".unpack('Z*Z*'\) #=> ["abc ", "abc "] - * "aa".unpack('b8B8'\) #=> ["10000110", "01100001"] - * "aaa".unpack('h2H2c'\) #=> ["16", "61", 97] - * "\\xfe\\xff\\xfe\\xff".unpack('sS'\) #=> [-2, 65534] - * "now=20is".unpack('M*'\) #=> ["now is"] - * "whole".unpack('xax2aX2aX1aX2a'\) #=> ["h", "e", "l", "l", "o"] - * - * This table summarizes the various formats and the Ruby classes - * returned by each. - * - * Format | Returns | Function - * -------+---------+----------------------------------------- - * A | String | with trailing nulls and spaces removed - * -------+---------+----------------------------------------- - * a | String | string - * -------+---------+----------------------------------------- - * B | String | extract bits from each character (msb first\) - * -------+---------+----------------------------------------- - * b | String | extract bits from each character (lsb first\) - * -------+---------+----------------------------------------- - * C | Fixnum | extract a character as an unsigned integer - * -------+---------+----------------------------------------- - * c | Fixnum | extract a character as an integer - * -------+---------+----------------------------------------- - * d,D | Float | treat sizeof(double\) characters as - * | | a native double - * -------+---------+----------------------------------------- - * E | Float | treat sizeof(double\) characters as - * | | a double in little-endian byte order - * -------+---------+----------------------------------------- - * e | Float | treat sizeof(float\) characters as - * | | a float in little-endian byte order - * -------+---------+----------------------------------------- - * f,F | Float | treat sizeof(float\) characters as - * | | a native float - * -------+---------+----------------------------------------- - * G | Float | treat sizeof(double\) characters as - * | | a double in network byte order - * -------+---------+----------------------------------------- - * g | Float | treat sizeof(float\) characters as a - * | | float in network byte order - * -------+---------+----------------------------------------- - * H | String | extract hex nibbles from each character - * | | (most significant first\) - * -------+---------+----------------------------------------- - * h | String | extract hex nibbles from each character - * | | (least significant first\) - * -------+---------+----------------------------------------- - * I | Integer | treat sizeof(int\) (modified by _\) - * | | successive characters as an unsigned - * | | native integer - * -------+---------+----------------------------------------- - * i | Integer | treat sizeof(int\) (modified by _\) - * | | successive characters as a signed - * | | native integer - * -------+---------+----------------------------------------- - * L | Integer | treat four (modified by _\) successive - * | | characters as an unsigned native - * | | long integer - * -------+---------+----------------------------------------- - * l | Integer | treat four (modified by _\) successive - * | | characters as a signed native - * | | long integer - * -------+---------+----------------------------------------- - * M | String | quoted-printable - * -------+---------+----------------------------------------- - * m | String | base64-encoded - * -------+---------+----------------------------------------- - * N | Integer | treat four characters as an unsigned - * | | long in network byte order - * -------+---------+----------------------------------------- - * n | Fixnum | treat two characters as an unsigned - * | | short in network byte order - * -------+---------+----------------------------------------- - * P | String | treat sizeof(char *\) characters as a - * | | pointer, and return \\emph{len} characters - * | | from the referenced location - * -------+---------+----------------------------------------- - * p | String | treat sizeof(char *\) characters as a - * | | pointer to a null-terminated string - * -------+---------+----------------------------------------- - * Q | Integer | treat 8 characters as an unsigned - * | | quad word (64 bits\) - * -------+---------+----------------------------------------- - * q | Integer | treat 8 characters as a signed - * | | quad word (64 bits\) - * -------+---------+----------------------------------------- - * S | Fixnum | treat two (different if _ used\) - * | | successive characters as an unsigned - * | | short in native byte order - * -------+---------+----------------------------------------- - * s | Fixnum | Treat two (different if _ used\) - * | | successive characters as a signed short - * | | in native byte order - * -------+---------+----------------------------------------- - * U | Integer | UTF-8 characters as unsigned integers - * -------+---------+----------------------------------------- - * u | String | UU-encoded - * -------+---------+----------------------------------------- - * V | Fixnum | treat four characters as an unsigned - * | | long in little-endian byte order - * -------+---------+----------------------------------------- - * v | Fixnum | treat two characters as an unsigned - * | | short in little-endian byte order - * -------+---------+----------------------------------------- - * w | Integer | BER-compressed integer (see Array.pack\) - * -------+---------+----------------------------------------- - * X | --- | skip backward one character - * -------+---------+----------------------------------------- - * x | --- | skip forward one character - * -------+---------+----------------------------------------- - * Z | String | with trailing nulls removed - * | | upto first null with * - * -------+---------+----------------------------------------- - * @ | --- | skip to the offset given by the - * | | length argument - * -------+---------+----------------------------------------- - */) - -directive(static) ident(VALUE) -ident(pack_unpack)operator(()ident(str)operator(,) ident(fmt)operator(\)) - ident(VALUE) ident(str)operator(,) ident(fmt)operator(;) -operator({) - directive(static) pre_type(char) operator(*)ident(hexdigits) operator(=) stringoperator(;) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(send)operator(;) - pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - ident(VALUE) ident(ary)operator(;) - pre_type(char) ident(type)operator(;) - pre_type(long) ident(len)operator(;) - pre_type(int) ident(tmp)operator(,) ident(star)operator(;) -preprocessor(#ifdef) ident(NATINT_PACK) - pre_type(int) ident(natint)operator(;) comment(/* native integer */) -preprocessor(#endif) - - ident(StringValue)operator(()ident(str)operator(\);) - ident(StringValue)operator(()ident(fmt)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(send) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(p) operator(=) ident(RSTRING)operator(()ident(fmt)operator(\)->)ident(ptr)operator(;) - ident(pend) operator(=) ident(p) operator(+) ident(RSTRING)operator(()ident(fmt)operator(\)->)ident(len)operator(;) - - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - ident(type) operator(=) operator(*)ident(p)operator(++;) -preprocessor(#ifdef) ident(NATINT_PACK) - ident(natint) operator(=) integer(0)operator(;) -preprocessor(#endif) - - reserved(if) operator(()ident(ISSPACE)operator(()ident(type)operator(\)\)) reserved(continue)operator(;) - reserved(if) operator(()ident(type) operator(==) char('#')operator(\)) operator({) - reserved(while) operator((()ident(p) operator(<) ident(pend)operator(\)) operator(&&) operator((*)ident(p) operator(!=) char('\\n')operator(\)\)) operator({) - ident(p)operator(++;) - operator(}) - reserved(continue)operator(;) - operator(}) - ident(star) operator(=) integer(0)operator(;) - reserved(if) operator((*)ident(p) operator(==) char('_') operator(||) operator(*)ident(p) operator(==) char('!')operator(\)) operator({) - pre_type(char) operator(*)ident(natstr) operator(=) stringoperator(;) - - reserved(if) operator(()ident(strchr)operator(()ident(natstr)operator(,) ident(type)operator(\)\)) operator({) -preprocessor(#ifdef) ident(NATINT_PACK) - ident(natint) operator(=) integer(1)operator(;) -preprocessor(#endif) - ident(p)operator(++;) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) operator(*)ident(p)operator(,) ident(natstr)operator(\);) - operator(}) - operator(}) - reserved(if) operator(()ident(p) operator(>=) ident(pend)operator(\)) - ident(len) operator(=) integer(1)operator(;) - reserved(else) reserved(if) operator((*)ident(p) operator(==) char('*')operator(\)) operator({) - ident(star) operator(=) integer(1)operator(;) - ident(len) operator(=) ident(send) operator(-) ident(s)operator(;) - ident(p)operator(++;) - operator(}) - reserved(else) reserved(if) operator(()ident(ISDIGIT)operator((*)ident(p)operator(\)\)) operator({) - ident(len) operator(=) ident(strtoul)operator(()ident(p)operator(,) operator(()pre_type(char)operator(**\)&)ident(p)operator(,) integer(10)operator(\);) - operator(}) - reserved(else) operator({) - ident(len) operator(=) operator(()ident(type) operator(!=) char('@')operator(\);) - operator(}) - - reserved(switch) operator(()ident(type)operator(\)) operator({) - reserved(case) char('%')operator(:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(break)operator(;) - - reserved(case) char('A')operator(:) - reserved(if) operator(()ident(len) operator(>) ident(send) operator(-) ident(s)operator(\)) ident(len) operator(=) ident(send) operator(-) ident(s)operator(;) - operator({) - pre_type(long) ident(end) operator(=) ident(len)operator(;) - pre_type(char) operator(*)ident(t) operator(=) ident(s) operator(+) ident(len) operator(-) integer(1)operator(;) - - reserved(while) operator(()ident(t) operator(>=) ident(s)operator(\)) operator({) - reserved(if) operator((*)ident(t) operator(!=) char(' ') operator(&&) operator(*)ident(t) operator(!=) char('\\0')operator(\)) reserved(break)operator(;) - ident(t)operator(--;) ident(len)operator(--;) - operator(}) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(infected_str_new)operator(()ident(s)operator(,) ident(len)operator(,) ident(str)operator(\)\);) - ident(s) operator(+=) ident(end)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('Z')operator(:) - operator({) - pre_type(char) operator(*)ident(t) operator(=) ident(s)operator(;) - - reserved(if) operator(()ident(len) operator(>) ident(send)operator(-)ident(s)operator(\)) ident(len) operator(=) ident(send)operator(-)ident(s)operator(;) - reserved(while) operator(()ident(t) operator(<) ident(s)operator(+)ident(len) operator(&&) operator(*)ident(t)operator(\)) ident(t)operator(++;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(infected_str_new)operator(()ident(s)operator(,) ident(t)operator(-)ident(s)operator(,) ident(str)operator(\)\);) - reserved(if) operator(()ident(t) operator(<) ident(send)operator(\)) ident(t)operator(++;) - ident(s) operator(=) ident(star) operator(?) ident(t) operator(:) ident(s)operator(+)ident(len)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('a')operator(:) - reserved(if) operator(()ident(len) operator(>) ident(send) operator(-) ident(s)operator(\)) ident(len) operator(=) ident(send) operator(-) ident(s)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(infected_str_new)operator(()ident(s)operator(,) ident(len)operator(,) ident(str)operator(\)\);) - ident(s) operator(+=) ident(len)operator(;) - reserved(break)operator(;) - - reserved(case) char('b')operator(:) - operator({) - ident(VALUE) ident(bitstr)operator(;) - pre_type(char) operator(*)ident(t)operator(;) - pre_type(int) ident(bits)operator(;) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(p)operator([-)integer(1)operator(]) operator(==) char('*') operator(||) ident(len) operator(>) operator(()ident(send) operator(-) ident(s)operator(\)) operator(*) integer(8)operator(\)) - ident(len) operator(=) operator(()ident(send) operator(-) ident(s)operator(\)) operator(*) integer(8)operator(;) - ident(bits) operator(=) integer(0)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(bitstr) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\)\);) - ident(t) operator(=) ident(RSTRING)operator(()ident(bitstr)operator(\)->)ident(ptr)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(i) operator(&) integer(7)operator(\)) ident(bits) operator(>>=) integer(1)operator(;) - reserved(else) ident(bits) operator(=) operator(*)ident(s)operator(++;) - operator(*)ident(t)operator(++) operator(=) operator(()ident(bits) operator(&) integer(1)operator(\)) operator(?) char('1') operator(:) char('0')operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) char('B')operator(:) - operator({) - ident(VALUE) ident(bitstr)operator(;) - pre_type(char) operator(*)ident(t)operator(;) - pre_type(int) ident(bits)operator(;) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(p)operator([-)integer(1)operator(]) operator(==) char('*') operator(||) ident(len) operator(>) operator(()ident(send) operator(-) ident(s)operator(\)) operator(*) integer(8)operator(\)) - ident(len) operator(=) operator(()ident(send) operator(-) ident(s)operator(\)) operator(*) integer(8)operator(;) - ident(bits) operator(=) integer(0)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(bitstr) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\)\);) - ident(t) operator(=) ident(RSTRING)operator(()ident(bitstr)operator(\)->)ident(ptr)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(i) operator(&) integer(7)operator(\)) ident(bits) operator(<<=) integer(1)operator(;) - reserved(else) ident(bits) operator(=) operator(*)ident(s)operator(++;) - operator(*)ident(t)operator(++) operator(=) operator(()ident(bits) operator(&) integer(128)operator(\)) operator(?) char('1') operator(:) char('0')operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) char('h')operator(:) - operator({) - ident(VALUE) ident(bitstr)operator(;) - pre_type(char) operator(*)ident(t)operator(;) - pre_type(int) ident(bits)operator(;) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(p)operator([-)integer(1)operator(]) operator(==) char('*') operator(||) ident(len) operator(>) operator(()ident(send) operator(-) ident(s)operator(\)) operator(*) integer(2)operator(\)) - ident(len) operator(=) operator(()ident(send) operator(-) ident(s)operator(\)) operator(*) integer(2)operator(;) - ident(bits) operator(=) integer(0)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(bitstr) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\)\);) - ident(t) operator(=) ident(RSTRING)operator(()ident(bitstr)operator(\)->)ident(ptr)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(i) operator(&) integer(1)operator(\)) - ident(bits) operator(>>=) integer(4)operator(;) - reserved(else) - ident(bits) operator(=) operator(*)ident(s)operator(++;) - operator(*)ident(t)operator(++) operator(=) ident(hexdigits)operator([)ident(bits) operator(&) integer(15)operator(];) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) char('H')operator(:) - operator({) - ident(VALUE) ident(bitstr)operator(;) - pre_type(char) operator(*)ident(t)operator(;) - pre_type(int) ident(bits)operator(;) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(p)operator([-)integer(1)operator(]) operator(==) char('*') operator(||) ident(len) operator(>) operator(()ident(send) operator(-) ident(s)operator(\)) operator(*) integer(2)operator(\)) - ident(len) operator(=) operator(()ident(send) operator(-) ident(s)operator(\)) operator(*) integer(2)operator(;) - ident(bits) operator(=) integer(0)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(bitstr) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\)\);) - ident(t) operator(=) ident(RSTRING)operator(()ident(bitstr)operator(\)->)ident(ptr)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(i) operator(&) integer(1)operator(\)) - ident(bits) operator(<<=) integer(4)operator(;) - reserved(else) - ident(bits) operator(=) operator(*)ident(s)operator(++;) - operator(*)ident(t)operator(++) operator(=) ident(hexdigits)operator([()ident(bits) operator(>>) integer(4)operator(\)) operator(&) integer(15)operator(];) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) char('c')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(char)operator(,)reserved(sizeof)operator(()pre_type(char)operator(\)\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(int) ident(c) operator(=) operator(*)ident(s)operator(++;) - reserved(if) operator(()ident(c) operator(>) operator(()pre_type(char)operator(\))integer(127)operator(\)) ident(c)operator(-=)integer(256)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(INT2FIX)operator(()ident(c)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('C')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(unsigned) pre_type(char)operator(,)reserved(sizeof)operator(()pre_type(unsigned) pre_type(char)operator(\)\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(char) ident(c) operator(=) operator(*)ident(s)operator(++;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(INT2FIX)operator(()ident(c)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('s')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(short)operator(,)integer(2)operator(\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(short) ident(tmp) operator(=) integer(0)operator(;) - ident(memcpy)operator(()ident(OFF16)operator((&)ident(tmp)operator(\),) ident(s)operator(,) ident(NATINT_LEN)operator(()pre_type(short)operator(,)integer(2)operator(\)\);) - ident(EXTEND16)operator(()ident(tmp)operator(\);) - ident(s) operator(+=) ident(NATINT_LEN)operator(()pre_type(short)operator(,)integer(2)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(INT2FIX)operator(()ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('S')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(unsigned) pre_type(short)operator(,)integer(2)operator(\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(short) ident(tmp) operator(=) integer(0)operator(;) - ident(memcpy)operator(()ident(OFF16)operator((&)ident(tmp)operator(\),) ident(s)operator(,) ident(NATINT_LEN)operator(()pre_type(unsigned) pre_type(short)operator(,)integer(2)operator(\)\);) - ident(s) operator(+=) ident(NATINT_LEN)operator(()pre_type(unsigned) pre_type(short)operator(,)integer(2)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(INT2FIX)operator(()ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('i')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(int)operator(,)reserved(sizeof)operator(()pre_type(int)operator(\)\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(int) ident(tmp)operator(;) - ident(memcpy)operator((&)ident(tmp)operator(,) ident(s)operator(,) reserved(sizeof)operator(()pre_type(int)operator(\)\);) - ident(s) operator(+=) reserved(sizeof)operator(()pre_type(int)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(INT2NUM)operator(()ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('I')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(unsigned) pre_type(int)operator(,)reserved(sizeof)operator(()pre_type(unsigned) pre_type(int)operator(\)\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(int) ident(tmp)operator(;) - ident(memcpy)operator((&)ident(tmp)operator(,) ident(s)operator(,) reserved(sizeof)operator(()pre_type(unsigned) pre_type(int)operator(\)\);) - ident(s) operator(+=) reserved(sizeof)operator(()pre_type(unsigned) pre_type(int)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(UINT2NUM)operator(()ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('l')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(long)operator(,)integer(4)operator(\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(long) ident(tmp) operator(=) integer(0)operator(;) - ident(memcpy)operator(()ident(OFF32)operator((&)ident(tmp)operator(\),) ident(s)operator(,) ident(NATINT_LEN)operator(()pre_type(long)operator(,)integer(4)operator(\)\);) - ident(EXTEND32)operator(()ident(tmp)operator(\);) - ident(s) operator(+=) ident(NATINT_LEN)operator(()pre_type(long)operator(,)integer(4)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(LONG2NUM)operator(()ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('L')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(unsigned) pre_type(long)operator(,)integer(4)operator(\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(long) ident(tmp) operator(=) integer(0)operator(;) - ident(memcpy)operator(()ident(OFF32)operator((&)ident(tmp)operator(\),) ident(s)operator(,) ident(NATINT_LEN)operator(()pre_type(unsigned) pre_type(long)operator(,)integer(4)operator(\)\);) - ident(s) operator(+=) ident(NATINT_LEN)operator(()pre_type(unsigned) pre_type(long)operator(,)integer(4)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(ULONG2NUM)operator(()ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('q')operator(:) - ident(PACK_LENGTH_ADJUST_SIZE)operator(()ident(QUAD_SIZE)operator(\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(char) operator(*)ident(tmp) operator(=) operator(()pre_type(char)operator(*\))ident(s)operator(;) - ident(s) operator(+=) ident(QUAD_SIZE)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_quad_unpack)operator(()ident(tmp)operator(,) integer(1)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('Q')operator(:) - ident(PACK_LENGTH_ADJUST_SIZE)operator(()ident(QUAD_SIZE)operator(\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(char) operator(*)ident(tmp) operator(=) operator(()pre_type(char)operator(*\))ident(s)operator(;) - ident(s) operator(+=) ident(QUAD_SIZE)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_quad_unpack)operator(()ident(tmp)operator(,) integer(0)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('n')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(unsigned) pre_type(short)operator(,)integer(2)operator(\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(short) ident(tmp) operator(=) integer(0)operator(;) - ident(memcpy)operator(()ident(OFF16B)operator((&)ident(tmp)operator(\),) ident(s)operator(,) ident(NATINT_LEN)operator(()pre_type(unsigned) pre_type(short)operator(,)integer(2)operator(\)\);) - ident(s) operator(+=) ident(NATINT_LEN)operator(()pre_type(unsigned) pre_type(short)operator(,)integer(2)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(UINT2NUM)operator(()ident(ntohs)operator(()ident(tmp)operator(\)\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('N')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(unsigned) pre_type(long)operator(,)integer(4)operator(\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(long) ident(tmp) operator(=) integer(0)operator(;) - ident(memcpy)operator(()ident(OFF32B)operator((&)ident(tmp)operator(\),) ident(s)operator(,) ident(NATINT_LEN)operator(()pre_type(unsigned) pre_type(long)operator(,)integer(4)operator(\)\);) - ident(s) operator(+=) ident(NATINT_LEN)operator(()pre_type(unsigned) pre_type(long)operator(,)integer(4)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(ULONG2NUM)operator(()ident(ntohl)operator(()ident(tmp)operator(\)\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('v')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(unsigned) pre_type(short)operator(,)integer(2)operator(\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(short) ident(tmp) operator(=) integer(0)operator(;) - ident(memcpy)operator(()ident(OFF16)operator((&)ident(tmp)operator(\),) ident(s)operator(,) ident(NATINT_LEN)operator(()pre_type(unsigned) pre_type(short)operator(,)integer(2)operator(\)\);) - ident(s) operator(+=) ident(NATINT_LEN)operator(()pre_type(unsigned) pre_type(short)operator(,)integer(2)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(UINT2NUM)operator(()ident(vtohs)operator(()ident(tmp)operator(\)\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('V')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(unsigned) pre_type(long)operator(,)integer(4)operator(\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(unsigned) pre_type(long) ident(tmp) operator(=) integer(0)operator(;) - ident(memcpy)operator(()ident(OFF32)operator((&)ident(tmp)operator(\),) ident(s)operator(,) ident(NATINT_LEN)operator(()pre_type(long)operator(,)integer(4)operator(\)\);) - ident(s) operator(+=) ident(NATINT_LEN)operator(()pre_type(long)operator(,)integer(4)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(ULONG2NUM)operator(()ident(vtohl)operator(()ident(tmp)operator(\)\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('f')operator(:) - reserved(case) char('F')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(float)operator(,)reserved(sizeof)operator(()pre_type(float)operator(\)\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(float) ident(tmp)operator(;) - ident(memcpy)operator((&)ident(tmp)operator(,) ident(s)operator(,) reserved(sizeof)operator(()pre_type(float)operator(\)\);) - ident(s) operator(+=) reserved(sizeof)operator(()pre_type(float)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_float_new)operator((()pre_type(double)operator(\))ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('e')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(float)operator(,)reserved(sizeof)operator(()pre_type(float)operator(\)\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(float) ident(tmp)operator(;) - ident(FLOAT_CONVWITH)operator(()ident(ftmp)operator(\);) - - ident(memcpy)operator((&)ident(tmp)operator(,) ident(s)operator(,) reserved(sizeof)operator(()pre_type(float)operator(\)\);) - ident(s) operator(+=) reserved(sizeof)operator(()pre_type(float)operator(\);) - ident(tmp) operator(=) ident(VTOHF)operator(()ident(tmp)operator(,)ident(ftmp)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_float_new)operator((()pre_type(double)operator(\))ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('E')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(double)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(double) ident(tmp)operator(;) - ident(DOUBLE_CONVWITH)operator(()ident(dtmp)operator(\);) - - ident(memcpy)operator((&)ident(tmp)operator(,) ident(s)operator(,) reserved(sizeof)operator(()pre_type(double)operator(\)\);) - ident(s) operator(+=) reserved(sizeof)operator(()pre_type(double)operator(\);) - ident(tmp) operator(=) ident(VTOHD)operator(()ident(tmp)operator(,)ident(dtmp)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_float_new)operator(()ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('D')operator(:) - reserved(case) char('d')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(double)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(double) ident(tmp)operator(;) - ident(memcpy)operator((&)ident(tmp)operator(,) ident(s)operator(,) reserved(sizeof)operator(()pre_type(double)operator(\)\);) - ident(s) operator(+=) reserved(sizeof)operator(()pre_type(double)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_float_new)operator(()ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('g')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(float)operator(,)reserved(sizeof)operator(()pre_type(float)operator(\)\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(float) ident(tmp)operator(;) - ident(FLOAT_CONVWITH)operator(()ident(ftmp)operator(;\)) - - ident(memcpy)operator((&)ident(tmp)operator(,) ident(s)operator(,) reserved(sizeof)operator(()pre_type(float)operator(\)\);) - ident(s) operator(+=) reserved(sizeof)operator(()pre_type(float)operator(\);) - ident(tmp) operator(=) ident(NTOHF)operator(()ident(tmp)operator(,)ident(ftmp)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_float_new)operator((()pre_type(double)operator(\))ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('G')operator(:) - ident(PACK_LENGTH_ADJUST)operator(()pre_type(double)operator(,)reserved(sizeof)operator(()pre_type(double)operator(\)\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - pre_type(double) ident(tmp)operator(;) - ident(DOUBLE_CONVWITH)operator(()ident(dtmp)operator(\);) - - ident(memcpy)operator((&)ident(tmp)operator(,) ident(s)operator(,) reserved(sizeof)operator(()pre_type(double)operator(\)\);) - ident(s) operator(+=) reserved(sizeof)operator(()pre_type(double)operator(\);) - ident(tmp) operator(=) ident(NTOHD)operator(()ident(tmp)operator(,)ident(dtmp)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_float_new)operator(()ident(tmp)operator(\)\);) - operator(}) - ident(PACK_ITEM_ADJUST)operator((\);) - reserved(break)operator(;) - - reserved(case) char('U')operator(:) - reserved(if) operator(()ident(len) operator(>) ident(send) operator(-) ident(s)operator(\)) ident(len) operator(=) ident(send) operator(-) ident(s)operator(;) - reserved(while) operator(()ident(len) operator(>) integer(0) operator(&&) ident(s) operator(<) ident(send)operator(\)) operator({) - pre_type(long) ident(alen) operator(=) ident(send) operator(-) ident(s)operator(;) - pre_type(unsigned) pre_type(long) ident(l)operator(;) - - ident(l) operator(=) ident(utf8_to_uv)operator(()ident(s)operator(,) operator(&)ident(alen)operator(\);) - ident(s) operator(+=) ident(alen)operator(;) ident(len)operator(--;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(ULONG2NUM)operator(()ident(l)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('u')operator(:) - operator({) - ident(VALUE) ident(buf) operator(=) ident(infected_str_new)operator(()integer(0)operator(,) operator(()ident(send) operator(-) ident(s)operator(\)*)integer(3)operator(/)integer(4)operator(,) ident(str)operator(\);) - pre_type(char) operator(*)ident(ptr) operator(=) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(ptr)operator(;) - pre_type(long) ident(total) operator(=) integer(0)operator(;) - - reserved(while) operator(()ident(s) operator(<) ident(send) operator(&&) operator(*)ident(s) operator(>) char(' ') operator(&&) operator(*)ident(s) operator(<) char('a')operator(\)) operator({) - pre_type(long) ident(a)operator(,)ident(b)operator(,)ident(c)operator(,)ident(d)operator(;) - pre_type(char) ident(hunk)operator([)integer(4)operator(];) - - ident(hunk)operator([)integer(3)operator(]) operator(=) char('\\0')operator(;) - ident(len) operator(=) operator((*)ident(s)operator(++) operator(-) char(' ')operator(\)) operator(&) oct(077)operator(;) - ident(total) operator(+=) ident(len)operator(;) - reserved(if) operator(()ident(total) operator(>) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(len)operator(\)) operator({) - ident(len) operator(-=) ident(total) operator(-) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(len)operator(;) - ident(total) operator(=) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(len)operator(;) - operator(}) - - reserved(while) operator(()ident(len) operator(>) integer(0)operator(\)) operator({) - pre_type(long) ident(mlen) operator(=) ident(len) operator(>) integer(3) operator(?) integer(3) operator(:) ident(len)operator(;) - - reserved(if) operator(()ident(s) operator(<) ident(send) operator(&&) operator(*)ident(s) operator(>=) char(' ')operator(\)) - ident(a) operator(=) operator((*)ident(s)operator(++) operator(-) char(' ')operator(\)) operator(&) oct(077)operator(;) - reserved(else) - ident(a) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(s) operator(<) ident(send) operator(&&) operator(*)ident(s) operator(>=) char(' ')operator(\)) - ident(b) operator(=) operator((*)ident(s)operator(++) operator(-) char(' ')operator(\)) operator(&) oct(077)operator(;) - reserved(else) - ident(b) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(s) operator(<) ident(send) operator(&&) operator(*)ident(s) operator(>=) char(' ')operator(\)) - ident(c) operator(=) operator((*)ident(s)operator(++) operator(-) char(' ')operator(\)) operator(&) oct(077)operator(;) - reserved(else) - ident(c) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(s) operator(<) ident(send) operator(&&) operator(*)ident(s) operator(>=) char(' ')operator(\)) - ident(d) operator(=) operator((*)ident(s)operator(++) operator(-) char(' ')operator(\)) operator(&) oct(077)operator(;) - reserved(else) - ident(d) operator(=) integer(0)operator(;) - ident(hunk)operator([)integer(0)operator(]) operator(=) ident(a) operator(<<) integer(2) operator(|) ident(b) operator(>>) integer(4)operator(;) - ident(hunk)operator([)integer(1)operator(]) operator(=) ident(b) operator(<<) integer(4) operator(|) ident(c) operator(>>) integer(2)operator(;) - ident(hunk)operator([)integer(2)operator(]) operator(=) ident(c) operator(<<) integer(6) operator(|) ident(d)operator(;) - ident(memcpy)operator(()ident(ptr)operator(,) ident(hunk)operator(,) ident(mlen)operator(\);) - ident(ptr) operator(+=) ident(mlen)operator(;) - ident(len) operator(-=) ident(mlen)operator(;) - operator(}) - reserved(if) operator((*)ident(s) operator(==) char('\\r')operator(\)) ident(s)operator(++;) - reserved(if) operator((*)ident(s) operator(==) char('\\n')operator(\)) ident(s)operator(++;) - reserved(else) reserved(if) operator(()ident(s) operator(<) ident(send) operator(&&) operator(()ident(s)operator(+)integer(1) operator(==) ident(send) operator(||) ident(s)operator([)integer(1)operator(]) operator(==) char('\\n')operator(\)\)) - ident(s) operator(+=) integer(2)operator(;) comment(/* possible checksum byte */) - operator(}) - - ident(RSTRING)operator(()ident(buf)operator(\)->)ident(ptr)operator([)ident(total)operator(]) operator(=) char('\\0')operator(;) - ident(RSTRING)operator(()ident(buf)operator(\)->)ident(len) operator(=) ident(total)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(buf)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('m')operator(:) - operator({) - ident(VALUE) ident(buf) operator(=) ident(infected_str_new)operator(()integer(0)operator(,) operator(()ident(send) operator(-) ident(s)operator(\)*)integer(3)operator(/)integer(4)operator(,) ident(str)operator(\);) - pre_type(char) operator(*)ident(ptr) operator(=) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(ptr)operator(;) - pre_type(int) ident(a) operator(=) operator(-)integer(1)operator(,)ident(b) operator(=) operator(-)integer(1)operator(,)ident(c) operator(=) integer(0)operator(,)ident(d)operator(;) - directive(static) pre_type(int) ident(first) operator(=) integer(1)operator(;) - directive(static) pre_type(int) ident(b64_xtable)operator([)integer(256)operator(];) - - reserved(if) operator(()ident(first)operator(\)) operator({) - pre_type(int) ident(i)operator(;) - ident(first) operator(=) integer(0)operator(;) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) integer(256)operator(;) ident(i)operator(++\)) operator({) - ident(b64_xtable)operator([)ident(i)operator(]) operator(=) operator(-)integer(1)operator(;) - operator(}) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) integer(64)operator(;) ident(i)operator(++\)) operator({) - ident(b64_xtable)operator([()pre_type(int)operator(\))ident(b64_table)operator([)ident(i)operator(]]) operator(=) ident(i)operator(;) - operator(}) - operator(}) - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - ident(a) operator(=) ident(b) operator(=) ident(c) operator(=) ident(d) operator(=) operator(-)integer(1)operator(;) - reserved(while)operator((()ident(a) operator(=) ident(b64_xtable)operator([()pre_type(int)operator(\)(*()pre_type(unsigned) pre_type(char)operator(*\))ident(s)operator(\)]\)) operator(==) operator(-)integer(1) operator(&&) ident(s) operator(<) ident(send)operator(\)) operator({) ident(s)operator(++;) operator(}) - reserved(if)operator(() ident(s) operator(>=) ident(send) operator(\)) reserved(break)operator(;) - ident(s)operator(++;) - reserved(while)operator((()ident(b) operator(=) ident(b64_xtable)operator([()pre_type(int)operator(\)(*()pre_type(unsigned) pre_type(char)operator(*\))ident(s)operator(\)]\)) operator(==) operator(-)integer(1) operator(&&) ident(s) operator(<) ident(send)operator(\)) operator({) ident(s)operator(++;) operator(}) - reserved(if)operator(() ident(s) operator(>=) ident(send) operator(\)) reserved(break)operator(;) - ident(s)operator(++;) - reserved(while)operator((()ident(c) operator(=) ident(b64_xtable)operator([()pre_type(int)operator(\)(*()pre_type(unsigned) pre_type(char)operator(*\))ident(s)operator(\)]\)) operator(==) operator(-)integer(1) operator(&&) ident(s) operator(<) ident(send)operator(\)) operator({) reserved(if)operator(() operator(*)ident(s) operator(==) char('=') operator(\)) reserved(break)operator(;) ident(s)operator(++;) operator(}) - reserved(if)operator(() operator(*)ident(s) operator(==) char('=') operator(||) ident(s) operator(>=) ident(send) operator(\)) reserved(break)operator(;) - ident(s)operator(++;) - reserved(while)operator((()ident(d) operator(=) ident(b64_xtable)operator([()pre_type(int)operator(\)(*()pre_type(unsigned) pre_type(char)operator(*\))ident(s)operator(\)]\)) operator(==) operator(-)integer(1) operator(&&) ident(s) operator(<) ident(send)operator(\)) operator({) reserved(if)operator(() operator(*)ident(s) operator(==) char('=') operator(\)) reserved(break)operator(;) ident(s)operator(++;) operator(}) - reserved(if)operator(() operator(*)ident(s) operator(==) char('=') operator(||) ident(s) operator(>=) ident(send) operator(\)) reserved(break)operator(;) - ident(s)operator(++;) - operator(*)ident(ptr)operator(++) operator(=) ident(a) operator(<<) integer(2) operator(|) ident(b) operator(>>) integer(4)operator(;) - operator(*)ident(ptr)operator(++) operator(=) ident(b) operator(<<) integer(4) operator(|) ident(c) operator(>>) integer(2)operator(;) - operator(*)ident(ptr)operator(++) operator(=) ident(c) operator(<<) integer(6) operator(|) ident(d)operator(;) - operator(}) - reserved(if) operator(()ident(a) operator(!=) operator(-)integer(1) operator(&&) ident(b) operator(!=) operator(-)integer(1)operator(\)) operator({) - reserved(if) operator(()ident(c) operator(==) operator(-)integer(1) operator(&&) operator(*)ident(s) operator(==) char('=')operator(\)) - operator(*)ident(ptr)operator(++) operator(=) ident(a) operator(<<) integer(2) operator(|) ident(b) operator(>>) integer(4)operator(;) - reserved(else) reserved(if) operator(()ident(c) operator(!=) operator(-)integer(1) operator(&&) operator(*)ident(s) operator(==) char('=')operator(\)) operator({) - operator(*)ident(ptr)operator(++) operator(=) ident(a) operator(<<) integer(2) operator(|) ident(b) operator(>>) integer(4)operator(;) - operator(*)ident(ptr)operator(++) operator(=) ident(b) operator(<<) integer(4) operator(|) ident(c) operator(>>) integer(2)operator(;) - operator(}) - operator(}) - operator(*)ident(ptr) operator(=) char('\\0')operator(;) - ident(RSTRING)operator(()ident(buf)operator(\)->)ident(len) operator(=) ident(ptr) operator(-) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(ptr)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(buf)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('M')operator(:) - operator({) - ident(VALUE) ident(buf) operator(=) ident(infected_str_new)operator(()integer(0)operator(,) ident(send) operator(-) ident(s)operator(,) ident(str)operator(\);) - pre_type(char) operator(*)ident(ptr) operator(=) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(ptr)operator(;) - pre_type(int) ident(c1)operator(,) ident(c2)operator(;) - - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - reserved(if) operator((*)ident(s) operator(==) char('=')operator(\)) operator({) - reserved(if) operator((++)ident(s) operator(==) ident(send)operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(s)operator(+)integer(1) operator(<) ident(send) operator(&&) operator(*)ident(s) operator(==) char('\\r') operator(&&) operator(*()ident(s)operator(+)integer(1)operator(\)) operator(==) char('\\n')operator(\)) - ident(s)operator(++;) - reserved(if) operator((*)ident(s) operator(!=) char('\\n')operator(\)) operator({) - reserved(if) operator((()ident(c1) operator(=) ident(hex2num)operator((*)ident(s)operator(\)\)) operator(==) operator(-)integer(1)operator(\)) reserved(break)operator(;) - reserved(if) operator((++)ident(s) operator(==) ident(send)operator(\)) reserved(break)operator(;) - reserved(if) operator((()ident(c2) operator(=) ident(hex2num)operator((*)ident(s)operator(\)\)) operator(==) operator(-)integer(1)operator(\)) reserved(break)operator(;) - operator(*)ident(ptr)operator(++) operator(=) ident(c1) operator(<<) integer(4) operator(|) ident(c2)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - operator(*)ident(ptr)operator(++) operator(=) operator(*)ident(s)operator(;) - operator(}) - ident(s)operator(++;) - operator(}) - operator(*)ident(ptr) operator(=) char('\\0')operator(;) - ident(RSTRING)operator(()ident(buf)operator(\)->)ident(len) operator(=) ident(ptr) operator(-) ident(RSTRING)operator(()ident(buf)operator(\)->)ident(ptr)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(buf)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('@')operator(:) - reserved(if) operator(()ident(len) operator(>) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(len)operator(;) - reserved(break)operator(;) - - reserved(case) char('X')operator(:) - reserved(if) operator(()ident(len) operator(>) ident(s) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - ident(s) operator(-=) ident(len)operator(;) - reserved(break)operator(;) - - reserved(case) char('x')operator(:) - reserved(if) operator(()ident(len) operator(>) ident(send) operator(-) ident(s)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - ident(s) operator(+=) ident(len)operator(;) - reserved(break)operator(;) - - reserved(case) char('P')operator(:) - reserved(if) operator(()reserved(sizeof)operator(()pre_type(char) operator(*\)) operator(<=) ident(send) operator(-) ident(s)operator(\)) operator({) - pre_type(char) operator(*)ident(t)operator(;) - ident(VALUE) ident(tmp)operator(;) - - ident(memcpy)operator((&)ident(t)operator(,) ident(s)operator(,) reserved(sizeof)operator(()pre_type(char) operator(*\)\);) - ident(s) operator(+=) reserved(sizeof)operator(()pre_type(char) operator(*\);) - - reserved(if) operator(()ident(t)operator(\)) operator({) - ident(VALUE) ident(a)operator(,) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - - reserved(if) operator((!()ident(a) operator(=) ident(rb_str_associated)operator(()ident(str)operator(\)\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(p) operator(=) ident(RARRAY)operator(()ident(a)operator(\)->)ident(ptr)operator(;) - ident(pend) operator(=) ident(p) operator(+) ident(RARRAY)operator(()ident(a)operator(\)->)ident(len)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator(()ident(TYPE)operator((*)ident(p)operator(\)) operator(==) ident(T_STRING) operator(&&) ident(RSTRING)operator((*)ident(p)operator(\)->)ident(ptr) operator(==) ident(t)operator(\)) operator({) - reserved(if) operator(()ident(len) operator(<) ident(RSTRING)operator((*)ident(p)operator(\)->)ident(len)operator(\)) operator({) - ident(tmp) operator(=) ident(rb_tainted_str_new)operator(()ident(t)operator(,) ident(len)operator(\);) - ident(rb_str_associate)operator(()ident(tmp)operator(,) ident(a)operator(\);) - operator(}) - reserved(else) operator({) - ident(tmp) operator(=) operator(*)ident(p)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - ident(p)operator(++;) - operator(}) - reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(tmp) operator(=) ident(Qnil)operator(;) - operator(}) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(tmp)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('p')operator(:) - reserved(if) operator(()ident(len) operator(>) operator(()ident(send) operator(-) ident(s)operator(\)) operator(/) reserved(sizeof)operator(()pre_type(char) operator(*\)\)) - ident(len) operator(=) operator(()ident(send) operator(-) ident(s)operator(\)) operator(/) reserved(sizeof)operator(()pre_type(char) operator(*\);) - reserved(while) operator(()ident(len)operator(--) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(send) operator(-) ident(s) operator(<) reserved(sizeof)operator(()pre_type(char) operator(*\)\)) - reserved(break)operator(;) - reserved(else) operator({) - ident(VALUE) ident(tmp)operator(;) - pre_type(char) operator(*)ident(t)operator(;) - - ident(memcpy)operator((&)ident(t)operator(,) ident(s)operator(,) reserved(sizeof)operator(()pre_type(char) operator(*\)\);) - ident(s) operator(+=) reserved(sizeof)operator(()pre_type(char) operator(*\);) - - reserved(if) operator(()ident(t)operator(\)) operator({) - ident(VALUE) ident(a)operator(,) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - - reserved(if) operator((!()ident(a) operator(=) ident(rb_str_associated)operator(()ident(str)operator(\)\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(p) operator(=) ident(RARRAY)operator(()ident(a)operator(\)->)ident(ptr)operator(;) - ident(pend) operator(=) ident(p) operator(+) ident(RARRAY)operator(()ident(a)operator(\)->)ident(len)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator(()ident(TYPE)operator((*)ident(p)operator(\)) operator(==) ident(T_STRING) operator(&&) ident(RSTRING)operator((*)ident(p)operator(\)->)ident(ptr) operator(==) ident(t)operator(\)) operator({) - ident(tmp) operator(=) operator(*)ident(p)operator(;) - reserved(break)operator(;) - operator(}) - ident(p)operator(++;) - operator(}) - reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(tmp) operator(=) ident(Qnil)operator(;) - operator(}) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(tmp)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) char('w')operator(:) - operator({) - pre_type(unsigned) pre_type(long) ident(ul) operator(=) integer(0)operator(;) - pre_type(unsigned) pre_type(long) ident(ulmask) operator(=) hex(0xfe)ident(UL) operator(<<) operator((()reserved(sizeof)operator(()pre_type(unsigned) pre_type(long)operator(\)) operator(-) integer(1)operator(\)) operator(*) integer(8)operator(\);) - - reserved(while) operator(()ident(len) operator(>) integer(0) operator(&&) ident(s) operator(<) ident(send)operator(\)) operator({) - ident(ul) operator(<<=) integer(7)operator(;) - ident(ul) operator(|=) operator((*)ident(s) operator(&) hex(0x7f)operator(\);) - reserved(if) operator((!(*)ident(s)operator(++) operator(&) hex(0x80)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(ULONG2NUM)operator(()ident(ul)operator(\)\);) - ident(len)operator(--;) - ident(ul) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ul) operator(&) ident(ulmask)operator(\)) operator({) - ident(VALUE) ident(big) operator(=) ident(rb_uint2big)operator(()ident(ul)operator(\);) - ident(VALUE) ident(big128) operator(=) ident(rb_uint2big)operator(()integer(128)operator(\);) - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - ident(big) operator(=) ident(rb_big_mul)operator(()ident(big)operator(,) ident(big128)operator(\);) - ident(big) operator(=) ident(rb_big_plus)operator(()ident(big)operator(,) ident(rb_uint2big)operator((*)ident(s) operator(&) hex(0x7f)operator(\)\);) - reserved(if) operator((!(*)ident(s)operator(++) operator(&) hex(0x80)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(big)operator(\);) - ident(len)operator(--;) - ident(ul) operator(=) integer(0)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - operator(}) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) - - reserved(return) ident(ary)operator(;) -operator(}) - -preprocessor(#define) ident(BYTEWIDTH) integer(8) - -directive(static) pre_type(int) -ident(uv_to_utf8)operator(()ident(buf)operator(,) ident(uv)operator(\)) - pre_type(char) operator(*)ident(buf)operator(;) - pre_type(unsigned) pre_type(long) ident(uv)operator(;) -operator({) - reserved(if) operator(()ident(uv) operator(<=) hex(0x7f)operator(\)) operator({) - ident(buf)operator([)integer(0)operator(]) operator(=) operator(()pre_type(char)operator(\))ident(uv)operator(;) - reserved(return) integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(uv) operator(<=) hex(0x7ff)operator(\)) operator({) - ident(buf)operator([)integer(0)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(6)operator(\)&)hex(0xff)operator(\)|)hex(0xc0)operator(;) - ident(buf)operator([)integer(1)operator(]) operator(=) operator(()ident(uv)operator(&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - reserved(return) integer(2)operator(;) - operator(}) - reserved(if) operator(()ident(uv) operator(<=) hex(0xffff)operator(\)) operator({) - ident(buf)operator([)integer(0)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(12)operator(\)&)hex(0xff)operator(\)|)hex(0xe0)operator(;) - ident(buf)operator([)integer(1)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(6)operator(\)&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - ident(buf)operator([)integer(2)operator(]) operator(=) operator(()ident(uv)operator(&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - reserved(return) integer(3)operator(;) - operator(}) - reserved(if) operator(()ident(uv) operator(<=) hex(0x1fffff)operator(\)) operator({) - ident(buf)operator([)integer(0)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(18)operator(\)&)hex(0xff)operator(\)|)hex(0xf0)operator(;) - ident(buf)operator([)integer(1)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(12)operator(\)&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - ident(buf)operator([)integer(2)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(6)operator(\)&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - ident(buf)operator([)integer(3)operator(]) operator(=) operator(()ident(uv)operator(&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - reserved(return) integer(4)operator(;) - operator(}) - reserved(if) operator(()ident(uv) operator(<=) hex(0x3ffffff)operator(\)) operator({) - ident(buf)operator([)integer(0)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(24)operator(\)&)hex(0xff)operator(\)|)hex(0xf8)operator(;) - ident(buf)operator([)integer(1)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(18)operator(\)&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - ident(buf)operator([)integer(2)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(12)operator(\)&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - ident(buf)operator([)integer(3)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(6)operator(\)&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - ident(buf)operator([)integer(4)operator(]) operator(=) operator(()ident(uv)operator(&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - reserved(return) integer(5)operator(;) - operator(}) - reserved(if) operator(()ident(uv) operator(<=) hex(0x7fffffff)operator(\)) operator({) - ident(buf)operator([)integer(0)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(30)operator(\)&)hex(0xff)operator(\)|)hex(0xfc)operator(;) - ident(buf)operator([)integer(1)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(24)operator(\)&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - ident(buf)operator([)integer(2)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(18)operator(\)&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - ident(buf)operator([)integer(3)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(12)operator(\)&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - ident(buf)operator([)integer(4)operator(]) operator(=) operator((()ident(uv)operator(>>)integer(6)operator(\)&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - ident(buf)operator([)integer(5)operator(]) operator(=) operator(()ident(uv)operator(&)hex(0x3f)operator(\)|)hex(0x80)operator(;) - reserved(return) integer(6)operator(;) - operator(}) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(\);) -operator(}) - -directive(static) directive(const) pre_type(unsigned) pre_type(long) ident(utf8_limits)operator([]) operator(=) operator({) - hex(0x0)operator(,) comment(/* 1 */) - hex(0x80)operator(,) comment(/* 2 */) - hex(0x800)operator(,) comment(/* 3 */) - hex(0x10000)operator(,) comment(/* 4 */) - hex(0x200000)operator(,) comment(/* 5 */) - hex(0x4000000)operator(,) comment(/* 6 */) - hex(0x80000000)operator(,) comment(/* 7 */) -operator(};) - -directive(static) pre_type(unsigned) pre_type(long) -ident(utf8_to_uv)operator(()ident(p)operator(,) ident(lenp)operator(\)) - pre_type(char) operator(*)ident(p)operator(;) - pre_type(long) operator(*)ident(lenp)operator(;) -operator({) - pre_type(int) ident(c) operator(=) operator(*)ident(p)operator(++) operator(&) hex(0xff)operator(;) - pre_type(unsigned) pre_type(long) ident(uv) operator(=) ident(c)operator(;) - pre_type(long) ident(n)operator(;) - - reserved(if) operator((!()ident(uv) operator(&) hex(0x80)operator(\)\)) operator({) - operator(*)ident(lenp) operator(=) integer(1)operator(;) - reserved(return) ident(uv)operator(;) - operator(}) - reserved(if) operator((!()ident(uv) operator(&) hex(0x40)operator(\)\)) operator({) - operator(*)ident(lenp) operator(=) integer(1)operator(;) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator((!()ident(uv) operator(&) hex(0x20)operator(\)\)) operator({) ident(n) operator(=) integer(2)operator(;) ident(uv) operator(&=) hex(0x1f)operator(;) operator(}) - reserved(else) reserved(if) operator((!()ident(uv) operator(&) hex(0x10)operator(\)\)) operator({) ident(n) operator(=) integer(3)operator(;) ident(uv) operator(&=) hex(0x0f)operator(;) operator(}) - reserved(else) reserved(if) operator((!()ident(uv) operator(&) hex(0x08)operator(\)\)) operator({) ident(n) operator(=) integer(4)operator(;) ident(uv) operator(&=) hex(0x07)operator(;) operator(}) - reserved(else) reserved(if) operator((!()ident(uv) operator(&) hex(0x04)operator(\)\)) operator({) ident(n) operator(=) integer(5)operator(;) ident(uv) operator(&=) hex(0x03)operator(;) operator(}) - reserved(else) reserved(if) operator((!()ident(uv) operator(&) hex(0x02)operator(\)\)) operator({) ident(n) operator(=) integer(6)operator(;) ident(uv) operator(&=) hex(0x01)operator(;) operator(}) - reserved(else) operator({) - operator(*)ident(lenp) operator(=) integer(1)operator(;) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(n) operator(>) operator(*)ident(lenp)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(n)operator(,) operator(*)ident(lenp)operator(\);) - operator(}) - operator(*)ident(lenp) operator(=) ident(n)operator(--;) - reserved(if) operator(()ident(n) operator(!=) integer(0)operator(\)) operator({) - reserved(while) operator(()ident(n)operator(--\)) operator({) - ident(c) operator(=) operator(*)ident(p)operator(++) operator(&) hex(0xff)operator(;) - reserved(if) operator((()ident(c) operator(&) hex(0xc0)operator(\)) operator(!=) hex(0x80)operator(\)) operator({) - operator(*)ident(lenp) operator(-=) ident(n) operator(+) integer(1)operator(;) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(else) operator({) - ident(c) operator(&=) hex(0x3f)operator(;) - ident(uv) operator(=) ident(uv) operator(<<) integer(6) operator(|) ident(c)operator(;) - operator(}) - operator(}) - operator(}) - ident(n) operator(=) operator(*)ident(lenp) operator(-) integer(1)operator(;) - reserved(if) operator(()ident(uv) operator(<) ident(utf8_limits)operator([)ident(n)operator(]\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(uv)operator(;) -operator(}) - -directive(void) -ident(Init_pack)operator((\)) -operator({) - ident(rb_define_method)operator(()ident(rb_cArray)operator(,) stringoperator(,) ident(pack_pack)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(pack_unpack)operator(,) integer(1)operator(\);) -operator(}) -comment(/* A Bison parser, made by GNU Bison 2.3. */) - -comment(/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C\) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option\) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */) - -comment(/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option\) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */) - -comment(/* C LALR(1\) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */) - -comment(/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */) - -comment(/* Identify Bison output. */) -preprocessor(#define) ident(YYBISON) integer(1) - -comment(/* Bison version. */) -preprocessor(#define) ident(YYBISON_VERSION) string - -comment(/* Skeleton name. */) -preprocessor(#define) ident(YYSKELETON_NAME) string - -comment(/* Pure parsers. */) -preprocessor(#define) ident(YYPURE) integer(0) - -comment(/* Using locations. */) -preprocessor(#define) ident(YYLSP_NEEDED) integer(0) - - - -comment(/* Tokens. */) -preprocessor(#ifndef) ident(YYTOKENTYPE) -preprocessor(# define) ident(YYTOKENTYPE) - comment(/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */) - reserved(enum) ident(yytokentype) operator({) - ident(kCLASS) operator(=) integer(258)operator(,) - ident(kMODULE) operator(=) integer(259)operator(,) - ident(kDEF) operator(=) integer(260)operator(,) - ident(kUNDEF) operator(=) integer(261)operator(,) - ident(kBEGIN) operator(=) integer(262)operator(,) - ident(kRESCUE) operator(=) integer(263)operator(,) - ident(kENSURE) operator(=) integer(264)operator(,) - ident(kEND) operator(=) integer(265)operator(,) - ident(kIF) operator(=) integer(266)operator(,) - ident(kUNLESS) operator(=) integer(267)operator(,) - ident(kTHEN) operator(=) integer(268)operator(,) - ident(kELSIF) operator(=) integer(269)operator(,) - ident(kELSE) operator(=) integer(270)operator(,) - ident(kCASE) operator(=) integer(271)operator(,) - ident(kWHEN) operator(=) integer(272)operator(,) - ident(kWHILE) operator(=) integer(273)operator(,) - ident(kUNTIL) operator(=) integer(274)operator(,) - ident(kFOR) operator(=) integer(275)operator(,) - ident(kBREAK) operator(=) integer(276)operator(,) - ident(kNEXT) operator(=) integer(277)operator(,) - ident(kREDO) operator(=) integer(278)operator(,) - ident(kRETRY) operator(=) integer(279)operator(,) - ident(kIN) operator(=) integer(280)operator(,) - ident(kDO) operator(=) integer(281)operator(,) - ident(kDO_COND) operator(=) integer(282)operator(,) - ident(kDO_BLOCK) operator(=) integer(283)operator(,) - ident(kRETURN) operator(=) integer(284)operator(,) - ident(kYIELD) operator(=) integer(285)operator(,) - ident(kSUPER) operator(=) integer(286)operator(,) - ident(kSELF) operator(=) integer(287)operator(,) - ident(kNIL) operator(=) integer(288)operator(,) - ident(kTRUE) operator(=) integer(289)operator(,) - ident(kFALSE) operator(=) integer(290)operator(,) - ident(kAND) operator(=) integer(291)operator(,) - ident(kOR) operator(=) integer(292)operator(,) - ident(kNOT) operator(=) integer(293)operator(,) - ident(kIF_MOD) operator(=) integer(294)operator(,) - ident(kUNLESS_MOD) operator(=) integer(295)operator(,) - ident(kWHILE_MOD) operator(=) integer(296)operator(,) - ident(kUNTIL_MOD) operator(=) integer(297)operator(,) - ident(kRESCUE_MOD) operator(=) integer(298)operator(,) - ident(kALIAS) operator(=) integer(299)operator(,) - ident(kDEFINED) operator(=) integer(300)operator(,) - ident(klBEGIN) operator(=) integer(301)operator(,) - ident(klEND) operator(=) integer(302)operator(,) - ident(k__LINE__) operator(=) integer(303)operator(,) - ident(k__FILE__) operator(=) integer(304)operator(,) - ident(tIDENTIFIER) operator(=) integer(305)operator(,) - ident(tFID) operator(=) integer(306)operator(,) - ident(tGVAR) operator(=) integer(307)operator(,) - ident(tIVAR) operator(=) integer(308)operator(,) - ident(tCONSTANT) operator(=) integer(309)operator(,) - ident(tCVAR) operator(=) integer(310)operator(,) - ident(tINTEGER) operator(=) integer(311)operator(,) - ident(tFLOAT) operator(=) integer(312)operator(,) - ident(tSTRING_CONTENT) operator(=) integer(313)operator(,) - ident(tNTH_REF) operator(=) integer(314)operator(,) - ident(tBACK_REF) operator(=) integer(315)operator(,) - ident(tREGEXP_END) operator(=) integer(316)operator(,) - ident(tUPLUS) operator(=) integer(317)operator(,) - ident(tUMINUS) operator(=) integer(318)operator(,) - ident(tPOW) operator(=) integer(319)operator(,) - ident(tCMP) operator(=) integer(320)operator(,) - ident(tEQ) operator(=) integer(321)operator(,) - ident(tEQQ) operator(=) integer(322)operator(,) - ident(tNEQ) operator(=) integer(323)operator(,) - ident(tGEQ) operator(=) integer(324)operator(,) - ident(tLEQ) operator(=) integer(325)operator(,) - ident(tANDOP) operator(=) integer(326)operator(,) - ident(tOROP) operator(=) integer(327)operator(,) - ident(tMATCH) operator(=) integer(328)operator(,) - ident(tNMATCH) operator(=) integer(329)operator(,) - ident(tDOT2) operator(=) integer(330)operator(,) - ident(tDOT3) operator(=) integer(331)operator(,) - ident(tAREF) operator(=) integer(332)operator(,) - ident(tASET) operator(=) integer(333)operator(,) - ident(tLSHFT) operator(=) integer(334)operator(,) - ident(tRSHFT) operator(=) integer(335)operator(,) - ident(tCOLON2) operator(=) integer(336)operator(,) - ident(tCOLON3) operator(=) integer(337)operator(,) - ident(tOP_ASGN) operator(=) integer(338)operator(,) - ident(tASSOC) operator(=) integer(339)operator(,) - ident(tLPAREN) operator(=) integer(340)operator(,) - ident(tLPAREN_ARG) operator(=) integer(341)operator(,) - ident(tRPAREN) operator(=) integer(342)operator(,) - ident(tLBRACK) operator(=) integer(343)operator(,) - ident(tLBRACE) operator(=) integer(344)operator(,) - ident(tLBRACE_ARG) operator(=) integer(345)operator(,) - ident(tSTAR) operator(=) integer(346)operator(,) - ident(tAMPER) operator(=) integer(347)operator(,) - ident(tSYMBEG) operator(=) integer(348)operator(,) - ident(tSTRING_BEG) operator(=) integer(349)operator(,) - ident(tXSTRING_BEG) operator(=) integer(350)operator(,) - ident(tREGEXP_BEG) operator(=) integer(351)operator(,) - ident(tWORDS_BEG) operator(=) integer(352)operator(,) - ident(tQWORDS_BEG) operator(=) integer(353)operator(,) - ident(tSTRING_DBEG) operator(=) integer(354)operator(,) - ident(tSTRING_DVAR) operator(=) integer(355)operator(,) - ident(tSTRING_END) operator(=) integer(356)operator(,) - ident(tLOWEST) operator(=) integer(357)operator(,) - ident(tUMINUS_NUM) operator(=) integer(358)operator(,) - ident(tLAST_TOKEN) operator(=) integer(359) - operator(};) -preprocessor(#endif) -comment(/* Tokens. */) -preprocessor(#define) ident(kCLASS) integer(258) -preprocessor(#define) ident(kMODULE) integer(259) -preprocessor(#define) ident(kDEF) integer(260) -preprocessor(#define) ident(kUNDEF) integer(261) -preprocessor(#define) ident(kBEGIN) integer(262) -preprocessor(#define) ident(kRESCUE) integer(263) -preprocessor(#define) ident(kENSURE) integer(264) -preprocessor(#define) ident(kEND) integer(265) -preprocessor(#define) ident(kIF) integer(266) -preprocessor(#define) ident(kUNLESS) integer(267) -preprocessor(#define) ident(kTHEN) integer(268) -preprocessor(#define) ident(kELSIF) integer(269) -preprocessor(#define) ident(kELSE) integer(270) -preprocessor(#define) ident(kCASE) integer(271) -preprocessor(#define) ident(kWHEN) integer(272) -preprocessor(#define) ident(kWHILE) integer(273) -preprocessor(#define) ident(kUNTIL) integer(274) -preprocessor(#define) ident(kFOR) integer(275) -preprocessor(#define) ident(kBREAK) integer(276) -preprocessor(#define) ident(kNEXT) integer(277) -preprocessor(#define) ident(kREDO) integer(278) -preprocessor(#define) ident(kRETRY) integer(279) -preprocessor(#define) ident(kIN) integer(280) -preprocessor(#define) ident(kDO) integer(281) -preprocessor(#define) ident(kDO_COND) integer(282) -preprocessor(#define) ident(kDO_BLOCK) integer(283) -preprocessor(#define) ident(kRETURN) integer(284) -preprocessor(#define) ident(kYIELD) integer(285) -preprocessor(#define) ident(kSUPER) integer(286) -preprocessor(#define) ident(kSELF) integer(287) -preprocessor(#define) ident(kNIL) integer(288) -preprocessor(#define) ident(kTRUE) integer(289) -preprocessor(#define) ident(kFALSE) integer(290) -preprocessor(#define) ident(kAND) integer(291) -preprocessor(#define) ident(kOR) integer(292) -preprocessor(#define) ident(kNOT) integer(293) -preprocessor(#define) ident(kIF_MOD) integer(294) -preprocessor(#define) ident(kUNLESS_MOD) integer(295) -preprocessor(#define) ident(kWHILE_MOD) integer(296) -preprocessor(#define) ident(kUNTIL_MOD) integer(297) -preprocessor(#define) ident(kRESCUE_MOD) integer(298) -preprocessor(#define) ident(kALIAS) integer(299) -preprocessor(#define) ident(kDEFINED) integer(300) -preprocessor(#define) ident(klBEGIN) integer(301) -preprocessor(#define) ident(klEND) integer(302) -preprocessor(#define) ident(k__LINE__) integer(303) -preprocessor(#define) ident(k__FILE__) integer(304) -preprocessor(#define) ident(tIDENTIFIER) integer(305) -preprocessor(#define) ident(tFID) integer(306) -preprocessor(#define) ident(tGVAR) integer(307) -preprocessor(#define) ident(tIVAR) integer(308) -preprocessor(#define) ident(tCONSTANT) integer(309) -preprocessor(#define) ident(tCVAR) integer(310) -preprocessor(#define) ident(tINTEGER) integer(311) -preprocessor(#define) ident(tFLOAT) integer(312) -preprocessor(#define) ident(tSTRING_CONTENT) integer(313) -preprocessor(#define) ident(tNTH_REF) integer(314) -preprocessor(#define) ident(tBACK_REF) integer(315) -preprocessor(#define) ident(tREGEXP_END) integer(316) -preprocessor(#define) ident(tUPLUS) integer(317) -preprocessor(#define) ident(tUMINUS) integer(318) -preprocessor(#define) ident(tPOW) integer(319) -preprocessor(#define) ident(tCMP) integer(320) -preprocessor(#define) ident(tEQ) integer(321) -preprocessor(#define) ident(tEQQ) integer(322) -preprocessor(#define) ident(tNEQ) integer(323) -preprocessor(#define) ident(tGEQ) integer(324) -preprocessor(#define) ident(tLEQ) integer(325) -preprocessor(#define) ident(tANDOP) integer(326) -preprocessor(#define) ident(tOROP) integer(327) -preprocessor(#define) ident(tMATCH) integer(328) -preprocessor(#define) ident(tNMATCH) integer(329) -preprocessor(#define) ident(tDOT2) integer(330) -preprocessor(#define) ident(tDOT3) integer(331) -preprocessor(#define) ident(tAREF) integer(332) -preprocessor(#define) ident(tASET) integer(333) -preprocessor(#define) ident(tLSHFT) integer(334) -preprocessor(#define) ident(tRSHFT) integer(335) -preprocessor(#define) ident(tCOLON2) integer(336) -preprocessor(#define) ident(tCOLON3) integer(337) -preprocessor(#define) ident(tOP_ASGN) integer(338) -preprocessor(#define) ident(tASSOC) integer(339) -preprocessor(#define) ident(tLPAREN) integer(340) -preprocessor(#define) ident(tLPAREN_ARG) integer(341) -preprocessor(#define) ident(tRPAREN) integer(342) -preprocessor(#define) ident(tLBRACK) integer(343) -preprocessor(#define) ident(tLBRACE) integer(344) -preprocessor(#define) ident(tLBRACE_ARG) integer(345) -preprocessor(#define) ident(tSTAR) integer(346) -preprocessor(#define) ident(tAMPER) integer(347) -preprocessor(#define) ident(tSYMBEG) integer(348) -preprocessor(#define) ident(tSTRING_BEG) integer(349) -preprocessor(#define) ident(tXSTRING_BEG) integer(350) -preprocessor(#define) ident(tREGEXP_BEG) integer(351) -preprocessor(#define) ident(tWORDS_BEG) integer(352) -preprocessor(#define) ident(tQWORDS_BEG) integer(353) -preprocessor(#define) ident(tSTRING_DBEG) integer(354) -preprocessor(#define) ident(tSTRING_DVAR) integer(355) -preprocessor(#define) ident(tSTRING_END) integer(356) -preprocessor(#define) ident(tLOWEST) integer(357) -preprocessor(#define) ident(tUMINUS_NUM) integer(358) -preprocessor(#define) ident(tLAST_TOKEN) integer(359) - - - - -comment(/* Copy the first part of user declarations. */) -preprocessor(#line) integer(13) string - - -preprocessor(#define) ident(YYDEBUG) integer(1) -preprocessor(#define) ident(YYERROR_VERBOSE) integer(1) -preprocessor(#ifndef) ident(YYSTACK_USE_ALLOCA) -preprocessor(#define) ident(YYSTACK_USE_ALLOCA) integer(0) -preprocessor(#endif) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("env.h") -preprocessor(#include) include("intern.h") -preprocessor(#include) include("node.h") -preprocessor(#include) include("st.h") -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#define) ident(YYMALLOC) ident(rb_parser_malloc) -preprocessor(#define) ident(YYREALLOC) ident(rb_parser_realloc) -preprocessor(#define) ident(YYCALLOC) ident(rb_parser_calloc) -preprocessor(#define) ident(YYFREE) ident(rb_parser_free) -preprocessor(#define) ident(malloc) ident(YYMALLOC) -preprocessor(#define) ident(realloc) ident(YYREALLOC) -preprocessor(#define) ident(calloc) ident(YYCALLOC) -preprocessor(#define) ident(free) ident(YYFREE) -directive(static) directive(void) operator(*)ident(rb_parser_malloc) ident(_)operator((()ident(size_t)operator(\)\);) -directive(static) directive(void) operator(*)ident(rb_parser_realloc) ident(_)operator((()directive(void) operator(*,) ident(size_t)operator(\)\);) -directive(static) directive(void) operator(*)ident(rb_parser_calloc) ident(_)operator((()ident(size_t)operator(,) ident(size_t)operator(\)\);) -directive(static) directive(void) ident(rb_parser_free) ident(_)operator((()directive(void) operator(*\)\);) - -preprocessor(#define) ident(yyparse) ident(ruby_yyparse) -preprocessor(#define) ident(yylex) ident(ruby_yylex) -preprocessor(#define) ident(yyerror) ident(ruby_yyerror) -preprocessor(#define) ident(yylval) ident(ruby_yylval) -preprocessor(#define) ident(yychar) ident(ruby_yychar) -preprocessor(#define) ident(yydebug) ident(ruby_yydebug) - -preprocessor(#define) ident(ID_SCOPE_SHIFT) integer(3) -preprocessor(#define) ident(ID_SCOPE_MASK) hex(0x07) -preprocessor(#define) ident(ID_LOCAL) hex(0x01) -preprocessor(#define) ident(ID_INSTANCE) hex(0x02) -preprocessor(#define) ident(ID_GLOBAL) hex(0x03) -preprocessor(#define) ident(ID_ATTRSET) hex(0x04) -preprocessor(#define) ident(ID_CONST) hex(0x05) -preprocessor(#define) ident(ID_CLASS) hex(0x06) -preprocessor(#define) ident(ID_JUNK) hex(0x07) -preprocessor(#define) ident(ID_INTERNAL) ident(ID_JUNK) - -preprocessor(#define) ident(is_notop_id)operator(()ident(id)operator(\)) operator((()ident(id)operator(\)>)ident(tLAST_TOKEN)operator(\)) -preprocessor(#define) ident(is_local_id)operator(()ident(id)operator(\)) operator(()ident(is_notop_id)operator(()ident(id)operator(\)&&(()ident(id)operator(\)&)ident(ID_SCOPE_MASK)operator(\)==)ident(ID_LOCAL)operator(\)) -preprocessor(#define) ident(is_global_id)operator(()ident(id)operator(\)) operator(()ident(is_notop_id)operator(()ident(id)operator(\)&&(()ident(id)operator(\)&)ident(ID_SCOPE_MASK)operator(\)==)ident(ID_GLOBAL)operator(\)) -preprocessor(#define) ident(is_instance_id)operator(()ident(id)operator(\)) operator(()ident(is_notop_id)operator(()ident(id)operator(\)&&(()ident(id)operator(\)&)ident(ID_SCOPE_MASK)operator(\)==)ident(ID_INSTANCE)operator(\)) -preprocessor(#define) ident(is_attrset_id)operator(()ident(id)operator(\)) operator(()ident(is_notop_id)operator(()ident(id)operator(\)&&(()ident(id)operator(\)&)ident(ID_SCOPE_MASK)operator(\)==)ident(ID_ATTRSET)operator(\)) -preprocessor(#define) ident(is_const_id)operator(()ident(id)operator(\)) operator(()ident(is_notop_id)operator(()ident(id)operator(\)&&(()ident(id)operator(\)&)ident(ID_SCOPE_MASK)operator(\)==)ident(ID_CONST)operator(\)) -preprocessor(#define) ident(is_class_id)operator(()ident(id)operator(\)) operator(()ident(is_notop_id)operator(()ident(id)operator(\)&&(()ident(id)operator(\)&)ident(ID_SCOPE_MASK)operator(\)==)ident(ID_CLASS)operator(\)) -preprocessor(#define) ident(is_junk_id)operator(()ident(id)operator(\)) operator(()ident(is_notop_id)operator(()ident(id)operator(\)&&(()ident(id)operator(\)&)ident(ID_SCOPE_MASK)operator(\)==)ident(ID_JUNK)operator(\)) - -preprocessor(#define) ident(is_asgn_or_id)operator(()ident(id)operator(\)) operator((()ident(is_notop_id)operator(()ident(id)operator(\)\)) operator(&&) \ - operator(((()ident(id)operator(\)&)ident(ID_SCOPE_MASK)operator(\)) operator(==) ident(ID_GLOBAL) operator(||) \ - operator((()ident(id)operator(\)&)ident(ID_SCOPE_MASK)operator(\)) operator(==) ident(ID_INSTANCE) operator(||) \ - operator((()ident(id)operator(\)&)ident(ID_SCOPE_MASK)operator(\)) operator(==) ident(ID_CLASS)operator(\)\)) - -ident(NODE) operator(*)ident(ruby_eval_tree_begin) operator(=) integer(0)operator(;) -ident(NODE) operator(*)ident(ruby_eval_tree) operator(=) integer(0)operator(;) - -pre_type(char) operator(*)ident(ruby_sourcefile)operator(;) comment(/* current source file */) -pre_type(int) ident(ruby_sourceline)operator(;) comment(/* current line no. */) - -directive(static) pre_type(int) ident(yylex)operator((\);) -directive(static) pre_type(int) ident(yyerror)operator((\);) - -directive(static) reserved(enum) ident(lex_state) operator({) - ident(EXPR_BEG)operator(,) comment(/* ignore newline, +/- is a sign. */) - ident(EXPR_END)operator(,) comment(/* newline significant, +/- is an operator. */) - ident(EXPR_ARG)operator(,) comment(/* newline significant, +/- is an operator. */) - ident(EXPR_CMDARG)operator(,) comment(/* newline significant, +/- is an operator. */) - ident(EXPR_ENDARG)operator(,) comment(/* newline significant, +/- is an operator. */) - ident(EXPR_MID)operator(,) comment(/* newline significant, +/- is an operator. */) - ident(EXPR_FNAME)operator(,) comment(/* ignore newline, no reserved words. */) - ident(EXPR_DOT)operator(,) comment(/* right after `.' or `::', no reserved words. */) - ident(EXPR_CLASS)operator(,) comment(/* immediate after `class', no here document. */) -operator(}) ident(lex_state)operator(;) -directive(static) ident(NODE) operator(*)ident(lex_strterm)operator(;) - -preprocessor(#ifdef) ident(HAVE_LONG_LONG) -reserved(typedef) pre_type(unsigned) ident(LONG_LONG) ident(stack_type)operator(;) -preprocessor(#else) -reserved(typedef) pre_type(unsigned) pre_type(long) ident(stack_type)operator(;) -preprocessor(#endif) - -preprocessor(#define) ident(BITSTACK_PUSH)operator(()ident(stack)operator(,) ident(n)operator(\)) operator(()ident(stack) operator(=) operator(()ident(stack)operator(<<)integer(1)operator(\)|(()ident(n)operator(\)&)integer(1)operator(\)\)) -preprocessor(#define) ident(BITSTACK_POP)operator(()ident(stack)operator(\)) operator(()ident(stack) operator(>>=) integer(1)operator(\)) -preprocessor(#define) ident(BITSTACK_LEXPOP)operator(()ident(stack)operator(\)) operator(()ident(stack) operator(=) operator(()ident(stack) operator(>>) integer(1)operator(\)) operator(|) operator(()ident(stack) operator(&) integer(1)operator(\)\)) -preprocessor(#define) ident(BITSTACK_SET_P)operator(()ident(stack)operator(\)) operator(()ident(stack)operator(&)integer(1)operator(\)) - -directive(static) ident(stack_type) ident(cond_stack) operator(=) integer(0)operator(;) -preprocessor(#define) ident(COND_PUSH)operator(()ident(n)operator(\)) ident(BITSTACK_PUSH)operator(()ident(cond_stack)operator(,) ident(n)operator(\)) -preprocessor(#define) ident(COND_POP)operator((\)) ident(BITSTACK_POP)operator(()ident(cond_stack)operator(\)) -preprocessor(#define) ident(COND_LEXPOP)operator((\)) ident(BITSTACK_LEXPOP)operator(()ident(cond_stack)operator(\)) -preprocessor(#define) ident(COND_P)operator((\)) ident(BITSTACK_SET_P)operator(()ident(cond_stack)operator(\)) - -directive(static) ident(stack_type) ident(cmdarg_stack) operator(=) integer(0)operator(;) -preprocessor(#define) ident(CMDARG_PUSH)operator(()ident(n)operator(\)) ident(BITSTACK_PUSH)operator(()ident(cmdarg_stack)operator(,) ident(n)operator(\)) -preprocessor(#define) ident(CMDARG_POP)operator((\)) ident(BITSTACK_POP)operator(()ident(cmdarg_stack)operator(\)) -preprocessor(#define) ident(CMDARG_LEXPOP)operator((\)) ident(BITSTACK_LEXPOP)operator(()ident(cmdarg_stack)operator(\)) -preprocessor(#define) ident(CMDARG_P)operator((\)) ident(BITSTACK_SET_P)operator(()ident(cmdarg_stack)operator(\)) - -directive(static) pre_type(int) ident(class_nest) operator(=) integer(0)operator(;) -directive(static) pre_type(int) ident(in_single) operator(=) integer(0)operator(;) -directive(static) pre_type(int) ident(in_def) operator(=) integer(0)operator(;) -directive(static) pre_type(int) ident(compile_for_eval) operator(=) integer(0)operator(;) -directive(static) ident(ID) ident(cur_mid) operator(=) integer(0)operator(;) -directive(static) pre_type(int) ident(command_start) operator(=) ident(Qtrue)operator(;) - -directive(static) ident(NODE) operator(*)ident(deferred_nodes)operator(;) - -directive(static) ident(NODE) operator(*)ident(cond)operator((\);) -directive(static) ident(NODE) operator(*)ident(logop)operator((\);) -directive(static) pre_type(int) ident(cond_negative)operator((\);) - -directive(static) ident(NODE) operator(*)ident(newline_node)operator((\);) -directive(static) directive(void) ident(fixpos)operator((\);) - -directive(static) pre_type(int) ident(value_expr0)operator((\);) -directive(static) directive(void) ident(void_expr0)operator((\);) -directive(static) directive(void) ident(void_stmts)operator((\);) -directive(static) ident(NODE) operator(*)ident(remove_begin)operator((\);) -preprocessor(#define) ident(value_expr)operator(()ident(node)operator(\)) ident(value_expr0)operator((()ident(node)operator(\)) operator(=) ident(remove_begin)operator(()ident(node)operator(\)\)) -preprocessor(#define) ident(void_expr)operator(()ident(node)operator(\)) ident(void_expr0)operator((()ident(node)operator(\)) operator(=) ident(remove_begin)operator(()ident(node)operator(\)\)) - -directive(static) ident(NODE) operator(*)ident(block_append)operator((\);) -directive(static) ident(NODE) operator(*)ident(list_append)operator((\);) -directive(static) ident(NODE) operator(*)ident(list_concat)operator((\);) -directive(static) ident(NODE) operator(*)ident(arg_concat)operator((\);) -directive(static) ident(NODE) operator(*)ident(arg_prepend)operator((\);) -directive(static) ident(NODE) operator(*)ident(literal_concat)operator((\);) -directive(static) ident(NODE) operator(*)ident(new_evstr)operator((\);) -directive(static) ident(NODE) operator(*)ident(evstr2dstr)operator((\);) -directive(static) ident(NODE) operator(*)ident(call_op)operator((\);) -directive(static) pre_type(int) ident(in_defined) operator(=) integer(0)operator(;) - -directive(static) ident(NODE) operator(*)ident(negate_lit)operator((\);) -directive(static) ident(NODE) operator(*)ident(ret_args)operator((\);) -directive(static) ident(NODE) operator(*)ident(arg_blk_pass)operator((\);) -directive(static) ident(NODE) operator(*)ident(new_call)operator((\);) -directive(static) ident(NODE) operator(*)ident(new_fcall)operator((\);) -directive(static) ident(NODE) operator(*)ident(new_super)operator((\);) -directive(static) ident(NODE) operator(*)ident(new_yield)operator((\);) - -directive(static) ident(NODE) operator(*)ident(gettable)operator((\);) -directive(static) ident(NODE) operator(*)ident(assignable)operator((\);) -directive(static) ident(NODE) operator(*)ident(aryset)operator((\);) -directive(static) ident(NODE) operator(*)ident(attrset)operator((\);) -directive(static) directive(void) ident(rb_backref_error)operator((\);) -directive(static) ident(NODE) operator(*)ident(node_assign)operator((\);) - -directive(static) ident(NODE) operator(*)ident(match_gen)operator((\);) -directive(static) directive(void) ident(local_push)operator((\);) -directive(static) directive(void) ident(local_pop)operator((\);) -directive(static) pre_type(int) ident(local_append)operator((\);) -directive(static) pre_type(int) ident(local_cnt)operator((\);) -directive(static) pre_type(int) ident(local_id)operator((\);) -directive(static) ident(ID) operator(*)ident(local_tbl)operator((\);) -directive(static) ident(ID) ident(internal_id)operator((\);) - -directive(static) reserved(struct) ident(RVarmap) operator(*)ident(dyna_push)operator((\);) -directive(static) directive(void) ident(dyna_pop)operator((\);) -directive(static) pre_type(int) ident(dyna_in_block)operator((\);) -directive(static) ident(NODE) operator(*)ident(dyna_init)operator((\);) - -directive(static) directive(void) ident(top_local_init)operator((\);) -directive(static) directive(void) ident(top_local_setup)operator((\);) - -directive(static) directive(void) ident(fixup_nodes)operator((\);) - -preprocessor(#define) ident(RE_OPTION_ONCE) hex(0x80) - -preprocessor(#define) ident(NODE_STRTERM) ident(NODE_ZARRAY) comment(/* nothing to gc */) -preprocessor(#define) ident(NODE_HEREDOC) ident(NODE_ARRAY) comment(/* 1, 3 to gc */) -preprocessor(#define) ident(SIGN_EXTEND)operator(()ident(x)operator(,)ident(n)operator(\)) operator(((()integer(1)operator(<<()ident(n)operator(\)-)integer(1)operator(\)^(()ident(x)operator(\)&~(~)integer(0)operator(<<()ident(n)operator(\)\)\)\)-()integer(1)operator(<<()ident(n)operator(\)-)integer(1)operator(\)\)) -preprocessor(#define) ident(nd_func) ident(u1)operator(.)ident(id) -preprocessor(#if) ident(SIZEOF_SHORT) operator(==) integer(2) -preprocessor(#define) ident(nd_term)operator(()ident(node)operator(\)) operator((()pre_type(signed) pre_type(short)operator(\)()ident(node)operator(\)->)ident(u2)operator(.)ident(id)operator(\)) -preprocessor(#else) -preprocessor(#define) ident(nd_term)operator(()ident(node)operator(\)) ident(SIGN_EXTEND)operator((()ident(node)operator(\)->)ident(u2)operator(.)ident(id)operator(,) ident(CHAR_BIT)operator(*)integer(2)operator(\)) -preprocessor(#endif) -preprocessor(#define) ident(nd_paren)operator(()ident(node)operator(\)) operator(()pre_type(char)operator(\)(()ident(node)operator(\)->)ident(u2)operator(.)ident(id) operator(>>) ident(CHAR_BIT)operator(*)integer(2)operator(\)) -preprocessor(#define) ident(nd_nest) ident(u3)operator(.)ident(id) - -comment(/* Older versions of Yacc set YYMAXDEPTH to a very low value by default (150, - for instance\). This is too low for Ruby to parse some files, such as - date/format.rb, therefore bump the value up to at least Bison's default. */) -preprocessor(#ifdef) ident(OLD_YACC) -preprocessor(#ifndef) ident(YYMAXDEPTH) -preprocessor(#define) ident(YYMAXDEPTH) integer(10000) -preprocessor(#endif) -preprocessor(#endif) - - - -comment(/* Enabling traces. */) -preprocessor(#ifndef) ident(YYDEBUG) -preprocessor(# define) ident(YYDEBUG) integer(0) -preprocessor(#endif) - -comment(/* Enabling verbose error messages. */) -preprocessor(#ifdef) ident(YYERROR_VERBOSE) -preprocessor(# undef) ident(YYERROR_VERBOSE) -preprocessor(# define) ident(YYERROR_VERBOSE) integer(1) -preprocessor(#else) -preprocessor(# define) ident(YYERROR_VERBOSE) integer(0) -preprocessor(#endif) - -comment(/* Enabling the token table. */) -preprocessor(#ifndef) ident(YYTOKEN_TABLE) -preprocessor(# define) ident(YYTOKEN_TABLE) integer(0) -preprocessor(#endif) - -preprocessor(#if) operator(!) ident(defined) ident(YYSTYPE) operator(&&) operator(!) ident(defined) ident(YYSTYPE_IS_DECLARED) -reserved(typedef) reserved(union) ident(YYSTYPE) -preprocessor(#line) integer(213) string -operator({) - ident(NODE) operator(*)ident(node)operator(;) - ident(ID) ident(id)operator(;) - pre_type(int) ident(num)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(vars)operator(;) -operator(}) -comment(/* Line 193 of yacc.c. */) -preprocessor(#line) integer(511) string - ident(YYSTYPE)operator(;) -preprocessor(# define) ident(yystype) ident(YYSTYPE) comment(/* obsolescent; will be withdrawn */) -preprocessor(# define) ident(YYSTYPE_IS_DECLARED) integer(1) -preprocessor(# define) ident(YYSTYPE_IS_TRIVIAL) integer(1) -preprocessor(#endif) - - - -comment(/* Copy the second part of user declarations. */) - - -comment(/* Line 216 of yacc.c. */) -preprocessor(#line) integer(524) string - -preprocessor(#ifdef) pre_type(short) -preprocessor(# undef) pre_type(short) -preprocessor(#endif) - -preprocessor(#ifdef) ident(YYTYPE_UINT8) -reserved(typedef) ident(YYTYPE_UINT8) ident(yytype_uint8)operator(;) -preprocessor(#else) -reserved(typedef) pre_type(unsigned) pre_type(char) ident(yytype_uint8)operator(;) -preprocessor(#endif) - -preprocessor(#ifdef) ident(YYTYPE_INT8) -reserved(typedef) ident(YYTYPE_INT8) ident(yytype_int8)operator(;) -preprocessor(#elif) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -reserved(typedef) pre_type(signed) pre_type(char) ident(yytype_int8)operator(;) -preprocessor(#else) -reserved(typedef) pre_type(short) pre_type(int) ident(yytype_int8)operator(;) -preprocessor(#endif) - -preprocessor(#ifdef) ident(YYTYPE_UINT16) -reserved(typedef) ident(YYTYPE_UINT16) ident(yytype_uint16)operator(;) -preprocessor(#else) -reserved(typedef) pre_type(unsigned) pre_type(short) pre_type(int) ident(yytype_uint16)operator(;) -preprocessor(#endif) - -preprocessor(#ifdef) ident(YYTYPE_INT16) -reserved(typedef) ident(YYTYPE_INT16) ident(yytype_int16)operator(;) -preprocessor(#else) -reserved(typedef) pre_type(short) pre_type(int) ident(yytype_int16)operator(;) -preprocessor(#endif) - -preprocessor(#ifndef) ident(YYSIZE_T) -preprocessor(# ifdef) ident(__SIZE_TYPE__) -preprocessor(# define) ident(YYSIZE_T) ident(__SIZE_TYPE__) -preprocessor(# elif) ident(defined) ident(size_t) -preprocessor(# define) ident(YYSIZE_T) ident(size_t) -preprocessor(# elif) operator(!) ident(defined) ident(YYSIZE_T) operator(&&) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -preprocessor(# include) include() comment(/* INFRINGES ON USER NAME SPACE */) -preprocessor(# define) ident(YYSIZE_T) ident(size_t) -preprocessor(# else) -preprocessor(# define) ident(YYSIZE_T) pre_type(unsigned) pre_type(int) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#define) ident(YYSIZE_MAXIMUM) operator((()ident(YYSIZE_T)operator(\)) operator(-)integer(1)operator(\)) - -preprocessor(#ifndef) ident(YY_) -preprocessor(# if) ident(YYENABLE_NLS) -preprocessor(# if) ident(ENABLE_NLS) -preprocessor(# include) include() comment(/* INFRINGES ON USER NAME SPACE */) -preprocessor(# define) ident(YY_)operator(()ident(msgid)operator(\)) ident(dgettext) operator(()stringoperator(,) ident(msgid)operator(\)) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# ifndef) ident(YY_) -preprocessor(# define) ident(YY_)operator(()ident(msgid)operator(\)) ident(msgid) -preprocessor(# endif) -preprocessor(#endif) - -comment(/* Suppress unused-variable warnings by "using" E. */) -preprocessor(#if) operator(!) ident(defined) ident(lint) operator(||) ident(defined) ident(__GNUC__) -preprocessor(# define) ident(YYUSE)operator(()ident(e)operator(\)) operator((()directive(void)operator(\)) operator(()ident(e)operator(\)\)) -preprocessor(#else) -preprocessor(# define) ident(YYUSE)operator(()ident(e)operator(\)) comment(/* empty */) -preprocessor(#endif) - -comment(/* Identity function, used to suppress warnings about constant conditions. */) -preprocessor(#ifndef) ident(lint) -preprocessor(# define) ident(YYID)operator(()ident(n)operator(\)) operator(()ident(n)operator(\)) -preprocessor(#else) -preprocessor(#if) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -directive(static) pre_type(int) -ident(YYID) operator(()pre_type(int) ident(i)operator(\)) -preprocessor(#else) -directive(static) pre_type(int) -ident(YYID) operator(()ident(i)operator(\)) - pre_type(int) ident(i)operator(;) -preprocessor(#endif) -operator({) - reserved(return) ident(i)operator(;) -operator(}) -preprocessor(#endif) - -preprocessor(#if) operator(!) ident(defined) ident(yyoverflow) operator(||) ident(YYERROR_VERBOSE) - -comment(/* The parser invokes alloca or malloc; define the necessary symbols. */) - -preprocessor(# ifdef) ident(YYSTACK_USE_ALLOCA) -preprocessor(# if) ident(YYSTACK_USE_ALLOCA) -preprocessor(# ifdef) ident(__GNUC__) -preprocessor(# define) ident(YYSTACK_ALLOC) ident(__builtin_alloca) -preprocessor(# elif) ident(defined) ident(__BUILTIN_VA_ARG_INCR) -preprocessor(# include) include() comment(/* INFRINGES ON USER NAME SPACE */) -preprocessor(# elif) ident(defined) ident(_AIX) -preprocessor(# define) ident(YYSTACK_ALLOC) ident(__alloca) -preprocessor(# elif) ident(defined) ident(_MSC_VER) -preprocessor(# include) include() comment(/* INFRINGES ON USER NAME SPACE */) -preprocessor(# define) ident(alloca) ident(_alloca) -preprocessor(# else) -preprocessor(# define) ident(YYSTACK_ALLOC) ident(alloca) -preprocessor(# if) operator(!) ident(defined) ident(_ALLOCA_H) operator(&&) operator(!) ident(defined) ident(_STDLIB_H) operator(&&) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -preprocessor(# include) include() comment(/* INFRINGES ON USER NAME SPACE */) -preprocessor(# ifndef) ident(_STDLIB_H) -preprocessor(# define) ident(_STDLIB_H) integer(1) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# endif) - -preprocessor(# ifdef) ident(YYSTACK_ALLOC) - comment(/* Pacify GCC's `empty if-body' warning. */) -preprocessor(# define) ident(YYSTACK_FREE)operator(()ident(Ptr)operator(\)) reserved(do) operator({) comment(/* empty */)operator(;) operator(}) reserved(while) operator(()ident(YYID) operator(()integer(0)operator(\)\)) -preprocessor(# ifndef) ident(YYSTACK_ALLOC_MAXIMUM) - comment(/* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N\) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */) -preprocessor(# define) ident(YYSTACK_ALLOC_MAXIMUM) integer(4032) comment(/* reasonable circa 2006 */) -preprocessor(# endif) -preprocessor(# else) -preprocessor(# define) ident(YYSTACK_ALLOC) ident(YYMALLOC) -preprocessor(# define) ident(YYSTACK_FREE) ident(YYFREE) -preprocessor(# ifndef) ident(YYSTACK_ALLOC_MAXIMUM) -preprocessor(# define) ident(YYSTACK_ALLOC_MAXIMUM) ident(YYSIZE_MAXIMUM) -preprocessor(# endif) -preprocessor(# if) operator(()ident(defined) ident(__cplusplus) operator(&&) operator(!) ident(defined) ident(_STDLIB_H) \ - operator(&&) operator(!) operator((()ident(defined) ident(YYMALLOC) operator(||) ident(defined) ident(malloc)operator(\)) \ - operator(&&) operator(()ident(defined) ident(YYFREE) operator(||) ident(defined) ident(free)operator(\)\)\)) -preprocessor(# include) include() comment(/* INFRINGES ON USER NAME SPACE */) -preprocessor(# ifndef) ident(_STDLIB_H) -preprocessor(# define) ident(_STDLIB_H) integer(1) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# ifndef) ident(YYMALLOC) -preprocessor(# define) ident(YYMALLOC) ident(malloc) -preprocessor(# if) operator(!) ident(defined) ident(malloc) operator(&&) operator(!) ident(defined) ident(_STDLIB_H) operator(&&) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -directive(void) operator(*)ident(malloc) operator(()ident(YYSIZE_T)operator(\);) comment(/* INFRINGES ON USER NAME SPACE */) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# ifndef) ident(YYFREE) -preprocessor(# define) ident(YYFREE) ident(free) -preprocessor(# if) operator(!) ident(defined) ident(free) operator(&&) operator(!) ident(defined) ident(_STDLIB_H) operator(&&) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -directive(void) ident(free) operator(()directive(void) operator(*\);) comment(/* INFRINGES ON USER NAME SPACE */) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(#endif) comment(/* ! defined yyoverflow || YYERROR_VERBOSE */) - - -preprocessor(#if) operator((!) ident(defined) ident(yyoverflow) \ - operator(&&) operator((!) ident(defined) ident(__cplusplus) \ - operator(||) operator(()ident(defined) ident(YYSTYPE_IS_TRIVIAL) operator(&&) ident(YYSTYPE_IS_TRIVIAL)operator(\)\)\)) - -comment(/* A type that is properly aligned for any stack member. */) -reserved(union) ident(yyalloc) -operator({) - ident(yytype_int16) ident(yyss)operator(;) - ident(YYSTYPE) ident(yyvs)operator(;) - operator(};) - -comment(/* The size of the maximum gap between one aligned stack and the next. */) -preprocessor(# define) ident(YYSTACK_GAP_MAXIMUM) operator(()reserved(sizeof) operator(()reserved(union) ident(yyalloc)operator(\)) operator(-) integer(1)operator(\)) - -comment(/* The size of an array large to enough to hold all stacks, each with - N elements. */) -preprocessor(# define) ident(YYSTACK_BYTES)operator(()ident(N)operator(\)) \ - operator((()ident(N)operator(\)) operator(*) operator(()reserved(sizeof) operator(()ident(yytype_int16)operator(\)) operator(+) reserved(sizeof) operator(()ident(YYSTYPE)operator(\)\)) \ - operator(+) ident(YYSTACK_GAP_MAXIMUM)operator(\)) - -comment(/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */) -preprocessor(# ifndef) ident(YYCOPY) -preprocessor(# if) ident(defined) ident(__GNUC__) operator(&&) integer(1) operator(<) ident(__GNUC__) -preprocessor(# define) ident(YYCOPY)operator(()ident(To)operator(,) ident(From)operator(,) ident(Count)operator(\)) \ - ident(__builtin_memcpy) operator(()ident(To)operator(,) ident(From)operator(,) operator(()ident(Count)operator(\)) operator(*) reserved(sizeof) operator((*()ident(From)operator(\)\)\)) -preprocessor(# else) -preprocessor(# define) ident(YYCOPY)operator(()ident(To)operator(,) ident(From)operator(,) ident(Count)operator(\)) \ - reserved(do) \ - operator({) \ - ident(YYSIZE_T) ident(yyi)operator(;) \ - reserved(for) operator(()ident(yyi) operator(=) integer(0)operator(;) ident(yyi) operator(<) operator(()ident(Count)operator(\);) ident(yyi)operator(++\)) \ - operator(()ident(To)operator(\)[)ident(yyi)operator(]) operator(=) operator(()ident(From)operator(\)[)ident(yyi)operator(];) \ - operator(}) \ - reserved(while) operator(()ident(YYID) operator(()integer(0)operator(\)\)) -preprocessor(# endif) -preprocessor(# endif) - -comment(/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */) -preprocessor(# define) ident(YYSTACK_RELOCATE)operator(()ident(Stack)operator(\)) \ - reserved(do) \ - operator({) \ - ident(YYSIZE_T) ident(yynewbytes)operator(;) \ - ident(YYCOPY) operator((&)ident(yyptr)operator(->)ident(Stack)operator(,) ident(Stack)operator(,) ident(yysize)operator(\);) \ - ident(Stack) operator(=) operator(&)ident(yyptr)operator(->)ident(Stack)operator(;) \ - ident(yynewbytes) operator(=) ident(yystacksize) operator(*) reserved(sizeof) operator((*)ident(Stack)operator(\)) operator(+) ident(YYSTACK_GAP_MAXIMUM)operator(;) \ - ident(yyptr) operator(+=) ident(yynewbytes) operator(/) reserved(sizeof) operator((*)ident(yyptr)operator(\);) \ - operator(}) \ - reserved(while) operator(()ident(YYID) operator(()integer(0)operator(\)\)) - -preprocessor(#endif) - -comment(/* YYFINAL -- State number of the termination state. */) -preprocessor(#define) ident(YYFINAL) integer(3) -comment(/* YYLAST -- Last index in YYTABLE. */) -preprocessor(#define) ident(YYLAST) integer(9550) - -comment(/* YYNTOKENS -- Number of terminals. */) -preprocessor(#define) ident(YYNTOKENS) integer(132) -comment(/* YYNNTS -- Number of nonterminals. */) -preprocessor(#define) ident(YYNNTS) integer(144) -comment(/* YYNRULES -- Number of rules. */) -preprocessor(#define) ident(YYNRULES) integer(501) -comment(/* YYNRULES -- Number of states. */) -preprocessor(#define) ident(YYNSTATES) integer(895) - -comment(/* YYTRANSLATE(YYLEX\) -- Bison symbol number corresponding to YYLEX. */) -preprocessor(#define) ident(YYUNDEFTOK) integer(2) -preprocessor(#define) ident(YYMAXUTOK) integer(359) - -preprocessor(#define) ident(YYTRANSLATE)operator(()ident(YYX)operator(\)) \ - operator((()pre_type(unsigned) pre_type(int)operator(\)) operator(()ident(YYX)operator(\)) operator(<=) ident(YYMAXUTOK) operator(?) ident(yytranslate)operator([)ident(YYX)operator(]) operator(:) ident(YYUNDEFTOK)operator(\)) - -comment(/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */) -directive(static) directive(const) ident(yytype_uint8) ident(yytranslate)operator([]) operator(=) -operator({) - integer(0)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(130)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(129)operator(,) integer(117)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(115)operator(,) integer(110)operator(,) integer(2)operator(,) - integer(128)operator(,) integer(125)operator(,) integer(113)operator(,) integer(111)operator(,) integer(126)operator(,) integer(112)operator(,) integer(124)operator(,) integer(114)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(105)operator(,) integer(131)operator(,) - integer(107)operator(,) integer(103)operator(,) integer(106)operator(,) integer(104)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(122)operator(,) integer(2)operator(,) integer(123)operator(,) integer(109)operator(,) integer(2)operator(,) integer(127)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(120)operator(,) integer(108)operator(,) integer(121)operator(,) integer(118)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(,) - integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) integer(13)operator(,) integer(14)operator(,) - integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) - integer(25)operator(,) integer(26)operator(,) integer(27)operator(,) integer(28)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) - integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(42)operator(,) integer(43)operator(,) integer(44)operator(,) - integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(61)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) - integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) integer(74)operator(,) - integer(75)operator(,) integer(76)operator(,) integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) integer(81)operator(,) integer(82)operator(,) integer(83)operator(,) integer(84)operator(,) - integer(85)operator(,) integer(86)operator(,) integer(87)operator(,) integer(88)operator(,) integer(89)operator(,) integer(90)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) - integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(102)operator(,) integer(116)operator(,) integer(119) -operator(};) - -preprocessor(#if) ident(YYDEBUG) -comment(/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */) -directive(static) directive(const) ident(yytype_uint16) ident(yyprhs)operator([]) operator(=) -operator({) - integer(0)operator(,) integer(0)operator(,) integer(3)operator(,) integer(4)operator(,) integer(7)operator(,) integer(12)operator(,) integer(15)operator(,) integer(17)operator(,) integer(19)operator(,) integer(23)operator(,) - integer(26)operator(,) integer(27)operator(,) integer(32)operator(,) integer(36)operator(,) integer(40)operator(,) integer(44)operator(,) integer(47)operator(,) integer(51)operator(,) integer(55)operator(,) integer(59)operator(,) - integer(63)operator(,) integer(67)operator(,) integer(68)operator(,) integer(74)operator(,) integer(79)operator(,) integer(83)operator(,) integer(87)operator(,) integer(91)operator(,) integer(98)operator(,) integer(104)operator(,) - integer(110)operator(,) integer(116)operator(,) integer(120)operator(,) integer(124)operator(,) integer(128)operator(,) integer(132)operator(,) integer(134)operator(,) integer(136)operator(,) integer(140)operator(,) integer(144)operator(,) - integer(147)operator(,) integer(150)operator(,) integer(152)operator(,) integer(154)operator(,) integer(156)operator(,) integer(158)operator(,) integer(161)operator(,) integer(164)operator(,) integer(167)operator(,) integer(169)operator(,) - integer(174)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(188)operator(,) integer(191)operator(,) integer(195)operator(,) integer(200)operator(,) integer(206)operator(,) integer(211)operator(,) - integer(217)operator(,) integer(220)operator(,) integer(223)operator(,) integer(225)operator(,) integer(229)operator(,) integer(231)operator(,) integer(235)operator(,) integer(237)operator(,) integer(240)operator(,) integer(244)operator(,) - integer(247)operator(,) integer(250)operator(,) integer(252)operator(,) integer(254)operator(,) integer(258)operator(,) integer(261)operator(,) integer(265)operator(,) integer(267)operator(,) integer(272)operator(,) integer(276)operator(,) - integer(280)operator(,) integer(284)operator(,) integer(288)operator(,) integer(291)operator(,) integer(293)operator(,) integer(295)operator(,) integer(300)operator(,) integer(304)operator(,) integer(308)operator(,) integer(312)operator(,) - integer(316)operator(,) integer(319)operator(,) integer(321)operator(,) integer(323)operator(,) integer(325)operator(,) integer(328)operator(,) integer(330)operator(,) integer(334)operator(,) integer(336)operator(,) integer(338)operator(,) - integer(340)operator(,) integer(342)operator(,) integer(344)operator(,) integer(346)operator(,) integer(348)operator(,) integer(350)operator(,) integer(352)operator(,) integer(354)operator(,) integer(355)operator(,) integer(360)operator(,) - integer(362)operator(,) integer(364)operator(,) integer(366)operator(,) integer(368)operator(,) integer(370)operator(,) integer(372)operator(,) integer(374)operator(,) integer(376)operator(,) integer(378)operator(,) integer(380)operator(,) - integer(382)operator(,) integer(384)operator(,) integer(386)operator(,) integer(388)operator(,) integer(390)operator(,) integer(392)operator(,) integer(394)operator(,) integer(396)operator(,) integer(398)operator(,) integer(400)operator(,) - integer(402)operator(,) integer(404)operator(,) integer(406)operator(,) integer(408)operator(,) integer(410)operator(,) integer(412)operator(,) integer(414)operator(,) integer(416)operator(,) integer(418)operator(,) integer(420)operator(,) - integer(422)operator(,) integer(424)operator(,) integer(426)operator(,) integer(428)operator(,) integer(430)operator(,) integer(432)operator(,) integer(434)operator(,) integer(436)operator(,) integer(438)operator(,) integer(440)operator(,) - integer(442)operator(,) integer(444)operator(,) integer(446)operator(,) integer(448)operator(,) integer(450)operator(,) integer(452)operator(,) integer(454)operator(,) integer(456)operator(,) integer(458)operator(,) integer(460)operator(,) - integer(462)operator(,) integer(464)operator(,) integer(466)operator(,) integer(468)operator(,) integer(470)operator(,) integer(472)operator(,) integer(474)operator(,) integer(476)operator(,) integer(478)operator(,) integer(480)operator(,) - integer(482)operator(,) integer(484)operator(,) integer(486)operator(,) integer(488)operator(,) integer(490)operator(,) integer(492)operator(,) integer(496)operator(,) integer(502)operator(,) integer(506)operator(,) integer(513)operator(,) - integer(519)operator(,) integer(525)operator(,) integer(531)operator(,) integer(537)operator(,) integer(542)operator(,) integer(546)operator(,) integer(550)operator(,) integer(554)operator(,) integer(558)operator(,) integer(562)operator(,) - integer(566)operator(,) integer(570)operator(,) integer(574)operator(,) integer(578)operator(,) integer(583)operator(,) integer(588)operator(,) integer(591)operator(,) integer(594)operator(,) integer(598)operator(,) integer(602)operator(,) - integer(606)operator(,) integer(610)operator(,) integer(614)operator(,) integer(618)operator(,) integer(622)operator(,) integer(626)operator(,) integer(630)operator(,) integer(634)operator(,) integer(638)operator(,) integer(642)operator(,) - integer(646)operator(,) integer(649)operator(,) integer(652)operator(,) integer(656)operator(,) integer(660)operator(,) integer(664)operator(,) integer(668)operator(,) integer(669)operator(,) integer(674)operator(,) integer(680)operator(,) - integer(682)operator(,) integer(684)operator(,) integer(686)operator(,) integer(689)operator(,) integer(692)operator(,) integer(698)operator(,) integer(701)operator(,) integer(705)operator(,) integer(709)operator(,) integer(714)operator(,) - integer(719)operator(,) integer(726)operator(,) integer(728)operator(,) integer(730)operator(,) integer(732)operator(,) integer(735)operator(,) integer(741)operator(,) integer(744)operator(,) integer(750)operator(,) integer(755)operator(,) - integer(763)operator(,) integer(767)operator(,) integer(769)operator(,) integer(774)operator(,) integer(778)operator(,) integer(784)operator(,) integer(792)operator(,) integer(795)operator(,) integer(801)operator(,) integer(806)operator(,) - integer(813)operator(,) integer(821)operator(,) integer(831)operator(,) integer(835)operator(,) integer(837)operator(,) integer(838)operator(,) integer(841)operator(,) integer(843)operator(,) integer(844)operator(,) integer(848)operator(,) - integer(849)operator(,) integer(854)operator(,) integer(857)operator(,) integer(860)operator(,) integer(862)operator(,) integer(864)operator(,) integer(868)operator(,) integer(872)operator(,) integer(877)operator(,) integer(880)operator(,) - integer(882)operator(,) integer(884)operator(,) integer(886)operator(,) integer(888)operator(,) integer(890)operator(,) integer(892)operator(,) integer(894)operator(,) integer(896)operator(,) integer(898)operator(,) integer(899)operator(,) - integer(904)operator(,) integer(905)operator(,) integer(911)operator(,) integer(915)operator(,) integer(919)operator(,) integer(922)operator(,) integer(927)operator(,) integer(931)operator(,) integer(935)operator(,) integer(937)operator(,) - integer(942)operator(,) integer(946)operator(,) integer(948)operator(,) integer(949)operator(,) integer(956)operator(,) integer(959)operator(,) integer(961)operator(,) integer(964)operator(,) integer(971)operator(,) integer(978)operator(,) - integer(979)operator(,) integer(980)operator(,) integer(988)operator(,) integer(989)operator(,) integer(990)operator(,) integer(998)operator(,) integer(1004)operator(,) integer(1009)operator(,) integer(1015)operator(,) integer(1016)operator(,) - integer(1017)operator(,) integer(1027)operator(,) integer(1028)operator(,) integer(1035)operator(,) integer(1036)operator(,) integer(1037)operator(,) integer(1046)operator(,) integer(1047)operator(,) integer(1053)operator(,) integer(1054)operator(,) - integer(1061)operator(,) integer(1062)operator(,) integer(1063)operator(,) integer(1073)operator(,) integer(1075)operator(,) integer(1077)operator(,) integer(1079)operator(,) integer(1081)operator(,) integer(1083)operator(,) integer(1085)operator(,) - integer(1087)operator(,) integer(1089)operator(,) integer(1092)operator(,) integer(1094)operator(,) integer(1096)operator(,) integer(1098)operator(,) integer(1100)operator(,) integer(1106)operator(,) integer(1108)operator(,) integer(1111)operator(,) - integer(1113)operator(,) integer(1115)operator(,) integer(1117)operator(,) integer(1120)operator(,) integer(1122)operator(,) integer(1126)operator(,) integer(1127)operator(,) integer(1128)operator(,) integer(1135)operator(,) integer(1138)operator(,) - integer(1143)operator(,) integer(1148)operator(,) integer(1151)operator(,) integer(1156)operator(,) integer(1161)operator(,) integer(1165)operator(,) integer(1168)operator(,) integer(1170)operator(,) integer(1171)operator(,) integer(1172)operator(,) - integer(1179)operator(,) integer(1180)operator(,) integer(1181)operator(,) integer(1188)operator(,) integer(1194)operator(,) integer(1196)operator(,) integer(1201)operator(,) integer(1204)operator(,) integer(1206)operator(,) integer(1208)operator(,) - integer(1215)operator(,) integer(1217)operator(,) integer(1219)operator(,) integer(1221)operator(,) integer(1223)operator(,) integer(1226)operator(,) integer(1228)operator(,) integer(1231)operator(,) integer(1233)operator(,) integer(1235)operator(,) - integer(1237)operator(,) integer(1239)operator(,) integer(1241)operator(,) integer(1243)operator(,) integer(1246)operator(,) integer(1250)operator(,) integer(1254)operator(,) integer(1258)operator(,) integer(1262)operator(,) integer(1266)operator(,) - integer(1267)operator(,) integer(1271)operator(,) integer(1273)operator(,) integer(1276)operator(,) integer(1280)operator(,) integer(1284)operator(,) integer(1285)operator(,) integer(1289)operator(,) integer(1290)operator(,) integer(1293)operator(,) - integer(1294)operator(,) integer(1297)operator(,) integer(1299)operator(,) integer(1300)operator(,) integer(1304)operator(,) integer(1305)operator(,) integer(1310)operator(,) integer(1312)operator(,) integer(1314)operator(,) integer(1316)operator(,) - integer(1318)operator(,) integer(1321)operator(,) integer(1323)operator(,) integer(1325)operator(,) integer(1327)operator(,) integer(1329)operator(,) integer(1333)operator(,) integer(1335)operator(,) integer(1337)operator(,) integer(1340)operator(,) - integer(1343)operator(,) integer(1345)operator(,) integer(1347)operator(,) integer(1349)operator(,) integer(1351)operator(,) integer(1353)operator(,) integer(1355)operator(,) integer(1357)operator(,) integer(1359)operator(,) integer(1361)operator(,) - integer(1363)operator(,) integer(1365)operator(,) integer(1367)operator(,) integer(1369)operator(,) integer(1371)operator(,) integer(1373)operator(,) integer(1375)operator(,) integer(1376)operator(,) integer(1381)operator(,) integer(1384)operator(,) - integer(1389)operator(,) integer(1392)operator(,) integer(1399)operator(,) integer(1404)operator(,) integer(1409)operator(,) integer(1412)operator(,) integer(1417)operator(,) integer(1420)operator(,) integer(1423)operator(,) integer(1425)operator(,) - integer(1426)operator(,) integer(1428)operator(,) integer(1430)operator(,) integer(1432)operator(,) integer(1434)operator(,) integer(1436)operator(,) integer(1438)operator(,) integer(1442)operator(,) integer(1446)operator(,) integer(1448)operator(,) - integer(1452)operator(,) integer(1454)operator(,) integer(1456)operator(,) integer(1459)operator(,) integer(1461)operator(,) integer(1463)operator(,) integer(1465)operator(,) integer(1468)operator(,) integer(1471)operator(,) integer(1473)operator(,) - integer(1475)operator(,) integer(1476)operator(,) integer(1482)operator(,) integer(1484)operator(,) integer(1487)operator(,) integer(1490)operator(,) integer(1492)operator(,) integer(1496)operator(,) integer(1500)operator(,) integer(1502)operator(,) - integer(1504)operator(,) integer(1506)operator(,) integer(1508)operator(,) integer(1510)operator(,) integer(1512)operator(,) integer(1514)operator(,) integer(1516)operator(,) integer(1518)operator(,) integer(1520)operator(,) integer(1522)operator(,) - integer(1524)operator(,) integer(1525)operator(,) integer(1527)operator(,) integer(1528)operator(,) integer(1530)operator(,) integer(1531)operator(,) integer(1533)operator(,) integer(1535)operator(,) integer(1537)operator(,) integer(1539)operator(,) - integer(1541)operator(,) integer(1544) -operator(};) - -comment(/* YYRHS -- A `-1'-separated list of the rules' RHS. */) -directive(static) directive(const) ident(yytype_int16) ident(yyrhs)operator([]) operator(=) -operator({) - integer(133)operator(,) integer(0)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(134)operator(,) integer(136)operator(,) operator(-)integer(1)operator(,) integer(136)operator(,) integer(219)operator(,) integer(203)operator(,) - integer(222)operator(,) operator(-)integer(1)operator(,) integer(137)operator(,) integer(270)operator(,) operator(-)integer(1)operator(,) integer(275)operator(,) operator(-)integer(1)operator(,) integer(138)operator(,) operator(-)integer(1)operator(,) integer(137)operator(,) - integer(274)operator(,) integer(138)operator(,) operator(-)integer(1)operator(,) integer(1)operator(,) integer(138)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(160)operator(,) integer(139)operator(,) - integer(160)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(52)operator(,) integer(52)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(52)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) - integer(44)operator(,) integer(52)operator(,) integer(59)operator(,) operator(-)integer(1)operator(,) integer(6)operator(,) integer(161)operator(,) operator(-)integer(1)operator(,) integer(138)operator(,) integer(39)operator(,) integer(142)operator(,) - operator(-)integer(1)operator(,) integer(138)operator(,) integer(40)operator(,) integer(142)operator(,) operator(-)integer(1)operator(,) integer(138)operator(,) integer(41)operator(,) integer(142)operator(,) operator(-)integer(1)operator(,) integer(138)operator(,) - integer(42)operator(,) integer(142)operator(,) operator(-)integer(1)operator(,) integer(138)operator(,) integer(43)operator(,) integer(138)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(46)operator(,) integer(140)operator(,) - integer(120)operator(,) integer(136)operator(,) integer(121)operator(,) operator(-)integer(1)operator(,) integer(47)operator(,) integer(120)operator(,) integer(136)operator(,) integer(121)operator(,) operator(-)integer(1)operator(,) integer(155)operator(,) - integer(103)operator(,) integer(143)operator(,) operator(-)integer(1)operator(,) integer(149)operator(,) integer(103)operator(,) integer(143)operator(,) operator(-)integer(1)operator(,) integer(246)operator(,) integer(83)operator(,) integer(143)operator(,) - operator(-)integer(1)operator(,) integer(199)operator(,) integer(122)operator(,) integer(168)operator(,) integer(123)operator(,) integer(83)operator(,) integer(143)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(124)operator(,) - integer(50)operator(,) integer(83)operator(,) integer(143)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(124)operator(,) integer(54)operator(,) integer(83)operator(,) integer(143)operator(,) operator(-)integer(1)operator(,) - integer(199)operator(,) integer(81)operator(,) integer(50)operator(,) integer(83)operator(,) integer(143)operator(,) operator(-)integer(1)operator(,) integer(247)operator(,) integer(83)operator(,) integer(143)operator(,) operator(-)integer(1)operator(,) - integer(155)operator(,) integer(103)operator(,) integer(181)operator(,) operator(-)integer(1)operator(,) integer(149)operator(,) integer(103)operator(,) integer(167)operator(,) operator(-)integer(1)operator(,) integer(149)operator(,) integer(103)operator(,) - integer(181)operator(,) operator(-)integer(1)operator(,) integer(141)operator(,) operator(-)integer(1)operator(,) integer(143)operator(,) operator(-)integer(1)operator(,) integer(141)operator(,) integer(36)operator(,) integer(141)operator(,) operator(-)integer(1)operator(,) - integer(141)operator(,) integer(37)operator(,) integer(141)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) integer(141)operator(,) operator(-)integer(1)operator(,) integer(117)operator(,) integer(143)operator(,) operator(-)integer(1)operator(,) - integer(165)operator(,) operator(-)integer(1)operator(,) integer(141)operator(,) operator(-)integer(1)operator(,) integer(148)operator(,) operator(-)integer(1)operator(,) integer(144)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(171)operator(,) - operator(-)integer(1)operator(,) integer(21)operator(,) integer(171)operator(,) operator(-)integer(1)operator(,) integer(22)operator(,) integer(171)operator(,) operator(-)integer(1)operator(,) integer(209)operator(,) operator(-)integer(1)operator(,) integer(209)operator(,) - integer(124)operator(,) integer(267)operator(,) integer(173)operator(,) operator(-)integer(1)operator(,) integer(209)operator(,) integer(81)operator(,) integer(267)operator(,) integer(173)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(90)operator(,) integer(146)operator(,) integer(205)operator(,) integer(147)operator(,) integer(136)operator(,) integer(121)operator(,) operator(-)integer(1)operator(,) integer(266)operator(,) integer(173)operator(,) - operator(-)integer(1)operator(,) integer(266)operator(,) integer(173)operator(,) integer(145)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(124)operator(,) integer(267)operator(,) integer(173)operator(,) operator(-)integer(1)operator(,) - integer(199)operator(,) integer(124)operator(,) integer(267)operator(,) integer(173)operator(,) integer(145)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(81)operator(,) integer(267)operator(,) integer(173)operator(,) - operator(-)integer(1)operator(,) integer(199)operator(,) integer(81)operator(,) integer(267)operator(,) integer(173)operator(,) integer(145)operator(,) operator(-)integer(1)operator(,) integer(31)operator(,) integer(173)operator(,) operator(-)integer(1)operator(,) - integer(30)operator(,) integer(173)operator(,) operator(-)integer(1)operator(,) integer(151)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(150)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(151)operator(,) - operator(-)integer(1)operator(,) integer(85)operator(,) integer(150)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(153)operator(,) operator(-)integer(1)operator(,) integer(153)operator(,) integer(152)operator(,) operator(-)integer(1)operator(,) - integer(153)operator(,) integer(91)operator(,) integer(154)operator(,) operator(-)integer(1)operator(,) integer(153)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(154)operator(,) operator(-)integer(1)operator(,) - integer(91)operator(,) operator(-)integer(1)operator(,) integer(154)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(150)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(152)operator(,) integer(126)operator(,) - operator(-)integer(1)operator(,) integer(153)operator(,) integer(152)operator(,) integer(126)operator(,) operator(-)integer(1)operator(,) integer(244)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(122)operator(,) integer(168)operator(,) - integer(123)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(124)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(81)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) - integer(199)operator(,) integer(124)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(81)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) integer(54)operator(,) - operator(-)integer(1)operator(,) integer(247)operator(,) operator(-)integer(1)operator(,) integer(244)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(122)operator(,) integer(168)operator(,) integer(123)operator(,) operator(-)integer(1)operator(,) - integer(199)operator(,) integer(124)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(81)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(124)operator(,) - integer(54)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(81)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) integer(247)operator(,) - operator(-)integer(1)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) integer(156)operator(,) operator(-)integer(1)operator(,) integer(156)operator(,) operator(-)integer(1)operator(,) - integer(199)operator(,) integer(81)operator(,) integer(156)operator(,) operator(-)integer(1)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) integer(51)operator(,) operator(-)integer(1)operator(,) - integer(163)operator(,) operator(-)integer(1)operator(,) integer(164)operator(,) operator(-)integer(1)operator(,) integer(158)operator(,) operator(-)integer(1)operator(,) integer(240)operator(,) operator(-)integer(1)operator(,) integer(159)operator(,) operator(-)integer(1)operator(,) - integer(242)operator(,) operator(-)integer(1)operator(,) integer(160)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(161)operator(,) integer(126)operator(,) integer(162)operator(,) integer(160)operator(,) operator(-)integer(1)operator(,) - integer(108)operator(,) operator(-)integer(1)operator(,) integer(109)operator(,) operator(-)integer(1)operator(,) integer(110)operator(,) operator(-)integer(1)operator(,) integer(65)operator(,) operator(-)integer(1)operator(,) integer(66)operator(,) operator(-)integer(1)operator(,) - integer(67)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) operator(-)integer(1)operator(,) integer(107)operator(,) operator(-)integer(1)operator(,) - integer(70)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) operator(-)integer(1)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) integer(111)operator(,) operator(-)integer(1)operator(,) integer(112)operator(,) operator(-)integer(1)operator(,) - integer(113)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(114)operator(,) operator(-)integer(1)operator(,) integer(115)operator(,) operator(-)integer(1)operator(,) integer(64)operator(,) operator(-)integer(1)operator(,) - integer(118)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) operator(-)integer(1)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) operator(-)integer(1)operator(,) integer(78)operator(,) operator(-)integer(1)operator(,) - integer(127)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) operator(-)integer(1)operator(,) integer(49)operator(,) operator(-)integer(1)operator(,) integer(46)operator(,) operator(-)integer(1)operator(,) integer(47)operator(,) operator(-)integer(1)operator(,) - integer(44)operator(,) operator(-)integer(1)operator(,) integer(36)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) integer(21)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) - integer(3)operator(,) operator(-)integer(1)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) integer(26)operator(,) operator(-)integer(1)operator(,) integer(15)operator(,) operator(-)integer(1)operator(,) - integer(14)operator(,) operator(-)integer(1)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) integer(9)operator(,) operator(-)integer(1)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) integer(20)operator(,) operator(-)integer(1)operator(,) - integer(25)operator(,) operator(-)integer(1)operator(,) integer(4)operator(,) operator(-)integer(1)operator(,) integer(22)operator(,) operator(-)integer(1)operator(,) integer(33)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) - integer(37)operator(,) operator(-)integer(1)operator(,) integer(23)operator(,) operator(-)integer(1)operator(,) integer(8)operator(,) operator(-)integer(1)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) operator(-)integer(1)operator(,) - integer(32)operator(,) operator(-)integer(1)operator(,) integer(31)operator(,) operator(-)integer(1)operator(,) integer(13)operator(,) operator(-)integer(1)operator(,) integer(34)operator(,) operator(-)integer(1)operator(,) integer(6)operator(,) operator(-)integer(1)operator(,) - integer(17)operator(,) operator(-)integer(1)operator(,) integer(30)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) operator(-)integer(1)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) operator(-)integer(1)operator(,) - integer(19)operator(,) operator(-)integer(1)operator(,) integer(155)operator(,) integer(103)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(155)operator(,) integer(103)operator(,) integer(165)operator(,) integer(43)operator(,) - integer(165)operator(,) operator(-)integer(1)operator(,) integer(246)operator(,) integer(83)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(122)operator(,) integer(168)operator(,) integer(123)operator(,) - integer(83)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(124)operator(,) integer(50)operator(,) integer(83)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) - integer(124)operator(,) integer(54)operator(,) integer(83)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(81)operator(,) integer(50)operator(,) integer(83)operator(,) integer(165)operator(,) - operator(-)integer(1)operator(,) integer(199)operator(,) integer(81)operator(,) integer(54)operator(,) integer(83)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) integer(54)operator(,) integer(83)operator(,) - integer(165)operator(,) operator(-)integer(1)operator(,) integer(247)operator(,) integer(83)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(75)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) - integer(165)operator(,) integer(76)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(111)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(112)operator(,) - integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(113)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(114)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) - integer(165)operator(,) integer(115)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(64)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(116)operator(,) integer(56)operator(,) - integer(64)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(116)operator(,) integer(57)operator(,) integer(64)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(165)operator(,) - operator(-)integer(1)operator(,) integer(63)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(108)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(109)operator(,) - integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(110)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(65)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) - integer(165)operator(,) integer(106)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(69)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(107)operator(,) - integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(70)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(66)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) - integer(165)operator(,) integer(67)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(68)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(73)operator(,) - integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(74)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(117)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(118)operator(,) - integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(79)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(80)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) - integer(165)operator(,) integer(71)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(72)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) - integer(271)operator(,) integer(166)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) integer(104)operator(,) integer(165)operator(,) integer(105)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) - integer(182)operator(,) operator(-)integer(1)operator(,) integer(165)operator(,) operator(-)integer(1)operator(,) integer(275)operator(,) operator(-)integer(1)operator(,) integer(148)operator(,) integer(271)operator(,) operator(-)integer(1)operator(,) integer(180)operator(,) - integer(272)operator(,) operator(-)integer(1)operator(,) integer(180)operator(,) integer(126)operator(,) integer(91)operator(,) integer(165)operator(,) integer(271)operator(,) operator(-)integer(1)operator(,) integer(264)operator(,) integer(272)operator(,) - operator(-)integer(1)operator(,) integer(91)operator(,) integer(165)operator(,) integer(271)operator(,) operator(-)integer(1)operator(,) integer(128)operator(,) integer(275)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(128)operator(,) - integer(171)operator(,) integer(271)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(128)operator(,) integer(209)operator(,) integer(271)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(128)operator(,) - integer(180)operator(,) integer(126)operator(,) integer(209)operator(,) integer(271)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(275)operator(,) operator(-)integer(1)operator(,) integer(169)operator(,) operator(-)integer(1)operator(,) - integer(148)operator(,) operator(-)integer(1)operator(,) integer(180)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) integer(180)operator(,) integer(126)operator(,) integer(91)operator(,) integer(167)operator(,) integer(179)operator(,) - operator(-)integer(1)operator(,) integer(264)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) integer(264)operator(,) integer(126)operator(,) integer(91)operator(,) integer(167)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) - integer(180)operator(,) integer(126)operator(,) integer(264)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) integer(180)operator(,) integer(126)operator(,) integer(264)operator(,) integer(126)operator(,) integer(91)operator(,) - integer(165)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(167)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) integer(178)operator(,) operator(-)integer(1)operator(,) integer(167)operator(,) - integer(126)operator(,) integer(180)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) integer(167)operator(,) integer(126)operator(,) integer(178)operator(,) operator(-)integer(1)operator(,) integer(167)operator(,) integer(126)operator(,) - integer(91)operator(,) integer(167)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) integer(167)operator(,) integer(126)operator(,) integer(180)operator(,) integer(126)operator(,) integer(91)operator(,) integer(167)operator(,) - integer(179)operator(,) operator(-)integer(1)operator(,) integer(264)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) integer(264)operator(,) integer(126)operator(,) integer(91)operator(,) integer(167)operator(,) integer(179)operator(,) - operator(-)integer(1)operator(,) integer(167)operator(,) integer(126)operator(,) integer(264)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) integer(167)operator(,) integer(126)operator(,) integer(180)operator(,) integer(126)operator(,) - integer(264)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) integer(167)operator(,) integer(126)operator(,) integer(264)operator(,) integer(126)operator(,) integer(91)operator(,) integer(167)operator(,) integer(179)operator(,) - operator(-)integer(1)operator(,) integer(167)operator(,) integer(126)operator(,) integer(180)operator(,) integer(126)operator(,) integer(264)operator(,) integer(126)operator(,) integer(91)operator(,) integer(167)operator(,) integer(179)operator(,) - operator(-)integer(1)operator(,) integer(91)operator(,) integer(167)operator(,) integer(179)operator(,) operator(-)integer(1)operator(,) integer(178)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(174)operator(,) integer(175)operator(,) - operator(-)integer(1)operator(,) integer(171)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(86)operator(,) integer(176)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(86)operator(,) - integer(172)operator(,) integer(177)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(92)operator(,) integer(167)operator(,) operator(-)integer(1)operator(,) integer(126)operator(,) integer(178)operator(,) operator(-)integer(1)operator(,) - integer(275)operator(,) operator(-)integer(1)operator(,) integer(167)operator(,) operator(-)integer(1)operator(,) integer(180)operator(,) integer(126)operator(,) integer(167)operator(,) operator(-)integer(1)operator(,) integer(180)operator(,) integer(126)operator(,) - integer(167)operator(,) operator(-)integer(1)operator(,) integer(180)operator(,) integer(126)operator(,) integer(91)operator(,) integer(167)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(167)operator(,) operator(-)integer(1)operator(,) - integer(223)operator(,) operator(-)integer(1)operator(,) integer(224)operator(,) operator(-)integer(1)operator(,) integer(227)operator(,) operator(-)integer(1)operator(,) integer(228)operator(,) operator(-)integer(1)operator(,) integer(229)operator(,) operator(-)integer(1)operator(,) - integer(232)operator(,) operator(-)integer(1)operator(,) integer(245)operator(,) operator(-)integer(1)operator(,) integer(247)operator(,) operator(-)integer(1)operator(,) integer(51)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) - integer(183)operator(,) integer(135)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(86)operator(,) integer(141)operator(,) integer(184)operator(,) integer(271)operator(,) integer(125)operator(,) - operator(-)integer(1)operator(,) integer(85)operator(,) integer(136)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(81)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) - integer(54)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(122)operator(,) integer(168)operator(,) integer(123)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(168)operator(,) integer(123)operator(,) - operator(-)integer(1)operator(,) integer(89)operator(,) integer(263)operator(,) integer(121)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) operator(-)integer(1)operator(,) integer(30)operator(,) integer(128)operator(,) integer(171)operator(,) - integer(125)operator(,) operator(-)integer(1)operator(,) integer(30)operator(,) integer(128)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(30)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) - integer(271)operator(,) integer(128)operator(,) integer(185)operator(,) integer(141)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(266)operator(,) integer(211)operator(,) operator(-)integer(1)operator(,) integer(210)operator(,) - operator(-)integer(1)operator(,) integer(210)operator(,) integer(211)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(142)operator(,) integer(200)operator(,) integer(136)operator(,) integer(202)operator(,) integer(10)operator(,) - operator(-)integer(1)operator(,) integer(12)operator(,) integer(142)operator(,) integer(200)operator(,) integer(136)operator(,) integer(203)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(18)operator(,) integer(186)operator(,) integer(142)operator(,) integer(201)operator(,) integer(187)operator(,) integer(136)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(19)operator(,) integer(188)operator(,) integer(142)operator(,) integer(201)operator(,) integer(189)operator(,) integer(136)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) integer(142)operator(,) - integer(270)operator(,) integer(216)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) integer(270)operator(,) integer(216)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) - integer(270)operator(,) integer(15)operator(,) integer(136)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(20)operator(,) integer(204)operator(,) integer(25)operator(,) - integer(190)operator(,) integer(142)operator(,) integer(201)operator(,) integer(191)operator(,) integer(136)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(157)operator(,) - integer(248)operator(,) integer(192)operator(,) integer(135)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(79)operator(,) integer(141)operator(,) - integer(193)operator(,) integer(273)operator(,) integer(194)operator(,) integer(135)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(4)operator(,) integer(157)operator(,) integer(195)operator(,) - integer(135)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(5)operator(,) integer(158)operator(,) integer(196)operator(,) integer(250)operator(,) integer(135)operator(,) integer(10)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(5)operator(,) integer(261)operator(,) integer(269)operator(,) integer(197)operator(,) integer(158)operator(,) integer(198)operator(,) integer(250)operator(,) - integer(135)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) integer(21)operator(,) operator(-)integer(1)operator(,) integer(22)operator(,) operator(-)integer(1)operator(,) integer(23)operator(,) operator(-)integer(1)operator(,) integer(24)operator(,) - operator(-)integer(1)operator(,) integer(182)operator(,) operator(-)integer(1)operator(,) integer(273)operator(,) operator(-)integer(1)operator(,) integer(105)operator(,) operator(-)integer(1)operator(,) integer(13)operator(,) operator(-)integer(1)operator(,) integer(273)operator(,) - integer(13)operator(,) operator(-)integer(1)operator(,) integer(273)operator(,) operator(-)integer(1)operator(,) integer(105)operator(,) operator(-)integer(1)operator(,) integer(27)operator(,) operator(-)integer(1)operator(,) integer(203)operator(,) operator(-)integer(1)operator(,) - integer(14)operator(,) integer(142)operator(,) integer(200)operator(,) integer(136)operator(,) integer(202)operator(,) operator(-)integer(1)operator(,) integer(275)operator(,) operator(-)integer(1)operator(,) integer(15)operator(,) integer(136)operator(,) - operator(-)integer(1)operator(,) integer(155)operator(,) operator(-)integer(1)operator(,) integer(149)operator(,) operator(-)integer(1)operator(,) integer(275)operator(,) operator(-)integer(1)operator(,) integer(108)operator(,) integer(108)operator(,) operator(-)integer(1)operator(,) - integer(72)operator(,) operator(-)integer(1)operator(,) integer(108)operator(,) integer(204)operator(,) integer(108)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(28)operator(,) integer(207)operator(,) - integer(205)operator(,) integer(208)operator(,) integer(136)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) integer(148)operator(,) integer(206)operator(,) operator(-)integer(1)operator(,) integer(209)operator(,) integer(124)operator(,) - integer(267)operator(,) integer(170)operator(,) operator(-)integer(1)operator(,) integer(209)operator(,) integer(81)operator(,) integer(267)operator(,) integer(170)operator(,) operator(-)integer(1)operator(,) integer(266)operator(,) integer(169)operator(,) - operator(-)integer(1)operator(,) integer(199)operator(,) integer(124)operator(,) integer(267)operator(,) integer(170)operator(,) operator(-)integer(1)operator(,) integer(199)operator(,) integer(81)operator(,) integer(267)operator(,) integer(169)operator(,) - operator(-)integer(1)operator(,) integer(199)operator(,) integer(81)operator(,) integer(268)operator(,) operator(-)integer(1)operator(,) integer(31)operator(,) integer(169)operator(,) operator(-)integer(1)operator(,) integer(31)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(120)operator(,) integer(212)operator(,) integer(205)operator(,) integer(213)operator(,) integer(136)operator(,) integer(121)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(26)operator(,) integer(214)operator(,) integer(205)operator(,) integer(215)operator(,) integer(136)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) integer(17)operator(,) integer(217)operator(,) - integer(200)operator(,) integer(136)operator(,) integer(218)operator(,) operator(-)integer(1)operator(,) integer(180)operator(,) operator(-)integer(1)operator(,) integer(180)operator(,) integer(126)operator(,) integer(91)operator(,) integer(167)operator(,) - operator(-)integer(1)operator(,) integer(91)operator(,) integer(167)operator(,) operator(-)integer(1)operator(,) integer(203)operator(,) operator(-)integer(1)operator(,) integer(216)operator(,) operator(-)integer(1)operator(,) integer(8)operator(,) integer(220)operator(,) - integer(221)operator(,) integer(200)operator(,) integer(136)operator(,) integer(219)operator(,) operator(-)integer(1)operator(,) integer(275)operator(,) operator(-)integer(1)operator(,) integer(167)operator(,) operator(-)integer(1)operator(,) integer(181)operator(,) - operator(-)integer(1)operator(,) integer(275)operator(,) operator(-)integer(1)operator(,) integer(84)operator(,) integer(155)operator(,) operator(-)integer(1)operator(,) integer(275)operator(,) operator(-)integer(1)operator(,) integer(9)operator(,) integer(136)operator(,) - operator(-)integer(1)operator(,) integer(275)operator(,) operator(-)integer(1)operator(,) integer(243)operator(,) operator(-)integer(1)operator(,) integer(240)operator(,) operator(-)integer(1)operator(,) integer(242)operator(,) operator(-)integer(1)operator(,) integer(225)operator(,) - operator(-)integer(1)operator(,) integer(226)operator(,) operator(-)integer(1)operator(,) integer(225)operator(,) integer(226)operator(,) operator(-)integer(1)operator(,) integer(94)operator(,) integer(234)operator(,) integer(101)operator(,) operator(-)integer(1)operator(,) - integer(95)operator(,) integer(235)operator(,) integer(101)operator(,) operator(-)integer(1)operator(,) integer(96)operator(,) integer(235)operator(,) integer(61)operator(,) operator(-)integer(1)operator(,) integer(97)operator(,) integer(129)operator(,) - integer(101)operator(,) operator(-)integer(1)operator(,) integer(97)operator(,) integer(230)operator(,) integer(101)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(230)operator(,) integer(231)operator(,) integer(129)operator(,) - operator(-)integer(1)operator(,) integer(236)operator(,) operator(-)integer(1)operator(,) integer(231)operator(,) integer(236)operator(,) operator(-)integer(1)operator(,) integer(98)operator(,) integer(129)operator(,) integer(101)operator(,) operator(-)integer(1)operator(,) - integer(98)operator(,) integer(233)operator(,) integer(101)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(233)operator(,) integer(58)operator(,) integer(129)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(234)operator(,) integer(236)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(235)operator(,) integer(236)operator(,) operator(-)integer(1)operator(,) integer(58)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(100)operator(,) integer(237)operator(,) integer(239)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(99)operator(,) integer(238)operator(,) integer(136)operator(,) integer(121)operator(,) operator(-)integer(1)operator(,) - integer(52)operator(,) operator(-)integer(1)operator(,) integer(53)operator(,) operator(-)integer(1)operator(,) integer(55)operator(,) operator(-)integer(1)operator(,) integer(247)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(241)operator(,) - operator(-)integer(1)operator(,) integer(158)operator(,) operator(-)integer(1)operator(,) integer(53)operator(,) operator(-)integer(1)operator(,) integer(52)operator(,) operator(-)integer(1)operator(,) integer(55)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) - integer(235)operator(,) integer(101)operator(,) operator(-)integer(1)operator(,) integer(56)operator(,) operator(-)integer(1)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(116)operator(,) integer(56)operator(,) operator(-)integer(1)operator(,) - integer(116)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) integer(53)operator(,) operator(-)integer(1)operator(,) integer(52)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) - operator(-)integer(1)operator(,) integer(55)operator(,) operator(-)integer(1)operator(,) integer(33)operator(,) operator(-)integer(1)operator(,) integer(32)operator(,) operator(-)integer(1)operator(,) integer(34)operator(,) operator(-)integer(1)operator(,) integer(35)operator(,) - operator(-)integer(1)operator(,) integer(49)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) operator(-)integer(1)operator(,) integer(244)operator(,) operator(-)integer(1)operator(,) integer(244)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) - operator(-)integer(1)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(273)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(107)operator(,) integer(249)operator(,) integer(142)operator(,) integer(273)operator(,) - operator(-)integer(1)operator(,) integer(1)operator(,) integer(273)operator(,) operator(-)integer(1)operator(,) integer(128)operator(,) integer(251)operator(,) integer(271)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) integer(251)operator(,) - integer(273)operator(,) operator(-)integer(1)operator(,) integer(253)operator(,) integer(126)operator(,) integer(255)operator(,) integer(126)operator(,) integer(257)operator(,) integer(260)operator(,) operator(-)integer(1)operator(,) integer(253)operator(,) - integer(126)operator(,) integer(255)operator(,) integer(260)operator(,) operator(-)integer(1)operator(,) integer(253)operator(,) integer(126)operator(,) integer(257)operator(,) integer(260)operator(,) operator(-)integer(1)operator(,) integer(253)operator(,) - integer(260)operator(,) operator(-)integer(1)operator(,) integer(255)operator(,) integer(126)operator(,) integer(257)operator(,) integer(260)operator(,) operator(-)integer(1)operator(,) integer(255)operator(,) integer(260)operator(,) operator(-)integer(1)operator(,) - integer(257)operator(,) integer(260)operator(,) operator(-)integer(1)operator(,) integer(259)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) integer(53)operator(,) operator(-)integer(1)operator(,) - integer(52)operator(,) operator(-)integer(1)operator(,) integer(55)operator(,) operator(-)integer(1)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) integer(252)operator(,) operator(-)integer(1)operator(,) integer(253)operator(,) integer(126)operator(,) - integer(252)operator(,) operator(-)integer(1)operator(,) integer(50)operator(,) integer(103)operator(,) integer(167)operator(,) operator(-)integer(1)operator(,) integer(254)operator(,) operator(-)integer(1)operator(,) integer(255)operator(,) integer(126)operator(,) - integer(254)operator(,) operator(-)integer(1)operator(,) integer(113)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(256)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) integer(256)operator(,) - operator(-)integer(1)operator(,) integer(110)operator(,) operator(-)integer(1)operator(,) integer(92)operator(,) operator(-)integer(1)operator(,) integer(258)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) integer(126)operator(,) integer(259)operator(,) - operator(-)integer(1)operator(,) integer(275)operator(,) operator(-)integer(1)operator(,) integer(245)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(128)operator(,) integer(262)operator(,) integer(141)operator(,) integer(271)operator(,) - integer(125)operator(,) operator(-)integer(1)operator(,) integer(275)operator(,) operator(-)integer(1)operator(,) integer(264)operator(,) integer(272)operator(,) operator(-)integer(1)operator(,) integer(180)operator(,) integer(272)operator(,) operator(-)integer(1)operator(,) - integer(265)operator(,) operator(-)integer(1)operator(,) integer(264)operator(,) integer(126)operator(,) integer(265)operator(,) operator(-)integer(1)operator(,) integer(167)operator(,) integer(84)operator(,) integer(167)operator(,) operator(-)integer(1)operator(,) - integer(50)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) integer(51)operator(,) operator(-)integer(1)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) - integer(51)operator(,) operator(-)integer(1)operator(,) integer(163)operator(,) operator(-)integer(1)operator(,) integer(50)operator(,) operator(-)integer(1)operator(,) integer(51)operator(,) operator(-)integer(1)operator(,) integer(163)operator(,) operator(-)integer(1)operator(,) - integer(124)operator(,) operator(-)integer(1)operator(,) integer(81)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(274)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(130)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(130)operator(,) operator(-)integer(1)operator(,) integer(126)operator(,) operator(-)integer(1)operator(,) integer(131)operator(,) operator(-)integer(1)operator(,) integer(130)operator(,) operator(-)integer(1)operator(,) integer(273)operator(,) - operator(-)integer(1)operator(,) integer(274)operator(,) integer(131)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1) -operator(};) - -comment(/* YYRLINE[YYN] -- source line where rule number YYN was defined. */) -directive(static) directive(const) ident(yytype_uint16) ident(yyrline)operator([]) operator(=) -operator({) - integer(0)operator(,) integer(350)operator(,) integer(350)operator(,) integer(350)operator(,) integer(375)operator(,) integer(395)operator(,) integer(403)operator(,) integer(404)operator(,) integer(408)operator(,) integer(412)operator(,) - integer(418)operator(,) integer(418)operator(,) integer(422)operator(,) integer(426)operator(,) integer(433)operator(,) integer(438)operator(,) integer(442)operator(,) integer(451)operator(,) integer(460)operator(,) integer(472)operator(,) - integer(484)operator(,) integer(490)operator(,) integer(489)operator(,) integer(503)operator(,) integer(511)operator(,) integer(515)operator(,) integer(521)operator(,) integer(546)operator(,) integer(562)operator(,) integer(574)operator(,) - integer(586)operator(,) integer(598)operator(,) integer(603)operator(,) integer(607)operator(,) integer(612)operator(,) integer(617)operator(,) integer(620)operator(,) integer(621)operator(,) integer(625)operator(,) integer(629)operator(,) - integer(633)operator(,) integer(637)operator(,) integer(640)operator(,) integer(647)operator(,) integer(648)operator(,) integer(649)operator(,) integer(653)operator(,) integer(657)operator(,) integer(663)operator(,) integer(664)operator(,) - integer(668)operator(,) integer(675)operator(,) integer(679)operator(,) integer(674)operator(,) integer(689)operator(,) integer(694)operator(,) integer(706)operator(,) integer(711)operator(,) integer(723)operator(,) integer(728)operator(,) - integer(740)operator(,) integer(745)operator(,) integer(752)operator(,) integer(753)operator(,) integer(759)operator(,) integer(760)operator(,) integer(766)operator(,) integer(770)operator(,) integer(774)operator(,) integer(778)operator(,) - integer(782)operator(,) integer(786)operator(,) integer(792)operator(,) integer(793)operator(,) integer(799)operator(,) integer(803)operator(,) integer(809)operator(,) integer(813)operator(,) integer(817)operator(,) integer(821)operator(,) - integer(825)operator(,) integer(829)operator(,) integer(835)operator(,) integer(841)operator(,) integer(848)operator(,) integer(852)operator(,) integer(856)operator(,) integer(860)operator(,) integer(864)operator(,) integer(868)operator(,) - integer(874)operator(,) integer(880)operator(,) integer(887)operator(,) integer(891)operator(,) integer(894)operator(,) integer(898)operator(,) integer(902)operator(,) integer(908)operator(,) integer(909)operator(,) integer(910)operator(,) - integer(911)operator(,) integer(916)operator(,) integer(923)operator(,) integer(924)operator(,) integer(927)operator(,) integer(931)operator(,) integer(934)operator(,) integer(938)operator(,) integer(938)operator(,) integer(944)operator(,) - integer(945)operator(,) integer(946)operator(,) integer(947)operator(,) integer(948)operator(,) integer(949)operator(,) integer(950)operator(,) integer(951)operator(,) integer(952)operator(,) integer(953)operator(,) integer(954)operator(,) - integer(955)operator(,) integer(956)operator(,) integer(957)operator(,) integer(958)operator(,) integer(959)operator(,) integer(960)operator(,) integer(961)operator(,) integer(962)operator(,) integer(963)operator(,) integer(964)operator(,) - integer(965)operator(,) integer(966)operator(,) integer(967)operator(,) integer(968)operator(,) integer(969)operator(,) integer(972)operator(,) integer(972)operator(,) integer(972)operator(,) integer(972)operator(,) integer(973)operator(,) - integer(973)operator(,) integer(973)operator(,) integer(973)operator(,) integer(973)operator(,) integer(973)operator(,) integer(973)operator(,) integer(974)operator(,) integer(974)operator(,) integer(974)operator(,) integer(974)operator(,) - integer(974)operator(,) integer(974)operator(,) integer(974)operator(,) integer(975)operator(,) integer(975)operator(,) integer(975)operator(,) integer(975)operator(,) integer(975)operator(,) integer(975)operator(,) integer(976)operator(,) - integer(976)operator(,) integer(976)operator(,) integer(976)operator(,) integer(976)operator(,) integer(976)operator(,) integer(976)operator(,) integer(977)operator(,) integer(977)operator(,) integer(977)operator(,) integer(977)operator(,) - integer(977)operator(,) integer(978)operator(,) integer(978)operator(,) integer(978)operator(,) integer(978)operator(,) integer(981)operator(,) integer(985)operator(,) integer(989)operator(,) integer(1014)operator(,) integer(1030)operator(,) - integer(1042)operator(,) integer(1054)operator(,) integer(1066)operator(,) integer(1071)operator(,) integer(1076)operator(,) integer(1081)operator(,) integer(1091)operator(,) integer(1101)operator(,) integer(1105)operator(,) integer(1109)operator(,) - integer(1113)operator(,) integer(1117)operator(,) integer(1121)operator(,) integer(1125)operator(,) integer(1129)operator(,) integer(1133)operator(,) integer(1142)operator(,) integer(1146)operator(,) integer(1150)operator(,) integer(1154)operator(,) - integer(1158)operator(,) integer(1162)operator(,) integer(1166)operator(,) integer(1170)operator(,) integer(1174)operator(,) integer(1178)operator(,) integer(1182)operator(,) integer(1186)operator(,) integer(1190)operator(,) integer(1194)operator(,) - integer(1198)operator(,) integer(1202)operator(,) integer(1206)operator(,) integer(1210)operator(,) integer(1214)operator(,) integer(1218)operator(,) integer(1222)operator(,) integer(1222)operator(,) integer(1227)operator(,) integer(1232)operator(,) - integer(1238)operator(,) integer(1245)operator(,) integer(1246)operator(,) integer(1251)operator(,) integer(1255)operator(,) integer(1260)operator(,) integer(1264)operator(,) integer(1271)operator(,) integer(1275)operator(,) integer(1279)operator(,) - integer(1284)operator(,) integer(1291)operator(,) integer(1292)operator(,) integer(1295)operator(,) integer(1300)operator(,) integer(1304)operator(,) integer(1309)operator(,) integer(1314)operator(,) integer(1319)operator(,) integer(1324)operator(,) - integer(1330)operator(,) integer(1334)operator(,) integer(1337)operator(,) integer(1341)operator(,) integer(1345)operator(,) integer(1350)operator(,) integer(1355)operator(,) integer(1360)operator(,) integer(1365)operator(,) integer(1370)operator(,) - integer(1375)operator(,) integer(1380)operator(,) integer(1385)operator(,) integer(1389)operator(,) integer(1392)operator(,) integer(1392)operator(,) integer(1404)operator(,) integer(1405)operator(,) integer(1405)operator(,) integer(1410)operator(,) - integer(1410)operator(,) integer(1417)operator(,) integer(1423)operator(,) integer(1427)operator(,) integer(1430)operator(,) integer(1434)operator(,) integer(1440)operator(,) integer(1444)operator(,) integer(1448)operator(,) integer(1454)operator(,) - integer(1455)operator(,) integer(1456)operator(,) integer(1457)operator(,) integer(1458)operator(,) integer(1459)operator(,) integer(1460)operator(,) integer(1461)operator(,) integer(1462)operator(,) integer(1467)operator(,) integer(1466)operator(,) - integer(1479)operator(,) integer(1479)operator(,) integer(1484)operator(,) integer(1489)operator(,) integer(1493)operator(,) integer(1497)operator(,) integer(1505)operator(,) integer(1514)operator(,) integer(1518)operator(,) integer(1522)operator(,) - integer(1526)operator(,) integer(1530)operator(,) integer(1534)operator(,) integer(1534)operator(,) integer(1539)operator(,) integer(1545)operator(,) integer(1546)operator(,) integer(1555)operator(,) integer(1568)operator(,) integer(1581)operator(,) - integer(1581)operator(,) integer(1581)operator(,) integer(1591)operator(,) integer(1591)operator(,) integer(1591)operator(,) integer(1601)operator(,) integer(1608)operator(,) integer(1612)operator(,) integer(1616)operator(,) integer(1616)operator(,) - integer(1616)operator(,) integer(1624)operator(,) integer(1623)operator(,) integer(1640)operator(,) integer(1645)operator(,) integer(1639)operator(,) integer(1662)operator(,) integer(1661)operator(,) integer(1678)operator(,) integer(1677)operator(,) - integer(1695)operator(,) integer(1696)operator(,) integer(1695)operator(,) integer(1710)operator(,) integer(1714)operator(,) integer(1718)operator(,) integer(1722)operator(,) integer(1728)operator(,) integer(1735)operator(,) integer(1736)operator(,) - integer(1737)operator(,) integer(1738)operator(,) integer(1741)operator(,) integer(1742)operator(,) integer(1743)operator(,) integer(1746)operator(,) integer(1747)operator(,) integer(1756)operator(,) integer(1757)operator(,) integer(1763)operator(,) - integer(1764)operator(,) integer(1767)operator(,) integer(1768)operator(,) integer(1772)operator(,) integer(1776)operator(,) integer(1783)operator(,) integer(1787)operator(,) integer(1782)operator(,) integer(1797)operator(,) integer(1806)operator(,) - integer(1810)operator(,) integer(1816)operator(,) integer(1821)operator(,) integer(1826)operator(,) integer(1831)operator(,) integer(1835)operator(,) integer(1839)operator(,) integer(1846)operator(,) integer(1850)operator(,) integer(1845)operator(,) - integer(1858)operator(,) integer(1862)operator(,) integer(1857)operator(,) integer(1871)operator(,) integer(1878)operator(,) integer(1879)operator(,) integer(1883)operator(,) integer(1889)operator(,) integer(1890)operator(,) integer(1893)operator(,) - integer(1904)operator(,) integer(1907)operator(,) integer(1911)operator(,) integer(1912)operator(,) integer(1915)operator(,) integer(1919)operator(,) integer(1922)operator(,) integer(1930)operator(,) integer(1933)operator(,) integer(1934)operator(,) - integer(1938)operator(,) integer(1941)operator(,) integer(1954)operator(,) integer(1955)operator(,) integer(1961)operator(,) integer(1967)operator(,) integer(1990)operator(,) integer(2023)operator(,) integer(2027)operator(,) integer(2034)operator(,) - integer(2037)operator(,) integer(2043)operator(,) integer(2044)operator(,) integer(2050)operator(,) integer(2054)operator(,) integer(2061)operator(,) integer(2064)operator(,) integer(2071)operator(,) integer(2074)operator(,) integer(2081)operator(,) - integer(2084)operator(,) integer(2090)operator(,) integer(2092)operator(,) integer(2091)operator(,) integer(2103)operator(,) integer(2102)operator(,) integer(2123)operator(,) integer(2124)operator(,) integer(2125)operator(,) integer(2126)operator(,) - integer(2129)operator(,) integer(2136)operator(,) integer(2137)operator(,) integer(2138)operator(,) integer(2139)operator(,) integer(2142)operator(,) integer(2176)operator(,) integer(2177)operator(,) integer(2178)operator(,) integer(2182)operator(,) - integer(2188)operator(,) integer(2189)operator(,) integer(2190)operator(,) integer(2191)operator(,) integer(2192)operator(,) integer(2193)operator(,) integer(2194)operator(,) integer(2195)operator(,) integer(2196)operator(,) integer(2197)operator(,) - integer(2198)operator(,) integer(2201)operator(,) integer(2207)operator(,) integer(2213)operator(,) integer(2214)operator(,) integer(2217)operator(,) integer(2222)operator(,) integer(2221)operator(,) integer(2229)operator(,) integer(2232)operator(,) - integer(2238)operator(,) integer(2244)operator(,) integer(2248)operator(,) integer(2252)operator(,) integer(2256)operator(,) integer(2260)operator(,) integer(2264)operator(,) integer(2268)operator(,) integer(2272)operator(,) integer(2277)operator(,) - integer(2282)operator(,) integer(2286)operator(,) integer(2290)operator(,) integer(2294)operator(,) integer(2298)operator(,) integer(2309)operator(,) integer(2310)operator(,) integer(2316)operator(,) integer(2326)operator(,) integer(2331)operator(,) - integer(2337)operator(,) integer(2338)operator(,) integer(2341)operator(,) integer(2352)operator(,) integer(2363)operator(,) integer(2364)operator(,) integer(2367)operator(,) integer(2377)operator(,) integer(2381)operator(,) integer(2384)operator(,) - integer(2389)operator(,) integer(2389)operator(,) integer(2414)operator(,) integer(2415)operator(,) integer(2419)operator(,) integer(2428)operator(,) integer(2429)operator(,) integer(2435)operator(,) integer(2441)operator(,) integer(2442)operator(,) - integer(2443)operator(,) integer(2446)operator(,) integer(2447)operator(,) integer(2448)operator(,) integer(2449)operator(,) integer(2452)operator(,) integer(2453)operator(,) integer(2454)operator(,) integer(2457)operator(,) integer(2458)operator(,) - integer(2461)operator(,) integer(2462)operator(,) integer(2465)operator(,) integer(2466)operator(,) integer(2469)operator(,) integer(2470)operator(,) integer(2471)operator(,) integer(2474)operator(,) integer(2475)operator(,) integer(2478)operator(,) - integer(2479)operator(,) integer(2482) -operator(};) -preprocessor(#endif) - -preprocessor(#if) ident(YYDEBUG) operator(||) ident(YYERROR_VERBOSE) operator(||) ident(YYTOKEN_TABLE) -comment(/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */) -directive(static) directive(const) pre_type(char) operator(*)directive(const) ident(yytname)operator([]) operator(=) -operator({) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) string')delimiter(")>operator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) integer(0) -operator(};) -preprocessor(#endif) - -preprocessor(# ifdef) ident(YYPRINT) -comment(/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */) -directive(static) directive(const) ident(yytype_uint16) ident(yytoknum)operator([]) operator(=) -operator({) - integer(0)operator(,) integer(256)operator(,) integer(257)operator(,) integer(258)operator(,) integer(259)operator(,) integer(260)operator(,) integer(261)operator(,) integer(262)operator(,) integer(263)operator(,) integer(264)operator(,) - integer(265)operator(,) integer(266)operator(,) integer(267)operator(,) integer(268)operator(,) integer(269)operator(,) integer(270)operator(,) integer(271)operator(,) integer(272)operator(,) integer(273)operator(,) integer(274)operator(,) - integer(275)operator(,) integer(276)operator(,) integer(277)operator(,) integer(278)operator(,) integer(279)operator(,) integer(280)operator(,) integer(281)operator(,) integer(282)operator(,) integer(283)operator(,) integer(284)operator(,) - integer(285)operator(,) integer(286)operator(,) integer(287)operator(,) integer(288)operator(,) integer(289)operator(,) integer(290)operator(,) integer(291)operator(,) integer(292)operator(,) integer(293)operator(,) integer(294)operator(,) - integer(295)operator(,) integer(296)operator(,) integer(297)operator(,) integer(298)operator(,) integer(299)operator(,) integer(300)operator(,) integer(301)operator(,) integer(302)operator(,) integer(303)operator(,) integer(304)operator(,) - integer(305)operator(,) integer(306)operator(,) integer(307)operator(,) integer(308)operator(,) integer(309)operator(,) integer(310)operator(,) integer(311)operator(,) integer(312)operator(,) integer(313)operator(,) integer(314)operator(,) - integer(315)operator(,) integer(316)operator(,) integer(317)operator(,) integer(318)operator(,) integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) integer(323)operator(,) integer(324)operator(,) - integer(325)operator(,) integer(326)operator(,) integer(327)operator(,) integer(328)operator(,) integer(329)operator(,) integer(330)operator(,) integer(331)operator(,) integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) - integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) integer(342)operator(,) integer(343)operator(,) integer(344)operator(,) - integer(345)operator(,) integer(346)operator(,) integer(347)operator(,) integer(348)operator(,) integer(349)operator(,) integer(350)operator(,) integer(351)operator(,) integer(352)operator(,) integer(353)operator(,) integer(354)operator(,) - integer(355)operator(,) integer(356)operator(,) integer(357)operator(,) integer(61)operator(,) integer(63)operator(,) integer(58)operator(,) integer(62)operator(,) integer(60)operator(,) integer(124)operator(,) integer(94)operator(,) - integer(38)operator(,) integer(43)operator(,) integer(45)operator(,) integer(42)operator(,) integer(47)operator(,) integer(37)operator(,) integer(358)operator(,) integer(33)operator(,) integer(126)operator(,) integer(359)operator(,) - integer(123)operator(,) integer(125)operator(,) integer(91)operator(,) integer(93)operator(,) integer(46)operator(,) integer(41)operator(,) integer(44)operator(,) integer(96)operator(,) integer(40)operator(,) integer(32)operator(,) - integer(10)operator(,) integer(59) -operator(};) -preprocessor(# endif) - -comment(/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */) -directive(static) directive(const) ident(yytype_uint16) ident(yyr1)operator([]) operator(=) -operator({) - integer(0)operator(,) integer(132)operator(,) integer(134)operator(,) integer(133)operator(,) integer(135)operator(,) integer(136)operator(,) integer(137)operator(,) integer(137)operator(,) integer(137)operator(,) integer(137)operator(,) - integer(139)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) - integer(138)operator(,) integer(140)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) - integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(138)operator(,) integer(141)operator(,) integer(141)operator(,) integer(141)operator(,) integer(141)operator(,) - integer(141)operator(,) integer(141)operator(,) integer(142)operator(,) integer(143)operator(,) integer(143)operator(,) integer(143)operator(,) integer(143)operator(,) integer(143)operator(,) integer(144)operator(,) integer(144)operator(,) - integer(144)operator(,) integer(146)operator(,) integer(147)operator(,) integer(145)operator(,) integer(148)operator(,) integer(148)operator(,) integer(148)operator(,) integer(148)operator(,) integer(148)operator(,) integer(148)operator(,) - integer(148)operator(,) integer(148)operator(,) integer(149)operator(,) integer(149)operator(,) integer(150)operator(,) integer(150)operator(,) integer(151)operator(,) integer(151)operator(,) integer(151)operator(,) integer(151)operator(,) - integer(151)operator(,) integer(151)operator(,) integer(152)operator(,) integer(152)operator(,) integer(153)operator(,) integer(153)operator(,) integer(154)operator(,) integer(154)operator(,) integer(154)operator(,) integer(154)operator(,) - integer(154)operator(,) integer(154)operator(,) integer(154)operator(,) integer(154)operator(,) integer(155)operator(,) integer(155)operator(,) integer(155)operator(,) integer(155)operator(,) integer(155)operator(,) integer(155)operator(,) - integer(155)operator(,) integer(155)operator(,) integer(156)operator(,) integer(156)operator(,) integer(157)operator(,) integer(157)operator(,) integer(157)operator(,) integer(158)operator(,) integer(158)operator(,) integer(158)operator(,) - integer(158)operator(,) integer(158)operator(,) integer(159)operator(,) integer(159)operator(,) integer(160)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) integer(161)operator(,) integer(163)operator(,) - integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) - integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) - integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(163)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) - integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) - integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) - integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) - integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(164)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) - integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) - integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) - integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) - integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(166)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) - integer(167)operator(,) integer(168)operator(,) integer(168)operator(,) integer(168)operator(,) integer(168)operator(,) integer(168)operator(,) integer(168)operator(,) integer(169)operator(,) integer(169)operator(,) integer(169)operator(,) - integer(169)operator(,) integer(170)operator(,) integer(170)operator(,) integer(171)operator(,) integer(171)operator(,) integer(171)operator(,) integer(171)operator(,) integer(171)operator(,) integer(171)operator(,) integer(171)operator(,) - integer(171)operator(,) integer(171)operator(,) integer(172)operator(,) integer(172)operator(,) integer(172)operator(,) integer(172)operator(,) integer(172)operator(,) integer(172)operator(,) integer(172)operator(,) integer(172)operator(,) - integer(172)operator(,) integer(172)operator(,) integer(172)operator(,) integer(172)operator(,) integer(174)operator(,) integer(173)operator(,) integer(175)operator(,) integer(176)operator(,) integer(175)operator(,) integer(177)operator(,) - integer(175)operator(,) integer(178)operator(,) integer(179)operator(,) integer(179)operator(,) integer(180)operator(,) integer(180)operator(,) integer(181)operator(,) integer(181)operator(,) integer(181)operator(,) integer(182)operator(,) - integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(183)operator(,) integer(182)operator(,) - integer(184)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) - integer(182)operator(,) integer(182)operator(,) integer(185)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(186)operator(,) - integer(187)operator(,) integer(182)operator(,) integer(188)operator(,) integer(189)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(190)operator(,) integer(191)operator(,) - integer(182)operator(,) integer(192)operator(,) integer(182)operator(,) integer(193)operator(,) integer(194)operator(,) integer(182)operator(,) integer(195)operator(,) integer(182)operator(,) integer(196)operator(,) integer(182)operator(,) - integer(197)operator(,) integer(198)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(182)operator(,) integer(199)operator(,) integer(200)operator(,) integer(200)operator(,) - integer(200)operator(,) integer(200)operator(,) integer(201)operator(,) integer(201)operator(,) integer(201)operator(,) integer(202)operator(,) integer(202)operator(,) integer(203)operator(,) integer(203)operator(,) integer(204)operator(,) - integer(204)operator(,) integer(205)operator(,) integer(205)operator(,) integer(205)operator(,) integer(205)operator(,) integer(207)operator(,) integer(208)operator(,) integer(206)operator(,) integer(209)operator(,) integer(209)operator(,) - integer(209)operator(,) integer(210)operator(,) integer(210)operator(,) integer(210)operator(,) integer(210)operator(,) integer(210)operator(,) integer(210)operator(,) integer(212)operator(,) integer(213)operator(,) integer(211)operator(,) - integer(214)operator(,) integer(215)operator(,) integer(211)operator(,) integer(216)operator(,) integer(217)operator(,) integer(217)operator(,) integer(217)operator(,) integer(218)operator(,) integer(218)operator(,) integer(219)operator(,) - integer(219)operator(,) integer(220)operator(,) integer(220)operator(,) integer(220)operator(,) integer(221)operator(,) integer(221)operator(,) integer(222)operator(,) integer(222)operator(,) integer(223)operator(,) integer(223)operator(,) - integer(223)operator(,) integer(224)operator(,) integer(225)operator(,) integer(225)operator(,) integer(226)operator(,) integer(227)operator(,) integer(228)operator(,) integer(229)operator(,) integer(229)operator(,) integer(230)operator(,) - integer(230)operator(,) integer(231)operator(,) integer(231)operator(,) integer(232)operator(,) integer(232)operator(,) integer(233)operator(,) integer(233)operator(,) integer(234)operator(,) integer(234)operator(,) integer(235)operator(,) - integer(235)operator(,) integer(236)operator(,) integer(237)operator(,) integer(236)operator(,) integer(238)operator(,) integer(236)operator(,) integer(239)operator(,) integer(239)operator(,) integer(239)operator(,) integer(239)operator(,) - integer(240)operator(,) integer(241)operator(,) integer(241)operator(,) integer(241)operator(,) integer(241)operator(,) integer(242)operator(,) integer(243)operator(,) integer(243)operator(,) integer(243)operator(,) integer(243)operator(,) - integer(244)operator(,) integer(244)operator(,) integer(244)operator(,) integer(244)operator(,) integer(244)operator(,) integer(244)operator(,) integer(244)operator(,) integer(244)operator(,) integer(244)operator(,) integer(244)operator(,) - integer(244)operator(,) integer(245)operator(,) integer(246)operator(,) integer(247)operator(,) integer(247)operator(,) integer(248)operator(,) integer(249)operator(,) integer(248)operator(,) integer(248)operator(,) integer(250)operator(,) - integer(250)operator(,) integer(251)operator(,) integer(251)operator(,) integer(251)operator(,) integer(251)operator(,) integer(251)operator(,) integer(251)operator(,) integer(251)operator(,) integer(251)operator(,) integer(251)operator(,) - integer(252)operator(,) integer(252)operator(,) integer(252)operator(,) integer(252)operator(,) integer(252)operator(,) integer(253)operator(,) integer(253)operator(,) integer(254)operator(,) integer(255)operator(,) integer(255)operator(,) - integer(256)operator(,) integer(256)operator(,) integer(257)operator(,) integer(257)operator(,) integer(258)operator(,) integer(258)operator(,) integer(259)operator(,) integer(260)operator(,) integer(260)operator(,) integer(261)operator(,) - integer(262)operator(,) integer(261)operator(,) integer(263)operator(,) integer(263)operator(,) integer(263)operator(,) integer(264)operator(,) integer(264)operator(,) integer(265)operator(,) integer(266)operator(,) integer(266)operator(,) - integer(266)operator(,) integer(267)operator(,) integer(267)operator(,) integer(267)operator(,) integer(267)operator(,) integer(268)operator(,) integer(268)operator(,) integer(268)operator(,) integer(269)operator(,) integer(269)operator(,) - integer(270)operator(,) integer(270)operator(,) integer(271)operator(,) integer(271)operator(,) integer(272)operator(,) integer(272)operator(,) integer(272)operator(,) integer(273)operator(,) integer(273)operator(,) integer(274)operator(,) - integer(274)operator(,) integer(275) -operator(};) - -comment(/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */) -directive(static) directive(const) ident(yytype_uint8) ident(yyr2)operator([]) operator(=) -operator({) - integer(0)operator(,) integer(2)operator(,) integer(0)operator(,) integer(2)operator(,) integer(4)operator(,) integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) integer(3)operator(,) integer(2)operator(,) - integer(0)operator(,) integer(4)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(2)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) - integer(3)operator(,) integer(0)operator(,) integer(5)operator(,) integer(4)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(6)operator(,) integer(5)operator(,) integer(5)operator(,) - integer(5)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(1)operator(,) integer(1)operator(,) integer(3)operator(,) integer(3)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(1)operator(,) integer(4)operator(,) - integer(4)operator(,) integer(0)operator(,) integer(0)operator(,) integer(6)operator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(4)operator(,) integer(5)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(1)operator(,) integer(3)operator(,) integer(1)operator(,) integer(3)operator(,) integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(2)operator(,) - integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) integer(3)operator(,) integer(2)operator(,) integer(3)operator(,) integer(1)operator(,) integer(4)operator(,) integer(3)operator(,) integer(3)operator(,) - integer(3)operator(,) integer(3)operator(,) integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) integer(4)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) - integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(1)operator(,) integer(3)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(0)operator(,) integer(4)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(3)operator(,) integer(5)operator(,) integer(3)operator(,) integer(6)operator(,) integer(5)operator(,) - integer(5)operator(,) integer(5)operator(,) integer(5)operator(,) integer(4)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) - integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(4)operator(,) integer(4)operator(,) integer(2)operator(,) integer(2)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) - integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(0)operator(,) integer(4)operator(,) integer(5)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(2)operator(,) integer(5)operator(,) integer(2)operator(,) integer(3)operator(,) integer(3)operator(,) integer(4)operator(,) integer(4)operator(,) - integer(6)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(5)operator(,) integer(2)operator(,) integer(5)operator(,) integer(4)operator(,) integer(7)operator(,) - integer(3)operator(,) integer(1)operator(,) integer(4)operator(,) integer(3)operator(,) integer(5)operator(,) integer(7)operator(,) integer(2)operator(,) integer(5)operator(,) integer(4)operator(,) integer(6)operator(,) - integer(7)operator(,) integer(9)operator(,) integer(3)operator(,) integer(1)operator(,) integer(0)operator(,) integer(2)operator(,) integer(1)operator(,) integer(0)operator(,) integer(3)operator(,) integer(0)operator(,) - integer(4)operator(,) integer(2)operator(,) integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) integer(3)operator(,) integer(3)operator(,) integer(4)operator(,) integer(2)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(0)operator(,) integer(4)operator(,) - integer(0)operator(,) integer(5)operator(,) integer(3)operator(,) integer(3)operator(,) integer(2)operator(,) integer(4)operator(,) integer(3)operator(,) integer(3)operator(,) integer(1)operator(,) integer(4)operator(,) - integer(3)operator(,) integer(1)operator(,) integer(0)operator(,) integer(6)operator(,) integer(2)operator(,) integer(1)operator(,) integer(2)operator(,) integer(6)operator(,) integer(6)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(7)operator(,) integer(0)operator(,) integer(0)operator(,) integer(7)operator(,) integer(5)operator(,) integer(4)operator(,) integer(5)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(9)operator(,) integer(0)operator(,) integer(6)operator(,) integer(0)operator(,) integer(0)operator(,) integer(8)operator(,) integer(0)operator(,) integer(5)operator(,) integer(0)operator(,) integer(6)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(9)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(5)operator(,) integer(1)operator(,) integer(2)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(1)operator(,) integer(3)operator(,) integer(0)operator(,) integer(0)operator(,) integer(6)operator(,) integer(2)operator(,) integer(4)operator(,) - integer(4)operator(,) integer(2)operator(,) integer(4)operator(,) integer(4)operator(,) integer(3)operator(,) integer(2)operator(,) integer(1)operator(,) integer(0)operator(,) integer(0)operator(,) integer(6)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(6)operator(,) integer(5)operator(,) integer(1)operator(,) integer(4)operator(,) integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) integer(6)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(1)operator(,) integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(0)operator(,) - integer(3)operator(,) integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(3)operator(,) integer(0)operator(,) integer(3)operator(,) integer(0)operator(,) integer(2)operator(,) integer(0)operator(,) - integer(2)operator(,) integer(1)operator(,) integer(0)operator(,) integer(3)operator(,) integer(0)operator(,) integer(4)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(3)operator(,) integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(0)operator(,) integer(4)operator(,) integer(2)operator(,) integer(4)operator(,) - integer(2)operator(,) integer(6)operator(,) integer(4)operator(,) integer(4)operator(,) integer(2)operator(,) integer(4)operator(,) integer(2)operator(,) integer(2)operator(,) integer(1)operator(,) integer(0)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(3)operator(,) integer(3)operator(,) integer(1)operator(,) integer(3)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(2)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(0)operator(,) integer(5)operator(,) integer(1)operator(,) integer(2)operator(,) integer(2)operator(,) integer(1)operator(,) integer(3)operator(,) integer(3)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(0)operator(,) integer(1)operator(,) integer(0)operator(,) integer(1)operator(,) integer(0)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(2)operator(,) integer(0) -operator(};) - -comment(/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */) -directive(static) directive(const) ident(yytype_uint16) ident(yydefact)operator([]) operator(=) -operator({) - integer(2)operator(,) integer(0)operator(,) integer(0)operator(,) integer(1)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(278)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(490)operator(,) integer(299)operator(,) integer(302)operator(,) integer(0)operator(,) integer(323)operator(,) integer(324)operator(,) integer(325)operator(,) integer(326)operator(,) - integer(288)operator(,) integer(291)operator(,) integer(356)operator(,) integer(426)operator(,) integer(425)operator(,) integer(427)operator(,) integer(428)operator(,) integer(0)operator(,) integer(0)operator(,) integer(492)operator(,) - integer(21)operator(,) integer(0)operator(,) integer(430)operator(,) integer(429)operator(,) integer(420)operator(,) integer(277)operator(,) integer(422)operator(,) integer(421)operator(,) integer(423)operator(,) integer(424)operator(,) - integer(416)operator(,) integer(417)operator(,) integer(433)operator(,) integer(434)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(501)operator(,) - integer(501)operator(,) integer(71)operator(,) integer(399)operator(,) integer(397)operator(,) integer(399)operator(,) integer(399)operator(,) integer(389)operator(,) integer(395)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(3)operator(,) integer(490)operator(,) integer(7)operator(,) integer(35)operator(,) integer(36)operator(,) integer(44)operator(,) integer(43)operator(,) integer(0)operator(,) integer(62)operator(,) - integer(0)operator(,) integer(66)operator(,) integer(72)operator(,) integer(0)operator(,) integer(41)operator(,) integer(219)operator(,) integer(0)operator(,) integer(48)operator(,) integer(295)operator(,) integer(269)operator(,) - integer(270)operator(,) integer(381)operator(,) integer(382)operator(,) integer(271)operator(,) integer(272)operator(,) integer(273)operator(,) integer(274)operator(,) integer(379)operator(,) integer(380)operator(,) integer(378)operator(,) - integer(431)operator(,) integer(275)operator(,) integer(0)operator(,) integer(276)operator(,) integer(254)operator(,) integer(6)operator(,) integer(9)operator(,) integer(323)operator(,) integer(324)operator(,) integer(288)operator(,) - integer(291)operator(,) integer(356)operator(,) integer(492)operator(,) integer(92)operator(,) integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(95)operator(,) - integer(0)operator(,) integer(327)operator(,) integer(0)operator(,) integer(431)operator(,) integer(276)operator(,) integer(0)operator(,) integer(316)operator(,) integer(144)operator(,) integer(155)operator(,) integer(145)operator(,) - integer(168)operator(,) integer(141)operator(,) integer(161)operator(,) integer(151)operator(,) integer(150)operator(,) integer(171)operator(,) integer(172)operator(,) integer(166)operator(,) integer(149)operator(,) integer(148)operator(,) - integer(143)operator(,) integer(169)operator(,) integer(173)operator(,) integer(174)operator(,) integer(153)operator(,) integer(142)operator(,) integer(156)operator(,) integer(160)operator(,) integer(162)operator(,) integer(154)operator(,) - integer(147)operator(,) integer(163)operator(,) integer(170)operator(,) integer(165)operator(,) integer(164)operator(,) integer(157)operator(,) integer(167)operator(,) integer(152)operator(,) integer(140)operator(,) integer(159)operator(,) - integer(158)operator(,) integer(139)operator(,) integer(146)operator(,) integer(137)operator(,) integer(138)operator(,) integer(135)operator(,) integer(136)operator(,) integer(97)operator(,) integer(99)operator(,) integer(98)operator(,) - integer(130)operator(,) integer(131)operator(,) integer(128)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(117)operator(,) integer(119)operator(,) integer(115)operator(,) integer(132)operator(,) - integer(133)operator(,) integer(120)operator(,) integer(121)operator(,) integer(125)operator(,) integer(116)operator(,) integer(118)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(122)operator(,) - integer(123)operator(,) integer(124)operator(,) integer(126)operator(,) integer(127)operator(,) integer(129)operator(,) integer(134)operator(,) integer(470)operator(,) integer(318)operator(,) integer(100)operator(,) integer(101)operator(,) - integer(469)operator(,) integer(0)operator(,) integer(164)operator(,) integer(157)operator(,) integer(167)operator(,) integer(152)operator(,) integer(135)operator(,) integer(136)operator(,) integer(97)operator(,) integer(98)operator(,) - integer(102)operator(,) integer(104)operator(,) integer(106)operator(,) integer(15)operator(,) integer(103)operator(,) integer(105)operator(,) integer(0)operator(,) integer(0)operator(,) integer(42)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(431)operator(,) integer(0)operator(,) integer(276)operator(,) integer(0)operator(,) integer(498)operator(,) integer(497)operator(,) integer(490)operator(,) integer(0)operator(,) - integer(499)operator(,) integer(491)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(340)operator(,) integer(339)operator(,) integer(0)operator(,) integer(0)operator(,) integer(431)operator(,) - integer(276)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(233)operator(,) integer(220)operator(,) integer(264)operator(,) integer(46)operator(,) integer(241)operator(,) integer(501)operator(,) - integer(501)operator(,) integer(475)operator(,) integer(47)operator(,) integer(45)operator(,) integer(0)operator(,) integer(61)operator(,) integer(0)operator(,) integer(501)operator(,) integer(355)operator(,) integer(60)operator(,) - integer(39)operator(,) integer(0)operator(,) integer(10)operator(,) integer(493)operator(,) integer(216)operator(,) integer(0)operator(,) integer(0)operator(,) integer(195)operator(,) integer(0)operator(,) integer(196)operator(,) - integer(284)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(62)operator(,) integer(280)operator(,) integer(0)operator(,) integer(492)operator(,) integer(0)operator(,) integer(494)operator(,) - integer(494)operator(,) integer(221)operator(,) integer(494)operator(,) integer(0)operator(,) integer(494)operator(,) integer(472)operator(,) integer(0)operator(,) integer(70)operator(,) integer(0)operator(,) integer(76)operator(,) - integer(83)operator(,) integer(413)operator(,) integer(412)operator(,) integer(414)operator(,) integer(411)operator(,) integer(0)operator(,) integer(410)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(418)operator(,) integer(419)operator(,) integer(40)operator(,) integer(210)operator(,) integer(211)operator(,) integer(5)operator(,) - integer(491)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(345)operator(,) integer(348)operator(,) - integer(0)operator(,) integer(74)operator(,) integer(0)operator(,) integer(69)operator(,) integer(67)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(360)operator(,) integer(357)operator(,) integer(296)operator(,) - integer(383)operator(,) integer(0)operator(,) integer(0)operator(,) integer(351)operator(,) integer(54)operator(,) integer(294)operator(,) integer(0)operator(,) integer(313)operator(,) integer(92)operator(,) integer(93)operator(,) - integer(94)operator(,) integer(418)operator(,) integer(419)operator(,) integer(0)operator(,) integer(436)operator(,) integer(311)operator(,) integer(435)operator(,) integer(0)operator(,) integer(501)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(449)operator(,) integer(489)operator(,) integer(488)operator(,) integer(320)operator(,) integer(107)operator(,) integer(0)operator(,) integer(501)operator(,) integer(284)operator(,) - integer(330)operator(,) integer(329)operator(,) integer(0)operator(,) integer(328)operator(,) integer(0)operator(,) integer(0)operator(,) integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(500)operator(,) integer(0)operator(,) integer(0)operator(,) integer(284)operator(,) integer(0)operator(,) - integer(501)operator(,) integer(0)operator(,) integer(308)operator(,) integer(501)operator(,) integer(261)operator(,) integer(0)operator(,) integer(0)operator(,) integer(234)operator(,) integer(263)operator(,) integer(0)operator(,) - integer(236)operator(,) integer(290)operator(,) integer(0)operator(,) integer(257)operator(,) integer(256)operator(,) integer(255)operator(,) integer(233)operator(,) integer(492)operator(,) integer(501)operator(,) integer(492)operator(,) - integer(0)operator(,) integer(12)operator(,) integer(14)operator(,) integer(13)operator(,) integer(0)operator(,) integer(292)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(282)operator(,) integer(63)operator(,) integer(492)operator(,) integer(492)operator(,) integer(222)operator(,) integer(286)operator(,) integer(496)operator(,) - integer(495)operator(,) integer(223)operator(,) integer(496)operator(,) integer(225)operator(,) integer(496)operator(,) integer(474)operator(,) integer(287)operator(,) integer(473)operator(,) integer(82)operator(,) integer(0)operator(,) - integer(501)operator(,) integer(0)operator(,) integer(401)operator(,) integer(404)operator(,) integer(402)operator(,) integer(415)operator(,) integer(400)operator(,) integer(384)operator(,) integer(398)operator(,) integer(385)operator(,) - integer(386)operator(,) integer(387)operator(,) integer(388)operator(,) integer(0)operator(,) integer(391)operator(,) integer(393)operator(,) integer(0)operator(,) integer(394)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(8)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(37)operator(,) integer(38)operator(,) integer(501)operator(,) integer(0)operator(,) - integer(25)operator(,) integer(33)operator(,) integer(0)operator(,) integer(34)operator(,) integer(0)operator(,) integer(68)operator(,) integer(75)operator(,) integer(24)operator(,) integer(175)operator(,) integer(264)operator(,) - integer(32)operator(,) integer(192)operator(,) integer(200)operator(,) integer(205)operator(,) integer(206)operator(,) integer(207)operator(,) integer(202)operator(,) integer(204)operator(,) integer(214)operator(,) integer(215)operator(,) - integer(208)operator(,) integer(209)operator(,) integer(185)operator(,) integer(186)operator(,) integer(212)operator(,) integer(213)operator(,) integer(0)operator(,) integer(201)operator(,) integer(203)operator(,) integer(197)operator(,) - integer(198)operator(,) integer(199)operator(,) integer(187)operator(,) integer(188)operator(,) integer(189)operator(,) integer(190)operator(,) integer(191)operator(,) integer(481)operator(,) integer(486)operator(,) integer(482)operator(,) - integer(487)operator(,) integer(254)operator(,) integer(354)operator(,) integer(0)operator(,) integer(481)operator(,) integer(483)operator(,) integer(482)operator(,) integer(484)operator(,) integer(501)operator(,) integer(481)operator(,) - integer(482)operator(,) integer(254)operator(,) integer(254)operator(,) integer(501)operator(,) integer(501)operator(,) integer(26)operator(,) integer(177)operator(,) integer(31)operator(,) integer(184)operator(,) integer(51)operator(,) - integer(55)operator(,) integer(0)operator(,) integer(438)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(93)operator(,) integer(96)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(501)operator(,) integer(0)operator(,) integer(492)operator(,) integer(454)operator(,) integer(452)operator(,) integer(451)operator(,) integer(450)operator(,) integer(453)operator(,) integer(461)operator(,) integer(465)operator(,) - integer(464)operator(,) integer(460)operator(,) integer(449)operator(,) integer(0)operator(,) integer(0)operator(,) integer(455)operator(,) integer(501)operator(,) integer(458)operator(,) integer(501)operator(,) integer(463)operator(,) - integer(501)operator(,) integer(0)operator(,) integer(448)operator(,) integer(0)operator(,) integer(0)operator(,) integer(279)operator(,) integer(501)operator(,) integer(501)operator(,) integer(370)operator(,) integer(501)operator(,) - integer(331)operator(,) integer(175)operator(,) integer(485)operator(,) integer(283)operator(,) integer(0)operator(,) integer(481)operator(,) integer(482)operator(,) integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(364)operator(,) integer(0)operator(,) integer(306)operator(,) integer(334)operator(,) integer(333)operator(,) integer(300)operator(,) integer(332)operator(,) integer(303)operator(,) integer(485)operator(,) - integer(283)operator(,) integer(0)operator(,) integer(481)operator(,) integer(482)operator(,) integer(0)operator(,) integer(0)operator(,) integer(240)operator(,) integer(477)operator(,) integer(0)operator(,) integer(265)operator(,) - integer(262)operator(,) integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(476)operator(,) integer(289)operator(,) integer(0)operator(,) integer(41)operator(,) integer(0)operator(,) integer(259)operator(,) - integer(0)operator(,) integer(253)operator(,) integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(227)operator(,) integer(11)operator(,) - integer(0)operator(,) integer(217)operator(,) integer(0)operator(,) integer(23)operator(,) integer(183)operator(,) integer(63)operator(,) integer(0)operator(,) integer(226)operator(,) integer(0)operator(,) integer(265)operator(,) - integer(79)operator(,) integer(81)operator(,) integer(0)operator(,) integer(481)operator(,) integer(482)operator(,) integer(0)operator(,) integer(0)operator(,) integer(390)operator(,) integer(392)operator(,) integer(396)operator(,) - integer(193)operator(,) integer(194)operator(,) integer(343)operator(,) integer(0)operator(,) integer(346)operator(,) integer(341)operator(,) integer(268)operator(,) integer(0)operator(,) integer(73)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(353)operator(,) integer(58)operator(,) integer(285)operator(,) integer(0)operator(,) integer(0)operator(,) integer(232)operator(,) integer(352)operator(,) - integer(56)operator(,) integer(231)operator(,) integer(350)operator(,) integer(50)operator(,) integer(349)operator(,) integer(49)operator(,) integer(361)operator(,) integer(358)operator(,) integer(501)operator(,) integer(314)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(285)operator(,) integer(317)operator(,) integer(0)operator(,) integer(0)operator(,) integer(492)operator(,) integer(0)operator(,) integer(440)operator(,) integer(0)operator(,) - integer(444)operator(,) integer(468)operator(,) integer(0)operator(,) integer(446)operator(,) integer(462)operator(,) integer(0)operator(,) integer(447)operator(,) integer(466)operator(,) integer(321)operator(,) integer(108)operator(,) - integer(371)operator(,) integer(372)operator(,) integer(501)operator(,) integer(373)operator(,) integer(0)operator(,) integer(501)operator(,) integer(337)operator(,) integer(0)operator(,) integer(0)operator(,) integer(335)operator(,) - integer(0)operator(,) integer(285)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(305)operator(,) integer(307)operator(,) integer(366)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(285)operator(,) integer(0)operator(,) integer(501)operator(,) integer(0)operator(,) integer(238)operator(,) integer(501)operator(,) integer(501)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(258)operator(,) integer(0)operator(,) integer(246)operator(,) integer(228)operator(,) integer(0)operator(,) integer(492)operator(,) integer(501)operator(,) integer(501)operator(,) integer(229)operator(,) - integer(0)operator(,) integer(22)operator(,) integer(281)operator(,) integer(492)operator(,) integer(77)operator(,) integer(0)operator(,) integer(406)operator(,) integer(407)operator(,) integer(408)operator(,) integer(403)operator(,) - integer(409)operator(,) integer(342)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(266)operator(,) integer(176)operator(,) integer(218)operator(,) integer(30)operator(,) integer(181)operator(,) - integer(182)operator(,) integer(59)operator(,) integer(0)operator(,) integer(28)operator(,) integer(179)operator(,) integer(29)operator(,) integer(180)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(52)operator(,) integer(0)operator(,) integer(437)operator(,) integer(312)operator(,) integer(471)operator(,) integer(457)operator(,) integer(0)operator(,) integer(319)operator(,) integer(456)operator(,) integer(501)operator(,) - integer(501)operator(,) integer(467)operator(,) integer(0)operator(,) integer(459)operator(,) integer(501)operator(,) integer(449)operator(,) integer(0)operator(,) integer(0)operator(,) integer(375)operator(,) integer(338)operator(,) - integer(0)operator(,) integer(4)operator(,) integer(377)operator(,) integer(0)operator(,) integer(297)operator(,) integer(0)operator(,) integer(298)operator(,) integer(0)operator(,) integer(501)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(309)operator(,) integer(235)operator(,) integer(0)operator(,) integer(237)operator(,) integer(252)operator(,) integer(0)operator(,) integer(243)operator(,) integer(501)operator(,) integer(501)operator(,) - integer(260)operator(,) integer(0)operator(,) integer(0)operator(,) integer(293)operator(,) integer(224)operator(,) integer(405)operator(,) integer(344)operator(,) integer(0)operator(,) integer(267)operator(,) integer(27)operator(,) - integer(178)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(439)operator(,) integer(0)operator(,) integer(442)operator(,) integer(443)operator(,) integer(445)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(374)operator(,) integer(0)operator(,) integer(84)operator(,) integer(91)operator(,) integer(0)operator(,) integer(376)operator(,) integer(0)operator(,) integer(365)operator(,) - integer(367)operator(,) integer(368)operator(,) integer(363)operator(,) integer(301)operator(,) integer(304)operator(,) integer(0)operator(,) integer(501)operator(,) integer(501)operator(,) integer(0)operator(,) integer(242)operator(,) - integer(0)operator(,) integer(248)operator(,) integer(501)operator(,) integer(230)operator(,) integer(347)operator(,) integer(362)operator(,) integer(359)operator(,) integer(0)operator(,) integer(315)operator(,) integer(501)operator(,) - integer(0)operator(,) integer(90)operator(,) integer(0)operator(,) integer(501)operator(,) integer(0)operator(,) integer(501)operator(,) integer(501)operator(,) integer(0)operator(,) integer(239)operator(,) integer(244)operator(,) - integer(0)operator(,) integer(501)operator(,) integer(0)operator(,) integer(247)operator(,) integer(53)operator(,) integer(441)operator(,) integer(322)operator(,) integer(485)operator(,) integer(89)operator(,) integer(0)operator(,) - integer(481)operator(,) integer(482)operator(,) integer(369)operator(,) integer(336)operator(,) integer(310)operator(,) integer(501)operator(,) integer(0)operator(,) integer(249)operator(,) integer(501)operator(,) integer(85)operator(,) - integer(245)operator(,) integer(0)operator(,) integer(250)operator(,) integer(501)operator(,) integer(251) -operator(};) - -comment(/* YYDEFGOTO[NTERM-NUM]. */) -directive(static) directive(const) ident(yytype_int16) ident(yydefgoto)operator([]) operator(=) -operator({) - operator(-)integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(377)operator(,) integer(378)operator(,) integer(62)operator(,) integer(63)operator(,) integer(424)operator(,) integer(255)operator(,) integer(64)operator(,) - integer(209)operator(,) integer(65)operator(,) integer(66)operator(,) integer(540)operator(,) integer(678)operator(,) integer(823)operator(,) integer(67)operator(,) integer(68)operator(,) integer(263)operator(,) integer(69)operator(,) - integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(210)operator(,) integer(109)operator(,) integer(110)operator(,) integer(200)operator(,) integer(201)operator(,) integer(202)operator(,) integer(203)operator(,) - integer(574)operator(,) integer(527)operator(,) integer(189)operator(,) integer(74)operator(,) integer(426)operator(,) integer(236)operator(,) integer(268)operator(,) integer(668)operator(,) integer(669)operator(,) integer(237)operator(,) - integer(619)operator(,) integer(245)operator(,) integer(246)operator(,) integer(415)operator(,) integer(620)operator(,) integer(730)operator(,) integer(610)operator(,) integer(407)operator(,) integer(269)operator(,) integer(483)operator(,) - integer(75)operator(,) integer(206)operator(,) integer(435)operator(,) integer(630)operator(,) integer(222)operator(,) integer(720)operator(,) integer(223)operator(,) integer(721)operator(,) integer(604)operator(,) integer(845)operator(,) - integer(544)operator(,) integer(541)operator(,) integer(771)operator(,) integer(370)operator(,) integer(372)operator(,) integer(573)operator(,) integer(785)operator(,) integer(258)operator(,) integer(382)operator(,) integer(596)operator(,) - integer(708)operator(,) integer(709)operator(,) integer(228)operator(,) integer(654)operator(,) integer(309)operator(,) integer(478)operator(,) integer(753)operator(,) integer(77)operator(,) integer(78)operator(,) integer(355)operator(,) - integer(534)operator(,) integer(769)operator(,) integer(533)operator(,) integer(768)operator(,) integer(394)operator(,) integer(592)operator(,) integer(842)operator(,) integer(577)operator(,) integer(702)operator(,) integer(787)operator(,) - integer(791)operator(,) integer(79)operator(,) integer(80)operator(,) integer(81)operator(,) integer(82)operator(,) integer(83)operator(,) integer(84)operator(,) integer(85)operator(,) integer(291)operator(,) integer(463)operator(,) - integer(86)operator(,) integer(293)operator(,) integer(287)operator(,) integer(285)operator(,) integer(456)operator(,) integer(646)operator(,) integer(645)operator(,) integer(749)operator(,) integer(87)operator(,) integer(286)operator(,) - integer(88)operator(,) integer(89)operator(,) integer(212)operator(,) integer(91)operator(,) integer(213)operator(,) integer(214)operator(,) integer(365)operator(,) integer(543)operator(,) integer(563)operator(,) integer(564)operator(,) - integer(565)operator(,) integer(566)operator(,) integer(567)operator(,) integer(568)operator(,) integer(569)operator(,) integer(570)operator(,) integer(571)operator(,) integer(781)operator(,) integer(690)operator(,) integer(191)operator(,) - integer(371)operator(,) integer(273)operator(,) integer(270)operator(,) integer(241)operator(,) integer(115)operator(,) integer(548)operator(,) integer(522)operator(,) integer(375)operator(,) integer(219)operator(,) integer(254)operator(,) - integer(441)operator(,) integer(383)operator(,) integer(221)operator(,) integer(95) -operator(};) - -comment(/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */) -preprocessor(#define) ident(YYPACT_NINF) operator(-)integer(654) -directive(static) directive(const) ident(yytype_int16) ident(yypact)operator([]) operator(=) -operator({) - operator(-)integer(654)operator(,) integer(73)operator(,) integer(2254)operator(,) operator(-)integer(654)operator(,) integer(5471)operator(,) integer(7939)operator(,) integer(8236)operator(,) integer(3906)operator(,) integer(5121)operator(,) operator(-)integer(654)operator(,) - integer(6810)operator(,) integer(6810)operator(,) integer(3777)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(8038)operator(,) integer(5677)operator(,) integer(5677)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(5677)operator(,) integer(4436)operator(,) integer(4539)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(6810)operator(,) integer(4996)operator(,) operator(-)integer(44)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(3)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(2117)operator(,) integer(4024)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(4127)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(50)operator(,) integer(3187)operator(,) integer(6810)operator(,) integer(6913)operator(,) - integer(7634)operator(,) integer(8335)operator(,) integer(4871)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(18)operator(,) operator(-)integer(1)operator(,) integer(94)operator(,) integer(7737)operator(,) - integer(7634)operator(,) operator(-)integer(654)operator(,) integer(124)operator(,) integer(757)operator(,) integer(249)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(104)operator(,) integer(74)operator(,) operator(-)integer(654)operator(,) - integer(57)operator(,) integer(8137)operator(,) operator(-)integer(654)operator(,) integer(96)operator(,) integer(9349)operator(,) integer(171)operator(,) integer(485)operator(,) integer(11)operator(,) integer(32)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) integer(120)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(10)operator(,) operator(-)integer(654)operator(,) integer(64)operator(,) integer(38)operator(,) integer(42)operator(,) operator(-)integer(654)operator(,) integer(757)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(99)operator(,) integer(111)operator(,) operator(-)integer(44)operator(,) integer(129)operator(,) integer(140)operator(,) integer(6810)operator(,) integer(90)operator(,) integer(3318)operator(,) integer(325)operator(,) operator(-)integer(654)operator(,) - integer(78)operator(,) operator(-)integer(654)operator(,) integer(549)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(42)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(95)operator(,) integer(148)operator(,) integer(282)operator(,) integer(333)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(336)operator(,) integer(337)operator(,) integer(465)operator(,) operator(-)integer(654)operator(,) integer(473)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) integer(495)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(147)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(2615)operator(,) integer(225)operator(,) integer(249)operator(,) integer(48)operator(,) - integer(188)operator(,) integer(558)operator(,) integer(31)operator(,) integer(213)operator(,) integer(258)operator(,) integer(48)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(124)operator(,) integer(88)operator(,) - operator(-)integer(654)operator(,) integer(209)operator(,) integer(6810)operator(,) integer(6810)operator(,) integer(288)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(559)operator(,) integer(324)operator(,) integer(66)operator(,) - integer(245)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) operator(-)integer(654)operator(,) integer(9349)operator(,) integer(274)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(262)operator(,) - integer(269)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(5363)operator(,) operator(-)integer(654)operator(,) integer(5780)operator(,) integer(5677)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) integer(222)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(275)operator(,) integer(285)operator(,) integer(3449)operator(,) operator(-)integer(654)operator(,) integer(571)operator(,) integer(366)operator(,) - integer(476)operator(,) integer(3187)operator(,) integer(310)operator(,) integer(315)operator(,) integer(342)operator(,) integer(249)operator(,) integer(7634)operator(,) operator(-)integer(44)operator(,) integer(371)operator(,) integer(392)operator(,) - integer(401)operator(,) operator(-)integer(654)operator(,) integer(480)operator(,) integer(375)operator(,) integer(401)operator(,) operator(-)integer(654)operator(,) integer(470)operator(,) operator(-)integer(654)operator(,) integer(586)operator(,) integer(595)operator(,) - integer(618)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(231)operator(,) operator(-)integer(654)operator(,) integer(482)operator(,) integer(515)operator(,) integer(674)operator(,) - integer(425)operator(,) integer(565)operator(,) integer(444)operator(,) integer(30)operator(,) integer(493)operator(,) integer(499)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(3674)operator(,) integer(6810)operator(,) integer(6810)operator(,) integer(6810)operator(,) integer(6810)operator(,) integer(5471)operator(,) integer(6810)operator(,) integer(6810)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(7016)operator(,) operator(-)integer(654)operator(,) integer(3187)operator(,) integer(8335)operator(,) integer(438)operator(,) integer(7016)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) - integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) - integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(7634)operator(,) - integer(7634)operator(,) integer(7634)operator(,) integer(1612)operator(,) integer(6913)operator(,) integer(8489)operator(,) integer(8555)operator(,) integer(8555)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) integer(7737)operator(,) integer(7737)operator(,) operator(-)integer(654)operator(,) integer(501)operator(,) operator(-)integer(654)operator(,) integer(275)operator(,) integer(249)operator(,) operator(-)integer(654)operator(,) integer(623)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(124)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(8621)operator(,) integer(6913)operator(,) integer(8555)operator(,) - integer(2615)operator(,) integer(6810)operator(,) integer(419)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(583)operator(,) integer(596)operator(,) integer(283)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(2737)operator(,) integer(590)operator(,) integer(7634)operator(,) integer(8687)operator(,) integer(6913)operator(,) integer(8753)operator(,) integer(7634)operator(,) integer(7634)operator(,) - integer(2981)operator(,) integer(601)operator(,) integer(3571)operator(,) integer(7119)operator(,) integer(611)operator(,) operator(-)integer(654)operator(,) integer(18)operator(,) integer(18)operator(,) integer(252)operator(,) integer(8819)operator(,) - integer(6913)operator(,) integer(8885)operator(,) operator(-)integer(654)operator(,) integer(498)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) integer(5883)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(5986)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(503)operator(,) integer(5574)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(104)operator(,) operator(-)integer(44)operator(,) integer(510)operator(,) integer(9)operator(,) - integer(512)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(5121)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) integer(3449)operator(,) integer(528)operator(,) integer(8687)operator(,) - integer(8753)operator(,) integer(7634)operator(,) integer(529)operator(,) operator(-)integer(654)operator(,) integer(527)operator(,) operator(-)integer(44)operator(,) integer(9213)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(7222)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(623)operator(,) integer(8951)operator(,) - integer(6913)operator(,) integer(9017)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(25)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(534)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) integer(7634)operator(,) - integer(757)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(37)operator(,) integer(7634)operator(,) - operator(-)integer(654)operator(,) integer(544)operator(,) integer(546)operator(,) operator(-)integer(654)operator(,) integer(550)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(1775)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) integer(366)operator(,) integer(9418)operator(,) integer(9418)operator(,) integer(9418)operator(,) integer(9418)operator(,) integer(547)operator(,) integer(547)operator(,) integer(9435)operator(,) integer(1667)operator(,) - integer(9418)operator(,) integer(9418)operator(,) integer(9366)operator(,) integer(9366)operator(,) integer(394)operator(,) integer(394)operator(,) integer(2464)operator(,) integer(547)operator(,) integer(547)operator(,) integer(714)operator(,) - integer(714)operator(,) integer(437)operator(,) integer(43)operator(,) integer(43)operator(,) integer(366)operator(,) integer(366)operator(,) integer(366)operator(,) integer(2365)operator(,) integer(4642)operator(,) integer(2484)operator(,) - integer(4745)operator(,) integer(111)operator(,) operator(-)integer(654)operator(,) integer(554)operator(,) integer(487)operator(,) operator(-)integer(654)operator(,) integer(585)operator(,) operator(-)integer(654)operator(,) integer(4539)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) integer(1899)operator(,) integer(1899)operator(,) integer(37)operator(,) integer(37)operator(,) operator(-)integer(654)operator(,) integer(9349)operator(,) operator(-)integer(654)operator(,) integer(9349)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) integer(124)operator(,) operator(-)integer(654)operator(,) integer(6810)operator(,) integer(2615)operator(,) integer(141)operator(,) integer(477)operator(,) operator(-)integer(654)operator(,) integer(111)operator(,) integer(562)operator(,) - integer(111)operator(,) integer(681)operator(,) integer(35)operator(,) integer(597)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(429)operator(,) integer(2615)operator(,) integer(124)operator(,) operator(-)integer(654)operator(,) integer(575)operator(,) operator(-)integer(654)operator(,) integer(577)operator(,) integer(655)operator(,) - integer(588)operator(,) integer(665)operator(,) operator(-)integer(654)operator(,) integer(5246)operator(,) integer(5121)operator(,) operator(-)integer(654)operator(,) integer(7325)operator(,) integer(703)operator(,) operator(-)integer(654)operator(,) integer(398)operator(,) - operator(-)integer(654)operator(,) integer(2345)operator(,) integer(4230)operator(,) integer(4333)operator(,) integer(599)operator(,) integer(344)operator(,) integer(416)operator(,) integer(703)operator(,) integer(726)operator(,) integer(734)operator(,) - integer(7634)operator(,) integer(626)operator(,) integer(48)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(60)operator(,) - integer(85)operator(,) integer(635)operator(,) integer(259)operator(,) integer(354)operator(,) integer(6810)operator(,) integer(657)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) integer(274)operator(,) - operator(-)integer(654)operator(,) integer(628)operator(,) integer(7634)operator(,) integer(274)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) integer(9265)operator(,) integer(16)operator(,) operator(-)integer(654)operator(,) - integer(636)operator(,) operator(-)integer(654)operator(,) integer(634)operator(,) integer(643)operator(,) integer(6089)operator(,) integer(8555)operator(,) integer(8555)operator(,) integer(645)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(6810)operator(,) integer(9349)operator(,) integer(656)operator(,) operator(-)integer(654)operator(,) integer(9349)operator(,) integer(296)operator(,) integer(658)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) operator(-)integer(654)operator(,) - integer(141)operator(,) integer(477)operator(,) integer(661)operator(,) integer(340)operator(,) integer(351)operator(,) integer(3449)operator(,) integer(671)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(366)operator(,) integer(366)operator(,) operator(-)integer(654)operator(,) integer(7840)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(7428)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) - integer(7634)operator(,) integer(7737)operator(,) integer(7634)operator(,) operator(-)integer(654)operator(,) integer(501)operator(,) integer(624)operator(,) integer(7737)operator(,) integer(7737)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(501)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(37)operator(,) operator(-)integer(654)operator(,) - integer(124)operator(,) integer(776)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(663)operator(,) integer(7634)operator(,) operator(-)integer(44)operator(,) integer(781)operator(,) operator(-)integer(654)operator(,) integer(429)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(452)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(12)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(544)operator(,) operator(-)integer(654)operator(,) integer(708)operator(,) operator(-)integer(654)operator(,) integer(3084)operator(,) integer(792)operator(,) operator(-)integer(654)operator(,) integer(6810)operator(,) integer(797)operator(,) operator(-)integer(654)operator(,) - integer(7634)operator(,) integer(432)operator(,) integer(7634)operator(,) integer(7634)operator(,) integer(798)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(7531)operator(,) integer(2859)operator(,) - integer(3571)operator(,) integer(3571)operator(,) integer(367)operator(,) integer(18)operator(,) integer(498)operator(,) integer(6192)operator(,) operator(-)integer(654)operator(,) integer(498)operator(,) integer(498)operator(,) integer(6295)operator(,) - integer(685)operator(,) operator(-)integer(654)operator(,) integer(6398)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(104)operator(,) integer(9)operator(,) integer(111)operator(,) integer(111)operator(,) operator(-)integer(654)operator(,) - integer(101)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(9213)operator(,) integer(631)operator(,) integer(690)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(709)operator(,) integer(3571)operator(,) integer(7634)operator(,) integer(692)operator(,) integer(9349)operator(,) integer(9349)operator(,) operator(-)integer(654)operator(,) integer(9349)operator(,) - integer(9349)operator(,) operator(-)integer(654)operator(,) integer(7737)operator(,) operator(-)integer(654)operator(,) integer(9349)operator(,) operator(-)integer(654)operator(,) integer(9349)operator(,) operator(-)integer(654)operator(,) integer(3571)operator(,) integer(3449)operator(,) - operator(-)integer(654)operator(,) integer(2615)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(691)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(693)operator(,) - integer(588)operator(,) operator(-)integer(654)operator(,) integer(597)operator(,) operator(-)integer(654)operator(,) integer(588)operator(,) integer(419)operator(,) integer(8434)operator(,) integer(48)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(3571)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(48)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) integer(165)operator(,) integer(810)operator(,) - integer(812)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(7634)operator(,) operator(-)integer(654)operator(,) integer(705)operator(,) integer(710)operator(,) - operator(-)integer(654)operator(,) integer(7634)operator(,) integer(712)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(825)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(9349)operator(,) integer(830)operator(,) integer(720)operator(,) integer(3449)operator(,) integer(832)operator(,) operator(-)integer(654)operator(,) integer(452)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(2615)operator(,) integer(789)operator(,) operator(-)integer(654)operator(,) integer(640)operator(,) integer(595)operator(,) integer(618)operator(,) integer(2615)operator(,) operator(-)integer(654)operator(,) integer(2737)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(3571)operator(,) integer(9286)operator(,) integer(498)operator(,) integer(6501)operator(,) operator(-)integer(654)operator(,) - integer(6604)operator(,) operator(-)integer(654)operator(,) integer(498)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(724)operator(,) operator(-)integer(654)operator(,) integer(588)operator(,) - integer(838)operator(,) integer(623)operator(,) integer(9083)operator(,) integer(6913)operator(,) integer(9149)operator(,) integer(596)operator(,) integer(398)operator(,) integer(839)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - integer(7634)operator(,) integer(727)operator(,) integer(7634)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(41)operator(,) integer(477)operator(,) integer(732)operator(,) - integer(76)operator(,) integer(93)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(498)operator(,) integer(6707)operator(,) operator(-)integer(654)operator(,) integer(498)operator(,) integer(631)operator(,) - operator(-)integer(654)operator(,) integer(7634)operator(,) operator(-)integer(654)operator(,) integer(498)operator(,) operator(-)integer(654) -operator(};) - -comment(/* YYPGOTO[NTERM-NUM]. */) -directive(static) directive(const) ident(yytype_int16) ident(yypgoto)operator([]) operator(=) -operator({) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(360)operator(,) integer(431)operator(,) operator(-)integer(654)operator(,) integer(59)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(958)operator(,) - integer(44)operator(,) integer(23)operator(,) operator(-)integer(654)operator(,) operator(-)integer(569)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(1)operator(,) operator(-)integer(6)operator(,) operator(-)integer(183)operator(,) integer(22)operator(,) - integer(779)operator(,) operator(-)integer(654)operator(,) operator(-)integer(25)operator(,) integer(927)operator(,) operator(-)integer(70)operator(,) integer(853)operator(,) integer(7)operator(,) operator(-)integer(654)operator(,) integer(21)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(5)operator(,) operator(-)integer(654)operator(,) operator(-)integer(16)operator(,) operator(-)integer(654)operator(,) integer(1378)operator(,) operator(-)integer(338)operator(,) operator(-)integer(7)operator(,) operator(-)integer(479)operator(,) integer(82)operator(,) - operator(-)integer(654)operator(,) integer(2)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(9)operator(,) integer(158)operator(,) integer(110)operator(,) operator(-)integer(278)operator(,) - integer(26)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(185)operator(,) operator(-)integer(209)operator(,) operator(-)integer(372)operator(,) - integer(0)operator(,) operator(-)integer(520)operator(,) integer(208)operator(,) operator(-)integer(458)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(228)operator(,) operator(-)integer(654)operator(,) integer(785)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(356)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(3)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(784)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(458)operator(,) operator(-)integer(217)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(12)operator(,) operator(-)integer(654)operator(,) - integer(14)operator(,) operator(-)integer(654)operator(,) integer(627)operator(,) integer(860)operator(,) integer(1246)operator(,) integer(1107)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) integer(84)operator(,) integer(309)operator(,) - integer(183)operator(,) operator(-)integer(654)operator(,) operator(-)integer(653)operator(,) integer(184)operator(,) operator(-)integer(654)operator(,) operator(-)integer(608)operator(,) operator(-)integer(654)operator(,) operator(-)integer(321)operator(,) operator(-)integer(504)operator(,) operator(-)integer(654)operator(,) - operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(4)operator(,) operator(-)integer(382)operator(,) integer(755)operator(,) operator(-)integer(226)operator(,) operator(-)integer(654)operator(,) operator(-)integer(654)operator(,) operator(-)integer(24)operator(,) integer(20)operator(,) - integer(467)operator(,) integer(53)operator(,) integer(814)operator(,) integer(756) -operator(};) - -comment(/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */) -preprocessor(#define) ident(YYTABLE_NINF) operator(-)integer(502) -directive(static) directive(const) ident(yytype_int16) ident(yytable)operator([]) operator(=) -operator({) - integer(235)operator(,) integer(235)operator(,) integer(188)operator(,) integer(188)operator(,) integer(235)operator(,) integer(523)operator(,) integer(390)operator(,) integer(238)operator(,) integer(238)operator(,) integer(225)operator(,) - integer(551)operator(,) integer(238)operator(,) integer(240)operator(,) integer(240)operator(,) integer(187)operator(,) integer(248)operator(,) integer(240)operator(,) integer(234)operator(,) integer(234)operator(,) integer(419)operator(,) - integer(204)operator(,) integer(234)operator(,) integer(205)operator(,) integer(188)operator(,) integer(249)operator(,) integer(598)operator(,) integer(277)operator(,) integer(614)operator(,) integer(257)operator(,) integer(259)operator(,) - integer(549)operator(,) integer(111)operator(,) integer(111)operator(,) integer(235)operator(,) integer(235)operator(,) integer(588)operator(,) integer(360)operator(,) integer(490)operator(,) integer(299)operator(,) integer(783)operator(,) - integer(204)operator(,) integer(111)operator(,) integer(205)operator(,) integer(297)operator(,) integer(298)operator(,) integer(594)operator(,) integer(274)operator(,) integer(188)operator(,) integer(584)operator(,) integer(252)operator(,) - integer(267)operator(,) integer(572)operator(,) integer(672)operator(,) integer(674)operator(,) operator(-)integer(87)operator(,) integer(215)operator(,) integer(218)operator(,) integer(705)operator(,) integer(347)operator(,) integer(284)operator(,) - integer(614)operator(,) integer(380)operator(,) integer(601)operator(,) integer(96)operator(,) integer(693)operator(,) integer(220)operator(,) integer(696)operator(,) integer(714)operator(,) integer(347)operator(,) integer(264)operator(,) - integer(458)operator(,) integer(306)operator(,) integer(307)operator(,) integer(3)operator(,) integer(464)operator(,) integer(676)operator(,) integer(677)operator(,) integer(111)operator(,) integer(432)operator(,) integer(363)operator(,) - integer(559)operator(,) integer(780)operator(,) integer(296)operator(,) integer(452)operator(,) integer(784)operator(,) operator(-)integer(87)operator(,) integer(253)operator(,) integer(353)operator(,) integer(466)operator(,) operator(-)integer(86)operator(,) - integer(625)operator(,) operator(-)integer(84)operator(,) integer(345)operator(,) operator(-)integer(432)operator(,) integer(248)operator(,) integer(761)operator(,) integer(354)operator(,) integer(111)operator(,) integer(560)operator(,) integer(242)operator(,) - integer(405)operator(,) integer(767)operator(,) integer(243)operator(,) integer(392)operator(,) integer(260)operator(,) integer(393)operator(,) operator(-)integer(88)operator(,) integer(316)operator(,) integer(353)operator(,) integer(652)operator(,) - operator(-)integer(89)operator(,) integer(290)operator(,) integer(642)operator(,) operator(-)integer(84)operator(,) operator(-)integer(432)operator(,) integer(220)operator(,) integer(521)operator(,) integer(256)operator(,) integer(528)operator(,) integer(531)operator(,) - integer(532)operator(,) integer(352)operator(,) integer(356)operator(,) integer(595)operator(,) integer(453)operator(,) integer(454)operator(,) integer(239)operator(,) integer(239)operator(,) integer(292)operator(,) integer(484)operator(,) - integer(239)operator(,) integer(467)operator(,) integer(308)operator(,) integer(626)operator(,) operator(-)integer(84)operator(,) integer(346)operator(,) operator(-)integer(76)operator(,) integer(306)operator(,) integer(307)operator(,) integer(253)operator(,) - integer(358)operator(,) operator(-)integer(91)operator(,) integer(729)operator(,) integer(550)operator(,) integer(359)operator(,) integer(653)operator(,) operator(-)integer(87)operator(,) integer(351)operator(,) integer(216)operator(,) integer(217)operator(,) - integer(294)operator(,) integer(295)operator(,) integer(348)operator(,) integer(381)operator(,) integer(647)operator(,) operator(-)integer(478)operator(,) integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) integer(521)operator(,) - integer(272)operator(,) integer(528)operator(,) integer(348)operator(,) integer(366)operator(,) operator(-)integer(83)operator(,) integer(253)operator(,) operator(-)integer(479)operator(,) operator(-)integer(485)operator(,) operator(-)integer(87)operator(,) operator(-)integer(481)operator(,) - integer(247)operator(,) operator(-)integer(87)operator(,) operator(-)integer(87)operator(,) integer(783)operator(,) operator(-)integer(84)operator(,) integer(550)operator(,) operator(-)integer(426)operator(,) integer(310)operator(,) integer(216)operator(,) integer(217)operator(,) - integer(704)operator(,) operator(-)integer(86)operator(,) integer(393)operator(,) integer(311)operator(,) integer(681)operator(,) integer(364)operator(,) operator(-)integer(79)operator(,) integer(76)operator(,) operator(-)integer(481)operator(,) integer(76)operator(,) - integer(112)operator(,) integer(112)operator(,) operator(-)integer(76)operator(,) operator(-)integer(89)operator(,) integer(391)operator(,) integer(211)operator(,) integer(211)operator(,) integer(211)operator(,) operator(-)integer(88)operator(,) integer(315)operator(,) - integer(227)operator(,) integer(211)operator(,) integer(211)operator(,) integer(687)operator(,) integer(550)operator(,) integer(211)operator(,) operator(-)integer(86)operator(,) operator(-)integer(86)operator(,) integer(216)operator(,) integer(217)operator(,) - operator(-)integer(420)operator(,) operator(-)integer(81)operator(,) integer(211)operator(,) operator(-)integer(482)operator(,) integer(53)operator(,) integer(235)operator(,) integer(235)operator(,) integer(297)operator(,) integer(859)operator(,) operator(-)integer(426)operator(,) - integer(770)operator(,) operator(-)integer(423)operator(,) operator(-)integer(485)operator(,) operator(-)integer(88)operator(,) operator(-)integer(88)operator(,) integer(550)operator(,) integer(813)operator(,) integer(244)operator(,) integer(235)operator(,) operator(-)integer(425)operator(,) - integer(235)operator(,) integer(235)operator(,) integer(76)operator(,) integer(211)operator(,) integer(211)operator(,) integer(238)operator(,) integer(278)operator(,) integer(238)operator(,) integer(238)operator(,) integer(247)operator(,) - integer(240)operator(,) integer(572)operator(,) integer(240)operator(,) integer(240)operator(,) integer(211)operator(,) integer(234)operator(,) integer(648)operator(,) integer(234)operator(,) integer(416)operator(,) operator(-)integer(478)operator(,) - integer(436)operator(,) operator(-)integer(420)operator(,) operator(-)integer(327)operator(,) operator(-)integer(420)operator(,) integer(216)operator(,) integer(217)operator(,) integer(278)operator(,) operator(-)integer(478)operator(,) integer(672)operator(,) integer(674)operator(,) - operator(-)integer(479)operator(,) operator(-)integer(485)operator(,) operator(-)integer(423)operator(,) operator(-)integer(485)operator(,) operator(-)integer(423)operator(,) operator(-)integer(485)operator(,) integer(396)operator(,) integer(397)operator(,) operator(-)integer(479)operator(,) operator(-)integer(481)operator(,) - operator(-)integer(91)operator(,) integer(220)operator(,) operator(-)integer(425)operator(,) integer(376)operator(,) integer(421)operator(,) integer(827)operator(,) integer(828)operator(,) operator(-)integer(90)operator(,) integer(840)operator(,) integer(379)operator(,) - integer(829)operator(,) integer(422)operator(,) integer(423)operator(,) integer(264)operator(,) operator(-)integer(86)operator(,) integer(306)operator(,) integer(307)operator(,) integer(437)operator(,) integer(485)operator(,) integer(452)operator(,) - integer(211)operator(,) integer(384)operator(,) integer(76)operator(,) operator(-)integer(327)operator(,) integer(235)operator(,) operator(-)integer(327)operator(,) integer(388)operator(,) integer(547)operator(,) integer(701)operator(,) integer(488)operator(,) - integer(491)operator(,) integer(492)operator(,) integer(493)operator(,) integer(494)operator(,) integer(495)operator(,) integer(496)operator(,) integer(497)operator(,) integer(498)operator(,) integer(499)operator(,) integer(500)operator(,) - integer(501)operator(,) integer(502)operator(,) integer(503)operator(,) integer(504)operator(,) integer(505)operator(,) integer(506)operator(,) integer(507)operator(,) integer(508)operator(,) integer(509)operator(,) integer(510)operator(,) - integer(511)operator(,) integer(512)operator(,) integer(513)operator(,) integer(514)operator(,) integer(515)operator(,) integer(516)operator(,) integer(412)operator(,) integer(235)operator(,) integer(414)operator(,) integer(417)operator(,) - integer(453)operator(,) integer(454)operator(,) integer(455)operator(,) integer(480)operator(,) integer(264)operator(,) integer(536)operator(,) integer(538)operator(,) integer(520)operator(,) integer(487)operator(,) integer(111)operator(,) - integer(395)operator(,) integer(389)operator(,) integer(398)operator(,) integer(614)operator(,) integer(267)operator(,) integer(471)operator(,) integer(472)operator(,) integer(473)operator(,) integer(474)operator(,) integer(402)operator(,) - integer(614)operator(,) integer(801)operator(,) integer(235)operator(,) operator(-)integer(91)operator(,) integer(239)operator(,) integer(875)operator(,) integer(239)operator(,) integer(418)operator(,) integer(405)operator(,) integer(470)operator(,) - operator(-)integer(90)operator(,) operator(-)integer(91)operator(,) integer(520)operator(,) operator(-)integer(427)operator(,) integer(475)operator(,) operator(-)integer(78)operator(,) integer(431)operator(,) operator(-)integer(86)operator(,) integer(581)operator(,) integer(267)operator(,) - integer(235)operator(,) operator(-)integer(83)operator(,) integer(536)operator(,) integer(538)operator(,) integer(535)operator(,) integer(537)operator(,) operator(-)integer(80)operator(,) integer(235)operator(,) operator(-)integer(82)operator(,) operator(-)integer(88)operator(,) - integer(520)operator(,) integer(361)operator(,) integer(362)operator(,) integer(719)operator(,) integer(235)operator(,) operator(-)integer(78)operator(,) operator(-)integer(90)operator(,) integer(267)operator(,) integer(406)operator(,) integer(235)operator(,) - integer(235)operator(,) integer(76)operator(,) operator(-)integer(85)operator(,) integer(235)operator(,) integer(520)operator(,) integer(409)operator(,) integer(736)operator(,) integer(617)operator(,) integer(410)operator(,) integer(737)operator(,) - integer(738)operator(,) integer(267)operator(,) integer(611)operator(,) integer(425)operator(,) integer(621)operator(,) integer(427)operator(,) operator(-)integer(427)operator(,) integer(211)operator(,) integer(211)operator(,) integer(622)operator(,) - integer(631)operator(,) integer(824)operator(,) integer(707)operator(,) integer(704)operator(,) operator(-)integer(428)operator(,) integer(634)operator(,) integer(542)operator(,) operator(-)integer(430)operator(,) operator(-)integer(429)operator(,) integer(188)operator(,) - integer(482)operator(,) operator(-)integer(65)operator(,) operator(-)integer(73)operator(,) integer(235)operator(,) integer(520)operator(,) integer(482)operator(,) integer(235)operator(,) integer(712)operator(,) integer(235)operator(,) integer(211)operator(,) - integer(316)operator(,) integer(211)operator(,) integer(211)operator(,) integer(61)operator(,) integer(235)operator(,) integer(433)operator(,) integer(204)operator(,) integer(623)operator(,) integer(205)operator(,) integer(627)operator(,) - integer(434)operator(,) integer(76)operator(,) integer(841)operator(,) operator(-)integer(78)operator(,) integer(520)operator(,) integer(629)operator(,) integer(76)operator(,) operator(-)integer(86)operator(,) operator(-)integer(78)operator(,) integer(597)operator(,) - integer(597)operator(,) integer(267)operator(,) integer(650)operator(,) integer(651)operator(,) operator(-)integer(80)operator(,) integer(636)operator(,) integer(637)operator(,) operator(-)integer(428)operator(,) integer(316)operator(,) operator(-)integer(80)operator(,) - operator(-)integer(430)operator(,) operator(-)integer(429)operator(,) operator(-)integer(88)operator(,) integer(235)operator(,) integer(572)operator(,) operator(-)integer(78)operator(,) operator(-)integer(78)operator(,) operator(-)integer(64)operator(,) integer(614)operator(,) integer(553)operator(,) - integer(860)operator(,) integer(554)operator(,) integer(555)operator(,) integer(556)operator(,) integer(557)operator(,) operator(-)integer(85)operator(,) operator(-)integer(80)operator(,) operator(-)integer(80)operator(,) integer(262)operator(,) integer(553)operator(,) - operator(-)integer(80)operator(,) integer(554)operator(,) integer(555)operator(,) integer(556)operator(,) integer(557)operator(,) integer(76)operator(,) integer(211)operator(,) integer(211)operator(,) integer(211)operator(,) integer(211)operator(,) - integer(76)operator(,) integer(211)operator(,) integer(211)operator(,) operator(-)integer(77)operator(,) integer(438)operator(,) integer(211)operator(,) integer(446)operator(,) integer(76)operator(,) integer(278)operator(,) integer(713)operator(,) - integer(211)operator(,) integer(316)operator(,) integer(782)operator(,) integer(591)operator(,) integer(614)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) - integer(558)operator(,) integer(559)operator(,) integer(288)operator(,) integer(289)operator(,) integer(663)operator(,) integer(795)operator(,) integer(329)operator(,) integer(330)operator(,) integer(439)operator(,) operator(-)integer(88)operator(,) - integer(558)operator(,) integer(559)operator(,) integer(440)operator(,) integer(664)operator(,) integer(448)operator(,) integer(879)operator(,) integer(461)operator(,) integer(442)operator(,) integer(211)operator(,) integer(560)operator(,) - integer(670)operator(,) integer(440)operator(,) integer(561)operator(,) integer(673)operator(,) integer(675)operator(,) operator(-)integer(85)operator(,) integer(211)operator(,) integer(211)operator(,) integer(262)operator(,) integer(560)operator(,) - integer(452)operator(,) integer(663)operator(,) integer(561)operator(,) integer(558)operator(,) integer(559)operator(,) integer(465)operator(,) operator(-)integer(420)operator(,) integer(562)operator(,) integer(337)operator(,) integer(338)operator(,) - integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) integer(211)operator(,) operator(-)integer(423)operator(,) integer(76)operator(,) integer(211)operator(,) integer(468)operator(,) operator(-)integer(283)operator(,) integer(431)operator(,) - integer(235)operator(,) integer(606)operator(,) integer(560)operator(,) integer(469)operator(,) integer(486)operator(,) integer(561)operator(,) integer(342)operator(,) integer(76)operator(,) integer(188)operator(,) integer(188)operator(,) - integer(666)operator(,) integer(211)operator(,) integer(684)operator(,) integer(452)operator(,) integer(235)operator(,) integer(76)operator(,) integer(373)operator(,) integer(76)operator(,) integer(836)operator(,) operator(-)integer(90)operator(,) - integer(698)operator(,) integer(453)operator(,) integer(454)operator(,) integer(457)operator(,) integer(838)operator(,) integer(211)operator(,) integer(204)operator(,) integer(680)operator(,) integer(205)operator(,) operator(-)integer(420)operator(,) - operator(-)integer(86)operator(,) integer(539)operator(,) integer(235)operator(,) integer(575)operator(,) integer(679)operator(,) integer(699)operator(,) integer(235)operator(,) operator(-)integer(423)operator(,) integer(211)operator(,) operator(-)integer(283)operator(,) - integer(235)operator(,) operator(-)integer(283)operator(,) operator(-)integer(82)operator(,) integer(580)operator(,) integer(576)operator(,) operator(-)integer(482)operator(,) integer(444)operator(,) integer(343)operator(,) integer(235)operator(,) integer(344)operator(,) - integer(440)operator(,) integer(316)operator(,) integer(76)operator(,) operator(-)integer(78)operator(,) integer(453)operator(,) integer(454)operator(,) integer(459)operator(,) integer(688)operator(,) integer(393)operator(,) integer(374)operator(,) - integer(611)operator(,) integer(593)operator(,) integer(743)operator(,) integer(452)operator(,) integer(605)operator(,) integer(735)operator(,) integer(329)operator(,) integer(330)operator(,) integer(615)operator(,) integer(90)operator(,) - integer(367)operator(,) integer(90)operator(,) integer(113)operator(,) integer(113)operator(,) integer(113)operator(,) integer(211)operator(,) integer(624)operator(,) integer(628)operator(,) integer(550)operator(,) integer(385)operator(,) - integer(399)operator(,) integer(235)operator(,) integer(229)operator(,) integer(756)operator(,) integer(757)operator(,) integer(759)operator(,) integer(760)operator(,) integer(225)operator(,) integer(723)operator(,) integer(633)operator(,) - integer(764)operator(,) integer(766)operator(,) integer(429)operator(,) operator(-)integer(73)operator(,) integer(635)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) - integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) integer(649)operator(,) integer(453)operator(,) integer(454)operator(,) integer(462)operator(,) integer(449)operator(,) integer(667)operator(,) integer(235)operator(,) - operator(-)integer(264)operator(,) integer(368)operator(,) integer(657)operator(,) integer(369)operator(,) integer(90)operator(,) integer(658)operator(,) operator(-)integer(431)operator(,) integer(665)operator(,) integer(279)operator(,) integer(111)operator(,) - integer(386)operator(,) integer(400)operator(,) integer(387)operator(,) integer(401)operator(,) integer(758)operator(,) integer(682)operator(,) integer(482)operator(,) integer(428)operator(,) operator(-)integer(88)operator(,) integer(763)operator(,) - integer(765)operator(,) integer(683)operator(,) integer(262)operator(,) integer(386)operator(,) integer(759)operator(,) integer(430)operator(,) integer(764)operator(,) integer(766)operator(,) integer(279)operator(,) operator(-)integer(276)operator(,) - integer(685)operator(,) integer(689)operator(,) integer(235)operator(,) integer(692)operator(,) operator(-)integer(284)operator(,) integer(694)operator(,) integer(776)operator(,) integer(762)operator(,) integer(450)operator(,) integer(235)operator(,) - integer(451)operator(,) operator(-)integer(80)operator(,) operator(-)integer(285)operator(,) integer(235)operator(,) integer(695)operator(,) integer(697)operator(,) integer(235)operator(,) operator(-)integer(431)operator(,) integer(704)operator(,) operator(-)integer(431)operator(,) - integer(807)operator(,) integer(862)operator(,) integer(711)operator(,) integer(746)operator(,) integer(747)operator(,) integer(809)operator(,) integer(748)operator(,) operator(-)integer(85)operator(,) integer(211)operator(,) integer(76)operator(,) - integer(42)operator(,) integer(43)operator(,) integer(452)operator(,) integer(772)operator(,) integer(90)operator(,) integer(460)operator(,) integer(715)operator(,) integer(443)operator(,) integer(235)operator(,) integer(445)operator(,) - operator(-)integer(276)operator(,) integer(447)operator(,) operator(-)integer(276)operator(,) integer(262)operator(,) integer(716)operator(,) operator(-)integer(284)operator(,) integer(820)operator(,) operator(-)integer(284)operator(,) integer(76)operator(,) integer(232)operator(,) - operator(-)integer(77)operator(,) integer(793)operator(,) integer(718)operator(,) operator(-)integer(285)operator(,) integer(725)operator(,) operator(-)integer(285)operator(,) integer(812)operator(,) integer(94)operator(,) integer(722)operator(,) integer(94)operator(,) - integer(732)operator(,) integer(731)operator(,) integer(863)operator(,) integer(814)operator(,) integer(864)operator(,) integer(94)operator(,) integer(94)operator(,) integer(94)operator(,) integer(734)operator(,) integer(726)operator(,) - integer(739)operator(,) integer(94)operator(,) integer(94)operator(,) integer(453)operator(,) integer(454)operator(,) integer(94)operator(,) integer(597)operator(,) integer(741)operator(,) integer(316)operator(,) integer(820)operator(,) - integer(733)operator(,) integer(235)operator(,) integer(94)operator(,) integer(742)operator(,) integer(744)operator(,) integer(819)operator(,) integer(773)operator(,) integer(846)operator(,) integer(774)operator(,) integer(211)operator(,) - integer(235)operator(,) integer(777)operator(,) integer(786)operator(,) integer(329)operator(,) integer(330)operator(,) integer(235)operator(,) integer(301)operator(,) integer(302)operator(,) integer(303)operator(,) integer(304)operator(,) - integer(305)operator(,) integer(790)operator(,) integer(94)operator(,) integer(94)operator(,) integer(94)operator(,) integer(271)operator(,) integer(275)operator(,) integer(794)operator(,) integer(796)operator(,) integer(211)operator(,) - integer(810)operator(,) integer(815)operator(,) integer(111)operator(,) integer(579)operator(,) integer(94)operator(,) integer(211)operator(,) integer(825)operator(,) integer(816)operator(,) operator(-)integer(265)operator(,) integer(826)operator(,) - integer(843)operator(,) integer(587)operator(,) integer(844)operator(,) integer(589)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) - integer(76)operator(,) integer(848)operator(,) integer(235)operator(,) integer(90)operator(,) integer(235)operator(,) integer(854)operator(,) integer(850)operator(,) integer(853)operator(,) integer(227)operator(,) integer(808)operator(,) - integer(855)operator(,) integer(856)operator(,) integer(858)operator(,) integer(861)operator(,) integer(871)operator(,) integer(874)operator(,) integer(211)operator(,) integer(235)operator(,) integer(876)operator(,) integer(884)operator(,) - integer(314)operator(,) integer(211)operator(,) integer(211)operator(,) integer(886)operator(,) integer(235)operator(,) integer(889)operator(,) integer(235)operator(,) integer(520)operator(,) integer(632)operator(,) integer(116)operator(,) - integer(94)operator(,) integer(752)operator(,) integer(94)operator(,) integer(349)operator(,) integer(267)operator(,) integer(350)operator(,) integer(883)operator(,) integer(190)operator(,) integer(882)operator(,) integer(830)operator(,) - integer(235)operator(,) integer(686)operator(,) integer(778)operator(,) integer(779)operator(,) integer(0)operator(,) integer(235)operator(,) integer(300)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(802)operator(,) integer(90)operator(,) integer(0)operator(,) integer(804)operator(,) integer(805)operator(,) integer(0)operator(,) integer(90)operator(,) integer(76)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(211)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(76)operator(,) integer(76)operator(,) integer(76)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(90)operator(,) integer(0)operator(,) integer(73)operator(,) - integer(0)operator(,) integer(73)operator(,) integer(90)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(76)operator(,) integer(90)operator(,) - integer(279)operator(,) integer(0)operator(,) integer(226)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(211)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(76)operator(,) integer(76)operator(,) integer(0)operator(,) integer(76)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(849)operator(,) integer(851)operator(,) integer(208)operator(,) integer(208)operator(,) - integer(208)operator(,) integer(833)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(76)operator(,) integer(0)operator(,) integer(94)operator(,) integer(94)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(250)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(408)operator(,) integer(408)operator(,) integer(90)operator(,) integer(0)operator(,) integer(94)operator(,) - integer(0)operator(,) integer(94)operator(,) integer(94)operator(,) integer(420)operator(,) integer(868)operator(,) integer(869)operator(,) integer(265)operator(,) integer(0)operator(,) integer(76)operator(,) integer(90)operator(,) - integer(873)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(76)operator(,) integer(94)operator(,) integer(90)operator(,) integer(0)operator(,) integer(90)operator(,) - integer(0)operator(,) integer(76)operator(,) integer(0)operator(,) integer(76)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(887)operator(,) - integer(76)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(890)operator(,) integer(0)operator(,) integer(0)operator(,) integer(892)operator(,) integer(0)operator(,) integer(211)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(894)operator(,) integer(0)operator(,) integer(0)operator(,) integer(90)operator(,) integer(94)operator(,) integer(94)operator(,) integer(94)operator(,) integer(94)operator(,) integer(94)operator(,) - integer(94)operator(,) integer(94)operator(,) integer(94)operator(,) integer(357)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(745)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(271)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(94)operator(,) integer(0)operator(,) integer(93)operator(,) - integer(0)operator(,) integer(93)operator(,) integer(114)operator(,) integer(114)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(230)operator(,) integer(94)operator(,) integer(271)operator(,) integer(94)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(578)operator(,) integer(789)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(94)operator(,) integer(271)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(798)operator(,) integer(799)operator(,) integer(800)operator(,) integer(0)operator(,) integer(93)operator(,) integer(94)operator(,) integer(271)operator(,) integer(0)operator(,) integer(280)operator(,) integer(408)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(90)operator(,) integer(0)operator(,) integer(0)operator(,) integer(408)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(280)operator(,) integer(0)operator(,) - integer(208)operator(,) integer(208)operator(,) integer(94)operator(,) integer(73)operator(,) integer(817)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(0)operator(,) - integer(90)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(821)operator(,) - integer(822)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(271)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(837)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(0)operator(,) integer(655)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) - integer(92)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(857)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(208)operator(,) - integer(208)operator(,) integer(208)operator(,) integer(208)operator(,) integer(0)operator(,) integer(476)operator(,) integer(477)operator(,) integer(0)operator(,) integer(865)operator(,) integer(0)operator(,) integer(866)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(90)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(867)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(229)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(671)operator(,) integer(0)operator(,) integer(0)operator(,) integer(671)operator(,) integer(671)operator(,) integer(655)operator(,) - integer(655)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(94)operator(,) integer(94)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(671)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(94)operator(,) integer(73)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(691)operator(,) integer(0)operator(,) integer(691)operator(,) integer(0)operator(,) integer(691)operator(,) integer(0)operator(,) integer(0)operator(,) integer(552)operator(,) - integer(0)operator(,) integer(90)operator(,) integer(703)operator(,) integer(706)operator(,) integer(0)operator(,) integer(706)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(706)operator(,) integer(0)operator(,) integer(0)operator(,) integer(90)operator(,) integer(90)operator(,) integer(90)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(73)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(408)operator(,) integer(93)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(265)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(408)operator(,) integer(94)operator(,) - integer(90)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(90)operator(,) integer(90)operator(,) integer(0)operator(,) integer(90)operator(,) integer(0)operator(,) - integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(93)operator(,) integer(834)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(90)operator(,) integer(0)operator(,) integer(93)operator(,) - integer(280)operator(,) integer(94)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(655)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(90)operator(,) integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(90)operator(,) integer(788)operator(,) integer(94)operator(,) - integer(0)operator(,) integer(792)operator(,) integer(94)operator(,) integer(90)operator(,) integer(0)operator(,) integer(90)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(73)operator(,) integer(90)operator(,) integer(0)operator(,) integer(94)operator(,) integer(94)operator(,) integer(94)operator(,) integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(408)operator(,) integer(0)operator(,) integer(0)operator(,) integer(408)operator(,) integer(408)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(93)operator(,) - integer(73)operator(,) integer(0)operator(,) integer(0)operator(,) integer(671)operator(,) integer(671)operator(,) integer(0)operator(,) integer(0)operator(,) integer(93)operator(,) integer(0)operator(,) integer(93)operator(,) - integer(0)operator(,) integer(208)operator(,) integer(92)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(94)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(94)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(93)operator(,) integer(691)operator(,) integer(691)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(691)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(92)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) integer(0)operator(,) integer(706)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(208)operator(,) integer(0)operator(,) integer(408)operator(,) integer(408)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) - integer(226)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) integer(740)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(94)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(94)operator(,) integer(0)operator(,) integer(408)operator(,) integer(408)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(408)operator(,) integer(403)operator(,) - integer(404)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(691)operator(,) integer(92)operator(,) integer(0)operator(,) integer(94)operator(,) integer(271)operator(,) - integer(0)operator(,) integer(578)operator(,) integer(706)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(408)operator(,) integer(92)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(73)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(408)operator(,) integer(0)operator(,) integer(0)operator(,) integer(408)operator(,) integer(0)operator(,) integer(73)operator(,) integer(73)operator(,) integer(73)operator(,) integer(408)operator(,) - integer(0)operator(,) integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(517)operator(,) integer(518)operator(,) integer(0)operator(,) integer(208)operator(,) integer(519)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) - integer(73)operator(,) integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(481)operator(,) integer(169)operator(,) - integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) integer(489)operator(,) integer(0)operator(,) integer(73)operator(,) integer(73)operator(,) integer(0)operator(,) integer(73)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(832)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(174)operator(,) integer(175)operator(,) - integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(184)operator(,) integer(316)operator(,) integer(317)operator(,) integer(318)operator(,) integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) integer(323)operator(,) integer(185)operator(,) - integer(325)operator(,) integer(326)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(329)operator(,) integer(330)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(73)operator(,) integer(0)operator(,) integer(93)operator(,) integer(750)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(230)operator(,) integer(0)operator(,) integer(0)operator(,) integer(73)operator(,) integer(0)operator(,) integer(73)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(489)operator(,) integer(73)operator(,) integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) - integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) integer(607)operator(,) integer(609)operator(,) integer(0)operator(,) integer(0)operator(,) integer(613)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(92)operator(,) integer(618)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) - integer(0)operator(,) integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(639)operator(,) integer(659)operator(,) integer(0)operator(,) - integer(613)operator(,) integer(0)operator(,) integer(639)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(93)operator(,) integer(93)operator(,) integer(93)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(316)operator(,) - integer(317)operator(,) integer(318)operator(,) integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) integer(323)operator(,) integer(324)operator(,) integer(325)operator(,) integer(326)operator(,) - integer(327)operator(,) integer(328)operator(,) integer(0)operator(,) integer(0)operator(,) integer(329)operator(,) integer(330)operator(,) integer(0)operator(,) integer(656)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(93)operator(,) integer(93)operator(,) integer(0)operator(,) integer(93)operator(,) integer(331)operator(,) - integer(0)operator(,) integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) - integer(341)operator(,) integer(92)operator(,) integer(0)operator(,) integer(835)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(93)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) - integer(0)operator(,) operator(-)integer(220)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) - integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(93)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) - operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(93)operator(,) integer(0)operator(,) integer(93)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(92)operator(,) integer(0)operator(,) integer(93)operator(,) integer(0)operator(,) integer(700)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(92)operator(,) integer(92)operator(,) integer(717)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(724)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(727)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(728)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(609)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(92)operator(,) integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(247)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) - operator(-)integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(755)operator(,) integer(92)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(775)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(92)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(639)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(613)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(613)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(818)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) - operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) - operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) - operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) integer(839)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) - operator(-)integer(478)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(847)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(852)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) - integer(0)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) - operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(609)operator(,) integer(0)operator(,) integer(613)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(478)operator(,) integer(0)operator(,) integer(0)operator(,) integer(885)operator(,) integer(0)operator(,) - integer(888)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) integer(4)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) - integer(8)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(613)operator(,) integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) integer(893)operator(,) - integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(28)operator(,) integer(29)operator(,) - integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) - integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(46)operator(,) integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) - integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(51)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(485)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(485)operator(,) - operator(-)integer(485)operator(,) integer(0)operator(,) operator(-)integer(485)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(659)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(485)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) integer(0)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) integer(316)operator(,) - integer(317)operator(,) integer(318)operator(,) integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) integer(323)operator(,) integer(324)operator(,) integer(325)operator(,) integer(326)operator(,) - integer(327)operator(,) integer(328)operator(,) integer(0)operator(,) integer(0)operator(,) integer(329)operator(,) integer(330)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(485)operator(,) - operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) - operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) integer(0)operator(,) integer(661)operator(,) integer(331)operator(,) - integer(0)operator(,) integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) - integer(341)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(87)operator(,) operator(-)integer(485)operator(,) - integer(0)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) - operator(-)integer(485)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(283)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) integer(0)operator(,) operator(-)integer(485)operator(,) - operator(-)integer(485)operator(,) operator(-)integer(79)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(485)operator(,) operator(-)integer(485)operator(,) integer(0)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) - integer(0)operator(,) operator(-)integer(283)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) integer(0)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) integer(316)operator(,) integer(317)operator(,) - integer(318)operator(,) integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) integer(323)operator(,) integer(324)operator(,) integer(325)operator(,) integer(326)operator(,) integer(327)operator(,) - integer(328)operator(,) integer(0)operator(,) integer(0)operator(,) integer(329)operator(,) integer(330)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) - operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) - operator(-)integer(283)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) integer(0)operator(,) integer(662)operator(,) integer(331)operator(,) integer(660)operator(,) - integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(89)operator(,) operator(-)integer(283)operator(,) integer(0)operator(,) - operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) integer(0)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) - operator(-)integer(81)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(283)operator(,) operator(-)integer(283)operator(,) integer(4)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) - integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(501)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) - integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(28)operator(,) - integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) - integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(46)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(47)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(51)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) - integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(4)operator(,) integer(0)operator(,) - integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(10)operator(,) integer(11)operator(,) - integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) - integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(28)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) - integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) - integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(46)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(51)operator(,) integer(0)operator(,) - integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(4)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) - integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) integer(12)operator(,) operator(-)integer(501)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) - integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(20)operator(,) integer(21)operator(,) - integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(28)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) - integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) - integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(46)operator(,) integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) - integer(51)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(4)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) operator(-)integer(501)operator(,) - operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) - integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(28)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) - integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(46)operator(,) integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) - integer(50)operator(,) integer(0)operator(,) integer(51)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(4)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) - integer(8)operator(,) integer(9)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) - integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(28)operator(,) integer(29)operator(,) - integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) - integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(46)operator(,) integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) - integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(51)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(4)operator(,) integer(0)operator(,) - integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) - integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) - integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(28)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) - integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) - integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(46)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(261)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(51)operator(,) integer(0)operator(,) - integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(4)operator(,) - integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) - integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) - integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) - integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(28)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) - integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(46)operator(,) integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(51)operator(,) - integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) - integer(4)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) - integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(20)operator(,) integer(21)operator(,) - integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(28)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) - integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) - integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(46)operator(,) integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) - integer(51)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(501)operator(,) integer(0)operator(,) integer(4)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) operator(-)integer(501)operator(,) - operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) - integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(28)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) - integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(46)operator(,) integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) - integer(50)operator(,) integer(0)operator(,) integer(51)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) - integer(8)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) - integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(501)operator(,) operator(-)integer(501)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(28)operator(,) integer(29)operator(,) - integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) - integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(46)operator(,) integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) - integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(51)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) - integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) - integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(395)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) - integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) - integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(216)operator(,) integer(217)operator(,) integer(117)operator(,) - integer(118)operator(,) integer(119)operator(,) integer(120)operator(,) integer(121)operator(,) integer(122)operator(,) integer(123)operator(,) integer(124)operator(,) integer(125)operator(,) integer(126)operator(,) integer(127)operator(,) - integer(128)operator(,) integer(129)operator(,) integer(130)operator(,) integer(131)operator(,) integer(132)operator(,) integer(133)operator(,) integer(134)operator(,) integer(135)operator(,) integer(136)operator(,) integer(137)operator(,) - integer(138)operator(,) integer(139)operator(,) integer(140)operator(,) integer(0)operator(,) integer(0)operator(,) integer(141)operator(,) integer(142)operator(,) integer(143)operator(,) integer(144)operator(,) integer(145)operator(,) - integer(146)operator(,) integer(147)operator(,) integer(148)operator(,) integer(149)operator(,) integer(150)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(151)operator(,) integer(152)operator(,) integer(153)operator(,) integer(154)operator(,) integer(155)operator(,) integer(156)operator(,) integer(157)operator(,) integer(158)operator(,) integer(36)operator(,) integer(37)operator(,) - integer(159)operator(,) integer(39)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(160)operator(,) integer(161)operator(,) - integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) - integer(182)operator(,) integer(183)operator(,) integer(0)operator(,) integer(0)operator(,) integer(184)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) - integer(0)operator(,) operator(-)integer(480)operator(,) integer(0)operator(,) integer(185)operator(,) integer(186)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(480)operator(,) integer(0)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) integer(0)operator(,) - operator(-)integer(480)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(480)operator(,) - integer(0)operator(,) integer(0)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) - operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) integer(0)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) integer(0)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(480)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(480)operator(,) - operator(-)integer(480)operator(,) integer(0)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) integer(0)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) - operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) integer(0)operator(,) operator(-)integer(479)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) - operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(480)operator(,) operator(-)integer(479)operator(,) operator(-)integer(480)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) - operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(480)operator(,) operator(-)integer(479)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) - operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) operator(-)integer(479)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) - operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) integer(0)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) integer(0)operator(,) operator(-)integer(479)operator(,) - operator(-)integer(479)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(479)operator(,) - integer(0)operator(,) integer(0)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) integer(0)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) integer(0)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) - operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) integer(0)operator(,) operator(-)integer(481)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(479)operator(,) operator(-)integer(481)operator(,) operator(-)integer(479)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) - operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(479)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(481)operator(,) - operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(481)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) - operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) integer(0)operator(,) operator(-)integer(481)operator(,) - operator(-)integer(481)operator(,) integer(0)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) operator(-)integer(481)operator(,) integer(710)operator(,) integer(0)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) integer(0)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) - integer(0)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(87)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) integer(0)operator(,) - operator(-)integer(482)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(481)operator(,) operator(-)integer(482)operator(,) - integer(0)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(481)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(482)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) - operator(-)integer(482)operator(,) integer(0)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) integer(0)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(482)operator(,) integer(662)operator(,) integer(0)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) - integer(0)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) integer(0)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) - operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(89)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) - operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(482)operator(,) - operator(-)integer(482)operator(,) operator(-)integer(482)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) - operator(-)integer(254)operator(,) operator(-)integer(482)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) - operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) - operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) - operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) - operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(244)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) - operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) - operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) - integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) - operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) integer(0)operator(,) operator(-)integer(483)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(254)operator(,) operator(-)integer(483)operator(,) integer(0)operator(,) - operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) integer(247)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(483)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) - integer(0)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) integer(0)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(483)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) integer(0)operator(,) - operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) integer(0)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) - operator(-)integer(483)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) - operator(-)integer(484)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(483)operator(,) operator(-)integer(483)operator(,) - operator(-)integer(483)operator(,) operator(-)integer(484)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) - operator(-)integer(483)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) - operator(-)integer(484)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(484)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) - operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) integer(0)operator(,) integer(0)operator(,) - operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) - operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) operator(-)integer(484)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(484)operator(,) integer(117)operator(,) integer(118)operator(,) integer(119)operator(,) integer(120)operator(,) integer(121)operator(,) integer(122)operator(,) - integer(123)operator(,) integer(124)operator(,) integer(125)operator(,) integer(126)operator(,) integer(127)operator(,) integer(128)operator(,) integer(129)operator(,) integer(130)operator(,) integer(131)operator(,) integer(132)operator(,) - integer(133)operator(,) integer(134)operator(,) integer(135)operator(,) integer(136)operator(,) integer(137)operator(,) integer(138)operator(,) integer(139)operator(,) integer(140)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(141)operator(,) integer(142)operator(,) integer(143)operator(,) integer(192)operator(,) integer(193)operator(,) integer(194)operator(,) integer(195)operator(,) integer(148)operator(,) integer(149)operator(,) integer(150)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(151)operator(,) integer(152)operator(,) integer(153)operator(,) integer(154)operator(,) integer(196)operator(,) - integer(197)operator(,) integer(198)operator(,) integer(158)operator(,) integer(281)operator(,) integer(282)operator(,) integer(199)operator(,) integer(283)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) - integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) - integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) - integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(0)operator(,) integer(0)operator(,) integer(184)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(117)operator(,) - integer(118)operator(,) integer(119)operator(,) integer(120)operator(,) integer(121)operator(,) integer(122)operator(,) integer(123)operator(,) integer(124)operator(,) integer(125)operator(,) integer(126)operator(,) integer(127)operator(,) - integer(128)operator(,) integer(129)operator(,) integer(130)operator(,) integer(131)operator(,) integer(132)operator(,) integer(133)operator(,) integer(134)operator(,) integer(135)operator(,) integer(136)operator(,) integer(137)operator(,) - integer(138)operator(,) integer(139)operator(,) integer(140)operator(,) integer(0)operator(,) integer(0)operator(,) integer(141)operator(,) integer(142)operator(,) integer(143)operator(,) integer(192)operator(,) integer(193)operator(,) - integer(194)operator(,) integer(195)operator(,) integer(148)operator(,) integer(149)operator(,) integer(150)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(151)operator(,) integer(152)operator(,) integer(153)operator(,) integer(154)operator(,) integer(196)operator(,) integer(197)operator(,) integer(198)operator(,) integer(158)operator(,) integer(251)operator(,) integer(0)operator(,) - integer(199)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(160)operator(,) integer(161)operator(,) - integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(52)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) - integer(182)operator(,) integer(183)operator(,) integer(0)operator(,) integer(0)operator(,) integer(184)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(117)operator(,) integer(118)operator(,) integer(119)operator(,) integer(120)operator(,) integer(121)operator(,) integer(122)operator(,) - integer(123)operator(,) integer(124)operator(,) integer(125)operator(,) integer(126)operator(,) integer(127)operator(,) integer(128)operator(,) integer(129)operator(,) integer(130)operator(,) integer(131)operator(,) integer(132)operator(,) - integer(133)operator(,) integer(134)operator(,) integer(135)operator(,) integer(136)operator(,) integer(137)operator(,) integer(138)operator(,) integer(139)operator(,) integer(140)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(141)operator(,) integer(142)operator(,) integer(143)operator(,) integer(192)operator(,) integer(193)operator(,) integer(194)operator(,) integer(195)operator(,) integer(148)operator(,) integer(149)operator(,) integer(150)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(151)operator(,) integer(152)operator(,) integer(153)operator(,) integer(154)operator(,) integer(196)operator(,) - integer(197)operator(,) integer(198)operator(,) integer(158)operator(,) integer(0)operator(,) integer(0)operator(,) integer(199)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) - integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) - integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(52)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) - integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(0)operator(,) integer(0)operator(,) integer(184)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(117)operator(,) - integer(118)operator(,) integer(119)operator(,) integer(120)operator(,) integer(121)operator(,) integer(122)operator(,) integer(123)operator(,) integer(124)operator(,) integer(125)operator(,) integer(126)operator(,) integer(127)operator(,) - integer(128)operator(,) integer(129)operator(,) integer(130)operator(,) integer(131)operator(,) integer(132)operator(,) integer(133)operator(,) integer(134)operator(,) integer(135)operator(,) integer(136)operator(,) integer(137)operator(,) - integer(138)operator(,) integer(139)operator(,) integer(140)operator(,) integer(0)operator(,) integer(0)operator(,) integer(141)operator(,) integer(142)operator(,) integer(143)operator(,) integer(192)operator(,) integer(193)operator(,) - integer(194)operator(,) integer(195)operator(,) integer(148)operator(,) integer(149)operator(,) integer(150)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(151)operator(,) integer(152)operator(,) integer(153)operator(,) integer(154)operator(,) integer(196)operator(,) integer(197)operator(,) integer(198)operator(,) integer(158)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(199)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(160)operator(,) integer(161)operator(,) - integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) - integer(182)operator(,) integer(183)operator(,) integer(0)operator(,) integer(0)operator(,) integer(184)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) - integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(12)operator(,) - integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) - integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) - integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(231)operator(,) integer(232)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(58)operator(,) - integer(233)operator(,) integer(60)operator(,) integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(12)operator(,) integer(411)operator(,) integer(13)operator(,) - integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(28)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) - integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(46)operator(,) integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) - integer(50)operator(,) integer(0)operator(,) integer(51)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) - integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) - integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) - integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) - integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(616)operator(,) integer(232)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) - integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) - integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) - integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) - integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(231)operator(,) integer(232)operator(,) - integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) - integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) - integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) - integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) - integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(413)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) - integer(0)operator(,) integer(231)operator(,) integer(232)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) - integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) - integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) - integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) - integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(608)operator(,) integer(232)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) - integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) - integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) - integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) - integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) - integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(612)operator(,) integer(232)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) - integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(21)operator(,) - integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) - integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) - integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) - integer(608)operator(,) integer(232)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) - integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) - integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) - integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(803)operator(,) integer(232)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) - integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) - integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) - integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) - integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) - integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(806)operator(,) integer(232)operator(,) integer(52)operator(,) integer(53)operator(,) - integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) - integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) - integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) - integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) - integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(811)operator(,) - integer(232)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) - integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) - integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) - integer(50)operator(,) integer(0)operator(,) integer(870)operator(,) integer(232)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) - integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) - integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) - integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) - integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(872)operator(,) integer(232)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) - integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) - integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) - integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) - integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) - integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(891)operator(,) integer(232)operator(,) - integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) - integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(20)operator(,) - integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(27)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) - integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) - integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) - integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(59)operator(,) integer(60)operator(,) integer(12)operator(,) - integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) - integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) - integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(266)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) - integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) - integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) - integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) - integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) - integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(479)operator(,) integer(0)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) - integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) - integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) - integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) - integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) - integer(590)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) - integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) - integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) - integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(638)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) - integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) - integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) - integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) - integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) - integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(479)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) - integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) - integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) - integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) - integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) - integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(754)operator(,) - integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) - integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) - integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) - integer(50)operator(,) integer(0)operator(,) integer(797)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) - integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) - integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) - integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) - integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) - integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) - integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(29)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) - integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(44)operator(,) - integer(45)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(207)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(58)operator(,) integer(233)operator(,) integer(60)operator(,) integer(12)operator(,) integer(0)operator(,) integer(13)operator(,) integer(14)operator(,) - integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) - integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(102)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) - integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) - integer(43)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(224)operator(,) integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) - integer(0)operator(,) integer(51)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(751)operator(,) integer(0)operator(,) - integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(12)operator(,) integer(108)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) - integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) - integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(102)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(103)operator(,) - integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(104)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(105)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(106)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) - integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(12)operator(,) integer(108)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) - integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) - integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(102)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(224)operator(,) integer(0)operator(,) integer(0)operator(,) integer(47)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(51)operator(,) - integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(12)operator(,) integer(108)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) - integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) - integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(102)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) - integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(276)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(312)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(313)operator(,) integer(0)operator(,) - integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) - integer(6)operator(,) integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(12)operator(,) integer(108)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) - integer(19)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) - integer(25)operator(,) integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(102)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(103)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) - integer(104)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(106)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) - integer(7)operator(,) integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(12)operator(,) integer(108)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) - integer(26)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(102)operator(,) integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) - integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(276)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(107)operator(,) integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) - integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) - integer(0)operator(,) integer(9)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(10)operator(,) integer(11)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(12)operator(,) integer(108)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(97)operator(,) integer(98)operator(,) integer(18)operator(,) integer(19)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(102)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) integer(39)operator(,) - integer(40)operator(,) integer(41)operator(,) integer(0)operator(,) integer(42)operator(,) integer(43)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(831)operator(,) integer(0)operator(,) integer(0)operator(,) integer(107)operator(,) - integer(48)operator(,) integer(0)operator(,) integer(49)operator(,) integer(50)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(524)operator(,) - integer(525)operator(,) integer(0)operator(,) integer(0)operator(,) integer(526)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(108)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) - integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(529)operator(,) integer(525)operator(,) integer(184)operator(,) integer(0)operator(,) integer(530)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) - integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) - integer(183)operator(,) integer(545)operator(,) integer(518)operator(,) integer(184)operator(,) integer(0)operator(,) integer(546)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) - integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) - integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) - integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(582)operator(,) integer(518)operator(,) integer(184)operator(,) - integer(0)operator(,) integer(583)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(160)operator(,) - integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) - integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(585)operator(,) integer(525)operator(,) integer(184)operator(,) integer(0)operator(,) integer(586)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) - integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) - integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(599)operator(,) - integer(518)operator(,) integer(184)operator(,) integer(0)operator(,) integer(600)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(185)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) - integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(602)operator(,) integer(525)operator(,) integer(184)operator(,) integer(0)operator(,) integer(603)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) - integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) - integer(183)operator(,) integer(640)operator(,) integer(518)operator(,) integer(184)operator(,) integer(0)operator(,) integer(641)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) - integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) - integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) - integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(643)operator(,) integer(525)operator(,) integer(184)operator(,) - integer(0)operator(,) integer(644)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(160)operator(,) - integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) - integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(877)operator(,) integer(518)operator(,) integer(184)operator(,) integer(0)operator(,) integer(878)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) - integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) - integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(880)operator(,) - integer(525)operator(,) integer(184)operator(,) integer(0)operator(,) integer(881)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(185)operator(,) integer(160)operator(,) integer(161)operator(,) integer(162)operator(,) integer(163)operator(,) integer(164)operator(,) integer(165)operator(,) integer(0)operator(,) integer(166)operator(,) integer(167)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(168)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(169)operator(,) integer(170)operator(,) integer(171)operator(,) integer(172)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(173)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(174)operator(,) integer(175)operator(,) integer(176)operator(,) integer(177)operator(,) integer(178)operator(,) - integer(179)operator(,) integer(180)operator(,) integer(181)operator(,) integer(182)operator(,) integer(183)operator(,) integer(0)operator(,) integer(0)operator(,) integer(184)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(185)operator(,) integer(316)operator(,) integer(317)operator(,) integer(318)operator(,) - integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) integer(323)operator(,) integer(324)operator(,) integer(325)operator(,) integer(326)operator(,) integer(327)operator(,) integer(328)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(329)operator(,) integer(330)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(331)operator(,) integer(0)operator(,) integer(332)operator(,) - integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) integer(316)operator(,) - integer(317)operator(,) integer(318)operator(,) integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) integer(323)operator(,) integer(324)operator(,) integer(325)operator(,) integer(326)operator(,) - integer(327)operator(,) integer(328)operator(,) integer(0)operator(,) integer(253)operator(,) integer(329)operator(,) integer(330)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(-)integer(220)operator(,) - integer(316)operator(,) integer(317)operator(,) integer(318)operator(,) integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) integer(323)operator(,) integer(324)operator(,) integer(325)operator(,) - integer(326)operator(,) integer(327)operator(,) integer(328)operator(,) integer(0)operator(,) integer(0)operator(,) integer(329)operator(,) integer(330)operator(,) integer(0)operator(,) integer(0)operator(,) integer(331)operator(,) - integer(0)operator(,) integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) - integer(341)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(331)operator(,) operator(-)integer(220)operator(,) integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) - integer(340)operator(,) integer(341)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(605)operator(,) integer(316)operator(,) integer(317)operator(,) integer(318)operator(,) integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) - integer(323)operator(,) integer(324)operator(,) integer(325)operator(,) integer(326)operator(,) integer(327)operator(,) integer(328)operator(,) integer(0)operator(,) integer(0)operator(,) integer(329)operator(,) integer(330)operator(,) - integer(316)operator(,) integer(317)operator(,) integer(318)operator(,) integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) integer(323)operator(,) integer(324)operator(,) integer(325)operator(,) - integer(326)operator(,) operator(-)integer(502)operator(,) operator(-)integer(502)operator(,) integer(0)operator(,) integer(0)operator(,) integer(329)operator(,) integer(330)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(331)operator(,) integer(0)operator(,) integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) - integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) - integer(340)operator(,) integer(341)operator(,) integer(316)operator(,) operator(-)integer(502)operator(,) operator(-)integer(502)operator(,) operator(-)integer(502)operator(,) operator(-)integer(502)operator(,) integer(321)operator(,) integer(322)operator(,) integer(0)operator(,) - integer(0)operator(,) operator(-)integer(502)operator(,) operator(-)integer(502)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(329)operator(,) integer(330)operator(,) integer(316)operator(,) - integer(317)operator(,) integer(318)operator(,) integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) integer(0)operator(,) integer(0)operator(,) integer(325)operator(,) integer(326)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(329)operator(,) integer(330)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) - integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) - integer(341) -operator(};) - -directive(static) directive(const) ident(yytype_int16) ident(yycheck)operator([]) operator(=) -operator({) - integer(16)operator(,) integer(17)operator(,) integer(7)operator(,) integer(8)operator(,) integer(20)operator(,) integer(343)operator(,) integer(215)operator(,) integer(16)operator(,) integer(17)operator(,) integer(15)operator(,) - integer(370)operator(,) integer(20)operator(,) integer(16)operator(,) integer(17)operator(,) integer(7)operator(,) integer(22)operator(,) integer(20)operator(,) integer(16)operator(,) integer(17)operator(,) integer(247)operator(,) - integer(8)operator(,) integer(20)operator(,) integer(8)operator(,) integer(28)operator(,) integer(22)operator(,) integer(397)operator(,) integer(51)operator(,) integer(409)operator(,) integer(44)operator(,) integer(45)operator(,) - integer(368)operator(,) integer(5)operator(,) integer(6)operator(,) integer(49)operator(,) integer(50)operator(,) integer(391)operator(,) integer(106)operator(,) integer(315)operator(,) integer(62)operator(,) integer(692)operator(,) - integer(28)operator(,) integer(15)operator(,) integer(28)operator(,) integer(59)operator(,) integer(60)operator(,) integer(27)operator(,) integer(50)operator(,) integer(52)operator(,) integer(386)operator(,) integer(28)operator(,) - integer(49)operator(,) integer(372)operator(,) integer(531)operator(,) integer(532)operator(,) integer(13)operator(,) integer(11)operator(,) integer(12)operator(,) integer(577)operator(,) integer(26)operator(,) integer(52)operator(,) - integer(442)operator(,) integer(13)operator(,) integer(400)operator(,) integer(4)operator(,) integer(568)operator(,) integer(12)operator(,) integer(570)operator(,) integer(587)operator(,) integer(26)operator(,) integer(47)operator(,) - integer(287)operator(,) integer(36)operator(,) integer(37)operator(,) integer(0)operator(,) integer(291)operator(,) integer(533)operator(,) integer(534)operator(,) integer(51)operator(,) integer(261)operator(,) integer(1)operator(,) - integer(92)operator(,) integer(689)operator(,) integer(59)operator(,) integer(58)operator(,) integer(692)operator(,) integer(25)operator(,) integer(130)operator(,) integer(94)operator(,) integer(58)operator(,) integer(13)operator(,) - integer(81)operator(,) integer(25)operator(,) integer(81)operator(,) integer(83)operator(,) integer(101)operator(,) integer(664)operator(,) integer(94)operator(,) integer(71)operator(,) integer(110)operator(,) integer(17)operator(,) - integer(84)operator(,) integer(670)operator(,) integer(20)operator(,) integer(15)operator(,) integer(54)operator(,) integer(17)operator(,) integer(13)operator(,) integer(64)operator(,) integer(115)operator(,) integer(72)operator(,) - integer(25)operator(,) integer(129)operator(,) integer(450)operator(,) integer(103)operator(,) integer(83)operator(,) integer(62)operator(,) integer(342)operator(,) integer(120)operator(,) integer(344)operator(,) integer(345)operator(,) - integer(346)operator(,) integer(83)operator(,) integer(102)operator(,) integer(105)operator(,) integer(99)operator(,) integer(100)operator(,) integer(16)operator(,) integer(17)operator(,) integer(129)operator(,) integer(312)operator(,) - integer(20)operator(,) integer(101)operator(,) integer(28)operator(,) integer(124)operator(,) integer(103)operator(,) integer(124)operator(,) integer(126)operator(,) integer(36)operator(,) integer(37)operator(,) integer(130)operator(,) - integer(50)operator(,) integer(103)operator(,) integer(126)operator(,) integer(369)operator(,) integer(54)operator(,) integer(108)operator(,) integer(105)operator(,) integer(83)operator(,) integer(130)operator(,) integer(131)operator(,) - integer(56)operator(,) integer(57)operator(,) integer(120)operator(,) integer(105)operator(,) integer(129)operator(,) integer(26)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(385)operator(,) - integer(50)operator(,) integer(387)operator(,) integer(120)operator(,) integer(110)operator(,) integer(126)operator(,) integer(130)operator(,) integer(26)operator(,) integer(26)operator(,) integer(108)operator(,) integer(128)operator(,) - integer(128)operator(,) integer(130)operator(,) integer(131)operator(,) integer(826)operator(,) integer(108)operator(,) integer(401)operator(,) integer(81)operator(,) integer(103)operator(,) integer(130)operator(,) integer(131)operator(,) - integer(15)operator(,) integer(105)operator(,) integer(17)operator(,) integer(126)operator(,) integer(544)operator(,) integer(107)operator(,) integer(126)operator(,) integer(2)operator(,) integer(128)operator(,) integer(4)operator(,) - integer(5)operator(,) integer(6)operator(,) integer(126)operator(,) integer(108)operator(,) integer(218)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) integer(105)operator(,) integer(103)operator(,) - integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(563)operator(,) integer(430)operator(,) integer(20)operator(,) integer(130)operator(,) integer(131)operator(,) integer(130)operator(,) integer(131)operator(,) - integer(81)operator(,) integer(126)operator(,) integer(27)operator(,) integer(128)operator(,) integer(94)operator(,) integer(231)operator(,) integer(232)operator(,) integer(233)operator(,) integer(826)operator(,) integer(124)operator(,) - integer(678)operator(,) integer(81)operator(,) integer(81)operator(,) integer(130)operator(,) integer(131)operator(,) integer(451)operator(,) integer(125)operator(,) integer(128)operator(,) integer(244)operator(,) integer(81)operator(,) - integer(246)operator(,) integer(247)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(244)operator(,) integer(51)operator(,) integer(246)operator(,) integer(247)operator(,) integer(128)operator(,) - integer(244)operator(,) integer(562)operator(,) integer(246)operator(,) integer(247)operator(,) integer(59)operator(,) integer(244)operator(,) integer(463)operator(,) integer(246)operator(,) integer(247)operator(,) integer(120)operator(,) - integer(266)operator(,) integer(122)operator(,) integer(81)operator(,) integer(124)operator(,) integer(130)operator(,) integer(131)operator(,) integer(71)operator(,) integer(128)operator(,) integer(737)operator(,) integer(738)operator(,) - integer(120)operator(,) integer(120)operator(,) integer(122)operator(,) integer(122)operator(,) integer(124)operator(,) integer(124)operator(,) integer(222)operator(,) integer(223)operator(,) integer(128)operator(,) integer(128)operator(,) - integer(25)operator(,) integer(218)operator(,) integer(124)operator(,) integer(126)operator(,) integer(52)operator(,) integer(779)operator(,) integer(780)operator(,) integer(25)operator(,) integer(798)operator(,) integer(54)operator(,) - integer(784)operator(,) integer(59)operator(,) integer(60)operator(,) integer(261)operator(,) integer(25)operator(,) integer(36)operator(,) integer(37)operator(,) integer(267)operator(,) integer(313)operator(,) integer(58)operator(,) - integer(105)operator(,) integer(103)operator(,) integer(107)operator(,) integer(122)operator(,) integer(310)operator(,) integer(124)operator(,) integer(83)operator(,) integer(367)operator(,) integer(576)operator(,) integer(315)operator(,) - integer(316)operator(,) integer(317)operator(,) integer(318)operator(,) integer(319)operator(,) integer(320)operator(,) integer(321)operator(,) integer(322)operator(,) integer(323)operator(,) integer(324)operator(,) integer(325)operator(,) - integer(326)operator(,) integer(327)operator(,) integer(328)operator(,) integer(329)operator(,) integer(330)operator(,) integer(331)operator(,) integer(332)operator(,) integer(333)operator(,) integer(334)operator(,) integer(335)operator(,) - integer(336)operator(,) integer(337)operator(,) integer(338)operator(,) integer(339)operator(,) integer(340)operator(,) integer(341)operator(,) integer(244)operator(,) integer(343)operator(,) integer(246)operator(,) integer(247)operator(,) - integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(310)operator(,) integer(312)operator(,) integer(351)operator(,) integer(352)operator(,) integer(342)operator(,) integer(315)operator(,) integer(313)operator(,) - integer(131)operator(,) integer(83)operator(,) integer(54)operator(,) integer(725)operator(,) integer(343)operator(,) integer(301)operator(,) integer(302)operator(,) integer(303)operator(,) integer(304)operator(,) integer(25)operator(,) - integer(732)operator(,) integer(723)operator(,) integer(368)operator(,) integer(108)operator(,) integer(244)operator(,) integer(859)operator(,) integer(246)operator(,) integer(247)operator(,) integer(84)operator(,) integer(300)operator(,) - integer(108)operator(,) integer(103)operator(,) integer(367)operator(,) integer(81)operator(,) integer(305)operator(,) integer(25)operator(,) integer(83)operator(,) integer(108)operator(,) integer(384)operator(,) integer(368)operator(,) - integer(386)operator(,) integer(126)operator(,) integer(388)operator(,) integer(389)operator(,) integer(351)operator(,) integer(352)operator(,) integer(25)operator(,) integer(393)operator(,) integer(126)operator(,) integer(25)operator(,) - integer(385)operator(,) integer(56)operator(,) integer(57)operator(,) integer(592)operator(,) integer(400)operator(,) integer(126)operator(,) integer(103)operator(,) integer(386)operator(,) integer(126)operator(,) integer(405)operator(,) - integer(406)operator(,) integer(206)operator(,) integer(25)operator(,) integer(409)operator(,) integer(399)operator(,) integer(126)operator(,) integer(624)operator(,) integer(413)operator(,) integer(240)operator(,) integer(625)operator(,) - integer(626)operator(,) integer(400)operator(,) integer(406)operator(,) integer(128)operator(,) integer(413)operator(,) integer(120)operator(,) integer(124)operator(,) integer(222)operator(,) integer(223)operator(,) integer(413)operator(,) - integer(426)operator(,) integer(771)operator(,) integer(14)operator(,) integer(15)operator(,) integer(81)operator(,) integer(431)operator(,) integer(363)operator(,) integer(81)operator(,) integer(81)operator(,) integer(424)operator(,) - integer(310)operator(,) integer(125)operator(,) integer(126)operator(,) integer(439)operator(,) integer(429)operator(,) integer(315)operator(,) integer(442)operator(,) integer(83)operator(,) integer(444)operator(,) integer(244)operator(,) - integer(64)operator(,) integer(246)operator(,) integer(247)operator(,) integer(2)operator(,) integer(450)operator(,) integer(125)operator(,) integer(424)operator(,) integer(417)operator(,) integer(424)operator(,) integer(419)operator(,) - integer(125)operator(,) integer(256)operator(,) integer(798)operator(,) integer(103)operator(,) integer(449)operator(,) integer(424)operator(,) integer(261)operator(,) integer(103)operator(,) integer(108)operator(,) integer(396)operator(,) - integer(397)operator(,) integer(450)operator(,) integer(468)operator(,) integer(469)operator(,) integer(103)operator(,) integer(435)operator(,) integer(436)operator(,) integer(124)operator(,) integer(64)operator(,) integer(108)operator(,) - integer(124)operator(,) integer(124)operator(,) integer(108)operator(,) integer(479)operator(,) integer(785)operator(,) integer(125)operator(,) integer(126)operator(,) integer(125)operator(,) integer(850)operator(,) integer(50)operator(,) - integer(830)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(108)operator(,) integer(125)operator(,) integer(126)operator(,) integer(47)operator(,) integer(50)operator(,) - integer(126)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(300)operator(,) integer(301)operator(,) integer(302)operator(,) integer(303)operator(,) integer(304)operator(,) - integer(305)operator(,) integer(306)operator(,) integer(307)operator(,) integer(126)operator(,) integer(123)operator(,) integer(310)operator(,) integer(121)operator(,) integer(312)operator(,) integer(313)operator(,) integer(83)operator(,) - integer(315)operator(,) integer(64)operator(,) integer(50)operator(,) integer(393)operator(,) integer(886)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) - integer(91)operator(,) integer(92)operator(,) integer(54)operator(,) integer(55)operator(,) integer(521)operator(,) integer(83)operator(,) integer(79)operator(,) integer(80)operator(,) integer(126)operator(,) integer(103)operator(,) - integer(91)operator(,) integer(92)operator(,) integer(130)operator(,) integer(521)operator(,) integer(54)operator(,) integer(863)operator(,) integer(101)operator(,) integer(126)operator(,) integer(343)operator(,) integer(110)operator(,) - integer(528)operator(,) integer(130)operator(,) integer(113)operator(,) integer(531)operator(,) integer(532)operator(,) integer(103)operator(,) integer(351)operator(,) integer(352)operator(,) integer(107)operator(,) integer(110)operator(,) - integer(58)operator(,) integer(548)operator(,) integer(113)operator(,) integer(91)operator(,) integer(92)operator(,) integer(101)operator(,) integer(81)operator(,) integer(128)operator(,) integer(111)operator(,) integer(112)operator(,) - integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(368)operator(,) integer(81)operator(,) integer(370)operator(,) integer(371)operator(,) integer(64)operator(,) integer(81)operator(,) integer(83)operator(,) - integer(576)operator(,) integer(403)operator(,) integer(110)operator(,) integer(64)operator(,) integer(126)operator(,) integer(113)operator(,) integer(81)operator(,) integer(382)operator(,) integer(573)operator(,) integer(574)operator(,) - integer(83)operator(,) integer(386)operator(,) integer(552)operator(,) integer(58)operator(,) integer(590)operator(,) integer(390)operator(,) integer(81)operator(,) integer(392)operator(,) integer(787)operator(,) integer(103)operator(,) - integer(573)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(793)operator(,) integer(400)operator(,) integer(574)operator(,) integer(543)operator(,) integer(574)operator(,) integer(124)operator(,) - integer(103)operator(,) integer(90)operator(,) integer(608)operator(,) integer(10)operator(,) integer(541)operator(,) integer(574)operator(,) integer(612)operator(,) integer(124)operator(,) integer(413)operator(,) integer(122)operator(,) - integer(616)operator(,) integer(124)operator(,) integer(126)operator(,) integer(13)operator(,) integer(8)operator(,) integer(128)operator(,) integer(126)operator(,) integer(122)operator(,) integer(624)operator(,) integer(124)operator(,) - integer(130)operator(,) integer(64)operator(,) integer(427)operator(,) integer(126)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(564)operator(,) integer(17)operator(,) integer(124)operator(,) - integer(624)operator(,) integer(10)operator(,) integer(638)operator(,) integer(58)operator(,) integer(126)operator(,) integer(624)operator(,) integer(79)operator(,) integer(80)operator(,) integer(125)operator(,) integer(2)operator(,) - integer(81)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(450)operator(,) integer(126)operator(,) integer(125)operator(,) integer(864)operator(,) integer(81)operator(,) - integer(81)operator(,) integer(657)operator(,) integer(15)operator(,) integer(659)operator(,) integer(660)operator(,) integer(661)operator(,) integer(662)operator(,) integer(653)operator(,) integer(604)operator(,) integer(121)operator(,) - integer(666)operator(,) integer(667)operator(,) integer(81)operator(,) integer(126)operator(,) integer(125)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) - integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(129)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(81)operator(,) integer(83)operator(,) integer(685)operator(,) - integer(126)operator(,) integer(122)operator(,) integer(126)operator(,) integer(124)operator(,) integer(47)operator(,) integer(125)operator(,) integer(81)operator(,) integer(123)operator(,) integer(51)operator(,) integer(653)operator(,) - integer(122)operator(,) integer(122)operator(,) integer(124)operator(,) integer(124)operator(,) integer(661)operator(,) integer(123)operator(,) integer(576)operator(,) integer(256)operator(,) integer(103)operator(,) integer(666)operator(,) - integer(667)operator(,) integer(10)operator(,) integer(261)operator(,) integer(122)operator(,) integer(710)operator(,) integer(124)operator(,) integer(712)operator(,) integer(713)operator(,) integer(71)operator(,) integer(81)operator(,) - integer(103)operator(,) integer(126)operator(,) integer(718)operator(,) integer(126)operator(,) integer(81)operator(,) integer(50)operator(,) integer(686)operator(,) integer(83)operator(,) integer(122)operator(,) integer(725)operator(,) - integer(124)operator(,) integer(126)operator(,) integer(81)operator(,) integer(729)operator(,) integer(126)operator(,) integer(50)operator(,) integer(732)operator(,) integer(122)operator(,) integer(15)operator(,) integer(124)operator(,) - integer(729)operator(,) integer(81)operator(,) integer(123)operator(,) integer(52)operator(,) integer(53)operator(,) integer(729)operator(,) integer(55)operator(,) integer(103)operator(,) integer(543)operator(,) integer(544)operator(,) - integer(59)operator(,) integer(60)operator(,) integer(58)operator(,) integer(680)operator(,) integer(107)operator(,) integer(61)operator(,) integer(10)operator(,) integer(270)operator(,) integer(754)operator(,) integer(272)operator(,) - integer(122)operator(,) integer(274)operator(,) integer(124)operator(,) integer(312)operator(,) integer(10)operator(,) integer(122)operator(,) integer(762)operator(,) integer(124)operator(,) integer(563)operator(,) integer(92)operator(,) - integer(126)operator(,) integer(707)operator(,) integer(126)operator(,) integer(122)operator(,) integer(126)operator(,) integer(124)operator(,) integer(736)operator(,) integer(2)operator(,) integer(123)operator(,) integer(4)operator(,) - integer(126)operator(,) integer(125)operator(,) integer(122)operator(,) integer(743)operator(,) integer(124)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) integer(125)operator(,) integer(611)operator(,) - integer(125)operator(,) integer(16)operator(,) integer(17)operator(,) integer(99)operator(,) integer(100)operator(,) integer(20)operator(,) integer(723)operator(,) integer(121)operator(,) integer(64)operator(,) integer(795)operator(,) - integer(622)operator(,) integer(797)operator(,) integer(27)operator(,) integer(125)operator(,) integer(123)operator(,) integer(762)operator(,) integer(10)operator(,) integer(803)operator(,) integer(125)operator(,) integer(604)operator(,) - integer(806)operator(,) integer(10)operator(,) integer(84)operator(,) integer(79)operator(,) integer(80)operator(,) integer(811)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(42)operator(,) - integer(43)operator(,) integer(9)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(49)operator(,) integer(50)operator(,) integer(10)operator(,) integer(10)operator(,) integer(624)operator(,) - integer(125)operator(,) integer(121)operator(,) integer(786)operator(,) integer(382)operator(,) integer(59)operator(,) integer(630)operator(,) integer(125)operator(,) integer(108)operator(,) integer(126)operator(,) integer(126)operator(,) - integer(10)operator(,) integer(390)operator(,) integer(10)operator(,) integer(392)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) - integer(645)operator(,) integer(126)operator(,) integer(848)operator(,) integer(206)operator(,) integer(850)operator(,) integer(10)operator(,) integer(126)operator(,) integer(125)operator(,) integer(653)operator(,) integer(729)operator(,) - integer(10)operator(,) integer(121)operator(,) integer(10)operator(,) integer(54)operator(,) integer(848)operator(,) integer(121)operator(,) integer(661)operator(,) integer(863)operator(,) integer(10)operator(,) integer(10)operator(,) - integer(71)operator(,) integer(666)operator(,) integer(667)operator(,) integer(126)operator(,) integer(870)operator(,) integer(123)operator(,) integer(872)operator(,) integer(862)operator(,) integer(427)operator(,) integer(6)operator(,) - integer(105)operator(,) integer(653)operator(,) integer(107)operator(,) integer(78)operator(,) integer(863)operator(,) integer(81)operator(,) integer(866)operator(,) integer(7)operator(,) integer(865)operator(,) integer(785)operator(,) - integer(886)operator(,) integer(562)operator(,) integer(689)operator(,) integer(689)operator(,) operator(-)integer(1)operator(,) integer(891)operator(,) integer(62)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(724)operator(,) integer(256)operator(,) operator(-)integer(1)operator(,) integer(727)operator(,) integer(728)operator(,) operator(-)integer(1)operator(,) integer(261)operator(,) integer(704)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(707)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(719)operator(,) integer(720)operator(,) integer(721)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(300)operator(,) operator(-)integer(1)operator(,) integer(2)operator(,) - operator(-)integer(1)operator(,) integer(4)operator(,) integer(305)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(753)operator(,) integer(312)operator(,) - integer(313)operator(,) operator(-)integer(1)operator(,) integer(15)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(762)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(768)operator(,) integer(769)operator(,) operator(-)integer(1)operator(,) integer(771)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(206)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(808)operator(,) integer(809)operator(,) integer(10)operator(,) integer(11)operator(,) - integer(12)operator(,) integer(786)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(47)operator(,) integer(790)operator(,) operator(-)integer(1)operator(,) integer(222)operator(,) integer(223)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(27)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(239)operator(,) integer(240)operator(,) integer(370)operator(,) operator(-)integer(1)operator(,) integer(244)operator(,) - operator(-)integer(1)operator(,) integer(246)operator(,) integer(247)operator(,) integer(247)operator(,) integer(846)operator(,) integer(847)operator(,) integer(48)operator(,) operator(-)integer(1)operator(,) integer(823)operator(,) integer(382)operator(,) - integer(852)operator(,) integer(256)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(830)operator(,) integer(261)operator(,) integer(390)operator(,) operator(-)integer(1)operator(,) integer(392)operator(,) - operator(-)integer(1)operator(,) integer(836)operator(,) operator(-)integer(1)operator(,) integer(838)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(871)operator(,) - integer(845)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(107)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(885)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(888)operator(,) operator(-)integer(1)operator(,) integer(863)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(893)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(427)operator(,) integer(300)operator(,) integer(301)operator(,) integer(302)operator(,) integer(303)operator(,) integer(304)operator(,) - integer(305)operator(,) integer(306)operator(,) integer(307)operator(,) integer(105)operator(,) operator(-)integer(1)operator(,) integer(310)operator(,) operator(-)integer(1)operator(,) integer(312)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(315)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(645)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(343)operator(,) integer(343)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(351)operator(,) integer(352)operator(,) operator(-)integer(1)operator(,) integer(2)operator(,) - operator(-)integer(1)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(15)operator(,) integer(368)operator(,) integer(368)operator(,) integer(370)operator(,) integer(371)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(206)operator(,) integer(378)operator(,) integer(704)operator(,) operator(-)integer(1)operator(,) integer(382)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(386)operator(,) integer(386)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(390)operator(,) operator(-)integer(1)operator(,) integer(392)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(719)operator(,) integer(720)operator(,) integer(721)operator(,) operator(-)integer(1)operator(,) integer(47)operator(,) integer(400)operator(,) integer(400)operator(,) operator(-)integer(1)operator(,) integer(51)operator(,) integer(403)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(413)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(544)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(418)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(71)operator(,) operator(-)integer(1)operator(,) - integer(222)operator(,) integer(223)operator(,) integer(427)operator(,) integer(256)operator(,) integer(753)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(261)operator(,) operator(-)integer(1)operator(,) - integer(563)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(768)operator(,) - integer(769)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(450)operator(,) integer(450)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(107)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(790)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(300)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(305)operator(,) operator(-)integer(1)operator(,) integer(478)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(312)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(2)operator(,) operator(-)integer(1)operator(,) - integer(4)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(823)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(301)operator(,) - integer(302)operator(,) integer(303)operator(,) integer(304)operator(,) operator(-)integer(1)operator(,) integer(306)operator(,) integer(307)operator(,) operator(-)integer(1)operator(,) integer(836)operator(,) operator(-)integer(1)operator(,) integer(838)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(645)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(845)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(653)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(528)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(531)operator(,) integer(532)operator(,) integer(533)operator(,) - integer(534)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(47)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(370)operator(,) integer(543)operator(,) integer(544)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(550)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(382)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(206)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(390)operator(,) integer(563)operator(,) integer(392)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(566)operator(,) operator(-)integer(1)operator(,) integer(568)operator(,) operator(-)integer(1)operator(,) integer(570)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(371)operator(,) - operator(-)integer(1)operator(,) integer(704)operator(,) integer(576)operator(,) integer(577)operator(,) operator(-)integer(1)operator(,) integer(579)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(587)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(719)operator(,) integer(720)operator(,) integer(721)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(107)operator(,) integer(427)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(604)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(256)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(611)operator(,) integer(261)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(413)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(622)operator(,) integer(624)operator(,) - integer(753)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(630)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(768)operator(,) integer(769)operator(,) operator(-)integer(1)operator(,) integer(771)operator(,) operator(-)integer(1)operator(,) - integer(645)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(300)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(305)operator(,) integer(786)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(661)operator(,) integer(790)operator(,) operator(-)integer(1)operator(,) integer(312)operator(,) - integer(313)operator(,) integer(666)operator(,) integer(667)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(678)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(823)operator(,) operator(-)integer(1)operator(,) integer(206)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(830)operator(,) integer(702)operator(,) integer(704)operator(,) - operator(-)integer(1)operator(,) integer(705)operator(,) integer(707)operator(,) integer(836)operator(,) operator(-)integer(1)operator(,) integer(838)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(544)operator(,) integer(845)operator(,) operator(-)integer(1)operator(,) integer(719)operator(,) integer(720)operator(,) integer(721)operator(,) integer(370)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(724)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(727)operator(,) integer(728)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(382)operator(,) - integer(563)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(737)operator(,) integer(738)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(390)operator(,) operator(-)integer(1)operator(,) integer(392)operator(,) - operator(-)integer(1)operator(,) integer(543)operator(,) integer(256)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(261)operator(,) integer(753)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(762)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(768)operator(,) integer(769)operator(,) operator(-)integer(1)operator(,) integer(771)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(427)operator(,) integer(779)operator(,) integer(780)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(784)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(790)operator(,) integer(300)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(305)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(798)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(312)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(604)operator(,) operator(-)integer(1)operator(,) integer(808)operator(,) integer(809)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(645)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(823)operator(,) operator(-)integer(1)operator(,) - integer(653)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(830)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(630)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(836)operator(,) operator(-)integer(1)operator(,) integer(838)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(845)operator(,) operator(-)integer(1)operator(,) integer(846)operator(,) integer(847)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(852)operator(,) integer(231)operator(,) - integer(232)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(859)operator(,) integer(370)operator(,) operator(-)integer(1)operator(,) integer(863)operator(,) integer(863)operator(,) - operator(-)integer(1)operator(,) integer(865)operator(,) integer(866)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(871)operator(,) integer(382)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(704)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(390)operator(,) operator(-)integer(1)operator(,) integer(392)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(885)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(888)operator(,) operator(-)integer(1)operator(,) integer(719)operator(,) integer(720)operator(,) integer(721)operator(,) integer(893)operator(,) - operator(-)integer(1)operator(,) integer(544)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(50)operator(,) integer(51)operator(,) operator(-)integer(1)operator(,) integer(707)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(563)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(427)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) - integer(753)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(310)operator(,) integer(77)operator(,) - integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) integer(315)operator(,) operator(-)integer(1)operator(,) integer(768)operator(,) integer(769)operator(,) operator(-)integer(1)operator(,) integer(771)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(786)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(790)operator(,) integer(106)operator(,) integer(107)operator(,) - integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(118)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(127)operator(,) - integer(73)operator(,) integer(74)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(823)operator(,) operator(-)integer(1)operator(,) integer(645)operator(,) integer(646)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(830)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(653)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(836)operator(,) operator(-)integer(1)operator(,) integer(838)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(393)operator(,) integer(845)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) - integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(405)operator(,) integer(406)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(409)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(544)operator(,) integer(413)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(563)operator(,) - operator(-)integer(1)operator(,) integer(704)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(439)operator(,) integer(43)operator(,) operator(-)integer(1)operator(,) - integer(442)operator(,) operator(-)integer(1)operator(,) integer(444)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(719)operator(,) integer(720)operator(,) integer(721)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(64)operator(,) - integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) integer(74)operator(,) - integer(75)operator(,) integer(76)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) integer(479)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(753)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(768)operator(,) integer(769)operator(,) operator(-)integer(1)operator(,) integer(771)operator(,) integer(104)operator(,) - operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) - integer(115)operator(,) integer(645)operator(,) operator(-)integer(1)operator(,) integer(786)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(790)operator(,) operator(-)integer(1)operator(,) integer(0)operator(,) - operator(-)integer(1)operator(,) integer(126)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(8)operator(,) integer(9)operator(,) integer(10)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) operator(-)integer(1)operator(,) integer(17)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(27)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(823)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(36)operator(,) integer(37)operator(,) integer(830)operator(,) integer(39)operator(,) integer(40)operator(,) - integer(41)operator(,) integer(42)operator(,) integer(43)operator(,) integer(836)operator(,) operator(-)integer(1)operator(,) integer(838)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(704)operator(,) operator(-)integer(1)operator(,) integer(845)operator(,) operator(-)integer(1)operator(,) integer(576)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(719)operator(,) integer(720)operator(,) integer(721)operator(,) integer(590)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(81)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(608)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(612)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(616)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(753)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(624)operator(,) operator(-)integer(1)operator(,) integer(105)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(768)operator(,) integer(769)operator(,) operator(-)integer(1)operator(,) integer(771)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(121)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(124)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(128)operator(,) operator(-)integer(1)operator(,) integer(130)operator(,) - integer(131)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(657)operator(,) integer(790)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(685)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(823)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(830)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(836)operator(,) operator(-)integer(1)operator(,) integer(838)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(845)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(718)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(725)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(732)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(754)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) - integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) integer(26)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) integer(797)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) - integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(806)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(811)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) - integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(848)operator(,) operator(-)integer(1)operator(,) integer(850)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) integer(120)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(128)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(870)operator(,) operator(-)integer(1)operator(,) - integer(872)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(0)operator(,) integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) - integer(6)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(886)operator(,) integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(891)operator(,) - integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) - integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) - integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) - integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(0)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(8)operator(,) integer(9)operator(,) integer(10)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(14)operator(,) - integer(15)operator(,) operator(-)integer(1)operator(,) integer(17)operator(,) operator(-)integer(1)operator(,) integer(130)operator(,) integer(131)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(43)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(26)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(36)operator(,) integer(37)operator(,) operator(-)integer(1)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(42)operator(,) integer(43)operator(,) integer(64)operator(,) - integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) integer(74)operator(,) - integer(75)operator(,) integer(76)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(64)operator(,) - integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) integer(74)operator(,) - integer(75)operator(,) integer(76)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) integer(81)operator(,) operator(-)integer(1)operator(,) integer(83)operator(,) integer(104)operator(,) - operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) - integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(103)operator(,) integer(104)operator(,) - operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) - integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(0)operator(,) integer(120)operator(,) integer(121)operator(,) integer(122)operator(,) operator(-)integer(1)operator(,) integer(124)operator(,) - integer(125)operator(,) integer(126)operator(,) integer(8)operator(,) integer(9)operator(,) integer(10)operator(,) integer(130)operator(,) integer(131)operator(,) operator(-)integer(1)operator(,) integer(14)operator(,) integer(15)operator(,) - operator(-)integer(1)operator(,) integer(17)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(36)operator(,) integer(37)operator(,) operator(-)integer(1)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(42)operator(,) integer(43)operator(,) integer(64)operator(,) integer(65)operator(,) - integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) integer(74)operator(,) integer(75)operator(,) - integer(76)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(64)operator(,) integer(65)operator(,) - integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) integer(74)operator(,) integer(75)operator(,) - integer(76)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) integer(81)operator(,) operator(-)integer(1)operator(,) integer(83)operator(,) integer(104)operator(,) integer(105)operator(,) - integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(103)operator(,) integer(104)operator(,) operator(-)integer(1)operator(,) - integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(121)operator(,) integer(122)operator(,) operator(-)integer(1)operator(,) integer(124)operator(,) integer(125)operator(,) - integer(126)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(130)operator(,) integer(131)operator(,) integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) - integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(15)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) - integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) - integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) - integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(1)operator(,) operator(-)integer(1)operator(,) - integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(130)operator(,) integer(131)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) - operator(-)integer(1)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) - integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) - integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) - integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(130)operator(,) integer(131)operator(,) integer(10)operator(,) - integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) - integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) - integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) - integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) - operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) - integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(130)operator(,) - integer(131)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(15)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) - integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) - integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) - integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) - integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) - integer(6)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) integer(9)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) - integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(130)operator(,) integer(131)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) - integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) - integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) - integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(1)operator(,) operator(-)integer(1)operator(,) - integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) - integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) - integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(130)operator(,) integer(131)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) - integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) - integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(130)operator(,) integer(131)operator(,) integer(1)operator(,) - operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) - integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) - integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) - integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) - integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) - integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) - operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(125)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(130)operator(,) integer(131)operator(,) - integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) - integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) - integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) - integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) - operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) - integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(121)operator(,) operator(-)integer(1)operator(,) integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(130)operator(,) - integer(131)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) - integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) - integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) - integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) - integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) - integer(6)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) - integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(130)operator(,) integer(131)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) - integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) - integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) - integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) - integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) - integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(131)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) - integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(130)operator(,) integer(131)operator(,) integer(3)operator(,) - integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) integer(13)operator(,) - integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) - integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) - integer(54)operator(,) integer(55)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) - integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) - integer(114)operator(,) integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) - operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(128)operator(,) integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) - integer(26)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) - integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) - integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) - integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) integer(120)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) - integer(23)operator(,) integer(24)operator(,) integer(128)operator(,) integer(26)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) - integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) - integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) integer(120)operator(,) integer(18)operator(,) integer(19)operator(,) - integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(128)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) - integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) - integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) - integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) integer(83)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) - operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(103)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) - integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) - operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(128)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) - integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) integer(83)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) - operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) - integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(103)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) - integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) - integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) integer(128)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) - integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) - integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) - integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) - integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(128)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) - integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) - integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) - operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) - integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) - integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(128)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) - operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) - integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) - integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) - integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) - integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) - integer(128)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) - integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) - integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(128)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) - integer(9)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) - integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) - integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) - integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) - integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) - integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(118)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(3)operator(,) - integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) integer(13)operator(,) - integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) - integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) operator(-)integer(1)operator(,) - integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) - integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) - integer(114)operator(,) integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) - integer(9)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) - integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) - integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) - integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) - integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) - integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(118)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(3)operator(,) - integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) integer(13)operator(,) - integer(14)operator(,) integer(15)operator(,) integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) integer(25)operator(,) integer(26)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) - integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) - integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) - integer(114)operator(,) integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) - integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) - operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) - integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) - operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) - integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(116)operator(,) - integer(117)operator(,) integer(118)operator(,) integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) integer(125)operator(,) integer(18)operator(,) - integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) - integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) - integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) - integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) - operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) - integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) - integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) - integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) - integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) - integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) - integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) - integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) - integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) - integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) - integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) - integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) - operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) - integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) - operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) - integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) - operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) - integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) - integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) - integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) - integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) - integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) - integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) - integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) - integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) - integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) - operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) - integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) - integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) - operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) - integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) - integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) - integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) - integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) - integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) - integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) - integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) - integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) - integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) - integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) - integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) - integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) - integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) - integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) - integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) - integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) - operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) - integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) - integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) - integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) - integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) - integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) - integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) integer(92)operator(,) - integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) - integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) - integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(38)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) - integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) - integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) - integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) - operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) - integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) - operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) - integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) - integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) - integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) - integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) - integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) - integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) - integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) - integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) - integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) - operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) - integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) - integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) - operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) - integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) - integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) - integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) - integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) - integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) - integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) - integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) - integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) - integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) - integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) - integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) - operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) - integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) - integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) - integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) - integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) - operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) - integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) - integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) - integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) - integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) - integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) integer(62)operator(,) - integer(63)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) integer(116)operator(,) integer(117)operator(,) integer(118)operator(,) integer(16)operator(,) operator(-)integer(1)operator(,) integer(18)operator(,) integer(19)operator(,) - integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) - integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) - integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) - integer(60)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) - operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) integer(108)operator(,) operator(-)integer(1)operator(,) - integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) integer(116)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) - integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) - integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) - integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) - integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) integer(116)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) - integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) - integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) - integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) - operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) integer(116)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) - integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) - integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) - integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) - integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) - integer(4)operator(,) integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(16)operator(,) integer(116)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) - integer(24)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) - integer(34)operator(,) integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) - integer(54)operator(,) integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) - integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) - integer(5)operator(,) operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(16)operator(,) integer(116)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) - integer(35)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(45)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) - integer(55)operator(,) integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(85)operator(,) integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) - integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) - operator(-)integer(1)operator(,) integer(7)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(11)operator(,) integer(12)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(16)operator(,) integer(116)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(45)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) operator(-)integer(1)operator(,) integer(59)operator(,) integer(60)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(82)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(85)operator(,) - integer(86)operator(,) operator(-)integer(1)operator(,) integer(88)operator(,) integer(89)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) - integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(50)operator(,) - integer(51)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(116)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) - integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(50)operator(,) integer(51)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) - integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) - integer(115)operator(,) integer(50)operator(,) integer(51)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) - integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) - integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) - integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(50)operator(,) integer(51)operator(,) integer(118)operator(,) - operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(62)operator(,) - integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) - integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(50)operator(,) integer(51)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) - integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) - integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(50)operator(,) - integer(51)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(127)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) - integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(50)operator(,) integer(51)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) - integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) - integer(115)operator(,) integer(50)operator(,) integer(51)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) - integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) - integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) - integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(50)operator(,) integer(51)operator(,) integer(118)operator(,) - operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(62)operator(,) - integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) - integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(50)operator(,) integer(51)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) - integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) - integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(50)operator(,) - integer(51)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) integer(54)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(127)operator(,) integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) operator(-)integer(1)operator(,) integer(69)operator(,) integer(70)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(77)operator(,) integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(91)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) - integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(118)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(127)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) - integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) integer(74)operator(,) integer(75)operator(,) integer(76)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(104)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) - integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(64)operator(,) - integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) integer(74)operator(,) - integer(75)operator(,) integer(76)operator(,) operator(-)integer(1)operator(,) integer(130)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(84)operator(,) - integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) - integer(74)operator(,) integer(75)operator(,) integer(76)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(104)operator(,) - operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) - integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - integer(104)operator(,) integer(126)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) - integer(114)operator(,) integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(126)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) - integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) integer(74)operator(,) integer(75)operator(,) integer(76)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) - integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) - integer(74)operator(,) integer(75)operator(,) integer(76)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(104)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) - integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) - integer(114)operator(,) integer(115)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(73)operator(,) integer(74)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) integer(64)operator(,) - integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(73)operator(,) integer(74)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(79)operator(,) integer(80)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) - integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) - operator(-)integer(1)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) - integer(115) -operator(};) - -comment(/* YYSTOS[STATE-NUM] -- The (internal number of the\) accessing - symbol of state STATE-NUM. */) -directive(static) directive(const) ident(yytype_uint16) ident(yystos)operator([]) operator(=) -operator({) - integer(0)operator(,) integer(133)operator(,) integer(134)operator(,) integer(0)operator(,) integer(1)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) - integer(11)operator(,) integer(12)operator(,) integer(16)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) - integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(38)operator(,) integer(44)operator(,) integer(45)operator(,) - integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) - integer(56)operator(,) integer(57)operator(,) integer(59)operator(,) integer(60)operator(,) integer(62)operator(,) integer(63)operator(,) integer(82)operator(,) integer(85)operator(,) integer(86)operator(,) integer(88)operator(,) - integer(89)operator(,) integer(91)operator(,) integer(93)operator(,) integer(94)operator(,) integer(95)operator(,) integer(96)operator(,) integer(97)operator(,) integer(98)operator(,) integer(116)operator(,) integer(117)operator(,) - integer(118)operator(,) integer(136)operator(,) integer(137)operator(,) integer(138)operator(,) integer(141)operator(,) integer(143)operator(,) integer(144)operator(,) integer(148)operator(,) integer(149)operator(,) integer(151)operator(,) - integer(152)operator(,) integer(153)operator(,) integer(154)operator(,) integer(155)operator(,) integer(165)operator(,) integer(182)operator(,) integer(199)operator(,) integer(209)operator(,) integer(210)operator(,) integer(223)operator(,) - integer(224)operator(,) integer(225)operator(,) integer(226)operator(,) integer(227)operator(,) integer(228)operator(,) integer(229)operator(,) integer(232)operator(,) integer(240)operator(,) integer(242)operator(,) integer(243)operator(,) - integer(244)operator(,) integer(245)operator(,) integer(246)operator(,) integer(247)operator(,) integer(266)operator(,) integer(275)operator(,) integer(138)operator(,) integer(21)operator(,) integer(22)operator(,) integer(29)operator(,) - integer(30)operator(,) integer(31)operator(,) integer(45)operator(,) integer(50)operator(,) integer(54)operator(,) integer(79)operator(,) integer(82)operator(,) integer(85)operator(,) integer(116)operator(,) integer(156)operator(,) - integer(157)operator(,) integer(182)operator(,) integer(199)operator(,) integer(244)operator(,) integer(247)operator(,) integer(266)operator(,) integer(157)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) - integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) integer(13)operator(,) integer(14)operator(,) integer(15)operator(,) - integer(16)operator(,) integer(17)operator(,) integer(18)operator(,) integer(19)operator(,) integer(20)operator(,) integer(21)operator(,) integer(22)operator(,) integer(23)operator(,) integer(24)operator(,) integer(25)operator(,) - integer(26)operator(,) integer(29)operator(,) integer(30)operator(,) integer(31)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(36)operator(,) integer(37)operator(,) - integer(38)operator(,) integer(44)operator(,) integer(45)operator(,) integer(46)operator(,) integer(47)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(51)operator(,) integer(54)operator(,) - integer(62)operator(,) integer(63)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) integer(69)operator(,) integer(70)operator(,) integer(73)operator(,) integer(77)operator(,) - integer(78)operator(,) integer(79)operator(,) integer(80)operator(,) integer(91)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) - integer(112)operator(,) integer(113)operator(,) integer(114)operator(,) integer(115)operator(,) integer(118)operator(,) integer(127)operator(,) integer(128)operator(,) integer(158)operator(,) integer(163)operator(,) integer(164)operator(,) - integer(245)operator(,) integer(261)operator(,) integer(32)operator(,) integer(33)operator(,) integer(34)operator(,) integer(35)operator(,) integer(48)operator(,) integer(49)operator(,) integer(50)operator(,) integer(54)operator(,) - integer(158)operator(,) integer(159)operator(,) integer(160)operator(,) integer(161)operator(,) integer(240)operator(,) integer(242)operator(,) integer(183)operator(,) integer(82)operator(,) integer(141)operator(,) integer(142)operator(,) - integer(155)operator(,) integer(199)operator(,) integer(244)operator(,) integer(246)operator(,) integer(247)operator(,) integer(142)operator(,) integer(130)operator(,) integer(131)operator(,) integer(142)operator(,) integer(270)operator(,) - integer(273)operator(,) integer(274)operator(,) integer(186)operator(,) integer(188)operator(,) integer(82)operator(,) integer(149)operator(,) integer(155)operator(,) integer(199)operator(,) integer(204)operator(,) integer(244)operator(,) - integer(247)operator(,) integer(91)operator(,) integer(92)operator(,) integer(117)operator(,) integer(148)operator(,) integer(165)operator(,) integer(167)operator(,) integer(171)operator(,) integer(178)operator(,) integer(180)operator(,) - integer(264)operator(,) integer(265)operator(,) integer(171)operator(,) integer(171)operator(,) integer(128)operator(,) integer(173)operator(,) integer(174)operator(,) integer(128)operator(,) integer(169)operator(,) integer(173)operator(,) - integer(141)operator(,) integer(52)operator(,) integer(160)operator(,) integer(130)operator(,) integer(271)operator(,) integer(140)operator(,) integer(120)operator(,) integer(165)operator(,) integer(199)operator(,) integer(165)operator(,) - integer(54)operator(,) integer(85)operator(,) integer(136)operator(,) integer(150)operator(,) integer(151)operator(,) integer(141)operator(,) integer(91)operator(,) integer(148)operator(,) integer(168)operator(,) integer(180)operator(,) - integer(264)operator(,) integer(275)operator(,) integer(180)operator(,) integer(263)operator(,) integer(264)operator(,) integer(275)operator(,) integer(82)operator(,) integer(154)operator(,) integer(199)operator(,) integer(244)operator(,) - integer(247)operator(,) integer(52)operator(,) integer(53)operator(,) integer(55)operator(,) integer(158)operator(,) integer(235)operator(,) integer(241)operator(,) integer(234)operator(,) integer(235)operator(,) integer(235)operator(,) - integer(129)operator(,) integer(230)operator(,) integer(129)operator(,) integer(233)operator(,) integer(56)operator(,) integer(57)operator(,) integer(143)operator(,) integer(165)operator(,) integer(165)operator(,) integer(270)operator(,) - integer(274)operator(,) integer(39)operator(,) integer(40)operator(,) integer(41)operator(,) integer(42)operator(,) integer(43)operator(,) integer(36)operator(,) integer(37)operator(,) integer(28)operator(,) integer(206)operator(,) - integer(103)operator(,) integer(126)operator(,) integer(85)operator(,) integer(91)operator(,) integer(152)operator(,) integer(103)operator(,) integer(64)operator(,) integer(65)operator(,) integer(66)operator(,) integer(67)operator(,) - integer(68)operator(,) integer(69)operator(,) integer(70)operator(,) integer(71)operator(,) integer(72)operator(,) integer(73)operator(,) integer(74)operator(,) integer(75)operator(,) integer(76)operator(,) integer(79)operator(,) - integer(80)operator(,) integer(104)operator(,) integer(106)operator(,) integer(107)operator(,) integer(108)operator(,) integer(109)operator(,) integer(110)operator(,) integer(111)operator(,) integer(112)operator(,) integer(113)operator(,) - integer(114)operator(,) integer(115)operator(,) integer(81)operator(,) integer(122)operator(,) integer(124)operator(,) integer(81)operator(,) integer(124)operator(,) integer(26)operator(,) integer(120)operator(,) integer(211)operator(,) - integer(226)operator(,) integer(83)operator(,) integer(83)operator(,) integer(169)operator(,) integer(173)operator(,) integer(211)operator(,) integer(271)operator(,) integer(141)operator(,) integer(50)operator(,) integer(54)operator(,) - integer(156)operator(,) integer(56)operator(,) integer(57)operator(,) integer(1)operator(,) integer(107)operator(,) integer(248)operator(,) integer(273)operator(,) integer(81)operator(,) integer(122)operator(,) integer(124)operator(,) - integer(195)operator(,) integer(262)operator(,) integer(196)operator(,) integer(81)operator(,) integer(124)operator(,) integer(269)operator(,) integer(126)operator(,) integer(135)operator(,) integer(136)operator(,) integer(54)operator(,) - integer(13)operator(,) integer(105)operator(,) integer(200)operator(,) integer(273)operator(,) integer(103)operator(,) integer(81)operator(,) integer(122)operator(,) integer(124)operator(,) integer(83)operator(,) integer(83)operator(,) - integer(200)operator(,) integer(270)operator(,) integer(15)operator(,) integer(17)operator(,) integer(216)operator(,) integer(131)operator(,) integer(142)operator(,) integer(142)operator(,) integer(54)operator(,) integer(81)operator(,) - integer(122)operator(,) integer(124)operator(,) integer(25)operator(,) integer(167)operator(,) integer(167)operator(,) integer(84)operator(,) integer(126)operator(,) integer(179)operator(,) integer(275)operator(,) integer(126)operator(,) - integer(179)operator(,) integer(125)operator(,) integer(171)operator(,) integer(86)operator(,) integer(171)operator(,) integer(175)operator(,) integer(148)operator(,) integer(171)operator(,) integer(180)operator(,) integer(209)operator(,) - integer(275)operator(,) integer(52)operator(,) integer(59)operator(,) integer(60)operator(,) integer(139)operator(,) integer(128)operator(,) integer(166)operator(,) integer(120)operator(,) integer(136)operator(,) integer(81)operator(,) - integer(124)operator(,) integer(83)operator(,) integer(150)operator(,) integer(125)operator(,) integer(125)operator(,) integer(184)operator(,) integer(165)operator(,) integer(271)operator(,) integer(123)operator(,) integer(126)operator(,) - integer(130)operator(,) integer(272)operator(,) integer(126)operator(,) integer(272)operator(,) integer(126)operator(,) integer(272)operator(,) integer(121)operator(,) integer(272)operator(,) integer(54)operator(,) integer(81)operator(,) - integer(122)operator(,) integer(124)operator(,) integer(58)operator(,) integer(99)operator(,) integer(100)operator(,) integer(101)operator(,) integer(236)operator(,) integer(101)operator(,) integer(236)operator(,) integer(101)operator(,) - integer(61)operator(,) integer(101)operator(,) integer(101)operator(,) integer(231)operator(,) integer(236)operator(,) integer(101)operator(,) integer(58)operator(,) integer(101)operator(,) integer(64)operator(,) integer(64)operator(,) - integer(138)operator(,) integer(142)operator(,) integer(142)operator(,) integer(142)operator(,) integer(142)operator(,) integer(138)operator(,) integer(141)operator(,) integer(141)operator(,) integer(207)operator(,) integer(91)operator(,) - integer(143)operator(,) integer(167)operator(,) integer(180)operator(,) integer(181)operator(,) integer(150)operator(,) integer(154)operator(,) integer(126)operator(,) integer(143)operator(,) integer(165)operator(,) integer(167)operator(,) - integer(181)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) - integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) - integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(165)operator(,) integer(50)operator(,) integer(51)operator(,) integer(54)operator(,) - integer(163)operator(,) integer(267)operator(,) integer(268)operator(,) integer(168)operator(,) integer(50)operator(,) integer(51)operator(,) integer(54)operator(,) integer(163)operator(,) integer(267)operator(,) integer(50)operator(,) - integer(54)operator(,) integer(267)operator(,) integer(267)operator(,) integer(214)operator(,) integer(212)operator(,) integer(143)operator(,) integer(165)operator(,) integer(143)operator(,) integer(165)operator(,) integer(90)operator(,) - integer(145)operator(,) integer(193)operator(,) integer(273)operator(,) integer(249)operator(,) integer(192)operator(,) integer(50)operator(,) integer(54)operator(,) integer(156)operator(,) integer(267)operator(,) integer(168)operator(,) - integer(267)operator(,) integer(135)operator(,) integer(141)operator(,) integer(50)operator(,) integer(52)operator(,) integer(53)operator(,) integer(54)operator(,) integer(55)operator(,) integer(91)operator(,) integer(92)operator(,) - integer(110)operator(,) integer(113)operator(,) integer(128)operator(,) integer(250)operator(,) integer(251)operator(,) integer(252)operator(,) integer(253)operator(,) integer(254)operator(,) integer(255)operator(,) integer(256)operator(,) - integer(257)operator(,) integer(258)operator(,) integer(259)operator(,) integer(197)operator(,) integer(162)operator(,) integer(10)operator(,) integer(8)operator(,) integer(219)operator(,) integer(275)operator(,) integer(136)operator(,) - integer(13)operator(,) integer(165)operator(,) integer(50)operator(,) integer(54)operator(,) integer(168)operator(,) integer(50)operator(,) integer(54)operator(,) integer(136)operator(,) integer(216)operator(,) integer(136)operator(,) - integer(91)operator(,) integer(180)operator(,) integer(217)operator(,) integer(10)operator(,) integer(27)operator(,) integer(105)operator(,) integer(201)operator(,) integer(273)operator(,) integer(201)operator(,) integer(50)operator(,) - integer(54)operator(,) integer(168)operator(,) integer(50)operator(,) integer(54)operator(,) integer(190)operator(,) integer(126)operator(,) integer(179)operator(,) integer(167)operator(,) integer(91)operator(,) integer(167)operator(,) - integer(178)operator(,) integer(264)operator(,) integer(91)operator(,) integer(167)operator(,) integer(265)operator(,) integer(125)operator(,) integer(91)operator(,) integer(165)operator(,) integer(167)operator(,) integer(172)operator(,) - integer(176)operator(,) integer(178)operator(,) integer(264)operator(,) integer(271)operator(,) integer(126)operator(,) integer(81)operator(,) integer(124)operator(,) integer(271)operator(,) integer(125)operator(,) integer(160)operator(,) - integer(185)operator(,) integer(165)operator(,) integer(136)operator(,) integer(121)operator(,) integer(165)operator(,) integer(125)operator(,) integer(271)operator(,) integer(271)operator(,) integer(91)operator(,) integer(167)operator(,) - integer(50)operator(,) integer(54)operator(,) integer(168)operator(,) integer(50)operator(,) integer(54)operator(,) integer(238)operator(,) integer(237)operator(,) integer(129)operator(,) integer(236)operator(,) integer(129)operator(,) - integer(165)operator(,) integer(165)operator(,) integer(72)operator(,) integer(108)operator(,) integer(205)operator(,) integer(275)operator(,) integer(167)operator(,) integer(126)operator(,) integer(125)operator(,) integer(43)operator(,) - integer(105)operator(,) integer(83)operator(,) integer(83)operator(,) integer(169)operator(,) integer(173)operator(,) integer(123)operator(,) integer(83)operator(,) integer(83)operator(,) integer(169)operator(,) integer(170)operator(,) - integer(173)operator(,) integer(275)operator(,) integer(170)operator(,) integer(173)operator(,) integer(170)operator(,) integer(173)operator(,) integer(205)operator(,) integer(205)operator(,) integer(146)operator(,) integer(273)operator(,) - integer(142)operator(,) integer(135)operator(,) integer(123)operator(,) integer(10)operator(,) integer(271)operator(,) integer(103)operator(,) integer(251)operator(,) integer(135)operator(,) integer(273)operator(,) integer(126)operator(,) - integer(260)operator(,) integer(275)operator(,) integer(126)operator(,) integer(260)operator(,) integer(50)operator(,) integer(126)operator(,) integer(260)operator(,) integer(50)operator(,) integer(158)operator(,) integer(160)operator(,) - integer(167)operator(,) integer(181)operator(,) integer(220)operator(,) integer(275)operator(,) integer(15)operator(,) integer(203)operator(,) integer(275)operator(,) integer(14)operator(,) integer(202)operator(,) integer(203)operator(,) - integer(83)operator(,) integer(123)operator(,) integer(83)operator(,) integer(83)operator(,) integer(203)operator(,) integer(10)operator(,) integer(10)operator(,) integer(167)operator(,) integer(126)operator(,) integer(200)operator(,) - integer(187)operator(,) integer(189)operator(,) integer(123)operator(,) integer(142)operator(,) integer(167)operator(,) integer(126)operator(,) integer(179)operator(,) integer(167)operator(,) integer(167)operator(,) integer(126)operator(,) - integer(177)operator(,) integer(125)operator(,) integer(126)operator(,) integer(179)operator(,) integer(125)operator(,) integer(148)operator(,) integer(209)operator(,) integer(267)operator(,) integer(267)operator(,) integer(125)operator(,) - integer(141)operator(,) integer(121)operator(,) integer(125)operator(,) integer(165)operator(,) integer(123)operator(,) integer(136)operator(,) integer(52)operator(,) integer(53)operator(,) integer(55)operator(,) integer(239)operator(,) - integer(247)operator(,) integer(108)operator(,) integer(204)operator(,) integer(208)operator(,) integer(91)operator(,) integer(167)operator(,) integer(165)operator(,) integer(165)operator(,) integer(143)operator(,) integer(165)operator(,) - integer(165)operator(,) integer(145)operator(,) integer(83)operator(,) integer(143)operator(,) integer(165)operator(,) integer(143)operator(,) integer(165)operator(,) integer(145)operator(,) integer(215)operator(,) integer(213)operator(,) - integer(205)operator(,) integer(194)operator(,) integer(273)operator(,) integer(10)operator(,) integer(125)operator(,) integer(167)operator(,) integer(271)operator(,) integer(10)operator(,) integer(252)operator(,) integer(255)operator(,) - integer(257)operator(,) integer(259)operator(,) integer(50)operator(,) integer(254)operator(,) integer(257)operator(,) integer(198)operator(,) integer(84)operator(,) integer(221)operator(,) integer(275)operator(,) integer(136)operator(,) - integer(9)operator(,) integer(222)operator(,) integer(275)operator(,) integer(142)operator(,) integer(10)operator(,) integer(83)operator(,) integer(10)operator(,) integer(91)operator(,) integer(136)operator(,) integer(136)operator(,) - integer(136)operator(,) integer(201)operator(,) integer(179)operator(,) integer(91)operator(,) integer(179)operator(,) integer(179)operator(,) integer(91)operator(,) integer(178)operator(,) integer(180)operator(,) integer(264)operator(,) - integer(125)operator(,) integer(91)operator(,) integer(271)operator(,) integer(125)operator(,) integer(271)operator(,) integer(121)operator(,) integer(108)operator(,) integer(136)operator(,) integer(167)operator(,) integer(143)operator(,) - integer(165)operator(,) integer(136)operator(,) integer(136)operator(,) integer(147)operator(,) integer(135)operator(,) integer(125)operator(,) integer(126)operator(,) integer(260)operator(,) integer(260)operator(,) integer(260)operator(,) - integer(250)operator(,) integer(82)operator(,) integer(155)operator(,) integer(199)operator(,) integer(244)operator(,) integer(247)operator(,) integer(200)operator(,) integer(136)operator(,) integer(200)operator(,) integer(167)operator(,) - integer(203)operator(,) integer(216)operator(,) integer(218)operator(,) integer(10)operator(,) integer(10)operator(,) integer(191)operator(,) integer(165)operator(,) integer(167)operator(,) integer(126)operator(,) integer(179)operator(,) - integer(126)operator(,) integer(179)operator(,) integer(167)operator(,) integer(125)operator(,) integer(10)operator(,) integer(10)operator(,) integer(121)operator(,) integer(136)operator(,) integer(10)operator(,) integer(257)operator(,) - integer(135)operator(,) integer(54)operator(,) integer(81)operator(,) integer(122)operator(,) integer(124)operator(,) integer(136)operator(,) integer(136)operator(,) integer(136)operator(,) integer(179)operator(,) integer(179)operator(,) - integer(91)operator(,) integer(264)operator(,) integer(91)operator(,) integer(179)operator(,) integer(121)operator(,) integer(260)operator(,) integer(10)operator(,) integer(50)operator(,) integer(54)operator(,) integer(168)operator(,) - integer(50)operator(,) integer(54)operator(,) integer(219)operator(,) integer(202)operator(,) integer(10)operator(,) integer(167)operator(,) integer(126)operator(,) integer(179)operator(,) integer(167)operator(,) integer(123)operator(,) - integer(179)operator(,) integer(91)operator(,) integer(179)operator(,) integer(167)operator(,) integer(179) -operator(};) - -preprocessor(#define) ident(yyerrok) operator(()ident(yyerrstatus) operator(=) integer(0)operator(\)) -preprocessor(#define) ident(yyclearin) operator(()ident(yychar) operator(=) ident(YYEMPTY)operator(\)) -preprocessor(#define) ident(YYEMPTY) operator((-)integer(2)operator(\)) -preprocessor(#define) ident(YYEOF) integer(0) - -preprocessor(#define) ident(YYACCEPT) reserved(goto) ident(yyacceptlab) -preprocessor(#define) ident(YYABORT) reserved(goto) ident(yyabortlab) -preprocessor(#define) ident(YYERROR) reserved(goto) ident(yyerrorlab) - - -comment(/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */) - -preprocessor(#define) ident(YYFAIL) reserved(goto) ident(yyerrlab) - -preprocessor(#define) ident(YYRECOVERING)operator((\)) operator((!!)ident(yyerrstatus)operator(\)) - -preprocessor(#define) ident(YYBACKUP)operator(()ident(Token)operator(,) ident(Value)operator(\)) \ -reserved(do) \ - reserved(if) operator(()ident(yychar) operator(==) ident(YYEMPTY) operator(&&) ident(yylen) operator(==) integer(1)operator(\)) \ - operator({) \ - ident(yychar) operator(=) operator(()ident(Token)operator(\);) \ - ident(yylval) operator(=) operator(()ident(Value)operator(\);) \ - ident(yytoken) operator(=) ident(YYTRANSLATE) operator(()ident(yychar)operator(\);) \ - ident(YYPOPSTACK) operator(()integer(1)operator(\);) \ - reserved(goto) ident(yybackup)operator(;) \ - operator(}) \ - reserved(else) \ - operator({) \ - ident(yyerror) operator(()ident(YY_)operator(()stringoperator(\)\);) \ - ident(YYERROR)operator(;) \ - operator(}) \ -reserved(while) operator(()ident(YYID) operator(()integer(0)operator(\)\)) - - -preprocessor(#define) ident(YYTERROR) integer(1) -preprocessor(#define) ident(YYERRCODE) integer(256) - - -comment(/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined\). */) - -preprocessor(#define) ident(YYRHSLOC)operator(()ident(Rhs)operator(,) ident(K)operator(\)) operator((()ident(Rhs)operator(\)[)ident(K)operator(]\)) -preprocessor(#ifndef) ident(YYLLOC_DEFAULT) -preprocessor(# define) ident(YYLLOC_DEFAULT)operator(()ident(Current)operator(,) ident(Rhs)operator(,) ident(N)operator(\)) \ - reserved(do) \ - reserved(if) operator(()ident(YYID) operator(()ident(N)operator(\)\)) \ - operator({) \ - operator(()ident(Current)operator(\))operator(.)ident(first_line) operator(=) ident(YYRHSLOC) operator(()ident(Rhs)operator(,) integer(1)operator(\))operator(.)ident(first_line)operator(;) \ - operator(()ident(Current)operator(\))operator(.)ident(first_column) operator(=) ident(YYRHSLOC) operator(()ident(Rhs)operator(,) integer(1)operator(\))operator(.)ident(first_column)operator(;) \ - operator(()ident(Current)operator(\))operator(.)ident(last_line) operator(=) ident(YYRHSLOC) operator(()ident(Rhs)operator(,) ident(N)operator(\))operator(.)ident(last_line)operator(;) \ - operator(()ident(Current)operator(\))operator(.)ident(last_column) operator(=) ident(YYRHSLOC) operator(()ident(Rhs)operator(,) ident(N)operator(\))operator(.)ident(last_column)operator(;) \ - operator(}) \ - reserved(else) \ - operator({) \ - operator(()ident(Current)operator(\))operator(.)ident(first_line) operator(=) operator(()ident(Current)operator(\))operator(.)ident(last_line) operator(=) \ - ident(YYRHSLOC) operator(()ident(Rhs)operator(,) integer(0)operator(\))operator(.)ident(last_line)operator(;) \ - operator(()ident(Current)operator(\))operator(.)ident(first_column) operator(=) operator(()ident(Current)operator(\))operator(.)ident(last_column) operator(=) \ - ident(YYRHSLOC) operator(()ident(Rhs)operator(,) integer(0)operator(\))operator(.)ident(last_column)operator(;) \ - operator(}) \ - reserved(while) operator(()ident(YYID) operator(()integer(0)operator(\)\)) -preprocessor(#endif) - - -comment(/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */) - -preprocessor(#ifndef) ident(YY_LOCATION_PRINT) -preprocessor(# if) ident(YYLTYPE_IS_TRIVIAL) -preprocessor(# define) ident(YY_LOCATION_PRINT)operator(()ident(File)operator(,) ident(Loc)operator(\)) \ - ident(fprintf) operator(()ident(File)operator(,) stringoperator(,) \ - operator(()ident(Loc)operator(\))operator(.)ident(first_line)operator(,) operator(()ident(Loc)operator(\))operator(.)ident(first_column)operator(,) \ - operator(()ident(Loc)operator(\))operator(.)ident(last_line)operator(,) operator(()ident(Loc)operator(\))operator(.)ident(last_column)operator(\)) -preprocessor(# else) -preprocessor(# define) ident(YY_LOCATION_PRINT)operator(()ident(File)operator(,) ident(Loc)operator(\)) operator((()directive(void)operator(\)) integer(0)operator(\)) -preprocessor(# endif) -preprocessor(#endif) - - -comment(/* YYLEX -- calling `yylex' with the right arguments. */) - -preprocessor(#ifdef) ident(YYLEX_PARAM) -preprocessor(# define) ident(YYLEX) ident(yylex) operator(()ident(YYLEX_PARAM)operator(\)) -preprocessor(#else) -preprocessor(# define) ident(YYLEX) ident(yylex) operator((\)) -preprocessor(#endif) - -comment(/* Enable debugging if requested. */) -preprocessor(#if) ident(YYDEBUG) - -preprocessor(# ifndef) ident(YYFPRINTF) -preprocessor(# include) include() comment(/* INFRINGES ON USER NAME SPACE */) -preprocessor(# define) ident(YYFPRINTF) ident(fprintf) -preprocessor(# endif) - -preprocessor(# define) ident(YYDPRINTF)operator(()ident(Args)operator(\)) \ -reserved(do) operator({) \ - reserved(if) operator(()ident(yydebug)operator(\)) \ - ident(YYFPRINTF) ident(Args)operator(;) \ -operator(}) reserved(while) operator(()ident(YYID) operator(()integer(0)operator(\)\)) - -preprocessor(# define) ident(YY_SYMBOL_PRINT)operator(()ident(Title)operator(,) ident(Type)operator(,) ident(Value)operator(,) ident(Location)operator(\)) \ -reserved(do) operator({) \ - reserved(if) operator(()ident(yydebug)operator(\)) \ - operator({) \ - ident(YYFPRINTF) operator(()ident(stderr)operator(,) stringoperator(,) ident(Title)operator(\);) \ - ident(yy_symbol_print) operator(()ident(stderr)operator(,) \ - ident(Type)operator(,) ident(Value)operator(\);) \ - ident(YYFPRINTF) operator(()ident(stderr)operator(,) stringoperator(\);) \ - operator(}) \ -operator(}) reserved(while) operator(()ident(YYID) operator(()integer(0)operator(\)\)) - - -comment(/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/) - -comment(/*ARGSUSED*/) -preprocessor(#if) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -directive(static) directive(void) -ident(yy_symbol_value_print) operator(()ident(FILE) operator(*)ident(yyoutput)operator(,) pre_type(int) ident(yytype)operator(,) ident(YYSTYPE) directive(const) operator(*) directive(const) ident(yyvaluep)operator(\)) -preprocessor(#else) -directive(static) directive(void) -ident(yy_symbol_value_print) operator(()ident(yyoutput)operator(,) ident(yytype)operator(,) ident(yyvaluep)operator(\)) - ident(FILE) operator(*)ident(yyoutput)operator(;) - pre_type(int) ident(yytype)operator(;) - ident(YYSTYPE) directive(const) operator(*) directive(const) ident(yyvaluep)operator(;) -preprocessor(#endif) -operator({) - reserved(if) operator((!)ident(yyvaluep)operator(\)) - reserved(return)operator(;) -preprocessor(# ifdef) ident(YYPRINT) - reserved(if) operator(()ident(yytype) operator(<) ident(YYNTOKENS)operator(\)) - ident(YYPRINT) operator(()ident(yyoutput)operator(,) ident(yytoknum)operator([)ident(yytype)operator(],) operator(*)ident(yyvaluep)operator(\);) -preprocessor(# else) - ident(YYUSE) operator(()ident(yyoutput)operator(\);) -preprocessor(# endif) - reserved(switch) operator(()ident(yytype)operator(\)) - operator({) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) -operator(}) - - -comment(/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/) - -preprocessor(#if) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -directive(static) directive(void) -ident(yy_symbol_print) operator(()ident(FILE) operator(*)ident(yyoutput)operator(,) pre_type(int) ident(yytype)operator(,) ident(YYSTYPE) directive(const) operator(*) directive(const) ident(yyvaluep)operator(\)) -preprocessor(#else) -directive(static) directive(void) -ident(yy_symbol_print) operator(()ident(yyoutput)operator(,) ident(yytype)operator(,) ident(yyvaluep)operator(\)) - ident(FILE) operator(*)ident(yyoutput)operator(;) - pre_type(int) ident(yytype)operator(;) - ident(YYSTYPE) directive(const) operator(*) directive(const) ident(yyvaluep)operator(;) -preprocessor(#endif) -operator({) - reserved(if) operator(()ident(yytype) operator(<) ident(YYNTOKENS)operator(\)) - ident(YYFPRINTF) operator(()ident(yyoutput)operator(,) stringoperator(,) ident(yytname)operator([)ident(yytype)operator(]\);) - reserved(else) - ident(YYFPRINTF) operator(()ident(yyoutput)operator(,) stringoperator(,) ident(yytname)operator([)ident(yytype)operator(]\);) - - ident(yy_symbol_value_print) operator(()ident(yyoutput)operator(,) ident(yytype)operator(,) ident(yyvaluep)operator(\);) - ident(YYFPRINTF) operator(()ident(yyoutput)operator(,) stringoperator(\);) -operator(}) - -comment(/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included\). | -`------------------------------------------------------------------*/) - -preprocessor(#if) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -directive(static) directive(void) -ident(yy_stack_print) operator(()ident(yytype_int16) operator(*)ident(bottom)operator(,) ident(yytype_int16) operator(*)ident(top)operator(\)) -preprocessor(#else) -directive(static) directive(void) -ident(yy_stack_print) operator(()ident(bottom)operator(,) ident(top)operator(\)) - ident(yytype_int16) operator(*)ident(bottom)operator(;) - ident(yytype_int16) operator(*)ident(top)operator(;) -preprocessor(#endif) -operator({) - ident(YYFPRINTF) operator(()ident(stderr)operator(,) stringoperator(\);) - reserved(for) operator((;) ident(bottom) operator(<=) ident(top)operator(;) operator(++)ident(bottom)operator(\)) - ident(YYFPRINTF) operator(()ident(stderr)operator(,) stringoperator(,) operator(*)ident(bottom)operator(\);) - ident(YYFPRINTF) operator(()ident(stderr)operator(,) stringoperator(\);) -operator(}) - -preprocessor(# define) ident(YY_STACK_PRINT)operator(()ident(Bottom)operator(,) ident(Top)operator(\)) \ -reserved(do) operator({) \ - reserved(if) operator(()ident(yydebug)operator(\)) \ - ident(yy_stack_print) operator((()ident(Bottom)operator(\),) operator(()ident(Top)operator(\)\);) \ -operator(}) reserved(while) operator(()ident(YYID) operator(()integer(0)operator(\)\)) - - -comment(/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/) - -preprocessor(#if) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -directive(static) directive(void) -ident(yy_reduce_print) operator(()ident(YYSTYPE) operator(*)ident(yyvsp)operator(,) pre_type(int) ident(yyrule)operator(\)) -preprocessor(#else) -directive(static) directive(void) -ident(yy_reduce_print) operator(()ident(yyvsp)operator(,) ident(yyrule)operator(\)) - ident(YYSTYPE) operator(*)ident(yyvsp)operator(;) - pre_type(int) ident(yyrule)operator(;) -preprocessor(#endif) -operator({) - pre_type(int) ident(yynrhs) operator(=) ident(yyr2)operator([)ident(yyrule)operator(];) - pre_type(int) ident(yyi)operator(;) - pre_type(unsigned) pre_type(long) pre_type(int) ident(yylno) operator(=) ident(yyrline)operator([)ident(yyrule)operator(];) - ident(YYFPRINTF) operator(()ident(stderr)operator(,) stringoperator(,) - ident(yyrule) operator(-) integer(1)operator(,) ident(yylno)operator(\);) - comment(/* The symbols being reduced. */) - reserved(for) operator(()ident(yyi) operator(=) integer(0)operator(;) ident(yyi) operator(<) ident(yynrhs)operator(;) ident(yyi)operator(++\)) - operator({) - ident(fprintf) operator(()ident(stderr)operator(,) stringoperator(,) ident(yyi) operator(+) integer(1)operator(\);) - ident(yy_symbol_print) operator(()ident(stderr)operator(,) ident(yyrhs)operator([)ident(yyprhs)operator([)ident(yyrule)operator(]) operator(+) ident(yyi)operator(],) - operator(&()ident(yyvsp)operator([()ident(yyi) operator(+) integer(1)operator(\)) operator(-) operator(()ident(yynrhs)operator(\)]\)) - operator(\);) - ident(fprintf) operator(()ident(stderr)operator(,) stringoperator(\);) - operator(}) -operator(}) - -preprocessor(# define) ident(YY_REDUCE_PRINT)operator(()ident(Rule)operator(\)) \ -reserved(do) operator({) \ - reserved(if) operator(()ident(yydebug)operator(\)) \ - ident(yy_reduce_print) operator(()ident(yyvsp)operator(,) ident(Rule)operator(\);) \ -operator(}) reserved(while) operator(()ident(YYID) operator(()integer(0)operator(\)\)) - -comment(/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */) -pre_type(int) ident(yydebug)operator(;) -preprocessor(#else) comment(/* !YYDEBUG */) -preprocessor(# define) ident(YYDPRINTF)operator(()ident(Args)operator(\)) -preprocessor(# define) ident(YY_SYMBOL_PRINT)operator(()ident(Title)operator(,) ident(Type)operator(,) ident(Value)operator(,) ident(Location)operator(\)) -preprocessor(# define) ident(YY_STACK_PRINT)operator(()ident(Bottom)operator(,) ident(Top)operator(\)) -preprocessor(# define) ident(YY_REDUCE_PRINT)operator(()ident(Rule)operator(\)) -preprocessor(#endif) comment(/* !YYDEBUG */) - - -comment(/* YYINITDEPTH -- initial size of the parser's stacks. */) -preprocessor(#ifndef) ident(YYINITDEPTH) -preprocessor(# define) ident(YYINITDEPTH) integer(200) -preprocessor(#endif) - -comment(/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used\). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH\) - evaluated with infinite-precision integer arithmetic. */) - -preprocessor(#ifndef) ident(YYMAXDEPTH) -preprocessor(# define) ident(YYMAXDEPTH) integer(10000) -preprocessor(#endif) - - - -preprocessor(#if) ident(YYERROR_VERBOSE) - -preprocessor(# ifndef) ident(yystrlen) -preprocessor(# if) ident(defined) ident(__GLIBC__) operator(&&) ident(defined) ident(_STRING_H) -preprocessor(# define) ident(yystrlen) ident(strlen) -preprocessor(# else) -comment(/* Return the length of YYSTR. */) -preprocessor(#if) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -directive(static) ident(YYSIZE_T) -ident(yystrlen) operator(()directive(const) pre_type(char) operator(*)ident(yystr)operator(\)) -preprocessor(#else) -directive(static) ident(YYSIZE_T) -ident(yystrlen) operator(()ident(yystr)operator(\)) - directive(const) pre_type(char) operator(*)ident(yystr)operator(;) -preprocessor(#endif) -operator({) - ident(YYSIZE_T) ident(yylen)operator(;) - reserved(for) operator(()ident(yylen) operator(=) integer(0)operator(;) ident(yystr)operator([)ident(yylen)operator(];) ident(yylen)operator(++\)) - reserved(continue)operator(;) - reserved(return) ident(yylen)operator(;) -operator(}) -preprocessor(# endif) -preprocessor(# endif) - -preprocessor(# ifndef) ident(yystpcpy) -preprocessor(# if) ident(defined) ident(__GLIBC__) operator(&&) ident(defined) ident(_STRING_H) operator(&&) ident(defined) ident(_GNU_SOURCE) -preprocessor(# define) ident(yystpcpy) ident(stpcpy) -preprocessor(# else) -comment(/* Copy YYSRC to YYDEST, returning the address of the terminating '\\0' in - YYDEST. */) -preprocessor(#if) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -directive(static) pre_type(char) operator(*) -ident(yystpcpy) operator(()pre_type(char) operator(*)ident(yydest)operator(,) directive(const) pre_type(char) operator(*)ident(yysrc)operator(\)) -preprocessor(#else) -directive(static) pre_type(char) operator(*) -ident(yystpcpy) operator(()ident(yydest)operator(,) ident(yysrc)operator(\)) - pre_type(char) operator(*)ident(yydest)operator(;) - directive(const) pre_type(char) operator(*)ident(yysrc)operator(;) -preprocessor(#endif) -operator({) - pre_type(char) operator(*)ident(yyd) operator(=) ident(yydest)operator(;) - directive(const) pre_type(char) operator(*)ident(yys) operator(=) ident(yysrc)operator(;) - - reserved(while) operator(((*)ident(yyd)operator(++) operator(=) operator(*)ident(yys)operator(++\)) operator(!=) char('\\0')operator(\)) - reserved(continue)operator(;) - - reserved(return) ident(yyd) operator(-) integer(1)operator(;) -operator(}) -preprocessor(# endif) -preprocessor(# endif) - -preprocessor(# ifndef) ident(yytnamerr) -comment(/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash\). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */) -directive(static) ident(YYSIZE_T) -ident(yytnamerr) operator(()pre_type(char) operator(*)ident(yyres)operator(,) directive(const) pre_type(char) operator(*)ident(yystr)operator(\)) -operator({) - reserved(if) operator((*)ident(yystr) operator(==) char('"')operator(\)) - operator({) - ident(YYSIZE_T) ident(yyn) operator(=) integer(0)operator(;) - pre_type(char) directive(const) operator(*)ident(yyp) operator(=) ident(yystr)operator(;) - - reserved(for) operator((;;\)) - reserved(switch) operator((*++)ident(yyp)operator(\)) - operator({) - reserved(case) char('\\'')operator(:) - reserved(case) char(',')operator(:) - reserved(goto) ident(do_not_strip_quotes)operator(;) - - reserved(case) char('\\\\')operator(:) - reserved(if) operator((*++)ident(yyp) operator(!=) char('\\\\')operator(\)) - reserved(goto) ident(do_not_strip_quotes)operator(;) - comment(/* Fall through. */) - reserved(default)operator(:) - reserved(if) operator(()ident(yyres)operator(\)) - ident(yyres)operator([)ident(yyn)operator(]) operator(=) operator(*)ident(yyp)operator(;) - ident(yyn)operator(++;) - reserved(break)operator(;) - - reserved(case) char('"')operator(:) - reserved(if) operator(()ident(yyres)operator(\)) - ident(yyres)operator([)ident(yyn)operator(]) operator(=) char('\\0')operator(;) - reserved(return) ident(yyn)operator(;) - operator(}) - label(do_not_strip_quotes:) operator(;) - operator(}) - - reserved(if) operator((!) ident(yyres)operator(\)) - reserved(return) ident(yystrlen) operator(()ident(yystr)operator(\);) - - reserved(return) ident(yystpcpy) operator(()ident(yyres)operator(,) ident(yystr)operator(\)) operator(-) ident(yyres)operator(;) -operator(}) -preprocessor(# endif) - -comment(/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */) -directive(static) ident(YYSIZE_T) -ident(yysyntax_error) operator(()pre_type(char) operator(*)ident(yyresult)operator(,) pre_type(int) ident(yystate)operator(,) pre_type(int) ident(yychar)operator(\)) -operator({) - pre_type(int) ident(yyn) operator(=) ident(yypact)operator([)ident(yystate)operator(];) - - reserved(if) operator((!) operator(()ident(YYPACT_NINF) operator(<) ident(yyn) operator(&&) ident(yyn) operator(<=) ident(YYLAST)operator(\)\)) - reserved(return) integer(0)operator(;) - reserved(else) - operator({) - pre_type(int) ident(yytype) operator(=) ident(YYTRANSLATE) operator(()ident(yychar)operator(\);) - ident(YYSIZE_T) ident(yysize0) operator(=) ident(yytnamerr) operator(()integer(0)operator(,) ident(yytname)operator([)ident(yytype)operator(]\);) - ident(YYSIZE_T) ident(yysize) operator(=) ident(yysize0)operator(;) - ident(YYSIZE_T) ident(yysize1)operator(;) - pre_type(int) ident(yysize_overflow) operator(=) integer(0)operator(;) - reserved(enum) operator({) ident(YYERROR_VERBOSE_ARGS_MAXIMUM) operator(=) integer(5) operator(};) - pre_type(char) directive(const) operator(*)ident(yyarg)operator([)ident(YYERROR_VERBOSE_ARGS_MAXIMUM)operator(];) - pre_type(int) ident(yyx)operator(;) - -comment(# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"\); - YY_("syntax error, unexpected %s, expecting %s"\); - YY_("syntax error, unexpected %s, expecting %s or %s"\); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"\); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"\); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2\) - * (sizeof yyor - 1\)\)]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected\); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx\) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR\) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM\) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]\); - yysize_overflow |= (yysize1 < yysize\); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix\); - yyprefix = yyor; - } - - yyf = YY_(yyformat\); - yysize1 = yysize + yystrlen (yyf\); - yysize_overflow |= (yysize1 < yysize\); - yysize = yysize1; - - if (yysize_overflow\) - return YYSIZE_MAXIMUM; - - if (yyresult\) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf\) != '\\0'\) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount\) - { - yyp += yytnamerr (yyp, yyarg[yyi++]\); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */) - - -comment(/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/) - -comment(/*ARGSUSED*/) -preprocessor(#if) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -directive(static) directive(void) -ident(yydestruct) operator(()directive(const) pre_type(char) operator(*)ident(yymsg)operator(,) pre_type(int) ident(yytype)operator(,) ident(YYSTYPE) operator(*)ident(yyvaluep)operator(\)) -preprocessor(#else) -directive(static) directive(void) -ident(yydestruct) operator(()ident(yymsg)operator(,) ident(yytype)operator(,) ident(yyvaluep)operator(\)) - directive(const) pre_type(char) operator(*)ident(yymsg)operator(;) - pre_type(int) ident(yytype)operator(;) - ident(YYSTYPE) operator(*)ident(yyvaluep)operator(;) -preprocessor(#endif) -operator({) - ident(YYUSE) operator(()ident(yyvaluep)operator(\);) - - reserved(if) operator((!)ident(yymsg)operator(\)) - ident(yymsg) operator(=) stringoperator(;) - ident(YY_SYMBOL_PRINT) operator(()ident(yymsg)operator(,) ident(yytype)operator(,) ident(yyvaluep)operator(,) ident(yylocationp)operator(\);) - - reserved(switch) operator(()ident(yytype)operator(\)) - operator({) - - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) -operator(}) - - -comment(/* Prevent warnings from -Wmissing-prototypes. */) - -preprocessor(#ifdef) ident(YYPARSE_PARAM) -preprocessor(#if) ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__cplusplus) -pre_type(int) ident(yyparse) operator(()directive(void) operator(*)ident(YYPARSE_PARAM)operator(\);) -preprocessor(#else) -pre_type(int) ident(yyparse) operator((\);) -preprocessor(#endif) -preprocessor(#else) comment(/* ! YYPARSE_PARAM */) -preprocessor(#if) ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__cplusplus) -pre_type(int) ident(yyparse) operator(()directive(void)operator(\);) -preprocessor(#else) -pre_type(int) ident(yyparse) operator((\);) -preprocessor(#endif) -preprocessor(#endif) comment(/* ! YYPARSE_PARAM */) - - - -comment(/* The look-ahead symbol. */) -pre_type(int) ident(yychar)operator(;) - -comment(/* The semantic value of the look-ahead symbol. */) -ident(YYSTYPE) ident(yylval)operator(;) - -comment(/* Number of syntax errors so far. */) -pre_type(int) ident(yynerrs)operator(;) - - - -comment(/*----------. -| yyparse. | -`----------*/) - -preprocessor(#ifdef) ident(YYPARSE_PARAM) -preprocessor(#if) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -pre_type(int) -ident(yyparse) operator(()directive(void) operator(*)ident(YYPARSE_PARAM)operator(\)) -preprocessor(#else) -pre_type(int) -ident(yyparse) operator(()ident(YYPARSE_PARAM)operator(\)) - directive(void) operator(*)ident(YYPARSE_PARAM)operator(;) -preprocessor(#endif) -preprocessor(#else) comment(/* ! YYPARSE_PARAM */) -preprocessor(#if) operator(()ident(defined) ident(__STDC__) operator(||) ident(defined) ident(__C99__FUNC__) \ - operator(||) ident(defined) ident(__cplusplus) operator(||) ident(defined) ident(_MSC_VER)operator(\)) -pre_type(int) -ident(yyparse) operator(()directive(void)operator(\)) -preprocessor(#else) -pre_type(int) -ident(yyparse) operator((\)) - -preprocessor(#endif) -preprocessor(#endif) -operator({) - - pre_type(int) ident(yystate)operator(;) - pre_type(int) ident(yyn)operator(;) - pre_type(int) ident(yyresult)operator(;) - comment(/* Number of tokens to shift before error messages enabled. */) - pre_type(int) ident(yyerrstatus)operator(;) - comment(/* Look-ahead token as an internal (translated\) token number. */) - pre_type(int) ident(yytoken) operator(=) integer(0)operator(;) -preprocessor(#if) ident(YYERROR_VERBOSE) - comment(/* Buffer for error messages, and its allocated size. */) - pre_type(char) ident(yymsgbuf)operator([)integer(128)operator(];) - pre_type(char) operator(*)ident(yymsg) operator(=) ident(yymsgbuf)operator(;) - ident(YYSIZE_T) ident(yymsg_alloc) operator(=) reserved(sizeof) ident(yymsgbuf)operator(;) -preprocessor(#endif) - - comment(/* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */) - - comment(/* The state stack. */) - ident(yytype_int16) ident(yyssa)operator([)ident(YYINITDEPTH)operator(];) - ident(yytype_int16) operator(*)ident(yyss) operator(=) ident(yyssa)operator(;) - ident(yytype_int16) operator(*)ident(yyssp)operator(;) - - comment(/* The semantic value stack. */) - ident(YYSTYPE) ident(yyvsa)operator([)ident(YYINITDEPTH)operator(];) - ident(YYSTYPE) operator(*)ident(yyvs) operator(=) ident(yyvsa)operator(;) - ident(YYSTYPE) operator(*)ident(yyvsp)operator(;) - - - -preprocessor(#define) ident(YYPOPSTACK)operator(()ident(N)operator(\)) operator(()ident(yyvsp) operator(-=) operator(()ident(N)operator(\),) ident(yyssp) operator(-=) operator(()ident(N)operator(\)\)) - - ident(YYSIZE_T) ident(yystacksize) operator(=) ident(YYINITDEPTH)operator(;) - - comment(/* The variables used to return semantic value and location from the - action routines. */) - ident(YYSTYPE) ident(yyval)operator(;) - - - comment(/* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */) - pre_type(int) ident(yylen) operator(=) integer(0)operator(;) - - ident(YYDPRINTF) operator((()ident(stderr)operator(,) stringoperator(\)\);) - - ident(yystate) operator(=) integer(0)operator(;) - ident(yyerrstatus) operator(=) integer(0)operator(;) - ident(yynerrs) operator(=) integer(0)operator(;) - ident(yychar) operator(=) ident(YYEMPTY)operator(;) comment(/* Cause a token to be read. */) - - comment(/* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */) - - ident(yyssp) operator(=) ident(yyss)operator(;) - ident(yyvsp) operator(=) ident(yyvs)operator(;) - - reserved(goto) ident(yysetstate)operator(;) - -comment(/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/) - label(yynewstate:) - comment(/* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */) - ident(yyssp)operator(++;) - - label(yysetstate:) - operator(*)ident(yyssp) operator(=) ident(yystate)operator(;) - - reserved(if) operator(()ident(yyss) operator(+) ident(yystacksize) operator(-) integer(1) operator(<=) ident(yyssp)operator(\)) - operator({) - comment(/* Get the current used size of the three stacks, in elements. */) - ident(YYSIZE_T) ident(yysize) operator(=) ident(yyssp) operator(-) ident(yyss) operator(+) integer(1)operator(;) - -preprocessor(#ifdef) ident(yyoverflow) - operator({) - comment(/* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */) - ident(YYSTYPE) operator(*)ident(yyvs1) operator(=) ident(yyvs)operator(;) - ident(yytype_int16) operator(*)ident(yyss1) operator(=) ident(yyss)operator(;) - - - comment(/* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */) - ident(yyoverflow) operator(()ident(YY_)operator(()stringoperator(\),) - operator(&)ident(yyss1)operator(,) ident(yysize) operator(*) reserved(sizeof) operator((*)ident(yyssp)operator(\),) - operator(&)ident(yyvs1)operator(,) ident(yysize) operator(*) reserved(sizeof) operator((*)ident(yyvsp)operator(\),) - - operator(&)ident(yystacksize)operator(\);) - - ident(yyss) operator(=) ident(yyss1)operator(;) - ident(yyvs) operator(=) ident(yyvs1)operator(;) - operator(}) -preprocessor(#else) comment(/* no yyoverflow */) -preprocessor(# ifndef) ident(YYSTACK_RELOCATE) - reserved(goto) ident(yyexhaustedlab)operator(;) -preprocessor(# else) - comment(/* Extend the stack our own way. */) - reserved(if) operator(()ident(YYMAXDEPTH) operator(<=) ident(yystacksize)operator(\)) - reserved(goto) ident(yyexhaustedlab)operator(;) - ident(yystacksize) operator(*=) integer(2)operator(;) - reserved(if) operator(()ident(YYMAXDEPTH) operator(<) ident(yystacksize)operator(\)) - ident(yystacksize) operator(=) ident(YYMAXDEPTH)operator(;) - - operator({) - ident(yytype_int16) operator(*)ident(yyss1) operator(=) ident(yyss)operator(;) - reserved(union) ident(yyalloc) operator(*)ident(yyptr) operator(=) - operator(()reserved(union) ident(yyalloc) operator(*\)) ident(YYSTACK_ALLOC) operator(()ident(YYSTACK_BYTES) operator(()ident(yystacksize)operator(\)\);) - reserved(if) operator((!) ident(yyptr)operator(\)) - reserved(goto) ident(yyexhaustedlab)operator(;) - ident(YYSTACK_RELOCATE) operator(()ident(yyss)operator(\);) - ident(YYSTACK_RELOCATE) operator(()ident(yyvs)operator(\);) - -preprocessor(# undef) ident(YYSTACK_RELOCATE) - reserved(if) operator(()ident(yyss1) operator(!=) ident(yyssa)operator(\)) - ident(YYSTACK_FREE) operator(()ident(yyss1)operator(\);) - operator(}) -preprocessor(# endif) -preprocessor(#endif) comment(/* no yyoverflow */) - - ident(yyssp) operator(=) ident(yyss) operator(+) ident(yysize) operator(-) integer(1)operator(;) - ident(yyvsp) operator(=) ident(yyvs) operator(+) ident(yysize) operator(-) integer(1)operator(;) - - - ident(YYDPRINTF) operator((()ident(stderr)operator(,) stringoperator(,) - operator(()pre_type(unsigned) pre_type(long) pre_type(int)operator(\)) ident(yystacksize)operator(\)\);) - - reserved(if) operator(()ident(yyss) operator(+) ident(yystacksize) operator(-) integer(1) operator(<=) ident(yyssp)operator(\)) - ident(YYABORT)operator(;) - operator(}) - - ident(YYDPRINTF) operator((()ident(stderr)operator(,) stringoperator(,) ident(yystate)operator(\)\);) - - reserved(goto) ident(yybackup)operator(;) - -comment(/*-----------. -| yybackup. | -`-----------*/) -label(yybackup:) - - comment(/* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */) - - comment(/* First try to decide what to do without reference to look-ahead token. */) - ident(yyn) operator(=) ident(yypact)operator([)ident(yystate)operator(];) - reserved(if) operator(()ident(yyn) operator(==) ident(YYPACT_NINF)operator(\)) - reserved(goto) ident(yydefault)operator(;) - - comment(/* Not known => get a look-ahead token if don't already have one. */) - - comment(/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */) - reserved(if) operator(()ident(yychar) operator(==) ident(YYEMPTY)operator(\)) - operator({) - ident(YYDPRINTF) operator((()ident(stderr)operator(,) stringoperator(\)\);) - ident(yychar) operator(=) ident(YYLEX)operator(;) - operator(}) - - reserved(if) operator(()ident(yychar) operator(<=) ident(YYEOF)operator(\)) - operator({) - ident(yychar) operator(=) ident(yytoken) operator(=) ident(YYEOF)operator(;) - ident(YYDPRINTF) operator((()ident(stderr)operator(,) stringoperator(\)\);) - operator(}) - reserved(else) - operator({) - ident(yytoken) operator(=) ident(YYTRANSLATE) operator(()ident(yychar)operator(\);) - ident(YY_SYMBOL_PRINT) operator(()stringoperator(,) ident(yytoken)operator(,) operator(&)ident(yylval)operator(,) operator(&)ident(yylloc)operator(\);) - operator(}) - - comment(/* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */) - ident(yyn) operator(+=) ident(yytoken)operator(;) - reserved(if) operator(()ident(yyn) operator(<) integer(0) operator(||) ident(YYLAST) operator(<) ident(yyn) operator(||) ident(yycheck)operator([)ident(yyn)operator(]) operator(!=) ident(yytoken)operator(\)) - reserved(goto) ident(yydefault)operator(;) - ident(yyn) operator(=) ident(yytable)operator([)ident(yyn)operator(];) - reserved(if) operator(()ident(yyn) operator(<=) integer(0)operator(\)) - operator({) - reserved(if) operator(()ident(yyn) operator(==) integer(0) operator(||) ident(yyn) operator(==) ident(YYTABLE_NINF)operator(\)) - reserved(goto) ident(yyerrlab)operator(;) - ident(yyn) operator(=) operator(-)ident(yyn)operator(;) - reserved(goto) ident(yyreduce)operator(;) - operator(}) - - reserved(if) operator(()ident(yyn) operator(==) ident(YYFINAL)operator(\)) - ident(YYACCEPT)operator(;) - - comment(/* Count tokens shifted since error; after three, turn off error - status. */) - reserved(if) operator(()ident(yyerrstatus)operator(\)) - ident(yyerrstatus)operator(--;) - - comment(/* Shift the look-ahead token. */) - ident(YY_SYMBOL_PRINT) operator(()stringoperator(,) ident(yytoken)operator(,) operator(&)ident(yylval)operator(,) operator(&)ident(yylloc)operator(\);) - - comment(/* Discard the shifted token unless it is eof. */) - reserved(if) operator(()ident(yychar) operator(!=) ident(YYEOF)operator(\)) - ident(yychar) operator(=) ident(YYEMPTY)operator(;) - - ident(yystate) operator(=) ident(yyn)operator(;) - operator(*++)ident(yyvsp) operator(=) ident(yylval)operator(;) - - reserved(goto) ident(yynewstate)operator(;) - - -comment(/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/) -label(yydefault:) - ident(yyn) operator(=) ident(yydefact)operator([)ident(yystate)operator(];) - reserved(if) operator(()ident(yyn) operator(==) integer(0)operator(\)) - reserved(goto) ident(yyerrlab)operator(;) - reserved(goto) ident(yyreduce)operator(;) - - -comment(/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/) -label(yyreduce:) - comment(/* yyn is the number of a rule to reduce with. */) - ident(yylen) operator(=) ident(yyr2)operator([)ident(yyn)operator(];) - - comment(/* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */) - ident(yyval) operator(=) ident(yyvsp)operator([)integer(1)operator(-)ident(yylen)operator(];) - - - ident(YY_REDUCE_PRINT) operator(()ident(yyn)operator(\);) - reserved(switch) operator(()ident(yyn)operator(\)) - operator({) - reserved(case) integer(2)operator(:) -preprocessor(#line) integer(350) string - operator({) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - ident(top_local_init)operator((\);) - reserved(if) operator(()ident(ruby_class) operator(==) ident(rb_cObject)operator(\)) ident(class_nest) operator(=) integer(0)operator(;) - reserved(else) ident(class_nest) operator(=) integer(1)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(3)operator(:) -preprocessor(#line) integer(357) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)) operator(&&) operator(!)ident(compile_for_eval)operator(\)) operator({) - comment(/* last expression should not be void */) - reserved(if) operator(()ident(nd_type)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)) operator(!=) ident(NODE_BLOCK)operator(\)) ident(void_expr)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(else) operator({) - ident(NODE) operator(*)ident(node) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - reserved(while) operator(()ident(node)operator(->)ident(nd_next)operator(\)) operator({) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - operator(}) - ident(void_expr)operator(()ident(node)operator(->)ident(nd_head)operator(\);) - operator(}) - operator(}) - ident(ruby_eval_tree) operator(=) ident(block_append)operator(()ident(ruby_eval_tree)operator(,) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - ident(top_local_setup)operator((\);) - ident(class_nest) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(4)operator(:) -preprocessor(#line) integer(379) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_RESCUE)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ENSURE)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(5)operator(:) -preprocessor(#line) integer(396) string - operator({) - ident(void_stmts)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixup_nodes)operator((&)ident(deferred_nodes)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(7)operator(:) -preprocessor(#line) integer(405) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(newline_node)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(8)operator(:) -preprocessor(#line) integer(409) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(newline_node)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(9)operator(:) -preprocessor(#line) integer(413) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(remove_begin)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(10)operator(:) -preprocessor(#line) integer(418) string - operator({)ident(lex_state) operator(=) ident(EXPR_FNAME)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(11)operator(:) -preprocessor(#line) integer(419) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ALIAS)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(12)operator(:) -preprocessor(#line) integer(423) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_VALIAS)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(13)operator(:) -preprocessor(#line) integer(427) string - operator({) - pre_type(char) ident(buf)operator([)integer(3)operator(];) - - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) operator(()pre_type(char)operator(\)()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_nth)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_VALIAS)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\),) ident(rb_intern)operator(()ident(buf)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(14)operator(:) -preprocessor(#line) integer(434) string - operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(15)operator(:) -preprocessor(#line) integer(439) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(16)operator(:) -preprocessor(#line) integer(443) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_IF)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) ident(remove_begin)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) integer(0)operator(\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator(()ident(cond_negative)operator((&()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_cond)operator(\)\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_else) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_body)operator(;) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_body) operator(=) integer(0)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(17)operator(:) -preprocessor(#line) integer(452) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_UNLESS)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) ident(remove_begin)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) integer(0)operator(\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator(()ident(cond_negative)operator((&()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_cond)operator(\)\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_body) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_else)operator(;) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_else) operator(=) integer(0)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(18)operator(:) -preprocessor(#line) integer(461) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)) operator(&&) ident(nd_type)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_BEGIN)operator(\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_WHILE)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_body)operator(,) integer(0)operator(\);) - operator(}) - reserved(else) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_WHILE)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) integer(1)operator(\);) - operator(}) - reserved(if) operator(()ident(cond_negative)operator((&()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_cond)operator(\)\)) operator({) - ident(nd_set_type)operator((()ident(yyval)operator(.)ident(node)operator(\),) ident(NODE_UNTIL)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(19)operator(:) -preprocessor(#line) integer(473) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)) operator(&&) ident(nd_type)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_BEGIN)operator(\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_UNTIL)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_body)operator(,) integer(0)operator(\);) - operator(}) - reserved(else) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_UNTIL)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) integer(1)operator(\);) - operator(}) - reserved(if) operator(()ident(cond_negative)operator((&()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_cond)operator(\)\)) operator({) - ident(nd_set_type)operator((()ident(yyval)operator(.)ident(node)operator(\),) ident(NODE_WHILE)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(20)operator(:) -preprocessor(#line) integer(485) string - operator({) - ident(NODE) operator(*)ident(resq) operator(=) ident(NEW_RESBODY)operator(()integer(0)operator(,) ident(remove_begin)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) integer(0)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_RESCUE)operator(()ident(remove_begin)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) ident(resq)operator(,) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(21)operator(:) -preprocessor(#line) integer(490) string - operator({) - reserved(if) operator(()ident(in_def) operator(||) ident(in_single)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - ident(local_push)operator(()integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(22)operator(:) -preprocessor(#line) integer(497) string - operator({) - ident(ruby_eval_tree_begin) operator(=) ident(block_append)operator(()ident(ruby_eval_tree_begin)operator(,) - ident(NEW_PREEXE)operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\)\);) - ident(local_pop)operator((\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(23)operator(:) -preprocessor(#line) integer(504) string - operator({) - reserved(if) operator(()ident(in_def) operator(||) ident(in_single)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(}) - - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ITER)operator(()integer(0)operator(,) ident(NEW_POSTEXE)operator((\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(24)operator(:) -preprocessor(#line) integer(512) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(node_assign)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(25)operator(:) -preprocessor(#line) integer(516) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_value) operator(=) operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_head)operator(\)) operator(?) ident(NEW_TO_ARY)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator(:) ident(NEW_ARRAY)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(26)operator(:) -preprocessor(#line) integer(522) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator({) - ident(ID) ident(vid) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_vid)operator(;) - reserved(if) operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tOROP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_value) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN_OR)operator(()ident(gettable)operator(()ident(vid)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator(()ident(is_asgn_or_id)operator(()ident(vid)operator(\)\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_aid) operator(=) ident(vid)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tANDOP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_value) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN_AND)operator(()ident(gettable)operator(()ident(vid)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(else) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_value) operator(=) ident(call_op)operator(()ident(gettable)operator(()ident(vid)operator(\),()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\),)integer(1)operator(,()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - operator(}) - reserved(else) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(27)operator(:) -preprocessor(#line) integer(547) string - operator({) - ident(NODE) operator(*)ident(args)operator(;) - - ident(value_expr)operator((()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((!()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\)) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)) operator(=) ident(NEW_ZARRAY)operator((\);) - ident(args) operator(=) ident(arg_concat)operator((()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tOROP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tANDOP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(1)operator(;) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN1)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\),) ident(args)operator(\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(28)operator(:) -preprocessor(#line) integer(563) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tOROP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tANDOP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(1)operator(;) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN2)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(29)operator(:) -preprocessor(#line) integer(575) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tOROP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tANDOP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(1)operator(;) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN2)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(30)operator(:) -preprocessor(#line) integer(587) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tOROP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tANDOP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(1)operator(;) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN2)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(31)operator(:) -preprocessor(#line) integer(599) string - operator({) - ident(rb_backref_error)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(32)operator(:) -preprocessor(#line) integer(604) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(node_assign)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(NEW_SVALUE)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(33)operator(:) -preprocessor(#line) integer(608) string - operator({) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_value) operator(=) operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_head)operator(\)) operator(?) ident(NEW_TO_ARY)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator(:) ident(NEW_ARRAY)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(34)operator(:) -preprocessor(#line) integer(613) string - operator({) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_value) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(37)operator(:) -preprocessor(#line) integer(622) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(logop)operator(()ident(NODE_AND)operator(,) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(38)operator(:) -preprocessor(#line) integer(626) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(logop)operator(()ident(NODE_OR)operator(,) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(39)operator(:) -preprocessor(#line) integer(630) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NOT)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(40)operator(:) -preprocessor(#line) integer(634) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NOT)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(42)operator(:) -preprocessor(#line) integer(641) string - operator({) - ident(value_expr)operator((()ident(yyval)operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(45)operator(:) -preprocessor(#line) integer(650) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_RETURN)operator(()ident(ret_args)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(46)operator(:) -preprocessor(#line) integer(654) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_BREAK)operator(()ident(ret_args)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(47)operator(:) -preprocessor(#line) integer(658) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NEXT)operator(()ident(ret_args)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(49)operator(:) -preprocessor(#line) integer(665) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_call)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(50)operator(:) -preprocessor(#line) integer(669) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_call)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(51)operator(:) -preprocessor(#line) integer(675) string - operator({) - operator(()ident(yyval)operator(.)ident(vars)operator(\)) operator(=) ident(dyna_push)operator((\);) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(num)operator(\)) operator(=) ident(ruby_sourceline)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(52)operator(:) -preprocessor(#line) integer(679) string - operator({()ident(yyval)operator(.)ident(vars)operator(\)) operator(=) ident(ruby_dyna_vars)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(53)operator(:) -preprocessor(#line) integer(682) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ITER)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) integer(0)operator(,) ident(dyna_init)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(vars)operator(\)\)\);) - ident(nd_set_line)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(num)operator(\)\);) - ident(dyna_pop)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(vars)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(54)operator(:) -preprocessor(#line) integer(690) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_fcall)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(55)operator(:) -preprocessor(#line) integer(695) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_fcall)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator({) - reserved(if) operator(()ident(nd_type)operator((()ident(yyval)operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_BLOCK_PASS)operator(\)) operator({) - ident(rb_compile_error)operator(()stringoperator(\);) - operator(}) - operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_iter) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(56)operator(:) -preprocessor(#line) integer(707) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_call)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(57)operator(:) -preprocessor(#line) integer(712) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_call)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\)) operator({) - reserved(if) operator(()ident(nd_type)operator((()ident(yyval)operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_BLOCK_PASS)operator(\)) operator({) - ident(rb_compile_error)operator(()stringoperator(\);) - operator(}) - operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_iter) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(58)operator(:) -preprocessor(#line) integer(724) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_call)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(59)operator(:) -preprocessor(#line) integer(729) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_call)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\)) operator({) - reserved(if) operator(()ident(nd_type)operator((()ident(yyval)operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_BLOCK_PASS)operator(\)) operator({) - ident(rb_compile_error)operator(()stringoperator(\);) - operator(}) - operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_iter) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(60)operator(:) -preprocessor(#line) integer(741) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_super)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(61)operator(:) -preprocessor(#line) integer(746) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_yield)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(63)operator(:) -preprocessor(#line) integer(754) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(65)operator(:) -preprocessor(#line) integer(761) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_MASGN)operator(()ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(66)operator(:) -preprocessor(#line) integer(767) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_MASGN)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\),) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(67)operator(:) -preprocessor(#line) integer(771) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_MASGN)operator(()ident(list_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\),) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(68)operator(:) -preprocessor(#line) integer(775) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_MASGN)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(69)operator(:) -preprocessor(#line) integer(779) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_MASGN)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),) operator(-)integer(1)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(70)operator(:) -preprocessor(#line) integer(783) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_MASGN)operator(()integer(0)operator(,) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(71)operator(:) -preprocessor(#line) integer(787) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_MASGN)operator(()integer(0)operator(,) operator(-)integer(1)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(73)operator(:) -preprocessor(#line) integer(794) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(74)operator(:) -preprocessor(#line) integer(800) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(75)operator(:) -preprocessor(#line) integer(804) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(76)operator(:) -preprocessor(#line) integer(810) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(assignable)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\),) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(77)operator(:) -preprocessor(#line) integer(814) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(aryset)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(78)operator(:) -preprocessor(#line) integer(818) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(attrset)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(79)operator(:) -preprocessor(#line) integer(822) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(attrset)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(80)operator(:) -preprocessor(#line) integer(826) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(attrset)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(81)operator(:) -preprocessor(#line) integer(830) string - operator({) - reserved(if) operator(()ident(in_def) operator(||) ident(in_single)operator(\)) - ident(yyerror)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_CDECL)operator(()integer(0)operator(,) integer(0)operator(,) ident(NEW_COLON2)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(82)operator(:) -preprocessor(#line) integer(836) string - operator({) - reserved(if) operator(()ident(in_def) operator(||) ident(in_single)operator(\)) - ident(yyerror)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_CDECL)operator(()integer(0)operator(,) integer(0)operator(,) ident(NEW_COLON3)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(83)operator(:) -preprocessor(#line) integer(842) string - operator({) - ident(rb_backref_error)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(84)operator(:) -preprocessor(#line) integer(849) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(assignable)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\),) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(85)operator(:) -preprocessor(#line) integer(853) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(aryset)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(86)operator(:) -preprocessor(#line) integer(857) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(attrset)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(87)operator(:) -preprocessor(#line) integer(861) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(attrset)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(88)operator(:) -preprocessor(#line) integer(865) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(attrset)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(89)operator(:) -preprocessor(#line) integer(869) string - operator({) - reserved(if) operator(()ident(in_def) operator(||) ident(in_single)operator(\)) - ident(yyerror)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_CDECL)operator(()integer(0)operator(,) integer(0)operator(,) ident(NEW_COLON2)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(90)operator(:) -preprocessor(#line) integer(875) string - operator({) - reserved(if) operator(()ident(in_def) operator(||) ident(in_single)operator(\)) - ident(yyerror)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_CDECL)operator(()integer(0)operator(,) integer(0)operator(,) ident(NEW_COLON3)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(91)operator(:) -preprocessor(#line) integer(881) string - operator({) - ident(rb_backref_error)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(92)operator(:) -preprocessor(#line) integer(888) string - operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(94)operator(:) -preprocessor(#line) integer(895) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_COLON3)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(95)operator(:) -preprocessor(#line) integer(899) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_COLON2)operator(()integer(0)operator(,) operator(()ident(yyval)operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(96)operator(:) -preprocessor(#line) integer(903) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_COLON2)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(100)operator(:) -preprocessor(#line) integer(912) string - operator({) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(101)operator(:) -preprocessor(#line) integer(917) string - operator({) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(104)operator(:) -preprocessor(#line) integer(928) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIT)operator(()ident(ID2SYM)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(106)operator(:) -preprocessor(#line) integer(935) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_UNDEF)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(107)operator(:) -preprocessor(#line) integer(938) string - operator({)ident(lex_state) operator(=) ident(EXPR_FNAME)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(108)operator(:) -preprocessor(#line) integer(939) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) ident(NEW_UNDEF)operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(109)operator(:) -preprocessor(#line) integer(944) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('|')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(110)operator(:) -preprocessor(#line) integer(945) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('^')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(111)operator(:) -preprocessor(#line) integer(946) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('&')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(112)operator(:) -preprocessor(#line) integer(947) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tCMP)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(113)operator(:) -preprocessor(#line) integer(948) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tEQ)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(114)operator(:) -preprocessor(#line) integer(949) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tEQQ)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(115)operator(:) -preprocessor(#line) integer(950) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tMATCH)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(116)operator(:) -preprocessor(#line) integer(951) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('>')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(117)operator(:) -preprocessor(#line) integer(952) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tGEQ)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(118)operator(:) -preprocessor(#line) integer(953) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('<')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(119)operator(:) -preprocessor(#line) integer(954) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tLEQ)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(120)operator(:) -preprocessor(#line) integer(955) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tLSHFT)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(121)operator(:) -preprocessor(#line) integer(956) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tRSHFT)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(122)operator(:) -preprocessor(#line) integer(957) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('+')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(123)operator(:) -preprocessor(#line) integer(958) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('-')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(124)operator(:) -preprocessor(#line) integer(959) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('*')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(125)operator(:) -preprocessor(#line) integer(960) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('*')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(126)operator(:) -preprocessor(#line) integer(961) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('/')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(127)operator(:) -preprocessor(#line) integer(962) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('%')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(128)operator(:) -preprocessor(#line) integer(963) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tPOW)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(129)operator(:) -preprocessor(#line) integer(964) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('~')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(130)operator(:) -preprocessor(#line) integer(965) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tUPLUS)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(131)operator(:) -preprocessor(#line) integer(966) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tUMINUS)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(132)operator(:) -preprocessor(#line) integer(967) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tAREF)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(133)operator(:) -preprocessor(#line) integer(968) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(tASET)operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(134)operator(:) -preprocessor(#line) integer(969) string - operator({) operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) char('`')operator(;) operator(}) - reserved(break)operator(;) - - reserved(case) integer(175)operator(:) -preprocessor(#line) integer(982) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(node_assign)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(176)operator(:) -preprocessor(#line) integer(986) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(node_assign)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) ident(NEW_RESCUE)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) ident(NEW_RESBODY)operator(()integer(0)operator(,()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),)integer(0)operator(\),) integer(0)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(177)operator(:) -preprocessor(#line) integer(990) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator({) - ident(ID) ident(vid) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_vid)operator(;) - reserved(if) operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tOROP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_value) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN_OR)operator(()ident(gettable)operator(()ident(vid)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator(()ident(is_asgn_or_id)operator(()ident(vid)operator(\)\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_aid) operator(=) ident(vid)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tANDOP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_value) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN_AND)operator(()ident(gettable)operator(()ident(vid)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(else) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_value) operator(=) ident(call_op)operator(()ident(gettable)operator(()ident(vid)operator(\),()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\),)integer(1)operator(,()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - operator(}) - reserved(else) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(178)operator(:) -preprocessor(#line) integer(1015) string - operator({) - ident(NODE) operator(*)ident(args)operator(;) - - ident(value_expr)operator((()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((!()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\)) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)) operator(=) ident(NEW_ZARRAY)operator((\);) - ident(args) operator(=) ident(arg_concat)operator((()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tOROP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tANDOP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(1)operator(;) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN1)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\),) ident(args)operator(\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(179)operator(:) -preprocessor(#line) integer(1031) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tOROP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tANDOP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(1)operator(;) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN2)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(180)operator(:) -preprocessor(#line) integer(1043) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tOROP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tANDOP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(1)operator(;) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN2)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(181)operator(:) -preprocessor(#line) integer(1055) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tOROP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(==) ident(tANDOP)operator(\)) operator({) - operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\)) operator(=) integer(1)operator(;) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_OP_ASGN2)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(182)operator(:) -preprocessor(#line) integer(1067) string - operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(183)operator(:) -preprocessor(#line) integer(1072) string - operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(184)operator(:) -preprocessor(#line) integer(1077) string - operator({) - ident(rb_backref_error)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(185)operator(:) -preprocessor(#line) integer(1082) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_DOT2)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator(()ident(nd_type)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_LIT) operator(&&) ident(FIXNUM_P)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_lit)operator(\)) operator(&&) - ident(nd_type)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_LIT) operator(&&) ident(FIXNUM_P)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_lit)operator(\)\)) operator({) - ident(deferred_nodes) operator(=) ident(list_append)operator(()ident(deferred_nodes)operator(,) operator(()ident(yyval)operator(.)ident(node)operator(\)\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(186)operator(:) -preprocessor(#line) integer(1092) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_DOT3)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator(()ident(nd_type)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_LIT) operator(&&) ident(FIXNUM_P)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_lit)operator(\)) operator(&&) - ident(nd_type)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_LIT) operator(&&) ident(FIXNUM_P)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_lit)operator(\)\)) operator({) - ident(deferred_nodes) operator(=) ident(list_append)operator(()ident(deferred_nodes)operator(,) operator(()ident(yyval)operator(.)ident(node)operator(\)\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(187)operator(:) -preprocessor(#line) integer(1102) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) char('+')operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(188)operator(:) -preprocessor(#line) integer(1106) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) char('-')operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(189)operator(:) -preprocessor(#line) integer(1110) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) char('*')operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(190)operator(:) -preprocessor(#line) integer(1114) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) char('/')operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(191)operator(:) -preprocessor(#line) integer(1118) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) char('%')operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(192)operator(:) -preprocessor(#line) integer(1122) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(tPOW)operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(193)operator(:) -preprocessor(#line) integer(1126) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator(()ident(call_op)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) ident(tPOW)operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\),) ident(tUMINUS)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(194)operator(:) -preprocessor(#line) integer(1130) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator(()ident(call_op)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) ident(tPOW)operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\),) ident(tUMINUS)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(195)operator(:) -preprocessor(#line) integer(1134) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)) operator(&&) ident(nd_type)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_LIT)operator(\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(else) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),) ident(tUPLUS)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(196)operator(:) -preprocessor(#line) integer(1143) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),) ident(tUMINUS)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(197)operator(:) -preprocessor(#line) integer(1147) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) char('|')operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(198)operator(:) -preprocessor(#line) integer(1151) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) char('^')operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(199)operator(:) -preprocessor(#line) integer(1155) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) char('&')operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(200)operator(:) -preprocessor(#line) integer(1159) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(tCMP)operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(201)operator(:) -preprocessor(#line) integer(1163) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) char('>')operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(202)operator(:) -preprocessor(#line) integer(1167) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(tGEQ)operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(203)operator(:) -preprocessor(#line) integer(1171) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) char('<')operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(204)operator(:) -preprocessor(#line) integer(1175) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(tLEQ)operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(205)operator(:) -preprocessor(#line) integer(1179) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(tEQ)operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(206)operator(:) -preprocessor(#line) integer(1183) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(tEQQ)operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(207)operator(:) -preprocessor(#line) integer(1187) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NOT)operator(()ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(tEQ)operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(208)operator(:) -preprocessor(#line) integer(1191) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(match_gen)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(209)operator(:) -preprocessor(#line) integer(1195) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NOT)operator(()ident(match_gen)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(210)operator(:) -preprocessor(#line) integer(1199) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NOT)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(211)operator(:) -preprocessor(#line) integer(1203) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),) char('~')operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(212)operator(:) -preprocessor(#line) integer(1207) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(tLSHFT)operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(213)operator(:) -preprocessor(#line) integer(1211) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(call_op)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(tRSHFT)operator(,) integer(1)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(214)operator(:) -preprocessor(#line) integer(1215) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(logop)operator(()ident(NODE_AND)operator(,) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(215)operator(:) -preprocessor(#line) integer(1219) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(logop)operator(()ident(NODE_OR)operator(,) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(216)operator(:) -preprocessor(#line) integer(1222) string - operator({)ident(in_defined) operator(=) integer(1)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(217)operator(:) -preprocessor(#line) integer(1223) string - operator({) - ident(in_defined) operator(=) integer(0)operator(;) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_DEFINED)operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(218)operator(:) -preprocessor(#line) integer(1228) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_IF)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(219)operator(:) -preprocessor(#line) integer(1233) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(220)operator(:) -preprocessor(#line) integer(1239) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(222)operator(:) -preprocessor(#line) integer(1247) string - operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(223)operator(:) -preprocessor(#line) integer(1252) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(224)operator(:) -preprocessor(#line) integer(1256) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_concat)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(225)operator(:) -preprocessor(#line) integer(1261) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIST)operator(()ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(226)operator(:) -preprocessor(#line) integer(1265) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NEWLINE)operator(()ident(NEW_SPLAT)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(227)operator(:) -preprocessor(#line) integer(1272) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(228)operator(:) -preprocessor(#line) integer(1276) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(229)operator(:) -preprocessor(#line) integer(1280) string - operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(230)operator(:) -preprocessor(#line) integer(1285) string - operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_append)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(233)operator(:) -preprocessor(#line) integer(1296) string - operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(234)operator(:) -preprocessor(#line) integer(1301) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(235)operator(:) -preprocessor(#line) integer(1305) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_concat)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(236)operator(:) -preprocessor(#line) integer(1310) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIST)operator(()ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(237)operator(:) -preprocessor(#line) integer(1315) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_concat)operator(()ident(NEW_LIST)operator(()ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\)\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(238)operator(:) -preprocessor(#line) integer(1320) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(239)operator(:) -preprocessor(#line) integer(1325) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_concat)operator(()ident(list_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\),) ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\)\),) operator(()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(7)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(240)operator(:) -preprocessor(#line) integer(1331) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator(()ident(NEW_SPLAT)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(242)operator(:) -preprocessor(#line) integer(1338) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator(()ident(list_concat)operator(()ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\),()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(243)operator(:) -preprocessor(#line) integer(1342) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(244)operator(:) -preprocessor(#line) integer(1346) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_concat)operator(()ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(245)operator(:) -preprocessor(#line) integer(1351) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_concat)operator(()ident(list_concat)operator(()ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\),()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(7)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(246)operator(:) -preprocessor(#line) integer(1356) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIST)operator(()ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(247)operator(:) -preprocessor(#line) integer(1361) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_concat)operator(()ident(NEW_LIST)operator(()ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\)\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(248)operator(:) -preprocessor(#line) integer(1366) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_append)operator(()ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\),) ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(249)operator(:) -preprocessor(#line) integer(1371) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_append)operator(()ident(list_concat)operator(()ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\),()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\),) ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(250)operator(:) -preprocessor(#line) integer(1376) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_concat)operator(()ident(list_append)operator(()ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\),) ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\)\),) operator(()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(7)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(251)operator(:) -preprocessor(#line) integer(1381) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_concat)operator(()ident(list_append)operator(()ident(list_concat)operator(()ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\)\),) ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\)\)\),) operator(()ident(yyvsp)operator([()integer(8)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(9)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(252)operator(:) -preprocessor(#line) integer(1386) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_blk_pass)operator(()ident(NEW_SPLAT)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(254)operator(:) -preprocessor(#line) integer(1392) string - operator({) - operator(()ident(yyval)operator(.)ident(num)operator(\)) operator(=) ident(cmdarg_stack)operator(;) - ident(CMDARG_PUSH)operator(()integer(1)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(255)operator(:) -preprocessor(#line) integer(1397) string - operator({) - comment(/* CMDARG_POP(\) */) - ident(cmdarg_stack) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(num)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(257)operator(:) -preprocessor(#line) integer(1405) string - operator({)ident(lex_state) operator(=) ident(EXPR_ENDARG)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(258)operator(:) -preprocessor(#line) integer(1406) string - operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(259)operator(:) -preprocessor(#line) integer(1410) string - operator({)ident(lex_state) operator(=) ident(EXPR_ENDARG)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(260)operator(:) -preprocessor(#line) integer(1411) string - operator({) - ident(rb_warn)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(261)operator(:) -preprocessor(#line) integer(1418) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_BLOCK_PASS)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(262)operator(:) -preprocessor(#line) integer(1424) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(264)operator(:) -preprocessor(#line) integer(1431) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(265)operator(:) -preprocessor(#line) integer(1435) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(266)operator(:) -preprocessor(#line) integer(1441) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(267)operator(:) -preprocessor(#line) integer(1445) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(arg_concat)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(268)operator(:) -preprocessor(#line) integer(1449) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_SPLAT)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(277)operator(:) -preprocessor(#line) integer(1463) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_FCALL)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\),) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(278)operator(:) -preprocessor(#line) integer(1467) string - operator({) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(num)operator(\)) operator(=) ident(ruby_sourceline)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(279)operator(:) -preprocessor(#line) integer(1472) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)) operator(==) pre_constant(NULL)operator(\)) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NIL)operator((\);) - reserved(else) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_BEGIN)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - ident(nd_set_line)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(num)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(280)operator(:) -preprocessor(#line) integer(1479) string - operator({)ident(lex_state) operator(=) ident(EXPR_ENDARG)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(281)operator(:) -preprocessor(#line) integer(1480) string - operator({) - ident(rb_warning)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(282)operator(:) -preprocessor(#line) integer(1485) string - operator({) - reserved(if) operator((!()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)) operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NIL)operator((\);) - reserved(else) operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(283)operator(:) -preprocessor(#line) integer(1490) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_COLON2)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(284)operator(:) -preprocessor(#line) integer(1494) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_COLON3)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(285)operator(:) -preprocessor(#line) integer(1498) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)) operator(&&) ident(nd_type)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_SELF)operator(\)) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_FCALL)operator(()ident(tAREF)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(else) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_CALL)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) ident(tAREF)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(286)operator(:) -preprocessor(#line) integer(1506) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)) operator(==) integer(0)operator(\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ZARRAY)operator((\);) comment(/* zero length array*/) - operator(}) - reserved(else) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(287)operator(:) -preprocessor(#line) integer(1515) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_HASH)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(288)operator(:) -preprocessor(#line) integer(1519) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_RETURN)operator(()integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(289)operator(:) -preprocessor(#line) integer(1523) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_yield)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(290)operator(:) -preprocessor(#line) integer(1527) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_YIELD)operator(()integer(0)operator(,) ident(Qfalse)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(291)operator(:) -preprocessor(#line) integer(1531) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_YIELD)operator(()integer(0)operator(,) ident(Qfalse)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(292)operator(:) -preprocessor(#line) integer(1534) string - operator({)ident(in_defined) operator(=) integer(1)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(293)operator(:) -preprocessor(#line) integer(1535) string - operator({) - ident(in_defined) operator(=) integer(0)operator(;) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_DEFINED)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(294)operator(:) -preprocessor(#line) integer(1540) string - operator({) - operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_iter) operator(=) ident(NEW_FCALL)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\),) integer(0)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - ident(fixpos)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_iter)operator(,) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(296)operator(:) -preprocessor(#line) integer(1547) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)) operator(&&) ident(nd_type)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_BLOCK_PASS)operator(\)) operator({) - ident(rb_compile_error)operator(()stringoperator(\);) - operator(}) - operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_iter) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(297)operator(:) -preprocessor(#line) integer(1559) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_IF)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator(()ident(cond_negative)operator((&()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_cond)operator(\)\)) operator({) - ident(NODE) operator(*)ident(tmp) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_body)operator(;) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_body) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_else)operator(;) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_else) operator(=) ident(tmp)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(298)operator(:) -preprocessor(#line) integer(1572) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_UNLESS)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator(()ident(cond_negative)operator((&()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_cond)operator(\)\)) operator({) - ident(NODE) operator(*)ident(tmp) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_body)operator(;) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_body) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_else)operator(;) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_else) operator(=) ident(tmp)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(299)operator(:) -preprocessor(#line) integer(1581) string - operator({)ident(COND_PUSH)operator(()integer(1)operator(\);}) - reserved(break)operator(;) - - reserved(case) integer(300)operator(:) -preprocessor(#line) integer(1581) string - operator({)ident(COND_POP)operator((\);}) - reserved(break)operator(;) - - reserved(case) integer(301)operator(:) -preprocessor(#line) integer(1584) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_WHILE)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\),) integer(1)operator(\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator(()ident(cond_negative)operator((&()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_cond)operator(\)\)) operator({) - ident(nd_set_type)operator((()ident(yyval)operator(.)ident(node)operator(\),) ident(NODE_UNTIL)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(302)operator(:) -preprocessor(#line) integer(1591) string - operator({)ident(COND_PUSH)operator(()integer(1)operator(\);}) - reserved(break)operator(;) - - reserved(case) integer(303)operator(:) -preprocessor(#line) integer(1591) string - operator({)ident(COND_POP)operator((\);}) - reserved(break)operator(;) - - reserved(case) integer(304)operator(:) -preprocessor(#line) integer(1594) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_UNTIL)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\),) integer(1)operator(\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(7)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(if) operator(()ident(cond_negative)operator((&()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_cond)operator(\)\)) operator({) - ident(nd_set_type)operator((()ident(yyval)operator(.)ident(node)operator(\),) ident(NODE_WHILE)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(305)operator(:) -preprocessor(#line) integer(1604) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_CASE)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(306)operator(:) -preprocessor(#line) integer(1609) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(307)operator(:) -preprocessor(#line) integer(1613) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(308)operator(:) -preprocessor(#line) integer(1616) string - operator({)ident(COND_PUSH)operator(()integer(1)operator(\);}) - reserved(break)operator(;) - - reserved(case) integer(309)operator(:) -preprocessor(#line) integer(1616) string - operator({)ident(COND_POP)operator((\);}) - reserved(break)operator(;) - - reserved(case) integer(310)operator(:) -preprocessor(#line) integer(1619) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_FOR)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(8)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(311)operator(:) -preprocessor(#line) integer(1624) string - operator({) - reserved(if) operator(()ident(in_def) operator(||) ident(in_single)operator(\)) - ident(yyerror)operator(()stringoperator(\);) - ident(class_nest)operator(++;) - ident(local_push)operator(()integer(0)operator(\);) - operator(()ident(yyval)operator(.)ident(num)operator(\)) operator(=) ident(ruby_sourceline)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(312)operator(:) -preprocessor(#line) integer(1633) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_CLASS)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - ident(nd_set_line)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(num)operator(\)\);) - ident(local_pop)operator((\);) - ident(class_nest)operator(--;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(313)operator(:) -preprocessor(#line) integer(1640) string - operator({) - operator(()ident(yyval)operator(.)ident(num)operator(\)) operator(=) ident(in_def)operator(;) - ident(in_def) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(314)operator(:) -preprocessor(#line) integer(1645) string - operator({) - operator(()ident(yyval)operator(.)ident(num)operator(\)) operator(=) ident(in_single)operator(;) - ident(in_single) operator(=) integer(0)operator(;) - ident(class_nest)operator(++;) - ident(local_push)operator(()integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(315)operator(:) -preprocessor(#line) integer(1653) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_SCLASS)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(8)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(7)operator(\)) operator(-) operator(()integer(8)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(8)operator(\)])operator(.)ident(node)operator(\)\);) - ident(local_pop)operator((\);) - ident(class_nest)operator(--;) - ident(in_def) operator(=) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(8)operator(\)])operator(.)ident(num)operator(\);) - ident(in_single) operator(=) operator(()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(8)operator(\)])operator(.)ident(num)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(316)operator(:) -preprocessor(#line) integer(1662) string - operator({) - reserved(if) operator(()ident(in_def) operator(||) ident(in_single)operator(\)) - ident(yyerror)operator(()stringoperator(\);) - ident(class_nest)operator(++;) - ident(local_push)operator(()integer(0)operator(\);) - operator(()ident(yyval)operator(.)ident(num)operator(\)) operator(=) ident(ruby_sourceline)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(317)operator(:) -preprocessor(#line) integer(1671) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_MODULE)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - ident(nd_set_line)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(num)operator(\)\);) - ident(local_pop)operator((\);) - ident(class_nest)operator(--;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(318)operator(:) -preprocessor(#line) integer(1678) string - operator({) - operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(cur_mid)operator(;) - ident(cur_mid) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\);) - ident(in_def)operator(++;) - ident(local_push)operator(()integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(319)operator(:) -preprocessor(#line) integer(1687) string - operator({) - reserved(if) operator((!()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\)) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)) operator(=) ident(NEW_NIL)operator((\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_DEFN)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) ident(NOEX_PRIVATE)operator(\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - ident(local_pop)operator((\);) - ident(in_def)operator(--;) - ident(cur_mid) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(id)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(320)operator(:) -preprocessor(#line) integer(1695) string - operator({)ident(lex_state) operator(=) ident(EXPR_FNAME)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(321)operator(:) -preprocessor(#line) integer(1696) string - operator({) - ident(in_single)operator(++;) - ident(local_push)operator(()integer(0)operator(\);) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) comment(/* force for args */) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(322)operator(:) -preprocessor(#line) integer(1704) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_DEFS)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(7)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(8)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(9)operator(\)])operator(.)ident(node)operator(\)\);) - ident(local_pop)operator((\);) - ident(in_single)operator(--;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(323)operator(:) -preprocessor(#line) integer(1711) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_BREAK)operator(()integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(324)operator(:) -preprocessor(#line) integer(1715) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NEXT)operator(()integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(325)operator(:) -preprocessor(#line) integer(1719) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_REDO)operator((\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(326)operator(:) -preprocessor(#line) integer(1723) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_RETRY)operator((\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(327)operator(:) -preprocessor(#line) integer(1729) string - operator({) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(336)operator(:) -preprocessor(#line) integer(1750) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_IF)operator(()ident(cond)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(338)operator(:) -preprocessor(#line) integer(1758) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(342)operator(:) -preprocessor(#line) integer(1769) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(NODE)operator(*\))integer(1)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(343)operator(:) -preprocessor(#line) integer(1773) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(NODE)operator(*\))integer(1)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(344)operator(:) -preprocessor(#line) integer(1777) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(345)operator(:) -preprocessor(#line) integer(1783) string - operator({) - operator(()ident(yyval)operator(.)ident(vars)operator(\)) operator(=) ident(dyna_push)operator((\);) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(num)operator(\)) operator(=) ident(ruby_sourceline)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(346)operator(:) -preprocessor(#line) integer(1787) string - operator({()ident(yyval)operator(.)ident(vars)operator(\)) operator(=) ident(ruby_dyna_vars)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(347)operator(:) -preprocessor(#line) integer(1790) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ITER)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) integer(0)operator(,) ident(dyna_init)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(vars)operator(\)\)\);) - ident(nd_set_line)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(num)operator(\)\);) - ident(dyna_pop)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(vars)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(348)operator(:) -preprocessor(#line) integer(1798) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)) operator(&&) ident(nd_type)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_BLOCK_PASS)operator(\)) operator({) - ident(rb_compile_error)operator(()stringoperator(\);) - operator(}) - operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_iter) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(349)operator(:) -preprocessor(#line) integer(1807) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_call)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(350)operator(:) -preprocessor(#line) integer(1811) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_call)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(351)operator(:) -preprocessor(#line) integer(1817) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_fcall)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(352)operator(:) -preprocessor(#line) integer(1822) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_call)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(353)operator(:) -preprocessor(#line) integer(1827) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_call)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(354)operator(:) -preprocessor(#line) integer(1832) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_call)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\),) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(355)operator(:) -preprocessor(#line) integer(1836) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_super)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(356)operator(:) -preprocessor(#line) integer(1840) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ZSUPER)operator((\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(357)operator(:) -preprocessor(#line) integer(1846) string - operator({) - operator(()ident(yyval)operator(.)ident(vars)operator(\)) operator(=) ident(dyna_push)operator((\);) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(num)operator(\)) operator(=) ident(ruby_sourceline)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(358)operator(:) -preprocessor(#line) integer(1850) string - operator({()ident(yyval)operator(.)ident(vars)operator(\)) operator(=) ident(ruby_dyna_vars)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(359)operator(:) -preprocessor(#line) integer(1852) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ITER)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) integer(0)operator(,) ident(dyna_init)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(vars)operator(\)\)\);) - ident(nd_set_line)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(num)operator(\)\);) - ident(dyna_pop)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(vars)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(360)operator(:) -preprocessor(#line) integer(1858) string - operator({) - operator(()ident(yyval)operator(.)ident(vars)operator(\)) operator(=) ident(dyna_push)operator((\);) - operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(num)operator(\)) operator(=) ident(ruby_sourceline)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(361)operator(:) -preprocessor(#line) integer(1862) string - operator({()ident(yyval)operator(.)ident(vars)operator(\)) operator(=) ident(ruby_dyna_vars)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(362)operator(:) -preprocessor(#line) integer(1864) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ITER)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) integer(0)operator(,) ident(dyna_init)operator((()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(vars)operator(\)\)\);) - ident(nd_set_line)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(num)operator(\)\);) - ident(dyna_pop)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(vars)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(363)operator(:) -preprocessor(#line) integer(1874) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_WHEN)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(365)operator(:) -preprocessor(#line) integer(1880) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) ident(NEW_WHEN)operator((()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) integer(0)operator(,) integer(0)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(366)operator(:) -preprocessor(#line) integer(1884) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIST)operator(()ident(NEW_WHEN)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),) integer(0)operator(,) integer(0)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(369)operator(:) -preprocessor(#line) integer(1896) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\)) operator({) - operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)) operator(=) ident(node_assign)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) ident(NEW_GVAR)operator(()ident(rb_intern)operator(()stringoperator(\)\)\);) - operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_RESBODY)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - ident(fixpos)operator((()ident(yyval)operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)?()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\):()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(371)operator(:) -preprocessor(#line) integer(1908) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(374)operator(:) -preprocessor(#line) integer(1916) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(376)operator(:) -preprocessor(#line) integer(1923) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\)) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - reserved(else) - comment(/* place holder */) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NIL)operator((\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(379)operator(:) -preprocessor(#line) integer(1935) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_LIT)operator(()ident(ID2SYM)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(381)operator(:) -preprocessor(#line) integer(1942) string - operator({) - ident(NODE) operator(*)ident(node) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\);) - reserved(if) operator((!)ident(node)operator(\)) operator({) - ident(node) operator(=) ident(NEW_STR)operator(()ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(node) operator(=) ident(evstr2dstr)operator(()ident(node)operator(\);) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(node)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(383)operator(:) -preprocessor(#line) integer(1956) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(literal_concat)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(384)operator(:) -preprocessor(#line) integer(1962) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(385)operator(:) -preprocessor(#line) integer(1968) string - operator({) - ident(NODE) operator(*)ident(node) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - reserved(if) operator((!)ident(node)operator(\)) operator({) - ident(node) operator(=) ident(NEW_XSTR)operator(()ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\)\);) - operator(}) - reserved(else) operator({) - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_STR)operator(:) - ident(nd_set_type)operator(()ident(node)operator(,) ident(NODE_XSTR)operator(\);) - reserved(break)operator(;) - reserved(case) ident(NODE_DSTR)operator(:) - ident(nd_set_type)operator(()ident(node)operator(,) ident(NODE_DXSTR)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(node) operator(=) ident(NEW_NODE)operator(()ident(NODE_DXSTR)operator(,) ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\),) integer(1)operator(,) ident(NEW_LIST)operator(()ident(node)operator(\)\);) - reserved(break)operator(;) - operator(}) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(node)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(386)operator(:) -preprocessor(#line) integer(1991) string - operator({) - pre_type(int) ident(options) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(num)operator(\);) - ident(NODE) operator(*)ident(node) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - reserved(if) operator((!)ident(node)operator(\)) operator({) - ident(node) operator(=) ident(NEW_LIT)operator(()ident(rb_reg_new)operator(()stringoperator(,) integer(0)operator(,) ident(options) operator(&) operator(~)ident(RE_OPTION_ONCE)operator(\)\);) - operator(}) - reserved(else) reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_STR)operator(:) - operator({) - ident(VALUE) ident(src) operator(=) ident(node)operator(->)ident(nd_lit)operator(;) - ident(nd_set_type)operator(()ident(node)operator(,) ident(NODE_LIT)operator(\);) - ident(node)operator(->)ident(nd_lit) operator(=) ident(rb_reg_new)operator(()ident(RSTRING)operator(()ident(src)operator(\)->)ident(ptr)operator(,) - ident(RSTRING)operator(()ident(src)operator(\)->)ident(len)operator(,) - ident(options) operator(&) operator(~)ident(RE_OPTION_ONCE)operator(\);) - operator(}) - reserved(break)operator(;) - reserved(default)operator(:) - ident(node) operator(=) ident(NEW_NODE)operator(()ident(NODE_DSTR)operator(,) ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\),) integer(1)operator(,) ident(NEW_LIST)operator(()ident(node)operator(\)\);) - reserved(case) ident(NODE_DSTR)operator(:) - reserved(if) operator(()ident(options) operator(&) ident(RE_OPTION_ONCE)operator(\)) operator({) - ident(nd_set_type)operator(()ident(node)operator(,) ident(NODE_DREGX_ONCE)operator(\);) - operator(}) - reserved(else) operator({) - ident(nd_set_type)operator(()ident(node)operator(,) ident(NODE_DREGX)operator(\);) - operator(}) - ident(node)operator(->)ident(nd_cflag) operator(=) ident(options) operator(&) operator(~)ident(RE_OPTION_ONCE)operator(;) - reserved(break)operator(;) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(node)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(387)operator(:) -preprocessor(#line) integer(2024) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ZARRAY)operator((\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(388)operator(:) -preprocessor(#line) integer(2028) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(389)operator(:) -preprocessor(#line) integer(2034) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(390)operator(:) -preprocessor(#line) integer(2038) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) ident(evstr2dstr)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(392)operator(:) -preprocessor(#line) integer(2045) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(literal_concat)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(393)operator(:) -preprocessor(#line) integer(2051) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ZARRAY)operator((\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(394)operator(:) -preprocessor(#line) integer(2055) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(395)operator(:) -preprocessor(#line) integer(2061) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(396)operator(:) -preprocessor(#line) integer(2065) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(397)operator(:) -preprocessor(#line) integer(2071) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(398)operator(:) -preprocessor(#line) integer(2075) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(literal_concat)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(399)operator(:) -preprocessor(#line) integer(2081) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(400)operator(:) -preprocessor(#line) integer(2085) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(literal_concat)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(402)operator(:) -preprocessor(#line) integer(2092) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(lex_strterm)operator(;) - ident(lex_strterm) operator(=) integer(0)operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(403)operator(:) -preprocessor(#line) integer(2098) string - operator({) - ident(lex_strterm) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_EVSTR)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(404)operator(:) -preprocessor(#line) integer(2103) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(lex_strterm)operator(;) - ident(lex_strterm) operator(=) integer(0)operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - ident(COND_PUSH)operator(()integer(0)operator(\);) - ident(CMDARG_PUSH)operator(()integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(405)operator(:) -preprocessor(#line) integer(2111) string - operator({) - ident(lex_strterm) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\);) - ident(COND_LEXPOP)operator((\);) - ident(CMDARG_LEXPOP)operator((\);) - reserved(if) operator(((()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\)) operator(&&) ident(nd_type)operator((()ident(yyval)operator(.)ident(node)operator(\)\)) operator(==) ident(NODE_NEWLINE)operator(\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_next)operator(;) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\)()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(new_evstr)operator((()ident(yyval)operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(406)operator(:) -preprocessor(#line) integer(2123) string - operator({()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_GVAR)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\)\);}) - reserved(break)operator(;) - - reserved(case) integer(407)operator(:) -preprocessor(#line) integer(2124) string - operator({()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_IVAR)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\)\);}) - reserved(break)operator(;) - - reserved(case) integer(408)operator(:) -preprocessor(#line) integer(2125) string - operator({()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_CVAR)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\)\);}) - reserved(break)operator(;) - - reserved(case) integer(410)operator(:) -preprocessor(#line) integer(2130) string - operator({) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - operator(()ident(yyval)operator(.)ident(id)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(415)operator(:) -preprocessor(#line) integer(2143) string - operator({) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - reserved(if) operator((!(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\)\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NIL)operator((\);) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(lit)operator(;) - - reserved(switch) operator(()ident(nd_type)operator((()ident(yyval)operator(.)ident(node)operator(\)\)\)) operator({) - reserved(case) ident(NODE_DSTR)operator(:) - ident(nd_set_type)operator((()ident(yyval)operator(.)ident(node)operator(\),) ident(NODE_DSYM)operator(\);) - reserved(break)operator(;) - reserved(case) ident(NODE_STR)operator(:) - ident(lit) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_lit)operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(lit)operator(\)->)ident(len) operator(==) integer(0)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(strlen)operator(()ident(RSTRING)operator(()ident(lit)operator(\)->)ident(ptr)operator(\)) operator(==) ident(RSTRING)operator(()ident(lit)operator(\)->)ident(len)operator(\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_lit) operator(=) ident(ID2SYM)operator(()ident(rb_intern)operator(()ident(RSTRING)operator((()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_lit)operator(\)->)ident(ptr)operator(\)\);) - ident(nd_set_type)operator((()ident(yyval)operator(.)ident(node)operator(\),) ident(NODE_LIT)operator(\);) - reserved(break)operator(;) - operator(}) - comment(/* fall through */) - reserved(default)operator(:) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NODE)operator(()ident(NODE_DSYM)operator(,) ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\),) integer(1)operator(,) ident(NEW_LIST)operator((()ident(yyval)operator(.)ident(node)operator(\)\)\);) - reserved(break)operator(;) - operator(}) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(418)operator(:) -preprocessor(#line) integer(2179) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(negate_lit)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(419)operator(:) -preprocessor(#line) integer(2183) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(negate_lit)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(425)operator(:) -preprocessor(#line) integer(2193) string - operator({()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(kNIL)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(426)operator(:) -preprocessor(#line) integer(2194) string - operator({()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(kSELF)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(427)operator(:) -preprocessor(#line) integer(2195) string - operator({()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(kTRUE)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(428)operator(:) -preprocessor(#line) integer(2196) string - operator({()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(kFALSE)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(429)operator(:) -preprocessor(#line) integer(2197) string - operator({()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(k__FILE__)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(430)operator(:) -preprocessor(#line) integer(2198) string - operator({()ident(yyval)operator(.)ident(id)operator(\)) operator(=) ident(k__LINE__)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(431)operator(:) -preprocessor(#line) integer(2202) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(gettable)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(432)operator(:) -preprocessor(#line) integer(2208) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(assignable)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\),) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(435)operator(:) -preprocessor(#line) integer(2218) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(436)operator(:) -preprocessor(#line) integer(2222) string - operator({) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(437)operator(:) -preprocessor(#line) integer(2226) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(438)operator(:) -preprocessor(#line) integer(2229) string - operator({)ident(yyerrok)operator(;) operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(439)operator(:) -preprocessor(#line) integer(2233) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\);) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - ident(command_start) operator(=) ident(Qtrue)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(440)operator(:) -preprocessor(#line) integer(2239) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(441)operator(:) -preprocessor(#line) integer(2245) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator(()ident(NEW_ARGS)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(num)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(5)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(6)operator(\)) operator(-) operator(()integer(6)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(442)operator(:) -preprocessor(#line) integer(2249) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator(()ident(NEW_ARGS)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(num)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) integer(0)operator(\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(443)operator(:) -preprocessor(#line) integer(2253) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator(()ident(NEW_ARGS)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(num)operator(\),) integer(0)operator(,) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(444)operator(:) -preprocessor(#line) integer(2257) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator(()ident(NEW_ARGS)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(num)operator(\),) integer(0)operator(,) integer(0)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(445)operator(:) -preprocessor(#line) integer(2261) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator(()ident(NEW_ARGS)operator(()integer(0)operator(,) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(4)operator(\)) operator(-) operator(()integer(4)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(446)operator(:) -preprocessor(#line) integer(2265) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator(()ident(NEW_ARGS)operator(()integer(0)operator(,) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\),) integer(0)operator(\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(447)operator(:) -preprocessor(#line) integer(2269) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator(()ident(NEW_ARGS)operator(()integer(0)operator(,) integer(0)operator(,) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(448)operator(:) -preprocessor(#line) integer(2273) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator(()ident(NEW_ARGS)operator(()integer(0)operator(,) integer(0)operator(,) integer(0)operator(\),) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(449)operator(:) -preprocessor(#line) integer(2277) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_ARGS)operator(()integer(0)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(450)operator(:) -preprocessor(#line) integer(2283) string - operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(451)operator(:) -preprocessor(#line) integer(2287) string - operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(452)operator(:) -preprocessor(#line) integer(2291) string - operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(453)operator(:) -preprocessor(#line) integer(2295) string - operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(454)operator(:) -preprocessor(#line) integer(2299) string - operator({) - reserved(if) operator((!)ident(is_local_id)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\)\)\)) - ident(yyerror)operator(()stringoperator(\);) - reserved(else) reserved(if) operator(()ident(local_id)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\)\)\)) - ident(yyerror)operator(()stringoperator(\);) - ident(local_cnt)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(id)operator(\)\);) - operator(()ident(yyval)operator(.)ident(num)operator(\)) operator(=) integer(1)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(456)operator(:) -preprocessor(#line) integer(2311) string - operator({) - operator(()ident(yyval)operator(.)ident(num)operator(\)) operator(+=) integer(1)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(457)operator(:) -preprocessor(#line) integer(2317) string - operator({) - reserved(if) operator((!)ident(is_local_id)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\)\)) - ident(yyerror)operator(()stringoperator(\);) - reserved(else) reserved(if) operator(()ident(local_id)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\)\)\)) - ident(yyerror)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(assignable)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(id)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(458)operator(:) -preprocessor(#line) integer(2327) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_BLOCK)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\)\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)->)ident(nd_end) operator(=) operator(()ident(yyval)operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(459)operator(:) -preprocessor(#line) integer(2332) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(block_append)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(462)operator(:) -preprocessor(#line) integer(2342) string - operator({) - reserved(if) operator((!)ident(is_local_id)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\)\)\)) - ident(yyerror)operator(()stringoperator(\);) - reserved(else) reserved(if) operator(()ident(local_id)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\)\)\)) - ident(yyerror)operator(()stringoperator(\);) - reserved(if) operator(()ident(dyna_in_block)operator((\)\)) operator({) - ident(rb_dvar_push)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\),) ident(Qnil)operator(\);) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(assignable)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\),) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(463)operator(:) -preprocessor(#line) integer(2353) string - operator({) - reserved(if) operator(()ident(dyna_in_block)operator((\)\)) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_DASGN_CURR)operator(()ident(internal_id)operator((\),) integer(0)operator(\);) - operator(}) - reserved(else) operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_NODE)operator(()ident(NODE_LASGN)operator(,)integer(0)operator(,)integer(0)operator(,)ident(local_append)operator(()integer(0)operator(\)\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(466)operator(:) -preprocessor(#line) integer(2368) string - operator({) - reserved(if) operator((!)ident(is_local_id)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\)\)\)) - ident(yyerror)operator(()stringoperator(\);) - reserved(else) reserved(if) operator(()ident(local_id)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\)\)\)) - ident(yyerror)operator(()stringoperator(\);) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(NEW_BLOCK_ARG)operator((()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(id)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(467)operator(:) -preprocessor(#line) integer(2378) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(2)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(469)operator(:) -preprocessor(#line) integer(2385) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(1)operator(\)])operator(.)ident(node)operator(\);) - ident(value_expr)operator((()ident(yyval)operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(470)operator(:) -preprocessor(#line) integer(2389) string - operator({)ident(lex_state) operator(=) ident(EXPR_BEG)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(471)operator(:) -preprocessor(#line) integer(2390) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) operator({) - reserved(switch) operator(()ident(nd_type)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\)\)) operator({) - reserved(case) ident(NODE_STR)operator(:) - reserved(case) ident(NODE_DSTR)operator(:) - reserved(case) ident(NODE_XSTR)operator(:) - reserved(case) ident(NODE_DXSTR)operator(:) - reserved(case) ident(NODE_DREGX)operator(:) - reserved(case) ident(NODE_LIT)operator(:) - reserved(case) ident(NODE_ARRAY)operator(:) - reserved(case) ident(NODE_ZARRAY)operator(:) - ident(yyerror)operator(()stringoperator(\);) - reserved(default)operator(:) - ident(value_expr)operator((()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\)\);) - reserved(break)operator(;) - operator(}) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(5)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(473)operator(:) -preprocessor(#line) integer(2416) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(474)operator(:) -preprocessor(#line) integer(2420) string - operator({) - reserved(if) operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\)->)ident(nd_alen)operator(%)integer(2) operator(!=) integer(0)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) operator(()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(2)operator(\)])operator(.)ident(node)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(476)operator(:) -preprocessor(#line) integer(2430) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_concat)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(477)operator(:) -preprocessor(#line) integer(2436) string - operator({) - operator(()ident(yyval)operator(.)ident(node)operator(\)) operator(=) ident(list_append)operator(()ident(NEW_LIST)operator((()ident(yyvsp)operator([()integer(1)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\),) operator(()ident(yyvsp)operator([()integer(3)operator(\)) operator(-) operator(()integer(3)operator(\)])operator(.)ident(node)operator(\)\);) - operator(}) - reserved(break)operator(;) - - reserved(case) integer(497)operator(:) -preprocessor(#line) integer(2474) string - operator({)ident(yyerrok)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(500)operator(:) -preprocessor(#line) integer(2479) string - operator({)ident(yyerrok)operator(;}) - reserved(break)operator(;) - - reserved(case) integer(501)operator(:) -preprocessor(#line) integer(2482) string - operator({()ident(yyval)operator(.)ident(node)operator(\)) operator(=) integer(0)operator(;}) - reserved(break)operator(;) - - -comment(/* Line 1267 of yacc.c. */) -preprocessor(#line) integer(7259) string - reserved(default)operator(:) reserved(break)operator(;) - operator(}) - ident(YY_SYMBOL_PRINT) operator(()string $$ =)delimiter(")>operator(,) ident(yyr1)operator([)ident(yyn)operator(],) operator(&)ident(yyval)operator(,) operator(&)ident(yyloc)operator(\);) - - ident(YYPOPSTACK) operator(()ident(yylen)operator(\);) - ident(yylen) operator(=) integer(0)operator(;) - ident(YY_STACK_PRINT) operator(()ident(yyss)operator(,) ident(yyssp)operator(\);) - - operator(*++)ident(yyvsp) operator(=) ident(yyval)operator(;) - - - comment(/* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */) - - ident(yyn) operator(=) ident(yyr1)operator([)ident(yyn)operator(];) - - ident(yystate) operator(=) ident(yypgoto)operator([)ident(yyn) operator(-) ident(YYNTOKENS)operator(]) operator(+) operator(*)ident(yyssp)operator(;) - reserved(if) operator(()integer(0) operator(<=) ident(yystate) operator(&&) ident(yystate) operator(<=) ident(YYLAST) operator(&&) ident(yycheck)operator([)ident(yystate)operator(]) operator(==) operator(*)ident(yyssp)operator(\)) - ident(yystate) operator(=) ident(yytable)operator([)ident(yystate)operator(];) - reserved(else) - ident(yystate) operator(=) ident(yydefgoto)operator([)ident(yyn) operator(-) ident(YYNTOKENS)operator(];) - - reserved(goto) ident(yynewstate)operator(;) - - -comment(/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/) -label(yyerrlab:) - comment(/* If not already recovering from an error, report this error. */) - reserved(if) operator((!)ident(yyerrstatus)operator(\)) - operator({) - operator(++)ident(yynerrs)operator(;) -preprocessor(#if) operator(!) ident(YYERROR_VERBOSE) - ident(yyerror) operator(()ident(YY_)operator(()stringoperator(\)\);) -preprocessor(#else) - operator({) - ident(YYSIZE_T) ident(yysize) operator(=) ident(yysyntax_error) operator(()integer(0)operator(,) ident(yystate)operator(,) ident(yychar)operator(\);) - reserved(if) operator(()ident(yymsg_alloc) operator(<) ident(yysize) operator(&&) ident(yymsg_alloc) operator(<) ident(YYSTACK_ALLOC_MAXIMUM)operator(\)) - operator({) - ident(YYSIZE_T) ident(yyalloc) operator(=) integer(2) operator(*) ident(yysize)operator(;) - reserved(if) operator((!) operator(()ident(yysize) operator(<=) ident(yyalloc) operator(&&) ident(yyalloc) operator(<=) ident(YYSTACK_ALLOC_MAXIMUM)operator(\)\)) - ident(yyalloc) operator(=) ident(YYSTACK_ALLOC_MAXIMUM)operator(;) - reserved(if) operator(()ident(yymsg) operator(!=) ident(yymsgbuf)operator(\)) - ident(YYSTACK_FREE) operator(()ident(yymsg)operator(\);) - ident(yymsg) operator(=) operator(()pre_type(char) operator(*\)) ident(YYSTACK_ALLOC) operator(()ident(yyalloc)operator(\);) - reserved(if) operator(()ident(yymsg)operator(\)) - ident(yymsg_alloc) operator(=) ident(yyalloc)operator(;) - reserved(else) - operator({) - ident(yymsg) operator(=) ident(yymsgbuf)operator(;) - ident(yymsg_alloc) operator(=) reserved(sizeof) ident(yymsgbuf)operator(;) - operator(}) - operator(}) - - reserved(if) operator(()integer(0) operator(<) ident(yysize) operator(&&) ident(yysize) operator(<=) ident(yymsg_alloc)operator(\)) - operator({) - operator(()directive(void)operator(\)) ident(yysyntax_error) operator(()ident(yymsg)operator(,) ident(yystate)operator(,) ident(yychar)operator(\);) - ident(yyerror) operator(()ident(yymsg)operator(\);) - operator(}) - reserved(else) - operator({) - ident(yyerror) operator(()ident(YY_)operator(()stringoperator(\)\);) - reserved(if) operator(()ident(yysize) operator(!=) integer(0)operator(\)) - reserved(goto) ident(yyexhaustedlab)operator(;) - operator(}) - operator(}) -preprocessor(#endif) - operator(}) - - - - reserved(if) operator(()ident(yyerrstatus) operator(==) integer(3)operator(\)) - operator({) - comment(/* If just tried and failed to reuse look-ahead token after an - error, discard it. */) - - reserved(if) operator(()ident(yychar) operator(<=) ident(YYEOF)operator(\)) - operator({) - comment(/* Return failure if at end of input. */) - reserved(if) operator(()ident(yychar) operator(==) ident(YYEOF)operator(\)) - ident(YYABORT)operator(;) - operator(}) - reserved(else) - operator({) - ident(yydestruct) operator(()stringoperator(,) - ident(yytoken)operator(,) operator(&)ident(yylval)operator(\);) - ident(yychar) operator(=) ident(YYEMPTY)operator(;) - operator(}) - operator(}) - - comment(/* Else will try to reuse look-ahead token after shifting the error - token. */) - reserved(goto) ident(yyerrlab1)operator(;) - - -comment(/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/) -label(yyerrorlab:) - - comment(/* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */) - reserved(if) operator(()comment(/*CONSTCOND*/) integer(0)operator(\)) - reserved(goto) ident(yyerrorlab)operator(;) - - comment(/* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */) - ident(YYPOPSTACK) operator(()ident(yylen)operator(\);) - ident(yylen) operator(=) integer(0)operator(;) - ident(YY_STACK_PRINT) operator(()ident(yyss)operator(,) ident(yyssp)operator(\);) - ident(yystate) operator(=) operator(*)ident(yyssp)operator(;) - reserved(goto) ident(yyerrlab1)operator(;) - - -comment(/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/) -label(yyerrlab1:) - ident(yyerrstatus) operator(=) integer(3)operator(;) comment(/* Each real token shifted decrements this. */) - - reserved(for) operator((;;\)) - operator({) - ident(yyn) operator(=) ident(yypact)operator([)ident(yystate)operator(];) - reserved(if) operator(()ident(yyn) operator(!=) ident(YYPACT_NINF)operator(\)) - operator({) - ident(yyn) operator(+=) ident(YYTERROR)operator(;) - reserved(if) operator(()integer(0) operator(<=) ident(yyn) operator(&&) ident(yyn) operator(<=) ident(YYLAST) operator(&&) ident(yycheck)operator([)ident(yyn)operator(]) operator(==) ident(YYTERROR)operator(\)) - operator({) - ident(yyn) operator(=) ident(yytable)operator([)ident(yyn)operator(];) - reserved(if) operator(()integer(0) operator(<) ident(yyn)operator(\)) - reserved(break)operator(;) - operator(}) - operator(}) - - comment(/* Pop the current state because it cannot handle the error token. */) - reserved(if) operator(()ident(yyssp) operator(==) ident(yyss)operator(\)) - ident(YYABORT)operator(;) - - - ident(yydestruct) operator(()stringoperator(,) - ident(yystos)operator([)ident(yystate)operator(],) ident(yyvsp)operator(\);) - ident(YYPOPSTACK) operator(()integer(1)operator(\);) - ident(yystate) operator(=) operator(*)ident(yyssp)operator(;) - ident(YY_STACK_PRINT) operator(()ident(yyss)operator(,) ident(yyssp)operator(\);) - operator(}) - - reserved(if) operator(()ident(yyn) operator(==) ident(YYFINAL)operator(\)) - ident(YYACCEPT)operator(;) - - operator(*++)ident(yyvsp) operator(=) ident(yylval)operator(;) - - - comment(/* Shift the error token. */) - ident(YY_SYMBOL_PRINT) operator(()stringoperator(,) ident(yystos)operator([)ident(yyn)operator(],) ident(yyvsp)operator(,) ident(yylsp)operator(\);) - - ident(yystate) operator(=) ident(yyn)operator(;) - reserved(goto) ident(yynewstate)operator(;) - - -comment(/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/) -label(yyacceptlab:) - ident(yyresult) operator(=) integer(0)operator(;) - reserved(goto) ident(yyreturn)operator(;) - -comment(/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/) -label(yyabortlab:) - ident(yyresult) operator(=) integer(1)operator(;) - reserved(goto) ident(yyreturn)operator(;) - -preprocessor(#ifndef) ident(yyoverflow) -comment(/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/) -label(yyexhaustedlab:) - ident(yyerror) operator(()ident(YY_)operator(()stringoperator(\)\);) - ident(yyresult) operator(=) integer(2)operator(;) - comment(/* Fall through. */) -preprocessor(#endif) - -label(yyreturn:) - reserved(if) operator(()ident(yychar) operator(!=) ident(YYEOF) operator(&&) ident(yychar) operator(!=) ident(YYEMPTY)operator(\)) - ident(yydestruct) operator(()stringoperator(,) - ident(yytoken)operator(,) operator(&)ident(yylval)operator(\);) - comment(/* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */) - ident(YYPOPSTACK) operator(()ident(yylen)operator(\);) - ident(YY_STACK_PRINT) operator(()ident(yyss)operator(,) ident(yyssp)operator(\);) - reserved(while) operator(()ident(yyssp) operator(!=) ident(yyss)operator(\)) - operator({) - ident(yydestruct) operator(()stringoperator(,) - ident(yystos)operator([*)ident(yyssp)operator(],) ident(yyvsp)operator(\);) - ident(YYPOPSTACK) operator(()integer(1)operator(\);) - operator(}) -preprocessor(#ifndef) ident(yyoverflow) - reserved(if) operator(()ident(yyss) operator(!=) ident(yyssa)operator(\)) - ident(YYSTACK_FREE) operator(()ident(yyss)operator(\);) -preprocessor(#endif) -preprocessor(#if) ident(YYERROR_VERBOSE) - reserved(if) operator(()ident(yymsg) operator(!=) ident(yymsgbuf)operator(\)) - ident(YYSTACK_FREE) operator(()ident(yymsg)operator(\);) -preprocessor(#endif) - comment(/* Make sure YYID is used. */) - reserved(return) ident(YYID) operator(()ident(yyresult)operator(\);) -operator(}) - - -preprocessor(#line) integer(2484) string - -preprocessor(#ifdef) ident(yystacksize) -preprocessor(#undef) ident(YYMALLOC) -preprocessor(#endif) - -preprocessor(#include) include("regex.h") -preprocessor(#include) include("util.h") - -comment(/* We remove any previous definition of `SIGN_EXTEND_CHAR', - since ours (we hope\) works properly with all combinations of - machines, compilers, `char' and `unsigned char' argument types. - (Per Bothner suggested the basic approach.\) */) -preprocessor(#undef) ident(SIGN_EXTEND_CHAR) -preprocessor(#if) ident(__STDC__) -preprocessor(# define) ident(SIGN_EXTEND_CHAR)operator(()ident(c)operator(\)) operator((()pre_type(signed) pre_type(char)operator(\)()ident(c)operator(\)\)) -preprocessor(#else) comment(/* not __STDC__ */) -comment(/* As in Harbison and Steele. */) -preprocessor(# define) ident(SIGN_EXTEND_CHAR)operator(()ident(c)operator(\)) operator((((()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)) operator(^) integer(128)operator(\)) operator(-) integer(128)operator(\)) -preprocessor(#endif) -preprocessor(#define) ident(is_identchar)operator(()ident(c)operator(\)) operator(()ident(SIGN_EXTEND_CHAR)operator(()ident(c)operator(\)!=-)integer(1)operator(&&()ident(ISALNUM)operator(()ident(c)operator(\)) operator(||) operator(()ident(c)operator(\)) operator(==) char('_') operator(||) ident(ismbchar)operator(()ident(c)operator(\)\)\)) - -directive(static) pre_type(char) operator(*)ident(tokenbuf) operator(=) pre_constant(NULL)operator(;) -directive(static) pre_type(int) ident(tokidx)operator(,) ident(toksiz) operator(=) integer(0)operator(;) - -preprocessor(#define) ident(LEAVE_BS) integer(1) - -directive(static) ident(VALUE) operator((*)ident(lex_gets)operator(\)(\);) comment(/* gets function */) -directive(static) ident(VALUE) ident(lex_input)operator(;) comment(/* non-nil if File */) -directive(static) ident(VALUE) ident(lex_lastline)operator(;) comment(/* gc protect */) -directive(static) pre_type(char) operator(*)ident(lex_pbeg)operator(;) -directive(static) pre_type(char) operator(*)ident(lex_p)operator(;) -directive(static) pre_type(char) operator(*)ident(lex_pend)operator(;) - -directive(static) pre_type(int) -ident(yyerror)operator(()ident(msg)operator(\)) - directive(const) pre_type(char) operator(*)ident(msg)operator(;) -operator({) - directive(const) pre_type(int) ident(max_line_margin) operator(=) integer(30)operator(;) - directive(const) pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(pe)operator(;) - pre_type(char) operator(*)ident(buf)operator(;) - pre_type(int) ident(len)operator(,) ident(i)operator(;) - - ident(rb_compile_error)operator(()stringoperator(,) ident(msg)operator(\);) - ident(p) operator(=) ident(lex_p)operator(;) - reserved(while) operator(()ident(lex_pbeg) operator(<=) ident(p)operator(\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('\\n')operator(\)) reserved(break)operator(;) - ident(p)operator(--;) - operator(}) - ident(p)operator(++;) - - ident(pe) operator(=) ident(lex_p)operator(;) - reserved(while) operator(()ident(pe) operator(<) ident(lex_pend)operator(\)) operator({) - reserved(if) operator((*)ident(pe) operator(==) char('\\n')operator(\)) reserved(break)operator(;) - ident(pe)operator(++;) - operator(}) - - ident(len) operator(=) ident(pe) operator(-) ident(p)operator(;) - reserved(if) operator(()ident(len) operator(>) integer(4)operator(\)) operator({) - pre_type(char) operator(*)ident(p2)operator(;) - directive(const) pre_type(char) operator(*)ident(pre) operator(=) stringoperator(,) operator(*)ident(post) operator(=) stringoperator(;) - - reserved(if) operator(()ident(len) operator(>) ident(max_line_margin) operator(*) integer(2) operator(+) integer(10)operator(\)) operator({) - pre_type(int) ident(re_mbc_startpos) ident(_)operator((()directive(const) pre_type(char) operator(*,) pre_type(int)operator(,) pre_type(int)operator(,) pre_type(int)operator(\)\);) - reserved(if) operator((()ident(len) operator(=) ident(lex_p) operator(-) ident(p)operator(\)) operator(>) ident(max_line_margin)operator(\)) operator({) - ident(p) operator(=) ident(p) operator(+) ident(re_mbc_startpos)operator(()ident(p)operator(,) ident(len)operator(,) ident(len) operator(-) ident(max_line_margin)operator(,) integer(0)operator(\);) - ident(pre) operator(=) stringoperator(;) - operator(}) - reserved(if) operator((()ident(len) operator(=) ident(pe) operator(-) ident(lex_p)operator(\)) operator(>) ident(max_line_margin)operator(\)) operator({) - ident(pe) operator(=) ident(lex_p) operator(+) ident(re_mbc_startpos)operator(()ident(lex_p)operator(,) ident(len)operator(,) ident(max_line_margin)operator(,) integer(1)operator(\);) - ident(post) operator(=) stringoperator(;) - operator(}) - ident(len) operator(=) ident(pe) operator(-) ident(p)operator(;) - operator(}) - ident(buf) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(len)operator(+)integer(2)operator(\);) - ident(MEMCPY)operator(()ident(buf)operator(,) ident(p)operator(,) pre_type(char)operator(,) ident(len)operator(\);) - ident(buf)operator([)ident(len)operator(]) operator(=) char('\\0')operator(;) - ident(rb_compile_error_append)operator(()stringoperator(,) ident(pre)operator(,) ident(buf)operator(,) ident(post)operator(\);) - - ident(i) operator(=) ident(lex_p) operator(-) ident(p)operator(;) - ident(p2) operator(=) ident(buf)operator(;) ident(pe) operator(=) ident(buf) operator(+) ident(len)operator(;) - - reserved(while) operator(()ident(p2) operator(<) ident(pe)operator(\)) operator({) - reserved(if) operator((*)ident(p2) operator(!=) char('\\t')operator(\)) operator(*)ident(p2) operator(=) char(' ')operator(;) - ident(p2)operator(++;) - operator(}) - ident(buf)operator([)ident(i)operator(]) operator(=) char('^')operator(;) - ident(buf)operator([)ident(i)operator(+)integer(1)operator(]) operator(=) char('\\0')operator(;) - ident(rb_compile_error_append)operator(()stringoperator(,) ident(buf)operator(\);) - operator(}) - - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) pre_type(int) ident(heredoc_end)operator(;) - -pre_type(int) ident(ruby_in_compile) operator(=) integer(0)operator(;) -pre_type(int) ident(ruby__end__seen)operator(;) - -directive(static) ident(VALUE) ident(ruby_debug_lines)operator(;) -preprocessor(#ifdef) ident(YYMALLOC) -directive(static) ident(NODE) operator(*)ident(parser_heap)operator(;) -preprocessor(#endif) - -directive(static) ident(NODE)operator(*) -ident(yycompile)operator(()ident(f)operator(,) ident(line)operator(\)) - pre_type(char) operator(*)ident(f)operator(;) - pre_type(int) ident(line)operator(;) -operator({) - pre_type(int) ident(n)operator(;) - ident(NODE) operator(*)ident(node) operator(=) integer(0)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(vp)operator(,) operator(*)ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) - - ident(ruby_in_compile) operator(=) integer(1)operator(;) - reserved(if) operator((!)ident(compile_for_eval) operator(&&) ident(rb_safe_level)operator((\)) operator(==) integer(0) operator(&&) - ident(rb_const_defined)operator(()ident(rb_cObject)operator(,) ident(rb_intern)operator(()stringoperator(\)\)\)) operator({) - ident(VALUE) ident(hash)operator(,) ident(fname)operator(;) - - ident(hash) operator(=) ident(rb_const_get)operator(()ident(rb_cObject)operator(,) ident(rb_intern)operator(()stringoperator(\)\);) - reserved(if) operator(()ident(TYPE)operator(()ident(hash)operator(\)) operator(==) ident(T_HASH)operator(\)) operator({) - ident(fname) operator(=) ident(rb_str_new2)operator(()ident(f)operator(\);) - ident(ruby_debug_lines) operator(=) ident(rb_ary_new)operator((\);) - ident(rb_hash_aset)operator(()ident(hash)operator(,) ident(fname)operator(,) ident(ruby_debug_lines)operator(\);) - operator(}) - reserved(if) operator(()ident(line) operator(>) integer(1)operator(\)) operator({) - ident(VALUE) ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,)integer(0)operator(\);) - reserved(while) operator(()ident(line) operator(>) integer(1)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ruby_debug_lines)operator(,) ident(str)operator(\);) - ident(line)operator(--;) - operator(}) - operator(}) - operator(}) - - ident(ruby__end__seen) operator(=) integer(0)operator(;) - ident(ruby_eval_tree) operator(=) integer(0)operator(;) - ident(ruby_eval_tree_begin) operator(=) integer(0)operator(;) - ident(heredoc_end) operator(=) integer(0)operator(;) - ident(lex_strterm) operator(=) integer(0)operator(;) - ident(ruby_current_node) operator(=) integer(0)operator(;) - ident(ruby_sourcefile) operator(=) ident(rb_source_filename)operator(()ident(f)operator(\);) - ident(deferred_nodes) operator(=) integer(0)operator(;) - ident(n) operator(=) ident(yyparse)operator((\);) - ident(ruby_debug_lines) operator(=) integer(0)operator(;) - ident(compile_for_eval) operator(=) integer(0)operator(;) - ident(ruby_in_compile) operator(=) integer(0)operator(;) - ident(cond_stack) operator(=) integer(0)operator(;) - ident(cmdarg_stack) operator(=) integer(0)operator(;) - ident(command_start) operator(=) integer(1)operator(;) - ident(class_nest) operator(=) integer(0)operator(;) - ident(in_single) operator(=) integer(0)operator(;) - ident(in_def) operator(=) integer(0)operator(;) - ident(cur_mid) operator(=) integer(0)operator(;) - ident(deferred_nodes) operator(=) integer(0)operator(;) - - ident(vp) operator(=) ident(ruby_dyna_vars)operator(;) - ident(ruby_dyna_vars) operator(=) ident(vars)operator(;) - ident(lex_strterm) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(vp) operator(&&) ident(vp) operator(!=) ident(vars)operator(\)) operator({) - reserved(struct) ident(RVarmap) operator(*)ident(tmp) operator(=) ident(vp)operator(;) - ident(vp) operator(=) ident(vp)operator(->)ident(next)operator(;) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(tmp)operator(\);) - operator(}) - reserved(if) operator(()ident(n) operator(==) integer(0)operator(\)) ident(node) operator(=) ident(ruby_eval_tree)operator(;) - reserved(if) operator(()ident(ruby_nerrs)operator(\)) ident(ruby_eval_tree_begin) operator(=) integer(0)operator(;) - reserved(return) ident(node)operator(;) -operator(}) - -directive(static) pre_type(int) ident(lex_gets_ptr)operator(;) - -directive(static) ident(VALUE) -ident(lex_get_str)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - pre_type(char) operator(*)ident(beg)operator(,) operator(*)ident(end)operator(,) operator(*)ident(pend)operator(;) - - ident(beg) operator(=) ident(RSTRING)operator(()ident(s)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(lex_gets_ptr)operator(\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(s)operator(\)->)ident(len) operator(==) ident(lex_gets_ptr)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(beg) operator(+=) ident(lex_gets_ptr)operator(;) - operator(}) - ident(pend) operator(=) ident(RSTRING)operator(()ident(s)operator(\)->)ident(ptr) operator(+) ident(RSTRING)operator(()ident(s)operator(\)->)ident(len)operator(;) - ident(end) operator(=) ident(beg)operator(;) - reserved(while) operator(()ident(end) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator((*)ident(end)operator(++) operator(==) char('\\n')operator(\)) reserved(break)operator(;) - operator(}) - ident(lex_gets_ptr) operator(=) ident(end) operator(-) ident(RSTRING)operator(()ident(s)operator(\)->)ident(ptr)operator(;) - reserved(return) ident(rb_str_new)operator(()ident(beg)operator(,) ident(end) operator(-) ident(beg)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(lex_getline)operator((\)) -operator({) - ident(VALUE) ident(line) operator(=) operator((*)ident(lex_gets)operator(\)()ident(lex_input)operator(\);) - reserved(if) operator(()ident(ruby_debug_lines) operator(&&) operator(!)ident(NIL_P)operator(()ident(line)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(ruby_debug_lines)operator(,) ident(line)operator(\);) - operator(}) - reserved(return) ident(line)operator(;) -operator(}) - -ident(NODE)operator(*) -ident(rb_compile_string)operator(()ident(f)operator(,) ident(s)operator(,) ident(line)operator(\)) - directive(const) pre_type(char) operator(*)ident(f)operator(;) - ident(VALUE) ident(s)operator(;) - pre_type(int) ident(line)operator(;) -operator({) - ident(lex_gets) operator(=) ident(lex_get_str)operator(;) - ident(lex_gets_ptr) operator(=) integer(0)operator(;) - ident(lex_input) operator(=) ident(s)operator(;) - ident(lex_pbeg) operator(=) ident(lex_p) operator(=) ident(lex_pend) operator(=) integer(0)operator(;) - ident(ruby_sourceline) operator(=) ident(line) operator(-) integer(1)operator(;) - ident(compile_for_eval) operator(=) ident(ruby_in_eval)operator(;) - - reserved(return) ident(yycompile)operator(()ident(f)operator(,) ident(line)operator(\);) -operator(}) - -ident(NODE)operator(*) -ident(rb_compile_cstr)operator(()ident(f)operator(,) ident(s)operator(,) ident(len)operator(,) ident(line)operator(\)) - directive(const) pre_type(char) operator(*)ident(f)operator(,) operator(*)ident(s)operator(;) - pre_type(int) ident(len)operator(,) ident(line)operator(;) -operator({) - reserved(return) ident(rb_compile_string)operator(()ident(f)operator(,) ident(rb_str_new)operator(()ident(s)operator(,) ident(len)operator(\),) ident(line)operator(\);) -operator(}) - -ident(NODE)operator(*) -ident(rb_compile_file)operator(()ident(f)operator(,) ident(file)operator(,) ident(start)operator(\)) - directive(const) pre_type(char) operator(*)ident(f)operator(;) - ident(VALUE) ident(file)operator(;) - pre_type(int) ident(start)operator(;) -operator({) - ident(lex_gets) operator(=) ident(rb_io_gets)operator(;) - ident(lex_input) operator(=) ident(file)operator(;) - ident(lex_pbeg) operator(=) ident(lex_p) operator(=) ident(lex_pend) operator(=) integer(0)operator(;) - ident(ruby_sourceline) operator(=) ident(start) operator(-) integer(1)operator(;) - - reserved(return) ident(yycompile)operator(()ident(f)operator(,) ident(start)operator(\);) -operator(}) - -directive(static) directive(inline) pre_type(int) -ident(nextc)operator((\)) -operator({) - pre_type(int) ident(c)operator(;) - - reserved(if) operator(()ident(lex_p) operator(==) ident(lex_pend)operator(\)) operator({) - reserved(if) operator(()ident(lex_input)operator(\)) operator({) - ident(VALUE) ident(v) operator(=) ident(lex_getline)operator((\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(v)operator(\)\)) reserved(return) operator(-)integer(1)operator(;) - reserved(if) operator(()ident(heredoc_end) operator(>) integer(0)operator(\)) operator({) - ident(ruby_sourceline) operator(=) ident(heredoc_end)operator(;) - ident(heredoc_end) operator(=) integer(0)operator(;) - operator(}) - ident(ruby_sourceline)operator(++;) - ident(lex_pbeg) operator(=) ident(lex_p) operator(=) ident(RSTRING)operator(()ident(v)operator(\)->)ident(ptr)operator(;) - ident(lex_pend) operator(=) ident(lex_p) operator(+) ident(RSTRING)operator(()ident(v)operator(\)->)ident(len)operator(;) - ident(lex_lastline) operator(=) ident(v)operator(;) - operator(}) - reserved(else) operator({) - ident(lex_lastline) operator(=) integer(0)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - operator(}) - ident(c) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)*)ident(lex_p)operator(++;) - reserved(if) operator(()ident(c) operator(==) char('\\r') operator(&&) ident(lex_p) operator(<) ident(lex_pend) operator(&&) operator(*)ident(lex_p) operator(==) char('\\n')operator(\)) operator({) - ident(lex_p)operator(++;) - ident(c) operator(=) char('\\n')operator(;) - operator(}) - - reserved(return) ident(c)operator(;) -operator(}) - -directive(static) directive(void) -ident(pushback)operator(()ident(c)operator(\)) - pre_type(int) ident(c)operator(;) -operator({) - reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) reserved(return)operator(;) - ident(lex_p)operator(--;) -operator(}) - -preprocessor(#define) ident(was_bol)operator((\)) operator(()ident(lex_p) operator(==) ident(lex_pbeg) operator(+) integer(1)operator(\)) -preprocessor(#define) ident(peek)operator(()ident(c)operator(\)) operator(()ident(lex_p) operator(!=) ident(lex_pend) operator(&&) operator(()ident(c)operator(\)) operator(==) operator(*)ident(lex_p)operator(\)) - -preprocessor(#define) ident(tokfix)operator((\)) operator(()ident(tokenbuf)operator([)ident(tokidx)operator(]=)char('\\0')operator(\)) -preprocessor(#define) ident(tok)operator((\)) ident(tokenbuf) -preprocessor(#define) ident(toklen)operator((\)) ident(tokidx) -preprocessor(#define) ident(toklast)operator((\)) operator(()ident(tokidx)operator(>)integer(0)operator(?)ident(tokenbuf)operator([)ident(tokidx)operator(-)integer(1)operator(]:)integer(0)operator(\)) - -directive(static) pre_type(char)operator(*) -ident(newtok)operator((\)) -operator({) - ident(tokidx) operator(=) integer(0)operator(;) - reserved(if) operator((!)ident(tokenbuf)operator(\)) operator({) - ident(toksiz) operator(=) integer(60)operator(;) - ident(tokenbuf) operator(=) ident(ALLOC_N)operator(()pre_type(char)operator(,) integer(60)operator(\);) - operator(}) - reserved(if) operator(()ident(toksiz) operator(>) integer(4096)operator(\)) operator({) - ident(toksiz) operator(=) integer(60)operator(;) - ident(REALLOC_N)operator(()ident(tokenbuf)operator(,) pre_type(char)operator(,) integer(60)operator(\);) - operator(}) - reserved(return) ident(tokenbuf)operator(;) -operator(}) - -directive(static) directive(void) -ident(tokadd)operator(()ident(c)operator(\)) - pre_type(char) ident(c)operator(;) -operator({) - ident(tokenbuf)operator([)ident(tokidx)operator(++]) operator(=) ident(c)operator(;) - reserved(if) operator(()ident(tokidx) operator(>=) ident(toksiz)operator(\)) operator({) - ident(toksiz) operator(*=) integer(2)operator(;) - ident(REALLOC_N)operator(()ident(tokenbuf)operator(,) pre_type(char)operator(,) ident(toksiz)operator(\);) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(read_escape)operator((\)) -operator({) - pre_type(int) ident(c)operator(;) - - reserved(switch) operator(()ident(c) operator(=) ident(nextc)operator((\)\)) operator({) - reserved(case) char('\\\\')operator(:) comment(/* Backslash */) - reserved(return) ident(c)operator(;) - - reserved(case) char('n')operator(:) comment(/* newline */) - reserved(return) char('\\n')operator(;) - - reserved(case) char('t')operator(:) comment(/* horizontal tab */) - reserved(return) char('\\t')operator(;) - - reserved(case) char('r')operator(:) comment(/* carriage-return */) - reserved(return) char('\\r')operator(;) - - reserved(case) char('f')operator(:) comment(/* form-feed */) - reserved(return) char('\\f')operator(;) - - reserved(case) char('v')operator(:) comment(/* vertical tab */) - reserved(return) char('\\13')operator(;) - - reserved(case) char('a')operator(:) comment(/* alarm(bell\) */) - reserved(return) char('\\007')operator(;) - - reserved(case) char('e')operator(:) comment(/* escape */) - reserved(return) oct(033)operator(;) - - reserved(case) char('0')operator(:) reserved(case) char('1')operator(:) reserved(case) char('2')operator(:) reserved(case) char('3')operator(:) comment(/* octal constant */) - reserved(case) char('4')operator(:) reserved(case) char('5')operator(:) reserved(case) char('6')operator(:) reserved(case) char('7')operator(:) - operator({) - pre_type(int) ident(numlen)operator(;) - - ident(pushback)operator(()ident(c)operator(\);) - ident(c) operator(=) ident(scan_oct)operator(()ident(lex_p)operator(,) integer(3)operator(,) operator(&)ident(numlen)operator(\);) - ident(lex_p) operator(+=) ident(numlen)operator(;) - operator(}) - reserved(return) ident(c)operator(;) - - reserved(case) char('x')operator(:) comment(/* hex constant */) - operator({) - pre_type(int) ident(numlen)operator(;) - - ident(c) operator(=) ident(scan_hex)operator(()ident(lex_p)operator(,) integer(2)operator(,) operator(&)ident(numlen)operator(\);) - reserved(if) operator(()ident(numlen) operator(==) integer(0)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - reserved(return) integer(0)operator(;) - operator(}) - ident(lex_p) operator(+=) ident(numlen)operator(;) - operator(}) - reserved(return) ident(c)operator(;) - - reserved(case) char('b')operator(:) comment(/* backspace */) - reserved(return) char('\\010')operator(;) - - reserved(case) char('s')operator(:) comment(/* space */) - reserved(return) char(' ')operator(;) - - reserved(case) char('M')operator(:) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) char('-')operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('\\0')operator(;) - operator(}) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('\\\\')operator(\)) operator({) - reserved(return) ident(read_escape)operator((\)) operator(|) hex(0x80)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(eof)operator(;) - reserved(else) operator({) - reserved(return) operator((()ident(c) operator(&) hex(0xff)operator(\)) operator(|) hex(0x80)operator(\);) - operator(}) - - reserved(case) char('C')operator(:) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) char('-')operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('\\0')operator(;) - operator(}) - reserved(case) char('c')operator(:) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)==) char('\\\\')operator(\)) operator({) - ident(c) operator(=) ident(read_escape)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('?')operator(\)) - reserved(return) oct(0177)operator(;) - reserved(else) reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(eof)operator(;) - reserved(return) ident(c) operator(&) hex(0x9f)operator(;) - - label(eof:) - reserved(case) operator(-)integer(1)operator(:) - ident(yyerror)operator(()stringoperator(\);) - reserved(return) char('\\0')operator(;) - - reserved(default)operator(:) - reserved(return) ident(c)operator(;) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(tokadd_escape)operator(()ident(term)operator(\)) - pre_type(int) ident(term)operator(;) -operator({) - pre_type(int) ident(c)operator(;) - - reserved(switch) operator(()ident(c) operator(=) ident(nextc)operator((\)\)) operator({) - reserved(case) char('\\n')operator(:) - reserved(return) integer(0)operator(;) comment(/* just ignore */) - - reserved(case) char('0')operator(:) reserved(case) char('1')operator(:) reserved(case) char('2')operator(:) reserved(case) char('3')operator(:) comment(/* octal constant */) - reserved(case) char('4')operator(:) reserved(case) char('5')operator(:) reserved(case) char('6')operator(:) reserved(case) char('7')operator(:) - operator({) - pre_type(int) ident(i)operator(;) - - ident(tokadd)operator(()char('\\\\')operator(\);) - ident(tokadd)operator(()ident(c)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)integer(2)operator(;) ident(i)operator(++\)) operator({) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(eof)operator(;) - reserved(if) operator(()ident(c) operator(<) char('0') operator(||) char('7') operator(<) ident(c)operator(\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(break)operator(;) - operator(}) - ident(tokadd)operator(()ident(c)operator(\);) - operator(}) - operator(}) - reserved(return) integer(0)operator(;) - - reserved(case) char('x')operator(:) comment(/* hex constant */) - operator({) - pre_type(int) ident(numlen)operator(;) - - ident(tokadd)operator(()char('\\\\')operator(\);) - ident(tokadd)operator(()ident(c)operator(\);) - ident(scan_hex)operator(()ident(lex_p)operator(,) integer(2)operator(,) operator(&)ident(numlen)operator(\);) - reserved(if) operator(()ident(numlen) operator(==) integer(0)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(while) operator(()ident(numlen)operator(--\)) - ident(tokadd)operator(()ident(nextc)operator((\)\);) - operator(}) - reserved(return) integer(0)operator(;) - - reserved(case) char('M')operator(:) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) char('-')operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) integer(0)operator(;) - operator(}) - ident(tokadd)operator(()char('\\\\')operator(\);) ident(tokadd)operator(()char('M')operator(\);) ident(tokadd)operator(()char('-')operator(\);) - reserved(goto) ident(escaped)operator(;) - - reserved(case) char('C')operator(:) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) char('-')operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) integer(0)operator(;) - operator(}) - ident(tokadd)operator(()char('\\\\')operator(\);) ident(tokadd)operator(()char('C')operator(\);) ident(tokadd)operator(()char('-')operator(\);) - reserved(goto) ident(escaped)operator(;) - - reserved(case) char('c')operator(:) - ident(tokadd)operator(()char('\\\\')operator(\);) ident(tokadd)operator(()char('c')operator(\);) - label(escaped:) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('\\\\')operator(\)) operator({) - reserved(return) ident(tokadd_escape)operator(()ident(term)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(eof)operator(;) - ident(tokadd)operator(()ident(c)operator(\);) - reserved(return) integer(0)operator(;) - - label(eof:) - reserved(case) operator(-)integer(1)operator(:) - ident(yyerror)operator(()stringoperator(\);) - reserved(return) operator(-)integer(1)operator(;) - - reserved(default)operator(:) - reserved(if) operator(()ident(c) operator(!=) char('\\\\') operator(||) ident(c) operator(!=) ident(term)operator(\)) - ident(tokadd)operator(()char('\\\\')operator(\);) - ident(tokadd)operator(()ident(c)operator(\);) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(regx_options)operator((\)) -operator({) - pre_type(char) ident(kcode) operator(=) integer(0)operator(;) - pre_type(int) ident(options) operator(=) integer(0)operator(;) - pre_type(int) ident(c)operator(;) - - ident(newtok)operator((\);) - reserved(while) operator(()ident(c) operator(=) ident(nextc)operator((\),) ident(ISALPHA)operator(()ident(c)operator(\)\)) operator({) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('i')operator(:) - ident(options) operator(|=) ident(RE_OPTION_IGNORECASE)operator(;) - reserved(break)operator(;) - reserved(case) char('x')operator(:) - ident(options) operator(|=) ident(RE_OPTION_EXTENDED)operator(;) - reserved(break)operator(;) - reserved(case) char('m')operator(:) - ident(options) operator(|=) ident(RE_OPTION_MULTILINE)operator(;) - reserved(break)operator(;) - reserved(case) char('o')operator(:) - ident(options) operator(|=) ident(RE_OPTION_ONCE)operator(;) - reserved(break)operator(;) - reserved(case) char('n')operator(:) - ident(kcode) operator(=) integer(16)operator(;) - reserved(break)operator(;) - reserved(case) char('e')operator(:) - ident(kcode) operator(=) integer(32)operator(;) - reserved(break)operator(;) - reserved(case) char('s')operator(:) - ident(kcode) operator(=) integer(48)operator(;) - reserved(break)operator(;) - reserved(case) char('u')operator(:) - ident(kcode) operator(=) integer(64)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(tokadd)operator(()ident(c)operator(\);) - reserved(break)operator(;) - operator(}) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(toklen)operator((\)\)) operator({) - ident(tokfix)operator((\);) - ident(rb_compile_error)operator(()stringoperator(,) - ident(toklen)operator((\)) operator(>) integer(1) operator(?) string operator(:) stringoperator(,) ident(tok)operator((\)\);) - operator(}) - reserved(return) ident(options) operator(|) ident(kcode)operator(;) -operator(}) - -preprocessor(#define) ident(STR_FUNC_ESCAPE) hex(0x01) -preprocessor(#define) ident(STR_FUNC_EXPAND) hex(0x02) -preprocessor(#define) ident(STR_FUNC_REGEXP) hex(0x04) -preprocessor(#define) ident(STR_FUNC_QWORDS) hex(0x08) -preprocessor(#define) ident(STR_FUNC_SYMBOL) hex(0x10) -preprocessor(#define) ident(STR_FUNC_INDENT) hex(0x20) - -reserved(enum) ident(string_type) operator({) - ident(str_squote) operator(=) operator(()integer(0)operator(\),) - ident(str_dquote) operator(=) operator(()ident(STR_FUNC_EXPAND)operator(\),) - ident(str_xquote) operator(=) operator(()ident(STR_FUNC_EXPAND)operator(\),) - ident(str_regexp) operator(=) operator(()ident(STR_FUNC_REGEXP)operator(|)ident(STR_FUNC_ESCAPE)operator(|)ident(STR_FUNC_EXPAND)operator(\),) - ident(str_sword) operator(=) operator(()ident(STR_FUNC_QWORDS)operator(\),) - ident(str_dword) operator(=) operator(()ident(STR_FUNC_QWORDS)operator(|)ident(STR_FUNC_EXPAND)operator(\),) - ident(str_ssym) operator(=) operator(()ident(STR_FUNC_SYMBOL)operator(\),) - ident(str_dsym) operator(=) operator(()ident(STR_FUNC_SYMBOL)operator(|)ident(STR_FUNC_EXPAND)operator(\),) -operator(};) - -directive(static) directive(void) -ident(dispose_string)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(xfree)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - ident(rb_gc_force_recycle)operator(()ident(str)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(tokadd_string)operator(()ident(func)operator(,) ident(term)operator(,) ident(paren)operator(,) ident(nest)operator(\)) - pre_type(int) ident(func)operator(,) ident(term)operator(,) ident(paren)operator(,) operator(*)ident(nest)operator(;) -operator({) - pre_type(int) ident(c)operator(;) - - reserved(while) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) operator(-)integer(1)operator(\)) operator({) - reserved(if) operator(()ident(paren) operator(&&) ident(c) operator(==) ident(paren)operator(\)) operator({) - operator(++*)ident(nest)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) ident(term)operator(\)) operator({) - reserved(if) operator((!)ident(nest) operator(||) operator(!*)ident(nest)operator(\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(break)operator(;) - operator(}) - operator(--*)ident(nest)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(func) operator(&) ident(STR_FUNC_EXPAND)operator(\)) operator(&&) ident(c) operator(==) char('#') operator(&&) ident(lex_p) operator(<) ident(lex_pend)operator(\)) operator({) - pre_type(int) ident(c2) operator(=) operator(*)ident(lex_p)operator(;) - reserved(if) operator(()ident(c2) operator(==) char('$') operator(||) ident(c2) operator(==) char('@') operator(||) ident(c2) operator(==) char('{')operator(\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\\\')operator(\)) operator({) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('\\n')operator(:) - reserved(if) operator(()ident(func) operator(&) ident(STR_FUNC_QWORDS)operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(func) operator(&) ident(STR_FUNC_EXPAND)operator(\)) reserved(continue)operator(;) - ident(tokadd)operator(()char('\\\\')operator(\);) - reserved(break)operator(;) - - reserved(case) char('\\\\')operator(:) - reserved(if) operator(()ident(func) operator(&) ident(STR_FUNC_ESCAPE)operator(\)) ident(tokadd)operator(()ident(c)operator(\);) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(if) operator(()ident(func) operator(&) ident(STR_FUNC_REGEXP)operator(\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(tokadd_escape)operator(()ident(term)operator(\)) operator(<) integer(0)operator(\)) - reserved(return) operator(-)integer(1)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(func) operator(&) ident(STR_FUNC_EXPAND)operator(\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(func) operator(&) ident(STR_FUNC_ESCAPE)operator(\)) ident(tokadd)operator(()char('\\\\')operator(\);) - ident(c) operator(=) ident(read_escape)operator((\);) - operator(}) - reserved(else) reserved(if) operator((()ident(func) operator(&) ident(STR_FUNC_QWORDS)operator(\)) operator(&&) ident(ISSPACE)operator(()ident(c)operator(\)\)) operator({) - comment(/* ignore backslashed spaces in %w */) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(!=) ident(term) operator(&&) operator(!()ident(paren) operator(&&) ident(c) operator(==) ident(paren)operator(\)\)) operator({) - ident(tokadd)operator(()char('\\\\')operator(\);) - operator(}) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - pre_type(int) ident(i)operator(,) ident(len) operator(=) ident(mbclen)operator(()ident(c)operator(\)-)integer(1)operator(;) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(tokadd)operator(()ident(c)operator(\);) - ident(c) operator(=) ident(nextc)operator((\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator((()ident(func) operator(&) ident(STR_FUNC_QWORDS)operator(\)) operator(&&) ident(ISSPACE)operator(()ident(c)operator(\)\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(if) operator((!)ident(c) operator(&&) operator(()ident(func) operator(&) ident(STR_FUNC_SYMBOL)operator(\)\)) operator({) - ident(func) operator(&=) operator(~)ident(STR_FUNC_SYMBOL)operator(;) - ident(rb_compile_error)operator(()stringoperator(\);) - reserved(continue)operator(;) - operator(}) - ident(tokadd)operator(()ident(c)operator(\);) - operator(}) - reserved(return) ident(c)operator(;) -operator(}) - -preprocessor(#define) ident(NEW_STRTERM)operator(()ident(func)operator(,) ident(term)operator(,) ident(paren)operator(\)) \ - ident(rb_node_newnode)operator(()ident(NODE_STRTERM)operator(,) operator(()ident(func)operator(\),) operator(()ident(term)operator(\)) operator(|) operator((()ident(paren)operator(\)) operator(<<) operator(()ident(CHAR_BIT) operator(*) integer(2)operator(\)\),) integer(0)operator(\)) - -directive(static) pre_type(int) -ident(parse_string)operator(()ident(quote)operator(\)) - ident(NODE) operator(*)ident(quote)operator(;) -operator({) - pre_type(int) ident(func) operator(=) ident(quote)operator(->)ident(nd_func)operator(;) - pre_type(int) ident(term) operator(=) ident(nd_term)operator(()ident(quote)operator(\);) - pre_type(int) ident(paren) operator(=) ident(nd_paren)operator(()ident(quote)operator(\);) - pre_type(int) ident(c)operator(,) ident(space) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(func) operator(==) operator(-)integer(1)operator(\)) reserved(return) ident(tSTRING_END)operator(;) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator((()ident(func) operator(&) ident(STR_FUNC_QWORDS)operator(\)) operator(&&) ident(ISSPACE)operator(()ident(c)operator(\)\)) operator({) - reserved(do) operator({)ident(c) operator(=) ident(nextc)operator((\);}) reserved(while) operator(()ident(ISSPACE)operator(()ident(c)operator(\)\);) - ident(space) operator(=) integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) ident(term) operator(&&) operator(!)ident(quote)operator(->)ident(nd_nest)operator(\)) operator({) - reserved(if) operator(()ident(func) operator(&) ident(STR_FUNC_QWORDS)operator(\)) operator({) - ident(quote)operator(->)ident(nd_func) operator(=) operator(-)integer(1)operator(;) - reserved(return) char(' ')operator(;) - operator(}) - reserved(if) operator((!()ident(func) operator(&) ident(STR_FUNC_REGEXP)operator(\)\)) reserved(return) ident(tSTRING_END)operator(;) - ident(yylval)operator(.)ident(num) operator(=) ident(regx_options)operator((\);) - reserved(return) ident(tREGEXP_END)operator(;) - operator(}) - reserved(if) operator(()ident(space)operator(\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char(' ')operator(;) - operator(}) - ident(newtok)operator((\);) - reserved(if) operator((()ident(func) operator(&) ident(STR_FUNC_EXPAND)operator(\)) operator(&&) ident(c) operator(==) char('#')operator(\)) operator({) - reserved(switch) operator(()ident(c) operator(=) ident(nextc)operator((\)\)) operator({) - reserved(case) char('$')operator(:) - reserved(case) char('@')operator(:) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tSTRING_DVAR)operator(;) - reserved(case) char('{')operator(:) - reserved(return) ident(tSTRING_DBEG)operator(;) - operator(}) - ident(tokadd)operator(()char('#')operator(\);) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(tokadd_string)operator(()ident(func)operator(,) ident(term)operator(,) ident(paren)operator(,) operator(&)ident(quote)operator(->)ident(nd_nest)operator(\)) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(ruby_sourceline) operator(=) ident(nd_line)operator(()ident(quote)operator(\);) - ident(rb_compile_error)operator(()stringoperator(\);) - reserved(return) ident(tSTRING_END)operator(;) - operator(}) - - ident(tokfix)operator((\);) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_STR)operator(()ident(rb_str_new)operator(()ident(tok)operator((\),) ident(toklen)operator((\)\)\);) - reserved(return) ident(tSTRING_CONTENT)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(heredoc_identifier)operator((\)) -operator({) - pre_type(int) ident(c) operator(=) ident(nextc)operator((\),) ident(term)operator(,) ident(func) operator(=) integer(0)operator(,) ident(len)operator(;) - - reserved(if) operator(()ident(c) operator(==) char('-')operator(\)) operator({) - ident(c) operator(=) ident(nextc)operator((\);) - ident(func) operator(=) ident(STR_FUNC_INDENT)operator(;) - operator(}) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('\\'')operator(:) - ident(func) operator(|=) ident(str_squote)operator(;) reserved(goto) ident(quoted)operator(;) - reserved(case) char('"')operator(:) - ident(func) operator(|=) ident(str_dquote)operator(;) reserved(goto) ident(quoted)operator(;) - reserved(case) char('`')operator(:) - ident(func) operator(|=) ident(str_xquote)operator(;) - label(quoted:) - ident(newtok)operator((\);) - ident(tokadd)operator(()ident(func)operator(\);) - ident(term) operator(=) ident(c)operator(;) - reserved(while) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) operator(-)integer(1) operator(&&) ident(c) operator(!=) ident(term)operator(\)) operator({) - ident(len) operator(=) ident(mbclen)operator(()ident(c)operator(\);) - reserved(do) operator({)ident(tokadd)operator(()ident(c)operator(\);}) reserved(while) operator((--)ident(len) operator(>) integer(0) operator(&&) operator(()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) operator(-)integer(1)operator(\);) - operator(}) - reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_compile_error)operator(()stringoperator(\);) - reserved(return) integer(0)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(if) operator((!)ident(is_identchar)operator(()ident(c)operator(\)\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(func) operator(&) ident(STR_FUNC_INDENT)operator(\)) operator({) - ident(pushback)operator(()char('-')operator(\);) - operator(}) - reserved(return) integer(0)operator(;) - operator(}) - ident(newtok)operator((\);) - ident(term) operator(=) char('"')operator(;) - ident(tokadd)operator(()ident(func) operator(|=) ident(str_dquote)operator(\);) - reserved(do) operator({) - ident(len) operator(=) ident(mbclen)operator(()ident(c)operator(\);) - reserved(do) operator({)ident(tokadd)operator(()ident(c)operator(\);}) reserved(while) operator((--)ident(len) operator(>) integer(0) operator(&&) operator(()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) operator(-)integer(1)operator(\);) - operator(}) reserved(while) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) operator(-)integer(1) operator(&&) ident(is_identchar)operator(()ident(c)operator(\)\);) - ident(pushback)operator(()ident(c)operator(\);) - reserved(break)operator(;) - operator(}) - - ident(tokfix)operator((\);) - ident(len) operator(=) ident(lex_p) operator(-) ident(lex_pbeg)operator(;) - ident(lex_p) operator(=) ident(lex_pend)operator(;) - ident(lex_strterm) operator(=) ident(rb_node_newnode)operator(()ident(NODE_HEREDOC)operator(,) - ident(rb_str_new)operator(()ident(tok)operator((\),) ident(toklen)operator((\)\),) comment(/* nd_lit */) - ident(len)operator(,) comment(/* nd_nth */) - ident(lex_lastline)operator(\);) comment(/* nd_orig */) - reserved(return) ident(term) operator(==) char('`') operator(?) ident(tXSTRING_BEG) operator(:) ident(tSTRING_BEG)operator(;) -operator(}) - -directive(static) directive(void) -ident(heredoc_restore)operator(()ident(here)operator(\)) - ident(NODE) operator(*)ident(here)operator(;) -operator({) - ident(VALUE) ident(line) operator(=) ident(here)operator(->)ident(nd_orig)operator(;) - ident(lex_lastline) operator(=) ident(line)operator(;) - ident(lex_pbeg) operator(=) ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr)operator(;) - ident(lex_pend) operator(=) ident(lex_pbeg) operator(+) ident(RSTRING)operator(()ident(line)operator(\)->)ident(len)operator(;) - ident(lex_p) operator(=) ident(lex_pbeg) operator(+) ident(here)operator(->)ident(nd_nth)operator(;) - ident(heredoc_end) operator(=) ident(ruby_sourceline)operator(;) - ident(ruby_sourceline) operator(=) ident(nd_line)operator(()ident(here)operator(\);) - ident(dispose_string)operator(()ident(here)operator(->)ident(nd_lit)operator(\);) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(here)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(whole_match_p)operator(()ident(eos)operator(,) ident(len)operator(,) ident(indent)operator(\)) - pre_type(char) operator(*)ident(eos)operator(;) - pre_type(int) ident(len)operator(,) ident(indent)operator(;) -operator({) - pre_type(char) operator(*)ident(p) operator(=) ident(lex_pbeg)operator(;) - pre_type(int) ident(n)operator(;) - - reserved(if) operator(()ident(indent)operator(\)) operator({) - reserved(while) operator((*)ident(p) operator(&&) ident(ISSPACE)operator((*)ident(p)operator(\)\)) ident(p)operator(++;) - operator(}) - ident(n)operator(=) ident(lex_pend) operator(-) operator(()ident(p) operator(+) ident(len)operator(\);) - reserved(if) operator(()ident(n) operator(<) integer(0) operator(||) operator(()ident(n) operator(>) integer(0) operator(&&) ident(p)operator([)ident(len)operator(]) operator(!=) char('\\n') operator(&&) ident(p)operator([)ident(len)operator(]) operator(!=) char('\\r')operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(strncmp)operator(()ident(eos)operator(,) ident(p)operator(,) ident(len)operator(\)) operator(==) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(here_document)operator(()ident(here)operator(\)) - ident(NODE) operator(*)ident(here)operator(;) -operator({) - pre_type(int) ident(c)operator(,) ident(func)operator(,) ident(indent) operator(=) integer(0)operator(;) - pre_type(char) operator(*)ident(eos)operator(,) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - pre_type(long) ident(len)operator(;) - ident(VALUE) ident(str) operator(=) integer(0)operator(;) - - ident(eos) operator(=) ident(RSTRING)operator(()ident(here)operator(->)ident(nd_lit)operator(\)->)ident(ptr)operator(;) - ident(len) operator(=) ident(RSTRING)operator(()ident(here)operator(->)ident(nd_lit)operator(\)->)ident(len) operator(-) integer(1)operator(;) - ident(indent) operator(=) operator(()ident(func) operator(=) operator(*)ident(eos)operator(++\)) operator(&) ident(STR_FUNC_INDENT)operator(;) - - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) operator(-)integer(1)operator(\)) operator({) - label(error:) - ident(rb_compile_error)operator(()stringoperator(,) ident(eos)operator(\);) - ident(heredoc_restore)operator(()ident(lex_strterm)operator(\);) - ident(lex_strterm) operator(=) integer(0)operator(;) - reserved(return) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(was_bol)operator((\)) operator(&&) ident(whole_match_p)operator(()ident(eos)operator(,) ident(len)operator(,) ident(indent)operator(\)\)) operator({) - ident(heredoc_restore)operator(()ident(lex_strterm)operator(\);) - reserved(return) ident(tSTRING_END)operator(;) - operator(}) - - reserved(if) operator((!()ident(func) operator(&) ident(STR_FUNC_EXPAND)operator(\)\)) operator({) - reserved(do) operator({) - ident(p) operator(=) ident(RSTRING)operator(()ident(lex_lastline)operator(\)->)ident(ptr)operator(;) - ident(pend) operator(=) ident(lex_pend)operator(;) - reserved(if) operator(()ident(pend) operator(>) ident(p)operator(\)) operator({) - reserved(switch) operator(()ident(pend)operator([-)integer(1)operator(]\)) operator({) - reserved(case) char('\\n')operator(:) - reserved(if) operator((--)ident(pend) operator(==) ident(p) operator(||) ident(pend)operator([-)integer(1)operator(]) operator(!=) char('\\r')operator(\)) operator({) - ident(pend)operator(++;) - reserved(break)operator(;) - operator(}) - reserved(case) char('\\r')operator(:) - operator(--)ident(pend)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(str)operator(\)) - ident(rb_str_cat)operator(()ident(str)operator(,) ident(p)operator(,) ident(pend) operator(-) ident(p)operator(\);) - reserved(else) - ident(str) operator(=) ident(rb_str_new)operator(()ident(p)operator(,) ident(pend) operator(-) ident(p)operator(\);) - reserved(if) operator(()ident(pend) operator(<) ident(lex_pend)operator(\)) ident(rb_str_cat)operator(()ident(str)operator(,) stringoperator(,) integer(1)operator(\);) - ident(lex_p) operator(=) ident(lex_pend)operator(;) - reserved(if) operator(()ident(nextc)operator((\)) operator(==) operator(-)integer(1)operator(\)) operator({) - reserved(if) operator(()ident(str)operator(\)) ident(dispose_string)operator(()ident(str)operator(\);) - reserved(goto) ident(error)operator(;) - operator(}) - operator(}) reserved(while) operator((!)ident(whole_match_p)operator(()ident(eos)operator(,) ident(len)operator(,) ident(indent)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(newtok)operator((\);) - reserved(if) operator(()ident(c) operator(==) char('#')operator(\)) operator({) - reserved(switch) operator(()ident(c) operator(=) ident(nextc)operator((\)\)) operator({) - reserved(case) char('$')operator(:) - reserved(case) char('@')operator(:) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tSTRING_DVAR)operator(;) - reserved(case) char('{')operator(:) - reserved(return) ident(tSTRING_DBEG)operator(;) - operator(}) - ident(tokadd)operator(()char('#')operator(\);) - operator(}) - reserved(do) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator((()ident(c) operator(=) ident(tokadd_string)operator(()ident(func)operator(,) char('\\n')operator(,) integer(0)operator(,) pre_constant(NULL)operator(\)\)) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(error)operator(;) - reserved(if) operator(()ident(c) operator(!=) char('\\n')operator(\)) operator({) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_STR)operator(()ident(rb_str_new)operator(()ident(tok)operator((\),) ident(toklen)operator((\)\)\);) - reserved(return) ident(tSTRING_CONTENT)operator(;) - operator(}) - ident(tokadd)operator(()ident(nextc)operator((\)\);) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) operator(-)integer(1)operator(\)) reserved(goto) ident(error)operator(;) - operator(}) reserved(while) operator((!)ident(whole_match_p)operator(()ident(eos)operator(,) ident(len)operator(,) ident(indent)operator(\)\);) - ident(str) operator(=) ident(rb_str_new)operator(()ident(tok)operator((\),) ident(toklen)operator((\)\);) - operator(}) - ident(heredoc_restore)operator(()ident(lex_strterm)operator(\);) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator((-)integer(1)operator(,) integer(0)operator(,) integer(0)operator(\);) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_STR)operator(()ident(str)operator(\);) - reserved(return) ident(tSTRING_CONTENT)operator(;) -operator(}) - -preprocessor(#include) include("lex.c") - -directive(static) directive(void) -ident(arg_ambiguous)operator((\)) -operator({) - ident(rb_warning)operator(()stringoperator(\);) -operator(}) - -preprocessor(#define) ident(IS_ARG)operator((\)) operator(()ident(lex_state) operator(==) ident(EXPR_ARG) operator(||) ident(lex_state) operator(==) ident(EXPR_CMDARG)operator(\)) -preprocessor(#define) ident(IS_BEG)operator((\)) operator(()ident(lex_state) operator(==) ident(EXPR_BEG) operator(||) ident(lex_state) operator(==) ident(EXPR_MID) operator(||) ident(lex_state) operator(==) ident(EXPR_CLASS)operator(\)) - -directive(static) pre_type(int) -ident(yylex)operator((\)) -operator({) - directive(register) pre_type(int) ident(c)operator(;) - pre_type(int) ident(space_seen) operator(=) integer(0)operator(;) - pre_type(int) ident(cmd_state)operator(;) - reserved(enum) ident(lex_state) ident(last_state)operator(;) - - reserved(if) operator(()ident(lex_strterm)operator(\)) operator({) - pre_type(int) ident(token)operator(;) - reserved(if) operator(()ident(nd_type)operator(()ident(lex_strterm)operator(\)) operator(==) ident(NODE_HEREDOC)operator(\)) operator({) - ident(token) operator(=) ident(here_document)operator(()ident(lex_strterm)operator(\);) - reserved(if) operator(()ident(token) operator(==) ident(tSTRING_END)operator(\)) operator({) - ident(lex_strterm) operator(=) integer(0)operator(;) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(token) operator(=) ident(parse_string)operator(()ident(lex_strterm)operator(\);) - reserved(if) operator(()ident(token) operator(==) ident(tSTRING_END) operator(||) ident(token) operator(==) ident(tREGEXP_END)operator(\)) operator({) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(lex_strterm)operator(\);) - ident(lex_strterm) operator(=) integer(0)operator(;) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - operator(}) - operator(}) - reserved(return) ident(token)operator(;) - operator(}) - ident(cmd_state) operator(=) ident(command_start)operator(;) - ident(command_start) operator(=) ident(Qfalse)operator(;) - label(retry:) - reserved(switch) operator(()ident(c) operator(=) ident(nextc)operator((\)\)) operator({) - reserved(case) char('\\0')operator(:) comment(/* NUL */) - reserved(case) char('\\004')operator(:) comment(/* ^D */) - reserved(case) char('\\032')operator(:) comment(/* ^Z */) - reserved(case) operator(-)integer(1)operator(:) comment(/* end of script. */) - reserved(return) integer(0)operator(;) - - comment(/* white spaces */) - reserved(case) char(' ')operator(:) reserved(case) char('\\t')operator(:) reserved(case) char('\\f')operator(:) reserved(case) char('\\r')operator(:) - reserved(case) char('\\13')operator(:) comment(/* '\\v' */) - ident(space_seen)operator(++;) - reserved(goto) ident(retry)operator(;) - - reserved(case) char('#')operator(:) comment(/* it's a comment */) - reserved(while) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) char('\\n')operator(\)) operator({) - reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) - reserved(return) integer(0)operator(;) - operator(}) - comment(/* fall through */) - reserved(case) char('\\n')operator(:) - reserved(switch) operator(()ident(lex_state)operator(\)) operator({) - reserved(case) ident(EXPR_BEG)operator(:) - reserved(case) ident(EXPR_FNAME)operator(:) - reserved(case) ident(EXPR_DOT)operator(:) - reserved(case) ident(EXPR_CLASS)operator(:) - reserved(goto) ident(retry)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - ident(command_start) operator(=) ident(Qtrue)operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) char('\\n')operator(;) - - reserved(case) char('*')operator(:) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('*')operator(\)) operator({) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) ident(tPOW)operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - ident(c) operator(=) ident(tPOW)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(c) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) char('*')operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(IS_ARG)operator((\)) operator(&&) ident(space_seen) operator(&&) operator(!)ident(ISSPACE)operator(()ident(c)operator(\)\){) - ident(rb_warning)operator(()stringoperator(\);) - ident(c) operator(=) ident(tSTAR)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(IS_BEG)operator((\)\)) operator({) - ident(c) operator(=) ident(tSTAR)operator(;) - operator(}) - reserved(else) operator({) - ident(c) operator(=) char('*')operator(;) - operator(}) - operator(}) - reserved(switch) operator(()ident(lex_state)operator(\)) operator({) - reserved(case) ident(EXPR_FNAME)operator(:) reserved(case) ident(EXPR_DOT)operator(:) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) reserved(break)operator(;) - operator(}) - reserved(return) ident(c)operator(;) - - reserved(case) char('!')operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - reserved(return) ident(tNEQ)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('~')operator(\)) operator({) - reserved(return) ident(tNMATCH)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('!')operator(;) - - reserved(case) char('=')operator(:) - reserved(if) operator(()ident(was_bol)operator((\)\)) operator({) - comment(/* skip embedded rd document */) - reserved(if) operator(()ident(strncmp)operator(()ident(lex_p)operator(,) stringoperator(,) integer(5)operator(\)) operator(==) integer(0) operator(&&) ident(ISSPACE)operator(()ident(lex_p)operator([)integer(5)operator(]\)\)) operator({) - reserved(for) operator((;;\)) operator({) - ident(lex_p) operator(=) ident(lex_pend)operator(;) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_compile_error)operator(()stringoperator(\);) - reserved(return) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(!=) char('=')operator(\)) reserved(continue)operator(;) - reserved(if) operator(()ident(strncmp)operator(()ident(lex_p)operator(,) stringoperator(,) integer(3)operator(\)) operator(==) integer(0) operator(&&) - operator(()ident(lex_p) operator(+) integer(3) operator(==) ident(lex_pend) operator(||) ident(ISSPACE)operator(()ident(lex_p)operator([)integer(3)operator(]\)\)\)) operator({) - reserved(break)operator(;) - operator(}) - operator(}) - ident(lex_p) operator(=) ident(lex_pend)operator(;) - reserved(goto) ident(retry)operator(;) - operator(}) - operator(}) - - reserved(switch) operator(()ident(lex_state)operator(\)) operator({) - reserved(case) ident(EXPR_FNAME)operator(:) reserved(case) ident(EXPR_DOT)operator(:) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) reserved(break)operator(;) - operator(}) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - reserved(return) ident(tEQQ)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tEQ)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('~')operator(\)) operator({) - reserved(return) ident(tMATCH)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('>')operator(\)) operator({) - reserved(return) ident(tASSOC)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('=')operator(;) - - reserved(case) char('<')operator(:) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(c) operator(==) char('<') operator(&&) - ident(lex_state) operator(!=) ident(EXPR_END) operator(&&) - ident(lex_state) operator(!=) ident(EXPR_DOT) operator(&&) - ident(lex_state) operator(!=) ident(EXPR_ENDARG) operator(&&) - ident(lex_state) operator(!=) ident(EXPR_CLASS) operator(&&) - operator((!)ident(IS_ARG)operator((\)) operator(||) ident(space_seen)operator(\)\)) operator({) - pre_type(int) ident(token) operator(=) ident(heredoc_identifier)operator((\);) - reserved(if) operator(()ident(token)operator(\)) reserved(return) ident(token)operator(;) - operator(}) - reserved(switch) operator(()ident(lex_state)operator(\)) operator({) - reserved(case) ident(EXPR_FNAME)operator(:) reserved(case) ident(EXPR_DOT)operator(:) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('=')operator(\)) operator({) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('>')operator(\)) operator({) - reserved(return) ident(tCMP)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tLEQ)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('<')operator(\)) operator({) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) ident(tLSHFT)operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tLSHFT)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('<')operator(;) - - reserved(case) char('>')operator(:) - reserved(switch) operator(()ident(lex_state)operator(\)) operator({) - reserved(case) ident(EXPR_FNAME)operator(:) reserved(case) ident(EXPR_DOT)operator(:) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) reserved(break)operator(;) - operator(}) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - reserved(return) ident(tGEQ)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('>')operator(\)) operator({) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) ident(tRSHFT)operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tRSHFT)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('>')operator(;) - - reserved(case) char('"')operator(:) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_dquote)operator(,) char('"')operator(,) integer(0)operator(\);) - reserved(return) ident(tSTRING_BEG)operator(;) - - reserved(case) char('`')operator(:) - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_FNAME)operator(\)) operator({) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - reserved(return) ident(c)operator(;) - operator(}) - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_DOT)operator(\)) operator({) - reserved(if) operator(()ident(cmd_state)operator(\)) - ident(lex_state) operator(=) ident(EXPR_CMDARG)operator(;) - reserved(else) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) - reserved(return) ident(c)operator(;) - operator(}) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_xquote)operator(,) char('`')operator(,) integer(0)operator(\);) - reserved(return) ident(tXSTRING_BEG)operator(;) - - reserved(case) char('\\'')operator(:) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_squote)operator(,) char('\\'')operator(,) integer(0)operator(\);) - reserved(return) ident(tSTRING_BEG)operator(;) - - reserved(case) char('?')operator(:) - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_END) operator(||) ident(lex_state) operator(==) ident(EXPR_ENDARG)operator(\)) operator({) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) char('?')operator(;) - operator(}) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_compile_error)operator(()stringoperator(\);) - reserved(return) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(ISSPACE)operator(()ident(c)operator(\)\){) - reserved(if) operator((!)ident(IS_ARG)operator((\)\){) - pre_type(int) ident(c2) operator(=) integer(0)operator(;) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char(' ')operator(:) - ident(c2) operator(=) char('s')operator(;) - reserved(break)operator(;) - reserved(case) char('\\n')operator(:) - ident(c2) operator(=) char('n')operator(;) - reserved(break)operator(;) - reserved(case) char('\\t')operator(:) - ident(c2) operator(=) char('t')operator(;) - reserved(break)operator(;) - reserved(case) char('\\v')operator(:) - ident(c2) operator(=) char('v')operator(;) - reserved(break)operator(;) - reserved(case) char('\\r')operator(:) - ident(c2) operator(=) char('r')operator(;) - reserved(break)operator(;) - reserved(case) char('\\f')operator(:) - ident(c2) operator(=) char('f')operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(c2)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) ident(c2)operator(\);) - operator(}) - operator(}) - label(ternary:) - ident(pushback)operator(()ident(c)operator(\);) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) char('?')operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - ident(rb_warn)operator(()stringoperator(,) ident(c)operator(\);) - reserved(goto) ident(ternary)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(ISALNUM)operator(()ident(c)operator(\)) operator(||) ident(c) operator(==) char('_')operator(\)) operator(&&) ident(lex_p) operator(<) ident(lex_pend) operator(&&) ident(is_identchar)operator((*)ident(lex_p)operator(\)\)) operator({) - reserved(goto) ident(ternary)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\\\')operator(\)) operator({) - ident(c) operator(=) ident(read_escape)operator((\);) - operator(}) - ident(c) operator(&=) hex(0xff)operator(;) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_LIT)operator(()ident(INT2FIX)operator(()ident(c)operator(\)\);) - reserved(return) ident(tINTEGER)operator(;) - - reserved(case) char('&')operator(:) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('&')operator(\)) operator({) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) ident(tANDOP)operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tANDOP)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) char('&')operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(IS_ARG)operator((\)) operator(&&) ident(space_seen) operator(&&) operator(!)ident(ISSPACE)operator(()ident(c)operator(\)\){) - ident(rb_warning)operator(()stringoperator(\);) - ident(c) operator(=) ident(tAMPER)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(IS_BEG)operator((\)\)) operator({) - ident(c) operator(=) ident(tAMPER)operator(;) - operator(}) - reserved(else) operator({) - ident(c) operator(=) char('&')operator(;) - operator(}) - reserved(switch) operator(()ident(lex_state)operator(\)) operator({) - reserved(case) ident(EXPR_FNAME)operator(:) reserved(case) ident(EXPR_DOT)operator(:) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - operator(}) - reserved(return) ident(c)operator(;) - - reserved(case) char('|')operator(:) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('|')operator(\)) operator({) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) ident(tOROP)operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tOROP)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) char('|')operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_FNAME) operator(||) ident(lex_state) operator(==) ident(EXPR_DOT)operator(\)) operator({) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) - operator(}) - reserved(else) operator({) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('|')operator(;) - - reserved(case) char('+')operator(:) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_FNAME) operator(||) ident(lex_state) operator(==) ident(EXPR_DOT)operator(\)) operator({) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) - reserved(if) operator(()ident(c) operator(==) char('@')operator(\)) operator({) - reserved(return) ident(tUPLUS)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('+')operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) char('+')operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - reserved(if) operator(()ident(IS_BEG)operator((\)) operator(||) - operator(()ident(IS_ARG)operator((\)) operator(&&) ident(space_seen) operator(&&) operator(!)ident(ISSPACE)operator(()ident(c)operator(\)\)\)) operator({) - reserved(if) operator(()ident(IS_ARG)operator((\)\)) ident(arg_ambiguous)operator((\);) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(ISDIGIT)operator(()ident(c)operator(\)\)) operator({) - ident(c) operator(=) char('+')operator(;) - reserved(goto) ident(start_num)operator(;) - operator(}) - reserved(return) ident(tUPLUS)operator(;) - operator(}) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('+')operator(;) - - reserved(case) char('-')operator(:) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_FNAME) operator(||) ident(lex_state) operator(==) ident(EXPR_DOT)operator(\)) operator({) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) - reserved(if) operator(()ident(c) operator(==) char('@')operator(\)) operator({) - reserved(return) ident(tUMINUS)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('-')operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) char('-')operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - reserved(if) operator(()ident(IS_BEG)operator((\)) operator(||) - operator(()ident(IS_ARG)operator((\)) operator(&&) ident(space_seen) operator(&&) operator(!)ident(ISSPACE)operator(()ident(c)operator(\)\)\)) operator({) - reserved(if) operator(()ident(IS_ARG)operator((\)\)) ident(arg_ambiguous)operator((\);) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(ISDIGIT)operator(()ident(c)operator(\)\)) operator({) - reserved(return) ident(tUMINUS_NUM)operator(;) - operator(}) - reserved(return) ident(tUMINUS)operator(;) - operator(}) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('-')operator(;) - - reserved(case) char('.')operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('.')operator(\)) operator({) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('.')operator(\)) operator({) - reserved(return) ident(tDOT3)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tDOT2)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(ISDIGIT)operator(()ident(c)operator(\)\)) operator({) - ident(yyerror)operator(()string floating literal anymore; put 0 before dot)delimiter(")>operator(\);) - operator(}) - ident(lex_state) operator(=) ident(EXPR_DOT)operator(;) - reserved(return) char('.')operator(;) - - label(start_num:) - reserved(case) char('0')operator(:) reserved(case) char('1')operator(:) reserved(case) char('2')operator(:) reserved(case) char('3')operator(:) reserved(case) char('4')operator(:) - reserved(case) char('5')operator(:) reserved(case) char('6')operator(:) reserved(case) char('7')operator(:) reserved(case) char('8')operator(:) reserved(case) char('9')operator(:) - operator({) - pre_type(int) ident(is_float)operator(,) ident(seen_point)operator(,) ident(seen_e)operator(,) ident(nondigit)operator(;) - - ident(is_float) operator(=) ident(seen_point) operator(=) ident(seen_e) operator(=) ident(nondigit) operator(=) integer(0)operator(;) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - ident(newtok)operator((\);) - reserved(if) operator(()ident(c) operator(==) char('-') operator(||) ident(c) operator(==) char('+')operator(\)) operator({) - ident(tokadd)operator(()ident(c)operator(\);) - ident(c) operator(=) ident(nextc)operator((\);) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('0')operator(\)) operator({) - pre_type(int) ident(start) operator(=) ident(toklen)operator((\);) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(c) operator(==) char('x') operator(||) ident(c) operator(==) char('X')operator(\)) operator({) - comment(/* hexadecimal */) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(ISXDIGIT)operator(()ident(c)operator(\)\)) operator({) - reserved(do) operator({) - reserved(if) operator(()ident(c) operator(==) char('_')operator(\)) operator({) - reserved(if) operator(()ident(nondigit)operator(\)) reserved(break)operator(;) - ident(nondigit) operator(=) ident(c)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(if) operator((!)ident(ISXDIGIT)operator(()ident(c)operator(\)\)) reserved(break)operator(;) - ident(nondigit) operator(=) integer(0)operator(;) - ident(tokadd)operator(()ident(c)operator(\);) - operator(}) reserved(while) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) operator(-)integer(1)operator(\);) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - ident(tokfix)operator((\);) - reserved(if) operator(()ident(toklen)operator((\)) operator(==) ident(start)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(nondigit)operator(\)) reserved(goto) ident(trailing_uc)operator(;) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_LIT)operator(()ident(rb_cstr_to_inum)operator(()ident(tok)operator((\),) integer(16)operator(,) ident(Qfalse)operator(\)\);) - reserved(return) ident(tINTEGER)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('b') operator(||) ident(c) operator(==) char('B')operator(\)) operator({) - comment(/* binary */) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(c) operator(==) char('0') operator(||) ident(c) operator(==) char('1')operator(\)) operator({) - reserved(do) operator({) - reserved(if) operator(()ident(c) operator(==) char('_')operator(\)) operator({) - reserved(if) operator(()ident(nondigit)operator(\)) reserved(break)operator(;) - ident(nondigit) operator(=) ident(c)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(!=) char('0') operator(&&) ident(c) operator(!=) char('1')operator(\)) reserved(break)operator(;) - ident(nondigit) operator(=) integer(0)operator(;) - ident(tokadd)operator(()ident(c)operator(\);) - operator(}) reserved(while) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) operator(-)integer(1)operator(\);) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - ident(tokfix)operator((\);) - reserved(if) operator(()ident(toklen)operator((\)) operator(==) ident(start)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(nondigit)operator(\)) reserved(goto) ident(trailing_uc)operator(;) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_LIT)operator(()ident(rb_cstr_to_inum)operator(()ident(tok)operator((\),) integer(2)operator(,) ident(Qfalse)operator(\)\);) - reserved(return) ident(tINTEGER)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('d') operator(||) ident(c) operator(==) char('D')operator(\)) operator({) - comment(/* decimal */) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(ISDIGIT)operator(()ident(c)operator(\)\)) operator({) - reserved(do) operator({) - reserved(if) operator(()ident(c) operator(==) char('_')operator(\)) operator({) - reserved(if) operator(()ident(nondigit)operator(\)) reserved(break)operator(;) - ident(nondigit) operator(=) ident(c)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(if) operator((!)ident(ISDIGIT)operator(()ident(c)operator(\)\)) reserved(break)operator(;) - ident(nondigit) operator(=) integer(0)operator(;) - ident(tokadd)operator(()ident(c)operator(\);) - operator(}) reserved(while) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) operator(-)integer(1)operator(\);) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - ident(tokfix)operator((\);) - reserved(if) operator(()ident(toklen)operator((\)) operator(==) ident(start)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(nondigit)operator(\)) reserved(goto) ident(trailing_uc)operator(;) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_LIT)operator(()ident(rb_cstr_to_inum)operator(()ident(tok)operator((\),) integer(10)operator(,) ident(Qfalse)operator(\)\);) - reserved(return) ident(tINTEGER)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('_')operator(\)) operator({) - comment(/* 0_0 */) - reserved(goto) ident(octal_number)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('o') operator(||) ident(c) operator(==) char('O')operator(\)) operator({) - comment(/* prefixed octal */) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(c) operator(==) char('_')operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - operator(}) - reserved(if) operator(()ident(c) operator(>=) char('0') operator(&&) ident(c) operator(<=) char('7')operator(\)) operator({) - comment(/* octal */) - label(octal_number:) - reserved(do) operator({) - reserved(if) operator(()ident(c) operator(==) char('_')operator(\)) operator({) - reserved(if) operator(()ident(nondigit)operator(\)) reserved(break)operator(;) - ident(nondigit) operator(=) ident(c)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(<) char('0') operator(||) ident(c) operator(>) char('9')operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(c) operator(>) char('7')operator(\)) reserved(goto) ident(invalid_octal)operator(;) - ident(nondigit) operator(=) integer(0)operator(;) - ident(tokadd)operator(()ident(c)operator(\);) - operator(}) reserved(while) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) operator(-)integer(1)operator(\);) - reserved(if) operator(()ident(toklen)operator((\)) operator(>) ident(start)operator(\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - ident(tokfix)operator((\);) - reserved(if) operator(()ident(nondigit)operator(\)) reserved(goto) ident(trailing_uc)operator(;) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_LIT)operator(()ident(rb_cstr_to_inum)operator(()ident(tok)operator((\),) integer(8)operator(,) ident(Qfalse)operator(\)\);) - reserved(return) ident(tINTEGER)operator(;) - operator(}) - reserved(if) operator(()ident(nondigit)operator(\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(goto) ident(trailing_uc)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(c) operator(>) char('7') operator(&&) ident(c) operator(<=) char('9')operator(\)) operator({) - label(invalid_octal:) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('.') operator(||) ident(c) operator(==) char('e') operator(||) ident(c) operator(==) char('E')operator(\)) operator({) - ident(tokadd)operator(()char('0')operator(\);) - operator(}) - reserved(else) operator({) - ident(pushback)operator(()ident(c)operator(\);) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_LIT)operator(()ident(INT2FIX)operator(()integer(0)operator(\)\);) - reserved(return) ident(tINTEGER)operator(;) - operator(}) - operator(}) - - reserved(for) operator((;;\)) operator({) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('0')operator(:) reserved(case) char('1')operator(:) reserved(case) char('2')operator(:) reserved(case) char('3')operator(:) reserved(case) char('4')operator(:) - reserved(case) char('5')operator(:) reserved(case) char('6')operator(:) reserved(case) char('7')operator(:) reserved(case) char('8')operator(:) reserved(case) char('9')operator(:) - ident(nondigit) operator(=) integer(0)operator(;) - ident(tokadd)operator(()ident(c)operator(\);) - reserved(break)operator(;) - - reserved(case) char('.')operator(:) - reserved(if) operator(()ident(nondigit)operator(\)) reserved(goto) ident(trailing_uc)operator(;) - reserved(if) operator(()ident(seen_point) operator(||) ident(seen_e)operator(\)) operator({) - reserved(goto) ident(decode_num)operator(;) - operator(}) - reserved(else) operator({) - pre_type(int) ident(c0) operator(=) ident(nextc)operator((\);) - reserved(if) operator((!)ident(ISDIGIT)operator(()ident(c0)operator(\)\)) operator({) - ident(pushback)operator(()ident(c0)operator(\);) - reserved(goto) ident(decode_num)operator(;) - operator(}) - ident(c) operator(=) ident(c0)operator(;) - operator(}) - ident(tokadd)operator(()char('.')operator(\);) - ident(tokadd)operator(()ident(c)operator(\);) - ident(is_float)operator(++;) - ident(seen_point)operator(++;) - ident(nondigit) operator(=) integer(0)operator(;) - reserved(break)operator(;) - - reserved(case) char('e')operator(:) - reserved(case) char('E')operator(:) - reserved(if) operator(()ident(nondigit)operator(\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - ident(c) operator(=) ident(nondigit)operator(;) - reserved(goto) ident(decode_num)operator(;) - operator(}) - reserved(if) operator(()ident(seen_e)operator(\)) operator({) - reserved(goto) ident(decode_num)operator(;) - operator(}) - ident(tokadd)operator(()ident(c)operator(\);) - ident(seen_e)operator(++;) - ident(is_float)operator(++;) - ident(nondigit) operator(=) ident(c)operator(;) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(c) operator(!=) char('-') operator(&&) ident(c) operator(!=) char('+')operator(\)) reserved(continue)operator(;) - ident(tokadd)operator(()ident(c)operator(\);) - ident(nondigit) operator(=) ident(c)operator(;) - reserved(break)operator(;) - - reserved(case) char('_')operator(:) comment(/* `_' in number just ignored */) - reserved(if) operator(()ident(nondigit)operator(\)) reserved(goto) ident(decode_num)operator(;) - ident(nondigit) operator(=) ident(c)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(goto) ident(decode_num)operator(;) - operator(}) - ident(c) operator(=) ident(nextc)operator((\);) - operator(}) - - label(decode_num:) - ident(pushback)operator(()ident(c)operator(\);) - ident(tokfix)operator((\);) - reserved(if) operator(()ident(nondigit)operator(\)) operator({) - pre_type(char) ident(tmp)operator([)integer(30)operator(];) - label(trailing_uc:) - ident(sprintf)operator(()ident(tmp)operator(,) stringoperator(,) ident(nondigit)operator(\);) - ident(yyerror)operator(()ident(tmp)operator(\);) - operator(}) - reserved(if) operator(()ident(is_float)operator(\)) operator({) - pre_type(double) ident(d) operator(=) ident(strtod)operator(()ident(tok)operator((\),) integer(0)operator(\);) - reserved(if) operator(()ident(errno) operator(==) ident(ERANGE)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) ident(tok)operator((\)\);) - ident(errno) operator(=) integer(0)operator(;) - operator(}) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_LIT)operator(()ident(rb_float_new)operator(()ident(d)operator(\)\);) - reserved(return) ident(tFLOAT)operator(;) - operator(}) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_LIT)operator(()ident(rb_cstr_to_inum)operator(()ident(tok)operator((\),) integer(10)operator(,) ident(Qfalse)operator(\)\);) - reserved(return) ident(tINTEGER)operator(;) - operator(}) - - reserved(case) char(']')operator(:) - reserved(case) char('}')operator(:) - reserved(case) char('\)')operator(:) - ident(COND_LEXPOP)operator((\);) - ident(CMDARG_LEXPOP)operator((\);) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - reserved(return) ident(c)operator(;) - - reserved(case) char(':')operator(:) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(c) operator(==) char(':')operator(\)) operator({) - reserved(if) operator(()ident(IS_BEG)operator((\)) operator(||) operator(()ident(IS_ARG)operator((\)) operator(&&) ident(space_seen)operator(\)\)) operator({) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tCOLON3)operator(;) - operator(}) - ident(lex_state) operator(=) ident(EXPR_DOT)operator(;) - reserved(return) ident(tCOLON2)operator(;) - operator(}) - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_END) operator(||) ident(lex_state) operator(==) ident(EXPR_ENDARG) operator(||) ident(ISSPACE)operator(()ident(c)operator(\)\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) char(':')operator(;) - operator(}) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('\\'')operator(:) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_ssym)operator(,) ident(c)operator(,) integer(0)operator(\);) - reserved(break)operator(;) - reserved(case) char('"')operator(:) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_dsym)operator(,) ident(c)operator(,) integer(0)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(pushback)operator(()ident(c)operator(\);) - reserved(break)operator(;) - operator(}) - ident(lex_state) operator(=) ident(EXPR_FNAME)operator(;) - reserved(return) ident(tSYMBEG)operator(;) - - reserved(case) char('/')operator(:) - reserved(if) operator(()ident(IS_BEG)operator((\)\)) operator({) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_regexp)operator(,) char('/')operator(,) integer(0)operator(\);) - reserved(return) ident(tREGEXP_BEG)operator(;) - operator(}) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) char('/')operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(IS_ARG)operator((\)) operator(&&) ident(space_seen)operator(\)) operator({) - reserved(if) operator((!)ident(ISSPACE)operator(()ident(c)operator(\)\)) operator({) - ident(arg_ambiguous)operator((\);) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_regexp)operator(,) char('/')operator(,) integer(0)operator(\);) - reserved(return) ident(tREGEXP_BEG)operator(;) - operator(}) - operator(}) - reserved(switch) operator(()ident(lex_state)operator(\)) operator({) - reserved(case) ident(EXPR_FNAME)operator(:) reserved(case) ident(EXPR_DOT)operator(:) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) reserved(break)operator(;) - operator(}) - reserved(return) char('/')operator(;) - - reserved(case) char('^')operator(:) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) char('^')operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - reserved(switch) operator(()ident(lex_state)operator(\)) operator({) - reserved(case) ident(EXPR_FNAME)operator(:) reserved(case) ident(EXPR_DOT)operator(:) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) reserved(break)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('^')operator(;) - - reserved(case) char(';')operator(:) - ident(command_start) operator(=) ident(Qtrue)operator(;) - reserved(case) char(',')operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(c)operator(;) - - reserved(case) char('~')operator(:) - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_FNAME) operator(||) ident(lex_state) operator(==) ident(EXPR_DOT)operator(\)) operator({) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(!=) char('@')operator(\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - operator(}) - operator(}) - reserved(switch) operator(()ident(lex_state)operator(\)) operator({) - reserved(case) ident(EXPR_FNAME)operator(:) reserved(case) ident(EXPR_DOT)operator(:) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) reserved(break)operator(;) - operator(}) - reserved(return) char('~')operator(;) - - reserved(case) char('(')operator(:) - ident(command_start) operator(=) ident(Qtrue)operator(;) - reserved(if) operator(()ident(IS_BEG)operator((\)\)) operator({) - ident(c) operator(=) ident(tLPAREN)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(space_seen)operator(\)) operator({) - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_CMDARG)operator(\)) operator({) - ident(c) operator(=) ident(tLPAREN_ARG)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_ARG)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(\);) - ident(c) operator(=) char('(')operator(;) - operator(}) - operator(}) - ident(COND_PUSH)operator(()integer(0)operator(\);) - ident(CMDARG_PUSH)operator(()integer(0)operator(\);) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(c)operator(;) - - reserved(case) char('[')operator(:) - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_FNAME) operator(||) ident(lex_state) operator(==) ident(EXPR_DOT)operator(\)) operator({) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char(']')operator(\)) operator({) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - reserved(return) ident(tASET)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tAREF)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('[')operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(IS_BEG)operator((\)\)) operator({) - ident(c) operator(=) ident(tLBRACK)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(IS_ARG)operator((\)) operator(&&) ident(space_seen)operator(\)) operator({) - ident(c) operator(=) ident(tLBRACK)operator(;) - operator(}) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - ident(COND_PUSH)operator(()integer(0)operator(\);) - ident(CMDARG_PUSH)operator(()integer(0)operator(\);) - reserved(return) ident(c)operator(;) - - reserved(case) char('{')operator(:) - reserved(if) operator(()ident(IS_ARG)operator((\)) operator(||) ident(lex_state) operator(==) ident(EXPR_END)operator(\)) - ident(c) operator(=) char('{')operator(;) comment(/* block (primary\) */) - reserved(else) reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_ENDARG)operator(\)) - ident(c) operator(=) ident(tLBRACE_ARG)operator(;) comment(/* block (expr\) */) - reserved(else) - ident(c) operator(=) ident(tLBRACE)operator(;) comment(/* hash */) - ident(COND_PUSH)operator(()integer(0)operator(\);) - ident(CMDARG_PUSH)operator(()integer(0)operator(\);) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(c)operator(;) - - reserved(case) char('\\\\')operator(:) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(c) operator(==) char('\\n')operator(\)) operator({) - ident(space_seen) operator(=) integer(1)operator(;) - reserved(goto) ident(retry)operator(;) comment(/* skip \\\\n */) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('\\\\')operator(;) - - reserved(case) char('%')operator(:) - reserved(if) operator(()ident(IS_BEG)operator((\)\)) operator({) - pre_type(int) ident(term)operator(;) - pre_type(int) ident(paren)operator(;) - - ident(c) operator(=) ident(nextc)operator((\);) - label(quotation:) - reserved(if) operator((!)ident(ISALNUM)operator(()ident(c)operator(\)\)) operator({) - ident(term) operator(=) ident(c)operator(;) - ident(c) operator(=) char('Q')operator(;) - operator(}) - reserved(else) operator({) - ident(term) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(ISALNUM)operator(()ident(term)operator(\)) operator(||) ident(ismbchar)operator(()ident(term)operator(\)\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - reserved(return) integer(0)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(c) operator(==) operator(-)integer(1) operator(||) ident(term) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_compile_error)operator(()stringoperator(\);) - reserved(return) integer(0)operator(;) - operator(}) - ident(paren) operator(=) ident(term)operator(;) - reserved(if) operator(()ident(term) operator(==) char('(')operator(\)) ident(term) operator(=) char('\)')operator(;) - reserved(else) reserved(if) operator(()ident(term) operator(==) char('[')operator(\)) ident(term) operator(=) char(']')operator(;) - reserved(else) reserved(if) operator(()ident(term) operator(==) char('{')operator(\)) ident(term) operator(=) char('}')operator(;) - reserved(else) reserved(if) operator(()ident(term) operator(==) char('<')operator(\)) ident(term) operator(=) char('>')operator(;) - reserved(else) ident(paren) operator(=) integer(0)operator(;) - - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('Q')operator(:) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_dquote)operator(,) ident(term)operator(,) ident(paren)operator(\);) - reserved(return) ident(tSTRING_BEG)operator(;) - - reserved(case) char('q')operator(:) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_squote)operator(,) ident(term)operator(,) ident(paren)operator(\);) - reserved(return) ident(tSTRING_BEG)operator(;) - - reserved(case) char('W')operator(:) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_dword)operator(,) ident(term)operator(,) ident(paren)operator(\);) - reserved(do) operator({)ident(c) operator(=) ident(nextc)operator((\);}) reserved(while) operator(()ident(ISSPACE)operator(()ident(c)operator(\)\);) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tWORDS_BEG)operator(;) - - reserved(case) char('w')operator(:) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_sword)operator(,) ident(term)operator(,) ident(paren)operator(\);) - reserved(do) operator({)ident(c) operator(=) ident(nextc)operator((\);}) reserved(while) operator(()ident(ISSPACE)operator(()ident(c)operator(\)\);) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) ident(tQWORDS_BEG)operator(;) - - reserved(case) char('x')operator(:) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_xquote)operator(,) ident(term)operator(,) ident(paren)operator(\);) - reserved(return) ident(tXSTRING_BEG)operator(;) - - reserved(case) char('r')operator(:) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_regexp)operator(,) ident(term)operator(,) ident(paren)operator(\);) - reserved(return) ident(tREGEXP_BEG)operator(;) - - reserved(case) char('s')operator(:) - ident(lex_strterm) operator(=) ident(NEW_STRTERM)operator(()ident(str_ssym)operator(,) ident(term)operator(,) ident(paren)operator(\);) - ident(lex_state) operator(=) ident(EXPR_FNAME)operator(;) - reserved(return) ident(tSYMBEG)operator(;) - - reserved(default)operator(:) - ident(yyerror)operator(()stringoperator(\);) - reserved(return) integer(0)operator(;) - operator(}) - operator(}) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=')operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) char('%')operator(;) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(tOP_ASGN)operator(;) - operator(}) - reserved(if) operator(()ident(IS_ARG)operator((\)) operator(&&) ident(space_seen) operator(&&) operator(!)ident(ISSPACE)operator(()ident(c)operator(\)\)) operator({) - reserved(goto) ident(quotation)operator(;) - operator(}) - reserved(switch) operator(()ident(lex_state)operator(\)) operator({) - reserved(case) ident(EXPR_FNAME)operator(:) reserved(case) ident(EXPR_DOT)operator(:) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) reserved(break)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('%')operator(;) - - reserved(case) char('$')operator(:) - ident(last_state) operator(=) ident(lex_state)operator(;) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - ident(newtok)operator((\);) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('_')operator(:) comment(/* $_: last read line string */) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(is_identchar)operator(()ident(c)operator(\)\)) operator({) - ident(tokadd)operator(()char('$')operator(\);) - ident(tokadd)operator(()char('_')operator(\);) - reserved(break)operator(;) - operator(}) - ident(pushback)operator(()ident(c)operator(\);) - ident(c) operator(=) char('_')operator(;) - comment(/* fall through */) - reserved(case) char('~')operator(:) comment(/* $~: match-data */) - ident(local_cnt)operator(()ident(c)operator(\);) - comment(/* fall through */) - reserved(case) char('*')operator(:) comment(/* $*: argv */) - reserved(case) char('$')operator(:) comment(/* $$: pid */) - reserved(case) char('?')operator(:) comment(/* $?: last status */) - reserved(case) char('!')operator(:) comment(/* $!: error string */) - reserved(case) char('@')operator(:) comment(/* $@: error position */) - reserved(case) char('/')operator(:) comment(/* $/: input record separator */) - reserved(case) char('\\\\')operator(:) comment(/* $\\: output record separator */) - reserved(case) char(';')operator(:) comment(/* $;: field separator */) - reserved(case) char(',')operator(:) comment(/* $,: output field separator */) - reserved(case) char('.')operator(:) comment(/* $.: last read line number */) - reserved(case) char('=')operator(:) comment(/* $=: ignorecase */) - reserved(case) char(':')operator(:) comment(/* $:: load path */) - reserved(case) char('<')operator(:) comment(/* $<: reading filename */) - reserved(case) char('>')operator(:) comment(/* $>: default output handle */) - reserved(case) char('\\"')operator(:) comment(/* $": already loaded files */) - ident(tokadd)operator(()char('$')operator(\);) - ident(tokadd)operator(()ident(c)operator(\);) - ident(tokfix)operator((\);) - ident(yylval)operator(.)ident(id) operator(=) ident(rb_intern)operator(()ident(tok)operator((\)\);) - reserved(return) ident(tGVAR)operator(;) - - reserved(case) char('-')operator(:) - ident(tokadd)operator(()char('$')operator(\);) - ident(tokadd)operator(()ident(c)operator(\);) - ident(c) operator(=) ident(nextc)operator((\);) - reserved(if) operator(()ident(is_identchar)operator(()ident(c)operator(\)\)) operator({) - ident(tokadd)operator(()ident(c)operator(\);) - operator(}) - reserved(else) operator({) - ident(pushback)operator(()ident(c)operator(\);) - operator(}) - label(gvar:) - ident(tokfix)operator((\);) - ident(yylval)operator(.)ident(id) operator(=) ident(rb_intern)operator(()ident(tok)operator((\)\);) - comment(/* xxx shouldn't check if valid option variable */) - reserved(return) ident(tGVAR)operator(;) - - reserved(case) char('&')operator(:) comment(/* $&: last match */) - reserved(case) char('`')operator(:) comment(/* $`: string before last match */) - reserved(case) char('\\'')operator(:) comment(/* $': string after last match */) - reserved(case) char('+')operator(:) comment(/* $+: string matches last paren. */) - reserved(if) operator(()ident(last_state) operator(==) ident(EXPR_FNAME)operator(\)) operator({) - ident(tokadd)operator(()char('$')operator(\);) - ident(tokadd)operator(()ident(c)operator(\);) - reserved(goto) ident(gvar)operator(;) - operator(}) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_BACK_REF)operator(()ident(c)operator(\);) - reserved(return) ident(tBACK_REF)operator(;) - - reserved(case) char('1')operator(:) reserved(case) char('2')operator(:) reserved(case) char('3')operator(:) - reserved(case) char('4')operator(:) reserved(case) char('5')operator(:) reserved(case) char('6')operator(:) - reserved(case) char('7')operator(:) reserved(case) char('8')operator(:) reserved(case) char('9')operator(:) - ident(tokadd)operator(()char('$')operator(\);) - reserved(do) operator({) - ident(tokadd)operator(()ident(c)operator(\);) - ident(c) operator(=) ident(nextc)operator((\);) - operator(}) reserved(while) operator(()ident(ISDIGIT)operator(()ident(c)operator(\)\);) - ident(pushback)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(last_state) operator(==) ident(EXPR_FNAME)operator(\)) reserved(goto) ident(gvar)operator(;) - ident(tokfix)operator((\);) - ident(yylval)operator(.)ident(node) operator(=) ident(NEW_NTH_REF)operator(()ident(atoi)operator(()ident(tok)operator((\)+)integer(1)operator(\)\);) - reserved(return) ident(tNTH_REF)operator(;) - - reserved(default)operator(:) - reserved(if) operator((!)ident(is_identchar)operator(()ident(c)operator(\)\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('$')operator(;) - operator(}) - reserved(case) char('0')operator(:) - ident(tokadd)operator(()char('$')operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('@')operator(:) - ident(c) operator(=) ident(nextc)operator((\);) - ident(newtok)operator((\);) - ident(tokadd)operator(()char('@')operator(\);) - reserved(if) operator(()ident(c) operator(==) char('@')operator(\)) operator({) - ident(tokadd)operator(()char('@')operator(\);) - ident(c) operator(=) ident(nextc)operator((\);) - operator(}) - reserved(if) operator(()ident(ISDIGIT)operator(()ident(c)operator(\)\)) operator({) - reserved(if) operator(()ident(tokidx) operator(==) integer(1)operator(\)) operator({) - ident(rb_compile_error)operator(()stringoperator(,) ident(c)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_compile_error)operator(()stringoperator(,) ident(c)operator(\);) - operator(}) - reserved(return) integer(0)operator(;) - operator(}) - reserved(if) operator((!)ident(is_identchar)operator(()ident(c)operator(\)\)) operator({) - ident(pushback)operator(()ident(c)operator(\);) - reserved(return) char('@')operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('_')operator(:) - reserved(if) operator(()ident(was_bol)operator((\)) operator(&&) ident(whole_match_p)operator(()stringoperator(,) integer(7)operator(,) integer(0)operator(\)\)) operator({) - ident(ruby__end__seen) operator(=) integer(1)operator(;) - ident(lex_lastline) operator(=) integer(0)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - ident(newtok)operator((\);) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(if) operator((!)ident(is_identchar)operator(()ident(c)operator(\)\)) operator({) - ident(rb_compile_error)operator(()stringoperator(,) ident(c)operator(\);) - reserved(goto) ident(retry)operator(;) - operator(}) - - ident(newtok)operator((\);) - reserved(break)operator(;) - operator(}) - - reserved(do) operator({) - ident(tokadd)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - pre_type(int) ident(i)operator(,) ident(len) operator(=) ident(mbclen)operator(()ident(c)operator(\)-)integer(1)operator(;) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(c) operator(=) ident(nextc)operator((\);) - ident(tokadd)operator(()ident(c)operator(\);) - operator(}) - operator(}) - ident(c) operator(=) ident(nextc)operator((\);) - operator(}) reserved(while) operator(()ident(is_identchar)operator(()ident(c)operator(\)\);) - reserved(if) operator((()ident(c) operator(==) char('!') operator(||) ident(c) operator(==) char('?')operator(\)) operator(&&) ident(is_identchar)operator(()ident(tok)operator((\)[)integer(0)operator(]\)) operator(&&) operator(!)ident(peek)operator(()char('=')operator(\)\)) operator({) - ident(tokadd)operator(()ident(c)operator(\);) - operator(}) - reserved(else) operator({) - ident(pushback)operator(()ident(c)operator(\);) - operator(}) - ident(tokfix)operator((\);) - - operator({) - pre_type(int) ident(result) operator(=) integer(0)operator(;) - - ident(last_state) operator(=) ident(lex_state)operator(;) - reserved(switch) operator(()ident(tok)operator((\)[)integer(0)operator(]\)) operator({) - reserved(case) char('$')operator(:) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - ident(result) operator(=) ident(tGVAR)operator(;) - reserved(break)operator(;) - reserved(case) char('@')operator(:) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - reserved(if) operator(()ident(tok)operator((\)[)integer(1)operator(]) operator(==) char('@')operator(\)) - ident(result) operator(=) ident(tCVAR)operator(;) - reserved(else) - ident(result) operator(=) ident(tIVAR)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(if) operator(()ident(toklast)operator((\)) operator(==) char('!') operator(||) ident(toklast)operator((\)) operator(==) char('?')operator(\)) operator({) - ident(result) operator(=) ident(tFID)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_FNAME)operator(\)) operator({) - reserved(if) operator((()ident(c) operator(=) ident(nextc)operator((\)\)) operator(==) char('=') operator(&&) operator(!)ident(peek)operator(()char('~')operator(\)) operator(&&) operator(!)ident(peek)operator(()char('>')operator(\)) operator(&&) - operator((!)ident(peek)operator(()char('=')operator(\)) operator(||) operator(()ident(lex_p) operator(+) integer(1) operator(<) ident(lex_pend) operator(&&) ident(lex_p)operator([)integer(1)operator(]) operator(==) char('>')operator(\)\)\)) operator({) - ident(result) operator(=) ident(tIDENTIFIER)operator(;) - ident(tokadd)operator(()ident(c)operator(\);) - ident(tokfix)operator((\);) - operator(}) - reserved(else) operator({) - ident(pushback)operator(()ident(c)operator(\);) - operator(}) - operator(}) - reserved(if) operator(()ident(result) operator(==) integer(0) operator(&&) ident(ISUPPER)operator(()ident(tok)operator((\)[)integer(0)operator(]\)\)) operator({) - ident(result) operator(=) ident(tCONSTANT)operator(;) - operator(}) - reserved(else) operator({) - ident(result) operator(=) ident(tIDENTIFIER)operator(;) - operator(}) - operator(}) - - reserved(if) operator(()ident(lex_state) operator(!=) ident(EXPR_DOT)operator(\)) operator({) - reserved(struct) ident(kwtable) operator(*)ident(kw)operator(;) - - comment(/* See if it is a reserved word. */) - ident(kw) operator(=) ident(rb_reserved_word)operator(()ident(tok)operator((\),) ident(toklen)operator((\)\);) - reserved(if) operator(()ident(kw)operator(\)) operator({) - reserved(enum) ident(lex_state) ident(state) operator(=) ident(lex_state)operator(;) - ident(lex_state) operator(=) ident(kw)operator(->)ident(state)operator(;) - reserved(if) operator(()ident(state) operator(==) ident(EXPR_FNAME)operator(\)) operator({) - ident(yylval)operator(.)ident(id) operator(=) ident(rb_intern)operator(()ident(kw)operator(->)ident(name)operator(\);) - reserved(return) ident(kw)operator(->)ident(id)operator([)integer(0)operator(];) - operator(}) - reserved(if) operator(()ident(kw)operator(->)ident(id)operator([)integer(0)operator(]) operator(==) ident(kDO)operator(\)) operator({) - reserved(if) operator(()ident(COND_P)operator((\)\)) reserved(return) ident(kDO_COND)operator(;) - reserved(if) operator(()ident(CMDARG_P)operator((\)) operator(&&) ident(state) operator(!=) ident(EXPR_CMDARG)operator(\)) - reserved(return) ident(kDO_BLOCK)operator(;) - reserved(if) operator(()ident(state) operator(==) ident(EXPR_ENDARG)operator(\)) - reserved(return) ident(kDO_BLOCK)operator(;) - reserved(return) ident(kDO)operator(;) - operator(}) - reserved(if) operator(()ident(state) operator(==) ident(EXPR_BEG)operator(\)) - reserved(return) ident(kw)operator(->)ident(id)operator([)integer(0)operator(];) - reserved(else) operator({) - reserved(if) operator(()ident(kw)operator(->)ident(id)operator([)integer(0)operator(]) operator(!=) ident(kw)operator(->)ident(id)operator([)integer(1)operator(]\)) - ident(lex_state) operator(=) ident(EXPR_BEG)operator(;) - reserved(return) ident(kw)operator(->)ident(id)operator([)integer(1)operator(];) - operator(}) - operator(}) - operator(}) - - reserved(if) operator(()ident(lex_state) operator(==) ident(EXPR_BEG) operator(||) - ident(lex_state) operator(==) ident(EXPR_MID) operator(||) - ident(lex_state) operator(==) ident(EXPR_DOT) operator(||) - ident(lex_state) operator(==) ident(EXPR_ARG) operator(||) - ident(lex_state) operator(==) ident(EXPR_CLASS) operator(||) - ident(lex_state) operator(==) ident(EXPR_CMDARG)operator(\)) operator({) - reserved(if) operator(()ident(cmd_state)operator(\)) operator({) - ident(lex_state) operator(=) ident(EXPR_CMDARG)operator(;) - operator(}) - reserved(else) operator({) - ident(lex_state) operator(=) ident(EXPR_ARG)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - operator(}) - operator(}) - ident(yylval)operator(.)ident(id) operator(=) ident(rb_intern)operator(()ident(tok)operator((\)\);) - reserved(if) operator(()ident(is_local_id)operator(()ident(yylval)operator(.)ident(id)operator(\)) operator(&&) - ident(last_state) operator(!=) ident(EXPR_DOT) operator(&&) - operator((()ident(dyna_in_block)operator((\)) operator(&&) ident(rb_dvar_defined)operator(()ident(yylval)operator(.)ident(id)operator(\)\)) operator(||) ident(local_id)operator(()ident(yylval)operator(.)ident(id)operator(\)\)\)) operator({) - ident(lex_state) operator(=) ident(EXPR_END)operator(;) - operator(}) - reserved(return) ident(result)operator(;) - operator(}) -operator(}) - -ident(NODE)operator(*) -ident(rb_node_newnode)operator(()ident(type)operator(,) ident(a0)operator(,) ident(a1)operator(,) ident(a2)operator(\)) - reserved(enum) ident(node_type) ident(type)operator(;) - ident(VALUE) ident(a0)operator(,) ident(a1)operator(,) ident(a2)operator(;) -operator({) - ident(NODE) operator(*)ident(n) operator(=) operator(()ident(NODE)operator(*\))ident(rb_newobj)operator((\);) - - ident(n)operator(->)ident(flags) operator(|=) ident(T_NODE)operator(;) - ident(nd_set_type)operator(()ident(n)operator(,) ident(type)operator(\);) - ident(nd_set_line)operator(()ident(n)operator(,) ident(ruby_sourceline)operator(\);) - ident(n)operator(->)ident(nd_file) operator(=) ident(ruby_sourcefile)operator(;) - - ident(n)operator(->)ident(u1)operator(.)ident(value) operator(=) ident(a0)operator(;) - ident(n)operator(->)ident(u2)operator(.)ident(value) operator(=) ident(a1)operator(;) - ident(n)operator(->)ident(u3)operator(.)ident(value) operator(=) ident(a2)operator(;) - - reserved(return) ident(n)operator(;) -operator(}) - -directive(static) reserved(enum) ident(node_type) -ident(nodetype)operator(()ident(node)operator(\)) comment(/* for debug */) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(return) operator(()reserved(enum) ident(node_type)operator(\))ident(nd_type)operator(()ident(node)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(nodeline)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(return) ident(nd_line)operator(()ident(node)operator(\);) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(newline_node)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - ident(NODE) operator(*)ident(nl) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(node)operator(\)) operator({) - pre_type(int) ident(line)operator(;) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_NEWLINE)operator(\)) reserved(return) ident(node)operator(;) - ident(line) operator(=) ident(nd_line)operator(()ident(node)operator(\);) - ident(node) operator(=) ident(remove_begin)operator(()ident(node)operator(\);) - ident(nl) operator(=) ident(NEW_NEWLINE)operator(()ident(node)operator(\);) - ident(nd_set_line)operator(()ident(nl)operator(,) ident(line)operator(\);) - ident(nl)operator(->)ident(nd_nth) operator(=) ident(line)operator(;) - operator(}) - reserved(return) ident(nl)operator(;) -operator(}) - -directive(static) directive(void) -ident(fixpos)operator(()ident(node)operator(,) ident(orig)operator(\)) - ident(NODE) operator(*)ident(node)operator(,) operator(*)ident(orig)operator(;) -operator({) - reserved(if) operator((!)ident(node)operator(\)) reserved(return)operator(;) - reserved(if) operator((!)ident(orig)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(orig) operator(==) operator(()ident(NODE)operator(*\))integer(1)operator(\)) reserved(return)operator(;) - ident(node)operator(->)ident(nd_file) operator(=) ident(orig)operator(->)ident(nd_file)operator(;) - ident(nd_set_line)operator(()ident(node)operator(,) ident(nd_line)operator(()ident(orig)operator(\)\);) -operator(}) - -directive(static) directive(void) -ident(parser_warning)operator(()ident(node)operator(,) ident(mesg)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) - directive(const) pre_type(char) operator(*)ident(mesg)operator(;) -operator({) - pre_type(int) ident(line) operator(=) ident(ruby_sourceline)operator(;) - ident(ruby_sourceline) operator(=) ident(nd_line)operator(()ident(node)operator(\);) - ident(rb_warning)operator(()stringoperator(,) ident(mesg)operator(\);) - ident(ruby_sourceline) operator(=) ident(line)operator(;) -operator(}) - -directive(static) directive(void) -ident(parser_warn)operator(()ident(node)operator(,) ident(mesg)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) - directive(const) pre_type(char) operator(*)ident(mesg)operator(;) -operator({) - pre_type(int) ident(line) operator(=) ident(ruby_sourceline)operator(;) - ident(ruby_sourceline) operator(=) ident(nd_line)operator(()ident(node)operator(\);) - ident(rb_warn)operator(()stringoperator(,) ident(mesg)operator(\);) - ident(ruby_sourceline) operator(=) ident(line)operator(;) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(block_append)operator(()ident(head)operator(,) ident(tail)operator(\)) - ident(NODE) operator(*)ident(head)operator(,) operator(*)ident(tail)operator(;) -operator({) - ident(NODE) operator(*)ident(end)operator(,) operator(*)ident(h) operator(=) ident(head)operator(;) - - reserved(if) operator(()ident(tail) operator(==) integer(0)operator(\)) reserved(return) ident(head)operator(;) - - label(again:) - reserved(if) operator(()ident(h) operator(==) integer(0)operator(\)) reserved(return) ident(tail)operator(;) - reserved(switch) operator(()ident(nd_type)operator(()ident(h)operator(\)\)) operator({) - reserved(case) ident(NODE_NEWLINE)operator(:) - ident(h) operator(=) ident(h)operator(->)ident(nd_next)operator(;) - reserved(goto) ident(again)operator(;) - reserved(case) ident(NODE_LIT)operator(:) - reserved(case) ident(NODE_STR)operator(:) - ident(parser_warning)operator(()ident(h)operator(,) stringoperator(\);) - reserved(return) ident(tail)operator(;) - reserved(default)operator(:) - ident(h) operator(=) ident(end) operator(=) ident(NEW_BLOCK)operator(()ident(head)operator(\);) - ident(end)operator(->)ident(nd_end) operator(=) ident(end)operator(;) - ident(fixpos)operator(()ident(end)operator(,) ident(head)operator(\);) - ident(head) operator(=) ident(end)operator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_BLOCK)operator(:) - ident(end) operator(=) ident(h)operator(->)ident(nd_end)operator(;) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(()ident(RTEST)operator(()ident(ruby_verbose)operator(\)\)) operator({) - ident(NODE) operator(*)ident(nd) operator(=) ident(end)operator(->)ident(nd_head)operator(;) - label(newline:) - reserved(switch) operator(()ident(nd_type)operator(()ident(nd)operator(\)\)) operator({) - reserved(case) ident(NODE_RETURN)operator(:) - reserved(case) ident(NODE_BREAK)operator(:) - reserved(case) ident(NODE_NEXT)operator(:) - reserved(case) ident(NODE_REDO)operator(:) - reserved(case) ident(NODE_RETRY)operator(:) - ident(parser_warning)operator(()ident(nd)operator(,) stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_NEWLINE)operator(:) - ident(nd) operator(=) ident(nd)operator(->)ident(nd_next)operator(;) - reserved(goto) ident(newline)operator(;) - - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) - - reserved(if) operator(()ident(nd_type)operator(()ident(tail)operator(\)) operator(!=) ident(NODE_BLOCK)operator(\)) operator({) - ident(tail) operator(=) ident(NEW_BLOCK)operator(()ident(tail)operator(\);) - ident(tail)operator(->)ident(nd_end) operator(=) ident(tail)operator(;) - operator(}) - ident(end)operator(->)ident(nd_next) operator(=) ident(tail)operator(;) - ident(h)operator(->)ident(nd_end) operator(=) ident(tail)operator(->)ident(nd_end)operator(;) - reserved(return) ident(head)operator(;) -operator(}) - -comment(/* append item to the list */) -directive(static) ident(NODE)operator(*) -ident(list_append)operator(()ident(list)operator(,) ident(item)operator(\)) - ident(NODE) operator(*)ident(list)operator(,) operator(*)ident(item)operator(;) -operator({) - ident(NODE) operator(*)ident(last)operator(;) - - reserved(if) operator(()ident(list) operator(==) integer(0)operator(\)) reserved(return) ident(NEW_LIST)operator(()ident(item)operator(\);) - reserved(if) operator(()ident(list)operator(->)ident(nd_next)operator(\)) operator({) - ident(last) operator(=) ident(list)operator(->)ident(nd_next)operator(->)ident(nd_end)operator(;) - operator(}) - reserved(else) operator({) - ident(last) operator(=) ident(list)operator(;) - operator(}) - - ident(list)operator(->)ident(nd_alen) operator(+=) integer(1)operator(;) - ident(last)operator(->)ident(nd_next) operator(=) ident(NEW_LIST)operator(()ident(item)operator(\);) - ident(list)operator(->)ident(nd_next)operator(->)ident(nd_end) operator(=) ident(last)operator(->)ident(nd_next)operator(;) - reserved(return) ident(list)operator(;) -operator(}) - -comment(/* concat two lists */) -directive(static) ident(NODE)operator(*) -ident(list_concat)operator(()ident(head)operator(,) ident(tail)operator(\)) - ident(NODE) operator(*)ident(head)operator(,) operator(*)ident(tail)operator(;) -operator({) - ident(NODE) operator(*)ident(last)operator(;) - - reserved(if) operator(()ident(head)operator(->)ident(nd_next)operator(\)) operator({) - ident(last) operator(=) ident(head)operator(->)ident(nd_next)operator(->)ident(nd_end)operator(;) - operator(}) - reserved(else) operator({) - ident(last) operator(=) ident(head)operator(;) - operator(}) - - ident(head)operator(->)ident(nd_alen) operator(+=) ident(tail)operator(->)ident(nd_alen)operator(;) - ident(last)operator(->)ident(nd_next) operator(=) ident(tail)operator(;) - reserved(if) operator(()ident(tail)operator(->)ident(nd_next)operator(\)) operator({) - ident(head)operator(->)ident(nd_next)operator(->)ident(nd_end) operator(=) ident(tail)operator(->)ident(nd_next)operator(->)ident(nd_end)operator(;) - operator(}) - reserved(else) operator({) - ident(head)operator(->)ident(nd_next)operator(->)ident(nd_end) operator(=) ident(tail)operator(;) - operator(}) - - reserved(return) ident(head)operator(;) -operator(}) - -comment(/* concat two string literals */) -directive(static) ident(NODE) operator(*) -ident(literal_concat)operator(()ident(head)operator(,) ident(tail)operator(\)) - ident(NODE) operator(*)ident(head)operator(,) operator(*)ident(tail)operator(;) -operator({) - reserved(enum) ident(node_type) ident(htype)operator(;) - - reserved(if) operator((!)ident(head)operator(\)) reserved(return) ident(tail)operator(;) - reserved(if) operator((!)ident(tail)operator(\)) reserved(return) ident(head)operator(;) - - ident(htype) operator(=) ident(nd_type)operator(()ident(head)operator(\);) - reserved(if) operator(()ident(htype) operator(==) ident(NODE_EVSTR)operator(\)) operator({) - ident(NODE) operator(*)ident(node) operator(=) ident(NEW_DSTR)operator(()ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\)\);) - ident(head) operator(=) ident(list_append)operator(()ident(node)operator(,) ident(head)operator(\);) - operator(}) - reserved(switch) operator(()ident(nd_type)operator(()ident(tail)operator(\)\)) operator({) - reserved(case) ident(NODE_STR)operator(:) - reserved(if) operator(()ident(htype) operator(==) ident(NODE_STR)operator(\)) operator({) - ident(rb_str_concat)operator(()ident(head)operator(->)ident(nd_lit)operator(,) ident(tail)operator(->)ident(nd_lit)operator(\);) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(tail)operator(\);) - operator(}) - reserved(else) operator({) - ident(list_append)operator(()ident(head)operator(,) ident(tail)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_DSTR)operator(:) - reserved(if) operator(()ident(htype) operator(==) ident(NODE_STR)operator(\)) operator({) - ident(rb_str_concat)operator(()ident(head)operator(->)ident(nd_lit)operator(,) ident(tail)operator(->)ident(nd_lit)operator(\);) - ident(tail)operator(->)ident(nd_lit) operator(=) ident(head)operator(->)ident(nd_lit)operator(;) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(head)operator(\);) - ident(head) operator(=) ident(tail)operator(;) - operator(}) - reserved(else) operator({) - ident(nd_set_type)operator(()ident(tail)operator(,) ident(NODE_ARRAY)operator(\);) - ident(tail)operator(->)ident(nd_head) operator(=) ident(NEW_STR)operator(()ident(tail)operator(->)ident(nd_lit)operator(\);) - ident(list_concat)operator(()ident(head)operator(,) ident(tail)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_EVSTR)operator(:) - reserved(if) operator(()ident(htype) operator(==) ident(NODE_STR)operator(\)) operator({) - ident(nd_set_type)operator(()ident(head)operator(,) ident(NODE_DSTR)operator(\);) - ident(head)operator(->)ident(nd_alen) operator(=) integer(1)operator(;) - operator(}) - ident(list_append)operator(()ident(head)operator(,) ident(tail)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(return) ident(head)operator(;) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(evstr2dstr)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_EVSTR)operator(\)) operator({) - ident(node) operator(=) ident(list_append)operator(()ident(NEW_DSTR)operator(()ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\)\),) ident(node)operator(\);) - operator(}) - reserved(return) ident(node)operator(;) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(new_evstr)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - ident(NODE) operator(*)ident(head) operator(=) ident(node)operator(;) - - label(again:) - reserved(if) operator(()ident(node)operator(\)) operator({) - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_STR)operator(:) reserved(case) ident(NODE_DSTR)operator(:) reserved(case) ident(NODE_EVSTR)operator(:) - reserved(return) ident(node)operator(;) - reserved(case) ident(NODE_NEWLINE)operator(:) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - operator(}) - reserved(return) ident(NEW_EVSTR)operator(()ident(head)operator(\);) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(call_op)operator(()ident(recv)operator(,) ident(id)operator(,) ident(narg)operator(,) ident(arg1)operator(\)) - ident(NODE) operator(*)ident(recv)operator(;) - ident(ID) ident(id)operator(;) - pre_type(int) ident(narg)operator(;) - ident(NODE) operator(*)ident(arg1)operator(;) -operator({) - ident(value_expr)operator(()ident(recv)operator(\);) - reserved(if) operator(()ident(narg) operator(==) integer(1)operator(\)) operator({) - ident(value_expr)operator(()ident(arg1)operator(\);) - ident(arg1) operator(=) ident(NEW_LIST)operator(()ident(arg1)operator(\);) - operator(}) - reserved(else) operator({) - ident(arg1) operator(=) integer(0)operator(;) - operator(}) - reserved(return) ident(NEW_CALL)operator(()ident(recv)operator(,) ident(id)operator(,) ident(arg1)operator(\);) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(match_gen)operator(()ident(node1)operator(,) ident(node2)operator(\)) - ident(NODE) operator(*)ident(node1)operator(;) - ident(NODE) operator(*)ident(node2)operator(;) -operator({) - ident(local_cnt)operator(()char('~')operator(\);) - - ident(value_expr)operator(()ident(node1)operator(\);) - ident(value_expr)operator(()ident(node2)operator(\);) - reserved(if) operator(()ident(node1)operator(\)) operator({) - reserved(switch) operator(()ident(nd_type)operator(()ident(node1)operator(\)\)) operator({) - reserved(case) ident(NODE_DREGX)operator(:) - reserved(case) ident(NODE_DREGX_ONCE)operator(:) - reserved(return) ident(NEW_MATCH2)operator(()ident(node1)operator(,) ident(node2)operator(\);) - - reserved(case) ident(NODE_LIT)operator(:) - reserved(if) operator(()ident(TYPE)operator(()ident(node1)operator(->)ident(nd_lit)operator(\)) operator(==) ident(T_REGEXP)operator(\)) operator({) - reserved(return) ident(NEW_MATCH2)operator(()ident(node1)operator(,) ident(node2)operator(\);) - operator(}) - operator(}) - operator(}) - - reserved(if) operator(()ident(node2)operator(\)) operator({) - reserved(switch) operator(()ident(nd_type)operator(()ident(node2)operator(\)\)) operator({) - reserved(case) ident(NODE_DREGX)operator(:) - reserved(case) ident(NODE_DREGX_ONCE)operator(:) - reserved(return) ident(NEW_MATCH3)operator(()ident(node2)operator(,) ident(node1)operator(\);) - - reserved(case) ident(NODE_LIT)operator(:) - reserved(if) operator(()ident(TYPE)operator(()ident(node2)operator(->)ident(nd_lit)operator(\)) operator(==) ident(T_REGEXP)operator(\)) operator({) - reserved(return) ident(NEW_MATCH3)operator(()ident(node2)operator(,) ident(node1)operator(\);) - operator(}) - operator(}) - operator(}) - - reserved(return) ident(NEW_CALL)operator(()ident(node1)operator(,) ident(tMATCH)operator(,) ident(NEW_LIST)operator(()ident(node2)operator(\)\);) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(gettable)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(if) operator(()ident(id) operator(==) ident(kSELF)operator(\)) operator({) - reserved(return) ident(NEW_SELF)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(id) operator(==) ident(kNIL)operator(\)) operator({) - reserved(return) ident(NEW_NIL)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(id) operator(==) ident(kTRUE)operator(\)) operator({) - reserved(return) ident(NEW_TRUE)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(id) operator(==) ident(kFALSE)operator(\)) operator({) - reserved(return) ident(NEW_FALSE)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(id) operator(==) ident(k__FILE__)operator(\)) operator({) - reserved(return) ident(NEW_STR)operator(()ident(rb_str_new2)operator(()ident(ruby_sourcefile)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(id) operator(==) ident(k__LINE__)operator(\)) operator({) - reserved(return) ident(NEW_LIT)operator(()ident(INT2FIX)operator(()ident(ruby_sourceline)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(is_local_id)operator(()ident(id)operator(\)\)) operator({) - reserved(if) operator(()ident(dyna_in_block)operator((\)) operator(&&) ident(rb_dvar_defined)operator(()ident(id)operator(\)\)) reserved(return) ident(NEW_DVAR)operator(()ident(id)operator(\);) - reserved(if) operator(()ident(local_id)operator(()ident(id)operator(\)\)) reserved(return) ident(NEW_LVAR)operator(()ident(id)operator(\);) - comment(/* method call without arguments */) -comment(#if 0 - /* Rite will warn this */ - rb_warn("ambiguous identifier; %s(\) or self.%s is better for method call", - rb_id2name(id\), rb_id2name(id\)\); -#endif) - reserved(return) ident(NEW_VCALL)operator(()ident(id)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(is_global_id)operator(()ident(id)operator(\)\)) operator({) - reserved(return) ident(NEW_GVAR)operator(()ident(id)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(is_instance_id)operator(()ident(id)operator(\)\)) operator({) - reserved(return) ident(NEW_IVAR)operator(()ident(id)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(is_const_id)operator(()ident(id)operator(\)\)) operator({) - reserved(return) ident(NEW_CONST)operator(()ident(id)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(is_class_id)operator(()ident(id)operator(\)\)) operator({) - reserved(return) ident(NEW_CVAR)operator(()ident(id)operator(\);) - operator(}) - ident(rb_compile_error)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(dyna_var_lookup) ident(_)operator((()ident(ID) ident(id)operator(\)\);) - -directive(static) ident(NODE)operator(*) -ident(assignable)operator(()ident(id)operator(,) ident(val)operator(\)) - ident(ID) ident(id)operator(;) - ident(NODE) operator(*)ident(val)operator(;) -operator({) - ident(value_expr)operator(()ident(val)operator(\);) - reserved(if) operator(()ident(id) operator(==) ident(kSELF)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(id) operator(==) ident(kNIL)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(id) operator(==) ident(kTRUE)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(id) operator(==) ident(kFALSE)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(id) operator(==) ident(k__FILE__)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(id) operator(==) ident(k__LINE__)operator(\)) operator({) - ident(yyerror)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(is_local_id)operator(()ident(id)operator(\)\)) operator({) - reserved(if) operator(()ident(rb_dvar_curr)operator(()ident(id)operator(\)\)) operator({) - reserved(return) ident(NEW_DASGN_CURR)operator(()ident(id)operator(,) ident(val)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(dyna_var_lookup)operator(()ident(id)operator(\)\)) operator({) - reserved(return) ident(NEW_DASGN)operator(()ident(id)operator(,) ident(val)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(local_id)operator(()ident(id)operator(\)) operator(||) operator(!)ident(dyna_in_block)operator((\)\)) operator({) - reserved(return) ident(NEW_LASGN)operator(()ident(id)operator(,) ident(val)operator(\);) - operator(}) - reserved(else)operator({) - ident(rb_dvar_push)operator(()ident(id)operator(,) ident(Qnil)operator(\);) - reserved(return) ident(NEW_DASGN_CURR)operator(()ident(id)operator(,) ident(val)operator(\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(is_global_id)operator(()ident(id)operator(\)\)) operator({) - reserved(return) ident(NEW_GASGN)operator(()ident(id)operator(,) ident(val)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(is_instance_id)operator(()ident(id)operator(\)\)) operator({) - reserved(return) ident(NEW_IASGN)operator(()ident(id)operator(,) ident(val)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(is_const_id)operator(()ident(id)operator(\)\)) operator({) - reserved(if) operator(()ident(in_def) operator(||) ident(in_single)operator(\)) - ident(yyerror)operator(()stringoperator(\);) - reserved(return) ident(NEW_CDECL)operator(()ident(id)operator(,) ident(val)operator(,) integer(0)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(is_class_id)operator(()ident(id)operator(\)\)) operator({) - reserved(if) operator(()ident(in_def) operator(||) ident(in_single)operator(\)) reserved(return) ident(NEW_CVASGN)operator(()ident(id)operator(,) ident(val)operator(\);) - reserved(return) ident(NEW_CVDECL)operator(()ident(id)operator(,) ident(val)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_compile_error)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(aryset)operator(()ident(recv)operator(,) ident(idx)operator(\)) - ident(NODE) operator(*)ident(recv)operator(,) operator(*)ident(idx)operator(;) -operator({) - reserved(if) operator(()ident(recv) operator(&&) ident(nd_type)operator(()ident(recv)operator(\)) operator(==) ident(NODE_SELF)operator(\)) - ident(recv) operator(=) operator(()ident(NODE) operator(*\))integer(1)operator(;) - reserved(else) - ident(value_expr)operator(()ident(recv)operator(\);) - reserved(return) ident(NEW_ATTRASGN)operator(()ident(recv)operator(,) ident(tASET)operator(,) ident(idx)operator(\);) -operator(}) - -ident(ID) -ident(rb_id_attrset)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - ident(id) operator(&=) operator(~)ident(ID_SCOPE_MASK)operator(;) - ident(id) operator(|=) ident(ID_ATTRSET)operator(;) - reserved(return) ident(id)operator(;) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(attrset)operator(()ident(recv)operator(,) ident(id)operator(\)) - ident(NODE) operator(*)ident(recv)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(if) operator(()ident(recv) operator(&&) ident(nd_type)operator(()ident(recv)operator(\)) operator(==) ident(NODE_SELF)operator(\)) - ident(recv) operator(=) operator(()ident(NODE) operator(*\))integer(1)operator(;) - reserved(else) - ident(value_expr)operator(()ident(recv)operator(\);) - reserved(return) ident(NEW_ATTRASGN)operator(()ident(recv)operator(,) ident(rb_id_attrset)operator(()ident(id)operator(\),) integer(0)operator(\);) -operator(}) - -directive(static) directive(void) -ident(rb_backref_error)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_NTH_REF)operator(:) - ident(rb_compile_error)operator(()stringoperator(,) ident(node)operator(->)ident(nd_nth)operator(\);) - reserved(break)operator(;) - reserved(case) ident(NODE_BACK_REF)operator(:) - ident(rb_compile_error)operator(()stringoperator(,) operator(()pre_type(int)operator(\))ident(node)operator(->)ident(nd_nth)operator(\);) - reserved(break)operator(;) - operator(}) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(arg_concat)operator(()ident(node1)operator(,) ident(node2)operator(\)) - ident(NODE) operator(*)ident(node1)operator(;) - ident(NODE) operator(*)ident(node2)operator(;) -operator({) - reserved(if) operator((!)ident(node2)operator(\)) reserved(return) ident(node1)operator(;) - reserved(return) ident(NEW_ARGSCAT)operator(()ident(node1)operator(,) ident(node2)operator(\);) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(arg_add)operator(()ident(node1)operator(,) ident(node2)operator(\)) - ident(NODE) operator(*)ident(node1)operator(;) - ident(NODE) operator(*)ident(node2)operator(;) -operator({) - reserved(if) operator((!)ident(node1)operator(\)) reserved(return) ident(NEW_LIST)operator(()ident(node2)operator(\);) - reserved(if) operator(()ident(nd_type)operator(()ident(node1)operator(\)) operator(==) ident(NODE_ARRAY)operator(\)) operator({) - reserved(return) ident(list_append)operator(()ident(node1)operator(,) ident(node2)operator(\);) - operator(}) - reserved(else) operator({) - reserved(return) ident(NEW_ARGSPUSH)operator(()ident(node1)operator(,) ident(node2)operator(\);) - operator(}) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(node_assign)operator(()ident(lhs)operator(,) ident(rhs)operator(\)) - ident(NODE) operator(*)ident(lhs)operator(,) operator(*)ident(rhs)operator(;) -operator({) - reserved(if) operator((!)ident(lhs)operator(\)) reserved(return) integer(0)operator(;) - - ident(value_expr)operator(()ident(rhs)operator(\);) - reserved(switch) operator(()ident(nd_type)operator(()ident(lhs)operator(\)\)) operator({) - reserved(case) ident(NODE_GASGN)operator(:) - reserved(case) ident(NODE_IASGN)operator(:) - reserved(case) ident(NODE_LASGN)operator(:) - reserved(case) ident(NODE_DASGN)operator(:) - reserved(case) ident(NODE_DASGN_CURR)operator(:) - reserved(case) ident(NODE_MASGN)operator(:) - reserved(case) ident(NODE_CDECL)operator(:) - reserved(case) ident(NODE_CVDECL)operator(:) - reserved(case) ident(NODE_CVASGN)operator(:) - ident(lhs)operator(->)ident(nd_value) operator(=) ident(rhs)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_ATTRASGN)operator(:) - reserved(case) ident(NODE_CALL)operator(:) - ident(lhs)operator(->)ident(nd_args) operator(=) ident(arg_add)operator(()ident(lhs)operator(->)ident(nd_args)operator(,) ident(rhs)operator(\);) - reserved(break)operator(;) - - reserved(default)operator(:) - comment(/* should not happen */) - reserved(break)operator(;) - operator(}) - - reserved(return) ident(lhs)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(value_expr0)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - pre_type(int) ident(cond) operator(=) integer(0)operator(;) - - reserved(while) operator(()ident(node)operator(\)) operator({) - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_DEFN)operator(:) - reserved(case) ident(NODE_DEFS)operator(:) - ident(parser_warning)operator(()ident(node)operator(,) stringoperator(\);) - reserved(return) ident(Qfalse)operator(;) - - reserved(case) ident(NODE_RETURN)operator(:) - reserved(case) ident(NODE_BREAK)operator(:) - reserved(case) ident(NODE_NEXT)operator(:) - reserved(case) ident(NODE_REDO)operator(:) - reserved(case) ident(NODE_RETRY)operator(:) - reserved(if) operator((!)ident(cond)operator(\)) ident(yyerror)operator(()stringoperator(\);) - comment(/* or "control never reach"? */) - reserved(return) ident(Qfalse)operator(;) - - reserved(case) ident(NODE_BLOCK)operator(:) - reserved(while) operator(()ident(node)operator(->)ident(nd_next)operator(\)) operator({) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - operator(}) - ident(node) operator(=) ident(node)operator(->)ident(nd_head)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_BEGIN)operator(:) - ident(node) operator(=) ident(node)operator(->)ident(nd_body)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_IF)operator(:) - reserved(if) operator((!)ident(value_expr)operator(()ident(node)operator(->)ident(nd_body)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - ident(node) operator(=) ident(node)operator(->)ident(nd_else)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_AND)operator(:) - reserved(case) ident(NODE_OR)operator(:) - ident(cond) operator(=) integer(1)operator(;) - ident(node) operator(=) ident(node)operator(->)ident(nd_2nd)operator(;) - reserved(break)operator(;) - - reserved(case) ident(NODE_NEWLINE)operator(:) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(return) ident(Qtrue)operator(;) - operator(}) - operator(}) - - reserved(return) ident(Qtrue)operator(;) -operator(}) - -directive(static) directive(void) -ident(void_expr0)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - pre_type(char) operator(*)ident(useless) operator(=) integer(0)operator(;) - - reserved(if) operator((!)ident(RTEST)operator(()ident(ruby_verbose)operator(\)\)) reserved(return)operator(;) - - label(again:) - reserved(if) operator((!)ident(node)operator(\)) reserved(return)operator(;) - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_NEWLINE)operator(:) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - reserved(goto) ident(again)operator(;) - - reserved(case) ident(NODE_CALL)operator(:) - reserved(switch) operator(()ident(node)operator(->)ident(nd_mid)operator(\)) operator({) - reserved(case) char('+')operator(:) - reserved(case) char('-')operator(:) - reserved(case) char('*')operator(:) - reserved(case) char('/')operator(:) - reserved(case) char('%')operator(:) - reserved(case) ident(tPOW)operator(:) - reserved(case) ident(tUPLUS)operator(:) - reserved(case) ident(tUMINUS)operator(:) - reserved(case) char('|')operator(:) - reserved(case) char('^')operator(:) - reserved(case) char('&')operator(:) - reserved(case) ident(tCMP)operator(:) - reserved(case) char('>')operator(:) - reserved(case) ident(tGEQ)operator(:) - reserved(case) char('<')operator(:) - reserved(case) ident(tLEQ)operator(:) - reserved(case) ident(tEQ)operator(:) - reserved(case) ident(tNEQ)operator(:) - ident(useless) operator(=) ident(rb_id2name)operator(()ident(node)operator(->)ident(nd_mid)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_LVAR)operator(:) - reserved(case) ident(NODE_DVAR)operator(:) - reserved(case) ident(NODE_GVAR)operator(:) - reserved(case) ident(NODE_IVAR)operator(:) - reserved(case) ident(NODE_CVAR)operator(:) - reserved(case) ident(NODE_NTH_REF)operator(:) - reserved(case) ident(NODE_BACK_REF)operator(:) - ident(useless) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_CONST)operator(:) - reserved(case) ident(NODE_CREF)operator(:) - ident(useless) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_LIT)operator(:) - reserved(case) ident(NODE_STR)operator(:) - reserved(case) ident(NODE_DSTR)operator(:) - reserved(case) ident(NODE_DREGX)operator(:) - reserved(case) ident(NODE_DREGX_ONCE)operator(:) - ident(useless) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_COLON2)operator(:) - reserved(case) ident(NODE_COLON3)operator(:) - ident(useless) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_DOT2)operator(:) - ident(useless) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_DOT3)operator(:) - ident(useless) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_SELF)operator(:) - ident(useless) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_NIL)operator(:) - ident(useless) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_TRUE)operator(:) - ident(useless) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_FALSE)operator(:) - ident(useless) operator(=) stringoperator(;) - reserved(break)operator(;) - reserved(case) ident(NODE_DEFINED)operator(:) - ident(useless) operator(=) stringoperator(;) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(()ident(useless)operator(\)) operator({) - pre_type(int) ident(line) operator(=) ident(ruby_sourceline)operator(;) - - ident(ruby_sourceline) operator(=) ident(nd_line)operator(()ident(node)operator(\);) - ident(rb_warn)operator(()stringoperator(,) ident(useless)operator(\);) - ident(ruby_sourceline) operator(=) ident(line)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(void_stmts)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(if) operator((!)ident(RTEST)operator(()ident(ruby_verbose)operator(\)\)) reserved(return)operator(;) - reserved(if) operator((!)ident(node)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(!=) ident(NODE_BLOCK)operator(\)) reserved(return)operator(;) - - reserved(for) operator((;;\)) operator({) - reserved(if) operator((!)ident(node)operator(->)ident(nd_next)operator(\)) reserved(return)operator(;) - ident(void_expr0)operator(()ident(node)operator(->)ident(nd_head)operator(\);) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - operator(}) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(remove_begin)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - ident(NODE) operator(**)ident(n) operator(=) operator(&)ident(node)operator(;) - reserved(while) operator((*)ident(n)operator(\)) operator({) - reserved(switch) operator(()ident(nd_type)operator((*)ident(n)operator(\)\)) operator({) - reserved(case) ident(NODE_NEWLINE)operator(:) - ident(n) operator(=) operator(&(*)ident(n)operator(\)->)ident(nd_next)operator(;) - reserved(continue)operator(;) - reserved(case) ident(NODE_BEGIN)operator(:) - operator(*)ident(n) operator(=) operator((*)ident(n)operator(\)->)ident(nd_body)operator(;) - reserved(default)operator(:) - reserved(return) ident(node)operator(;) - operator(}) - operator(}) - reserved(return) ident(node)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(assign_in_cond)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_MASGN)operator(:) - ident(yyerror)operator(()stringoperator(\);) - reserved(return) integer(1)operator(;) - - reserved(case) ident(NODE_LASGN)operator(:) - reserved(case) ident(NODE_DASGN)operator(:) - reserved(case) ident(NODE_GASGN)operator(:) - reserved(case) ident(NODE_IASGN)operator(:) - reserved(break)operator(;) - - reserved(case) ident(NODE_NEWLINE)operator(:) - reserved(default)operator(:) - reserved(return) integer(0)operator(;) - operator(}) - - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(->)ident(nd_value)operator(\)\)) operator({) - reserved(case) ident(NODE_LIT)operator(:) - reserved(case) ident(NODE_STR)operator(:) - reserved(case) ident(NODE_NIL)operator(:) - reserved(case) ident(NODE_TRUE)operator(:) - reserved(case) ident(NODE_FALSE)operator(:) - comment(/* reports always */) - ident(parser_warn)operator(()ident(node)operator(->)ident(nd_value)operator(,) stringoperator(\);) - reserved(return) integer(1)operator(;) - - reserved(case) ident(NODE_DSTR)operator(:) - reserved(case) ident(NODE_XSTR)operator(:) - reserved(case) ident(NODE_DXSTR)operator(:) - reserved(case) ident(NODE_EVSTR)operator(:) - reserved(case) ident(NODE_DREGX)operator(:) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) -comment(#if 0 - if (assign_in_cond(node->nd_value\) == 0\) { - parser_warning(node->nd_value, "assignment in condition"\); - } -#endif) - reserved(return) integer(1)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(e_option_supplied)operator((\)) -operator({) - reserved(if) operator(()ident(strcmp)operator(()ident(ruby_sourcefile)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) directive(void) -ident(warn_unless_e_option)operator(()ident(node)operator(,) ident(str)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) - directive(const) pre_type(char) operator(*)ident(str)operator(;) -operator({) - reserved(if) operator((!)ident(e_option_supplied)operator((\)\)) ident(parser_warn)operator(()ident(node)operator(,) ident(str)operator(\);) -operator(}) - -directive(static) directive(void) -ident(warning_unless_e_option)operator(()ident(node)operator(,) ident(str)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) - directive(const) pre_type(char) operator(*)ident(str)operator(;) -operator({) - reserved(if) operator((!)ident(e_option_supplied)operator((\)\)) ident(parser_warning)operator(()ident(node)operator(,) ident(str)operator(\);) -operator(}) - -directive(static) directive(void) -ident(fixup_nodes)operator(()ident(rootnode)operator(\)) - ident(NODE) operator(**)ident(rootnode)operator(;) -operator({) - ident(NODE) operator(*)ident(node)operator(,) operator(*)ident(next)operator(,) operator(*)ident(head)operator(;) - - reserved(for) operator(()ident(node) operator(=) operator(*)ident(rootnode)operator(;) ident(node)operator(;) ident(node) operator(=) ident(next)operator(\)) operator({) - reserved(enum) ident(node_type) ident(type)operator(;) - ident(VALUE) ident(val)operator(;) - - ident(next) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - ident(head) operator(=) ident(node)operator(->)ident(nd_head)operator(;) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(node)operator(\);) - operator(*)ident(rootnode) operator(=) ident(next)operator(;) - reserved(switch) operator(()ident(type) operator(=) ident(nd_type)operator(()ident(head)operator(\)\)) operator({) - reserved(case) ident(NODE_DOT2)operator(:) - reserved(case) ident(NODE_DOT3)operator(:) - ident(val) operator(=) ident(rb_range_new)operator(()ident(head)operator(->)ident(nd_beg)operator(->)ident(nd_lit)operator(,) ident(head)operator(->)ident(nd_end)operator(->)ident(nd_lit)operator(,) - ident(type) operator(==) ident(NODE_DOT3) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(\);) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(head)operator(->)ident(nd_beg)operator(\);) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(head)operator(->)ident(nd_end)operator(\);) - ident(nd_set_type)operator(()ident(head)operator(,) ident(NODE_LIT)operator(\);) - ident(head)operator(->)ident(nd_lit) operator(=) ident(val)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) -operator(}) - -directive(static) ident(NODE) operator(*)ident(cond0)operator((\);) - -directive(static) ident(NODE)operator(*) -ident(range_op)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(enum) ident(node_type) ident(type)operator(;) - - reserved(if) operator(()ident(node) operator(==) integer(0)operator(\)) reserved(return) integer(0)operator(;) - - ident(type) operator(=) ident(nd_type)operator(()ident(node)operator(\);) - reserved(if) operator(()ident(type) operator(==) ident(NODE_NEWLINE)operator(\)) operator({) - ident(node) operator(=) ident(node)operator(->)ident(nd_next)operator(;) - ident(type) operator(=) ident(nd_type)operator(()ident(node)operator(\);) - operator(}) - ident(value_expr)operator(()ident(node)operator(\);) - reserved(if) operator(()ident(type) operator(==) ident(NODE_LIT) operator(&&) ident(FIXNUM_P)operator(()ident(node)operator(->)ident(nd_lit)operator(\)\)) operator({) - ident(warn_unless_e_option)operator(()ident(node)operator(,) stringoperator(\);) - reserved(return) ident(call_op)operator(()ident(node)operator(,)ident(tEQ)operator(,)integer(1)operator(,)ident(NEW_GVAR)operator(()ident(rb_intern)operator(()stringoperator(\)\)\);) - operator(}) - reserved(return) ident(cond0)operator(()ident(node)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(literal_node)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(if) operator((!)ident(node)operator(\)) reserved(return) integer(1)operator(;) comment(/* same as NODE_NIL */) - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_LIT)operator(:) - reserved(case) ident(NODE_STR)operator(:) - reserved(case) ident(NODE_DSTR)operator(:) - reserved(case) ident(NODE_EVSTR)operator(:) - reserved(case) ident(NODE_DREGX)operator(:) - reserved(case) ident(NODE_DREGX_ONCE)operator(:) - reserved(case) ident(NODE_DSYM)operator(:) - reserved(return) integer(2)operator(;) - reserved(case) ident(NODE_TRUE)operator(:) - reserved(case) ident(NODE_FALSE)operator(:) - reserved(case) ident(NODE_NIL)operator(:) - reserved(return) integer(1)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(cond0)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(if) operator(()ident(node) operator(==) integer(0)operator(\)) reserved(return) integer(0)operator(;) - ident(assign_in_cond)operator(()ident(node)operator(\);) - - reserved(switch) operator(()ident(nd_type)operator(()ident(node)operator(\)\)) operator({) - reserved(case) ident(NODE_DSTR)operator(:) - reserved(case) ident(NODE_EVSTR)operator(:) - reserved(case) ident(NODE_STR)operator(:) - ident(rb_warn)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_DREGX)operator(:) - reserved(case) ident(NODE_DREGX_ONCE)operator(:) - ident(warning_unless_e_option)operator(()ident(node)operator(,) stringoperator(\);) - ident(local_cnt)operator(()char('_')operator(\);) - ident(local_cnt)operator(()char('~')operator(\);) - reserved(return) ident(NEW_MATCH2)operator(()ident(node)operator(,) ident(NEW_GVAR)operator(()ident(rb_intern)operator(()stringoperator(\)\)\);) - - reserved(case) ident(NODE_AND)operator(:) - reserved(case) ident(NODE_OR)operator(:) - ident(node)operator(->)ident(nd_1st) operator(=) ident(cond0)operator(()ident(node)operator(->)ident(nd_1st)operator(\);) - ident(node)operator(->)ident(nd_2nd) operator(=) ident(cond0)operator(()ident(node)operator(->)ident(nd_2nd)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_DOT2)operator(:) - reserved(case) ident(NODE_DOT3)operator(:) - ident(node)operator(->)ident(nd_beg) operator(=) ident(range_op)operator(()ident(node)operator(->)ident(nd_beg)operator(\);) - ident(node)operator(->)ident(nd_end) operator(=) ident(range_op)operator(()ident(node)operator(->)ident(nd_end)operator(\);) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_DOT2)operator(\)) ident(nd_set_type)operator(()ident(node)operator(,)ident(NODE_FLIP2)operator(\);) - reserved(else) reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_DOT3)operator(\)) ident(nd_set_type)operator(()ident(node)operator(,) ident(NODE_FLIP3)operator(\);) - ident(node)operator(->)ident(nd_cnt) operator(=) ident(local_append)operator(()ident(internal_id)operator((\)\);) - reserved(if) operator((!)ident(e_option_supplied)operator((\)\)) operator({) - pre_type(int) ident(b) operator(=) ident(literal_node)operator(()ident(node)operator(->)ident(nd_beg)operator(\);) - pre_type(int) ident(e) operator(=) ident(literal_node)operator(()ident(node)operator(->)ident(nd_end)operator(\);) - reserved(if) operator((()ident(b) operator(==) integer(1) operator(&&) ident(e) operator(==) integer(1)operator(\)) operator(||) operator(()ident(b) operator(+) ident(e) operator(>=) integer(2) operator(&&) ident(RTEST)operator(()ident(ruby_verbose)operator(\)\)\)) operator({) - ident(parser_warn)operator(()ident(node)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(NODE_DSYM)operator(:) - ident(parser_warning)operator(()ident(node)operator(,) stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(NODE_LIT)operator(:) - reserved(if) operator(()ident(TYPE)operator(()ident(node)operator(->)ident(nd_lit)operator(\)) operator(==) ident(T_REGEXP)operator(\)) operator({) - ident(warn_unless_e_option)operator(()ident(node)operator(,) stringoperator(\);) - ident(nd_set_type)operator(()ident(node)operator(,) ident(NODE_MATCH)operator(\);) - ident(local_cnt)operator(()char('_')operator(\);) - ident(local_cnt)operator(()char('~')operator(\);) - operator(}) - reserved(else) operator({) - ident(parser_warning)operator(()ident(node)operator(,) stringoperator(\);) - operator(}) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - reserved(return) ident(node)operator(;) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(cond)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(if) operator(()ident(node) operator(==) integer(0)operator(\)) reserved(return) integer(0)operator(;) - ident(value_expr)operator(()ident(node)operator(\);) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_NEWLINE)operator(\){) - ident(node)operator(->)ident(nd_next) operator(=) ident(cond0)operator(()ident(node)operator(->)ident(nd_next)operator(\);) - reserved(return) ident(node)operator(;) - operator(}) - reserved(return) ident(cond0)operator(()ident(node)operator(\);) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(logop)operator(()ident(type)operator(,) ident(left)operator(,) ident(right)operator(\)) - reserved(enum) ident(node_type) ident(type)operator(;) - ident(NODE) operator(*)ident(left)operator(,) operator(*)ident(right)operator(;) -operator({) - ident(value_expr)operator(()ident(left)operator(\);) - reserved(if) operator(()ident(left) operator(&&) ident(nd_type)operator(()ident(left)operator(\)) operator(==) ident(type)operator(\)) operator({) - ident(NODE) operator(*)ident(node) operator(=) ident(left)operator(,) operator(*)ident(second)operator(;) - reserved(while) operator((()ident(second) operator(=) ident(node)operator(->)ident(nd_2nd)operator(\)) operator(!=) integer(0) operator(&&) ident(nd_type)operator(()ident(second)operator(\)) operator(==) ident(type)operator(\)) operator({) - ident(node) operator(=) ident(second)operator(;) - operator(}) - ident(node)operator(->)ident(nd_2nd) operator(=) ident(NEW_NODE)operator(()ident(type)operator(,) ident(second)operator(,) ident(right)operator(,) integer(0)operator(\);) - reserved(return) ident(left)operator(;) - operator(}) - reserved(return) ident(NEW_NODE)operator(()ident(type)operator(,) ident(left)operator(,) ident(right)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(cond_negative)operator(()ident(nodep)operator(\)) - ident(NODE) operator(**)ident(nodep)operator(;) -operator({) - ident(NODE) operator(*)ident(c) operator(=) operator(*)ident(nodep)operator(;) - - reserved(if) operator((!)ident(c)operator(\)) reserved(return) integer(0)operator(;) - reserved(switch) operator(()ident(nd_type)operator(()ident(c)operator(\)\)) operator({) - reserved(case) ident(NODE_NOT)operator(:) - operator(*)ident(nodep) operator(=) ident(c)operator(->)ident(nd_body)operator(;) - reserved(return) integer(1)operator(;) - reserved(case) ident(NODE_NEWLINE)operator(:) - reserved(if) operator(()ident(c)operator(->)ident(nd_next) operator(&&) ident(nd_type)operator(()ident(c)operator(->)ident(nd_next)operator(\)) operator(==) ident(NODE_NOT)operator(\)) operator({) - ident(c)operator(->)ident(nd_next) operator(=) ident(c)operator(->)ident(nd_next)operator(->)ident(nd_body)operator(;) - reserved(return) integer(1)operator(;) - operator(}) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) directive(void) -ident(no_blockarg)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(if) operator(()ident(node) operator(&&) ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_BLOCK_PASS)operator(\)) operator({) - ident(rb_compile_error)operator(()stringoperator(\);) - operator(}) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(ret_args)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(if) operator(()ident(node)operator(\)) operator({) - ident(no_blockarg)operator(()ident(node)operator(\);) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_ARRAY) operator(&&) ident(node)operator(->)ident(nd_next) operator(==) integer(0)operator(\)) operator({) - ident(node) operator(=) ident(node)operator(->)ident(nd_head)operator(;) - operator(}) - reserved(if) operator(()ident(node) operator(&&) ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_SPLAT)operator(\)) operator({) - ident(node) operator(=) ident(NEW_SVALUE)operator(()ident(node)operator(\);) - operator(}) - operator(}) - reserved(return) ident(node)operator(;) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(new_yield)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - pre_type(long) ident(state) operator(=) ident(Qtrue)operator(;) - - reserved(if) operator(()ident(node)operator(\)) operator({) - ident(no_blockarg)operator(()ident(node)operator(\);) - reserved(if) operator(()ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_ARRAY) operator(&&) ident(node)operator(->)ident(nd_next) operator(==) integer(0)operator(\)) operator({) - ident(node) operator(=) ident(node)operator(->)ident(nd_head)operator(;) - ident(state) operator(=) ident(Qfalse)operator(;) - operator(}) - reserved(if) operator(()ident(node) operator(&&) ident(nd_type)operator(()ident(node)operator(\)) operator(==) ident(NODE_SPLAT)operator(\)) operator({) - ident(state) operator(=) ident(Qtrue)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(state) operator(=) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(NEW_YIELD)operator(()ident(node)operator(,) ident(state)operator(\);) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(negate_lit)operator(()ident(node)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(node)operator(->)ident(nd_lit)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(node)operator(->)ident(nd_lit) operator(=) ident(LONG2FIX)operator((-)ident(FIX2LONG)operator(()ident(node)operator(->)ident(nd_lit)operator(\)\);) - reserved(break)operator(;) - reserved(case) ident(T_BIGNUM)operator(:) - ident(node)operator(->)ident(nd_lit) operator(=) ident(rb_funcall)operator(()ident(node)operator(->)ident(nd_lit)operator(,)ident(tUMINUS)operator(,)integer(0)operator(,)integer(0)operator(\);) - reserved(break)operator(;) - reserved(case) ident(T_FLOAT)operator(:) - ident(RFLOAT)operator(()ident(node)operator(->)ident(nd_lit)operator(\)->)ident(value) operator(=) operator(-)ident(RFLOAT)operator(()ident(node)operator(->)ident(nd_lit)operator(\)->)ident(value)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - reserved(return) ident(node)operator(;) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(arg_blk_pass)operator(()ident(node1)operator(,) ident(node2)operator(\)) - ident(NODE) operator(*)ident(node1)operator(;) - ident(NODE) operator(*)ident(node2)operator(;) -operator({) - reserved(if) operator(()ident(node2)operator(\)) operator({) - ident(node2)operator(->)ident(nd_head) operator(=) ident(node1)operator(;) - reserved(return) ident(node2)operator(;) - operator(}) - reserved(return) ident(node1)operator(;) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(arg_prepend)operator(()ident(node1)operator(,) ident(node2)operator(\)) - ident(NODE) operator(*)ident(node1)operator(,) operator(*)ident(node2)operator(;) -operator({) - reserved(switch) operator(()ident(nd_type)operator(()ident(node2)operator(\)\)) operator({) - reserved(case) ident(NODE_ARRAY)operator(:) - reserved(return) ident(list_concat)operator(()ident(NEW_LIST)operator(()ident(node1)operator(\),) ident(node2)operator(\);) - - reserved(case) ident(NODE_SPLAT)operator(:) - reserved(return) ident(arg_concat)operator(()ident(node1)operator(,) ident(node2)operator(->)ident(nd_head)operator(\);) - - reserved(case) ident(NODE_BLOCK_PASS)operator(:) - ident(node2)operator(->)ident(nd_body) operator(=) ident(arg_prepend)operator(()ident(node1)operator(,) ident(node2)operator(->)ident(nd_body)operator(\);) - reserved(return) ident(node2)operator(;) - - reserved(default)operator(:) - ident(rb_bug)operator(()stringoperator(,) ident(nd_type)operator(()ident(node2)operator(\)\);) - operator(}) - reserved(return) integer(0)operator(;) comment(/* not reached */) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(new_call)operator(()ident(r)operator(,)ident(m)operator(,)ident(a)operator(\)) - ident(NODE) operator(*)ident(r)operator(;) - ident(ID) ident(m)operator(;) - ident(NODE) operator(*)ident(a)operator(;) -operator({) - reserved(if) operator(()ident(a) operator(&&) ident(nd_type)operator(()ident(a)operator(\)) operator(==) ident(NODE_BLOCK_PASS)operator(\)) operator({) - ident(a)operator(->)ident(nd_iter) operator(=) ident(NEW_CALL)operator(()ident(r)operator(,)ident(m)operator(,)ident(a)operator(->)ident(nd_head)operator(\);) - reserved(return) ident(a)operator(;) - operator(}) - reserved(return) ident(NEW_CALL)operator(()ident(r)operator(,)ident(m)operator(,)ident(a)operator(\);) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(new_fcall)operator(()ident(m)operator(,)ident(a)operator(\)) - ident(ID) ident(m)operator(;) - ident(NODE) operator(*)ident(a)operator(;) -operator({) - reserved(if) operator(()ident(a) operator(&&) ident(nd_type)operator(()ident(a)operator(\)) operator(==) ident(NODE_BLOCK_PASS)operator(\)) operator({) - ident(a)operator(->)ident(nd_iter) operator(=) ident(NEW_FCALL)operator(()ident(m)operator(,)ident(a)operator(->)ident(nd_head)operator(\);) - reserved(return) ident(a)operator(;) - operator(}) - reserved(return) ident(NEW_FCALL)operator(()ident(m)operator(,)ident(a)operator(\);) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(new_super)operator(()ident(a)operator(\)) - ident(NODE) operator(*)ident(a)operator(;) -operator({) - reserved(if) operator(()ident(a) operator(&&) ident(nd_type)operator(()ident(a)operator(\)) operator(==) ident(NODE_BLOCK_PASS)operator(\)) operator({) - ident(a)operator(->)ident(nd_iter) operator(=) ident(NEW_SUPER)operator(()ident(a)operator(->)ident(nd_head)operator(\);) - reserved(return) ident(a)operator(;) - operator(}) - reserved(return) ident(NEW_SUPER)operator(()ident(a)operator(\);) -operator(}) - -directive(static) reserved(struct) ident(local_vars) operator({) - ident(ID) operator(*)ident(tbl)operator(;) - pre_type(int) ident(nofree)operator(;) - pre_type(int) ident(cnt)operator(;) - pre_type(int) ident(dlev)operator(;) - reserved(struct) ident(RVarmap)operator(*) ident(dyna_vars)operator(;) - reserved(struct) ident(local_vars) operator(*)ident(prev)operator(;) -operator(}) operator(*)ident(lvtbl)operator(;) - -directive(static) directive(void) -ident(local_push)operator(()ident(top)operator(\)) - pre_type(int) ident(top)operator(;) -operator({) - reserved(struct) ident(local_vars) operator(*)ident(local)operator(;) - - ident(local) operator(=) ident(ALLOC)operator(()reserved(struct) ident(local_vars)operator(\);) - ident(local)operator(->)ident(prev) operator(=) ident(lvtbl)operator(;) - ident(local)operator(->)ident(nofree) operator(=) integer(0)operator(;) - ident(local)operator(->)ident(cnt) operator(=) integer(0)operator(;) - ident(local)operator(->)ident(tbl) operator(=) integer(0)operator(;) - ident(local)operator(->)ident(dlev) operator(=) integer(0)operator(;) - ident(local)operator(->)ident(dyna_vars) operator(=) ident(ruby_dyna_vars)operator(;) - ident(lvtbl) operator(=) ident(local)operator(;) - reserved(if) operator((!)ident(top)operator(\)) operator({) - comment(/* preserve reference for GC, but link should be cut. */) - ident(rb_dvar_push)operator(()integer(0)operator(,) operator(()ident(VALUE)operator(\))ident(ruby_dyna_vars)operator(\);) - ident(ruby_dyna_vars)operator(->)ident(next) operator(=) integer(0)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(local_pop)operator((\)) -operator({) - reserved(struct) ident(local_vars) operator(*)ident(local) operator(=) ident(lvtbl)operator(->)ident(prev)operator(;) - - reserved(if) operator(()ident(lvtbl)operator(->)ident(tbl)operator(\)) operator({) - reserved(if) operator((!)ident(lvtbl)operator(->)ident(nofree)operator(\)) ident(xfree)operator(()ident(lvtbl)operator(->)ident(tbl)operator(\);) - reserved(else) ident(lvtbl)operator(->)ident(tbl)operator([)integer(0)operator(]) operator(=) ident(lvtbl)operator(->)ident(cnt)operator(;) - operator(}) - ident(ruby_dyna_vars) operator(=) ident(lvtbl)operator(->)ident(dyna_vars)operator(;) - ident(xfree)operator(()ident(lvtbl)operator(\);) - ident(lvtbl) operator(=) ident(local)operator(;) -operator(}) - -directive(static) ident(ID)operator(*) -ident(local_tbl)operator((\)) -operator({) - ident(lvtbl)operator(->)ident(nofree) operator(=) integer(1)operator(;) - reserved(return) ident(lvtbl)operator(->)ident(tbl)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(local_append)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(if) operator(()ident(lvtbl)operator(->)ident(tbl) operator(==) integer(0)operator(\)) operator({) - ident(lvtbl)operator(->)ident(tbl) operator(=) ident(ALLOC_N)operator(()ident(ID)operator(,) integer(4)operator(\);) - ident(lvtbl)operator(->)ident(tbl)operator([)integer(0)operator(]) operator(=) integer(0)operator(;) - ident(lvtbl)operator(->)ident(tbl)operator([)integer(1)operator(]) operator(=) char('_')operator(;) - ident(lvtbl)operator(->)ident(tbl)operator([)integer(2)operator(]) operator(=) char('~')operator(;) - ident(lvtbl)operator(->)ident(cnt) operator(=) integer(2)operator(;) - reserved(if) operator(()ident(id) operator(==) char('_')operator(\)) reserved(return) integer(0)operator(;) - reserved(if) operator(()ident(id) operator(==) char('~')operator(\)) reserved(return) integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(REALLOC_N)operator(()ident(lvtbl)operator(->)ident(tbl)operator(,) ident(ID)operator(,) ident(lvtbl)operator(->)ident(cnt)operator(+)integer(2)operator(\);) - operator(}) - - ident(lvtbl)operator(->)ident(tbl)operator([)ident(lvtbl)operator(->)ident(cnt)operator(+)integer(1)operator(]) operator(=) ident(id)operator(;) - reserved(return) ident(lvtbl)operator(->)ident(cnt)operator(++;) -operator(}) - -directive(static) pre_type(int) -ident(local_cnt)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - pre_type(int) ident(cnt)operator(,) ident(max)operator(;) - - reserved(if) operator(()ident(id) operator(==) integer(0)operator(\)) reserved(return) ident(lvtbl)operator(->)ident(cnt)operator(;) - - reserved(for) operator(()ident(cnt)operator(=)integer(1)operator(,) ident(max)operator(=)ident(lvtbl)operator(->)ident(cnt)operator(+)integer(1)operator(;) ident(cnt)operator(<)ident(max)operator(;)ident(cnt)operator(++\)) operator({) - reserved(if) operator(()ident(lvtbl)operator(->)ident(tbl)operator([)ident(cnt)operator(]) operator(==) ident(id)operator(\)) reserved(return) ident(cnt)operator(-)integer(1)operator(;) - operator(}) - reserved(return) ident(local_append)operator(()ident(id)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(local_id)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - pre_type(int) ident(i)operator(,) ident(max)operator(;) - - reserved(if) operator(()ident(lvtbl) operator(==) integer(0)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(3)operator(,) ident(max)operator(=)ident(lvtbl)operator(->)ident(cnt)operator(+)integer(1)operator(;) ident(i)operator(<)ident(max)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(lvtbl)operator(->)ident(tbl)operator([)ident(i)operator(]) operator(==) ident(id)operator(\)) reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) directive(void) -ident(top_local_init)operator((\)) -operator({) - ident(local_push)operator(()integer(1)operator(\);) - ident(lvtbl)operator(->)ident(cnt) operator(=) ident(ruby_scope)operator(->)ident(local_tbl)operator(?)ident(ruby_scope)operator(->)ident(local_tbl)operator([)integer(0)operator(]:)integer(0)operator(;) - reserved(if) operator(()ident(lvtbl)operator(->)ident(cnt) operator(>) integer(0)operator(\)) operator({) - ident(lvtbl)operator(->)ident(tbl) operator(=) ident(ALLOC_N)operator(()ident(ID)operator(,) ident(lvtbl)operator(->)ident(cnt)operator(+)integer(3)operator(\);) - ident(MEMCPY)operator(()ident(lvtbl)operator(->)ident(tbl)operator(,) ident(ruby_scope)operator(->)ident(local_tbl)operator(,) ident(ID)operator(,) ident(lvtbl)operator(->)ident(cnt)operator(+)integer(1)operator(\);) - operator(}) - reserved(else) operator({) - ident(lvtbl)operator(->)ident(tbl) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(ruby_dyna_vars)operator(\)) - ident(lvtbl)operator(->)ident(dlev) operator(=) integer(1)operator(;) - reserved(else) - ident(lvtbl)operator(->)ident(dlev) operator(=) integer(0)operator(;) -operator(}) - -directive(static) directive(void) -ident(top_local_setup)operator((\)) -operator({) - pre_type(int) ident(len) operator(=) ident(lvtbl)operator(->)ident(cnt)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(if) operator(()ident(len) operator(>) integer(0)operator(\)) operator({) - ident(i) operator(=) ident(ruby_scope)operator(->)ident(local_tbl)operator(?)ident(ruby_scope)operator(->)ident(local_tbl)operator([)integer(0)operator(]:)integer(0)operator(;) - - reserved(if) operator(()ident(i) operator(<) ident(len)operator(\)) operator({) - reserved(if) operator(()ident(i) operator(==) integer(0) operator(||) operator(()ident(ruby_scope)operator(->)ident(flags) operator(&) ident(SCOPE_MALLOC)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(VALUE) operator(*)ident(vars) operator(=) ident(ALLOC_N)operator(()ident(VALUE)operator(,) ident(len)operator(+)integer(1)operator(\);) - reserved(if) operator(()ident(ruby_scope)operator(->)ident(local_vars)operator(\)) operator({) - operator(*)ident(vars)operator(++) operator(=) ident(ruby_scope)operator(->)ident(local_vars)operator([-)integer(1)operator(];) - ident(MEMCPY)operator(()ident(vars)operator(,) ident(ruby_scope)operator(->)ident(local_vars)operator(,) ident(VALUE)operator(,) ident(i)operator(\);) - ident(rb_mem_clear)operator(()ident(vars)operator(+)ident(i)operator(,) ident(len)operator(-)ident(i)operator(\);) - operator(}) - reserved(else) operator({) - operator(*)ident(vars)operator(++) operator(=) integer(0)operator(;) - ident(rb_mem_clear)operator(()ident(vars)operator(,) ident(len)operator(\);) - operator(}) - ident(ruby_scope)operator(->)ident(local_vars) operator(=) ident(vars)operator(;) - ident(ruby_scope)operator(->)ident(flags) operator(|=) ident(SCOPE_MALLOC)operator(;) - operator(}) - reserved(else) operator({) - ident(VALUE) operator(*)ident(vars) operator(=) ident(ruby_scope)operator(->)ident(local_vars)operator(-)integer(1)operator(;) - ident(REALLOC_N)operator(()ident(vars)operator(,) ident(VALUE)operator(,) ident(len)operator(+)integer(1)operator(\);) - ident(ruby_scope)operator(->)ident(local_vars) operator(=) ident(vars)operator(+)integer(1)operator(;) - ident(rb_mem_clear)operator(()ident(ruby_scope)operator(->)ident(local_vars)operator(+)ident(i)operator(,) ident(len)operator(-)ident(i)operator(\);) - operator(}) - reserved(if) operator(()ident(ruby_scope)operator(->)ident(local_tbl) operator(&&) ident(ruby_scope)operator(->)ident(local_vars)operator([-)integer(1)operator(]) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator((!()ident(ruby_scope)operator(->)ident(flags) operator(&) ident(SCOPE_CLONE)operator(\)\)) - ident(xfree)operator(()ident(ruby_scope)operator(->)ident(local_tbl)operator(\);) - operator(}) - ident(ruby_scope)operator(->)ident(local_vars)operator([-)integer(1)operator(]) operator(=) integer(0)operator(;) comment(/* no reference needed */) - ident(ruby_scope)operator(->)ident(local_tbl) operator(=) ident(local_tbl)operator((\);) - operator(}) - operator(}) - ident(local_pop)operator((\);) -operator(}) - -preprocessor(#define) ident(DVAR_USED) ident(FL_USER6) - -directive(static) ident(VALUE) -ident(dyna_var_lookup)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(struct) ident(RVarmap) operator(*)ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) - - reserved(while) operator(()ident(vars)operator(\)) operator({) - reserved(if) operator(()ident(vars)operator(->)ident(id) operator(==) ident(id)operator(\)) operator({) - ident(FL_SET)operator(()ident(vars)operator(,) ident(DVAR_USED)operator(\);) - reserved(return) ident(Qtrue)operator(;) - operator(}) - ident(vars) operator(=) ident(vars)operator(->)ident(next)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) reserved(struct) ident(RVarmap)operator(*) -ident(dyna_push)operator((\)) -operator({) - reserved(struct) ident(RVarmap)operator(*) ident(vars) operator(=) ident(ruby_dyna_vars)operator(;) - - ident(rb_dvar_push)operator(()integer(0)operator(,) integer(0)operator(\);) - ident(lvtbl)operator(->)ident(dlev)operator(++;) - reserved(return) ident(vars)operator(;) -operator(}) - -directive(static) directive(void) -ident(dyna_pop)operator(()ident(vars)operator(\)) - reserved(struct) ident(RVarmap)operator(*) ident(vars)operator(;) -operator({) - ident(lvtbl)operator(->)ident(dlev)operator(--;) - ident(ruby_dyna_vars) operator(=) ident(vars)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(dyna_in_block)operator((\)) -operator({) - reserved(return) operator(()ident(lvtbl)operator(->)ident(dlev) operator(>) integer(0)operator(\);) -operator(}) - -directive(static) ident(NODE) operator(*) -ident(dyna_init)operator(()ident(node)operator(,) ident(pre)operator(\)) - ident(NODE) operator(*)ident(node)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(pre)operator(;) -operator({) - reserved(struct) ident(RVarmap) operator(*)ident(post) operator(=) ident(ruby_dyna_vars)operator(;) - ident(NODE) operator(*)ident(var)operator(;) - - reserved(if) operator((!)ident(node) operator(||) operator(!)ident(post) operator(||) ident(pre) operator(==) ident(post)operator(\)) reserved(return) ident(node)operator(;) - reserved(for) operator(()ident(var) operator(=) integer(0)operator(;) ident(post) operator(!=) ident(pre) operator(&&) ident(post)operator(->)ident(id)operator(;) ident(post) operator(=) ident(post)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(post)operator(,) ident(DVAR_USED)operator(\)\)) operator({) - ident(var) operator(=) ident(NEW_DASGN_CURR)operator(()ident(post)operator(->)ident(id)operator(,) ident(var)operator(\);) - operator(}) - operator(}) - reserved(return) ident(block_append)operator(()ident(var)operator(,) ident(node)operator(\);) -operator(}) - -pre_type(int) -ident(ruby_parser_stack_on_heap)operator((\)) -operator({) -preprocessor(#if) ident(defined)operator(()ident(YYMALLOC)operator(\)) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#else) - reserved(return) ident(Qtrue)operator(;) -preprocessor(#endif) -operator(}) - -directive(void) -ident(rb_gc_mark_parser)operator((\)) -operator({) -preprocessor(#if) ident(defined) ident(YYMALLOC) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(parser_heap)operator(\);) -preprocessor(#elif) ident(defined) ident(yystacksize) - reserved(if) operator(()ident(yyvsp)operator(\)) ident(rb_gc_mark_locations)operator((()ident(VALUE) operator(*\))ident(yyvs)operator(,) operator(()ident(VALUE) operator(*\))ident(yyvsp)operator(\);) -preprocessor(#endif) - - reserved(if) operator((!)ident(ruby_in_compile)operator(\)) reserved(return)operator(;) - - ident(rb_gc_mark_maybe)operator((()ident(VALUE)operator(\))ident(yylval)operator(.)ident(node)operator(\);) - ident(rb_gc_mark)operator(()ident(ruby_debug_lines)operator(\);) - ident(rb_gc_mark)operator(()ident(lex_lastline)operator(\);) - ident(rb_gc_mark)operator(()ident(lex_input)operator(\);) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(lex_strterm)operator(\);) - ident(rb_gc_mark)operator((()ident(VALUE)operator(\))ident(deferred_nodes)operator(\);) -operator(}) - -directive(void) -ident(rb_parser_append_print)operator((\)) -operator({) - ident(ruby_eval_tree) operator(=) - ident(block_append)operator(()ident(ruby_eval_tree)operator(,) - ident(NEW_FCALL)operator(()ident(rb_intern)operator(()stringoperator(\),) - ident(NEW_ARRAY)operator(()ident(NEW_GVAR)operator(()ident(rb_intern)operator(()stringoperator(\)\)\)\)\);) -operator(}) - -directive(void) -ident(rb_parser_while_loop)operator(()ident(chop)operator(,) ident(split)operator(\)) - pre_type(int) ident(chop)operator(,) ident(split)operator(;) -operator({) - reserved(if) operator(()ident(split)operator(\)) operator({) - ident(ruby_eval_tree) operator(=) - ident(block_append)operator(()ident(NEW_GASGN)operator(()ident(rb_intern)operator(()stringoperator(\),) - ident(NEW_CALL)operator(()ident(NEW_GVAR)operator(()ident(rb_intern)operator(()stringoperator(\)\),) - ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(\)\),) - ident(ruby_eval_tree)operator(\);) - operator(}) - reserved(if) operator(()ident(chop)operator(\)) operator({) - ident(ruby_eval_tree) operator(=) - ident(block_append)operator(()ident(NEW_CALL)operator(()ident(NEW_GVAR)operator(()ident(rb_intern)operator(()stringoperator(\)\),) - ident(rb_intern)operator(()stringoperator(\),) integer(0)operator(\),) ident(ruby_eval_tree)operator(\);) - operator(}) - ident(ruby_eval_tree) operator(=) ident(NEW_OPT_N)operator(()ident(ruby_eval_tree)operator(\);) -operator(}) - -directive(static) reserved(struct) operator({) - ident(ID) ident(token)operator(;) - pre_type(char) operator(*)ident(name)operator(;) -operator(}) ident(op_tbl)operator([]) operator(=) operator({) - operator({)ident(tDOT2)operator(,) stringoperator(},) - operator({)ident(tDOT3)operator(,) stringoperator(},) - operator({)char('+')operator(,) stringoperator(},) - operator({)char('-')operator(,) stringoperator(},) - operator({)char('+')operator(,) stringoperator(},) - operator({)char('-')operator(,) stringoperator(},) - operator({)char('*')operator(,) stringoperator(},) - operator({)char('/')operator(,) stringoperator(},) - operator({)char('%')operator(,) stringoperator(},) - operator({)ident(tPOW)operator(,) stringoperator(},) - operator({)ident(tUPLUS)operator(,) stringoperator(},) - operator({)ident(tUMINUS)operator(,) stringoperator(},) - operator({)ident(tUPLUS)operator(,) stringoperator(},) - operator({)ident(tUMINUS)operator(,) stringoperator(},) - operator({)char('|')operator(,) stringoperator(},) - operator({)char('^')operator(,) stringoperator(},) - operator({)char('&')operator(,) stringoperator(},) - operator({)ident(tCMP)operator(,) string)delimiter(")>operator(},) - operator({)char('>')operator(,) string)delimiter(")>operator(},) - operator({)ident(tGEQ)operator(,) string=)delimiter(")>operator(},) - operator({)char('<')operator(,) stringoperator(},) - operator({)ident(tLEQ)operator(,) stringoperator(},) - operator({)ident(tEQ)operator(,) stringoperator(},) - operator({)ident(tEQQ)operator(,) stringoperator(},) - operator({)ident(tNEQ)operator(,) stringoperator(},) - operator({)ident(tMATCH)operator(,) stringoperator(},) - operator({)ident(tNMATCH)operator(,) stringoperator(},) - operator({)char('!')operator(,) stringoperator(},) - operator({)char('~')operator(,) stringoperator(},) - operator({)char('!')operator(,) stringoperator(},) - operator({)char('~')operator(,) stringoperator(},) - operator({)char('!')operator(,) stringoperator(},) - operator({)char('~')operator(,) stringoperator(},) - operator({)ident(tAREF)operator(,) stringoperator(},) - operator({)ident(tASET)operator(,) stringoperator(},) - operator({)ident(tLSHFT)operator(,) stringoperator(},) - operator({)ident(tRSHFT)operator(,) string>)delimiter(")>operator(},) - operator({)ident(tCOLON2)operator(,) stringoperator(},) - operator({)char('`')operator(,) stringoperator(},) - operator({)integer(0)operator(,) integer(0)operator(}) -operator(};) - -directive(static) ident(st_table) operator(*)ident(sym_tbl)operator(;) -directive(static) ident(st_table) operator(*)ident(sym_rev_tbl)operator(;) - -directive(void) -ident(Init_sym)operator((\)) -operator({) - ident(sym_tbl) operator(=) ident(st_init_strtable_with_size)operator(()integer(200)operator(\);) - ident(sym_rev_tbl) operator(=) ident(st_init_numtable_with_size)operator(()integer(200)operator(\);) -operator(}) - -directive(static) ident(ID) ident(last_id) operator(=) ident(tLAST_TOKEN)operator(;) - -directive(static) ident(ID) -ident(internal_id)operator((\)) -operator({) - reserved(return) ident(ID_INTERNAL) operator(|) operator((++)ident(last_id) operator(<<) ident(ID_SCOPE_SHIFT)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(is_special_global_name)operator(()ident(m)operator(\)) - directive(const) pre_type(char) operator(*)ident(m)operator(;) -operator({) - reserved(switch) operator((*)ident(m)operator(\)) operator({) - reserved(case) char('~')operator(:) reserved(case) char('*')operator(:) reserved(case) char('$')operator(:) reserved(case) char('?')operator(:) reserved(case) char('!')operator(:) reserved(case) char('@')operator(:) - reserved(case) char('/')operator(:) reserved(case) char('\\\\')operator(:) reserved(case) char(';')operator(:) reserved(case) char(',')operator(:) reserved(case) char('.')operator(:) reserved(case) char('=')operator(:) - reserved(case) char(':')operator(:) reserved(case) char('<')operator(:) reserved(case) char('>')operator(:) reserved(case) char('\\"')operator(:) - reserved(case) char('&')operator(:) reserved(case) char('`')operator(:) reserved(case) char('\\'')operator(:) reserved(case) char('+')operator(:) - reserved(case) char('0')operator(:) - operator(++)ident(m)operator(;) - reserved(break)operator(;) - reserved(case) char('-')operator(:) - operator(++)ident(m)operator(;) - reserved(if) operator(()ident(is_identchar)operator((*)ident(m)operator(\)\)) ident(m) operator(+=) ident(mbclen)operator((*)ident(m)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(if) operator((!)ident(ISDIGIT)operator((*)ident(m)operator(\)\)) reserved(return) integer(0)operator(;) - reserved(do) operator(++)ident(m)operator(;) reserved(while) operator(()ident(ISDIGIT)operator((*)ident(m)operator(\)\);) - operator(}) - reserved(return) operator(!*)ident(m)operator(;) -operator(}) - -pre_type(int) -ident(rb_symname_p)operator(()ident(name)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(m) operator(=) ident(name)operator(;) - pre_type(int) ident(localid) operator(=) ident(Qfalse)operator(;) - - reserved(if) operator((!)ident(m)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(switch) operator((*)ident(m)operator(\)) operator({) - reserved(case) char('\\0')operator(:) - reserved(return) ident(Qfalse)operator(;) - - reserved(case) char('$')operator(:) - reserved(if) operator(()ident(is_special_global_name)operator((++)ident(m)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(goto) ident(id)operator(;) - - reserved(case) char('@')operator(:) - reserved(if) operator((*++)ident(m) operator(==) char('@')operator(\)) operator(++)ident(m)operator(;) - reserved(goto) ident(id)operator(;) - - reserved(case) char('<')operator(:) - reserved(switch) operator((*++)ident(m)operator(\)) operator({) - reserved(case) char('<')operator(:) operator(++)ident(m)operator(;) reserved(break)operator(;) - reserved(case) char('=')operator(:) reserved(if) operator((*++)ident(m) operator(==) char('>')operator(\)) operator(++)ident(m)operator(;) reserved(break)operator(;) - reserved(default)operator(:) reserved(break)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('>')operator(:) - reserved(switch) operator((*++)ident(m)operator(\)) operator({) - reserved(case) char('>')operator(:) reserved(case) char('=')operator(:) operator(++)ident(m)operator(;) reserved(break)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('=')operator(:) - reserved(switch) operator((*++)ident(m)operator(\)) operator({) - reserved(case) char('~')operator(:) operator(++)ident(m)operator(;) reserved(break)operator(;) - reserved(case) char('=')operator(:) reserved(if) operator((*++)ident(m) operator(==) char('=')operator(\)) operator(++)ident(m)operator(;) reserved(break)operator(;) - reserved(default)operator(:) reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('*')operator(:) - reserved(if) operator((*++)ident(m) operator(==) char('*')operator(\)) operator(++)ident(m)operator(;) - reserved(break)operator(;) - - reserved(case) char('+')operator(:) reserved(case) char('-')operator(:) - reserved(if) operator((*++)ident(m) operator(==) char('@')operator(\)) operator(++)ident(m)operator(;) - reserved(break)operator(;) - - reserved(case) char('|')operator(:) reserved(case) char('^')operator(:) reserved(case) char('&')operator(:) reserved(case) char('/')operator(:) reserved(case) char('%')operator(:) reserved(case) char('~')operator(:) reserved(case) char('`')operator(:) - operator(++)ident(m)operator(;) - reserved(break)operator(;) - - reserved(case) char('[')operator(:) - reserved(if) operator((*++)ident(m) operator(!=) char(']')operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator((*++)ident(m) operator(==) char('=')operator(\)) operator(++)ident(m)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(localid) operator(=) operator(!)ident(ISUPPER)operator((*)ident(m)operator(\);) - label(id:) - reserved(if) operator((*)ident(m) operator(!=) char('_') operator(&&) operator(!)ident(ISALPHA)operator((*)ident(m)operator(\)) operator(&&) operator(!)ident(ismbchar)operator((*)ident(m)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(while) operator(()ident(is_identchar)operator((*)ident(m)operator(\)\)) ident(m) operator(+=) ident(mbclen)operator((*)ident(m)operator(\);) - reserved(if) operator(()ident(localid)operator(\)) operator({) - reserved(switch) operator((*)ident(m)operator(\)) operator({) - reserved(case) char('!')operator(:) reserved(case) char('?')operator(:) reserved(case) char('=')operator(:) operator(++)ident(m)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - operator(}) - reserved(return) operator(*)ident(m) operator(?) ident(Qfalse) operator(:) ident(Qtrue)operator(;) -operator(}) - -pre_type(int) -ident(rb_sym_interned_p)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(ID) ident(id)operator(;) - - reserved(if) operator(()ident(st_lookup)operator(()ident(sym_tbl)operator(,) operator(()ident(st_data_t)operator(\))ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(id)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -ident(ID) -ident(rb_intern)operator(()ident(name)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(m) operator(=) ident(name)operator(;) - ident(ID) ident(id)operator(;) - pre_type(int) ident(last)operator(;) - - reserved(if) operator(()ident(st_lookup)operator(()ident(sym_tbl)operator(,) operator(()ident(st_data_t)operator(\))ident(name)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(id)operator(\)\)) - reserved(return) ident(id)operator(;) - - ident(last) operator(=) ident(strlen)operator(()ident(name)operator(\)-)integer(1)operator(;) - ident(id) operator(=) integer(0)operator(;) - reserved(switch) operator((*)ident(name)operator(\)) operator({) - reserved(case) char('$')operator(:) - ident(id) operator(|=) ident(ID_GLOBAL)operator(;) - reserved(if) operator(()ident(is_special_global_name)operator((++)ident(m)operator(\)\)) reserved(goto) ident(new_id)operator(;) - reserved(break)operator(;) - reserved(case) char('@')operator(:) - reserved(if) operator(()ident(name)operator([)integer(1)operator(]) operator(==) char('@')operator(\)) operator({) - ident(m)operator(++;) - ident(id) operator(|=) ident(ID_CLASS)operator(;) - operator(}) - reserved(else) operator({) - ident(id) operator(|=) ident(ID_INSTANCE)operator(;) - operator(}) - ident(m)operator(++;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(if) operator(()ident(name)operator([)integer(0)operator(]) operator(!=) char('_') operator(&&) ident(ISASCII)operator(()ident(name)operator([)integer(0)operator(]\)) operator(&&) operator(!)ident(ISALNUM)operator(()ident(name)operator([)integer(0)operator(]\)\)) operator({) - comment(/* operators */) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(op_tbl)operator([)ident(i)operator(])operator(.)ident(token)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator((*)ident(op_tbl)operator([)ident(i)operator(])operator(.)ident(name) operator(==) operator(*)ident(name) operator(&&) - ident(strcmp)operator(()ident(op_tbl)operator([)ident(i)operator(])operator(.)ident(name)operator(,) ident(name)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(id) operator(=) ident(op_tbl)operator([)ident(i)operator(])operator(.)ident(token)operator(;) - reserved(goto) ident(id_regist)operator(;) - operator(}) - operator(}) - operator(}) - - reserved(if) operator(()ident(name)operator([)ident(last)operator(]) operator(==) char('=')operator(\)) operator({) - comment(/* attribute assignment */) - pre_type(char) operator(*)ident(buf) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,)ident(last)operator(+)integer(1)operator(\);) - - ident(strncpy)operator(()ident(buf)operator(,) ident(name)operator(,) ident(last)operator(\);) - ident(buf)operator([)ident(last)operator(]) operator(=) char('\\0')operator(;) - ident(id) operator(=) ident(rb_intern)operator(()ident(buf)operator(\);) - reserved(if) operator(()ident(id) operator(>) ident(tLAST_TOKEN) operator(&&) operator(!)ident(is_attrset_id)operator(()ident(id)operator(\)\)) operator({) - ident(id) operator(=) ident(rb_id_attrset)operator(()ident(id)operator(\);) - reserved(goto) ident(id_regist)operator(;) - operator(}) - ident(id) operator(=) ident(ID_ATTRSET)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ISUPPER)operator(()ident(name)operator([)integer(0)operator(]\)\)) operator({) - ident(id) operator(=) ident(ID_CONST)operator(;) - operator(}) - reserved(else) operator({) - ident(id) operator(=) ident(ID_LOCAL)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - reserved(if) operator((!)ident(ISDIGIT)operator((*)ident(m)operator(\)\)) operator({) - reserved(while) operator(()ident(m) operator(<=) ident(name) operator(+) ident(last) operator(&&) ident(is_identchar)operator((*)ident(m)operator(\)\)) operator({) - ident(m) operator(+=) ident(mbclen)operator((*)ident(m)operator(\);) - operator(}) - operator(}) - reserved(if) operator((*)ident(m)operator(\)) ident(id) operator(=) ident(ID_JUNK)operator(;) - label(new_id:) - ident(id) operator(|=) operator(++)ident(last_id) operator(<<) ident(ID_SCOPE_SHIFT)operator(;) - label(id_regist:) - ident(name) operator(=) ident(strdup)operator(()ident(name)operator(\);) - ident(st_add_direct)operator(()ident(sym_tbl)operator(,) operator(()ident(st_data_t)operator(\))ident(name)operator(,) ident(id)operator(\);) - ident(st_add_direct)operator(()ident(sym_rev_tbl)operator(,) ident(id)operator(,) operator(()ident(st_data_t)operator(\))ident(name)operator(\);) - reserved(return) ident(id)operator(;) -operator(}) - -pre_type(char) operator(*) -ident(rb_id2name)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - pre_type(char) operator(*)ident(name)operator(;) - ident(st_data_t) ident(data)operator(;) - - reserved(if) operator(()ident(id) operator(<) ident(tLAST_TOKEN)operator(\)) operator({) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(op_tbl)operator([)ident(i)operator(])operator(.)ident(token)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(op_tbl)operator([)ident(i)operator(])operator(.)ident(token) operator(==) ident(id)operator(\)) - reserved(return) ident(op_tbl)operator([)ident(i)operator(])operator(.)ident(name)operator(;) - operator(}) - operator(}) - - reserved(if) operator(()ident(st_lookup)operator(()ident(sym_rev_tbl)operator(,) ident(id)operator(,) operator(&)ident(data)operator(\)\)) - reserved(return) operator(()pre_type(char) operator(*\))ident(data)operator(;) - - reserved(if) operator(()ident(is_attrset_id)operator(()ident(id)operator(\)\)) operator({) - ident(ID) ident(id2) operator(=) operator(()ident(id) operator(&) operator(~)ident(ID_SCOPE_MASK)operator(\)) operator(|) ident(ID_LOCAL)operator(;) - - label(again:) - ident(name) operator(=) ident(rb_id2name)operator(()ident(id2)operator(\);) - reserved(if) operator(()ident(name)operator(\)) operator({) - pre_type(char) operator(*)ident(buf) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(strlen)operator(()ident(name)operator(\)+)integer(2)operator(\);) - - ident(strcpy)operator(()ident(buf)operator(,) ident(name)operator(\);) - ident(strcat)operator(()ident(buf)operator(,) stringoperator(\);) - ident(rb_intern)operator(()ident(buf)operator(\);) - reserved(return) ident(rb_id2name)operator(()ident(id)operator(\);) - operator(}) - reserved(if) operator(()ident(is_local_id)operator(()ident(id2)operator(\)\)) operator({) - ident(id2) operator(=) operator(()ident(id) operator(&) operator(~)ident(ID_SCOPE_MASK)operator(\)) operator(|) ident(ID_CONST)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(symbols_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(ary)operator(\)) - pre_type(char) operator(*)ident(key)operator(;) - ident(ID) ident(value)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(ID2SYM)operator(()ident(value)operator(\)\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * Symbol.all_symbols => array - * - * Returns an array of all the symbols currently in Ruby's symbol - * table. - * - * Symbol.all_symbols.size #=> 903 - * Symbol.all_symbols[1,20] #=> [:floor, :ARGV, :Binding, :symlink, - * :chown, :EOFError, :$;, :String, - * :LOCK_SH, :"setuid?", :$<, - * :default_proc, :compact, :extend, - * :Tms, :getwd, :$=, :ThreadGroup, - * :wait2, :$>] - */) - -ident(VALUE) -ident(rb_sym_all_symbols)operator((\)) -operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new2)operator(()ident(sym_tbl)operator(->)ident(num_entries)operator(\);) - - ident(st_foreach)operator(()ident(sym_tbl)operator(,) ident(symbols_i)operator(,) ident(ary)operator(\);) - reserved(return) ident(ary)operator(;) -operator(}) - -pre_type(int) -ident(rb_is_const_id)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(if) operator(()ident(is_const_id)operator(()ident(id)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -pre_type(int) -ident(rb_is_class_id)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(if) operator(()ident(is_class_id)operator(()ident(id)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -pre_type(int) -ident(rb_is_instance_id)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(if) operator(()ident(is_instance_id)operator(()ident(id)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -pre_type(int) -ident(rb_is_local_id)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(if) operator(()ident(is_local_id)operator(()ident(id)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -pre_type(int) -ident(rb_is_junk_id)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(if) operator(()ident(is_junk_id)operator(()ident(id)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) directive(void) -ident(special_local_set)operator(()ident(c)operator(,) ident(val)operator(\)) - pre_type(char) ident(c)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - pre_type(int) ident(cnt)operator(;) - - ident(top_local_init)operator((\);) - ident(cnt) operator(=) ident(local_cnt)operator(()ident(c)operator(\);) - ident(top_local_setup)operator((\);) - ident(ruby_scope)operator(->)ident(local_vars)operator([)ident(cnt)operator(]) operator(=) ident(val)operator(;) -operator(}) - -ident(VALUE) -ident(rb_backref_get)operator((\)) -operator({) - ident(VALUE) operator(*)ident(var) operator(=) ident(rb_svar)operator(()integer(1)operator(\);) - reserved(if) operator(()ident(var)operator(\)) operator({) - reserved(return) operator(*)ident(var)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(void) -ident(rb_backref_set)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - ident(VALUE) operator(*)ident(var) operator(=) ident(rb_svar)operator(()integer(1)operator(\);) - reserved(if) operator(()ident(var)operator(\)) operator({) - operator(*)ident(var) operator(=) ident(val)operator(;) - operator(}) - reserved(else) operator({) - ident(special_local_set)operator(()char('~')operator(,) ident(val)operator(\);) - operator(}) -operator(}) - -ident(VALUE) -ident(rb_lastline_get)operator((\)) -operator({) - ident(VALUE) operator(*)ident(var) operator(=) ident(rb_svar)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(var)operator(\)) operator({) - reserved(return) operator(*)ident(var)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(void) -ident(rb_lastline_set)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - ident(VALUE) operator(*)ident(var) operator(=) ident(rb_svar)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(var)operator(\)) operator({) - operator(*)ident(var) operator(=) ident(val)operator(;) - operator(}) - reserved(else) operator({) - ident(special_local_set)operator(()char('_')operator(,) ident(val)operator(\);) - operator(}) -operator(}) - -preprocessor(#ifdef) ident(YYMALLOC) -preprocessor(#define) ident(HEAPCNT)operator(()ident(n)operator(,) ident(size)operator(\)) operator((()ident(n)operator(\)) operator(*) operator(()ident(size)operator(\)) operator(/) reserved(sizeof)operator(()ident(YYSTYPE)operator(\)\)) -preprocessor(#define) ident(NEWHEAP)operator((\)) ident(rb_node_newnode)operator(()ident(NODE_ALLOCA)operator(,) integer(0)operator(,) operator(()ident(VALUE)operator(\))ident(parser_heap)operator(,) integer(0)operator(\)) -preprocessor(#define) ident(ADD2HEAP)operator(()ident(n)operator(,) ident(c)operator(,) ident(p)operator(\)) operator((()ident(parser_heap) operator(=) operator(()ident(n)operator(\)\)->)ident(u1)operator(.)ident(node) operator(=) operator(()ident(p)operator(\),) \ - operator(()ident(n)operator(\)->)ident(u3)operator(.)ident(cnt) operator(=) operator(()ident(c)operator(\),) operator(()ident(p)operator(\)\)) - -directive(static) directive(void) operator(*) -ident(rb_parser_malloc)operator(()ident(size)operator(\)) - ident(size_t) ident(size)operator(;) -operator({) - ident(size_t) ident(cnt) operator(=) ident(HEAPCNT)operator(()integer(1)operator(,) ident(size)operator(\);) - ident(NODE) operator(*)ident(n) operator(=) ident(NEWHEAP)operator((\);) - directive(void) operator(*)ident(ptr) operator(=) ident(xmalloc)operator(()ident(size)operator(\);) - - reserved(return) ident(ADD2HEAP)operator(()ident(n)operator(,) ident(cnt)operator(,) ident(ptr)operator(\);) -operator(}) - -directive(static) directive(void) operator(*) -ident(rb_parser_calloc)operator(()ident(nelem)operator(,) ident(size)operator(\)) - ident(size_t) ident(nelem)operator(,) ident(size)operator(;) -operator({) - ident(size_t) ident(cnt) operator(=) ident(HEAPCNT)operator(()ident(nelem)operator(,) ident(size)operator(\);) - ident(NODE) operator(*)ident(n) operator(=) ident(NEWHEAP)operator((\);) - directive(void) operator(*)ident(ptr) operator(=) ident(xcalloc)operator(()ident(nelem)operator(,) ident(size)operator(\);) - - reserved(return) ident(ADD2HEAP)operator(()ident(n)operator(,) ident(cnt)operator(,) ident(ptr)operator(\);) -operator(}) - -directive(static) directive(void) operator(*) -ident(rb_parser_realloc)operator(()ident(ptr)operator(,) ident(size)operator(\)) - directive(void) operator(*)ident(ptr)operator(;) - ident(size_t) ident(size)operator(;) -operator({) - ident(NODE) operator(*)ident(n)operator(;) - ident(size_t) ident(cnt) operator(=) ident(HEAPCNT)operator(()integer(1)operator(,) ident(size)operator(\);) - - reserved(if) operator(()ident(ptr) operator(&&) operator(()ident(n) operator(=) ident(parser_heap)operator(\)) operator(!=) pre_constant(NULL)operator(\)) operator({) - reserved(do) operator({) - reserved(if) operator(()ident(n)operator(->)ident(u1)operator(.)ident(node) operator(==) ident(ptr)operator(\)) operator({) - ident(n)operator(->)ident(u1)operator(.)ident(node) operator(=) ident(ptr) operator(=) ident(xrealloc)operator(()ident(ptr)operator(,) ident(size)operator(\);) - reserved(if) operator(()ident(n)operator(->)ident(u3)operator(.)ident(cnt)operator(\)) ident(n)operator(->)ident(u3)operator(.)ident(cnt) operator(=) ident(cnt)operator(;) - reserved(return) ident(ptr)operator(;) - operator(}) - operator(}) reserved(while) operator((()ident(n) operator(=) ident(n)operator(->)ident(u2)operator(.)ident(node)operator(\)) operator(!=) pre_constant(NULL)operator(\);) - operator(}) - ident(n) operator(=) ident(NEWHEAP)operator((\);) - ident(ptr) operator(=) ident(xrealloc)operator(()ident(ptr)operator(,) ident(size)operator(\);) - reserved(return) ident(ADD2HEAP)operator(()ident(n)operator(,) ident(cnt)operator(,) ident(ptr)operator(\);) -operator(}) - -directive(static) directive(void) -ident(rb_parser_free)operator(()ident(ptr)operator(\)) - directive(void) operator(*)ident(ptr)operator(;) -operator({) - ident(NODE) operator(**)ident(prev) operator(=) operator(&)ident(parser_heap)operator(,) operator(*)ident(n)operator(;) - - reserved(while) operator((()ident(n) operator(=) operator(*)ident(prev)operator(\)) operator(!=) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(n)operator(->)ident(u1)operator(.)ident(node) operator(==) ident(ptr)operator(\)) operator({) - operator(*)ident(prev) operator(=) ident(n)operator(->)ident(u2)operator(.)ident(node)operator(;) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(n)operator(\);) - reserved(break)operator(;) - operator(}) - ident(prev) operator(=) operator(&)ident(n)operator(->)ident(u2)operator(.)ident(node)operator(;) - operator(}) - ident(xfree)operator(()ident(ptr)operator(\);) -operator(}) -preprocessor(#endif) - -comment(/********************************************************************** - - prec.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007\) $ - created at: Tue Jan 26 02:40:41 2000 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") - -ident(VALUE) ident(rb_mPrecision)operator(;) - -directive(static) ident(ID) ident(prc_pr)operator(,) ident(prc_if)operator(;) - - -comment(/* - * call-seq: - * num.prec(klass\) => a_klass - * - * Converts _self_ into an instance of _klass_. By default, - * +prec+ invokes - * - * klass.induced_from(num\) - * - * and returns its value. So, if klass.induced_from - * doesn't return an instance of _klass_, it will be necessary - * to reimplement +prec+. - */) - -directive(static) ident(VALUE) -ident(prec_prec)operator(()ident(x)operator(,) ident(klass)operator(\)) - ident(VALUE) ident(x)operator(,) ident(klass)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(klass)operator(,) ident(prc_if)operator(,) integer(1)operator(,) ident(x)operator(\);) -operator(}) - -comment(/* - * call-seq: - * num.prec_i => Integer - * - * Returns an +Integer+ converted from _num_. It is equivalent - * to prec(Integer\). - */) - -directive(static) ident(VALUE) -ident(prec_prec_i)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - ident(VALUE) ident(klass) operator(=) ident(rb_cInteger)operator(;) - - reserved(return) ident(rb_funcall)operator(()ident(x)operator(,) ident(prc_pr)operator(,) integer(1)operator(,) ident(klass)operator(\);) -operator(}) - -comment(/* - * call-seq: - * num.prec_f => Float - * - * Returns a +Float+ converted from _num_. It is equivalent - * to prec(Float\). - */) - -directive(static) ident(VALUE) -ident(prec_prec_f)operator(()ident(x)operator(\)) - ident(VALUE) ident(x)operator(;) -operator({) - ident(VALUE) ident(klass) operator(=) ident(rb_cFloat)operator(;) - - reserved(return) ident(rb_funcall)operator(()ident(x)operator(,) ident(prc_pr)operator(,) integer(1)operator(,) ident(klass)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Mod.induced_from(number\) => a_mod - * - * Creates an instance of mod from. This method is overridden - * by concrete +Numeric+ classes, so that (for example\) - * - * Fixnum.induced_from(9.9\) #=> 9 - * - * Note that a use of +prec+ in a redefinition may cause - * an infinite loop. - */) - -directive(static) ident(VALUE) -ident(prec_induced_from)operator(()ident(module)operator(,) ident(x)operator(\)) - ident(VALUE) ident(module)operator(,) ident(x)operator(;) -operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(x)operator(\),) ident(rb_class2name)operator(()ident(module)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -comment(/* - * call_seq: - * included - * - * When the +Precision+ module is mixed-in to a class, this +included+ - * method is used to add our default +induced_from+ implementation - * to the host class. - */) - -directive(static) ident(VALUE) -ident(prec_included)operator(()ident(module)operator(,) ident(include)operator(\)) - ident(VALUE) ident(module)operator(,) ident(include)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(include)operator(\)\)) operator({) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - reserved(break)operator(;) - reserved(default)operator(:) - ident(Check_Type)operator(()ident(include)operator(,) ident(T_CLASS)operator(\);) - reserved(break)operator(;) - operator(}) - ident(rb_define_singleton_method)operator(()ident(include)operator(,) stringoperator(,) ident(prec_induced_from)operator(,) integer(1)operator(\);) - reserved(return) ident(module)operator(;) -operator(}) - -comment(/* - * Precision is a mixin for concrete numeric classes with - * precision. Here, `precision' means the fineness of approximation - * of a real number, so, this module should not be included into - * anything which is not a subset of Real (so it should not be - * included in classes such as +Complex+ or +Matrix+\). -*/) - -directive(void) -ident(Init_Precision)operator((\)) -operator({) - ident(rb_mPrecision) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_mPrecision)operator(,) stringoperator(,) ident(prec_included)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mPrecision)operator(,) stringoperator(,) ident(prec_prec)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_mPrecision)operator(,) stringoperator(,) ident(prec_prec_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_mPrecision)operator(,) stringoperator(,) ident(prec_prec_f)operator(,) integer(0)operator(\);) - - ident(prc_pr) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(prc_if) operator(=) ident(rb_intern)operator(()stringoperator(\);) -operator(}) -comment(/********************************************************************** - - process.c - - - $Author: shyouhei $ - $Date: 2008-06-29 11:33:11 +0200 (Sun, 29 Jun 2008\) $ - created at: Tue Aug 10 14:30:50 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("rubysig.h") -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#ifdef) ident(HAVE_STDLIB_H) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#ifdef) ident(HAVE_UNISTD_H) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#ifdef) ident(__DJGPP__) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#ifndef) ident(EXIT_SUCCESS) -preprocessor(#define) ident(EXIT_SUCCESS) integer(0) -preprocessor(#endif) -preprocessor(#ifndef) ident(EXIT_FAILURE) -preprocessor(#define) ident(EXIT_FAILURE) integer(1) -preprocessor(#endif) - -reserved(struct) ident(timeval) ident(rb_time_interval) ident(_)operator((()ident(VALUE)operator(\)\);) - -preprocessor(#ifdef) ident(HAVE_SYS_WAIT_H) -preprocessor(# include) include() -preprocessor(#endif) -preprocessor(#ifdef) ident(HAVE_SYS_RESOURCE_H) -preprocessor(# include) include() -preprocessor(#endif) -preprocessor(#include) include("st.h") - -preprocessor(#ifdef) ident(__EMX__) -preprocessor(#undef) ident(HAVE_GETPGRP) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_SYS_TIMES_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_GRP_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_TIMES)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) -directive(static) ident(VALUE) ident(S_Tms)operator(;) -preprocessor(#endif) - -preprocessor(#ifndef) ident(WIFEXITED) -preprocessor(#define) ident(WIFEXITED)operator(()ident(w)operator(\)) operator(((()ident(w)operator(\)) operator(&) hex(0xff)operator(\)) operator(==) integer(0)operator(\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(WIFSIGNALED) -preprocessor(#define) ident(WIFSIGNALED)operator(()ident(w)operator(\)) operator(((()ident(w)operator(\)) operator(&) hex(0x7f)operator(\)) operator(>) integer(0) operator(&&) operator(((()ident(w)operator(\)) operator(&) hex(0x7f)operator(\)) operator(<) hex(0x7f)operator(\)\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(WIFSTOPPED) -preprocessor(#define) ident(WIFSTOPPED)operator(()ident(w)operator(\)) operator(((()ident(w)operator(\)) operator(&) hex(0xff)operator(\)) operator(==) hex(0x7f)operator(\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(WEXITSTATUS) -preprocessor(#define) ident(WEXITSTATUS)operator(()ident(w)operator(\)) operator(((()ident(w)operator(\)) operator(>>) integer(8)operator(\)) operator(&) hex(0xff)operator(\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(WTERMSIG) -preprocessor(#define) ident(WTERMSIG)operator(()ident(w)operator(\)) operator((()ident(w)operator(\)) operator(&) hex(0x7f)operator(\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(WSTOPSIG) -preprocessor(#define) ident(WSTOPSIG) ident(WEXITSTATUS) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__APPLE__)operator(\)) operator(&&) operator(() ident(defined)operator(()ident(__MACH__)operator(\)) operator(||) ident(defined)operator(()ident(__DARWIN__)operator(\)) operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__MacOS_X__)operator(\)) -preprocessor(#define) ident(__MacOS_X__) integer(1) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__FreeBSD__)operator(\)) operator(||) ident(defined)operator(()ident(__NetBSD__)operator(\)) operator(||) ident(defined)operator(()ident(__OpenBSD__)operator(\)) operator(||) ident(defined)operator(()ident(__bsdi__)operator(\)) -preprocessor(#define) ident(HAVE_44BSD_SETUID) integer(1) -preprocessor(#define) ident(HAVE_44BSD_SETGID) integer(1) -preprocessor(#endif) - -preprocessor(#ifdef) ident(__NetBSD__) -preprocessor(#undef) ident(HAVE_SETRUID) -preprocessor(#undef) ident(HAVE_SETRGID) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__MacOS_X__)operator(\)) operator(||) ident(defined)operator(()ident(__bsdi__)operator(\)) -preprocessor(#define) ident(BROKEN_SETREUID) integer(1) -preprocessor(#define) ident(BROKEN_SETREGID) integer(1) -preprocessor(#endif) - -preprocessor(#ifdef) ident(BROKEN_SETREUID) -preprocessor(#define) ident(setreuid) ident(ruby_setreuid) -preprocessor(#endif) -preprocessor(#ifdef) ident(BROKEN_SETREGID) -preprocessor(#define) ident(setregid) ident(ruby_setregid) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_44BSD_SETUID)operator(\)) operator(||) ident(defined)operator(()ident(__MacOS_X__)operator(\)) -preprocessor(#if) operator(!)ident(defined)operator(()ident(USE_SETREUID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(BROKEN_SETREUID)operator(\)) -preprocessor(#define) ident(OBSOLETE_SETREUID) integer(1) -preprocessor(#endif) -preprocessor(#if) operator(!)ident(defined)operator(()ident(USE_SETREGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(BROKEN_SETREGID)operator(\)) -preprocessor(#define) ident(OBSOLETE_SETREGID) integer(1) -preprocessor(#endif) -preprocessor(#endif) - -preprocessor(#define) ident(preserving_errno)operator(()ident(stmts)operator(\)) \ - reserved(do) operator({)pre_type(int) ident(saved_errno) operator(=) ident(errno)operator(;) ident(stmts)operator(;) ident(errno) operator(=) ident(saved_errno)operator(;}) reserved(while) operator(()integer(0)operator(\)) - - -comment(/* - * call-seq: - * Process.pid => fixnum - * - * Returns the process id of this process. Not available on all - * platforms. - * - * Process.pid #=> 27415 - */) - -directive(static) ident(VALUE) -ident(get_pid)operator((\)) -operator({) - ident(rb_secure)operator(()integer(2)operator(\);) - reserved(return) ident(INT2FIX)operator(()ident(getpid)operator((\)\);) -operator(}) - - -comment(/* - * call-seq: - * Process.ppid => fixnum - * - * Returns the process id of the parent of this process. Always - * returns 0 on NT. Not available on all platforms. - * - * puts "I am #{Process.pid}" - * Process.fork { puts "Dad is #{Process.ppid}" } - * - * produces: - * - * I am 27417 - * Dad is 27417 - */) - -directive(static) ident(VALUE) -ident(get_ppid)operator((\)) -operator({) - ident(rb_secure)operator(()integer(2)operator(\);) -preprocessor(#ifdef) ident(_WIN32) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -preprocessor(#else) - reserved(return) ident(INT2FIX)operator(()ident(getppid)operator((\)\);) -preprocessor(#endif) -operator(}) - - -comment(/********************************************************************* - * - * Document-class: Process::Status - * - * Process::Status encapsulates the information on the - * status of a running or terminated system process. The built-in - * variable $? is either +nil+ or a - * Process::Status object. - * - * fork { exit 99 } #=> 26557 - * Process.wait #=> 26557 - * $?.class #=> Process::Status - * $?.to_i #=> 25344 - * $? >> 8 #=> 99 - * $?.stopped? #=> false - * $?.exited? #=> true - * $?.exitstatus #=> 99 - * - * Posix systems record information on processes using a 16-bit - * integer. The lower bits record the process status (stopped, - * exited, signaled\) and the upper bits possibly contain additional - * information (for example the program's return code in the case of - * exited processes\). Pre Ruby 1.8, these bits were exposed directly - * to the Ruby program. Ruby now encapsulates these in a - * Process::Status object. To maximize compatibility, - * however, these objects retain a bit-oriented interface. In the - * descriptions that follow, when we talk about the integer value of - * _stat_, we're referring to this 16 bit value. - */) - -directive(static) ident(VALUE) ident(rb_cProcStatus)operator(;) -ident(VALUE) ident(rb_last_status) operator(=) ident(Qnil)operator(;) - -directive(static) directive(void) -ident(last_status_set)operator(()ident(status)operator(,) ident(pid)operator(\)) - pre_type(int) ident(status)operator(,) ident(pid)operator(;) -operator({) - ident(rb_last_status) operator(=) ident(rb_obj_alloc)operator(()ident(rb_cProcStatus)operator(\);) - ident(rb_iv_set)operator(()ident(rb_last_status)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(status)operator(\)\);) - ident(rb_iv_set)operator(()ident(rb_last_status)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(pid)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * stat.to_i => fixnum - * stat.to_int => fixnum - * - * Returns the bits in _stat_ as a Fixnum. Poking - * around in these bits is platform dependent. - * - * fork { exit 0xab } #=> 26566 - * Process.wait #=> 26566 - * sprintf('%04x', $?.to_i\) #=> "ab00" - */) - -directive(static) ident(VALUE) -ident(pst_to_i)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) - reserved(return) ident(rb_iv_get)operator(()ident(st)operator(,) stringoperator(\);) -operator(}) - - -comment(/* - * call-seq: - * stat.to_s => string - * - * Equivalent to _stat_.to_i.to_s. - */) - -directive(static) ident(VALUE) -ident(pst_to_s)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) - reserved(return) ident(rb_fix2str)operator(()ident(pst_to_i)operator(()ident(st)operator(\),) integer(10)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * stat.pid => fixnum - * - * Returns the process ID that this status object represents. - * - * fork { exit } #=> 26569 - * Process.wait #=> 26569 - * $?.pid #=> 26569 - */) - -directive(static) ident(VALUE) -ident(pst_pid)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) - reserved(return) ident(rb_iv_get)operator(()ident(st)operator(,) stringoperator(\);) -operator(}) - - -comment(/* - * call-seq: - * stat.inspect => string - * - * Override the inspection method. - */) - -directive(static) ident(VALUE) -ident(pst_inspect)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) - ident(VALUE) ident(pid)operator(;) - pre_type(int) ident(status)operator(;) - ident(VALUE) ident(str)operator(;) - pre_type(char) ident(buf)operator([)integer(256)operator(];) - - ident(pid) operator(=) ident(pst_pid)operator(()ident(st)operator(\);) - ident(status) operator(=) ident(NUM2INT)operator(()ident(st)operator(\);) - - ident(snprintf)operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\),) stringoperator(,) ident(rb_class2name)operator(()ident(CLASS_OF)operator(()ident(st)operator(\)\),) ident(NUM2LONG)operator(()ident(pid)operator(\)\);) - ident(str) operator(=) ident(rb_str_new2)operator(()ident(buf)operator(\);) - reserved(if) operator(()ident(WIFSTOPPED)operator(()ident(status)operator(\)\)) operator({) - pre_type(int) ident(stopsig) operator(=) ident(WSTOPSIG)operator(()ident(status)operator(\);) - directive(const) pre_type(char) operator(*)ident(signame) operator(=) ident(ruby_signal_name)operator(()ident(stopsig)operator(\);) - reserved(if) operator(()ident(signame)operator(\)) operator({) - ident(snprintf)operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\),) stringoperator(,) ident(signame)operator(,) ident(stopsig)operator(\);) - operator(}) - reserved(else) operator({) - ident(snprintf)operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\),) stringoperator(,) ident(stopsig)operator(\);) - operator(}) - ident(rb_str_cat2)operator(()ident(str)operator(,) ident(buf)operator(\);) - operator(}) - reserved(if) operator(()ident(WIFSIGNALED)operator(()ident(status)operator(\)\)) operator({) - pre_type(int) ident(termsig) operator(=) ident(WTERMSIG)operator(()ident(status)operator(\);) - directive(const) pre_type(char) operator(*)ident(signame) operator(=) ident(ruby_signal_name)operator(()ident(termsig)operator(\);) - reserved(if) operator(()ident(signame)operator(\)) operator({) - ident(snprintf)operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\),) stringoperator(,) ident(signame)operator(,) ident(termsig)operator(\);) - operator(}) - reserved(else) operator({) - ident(snprintf)operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\),) stringoperator(,) ident(termsig)operator(\);) - operator(}) - ident(rb_str_cat2)operator(()ident(str)operator(,) ident(buf)operator(\);) - operator(}) - reserved(if) operator(()ident(WIFEXITED)operator(()ident(status)operator(\)\)) operator({) - ident(snprintf)operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\),) stringoperator(,) ident(WEXITSTATUS)operator(()ident(status)operator(\)\);) - ident(rb_str_cat2)operator(()ident(str)operator(,) ident(buf)operator(\);) - operator(}) -preprocessor(#ifdef) ident(WCOREDUMP) - reserved(if) operator(()ident(WCOREDUMP)operator(()ident(status)operator(\)\)) operator({) - ident(rb_str_cat2)operator(()ident(str)operator(,) stringoperator(\);) - operator(}) -preprocessor(#endif) - ident(rb_str_cat2)operator(()ident(str)operator(,) string)delimiter(")>operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * stat == other => true or false - * - * Returns +true+ if the integer value of _stat_ - * equals other. - */) - -directive(static) ident(VALUE) -ident(pst_equal)operator(()ident(st1)operator(,) ident(st2)operator(\)) - ident(VALUE) ident(st1)operator(,) ident(st2)operator(;) -operator({) - reserved(if) operator(()ident(st1) operator(==) ident(st2)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(rb_equal)operator(()ident(pst_to_i)operator(()ident(st1)operator(\),) ident(st2)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * stat & num => fixnum - * - * Logical AND of the bits in _stat_ with num. - * - * fork { exit 0x37 } - * Process.wait - * sprintf('%04x', $?.to_i\) #=> "3700" - * sprintf('%04x', $? & 0x1e00\) #=> "1600" - */) - -directive(static) ident(VALUE) -ident(pst_bitand)operator(()ident(st1)operator(,) ident(st2)operator(\)) - ident(VALUE) ident(st1)operator(,) ident(st2)operator(;) -operator({) - pre_type(int) ident(status) operator(=) ident(NUM2INT)operator(()ident(st1)operator(\)) operator(&) ident(NUM2INT)operator(()ident(st2)operator(\);) - - reserved(return) ident(INT2NUM)operator(()ident(status)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * stat >> num => fixnum - * - * Shift the bits in _stat_ right num places. - * - * fork { exit 99 } #=> 26563 - * Process.wait #=> 26563 - * $?.to_i #=> 25344 - * $? >> 8 #=> 99 - */) - -directive(static) ident(VALUE) -ident(pst_rshift)operator(()ident(st1)operator(,) ident(st2)operator(\)) - ident(VALUE) ident(st1)operator(,) ident(st2)operator(;) -operator({) - pre_type(int) ident(status) operator(=) ident(NUM2INT)operator(()ident(st1)operator(\)) operator(>>) ident(NUM2INT)operator(()ident(st2)operator(\);) - - reserved(return) ident(INT2NUM)operator(()ident(status)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * stat.stopped? => true or false - * - * Returns +true+ if this process is stopped. This is only - * returned if the corresponding wait call had the - * WUNTRACED flag set. - */) - -directive(static) ident(VALUE) -ident(pst_wifstopped)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) - pre_type(int) ident(status) operator(=) ident(NUM2INT)operator(()ident(st)operator(\);) - - reserved(if) operator(()ident(WIFSTOPPED)operator(()ident(status)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - reserved(else) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * stat.stopsig => fixnum or nil - * - * Returns the number of the signal that caused _stat_ to stop - * (or +nil+ if self is not stopped\). - */) - -directive(static) ident(VALUE) -ident(pst_wstopsig)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) - pre_type(int) ident(status) operator(=) ident(NUM2INT)operator(()ident(st)operator(\);) - - reserved(if) operator(()ident(WIFSTOPPED)operator(()ident(status)operator(\)\)) - reserved(return) ident(INT2NUM)operator(()ident(WSTOPSIG)operator(()ident(status)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * stat.signaled? => true or false - * - * Returns +true+ if _stat_ terminated because of - * an uncaught signal. - */) - -directive(static) ident(VALUE) -ident(pst_wifsignaled)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) - pre_type(int) ident(status) operator(=) ident(NUM2INT)operator(()ident(st)operator(\);) - - reserved(if) operator(()ident(WIFSIGNALED)operator(()ident(status)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - reserved(else) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * stat.termsig => fixnum or nil - * - * Returns the number of the signal that caused _stat_ to - * terminate (or +nil+ if self was not terminated by an - * uncaught signal\). - */) - -directive(static) ident(VALUE) -ident(pst_wtermsig)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) - pre_type(int) ident(status) operator(=) ident(NUM2INT)operator(()ident(st)operator(\);) - - reserved(if) operator(()ident(WIFSIGNALED)operator(()ident(status)operator(\)\)) - reserved(return) ident(INT2NUM)operator(()ident(WTERMSIG)operator(()ident(status)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * stat.exited? => true or false - * - * Returns +true+ if _stat_ exited normally (for - * example using an exit(\) call or finishing the - * program\). - */) - -directive(static) ident(VALUE) -ident(pst_wifexited)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) - pre_type(int) ident(status) operator(=) ident(NUM2INT)operator(()ident(st)operator(\);) - - reserved(if) operator(()ident(WIFEXITED)operator(()ident(status)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - reserved(else) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * stat.exitstatus => fixnum or nil - * - * Returns the least significant eight bits of the return code of - * _stat_. Only available if exited? is - * +true+. - * - * fork { } #=> 26572 - * Process.wait #=> 26572 - * $?.exited? #=> true - * $?.exitstatus #=> 0 - * - * fork { exit 99 } #=> 26573 - * Process.wait #=> 26573 - * $?.exited? #=> true - * $?.exitstatus #=> 99 - */) - -directive(static) ident(VALUE) -ident(pst_wexitstatus)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) - pre_type(int) ident(status) operator(=) ident(NUM2INT)operator(()ident(st)operator(\);) - - reserved(if) operator(()ident(WIFEXITED)operator(()ident(status)operator(\)\)) - reserved(return) ident(INT2NUM)operator(()ident(WEXITSTATUS)operator(()ident(status)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * stat.success? => true, false or nil - * - * Returns +true+ if _stat_ is successful, +false+ if not. - * Returns +nil+ if exited? is not +true+. - */) - -directive(static) ident(VALUE) -ident(pst_success_p)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) - pre_type(int) ident(status) operator(=) ident(NUM2INT)operator(()ident(st)operator(\);) - - reserved(if) operator((!)ident(WIFEXITED)operator(()ident(status)operator(\)\)) - reserved(return) ident(Qnil)operator(;) - reserved(return) ident(WEXITSTATUS)operator(()ident(status)operator(\)) operator(==) ident(EXIT_SUCCESS) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * stat.coredump? => true or false - * - * Returns +true+ if _stat_ generated a coredump - * when it terminated. Not available on all platforms. - */) - -directive(static) ident(VALUE) -ident(pst_wcoredump)operator(()ident(st)operator(\)) - ident(VALUE) ident(st)operator(;) -operator({) -preprocessor(#ifdef) ident(WCOREDUMP) - pre_type(int) ident(status) operator(=) ident(NUM2INT)operator(()ident(st)operator(\);) - - reserved(if) operator(()ident(WCOREDUMP)operator(()ident(status)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - reserved(else) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#else) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) -operator(}) - -preprocessor(#if) operator(!)ident(defined)operator(()ident(HAVE_WAITPID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(HAVE_WAIT4)operator(\)) -preprocessor(#define) ident(NO_WAITPID) -directive(static) ident(st_table) operator(*)ident(pid_tbl)operator(;) -preprocessor(#endif) - -pre_type(int) -ident(rb_waitpid)operator(()ident(pid)operator(,) ident(st)operator(,) ident(flags)operator(\)) - pre_type(int) ident(pid)operator(;) - pre_type(int) operator(*)ident(st)operator(;) - pre_type(int) ident(flags)operator(;) -operator({) - pre_type(int) ident(result)operator(;) -preprocessor(#ifndef) ident(NO_WAITPID) - pre_type(int) ident(oflags) operator(=) ident(flags)operator(;) - reserved(if) operator((!)ident(rb_thread_alone)operator((\)\)) operator({) comment(/* there're other threads to run */) - ident(flags) operator(|=) ident(WNOHANG)operator(;) - operator(}) - - label(retry:) - ident(TRAP_BEG)operator(;) -preprocessor(#ifdef) ident(HAVE_WAITPID) - ident(result) operator(=) ident(waitpid)operator(()ident(pid)operator(,) ident(st)operator(,) ident(flags)operator(\);) -preprocessor(#else) comment(/* HAVE_WAIT4 */) - ident(result) operator(=) ident(wait4)operator(()ident(pid)operator(,) ident(st)operator(,) ident(flags)operator(,) pre_constant(NULL)operator(\);) -preprocessor(#endif) - ident(TRAP_END)operator(;) - reserved(if) operator(()ident(result) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(errno) operator(==) ident(EINTR)operator(\)) operator({) - ident(rb_thread_polling)operator((\);) - reserved(goto) ident(retry)operator(;) - operator(}) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(result) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(oflags) operator(&) ident(WNOHANG)operator(\)) reserved(return) integer(0)operator(;) - ident(rb_thread_polling)operator((\);) - reserved(if) operator(()ident(rb_thread_alone)operator((\)\)) ident(flags) operator(=) ident(oflags)operator(;) - reserved(goto) ident(retry)operator(;) - operator(}) -preprocessor(#else) comment(/* NO_WAITPID */) - reserved(if) operator(()ident(pid_tbl) operator(&&) ident(st_lookup)operator(()ident(pid_tbl)operator(,) ident(pid)operator(,) ident(st)operator(\)\)) operator({) - ident(last_status_set)operator((*)ident(st)operator(,) ident(pid)operator(\);) - ident(st_delete)operator(()ident(pid_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(pid)operator(,) pre_constant(NULL)operator(\);) - reserved(return) ident(pid)operator(;) - operator(}) - - reserved(if) operator(()ident(flags)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - reserved(for) operator((;;\)) operator({) - ident(TRAP_BEG)operator(;) - ident(result) operator(=) ident(wait)operator(()ident(st)operator(\);) - ident(TRAP_END)operator(;) - reserved(if) operator(()ident(result) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(errno) operator(==) ident(EINTR)operator(\)) operator({) - ident(rb_thread_schedule)operator((\);) - reserved(continue)operator(;) - operator(}) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(result) operator(==) ident(pid)operator(\)) operator({) - reserved(break)operator(;) - operator(}) - reserved(if) operator((!)ident(pid_tbl)operator(\)) - ident(pid_tbl) operator(=) ident(st_init_numtable)operator((\);) - ident(st_insert)operator(()ident(pid_tbl)operator(,) ident(pid)operator(,) ident(st)operator(\);) - reserved(if) operator((!)ident(rb_thread_alone)operator((\)\)) ident(rb_thread_schedule)operator((\);) - operator(}) -preprocessor(#endif) - reserved(if) operator(()ident(result) operator(>) integer(0)operator(\)) operator({) - ident(last_status_set)operator((*)ident(st)operator(,) ident(result)operator(\);) - operator(}) - reserved(return) ident(result)operator(;) -operator(}) - -preprocessor(#ifdef) ident(NO_WAITPID) -reserved(struct) ident(wait_data) operator({) - pre_type(int) ident(pid)operator(;) - pre_type(int) ident(status)operator(;) -operator(};) - -directive(static) pre_type(int) -ident(wait_each)operator(()ident(pid)operator(,) ident(status)operator(,) ident(data)operator(\)) - pre_type(int) ident(pid)operator(,) ident(status)operator(;) - reserved(struct) ident(wait_data) operator(*)ident(data)operator(;) -operator({) - reserved(if) operator(()ident(data)operator(->)ident(status) operator(!=) operator(-)integer(1)operator(\)) reserved(return) ident(ST_STOP)operator(;) - - ident(data)operator(->)ident(pid) operator(=) ident(pid)operator(;) - ident(data)operator(->)ident(status) operator(=) ident(status)operator(;) - reserved(return) ident(ST_DELETE)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(waitall_each)operator(()ident(pid)operator(,) ident(status)operator(,) ident(ary)operator(\)) - pre_type(int) ident(pid)operator(,) ident(status)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(last_status_set)operator(()ident(status)operator(,) ident(pid)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_assoc_new)operator(()ident(INT2NUM)operator(()ident(pid)operator(\),) ident(rb_last_status)operator(\)\);) - reserved(return) ident(ST_DELETE)operator(;) -operator(}) -preprocessor(#endif) - - -comment(/* [MG]:FIXME: I wasn't sure how this should be done, since ::wait(\) - has historically been documented as if it didn't take any arguments - despite the fact that it's just an alias for ::waitpid(\). The way I - have it below is more truthful, but a little confusing. - - I also took the liberty of putting in the pid values, as they're - pretty useful, and it looked as if the original 'ri' output was - supposed to contain them after "[...]depending on the value of - aPid:". - - The 'ansi' and 'bs' formats of the ri output don't display the - definition list for some reason, but the plain text one does. - */) - -comment(/* - * call-seq: - * Process.wait(\) => fixnum - * Process.wait(pid=-1, flags=0\) => fixnum - * Process.waitpid(pid=-1, flags=0\) => fixnum - * - * Waits for a child process to exit, returns its process id, and - * sets $? to a Process::Status object - * containing information on that process. Which child it waits on - * depends on the value of _pid_: - * - * > 0:: Waits for the child whose process ID equals _pid_. - * - * 0:: Waits for any child whose process group ID equals that of the - * calling process. - * - * -1:: Waits for any child process (the default if no _pid_ is - * given\). - * - * < -1:: Waits for any child whose process group ID equals the absolute - * value of _pid_. - * - * The _flags_ argument may be a logical or of the flag values - * Process::WNOHANG (do not block if no child available\) - * or Process::WUNTRACED (return stopped children that - * haven't been reported\). Not all flags are available on all - * platforms, but a flag value of zero will work on all platforms. - * - * Calling this method raises a SystemError if there are - * no child processes. Not available on all platforms. - * - * include Process - * fork { exit 99 } #=> 27429 - * wait #=> 27429 - * $?.exitstatus #=> 99 - * - * pid = fork { sleep 3 } #=> 27440 - * Time.now #=> Wed Apr 09 08:57:09 CDT 2003 - * waitpid(pid, Process::WNOHANG\) #=> nil - * Time.now #=> Wed Apr 09 08:57:09 CDT 2003 - * waitpid(pid, 0\) #=> 27440 - * Time.now #=> Wed Apr 09 08:57:12 CDT 2003 - */) - -directive(static) ident(VALUE) -ident(proc_wait)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(vpid)operator(,) ident(vflags)operator(;) - pre_type(int) ident(pid)operator(,) ident(flags)operator(,) ident(status)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(flags) operator(=) integer(0)operator(;) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(vpid)operator(,) operator(&)ident(vflags)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(pid) operator(=) operator(-)integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(pid) operator(=) ident(NUM2INT)operator(()ident(vpid)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(2) operator(&&) operator(!)ident(NIL_P)operator(()ident(vflags)operator(\)\)) operator({) - ident(flags) operator(=) ident(NUM2UINT)operator(()ident(vflags)operator(\);) - operator(}) - operator(}) - reserved(if) operator((()ident(pid) operator(=) ident(rb_waitpid)operator(()ident(pid)operator(,) operator(&)ident(status)operator(,) ident(flags)operator(\)\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(pid) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(rb_last_status) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(pid)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process.wait2(pid=-1, flags=0\) => [pid, status] - * Process.waitpid2(pid=-1, flags=0\) => [pid, status] - * - * Waits for a child process to exit (see Process::waitpid for exact - * semantics\) and returns an array containing the process id and the - * exit status (a Process::Status object\) of that - * child. Raises a SystemError if there are no child - * processes. - * - * Process.fork { exit 99 } #=> 27437 - * pid, status = Process.wait2 - * pid #=> 27437 - * status.exitstatus #=> 99 - */) - -directive(static) ident(VALUE) -ident(proc_wait2)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(pid) operator(=) ident(proc_wait)operator(()ident(argc)operator(,) ident(argv)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(pid)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(rb_assoc_new)operator(()ident(pid)operator(,) ident(rb_last_status)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process.waitall => [ [pid1,status1], ...] - * - * Waits for all children, returning an array of - * _pid_/_status_ pairs (where _status_ is a - * Process::Status object\). - * - * fork { sleep 0.2; exit 2 } #=> 27432 - * fork { sleep 0.1; exit 1 } #=> 27433 - * fork { exit 0 } #=> 27434 - * p Process.waitall - * - * produces: - * - * [[27434, #], - * [27433, #], - * [27432, #]] - */) - -directive(static) ident(VALUE) -ident(proc_waitall)operator((\)) -operator({) - ident(VALUE) ident(result)operator(;) - pre_type(int) ident(pid)operator(,) ident(status)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(result) operator(=) ident(rb_ary_new)operator((\);) -preprocessor(#ifdef) ident(NO_WAITPID) - reserved(if) operator(()ident(pid_tbl)operator(\)) operator({) - ident(st_foreach)operator(()ident(pid_tbl)operator(,) ident(waitall_each)operator(,) ident(result)operator(\);) - operator(}) - - reserved(for) operator(()ident(pid) operator(=) operator(-)integer(1)operator(;;\)) operator({) - ident(pid) operator(=) ident(wait)operator((&)ident(status)operator(\);) - reserved(if) operator(()ident(pid) operator(==) operator(-)integer(1)operator(\)) operator({) - reserved(if) operator(()ident(errno) operator(==) ident(ECHILD)operator(\)) - reserved(break)operator(;) - reserved(if) operator(()ident(errno) operator(==) ident(EINTR)operator(\)) operator({) - ident(rb_thread_schedule)operator((\);) - reserved(continue)operator(;) - operator(}) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - ident(last_status_set)operator(()ident(status)operator(,) ident(pid)operator(\);) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_assoc_new)operator(()ident(INT2NUM)operator(()ident(pid)operator(\),) ident(rb_last_status)operator(\)\);) - operator(}) -preprocessor(#else) - ident(rb_last_status) operator(=) ident(Qnil)operator(;) - reserved(for) operator(()ident(pid) operator(=) operator(-)integer(1)operator(;;\)) operator({) - ident(pid) operator(=) ident(rb_waitpid)operator((-)integer(1)operator(,) operator(&)ident(status)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(pid) operator(==) operator(-)integer(1)operator(\)) operator({) - reserved(if) operator(()ident(errno) operator(==) ident(ECHILD)operator(\)) - reserved(break)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_assoc_new)operator(()ident(INT2NUM)operator(()ident(pid)operator(\),) ident(rb_last_status)operator(\)\);) - operator(}) -preprocessor(#endif) - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(detach_process_watcher)operator(()ident(arg)operator(\)) - directive(void) operator(*)ident(arg)operator(;) -operator({) - pre_type(int) ident(pid) operator(=) operator(()pre_type(int)operator(\)()ident(VALUE)operator(\))ident(arg)operator(,) ident(status)operator(;) - - reserved(while) operator(()ident(rb_waitpid)operator(()ident(pid)operator(,) operator(&)ident(status)operator(,) ident(WNOHANG)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(rb_thread_sleep)operator(()integer(1)operator(\);) - operator(}) - reserved(return) ident(rb_last_status)operator(;) -operator(}) - -ident(VALUE) -ident(rb_detach_process)operator(()ident(pid)operator(\)) - pre_type(int) ident(pid)operator(;) -operator({) - reserved(return) ident(rb_thread_create)operator(()ident(detach_process_watcher)operator(,) operator(()directive(void)operator(*\)()ident(VALUE)operator(\))ident(pid)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process.detach(pid\) => thread - * - * Some operating systems retain the status of terminated child - * processes until the parent collects that status (normally using - * some variant of wait(\). If the parent never collects - * this status, the child stays around as a zombie process. - * Process::detach prevents this by setting up a - * separate Ruby thread whose sole job is to reap the status of the - * process _pid_ when it terminates. Use detach - * only when you do not intent to explicitly wait for the child to - * terminate. detach only checks the status - * periodically (currently once each second\). - * - * The waiting thread returns the exit status of the detached process - * when it terminates, so you can use Thread#join to - * know the result. If specified _pid_ is not a valid child process - * ID, the thread returns +nil+ immediately. - * - * In this first example, we don't reap the first child process, so - * it appears as a zombie in the process status display. - * - * p1 = fork { sleep 0.1 } - * p2 = fork { sleep 0.2 } - * Process.waitpid(p2\) - * sleep 2 - * system("ps -ho pid,state -p #{p1}"\) - * - * produces: - * - * 27389 Z - * - * In the next example, Process::detach is used to reap - * the child automatically. - * - * p1 = fork { sleep 0.1 } - * p2 = fork { sleep 0.2 } - * Process.detach(p1\) - * Process.waitpid(p2\) - * sleep 2 - * system("ps -ho pid,state -p #{p1}"\) - * - * (produces no output\) - */) - -directive(static) ident(VALUE) -ident(proc_detach)operator(()ident(VALUE) ident(obj)operator(,) ident(VALUE) ident(pid)operator(\)) -operator({) - ident(rb_secure)operator(()integer(2)operator(\);) - reserved(return) ident(rb_detach_process)operator(()ident(NUM2INT)operator(()ident(pid)operator(\)\);) -operator(}) - -preprocessor(#ifndef) ident(HAVE_STRING_H) -pre_type(char) operator(*)ident(strtok)operator((\);) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_SETITIMER) -preprocessor(#define) ident(before_exec)operator((\)) ident(rb_thread_stop_timer)operator((\)) -preprocessor(#define) ident(after_exec)operator((\)) ident(rb_thread_start_timer)operator((\)) -preprocessor(#else) -preprocessor(#define) ident(before_exec)operator((\)) -preprocessor(#define) ident(after_exec)operator((\)) -preprocessor(#endif) - -directive(extern) pre_type(char) operator(*)ident(dln_find_exe)operator((\);) - -directive(static) directive(void) -ident(security)operator(()ident(str)operator(\)) - pre_type(char) operator(*)ident(str)operator(;) -operator({) - reserved(if) operator(()ident(rb_env_path_tainted)operator((\)\)) operator({) - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(str)operator(\);) - operator(}) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(proc_exec_v)operator(()ident(argv)operator(,) ident(prog)operator(\)) - pre_type(char) operator(**)ident(argv)operator(;) - pre_type(char) operator(*)ident(prog)operator(;) -operator({) - reserved(if) operator((!)ident(prog)operator(\)) - ident(prog) operator(=) ident(argv)operator([)integer(0)operator(];) - ident(security)operator(()ident(prog)operator(\);) - ident(prog) operator(=) ident(dln_find_exe)operator(()ident(prog)operator(,) integer(0)operator(\);) - reserved(if) operator((!)ident(prog)operator(\)) - reserved(return) operator(-)integer(1)operator(;) - -preprocessor(#if) operator(()ident(defined)operator(()ident(MSDOS)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(DJGPP)operator(\)\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__EMX__)operator(\)) operator(||) ident(defined)operator(()ident(OS2)operator(\)) - operator({) -preprocessor(#if) ident(defined)operator(()ident(__human68k__)operator(\)) -preprocessor(#define) ident(COMMAND) string -preprocessor(#endif) -preprocessor(#if) ident(defined)operator(()ident(__EMX__)operator(\)) operator(||) ident(defined)operator(()ident(OS2)operator(\)) comment(/* OS/2 emx */) -preprocessor(#define) ident(COMMAND) string -preprocessor(#endif) -preprocessor(#if) operator(()ident(defined)operator(()ident(MSDOS)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(DJGPP)operator(\)\)) -preprocessor(#define) ident(COMMAND) string -preprocessor(#endif) - pre_type(char) operator(*)ident(extension)operator(;) - - reserved(if) operator((()ident(extension) operator(=) ident(strrchr)operator(()ident(prog)operator(,) char('.')operator(\)\)) operator(!=) pre_constant(NULL) operator(&&) ident(strcasecmp)operator(()ident(extension)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) operator({) - pre_type(char) operator(**)ident(new_argv)operator(;) - pre_type(char) operator(*)ident(p)operator(;) - pre_type(int) ident(n)operator(;) - - reserved(for) operator(()ident(n) operator(=) integer(0)operator(;) ident(argv)operator([)ident(n)operator(];) ident(n)operator(++\)) - comment(/* no-op */)operator(;) - ident(new_argv) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(*,) ident(n) operator(+) integer(2)operator(\);) - reserved(for) operator((;) ident(n) operator(>) integer(0)operator(;) ident(n)operator(--\)) - ident(new_argv)operator([)ident(n) operator(+) integer(1)operator(]) operator(=) ident(argv)operator([)ident(n)operator(];) - ident(new_argv)operator([)integer(1)operator(]) operator(=) ident(strcpy)operator(()ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(strlen)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(+) integer(1)operator(\),) ident(argv)operator([)integer(0)operator(]\);) - reserved(for) operator(()ident(p) operator(=) ident(new_argv)operator([)integer(1)operator(];) operator(*)ident(p) operator(!=) char('\\0')operator(;) ident(p)operator(++\)) - reserved(if) operator((*)ident(p) operator(==) char('/')operator(\)) - operator(*)ident(p) operator(=) char('\\\\')operator(;) - ident(new_argv)operator([)integer(0)operator(]) operator(=) ident(COMMAND)operator(;) - ident(argv) operator(=) ident(new_argv)operator(;) - ident(prog) operator(=) ident(dln_find_exe)operator(()ident(argv)operator([)integer(0)operator(],) integer(0)operator(\);) - reserved(if) operator((!)ident(prog)operator(\)) operator({) - ident(errno) operator(=) ident(ENOENT)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - operator(}) - operator(}) -preprocessor(#endif) comment(/* MSDOS or __human68k__ or __EMX__ */) - ident(before_exec)operator((\);) - ident(rb_thread_cancel_timer)operator((\);) - ident(execv)operator(()ident(prog)operator(,) ident(argv)operator(\);) - ident(preserving_errno)operator(()ident(after_exec)operator((\)\);) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(proc_exec_n)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(progv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(progv)operator(;) -operator({) - pre_type(char) operator(*)ident(prog) operator(=) integer(0)operator(;) - pre_type(char) operator(**)ident(args)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(if) operator(()ident(progv)operator(\)) operator({) - ident(prog) operator(=) ident(RSTRING)operator(()ident(progv)operator(\)->)ident(ptr)operator(;) - operator(}) - ident(args) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(*,) ident(argc)operator(+)integer(1)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(SafeStringValue)operator(()ident(argv)operator([)ident(i)operator(]\);) - ident(args)operator([)ident(i)operator(]) operator(=) ident(RSTRING)operator(()ident(argv)operator([)ident(i)operator(]\)->)ident(ptr)operator(;) - operator(}) - ident(args)operator([)ident(i)operator(]) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(args)operator([)integer(0)operator(]\)) operator({) - reserved(return) ident(proc_exec_v)operator(()ident(args)operator(,) ident(prog)operator(\);) - operator(}) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - -pre_type(int) -ident(rb_proc_exec)operator(()ident(str)operator(\)) - directive(const) pre_type(char) operator(*)ident(str)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(s) operator(=) ident(str)operator(;) - pre_type(char) operator(*)ident(ss)operator(,) operator(*)ident(t)operator(;) - pre_type(char) operator(**)ident(argv)operator(,) operator(**)ident(a)operator(;) - - reserved(while) operator((*)ident(str) operator(&&) ident(ISSPACE)operator((*)ident(str)operator(\)\)) - ident(str)operator(++;) - -preprocessor(#ifdef) ident(_WIN32) - ident(before_exec)operator((\);) - ident(do_spawn)operator(()ident(P_OVERLAY)operator(,) operator(()pre_type(char) operator(*\))ident(str)operator(\);) - ident(after_exec)operator((\);) -preprocessor(#else) - reserved(for) operator(()ident(s)operator(=)ident(str)operator(;) operator(*)ident(s)operator(;) ident(s)operator(++\)) operator({) - reserved(if) operator((*)ident(s) operator(!=) char(' ') operator(&&) operator(!)ident(ISALPHA)operator((*)ident(s)operator(\)) operator(&&) ident(strchr)operator(()string(\)~&|)char(\\\\)content($;'`)char(\\")char(\\n)delimiter(")>operator(,*)ident(s)operator(\)\)) operator({) -preprocessor(#if) ident(defined)operator(()ident(MSDOS)operator(\)) - pre_type(int) ident(status)operator(;) - ident(before_exec)operator((\);) - ident(status) operator(=) ident(system)operator(()ident(str)operator(\);) - ident(after_exec)operator((\);) - reserved(if) operator(()ident(status) operator(!=) operator(-)integer(1)operator(\)) - ident(exit)operator(()ident(status)operator(\);) -preprocessor(#else) -preprocessor(#if) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN32__)operator(\)) operator(||) ident(defined)operator(()ident(__EMX__)operator(\)) - pre_type(char) operator(*)ident(shell) operator(=) ident(dln_find_exe)operator(()stringoperator(,) integer(0)operator(\);) - pre_type(int) ident(status) operator(=) operator(-)integer(1)operator(;) - ident(before_exec)operator((\);) - reserved(if) operator(()ident(shell)operator(\)) - ident(execl)operator(()ident(shell)operator(,) stringoperator(,) stringoperator(,) ident(str)operator(,) operator(()pre_type(char) operator(*\)) pre_constant(NULL)operator(\);) - reserved(else) - ident(status) operator(=) ident(system)operator(()ident(str)operator(\);) - ident(after_exec)operator((\);) - reserved(if) operator(()ident(status) operator(!=) operator(-)integer(1)operator(\)) - ident(exit)operator(()ident(status)operator(\);) -preprocessor(#else) - ident(before_exec)operator((\);) - ident(execl)operator(()stringoperator(,) stringoperator(,) stringoperator(,) ident(str)operator(,) operator(()pre_type(char) operator(*\))pre_constant(NULL)operator(\);) - ident(preserving_errno)operator(()ident(after_exec)operator((\)\);) -preprocessor(#endif) -preprocessor(#endif) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - operator(}) - ident(a) operator(=) ident(argv) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(*,) operator(()ident(s)operator(-)ident(str)operator(\))operator(/)integer(2)operator(+)integer(2)operator(\);) - ident(ss) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(s)operator(-)ident(str)operator(+)integer(1)operator(\);) - ident(strcpy)operator(()ident(ss)operator(,) ident(str)operator(\);) - reserved(if) operator(((*)ident(a)operator(++) operator(=) ident(strtok)operator(()ident(ss)operator(,) stringoperator(\)\)) operator(!=) integer(0)operator(\)) operator({) - reserved(while) operator((()ident(t) operator(=) ident(strtok)operator(()pre_constant(NULL)operator(,) stringoperator(\)\)) operator(!=) integer(0)operator(\)) operator({) - operator(*)ident(a)operator(++) operator(=) ident(t)operator(;) - operator(}) - operator(*)ident(a) operator(=) pre_constant(NULL)operator(;) - operator(}) - reserved(if) operator(()ident(argv)operator([)integer(0)operator(]\)) operator({) - reserved(return) ident(proc_exec_v)operator(()ident(argv)operator(,) integer(0)operator(\);) - operator(}) - ident(errno) operator(=) ident(ENOENT)operator(;) -preprocessor(#endif) comment(/* _WIN32 */) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__DJGPP__)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) -directive(static) pre_type(int) -ident(proc_spawn_v)operator(()ident(argv)operator(,) ident(prog)operator(\)) - pre_type(char) operator(**)ident(argv)operator(;) - pre_type(char) operator(*)ident(prog)operator(;) -operator({) - pre_type(char) operator(*)ident(extension)operator(;) - pre_type(int) ident(status)operator(;) - - reserved(if) operator((!)ident(prog)operator(\)) - ident(prog) operator(=) ident(argv)operator([)integer(0)operator(];) - ident(security)operator(()ident(prog)operator(\);) - ident(prog) operator(=) ident(dln_find_exe)operator(()ident(prog)operator(,) integer(0)operator(\);) - reserved(if) operator((!)ident(prog)operator(\)) - reserved(return) operator(-)integer(1)operator(;) - -preprocessor(#if) ident(defined)operator(()ident(__human68k__)operator(\)) - reserved(if) operator((()ident(extension) operator(=) ident(strrchr)operator(()ident(prog)operator(,) char('.')operator(\)\)) operator(!=) pre_constant(NULL) operator(&&) ident(strcasecmp)operator(()ident(extension)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) operator({) - pre_type(char) operator(**)ident(new_argv)operator(;) - pre_type(char) operator(*)ident(p)operator(;) - pre_type(int) ident(n)operator(;) - - reserved(for) operator(()ident(n) operator(=) integer(0)operator(;) ident(argv)operator([)ident(n)operator(];) ident(n)operator(++\)) - comment(/* no-op */)operator(;) - ident(new_argv) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(*,) ident(n) operator(+) integer(2)operator(\);) - reserved(for) operator((;) ident(n) operator(>) integer(0)operator(;) ident(n)operator(--\)) - ident(new_argv)operator([)ident(n) operator(+) integer(1)operator(]) operator(=) ident(argv)operator([)ident(n)operator(];) - ident(new_argv)operator([)integer(1)operator(]) operator(=) ident(strcpy)operator(()ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(strlen)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(+) integer(1)operator(\),) ident(argv)operator([)integer(0)operator(]\);) - reserved(for) operator(()ident(p) operator(=) ident(new_argv)operator([)integer(1)operator(];) operator(*)ident(p) operator(!=) char('\\0')operator(;) ident(p)operator(++\)) - reserved(if) operator((*)ident(p) operator(==) char('/')operator(\)) - operator(*)ident(p) operator(=) char('\\\\')operator(;) - ident(new_argv)operator([)integer(0)operator(]) operator(=) ident(COMMAND)operator(;) - ident(argv) operator(=) ident(new_argv)operator(;) - ident(prog) operator(=) ident(dln_find_exe)operator(()ident(argv)operator([)integer(0)operator(],) integer(0)operator(\);) - reserved(if) operator((!)ident(prog)operator(\)) operator({) - ident(errno) operator(=) ident(ENOENT)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - operator(}) -preprocessor(#endif) - ident(before_exec)operator((\);) -preprocessor(#if) ident(defined)operator(()ident(_WIN32)operator(\)) - ident(status) operator(=) ident(do_aspawn)operator(()ident(P_WAIT)operator(,) ident(prog)operator(,) ident(argv)operator(\);) -preprocessor(#else) - ident(status) operator(=) ident(spawnv)operator(()ident(P_WAIT)operator(,) ident(prog)operator(,) ident(argv)operator(\);) -preprocessor(#endif) - ident(after_exec)operator((\);) - reserved(return) ident(status)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(proc_spawn_n)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(prog)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(prog)operator(;) -operator({) - pre_type(char) operator(**)ident(args)operator(;) - pre_type(int) ident(i)operator(;) - - ident(args) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(*,) ident(argc) operator(+) integer(1)operator(\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(SafeStringValue)operator(()ident(argv)operator([)ident(i)operator(]\);) - ident(args)operator([)ident(i)operator(]) operator(=) ident(StringValueCStr)operator(()ident(argv)operator([)ident(i)operator(]\);) - operator(}) - reserved(if) operator(()ident(prog)operator(\)) - ident(SafeStringValue)operator(()ident(prog)operator(\);) - ident(args)operator([)ident(i)operator(]) operator(=) operator(()pre_type(char)operator(*\)) integer(0)operator(;) - reserved(if) operator(()ident(args)operator([)integer(0)operator(]\)) - reserved(return) ident(proc_spawn_v)operator(()ident(args)operator(,) ident(prog) operator(?) ident(StringValueCStr)operator(()ident(prog)operator(\)) operator(:) integer(0)operator(\);) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - -preprocessor(#if) operator(!)ident(defined)operator(()ident(_WIN32)operator(\)) -directive(static) pre_type(int) -ident(proc_spawn)operator(()ident(sv)operator(\)) - ident(VALUE) ident(sv)operator(;) -operator({) - pre_type(char) operator(*)ident(str)operator(;) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(t)operator(;) - pre_type(char) operator(**)ident(argv)operator(,) operator(**)ident(a)operator(;) - pre_type(int) ident(status)operator(;) - - ident(SafeStringValue)operator(()ident(sv)operator(\);) - ident(str) operator(=) ident(s) operator(=) ident(StringValueCStr)operator(()ident(sv)operator(\);) - reserved(for) operator(()ident(s) operator(=) ident(str)operator(;) operator(*)ident(s)operator(;) ident(s)operator(++\)) operator({) - reserved(if) operator((*)ident(s) operator(!=) char(' ') operator(&&) operator(!)ident(ISALPHA)operator((*)ident(s)operator(\)) operator(&&) ident(strchr)operator(()string(\)~&|)char(\\\\)content($;'`)char(\\")char(\\n)delimiter(")>operator(,*)ident(s)operator(\)\)) operator({) - pre_type(char) operator(*)ident(shell) operator(=) ident(dln_find_exe)operator(()stringoperator(,) integer(0)operator(\);) - ident(before_exec)operator((\);) - ident(status) operator(=) ident(shell)operator(?)ident(spawnl)operator(()ident(P_WAIT)operator(,)ident(shell)operator(,)stringoperator(,)stringoperator(,)ident(str)operator(,()pre_type(char)operator(*\))pre_constant(NULL)operator(\):)ident(system)operator(()ident(str)operator(\);) - ident(after_exec)operator((\);) - reserved(return) ident(status)operator(;) - operator(}) - operator(}) - ident(a) operator(=) ident(argv) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(*,) operator(()ident(s) operator(-) ident(str)operator(\)) operator(/) integer(2) operator(+) integer(2)operator(\);) - ident(s) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(s) operator(-) ident(str) operator(+) integer(1)operator(\);) - ident(strcpy)operator(()ident(s)operator(,) ident(str)operator(\);) - reserved(if) operator((*)ident(a)operator(++) operator(=) ident(strtok)operator(()ident(s)operator(,) stringoperator(\)\)) operator({) - reserved(while) operator(()ident(t) operator(=) ident(strtok)operator(()pre_constant(NULL)operator(,) stringoperator(\)\)) - operator(*)ident(a)operator(++) operator(=) ident(t)operator(;) - operator(*)ident(a) operator(=) pre_constant(NULL)operator(;) - operator(}) - reserved(return) ident(argv)operator([)integer(0)operator(]) operator(?) ident(proc_spawn_v)operator(()ident(argv)operator(,) integer(0)operator(\)) operator(:) operator(-)integer(1)operator(;) -operator(}) -preprocessor(#endif) -preprocessor(#endif) - -reserved(struct) ident(rb_exec_arg) operator({) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(prog)operator(;) -operator(};) - -directive(static) directive(void) -ident(proc_prepare_args)operator(()ident(e)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(prog)operator(\)) - reserved(struct) ident(rb_exec_arg) operator(*)ident(e)operator(;) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(prog)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - ident(MEMZERO)operator(()ident(e)operator(,) reserved(struct) ident(rb_exec_arg)operator(,) integer(1)operator(\);) - reserved(if) operator(()ident(prog)operator(\)) operator({) - ident(SafeStringValue)operator(()ident(prog)operator(\);) - ident(StringValueCStr)operator(()ident(prog)operator(\);) - operator(}) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(SafeStringValue)operator(()ident(argv)operator([)ident(i)operator(]\);) - ident(StringValueCStr)operator(()ident(argv)operator([)ident(i)operator(]\);) - operator(}) - ident(security)operator(()ident(RSTRING)operator(()ident(prog) operator(?) ident(prog) operator(:) ident(argv)operator([)integer(0)operator(]\)->)ident(ptr)operator(\);) - ident(e)operator(->)ident(prog) operator(=) ident(prog)operator(;) - ident(e)operator(->)ident(argc) operator(=) ident(argc)operator(;) - ident(e)operator(->)ident(argv) operator(=) ident(argv)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(proc_exec_args)operator(()ident(earg)operator(\)) - ident(VALUE) ident(earg)operator(;) -operator({) - reserved(struct) ident(rb_exec_arg) operator(*)ident(e) operator(=) operator(()reserved(struct) ident(rb_exec_arg) operator(*\))ident(earg)operator(;) - pre_type(int) ident(argc) operator(=) ident(e)operator(->)ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv) operator(=) ident(e)operator(->)ident(argv)operator(;) - ident(VALUE) ident(prog) operator(=) ident(e)operator(->)ident(prog)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(1) operator(&&) ident(prog) operator(==) integer(0)operator(\)) operator({) - reserved(return) operator(()ident(VALUE)operator(\))ident(rb_proc_exec)operator(()ident(RSTRING)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(ptr)operator(\);) - operator(}) - reserved(else) operator({) - reserved(return) operator(()ident(VALUE)operator(\))ident(proc_exec_n)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(prog)operator(\);) - operator(}) -operator(}) - -comment(/* - * call-seq: - * exec(command [, arg, ...]\) - * - * Replaces the current process by running the given external _command_. - * If +exec+ is given a single argument, that argument is - * taken as a line that is subject to shell expansion before being - * executed. If multiple arguments are given, the second and subsequent - * arguments are passed as parameters to _command_ with no shell - * expansion. If the first argument is a two-element array, the first - * element is the command to be executed, and the second argument is - * used as the argv[0] value, which may show up in process - * listings. In MSDOS environments, the command is executed in a - * subshell; otherwise, one of the exec(2\) system calls is - * used, so the running command may inherit some of the environment of - * the original program (including open file descriptors\). - * - * exec "echo *" # echoes list of files in current directory - * # never get here - * - * - * exec "echo", "*" # echoes an asterisk - * # never get here - */) - -ident(VALUE) -ident(rb_f_exec)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(prog) operator(=) integer(0)operator(;) - ident(VALUE) ident(tmp)operator(;) - reserved(struct) ident(rb_exec_arg) ident(earg)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rb_last_status) operator(=) ident(Qnil)operator(;) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - ident(tmp) operator(=) ident(rb_check_array_type)operator(()ident(argv)operator([)integer(0)operator(]\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(len) operator(!=) integer(2)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(prog) operator(=) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - ident(argv)operator([)integer(0)operator(]) operator(=) ident(RARRAY)operator(()ident(tmp)operator(\)->)ident(ptr)operator([)integer(1)operator(];) - ident(SafeStringValue)operator(()ident(prog)operator(\);) - operator(}) - ident(proc_prepare_args)operator((&)ident(earg)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(prog)operator(\);) - ident(proc_exec_args)operator((()ident(VALUE)operator(\)&)ident(earg)operator(\);) - ident(rb_sys_fail)operator(()ident(RSTRING)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(ptr)operator(\);) - reserved(return) ident(Qnil)operator(;) comment(/* dummy */) -operator(}) - - -comment(/* - * call-seq: - * Kernel.fork [{ block }] => fixnum or nil - * Process.fork [{ block }] => fixnum or nil - * - * Creates a subprocess. If a block is specified, that block is run - * in the subprocess, and the subprocess terminates with a status of - * zero. Otherwise, the +fork+ call returns twice, once in - * the parent, returning the process ID of the child, and once in - * the child, returning _nil_. The child process can exit using - * Kernel.exit! to avoid running any - * at_exit functions. The parent process should - * use Process.wait to collect the termination statuses - * of its children or use Process.detach to register - * disinterest in their status; otherwise, the operating system - * may accumulate zombie processes. - * - * The thread calling fork is the only thread in the created child process. - * fork doesn't copy other threads. - */) - -directive(static) ident(VALUE) -ident(rb_f_fork)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#if) operator(!)ident(defined)operator(()ident(__human68k__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(_WIN32)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__MACOS__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__EMX__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__VMS)operator(\)) - pre_type(int) ident(pid)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - -preprocessor(#ifndef) ident(__VMS) - ident(fflush)operator(()ident(stdout)operator(\);) - ident(fflush)operator(()ident(stderr)operator(\);) -preprocessor(#endif) - - reserved(switch) operator(()ident(pid) operator(=) ident(fork)operator((\)\)) operator({) - reserved(case) integer(0)operator(:) -preprocessor(#ifdef) ident(linux) - ident(after_exec)operator((\);) -preprocessor(#endif) - ident(rb_thread_atfork)operator((\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - pre_type(int) ident(status)operator(;) - - ident(rb_protect)operator(()ident(rb_yield)operator(,) ident(Qundef)operator(,) operator(&)ident(status)operator(\);) - ident(ruby_stop)operator(()ident(status)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) - - reserved(case) operator(-)integer(1)operator(:) - ident(rb_sys_fail)operator(()stringoperator(\);) - reserved(return) ident(Qnil)operator(;) - - reserved(default)operator(:) - reserved(return) ident(INT2FIX)operator(()ident(pid)operator(\);) - operator(}) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process.exit!(fixnum=-1\) - * - * Exits the process immediately. No exit handlers are - * run. fixnum is returned to the underlying system as the - * exit status. - * - * Process.exit!(0\) - */) - -directive(static) ident(VALUE) -ident(rb_f_exit_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(status)operator(;) - pre_type(int) ident(istatus)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(status)operator(\)) operator(==) integer(1)operator(\)) operator({) - reserved(switch) operator(()ident(status)operator(\)) operator({) - reserved(case) ident(Qtrue)operator(:) - ident(istatus) operator(=) ident(EXIT_SUCCESS)operator(;) - reserved(break)operator(;) - reserved(case) ident(Qfalse)operator(:) - ident(istatus) operator(=) ident(EXIT_FAILURE)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(istatus) operator(=) ident(NUM2INT)operator(()ident(status)operator(\);) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(istatus) operator(=) ident(EXIT_FAILURE)operator(;) - operator(}) - ident(_exit)operator(()ident(istatus)operator(\);) - - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(sun)operator(\)) -preprocessor(#define) ident(signal)operator(()ident(a)operator(,)ident(b)operator(\)) ident(sigset)operator(()ident(a)operator(,)ident(b)operator(\)) -preprocessor(#endif) - -directive(void) -ident(rb_syswait)operator(()ident(pid)operator(\)) - pre_type(int) ident(pid)operator(;) -operator({) - directive(static) pre_type(int) ident(overriding)operator(;) -preprocessor(#ifdef) ident(SIGHUP) - ident(RETSIGTYPE) operator((*)ident(hfunc)operator(\))ident(_)operator((()pre_type(int)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGQUIT) - ident(RETSIGTYPE) operator((*)ident(qfunc)operator(\))ident(_)operator((()pre_type(int)operator(\)\);) -preprocessor(#endif) - ident(RETSIGTYPE) operator((*)ident(ifunc)operator(\))ident(_)operator((()pre_type(int)operator(\)\);) - pre_type(int) ident(status)operator(;) - pre_type(int) ident(i)operator(,) ident(hooked) operator(=) ident(Qfalse)operator(;) - - reserved(if) operator((!)ident(overriding)operator(\)) operator({) -preprocessor(#ifdef) ident(SIGHUP) - ident(hfunc) operator(=) ident(signal)operator(()ident(SIGHUP)operator(,) ident(SIG_IGN)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGQUIT) - ident(qfunc) operator(=) ident(signal)operator(()ident(SIGQUIT)operator(,) ident(SIG_IGN)operator(\);) -preprocessor(#endif) - ident(ifunc) operator(=) ident(signal)operator(()ident(SIGINT)operator(,) ident(SIG_IGN)operator(\);) - ident(overriding) operator(=) ident(Qtrue)operator(;) - ident(hooked) operator(=) ident(Qtrue)operator(;) - operator(}) - - reserved(do) operator({) - ident(i) operator(=) ident(rb_waitpid)operator(()ident(pid)operator(,) operator(&)ident(status)operator(,) integer(0)operator(\);) - operator(}) reserved(while) operator(()ident(i) operator(==) operator(-)integer(1) operator(&&) ident(errno) operator(==) ident(EINTR)operator(\);) - - reserved(if) operator(()ident(hooked)operator(\)) operator({) -preprocessor(#ifdef) ident(SIGHUP) - ident(signal)operator(()ident(SIGHUP)operator(,) ident(hfunc)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGQUIT) - ident(signal)operator(()ident(SIGQUIT)operator(,) ident(qfunc)operator(\);) -preprocessor(#endif) - ident(signal)operator(()ident(SIGINT)operator(,) ident(ifunc)operator(\);) - ident(overriding) operator(=) ident(Qfalse)operator(;) - operator(}) -operator(}) - -comment(/* - * call-seq: - * system(cmd [, arg, ...]\) => true or false - * - * Executes _cmd_ in a subshell, returning +true+ if - * the command was found and ran successfully, +false+ - * otherwise. An error status is available in $?. The - * arguments are processed in the same way as for - * Kernel::exec. - * - * system("echo *"\) - * system("echo", "*"\) - * - * produces: - * - * config.h main.rb - * * - */) - -directive(static) ident(VALUE) -ident(rb_f_system)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - pre_type(int) ident(status)operator(;) -preprocessor(#if) ident(defined)operator(()ident(__EMX__)operator(\)) - ident(VALUE) ident(cmd)operator(;) - - ident(fflush)operator(()ident(stdout)operator(\);) - ident(fflush)operator(()ident(stderr)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rb_last_status) operator(=) ident(Qnil)operator(;) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(TYPE)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(==) ident(T_ARRAY)operator(\)) operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(len) operator(!=) integer(2)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(argv)operator([)integer(0)operator(]) operator(=) ident(RARRAY)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(ptr)operator([)integer(0)operator(];) - operator(}) - ident(cmd) operator(=) ident(rb_ary_join)operator(()ident(rb_ary_new4)operator(()ident(argc)operator(,) ident(argv)operator(\),) ident(rb_str_new2)operator(()stringoperator(\)\);) - - ident(SafeStringValue)operator(()ident(cmd)operator(\);) - ident(status) operator(=) ident(do_spawn)operator(()ident(RSTRING)operator(()ident(cmd)operator(\)->)ident(ptr)operator(\);) - ident(last_status_set)operator(()ident(status)operator(,) integer(0)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__DJGPP__)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) - directive(volatile) ident(VALUE) ident(prog) operator(=) integer(0)operator(;) - - ident(fflush)operator(()ident(stdout)operator(\);) - ident(fflush)operator(()ident(stderr)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rb_last_status) operator(=) ident(Qnil)operator(;) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(TYPE)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(==) ident(T_ARRAY)operator(\)) operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(len) operator(!=) integer(2)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(prog) operator(=) ident(RARRAY)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(ptr)operator([)integer(0)operator(];) - ident(argv)operator([)integer(0)operator(]) operator(=) ident(RARRAY)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(ptr)operator([)integer(1)operator(];) - operator(}) - - reserved(if) operator(()ident(argc) operator(==) integer(1) operator(&&) ident(prog) operator(==) integer(0)operator(\)) operator({) -preprocessor(#if) ident(defined)operator(()ident(_WIN32)operator(\)) - ident(SafeStringValue)operator(()ident(argv)operator([)integer(0)operator(]\);) - ident(status) operator(=) ident(do_spawn)operator(()ident(P_WAIT)operator(,) ident(StringValueCStr)operator(()ident(argv)operator([)integer(0)operator(]\)\);) -preprocessor(#else) - ident(status) operator(=) ident(proc_spawn)operator(()ident(argv)operator([)integer(0)operator(]\);) -preprocessor(#endif) - operator(}) - reserved(else) operator({) - ident(status) operator(=) ident(proc_spawn_n)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(prog)operator(\);) - operator(}) -preprocessor(#if) operator(!)ident(defined)operator(()ident(_WIN32)operator(\)) - ident(last_status_set)operator(()ident(status) operator(==) operator(-)integer(1) operator(?) integer(127) operator(:) ident(status)operator(,) integer(0)operator(\);) -preprocessor(#else) - reserved(if) operator(()ident(status) operator(==) operator(-)integer(1)operator(\)) - ident(last_status_set)operator(()hex(0x7f) operator(<<) integer(8)operator(,) integer(0)operator(\);) -preprocessor(#endif) -preprocessor(#elif) ident(defined)operator(()ident(__VMS)operator(\)) - ident(VALUE) ident(cmd)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rb_last_status) operator(=) ident(Qnil)operator(;) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(TYPE)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(==) ident(T_ARRAY)operator(\)) operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(len) operator(!=) integer(2)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(argv)operator([)integer(0)operator(]) operator(=) ident(RARRAY)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(ptr)operator([)integer(0)operator(];) - operator(}) - ident(cmd) operator(=) ident(rb_ary_join)operator(()ident(rb_ary_new4)operator(()ident(argc)operator(,) ident(argv)operator(\),) ident(rb_str_new2)operator(()stringoperator(\)\);) - - ident(SafeStringValue)operator(()ident(cmd)operator(\);) - ident(status) operator(=) ident(system)operator(()ident(StringValueCStr)operator(()ident(cmd)operator(\)\);) - ident(last_status_set)operator((()ident(status) operator(&) hex(0xff)operator(\)) operator(<<) integer(8)operator(,) integer(0)operator(\);) -preprocessor(#else) - directive(volatile) ident(VALUE) ident(prog) operator(=) integer(0)operator(;) - pre_type(int) ident(pid)operator(;) - reserved(struct) ident(rb_exec_arg) ident(earg)operator(;) - ident(RETSIGTYPE) operator((*)ident(chfunc)operator(\)()pre_type(int)operator(\);) - - ident(fflush)operator(()ident(stdout)operator(\);) - ident(fflush)operator(()ident(stderr)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rb_last_status) operator(=) ident(Qnil)operator(;) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator(()ident(TYPE)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(==) ident(T_ARRAY)operator(\)) operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(len) operator(!=) integer(2)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(prog) operator(=) ident(RARRAY)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(ptr)operator([)integer(0)operator(];) - ident(argv)operator([)integer(0)operator(]) operator(=) ident(RARRAY)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(ptr)operator([)integer(1)operator(];) - operator(}) - ident(proc_prepare_args)operator((&)ident(earg)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(prog)operator(\);) - - ident(chfunc) operator(=) ident(signal)operator(()ident(SIGCHLD)operator(,) ident(SIG_DFL)operator(\);) - label(retry:) - ident(pid) operator(=) ident(fork)operator((\);) - reserved(if) operator(()ident(pid) operator(==) integer(0)operator(\)) operator({) - comment(/* child process */) - ident(rb_thread_atfork)operator((\);) - ident(rb_protect)operator(()ident(proc_exec_args)operator(,) operator(()ident(VALUE)operator(\)&)ident(earg)operator(,) pre_constant(NULL)operator(\);) - ident(_exit)operator(()integer(127)operator(\);) - operator(}) - reserved(if) operator(()ident(pid) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(errno) operator(==) ident(EAGAIN)operator(\)) operator({) - ident(rb_thread_sleep)operator(()integer(1)operator(\);) - reserved(goto) ident(retry)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(rb_syswait)operator(()ident(pid)operator(\);) - operator(}) - ident(signal)operator(()ident(SIGCHLD)operator(,) ident(chfunc)operator(\);) - reserved(if) operator(()ident(pid) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(status) operator(=) ident(NUM2INT)operator(()ident(rb_last_status)operator(\);) -preprocessor(#endif) - - reserved(if) operator(()ident(status) operator(==) ident(EXIT_SUCCESS)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * sleep([duration]\) => fixnum - * - * Suspends the current thread for _duration_ seconds (which may be any number, - * including a +Float+ with fractional seconds\). Returns the actual number of - * seconds slept (rounded\), which may be less than that asked for if another - * thread calls Thread#run. Zero arguments causes +sleep+ to sleep - * forever. - * - * Time.new #=> Wed Apr 09 08:56:32 CDT 2003 - * sleep 1.2 #=> 1 - * Time.new #=> Wed Apr 09 08:56:33 CDT 2003 - * sleep 1.9 #=> 2 - * Time.new #=> Wed Apr 09 08:56:35 CDT 2003 - */) - -directive(static) ident(VALUE) -ident(rb_f_sleep)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - pre_type(int) ident(beg)operator(,) ident(end)operator(;) - - ident(beg) operator(=) ident(time)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(rb_thread_sleep_forever)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - ident(rb_thread_wait_for)operator(()ident(rb_time_interval)operator(()ident(argv)operator([)integer(0)operator(]\)\);) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - ident(end) operator(=) ident(time)operator(()integer(0)operator(\)) operator(-) ident(beg)operator(;) - - reserved(return) ident(INT2FIX)operator(()ident(end)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process.getpgrp => integer - * - * Returns the process group ID for this process. Not available on - * all platforms. - * - * Process.getpgid(0\) #=> 25527 - * Process.getpgrp #=> 25527 - */) - -preprocessor(#if) ident(defined)operator(()ident(SIGCLD)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(SIGCHLD)operator(\)) -preprocessor(# define) ident(SIGCHLD) ident(SIGCLD) -preprocessor(#endif) - -directive(static) ident(VALUE) -ident(proc_getpgrp)operator((\)) -operator({) - pre_type(int) ident(pgrp)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) -preprocessor(#if) ident(defined)operator(()ident(HAVE_GETPGRP)operator(\)) operator(&&) ident(defined)operator(()ident(GETPGRP_VOID)operator(\)) - ident(pgrp) operator(=) ident(getpgrp)operator((\);) - reserved(if) operator(()ident(pgrp) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(return) ident(INT2FIX)operator(()ident(pgrp)operator(\);) -preprocessor(#else) -preprocessor(# ifdef) ident(HAVE_GETPGID) - ident(pgrp) operator(=) ident(getpgid)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(pgrp) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(return) ident(INT2FIX)operator(()ident(pgrp)operator(\);) -preprocessor(# else) - ident(rb_notimplement)operator((\);) -preprocessor(# endif) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process.setpgrp => 0 - * - * Equivalent to setpgid(0,0\). Not available on all - * platforms. - */) - -directive(static) ident(VALUE) -ident(proc_setpgrp)operator((\)) -operator({) - ident(rb_secure)operator(()integer(2)operator(\);) - comment(/* check for posix setpgid(\) first; this matches the posix */) - comment(/* getpgrp(\) above. It appears that configure will set SETPGRP_VOID */) - comment(/* even though setpgrp(0,0\) would be prefered. The posix call avoids */) - comment(/* this confusion. */) -preprocessor(#ifdef) ident(HAVE_SETPGID) - reserved(if) operator(()ident(setpgid)operator(()integer(0)operator(,)integer(0)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETPGRP)operator(\)) operator(&&) ident(defined)operator(()ident(SETPGRP_VOID)operator(\)) - reserved(if) operator(()ident(setpgrp)operator((\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process.getpgid(pid\) => integer - * - * Returns the process group ID for the given process id. Not - * available on all platforms. - * - * Process.getpgid(Process.ppid(\)\) #=> 25527 - */) - -directive(static) ident(VALUE) -ident(proc_getpgid)operator(()ident(obj)operator(,) ident(pid)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(pid)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_GETPGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - pre_type(int) ident(i)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(i) operator(=) ident(getpgid)operator(()ident(NUM2INT)operator(()ident(pid)operator(\)\);) - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(return) ident(INT2NUM)operator(()ident(i)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process.setpgid(pid, integer\) => 0 - * - * Sets the process group ID of _pid_ (0 indicates this - * process\) to integer. Not available on all platforms. - */) - -directive(static) ident(VALUE) -ident(proc_setpgid)operator(()ident(obj)operator(,) ident(pid)operator(,) ident(pgrp)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(pid)operator(,) ident(pgrp)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_SETPGID) - pre_type(int) ident(ipid)operator(,) ident(ipgrp)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(ipid) operator(=) ident(NUM2INT)operator(()ident(pid)operator(\);) - ident(ipgrp) operator(=) ident(NUM2INT)operator(()ident(pgrp)operator(\);) - - reserved(if) operator(()ident(setpgid)operator(()ident(ipid)operator(,) ident(ipgrp)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process.setsid => fixnum - * - * Establishes this process as a new session and process group - * leader, with no controlling tty. Returns the session id. Not - * available on all platforms. - * - * Process.setsid #=> 27422 - */) - -directive(static) ident(VALUE) -ident(proc_setsid)operator((\)) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETSID)operator(\)) - pre_type(int) ident(pid)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(pid) operator(=) ident(setsid)operator((\);) - reserved(if) operator(()ident(pid) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(return) ident(INT2FIX)operator(()ident(pid)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETPGRP)operator(\)) operator(&&) ident(defined)operator(()ident(TIOCNOTTY)operator(\)) - ident(rb_pid_t) ident(pid)operator(;) - pre_type(int) ident(ret)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(pid) operator(=) ident(getpid)operator((\);) -preprocessor(#if) ident(defined)operator(()ident(SETPGRP_VOID)operator(\)) - ident(ret) operator(=) ident(setpgrp)operator((\);) - comment(/* If `pid_t setpgrp(void\)' is equivalent to setsid(\), - `ret' will be the same value as `pid', and following open(\) will fail. - In Linux, `int setpgrp(void\)' is equivalent to setpgid(0, 0\). */) -preprocessor(#else) - ident(ret) operator(=) ident(setpgrp)operator(()integer(0)operator(,) ident(pid)operator(\);) -preprocessor(#endif) - reserved(if) operator(()ident(ret) operator(==) operator(-)integer(1)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - - reserved(if) operator((()ident(fd) operator(=) ident(open)operator(()stringoperator(,) ident(O_RDWR)operator(\)\)) operator(>=) integer(0)operator(\)) operator({) - ident(ioctl)operator(()ident(fd)operator(,) ident(TIOCNOTTY)operator(,) pre_constant(NULL)operator(\);) - ident(close)operator(()ident(fd)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(pid)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process.getpriority(kind, integer\) => fixnum - * - * Gets the scheduling priority for specified process, process group, - * or user. kind indicates the kind of entity to find: one - * of Process::PRIO_PGRP, - * Process::PRIO_USER, or - * Process::PRIO_PROCESS. _integer_ is an id - * indicating the particular process, process group, or user (an id - * of 0 means _current_\). Lower priorities are more favorable - * for scheduling. Not available on all platforms. - * - * Process.getpriority(Process::PRIO_USER, 0\) #=> 19 - * Process.getpriority(Process::PRIO_PROCESS, 0\) #=> 19 - */) - -directive(static) ident(VALUE) -ident(proc_getpriority)operator(()ident(obj)operator(,) ident(which)operator(,) ident(who)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(which)operator(,) ident(who)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_GETPRIORITY) - pre_type(int) ident(prio)operator(,) ident(iwhich)operator(,) ident(iwho)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(iwhich) operator(=) ident(NUM2INT)operator(()ident(which)operator(\);) - ident(iwho) operator(=) ident(NUM2INT)operator(()ident(who)operator(\);) - - ident(errno) operator(=) integer(0)operator(;) - ident(prio) operator(=) ident(getpriority)operator(()ident(iwhich)operator(,) ident(iwho)operator(\);) - reserved(if) operator(()ident(errno)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(return) ident(INT2FIX)operator(()ident(prio)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process.setpriority(kind, integer, priority\) => 0 - * - * See Process#getpriority. - * - * Process.setpriority(Process::PRIO_USER, 0, 19\) #=> 0 - * Process.setpriority(Process::PRIO_PROCESS, 0, 19\) #=> 0 - * Process.getpriority(Process::PRIO_USER, 0\) #=> 19 - * Process.getpriority(Process::PRIO_PROCESS, 0\) #=> 19 - */) - -directive(static) ident(VALUE) -ident(proc_setpriority)operator(()ident(obj)operator(,) ident(which)operator(,) ident(who)operator(,) ident(prio)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(which)operator(,) ident(who)operator(,) ident(prio)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_GETPRIORITY) - pre_type(int) ident(iwhich)operator(,) ident(iwho)operator(,) ident(iprio)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - ident(iwhich) operator(=) ident(NUM2INT)operator(()ident(which)operator(\);) - ident(iwho) operator(=) ident(NUM2INT)operator(()ident(who)operator(\);) - ident(iprio) operator(=) ident(NUM2INT)operator(()ident(prio)operator(\);) - - reserved(if) operator(()ident(setpriority)operator(()ident(iwhich)operator(,) ident(iwho)operator(,) ident(iprio)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) -operator(}) - -preprocessor(#if) ident(SIZEOF_RLIM_T) operator(==) ident(SIZEOF_INT) -preprocessor(# define) ident(RLIM2NUM)operator(()ident(v)operator(\)) ident(UINT2NUM)operator(()ident(v)operator(\)) -preprocessor(# define) ident(NUM2RLIM)operator(()ident(v)operator(\)) ident(NUM2UINT)operator(()ident(v)operator(\)) -preprocessor(#elif) ident(SIZEOF_RLIM_T) operator(==) ident(SIZEOF_LONG) -preprocessor(# define) ident(RLIM2NUM)operator(()ident(v)operator(\)) ident(ULONG2NUM)operator(()ident(v)operator(\)) -preprocessor(# define) ident(NUM2RLIM)operator(()ident(v)operator(\)) ident(NUM2ULONG)operator(()ident(v)operator(\)) -preprocessor(#elif) ident(SIZEOF_RLIM_T) operator(==) ident(SIZEOF_LONG_LONG) -preprocessor(# define) ident(RLIM2NUM)operator(()ident(v)operator(\)) ident(ULL2NUM)operator(()ident(v)operator(\)) -preprocessor(# define) ident(NUM2RLIM)operator(()ident(v)operator(\)) ident(NUM2ULL)operator(()ident(v)operator(\)) -preprocessor(#endif) - -comment(/* - * call-seq: - * Process.getrlimit(resource\) => [cur_limit, max_limit] - * - * Gets the resource limit of the process. - * _cur_limit_ means current (soft\) limit and - * _max_limit_ means maximum (hard\) limit. - * - * _resource_ indicates the kind of resource to limit: - * such as Process::RLIMIT_CORE, - * Process::RLIMIT_CPU, etc. - * See Process.setrlimit for details. - * - * _cur_limit_ and _max_limit_ may be Process::RLIM_INFINITY, - * Process::RLIM_SAVED_MAX or - * Process::RLIM_SAVED_CUR. - * See Process.setrlimit and the system getrlimit(2\) manual for details. - */) - -directive(static) ident(VALUE) -ident(proc_getrlimit)operator(()ident(VALUE) ident(obj)operator(,) ident(VALUE) ident(resource)operator(\)) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_GETRLIMIT)operator(\)) operator(&&) ident(defined)operator(()ident(RLIM2NUM)operator(\)) - reserved(struct) ident(rlimit) ident(rlim)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - - reserved(if) operator(()ident(getrlimit)operator(()ident(NUM2INT)operator(()ident(resource)operator(\),) operator(&)ident(rlim)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()stringoperator(\);) - operator(}) - reserved(return) ident(rb_assoc_new)operator(()ident(RLIM2NUM)operator(()ident(rlim)operator(.)ident(rlim_cur)operator(\),) ident(RLIM2NUM)operator(()ident(rlim)operator(.)ident(rlim_max)operator(\)\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * Process.setrlimit(resource, cur_limit, max_limit\) => nil - * Process.setrlimit(resource, cur_limit\) => nil - * - * Sets the resource limit of the process. - * _cur_limit_ means current (soft\) limit and - * _max_limit_ means maximum (hard\) limit. - * - * If _max_limit_ is not given, _cur_limit_ is used. - * - * _resource_ indicates the kind of resource to limit. - * The list of resources are OS dependent. - * Ruby may support following resources. - * - * [Process::RLIMIT_CORE] core size (bytes\) (SUSv3\) - * [Process::RLIMIT_CPU] CPU time (seconds\) (SUSv3\) - * [Process::RLIMIT_DATA] data segment (bytes\) (SUSv3\) - * [Process::RLIMIT_FSIZE] file size (bytes\) (SUSv3\) - * [Process::RLIMIT_NOFILE] file descriptors (number\) (SUSv3\) - * [Process::RLIMIT_STACK] stack size (bytes\) (SUSv3\) - * [Process::RLIMIT_AS] total available memory (bytes\) (SUSv3, NetBSD, FreeBSD, OpenBSD but 4.4BSD-Lite\) - * [Process::RLIMIT_MEMLOCK] total size for mlock(2\) (bytes\) (4.4BSD, GNU/Linux\) - * [Process::RLIMIT_NPROC] number of processes for the user (number\) (4.4BSD, GNU/Linux\) - * [Process::RLIMIT_RSS] resident memory size (bytes\) (4.2BSD, GNU/Linux\) - * [Process::RLIMIT_SBSIZE] all socket buffers (bytes\) (NetBSD, FreeBSD\) - * - * Other Process::RLIMIT_??? constants may be defined. - * - * _cur_limit_ and _max_limit_ may be Process::RLIM_INFINITY, - * which means that the resource is not limited. - * They may be Process::RLIM_SAVED_MAX or - * Process::RLIM_SAVED_CUR too. - * See system setrlimit(2\) manual for details. - * - */) - -directive(static) ident(VALUE) -ident(proc_setrlimit)operator(()pre_type(int) ident(argc)operator(,) ident(VALUE) operator(*)ident(argv)operator(,) ident(VALUE) ident(obj)operator(\)) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRLIMIT)operator(\)) operator(&&) ident(defined)operator(()ident(NUM2RLIM)operator(\)) - ident(VALUE) ident(resource)operator(,) ident(rlim_cur)operator(,) ident(rlim_max)operator(;) - reserved(struct) ident(rlimit) ident(rlim)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(resource)operator(,) operator(&)ident(rlim_cur)operator(,) operator(&)ident(rlim_max)operator(\);) - reserved(if) operator(()ident(rlim_max) operator(==) ident(Qnil)operator(\)) - ident(rlim_max) operator(=) ident(rlim_cur)operator(;) - - ident(rlim)operator(.)ident(rlim_cur) operator(=) ident(NUM2RLIM)operator(()ident(rlim_cur)operator(\);) - ident(rlim)operator(.)ident(rlim_max) operator(=) ident(NUM2RLIM)operator(()ident(rlim_max)operator(\);) - - reserved(if) operator(()ident(setrlimit)operator(()ident(NUM2INT)operator(()ident(resource)operator(\),) operator(&)ident(rlim)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()stringoperator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) -operator(}) - -directive(static) pre_type(int) ident(under_uid_switch) operator(=) integer(0)operator(;) -directive(static) directive(void) -ident(check_uid_switch)operator((\)) -operator({) - ident(rb_secure)operator(()integer(2)operator(\);) - reserved(if) operator(()ident(under_uid_switch)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) -operator(}) - -directive(static) pre_type(int) ident(under_gid_switch) operator(=) integer(0)operator(;) -directive(static) directive(void) -ident(check_gid_switch)operator((\)) -operator({) - ident(rb_secure)operator(()integer(2)operator(\);) - reserved(if) operator(()ident(under_gid_switch)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) -operator(}) - - -comment(/********************************************************************* - * Document-class: Process::Sys - * - * The Process::Sys module contains UID and GID - * functions which provide direct bindings to the system calls of the - * same names instead of the more-portable versions of the same - * functionality found in the Process, - * Process::UID, and Process::GID modules. - */) - - -comment(/* - * call-seq: - * Process::Sys.setuid(integer\) => nil - * - * Set the user ID of the current process to _integer_. Not - * available on all platforms. - * - */) - -directive(static) ident(VALUE) -ident(p_sys_setuid)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) -preprocessor(#if) ident(defined) ident(HAVE_SETUID) - ident(check_uid_switch)operator((\);) - reserved(if) operator(()ident(setuid)operator(()ident(NUM2INT)operator(()ident(id)operator(\)\)) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(Qnil)operator(;) -operator(}) - - - -comment(/* - * call-seq: - * Process::Sys.setruid(integer\) => nil - * - * Set the real user ID of the calling process to _integer_. - * Not available on all platforms. - * - */) - -directive(static) ident(VALUE) -ident(p_sys_setruid)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) -preprocessor(#if) ident(defined) ident(HAVE_SETRUID) - ident(check_uid_switch)operator((\);) - reserved(if) operator(()ident(setruid)operator(()ident(NUM2INT)operator(()ident(id)operator(\)\)) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Process::Sys.seteuid(integer\) => nil - * - * Set the effective user ID of the calling process to - * _integer_. Not available on all platforms. - * - */) - -directive(static) ident(VALUE) -ident(p_sys_seteuid)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) -preprocessor(#if) ident(defined) ident(HAVE_SETEUID) - ident(check_uid_switch)operator((\);) - reserved(if) operator(()ident(seteuid)operator(()ident(NUM2INT)operator(()ident(id)operator(\)\)) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Process::Sys.setreuid(rid, eid\) => nil - * - * Sets the (integer\) real and/or effective user IDs of the current - * process to _rid_ and _eid_, respectively. A value of - * -1 for either means to leave that ID unchanged. Not - * available on all platforms. - * - */) - -directive(static) ident(VALUE) -ident(p_sys_setreuid)operator(()ident(obj)operator(,) ident(rid)operator(,) ident(eid)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(rid)operator(,) ident(eid)operator(;) -operator({) -preprocessor(#if) ident(defined) ident(HAVE_SETREUID) - ident(check_uid_switch)operator((\);) - reserved(if) operator(()ident(setreuid)operator(()ident(NUM2INT)operator(()ident(rid)operator(\),)ident(NUM2INT)operator(()ident(eid)operator(\)\)) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Process::Sys.setresuid(rid, eid, sid\) => nil - * - * Sets the (integer\) real, effective, and saved user IDs of the - * current process to _rid_, _eid_, and _sid_ respectively. A - * value of -1 for any value means to - * leave that ID unchanged. Not available on all platforms. - * - */) - -directive(static) ident(VALUE) -ident(p_sys_setresuid)operator(()ident(obj)operator(,) ident(rid)operator(,) ident(eid)operator(,) ident(sid)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(rid)operator(,) ident(eid)operator(,) ident(sid)operator(;) -operator({) -preprocessor(#if) ident(defined) ident(HAVE_SETRESUID) - ident(check_uid_switch)operator((\);) - reserved(if) operator(()ident(setresuid)operator(()ident(NUM2INT)operator(()ident(rid)operator(\),)ident(NUM2INT)operator(()ident(eid)operator(\),)ident(NUM2INT)operator(()ident(sid)operator(\)\)) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Process.uid => fixnum - * Process::UID.rid => fixnum - * Process::Sys.getuid => fixnum - * - * Returns the (real\) user ID of this process. - * - * Process.uid #=> 501 - */) - -directive(static) ident(VALUE) -ident(proc_getuid)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(uid) operator(=) ident(getuid)operator((\);) - reserved(return) ident(INT2FIX)operator(()ident(uid)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process.uid= integer => numeric - * - * Sets the (integer\) user ID for this process. Not available on all - * platforms. - */) - -directive(static) ident(VALUE) -ident(proc_setuid)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) - pre_type(int) ident(uid) operator(=) ident(NUM2INT)operator(()ident(id)operator(\);) - - ident(check_uid_switch)operator((\);) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESUID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - reserved(if) operator(()ident(setresuid)operator(()ident(uid)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETREUID) - reserved(if) operator(()ident(setreuid)operator(()ident(uid)operator(,) operator(-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETRUID) - reserved(if) operator(()ident(setruid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETUID) - operator({) - reserved(if) operator(()ident(geteuid)operator((\)) operator(==) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(setuid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_notimplement)operator((\);) - operator(}) - operator(}) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(INT2FIX)operator(()ident(uid)operator(\);) -operator(}) - - -comment(/******************************************************************** - * - * Document-class: Process::UID - * - * The Process::UID module contains a collection of - * module functions which can be used to portably get, set, and - * switch the current process's real, effective, and saved user IDs. - * - */) - -directive(static) pre_type(int) ident(SAVED_USER_ID) operator(=) operator(-)integer(1)operator(;) - -preprocessor(#ifdef) ident(BROKEN_SETREUID) -pre_type(int) -ident(setreuid)operator(()ident(ruid)operator(,) ident(euid)operator(\)) - ident(rb_uid_t) ident(ruid)operator(,) ident(euid)operator(;) -operator({) - reserved(if) operator(()ident(ruid) operator(!=) operator(-)integer(1) operator(&&) ident(ruid) operator(!=) ident(getuid)operator((\)\)) operator({) - reserved(if) operator(()ident(euid) operator(==) operator(-)integer(1)operator(\)) ident(euid) operator(=) ident(geteuid)operator((\);) - reserved(if) operator(()ident(setuid)operator(()ident(ruid)operator(\)) operator(<) integer(0)operator(\)) reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(euid) operator(!=) operator(-)integer(1) operator(&&) ident(euid) operator(!=) ident(geteuid)operator((\)\)) operator({) - reserved(if) operator(()ident(seteuid)operator(()ident(euid)operator(\)) operator(<) integer(0)operator(\)) reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) -preprocessor(#endif) - -comment(/* - * call-seq: - * Process::UID.change_privilege(integer\) => fixnum - * - * Change the current process's real and effective user ID to that - * specified by _integer_. Returns the new user ID. Not - * available on all platforms. - * - * [Process.uid, Process.euid] #=> [0, 0] - * Process::UID.change_privilege(31\) #=> 31 - * [Process.uid, Process.euid] #=> [31, 31] - */) - -directive(static) ident(VALUE) -ident(p_uid_change_privilege)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) - pre_type(int) ident(uid)operator(;) - - ident(check_uid_switch)operator((\);) - - ident(uid) operator(=) ident(NUM2INT)operator(()ident(id)operator(\);) - - reserved(if) operator(()ident(geteuid)operator((\)) operator(==) integer(0)operator(\)) operator({) comment(/* root-user */) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESUID)operator(\)) - reserved(if) operator(()ident(setresuid)operator(()ident(uid)operator(,) ident(uid)operator(,) ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETUID)operator(\)) - reserved(if) operator(()ident(setuid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETREUID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(OBSOLETE_SETREUID)operator(\)) - reserved(if) operator(()ident(getuid)operator((\)) operator(==) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(SAVED_USER_ID) operator(==) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(setreuid)operator((-)integer(1)operator(,) ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(uid) operator(==) integer(0)operator(\)) operator({) comment(/* (r,e,s\) == (root, root, x\) */) - reserved(if) operator(()ident(setreuid)operator((-)integer(1)operator(,) ident(SAVED_USER_ID)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setreuid)operator(()ident(SAVED_USER_ID)operator(,) integer(0)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) integer(0)operator(;) comment(/* (r,e,s\) == (x, root, root\) */) - reserved(if) operator(()ident(setreuid)operator(()ident(uid)operator(,) ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(setreuid)operator(()integer(0)operator(,) operator(-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(setreuid)operator(()ident(uid)operator(,) ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - operator(}) - operator(}) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(setreuid)operator(()ident(uid)operator(,) ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - operator(}) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETRUID)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_SETEUID)operator(\)) - reserved(if) operator(()ident(getuid)operator((\)) operator(==) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(SAVED_USER_ID) operator(==) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(seteuid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(uid) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(setruid)operator(()ident(SAVED_USER_ID)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(setruid)operator(()integer(0)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(setruid)operator(()integer(0)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(seteuid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setruid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - operator(}) - operator(}) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(seteuid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setruid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - operator(}) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - operator(}) reserved(else) operator({) comment(/* unprivileged user */) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESUID)operator(\)) - reserved(if) operator(()ident(setresuid)operator((()ident(getuid)operator((\)) operator(==) ident(uid)operator(\)?) operator(-)integer(1)operator(:) ident(uid)operator(,) - operator(()ident(geteuid)operator((\)) operator(==) ident(uid)operator(\)?) operator(-)integer(1)operator(:) ident(uid)operator(,) - operator(()ident(SAVED_USER_ID) operator(==) ident(uid)operator(\)?) operator(-)integer(1)operator(:) ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETREUID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(OBSOLETE_SETREUID)operator(\)) - reserved(if) operator(()ident(SAVED_USER_ID) operator(==) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(setreuid)operator((()ident(getuid)operator((\)) operator(==) ident(uid)operator(\)?) operator(-)integer(1)operator(:) ident(uid)operator(,) - operator(()ident(geteuid)operator((\)) operator(==) ident(uid)operator(\)?) operator(-)integer(1)operator(:) ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) reserved(if) operator(()ident(getuid)operator((\)) operator(!=) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(setreuid)operator(()ident(uid)operator(,) operator(()ident(geteuid)operator((\)) operator(==) ident(uid)operator(\)?) operator(-)integer(1)operator(:) ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - operator(}) reserved(else) reserved(if) operator(()comment(/* getuid(\) == uid && */) ident(geteuid)operator((\)) operator(!=) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(setreuid)operator(()ident(geteuid)operator((\),) ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - reserved(if) operator(()ident(setreuid)operator(()ident(uid)operator(,) operator(-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) comment(/* getuid(\) == uid && geteuid(\) == uid */) - reserved(if) operator(()ident(setreuid)operator((-)integer(1)operator(,) ident(SAVED_USER_ID)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setreuid)operator(()ident(SAVED_USER_ID)operator(,) ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - reserved(if) operator(()ident(setreuid)operator(()ident(uid)operator(,) operator(-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETRUID)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_SETEUID)operator(\)) - reserved(if) operator(()ident(SAVED_USER_ID) operator(==) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(geteuid)operator((\)) operator(!=) ident(uid) operator(&&) ident(seteuid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(getuid)operator((\)) operator(!=) ident(uid) operator(&&) ident(setruid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) reserved(if) operator(()comment(/* SAVED_USER_ID != uid && */) ident(geteuid)operator((\)) operator(==) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(getuid)operator((\)) operator(!=) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(setruid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(setruid)operator(()ident(SAVED_USER_ID)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - reserved(if) operator(()ident(setruid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - operator(}) reserved(else) reserved(if) operator(()comment(/* geteuid(\) != uid && */) ident(getuid)operator((\)) operator(==) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(seteuid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setruid)operator(()ident(SAVED_USER_ID)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - reserved(if) operator(()ident(setruid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#elif) ident(defined) ident(HAVE_44BSD_SETUID) - reserved(if) operator(()ident(getuid)operator((\)) operator(==) ident(uid)operator(\)) operator({) - comment(/* (r,e,s\)==(uid,?,?\) ==> (uid,uid,uid\) */) - reserved(if) operator(()ident(setuid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) - operator(}) reserved(else) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#elif) ident(defined) ident(HAVE_SETEUID) - reserved(if) operator(()ident(getuid)operator((\)) operator(==) ident(uid) operator(&&) ident(SAVED_USER_ID) operator(==) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(seteuid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#elif) ident(defined) ident(HAVE_SETUID) - reserved(if) operator(()ident(getuid)operator((\)) operator(==) ident(uid) operator(&&) ident(SAVED_USER_ID) operator(==) ident(uid)operator(\)) operator({) - reserved(if) operator(()ident(setuid)operator(()ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(uid)operator(\);) -operator(}) - - - -comment(/* - * call-seq: - * Process::Sys.setgid(integer\) => nil - * - * Set the group ID of the current process to _integer_. Not - * available on all platforms. - * - */) - -directive(static) ident(VALUE) -ident(p_sys_setgid)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) -preprocessor(#if) ident(defined) ident(HAVE_SETGID) - ident(check_gid_switch)operator((\);) - reserved(if) operator(()ident(setgid)operator(()ident(NUM2INT)operator(()ident(id)operator(\)\)) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Process::Sys.setrgid(integer\) => nil - * - * Set the real group ID of the calling process to _integer_. - * Not available on all platforms. - * - */) - -directive(static) ident(VALUE) -ident(p_sys_setrgid)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) -preprocessor(#if) ident(defined) ident(HAVE_SETRGID) - ident(check_gid_switch)operator((\);) - reserved(if) operator(()ident(setrgid)operator(()ident(NUM2INT)operator(()ident(id)operator(\)\)) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(Qnil)operator(;) -operator(}) - - - -comment(/* - * call-seq: - * Process::Sys.setegid(integer\) => nil - * - * Set the effective group ID of the calling process to - * _integer_. Not available on all platforms. - * - */) - -directive(static) ident(VALUE) -ident(p_sys_setegid)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) -preprocessor(#if) ident(defined) ident(HAVE_SETEGID) - ident(check_gid_switch)operator((\);) - reserved(if) operator(()ident(setegid)operator(()ident(NUM2INT)operator(()ident(id)operator(\)\)) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Process::Sys.setregid(rid, eid\) => nil - * - * Sets the (integer\) real and/or effective group IDs of the current - * process to rid and eid, respectively. A value of - * -1 for either means to leave that ID unchanged. Not - * available on all platforms. - * - */) - -directive(static) ident(VALUE) -ident(p_sys_setregid)operator(()ident(obj)operator(,) ident(rid)operator(,) ident(eid)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(rid)operator(,) ident(eid)operator(;) -operator({) -preprocessor(#if) ident(defined) ident(HAVE_SETREGID) - ident(check_gid_switch)operator((\);) - reserved(if) operator(()ident(setregid)operator(()ident(NUM2INT)operator(()ident(rid)operator(\),)ident(NUM2INT)operator(()ident(eid)operator(\)\)) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * Process::Sys.setresgid(rid, eid, sid\) => nil - * - * Sets the (integer\) real, effective, and saved user IDs of the - * current process to rid, eid, and sid - * respectively. A value of -1 for any value means to - * leave that ID unchanged. Not available on all platforms. - * - */) - -directive(static) ident(VALUE) -ident(p_sys_setresgid)operator(()ident(obj)operator(,) ident(rid)operator(,) ident(eid)operator(,) ident(sid)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(rid)operator(,) ident(eid)operator(,) ident(sid)operator(;) -operator({) -preprocessor(#if) ident(defined) ident(HAVE_SETRESGID) - ident(check_gid_switch)operator((\);) - reserved(if) operator(()ident(setresgid)operator(()ident(NUM2INT)operator(()ident(rid)operator(\),)ident(NUM2INT)operator(()ident(eid)operator(\),)ident(NUM2INT)operator(()ident(sid)operator(\)\)) operator(!=) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Process::Sys.issetugid => true or false - * - * Returns +true+ if the process was created as a result - * of an execve(2\) system call which had either of the setuid or - * setgid bits set (and extra privileges were given as a result\) or - * if it has changed any of its real, effective or saved user or - * group IDs since it began execution. - * - */) - -directive(static) ident(VALUE) -ident(p_sys_issetugid)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#if) ident(defined) ident(HAVE_ISSETUGID) - ident(rb_secure)operator(()integer(2)operator(\);) - reserved(if) operator(()ident(issetugid)operator((\)\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) reserved(else) operator({) - reserved(return) ident(Qfalse)operator(;) - operator(}) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process.gid => fixnum - * Process::GID.rid => fixnum - * Process::Sys.getgid => fixnum - * - * Returns the (real\) group ID for this process. - * - * Process.gid #=> 500 - */) - -directive(static) ident(VALUE) -ident(proc_getgid)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(gid) operator(=) ident(getgid)operator((\);) - reserved(return) ident(INT2FIX)operator(()ident(gid)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process.gid= fixnum => fixnum - * - * Sets the group ID for this process. - */) - -directive(static) ident(VALUE) -ident(proc_setgid)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) - pre_type(int) ident(gid) operator(=) ident(NUM2INT)operator(()ident(id)operator(\);) - - ident(check_gid_switch)operator((\);) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - reserved(if) operator(()ident(setresgid)operator(()ident(gid)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETREGID) - reserved(if) operator(()ident(setregid)operator(()ident(gid)operator(,) operator(-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETRGID) - reserved(if) operator(()ident(setrgid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETGID) - operator({) - reserved(if) operator(()ident(getegid)operator((\)) operator(==) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(setgid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_notimplement)operator((\);) - operator(}) - operator(}) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(INT2FIX)operator(()ident(gid)operator(\);) -operator(}) - - -directive(static) ident(size_t) ident(maxgroups) operator(=) integer(32)operator(;) - - -comment(/* - * call-seq: - * Process.groups => array - * - * Get an Array of the gids of groups in the - * supplemental group access list for this process. - * - * Process.groups #=> [27, 6, 10, 11] - * - */) - -directive(static) ident(VALUE) -ident(proc_getgroups)operator(()ident(VALUE) ident(obj)operator(\)) -operator({) -preprocessor(#ifdef) ident(HAVE_GETGROUPS) - ident(VALUE) ident(ary)operator(;) - ident(size_t) ident(ngroups)operator(;) - ident(rb_gid_t) operator(*)ident(groups)operator(;) - pre_type(int) ident(i)operator(;) - - ident(groups) operator(=) ident(ALLOCA_N)operator(()ident(rb_gid_t)operator(,) ident(maxgroups)operator(\);) - - ident(ngroups) operator(=) ident(getgroups)operator(()ident(maxgroups)operator(,) ident(groups)operator(\);) - reserved(if) operator(()ident(ngroups) operator(==) operator(-)integer(1)operator(\)) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(ngroups)operator(;) ident(i)operator(++\)) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(INT2NUM)operator(()ident(groups)operator([)ident(i)operator(]\)\);) - - reserved(return) ident(ary)operator(;) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process.groups= array => array - * - * Set the supplemental group access list to the given - * Array of group IDs. - * - * Process.groups #=> [0, 1, 2, 3, 4, 6, 10, 11, 20, 26, 27] - * Process.groups = [27, 6, 10, 11] #=> [27, 6, 10, 11] - * Process.groups #=> [27, 6, 10, 11] - * - */) - -directive(static) ident(VALUE) -ident(proc_setgroups)operator(()ident(VALUE) ident(obj)operator(,) ident(VALUE) ident(ary)operator(\)) -operator({) -preprocessor(#ifdef) ident(HAVE_SETGROUPS) - ident(size_t) ident(ngroups)operator(;) - ident(rb_gid_t) operator(*)ident(groups)operator(;) - pre_type(int) ident(i)operator(;) - reserved(struct) ident(group) operator(*)ident(gr)operator(;) - - ident(Check_Type)operator(()ident(ary)operator(,) ident(T_ARRAY)operator(\);) - - ident(ngroups) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(ngroups) operator(>) ident(maxgroups)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(maxgroups)operator(\);) - - ident(groups) operator(=) ident(ALLOCA_N)operator(()ident(rb_gid_t)operator(,) ident(ngroups)operator(\);) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(ngroups) operator(&&) ident(i) operator(<) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(g) operator(=) ident(RARRAY)operator(()ident(ary)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(g)operator(\)\)) operator({) - ident(groups)operator([)ident(i)operator(]) operator(=) ident(FIX2INT)operator(()ident(g)operator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(tmp) operator(=) ident(rb_check_string_type)operator(()ident(g)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - ident(groups)operator([)ident(i)operator(]) operator(=) ident(NUM2INT)operator(()ident(g)operator(\);) - operator(}) - reserved(else) operator({) - ident(gr) operator(=) ident(getgrnam)operator(()ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator(\);) - reserved(if) operator(()ident(gr) operator(==) pre_constant(NULL)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) - stringoperator(,) ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator(\);) - ident(groups)operator([)ident(i)operator(]) operator(=) ident(gr)operator(->)ident(gr_gid)operator(;) - operator(}) - operator(}) - operator(}) - - ident(i) operator(=) ident(setgroups)operator(()ident(ngroups)operator(,) ident(groups)operator(\);) - reserved(if) operator(()ident(i) operator(==) operator(-)integer(1)operator(\)) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - - reserved(return) ident(proc_getgroups)operator(()ident(obj)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process.initgroups(username, gid\) => array - * - * Initializes the supplemental group access list by reading the - * system group database and using all groups of which the given user - * is a member. The group with the specified gid is also - * added to the list. Returns the resulting Array of the - * gids of all the groups in the supplementary group access list. Not - * available on all platforms. - * - * Process.groups #=> [0, 1, 2, 3, 4, 6, 10, 11, 20, 26, 27] - * Process.initgroups( "mgranger", 30 \) #=> [30, 6, 10, 11] - * Process.groups #=> [30, 6, 10, 11] - * - */) - -directive(static) ident(VALUE) -ident(proc_initgroups)operator(()ident(obj)operator(,) ident(uname)operator(,) ident(base_grp)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(uname)operator(,) ident(base_grp)operator(;) -operator({) -preprocessor(#ifdef) ident(HAVE_INITGROUPS) - reserved(if) operator(()ident(initgroups)operator(()ident(StringValuePtr)operator(()ident(uname)operator(\),) operator(()ident(rb_gid_t)operator(\))ident(NUM2INT)operator(()ident(base_grp)operator(\)\)) operator(!=) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - reserved(return) ident(proc_getgroups)operator(()ident(obj)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) - reserved(return) ident(Qnil)operator(;) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process.maxgroups => fixnum - * - * Returns the maximum number of gids allowed in the supplemental - * group access list. - * - * Process.maxgroups #=> 32 - */) - -directive(static) ident(VALUE) -ident(proc_getmaxgroups)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(INT2FIX)operator(()ident(maxgroups)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process.maxgroups= fixnum => fixnum - * - * Sets the maximum number of gids allowed in the supplemental group - * access list. - */) - -directive(static) ident(VALUE) -ident(proc_setmaxgroups)operator(()ident(VALUE) ident(obj)operator(,) ident(VALUE) ident(val)operator(\)) -operator({) - ident(size_t) ident(ngroups) operator(=) ident(FIX2INT)operator(()ident(val)operator(\);) - - reserved(if) operator(()ident(ngroups) operator(>) integer(4096)operator(\)) - ident(ngroups) operator(=) integer(4096)operator(;) - - ident(maxgroups) operator(=) ident(ngroups)operator(;) - - reserved(return) ident(INT2FIX)operator(()ident(maxgroups)operator(\);) -operator(}) - - -comment(/******************************************************************** - * - * Document-class: Process::GID - * - * The Process::GID module contains a collection of - * module functions which can be used to portably get, set, and - * switch the current process's real, effective, and saved group IDs. - * - */) - -directive(static) pre_type(int) ident(SAVED_GROUP_ID) operator(=) operator(-)integer(1)operator(;) - -preprocessor(#ifdef) ident(BROKEN_SETREGID) -pre_type(int) -ident(setregid)operator(()ident(rgid)operator(,) ident(egid)operator(\)) - ident(rb_gid_t) ident(rgid)operator(,) ident(egid)operator(;) -operator({) - reserved(if) operator(()ident(rgid) operator(!=) operator(-)integer(1) operator(&&) ident(rgid) operator(!=) ident(getgid)operator((\)\)) operator({) - reserved(if) operator(()ident(egid) operator(==) operator(-)integer(1)operator(\)) ident(egid) operator(=) ident(getegid)operator((\);) - reserved(if) operator(()ident(setgid)operator(()ident(rgid)operator(\)) operator(<) integer(0)operator(\)) reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(egid) operator(!=) operator(-)integer(1) operator(&&) ident(egid) operator(!=) ident(getegid)operator((\)\)) operator({) - reserved(if) operator(()ident(setegid)operator(()ident(egid)operator(\)) operator(<) integer(0)operator(\)) reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) -preprocessor(#endif) - -comment(/* - * call-seq: - * Process::GID.change_privilege(integer\) => fixnum - * - * Change the current process's real and effective group ID to that - * specified by _integer_. Returns the new group ID. Not - * available on all platforms. - * - * [Process.gid, Process.egid] #=> [0, 0] - * Process::GID.change_privilege(33\) #=> 33 - * [Process.gid, Process.egid] #=> [33, 33] - */) - -directive(static) ident(VALUE) -ident(p_gid_change_privilege)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) - pre_type(int) ident(gid)operator(;) - - ident(check_gid_switch)operator((\);) - - ident(gid) operator(=) ident(NUM2INT)operator(()ident(id)operator(\);) - - reserved(if) operator(()ident(geteuid)operator((\)) operator(==) integer(0)operator(\)) operator({) comment(/* root-user */) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESGID)operator(\)) - reserved(if) operator(()ident(setresgid)operator(()ident(gid)operator(,) ident(gid)operator(,) ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) -preprocessor(#elif) ident(defined) ident(HAVE_SETGID) - reserved(if) operator(()ident(setgid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETREGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(OBSOLETE_SETREGID)operator(\)) - reserved(if) operator(()ident(getgid)operator((\)) operator(==) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(SAVED_GROUP_ID) operator(==) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(setregid)operator((-)integer(1)operator(,) ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(gid) operator(==) integer(0)operator(\)) operator({) comment(/* (r,e,s\) == (root, y, x\) */) - reserved(if) operator(()ident(setregid)operator((-)integer(1)operator(,) ident(SAVED_GROUP_ID)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setregid)operator(()ident(SAVED_GROUP_ID)operator(,) integer(0)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) integer(0)operator(;) comment(/* (r,e,s\) == (x, root, root\) */) - reserved(if) operator(()ident(setregid)operator(()ident(gid)operator(,) ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - operator(}) reserved(else) operator({) comment(/* (r,e,s\) == (z, y, x\) */) - reserved(if) operator(()ident(setregid)operator(()integer(0)operator(,) integer(0)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(setregid)operator(()ident(gid)operator(,) ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - operator(}) - operator(}) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(setregid)operator(()ident(gid)operator(,) ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - operator(}) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETRGID)operator(\)) operator(&&) ident(defined) operator(()ident(HAVE_SETEGID)operator(\)) - reserved(if) operator(()ident(getgid)operator((\)) operator(==) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(SAVED_GROUP_ID) operator(==) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(setegid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(gid) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(setegid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setrgid)operator(()ident(SAVED_GROUP_ID)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(setrgid)operator(()integer(0)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(setrgid)operator(()integer(0)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(setegid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setrgid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - operator(}) - operator(}) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(setegid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setrgid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - operator(}) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - operator(}) reserved(else) operator({) comment(/* unprivileged user */) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESGID)operator(\)) - reserved(if) operator(()ident(setresgid)operator((()ident(getgid)operator((\)) operator(==) ident(gid)operator(\)?) operator(-)integer(1)operator(:) ident(gid)operator(,) - operator(()ident(getegid)operator((\)) operator(==) ident(gid)operator(\)?) operator(-)integer(1)operator(:) ident(gid)operator(,) - operator(()ident(SAVED_GROUP_ID) operator(==) ident(gid)operator(\)?) operator(-)integer(1)operator(:) ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETREGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(OBSOLETE_SETREGID)operator(\)) - reserved(if) operator(()ident(SAVED_GROUP_ID) operator(==) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(setregid)operator((()ident(getgid)operator((\)) operator(==) ident(gid)operator(\)?) operator(-)integer(1)operator(:) ident(gid)operator(,) - operator(()ident(getegid)operator((\)) operator(==) ident(gid)operator(\)?) operator(-)integer(1)operator(:) ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) reserved(if) operator(()ident(getgid)operator((\)) operator(!=) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(setregid)operator(()ident(gid)operator(,) operator(()ident(getegid)operator((\)) operator(==) ident(gid)operator(\)?) operator(-)integer(1)operator(:) ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - operator(}) reserved(else) reserved(if) operator(()comment(/* getgid(\) == gid && */) ident(getegid)operator((\)) operator(!=) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(setregid)operator(()ident(getegid)operator((\),) ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - reserved(if) operator(()ident(setregid)operator(()ident(gid)operator(,) operator(-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) comment(/* getgid(\) == gid && getegid(\) == gid */) - reserved(if) operator(()ident(setregid)operator((-)integer(1)operator(,) ident(SAVED_GROUP_ID)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setregid)operator(()ident(SAVED_GROUP_ID)operator(,) ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - reserved(if) operator(()ident(setregid)operator(()ident(gid)operator(,) operator(-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETRGID)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_SETEGID)operator(\)) - reserved(if) operator(()ident(SAVED_GROUP_ID) operator(==) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(getegid)operator((\)) operator(!=) ident(gid) operator(&&) ident(setegid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(getgid)operator((\)) operator(!=) ident(gid) operator(&&) ident(setrgid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) reserved(if) operator(()comment(/* SAVED_GROUP_ID != gid && */) ident(getegid)operator((\)) operator(==) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(getgid)operator((\)) operator(!=) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(setrgid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(setrgid)operator(()ident(SAVED_GROUP_ID)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - reserved(if) operator(()ident(setrgid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - operator(}) reserved(else) reserved(if) operator(()comment(/* getegid(\) != gid && */) ident(getgid)operator((\)) operator(==) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(setegid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setrgid)operator(()ident(SAVED_GROUP_ID)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - reserved(if) operator(()ident(setrgid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#elif) ident(defined) ident(HAVE_44BSD_SETGID) - reserved(if) operator(()ident(getgid)operator((\)) operator(==) ident(gid)operator(\)) operator({) - comment(/* (r,e,s\)==(gid,?,?\) ==> (gid,gid,gid\) */) - reserved(if) operator(()ident(setgid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) - operator(}) reserved(else) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#elif) ident(defined) ident(HAVE_SETEGID) - reserved(if) operator(()ident(getgid)operator((\)) operator(==) ident(gid) operator(&&) ident(SAVED_GROUP_ID) operator(==) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(setegid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#elif) ident(defined) ident(HAVE_SETGID) - reserved(if) operator(()ident(getgid)operator((\)) operator(==) ident(gid) operator(&&) ident(SAVED_GROUP_ID) operator(==) ident(gid)operator(\)) operator({) - reserved(if) operator(()ident(setgid)operator(()ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) reserved(else) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(gid)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process.euid => fixnum - * Process::UID.eid => fixnum - * Process::Sys.geteuid => fixnum - * - * Returns the effective user ID for this process. - * - * Process.euid #=> 501 - */) - -directive(static) ident(VALUE) -ident(proc_geteuid)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(euid) operator(=) ident(geteuid)operator((\);) - reserved(return) ident(INT2FIX)operator(()ident(euid)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process.euid= integer - * - * Sets the effective user ID for this process. Not available on all - * platforms. - */) - -directive(static) ident(VALUE) -ident(proc_seteuid)operator(()ident(obj)operator(,) ident(euid)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(euid)operator(;) -operator({) - ident(check_uid_switch)operator((\);) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESUID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - reserved(if) operator(()ident(setresuid)operator((-)integer(1)operator(,) ident(NUM2INT)operator(()ident(euid)operator(\),) operator(-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETREUID) - reserved(if) operator(()ident(setreuid)operator((-)integer(1)operator(,) ident(NUM2INT)operator(()ident(euid)operator(\)\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETEUID) - reserved(if) operator(()ident(seteuid)operator(()ident(NUM2INT)operator(()ident(euid)operator(\)\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETUID) - ident(euid) operator(=) ident(NUM2INT)operator(()ident(euid)operator(\);) - reserved(if) operator(()ident(euid) operator(==) ident(getuid)operator((\)\)) operator({) - reserved(if) operator(()ident(setuid)operator(()ident(euid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_notimplement)operator((\);) - operator(}) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(euid)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_seteuid_core)operator(()ident(euid)operator(\)) - pre_type(int) ident(euid)operator(;) -operator({) - pre_type(int) ident(uid)operator(;) - - ident(check_uid_switch)operator((\);) - - ident(uid) operator(=) ident(getuid)operator((\);) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESUID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - reserved(if) operator(()ident(uid) operator(!=) ident(euid)operator(\)) operator({) - reserved(if) operator(()ident(setresuid)operator((-)integer(1)operator(,)ident(euid)operator(,)ident(euid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(euid)operator(;) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(setresuid)operator((-)integer(1)operator(,)ident(euid)operator(,-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETREUID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(OBSOLETE_SETREUID)operator(\)) - reserved(if) operator(()ident(setreuid)operator((-)integer(1)operator(,) ident(euid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(uid) operator(!=) ident(euid)operator(\)) operator({) - reserved(if) operator(()ident(setreuid)operator(()ident(euid)operator(,)ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setreuid)operator(()ident(uid)operator(,)ident(euid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(euid)operator(;) - operator(}) -preprocessor(#elif) ident(defined) ident(HAVE_SETEUID) - reserved(if) operator(()ident(seteuid)operator(()ident(euid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETUID) - reserved(if) operator(()ident(geteuid)operator((\)) operator(==) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setuid)operator(()ident(euid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(INT2FIX)operator(()ident(euid)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process::UID.grant_privilege(integer\) => fixnum - * Process::UID.eid= integer => fixnum - * - * Set the effective user ID, and if possible, the saved user ID of - * the process to the given _integer_. Returns the new - * effective user ID. Not available on all platforms. - * - * [Process.uid, Process.euid] #=> [0, 0] - * Process::UID.grant_privilege(31\) #=> 31 - * [Process.uid, Process.euid] #=> [0, 31] - */) - -directive(static) ident(VALUE) -ident(p_uid_grant_privilege)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) - reserved(return) ident(rb_seteuid_core)operator(()ident(NUM2INT)operator(()ident(id)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * Process.egid => fixnum - * Process::GID.eid => fixnum - * Process::Sys.geteid => fixnum - * - * Returns the effective group ID for this process. Not available on - * all platforms. - * - * Process.egid #=> 500 - */) - -directive(static) ident(VALUE) -ident(proc_getegid)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(egid) operator(=) ident(getegid)operator((\);) - - reserved(return) ident(INT2FIX)operator(()ident(egid)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process.egid = fixnum => fixnum - * - * Sets the effective group ID for this process. Not available on all - * platforms. - */) - -directive(static) ident(VALUE) -ident(proc_setegid)operator(()ident(obj)operator(,) ident(egid)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(egid)operator(;) -operator({) - ident(check_gid_switch)operator((\);) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - reserved(if) operator(()ident(setresgid)operator((-)integer(1)operator(,) ident(NUM2INT)operator(()ident(egid)operator(\),) operator(-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETREGID) - reserved(if) operator(()ident(setregid)operator((-)integer(1)operator(,) ident(NUM2INT)operator(()ident(egid)operator(\)\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETEGID) - reserved(if) operator(()ident(setegid)operator(()ident(NUM2INT)operator(()ident(egid)operator(\)\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETGID) - ident(egid) operator(=) ident(NUM2INT)operator(()ident(egid)operator(\);) - reserved(if) operator(()ident(egid) operator(==) ident(getgid)operator((\)\)) operator({) - reserved(if) operator(()ident(setgid)operator(()ident(egid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_notimplement)operator((\);) - operator(}) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(egid)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_setegid_core)operator(()ident(egid)operator(\)) - pre_type(int) ident(egid)operator(;) -operator({) - pre_type(int) ident(gid)operator(;) - - ident(check_gid_switch)operator((\);) - - ident(gid) operator(=) ident(getgid)operator((\);) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - reserved(if) operator(()ident(gid) operator(!=) ident(egid)operator(\)) operator({) - reserved(if) operator(()ident(setresgid)operator((-)integer(1)operator(,)ident(egid)operator(,)ident(egid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(egid)operator(;) - operator(}) reserved(else) operator({) - reserved(if) operator(()ident(setresgid)operator((-)integer(1)operator(,)ident(egid)operator(,-)integer(1)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETREGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(OBSOLETE_SETREGID)operator(\)) - reserved(if) operator(()ident(setregid)operator((-)integer(1)operator(,) ident(egid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(gid) operator(!=) ident(egid)operator(\)) operator({) - reserved(if) operator(()ident(setregid)operator(()ident(egid)operator(,)ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setregid)operator(()ident(gid)operator(,)ident(egid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(egid)operator(;) - operator(}) -preprocessor(#elif) ident(defined) ident(HAVE_SETEGID) - reserved(if) operator(()ident(setegid)operator(()ident(egid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#elif) ident(defined) ident(HAVE_SETGID) - reserved(if) operator(()ident(geteuid)operator((\)) operator(==) integer(0) comment(/* root user */)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(setgid)operator(()ident(egid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(INT2FIX)operator(()ident(egid)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process::GID.grant_privilege(integer\) => fixnum - * Process::GID.eid = integer => fixnum - * - * Set the effective group ID, and if possible, the saved group ID of - * the process to the given _integer_. Returns the new - * effective group ID. Not available on all platforms. - * - * [Process.gid, Process.egid] #=> [0, 0] - * Process::GID.grant_privilege(31\) #=> 33 - * [Process.gid, Process.egid] #=> [0, 33] - */) - -directive(static) ident(VALUE) -ident(p_gid_grant_privilege)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(id)operator(;) -operator({) - reserved(return) ident(rb_setegid_core)operator(()ident(NUM2INT)operator(()ident(id)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * Process::UID.re_exchangeable? => true or false - * - * Returns +true+ if the real and effective user IDs of a - * process may be exchanged on the current platform. - * - */) - -directive(static) ident(VALUE) -ident(p_uid_exchangeable)operator((\)) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESUID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - reserved(return) ident(Qtrue)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETREUID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(OBSOLETE_SETREUID)operator(\)) - reserved(return) ident(Qtrue)operator(;) -preprocessor(#else) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process::UID.re_exchange => fixnum - * - * Exchange real and effective user IDs and return the new effective - * user ID. Not available on all platforms. - * - * [Process.uid, Process.euid] #=> [0, 31] - * Process::UID.re_exchange #=> 0 - * [Process.uid, Process.euid] #=> [31, 0] - */) - -directive(static) ident(VALUE) -ident(p_uid_exchange)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(uid)operator(,) ident(euid)operator(;) - - ident(check_uid_switch)operator((\);) - - ident(uid) operator(=) ident(getuid)operator((\);) - ident(euid) operator(=) ident(geteuid)operator((\);) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESUID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - reserved(if) operator(()ident(setresuid)operator(()ident(euid)operator(,) ident(uid)operator(,) ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETREUID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(OBSOLETE_SETREUID)operator(\)) - reserved(if) operator(()ident(setreuid)operator(()ident(euid)operator(,)ident(uid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_USER_ID) operator(=) ident(uid)operator(;) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(INT2FIX)operator(()ident(uid)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process::GID.re_exchangeable? => true or false - * - * Returns +true+ if the real and effective group IDs of a - * process may be exchanged on the current platform. - * - */) - -directive(static) ident(VALUE) -ident(p_gid_exchangeable)operator((\)) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - reserved(return) ident(Qtrue)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETREGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(OBSOLETE_SETREGID)operator(\)) - reserved(return) ident(Qtrue)operator(;) -preprocessor(#else) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process::GID.re_exchange => fixnum - * - * Exchange real and effective group IDs and return the new effective - * group ID. Not available on all platforms. - * - * [Process.gid, Process.egid] #=> [0, 33] - * Process::GID.re_exchange #=> 0 - * [Process.gid, Process.egid] #=> [33, 0] - */) - -directive(static) ident(VALUE) -ident(p_gid_exchange)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(gid)operator(,) ident(egid)operator(;) - - ident(check_gid_switch)operator((\);) - - ident(gid) operator(=) ident(getgid)operator((\);) - ident(egid) operator(=) ident(getegid)operator((\);) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - reserved(if) operator(()ident(setresgid)operator(()ident(egid)operator(,) ident(gid)operator(,) ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETREGID)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(OBSOLETE_SETREGID)operator(\)) - reserved(if) operator(()ident(setregid)operator(()ident(egid)operator(,)ident(gid)operator(\)) operator(<) integer(0)operator(\)) ident(rb_sys_fail)operator(()integer(0)operator(\);) - ident(SAVED_GROUP_ID) operator(=) ident(gid)operator(;) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) - reserved(return) ident(INT2FIX)operator(()ident(gid)operator(\);) -operator(}) - -comment(/* [MG] :FIXME: Is this correct? I'm not sure how to phrase this. */) - -comment(/* - * call-seq: - * Process::UID.sid_available? => true or false - * - * Returns +true+ if the current platform has saved user - * ID functionality. - * - */) - -directive(static) ident(VALUE) -ident(p_uid_have_saved_id)operator((\)) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESUID)operator(\)) operator(||) ident(defined)operator(()ident(HAVE_SETEUID)operator(\)) operator(||) ident(defined)operator(()ident(_POSIX_SAVED_IDS)operator(\)) - reserved(return) ident(Qtrue)operator(;) -preprocessor(#else) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) -operator(}) - - -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESUID)operator(\)) operator(||) ident(defined)operator(()ident(HAVE_SETEUID)operator(\)) operator(||) ident(defined)operator(()ident(_POSIX_SAVED_IDS)operator(\)) -directive(static) ident(VALUE) -ident(p_uid_sw_ensure)operator(()ident(id)operator(\)) - pre_type(int) ident(id)operator(;) -operator({) - ident(under_uid_switch) operator(=) integer(0)operator(;) - reserved(return) ident(rb_seteuid_core)operator(()ident(id)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process::UID.switch => fixnum - * Process::UID.switch {|| block} => object - * - * Switch the effective and real user IDs of the current process. If - * a block is given, the user IDs will be switched back - * after the block is executed. Returns the new effective user ID if - * called without a block, and the return value of the block if one - * is given. - * - */) - -directive(static) ident(VALUE) -ident(p_uid_switch)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(uid)operator(,) ident(euid)operator(;) - - ident(check_uid_switch)operator((\);) - - ident(uid) operator(=) ident(getuid)operator((\);) - ident(euid) operator(=) ident(geteuid)operator((\);) - - reserved(if) operator(()ident(uid) operator(!=) ident(euid)operator(\)) operator({) - ident(proc_seteuid)operator(()ident(obj)operator(,) ident(INT2FIX)operator(()ident(uid)operator(\)\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(under_uid_switch) operator(=) integer(1)operator(;) - reserved(return) ident(rb_ensure)operator(()ident(rb_yield)operator(,) ident(Qnil)operator(,) ident(p_uid_sw_ensure)operator(,) ident(SAVED_USER_ID)operator(\);) - operator(}) reserved(else) operator({) - reserved(return) ident(INT2FIX)operator(()ident(euid)operator(\);) - operator(}) - operator(}) reserved(else) reserved(if) operator(()ident(euid) operator(!=) ident(SAVED_USER_ID)operator(\)) operator({) - ident(proc_seteuid)operator(()ident(obj)operator(,) ident(INT2FIX)operator(()ident(SAVED_USER_ID)operator(\)\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(under_uid_switch) operator(=) integer(1)operator(;) - reserved(return) ident(rb_ensure)operator(()ident(rb_yield)operator(,) ident(Qnil)operator(,) ident(p_uid_sw_ensure)operator(,) ident(euid)operator(\);) - operator(}) reserved(else) operator({) - reserved(return) ident(INT2FIX)operator(()ident(uid)operator(\);) - operator(}) - operator(}) reserved(else) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - -preprocessor(#else) -directive(static) ident(VALUE) -ident(p_uid_sw_ensure)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(under_uid_switch) operator(=) integer(0)operator(;) - reserved(return) ident(p_uid_exchange)operator(()ident(obj)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(p_uid_switch)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(uid)operator(,) ident(euid)operator(;) - - ident(check_uid_switch)operator((\);) - - ident(uid) operator(=) ident(getuid)operator((\);) - ident(euid) operator(=) ident(geteuid)operator((\);) - - reserved(if) operator(()ident(uid) operator(==) ident(euid)operator(\)) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - ident(p_uid_exchange)operator(()ident(obj)operator(\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(under_uid_switch) operator(=) integer(1)operator(;) - reserved(return) ident(rb_ensure)operator(()ident(rb_yield)operator(,) ident(Qnil)operator(,) ident(p_uid_sw_ensure)operator(,) ident(obj)operator(\);) - operator(}) reserved(else) operator({) - reserved(return) ident(INT2FIX)operator(()ident(euid)operator(\);) - operator(}) -preprocessor(#endif) -operator(}) - - -comment(/* [MG] :FIXME: Is this correct? I'm not sure how to phrase this. */) - -comment(/* - * call-seq: - * Process::GID.sid_available? => true or false - * - * Returns +true+ if the current platform has saved group - * ID functionality. - * - */) - -directive(static) ident(VALUE) -ident(p_gid_have_saved_id)operator((\)) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESGID)operator(\)) operator(||) ident(defined)operator(()ident(HAVE_SETEGID)operator(\)) operator(||) ident(defined)operator(()ident(_POSIX_SAVED_IDS)operator(\)) - reserved(return) ident(Qtrue)operator(;) -preprocessor(#else) - reserved(return) ident(Qfalse)operator(;) -preprocessor(#endif) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETRESGID)operator(\)) operator(||) ident(defined)operator(()ident(HAVE_SETEGID)operator(\)) operator(||) ident(defined)operator(()ident(_POSIX_SAVED_IDS)operator(\)) -directive(static) ident(VALUE) -ident(p_gid_sw_ensure)operator(()ident(id)operator(\)) - pre_type(int) ident(id)operator(;) -operator({) - ident(under_gid_switch) operator(=) integer(0)operator(;) - reserved(return) ident(rb_setegid_core)operator(()ident(id)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * Process::GID.switch => fixnum - * Process::GID.switch {|| block} => object - * - * Switch the effective and real group IDs of the current process. If - * a block is given, the group IDs will be switched back - * after the block is executed. Returns the new effective group ID if - * called without a block, and the return value of the block if one - * is given. - * - */) - -directive(static) ident(VALUE) -ident(p_gid_switch)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(gid)operator(,) ident(egid)operator(;) - - ident(check_gid_switch)operator((\);) - - ident(gid) operator(=) ident(getgid)operator((\);) - ident(egid) operator(=) ident(getegid)operator((\);) - - reserved(if) operator(()ident(gid) operator(!=) ident(egid)operator(\)) operator({) - ident(proc_setegid)operator(()ident(obj)operator(,) ident(INT2FIX)operator(()ident(gid)operator(\)\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(under_gid_switch) operator(=) integer(1)operator(;) - reserved(return) ident(rb_ensure)operator(()ident(rb_yield)operator(,) ident(Qnil)operator(,) ident(p_gid_sw_ensure)operator(,) ident(SAVED_GROUP_ID)operator(\);) - operator(}) reserved(else) operator({) - reserved(return) ident(INT2FIX)operator(()ident(egid)operator(\);) - operator(}) - operator(}) reserved(else) reserved(if) operator(()ident(egid) operator(!=) ident(SAVED_GROUP_ID)operator(\)) operator({) - ident(proc_setegid)operator(()ident(obj)operator(,) ident(INT2FIX)operator(()ident(SAVED_GROUP_ID)operator(\)\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(under_gid_switch) operator(=) integer(1)operator(;) - reserved(return) ident(rb_ensure)operator(()ident(rb_yield)operator(,) ident(Qnil)operator(,) ident(p_gid_sw_ensure)operator(,) ident(egid)operator(\);) - operator(}) reserved(else) operator({) - reserved(return) ident(INT2FIX)operator(()ident(gid)operator(\);) - operator(}) - operator(}) reserved(else) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#else) -directive(static) ident(VALUE) -ident(p_gid_sw_ensure)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(under_gid_switch) operator(=) integer(0)operator(;) - reserved(return) ident(p_gid_exchange)operator(()ident(obj)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(p_gid_switch)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - pre_type(int) ident(gid)operator(,) ident(egid)operator(;) - - ident(check_gid_switch)operator((\);) - - ident(gid) operator(=) ident(getgid)operator((\);) - ident(egid) operator(=) ident(getegid)operator((\);) - - reserved(if) operator(()ident(gid) operator(==) ident(egid)operator(\)) operator({) - ident(errno) operator(=) ident(EPERM)operator(;) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - ident(p_gid_exchange)operator(()ident(obj)operator(\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(under_gid_switch) operator(=) integer(1)operator(;) - reserved(return) ident(rb_ensure)operator(()ident(rb_yield)operator(,) ident(Qnil)operator(,) ident(p_gid_sw_ensure)operator(,) ident(obj)operator(\);) - operator(}) reserved(else) operator({) - reserved(return) ident(INT2FIX)operator(()ident(egid)operator(\);) - operator(}) -preprocessor(#endif) -operator(}) - - -comment(/* - * call-seq: - * Process.times => aStructTms - * - * Returns a Tms structure (see Struct::Tms - * on page 388\) that contains user and system CPU times for this - * process. - * - * t = Process.times - * [ t.utime, t.stime ] #=> [0.0, 0.02] - */) - -ident(VALUE) -ident(rb_proc_times)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_TIMES)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CHECKER__)operator(\)) - directive(const) pre_type(double) ident(hertz) operator(=) -preprocessor(#ifdef) ident(HAVE__SC_CLK_TCK) - operator(()pre_type(double)operator(\))ident(sysconf)operator(()ident(_SC_CLK_TCK)operator(\);) -preprocessor(#else) -preprocessor(#ifndef) ident(HZ) -preprocessor(# ifdef) ident(CLK_TCK) -preprocessor(# define) ident(HZ) ident(CLK_TCK) -preprocessor(# else) -preprocessor(# define) ident(HZ) integer(60) -preprocessor(# endif) -preprocessor(#endif) comment(/* HZ */) - ident(HZ)operator(;) -preprocessor(#endif) - reserved(struct) ident(tms) ident(buf)operator(;) - directive(volatile) ident(VALUE) ident(utime)operator(,) ident(stime)operator(,) ident(cutime)operator(,) ident(sctime)operator(;) - - ident(times)operator((&)ident(buf)operator(\);) - reserved(return) ident(rb_struct_new)operator(()ident(S_Tms)operator(,) - ident(utime) operator(=) ident(rb_float_new)operator(()ident(buf)operator(.)ident(tms_utime) operator(/) ident(hertz)operator(\),) - ident(stime) operator(=) ident(rb_float_new)operator(()ident(buf)operator(.)ident(tms_stime) operator(/) ident(hertz)operator(\),) - ident(cutime) operator(=) ident(rb_float_new)operator(()ident(buf)operator(.)ident(tms_cutime) operator(/) ident(hertz)operator(\),) - ident(sctime) operator(=) ident(rb_float_new)operator(()ident(buf)operator(.)ident(tms_cstime) operator(/) ident(hertz)operator(\)\);) -preprocessor(#else) - ident(rb_notimplement)operator((\);) -preprocessor(#endif) -operator(}) - -ident(VALUE) ident(rb_mProcess)operator(;) -ident(VALUE) ident(rb_mProcUID)operator(;) -ident(VALUE) ident(rb_mProcGID)operator(;) -ident(VALUE) ident(rb_mProcID_Syscall)operator(;) - - -comment(/* - * The Process module is a collection of methods used to - * manipulate processes. - */) - -directive(void) -ident(Init_process)operator((\)) -operator({) - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(get_pid)operator(,) integer(0)operator(\);) - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(rb_last_status)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_exec)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_fork)operator(,) integer(0)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_exit_bang)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_system)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_sleep)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_mProcess) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - -preprocessor(#if) operator(!)ident(defined)operator(()ident(_WIN32)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(DJGPP)operator(\)) -preprocessor(#ifdef) ident(WNOHANG) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(WNOHANG)operator(\)\);) -preprocessor(#else) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()integer(0)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(WUNTRACED) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(WUNTRACED)operator(\)\);) -preprocessor(#else) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()integer(0)operator(\)\);) -preprocessor(#endif) -preprocessor(#endif) - - ident(rb_define_singleton_method)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(rb_f_fork)operator(,) integer(0)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(rb_f_exit_bang)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(rb_f_exit)operator(,) operator(-)integer(1)operator(\);) comment(/* in eval.c */) - ident(rb_define_singleton_method)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(rb_f_abort)operator(,) operator(-)integer(1)operator(\);) comment(/* in eval.c */) - - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(rb_f_kill)operator(,) operator(-)integer(1)operator(\);) comment(/* in signal.c */) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_wait)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_wait2)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_wait)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_wait2)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_waitall)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_detach)operator(,) integer(1)operator(\);) - - ident(rb_cProcStatus) operator(=) ident(rb_define_class_under)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cProcStatus)operator(\),) stringoperator(\);) - - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_bitand)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) string>)delimiter(")>operator(,) ident(pst_rshift)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_to_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_to_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_inspect)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_pid)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_wifstopped)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_wstopsig)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_wifsignaled)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_wtermsig)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_wifexited)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_wexitstatus)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_success_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cProcStatus)operator(,) stringoperator(,) ident(pst_wcoredump)operator(,) integer(0)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(get_pid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(get_ppid)operator(,) integer(0)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_getpgrp)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_setpgrp)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_getpgid)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_setpgid)operator(,) integer(2)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_setsid)operator(,) integer(0)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_getpriority)operator(,) integer(2)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_setpriority)operator(,) integer(3)operator(\);) - -preprocessor(#ifdef) ident(HAVE_GETPRIORITY) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(PRIO_PROCESS)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(PRIO_PGRP)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(PRIO_USER)operator(\)\);) -preprocessor(#endif) - - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_getrlimit)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_setrlimit)operator(,) operator(-)integer(1)operator(\);) -preprocessor(#ifdef) ident(RLIM2NUM) -preprocessor(#ifdef) ident(RLIM_INFINITY) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(RLIM2NUM)operator(()ident(RLIM_INFINITY)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIM_SAVED_MAX) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(RLIM2NUM)operator(()ident(RLIM_SAVED_MAX)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIM_SAVED_CUR) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(RLIM2NUM)operator(()ident(RLIM_SAVED_CUR)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIMIT_CORE) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RLIMIT_CORE)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIMIT_CPU) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RLIMIT_CPU)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIMIT_DATA) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RLIMIT_DATA)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIMIT_FSIZE) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RLIMIT_FSIZE)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIMIT_NOFILE) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RLIMIT_NOFILE)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIMIT_STACK) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RLIMIT_STACK)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIMIT_AS) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RLIMIT_AS)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIMIT_MEMLOCK) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RLIMIT_MEMLOCK)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIMIT_NPROC) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RLIMIT_NPROC)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIMIT_RSS) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RLIMIT_RSS)operator(\)\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(RLIMIT_SBSIZE) - ident(rb_define_const)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RLIMIT_SBSIZE)operator(\)\);) -preprocessor(#endif) -preprocessor(#endif) - - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_getuid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_setuid)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_getgid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_setgid)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_geteuid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_seteuid)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_getegid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_setegid)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_initgroups)operator(,) integer(2)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_getgroups)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_setgroups)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_getmaxgroups)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(proc_setmaxgroups)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcess)operator(,) stringoperator(,) ident(rb_proc_times)operator(,) integer(0)operator(\);) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_TIMES)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) - ident(S_Tms) operator(=) ident(rb_struct_define)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) pre_constant(NULL)operator(\);) -preprocessor(#endif) - - ident(SAVED_USER_ID) operator(=) ident(geteuid)operator((\);) - ident(SAVED_GROUP_ID) operator(=) ident(getegid)operator((\);) - - ident(rb_mProcUID) operator(=) ident(rb_define_module_under)operator(()ident(rb_mProcess)operator(,) stringoperator(\);) - ident(rb_mProcGID) operator(=) ident(rb_define_module_under)operator(()ident(rb_mProcess)operator(,) stringoperator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcUID)operator(,) stringoperator(,) ident(proc_getuid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcGID)operator(,) stringoperator(,) ident(proc_getgid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcUID)operator(,) stringoperator(,) ident(proc_geteuid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcGID)operator(,) stringoperator(,) ident(proc_getegid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcUID)operator(,) stringoperator(,) ident(p_uid_change_privilege)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcGID)operator(,) stringoperator(,) ident(p_gid_change_privilege)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcUID)operator(,) stringoperator(,) ident(p_uid_grant_privilege)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcGID)operator(,) stringoperator(,) ident(p_gid_grant_privilege)operator(,) integer(1)operator(\);) - ident(rb_define_alias)operator(()ident(rb_singleton_class)operator(()ident(rb_mProcUID)operator(\),) stringoperator(,) stringoperator(\);) - ident(rb_define_alias)operator(()ident(rb_singleton_class)operator(()ident(rb_mProcGID)operator(\),) stringoperator(,) stringoperator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcUID)operator(,) stringoperator(,) ident(p_uid_exchange)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcGID)operator(,) stringoperator(,) ident(p_gid_exchange)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcUID)operator(,) stringoperator(,) ident(p_uid_exchangeable)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcGID)operator(,) stringoperator(,) ident(p_gid_exchangeable)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcUID)operator(,) stringoperator(,) ident(p_uid_have_saved_id)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcGID)operator(,) stringoperator(,) ident(p_gid_have_saved_id)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcUID)operator(,) stringoperator(,) ident(p_uid_switch)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcGID)operator(,) stringoperator(,) ident(p_gid_switch)operator(,) integer(0)operator(\);) - - ident(rb_mProcID_Syscall) operator(=) ident(rb_define_module_under)operator(()ident(rb_mProcess)operator(,) stringoperator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(proc_getuid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(proc_geteuid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(proc_getgid)operator(,) integer(0)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(proc_getegid)operator(,) integer(0)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(p_sys_setuid)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(p_sys_setgid)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(p_sys_setruid)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(p_sys_setrgid)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(p_sys_seteuid)operator(,) integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(p_sys_setegid)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(p_sys_setreuid)operator(,) integer(2)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(p_sys_setregid)operator(,) integer(2)operator(\);) - - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(p_sys_setresuid)operator(,) integer(3)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(p_sys_setresgid)operator(,) integer(3)operator(\);) - ident(rb_define_module_function)operator(()ident(rb_mProcID_Syscall)operator(,) stringoperator(,) ident(p_sys_issetugid)operator(,) integer(0)operator(\);) -operator(}) -comment(/********************************************************************** - - random.c - - - $Author: shyouhei $ - $Date: 2009-01-17 04:15:36 +0100 (Sat, 17 Jan 2009\) $ - created at: Fri Dec 24 16:39:21 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -comment(/* -This is based on trimmed version of MT19937. To get the original version, -contact . - -The original copyright notice follows. - - A C-program for MT19937, with initialization improved 2002/2/10. - Coded by Takuji Nishimura and Makoto Matsumoto. - This is a faster version by taking Shawn Cokus's optimization, - Matthe Bellew's simplification, Isaku Wada's real version. - - Before using, initialize the state by using init_genrand(seed\) - or init_by_array(init_key, key_length\). - - Copyright (C\) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The names of its contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION\) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE\) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - Any feedback is very welcome. - http://www.math.keio.ac.jp/matumoto/emt.html - email: matumoto@math.keio.ac.jp -*/) - -comment(/* Period parameters */) -preprocessor(#define) ident(N) integer(624) -preprocessor(#define) ident(M) integer(397) -preprocessor(#define) ident(MATRIX_A) hex(0x9908b0df)ident(UL) comment(/* constant vector a */) -preprocessor(#define) ident(UMASK) hex(0x80000000)ident(UL) comment(/* most significant w-r bits */) -preprocessor(#define) ident(LMASK) hex(0x7fffffff)ident(UL) comment(/* least significant r bits */) -preprocessor(#define) ident(MIXBITS)operator(()ident(u)operator(,)ident(v)operator(\)) operator(() operator((()ident(u)operator(\)) operator(&) ident(UMASK)operator(\)) operator(|) operator((()ident(v)operator(\)) operator(&) ident(LMASK)operator(\)) operator(\)) -preprocessor(#define) ident(TWIST)operator(()ident(u)operator(,)ident(v)operator(\)) operator((()ident(MIXBITS)operator(()ident(u)operator(,)ident(v)operator(\)) operator(>>) integer(1)operator(\)) operator(^) operator((()ident(v)operator(\)&)integer(1)ident(UL) operator(?) ident(MATRIX_A) operator(:) integer(0)ident(UL)operator(\)\)) - -directive(static) pre_type(unsigned) pre_type(long) ident(state)operator([)ident(N)operator(];) comment(/* the array for the state vector */) -directive(static) pre_type(int) ident(left) operator(=) integer(1)operator(;) -directive(static) pre_type(int) ident(initf) operator(=) integer(0)operator(;) -directive(static) pre_type(unsigned) pre_type(long) operator(*)ident(next)operator(;) - -comment(/* initializes state[N] with a seed */) -directive(static) directive(void) -ident(init_genrand)operator(()ident(s)operator(\)) - pre_type(unsigned) pre_type(long) ident(s)operator(;) -operator({) - pre_type(int) ident(j)operator(;) - ident(state)operator([)integer(0)operator(]=) ident(s) operator(&) hex(0xffffffff)ident(UL)operator(;) - reserved(for) operator(()ident(j)operator(=)integer(1)operator(;) ident(j)operator(<)ident(N)operator(;) ident(j)operator(++\)) operator({) - ident(state)operator([)ident(j)operator(]) operator(=) operator(()integer(1812433253)ident(UL) operator(*) operator(()ident(state)operator([)ident(j)operator(-)integer(1)operator(]) operator(^) operator(()ident(state)operator([)ident(j)operator(-)integer(1)operator(]) operator(>>) integer(30)operator(\)\)) operator(+) ident(j)operator(\);) - comment(/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */) - comment(/* In the previous versions, MSBs of the seed affect */) - comment(/* only MSBs of the array state[]. */) - comment(/* 2002/01/09 modified by Makoto Matsumoto */) - ident(state)operator([)ident(j)operator(]) operator(&=) hex(0xffffffff)ident(UL)operator(;) comment(/* for >32 bit machines */) - operator(}) - ident(left) operator(=) integer(1)operator(;) ident(initf) operator(=) integer(1)operator(;) -operator(}) - -comment(/* initialize by an array with array-length */) -comment(/* init_key is the array for initializing keys */) -comment(/* key_length is its length */) -comment(/* slight change for C++, 2004/2/26 */) -directive(static) directive(void) -ident(init_by_array)operator(()pre_type(unsigned) pre_type(long) ident(init_key)operator([],) pre_type(int) ident(key_length)operator(\)) -operator({) - pre_type(int) ident(i)operator(,) ident(j)operator(,) ident(k)operator(;) - ident(init_genrand)operator(()integer(19650218)ident(UL)operator(\);) - ident(i)operator(=)integer(1)operator(;) ident(j)operator(=)integer(0)operator(;) - ident(k) operator(=) operator(()ident(N)operator(>)ident(key_length) operator(?) ident(N) operator(:) ident(key_length)operator(\);) - reserved(for) operator((;) ident(k)operator(;) ident(k)operator(--\)) operator({) - ident(state)operator([)ident(i)operator(]) operator(=) operator(()ident(state)operator([)ident(i)operator(]) operator(^) operator((()ident(state)operator([)ident(i)operator(-)integer(1)operator(]) operator(^) operator(()ident(state)operator([)ident(i)operator(-)integer(1)operator(]) operator(>>) integer(30)operator(\)\)) operator(*) integer(1664525)ident(UL)operator(\)\)) - operator(+) ident(init_key)operator([)ident(j)operator(]) operator(+) ident(j)operator(;) comment(/* non linear */) - ident(state)operator([)ident(i)operator(]) operator(&=) hex(0xffffffff)ident(UL)operator(;) comment(/* for WORDSIZE > 32 machines */) - ident(i)operator(++;) ident(j)operator(++;) - reserved(if) operator(()ident(i)operator(>=)ident(N)operator(\)) operator({) ident(state)operator([)integer(0)operator(]) operator(=) ident(state)operator([)ident(N)operator(-)integer(1)operator(];) ident(i)operator(=)integer(1)operator(;) operator(}) - reserved(if) operator(()ident(j)operator(>=)ident(key_length)operator(\)) ident(j)operator(=)integer(0)operator(;) - operator(}) - reserved(for) operator(()ident(k)operator(=)ident(N)operator(-)integer(1)operator(;) ident(k)operator(;) ident(k)operator(--\)) operator({) - ident(state)operator([)ident(i)operator(]) operator(=) operator(()ident(state)operator([)ident(i)operator(]) operator(^) operator((()ident(state)operator([)ident(i)operator(-)integer(1)operator(]) operator(^) operator(()ident(state)operator([)ident(i)operator(-)integer(1)operator(]) operator(>>) integer(30)operator(\)\)) operator(*) integer(1566083941)ident(UL)operator(\)\)) - operator(-) ident(i)operator(;) comment(/* non linear */) - ident(state)operator([)ident(i)operator(]) operator(&=) hex(0xffffffff)ident(UL)operator(;) comment(/* for WORDSIZE > 32 machines */) - ident(i)operator(++;) - reserved(if) operator(()ident(i)operator(>=)ident(N)operator(\)) operator({) ident(state)operator([)integer(0)operator(]) operator(=) ident(state)operator([)ident(N)operator(-)integer(1)operator(];) ident(i)operator(=)integer(1)operator(;) operator(}) - operator(}) - - ident(state)operator([)integer(0)operator(]) operator(=) hex(0x80000000)ident(UL)operator(;) comment(/* MSB is 1; assuring non-zero initial array */) - ident(left) operator(=) integer(1)operator(;) ident(initf) operator(=) integer(1)operator(;) -operator(}) - -directive(static) directive(void) -ident(next_state)operator((\)) -operator({) - pre_type(unsigned) pre_type(long) operator(*)ident(p)operator(=)ident(state)operator(;) - pre_type(int) ident(j)operator(;) - - comment(/* if init_genrand(\) has not been called, */) - comment(/* a default initial seed is used */) - reserved(if) operator(()ident(initf)operator(==)integer(0)operator(\)) ident(init_genrand)operator(()integer(5489)ident(UL)operator(\);) - - ident(left) operator(=) ident(N)operator(;) - ident(next) operator(=) ident(state)operator(;) - - reserved(for) operator(()ident(j)operator(=)ident(N)operator(-)ident(M)operator(+)integer(1)operator(;) operator(--)ident(j)operator(;) ident(p)operator(++\)) - operator(*)ident(p) operator(=) ident(p)operator([)ident(M)operator(]) operator(^) ident(TWIST)operator(()ident(p)operator([)integer(0)operator(],) ident(p)operator([)integer(1)operator(]\);) - - reserved(for) operator(()ident(j)operator(=)ident(M)operator(;) operator(--)ident(j)operator(;) ident(p)operator(++\)) - operator(*)ident(p) operator(=) ident(p)operator([)ident(M)operator(-)ident(N)operator(]) operator(^) ident(TWIST)operator(()ident(p)operator([)integer(0)operator(],) ident(p)operator([)integer(1)operator(]\);) - - operator(*)ident(p) operator(=) ident(p)operator([)ident(M)operator(-)ident(N)operator(]) operator(^) ident(TWIST)operator(()ident(p)operator([)integer(0)operator(],) ident(state)operator([)integer(0)operator(]\);) -operator(}) - -comment(/* generates a random number on [0,0xffffffff]-interval */) -directive(static) pre_type(unsigned) pre_type(long) -ident(genrand_int32)operator(()directive(void)operator(\)) -operator({) - pre_type(unsigned) pre_type(long) ident(y)operator(;) - - reserved(if) operator((--)ident(left) operator(==) integer(0)operator(\)) ident(next_state)operator((\);) - ident(y) operator(=) operator(*)ident(next)operator(++;) - - comment(/* Tempering */) - ident(y) operator(^=) operator(()ident(y) operator(>>) integer(11)operator(\);) - ident(y) operator(^=) operator(()ident(y) operator(<<) integer(7)operator(\)) operator(&) hex(0x9d2c5680)ident(UL)operator(;) - ident(y) operator(^=) operator(()ident(y) operator(<<) integer(15)operator(\)) operator(&) hex(0xefc60000)ident(UL)operator(;) - ident(y) operator(^=) operator(()ident(y) operator(>>) integer(18)operator(\);) - - reserved(return) ident(y)operator(;) -operator(}) - -comment(/* generates a random number on [0,1\) with 53-bit resolution*/) -directive(static) pre_type(double) -ident(genrand_real)operator(()directive(void)operator(\)) -operator({) - pre_type(unsigned) pre_type(long) ident(a)operator(=)ident(genrand_int32)operator((\)>>)integer(5)operator(,) ident(b)operator(=)ident(genrand_int32)operator((\)>>)integer(6)operator(;) - reserved(return)operator(()ident(a)operator(*)integer(6710886)float(4)float(.0)operator(+)ident(b)operator(\)*()float(1)float(.0)operator(/)integer(900719925474099)float(2)float(.0)operator(\);) -operator(}) -comment(/* These real versions are due to Isaku Wada, 2002/01/09 added */) - -preprocessor(#undef) ident(N) -preprocessor(#undef) ident(M) - -comment(/* These real versions are due to Isaku Wada, 2002/01/09 added */) - -preprocessor(#include) include("ruby.h") - -preprocessor(#ifdef) ident(HAVE_UNISTD_H) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#ifdef) ident(HAVE_FCNTL_H) -preprocessor(#include) include() -preprocessor(#endif) - -directive(static) ident(VALUE) ident(saved_seed) operator(=) ident(INT2FIX)operator(()integer(0)operator(\);) - -directive(static) ident(VALUE) -ident(rand_init)operator(()ident(vseed)operator(\)) - ident(VALUE) ident(vseed)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(seed)operator(;) - ident(VALUE) ident(old)operator(;) - pre_type(long) ident(len)operator(;) - pre_type(unsigned) pre_type(long) operator(*)ident(buf)operator(;) - - ident(seed) operator(=) ident(rb_to_int)operator(()ident(vseed)operator(\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(seed)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(len) operator(=) reserved(sizeof)operator(()ident(VALUE)operator(\);) - reserved(break)operator(;) - reserved(case) ident(T_BIGNUM)operator(:) - ident(len) operator(=) ident(RBIGNUM)operator(()ident(seed)operator(\)->)ident(len) operator(*) ident(SIZEOF_BDIGITS)operator(;) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) - ident(len) operator(=) integer(4)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(vseed)operator(\)\);) - operator(}) - ident(len) operator(=) operator(()ident(len) operator(+) integer(3)operator(\)) operator(/) integer(4)operator(;) comment(/* number of 32bit words */) - ident(buf) operator(=) ident(ALLOC_N)operator(()pre_type(unsigned) pre_type(long)operator(,) ident(len)operator(\);) comment(/* allocate longs for init_by_array */) - ident(memset)operator(()ident(buf)operator(,) integer(0)operator(,) ident(len) operator(*) reserved(sizeof)operator(()pre_type(long)operator(\)\);) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(seed)operator(\)\)) operator({) - ident(buf)operator([)integer(0)operator(]) operator(=) ident(FIX2ULONG)operator(()ident(seed)operator(\)) operator(&) hex(0xffffffff)operator(;) -preprocessor(#if) ident(SIZEOF_LONG) operator(>) integer(4) - ident(buf)operator([)integer(1)operator(]) operator(=) ident(FIX2ULONG)operator(()ident(seed)operator(\)) operator(>>) integer(32)operator(;) -preprocessor(#endif) - operator(}) - reserved(else) operator({) - pre_type(int) ident(i)operator(,) ident(j)operator(;) - reserved(for) operator(()ident(i) operator(=) ident(RBIGNUM)operator(()ident(seed)operator(\)->)ident(len)operator(-)integer(1)operator(;) integer(0) operator(<=) ident(i)operator(;) ident(i)operator(--\)) operator({) - ident(j) operator(=) ident(i) operator(*) ident(SIZEOF_BDIGITS) operator(/) integer(4)operator(;) -preprocessor(#if) ident(SIZEOF_BDIGITS) operator(<) integer(4) - ident(buf)operator([)ident(j)operator(]) operator(<<=) ident(SIZEOF_BDIGITS) operator(*) integer(8)operator(;) -preprocessor(#endif) - ident(buf)operator([)ident(j)operator(]) operator(|=) operator((()ident(BDIGIT) operator(*\))ident(RBIGNUM)operator(()ident(seed)operator(\)->)ident(digits)operator(\)[)ident(i)operator(];) - operator(}) - operator(}) - reserved(while) operator(()integer(1) operator(<) ident(len) operator(&&) ident(buf)operator([)ident(len)operator(-)integer(1)operator(]) operator(==) integer(0)operator(\)) operator({) - ident(len)operator(--;) - operator(}) - reserved(if) operator(()ident(len) operator(<=) integer(1)operator(\)) operator({) - ident(init_genrand)operator(()ident(buf)operator([)integer(0)operator(]\);) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(buf)operator([)ident(len)operator(-)integer(1)operator(]) operator(==) integer(1)operator(\)) comment(/* remove leading-zero-guard */) - ident(len)operator(--;) - ident(init_by_array)operator(()ident(buf)operator(,) ident(len)operator(\);) - operator(}) - ident(old) operator(=) ident(saved_seed)operator(;) - ident(saved_seed) operator(=) ident(seed)operator(;) - ident(free)operator(()ident(buf)operator(\);) - reserved(return) ident(old)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(random_seed)operator((\)) -operator({) - directive(static) pre_type(int) ident(n) operator(=) integer(0)operator(;) - reserved(struct) ident(timeval) ident(tv)operator(;) - pre_type(int) ident(fd)operator(;) - reserved(struct) ident(stat) ident(statbuf)operator(;) - - pre_type(int) ident(seed_len)operator(;) - ident(BDIGIT) operator(*)ident(digits)operator(;) - pre_type(unsigned) pre_type(long) operator(*)ident(seed)operator(;) - ident(NEWOBJ)operator(()ident(big)operator(,) reserved(struct) ident(RBignum)operator(\);) - ident(OBJSETUP)operator(()ident(big)operator(,) ident(rb_cBignum)operator(,) ident(T_BIGNUM)operator(\);) - - ident(seed_len) operator(=) integer(4) operator(*) reserved(sizeof)operator(()pre_type(long)operator(\);) - ident(big)operator(->)ident(sign) operator(=) integer(1)operator(;) - ident(big)operator(->)ident(len) operator(=) ident(seed_len) operator(/) ident(SIZEOF_BDIGITS) operator(+) integer(1)operator(;) - ident(digits) operator(=) ident(big)operator(->)ident(digits) operator(=) ident(ALLOC_N)operator(()ident(BDIGIT)operator(,) ident(big)operator(->)ident(len)operator(\);) - ident(seed) operator(=) operator(()pre_type(unsigned) pre_type(long) operator(*\))ident(big)operator(->)ident(digits)operator(;) - - ident(memset)operator(()ident(digits)operator(,) integer(0)operator(,) ident(big)operator(->)ident(len) operator(*) ident(SIZEOF_BDIGITS)operator(\);) - -preprocessor(#ifdef) ident(S_ISCHR) - reserved(if) operator((()ident(fd) operator(=) ident(open)operator(()stringoperator(,) ident(O_RDONLY) -preprocessor(#ifdef) ident(O_NONBLOCK) - operator(|)ident(O_NONBLOCK) -preprocessor(#endif) -preprocessor(#ifdef) ident(O_NOCTTY) - operator(|)ident(O_NOCTTY) -preprocessor(#endif) -preprocessor(#ifdef) ident(O_NOFOLLOW) - operator(|)ident(O_NOFOLLOW) -preprocessor(#endif) - operator(\)\)) operator(>=) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(fstat)operator(()ident(fd)operator(,) operator(&)ident(statbuf)operator(\)) operator(==) integer(0) operator(&&) ident(S_ISCHR)operator(()ident(statbuf)operator(.)ident(st_mode)operator(\)\)) operator({) - ident(read)operator(()ident(fd)operator(,) ident(seed)operator(,) ident(seed_len)operator(\);) - operator(}) - ident(close)operator(()ident(fd)operator(\);) - operator(}) -preprocessor(#endif) - - ident(gettimeofday)operator((&)ident(tv)operator(,) integer(0)operator(\);) - ident(seed)operator([)integer(0)operator(]) operator(^=) ident(tv)operator(.)ident(tv_usec)operator(;) - ident(seed)operator([)integer(1)operator(]) operator(^=) ident(tv)operator(.)ident(tv_sec)operator(;) - ident(seed)operator([)integer(2)operator(]) operator(^=) ident(getpid)operator((\)) operator(^) operator(()ident(n)operator(++) operator(<<) integer(16)operator(\);) - ident(seed)operator([)integer(3)operator(]) operator(^=) operator(()pre_type(unsigned) pre_type(long)operator(\)&)ident(seed)operator(;) - - comment(/* set leading-zero-guard if need. */) - ident(digits)operator([)ident(big)operator(->)ident(len)operator(-)integer(1)operator(]) operator(=) ident(digits)operator([)ident(big)operator(->)ident(len)operator(-)integer(2)operator(]) operator(<=) integer(1) operator(?) integer(1) operator(:) integer(0)operator(;) - - reserved(return) ident(rb_big_norm)operator((()ident(VALUE)operator(\))ident(big)operator(\);) -operator(}) - -comment(/* - * call-seq: - * srand(number=0\) => old_seed - * - * Seeds the pseudorandom number generator to the value of - * number.to_i.abs. If number is omitted, - * seeds the generator using a combination of the time, the - * process id, and a sequence number. (This is also the behavior if - * Kernel::rand is called without previously calling - * srand, but without the sequence.\) By setting the seed - * to a known value, scripts can be made deterministic during testing. - * The previous seed value is returned. Also see Kernel::rand. - */) - -directive(static) ident(VALUE) -ident(rb_f_srand)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(seed)operator(,) ident(old)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(seed)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(seed) operator(=) ident(random_seed)operator((\);) - operator(}) - ident(old) operator(=) ident(rand_init)operator(()ident(seed)operator(\);) - - reserved(return) ident(old)operator(;) -operator(}) - -directive(static) pre_type(unsigned) pre_type(long) -ident(make_mask)operator(()pre_type(unsigned) pre_type(long) ident(x)operator(\)) -operator({) - ident(x) operator(=) ident(x) operator(|) ident(x) operator(>>) integer(1)operator(;) - ident(x) operator(=) ident(x) operator(|) ident(x) operator(>>) integer(2)operator(;) - ident(x) operator(=) ident(x) operator(|) ident(x) operator(>>) integer(4)operator(;) - ident(x) operator(=) ident(x) operator(|) ident(x) operator(>>) integer(8)operator(;) - ident(x) operator(=) ident(x) operator(|) ident(x) operator(>>) integer(16)operator(;) -preprocessor(#if) integer(4) operator(<) ident(SIZEOF_LONG) - ident(x) operator(=) ident(x) operator(|) ident(x) operator(>>) integer(32)operator(;) -preprocessor(#endif) - reserved(return) ident(x)operator(;) -operator(}) - -directive(static) pre_type(unsigned) pre_type(long) -ident(limited_rand)operator(()pre_type(unsigned) pre_type(long) ident(limit)operator(\)) -operator({) - pre_type(unsigned) pre_type(long) ident(mask) operator(=) ident(make_mask)operator(()ident(limit)operator(\);) - pre_type(int) ident(i)operator(;) - pre_type(unsigned) pre_type(long) ident(val)operator(;) - - label(retry:) - ident(val) operator(=) integer(0)operator(;) - reserved(for) operator(()ident(i) operator(=) ident(SIZEOF_LONG)operator(/)integer(4)operator(-)integer(1)operator(;) integer(0) operator(<=) ident(i)operator(;) ident(i)operator(--\)) operator({) - reserved(if) operator(()ident(mask) operator(>>) operator(()ident(i) operator(*) integer(32)operator(\)\)) operator({) - ident(val) operator(|=) ident(genrand_int32)operator((\)) operator(<<) operator(()ident(i) operator(*) integer(32)operator(\);) - ident(val) operator(&=) ident(mask)operator(;) - reserved(if) operator(()ident(limit) operator(<) ident(val)operator(\)) - reserved(goto) ident(retry)operator(;) - operator(}) - operator(}) - reserved(return) ident(val)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(limited_big_rand)operator(()reserved(struct) ident(RBignum) operator(*)ident(limit)operator(\)) -operator({) - pre_type(unsigned) pre_type(long) ident(mask)operator(,) ident(lim)operator(,) ident(rnd)operator(;) - reserved(struct) ident(RBignum) operator(*)ident(val)operator(;) - pre_type(int) ident(i)operator(,) ident(len)operator(,) ident(boundary)operator(;) - - ident(len) operator(=) operator(()ident(limit)operator(->)ident(len) operator(*) ident(SIZEOF_BDIGITS) operator(+) integer(3)operator(\)) operator(/) integer(4)operator(;) - ident(val) operator(=) operator(()reserved(struct) ident(RBignum) operator(*\))ident(rb_big_clone)operator((()ident(VALUE)operator(\))ident(limit)operator(\);) - ident(val)operator(->)ident(sign) operator(=) integer(1)operator(;) -preprocessor(#if) ident(SIZEOF_BDIGITS) operator(==) integer(2) -preprocessor(# define) ident(BIG_GET32)operator(()ident(big)operator(,)ident(i)operator(\)) operator(((()ident(BDIGIT) operator(*\)()ident(big)operator(\)->)ident(digits)operator(\)[()ident(i)operator(\)*)integer(2)operator(]) operator(|) \ - operator((()ident(i)operator(\)*)integer(2)operator(+)integer(1) operator(<) operator(()ident(big)operator(\)->)ident(len) operator(?) operator(((()ident(BDIGIT) operator(*\)()ident(big)operator(\)->)ident(digits)operator(\)[()ident(i)operator(\)*)integer(2)operator(+)integer(1)operator(]) operator(<<) integer(16)operator(\)) \ - operator(:) integer(0)operator(\)\)) -preprocessor(# define) ident(BIG_SET32)operator(()ident(big)operator(,)ident(i)operator(,)ident(d)operator(\)) operator((((()ident(BDIGIT) operator(*\)()ident(big)operator(\)->)ident(digits)operator(\)[()ident(i)operator(\)*)integer(2)operator(]) operator(=) operator(()ident(d)operator(\)) operator(&) hex(0xffff)operator(\),) \ - operator((()ident(i)operator(\)*)integer(2)operator(+)integer(1) operator(<) operator(()ident(big)operator(\)->)ident(len) operator(?) operator(((()ident(BDIGIT) operator(*\)()ident(big)operator(\)->)ident(digits)operator(\)[()ident(i)operator(\)*)integer(2)operator(+)integer(1)operator(]) operator(=) operator(()ident(d)operator(\)) operator(>>) integer(16)operator(\)) \ - operator(:) integer(0)operator(\)\)) -preprocessor(#else) - comment(/* SIZEOF_BDIGITS == 4 */) -preprocessor(# define) ident(BIG_GET32)operator(()ident(big)operator(,)ident(i)operator(\)) operator(((()ident(BDIGIT) operator(*\)()ident(big)operator(\)->)ident(digits)operator(\)[)ident(i)operator(]\)) -preprocessor(# define) ident(BIG_SET32)operator(()ident(big)operator(,)ident(i)operator(,)ident(d)operator(\)) operator(((()ident(BDIGIT) operator(*\)()ident(big)operator(\)->)ident(digits)operator(\)[)ident(i)operator(]) operator(=) operator(()ident(d)operator(\)\)) -preprocessor(#endif) - label(retry:) - ident(mask) operator(=) integer(0)operator(;) - ident(boundary) operator(=) integer(1)operator(;) - reserved(for) operator(()ident(i) operator(=) ident(len)operator(-)integer(1)operator(;) integer(0) operator(<=) ident(i)operator(;) ident(i)operator(--\)) operator({) - ident(lim) operator(=) ident(BIG_GET32)operator(()ident(limit)operator(,) ident(i)operator(\);) - ident(mask) operator(=) ident(mask) operator(?) hex(0xffffffff) operator(:) ident(make_mask)operator(()ident(lim)operator(\);) - reserved(if) operator(()ident(mask)operator(\)) operator({) - ident(rnd) operator(=) ident(genrand_int32)operator((\)) operator(&) ident(mask)operator(;) - reserved(if) operator(()ident(boundary)operator(\)) operator({) - reserved(if) operator(()ident(lim) operator(<) ident(rnd)operator(\)) - reserved(goto) ident(retry)operator(;) - reserved(if) operator(()ident(rnd) operator(<) ident(lim)operator(\)) - ident(boundary) operator(=) integer(0)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(rnd) operator(=) integer(0)operator(;) - operator(}) - ident(BIG_SET32)operator(()ident(val)operator(,) ident(i)operator(,) ident(rnd)operator(\);) - operator(}) - reserved(return) ident(rb_big_norm)operator((()ident(VALUE)operator(\))ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * rand(max=0\) => number - * - * Converts max to an integer using max1 = - * max.to_i.abs. If the result is zero, returns a - * pseudorandom floating point number greater than or equal to 0.0 and - * less than 1.0. Otherwise, returns a pseudorandom integer greater - * than or equal to zero and less than max1. Kernel::srand - * may be used to ensure repeatable sequences of random numbers between - * different runs of the program. Ruby currently uses a modified - * Mersenne Twister with a period of 2**19937-1. - * - * srand 1234 #=> 0 - * [ rand, rand ] #=> [0.191519450163469, 0.49766366626136] - * [ rand(10\), rand(1000\) ] #=> [6, 817] - * srand 1234 #=> 1234 - * [ rand, rand ] #=> [0.191519450163469, 0.49766366626136] - */) - -directive(static) ident(VALUE) -ident(rb_f_rand)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(obj)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(vmax)operator(;) - pre_type(long) ident(val)operator(,) ident(max)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(vmax)operator(\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(vmax)operator(\)\)) operator({) - reserved(case) ident(T_FLOAT)operator(:) - reserved(if) operator(()ident(RFLOAT)operator(()ident(vmax)operator(\)->)ident(value) operator(<=) ident(LONG_MAX) operator(&&) ident(RFLOAT)operator(()ident(vmax)operator(\)->)ident(value) operator(>=) ident(LONG_MIN)operator(\)) operator({) - ident(max) operator(=) operator(()pre_type(long)operator(\))ident(RFLOAT)operator(()ident(vmax)operator(\)->)ident(value)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(RFLOAT)operator(()ident(vmax)operator(\)->)ident(value) operator(<) integer(0)operator(\)) - ident(vmax) operator(=) ident(rb_dbl2big)operator((-)ident(RFLOAT)operator(()ident(vmax)operator(\)->)ident(value)operator(\);) - reserved(else) - ident(vmax) operator(=) ident(rb_dbl2big)operator(()ident(RFLOAT)operator(()ident(vmax)operator(\)->)ident(value)operator(\);) - comment(/* fall through */) - reserved(case) ident(T_BIGNUM)operator(:) - label(bignum:) - operator({) - reserved(struct) ident(RBignum) operator(*)ident(limit) operator(=) operator(()reserved(struct) ident(RBignum) operator(*\))ident(vmax)operator(;) - reserved(if) operator((!)ident(limit)operator(->)ident(sign)operator(\)) operator({) - ident(limit) operator(=) operator(()reserved(struct) ident(RBignum) operator(*\))ident(rb_big_clone)operator(()ident(vmax)operator(\);) - ident(limit)operator(->)ident(sign) operator(=) integer(1)operator(;) - operator(}) - ident(limit) operator(=) operator(()reserved(struct) ident(RBignum) operator(*\))ident(rb_big_minus)operator((()ident(VALUE)operator(\))ident(limit)operator(,) ident(INT2FIX)operator(()integer(1)operator(\)\);) - reserved(if) operator(()ident(FIXNUM_P)operator((()ident(VALUE)operator(\))ident(limit)operator(\)\)) operator({) - reserved(if) operator(()ident(FIX2LONG)operator((()ident(VALUE)operator(\))ident(limit)operator(\)) operator(==) operator(-)integer(1)operator(\)) - reserved(return) ident(rb_float_new)operator(()ident(genrand_real)operator((\)\);) - reserved(return) ident(LONG2NUM)operator(()ident(limited_rand)operator(()ident(FIX2LONG)operator((()ident(VALUE)operator(\))ident(limit)operator(\)\)\);) - operator(}) - reserved(return) ident(limited_big_rand)operator(()ident(limit)operator(\);) - operator(}) - reserved(case) ident(T_NIL)operator(:) - ident(max) operator(=) integer(0)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(vmax) operator(=) ident(rb_Integer)operator(()ident(vmax)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(vmax)operator(\)) operator(==) ident(T_BIGNUM)operator(\)) reserved(goto) ident(bignum)operator(;) - comment(/* fall through */) - reserved(case) ident(T_FIXNUM)operator(:) - ident(max) operator(=) ident(FIX2LONG)operator(()ident(vmax)operator(\);) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(()ident(max) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(rb_float_new)operator(()ident(genrand_real)operator((\)\);) - operator(}) - reserved(if) operator(()ident(max) operator(<) integer(0)operator(\)) ident(max) operator(=) operator(-)ident(max)operator(;) - ident(val) operator(=) ident(limited_rand)operator(()ident(max)operator(-)integer(1)operator(\);) - reserved(return) ident(LONG2NUM)operator(()ident(val)operator(\);) -operator(}) - -directive(void) -ident(Init_Random)operator((\)) -operator({) - ident(rand_init)operator(()ident(random_seed)operator((\)\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_srand)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_rand)operator(,) operator(-)integer(1)operator(\);) - ident(rb_global_variable)operator((&)ident(saved_seed)operator(\);) -operator(}) -comment(/********************************************************************** - - range.c - - - $Author: shyouhei $ - $Date: 2007-09-16 21:38:27 +0200 (Sun, 16 Sep 2007\) $ - created at: Thu Aug 19 17:46:47 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") - -ident(VALUE) ident(rb_cRange)operator(;) -directive(static) ident(ID) ident(id_cmp)operator(,) ident(id_succ)operator(,) ident(id_beg)operator(,) ident(id_end)operator(,) ident(id_excl)operator(;) - -preprocessor(#define) ident(EXCL)operator(()ident(r)operator(\)) ident(RTEST)operator(()ident(rb_ivar_get)operator((()ident(r)operator(\),) ident(id_excl)operator(\)\)) -preprocessor(#define) ident(SET_EXCL)operator(()ident(r)operator(,)ident(v)operator(\)) ident(rb_ivar_set)operator((()ident(r)operator(\),) ident(id_excl)operator(,) operator(()ident(v)operator(\)) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(\)) - -directive(static) ident(VALUE) -ident(range_failed)operator((\)) -operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(return) ident(Qnil)operator(;) comment(/* dummy */) -operator(}) - -directive(static) ident(VALUE) -ident(range_check)operator(()ident(args)operator(\)) - ident(VALUE) operator(*)ident(args)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(args)operator([)integer(0)operator(],) ident(id_cmp)operator(,) integer(1)operator(,) ident(args)operator([)integer(1)operator(]\);) -operator(}) - -directive(static) directive(void) -ident(range_init)operator(()ident(range)operator(,) ident(beg)operator(,) ident(end)operator(,) ident(exclude_end)operator(\)) - ident(VALUE) ident(range)operator(,) ident(beg)operator(,) ident(end)operator(;) - pre_type(int) ident(exclude_end)operator(;) -operator({) - ident(VALUE) ident(args)operator([)integer(2)operator(];) - - ident(args)operator([)integer(0)operator(]) operator(=) ident(beg)operator(;) - ident(args)operator([)integer(1)operator(]) operator(=) ident(end)operator(;) - - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(beg)operator(\)) operator(||) operator(!)ident(FIXNUM_P)operator(()ident(end)operator(\)\)) operator({) - ident(VALUE) ident(v)operator(;) - - ident(v) operator(=) ident(rb_rescue)operator(()ident(range_check)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(,) ident(range_failed)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(v)operator(\)\)) ident(range_failed)operator((\);) - operator(}) - - ident(SET_EXCL)operator(()ident(range)operator(,) ident(exclude_end)operator(\);) - ident(rb_ivar_set)operator(()ident(range)operator(,) ident(id_beg)operator(,) ident(beg)operator(\);) - ident(rb_ivar_set)operator(()ident(range)operator(,) ident(id_end)operator(,) ident(end)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_range_new)operator(()ident(beg)operator(,) ident(end)operator(,) ident(exclude_end)operator(\)) - ident(VALUE) ident(beg)operator(,) ident(end)operator(;) - pre_type(int) ident(exclude_end)operator(;) -operator({) - ident(VALUE) ident(range) operator(=) ident(rb_obj_alloc)operator(()ident(rb_cRange)operator(\);) - - ident(range_init)operator(()ident(range)operator(,) ident(beg)operator(,) ident(end)operator(,) ident(exclude_end)operator(\);) - reserved(return) ident(range)operator(;) -operator(}) - -comment(/* - * call-seq: - * Range.new(start, end, exclusive=false\) => range - * - * Constructs a range using the given start and end. If the third - * parameter is omitted or is false, the range will include - * the end object; otherwise, it will be excluded. - */) - -directive(static) ident(VALUE) -ident(range_initialize)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(range)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(range)operator(;) -operator({) - ident(VALUE) ident(beg)operator(,) ident(end)operator(,) ident(flags)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(beg)operator(,) operator(&)ident(end)operator(,) operator(&)ident(flags)operator(\);) - comment(/* Ranges are immutable, so that they should be initialized only once. */) - reserved(if) operator(()ident(rb_ivar_defined)operator(()ident(range)operator(,) ident(id_beg)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(rb_intern)operator(()stringoperator(\),) stringoperator(\);) - operator(}) - ident(range_init)operator(()ident(range)operator(,) ident(beg)operator(,) ident(end)operator(,) ident(RTEST)operator(()ident(flags)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * rng.exclude_end? => true or false - * - * Returns true if rng excludes its end value. - */) - -directive(static) ident(VALUE) -ident(range_exclude_end_p)operator(()ident(range)operator(\)) - ident(VALUE) ident(range)operator(;) -operator({) - reserved(return) ident(EXCL)operator(()ident(range)operator(\)) operator(?) ident(Qtrue) operator(:) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * rng == obj => true or false - * - * Returns true only if obj is a Range, has equivalent - * beginning and end items (by comparing them with ==\), and has - * the same #exclude_end? setting as rng. - * - * (0..2\) == (0..2\) #=> true - * (0..2\) == Range.new(0,2\) #=> true - * (0..2\) == (0...2\) #=> false - * - */) - -directive(static) ident(VALUE) -ident(range_eq)operator(()ident(range)operator(,) ident(obj)operator(\)) - ident(VALUE) ident(range)operator(,) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(range) operator(==) ident(obj)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator((!)ident(rb_obj_is_instance_of)operator(()ident(obj)operator(,) ident(rb_obj_class)operator(()ident(range)operator(\)\)\)) - reserved(return) ident(Qfalse)operator(;) - - reserved(if) operator((!)ident(rb_equal)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_beg)operator(\),) ident(rb_ivar_get)operator(()ident(obj)operator(,) ident(id_beg)operator(\)\)\)) - reserved(return) ident(Qfalse)operator(;) - reserved(if) operator((!)ident(rb_equal)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_end)operator(\),) ident(rb_ivar_get)operator(()ident(obj)operator(,) ident(id_end)operator(\)\)\)) - reserved(return) ident(Qfalse)operator(;) - - reserved(if) operator(()ident(EXCL)operator(()ident(range)operator(\)) operator(!=) ident(EXCL)operator(()ident(obj)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - - reserved(return) ident(Qtrue)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(r_lt)operator(()ident(a)operator(,) ident(b)operator(\)) - ident(VALUE) ident(a)operator(,) ident(b)operator(;) -operator({) - ident(VALUE) ident(r) operator(=) ident(rb_funcall)operator(()ident(a)operator(,) ident(id_cmp)operator(,) integer(1)operator(,) ident(b)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(r)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(rb_cmpint)operator(()ident(r)operator(,) ident(a)operator(,) ident(b)operator(\)) operator(<) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(r_le)operator(()ident(a)operator(,) ident(b)operator(\)) - ident(VALUE) ident(a)operator(,) ident(b)operator(;) -operator({) - pre_type(int) ident(c)operator(;) - ident(VALUE) ident(r) operator(=) ident(rb_funcall)operator(()ident(a)operator(,) ident(id_cmp)operator(,) integer(1)operator(,) ident(b)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(r)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - ident(c) operator(=) ident(rb_cmpint)operator(()ident(r)operator(,) ident(a)operator(,) ident(b)operator(\);) - reserved(if) operator(()ident(c) operator(==) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(c) operator(<) integer(0)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * rng.eql?(obj\) => true or false - * - * Returns true only if obj is a Range, has equivalent - * beginning and end items (by comparing them with #eql?\), and has the same - * #exclude_end? setting as rng. - * - * (0..2\) == (0..2\) #=> true - * (0..2\) == Range.new(0,2\) #=> true - * (0..2\) == (0...2\) #=> false - * - */) - -directive(static) ident(VALUE) -ident(range_eql)operator(()ident(range)operator(,) ident(obj)operator(\)) - ident(VALUE) ident(range)operator(,) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(range) operator(==) ident(obj)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator((!)ident(rb_obj_is_instance_of)operator(()ident(obj)operator(,) ident(rb_obj_class)operator(()ident(range)operator(\)\)\)) - reserved(return) ident(Qfalse)operator(;) - - reserved(if) operator((!)ident(rb_eql)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_beg)operator(\),) ident(rb_ivar_get)operator(()ident(obj)operator(,) ident(id_beg)operator(\)\)\)) - reserved(return) ident(Qfalse)operator(;) - reserved(if) operator((!)ident(rb_eql)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_end)operator(\),) ident(rb_ivar_get)operator(()ident(obj)operator(,) ident(id_end)operator(\)\)\)) - reserved(return) ident(Qfalse)operator(;) - - reserved(if) operator(()ident(EXCL)operator(()ident(range)operator(\)) operator(!=) ident(EXCL)operator(()ident(obj)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * rng.hash => fixnum - * - * Generate a hash value such that two ranges with the same start and - * end points, and the same value for the "exclude end" flag, generate - * the same hash value. - */) - -directive(static) ident(VALUE) -ident(range_hash)operator(()ident(range)operator(\)) - ident(VALUE) ident(range)operator(;) -operator({) - pre_type(long) ident(hash) operator(=) ident(EXCL)operator(()ident(range)operator(\);) - ident(VALUE) ident(v)operator(;) - - ident(v) operator(=) ident(rb_hash)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_beg)operator(\)\);) - ident(hash) operator(^=) ident(v) operator(<<) integer(1)operator(;) - ident(v) operator(=) ident(rb_hash)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_end)operator(\)\);) - ident(hash) operator(^=) ident(v) operator(<<) integer(9)operator(;) - ident(hash) operator(^=) ident(EXCL)operator(()ident(range)operator(\)) operator(<<) integer(24)operator(;) - - reserved(return) ident(LONG2FIX)operator(()ident(hash)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(str_step)operator(()ident(args)operator(\)) - ident(VALUE) operator(*)ident(args)operator(;) -operator({) - reserved(return) ident(rb_str_upto)operator(()ident(args)operator([)integer(0)operator(],) ident(args)operator([)integer(1)operator(],) ident(EXCL)operator(()ident(args)operator([)integer(2)operator(]\)\);) -operator(}) - -directive(static) directive(void) -ident(range_each_func)operator(()ident(range)operator(,) ident(func)operator(,) ident(v)operator(,) ident(e)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(range)operator(;) - directive(void) operator((*)ident(func)operator(\)) ident(_)operator((()ident(VALUE)operator(,) directive(void)operator(*\)\);) - ident(VALUE) ident(v)operator(,) ident(e)operator(;) - directive(void) operator(*)ident(arg)operator(;) -operator({) - pre_type(int) ident(c)operator(;) - - reserved(if) operator(()ident(EXCL)operator(()ident(range)operator(\)\)) operator({) - reserved(while) operator(()ident(r_lt)operator(()ident(v)operator(,) ident(e)operator(\)\)) operator({) - operator((*)ident(func)operator(\)()ident(v)operator(,) ident(arg)operator(\);) - ident(v) operator(=) ident(rb_funcall)operator(()ident(v)operator(,) ident(id_succ)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - reserved(while) operator(()ident(RTEST)operator(()ident(c) operator(=) ident(r_le)operator(()ident(v)operator(,) ident(e)operator(\)\)\)) operator({) - operator((*)ident(func)operator(\)()ident(v)operator(,) ident(arg)operator(\);) - reserved(if) operator(()ident(c) operator(==) ident(INT2FIX)operator(()integer(0)operator(\)\)) reserved(break)operator(;) - ident(v) operator(=) ident(rb_funcall)operator(()ident(v)operator(,) ident(id_succ)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(step_i)operator(()ident(i)operator(,) ident(iter)operator(\)) - ident(VALUE) ident(i)operator(;) - pre_type(long) operator(*)ident(iter)operator(;) -operator({) - ident(iter)operator([)integer(0)operator(]--;) - reserved(if) operator(()ident(iter)operator([)integer(0)operator(]) operator(==) integer(0)operator(\)) operator({) - ident(rb_yield)operator(()ident(i)operator(\);) - ident(iter)operator([)integer(0)operator(]) operator(=) ident(iter)operator([)integer(1)operator(];) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * rng.step(n=1\) {| obj | block } => rng - * - * Iterates over rng, passing each nth element to the block. If - * the range contains numbers or strings, natural ordering is used. Otherwise - * step invokes succ to iterate through range - * elements. The following code uses class Xs, which is defined - * in the class-level documentation. - * - * range = Xs.new(1\)..Xs.new(10\) - * range.step(2\) {|x| puts x} - * range.step(3\) {|x| puts x} - * - * produces: - * - * 1 x - * 3 xxx - * 5 xxxxx - * 7 xxxxxxx - * 9 xxxxxxxxx - * 1 x - * 4 xxxx - * 7 xxxxxxx - * 10 xxxxxxxxxx - */) - - -directive(static) ident(VALUE) -ident(range_step)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(range)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(range)operator(;) -operator({) - ident(VALUE) ident(b)operator(,) ident(e)operator(,) ident(step)operator(;) - pre_type(long) ident(unit)operator(;) - - ident(b) operator(=) ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_beg)operator(\);) - ident(e) operator(=) ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_end)operator(\);) - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(step)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(step) operator(=) ident(INT2FIX)operator(()integer(1)operator(\);) - operator(}) - - ident(unit) operator(=) ident(NUM2LONG)operator(()ident(step)operator(\);) - reserved(if) operator(()ident(unit) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(b)operator(\)) operator(&&) ident(FIXNUM_P)operator(()ident(e)operator(\)\)) operator({) comment(/* fixnums are special */) - pre_type(long) ident(end) operator(=) ident(FIX2LONG)operator(()ident(e)operator(\);) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(unit) operator(==) integer(0)operator(\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(if) operator((!)ident(EXCL)operator(()ident(range)operator(\)\)) ident(end) operator(+=) integer(1)operator(;) - ident(i) operator(=) ident(FIX2LONG)operator(()ident(b)operator(\);) - reserved(while) operator(()ident(i) operator(<) ident(end)operator(\)) operator({) - ident(rb_yield)operator(()ident(LONG2NUM)operator(()ident(i)operator(\)\);) - reserved(if) operator(()ident(i) operator(+) ident(unit) operator(<) ident(i)operator(\)) reserved(break)operator(;) - ident(i) operator(+=) ident(unit)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(tmp) operator(=) ident(rb_check_string_type)operator(()ident(b)operator(\);) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - ident(VALUE) ident(args)operator([)integer(5)operator(];) - pre_type(long) ident(iter)operator([)integer(2)operator(];) - - ident(b) operator(=) ident(tmp)operator(;) - reserved(if) operator(()ident(unit) operator(==) integer(0)operator(\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - ident(args)operator([)integer(0)operator(]) operator(=) ident(b)operator(;) ident(args)operator([)integer(1)operator(]) operator(=) ident(e)operator(;) ident(args)operator([)integer(2)operator(]) operator(=) ident(range)operator(;) - ident(iter)operator([)integer(0)operator(]) operator(=) integer(1)operator(;) ident(iter)operator([)integer(1)operator(]) operator(=) ident(unit)operator(;) - ident(rb_iterate)operator((()ident(VALUE)operator((*\))ident(_)operator((()ident(VALUE)operator(\)\)\))ident(str_step)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(,) ident(step_i)operator(,) - operator(()ident(VALUE)operator(\))ident(iter)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(rb_obj_is_kind_of)operator(()ident(b)operator(,) ident(rb_cNumeric)operator(\)\)) operator({) - ident(ID) ident(c) operator(=) ident(rb_intern)operator(()ident(EXCL)operator(()ident(range)operator(\)) operator(?) string operator(:) stringoperator(\);) - - reserved(if) operator(()ident(rb_equal)operator(()ident(step)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\)\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(while) operator(()ident(RTEST)operator(()ident(rb_funcall)operator(()ident(b)operator(,) ident(c)operator(,) integer(1)operator(,) ident(e)operator(\)\)\)) operator({) - ident(rb_yield)operator(()ident(b)operator(\);) - ident(b) operator(=) ident(rb_funcall)operator(()ident(b)operator(,) char('+')operator(,) integer(1)operator(,) ident(step)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - pre_type(long) ident(args)operator([)integer(2)operator(];) - - reserved(if) operator(()ident(unit) operator(==) integer(0)operator(\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(b)operator(,) ident(id_succ)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(b)operator(\)\);) - operator(}) - - ident(args)operator([)integer(0)operator(]) operator(=) integer(1)operator(;) - ident(args)operator([)integer(1)operator(]) operator(=) ident(unit)operator(;) - ident(range_each_func)operator(()ident(range)operator(,) ident(step_i)operator(,) ident(b)operator(,) ident(e)operator(,) ident(args)operator(\);) - operator(}) - operator(}) - reserved(return) ident(range)operator(;) -operator(}) - -directive(static) directive(void) -ident(each_i)operator(()ident(v)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(v)operator(;) - directive(void) operator(*)ident(arg)operator(;) -operator({) - ident(rb_yield)operator(()ident(v)operator(\);) -operator(}) - -comment(/* - * call-seq: - * rng.each {| i | block } => rng - * - * Iterates over the elements rng, passing each in turn to the - * block. You can only iterate if the start object of the range - * supports the +succ+ method (which means that you can't iterate over - * ranges of +Float+ objects\). - * - * (10..15\).each do |n| - * print n, ' ' - * end - * - * produces: - * - * 10 11 12 13 14 15 - */) - -directive(static) ident(VALUE) -ident(range_each)operator(()ident(range)operator(\)) - ident(VALUE) ident(range)operator(;) -operator({) - ident(VALUE) ident(beg)operator(,) ident(end)operator(;) - - ident(beg) operator(=) ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_beg)operator(\);) - ident(end) operator(=) ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_end)operator(\);) - - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(beg)operator(,) ident(id_succ)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(beg)operator(\)\);) - operator(}) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(beg)operator(\)) operator(&&) ident(FIXNUM_P)operator(()ident(end)operator(\)\)) operator({) comment(/* fixnums are special */) - pre_type(long) ident(lim) operator(=) ident(FIX2LONG)operator(()ident(end)operator(\);) - pre_type(long) ident(i)operator(;) - - reserved(if) operator((!)ident(EXCL)operator(()ident(range)operator(\)\)) ident(lim) operator(+=) integer(1)operator(;) - reserved(for) operator(()ident(i)operator(=)ident(FIX2LONG)operator(()ident(beg)operator(\);) ident(i)operator(<)ident(lim)operator(;) ident(i)operator(++\)) operator({) - ident(rb_yield)operator(()ident(LONG2NUM)operator(()ident(i)operator(\)\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(TYPE)operator(()ident(beg)operator(\)) operator(==) ident(T_STRING)operator(\)) operator({) - ident(VALUE) ident(args)operator([)integer(5)operator(];) - pre_type(long) ident(iter)operator([)integer(2)operator(];) - - ident(args)operator([)integer(0)operator(]) operator(=) ident(beg)operator(;) ident(args)operator([)integer(1)operator(]) operator(=) ident(end)operator(;) ident(args)operator([)integer(2)operator(]) operator(=) ident(range)operator(;) - ident(iter)operator([)integer(0)operator(]) operator(=) integer(1)operator(;) ident(iter)operator([)integer(1)operator(]) operator(=) integer(1)operator(;) - ident(rb_iterate)operator((()ident(VALUE)operator((*\))ident(_)operator((()ident(VALUE)operator(\)\)\))ident(str_step)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(,) ident(step_i)operator(,) - operator(()ident(VALUE)operator(\))ident(iter)operator(\);) - operator(}) - reserved(else) operator({) - ident(range_each_func)operator(()ident(range)operator(,) ident(each_i)operator(,) ident(beg)operator(,) ident(end)operator(,) pre_constant(NULL)operator(\);) - operator(}) - reserved(return) ident(range)operator(;) -operator(}) - -comment(/* - * call-seq: - * rng.first => obj - * rng.begin => obj - * - * Returns the first object in rng. - */) - -directive(static) ident(VALUE) -ident(range_first)operator(()ident(range)operator(\)) - ident(VALUE) ident(range)operator(;) -operator({) - reserved(return) ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_beg)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * rng.end => obj - * rng.last => obj - * - * Returns the object that defines the end of rng. - * - * (1..10\).end #=> 10 - * (1...10\).end #=> 10 - */) - - -directive(static) ident(VALUE) -ident(range_last)operator(()ident(range)operator(\)) - ident(VALUE) ident(range)operator(;) -operator({) - reserved(return) ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_end)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_range_beg_len)operator(()ident(range)operator(,) ident(begp)operator(,) ident(lenp)operator(,) ident(len)operator(,) ident(err)operator(\)) - ident(VALUE) ident(range)operator(;) - pre_type(long) operator(*)ident(begp)operator(,) operator(*)ident(lenp)operator(;) - pre_type(long) ident(len)operator(;) - pre_type(int) ident(err)operator(;) -operator({) - pre_type(long) ident(beg)operator(,) ident(end)operator(,) ident(b)operator(,) ident(e)operator(;) - - reserved(if) operator((!)ident(rb_obj_is_kind_of)operator(()ident(range)operator(,) ident(rb_cRange)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - - ident(beg) operator(=) ident(b) operator(=) ident(NUM2LONG)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_beg)operator(\)\);) - ident(end) operator(=) ident(e) operator(=) ident(NUM2LONG)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_end)operator(\)\);) - - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) operator({) - ident(beg) operator(+=) ident(len)operator(;) - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) reserved(goto) ident(out_of_range)operator(;) - operator(}) - reserved(if) operator(()ident(err) operator(==) integer(0) operator(||) ident(err) operator(==) integer(2)operator(\)) operator({) - reserved(if) operator(()ident(beg) operator(>) ident(len)operator(\)) reserved(goto) ident(out_of_range)operator(;) - reserved(if) operator(()ident(end) operator(>) ident(len)operator(\)) ident(end) operator(=) ident(len)operator(;) - operator(}) - reserved(if) operator(()ident(end) operator(<) integer(0)operator(\)) ident(end) operator(+=) ident(len)operator(;) - reserved(if) operator((!)ident(EXCL)operator(()ident(range)operator(\)\)) ident(end)operator(++;) comment(/* include end point */) - ident(len) operator(=) ident(end) operator(-) ident(beg)operator(;) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) ident(len) operator(=) integer(0)operator(;) - - operator(*)ident(begp) operator(=) ident(beg)operator(;) - operator(*)ident(lenp) operator(=) ident(len)operator(;) - reserved(return) ident(Qtrue)operator(;) - - label(out_of_range:) - reserved(if) operator(()ident(err)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) - ident(b)operator(,) ident(EXCL)operator(()ident(range)operator(\)?) string operator(:) stringoperator(,) ident(e)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * rng.to_s => string - * - * Convert this range object to a printable form. - */) - -directive(static) ident(VALUE) -ident(range_to_s)operator(()ident(range)operator(\)) - ident(VALUE) ident(range)operator(;) -operator({) - ident(VALUE) ident(str)operator(,) ident(str2)operator(;) - - ident(str) operator(=) ident(rb_obj_as_string)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_beg)operator(\)\);) - ident(str2) operator(=) ident(rb_obj_as_string)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_end)operator(\)\);) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_cat)operator(()ident(str)operator(,) stringoperator(,) ident(EXCL)operator(()ident(range)operator(\)?)integer(3)operator(:)integer(2)operator(\);) - ident(rb_str_append)operator(()ident(str)operator(,) ident(str2)operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(str2)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * rng.inspect => string - * - * Convert this range object to a printable form (using - * inspect to convert the start and end - * objects\). - */) - - -directive(static) ident(VALUE) -ident(range_inspect)operator(()ident(range)operator(\)) - ident(VALUE) ident(range)operator(;) -operator({) - ident(VALUE) ident(str)operator(,) ident(str2)operator(;) - - ident(str) operator(=) ident(rb_inspect)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_beg)operator(\)\);) - ident(str2) operator(=) ident(rb_inspect)operator(()ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_end)operator(\)\);) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_cat)operator(()ident(str)operator(,) stringoperator(,) ident(EXCL)operator(()ident(range)operator(\)?)integer(3)operator(:)integer(2)operator(\);) - ident(rb_str_append)operator(()ident(str)operator(,) ident(str2)operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(str2)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * rng === obj => true or false - * rng.member?(val\) => true or false - * rng.include?(val\) => true or false - * - * Returns true if obj is an element of - * rng, false otherwise. Conveniently, - * === is the comparison operator used by - * case statements. - * - * case 79 - * when 1..50 then print "low\\n" - * when 51..75 then print "medium\\n" - * when 76..100 then print "high\\n" - * end - * - * produces: - * - * high - */) - -directive(static) ident(VALUE) -ident(range_include)operator(()ident(range)operator(,) ident(val)operator(\)) - ident(VALUE) ident(range)operator(,) ident(val)operator(;) -operator({) - ident(VALUE) ident(beg)operator(,) ident(end)operator(;) - - ident(beg) operator(=) ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_beg)operator(\);) - ident(end) operator(=) ident(rb_ivar_get)operator(()ident(range)operator(,) ident(id_end)operator(\);) - reserved(if) operator(()ident(r_le)operator(()ident(beg)operator(,) ident(val)operator(\)\)) operator({) - reserved(if) operator(()ident(EXCL)operator(()ident(range)operator(\)\)) operator({) - reserved(if) operator(()ident(r_lt)operator(()ident(val)operator(,) ident(end)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(r_le)operator(()ident(val)operator(,) ident(end)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* A Range represents an interval---a set of values with a - * start and an end. Ranges may be constructed using the - * s..e and - * s...e literals, or with - * Range::new. Ranges constructed using .. - * run from the start to the end inclusively. Those created using - * ... exclude the end value. When used as an iterator, - * ranges return each value in the sequence. - * - * (-1..-5\).to_a #=> [] - * (-5..-1\).to_a #=> [-5, -4, -3, -2, -1] - * ('a'..'e'\).to_a #=> ["a", "b", "c", "d", "e"] - * ('a'...'e'\).to_a #=> ["a", "b", "c", "d"] - * - * Ranges can be constructed using objects of any type, as long as the - * objects can be compared using their <=> operator and - * they support the succ method to return the next object - * in sequence. - * - * class Xs # represent a string of 'x's - * include Comparable - * attr :length - * def initialize(n\) - * @length = n - * end - * def succ - * Xs.new(@length + 1\) - * end - * def <=>(other\) - * @length <=> other.length - * end - * def to_s - * sprintf "%2d #{inspect}", @length - * end - * def inspect - * 'x' * @length - * end - * end - * - * r = Xs.new(3\)..Xs.new(6\) #=> xxx..xxxxxx - * r.to_a #=> [xxx, xxxx, xxxxx, xxxxxx] - * r.member?(Xs.new(5\)\) #=> true - * - * In the previous code example, class Xs includes the - * Comparable module. This is because - * Enumerable#member? checks for equality using - * ==. Including Comparable ensures that the - * == method is defined in terms of the <=> - * method implemented in Xs. - * - */) - -directive(void) -ident(Init_Range)operator((\)) -operator({) - ident(rb_cRange) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_include_module)operator(()ident(rb_cRange)operator(,) ident(rb_mEnumerable)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_initialize)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_eq)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_include)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_eql)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_hash)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_each)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_step)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_first)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_last)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_first)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_last)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_inspect)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_exclude_end_p)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_include)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRange)operator(,) stringoperator(,) ident(range_include)operator(,) integer(1)operator(\);) - - ident(id_cmp) operator(=) ident(rb_intern)operator(()string)delimiter(")>operator(\);) - ident(id_succ) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_beg) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_end) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(id_excl) operator(=) ident(rb_intern)operator(()stringoperator(\);) -operator(}) -comment(/********************************************************************** - - re.c - - - $Author: shyouhei $ - created at: Mon Aug 9 18:24:49 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("re.h") -preprocessor(#include) include() - -ident(VALUE) ident(rb_eRegexpError)operator(;) - -preprocessor(#define) ident(BEG)operator(()ident(no)operator(\)) ident(regs)operator(->)ident(beg)operator([)ident(no)operator(]) -preprocessor(#define) ident(END)operator(()ident(no)operator(\)) ident(regs)operator(->)ident(end)operator([)ident(no)operator(]) - -preprocessor(#if) char('a') operator(==) integer(97) comment(/* it's ascii */) -directive(static) directive(const) pre_type(char) ident(casetable)operator([]) operator(=) operator({) - char('\\000')operator(,) char('\\001')operator(,) char('\\002')operator(,) char('\\003')operator(,) char('\\004')operator(,) char('\\005')operator(,) char('\\006')operator(,) char('\\007')operator(,) - char('\\010')operator(,) char('\\011')operator(,) char('\\012')operator(,) char('\\013')operator(,) char('\\014')operator(,) char('\\015')operator(,) char('\\016')operator(,) char('\\017')operator(,) - char('\\020')operator(,) char('\\021')operator(,) char('\\022')operator(,) char('\\023')operator(,) char('\\024')operator(,) char('\\025')operator(,) char('\\026')operator(,) char('\\027')operator(,) - char('\\030')operator(,) char('\\031')operator(,) char('\\032')operator(,) char('\\033')operator(,) char('\\034')operator(,) char('\\035')operator(,) char('\\036')operator(,) char('\\037')operator(,) - comment(/* ' ' '!' '"' '#' '$' '%' '&' ''' */) - char('\\040')operator(,) char('\\041')operator(,) char('\\042')operator(,) char('\\043')operator(,) char('\\044')operator(,) char('\\045')operator(,) char('\\046')operator(,) char('\\047')operator(,) - comment(/* '(' '\)' '*' '+' ',' '-' '.' '/' */) - char('\\050')operator(,) char('\\051')operator(,) char('\\052')operator(,) char('\\053')operator(,) char('\\054')operator(,) char('\\055')operator(,) char('\\056')operator(,) char('\\057')operator(,) - comment(/* '0' '1' '2' '3' '4' '5' '6' '7' */) - char('\\060')operator(,) char('\\061')operator(,) char('\\062')operator(,) char('\\063')operator(,) char('\\064')operator(,) char('\\065')operator(,) char('\\066')operator(,) char('\\067')operator(,) - comment(/* '8' '9' ':' ';' '<' '=' '>' '?' */) - char('\\070')operator(,) char('\\071')operator(,) char('\\072')operator(,) char('\\073')operator(,) char('\\074')operator(,) char('\\075')operator(,) char('\\076')operator(,) char('\\077')operator(,) - comment(/* '@' 'A' 'B' 'C' 'D' 'E' 'F' 'G' */) - char('\\100')operator(,) char('\\141')operator(,) char('\\142')operator(,) char('\\143')operator(,) char('\\144')operator(,) char('\\145')operator(,) char('\\146')operator(,) char('\\147')operator(,) - comment(/* 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O' */) - char('\\150')operator(,) char('\\151')operator(,) char('\\152')operator(,) char('\\153')operator(,) char('\\154')operator(,) char('\\155')operator(,) char('\\156')operator(,) char('\\157')operator(,) - comment(/* 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' */) - char('\\160')operator(,) char('\\161')operator(,) char('\\162')operator(,) char('\\163')operator(,) char('\\164')operator(,) char('\\165')operator(,) char('\\166')operator(,) char('\\167')operator(,) - comment(/* 'X' 'Y' 'Z' '[' '\\' ']' '^' '_' */) - char('\\170')operator(,) char('\\171')operator(,) char('\\172')operator(,) char('\\133')operator(,) char('\\134')operator(,) char('\\135')operator(,) char('\\136')operator(,) char('\\137')operator(,) - comment(/* '`' 'a' 'b' 'c' 'd' 'e' 'f' 'g' */) - char('\\140')operator(,) char('\\141')operator(,) char('\\142')operator(,) char('\\143')operator(,) char('\\144')operator(,) char('\\145')operator(,) char('\\146')operator(,) char('\\147')operator(,) - comment(/* 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' */) - char('\\150')operator(,) char('\\151')operator(,) char('\\152')operator(,) char('\\153')operator(,) char('\\154')operator(,) char('\\155')operator(,) char('\\156')operator(,) char('\\157')operator(,) - comment(/* 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' */) - char('\\160')operator(,) char('\\161')operator(,) char('\\162')operator(,) char('\\163')operator(,) char('\\164')operator(,) char('\\165')operator(,) char('\\166')operator(,) char('\\167')operator(,) - comment(/* 'x' 'y' 'z' '{' '|' '}' '~' */) - char('\\170')operator(,) char('\\171')operator(,) char('\\172')operator(,) char('\\173')operator(,) char('\\174')operator(,) char('\\175')operator(,) char('\\176')operator(,) char('\\177')operator(,) - char('\\200')operator(,) char('\\201')operator(,) char('\\202')operator(,) char('\\203')operator(,) char('\\204')operator(,) char('\\205')operator(,) char('\\206')operator(,) char('\\207')operator(,) - char('\\210')operator(,) char('\\211')operator(,) char('\\212')operator(,) char('\\213')operator(,) char('\\214')operator(,) char('\\215')operator(,) char('\\216')operator(,) char('\\217')operator(,) - char('\\220')operator(,) char('\\221')operator(,) char('\\222')operator(,) char('\\223')operator(,) char('\\224')operator(,) char('\\225')operator(,) char('\\226')operator(,) char('\\227')operator(,) - char('\\230')operator(,) char('\\231')operator(,) char('\\232')operator(,) char('\\233')operator(,) char('\\234')operator(,) char('\\235')operator(,) char('\\236')operator(,) char('\\237')operator(,) - char('\\240')operator(,) char('\\241')operator(,) char('\\242')operator(,) char('\\243')operator(,) char('\\244')operator(,) char('\\245')operator(,) char('\\246')operator(,) char('\\247')operator(,) - char('\\250')operator(,) char('\\251')operator(,) char('\\252')operator(,) char('\\253')operator(,) char('\\254')operator(,) char('\\255')operator(,) char('\\256')operator(,) char('\\257')operator(,) - char('\\260')operator(,) char('\\261')operator(,) char('\\262')operator(,) char('\\263')operator(,) char('\\264')operator(,) char('\\265')operator(,) char('\\266')operator(,) char('\\267')operator(,) - char('\\270')operator(,) char('\\271')operator(,) char('\\272')operator(,) char('\\273')operator(,) char('\\274')operator(,) char('\\275')operator(,) char('\\276')operator(,) char('\\277')operator(,) - char('\\300')operator(,) char('\\301')operator(,) char('\\302')operator(,) char('\\303')operator(,) char('\\304')operator(,) char('\\305')operator(,) char('\\306')operator(,) char('\\307')operator(,) - char('\\310')operator(,) char('\\311')operator(,) char('\\312')operator(,) char('\\313')operator(,) char('\\314')operator(,) char('\\315')operator(,) char('\\316')operator(,) char('\\317')operator(,) - char('\\320')operator(,) char('\\321')operator(,) char('\\322')operator(,) char('\\323')operator(,) char('\\324')operator(,) char('\\325')operator(,) char('\\326')operator(,) char('\\327')operator(,) - char('\\330')operator(,) char('\\331')operator(,) char('\\332')operator(,) char('\\333')operator(,) char('\\334')operator(,) char('\\335')operator(,) char('\\336')operator(,) char('\\337')operator(,) - char('\\340')operator(,) char('\\341')operator(,) char('\\342')operator(,) char('\\343')operator(,) char('\\344')operator(,) char('\\345')operator(,) char('\\346')operator(,) char('\\347')operator(,) - char('\\350')operator(,) char('\\351')operator(,) char('\\352')operator(,) char('\\353')operator(,) char('\\354')operator(,) char('\\355')operator(,) char('\\356')operator(,) char('\\357')operator(,) - char('\\360')operator(,) char('\\361')operator(,) char('\\362')operator(,) char('\\363')operator(,) char('\\364')operator(,) char('\\365')operator(,) char('\\366')operator(,) char('\\367')operator(,) - char('\\370')operator(,) char('\\371')operator(,) char('\\372')operator(,) char('\\373')operator(,) char('\\374')operator(,) char('\\375')operator(,) char('\\376')operator(,) char('\\377')operator(,) -operator(};) -preprocessor(#else) -preprocessor(# error) operator(>>>) string operator(<<<) -preprocessor(#endif) - -pre_type(int) -ident(rb_memcicmp)operator(()ident(x)operator(,) ident(y)operator(,) ident(len)operator(\)) - directive(const) directive(void) operator(*)ident(x)operator(,) operator(*)ident(y)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(p1) operator(=) ident(x)operator(,) operator(*)ident(p2) operator(=) ident(y)operator(;) - pre_type(int) ident(tmp)operator(;) - - reserved(while) operator(()ident(len)operator(--\)) operator({) - reserved(if) operator((()ident(tmp) operator(=) ident(casetable)operator([()pre_type(unsigned)operator(\)*)ident(p1)operator(++]) operator(-) ident(casetable)operator([()pre_type(unsigned)operator(\)*)ident(p2)operator(++]\)) operator(!=) integer(0)operator(\)) - reserved(return) ident(tmp)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -pre_type(int) -ident(rb_memcmp)operator(()ident(p1)operator(,) ident(p2)operator(,) ident(len)operator(\)) - directive(const) directive(void) operator(*)ident(p1)operator(,) operator(*)ident(p2)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - reserved(if) operator((!)ident(ruby_ignorecase)operator(\)) operator({) - reserved(return) ident(memcmp)operator(()ident(p1)operator(,) ident(p2)operator(,) ident(len)operator(\);) - operator(}) - reserved(return) ident(rb_memcicmp)operator(()ident(p1)operator(,) ident(p2)operator(,) ident(len)operator(\);) -operator(}) - -pre_type(long) -ident(rb_memsearch)operator(()ident(x0)operator(,) ident(m)operator(,) ident(y0)operator(,) ident(n)operator(\)) - directive(const) directive(void) operator(*)ident(x0)operator(,) operator(*)ident(y0)operator(;) - pre_type(long) ident(m)operator(,) ident(n)operator(;) -operator({) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(x) operator(=) operator(()pre_type(unsigned) pre_type(char) operator(*\))ident(x0)operator(,) operator(*)ident(y) operator(=) operator(()pre_type(unsigned) pre_type(char) operator(*\))ident(y0)operator(;) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(e)operator(;) - pre_type(long) ident(i)operator(;) - pre_type(int) ident(d)operator(;) - pre_type(unsigned) pre_type(long) ident(hx)operator(,) ident(hy)operator(;) - -preprocessor(#define) ident(KR_REHASH)operator(()ident(a)operator(,) ident(b)operator(,) ident(h)operator(\)) operator(((()ident(h)operator(\)) operator(<<) integer(1)operator(\)) operator(-) operator(((()pre_type(unsigned) pre_type(long)operator(\)()ident(a)operator(\)\)<<)ident(d)operator(\)) operator(+) operator(()ident(b)operator(\)\)) - - reserved(if) operator(()ident(m) operator(>) ident(n)operator(\)) reserved(return) operator(-)integer(1)operator(;) - ident(s) operator(=) ident(y)operator(;) ident(e) operator(=) ident(s) operator(+) ident(n) operator(-) ident(m)operator(;) - - comment(/* Preprocessing */) - comment(/* computes d = 2^(m-1\) with - the left-shift operator */) - ident(d) operator(=) reserved(sizeof)operator(()ident(hx)operator(\)) operator(*) ident(CHAR_BIT) operator(-) integer(1)operator(;) - reserved(if) operator(()ident(d) operator(>) ident(m)operator(\)) ident(d) operator(=) ident(m)operator(;) - - reserved(if) operator(()ident(ruby_ignorecase)operator(\)) operator({) - reserved(if) operator(()ident(n) operator(==) ident(m)operator(\)) operator({) - reserved(return) ident(rb_memcicmp)operator(()ident(x)operator(,) ident(s)operator(,) ident(m)operator(\)) operator(==) integer(0) operator(?) integer(0) operator(:) operator(-)integer(1)operator(;) - operator(}) - comment(/* Prepare hash value */) - reserved(for) operator(()ident(hy) operator(=) ident(hx) operator(=) ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(d)operator(;) operator(++)ident(i)operator(\)) operator({) - ident(hx) operator(=) ident(KR_REHASH)operator(()integer(0)operator(,) ident(casetable)operator([)ident(x)operator([)ident(i)operator(]],) ident(hx)operator(\);) - ident(hy) operator(=) ident(KR_REHASH)operator(()integer(0)operator(,) ident(casetable)operator([)ident(s)operator([)ident(i)operator(]],) ident(hy)operator(\);) - operator(}) - comment(/* Searching */) - reserved(while) operator(()ident(hx) operator(!=) ident(hy) operator(||) ident(rb_memcicmp)operator(()ident(x)operator(,) ident(s)operator(,) ident(m)operator(\)\)) operator({) - reserved(if) operator(()ident(s) operator(>=) ident(e)operator(\)) reserved(return) operator(-)integer(1)operator(;) - ident(hy) operator(=) ident(KR_REHASH)operator(()ident(casetable)operator([*)ident(s)operator(],) ident(casetable)operator([*()ident(s)operator(+)ident(d)operator(\)],) ident(hy)operator(\);) - ident(s)operator(++;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(n) operator(==) ident(m)operator(\)) operator({) - reserved(return) ident(memcmp)operator(()ident(x)operator(,) ident(s)operator(,) ident(m)operator(\)) operator(==) integer(0) operator(?) integer(0) operator(:) operator(-)integer(1)operator(;) - operator(}) - comment(/* Prepare hash value */) - reserved(for) operator(()ident(hy) operator(=) ident(hx) operator(=) ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(d)operator(;) operator(++)ident(i)operator(\)) operator({) - ident(hx) operator(=) ident(KR_REHASH)operator(()integer(0)operator(,) ident(x)operator([)ident(i)operator(],) ident(hx)operator(\);) - ident(hy) operator(=) ident(KR_REHASH)operator(()integer(0)operator(,) ident(s)operator([)ident(i)operator(],) ident(hy)operator(\);) - operator(}) - comment(/* Searching */) - reserved(while) operator(()ident(hx) operator(!=) ident(hy) operator(||) ident(memcmp)operator(()ident(x)operator(,) ident(s)operator(,) ident(m)operator(\)\)) operator({) - reserved(if) operator(()ident(s) operator(>=) ident(e)operator(\)) reserved(return) operator(-)integer(1)operator(;) - ident(hy) operator(=) ident(KR_REHASH)operator((*)ident(s)operator(,) operator(*()ident(s)operator(+)ident(d)operator(\),) ident(hy)operator(\);) - ident(s)operator(++;) - operator(}) - operator(}) - reserved(return) ident(s)operator(-)ident(y)operator(;) -operator(}) - -preprocessor(#define) ident(REG_LITERAL) ident(FL_USER5) -preprocessor(#define) ident(REG_CASESTATE) ident(FL_USER0) -preprocessor(#define) ident(KCODE_NONE) integer(0) -preprocessor(#define) ident(KCODE_EUC) ident(FL_USER1) -preprocessor(#define) ident(KCODE_SJIS) ident(FL_USER2) -preprocessor(#define) ident(KCODE_UTF8) ident(FL_USER3) -preprocessor(#define) ident(KCODE_FIXED) ident(FL_USER4) -preprocessor(#define) ident(KCODE_MASK) operator(()ident(KCODE_EUC)operator(|)ident(KCODE_SJIS)operator(|)ident(KCODE_UTF8)operator(\)) - -directive(static) pre_type(int) ident(reg_kcode) operator(=) ident(DEFAULT_KCODE)operator(;) - -directive(static) directive(void) -ident(kcode_euc)operator(()ident(re)operator(\)) - reserved(struct) ident(RRegexp) operator(*)ident(re)operator(;) -operator({) - ident(FL_UNSET)operator(()ident(re)operator(,) ident(KCODE_MASK)operator(\);) - ident(FL_SET)operator(()ident(re)operator(,) ident(KCODE_EUC)operator(\);) - ident(FL_SET)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\);) -operator(}) - -directive(static) directive(void) -ident(kcode_sjis)operator(()ident(re)operator(\)) - reserved(struct) ident(RRegexp) operator(*)ident(re)operator(;) -operator({) - ident(FL_UNSET)operator(()ident(re)operator(,) ident(KCODE_MASK)operator(\);) - ident(FL_SET)operator(()ident(re)operator(,) ident(KCODE_SJIS)operator(\);) - ident(FL_SET)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\);) -operator(}) - -directive(static) directive(void) -ident(kcode_utf8)operator(()ident(re)operator(\)) - reserved(struct) ident(RRegexp) operator(*)ident(re)operator(;) -operator({) - ident(FL_UNSET)operator(()ident(re)operator(,) ident(KCODE_MASK)operator(\);) - ident(FL_SET)operator(()ident(re)operator(,) ident(KCODE_UTF8)operator(\);) - ident(FL_SET)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\);) -operator(}) - -directive(static) directive(void) -ident(kcode_none)operator(()ident(re)operator(\)) - reserved(struct) ident(RRegexp) operator(*)ident(re)operator(;) -operator({) - ident(FL_UNSET)operator(()ident(re)operator(,) ident(KCODE_MASK)operator(\);) - ident(FL_SET)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\);) -operator(}) - -directive(static) pre_type(int) ident(curr_kcode)operator(;) - -directive(void) -ident(rb_kcode_set_option)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\)\)) reserved(return)operator(;) - - ident(curr_kcode) operator(=) ident(RBASIC)operator(()ident(re)operator(\)->)ident(flags) operator(&) ident(KCODE_MASK)operator(;) - reserved(if) operator(()ident(reg_kcode) operator(==) ident(curr_kcode)operator(\)) reserved(return)operator(;) - reserved(switch) operator(()ident(curr_kcode)operator(\)) operator({) - reserved(case) ident(KCODE_NONE)operator(:) - ident(re_mbcinit)operator(()ident(MBCTYPE_ASCII)operator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_EUC)operator(:) - ident(re_mbcinit)operator(()ident(MBCTYPE_EUC)operator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_SJIS)operator(:) - ident(re_mbcinit)operator(()ident(MBCTYPE_SJIS)operator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_UTF8)operator(:) - ident(re_mbcinit)operator(()ident(MBCTYPE_UTF8)operator(\);) - reserved(break)operator(;) - operator(}) -operator(}) - -directive(void) -ident(rb_kcode_reset_option)operator((\)) -operator({) - reserved(if) operator(()ident(reg_kcode) operator(==) ident(curr_kcode)operator(\)) reserved(return)operator(;) - reserved(switch) operator(()ident(reg_kcode)operator(\)) operator({) - reserved(case) ident(KCODE_NONE)operator(:) - ident(re_mbcinit)operator(()ident(MBCTYPE_ASCII)operator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_EUC)operator(:) - ident(re_mbcinit)operator(()ident(MBCTYPE_EUC)operator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_SJIS)operator(:) - ident(re_mbcinit)operator(()ident(MBCTYPE_SJIS)operator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_UTF8)operator(:) - ident(re_mbcinit)operator(()ident(MBCTYPE_UTF8)operator(\);) - reserved(break)operator(;) - operator(}) -operator(}) - -pre_type(int) -ident(rb_reg_mbclen2)operator(()ident(c)operator(,) ident(re)operator(\)) - pre_type(unsigned) pre_type(int) ident(c)operator(;) - ident(VALUE) ident(re)operator(;) -operator({) - pre_type(int) ident(len)operator(;) - - reserved(if) operator((!)ident(FL_TEST)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\)\)) - reserved(return) ident(mbclen)operator(()ident(c)operator(\);) - ident(rb_kcode_set_option)operator(()ident(re)operator(\);) - ident(len) operator(=) ident(mbclen)operator(()ident(c)operator(\);) - ident(rb_kcode_reset_option)operator((\);) - reserved(return) ident(len)operator(;) -operator(}) - -directive(static) directive(void) -ident(rb_reg_check)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - reserved(if) operator((!)ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr) operator(||) operator(!)ident(RREGEXP)operator(()ident(re)operator(\)->)ident(str)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) -operator(}) - -directive(extern) pre_type(int) ident(ruby_in_compile)operator(;) - -directive(static) directive(void) -ident(rb_reg_expr_str)operator(()ident(str)operator(,) ident(s)operator(,) ident(len)operator(\)) - ident(VALUE) ident(str)operator(;) - directive(const) pre_type(char) operator(*)ident(s)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - pre_type(int) ident(need_escape) operator(=) integer(0)operator(;) - - ident(p) operator(=) ident(s)operator(;) ident(pend) operator(=) ident(p) operator(+) ident(len)operator(;) - reserved(while) operator(()ident(p)operator(<)ident(pend)operator(\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('/') operator(||) operator((!)ident(ISPRINT)operator((*)ident(p)operator(\)) operator(&&) operator(!)ident(ismbchar)operator((*)ident(p)operator(\)\)\)) operator({) - ident(need_escape) operator(=) integer(1)operator(;) - reserved(break)operator(;) - operator(}) - ident(p) operator(+=) ident(mbclen)operator((*)ident(p)operator(\);) - operator(}) - reserved(if) operator((!)ident(need_escape)operator(\)) operator({) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(s)operator(,) ident(len)operator(\);) - operator(}) - reserved(else) operator({) - ident(p) operator(=) ident(s)operator(;) - reserved(while) operator(()ident(p)operator(<)ident(pend)operator(\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('\\\\')operator(\)) operator({) - pre_type(int) ident(n) operator(=) ident(mbclen)operator(()ident(p)operator([)integer(1)operator(]\)) operator(+) integer(1)operator(;) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(p)operator(,) ident(n)operator(\);) - ident(p) operator(+=) ident(n)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(else) reserved(if) operator((*)ident(p) operator(==) char('/')operator(\)) operator({) - pre_type(char) ident(c) operator(=) char('\\\\')operator(;) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\);) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(p)operator(,) integer(1)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(ismbchar)operator((*)ident(p)operator(\)\)) operator({) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(p)operator(,) ident(mbclen)operator((*)ident(p)operator(\)\);) - ident(p) operator(+=) ident(mbclen)operator((*)ident(p)operator(\);) - reserved(continue)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ISPRINT)operator((*)ident(p)operator(\)\)) operator({) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(p)operator(,) integer(1)operator(\);) - operator(}) - reserved(else) reserved(if) operator((!)ident(ISSPACE)operator((*)ident(p)operator(\)\)) operator({) - pre_type(char) ident(b)operator([)integer(8)operator(];) - - ident(sprintf)operator(()ident(b)operator(,) stringoperator(,) operator(*)ident(p) operator(&) oct(0377)operator(\);) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(b)operator(,) integer(4)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(p)operator(,) integer(1)operator(\);) - operator(}) - ident(p)operator(++;) - operator(}) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(rb_reg_desc)operator(()ident(s)operator(,) ident(len)operator(,) ident(re)operator(\)) - directive(const) pre_type(char) operator(*)ident(s)operator(;) - pre_type(long) ident(len)operator(;) - ident(VALUE) ident(re)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(rb_str_buf_new2)operator(()stringoperator(\);) - - ident(rb_reg_expr_str)operator(()ident(str)operator(,) ident(s)operator(,) ident(len)operator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(if) operator(()ident(re)operator(\)) operator({) - ident(rb_reg_check)operator(()ident(re)operator(\);) - reserved(if) operator(()ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(->)ident(options) operator(&) ident(RE_OPTION_MULTILINE)operator(\)) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(if) operator(()ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(->)ident(options) operator(&) ident(RE_OPTION_IGNORECASE)operator(\)) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(if) operator(()ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(->)ident(options) operator(&) ident(RE_OPTION_EXTENDED)operator(\)) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\)\)) operator({) - reserved(switch) operator((()ident(RBASIC)operator(()ident(re)operator(\)->)ident(flags) operator(&) ident(KCODE_MASK)operator(\)\)) operator({) - reserved(case) ident(KCODE_NONE)operator(:) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_EUC)operator(:) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_SJIS)operator(:) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_UTF8)operator(:) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(break)operator(;) - operator(}) - operator(}) - operator(}) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(re)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * rxp.source => str - * - * Returns the original string of the pattern. - * - * /ab+c/ix.source #=> "ab+c" - */) - -directive(static) ident(VALUE) -ident(rb_reg_source)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - - ident(rb_reg_check)operator(()ident(re)operator(\);) - ident(str) operator(=) ident(rb_str_new)operator(()ident(RREGEXP)operator(()ident(re)operator(\)->)ident(str)operator(,)ident(RREGEXP)operator(()ident(re)operator(\)->)ident(len)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(re)operator(\)\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * rxp.inspect => string - * - * Produce a nicely formatted string-version of _rxp_. Perhaps surprisingly, - * #inspect actually produces the more natural version of - * the string than #to_s. - * - * /ab+c/ix.to_s #=> /ab+c/ix -*/) - -directive(static) ident(VALUE) -ident(rb_reg_inspect)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - ident(rb_reg_check)operator(()ident(re)operator(\);) - reserved(return) ident(rb_reg_desc)operator(()ident(RREGEXP)operator(()ident(re)operator(\)->)ident(str)operator(,) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(len)operator(,) ident(re)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * rxp.to_s => str - * - * Returns a string containing the regular expression and its options (using the - * (?xxx:yyy\) notation. This string can be fed back in to - * Regexp::new to a regular expression with the same semantics as - * the original. (However, Regexp#== may not return true when - * comparing the two, as the source of the regular expression itself may - * differ, as the example shows\). Regexp#inspect produces a - * generally more readable version of rxp. - * - * r1 = /ab+c/ix #=> /ab+c/ix - * s1 = r1.to_s #=> "(?ix-m:ab+c\)" - * r2 = Regexp.new(s1\) #=> /(?ix-m:ab+c\)/ - * r1 == r2 #=> false - * r1.source #=> "ab+c" - * r2.source #=> "(?ix-m:ab+c\)" - */) - -directive(static) ident(VALUE) -ident(rb_reg_to_s)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - pre_type(int) ident(options)operator(;) - directive(const) pre_type(int) ident(embeddable) operator(=) ident(RE_OPTION_MULTILINE)operator(|)ident(RE_OPTION_IGNORECASE)operator(|)ident(RE_OPTION_EXTENDED)operator(;) - pre_type(long) ident(len)operator(;) - directive(const) pre_type(char)operator(*) ident(ptr)operator(;) - ident(VALUE) ident(str) operator(=) ident(rb_str_buf_new2)operator(()stringoperator(\);) - - ident(rb_reg_check)operator(()ident(re)operator(\);) - - ident(options) operator(=) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(->)ident(options)operator(;) - ident(ptr) operator(=) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(str)operator(;) - ident(len) operator(=) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(len)operator(;) - label(again:) - reserved(if) operator(()ident(len) operator(>=) integer(4) operator(&&) ident(ptr)operator([)integer(0)operator(]) operator(==) char('(') operator(&&) ident(ptr)operator([)integer(1)operator(]) operator(==) char('?')operator(\)) operator({) - pre_type(int) ident(err) operator(=) integer(1)operator(;) - ident(ptr) operator(+=) integer(2)operator(;) - reserved(if) operator((()ident(len) operator(-=) integer(2)operator(\)) operator(>) integer(0)operator(\)) operator({) - reserved(do) operator({) - reserved(if) operator((*)ident(ptr) operator(==) char('m')operator(\)) operator({) - ident(options) operator(|=) ident(RE_OPTION_MULTILINE)operator(;) - operator(}) - reserved(else) reserved(if) operator((*)ident(ptr) operator(==) char('i')operator(\)) operator({) - ident(options) operator(|=) ident(RE_OPTION_IGNORECASE)operator(;) - operator(}) - reserved(else) reserved(if) operator((*)ident(ptr) operator(==) char('x')operator(\)) operator({) - ident(options) operator(|=) ident(RE_OPTION_EXTENDED)operator(;) - operator(}) - reserved(else) reserved(break)operator(;) - operator(++)ident(ptr)operator(;) - operator(}) reserved(while) operator((--)ident(len) operator(>) integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(len) operator(>) integer(1) operator(&&) operator(*)ident(ptr) operator(==) char('-')operator(\)) operator({) - operator(++)ident(ptr)operator(;) - operator(--)ident(len)operator(;) - reserved(do) operator({) - reserved(if) operator((*)ident(ptr) operator(==) char('m')operator(\)) operator({) - ident(options) operator(&=) operator(~)ident(RE_OPTION_MULTILINE)operator(;) - operator(}) - reserved(else) reserved(if) operator((*)ident(ptr) operator(==) char('i')operator(\)) operator({) - ident(options) operator(&=) operator(~)ident(RE_OPTION_IGNORECASE)operator(;) - operator(}) - reserved(else) reserved(if) operator((*)ident(ptr) operator(==) char('x')operator(\)) operator({) - ident(options) operator(&=) operator(~)ident(RE_OPTION_EXTENDED)operator(;) - operator(}) - reserved(else) reserved(break)operator(;) - operator(++)ident(ptr)operator(;) - operator(}) reserved(while) operator((--)ident(len) operator(>) integer(0)operator(\);) - operator(}) - reserved(if) operator((*)ident(ptr) operator(==) char('\)')operator(\)) operator({) - operator(--)ident(len)operator(;) - operator(++)ident(ptr)operator(;) - reserved(goto) ident(again)operator(;) - operator(}) - reserved(if) operator((*)ident(ptr) operator(==) char(':') operator(&&) ident(ptr)operator([)ident(len)operator(-)integer(1)operator(]) operator(==) char('\)')operator(\)) operator({) - ident(Regexp) operator(*)ident(rp)operator(;) - ident(rb_kcode_set_option)operator(()ident(re)operator(\);) - ident(rp) operator(=) ident(ALLOC)operator(()ident(Regexp)operator(\);) - ident(MEMZERO)operator((()pre_type(char) operator(*\))ident(rp)operator(,) ident(Regexp)operator(,) integer(1)operator(\);) - ident(err) operator(=) ident(re_compile_pattern)operator((++)ident(ptr)operator(,) ident(len) operator(-=) integer(2)operator(,) ident(rp)operator(\)) operator(!=) integer(0)operator(;) - ident(rb_kcode_reset_option)operator((\);) - ident(re_free_pattern)operator(()ident(rp)operator(\);) - operator(}) - reserved(if) operator(()ident(err)operator(\)) operator({) - ident(options) operator(=) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(->)ident(options)operator(;) - ident(ptr) operator(=) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(str)operator(;) - ident(len) operator(=) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(len)operator(;) - operator(}) - operator(}) - - reserved(if) operator(()ident(options) operator(&) ident(RE_OPTION_MULTILINE)operator(\)) ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(if) operator(()ident(options) operator(&) ident(RE_OPTION_IGNORECASE)operator(\)) ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(if) operator(()ident(options) operator(&) ident(RE_OPTION_EXTENDED)operator(\)) ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - - reserved(if) operator((()ident(options) operator(&) ident(embeddable)operator(\)) operator(!=) ident(embeddable)operator(\)) operator({) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(if) operator((!()ident(options) operator(&) ident(RE_OPTION_MULTILINE)operator(\)\)) ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(if) operator((!()ident(options) operator(&) ident(RE_OPTION_IGNORECASE)operator(\)\)) ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(if) operator((!()ident(options) operator(&) ident(RE_OPTION_EXTENDED)operator(\)\)) ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - operator(}) - - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(rb_reg_expr_str)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(len)operator(\);) - ident(rb_str_buf_cat2)operator(()ident(str)operator(,) stringoperator(\);) - - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(re)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) directive(void) -ident(rb_reg_raise)operator(()ident(s)operator(,) ident(len)operator(,) ident(err)operator(,) ident(re)operator(\)) - directive(const) pre_type(char) operator(*)ident(s)operator(;) - pre_type(long) ident(len)operator(;) - directive(const) pre_type(char) operator(*)ident(err)operator(;) - ident(VALUE) ident(re)operator(;) -operator({) - ident(VALUE) ident(desc) operator(=) ident(rb_reg_desc)operator(()ident(s)operator(,) ident(len)operator(,) ident(re)operator(\);) - - reserved(if) operator(()ident(ruby_in_compile)operator(\)) - ident(rb_compile_error)operator(()stringoperator(,) ident(err)operator(,) ident(RSTRING)operator(()ident(desc)operator(\)->)ident(ptr)operator(\);) - reserved(else) - ident(rb_raise)operator(()ident(rb_eRegexpError)operator(,) stringoperator(,) ident(err)operator(,) ident(RSTRING)operator(()ident(desc)operator(\)->)ident(ptr)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * rxp.casefold? => true or false - * - * Returns the value of the case-insensitive flag. - */) - -directive(static) ident(VALUE) -ident(rb_reg_casefold_p)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - ident(rb_reg_check)operator(()ident(re)operator(\);) - reserved(if) operator(()ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(->)ident(options) operator(&) ident(RE_OPTION_IGNORECASE)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * rxp.options => fixnum - * - * Returns the set of bits corresponding to the options used when creating this - * Regexp (see Regexp::new for details. Note that additional bits - * may be set in the returned options: these are used internally by the regular - * expression code. These extra bits are ignored if the options are passed to - * Regexp::new. - * - * Regexp::IGNORECASE #=> 1 - * Regexp::EXTENDED #=> 2 - * Regexp::MULTILINE #=> 4 - * - * /cat/.options #=> 128 - * /cat/ix.options #=> 131 - * Regexp.new('cat', true\).options #=> 129 - * Regexp.new('cat', 0, 's'\).options #=> 384 - * - * r = /cat/ix - * Regexp.new(r.source, r.options\) #=> /cat/ix - */) - -directive(static) ident(VALUE) -ident(rb_reg_options_m)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - pre_type(int) ident(options) operator(=) ident(rb_reg_options)operator(()ident(re)operator(\);) - reserved(return) ident(INT2NUM)operator(()ident(options)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * rxp.kcode => str - * - * Returns the character set code for the regexp. - */) - -directive(static) ident(VALUE) -ident(rb_reg_kcode_m)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - pre_type(char) operator(*)ident(kcode)operator(;) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\)\)) operator({) - reserved(switch) operator(()ident(RBASIC)operator(()ident(re)operator(\)->)ident(flags) operator(&) ident(KCODE_MASK)operator(\)) operator({) - reserved(case) ident(KCODE_NONE)operator(:) - ident(kcode) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) ident(KCODE_EUC)operator(:) - ident(kcode) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) ident(KCODE_SJIS)operator(:) - ident(kcode) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) ident(KCODE_UTF8)operator(:) - ident(kcode) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_bug)operator(()stringoperator(\);) - reserved(break)operator(;) - operator(}) - reserved(return) ident(rb_str_new2)operator(()ident(kcode)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(Regexp)operator(*) -ident(make_regexp)operator(()ident(s)operator(,) ident(len)operator(,) ident(flags)operator(\)) - directive(const) pre_type(char) operator(*)ident(s)operator(;) - pre_type(long) ident(len)operator(;) - pre_type(int) ident(flags)operator(;) -operator({) - ident(Regexp) operator(*)ident(rp)operator(;) - pre_type(char) operator(*)ident(err)operator(;) - - comment(/* Handle escaped characters first. */) - - comment(/* Build a copy of the string (in dest\) with the - escaped characters translated, and generate the regex - from that. - */) - - ident(rp) operator(=) ident(ALLOC)operator(()ident(Regexp)operator(\);) - ident(MEMZERO)operator((()pre_type(char) operator(*\))ident(rp)operator(,) ident(Regexp)operator(,) integer(1)operator(\);) - ident(rp)operator(->)ident(buffer) operator(=) ident(ALLOC_N)operator(()pre_type(char)operator(,) integer(16)operator(\);) - ident(rp)operator(->)ident(allocated) operator(=) integer(16)operator(;) - ident(rp)operator(->)ident(fastmap) operator(=) ident(ALLOC_N)operator(()pre_type(char)operator(,) integer(256)operator(\);) - reserved(if) operator(()ident(flags)operator(\)) operator({) - ident(rp)operator(->)ident(options) operator(=) ident(flags)operator(;) - operator(}) - ident(err) operator(=) ident(re_compile_pattern)operator(()ident(s)operator(,) ident(len)operator(,) ident(rp)operator(\);) - - reserved(if) operator(()ident(err) operator(!=) pre_constant(NULL)operator(\)) operator({) - ident(re_free_pattern)operator(()ident(rp)operator(\);) - ident(rb_reg_raise)operator(()ident(s)operator(,) ident(len)operator(,) ident(err)operator(,) integer(0)operator(\);) - reserved(return) integer(0)operator(;) - operator(}) - reserved(return) ident(rp)operator(;) -operator(}) - - -comment(/* - * Document-class: MatchData - * - * MatchData is the type of the special variable $~, - * and is the type of the object returned by Regexp#match and - * Regexp#last_match. It encapsulates all the results of a pattern - * match, results normally accessed through the special variables - * $&, $', $`, $1, - * $2, and so on. Matchdata is also known as - * MatchingData. - * - */) - -ident(VALUE) ident(rb_cMatch)operator(;) - -directive(static) ident(VALUE) ident(match_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(match_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(match)operator(,) reserved(struct) ident(RMatch)operator(\);) - ident(OBJSETUP)operator(()ident(match)operator(,) ident(klass)operator(,) ident(T_MATCH)operator(\);) - - ident(match)operator(->)ident(str) operator(=) integer(0)operator(;) - ident(match)operator(->)ident(regs) operator(=) integer(0)operator(;) - ident(match)operator(->)ident(regs) operator(=) ident(ALLOC)operator(()reserved(struct) ident(re_registers)operator(\);) - ident(MEMZERO)operator(()ident(match)operator(->)ident(regs)operator(,) reserved(struct) ident(re_registers)operator(,) integer(1)operator(\);) - - reserved(return) operator(()ident(VALUE)operator(\))ident(match)operator(;) -operator(}) - -directive(static) directive(void) -ident(match_check)operator(()ident(VALUE) ident(match)operator(\)) -operator({) - reserved(if) operator((!)ident(RMATCH)operator(()ident(match)operator(\)->)ident(str)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) -operator(}) - -comment(/* :nodoc: */) -directive(static) ident(VALUE) -ident(match_init_copy)operator(()ident(obj)operator(,) ident(orig)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(orig)operator(;) -operator({) - reserved(if) operator(()ident(obj) operator(==) ident(orig)operator(\)) reserved(return) ident(obj)operator(;) - - reserved(if) operator((!)ident(rb_obj_is_instance_of)operator(()ident(orig)operator(,) ident(rb_obj_class)operator(()ident(obj)operator(\)\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(RMATCH)operator(()ident(obj)operator(\)->)ident(str) operator(=) ident(RMATCH)operator(()ident(orig)operator(\)->)ident(str)operator(;) - ident(re_free_registers)operator(()ident(RMATCH)operator(()ident(obj)operator(\)->)ident(regs)operator(\);) - ident(RMATCH)operator(()ident(obj)operator(\)->)ident(regs)operator(->)ident(allocated) operator(=) integer(0)operator(;) - ident(re_copy_registers)operator(()ident(RMATCH)operator(()ident(obj)operator(\)->)ident(regs)operator(,) ident(RMATCH)operator(()ident(orig)operator(\)->)ident(regs)operator(\);) - - reserved(return) ident(obj)operator(;) -operator(}) - - -comment(/* - * call-seq: - * mtch.length => integer - * mtch.size => integer - * - * Returns the number of elements in the match array. - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138."\) - * m.length #=> 5 - * m.size #=> 5 - */) - -directive(static) ident(VALUE) -ident(match_size)operator(()ident(match)operator(\)) - ident(VALUE) ident(match)operator(;) -operator({) - ident(match_check)operator(()ident(match)operator(\);) - reserved(return) ident(INT2FIX)operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * mtch.offset(n\) => array - * - * Returns a two-element array containing the beginning and ending offsets of - * the nth match. - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138."\) - * m.offset(0\) #=> [1, 7] - * m.offset(4\) #=> [6, 7] - */) - -directive(static) ident(VALUE) -ident(match_offset)operator(()ident(match)operator(,) ident(n)operator(\)) - ident(VALUE) ident(match)operator(,) ident(n)operator(;) -operator({) - pre_type(int) ident(i) operator(=) ident(NUM2INT)operator(()ident(n)operator(\);) - - ident(match_check)operator(()ident(match)operator(\);) - reserved(if) operator(()ident(i) operator(<) integer(0) operator(||) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs) operator(<=) ident(i)operator(\)) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(i)operator(\);) - - reserved(if) operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(beg)operator([)ident(i)operator(]) operator(<) integer(0)operator(\)) - reserved(return) ident(rb_assoc_new)operator(()ident(Qnil)operator(,) ident(Qnil)operator(\);) - - reserved(return) ident(rb_assoc_new)operator(()ident(INT2FIX)operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(beg)operator([)ident(i)operator(]\),) - ident(INT2FIX)operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(end)operator([)ident(i)operator(]\)\);) -operator(}) - - -comment(/* - * call-seq: - * mtch.begin(n\) => integer - * - * Returns the offset of the start of the nth element of the match - * array in the string. - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138."\) - * m.begin(0\) #=> 1 - * m.begin(2\) #=> 2 - */) - -directive(static) ident(VALUE) -ident(match_begin)operator(()ident(match)operator(,) ident(n)operator(\)) - ident(VALUE) ident(match)operator(,) ident(n)operator(;) -operator({) - pre_type(int) ident(i) operator(=) ident(NUM2INT)operator(()ident(n)operator(\);) - - ident(match_check)operator(()ident(match)operator(\);) - reserved(if) operator(()ident(i) operator(<) integer(0) operator(||) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs) operator(<=) ident(i)operator(\)) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(i)operator(\);) - - reserved(if) operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(beg)operator([)ident(i)operator(]) operator(<) integer(0)operator(\)) - reserved(return) ident(Qnil)operator(;) - - reserved(return) ident(INT2FIX)operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(beg)operator([)ident(i)operator(]\);) -operator(}) - - -comment(/* - * call-seq: - * mtch.end(n\) => integer - * - * Returns the offset of the character immediately following the end of the - * nth element of the match array in the string. - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138."\) - * m.end(0\) #=> 7 - * m.end(2\) #=> 3 - */) - -directive(static) ident(VALUE) -ident(match_end)operator(()ident(match)operator(,) ident(n)operator(\)) - ident(VALUE) ident(match)operator(,) ident(n)operator(;) -operator({) - pre_type(int) ident(i) operator(=) ident(NUM2INT)operator(()ident(n)operator(\);) - - ident(match_check)operator(()ident(match)operator(\);) - reserved(if) operator(()ident(i) operator(<) integer(0) operator(||) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs) operator(<=) ident(i)operator(\)) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(i)operator(\);) - - reserved(if) operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(beg)operator([)ident(i)operator(]) operator(<) integer(0)operator(\)) - reserved(return) ident(Qnil)operator(;) - - reserved(return) ident(INT2FIX)operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(end)operator([)ident(i)operator(]\);) -operator(}) - -preprocessor(#define) ident(MATCH_BUSY) ident(FL_USER2) - -directive(void) -ident(rb_match_busy)operator(()ident(match)operator(\)) - ident(VALUE) ident(match)operator(;) -operator({) - ident(FL_SET)operator(()ident(match)operator(,) ident(MATCH_BUSY)operator(\);) -operator(}) - -pre_type(int) ident(ruby_ignorecase)operator(;) -directive(static) pre_type(int) ident(may_need_recompile)operator(;) - -directive(static) directive(void) -ident(rb_reg_prepare_re)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - pre_type(int) ident(need_recompile) operator(=) integer(0)operator(;) - pre_type(int) ident(state)operator(;) - - ident(rb_reg_check)operator(()ident(re)operator(\);) - ident(state) operator(=) ident(FL_TEST)operator(()ident(re)operator(,) ident(REG_CASESTATE)operator(\);) - comment(/* ignorecase status */) - reserved(if) operator(()ident(ruby_ignorecase) operator(&&) operator(!)ident(state)operator(\)) operator({) - ident(FL_SET)operator(()ident(re)operator(,) ident(REG_CASESTATE)operator(\);) - ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(->)ident(options) operator(|=) ident(RE_OPTION_IGNORECASE)operator(;) - ident(need_recompile) operator(=) integer(1)operator(;) - operator(}) - reserved(if) operator((!)ident(ruby_ignorecase) operator(&&) ident(state)operator(\)) operator({) - ident(FL_UNSET)operator(()ident(re)operator(,) ident(REG_CASESTATE)operator(\);) - ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(->)ident(options) operator(&=) operator(~)ident(RE_OPTION_IGNORECASE)operator(;) - ident(need_recompile) operator(=) integer(1)operator(;) - operator(}) - - reserved(if) operator((!)ident(FL_TEST)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\)) operator(&&) - operator(()ident(RBASIC)operator(()ident(re)operator(\)->)ident(flags) operator(&) ident(KCODE_MASK)operator(\)) operator(!=) ident(reg_kcode)operator(\)) operator({) - ident(need_recompile) operator(=) integer(1)operator(;) - ident(RBASIC)operator(()ident(re)operator(\)->)ident(flags) operator(&=) operator(~)ident(KCODE_MASK)operator(;) - ident(RBASIC)operator(()ident(re)operator(\)->)ident(flags) operator(|=) ident(reg_kcode)operator(;) - operator(}) - - reserved(if) operator(()ident(need_recompile)operator(\)) operator({) - pre_type(char) operator(*)ident(err)operator(;) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\)\)) - ident(rb_kcode_set_option)operator(()ident(re)operator(\);) - ident(rb_reg_check)operator(()ident(re)operator(\);) - ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(->)ident(fastmap_accurate) operator(=) integer(0)operator(;) - ident(err) operator(=) ident(re_compile_pattern)operator(()ident(RREGEXP)operator(()ident(re)operator(\)->)ident(str)operator(,) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(len)operator(,) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(\);) - reserved(if) operator(()ident(err) operator(!=) pre_constant(NULL)operator(\)) operator({) - ident(rb_reg_raise)operator(()ident(RREGEXP)operator(()ident(re)operator(\)->)ident(str)operator(,) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(len)operator(,) ident(err)operator(,) ident(re)operator(\);) - operator(}) - operator(}) -operator(}) - -pre_type(long) -ident(rb_reg_adjust_startpos)operator(()ident(re)operator(,) ident(str)operator(,) ident(pos)operator(,) ident(reverse)operator(\)) - ident(VALUE) ident(re)operator(,) ident(str)operator(;) - pre_type(long) ident(pos)operator(,) ident(reverse)operator(;) -operator({) - pre_type(long) ident(range)operator(;) - - ident(rb_reg_check)operator(()ident(re)operator(\);) - reserved(if) operator(()ident(may_need_recompile)operator(\)) ident(rb_reg_prepare_re)operator(()ident(re)operator(\);) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\)\)) - ident(rb_kcode_set_option)operator(()ident(re)operator(\);) - reserved(else) reserved(if) operator(()ident(reg_kcode) operator(!=) ident(curr_kcode)operator(\)) - ident(rb_kcode_reset_option)operator((\);) - - reserved(if) operator(()ident(reverse)operator(\)) operator({) - ident(range) operator(=) operator(-)ident(pos)operator(;) - operator(}) - reserved(else) operator({) - ident(range) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(pos)operator(;) - operator(}) - reserved(return) ident(re_adjust_startpos)operator(()ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(,) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) - ident(pos)operator(,) ident(range)operator(\);) -operator(}) - -pre_type(long) -ident(rb_reg_search)operator(()ident(re)operator(,) ident(str)operator(,) ident(pos)operator(,) ident(reverse)operator(\)) - ident(VALUE) ident(re)operator(,) ident(str)operator(;) - pre_type(long) ident(pos)operator(,) ident(reverse)operator(;) -operator({) - pre_type(long) ident(result)operator(;) - ident(VALUE) ident(match)operator(;) - reserved(struct) ident(re_registers) ident(regs)operator(;) - pre_type(long) ident(range)operator(;) - - reserved(if) operator(()ident(pos) operator(>) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(||) ident(pos) operator(<) integer(0)operator(\)) operator({) - ident(rb_backref_set)operator(()ident(Qnil)operator(\);) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - - ident(rb_reg_check)operator(()ident(re)operator(\);) - reserved(if) operator(()ident(may_need_recompile)operator(\)) ident(rb_reg_prepare_re)operator(()ident(re)operator(\);) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\)\)) - ident(rb_kcode_set_option)operator(()ident(re)operator(\);) - reserved(else) reserved(if) operator(()ident(reg_kcode) operator(!=) ident(curr_kcode)operator(\)) - ident(rb_kcode_reset_option)operator((\);) - - reserved(if) operator(()ident(reverse)operator(\)) operator({) - ident(range) operator(=) operator(-)ident(pos)operator(;) - operator(}) - reserved(else) operator({) - ident(range) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(pos)operator(;) - operator(}) - ident(MEMZERO)operator((&)ident(regs)operator(,) reserved(struct) ident(re_registers)operator(,) integer(1)operator(\);) - ident(result) operator(=) ident(re_search)operator(()ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(,)ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) - ident(pos)operator(,) ident(range)operator(,) operator(&)ident(regs)operator(\);) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\)\)) - ident(rb_kcode_reset_option)operator((\);) - - reserved(if) operator(()ident(result) operator(==) operator(-)integer(2)operator(\)) operator({) - ident(rb_reg_raise)operator(()ident(RREGEXP)operator(()ident(re)operator(\)->)ident(str)operator(,) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(len)operator(,) - stringoperator(,) ident(re)operator(\);) - operator(}) - - reserved(if) operator(()ident(result) operator(<) integer(0)operator(\)) operator({) - ident(re_free_registers)operator((&)ident(regs)operator(\);) - ident(rb_backref_set)operator(()ident(Qnil)operator(\);) - reserved(return) ident(result)operator(;) - operator(}) - - ident(match) operator(=) ident(rb_backref_get)operator((\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(match)operator(\)) operator(||) ident(FL_TEST)operator(()ident(match)operator(,) ident(MATCH_BUSY)operator(\)\)) operator({) - ident(match) operator(=) ident(match_alloc)operator(()ident(rb_cMatch)operator(\);) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(3)operator(\)) - ident(OBJ_TAINT)operator(()ident(match)operator(\);) - reserved(else) - ident(FL_UNSET)operator(()ident(match)operator(,) ident(FL_TAINT)operator(\);) - operator(}) - - ident(re_copy_registers)operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(,) operator(&)ident(regs)operator(\);) - ident(re_free_registers)operator((&)ident(regs)operator(\);) - ident(RMATCH)operator(()ident(match)operator(\)->)ident(str) operator(=) ident(rb_str_new4)operator(()ident(str)operator(\);) - ident(rb_backref_set)operator(()ident(match)operator(\);) - - ident(OBJ_INFECT)operator(()ident(match)operator(,) ident(re)operator(\);) - ident(OBJ_INFECT)operator(()ident(match)operator(,) ident(str)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - -ident(VALUE) -ident(rb_reg_nth_defined)operator(()ident(nth)operator(,) ident(match)operator(\)) - pre_type(int) ident(nth)operator(;) - ident(VALUE) ident(match)operator(;) -operator({) - reserved(if) operator(()ident(NIL_P)operator(()ident(match)operator(\)\)) reserved(return) ident(Qnil)operator(;) - ident(match_check)operator(()ident(match)operator(\);) - reserved(if) operator(()ident(nth) operator(>=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs)operator(\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(if) operator(()ident(nth) operator(<) integer(0)operator(\)) operator({) - ident(nth) operator(+=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs)operator(;) - reserved(if) operator(()ident(nth) operator(<=) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(if) operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(BEG)operator(()ident(nth)operator(\)) operator(==) operator(-)integer(1)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -ident(VALUE) -ident(rb_reg_nth_match)operator(()ident(nth)operator(,) ident(match)operator(\)) - pre_type(int) ident(nth)operator(;) - ident(VALUE) ident(match)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - pre_type(long) ident(start)operator(,) ident(end)operator(,) ident(len)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(match)operator(\)\)) reserved(return) ident(Qnil)operator(;) - ident(match_check)operator(()ident(match)operator(\);) - reserved(if) operator(()ident(nth) operator(>=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs)operator(\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(if) operator(()ident(nth) operator(<) integer(0)operator(\)) operator({) - ident(nth) operator(+=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs)operator(;) - reserved(if) operator(()ident(nth) operator(<=) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - operator(}) - ident(start) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(BEG)operator(()ident(nth)operator(\);) - reserved(if) operator(()ident(start) operator(==) operator(-)integer(1)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(end) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(END)operator(()ident(nth)operator(\);) - ident(len) operator(=) ident(end) operator(-) ident(start)operator(;) - ident(str) operator(=) ident(rb_str_substr)operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(str)operator(,) ident(start)operator(,) ident(len)operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(match)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_reg_last_match)operator(()ident(match)operator(\)) - ident(VALUE) ident(match)operator(;) -operator({) - reserved(return) ident(rb_reg_nth_match)operator(()integer(0)operator(,) ident(match)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * mtch.pre_match => str - * - * Returns the portion of the original string before the current match. - * Equivalent to the special variable $`. - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138."\) - * m.pre_match #=> "T" - */) - -ident(VALUE) -ident(rb_reg_match_pre)operator(()ident(match)operator(\)) - ident(VALUE) ident(match)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(match)operator(\)\)) reserved(return) ident(Qnil)operator(;) - ident(match_check)operator(()ident(match)operator(\);) - reserved(if) operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(BEG)operator(()integer(0)operator(\)) operator(==) operator(-)integer(1)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(str) operator(=) ident(rb_str_substr)operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(str)operator(,) integer(0)operator(,) ident(RMATCH)operator(()ident(match)operator(\)->)ident(BEG)operator(()integer(0)operator(\)\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(match)operator(\)\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * mtch.post_match => str - * - * Returns the portion of the original string after the current match. - * Equivalent to the special variable $'. - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138: The Movie"\) - * m.post_match #=> ": The Movie" - */) - -ident(VALUE) -ident(rb_reg_match_post)operator(()ident(match)operator(\)) - ident(VALUE) ident(match)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - pre_type(long) ident(pos)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(match)operator(\)\)) reserved(return) ident(Qnil)operator(;) - ident(match_check)operator(()ident(match)operator(\);) - reserved(if) operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(BEG)operator(()integer(0)operator(\)) operator(==) operator(-)integer(1)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(str) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(str)operator(;) - ident(pos) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(END)operator(()integer(0)operator(\);) - ident(str) operator(=) ident(rb_str_substr)operator(()ident(str)operator(,) ident(pos)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(pos)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(match)operator(\)\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_reg_match_last)operator(()ident(match)operator(\)) - ident(VALUE) ident(match)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(match)operator(\)\)) reserved(return) ident(Qnil)operator(;) - ident(match_check)operator(()ident(match)operator(\);) - reserved(if) operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(BEG)operator(()integer(0)operator(\)) operator(==) operator(-)integer(1)operator(\)) reserved(return) ident(Qnil)operator(;) - - reserved(for) operator(()ident(i)operator(=)ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs)operator(-)integer(1)operator(;) ident(RMATCH)operator(()ident(match)operator(\)->)ident(BEG)operator(()ident(i)operator(\)) operator(==) operator(-)integer(1) operator(&&) ident(i) operator(>) integer(0)operator(;) ident(i)operator(--\)) - operator(;) - reserved(if) operator(()ident(i) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(rb_reg_nth_match)operator(()ident(i)operator(,) ident(match)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(last_match_getter)operator((\)) -operator({) - reserved(return) ident(rb_reg_last_match)operator(()ident(rb_backref_get)operator((\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(prematch_getter)operator((\)) -operator({) - reserved(return) ident(rb_reg_match_pre)operator(()ident(rb_backref_get)operator((\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(postmatch_getter)operator((\)) -operator({) - reserved(return) ident(rb_reg_match_post)operator(()ident(rb_backref_get)operator((\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(last_paren_match_getter)operator((\)) -operator({) - reserved(return) ident(rb_reg_match_last)operator(()ident(rb_backref_get)operator((\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(match_array)operator(()ident(match)operator(,) ident(start)operator(\)) - ident(VALUE) ident(match)operator(;) - pre_type(int) ident(start)operator(;) -operator({) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) - ident(VALUE) ident(ary)operator(;) - ident(VALUE) ident(target)operator(;) - pre_type(int) ident(i)operator(;) - pre_type(int) ident(taint) operator(=) ident(OBJ_TAINTED)operator(()ident(match)operator(\);) - - ident(match_check)operator(()ident(match)operator(\);) - ident(regs) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(;) - ident(ary) operator(=) ident(rb_ary_new2)operator(()ident(regs)operator(->)ident(num_regs)operator(\);) - ident(target) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(str)operator(;) - - reserved(for) operator(()ident(i)operator(=)ident(start)operator(;) ident(i)operator(<)ident(regs)operator(->)ident(num_regs)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(regs)operator(->)ident(beg)operator([)ident(i)operator(]) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(Qnil)operator(\);) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(str) operator(=) ident(rb_str_substr)operator(()ident(target)operator(,) ident(regs)operator(->)ident(beg)operator([)ident(i)operator(],) ident(regs)operator(->)ident(end)operator([)ident(i)operator(]-)ident(regs)operator(->)ident(beg)operator([)ident(i)operator(]\);) - reserved(if) operator(()ident(taint)operator(\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(str)operator(\);) - operator(}) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - - -comment(/* [MG]:FIXME: I put parens around the /.../.match(\) in the first line of the - second example to prevent the '*' followed by a '/' from ending the - comment. */) - -comment(/* - * call-seq: - * mtch.to_a => anArray - * - * Returns the array of matches. - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138."\) - * m.to_a #=> ["HX1138", "H", "X", "113", "8"] - * - * Because to_a is called when expanding - * *variable, there's a useful assignment - * shortcut for extracting matched fields. This is slightly slower than - * accessing the fields directly (as an intermediate array is - * generated\). - * - * all,f1,f2,f3 = *(/(.\)(.\)(\\d+\)(\\d\)/.match("THX1138."\)\) - * all #=> "HX1138" - * f1 #=> "H" - * f2 #=> "X" - * f3 #=> "113" - */) - -directive(static) ident(VALUE) -ident(match_to_a)operator(()ident(match)operator(\)) - ident(VALUE) ident(match)operator(;) -operator({) - reserved(return) ident(match_array)operator(()ident(match)operator(,) integer(0)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * mtch.captures => array - * - * Returns the array of captures; equivalent to mtch.to_a[1..-1]. - * - * f1,f2,f3,f4 = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138."\).captures - * f1 #=> "H" - * f2 #=> "X" - * f3 #=> "113" - * f4 #=> "8" - */) -directive(static) ident(VALUE) -ident(match_captures)operator(()ident(match)operator(\)) - ident(VALUE) ident(match)operator(;) -operator({) - reserved(return) ident(match_array)operator(()ident(match)operator(,) integer(1)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * mtch[i] => obj - * mtch[start, length] => array - * mtch[range] => array - * - * Match Reference---MatchData acts as an array, and may be - * accessed using the normal array indexing techniques. mtch[0] is - * equivalent to the special variable $&, and returns the entire - * matched string. mtch[1], mtch[2], and so on return the values - * of the matched backreferences (portions of the pattern between parentheses\). - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138."\) - * m[0] #=> "HX1138" - * m[1, 2] #=> ["H", "X"] - * m[1..3] #=> ["H", "X", "113"] - * m[-3, 2] #=> ["X", "113"] - */) - -directive(static) ident(VALUE) -ident(match_aref)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(match)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(match)operator(;) -operator({) - ident(VALUE) ident(idx)operator(,) ident(rest)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(idx)operator(,) operator(&)ident(rest)operator(\);) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(rest)operator(\)) operator(||) operator(!)ident(FIXNUM_P)operator(()ident(idx)operator(\)) operator(||) ident(FIX2INT)operator(()ident(idx)operator(\)) operator(<) integer(0)operator(\)) operator({) - reserved(return) ident(rb_ary_aref)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(match_to_a)operator(()ident(match)operator(\)\);) - operator(}) - reserved(return) ident(rb_reg_nth_match)operator(()ident(FIX2INT)operator(()ident(idx)operator(\),) ident(match)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(match_entry) ident(_)operator((()ident(VALUE)operator(,) pre_type(long)operator(\)\);) -directive(static) ident(VALUE) -ident(match_entry)operator(()ident(match)operator(,) ident(n)operator(\)) - ident(VALUE) ident(match)operator(;) - pre_type(long) ident(n)operator(;) -operator({) - reserved(return) ident(rb_reg_nth_match)operator(()ident(n)operator(,) ident(match)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * mtch.select([index]*\) => array - * - * Uses each index to access the matching values, returning an array of - * the corresponding matches. - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138: The Movie"\) - * m.to_a #=> ["HX1138", "H", "X", "113", "8"] - * m.select(0, 2, -2\) #=> ["HX1138", "X", "113"] - */) - -directive(static) ident(VALUE) -ident(match_values_at)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(match)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(match)operator(;) -operator({) - ident(match_check)operator(()ident(match)operator(\);) - reserved(return) ident(rb_values_at)operator(()ident(match)operator(,) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(match_entry)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * mtch.select([index]*\) => array - * - * Uses each index to access the matching values, returning an - * array of the corresponding matches. - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138: The Movie"\) - * m.to_a #=> ["HX1138", "H", "X", "113", "8"] - * m.select(0, 2, -2\) #=> ["HX1138", "X", "113"] - */) - -directive(static) ident(VALUE) -ident(match_select)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(match)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(match)operator(;) -operator({) - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - reserved(else) operator({) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) - ident(VALUE) ident(target)operator(;) - ident(VALUE) ident(result) operator(=) ident(rb_ary_new)operator((\);) - pre_type(int) ident(i)operator(;) - pre_type(int) ident(taint) operator(=) ident(OBJ_TAINTED)operator(()ident(match)operator(\);) - - ident(match_check)operator(()ident(match)operator(\);) - ident(regs) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(;) - ident(target) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(str)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(regs)operator(->)ident(num_regs)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(str) operator(=) ident(rb_str_substr)operator(()ident(target)operator(,) ident(regs)operator(->)ident(beg)operator([)ident(i)operator(],) ident(regs)operator(->)ident(end)operator([)ident(i)operator(]-)ident(regs)operator(->)ident(beg)operator([)ident(i)operator(]\);) - reserved(if) operator(()ident(taint)operator(\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield)operator(()ident(str)operator(\)\)\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(str)operator(\);) - operator(}) - operator(}) - reserved(return) ident(result)operator(;) - operator(}) -operator(}) - - -comment(/* - * call-seq: - * mtch.to_s => str - * - * Returns the entire matched string. - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138."\) - * m.to_s #=> "HX1138" - */) - -directive(static) ident(VALUE) -ident(match_to_s)operator(()ident(match)operator(\)) - ident(VALUE) ident(match)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(rb_reg_last_match)operator(()ident(match)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(str)operator(\)\)) ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,)integer(0)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(match)operator(\)\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(RMATCH)operator(()ident(match)operator(\)->)ident(str)operator(\)\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * mtch.string => str - * - * Returns a frozen copy of the string passed in to match. - * - * m = /(.\)(.\)(\\d+\)(\\d\)/.match("THX1138."\) - * m.string #=> "THX1138." - */) - -directive(static) ident(VALUE) -ident(match_string)operator(()ident(match)operator(\)) - ident(VALUE) ident(match)operator(;) -operator({) - ident(match_check)operator(()ident(match)operator(\);) - reserved(return) ident(RMATCH)operator(()ident(match)operator(\)->)ident(str)operator(;) comment(/* str is frozen */) -operator(}) - -ident(VALUE) ident(rb_cRegexp)operator(;) - -directive(static) directive(void) -ident(rb_reg_initialize)operator(()ident(obj)operator(,) ident(s)operator(,) ident(len)operator(,) ident(options)operator(\)) - ident(VALUE) ident(obj)operator(;) - directive(const) pre_type(char) operator(*)ident(s)operator(;) - pre_type(long) ident(len)operator(;) - pre_type(int) ident(options)operator(;) comment(/* CASEFOLD = 1 */) - comment(/* EXTENDED = 2 */) - comment(/* MULTILINE = 4 */) - comment(/* CODE_NONE = 16 */) - comment(/* CODE_EUC = 32 */) - comment(/* CODE_SJIS = 48 */) - comment(/* CODE_UTF8 = 64 */) -operator({) - reserved(struct) ident(RRegexp) operator(*)ident(re) operator(=) ident(RREGEXP)operator(()ident(obj)operator(\);) - - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(obj)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - ident(rb_check_frozen)operator(()ident(obj)operator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(REG_LITERAL)operator(\)\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(re)operator(->)ident(ptr)operator(\)) ident(re_free_pattern)operator(()ident(re)operator(->)ident(ptr)operator(\);) - reserved(if) operator(()ident(re)operator(->)ident(str)operator(\)) ident(free)operator(()ident(re)operator(->)ident(str)operator(\);) - ident(re)operator(->)ident(ptr) operator(=) integer(0)operator(;) - ident(re)operator(->)ident(str) operator(=) integer(0)operator(;) - - reserved(switch) operator(()ident(options) operator(&) operator(~)hex(0xf)operator(\)) operator({) - reserved(case) integer(0)operator(:) - reserved(default)operator(:) - ident(FL_SET)operator(()ident(re)operator(,) ident(reg_kcode)operator(\);) - reserved(break)operator(;) - reserved(case) integer(16)operator(:) - ident(kcode_none)operator(()ident(re)operator(\);) - reserved(break)operator(;) - reserved(case) integer(32)operator(:) - ident(kcode_euc)operator(()ident(re)operator(\);) - reserved(break)operator(;) - reserved(case) integer(48)operator(:) - ident(kcode_sjis)operator(()ident(re)operator(\);) - reserved(break)operator(;) - reserved(case) integer(64)operator(:) - ident(kcode_utf8)operator(()ident(re)operator(\);) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(()ident(options) operator(&) operator(~)hex(0xf)operator(\)) operator({) - ident(rb_kcode_set_option)operator((()ident(VALUE)operator(\))ident(re)operator(\);) - operator(}) - reserved(if) operator(()ident(ruby_ignorecase)operator(\)) operator({) - ident(options) operator(|=) ident(RE_OPTION_IGNORECASE)operator(;) - ident(FL_SET)operator(()ident(re)operator(,) ident(REG_CASESTATE)operator(\);) - operator(}) - ident(re)operator(->)ident(ptr) operator(=) ident(make_regexp)operator(()ident(s)operator(,) ident(len)operator(,) ident(options) operator(&) hex(0xf)operator(\);) - ident(re)operator(->)ident(str) operator(=) ident(ALLOC_N)operator(()pre_type(char)operator(,) ident(len)operator(+)integer(1)operator(\);) - ident(memcpy)operator(()ident(re)operator(->)ident(str)operator(,) ident(s)operator(,) ident(len)operator(\);) - ident(re)operator(->)ident(str)operator([)ident(len)operator(]) operator(=) char('\\0')operator(;) - ident(re)operator(->)ident(len) operator(=) ident(len)operator(;) - reserved(if) operator(()ident(options) operator(&) operator(~)hex(0xf)operator(\)) operator({) - ident(rb_kcode_reset_option)operator((\);) - operator(}) - reserved(if) operator(()ident(ruby_in_compile)operator(\)) ident(FL_SET)operator(()ident(obj)operator(,) ident(REG_LITERAL)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(rb_reg_s_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(rb_reg_s_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(re)operator(,) reserved(struct) ident(RRegexp)operator(\);) - ident(OBJSETUP)operator(()ident(re)operator(,) ident(klass)operator(,) ident(T_REGEXP)operator(\);) - - ident(re)operator(->)ident(ptr) operator(=) integer(0)operator(;) - ident(re)operator(->)ident(len) operator(=) integer(0)operator(;) - ident(re)operator(->)ident(str) operator(=) integer(0)operator(;) - - reserved(return) operator(()ident(VALUE)operator(\))ident(re)operator(;) -operator(}) - -ident(VALUE) -ident(rb_reg_new)operator(()ident(s)operator(,) ident(len)operator(,) ident(options)operator(\)) - directive(const) pre_type(char) operator(*)ident(s)operator(;) - pre_type(long) ident(len)operator(;) - pre_type(int) ident(options)operator(;) -operator({) - ident(VALUE) ident(re) operator(=) ident(rb_reg_s_alloc)operator(()ident(rb_cRegexp)operator(\);) - - ident(rb_reg_initialize)operator(()ident(re)operator(,) ident(s)operator(,) ident(len)operator(,) ident(options)operator(\);) - reserved(return) operator(()ident(VALUE)operator(\))ident(re)operator(;) -operator(}) - -directive(static) pre_type(int) ident(case_cache)operator(;) -directive(static) pre_type(int) ident(kcode_cache)operator(;) -directive(static) ident(VALUE) ident(reg_cache)operator(;) - -ident(VALUE) -ident(rb_reg_regcomp)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(save_str) operator(=) ident(str)operator(;) - reserved(if) operator(()ident(reg_cache) operator(&&) ident(RREGEXP)operator(()ident(reg_cache)operator(\)->)ident(len) operator(==) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) - operator(&&) ident(case_cache) operator(==) ident(ruby_ignorecase) - operator(&&) ident(kcode_cache) operator(==) ident(reg_kcode) - operator(&&) ident(memcmp)operator(()ident(RREGEXP)operator(()ident(reg_cache)operator(\)->)ident(str)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator(==) integer(0)operator(\)) - reserved(return) ident(reg_cache)operator(;) - - ident(case_cache) operator(=) ident(ruby_ignorecase)operator(;) - ident(kcode_cache) operator(=) ident(reg_kcode)operator(;) - reserved(return) ident(reg_cache) operator(=) ident(rb_reg_new)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) - ident(ruby_ignorecase)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(rb_reg_cur_kcode)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\)\)) operator({) - reserved(return) ident(RBASIC)operator(()ident(re)operator(\)->)ident(flags) operator(&) ident(KCODE_MASK)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -comment(/* - * call-seq: - * rxp.hash => fixnum - * - * Produce a hash based on the text and options of this regular expression. - */) - -directive(static) ident(VALUE) -ident(rb_reg_hash)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - pre_type(int) ident(hashval)operator(,) ident(len)operator(;) - pre_type(char) operator(*)ident(p)operator(;) - - ident(rb_reg_check)operator(()ident(re)operator(\);) - ident(hashval) operator(=) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(->)ident(options)operator(;) - ident(len) operator(=) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(len)operator(;) - ident(p) operator(=) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(str)operator(;) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(hashval) operator(=) ident(hashval) operator(*) integer(33) operator(+) operator(*)ident(p)operator(++;) - operator(}) - ident(hashval) operator(=) ident(hashval) operator(+) operator(()ident(hashval)operator(>>)integer(5)operator(\);) - - reserved(return) ident(INT2FIX)operator(()ident(hashval)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * rxp == other_rxp => true or false - * rxp.eql?(other_rxp\) => true or false - * - * Equality---Two regexps are equal if their patterns are identical, they have - * the same character set code, and their casefold? values are the - * same. - * - * /abc/ == /abc/x #=> false - * /abc/ == /abc/i #=> false - * /abc/u == /abc/n #=> false - */) - -directive(static) ident(VALUE) -ident(rb_reg_equal)operator(()ident(re1)operator(,) ident(re2)operator(\)) - ident(VALUE) ident(re1)operator(,) ident(re2)operator(;) -operator({) - reserved(if) operator(()ident(re1) operator(==) ident(re2)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(re2)operator(\)) operator(!=) ident(T_REGEXP)operator(\)) reserved(return) ident(Qfalse)operator(;) - ident(rb_reg_check)operator(()ident(re1)operator(\);) ident(rb_reg_check)operator(()ident(re2)operator(\);) - reserved(if) operator(()ident(RREGEXP)operator(()ident(re1)operator(\)->)ident(len) operator(!=) ident(RREGEXP)operator(()ident(re2)operator(\)->)ident(len)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(memcmp)operator(()ident(RREGEXP)operator(()ident(re1)operator(\)->)ident(str)operator(,) ident(RREGEXP)operator(()ident(re2)operator(\)->)ident(str)operator(,) ident(RREGEXP)operator(()ident(re1)operator(\)->)ident(len)operator(\)) operator(==) integer(0) operator(&&) - ident(rb_reg_cur_kcode)operator(()ident(re1)operator(\)) operator(==) ident(rb_reg_cur_kcode)operator(()ident(re2)operator(\)) operator(&&) - ident(RREGEXP)operator(()ident(re1)operator(\)->)ident(ptr)operator(->)ident(options) operator(==) ident(RREGEXP)operator(()ident(re2)operator(\)->)ident(ptr)operator(->)ident(options)operator(\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - - -comment(/* - * call-seq: - * rxp.match(str\) => matchdata or nil - * - * Returns a MatchData object describing the match, or - * nil if there was no match. This is equivalent to retrieving the - * value of the special variable $~ following a normal match. - * - * /(.\)(.\)(.\)/.match("abc"\)[2] #=> "b" - */) - -ident(VALUE) -ident(rb_reg_match)operator(()ident(re)operator(,) ident(str)operator(\)) - ident(VALUE) ident(re)operator(,) ident(str)operator(;) -operator({) - pre_type(long) ident(start)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(rb_backref_set)operator(()ident(Qnil)operator(\);) - reserved(return) ident(Qnil)operator(;) - operator(}) - ident(StringValue)operator(()ident(str)operator(\);) - ident(start) operator(=) ident(rb_reg_search)operator(()ident(re)operator(,) ident(str)operator(,) integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(start) operator(<) integer(0)operator(\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(LONG2FIX)operator(()ident(start)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * rxp === str => true or false - * - * Case Equality---Synonym for Regexp#=~ used in case statements. - * - * a = "HELLO" - * case a - * when /^[a-z]*$/; print "Lower case\\n" - * when /^[A-Z]*$/; print "Upper case\\n" - * else; print "Mixed case\\n" - * end - * - * produces: - * - * Upper case - */) - -ident(VALUE) -ident(rb_reg_eqq)operator(()ident(re)operator(,) ident(str)operator(\)) - ident(VALUE) ident(re)operator(,) ident(str)operator(;) -operator({) - pre_type(long) ident(start)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(str)operator(\)) operator(!=) ident(T_STRING)operator(\)) operator({) - ident(str) operator(=) ident(rb_check_string_type)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(rb_backref_set)operator(()ident(Qnil)operator(\);) - reserved(return) ident(Qfalse)operator(;) - operator(}) - operator(}) - ident(StringValue)operator(()ident(str)operator(\);) - ident(start) operator(=) ident(rb_reg_search)operator(()ident(re)operator(,) ident(str)operator(,) integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(start) operator(<) integer(0)operator(\)) operator({) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(Qtrue)operator(;) -operator(}) - - -comment(/* - * call-seq: - * ~ rxp => integer or nil - * - * Match---Matches rxp against the contents of $_. - * Equivalent to rxp =~ $_. - * - * $_ = "input data" - * ~ /at/ #=> 7 - */) - -ident(VALUE) -ident(rb_reg_match2)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - pre_type(long) ident(start)operator(;) - ident(VALUE) ident(line) operator(=) ident(rb_lastline_get)operator((\);) - - reserved(if) operator(()ident(TYPE)operator(()ident(line)operator(\)) operator(!=) ident(T_STRING)operator(\)) operator({) - ident(rb_backref_set)operator(()ident(Qnil)operator(\);) - reserved(return) ident(Qnil)operator(;) - operator(}) - - ident(start) operator(=) ident(rb_reg_search)operator(()ident(re)operator(,) ident(line)operator(,) integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(start) operator(<) integer(0)operator(\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(LONG2FIX)operator(()ident(start)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * rxp.match(str\) => matchdata or nil - * - * Returns a MatchData object describing the match, or - * nil if there was no match. This is equivalent to retrieving the - * value of the special variable $~ following a normal match. - * - * /(.\)(.\)(.\)/.match("abc"\)[2] #=> "b" - */) - -directive(static) ident(VALUE) -ident(rb_reg_match_m)operator(()ident(re)operator(,) ident(str)operator(\)) - ident(VALUE) ident(re)operator(,) ident(str)operator(;) -operator({) - ident(VALUE) ident(result) operator(=) ident(rb_reg_match)operator(()ident(re)operator(,) ident(str)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(result)operator(\)\)) reserved(return) ident(Qnil)operator(;) - ident(result) operator(=) ident(rb_backref_get)operator((\);) - ident(rb_match_busy)operator(()ident(result)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * Document-method: compile - * - * Synonym for Regexp.new - */) - -comment(/* - * call-seq: - * Regexp.new(string [, options [, lang]]\) => regexp - * Regexp.new(regexp\) => regexp - * Regexp.compile(string [, options [, lang]]\) => regexp - * Regexp.compile(regexp\) => regexp - * - * Constructs a new regular expression from pattern, which can be either - * a String or a Regexp (in which case that regexp's - * options are propagated, and new options may not be specified (a change as of - * Ruby 1.8\). If options is a Fixnum, it should be one or - * more of the constants Regexp::EXTENDED, - * Regexp::IGNORECASE, and Regexp::MULTILINE, - * or-ed together. Otherwise, if options is not - * nil, the regexp will be case insensitive. The lang - * parameter enables multibyte support for the regexp: `n', `N' = none, `e', - * `E' = EUC, `s', `S' = SJIS, `u', `U' = UTF-8. - * - * r1 = Regexp.new('^a-z+:\\\\s+\\w+'\) #=> /^a-z+:\\s+\\w+/ - * r2 = Regexp.new('cat', true\) #=> /cat/i - * r3 = Regexp.new('dog', Regexp::EXTENDED\) #=> /dog/x - * r4 = Regexp.new(r2\) #=> /cat/i - */) - -directive(static) ident(VALUE) -ident(rb_reg_initialize_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(s)operator(;) - pre_type(long) ident(len)operator(;) - pre_type(int) ident(flags) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0) operator(||) ident(argc) operator(>) integer(3)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(==) ident(T_REGEXP)operator(\)) operator({) - reserved(if) operator(()ident(argc) operator(>) integer(1)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) operator(()ident(argc) operator(==) integer(3)operator(\)) operator(?) stringoperator(:) stringoperator(\);) - operator(}) - ident(rb_reg_check)operator(()ident(argv)operator([)integer(0)operator(]\);) - ident(flags) operator(=) ident(RREGEXP)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(ptr)operator(->)ident(options) operator(&) hex(0xf)operator(;) - reserved(if) operator(()ident(FL_TEST)operator(()ident(argv)operator([)integer(0)operator(],) ident(KCODE_FIXED)operator(\)\)) operator({) - reserved(switch) operator(()ident(RBASIC)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(flags) operator(&) ident(KCODE_MASK)operator(\)) operator({) - reserved(case) ident(KCODE_NONE)operator(:) - ident(flags) operator(|=) integer(16)operator(;) - reserved(break)operator(;) - reserved(case) ident(KCODE_EUC)operator(:) - ident(flags) operator(|=) integer(32)operator(;) - reserved(break)operator(;) - reserved(case) ident(KCODE_SJIS)operator(:) - ident(flags) operator(|=) integer(48)operator(;) - reserved(break)operator(;) - reserved(case) ident(KCODE_UTF8)operator(:) - ident(flags) operator(|=) integer(64)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) - ident(s) operator(=) ident(RREGEXP)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(str)operator(;) - ident(len) operator(=) ident(RREGEXP)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(len)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(argc) operator(>=) integer(2)operator(\)) operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(argv)operator([)integer(1)operator(]\)\)) ident(flags) operator(=) ident(FIX2INT)operator(()ident(argv)operator([)integer(1)operator(]\);) - reserved(else) reserved(if) operator(()ident(RTEST)operator(()ident(argv)operator([)integer(1)operator(]\)\)) ident(flags) operator(=) ident(RE_OPTION_IGNORECASE)operator(;) - operator(}) - reserved(if) operator(()ident(argc) operator(==) integer(3) operator(&&) operator(!)ident(NIL_P)operator(()ident(argv)operator([)integer(2)operator(]\)\)) operator({) - pre_type(char) operator(*)ident(kcode) operator(=) ident(StringValuePtr)operator(()ident(argv)operator([)integer(2)operator(]\);) - - ident(flags) operator(&=) operator(~)hex(0x70)operator(;) - reserved(switch) operator(()ident(kcode)operator([)integer(0)operator(]\)) operator({) - reserved(case) char('n')operator(:) reserved(case) char('N')operator(:) - ident(flags) operator(|=) integer(16)operator(;) - reserved(break)operator(;) - reserved(case) char('e')operator(:) reserved(case) char('E')operator(:) - ident(flags) operator(|=) integer(32)operator(;) - reserved(break)operator(;) - reserved(case) char('s')operator(:) reserved(case) char('S')operator(:) - ident(flags) operator(|=) integer(48)operator(;) - reserved(break)operator(;) - reserved(case) char('u')operator(:) reserved(case) char('U')operator(:) - ident(flags) operator(|=) integer(64)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) - ident(s) operator(=) ident(StringValuePtr)operator(()ident(argv)operator([)integer(0)operator(]\);) - ident(len) operator(=) ident(RSTRING)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(len)operator(;) - operator(}) - ident(rb_reg_initialize)operator(()ident(self)operator(,) ident(s)operator(,) ident(len)operator(,) ident(flags)operator(\);) - reserved(return) ident(self)operator(;) -operator(}) - -ident(VALUE) -ident(rb_reg_quote)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(send)operator(,) operator(*)ident(t)operator(;) - ident(VALUE) ident(tmp)operator(;) - pre_type(int) ident(c)operator(;) - - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(send) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(for) operator((;) ident(s) operator(<) ident(send)operator(;) ident(s)operator(++\)) operator({) - ident(c) operator(=) operator(*)ident(s)operator(;) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - pre_type(int) ident(n) operator(=) ident(mbclen)operator(()ident(c)operator(\);) - - reserved(while) operator(()ident(n)operator(--) operator(&&) ident(s) operator(<) ident(send)operator(\)) - ident(s)operator(++;) - ident(s)operator(--;) - reserved(continue)operator(;) - operator(}) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('[')operator(:) reserved(case) char(']')operator(:) reserved(case) char('{')operator(:) reserved(case) char('}')operator(:) - reserved(case) char('(')operator(:) reserved(case) char('\)')operator(:) reserved(case) char('|')operator(:) reserved(case) char('-')operator(:) - reserved(case) char('*')operator(:) reserved(case) char('.')operator(:) reserved(case) char('\\\\')operator(:) - reserved(case) char('?')operator(:) reserved(case) char('+')operator(:) reserved(case) char('^')operator(:) reserved(case) char('$')operator(:) - reserved(case) char(' ')operator(:) reserved(case) char('#')operator(:) - reserved(case) char('\\t')operator(:) reserved(case) char('\\f')operator(:) reserved(case) char('\\n')operator(:) reserved(case) char('\\r')operator(:) - reserved(goto) ident(meta_found)operator(;) - operator(}) - operator(}) - reserved(return) ident(rb_str_new3)operator(()ident(str)operator(\);) - - label(meta_found:) - ident(tmp) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(*)integer(2)operator(\);) - ident(t) operator(=) ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator(;) - comment(/* copy upto metacharacter */) - ident(memcpy)operator(()ident(t)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(s) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - ident(t) operator(+=) ident(s) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - - reserved(for) operator((;) ident(s) operator(<) ident(send)operator(;) ident(s)operator(++\)) operator({) - ident(c) operator(=) operator(*)ident(s)operator(;) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - pre_type(int) ident(n) operator(=) ident(mbclen)operator(()ident(c)operator(\);) - - reserved(while) operator(()ident(n)operator(--) operator(&&) ident(s) operator(<) ident(send)operator(\)) - operator(*)ident(t)operator(++) operator(=) operator(*)ident(s)operator(++;) - ident(s)operator(--;) - reserved(continue)operator(;) - operator(}) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('[')operator(:) reserved(case) char(']')operator(:) reserved(case) char('{')operator(:) reserved(case) char('}')operator(:) - reserved(case) char('(')operator(:) reserved(case) char('\)')operator(:) reserved(case) char('|')operator(:) reserved(case) char('-')operator(:) - reserved(case) char('*')operator(:) reserved(case) char('.')operator(:) reserved(case) char('\\\\')operator(:) - reserved(case) char('?')operator(:) reserved(case) char('+')operator(:) reserved(case) char('^')operator(:) reserved(case) char('$')operator(:) - reserved(case) char('#')operator(:) - operator(*)ident(t)operator(++) operator(=) char('\\\\')operator(;) - reserved(break)operator(;) - reserved(case) char(' ')operator(:) - operator(*)ident(t)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(t)operator(++) operator(=) char(' ')operator(;) - reserved(continue)operator(;) - reserved(case) char('\\t')operator(:) - operator(*)ident(t)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(t)operator(++) operator(=) char('t')operator(;) - reserved(continue)operator(;) - reserved(case) char('\\n')operator(:) - operator(*)ident(t)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(t)operator(++) operator(=) char('n')operator(;) - reserved(continue)operator(;) - reserved(case) char('\\r')operator(:) - operator(*)ident(t)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(t)operator(++) operator(=) char('r')operator(;) - reserved(continue)operator(;) - reserved(case) char('\\f')operator(:) - operator(*)ident(t)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(t)operator(++) operator(=) char('f')operator(;) - reserved(continue)operator(;) - operator(}) - operator(*)ident(t)operator(++) operator(=) ident(c)operator(;) - operator(}) - ident(rb_str_resize)operator(()ident(tmp)operator(,) ident(t) operator(-) ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator(\);) - ident(OBJ_INFECT)operator(()ident(tmp)operator(,) ident(str)operator(\);) - reserved(return) ident(tmp)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Regexp.escape(str\) => a_str - * Regexp.quote(str\) => a_str - * - * Escapes any characters that would have special meaning in a regular - * expression. Returns a new escaped string, or self if no characters are - * escaped. For any string, - * Regexp.escape(str\)=~str will be true. - * - * Regexp.escape('\\\\*?{}.'\) #=> \\\\\\\\\\*\\?\\{\\}\\. - */) - -directive(static) ident(VALUE) -ident(rb_reg_s_quote)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(str)operator(,) ident(kcode)operator(;) - pre_type(int) ident(kcode_saved) operator(=) ident(reg_kcode)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(str)operator(,) operator(&)ident(kcode)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(kcode)operator(\)\)) operator({) - ident(rb_set_kcode)operator(()ident(StringValuePtr)operator(()ident(kcode)operator(\)\);) - ident(curr_kcode) operator(=) ident(reg_kcode)operator(;) - ident(reg_kcode) operator(=) ident(kcode_saved)operator(;) - operator(}) - ident(StringValue)operator(()ident(str)operator(\);) - ident(str) operator(=) ident(rb_reg_quote)operator(()ident(str)operator(\);) - ident(rb_kcode_reset_option)operator((\);) - reserved(return) ident(str)operator(;) -operator(}) - -pre_type(int) -ident(rb_kcode)operator((\)) -operator({) - reserved(switch) operator(()ident(reg_kcode)operator(\)) operator({) - reserved(case) ident(KCODE_EUC)operator(:) - reserved(return) ident(MBCTYPE_EUC)operator(;) - reserved(case) ident(KCODE_SJIS)operator(:) - reserved(return) ident(MBCTYPE_SJIS)operator(;) - reserved(case) ident(KCODE_UTF8)operator(:) - reserved(return) ident(MBCTYPE_UTF8)operator(;) - reserved(case) ident(KCODE_NONE)operator(:) - reserved(return) ident(MBCTYPE_ASCII)operator(;) - operator(}) - ident(rb_bug)operator(()stringoperator(,) ident(reg_kcode)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(rb_reg_get_kcode)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - reserved(switch) operator(()ident(RBASIC)operator(()ident(re)operator(\)->)ident(flags) operator(&) ident(KCODE_MASK)operator(\)) operator({) - reserved(case) ident(KCODE_NONE)operator(:) - reserved(return) integer(16)operator(;) - reserved(case) ident(KCODE_EUC)operator(:) - reserved(return) integer(32)operator(;) - reserved(case) ident(KCODE_SJIS)operator(:) - reserved(return) integer(48)operator(;) - reserved(case) ident(KCODE_UTF8)operator(:) - reserved(return) integer(64)operator(;) - reserved(default)operator(:) - reserved(return) integer(0)operator(;) - operator(}) -operator(}) - -pre_type(int) -ident(rb_reg_options)operator(()ident(re)operator(\)) - ident(VALUE) ident(re)operator(;) -operator({) - pre_type(int) ident(options)operator(;) - - ident(rb_reg_check)operator(()ident(re)operator(\);) - ident(options) operator(=) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(ptr)operator(->)ident(options) operator(&) - operator(()ident(RE_OPTION_IGNORECASE)operator(|)ident(RE_OPTION_MULTILINE)operator(|)ident(RE_OPTION_EXTENDED)operator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(re)operator(,) ident(KCODE_FIXED)operator(\)\)) operator({) - ident(options) operator(|=) ident(rb_reg_get_kcode)operator(()ident(re)operator(\);) - operator(}) - reserved(return) ident(options)operator(;) -operator(}) - - -comment(/* - * call-seq: - * Regexp.union([pattern]*\) => new_str - * - * Return a Regexp object that is the union of the given - * patterns, i.e., will match any of its parts. The patterns - * can be Regexp objects, in which case their options will be preserved, or - * Strings. If no arguments are given, returns /(?!\)/. - * - * Regexp.union #=> /(?!\)/ - * Regexp.union("penzance"\) #=> /penzance/ - * Regexp.union("skiing", "sledding"\) #=> /skiing|sledding/ - * Regexp.union(/dogs/, /cats/i\) #=> /(?-mix:dogs\)|(?i-mx:cats\)/ - */) -directive(static) ident(VALUE) -ident(rb_reg_s_union)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - ident(VALUE) ident(args)operator([)integer(1)operator(];) - ident(args)operator([)integer(0)operator(]) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(return) ident(rb_class_new_instance)operator(()integer(1)operator(,) ident(args)operator(,) ident(rb_cRegexp)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - ident(VALUE) ident(v)operator(;) - ident(v) operator(=) ident(rb_check_convert_type)operator(()ident(argv)operator([)integer(0)operator(],) ident(T_REGEXP)operator(,) stringoperator(,) stringoperator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(v)operator(\)\)) - reserved(return) ident(v)operator(;) - reserved(else) operator({) - ident(VALUE) ident(args)operator([)integer(1)operator(];) - ident(args)operator([)integer(0)operator(]) operator(=) ident(rb_reg_s_quote)operator(()ident(argc)operator(,) ident(argv)operator(\);) - reserved(return) ident(rb_class_new_instance)operator(()integer(1)operator(,) ident(args)operator(,) ident(rb_cRegexp)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - pre_type(int) ident(i)operator(,) ident(kcode) operator(=) operator(-)integer(1)operator(;) - ident(VALUE) ident(kcode_re) operator(=) ident(Qnil)operator(;) - ident(VALUE) ident(source) operator(=) ident(rb_str_buf_new)operator(()integer(0)operator(\);) - ident(VALUE) ident(args)operator([)integer(3)operator(];) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(argc)operator(;) ident(i)operator(++\)) operator({) - directive(volatile) ident(VALUE) ident(v)operator(;) - reserved(if) operator(()integer(0) operator(<) ident(i)operator(\)) - ident(rb_str_buf_cat2)operator(()ident(source)operator(,) stringoperator(\);) - ident(v) operator(=) ident(rb_check_convert_type)operator(()ident(argv)operator([)ident(i)operator(],) ident(T_REGEXP)operator(,) stringoperator(,) stringoperator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(v)operator(\)\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(v)operator(,) ident(KCODE_FIXED)operator(\)\)) operator({) - reserved(if) operator(()ident(kcode) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(kcode_re) operator(=) ident(v)operator(;) - ident(kcode) operator(=) ident(RBASIC)operator(()ident(v)operator(\)->)ident(flags) operator(&) ident(KCODE_MASK)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(RBASIC)operator(()ident(v)operator(\)->)ident(flags) operator(&) ident(KCODE_MASK)operator(\)) operator(!=) ident(kcode)operator(\)) operator({) - directive(volatile) ident(VALUE) ident(str1)operator(,) ident(str2)operator(;) - ident(str1) operator(=) ident(rb_inspect)operator(()ident(kcode_re)operator(\);) - ident(str2) operator(=) ident(rb_inspect)operator(()ident(v)operator(\);) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(RSTRING)operator(()ident(str1)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator(\);) - operator(}) - operator(}) - ident(v) operator(=) ident(rb_reg_to_s)operator(()ident(v)operator(\);) - operator(}) - reserved(else) operator({) - ident(args)operator([)integer(0)operator(]) operator(=) ident(argv)operator([)ident(i)operator(];) - ident(v) operator(=) ident(rb_reg_s_quote)operator(()integer(1)operator(,) ident(args)operator(\);) - operator(}) - ident(rb_str_buf_append)operator(()ident(source)operator(,) ident(v)operator(\);) - operator(}) - ident(args)operator([)integer(0)operator(]) operator(=) ident(source)operator(;) - ident(args)operator([)integer(1)operator(]) operator(=) ident(Qnil)operator(;) - reserved(switch) operator(()ident(kcode)operator(\)) operator({) - reserved(case) operator(-)integer(1)operator(:) - ident(args)operator([)integer(2)operator(]) operator(=) ident(Qnil)operator(;) - reserved(break)operator(;) - reserved(case) ident(KCODE_NONE)operator(:) - ident(args)operator([)integer(2)operator(]) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_EUC)operator(:) - ident(args)operator([)integer(2)operator(]) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_SJIS)operator(:) - ident(args)operator([)integer(2)operator(]) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(break)operator(;) - reserved(case) ident(KCODE_UTF8)operator(:) - ident(args)operator([)integer(2)operator(]) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(break)operator(;) - operator(}) - reserved(return) ident(rb_class_new_instance)operator(()integer(3)operator(,) ident(args)operator(,) ident(rb_cRegexp)operator(\);) - operator(}) -operator(}) - -comment(/* :nodoc: */) -directive(static) ident(VALUE) -ident(rb_reg_init_copy)operator(()ident(copy)operator(,) ident(re)operator(\)) - ident(VALUE) ident(copy)operator(,) ident(re)operator(;) -operator({) - reserved(if) operator(()ident(copy) operator(==) ident(re)operator(\)) reserved(return) ident(copy)operator(;) - ident(rb_check_frozen)operator(()ident(copy)operator(\);) - comment(/* need better argument type check */) - reserved(if) operator((!)ident(rb_obj_is_instance_of)operator(()ident(re)operator(,) ident(rb_obj_class)operator(()ident(copy)operator(\)\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(rb_reg_check)operator(()ident(re)operator(\);) - ident(rb_reg_initialize)operator(()ident(copy)operator(,) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(str)operator(,) ident(RREGEXP)operator(()ident(re)operator(\)->)ident(len)operator(,) - ident(rb_reg_options)operator(()ident(re)operator(\)\);) - reserved(return) ident(copy)operator(;) -operator(}) - -ident(VALUE) -ident(rb_reg_regsub)operator(()ident(str)operator(,) ident(src)operator(,) ident(regs)operator(\)) - ident(VALUE) ident(str)operator(,) ident(src)operator(;) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) -operator({) - ident(VALUE) ident(val) operator(=) integer(0)operator(;) - pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(s)operator(,) operator(*)ident(e)operator(,) ident(c)operator(;) - pre_type(int) ident(no)operator(;) - - ident(p) operator(=) ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(e) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - - reserved(while) operator(()ident(s) operator(<) ident(e)operator(\)) operator({) - pre_type(char) operator(*)ident(ss) operator(=) ident(s)operator(;) - - ident(c) operator(=) operator(*)ident(s)operator(++;) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - ident(s) operator(+=) ident(mbclen)operator(()ident(c)operator(\)) operator(-) integer(1)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(!=) char('\\\\') operator(||) ident(s) operator(==) ident(e)operator(\)) reserved(continue)operator(;) - - reserved(if) operator((!)ident(val)operator(\)) operator({) - ident(val) operator(=) ident(rb_str_buf_new)operator(()ident(ss)operator(-)ident(p)operator(\);) - ident(rb_str_buf_cat)operator(()ident(val)operator(,) ident(p)operator(,) ident(ss)operator(-)ident(p)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_str_buf_cat)operator(()ident(val)operator(,) ident(p)operator(,) ident(ss)operator(-)ident(p)operator(\);) - operator(}) - - ident(c) operator(=) operator(*)ident(s)operator(++;) - ident(p) operator(=) ident(s)operator(;) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('0')operator(:) reserved(case) char('1')operator(:) reserved(case) char('2')operator(:) reserved(case) char('3')operator(:) reserved(case) char('4')operator(:) - reserved(case) char('5')operator(:) reserved(case) char('6')operator(:) reserved(case) char('7')operator(:) reserved(case) char('8')operator(:) reserved(case) char('9')operator(:) - ident(no) operator(=) ident(c) operator(-) char('0')operator(;) - reserved(break)operator(;) - reserved(case) char('&')operator(:) - ident(no) operator(=) integer(0)operator(;) - reserved(break)operator(;) - - reserved(case) char('`')operator(:) - ident(rb_str_buf_cat)operator(()ident(val)operator(,) ident(RSTRING)operator(()ident(src)operator(\)->)ident(ptr)operator(,) ident(BEG)operator(()integer(0)operator(\)\);) - reserved(continue)operator(;) - - reserved(case) char('\\'')operator(:) - ident(rb_str_buf_cat)operator(()ident(val)operator(,) ident(RSTRING)operator(()ident(src)operator(\)->)ident(ptr)operator(+)ident(END)operator(()integer(0)operator(\),) ident(RSTRING)operator(()ident(src)operator(\)->)ident(len)operator(-)ident(END)operator(()integer(0)operator(\)\);) - reserved(continue)operator(;) - - reserved(case) char('+')operator(:) - ident(no) operator(=) ident(regs)operator(->)ident(num_regs)operator(-)integer(1)operator(;) - reserved(while) operator(()ident(BEG)operator(()ident(no)operator(\)) operator(==) operator(-)integer(1) operator(&&) ident(no) operator(>) integer(0)operator(\)) ident(no)operator(--;) - reserved(if) operator(()ident(no) operator(==) integer(0)operator(\)) reserved(continue)operator(;) - reserved(break)operator(;) - - reserved(case) char('\\\\')operator(:) - ident(rb_str_buf_cat)operator(()ident(val)operator(,) ident(s)operator(-)integer(1)operator(,) integer(1)operator(\);) - reserved(continue)operator(;) - - reserved(default)operator(:) - ident(rb_str_buf_cat)operator(()ident(val)operator(,) ident(s)operator(-)integer(2)operator(,) integer(2)operator(\);) - reserved(continue)operator(;) - operator(}) - - reserved(if) operator(()ident(no) operator(>=) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(no) operator(>=) ident(regs)operator(->)ident(num_regs)operator(\)) reserved(continue)operator(;) - reserved(if) operator(()ident(BEG)operator(()ident(no)operator(\)) operator(==) operator(-)integer(1)operator(\)) reserved(continue)operator(;) - ident(rb_str_buf_cat)operator(()ident(val)operator(,) ident(RSTRING)operator(()ident(src)operator(\)->)ident(ptr)operator(+)ident(BEG)operator(()ident(no)operator(\),) ident(END)operator(()ident(no)operator(\)-)ident(BEG)operator(()ident(no)operator(\)\);) - operator(}) - operator(}) - - reserved(if) operator(()ident(p) operator(<) ident(e)operator(\)) operator({) - reserved(if) operator((!)ident(val)operator(\)) operator({) - ident(val) operator(=) ident(rb_str_buf_new)operator(()ident(e)operator(-)ident(p)operator(\);) - ident(rb_str_buf_cat)operator(()ident(val)operator(,) ident(p)operator(,) ident(e)operator(-)ident(p)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_str_buf_cat)operator(()ident(val)operator(,) ident(p)operator(,) ident(e)operator(-)ident(p)operator(\);) - operator(}) - operator(}) - reserved(if) operator((!)ident(val)operator(\)) reserved(return) ident(str)operator(;) - - reserved(return) ident(val)operator(;) -operator(}) - -directive(const) pre_type(char)operator(*) -ident(rb_get_kcode)operator((\)) -operator({) - reserved(switch) operator(()ident(reg_kcode)operator(\)) operator({) - reserved(case) ident(KCODE_SJIS)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(KCODE_EUC)operator(:) - reserved(return) stringoperator(;) - reserved(case) ident(KCODE_UTF8)operator(:) - reserved(return) stringoperator(;) - reserved(default)operator(:) - reserved(return) stringoperator(;) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(kcode_getter)operator((\)) -operator({) - reserved(return) ident(rb_str_new2)operator(()ident(rb_get_kcode)operator((\)\);) -operator(}) - -directive(void) -ident(rb_set_kcode)operator(()ident(code)operator(\)) - directive(const) pre_type(char) operator(*)ident(code)operator(;) -operator({) - reserved(if) operator(()ident(code) operator(==) integer(0)operator(\)) reserved(goto) ident(set_no_conversion)operator(;) - - reserved(switch) operator(()ident(code)operator([)integer(0)operator(]\)) operator({) - reserved(case) char('E')operator(:) - reserved(case) char('e')operator(:) - ident(reg_kcode) operator(=) ident(KCODE_EUC)operator(;) - ident(re_mbcinit)operator(()ident(MBCTYPE_EUC)operator(\);) - reserved(break)operator(;) - reserved(case) char('S')operator(:) - reserved(case) char('s')operator(:) - ident(reg_kcode) operator(=) ident(KCODE_SJIS)operator(;) - ident(re_mbcinit)operator(()ident(MBCTYPE_SJIS)operator(\);) - reserved(break)operator(;) - reserved(case) char('U')operator(:) - reserved(case) char('u')operator(:) - ident(reg_kcode) operator(=) ident(KCODE_UTF8)operator(;) - ident(re_mbcinit)operator(()ident(MBCTYPE_UTF8)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(case) char('N')operator(:) - reserved(case) char('n')operator(:) - reserved(case) char('A')operator(:) - reserved(case) char('a')operator(:) - label(set_no_conversion:) - ident(reg_kcode) operator(=) ident(KCODE_NONE)operator(;) - ident(re_mbcinit)operator(()ident(MBCTYPE_ASCII)operator(\);) - reserved(break)operator(;) - operator(}) -operator(}) - -directive(static) directive(void) -ident(kcode_setter)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - ident(may_need_recompile) operator(=) integer(1)operator(;) - ident(rb_set_kcode)operator(()ident(StringValuePtr)operator(()ident(val)operator(\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(ignorecase_getter)operator((\)) -operator({) - reserved(return) ident(ruby_ignorecase)operator(?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - -directive(static) directive(void) -ident(ignorecase_setter)operator(()ident(val)operator(,) ident(id)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(rb_warn)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - ident(may_need_recompile) operator(=) integer(1)operator(;) - ident(ruby_ignorecase) operator(=) ident(RTEST)operator(()ident(val)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(match_getter)operator((\)) -operator({) - ident(VALUE) ident(match) operator(=) ident(rb_backref_get)operator((\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(match)operator(\)\)) reserved(return) ident(Qnil)operator(;) - ident(rb_match_busy)operator(()ident(match)operator(\);) - reserved(return) ident(match)operator(;) -operator(}) - -directive(static) directive(void) -ident(match_setter)operator(()ident(val)operator(\)) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(val)operator(\)\)) operator({) - ident(Check_Type)operator(()ident(val)operator(,) ident(T_MATCH)operator(\);) - operator(}) - ident(rb_backref_set)operator(()ident(val)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Regexp.last_match => matchdata - * Regexp.last_match(fixnum\) => str - * - * The first form returns the MatchData object generated by the - * last successful pattern match. Equivalent to reading the global variable - * $~. The second form returns the nth field in this - * MatchData object. - * - * /c(.\)t/ =~ 'cat' #=> 0 - * Regexp.last_match #=> # - * Regexp.last_match(0\) #=> "cat" - * Regexp.last_match(1\) #=> "a" - * Regexp.last_match(2\) #=> nil - */) - -directive(static) ident(VALUE) -ident(rb_reg_s_last_match)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(nth)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(nth)operator(\)) operator(==) integer(1)operator(\)) operator({) - reserved(return) ident(rb_reg_nth_match)operator(()ident(NUM2INT)operator(()ident(nth)operator(\),) ident(rb_backref_get)operator((\)\);) - operator(}) - reserved(return) ident(match_getter)operator((\);) -operator(}) - - -comment(/* - * Document-class: Regexp - * - * A Regexp holds a regular expression, used to match a pattern - * against strings. Regexps are created using the /.../ and - * %r{...} literals, and by the Regexp::new - * constructor. - * - */) - -directive(void) -ident(Init_Regexp)operator((\)) -operator({) - ident(rb_eRegexpError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) - - ident(re_set_casetable)operator(()ident(casetable)operator(\);) -preprocessor(#if) ident(DEFAULT_KCODE) operator(==) ident(KCODE_EUC) - ident(re_mbcinit)operator(()ident(MBCTYPE_EUC)operator(\);) -preprocessor(#else) -preprocessor(#if) ident(DEFAULT_KCODE) operator(==) ident(KCODE_SJIS) - ident(re_mbcinit)operator(()ident(MBCTYPE_SJIS)operator(\);) -preprocessor(#else) -preprocessor(#if) ident(DEFAULT_KCODE) operator(==) ident(KCODE_UTF8) - ident(re_mbcinit)operator(()ident(MBCTYPE_UTF8)operator(\);) -preprocessor(#else) - ident(re_mbcinit)operator(()ident(MBCTYPE_ASCII)operator(\);) -preprocessor(#endif) -preprocessor(#endif) -preprocessor(#endif) - - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(match_getter)operator(,) ident(match_setter)operator(\);) - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(last_match_getter)operator(,) integer(0)operator(\);) - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(prematch_getter)operator(,) integer(0)operator(\);) - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(postmatch_getter)operator(,) integer(0)operator(\);) - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(last_paren_match_getter)operator(,) integer(0)operator(\);) - - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(ignorecase_getter)operator(,) ident(ignorecase_setter)operator(\);) - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(kcode_getter)operator(,) ident(kcode_setter)operator(\);) - ident(rb_define_virtual_variable)operator(()stringoperator(,) ident(kcode_getter)operator(,) ident(kcode_setter)operator(\);) - - ident(rb_cRegexp) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_define_alloc_func)operator(()ident(rb_cRegexp)operator(,) ident(rb_reg_s_alloc)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_class_new_instance)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_s_quote)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_s_quote)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_s_union)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_s_last_match)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_initialize_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_init_copy)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_hash)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_match)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_eqq)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_match2)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_match_m)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_source)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_casefold_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_options_m)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(rb_reg_kcode_m)operator(,) integer(0)operator(\);) - - ident(rb_define_const)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RE_OPTION_IGNORECASE)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RE_OPTION_EXTENDED)operator(\)\);) - ident(rb_define_const)operator(()ident(rb_cRegexp)operator(,) stringoperator(,) ident(INT2FIX)operator(()ident(RE_OPTION_MULTILINE)operator(\)\);) - - ident(rb_global_variable)operator((&)ident(reg_cache)operator(\);) - - ident(rb_cMatch) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(rb_cMatch)operator(\);) - ident(rb_define_alloc_func)operator(()ident(rb_cMatch)operator(,) ident(match_alloc)operator(\);) - ident(rb_undef_method)operator(()ident(CLASS_OF)operator(()ident(rb_cMatch)operator(\),) stringoperator(\);) - - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_init_copy)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_size)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_size)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_offset)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_begin)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_end)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_to_a)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_aref)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_captures)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_select)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_values_at)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(rb_reg_match_pre)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(rb_reg_match_post)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(rb_any_to_s)operator(,) integer(0)operator(\);) comment(/* in object.c */) - ident(rb_define_method)operator(()ident(rb_cMatch)operator(,) stringoperator(,) ident(match_string)operator(,) integer(0)operator(\);) -operator(}) -comment(/* Extended regular expression matching and search library. - Copyright (C\) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option\) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file LGPL. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */) -comment(/* Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto\) - Last change: May 21, 1993 by t^2 */) -comment(/* removed gapped buffer support, multiple syntax support by matz */) -comment(/* Perl5 extension added by matz */) -comment(/* UTF-8 extension added Jan 16 1999 by Yoshida Masato */) - -preprocessor(#include) include("config.h") - -preprocessor(#ifdef) ident(HAVE_STRING_H) -preprocessor(# include) include() -preprocessor(#else) -preprocessor(# include) include() -preprocessor(#endif) - -comment(/* We write fatal error messages on standard error. */) -preprocessor(#include) include() - -comment(/* isalpha(3\) etc. are used for the character classes. */) -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#ifndef) ident(PARAMS) -preprocessor(# if) ident(defined) ident(__GNUC__) operator(||) operator(()ident(defined) ident(__STDC__) operator(&&) ident(__STDC__)operator(\)) -preprocessor(# define) ident(PARAMS)operator(()ident(args)operator(\)) ident(args) -preprocessor(# else) -preprocessor(# define) ident(PARAMS)operator(()ident(args)operator(\)) operator((\)) -preprocessor(# endif) comment(/* GCC. */) -preprocessor(#endif) comment(/* Not PARAMS. */) - -preprocessor(#if) ident(defined)operator(()ident(STDC_HEADERS)operator(\)) -preprocessor(# include) include() -preprocessor(#else) -comment(/* We need this for `regex.h', and perhaps for the Emacs include files. */) -preprocessor(# include) include() -preprocessor(#endif) -preprocessor(#ifdef) ident(HAVE_STDLIB_H) -preprocessor(# include) include() -preprocessor(#endif) - -preprocessor(#if) operator(!)ident(defined)operator(()ident(__STDC__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(_MSC_VER)operator(\)) -preprocessor(# define) directive(volatile) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_PROTOTYPES) -preprocessor(# define) ident(_)operator(()ident(args)operator(\)) ident(args) -preprocessor(#else) -preprocessor(# define) ident(_)operator(()ident(args)operator(\)) operator((\)) -preprocessor(#endif) - -preprocessor(#ifdef) ident(RUBY_PLATFORM) -preprocessor(#include) include("defines.h") -preprocessor(#undef) ident(xmalloc) -preprocessor(#undef) ident(xrealloc) -preprocessor(#undef) ident(xcalloc) -preprocessor(#undef) ident(xfree) - -preprocessor(# define) ident(RUBY) -directive(extern) pre_type(int) ident(rb_prohibit_interrupt)operator(;) -directive(extern) pre_type(int) ident(rb_trap_pending)operator(;) -directive(void) ident(rb_trap_exec) ident(_)operator((()directive(void)operator(\)\);) - -preprocessor(# define) ident(CHECK_INTS) reserved(do) operator({)\ - reserved(if) operator((!)ident(rb_prohibit_interrupt)operator(\)) operator({)\ - reserved(if) operator(()ident(rb_trap_pending)operator(\)) ident(rb_trap_exec)operator((\);)\ - operator(})\ -operator(}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#endif) - -comment(/* Make alloca work the best possible way. */) -preprocessor(#ifdef) ident(__GNUC__) -preprocessor(# ifndef) ident(atarist) -preprocessor(# ifndef) ident(alloca) -preprocessor(# define) ident(alloca) ident(__builtin_alloca) -preprocessor(# endif) -preprocessor(# endif) comment(/* atarist */) -preprocessor(#else) -preprocessor(# ifdef) ident(HAVE_ALLOCA_H) -preprocessor(# include) include() -preprocessor(# else) -preprocessor(# ifdef) ident(_AIX) - preprocessor(#pragma) ident(alloca) -preprocessor(# else) -preprocessor(# ifndef) ident(alloca) comment(/* predefined by HP cc +Olibcalls */) -directive(void) operator(*)ident(alloca) operator((\);) -preprocessor(# endif) -preprocessor(# endif) comment(/* AIX */) -preprocessor(# endif) comment(/* HAVE_ALLOCA_H */) - -preprocessor(#endif) comment(/* __GNUC__ */) - -preprocessor(#ifdef) ident(HAVE_STRING_H) -preprocessor(# include) include() -preprocessor(#else) -preprocessor(# include) include() -preprocessor(#endif) - -preprocessor(#define) ident(xmalloc) ident(malloc) -preprocessor(#define) ident(xrealloc) ident(realloc) -preprocessor(#define) ident(xcalloc) ident(calloc) -preprocessor(#define) ident(xfree) ident(free) - -preprocessor(#ifdef) ident(C_ALLOCA) -preprocessor(#define) ident(FREE_VARIABLES)operator((\)) ident(alloca)operator(()integer(0)operator(\)) -preprocessor(#else) -preprocessor(#define) ident(FREE_VARIABLES)operator((\)) -preprocessor(#endif) - -preprocessor(#define) ident(FREE_AND_RETURN_VOID)operator(()ident(stackb)operator(\)) reserved(do) operator({) \ - ident(FREE_VARIABLES)operator((\);) \ - reserved(if) operator(()ident(stackb) operator(!=) ident(stacka)operator(\)) ident(xfree)operator(()ident(stackb)operator(\);) \ - reserved(return)operator(;) \ -operator(}) reserved(while)operator(()integer(0)operator(\)) - -preprocessor(#define) ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,)ident(val)operator(\)) reserved(do) operator({) \ - ident(FREE_VARIABLES)operator((\);) \ - reserved(if) operator(()ident(stackb) operator(!=) ident(stacka)operator(\)) ident(xfree)operator(()ident(stackb)operator(\);) \ - reserved(return)operator(()ident(val)operator(\);) \ -operator(}) reserved(while)operator(()integer(0)operator(\)) - -preprocessor(#define) ident(DOUBLE_STACK)operator(()ident(type)operator(\)) reserved(do) operator({) \ - ident(type) operator(*)ident(stackx)operator(;) \ - pre_type(unsigned) pre_type(int) ident(xlen) operator(=) ident(stacke) operator(-) ident(stackb)operator(;) \ - reserved(if) operator(()ident(stackb) operator(==) ident(stacka)operator(\)) operator({) \ - ident(stackx) operator(=) operator(()ident(type)operator(*\))ident(xmalloc)operator(()integer(2) operator(*) ident(xlen) operator(*) reserved(sizeof)operator(()ident(type)operator(\)\);) \ - reserved(if) operator((!)ident(stackx)operator(\)) reserved(goto) ident(memory_exhausted)operator(;) \ - ident(memcpy)operator(()ident(stackx)operator(,) ident(stackb)operator(,) ident(xlen) operator(*) reserved(sizeof) operator(()ident(type)operator(\)\);) \ - operator(}) \ - reserved(else) operator({) \ - ident(stackx) operator(=) operator(()ident(type)operator(*\))ident(xrealloc)operator(()ident(stackb)operator(,) integer(2) operator(*) ident(xlen) operator(*) reserved(sizeof)operator(()ident(type)operator(\)\);) \ - reserved(if) operator((!)ident(stackx)operator(\)) reserved(goto) ident(memory_exhausted)operator(;) \ - operator(}) \ - comment(/* Rearrange the pointers. */) \ - ident(stackp) operator(=) ident(stackx) operator(+) operator(()ident(stackp) operator(-) ident(stackb)operator(\);) \ - ident(stackb) operator(=) ident(stackx)operator(;) \ - ident(stacke) operator(=) ident(stackb) operator(+) integer(2) operator(*) ident(xlen)operator(;) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(RE_TALLOC)operator(()ident(n)operator(,)ident(t)operator(\)) operator((()ident(t)operator(*\))ident(alloca)operator((()ident(n)operator(\)*)reserved(sizeof)operator(()ident(t)operator(\)\)\)) -preprocessor(#define) ident(TMALLOC)operator(()ident(n)operator(,)ident(t)operator(\)) operator((()ident(t)operator(*\))ident(xmalloc)operator((()ident(n)operator(\)*)reserved(sizeof)operator(()ident(t)operator(\)\)\)) -preprocessor(#define) ident(TREALLOC)operator(()ident(s)operator(,)ident(n)operator(,)ident(t)operator(\)) operator(()ident(s)operator(=(()ident(t)operator(*\))ident(xrealloc)operator(()ident(s)operator(,()ident(n)operator(\)*)reserved(sizeof)operator(()ident(t)operator(\)\)\)\)) - -preprocessor(#define) ident(EXPAND_FAIL_STACK)operator((\)) ident(DOUBLE_STACK)operator(()pre_type(unsigned) pre_type(char)operator(*\)) -preprocessor(#define) ident(ENSURE_FAIL_STACK)operator(()ident(n)operator(\)) \ - reserved(do) operator({) \ - reserved(if) operator(()ident(stacke) operator(-) ident(stackp) operator(<=) operator(()ident(n)operator(\)\)) operator({) \ - comment(/* if (len > re_max_failures * MAX_NUM_FAILURE_ITEMS\) \\ - { \\ - FREE_AND_RETURN(stackb,(-2\)\); \\ - }*/) \ - \ - comment(/* Roughly double the size of the stack. */) \ - ident(EXPAND_FAIL_STACK)operator((\);) \ - operator(}) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -comment(/* Get the interface, including the syntax bits. */) -preprocessor(#include) include("regex.h") - -comment(/* Subroutines for re_compile_pattern. */) -directive(static) directive(void) ident(store_jump) ident(_)operator((()pre_type(char)operator(*,) pre_type(int)operator(,) pre_type(char)operator(*\)\);) -directive(static) directive(void) ident(insert_jump) ident(_)operator((()pre_type(int)operator(,) pre_type(char)operator(*,) pre_type(char)operator(*,) pre_type(char)operator(*\)\);) -directive(static) directive(void) ident(store_jump_n) ident(_)operator((()pre_type(char)operator(*,) pre_type(int)operator(,) pre_type(char)operator(*,) pre_type(unsigned)operator(\)\);) -directive(static) directive(void) ident(insert_jump_n) ident(_)operator((()pre_type(int)operator(,) pre_type(char)operator(*,) pre_type(char)operator(*,) pre_type(char)operator(*,) pre_type(unsigned)operator(\)\);) -directive(static) directive(void) ident(insert_op) ident(_)operator((()pre_type(int)operator(,) pre_type(char)operator(*,) pre_type(char)operator(*\)\);) -directive(static) directive(void) ident(insert_op_2) ident(_)operator((()pre_type(int)operator(,) pre_type(char)operator(*,) pre_type(char)operator(*,) pre_type(int)operator(,) pre_type(int)operator(\)\);) -directive(static) pre_type(int) ident(memcmp_translate) ident(_)operator((()pre_type(unsigned) pre_type(char)operator(*,) pre_type(unsigned) pre_type(char)operator(*,) pre_type(int)operator(\)\);) - -comment(/* Define the syntax stuff, so we can do the \\<, \\>, etc. */) - -comment(/* This must be nonzero for the wordchar and notwordchar pattern - commands in re_match. */) -preprocessor(#define) ident(Sword) integer(1) -preprocessor(#define) ident(Sword2) integer(2) - -preprocessor(#define) ident(SYNTAX)operator(()ident(c)operator(\)) ident(re_syntax_table)operator([)ident(c)operator(]) - -directive(static) pre_type(char) ident(re_syntax_table)operator([)integer(256)operator(];) -directive(static) directive(void) ident(init_syntax_once) ident(_)operator((()directive(void)operator(\)\);) -directive(static) directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(translate) operator(=) integer(0)operator(;) -directive(static) directive(void) ident(init_regs) ident(_)operator((()reserved(struct) ident(re_registers)operator(*,) pre_type(unsigned) pre_type(int)operator(\)\);) -directive(static) directive(void) ident(bm_init_skip) ident(_)operator((()pre_type(int) operator(*,) pre_type(unsigned) pre_type(char)operator(*,) pre_type(int)operator(,) directive(const) pre_type(unsigned) pre_type(char)operator(*\)\);) -directive(static) pre_type(int) ident(current_mbctype) operator(=) ident(MBCTYPE_ASCII)operator(;) - -preprocessor(#undef) ident(P) - -preprocessor(#ifdef) ident(RUBY) -preprocessor(#include) include("util.h") -directive(void) ident(rb_warn) ident(_)operator((()directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\);) -preprocessor(# define) ident(re_warning)operator(()ident(x)operator(\)) ident(rb_warn)operator(()ident(x)operator(\)) -preprocessor(#endif) - -preprocessor(#ifndef) ident(re_warning) -preprocessor(# define) ident(re_warning)operator(()ident(x)operator(\)) -preprocessor(#endif) - -directive(static) directive(void) -ident(init_syntax_once)operator((\)) -operator({) - directive(register) pre_type(int) ident(c)operator(;) - directive(static) pre_type(int) ident(done) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(done)operator(\)) - reserved(return)operator(;) - - ident(memset)operator(()ident(re_syntax_table)operator(,) integer(0)operator(,) reserved(sizeof) ident(re_syntax_table)operator(\);) - - reserved(for) operator(()ident(c)operator(=)integer(0)operator(;) ident(c)operator(<=)hex(0x7f)operator(;) ident(c)operator(++\)) - reserved(if) operator(()ident(isalnum)operator(()ident(c)operator(\)\)) - ident(re_syntax_table)operator([)ident(c)operator(]) operator(=) ident(Sword)operator(;) - ident(re_syntax_table)operator([)char('_')operator(]) operator(=) ident(Sword)operator(;) - - reserved(for) operator(()ident(c)operator(=)hex(0x80)operator(;) ident(c)operator(<=)hex(0xff)operator(;) ident(c)operator(++\)) - reserved(if) operator(()ident(isalnum)operator(()ident(c)operator(\)\)) - ident(re_syntax_table)operator([)ident(c)operator(]) operator(=) ident(Sword2)operator(;) - ident(done) operator(=) integer(1)operator(;) -operator(}) - -directive(void) -ident(re_set_casetable)operator(()ident(table)operator(\)) - directive(const) pre_type(char) operator(*)ident(table)operator(;) -operator({) - ident(translate) operator(=) operator(()directive(const) pre_type(unsigned) pre_type(char)operator(*\))ident(table)operator(;) -operator(}) - -comment(/* Jim Meyering writes: - - "... Some ctype macros are valid only for character codes that - isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when - using /bin/cc or gcc but without giving an ansi option\). So, all - ctype uses should be through macros like ISPRINT... If - STDC_HEADERS is defined, then autoconf has verified that the ctype - macros don't need to be guarded with references to isascii. ... - Defining isascii to 1 should let any compiler worth its salt - eliminate the && through constant folding." - Solaris defines some of these symbols so we must undefine them first. */) - -preprocessor(#undef) ident(ISASCII) -preprocessor(#if) ident(defined) ident(STDC_HEADERS) operator(||) operator((!)ident(defined) ident(isascii) operator(&&) operator(!)ident(defined) ident(HAVE_ISASCII)operator(\)) -preprocessor(# define) ident(ISASCII)operator(()ident(c)operator(\)) integer(1) -preprocessor(#else) -preprocessor(# define) ident(ISASCII)operator(()ident(c)operator(\)) ident(isascii)operator(()ident(c)operator(\)) -preprocessor(#endif) - -preprocessor(#ifdef) ident(isblank) -preprocessor(# define) ident(ISBLANK)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isblank)operator(()ident(c)operator(\)\)) -preprocessor(#else) -preprocessor(# define) ident(ISBLANK)operator(()ident(c)operator(\)) operator((()ident(c)operator(\)) operator(==) char(' ') operator(||) operator(()ident(c)operator(\)) operator(==) char('\\t')operator(\)) -preprocessor(#endif) -preprocessor(#ifdef) ident(isgraph) -preprocessor(# define) ident(ISGRAPH)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isgraph)operator(()ident(c)operator(\)\)) -preprocessor(#else) -preprocessor(# define) ident(ISGRAPH)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isprint)operator(()ident(c)operator(\)) operator(&&) operator(!)ident(isspace)operator(()ident(c)operator(\)\)) -preprocessor(#endif) - -preprocessor(#undef) ident(ISPRINT) -preprocessor(#define) ident(ISPRINT)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isprint)operator(()ident(c)operator(\)\)) -preprocessor(#define) ident(ISDIGIT)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isdigit)operator(()ident(c)operator(\)\)) -preprocessor(#define) ident(ISALNUM)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isalnum)operator(()ident(c)operator(\)\)) -preprocessor(#define) ident(ISALPHA)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isalpha)operator(()ident(c)operator(\)\)) -preprocessor(#define) ident(ISCNTRL)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(iscntrl)operator(()ident(c)operator(\)\)) -preprocessor(#define) ident(ISLOWER)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(islower)operator(()ident(c)operator(\)\)) -preprocessor(#define) ident(ISPUNCT)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(ispunct)operator(()ident(c)operator(\)\)) -preprocessor(#define) ident(ISSPACE)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isspace)operator(()ident(c)operator(\)\)) -preprocessor(#define) ident(ISUPPER)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isupper)operator(()ident(c)operator(\)\)) -preprocessor(#define) ident(ISXDIGIT)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isxdigit)operator(()ident(c)operator(\)\)) - -preprocessor(#ifndef) pre_constant(NULL) -preprocessor(# define) pre_constant(NULL) operator(()directive(void) operator(*\))integer(0) -preprocessor(#endif) - -comment(/* We remove any previous definition of `SIGN_EXTEND_CHAR', - since ours (we hope\) works properly with all combinations of - machines, compilers, `char' and `unsigned char' argument types. - (Per Bothner suggested the basic approach.\) */) -preprocessor(#undef) ident(SIGN_EXTEND_CHAR) -preprocessor(#if) ident(__STDC__) -preprocessor(# define) ident(SIGN_EXTEND_CHAR)operator(()ident(c)operator(\)) operator((()pre_type(signed) pre_type(char)operator(\)()ident(c)operator(\)\)) -preprocessor(#else) comment(/* not __STDC__ */) -comment(/* As in Harbison and Steele. */) -preprocessor(# define) ident(SIGN_EXTEND_CHAR)operator(()ident(c)operator(\)) operator((((()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)) operator(^) integer(128)operator(\)) operator(-) integer(128)operator(\)) -preprocessor(#endif) - -comment(/* These are the command codes that appear in compiled regular - expressions, one per byte. Some command codes are followed by - argument bytes. A command code can specify any interpretation - whatsoever for its arguments. Zero-bytes may appear in the compiled - regular expression. - - The value of `exactn' is needed in search.c (search_buffer\) in emacs. - So regex.h defines a symbol `RE_EXACTN_VALUE' to be 1; the value of - `exactn' we use here must also be 1. */) - -reserved(enum) ident(regexpcode) - operator({) - ident(unused)operator(=)integer(0)operator(,) - ident(exactn)operator(=)integer(1)operator(,) comment(/* Followed by one byte giving n, then by n literal bytes. */) - ident(begline)operator(,) comment(/* Fail unless at beginning of line. */) - ident(endline)operator(,) comment(/* Fail unless at end of line. */) - ident(begbuf)operator(,) comment(/* Succeeds if at beginning of buffer (if emacs\) or at beginning - of string to be matched (if not\). */) - ident(endbuf)operator(,) comment(/* Analogously, for end of buffer/string. */) - ident(endbuf2)operator(,) comment(/* End of buffer/string, or newline just before it. */) - ident(begpos)operator(,) comment(/* Matches where last scan//gsub left off. */) - ident(jump)operator(,) comment(/* Followed by two bytes giving relative address to jump to. */) - ident(jump_past_alt)operator(,)comment(/* Same as jump, but marks the end of an alternative. */) - ident(on_failure_jump)operator(,) comment(/* Followed by two bytes giving relative address of - place to resume at in case of failure. */) - ident(finalize_jump)operator(,) comment(/* Throw away latest failure point and then jump to - address. */) - ident(maybe_finalize_jump)operator(,) comment(/* Like jump but finalize if safe to do so. - This is used to jump back to the beginning - of a repeat. If the command that follows - this jump is clearly incompatible with the - one at the beginning of the repeat, such that - we can be sure that there is no use backtracking - out of repetitions already completed, - then we finalize. */) - ident(dummy_failure_jump)operator(,) comment(/* Jump, and push a dummy failure point. This - failure point will be thrown away if an attempt - is made to use it for a failure. A + construct - makes this before the first repeat. Also - use it as an intermediary kind of jump when - compiling an or construct. */) - ident(push_dummy_failure)operator(,) comment(/* Push a dummy failure point and continue. Used at the end of - alternatives. */) - ident(succeed_n)operator(,) comment(/* Used like on_failure_jump except has to succeed n times; - then gets turned into an on_failure_jump. The relative - address following it is useless until then. The - address is followed by two bytes containing n. */) - ident(jump_n)operator(,) comment(/* Similar to jump, but jump n times only; also the relative - address following is in turn followed by yet two more bytes - containing n. */) - ident(try_next)operator(,) comment(/* Jump to next pattern for the first time, - leaving this pattern on the failure stack. */) - ident(finalize_push)operator(,) comment(/* Finalize stack and push the beginning of the pattern - on the stack to retry (used for non-greedy match\) */) - ident(finalize_push_n)operator(,) comment(/* Similar to finalize_push, buf finalize n time only */) - ident(set_number_at)operator(,) comment(/* Set the following relative location to the - subsequent number. */) - ident(anychar)operator(,) comment(/* Matches any (more or less\) one character excluding newlines. */) - ident(anychar_repeat)operator(,) comment(/* Matches sequence of characters excluding newlines. */) - ident(charset)operator(,) comment(/* Matches any one char belonging to specified set. - First following byte is number of bitmap bytes. - Then come bytes for a bitmap saying which chars are in. - Bits in each byte are ordered low-bit-first. - A character is in the set if its bit is 1. - A character too large to have a bit in the map - is automatically not in the set. */) - ident(charset_not)operator(,) comment(/* Same parameters as charset, but match any character - that is not one of those specified. */) - ident(start_memory)operator(,) comment(/* Start remembering the text that is matched, for - storing in a memory register. Followed by one - byte containing the register number. Register numbers - must be in the range 0 through RE_NREGS. */) - ident(stop_memory)operator(,) comment(/* Stop remembering the text that is matched - and store it in a memory register. Followed by - one byte containing the register number. Register - numbers must be in the range 0 through RE_NREGS. */) - ident(start_paren)operator(,) comment(/* Place holder at the start of (?:..\). */) - ident(stop_paren)operator(,) comment(/* Place holder at the end of (?:..\). */) - ident(casefold_on)operator(,) comment(/* Turn on casefold flag. */) - ident(casefold_off)operator(,) comment(/* Turn off casefold flag. */) - ident(option_set)operator(,) comment(/* Turn on multi line match (match with newlines\). */) - ident(start_nowidth)operator(,) comment(/* Save string point to the stack. */) - ident(stop_nowidth)operator(,) comment(/* Restore string place at the point start_nowidth. */) - ident(pop_and_fail)operator(,) comment(/* Fail after popping nowidth entry from stack. */) - ident(stop_backtrack)operator(,) comment(/* Restore backtrack stack at the point start_nowidth. */) - ident(duplicate)operator(,) comment(/* Match a duplicate of something remembered. - Followed by one byte containing the index of the memory - register. */) - ident(wordchar)operator(,) comment(/* Matches any word-constituent character. */) - ident(notwordchar)operator(,) comment(/* Matches any char that is not a word-constituent. */) - ident(wordbeg)operator(,) comment(/* Succeeds if at word beginning. */) - ident(wordend)operator(,) comment(/* Succeeds if at word end. */) - ident(wordbound)operator(,) comment(/* Succeeds if at a word boundary. */) - ident(notwordbound) comment(/* Succeeds if not at a word boundary. */) - operator(};) - - -comment(/* Number of failure points to allocate space for initially, - when matching. If this number is exceeded, more space is allocated, - so it is not a hard limit. */) - -preprocessor(#ifndef) ident(NFAILURES) -preprocessor(#define) ident(NFAILURES) integer(160) -preprocessor(#endif) - -comment(/* Store NUMBER in two contiguous bytes starting at DESTINATION. */) -preprocessor(#define) ident(STORE_NUMBER)operator(()ident(destination)operator(,) ident(number)operator(\)) \ - reserved(do) operator({) operator(()ident(destination)operator(\)[)integer(0)operator(]) operator(=) operator(()ident(number)operator(\)) operator(&) oct(0377)operator(;) \ - operator(()ident(destination)operator(\)[)integer(1)operator(]) operator(=) operator(()ident(number)operator(\)) operator(>>) integer(8)operator(;) operator(}) reserved(while) operator(()integer(0)operator(\)) - -comment(/* Same as STORE_NUMBER, except increment the destination pointer to - the byte after where the number is stored. Watch out that values for - DESTINATION such as p + 1 won't work, whereas p will. */) -preprocessor(#define) ident(STORE_NUMBER_AND_INCR)operator(()ident(destination)operator(,) ident(number)operator(\)) \ - reserved(do) operator({) ident(STORE_NUMBER)operator(()ident(destination)operator(,) ident(number)operator(\);) \ - operator(()ident(destination)operator(\)) operator(+=) integer(2)operator(;) operator(}) reserved(while) operator(()integer(0)operator(\)) - - -comment(/* Put into DESTINATION a number stored in two contingous bytes starting - at SOURCE. */) -preprocessor(#define) ident(EXTRACT_NUMBER)operator(()ident(destination)operator(,) ident(source)operator(\)) \ - reserved(do) operator({) operator(()ident(destination)operator(\)) operator(=) operator(*()ident(source)operator(\)) operator(&) oct(0377)operator(;) \ - operator(()ident(destination)operator(\)) operator(+=) ident(SIGN_EXTEND_CHAR)operator((*()pre_type(char)operator(*\)(()ident(source)operator(\)) operator(+) integer(1)operator(\)\)) operator(<<) integer(8)operator(;) operator(}) reserved(while) operator(()integer(0)operator(\)) - -comment(/* Same as EXTRACT_NUMBER, except increment the pointer for source to - point to second byte of SOURCE. Note that SOURCE has to be a value - such as p, not, e.g., p + 1. */) -preprocessor(#define) ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(destination)operator(,) ident(source)operator(\)) \ - reserved(do) operator({) ident(EXTRACT_NUMBER)operator(()ident(destination)operator(,) ident(source)operator(\);) \ - operator(()ident(source)operator(\)) operator(+=) integer(2)operator(;) operator(}) reserved(while) operator(()integer(0)operator(\)) - - -comment(/* Specify the precise syntax of regexps for compilation. This provides - for compatibility for various utilities which historically have - different, incompatible syntaxes. - - The argument SYNTAX is a bit-mask comprised of the various bits - defined in regex.h. */) - -pre_type(long) -ident(re_set_syntax)operator(()ident(syntax)operator(\)) - pre_type(long) ident(syntax)operator(;) -operator({) - comment(/* obsolete */) - reserved(return) integer(0)operator(;) -operator(}) - -comment(/* Macros for re_compile_pattern, which is found below these definitions. */) - -preprocessor(#define) ident(TRANSLATE_P)operator((\)) operator((()ident(options)operator(&)ident(RE_OPTION_IGNORECASE)operator(\)) operator(&&) ident(translate)operator(\)) -preprocessor(#define) ident(MAY_TRANSLATE)operator((\)) operator((()ident(bufp)operator(->)ident(options)operator(&()ident(RE_OPTION_IGNORECASE)operator(|)ident(RE_MAY_IGNORECASE)operator(\)\)) operator(&&) ident(translate)operator(\)) -comment(/* Fetch the next character in the uncompiled pattern---translating it - if necessary. Also cast from a signed character in the constant - string passed to us by the user to an unsigned char that we can use - as an array index (in, e.g., `translate'\). */) -preprocessor(#define) ident(PATFETCH)operator(()ident(c)operator(\)) \ - reserved(do) operator({)reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) reserved(goto) ident(end_of_pattern)operator(;) \ - ident(c) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)) operator(*)ident(p)operator(++;) \ - reserved(if) operator(()ident(TRANSLATE_P)operator((\)\)) ident(c) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(translate)operator([)ident(c)operator(];) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -comment(/* Fetch the next character in the uncompiled pattern, with no - translation. */) -preprocessor(#define) ident(PATFETCH_RAW)operator(()ident(c)operator(\)) \ - reserved(do) operator({)reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) reserved(goto) ident(end_of_pattern)operator(;) \ - ident(c) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)*)ident(p)operator(++;) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -comment(/* Go backwards one character in the pattern. */) -preprocessor(#define) ident(PATUNFETCH) ident(p)operator(--) - -preprocessor(#define) ident(MBC2WC)operator(()ident(c)operator(,) ident(p)operator(\)) \ - reserved(do) operator({) \ - reserved(if) operator(()ident(current_mbctype) operator(==) ident(MBCTYPE_UTF8)operator(\)) operator({) \ - pre_type(int) ident(n) operator(=) ident(mbclen)operator(()ident(c)operator(\)) operator(-) integer(1)operator(;) \ - ident(c) operator(&=) operator(()integer(1)operator(<<()ident(BYTEWIDTH)operator(-)integer(2)operator(-)ident(n)operator(\)\)) operator(-) integer(1)operator(;) \ - reserved(while) operator(()ident(n)operator(--\)) operator({) \ - ident(c) operator(=) ident(c) operator(<<) integer(6) operator(|) operator((*)ident(p)operator(++) operator(&) operator((()integer(1)operator(<<)integer(6)operator(\)-)integer(1)operator(\)\);) \ - operator(}) \ - operator(}) \ - reserved(else) operator({) \ - ident(c) operator(<<=) integer(8)operator(;) \ - ident(c) operator(|=) operator(()pre_type(unsigned) pre_type(char)operator(\)*()ident(p)operator(\)++;) \ - operator(}) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(PATFETCH_MBC)operator(()ident(c)operator(\)) \ - reserved(do) operator({) \ - reserved(if) operator(()ident(p) operator(+) ident(mbclen)operator(()ident(c)operator(\)) operator(-) integer(1) operator(>=) ident(pend)operator(\)) reserved(goto) ident(end_of_pattern)operator(;) \ - ident(MBC2WC)operator(()ident(c)operator(,) ident(p)operator(\);) \ - operator(}) reserved(while)operator(()integer(0)operator(\)) - -preprocessor(#define) ident(WC2MBC1ST)operator(()ident(c)operator(\)) \ - operator((()ident(current_mbctype) operator(!=) ident(MBCTYPE_UTF8)operator(\)) operator(?) operator((()ident(c)operator(<)hex(0x100)operator(\)) operator(?) operator(()ident(c)operator(\)) operator(:) operator(((()ident(c)operator(\)>>)integer(8)operator(\)&)hex(0xff)operator(\)\)) operator(:) ident(utf8_firstbyte)operator(()ident(c)operator(\)\)) - -reserved(typedef) pre_type(unsigned) pre_type(int) operator((*)ident(mbc_startpos_func_t)operator(\)) ident(_)operator((()directive(const) pre_type(char) operator(*)ident(string)operator(,) pre_type(unsigned) pre_type(int) ident(pos)operator(\)\);) - -directive(static) pre_type(unsigned) pre_type(int) ident(asc_startpos) ident(_)operator((()directive(const) pre_type(char) operator(*)ident(string)operator(,) pre_type(unsigned) pre_type(int) ident(pos)operator(\)\);) -directive(static) pre_type(unsigned) pre_type(int) ident(euc_startpos) ident(_)operator((()directive(const) pre_type(char) operator(*)ident(string)operator(,) pre_type(unsigned) pre_type(int) ident(pos)operator(\)\);) -directive(static) pre_type(unsigned) pre_type(int) ident(sjis_startpos) ident(_)operator((()directive(const) pre_type(char) operator(*)ident(string)operator(,) pre_type(unsigned) pre_type(int) ident(pos)operator(\)\);) -directive(static) pre_type(unsigned) pre_type(int) ident(utf8_startpos) ident(_)operator((()directive(const) pre_type(char) operator(*)ident(string)operator(,) pre_type(unsigned) pre_type(int) ident(pos)operator(\)\);) - -directive(static) directive(const) ident(mbc_startpos_func_t) ident(mbc_startpos_func)operator([)integer(4)operator(]) operator(=) operator({) - ident(asc_startpos)operator(,) ident(euc_startpos)operator(,) ident(sjis_startpos)operator(,) ident(utf8_startpos) -operator(};) - -preprocessor(#define) ident(mbc_startpos)operator(()ident(start)operator(,) ident(pos)operator(\)) operator((*)ident(mbc_startpos_func)operator([)ident(current_mbctype)operator(]\)(()ident(start)operator(\),) operator(()ident(pos)operator(\)\)) - -directive(static) pre_type(unsigned) pre_type(int) -ident(utf8_firstbyte)operator(()ident(c)operator(\)) - pre_type(unsigned) pre_type(long) ident(c)operator(;) -operator({) - reserved(if) operator(()ident(c) operator(<) hex(0x80)operator(\)) reserved(return) ident(c)operator(;) - reserved(if) operator(()ident(c) operator(<=) hex(0x7ff)operator(\)) reserved(return) operator((()ident(c)operator(>>)integer(6)operator(\)&)hex(0xff)operator(\)|)hex(0xc0)operator(;) - reserved(if) operator(()ident(c) operator(<=) hex(0xffff)operator(\)) reserved(return) operator((()ident(c)operator(>>)integer(12)operator(\)&)hex(0xff)operator(\)|)hex(0xe0)operator(;) - reserved(if) operator(()ident(c) operator(<=) hex(0x1fffff)operator(\)) reserved(return) operator((()ident(c)operator(>>)integer(18)operator(\)&)hex(0xff)operator(\)|)hex(0xf0)operator(;) - reserved(if) operator(()ident(c) operator(<=) hex(0x3ffffff)operator(\)) reserved(return) operator((()ident(c)operator(>>)integer(24)operator(\)&)hex(0xff)operator(\)|)hex(0xf8)operator(;) - reserved(if) operator(()ident(c) operator(<=) hex(0x7fffffff)operator(\)) reserved(return) operator((()ident(c)operator(>>)integer(30)operator(\)&)hex(0xff)operator(\)|)hex(0xfc)operator(;) -preprocessor(#if) ident(SIZEOF_INT) operator(>) integer(4) - reserved(if) operator(()ident(c) operator(<=) hex(0xfffffffff)operator(\)) reserved(return) hex(0xfe)operator(;) -preprocessor(#else) - reserved(return) hex(0xfe)operator(;) -preprocessor(#endif) -operator(}) - -directive(static) directive(void) -ident(print_mbc)operator(()ident(c)operator(\)) - pre_type(unsigned) pre_type(int) ident(c)operator(;) -operator({) - reserved(if) operator(()ident(current_mbctype) operator(==) ident(MBCTYPE_UTF8)operator(\)) operator({) - reserved(if) operator(()ident(c) operator(<) hex(0x80)operator(\)) - ident(printf)operator(()stringoperator(,) operator(()pre_type(int)operator(\))ident(c)operator(\);) - reserved(else) reserved(if) operator(()ident(c) operator(<=) hex(0x7ff)operator(\)) - ident(printf)operator(()stringoperator(,) operator(()pre_type(int)operator(\))ident(utf8_firstbyte)operator(()ident(c)operator(\),) operator(()pre_type(int)operator(\)()ident(c) operator(&) hex(0x3f)operator(\)\);) - reserved(else) reserved(if) operator(()ident(c) operator(<=) hex(0xffff)operator(\)) - ident(printf)operator(()stringoperator(,) operator(()pre_type(int)operator(\))ident(utf8_firstbyte)operator(()ident(c)operator(\),) operator(()pre_type(int)operator(\)(()ident(c) operator(>>) integer(6)operator(\)) operator(&) hex(0x3f)operator(\),) - operator(()pre_type(int)operator(\)()ident(c) operator(&) hex(0x3f)operator(\)\);) - reserved(else) reserved(if) operator(()ident(c) operator(<=) hex(0x1fffff)operator(\)) - ident(printf)operator(()stringoperator(,) operator(()pre_type(int)operator(\))ident(utf8_firstbyte)operator(()ident(c)operator(\),) operator(()pre_type(int)operator(\)(()ident(c) operator(>>) integer(12)operator(\)) operator(&) hex(0x3f)operator(\),) - operator(()pre_type(int)operator(\)(()ident(c) operator(>>) integer(6)operator(\)) operator(&) hex(0x3f)operator(\),) operator(()pre_type(int)operator(\)()ident(c) operator(&) hex(0x3f)operator(\)\);) - reserved(else) reserved(if) operator(()ident(c) operator(<=) hex(0x3ffffff)operator(\)) - ident(printf)operator(()stringoperator(,) operator(()pre_type(int)operator(\))ident(utf8_firstbyte)operator(()ident(c)operator(\),) operator(()pre_type(int)operator(\)(()ident(c) operator(>>) integer(18)operator(\)) operator(&) hex(0x3f)operator(\),) - operator(()pre_type(int)operator(\)(()ident(c) operator(>>) integer(12)operator(\)) operator(&) hex(0x3f)operator(\),) operator(()pre_type(int)operator(\)(()ident(c) operator(>>) integer(6)operator(\)) operator(&) hex(0x3f)operator(\),) operator(()pre_type(int)operator(\)()ident(c) operator(&) hex(0x3f)operator(\)\);) - reserved(else) reserved(if) operator(()ident(c) operator(<=) hex(0x7fffffff)operator(\)) - ident(printf)operator(()stringoperator(,) operator(()pre_type(int)operator(\))ident(utf8_firstbyte)operator(()ident(c)operator(\),) operator(()pre_type(int)operator(\)(()ident(c) operator(>>) integer(24)operator(\)) operator(&) hex(0x3f)operator(\),) - operator(()pre_type(int)operator(\)(()ident(c) operator(>>) integer(18)operator(\)) operator(&) hex(0x3f)operator(\),) operator(()pre_type(int)operator(\)(()ident(c) operator(>>) integer(12)operator(\)) operator(&) hex(0x3f)operator(\),) - operator(()pre_type(int)operator(\)(()ident(c) operator(>>) integer(6)operator(\)) operator(&) hex(0x3f)operator(\),) operator(()pre_type(int)operator(\)()ident(c) operator(&) hex(0x3f)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(<) hex(0xff)operator(\)) operator({) - ident(printf)operator(()stringoperator(,) operator(()pre_type(int)operator(\))ident(c)operator(\);) - operator(}) - reserved(else) operator({) - ident(printf)operator(()stringoperator(,) operator(()pre_type(int)operator(\)()ident(c) operator(>>) ident(BYTEWIDTH)operator(\),) operator(()pre_type(int)operator(\)()ident(c) operator(&)hex(0xff)operator(\)\);) - operator(}) -operator(}) - -comment(/* If the buffer isn't allocated when it comes in, use this. */) -preprocessor(#define) ident(INIT_BUF_SIZE) integer(28) - -comment(/* Make sure we have at least N more bytes of space in buffer. */) -preprocessor(#define) ident(GET_BUFFER_SPACE)operator(()ident(n)operator(\)) \ - reserved(do) operator({) \ - reserved(while) operator(()ident(b) operator(-) ident(bufp)operator(->)ident(buffer) operator(+) operator(()ident(n)operator(\)) operator(>=) ident(bufp)operator(->)ident(allocated)operator(\)) \ - ident(EXTEND_BUFFER)operator(;) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -comment(/* Make sure we have one more byte of buffer space and then add CH to it. */) -preprocessor(#define) ident(BUFPUSH)operator(()ident(ch)operator(\)) \ - reserved(do) operator({) \ - ident(GET_BUFFER_SPACE)operator(()integer(1)operator(\);) \ - operator(*)ident(b)operator(++) operator(=) operator(()pre_type(char)operator(\)()ident(ch)operator(\);) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -comment(/* Extend the buffer by twice its current size via reallociation and - reset the pointers that pointed into the old allocation to point to - the correct places in the new allocation. If extending the buffer - results in it being larger than 1 << 16, then flag memory exhausted. */) -preprocessor(#define) ident(EXTEND_BUFFER) \ - reserved(do) operator({) pre_type(char) operator(*)ident(old_buffer) operator(=) ident(bufp)operator(->)ident(buffer)operator(;) \ - reserved(if) operator(()ident(bufp)operator(->)ident(allocated) operator(==) operator(()integer(1L)operator(<<)integer(16)operator(\)\)) reserved(goto) ident(too_big)operator(;) \ - ident(bufp)operator(->)ident(allocated) operator(*=) integer(2)operator(;) \ - reserved(if) operator(()ident(bufp)operator(->)ident(allocated) operator(>) operator(()integer(1L)operator(<<)integer(16)operator(\)\)) ident(bufp)operator(->)ident(allocated) operator(=) operator(()integer(1L)operator(<<)integer(16)operator(\);) \ - ident(bufp)operator(->)ident(buffer) operator(=) operator(()pre_type(char)operator(*\))ident(xrealloc)operator(()ident(bufp)operator(->)ident(buffer)operator(,) ident(bufp)operator(->)ident(allocated)operator(\);) \ - reserved(if) operator(()ident(bufp)operator(->)ident(buffer) operator(==) integer(0)operator(\)) \ - reserved(goto) ident(memory_exhausted)operator(;) \ - ident(b) operator(=) operator(()ident(b) operator(-) ident(old_buffer)operator(\)) operator(+) ident(bufp)operator(->)ident(buffer)operator(;) \ - reserved(if) operator(()ident(fixup_alt_jump)operator(\)) \ - ident(fixup_alt_jump) operator(=) operator(()ident(fixup_alt_jump) operator(-) ident(old_buffer)operator(\)) operator(+) ident(bufp)operator(->)ident(buffer)operator(;) \ - reserved(if) operator(()ident(laststart)operator(\)) \ - ident(laststart) operator(=) operator(()ident(laststart) operator(-) ident(old_buffer)operator(\)) operator(+) ident(bufp)operator(->)ident(buffer)operator(;) \ - ident(begalt) operator(=) operator(()ident(begalt) operator(-) ident(old_buffer)operator(\)) operator(+) ident(bufp)operator(->)ident(buffer)operator(;) \ - reserved(if) operator(()ident(pending_exact)operator(\)) \ - ident(pending_exact) operator(=) operator(()ident(pending_exact) operator(-) ident(old_buffer)operator(\)) operator(+) ident(bufp)operator(->)ident(buffer)operator(;) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - - -comment(/* Set the bit for character C in a character set list. */) -preprocessor(#define) ident(SET_LIST_BIT)operator(()ident(c)operator(\)) \ - operator(()ident(b)operator([()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)) operator(/) ident(BYTEWIDTH)operator(]) \ - operator(|=) integer(1) operator(<<) operator((()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)) operator(%) ident(BYTEWIDTH)operator(\)\)) - -comment(/* Get the next unsigned number in the uncompiled pattern. */) -preprocessor(#define) ident(GET_UNSIGNED_NUMBER)operator(()ident(num)operator(\)) \ - reserved(do) operator({) reserved(if) operator(()ident(p) operator(!=) ident(pend)operator(\)) operator({) \ - ident(PATFETCH)operator(()ident(c)operator(\);) \ - reserved(while) operator(()ident(ISDIGIT)operator(()ident(c)operator(\)\)) operator({) \ - reserved(if) operator(()ident(num) operator(<) integer(0)operator(\)) \ - ident(num) operator(=) integer(0)operator(;) \ - ident(num) operator(=) ident(num) operator(*) integer(10) operator(+) ident(c) operator(-) char('0')operator(;) \ - reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) \ - reserved(break)operator(;) \ - ident(PATFETCH)operator(()ident(c)operator(\);) \ - operator(}) \ - operator(}) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(STREQ)operator(()ident(s1)operator(,) ident(s2)operator(\)) operator((()ident(strcmp)operator(()ident(s1)operator(,) ident(s2)operator(\)) operator(==) integer(0)operator(\)\)) - -preprocessor(#define) ident(CHAR_CLASS_MAX_LENGTH) integer(6) comment(/* Namely, `xdigit'. */) - -preprocessor(#define) ident(IS_CHAR_CLASS)operator(()ident(string)operator(\)) \ - operator(()ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)) operator(||) ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)) \ - operator(||) ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)) operator(||) ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)) \ - operator(||) ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)) operator(||) ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)) \ - operator(||) ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)) operator(||) ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)) \ - operator(||) ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)) operator(||) ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)) \ - operator(||) ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)) operator(||) ident(STREQ)operator(()ident(string)operator(,) stringoperator(\)\)) - -preprocessor(#define) ident(STORE_MBC)operator(()ident(p)operator(,) ident(c)operator(\)) \ - reserved(do) operator({) \ - operator(()ident(p)operator(\)[)integer(0)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)((()ident(c)operator(\)) operator(>>)integer(24)operator(\)) operator(&) hex(0xff)operator(\);) \ - operator(()ident(p)operator(\)[)integer(1)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)((()ident(c)operator(\)) operator(>>)integer(16)operator(\)) operator(&) hex(0xff)operator(\);) \ - operator(()ident(p)operator(\)[)integer(2)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)((()ident(c)operator(\)) operator(>>) integer(8)operator(\)) operator(&) hex(0xff)operator(\);) \ - operator(()ident(p)operator(\)[)integer(3)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)((()ident(c)operator(\)) operator(>>) integer(0)operator(\)) operator(&) hex(0xff)operator(\);) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(STORE_MBC_AND_INCR)operator(()ident(p)operator(,) ident(c)operator(\)) \ - reserved(do) operator({) \ - operator(*()ident(p)operator(\)++) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)((()ident(c)operator(\)) operator(>>)integer(24)operator(\)) operator(&) hex(0xff)operator(\);) \ - operator(*()ident(p)operator(\)++) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)((()ident(c)operator(\)) operator(>>)integer(16)operator(\)) operator(&) hex(0xff)operator(\);) \ - operator(*()ident(p)operator(\)++) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)((()ident(c)operator(\)) operator(>>) integer(8)operator(\)) operator(&) hex(0xff)operator(\);) \ - operator(*()ident(p)operator(\)++) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)((()ident(c)operator(\)) operator(>>) integer(0)operator(\)) operator(&) hex(0xff)operator(\);) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(EXTRACT_MBC)operator(()ident(p)operator(\)) \ - operator((()pre_type(unsigned) pre_type(int)operator(\)(()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[)integer(0)operator(]) operator(<<) integer(24) operator(|) \ - operator(()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[)integer(1)operator(]) operator(<<) integer(16) operator(|) \ - operator(()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[)integer(2)operator(]) operator(<<) integer(8) operator(|) \ - operator(()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[)integer(3)operator(]\)\)) - -preprocessor(#define) ident(EXTRACT_MBC_AND_INCR)operator(()ident(p)operator(\)) \ - operator((()pre_type(unsigned) pre_type(int)operator(\)(()ident(p)operator(\)) operator(+=) integer(4)operator(,) \ - operator(()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[-)integer(4)operator(]) operator(<<) integer(24) operator(|) \ - operator(()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[-)integer(3)operator(]) operator(<<) integer(16) operator(|) \ - operator(()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[-)integer(2)operator(]) operator(<<) integer(8) operator(|) \ - operator(()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[-)integer(1)operator(]\)\)) - -preprocessor(#define) ident(EXTRACT_UNSIGNED)operator(()ident(p)operator(\)) \ - operator((()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[)integer(0)operator(]) operator(|) operator(()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[)integer(1)operator(]) operator(<<) integer(8)operator(\)) -preprocessor(#define) ident(EXTRACT_UNSIGNED_AND_INCR)operator(()ident(p)operator(\)) \ - operator((()ident(p)operator(\)) operator(+=) integer(2)operator(,) operator(()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[-)integer(2)operator(]) operator(|) operator(()pre_type(unsigned) pre_type(char)operator(\)()ident(p)operator(\)[-)integer(1)operator(]) operator(<<) integer(8)operator(\)) - -comment(/* Handle (mb\)?charset(_not\)?. - - Structure of mbcharset(_not\)? in compiled pattern. - - struct { - unsinged char id; mbcharset(_not\)? - unsigned char sbc_size; - unsigned char sbc_map[sbc_size]; same as charset(_not\)? up to here. - unsigned short mbc_size; number of intervals. - struct { - unsigned long beg; beginning of interval. - unsigned long end; end of interval. - } intervals[mbc_size]; - }; */) - -directive(static) directive(void) -ident(set_list_bits)operator(()ident(c1)operator(,) ident(c2)operator(,) ident(b)operator(\)) - pre_type(unsigned) pre_type(long) ident(c1)operator(,) ident(c2)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(b)operator(;) -operator({) - pre_type(unsigned) pre_type(char) ident(sbc_size) operator(=) ident(b)operator([-)integer(1)operator(];) - pre_type(unsigned) pre_type(short) ident(mbc_size) operator(=) ident(EXTRACT_UNSIGNED)operator((&)ident(b)operator([)ident(sbc_size)operator(]\);) - pre_type(unsigned) pre_type(short) ident(beg)operator(,) ident(end)operator(,) ident(upb)operator(;) - - reserved(if) operator(()ident(c1) operator(>) ident(c2)operator(\)) - reserved(return)operator(;) - ident(b) operator(=) operator(&)ident(b)operator([)ident(sbc_size) operator(+) integer(2)operator(];) - - reserved(for) operator(()ident(beg) operator(=) integer(0)operator(,) ident(upb) operator(=) ident(mbc_size)operator(;) ident(beg) operator(<) ident(upb)operator(;) operator(\)) operator({) - pre_type(unsigned) pre_type(short) ident(mid) operator(=) operator(()pre_type(unsigned) pre_type(short)operator(\)()ident(beg) operator(+) ident(upb)operator(\)) operator(>>) integer(1)operator(;) - - reserved(if) operator((()pre_type(int)operator(\))ident(c1) operator(-) integer(1) operator(>) operator(()pre_type(int)operator(\))ident(EXTRACT_MBC)operator((&)ident(b)operator([)ident(mid)operator(*)integer(8)operator(+)integer(4)operator(]\)\)) - ident(beg) operator(=) ident(mid) operator(+) integer(1)operator(;) - reserved(else) - ident(upb) operator(=) ident(mid)operator(;) - operator(}) - - reserved(for) operator(()ident(end) operator(=) ident(beg)operator(,) ident(upb) operator(=) ident(mbc_size)operator(;) ident(end) operator(<) ident(upb)operator(;) operator(\)) operator({) - pre_type(unsigned) pre_type(short) ident(mid) operator(=) operator(()pre_type(unsigned) pre_type(short)operator(\)()ident(end) operator(+) ident(upb)operator(\)) operator(>>) integer(1)operator(;) - - reserved(if) operator((()pre_type(int)operator(\))ident(c2) operator(>=) operator(()pre_type(int)operator(\))ident(EXTRACT_MBC)operator((&)ident(b)operator([)ident(mid)operator(*)integer(8)operator(]\)) operator(-) integer(1)operator(\)) - ident(end) operator(=) ident(mid) operator(+) integer(1)operator(;) - reserved(else) - ident(upb) operator(=) ident(mid)operator(;) - operator(}) - - reserved(if) operator(()ident(beg) operator(!=) ident(end)operator(\)) operator({) - reserved(if) operator(()ident(c1) operator(>) ident(EXTRACT_MBC)operator((&)ident(b)operator([)ident(beg)operator(*)integer(8)operator(]\)\)) - ident(c1) operator(=) ident(EXTRACT_MBC)operator((&)ident(b)operator([)ident(beg)operator(*)integer(8)operator(]\);) - reserved(if) operator(()ident(c2) operator(<) ident(EXTRACT_MBC)operator((&)ident(b)operator([()ident(end) operator(-) integer(1)operator(\)*)integer(8)operator(+)integer(4)operator(]\)\)) - ident(c2) operator(=) ident(EXTRACT_MBC)operator((&)ident(b)operator([()ident(end) operator(-) integer(1)operator(\)*)integer(8)operator(+)integer(4)operator(]\);) - operator(}) - reserved(if) operator(()ident(end) operator(<) ident(mbc_size) operator(&&) ident(end) operator(!=) ident(beg) operator(+) integer(1)operator(\)) - comment(/* NOTE: memcpy(\) would not work here. */) - ident(memmove)operator((&)ident(b)operator([()ident(beg) operator(+) integer(1)operator(\)*)integer(8)operator(],) operator(&)ident(b)operator([)ident(end)operator(*)integer(8)operator(],) operator(()ident(mbc_size) operator(-) ident(end)operator(\)*)integer(8)operator(\);) - ident(STORE_MBC)operator((&)ident(b)operator([)ident(beg)operator(*)integer(8) operator(+) integer(0)operator(],) ident(c1)operator(\);) - ident(STORE_MBC)operator((&)ident(b)operator([)ident(beg)operator(*)integer(8) operator(+) integer(4)operator(],) ident(c2)operator(\);) - ident(mbc_size) operator(+=) ident(beg) operator(-) ident(end) operator(+) integer(1)operator(;) - ident(STORE_NUMBER)operator((&)ident(b)operator([-)integer(2)operator(],) ident(mbc_size)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(is_in_list_sbc)operator(()ident(c)operator(,) ident(b)operator(\)) - pre_type(unsigned) pre_type(long) ident(c)operator(;) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(b)operator(;) -operator({) - pre_type(unsigned) pre_type(short) ident(size)operator(;) - - ident(size) operator(=) operator(*)ident(b)operator(++;) - reserved(return) operator((()pre_type(int)operator(\))ident(c) operator(/) ident(BYTEWIDTH) operator(<) operator(()pre_type(int)operator(\))ident(size) operator(&&) ident(b)operator([)ident(c) operator(/) ident(BYTEWIDTH)operator(]) operator(&) integer(1) operator(<<) ident(c) operator(%) ident(BYTEWIDTH)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(is_in_list_mbc)operator(()ident(c)operator(,) ident(b)operator(\)) - pre_type(unsigned) pre_type(long) ident(c)operator(;) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(b)operator(;) -operator({) - pre_type(unsigned) pre_type(short) ident(size)operator(;) - pre_type(unsigned) pre_type(short) ident(i)operator(,) ident(j)operator(;) - - ident(size) operator(=) operator(*)ident(b)operator(++;) - ident(b) operator(+=) ident(size) operator(+) integer(2)operator(;) - ident(size) operator(=) ident(EXTRACT_UNSIGNED)operator((&)ident(b)operator([-)integer(2)operator(]\);) - reserved(if) operator(()ident(size) operator(==) integer(0)operator(\)) reserved(return) integer(0)operator(;) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(,) ident(j) operator(=) ident(size)operator(;) ident(i) operator(<) ident(j)operator(;) operator(\)) operator({) - pre_type(unsigned) pre_type(short) ident(k) operator(=) operator(()pre_type(unsigned) pre_type(short)operator(\)()ident(i) operator(+) ident(j)operator(\)) operator(>>) integer(1)operator(;) - - reserved(if) operator(()ident(c) operator(>) ident(EXTRACT_MBC)operator((&)ident(b)operator([)ident(k)operator(*)integer(8)operator(+)integer(4)operator(]\)\)) - ident(i) operator(=) ident(k) operator(+) integer(1)operator(;) - reserved(else) - ident(j) operator(=) ident(k)operator(;) - operator(}) - reserved(if) operator(()ident(i) operator(<) ident(size) operator(&&) ident(EXTRACT_MBC)operator((&)ident(b)operator([)ident(i)operator(*)integer(8)operator(]\)) operator(<=) ident(c)operator(\)) - reserved(return) integer(1)operator(;) - - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(is_in_list)operator(()ident(c)operator(,) ident(b)operator(\)) - pre_type(unsigned) pre_type(long) ident(c)operator(;) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(b)operator(;) -operator({) - reserved(return) ident(is_in_list_sbc)operator(()ident(c)operator(,) ident(b)operator(\)) operator(||) operator(()ident(current_mbctype) operator(?) ident(is_in_list_mbc)operator(()ident(c)operator(,) ident(b)operator(\)) operator(:) integer(0)operator(\);) -operator(}) - -directive(static) directive(void) -ident(print_partial_compiled_pattern)operator(()ident(start)operator(,) ident(end)operator(\)) - pre_type(unsigned) pre_type(char) operator(*)ident(start)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(end)operator(;) -operator({) - pre_type(int) ident(mcnt)operator(,) ident(mcnt2)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(p) operator(=) ident(start)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(pend) operator(=) ident(end)operator(;) - - reserved(if) operator(()ident(start) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(printf)operator(()stringoperator(\);) - reserved(return)operator(;) - operator(}) - - comment(/* Loop over pattern commands. */) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - reserved(switch) operator((()reserved(enum) ident(regexpcode)operator(\)*)ident(p)operator(++\)) operator({) - reserved(case) ident(unused)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(exactn)operator(:) - ident(mcnt) operator(=) operator(*)ident(p)operator(++;) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(\);) - reserved(do) operator({) - ident(putchar)operator(()char('/')operator(\);) - ident(printf)operator(()stringoperator(,) operator(*)ident(p)operator(++\);) - operator(}) - reserved(while) operator((--)ident(mcnt)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(start_memory)operator(:) - ident(mcnt) operator(=) operator(*)ident(p)operator(++;) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(,) operator(*)ident(p)operator(++\);) - reserved(break)operator(;) - - reserved(case) ident(stop_memory)operator(:) - ident(mcnt) operator(=) operator(*)ident(p)operator(++;) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(,) operator(*)ident(p)operator(++\);) - reserved(break)operator(;) - - reserved(case) ident(start_paren)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(stop_paren)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(casefold_on)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(casefold_off)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(option_set)operator(:) - ident(printf)operator(()stringoperator(,) operator(*)ident(p)operator(++\);) - reserved(break)operator(;) - - reserved(case) ident(start_nowidth)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(stop_nowidth)operator(:) - ident(printf)operator(()stringoperator(\);) - ident(p) operator(+=) integer(2)operator(;) - reserved(break)operator(;) - - reserved(case) ident(pop_and_fail)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(stop_backtrack)operator(:) - ident(printf)operator(()stringoperator(\);) - ident(p) operator(+=) integer(2)operator(;) - reserved(break)operator(;) - - reserved(case) ident(duplicate)operator(:) - ident(printf)operator(()stringoperator(,) operator(*)ident(p)operator(++\);) - reserved(break)operator(;) - - reserved(case) ident(anychar)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(anychar_repeat)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(charset)operator(:) - reserved(case) ident(charset_not)operator(:) - operator({) - directive(register) pre_type(int) ident(c)operator(;) - - ident(printf)operator(()stringoperator(,) - operator(()reserved(enum) ident(regexpcode)operator(\)*()ident(p) operator(-) integer(1)operator(\)) operator(==) ident(charset_not) operator(?) string operator(:) stringoperator(\);) - - ident(mcnt) operator(=) operator(*)ident(p)operator(++;) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(\);) - reserved(for) operator(()ident(c) operator(=) integer(0)operator(;) ident(c) operator(<) ident(mcnt)operator(;) ident(c)operator(++\)) operator({) - pre_type(unsigned) ident(bit)operator(;) - pre_type(unsigned) pre_type(char) ident(map_byte) operator(=) ident(p)operator([)ident(c)operator(];) - - ident(putchar)operator(()char('/')operator(\);) - - reserved(for) operator(()ident(bit) operator(=) integer(0)operator(;) ident(bit) operator(<) ident(BYTEWIDTH)operator(;) ident(bit)operator(++\)) - reserved(if) operator(()ident(map_byte) operator(&) operator(()integer(1) operator(<<) ident(bit)operator(\)\)) - ident(printf)operator(()stringoperator(,) ident(c) operator(*) ident(BYTEWIDTH) operator(+) ident(bit)operator(\);) - operator(}) - ident(p) operator(+=) ident(mcnt)operator(;) - ident(mcnt) operator(=) ident(EXTRACT_UNSIGNED_AND_INCR)operator(()ident(p)operator(\);) - ident(putchar)operator(()char('/')operator(\);) - reserved(while) operator(()ident(mcnt)operator(--\)) operator({) - ident(print_mbc)operator(()ident(EXTRACT_MBC_AND_INCR)operator(()ident(p)operator(\)\);) - ident(putchar)operator(()char('-')operator(\);) - ident(print_mbc)operator(()ident(EXTRACT_MBC_AND_INCR)operator(()ident(p)operator(\)\);) - operator(}) - reserved(break)operator(;) - operator(}) - - reserved(case) ident(begline)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(endline)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(on_failure_jump)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(dummy_failure_jump)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(push_dummy_failure)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(finalize_jump)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(maybe_finalize_jump)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(jump_past_alt)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(jump)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(succeed_n)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt2)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(,) ident(mcnt2)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(jump_n)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt2)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(,) ident(mcnt2)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(set_number_at)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt2)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(,) ident(mcnt2)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(try_next)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(finalize_push)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(finalize_push_n)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt2)operator(,) ident(p)operator(\);) - ident(printf)operator(()stringoperator(,) ident(mcnt)operator(,) ident(mcnt2)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(wordbound)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(notwordbound)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(wordbeg)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(wordend)operator(:) - ident(printf)operator(()stringoperator(\);) - - reserved(case) ident(wordchar)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(notwordchar)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(begbuf)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(endbuf)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(endbuf2)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(case) ident(begpos)operator(:) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(printf)operator(()stringoperator(,) operator(*()ident(p)operator(-)integer(1)operator(\)\);) - operator(}) - operator(}) - ident(printf)operator(()stringoperator(\);) -operator(}) - - -directive(static) directive(void) -ident(print_compiled_pattern)operator(()ident(bufp)operator(\)) - reserved(struct) ident(re_pattern_buffer) operator(*)ident(bufp)operator(;) -operator({) - pre_type(unsigned) pre_type(char) operator(*)ident(buffer) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(bufp)operator(->)ident(buffer)operator(;) - - ident(print_partial_compiled_pattern)operator(()ident(buffer)operator(,) ident(buffer) operator(+) ident(bufp)operator(->)ident(used)operator(\);) -operator(}) - -directive(static) pre_type(char)operator(*) -ident(calculate_must_string)operator(()ident(start)operator(,) ident(end)operator(\)) - pre_type(char) operator(*)ident(start)operator(;) - pre_type(char) operator(*)ident(end)operator(;) -operator({) - pre_type(int) ident(mcnt)operator(;) - pre_type(int) ident(max) operator(=) integer(0)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(p) operator(=) operator(()pre_type(unsigned) pre_type(char) operator(*\))ident(start)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(pend) operator(=) operator(()pre_type(unsigned) pre_type(char) operator(*\))ident(end)operator(;) - pre_type(char) operator(*)ident(must) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(start) operator(==) pre_constant(NULL)operator(\)) reserved(return) integer(0)operator(;) - - comment(/* Loop over pattern commands. */) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - reserved(switch) operator((()reserved(enum) ident(regexpcode)operator(\)*)ident(p)operator(++\)) operator({) - reserved(case) ident(unused)operator(:) - reserved(break)operator(;) - - reserved(case) ident(exactn)operator(:) - ident(mcnt) operator(=) operator(*)ident(p)operator(;) - reserved(if) operator(()ident(mcnt) operator(>) ident(max)operator(\)) operator({) - ident(must) operator(=) operator(()pre_type(char) operator(*\))ident(p)operator(;) - ident(max) operator(=) ident(mcnt)operator(;) - operator(}) - ident(p) operator(+=) ident(mcnt)operator(+)integer(1)operator(;) - reserved(break)operator(;) - - reserved(case) ident(start_memory)operator(:) - reserved(case) ident(stop_memory)operator(:) - ident(p) operator(+=) integer(2)operator(;) - reserved(break)operator(;) - - reserved(case) ident(duplicate)operator(:) - reserved(case) ident(option_set)operator(:) - ident(p)operator(++;) - reserved(break)operator(;) - - reserved(case) ident(casefold_on)operator(:) - reserved(case) ident(casefold_off)operator(:) - reserved(return) integer(0)operator(;) comment(/* should not check must_string */) - - reserved(case) ident(pop_and_fail)operator(:) - reserved(case) ident(anychar)operator(:) - reserved(case) ident(anychar_repeat)operator(:) - reserved(case) ident(begline)operator(:) - reserved(case) ident(endline)operator(:) - reserved(case) ident(wordbound)operator(:) - reserved(case) ident(notwordbound)operator(:) - reserved(case) ident(wordbeg)operator(:) - reserved(case) ident(wordend)operator(:) - reserved(case) ident(wordchar)operator(:) - reserved(case) ident(notwordchar)operator(:) - reserved(case) ident(begbuf)operator(:) - reserved(case) ident(endbuf)operator(:) - reserved(case) ident(endbuf2)operator(:) - reserved(case) ident(begpos)operator(:) - reserved(case) ident(push_dummy_failure)operator(:) - reserved(case) ident(start_paren)operator(:) - reserved(case) ident(stop_paren)operator(:) - reserved(break)operator(;) - - reserved(case) ident(charset)operator(:) - reserved(case) ident(charset_not)operator(:) - ident(mcnt) operator(=) operator(*)ident(p)operator(++;) - ident(p) operator(+=) ident(mcnt)operator(;) - ident(mcnt) operator(=) ident(EXTRACT_UNSIGNED_AND_INCR)operator(()ident(p)operator(\);) - reserved(while) operator(()ident(mcnt)operator(--\)) operator({) - ident(p) operator(+=) integer(8)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(on_failure_jump)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - reserved(if) operator(()ident(mcnt) operator(>) integer(0)operator(\)) ident(p) operator(+=) ident(mcnt)operator(;) - reserved(if) operator((()reserved(enum) ident(regexpcode)operator(\))ident(p)operator([-)integer(3)operator(]) operator(==) ident(jump)operator(\)) operator({) - ident(p) operator(-=) integer(2)operator(;) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - reserved(if) operator(()ident(mcnt) operator(>) integer(0)operator(\)) ident(p) operator(+=) ident(mcnt)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(dummy_failure_jump)operator(:) - reserved(case) ident(succeed_n)operator(:) - reserved(case) ident(try_next)operator(:) - reserved(case) ident(jump)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - reserved(if) operator(()ident(mcnt) operator(>) integer(0)operator(\)) ident(p) operator(+=) ident(mcnt)operator(;) - reserved(break)operator(;) - - reserved(case) ident(start_nowidth)operator(:) - reserved(case) ident(stop_nowidth)operator(:) - reserved(case) ident(stop_backtrack)operator(:) - reserved(case) ident(finalize_jump)operator(:) - reserved(case) ident(maybe_finalize_jump)operator(:) - reserved(case) ident(finalize_push)operator(:) - ident(p) operator(+=) integer(2)operator(;) - reserved(break)operator(;) - - reserved(case) ident(jump_n)operator(:) - reserved(case) ident(set_number_at)operator(:) - reserved(case) ident(finalize_push_n)operator(:) - ident(p) operator(+=) integer(4)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(return) ident(must)operator(;) -operator(}) - -directive(static) pre_type(unsigned) pre_type(int) -ident(read_backslash)operator(()ident(c)operator(\)) - pre_type(int) ident(c)operator(;) -operator({) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('n')operator(:) - reserved(return) char('\\n')operator(;) - - reserved(case) char('t')operator(:) - reserved(return) char('\\t')operator(;) - - reserved(case) char('r')operator(:) - reserved(return) char('\\r')operator(;) - - reserved(case) char('f')operator(:) - reserved(return) char('\\f')operator(;) - - reserved(case) char('v')operator(:) - reserved(return) char('\\v')operator(;) - - reserved(case) char('a')operator(:) - reserved(return) char('\\007')operator(;) - - reserved(case) char('b')operator(:) - reserved(return) char('\\010')operator(;) - - reserved(case) char('e')operator(:) - reserved(return) char('\\033')operator(;) - operator(}) - reserved(return) ident(c)operator(;) -operator(}) - -directive(static) pre_type(unsigned) pre_type(int) -ident(read_special)operator(()ident(p)operator(,) ident(pend)operator(,) ident(pp)operator(\)) - directive(const) pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(,) operator(**)ident(pp)operator(;) -operator({) - pre_type(int) ident(c)operator(;) - - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('M')operator(:) - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(c) operator(!=) char('-')operator(\)) reserved(return) operator(-)integer(1)operator(;) - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - operator(*)ident(pp) operator(=) ident(p)operator(;) - reserved(if) operator(()ident(c) operator(==) char('\\\\')operator(\)) operator({) - reserved(return) ident(read_special)operator((--)ident(p)operator(,) ident(pend)operator(,) ident(pp)operator(\)) operator(|) hex(0x80)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) reserved(return) operator(~)integer(0)operator(;) - reserved(else) operator({) - reserved(return) operator((()ident(c) operator(&) hex(0xff)operator(\)) operator(|) hex(0x80)operator(\);) - operator(}) - - reserved(case) char('C')operator(:) - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(c) operator(!=) char('-')operator(\)) reserved(return) operator(~)integer(0)operator(;) - reserved(case) char('c')operator(:) - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - operator(*)ident(pp) operator(=) ident(p)operator(;) - reserved(if) operator(()ident(c) operator(==) char('\\\\')operator(\)) operator({) - ident(c) operator(=) ident(read_special)operator((--)ident(p)operator(,) ident(pend)operator(,) ident(pp)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('?')operator(\)) reserved(return) oct(0177)operator(;) - reserved(else) reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) reserved(return) operator(~)integer(0)operator(;) - reserved(return) ident(c) operator(&) hex(0x9f)operator(;) - reserved(default)operator(:) - operator(*)ident(pp) operator(=) ident(p) operator(+) integer(1)operator(;) - reserved(return) ident(read_backslash)operator(()ident(c)operator(\);) - operator(}) - - label(end_of_pattern:) - reserved(return) operator(~)integer(0)operator(;) -operator(}) - -comment(/* re_compile_pattern takes a regular-expression string - and converts it into a buffer full of byte commands for matching. - - PATTERN is the address of the pattern string - SIZE is the length of it. - BUFP is a struct re_pattern_buffer * which points to the info - on where to store the byte commands. - This structure contains a char * which points to the - actual space, which should have been obtained with malloc. - re_compile_pattern may use realloc to grow the buffer space. - - The number of bytes of commands can be found out by looking in - the `struct re_pattern_buffer' that bufp pointed to, after - re_compile_pattern returns. */) - -pre_type(char) operator(*) -ident(re_compile_pattern)operator(()ident(pattern)operator(,) ident(size)operator(,) ident(bufp)operator(\)) - directive(const) pre_type(char) operator(*)ident(pattern)operator(;) - pre_type(int) ident(size)operator(;) - reserved(struct) ident(re_pattern_buffer) operator(*)ident(bufp)operator(;) -operator({) - directive(register) pre_type(char) operator(*)ident(b) operator(=) ident(bufp)operator(->)ident(buffer)operator(;) - directive(register) directive(const) pre_type(char) operator(*)ident(p) operator(=) ident(pattern)operator(;) - directive(const) pre_type(char) operator(*)ident(nextp)operator(;) - directive(const) pre_type(char) operator(*)ident(pend) operator(=) ident(pattern) operator(+) ident(size)operator(;) - directive(register) pre_type(unsigned) pre_type(int) ident(c)operator(,) ident(c1) operator(=) integer(0)operator(;) - directive(const) pre_type(char) operator(*)ident(p0)operator(;) - pre_type(int) ident(numlen)operator(;) -preprocessor(#define) ident(ERROR_MSG_MAX_SIZE) integer(200) - directive(static) pre_type(char) ident(error_msg)operator([)ident(ERROR_MSG_MAX_SIZE)operator(+)integer(1)operator(];) - - comment(/* Address of the count-byte of the most recently inserted `exactn' - command. This makes it possible to tell whether a new exact-match - character can be added to that command or requires a new `exactn' - command. */) - - pre_type(char) operator(*)ident(pending_exact) operator(=) integer(0)operator(;) - - comment(/* Address of the place where a forward-jump should go to the end of - the containing expression. Each alternative of an `or', except the - last, ends with a forward-jump of this sort. */) - - pre_type(char) operator(*)ident(fixup_alt_jump) operator(=) integer(0)operator(;) - - comment(/* Address of start of the most recently finished expression. - This tells postfix * where to find the start of its operand. */) - - pre_type(char) operator(*)ident(laststart) operator(=) integer(0)operator(;) - - comment(/* In processing a repeat, 1 means zero matches is allowed. */) - - pre_type(char) ident(zero_times_ok)operator(;) - - comment(/* In processing a repeat, 1 means many matches is allowed. */) - - pre_type(char) ident(many_times_ok)operator(;) - - comment(/* In processing a repeat, 1 means non-greedy matches. */) - - pre_type(char) ident(greedy)operator(;) - - comment(/* Address of beginning of regexp, or inside of last (. */) - - pre_type(char) operator(*)ident(begalt) operator(=) ident(b)operator(;) - - comment(/* Place in the uncompiled pattern (i.e., the {\) to - which to go back if the interval is invalid. */) - directive(const) pre_type(char) operator(*)ident(beg_interval)operator(;) - - comment(/* In processing an interval, at least this many matches must be made. */) - pre_type(int) ident(lower_bound)operator(;) - - comment(/* In processing an interval, at most this many matches can be made. */) - pre_type(int) ident(upper_bound)operator(;) - - comment(/* Stack of information saved by ( and restored by \). - Five stack elements are pushed by each (: - First, the value of b. - Second, the value of fixup_alt_jump. - Third, the value of begalt. - Fourth, the value of regnum. - Fifth, the type of the paren. */) - - pre_type(int) ident(stacka)operator([)integer(40)operator(];) - pre_type(int) operator(*)ident(stackb) operator(=) ident(stacka)operator(;) - pre_type(int) operator(*)ident(stackp) operator(=) ident(stackb)operator(;) - pre_type(int) operator(*)ident(stacke) operator(=) ident(stackb) operator(+) integer(40)operator(;) - - comment(/* Counts ('s as they are encountered. Remembered for the matching \), - where it becomes the register number to put in the stop_memory - command. */) - - pre_type(int) ident(regnum) operator(=) integer(1)operator(;) - - pre_type(int) ident(range) operator(=) integer(0)operator(;) - pre_type(int) ident(had_mbchar) operator(=) integer(0)operator(;) - pre_type(int) ident(had_num_literal) operator(=) integer(0)operator(;) - pre_type(int) ident(had_char_class) operator(=) integer(0)operator(;) - - pre_type(int) ident(options) operator(=) ident(bufp)operator(->)ident(options)operator(;) - - ident(bufp)operator(->)ident(fastmap_accurate) operator(=) integer(0)operator(;) - ident(bufp)operator(->)ident(must) operator(=) integer(0)operator(;) - ident(bufp)operator(->)ident(must_skip) operator(=) integer(0)operator(;) - - comment(/* Initialize the syntax table. */) - ident(init_syntax_once)operator((\);) - - reserved(if) operator(()ident(bufp)operator(->)ident(allocated) operator(==) integer(0)operator(\)) operator({) - ident(bufp)operator(->)ident(allocated) operator(=) ident(INIT_BUF_SIZE)operator(;) - comment(/* EXTEND_BUFFER loses when bufp->allocated is 0. */) - ident(bufp)operator(->)ident(buffer) operator(=) operator(()pre_type(char)operator(*\))ident(xrealloc)operator(()ident(bufp)operator(->)ident(buffer)operator(,) ident(INIT_BUF_SIZE)operator(\);) - reserved(if) operator((!)ident(bufp)operator(->)ident(buffer)operator(\)) reserved(goto) ident(memory_exhausted)operator(;) comment(/* this not happen */) - ident(begalt) operator(=) ident(b) operator(=) ident(bufp)operator(->)ident(buffer)operator(;) - operator(}) - - reserved(while) operator(()ident(p) operator(!=) ident(pend)operator(\)) operator({) - ident(PATFETCH)operator(()ident(c)operator(\);) - - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('$')operator(:) - reserved(if) operator(()ident(bufp)operator(->)ident(options) operator(&) ident(RE_OPTION_SINGLELINE)operator(\)) operator({) - ident(BUFPUSH)operator(()ident(endbuf)operator(\);) - operator(}) - reserved(else) operator({) - ident(p0) operator(=) ident(p)operator(;) - comment(/* When testing what follows the $, - look past the \\-constructs that don't consume anything. */) - - reserved(while) operator(()ident(p0) operator(!=) ident(pend)operator(\)) operator({) - reserved(if) operator((*)ident(p0) operator(==) char('\\\\') operator(&&) ident(p0) operator(+) integer(1) operator(!=) ident(pend) - operator(&&) operator(()ident(p0)operator([)integer(1)operator(]) operator(==) char('b') operator(||) ident(p0)operator([)integer(1)operator(]) operator(==) char('B')operator(\)\)) - ident(p0) operator(+=) integer(2)operator(;) - reserved(else) - reserved(break)operator(;) - operator(}) - ident(BUFPUSH)operator(()ident(endline)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('^')operator(:) - reserved(if) operator(()ident(bufp)operator(->)ident(options) operator(&) ident(RE_OPTION_SINGLELINE)operator(\)) - ident(BUFPUSH)operator(()ident(begbuf)operator(\);) - reserved(else) - ident(BUFPUSH)operator(()ident(begline)operator(\);) - reserved(break)operator(;) - - reserved(case) char('+')operator(:) - reserved(case) char('?')operator(:) - reserved(case) char('*')operator(:) - comment(/* If there is no previous pattern, char not special. */) - reserved(if) operator((!)ident(laststart)operator(\)) operator({) - ident(snprintf)operator(()ident(error_msg)operator(,) ident(ERROR_MSG_MAX_SIZE)operator(,) - stringoperator(,) - ident(c)operator(,) ident(p)operator(-)ident(pattern)operator(\);) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) ident(error_msg)operator(\);) - operator(}) - comment(/* If there is a sequence of repetition chars, - collapse it down to just one. */) - ident(zero_times_ok) operator(=) ident(c) operator(!=) char('+')operator(;) - ident(many_times_ok) operator(=) ident(c) operator(!=) char('?')operator(;) - ident(greedy) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(p) operator(!=) ident(pend)operator(\)) operator({) - ident(PATFETCH)operator(()ident(c)operator(\);) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('?')operator(:) - ident(greedy) operator(=) integer(0)operator(;) - reserved(break)operator(;) - reserved(case) char('*')operator(:) - reserved(case) char('+')operator(:) - reserved(goto) ident(nested_meta)operator(;) - reserved(default)operator(:) - ident(PATUNFETCH)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - - label(repeat:) - comment(/* Star, etc. applied to an empty pattern is equivalent - to an empty pattern. */) - reserved(if) operator((!)ident(laststart)operator(\)) - reserved(break)operator(;) - - reserved(if) operator(()ident(greedy) operator(&&) ident(many_times_ok) operator(&&) operator(*)ident(laststart) operator(==) ident(anychar) operator(&&) ident(b) operator(-) ident(laststart) operator(<=) integer(2)operator(\)) operator({) - reserved(if) operator(()ident(b)operator([-)integer(1)operator(]) operator(==) ident(stop_paren)operator(\)) - ident(b)operator(--;) - reserved(if) operator(()ident(zero_times_ok)operator(\)) - operator(*)ident(laststart) operator(=) ident(anychar_repeat)operator(;) - reserved(else) operator({) - ident(BUFPUSH)operator(()ident(anychar_repeat)operator(\);) - operator(}) - reserved(break)operator(;) - operator(}) - comment(/* Now we know whether or not zero matches is allowed - and also whether or not two or more matches is allowed. */) - reserved(if) operator(()ident(many_times_ok)operator(\)) operator({) - comment(/* If more than one repetition is allowed, put in at the - end a backward relative jump from b to before the next - jump we're going to put in below (which jumps from - laststart to after this jump\). */) - ident(GET_BUFFER_SPACE)operator(()integer(3)operator(\);) - ident(store_jump)operator(()ident(b)operator(,)ident(greedy)operator(?)ident(maybe_finalize_jump)operator(:)ident(finalize_push)operator(,)ident(laststart)operator(-)integer(3)operator(\);) - ident(b) operator(+=) integer(3)operator(;) comment(/* Because store_jump put stuff here. */) - operator(}) - - comment(/* On failure, jump from laststart to next pattern, which will be the - end of the buffer after this jump is inserted. */) - ident(GET_BUFFER_SPACE)operator(()integer(3)operator(\);) - ident(insert_jump)operator(()ident(on_failure_jump)operator(,) ident(laststart)operator(,) ident(b) operator(+) integer(3)operator(,) ident(b)operator(\);) - ident(b) operator(+=) integer(3)operator(;) - - reserved(if) operator(()ident(zero_times_ok)operator(\)) operator({) - reserved(if) operator(()ident(greedy) operator(==) integer(0)operator(\)) operator({) - ident(GET_BUFFER_SPACE)operator(()integer(3)operator(\);) - ident(insert_jump)operator(()ident(try_next)operator(,) ident(laststart)operator(,) ident(b) operator(+) integer(3)operator(,) ident(b)operator(\);) - ident(b) operator(+=) integer(3)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - comment(/* At least one repetition is required, so insert a - `dummy_failure_jump' before the initial - `on_failure_jump' instruction of the loop. This - effects a skip over that instruction the first time - we hit that loop. */) - ident(GET_BUFFER_SPACE)operator(()integer(3)operator(\);) - ident(insert_jump)operator(()ident(dummy_failure_jump)operator(,) ident(laststart)operator(,) ident(laststart) operator(+) integer(6)operator(,) ident(b)operator(\);) - ident(b) operator(+=) integer(3)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('.')operator(:) - ident(laststart) operator(=) ident(b)operator(;) - ident(BUFPUSH)operator(()ident(anychar)operator(\);) - reserved(break)operator(;) - - reserved(case) char('[')operator(:) - reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - reserved(while) operator((()ident(b) operator(-) ident(bufp)operator(->)ident(buffer) operator(+) integer(9) operator(+) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH)operator(\)) - operator(>) ident(bufp)operator(->)ident(allocated)operator(\)) - ident(EXTEND_BUFFER)operator(;) - - ident(laststart) operator(=) ident(b)operator(;) - reserved(if) operator((*)ident(p) operator(==) char('^')operator(\)) operator({) - ident(BUFPUSH)operator(()ident(charset_not)operator(\);) - ident(p)operator(++;) - operator(}) - reserved(else) - ident(BUFPUSH)operator(()ident(charset)operator(\);) - ident(p0) operator(=) ident(p)operator(;) - - ident(BUFPUSH)operator((()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH)operator(\);) - comment(/* Clear the whole map */) - ident(memset)operator(()ident(b)operator(,) integer(0)operator(,) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH) operator(+) integer(2)operator(\);) - - ident(had_mbchar) operator(=) integer(0)operator(;) - ident(had_num_literal) operator(=) integer(0)operator(;) - ident(had_char_class) operator(=) integer(0)operator(;) - - comment(/* Read in characters and ranges, setting map bits. */) - reserved(for) operator((;;\)) operator({) - pre_type(int) ident(size)operator(;) - pre_type(unsigned) ident(last) operator(=) operator(()pre_type(unsigned)operator(\)-)integer(1)operator(;) - - reserved(if) operator((()ident(size) operator(=) ident(EXTRACT_UNSIGNED)operator((&)ident(b)operator([()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH)operator(]\)\)) operator(||) ident(current_mbctype)operator(\)) operator({) - comment(/* Ensure the space is enough to hold another interval - of multi-byte chars in charset(_not\)?. */) - ident(size) operator(=) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH) operator(+) integer(2) operator(+) ident(size)operator(*)integer(8) operator(+) integer(8)operator(;) - reserved(while) operator(()ident(b) operator(+) ident(size) operator(+) integer(1) operator(>) ident(bufp)operator(->)ident(buffer) operator(+) ident(bufp)operator(->)ident(allocated)operator(\)) - ident(EXTEND_BUFFER)operator(;) - operator(}) - label(range_retry:) - reserved(if) operator(()ident(range) operator(&&) ident(had_char_class)operator(\)) operator({) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - operator(}) - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - - reserved(if) operator(()ident(c) operator(==) char(']')operator(\)) operator({) - reserved(if) operator(()ident(p) operator(==) ident(p0) operator(+) integer(1)operator(\)) operator({) - reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - ident(re_warning)operator(()stringoperator(\);) - operator(}) - reserved(else) - comment(/* Stop if this isn't merely a ] inside a bracket - expression, but rather the end of a bracket - expression. */) - reserved(break)operator(;) - operator(}) - comment(/* Look ahead to see if it's a range when the last thing - was a character class. */) - reserved(if) operator(()ident(had_char_class) operator(&&) ident(c) operator(==) char('-') operator(&&) operator(*)ident(p) operator(!=) char(']')operator(\)) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - ident(PATFETCH_MBC)operator(()ident(c)operator(\);) - ident(had_mbchar)operator(++;) - operator(}) - ident(had_char_class) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(c) operator(==) char('-') operator(&&) operator((()ident(p) operator(!=) ident(p0) operator(+) integer(1) operator(&&) operator(*)ident(p) operator(!=) char(']')operator(\)) operator(||) - operator(()ident(p)operator([)integer(0)operator(]) operator(==) char('-') operator(&&) ident(p)operator([)integer(1)operator(]) operator(!=) char(']')operator(\)) operator(||) - ident(range)operator(\)\)) - ident(re_warning)operator(()stringoperator(\);) - reserved(if) operator(()ident(c) operator(==) char('[') operator(&&) operator(*)ident(p) operator(!=) char(':')operator(\)) - ident(re_warning)operator(()stringoperator(\);) - - comment(/* \\ escapes characters when inside [...]. */) - reserved(if) operator(()ident(c) operator(==) char('\\\\')operator(\)) operator({) - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('w')operator(:) - reserved(for) operator(()ident(c) operator(=) integer(0)operator(;) ident(c) operator(<) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\);) ident(c)operator(++\)) operator({) - reserved(if) operator(()ident(SYNTAX)operator(()ident(c)operator(\)) operator(==) ident(Sword) operator(||) - operator((!)ident(current_mbctype) operator(&&) ident(SYNTAX)operator(()ident(c)operator(\)) operator(==) ident(Sword2)operator(\)\)) - ident(SET_LIST_BIT)operator(()ident(c)operator(\);) - operator(}) - reserved(if) operator(()ident(current_mbctype)operator(\)) operator({) - ident(set_list_bits)operator(()hex(0x80)operator(,) hex(0xffffffff)operator(,) ident(b)operator(\);) - operator(}) - ident(had_char_class) operator(=) integer(1)operator(;) - ident(last) operator(=) operator(-)integer(1)operator(;) - reserved(continue)operator(;) - - reserved(case) char('W')operator(:) - reserved(for) operator(()ident(c) operator(=) integer(0)operator(;) ident(c) operator(<) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\);) ident(c)operator(++\)) operator({) - reserved(if) operator(()ident(SYNTAX)operator(()ident(c)operator(\)) operator(!=) ident(Sword) operator(&&) - operator((()ident(current_mbctype) operator(&&) operator(!)ident(re_mbctab)operator([)ident(c)operator(]\)) operator(||) - operator((!)ident(current_mbctype) operator(&&) ident(SYNTAX)operator(()ident(c)operator(\)) operator(!=) ident(Sword2)operator(\)\)\)) - ident(SET_LIST_BIT)operator(()ident(c)operator(\);) - operator(}) - ident(had_char_class) operator(=) integer(1)operator(;) - ident(last) operator(=) operator(-)integer(1)operator(;) - reserved(continue)operator(;) - - reserved(case) char('s')operator(:) - reserved(for) operator(()ident(c) operator(=) integer(0)operator(;) ident(c) operator(<) integer(256)operator(;) ident(c)operator(++\)) - reserved(if) operator(()ident(ISSPACE)operator(()ident(c)operator(\)\)) - ident(SET_LIST_BIT)operator(()ident(c)operator(\);) - ident(had_char_class) operator(=) integer(1)operator(;) - ident(last) operator(=) operator(-)integer(1)operator(;) - reserved(continue)operator(;) - - reserved(case) char('S')operator(:) - reserved(for) operator(()ident(c) operator(=) integer(0)operator(;) ident(c) operator(<) integer(256)operator(;) ident(c)operator(++\)) - reserved(if) operator((!)ident(ISSPACE)operator(()ident(c)operator(\)\)) - ident(SET_LIST_BIT)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(current_mbctype)operator(\)) - ident(set_list_bits)operator(()hex(0x80)operator(,) hex(0xffffffff)operator(,) ident(b)operator(\);) - ident(had_char_class) operator(=) integer(1)operator(;) - ident(last) operator(=) operator(-)integer(1)operator(;) - reserved(continue)operator(;) - - reserved(case) char('d')operator(:) - reserved(for) operator(()ident(c) operator(=) char('0')operator(;) ident(c) operator(<=) char('9')operator(;) ident(c)operator(++\)) - ident(SET_LIST_BIT)operator(()ident(c)operator(\);) - ident(had_char_class) operator(=) integer(1)operator(;) - ident(last) operator(=) operator(-)integer(1)operator(;) - reserved(continue)operator(;) - - reserved(case) char('D')operator(:) - reserved(for) operator(()ident(c) operator(=) integer(0)operator(;) ident(c) operator(<) integer(256)operator(;) ident(c)operator(++\)) - reserved(if) operator((!)ident(ISDIGIT)operator(()ident(c)operator(\)\)) - ident(SET_LIST_BIT)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(current_mbctype)operator(\)) - ident(set_list_bits)operator(()hex(0x80)operator(,) hex(0xffffffff)operator(,) ident(b)operator(\);) - ident(had_char_class) operator(=) integer(1)operator(;) - ident(last) operator(=) operator(-)integer(1)operator(;) - reserved(continue)operator(;) - - reserved(case) char('x')operator(:) - ident(c) operator(=) ident(scan_hex)operator(()ident(p)operator(,) integer(2)operator(,) operator(&)ident(numlen)operator(\);) - reserved(if) operator(()ident(numlen) operator(==) integer(0)operator(\)) reserved(goto) ident(invalid_escape)operator(;) - ident(p) operator(+=) ident(numlen)operator(;) - ident(had_num_literal) operator(=) integer(1)operator(;) - reserved(break)operator(;) - - reserved(case) char('0')operator(:) reserved(case) char('1')operator(:) reserved(case) char('2')operator(:) reserved(case) char('3')operator(:) reserved(case) char('4')operator(:) - reserved(case) char('5')operator(:) reserved(case) char('6')operator(:) reserved(case) char('7')operator(:) reserved(case) char('8')operator(:) reserved(case) char('9')operator(:) - ident(PATUNFETCH)operator(;) - ident(c) operator(=) ident(scan_oct)operator(()ident(p)operator(,) integer(3)operator(,) operator(&)ident(numlen)operator(\);) - ident(p) operator(+=) ident(numlen)operator(;) - ident(had_num_literal) operator(=) integer(1)operator(;) - reserved(break)operator(;) - - reserved(case) char('M')operator(:) - reserved(case) char('C')operator(:) - reserved(case) char('c')operator(:) - operator({) - directive(const) pre_type(char) operator(*)ident(pp)operator(;) - - operator(--)ident(p)operator(;) - ident(c) operator(=) ident(read_special)operator(()ident(p)operator(,) ident(pend)operator(,) operator(&)ident(pp)operator(\);) - reserved(if) operator(()ident(c) operator(>) integer(255)operator(\)) reserved(goto) ident(invalid_escape)operator(;) - ident(p) operator(=) ident(pp)operator(;) - ident(had_num_literal) operator(=) integer(1)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(c) operator(=) ident(read_backslash)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - ident(PATFETCH_MBC)operator(()ident(c)operator(\);) - ident(had_mbchar)operator(++;) - operator(}) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('[') operator(&&) operator(*)ident(p) operator(==) char(':')operator(\)) operator({) comment(/* [:...:] */) - comment(/* Leave room for the null. */) - pre_type(char) ident(str)operator([)ident(CHAR_CLASS_MAX_LENGTH) operator(+) integer(1)operator(];) - - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - ident(c1) operator(=) integer(0)operator(;) - - comment(/* If pattern is `[[:'. */) - reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - - reserved(for) operator((;;\)) operator({) - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(c) operator(==) char(':') operator(||) ident(c) operator(==) char(']') operator(||) ident(p) operator(==) ident(pend) - operator(||) ident(c1) operator(==) ident(CHAR_CLASS_MAX_LENGTH)operator(\)) - reserved(break)operator(;) - ident(str)operator([)ident(c1)operator(++]) operator(=) ident(c)operator(;) - operator(}) - ident(str)operator([)ident(c1)operator(]) operator(=) char('\\0')operator(;) - - comment(/* If isn't a word bracketed by `[:' and `:]': - undo the ending character, the letters, and - the leading `:' and `['. */) - reserved(if) operator(()ident(c) operator(==) char(':') operator(&&) operator(*)ident(p) operator(==) char(']')operator(\)) operator({) - pre_type(int) ident(ch)operator(;) - pre_type(char) ident(is_alnum) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - pre_type(char) ident(is_alpha) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - pre_type(char) ident(is_blank) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - pre_type(char) ident(is_cntrl) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - pre_type(char) ident(is_digit) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - pre_type(char) ident(is_graph) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - pre_type(char) ident(is_lower) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - pre_type(char) ident(is_print) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - pre_type(char) ident(is_punct) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - pre_type(char) ident(is_space) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - pre_type(char) ident(is_upper) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - pre_type(char) ident(is_xdigit) operator(=) ident(STREQ)operator(()ident(str)operator(,) stringoperator(\);) - - reserved(if) operator((!)ident(IS_CHAR_CLASS)operator(()ident(str)operator(\)\){) - ident(snprintf)operator(()ident(error_msg)operator(,) ident(ERROR_MSG_MAX_SIZE)operator(,) - stringoperator(,) ident(str)operator(\);) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) ident(error_msg)operator(\);) - operator(}) - - comment(/* Throw away the ] at the end of the character class. */) - ident(PATFETCH)operator(()ident(c)operator(\);) - - reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - - reserved(for) operator(()ident(ch) operator(=) integer(0)operator(;) ident(ch) operator(<) integer(1) operator(<<) ident(BYTEWIDTH)operator(;) ident(ch)operator(++\)) operator({) - reserved(if) operator(() operator(()ident(is_alnum) operator(&&) ident(ISALNUM)operator(()ident(ch)operator(\)\)) - operator(||) operator(()ident(is_alpha) operator(&&) ident(ISALPHA)operator(()ident(ch)operator(\)\)) - operator(||) operator(()ident(is_blank) operator(&&) ident(ISBLANK)operator(()ident(ch)operator(\)\)) - operator(||) operator(()ident(is_cntrl) operator(&&) ident(ISCNTRL)operator(()ident(ch)operator(\)\)) - operator(||) operator(()ident(is_digit) operator(&&) ident(ISDIGIT)operator(()ident(ch)operator(\)\)) - operator(||) operator(()ident(is_graph) operator(&&) ident(ISGRAPH)operator(()ident(ch)operator(\)\)) - operator(||) operator(()ident(is_lower) operator(&&) ident(ISLOWER)operator(()ident(ch)operator(\)\)) - operator(||) operator(()ident(is_print) operator(&&) ident(ISPRINT)operator(()ident(ch)operator(\)\)) - operator(||) operator(()ident(is_punct) operator(&&) ident(ISPUNCT)operator(()ident(ch)operator(\)\)) - operator(||) operator(()ident(is_space) operator(&&) ident(ISSPACE)operator(()ident(ch)operator(\)\)) - operator(||) operator(()ident(is_upper) operator(&&) ident(ISUPPER)operator(()ident(ch)operator(\)\)) - operator(||) operator(()ident(is_xdigit) operator(&&) ident(ISXDIGIT)operator(()ident(ch)operator(\)\)\)) - ident(SET_LIST_BIT)operator(()ident(ch)operator(\);) - operator(}) - ident(had_char_class) operator(=) integer(1)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(else) operator({) - ident(c1) operator(+=) integer(2)operator(;) - reserved(while) operator(()ident(c1)operator(--\)) - ident(PATUNFETCH)operator(;) - ident(re_warning)operator(()stringoperator(\);) - ident(c) operator(=) char('[')operator(;) - operator(}) - operator(}) - - comment(/* Get a range. */) - reserved(if) operator(()ident(range)operator(\)) operator({) - reserved(if) operator(()ident(last) operator(>) ident(c)operator(\)) - reserved(goto) ident(invalid_pattern)operator(;) - - ident(range) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(had_mbchar) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(TRANSLATE_P)operator((\)\)) operator({) - reserved(for) operator((;)ident(last)operator(<=)ident(c)operator(;)ident(last)operator(++\)) - ident(SET_LIST_BIT)operator(()ident(translate)operator([)ident(last)operator(]\);) - operator(}) - reserved(else) operator({) - reserved(for) operator((;)ident(last)operator(<=)ident(c)operator(;)ident(last)operator(++\)) - ident(SET_LIST_BIT)operator(()ident(last)operator(\);) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(had_mbchar) operator(==) integer(2)operator(\)) operator({) - ident(set_list_bits)operator(()ident(last)operator(,) ident(c)operator(,) ident(b)operator(\);) - operator(}) - reserved(else) operator({) - comment(/* restriction: range between sbc and mbc */) - reserved(goto) ident(invalid_pattern)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(p)operator([)integer(0)operator(]) operator(==) char('-') operator(&&) ident(p)operator([)integer(1)operator(]) operator(!=) char(']')operator(\)) operator({) - ident(last) operator(=) ident(c)operator(;) - ident(PATFETCH_RAW)operator(()ident(c1)operator(\);) - ident(range) operator(=) integer(1)operator(;) - reserved(goto) ident(range_retry)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(TRANSLATE_P)operator((\)) operator(&&) ident(c) operator(<) hex(0x100)operator(\)) ident(c) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(translate)operator([)ident(c)operator(];) - reserved(if) operator(()ident(had_mbchar) operator(==) integer(0) operator(&&) operator((!)ident(current_mbctype) operator(||) operator(!)ident(had_num_literal)operator(\)\)) operator({) - ident(SET_LIST_BIT)operator(()ident(c)operator(\);) - ident(had_num_literal) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(set_list_bits)operator(()ident(c)operator(,) ident(c)operator(,) ident(b)operator(\);) - operator(}) - operator(}) - ident(had_mbchar) operator(=) integer(0)operator(;) - operator(}) - - comment(/* Discard any character set/class bitmap bytes that are all - 0 at the end of the map. Decrement the map-length byte too. */) - reserved(while) operator((()pre_type(int)operator(\))ident(b)operator([-)integer(1)operator(]) operator(>) integer(0) operator(&&) ident(b)operator([)ident(b)operator([-)integer(1)operator(]) operator(-) integer(1)operator(]) operator(==) integer(0)operator(\)) - ident(b)operator([-)integer(1)operator(]--;) - reserved(if) operator(()ident(b)operator([-)integer(1)operator(]) operator(!=) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH)operator(\)) - ident(memmove)operator((&)ident(b)operator([()pre_type(unsigned) pre_type(char)operator(\))ident(b)operator([-)integer(1)operator(]],) operator(&)ident(b)operator([()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH)operator(],) - integer(2) operator(+) ident(EXTRACT_UNSIGNED)operator((&)ident(b)operator([()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH)operator(]\)*)integer(8)operator(\);) - ident(b) operator(+=) ident(b)operator([-)integer(1)operator(]) operator(+) integer(2) operator(+) ident(EXTRACT_UNSIGNED)operator((&)ident(b)operator([()pre_type(unsigned) pre_type(char)operator(\))ident(b)operator([-)integer(1)operator(]]\)*)integer(8)operator(;) - ident(had_num_literal) operator(=) integer(0)operator(;) - reserved(break)operator(;) - - reserved(case) char('(')operator(:) - operator({) - pre_type(int) ident(old_options) operator(=) ident(options)operator(;) - pre_type(int) ident(push_option) operator(=) integer(0)operator(;) - pre_type(int) ident(casefold) operator(=) integer(0)operator(;) - - ident(PATFETCH)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(c) operator(==) char('?')operator(\)) operator({) - pre_type(int) ident(negative) operator(=) integer(0)operator(;) - - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('x')operator(:) reserved(case) char('m')operator(:) reserved(case) char('i')operator(:) reserved(case) char('-')operator(:) - reserved(for) operator((;;\)) operator({) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('-')operator(:) - ident(negative) operator(=) integer(1)operator(;) - reserved(break)operator(;) - - reserved(case) char(':')operator(:) - reserved(case) char('\)')operator(:) - reserved(break)operator(;) - - reserved(case) char('x')operator(:) - reserved(if) operator(()ident(negative)operator(\)) - ident(options) operator(&=) operator(~)ident(RE_OPTION_EXTENDED)operator(;) - reserved(else) - ident(options) operator(|=) ident(RE_OPTION_EXTENDED)operator(;) - reserved(break)operator(;) - - reserved(case) char('m')operator(:) - reserved(if) operator(()ident(negative)operator(\)) operator({) - reserved(if) operator(()ident(options)operator(&)ident(RE_OPTION_MULTILINE)operator(\)) operator({) - ident(options) operator(&=) operator(~)ident(RE_OPTION_MULTILINE)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator((!()ident(options)operator(&)ident(RE_OPTION_MULTILINE)operator(\)\)) operator({) - ident(options) operator(|=) ident(RE_OPTION_MULTILINE)operator(;) - operator(}) - ident(push_option) operator(=) integer(1)operator(;) - reserved(break)operator(;) - - reserved(case) char('i')operator(:) - reserved(if) operator(()ident(negative)operator(\)) operator({) - reserved(if) operator(()ident(options)operator(&)ident(RE_OPTION_IGNORECASE)operator(\)) operator({) - ident(options) operator(&=) operator(~)ident(RE_OPTION_IGNORECASE)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator((!()ident(options)operator(&)ident(RE_OPTION_IGNORECASE)operator(\)\)) operator({) - ident(options) operator(|=) ident(RE_OPTION_IGNORECASE)operator(;) - operator(}) - ident(casefold) operator(=) integer(1)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('\)')operator(\)) operator({) - ident(c) operator(=) char('#')operator(;) comment(/* read whole in-line options */) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char(':')operator(\)) reserved(break)operator(;) - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('#')operator(:) - reserved(for) operator((;;\)) operator({) - ident(PATFETCH)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(c) operator(==) char('\)')operator(\)) reserved(break)operator(;) - operator(}) - ident(c) operator(=) char('#')operator(;) - reserved(break)operator(;) - - reserved(case) char(':')operator(:) - reserved(case) char('=')operator(:) - reserved(case) char('!')operator(:) - reserved(case) char('>')operator(:) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(PATUNFETCH)operator(;) - ident(c) operator(=) char('(')operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(==) char('#')operator(\)) operator({) - reserved(if) operator(()ident(push_option)operator(\)) operator({) - ident(BUFPUSH)operator(()ident(option_set)operator(\);) - ident(BUFPUSH)operator(()ident(options)operator(\);) - operator(}) - reserved(if) operator(()ident(casefold)operator(\)) operator({) - reserved(if) operator(()ident(options) operator(&) ident(RE_OPTION_IGNORECASE)operator(\)) - ident(BUFPUSH)operator(()ident(casefold_on)operator(\);) - reserved(else) - ident(BUFPUSH)operator(()ident(casefold_off)operator(\);) - operator(}) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(stackp)operator(+)integer(8) operator(>=) ident(stacke)operator(\)) operator({) - ident(DOUBLE_STACK)operator(()pre_type(int)operator(\);) - operator(}) - - comment(/* Laststart should point to the start_memory that we are about - to push (unless the pattern has RE_NREGS or more ('s\). */) - comment(/* obsolete: now RE_NREGS is just a default register size. */) - operator(*)ident(stackp)operator(++) operator(=) ident(b) operator(-) ident(bufp)operator(->)ident(buffer)operator(;) - operator(*)ident(stackp)operator(++) operator(=) ident(fixup_alt_jump) operator(?) ident(fixup_alt_jump) operator(-) ident(bufp)operator(->)ident(buffer) operator(+) integer(1) operator(:) integer(0)operator(;) - operator(*)ident(stackp)operator(++) operator(=) ident(begalt) operator(-) ident(bufp)operator(->)ident(buffer)operator(;) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('(')operator(:) - ident(BUFPUSH)operator(()ident(start_memory)operator(\);) - ident(BUFPUSH)operator(()ident(regnum)operator(\);) - operator(*)ident(stackp)operator(++) operator(=) ident(regnum)operator(++;) - operator(*)ident(stackp)operator(++) operator(=) ident(b) operator(-) ident(bufp)operator(->)ident(buffer)operator(;) - ident(BUFPUSH)operator(()integer(0)operator(\);) - comment(/* too many (\)'s to fit in a byte. (max 254\) */) - reserved(if) operator(()ident(regnum) operator(>=) ident(RE_REG_MAX)operator(\)) reserved(goto) ident(too_big)operator(;) - reserved(break)operator(;) - - reserved(case) char('=')operator(:) - reserved(case) char('!')operator(:) - reserved(case) char('>')operator(:) - ident(BUFPUSH)operator(()ident(start_nowidth)operator(\);) - operator(*)ident(stackp)operator(++) operator(=) ident(b) operator(-) ident(bufp)operator(->)ident(buffer)operator(;) - ident(BUFPUSH)operator(()integer(0)operator(\);) comment(/* temporary value */) - ident(BUFPUSH)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(c) operator(!=) char('!')operator(\)) reserved(break)operator(;) - - ident(BUFPUSH)operator(()ident(on_failure_jump)operator(\);) - operator(*)ident(stackp)operator(++) operator(=) ident(b) operator(-) ident(bufp)operator(->)ident(buffer)operator(;) - ident(BUFPUSH)operator(()integer(0)operator(\);) comment(/* temporary value */) - ident(BUFPUSH)operator(()integer(0)operator(\);) - reserved(break)operator(;) - - reserved(case) char(':')operator(:) - ident(BUFPUSH)operator(()ident(start_paren)operator(\);) - ident(pending_exact) operator(=) integer(0)operator(;) - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(push_option)operator(\)) operator({) - ident(BUFPUSH)operator(()ident(option_set)operator(\);) - ident(BUFPUSH)operator(()ident(options)operator(\);) - operator(}) - reserved(if) operator(()ident(casefold)operator(\)) operator({) - reserved(if) operator(()ident(options) operator(&) ident(RE_OPTION_IGNORECASE)operator(\)) - ident(BUFPUSH)operator(()ident(casefold_on)operator(\);) - reserved(else) - ident(BUFPUSH)operator(()ident(casefold_off)operator(\);) - operator(}) - operator(*)ident(stackp)operator(++) operator(=) ident(c)operator(;) - operator(*)ident(stackp)operator(++) operator(=) ident(old_options)operator(;) - ident(fixup_alt_jump) operator(=) integer(0)operator(;) - ident(laststart) operator(=) integer(0)operator(;) - ident(begalt) operator(=) ident(b)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('\)')operator(:) - reserved(if) operator(()ident(stackp) operator(==) ident(stackb)operator(\)) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - - ident(pending_exact) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(fixup_alt_jump)operator(\)) operator({) - comment(/* Push a dummy failure point at the end of the - alternative for a possible future - `finalize_jump' to pop. See comments at - `push_dummy_failure' in `re_match'. */) - ident(BUFPUSH)operator(()ident(push_dummy_failure)operator(\);) - - comment(/* We allocated space for this jump when we assigned - to `fixup_alt_jump', in the `handle_alt' case below. */) - ident(store_jump)operator(()ident(fixup_alt_jump)operator(,) ident(jump)operator(,) ident(b)operator(\);) - operator(}) - reserved(if) operator(()ident(options) operator(!=) ident(stackp)operator([-)integer(1)operator(]\)) operator({) - reserved(if) operator((()ident(options) operator(^) ident(stackp)operator([-)integer(1)operator(]\)) operator(&) ident(RE_OPTION_IGNORECASE)operator(\)) operator({) - ident(BUFPUSH)operator((()ident(options)operator(&)ident(RE_OPTION_IGNORECASE)operator(\)?)ident(casefold_off)operator(:)ident(casefold_on)operator(\);) - operator(}) - reserved(if) operator((()ident(options) operator(^) ident(stackp)operator([-)integer(1)operator(]\)) operator(!=) ident(RE_OPTION_IGNORECASE)operator(\)) operator({) - ident(BUFPUSH)operator(()ident(option_set)operator(\);) - ident(BUFPUSH)operator(()ident(stackp)operator([-)integer(1)operator(]\);) - operator(}) - operator(}) - ident(p0) operator(=) ident(b)operator(;) - ident(options) operator(=) operator(*--)ident(stackp)operator(;) - reserved(switch) operator(()ident(c) operator(=) operator(*--)ident(stackp)operator(\)) operator({) - reserved(case) char('(')operator(:) - operator({) - pre_type(char) operator(*)ident(loc) operator(=) ident(bufp)operator(->)ident(buffer) operator(+) operator(*--)ident(stackp)operator(;) - operator(*)ident(loc) operator(=) ident(regnum) operator(-) ident(stackp)operator([-)integer(1)operator(];) - ident(BUFPUSH)operator(()ident(stop_memory)operator(\);) - ident(BUFPUSH)operator(()ident(stackp)operator([-)integer(1)operator(]\);) - ident(BUFPUSH)operator(()ident(regnum) operator(-) ident(stackp)operator([-)integer(1)operator(]\);) - ident(stackp)operator(--;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('!')operator(:) - ident(BUFPUSH)operator(()ident(pop_and_fail)operator(\);) - comment(/* back patch */) - ident(STORE_NUMBER)operator(()ident(bufp)operator(->)ident(buffer)operator(+)ident(stackp)operator([-)integer(1)operator(],) ident(b) operator(-) ident(bufp)operator(->)ident(buffer) operator(-) ident(stackp)operator([-)integer(1)operator(]) operator(-) integer(2)operator(\);) - ident(stackp)operator(--;) - comment(/* fall through */) - reserved(case) char('=')operator(:) - ident(BUFPUSH)operator(()ident(stop_nowidth)operator(\);) - comment(/* tell stack-pos place to start_nowidth */) - ident(STORE_NUMBER)operator(()ident(bufp)operator(->)ident(buffer)operator(+)ident(stackp)operator([-)integer(1)operator(],) ident(b) operator(-) ident(bufp)operator(->)ident(buffer) operator(-) ident(stackp)operator([-)integer(1)operator(]) operator(-) integer(2)operator(\);) - ident(BUFPUSH)operator(()integer(0)operator(\);) comment(/* space to hold stack pos */) - ident(BUFPUSH)operator(()integer(0)operator(\);) - ident(stackp)operator(--;) - reserved(break)operator(;) - - reserved(case) char('>')operator(:) - ident(BUFPUSH)operator(()ident(stop_backtrack)operator(\);) - comment(/* tell stack-pos place to start_nowidth */) - ident(STORE_NUMBER)operator(()ident(bufp)operator(->)ident(buffer)operator(+)ident(stackp)operator([-)integer(1)operator(],) ident(b) operator(-) ident(bufp)operator(->)ident(buffer) operator(-) ident(stackp)operator([-)integer(1)operator(]) operator(-) integer(2)operator(\);) - ident(BUFPUSH)operator(()integer(0)operator(\);) comment(/* space to hold stack pos */) - ident(BUFPUSH)operator(()integer(0)operator(\);) - ident(stackp)operator(--;) - reserved(break)operator(;) - - reserved(case) char(':')operator(:) - ident(BUFPUSH)operator(()ident(stop_paren)operator(\);) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - ident(begalt) operator(=) operator(*--)ident(stackp) operator(+) ident(bufp)operator(->)ident(buffer)operator(;) - ident(stackp)operator(--;) - ident(fixup_alt_jump) operator(=) operator(*)ident(stackp) operator(?) operator(*)ident(stackp) operator(+) ident(bufp)operator(->)ident(buffer) operator(-) integer(1) operator(:) integer(0)operator(;) - ident(laststart) operator(=) operator(*--)ident(stackp) operator(+) ident(bufp)operator(->)ident(buffer)operator(;) - reserved(if) operator(()ident(c) operator(==) char('!') operator(||) ident(c) operator(==) char('=')operator(\)) ident(laststart) operator(=) ident(b)operator(;) - reserved(break)operator(;) - - reserved(case) char('|')operator(:) - comment(/* Insert before the previous alternative a jump which - jumps to this alternative if the former fails. */) - ident(GET_BUFFER_SPACE)operator(()integer(3)operator(\);) - ident(insert_jump)operator(()ident(on_failure_jump)operator(,) ident(begalt)operator(,) ident(b) operator(+) integer(6)operator(,) ident(b)operator(\);) - ident(pending_exact) operator(=) integer(0)operator(;) - ident(b) operator(+=) integer(3)operator(;) - comment(/* The alternative before this one has a jump after it - which gets executed if it gets matched. Adjust that - jump so it will jump to this alternative's analogous - jump (put in below, which in turn will jump to the next - (if any\) alternative's such jump, etc.\). The last such - jump jumps to the correct final destination. A picture: - _____ _____ - | | | | - | v | v - a | b | c - - If we are at `b', then fixup_alt_jump right now points to a - three-byte space after `a'. We'll put in the jump, set - fixup_alt_jump to right after `b', and leave behind three - bytes which we'll fill in when we get to after `c'. */) - - reserved(if) operator(()ident(fixup_alt_jump)operator(\)) - ident(store_jump)operator(()ident(fixup_alt_jump)operator(,) ident(jump_past_alt)operator(,) ident(b)operator(\);) - - comment(/* Mark and leave space for a jump after this alternative, - to be filled in later either by next alternative or - when know we're at the end of a series of alternatives. */) - ident(fixup_alt_jump) operator(=) ident(b)operator(;) - ident(GET_BUFFER_SPACE)operator(()integer(3)operator(\);) - ident(b) operator(+=) integer(3)operator(;) - - ident(laststart) operator(=) integer(0)operator(;) - ident(begalt) operator(=) ident(b)operator(;) - reserved(break)operator(;) - - reserved(case) char('{')operator(:) - comment(/* If there is no previous pattern, this is an invalid pattern. */) - reserved(if) operator((!)ident(laststart)operator(\)) operator({) - ident(snprintf)operator(()ident(error_msg)operator(,) ident(ERROR_MSG_MAX_SIZE)operator(,) - stringoperator(,) - ident(p)operator(-)ident(pattern)operator(\);) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) ident(error_msg)operator(\);) - operator(}) - reserved(if)operator(() ident(p) operator(==) ident(pend)operator(\)) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) string operator(\);) - - ident(beg_interval) operator(=) ident(p) operator(-) integer(1)operator(;) - - ident(lower_bound) operator(=) operator(-)integer(1)operator(;) comment(/* So can see if are set. */) - ident(upper_bound) operator(=) operator(-)integer(1)operator(;) - ident(GET_UNSIGNED_NUMBER)operator(()ident(lower_bound)operator(\);) - reserved(if) operator(()ident(c) operator(==) char(',')operator(\)) operator({) - ident(GET_UNSIGNED_NUMBER)operator(()ident(upper_bound)operator(\);) - operator(}) - reserved(else) - comment(/* Interval such as `{1}' => match exactly once. */) - ident(upper_bound) operator(=) ident(lower_bound)operator(;) - - reserved(if) operator(()ident(lower_bound) operator(<) integer(0) operator(||) ident(c) operator(!=) char('}')operator(\)) - reserved(goto) ident(unfetch_interval)operator(;) - - reserved(if) operator(()ident(lower_bound) operator(>=) ident(RE_DUP_MAX) operator(||) ident(upper_bound) operator(>=) ident(RE_DUP_MAX)operator(\)) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - reserved(if) operator(()ident(upper_bound) operator(<) integer(0)operator(\)) ident(upper_bound) operator(=) ident(RE_DUP_MAX)operator(;) - reserved(if) operator(()ident(lower_bound) operator(>) ident(upper_bound)operator(\)) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) string m)delimiter(")>operator(\);) - - ident(beg_interval) operator(=) integer(0)operator(;) - ident(pending_exact) operator(=) integer(0)operator(;) - - ident(greedy) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(p) operator(!=) ident(pend)operator(\)) operator({) - ident(PATFETCH)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(c) operator(==) char('?')operator(\)) ident(greedy) operator(=) integer(0)operator(;) - reserved(else) ident(PATUNFETCH)operator(;) - operator(}) - - reserved(if) operator(()ident(lower_bound) operator(==) integer(0)operator(\)) operator({) - ident(zero_times_ok) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(upper_bound) operator(==) ident(RE_DUP_MAX)operator(\)) operator({) - ident(many_times_ok) operator(=) integer(1)operator(;) - reserved(goto) ident(repeat)operator(;) - operator(}) - reserved(if) operator(()ident(upper_bound) operator(==) integer(1)operator(\)) operator({) - ident(many_times_ok) operator(=) integer(0)operator(;) - reserved(goto) ident(repeat)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(lower_bound) operator(==) integer(1)operator(\)) operator({) - reserved(if) operator(()ident(upper_bound) operator(==) integer(1)operator(\)) operator({) - comment(/* No need to repeat */) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(upper_bound) operator(==) ident(RE_DUP_MAX)operator(\)) operator({) - ident(many_times_ok) operator(=) integer(1)operator(;) - ident(zero_times_ok) operator(=) integer(0)operator(;) - reserved(goto) ident(repeat)operator(;) - operator(}) - operator(}) - - comment(/* If upper_bound is zero, don't want to succeed at all; - jump from laststart to b + 3, which will be the end of - the buffer after this jump is inserted. */) - - reserved(if) operator(()ident(upper_bound) operator(==) integer(0)operator(\)) operator({) - ident(GET_BUFFER_SPACE)operator(()integer(3)operator(\);) - ident(insert_jump)operator(()ident(jump)operator(,) ident(laststart)operator(,) ident(b) operator(+) integer(3)operator(,) ident(b)operator(\);) - ident(b) operator(+=) integer(3)operator(;) - reserved(break)operator(;) - operator(}) - - comment(/* If lower_bound == upper_bound, repeat count can be removed */) - reserved(if) operator(()ident(lower_bound) operator(==) ident(upper_bound)operator(\)) operator({) - pre_type(int) ident(mcnt)operator(;) - pre_type(int) ident(skip_stop_paren) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(b)operator([-)integer(1)operator(]) operator(==) ident(stop_paren)operator(\)) operator({) - ident(skip_stop_paren) operator(=) integer(1)operator(;) - ident(b)operator(--;) - operator(}) - - reserved(if) operator((*)ident(laststart) operator(==) ident(exactn) operator(&&) ident(laststart)operator([)integer(1)operator(]+)integer(2) operator(==) ident(b) operator(-) ident(laststart) - operator(&&) ident(laststart)operator([)integer(1)operator(]*)ident(lower_bound) operator(<) integer(256)operator(\)) operator({) - ident(mcnt) operator(=) ident(laststart)operator([)integer(1)operator(];) - ident(GET_BUFFER_SPACE)operator((()ident(lower_bound)operator(-)integer(1)operator(\)*)ident(mcnt)operator(\);) - ident(laststart)operator([)integer(1)operator(]) operator(=) ident(lower_bound)operator(*)ident(mcnt)operator(;) - reserved(while) operator((--)ident(lower_bound)operator(\)) operator({) - ident(memcpy)operator(()ident(b)operator(,) ident(laststart)operator(+)integer(2)operator(,) ident(mcnt)operator(\);) - ident(b) operator(+=) ident(mcnt)operator(;) - operator(}) - reserved(if) operator(()ident(skip_stop_paren)operator(\)) ident(BUFPUSH)operator(()ident(stop_paren)operator(\);) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(()ident(lower_bound) operator(<) integer(5) operator(&&) ident(b) operator(-) ident(laststart) operator(<) integer(10)operator(\)) operator({) - comment(/* 5 and 10 are the magic numbers */) - - ident(mcnt) operator(=) ident(b) operator(-) ident(laststart)operator(;) - ident(GET_BUFFER_SPACE)operator((()ident(lower_bound)operator(-)integer(1)operator(\)*)ident(mcnt)operator(\);) - reserved(while) operator((--)ident(lower_bound)operator(\)) operator({) - ident(memcpy)operator(()ident(b)operator(,) ident(laststart)operator(,) ident(mcnt)operator(\);) - ident(b) operator(+=) ident(mcnt)operator(;) - operator(}) - reserved(if) operator(()ident(skip_stop_paren)operator(\)) ident(BUFPUSH)operator(()ident(stop_paren)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(skip_stop_paren)operator(\)) ident(b)operator(++;) comment(/* push back stop_paren */) - operator(}) - - comment(/* Otherwise, we have a nontrivial interval. When - we're all done, the pattern will look like: - set_number_at - set_number_at - succeed_n - - jump_n - (The upper bound and `jump_n' are omitted if - `upper_bound' is 1, though.\) */) - operator({) comment(/* If the upper bound is > 1, we need to insert - more at the end of the loop. */) - pre_type(unsigned) ident(nbytes) operator(=) ident(upper_bound) operator(==) integer(1) operator(?) integer(10) operator(:) integer(20)operator(;) - - ident(GET_BUFFER_SPACE)operator(()ident(nbytes)operator(\);) - comment(/* Initialize lower bound of the `succeed_n', even - though it will be set during matching by its - attendant `set_number_at' (inserted next\), - because `re_compile_fastmap' needs to know. - Jump to the `jump_n' we might insert below. */) - ident(insert_jump_n)operator(()ident(succeed_n)operator(,) ident(laststart)operator(,) ident(b) operator(+) operator(()ident(nbytes)operator(/)integer(2)operator(\),) - ident(b)operator(,) ident(lower_bound)operator(\);) - ident(b) operator(+=) integer(5)operator(;) comment(/* Just increment for the succeed_n here. */) - - comment(/* Code to initialize the lower bound. Insert - before the `succeed_n'. The `5' is the last two - bytes of this `set_number_at', plus 3 bytes of - the following `succeed_n'. */) - ident(insert_op_2)operator(()ident(set_number_at)operator(,) ident(laststart)operator(,) ident(b)operator(,) integer(5)operator(,) ident(lower_bound)operator(\);) - ident(b) operator(+=) integer(5)operator(;) - - reserved(if) operator(()ident(upper_bound) operator(>) integer(1)operator(\)) operator({) - comment(/* More than one repetition is allowed, so - append a backward jump to the `succeed_n' - that starts this interval. - - When we've reached this during matching, - we'll have matched the interval once, so - jump back only `upper_bound - 1' times. */) - ident(GET_BUFFER_SPACE)operator(()integer(5)operator(\);) - ident(store_jump_n)operator(()ident(b)operator(,) ident(greedy)operator(?)ident(jump_n)operator(:)ident(finalize_push_n)operator(,) ident(laststart) operator(+) integer(5)operator(,) - ident(upper_bound) operator(-) integer(1)operator(\);) - ident(b) operator(+=) integer(5)operator(;) - - comment(/* The location we want to set is the second - parameter of the `jump_n'; that is `b-2' as - an absolute address. `laststart' will be - the `set_number_at' we're about to insert; - `laststart+3' the number to set, the source - for the relative address. But we are - inserting into the middle of the pattern -- - so everything is getting moved up by 5. - Conclusion: (b - 2\) - (laststart + 3\) + 5, - i.e., b - laststart. - - We insert this at the beginning of the loop - so that if we fail during matching, we'll - reinitialize the bounds. */) - ident(insert_op_2)operator(()ident(set_number_at)operator(,) ident(laststart)operator(,) ident(b)operator(,) ident(b) operator(-) ident(laststart)operator(,) - ident(upper_bound) operator(-) integer(1)operator(\);) - ident(b) operator(+=) integer(5)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - label(unfetch_interval:) - comment(/* If an invalid interval, match the characters as literals. */) - ident(re_warning)operator(()stringoperator(\);) - ident(p) operator(=) ident(beg_interval)operator(;) - ident(beg_interval) operator(=) integer(0)operator(;) - - comment(/* normal_char and normal_backslash need `c'. */) - ident(PATFETCH)operator(()ident(c)operator(\);) - reserved(goto) ident(normal_char)operator(;) - - reserved(case) char('\\\\')operator(:) - reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - comment(/* Do not translate the character after the \\, so that we can - distinguish, e.g., \\B from \\b, even if we normally would - translate, e.g., B to b. */) - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('s')operator(:) - reserved(case) char('S')operator(:) - reserved(case) char('d')operator(:) - reserved(case) char('D')operator(:) - reserved(while) operator(()ident(b) operator(-) ident(bufp)operator(->)ident(buffer) operator(+) integer(9) operator(+) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH) - operator(>) ident(bufp)operator(->)ident(allocated)operator(\)) - ident(EXTEND_BUFFER)operator(;) - - ident(laststart) operator(=) ident(b)operator(;) - reserved(if) operator(()ident(c) operator(==) char('s') operator(||) ident(c) operator(==) char('d')operator(\)) operator({) - ident(BUFPUSH)operator(()ident(charset)operator(\);) - operator(}) - reserved(else) operator({) - ident(BUFPUSH)operator(()ident(charset_not)operator(\);) - operator(}) - - ident(BUFPUSH)operator((()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH)operator(\);) - ident(memset)operator(()ident(b)operator(,) integer(0)operator(,) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH) operator(+) integer(2)operator(\);) - reserved(if) operator(()ident(c) operator(==) char('s') operator(||) ident(c) operator(==) char('S')operator(\)) operator({) - ident(SET_LIST_BIT)operator(()char(' ')operator(\);) - ident(SET_LIST_BIT)operator(()char('\\t')operator(\);) - ident(SET_LIST_BIT)operator(()char('\\n')operator(\);) - ident(SET_LIST_BIT)operator(()char('\\r')operator(\);) - ident(SET_LIST_BIT)operator(()char('\\f')operator(\);) - operator(}) - reserved(else) operator({) - pre_type(char) ident(cc)operator(;) - - reserved(for) operator(()ident(cc) operator(=) char('0')operator(;) ident(cc) operator(<=) char('9')operator(;) ident(cc)operator(++\)) operator({) - ident(SET_LIST_BIT)operator(()ident(cc)operator(\);) - operator(}) - operator(}) - - reserved(while) operator((()pre_type(int)operator(\))ident(b)operator([-)integer(1)operator(]) operator(>) integer(0) operator(&&) ident(b)operator([)ident(b)operator([-)integer(1)operator(]) operator(-) integer(1)operator(]) operator(==) integer(0)operator(\)) - ident(b)operator([-)integer(1)operator(]--;) - reserved(if) operator(()ident(b)operator([-)integer(1)operator(]) operator(!=) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH)operator(\)) - ident(memmove)operator((&)ident(b)operator([()pre_type(unsigned) pre_type(char)operator(\))ident(b)operator([-)integer(1)operator(]],) operator(&)ident(b)operator([()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH)operator(],) - integer(2) operator(+) ident(EXTRACT_UNSIGNED)operator((&)ident(b)operator([()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)) operator(/) ident(BYTEWIDTH)operator(]\)*)integer(8)operator(\);) - ident(b) operator(+=) ident(b)operator([-)integer(1)operator(]) operator(+) integer(2) operator(+) ident(EXTRACT_UNSIGNED)operator((&)ident(b)operator([()pre_type(unsigned) pre_type(char)operator(\))ident(b)operator([-)integer(1)operator(]]\)*)integer(8)operator(;) - reserved(break)operator(;) - - reserved(case) char('w')operator(:) - ident(laststart) operator(=) ident(b)operator(;) - ident(BUFPUSH)operator(()ident(wordchar)operator(\);) - reserved(break)operator(;) - - reserved(case) char('W')operator(:) - ident(laststart) operator(=) ident(b)operator(;) - ident(BUFPUSH)operator(()ident(notwordchar)operator(\);) - reserved(break)operator(;) - -preprocessor(#ifndef) ident(RUBY) - reserved(case) char('<')operator(:) - ident(BUFPUSH)operator(()ident(wordbeg)operator(\);) - reserved(break)operator(;) - - reserved(case) char('>')operator(:) - ident(BUFPUSH)operator(()ident(wordend)operator(\);) - reserved(break)operator(;) -preprocessor(#endif) - - reserved(case) char('b')operator(:) - ident(BUFPUSH)operator(()ident(wordbound)operator(\);) - reserved(break)operator(;) - - reserved(case) char('B')operator(:) - ident(BUFPUSH)operator(()ident(notwordbound)operator(\);) - reserved(break)operator(;) - - reserved(case) char('A')operator(:) - ident(BUFPUSH)operator(()ident(begbuf)operator(\);) - reserved(break)operator(;) - - reserved(case) char('Z')operator(:) - reserved(if) operator((()ident(bufp)operator(->)ident(options) operator(&) ident(RE_OPTION_SINGLELINE)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(BUFPUSH)operator(()ident(endbuf2)operator(\);) - reserved(break)operator(;) - operator(}) - comment(/* fall through */) - reserved(case) char('z')operator(:) - ident(BUFPUSH)operator(()ident(endbuf)operator(\);) - reserved(break)operator(;) - - reserved(case) char('G')operator(:) - ident(BUFPUSH)operator(()ident(begpos)operator(\);) - reserved(break)operator(;) - - comment(/* hex */) - reserved(case) char('x')operator(:) - ident(had_mbchar) operator(=) integer(0)operator(;) - ident(c) operator(=) ident(scan_hex)operator(()ident(p)operator(,) integer(2)operator(,) operator(&)ident(numlen)operator(\);) - reserved(if) operator(()ident(numlen) operator(==) integer(0)operator(\)) reserved(goto) ident(invalid_escape)operator(;) - ident(p) operator(+=) ident(numlen)operator(;) - ident(had_num_literal) operator(=) integer(1)operator(;) - reserved(goto) ident(numeric_char)operator(;) - - comment(/* octal */) - reserved(case) char('0')operator(:) - ident(had_mbchar) operator(=) integer(0)operator(;) - ident(c) operator(=) ident(scan_oct)operator(()ident(p)operator(,) integer(2)operator(,) operator(&)ident(numlen)operator(\);) - ident(p) operator(+=) ident(numlen)operator(;) - ident(had_num_literal) operator(=) integer(1)operator(;) - reserved(goto) ident(numeric_char)operator(;) - - comment(/* back-ref or octal */) - reserved(case) char('1')operator(:) reserved(case) char('2')operator(:) reserved(case) char('3')operator(:) - reserved(case) char('4')operator(:) reserved(case) char('5')operator(:) reserved(case) char('6')operator(:) - reserved(case) char('7')operator(:) reserved(case) char('8')operator(:) reserved(case) char('9')operator(:) - ident(PATUNFETCH)operator(;) - ident(p0) operator(=) ident(p)operator(;) - - ident(had_mbchar) operator(=) integer(0)operator(;) - ident(c1) operator(=) integer(0)operator(;) - ident(GET_UNSIGNED_NUMBER)operator(()ident(c1)operator(\);) - reserved(if) operator((!)ident(ISDIGIT)operator(()ident(c)operator(\)\)) ident(PATUNFETCH)operator(;) - - reserved(if) operator(()integer(9) operator(<) ident(c1) operator(&&) ident(c1) operator(>=) ident(regnum)operator(\)) operator({) - comment(/* need to get octal */) - ident(c) operator(=) ident(scan_oct)operator(()ident(p0)operator(,) integer(3)operator(,) operator(&)ident(numlen)operator(\)) operator(&) hex(0xff)operator(;) - ident(p) operator(=) ident(p0) operator(+) ident(numlen)operator(;) - ident(c1) operator(=) integer(0)operator(;) - ident(had_num_literal) operator(=) integer(1)operator(;) - reserved(goto) ident(numeric_char)operator(;) - operator(}) - - ident(laststart) operator(=) ident(b)operator(;) - ident(BUFPUSH)operator(()ident(duplicate)operator(\);) - ident(BUFPUSH)operator(()ident(c1)operator(\);) - reserved(break)operator(;) - - reserved(case) char('M')operator(:) - reserved(case) char('C')operator(:) - reserved(case) char('c')operator(:) - ident(p0) operator(=) operator(--)ident(p)operator(;) - ident(c) operator(=) ident(read_special)operator(()ident(p)operator(,) ident(pend)operator(,) operator(&)ident(p0)operator(\);) - reserved(if) operator(()ident(c) operator(>) integer(255)operator(\)) reserved(goto) ident(invalid_escape)operator(;) - ident(p) operator(=) ident(p0)operator(;) - ident(had_num_literal) operator(=) integer(1)operator(;) - reserved(goto) ident(numeric_char)operator(;) - - reserved(default)operator(:) - ident(c) operator(=) ident(read_backslash)operator(()ident(c)operator(\);) - reserved(goto) ident(normal_char)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('#')operator(:) - reserved(if) operator(()ident(options) operator(&) ident(RE_OPTION_EXTENDED)operator(\)) operator({) - reserved(while) operator(()ident(p) operator(!=) ident(pend)operator(\)) operator({) - ident(PATFETCH)operator(()ident(c)operator(\);) - reserved(if) operator(()ident(c) operator(==) char('\\n')operator(\)) reserved(break)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - reserved(goto) ident(normal_char)operator(;) - - reserved(case) char(' ')operator(:) - reserved(case) char('\\t')operator(:) - reserved(case) char('\\f')operator(:) - reserved(case) char('\\r')operator(:) - reserved(case) char('\\n')operator(:) - reserved(if) operator(()ident(options) operator(&) ident(RE_OPTION_EXTENDED)operator(\)) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(if) operator(()ident(c) operator(==) char(']')operator(\)) - ident(re_warning)operator(()stringoperator(\);) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('}')operator(\)) - ident(re_warning)operator(()stringoperator(\);) - label(normal_char:) comment(/* Expects the character in `c'. */) - ident(had_mbchar) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - ident(had_mbchar) operator(=) integer(1)operator(;) - ident(c1) operator(=) ident(p) operator(-) ident(pattern)operator(;) - operator(}) - label(numeric_char:) - ident(nextp) operator(=) ident(p) operator(+) ident(mbclen)operator(()ident(c)operator(\)) operator(-) integer(1)operator(;) - reserved(if) operator((!)ident(pending_exact) operator(||) ident(pending_exact) operator(+) operator(*)ident(pending_exact) operator(+) integer(1) operator(!=) ident(b) - operator(||) operator(*)ident(pending_exact) operator(>=) operator(()ident(c1) operator(?) oct(0176) operator(:) oct(0177)operator(\)) - operator(||) operator(()ident(nextp) operator(<) ident(pend) operator(&&) - operator(() operator(*)ident(nextp) operator(==) char('+') operator(||) operator(*)ident(nextp) operator(==) char('?') - operator(||) operator(*)ident(nextp) operator(==) char('*') operator(||) operator(*)ident(nextp) operator(==) char('^') - operator(||) operator(*)ident(nextp) operator(==) char('{')operator(\)\)\)) operator({) - ident(laststart) operator(=) ident(b)operator(;) - ident(BUFPUSH)operator(()ident(exactn)operator(\);) - ident(pending_exact) operator(=) ident(b)operator(;) - ident(BUFPUSH)operator(()integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(had_num_literal) operator(||) ident(c) operator(==) hex(0xff)operator(\)) operator({) - ident(BUFPUSH)operator(()hex(0xff)operator(\);) - operator((*)ident(pending_exact)operator(\)++;) - ident(had_num_literal) operator(=) integer(0)operator(;) - operator(}) - ident(BUFPUSH)operator(()ident(c)operator(\);) - operator((*)ident(pending_exact)operator(\)++;) - reserved(if) operator(()ident(had_mbchar)operator(\)) operator({) - pre_type(int) ident(len) operator(=) ident(mbclen)operator(()ident(c)operator(\)) operator(-) integer(1)operator(;) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(PATFETCH_RAW)operator(()ident(c)operator(\);) - ident(BUFPUSH)operator(()ident(c)operator(\);) - operator((*)ident(pending_exact)operator(\)++;) - operator(}) - operator(}) - operator(}) - operator(}) - - reserved(if) operator(()ident(fixup_alt_jump)operator(\)) - ident(store_jump)operator(()ident(fixup_alt_jump)operator(,) ident(jump)operator(,) ident(b)operator(\);) - - reserved(if) operator(()ident(stackp) operator(!=) ident(stackb)operator(\)) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - - comment(/* set optimize flags */) - ident(laststart) operator(=) ident(bufp)operator(->)ident(buffer)operator(;) - reserved(if) operator(()ident(laststart) operator(!=) ident(b)operator(\)) operator({) - reserved(if) operator((*)ident(laststart) operator(==) ident(dummy_failure_jump)operator(\)) ident(laststart) operator(+=) integer(3)operator(;) - reserved(else) reserved(if) operator((*)ident(laststart) operator(==) ident(try_next)operator(\)) ident(laststart) operator(+=) integer(3)operator(;) - reserved(if) operator((*)ident(laststart) operator(==) ident(anychar_repeat)operator(\)) operator({) - ident(bufp)operator(->)ident(options) operator(|=) ident(RE_OPTIMIZE_ANCHOR)operator(;) - operator(}) - operator(}) - - ident(bufp)operator(->)ident(used) operator(=) ident(b) operator(-) ident(bufp)operator(->)ident(buffer)operator(;) - ident(bufp)operator(->)ident(re_nsub) operator(=) ident(regnum)operator(;) - ident(laststart) operator(=) ident(bufp)operator(->)ident(buffer)operator(;) - reserved(if) operator(()ident(laststart) operator(!=) ident(b)operator(\)) operator({) - reserved(if) operator((*)ident(laststart) operator(==) ident(start_memory)operator(\)) ident(laststart) operator(+=) integer(3)operator(;) - reserved(if) operator((*)ident(laststart) operator(==) ident(exactn)operator(\)) operator({) - ident(bufp)operator(->)ident(options) operator(|=) ident(RE_OPTIMIZE_EXACTN)operator(;) - ident(bufp)operator(->)ident(must) operator(=) ident(laststart)operator(+)integer(1)operator(;) - operator(}) - operator(}) - reserved(if) operator((!)ident(bufp)operator(->)ident(must)operator(\)) operator({) - ident(bufp)operator(->)ident(must) operator(=) ident(calculate_must_string)operator(()ident(bufp)operator(->)ident(buffer)operator(,) ident(b)operator(\);) - operator(}) - reserved(if) operator(()ident(current_mbctype) operator(==) ident(MBCTYPE_SJIS)operator(\)) ident(bufp)operator(->)ident(options) operator(|=) ident(RE_OPTIMIZE_NO_BM)operator(;) - reserved(else) reserved(if) operator(()ident(bufp)operator(->)ident(must)operator(\)) operator({) - pre_type(int) ident(i)operator(;) - pre_type(int) ident(len) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(bufp)operator(->)ident(must)operator([)integer(0)operator(];) - - reserved(for) operator(()ident(i)operator(=)integer(1)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator((()pre_type(unsigned) pre_type(char)operator(\))ident(bufp)operator(->)ident(must)operator([)ident(i)operator(]) operator(==) hex(0xff) operator(||) - operator(()ident(current_mbctype) operator(&&) ident(ismbchar)operator(()ident(bufp)operator(->)ident(must)operator([)ident(i)operator(]\)\)\)) operator({) - ident(bufp)operator(->)ident(options) operator(|=) ident(RE_OPTIMIZE_NO_BM)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator((!()ident(bufp)operator(->)ident(options) operator(&) ident(RE_OPTIMIZE_NO_BM)operator(\)\)) operator({) - ident(bufp)operator(->)ident(must_skip) operator(=) operator(()pre_type(int) operator(*\)) ident(xmalloc)operator((()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)*)reserved(sizeof)operator(()pre_type(int)operator(\)\);) - ident(bm_init_skip)operator(()ident(bufp)operator(->)ident(must_skip)operator(,) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(bufp)operator(->)ident(must)operator(+)integer(1)operator(,) - operator(()pre_type(unsigned) pre_type(char)operator(\))ident(bufp)operator(->)ident(must)operator([)integer(0)operator(],) - operator(()pre_type(unsigned) pre_type(char)operator(*\)()ident(MAY_TRANSLATE)operator((\)?)ident(translate)operator(:)integer(0)operator(\)\);) - operator(}) - operator(}) - - ident(bufp)operator(->)ident(regstart) operator(=) ident(TMALLOC)operator(()ident(regnum)operator(,) pre_type(unsigned) pre_type(char)operator(*\);) - ident(bufp)operator(->)ident(regend) operator(=) ident(TMALLOC)operator(()ident(regnum)operator(,) pre_type(unsigned) pre_type(char)operator(*\);) - ident(bufp)operator(->)ident(old_regstart) operator(=) ident(TMALLOC)operator(()ident(regnum)operator(,) pre_type(unsigned) pre_type(char)operator(*\);) - ident(bufp)operator(->)ident(old_regend) operator(=) ident(TMALLOC)operator(()ident(regnum)operator(,) pre_type(unsigned) pre_type(char)operator(*\);) - ident(bufp)operator(->)ident(reg_info) operator(=) ident(TMALLOC)operator(()ident(regnum)operator(,) ident(register_info_type)operator(\);) - ident(bufp)operator(->)ident(best_regstart) operator(=) ident(TMALLOC)operator(()ident(regnum)operator(,) pre_type(unsigned) pre_type(char)operator(*\);) - ident(bufp)operator(->)ident(best_regend) operator(=) ident(TMALLOC)operator(()ident(regnum)operator(,) pre_type(unsigned) pre_type(char)operator(*\);) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) integer(0)operator(\);) - - label(invalid_pattern:) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - - label(end_of_pattern:) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - - label(too_big:) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - - label(memory_exhausted:) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - - label(nested_meta:) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) - - label(invalid_escape:) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) stringoperator(\);) -operator(}) - -directive(void) -ident(re_free_pattern)operator(()ident(bufp)operator(\)) - reserved(struct) ident(re_pattern_buffer) operator(*)ident(bufp)operator(;) -operator({) - ident(xfree)operator(()ident(bufp)operator(->)ident(buffer)operator(\);) - ident(xfree)operator(()ident(bufp)operator(->)ident(fastmap)operator(\);) - reserved(if) operator(()ident(bufp)operator(->)ident(must_skip)operator(\)) ident(xfree)operator(()ident(bufp)operator(->)ident(must_skip)operator(\);) - - ident(xfree)operator(()ident(bufp)operator(->)ident(regstart)operator(\);) - ident(xfree)operator(()ident(bufp)operator(->)ident(regend)operator(\);) - ident(xfree)operator(()ident(bufp)operator(->)ident(old_regstart)operator(\);) - ident(xfree)operator(()ident(bufp)operator(->)ident(old_regend)operator(\);) - ident(xfree)operator(()ident(bufp)operator(->)ident(best_regstart)operator(\);) - ident(xfree)operator(()ident(bufp)operator(->)ident(best_regend)operator(\);) - ident(xfree)operator(()ident(bufp)operator(->)ident(reg_info)operator(\);) - ident(xfree)operator(()ident(bufp)operator(\);) -operator(}) - -comment(/* Store a jump of the form . - Store in the location FROM a jump operation to jump to relative - address FROM - TO. OPCODE is the opcode to store. */) - -directive(static) directive(void) -ident(store_jump)operator(()ident(from)operator(,) ident(opcode)operator(,) ident(to)operator(\)) - pre_type(char) operator(*)ident(from)operator(,) operator(*)ident(to)operator(;) - pre_type(int) ident(opcode)operator(;) -operator({) - ident(from)operator([)integer(0)operator(]) operator(=) operator(()pre_type(char)operator(\))ident(opcode)operator(;) - ident(STORE_NUMBER)operator(()ident(from) operator(+) integer(1)operator(,) ident(to) operator(-) operator(()ident(from) operator(+) integer(3)operator(\)\);) -operator(}) - - -comment(/* Open up space before char FROM, and insert there a jump to TO. - CURRENT_END gives the end of the storage not in use, so we know - how much data to copy up. OP is the opcode of the jump to insert. - - If you call this function, you must zero out pending_exact. */) - -directive(static) directive(void) -ident(insert_jump)operator(()ident(op)operator(,) ident(from)operator(,) ident(to)operator(,) ident(current_end)operator(\)) - pre_type(int) ident(op)operator(;) - pre_type(char) operator(*)ident(from)operator(,) operator(*)ident(to)operator(,) operator(*)ident(current_end)operator(;) -operator({) - directive(register) pre_type(char) operator(*)ident(pfrom) operator(=) ident(current_end)operator(;) comment(/* Copy from here... */) - directive(register) pre_type(char) operator(*)ident(pto) operator(=) ident(current_end) operator(+) integer(3)operator(;) comment(/* ...to here. */) - - reserved(while) operator(()ident(pfrom) operator(!=) ident(from)operator(\)) - operator(*--)ident(pto) operator(=) operator(*--)ident(pfrom)operator(;) - ident(store_jump)operator(()ident(from)operator(,) ident(op)operator(,) ident(to)operator(\);) -operator(}) - - -comment(/* Store a jump of the form . - - Store in the location FROM a jump operation to jump to relative - address FROM - TO. OPCODE is the opcode to store, N is a number the - jump uses, say, to decide how many times to jump. - - If you call this function, you must zero out pending_exact. */) - -directive(static) directive(void) -ident(store_jump_n)operator(()ident(from)operator(,) ident(opcode)operator(,) ident(to)operator(,) ident(n)operator(\)) - pre_type(char) operator(*)ident(from)operator(,) operator(*)ident(to)operator(;) - pre_type(int) ident(opcode)operator(;) - pre_type(unsigned) ident(n)operator(;) -operator({) - ident(from)operator([)integer(0)operator(]) operator(=) operator(()pre_type(char)operator(\))ident(opcode)operator(;) - ident(STORE_NUMBER)operator(()ident(from) operator(+) integer(1)operator(,) ident(to) operator(-) operator(()ident(from) operator(+) integer(3)operator(\)\);) - ident(STORE_NUMBER)operator(()ident(from) operator(+) integer(3)operator(,) ident(n)operator(\);) -operator(}) - - -comment(/* Similar to insert_jump, but handles a jump which needs an extra - number to handle minimum and maximum cases. Open up space at - location FROM, and insert there a jump to TO. CURRENT_END gives the - end of the storage in use, so we know how much data to copy up. OP is - the opcode of the jump to insert. - - If you call this function, you must zero out pending_exact. */) - -directive(static) directive(void) -ident(insert_jump_n)operator(()ident(op)operator(,) ident(from)operator(,) ident(to)operator(,) ident(current_end)operator(,) ident(n)operator(\)) - pre_type(int) ident(op)operator(;) - pre_type(char) operator(*)ident(from)operator(,) operator(*)ident(to)operator(,) operator(*)ident(current_end)operator(;) - pre_type(unsigned) ident(n)operator(;) -operator({) - directive(register) pre_type(char) operator(*)ident(pfrom) operator(=) ident(current_end)operator(;) comment(/* Copy from here... */) - directive(register) pre_type(char) operator(*)ident(pto) operator(=) ident(current_end) operator(+) integer(5)operator(;) comment(/* ...to here. */) - - reserved(while) operator(()ident(pfrom) operator(!=) ident(from)operator(\)) - operator(*--)ident(pto) operator(=) operator(*--)ident(pfrom)operator(;) - ident(store_jump_n)operator(()ident(from)operator(,) ident(op)operator(,) ident(to)operator(,) ident(n)operator(\);) -operator(}) - - -comment(/* Open up space at location THERE, and insert operation OP. - CURRENT_END gives the end of the storage in use, so - we know how much data to copy up. - - If you call this function, you must zero out pending_exact. */) - -directive(static) directive(void) -ident(insert_op)operator(()ident(op)operator(,) ident(there)operator(,) ident(current_end)operator(\)) - pre_type(int) ident(op)operator(;) - pre_type(char) operator(*)ident(there)operator(,) operator(*)ident(current_end)operator(;) -operator({) - directive(register) pre_type(char) operator(*)ident(pfrom) operator(=) ident(current_end)operator(;) comment(/* Copy from here... */) - directive(register) pre_type(char) operator(*)ident(pto) operator(=) ident(current_end) operator(+) integer(1)operator(;) comment(/* ...to here. */) - - reserved(while) operator(()ident(pfrom) operator(!=) ident(there)operator(\)) - operator(*--)ident(pto) operator(=) operator(*--)ident(pfrom)operator(;) - - ident(there)operator([)integer(0)operator(]) operator(=) operator(()pre_type(char)operator(\))ident(op)operator(;) -operator(}) - - -comment(/* Open up space at location THERE, and insert operation OP followed by - NUM_1 and NUM_2. CURRENT_END gives the end of the storage in use, so - we know how much data to copy up. - - If you call this function, you must zero out pending_exact. */) - -directive(static) directive(void) -ident(insert_op_2)operator(()ident(op)operator(,) ident(there)operator(,) ident(current_end)operator(,) ident(num_1)operator(,) ident(num_2)operator(\)) - pre_type(int) ident(op)operator(;) - pre_type(char) operator(*)ident(there)operator(,) operator(*)ident(current_end)operator(;) - pre_type(int) ident(num_1)operator(,) ident(num_2)operator(;) -operator({) - directive(register) pre_type(char) operator(*)ident(pfrom) operator(=) ident(current_end)operator(;) comment(/* Copy from here... */) - directive(register) pre_type(char) operator(*)ident(pto) operator(=) ident(current_end) operator(+) integer(5)operator(;) comment(/* ...to here. */) - - reserved(while) operator(()ident(pfrom) operator(!=) ident(there)operator(\)) - operator(*--)ident(pto) operator(=) operator(*--)ident(pfrom)operator(;) - - ident(there)operator([)integer(0)operator(]) operator(=) operator(()pre_type(char)operator(\))ident(op)operator(;) - ident(STORE_NUMBER)operator(()ident(there) operator(+) integer(1)operator(,) ident(num_1)operator(\);) - ident(STORE_NUMBER)operator(()ident(there) operator(+) integer(3)operator(,) ident(num_2)operator(\);) -operator(}) - - -preprocessor(#define) ident(trans_eq)operator(()ident(c1)operator(,) ident(c2)operator(,) ident(translate)operator(\)) operator(()ident(translate)operator(?()ident(translate)operator([)ident(c1)operator(]==)ident(translate)operator([)ident(c2)operator(]\):(()ident(c1)operator(\)==()ident(c2)operator(\)\)\)) -directive(static) pre_type(int) -ident(slow_match)operator(()ident(little)operator(,) ident(lend)operator(,) ident(big)operator(,) ident(bend)operator(,) ident(translate)operator(\)) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(little)operator(,) operator(*)ident(lend)operator(;) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(big)operator(,) operator(*)ident(bend)operator(;) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(translate)operator(;) -operator({) - pre_type(int) ident(c)operator(;) - - reserved(while) operator(()ident(little) operator(<) ident(lend) operator(&&) ident(big) operator(<) ident(bend)operator(\)) operator({) - ident(c) operator(=) operator(*)ident(little)operator(++;) - reserved(if) operator(()ident(c) operator(==) hex(0xff)operator(\)) - ident(c) operator(=) operator(*)ident(little)operator(++;) - reserved(if) operator((!)ident(trans_eq)operator((*)ident(big)operator(++,) ident(c)operator(,) ident(translate)operator(\)\)) reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(little) operator(==) ident(lend)operator(\)) reserved(return) integer(1)operator(;) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(slow_search)operator(()ident(little)operator(,) ident(llen)operator(,) ident(big)operator(,) ident(blen)operator(,) ident(translate)operator(\)) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(little)operator(;) - pre_type(int) ident(llen)operator(;) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(big)operator(;) - pre_type(int) ident(blen)operator(;) - directive(const) pre_type(char) operator(*)ident(translate)operator(;) -operator({) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(bsave) operator(=) ident(big)operator(;) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(bend) operator(=) ident(big) operator(+) ident(blen)operator(;) - directive(register) pre_type(int) ident(c)operator(;) - pre_type(int) ident(fescape) operator(=) integer(0)operator(;) - - ident(c) operator(=) operator(*)ident(little)operator(;) - reserved(if) operator(()ident(c) operator(==) hex(0xff)operator(\)) operator({) - ident(c) operator(=) ident(little)operator([)integer(1)operator(];) - ident(fescape) operator(=) integer(1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(translate) operator(&&) operator(!)ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - ident(c) operator(=) ident(translate)operator([)ident(c)operator(];) - operator(}) - - reserved(while) operator(()ident(big) operator(<) ident(bend)operator(\)) operator({) - comment(/* look for first character */) - reserved(if) operator(()ident(fescape)operator(\)) operator({) - reserved(while) operator(()ident(big) operator(<) ident(bend)operator(\)) operator({) - reserved(if) operator((*)ident(big) operator(==) ident(c)operator(\)) reserved(break)operator(;) - ident(big)operator(++;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(translate) operator(&&) operator(!)ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - reserved(while) operator(()ident(big) operator(<) ident(bend)operator(\)) operator({) - reserved(if) operator(()ident(ismbchar)operator((*)ident(big)operator(\)\)) ident(big)operator(+=)ident(mbclen)operator((*)ident(big)operator(\)-)integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(translate)operator([*)ident(big)operator(]) operator(==) ident(c)operator(\)) reserved(break)operator(;) - ident(big)operator(++;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(while) operator(()ident(big) operator(<) ident(bend)operator(\)) operator({) - reserved(if) operator((*)ident(big) operator(==) ident(c)operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(ismbchar)operator((*)ident(big)operator(\)\)) ident(big)operator(+=)ident(mbclen)operator((*)ident(big)operator(\)-)integer(1)operator(;) - ident(big)operator(++;) - operator(}) - operator(}) - - reserved(if) operator(()ident(slow_match)operator(()ident(little)operator(,) ident(little)operator(+)ident(llen)operator(,) ident(big)operator(,) ident(bend)operator(,) operator(()pre_type(unsigned) pre_type(char) operator(*\))ident(translate)operator(\)\)) - reserved(return) ident(big) operator(-) ident(bsave)operator(;) - - ident(big)operator(+=)ident(mbclen)operator((*)ident(big)operator(\);) - operator(}) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - -directive(static) directive(void) -ident(bm_init_skip)operator(()ident(skip)operator(,) ident(pat)operator(,) ident(m)operator(,) ident(translate)operator(\)) - pre_type(int) operator(*)ident(skip)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(pat)operator(;) - pre_type(int) ident(m)operator(;) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(translate)operator(;) -operator({) - pre_type(int) ident(j)operator(,) ident(c)operator(;) - - reserved(for) operator(()ident(c)operator(=)integer(0)operator(;) ident(c)operator(<)integer(256)operator(;) ident(c)operator(++\)) operator({) - ident(skip)operator([)ident(c)operator(]) operator(=) ident(m)operator(;) - operator(}) - reserved(if) operator(()ident(translate)operator(\)) operator({) - reserved(for) operator(()ident(j)operator(=)integer(0)operator(;) ident(j)operator(<)ident(m)operator(-)integer(1)operator(;) ident(j)operator(++\)) operator({) - ident(skip)operator([)ident(translate)operator([)ident(pat)operator([)ident(j)operator(]]]) operator(=) ident(m)operator(-)integer(1)operator(-)ident(j)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(for) operator(()ident(j)operator(=)integer(0)operator(;) ident(j)operator(<)ident(m)operator(-)integer(1)operator(;) ident(j)operator(++\)) operator({) - ident(skip)operator([)ident(pat)operator([)ident(j)operator(]]) operator(=) ident(m)operator(-)integer(1)operator(-)ident(j)operator(;) - operator(}) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(bm_search)operator(()ident(little)operator(,) ident(llen)operator(,) ident(big)operator(,) ident(blen)operator(,) ident(skip)operator(,) ident(translate)operator(\)) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(little)operator(;) - pre_type(int) ident(llen)operator(;) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(big)operator(;) - pre_type(int) ident(blen)operator(;) - pre_type(int) operator(*)ident(skip)operator(;) - directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(translate)operator(;) -operator({) - pre_type(int) ident(i)operator(,) ident(j)operator(,) ident(k)operator(;) - - ident(i) operator(=) ident(llen)operator(-)integer(1)operator(;) - reserved(if) operator(()ident(translate)operator(\)) operator({) - reserved(while) operator(()ident(i) operator(<) ident(blen)operator(\)) operator({) - ident(k) operator(=) ident(i)operator(;) - ident(j) operator(=) ident(llen)operator(-)integer(1)operator(;) - reserved(while) operator(()ident(j) operator(>=) integer(0) operator(&&) ident(translate)operator([)ident(big)operator([)ident(k)operator(]]) operator(==) ident(translate)operator([)ident(little)operator([)ident(j)operator(]]\)) operator({) - ident(k)operator(--;) - ident(j)operator(--;) - operator(}) - reserved(if) operator(()ident(j) operator(<) integer(0)operator(\)) reserved(return) ident(k)operator(+)integer(1)operator(;) - - ident(i) operator(+=) ident(skip)operator([)ident(translate)operator([)ident(big)operator([)ident(i)operator(]]];) - operator(}) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(while) operator(()ident(i) operator(<) ident(blen)operator(\)) operator({) - ident(k) operator(=) ident(i)operator(;) - ident(j) operator(=) ident(llen)operator(-)integer(1)operator(;) - reserved(while) operator(()ident(j) operator(>=) integer(0) operator(&&) ident(big)operator([)ident(k)operator(]) operator(==) ident(little)operator([)ident(j)operator(]\)) operator({) - ident(k)operator(--;) - ident(j)operator(--;) - operator(}) - reserved(if) operator(()ident(j) operator(<) integer(0)operator(\)) reserved(return) ident(k)operator(+)integer(1)operator(;) - - ident(i) operator(+=) ident(skip)operator([)ident(big)operator([)ident(i)operator(]];) - operator(}) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - -comment(/* Given a pattern, compute a fastmap from it. The fastmap records - which of the (1 << BYTEWIDTH\) possible characters can start a string - that matches the pattern. This fastmap is used by re_search to skip - quickly over totally implausible text. - - The caller must supply the address of a (1 << BYTEWIDTH\)-byte data - area as bufp->fastmap. - The other components of bufp describe the pattern to be used. */) -directive(static) pre_type(int) -ident(re_compile_fastmap0)operator(()ident(bufp)operator(\)) - reserved(struct) ident(re_pattern_buffer) operator(*)ident(bufp)operator(;) -operator({) - pre_type(unsigned) pre_type(char) operator(*)ident(pattern) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(bufp)operator(->)ident(buffer)operator(;) - pre_type(int) ident(size) operator(=) ident(bufp)operator(->)ident(used)operator(;) - directive(register) pre_type(char) operator(*)ident(fastmap) operator(=) ident(bufp)operator(->)ident(fastmap)operator(;) - directive(register) pre_type(unsigned) pre_type(char) operator(*)ident(p) operator(=) ident(pattern)operator(;) - directive(register) pre_type(unsigned) pre_type(char) operator(*)ident(pend) operator(=) ident(pattern) operator(+) ident(size)operator(;) - directive(register) pre_type(int) ident(j)operator(,) ident(k)operator(;) - pre_type(unsigned) ident(is_a_succeed_n)operator(;) - - - pre_type(unsigned) pre_type(char) operator(*)ident(stacka)operator([)ident(NFAILURES)operator(];) - pre_type(unsigned) pre_type(char) operator(**)ident(stackb) operator(=) ident(stacka)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(stackp) operator(=) ident(stackb)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(stacke) operator(=) ident(stackb) operator(+) ident(NFAILURES)operator(;) - pre_type(int) ident(options) operator(=) ident(bufp)operator(->)ident(options)operator(;) - - ident(memset)operator(()ident(fastmap)operator(,) integer(0)operator(,) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\)\);) - ident(bufp)operator(->)ident(fastmap_accurate) operator(=) integer(1)operator(;) - ident(bufp)operator(->)ident(can_be_null) operator(=) integer(0)operator(;) - - reserved(while) operator(()ident(p)operator(\)) operator({) - ident(is_a_succeed_n) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) operator({) - ident(bufp)operator(->)ident(can_be_null) operator(=) integer(1)operator(;) - reserved(break)operator(;) - operator(}) -preprocessor(#ifdef) ident(SWITCH_ENUM_BUG) - reserved(switch) operator((()pre_type(int)operator(\)(()reserved(enum) ident(regexpcode)operator(\)*)ident(p)operator(++\)\)) -preprocessor(#else) - reserved(switch) operator((()reserved(enum) ident(regexpcode)operator(\)*)ident(p)operator(++\)) -preprocessor(#endif) - operator({) - reserved(case) ident(exactn)operator(:) - reserved(if) operator(()ident(p)operator([)integer(1)operator(]) operator(==) hex(0xff)operator(\)) operator({) - reserved(if) operator(()ident(TRANSLATE_P)operator((\)\)) - ident(fastmap)operator([)ident(translate)operator([)ident(p)operator([)integer(2)operator(]]]) operator(=) integer(2)operator(;) - reserved(else) - ident(fastmap)operator([)ident(p)operator([)integer(2)operator(]]) operator(=) integer(2)operator(;) - ident(bufp)operator(->)ident(options) operator(|=) ident(RE_OPTIMIZE_BMATCH)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(TRANSLATE_P)operator((\)\)) - ident(fastmap)operator([)ident(translate)operator([)ident(p)operator([)integer(1)operator(]]]) operator(=) integer(1)operator(;) - reserved(else) - ident(fastmap)operator([)ident(p)operator([)integer(1)operator(]]) operator(=) integer(1)operator(;) - reserved(break)operator(;) - - reserved(case) ident(begline)operator(:) - reserved(case) ident(begbuf)operator(:) - reserved(case) ident(begpos)operator(:) - reserved(case) ident(endbuf)operator(:) - reserved(case) ident(endbuf2)operator(:) - reserved(case) ident(wordbound)operator(:) - reserved(case) ident(notwordbound)operator(:) - reserved(case) ident(wordbeg)operator(:) - reserved(case) ident(wordend)operator(:) - reserved(case) ident(pop_and_fail)operator(:) - reserved(case) ident(push_dummy_failure)operator(:) - reserved(case) ident(start_paren)operator(:) - reserved(case) ident(stop_paren)operator(:) - reserved(continue)operator(;) - - reserved(case) ident(casefold_on)operator(:) - ident(bufp)operator(->)ident(options) operator(|=) ident(RE_MAY_IGNORECASE)operator(;) - ident(options) operator(|=) ident(RE_OPTION_IGNORECASE)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(casefold_off)operator(:) - ident(options) operator(&=) operator(~)ident(RE_OPTION_IGNORECASE)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(option_set)operator(:) - ident(options) operator(=) operator(*)ident(p)operator(++;) - reserved(continue)operator(;) - - reserved(case) ident(endline)operator(:) - reserved(if) operator(()ident(TRANSLATE_P)operator((\)\)) - ident(fastmap)operator([)ident(translate)operator([)char('\\n')operator(]]) operator(=) integer(1)operator(;) - reserved(else) - ident(fastmap)operator([)char('\\n')operator(]) operator(=) integer(1)operator(;) - reserved(if) operator((()ident(options) operator(&) ident(RE_OPTION_SINGLELINE)operator(\)) operator(==) integer(0) operator(&&) ident(bufp)operator(->)ident(can_be_null) operator(==) integer(0)operator(\)) - ident(bufp)operator(->)ident(can_be_null) operator(=) integer(2)operator(;) - reserved(break)operator(;) - - reserved(case) ident(jump_n)operator(:) - reserved(case) ident(finalize_jump)operator(:) - reserved(case) ident(maybe_finalize_jump)operator(:) - reserved(case) ident(jump)operator(:) - reserved(case) ident(jump_past_alt)operator(:) - reserved(case) ident(dummy_failure_jump)operator(:) - reserved(case) ident(finalize_push)operator(:) - reserved(case) ident(finalize_push_n)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(j)operator(,) ident(p)operator(\);) - ident(p) operator(+=) ident(j)operator(;) - reserved(if) operator(()ident(j) operator(>) integer(0)operator(\)) - reserved(continue)operator(;) - comment(/* Jump backward reached implies we just went through - the body of a loop and matched nothing. - Opcode jumped to should be an on_failure_jump. - Just treat it like an ordinary jump. - For a * loop, it has pushed its failure point already; - If so, discard that as redundant. */) - - reserved(if) operator((()reserved(enum) ident(regexpcode)operator(\)*)ident(p) operator(!=) ident(on_failure_jump) - operator(&&) operator(()reserved(enum) ident(regexpcode)operator(\)*)ident(p) operator(!=) ident(try_next) - operator(&&) operator(()reserved(enum) ident(regexpcode)operator(\)*)ident(p) operator(!=) ident(succeed_n)operator(\)) - reserved(continue)operator(;) - ident(p)operator(++;) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(j)operator(,) ident(p)operator(\);) - ident(p) operator(+=) ident(j)operator(;) - reserved(if) operator(()ident(stackp) operator(!=) ident(stackb) operator(&&) operator(*)ident(stackp) operator(==) ident(p)operator(\)) - ident(stackp)operator(--;) comment(/* pop */) - reserved(continue)operator(;) - - reserved(case) ident(try_next)operator(:) - reserved(case) ident(start_nowidth)operator(:) - reserved(case) ident(stop_nowidth)operator(:) - reserved(case) ident(stop_backtrack)operator(:) - ident(p) operator(+=) integer(2)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(succeed_n)operator(:) - ident(is_a_succeed_n) operator(=) integer(1)operator(;) - comment(/* Get to the number of times to succeed. */) - ident(EXTRACT_NUMBER)operator(()ident(k)operator(,) ident(p) operator(+) integer(2)operator(\);) - comment(/* Increment p past the n for when k != 0. */) - reserved(if) operator(()ident(k) operator(!=) integer(0)operator(\)) operator({) - ident(p) operator(+=) integer(4)operator(;) - reserved(continue)operator(;) - operator(}) - comment(/* fall through */) - - reserved(case) ident(on_failure_jump)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(j)operator(,) ident(p)operator(\);) - reserved(if) operator(()ident(p) operator(+) ident(j) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator(()ident(stackp) operator(==) ident(stacke)operator(\)) operator({) - ident(EXPAND_FAIL_STACK)operator((\);) - operator(}) - operator(*++)ident(stackp) operator(=) ident(p) operator(+) ident(j)operator(;) comment(/* push */) - operator(}) - reserved(else) operator({) - ident(bufp)operator(->)ident(can_be_null) operator(=) integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(is_a_succeed_n)operator(\)) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(k)operator(,) ident(p)operator(\);) comment(/* Skip the n. */) - reserved(continue)operator(;) - - reserved(case) ident(set_number_at)operator(:) - ident(p) operator(+=) integer(4)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(start_memory)operator(:) - reserved(case) ident(stop_memory)operator(:) - ident(p) operator(+=) integer(2)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(duplicate)operator(:) - ident(bufp)operator(->)ident(can_be_null) operator(=) integer(1)operator(;) - reserved(if) operator((*)ident(p) operator(>=) ident(bufp)operator(->)ident(re_nsub)operator(\)) reserved(break)operator(;) - ident(fastmap)operator([)char('\\n')operator(]) operator(=) integer(1)operator(;) - reserved(case) ident(anychar_repeat)operator(:) - reserved(case) ident(anychar)operator(:) - reserved(for) operator(()ident(j) operator(=) integer(0)operator(;) ident(j) operator(<) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\);) ident(j)operator(++\)) operator({) - reserved(if) operator(()ident(j) operator(!=) char('\\n') operator(||) operator(()ident(options) operator(&) ident(RE_OPTION_MULTILINE)operator(\)\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(bufp)operator(->)ident(can_be_null)operator(\)) operator({) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) integer(0)operator(\);) - operator(}) - comment(/* Don't return; check the alternative paths - so we can set can_be_null if appropriate. */) - reserved(if) operator((()reserved(enum) ident(regexpcode)operator(\))ident(p)operator([-)integer(1)operator(]) operator(==) ident(anychar_repeat)operator(\)) operator({) - reserved(continue)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(wordchar)operator(:) - reserved(for) operator(()ident(j) operator(=) integer(0)operator(;) ident(j) operator(<) hex(0x80)operator(;) ident(j)operator(++\)) operator({) - reserved(if) operator(()ident(SYNTAX)operator(()ident(j)operator(\)) operator(==) ident(Sword)operator(\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - operator(}) - reserved(switch) operator(()ident(current_mbctype)operator(\)) operator({) - reserved(case) ident(MBCTYPE_ASCII)operator(:) - reserved(for) operator(()ident(j) operator(=) hex(0x80)operator(;) ident(j) operator(<) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\);) ident(j)operator(++\)) operator({) - reserved(if) operator(()ident(SYNTAX)operator(()ident(j)operator(\)) operator(==) ident(Sword2)operator(\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - operator(}) - reserved(break)operator(;) - reserved(case) ident(MBCTYPE_EUC)operator(:) - reserved(case) ident(MBCTYPE_SJIS)operator(:) - reserved(case) ident(MBCTYPE_UTF8)operator(:) - reserved(for) operator(()ident(j) operator(=) hex(0x80)operator(;) ident(j) operator(<) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\);) ident(j)operator(++\)) operator({) - reserved(if) operator(()ident(re_mbctab)operator([)ident(j)operator(]\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(notwordchar)operator(:) - reserved(for) operator(()ident(j) operator(=) integer(0)operator(;) ident(j) operator(<) hex(0x80)operator(;) ident(j)operator(++\)) - reserved(if) operator(()ident(SYNTAX)operator(()ident(j)operator(\)) operator(!=) ident(Sword)operator(\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - reserved(switch) operator(()ident(current_mbctype)operator(\)) operator({) - reserved(case) ident(MBCTYPE_ASCII)operator(:) - reserved(for) operator(()ident(j) operator(=) hex(0x80)operator(;) ident(j) operator(<) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\);) ident(j)operator(++\)) operator({) - reserved(if) operator(()ident(SYNTAX)operator(()ident(j)operator(\)) operator(!=) ident(Sword2)operator(\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - operator(}) - reserved(break)operator(;) - reserved(case) ident(MBCTYPE_EUC)operator(:) - reserved(case) ident(MBCTYPE_SJIS)operator(:) - reserved(case) ident(MBCTYPE_UTF8)operator(:) - reserved(for) operator(()ident(j) operator(=) hex(0x80)operator(;) ident(j) operator(<) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\);) ident(j)operator(++\)) operator({) - reserved(if) operator((!)ident(re_mbctab)operator([)ident(j)operator(]\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(charset)operator(:) - comment(/* NOTE: Charset for single-byte chars never contain - multi-byte char. See set_list_bits(\). */) - reserved(for) operator(()ident(j) operator(=) operator(*)ident(p)operator(++) operator(*) ident(BYTEWIDTH) operator(-) integer(1)operator(;) ident(j) operator(>=) integer(0)operator(;) ident(j)operator(--\)) - reserved(if) operator(()ident(p)operator([)ident(j) operator(/) ident(BYTEWIDTH)operator(]) operator(&) operator(()integer(1) operator(<<) operator(()ident(j) operator(%) ident(BYTEWIDTH)operator(\)\)\)) operator({) - pre_type(int) ident(tmp) operator(=) ident(TRANSLATE_P)operator((\)?)ident(translate)operator([)ident(j)operator(]:)ident(j)operator(;) - ident(fastmap)operator([)ident(tmp)operator(]) operator(=) integer(1)operator(;) - operator(}) - operator({) - pre_type(unsigned) pre_type(short) ident(size)operator(;) - pre_type(unsigned) pre_type(long) ident(c)operator(,) ident(beg)operator(,) ident(end)operator(;) - - ident(p) operator(+=) ident(p)operator([-)integer(1)operator(]) operator(+) integer(2)operator(;) - ident(size) operator(=) ident(EXTRACT_UNSIGNED)operator((&)ident(p)operator([-)integer(2)operator(]\);) - reserved(for) operator(()ident(j) operator(=) integer(0)operator(;) ident(j) operator(<) operator(()pre_type(int)operator(\))ident(size)operator(;) ident(j)operator(++\)) operator({) - ident(c) operator(=) ident(EXTRACT_MBC)operator((&)ident(p)operator([)ident(j)operator(*)integer(8)operator(]\);) - ident(beg) operator(=) ident(WC2MBC1ST)operator(()ident(c)operator(\);) - ident(c) operator(=) ident(EXTRACT_MBC)operator((&)ident(p)operator([)ident(j)operator(*)integer(8)operator(+)integer(4)operator(]\);) - ident(end) operator(=) ident(WC2MBC1ST)operator(()ident(c)operator(\);) - comment(/* set bits for 1st bytes of multi-byte chars. */) - reserved(while) operator(()ident(beg) operator(<=) ident(end)operator(\)) operator({) - comment(/* NOTE: Charset for multi-byte chars might contain - single-byte chars. We must reject them. */) - reserved(if) operator(()ident(c) operator(<) hex(0x100)operator(\)) operator({) - ident(fastmap)operator([)ident(beg)operator(]) operator(=) integer(2)operator(;) - ident(bufp)operator(->)ident(options) operator(|=) ident(RE_OPTIMIZE_BMATCH)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ismbchar)operator(()ident(beg)operator(\)\)) - ident(fastmap)operator([)ident(beg)operator(]) operator(=) integer(1)operator(;) - ident(beg)operator(++;) - operator(}) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(charset_not)operator(:) - comment(/* S: set of all single-byte chars. - M: set of all first bytes that can start multi-byte chars. - s: any set of single-byte chars. - m: any set of first bytes that can start multi-byte chars. - - We assume S+M = U. - ___ _ _ - s+m = (S*s+M*m\). */) - comment(/* Chars beyond end of map must be allowed */) - comment(/* NOTE: Charset_not for single-byte chars might contain - multi-byte chars. See set_list_bits(\). */) - reserved(for) operator(()ident(j) operator(=) operator(*)ident(p) operator(*) ident(BYTEWIDTH)operator(;) ident(j) operator(<) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\);) ident(j)operator(++\)) - reserved(if) operator((!)ident(ismbchar)operator(()ident(j)operator(\)\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - - reserved(for) operator(()ident(j) operator(=) operator(*)ident(p)operator(++) operator(*) ident(BYTEWIDTH) operator(-) integer(1)operator(;) ident(j) operator(>=) integer(0)operator(;) ident(j)operator(--\)) - reserved(if) operator((!()ident(p)operator([)ident(j) operator(/) ident(BYTEWIDTH)operator(]) operator(&) operator(()integer(1) operator(<<) operator(()ident(j) operator(%) ident(BYTEWIDTH)operator(\)\)\)\)) operator({) - reserved(if) operator((!)ident(ismbchar)operator(()ident(j)operator(\)\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - operator(}) - operator({) - pre_type(unsigned) pre_type(short) ident(size)operator(;) - pre_type(unsigned) pre_type(long) ident(c)operator(,) ident(beg)operator(;) - pre_type(int) ident(num_literal) operator(=) integer(0)operator(;) - - ident(p) operator(+=) ident(p)operator([-)integer(1)operator(]) operator(+) integer(2)operator(;) - ident(size) operator(=) ident(EXTRACT_UNSIGNED)operator((&)ident(p)operator([-)integer(2)operator(]\);) - reserved(if) operator(()ident(size) operator(==) integer(0)operator(\)) operator({) - reserved(for) operator(()ident(j) operator(=) hex(0x80)operator(;) ident(j) operator(<) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\);) ident(j)operator(++\)) - reserved(if) operator(()ident(ismbchar)operator(()ident(j)operator(\)\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - reserved(break)operator(;) - operator(}) - reserved(for) operator(()ident(j) operator(=) integer(0)operator(,)ident(c) operator(=) integer(0)operator(;)ident(j) operator(<) operator(()pre_type(int)operator(\))ident(size)operator(;) ident(j)operator(++\)) operator({) - pre_type(unsigned) pre_type(int) ident(cc) operator(=) ident(EXTRACT_MBC)operator((&)ident(p)operator([)ident(j)operator(*)integer(8)operator(]\);) - ident(beg) operator(=) ident(WC2MBC1ST)operator(()ident(cc)operator(\);) - reserved(while) operator(()ident(c) operator(<=) ident(beg)operator(\)) operator({) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) - ident(fastmap)operator([)ident(c)operator(]) operator(=) integer(1)operator(;) - ident(c)operator(++;) - operator(}) - - ident(cc) operator(=) ident(EXTRACT_MBC)operator((&)ident(p)operator([)ident(j)operator(*)integer(8)operator(+)integer(4)operator(]\);) - reserved(if) operator(()ident(cc) operator(<) hex(0xff)operator(\)) operator({) - ident(num_literal) operator(=) integer(1)operator(;) - reserved(while) operator(()ident(c) operator(<=) ident(cc)operator(\)) operator({) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) - ident(fastmap)operator([)ident(c)operator(]) operator(=) integer(1)operator(;) - ident(c)operator(++;) - operator(}) - operator(}) - ident(c) operator(=) ident(WC2MBC1ST)operator(()ident(cc)operator(\);) - operator(}) - - reserved(for) operator(()ident(j) operator(=) ident(c)operator(;) ident(j) operator(<) operator(()integer(1) operator(<<) ident(BYTEWIDTH)operator(\);) ident(j)operator(++\)) operator({) - reserved(if) operator(()ident(num_literal)operator(\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(ismbchar)operator(()ident(j)operator(\)\)) - ident(fastmap)operator([)ident(j)operator(]) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(unused)operator(:) comment(/* pacify gcc -Wall */) - reserved(break)operator(;) - operator(}) - - comment(/* Get here means we have successfully found the possible starting - characters of one path of the pattern. We need not follow this - path any farther. Instead, look at the next alternative - remembered in the stack. */) - reserved(if) operator(()ident(stackp) operator(!=) ident(stackb)operator(\)) - ident(p) operator(=) operator(*)ident(stackp)operator(--;) comment(/* pop */) - reserved(else) - reserved(break)operator(;) - operator(}) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) integer(0)operator(\);) - label(memory_exhausted:) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) operator(-)integer(2)operator(\);) -operator(}) - -directive(void) -ident(re_compile_fastmap)operator(()ident(bufp)operator(\)) - reserved(struct) ident(re_pattern_buffer) operator(*)ident(bufp)operator(;) -operator({) - operator(()directive(void)operator(\))ident(re_compile_fastmap0)operator(()ident(bufp)operator(\);) -operator(}) - -comment(/* adjust startpos value to the position between characters. */) -pre_type(int) -ident(re_mbc_startpos)operator(()ident(string)operator(,) ident(size)operator(,) ident(startpos)operator(,) ident(range)operator(\)) - directive(const) pre_type(char) operator(*)ident(string)operator(;) - pre_type(int) ident(size)operator(,) ident(startpos)operator(,) ident(range)operator(;) -operator({) - pre_type(int) ident(i) operator(=) ident(mbc_startpos)operator(()ident(string)operator(,) ident(startpos)operator(\);) - - reserved(if) operator(()ident(i) operator(<) ident(startpos)operator(\)) operator({) - reserved(if) operator(()ident(range) operator(>) integer(0)operator(\)) operator({) - ident(startpos) operator(=) ident(i) operator(+) ident(mbclen)operator(()ident(string)operator([)ident(i)operator(]\);) - operator(}) - reserved(else) operator({) - pre_type(int) ident(len) operator(=) ident(mbclen)operator(()ident(string)operator([)ident(i)operator(]\);) - reserved(if) operator(()ident(i) operator(+) ident(len) operator(<=) ident(startpos)operator(\)) - ident(startpos) operator(=) ident(i) operator(+) ident(len)operator(;) - reserved(else) - ident(startpos) operator(=) ident(i)operator(;) - operator(}) - operator(}) - reserved(return) ident(startpos)operator(;) -operator(}) - -pre_type(int) -ident(re_adjust_startpos)operator(()ident(bufp)operator(,) ident(string)operator(,) ident(size)operator(,) ident(startpos)operator(,) ident(range)operator(\)) - reserved(struct) ident(re_pattern_buffer) operator(*)ident(bufp)operator(;) - directive(const) pre_type(char) operator(*)ident(string)operator(;) - pre_type(int) ident(size)operator(,) ident(startpos)operator(,) ident(range)operator(;) -operator({) - comment(/* Update the fastmap now if not correct already. */) - reserved(if) operator((!)ident(bufp)operator(->)ident(fastmap_accurate)operator(\)) operator({) - pre_type(int) ident(ret) operator(=) ident(re_compile_fastmap0)operator(()ident(bufp)operator(\);) - reserved(if) operator(()ident(ret)operator(\)) reserved(return) ident(ret)operator(;) - operator(}) - - comment(/* Adjust startpos for mbc string */) - reserved(if) operator(()ident(current_mbctype) operator(&&) ident(startpos)operator(>)integer(0) operator(&&) operator(!()ident(bufp)operator(->)ident(options)operator(&)ident(RE_OPTIMIZE_BMATCH)operator(\)\)) operator({) - ident(startpos) operator(=) ident(re_mbc_startpos)operator(()ident(string)operator(,) ident(size)operator(,) ident(startpos)operator(,) ident(range)operator(\);) - operator(}) - reserved(return) ident(startpos)operator(;) -operator(}) - - -directive(static) pre_type(int) ident(re_match_exec) ident(_)operator((()reserved(struct) ident(re_pattern_buffer) operator(*,) directive(const) pre_type(char) operator(*,) pre_type(int)operator(,) pre_type(int)operator(,) pre_type(int)operator(,) - reserved(struct) ident(re_registers) operator(*\)\);) - -comment(/* Using the compiled pattern in BUFP->buffer, first tries to match - STRING, starting first at index STARTPOS, then at STARTPOS + 1, and - so on. RANGE is the number of places to try before giving up. If - RANGE is negative, it searches backwards, i.e., the starting - positions tried are STARTPOS, STARTPOS - 1, etc. STRING is of SIZE. - In REGS, return the indices of STRING that matched the entire - BUFP->buffer and its contained subexpressions. - - The value returned is the position in the strings at which the match - was found, or -1 if no match was found, or -2 if error (such as - failure stack overflow\). */) - -pre_type(int) -ident(re_search)operator(()ident(bufp)operator(,) ident(string)operator(,) ident(size)operator(,) ident(startpos)operator(,) ident(range)operator(,) ident(regs)operator(\)) - reserved(struct) ident(re_pattern_buffer) operator(*)ident(bufp)operator(;) - directive(const) pre_type(char) operator(*)ident(string)operator(;) - pre_type(int) ident(size)operator(,) ident(startpos)operator(,) ident(range)operator(;) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) -operator({) - directive(register) pre_type(char) operator(*)ident(fastmap) operator(=) ident(bufp)operator(->)ident(fastmap)operator(;) - pre_type(int) ident(val)operator(,) ident(anchor) operator(=) integer(0)operator(,) ident(initpos) operator(=) ident(startpos)operator(;) - - comment(/* Check for out-of-range starting position. */) - reserved(if) operator(()ident(startpos) operator(<) integer(0) operator(||) ident(startpos) operator(>) ident(size)operator(\)) - reserved(return) operator(-)integer(1)operator(;) - reserved(if) operator((!)ident(string)operator(\)) operator({) - reserved(if) operator(()ident(size) operator(==) integer(0)operator(\)) ident(string) operator(=) stringoperator(;) - reserved(else) reserved(return) operator(-)integer(1)operator(;) - operator(}) - - comment(/* Update the fastmap now if not correct already. */) - reserved(if) operator(()ident(fastmap) operator(&&) operator(!)ident(bufp)operator(->)ident(fastmap_accurate)operator(\)) operator({) - pre_type(int) ident(ret) operator(=) ident(re_compile_fastmap0)operator(()ident(bufp)operator(\);) - reserved(if) operator(()ident(ret)operator(\)) reserved(return) ident(ret)operator(;) - operator(}) - - - comment(/* If the search isn't to be a backwards one, don't waste time in a - search for a pattern that must be anchored. */) - reserved(if) operator(()ident(bufp)operator(->)ident(used) operator(>) integer(0)operator(\)) operator({) - reserved(switch) operator((()reserved(enum) ident(regexpcode)operator(\))ident(bufp)operator(->)ident(buffer)operator([)integer(0)operator(]\)) operator({) - reserved(case) ident(begbuf)operator(:) - label(begbuf_match:) - reserved(if) operator(()ident(range) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(startpos) operator(>) integer(0)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(else) operator({) - ident(val) operator(=) ident(re_match)operator(()ident(bufp)operator(,) ident(string)operator(,) ident(size)operator(,) integer(0)operator(,) ident(regs)operator(\);) - reserved(if) operator(()ident(val) operator(>=) integer(0)operator(\)) reserved(return) integer(0)operator(;) - reserved(return) ident(val)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(begline)operator(:) - ident(anchor) operator(=) integer(1)operator(;) - reserved(break)operator(;) - - reserved(case) ident(begpos)operator(:) - ident(val) operator(=) ident(re_match)operator(()ident(bufp)operator(,) ident(string)operator(,) ident(size)operator(,) ident(startpos)operator(,) ident(regs)operator(\);) - reserved(if) operator(()ident(val) operator(>=) integer(0)operator(\)) reserved(return) ident(startpos)operator(;) - reserved(return) ident(val)operator(;) - - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(bufp)operator(->)ident(options) operator(&) ident(RE_OPTIMIZE_ANCHOR)operator(\)) operator({) - reserved(if) operator(()ident(bufp)operator(->)ident(options)operator(&)ident(RE_OPTION_MULTILINE) operator(&&) ident(range) operator(>) integer(0)operator(\)) operator({) - reserved(goto) ident(begbuf_match)operator(;) - operator(}) - ident(anchor) operator(=) integer(1)operator(;) - operator(}) - - reserved(if) operator(()ident(bufp)operator(->)ident(must)operator(\)) operator({) - pre_type(int) ident(len) operator(=) operator((()pre_type(unsigned) pre_type(char)operator(*\))ident(bufp)operator(->)ident(must)operator(\)[)integer(0)operator(];) - pre_type(int) ident(pos)operator(,) ident(pbeg)operator(,) ident(pend)operator(;) - - ident(pbeg) operator(=) ident(startpos)operator(;) - ident(pend) operator(=) ident(startpos) operator(+) ident(range)operator(;) - reserved(if) operator(()ident(pbeg) operator(>) ident(pend)operator(\)) operator({) comment(/* swap pbeg,pend */) - ident(pos) operator(=) ident(pend)operator(;) ident(pend) operator(=) ident(pbeg)operator(;) ident(pbeg) operator(=) ident(pos)operator(;) - operator(}) - ident(pend) operator(=) ident(size)operator(;) - reserved(if) operator(()ident(bufp)operator(->)ident(options) operator(&) ident(RE_OPTIMIZE_NO_BM)operator(\)) operator({) - ident(pos) operator(=) ident(slow_search)operator((()pre_type(unsigned) pre_type(char) operator(*\)()ident(bufp)operator(->)ident(must)operator(+)integer(1)operator(\),) ident(len)operator(,) - operator(()pre_type(unsigned) pre_type(char)operator(*\)()ident(string)operator(+)ident(pbeg)operator(\),) ident(pend)operator(-)ident(pbeg)operator(,) - operator(()pre_type(char) operator(*\)()ident(MAY_TRANSLATE)operator((\)?)ident(translate)operator(:)integer(0)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(pos) operator(=) ident(bm_search)operator((()pre_type(unsigned) pre_type(char) operator(*\)()ident(bufp)operator(->)ident(must)operator(+)integer(1)operator(\),) ident(len)operator(,) - operator(()pre_type(unsigned) pre_type(char) operator(*\)()ident(string)operator(+)ident(pbeg)operator(\),) ident(pend)operator(-)ident(pbeg)operator(,) - ident(bufp)operator(->)ident(must_skip)operator(,) - ident(MAY_TRANSLATE)operator((\)?)ident(translate)operator(:)integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(pos) operator(==) operator(-)integer(1)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(if) operator(()ident(range) operator(>) integer(0) operator(&&) operator(()ident(bufp)operator(->)ident(options) operator(&) ident(RE_OPTIMIZE_EXACTN)operator(\)\)) operator({) - ident(startpos) operator(+=) ident(pos)operator(;) - ident(range) operator(-=) ident(pos)operator(;) - reserved(if) operator(()ident(range) operator(<) integer(0)operator(\)) reserved(return) operator(-)integer(1)operator(;) - operator(}) - operator(}) - - reserved(for) operator((;;\)) operator({) - comment(/* If a fastmap is supplied, skip quickly over characters that - cannot possibly be the start of a match. Note, however, that - if the pattern can possibly match the null string, we must - test it at each starting point so that we take the first null - string we get. */) - - reserved(if) operator(()ident(fastmap) operator(&&) ident(startpos) operator(<) ident(size) - operator(&&) ident(bufp)operator(->)ident(can_be_null) operator(!=) integer(1) operator(&&) operator(!()ident(anchor) operator(&&) ident(startpos) operator(==) integer(0)operator(\)\)) operator({) - reserved(if) operator(()ident(range) operator(>) integer(0)operator(\)) operator({) comment(/* Searching forwards. */) - directive(register) pre_type(unsigned) pre_type(char) operator(*)ident(p)operator(,) ident(c)operator(;) - pre_type(int) ident(irange) operator(=) ident(range)operator(;) - - ident(p) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(string)operator(+)ident(startpos)operator(;) - - reserved(while) operator(()ident(range) operator(>) integer(0)operator(\)) operator({) - ident(c) operator(=) operator(*)ident(p)operator(++;) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - pre_type(int) ident(len)operator(;) - - reserved(if) operator(()ident(fastmap)operator([)ident(c)operator(]\)) - reserved(break)operator(;) - ident(len) operator(=) ident(mbclen)operator(()ident(c)operator(\)) operator(-) integer(1)operator(;) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(c) operator(=) operator(*)ident(p)operator(++;) - ident(range)operator(--;) - reserved(if) operator(()ident(fastmap)operator([)ident(c)operator(]) operator(==) integer(2)operator(\)) - reserved(goto) ident(startpos_adjust)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(fastmap)operator([)ident(MAY_TRANSLATE)operator((\)) operator(?) ident(translate)operator([)ident(c)operator(]) operator(:) ident(c)operator(]\)) - reserved(break)operator(;) - operator(}) - ident(range)operator(--;) - operator(}) - label(startpos_adjust:) - ident(startpos) operator(+=) ident(irange) operator(-) ident(range)operator(;) - operator(}) - reserved(else) operator({) comment(/* Searching backwards. */) - directive(register) pre_type(unsigned) pre_type(char) ident(c)operator(;) - - ident(c) operator(=) ident(string)operator([)ident(startpos)operator(];) - ident(c) operator(&=) hex(0xff)operator(;) - reserved(if) operator(()ident(MAY_TRANSLATE)operator((\)) operator(?) operator(!)ident(fastmap)operator([)ident(translate)operator([)ident(c)operator(]]) operator(:) operator(!)ident(fastmap)operator([)ident(c)operator(]\)) - reserved(goto) ident(advance)operator(;) - operator(}) - operator(}) - - reserved(if) operator(()ident(startpos) operator(>) ident(size)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(if) operator((()ident(anchor) operator(||) operator(!)ident(bufp)operator(->)ident(can_be_null)operator(\)) operator(&&) ident(range) operator(>) integer(0) operator(&&) ident(size) operator(>) integer(0) operator(&&) ident(startpos) operator(==) ident(size)operator(\)) - reserved(return) operator(-)integer(1)operator(;) - ident(val) operator(=) ident(re_match_exec)operator(()ident(bufp)operator(,) ident(string)operator(,) ident(size)operator(,) ident(startpos)operator(,) ident(initpos)operator(,) ident(regs)operator(\);) - reserved(if) operator(()ident(val) operator(>=) integer(0)operator(\)) reserved(return) ident(startpos)operator(;) - reserved(if) operator(()ident(val) operator(==) operator(-)integer(2)operator(\)) reserved(return) operator(-)integer(2)operator(;) - -preprocessor(#ifndef) ident(NO_ALLOCA) -preprocessor(#ifdef) ident(C_ALLOCA) - ident(alloca)operator(()integer(0)operator(\);) -preprocessor(#endif) comment(/* C_ALLOCA */) -preprocessor(#endif) comment(/* NO_ALLOCA */) - - reserved(if) operator(()ident(range) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(anchor) operator(&&) ident(startpos) operator(<) ident(size) operator(&&) - operator(()ident(startpos) operator(<) integer(1) operator(||) ident(string)operator([)ident(startpos)operator(-)integer(1)operator(]) operator(!=) char('\\n')operator(\)\)) operator({) - reserved(while) operator(()ident(range) operator(>) integer(0) operator(&&) ident(string)operator([)ident(startpos)operator(]) operator(!=) char('\\n')operator(\)) operator({) - ident(range)operator(--;) - ident(startpos)operator(++;) - operator(}) - operator(}) - operator(}) - - label(advance:) - reserved(if) operator((!)ident(range)operator(\)) - reserved(break)operator(;) - reserved(else) reserved(if) operator(()ident(range) operator(>) integer(0)operator(\)) operator({) - directive(const) pre_type(char) operator(*)ident(d) operator(=) ident(string) operator(+) ident(startpos)operator(;) - - reserved(if) operator(()ident(ismbchar)operator((*)ident(d)operator(\)\)) operator({) - pre_type(int) ident(len) operator(=) ident(mbclen)operator((*)ident(d)operator(\)) operator(-) integer(1)operator(;) - ident(range)operator(-=)ident(len)operator(,) ident(startpos)operator(+=)ident(len)operator(;) - reserved(if) operator((!)ident(range)operator(\)) - reserved(break)operator(;) - operator(}) - ident(range)operator(--,) ident(startpos)operator(++;) - operator(}) - reserved(else) operator({) - ident(range)operator(++,) ident(startpos)operator(--;) - operator({) - directive(const) pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(d)operator(,) operator(*)ident(p)operator(;) - - ident(s) operator(=) ident(string)operator(;) ident(d) operator(=) ident(string) operator(+) ident(startpos)operator(;) - reserved(for) operator(()ident(p) operator(=) ident(d)operator(;) ident(p)operator(--) operator(>) ident(s) operator(&&) ident(ismbchar)operator((*)ident(p)operator(\);) operator(\)) - comment(/* --p >= s would not work on 80[12]?86. - (when the offset of s equals 0 other than huge model.\) */) - operator(;) - reserved(if) operator((!(()ident(d) operator(-) ident(p)operator(\)) operator(&) integer(1)operator(\)\)) operator({) - reserved(if) operator((!)ident(range)operator(\)) - reserved(break)operator(;) - ident(range)operator(++,) ident(startpos)operator(--;) - operator(}) - operator(}) - operator(}) - operator(}) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - - - - -comment(/* The following are used for re_match, defined below: */) - -comment(/* Accessing macros used in re_match: */) - -preprocessor(#define) ident(IS_ACTIVE)operator(()ident(R)operator(\)) operator((()ident(R)operator(\))operator(.)ident(bits)operator(.)ident(is_active)operator(\)) -preprocessor(#define) ident(MATCHED_SOMETHING)operator(()ident(R)operator(\)) operator((()ident(R)operator(\))operator(.)ident(bits)operator(.)ident(matched_something)operator(\)) - - -comment(/* Macros used by re_match: */) - -comment(/* I.e., regstart, regend, and reg_info. */) -preprocessor(#define) ident(NUM_REG_ITEMS) integer(3) - -comment(/* I.e., ptr and count. */) -preprocessor(#define) ident(NUM_COUNT_ITEMS) integer(2) - -comment(/* Individual items aside from the registers. */) -preprocessor(#define) ident(NUM_NONREG_ITEMS) integer(4) - -comment(/* We push at most this many things on the stack whenever we - fail. The `+ 2' refers to PATTERN_PLACE and STRING_PLACE, which are - arguments to the PUSH_FAILURE_POINT macro. */) -preprocessor(#define) ident(MAX_NUM_FAILURE_ITEMS) operator(()ident(num_regs) operator(*) ident(NUM_REG_ITEMS) operator(+) ident(NUM_NONREG_ITEMS)operator(\)) - -comment(/* We push this many things on the stack whenever we fail. */) -preprocessor(#define) ident(NUM_FAILURE_ITEMS) operator(()ident(last_used_reg) operator(*) ident(NUM_REG_ITEMS) operator(+) ident(NUM_NONREG_ITEMS) operator(+) integer(1)operator(\)) - -comment(/* This pushes counter information for succeed_n and jump_n */) -preprocessor(#define) ident(PUSH_FAILURE_COUNT)operator(()ident(ptr)operator(\)) \ - reserved(do) operator({) \ - pre_type(int) ident(c)operator(;) \ - ident(EXTRACT_NUMBER)operator(()ident(c)operator(,) ident(ptr)operator(\);) \ - ident(ENSURE_FAIL_STACK)operator(()ident(NUM_COUNT_ITEMS)operator(\);) \ - operator(*)ident(stackp)operator(++) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\)()pre_type(long)operator(\))ident(c)operator(;) \ - operator(*)ident(stackp)operator(++) operator(=) operator(()ident(ptr)operator(\);) \ - ident(num_failure_counts)operator(++;) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -comment(/* This pushes most of the information about the current state we will want - if we ever fail back to it. */) - -preprocessor(#define) ident(PUSH_FAILURE_POINT)operator(()ident(pattern_place)operator(,) ident(string_place)operator(\)) \ - reserved(do) operator({) \ - pre_type(long) ident(last_used_reg)operator(,) ident(this_reg)operator(;) \ - \ - comment(/* Find out how many registers are active or have been matched. \\ - (Aside from register zero, which is only set at the end.\) */) \ - reserved(for) operator(()ident(last_used_reg) operator(=) ident(num_regs)operator(-)integer(1)operator(;) ident(last_used_reg) operator(>) integer(0)operator(;) ident(last_used_reg)operator(--\))\ - reserved(if) operator((!)ident(REG_UNSET)operator(()ident(regstart)operator([)ident(last_used_reg)operator(]\)\)) \ - reserved(break)operator(;) \ - \ - ident(ENSURE_FAIL_STACK)operator(()ident(NUM_FAILURE_ITEMS)operator(\);) \ - operator(*)ident(stackp)operator(++) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\)()pre_type(long)operator(\))ident(num_failure_counts)operator(;) \ - ident(num_failure_counts) operator(=) integer(0)operator(;) \ - \ - comment(/* Now push the info for each of those registers. */) \ - reserved(for) operator(()ident(this_reg) operator(=) integer(1)operator(;) ident(this_reg) operator(<=) ident(last_used_reg)operator(;) ident(this_reg)operator(++\)) operator({) \ - operator(*)ident(stackp)operator(++) operator(=) ident(regstart)operator([)ident(this_reg)operator(];) \ - operator(*)ident(stackp)operator(++) operator(=) ident(regend)operator([)ident(this_reg)operator(];) \ - operator(*)ident(stackp)operator(++) operator(=) ident(reg_info)operator([)ident(this_reg)operator(])operator(.)ident(word)operator(;) \ - operator(}) \ - \ - comment(/* Push how many registers we saved. */) \ - operator(*)ident(stackp)operator(++) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(last_used_reg)operator(;) \ - \ - operator(*)ident(stackp)operator(++) operator(=) ident(pattern_place)operator(;) \ - operator(*)ident(stackp)operator(++) operator(=) ident(string_place)operator(;) \ - operator(*)ident(stackp)operator(++) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\)()pre_type(long)operator(\))ident(options)operator(;) comment(/* current option status */) \ - operator(*)ident(stackp)operator(++) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))integer(0)operator(;) comment(/* non-greedy flag */) \ - operator(}) reserved(while)operator(()integer(0)operator(\)) - -preprocessor(#define) ident(NON_GREEDY) operator((()pre_type(unsigned) pre_type(char)operator(*\))integer(1)operator(\)) - -preprocessor(#define) ident(POP_FAILURE_COUNT)operator((\)) \ - reserved(do) operator({) \ - pre_type(unsigned) pre_type(char) operator(*)ident(ptr) operator(=) operator(*--)ident(stackp)operator(;) \ - pre_type(int) ident(count) operator(=) operator(()pre_type(long)operator(\)*--)ident(stackp)operator(;) \ - ident(STORE_NUMBER)operator(()ident(ptr)operator(,) ident(count)operator(\);) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -comment(/* This pops what PUSH_FAILURE_POINT pushes. */) - -preprocessor(#define) ident(POP_FAILURE_POINT)operator((\)) \ - reserved(do) operator({) \ - pre_type(long) ident(temp)operator(;) \ - ident(stackp) operator(-=) ident(NUM_NONREG_ITEMS)operator(;) comment(/* Remove failure points (and flag\). */) \ - ident(temp) operator(=) operator(()pre_type(long)operator(\)*--)ident(stackp)operator(;) comment(/* How many regs pushed. */) \ - ident(temp) operator(*=) ident(NUM_REG_ITEMS)operator(;) comment(/* How much to take off the stack. */) \ - ident(stackp) operator(-=) ident(temp)operator(;) comment(/* Remove the register info. */) \ - ident(temp) operator(=) operator(()pre_type(long)operator(\)*--)ident(stackp)operator(;) comment(/* How many counters pushed. */) \ - reserved(while) operator(()ident(temp)operator(--\)) operator({) \ - ident(POP_FAILURE_COUNT)operator((\);) comment(/* Remove the counter info. */) \ - operator(}) \ - ident(num_failure_counts) operator(=) integer(0)operator(;) comment(/* Reset num_failure_counts. */) \ - operator(}) reserved(while)operator(()integer(0)operator(\)) - - comment(/* Registers are set to a sentinel when they haven't yet matched. */) -preprocessor(#define) ident(REG_UNSET_VALUE) operator((()pre_type(unsigned) pre_type(char)operator(*\)-)integer(1)operator(\)) -preprocessor(#define) ident(REG_UNSET)operator(()ident(e)operator(\)) operator((()ident(e)operator(\)) operator(==) ident(REG_UNSET_VALUE)operator(\)) - -preprocessor(#define) ident(PREFETCH) reserved(if) operator(()ident(d) operator(==) ident(dend)operator(\)) reserved(goto) ident(fail) - - comment(/* Call this when have matched something; it sets `matched' flags for the - registers corresponding to the subexpressions of which we currently - are inside. */) -preprocessor(#define) ident(SET_REGS_MATCHED) \ - reserved(do) operator({) pre_type(unsigned) ident(this_reg)operator(;) \ - reserved(for) operator(()ident(this_reg) operator(=) integer(0)operator(;) ident(this_reg) operator(<) ident(num_regs)operator(;) ident(this_reg)operator(++\)) operator({) \ - reserved(if) operator(()ident(IS_ACTIVE)operator(()ident(reg_info)operator([)ident(this_reg)operator(]\)\)) \ - ident(MATCHED_SOMETHING)operator(()ident(reg_info)operator([)ident(this_reg)operator(]\)) operator(=) integer(1)operator(;) \ - reserved(else) \ - ident(MATCHED_SOMETHING)operator(()ident(reg_info)operator([)ident(this_reg)operator(]\)) operator(=) integer(0)operator(;) \ - operator(}) \ - operator(}) reserved(while)operator(()integer(0)operator(\)) - -preprocessor(#define) ident(AT_STRINGS_BEG)operator(()ident(d)operator(\)) operator((()ident(d)operator(\)) operator(==) ident(string)operator(\)) -preprocessor(#define) ident(AT_STRINGS_END)operator(()ident(d)operator(\)) operator((()ident(d)operator(\)) operator(==) ident(dend)operator(\)) - -preprocessor(#define) ident(IS_A_LETTER)operator(()ident(d)operator(\)) operator(()ident(SYNTAX)operator((*()ident(d)operator(\)\)) operator(==) ident(Sword) operator(||) \ - operator(()ident(current_mbctype) operator(?) \ - operator(()ident(re_mbctab)operator([*()ident(d)operator(\)]) operator(&&) operator((()ident(d)operator(\)+)ident(mbclen)operator((*()ident(d)operator(\)\)\)<=)ident(dend)operator(\):) \ - ident(SYNTAX)operator((*()ident(d)operator(\)\)) operator(==) ident(Sword2)operator(\)\)) - -preprocessor(#define) ident(PREV_IS_A_LETTER)operator(()ident(d)operator(\)) operator((()ident(current_mbctype) operator(==) ident(MBCTYPE_SJIS)operator(\)?) \ - ident(IS_A_LETTER)operator((()ident(d)operator(\)-(!)ident(AT_STRINGS_BEG)operator((()ident(d)operator(\)-)integer(1)operator(\)&&) \ - ident(ismbchar)operator((()ident(d)operator(\)[-)integer(2)operator(]\)?)integer(2)operator(:)integer(1)operator(\)\):) \ - operator((()ident(current_mbctype) operator(&&) operator((()ident(d)operator(\)[-)integer(1)operator(]) operator(>=) hex(0x80)operator(\)\)) operator(||) \ - ident(IS_A_LETTER)operator((()ident(d)operator(\)-)integer(1)operator(\)\)\)) - -directive(static) directive(void) -ident(init_regs)operator(()ident(regs)operator(,) ident(num_regs)operator(\)) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) - pre_type(unsigned) pre_type(int) ident(num_regs)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - ident(regs)operator(->)ident(num_regs) operator(=) ident(num_regs)operator(;) - reserved(if) operator(()ident(num_regs) operator(<) ident(RE_NREGS)operator(\)) - ident(num_regs) operator(=) ident(RE_NREGS)operator(;) - - reserved(if) operator(()ident(regs)operator(->)ident(allocated) operator(==) integer(0)operator(\)) operator({) - ident(regs)operator(->)ident(beg) operator(=) ident(TMALLOC)operator(()ident(num_regs)operator(,) pre_type(int)operator(\);) - ident(regs)operator(->)ident(end) operator(=) ident(TMALLOC)operator(()ident(num_regs)operator(,) pre_type(int)operator(\);) - ident(regs)operator(->)ident(allocated) operator(=) ident(num_regs)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(regs)operator(->)ident(allocated) operator(<) ident(num_regs)operator(\)) operator({) - ident(TREALLOC)operator(()ident(regs)operator(->)ident(beg)operator(,) ident(num_regs)operator(,) pre_type(int)operator(\);) - ident(TREALLOC)operator(()ident(regs)operator(->)ident(end)operator(,) ident(num_regs)operator(,) pre_type(int)operator(\);) - ident(regs)operator(->)ident(allocated) operator(=) ident(num_regs)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(num_regs)operator(;) ident(i)operator(++\)) operator({) - ident(regs)operator(->)ident(beg)operator([)ident(i)operator(]) operator(=) ident(regs)operator(->)ident(end)operator([)ident(i)operator(]) operator(=) operator(-)integer(1)operator(;) - operator(}) -operator(}) - -comment(/* Match the pattern described by BUFP against STRING, which is of - SIZE. Start the match at index POS in STRING. In REGS, return the - indices of STRING that matched the entire BUFP->buffer and its - contained subexpressions. - - If bufp->fastmap is nonzero, then it had better be up to date. - - The reason that the data to match are specified as two components - which are to be regarded as concatenated is so this function can be - used directly on the contents of an Emacs buffer. - - -1 is returned if there is no match. -2 is returned if there is an - error (such as match stack overflow\). Otherwise the value is the - length of the substring which was matched. */) - -pre_type(int) -ident(re_match)operator(()ident(bufp)operator(,) ident(string_arg)operator(,) ident(size)operator(,) ident(pos)operator(,) ident(regs)operator(\)) - reserved(struct) ident(re_pattern_buffer) operator(*)ident(bufp)operator(;) - directive(const) pre_type(char) operator(*)ident(string_arg)operator(;) - pre_type(int) ident(size)operator(,) ident(pos)operator(;) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) -operator({) - reserved(return) ident(re_match_exec)operator(()ident(bufp)operator(,) ident(string_arg)operator(,) ident(size)operator(,) ident(pos)operator(,) ident(pos)operator(,) ident(regs)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(re_match_exec)operator(()ident(bufp)operator(,) ident(string_arg)operator(,) ident(size)operator(,) ident(pos)operator(,) ident(beg)operator(,) ident(regs)operator(\)) - reserved(struct) ident(re_pattern_buffer) operator(*)ident(bufp)operator(;) - directive(const) pre_type(char) operator(*)ident(string_arg)operator(;) - pre_type(int) ident(size)operator(,) ident(pos)operator(,) ident(beg)operator(;) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) -operator({) - directive(register) pre_type(unsigned) pre_type(char) operator(*)ident(p) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(bufp)operator(->)ident(buffer)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(p1)operator(;) - - comment(/* Pointer to beyond end of buffer. */) - directive(register) pre_type(unsigned) pre_type(char) operator(*)ident(pend) operator(=) ident(p) operator(+) ident(bufp)operator(->)ident(used)operator(;) - - pre_type(unsigned) ident(num_regs) operator(=) ident(bufp)operator(->)ident(re_nsub)operator(;) - - pre_type(unsigned) pre_type(char) operator(*)ident(string) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(string_arg)operator(;) - - directive(register) pre_type(unsigned) pre_type(char) operator(*)ident(d)operator(,) operator(*)ident(dend)operator(;) - directive(register) pre_type(int) ident(mcnt)operator(;) comment(/* Multipurpose. */) - pre_type(int) ident(options) operator(=) ident(bufp)operator(->)ident(options)operator(;) - - comment(/* Failure point stack. Each place that can handle a failure further - down the line pushes a failure point on this stack. It consists of - restart, regend, and reg_info for all registers corresponding to the - subexpressions we're currently inside, plus the number of such - registers, and, finally, two char *'s. The first char * is where to - resume scanning the pattern; the second one is where to resume - scanning the strings. If the latter is zero, the failure point is a - ``dummy''; if a failure happens and the failure point is a dummy, it - gets discarded and the next next one is tried. */) - - pre_type(unsigned) pre_type(char) operator(**)directive(const) ident(stacka) operator(=) integer(0)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(stackb)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(stackp)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(stacke)operator(;) - - comment(/* Information on the contents of registers. These are pointers into - the input strings; they record just what was matched (on this - attempt\) by a subexpression part of the pattern, that is, the - regnum-th regstart pointer points to where in the pattern we began - matching and the regnum-th regend points to right after where we - stopped matching the regnum-th subexpression. (The zeroth register - keeps track of what the whole pattern matches.\) */) - - pre_type(unsigned) pre_type(char) operator(**)ident(regstart) operator(=) ident(bufp)operator(->)ident(regstart)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(regend) operator(=) ident(bufp)operator(->)ident(regend)operator(;) - - comment(/* If a group that's operated upon by a repetition operator fails to - match anything, then the register for its start will need to be - restored because it will have been set to wherever in the string we - are when we last see its open-group operator. Similarly for a - register's end. */) - pre_type(unsigned) pre_type(char) operator(**)ident(old_regstart) operator(=) ident(bufp)operator(->)ident(old_regstart)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(old_regend) operator(=) ident(bufp)operator(->)ident(old_regend)operator(;) - - comment(/* The is_active field of reg_info helps us keep track of which (possibly - nested\) subexpressions we are currently in. The matched_something - field of reg_info[reg_num] helps us tell whether or not we have - matched any of the pattern so far this time through the reg_num-th - subexpression. These two fields get reset each time through any - loop their register is in. */) - - ident(register_info_type) operator(*)ident(reg_info) operator(=) ident(bufp)operator(->)ident(reg_info)operator(;) - - comment(/* The following record the register info as found in the above - variables when we find a match better than any we've seen before. - This happens as we backtrack through the failure points, which in - turn happens only if we have not yet matched the entire string. */) - - pre_type(unsigned) ident(best_regs_set) operator(=) integer(0)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(best_regstart) operator(=) ident(bufp)operator(->)ident(best_regstart)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(best_regend) operator(=) ident(bufp)operator(->)ident(best_regend)operator(;) - - pre_type(int) ident(num_failure_counts) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(regs)operator(\)) operator({) - ident(init_regs)operator(()ident(regs)operator(,) ident(num_regs)operator(\);) - operator(}) - - comment(/* Initialize the stack. */) - ident(stackb) operator(=) ident(TMALLOC)operator(()ident(MAX_NUM_FAILURE_ITEMS) operator(*) ident(NFAILURES)operator(,) pre_type(unsigned) pre_type(char)operator(*\);) - ident(stackp) operator(=) ident(stackb)operator(;) - ident(stacke) operator(=) operator(&)ident(stackb)operator([)ident(MAX_NUM_FAILURE_ITEMS) operator(*) ident(NFAILURES)operator(];) - -preprocessor(#ifdef) ident(DEBUG_REGEX) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(,) ident(string_arg)operator(\);) -preprocessor(#endif) - - comment(/* Initialize subexpression text positions to -1 to mark ones that no - ( or ( and \) or \) has been seen for. Also set all registers to - inactive and mark them as not having matched anything or ever - failed. */) - reserved(for) operator(()ident(mcnt) operator(=) integer(0)operator(;) ident(mcnt) operator(<) ident(num_regs)operator(;) ident(mcnt)operator(++\)) operator({) - ident(regstart)operator([)ident(mcnt)operator(]) operator(=) ident(regend)operator([)ident(mcnt)operator(]) - operator(=) ident(old_regstart)operator([)ident(mcnt)operator(]) operator(=) ident(old_regend)operator([)ident(mcnt)operator(]) - operator(=) ident(best_regstart)operator([)ident(mcnt)operator(]) operator(=) ident(best_regend)operator([)ident(mcnt)operator(]) operator(=) ident(REG_UNSET_VALUE)operator(;) -preprocessor(#ifdef) ident(__CHECKER__) - ident(reg_info)operator([)ident(mcnt)operator(])operator(.)ident(word) operator(=) integer(0)operator(;) -preprocessor(#endif) - ident(IS_ACTIVE) operator(()ident(reg_info)operator([)ident(mcnt)operator(]\)) operator(=) integer(0)operator(;) - ident(MATCHED_SOMETHING) operator(()ident(reg_info)operator([)ident(mcnt)operator(]\)) operator(=) integer(0)operator(;) - operator(}) - - comment(/* Set up pointers to ends of strings. - Don't allow the second string to be empty unless both are empty. */) - - - comment(/* `p' scans through the pattern as `d' scans through the data. `dend' - is the end of the input string that `d' points within. `d' is - advanced into the following input string whenever necessary, but - this happens before fetching; therefore, at the beginning of the - loop, `d' can be pointing at the end of a string, but it cannot - equal string2. */) - - ident(d) operator(=) ident(string) operator(+) ident(pos)operator(,) ident(dend) operator(=) ident(string) operator(+) ident(size)operator(;) - - comment(/* This loops over pattern commands. It exits by returning from the - function if match is complete, or it drops through if match fails - at this starting point in the input data. */) - - reserved(for) operator((;;\)) operator({) -preprocessor(#ifdef) ident(DEBUG_REGEX) - ident(fprintf)operator(()ident(stderr)operator(,) - stringoperator(,) - ident(p) operator(-) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(bufp)operator(->)ident(buffer)operator(,) - operator(*)ident(p)operator(\);) -preprocessor(#endif) - comment(/* End of pattern means we might have succeeded. */) - reserved(if) operator(()ident(p) operator(==) ident(pend)operator(\)) operator({) - comment(/* If not end of string, try backtracking. Otherwise done. */) - reserved(if) operator((()ident(bufp)operator(->)ident(options) operator(&) ident(RE_OPTION_LONGEST)operator(\)) operator(&&) ident(d) operator(!=) ident(dend)operator(\)) operator({) - reserved(if) operator(()ident(best_regs_set)operator(\)) comment(/* non-greedy, no need to backtrack */) - reserved(goto) ident(restore_best_regs)operator(;) - reserved(while) operator(()ident(stackp) operator(!=) ident(stackb) operator(&&) ident(stackp)operator([-)integer(1)operator(]) operator(==) ident(NON_GREEDY)operator(\)) operator({) - reserved(if) operator(()ident(best_regs_set)operator(\)) comment(/* non-greedy, no need to backtrack */) - reserved(goto) ident(restore_best_regs)operator(;) - ident(POP_FAILURE_POINT)operator((\);) - operator(}) - reserved(if) operator(()ident(stackp) operator(!=) ident(stackb)operator(\)) operator({) - comment(/* More failure points to try. */) - - comment(/* If exceeds best match so far, save it. */) - reserved(if) operator((!) ident(best_regs_set) operator(||) operator(()ident(d) operator(>) ident(best_regend)operator([)integer(0)operator(]\)\)) operator({) - ident(best_regs_set) operator(=) integer(1)operator(;) - ident(best_regend)operator([)integer(0)operator(]) operator(=) ident(d)operator(;) comment(/* Never use regstart[0]. */) - - reserved(for) operator(()ident(mcnt) operator(=) integer(1)operator(;) ident(mcnt) operator(<) ident(num_regs)operator(;) ident(mcnt)operator(++\)) operator({) - ident(best_regstart)operator([)ident(mcnt)operator(]) operator(=) ident(regstart)operator([)ident(mcnt)operator(];) - ident(best_regend)operator([)ident(mcnt)operator(]) operator(=) ident(regend)operator([)ident(mcnt)operator(];) - operator(}) - operator(}) - reserved(goto) ident(fail)operator(;) - operator(}) - comment(/* If no failure points, don't restore garbage. */) - reserved(else) reserved(if) operator(()ident(best_regs_set)operator(\)) operator({) - label(restore_best_regs:) - comment(/* Restore best match. */) - ident(d) operator(=) ident(best_regend)operator([)integer(0)operator(];) - - reserved(for) operator(()ident(mcnt) operator(=) integer(0)operator(;) ident(mcnt) operator(<) ident(num_regs)operator(;) ident(mcnt)operator(++\)) operator({) - ident(regstart)operator([)ident(mcnt)operator(]) operator(=) ident(best_regstart)operator([)ident(mcnt)operator(];) - ident(regend)operator([)ident(mcnt)operator(]) operator(=) ident(best_regend)operator([)ident(mcnt)operator(];) - operator(}) - operator(}) - operator(}) - - comment(/* If caller wants register contents data back, convert it - to indices. */) - reserved(if) operator(()ident(regs)operator(\)) operator({) - ident(regs)operator(->)ident(beg)operator([)integer(0)operator(]) operator(=) ident(pos)operator(;) - ident(regs)operator(->)ident(end)operator([)integer(0)operator(]) operator(=) ident(d) operator(-) ident(string)operator(;) - reserved(for) operator(()ident(mcnt) operator(=) integer(1)operator(;) ident(mcnt) operator(<) ident(num_regs)operator(;) ident(mcnt)operator(++\)) operator({) - reserved(if) operator(()ident(REG_UNSET)operator(()ident(regend)operator([)ident(mcnt)operator(]\)\)) operator({) - ident(regs)operator(->)ident(beg)operator([)ident(mcnt)operator(]) operator(=) operator(-)integer(1)operator(;) - ident(regs)operator(->)ident(end)operator([)ident(mcnt)operator(]) operator(=) operator(-)integer(1)operator(;) - reserved(continue)operator(;) - operator(}) - ident(regs)operator(->)ident(beg)operator([)ident(mcnt)operator(]) operator(=) ident(regstart)operator([)ident(mcnt)operator(]) operator(-) ident(string)operator(;) - ident(regs)operator(->)ident(end)operator([)ident(mcnt)operator(]) operator(=) ident(regend)operator([)ident(mcnt)operator(]) operator(-) ident(string)operator(;) - operator(}) - operator(}) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,) operator(()ident(d) operator(-) ident(pos) operator(-) ident(string)operator(\)\);) - operator(}) - - comment(/* Otherwise match next pattern command. */) -preprocessor(#ifdef) ident(SWITCH_ENUM_BUG) - reserved(switch) operator((()pre_type(int)operator(\)(()reserved(enum) ident(regexpcode)operator(\)*)ident(p)operator(++\)\)) -preprocessor(#else) - reserved(switch) operator((()reserved(enum) ident(regexpcode)operator(\)*)ident(p)operator(++\)) -preprocessor(#endif) - operator({) - comment(/* ( [or `(', as appropriate] is represented by start_memory, - \) by stop_memory. Both of those commands are followed by - a register number in the next byte. The text matched - within the ( and \) is recorded under that number. */) - reserved(case) ident(start_memory)operator(:) - ident(old_regstart)operator([*)ident(p)operator(]) operator(=) ident(regstart)operator([*)ident(p)operator(];) - ident(regstart)operator([*)ident(p)operator(]) operator(=) ident(d)operator(;) - ident(IS_ACTIVE)operator(()ident(reg_info)operator([*)ident(p)operator(]\)) operator(=) integer(1)operator(;) - ident(MATCHED_SOMETHING)operator(()ident(reg_info)operator([*)ident(p)operator(]\)) operator(=) integer(0)operator(;) - ident(p) operator(+=) integer(2)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(stop_memory)operator(:) - ident(old_regend)operator([*)ident(p)operator(]) operator(=) ident(regend)operator([*)ident(p)operator(];) - ident(regend)operator([*)ident(p)operator(]) operator(=) ident(d)operator(;) - ident(IS_ACTIVE)operator(()ident(reg_info)operator([*)ident(p)operator(]\)) operator(=) integer(0)operator(;) - ident(p) operator(+=) integer(2)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(start_paren)operator(:) - reserved(case) ident(stop_paren)operator(:) - reserved(break)operator(;) - - comment(/* \\ has been turned into a `duplicate' command which is - followed by the numeric value of as the register number. */) - reserved(case) ident(duplicate)operator(:) - operator({) - pre_type(int) ident(regno) operator(=) operator(*)ident(p)operator(++;) comment(/* Get which register to match against */) - directive(register) pre_type(unsigned) pre_type(char) operator(*)ident(d2)operator(,) operator(*)ident(dend2)operator(;) - - comment(/* Check if there's corresponding group */) - reserved(if) operator(()ident(regno) operator(>=) ident(num_regs)operator(\)) reserved(goto) ident(fail)operator(;) - comment(/* Check if corresponding group is still open */) - reserved(if) operator(()ident(IS_ACTIVE)operator(()ident(reg_info)operator([)ident(regno)operator(]\)\)) reserved(goto) ident(fail)operator(;) - - comment(/* Where in input to try to start matching. */) - ident(d2) operator(=) ident(regstart)operator([)ident(regno)operator(];) - reserved(if) operator(()ident(REG_UNSET)operator(()ident(d2)operator(\)\)) reserved(goto) ident(fail)operator(;) - - comment(/* Where to stop matching; if both the place to start and - the place to stop matching are in the same string, then - set to the place to stop, otherwise, for now have to use - the end of the first string. */) - - ident(dend2) operator(=) ident(regend)operator([)ident(regno)operator(];) - reserved(if) operator(()ident(REG_UNSET)operator(()ident(dend2)operator(\)\)) reserved(goto) ident(fail)operator(;) - reserved(for) operator((;;\)) operator({) - comment(/* At end of register contents => success */) - reserved(if) operator(()ident(d2) operator(==) ident(dend2)operator(\)) reserved(break)operator(;) - - comment(/* If necessary, advance to next segment in data. */) - ident(PREFETCH)operator(;) - - comment(/* How many characters left in this segment to match. */) - ident(mcnt) operator(=) ident(dend) operator(-) ident(d)operator(;) - - comment(/* Want how many consecutive characters we can match in - one shot, so, if necessary, adjust the count. */) - reserved(if) operator(()ident(mcnt) operator(>) ident(dend2) operator(-) ident(d2)operator(\)) - ident(mcnt) operator(=) ident(dend2) operator(-) ident(d2)operator(;) - - comment(/* Compare that many; failure if mismatch, else move - past them. */) - reserved(if) operator((()ident(options) operator(&) ident(RE_OPTION_IGNORECASE)operator(\)) - operator(?) ident(memcmp_translate)operator(()ident(d)operator(,) ident(d2)operator(,) ident(mcnt)operator(\)) - operator(:) ident(memcmp)operator((()pre_type(char)operator(*\))ident(d)operator(,) operator(()pre_type(char)operator(*\))ident(d2)operator(,) ident(mcnt)operator(\)\)) - reserved(goto) ident(fail)operator(;) - ident(d) operator(+=) ident(mcnt)operator(,) ident(d2) operator(+=) ident(mcnt)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(start_nowidth)operator(:) - ident(PUSH_FAILURE_POINT)operator(()integer(0)operator(,) ident(d)operator(\);) - reserved(if) operator(()ident(stackp) operator(-) ident(stackb) operator(>) ident(RE_DUP_MAX)operator(\)) operator({) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,(-)integer(2)operator(\)\);) - operator(}) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(STORE_NUMBER)operator(()ident(p)operator(+)ident(mcnt)operator(,) ident(stackp) operator(-) ident(stackb)operator(\);) - reserved(continue)operator(;) - - reserved(case) ident(stop_nowidth)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(stackp) operator(=) ident(stackb) operator(+) ident(mcnt)operator(;) - ident(d) operator(=) ident(stackp)operator([-)integer(3)operator(];) - ident(POP_FAILURE_POINT)operator((\);) - reserved(continue)operator(;) - - reserved(case) ident(stop_backtrack)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(stackp) operator(=) ident(stackb) operator(+) ident(mcnt)operator(;) - ident(POP_FAILURE_POINT)operator((\);) - reserved(continue)operator(;) - - reserved(case) ident(pop_and_fail)operator(:) - ident(EXTRACT_NUMBER)operator(()ident(mcnt)operator(,) ident(p)operator(+)integer(1)operator(\);) - ident(stackp) operator(=) ident(stackb) operator(+) ident(mcnt)operator(;) - ident(POP_FAILURE_POINT)operator((\);) - reserved(goto) ident(fail)operator(;) - - reserved(case) ident(anychar)operator(:) - ident(PREFETCH)operator(;) - reserved(if) operator(()ident(ismbchar)operator((*)ident(d)operator(\)\)) operator({) - reserved(if) operator(()ident(d) operator(+) ident(mbclen)operator((*)ident(d)operator(\)) operator(>) ident(dend)operator(\)) - reserved(goto) ident(fail)operator(;) - ident(SET_REGS_MATCHED)operator(;) - ident(d) operator(+=) ident(mbclen)operator((*)ident(d)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(if) operator((!()ident(options)operator(&)ident(RE_OPTION_MULTILINE)operator(\)) - operator(&&) operator(()ident(TRANSLATE_P)operator((\)) operator(?) ident(translate)operator([*)ident(d)operator(]) operator(:) operator(*)ident(d)operator(\)) operator(==) char('\\n')operator(\)) - reserved(goto) ident(fail)operator(;) - ident(SET_REGS_MATCHED)operator(;) - ident(d)operator(++;) - reserved(break)operator(;) - - reserved(case) ident(anychar_repeat)operator(:) - reserved(for) operator((;;\)) operator({) - ident(PUSH_FAILURE_POINT)operator(()ident(p)operator(,) ident(d)operator(\);) - ident(PREFETCH)operator(;) - reserved(if) operator(()ident(ismbchar)operator((*)ident(d)operator(\)\)) operator({) - reserved(if) operator(()ident(d) operator(+) ident(mbclen)operator((*)ident(d)operator(\)) operator(>) ident(dend)operator(\)) - reserved(goto) ident(fail)operator(;) - ident(SET_REGS_MATCHED)operator(;) - ident(d) operator(+=) ident(mbclen)operator((*)ident(d)operator(\);) - reserved(continue)operator(;) - operator(}) - reserved(if) operator((!()ident(options)operator(&)ident(RE_OPTION_MULTILINE)operator(\)) operator(&&) - operator(()ident(TRANSLATE_P)operator((\)) operator(?) ident(translate)operator([*)ident(d)operator(]) operator(:) operator(*)ident(d)operator(\)) operator(==) char('\\n')operator(\)) - reserved(goto) ident(fail)operator(;) - ident(SET_REGS_MATCHED)operator(;) - ident(d)operator(++;) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(charset)operator(:) - reserved(case) ident(charset_not)operator(:) - operator({) - pre_type(int) ident(not)operator(;) comment(/* Nonzero for charset_not. */) - pre_type(int) ident(part) operator(=) integer(0)operator(;) comment(/* true if matched part of mbc */) - pre_type(unsigned) pre_type(char) operator(*)ident(dsave) operator(=) ident(d) operator(+) integer(1)operator(;) - pre_type(int) ident(cc)operator(,) ident(c)operator(;) - - ident(PREFETCH)operator(;) - ident(c) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\)*)ident(d)operator(++;) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - reserved(if) operator(()ident(d) operator(+) ident(mbclen)operator(()ident(c)operator(\)) operator(-) integer(1) operator(<=) ident(dend)operator(\)) operator({) - ident(cc) operator(=) ident(c)operator(;) - ident(MBC2WC)operator(()ident(c)operator(,) ident(d)operator(\);) - ident(not) operator(=) ident(is_in_list_mbc)operator(()ident(c)operator(,) ident(p)operator(\);) - reserved(if) operator((!)ident(not)operator(\)) operator({) - ident(part) operator(=) ident(not) operator(=) ident(is_in_list_sbc)operator(()ident(cc)operator(,) ident(p)operator(\);) - operator(}) - operator(}) reserved(else) operator({) - ident(not) operator(=) ident(is_in_list)operator(()ident(c)operator(,) ident(p)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(TRANSLATE_P)operator((\)\)) - ident(c) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(translate)operator([)ident(c)operator(];) - ident(not) operator(=) ident(is_in_list)operator(()ident(c)operator(,) ident(p)operator(\);) - operator(}) - - reserved(if) operator((*()ident(p) operator(-) integer(1)operator(\)) operator(==) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(charset_not)operator(\)) operator({) - ident(not) operator(=) operator(!)ident(not)operator(;) - operator(}) - reserved(if) operator((!)ident(not)operator(\)) reserved(goto) ident(fail)operator(;) - - ident(p) operator(+=) integer(1) operator(+) operator(*)ident(p) operator(+) integer(2) operator(+) ident(EXTRACT_UNSIGNED)operator((&)ident(p)operator([)integer(1) operator(+) operator(*)ident(p)operator(]\)*)integer(8)operator(;) - ident(SET_REGS_MATCHED)operator(;) - - reserved(if) operator(()ident(part)operator(\)) ident(d) operator(=) ident(dsave)operator(;) - reserved(break)operator(;) - operator(}) - - reserved(case) ident(begline)operator(:) - reserved(if) operator(()ident(size) operator(==) integer(0) operator(||) ident(AT_STRINGS_BEG)operator(()ident(d)operator(\)\)) - reserved(break)operator(;) - reserved(if) operator(()ident(d)operator([-)integer(1)operator(]) operator(==) char('\\n') operator(&&) operator(!)ident(AT_STRINGS_END)operator(()ident(d)operator(\)\)) - reserved(break)operator(;) - reserved(goto) ident(fail)operator(;) - - reserved(case) ident(endline)operator(:) - reserved(if) operator(()ident(AT_STRINGS_END)operator(()ident(d)operator(\)\)) operator({) - reserved(break)operator(;) - operator(}) - reserved(else) reserved(if) operator((*)ident(d) operator(==) char('\\n')operator(\)) - reserved(break)operator(;) - reserved(goto) ident(fail)operator(;) - - comment(/* Match at the very beginning of the string. */) - reserved(case) ident(begbuf)operator(:) - reserved(if) operator(()ident(AT_STRINGS_BEG)operator(()ident(d)operator(\)\)) - reserved(break)operator(;) - reserved(goto) ident(fail)operator(;) - - comment(/* Match at the very end of the data. */) - reserved(case) ident(endbuf)operator(:) - reserved(if) operator(()ident(AT_STRINGS_END)operator(()ident(d)operator(\)\)) - reserved(break)operator(;) - reserved(goto) ident(fail)operator(;) - - comment(/* Match at the very end of the data. */) - reserved(case) ident(endbuf2)operator(:) - reserved(if) operator(()ident(AT_STRINGS_END)operator(()ident(d)operator(\)\)) operator({) - reserved(break)operator(;) - operator(}) - comment(/* .. or newline just before the end of the data. */) - reserved(if) operator((*)ident(d) operator(==) char('\\n') operator(&&) ident(AT_STRINGS_END)operator(()ident(d)operator(+)integer(1)operator(\)\)) - reserved(break)operator(;) - reserved(goto) ident(fail)operator(;) - - comment(/* `or' constructs are handled by starting each alternative with - an on_failure_jump that points to the start of the next - alternative. Each alternative except the last ends with a - jump to the joining point. (Actually, each jump except for - the last one really jumps to the following jump, because - tensioning the jumps is a hassle.\) */) - - comment(/* The start of a stupid repeat has an on_failure_jump that points - past the end of the repeat text. This makes a failure point so - that on failure to match a repetition, matching restarts past - as many repetitions have been found with no way to fail and - look for another one. */) - - comment(/* A smart repeat is similar but loops back to the on_failure_jump - so that each repetition makes another failure point. */) - - comment(/* Match at the starting position. */) - reserved(case) ident(begpos)operator(:) - reserved(if) operator(()ident(d) operator(-) ident(string) operator(==) ident(beg)operator(\)) - reserved(break)operator(;) - reserved(goto) ident(fail)operator(;) - - reserved(case) ident(on_failure_jump)operator(:) - label(on_failure:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(PUSH_FAILURE_POINT)operator(()ident(p) operator(+) ident(mcnt)operator(,) ident(d)operator(\);) - reserved(continue)operator(;) - - comment(/* The end of a smart repeat has a maybe_finalize_jump back. - Change it either to a finalize_jump or an ordinary jump. */) - reserved(case) ident(maybe_finalize_jump)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(p1) operator(=) ident(p)operator(;) - - comment(/* Compare the beginning of the repeat with what in the - pattern follows its end. If we can establish that there - is nothing that they would both match, i.e., that we - would have to backtrack because of (as in, e.g., `a*a'\) - then we can change to finalize_jump, because we'll - never have to backtrack. - - This is not true in the case of alternatives: in - `(a|ab\)*' we do need to backtrack to the `ab' alternative - (e.g., if the string was `ab'\). But instead of trying to - detect that here, the alternative has put on a dummy - failure point which is what we will end up popping. */) - - comment(/* Skip over open/close-group commands. */) - reserved(while) operator(()ident(p1) operator(+) integer(2) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator((()reserved(enum) ident(regexpcode)operator(\)*)ident(p1) operator(==) ident(stop_memory) operator(||) - operator(()reserved(enum) ident(regexpcode)operator(\)*)ident(p1) operator(==) ident(start_memory)operator(\)) - ident(p1) operator(+=) integer(3)operator(;) comment(/* Skip over args, too. */) - reserved(else) reserved(if) operator(()comment(/*(enum regexpcode\)*p1 == start_paren ||*/) - operator(()reserved(enum) ident(regexpcode)operator(\)*)ident(p1) operator(==) ident(stop_paren)operator(\)) - ident(p1) operator(+=) integer(1)operator(;) - reserved(else) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(()ident(p1) operator(==) ident(pend)operator(\)) - ident(p)operator([-)integer(3)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(finalize_jump)operator(;) - reserved(else) reserved(if) operator((*)ident(p1) operator(==) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(exactn) operator(||) - operator(*)ident(p1) operator(==) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(endline)operator(\)) operator({) - directive(register) pre_type(int) ident(c) operator(=) operator(*)ident(p1) operator(==) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(endline) operator(?) char('\\n') operator(:) ident(p1)operator([)integer(2)operator(];) - directive(register) pre_type(unsigned) pre_type(char) operator(*)ident(p2) operator(=) ident(p) operator(+) ident(mcnt)operator(;) - comment(/* p2[0] ... p2[2] are an on_failure_jump. - Examine what follows that. */) - reserved(if) operator(()ident(p2)operator([)integer(3)operator(]) operator(==) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(exactn) operator(&&) ident(p2)operator([)integer(5)operator(]) operator(!=) ident(c)operator(\)) - ident(p)operator([-)integer(3)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(finalize_jump)operator(;) - reserved(else) reserved(if) operator(()ident(p2)operator([)integer(3)operator(]) operator(==) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(charset) operator(||) - ident(p2)operator([)integer(3)operator(]) operator(==) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(charset_not)operator(\)) operator({) - pre_type(int) ident(not)operator(;) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - pre_type(unsigned) pre_type(char) operator(*)ident(pp) operator(=) ident(p1)operator(+)integer(3)operator(;) - ident(MBC2WC)operator(()ident(c)operator(,) ident(pp)operator(\);) - operator(}) - comment(/* `is_in_list(\)' is TRUE if c would match */) - comment(/* That means it is not safe to finalize. */) - ident(not) operator(=) ident(is_in_list)operator(()ident(c)operator(,) ident(p2) operator(+) integer(4)operator(\);) - reserved(if) operator(()ident(p2)operator([)integer(3)operator(]) operator(==) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(charset_not)operator(\)) - ident(not) operator(=) operator(!)ident(not)operator(;) - reserved(if) operator((!)ident(not)operator(\)) - ident(p)operator([-)integer(3)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(finalize_jump)operator(;) - operator(}) - operator(}) - ident(p) operator(-=) integer(2)operator(;) comment(/* Point at relative address again. */) - reserved(if) operator(()ident(p)operator([-)integer(1)operator(]) operator(!=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(finalize_jump)operator(\)) operator({) - ident(p)operator([-)integer(1)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(jump)operator(;) - reserved(goto) ident(nofinalize)operator(;) - operator(}) - comment(/* Note fall through. */) - - comment(/* The end of a stupid repeat has a finalize_jump back to the - start, where another failure point will be made which will - point to after all the repetitions found so far. */) - - comment(/* Take off failure points put on by matching on_failure_jump - because didn't fail. Also remove the register information - put on by the on_failure_jump. */) - reserved(case) ident(finalize_jump)operator(:) - reserved(if) operator(()ident(stackp) operator(>) ident(stackb) operator(&&) ident(stackp)operator([-)integer(3)operator(]) operator(==) ident(d)operator(\)) operator({) - ident(p) operator(=) ident(stackp)operator([-)integer(4)operator(];) - ident(POP_FAILURE_POINT)operator((\);) - reserved(continue)operator(;) - operator(}) - ident(POP_FAILURE_POINT)operator((\);) - comment(/* Note fall through. */) - - comment(/* We need this opcode so we can detect where alternatives end - in `group_match_null_string_p' et al. */) - reserved(case) ident(jump_past_alt)operator(:) - comment(/* fall through */) - - comment(/* Jump without taking off any failure points. */) - reserved(case) ident(jump)operator(:) - label(nofinalize:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - reserved(if) operator(()ident(mcnt) operator(<) integer(0) operator(&&) ident(stackp) operator(>) ident(stackb) operator(&&) ident(stackp)operator([-)integer(3)operator(]) operator(==) ident(d)operator(\)) comment(/* avoid infinite loop */) - reserved(goto) ident(fail)operator(;) - ident(p) operator(+=) ident(mcnt)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(dummy_failure_jump)operator(:) - comment(/* Normally, the on_failure_jump pushes a failure point, which - then gets popped at finalize_jump. We will end up at - finalize_jump, also, and with a pattern of, say, `a+', we - are skipping over the on_failure_jump, so we have to push - something meaningless for finalize_jump to pop. */) - ident(PUSH_FAILURE_POINT)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(goto) ident(nofinalize)operator(;) - - comment(/* At the end of an alternative, we need to push a dummy failure - point in case we are followed by a `finalize_jump', because - we don't want the failure point for the alternative to be - popped. For example, matching `(a|ab\)*' against `aab' - requires that we match the `ab' alternative. */) - reserved(case) ident(push_dummy_failure)operator(:) - comment(/* See comments just above at `dummy_failure_jump' about the - two zeroes. */) - ident(p1) operator(=) ident(p)operator(;) - comment(/* Skip over open/close-group commands. */) - reserved(while) operator(()ident(p1) operator(+) integer(2) operator(<) ident(pend)operator(\)) operator({) - reserved(if) operator((()reserved(enum) ident(regexpcode)operator(\)*)ident(p1) operator(==) ident(stop_memory) operator(||) - operator(()reserved(enum) ident(regexpcode)operator(\)*)ident(p1) operator(==) ident(start_memory)operator(\)) - ident(p1) operator(+=) integer(3)operator(;) comment(/* Skip over args, too. */) - reserved(else) reserved(if) operator(()comment(/*(enum regexpcode\)*p1 == start_paren ||*/) - operator(()reserved(enum) ident(regexpcode)operator(\)*)ident(p1) operator(==) ident(stop_paren)operator(\)) - ident(p1) operator(+=) integer(1)operator(;) - reserved(else) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(p1) operator(<) ident(pend) operator(&&) operator(()reserved(enum) ident(regexpcode)operator(\)*)ident(p1) operator(==) ident(jump)operator(\)) - ident(p)operator([-)integer(1)operator(]) operator(=) ident(unused)operator(;) - reserved(else) - ident(PUSH_FAILURE_POINT)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(break)operator(;) - - comment(/* Have to succeed matching what follows at least n times. Then - just handle like an on_failure_jump. */) - reserved(case) ident(succeed_n)operator(:) - ident(EXTRACT_NUMBER)operator(()ident(mcnt)operator(,) ident(p) operator(+) integer(2)operator(\);) - comment(/* Originally, this is how many times we HAVE to succeed. */) - reserved(if) operator(()ident(mcnt) operator(!=) integer(0)operator(\)) operator({) - ident(mcnt)operator(--;) - ident(p) operator(+=) integer(2)operator(;) - ident(PUSH_FAILURE_COUNT)operator(()ident(p)operator(\);) - ident(STORE_NUMBER_AND_INCR)operator(()ident(p)operator(,) ident(mcnt)operator(\);) - ident(PUSH_FAILURE_POINT)operator(()integer(0)operator(,) integer(0)operator(\);) - operator(}) - reserved(else) operator({) - reserved(goto) ident(on_failure)operator(;) - operator(}) - reserved(continue)operator(;) - - reserved(case) ident(jump_n)operator(:) - ident(EXTRACT_NUMBER)operator(()ident(mcnt)operator(,) ident(p) operator(+) integer(2)operator(\);) - comment(/* Originally, this is how many times we CAN jump. */) - reserved(if) operator(()ident(mcnt)operator(\)) operator({) - ident(mcnt)operator(--;) - ident(PUSH_FAILURE_COUNT)operator(()ident(p) operator(+) integer(2)operator(\);) - ident(STORE_NUMBER)operator(()ident(p) operator(+) integer(2)operator(,) ident(mcnt)operator(\);) - reserved(goto) ident(nofinalize)operator(;) comment(/* Do the jump without taking off - any failure points. */) - operator(}) - comment(/* If don't have to jump any more, skip over the rest of command. */) - reserved(else) - ident(p) operator(+=) integer(4)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(set_number_at)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(p1) operator(=) ident(p) operator(+) ident(mcnt)operator(;) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(STORE_NUMBER)operator(()ident(p1)operator(,) ident(mcnt)operator(\);) - reserved(continue)operator(;) - - reserved(case) ident(try_next)operator(:) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - reserved(if) operator(()ident(p) operator(+) ident(mcnt) operator(<) ident(pend)operator(\)) operator({) - ident(PUSH_FAILURE_POINT)operator(()ident(p)operator(,) ident(d)operator(\);) - ident(stackp)operator([-)integer(1)operator(]) operator(=) ident(NON_GREEDY)operator(;) - operator(}) - ident(p) operator(+=) ident(mcnt)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(finalize_push)operator(:) - ident(POP_FAILURE_POINT)operator((\);) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - reserved(if) operator(()ident(mcnt) operator(<) integer(0) operator(&&) ident(stackp) operator(>) ident(stackb) operator(&&) ident(stackp)operator([-)integer(3)operator(]) operator(==) ident(d)operator(\)) comment(/* avoid infinite loop */) - reserved(goto) ident(fail)operator(;) - ident(PUSH_FAILURE_POINT)operator(()ident(p) operator(+) ident(mcnt)operator(,) ident(d)operator(\);) - ident(stackp)operator([-)integer(1)operator(]) operator(=) ident(NON_GREEDY)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(finalize_push_n)operator(:) - ident(EXTRACT_NUMBER)operator(()ident(mcnt)operator(,) ident(p) operator(+) integer(2)operator(\);) - comment(/* Originally, this is how many times we CAN jump. */) - reserved(if) operator(()ident(mcnt)operator(\)) operator({) - pre_type(int) ident(pos)operator(,) ident(i)operator(;) - - ident(mcnt)operator(--;) - ident(STORE_NUMBER)operator(()ident(p) operator(+) integer(2)operator(,) ident(mcnt)operator(\);) - ident(EXTRACT_NUMBER)operator(()ident(pos)operator(,) ident(p)operator(\);) - ident(EXTRACT_NUMBER)operator(()ident(i)operator(,) ident(p)operator(+)ident(pos)operator(+)integer(5)operator(\);) - reserved(if) operator(()ident(i) operator(>) integer(0)operator(\)) reserved(goto) ident(nofinalize)operator(;) - ident(POP_FAILURE_POINT)operator((\);) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p)operator(\);) - ident(PUSH_FAILURE_POINT)operator(()ident(p) operator(+) ident(mcnt)operator(,) ident(d)operator(\);) - ident(stackp)operator([-)integer(1)operator(]) operator(=) ident(NON_GREEDY)operator(;) - ident(p) operator(+=) integer(2)operator(;) comment(/* skip n */) - operator(}) - comment(/* If don't have to push any more, skip over the rest of command. */) - reserved(else) - ident(p) operator(+=) integer(4)operator(;) - reserved(continue)operator(;) - - comment(/* Ignore these. Used to ignore the n of succeed_n's which - currently have n == 0. */) - reserved(case) ident(unused)operator(:) - reserved(continue)operator(;) - - reserved(case) ident(casefold_on)operator(:) - ident(options) operator(|=) ident(RE_OPTION_IGNORECASE)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(casefold_off)operator(:) - ident(options) operator(&=) operator(~)ident(RE_OPTION_IGNORECASE)operator(;) - reserved(continue)operator(;) - - reserved(case) ident(option_set)operator(:) - ident(options) operator(=) operator(*)ident(p)operator(++;) - reserved(continue)operator(;) - - reserved(case) ident(wordbound)operator(:) - reserved(if) operator(()ident(AT_STRINGS_BEG)operator(()ident(d)operator(\)\)) operator({) - reserved(if) operator(()ident(AT_STRINGS_END)operator(()ident(d)operator(\)\)) reserved(goto) ident(fail)operator(;) - reserved(if) operator(()ident(IS_A_LETTER)operator(()ident(d)operator(\)\)) reserved(break)operator(;) - reserved(else) reserved(goto) ident(fail)operator(;) - operator(}) - reserved(if) operator(()ident(AT_STRINGS_END)operator(()ident(d)operator(\)\)) operator({) - reserved(if) operator(()ident(PREV_IS_A_LETTER)operator(()ident(d)operator(\)\)) reserved(break)operator(;) - reserved(else) reserved(goto) ident(fail)operator(;) - operator(}) - reserved(if) operator(()ident(PREV_IS_A_LETTER)operator(()ident(d)operator(\)) operator(!=) ident(IS_A_LETTER)operator(()ident(d)operator(\)\)) - reserved(break)operator(;) - reserved(goto) ident(fail)operator(;) - - reserved(case) ident(notwordbound)operator(:) - reserved(if) operator(()ident(AT_STRINGS_BEG)operator(()ident(d)operator(\)\)) operator({) - reserved(if) operator(()ident(IS_A_LETTER)operator(()ident(d)operator(\)\)) reserved(goto) ident(fail)operator(;) - reserved(else) reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(AT_STRINGS_END)operator(()ident(d)operator(\)\)) operator({) - reserved(if) operator(()ident(PREV_IS_A_LETTER)operator(()ident(d)operator(\)\)) reserved(goto) ident(fail)operator(;) - reserved(else) reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(PREV_IS_A_LETTER)operator(()ident(d)operator(\)) operator(!=) ident(IS_A_LETTER)operator(()ident(d)operator(\)\)) - reserved(goto) ident(fail)operator(;) - reserved(break)operator(;) - - reserved(case) ident(wordbeg)operator(:) - reserved(if) operator(()ident(IS_A_LETTER)operator(()ident(d)operator(\)) operator(&&) operator(()ident(AT_STRINGS_BEG)operator(()ident(d)operator(\)) operator(||) operator(!)ident(PREV_IS_A_LETTER)operator(()ident(d)operator(\)\)\)) - reserved(break)operator(;) - reserved(goto) ident(fail)operator(;) - - reserved(case) ident(wordend)operator(:) - reserved(if) operator((!)ident(AT_STRINGS_BEG)operator(()ident(d)operator(\)) operator(&&) ident(PREV_IS_A_LETTER)operator(()ident(d)operator(\)) - operator(&&) operator((!)ident(IS_A_LETTER)operator(()ident(d)operator(\)) operator(||) ident(AT_STRINGS_END)operator(()ident(d)operator(\)\)\)) - reserved(break)operator(;) - reserved(goto) ident(fail)operator(;) - - reserved(case) ident(wordchar)operator(:) - ident(PREFETCH)operator(;) - reserved(if) operator((!)ident(IS_A_LETTER)operator(()ident(d)operator(\)\)) - reserved(goto) ident(fail)operator(;) - reserved(if) operator(()ident(ismbchar)operator((*)ident(d)operator(\)) operator(&&) ident(d) operator(+) ident(mbclen)operator((*)ident(d)operator(\)) operator(-) integer(1) operator(<) ident(dend)operator(\)) - ident(d) operator(+=) ident(mbclen)operator((*)ident(d)operator(\)) operator(-) integer(1)operator(;) - ident(d)operator(++;) - ident(SET_REGS_MATCHED)operator(;) - reserved(break)operator(;) - - reserved(case) ident(notwordchar)operator(:) - ident(PREFETCH)operator(;) - reserved(if) operator(()ident(IS_A_LETTER)operator(()ident(d)operator(\)\)) - reserved(goto) ident(fail)operator(;) - reserved(if) operator(()ident(ismbchar)operator((*)ident(d)operator(\)) operator(&&) ident(d) operator(+) ident(mbclen)operator((*)ident(d)operator(\)) operator(-) integer(1) operator(<) ident(dend)operator(\)) - ident(d) operator(+=) ident(mbclen)operator((*)ident(d)operator(\)) operator(-) integer(1)operator(;) - ident(d)operator(++;) - ident(SET_REGS_MATCHED)operator(;) - reserved(break)operator(;) - - reserved(case) ident(exactn)operator(:) - comment(/* Match the next few pattern characters exactly. - mcnt is how many characters to match. */) - ident(mcnt) operator(=) operator(*)ident(p)operator(++;) - comment(/* This is written out as an if-else so we don't waste time - testing `translate' inside the loop. */) - reserved(if) operator(()ident(TRANSLATE_P)operator((\)\)) operator({) - reserved(do) operator({) - pre_type(unsigned) pre_type(char) ident(c)operator(;) - - ident(PREFETCH)operator(;) - reserved(if) operator((*)ident(p) operator(==) hex(0xff)operator(\)) operator({) - ident(p)operator(++;) - reserved(if) operator((!--)ident(mcnt) - operator(||) ident(AT_STRINGS_END)operator(()ident(d)operator(\)) - operator(||) operator(()pre_type(unsigned) pre_type(char)operator(\)*)ident(d)operator(++) operator(!=) operator(()pre_type(unsigned) pre_type(char)operator(\)*)ident(p)operator(++\)) - reserved(goto) ident(fail)operator(;) - reserved(continue)operator(;) - operator(}) - ident(c) operator(=) operator(*)ident(d)operator(++;) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - pre_type(int) ident(n)operator(;) - - reserved(if) operator(()ident(c) operator(!=) operator(()pre_type(unsigned) pre_type(char)operator(\)*)ident(p)operator(++\)) - reserved(goto) ident(fail)operator(;) - reserved(for) operator(()ident(n) operator(=) ident(mbclen)operator(()ident(c)operator(\)) operator(-) integer(1)operator(;) ident(n) operator(>) integer(0)operator(;) ident(n)operator(--\)) - reserved(if) operator((!--)ident(mcnt) comment(/* redundant check if pattern was - compiled properly. */) - operator(||) ident(AT_STRINGS_END)operator(()ident(d)operator(\)) - operator(||) operator(()pre_type(unsigned) pre_type(char)operator(\)*)ident(d)operator(++) operator(!=) operator(()pre_type(unsigned) pre_type(char)operator(\)*)ident(p)operator(++\)) - reserved(goto) ident(fail)operator(;) - reserved(continue)operator(;) - operator(}) - comment(/* compiled code translation needed for ruby */) - reserved(if) operator((()pre_type(unsigned) pre_type(char)operator(\))ident(translate)operator([)ident(c)operator(]) operator(!=) operator(()pre_type(unsigned) pre_type(char)operator(\))ident(translate)operator([*)ident(p)operator(++]\)) - reserved(goto) ident(fail)operator(;) - operator(}) - reserved(while) operator((--)ident(mcnt)operator(\);) - operator(}) - reserved(else) operator({) - reserved(do) operator({) - ident(PREFETCH)operator(;) - reserved(if) operator((*)ident(p) operator(==) hex(0xff)operator(\)) operator({)ident(p)operator(++;) ident(mcnt)operator(--;}) - reserved(if) operator((*)ident(d)operator(++) operator(!=) operator(*)ident(p)operator(++\)) reserved(goto) ident(fail)operator(;) - operator(}) - reserved(while) operator((--)ident(mcnt)operator(\);) - operator(}) - ident(SET_REGS_MATCHED)operator(;) - reserved(break)operator(;) - operator(}) -preprocessor(#ifdef) ident(RUBY) - ident(CHECK_INTS)operator(;) -preprocessor(#endif) - reserved(continue)operator(;) comment(/* Successfully executed one pattern command; keep going. */) - - comment(/* Jump here if any matching operation fails. */) - label(fail:) - reserved(if) operator(()ident(stackp) operator(!=) ident(stackb)operator(\)) operator({) - comment(/* A restart point is known. Restart there and pop it. */) - pre_type(short) ident(last_used_reg)operator(,) ident(this_reg)operator(;) - - comment(/* If this failure point is from a dummy_failure_point, just - skip it. */) - reserved(if) operator(()ident(stackp)operator([-)integer(4)operator(]) operator(==) integer(0) operator(||) operator(()ident(best_regs_set) operator(&&) ident(stackp)operator([-)integer(1)operator(]) operator(==) ident(NON_GREEDY)operator(\)\)) operator({) - ident(POP_FAILURE_POINT)operator((\);) - reserved(goto) ident(fail)operator(;) - operator(}) - ident(stackp)operator(--;) comment(/* discard greedy flag */) - ident(options) operator(=) operator(()pre_type(long)operator(\)*--)ident(stackp)operator(;) - ident(d) operator(=) operator(*--)ident(stackp)operator(;) - ident(p) operator(=) operator(*--)ident(stackp)operator(;) - comment(/* Restore register info. */) - ident(last_used_reg) operator(=) operator(()pre_type(long)operator(\)*--)ident(stackp)operator(;) - - comment(/* Make the ones that weren't saved -1 or 0 again. */) - reserved(for) operator(()ident(this_reg) operator(=) ident(num_regs) operator(-) integer(1)operator(;) ident(this_reg) operator(>) ident(last_used_reg)operator(;) ident(this_reg)operator(--\)) operator({) - ident(regend)operator([)ident(this_reg)operator(]) operator(=) ident(REG_UNSET_VALUE)operator(;) - ident(regstart)operator([)ident(this_reg)operator(]) operator(=) ident(REG_UNSET_VALUE)operator(;) - ident(IS_ACTIVE)operator(()ident(reg_info)operator([)ident(this_reg)operator(]\)) operator(=) integer(0)operator(;) - ident(MATCHED_SOMETHING)operator(()ident(reg_info)operator([)ident(this_reg)operator(]\)) operator(=) integer(0)operator(;) - operator(}) - - comment(/* And restore the rest from the stack. */) - reserved(for) operator(() operator(;) ident(this_reg) operator(>) integer(0)operator(;) ident(this_reg)operator(--\)) operator({) - ident(reg_info)operator([)ident(this_reg)operator(])operator(.)ident(word) operator(=) operator(*--)ident(stackp)operator(;) - ident(regend)operator([)ident(this_reg)operator(]) operator(=) operator(*--)ident(stackp)operator(;) - ident(regstart)operator([)ident(this_reg)operator(]) operator(=) operator(*--)ident(stackp)operator(;) - operator(}) - ident(mcnt) operator(=) operator(()pre_type(long)operator(\)*--)ident(stackp)operator(;) - reserved(while) operator(()ident(mcnt)operator(--\)) operator({) - ident(POP_FAILURE_COUNT)operator((\);) - operator(}) - reserved(if) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - pre_type(int) ident(is_a_jump_n) operator(=) integer(0)operator(;) - pre_type(int) ident(failed_paren) operator(=) integer(0)operator(;) - - ident(p1) operator(=) ident(p)operator(;) - comment(/* If failed to a backwards jump that's part of a repetition - loop, need to pop this failure point and use the next one. */) - reserved(switch) operator((()reserved(enum) ident(regexpcode)operator(\)*)ident(p1)operator(\)) operator({) - reserved(case) ident(jump_n)operator(:) - reserved(case) ident(finalize_push_n)operator(:) - ident(is_a_jump_n) operator(=) integer(1)operator(;) - reserved(case) ident(maybe_finalize_jump)operator(:) - reserved(case) ident(finalize_jump)operator(:) - reserved(case) ident(finalize_push)operator(:) - reserved(case) ident(jump)operator(:) - ident(p1)operator(++;) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p1)operator(\);) - - reserved(if) operator(()ident(mcnt) operator(>=) integer(0)operator(\)) reserved(break)operator(;) comment(/* should be backward jump */) - ident(p1) operator(+=) ident(mcnt)operator(;) - - reserved(if) operator((() ident(is_a_jump_n) operator(&&) operator(()reserved(enum) ident(regexpcode)operator(\)*)ident(p1) operator(==) ident(succeed_n)operator(\)) operator(||) - operator((!)ident(is_a_jump_n) operator(&&) operator(()reserved(enum) ident(regexpcode)operator(\)*)ident(p1) operator(==) ident(on_failure_jump)operator(\)\)) operator({) - reserved(if) operator(()ident(failed_paren)operator(\)) operator({) - ident(p1)operator(++;) - ident(EXTRACT_NUMBER_AND_INCR)operator(()ident(mcnt)operator(,) ident(p1)operator(\);) - ident(PUSH_FAILURE_POINT)operator(()ident(p1) operator(+) ident(mcnt)operator(,) ident(d)operator(\);) - operator(}) - reserved(goto) ident(fail)operator(;) - operator(}) - reserved(break)operator(;) - reserved(default)operator(:) - comment(/* do nothing */)operator(;) - operator(}) - operator(}) - operator(}) - reserved(else) - reserved(break)operator(;) comment(/* Matching at this starting point really fails. */) - operator(}) - - reserved(if) operator(()ident(best_regs_set)operator(\)) - reserved(goto) ident(restore_best_regs)operator(;) - - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,(-)integer(1)operator(\)\);) comment(/* Failure to match. */) - label(memory_exhausted:) - ident(FREE_AND_RETURN)operator(()ident(stackb)operator(,(-)integer(2)operator(\)\);) -operator(}) - - -directive(static) pre_type(int) -ident(memcmp_translate)operator(()ident(s1)operator(,) ident(s2)operator(,) ident(len)operator(\)) - pre_type(unsigned) pre_type(char) operator(*)ident(s1)operator(,) operator(*)ident(s2)operator(;) - directive(register) pre_type(int) ident(len)operator(;) -operator({) - directive(register) pre_type(unsigned) pre_type(char) operator(*)ident(p1) operator(=) ident(s1)operator(,) operator(*)ident(p2) operator(=) ident(s2)operator(,) ident(c)operator(;) - reserved(while) operator(()ident(len)operator(\)) operator({) - ident(c) operator(=) operator(*)ident(p1)operator(++;) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)\)) operator({) - pre_type(int) ident(n)operator(;) - - reserved(if) operator(()ident(c) operator(!=) operator(*)ident(p2)operator(++\)) reserved(return) integer(1)operator(;) - reserved(for) operator(()ident(n) operator(=) ident(mbclen)operator(()ident(c)operator(\)) operator(-) integer(1)operator(;) ident(n) operator(>) integer(0)operator(;) ident(n)operator(--\)) - reserved(if) operator((!--)ident(len) operator(||) operator(*)ident(p1)operator(++) operator(!=) operator(*)ident(p2)operator(++\)) - reserved(return) integer(1)operator(;) - operator(}) - reserved(else) - reserved(if) operator(()ident(translate)operator([)ident(c)operator(]) operator(!=) ident(translate)operator([*)ident(p2)operator(++]\)) - reserved(return) integer(1)operator(;) - ident(len)operator(--;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(void) -ident(re_copy_registers)operator(()ident(regs1)operator(,) ident(regs2)operator(\)) - reserved(struct) ident(re_registers) operator(*)ident(regs1)operator(,) operator(*)ident(regs2)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - - reserved(if) operator(()ident(regs1) operator(==) ident(regs2)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(regs1)operator(->)ident(allocated) operator(==) integer(0)operator(\)) operator({) - ident(regs1)operator(->)ident(beg) operator(=) ident(TMALLOC)operator(()ident(regs2)operator(->)ident(num_regs)operator(,) pre_type(int)operator(\);) - ident(regs1)operator(->)ident(end) operator(=) ident(TMALLOC)operator(()ident(regs2)operator(->)ident(num_regs)operator(,) pre_type(int)operator(\);) - ident(regs1)operator(->)ident(allocated) operator(=) ident(regs2)operator(->)ident(num_regs)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(regs1)operator(->)ident(allocated) operator(<) ident(regs2)operator(->)ident(num_regs)operator(\)) operator({) - ident(TREALLOC)operator(()ident(regs1)operator(->)ident(beg)operator(,) ident(regs2)operator(->)ident(num_regs)operator(,) pre_type(int)operator(\);) - ident(TREALLOC)operator(()ident(regs1)operator(->)ident(end)operator(,) ident(regs2)operator(->)ident(num_regs)operator(,) pre_type(int)operator(\);) - ident(regs1)operator(->)ident(allocated) operator(=) ident(regs2)operator(->)ident(num_regs)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(regs2)operator(->)ident(num_regs)operator(;) ident(i)operator(++\)) operator({) - ident(regs1)operator(->)ident(beg)operator([)ident(i)operator(]) operator(=) ident(regs2)operator(->)ident(beg)operator([)ident(i)operator(];) - ident(regs1)operator(->)ident(end)operator([)ident(i)operator(]) operator(=) ident(regs2)operator(->)ident(end)operator([)ident(i)operator(];) - operator(}) - ident(regs1)operator(->)ident(num_regs) operator(=) ident(regs2)operator(->)ident(num_regs)operator(;) -operator(}) - -directive(void) -ident(re_free_registers)operator(()ident(regs)operator(\)) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) -operator({) - reserved(if) operator(()ident(regs)operator(->)ident(allocated) operator(==) integer(0)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(regs)operator(->)ident(beg)operator(\)) ident(xfree)operator(()ident(regs)operator(->)ident(beg)operator(\);) - reserved(if) operator(()ident(regs)operator(->)ident(end)operator(\)) ident(xfree)operator(()ident(regs)operator(->)ident(end)operator(\);) -operator(}) - -comment(/* Functions for multi-byte support. - Created for grep multi-byte extension Jul., 1993 by t^2 (Takahiro Tanimoto\) - Last change: Jul. 9, 1993 by t^2 */) -directive(static) directive(const) pre_type(unsigned) pre_type(char) ident(mbctab_ascii)operator([]) operator(=) operator({) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) -operator(};) - -directive(static) directive(const) pre_type(unsigned) pre_type(char) ident(mbctab_euc)operator([]) operator(=) operator({) comment(/* 0xA1-0xFE */) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(1)operator(,) integer(2)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(0)operator(,) -operator(};) - -directive(static) directive(const) pre_type(unsigned) pre_type(char) ident(mbctab_sjis)operator([]) operator(=) operator({) comment(/* 0x81-0x9F,0xE0-0xFC */) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0) -operator(};) - -directive(static) directive(const) pre_type(unsigned) pre_type(char) ident(mbctab_sjis_trail)operator([]) operator(=) operator({) comment(/* 0x40-0x7E,0x80-0xFC */) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(0)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0) -operator(};) - -directive(static) directive(const) pre_type(unsigned) pre_type(char) ident(mbctab_utf8)operator([]) operator(=) operator({) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(,) - integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) - integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(4)operator(,) integer(4)operator(,) integer(4)operator(,) integer(4)operator(,) integer(5)operator(,) integer(5)operator(,) integer(0)operator(,) integer(0)operator(,) -operator(};) - -directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(re_mbctab) operator(=) ident(mbctab_ascii)operator(;) - -directive(void) -ident(re_mbcinit)operator(()ident(mbctype)operator(\)) - pre_type(int) ident(mbctype)operator(;) -operator({) - reserved(switch) operator(()ident(mbctype)operator(\)) operator({) - reserved(case) ident(MBCTYPE_ASCII)operator(:) - ident(re_mbctab) operator(=) ident(mbctab_ascii)operator(;) - ident(current_mbctype) operator(=) ident(MBCTYPE_ASCII)operator(;) - reserved(break)operator(;) - reserved(case) ident(MBCTYPE_EUC)operator(:) - ident(re_mbctab) operator(=) ident(mbctab_euc)operator(;) - ident(current_mbctype) operator(=) ident(MBCTYPE_EUC)operator(;) - reserved(break)operator(;) - reserved(case) ident(MBCTYPE_SJIS)operator(:) - ident(re_mbctab) operator(=) ident(mbctab_sjis)operator(;) - ident(current_mbctype) operator(=) ident(MBCTYPE_SJIS)operator(;) - reserved(break)operator(;) - reserved(case) ident(MBCTYPE_UTF8)operator(:) - ident(re_mbctab) operator(=) ident(mbctab_utf8)operator(;) - ident(current_mbctype) operator(=) ident(MBCTYPE_UTF8)operator(;) - reserved(break)operator(;) - operator(}) -operator(}) - -preprocessor(#define) ident(mbc_isfirst)operator(()ident(t)operator(,) ident(c)operator(\)) operator(()ident(t)operator(\)[()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)]) -preprocessor(#define) ident(mbc_len)operator(()ident(t)operator(,) ident(c)operator(\)) operator((()ident(t)operator(\)[()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)]+)integer(1)operator(\)) - -directive(static) pre_type(unsigned) pre_type(int) -ident(asc_startpos)operator(()ident(string)operator(,) ident(pos)operator(\)) - directive(const) pre_type(char) operator(*)ident(string)operator(;) - pre_type(unsigned) pre_type(int) ident(pos)operator(;) -operator({) - reserved(return) ident(pos)operator(;) -operator(}) - -preprocessor(#define) ident(euc_islead)operator(()ident(c)operator(\)) operator((()pre_type(unsigned) pre_type(char)operator(\)(()ident(c)operator(\)) operator(-) hex(0xa1)operator(\)) operator(>) hex(0xfe) operator(-) hex(0xa1)operator(\)) -preprocessor(#define) ident(euc_mbclen)operator(()ident(c)operator(\)) ident(mbc_len)operator(()ident(mbctab_euc)operator(,) operator(()ident(c)operator(\)\)) -directive(static) pre_type(unsigned) pre_type(int) -ident(euc_startpos)operator(()ident(string)operator(,) ident(pos)operator(\)) - directive(const) pre_type(char) operator(*)ident(string)operator(;) - pre_type(unsigned) pre_type(int) ident(pos)operator(;) -operator({) - pre_type(unsigned) pre_type(int) ident(i) operator(=) ident(pos)operator(,) ident(w)operator(;) - - reserved(while) operator(()ident(i) operator(>) integer(0) operator(&&) operator(!)ident(euc_islead)operator(()ident(string)operator([)ident(i)operator(]\)\)) operator({) - operator(--)ident(i)operator(;) - operator(}) - reserved(if) operator(()ident(i) operator(==) ident(pos) operator(||) ident(i) operator(+) operator(()ident(w) operator(=) ident(euc_mbclen)operator(()ident(string)operator([)ident(i)operator(]\)\)) operator(>) ident(pos)operator(\)) operator({) - reserved(return) ident(i)operator(;) - operator(}) - ident(i) operator(+=) ident(w)operator(;) - reserved(return) ident(i) operator(+) operator((()ident(pos) operator(-) ident(i)operator(\)) operator(&) operator(~)integer(1)operator(\);) -operator(}) - -preprocessor(#define) ident(sjis_isfirst)operator(()ident(c)operator(\)) ident(mbc_isfirst)operator(()ident(mbctab_sjis)operator(,) operator(()ident(c)operator(\)\)) -preprocessor(#define) ident(sjis_istrail)operator(()ident(c)operator(\)) ident(mbctab_sjis_trail)operator([()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)]) -preprocessor(#define) ident(sjis_mbclen)operator(()ident(c)operator(\)) ident(mbc_len)operator(()ident(mbctab_sjis)operator(,) operator(()ident(c)operator(\)\)) -directive(static) pre_type(unsigned) pre_type(int) -ident(sjis_startpos)operator(()ident(string)operator(,) ident(pos)operator(\)) - directive(const) pre_type(char) operator(*)ident(string)operator(;) - pre_type(unsigned) pre_type(int) ident(pos)operator(;) -operator({) - pre_type(unsigned) pre_type(int) ident(i) operator(=) ident(pos)operator(,) ident(w)operator(;) - - reserved(if) operator(()ident(i) operator(>) integer(0) operator(&&) ident(sjis_istrail)operator(()ident(string)operator([)ident(i)operator(]\)\)) operator({) - reserved(do) operator({) - reserved(if) operator((!)ident(sjis_isfirst)operator(()ident(string)operator([--)ident(i)operator(]\)\)) operator({) - operator(++)ident(i)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) reserved(while) operator(()ident(i) operator(>) integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(i) operator(==) ident(pos) operator(||) ident(i) operator(+) operator(()ident(w) operator(=) ident(sjis_mbclen)operator(()ident(string)operator([)ident(i)operator(]\)\)) operator(>) ident(pos)operator(\)) operator({) - reserved(return) ident(i)operator(;) - operator(}) - ident(i) operator(+=) ident(w)operator(;) - reserved(return) ident(i) operator(+) operator((()ident(pos) operator(-) ident(i)operator(\)) operator(&) operator(~)integer(1)operator(\);) -operator(}) - -preprocessor(#define) ident(utf8_islead)operator(()ident(c)operator(\)) operator((()pre_type(unsigned) pre_type(char)operator(\)(()ident(c)operator(\)) operator(&) hex(0xc0)operator(\)) operator(!=) hex(0x80)operator(\)) -preprocessor(#define) ident(utf8_mbclen)operator(()ident(c)operator(\)) ident(mbc_len)operator(()ident(mbctab_utf8)operator(,) operator(()ident(c)operator(\)\)) -directive(static) pre_type(unsigned) pre_type(int) -ident(utf8_startpos)operator(()ident(string)operator(,) ident(pos)operator(\)) - directive(const) pre_type(char) operator(*)ident(string)operator(;) - pre_type(unsigned) pre_type(int) ident(pos)operator(;) -operator({) - pre_type(unsigned) pre_type(int) ident(i) operator(=) ident(pos)operator(,) ident(w)operator(;) - - reserved(while) operator(()ident(i) operator(>) integer(0) operator(&&) operator(!)ident(utf8_islead)operator(()ident(string)operator([)ident(i)operator(]\)\)) operator({) - operator(--)ident(i)operator(;) - operator(}) - reserved(if) operator(()ident(i) operator(==) ident(pos) operator(||) ident(i) operator(+) operator(()ident(w) operator(=) ident(utf8_mbclen)operator(()ident(string)operator([)ident(i)operator(]\)\)) operator(>) ident(pos)operator(\)) operator({) - reserved(return) ident(i)operator(;) - operator(}) - reserved(return) ident(i) operator(+) ident(w)operator(;) -operator(}) - -comment(/* - vi: sw=2 ts=8 - Local variables: - mode : C - c-file-style : "gnu" - tab-width : 8 - End -*/) -comment(/********************************************************************** - - ruby.c - - - $Author: shyouhei $ - $Date: 2008-07-10 11:36:08 +0200 (Thu, 10 Jul 2008\) $ - created at: Tue Aug 10 12:47:31 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#if) ident(defined) ident(_WIN32) operator(||) ident(defined) ident(__CYGWIN__) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#if) ident(defined) ident(__CYGWIN__) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#ifdef) ident(_WIN32_WCE) -preprocessor(#include) include() -preprocessor(#include) include("wince.h") -preprocessor(#endif) -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("dln.h") -preprocessor(#include) include("node.h") -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#ifdef) ident(__hpux) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_UNISTD_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_STRING_H) -pre_type(char) operator(*)ident(strchr) ident(_)operator((()directive(const) pre_type(char)operator(*,)directive(const) pre_type(char)operator(\)\);) -pre_type(char) operator(*)ident(strrchr) ident(_)operator((()directive(const) pre_type(char)operator(*,)directive(const) pre_type(char)operator(\)\);) -pre_type(char) operator(*)ident(strstr) ident(_)operator((()directive(const) pre_type(char)operator(*,)directive(const) pre_type(char)operator(*\)\);) -preprocessor(#endif) - -preprocessor(#include) include("util.h") - -preprocessor(#ifndef) ident(HAVE_STDLIB_H) -pre_type(char) operator(*)ident(getenv)operator((\);) -preprocessor(#endif) - -ident(VALUE) ident(ruby_debug) operator(=) ident(Qfalse)operator(;) -ident(VALUE) ident(ruby_verbose) operator(=) ident(Qfalse)operator(;) -directive(static) pre_type(int) ident(sflag) operator(=) integer(0)operator(;) -directive(static) pre_type(int) ident(xflag) operator(=) integer(0)operator(;) -directive(extern) pre_type(int) ident(ruby_yydebug)operator(;) - -pre_type(char) operator(*)ident(ruby_inplace_mode) operator(=) ident(Qfalse)operator(;) - -directive(static) directive(void) ident(load_stdin) ident(_)operator((()directive(void)operator(\)\);) -directive(static) directive(void) ident(load_file) ident(_)operator((()directive(const) pre_type(char) operator(*,) pre_type(int)operator(\)\);) -directive(static) directive(void) ident(forbid_setid) ident(_)operator((()directive(const) pre_type(char) operator(*\)\);) - -directive(static) ident(VALUE) ident(do_loop) operator(=) ident(Qfalse)operator(,) ident(do_print) operator(=) ident(Qfalse)operator(;) -directive(static) ident(VALUE) ident(do_check) operator(=) ident(Qfalse)operator(,) ident(do_line) operator(=) ident(Qfalse)operator(;) -directive(static) ident(VALUE) ident(do_split) operator(=) ident(Qfalse)operator(;) - -directive(static) pre_type(char) operator(*)ident(script)operator(;) - -directive(static) pre_type(int) ident(origargc)operator(;) -directive(static) pre_type(char) operator(**)ident(origargv)operator(;) - -directive(static) directive(void) -ident(usage)operator(()ident(name)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - comment(/* This message really ought to be max 23 lines. - * Removed -h because the user already knows that option. Others? */) - - directive(static) pre_type(char) operator(*)ident(usage_msg)operator([]) operator(=) operator({) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -pre_constant(NULL) -operator(};) - pre_type(char) operator(**)ident(p) operator(=) ident(usage_msg)operator(;) - - ident(printf)operator(()stringoperator(,) ident(name)operator(\);) - reserved(while) operator((*)ident(p)operator(\)) - ident(printf)operator(()stringoperator(,) operator(*)ident(p)operator(++\);) -operator(}) - -directive(extern) ident(VALUE) ident(rb_load_path)operator(;) - -preprocessor(#ifndef) ident(CharNext) comment(/* defined as CharNext[AW] on Windows. */) -preprocessor(#define) ident(CharNext)operator(()ident(p)operator(\)) operator((()ident(p)operator(\)) operator(+) ident(mblen)operator(()ident(p)operator(,) ident(RUBY_MBCHAR_MAXSIZE)operator(\)\)) -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(DOSISH) operator(||) ident(defined) ident(__CYGWIN__) -directive(static) directive(inline) directive(void) -ident(translate_char)operator(()pre_type(char) operator(*)ident(p)operator(,) pre_type(int) ident(from)operator(,) pre_type(int) ident(to)operator(\)) -operator({) - reserved(while) operator((*)ident(p)operator(\)) operator({) - reserved(if) operator((()pre_type(unsigned) pre_type(char)operator(\)*)ident(p) operator(==) ident(from)operator(\)) - operator(*)ident(p) operator(=) ident(to)operator(;) - ident(p) operator(=) ident(CharNext)operator(()ident(p)operator(\);) - operator(}) -operator(}) -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(_WIN32) operator(||) ident(defined) ident(__CYGWIN__) operator(||) ident(defined) ident(__DJGPP__) -directive(static) ident(VALUE) -ident(rubylib_mangled_path)operator(()directive(const) pre_type(char) operator(*)ident(s)operator(,) pre_type(unsigned) pre_type(int) ident(l)operator(\)) -operator({) - directive(static) pre_type(char) operator(*)ident(newp)operator(,) operator(*)ident(oldp)operator(;) - directive(static) pre_type(int) ident(newl)operator(,) ident(oldl)operator(,) ident(notfound)operator(;) - pre_type(char) operator(*)ident(ptr)operator(;) - ident(VALUE) ident(ret)operator(;) - - reserved(if) operator((!)ident(newp) operator(&&) operator(!)ident(notfound)operator(\)) operator({) - ident(newp) operator(=) ident(getenv)operator(()stringoperator(\);) - reserved(if) operator(()ident(newp)operator(\)) operator({) - ident(oldp) operator(=) ident(newp) operator(=) ident(strdup)operator(()ident(newp)operator(\);) - reserved(while) operator((*)ident(newp) operator(&&) operator(!)ident(ISSPACE)operator((*)ident(newp)operator(\)) operator(&&) operator(*)ident(newp) operator(!=) char(';')operator(\)) operator({) - ident(newp) operator(=) ident(CharNext)operator(()ident(newp)operator(\);) comment(/* Skip digits. */) - operator(}) - ident(oldl) operator(=) ident(newp) operator(-) ident(oldp)operator(;) - reserved(while) operator((*)ident(newp) operator(&&) operator(()ident(ISSPACE)operator((*)ident(newp)operator(\)) operator(||) operator(*)ident(newp) operator(==) char(';')operator(\)\)) operator({) - ident(newp) operator(=) ident(CharNext)operator(()ident(newp)operator(\);) comment(/* Skip whitespace. */) - operator(}) - ident(newl) operator(=) ident(strlen)operator(()ident(newp)operator(\);) - reserved(if) operator(()ident(newl) operator(==) integer(0) operator(||) ident(oldl) operator(==) integer(0)operator(\)) operator({) - ident(rb_fatal)operator(()stringoperator(\);) - operator(}) - ident(translate_char)operator(()ident(newp)operator(,) char('\\\\')operator(,) char('/')operator(\);) - operator(}) - reserved(else) operator({) - ident(notfound) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(if) operator((!)ident(newp) operator(||) ident(l) operator(<) ident(oldl) operator(||) ident(strncasecmp)operator(()ident(oldp)operator(,) ident(s)operator(,) ident(oldl)operator(\)) operator(!=) integer(0)operator(\)) operator({) - reserved(return) ident(rb_str_new)operator(()ident(s)operator(,) ident(l)operator(\);) - operator(}) - ident(ret) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(l) operator(+) ident(newl) operator(-) ident(oldl)operator(\);) - ident(ptr) operator(=) ident(RSTRING_PTR)operator(()ident(ret)operator(\);) - ident(memcpy)operator(()ident(ptr)operator(,) ident(newp)operator(,) ident(newl)operator(\);) - ident(memcpy)operator(()ident(ptr) operator(+) ident(newl)operator(,) ident(s) operator(+) ident(oldl)operator(,) ident(l) operator(-) ident(oldl)operator(\);) - ident(ptr)operator([)ident(l) operator(+) ident(newl) operator(-) ident(oldl)operator(]) operator(=) integer(0)operator(;) - reserved(return) ident(ret)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rubylib_mangled_path2)operator(()directive(const) pre_type(char) operator(*)ident(s)operator(\)) -operator({) - reserved(return) ident(rubylib_mangled_path)operator(()ident(s)operator(,) ident(strlen)operator(()ident(s)operator(\)\);) -operator(}) -preprocessor(#else) -preprocessor(#define) ident(rubylib_mangled_path) ident(rb_str_new) -preprocessor(#define) ident(rubylib_mangled_path2) ident(rb_str_new2) -preprocessor(#endif) - -directive(static) directive(void) ident(push_include) ident(_)operator((()directive(const) pre_type(char) operator(*)ident(path)operator(\)\);) - -directive(static) directive(void) -ident(push_include)operator(()ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) - directive(const) pre_type(char) ident(sep) operator(=) ident(PATH_SEP_CHAR)operator(;) - directive(const) pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(s)operator(;) - - ident(p) operator(=) ident(path)operator(;) - reserved(while) operator((*)ident(p)operator(\)) operator({) - reserved(while) operator((*)ident(p) operator(==) ident(sep)operator(\)) - ident(p)operator(++;) - reserved(if) operator((!*)ident(p)operator(\)) reserved(break)operator(;) - reserved(for) operator(()ident(s) operator(=) ident(p)operator(;) operator(*)ident(s) operator(&&) operator(*)ident(s) operator(!=) ident(sep)operator(;) ident(s) operator(=) ident(CharNext)operator(()ident(s)operator(\)\);) - ident(rb_ary_push)operator(()ident(rb_load_path)operator(,) ident(rubylib_mangled_path)operator(()ident(p)operator(,) ident(s) operator(-) ident(p)operator(\)\);) - ident(p) operator(=) ident(s)operator(;) - operator(}) -operator(}) - -preprocessor(#ifdef) ident(__CYGWIN__) -directive(static) directive(void) -ident(push_include_cygwin)operator(()directive(const) pre_type(char) operator(*)ident(path)operator(\)) -operator({) - directive(const) pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(s)operator(;) - pre_type(char) ident(rubylib)operator([)ident(FILENAME_MAX)operator(];) - ident(VALUE) ident(buf) operator(=) integer(0)operator(;) - - ident(p) operator(=) ident(path)operator(;) - reserved(while) operator((*)ident(p)operator(\)) operator({) - pre_type(unsigned) pre_type(int) ident(len)operator(;) - reserved(while) operator((*)ident(p) operator(==) char(';')operator(\)) - ident(p)operator(++;) - reserved(if) operator((!*)ident(p)operator(\)) reserved(break)operator(;) - reserved(for) operator(()ident(s) operator(=) ident(p)operator(;) operator(*)ident(s) operator(&&) operator(*)ident(s) operator(!=) char(';')operator(;) ident(s) operator(=) ident(CharNext)operator(()ident(s)operator(\)\);) - ident(len) operator(=) ident(s) operator(-) ident(p)operator(;) - reserved(if) operator((*)ident(s)operator(\)) operator({) - reserved(if) operator((!)ident(buf)operator(\)) operator({) - ident(buf) operator(=) ident(rb_str_new)operator(()ident(p)operator(,) ident(len)operator(\);) - ident(p) operator(=) ident(RSTRING_PTR)operator(()ident(buf)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_str_resize)operator(()ident(buf)operator(,) ident(len)operator(\);) - ident(p) operator(=) ident(strncpy)operator(()ident(RSTRING_PTR)operator(()ident(buf)operator(\),) ident(p)operator(,) ident(len)operator(\);) - operator(}) - operator(}) - reserved(if) operator(()ident(cygwin_conv_to_posix_path)operator(()ident(p)operator(,) ident(rubylib)operator(\)) operator(==) integer(0)operator(\)) - ident(p) operator(=) ident(rubylib)operator(;) - ident(push_include)operator(()ident(p)operator(\);) - reserved(if) operator((!*)ident(s)operator(\)) reserved(break)operator(;) - ident(p) operator(=) ident(s) operator(+) integer(1)operator(;) - operator(}) -operator(}) - -preprocessor(#define) ident(push_include) ident(push_include_cygwin) -preprocessor(#endif) - -directive(void) -ident(ruby_incpush)operator(()ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) - reserved(if) operator(()ident(path) operator(==) integer(0)operator(\)) - reserved(return)operator(;) - ident(push_include)operator(()ident(path)operator(\);) -operator(}) - -preprocessor(#if) ident(defined) ident(DOSISH) operator(||) ident(defined) ident(__CYGWIN__) -preprocessor(#define) ident(LOAD_RELATIVE) integer(1) -preprocessor(#endif) - -directive(void) -ident(ruby_init_loadpath)operator((\)) -operator({) -preprocessor(#if) ident(defined) ident(LOAD_RELATIVE) - pre_type(char) ident(libpath)operator([)ident(FILENAME_MAX)operator(+)integer(1)operator(];) - pre_type(char) operator(*)ident(p)operator(;) - pre_type(int) ident(rest)operator(;) -preprocessor(#if) ident(defined) ident(_WIN32) operator(||) ident(defined) ident(__CYGWIN__) - ident(HMODULE) ident(libruby) operator(=) pre_constant(NULL)operator(;) - ident(MEMORY_BASIC_INFORMATION) ident(m)operator(;) - -preprocessor(#ifndef) ident(_WIN32_WCE) - ident(memset)operator((&)ident(m)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(m)operator(\)\);) - reserved(if) operator(()ident(VirtualQuery)operator(()ident(ruby_init_loadpath)operator(,) operator(&)ident(m)operator(,) reserved(sizeof)operator(()ident(m)operator(\)\)) operator(&&) ident(m)operator(.)ident(State) operator(==) ident(MEM_COMMIT)operator(\)) - ident(libruby) operator(=) operator(()ident(HMODULE)operator(\))ident(m)operator(.)ident(AllocationBase)operator(;) -preprocessor(#endif) - ident(GetModuleFileName)operator(()ident(libruby)operator(,) ident(libpath)operator(,) reserved(sizeof) ident(libpath)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(DJGPP)operator(\)) - directive(extern) pre_type(char) operator(*)ident(__dos_argv0)operator(;) - ident(strncpy)operator(()ident(libpath)operator(,) ident(__dos_argv0)operator(,) ident(FILENAME_MAX)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(__human68k__)operator(\)) - directive(extern) pre_type(char) operator(**)ident(_argv)operator(;) - ident(strncpy)operator(()ident(libpath)operator(,) ident(_argv)operator([)integer(0)operator(],) ident(FILENAME_MAX)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(__EMX__)operator(\)) - ident(_execname)operator(()ident(libpath)operator(,) ident(FILENAME_MAX)operator(\);) -preprocessor(#endif) - - ident(libpath)operator([)ident(FILENAME_MAX)operator(]) operator(=) char('\\0')operator(;) -preprocessor(#if) ident(defined) ident(DOSISH) - ident(translate_char)operator(()ident(libpath)operator(,) char('\\\\')operator(,) char('/')operator(\);) -preprocessor(#elif) ident(defined) ident(__CYGWIN__) - operator({) - pre_type(char) ident(rubylib)operator([)ident(FILENAME_MAX)operator(];) - ident(cygwin_conv_to_posix_path)operator(()ident(libpath)operator(,) ident(rubylib)operator(\);) - ident(strncpy)operator(()ident(libpath)operator(,) ident(rubylib)operator(,) reserved(sizeof)operator(()ident(libpath)operator(\)\);) - operator(}) -preprocessor(#endif) - ident(p) operator(=) ident(strrchr)operator(()ident(libpath)operator(,) char('/')operator(\);) - reserved(if) operator(()ident(p)operator(\)) operator({) - operator(*)ident(p) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(p) operator(-) ident(libpath) operator(>) integer(3) operator(&&) operator(!)ident(strcasecmp)operator(()ident(p) operator(-) integer(4)operator(,) stringoperator(\)\)) operator({) - ident(p) operator(-=) integer(4)operator(;) - operator(*)ident(p) operator(=) integer(0)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(strcpy)operator(()ident(libpath)operator(,) stringoperator(\);) - ident(p) operator(=) ident(libpath) operator(+) integer(1)operator(;) - operator(}) - - ident(rest) operator(=) ident(FILENAME_MAX) operator(-) operator(()ident(p) operator(-) ident(libpath)operator(\);) - -preprocessor(#define) ident(RUBY_RELATIVE)operator(()ident(path)operator(\)) operator(()ident(strncpy)operator(()ident(p)operator(,) operator(()ident(path)operator(\),) ident(rest)operator(\),) ident(libpath)operator(\)) -preprocessor(#else) -preprocessor(#define) ident(RUBY_RELATIVE)operator(()ident(path)operator(\)) operator(()ident(path)operator(\)) -preprocessor(#endif) -preprocessor(#define) ident(incpush)operator(()ident(path)operator(\)) ident(rb_ary_push)operator(()ident(rb_load_path)operator(,) ident(rubylib_mangled_path2)operator(()ident(path)operator(\)\)) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(==) integer(0)operator(\)) operator({) - ident(ruby_incpush)operator(()ident(getenv)operator(()stringoperator(\)\);) - operator(}) - -preprocessor(#ifdef) ident(RUBY_SEARCH_PATH) - ident(incpush)operator(()ident(RUBY_RELATIVE)operator(()ident(RUBY_SEARCH_PATH)operator(\)\);) -preprocessor(#endif) - - ident(incpush)operator(()ident(RUBY_RELATIVE)operator(()ident(RUBY_SITE_LIB2)operator(\)\);) -preprocessor(#ifdef) ident(RUBY_SITE_THIN_ARCHLIB) - ident(incpush)operator(()ident(RUBY_RELATIVE)operator(()ident(RUBY_SITE_THIN_ARCHLIB)operator(\)\);) -preprocessor(#endif) - ident(incpush)operator(()ident(RUBY_RELATIVE)operator(()ident(RUBY_SITE_ARCHLIB)operator(\)\);) - ident(incpush)operator(()ident(RUBY_RELATIVE)operator(()ident(RUBY_SITE_LIB)operator(\)\);) - - ident(incpush)operator(()ident(RUBY_RELATIVE)operator(()ident(RUBY_LIB)operator(\)\);) -preprocessor(#ifdef) ident(RUBY_THIN_ARCHLIB) - ident(incpush)operator(()ident(RUBY_RELATIVE)operator(()ident(RUBY_THIN_ARCHLIB)operator(\)\);) -preprocessor(#endif) - ident(incpush)operator(()ident(RUBY_RELATIVE)operator(()ident(RUBY_ARCHLIB)operator(\)\);) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(==) integer(0)operator(\)) operator({) - ident(incpush)operator(()stringoperator(\);) - operator(}) -operator(}) - -reserved(struct) ident(req_list) operator({) - pre_type(char) operator(*)ident(name)operator(;) - reserved(struct) ident(req_list) operator(*)ident(next)operator(;) -operator(};) -directive(static) reserved(struct) ident(req_list) ident(req_list_head)operator(,) operator(*)ident(req_list_last) operator(=) operator(&)ident(req_list_head)operator(;) - -directive(static) directive(void) -ident(add_modules)operator(()ident(mod)operator(\)) - directive(const) pre_type(char) operator(*)ident(mod)operator(;) -operator({) - reserved(struct) ident(req_list) operator(*)ident(list)operator(;) - - ident(list) operator(=) ident(ALLOC)operator(()reserved(struct) ident(req_list)operator(\);) - ident(list)operator(->)ident(name) operator(=) ident(ALLOC_N)operator(()pre_type(char)operator(,) ident(strlen)operator(()ident(mod)operator(\)+)integer(1)operator(\);) - ident(strcpy)operator(()ident(list)operator(->)ident(name)operator(,) ident(mod)operator(\);) - ident(list)operator(->)ident(next) operator(=) integer(0)operator(;) - ident(req_list_last)operator(->)ident(next) operator(=) ident(list)operator(;) - ident(req_list_last) operator(=) ident(list)operator(;) -operator(}) - -directive(extern) directive(void) ident(Init_ext) ident(_)operator((()directive(void)operator(\)\);) - -directive(static) directive(void) -ident(require_libraries)operator((\)) -operator({) - directive(extern) ident(NODE) operator(*)ident(ruby_eval_tree)operator(;) - directive(extern) ident(NODE) operator(*)ident(ruby_eval_tree_begin)operator(;) - ident(NODE) operator(*)ident(save)operator([)integer(3)operator(];) - reserved(struct) ident(req_list) operator(*)ident(list) operator(=) ident(req_list_head)operator(.)ident(next)operator(;) - reserved(struct) ident(req_list) operator(*)ident(tmp)operator(;) - - ident(save)operator([)integer(0)operator(]) operator(=) ident(ruby_eval_tree)operator(;) - ident(save)operator([)integer(1)operator(]) operator(=) ident(ruby_eval_tree_begin)operator(;) - ident(save)operator([)integer(2)operator(]) operator(=) ident(NEW_NEWLINE)operator(()integer(0)operator(\);) - ident(ruby_eval_tree) operator(=) ident(ruby_eval_tree_begin) operator(=) integer(0)operator(;) - ident(ruby_current_node) operator(=) integer(0)operator(;) - ident(Init_ext)operator((\);) comment(/* should be called here for some reason :-( */) - ident(ruby_current_node) operator(=) ident(save)operator([)integer(2)operator(];) - ident(ruby_set_current_source)operator((\);) - ident(req_list_last) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(list)operator(\)) operator({) - pre_type(int) ident(state)operator(;) - - ident(ruby_current_node) operator(=) integer(0)operator(;) - ident(rb_protect)operator((()ident(VALUE) operator((*\)()ident(VALUE)operator(\)\))ident(rb_require)operator(,) operator(()ident(VALUE)operator(\))ident(list)operator(->)ident(name)operator(,) operator(&)ident(state)operator(\);) - reserved(if) operator(()ident(state)operator(\)) ident(rb_jump_tag)operator(()ident(state)operator(\);) - ident(tmp) operator(=) ident(list)operator(->)ident(next)operator(;) - ident(free)operator(()ident(list)operator(->)ident(name)operator(\);) - ident(free)operator(()ident(list)operator(\);) - ident(list) operator(=) ident(tmp)operator(;) - ident(ruby_current_node) operator(=) ident(save)operator([)integer(2)operator(];) - ident(ruby_set_current_source)operator((\);) - operator(}) - ident(req_list_head)operator(.)ident(next) operator(=) integer(0)operator(;) - ident(ruby_eval_tree) operator(=) ident(save)operator([)integer(0)operator(];) - ident(ruby_eval_tree_begin) operator(=) ident(save)operator([)integer(1)operator(];) - ident(rb_gc_force_recycle)operator((()ident(VALUE)operator(\))ident(save)operator([)integer(2)operator(]\);) - ident(ruby_current_node) operator(=) integer(0)operator(;) -operator(}) - -directive(static) directive(void) -ident(process_sflag)operator((\)) -operator({) - reserved(if) operator(()ident(sflag)operator(\)) operator({) - pre_type(long) ident(n)operator(;) - ident(VALUE) operator(*)ident(args)operator(;) - - ident(n) operator(=) ident(RARRAY)operator(()ident(rb_argv)operator(\)->)ident(len)operator(;) - ident(args) operator(=) ident(RARRAY)operator(()ident(rb_argv)operator(\)->)ident(ptr)operator(;) - reserved(while) operator(()ident(n) operator(>) integer(0)operator(\)) operator({) - ident(VALUE) ident(v) operator(=) operator(*)ident(args)operator(++;) - pre_type(char) operator(*)ident(s) operator(=) ident(StringValuePtr)operator(()ident(v)operator(\);) - pre_type(char) operator(*)ident(p)operator(;) - pre_type(int) ident(hyphen) operator(=) ident(Qfalse)operator(;) - - reserved(if) operator(()ident(s)operator([)integer(0)operator(]) operator(!=) char('-')operator(\)) reserved(break)operator(;) - ident(n)operator(--;) - reserved(if) operator(()ident(s)operator([)integer(1)operator(]) operator(==) char('-') operator(&&) ident(s)operator([)integer(2)operator(]) operator(==) char('\\0')operator(\)) reserved(break)operator(;) - - ident(v) operator(=) ident(Qtrue)operator(;) - comment(/* check if valid name before replacing - with _ */) - reserved(for) operator(()ident(p) operator(=) ident(s) operator(+) integer(1)operator(;) operator(*)ident(p)operator(;) ident(p)operator(++\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('=')operator(\)) operator({) - operator(*)ident(p)operator(++) operator(=) char('\\0')operator(;) - ident(v) operator(=) ident(rb_str_new2)operator(()ident(p)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(if) operator((*)ident(p) operator(==) char('-')operator(\)) operator({) - ident(hyphen) operator(=) ident(Qtrue)operator(;) - operator(}) - reserved(else) reserved(if) operator((*)ident(p) operator(!=) char('_') operator(&&) operator(!)ident(ISALNUM)operator((*)ident(p)operator(\)\)) operator({) - ident(VALUE) ident(name_error)operator([)integer(2)operator(];) - ident(name_error)operator([)integer(0)operator(]) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(if) operator((!()ident(p) operator(=) ident(strchr)operator(()ident(p)operator(,) char('=')operator(\)\)\)) operator({) - ident(rb_str_cat2)operator(()ident(name_error)operator([)integer(0)operator(],) ident(s)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_str_cat)operator(()ident(name_error)operator([)integer(0)operator(],) ident(s)operator(,) ident(p) operator(-) ident(s)operator(\);) - operator(}) - ident(name_error)operator([)integer(1)operator(]) operator(=) ident(args)operator([-)integer(1)operator(];) - ident(rb_exc_raise)operator(()ident(rb_class_new_instance)operator(()integer(2)operator(,) ident(name_error)operator(,) ident(rb_eNameError)operator(\)\);) - operator(}) - operator(}) - ident(s)operator([)integer(0)operator(]) operator(=) char('$')operator(;) - reserved(if) operator(()ident(hyphen)operator(\)) operator({) - reserved(for) operator(()ident(p) operator(=) ident(s) operator(+) integer(1)operator(;) operator(*)ident(p)operator(;) operator(++)ident(p)operator(\)) operator({) - reserved(if) operator((*)ident(p) operator(==) char('-')operator(\)) operator(*)ident(p) operator(=) char('_')operator(;) - operator(}) - operator(}) - ident(rb_gv_set)operator(()ident(s)operator(,) ident(v)operator(\);) - operator(}) - ident(n) operator(=) ident(RARRAY)operator(()ident(rb_argv)operator(\)->)ident(len) operator(-) ident(n)operator(;) - reserved(while) operator(()ident(n)operator(--\)) operator({) - ident(rb_ary_shift)operator(()ident(rb_argv)operator(\);) - operator(}) - operator(}) - ident(sflag) operator(=) integer(0)operator(;) -operator(}) - -directive(static) directive(void) ident(proc_options) ident(_)operator((()pre_type(int) ident(argc)operator(,) pre_type(char) operator(**)ident(argv)operator(\)\);) - -directive(static) pre_type(char)operator(*) -ident(moreswitches)operator(()ident(s)operator(\)) - pre_type(char) operator(*)ident(s)operator(;) -operator({) - pre_type(int) ident(argc)operator(;) pre_type(char) operator(*)ident(argv)operator([)integer(3)operator(];) - pre_type(char) operator(*)ident(p) operator(=) ident(s)operator(;) - - ident(argc) operator(=) integer(2)operator(;) ident(argv)operator([)integer(0)operator(]) operator(=) ident(argv)operator([)integer(2)operator(]) operator(=) integer(0)operator(;) - reserved(while) operator((*)ident(s) operator(&&) operator(!)ident(ISSPACE)operator((*)ident(s)operator(\)\)) - ident(s)operator(++;) - ident(argv)operator([)integer(1)operator(]) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(s)operator(-)ident(p)operator(+)integer(2)operator(\);) - ident(argv)operator([)integer(1)operator(][)integer(0)operator(]) operator(=) char('-')operator(;) - ident(strncpy)operator(()ident(argv)operator([)integer(1)operator(]+)integer(1)operator(,) ident(p)operator(,) ident(s)operator(-)ident(p)operator(\);) - ident(argv)operator([)integer(1)operator(][)ident(s)operator(-)ident(p)operator(+)integer(1)operator(]) operator(=) char('\\0')operator(;) - ident(proc_options)operator(()ident(argc)operator(,) ident(argv)operator(\);) - reserved(while) operator((*)ident(s) operator(&&) ident(ISSPACE)operator((*)ident(s)operator(\)\)) - ident(s)operator(++;) - reserved(return) ident(s)operator(;) -operator(}) - -directive(static) directive(void) -ident(proc_options)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - pre_type(char) operator(**)ident(argv)operator(;) -operator({) - pre_type(char) operator(*)ident(argv0) operator(=) ident(argv)operator([)integer(0)operator(];) - pre_type(int) ident(do_search)operator(;) - pre_type(char) operator(*)ident(s)operator(;) - ident(NODE) operator(*)directive(volatile) ident(script_node) operator(=) integer(0)operator(;) - - pre_type(int) ident(version) operator(=) integer(0)operator(;) - pre_type(int) ident(copyright) operator(=) integer(0)operator(;) - pre_type(int) ident(verbose) operator(=) integer(0)operator(;) - ident(VALUE) ident(e_script) operator(=) ident(Qfalse)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) reserved(return)operator(;) - - ident(do_search) operator(=) ident(Qfalse)operator(;) - - reserved(for) operator(()ident(argc)operator(--,)ident(argv)operator(++;) ident(argc) operator(>) integer(0)operator(;) ident(argc)operator(--,)ident(argv)operator(++\)) operator({) - reserved(if) operator(()ident(argv)operator([)integer(0)operator(][)integer(0)operator(]) operator(!=) char('-') operator(||) operator(!)ident(argv)operator([)integer(0)operator(][)integer(1)operator(]\)) reserved(break)operator(;) - - ident(s) operator(=) ident(argv)operator([)integer(0)operator(]+)integer(1)operator(;) - label(reswitch:) - reserved(switch) operator((*)ident(s)operator(\)) operator({) - reserved(case) char('a')operator(:) - ident(do_split) operator(=) ident(Qtrue)operator(;) - ident(s)operator(++;) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('p')operator(:) - ident(do_print) operator(=) ident(Qtrue)operator(;) - comment(/* through */) - reserved(case) char('n')operator(:) - ident(do_loop) operator(=) ident(Qtrue)operator(;) - ident(s)operator(++;) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('d')operator(:) - ident(ruby_debug) operator(=) ident(Qtrue)operator(;) - ident(ruby_verbose) operator(=) ident(Qtrue)operator(;) - ident(s)operator(++;) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('y')operator(:) - ident(ruby_yydebug) operator(=) integer(1)operator(;) - ident(s)operator(++;) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('v')operator(:) - reserved(if) operator(()ident(argv0) operator(==) integer(0) operator(||) ident(verbose)operator(\)) operator({) - ident(s)operator(++;) - reserved(goto) ident(reswitch)operator(;) - operator(}) - ident(ruby_show_version)operator((\);) - ident(verbose) operator(=) integer(1)operator(;) - reserved(case) char('w')operator(:) - ident(ruby_verbose) operator(=) ident(Qtrue)operator(;) - ident(s)operator(++;) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('W')operator(:) - operator({) - pre_type(int) ident(numlen)operator(;) - pre_type(int) ident(v) operator(=) integer(2)operator(;) comment(/* -W as -W2 */) - - reserved(if) operator((*++)ident(s)operator(\)) operator({) - ident(v) operator(=) ident(scan_oct)operator(()ident(s)operator(,) integer(1)operator(,) operator(&)ident(numlen)operator(\);) - reserved(if) operator(()ident(numlen) operator(==) integer(0)operator(\)) ident(v) operator(=) integer(1)operator(;) - ident(s) operator(+=) ident(numlen)operator(;) - operator(}) - reserved(switch) operator(()ident(v)operator(\)) operator({) - reserved(case) integer(0)operator(:) - ident(ruby_verbose) operator(=) ident(Qnil)operator(;) reserved(break)operator(;) - reserved(case) integer(1)operator(:) - ident(ruby_verbose) operator(=) ident(Qfalse)operator(;) reserved(break)operator(;) - reserved(default)operator(:) - ident(ruby_verbose) operator(=) ident(Qtrue)operator(;) reserved(break)operator(;) - operator(}) - operator(}) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('c')operator(:) - ident(do_check) operator(=) ident(Qtrue)operator(;) - ident(s)operator(++;) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('s')operator(:) - ident(forbid_setid)operator(()stringoperator(\);) - ident(sflag) operator(=) integer(1)operator(;) - ident(s)operator(++;) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('h')operator(:) - ident(usage)operator(()ident(origargv)operator([)integer(0)operator(]\);) - ident(exit)operator(()integer(0)operator(\);) - - reserved(case) char('l')operator(:) - ident(do_line) operator(=) ident(Qtrue)operator(;) - ident(rb_output_rs) operator(=) ident(rb_rs)operator(;) - ident(s)operator(++;) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('S')operator(:) - ident(forbid_setid)operator(()stringoperator(\);) - ident(do_search) operator(=) ident(Qtrue)operator(;) - ident(s)operator(++;) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('e')operator(:) - ident(forbid_setid)operator(()stringoperator(\);) - reserved(if) operator((!*++)ident(s)operator(\)) operator({) - ident(s) operator(=) ident(argv)operator([)integer(1)operator(];) - ident(argc)operator(--,)ident(argv)operator(++;) - operator(}) - reserved(if) operator((!)ident(s)operator(\)) operator({) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(,) ident(origargv)operator([)integer(0)operator(]\);) - ident(exit)operator(()integer(2)operator(\);) - operator(}) - reserved(if) operator((!)ident(e_script)operator(\)) operator({) - ident(e_script) operator(=) ident(rb_str_new)operator(()integer(0)operator(,)integer(0)operator(\);) - reserved(if) operator(()ident(script) operator(==) integer(0)operator(\)) ident(script) operator(=) stringoperator(;) - operator(}) - ident(rb_str_cat2)operator(()ident(e_script)operator(,) ident(s)operator(\);) - ident(rb_str_cat2)operator(()ident(e_script)operator(,) stringoperator(\);) - reserved(break)operator(;) - - reserved(case) char('r')operator(:) - ident(forbid_setid)operator(()stringoperator(\);) - reserved(if) operator((*++)ident(s)operator(\)) operator({) - ident(add_modules)operator(()ident(s)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(argv)operator([)integer(1)operator(]\)) operator({) - ident(add_modules)operator(()ident(argv)operator([)integer(1)operator(]\);) - ident(argc)operator(--,)ident(argv)operator(++;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('i')operator(:) - ident(forbid_setid)operator(()stringoperator(\);) - reserved(if) operator(()ident(ruby_inplace_mode)operator(\)) ident(free)operator(()ident(ruby_inplace_mode)operator(\);) - ident(ruby_inplace_mode) operator(=) ident(strdup)operator(()ident(s)operator(+)integer(1)operator(\);) - reserved(break)operator(;) - - reserved(case) char('x')operator(:) - ident(xflag) operator(=) ident(Qtrue)operator(;) - ident(s)operator(++;) - reserved(if) operator((*)ident(s) operator(&&) ident(chdir)operator(()ident(s)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_fatal)operator(()stringoperator(,) ident(s)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('C')operator(:) - reserved(case) char('X')operator(:) - ident(s)operator(++;) - reserved(if) operator((!*)ident(s)operator(\)) operator({) - ident(s) operator(=) ident(argv)operator([)integer(1)operator(];) - ident(argc)operator(--,)ident(argv)operator(++;) - operator(}) - reserved(if) operator((!)ident(s) operator(||) operator(!*)ident(s)operator(\)) operator({) - ident(rb_fatal)operator(()stringoperator(\);) - operator(}) - reserved(if) operator(()ident(chdir)operator(()ident(s)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_fatal)operator(()stringoperator(,) ident(s)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('F')operator(:) - reserved(if) operator((*++)ident(s)operator(\)) operator({) - ident(rb_fs) operator(=) ident(rb_reg_new)operator(()ident(s)operator(,) ident(strlen)operator(()ident(s)operator(\),) integer(0)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('K')operator(:) - reserved(if) operator((*++)ident(s)operator(\)) operator({) - ident(rb_set_kcode)operator(()ident(s)operator(\);) - ident(s)operator(++;) - operator(}) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('T')operator(:) - operator({) - pre_type(int) ident(numlen)operator(;) - pre_type(int) ident(v) operator(=) integer(1)operator(;) - - reserved(if) operator((*++)ident(s)operator(\)) operator({) - ident(v) operator(=) ident(scan_oct)operator(()ident(s)operator(,) integer(2)operator(,) operator(&)ident(numlen)operator(\);) - reserved(if) operator(()ident(numlen) operator(==) integer(0)operator(\)) ident(v) operator(=) integer(1)operator(;) - ident(s) operator(+=) ident(numlen)operator(;) - operator(}) - ident(rb_set_safe_level)operator(()ident(v)operator(\);) - operator(}) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('I')operator(:) - ident(forbid_setid)operator(()stringoperator(\);) - reserved(if) operator((*++)ident(s)operator(\)) - ident(ruby_incpush)operator(()ident(s)operator(\);) - reserved(else) reserved(if) operator(()ident(argv)operator([)integer(1)operator(]\)) operator({) - ident(ruby_incpush)operator(()ident(argv)operator([)integer(1)operator(]\);) - ident(argc)operator(--,)ident(argv)operator(++;) - operator(}) - reserved(break)operator(;) - - reserved(case) char('0')operator(:) - operator({) - pre_type(int) ident(numlen)operator(;) - pre_type(int) ident(v)operator(;) - pre_type(char) ident(c)operator(;) - - ident(v) operator(=) ident(scan_oct)operator(()ident(s)operator(,) integer(4)operator(,) operator(&)ident(numlen)operator(\);) - ident(s) operator(+=) ident(numlen)operator(;) - reserved(if) operator(()ident(v) operator(>) oct(0377)operator(\)) ident(rb_rs) operator(=) ident(Qnil)operator(;) - reserved(else) reserved(if) operator(()ident(v) operator(==) integer(0) operator(&&) ident(numlen) operator(>=) integer(2)operator(\)) operator({) - ident(rb_rs) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - operator(}) - reserved(else) operator({) - ident(c) operator(=) ident(v) operator(&) hex(0xff)operator(;) - ident(rb_rs) operator(=) ident(rb_str_new)operator((&)ident(c)operator(,) integer(1)operator(\);) - operator(}) - operator(}) - reserved(goto) ident(reswitch)operator(;) - - reserved(case) char('-')operator(:) - reserved(if) operator((!)ident(s)operator([)integer(1)operator(]) operator(||) operator(()ident(s)operator([)integer(1)operator(]) operator(==) char('\\r') operator(&&) operator(!)ident(s)operator([)integer(2)operator(]\)\)) operator({) - ident(argc)operator(--,)ident(argv)operator(++;) - reserved(goto) ident(switch_end)operator(;) - operator(}) - ident(s)operator(++;) - reserved(if) operator(()ident(strcmp)operator(()stringoperator(,) ident(s)operator(\)) operator(==) integer(0)operator(\)) - ident(copyright) operator(=) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(strcmp)operator(()stringoperator(,) ident(s)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(ruby_debug) operator(=) ident(Qtrue)operator(;) - ident(ruby_verbose) operator(=) ident(Qtrue)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(strcmp)operator(()stringoperator(,) ident(s)operator(\)) operator(==) integer(0)operator(\)) - ident(version) operator(=) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(strcmp)operator(()stringoperator(,) ident(s)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(verbose) operator(=) integer(1)operator(;) - ident(ruby_verbose) operator(=) ident(Qtrue)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(strcmp)operator(()stringoperator(,) ident(s)operator(\)) operator(==) integer(0)operator(\)) - ident(ruby_yydebug) operator(=) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(strcmp)operator(()stringoperator(,) ident(s)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(usage)operator(()ident(origargv)operator([)integer(0)operator(]\);) - ident(exit)operator(()integer(0)operator(\);) - operator(}) - reserved(else) operator({) - ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(,) - ident(origargv)operator([)integer(0)operator(],) ident(s)operator(\);) - ident(exit)operator(()integer(2)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('\\r')operator(:) - reserved(if) operator((!)ident(s)operator([)integer(1)operator(]\)) reserved(break)operator(;) - - reserved(default)operator(:) - operator({) - directive(const) pre_type(char) operator(*)ident(format)operator(;) - reserved(if) operator(()ident(ISPRINT)operator((*)ident(s)operator(\)\)) operator({) - ident(format) operator(=) stringoperator(;) - operator(}) - reserved(else) operator({) - ident(format) operator(=) stringoperator(;) - operator(}) - ident(fprintf)operator(()ident(stderr)operator(,) ident(format)operator(,) ident(origargv)operator([)integer(0)operator(],) operator(()pre_type(int)operator(\)()pre_type(unsigned) pre_type(char)operator(\)*)ident(s)operator(\);) - operator(}) - ident(exit)operator(()integer(2)operator(\);) - - reserved(case) integer(0)operator(:) - reserved(break)operator(;) - operator(}) - operator(}) - - label(switch_end:) - reserved(if) operator(()ident(argv0) operator(==) integer(0)operator(\)) reserved(return)operator(;) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(==) integer(0) operator(&&) operator(()ident(s) operator(=) ident(getenv)operator(()stringoperator(\)\)\)) operator({) - reserved(while) operator(()ident(ISSPACE)operator((*)ident(s)operator(\)\)) ident(s)operator(++;) - reserved(if) operator((*)ident(s) operator(==) char('T') operator(||) operator((*)ident(s) operator(==) char('-') operator(&&) operator(*()ident(s)operator(+)integer(1)operator(\)) operator(==) char('T')operator(\)\)) operator({) - pre_type(int) ident(numlen)operator(;) - pre_type(int) ident(v) operator(=) integer(1)operator(;) - - reserved(if) operator((*)ident(s) operator(!=) char('T')operator(\)) operator(++)ident(s)operator(;) - reserved(if) operator((*++)ident(s)operator(\)) operator({) - ident(v) operator(=) ident(scan_oct)operator(()ident(s)operator(,) integer(2)operator(,) operator(&)ident(numlen)operator(\);) - reserved(if) operator(()ident(numlen) operator(==) integer(0)operator(\)) ident(v) operator(=) integer(1)operator(;) - operator(}) - ident(rb_set_safe_level)operator(()ident(v)operator(\);) - operator(}) - reserved(else) operator({) - reserved(while) operator(()ident(s) operator(&&) operator(*)ident(s)operator(\)) operator({) - reserved(if) operator((*)ident(s) operator(==) char('-')operator(\)) operator({) - ident(s)operator(++;) - reserved(if) operator(()ident(ISSPACE)operator((*)ident(s)operator(\)\)) operator({) - reserved(do) operator({)ident(s)operator(++;}) reserved(while) operator(()ident(ISSPACE)operator((*)ident(s)operator(\)\);) - reserved(continue)operator(;) - operator(}) - operator(}) - reserved(if) operator((!*)ident(s)operator(\)) reserved(break)operator(;) - reserved(if) operator((!)ident(strchr)operator(()stringoperator(,) operator(*)ident(s)operator(\)\)) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(,) operator(*)ident(s)operator(\);) - ident(s) operator(=) ident(moreswitches)operator(()ident(s)operator(\);) - operator(}) - operator(}) - operator(}) - - reserved(if) operator(()ident(version)operator(\)) operator({) - ident(ruby_show_version)operator((\);) - ident(exit)operator(()integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(copyright)operator(\)) operator({) - ident(ruby_show_copyright)operator((\);) - operator(}) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) operator({) - ident(OBJ_TAINT)operator(()ident(rb_argv)operator(\);) - ident(OBJ_TAINT)operator(()ident(rb_load_path)operator(\);) - operator(}) - - reserved(if) operator((!)ident(e_script)operator(\)) operator({) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) comment(/* no more args */) - reserved(if) operator(()ident(verbose)operator(\)) ident(exit)operator(()integer(0)operator(\);) - ident(script) operator(=) stringoperator(;) - operator(}) - reserved(else) operator({) - ident(script) operator(=) ident(argv)operator([)integer(0)operator(];) - reserved(if) operator(()ident(script)operator([)integer(0)operator(]) operator(==) char('\\0')operator(\)) operator({) - ident(script) operator(=) stringoperator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(do_search)operator(\)) operator({) - pre_type(char) operator(*)ident(path) operator(=) ident(getenv)operator(()stringoperator(\);) - - ident(script) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(path)operator(\)) operator({) - ident(script) operator(=) ident(dln_find_file)operator(()ident(argv)operator([)integer(0)operator(],) ident(path)operator(\);) - operator(}) - reserved(if) operator((!)ident(script)operator(\)) operator({) - ident(script) operator(=) ident(dln_find_file)operator(()ident(argv)operator([)integer(0)operator(],) ident(getenv)operator(()ident(PATH_ENV)operator(\)\);) - operator(}) - reserved(if) operator((!)ident(script)operator(\)) ident(script) operator(=) ident(argv)operator([)integer(0)operator(];) - ident(script) operator(=) ident(ruby_sourcefile) operator(=) ident(rb_source_filename)operator(()ident(script)operator(\);) - ident(script_node) operator(=) ident(NEW_NEWLINE)operator(()integer(0)operator(\);) - operator(}) -preprocessor(#if) ident(defined) ident(DOSISH) operator(||) ident(defined) ident(__CYGWIN__) - ident(translate_char)operator(()ident(script)operator(,) char('\\\\')operator(,) char('/')operator(\);) -preprocessor(#endif) - ident(argc)operator(--;) ident(argv)operator(++;) - operator(}) - operator(}) - - ident(ruby_script)operator(()ident(script)operator(\);) - ident(ruby_set_argv)operator(()ident(argc)operator(,) ident(argv)operator(\);) - ident(process_sflag)operator((\);) - - ident(ruby_init_loadpath)operator((\);) - ident(ruby_sourcefile) operator(=) ident(rb_source_filename)operator(()ident(argv0)operator(\);) - reserved(if) operator(()ident(e_script)operator(\)) operator({) - ident(require_libraries)operator((\);) - ident(rb_compile_string)operator(()ident(script)operator(,) ident(e_script)operator(,) integer(1)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(strlen)operator(()ident(script)operator(\)) operator(==) integer(1) operator(&&) ident(script)operator([)integer(0)operator(]) operator(==) char('-')operator(\)) operator({) - ident(load_stdin)operator((\);) - operator(}) - reserved(else) operator({) - ident(load_file)operator(()ident(script)operator(,) integer(1)operator(\);) - operator(}) - - ident(process_sflag)operator((\);) - ident(xflag) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) operator({) - ident(FL_UNSET)operator(()ident(rb_argv)operator(,) ident(FL_TAINT)operator(\);) - ident(FL_UNSET)operator(()ident(rb_load_path)operator(,) ident(FL_TAINT)operator(\);) - operator(}) -operator(}) - -directive(extern) pre_type(int) ident(ruby__end__seen)operator(;) - -directive(static) directive(void) -ident(load_file)operator(()ident(fname)operator(,) ident(script)operator(\)) - directive(const) pre_type(char) operator(*)ident(fname)operator(;) - pre_type(int) ident(script)operator(;) -operator({) - directive(extern) ident(VALUE) ident(rb_stdin)operator(;) - ident(VALUE) ident(f)operator(;) - pre_type(int) ident(line_start) operator(=) integer(1)operator(;) - - reserved(if) operator((!)ident(fname)operator(\)) ident(rb_load_fail)operator(()ident(fname)operator(\);) - reserved(if) operator(()ident(strcmp)operator(()ident(fname)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) operator({) - ident(f) operator(=) ident(rb_stdin)operator(;) - operator(}) - reserved(else) operator({) - ident(FILE) operator(*)ident(fp) operator(=) ident(fopen)operator(()ident(fname)operator(,) stringoperator(\);) - - reserved(if) operator(()ident(fp) operator(==) pre_constant(NULL)operator(\)) operator({) - ident(rb_load_fail)operator(()ident(fname)operator(\);) - operator(}) - ident(fclose)operator(()ident(fp)operator(\);) - - ident(f) operator(=) ident(rb_file_open)operator(()ident(fname)operator(,) stringoperator(\);) -preprocessor(#if) ident(defined) ident(DOSISH) operator(||) ident(defined) ident(__CYGWIN__) - operator({) - pre_type(char) operator(*)ident(ext) operator(=) ident(strrchr)operator(()ident(fname)operator(,) char('.')operator(\);) - reserved(if) operator(()ident(ext) operator(&&) ident(strcasecmp)operator(()ident(ext)operator(,) stringoperator(\)) operator(==) integer(0)operator(\)) - ident(rb_io_binmode)operator(()ident(f)operator(\);) - operator(}) -preprocessor(#endif) - operator(}) - - reserved(if) operator(()ident(script)operator(\)) operator({) - ident(VALUE) ident(c) operator(=) integer(1)operator(;) comment(/* something not nil */) - ident(VALUE) ident(line)operator(;) - pre_type(char) operator(*)ident(p)operator(;) - - reserved(if) operator(()ident(xflag)operator(\)) operator({) - ident(forbid_setid)operator(()stringoperator(\);) - ident(xflag) operator(=) ident(Qfalse)operator(;) - reserved(while) operator((!)ident(NIL_P)operator(()ident(line) operator(=) ident(rb_io_gets)operator(()ident(f)operator(\)\)\)) operator({) - ident(line_start)operator(++;) - reserved(if) operator(()ident(RSTRING)operator(()ident(line)operator(\)->)ident(len) operator(>) integer(2) - operator(&&) ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(==) char('#') - operator(&&) ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr)operator([)integer(1)operator(]) operator(==) char('!')operator(\)) operator({) - reserved(if) operator((()ident(p) operator(=) ident(strstr)operator(()ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr)operator(,) stringoperator(\)\)) operator(!=) integer(0)operator(\)) operator({) - reserved(goto) ident(start_read)operator(;) - operator(}) - operator(}) - operator(}) - ident(rb_raise)operator(()ident(rb_eLoadError)operator(,) stringoperator(\);) - operator(}) - - ident(c) operator(=) ident(rb_io_getc)operator(()ident(f)operator(\);) - reserved(if) operator(()ident(c) operator(==) ident(INT2FIX)operator(()char('#')operator(\)\)) operator({) - ident(line) operator(=) ident(rb_io_gets)operator(()ident(f)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(line)operator(\)\)) reserved(return)operator(;) - ident(line_start)operator(++;) - - reserved(if) operator(()ident(RSTRING)operator(()ident(line)operator(\)->)ident(len) operator(>) integer(2) operator(&&) ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(==) char('!')operator(\)) operator({) - reserved(if) operator((()ident(p) operator(=) ident(strstr)operator(()ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr)operator(,) stringoperator(\)\)) operator(==) integer(0)operator(\)) operator({) - comment(/* not ruby script, kick the program */) - pre_type(char) operator(**)ident(argv)operator(;) - pre_type(char) operator(*)ident(path)operator(;) - pre_type(char) operator(*)ident(pend) operator(=) ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr) operator(+) ident(RSTRING)operator(()ident(line)operator(\)->)ident(len)operator(;) - - ident(p) operator(=) ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr) operator(+) integer(1)operator(;) comment(/* skip `#!' */) - reserved(if) operator(()ident(pend)operator([-)integer(1)operator(]) operator(==) char('\\n')operator(\)) ident(pend)operator(--;) comment(/* chomp line */) - reserved(if) operator(()ident(pend)operator([-)integer(1)operator(]) operator(==) char('\\r')operator(\)) ident(pend)operator(--;) - operator(*)ident(pend) operator(=) char('\\0')operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend) operator(&&) ident(ISSPACE)operator((*)ident(p)operator(\)\)) - ident(p)operator(++;) - ident(path) operator(=) ident(p)operator(;) comment(/* interpreter path */) - reserved(while) operator(()ident(p) operator(<) ident(pend) operator(&&) operator(!)ident(ISSPACE)operator((*)ident(p)operator(\)\)) - ident(p)operator(++;) - operator(*)ident(p)operator(++) operator(=) char('\\0')operator(;) - reserved(if) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - ident(argv) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(*,) ident(origargc)operator(+)integer(3)operator(\);) - ident(argv)operator([)integer(1)operator(]) operator(=) ident(p)operator(;) - ident(MEMCPY)operator(()ident(argv)operator(+)integer(2)operator(,) ident(origargv)operator(+)integer(1)operator(,) pre_type(char)operator(*,) ident(origargc)operator(\);) - operator(}) - reserved(else) operator({) - ident(argv) operator(=) ident(origargv)operator(;) - operator(}) - ident(argv)operator([)integer(0)operator(]) operator(=) ident(path)operator(;) - ident(execv)operator(()ident(path)operator(,) ident(argv)operator(\);) - - ident(ruby_sourcefile) operator(=) ident(rb_source_filename)operator(()ident(fname)operator(\);) - ident(ruby_sourceline) operator(=) integer(1)operator(;) - ident(rb_fatal)operator(()stringoperator(,) ident(path)operator(\);) - operator(}) - - label(start_read:) - ident(p) operator(+=) integer(4)operator(;) - ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(line)operator(\)->)ident(len)operator(-)integer(1)operator(]) operator(=) char('\\0')operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(line)operator(\)->)ident(len)operator(-)integer(2)operator(]) operator(==) char('\\r')operator(\)) - ident(RSTRING)operator(()ident(line)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(line)operator(\)->)ident(len)operator(-)integer(2)operator(]) operator(=) char('\\0')operator(;) - reserved(if) operator((()ident(p) operator(=) ident(strstr)operator(()ident(p)operator(,) stringoperator(\)\)) operator(!=) integer(0)operator(\)) operator({) - ident(p)operator(++;) comment(/* skip space before `-' */) - reserved(while) operator((*)ident(p) operator(==) char('-')operator(\)) operator({) - ident(p) operator(=) ident(moreswitches)operator(()ident(p)operator(+)integer(1)operator(\);) - operator(}) - operator(}) - operator(}) - operator(}) - reserved(else) reserved(if) operator((!)ident(NIL_P)operator(()ident(c)operator(\)\)) operator({) - ident(rb_io_ungetc)operator(()ident(f)operator(,) ident(c)operator(\);) - operator(}) - ident(require_libraries)operator((\);) comment(/* Why here? unnatural */) - reserved(if) operator(()ident(NIL_P)operator(()ident(c)operator(\)\)) reserved(return)operator(;) - operator(}) - ident(rb_compile_file)operator(()ident(fname)operator(,) ident(f)operator(,) ident(line_start)operator(\);) - reserved(if) operator(()ident(script) operator(&&) ident(ruby__end__seen)operator(\)) operator({) - ident(rb_define_global_const)operator(()stringoperator(,) ident(f)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(f) operator(!=) ident(rb_stdin)operator(\)) operator({) - ident(rb_io_close)operator(()ident(f)operator(\);) - operator(}) - - reserved(if) operator(()ident(ruby_parser_stack_on_heap)operator((\)\)) operator({) - ident(rb_gc)operator((\);) - operator(}) -operator(}) - -directive(void) -ident(rb_load_file)operator(()ident(fname)operator(\)) - directive(const) pre_type(char) operator(*)ident(fname)operator(;) -operator({) - ident(load_file)operator(()ident(fname)operator(,) integer(0)operator(\);) -operator(}) - -directive(static) directive(void) -ident(load_stdin)operator((\)) -operator({) - ident(forbid_setid)operator(()stringoperator(\);) - ident(load_file)operator(()stringoperator(,) integer(1)operator(\);) -operator(}) - -ident(VALUE) ident(rb_progname)operator(;) -ident(VALUE) ident(rb_argv)operator(;) -ident(VALUE) ident(rb_argv0)operator(;) - -preprocessor(#if) ident(defined)operator(()ident(PSTAT_SETCMD)operator(\)) operator(||) ident(defined)operator(()ident(HAVE_SETPROCTITLE)operator(\)) -preprocessor(#elif) ident(defined)operator(()ident(_WIN32)operator(\)) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETENV)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_UNSETENV)operator(\)) -preprocessor(#else) -preprocessor(#define) ident(USE_ENVSPACE_FOR_ARG0) -preprocessor(#endif) - -preprocessor(#ifdef) ident(USE_ENVSPACE_FOR_ARG0) -directive(static) reserved(struct) operator({) - pre_type(char) operator(*)ident(begin)operator(,) operator(*)ident(end)operator(;) -operator(}) ident(envspace)operator(;) -directive(extern) pre_type(char) operator(**)ident(environ)operator(;) - -directive(static) directive(void) -ident(set_arg0space)operator((\)) -operator({) - pre_type(char) operator(*)ident(s)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(if) operator((!)ident(environ) operator(||) operator(()ident(s) operator(=) ident(environ)operator([)integer(0)operator(]\)) operator(==) pre_constant(NULL)operator(\)) reserved(return)operator(;) - ident(envspace)operator(.)ident(begin) operator(=) ident(s)operator(;) - ident(s) operator(+=) ident(strlen)operator(()ident(s)operator(\);) - reserved(for) operator(()ident(i) operator(=) integer(1)operator(;) ident(environ)operator([)ident(i)operator(];) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(environ)operator([)ident(i)operator(]) operator(==) ident(s) operator(+) integer(1)operator(\)) operator({) - ident(s)operator(++;) - ident(s) operator(+=) ident(strlen)operator(()ident(s)operator(\);) comment(/* this one is ok too */) - operator(}) - operator(}) - ident(envspace)operator(.)ident(end) operator(=) ident(s)operator(;) -operator(}) -preprocessor(#else) -preprocessor(#define) ident(set_arg0space)operator((\)) operator((()directive(void)operator(\))integer(0)operator(\)) -preprocessor(#endif) - -directive(static) pre_type(int) -ident(get_arglen)operator(()pre_type(int) ident(argc)operator(,) pre_type(char) operator(**)ident(argv)operator(\)) -operator({) - pre_type(char) operator(*)ident(s) operator(=) ident(argv)operator([)integer(0)operator(];) - pre_type(int) ident(i)operator(;) - - reserved(if) operator((!)ident(argc)operator(\)) reserved(return) integer(0)operator(;) - ident(s) operator(+=) ident(strlen)operator(()ident(s)operator(\);) - comment(/* See if all the arguments are contiguous in memory */) - reserved(for) operator(()ident(i) operator(=) integer(1)operator(;) ident(i) operator(<) ident(argc)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(argv)operator([)ident(i)operator(]) operator(==) ident(s) operator(+) integer(1)operator(\)) operator({) - ident(s)operator(++;) - ident(s) operator(+=) ident(strlen)operator(()ident(s)operator(\);) comment(/* this one is ok too */) - operator(}) - reserved(else) operator({) - reserved(break)operator(;) - operator(}) - operator(}) -preprocessor(#if) ident(defined)operator(()ident(USE_ENVSPACE_FOR_ARG0)operator(\)) - reserved(if) operator(()ident(environ) operator(&&) operator(()ident(s) operator(==) ident(environ)operator([)integer(0)operator(]\)\)) operator({) - ident(s) operator(+=) ident(strlen)operator(()ident(s)operator(\);) - reserved(for) operator(()ident(i) operator(=) integer(1)operator(;) ident(environ)operator([)ident(i)operator(];) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(environ)operator([)ident(i)operator(]) operator(==) ident(s) operator(+) integer(1)operator(\)) operator({) - ident(s)operator(++;) - ident(s) operator(+=) ident(strlen)operator(()ident(s)operator(\);) comment(/* this one is ok too */) - operator(}) - operator(}) - ident(ruby_setenv)operator(()stringoperator(,) pre_constant(NULL)operator(\);) comment(/* duplicate environ vars */) - operator(}) -preprocessor(#endif) - reserved(return) ident(s) operator(-) ident(argv)operator([)integer(0)operator(];) -operator(}) - -directive(static) directive(void) -ident(set_arg0)operator(()ident(val)operator(,) ident(id)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(progname)operator(;) - pre_type(char) operator(*)ident(s)operator(;) - pre_type(long) ident(i)operator(;) - pre_type(int) ident(j)operator(;) -preprocessor(#if) operator(!)ident(defined)operator(()ident(PSTAT_SETCMD)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(HAVE_SETPROCTITLE)operator(\)) - directive(static) pre_type(int) ident(len) operator(=) integer(0)operator(;) -preprocessor(#endif) - - reserved(if) operator(()ident(origargv) operator(==) integer(0)operator(\)) ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - ident(StringValue)operator(()ident(val)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(val)operator(\)->)ident(ptr)operator(;) - ident(i) operator(=) ident(RSTRING)operator(()ident(val)operator(\)->)ident(len)operator(;) -preprocessor(#if) ident(defined)operator(()ident(PSTAT_SETCMD)operator(\)) - reserved(if) operator(()ident(i) operator(>=) ident(PST_CLEN)operator(\)) operator({) - reserved(union) ident(pstun) ident(j)operator(;) - ident(j)operator(.)ident(pst_command) operator(=) ident(s)operator(;) - ident(i) operator(=) ident(PST_CLEN)operator(;) - ident(RSTRING)operator(()ident(val)operator(\)->)ident(len) operator(=) ident(i)operator(;) - operator(*()ident(s) operator(+) ident(i)operator(\)) operator(=) char('\\0')operator(;) - ident(pstat)operator(()ident(PSTAT_SETCMD)operator(,) ident(j)operator(,) ident(PST_CLEN)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - reserved(else) operator({) - reserved(union) ident(pstun) ident(j)operator(;) - ident(j)operator(.)ident(pst_command) operator(=) ident(s)operator(;) - ident(pstat)operator(()ident(PSTAT_SETCMD)operator(,) ident(j)operator(,) ident(i)operator(,) integer(0)operator(,) integer(0)operator(\);) - operator(}) - ident(progname) operator(=) ident(rb_tainted_str_new)operator(()ident(s)operator(,) ident(i)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_SETPROCTITLE)operator(\)) - ident(setproctitle)operator(()stringoperator(,) operator(()pre_type(int)operator(\))ident(i)operator(,) ident(s)operator(\);) - ident(progname) operator(=) ident(rb_tainted_str_new)operator(()ident(s)operator(,) ident(i)operator(\);) -preprocessor(#else) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) operator({) - ident(len) operator(=) ident(get_arglen)operator(()ident(origargc)operator(,) ident(origargv)operator(\);) - operator(}) - - reserved(if) operator(()ident(i) operator(>=) ident(len)operator(\)) operator({) - ident(i) operator(=) ident(len)operator(;) - operator(}) - ident(memcpy)operator(()ident(origargv)operator([)integer(0)operator(],) ident(s)operator(,) ident(i)operator(\);) - ident(s) operator(=) ident(origargv)operator([)integer(0)operator(]) operator(+) ident(i)operator(;) - operator(*)ident(s) operator(=) char('\\0')operator(;) - reserved(if) operator((++)ident(i) operator(<) ident(len)operator(\)) ident(memset)operator(()ident(s) operator(+) integer(1)operator(,) char(' ')operator(,) ident(len) operator(-) ident(i)operator(\);) - reserved(for) operator(()ident(i) operator(=) ident(len)operator(-)integer(1)operator(,) ident(j) operator(=) ident(origargc)operator(-)integer(1)operator(;) ident(j) operator(>) integer(0) operator(&&) ident(i) operator(>=) integer(0)operator(;) operator(--)ident(i)operator(,) operator(--)ident(j)operator(\)) operator({) - ident(origargv)operator([)ident(j)operator(]) operator(=) ident(origargv)operator([)integer(0)operator(]) operator(+) ident(i)operator(;) - operator(*)ident(origargv)operator([)ident(j)operator(]) operator(=) char('\\0')operator(;) - operator(}) - ident(progname) operator(=) ident(rb_tainted_str_new2)operator(()ident(origargv)operator([)integer(0)operator(]\);) -preprocessor(#endif) - ident(rb_progname) operator(=) ident(rb_obj_freeze)operator(()ident(progname)operator(\);) -operator(}) - -directive(void) -ident(ruby_script)operator(()ident(name)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - reserved(if) operator(()ident(name)operator(\)) operator({) - ident(rb_progname) operator(=) ident(rb_obj_freeze)operator(()ident(rb_tainted_str_new2)operator(()ident(name)operator(\)\);) - ident(ruby_sourcefile) operator(=) ident(rb_source_filename)operator(()ident(name)operator(\);) - operator(}) -operator(}) - -directive(static) pre_type(int) ident(uid)operator(,) ident(euid)operator(,) ident(gid)operator(,) ident(egid)operator(;) - -directive(static) directive(void) -ident(init_ids)operator((\)) -operator({) - ident(uid) operator(=) operator(()pre_type(int)operator(\))ident(getuid)operator((\);) - ident(euid) operator(=) operator(()pre_type(int)operator(\))ident(geteuid)operator((\);) - ident(gid) operator(=) operator(()pre_type(int)operator(\))ident(getgid)operator((\);) - ident(egid) operator(=) operator(()pre_type(int)operator(\))ident(getegid)operator((\);) -preprocessor(#ifdef) ident(VMS) - ident(uid) operator(|=) ident(gid) operator(<<) integer(16)operator(;) - ident(euid) operator(|=) ident(egid) operator(<<) integer(16)operator(;) -preprocessor(#endif) - reserved(if) operator(()ident(uid) operator(&&) operator(()ident(euid) operator(!=) ident(uid) operator(||) ident(egid) operator(!=) ident(gid)operator(\)\)) operator({) - ident(rb_set_safe_level)operator(()integer(1)operator(\);) - operator(}) -operator(}) - -directive(static) directive(void) -ident(forbid_setid)operator(()ident(s)operator(\)) - directive(const) pre_type(char) operator(*)ident(s)operator(;) -operator({) - reserved(if) operator(()ident(euid) operator(!=) ident(uid)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(s)operator(\);) - reserved(if) operator(()ident(egid) operator(!=) ident(gid)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(s)operator(\);) - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>) integer(0)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(s)operator(\);) -operator(}) - -directive(static) directive(void) -ident(verbose_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(variable)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) operator(*)ident(variable)operator(;) -operator({) - ident(ruby_verbose) operator(=) ident(RTEST)operator(()ident(val)operator(\)) operator(?) ident(Qtrue) operator(:) ident(val)operator(;) -operator(}) - -directive(void) -ident(ruby_prog_init)operator((\)) -operator({) - ident(init_ids)operator((\);) - - ident(ruby_sourcefile) operator(=) ident(rb_source_filename)operator(()stringoperator(\);) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(ruby_verbose)operator(,) integer(0)operator(,) ident(verbose_setter)operator(\);) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(ruby_verbose)operator(,) integer(0)operator(,) ident(verbose_setter)operator(\);) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(ruby_verbose)operator(,) integer(0)operator(,) ident(verbose_setter)operator(\);) - ident(rb_define_variable)operator(()stringoperator(,) operator(&)ident(ruby_debug)operator(\);) - ident(rb_define_variable)operator(()stringoperator(,) operator(&)ident(ruby_debug)operator(\);) - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(do_print)operator(\);) - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(do_line)operator(\);) - - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(rb_progname)operator(,) integer(0)operator(,) ident(set_arg0)operator(\);) - ident(rb_define_hooked_variable)operator(()stringoperator(,) operator(&)ident(rb_progname)operator(,) integer(0)operator(,) ident(set_arg0)operator(\);) - - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(rb_argv)operator(\);) - ident(rb_argv) operator(=) ident(rb_ary_new)operator((\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(rb_argv)operator(\);) - ident(rb_define_readonly_variable)operator(()stringoperator(,) operator(&)ident(do_split)operator(\);) - ident(rb_global_variable)operator((&)ident(rb_argv0)operator(\);) - -preprocessor(#ifdef) ident(MSDOS) - comment(/* - * There is no way we can refer to them from ruby, so close them to save - * space. - */) - operator(()directive(void)operator(\))ident(fclose)operator(()ident(stdaux)operator(\);) - operator(()directive(void)operator(\))ident(fclose)operator(()ident(stdprn)operator(\);) -preprocessor(#endif) -operator(}) - -directive(void) -ident(ruby_set_argv)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - pre_type(char) operator(**)ident(argv)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - -preprocessor(#if) ident(defined)operator(()ident(USE_DLN_A_OUT)operator(\)) - reserved(if) operator(()ident(origargv)operator(\)) ident(dln_argv0) operator(=) ident(origargv)operator([)integer(0)operator(];) - reserved(else) ident(dln_argv0) operator(=) ident(argv)operator([)integer(0)operator(];) -preprocessor(#endif) - ident(rb_ary_clear)operator(()ident(rb_argv)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(arg) operator(=) ident(rb_tainted_str_new2)operator(()ident(argv)operator([)ident(i)operator(]\);) - - ident(OBJ_FREEZE)operator(()ident(arg)operator(\);) - ident(rb_ary_push)operator(()ident(rb_argv)operator(,) ident(arg)operator(\);) - operator(}) -operator(}) - -directive(void) -ident(ruby_process_options)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - pre_type(char) operator(**)ident(argv)operator(;) -operator({) - ident(origargc) operator(=) ident(argc)operator(;) ident(origargv) operator(=) ident(argv)operator(;) - - ident(ruby_script)operator(()ident(argv)operator([)integer(0)operator(]\);) comment(/* for the time being */) - ident(rb_argv0) operator(=) ident(rb_progname)operator(;) -preprocessor(#if) ident(defined)operator(()ident(USE_DLN_A_OUT)operator(\)) - ident(dln_argv0) operator(=) ident(argv)operator([)integer(0)operator(];) -preprocessor(#endif) - ident(set_arg0space)operator((\);) - ident(proc_options)operator(()ident(argc)operator(,) ident(argv)operator(\);) - - reserved(if) operator(()ident(do_check) operator(&&) ident(ruby_nerrs) operator(==) integer(0)operator(\)) operator({) - ident(printf)operator(()stringoperator(\);) - ident(exit)operator(()integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(do_print)operator(\)) operator({) - ident(rb_parser_append_print)operator((\);) - operator(}) - reserved(if) operator(()ident(do_loop)operator(\)) operator({) - ident(rb_parser_while_loop)operator(()ident(do_line)operator(,) ident(do_split)operator(\);) - operator(}) -operator(}) -comment(/********************************************************************** - - signal.c - - - $Author: shyouhei $ - $Date: 2008-06-29 09:52:47 +0200 (Sun, 29 Jun 2008\) $ - created at: Tue Dec 20 10:13:44 JST 1994 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("rubysig.h") -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#ifdef) ident(__BEOS__) -preprocessor(#undef) ident(SIGBUS) -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(HAVE_SIGPROCMASK) operator(||) ident(defined) ident(HAVE_SIGSETMASK) -preprocessor(#define) ident(USE_TRAP_MASK) integer(1) -preprocessor(#else) -preprocessor(#define) ident(USE_TRAP_MASK) integer(0) -preprocessor(#endif) - -preprocessor(#ifndef) ident(NSIG) -preprocessor(# ifdef) ident(DJGPP) -preprocessor(# define) ident(NSIG) ident(SIGMAX) -preprocessor(# else) -preprocessor(# define) ident(NSIG) operator(()ident(_SIGMAX) operator(+) integer(1)operator(\)) comment(/* For QNX */) -preprocessor(# endif) -preprocessor(#endif) - -directive(static) reserved(struct) ident(signals) operator({) - pre_type(char) operator(*)ident(signm)operator(;) - pre_type(int) ident(signo)operator(;) -operator(}) ident(siglist) operator([]) operator(=) operator({) - operator({)stringoperator(,) integer(0)operator(},) -preprocessor(#ifdef) ident(SIGHUP) - operator({)stringoperator(,) ident(SIGHUP)operator(},) -preprocessor(#endif) - operator({)stringoperator(,) ident(SIGINT)operator(},) -preprocessor(#ifdef) ident(SIGQUIT) - operator({)stringoperator(,) ident(SIGQUIT)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGILL) - operator({)stringoperator(,) ident(SIGILL)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGTRAP) - operator({)stringoperator(,) ident(SIGTRAP)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGIOT) - operator({)stringoperator(,) ident(SIGIOT)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGABRT) - operator({)stringoperator(,) ident(SIGABRT)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGEMT) - operator({)stringoperator(,) ident(SIGEMT)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGFPE) - operator({)stringoperator(,) ident(SIGFPE)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGKILL) - operator({)stringoperator(,) ident(SIGKILL)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGBUS) - operator({)stringoperator(,) ident(SIGBUS)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGSEGV) - operator({)stringoperator(,) ident(SIGSEGV)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGSYS) - operator({)stringoperator(,) ident(SIGSYS)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGPIPE) - operator({)stringoperator(,) ident(SIGPIPE)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGALRM) - operator({)stringoperator(,) ident(SIGALRM)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGTERM) - operator({)stringoperator(,) ident(SIGTERM)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGURG) - operator({)stringoperator(,) ident(SIGURG)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGSTOP) - operator({)stringoperator(,) ident(SIGSTOP)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGTSTP) - operator({)stringoperator(,) ident(SIGTSTP)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGCONT) - operator({)stringoperator(,) ident(SIGCONT)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGCHLD) - operator({)stringoperator(,) ident(SIGCHLD)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGCLD) - operator({)stringoperator(,) ident(SIGCLD)operator(},) -preprocessor(#else) -preprocessor(# ifdef) ident(SIGCHLD) - operator({)stringoperator(,) ident(SIGCHLD)operator(},) -preprocessor(# endif) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGTTIN) - operator({)stringoperator(,) ident(SIGTTIN)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGTTOU) - operator({)stringoperator(,) ident(SIGTTOU)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGIO) - operator({)stringoperator(,) ident(SIGIO)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGXCPU) - operator({)stringoperator(,) ident(SIGXCPU)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGXFSZ) - operator({)stringoperator(,) ident(SIGXFSZ)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGVTALRM) - operator({)stringoperator(,) ident(SIGVTALRM)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGPROF) - operator({)stringoperator(,) ident(SIGPROF)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGWINCH) - operator({)stringoperator(,) ident(SIGWINCH)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGUSR1) - operator({)stringoperator(,) ident(SIGUSR1)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGUSR2) - operator({)stringoperator(,) ident(SIGUSR2)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGLOST) - operator({)stringoperator(,) ident(SIGLOST)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGMSG) - operator({)stringoperator(,) ident(SIGMSG)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGPWR) - operator({)stringoperator(,) ident(SIGPWR)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGPOLL) - operator({)stringoperator(,) ident(SIGPOLL)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGDANGER) - operator({)stringoperator(,) ident(SIGDANGER)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGMIGRATE) - operator({)stringoperator(,) ident(SIGMIGRATE)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGPRE) - operator({)stringoperator(,) ident(SIGPRE)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGGRANT) - operator({)stringoperator(,) ident(SIGGRANT)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGRETRACT) - operator({)stringoperator(,) ident(SIGRETRACT)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGSOUND) - operator({)stringoperator(,) ident(SIGSOUND)operator(},) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGINFO) - operator({)stringoperator(,) ident(SIGINFO)operator(},) -preprocessor(#endif) - operator({)pre_constant(NULL)operator(,) integer(0)operator(}) -operator(};) - -directive(static) pre_type(int) -ident(signm2signo)operator(()ident(nm)operator(\)) - directive(const) pre_type(char) operator(*)ident(nm)operator(;) -operator({) - reserved(struct) ident(signals) operator(*)ident(sigs)operator(;) - - reserved(for) operator(()ident(sigs) operator(=) ident(siglist)operator(;) ident(sigs)operator(->)ident(signm)operator(;) ident(sigs)operator(++\)) - reserved(if) operator(()ident(strcmp)operator(()ident(sigs)operator(->)ident(signm)operator(,) ident(nm)operator(\)) operator(==) integer(0)operator(\)) - reserved(return) ident(sigs)operator(->)ident(signo)operator(;) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) pre_type(char)operator(*) -ident(signo2signm)operator(()ident(no)operator(\)) - pre_type(int) ident(no)operator(;) -operator({) - reserved(struct) ident(signals) operator(*)ident(sigs)operator(;) - - reserved(for) operator(()ident(sigs) operator(=) ident(siglist)operator(;) ident(sigs)operator(->)ident(signm)operator(;) ident(sigs)operator(++\)) - reserved(if) operator(()ident(sigs)operator(->)ident(signo) operator(==) ident(no)operator(\)) - reserved(return) ident(sigs)operator(->)ident(signm)operator(;) - reserved(return) integer(0)operator(;) -operator(}) - -directive(const) pre_type(char) operator(*) -ident(ruby_signal_name)operator(()ident(no)operator(\)) - pre_type(int) ident(no)operator(;) -operator({) - reserved(return) ident(signo2signm)operator(()ident(no)operator(\);) -operator(}) - -comment(/* - * call-seq: - * SignalException.new(sig\) => signal_exception - * - * Construct a new SignalException object. +sig+ should be a known - * signal name, or a signal number. - */) - -directive(static) ident(VALUE) -ident(esignal_init)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(self)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(self)operator(;) -operator({) - pre_type(int) ident(argnum) operator(=) integer(1)operator(;) - ident(VALUE) ident(sig) operator(=) ident(Qnil)operator(;) - pre_type(int) ident(signo)operator(;) - directive(const) pre_type(char) operator(*)ident(signm)operator(;) - pre_type(char) ident(tmpnm)operator([()reserved(sizeof)operator(()pre_type(int)operator(\)*)ident(CHAR_BIT)operator(\))operator(/)integer(3)operator(+)integer(4)operator(];) - - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({) - ident(sig) operator(=) ident(argv)operator([)integer(0)operator(];) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(sig)operator(\)\)) ident(argnum) operator(=) integer(2)operator(;) - operator(}) - reserved(if) operator(()ident(argc) operator(<) integer(1) operator(||) ident(argnum) operator(<) ident(argc)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(argc)operator(,) ident(argnum)operator(\);) - operator(}) - reserved(if) operator(()ident(argnum) operator(==) integer(2)operator(\)) operator({) - ident(signo) operator(=) ident(FIX2INT)operator(()ident(sig)operator(\);) - reserved(if) operator(()ident(signo) operator(<) integer(0) operator(||) ident(signo) operator(>) ident(NSIG)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(signo)operator(\);) - operator(}) - reserved(if) operator(()ident(argc) operator(>) integer(1)operator(\)) operator({) - ident(sig) operator(=) ident(argv)operator([)integer(1)operator(];) - operator(}) - reserved(else) operator({) - ident(signm) operator(=) ident(signo2signm)operator(()ident(signo)operator(\);) - reserved(if) operator(()ident(signm)operator(\)) operator({) - ident(snprintf)operator(()ident(tmpnm)operator(,) reserved(sizeof)operator(()ident(tmpnm)operator(\),) stringoperator(,) ident(signm)operator(\);) - operator(}) - reserved(else) operator({) - ident(snprintf)operator(()ident(tmpnm)operator(,) reserved(sizeof)operator(()ident(tmpnm)operator(\),) stringoperator(,) ident(signo)operator(\);) - operator(}) - ident(sig) operator(=) ident(rb_str_new2)operator(()ident(signm) operator(=) ident(tmpnm)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(signm) operator(=) ident(SYMBOL_P)operator(()ident(sig)operator(\)) operator(?) ident(rb_id2name)operator(()ident(SYM2ID)operator(()ident(sig)operator(\)\)) operator(:) ident(StringValuePtr)operator(()ident(sig)operator(\);) - reserved(if) operator(()ident(strncmp)operator(()ident(signm)operator(,) stringoperator(,) integer(3)operator(\)) operator(==) integer(0)operator(\)) ident(signm) operator(+=) integer(3)operator(;) - ident(signo) operator(=) ident(signm2signo)operator(()ident(signm)operator(\);) - reserved(if) operator((!)ident(signo)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(signm)operator(\);) - operator(}) - reserved(if) operator(()ident(SYMBOL_P)operator(()ident(sig)operator(\)\)) operator({) - ident(sig) operator(=) ident(rb_str_new2)operator(()ident(signm)operator(\);) - operator(}) - operator(}) - ident(rb_call_super)operator(()integer(1)operator(,) operator(&)ident(sig)operator(\);) - ident(rb_iv_set)operator(()ident(self)operator(,) stringoperator(,) ident(INT2NUM)operator(()ident(signo)operator(\)\);) - - reserved(return) ident(self)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(interrupt_init)operator(()ident(self)operator(,) ident(mesg)operator(\)) - ident(VALUE) ident(self)operator(,) ident(mesg)operator(;) -operator({) - ident(VALUE) ident(argv)operator([)integer(2)operator(];) - - ident(argv)operator([)integer(0)operator(]) operator(=) ident(INT2FIX)operator(()ident(SIGINT)operator(\);) - ident(argv)operator([)integer(1)operator(]) operator(=) ident(mesg)operator(;) - reserved(return) ident(rb_call_super)operator(()integer(2)operator(,) ident(argv)operator(\);) -operator(}) - -directive(void) -ident(ruby_default_signal)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) -preprocessor(#ifndef) ident(MACOS_UNUSE_SIGNAL) - directive(extern) ident(rb_pid_t) ident(getpid) ident(_)operator((()directive(void)operator(\)\);) - - ident(signal)operator(()ident(sig)operator(,) ident(SIG_DFL)operator(\);) - ident(kill)operator(()ident(getpid)operator((\),) ident(sig)operator(\);) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * Process.kill(signal, pid, ...\) => fixnum - * - * Sends the given signal to the specified process id(s\), or to the - * current process if _pid_ is zero. _signal_ may be an - * integer signal number or a POSIX signal name (either with or without - * a +SIG+ prefix\). If _signal_ is negative (or starts - * with a minus sign\), kills process groups instead of - * processes. Not all signals are available on all platforms. - * - * pid = fork do - * Signal.trap("HUP"\) { puts "Ouch!"; exit } - * # ... do some work ... - * end - * # ... - * Process.kill("HUP", pid\) - * Process.wait - * - * produces: - * - * Ouch! - */) - -ident(VALUE) -ident(rb_f_kill)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - pre_type(int) ident(negative) operator(=) integer(0)operator(;) - pre_type(int) ident(sig)operator(;) - pre_type(int) ident(i)operator(;) - pre_type(char) operator(*)ident(s)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - reserved(if) operator(()ident(argc) operator(<) integer(2)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(argv)operator([)integer(0)operator(]\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(sig) operator(=) ident(FIX2INT)operator(()ident(argv)operator([)integer(0)operator(]\);) - reserved(break)operator(;) - - reserved(case) ident(T_SYMBOL)operator(:) - ident(s) operator(=) ident(rb_id2name)operator(()ident(SYM2ID)operator(()ident(argv)operator([)integer(0)operator(]\)\);) - reserved(if) operator((!)ident(s)operator(\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(goto) ident(str_signal)operator(;) - - reserved(case) ident(T_STRING)operator(:) - ident(s) operator(=) ident(RSTRING)operator(()ident(argv)operator([)integer(0)operator(]\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(s)operator([)integer(0)operator(]) operator(==) char('-')operator(\)) operator({) - ident(negative)operator(++;) - ident(s)operator(++;) - operator(}) - label(str_signal:) - reserved(if) operator(()ident(strncmp)operator(()stringoperator(,) ident(s)operator(,) integer(3)operator(\)) operator(==) integer(0)operator(\)) - ident(s) operator(+=) integer(3)operator(;) - reserved(if)operator((()ident(sig) operator(=) ident(signm2signo)operator(()ident(s)operator(\)\)) operator(==) integer(0)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(s)operator(\);) - - reserved(if) operator(()ident(negative)operator(\)) - ident(sig) operator(=) operator(-)ident(sig)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - operator({) - ident(VALUE) ident(str)operator(;) - - ident(str) operator(=) ident(rb_check_string_type)operator(()ident(argv)operator([)integer(0)operator(]\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(str)operator(\)\)) operator({) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - reserved(goto) ident(str_signal)operator(;) - operator(}) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(argv)operator([)integer(0)operator(]\)\);) - operator(}) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(()ident(sig) operator(<) integer(0)operator(\)) operator({) - ident(sig) operator(=) operator(-)ident(sig)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(1)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - pre_type(int) ident(pid) operator(=) ident(NUM2INT)operator(()ident(argv)operator([)ident(i)operator(]\);) -preprocessor(#ifdef) ident(HAS_KILLPG) - reserved(if) operator(()ident(killpg)operator(()ident(pid)operator(,) ident(sig)operator(\)) operator(<) integer(0)operator(\)) -preprocessor(#else) - reserved(if) operator(()ident(kill)operator((-)ident(pid)operator(,) ident(sig)operator(\)) operator(<) integer(0)operator(\)) -preprocessor(#endif) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - reserved(for) operator(()ident(i)operator(=)integer(1)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(Check_Type)operator(()ident(argv)operator([)ident(i)operator(],) ident(T_FIXNUM)operator(\);) - reserved(if) operator(()ident(kill)operator(()ident(FIX2INT)operator(()ident(argv)operator([)ident(i)operator(]\),) ident(sig)operator(\)) operator(<) integer(0)operator(\)) - ident(rb_sys_fail)operator(()integer(0)operator(\);) - operator(}) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(i)operator(-)integer(1)operator(\);) -operator(}) - -directive(static) reserved(struct) operator({) - ident(VALUE) ident(cmd)operator(;) - pre_type(int) ident(safe)operator(;) -operator(}) ident(trap_list)operator([)ident(NSIG)operator(];) -directive(static) ident(rb_atomic_t) ident(trap_pending_list)operator([)ident(NSIG)operator(];) -directive(static) pre_type(char) ident(rb_trap_accept_nativethreads)operator([)ident(NSIG)operator(];) -ident(rb_atomic_t) ident(rb_trap_pending)operator(;) -ident(rb_atomic_t) ident(rb_trap_immediate)operator(;) -pre_type(int) ident(rb_prohibit_interrupt) operator(=) integer(1)operator(;) - -directive(void) -ident(rb_gc_mark_trap_list)operator((\)) -operator({) -preprocessor(#ifndef) ident(MACOS_UNUSE_SIGNAL) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(NSIG)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(trap_list)operator([)ident(i)operator(])operator(.)ident(cmd)operator(\)) - ident(rb_gc_mark)operator(()ident(trap_list)operator([)ident(i)operator(])operator(.)ident(cmd)operator(\);) - operator(}) -preprocessor(#endif) comment(/* MACOS_UNUSE_SIGNAL */) -operator(}) - -preprocessor(#ifdef) ident(__dietlibc__) -preprocessor(#define) ident(sighandler_t) ident(sh_t) -preprocessor(#endif) - -reserved(typedef) ident(RETSIGTYPE) operator((*)ident(sighandler_t)operator(\))ident(_)operator((()pre_type(int)operator(\)\);) - -preprocessor(#ifdef) ident(POSIX_SIGNAL) -directive(static) ident(sighandler_t) -ident(ruby_signal)operator(()ident(signum)operator(,) ident(handler)operator(\)) - pre_type(int) ident(signum)operator(;) - ident(sighandler_t) ident(handler)operator(;) -operator({) - reserved(struct) ident(sigaction) ident(sigact)operator(,) ident(old)operator(;) - - ident(rb_trap_accept_nativethreads)operator([)ident(signum)operator(]) operator(=) integer(0)operator(;) - - ident(sigact)operator(.)ident(sa_handler) operator(=) ident(handler)operator(;) - ident(sigemptyset)operator((&)ident(sigact)operator(.)ident(sa_mask)operator(\);) - ident(sigact)operator(.)ident(sa_flags) operator(=) integer(0)operator(;) -preprocessor(# ifdef) ident(SA_NOCLDWAIT) - reserved(if) operator(()ident(signum) operator(==) ident(SIGCHLD) operator(&&) ident(handler) operator(==) ident(SIG_IGN)operator(\)) - ident(sigact)operator(.)ident(sa_flags) operator(|=) ident(SA_NOCLDWAIT)operator(;) -preprocessor(# endif) - ident(sigaction)operator(()ident(signum)operator(,) operator(&)ident(sigact)operator(,) operator(&)ident(old)operator(\);) - reserved(return) ident(old)operator(.)ident(sa_handler)operator(;) -operator(}) - -directive(void) -ident(posix_signal)operator(()ident(signum)operator(,) ident(handler)operator(\)) - pre_type(int) ident(signum)operator(;) - ident(sighandler_t) ident(handler)operator(;) -operator({) - ident(ruby_signal)operator(()ident(signum)operator(,) ident(handler)operator(\);) -operator(}) - -preprocessor(# ifdef) ident(HAVE_NATIVETHREAD) -directive(static) ident(sighandler_t) -ident(ruby_nativethread_signal)operator(()ident(signum)operator(,) ident(handler)operator(\)) - pre_type(int) ident(signum)operator(;) - ident(sighandler_t) ident(handler)operator(;) -operator({) - ident(sighandler_t) ident(old)operator(;) - - ident(old) operator(=) ident(ruby_signal)operator(()ident(signum)operator(,) ident(handler)operator(\);) - ident(rb_trap_accept_nativethreads)operator([)ident(signum)operator(]) operator(=) integer(1)operator(;) - reserved(return) ident(old)operator(;) -operator(}) - -directive(void) -ident(posix_nativethread_signal)operator(()ident(signum)operator(,) ident(handler)operator(\)) - pre_type(int) ident(signum)operator(;) - ident(sighandler_t) ident(handler)operator(;) -operator({) - ident(ruby_nativethread_signal)operator(()ident(signum)operator(,) ident(handler)operator(\);) -operator(}) -preprocessor(# endif) - -preprocessor(#else) comment(/* !POSIX_SIGNAL */) -preprocessor(#define) ident(ruby_signal)operator(()ident(sig)operator(,)ident(handler)operator(\)) operator(()ident(rb_trap_accept_nativethreads)operator([)ident(sig)operator(]) operator(=) integer(0)operator(,) ident(signal)operator((()ident(sig)operator(\),()ident(handler)operator(\)\)\)) - -preprocessor(# ifdef) ident(HAVE_NATIVETHREAD) -directive(static) ident(sighandler_t) -ident(ruby_nativethread_signal)operator(()ident(signum)operator(,) ident(handler)operator(\)) - pre_type(int) ident(signum)operator(;) - ident(sighandler_t) ident(handler)operator(;) -operator({) - ident(sighandler_t) ident(old)operator(;) - - ident(old) operator(=) ident(signal)operator(()ident(signum)operator(,) ident(handler)operator(\);) - ident(rb_trap_accept_nativethreads)operator([)ident(signum)operator(]) operator(=) integer(1)operator(;) - reserved(return) ident(old)operator(;) -operator(}) -preprocessor(# endif) -preprocessor(#endif) comment(/* POSIX_SIGNAL */) - -directive(static) directive(void) ident(signal_exec) ident(_)operator((()pre_type(int) ident(sig)operator(\)\);) -directive(static) directive(void) -ident(signal_exec)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) - reserved(if) operator(()ident(trap_list)operator([)ident(sig)operator(])operator(.)ident(cmd) operator(==) integer(0)operator(\)) operator({) - reserved(switch) operator(()ident(sig)operator(\)) operator({) - reserved(case) ident(SIGINT)operator(:) - ident(rb_thread_interrupt)operator((\);) - reserved(break)operator(;) -preprocessor(#ifdef) ident(SIGHUP) - reserved(case) ident(SIGHUP)operator(:) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGQUIT) - reserved(case) ident(SIGQUIT)operator(:) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGTERM) - reserved(case) ident(SIGTERM)operator(:) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGALRM) - reserved(case) ident(SIGALRM)operator(:) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGUSR1) - reserved(case) ident(SIGUSR1)operator(:) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGUSR2) - reserved(case) ident(SIGUSR2)operator(:) -preprocessor(#endif) - ident(rb_thread_signal_raise)operator(()ident(sig)operator(\);) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(trap_list)operator([)ident(sig)operator(])operator(.)ident(cmd) operator(==) ident(Qundef)operator(\)) operator({) - ident(rb_thread_signal_exit)operator((\);) - operator(}) - reserved(else) operator({) - ident(rb_thread_trap_eval)operator(()ident(trap_list)operator([)ident(sig)operator(])operator(.)ident(cmd)operator(,) ident(sig)operator(,) ident(trap_list)operator([)ident(sig)operator(])operator(.)ident(safe)operator(\);) - operator(}) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_NATIVETHREAD)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_NATIVETHREAD_KILL)operator(\)) -directive(static) directive(void) -ident(sigsend_to_ruby_thread)operator(()pre_type(int) ident(sig)operator(\)) -operator({) -preprocessor(# ifdef) ident(HAVE_SIGPROCMASK) - ident(sigset_t) ident(mask)operator(,) ident(old_mask)operator(;) -preprocessor(# else) - pre_type(int) ident(mask)operator(,) ident(old_mask)operator(;) -preprocessor(# endif) - -preprocessor(# ifdef) ident(HAVE_SIGPROCMASK) - ident(sigfillset)operator((&)ident(mask)operator(\);) - ident(sigprocmask)operator(()ident(SIG_BLOCK)operator(,) operator(&)ident(mask)operator(,) operator(&)ident(old_mask)operator(\);) -preprocessor(# else) - ident(mask) operator(=) ident(sigblock)operator((~)integer(0)operator(\);) - ident(sigsetmask)operator(()ident(mask)operator(\);) -preprocessor(# endif) - - ident(ruby_native_thread_kill)operator(()ident(sig)operator(\);) -operator(}) -preprocessor(#endif) - -directive(static) ident(RETSIGTYPE) ident(sighandler) ident(_)operator((()pre_type(int)operator(\)\);) -directive(static) ident(RETSIGTYPE) -ident(sighandler)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) -preprocessor(#ifdef) ident(_WIN32) -preprocessor(#define) ident(IN_MAIN_CONTEXT)operator(()ident(f)operator(,) ident(a)operator(\)) operator(()ident(rb_w32_main_context)operator(()ident(a)operator(,) ident(f)operator(\)) operator(?) operator(()directive(void)operator(\))integer(0) operator(:) ident(f)operator(()ident(a)operator(\)\)) -preprocessor(#else) -preprocessor(#define) ident(IN_MAIN_CONTEXT)operator(()ident(f)operator(,) ident(a)operator(\)) ident(f)operator(()ident(a)operator(\)) -preprocessor(#endif) - - reserved(if) operator(()ident(sig) operator(>=) ident(NSIG)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(,) ident(sig)operator(\);) - operator(}) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_NATIVETHREAD)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_NATIVETHREAD_KILL)operator(\)) - reserved(if) operator((!)ident(is_ruby_native_thread)operator((\)) operator(&&) operator(!)ident(rb_trap_accept_nativethreads)operator([)ident(sig)operator(]\)) operator({) - ident(sigsend_to_ruby_thread)operator(()ident(sig)operator(\);) - reserved(return)operator(;) - operator(}) -preprocessor(#endif) - -preprocessor(#if) operator(!)ident(defined)operator(()ident(BSD_SIGNAL)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(POSIX_SIGNAL)operator(\)) - reserved(if) operator(()ident(rb_trap_accept_nativethreads)operator([)ident(sig)operator(]\)) operator({) - ident(ruby_nativethread_signal)operator(()ident(sig)operator(,) ident(sighandler)operator(\);) - operator(}) - reserved(else) operator({) - ident(ruby_signal)operator(()ident(sig)operator(,) ident(sighandler)operator(\);) - operator(}) -preprocessor(#endif) - - reserved(if) operator(()ident(trap_list)operator([)ident(sig)operator(])operator(.)ident(cmd) operator(==) integer(0) operator(&&) ident(ATOMIC_TEST)operator(()ident(rb_trap_immediate)operator(\)\)) operator({) - ident(IN_MAIN_CONTEXT)operator(()ident(signal_exec)operator(,) ident(sig)operator(\);) - ident(ATOMIC_SET)operator(()ident(rb_trap_immediate)operator(,) integer(1)operator(\);) - operator(}) - reserved(else) operator({) - ident(ATOMIC_INC)operator(()ident(rb_trap_pending)operator(\);) - ident(ATOMIC_INC)operator(()ident(trap_pending_list)operator([)ident(sig)operator(]\);) -preprocessor(#ifdef) ident(_WIN32) - ident(rb_w32_interrupted)operator((\);) -preprocessor(#endif) - operator(}) -operator(}) - -preprocessor(#ifdef) ident(SIGBUS) -directive(static) ident(RETSIGTYPE) ident(sigbus) ident(_)operator((()pre_type(int)operator(\)\);) -directive(static) ident(RETSIGTYPE) -ident(sigbus)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_NATIVETHREAD)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_NATIVETHREAD_KILL)operator(\)) - reserved(if) operator((!)ident(is_ruby_native_thread)operator((\)) operator(&&) operator(!)ident(rb_trap_accept_nativethreads)operator([)ident(sig)operator(]\)) operator({) - ident(sigsend_to_ruby_thread)operator(()ident(sig)operator(\);) - reserved(return)operator(;) - operator(}) -preprocessor(#endif) - - ident(rb_bug)operator(()stringoperator(\);) -operator(}) -preprocessor(#endif) - -preprocessor(#ifdef) ident(SIGSEGV) -directive(static) ident(RETSIGTYPE) ident(sigsegv) ident(_)operator((()pre_type(int)operator(\)\);) -directive(static) ident(RETSIGTYPE) -ident(sigsegv)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_NATIVETHREAD)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_NATIVETHREAD_KILL)operator(\)) - reserved(if) operator((!)ident(is_ruby_native_thread)operator((\)) operator(&&) operator(!)ident(rb_trap_accept_nativethreads)operator([)ident(sig)operator(]\)) operator({) - ident(sigsend_to_ruby_thread)operator(()ident(sig)operator(\);) - reserved(return)operator(;) - operator(}) -preprocessor(#endif) - - ident(rb_bug)operator(()stringoperator(\);) -operator(}) -preprocessor(#endif) - -preprocessor(#ifdef) ident(SIGPIPE) -directive(static) ident(RETSIGTYPE) ident(sigpipe) ident(_)operator((()pre_type(int)operator(\)\);) -directive(static) ident(RETSIGTYPE) -ident(sigpipe)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) - comment(/* do nothing */) -operator(}) -preprocessor(#endif) - -directive(void) -ident(rb_trap_exit)operator((\)) -operator({) -preprocessor(#ifndef) ident(MACOS_UNUSE_SIGNAL) - reserved(if) operator(()ident(trap_list)operator([)integer(0)operator(])operator(.)ident(cmd)operator(\)) operator({) - ident(VALUE) ident(trap_exit) operator(=) ident(trap_list)operator([)integer(0)operator(])operator(.)ident(cmd)operator(;) - - ident(trap_list)operator([)integer(0)operator(])operator(.)ident(cmd) operator(=) integer(0)operator(;) - ident(rb_eval_cmd)operator(()ident(trap_exit)operator(,) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(INT2FIX)operator(()integer(0)operator(\)\),) ident(trap_list)operator([)integer(0)operator(])operator(.)ident(safe)operator(\);) - operator(}) -preprocessor(#endif) -operator(}) - -directive(void) -ident(rb_trap_exec)operator((\)) -operator({) -preprocessor(#ifndef) ident(MACOS_UNUSE_SIGNAL) - pre_type(int) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(NSIG)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(trap_pending_list)operator([)ident(i)operator(]\)) operator({) - ident(trap_pending_list)operator([)ident(i)operator(]) operator(=) integer(0)operator(;) - ident(signal_exec)operator(()ident(i)operator(\);) - operator(}) - operator(}) -preprocessor(#endif) comment(/* MACOS_UNUSE_SIGNAL */) - ident(rb_trap_pending) operator(=) integer(0)operator(;) -operator(}) - -reserved(struct) ident(trap_arg) operator({) -preprocessor(#if) ident(USE_TRAP_MASK) -preprocessor(# ifdef) ident(HAVE_SIGPROCMASK) - ident(sigset_t) ident(mask)operator(;) -preprocessor(# else) - pre_type(int) ident(mask)operator(;) -preprocessor(# endif) -preprocessor(#endif) - ident(VALUE) ident(sig)operator(,) ident(cmd)operator(;) -operator(};) - -preprocessor(# ifdef) ident(HAVE_SIGPROCMASK) -directive(static) ident(sigset_t) ident(trap_last_mask)operator(;) -preprocessor(# else) -directive(static) pre_type(int) ident(trap_last_mask)operator(;) -preprocessor(# endif) - -directive(static) ident(RETSIGTYPE) ident(sigexit) ident(_)operator((()pre_type(int)operator(\)\);) -directive(static) ident(RETSIGTYPE) -ident(sigexit)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) - ident(rb_thread_signal_exit)operator((\);) -operator(}) - -directive(static) ident(VALUE) -ident(trap)operator(()ident(arg)operator(\)) - reserved(struct) ident(trap_arg) operator(*)ident(arg)operator(;) -operator({) - ident(sighandler_t) ident(func)operator(,) ident(oldfunc)operator(;) - ident(VALUE) ident(command)operator(,) ident(oldcmd)operator(;) - pre_type(int) ident(sig) operator(=) operator(-)integer(1)operator(;) - pre_type(char) operator(*)ident(s)operator(;) - - ident(func) operator(=) ident(sighandler)operator(;) - ident(command) operator(=) ident(arg)operator(->)ident(cmd)operator(;) - reserved(if) operator(()ident(NIL_P)operator(()ident(command)operator(\)\)) operator({) - ident(func) operator(=) ident(SIG_IGN)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(TYPE)operator(()ident(command)operator(\)) operator(==) ident(T_STRING)operator(\)) operator({) - ident(SafeStringValue)operator(()ident(command)operator(\);) comment(/* taint check */) - reserved(if) operator(()ident(RSTRING)operator(()ident(command)operator(\)->)ident(len) operator(==) integer(0)operator(\)) operator({) - ident(func) operator(=) ident(SIG_IGN)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(RSTRING)operator(()ident(command)operator(\)->)ident(len) operator(==) integer(7)operator(\)) operator({) - reserved(if) operator(()ident(strncmp)operator(()ident(RSTRING)operator(()ident(command)operator(\)->)ident(ptr)operator(,) stringoperator(,) integer(7)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(func) operator(=) ident(SIG_IGN)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(strncmp)operator(()ident(RSTRING)operator(()ident(command)operator(\)->)ident(ptr)operator(,) stringoperator(,) integer(7)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(func) operator(=) ident(SIG_DFL)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(strncmp)operator(()ident(RSTRING)operator(()ident(command)operator(\)->)ident(ptr)operator(,) stringoperator(,) integer(7)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(func) operator(=) ident(SIG_DFL)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(RSTRING)operator(()ident(command)operator(\)->)ident(len) operator(==) integer(6)operator(\)) operator({) - reserved(if) operator(()ident(strncmp)operator(()ident(RSTRING)operator(()ident(command)operator(\)->)ident(ptr)operator(,) stringoperator(,) integer(6)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(func) operator(=) ident(SIG_IGN)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(RSTRING)operator(()ident(command)operator(\)->)ident(len) operator(==) integer(4)operator(\)) operator({) - reserved(if) operator(()ident(strncmp)operator(()ident(RSTRING)operator(()ident(command)operator(\)->)ident(ptr)operator(,) stringoperator(,) integer(4)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(func) operator(=) ident(sigexit)operator(;) - operator(}) - operator(}) - operator(}) - reserved(if) operator(()ident(func) operator(==) ident(SIG_IGN) operator(||) ident(func) operator(==) ident(SIG_DFL)operator(\)) operator({) - ident(command) operator(=) integer(0)operator(;) - operator(}) - - reserved(switch) operator(()ident(TYPE)operator(()ident(arg)operator(->)ident(sig)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(sig) operator(=) ident(FIX2INT)operator(()ident(arg)operator(->)ident(sig)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_SYMBOL)operator(:) - ident(s) operator(=) ident(rb_id2name)operator(()ident(SYM2ID)operator(()ident(arg)operator(->)ident(sig)operator(\)\);) - reserved(if) operator((!)ident(s)operator(\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(goto) ident(str_signal)operator(;) - - reserved(case) ident(T_STRING)operator(:) - ident(s) operator(=) ident(RSTRING)operator(()ident(arg)operator(->)ident(sig)operator(\)->)ident(ptr)operator(;) - - label(str_signal:) - reserved(if) operator(()ident(strncmp)operator(()stringoperator(,) ident(s)operator(,) integer(3)operator(\)) operator(==) integer(0)operator(\)) - ident(s) operator(+=) integer(3)operator(;) - ident(sig) operator(=) ident(signm2signo)operator(()ident(s)operator(\);) - reserved(if) operator(()ident(sig) operator(==) integer(0) operator(&&) ident(strcmp)operator(()ident(s)operator(,) stringoperator(\)) operator(!=) integer(0)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(s)operator(\);) - operator(}) - - reserved(if) operator(()ident(sig) operator(<) integer(0) operator(||) ident(sig) operator(>=) ident(NSIG)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(sig)operator(\);) - operator(}) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETITIMER)operator(\)) - reserved(if) operator(()ident(sig) operator(==) ident(SIGVTALRM)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) -preprocessor(#endif) - reserved(if) operator(()ident(func) operator(==) ident(SIG_DFL)operator(\)) operator({) - reserved(switch) operator(()ident(sig)operator(\)) operator({) - reserved(case) ident(SIGINT)operator(:) -preprocessor(#ifdef) ident(SIGHUP) - reserved(case) ident(SIGHUP)operator(:) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGQUIT) - reserved(case) ident(SIGQUIT)operator(:) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGTERM) - reserved(case) ident(SIGTERM)operator(:) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGALRM) - reserved(case) ident(SIGALRM)operator(:) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGUSR1) - reserved(case) ident(SIGUSR1)operator(:) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGUSR2) - reserved(case) ident(SIGUSR2)operator(:) -preprocessor(#endif) - ident(func) operator(=) ident(sighandler)operator(;) - reserved(break)operator(;) -preprocessor(#ifdef) ident(SIGBUS) - reserved(case) ident(SIGBUS)operator(:) - ident(func) operator(=) ident(sigbus)operator(;) - reserved(break)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGSEGV) - reserved(case) ident(SIGSEGV)operator(:) - ident(func) operator(=) ident(sigsegv)operator(;) - reserved(break)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGPIPE) - reserved(case) ident(SIGPIPE)operator(:) - ident(func) operator(=) ident(sigpipe)operator(;) - reserved(break)operator(;) -preprocessor(#endif) - operator(}) - operator(}) - ident(oldfunc) operator(=) ident(ruby_signal)operator(()ident(sig)operator(,) ident(func)operator(\);) - ident(oldcmd) operator(=) ident(trap_list)operator([)ident(sig)operator(])operator(.)ident(cmd)operator(;) - reserved(if) operator((!)ident(oldcmd)operator(\)) operator({) - reserved(if) operator(()ident(oldfunc) operator(==) ident(SIG_IGN)operator(\)) ident(oldcmd) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(else) reserved(if) operator(()ident(oldfunc) operator(==) ident(sighandler)operator(\)) ident(oldcmd) operator(=) ident(rb_str_new2)operator(()stringoperator(\);) - reserved(else) ident(oldcmd) operator(=) ident(Qnil)operator(;) - operator(}) - - ident(trap_list)operator([)ident(sig)operator(])operator(.)ident(cmd) operator(=) ident(command)operator(;) - ident(trap_list)operator([)ident(sig)operator(])operator(.)ident(safe) operator(=) ident(ruby_safe_level)operator(;) - comment(/* enable at least specified signal. */) -preprocessor(#if) ident(USE_TRAP_MASK) -preprocessor(#ifdef) ident(HAVE_SIGPROCMASK) - ident(sigdelset)operator((&)ident(arg)operator(->)ident(mask)operator(,) ident(sig)operator(\);) -preprocessor(#else) - ident(arg)operator(->)ident(mask) operator(&=) operator(~)ident(sigmask)operator(()ident(sig)operator(\);) -preprocessor(#endif) -preprocessor(#endif) - reserved(return) ident(oldcmd)operator(;) -operator(}) - -preprocessor(#if) ident(USE_TRAP_MASK) -directive(static) ident(VALUE) -ident(trap_ensure)operator(()ident(arg)operator(\)) - reserved(struct) ident(trap_arg) operator(*)ident(arg)operator(;) -operator({) - comment(/* enable interrupt */) -preprocessor(#ifdef) ident(HAVE_SIGPROCMASK) - ident(sigprocmask)operator(()ident(SIG_SETMASK)operator(,) operator(&)ident(arg)operator(->)ident(mask)operator(,) pre_constant(NULL)operator(\);) -preprocessor(#else) - ident(sigsetmask)operator(()ident(arg)operator(->)ident(mask)operator(\);) -preprocessor(#endif) - ident(trap_last_mask) operator(=) ident(arg)operator(->)ident(mask)operator(;) - reserved(return) integer(0)operator(;) -operator(}) -preprocessor(#endif) - -directive(void) -ident(rb_trap_restore_mask)operator((\)) -operator({) -preprocessor(#if) ident(USE_TRAP_MASK) -preprocessor(# ifdef) ident(HAVE_SIGPROCMASK) - ident(sigprocmask)operator(()ident(SIG_SETMASK)operator(,) operator(&)ident(trap_last_mask)operator(,) pre_constant(NULL)operator(\);) -preprocessor(# else) - ident(sigsetmask)operator(()ident(trap_last_mask)operator(\);) -preprocessor(# endif) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * Signal.trap( signal, proc \) => obj - * Signal.trap( signal \) {| | block } => obj - * - * Specifies the handling of signals. The first parameter is a signal - * name (a string such as ``SIGALRM'', ``SIGUSR1'', and so on\) or a - * signal number. The characters ``SIG'' may be omitted from the - * signal name. The command or block specifies code to be run when the - * signal is raised. If the command is the string ``IGNORE'' or - * ``SIG_IGN'', the signal will be ignored. If the command is - * ``DEFAULT'' or ``SIG_DFL'', the operating system's default handler - * will be invoked. If the command is ``EXIT'', the script will be - * terminated by the signal. Otherwise, the given command or block - * will be run. - * The special signal name ``EXIT'' or signal number zero will be - * invoked just prior to program termination. - * trap returns the previous handler for the given signal. - * - * Signal.trap(0, proc { puts "Terminating: #{$$}" }\) - * Signal.trap("CLD"\) { puts "Child died" } - * fork && Process.wait - * - * produces: - * Terminating: 27461 - * Child died - * Terminating: 27460 - */) -directive(static) ident(VALUE) -ident(sig_trap)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(struct) ident(trap_arg) ident(arg)operator(;) - - ident(rb_secure)operator(()integer(2)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0) operator(||) ident(argc) operator(>) integer(2)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - ident(arg)operator(.)ident(sig) operator(=) ident(argv)operator([)integer(0)operator(];) - reserved(if) operator(()ident(argc) operator(==) integer(1)operator(\)) operator({) - ident(arg)operator(.)ident(cmd) operator(=) ident(rb_block_proc)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(argc) operator(==) integer(2)operator(\)) operator({) - ident(arg)operator(.)ident(cmd) operator(=) ident(argv)operator([)integer(1)operator(];) - operator(}) - - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(arg)operator(.)ident(cmd)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) -preprocessor(#if) ident(USE_TRAP_MASK) - comment(/* disable interrupt */) -preprocessor(# ifdef) ident(HAVE_SIGPROCMASK) - ident(sigfillset)operator((&)ident(arg)operator(.)ident(mask)operator(\);) - ident(sigprocmask)operator(()ident(SIG_BLOCK)operator(,) operator(&)ident(arg)operator(.)ident(mask)operator(,) operator(&)ident(arg)operator(.)ident(mask)operator(\);) -preprocessor(# else) - ident(arg)operator(.)ident(mask) operator(=) ident(sigblock)operator((~)integer(0)operator(\);) -preprocessor(# endif) - - reserved(return) ident(rb_ensure)operator(()ident(trap)operator(,) operator(()ident(VALUE)operator(\)&)ident(arg)operator(,) ident(trap_ensure)operator(,) operator(()ident(VALUE)operator(\)&)ident(arg)operator(\);) -preprocessor(#else) - reserved(return) ident(trap)operator((&)ident(arg)operator(\);) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * Signal.list => a_hash - * - * Returns a list of signal names mapped to the corresponding - * underlying signal numbers. - * - * Signal.list #=> {"ABRT"=>6, "ALRM"=>14, "BUS"=>7, "CHLD"=>17, "CLD"=>17, "CONT"=>18, "FPE"=>8, "HUP"=>1, "ILL"=>4, "INT"=>2, "IO"=>29, "IOT"=>6, "KILL"=>9, "PIPE"=>13, "POLL"=>29, "PROF"=>27, "PWR"=>30, "QUIT"=>3, "SEGV"=>11, "STOP"=>19, "SYS"=>31, "TERM"=>15, "TRAP"=>5, "TSTP"=>20, "TTIN"=>21, "TTOU"=>22, "URG"=>23, "USR1"=>10, "USR2"=>12, "VTALRM"=>26, "WINCH"=>28, "XCPU"=>24, "XFSZ"=>25} - */) -directive(static) ident(VALUE) -ident(sig_list)operator((\)) -operator({) - ident(VALUE) ident(h) operator(=) ident(rb_hash_new)operator((\);) - reserved(struct) ident(signals) operator(*)ident(sigs)operator(;) - - reserved(for) operator(()ident(sigs) operator(=) ident(siglist)operator(;) ident(sigs)operator(->)ident(signm)operator(;) ident(sigs)operator(++\)) operator({) - ident(rb_hash_aset)operator(()ident(h)operator(,) ident(rb_str_new2)operator(()ident(sigs)operator(->)ident(signm)operator(\),) ident(INT2FIX)operator(()ident(sigs)operator(->)ident(signo)operator(\)\);) - operator(}) - reserved(return) ident(h)operator(;) -operator(}) - -directive(static) directive(void) -ident(install_sighandler)operator(()ident(signum)operator(,) ident(handler)operator(\)) - pre_type(int) ident(signum)operator(;) - ident(sighandler_t) ident(handler)operator(;) -operator({) - ident(sighandler_t) ident(old)operator(;) - - ident(old) operator(=) ident(ruby_signal)operator(()ident(signum)operator(,) ident(handler)operator(\);) - reserved(if) operator(()ident(old) operator(!=) ident(SIG_DFL)operator(\)) operator({) - ident(ruby_signal)operator(()ident(signum)operator(,) ident(old)operator(\);) - operator(}) -operator(}) - -comment(#if 0 -/* - * If you write a handler which works on any native thread - * (even if the thread is NOT a ruby's one\), please enable - * this function and use it to install the handler, instead - * of `install_sighandler(\)'. - */ -#ifdef HAVE_NATIVETHREAD -static void -install_nativethread_sighandler(signum, handler\) - int signum; - sighandler_t handler; -{ - sighandler_t old; - int old_st; - - old_st = rb_trap_accept_nativethreads[signum]; - old = ruby_nativethread_signal(signum, handler\); - if (old != SIG_DFL\) { - if (old_st\) { - ruby_nativethread_signal(signum, old\); - } else { - ruby_signal(signum, old\); - } - } -} -#endif) -preprocessor(#endif) - -directive(static) directive(void) -ident(init_sigchld)operator(()ident(sig)operator(\)) - pre_type(int) ident(sig)operator(;) -operator({) - ident(sighandler_t) ident(oldfunc)operator(;) -preprocessor(#if) ident(USE_TRAP_MASK) -preprocessor(# ifdef) ident(HAVE_SIGPROCMASK) - ident(sigset_t) ident(mask)operator(;) -preprocessor(# else) - pre_type(int) ident(mask)operator(;) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#if) ident(USE_TRAP_MASK) - comment(/* disable interrupt */) -preprocessor(# ifdef) ident(HAVE_SIGPROCMASK) - ident(sigfillset)operator((&)ident(mask)operator(\);) - ident(sigprocmask)operator(()ident(SIG_BLOCK)operator(,) operator(&)ident(mask)operator(,) operator(&)ident(mask)operator(\);) -preprocessor(# else) - ident(mask) operator(=) ident(sigblock)operator((~)integer(0)operator(\);) -preprocessor(# endif) -preprocessor(#endif) - - ident(oldfunc) operator(=) ident(ruby_signal)operator(()ident(sig)operator(,) ident(SIG_DFL)operator(\);) - reserved(if) operator(()ident(oldfunc) operator(!=) ident(SIG_DFL) operator(&&) ident(oldfunc) operator(!=) ident(SIG_IGN)operator(\)) operator({) - ident(ruby_signal)operator(()ident(sig)operator(,) ident(oldfunc)operator(\);) - operator(}) reserved(else) operator({) - ident(trap_list)operator([)ident(sig)operator(])operator(.)ident(cmd) operator(=) integer(0)operator(;) - operator(}) - -preprocessor(#if) ident(USE_TRAP_MASK) -preprocessor(#ifdef) ident(HAVE_SIGPROCMASK) - ident(sigdelset)operator((&)ident(mask)operator(,) ident(sig)operator(\);) - ident(sigprocmask)operator(()ident(SIG_SETMASK)operator(,) operator(&)ident(mask)operator(,) pre_constant(NULL)operator(\);) -preprocessor(#else) - ident(mask) operator(&=) operator(~)ident(sigmask)operator(()ident(sig)operator(\);) - ident(sigsetmask)operator(()ident(mask)operator(\);) -preprocessor(#endif) - ident(trap_last_mask) operator(=) ident(mask)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* - * Many operating systems allow signals to be sent to running - * processes. Some signals have a defined effect on the process, while - * others may be trapped at the code level and acted upon. For - * example, your process may trap the USR1 signal and use it to toggle - * debugging, and may use TERM to initiate a controlled shutdown. - * - * pid = fork do - * Signal.trap("USR1"\) do - * $debug = !$debug - * puts "Debug now: #$debug" - * end - * Signal.trap("TERM"\) do - * puts "Terminating..." - * shutdown(\) - * end - * # . . . do some work . . . - * end - * - * Process.detach(pid\) - * - * # Controlling program: - * Process.kill("USR1", pid\) - * # ... - * Process.kill("USR1", pid\) - * # ... - * Process.kill("TERM", pid\) - * - * produces: - * Debug now: true - * Debug now: false - * Terminating... - * - * The list of available signal names and their interpretation is - * system dependent. Signal delivery semantics may also vary between - * systems; in particular signal delivery may not always be reliable. - */) -directive(void) -ident(Init_signal)operator((\)) -operator({) -preprocessor(#ifndef) ident(MACOS_UNUSE_SIGNAL) - ident(VALUE) ident(mSignal) operator(=) ident(rb_define_module)operator(()stringoperator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(sig_trap)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(mSignal)operator(,) stringoperator(,) ident(sig_trap)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_module_function)operator(()ident(mSignal)operator(,) stringoperator(,) ident(sig_list)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_eSignal)operator(,) stringoperator(,) ident(esignal_init)operator(,) operator(-)integer(1)operator(\);) - ident(rb_attr)operator(()ident(rb_eSignal)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) integer(0)operator(,) integer(0)operator(\);) - ident(rb_alias)operator(()ident(rb_eSignal)operator(,) ident(rb_intern)operator(()stringoperator(\),) ident(rb_intern)operator(()stringoperator(\)\);) - ident(rb_define_method)operator(()ident(rb_eInterrupt)operator(,) stringoperator(,) ident(interrupt_init)operator(,) integer(1)operator(\);) - - ident(install_sighandler)operator(()ident(SIGINT)operator(,) ident(sighandler)operator(\);) -preprocessor(#ifdef) ident(SIGHUP) - ident(install_sighandler)operator(()ident(SIGHUP)operator(,) ident(sighandler)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGQUIT) - ident(install_sighandler)operator(()ident(SIGQUIT)operator(,) ident(sighandler)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGTERM) - ident(install_sighandler)operator(()ident(SIGTERM)operator(,) ident(sighandler)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGALRM) - ident(install_sighandler)operator(()ident(SIGALRM)operator(,) ident(sighandler)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGUSR1) - ident(install_sighandler)operator(()ident(SIGUSR1)operator(,) ident(sighandler)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGUSR2) - ident(install_sighandler)operator(()ident(SIGUSR2)operator(,) ident(sighandler)operator(\);) -preprocessor(#endif) - -preprocessor(#ifdef) ident(SIGBUS) - ident(install_sighandler)operator(()ident(SIGBUS)operator(,) ident(sigbus)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGSEGV) - ident(install_sighandler)operator(()ident(SIGSEGV)operator(,) ident(sigsegv)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(SIGPIPE) - ident(install_sighandler)operator(()ident(SIGPIPE)operator(,) ident(sigpipe)operator(\);) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(SIGCLD)operator(\)) - ident(init_sigchld)operator(()ident(SIGCLD)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(SIGCHLD)operator(\)) - ident(init_sigchld)operator(()ident(SIGCHLD)operator(\);) -preprocessor(#endif) - -preprocessor(#endif) comment(/* MACOS_UNUSE_SIGNAL */) -operator(}) -comment(/********************************************************************** - - sprintf.c - - - $Author: shyouhei $ - $Date: 2008-06-20 01:12:46 +0200 (Fri, 20 Jun 2008\) $ - created at: Fri Oct 15 10:39:26 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("re.h") -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#define) ident(BIT_DIGITS)operator(()ident(N)operator(\)) operator(((()ident(N)operator(\)*)integer(146)operator(\))operator(/)integer(485) operator(+) integer(1)operator(\)) comment(/* log2(10\) =~ 146/485 */) -preprocessor(#define) ident(BITSPERDIG) operator(()ident(SIZEOF_BDIGITS)operator(*)ident(CHAR_BIT)operator(\)) -preprocessor(#define) ident(EXTENDSIGN)operator(()ident(n)operator(,) ident(l)operator(\)) operator((((~)integer(0) operator(<<) operator(()ident(n)operator(\)\)) operator(>>) operator(((()ident(n)operator(\)*()ident(l)operator(\)\)) operator(%) ident(BITSPERDIG)operator(\)\)) operator(&) operator(~(~)integer(0) operator(<<) operator(()ident(n)operator(\)\)\)) - -directive(static) directive(void) ident(fmt_setup) ident(_)operator((()pre_type(char)operator(*,)pre_type(int)operator(,)pre_type(int)operator(,)pre_type(int)operator(,)pre_type(int)operator(\)\);) - -directive(static) pre_type(char)operator(*) -ident(remove_sign_bits)operator(()ident(str)operator(,) ident(base)operator(\)) - pre_type(char) operator(*)ident(str)operator(;) - pre_type(int) ident(base)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(t)operator(;) - - ident(s) operator(=) ident(t) operator(=) ident(str)operator(;) - - reserved(if) operator(()ident(base) operator(==) integer(16)operator(\)) operator({) - reserved(while) operator((*)ident(t) operator(==) char('f')operator(\)) operator({) - ident(t)operator(++;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(base) operator(==) integer(8)operator(\)) operator({) - operator(*)ident(t) operator(|=) ident(EXTENDSIGN)operator(()integer(3)operator(,) ident(strlen)operator(()ident(t)operator(\)\);) - reserved(while) operator((*)ident(t) operator(==) char('7')operator(\)) operator({) - ident(t)operator(++;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(base) operator(==) integer(2)operator(\)) operator({) - reserved(while) operator((*)ident(t) operator(==) char('1')operator(\)) operator({) - ident(t)operator(++;) - operator(}) - operator(}) - reserved(if) operator(()ident(t) operator(>) ident(s)operator(\)) operator({) - reserved(while) operator((*)ident(t)operator(\)) operator(*)ident(s)operator(++) operator(=) operator(*)ident(t)operator(++;) - operator(*)ident(s) operator(=) char('\\0')operator(;) - operator(}) - - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) pre_type(char) -ident(sign_bits)operator(()ident(base)operator(,) ident(p)operator(\)) - pre_type(int) ident(base)operator(;) - directive(const) pre_type(char) operator(*)ident(p)operator(;) -operator({) - pre_type(char) ident(c) operator(=) char('.')operator(;) - - reserved(switch) operator(()ident(base)operator(\)) operator({) - reserved(case) integer(16)operator(:) - reserved(if) operator((*)ident(p) operator(==) char('X')operator(\)) ident(c) operator(=) char('F')operator(;) - reserved(else) ident(c) operator(=) char('f')operator(;) - reserved(break)operator(;) - reserved(case) integer(8)operator(:) - ident(c) operator(=) char('7')operator(;) reserved(break)operator(;) - reserved(case) integer(2)operator(:) - ident(c) operator(=) char('1')operator(;) reserved(break)operator(;) - operator(}) - reserved(return) ident(c)operator(;) -operator(}) - -preprocessor(#define) ident(FNONE) integer(0) -preprocessor(#define) ident(FSHARP) integer(1) -preprocessor(#define) ident(FMINUS) integer(2) -preprocessor(#define) ident(FPLUS) integer(4) -preprocessor(#define) ident(FZERO) integer(8) -preprocessor(#define) ident(FSPACE) integer(16) -preprocessor(#define) ident(FWIDTH) integer(32) -preprocessor(#define) ident(FPREC) integer(64) -preprocessor(#define) ident(FPREC0) integer(128) - -preprocessor(#define) ident(CHECK)operator(()ident(l)operator(\)) reserved(do) operator({)\ - reserved(while) operator(()ident(blen) operator(+) operator(()ident(l)operator(\)) operator(>=) ident(bsiz)operator(\)) operator({)\ - ident(bsiz)operator(*=)integer(2)operator(;)\ - operator(})\ - ident(rb_str_resize)operator(()ident(result)operator(,) ident(bsiz)operator(\);)\ - ident(buf) operator(=) ident(RSTRING)operator(()ident(result)operator(\)->)ident(ptr)operator(;)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(PUSH)operator(()ident(s)operator(,) ident(l)operator(\)) reserved(do) operator({) \ - ident(CHECK)operator(()ident(l)operator(\);)\ - ident(memcpy)operator((&)ident(buf)operator([)ident(blen)operator(],) ident(s)operator(,) ident(l)operator(\);)\ - ident(blen) operator(+=) operator(()ident(l)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(GETARG)operator((\)) operator(()ident(nextvalue) operator(!=) ident(Qundef) operator(?) ident(nextvalue) operator(:) \ - ident(posarg) operator(<) integer(0) operator(?) \ - operator(()ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(nextarg)operator(\),) integer(0)operator(\)) operator(:) \ - operator(()ident(posarg) operator(=) ident(nextarg)operator(++,) ident(GETNTHARG)operator(()ident(posarg)operator(\)\)\)) - -preprocessor(#define) ident(GETPOSARG)operator(()ident(n)operator(\)) operator(()ident(posarg) operator(>) integer(0) operator(?) \ - operator(()ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(n)operator(,) ident(posarg)operator(\),) integer(0)operator(\)) operator(:) \ - operator((()ident(n) operator(<) integer(1)operator(\)) operator(?) operator(()ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(n)operator(\),) integer(0)operator(\)) operator(:) \ - operator(()ident(posarg) operator(=) operator(-)integer(1)operator(,) ident(GETNTHARG)operator(()ident(n)operator(\)\)\)\)) - -preprocessor(#define) ident(GETNTHARG)operator(()ident(nth)operator(\)) \ - operator((()ident(nth) operator(>=) ident(argc)operator(\)) operator(?) operator(()ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\),) integer(0)operator(\)) operator(:) ident(argv)operator([)ident(nth)operator(]\)) - -preprocessor(#define) ident(GETNUM)operator(()ident(n)operator(,) ident(val)operator(\)) \ - reserved(for) operator((;) ident(p) operator(<) ident(end) operator(&&) ident(ISDIGIT)operator((*)ident(p)operator(\);) ident(p)operator(++\)) operator({) \ - pre_type(int) ident(next_n) operator(=) integer(10) operator(*) ident(n) operator(+) operator((*)ident(p) operator(-) char('0')operator(\);) \ - reserved(if) operator(()ident(next_n) operator(/) integer(10) operator(!=) ident(n)operator(\)) operator({)\ - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) preprocessor(#val) stringoperator(\);) \ - operator(}) \ - ident(n) operator(=) ident(next_n)operator(;) \ - operator(}) \ - reserved(if) operator(()ident(p) operator(>=) ident(end)operator(\)) operator({) \ - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) \ - operator(}) - -preprocessor(#define) ident(GETASTER)operator(()ident(val)operator(\)) reserved(do) operator({) \ - ident(t) operator(=) ident(p)operator(++;) \ - ident(n) operator(=) integer(0)operator(;) \ - ident(GETNUM)operator(()ident(n)operator(,) ident(val)operator(\);) \ - reserved(if) operator((*)ident(p) operator(==) char('$')operator(\)) operator({) \ - ident(tmp) operator(=) ident(GETPOSARG)operator(()ident(n)operator(\);) \ - operator(}) \ - reserved(else) operator({) \ - ident(tmp) operator(=) ident(GETARG)operator((\);) \ - ident(p) operator(=) ident(t)operator(;) \ - operator(}) \ - ident(val) operator(=) ident(NUM2INT)operator(()ident(tmp)operator(\);) \ -operator(}) reserved(while) operator(()integer(0)operator(\)) - - -comment(/* - * call-seq: - * format(format_string [, arguments...] \) => string - * sprintf(format_string [, arguments...] \) => string - * - * Returns the string resulting from applying format_string to - * any additional arguments. Within the format string, any characters - * other than format sequences are copied to the result. A format - * sequence consists of a percent sign, followed by optional flags, - * width, and precision indicators, then terminated with a field type - * character. The field type controls how the corresponding - * sprintf argument is to be interpreted, while the flags - * modify that interpretation. The field type characters are listed - * in the table at the end of this section. The flag characters are: - * - * Flag | Applies to | Meaning - * ---------+--------------+----------------------------------------- - * space | bdeEfgGiouxX | Leave a space at the start of - * | | positive numbers. - * ---------+--------------+----------------------------------------- - * (digit\)$ | all | Specifies the absolute argument number - * | | for this field. Absolute and relative - * | | argument numbers cannot be mixed in a - * | | sprintf string. - * ---------+--------------+----------------------------------------- - * # | beEfgGoxX | Use an alternative format. For the - * | | conversions `o', `x', `X', and `b', - * | | prefix the result with ``0'', ``0x'', ``0X'', - * | | and ``0b'', respectively. For `e', - * | | `E', `f', `g', and 'G', force a decimal - * | | point to be added, even if no digits follow. - * | | For `g' and 'G', do not remove trailing zeros. - * ---------+--------------+----------------------------------------- - * + | bdeEfgGiouxX | Add a leading plus sign to positive numbers. - * ---------+--------------+----------------------------------------- - * - | all | Left-justify the result of this conversion. - * ---------+--------------+----------------------------------------- - * 0 (zero\) | bdeEfgGiouxX | Pad with zeros, not spaces. - * ---------+--------------+----------------------------------------- - * * | all | Use the next argument as the field width. - * | | If negative, left-justify the result. If the - * | | asterisk is followed by a number and a dollar - * | | sign, use the indicated argument as the width. - * - * - * The field width is an optional integer, followed optionally by a - * period and a precision. The width specifies the minimum number of - * characters that will be written to the result for this field. For - * numeric fields, the precision controls the number of decimal places - * displayed. For string fields, the precision determines the maximum - * number of characters to be copied from the string. (Thus, the format - * sequence %10.10s will always contribute exactly ten - * characters to the result.\) - * - * The field types are: - * - * Field | Conversion - * ------+-------------------------------------------------------------- - * b | Convert argument as a binary number. - * c | Argument is the numeric code for a single character. - * d | Convert argument as a decimal number. - * E | Equivalent to `e', but uses an uppercase E to indicate - * | the exponent. - * e | Convert floating point argument into exponential notation - * | with one digit before the decimal point. The precision - * | determines the number of fractional digits (defaulting to six\). - * f | Convert floating point argument as [-]ddd.ddd, - * | where the precision determines the number of digits after - * | the decimal point. - * G | Equivalent to `g', but use an uppercase `E' in exponent form. - * g | Convert a floating point number using exponential form - * | if the exponent is less than -4 or greater than or - * | equal to the precision, or in d.dddd form otherwise. - * i | Identical to `d'. - * o | Convert argument as an octal number. - * p | The valuing of argument.inspect. - * s | Argument is a string to be substituted. If the format - * | sequence contains a precision, at most that many characters - * | will be copied. - * u | Treat argument as an unsigned decimal number. Negative integers - * | are displayed as a 32 bit two's complement plus one for the - * | underlying architecture; that is, 2 ** 32 + n. However, since - * | Ruby has no inherent limit on bits used to represent the - * | integer, this value is preceded by two dots (..\) in order to - * | indicate a infinite number of leading sign bits. - * X | Convert argument as a hexadecimal number using uppercase - * | letters. Negative numbers will be displayed with two - * | leading periods (representing an infinite string of - * | leading 'FF's. - * x | Convert argument as a hexadecimal number. - * | Negative numbers will be displayed with two - * | leading periods (representing an infinite string of - * | leading 'ff's. - * - * Examples: - * - * sprintf("%d %04x", 123, 123\) #=> "123 007b" - * sprintf("%08b '%4s'", 123, 123\) #=> "01111011 ' 123'" - * sprintf("%1$*2$s %2$d %1$s", "hello", 8\) #=> " hello 8 hello" - * sprintf("%1$*2$s %2$d", "hello", -8\) #=> "hello -8" - * sprintf("%+g:% g:%-g", 1.23, 1.23, 1.23\) #=> "+1.23: 1.23:1.23" - * sprintf("%u", -123\) #=> "..4294967173" - */) - -ident(VALUE) -ident(rb_f_sprintf)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(return) ident(rb_str_format)operator(()ident(argc) operator(-) integer(1)operator(,) ident(argv) operator(+) integer(1)operator(,) ident(GETNTHARG)operator(()integer(0)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_str_format)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(fmt)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(fmt)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(end)operator(;) - pre_type(char) operator(*)ident(buf)operator(;) - pre_type(int) ident(blen)operator(,) ident(bsiz)operator(;) - ident(VALUE) ident(result)operator(;) - - pre_type(int) ident(width)operator(,) ident(prec)operator(,) ident(flags) operator(=) ident(FNONE)operator(;) - pre_type(int) ident(nextarg) operator(=) integer(1)operator(;) - pre_type(int) ident(posarg) operator(=) integer(0)operator(;) - pre_type(int) ident(tainted) operator(=) integer(0)operator(;) - ident(VALUE) ident(nextvalue)operator(;) - ident(VALUE) ident(tmp)operator(;) - ident(VALUE) ident(str)operator(;) - -preprocessor(#define) ident(CHECK_FOR_WIDTH)operator(()ident(f)operator(\)) \ - reserved(if) operator((()ident(f)operator(\)) operator(&) ident(FWIDTH)operator(\)) operator({) \ - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) \ - operator(}) \ - reserved(if) operator((()ident(f)operator(\)) operator(&) ident(FPREC0)operator(\)) operator({) \ - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) \ - operator(}) -preprocessor(#define) ident(CHECK_FOR_FLAGS)operator(()ident(f)operator(\)) \ - reserved(if) operator((()ident(f)operator(\)) operator(&) ident(FWIDTH)operator(\)) operator({) \ - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) \ - operator(}) \ - reserved(if) operator((()ident(f)operator(\)) operator(&) ident(FPREC0)operator(\)) operator({) \ - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) \ - operator(}) - - operator(++)ident(argc)operator(;) - operator(--)ident(argv)operator(;) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(fmt)operator(\)\)) ident(tainted) operator(=) integer(1)operator(;) - ident(StringValue)operator(()ident(fmt)operator(\);) - ident(fmt) operator(=) ident(rb_str_new4)operator(()ident(fmt)operator(\);) - ident(p) operator(=) ident(RSTRING)operator(()ident(fmt)operator(\)->)ident(ptr)operator(;) - ident(end) operator(=) ident(p) operator(+) ident(RSTRING)operator(()ident(fmt)operator(\)->)ident(len)operator(;) - ident(blen) operator(=) integer(0)operator(;) - ident(bsiz) operator(=) integer(120)operator(;) - ident(result) operator(=) ident(rb_str_buf_new)operator(()ident(bsiz)operator(\);) - ident(buf) operator(=) ident(RSTRING)operator(()ident(result)operator(\)->)ident(ptr)operator(;) - - reserved(for) operator((;) ident(p) operator(<) ident(end)operator(;) ident(p)operator(++\)) operator({) - directive(const) pre_type(char) operator(*)ident(t)operator(;) - pre_type(int) ident(n)operator(;) - - reserved(for) operator(()ident(t) operator(=) ident(p)operator(;) ident(t) operator(<) ident(end) operator(&&) operator(*)ident(t) operator(!=) char('%')operator(;) ident(t)operator(++\)) operator(;) - ident(PUSH)operator(()ident(p)operator(,) ident(t) operator(-) ident(p)operator(\);) - reserved(if) operator(()ident(t) operator(>=) ident(end)operator(\)) operator({) - comment(/* end of fmt string */) - reserved(goto) ident(sprint_exit)operator(;) - operator(}) - ident(p) operator(=) ident(t) operator(+) integer(1)operator(;) comment(/* skip `%' */) - - ident(width) operator(=) ident(prec) operator(=) operator(-)integer(1)operator(;) - ident(nextvalue) operator(=) ident(Qundef)operator(;) - label(retry:) - reserved(switch) operator((*)ident(p)operator(\)) operator({) - reserved(default)operator(:) - reserved(if) operator(()ident(ISPRINT)operator((*)ident(p)operator(\)\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) operator(*)ident(p)operator(\);) - reserved(else) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(break)operator(;) - - reserved(case) char(' ')operator(:) - ident(CHECK_FOR_FLAGS)operator(()ident(flags)operator(\);) - ident(flags) operator(|=) ident(FSPACE)operator(;) - ident(p)operator(++;) - reserved(goto) ident(retry)operator(;) - - reserved(case) char('#')operator(:) - ident(CHECK_FOR_FLAGS)operator(()ident(flags)operator(\);) - ident(flags) operator(|=) ident(FSHARP)operator(;) - ident(p)operator(++;) - reserved(goto) ident(retry)operator(;) - - reserved(case) char('+')operator(:) - ident(CHECK_FOR_FLAGS)operator(()ident(flags)operator(\);) - ident(flags) operator(|=) ident(FPLUS)operator(;) - ident(p)operator(++;) - reserved(goto) ident(retry)operator(;) - - reserved(case) char('-')operator(:) - ident(CHECK_FOR_FLAGS)operator(()ident(flags)operator(\);) - ident(flags) operator(|=) ident(FMINUS)operator(;) - ident(p)operator(++;) - reserved(goto) ident(retry)operator(;) - - reserved(case) char('0')operator(:) - ident(CHECK_FOR_FLAGS)operator(()ident(flags)operator(\);) - ident(flags) operator(|=) ident(FZERO)operator(;) - ident(p)operator(++;) - reserved(goto) ident(retry)operator(;) - - reserved(case) char('1')operator(:) reserved(case) char('2')operator(:) reserved(case) char('3')operator(:) reserved(case) char('4')operator(:) - reserved(case) char('5')operator(:) reserved(case) char('6')operator(:) reserved(case) char('7')operator(:) reserved(case) char('8')operator(:) reserved(case) char('9')operator(:) - ident(n) operator(=) integer(0)operator(;) - ident(GETNUM)operator(()ident(n)operator(,) ident(width)operator(\);) - reserved(if) operator((*)ident(p) operator(==) char('$')operator(\)) operator({) - reserved(if) operator(()ident(nextvalue) operator(!=) ident(Qundef)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(n)operator(\);) - operator(}) - ident(nextvalue) operator(=) ident(GETPOSARG)operator(()ident(n)operator(\);) - ident(p)operator(++;) - reserved(goto) ident(retry)operator(;) - operator(}) - ident(CHECK_FOR_WIDTH)operator(()ident(flags)operator(\);) - ident(width) operator(=) ident(n)operator(;) - ident(flags) operator(|=) ident(FWIDTH)operator(;) - reserved(goto) ident(retry)operator(;) - - reserved(case) char('*')operator(:) - ident(CHECK_FOR_WIDTH)operator(()ident(flags)operator(\);) - ident(flags) operator(|=) ident(FWIDTH)operator(;) - ident(GETASTER)operator(()ident(width)operator(\);) - reserved(if) operator(()ident(width) operator(<) integer(0)operator(\)) operator({) - ident(flags) operator(|=) ident(FMINUS)operator(;) - ident(width) operator(=) operator(-)ident(width)operator(;) - operator(}) - ident(p)operator(++;) - reserved(goto) ident(retry)operator(;) - - reserved(case) char('.')operator(:) - reserved(if) operator(()ident(flags) operator(&) ident(FPREC0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(flags) operator(|=) ident(FPREC)operator(|)ident(FPREC0)operator(;) - - ident(prec) operator(=) integer(0)operator(;) - ident(p)operator(++;) - reserved(if) operator((*)ident(p) operator(==) char('*')operator(\)) operator({) - ident(GETASTER)operator(()ident(prec)operator(\);) - reserved(if) operator(()ident(prec) operator(<) integer(0)operator(\)) operator({) comment(/* ignore negative precision */) - ident(flags) operator(&=) operator(~)ident(FPREC)operator(;) - operator(}) - ident(p)operator(++;) - reserved(goto) ident(retry)operator(;) - operator(}) - - ident(GETNUM)operator(()ident(prec)operator(,) ident(precision)operator(\);) - reserved(goto) ident(retry)operator(;) - - reserved(case) char('\\n')operator(:) - reserved(case) char('\\0')operator(:) - ident(p)operator(--;) - reserved(case) char('%')operator(:) - reserved(if) operator(()ident(flags) operator(!=) ident(FNONE)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(PUSH)operator(()stringoperator(,) integer(1)operator(\);) - reserved(break)operator(;) - - reserved(case) char('c')operator(:) - operator({) - ident(VALUE) ident(val) operator(=) ident(GETARG)operator((\);) - pre_type(char) ident(c)operator(;) - - reserved(if) operator((!()ident(flags) operator(&) ident(FMINUS)operator(\)\)) - reserved(while) operator((--)ident(width) operator(>) integer(0)operator(\)) - ident(PUSH)operator(()stringoperator(,) integer(1)operator(\);) - ident(c) operator(=) ident(NUM2INT)operator(()ident(val)operator(\)) operator(&) hex(0xff)operator(;) - ident(PUSH)operator((&)ident(c)operator(,) integer(1)operator(\);) - reserved(while) operator((--)ident(width) operator(>) integer(0)operator(\)) - ident(PUSH)operator(()stringoperator(,) integer(1)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('s')operator(:) - reserved(case) char('p')operator(:) - operator({) - ident(VALUE) ident(arg) operator(=) ident(GETARG)operator((\);) - pre_type(long) ident(len)operator(;) - - reserved(if) operator((*)ident(p) operator(==) char('p')operator(\)) ident(arg) operator(=) ident(rb_inspect)operator(()ident(arg)operator(\);) - ident(str) operator(=) ident(rb_obj_as_string)operator(()ident(arg)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(str)operator(\)\)) ident(tainted) operator(=) integer(1)operator(;) - ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(flags)operator(&)ident(FPREC)operator(\)) operator({) - reserved(if) operator(()ident(prec) operator(<) ident(len)operator(\)) operator({) - ident(len) operator(=) ident(prec)operator(;) - operator(}) - operator(}) - comment(/* need to adjust multi-byte string pos */) - reserved(if) operator(()ident(flags)operator(&)ident(FWIDTH)operator(\)) operator({) - reserved(if) operator(()ident(width) operator(>) ident(len)operator(\)) operator({) - ident(CHECK)operator(()ident(width)operator(\);) - ident(width) operator(-=) ident(len)operator(;) - reserved(if) operator((!()ident(flags)operator(&)ident(FMINUS)operator(\)\)) operator({) - reserved(while) operator(()ident(width)operator(--\)) operator({) - ident(buf)operator([)ident(blen)operator(++]) operator(=) char(' ')operator(;) - operator(}) - operator(}) - ident(memcpy)operator((&)ident(buf)operator([)ident(blen)operator(],) ident(RSTRING_PTR)operator(()ident(str)operator(\),) ident(len)operator(\);) - ident(blen) operator(+=) ident(len)operator(;) - reserved(if) operator(()ident(flags)operator(&)ident(FMINUS)operator(\)) operator({) - reserved(while) operator(()ident(width)operator(--\)) operator({) - ident(buf)operator([)ident(blen)operator(++]) operator(=) char(' ')operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - operator(}) - operator(}) - ident(PUSH)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) char('d')operator(:) - reserved(case) char('i')operator(:) - reserved(case) char('o')operator(:) - reserved(case) char('x')operator(:) - reserved(case) char('X')operator(:) - reserved(case) char('b')operator(:) - reserved(case) char('B')operator(:) - reserved(case) char('u')operator(:) - operator({) - directive(volatile) ident(VALUE) ident(val) operator(=) ident(GETARG)operator((\);) - pre_type(char) ident(fbuf)operator([)integer(32)operator(],) ident(nbuf)operator([)integer(64)operator(],) operator(*)ident(s)operator(,) operator(*)ident(t)operator(;) - directive(const) pre_type(char) operator(*)ident(prefix) operator(=) integer(0)operator(;) - pre_type(int) ident(sign) operator(=) integer(0)operator(;) - pre_type(char) ident(sc) operator(=) integer(0)operator(;) - pre_type(long) ident(v) operator(=) integer(0)operator(;) - pre_type(int) ident(base)operator(,) ident(bignum) operator(=) integer(0)operator(;) - pre_type(int) ident(len)operator(,) ident(pos)operator(;) - directive(volatile) ident(VALUE) ident(tmp)operator(;) - directive(volatile) ident(VALUE) ident(tmp1)operator(;) - - reserved(switch) operator((*)ident(p)operator(\)) operator({) - reserved(case) char('d')operator(:) - reserved(case) char('i')operator(:) - ident(sign) operator(=) integer(1)operator(;) reserved(break)operator(;) - reserved(case) char('o')operator(:) - reserved(case) char('x')operator(:) - reserved(case) char('X')operator(:) - reserved(case) char('b')operator(:) - reserved(case) char('B')operator(:) - reserved(case) char('u')operator(:) - reserved(default)operator(:) - reserved(if) operator(()ident(flags)operator(&()ident(FPLUS)operator(|)ident(FSPACE)operator(\)\)) ident(sign) operator(=) integer(1)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(flags) operator(&) ident(FSHARP)operator(\)) operator({) - reserved(switch) operator((*)ident(p)operator(\)) operator({) - reserved(case) char('o')operator(:) - ident(prefix) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) char('x')operator(:) - ident(prefix) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) char('X')operator(:) - ident(prefix) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) char('b')operator(:) - ident(prefix) operator(=) stringoperator(;) reserved(break)operator(;) - reserved(case) char('B')operator(:) - ident(prefix) operator(=) stringoperator(;) reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(prefix)operator(\)) operator({) - ident(width) operator(-=) ident(strlen)operator(()ident(prefix)operator(\);) - operator(}) - operator(}) - - label(bin_retry:) - reserved(switch) operator(()ident(TYPE)operator(()ident(val)operator(\)\)) operator({) - reserved(case) ident(T_FLOAT)operator(:) - ident(val) operator(=) ident(rb_dbl2big)operator(()ident(RFLOAT)operator(()ident(val)operator(\)->)ident(value)operator(\);) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(val)operator(\)\)) reserved(goto) ident(bin_retry)operator(;) - ident(bignum) operator(=) integer(1)operator(;) - reserved(break)operator(;) - reserved(case) ident(T_STRING)operator(:) - ident(val) operator(=) ident(rb_str_to_inum)operator(()ident(val)operator(,) integer(0)operator(,) ident(Qtrue)operator(\);) - reserved(goto) ident(bin_retry)operator(;) - reserved(case) ident(T_BIGNUM)operator(:) - ident(bignum) operator(=) integer(1)operator(;) - reserved(break)operator(;) - reserved(case) ident(T_FIXNUM)operator(:) - ident(v) operator(=) ident(FIX2LONG)operator(()ident(val)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(val) operator(=) ident(rb_Integer)operator(()ident(val)operator(\);) - reserved(goto) ident(bin_retry)operator(;) - operator(}) - - reserved(switch) operator((*)ident(p)operator(\)) operator({) - reserved(case) char('o')operator(:) - ident(base) operator(=) integer(8)operator(;) reserved(break)operator(;) - reserved(case) char('x')operator(:) - reserved(case) char('X')operator(:) - ident(base) operator(=) integer(16)operator(;) reserved(break)operator(;) - reserved(case) char('b')operator(:) - reserved(case) char('B')operator(:) - ident(base) operator(=) integer(2)operator(;) reserved(break)operator(;) - reserved(case) char('u')operator(:) - reserved(case) char('d')operator(:) - reserved(case) char('i')operator(:) - reserved(default)operator(:) - ident(base) operator(=) integer(10)operator(;) reserved(break)operator(;) - operator(}) - - reserved(if) operator((!)ident(bignum)operator(\)) operator({) - reserved(if) operator(()ident(base) operator(==) integer(2)operator(\)) operator({) - ident(val) operator(=) ident(rb_int2big)operator(()ident(v)operator(\);) - reserved(goto) ident(bin_retry)operator(;) - operator(}) - reserved(if) operator(()ident(sign)operator(\)) operator({) - pre_type(char) ident(c) operator(=) operator(*)ident(p)operator(;) - reserved(if) operator(()ident(c) operator(==) char('i')operator(\)) ident(c) operator(=) char('d')operator(;) comment(/* %d and %i are identical */) - reserved(if) operator(()ident(v) operator(<) integer(0)operator(\)) operator({) - ident(v) operator(=) operator(-)ident(v)operator(;) - ident(sc) operator(=) char('-')operator(;) - ident(width)operator(--;) - operator(}) - reserved(else) reserved(if) operator(()ident(flags) operator(&) ident(FPLUS)operator(\)) operator({) - ident(sc) operator(=) char('+')operator(;) - ident(width)operator(--;) - operator(}) - reserved(else) reserved(if) operator(()ident(flags) operator(&) ident(FSPACE)operator(\)) operator({) - ident(sc) operator(=) char(' ')operator(;) - ident(width)operator(--;) - operator(}) - ident(sprintf)operator(()ident(fbuf)operator(,) stringoperator(,) ident(c)operator(\);) - ident(sprintf)operator(()ident(nbuf)operator(,) ident(fbuf)operator(,) ident(v)operator(\);) - ident(s) operator(=) ident(nbuf)operator(;) - reserved(goto) ident(format_integer)operator(;) - operator(}) - ident(s) operator(=) ident(nbuf)operator(;) - reserved(if) operator(()ident(v) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(base) operator(==) integer(10)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(\);) - operator(}) - reserved(if) operator((!()ident(flags)operator(&()ident(FPREC)operator(|)ident(FZERO)operator(\)\)\)) operator({) - ident(strcpy)operator(()ident(s)operator(,) stringoperator(\);) - ident(s) operator(+=) integer(2)operator(;) - operator(}) - operator(}) - ident(sprintf)operator(()ident(fbuf)operator(,) stringoperator(,) operator(*)ident(p) operator(==) char('X') operator(?) char('x') operator(:) operator(*)ident(p)operator(\);) - ident(sprintf)operator(()ident(s)operator(,) ident(fbuf)operator(,) ident(v)operator(\);) - reserved(if) operator(()ident(v) operator(<) integer(0)operator(\)) operator({) - pre_type(char) ident(d) operator(=) integer(0)operator(;) - - ident(remove_sign_bits)operator(()ident(s)operator(,) ident(base)operator(\);) - reserved(switch) operator(()ident(base)operator(\)) operator({) - reserved(case) integer(16)operator(:) - ident(d) operator(=) char('f')operator(;) reserved(break)operator(;) - reserved(case) integer(8)operator(:) - ident(d) operator(=) char('7')operator(;) reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(d) operator(&&) operator(*)ident(s) operator(!=) ident(d)operator(\)) operator({) - ident(memmove)operator(()ident(s)operator(+)integer(1)operator(,) ident(s)operator(,) ident(strlen)operator(()ident(s)operator(\)+)integer(1)operator(\);) - operator(*)ident(s) operator(=) ident(d)operator(;) - operator(}) - operator(}) - ident(s) operator(=) ident(nbuf)operator(;) - reserved(goto) ident(format_integer)operator(;) - operator(}) - - reserved(if) operator(()ident(sign)operator(\)) operator({) - ident(tmp) operator(=) ident(rb_big2str)operator(()ident(val)operator(,) ident(base)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(s)operator([)integer(0)operator(]) operator(==) char('-')operator(\)) operator({) - ident(s)operator(++;) - ident(sc) operator(=) char('-')operator(;) - ident(width)operator(--;) - operator(}) - reserved(else) reserved(if) operator(()ident(flags) operator(&) ident(FPLUS)operator(\)) operator({) - ident(sc) operator(=) char('+')operator(;) - ident(width)operator(--;) - operator(}) - reserved(else) reserved(if) operator(()ident(flags) operator(&) ident(FSPACE)operator(\)) operator({) - ident(sc) operator(=) char(' ')operator(;) - ident(width)operator(--;) - operator(}) - reserved(goto) ident(format_integer)operator(;) - operator(}) - reserved(if) operator((!)ident(RBIGNUM)operator(()ident(val)operator(\)->)ident(sign)operator(\)) operator({) - ident(val) operator(=) ident(rb_big_clone)operator(()ident(val)operator(\);) - ident(rb_big_2comp)operator(()ident(val)operator(\);) - operator(}) - ident(tmp1) operator(=) ident(tmp) operator(=) ident(rb_big2str0)operator(()ident(val)operator(,) ident(base)operator(,) ident(RBIGNUM)operator(()ident(val)operator(\)->)ident(sign)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator(;) - reserved(if) operator((*)ident(s) operator(==) char('-')operator(\)) operator({) - reserved(if) operator(()ident(base) operator(==) integer(10)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(\);) - operator(}) - ident(remove_sign_bits)operator((++)ident(s)operator(,) ident(base)operator(\);) - ident(tmp) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) integer(3)operator(+)ident(strlen)operator(()ident(s)operator(\)\);) - ident(t) operator(=) ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator(;) - reserved(if) operator((!()ident(flags)operator(&()ident(FPREC)operator(|)ident(FZERO)operator(\)\)\)) operator({) - ident(strcpy)operator(()ident(t)operator(,) stringoperator(\);) - ident(t) operator(+=) integer(2)operator(;) - operator(}) - reserved(switch) operator(()ident(base)operator(\)) operator({) - reserved(case) integer(16)operator(:) - reserved(if) operator(()ident(s)operator([)integer(0)operator(]) operator(!=) char('f')operator(\)) ident(strcpy)operator(()ident(t)operator(++,) stringoperator(\);) reserved(break)operator(;) - reserved(case) integer(8)operator(:) - reserved(if) operator(()ident(s)operator([)integer(0)operator(]) operator(!=) char('7')operator(\)) ident(strcpy)operator(()ident(t)operator(++,) stringoperator(\);) reserved(break)operator(;) - reserved(case) integer(2)operator(:) - reserved(if) operator(()ident(s)operator([)integer(0)operator(]) operator(!=) char('1')operator(\)) ident(strcpy)operator(()ident(t)operator(++,) stringoperator(\);) reserved(break)operator(;) - operator(}) - ident(strcpy)operator(()ident(t)operator(,) ident(s)operator(\);) - ident(bignum) operator(=) integer(2)operator(;) - operator(}) - ident(s) operator(=) ident(RSTRING)operator(()ident(tmp)operator(\)->)ident(ptr)operator(;) - - label(format_integer:) - ident(pos) operator(=) operator(-)integer(1)operator(;) - ident(len) operator(=) ident(strlen)operator(()ident(s)operator(\);) - - reserved(if) operator((*)ident(p) operator(==) char('X')operator(\)) operator({) - pre_type(char) operator(*)ident(pp) operator(=) ident(s)operator(;) - reserved(while) operator((*)ident(pp)operator(\)) operator({) - operator(*)ident(pp) operator(=) ident(toupper)operator((*)ident(pp)operator(\);) - ident(pp)operator(++;) - operator(}) - operator(}) - reserved(if) operator((()ident(flags)operator(&()ident(FZERO)operator(|)ident(FPREC)operator(\)\)) operator(==) ident(FZERO)operator(\)) operator({) - ident(prec) operator(=) ident(width)operator(;) - ident(width) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(prec) operator(<) ident(len)operator(\)) ident(prec) operator(=) ident(len)operator(;) - ident(width) operator(-=) ident(prec)operator(;) - operator(}) - reserved(if) operator((!()ident(flags)operator(&)ident(FMINUS)operator(\)\)) operator({) - ident(CHECK)operator(()ident(width)operator(\);) - reserved(while) operator(()ident(width)operator(--) operator(>) integer(0)operator(\)) operator({) - ident(buf)operator([)ident(blen)operator(++]) operator(=) char(' ')operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(sc)operator(\)) ident(PUSH)operator((&)ident(sc)operator(,) integer(1)operator(\);) - reserved(if) operator(()ident(prefix)operator(\)) operator({) - pre_type(int) ident(plen) operator(=) ident(strlen)operator(()ident(prefix)operator(\);) - ident(PUSH)operator(()ident(prefix)operator(,) ident(plen)operator(\);) - operator(}) - ident(CHECK)operator(()ident(prec) operator(-) ident(len)operator(\);) - reserved(if) operator((!)ident(bignum) operator(&&) ident(v) operator(<) integer(0)operator(\)) operator({) - pre_type(char) ident(c) operator(=) ident(sign_bits)operator(()ident(base)operator(,) ident(p)operator(\);) - reserved(while) operator(()ident(len) operator(<) ident(prec)operator(--\)) operator({) - ident(buf)operator([)ident(blen)operator(++]) operator(=) ident(c)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - pre_type(char) ident(c)operator(;) - - reserved(if) operator((!)ident(sign) operator(&&) ident(bignum) operator(&&) operator(!)ident(RBIGNUM)operator(()ident(val)operator(\)->)ident(sign)operator(\)) - ident(c) operator(=) ident(sign_bits)operator(()ident(base)operator(,) ident(p)operator(\);) - reserved(else) - ident(c) operator(=) char('0')operator(;) - reserved(while) operator(()ident(len) operator(<) ident(prec)operator(--\)) operator({) - ident(buf)operator([)ident(blen)operator(++]) operator(=) ident(c)operator(;) - operator(}) - operator(}) - ident(PUSH)operator(()ident(s)operator(,) ident(len)operator(\);) - ident(CHECK)operator(()ident(width)operator(\);) - reserved(while) operator(()ident(width)operator(--) operator(>) integer(0)operator(\)) operator({) - ident(buf)operator([)ident(blen)operator(++]) operator(=) char(' ')operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(case) char('f')operator(:) - reserved(case) char('g')operator(:) - reserved(case) char('G')operator(:) - reserved(case) char('e')operator(:) - reserved(case) char('E')operator(:) - operator({) - ident(VALUE) ident(val) operator(=) ident(GETARG)operator((\);) - pre_type(double) ident(fval)operator(;) - pre_type(int) ident(i)operator(,) ident(need) operator(=) integer(6)operator(;) - pre_type(char) ident(fbuf)operator([)integer(32)operator(];) - - ident(fval) operator(=) ident(RFLOAT)operator(()ident(rb_Float)operator(()ident(val)operator(\)\)->)ident(value)operator(;) -preprocessor(#if) ident(defined)operator(()ident(_WIN32)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__BORLANDC__)operator(\)) - reserved(if) operator(()ident(isnan)operator(()ident(fval)operator(\)) operator(||) ident(isinf)operator(()ident(fval)operator(\)\)) operator({) - pre_type(char) operator(*)ident(expr)operator(;) - - reserved(if) operator(()ident(isnan)operator(()ident(fval)operator(\)\)) operator({) - ident(expr) operator(=) stringoperator(;) - operator(}) - reserved(else) operator({) - ident(expr) operator(=) stringoperator(;) - operator(}) - ident(need) operator(=) ident(strlen)operator(()ident(expr)operator(\);) - reserved(if) operator(((!)ident(isnan)operator(()ident(fval)operator(\)) operator(&&) ident(fval) operator(<) float(0)float(.0)operator(\)) operator(||) operator(()ident(flags) operator(&) ident(FPLUS)operator(\)\)) - ident(need)operator(++;) - reserved(else) reserved(if) operator(()ident(flags) operator(&) ident(FSPACE)operator(\)) - ident(need)operator(++;) - reserved(if) operator((()ident(flags) operator(&) ident(FWIDTH)operator(\)) operator(&&) ident(need) operator(<) ident(width)operator(\)) - ident(need) operator(=) ident(width)operator(;) - - ident(CHECK)operator(()ident(need)operator(\);) - ident(sprintf)operator((&)ident(buf)operator([)ident(blen)operator(],) stringoperator(,) ident(need)operator(,) stringoperator(\);) - reserved(if) operator(()ident(flags) operator(&) ident(FMINUS)operator(\)) operator({) - reserved(if) operator((!)ident(isnan)operator(()ident(fval)operator(\)) operator(&&) ident(fval) operator(<) float(0)float(.0)operator(\)) - ident(buf)operator([)ident(blen)operator(++]) operator(=) char('-')operator(;) - reserved(else) reserved(if) operator(()ident(flags) operator(&) ident(FPLUS)operator(\)) - ident(buf)operator([)ident(blen)operator(++]) operator(=) char('+')operator(;) - reserved(else) reserved(if) operator(()ident(flags) operator(&) ident(FSPACE)operator(\)) - ident(blen)operator(++;) - ident(strncpy)operator((&)ident(buf)operator([)ident(blen)operator(],) ident(expr)operator(,) ident(strlen)operator(()ident(expr)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(flags) operator(&) ident(FZERO)operator(\)) operator({) - reserved(if) operator((!)ident(isnan)operator(()ident(fval)operator(\)) operator(&&) ident(fval) operator(<) float(0)float(.0)operator(\)) operator({) - ident(buf)operator([)ident(blen)operator(++]) operator(=) char('-')operator(;) - ident(need)operator(--;) - operator(}) - reserved(else) reserved(if) operator(()ident(flags) operator(&) ident(FPLUS)operator(\)) operator({) - ident(buf)operator([)ident(blen)operator(++]) operator(=) char('+')operator(;) - ident(need)operator(--;) - operator(}) - reserved(else) reserved(if) operator(()ident(flags) operator(&) ident(FSPACE)operator(\)) operator({) - ident(blen)operator(++;) - ident(need)operator(--;) - operator(}) - reserved(while) operator(()ident(need)operator(--) operator(-) ident(strlen)operator(()ident(expr)operator(\)) operator(>) integer(0)operator(\)) operator({) - ident(buf)operator([)ident(blen)operator(++]) operator(=) char('0')operator(;) - operator(}) - ident(strncpy)operator((&)ident(buf)operator([)ident(blen)operator(],) ident(expr)operator(,) ident(strlen)operator(()ident(expr)operator(\)\);) - operator(}) - reserved(else) operator({) - reserved(if) operator((!)ident(isnan)operator(()ident(fval)operator(\)) operator(&&) ident(fval) operator(<) float(0)float(.0)operator(\)) - ident(buf)operator([)ident(blen) operator(+) ident(need) operator(-) ident(strlen)operator(()ident(expr)operator(\)) operator(-) integer(1)operator(]) operator(=) char('-')operator(;) - reserved(else) reserved(if) operator(()ident(flags) operator(&) ident(FPLUS)operator(\)) - ident(buf)operator([)ident(blen) operator(+) ident(need) operator(-) ident(strlen)operator(()ident(expr)operator(\)) operator(-) integer(1)operator(]) operator(=) char('+')operator(;) - ident(strncpy)operator((&)ident(buf)operator([)ident(blen) operator(+) ident(need) operator(-) ident(strlen)operator(()ident(expr)operator(\)],) ident(expr)operator(,) - ident(strlen)operator(()ident(expr)operator(\)\);) - operator(}) - ident(blen) operator(+=) ident(strlen)operator((&)ident(buf)operator([)ident(blen)operator(]\);) - reserved(break)operator(;) - operator(}) -preprocessor(#endif) comment(/* defined(_WIN32\) && !defined(__BORLANDC__\) */) - ident(fmt_setup)operator(()ident(fbuf)operator(,) operator(*)ident(p)operator(,) ident(flags)operator(,) ident(width)operator(,) ident(prec)operator(\);) - ident(need) operator(=) integer(0)operator(;) - reserved(if) operator((*)ident(p) operator(!=) char('e') operator(&&) operator(*)ident(p) operator(!=) char('E')operator(\)) operator({) - ident(i) operator(=) ident(INT_MIN)operator(;) - ident(frexp)operator(()ident(fval)operator(,) operator(&)ident(i)operator(\);) - reserved(if) operator(()ident(i) operator(>) integer(0)operator(\)) - ident(need) operator(=) ident(BIT_DIGITS)operator(()ident(i)operator(\);) - operator(}) - ident(need) operator(+=) operator(()ident(flags)operator(&)ident(FPREC)operator(\)) operator(?) ident(prec) operator(:) integer(6)operator(;) - reserved(if) operator((()ident(flags)operator(&)ident(FWIDTH)operator(\)) operator(&&) ident(need) operator(<) ident(width)operator(\)) - ident(need) operator(=) ident(width)operator(;) - ident(need) operator(+=) integer(20)operator(;) - - ident(CHECK)operator(()ident(need)operator(\);) - ident(sprintf)operator((&)ident(buf)operator([)ident(blen)operator(],) ident(fbuf)operator(,) ident(fval)operator(\);) - ident(blen) operator(+=) ident(strlen)operator((&)ident(buf)operator([)ident(blen)operator(]\);) - operator(}) - reserved(break)operator(;) - operator(}) - ident(flags) operator(=) ident(FNONE)operator(;) - operator(}) - - label(sprint_exit:) - comment(/* XXX - We cannot validiate the number of arguments if (digit\)$ style used. - */) - reserved(if) operator(()ident(posarg) operator(>=) integer(0) operator(&&) ident(nextarg) operator(<) ident(argc)operator(\)) operator({) - directive(const) pre_type(char) operator(*)ident(mesg) operator(=) stringoperator(;) - reserved(if) operator(()ident(RTEST)operator(()ident(ruby_debug)operator(\)\)) ident(rb_raise)operator(()ident(rb_eArgError)operator(,) ident(mesg)operator(\);) - reserved(if) operator(()ident(RTEST)operator(()ident(ruby_verbose)operator(\)\)) ident(rb_warn)operator(()ident(mesg)operator(\);) - operator(}) - ident(rb_str_resize)operator(()ident(result)operator(,) ident(blen)operator(\);) - - reserved(if) operator(()ident(tainted)operator(\)) ident(OBJ_TAINT)operator(()ident(result)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) directive(void) -ident(fmt_setup)operator(()ident(buf)operator(,) ident(c)operator(,) ident(flags)operator(,) ident(width)operator(,) ident(prec)operator(\)) - pre_type(char) operator(*)ident(buf)operator(;) - pre_type(int) ident(c)operator(;) - pre_type(int) ident(flags)operator(,) ident(width)operator(,) ident(prec)operator(;) -operator({) - operator(*)ident(buf)operator(++) operator(=) char('%')operator(;) - reserved(if) operator(()ident(flags) operator(&) ident(FSHARP)operator(\)) operator(*)ident(buf)operator(++) operator(=) char('#')operator(;) - reserved(if) operator(()ident(flags) operator(&) ident(FPLUS)operator(\)) operator(*)ident(buf)operator(++) operator(=) char('+')operator(;) - reserved(if) operator(()ident(flags) operator(&) ident(FMINUS)operator(\)) operator(*)ident(buf)operator(++) operator(=) char('-')operator(;) - reserved(if) operator(()ident(flags) operator(&) ident(FZERO)operator(\)) operator(*)ident(buf)operator(++) operator(=) char('0')operator(;) - reserved(if) operator(()ident(flags) operator(&) ident(FSPACE)operator(\)) operator(*)ident(buf)operator(++) operator(=) char(' ')operator(;) - - reserved(if) operator(()ident(flags) operator(&) ident(FWIDTH)operator(\)) operator({) - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) ident(width)operator(\);) - ident(buf) operator(+=) ident(strlen)operator(()ident(buf)operator(\);) - operator(}) - - reserved(if) operator(()ident(flags) operator(&) ident(FPREC)operator(\)) operator({) - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) ident(prec)operator(\);) - ident(buf) operator(+=) ident(strlen)operator(()ident(buf)operator(\);) - operator(}) - - operator(*)ident(buf)operator(++) operator(=) ident(c)operator(;) - operator(*)ident(buf) operator(=) char('\\0')operator(;) -operator(}) -comment(/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */) - -comment(/* static char sccsid[] = "@(#\) st.c 5.1 89/12/14 Crucible"; */) - -preprocessor(#include) include("config.h") -preprocessor(#include) include("defines.h") -preprocessor(#include) include() -preprocessor(#ifdef) ident(HAVE_STDLIB_H) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#include) include() -preprocessor(#include) include("st.h") - -reserved(typedef) reserved(struct) ident(st_table_entry) ident(st_table_entry)operator(;) - -reserved(struct) ident(st_table_entry) operator({) - pre_type(unsigned) pre_type(int) ident(hash)operator(;) - ident(st_data_t) ident(key)operator(;) - ident(st_data_t) ident(record)operator(;) - ident(st_table_entry) operator(*)ident(next)operator(;) -operator(};) - -preprocessor(#define) ident(ST_DEFAULT_MAX_DENSITY) integer(5) -preprocessor(#define) ident(ST_DEFAULT_INIT_TABLE_SIZE) integer(11) - - comment(/* - * DEFAULT_MAX_DENSITY is the default for the largest we allow the - * average number of items per bin before increasing the number of - * bins - * - * DEFAULT_INIT_TABLE_SIZE is the default for the number of bins - * allocated initially - * - */) -directive(static) pre_type(int) ident(numcmp)operator(()pre_type(long)operator(,) pre_type(long)operator(\);) -directive(static) pre_type(int) ident(numhash)operator(()pre_type(long)operator(\);) -directive(static) reserved(struct) ident(st_hash_type) ident(type_numhash) operator(=) operator({) - ident(numcmp)operator(,) - ident(numhash)operator(,) -operator(};) - -comment(/* extern int strcmp(const char *, const char *\); */) -directive(static) pre_type(int) ident(strhash)operator(()directive(const) pre_type(char) operator(*\);) -directive(static) reserved(struct) ident(st_hash_type) ident(type_strhash) operator(=) operator({) - ident(strcmp)operator(,) - ident(strhash)operator(,) -operator(};) - -directive(static) directive(void) ident(rehash)operator(()ident(st_table) operator(*\);) - -preprocessor(#ifdef) ident(RUBY) -preprocessor(#define) ident(malloc) ident(xmalloc) -preprocessor(#define) ident(calloc) ident(xcalloc) -preprocessor(#endif) - -preprocessor(#define) ident(alloc)operator(()ident(type)operator(\)) operator(()ident(type)operator(*\))ident(malloc)operator((()pre_type(unsigned)operator(\))reserved(sizeof)operator(()ident(type)operator(\)\)) -preprocessor(#define) ident(Calloc)operator(()ident(n)operator(,)ident(s)operator(\)) operator(()pre_type(char)operator(*\))ident(calloc)operator((()ident(n)operator(\),()ident(s)operator(\)\)) - -preprocessor(#define) ident(EQUAL)operator(()ident(table)operator(,)ident(x)operator(,)ident(y)operator(\)) operator((()ident(x)operator(\)==()ident(y)operator(\)) operator(||) operator((*)ident(table)operator(->)ident(type)operator(->)ident(compare)operator(\)(()ident(x)operator(\),()ident(y)operator(\)\)) operator(==) integer(0)operator(\)) - -preprocessor(#define) ident(do_hash)operator(()ident(key)operator(,)ident(table)operator(\)) operator(()pre_type(unsigned) pre_type(int)operator(\)(*()ident(table)operator(\)->)ident(type)operator(->)ident(hash)operator(\)(()ident(key)operator(\)\)) -preprocessor(#define) ident(do_hash_bin)operator(()ident(key)operator(,)ident(table)operator(\)) operator(()ident(do_hash)operator(()ident(key)operator(,) ident(table)operator(\)%()ident(table)operator(\)->)ident(num_bins)operator(\)) - -comment(/* - * MINSIZE is the minimum size of a dictionary. - */) - -preprocessor(#define) ident(MINSIZE) integer(8) - -comment(/* -Table of prime numbers 2^n+a, 2<=n<=30. -*/) -directive(static) pre_type(long) ident(primes)operator([]) operator(=) operator({) - integer(8) operator(+) integer(3)operator(,) - integer(16) operator(+) integer(3)operator(,) - integer(32) operator(+) integer(5)operator(,) - integer(64) operator(+) integer(3)operator(,) - integer(128) operator(+) integer(3)operator(,) - integer(256) operator(+) integer(27)operator(,) - integer(512) operator(+) integer(9)operator(,) - integer(1024) operator(+) integer(9)operator(,) - integer(2048) operator(+) integer(5)operator(,) - integer(4096) operator(+) integer(3)operator(,) - integer(8192) operator(+) integer(27)operator(,) - integer(16384) operator(+) integer(43)operator(,) - integer(32768) operator(+) integer(3)operator(,) - integer(65536) operator(+) integer(45)operator(,) - integer(131072) operator(+) integer(29)operator(,) - integer(262144) operator(+) integer(3)operator(,) - integer(524288) operator(+) integer(21)operator(,) - integer(1048576) operator(+) integer(7)operator(,) - integer(2097152) operator(+) integer(17)operator(,) - integer(4194304) operator(+) integer(15)operator(,) - integer(8388608) operator(+) integer(9)operator(,) - integer(16777216) operator(+) integer(43)operator(,) - integer(33554432) operator(+) integer(35)operator(,) - integer(67108864) operator(+) integer(15)operator(,) - integer(134217728) operator(+) integer(29)operator(,) - integer(268435456) operator(+) integer(3)operator(,) - integer(536870912) operator(+) integer(11)operator(,) - integer(1073741824) operator(+) integer(85)operator(,) - integer(0) -operator(};) - -directive(static) pre_type(int) -ident(new_size)operator(()ident(size)operator(\)) - pre_type(int) ident(size)operator(;) -operator({) - pre_type(int) ident(i)operator(;) - -comment(#if 0 - for (i=3; i<31; i++\) { - if ((1< size\) return 1<) ident(size)operator(\)) reserved(return) ident(primes)operator([)ident(i)operator(];) - operator(}) - comment(/* Ran out of polynomials */) - reserved(return) operator(-)integer(1)operator(;) comment(/* should raise exception */) -preprocessor(#endif) -operator(}) - -preprocessor(#ifdef) ident(HASH_LOG) -directive(static) pre_type(int) ident(collision) operator(=) integer(0)operator(;) -directive(static) pre_type(int) ident(init_st) operator(=) integer(0)operator(;) - -directive(static) directive(void) -ident(stat_col)operator((\)) -operator({) - ident(FILE) operator(*)ident(f) operator(=) ident(fopen)operator(()stringoperator(,) stringoperator(\);) - ident(fprintf)operator(()ident(f)operator(,) stringoperator(,) ident(collision)operator(\);) - ident(fclose)operator(()ident(f)operator(\);) -operator(}) -preprocessor(#endif) - -ident(st_table)operator(*) -ident(st_init_table_with_size)operator(()ident(type)operator(,) ident(size)operator(\)) - reserved(struct) ident(st_hash_type) operator(*)ident(type)operator(;) - pre_type(int) ident(size)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - -preprocessor(#ifdef) ident(HASH_LOG) - reserved(if) operator(()ident(init_st) operator(==) integer(0)operator(\)) operator({) - ident(init_st) operator(=) integer(1)operator(;) - ident(atexit)operator(()ident(stat_col)operator(\);) - operator(}) -preprocessor(#endif) - - ident(size) operator(=) ident(new_size)operator(()ident(size)operator(\);) comment(/* round up to prime number */) - - ident(tbl) operator(=) ident(alloc)operator(()ident(st_table)operator(\);) - ident(tbl)operator(->)ident(type) operator(=) ident(type)operator(;) - ident(tbl)operator(->)ident(num_entries) operator(=) integer(0)operator(;) - ident(tbl)operator(->)ident(num_bins) operator(=) ident(size)operator(;) - ident(tbl)operator(->)ident(bins) operator(=) operator(()ident(st_table_entry) operator(**\))ident(Calloc)operator(()ident(size)operator(,) reserved(sizeof)operator(()ident(st_table_entry)operator(*\)\);) - - reserved(return) ident(tbl)operator(;) -operator(}) - -ident(st_table)operator(*) -ident(st_init_table)operator(()ident(type)operator(\)) - reserved(struct) ident(st_hash_type) operator(*)ident(type)operator(;) -operator({) - reserved(return) ident(st_init_table_with_size)operator(()ident(type)operator(,) integer(0)operator(\);) -operator(}) - -ident(st_table)operator(*) -ident(st_init_numtable)operator(()directive(void)operator(\)) -operator({) - reserved(return) ident(st_init_table)operator((&)ident(type_numhash)operator(\);) -operator(}) - -ident(st_table)operator(*) -ident(st_init_numtable_with_size)operator(()ident(size)operator(\)) - pre_type(int) ident(size)operator(;) -operator({) - reserved(return) ident(st_init_table_with_size)operator((&)ident(type_numhash)operator(,) ident(size)operator(\);) -operator(}) - -ident(st_table)operator(*) -ident(st_init_strtable)operator(()directive(void)operator(\)) -operator({) - reserved(return) ident(st_init_table)operator((&)ident(type_strhash)operator(\);) -operator(}) - -ident(st_table)operator(*) -ident(st_init_strtable_with_size)operator(()ident(size)operator(\)) - pre_type(int) ident(size)operator(;) -operator({) - reserved(return) ident(st_init_table_with_size)operator((&)ident(type_strhash)operator(,) ident(size)operator(\);) -operator(}) - -directive(void) -ident(st_free_table)operator(()ident(table)operator(\)) - ident(st_table) operator(*)ident(table)operator(;) -operator({) - directive(register) ident(st_table_entry) operator(*)ident(ptr)operator(,) operator(*)ident(next)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(for)operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(table)operator(->)ident(num_bins)operator(;) ident(i)operator(++\)) operator({) - ident(ptr) operator(=) ident(table)operator(->)ident(bins)operator([)ident(i)operator(];) - reserved(while) operator(()ident(ptr) operator(!=) integer(0)operator(\)) operator({) - ident(next) operator(=) ident(ptr)operator(->)ident(next)operator(;) - ident(free)operator(()ident(ptr)operator(\);) - ident(ptr) operator(=) ident(next)operator(;) - operator(}) - operator(}) - ident(free)operator(()ident(table)operator(->)ident(bins)operator(\);) - ident(free)operator(()ident(table)operator(\);) -operator(}) - -preprocessor(#define) ident(PTR_NOT_EQUAL)operator(()ident(table)operator(,) ident(ptr)operator(,) ident(hash_val)operator(,) ident(key)operator(\)) \ -operator((()ident(ptr)operator(\)) operator(!=) integer(0) operator(&&) operator(()ident(ptr)operator(->)ident(hash) operator(!=) operator(()ident(hash_val)operator(\)) operator(||) operator(!)ident(EQUAL)operator((()ident(table)operator(\),) operator(()ident(key)operator(\),) operator(()ident(ptr)operator(\)->)ident(key)operator(\)\)\)) - -preprocessor(#ifdef) ident(HASH_LOG) -preprocessor(#define) ident(COLLISION) ident(collision)operator(++) -preprocessor(#else) -preprocessor(#define) ident(COLLISION) -preprocessor(#endif) - -preprocessor(#define) ident(FIND_ENTRY)operator(()ident(table)operator(,) ident(ptr)operator(,) ident(hash_val)operator(,) ident(bin_pos)operator(\)) reserved(do) operator({)\ - ident(bin_pos) operator(=) ident(hash_val)operator(%()ident(table)operator(\)->)ident(num_bins)operator(;)\ - ident(ptr) operator(=) operator(()ident(table)operator(\)->)ident(bins)operator([)ident(bin_pos)operator(];)\ - reserved(if) operator(()ident(PTR_NOT_EQUAL)operator(()ident(table)operator(,) ident(ptr)operator(,) ident(hash_val)operator(,) ident(key)operator(\)\)) operator({)\ - ident(COLLISION)operator(;)\ - reserved(while) operator(()ident(PTR_NOT_EQUAL)operator(()ident(table)operator(,) ident(ptr)operator(->)ident(next)operator(,) ident(hash_val)operator(,) ident(key)operator(\)\)) operator({)\ - ident(ptr) operator(=) ident(ptr)operator(->)ident(next)operator(;)\ - operator(})\ - ident(ptr) operator(=) ident(ptr)operator(->)ident(next)operator(;)\ - operator(})\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -pre_type(int) -ident(st_lookup)operator(()ident(table)operator(,) ident(key)operator(,) ident(value)operator(\)) - ident(st_table) operator(*)ident(table)operator(;) - directive(register) ident(st_data_t) ident(key)operator(;) - ident(st_data_t) operator(*)ident(value)operator(;) -operator({) - pre_type(unsigned) pre_type(int) ident(hash_val)operator(,) ident(bin_pos)operator(;) - directive(register) ident(st_table_entry) operator(*)ident(ptr)operator(;) - - ident(hash_val) operator(=) ident(do_hash)operator(()ident(key)operator(,) ident(table)operator(\);) - ident(FIND_ENTRY)operator(()ident(table)operator(,) ident(ptr)operator(,) ident(hash_val)operator(,) ident(bin_pos)operator(\);) - - reserved(if) operator(()ident(ptr) operator(==) integer(0)operator(\)) operator({) - reserved(return) integer(0)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(value) operator(!=) integer(0)operator(\)) operator(*)ident(value) operator(=) ident(ptr)operator(->)ident(record)operator(;) - reserved(return) integer(1)operator(;) - operator(}) -operator(}) - -preprocessor(#define) ident(ADD_DIRECT)operator(()ident(table)operator(,) ident(key)operator(,) ident(value)operator(,) ident(hash_val)operator(,) ident(bin_pos)operator(\))\ -reserved(do) operator({)\ - ident(st_table_entry) operator(*)ident(entry)operator(;)\ - reserved(if) operator(()ident(table)operator(->)ident(num_entries)operator(/)operator(()ident(table)operator(->)ident(num_bins)operator(\)) operator(>) ident(ST_DEFAULT_MAX_DENSITY)operator(\)) operator({)\ - ident(rehash)operator(()ident(table)operator(\);)\ - ident(bin_pos) operator(=) ident(hash_val) operator(%) ident(table)operator(->)ident(num_bins)operator(;)\ - operator(})\ - \ - ident(entry) operator(=) ident(alloc)operator(()ident(st_table_entry)operator(\);)\ - \ - ident(entry)operator(->)ident(hash) operator(=) ident(hash_val)operator(;)\ - ident(entry)operator(->)ident(key) operator(=) ident(key)operator(;)\ - ident(entry)operator(->)ident(record) operator(=) ident(value)operator(;)\ - ident(entry)operator(->)ident(next) operator(=) ident(table)operator(->)ident(bins)operator([)ident(bin_pos)operator(];)\ - ident(table)operator(->)ident(bins)operator([)ident(bin_pos)operator(]) operator(=) ident(entry)operator(;)\ - ident(table)operator(->)ident(num_entries)operator(++;)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -pre_type(int) -ident(st_insert)operator(()ident(table)operator(,) ident(key)operator(,) ident(value)operator(\)) - directive(register) ident(st_table) operator(*)ident(table)operator(;) - directive(register) ident(st_data_t) ident(key)operator(;) - ident(st_data_t) ident(value)operator(;) -operator({) - pre_type(unsigned) pre_type(int) ident(hash_val)operator(,) ident(bin_pos)operator(;) - directive(register) ident(st_table_entry) operator(*)ident(ptr)operator(;) - - ident(hash_val) operator(=) ident(do_hash)operator(()ident(key)operator(,) ident(table)operator(\);) - ident(FIND_ENTRY)operator(()ident(table)operator(,) ident(ptr)operator(,) ident(hash_val)operator(,) ident(bin_pos)operator(\);) - - reserved(if) operator(()ident(ptr) operator(==) integer(0)operator(\)) operator({) - ident(ADD_DIRECT)operator(()ident(table)operator(,) ident(key)operator(,) ident(value)operator(,) ident(hash_val)operator(,) ident(bin_pos)operator(\);) - reserved(return) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(ptr)operator(->)ident(record) operator(=) ident(value)operator(;) - reserved(return) integer(1)operator(;) - operator(}) -operator(}) - -directive(void) -ident(st_add_direct)operator(()ident(table)operator(,) ident(key)operator(,) ident(value)operator(\)) - ident(st_table) operator(*)ident(table)operator(;) - ident(st_data_t) ident(key)operator(;) - ident(st_data_t) ident(value)operator(;) -operator({) - pre_type(unsigned) pre_type(int) ident(hash_val)operator(,) ident(bin_pos)operator(;) - - ident(hash_val) operator(=) ident(do_hash)operator(()ident(key)operator(,) ident(table)operator(\);) - ident(bin_pos) operator(=) ident(hash_val) operator(%) ident(table)operator(->)ident(num_bins)operator(;) - ident(ADD_DIRECT)operator(()ident(table)operator(,) ident(key)operator(,) ident(value)operator(,) ident(hash_val)operator(,) ident(bin_pos)operator(\);) -operator(}) - -directive(static) directive(void) -ident(rehash)operator(()ident(table)operator(\)) - directive(register) ident(st_table) operator(*)ident(table)operator(;) -operator({) - directive(register) ident(st_table_entry) operator(*)ident(ptr)operator(,) operator(*)ident(next)operator(,) operator(**)ident(new_bins)operator(;) - pre_type(int) ident(i)operator(,) ident(old_num_bins) operator(=) ident(table)operator(->)ident(num_bins)operator(,) ident(new_num_bins)operator(;) - pre_type(unsigned) pre_type(int) ident(hash_val)operator(;) - - ident(new_num_bins) operator(=) ident(new_size)operator(()ident(old_num_bins)operator(+)integer(1)operator(\);) - ident(new_bins) operator(=) operator(()ident(st_table_entry)operator(**\))ident(Calloc)operator(()ident(new_num_bins)operator(,) reserved(sizeof)operator(()ident(st_table_entry)operator(*\)\);) - - reserved(for)operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(old_num_bins)operator(;) ident(i)operator(++\)) operator({) - ident(ptr) operator(=) ident(table)operator(->)ident(bins)operator([)ident(i)operator(];) - reserved(while) operator(()ident(ptr) operator(!=) integer(0)operator(\)) operator({) - ident(next) operator(=) ident(ptr)operator(->)ident(next)operator(;) - ident(hash_val) operator(=) ident(ptr)operator(->)ident(hash) operator(%) ident(new_num_bins)operator(;) - ident(ptr)operator(->)ident(next) operator(=) ident(new_bins)operator([)ident(hash_val)operator(];) - ident(new_bins)operator([)ident(hash_val)operator(]) operator(=) ident(ptr)operator(;) - ident(ptr) operator(=) ident(next)operator(;) - operator(}) - operator(}) - ident(free)operator(()ident(table)operator(->)ident(bins)operator(\);) - ident(table)operator(->)ident(num_bins) operator(=) ident(new_num_bins)operator(;) - ident(table)operator(->)ident(bins) operator(=) ident(new_bins)operator(;) -operator(}) - -ident(st_table)operator(*) -ident(st_copy)operator(()ident(old_table)operator(\)) - ident(st_table) operator(*)ident(old_table)operator(;) -operator({) - ident(st_table) operator(*)ident(new_table)operator(;) - ident(st_table_entry) operator(*)ident(ptr)operator(,) operator(*)ident(entry)operator(;) - pre_type(int) ident(i)operator(,) ident(num_bins) operator(=) ident(old_table)operator(->)ident(num_bins)operator(;) - - ident(new_table) operator(=) ident(alloc)operator(()ident(st_table)operator(\);) - reserved(if) operator(()ident(new_table) operator(==) integer(0)operator(\)) operator({) - reserved(return) integer(0)operator(;) - operator(}) - - operator(*)ident(new_table) operator(=) operator(*)ident(old_table)operator(;) - ident(new_table)operator(->)ident(bins) operator(=) operator(()ident(st_table_entry)operator(**\)) - ident(Calloc)operator((()pre_type(unsigned)operator(\))ident(num_bins)operator(,) reserved(sizeof)operator(()ident(st_table_entry)operator(*\)\);) - - reserved(if) operator(()ident(new_table)operator(->)ident(bins) operator(==) integer(0)operator(\)) operator({) - ident(free)operator(()ident(new_table)operator(\);) - reserved(return) integer(0)operator(;) - operator(}) - - reserved(for)operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(num_bins)operator(;) ident(i)operator(++\)) operator({) - ident(new_table)operator(->)ident(bins)operator([)ident(i)operator(]) operator(=) integer(0)operator(;) - ident(ptr) operator(=) ident(old_table)operator(->)ident(bins)operator([)ident(i)operator(];) - reserved(while) operator(()ident(ptr) operator(!=) integer(0)operator(\)) operator({) - ident(entry) operator(=) ident(alloc)operator(()ident(st_table_entry)operator(\);) - reserved(if) operator(()ident(entry) operator(==) integer(0)operator(\)) operator({) - ident(free)operator(()ident(new_table)operator(->)ident(bins)operator(\);) - ident(free)operator(()ident(new_table)operator(\);) - reserved(return) integer(0)operator(;) - operator(}) - operator(*)ident(entry) operator(=) operator(*)ident(ptr)operator(;) - ident(entry)operator(->)ident(next) operator(=) ident(new_table)operator(->)ident(bins)operator([)ident(i)operator(];) - ident(new_table)operator(->)ident(bins)operator([)ident(i)operator(]) operator(=) ident(entry)operator(;) - ident(ptr) operator(=) ident(ptr)operator(->)ident(next)operator(;) - operator(}) - operator(}) - reserved(return) ident(new_table)operator(;) -operator(}) - -pre_type(int) -ident(st_delete)operator(()ident(table)operator(,) ident(key)operator(,) ident(value)operator(\)) - directive(register) ident(st_table) operator(*)ident(table)operator(;) - directive(register) ident(st_data_t) operator(*)ident(key)operator(;) - ident(st_data_t) operator(*)ident(value)operator(;) -operator({) - pre_type(unsigned) pre_type(int) ident(hash_val)operator(;) - ident(st_table_entry) operator(*)ident(tmp)operator(;) - directive(register) ident(st_table_entry) operator(*)ident(ptr)operator(;) - - ident(hash_val) operator(=) ident(do_hash_bin)operator((*)ident(key)operator(,) ident(table)operator(\);) - ident(ptr) operator(=) ident(table)operator(->)ident(bins)operator([)ident(hash_val)operator(];) - - reserved(if) operator(()ident(ptr) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(value) operator(!=) integer(0)operator(\)) operator(*)ident(value) operator(=) integer(0)operator(;) - reserved(return) integer(0)operator(;) - operator(}) - - reserved(if) operator(()ident(EQUAL)operator(()ident(table)operator(,) operator(*)ident(key)operator(,) ident(ptr)operator(->)ident(key)operator(\)\)) operator({) - ident(table)operator(->)ident(bins)operator([)ident(hash_val)operator(]) operator(=) ident(ptr)operator(->)ident(next)operator(;) - ident(table)operator(->)ident(num_entries)operator(--;) - reserved(if) operator(()ident(value) operator(!=) integer(0)operator(\)) operator(*)ident(value) operator(=) ident(ptr)operator(->)ident(record)operator(;) - operator(*)ident(key) operator(=) ident(ptr)operator(->)ident(key)operator(;) - ident(free)operator(()ident(ptr)operator(\);) - reserved(return) integer(1)operator(;) - operator(}) - - reserved(for)operator((;) ident(ptr)operator(->)ident(next) operator(!=) integer(0)operator(;) ident(ptr) operator(=) ident(ptr)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator(()ident(EQUAL)operator(()ident(table)operator(,) ident(ptr)operator(->)ident(next)operator(->)ident(key)operator(,) operator(*)ident(key)operator(\)\)) operator({) - ident(tmp) operator(=) ident(ptr)operator(->)ident(next)operator(;) - ident(ptr)operator(->)ident(next) operator(=) ident(ptr)operator(->)ident(next)operator(->)ident(next)operator(;) - ident(table)operator(->)ident(num_entries)operator(--;) - reserved(if) operator(()ident(value) operator(!=) integer(0)operator(\)) operator(*)ident(value) operator(=) ident(tmp)operator(->)ident(record)operator(;) - operator(*)ident(key) operator(=) ident(tmp)operator(->)ident(key)operator(;) - ident(free)operator(()ident(tmp)operator(\);) - reserved(return) integer(1)operator(;) - operator(}) - operator(}) - - reserved(return) integer(0)operator(;) -operator(}) - -pre_type(int) -ident(st_delete_safe)operator(()ident(table)operator(,) ident(key)operator(,) ident(value)operator(,) ident(never)operator(\)) - directive(register) ident(st_table) operator(*)ident(table)operator(;) - directive(register) ident(st_data_t) operator(*)ident(key)operator(;) - ident(st_data_t) operator(*)ident(value)operator(;) - ident(st_data_t) ident(never)operator(;) -operator({) - pre_type(unsigned) pre_type(int) ident(hash_val)operator(;) - directive(register) ident(st_table_entry) operator(*)ident(ptr)operator(;) - - ident(hash_val) operator(=) ident(do_hash_bin)operator((*)ident(key)operator(,) ident(table)operator(\);) - ident(ptr) operator(=) ident(table)operator(->)ident(bins)operator([)ident(hash_val)operator(];) - - reserved(if) operator(()ident(ptr) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(value) operator(!=) integer(0)operator(\)) operator(*)ident(value) operator(=) integer(0)operator(;) - reserved(return) integer(0)operator(;) - operator(}) - - reserved(for)operator((;) ident(ptr) operator(!=) integer(0)operator(;) ident(ptr) operator(=) ident(ptr)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator((()ident(ptr)operator(->)ident(key) operator(!=) ident(never)operator(\)) operator(&&) ident(EQUAL)operator(()ident(table)operator(,) ident(ptr)operator(->)ident(key)operator(,) operator(*)ident(key)operator(\)\)) operator({) - ident(table)operator(->)ident(num_entries)operator(--;) - operator(*)ident(key) operator(=) ident(ptr)operator(->)ident(key)operator(;) - reserved(if) operator(()ident(value) operator(!=) integer(0)operator(\)) operator(*)ident(value) operator(=) ident(ptr)operator(->)ident(record)operator(;) - ident(ptr)operator(->)ident(key) operator(=) ident(ptr)operator(->)ident(record) operator(=) ident(never)operator(;) - reserved(return) integer(1)operator(;) - operator(}) - operator(}) - - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(delete_never)operator(()ident(key)operator(,) ident(value)operator(,) ident(never)operator(\)) - ident(st_data_t) ident(key)operator(,) ident(value)operator(,) ident(never)operator(;) -operator({) - reserved(if) operator(()ident(value) operator(==) ident(never)operator(\)) reserved(return) ident(ST_DELETE)operator(;) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(void) -ident(st_cleanup_safe)operator(()ident(table)operator(,) ident(never)operator(\)) - ident(st_table) operator(*)ident(table)operator(;) - ident(st_data_t) ident(never)operator(;) -operator({) - pre_type(int) ident(num_entries) operator(=) ident(table)operator(->)ident(num_entries)operator(;) - - ident(st_foreach)operator(()ident(table)operator(,) ident(delete_never)operator(,) ident(never)operator(\);) - ident(table)operator(->)ident(num_entries) operator(=) ident(num_entries)operator(;) -operator(}) - -pre_type(int) -ident(st_foreach)operator(()ident(table)operator(,) ident(func)operator(,) ident(arg)operator(\)) - ident(st_table) operator(*)ident(table)operator(;) - pre_type(int) operator((*)ident(func)operator(\)(\);) - ident(st_data_t) ident(arg)operator(;) -operator({) - ident(st_table_entry) operator(*)ident(ptr)operator(,) operator(*)ident(last)operator(,) operator(*)ident(tmp)operator(;) - reserved(enum) ident(st_retval) ident(retval)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(for)operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(table)operator(->)ident(num_bins)operator(;) ident(i)operator(++\)) operator({) - ident(last) operator(=) integer(0)operator(;) - reserved(for)operator(()ident(ptr) operator(=) ident(table)operator(->)ident(bins)operator([)ident(i)operator(];) ident(ptr) operator(!=) integer(0)operator(;\)) operator({) - ident(retval) operator(=) operator((*)ident(func)operator(\)()ident(ptr)operator(->)ident(key)operator(,) ident(ptr)operator(->)ident(record)operator(,) ident(arg)operator(\);) - reserved(switch) operator(()ident(retval)operator(\)) operator({) - reserved(case) ident(ST_CHECK)operator(:) comment(/* check if hash is modified during iteration */) - ident(tmp) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(i) operator(<) ident(table)operator(->)ident(num_bins)operator(\)) operator({) - reserved(for) operator(()ident(tmp) operator(=) ident(table)operator(->)ident(bins)operator([)ident(i)operator(];) ident(tmp)operator(;) ident(tmp)operator(=)ident(tmp)operator(->)ident(next)operator(\)) operator({) - reserved(if) operator(()ident(tmp) operator(==) ident(ptr)operator(\)) reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator((!)ident(tmp)operator(\)) operator({) - comment(/* call func with error notice */) - reserved(return) integer(1)operator(;) - operator(}) - comment(/* fall through */) - reserved(case) ident(ST_CONTINUE)operator(:) - ident(last) operator(=) ident(ptr)operator(;) - ident(ptr) operator(=) ident(ptr)operator(->)ident(next)operator(;) - reserved(break)operator(;) - reserved(case) ident(ST_STOP)operator(:) - reserved(return) integer(0)operator(;) - reserved(case) ident(ST_DELETE)operator(:) - ident(tmp) operator(=) ident(ptr)operator(;) - reserved(if) operator(()ident(last) operator(==) integer(0)operator(\)) operator({) - ident(table)operator(->)ident(bins)operator([)ident(i)operator(]) operator(=) ident(ptr)operator(->)ident(next)operator(;) - operator(}) - reserved(else) operator({) - ident(last)operator(->)ident(next) operator(=) ident(ptr)operator(->)ident(next)operator(;) - operator(}) - ident(ptr) operator(=) ident(ptr)operator(->)ident(next)operator(;) - ident(free)operator(()ident(tmp)operator(\);) - ident(table)operator(->)ident(num_entries)operator(--;) - operator(}) - operator(}) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(strhash)operator(()ident(string)operator(\)) - directive(register) directive(const) pre_type(char) operator(*)ident(string)operator(;) -operator({) - directive(register) pre_type(int) ident(c)operator(;) - -preprocessor(#ifdef) ident(HASH_ELFHASH) - directive(register) pre_type(unsigned) pre_type(int) ident(h) operator(=) integer(0)operator(,) ident(g)operator(;) - - reserved(while) operator((()ident(c) operator(=) operator(*)ident(string)operator(++\)) operator(!=) char('\\0')operator(\)) operator({) - ident(h) operator(=) operator(() ident(h) operator(<<) integer(4) operator(\)) operator(+) ident(c)operator(;) - reserved(if) operator(() ident(g) operator(=) ident(h) operator(&) hex(0xF0000000) operator(\)) - ident(h) operator(^=) ident(g) operator(>>) integer(24)operator(;) - ident(h) operator(&=) operator(~)ident(g)operator(;) - operator(}) - reserved(return) ident(h)operator(;) -preprocessor(#elif) ident(defined)operator(()ident(HASH_PERL)operator(\)) - directive(register) pre_type(int) ident(val) operator(=) integer(0)operator(;) - - reserved(while) operator((()ident(c) operator(=) operator(*)ident(string)operator(++\)) operator(!=) char('\\0')operator(\)) operator({) - ident(val) operator(+=) ident(c)operator(;) - ident(val) operator(+=) operator(()ident(val) operator(<<) integer(10)operator(\);) - ident(val) operator(^=) operator(()ident(val) operator(>>) integer(6)operator(\);) - operator(}) - ident(val) operator(+=) operator(()ident(val) operator(<<) integer(3)operator(\);) - ident(val) operator(^=) operator(()ident(val) operator(>>) integer(11)operator(\);) - - reserved(return) ident(val) operator(+) operator(()ident(val) operator(<<) integer(15)operator(\);) -preprocessor(#else) - directive(register) pre_type(int) ident(val) operator(=) integer(0)operator(;) - - reserved(while) operator((()ident(c) operator(=) operator(*)ident(string)operator(++\)) operator(!=) char('\\0')operator(\)) operator({) - ident(val) operator(=) ident(val)operator(*)integer(997) operator(+) ident(c)operator(;) - operator(}) - - reserved(return) ident(val) operator(+) operator(()ident(val)operator(>>)integer(5)operator(\);) -preprocessor(#endif) -operator(}) - -directive(static) pre_type(int) -ident(numcmp)operator(()ident(x)operator(,) ident(y)operator(\)) - pre_type(long) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(return) ident(x) operator(!=) ident(y)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(numhash)operator(()ident(n)operator(\)) - pre_type(long) ident(n)operator(;) -operator({) - reserved(return) ident(n)operator(;) -operator(}) -comment(/********************************************************************** - - string.c - - - $Author: shyouhei $ - $Date: 2009-02-17 03:58:28 +0100 (Tue, 17 Feb 2009\) $ - created at: Mon Aug 9 17:12:58 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("re.h") - -preprocessor(#define) ident(BEG)operator(()ident(no)operator(\)) ident(regs)operator(->)ident(beg)operator([)ident(no)operator(]) -preprocessor(#define) ident(END)operator(()ident(no)operator(\)) ident(regs)operator(->)ident(end)operator([)ident(no)operator(]) - -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#ifdef) ident(HAVE_UNISTD_H) -preprocessor(#include) include() -preprocessor(#endif) - -ident(VALUE) ident(rb_cString)operator(;) - -preprocessor(#define) ident(STR_TMPLOCK) ident(FL_USER1) -preprocessor(#define) ident(STR_ASSOC) ident(FL_USER3) -preprocessor(#define) ident(STR_NOCAPA) operator(()ident(ELTS_SHARED)operator(|)ident(STR_ASSOC)operator(\)) - -preprocessor(#define) ident(RESIZE_CAPA)operator(()ident(str)operator(,)ident(capacity)operator(\)) reserved(do) operator({)\ - ident(REALLOC_N)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) pre_type(char)operator(,) operator(()ident(capacity)operator(\)+)integer(1)operator(\);)\ - reserved(if) operator((!)ident(FL_TEST)operator(()ident(str)operator(,) ident(STR_NOCAPA)operator(\)\))\ - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) operator(()ident(capacity)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -ident(VALUE) ident(rb_fs)operator(;) - -directive(static) directive(inline) directive(void) -ident(str_mod_check)operator(()ident(s)operator(,) ident(p)operator(,) ident(len)operator(\)) - ident(VALUE) ident(s)operator(;) - pre_type(char) operator(*)ident(p)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(s)operator(\)->)ident(ptr) operator(!=) ident(p) operator(||) ident(RSTRING)operator(()ident(s)operator(\)->)ident(len) operator(!=) ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) -operator(}) - -directive(static) directive(inline) directive(void) -ident(str_frozen_check)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(s)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) -operator(}) - -directive(static) ident(VALUE) ident(str_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(str_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(NEWOBJ)operator(()ident(str)operator(,) reserved(struct) ident(RString)operator(\);) - ident(OBJSETUP)operator(()ident(str)operator(,) ident(klass)operator(,) ident(T_STRING)operator(\);) - - ident(str)operator(->)ident(ptr) operator(=) integer(0)operator(;) - ident(str)operator(->)ident(len) operator(=) integer(0)operator(;) - ident(str)operator(->)ident(aux)operator(.)ident(capa) operator(=) integer(0)operator(;) - - reserved(return) operator(()ident(VALUE)operator(\))ident(str)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(str_new)operator(()ident(klass)operator(,) ident(ptr)operator(,) ident(len)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - ident(str) operator(=) ident(str_alloc)operator(()ident(klass)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(len)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(len)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(=) ident(ALLOC_N)operator(()pre_type(char)operator(,)ident(len)operator(+)integer(1)operator(\);) - reserved(if) operator(()ident(ptr)operator(\)) operator({) - ident(memcpy)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(ptr)operator(,) ident(len)operator(\);) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(len)operator(]) operator(=) char('\\0')operator(;) - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_new)operator(()ident(ptr)operator(,) ident(len)operator(\)) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - reserved(return) ident(str_new)operator(()ident(rb_cString)operator(,) ident(ptr)operator(,) ident(len)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_str_new2)operator(()ident(ptr)operator(\)) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) -operator({) - reserved(if) operator((!)ident(ptr)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(rb_str_new)operator(()ident(ptr)operator(,) ident(strlen)operator(()ident(ptr)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_tainted_str_new)operator(()ident(ptr)operator(,) ident(len)operator(\)) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(rb_str_new)operator(()ident(ptr)operator(,) ident(len)operator(\);) - - ident(OBJ_TAINT)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_tainted_str_new2)operator(()ident(ptr)operator(\)) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(rb_str_new2)operator(()ident(ptr)operator(\);) - - ident(OBJ_TAINT)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(str_new3)operator(()ident(klass)operator(,) ident(str)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(str)operator(;) -operator({) - ident(VALUE) ident(str2) operator(=) ident(str_alloc)operator(()ident(klass)operator(\);) - - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(aux)operator(.)ident(shared) operator(=) ident(str)operator(;) - ident(FL_SET)operator(()ident(str2)operator(,) ident(ELTS_SHARED)operator(\);) - - reserved(return) ident(str2)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_new3)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(str2) operator(=) ident(str_new3)operator(()ident(rb_obj_class)operator(()ident(str)operator(\),) ident(str)operator(\);) - - ident(OBJ_INFECT)operator(()ident(str2)operator(,) ident(str)operator(\);) - reserved(return) ident(str2)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(str_new4)operator(()ident(klass)operator(,) ident(str)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(str)operator(;) -operator({) - ident(VALUE) ident(str2) operator(=) ident(str_alloc)operator(()ident(klass)operator(\);) - - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str)operator(,) ident(ELTS_SHARED)operator(\)\)) operator({) - ident(FL_SET)operator(()ident(str2)operator(,) ident(ELTS_SHARED)operator(\);) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(aux)operator(.)ident(shared) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(shared)operator(;) - operator(}) - reserved(else) operator({) - ident(FL_SET)operator(()ident(str)operator(,) ident(ELTS_SHARED)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(shared) operator(=) ident(str2)operator(;) - operator(}) - - reserved(return) ident(str2)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_new4)operator(()ident(orig)operator(\)) - ident(VALUE) ident(orig)operator(;) -operator({) - ident(VALUE) ident(klass)operator(,) ident(str)operator(;) - - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(orig)operator(\)\)) reserved(return) ident(orig)operator(;) - ident(klass) operator(=) ident(rb_obj_class)operator(()ident(orig)operator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(orig)operator(,) ident(ELTS_SHARED)operator(\)) operator(&&) operator(()ident(str) operator(=) ident(RSTRING)operator(()ident(orig)operator(\)->)ident(aux)operator(.)ident(shared)operator(\)) operator(&&) ident(klass) operator(==) ident(RBASIC)operator(()ident(str)operator(\)->)ident(klass)operator(\)) operator({) - pre_type(long) ident(ofs)operator(;) - ident(ofs) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(RSTRING)operator(()ident(orig)operator(\)->)ident(len)operator(;) - reserved(if) operator((()ident(ofs) operator(>) integer(0)operator(\)) operator(||) operator((!)ident(OBJ_TAINTED)operator(()ident(str)operator(\)) operator(&&) ident(OBJ_TAINTED)operator(()ident(orig)operator(\)\)\)) operator({) - ident(str) operator(=) ident(str_new3)operator(()ident(klass)operator(,) ident(str)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+=) ident(ofs)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-=) ident(ofs)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(FL_TEST)operator(()ident(orig)operator(,) ident(STR_ASSOC)operator(\)\)) operator({) - ident(str) operator(=) ident(str_new)operator(()ident(klass)operator(,) ident(RSTRING)operator(()ident(orig)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(orig)operator(\)->)ident(len)operator(\);) - operator(}) - reserved(else) operator({) - ident(str) operator(=) ident(str_new4)operator(()ident(klass)operator(,) ident(orig)operator(\);) - operator(}) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(orig)operator(\);) - ident(OBJ_FREEZE)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_new5)operator(()ident(obj)operator(,) ident(ptr)operator(,) ident(len)operator(\)) - ident(VALUE) ident(obj)operator(;) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - reserved(return) ident(str_new)operator(()ident(rb_obj_class)operator(()ident(obj)operator(\),) ident(ptr)operator(,) ident(len)operator(\);) -operator(}) - -preprocessor(#define) ident(STR_BUF_MIN_SIZE) integer(128) - -ident(VALUE) -ident(rb_str_buf_new)operator(()ident(capa)operator(\)) - pre_type(long) ident(capa)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(str_alloc)operator(()ident(rb_cString)operator(\);) - - reserved(if) operator(()ident(capa) operator(<) ident(STR_BUF_MIN_SIZE)operator(\)) operator({) - ident(capa) operator(=) ident(STR_BUF_MIN_SIZE)operator(;) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(=) integer(0)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) integer(0)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(capa)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(=) ident(ALLOC_N)operator(()pre_type(char)operator(,) ident(capa)operator(+)integer(1)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(=) char('\\0')operator(;) - - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_buf_new2)operator(()ident(ptr)operator(\)) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - pre_type(long) ident(len) operator(=) ident(strlen)operator(()ident(ptr)operator(\);) - - ident(str) operator(=) ident(rb_str_buf_new)operator(()ident(len)operator(\);) - ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(len)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_to_str)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(rb_convert_type)operator(()ident(str)operator(,) ident(T_STRING)operator(,) stringoperator(,) stringoperator(\);) -operator(}) - -directive(static) directive(void) -ident(rb_str_shared_replace)operator(()ident(str)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str)operator(,) ident(str2)operator(;) -operator({) - reserved(if) operator(()ident(str) operator(==) ident(str2)operator(\)) reserved(return)operator(;) - ident(rb_str_modify)operator(()ident(str)operator(\);) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(str)operator(,) ident(ELTS_SHARED)operator(\)\)) ident(free)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(str2)operator(\)\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(=) integer(0)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) integer(0)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) integer(0)operator(;) - ident(FL_UNSET)operator(()ident(str)operator(,) ident(STR_NOCAPA)operator(\);) - reserved(return)operator(;) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(;) - ident(FL_UNSET)operator(()ident(str)operator(,) ident(STR_NOCAPA)operator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str2)operator(,) ident(STR_NOCAPA)operator(\)\)) operator({) - ident(FL_SET)operator(()ident(str)operator(,) ident(RBASIC)operator(()ident(str2)operator(\)->)ident(flags) operator(&) ident(STR_NOCAPA)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(shared) operator(=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(aux)operator(.)ident(shared)operator(;) - operator(}) - reserved(else) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(aux)operator(.)ident(capa)operator(;) - operator(}) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr) operator(=) integer(0)operator(;) comment(/* abandon str2 */) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len) operator(=) integer(0)operator(;) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) integer(0)operator(;) - ident(FL_UNSET)operator(()ident(str2)operator(,) ident(STR_NOCAPA)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(str2)operator(\)\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) -operator(}) - -directive(static) ident(ID) ident(id_to_s)operator(;) - -ident(VALUE) -ident(rb_obj_as_string)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(obj)operator(\)) operator(==) ident(T_STRING)operator(\)) operator({) - reserved(return) ident(obj)operator(;) - operator(}) - ident(str) operator(=) ident(rb_funcall)operator(()ident(obj)operator(,) ident(id_to_s)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(str)operator(\)) operator(!=) ident(T_STRING)operator(\)) - reserved(return) ident(rb_any_to_s)operator(()ident(obj)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(obj)operator(\)\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(rb_str_s_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(rb_str_replace) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) - -ident(VALUE) -ident(rb_str_dup)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(dup) operator(=) ident(str_alloc)operator(()ident(rb_obj_class)operator(()ident(str)operator(\)\);) - ident(rb_str_replace)operator(()ident(dup)operator(,) ident(str)operator(\);) - reserved(return) ident(dup)operator(;) -operator(}) - - -comment(/* - * call-seq: - * String.new(str=""\) => new_str - * - * Returns a new string object containing a copy of str. - */) - -directive(static) ident(VALUE) -ident(rb_str_init)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(orig)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(orig)operator(\)) operator(==) integer(1)operator(\)) - ident(rb_str_replace)operator(()ident(str)operator(,) ident(orig)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * str.length => integer - * - * Returns the length of str. - */) - -directive(static) ident(VALUE) -ident(rb_str_length)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(LONG2NUM)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) -operator(}) - -comment(/* - * call-seq: - * str.empty? => true or false - * - * Returns true if str has a length of zero. - * - * "hello".empty? #=> false - * "".empty? #=> true - */) - -directive(static) ident(VALUE) -ident(rb_str_empty)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * str + other_str => new_str - * - * Concatenation---Returns a new String containing - * other_str concatenated to str. - * - * "Hello from " + self.to_s #=> "Hello from main" - */) - -ident(VALUE) -ident(rb_str_plus)operator(()ident(str1)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str1)operator(,) ident(str2)operator(;) -operator({) - ident(VALUE) ident(str3)operator(;) - - ident(StringValue)operator(()ident(str2)operator(\);) - ident(str3) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len)operator(+)ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\);) - ident(memcpy)operator(()ident(RSTRING)operator(()ident(str3)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str1)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len)operator(\);) - ident(memcpy)operator(()ident(RSTRING)operator(()ident(str3)operator(\)->)ident(ptr) operator(+) ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len)operator(,) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\);) - ident(RSTRING)operator(()ident(str3)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str3)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) - - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(str1)operator(\)) operator(||) ident(OBJ_TAINTED)operator(()ident(str2)operator(\)\)) - ident(OBJ_TAINT)operator(()ident(str3)operator(\);) - reserved(return) ident(str3)operator(;) -operator(}) - -comment(/* - * call-seq: - * str * integer => new_str - * - * Copy---Returns a new String containing integer copies of - * the receiver. - * - * "Ho! " * 3 #=> "Ho! Ho! Ho! " - */) - -ident(VALUE) -ident(rb_str_times)operator(()ident(str)operator(,) ident(times)operator(\)) - ident(VALUE) ident(str)operator(;) - ident(VALUE) ident(times)operator(;) -operator({) - ident(VALUE) ident(str2)operator(;) - pre_type(long) ident(i)operator(,) ident(len)operator(;) - - ident(len) operator(=) ident(NUM2LONG)operator(()ident(times)operator(\);) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(len) operator(&&) ident(LONG_MAX)operator(/)ident(len) operator(<) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - ident(str2) operator(=) ident(rb_str_new5)operator(()ident(str)operator(,)integer(0)operator(,) ident(len) operator(*=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(len)operator(;) ident(i) operator(+=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator({) - ident(memcpy)operator(()ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr) operator(+) ident(i)operator(,) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) - operator(}) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) - - ident(OBJ_INFECT)operator(()ident(str2)operator(,) ident(str)operator(\);) - - reserved(return) ident(str2)operator(;) -operator(}) - -comment(/* - * call-seq: - * str % arg => new_str - * - * Format---Uses str as a format specification, and returns the result - * of applying it to arg. If the format specification contains more than - * one substitution, then arg must be an Array containing - * the values to be substituted. See Kernel::sprintf for details - * of the format string. - * - * "%05d" % 123 #=> "00123" - * "%-5s: %08x" % [ "ID", self.id ] #=> "ID : 200e14d6" - */) - -directive(static) ident(VALUE) -ident(rb_str_format_m)operator(()ident(str)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(str)operator(,) ident(arg)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(tmp) operator(=) ident(rb_check_array_type)operator(()ident(arg)operator(\);) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - reserved(return) ident(rb_str_format)operator(()ident(RARRAY_LEN)operator(()ident(tmp)operator(\),) ident(RARRAY_PTR)operator(()ident(tmp)operator(\),) ident(str)operator(\);) - operator(}) - reserved(return) ident(rb_str_format)operator(()integer(1)operator(,) operator(&)ident(arg)operator(,) ident(str)operator(\);) -operator(}) - -directive(static) directive(const) pre_type(char) ident(null_str)operator([]) operator(=) stringoperator(;) - -directive(static) pre_type(int) -ident(str_independent)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str)operator(,) ident(STR_TMPLOCK)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(str)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(str)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(==) ident(null_str)operator(\)) reserved(return) integer(0)operator(;) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(str)operator(,) ident(ELTS_SHARED)operator(\)\)) reserved(return) integer(1)operator(;) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) directive(void) -ident(str_make_independent)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(ptr)operator(;) - - ident(ptr) operator(=) ident(ALLOC_N)operator(()pre_type(char)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(+)integer(1)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) operator({) - ident(memcpy)operator(()ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) - operator(}) - ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(]) operator(=) integer(0)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(=) ident(ptr)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(FL_UNSET)operator(()ident(str)operator(,) ident(STR_NOCAPA)operator(\);) -operator(}) - -directive(void) -ident(rb_str_modify)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(if) operator((!)ident(str_independent)operator(()ident(str)operator(\)\)) - ident(str_make_independent)operator(()ident(str)operator(\);) -operator(}) - -directive(void) -ident(rb_str_associate)operator(()ident(str)operator(,) ident(add)operator(\)) - ident(VALUE) ident(str)operator(,) ident(add)operator(;) -operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str)operator(,) ident(STR_ASSOC)operator(\)\)) operator({) - comment(/* already associated */) - ident(rb_ary_concat)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(shared)operator(,) ident(add)operator(\);) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str)operator(,) ident(ELTS_SHARED)operator(\)\)) operator({) - ident(str_make_independent)operator(()ident(str)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(capa) operator(!=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator({) - ident(RESIZE_CAPA)operator(()ident(str)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(shared) operator(=) ident(add)operator(;) - ident(FL_SET)operator(()ident(str)operator(,) ident(STR_ASSOC)operator(\);) - operator(}) -operator(}) - -ident(VALUE) -ident(rb_str_associated)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str)operator(,) ident(STR_ASSOC)operator(\)\)) operator({) - reserved(return) ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(shared)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -preprocessor(#define) ident(make_null_str)operator(()ident(s)operator(\)) reserved(do) operator({) \ - ident(FL_SET)operator(()ident(s)operator(,) ident(ELTS_SHARED)operator(\);) \ - ident(RSTRING)operator(()ident(s)operator(\)->)ident(ptr) operator(=) operator(()pre_type(char) operator(*\))ident(null_str)operator(;) \ - ident(RSTRING)operator(()ident(s)operator(\)->)ident(aux)operator(.)ident(shared) operator(=) integer(0)operator(;) \ - operator(}) reserved(while) operator(()integer(0)operator(\)) - -directive(static) ident(VALUE) -ident(rb_str_s_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(str_alloc)operator(()ident(klass)operator(\);) - ident(make_null_str)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_string_value)operator(()ident(ptr)operator(\)) - directive(volatile) ident(VALUE) operator(*)ident(ptr)operator(;) -operator({) - ident(VALUE) ident(s) operator(=) operator(*)ident(ptr)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(s)operator(\)) operator(!=) ident(T_STRING)operator(\)) operator({) - ident(s) operator(=) ident(rb_str_to_str)operator(()ident(s)operator(\);) - operator(*)ident(ptr) operator(=) ident(s)operator(;) - operator(}) - reserved(if) operator((!)ident(RSTRING)operator(()ident(s)operator(\)->)ident(ptr)operator(\)) operator({) - ident(make_null_str)operator(()ident(s)operator(\);) - operator(}) - reserved(return) ident(s)operator(;) -operator(}) - -pre_type(char) operator(*) -ident(rb_string_value_ptr)operator(()ident(ptr)operator(\)) - directive(volatile) ident(VALUE) operator(*)ident(ptr)operator(;) -operator({) - reserved(return) ident(RSTRING)operator(()ident(rb_string_value)operator(()ident(ptr)operator(\)\)->)ident(ptr)operator(;) -operator(}) - -pre_type(char) operator(*) -ident(rb_string_value_cstr)operator(()ident(ptr)operator(\)) - directive(volatile) ident(VALUE) operator(*)ident(ptr)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(rb_string_value)operator(()ident(ptr)operator(\);) - pre_type(char) operator(*)ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - - reserved(if) operator((!)ident(s) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(!=) ident(strlen)operator(()ident(s)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(s)operator(;) -operator(}) - -ident(VALUE) -ident(rb_check_string_type)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_check_convert_type)operator(()ident(str)operator(,) ident(T_STRING)operator(,) stringoperator(,) stringoperator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(str)operator(\)) operator(&&) operator(!)ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) operator({) - ident(make_null_str)operator(()ident(str)operator(\);) - operator(}) - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_substr)operator(()ident(str)operator(,) ident(beg)operator(,) ident(len)operator(\)) - ident(VALUE) ident(str)operator(;) - pre_type(long) ident(beg)operator(,) ident(len)operator(;) -operator({) - ident(VALUE) ident(str2)operator(;) - - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(beg) operator(>) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) operator({) - ident(beg) operator(+=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(if) operator(()ident(beg) operator(+) ident(len) operator(>) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator({) - ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(beg)operator(;) - operator(}) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) operator({) - ident(len) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) operator({) - ident(str2) operator(=) ident(rb_str_new5)operator(()ident(str)operator(,)integer(0)operator(,)integer(0)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(len) operator(>) reserved(sizeof)operator(()reserved(struct) ident(RString)operator(\))operator(/)integer(2) operator(&&) - ident(beg) operator(+) ident(len) operator(==) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(&&) operator(!)ident(FL_TEST)operator(()ident(str)operator(,) ident(STR_ASSOC)operator(\)\)) operator({) - ident(str2) operator(=) ident(rb_str_new4)operator(()ident(str)operator(\);) - ident(str2) operator(=) ident(str_new3)operator(()ident(rb_obj_class)operator(()ident(str2)operator(\),) ident(str2)operator(\);) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr) operator(+=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len) operator(-) ident(len)operator(;) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len) operator(=) ident(len)operator(;) - operator(}) - reserved(else) operator({) - ident(str2) operator(=) ident(rb_str_new5)operator(()ident(str)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(+)ident(beg)operator(,) ident(len)operator(\);) - operator(}) - ident(OBJ_INFECT)operator(()ident(str2)operator(,) ident(str)operator(\);) - - reserved(return) ident(str2)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_freeze)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(rb_obj_freeze)operator(()ident(str)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_str_dup_frozen)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str)operator(,) ident(ELTS_SHARED)operator(\)) operator(&&) ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(shared)operator(\)) operator({) - ident(VALUE) ident(shared) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(shared)operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(shared)operator(\)->)ident(len) operator(==) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator({) - ident(OBJ_FREEZE)operator(()ident(shared)operator(\);) - reserved(return) ident(shared)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(str)operator(\)\)) reserved(return) ident(str)operator(;) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(OBJ_FREEZE)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_locktmp)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str)operator(,) ident(STR_TMPLOCK)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - ident(FL_SET)operator(()ident(str)operator(,) ident(STR_TMPLOCK)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_unlocktmp)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(str)operator(,) ident(STR_TMPLOCK)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - ident(FL_UNSET)operator(()ident(str)operator(,) ident(STR_TMPLOCK)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_resize)operator(()ident(str)operator(,) ident(len)operator(\)) - ident(VALUE) ident(str)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - ident(rb_str_modify)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(len) operator(!=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<) ident(len) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(len) operator(>) integer(1024)operator(\)) operator({) - ident(REALLOC_N)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) pre_type(char)operator(,) ident(len)operator(+)integer(1)operator(\);) - reserved(if) operator((!)ident(FL_TEST)operator(()ident(str)operator(,) ident(STR_NOCAPA)operator(\)\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(len)operator(;) - operator(}) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(len)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(len)operator(]) operator(=) char('\\0')operator(;) comment(/* sentinel */) - operator(}) - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(str_buf_cat)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(len)operator(\)) - ident(VALUE) ident(str)operator(;) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - pre_type(long) ident(capa)operator(,) ident(total)operator(,) ident(off) operator(=) operator(-)integer(1)operator(;;) - - ident(rb_str_modify)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(ptr) operator(>=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(&&) ident(ptr) operator(<=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator({) - ident(off) operator(=) ident(ptr) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - operator(}) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) reserved(return) integer(0)operator(;) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str)operator(,) ident(STR_ASSOC)operator(\)\)) operator({) - ident(FL_UNSET)operator(()ident(str)operator(,) ident(STR_ASSOC)operator(\);) - ident(capa) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - operator(}) - reserved(else) operator({) - ident(capa) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(capa)operator(;) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>=) ident(LONG_MAX) operator(-) ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(total) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(+)ident(len)operator(;) - reserved(if) operator(()ident(capa) operator(<=) ident(total)operator(\)) operator({) - reserved(while) operator(()ident(total) operator(>) ident(capa)operator(\)) operator({) - reserved(if) operator(()ident(capa) operator(+) integer(1) operator(>=) ident(LONG_MAX) operator(/) integer(2)operator(\)) operator({) - ident(capa) operator(=) ident(total)operator(;) - reserved(break)operator(;) - operator(}) - ident(capa) operator(=) operator(()ident(capa) operator(+) integer(1)operator(\)) operator(*) integer(2)operator(;) - operator(}) - ident(RESIZE_CAPA)operator(()ident(str)operator(,) ident(capa)operator(\);) - operator(}) - reserved(if) operator(()ident(off) operator(!=) operator(-)integer(1)operator(\)) operator({) - ident(ptr) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(off)operator(;) - operator(}) - ident(memcpy)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) ident(ptr)operator(,) ident(len)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(total)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(total)operator(]) operator(=) char('\\0')operator(;) comment(/* sentinel */) - - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(len)operator(\)) - ident(VALUE) ident(str)operator(;) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(str)operator(;) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(str_buf_cat)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(len)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_str_buf_cat2)operator(()ident(str)operator(,) ident(ptr)operator(\)) - ident(VALUE) ident(str)operator(;) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) -operator({) - reserved(return) ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(strlen)operator(()ident(ptr)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_str_cat)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(len)operator(\)) - ident(VALUE) ident(str)operator(;) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) -operator({) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str)operator(,) ident(STR_ASSOC)operator(\)\)) operator({) - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(REALLOC_N)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) pre_type(char)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(+)ident(len)operator(+)integer(1)operator(\);) - ident(memcpy)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) ident(ptr)operator(,) ident(len)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(+=) ident(len)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) comment(/* sentinel */) - reserved(return) ident(str)operator(;) - operator(}) - - reserved(return) ident(rb_str_buf_cat)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(len)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_str_cat2)operator(()ident(str)operator(,) ident(ptr)operator(\)) - ident(VALUE) ident(str)operator(;) - directive(const) pre_type(char) operator(*)ident(ptr)operator(;) -operator({) - reserved(return) ident(rb_str_cat)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(strlen)operator(()ident(ptr)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str)operator(,) ident(str2)operator(;) -operator({) - ident(str_buf_cat)operator(()ident(str)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(str2)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_append)operator(()ident(str)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str)operator(,) ident(str2)operator(;) -operator({) - ident(StringValue)operator(()ident(str2)operator(\);) - ident(rb_str_modify)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str)operator(,) ident(STR_ASSOC)operator(\)\)) operator({) - pre_type(long) ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(+)ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(;) - ident(REALLOC_N)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) pre_type(char)operator(,) ident(len)operator(+)integer(1)operator(\);) - ident(memcpy)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) - ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(len)operator(]) operator(=) char('\\0')operator(;) comment(/* sentinel */) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(len)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) ident(rb_str_buf_append)operator(()ident(str)operator(,) ident(str2)operator(\);) - operator(}) - operator(}) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(str2)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str << fixnum => str - * str.concat(fixnum\) => str - * str << obj => str - * str.concat(obj\) => str - * - * Append---Concatenates the given object to str. If the object is a - * Fixnum between 0 and 255, it is converted to a character before - * concatenation. - * - * a = "hello " - * a << "world" #=> "hello world" - * a.concat(33\) #=> "hello world!" - */) - -ident(VALUE) -ident(rb_str_concat)operator(()ident(str1)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str1)operator(,) ident(str2)operator(;) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(str2)operator(\)\)) operator({) - pre_type(int) ident(i) operator(=) ident(FIX2INT)operator(()ident(str2)operator(\);) - reserved(if) operator(()integer(0) operator(<=) ident(i) operator(&&) ident(i) operator(<=) hex(0xff)operator(\)) operator({) comment(/* byte */) - pre_type(char) ident(c) operator(=) ident(i)operator(;) - reserved(return) ident(rb_str_cat)operator(()ident(str1)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\);) - operator(}) - operator(}) - ident(str1) operator(=) ident(rb_str_append)operator(()ident(str1)operator(,) ident(str2)operator(\);) - - reserved(return) ident(str1)operator(;) -operator(}) - -pre_type(int) -ident(rb_str_hash)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - directive(register) pre_type(long) ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - directive(register) pre_type(char) operator(*)ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - directive(register) pre_type(int) ident(key) operator(=) integer(0)operator(;) - -preprocessor(#if) ident(defined)operator(()ident(HASH_ELFHASH)operator(\)) - directive(register) pre_type(unsigned) pre_type(int) ident(g)operator(;) - - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(key) operator(=) operator(()ident(key) operator(<<) integer(4)operator(\)) operator(+) operator(*)ident(p)operator(++;) - reserved(if) operator(()ident(g) operator(=) ident(key) operator(&) hex(0xF0000000)operator(\)) - ident(key) operator(^=) ident(g) operator(>>) integer(24)operator(;) - ident(key) operator(&=) operator(~)ident(g)operator(;) - operator(}) -preprocessor(#elif) ident(defined)operator(()ident(HASH_PERL)operator(\)) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(key) operator(+=) operator(*)ident(p)operator(++;) - ident(key) operator(+=) operator(()ident(key) operator(<<) integer(10)operator(\);) - ident(key) operator(^=) operator(()ident(key) operator(>>) integer(6)operator(\);) - operator(}) - ident(key) operator(+=) operator(()ident(key) operator(<<) integer(3)operator(\);) - ident(key) operator(^=) operator(()ident(key) operator(>>) integer(11)operator(\);) - ident(key) operator(+=) operator(()ident(key) operator(<<) integer(15)operator(\);) -preprocessor(#else) - reserved(while) operator(()ident(len)operator(--\)) operator({) - ident(key) operator(=) ident(key)operator(*)integer(65599) operator(+) operator(*)ident(p)operator(;) - ident(p)operator(++;) - operator(}) - ident(key) operator(=) ident(key) operator(+) operator(()ident(key)operator(>>)integer(5)operator(\);) -preprocessor(#endif) - reserved(return) ident(key)operator(;) -operator(}) - -comment(/* - * call-seq: - * str.hash => fixnum - * - * Return a hash based on the string's length and content. - */) - -directive(static) ident(VALUE) -ident(rb_str_hash_m)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(int) ident(key) operator(=) ident(rb_str_hash)operator(()ident(str)operator(\);) - reserved(return) ident(INT2FIX)operator(()ident(key)operator(\);) -operator(}) - -preprocessor(#define) ident(lesser)operator(()ident(a)operator(,)ident(b)operator(\)) operator(((()ident(a)operator(\)>()ident(b)operator(\)\)?()ident(b)operator(\):()ident(a)operator(\)\)) - -pre_type(int) -ident(rb_str_cmp)operator(()ident(str1)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str1)operator(,) ident(str2)operator(;) -operator({) - pre_type(long) ident(len)operator(;) - pre_type(int) ident(retval)operator(;) - - ident(len) operator(=) ident(lesser)operator(()ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\);) - ident(retval) operator(=) ident(rb_memcmp)operator(()ident(RSTRING)operator(()ident(str1)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator(,) ident(len)operator(\);) - reserved(if) operator(()ident(retval) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len) operator(==) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\)) reserved(return) integer(0)operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len) operator(>) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\)) reserved(return) integer(1)operator(;) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(retval) operator(>) integer(0)operator(\)) reserved(return) integer(1)operator(;) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str == obj => true or false - * - * Equality---If obj is not a String, returns - * false. Otherwise, returns true if str - * <=> obj returns zero. - */) - -directive(static) ident(VALUE) -ident(rb_str_equal)operator(()ident(str1)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str1)operator(,) ident(str2)operator(;) -operator({) - reserved(if) operator(()ident(str1) operator(==) ident(str2)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(str2)operator(\)) operator(!=) ident(T_STRING)operator(\)) operator({) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(str2)operator(,) ident(rb_intern)operator(()stringoperator(\)\)\)) operator({) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(rb_equal)operator(()ident(str2)operator(,) ident(str1)operator(\);) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len) operator(==) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len) operator(&&) - ident(rb_str_cmp)operator(()ident(str1)operator(,) ident(str2)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -preprocessor(#define) ident(IS_EVSTR)operator(()ident(p)operator(,)ident(e)operator(\)) operator((()ident(p)operator(\)) operator(<) operator(()ident(e)operator(\)) operator(&&) operator((*()ident(p)operator(\)) operator(==) char('$') operator(||) operator(*()ident(p)operator(\)) operator(==) char('@') operator(||) operator(*()ident(p)operator(\)) operator(==) char('{')operator(\)\)) - -comment(/* - * call-seq: - * str.eql?(other\) => true or false - * - * Two strings are equal if the have the same length and content. - */) - -directive(static) ident(VALUE) -ident(rb_str_eql)operator(()ident(str1)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str1)operator(,) ident(str2)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(str2)operator(\)) operator(!=) ident(T_STRING) operator(||) ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len) operator(!=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\)) - reserved(return) ident(Qfalse)operator(;) - - reserved(if) operator(()ident(memcmp)operator(()ident(RSTRING)operator(()ident(str1)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator(,) - ident(lesser)operator(()ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\)\)) operator(==) integer(0)operator(\)) - reserved(return) ident(Qtrue)operator(;) - - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * str <=> other_str => -1, 0, +1 - * - * Comparison---Returns -1 if other_str is less than, 0 if - * other_str is equal to, and +1 if other_str is greater than - * str. If the strings are of different lengths, and the strings are - * equal when compared up to the shortest length, then the longer string is - * considered greater than the shorter one. If the variable $= is - * false, the comparison is based on comparing the binary values - * of each character in the string. In older versions of Ruby, setting - * $= allowed case-insensitive comparisons; this is now deprecated - * in favor of using String#casecmp. - * - * <=> is the basis for the methods <, - * <=, >, >=, and between?, - * included from module Comparable. The method - * String#== does not use Comparable#==. - * - * "abcdef" <=> "abcde" #=> 1 - * "abcdef" <=> "abcdef" #=> 0 - * "abcdef" <=> "abcdefg" #=> -1 - * "abcdef" <=> "ABCDEF" #=> 1 - */) - -directive(static) ident(VALUE) -ident(rb_str_cmp_m)operator(()ident(str1)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str1)operator(,) ident(str2)operator(;) -operator({) - pre_type(long) ident(result)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(str2)operator(\)) operator(!=) ident(T_STRING)operator(\)) operator({) - reserved(if) operator((!)ident(rb_respond_to)operator(()ident(str2)operator(,) ident(rb_intern)operator(()stringoperator(\)\)\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(else) reserved(if) operator((!)ident(rb_respond_to)operator(()ident(str2)operator(,) ident(rb_intern)operator(()string)delimiter(")>operator(\)\)\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(tmp) operator(=) ident(rb_funcall)operator(()ident(str2)operator(,) ident(rb_intern)operator(()string)delimiter(")>operator(\),) integer(1)operator(,) ident(str1)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(tmp)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(if) operator((!)ident(FIXNUM_P)operator(()ident(tmp)operator(\)\)) operator({) - reserved(return) ident(rb_funcall)operator(()ident(LONG2FIX)operator(()integer(0)operator(\),) char('-')operator(,) integer(1)operator(,) ident(tmp)operator(\);) - operator(}) - ident(result) operator(=) operator(-)ident(FIX2LONG)operator(()ident(tmp)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(result) operator(=) ident(rb_str_cmp)operator(()ident(str1)operator(,) ident(str2)operator(\);) - operator(}) - reserved(return) ident(LONG2NUM)operator(()ident(result)operator(\);) -operator(}) - -comment(/* - * call-seq: - * str.casecmp(other_str\) => -1, 0, +1 - * - * Case-insensitive version of String#<=>. - * - * "abcdef".casecmp("abcde"\) #=> 1 - * "aBcDeF".casecmp("abcdef"\) #=> 0 - * "abcdef".casecmp("abcdefg"\) #=> -1 - * "abcdef".casecmp("ABCDEF"\) #=> 0 - */) - -directive(static) ident(VALUE) -ident(rb_str_casecmp)operator(()ident(str1)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str1)operator(,) ident(str2)operator(;) -operator({) - pre_type(long) ident(len)operator(;) - pre_type(int) ident(retval)operator(;) - - ident(StringValue)operator(()ident(str2)operator(\);) - ident(len) operator(=) ident(lesser)operator(()ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\);) - ident(retval) operator(=) ident(rb_memcicmp)operator(()ident(RSTRING)operator(()ident(str1)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator(,) ident(len)operator(\);) - reserved(if) operator(()ident(retval) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len) operator(==) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str1)operator(\)->)ident(len) operator(>) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - reserved(if) operator(()ident(retval) operator(==) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(retval) operator(>) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) -operator(}) - -directive(static) pre_type(long) -ident(rb_str_index)operator(()ident(str)operator(,) ident(sub)operator(,) ident(offset)operator(\)) - ident(VALUE) ident(str)operator(,) ident(sub)operator(;) - pre_type(long) ident(offset)operator(;) -operator({) - pre_type(long) ident(pos)operator(;) - - reserved(if) operator(()ident(offset) operator(<) integer(0)operator(\)) operator({) - ident(offset) operator(+=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(offset) operator(<) integer(0)operator(\)) reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(offset) operator(<) ident(RSTRING)operator(()ident(sub)operator(\)->)ident(len)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(sub)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(offset)operator(;) - ident(pos) operator(=) ident(rb_memsearch)operator(()ident(RSTRING)operator(()ident(sub)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(sub)operator(\)->)ident(len)operator(,) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(+)ident(offset)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(-)ident(offset)operator(\);) - reserved(if) operator(()ident(pos) operator(<) integer(0)operator(\)) reserved(return) ident(pos)operator(;) - reserved(return) ident(pos) operator(+) ident(offset)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.index(substring [, offset]\) => fixnum or nil - * str.index(fixnum [, offset]\) => fixnum or nil - * str.index(regexp [, offset]\) => fixnum or nil - * - * Returns the index of the first occurrence of the given substring, - * character (fixnum\), or pattern (regexp\) in str. Returns - * nil if not found. If the second parameter is present, it - * specifies the position in the string to begin the search. - * - * "hello".index('e'\) #=> 1 - * "hello".index('lo'\) #=> 3 - * "hello".index('a'\) #=> nil - * "hello".index(101\) #=> 1 - * "hello".index(/[aeiou]/, -3\) #=> 4 - */) - -directive(static) ident(VALUE) -ident(rb_str_index_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(sub)operator(;) - ident(VALUE) ident(initpos)operator(;) - pre_type(long) ident(pos)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(sub)operator(,) operator(&)ident(initpos)operator(\)) operator(==) integer(2)operator(\)) operator({) - ident(pos) operator(=) ident(NUM2LONG)operator(()ident(initpos)operator(\);) - operator(}) - reserved(else) operator({) - ident(pos) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(pos) operator(<) integer(0)operator(\)) operator({) - ident(pos) operator(+=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(pos) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(sub)operator(\)) operator(==) ident(T_REGEXP)operator(\)) operator({) - ident(rb_backref_set)operator(()ident(Qnil)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) - operator(}) - operator(}) - - reserved(switch) operator(()ident(TYPE)operator(()ident(sub)operator(\)\)) operator({) - reserved(case) ident(T_REGEXP)operator(:) - ident(pos) operator(=) ident(rb_reg_adjust_startpos)operator(()ident(sub)operator(,) ident(str)operator(,) ident(pos)operator(,) integer(0)operator(\);) - ident(pos) operator(=) ident(rb_reg_search)operator(()ident(sub)operator(,) ident(str)operator(,) ident(pos)operator(,) integer(0)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_FIXNUM)operator(:) - operator({) - pre_type(int) ident(c) operator(=) ident(FIX2INT)operator(()ident(sub)operator(\);) - pre_type(long) ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(p) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - - reserved(for) operator((;)ident(pos)operator(<)ident(len)operator(;)ident(pos)operator(++\)) operator({) - reserved(if) operator(()ident(p)operator([)ident(pos)operator(]) operator(==) ident(c)operator(\)) reserved(return) ident(LONG2NUM)operator(()ident(pos)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) - operator(}) - - reserved(default)operator(:) operator({) - ident(VALUE) ident(tmp)operator(;) - - ident(tmp) operator(=) ident(rb_check_string_type)operator(()ident(sub)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(tmp)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(sub)operator(\)\);) - operator(}) - ident(sub) operator(=) ident(tmp)operator(;) - operator(}) - comment(/* fall through */) - reserved(case) ident(T_STRING)operator(:) - ident(pos) operator(=) ident(rb_str_index)operator(()ident(str)operator(,) ident(sub)operator(,) ident(pos)operator(\);) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(()ident(pos) operator(==) operator(-)integer(1)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(LONG2NUM)operator(()ident(pos)operator(\);) -operator(}) - -directive(static) pre_type(long) -ident(rb_str_rindex)operator(()ident(str)operator(,) ident(sub)operator(,) ident(pos)operator(\)) - ident(VALUE) ident(str)operator(,) ident(sub)operator(;) - pre_type(long) ident(pos)operator(;) -operator({) - pre_type(long) ident(len) operator(=) ident(RSTRING)operator(()ident(sub)operator(\)->)ident(len)operator(;) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(sbeg)operator(,) operator(*)ident(t)operator(;) - - comment(/* substring longer than string */) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<) ident(len)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(pos) operator(<) ident(len)operator(\)) operator({) - ident(pos) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(len)operator(;) - operator(}) - ident(sbeg) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(pos)operator(;) - ident(t) operator(=) ident(RSTRING)operator(()ident(sub)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(len)operator(\)) operator({) - reserved(while) operator(()ident(sbeg) operator(<=) ident(s)operator(\)) operator({) - reserved(if) operator(()ident(rb_memcmp)operator(()ident(s)operator(,) ident(t)operator(,) ident(len)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(s) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - operator(}) - ident(s)operator(--;) - operator(}) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) ident(pos)operator(;) - operator(}) -operator(}) - - -comment(/* - * call-seq: - * str.rindex(substring [, fixnum]\) => fixnum or nil - * str.rindex(fixnum [, fixnum]\) => fixnum or nil - * str.rindex(regexp [, fixnum]\) => fixnum or nil - * - * Returns the index of the last occurrence of the given substring, - * character (fixnum\), or pattern (regexp\) in str. Returns - * nil if not found. If the second parameter is present, it - * specifies the position in the string to end the search---characters beyond - * this point will not be considered. - * - * "hello".rindex('e'\) #=> 1 - * "hello".rindex('l'\) #=> 3 - * "hello".rindex('a'\) #=> nil - * "hello".rindex(101\) #=> 1 - * "hello".rindex(/[aeiou]/, -2\) #=> 1 - */) - -directive(static) ident(VALUE) -ident(rb_str_rindex_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(sub)operator(;) - ident(VALUE) ident(position)operator(;) - pre_type(long) ident(pos)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(sub)operator(,) operator(&)ident(position)operator(\)) operator(==) integer(2)operator(\)) operator({) - ident(pos) operator(=) ident(NUM2LONG)operator(()ident(position)operator(\);) - reserved(if) operator(()ident(pos) operator(<) integer(0)operator(\)) operator({) - ident(pos) operator(+=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(pos) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(sub)operator(\)) operator(==) ident(T_REGEXP)operator(\)) operator({) - ident(rb_backref_set)operator(()ident(Qnil)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(pos) operator(>) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) ident(pos) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - operator(}) - reserved(else) operator({) - ident(pos) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - operator(}) - - reserved(switch) operator(()ident(TYPE)operator(()ident(sub)operator(\)\)) operator({) - reserved(case) ident(T_REGEXP)operator(:) - reserved(if) operator(()ident(RREGEXP)operator(()ident(sub)operator(\)->)ident(len)operator(\)) operator({) - ident(pos) operator(=) ident(rb_reg_adjust_startpos)operator(()ident(sub)operator(,) ident(str)operator(,) ident(pos)operator(,) integer(1)operator(\);) - ident(pos) operator(=) ident(rb_reg_search)operator(()ident(sub)operator(,) ident(str)operator(,) ident(pos)operator(,) integer(1)operator(\);) - operator(}) - reserved(if) operator(()ident(pos) operator(>=) integer(0)operator(\)) reserved(return) ident(LONG2NUM)operator(()ident(pos)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_STRING)operator(:) - ident(pos) operator(=) ident(rb_str_rindex)operator(()ident(str)operator(,) ident(sub)operator(,) ident(pos)operator(\);) - reserved(if) operator(()ident(pos) operator(>=) integer(0)operator(\)) reserved(return) ident(LONG2NUM)operator(()ident(pos)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(T_FIXNUM)operator(:) - operator({) - pre_type(int) ident(c) operator(=) ident(FIX2INT)operator(()ident(sub)operator(\);) - pre_type(unsigned) pre_type(char) operator(*)ident(p) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(pos)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(pbeg) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - - reserved(if) operator(()ident(pos) operator(==) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator({) - reserved(if) operator(()ident(pos) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - operator(--)ident(p)operator(;) - operator(}) - reserved(while) operator(()ident(pbeg) operator(<=) ident(p)operator(\)) operator({) - reserved(if) operator((*)ident(p) operator(==) ident(c)operator(\)) reserved(return) ident(LONG2NUM)operator((()pre_type(char)operator(*\))ident(p) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - ident(p)operator(--;) - operator(}) - reserved(return) ident(Qnil)operator(;) - operator(}) - - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(sub)operator(\)\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * str =~ obj => fixnum or nil - * - * Match---If obj is a Regexp, use it as a pattern to match - * against str,and returns the position the match starts, or - * nil if there is no match. Otherwise, invokes - * obj.=~, passing str as an argument. The default - * =~ in Object returns false. - * - * "cat o' 9 tails" =~ /\\d/ #=> 7 - * "cat o' 9 tails" =~ 9 #=> false - */) - -directive(static) ident(VALUE) -ident(rb_str_match)operator(()ident(x)operator(,) ident(y)operator(\)) - ident(VALUE) ident(x)operator(,) ident(y)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(y)operator(\)\)) operator({) - reserved(case) ident(T_STRING)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - - reserved(case) ident(T_REGEXP)operator(:) - reserved(return) ident(rb_reg_match)operator(()ident(y)operator(,) ident(x)operator(\);) - - reserved(default)operator(:) - reserved(return) ident(rb_funcall)operator(()ident(y)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(x)operator(\);) - operator(}) -operator(}) - - -directive(static) ident(VALUE) ident(get_pat) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(\)\);) - - -comment(/* - * call-seq: - * str.match(pattern\) => matchdata or nil - * - * Converts pattern to a Regexp (if it isn't already one\), - * then invokes its match method on str. - * - * 'hello'.match('(.\)\\1'\) #=> # - * 'hello'.match('(.\)\\1'\)[0] #=> "ll" - * 'hello'.match(/(.\)\\1/\)[0] #=> "ll" - * 'hello'.match('xx'\) #=> nil - */) - -directive(static) ident(VALUE) -ident(rb_str_match_m)operator(()ident(str)operator(,) ident(re)operator(\)) - ident(VALUE) ident(str)operator(,) ident(re)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(get_pat)operator(()ident(re)operator(,) integer(0)operator(\),) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(str)operator(\);) -operator(}) - -directive(static) pre_type(char) -ident(succ_char)operator(()ident(s)operator(\)) - pre_type(char) operator(*)ident(s)operator(;) -operator({) - pre_type(char) ident(c) operator(=) operator(*)ident(s)operator(;) - - comment(/* numerics */) - reserved(if) operator(()char('0') operator(<=) ident(c) operator(&&) ident(c) operator(<) char('9')operator(\)) operator((*)ident(s)operator(\)++;) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('9')operator(\)) operator({) - operator(*)ident(s) operator(=) char('0')operator(;) - reserved(return) char('1')operator(;) - operator(}) - comment(/* small alphabets */) - reserved(else) reserved(if) operator(()char('a') operator(<=) ident(c) operator(&&) ident(c) operator(<) char('z')operator(\)) operator((*)ident(s)operator(\)++;) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('z')operator(\)) operator({) - reserved(return) operator(*)ident(s) operator(=) char('a')operator(;) - operator(}) - comment(/* capital alphabets */) - reserved(else) reserved(if) operator(()char('A') operator(<=) ident(c) operator(&&) ident(c) operator(<) char('Z')operator(\)) operator((*)ident(s)operator(\)++;) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('Z')operator(\)) operator({) - reserved(return) operator(*)ident(s) operator(=) char('A')operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.succ => new_str - * str.next => new_str - * - * Returns the successor to str. The successor is calculated by - * incrementing characters starting from the rightmost alphanumeric (or - * the rightmost character if there are no alphanumerics\) in the - * string. Incrementing a digit always results in another digit, and - * incrementing a letter results in another letter of the same case. - * Incrementing nonalphanumerics uses the underlying character set's - * collating sequence. - * - * If the increment generates a ``carry,'' the character to the left of - * it is incremented. This process repeats until there is no carry, - * adding an additional character if necessary. - * - * "abcd".succ #=> "abce" - * "THX1138".succ #=> "THX1139" - * "<>".succ #=> "<>" - * "1999zzz".succ #=> "2000aaa" - * "ZZZ9999".succ #=> "AAAA0000" - * "***".succ #=> "**+" - */) - -directive(static) ident(VALUE) -ident(rb_str_succ)operator(()ident(orig)operator(\)) - ident(VALUE) ident(orig)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - pre_type(char) operator(*)ident(sbeg)operator(,) operator(*)ident(s)operator(;) - pre_type(int) ident(c) operator(=) operator(-)integer(1)operator(;) - pre_type(long) ident(n) operator(=) integer(0)operator(;) - - ident(str) operator(=) ident(rb_str_new5)operator(()ident(orig)operator(,) ident(RSTRING)operator(()ident(orig)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(orig)operator(\)->)ident(len)operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(orig)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(str)operator(;) - - ident(sbeg) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(s) operator(=) ident(sbeg) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) integer(1)operator(;) - - reserved(while) operator(()ident(sbeg) operator(<=) ident(s)operator(\)) operator({) - reserved(if) operator(()ident(ISALNUM)operator((*)ident(s)operator(\)\)) operator({) - reserved(if) operator((()ident(c) operator(=) ident(succ_char)operator(()ident(s)operator(\)\)) operator(==) integer(0)operator(\)) reserved(break)operator(;) - ident(n) operator(=) ident(s) operator(-) ident(sbeg)operator(;) - operator(}) - ident(s)operator(--;) - operator(}) - reserved(if) operator(()ident(c) operator(==) operator(-)integer(1)operator(\)) operator({) comment(/* str contains no alnum */) - ident(sbeg) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(s) operator(=) ident(sbeg) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) integer(1)operator(;) - ident(c) operator(=) char('\\001')operator(;) - reserved(while) operator(()ident(sbeg) operator(<=) ident(s)operator(\)) operator({) - reserved(if) operator(((*)ident(s) operator(+=) integer(1)operator(\)) operator(!=) integer(0)operator(\)) reserved(break)operator(;) - ident(s)operator(--;) - operator(}) - operator(}) - reserved(if) operator(()ident(s) operator(<) ident(sbeg)operator(\)) operator({) - ident(RESIZE_CAPA)operator(()ident(str)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(+) integer(1)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(n)operator(;) - ident(memmove)operator(()ident(s)operator(+)integer(1)operator(,) ident(s)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(n)operator(\);) - operator(*)ident(s) operator(=) ident(c)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(+=) integer(1)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) - operator(}) - - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.succ! => str - * str.next! => str - * - * Equivalent to String#succ, but modifies the receiver in - * place. - */) - -directive(static) ident(VALUE) -ident(rb_str_succ_bang)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(rb_str_shared_replace)operator(()ident(str)operator(,) ident(rb_str_succ)operator(()ident(str)operator(\)\);) - - reserved(return) ident(str)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_upto)operator(()ident(beg)operator(,) ident(end)operator(,) ident(excl)operator(\)) - ident(VALUE) ident(beg)operator(,) ident(end)operator(;) - pre_type(int) ident(excl)operator(;) -operator({) - ident(VALUE) ident(current)operator(,) ident(after_end)operator(;) - ident(ID) ident(succ) operator(=) ident(rb_intern)operator(()stringoperator(\);) - pre_type(int) ident(n)operator(;) - - ident(StringValue)operator(()ident(end)operator(\);) - ident(n) operator(=) ident(rb_str_cmp)operator(()ident(beg)operator(,) ident(end)operator(\);) - reserved(if) operator(()ident(n) operator(>) integer(0) operator(||) operator(()ident(excl) operator(&&) ident(n) operator(==) integer(0)operator(\)\)) reserved(return) ident(beg)operator(;) - ident(after_end) operator(=) ident(rb_funcall)operator(()ident(end)operator(,) ident(succ)operator(,) integer(0)operator(,) integer(0)operator(\);) - ident(current) operator(=) ident(beg)operator(;) - reserved(while) operator((!)ident(rb_str_equal)operator(()ident(current)operator(,) ident(after_end)operator(\)\)) operator({) - ident(rb_yield)operator(()ident(current)operator(\);) - reserved(if) operator((!)ident(excl) operator(&&) ident(rb_str_equal)operator(()ident(current)operator(,) ident(end)operator(\)\)) reserved(break)operator(;) - ident(current) operator(=) ident(rb_funcall)operator(()ident(current)operator(,) ident(succ)operator(,) integer(0)operator(,) integer(0)operator(\);) - ident(StringValue)operator(()ident(current)operator(\);) - reserved(if) operator(()ident(excl) operator(&&) ident(rb_str_equal)operator(()ident(current)operator(,) ident(end)operator(\)\)) reserved(break)operator(;) - ident(StringValue)operator(()ident(current)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(current)operator(\)->)ident(len) operator(>) ident(RSTRING)operator(()ident(end)operator(\)->)ident(len) operator(||) ident(RSTRING)operator(()ident(current)operator(\)->)ident(len) operator(==) integer(0)operator(\)) - reserved(break)operator(;) - operator(}) - - reserved(return) ident(beg)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.upto(other_str\) {|s| block } => str - * - * Iterates through successive values, starting at str and - * ending at other_str inclusive, passing each value in turn to - * the block. The String#succ method is used to generate - * each value. - * - * "a8".upto("b6"\) {|s| print s, ' ' } - * for s in "a8".."b6" - * print s, ' ' - * end - * - * produces: - * - * a8 a9 b0 b1 b2 b3 b4 b5 b6 - * a8 a9 b0 b1 b2 b3 b4 b5 b6 - */) - -directive(static) ident(VALUE) -ident(rb_str_upto_m)operator(()ident(beg)operator(,) ident(end)operator(\)) - ident(VALUE) ident(beg)operator(,) ident(end)operator(;) -operator({) - reserved(return) ident(rb_str_upto)operator(()ident(beg)operator(,) ident(end)operator(,) ident(Qfalse)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_str_subpat)operator(()ident(str)operator(,) ident(re)operator(,) ident(nth)operator(\)) - ident(VALUE) ident(str)operator(,) ident(re)operator(;) - pre_type(int) ident(nth)operator(;) -operator({) - reserved(if) operator(()ident(rb_reg_search)operator(()ident(re)operator(,) ident(str)operator(,) integer(0)operator(,) integer(0)operator(\)) operator(>=) integer(0)operator(\)) operator({) - reserved(return) ident(rb_reg_nth_match)operator(()ident(nth)operator(,) ident(rb_backref_get)operator((\)\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_str_aref)operator(()ident(str)operator(,) ident(indx)operator(\)) - ident(VALUE) ident(str)operator(;) - ident(VALUE) ident(indx)operator(;) -operator({) - pre_type(long) ident(idx)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(indx)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(idx) operator(=) ident(FIX2LONG)operator(()ident(indx)operator(\);) - - label(num_index:) - reserved(if) operator(()ident(idx) operator(<) integer(0)operator(\)) operator({) - ident(idx) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(+) ident(idx)operator(;) - operator(}) - reserved(if) operator(()ident(idx) operator(<) integer(0) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<=) ident(idx)operator(\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(idx)operator(]) operator(&) hex(0xff)operator(\);) - - reserved(case) ident(T_REGEXP)operator(:) - reserved(return) ident(rb_str_subpat)operator(()ident(str)operator(,) ident(indx)operator(,) integer(0)operator(\);) - - reserved(case) ident(T_STRING)operator(:) - reserved(if) operator(()ident(rb_str_index)operator(()ident(str)operator(,) ident(indx)operator(,) integer(0)operator(\)) operator(!=) operator(-)integer(1)operator(\)) - reserved(return) ident(rb_str_dup)operator(()ident(indx)operator(\);) - reserved(return) ident(Qnil)operator(;) - - reserved(default)operator(:) - comment(/* check if indx is Range */) - operator({) - pre_type(long) ident(beg)operator(,) ident(len)operator(;) - ident(VALUE) ident(tmp)operator(;) - - reserved(switch) operator(()ident(rb_range_beg_len)operator(()ident(indx)operator(,) operator(&)ident(beg)operator(,) operator(&)ident(len)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) integer(0)operator(\)\)) operator({) - reserved(case) ident(Qfalse)operator(:) - reserved(break)operator(;) - reserved(case) ident(Qnil)operator(:) - reserved(return) ident(Qnil)operator(;) - reserved(default)operator(:) - ident(tmp) operator(=) ident(rb_str_substr)operator(()ident(str)operator(,) ident(beg)operator(,) ident(len)operator(\);) - ident(OBJ_INFECT)operator(()ident(tmp)operator(,) ident(indx)operator(\);) - reserved(return) ident(tmp)operator(;) - operator(}) - operator(}) - ident(idx) operator(=) ident(NUM2LONG)operator(()ident(indx)operator(\);) - reserved(goto) ident(num_index)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - - -comment(/* - * call-seq: - * str[fixnum] => fixnum or nil - * str[fixnum, fixnum] => new_str or nil - * str[range] => new_str or nil - * str[regexp] => new_str or nil - * str[regexp, fixnum] => new_str or nil - * str[other_str] => new_str or nil - * str.slice(fixnum\) => fixnum or nil - * str.slice(fixnum, fixnum\) => new_str or nil - * str.slice(range\) => new_str or nil - * str.slice(regexp\) => new_str or nil - * str.slice(regexp, fixnum\) => new_str or nil - * str.slice(other_str\) => new_str or nil - * - * Element Reference---If passed a single Fixnum, returns the code - * of the character at that position. If passed two Fixnum - * objects, returns a substring starting at the offset given by the first, and - * a length given by the second. If given a range, a substring containing - * characters at offsets given by the range is returned. In all three cases, if - * an offset is negative, it is counted from the end of str. Returns - * nil if the initial offset falls outside the string, the length - * is negative, or the beginning of the range is greater than the end. - * - * If a Regexp is supplied, the matching portion of str is - * returned. If a numeric parameter follows the regular expression, that - * component of the MatchData is returned instead. If a - * String is given, that string is returned if it occurs in - * str. In both cases, nil is returned if there is no - * match. - * - * a = "hello there" - * a[1] #=> 101 - * a[1,3] #=> "ell" - * a[1..3] #=> "ell" - * a[-3,2] #=> "er" - * a[-4..-2] #=> "her" - * a[12..-1] #=> nil - * a[-2..-4] #=> "" - * a[/[aeiou](.\)\\1/] #=> "ell" - * a[/[aeiou](.\)\\1/, 0] #=> "ell" - * a[/[aeiou](.\)\\1/, 1] #=> "l" - * a[/[aeiou](.\)\\1/, 2] #=> nil - * a["lo"] #=> "lo" - * a["bye"] #=> nil - */) - -directive(static) ident(VALUE) -ident(rb_str_aref_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(if) operator(()ident(argc) operator(==) integer(2)operator(\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(==) ident(T_REGEXP)operator(\)) operator({) - reserved(return) ident(rb_str_subpat)operator(()ident(str)operator(,) ident(argv)operator([)integer(0)operator(],) ident(NUM2INT)operator(()ident(argv)operator([)integer(1)operator(]\)\);) - operator(}) - reserved(return) ident(rb_str_substr)operator(()ident(str)operator(,) ident(NUM2LONG)operator(()ident(argv)operator([)integer(0)operator(]\),) ident(NUM2LONG)operator(()ident(argv)operator([)integer(1)operator(]\)\);) - operator(}) - reserved(if) operator(()ident(argc) operator(!=) integer(1)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - reserved(return) ident(rb_str_aref)operator(()ident(str)operator(,) ident(argv)operator([)integer(0)operator(]\);) -operator(}) - -directive(static) directive(void) -ident(rb_str_splice)operator(()ident(str)operator(,) ident(beg)operator(,) ident(len)operator(,) ident(val)operator(\)) - ident(VALUE) ident(str)operator(;) - pre_type(long) ident(beg)operator(,) ident(len)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(if) operator(()ident(len) operator(<) integer(0)operator(\)) ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(len)operator(\);) - - ident(StringValue)operator(()ident(val)operator(\);) - ident(rb_str_modify)operator(()ident(str)operator(\);) - - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<) ident(beg)operator(\)) operator({) - label(out_of_range:) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(beg)operator(\);) - operator(}) - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator((-)ident(beg) operator(>) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator({) - reserved(goto) ident(out_of_range)operator(;) - operator(}) - ident(beg) operator(+=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<) ident(len) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<) ident(beg) operator(+) ident(len)operator(\)) operator({) - ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(beg)operator(;) - operator(}) - - reserved(if) operator(()ident(len) operator(<) ident(RSTRING)operator(()ident(val)operator(\)->)ident(len)operator(\)) operator({) - comment(/* expand string */) - ident(RESIZE_CAPA)operator(()ident(str)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(+) ident(RSTRING)operator(()ident(val)operator(\)->)ident(len) operator(-) ident(len) operator(+) integer(1)operator(\);) - operator(}) - - reserved(if) operator(()ident(RSTRING)operator(()ident(val)operator(\)->)ident(len) operator(!=) ident(len)operator(\)) operator({) - ident(memmove)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(beg) operator(+) ident(RSTRING)operator(()ident(val)operator(\)->)ident(len)operator(,) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(beg) operator(+) ident(len)operator(,) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) operator(()ident(beg) operator(+) ident(len)operator(\)\);) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<) ident(beg) operator(&&) ident(len) operator(<) integer(0)operator(\)) operator({) - ident(MEMZERO)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) pre_type(char)operator(,) operator(-)ident(len)operator(\);) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(val)operator(\)->)ident(len) operator(>) integer(0)operator(\)) operator({) - ident(memmove)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(+)ident(beg)operator(,) ident(RSTRING)operator(()ident(val)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(val)operator(\)->)ident(len)operator(\);) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(+=) ident(RSTRING)operator(()ident(val)operator(\)->)ident(len) operator(-) ident(len)operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) - operator(}) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(val)operator(\);) -operator(}) - -directive(void) -ident(rb_str_update)operator(()ident(str)operator(,) ident(beg)operator(,) ident(len)operator(,) ident(val)operator(\)) - ident(VALUE) ident(str)operator(;) - pre_type(long) ident(beg)operator(,) ident(len)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(rb_str_splice)operator(()ident(str)operator(,) ident(beg)operator(,) ident(len)operator(,) ident(val)operator(\);) -operator(}) - -directive(static) directive(void) -ident(rb_str_subpat_set)operator(()ident(str)operator(,) ident(re)operator(,) ident(nth)operator(,) ident(val)operator(\)) - ident(VALUE) ident(str)operator(,) ident(re)operator(;) - pre_type(int) ident(nth)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(VALUE) ident(match)operator(;) - pre_type(long) ident(start)operator(,) ident(end)operator(,) ident(len)operator(;) - - reserved(if) operator(()ident(rb_reg_search)operator(()ident(re)operator(,) ident(str)operator(,) integer(0)operator(,) integer(0)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(\);) - operator(}) - ident(match) operator(=) ident(rb_backref_get)operator((\);) - reserved(if) operator(()ident(nth) operator(>=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs)operator(\)) operator({) - label(out_of_range:) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(nth)operator(\);) - operator(}) - reserved(if) operator(()ident(nth) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator((-)ident(nth) operator(>=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs)operator(\)) operator({) - reserved(goto) ident(out_of_range)operator(;) - operator(}) - ident(nth) operator(+=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(->)ident(num_regs)operator(;) - operator(}) - - ident(start) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(BEG)operator(()ident(nth)operator(\);) - reserved(if) operator(()ident(start) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(nth)operator(\);) - operator(}) - ident(end) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(END)operator(()ident(nth)operator(\);) - ident(len) operator(=) ident(end) operator(-) ident(start)operator(;) - ident(rb_str_splice)operator(()ident(str)operator(,) ident(start)operator(,) ident(len)operator(,) ident(val)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_str_aset)operator(()ident(str)operator(,) ident(indx)operator(,) ident(val)operator(\)) - ident(VALUE) ident(str)operator(;) - ident(VALUE) ident(indx)operator(,) ident(val)operator(;) -operator({) - pre_type(long) ident(idx)operator(,) ident(beg)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(indx)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(idx) operator(=) ident(FIX2LONG)operator(()ident(indx)operator(\);) - label(num_index:) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<=) ident(idx)operator(\)) operator({) - label(out_of_range:) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) ident(idx)operator(\);) - operator(}) - reserved(if) operator(()ident(idx) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator((-)ident(idx) operator(>) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) - reserved(goto) ident(out_of_range)operator(;) - ident(idx) operator(+=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - operator(}) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(val)operator(\)\)) operator({) - ident(rb_str_modify)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) ident(idx)operator(\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(+=) integer(1)operator(;) - ident(RESIZE_CAPA)operator(()ident(str)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(idx)operator(]) operator(=) ident(FIX2INT)operator(()ident(val)operator(\)) operator(&) hex(0xff)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_str_splice)operator(()ident(str)operator(,) ident(idx)operator(,) integer(1)operator(,) ident(val)operator(\);) - operator(}) - reserved(return) ident(val)operator(;) - - reserved(case) ident(T_REGEXP)operator(:) - ident(rb_str_subpat_set)operator(()ident(str)operator(,) ident(indx)operator(,) integer(0)operator(,) ident(val)operator(\);) - reserved(return) ident(val)operator(;) - - reserved(case) ident(T_STRING)operator(:) - ident(beg) operator(=) ident(rb_str_index)operator(()ident(str)operator(,) ident(indx)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(\);) - operator(}) - ident(rb_str_splice)operator(()ident(str)operator(,) ident(beg)operator(,) ident(RSTRING)operator(()ident(indx)operator(\)->)ident(len)operator(,) ident(val)operator(\);) - reserved(return) ident(val)operator(;) - - reserved(default)operator(:) - comment(/* check if indx is Range */) - operator({) - pre_type(long) ident(beg)operator(,) ident(len)operator(;) - reserved(if) operator(()ident(rb_range_beg_len)operator(()ident(indx)operator(,) operator(&)ident(beg)operator(,) operator(&)ident(len)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) integer(2)operator(\)\)) operator({) - ident(rb_str_splice)operator(()ident(str)operator(,) ident(beg)operator(,) ident(len)operator(,) ident(val)operator(\);) - reserved(return) ident(val)operator(;) - operator(}) - operator(}) - ident(idx) operator(=) ident(NUM2LONG)operator(()ident(indx)operator(\);) - reserved(goto) ident(num_index)operator(;) - operator(}) -operator(}) - -comment(/* - * call-seq: - * str[fixnum] = fixnum - * str[fixnum] = new_str - * str[fixnum, fixnum] = new_str - * str[range] = aString - * str[regexp] = new_str - * str[regexp, fixnum] = new_str - * str[other_str] = new_str - * - * Element Assignment---Replaces some or all of the content of str. The - * portion of the string affected is determined using the same criteria as - * String#[]. If the replacement string is not the same length as - * the text it is replacing, the string will be adjusted accordingly. If the - * regular expression or string is used as the index doesn't match a position - * in the string, IndexError is raised. If the regular expression - * form is used, the optional second Fixnum allows you to specify - * which portion of the match to replace (effectively using the - * MatchData indexing rules. The forms that take a - * Fixnum will raise an IndexError if the value is - * out of range; the Range form will raise a - * RangeError, and the Regexp and String - * forms will silently ignore the assignment. - */) - -directive(static) ident(VALUE) -ident(rb_str_aset_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(if) operator(()ident(argc) operator(==) integer(3)operator(\)) operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(argv)operator([)integer(0)operator(]\)) operator(==) ident(T_REGEXP)operator(\)) operator({) - ident(rb_str_subpat_set)operator(()ident(str)operator(,) ident(argv)operator([)integer(0)operator(],) ident(NUM2INT)operator(()ident(argv)operator([)integer(1)operator(]\),) ident(argv)operator([)integer(2)operator(]\);) - operator(}) - reserved(else) operator({) - ident(rb_str_splice)operator(()ident(str)operator(,) ident(NUM2LONG)operator(()ident(argv)operator([)integer(0)operator(]\),) ident(NUM2LONG)operator(()ident(argv)operator([)integer(1)operator(]\),) ident(argv)operator([)integer(2)operator(]\);) - operator(}) - reserved(return) ident(argv)operator([)integer(2)operator(];) - operator(}) - reserved(if) operator(()ident(argc) operator(!=) integer(2)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - reserved(return) ident(rb_str_aset)operator(()ident(str)operator(,) ident(argv)operator([)integer(0)operator(],) ident(argv)operator([)integer(1)operator(]\);) -operator(}) - -comment(/* - * call-seq: - * str.insert(index, other_str\) => str - * - * Inserts other_str before the character at the given - * index, modifying str. Negative indices count from the - * end of the string, and insert after the given character. - * The intent is insert aString so that it starts at the given - * index. - * - * "abcd".insert(0, 'X'\) #=> "Xabcd" - * "abcd".insert(3, 'X'\) #=> "abcXd" - * "abcd".insert(4, 'X'\) #=> "abcdX" - * "abcd".insert(-3, 'X'\) #=> "abXcd" - * "abcd".insert(-1, 'X'\) #=> "abcdX" - */) - -directive(static) ident(VALUE) -ident(rb_str_insert)operator(()ident(str)operator(,) ident(idx)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str)operator(,) ident(idx)operator(,) ident(str2)operator(;) -operator({) - pre_type(long) ident(pos) operator(=) ident(NUM2LONG)operator(()ident(idx)operator(\);) - - reserved(if) operator(()ident(pos) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(pos) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(pos) operator(<) integer(0)operator(\)) operator({) - ident(pos)operator(++;) - operator(}) - ident(rb_str_splice)operator(()ident(str)operator(,) ident(pos)operator(,) integer(0)operator(,) ident(str2)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * str.slice!(fixnum\) => fixnum or nil - * str.slice!(fixnum, fixnum\) => new_str or nil - * str.slice!(range\) => new_str or nil - * str.slice!(regexp\) => new_str or nil - * str.slice!(other_str\) => new_str or nil - * - * Deletes the specified portion from str, and returns the portion - * deleted. The forms that take a Fixnum will raise an - * IndexError if the value is out of range; the Range - * form will raise a RangeError, and the Regexp and - * String forms will silently ignore the assignment. - * - * string = "this is a string" - * string.slice!(2\) #=> 105 - * string.slice!(3..6\) #=> " is " - * string.slice!(/s.*t/\) #=> "sa st" - * string.slice!("r"\) #=> "r" - * string #=> "thing" - */) - -directive(static) ident(VALUE) -ident(rb_str_slice_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(result)operator(;) - ident(VALUE) ident(buf)operator([)integer(3)operator(];) - pre_type(int) ident(i)operator(;) - - reserved(if) operator(()ident(argc) operator(<) integer(1) operator(||) integer(2) operator(<) ident(argc)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(buf)operator([)ident(i)operator(]) operator(=) ident(argv)operator([)ident(i)operator(];) - operator(}) - ident(buf)operator([)ident(i)operator(]) operator(=) ident(rb_str_new)operator(()integer(0)operator(,)integer(0)operator(\);) - ident(result) operator(=) ident(rb_str_aref_m)operator(()ident(argc)operator(,) ident(buf)operator(,) ident(str)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(result)operator(\)\)) operator({) - ident(rb_str_aset_m)operator(()ident(argc)operator(+)integer(1)operator(,) ident(buf)operator(,) ident(str)operator(\);) - operator(}) - reserved(return) ident(result)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(get_pat)operator(()ident(pat)operator(,) ident(quote)operator(\)) - ident(VALUE) ident(pat)operator(;) - pre_type(int) ident(quote)operator(;) -operator({) - ident(VALUE) ident(val)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(pat)operator(\)\)) operator({) - reserved(case) ident(T_REGEXP)operator(:) - reserved(return) ident(pat)operator(;) - - reserved(case) ident(T_STRING)operator(:) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(val) operator(=) ident(rb_check_string_type)operator(()ident(pat)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(val)operator(\)\)) operator({) - ident(Check_Type)operator(()ident(pat)operator(,) ident(T_REGEXP)operator(\);) - operator(}) - ident(pat) operator(=) ident(val)operator(;) - operator(}) - - reserved(if) operator(()ident(quote)operator(\)) operator({) - ident(pat) operator(=) ident(rb_reg_quote)operator(()ident(pat)operator(\);) - operator(}) - - reserved(return) ident(rb_reg_regcomp)operator(()ident(pat)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.sub!(pattern, replacement\) => str or nil - * str.sub!(pattern\) {|match| block } => str or nil - * - * Performs the substitutions of String#sub in place, - * returning str, or nil if no substitutions were - * performed. - */) - -directive(static) ident(VALUE) -ident(rb_str_sub_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(pat)operator(,) ident(repl)operator(,) ident(match)operator(;) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) - pre_type(int) ident(iter) operator(=) integer(0)operator(;) - pre_type(int) ident(tainted) operator(=) integer(0)operator(;) - pre_type(long) ident(plen)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(1) operator(&&) ident(rb_block_given_p)operator((\)\)) operator({) - ident(iter) operator(=) integer(1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(argc) operator(==) integer(2)operator(\)) operator({) - ident(repl) operator(=) ident(argv)operator([)integer(1)operator(];) - ident(StringValue)operator(()ident(repl)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(repl)operator(\)\)) ident(tainted) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - - ident(pat) operator(=) ident(get_pat)operator(()ident(argv)operator([)integer(0)operator(],) integer(1)operator(\);) - reserved(if) operator(()ident(rb_reg_search)operator(()ident(pat)operator(,) ident(str)operator(,) integer(0)operator(,) integer(0)operator(\)) operator(>=) integer(0)operator(\)) operator({) - ident(match) operator(=) ident(rb_backref_get)operator((\);) - ident(regs) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(;) - - reserved(if) operator(()ident(iter)operator(\)) operator({) - pre_type(char) operator(*)ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) pre_type(long) ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - - ident(rb_match_busy)operator(()ident(match)operator(\);) - ident(repl) operator(=) ident(rb_obj_as_string)operator(()ident(rb_yield)operator(()ident(rb_reg_nth_match)operator(()integer(0)operator(,) ident(match)operator(\)\)\);) - ident(str_mod_check)operator(()ident(str)operator(,) ident(p)operator(,) ident(len)operator(\);) - ident(str_frozen_check)operator(()ident(str)operator(\);) - ident(rb_backref_set)operator(()ident(match)operator(\);) - operator(}) - reserved(else) operator({) - ident(repl) operator(=) ident(rb_reg_regsub)operator(()ident(repl)operator(,) ident(str)operator(,) ident(regs)operator(\);) - operator(}) - ident(rb_str_modify)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(repl)operator(\)\)) ident(tainted) operator(=) integer(1)operator(;) - ident(plen) operator(=) ident(END)operator(()integer(0)operator(\)) operator(-) ident(BEG)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(repl)operator(\)->)ident(len) operator(>) ident(plen)operator(\)) operator({) - ident(RESIZE_CAPA)operator(()ident(str)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(+) ident(RSTRING)operator(()ident(repl)operator(\)->)ident(len) operator(-) ident(plen)operator(\);) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(repl)operator(\)->)ident(len) operator(!=) ident(plen)operator(\)) operator({) - ident(memmove)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(BEG)operator(()integer(0)operator(\)) operator(+) ident(RSTRING)operator(()ident(repl)operator(\)->)ident(len)operator(,) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(BEG)operator(()integer(0)operator(\)) operator(+) ident(plen)operator(,) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(BEG)operator(()integer(0)operator(\)) operator(-) ident(plen)operator(\);) - operator(}) - ident(memcpy)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(BEG)operator(()integer(0)operator(\),) - ident(RSTRING)operator(()ident(repl)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(repl)operator(\)->)ident(len)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(+=) ident(RSTRING)operator(()ident(repl)operator(\)->)ident(len) operator(-) ident(plen)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) - reserved(if) operator(()ident(tainted)operator(\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - - reserved(return) ident(str)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.sub(pattern, replacement\) => new_str - * str.sub(pattern\) {|match| block } => new_str - * - * Returns a copy of str with the first occurrence of - * pattern replaced with either replacement or the value of the - * block. The pattern will typically be a Regexp; if it is - * a String then no regular expression metacharacters will be - * interpreted (that is /\\d/ will match a digit, but - * '\\d' will match a backslash followed by a 'd'\). - * - * If the method call specifies replacement, special variables such as - * $& will not be useful, as substitution into the string occurs - * before the pattern match starts. However, the sequences \\1, - * \\2, etc., may be used. - * - * In the block form, the current match string is passed in as a parameter, and - * variables such as $1, $2, $`, - * $&, and $' will be set appropriately. The value - * returned by the block will be substituted for the match on each call. - * - * The result inherits any tainting in the original string or any supplied - * replacement string. - * - * "hello".sub(/[aeiou]/, '*'\) #=> "h*llo" - * "hello".sub(/([aeiou]\)/, '<\\1>'\) #=> "hllo" - * "hello".sub(/./\) {|s| s[0].to_s + ' ' } #=> "104 ello" - */) - -directive(static) ident(VALUE) -ident(rb_str_sub)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_sub_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(str_gsub)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(,) ident(bang)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) - pre_type(int) ident(bang)operator(;) -operator({) - ident(VALUE) ident(pat)operator(,) ident(val)operator(,) ident(repl)operator(,) ident(match)operator(,) ident(dest)operator(;) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) - pre_type(long) ident(beg)operator(,) ident(n)operator(;) - pre_type(long) ident(offset)operator(,) ident(blen)operator(,) ident(slen)operator(,) ident(len)operator(;) - pre_type(int) ident(iter) operator(=) integer(0)operator(;) - pre_type(char) operator(*)ident(buf)operator(,) operator(*)ident(bp)operator(,) operator(*)ident(sp)operator(,) operator(*)ident(cp)operator(;) - pre_type(int) ident(tainted) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(1) operator(&&) ident(rb_block_given_p)operator((\)\)) operator({) - ident(iter) operator(=) integer(1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(argc) operator(==) integer(2)operator(\)) operator({) - ident(repl) operator(=) ident(argv)operator([)integer(1)operator(];) - ident(StringValue)operator(()ident(repl)operator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(repl)operator(\)\)) ident(tainted) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - - ident(pat) operator(=) ident(get_pat)operator(()ident(argv)operator([)integer(0)operator(],) integer(1)operator(\);) - ident(offset)operator(=)integer(0)operator(;) ident(n)operator(=)integer(0)operator(;) - ident(beg) operator(=) ident(rb_reg_search)operator(()ident(pat)operator(,) ident(str)operator(,) integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(beg) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(bang)operator(\)) reserved(return) ident(Qnil)operator(;) comment(/* no match, no substitution */) - reserved(return) ident(rb_str_dup)operator(()ident(str)operator(\);) - operator(}) - - ident(blen) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(+) integer(30)operator(;) comment(/* len + margin */) - ident(dest) operator(=) ident(str_new)operator(()integer(0)operator(,) integer(0)operator(,) ident(blen)operator(\);) - ident(buf) operator(=) ident(RSTRING)operator(()ident(dest)operator(\)->)ident(ptr)operator(;) - ident(bp) operator(=) ident(buf)operator(;) - ident(sp) operator(=) ident(cp) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(slen) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - - ident(rb_str_locktmp)operator(()ident(dest)operator(\);) - reserved(while) operator(()ident(beg) operator(>=) integer(0)operator(\)) operator({) - ident(n)operator(++;) - ident(match) operator(=) ident(rb_backref_get)operator((\);) - ident(regs) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(;) - reserved(if) operator(()ident(iter)operator(\)) operator({) - ident(rb_match_busy)operator(()ident(match)operator(\);) - ident(val) operator(=) ident(rb_obj_as_string)operator(()ident(rb_yield)operator(()ident(rb_reg_nth_match)operator(()integer(0)operator(,) ident(match)operator(\)\)\);) - ident(str_mod_check)operator(()ident(str)operator(,) ident(sp)operator(,) ident(slen)operator(\);) - reserved(if) operator(()ident(bang)operator(\)) ident(str_frozen_check)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(val) operator(==) ident(dest)operator(\)) operator({) comment(/* paranoid chack [ruby-dev:24827] */) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - ident(rb_backref_set)operator(()ident(match)operator(\);) - operator(}) - reserved(else) operator({) - ident(val) operator(=) ident(rb_reg_regsub)operator(()ident(repl)operator(,) ident(str)operator(,) ident(regs)operator(\);) - operator(}) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(val)operator(\)\)) ident(tainted) operator(=) integer(1)operator(;) - ident(len) operator(=) operator(()ident(bp) operator(-) ident(buf)operator(\)) operator(+) operator(()ident(beg) operator(-) ident(offset)operator(\)) operator(+) ident(RSTRING)operator(()ident(val)operator(\)->)ident(len) operator(+) integer(3)operator(;) - reserved(if) operator(()ident(blen) operator(<) ident(len)operator(\)) operator({) - reserved(while) operator(()ident(blen) operator(<) ident(len)operator(\)) ident(blen) operator(*=) integer(2)operator(;) - ident(len) operator(=) ident(bp) operator(-) ident(buf)operator(;) - ident(RESIZE_CAPA)operator(()ident(dest)operator(,) ident(blen)operator(\);) - ident(RSTRING)operator(()ident(dest)operator(\)->)ident(len) operator(=) ident(blen)operator(;) - ident(buf) operator(=) ident(RSTRING)operator(()ident(dest)operator(\)->)ident(ptr)operator(;) - ident(bp) operator(=) ident(buf) operator(+) ident(len)operator(;) - operator(}) - ident(len) operator(=) ident(beg) operator(-) ident(offset)operator(;) comment(/* copy pre-match substr */) - ident(memcpy)operator(()ident(bp)operator(,) ident(cp)operator(,) ident(len)operator(\);) - ident(bp) operator(+=) ident(len)operator(;) - ident(memcpy)operator(()ident(bp)operator(,) ident(RSTRING)operator(()ident(val)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(val)operator(\)->)ident(len)operator(\);) - ident(bp) operator(+=) ident(RSTRING)operator(()ident(val)operator(\)->)ident(len)operator(;) - ident(offset) operator(=) ident(END)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(BEG)operator(()integer(0)operator(\)) operator(==) ident(END)operator(()integer(0)operator(\)\)) operator({) - comment(/* - * Always consume at least one character of the input string - * in order to prevent infinite loops. - */) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<=) ident(END)operator(()integer(0)operator(\)\)) reserved(break)operator(;) - ident(len) operator(=) ident(mbclen2)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(END)operator(()integer(0)operator(\)],) ident(pat)operator(\);) - ident(memcpy)operator(()ident(bp)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(+)ident(END)operator(()integer(0)operator(\),) ident(len)operator(\);) - ident(bp) operator(+=) ident(len)operator(;) - ident(offset) operator(=) ident(END)operator(()integer(0)operator(\)) operator(+) ident(len)operator(;) - operator(}) - ident(cp) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(+) ident(offset)operator(;) - reserved(if) operator(()ident(offset) operator(>) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) reserved(break)operator(;) - ident(beg) operator(=) ident(rb_reg_search)operator(()ident(pat)operator(,) ident(str)operator(,) ident(offset)operator(,) integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) ident(offset)operator(\)) operator({) - ident(len) operator(=) ident(bp) operator(-) ident(buf)operator(;) - reserved(if) operator(()ident(blen) operator(-) ident(len) operator(<) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(offset)operator(\)) operator({) - ident(blen) operator(=) ident(len) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(offset)operator(;) - ident(RESIZE_CAPA)operator(()ident(dest)operator(,) ident(blen)operator(\);) - ident(buf) operator(=) ident(RSTRING)operator(()ident(dest)operator(\)->)ident(ptr)operator(;) - ident(bp) operator(=) ident(buf) operator(+) ident(len)operator(;) - operator(}) - ident(memcpy)operator(()ident(bp)operator(,) ident(cp)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(offset)operator(\);) - ident(bp) operator(+=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) ident(offset)operator(;) - operator(}) - ident(rb_backref_set)operator(()ident(match)operator(\);) - operator(*)ident(bp) operator(=) char('\\0')operator(;) - ident(rb_str_unlocktmp)operator(()ident(dest)operator(\);) - reserved(if) operator(()ident(bang)operator(\)) operator({) - reserved(if) operator(()ident(str_independent)operator(()ident(str)operator(\)\)) operator({) - ident(free)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - operator(}) - ident(FL_UNSET)operator(()ident(str)operator(,) ident(STR_NOCAPA)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(=) ident(buf)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(capa) operator(=) ident(blen)operator(;) - ident(RSTRING)operator(()ident(dest)operator(\)->)ident(ptr) operator(=) integer(0)operator(;) - ident(RSTRING)operator(()ident(dest)operator(\)->)ident(len) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(RBASIC)operator(()ident(dest)operator(\)->)ident(klass) operator(=) ident(rb_obj_class)operator(()ident(str)operator(\);) - ident(OBJ_INFECT)operator(()ident(dest)operator(,) ident(str)operator(\);) - ident(str) operator(=) ident(dest)operator(;) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(bp) operator(-) ident(buf)operator(;) - - reserved(if) operator(()ident(tainted)operator(\)) ident(OBJ_TAINT)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.gsub!(pattern, replacement\) => str or nil - * str.gsub!(pattern\) {|match| block } => str or nil - * - * Performs the substitutions of String#gsub in place, returning - * str, or nil if no substitutions were performed. - */) - -directive(static) ident(VALUE) -ident(rb_str_gsub_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(str_gsub)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(,) integer(1)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.gsub(pattern, replacement\) => new_str - * str.gsub(pattern\) {|match| block } => new_str - * - * Returns a copy of str with all occurrences of pattern - * replaced with either replacement or the value of the block. The - * pattern will typically be a Regexp; if it is a - * String then no regular expression metacharacters will be - * interpreted (that is /\\d/ will match a digit, but - * '\\d' will match a backslash followed by a 'd'\). - * - * If a string is used as the replacement, special variables from the match - * (such as $& and $1\) cannot be substituted into it, - * as substitution into the string occurs before the pattern match - * starts. However, the sequences \\1, \\2, and so on - * may be used to interpolate successive groups in the match. - * - * In the block form, the current match string is passed in as a parameter, and - * variables such as $1, $2, $`, - * $&, and $' will be set appropriately. The value - * returned by the block will be substituted for the match on each call. - * - * The result inherits any tainting in the original string or any supplied - * replacement string. - * - * "hello".gsub(/[aeiou]/, '*'\) #=> "h*ll*" - * "hello".gsub(/([aeiou]\)/, '<\\1>'\) #=> "hll" - * "hello".gsub(/./\) {|s| s[0].to_s + ' '} #=> "104 101 108 108 111 " - */) - -directive(static) ident(VALUE) -ident(rb_str_gsub)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(str_gsub)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(,) integer(0)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.replace(other_str\) => str - * - * Replaces the contents and taintedness of str with the corresponding - * values in other_str. - * - * s = "hello" #=> "hello" - * s.replace "world" #=> "world" - */) - -directive(static) ident(VALUE) -ident(rb_str_replace)operator(()ident(str)operator(,) ident(str2)operator(\)) - ident(VALUE) ident(str)operator(,) ident(str2)operator(;) -operator({) - reserved(if) operator(()ident(str) operator(==) ident(str2)operator(\)) reserved(return) ident(str)operator(;) - - ident(StringValue)operator(()ident(str2)operator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str2)operator(,) ident(ELTS_SHARED)operator(\)\)) operator({) - reserved(if) operator(()ident(str_independent)operator(()ident(str)operator(\)\)) operator({) - ident(free)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator(;) - ident(FL_SET)operator(()ident(str)operator(,) ident(ELTS_SHARED)operator(\);) - ident(FL_UNSET)operator(()ident(str)operator(,) ident(STR_ASSOC)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(shared) operator(=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(aux)operator(.)ident(shared)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(str_independent)operator(()ident(str)operator(\)\)) operator({) - ident(rb_str_resize)operator(()ident(str)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\);) - ident(memcpy)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(\);) - reserved(if) operator((!)ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) operator({) - ident(make_null_str)operator(()ident(str)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(ptr)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(len)operator(;) - ident(str_make_independent)operator(()ident(str)operator(\);) - operator(}) - reserved(if) operator(()ident(FL_TEST)operator(()ident(str2)operator(,) ident(STR_ASSOC)operator(\)\)) operator({) - ident(FL_SET)operator(()ident(str)operator(,) ident(STR_ASSOC)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(aux)operator(.)ident(shared) operator(=) ident(RSTRING)operator(()ident(str2)operator(\)->)ident(aux)operator(.)ident(shared)operator(;) - operator(}) - operator(}) - - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(str2)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(uscore_get)operator((\)) -operator({) - ident(VALUE) ident(line)operator(;) - - ident(line) operator(=) ident(rb_lastline_get)operator((\);) - reserved(if) operator(()ident(TYPE)operator(()ident(line)operator(\)) operator(!=) ident(T_STRING)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(NIL_P)operator(()ident(line)operator(\)) operator(?) string operator(:) ident(rb_obj_classname)operator(()ident(line)operator(\)\);) - operator(}) - reserved(return) ident(line)operator(;) -operator(}) - -comment(/* - * call-seq: - * sub!(pattern, replacement\) => $_ or nil - * sub!(pattern\) {|...| block } => $_ or nil - * - * Equivalent to $_.sub!(args\). - */) - -directive(static) ident(VALUE) -ident(rb_f_sub_bang)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(return) ident(rb_str_sub_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(uscore_get)operator((\)\);) -operator(}) - -comment(/* - * call-seq: - * sub(pattern, replacement\) => $_ - * sub(pattern\) { block } => $_ - * - * Equivalent to $_.sub(args\), except that - * $_ will be updated if substitution occurs. - */) - -directive(static) ident(VALUE) -ident(rb_f_sub)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(rb_str_dup)operator(()ident(uscore_get)operator((\)\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(rb_str_sub_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)\)\)) - reserved(return) ident(str)operator(;) - ident(rb_lastline_set)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * gsub!(pattern, replacement\) => string or nil - * gsub!(pattern\) {|...| block } => string or nil - * - * Equivalent to Kernel::gsub, except nil is - * returned if $_ is not modified. - * - * $_ = "quick brown fox" - * gsub! /cat/, '*' #=> nil - * $_ #=> "quick brown fox" - */) - -directive(static) ident(VALUE) -ident(rb_f_gsub_bang)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(return) ident(rb_str_gsub_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(uscore_get)operator((\)\);) -operator(}) - -comment(/* - * call-seq: - * gsub(pattern, replacement\) => string - * gsub(pattern\) {|...| block } => string - * - * Equivalent to $_.gsub..., except that $_ - * receives the modified result. - * - * $_ = "quick brown fox" - * gsub /[aeiou]/, '*' #=> "q**ck br*wn f*x" - * $_ #=> "q**ck br*wn f*x" - */) - -directive(static) ident(VALUE) -ident(rb_f_gsub)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(rb_str_dup)operator(()ident(uscore_get)operator((\)\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(rb_str_gsub_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)\)\)) - reserved(return) ident(str)operator(;) - ident(rb_lastline_set)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.reverse! => str - * - * Reverses str in place. - */) - -directive(static) ident(VALUE) -ident(rb_str_reverse_bang)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(e)operator(;) - pre_type(char) ident(c)operator(;) - - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) integer(1)operator(\)) operator({) - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(e) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) integer(1)operator(;) - reserved(while) operator(()ident(s) operator(<) ident(e)operator(\)) operator({) - ident(c) operator(=) operator(*)ident(s)operator(;) - operator(*)ident(s)operator(++) operator(=) operator(*)ident(e)operator(;) - operator(*)ident(e)operator(--) operator(=) ident(c)operator(;) - operator(}) - operator(}) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.reverse => new_str - * - * Returns a new string with the characters from str in reverse order. - * - * "stressed".reverse #=> "desserts" - */) - -directive(static) ident(VALUE) -ident(rb_str_reverse)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(obj)operator(;) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(e)operator(,) operator(*)ident(p)operator(;) - - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(<=) integer(1)operator(\)) reserved(return) ident(rb_str_dup)operator(()ident(str)operator(\);) - - ident(obj) operator(=) ident(rb_str_new5)operator(()ident(str)operator(,) integer(0)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(e) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-) integer(1)operator(;) - ident(p) operator(=) ident(RSTRING)operator(()ident(obj)operator(\)->)ident(ptr)operator(;) - - reserved(while) operator(()ident(e) operator(>=) ident(s)operator(\)) operator({) - operator(*)ident(p)operator(++) operator(=) operator(*)ident(e)operator(--;) - operator(}) - ident(OBJ_INFECT)operator(()ident(obj)operator(,) ident(str)operator(\);) - - reserved(return) ident(obj)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.include? other_str => true or false - * str.include? fixnum => true or false - * - * Returns true if str contains the given string or - * character. - * - * "hello".include? "lo" #=> true - * "hello".include? "ol" #=> false - * "hello".include? ?h #=> true - */) - -directive(static) ident(VALUE) -ident(rb_str_include)operator(()ident(str)operator(,) ident(arg)operator(\)) - ident(VALUE) ident(str)operator(,) ident(arg)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(arg)operator(\)\)) operator({) - reserved(if) operator(()ident(memchr)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(FIX2INT)operator(()ident(arg)operator(\),) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) - operator(}) - - ident(StringValue)operator(()ident(arg)operator(\);) - ident(i) operator(=) ident(rb_str_index)operator(()ident(str)operator(,) ident(arg)operator(,) integer(0)operator(\);) - - reserved(if) operator(()ident(i) operator(==) operator(-)integer(1)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.to_i(base=10\) => integer - * - * Returns the result of interpreting leading characters in str as an - * integer base base (2, 8, 10, or 16\). Extraneous characters past the - * end of a valid number are ignored. If there is not a valid number at the - * start of str, 0 is returned. This method never raises an - * exception. - * - * "12345".to_i #=> 12345 - * "99 red balloons".to_i #=> 99 - * "0a".to_i #=> 0 - * "0a".to_i(16\) #=> 10 - * "hello".to_i #=> 0 - * "1100101".to_i(2\) #=> 101 - * "1100101".to_i(8\) #=> 294977 - * "1100101".to_i(10\) #=> 1100101 - * "1100101".to_i(16\) #=> 17826049 - */) - -directive(static) ident(VALUE) -ident(rb_str_to_i)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(b)operator(;) - pre_type(int) ident(base)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(b)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) ident(base) operator(=) integer(10)operator(;) - reserved(else) ident(base) operator(=) ident(NUM2INT)operator(()ident(b)operator(\);) - - reserved(if) operator(()ident(base) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(base)operator(\);) - operator(}) - reserved(return) ident(rb_str_to_inum)operator(()ident(str)operator(,) ident(base)operator(,) ident(Qfalse)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.to_f => float - * - * Returns the result of interpreting leading characters in str as a - * floating point number. Extraneous characters past the end of a valid number - * are ignored. If there is not a valid number at the start of str, - * 0.0 is returned. This method never raises an exception. - * - * "123.45e1".to_f #=> 1234.5 - * "45.67 degrees".to_f #=> 45.67 - * "thx1138".to_f #=> 0.0 - */) - -directive(static) ident(VALUE) -ident(rb_str_to_f)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(rb_float_new)operator(()ident(rb_str_to_dbl)operator(()ident(str)operator(,) ident(Qfalse)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * str.to_s => str - * str.to_str => str - * - * Returns the receiver. - */) - -directive(static) ident(VALUE) -ident(rb_str_to_s)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(if) operator(()ident(rb_obj_class)operator(()ident(str)operator(\)) operator(!=) ident(rb_cString)operator(\)) operator({) - ident(VALUE) ident(dup) operator(=) ident(str_alloc)operator(()ident(rb_cString)operator(\);) - ident(rb_str_replace)operator(()ident(dup)operator(,) ident(str)operator(\);) - reserved(return) ident(dup)operator(;) - operator(}) - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * str.inspect => string - * - * Returns a printable version of _str_, with special characters - * escaped. - * - * str = "hello" - * str[3] = 8 - * str.inspect #=> "hel\\010o" - */) - -ident(VALUE) -ident(rb_str_inspect)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - ident(VALUE) ident(result) operator(=) ident(rb_str_buf_new2)operator(()stringoperator(\);) - pre_type(char) ident(s)operator([)integer(5)operator(];) - - ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(pend) operator(=) ident(p) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - pre_type(char) ident(c) operator(=) operator(*)ident(p)operator(++;) - reserved(if) operator(()ident(ismbchar)operator(()ident(c)operator(\)) operator(&&) ident(p) operator(<) ident(pend)operator(\)) operator({) - pre_type(int) ident(len) operator(=) ident(mbclen)operator(()ident(c)operator(\);) - ident(rb_str_buf_cat)operator(()ident(result)operator(,) ident(p) operator(-) integer(1)operator(,) ident(len)operator(\);) - ident(p) operator(+=) ident(len) operator(-) integer(1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('"')operator(||) ident(c) operator(==) char('\\\\') operator(||) operator(()ident(c) operator(==) char('#') operator(&&) ident(IS_EVSTR)operator(()ident(p)operator(,) ident(pend)operator(\)\)\)) operator({) - ident(s)operator([)integer(0)operator(]) operator(=) char('\\\\')operator(;) ident(s)operator([)integer(1)operator(]) operator(=) ident(c)operator(;) - ident(rb_str_buf_cat)operator(()ident(result)operator(,) ident(s)operator(,) integer(2)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(ISPRINT)operator(()ident(c)operator(\)\)) operator({) - ident(s)operator([)integer(0)operator(]) operator(=) ident(c)operator(;) - ident(rb_str_buf_cat)operator(()ident(result)operator(,) ident(s)operator(,) integer(1)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\n')operator(\)) operator({) - ident(s)operator([)integer(0)operator(]) operator(=) char('\\\\')operator(;) ident(s)operator([)integer(1)operator(]) operator(=) char('n')operator(;) - ident(rb_str_buf_cat)operator(()ident(result)operator(,) ident(s)operator(,) integer(2)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\r')operator(\)) operator({) - ident(s)operator([)integer(0)operator(]) operator(=) char('\\\\')operator(;) ident(s)operator([)integer(1)operator(]) operator(=) char('r')operator(;) - ident(rb_str_buf_cat)operator(()ident(result)operator(,) ident(s)operator(,) integer(2)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\t')operator(\)) operator({) - ident(s)operator([)integer(0)operator(]) operator(=) char('\\\\')operator(;) ident(s)operator([)integer(1)operator(]) operator(=) char('t')operator(;) - ident(rb_str_buf_cat)operator(()ident(result)operator(,) ident(s)operator(,) integer(2)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\f')operator(\)) operator({) - ident(s)operator([)integer(0)operator(]) operator(=) char('\\\\')operator(;) ident(s)operator([)integer(1)operator(]) operator(=) char('f')operator(;) - ident(rb_str_buf_cat)operator(()ident(result)operator(,) ident(s)operator(,) integer(2)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\013')operator(\)) operator({) - ident(s)operator([)integer(0)operator(]) operator(=) char('\\\\')operator(;) ident(s)operator([)integer(1)operator(]) operator(=) char('v')operator(;) - ident(rb_str_buf_cat)operator(()ident(result)operator(,) ident(s)operator(,) integer(2)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\010')operator(\)) operator({) - ident(s)operator([)integer(0)operator(]) operator(=) char('\\\\')operator(;) ident(s)operator([)integer(1)operator(]) operator(=) char('b')operator(;) - ident(rb_str_buf_cat)operator(()ident(result)operator(,) ident(s)operator(,) integer(2)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\007')operator(\)) operator({) - ident(s)operator([)integer(0)operator(]) operator(=) char('\\\\')operator(;) ident(s)operator([)integer(1)operator(]) operator(=) char('a')operator(;) - ident(rb_str_buf_cat)operator(()ident(result)operator(,) ident(s)operator(,) integer(2)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) oct(033)operator(\)) operator({) - ident(s)operator([)integer(0)operator(]) operator(=) char('\\\\')operator(;) ident(s)operator([)integer(1)operator(]) operator(=) char('e')operator(;) - ident(rb_str_buf_cat)operator(()ident(result)operator(,) ident(s)operator(,) integer(2)operator(\);) - operator(}) - reserved(else) operator({) - ident(sprintf)operator(()ident(s)operator(,) stringoperator(,) ident(c) operator(&) oct(0377)operator(\);) - ident(rb_str_buf_cat2)operator(()ident(result)operator(,) ident(s)operator(\);) - operator(}) - operator(}) - ident(rb_str_buf_cat2)operator(()ident(result)operator(,) stringoperator(\);) - - ident(OBJ_INFECT)operator(()ident(result)operator(,) ident(str)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.dump => new_str - * - * Produces a version of str with all nonprinting characters replaced by - * \\nnn notation and all special characters escaped. - */) - -ident(VALUE) -ident(rb_str_dump)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(long) ident(len)operator(;) - pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - pre_type(char) operator(*)ident(q)operator(,) operator(*)ident(qend)operator(;) - ident(VALUE) ident(result)operator(;) - - ident(len) operator(=) integer(2)operator(;) comment(/* "" */) - ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(pend) operator(=) ident(p) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - pre_type(char) ident(c) operator(=) operator(*)ident(p)operator(++;) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('"')operator(:) reserved(case) char('\\\\')operator(:) - reserved(case) char('\\n')operator(:) reserved(case) char('\\r')operator(:) - reserved(case) char('\\t')operator(:) reserved(case) char('\\f')operator(:) - reserved(case) char('\\013')operator(:) reserved(case) char('\\010')operator(:) reserved(case) char('\\007')operator(:) reserved(case) char('\\033')operator(:) - ident(len) operator(+=) integer(2)operator(;) - reserved(break)operator(;) - - reserved(case) char('#')operator(:) - ident(len) operator(+=) ident(IS_EVSTR)operator(()ident(p)operator(,) ident(pend)operator(\)) operator(?) integer(2) operator(:) integer(1)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(if) operator(()ident(ISPRINT)operator(()ident(c)operator(\)\)) operator({) - ident(len)operator(++;) - operator(}) - reserved(else) operator({) - ident(len) operator(+=) integer(4)operator(;) comment(/* \\nnn */) - operator(}) - reserved(break)operator(;) - operator(}) - operator(}) - - ident(result) operator(=) ident(rb_str_new5)operator(()ident(str)operator(,) integer(0)operator(,) ident(len)operator(\);) - ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(pend) operator(=) ident(p) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(q) operator(=) ident(RSTRING)operator(()ident(result)operator(\)->)ident(ptr)operator(;) ident(qend) operator(=) ident(q) operator(+) ident(len)operator(;) - - operator(*)ident(q)operator(++) operator(=) char('"')operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - pre_type(char) ident(c) operator(=) operator(*)ident(p)operator(++;) - - reserved(if) operator(()ident(c) operator(==) char('"') operator(||) ident(c) operator(==) char('\\\\')operator(\)) operator({) - operator(*)ident(q)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(q)operator(++) operator(=) ident(c)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('#')operator(\)) operator({) - reserved(if) operator(()ident(IS_EVSTR)operator(()ident(p)operator(,) ident(pend)operator(\)\)) operator(*)ident(q)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(q)operator(++) operator(=) char('#')operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ISPRINT)operator(()ident(c)operator(\)\)) operator({) - operator(*)ident(q)operator(++) operator(=) ident(c)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\n')operator(\)) operator({) - operator(*)ident(q)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(q)operator(++) operator(=) char('n')operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\r')operator(\)) operator({) - operator(*)ident(q)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(q)operator(++) operator(=) char('r')operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\t')operator(\)) operator({) - operator(*)ident(q)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(q)operator(++) operator(=) char('t')operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\f')operator(\)) operator({) - operator(*)ident(q)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(q)operator(++) operator(=) char('f')operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\013')operator(\)) operator({) - operator(*)ident(q)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(q)operator(++) operator(=) char('v')operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\010')operator(\)) operator({) - operator(*)ident(q)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(q)operator(++) operator(=) char('b')operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\007')operator(\)) operator({) - operator(*)ident(q)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(q)operator(++) operator(=) char('a')operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(c) operator(==) char('\\033')operator(\)) operator({) - operator(*)ident(q)operator(++) operator(=) char('\\\\')operator(;) - operator(*)ident(q)operator(++) operator(=) char('e')operator(;) - operator(}) - reserved(else) operator({) - operator(*)ident(q)operator(++) operator(=) char('\\\\')operator(;) - ident(sprintf)operator(()ident(q)operator(,) stringoperator(,) ident(c)operator(&)hex(0xff)operator(\);) - ident(q) operator(+=) integer(3)operator(;) - operator(}) - operator(}) - operator(*)ident(q)operator(++) operator(=) char('"')operator(;) - - ident(OBJ_INFECT)operator(()ident(result)operator(,) ident(str)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.upcase! => str or nil - * - * Upcases the contents of str, returning nil if no changes - * were made. - */) - -directive(static) ident(VALUE) -ident(rb_str_upcase_bang)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(send)operator(;) - pre_type(int) ident(modify) operator(=) integer(0)operator(;) - - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(send) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - reserved(if) operator(()ident(ismbchar)operator((*)ident(s)operator(\)\)) operator({) - ident(s)operator(+=)ident(mbclen)operator((*)ident(s)operator(\)) operator(-) integer(1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ISLOWER)operator((*)ident(s)operator(\)\)) operator({) - operator(*)ident(s) operator(=) ident(toupper)operator((*)ident(s)operator(\);) - ident(modify) operator(=) integer(1)operator(;) - operator(}) - ident(s)operator(++;) - operator(}) - - reserved(if) operator(()ident(modify)operator(\)) reserved(return) ident(str)operator(;) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.upcase => new_str - * - * Returns a copy of str with all lowercase letters replaced with their - * uppercase counterparts. The operation is locale insensitive---only - * characters ``a'' to ``z'' are affected. - * - * "hEllO".upcase #=> "HELLO" - */) - -directive(static) ident(VALUE) -ident(rb_str_upcase)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_upcase_bang)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.downcase! => str or nil - * - * Downcases the contents of str, returning nil if no - * changes were made. - */) - -directive(static) ident(VALUE) -ident(rb_str_downcase_bang)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(send)operator(;) - pre_type(int) ident(modify) operator(=) integer(0)operator(;) - - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(send) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - reserved(if) operator(()ident(ismbchar)operator((*)ident(s)operator(\)\)) operator({) - ident(s)operator(+=)ident(mbclen)operator((*)ident(s)operator(\)) operator(-) integer(1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ISUPPER)operator((*)ident(s)operator(\)\)) operator({) - operator(*)ident(s) operator(=) ident(tolower)operator((*)ident(s)operator(\);) - ident(modify) operator(=) integer(1)operator(;) - operator(}) - ident(s)operator(++;) - operator(}) - - reserved(if) operator(()ident(modify)operator(\)) reserved(return) ident(str)operator(;) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.downcase => new_str - * - * Returns a copy of str with all uppercase letters replaced with their - * lowercase counterparts. The operation is locale insensitive---only - * characters ``A'' to ``Z'' are affected. - * - * "hEllO".downcase #=> "hello" - */) - -directive(static) ident(VALUE) -ident(rb_str_downcase)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_downcase_bang)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.capitalize! => str or nil - * - * Modifies str by converting the first character to uppercase and the - * remainder to lowercase. Returns nil if no changes are made. - * - * a = "hello" - * a.capitalize! #=> "Hello" - * a #=> "Hello" - * a.capitalize! #=> nil - */) - -directive(static) ident(VALUE) -ident(rb_str_capitalize_bang)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(send)operator(;) - pre_type(int) ident(modify) operator(=) integer(0)operator(;) - - ident(rb_str_modify)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0) operator(||) operator(!)ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(send) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(ISLOWER)operator((*)ident(s)operator(\)\)) operator({) - operator(*)ident(s) operator(=) ident(toupper)operator((*)ident(s)operator(\);) - ident(modify) operator(=) integer(1)operator(;) - operator(}) - reserved(while) operator((++)ident(s) operator(<) ident(send)operator(\)) operator({) - reserved(if) operator(()ident(ismbchar)operator((*)ident(s)operator(\)\)) operator({) - ident(s)operator(+=)ident(mbclen)operator((*)ident(s)operator(\)) operator(-) integer(1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ISUPPER)operator((*)ident(s)operator(\)\)) operator({) - operator(*)ident(s) operator(=) ident(tolower)operator((*)ident(s)operator(\);) - ident(modify) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(modify)operator(\)) reserved(return) ident(str)operator(;) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.capitalize => new_str - * - * Returns a copy of str with the first character converted to uppercase - * and the remainder to lowercase. - * - * "hello".capitalize #=> "Hello" - * "HELLO".capitalize #=> "Hello" - * "123ABC".capitalize #=> "123abc" - */) - -directive(static) ident(VALUE) -ident(rb_str_capitalize)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_capitalize_bang)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.swapcase! => str or nil - * - * Equivalent to String#swapcase, but modifies the receiver in - * place, returning str, or nil if no changes were made. - */) - -directive(static) ident(VALUE) -ident(rb_str_swapcase_bang)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(send)operator(;) - pre_type(int) ident(modify) operator(=) integer(0)operator(;) - - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(send) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - reserved(if) operator(()ident(ismbchar)operator((*)ident(s)operator(\)\)) operator({) - ident(s)operator(+=)ident(mbclen)operator((*)ident(s)operator(\)) operator(-) integer(1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ISUPPER)operator((*)ident(s)operator(\)\)) operator({) - operator(*)ident(s) operator(=) ident(tolower)operator((*)ident(s)operator(\);) - ident(modify) operator(=) integer(1)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ISLOWER)operator((*)ident(s)operator(\)\)) operator({) - operator(*)ident(s) operator(=) ident(toupper)operator((*)ident(s)operator(\);) - ident(modify) operator(=) integer(1)operator(;) - operator(}) - ident(s)operator(++;) - operator(}) - - reserved(if) operator(()ident(modify)operator(\)) reserved(return) ident(str)operator(;) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.swapcase => new_str - * - * Returns a copy of str with uppercase alphabetic characters converted - * to lowercase and lowercase characters converted to uppercase. - * - * "Hello".swapcase #=> "hELLO" - * "cYbEr_PuNk11".swapcase #=> "CyBeR_pUnK11" - */) - -directive(static) ident(VALUE) -ident(rb_str_swapcase)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_swapcase_bang)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -reserved(typedef) pre_type(unsigned) pre_type(char) operator(*)ident(USTR)operator(;) - -reserved(struct) ident(tr) operator({) - pre_type(int) ident(gen)operator(,) ident(now)operator(,) ident(max)operator(;) - pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) -operator(};) - -directive(static) pre_type(int) -ident(trnext)operator(()ident(t)operator(\)) - reserved(struct) ident(tr) operator(*)ident(t)operator(;) -operator({) - reserved(for) operator((;;\)) operator({) - reserved(if) operator((!)ident(t)operator(->)ident(gen)operator(\)) operator({) - reserved(if) operator(()ident(t)operator(->)ident(p) operator(==) ident(t)operator(->)ident(pend)operator(\)) reserved(return) operator(-)integer(1)operator(;) - reserved(if) operator(()ident(t)operator(->)ident(p) operator(<) ident(t)operator(->)ident(pend) operator(-) integer(1) operator(&&) operator(*)ident(t)operator(->)ident(p) operator(==) char('\\\\')operator(\)) operator({) - ident(t)operator(->)ident(p)operator(++;) - operator(}) - ident(t)operator(->)ident(now) operator(=) operator(*()ident(USTR)operator(\))ident(t)operator(->)ident(p)operator(++;) - reserved(if) operator(()ident(t)operator(->)ident(p) operator(<) ident(t)operator(->)ident(pend) operator(-) integer(1) operator(&&) operator(*)ident(t)operator(->)ident(p) operator(==) char('-')operator(\)) operator({) - ident(t)operator(->)ident(p)operator(++;) - reserved(if) operator(()ident(t)operator(->)ident(p) operator(<) ident(t)operator(->)ident(pend)operator(\)) operator({) - reserved(if) operator(()ident(t)operator(->)ident(now) operator(>) operator(*()ident(USTR)operator(\))ident(t)operator(->)ident(p)operator(\)) operator({) - ident(t)operator(->)ident(p)operator(++;) - reserved(continue)operator(;) - operator(}) - ident(t)operator(->)ident(gen) operator(=) integer(1)operator(;) - ident(t)operator(->)ident(max) operator(=) operator(*()ident(USTR)operator(\))ident(t)operator(->)ident(p)operator(++;) - operator(}) - operator(}) - reserved(return) ident(t)operator(->)ident(now)operator(;) - operator(}) - reserved(else) reserved(if) operator((++)ident(t)operator(->)ident(now) operator(<) ident(t)operator(->)ident(max)operator(\)) operator({) - reserved(return) ident(t)operator(->)ident(now)operator(;) - operator(}) - reserved(else) operator({) - ident(t)operator(->)ident(gen) operator(=) integer(0)operator(;) - reserved(return) ident(t)operator(->)ident(max)operator(;) - operator(}) - operator(}) -operator(}) - -directive(static) ident(VALUE) ident(rb_str_delete_bang) ident(_)operator((()pre_type(int)operator(,)ident(VALUE)operator(*,)ident(VALUE)operator(\)\);) - -directive(static) ident(VALUE) -ident(tr_trans)operator(()ident(str)operator(,) ident(src)operator(,) ident(repl)operator(,) ident(sflag)operator(\)) - ident(VALUE) ident(str)operator(,) ident(src)operator(,) ident(repl)operator(;) - pre_type(int) ident(sflag)operator(;) -operator({) - reserved(struct) ident(tr) ident(trsrc)operator(,) ident(trrepl)operator(;) - pre_type(int) ident(cflag) operator(=) integer(0)operator(;) - pre_type(int) ident(trans)operator([)integer(256)operator(];) - pre_type(int) ident(i)operator(,) ident(c)operator(,) ident(modify) operator(=) integer(0)operator(;) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(send)operator(;) - - ident(StringValue)operator(()ident(src)operator(\);) - ident(StringValue)operator(()ident(repl)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0) operator(||) operator(!)ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(trsrc)operator(.)ident(p) operator(=) ident(RSTRING)operator(()ident(src)operator(\)->)ident(ptr)operator(;) ident(trsrc)operator(.)ident(pend) operator(=) ident(trsrc)operator(.)ident(p) operator(+) ident(RSTRING)operator(()ident(src)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(src)operator(\)->)ident(len) operator(>=) integer(2) operator(&&) ident(RSTRING)operator(()ident(src)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(==) char('^')operator(\)) operator({) - ident(cflag)operator(++;) - ident(trsrc)operator(.)ident(p)operator(++;) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(repl)operator(\)->)ident(len) operator(==) integer(0)operator(\)) operator({) - reserved(return) ident(rb_str_delete_bang)operator(()integer(1)operator(,) operator(&)ident(src)operator(,) ident(str)operator(\);) - operator(}) - ident(trrepl)operator(.)ident(p) operator(=) ident(RSTRING)operator(()ident(repl)operator(\)->)ident(ptr)operator(;) - ident(trrepl)operator(.)ident(pend) operator(=) ident(trrepl)operator(.)ident(p) operator(+) ident(RSTRING)operator(()ident(repl)operator(\)->)ident(len)operator(;) - ident(trsrc)operator(.)ident(gen) operator(=) ident(trrepl)operator(.)ident(gen) operator(=) integer(0)operator(;) - ident(trsrc)operator(.)ident(now) operator(=) ident(trrepl)operator(.)ident(now) operator(=) integer(0)operator(;) - ident(trsrc)operator(.)ident(max) operator(=) ident(trrepl)operator(.)ident(max) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(cflag)operator(\)) operator({) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)integer(256)operator(;) ident(i)operator(++\)) operator({) - ident(trans)operator([)ident(i)operator(]) operator(=) integer(1)operator(;) - operator(}) - reserved(while) operator((()ident(c) operator(=) ident(trnext)operator((&)ident(trsrc)operator(\)\)) operator(>=) integer(0)operator(\)) operator({) - ident(trans)operator([)ident(c) operator(&) hex(0xff)operator(]) operator(=) operator(-)integer(1)operator(;) - operator(}) - reserved(while) operator((()ident(c) operator(=) ident(trnext)operator((&)ident(trrepl)operator(\)\)) operator(>=) integer(0)operator(\)) - comment(/* retrieve last replacer */)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)integer(256)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(trans)operator([)ident(i)operator(]) operator(>=) integer(0)operator(\)) operator({) - ident(trans)operator([)ident(i)operator(]) operator(=) ident(trrepl)operator(.)ident(now)operator(;) - operator(}) - operator(}) - operator(}) - reserved(else) operator({) - pre_type(int) ident(r)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)integer(256)operator(;) ident(i)operator(++\)) operator({) - ident(trans)operator([)ident(i)operator(]) operator(=) operator(-)integer(1)operator(;) - operator(}) - reserved(while) operator((()ident(c) operator(=) ident(trnext)operator((&)ident(trsrc)operator(\)\)) operator(>=) integer(0)operator(\)) operator({) - ident(r) operator(=) ident(trnext)operator((&)ident(trrepl)operator(\);) - reserved(if) operator(()ident(r) operator(==) operator(-)integer(1)operator(\)) ident(r) operator(=) ident(trrepl)operator(.)ident(now)operator(;) - ident(trans)operator([)ident(c) operator(&) hex(0xff)operator(]) operator(=) ident(r)operator(;) - operator(}) - operator(}) - - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(send) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(sflag)operator(\)) operator({) - pre_type(char) operator(*)ident(t) operator(=) ident(s)operator(;) - pre_type(int) ident(c0)operator(,) ident(last) operator(=) operator(-)integer(1)operator(;) - - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - ident(c0) operator(=) operator(*)ident(s)operator(++;) - reserved(if) operator((()ident(c) operator(=) ident(trans)operator([)ident(c0) operator(&) hex(0xff)operator(]\)) operator(>=) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(last) operator(==) ident(c)operator(\)) reserved(continue)operator(;) - ident(last) operator(=) ident(c)operator(;) - operator(*)ident(t)operator(++) operator(=) ident(c) operator(&) hex(0xff)operator(;) - ident(modify) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(last) operator(=) operator(-)integer(1)operator(;) - operator(*)ident(t)operator(++) operator(=) ident(c0)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) operator(()ident(t) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) operator(()ident(t) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - ident(modify) operator(=) integer(1)operator(;) - operator(*)ident(t) operator(=) char('\\0')operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - reserved(if) operator((()ident(c) operator(=) ident(trans)operator([*)ident(s) operator(&) hex(0xff)operator(]\)) operator(>=) integer(0)operator(\)) operator({) - operator(*)ident(s) operator(=) ident(c) operator(&) hex(0xff)operator(;) - ident(modify) operator(=) integer(1)operator(;) - operator(}) - ident(s)operator(++;) - operator(}) - operator(}) - - reserved(if) operator(()ident(modify)operator(\)) reserved(return) ident(str)operator(;) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.tr!(from_str, to_str\) => str or nil - * - * Translates str in place, using the same rules as - * String#tr. Returns str, or nil if no - * changes were made. - */) - -directive(static) ident(VALUE) -ident(rb_str_tr_bang)operator(()ident(str)operator(,) ident(src)operator(,) ident(repl)operator(\)) - ident(VALUE) ident(str)operator(,) ident(src)operator(,) ident(repl)operator(;) -operator({) - reserved(return) ident(tr_trans)operator(()ident(str)operator(,) ident(src)operator(,) ident(repl)operator(,) integer(0)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.tr(from_str, to_str\) => new_str - * - * Returns a copy of str with the characters in from_str replaced - * by the corresponding characters in to_str. If to_str is - * shorter than from_str, it is padded with its last character. Both - * strings may use the c1--c2 notation to denote ranges of characters, and - * from_str may start with a ^, which denotes all - * characters except those listed. - * - * "hello".tr('aeiou', '*'\) #=> "h*ll*" - * "hello".tr('^aeiou', '*'\) #=> "*e**o" - * "hello".tr('el', 'ip'\) #=> "hippo" - * "hello".tr('a-y', 'b-z'\) #=> "ifmmp" - */) - -directive(static) ident(VALUE) -ident(rb_str_tr)operator(()ident(str)operator(,) ident(src)operator(,) ident(repl)operator(\)) - ident(VALUE) ident(str)operator(,) ident(src)operator(,) ident(repl)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(tr_trans)operator(()ident(str)operator(,) ident(src)operator(,) ident(repl)operator(,) integer(0)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) directive(void) -ident(tr_setup_table)operator(()ident(str)operator(,) ident(table)operator(,) ident(init)operator(\)) - ident(VALUE) ident(str)operator(;) - pre_type(char) ident(table)operator([)integer(256)operator(];) - pre_type(int) ident(init)operator(;) -operator({) - pre_type(char) ident(buf)operator([)integer(256)operator(];) - reserved(struct) ident(tr) ident(tr)operator(;) - pre_type(int) ident(i)operator(,) ident(c)operator(;) - pre_type(int) ident(cflag) operator(=) integer(0)operator(;) - - ident(tr)operator(.)ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) ident(tr)operator(.)ident(pend) operator(=) ident(tr)operator(.)ident(p) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(tr)operator(.)ident(gen) operator(=) ident(tr)operator(.)ident(now) operator(=) ident(tr)operator(.)ident(max) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) integer(1) operator(&&) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(==) char('^')operator(\)) operator({) - ident(cflag) operator(=) integer(1)operator(;) - ident(tr)operator(.)ident(p)operator(++;) - operator(}) - - reserved(if) operator(()ident(init)operator(\)) operator({) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)integer(256)operator(;) ident(i)operator(++\)) operator({) - ident(table)operator([)ident(i)operator(]) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)integer(256)operator(;) ident(i)operator(++\)) operator({) - ident(buf)operator([)ident(i)operator(]) operator(=) ident(cflag)operator(;) - operator(}) - reserved(while) operator((()ident(c) operator(=) ident(trnext)operator((&)ident(tr)operator(\)\)) operator(>=) integer(0)operator(\)) operator({) - ident(buf)operator([)ident(c) operator(&) hex(0xff)operator(]) operator(=) operator(!)ident(cflag)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)integer(256)operator(;) ident(i)operator(++\)) operator({) - ident(table)operator([)ident(i)operator(]) operator(=) ident(table)operator([)ident(i)operator(]) operator(&&) ident(buf)operator([)ident(i)operator(];) - operator(}) -operator(}) - - -comment(/* - * call-seq: - * str.delete!([other_str]+>\) => str or nil - * - * Performs a delete operation in place, returning str, or - * nil if str was not modified. - */) - -directive(static) ident(VALUE) -ident(rb_str_delete_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(send)operator(,) operator(*)ident(t)operator(;) - pre_type(char) ident(squeez)operator([)integer(256)operator(];) - pre_type(int) ident(modify) operator(=) integer(0)operator(;) - pre_type(int) ident(init) operator(=) integer(1)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(if) operator(()ident(argc) operator(<) integer(1)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(s) operator(=) ident(argv)operator([)ident(i)operator(];) - - ident(StringValue)operator(()ident(s)operator(\);) - ident(tr_setup_table)operator(()ident(s)operator(,) ident(squeez)operator(,) ident(init)operator(\);) - ident(init) operator(=) integer(0)operator(;) - operator(}) - - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(s) operator(=) ident(t) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - reserved(if) operator((!)ident(s) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(send) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - reserved(if) operator(()ident(squeez)operator([*)ident(s) operator(&) hex(0xff)operator(]\)) - ident(modify) operator(=) integer(1)operator(;) - reserved(else) - operator(*)ident(t)operator(++) operator(=) operator(*)ident(s)operator(;) - ident(s)operator(++;) - operator(}) - operator(*)ident(t) operator(=) char('\\0')operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(t) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - - reserved(if) operator(()ident(modify)operator(\)) reserved(return) ident(str)operator(;) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.delete([other_str]+\) => new_str - * - * Returns a copy of str with all characters in the intersection of its - * arguments deleted. Uses the same rules for building the set of characters as - * String#count. - * - * "hello".delete "l","lo" #=> "heo" - * "hello".delete "lo" #=> "he" - * "hello".delete "aeiou", "^e" #=> "hell" - * "hello".delete "ej-m" #=> "ho" - */) - -directive(static) ident(VALUE) -ident(rb_str_delete)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_delete_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.squeeze!([other_str]*\) => str or nil - * - * Squeezes str in place, returning either str, or - * nil if no changes were made. - */) - -directive(static) ident(VALUE) -ident(rb_str_squeeze_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) ident(squeez)operator([)integer(256)operator(];) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(send)operator(,) operator(*)ident(t)operator(;) - pre_type(int) ident(c)operator(,) ident(save)operator(,) ident(modify) operator(=) integer(0)operator(;) - pre_type(int) ident(init) operator(=) integer(1)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(if) operator(()ident(argc) operator(==) integer(0)operator(\)) operator({) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)integer(256)operator(;) ident(i)operator(++\)) operator({) - ident(squeez)operator([)ident(i)operator(]) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(s) operator(=) ident(argv)operator([)ident(i)operator(];) - - ident(StringValue)operator(()ident(s)operator(\);) - ident(tr_setup_table)operator(()ident(s)operator(,) ident(squeez)operator(,) ident(init)operator(\);) - ident(init) operator(=) integer(0)operator(;) - operator(}) - operator(}) - - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(s) operator(=) ident(t) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - reserved(if) operator((!)ident(s) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(send) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(save) operator(=) operator(-)integer(1)operator(;) - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - ident(c) operator(=) operator(*)ident(s)operator(++) operator(&) hex(0xff)operator(;) - reserved(if) operator(()ident(c) operator(!=) ident(save) operator(||) operator(!)ident(squeez)operator([)ident(c)operator(]\)) operator({) - operator(*)ident(t)operator(++) operator(=) ident(save) operator(=) ident(c)operator(;) - operator(}) - operator(}) - operator(*)ident(t) operator(=) char('\\0')operator(;) - reserved(if) operator(()ident(t) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(!=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(t) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(modify) operator(=) integer(1)operator(;) - operator(}) - - reserved(if) operator(()ident(modify)operator(\)) reserved(return) ident(str)operator(;) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.squeeze([other_str]*\) => new_str - * - * Builds a set of characters from the other_str parameter(s\) using the - * procedure described for String#count. Returns a new string - * where runs of the same character that occur in this set are replaced by a - * single character. If no arguments are given, all runs of identical - * characters are replaced by a single character. - * - * "yellow moon".squeeze #=> "yelow mon" - * " now is the".squeeze(" "\) #=> " now is the" - * "putters shoot balls".squeeze("m-z"\) #=> "puters shot balls" - */) - -directive(static) ident(VALUE) -ident(rb_str_squeeze)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_squeeze_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.tr_s!(from_str, to_str\) => str or nil - * - * Performs String#tr_s processing on str in place, - * returning str, or nil if no changes were made. - */) - -directive(static) ident(VALUE) -ident(rb_str_tr_s_bang)operator(()ident(str)operator(,) ident(src)operator(,) ident(repl)operator(\)) - ident(VALUE) ident(str)operator(,) ident(src)operator(,) ident(repl)operator(;) -operator({) - reserved(return) ident(tr_trans)operator(()ident(str)operator(,) ident(src)operator(,) ident(repl)operator(,) integer(1)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.tr_s(from_str, to_str\) => new_str - * - * Processes a copy of str as described under String#tr, - * then removes duplicate characters in regions that were affected by the - * translation. - * - * "hello".tr_s('l', 'r'\) #=> "hero" - * "hello".tr_s('el', '*'\) #=> "h*o" - * "hello".tr_s('el', 'hx'\) #=> "hhxo" - */) - -directive(static) ident(VALUE) -ident(rb_str_tr_s)operator(()ident(str)operator(,) ident(src)operator(,) ident(repl)operator(\)) - ident(VALUE) ident(str)operator(,) ident(src)operator(,) ident(repl)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(tr_trans)operator(()ident(str)operator(,) ident(src)operator(,) ident(repl)operator(,) integer(1)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.count([other_str]+\) => fixnum - * - * Each other_str parameter defines a set of characters to count. The - * intersection of these sets defines the characters to count in - * str. Any other_str that starts with a caret (^\) is - * negated. The sequence c1--c2 means all characters between c1 and c2. - * - * a = "hello world" - * a.count "lo" #=> 5 - * a.count "lo", "o" #=> 2 - * a.count "hello", "^l" #=> 4 - * a.count "ej-m" #=> 4 - */) - -directive(static) ident(VALUE) -ident(rb_str_count)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) ident(table)operator([)integer(256)operator(];) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(send)operator(;) - pre_type(int) ident(init) operator(=) integer(1)operator(;) - pre_type(int) ident(i)operator(;) - - reserved(if) operator(()ident(argc) operator(<) integer(1)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(argc)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(s) operator(=) ident(argv)operator([)ident(i)operator(];) - - ident(StringValue)operator(()ident(s)operator(\);) - ident(tr_setup_table)operator(()ident(s)operator(,) ident(table)operator(,) ident(init)operator(\);) - ident(init) operator(=) integer(0)operator(;) - operator(}) - - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - reserved(if) operator((!)ident(s) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - ident(send) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(i) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(s) operator(<) ident(send)operator(\)) operator({) - reserved(if) operator(()ident(table)operator([*)ident(s)operator(++) operator(&) hex(0xff)operator(]\)) operator({) - ident(i)operator(++;) - operator(}) - operator(}) - reserved(return) ident(INT2NUM)operator(()ident(i)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.split(pattern=$;, [limit]\) => anArray - * - * Divides str into substrings based on a delimiter, returning an array - * of these substrings. - * - * If pattern is a String, then its contents are used as - * the delimiter when splitting str. If pattern is a single - * space, str is split on whitespace, with leading whitespace and runs - * of contiguous whitespace characters ignored. - * - * If pattern is a Regexp, str is divided where the - * pattern matches. Whenever the pattern matches a zero-length string, - * str is split into individual characters. - * - * If pattern is omitted, the value of $; is used. If - * $; is nil (which is the default\), str is - * split on whitespace as if ` ' were specified. - * - * If the limit parameter is omitted, trailing null fields are - * suppressed. If limit is a positive number, at most that number of - * fields will be returned (if limit is 1, the entire - * string is returned as the only entry in an array\). If negative, there is no - * limit to the number of fields returned, and trailing null fields are not - * suppressed. - * - * " now's the time".split #=> ["now's", "the", "time"] - * " now's the time".split(' '\) #=> ["now's", "the", "time"] - * " now's the time".split(/ /\) #=> ["", "now's", "", "the", "time"] - * "1, 2.34,56, 7".split(%r{,\\s*}\) #=> ["1", "2.34", "56", "7"] - * "hello".split(//\) #=> ["h", "e", "l", "l", "o"] - * "hello".split(//, 3\) #=> ["h", "e", "llo"] - * "hi mom".split(%r{\\s*}\) #=> ["h", "i", "m", "o", "m"] - * - * "mellow yellow".split("ello"\) #=> ["m", "w y", "w"] - * "1,2,,3,4,,".split(','\) #=> ["1", "2", "", "3", "4"] - * "1,2,,3,4,,".split(',', 4\) #=> ["1", "2", "", "3,4,,"] - * "1,2,,3,4,,".split(',', -4\) #=> ["1", "2", "", "3", "4", "", ""] - */) - -directive(static) ident(VALUE) -ident(rb_str_split_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(spat)operator(;) - ident(VALUE) ident(limit)operator(;) - pre_type(int) ident(awk_split) operator(=) ident(Qfalse)operator(;) - pre_type(long) ident(beg)operator(,) ident(end)operator(,) ident(i) operator(=) integer(0)operator(;) - pre_type(int) ident(lim) operator(=) integer(0)operator(;) - ident(VALUE) ident(result)operator(,) ident(tmp)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(spat)operator(,) operator(&)ident(limit)operator(\)) operator(==) integer(2)operator(\)) operator({) - ident(lim) operator(=) ident(NUM2INT)operator(()ident(limit)operator(\);) - reserved(if) operator(()ident(lim) operator(<=) integer(0)operator(\)) ident(limit) operator(=) ident(Qnil)operator(;) - reserved(else) reserved(if) operator(()ident(lim) operator(==) integer(1)operator(\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) - reserved(return) ident(rb_ary_new2)operator(()integer(0)operator(\);) - reserved(return) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(str)operator(\);) - operator(}) - ident(i) operator(=) integer(1)operator(;) - operator(}) - - reserved(if) operator(()ident(NIL_P)operator(()ident(spat)operator(\)\)) operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(rb_fs)operator(\)\)) operator({) - ident(spat) operator(=) ident(rb_fs)operator(;) - reserved(goto) ident(fs_set)operator(;) - operator(}) - ident(awk_split) operator(=) ident(Qtrue)operator(;) - operator(}) - reserved(else) operator({) - label(fs_set:) - reserved(if) operator(()ident(TYPE)operator(()ident(spat)operator(\)) operator(==) ident(T_STRING) operator(&&) ident(RSTRING)operator(()ident(spat)operator(\)->)ident(len) operator(==) integer(1)operator(\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(spat)operator(\)->)ident(ptr)operator([)integer(0)operator(]) operator(==) char(' ')operator(\)) operator({) - ident(awk_split) operator(=) ident(Qtrue)operator(;) - operator(}) - reserved(else) operator({) - ident(spat) operator(=) ident(rb_reg_regcomp)operator(()ident(rb_reg_quote)operator(()ident(spat)operator(\)\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(spat) operator(=) ident(get_pat)operator(()ident(spat)operator(,) integer(1)operator(\);) - operator(}) - operator(}) - - ident(result) operator(=) ident(rb_ary_new)operator((\);) - ident(beg) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(awk_split)operator(\)) operator({) - pre_type(char) operator(*)ident(ptr) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - pre_type(long) ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - pre_type(char) operator(*)ident(eptr) operator(=) ident(ptr) operator(+) ident(len)operator(;) - pre_type(int) ident(skip) operator(=) integer(1)operator(;) - - reserved(for) operator(()ident(end) operator(=) ident(beg) operator(=) integer(0)operator(;) ident(ptr)operator(<)ident(eptr)operator(;) ident(ptr)operator(++\)) operator({) - reserved(if) operator(()ident(skip)operator(\)) operator({) - reserved(if) operator(()ident(ISSPACE)operator((*)ident(ptr)operator(\)\)) operator({) - ident(beg)operator(++;) - operator(}) - reserved(else) operator({) - ident(end) operator(=) ident(beg)operator(+)integer(1)operator(;) - ident(skip) operator(=) integer(0)operator(;) - reserved(if) operator((!)ident(NIL_P)operator(()ident(limit)operator(\)) operator(&&) ident(lim) operator(<=) ident(i)operator(\)) reserved(break)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(ISSPACE)operator((*)ident(ptr)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_str_substr)operator(()ident(str)operator(,) ident(beg)operator(,) ident(end)operator(-)ident(beg)operator(\)\);) - ident(skip) operator(=) integer(1)operator(;) - ident(beg) operator(=) ident(end) operator(+) integer(1)operator(;) - reserved(if) operator((!)ident(NIL_P)operator(()ident(limit)operator(\)\)) operator(++)ident(i)operator(;) - operator(}) - reserved(else) operator({) - ident(end)operator(++;) - operator(}) - operator(}) - operator(}) - operator(}) - reserved(else) operator({) - pre_type(long) ident(start) operator(=) ident(beg)operator(;) - pre_type(long) ident(idx)operator(;) - pre_type(int) ident(last_null) operator(=) integer(0)operator(;) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) - - reserved(while) operator((()ident(end) operator(=) ident(rb_reg_search)operator(()ident(spat)operator(,) ident(str)operator(,) ident(start)operator(,) integer(0)operator(\)\)) operator(>=) integer(0)operator(\)) operator({) - ident(regs) operator(=) ident(RMATCH)operator(()ident(rb_backref_get)operator((\)\)->)ident(regs)operator(;) - reserved(if) operator(()ident(start) operator(==) ident(end) operator(&&) ident(BEG)operator(()integer(0)operator(\)) operator(==) ident(END)operator(()integer(0)operator(\)\)) operator({) - reserved(if) operator((!)ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_str_new)operator(()stringoperator(,) integer(0)operator(\)\);) - reserved(break)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(last_null) operator(==) integer(1)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_str_substr)operator(()ident(str)operator(,) ident(beg)operator(,) ident(mbclen2)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(beg)operator(],)ident(spat)operator(\)\)\);) - ident(beg) operator(=) ident(start)operator(;) - operator(}) - reserved(else) operator({) - ident(start) operator(+=) ident(mbclen2)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(start)operator(],)ident(spat)operator(\);) - ident(last_null) operator(=) integer(1)operator(;) - reserved(continue)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_str_substr)operator(()ident(str)operator(,) ident(beg)operator(,) ident(end)operator(-)ident(beg)operator(\)\);) - ident(beg) operator(=) ident(start) operator(=) ident(END)operator(()integer(0)operator(\);) - operator(}) - ident(last_null) operator(=) integer(0)operator(;) - - reserved(for) operator(()ident(idx)operator(=)integer(1)operator(;) ident(idx) operator(<) ident(regs)operator(->)ident(num_regs)operator(;) ident(idx)operator(++\)) operator({) - reserved(if) operator(()ident(BEG)operator(()ident(idx)operator(\)) operator(==) operator(-)integer(1)operator(\)) reserved(continue)operator(;) - reserved(if) operator(()ident(BEG)operator(()ident(idx)operator(\)) operator(==) ident(END)operator(()ident(idx)operator(\)\)) - ident(tmp) operator(=) ident(rb_str_new5)operator(()ident(str)operator(,) integer(0)operator(,) integer(0)operator(\);) - reserved(else) - ident(tmp) operator(=) ident(rb_str_substr)operator(()ident(str)operator(,) ident(BEG)operator(()ident(idx)operator(\),) ident(END)operator(()ident(idx)operator(\)-)ident(BEG)operator(()ident(idx)operator(\)\);) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(tmp)operator(\);) - operator(}) - reserved(if) operator((!)ident(NIL_P)operator(()ident(limit)operator(\)) operator(&&) ident(lim) operator(<=) operator(++)ident(i)operator(\)) reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) integer(0) operator(&&) operator((!)ident(NIL_P)operator(()ident(limit)operator(\)) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) ident(beg) operator(||) ident(lim) operator(<) integer(0)operator(\)\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) ident(beg)operator(\)) - ident(tmp) operator(=) ident(rb_str_new5)operator(()ident(str)operator(,) integer(0)operator(,) integer(0)operator(\);) - reserved(else) - ident(tmp) operator(=) ident(rb_str_substr)operator(()ident(str)operator(,) ident(beg)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(-)ident(beg)operator(\);) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(tmp)operator(\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(limit)operator(\)) operator(&&) ident(lim) operator(==) integer(0)operator(\)) operator({) - reserved(while) operator(()ident(RARRAY)operator(()ident(result)operator(\)->)ident(len) operator(>) integer(0) operator(&&) - ident(RSTRING)operator(()ident(RARRAY)operator(()ident(result)operator(\)->)ident(ptr)operator([)ident(RARRAY)operator(()ident(result)operator(\)->)ident(len)operator(-)integer(1)operator(]\)->)ident(len) operator(==) integer(0)operator(\)) - ident(rb_ary_pop)operator(()ident(result)operator(\);) - operator(}) - - reserved(return) ident(result)operator(;) -operator(}) - -ident(VALUE) -ident(rb_str_split)operator(()ident(str)operator(,) ident(sep0)operator(\)) - ident(VALUE) ident(str)operator(;) - directive(const) pre_type(char) operator(*)ident(sep0)operator(;) -operator({) - ident(VALUE) ident(sep)operator(;) - - ident(StringValue)operator(()ident(str)operator(\);) - ident(sep) operator(=) ident(rb_str_new2)operator(()ident(sep0)operator(\);) - reserved(return) ident(rb_str_split_m)operator(()integer(1)operator(,) operator(&)ident(sep)operator(,) ident(str)operator(\);) -operator(}) - -comment(/* - * call-seq: - * split([pattern [, limit]]\) => array - * - * Equivalent to $_.split(pattern, limit\). - * See String#split. - */) - -directive(static) ident(VALUE) -ident(rb_f_split)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(return) ident(rb_str_split_m)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(uscore_get)operator((\)\);) -operator(}) - -comment(/* - * call-seq: - * str.each(separator=$/\) {|substr| block } => str - * str.each_line(separator=$/\) {|substr| block } => str - * - * Splits str using the supplied parameter as the record separator - * ($/ by default\), passing each substring in turn to the supplied - * block. If a zero-length record separator is supplied, the string is split on - * \\n characters, except that multiple successive newlines are - * appended together. - * - * print "Example one\\n" - * "hello\\nworld".each {|s| p s} - * print "Example two\\n" - * "hello\\nworld".each('l'\) {|s| p s} - * print "Example three\\n" - * "hello\\n\\n\\nworld".each(''\) {|s| p s} - * - * produces: - * - * Example one - * "hello\\n" - * "world" - * Example two - * "hel" - * "l" - * "o\\nworl" - * "d" - * Example three - * "hello\\n\\n\\n" - * "world" - */) - -directive(static) ident(VALUE) -ident(rb_str_each_line)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(rs)operator(;) - pre_type(int) ident(newline)operator(;) - pre_type(char) operator(*)ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) operator(*)ident(pend) operator(=) ident(p) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) operator(*)ident(s)operator(;) - pre_type(char) operator(*)ident(ptr) operator(=) ident(p)operator(;) - pre_type(long) ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(,) ident(rslen)operator(;) - ident(VALUE) ident(line)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(rs)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(rs) operator(=) ident(rb_rs)operator(;) - operator(}) - - reserved(if) operator(()ident(NIL_P)operator(()ident(rs)operator(\)\)) operator({) - ident(rb_yield)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) - operator(}) - ident(StringValue)operator(()ident(rs)operator(\);) - ident(rslen) operator(=) ident(RSTRING)operator(()ident(rs)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(rslen) operator(==) integer(0)operator(\)) operator({) - ident(newline) operator(=) char('\\n')operator(;) - operator(}) - reserved(else) operator({) - ident(newline) operator(=) ident(RSTRING)operator(()ident(rs)operator(\)->)ident(ptr)operator([)ident(rslen)operator(-)integer(1)operator(];) - operator(}) - - reserved(for) operator(()ident(s) operator(=) ident(p)operator(,) ident(p) operator(+=) ident(rslen)operator(;) ident(p) operator(<) ident(pend)operator(;) ident(p)operator(++\)) operator({) - reserved(if) operator(()ident(rslen) operator(==) integer(0) operator(&&) operator(*)ident(p) operator(==) char('\\n')operator(\)) operator({) - reserved(if) operator((*++)ident(p) operator(!=) char('\\n')operator(\)) reserved(continue)operator(;) - reserved(while) operator((*)ident(p) operator(==) char('\\n')operator(\)) ident(p)operator(++;) - operator(}) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(<) ident(p) operator(&&) ident(p)operator([-)integer(1)operator(]) operator(==) ident(newline) operator(&&) - operator(()ident(rslen) operator(<=) integer(1) operator(||) - ident(rb_memcmp)operator(()ident(RSTRING)operator(()ident(rs)operator(\)->)ident(ptr)operator(,) ident(p)operator(-)ident(rslen)operator(,) ident(rslen)operator(\)) operator(==) integer(0)operator(\)\)) operator({) - ident(line) operator(=) ident(rb_str_new5)operator(()ident(str)operator(,) ident(s)operator(,) ident(p) operator(-) ident(s)operator(\);) - ident(OBJ_INFECT)operator(()ident(line)operator(,) ident(str)operator(\);) - ident(rb_yield)operator(()ident(line)operator(\);) - ident(str_mod_check)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(len)operator(\);) - ident(s) operator(=) ident(p)operator(;) - operator(}) - operator(}) - - reserved(if) operator(()ident(s) operator(!=) ident(pend)operator(\)) operator({) - reserved(if) operator(()ident(p) operator(>) ident(pend)operator(\)) ident(p) operator(=) ident(pend)operator(;) - ident(line) operator(=) ident(rb_str_new5)operator(()ident(str)operator(,) ident(s)operator(,) ident(p) operator(-) ident(s)operator(\);) - ident(OBJ_INFECT)operator(()ident(line)operator(,) ident(str)operator(\);) - ident(rb_yield)operator(()ident(line)operator(\);) - operator(}) - - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.each_byte {|fixnum| block } => str - * - * Passes each byte in str to the given block. - * - * "hello".each_byte {|c| print c, ' ' } - * - * produces: - * - * 104 101 108 108 111 - */) - -directive(static) ident(VALUE) -ident(rb_str_each_byte)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_yield)operator(()ident(INT2FIX)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(&) hex(0xff)operator(\)\);) - operator(}) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.chop! => str or nil - * - * Processes str as for String#chop, returning str, - * or nil if str is the empty string. See also - * String#chomp!. - */) - -directive(static) ident(VALUE) -ident(rb_str_chop_bang)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) integer(0)operator(\)) operator({) - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(--;) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(]) operator(==) char('\\n')operator(\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) integer(0) operator(&&) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(-)integer(1)operator(]) operator(==) char('\\r')operator(\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(--;) - operator(}) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) - reserved(return) ident(str)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.chop => new_str - * - * Returns a new String with the last character removed. If the - * string ends with \\r\\n, both characters are removed. Applying - * chop to an empty string returns an empty - * string. String#chomp is often a safer alternative, as it leaves - * the string unchanged if it doesn't end in a record separator. - * - * "string\\r\\n".chop #=> "string" - * "string\\n\\r".chop #=> "string\\n" - * "string\\n".chop #=> "string" - * "string".chop #=> "strin" - * "x".chop.chop #=> "" - */) - -directive(static) ident(VALUE) -ident(rb_str_chop)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_chop_bang)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * chop! => $_ or nil - * - * Equivalent to $_.chop!. - * - * a = "now\\r\\n" - * $_ = a - * chop! #=> "now" - * chop! #=> "no" - * chop! #=> "n" - * chop! #=> "" - * chop! #=> nil - * $_ #=> "" - * a #=> "" - */) - -directive(static) ident(VALUE) -ident(rb_f_chop_bang)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(rb_str_chop_bang)operator(()ident(uscore_get)operator((\)\);) -operator(}) - -comment(/* - * call-seq: - * chop => string - * - * Equivalent to ($_.dup\).chop!, except nil - * is never returned. See String#chop!. - * - * a = "now\\r\\n" - * $_ = a - * chop #=> "now" - * $_ #=> "now" - * chop #=> "no" - * chop #=> "n" - * chop #=> "" - * chop #=> "" - * a #=> "now\\r\\n" - */) - -directive(static) ident(VALUE) -ident(rb_f_chop)operator((\)) -operator({) - ident(VALUE) ident(str) operator(=) ident(uscore_get)operator((\);) - - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) integer(0)operator(\)) operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_chop_bang)operator(()ident(str)operator(\);) - ident(rb_lastline_set)operator(()ident(str)operator(\);) - operator(}) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.chomp!(separator=$/\) => str or nil - * - * Modifies str in place as described for String#chomp, - * returning str, or nil if no modifications were made. - */) - -directive(static) ident(VALUE) -ident(rb_str_chomp_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(rs)operator(;) - pre_type(int) ident(newline)operator(;) - pre_type(char) operator(*)ident(p)operator(;) - pre_type(long) ident(len)operator(,) ident(rslen)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(rs)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(rs) operator(=) ident(rb_rs)operator(;) - reserved(if) operator(()ident(rs) operator(==) ident(rb_default_rs)operator(\)) operator({) - label(smart_chomp:) - ident(rb_str_modify)operator(()ident(str)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(len)operator(-)integer(1)operator(]) operator(==) char('\\n')operator(\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(--;) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) integer(0) operator(&&) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(-)integer(1)operator(]) operator(==) char('\\r')operator(\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(--;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(len)operator(-)integer(1)operator(]) operator(==) char('\\r')operator(\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(--;) - operator(}) - reserved(else) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) - reserved(return) ident(str)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(rs)operator(\)\)) reserved(return) ident(Qnil)operator(;) - ident(StringValue)operator(()ident(rs)operator(\);) - ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(rslen) operator(=) ident(RSTRING)operator(()ident(rs)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(rslen) operator(==) integer(0)operator(\)) operator({) - reserved(while) operator(()ident(len)operator(>)integer(0) operator(&&) ident(p)operator([)ident(len)operator(-)integer(1)operator(]) operator(==) char('\\n')operator(\)) operator({) - ident(len)operator(--;) - reserved(if) operator(()ident(len)operator(>)integer(0) operator(&&) ident(p)operator([)ident(len)operator(-)integer(1)operator(]) operator(==) char('\\r')operator(\)) - ident(len)operator(--;) - operator(}) - reserved(if) operator(()ident(len) operator(<) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(len)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(len)operator(]) operator(=) char('\\0')operator(;) - reserved(return) ident(str)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(if) operator(()ident(rslen) operator(>) ident(len)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(newline) operator(=) ident(RSTRING)operator(()ident(rs)operator(\)->)ident(ptr)operator([)ident(rslen)operator(-)integer(1)operator(];) - reserved(if) operator(()ident(rslen) operator(==) integer(1) operator(&&) ident(newline) operator(==) char('\\n')operator(\)) - reserved(goto) ident(smart_chomp)operator(;) - - reserved(if) operator(()ident(p)operator([)ident(len)operator(-)integer(1)operator(]) operator(==) ident(newline) operator(&&) - operator(()ident(rslen) operator(<=) integer(1) operator(||) - ident(rb_memcmp)operator(()ident(RSTRING)operator(()ident(rs)operator(\)->)ident(ptr)operator(,) ident(p)operator(+)ident(len)operator(-)ident(rslen)operator(,) ident(rslen)operator(\)) operator(==) integer(0)operator(\)\)) operator({) - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(-=) ident(rslen)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) - reserved(return) ident(str)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.chomp(separator=$/\) => new_str - * - * Returns a new String with the given record separator removed - * from the end of str (if present\). If $/ has not been - * changed from the default Ruby record separator, then chomp also - * removes carriage return characters (that is it will remove \\n, - * \\r, and \\r\\n\). - * - * "hello".chomp #=> "hello" - * "hello\\n".chomp #=> "hello" - * "hello\\r\\n".chomp #=> "hello" - * "hello\\n\\r".chomp #=> "hello\\n" - * "hello\\r".chomp #=> "hello" - * "hello \\n there".chomp #=> "hello \\n there" - * "hello".chomp("llo"\) #=> "he" - */) - -directive(static) ident(VALUE) -ident(rb_str_chomp)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_chomp_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * chomp! => $_ or nil - * chomp!(string\) => $_ or nil - * - * Equivalent to $_.chomp!(string\). See - * String#chomp! - * - * $_ = "now\\n" - * chomp! #=> "now" - * $_ #=> "now" - * chomp! "x" #=> nil - * $_ #=> "now" - */) - -directive(static) ident(VALUE) -ident(rb_f_chomp_bang)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - reserved(return) ident(rb_str_chomp_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(uscore_get)operator((\)\);) -operator(}) - -comment(/* - * call-seq: - * chomp => $_ - * chomp(string\) => $_ - * - * Equivalent to $_ = $_.chomp(string\). See - * String#chomp. - * - * $_ = "now\\n" - * chomp #=> "now" - * $_ #=> "now" - * chomp "ow" #=> "n" - * $_ #=> "n" - * chomp "xxx" #=> "n" - * $_ #=> "n" - */) - -directive(static) ident(VALUE) -ident(rb_f_chomp)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(str) operator(=) ident(uscore_get)operator((\);) - ident(VALUE) ident(dup) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(rb_str_chomp_bang)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(dup)operator(\)\)\)) - reserved(return) ident(str)operator(;) - ident(rb_lastline_set)operator(()ident(dup)operator(\);) - reserved(return) ident(dup)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.lstrip! => self or nil - * - * Removes leading whitespace from str, returning nil if no - * change was made. See also String#rstrip! and - * String#strip!. - * - * " hello ".lstrip #=> "hello " - * "hello".lstrip! #=> nil - */) - -directive(static) ident(VALUE) -ident(rb_str_lstrip_bang)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(t)operator(,) operator(*)ident(e)operator(;) - - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - reserved(if) operator((!)ident(s) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(e) operator(=) ident(t) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - comment(/* remove spaces at head */) - reserved(while) operator(()ident(s) operator(<) ident(t) operator(&&) ident(ISSPACE)operator((*)ident(s)operator(\)\)) ident(s)operator(++;) - - reserved(if) operator(()ident(s) operator(>) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) operator({) - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(t)operator(-)ident(s)operator(;) - ident(memmove)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(s)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) - reserved(return) ident(str)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.lstrip => new_str - * - * Returns a copy of str with leading whitespace removed. See also - * String#rstrip and String#strip. - * - * " hello ".lstrip #=> "hello " - * "hello".lstrip #=> "hello" - */) - -directive(static) ident(VALUE) -ident(rb_str_lstrip)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_lstrip_bang)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.rstrip! => self or nil - * - * Removes trailing whitespace from str, returning nil if - * no change was made. See also String#lstrip! and - * String#strip!. - * - * " hello ".rstrip #=> " hello" - * "hello".rstrip! #=> nil - */) - -directive(static) ident(VALUE) -ident(rb_str_rstrip_bang)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(t)operator(,) operator(*)ident(e)operator(;) - - ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - reserved(if) operator((!)ident(s) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) reserved(return) ident(Qnil)operator(;) - ident(e) operator(=) ident(t) operator(=) ident(s) operator(+) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - - comment(/* remove trailing '\\0's */) - reserved(while) operator(()ident(s) operator(<) ident(t) operator(&&) ident(t)operator([-)integer(1)operator(]) operator(==) char('\\0')operator(\)) ident(t)operator(--;) - - comment(/* remove trailing spaces */) - reserved(while) operator(()ident(s) operator(<) ident(t) operator(&&) ident(ISSPACE)operator((*()ident(t)operator(-)integer(1)operator(\)\)\)) ident(t)operator(--;) - - reserved(if) operator(()ident(t) operator(<) ident(e)operator(\)) operator({) - ident(rb_str_modify)operator(()ident(str)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(t)operator(-)ident(s)operator(;) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(]) operator(=) char('\\0')operator(;) - reserved(return) ident(str)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.rstrip => new_str - * - * Returns a copy of str with trailing whitespace removed. See also - * String#lstrip and String#strip. - * - * " hello ".rstrip #=> " hello" - * "hello".rstrip #=> "hello" - */) - -directive(static) ident(VALUE) -ident(rb_str_rstrip)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_rstrip_bang)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.strip! => str or nil - * - * Removes leading and trailing whitespace from str. Returns - * nil if str was not altered. - */) - -directive(static) ident(VALUE) -ident(rb_str_strip_bang)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(l) operator(=) ident(rb_str_lstrip_bang)operator(()ident(str)operator(\);) - ident(VALUE) ident(r) operator(=) ident(rb_str_rstrip_bang)operator(()ident(str)operator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(l)operator(\)) operator(&&) ident(NIL_P)operator(()ident(r)operator(\)\)) reserved(return) ident(Qnil)operator(;) - reserved(return) ident(str)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.strip => new_str - * - * Returns a copy of str with leading and trailing whitespace removed. - * - * " hello ".strip #=> "hello" - * "\\tgoodbye\\r\\n".strip #=> "goodbye" - */) - -directive(static) ident(VALUE) -ident(rb_str_strip)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(rb_str_strip_bang)operator(()ident(str)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(scan_once)operator(()ident(str)operator(,) ident(pat)operator(,) ident(start)operator(\)) - ident(VALUE) ident(str)operator(,) ident(pat)operator(;) - pre_type(long) operator(*)ident(start)operator(;) -operator({) - ident(VALUE) ident(result)operator(,) ident(match)operator(;) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(rb_reg_search)operator(()ident(pat)operator(,) ident(str)operator(,) operator(*)ident(start)operator(,) integer(0)operator(\)) operator(>=) integer(0)operator(\)) operator({) - ident(match) operator(=) ident(rb_backref_get)operator((\);) - ident(regs) operator(=) ident(RMATCH)operator(()ident(match)operator(\)->)ident(regs)operator(;) - reserved(if) operator(()ident(BEG)operator(()integer(0)operator(\)) operator(==) ident(END)operator(()integer(0)operator(\)\)) operator({) - comment(/* - * Always consume at least one character of the input string - */) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) ident(END)operator(()integer(0)operator(\)\)) - operator(*)ident(start) operator(=) ident(END)operator(()integer(0)operator(\)+)ident(mbclen2)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(END)operator(()integer(0)operator(\)],)ident(pat)operator(\);) - reserved(else) - operator(*)ident(start) operator(=) ident(END)operator(()integer(0)operator(\)+)integer(1)operator(;) - operator(}) - reserved(else) operator({) - operator(*)ident(start) operator(=) ident(END)operator(()integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(regs)operator(->)ident(num_regs) operator(==) integer(1)operator(\)) operator({) - reserved(return) ident(rb_reg_nth_match)operator(()integer(0)operator(,) ident(match)operator(\);) - operator(}) - ident(result) operator(=) ident(rb_ary_new2)operator(()ident(regs)operator(->)ident(num_regs)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(1)operator(;) ident(i) operator(<) ident(regs)operator(->)ident(num_regs)operator(;) ident(i)operator(++\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(rb_reg_nth_match)operator(()ident(i)operator(,) ident(match)operator(\)\);) - operator(}) - - reserved(return) ident(result)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.scan(pattern\) => array - * str.scan(pattern\) {|match, ...| block } => str - * - * Both forms iterate through str, matching the pattern (which may be a - * Regexp or a String\). For each match, a result is - * generated and either added to the result array or passed to the block. If - * the pattern contains no groups, each individual result consists of the - * matched string, $&. If the pattern contains groups, each - * individual result is itself an array containing one entry per group. - * - * a = "cruel world" - * a.scan(/\\w+/\) #=> ["cruel", "world"] - * a.scan(/.../\) #=> ["cru", "el ", "wor"] - * a.scan(/(...\)/\) #=> [["cru"], ["el "], ["wor"]] - * a.scan(/(..\)(..\)/\) #=> [["cr", "ue"], ["l ", "wo"]] - * - * And the block form: - * - * a.scan(/\\w+/\) {|w| print "<<#{w}>> " } - * print "\\n" - * a.scan(/(.\)(.\)/\) {|x,y| print y, x } - * print "\\n" - * - * produces: - * - * <> <> - * rceu lowlr - */) - -directive(static) ident(VALUE) -ident(rb_str_scan)operator(()ident(str)operator(,) ident(pat)operator(\)) - ident(VALUE) ident(str)operator(,) ident(pat)operator(;) -operator({) - ident(VALUE) ident(result)operator(;) - pre_type(long) ident(start) operator(=) integer(0)operator(;) - ident(VALUE) ident(match) operator(=) ident(Qnil)operator(;) - pre_type(char) operator(*)ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) pre_type(long) ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - - ident(pat) operator(=) ident(get_pat)operator(()ident(pat)operator(,) integer(1)operator(\);) - reserved(if) operator((!)ident(rb_block_given_p)operator((\)\)) operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - reserved(while) operator((!)ident(NIL_P)operator(()ident(result) operator(=) ident(scan_once)operator(()ident(str)operator(,) ident(pat)operator(,) operator(&)ident(start)operator(\)\)\)) operator({) - ident(match) operator(=) ident(rb_backref_get)operator((\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(result)operator(\);) - operator(}) - ident(rb_backref_set)operator(()ident(match)operator(\);) - reserved(return) ident(ary)operator(;) - operator(}) - - reserved(while) operator((!)ident(NIL_P)operator(()ident(result) operator(=) ident(scan_once)operator(()ident(str)operator(,) ident(pat)operator(,) operator(&)ident(start)operator(\)\)\)) operator({) - ident(match) operator(=) ident(rb_backref_get)operator((\);) - ident(rb_match_busy)operator(()ident(match)operator(\);) - ident(rb_yield)operator(()ident(result)operator(\);) - ident(str_mod_check)operator(()ident(str)operator(,) ident(p)operator(,) ident(len)operator(\);) - ident(rb_backref_set)operator(()ident(match)operator(\);) comment(/* restore $~ value */) - operator(}) - ident(rb_backref_set)operator(()ident(match)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * scan(pattern\) => array - * scan(pattern\) {|///| block } => $_ - * - * Equivalent to calling $_.scan. See - * String#scan. - */) - -directive(static) ident(VALUE) -ident(rb_f_scan)operator(()ident(self)operator(,) ident(pat)operator(\)) - ident(VALUE) ident(self)operator(,) ident(pat)operator(;) -operator({) - reserved(return) ident(rb_str_scan)operator(()ident(uscore_get)operator((\),) ident(pat)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.hex => integer - * - * Treats leading characters from str as a string of hexadecimal digits - * (with an optional sign and an optional 0x\) and returns the - * corresponding number. Zero is returned on error. - * - * "0x0a".hex #=> 10 - * "-1234".hex #=> -4660 - * "0".hex #=> 0 - * "wombat".hex #=> 0 - */) - -directive(static) ident(VALUE) -ident(rb_str_hex)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(rb_str_to_inum)operator(()ident(str)operator(,) integer(16)operator(,) ident(Qfalse)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.oct => integer - * - * Treats leading characters of str as a string of octal digits (with an - * optional sign\) and returns the corresponding number. Returns 0 if the - * conversion fails. - * - * "123".oct #=> 83 - * "-377".oct #=> -255 - * "bad".oct #=> 0 - * "0377bad".oct #=> 255 - */) - -directive(static) ident(VALUE) -ident(rb_str_oct)operator(()ident(str)operator(\)) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(rb_str_to_inum)operator(()ident(str)operator(,) operator(-)integer(8)operator(,) ident(Qfalse)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.crypt(other_str\) => new_str - * - * Applies a one-way cryptographic hash to str by invoking the standard - * library function crypt. The argument is the salt string, which - * should be two characters long, each character drawn from - * [a-zA-Z0-9./]. - */) - -directive(static) ident(VALUE) -ident(rb_str_crypt)operator(()ident(str)operator(,) ident(salt)operator(\)) - ident(VALUE) ident(str)operator(,) ident(salt)operator(;) -operator({) - directive(extern) pre_type(char) operator(*)ident(crypt)operator((\);) - ident(VALUE) ident(result)operator(;) - pre_type(char) operator(*)ident(s)operator(;) - - ident(StringValue)operator(()ident(salt)operator(\);) - reserved(if) operator(()ident(RSTRING)operator(()ident(salt)operator(\)->)ident(len) operator(<) integer(2)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) string=2 bytes\))delimiter(")>operator(\);) - - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - reserved(else) ident(s) operator(=) stringoperator(;) - ident(result) operator(=) ident(rb_str_new2)operator(()ident(crypt)operator(()ident(s)operator(,) ident(RSTRING)operator(()ident(salt)operator(\)->)ident(ptr)operator(\)\);) - ident(OBJ_INFECT)operator(()ident(result)operator(,) ident(str)operator(\);) - ident(OBJ_INFECT)operator(()ident(result)operator(,) ident(salt)operator(\);) - reserved(return) ident(result)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.intern => symbol - * str.to_sym => symbol - * - * Returns the Symbol corresponding to str, creating the - * symbol if it did not previously exist. See Symbol#id2name. - * - * "Koala".intern #=> :Koala - * s = 'cat'.to_sym #=> :cat - * s == :cat #=> true - * s = '@cat'.to_sym #=> :@cat - * s == :@cat #=> true - * - * This can also be used to create symbols that cannot be represented using the - * :xxx notation. - * - * 'cat and dog'.to_sym #=> :"cat and dog" - */) - -ident(VALUE) -ident(rb_str_intern)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - directive(volatile) ident(VALUE) ident(str) operator(=) ident(s)operator(;) - ident(ID) ident(id)operator(;) - - reserved(if) operator((!)ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(==) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(strlen)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)) operator(!=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(str)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(1) operator(&&) operator(!)ident(rb_sym_interned_p)operator(()ident(str)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - ident(id) operator(=) ident(rb_intern)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - reserved(return) ident(ID2SYM)operator(()ident(id)operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.sum(n=16\) => integer - * - * Returns a basic n-bit checksum of the characters in str, - * where n is the optional Fixnum parameter, defaulting - * to 16. The result is simply the sum of the binary value of each character in - * str modulo 2n - 1. This is not a particularly good - * checksum. - */) - -directive(static) ident(VALUE) -ident(rb_str_sum)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - ident(VALUE) ident(vbits)operator(;) - pre_type(int) ident(bits)operator(;) - pre_type(char) operator(*)ident(ptr)operator(,) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - pre_type(long) ident(len)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(vbits)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(bits) operator(=) integer(16)operator(;) - operator(}) - reserved(else) ident(bits) operator(=) ident(NUM2INT)operator(()ident(vbits)operator(\);) - - ident(ptr) operator(=) ident(p) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - ident(len) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(pend) operator(=) ident(p) operator(+) ident(len)operator(;) - reserved(if) operator(()ident(bits) operator(>=) reserved(sizeof)operator(()pre_type(long)operator(\)*)ident(CHAR_BIT)operator(\)) operator({) - ident(VALUE) ident(sum) operator(=) ident(INT2FIX)operator(()integer(0)operator(\);) - - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - ident(str_mod_check)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(len)operator(\);) - ident(sum) operator(=) ident(rb_funcall)operator(()ident(sum)operator(,) char('+')operator(,) integer(1)operator(,) ident(INT2FIX)operator((()pre_type(unsigned) pre_type(char)operator(\)*)ident(p)operator(\)\);) - ident(p)operator(++;) - operator(}) - reserved(if) operator(()ident(bits) operator(!=) integer(0)operator(\)) operator({) - ident(VALUE) ident(mod)operator(;) - - ident(mod) operator(=) ident(rb_funcall)operator(()ident(INT2FIX)operator(()integer(1)operator(\),) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(INT2FIX)operator(()ident(bits)operator(\)\);) - ident(mod) operator(=) ident(rb_funcall)operator(()ident(mod)operator(,) char('-')operator(,) integer(1)operator(,) ident(INT2FIX)operator(()integer(1)operator(\)\);) - ident(sum) operator(=) ident(rb_funcall)operator(()ident(sum)operator(,) char('&')operator(,) integer(1)operator(,) ident(mod)operator(\);) - operator(}) - reserved(return) ident(sum)operator(;) - operator(}) - reserved(else) operator({) - pre_type(unsigned) pre_type(long) ident(sum) operator(=) integer(0)operator(;) - - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - ident(str_mod_check)operator(()ident(str)operator(,) ident(ptr)operator(,) ident(len)operator(\);) - ident(sum) operator(+=) operator(()pre_type(unsigned) pre_type(char)operator(\)*)ident(p)operator(;) - ident(p)operator(++;) - operator(}) - reserved(if) operator(()ident(bits) operator(!=) integer(0)operator(\)) operator({) - ident(sum) operator(&=) operator(((()pre_type(unsigned) pre_type(long)operator(\))integer(1)operator(\)<<)ident(bits)operator(\)-)integer(1)operator(;) - operator(}) - reserved(return) ident(rb_int2inum)operator(()ident(sum)operator(\);) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(rb_str_justify)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(,) ident(jflag)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) - pre_type(char) ident(jflag)operator(;) -operator({) - ident(VALUE) ident(w)operator(;) - pre_type(long) ident(width)operator(,) ident(flen) operator(=) integer(0)operator(;) - ident(VALUE) ident(res)operator(;) - pre_type(char) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(,) operator(*)ident(f) operator(=) stringoperator(;) - pre_type(long) ident(n)operator(;) - ident(VALUE) ident(pad)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(w)operator(,) operator(&)ident(pad)operator(\);) - ident(width) operator(=) ident(NUM2LONG)operator(()ident(w)operator(\);) - reserved(if) operator(()ident(argc) operator(==) integer(2)operator(\)) operator({) - ident(StringValue)operator(()ident(pad)operator(\);) - ident(f) operator(=) ident(RSTRING)operator(()ident(pad)operator(\)->)ident(ptr)operator(;) - ident(flen) operator(=) ident(RSTRING)operator(()ident(pad)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(flen) operator(==) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - operator(}) - reserved(if) operator(()ident(width) operator(<) integer(0) operator(||) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>=) ident(width)operator(\)) reserved(return) ident(rb_str_dup)operator(()ident(str)operator(\);) - ident(res) operator(=) ident(rb_str_new5)operator(()ident(str)operator(,) integer(0)operator(,) ident(width)operator(\);) - ident(p) operator(=) ident(RSTRING)operator(()ident(res)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(jflag) operator(!=) char('l')operator(\)) operator({) - ident(n) operator(=) ident(width) operator(-) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(pend) operator(=) ident(p) operator(+) operator((()ident(jflag) operator(==) char('r')operator(\)) operator(?) ident(n) operator(:) ident(n)operator(/)integer(2)operator(\);) - reserved(if) operator(()ident(flen) operator(<=) integer(1)operator(\)) operator({) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - operator(*)ident(p)operator(++) operator(=) operator(*)ident(f)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - pre_type(char) operator(*)ident(q) operator(=) ident(f)operator(;) - reserved(while) operator(()ident(p) operator(+) ident(flen) operator(<=) ident(pend)operator(\)) operator({) - ident(memcpy)operator(()ident(p)operator(,)ident(f)operator(,)ident(flen)operator(\);) - ident(p) operator(+=) ident(flen)operator(;) - operator(}) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - operator(*)ident(p)operator(++) operator(=) operator(*)ident(q)operator(++;) - operator(}) - operator(}) - operator(}) - ident(memcpy)operator(()ident(p)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) - reserved(if) operator(()ident(jflag) operator(!=) char('r')operator(\)) operator({) - ident(p) operator(+=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) ident(pend) operator(=) ident(RSTRING)operator(()ident(res)operator(\)->)ident(ptr) operator(+) ident(width)operator(;) - reserved(if) operator(()ident(flen) operator(<=) integer(1)operator(\)) operator({) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - operator(*)ident(p)operator(++) operator(=) operator(*)ident(f)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(while) operator(()ident(p) operator(+) ident(flen) operator(<=) ident(pend)operator(\)) operator({) - ident(memcpy)operator(()ident(p)operator(,)ident(f)operator(,)ident(flen)operator(\);) - ident(p) operator(+=) ident(flen)operator(;) - operator(}) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - operator(*)ident(p)operator(++) operator(=) operator(*)ident(f)operator(++;) - operator(}) - operator(}) - operator(}) - ident(OBJ_INFECT)operator(()ident(res)operator(,) ident(str)operator(\);) - reserved(if) operator(()ident(flen) operator(>) integer(0)operator(\)) ident(OBJ_INFECT)operator(()ident(res)operator(,) ident(pad)operator(\);) - reserved(return) ident(res)operator(;) -operator(}) - - -comment(/* - * call-seq: - * str.ljust(integer, padstr=' '\) => new_str - * - * If integer is greater than the length of str, returns a new - * String of length integer with str left justified - * and padded with padstr; otherwise, returns str. - * - * "hello".ljust(4\) #=> "hello" - * "hello".ljust(20\) #=> "hello " - * "hello".ljust(20, '1234'\) #=> "hello123412341234123" - */) - -directive(static) ident(VALUE) -ident(rb_str_ljust)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(rb_str_justify)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(,) char('l')operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.rjust(integer, padstr=' '\) => new_str - * - * If integer is greater than the length of str, returns a new - * String of length integer with str right justified - * and padded with padstr; otherwise, returns str. - * - * "hello".rjust(4\) #=> "hello" - * "hello".rjust(20\) #=> " hello" - * "hello".rjust(20, '1234'\) #=> "123412341234123hello" - */) - -directive(static) ident(VALUE) -ident(rb_str_rjust)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(rb_str_justify)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(,) char('r')operator(\);) -operator(}) - - -comment(/* - * call-seq: - * str.center(integer, padstr\) => new_str - * - * If integer is greater than the length of str, returns a new - * String of length integer with str centered and - * padded with padstr; otherwise, returns str. - * - * "hello".center(4\) #=> "hello" - * "hello".center(20\) #=> " hello " - * "hello".center(20, '123'\) #=> "1231231hello12312312" - */) - -directive(static) ident(VALUE) -ident(rb_str_center)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(str)operator(;) -operator({) - reserved(return) ident(rb_str_justify)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(str)operator(,) char('c')operator(\);) -operator(}) - -directive(void) -ident(rb_str_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(var)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) operator(*)ident(var)operator(;) -operator({) - reserved(if) operator((!)ident(NIL_P)operator(()ident(val)operator(\)) operator(&&) ident(TYPE)operator(()ident(val)operator(\)) operator(!=) ident(T_STRING)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - operator(*)ident(var) operator(=) ident(val)operator(;) -operator(}) - - -comment(/* - * A String object holds and manipulates an arbitrary sequence of - * bytes, typically representing characters. String objects may be created - * using String::new or as literals. - * - * Because of aliasing issues, users of strings should be aware of the methods - * that modify the contents of a String object. Typically, - * methods with names ending in ``!'' modify their receiver, while those - * without a ``!'' return a new String. However, there are - * exceptions, such as String#[]=. - * - */) - -directive(void) -ident(Init_String)operator((\)) -operator({) - ident(rb_cString) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_include_module)operator(()ident(rb_cString)operator(,) ident(rb_mComparable)operator(\);) - ident(rb_include_module)operator(()ident(rb_cString)operator(,) ident(rb_mEnumerable)operator(\);) - ident(rb_define_alloc_func)operator(()ident(rb_cString)operator(,) ident(rb_str_s_alloc)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_init)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_replace)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) string)delimiter(")>operator(,) ident(rb_str_cmp_m)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_eql)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_hash_m)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_casecmp)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_plus)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_times)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_format_m)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_aref_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_aset_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_insert)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_length)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_length)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_empty)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_match)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_match_m)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_succ)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_succ_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_succ)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_succ_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_upto_m)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_index_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_rindex_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_replace)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_to_i)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_to_f)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_dump)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_upcase)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_downcase)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_capitalize)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_swapcase)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_upcase_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_downcase_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_capitalize_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_swapcase_bang)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_hex)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_oct)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_split_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_reverse)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_reverse_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_concat)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_concat)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_crypt)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_intern)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_intern)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_include)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_scan)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_ljust)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_rjust)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_center)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_sub)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_gsub)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_chop)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_chomp)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_strip)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_lstrip)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_rstrip)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_sub_bang)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_gsub_bang)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_chop_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_chomp_bang)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_strip_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_lstrip_bang)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_rstrip_bang)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_tr)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_tr_s)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_delete)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_squeeze)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_count)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_tr_bang)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_tr_s_bang)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_delete_bang)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_squeeze_bang)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_each_line)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_each_line)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_each_byte)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_sum)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_sub)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_gsub)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_sub_bang)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_gsub_bang)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_chop)operator(,) integer(0)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_chop_bang)operator(,) integer(0)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_chomp)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_chomp_bang)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_split)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_global_function)operator(()stringoperator(,) ident(rb_f_scan)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_aref_m)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cString)operator(,) stringoperator(,) ident(rb_str_slice_bang)operator(,) operator(-)integer(1)operator(\);) - - ident(id_to_s) operator(=) ident(rb_intern)operator(()stringoperator(\);) - - ident(rb_fs) operator(=) ident(Qnil)operator(;) - ident(rb_define_variable)operator(()stringoperator(,) operator(&)ident(rb_fs)operator(\);) - ident(rb_define_variable)operator(()stringoperator(,) operator(&)ident(rb_fs)operator(\);) -operator(}) -comment(/********************************************************************** - - struct.c - - - $Author: shyouhei $ - $Date: 2008-06-15 15:44:44 +0200 (Sun, 15 Jun 2008\) $ - created at: Tue Mar 22 18:44:30 JST 1995 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("env.h") - -ident(VALUE) ident(rb_cStruct)operator(;) - -directive(static) ident(VALUE) ident(struct_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) - -ident(VALUE) -ident(rb_struct_iv_get)operator(()ident(c)operator(,) ident(name)operator(\)) - ident(VALUE) ident(c)operator(;) - pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(ID) ident(id)operator(;) - - ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - reserved(for) operator((;;\)) operator({) - reserved(if) operator(()ident(rb_ivar_defined)operator(()ident(c)operator(,) ident(id)operator(\)\)) - reserved(return) ident(rb_ivar_get)operator(()ident(c)operator(,) ident(id)operator(\);) - ident(c) operator(=) ident(RCLASS)operator(()ident(c)operator(\)->)ident(super)operator(;) - reserved(if) operator(()ident(c) operator(==) integer(0) operator(||) ident(c) operator(==) ident(rb_cStruct)operator(\)) - reserved(return) ident(Qnil)operator(;) - operator(}) -operator(}) - -ident(VALUE) -ident(rb_struct_s_members)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(members) operator(=) ident(rb_struct_iv_get)operator(()ident(klass)operator(,) stringoperator(\);) - - reserved(if) operator(()ident(NIL_P)operator(()ident(members)operator(\)\)) operator({) - ident(rb_bug)operator(()stringoperator(\);) - operator(}) - reserved(return) ident(members)operator(;) -operator(}) - -ident(VALUE) -ident(rb_struct_members)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - ident(VALUE) ident(members) operator(=) ident(rb_struct_s_members)operator(()ident(rb_obj_class)operator(()ident(s)operator(\)\);) - - reserved(if) operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len) operator(!=) ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(,) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(\);) - operator(}) - reserved(return) ident(members)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_struct_s_members_m)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(members)operator(,) ident(ary)operator(;) - ident(VALUE) operator(*)ident(p)operator(,) operator(*)ident(pend)operator(;) - - ident(members) operator(=) ident(rb_struct_s_members)operator(()ident(klass)operator(\);) - ident(ary) operator(=) ident(rb_ary_new2)operator(()ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(\);) - ident(p) operator(=) ident(RARRAY)operator(()ident(members)operator(\)->)ident(ptr)operator(;) ident(pend) operator(=) ident(p) operator(+) ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(;) - reserved(while) operator(()ident(p) operator(<) ident(pend)operator(\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(SYM2ID)operator((*)ident(p)operator(\)\)\)\);) - ident(p)operator(++;) - operator(}) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * struct.members => array - * - * Returns an array of strings representing the names of the instance - * variables. - * - * Customer = Struct.new(:name, :address, :zip\) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345\) - * joe.members #=> ["name", "address", "zip"] - */) - -directive(static) ident(VALUE) -ident(rb_struct_members_m)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_struct_s_members_m)operator(()ident(rb_obj_class)operator(()ident(obj)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_struct_getmember)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(members)operator(,) ident(slot)operator(;) - pre_type(long) ident(i)operator(;) - - ident(members) operator(=) ident(rb_struct_members)operator(()ident(obj)operator(\);) - ident(slot) operator(=) ident(ID2SYM)operator(()ident(id)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(RARRAY)operator(()ident(members)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(==) ident(slot)operator(\)) operator({) - reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - operator(}) - operator(}) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -directive(static) ident(VALUE) -ident(rb_struct_ref)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_struct_getmember)operator(()ident(obj)operator(,) ident(ruby_frame)operator(->)ident(orig_func)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(rb_struct_ref0)operator(()ident(obj)operator(\)) ident(VALUE) ident(obj)operator(;) operator({)reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)integer(0)operator(];}) -directive(static) ident(VALUE) ident(rb_struct_ref1)operator(()ident(obj)operator(\)) ident(VALUE) ident(obj)operator(;) operator({)reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)integer(1)operator(];}) -directive(static) ident(VALUE) ident(rb_struct_ref2)operator(()ident(obj)operator(\)) ident(VALUE) ident(obj)operator(;) operator({)reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)integer(2)operator(];}) -directive(static) ident(VALUE) ident(rb_struct_ref3)operator(()ident(obj)operator(\)) ident(VALUE) ident(obj)operator(;) operator({)reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)integer(3)operator(];}) -directive(static) ident(VALUE) ident(rb_struct_ref4)operator(()ident(obj)operator(\)) ident(VALUE) ident(obj)operator(;) operator({)reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)integer(4)operator(];}) -directive(static) ident(VALUE) ident(rb_struct_ref5)operator(()ident(obj)operator(\)) ident(VALUE) ident(obj)operator(;) operator({)reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)integer(5)operator(];}) -directive(static) ident(VALUE) ident(rb_struct_ref6)operator(()ident(obj)operator(\)) ident(VALUE) ident(obj)operator(;) operator({)reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)integer(6)operator(];}) -directive(static) ident(VALUE) ident(rb_struct_ref7)operator(()ident(obj)operator(\)) ident(VALUE) ident(obj)operator(;) operator({)reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)integer(7)operator(];}) -directive(static) ident(VALUE) ident(rb_struct_ref8)operator(()ident(obj)operator(\)) ident(VALUE) ident(obj)operator(;) operator({)reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)integer(8)operator(];}) -directive(static) ident(VALUE) ident(rb_struct_ref9)operator(()ident(obj)operator(\)) ident(VALUE) ident(obj)operator(;) operator({)reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)integer(9)operator(];}) - -directive(static) ident(VALUE) operator((*)ident(ref_func)operator([)integer(10)operator(]\)(\)) operator(=) operator({) - ident(rb_struct_ref0)operator(,) - ident(rb_struct_ref1)operator(,) - ident(rb_struct_ref2)operator(,) - ident(rb_struct_ref3)operator(,) - ident(rb_struct_ref4)operator(,) - ident(rb_struct_ref5)operator(,) - ident(rb_struct_ref6)operator(,) - ident(rb_struct_ref7)operator(,) - ident(rb_struct_ref8)operator(,) - ident(rb_struct_ref9)operator(,) -operator(};) - -directive(static) directive(void) -ident(rb_struct_modify)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(s)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(s)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_struct_set)operator(()ident(obj)operator(,) ident(val)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(val)operator(;) -operator({) - ident(VALUE) ident(members)operator(,) ident(slot)operator(;) - ident(ID) ident(id)operator(;) - pre_type(long) ident(i)operator(;) - - ident(members) operator(=) ident(rb_struct_members)operator(()ident(obj)operator(\);) - ident(rb_struct_modify)operator(()ident(obj)operator(\);) - ident(id) operator(=) ident(ruby_frame)operator(->)ident(orig_func)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(slot) operator(=) ident(RARRAY)operator(()ident(members)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - reserved(if) operator(()ident(rb_id_attrset)operator(()ident(SYM2ID)operator(()ident(slot)operator(\)\)) operator(==) ident(id)operator(\)) operator({) - reserved(return) ident(RSTRUCT)operator(()ident(obj)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(=) ident(val)operator(;) - operator(}) - operator(}) - ident(rb_name_error)operator(()ident(ruby_frame)operator(->)ident(last_func)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(id)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -directive(static) ident(VALUE) -ident(make_struct)operator(()ident(name)operator(,) ident(members)operator(,) ident(klass)operator(\)) - ident(VALUE) ident(name)operator(,) ident(members)operator(,) ident(klass)operator(;) -operator({) - ident(VALUE) ident(nstr)operator(;) - ident(ID) ident(id)operator(;) - pre_type(long) ident(i)operator(;) - - ident(OBJ_FREEZE)operator(()ident(members)operator(\);) - reserved(if) operator(()ident(NIL_P)operator(()ident(name)operator(\)\)) operator({) - ident(nstr) operator(=) ident(rb_class_new)operator(()ident(klass)operator(\);) - ident(rb_make_metaclass)operator(()ident(nstr)operator(,) ident(RBASIC)operator(()ident(klass)operator(\)->)ident(klass)operator(\);) - ident(rb_class_inherited)operator(()ident(klass)operator(,) ident(nstr)operator(\);) - operator(}) - reserved(else) operator({) - pre_type(char) operator(*)ident(cname) operator(=) ident(StringValuePtr)operator(()ident(name)operator(\);) - ident(id) operator(=) ident(rb_intern)operator(()ident(cname)operator(\);) - reserved(if) operator((!)ident(rb_is_const_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(cname)operator(\);) - operator(}) - reserved(if) operator(()ident(rb_const_defined_at)operator(()ident(klass)operator(,) ident(id)operator(\)\)) operator({) - ident(rb_warn)operator(()stringoperator(,) ident(cname)operator(\);) - ident(rb_mod_remove_const)operator(()ident(klass)operator(,) ident(ID2SYM)operator(()ident(id)operator(\)\);) - operator(}) - ident(nstr) operator(=) ident(rb_define_class_under)operator(()ident(klass)operator(,) ident(rb_id2name)operator(()ident(id)operator(\),) ident(klass)operator(\);) - operator(}) - ident(rb_iv_set)operator(()ident(nstr)operator(,) stringoperator(,) ident(LONG2NUM)operator(()ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(\)\);) - ident(rb_iv_set)operator(()ident(nstr)operator(,) stringoperator(,) ident(members)operator(\);) - - ident(rb_define_alloc_func)operator(()ident(nstr)operator(,) ident(struct_alloc)operator(\);) - ident(rb_define_singleton_method)operator(()ident(nstr)operator(,) stringoperator(,) ident(rb_class_new_instance)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(nstr)operator(,) stringoperator(,) ident(rb_class_new_instance)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(nstr)operator(,) stringoperator(,) ident(rb_struct_s_members_m)operator(,) integer(0)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<) ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(ID) ident(id) operator(=) ident(SYM2ID)operator(()ident(RARRAY)operator(()ident(members)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - reserved(if) operator(()ident(rb_is_local_id)operator(()ident(id)operator(\)) operator(||) ident(rb_is_const_id)operator(()ident(id)operator(\)\)) operator({) - reserved(if) operator(()ident(i)operator(<)integer(10)operator(\)) operator({) - ident(rb_define_method_id)operator(()ident(nstr)operator(,) ident(id)operator(,) ident(ref_func)operator([)ident(i)operator(],) integer(0)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_define_method_id)operator(()ident(nstr)operator(,) ident(id)operator(,) ident(rb_struct_ref)operator(,) integer(0)operator(\);) - operator(}) - ident(rb_define_method_id)operator(()ident(nstr)operator(,) ident(rb_id_attrset)operator(()ident(id)operator(\),) ident(rb_struct_set)operator(,) integer(1)operator(\);) - operator(}) - operator(}) - - reserved(return) ident(nstr)operator(;) -operator(}) - -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -preprocessor(#include) include() -preprocessor(#define) ident(va_init_list)operator(()ident(a)operator(,)ident(b)operator(\)) ident(va_start)operator(()ident(a)operator(,)ident(b)operator(\)) -preprocessor(#else) -preprocessor(#include) include() -preprocessor(#define) ident(va_init_list)operator(()ident(a)operator(,)ident(b)operator(\)) ident(va_start)operator(()ident(a)operator(\)) -preprocessor(#endif) - -ident(VALUE) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_struct_define)operator(()directive(const) pre_type(char) operator(*)ident(name)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_struct_define)operator(()ident(name)operator(,) ident(va_alist)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(va_list) ident(ar)operator(;) - ident(VALUE) ident(nm)operator(,) ident(ary)operator(;) - pre_type(char) operator(*)ident(mem)operator(;) - - reserved(if) operator((!)ident(name)operator(\)) ident(nm) operator(=) ident(Qnil)operator(;) - reserved(else) ident(nm) operator(=) ident(rb_str_new2)operator(()ident(name)operator(\);) - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - ident(va_init_list)operator(()ident(ar)operator(,) ident(name)operator(\);) - reserved(while) operator((()ident(mem) operator(=) ident(va_arg)operator(()ident(ar)operator(,) pre_type(char)operator(*\)\)) operator(!=) integer(0)operator(\)) operator({) - ident(ID) ident(slot) operator(=) ident(rb_intern)operator(()ident(mem)operator(\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(ID2SYM)operator(()ident(slot)operator(\)\);) - operator(}) - ident(va_end)operator(()ident(ar)operator(\);) - - reserved(return) ident(make_struct)operator(()ident(nm)operator(,) ident(ary)operator(,) ident(rb_cStruct)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Struct.new( [aString] [, aSym]+> \) => StructClass - * StructClass.new(arg, ...\) => obj - * StructClass[arg, ...] => obj - * - * Creates a new class, named by aString, containing accessor - * methods for the given symbols. If the name aString is - * omitted, an anonymous structure class will be created. Otherwise, - * the name of this struct will appear as a constant in class - * Struct, so it must be unique for all - * Structs in the system and should start with a capital - * letter. Assigning a structure class to a constant effectively gives - * the class the name of the constant. - * - * Struct::new returns a new Class object, - * which can then be used to create specific instances of the new - * structure. The number of actual parameters must be - * less than or equal to the number of attributes defined for this - * class; unset parameters default to \\nil{}. Passing too many - * parameters will raise an \\E{ArgumentError}. - * - * The remaining methods listed in this section (class and instance\) - * are defined for this generated class. - * - * # Create a structure with a name in Struct - * Struct.new("Customer", :name, :address\) #=> Struct::Customer - * Struct::Customer.new("Dave", "123 Main"\) #=> # - * - * # Create a structure named by its constant - * Customer = Struct.new(:name, :address\) #=> Customer - * Customer.new("Dave", "123 Main"\) #=> # - */) - -directive(static) ident(VALUE) -ident(rb_struct_s_def)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(name)operator(,) ident(rest)operator(;) - pre_type(long) ident(i)operator(;) - ident(VALUE) ident(st)operator(;) - ident(ID) ident(id)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(name)operator(,) operator(&)ident(rest)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(name)operator(\)) operator(&&) ident(SYMBOL_P)operator(()ident(name)operator(\)\)) operator({) - ident(rb_ary_unshift)operator(()ident(rest)operator(,) ident(name)operator(\);) - ident(name) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RARRAY)operator(()ident(rest)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(id) operator(=) ident(rb_to_id)operator(()ident(RARRAY)operator(()ident(rest)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - ident(RARRAY)operator(()ident(rest)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(=) ident(ID2SYM)operator(()ident(id)operator(\);) - operator(}) - ident(st) operator(=) ident(make_struct)operator(()ident(name)operator(,) ident(rest)operator(,) ident(klass)operator(\);) - reserved(if) operator(()ident(rb_block_given_p)operator((\)\)) operator({) - ident(rb_mod_module_eval)operator(()integer(0)operator(,) integer(0)operator(,) ident(st)operator(\);) - operator(}) - - reserved(return) ident(st)operator(;) -operator(}) - -comment(/* - */) - -directive(static) ident(VALUE) -ident(rb_struct_initialize)operator(()ident(self)operator(,) ident(values)operator(\)) - ident(VALUE) ident(self)operator(,) ident(values)operator(;) -operator({) - ident(VALUE) ident(klass) operator(=) ident(rb_obj_class)operator(()ident(self)operator(\);) - ident(VALUE) ident(size)operator(;) - pre_type(long) ident(n)operator(;) - - ident(rb_struct_modify)operator(()ident(self)operator(\);) - ident(size) operator(=) ident(rb_struct_iv_get)operator(()ident(klass)operator(,) stringoperator(\);) - ident(n) operator(=) ident(FIX2LONG)operator(()ident(size)operator(\);) - reserved(if) operator(()ident(n) operator(<) ident(RARRAY)operator(()ident(values)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - ident(MEMCPY)operator(()ident(RSTRUCT)operator(()ident(self)operator(\)->)ident(ptr)operator(,) ident(RARRAY)operator(()ident(values)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RARRAY)operator(()ident(values)operator(\)->)ident(len)operator(\);) - reserved(if) operator(()ident(n) operator(>) ident(RARRAY)operator(()ident(values)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_mem_clear)operator(()ident(RSTRUCT)operator(()ident(self)operator(\)->)ident(ptr)operator(+)ident(RARRAY)operator(()ident(values)operator(\)->)ident(len)operator(,) - ident(n)operator(-)ident(RARRAY)operator(()ident(values)operator(\)->)ident(len)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(struct_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(size)operator(;) - pre_type(long) ident(n)operator(;) - ident(NEWOBJ)operator(()ident(st)operator(,) reserved(struct) ident(RStruct)operator(\);) - ident(OBJSETUP)operator(()ident(st)operator(,) ident(klass)operator(,) ident(T_STRUCT)operator(\);) - - ident(size) operator(=) ident(rb_struct_iv_get)operator(()ident(klass)operator(,) stringoperator(\);) - ident(n) operator(=) ident(FIX2LONG)operator(()ident(size)operator(\);) - - ident(st)operator(->)ident(ptr) operator(=) ident(ALLOC_N)operator(()ident(VALUE)operator(,) ident(n)operator(\);) - ident(rb_mem_clear)operator(()ident(st)operator(->)ident(ptr)operator(,) ident(n)operator(\);) - ident(st)operator(->)ident(len) operator(=) ident(n)operator(;) - - reserved(return) operator(()ident(VALUE)operator(\))ident(st)operator(;) -operator(}) - -ident(VALUE) -ident(rb_struct_alloc)operator(()ident(klass)operator(,) ident(values)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(values)operator(;) -operator({) - reserved(return) ident(rb_class_new_instance)operator(()ident(RARRAY)operator(()ident(values)operator(\)->)ident(len)operator(,) ident(RARRAY)operator(()ident(values)operator(\)->)ident(ptr)operator(,) ident(klass)operator(\);) -operator(}) - -ident(VALUE) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -ident(rb_struct_new)operator(()ident(VALUE) ident(klass)operator(,) operator(.)operator(.)operator(.)operator(\)) -preprocessor(#else) -ident(rb_struct_new)operator(()ident(klass)operator(,) ident(va_alist)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(va_dcl) -preprocessor(#endif) -operator({) - ident(VALUE) ident(sz)operator(,) operator(*)ident(mem)operator(;) - pre_type(long) ident(size)operator(,) ident(i)operator(;) - ident(va_list) ident(args)operator(;) - - ident(sz) operator(=) ident(rb_struct_iv_get)operator(()ident(klass)operator(,) stringoperator(\);) - ident(size) operator(=) ident(FIX2LONG)operator(()ident(sz)operator(\);) - ident(mem) operator(=) ident(ALLOCA_N)operator(()ident(VALUE)operator(,) ident(size)operator(\);) - ident(va_init_list)operator(()ident(args)operator(,) ident(klass)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(size)operator(;) ident(i)operator(++\)) operator({) - ident(mem)operator([)ident(i)operator(]) operator(=) ident(va_arg)operator(()ident(args)operator(,) ident(VALUE)operator(\);) - operator(}) - ident(va_end)operator(()ident(args)operator(\);) - - reserved(return) ident(rb_class_new_instance)operator(()ident(size)operator(,) ident(mem)operator(,) ident(klass)operator(\);) -operator(}) - -comment(/* - * call-seq: - * struct.each {|obj| block } => struct - * - * Calls block once for each instance variable, passing the - * value as a parameter. - * - * Customer = Struct.new(:name, :address, :zip\) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345\) - * joe.each {|x| puts(x\) } - * - * produces: - * - * Joe Smith - * 123 Maple, Anytown NC - * 12345 - */) - -directive(static) ident(VALUE) -ident(rb_struct_each)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_yield)operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - operator(}) - reserved(return) ident(s)operator(;) -operator(}) - -comment(/* - * call-seq: - * struct.each_pair {|sym, obj| block } => struct - * - * Calls block once for each instance variable, passing the name - * (as a symbol\) and the value as parameters. - * - * Customer = Struct.new(:name, :address, :zip\) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345\) - * joe.each_pair {|name, value| puts("#{name} => #{value}"\) } - * - * produces: - * - * name => Joe Smith - * address => 123 Maple, Anytown NC - * zip => 12345 - */) - -directive(static) ident(VALUE) -ident(rb_struct_each_pair)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - ident(VALUE) ident(members)operator(;) - pre_type(long) ident(i)operator(;) - - ident(members) operator(=) ident(rb_struct_members)operator(()ident(s)operator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(rb_yield_values)operator(()integer(2)operator(,) ident(rb_ary_entry)operator(()ident(members)operator(,) ident(i)operator(\),) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - operator(}) - reserved(return) ident(s)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(inspect_struct)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - pre_type(char) operator(*)ident(cname) operator(=) ident(rb_class2name)operator(()ident(rb_obj_class)operator(()ident(s)operator(\)\);) - ident(VALUE) ident(str)operator(,) ident(members)operator(;) - pre_type(long) ident(i)operator(;) - - ident(members) operator(=) ident(rb_struct_members)operator(()ident(s)operator(\);) - ident(str) operator(=) ident(rb_str_buf_new2)operator(()stringoperator(\);) - ident(rb_str_cat2)operator(()ident(str)operator(,) ident(cname)operator(\);) - ident(rb_str_cat2)operator(()ident(str)operator(,) stringoperator(\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(slot)operator(;) - ident(ID) ident(id)operator(;) - pre_type(char) operator(*)ident(p)operator(;) - - reserved(if) operator(()ident(i) operator(>) integer(0)operator(\)) operator({) - ident(rb_str_cat2)operator(()ident(str)operator(,) stringoperator(\);) - operator(}) - ident(slot) operator(=) ident(RARRAY)operator(()ident(members)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - ident(id) operator(=) ident(SYM2ID)operator(()ident(slot)operator(\);) - reserved(if) operator(()ident(rb_is_local_id)operator(()ident(id)operator(\)) operator(||) ident(rb_is_const_id)operator(()ident(id)operator(\)\)) operator({) - ident(p) operator(=) ident(rb_id2name)operator(()ident(id)operator(\);) - ident(rb_str_cat2)operator(()ident(str)operator(,) ident(p)operator(\);) - operator(}) - reserved(else) operator({) - ident(rb_str_append)operator(()ident(str)operator(,) ident(rb_inspect)operator(()ident(slot)operator(\)\);) - operator(}) - ident(rb_str_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(rb_str_append)operator(()ident(str)operator(,) ident(rb_inspect)operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)\);) - operator(}) - ident(rb_str_cat2)operator(()ident(str)operator(,) string)delimiter(")>operator(\);) - ident(OBJ_INFECT)operator(()ident(str)operator(,) ident(s)operator(\);) - - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * struct.to_s => string - * struct.inspect => string - * - * Describe the contents of this struct in a string. - */) - -directive(static) ident(VALUE) -ident(rb_struct_inspect)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - reserved(if) operator(()ident(rb_inspecting_p)operator(()ident(s)operator(\)\)) operator({) - pre_type(char) operator(*)ident(cname) operator(=) ident(rb_class2name)operator(()ident(rb_obj_class)operator(()ident(s)operator(\)\);) - ident(size_t) ident(len) operator(=) ident(strlen)operator(()ident(cname)operator(\)) operator(+) integer(14)operator(;) - ident(VALUE) ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) - - ident(snprintf)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(len)operator(+)integer(1)operator(,) string)delimiter(")>operator(,) ident(cname)operator(\);) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(strlen)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - reserved(return) ident(str)operator(;) - operator(}) - reserved(return) ident(rb_protect_inspect)operator(()ident(inspect_struct)operator(,) ident(s)operator(,) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * struct.to_a => array - * struct.values => array - * - * Returns the values for this instance as an array. - * - * Customer = Struct.new(:name, :address, :zip\) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345\) - * joe.to_a[1] #=> "123 Maple, Anytown NC" - */) - -directive(static) ident(VALUE) -ident(rb_struct_to_a)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - reserved(return) ident(rb_ary_new4)operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(,) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator(\);) -operator(}) - -comment(/* :nodoc: */) -directive(static) ident(VALUE) -ident(rb_struct_init_copy)operator(()ident(copy)operator(,) ident(s)operator(\)) - ident(VALUE) ident(copy)operator(,) ident(s)operator(;) -operator({) - reserved(if) operator(()ident(copy) operator(==) ident(s)operator(\)) reserved(return) ident(copy)operator(;) - ident(rb_check_frozen)operator(()ident(copy)operator(\);) - reserved(if) operator((!)ident(rb_obj_is_instance_of)operator(()ident(s)operator(,) ident(rb_obj_class)operator(()ident(copy)operator(\)\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator(()ident(RSTRUCT)operator(()ident(copy)operator(\)->)ident(len) operator(!=) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(MEMCPY)operator(()ident(RSTRUCT)operator(()ident(copy)operator(\)->)ident(ptr)operator(,) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator(,) ident(VALUE)operator(,) ident(RSTRUCT)operator(()ident(copy)operator(\)->)ident(len)operator(\);) - - reserved(return) ident(copy)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(rb_struct_aref_id)operator(()ident(s)operator(,) ident(id)operator(\)) - ident(VALUE) ident(s)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(members)operator(;) - pre_type(long) ident(i)operator(,) ident(len)operator(;) - - ident(members) operator(=) ident(rb_struct_members)operator(()ident(s)operator(\);) - ident(len) operator(=) ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(SYM2ID)operator(()ident(RARRAY)operator(()ident(members)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)) operator(==) ident(id)operator(\)) operator({) - reserved(return) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(];) - operator(}) - operator(}) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -comment(/* - * call-seq: - * struct[symbol] => anObject - * struct[fixnum] => anObject - * - * Attribute Reference---Returns the value of the instance variable - * named by symbol, or indexed (0..length-1\) by - * fixnum. Will raise NameError if the named - * variable does not exist, or IndexError if the index is - * out of range. - * - * Customer = Struct.new(:name, :address, :zip\) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345\) - * - * joe["name"] #=> "Joe Smith" - * joe[:name] #=> "Joe Smith" - * joe[0] #=> "Joe Smith" - */) - -ident(VALUE) -ident(rb_struct_aref)operator(()ident(s)operator(,) ident(idx)operator(\)) - ident(VALUE) ident(s)operator(,) ident(idx)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(idx)operator(\)) operator(==) ident(T_STRING) operator(||) ident(TYPE)operator(()ident(idx)operator(\)) operator(==) ident(T_SYMBOL)operator(\)) operator({) - reserved(return) ident(rb_struct_aref_id)operator(()ident(s)operator(,) ident(rb_to_id)operator(()ident(idx)operator(\)\);) - operator(}) - - ident(i) operator(=) ident(NUM2LONG)operator(()ident(idx)operator(\);) - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) ident(i) operator(=) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len) operator(+) ident(i)operator(;) - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) - ident(i)operator(,) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(\);) - reserved(if) operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len) operator(<=) ident(i)operator(\)) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) - ident(i)operator(,) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(\);) - reserved(return) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(];) -operator(}) - -directive(static) ident(VALUE) -ident(rb_struct_aset_id)operator(()ident(s)operator(,) ident(id)operator(,) ident(val)operator(\)) - ident(VALUE) ident(s)operator(,) ident(val)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(members)operator(;) - pre_type(long) ident(i)operator(,) ident(len)operator(;) - - ident(members) operator(=) ident(rb_struct_members)operator(()ident(s)operator(\);) - ident(rb_struct_modify)operator(()ident(s)operator(\);) - ident(len) operator(=) ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len) operator(!=) ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(RARRAY)operator(()ident(members)operator(\)->)ident(len)operator(,) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(\);) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(SYM2ID)operator(()ident(RARRAY)operator(()ident(members)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)) operator(==) ident(id)operator(\)) operator({) - ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(=) ident(val)operator(;) - reserved(return) ident(val)operator(;) - operator(}) - operator(}) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * struct[symbol] = obj => obj - * struct[fixnum] = obj => obj - * - * Attribute Assignment---Assigns to the instance variable named by - * symbol or fixnum the value obj and - * returns it. Will raise a NameError if the named - * variable does not exist, or an IndexError if the index - * is out of range. - * - * Customer = Struct.new(:name, :address, :zip\) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345\) - * - * joe["name"] = "Luke" - * joe[:zip] = "90210" - * - * joe.name #=> "Luke" - * joe.zip #=> "90210" - */) - -ident(VALUE) -ident(rb_struct_aset)operator(()ident(s)operator(,) ident(idx)operator(,) ident(val)operator(\)) - ident(VALUE) ident(s)operator(,) ident(idx)operator(,) ident(val)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(idx)operator(\)) operator(==) ident(T_STRING) operator(||) ident(TYPE)operator(()ident(idx)operator(\)) operator(==) ident(T_SYMBOL)operator(\)) operator({) - reserved(return) ident(rb_struct_aset_id)operator(()ident(s)operator(,) ident(rb_to_id)operator(()ident(idx)operator(\),) ident(val)operator(\);) - operator(}) - - ident(i) operator(=) ident(NUM2LONG)operator(()ident(idx)operator(\);) - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) ident(i) operator(=) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len) operator(+) ident(i)operator(;) - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) - ident(i)operator(,) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(\);) - operator(}) - reserved(if) operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len) operator(<=) ident(i)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eIndexError)operator(,) stringoperator(,) - ident(i)operator(,) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(\);) - operator(}) - ident(rb_struct_modify)operator(()ident(s)operator(\);) - reserved(return) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(]) operator(=) ident(val)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(struct_entry) ident(_)operator((()ident(VALUE)operator(,) pre_type(long)operator(\)\);) -directive(static) ident(VALUE) -ident(struct_entry)operator(()ident(s)operator(,) ident(n)operator(\)) - ident(VALUE) ident(s)operator(;) - pre_type(long) ident(n)operator(;) -operator({) - reserved(return) ident(rb_struct_aref)operator(()ident(s)operator(,) ident(LONG2NUM)operator(()ident(n)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * struct.values_at(selector,... \) => an_array - * - * Returns an array containing the elements in - * _self_ corresponding to the given selector(s\). The selectors - * may be either integer indices or ranges. - * See also .select. - * - * a = %w{ a b c d e f } - * a.values_at(1, 3, 5\) - * a.values_at(1, 3, 5, 7\) - * a.values_at(-1, -3, -5, -7\) - * a.values_at(1..3, 2...5\) - */) - -directive(static) ident(VALUE) -ident(rb_struct_values_at)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(s)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(s)operator(;) -operator({) - reserved(return) ident(rb_values_at)operator(()ident(s)operator(,) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(,) ident(argc)operator(,) ident(argv)operator(,) ident(struct_entry)operator(\);) -operator(}) - -comment(/* - * call-seq: - * struct.select {|i| block } => array - * - * Invokes the block passing in successive elements from - * struct, returning an array containing those elements - * for which the block returns a true value (equivalent to - * Enumerable#select\). - * - * Lots = Struct.new(:a, :b, :c, :d, :e, :f\) - * l = Lots.new(11, 22, 33, 44, 55, 66\) - * l.select {|v| (v % 2\).zero? } #=> [22, 44, 66] - */) - -directive(static) ident(VALUE) -ident(rb_struct_select)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(s)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(s)operator(;) -operator({) - ident(VALUE) ident(result)operator(;) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(argc) operator(>) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(argc)operator(\);) - operator(}) - ident(result) operator(=) ident(rb_ary_new)operator((\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(rb_yield)operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)\)\)) operator({) - ident(rb_ary_push)operator(()ident(result)operator(,) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - operator(}) - operator(}) - - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * struct == other_struct => true or false - * - * Equality---Returns true if other_struct is - * equal to this one: they must be of the same class as generated by - * Struct::new, and the values of all instance variables - * must be equal (according to Object#==\). - * - * Customer = Struct.new(:name, :address, :zip\) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345\) - * joejr = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345\) - * jane = Customer.new("Jane Doe", "456 Elm, Anytown NC", 12345\) - * joe == joejr #=> true - * joe == jane #=> false - */) - -directive(static) ident(VALUE) -ident(rb_struct_equal)operator(()ident(s)operator(,) ident(s2)operator(\)) - ident(VALUE) ident(s)operator(,) ident(s2)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(s) operator(==) ident(s2)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(s2)operator(\)) operator(!=) ident(T_STRUCT)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(rb_obj_class)operator(()ident(s)operator(\)) operator(!=) ident(rb_obj_class)operator(()ident(s2)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len) operator(!=) ident(RSTRUCT)operator(()ident(s2)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(\);) comment(/* should never happen */) - operator(}) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator((!)ident(rb_equal)operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(RSTRUCT)operator(()ident(s2)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)\)) reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * struct.hash => fixnum - * - * Return a hash value based on this struct's contents. - */) - -directive(static) ident(VALUE) -ident(rb_struct_hash)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - pre_type(long) ident(i)operator(,) ident(h)operator(;) - ident(VALUE) ident(n)operator(;) - - ident(h) operator(=) ident(rb_hash)operator(()ident(rb_obj_class)operator(()ident(s)operator(\)\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(h) operator(=) operator(()ident(h) operator(<<) integer(1)operator(\)) operator(|) operator(()ident(h)operator(<)integer(0) operator(?) integer(1) operator(:) integer(0)operator(\);) - ident(n) operator(=) ident(rb_hash)operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(]\);) - ident(h) operator(^=) ident(NUM2LONG)operator(()ident(n)operator(\);) - operator(}) - reserved(return) ident(LONG2FIX)operator(()ident(h)operator(\);) -operator(}) - -comment(/* - * code-seq: - * struct.eql?(other\) => true or false - * - * Two structures are equal if they are the same object, or if all their - * fields are equal (using eql?\). - */) - -directive(static) ident(VALUE) -ident(rb_struct_eql)operator(()ident(s)operator(,) ident(s2)operator(\)) - ident(VALUE) ident(s)operator(,) ident(s2)operator(;) -operator({) - pre_type(long) ident(i)operator(;) - - reserved(if) operator(()ident(s) operator(==) ident(s2)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(if) operator(()ident(TYPE)operator(()ident(s2)operator(\)) operator(!=) ident(T_STRUCT)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(rb_obj_class)operator(()ident(s)operator(\)) operator(!=) ident(rb_obj_class)operator(()ident(s2)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len) operator(!=) ident(RSTRUCT)operator(()ident(s2)operator(\)->)ident(len)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(\);) comment(/* should never happen */) - operator(}) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator((!)ident(rb_eql)operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(ptr)operator([)ident(i)operator(],) ident(RSTRUCT)operator(()ident(s2)operator(\)->)ident(ptr)operator([)ident(i)operator(]\)\)) reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -comment(/* - * call-seq: - * struct.length => fixnum - * struct.size => fixnum - * - * Returns the number of instance variables. - * - * Customer = Struct.new(:name, :address, :zip\) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345\) - * joe.length #=> 3 - */) - -directive(static) ident(VALUE) -ident(rb_struct_size)operator(()ident(s)operator(\)) - ident(VALUE) ident(s)operator(;) -operator({) - reserved(return) ident(LONG2FIX)operator(()ident(RSTRUCT)operator(()ident(s)operator(\)->)ident(len)operator(\);) -operator(}) - -comment(/* - * A Struct is a convenient way to bundle a number of - * attributes together, using accessor methods, without having to write - * an explicit class. - * - * The Struct class is a generator of specific classes, - * each one of which is defined to hold a set of variables and their - * accessors. In these examples, we'll call the generated class - * ``CustomerClass,'' and we'll show an example instance of that - * class as ``CustomerInst.'' - * - * In the descriptions that follow, the parameter symbol refers - * to a symbol, which is either a quoted string or a - * Symbol (such as :name\). - */) -directive(void) -ident(Init_Struct)operator((\)) -operator({) - ident(rb_cStruct) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_include_module)operator(()ident(rb_cStruct)operator(,) ident(rb_mEnumerable)operator(\);) - - ident(rb_undef_alloc_func)operator(()ident(rb_cStruct)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_s_def)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_initialize)operator(,) operator(-)integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_init_copy)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_equal)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_eql)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_hash)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_inspect)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_to_a)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_to_a)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_size)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_size)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_each)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_each_pair)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_aref)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_aset)operator(,) integer(2)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_select)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_values_at)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cStruct)operator(,) stringoperator(,) ident(rb_struct_members_m)operator(,) integer(0)operator(\);) -operator(}) -comment(/********************************************************************** - - time.c - - - $Author: shyouhei $ - $Date: 2009-02-02 12:03:25 +0100 (Mon, 02 Feb 2009\) $ - created at: Tue Dec 28 14:31:59 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#ifdef) ident(HAVE_UNISTD_H) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#include) include() -preprocessor(#include) include() - -ident(VALUE) ident(rb_cTime)operator(;) - -reserved(struct) ident(time_object) operator({) - reserved(struct) ident(timeval) ident(tv)operator(;) - reserved(struct) ident(tm) ident(tm)operator(;) - pre_type(int) ident(gmt)operator(;) - pre_type(int) ident(tm_got)operator(;) -operator(};) - -preprocessor(#define) ident(GetTimeval)operator(()ident(obj)operator(,) ident(tobj)operator(\)) \ - ident(Data_Get_Struct)operator(()ident(obj)operator(,) reserved(struct) ident(time_object)operator(,) ident(tobj)operator(\)) - -directive(static) directive(void) ident(time_free) ident(_)operator((()directive(void) operator(*\)\);) -directive(static) ident(VALUE) ident(time_utc_offset) ident(_)operator((()ident(VALUE)operator(\)\);) - -directive(static) directive(void) -ident(time_free)operator(()ident(tobj)operator(\)) - directive(void) operator(*)ident(tobj)operator(;) -operator({) - reserved(if) operator(()ident(tobj)operator(\)) ident(free)operator(()ident(tobj)operator(\);) -operator(}) - -directive(static) ident(VALUE) ident(time_s_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) -ident(time_s_alloc)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(obj)operator(;) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(obj) operator(=) ident(Data_Make_Struct)operator(()ident(klass)operator(,) reserved(struct) ident(time_object)operator(,) integer(0)operator(,) ident(time_free)operator(,) ident(tobj)operator(\);) - ident(tobj)operator(->)ident(tm_got)operator(=)integer(0)operator(;) - ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec) operator(=) integer(0)operator(;) - ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec) operator(=) integer(0)operator(;) - - reserved(return) ident(obj)operator(;) -operator(}) - -directive(static) directive(void) -ident(time_modify)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - ident(rb_check_frozen)operator(()ident(time)operator(\);) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(time)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) -operator(}) - -comment(/* - * Document-method: now - * - * Synonym for Time.new. Returns a +Time+ object - * initialized tot he current system time. - * - * call-seq: - * Time.new -> time - * - * Returns a Time object initialized to the current system - * time. Note: The object created will be created using the - * resolution available on your system clock, and so may include - * fractional seconds. - * - * a = Time.new #=> Wed Apr 09 08:56:03 CDT 2003 - * b = Time.new #=> Wed Apr 09 08:56:03 CDT 2003 - * a == b #=> false - * "%.6f" % a.to_f #=> "1049896563.230740" - * "%.6f" % b.to_f #=> "1049896563.231466" - * - */) - -directive(static) ident(VALUE) -ident(time_init)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(time_modify)operator(()ident(time)operator(\);) - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - ident(tobj)operator(->)ident(tm_got)operator(=)integer(0)operator(;) - ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec) operator(=) integer(0)operator(;) - ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(gettimeofday)operator((&)ident(tobj)operator(->)ident(tv)operator(,) integer(0)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(rb_sys_fail)operator(()stringoperator(\);) - operator(}) - - reserved(return) ident(time)operator(;) -operator(}) - -preprocessor(#define) ident(NDIV)operator(()ident(x)operator(,)ident(y)operator(\)) operator((-(-(()ident(x)operator(\)+)integer(1)operator(\))operator(/)operator(()ident(y)operator(\)\)-)integer(1)operator(\)) -preprocessor(#define) ident(NMOD)operator(()ident(x)operator(,)ident(y)operator(\)) operator((()ident(y)operator(\)-(-(()ident(x)operator(\)+)integer(1)operator(\)%()ident(y)operator(\)\)-)integer(1)operator(\)) - -directive(static) directive(void) -ident(time_overflow_p)operator(()ident(secp)operator(,) ident(usecp)operator(\)) - ident(time_t) operator(*)ident(secp)operator(,) operator(*)ident(usecp)operator(;) -operator({) - ident(time_t) ident(tmp)operator(,) ident(sec) operator(=) operator(*)ident(secp)operator(,) ident(usec) operator(=) operator(*)ident(usecp)operator(;) - - reserved(if) operator(()ident(usec) operator(>=) integer(1000000)operator(\)) operator({) comment(/* usec positive overflow */) - ident(tmp) operator(=) ident(sec) operator(+) ident(usec) operator(/) integer(1000000)operator(;) - ident(usec) operator(%=) integer(1000000)operator(;) - reserved(if) operator(()ident(sec) operator(>) integer(0) operator(&&) ident(tmp) operator(<) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(\);) - operator(}) - ident(sec) operator(=) ident(tmp)operator(;) - operator(}) - reserved(if) operator(()ident(usec) operator(<) integer(0)operator(\)) operator({) comment(/* usec negative overflow */) - ident(tmp) operator(=) ident(sec) operator(+) ident(NDIV)operator(()ident(usec)operator(,)integer(1000000)operator(\);) comment(/* negative div */) - ident(usec) operator(=) ident(NMOD)operator(()ident(usec)operator(,)integer(1000000)operator(\);) comment(/* negative mod */) - reserved(if) operator(()ident(sec) operator(<) integer(0) operator(&&) ident(tmp) operator(>) integer(0)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(\);) - operator(}) - ident(sec) operator(=) ident(tmp)operator(;) - operator(}) -preprocessor(#ifndef) ident(NEGATIVE_TIME_T) - reserved(if) operator(()ident(sec) operator(<) integer(0) operator(||) operator(()ident(sec) operator(==) integer(0) operator(&&) ident(usec) operator(<) integer(0)operator(\)\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) -preprocessor(#endif) - operator(*)ident(secp) operator(=) ident(sec)operator(;) - operator(*)ident(usecp) operator(=) ident(usec)operator(;) -operator(}) - -directive(static) ident(VALUE) ident(time_new_internal) ident(_)operator((()ident(VALUE)operator(,) ident(time_t)operator(,) ident(time_t)operator(\)\);) -directive(static) ident(VALUE) -ident(time_new_internal)operator(()ident(klass)operator(,) ident(sec)operator(,) ident(usec)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(time_t) ident(sec)operator(,) ident(usec)operator(;) -operator({) - ident(VALUE) ident(time) operator(=) ident(time_s_alloc)operator(()ident(klass)operator(\);) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - ident(time_overflow_p)operator((&)ident(sec)operator(,) operator(&)ident(usec)operator(\);) - ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec) operator(=) ident(sec)operator(;) - ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec) operator(=) ident(usec)operator(;) - - reserved(return) ident(time)operator(;) -operator(}) - -ident(VALUE) -ident(rb_time_new)operator(()ident(sec)operator(,) ident(usec)operator(\)) - ident(time_t) ident(sec)operator(,) ident(usec)operator(;) -operator({) - reserved(return) ident(time_new_internal)operator(()ident(rb_cTime)operator(,) ident(sec)operator(,) ident(usec)operator(\);) -operator(}) - -directive(static) reserved(struct) ident(timeval) -ident(time_timeval)operator(()ident(time)operator(,) ident(interval)operator(\)) - ident(VALUE) ident(time)operator(;) - pre_type(int) ident(interval)operator(;) -operator({) - reserved(struct) ident(timeval) ident(t)operator(;) - pre_type(char) operator(*)ident(tstr) operator(=) ident(interval) operator(?) string operator(:) stringoperator(;) - -preprocessor(#ifndef) ident(NEGATIVE_TIME_T) - ident(interval) operator(=) integer(1)operator(;) -preprocessor(#endif) - - reserved(switch) operator(()ident(TYPE)operator(()ident(time)operator(\)\)) operator({) - reserved(case) ident(T_FIXNUM)operator(:) - ident(t)operator(.)ident(tv_sec) operator(=) ident(FIX2LONG)operator(()ident(time)operator(\);) - reserved(if) operator(()ident(interval) operator(&&) ident(t)operator(.)ident(tv_sec) operator(<) integer(0)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(tstr)operator(\);) - ident(t)operator(.)ident(tv_usec) operator(=) integer(0)operator(;) - reserved(break)operator(;) - - reserved(case) ident(T_FLOAT)operator(:) - reserved(if) operator(()ident(interval) operator(&&) ident(RFLOAT)operator(()ident(time)operator(\)->)ident(value) operator(<) float(0)float(.0)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(tstr)operator(\);) - reserved(else) operator({) - pre_type(double) ident(f)operator(,) ident(d)operator(;) - - ident(d) operator(=) ident(modf)operator(()ident(RFLOAT)operator(()ident(time)operator(\)->)ident(value)operator(,) operator(&)ident(f)operator(\);) - reserved(if) operator(()ident(d) operator(<) integer(0)operator(\)) operator({) - ident(d) operator(+=) integer(1)operator(;) - ident(f) operator(-=) integer(1)operator(;) - operator(}) - ident(t)operator(.)ident(tv_sec) operator(=) operator(()ident(time_t)operator(\))ident(f)operator(;) - reserved(if) operator(()ident(f) operator(!=) ident(t)operator(.)ident(tv_sec)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(RFLOAT)operator(()ident(time)operator(\)->)ident(value)operator(\);) - operator(}) - ident(t)operator(.)ident(tv_usec) operator(=) operator(()ident(time_t)operator(\)()ident(d)operator(*)float(1)ident(e6)operator(+)float(0)float(.5)operator(\);) - operator(}) - reserved(break)operator(;) - - reserved(case) ident(T_BIGNUM)operator(:) - ident(t)operator(.)ident(tv_sec) operator(=) ident(NUM2LONG)operator(()ident(time)operator(\);) - reserved(if) operator(()ident(interval) operator(&&) ident(t)operator(.)ident(tv_sec) operator(<) integer(0)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(tstr)operator(\);) - ident(t)operator(.)ident(tv_usec) operator(=) integer(0)operator(;) - reserved(break)operator(;) - - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_obj_classname)operator(()ident(time)operator(\),) ident(tstr)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(return) ident(t)operator(;) -operator(}) - -reserved(struct) ident(timeval) -ident(rb_time_interval)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(return) ident(time_timeval)operator(()ident(time)operator(,) ident(Qtrue)operator(\);) -operator(}) - -reserved(struct) ident(timeval) -ident(rb_time_timeval)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - reserved(struct) ident(timeval) ident(t)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(time)operator(\)) operator(==) ident(T_DATA) operator(&&) ident(RDATA)operator(()ident(time)operator(\)->)ident(dfree) operator(==) ident(time_free)operator(\)) operator({) - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - ident(t) operator(=) ident(tobj)operator(->)ident(tv)operator(;) - reserved(return) ident(t)operator(;) - operator(}) - reserved(return) ident(time_timeval)operator(()ident(time)operator(,) ident(Qfalse)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Time.at( aTime \) => time - * Time.at( seconds [, microseconds] \) => time - * - * Creates a new time object with the value given by aTime, or - * the given number of seconds (and optional - * microseconds\) from epoch. A non-portable feature allows the - * offset to be negative on some systems. - * - * Time.at(0\) #=> Wed Dec 31 18:00:00 CST 1969 - * Time.at(946702800\) #=> Fri Dec 31 23:00:00 CST 1999 - * Time.at(-284061600\) #=> Sat Dec 31 00:00:00 CST 1960 - */) - -directive(static) ident(VALUE) -ident(time_s_at)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(struct) ident(timeval) ident(tv)operator(;) - ident(VALUE) ident(time)operator(,) ident(t)operator(;) - - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(time)operator(,) operator(&)ident(t)operator(\)) operator(==) integer(2)operator(\)) operator({) - ident(tv)operator(.)ident(tv_sec) operator(=) ident(NUM2LONG)operator(()ident(time)operator(\);) - ident(tv)operator(.)ident(tv_usec) operator(=) ident(NUM2LONG)operator(()ident(t)operator(\);) - operator(}) - reserved(else) operator({) - ident(tv) operator(=) ident(rb_time_timeval)operator(()ident(time)operator(\);) - operator(}) - ident(t) operator(=) ident(time_new_internal)operator(()ident(klass)operator(,) ident(tv)operator(.)ident(tv_sec)operator(,) ident(tv)operator(.)ident(tv_usec)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(time)operator(\)) operator(==) ident(T_DATA) operator(&&) ident(RDATA)operator(()ident(time)operator(\)->)ident(dfree) operator(==) ident(time_free)operator(\)) operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(,) operator(*)ident(tobj2)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - ident(GetTimeval)operator(()ident(t)operator(,) ident(tobj2)operator(\);) - ident(tobj2)operator(->)ident(gmt) operator(=) ident(tobj)operator(->)ident(gmt)operator(;) - operator(}) - reserved(return) ident(t)operator(;) -operator(}) - -directive(static) pre_type(char) operator(*)ident(months) operator([)integer(12)operator(]) operator(=) operator({) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) -operator(};) - -directive(static) pre_type(long) -ident(obj2long)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(obj)operator(\)) operator(==) ident(T_STRING)operator(\)) operator({) - ident(obj) operator(=) ident(rb_str_to_inum)operator(()ident(obj)operator(,) integer(10)operator(,) ident(Qfalse)operator(\);) - operator(}) - - reserved(return) ident(NUM2LONG)operator(()ident(obj)operator(\);) -operator(}) - -directive(static) directive(void) -ident(time_arg)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(tm)operator(,) ident(usec)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - reserved(struct) ident(tm) operator(*)ident(tm)operator(;) - ident(time_t) operator(*)ident(usec)operator(;) -operator({) - ident(VALUE) ident(v)operator([)integer(8)operator(];) - pre_type(int) ident(i)operator(;) - pre_type(long) ident(year)operator(;) - - ident(MEMZERO)operator(()ident(tm)operator(,) reserved(struct) ident(tm)operator(,) integer(1)operator(\);) - operator(*)ident(usec) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(argc) operator(==) integer(10)operator(\)) operator({) - ident(v)operator([)integer(0)operator(]) operator(=) ident(argv)operator([)integer(5)operator(];) - ident(v)operator([)integer(1)operator(]) operator(=) ident(argv)operator([)integer(4)operator(];) - ident(v)operator([)integer(2)operator(]) operator(=) ident(argv)operator([)integer(3)operator(];) - ident(v)operator([)integer(3)operator(]) operator(=) ident(argv)operator([)integer(2)operator(];) - ident(v)operator([)integer(4)operator(]) operator(=) ident(argv)operator([)integer(1)operator(];) - ident(v)operator([)integer(5)operator(]) operator(=) ident(argv)operator([)integer(0)operator(];) - ident(v)operator([)integer(6)operator(]) operator(=) ident(Qnil)operator(;) - ident(tm)operator(->)ident(tm_isdst) operator(=) ident(RTEST)operator(()ident(argv)operator([)integer(8)operator(]\)) operator(?) integer(1) operator(:) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(v)operator([)integer(0)operator(],&)ident(v)operator([)integer(1)operator(],&)ident(v)operator([)integer(2)operator(],&)ident(v)operator([)integer(3)operator(],&)ident(v)operator([)integer(4)operator(],&)ident(v)operator([)integer(5)operator(],&)ident(v)operator([)integer(6)operator(],&)ident(v)operator([)integer(7)operator(]\);) - comment(/* v[6] may be usec or zone (parsedate\) */) - comment(/* v[7] is wday (parsedate; ignored\) */) - ident(tm)operator(->)ident(tm_wday) operator(=) operator(-)integer(1)operator(;) - ident(tm)operator(->)ident(tm_isdst) operator(=) operator(-)integer(1)operator(;) - operator(}) - - ident(year) operator(=) ident(obj2long)operator(()ident(v)operator([)integer(0)operator(]\);) - - reserved(if) operator(()integer(0) operator(<=) ident(year) operator(&&) ident(year) operator(<) integer(39)operator(\)) operator({) - ident(year) operator(+=) integer(100)operator(;) - ident(rb_warning)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()integer(69) operator(<=) ident(year) operator(&&) ident(year) operator(<) integer(139)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(\);) - operator(}) - reserved(else) operator({) - ident(year) operator(-=) integer(1900)operator(;) - operator(}) - - ident(tm)operator(->)ident(tm_year) operator(=) ident(year)operator(;) - - reserved(if) operator(()ident(NIL_P)operator(()ident(v)operator([)integer(1)operator(]\)\)) operator({) - ident(tm)operator(->)ident(tm_mon) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(VALUE) ident(s) operator(=) ident(rb_check_string_type)operator(()ident(v)operator([)integer(1)operator(]\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(s)operator(\)\)) operator({) - ident(tm)operator(->)ident(tm_mon) operator(=) operator(-)integer(1)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)integer(12)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(RSTRING)operator(()ident(s)operator(\)->)ident(len) operator(==) integer(3) operator(&&) - ident(strcasecmp)operator(()ident(months)operator([)ident(i)operator(],) ident(RSTRING)operator(()ident(s)operator(\)->)ident(ptr)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(tm)operator(->)ident(tm_mon) operator(=) ident(i)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(tm)operator(->)ident(tm_mon) operator(==) operator(-)integer(1)operator(\)) operator({) - pre_type(char) ident(c) operator(=) ident(RSTRING)operator(()ident(s)operator(\)->)ident(ptr)operator([)integer(0)operator(];) - - reserved(if) operator(()char('0') operator(<=) ident(c) operator(&&) ident(c) operator(<=) char('9')operator(\)) operator({) - ident(tm)operator(->)ident(tm_mon) operator(=) ident(obj2long)operator(()ident(s)operator(\)-)integer(1)operator(;) - operator(}) - operator(}) - operator(}) - reserved(else) operator({) - ident(tm)operator(->)ident(tm_mon) operator(=) ident(obj2long)operator(()ident(v)operator([)integer(1)operator(]\)-)integer(1)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(v)operator([)integer(2)operator(]\)\)) operator({) - ident(tm)operator(->)ident(tm_mday) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) - ident(tm)operator(->)ident(tm_mday) operator(=) ident(obj2long)operator(()ident(v)operator([)integer(2)operator(]\);) - operator(}) - ident(tm)operator(->)ident(tm_hour) operator(=) ident(NIL_P)operator(()ident(v)operator([)integer(3)operator(]\)?)integer(0)operator(:)ident(obj2long)operator(()ident(v)operator([)integer(3)operator(]\);) - ident(tm)operator(->)ident(tm_min) operator(=) ident(NIL_P)operator(()ident(v)operator([)integer(4)operator(]\)?)integer(0)operator(:)ident(obj2long)operator(()ident(v)operator([)integer(4)operator(]\);) - ident(tm)operator(->)ident(tm_sec) operator(=) ident(NIL_P)operator(()ident(v)operator([)integer(5)operator(]\)?)integer(0)operator(:)ident(obj2long)operator(()ident(v)operator([)integer(5)operator(]\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(v)operator([)integer(6)operator(]\)\)) operator({) - reserved(if) operator(()ident(argc) operator(==) integer(8)operator(\)) operator({) - comment(/* v[6] is timezone, but ignored */) - operator(}) - reserved(else) reserved(if) operator(()ident(argc) operator(==) integer(7)operator(\)) operator({) - operator(*)ident(usec) operator(=) ident(obj2long)operator(()ident(v)operator([)integer(6)operator(]\);) - operator(}) - operator(}) - - comment(/* value validation */) - reserved(if) operator(() - ident(tm)operator(->)ident(tm_year) operator(!=) ident(year) operator(||) -preprocessor(#ifndef) ident(NEGATIVE_TIME_T) - ident(tm)operator(->)ident(tm_year) operator(<) integer(69) operator(||) -preprocessor(#endif) - ident(tm)operator(->)ident(tm_mon) operator(<) integer(0) operator(||) ident(tm)operator(->)ident(tm_mon) operator(>) integer(11) - operator(||) ident(tm)operator(->)ident(tm_mday) operator(<) integer(1) operator(||) ident(tm)operator(->)ident(tm_mday) operator(>) integer(31) - operator(||) ident(tm)operator(->)ident(tm_hour) operator(<) integer(0) operator(||) ident(tm)operator(->)ident(tm_hour) operator(>) integer(23) - operator(||) ident(tm)operator(->)ident(tm_min) operator(<) integer(0) operator(||) ident(tm)operator(->)ident(tm_min) operator(>) integer(59) - operator(||) ident(tm)operator(->)ident(tm_sec) operator(<) integer(0) operator(||) ident(tm)operator(->)ident(tm_sec) operator(>) integer(60)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) -operator(}) - -directive(static) ident(VALUE) ident(time_gmtime) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(time_localtime) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(static) ident(VALUE) ident(time_get_tm) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(\)\);) - -directive(static) pre_type(int) -ident(leap_year_p)operator(()ident(y)operator(\)) - pre_type(long) ident(y)operator(;) -operator({) - reserved(return) operator((()ident(y) operator(%) integer(4) operator(==) integer(0)operator(\)) operator(&&) operator(()ident(y) operator(%) integer(100) operator(!=) integer(0)operator(\)\)) operator(||) operator(()ident(y) operator(%) integer(400) operator(==) integer(0)operator(\);) -operator(}) - -preprocessor(#define) ident(DIV)operator(()ident(n)operator(,)ident(d)operator(\)) operator((()ident(n)operator(\)<)integer(0) operator(?) ident(NDIV)operator((()ident(n)operator(\),()ident(d)operator(\)\)) operator(:) operator(()ident(n)operator(\))operator(/)operator(()ident(d)operator(\)\)) - -directive(static) ident(time_t) -ident(timegm_noleapsecond)operator(()ident(tm)operator(\)) - reserved(struct) ident(tm) operator(*)ident(tm)operator(;) -operator({) - directive(static) pre_type(int) ident(common_year_yday_offset)operator([]) operator(=) operator({) - operator(-)integer(1)operator(,) - operator(-)integer(1) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(28)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(28) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(28) operator(+) integer(31) operator(+) integer(30)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(28) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(28) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(28) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(28) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(28) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(31) operator(+) integer(30)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(28) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(28) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) - comment(/* 1 2 3 4 5 6 7 8 9 10 11 */) - operator(};) - directive(static) pre_type(int) ident(leap_year_yday_offset)operator([]) operator(=) operator({) - operator(-)integer(1)operator(,) - operator(-)integer(1) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(29)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(29) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(29) operator(+) integer(31) operator(+) integer(30)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(29) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(29) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(29) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(29) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(29) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(31) operator(+) integer(30)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(29) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31)operator(,) - operator(-)integer(1) operator(+) integer(31) operator(+) integer(29) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(31) operator(+) integer(30) operator(+) integer(31) operator(+) integer(30) - comment(/* 1 2 3 4 5 6 7 8 9 10 11 */) - operator(};) - - pre_type(long) ident(tm_year) operator(=) ident(tm)operator(->)ident(tm_year)operator(;) - pre_type(int) ident(tm_yday) operator(=) ident(tm)operator(->)ident(tm_mday)operator(;) - reserved(if) operator(()ident(leap_year_p)operator(()ident(tm_year) operator(+) integer(1900)operator(\)\)) - ident(tm_yday) operator(+=) ident(leap_year_yday_offset)operator([)ident(tm)operator(->)ident(tm_mon)operator(];) - reserved(else) - ident(tm_yday) operator(+=) ident(common_year_yday_offset)operator([)ident(tm)operator(->)ident(tm_mon)operator(];) - - comment(/* - * `Seconds Since the Epoch' in SUSv3: - * tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 + - * (tm_year-70\)*31536000 + ((tm_year-69\)/4\)*86400 - - * ((tm_year-1\)/100\)*86400 + ((tm_year+299\)/400\)*86400 - */) - reserved(return) ident(tm)operator(->)ident(tm_sec) operator(+) ident(tm)operator(->)ident(tm_min)operator(*)integer(60) operator(+) ident(tm)operator(->)ident(tm_hour)operator(*)integer(3600) operator(+) - operator(()ident(time_t)operator(\)()ident(tm_yday) operator(+) - operator(()ident(tm_year)operator(-)integer(70)operator(\)*)integer(365) operator(+) - ident(DIV)operator(()ident(tm_year)operator(-)integer(69)operator(,)integer(4)operator(\)) operator(-) - ident(DIV)operator(()ident(tm_year)operator(-)integer(1)operator(,)integer(100)operator(\)) operator(+) - ident(DIV)operator(()ident(tm_year)operator(+)integer(299)operator(,)integer(400)operator(\)\)*)integer(86400)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(tmcmp)operator(()ident(a)operator(,) ident(b)operator(\)) - reserved(struct) ident(tm) operator(*)ident(a)operator(;) - reserved(struct) ident(tm) operator(*)ident(b)operator(;) -operator({) - reserved(if) operator(()ident(a)operator(->)ident(tm_year) operator(!=) ident(b)operator(->)ident(tm_year)operator(\)) - reserved(return) ident(a)operator(->)ident(tm_year) operator(<) ident(b)operator(->)ident(tm_year) operator(?) operator(-)integer(1) operator(:) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(a)operator(->)ident(tm_mon) operator(!=) ident(b)operator(->)ident(tm_mon)operator(\)) - reserved(return) ident(a)operator(->)ident(tm_mon) operator(<) ident(b)operator(->)ident(tm_mon) operator(?) operator(-)integer(1) operator(:) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(a)operator(->)ident(tm_mday) operator(!=) ident(b)operator(->)ident(tm_mday)operator(\)) - reserved(return) ident(a)operator(->)ident(tm_mday) operator(<) ident(b)operator(->)ident(tm_mday) operator(?) operator(-)integer(1) operator(:) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(a)operator(->)ident(tm_hour) operator(!=) ident(b)operator(->)ident(tm_hour)operator(\)) - reserved(return) ident(a)operator(->)ident(tm_hour) operator(<) ident(b)operator(->)ident(tm_hour) operator(?) operator(-)integer(1) operator(:) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(a)operator(->)ident(tm_min) operator(!=) ident(b)operator(->)ident(tm_min)operator(\)) - reserved(return) ident(a)operator(->)ident(tm_min) operator(<) ident(b)operator(->)ident(tm_min) operator(?) operator(-)integer(1) operator(:) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(a)operator(->)ident(tm_sec) operator(!=) ident(b)operator(->)ident(tm_sec)operator(\)) - reserved(return) ident(a)operator(->)ident(tm_sec) operator(<) ident(b)operator(->)ident(tm_sec) operator(?) operator(-)integer(1) operator(:) integer(1)operator(;) - reserved(else) - reserved(return) integer(0)operator(;) -operator(}) - -preprocessor(#if) ident(SIZEOF_TIME_T) operator(==) ident(SIZEOF_LONG) -reserved(typedef) pre_type(unsigned) pre_type(long) ident(unsigned_time_t)operator(;) -preprocessor(#elif) ident(SIZEOF_TIME_T) operator(==) ident(SIZEOF_INT) -reserved(typedef) pre_type(unsigned) pre_type(int) ident(unsigned_time_t)operator(;) -preprocessor(#elif) ident(SIZEOF_TIME_T) operator(==) ident(SIZEOF_LONG_LONG) -reserved(typedef) pre_type(unsigned) ident(LONG_LONG) ident(unsigned_time_t)operator(;) -preprocessor(#else) -preprocessor(# error) ident(cannot) ident(find) ident(integer) ident(type) ident(which) ident(size) ident(is) ident(same) ident(as) ident(time_t)operator(.) -preprocessor(#endif) - -directive(static) ident(time_t) -ident(search_time_t)operator(()ident(tptr)operator(,) ident(utc_p)operator(\)) - reserved(struct) ident(tm) operator(*)ident(tptr)operator(;) - pre_type(int) ident(utc_p)operator(;) -operator({) - ident(time_t) ident(guess)operator(,) ident(guess_lo)operator(,) ident(guess_hi)operator(;) - reserved(struct) ident(tm) operator(*)ident(tm)operator(,) ident(tm_lo)operator(,) ident(tm_hi)operator(;) - pre_type(int) ident(d)operator(,) ident(have_guess)operator(;) - pre_type(int) ident(find_dst)operator(;) - - ident(find_dst) operator(=) integer(0) operator(<) ident(tptr)operator(->)ident(tm_isdst)operator(;) - -preprocessor(#ifdef) ident(NEGATIVE_TIME_T) - ident(guess_lo) operator(=) operator(()ident(time_t)operator(\)~(()ident(unsigned_time_t)operator(\)~()ident(time_t)operator(\))integer(0) operator(>>) integer(1)operator(\);) -preprocessor(#else) - ident(guess_lo) operator(=) integer(0)operator(;) -preprocessor(#endif) - ident(guess_hi) operator(=) operator((()ident(time_t)operator(\)-)integer(1)operator(\)) operator(<) operator((()ident(time_t)operator(\))integer(0)operator(\)) operator(?) - operator(()ident(time_t)operator(\)(()ident(unsigned_time_t)operator(\)~()ident(time_t)operator(\))integer(0) operator(>>) integer(1)operator(\)) operator(:) - operator(~()ident(time_t)operator(\))integer(0)operator(;) - - ident(guess) operator(=) ident(timegm_noleapsecond)operator(()ident(tptr)operator(\);) - ident(tm) operator(=) operator(()ident(utc_p) operator(?) ident(gmtime) operator(:) ident(localtime)operator(\)(&)ident(guess)operator(\);) - reserved(if) operator(()ident(tm)operator(\)) operator({) - ident(d) operator(=) ident(tmcmp)operator(()ident(tptr)operator(,) ident(tm)operator(\);) - reserved(if) operator(()ident(d) operator(==) integer(0)operator(\)) reserved(return) ident(guess)operator(;) - reserved(if) operator(()ident(d) operator(<) integer(0)operator(\)) operator({) - ident(guess_hi) operator(=) ident(guess)operator(;) - ident(guess) operator(-=) integer(24) operator(*) integer(60) operator(*) integer(60)operator(;) - operator(}) - reserved(else) operator({) - ident(guess_lo) operator(=) ident(guess)operator(;) - ident(guess) operator(+=) integer(24) operator(*) integer(60) operator(*) integer(60)operator(;) - operator(}) - reserved(if) operator(()ident(guess_lo) operator(<) ident(guess) operator(&&) ident(guess) operator(<) ident(guess_hi) operator(&&) - operator(()ident(tm) operator(=) operator(()ident(utc_p) operator(?) ident(gmtime) operator(:) ident(localtime)operator(\)(&)ident(guess)operator(\)\)) operator(!=) pre_constant(NULL)operator(\)) operator({) - ident(d) operator(=) ident(tmcmp)operator(()ident(tptr)operator(,) ident(tm)operator(\);) - reserved(if) operator(()ident(d) operator(==) integer(0)operator(\)) reserved(return) ident(guess)operator(;) - reserved(if) operator(()ident(d) operator(<) integer(0)operator(\)) - ident(guess_hi) operator(=) ident(guess)operator(;) - reserved(else) - ident(guess_lo) operator(=) ident(guess)operator(;) - operator(}) - operator(}) - - ident(tm) operator(=) operator(()ident(utc_p) operator(?) ident(gmtime) operator(:) ident(localtime)operator(\)(&)ident(guess_lo)operator(\);) - reserved(if) operator((!)ident(tm)operator(\)) reserved(goto) ident(error)operator(;) - ident(d) operator(=) ident(tmcmp)operator(()ident(tptr)operator(,) ident(tm)operator(\);) - reserved(if) operator(()ident(d) operator(<) integer(0)operator(\)) reserved(goto) ident(out_of_range)operator(;) - reserved(if) operator(()ident(d) operator(==) integer(0)operator(\)) reserved(return) ident(guess_lo)operator(;) - ident(tm_lo) operator(=) operator(*)ident(tm)operator(;) - - ident(tm) operator(=) operator(()ident(utc_p) operator(?) ident(gmtime) operator(:) ident(localtime)operator(\)(&)ident(guess_hi)operator(\);) - reserved(if) operator((!)ident(tm)operator(\)) reserved(goto) ident(error)operator(;) - ident(d) operator(=) ident(tmcmp)operator(()ident(tptr)operator(,) ident(tm)operator(\);) - reserved(if) operator(()ident(d) operator(>) integer(0)operator(\)) reserved(goto) ident(out_of_range)operator(;) - reserved(if) operator(()ident(d) operator(==) integer(0)operator(\)) reserved(return) ident(guess_hi)operator(;) - ident(tm_hi) operator(=) operator(*)ident(tm)operator(;) - - ident(have_guess) operator(=) integer(0)operator(;) - - reserved(while) operator(()ident(guess_lo) operator(+) integer(1) operator(<) ident(guess_hi)operator(\)) operator({) - comment(/* there is a gap between guess_lo and guess_hi. */) - pre_type(unsigned) pre_type(long) ident(range) operator(=) integer(0)operator(;) - reserved(if) operator((!)ident(have_guess)operator(\)) operator({) - pre_type(int) ident(a)operator(,) ident(b)operator(;) - comment(/* - Try precious guess by a linear interpolation at first. - `a' and `b' is a coefficient of guess_lo and guess_hi as: - - guess = (guess_lo * a + guess_hi * b\) / (a + b\) - - However this causes overflow in most cases, following assignment - is used instead: - - guess = guess_lo / d * a + (guess_lo % d\) * a / d - + guess_hi / d * b + (guess_hi % d\) * b / d - where d = a + b - - To avoid overflow in this assignment, `d' is restricted to less than - sqrt(2**31\). By this restriction and other reasons, the guess is - not accurate and some error is expected. `range' approximates - the maximum error. - - When these parameters are not suitable, i.e. guess is not within - guess_lo and guess_hi, simple guess by binary search is used. - */) - ident(range) operator(=) integer(366) operator(*) integer(24) operator(*) integer(60) operator(*) integer(60)operator(;) - ident(a) operator(=) operator(()ident(tm_hi)operator(.)ident(tm_year) operator(-) ident(tptr)operator(->)ident(tm_year)operator(\);) - ident(b) operator(=) operator(()ident(tptr)operator(->)ident(tm_year) operator(-) ident(tm_lo)operator(.)ident(tm_year)operator(\);) - comment(/* 46000 is selected as `some big number less than sqrt(2**31\)'. */) - reserved(if) operator(()ident(a) operator(+) ident(b) operator(<=) integer(46000) operator(/) integer(12)operator(\)) operator({) - ident(range) operator(=) integer(31) operator(*) integer(24) operator(*) integer(60) operator(*) integer(60)operator(;) - ident(a) operator(*=) integer(12)operator(;) - ident(b) operator(*=) integer(12)operator(;) - ident(a) operator(+=) ident(tm_hi)operator(.)ident(tm_mon) operator(-) ident(tptr)operator(->)ident(tm_mon)operator(;) - ident(b) operator(+=) ident(tptr)operator(->)ident(tm_mon) operator(-) ident(tm_lo)operator(.)ident(tm_mon)operator(;) - reserved(if) operator(()ident(a) operator(+) ident(b) operator(<=) integer(46000) operator(/) integer(31)operator(\)) operator({) - ident(range) operator(=) integer(24) operator(*) integer(60) operator(*) integer(60)operator(;) - ident(a) operator(*=) integer(31)operator(;) - ident(b) operator(*=) integer(31)operator(;) - ident(a) operator(+=) ident(tm_hi)operator(.)ident(tm_mday) operator(-) ident(tptr)operator(->)ident(tm_mday)operator(;) - ident(b) operator(+=) ident(tptr)operator(->)ident(tm_mday) operator(-) ident(tm_lo)operator(.)ident(tm_mday)operator(;) - reserved(if) operator(()ident(a) operator(+) ident(b) operator(<=) integer(46000) operator(/) integer(24)operator(\)) operator({) - ident(range) operator(=) integer(60) operator(*) integer(60)operator(;) - ident(a) operator(*=) integer(24)operator(;) - ident(b) operator(*=) integer(24)operator(;) - ident(a) operator(+=) ident(tm_hi)operator(.)ident(tm_hour) operator(-) ident(tptr)operator(->)ident(tm_hour)operator(;) - ident(b) operator(+=) ident(tptr)operator(->)ident(tm_hour) operator(-) ident(tm_lo)operator(.)ident(tm_hour)operator(;) - reserved(if) operator(()ident(a) operator(+) ident(b) operator(<=) integer(46000) operator(/) integer(60)operator(\)) operator({) - ident(range) operator(=) integer(60)operator(;) - ident(a) operator(*=) integer(60)operator(;) - ident(b) operator(*=) integer(60)operator(;) - ident(a) operator(+=) ident(tm_hi)operator(.)ident(tm_min) operator(-) ident(tptr)operator(->)ident(tm_min)operator(;) - ident(b) operator(+=) ident(tptr)operator(->)ident(tm_min) operator(-) ident(tm_lo)operator(.)ident(tm_min)operator(;) - reserved(if) operator(()ident(a) operator(+) ident(b) operator(<=) integer(46000) operator(/) integer(60)operator(\)) operator({) - ident(range) operator(=) integer(1)operator(;) - ident(a) operator(*=) integer(60)operator(;) - ident(b) operator(*=) integer(60)operator(;) - ident(a) operator(+=) ident(tm_hi)operator(.)ident(tm_sec) operator(-) ident(tptr)operator(->)ident(tm_sec)operator(;) - ident(b) operator(+=) ident(tptr)operator(->)ident(tm_sec) operator(-) ident(tm_lo)operator(.)ident(tm_sec)operator(;) - operator(}) - operator(}) - operator(}) - operator(}) - operator(}) - reserved(if) operator(()ident(a) operator(<=) integer(0)operator(\)) ident(a) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(b) operator(<=) integer(0)operator(\)) ident(b) operator(=) integer(1)operator(;) - ident(d) operator(=) ident(a) operator(+) ident(b)operator(;) - comment(/* - Although `/' and `%' may produce unexpected result with negative - argument, it doesn't cause serious problem because there is a - fail safe. - */) - ident(guess) operator(=) ident(guess_lo) operator(/) ident(d) operator(*) ident(a) operator(+) operator(()ident(guess_lo) operator(%) ident(d)operator(\)) operator(*) ident(a) operator(/) ident(d) - operator(+) ident(guess_hi) operator(/) ident(d) operator(*) ident(b) operator(+) operator(()ident(guess_hi) operator(%) ident(d)operator(\)) operator(*) ident(b) operator(/) ident(d)operator(;) - ident(have_guess) operator(=) integer(1)operator(;) - operator(}) - - reserved(if) operator(()ident(guess) operator(<=) ident(guess_lo) operator(||) ident(guess_hi) operator(<=) ident(guess)operator(\)) operator({) - comment(/* Precious guess is invalid. try binary search. */) - ident(guess) operator(=) ident(guess_lo) operator(/) integer(2) operator(+) ident(guess_hi) operator(/) integer(2)operator(;) - reserved(if) operator(()ident(guess) operator(<=) ident(guess_lo)operator(\)) - ident(guess) operator(=) ident(guess_lo) operator(+) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(guess) operator(>=) ident(guess_hi)operator(\)) - ident(guess) operator(=) ident(guess_hi) operator(-) integer(1)operator(;) - ident(range) operator(=) integer(0)operator(;) - operator(}) - - ident(tm) operator(=) operator(()ident(utc_p) operator(?) ident(gmtime) operator(:) ident(localtime)operator(\)(&)ident(guess)operator(\);) - reserved(if) operator((!)ident(tm)operator(\)) reserved(goto) ident(error)operator(;) - ident(have_guess) operator(=) integer(0)operator(;) - - ident(d) operator(=) ident(tmcmp)operator(()ident(tptr)operator(,) ident(tm)operator(\);) - reserved(if) operator(()ident(d) operator(<) integer(0)operator(\)) operator({) - ident(guess_hi) operator(=) ident(guess)operator(;) - ident(tm_hi) operator(=) operator(*)ident(tm)operator(;) - reserved(if) operator(()ident(range)operator(\)) operator({) - ident(guess) operator(=) ident(guess) operator(-) ident(range)operator(;) - ident(range) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(guess_lo) operator(<) ident(guess) operator(&&) ident(guess) operator(<) ident(guess_hi)operator(\)) - ident(have_guess) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(d) operator(>) integer(0)operator(\)) operator({) - ident(guess_lo) operator(=) ident(guess)operator(;) - ident(tm_lo) operator(=) operator(*)ident(tm)operator(;) - reserved(if) operator(()ident(range)operator(\)) operator({) - ident(guess) operator(=) ident(guess) operator(+) ident(range)operator(;) - ident(range) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(guess_lo) operator(<) ident(guess) operator(&&) ident(guess) operator(<) ident(guess_hi)operator(\)) - ident(have_guess) operator(=) integer(1)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - reserved(if) operator((!)ident(utc_p)operator(\)) operator({) - comment(/* If localtime is nonmonotonic, another result may exist. */) - ident(time_t) ident(guess2)operator(;) - reserved(if) operator(()ident(find_dst)operator(\)) operator({) - ident(guess2) operator(=) ident(guess) operator(-) integer(2) operator(*) integer(60) operator(*) integer(60)operator(;) - ident(tm) operator(=) ident(localtime)operator((&)ident(guess2)operator(\);) - reserved(if) operator(()ident(tm)operator(\)) operator({) - reserved(if) operator(()ident(tptr)operator(->)ident(tm_hour) operator(!=) operator(()ident(tm)operator(->)ident(tm_hour) operator(+) integer(2)operator(\)) operator(%) integer(24) operator(||) - ident(tptr)operator(->)ident(tm_min) operator(!=) ident(tm)operator(->)ident(tm_min) operator(||) - ident(tptr)operator(->)ident(tm_sec) operator(!=) ident(tm)operator(->)ident(tm_sec)operator(\)) operator({) - ident(guess2) operator(-=) operator(()ident(tm)operator(->)ident(tm_hour) operator(-) ident(tptr)operator(->)ident(tm_hour)operator(\)) operator(*) integer(60) operator(*) integer(60) operator(+) - operator(()ident(tm)operator(->)ident(tm_min) operator(-) ident(tptr)operator(->)ident(tm_min)operator(\)) operator(*) integer(60) operator(+) - operator(()ident(tm)operator(->)ident(tm_sec) operator(-) ident(tptr)operator(->)ident(tm_sec)operator(\);) - reserved(if) operator(()ident(tptr)operator(->)ident(tm_mday) operator(!=) ident(tm)operator(->)ident(tm_mday)operator(\)) - ident(guess2) operator(+=) integer(24) operator(*) integer(60) operator(*) integer(60)operator(;) - reserved(if) operator(()ident(guess) operator(!=) ident(guess2)operator(\)) operator({) - ident(tm) operator(=) ident(localtime)operator((&)ident(guess2)operator(\);) - reserved(if) operator(()ident(tmcmp)operator(()ident(tptr)operator(,) ident(tm)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(guess) operator(<) ident(guess2)operator(\)) - reserved(return) ident(guess)operator(;) - reserved(else) - reserved(return) ident(guess2)operator(;) - operator(}) - operator(}) - operator(}) - operator(}) - operator(}) - reserved(else) operator({) - ident(guess2) operator(=) ident(guess) operator(+) integer(2) operator(*) integer(60) operator(*) integer(60)operator(;) - ident(tm) operator(=) ident(localtime)operator((&)ident(guess2)operator(\);) - reserved(if) operator(()ident(tm)operator(\)) operator({) - reserved(if) operator((()ident(tptr)operator(->)ident(tm_hour) operator(+) integer(2)operator(\)) operator(%) integer(24) operator(!=) ident(tm)operator(->)ident(tm_hour) operator(||) - ident(tptr)operator(->)ident(tm_min) operator(!=) ident(tm)operator(->)ident(tm_min) operator(||) - ident(tptr)operator(->)ident(tm_sec) operator(!=) ident(tm)operator(->)ident(tm_sec)operator(\)) operator({) - ident(guess2) operator(-=) operator(()ident(tm)operator(->)ident(tm_hour) operator(-) ident(tptr)operator(->)ident(tm_hour)operator(\)) operator(*) integer(60) operator(*) integer(60) operator(+) - operator(()ident(tm)operator(->)ident(tm_min) operator(-) ident(tptr)operator(->)ident(tm_min)operator(\)) operator(*) integer(60) operator(+) - operator(()ident(tm)operator(->)ident(tm_sec) operator(-) ident(tptr)operator(->)ident(tm_sec)operator(\);) - reserved(if) operator(()ident(tptr)operator(->)ident(tm_mday) operator(!=) ident(tm)operator(->)ident(tm_mday)operator(\)) - ident(guess2) operator(-=) integer(24) operator(*) integer(60) operator(*) integer(60)operator(;) - reserved(if) operator(()ident(guess) operator(!=) ident(guess2)operator(\)) operator({) - ident(tm) operator(=) ident(localtime)operator((&)ident(guess2)operator(\);) - reserved(if) operator(()ident(tmcmp)operator(()ident(tptr)operator(,) ident(tm)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(guess) operator(<) ident(guess2)operator(\)) - reserved(return) ident(guess2)operator(;) - reserved(else) - reserved(return) ident(guess)operator(;) - operator(}) - operator(}) - operator(}) - operator(}) - operator(}) - operator(}) - reserved(return) ident(guess)operator(;) - operator(}) - operator(}) - comment(/* Given argument has no corresponding time_t. Let's outerpolation. */) - reserved(if) operator(()ident(tm_lo)operator(.)ident(tm_year) operator(==) ident(tptr)operator(->)ident(tm_year) operator(&&) ident(tm_lo)operator(.)ident(tm_mon) operator(==) ident(tptr)operator(->)ident(tm_mon)operator(\)) operator({) - reserved(return) ident(guess_lo) operator(+) - operator(()ident(tptr)operator(->)ident(tm_mday) operator(-) ident(tm_lo)operator(.)ident(tm_mday)operator(\)) operator(*) integer(24) operator(*) integer(60) operator(*) integer(60) operator(+) - operator(()ident(tptr)operator(->)ident(tm_hour) operator(-) ident(tm_lo)operator(.)ident(tm_hour)operator(\)) operator(*) integer(60) operator(*) integer(60) operator(+) - operator(()ident(tptr)operator(->)ident(tm_min) operator(-) ident(tm_lo)operator(.)ident(tm_min)operator(\)) operator(*) integer(60) operator(+) - operator(()ident(tptr)operator(->)ident(tm_sec) operator(-) ident(tm_lo)operator(.)ident(tm_sec)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(tm_hi)operator(.)ident(tm_year) operator(==) ident(tptr)operator(->)ident(tm_year) operator(&&) ident(tm_hi)operator(.)ident(tm_mon) operator(==) ident(tptr)operator(->)ident(tm_mon)operator(\)) operator({) - reserved(return) ident(guess_hi) operator(+) - operator(()ident(tptr)operator(->)ident(tm_mday) operator(-) ident(tm_hi)operator(.)ident(tm_mday)operator(\)) operator(*) integer(24) operator(*) integer(60) operator(*) integer(60) operator(+) - operator(()ident(tptr)operator(->)ident(tm_hour) operator(-) ident(tm_hi)operator(.)ident(tm_hour)operator(\)) operator(*) integer(60) operator(*) integer(60) operator(+) - operator(()ident(tptr)operator(->)ident(tm_min) operator(-) ident(tm_hi)operator(.)ident(tm_min)operator(\)) operator(*) integer(60) operator(+) - operator(()ident(tptr)operator(->)ident(tm_sec) operator(-) ident(tm_hi)operator(.)ident(tm_sec)operator(\);) - operator(}) - - label(out_of_range:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - - label(error:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(return) integer(0)operator(;) comment(/* not reached */) -operator(}) - -directive(static) ident(time_t) -ident(make_time_t)operator(()ident(tptr)operator(,) ident(utc_p)operator(\)) - reserved(struct) ident(tm) operator(*)ident(tptr)operator(;) - pre_type(int) ident(utc_p)operator(;) -operator({) - ident(time_t) ident(t)operator(;) - reserved(struct) ident(tm) operator(*)ident(tmp)operator(,) ident(buf)operator(;) - ident(buf) operator(=) operator(*)ident(tptr)operator(;) - reserved(if) operator(()ident(utc_p)operator(\)) operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_TIMEGM)operator(\)) - reserved(if) operator((()ident(t) operator(=) ident(timegm)operator((&)ident(buf)operator(\)\)) operator(!=) operator(-)integer(1)operator(\)) - reserved(return) ident(t)operator(;) -preprocessor(#ifdef) ident(NEGATIVE_TIME_T) - reserved(if) operator((()ident(tmp) operator(=) ident(gmtime)operator((&)ident(t)operator(\)\)) operator(&&) - ident(tptr)operator(->)ident(tm_year) operator(==) ident(tmp)operator(->)ident(tm_year) operator(&&) - ident(tptr)operator(->)ident(tm_mon) operator(==) ident(tmp)operator(->)ident(tm_mon) operator(&&) - ident(tptr)operator(->)ident(tm_mday) operator(==) ident(tmp)operator(->)ident(tm_mday) operator(&&) - ident(tptr)operator(->)ident(tm_hour) operator(==) ident(tmp)operator(->)ident(tm_hour) operator(&&) - ident(tptr)operator(->)ident(tm_min) operator(==) ident(tmp)operator(->)ident(tm_min) operator(&&) - ident(tptr)operator(->)ident(tm_sec) operator(==) ident(tmp)operator(->)ident(tm_sec)operator(\)) - reserved(return) ident(t)operator(;) -preprocessor(#endif) -preprocessor(#endif) - reserved(return) ident(search_time_t)operator((&)ident(buf)operator(,) ident(utc_p)operator(\);) - operator(}) - reserved(else) operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_MKTIME)operator(\)) - reserved(if) operator((()ident(t) operator(=) ident(mktime)operator((&)ident(buf)operator(\)\)) operator(!=) operator(-)integer(1)operator(\)) - reserved(return) ident(t)operator(;) -preprocessor(#ifdef) ident(NEGATIVE_TIME_T) - reserved(if) operator((()ident(tmp) operator(=) ident(localtime)operator((&)ident(t)operator(\)\)) operator(&&) - ident(tptr)operator(->)ident(tm_year) operator(==) ident(tmp)operator(->)ident(tm_year) operator(&&) - ident(tptr)operator(->)ident(tm_mon) operator(==) ident(tmp)operator(->)ident(tm_mon) operator(&&) - ident(tptr)operator(->)ident(tm_mday) operator(==) ident(tmp)operator(->)ident(tm_mday) operator(&&) - ident(tptr)operator(->)ident(tm_hour) operator(==) ident(tmp)operator(->)ident(tm_hour) operator(&&) - ident(tptr)operator(->)ident(tm_min) operator(==) ident(tmp)operator(->)ident(tm_min) operator(&&) - ident(tptr)operator(->)ident(tm_sec) operator(==) ident(tmp)operator(->)ident(tm_sec)operator(\)) - reserved(return) ident(t)operator(;) -preprocessor(#endif) -preprocessor(#endif) - reserved(return) ident(search_time_t)operator((&)ident(buf)operator(,) ident(utc_p)operator(\);) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(time_utc_or_local)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(utc_p)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - pre_type(int) ident(utc_p)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(struct) ident(tm) ident(tm)operator(;) - ident(VALUE) ident(time)operator(;) - ident(time_t) ident(usec)operator(;) - - ident(time_arg)operator(()ident(argc)operator(,) ident(argv)operator(,) operator(&)ident(tm)operator(,) operator(&)ident(usec)operator(\);) - ident(time) operator(=) ident(time_new_internal)operator(()ident(klass)operator(,) ident(make_time_t)operator((&)ident(tm)operator(,) ident(utc_p)operator(\),) ident(usec)operator(\);) - reserved(if) operator(()ident(utc_p)operator(\)) reserved(return) ident(time_gmtime)operator(()ident(time)operator(\);) - reserved(return) ident(time_localtime)operator(()ident(time)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Time.utc( year [, month, day, hour, min, sec, usec] \) => time - * Time.utc( sec, min, hour, day, month, year, wday, yday, isdst, tz - * \) => time - * Time.gm( year [, month, day, hour, min, sec, usec] \) => time - * Time.gm( sec, min, hour, day, month, year, wday, yday, isdst, tz - * \) => time - * - * Creates a time based on given values, interpreted as UTC (GMT\). The - * year must be specified. Other values default to the minimum value - * for that field (and may be nil or omitted\). Months may - * be specified by numbers from 1 to 12, or by the three-letter English - * month names. Hours are specified on a 24-hour clock (0..23\). Raises - * an ArgumentError if any values are out of range. Will - * also accept ten arguments in the order output by - * Time#to_a. - * - * Time.utc(2000,"jan",1,20,15,1\) #=> Sat Jan 01 20:15:01 UTC 2000 - * Time.gm(2000,"jan",1,20,15,1\) #=> Sat Jan 01 20:15:01 UTC 2000 - */) -directive(static) ident(VALUE) -ident(time_s_mkutc)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(return) ident(time_utc_or_local)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(Qtrue)operator(,) ident(klass)operator(\);) -operator(}) - -comment(/* - * call-seq: - * Time.local( year [, month, day, hour, min, sec, usec] \) => time - * Time.local( sec, min, hour, day, month, year, wday, yday, isdst, - * tz \) => time - * Time.mktime( year, month, day, hour, min, sec, usec \) => time - * - * Same as Time::gm, but interprets the values in the - * local time zone. - * - * Time.local(2000,"jan",1,20,15,1\) #=> Sat Jan 01 20:15:01 CST 2000 - */) - -directive(static) ident(VALUE) -ident(time_s_mktime)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(klass)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(return) ident(time_utc_or_local)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(Qfalse)operator(,) ident(klass)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.to_i => int - * time.tv_sec => int - * - * Returns the value of time as an integer number of seconds - * since epoch. - * - * t = Time.now - * "%10.5f" % t.to_f #=> "1049896564.17839" - * t.to_i #=> 1049896564 - */) - -directive(static) ident(VALUE) -ident(time_to_i)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(return) ident(LONG2NUM)operator(()ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.to_f => float - * - * Returns the value of time as a floating point number of - * seconds since epoch. - * - * t = Time.now - * "%10.5f" % t.to_f #=> "1049896564.13654" - * t.to_i #=> 1049896564 - */) - -directive(static) ident(VALUE) -ident(time_to_f)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(return) ident(rb_float_new)operator((()pre_type(double)operator(\))ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec)operator(+()pre_type(double)operator(\))ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec)operator(/)float(1)ident(e6)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.usec => int - * time.tv_usec => int - * - * Returns just the number of microseconds for time. - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * "%10.6f" % t.to_f #=> "1049896564.259970" - * t.usec #=> 259970 - */) - -directive(static) ident(VALUE) -ident(time_usec)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(return) ident(LONG2NUM)operator(()ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time <=> other_time => -1, 0, +1 - * time <=> numeric => -1, 0, +1 - * - * Comparison---Compares time with other_time or with - * numeric, which is the number of seconds (possibly - * fractional\) since epoch. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t2 = t + 2592000 #=> Fri May 09 08:56:03 CDT 2003 - * t <=> t2 #=> -1 - * t2 <=> t #=> 1 - * t <=> t #=> 0 - */) - -directive(static) ident(VALUE) -ident(time_cmp)operator(()ident(time1)operator(,) ident(time2)operator(\)) - ident(VALUE) ident(time1)operator(,) ident(time2)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj1)operator(,) operator(*)ident(tobj2)operator(;) - - ident(GetTimeval)operator(()ident(time1)operator(,) ident(tobj1)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(time2)operator(\)) operator(==) ident(T_DATA) operator(&&) ident(RDATA)operator(()ident(time2)operator(\)->)ident(dfree) operator(==) ident(time_free)operator(\)) operator({) - ident(GetTimeval)operator(()ident(time2)operator(,) ident(tobj2)operator(\);) - reserved(if) operator(()ident(tobj1)operator(->)ident(tv)operator(.)ident(tv_sec) operator(==) ident(tobj2)operator(->)ident(tv)operator(.)ident(tv_sec)operator(\)) operator({) - reserved(if) operator(()ident(tobj1)operator(->)ident(tv)operator(.)ident(tv_usec) operator(==) ident(tobj2)operator(->)ident(tv)operator(.)ident(tv_usec)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - reserved(if) operator(()ident(tobj1)operator(->)ident(tv)operator(.)ident(tv_usec) operator(>) ident(tobj2)operator(->)ident(tv)operator(.)ident(tv_usec)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - reserved(if) operator(()ident(tobj1)operator(->)ident(tv)operator(.)ident(tv_sec) operator(>) ident(tobj2)operator(->)ident(tv)operator(.)ident(tv_sec)operator(\)) reserved(return) ident(INT2FIX)operator(()integer(1)operator(\);) - reserved(return) ident(INT2FIX)operator((-)integer(1)operator(\);) - operator(}) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/* - * call-seq: - * time.eql?(other_time\) - * - * Return true if time and other_time are - * both Time objects with the same seconds and fractional - * seconds. - */) - -directive(static) ident(VALUE) -ident(time_eql)operator(()ident(time1)operator(,) ident(time2)operator(\)) - ident(VALUE) ident(time1)operator(,) ident(time2)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj1)operator(,) operator(*)ident(tobj2)operator(;) - - ident(GetTimeval)operator(()ident(time1)operator(,) ident(tobj1)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(time2)operator(\)) operator(==) ident(T_DATA) operator(&&) ident(RDATA)operator(()ident(time2)operator(\)->)ident(dfree) operator(==) ident(time_free)operator(\)) operator({) - ident(GetTimeval)operator(()ident(time2)operator(,) ident(tobj2)operator(\);) - reserved(if) operator(()ident(tobj1)operator(->)ident(tv)operator(.)ident(tv_sec) operator(==) ident(tobj2)operator(->)ident(tv)operator(.)ident(tv_sec)operator(\)) operator({) - reserved(if) operator(()ident(tobj1)operator(->)ident(tv)operator(.)ident(tv_usec) operator(==) ident(tobj2)operator(->)ident(tv)operator(.)ident(tv_usec)operator(\)) reserved(return) ident(Qtrue)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * time.utc? => true or false - * time.gmt? => true or false - * - * Returns true if time represents a time in UTC - * (GMT\). - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.utc? #=> false - * t = Time.gm(2000,"jan",1,20,15,1\) #=> Sat Jan 01 20:15:01 UTC 2000 - * t.utc? #=> true - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.gmt? #=> false - * t = Time.gm(2000,1,1,20,15,1\) #=> Sat Jan 01 20:15:01 UTC 2000 - * t.gmt? #=> true - */) - -directive(static) ident(VALUE) -ident(time_utc_p)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(gmt)operator(\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * time.hash => fixnum - * - * Return a hash code for this time object. - */) - -directive(static) ident(VALUE) -ident(time_hash)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - pre_type(long) ident(hash)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - ident(hash) operator(=) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec) operator(^) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec)operator(;) - reserved(return) ident(LONG2FIX)operator(()ident(hash)operator(\);) -operator(}) - -comment(/* :nodoc: */) -directive(static) ident(VALUE) -ident(time_init_copy)operator(()ident(copy)operator(,) ident(time)operator(\)) - ident(VALUE) ident(copy)operator(,) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(,) operator(*)ident(tcopy)operator(;) - - reserved(if) operator(()ident(copy) operator(==) ident(time)operator(\)) reserved(return) ident(copy)operator(;) - ident(time_modify)operator(()ident(copy)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(time)operator(\)) operator(!=) ident(T_DATA) operator(||) ident(RDATA)operator(()ident(time)operator(\)->)ident(dfree) operator(!=) ident(time_free)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - ident(GetTimeval)operator(()ident(copy)operator(,) ident(tcopy)operator(\);) - ident(MEMCPY)operator(()ident(tcopy)operator(,) ident(tobj)operator(,) reserved(struct) ident(time_object)operator(,) integer(1)operator(\);) - - reserved(return) ident(copy)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(time_dup)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - ident(VALUE) ident(dup) operator(=) ident(time_s_alloc)operator(()ident(CLASS_OF)operator(()ident(time)operator(\)\);) - ident(time_init_copy)operator(()ident(dup)operator(,) ident(time)operator(\);) - reserved(return) ident(dup)operator(;) -operator(}) - -comment(/* - * call-seq: - * time.localtime => time - * - * Converts time to local time (using the local time zone in - * effect for this process\) modifying the receiver. - * - * t = Time.gm(2000, "jan", 1, 20, 15, 1\) - * t.gmt? #=> true - * t.localtime #=> Sat Jan 01 14:15:01 CST 2000 - * t.gmt? #=> false - */) - -directive(static) ident(VALUE) -ident(time_localtime)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - reserved(struct) ident(tm) operator(*)ident(tm_tmp)operator(;) - ident(time_t) ident(t)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator((!)ident(tobj)operator(->)ident(gmt)operator(\)) operator({) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got)operator(\)) - reserved(return) ident(time)operator(;) - operator(}) - reserved(else) operator({) - ident(time_modify)operator(()ident(time)operator(\);) - operator(}) - ident(t) operator(=) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec)operator(;) - ident(tm_tmp) operator(=) ident(localtime)operator((&)ident(t)operator(\);) - reserved(if) operator((!)ident(tm_tmp)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - ident(tobj)operator(->)ident(tm) operator(=) operator(*)ident(tm_tmp)operator(;) - ident(tobj)operator(->)ident(tm_got) operator(=) integer(1)operator(;) - ident(tobj)operator(->)ident(gmt) operator(=) integer(0)operator(;) - reserved(return) ident(time)operator(;) -operator(}) - -comment(/* - * call-seq: - * time.gmtime => time - * time.utc => time - * - * Converts time to UTC (GMT\), modifying the receiver. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.gmt? #=> false - * t.gmtime #=> Wed Apr 09 13:56:03 UTC 2003 - * t.gmt? #=> true - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.utc? #=> false - * t.utc #=> Wed Apr 09 13:56:04 UTC 2003 - * t.utc? #=> true - */) - -directive(static) ident(VALUE) -ident(time_gmtime)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - reserved(struct) ident(tm) operator(*)ident(tm_tmp)operator(;) - ident(time_t) ident(t)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(gmt)operator(\)) operator({) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got)operator(\)) - reserved(return) ident(time)operator(;) - operator(}) - reserved(else) operator({) - ident(time_modify)operator(()ident(time)operator(\);) - operator(}) - ident(t) operator(=) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec)operator(;) - ident(tm_tmp) operator(=) ident(gmtime)operator((&)ident(t)operator(\);) - reserved(if) operator((!)ident(tm_tmp)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - ident(tobj)operator(->)ident(tm) operator(=) operator(*)ident(tm_tmp)operator(;) - ident(tobj)operator(->)ident(tm_got) operator(=) integer(1)operator(;) - ident(tobj)operator(->)ident(gmt) operator(=) integer(1)operator(;) - reserved(return) ident(time)operator(;) -operator(}) - -comment(/* - * call-seq: - * time.getlocal => new_time - * - * Returns a new new_time object representing time in - * local time (using the local time zone in effect for this process\). - * - * t = Time.gm(2000,1,1,20,15,1\) #=> Sat Jan 01 20:15:01 UTC 2000 - * t.gmt? #=> true - * l = t.getlocal #=> Sat Jan 01 14:15:01 CST 2000 - * l.gmt? #=> false - * t == l #=> true - */) - -directive(static) ident(VALUE) -ident(time_getlocaltime)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(return) ident(time_localtime)operator(()ident(time_dup)operator(()ident(time)operator(\)\);) -operator(}) - -comment(/* - * call-seq: - * time.getgm => new_time - * time.getutc => new_time - * - * Returns a new new_time object representing time in - * UTC. - * - * t = Time.local(2000,1,1,20,15,1\) #=> Sat Jan 01 20:15:01 CST 2000 - * t.gmt? #=> false - * y = t.getgm #=> Sun Jan 02 02:15:01 UTC 2000 - * y.gmt? #=> true - * t == y #=> true - */) - -directive(static) ident(VALUE) -ident(time_getgmtime)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(return) ident(time_gmtime)operator(()ident(time_dup)operator(()ident(time)operator(\)\);) -operator(}) - -directive(static) ident(VALUE) -ident(time_get_tm)operator(()ident(time)operator(,) ident(gmt)operator(\)) - ident(VALUE) ident(time)operator(;) - pre_type(int) ident(gmt)operator(;) -operator({) - reserved(if) operator(()ident(gmt)operator(\)) reserved(return) ident(time_gmtime)operator(()ident(time)operator(\);) - reserved(return) ident(time_localtime)operator(()ident(time)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.asctime => string - * time.ctime => string - * - * Returns a canonical string representation of time. - * - * Time.now.asctime #=> "Wed Apr 9 08:56:03 2003" - */) - -directive(static) ident(VALUE) -ident(time_asctime)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - pre_type(char) operator(*)ident(s)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - ident(s) operator(=) ident(asctime)operator((&)ident(tobj)operator(->)ident(tm)operator(\);) - reserved(if) operator(()ident(s)operator([)integer(24)operator(]) operator(==) char('\\n')operator(\)) ident(s)operator([)integer(24)operator(]) operator(=) char('\\0')operator(;) - - reserved(return) ident(rb_str_new2)operator(()ident(s)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.inspect => string - * time.to_s => string - * - * Returns a string representing time. Equivalent to calling - * Time#strftime with a format string of ``%a - * %b %d %H:%M:%S - * %Z %Y''. - * - * Time.now.to_s #=> "Wed Apr 09 08:56:04 CDT 2003" - */) - -directive(static) ident(VALUE) -ident(time_to_s)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - pre_type(char) ident(buf)operator([)integer(128)operator(];) - pre_type(int) ident(len)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - reserved(if) operator(()ident(tobj)operator(->)ident(gmt) operator(==) integer(1)operator(\)) operator({) - ident(len) operator(=) ident(strftime)operator(()ident(buf)operator(,) integer(128)operator(,) stringoperator(,) operator(&)ident(tobj)operator(->)ident(tm)operator(\);) - operator(}) - reserved(else) operator({) - ident(time_t) ident(off)operator(;) - pre_type(char) ident(buf2)operator([)integer(32)operator(];) - pre_type(char) ident(sign) operator(=) char('+')operator(;) -preprocessor(#if) ident(defined)operator(()ident(HAVE_STRUCT_TM_TM_GMTOFF)operator(\)) - ident(off) operator(=) ident(tobj)operator(->)ident(tm)operator(.)ident(tm_gmtoff)operator(;) -preprocessor(#else) - ident(VALUE) ident(tmp) operator(=) ident(time_utc_offset)operator(()ident(time)operator(\);) - ident(off) operator(=) ident(NUM2INT)operator(()ident(tmp)operator(\);) -preprocessor(#endif) - reserved(if) operator(()ident(off) operator(<) integer(0)operator(\)) operator({) - ident(sign) operator(=) char('-')operator(;) - ident(off) operator(=) operator(-)ident(off)operator(;) - operator(}) - ident(sprintf)operator(()ident(buf2)operator(,) stringoperator(,) - ident(sign)operator(,) operator(()pre_type(int)operator(\)()ident(off)operator(/)integer(3600)operator(\),) operator(()pre_type(int)operator(\)()ident(off)operator(%)integer(3600)operator(/)integer(60)operator(\)\);) - ident(len) operator(=) ident(strftime)operator(()ident(buf)operator(,) integer(128)operator(,) ident(buf2)operator(,) operator(&)ident(tobj)operator(->)ident(tm)operator(\);) - operator(}) - reserved(return) ident(rb_str_new)operator(()ident(buf)operator(,) ident(len)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(time_add)operator(()ident(tobj)operator(,) ident(offset)operator(,) ident(sign)operator(\)) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - ident(VALUE) ident(offset)operator(;) - pre_type(int) ident(sign)operator(;) -operator({) - pre_type(double) ident(v) operator(=) ident(NUM2DBL)operator(()ident(offset)operator(\);) - pre_type(double) ident(f)operator(,) ident(d)operator(;) - ident(unsigned_time_t) ident(sec_off)operator(;) - ident(time_t) ident(usec_off)operator(,) ident(sec)operator(,) ident(usec)operator(;) - ident(VALUE) ident(result)operator(;) - - reserved(if) operator(()ident(v) operator(<) integer(0)operator(\)) operator({) - ident(v) operator(=) operator(-)ident(v)operator(;) - ident(sign) operator(=) operator(-)ident(sign)operator(;) - operator(}) - ident(d) operator(=) ident(modf)operator(()ident(v)operator(,) operator(&)ident(f)operator(\);) - ident(sec_off) operator(=) operator(()ident(unsigned_time_t)operator(\))ident(f)operator(;) - reserved(if) operator(()ident(f) operator(!=) operator(()pre_type(double)operator(\))ident(sec_off)operator(\)) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) - ident(sign) operator(<) integer(0) operator(?) string operator(:) stringoperator(,) ident(v)operator(\);) - ident(usec_off) operator(=) operator(()ident(time_t)operator(\)()ident(d)operator(*)float(1)ident(e6)operator(+)float(0)float(.5)operator(\);) - - reserved(if) operator(()ident(sign) operator(<) integer(0)operator(\)) operator({) - ident(sec) operator(=) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec) operator(-) ident(sec_off)operator(;) - ident(usec) operator(=) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec) operator(-) ident(usec_off)operator(;) - reserved(if) operator(()ident(sec) operator(>) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec)operator(\)) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(v)operator(\);) - operator(}) - reserved(else) operator({) - ident(sec) operator(=) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec) operator(+) ident(sec_off)operator(;) - ident(usec) operator(=) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec) operator(+) ident(usec_off)operator(;) - reserved(if) operator(()ident(sec) operator(<) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec)operator(\)) - ident(rb_raise)operator(()ident(rb_eRangeError)operator(,) stringoperator(,) ident(v)operator(\);) - operator(}) - ident(result) operator(=) ident(rb_time_new)operator(()ident(sec)operator(,) ident(usec)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(gmt)operator(\)) operator({) - ident(GetTimeval)operator(()ident(result)operator(,) ident(tobj)operator(\);) - ident(tobj)operator(->)ident(gmt) operator(=) integer(1)operator(;) - operator(}) - reserved(return) ident(result)operator(;) -operator(}) - -comment(/* - * call-seq: - * time + numeric => time - * - * Addition---Adds some number of seconds (possibly fractional\) to - * time and returns that value as a new time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t + (60 * 60 * 24\) #=> Thu Apr 10 08:56:03 CDT 2003 - */) - -directive(static) ident(VALUE) -ident(time_plus)operator(()ident(time1)operator(,) ident(time2)operator(\)) - ident(VALUE) ident(time1)operator(,) ident(time2)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - ident(GetTimeval)operator(()ident(time1)operator(,) ident(tobj)operator(\);) - - reserved(if) operator(()ident(TYPE)operator(()ident(time2)operator(\)) operator(==) ident(T_DATA) operator(&&) ident(RDATA)operator(()ident(time2)operator(\)->)ident(dfree) operator(==) ident(time_free)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - reserved(return) ident(time_add)operator(()ident(tobj)operator(,) ident(time2)operator(,) integer(1)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time - other_time => float - * time - numeric => time - * - * Difference---Returns a new time that represents the difference - * between two times, or subtracts the given number of seconds in - * numeric from time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t2 = t + 2592000 #=> Fri May 09 08:56:03 CDT 2003 - * t2 - t #=> 2592000.0 - * t2 - 2592000 #=> Wed Apr 09 08:56:03 CDT 2003 - */) - -directive(static) ident(VALUE) -ident(time_minus)operator(()ident(time1)operator(,) ident(time2)operator(\)) - ident(VALUE) ident(time1)operator(,) ident(time2)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time1)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(TYPE)operator(()ident(time2)operator(\)) operator(==) ident(T_DATA) operator(&&) ident(RDATA)operator(()ident(time2)operator(\)->)ident(dfree) operator(==) ident(time_free)operator(\)) operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj2)operator(;) - pre_type(double) ident(f)operator(;) - - ident(GetTimeval)operator(()ident(time2)operator(,) ident(tobj2)operator(\);) - ident(f) operator(=) operator(()pre_type(double)operator(\))ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec) operator(-) operator(()pre_type(double)operator(\))ident(tobj2)operator(->)ident(tv)operator(.)ident(tv_sec)operator(;) - ident(f) operator(+=) operator((()pre_type(double)operator(\))ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec) operator(-) operator(()pre_type(double)operator(\))ident(tobj2)operator(->)ident(tv)operator(.)ident(tv_usec)operator(\)*)float(1)ident(e)operator(-)integer(6)operator(;) - comment(/* XXX: should check float overflow on 64bit time_t platforms */) - - reserved(return) ident(rb_float_new)operator(()ident(f)operator(\);) - operator(}) - reserved(return) ident(time_add)operator(()ident(tobj)operator(,) ident(time2)operator(,) operator(-)integer(1)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.succ => new_time - * - * Return a new time object, one second later than time. - */) - -directive(static) ident(VALUE) -ident(time_succ)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - pre_type(int) ident(gmt)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - ident(gmt) operator(=) ident(tobj)operator(->)ident(gmt)operator(;) - ident(time) operator(=) ident(rb_time_new)operator(()ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec) operator(+) integer(1)operator(,) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec)operator(\);) - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - ident(tobj)operator(->)ident(gmt) operator(=) ident(gmt)operator(;) - reserved(return) ident(time)operator(;) -operator(}) - -comment(/* - * call-seq: - * time.sec => fixnum - * - * Returns the second of the minute (0..60\)[Yes, seconds really can - * range from zero to 60. This allows the system to inject leap seconds - * every now and then to correct for the fact that years are not really - * a convenient number of hours long.] for time. - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.sec #=> 4 - */) - -directive(static) ident(VALUE) -ident(time_sec)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_sec)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.min => fixnum - * - * Returns the minute of the hour (0..59\) for time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.min #=> 56 - */) - -directive(static) ident(VALUE) -ident(time_min)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_min)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.hour => fixnum - * - * Returns the hour of the day (0..23\) for time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.hour #=> 8 - */) - -directive(static) ident(VALUE) -ident(time_hour)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_hour)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.day => fixnum - * time.mday => fixnum - * - * Returns the day of the month (1..n\) for time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.day #=> 9 - * t.mday #=> 9 - */) - -directive(static) ident(VALUE) -ident(time_mday)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_mday)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.mon => fixnum - * time.month => fixnum - * - * Returns the month of the year (1..12\) for time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.mon #=> 4 - * t.month #=> 4 - */) - -directive(static) ident(VALUE) -ident(time_mon)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_mon)operator(+)integer(1)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.year => fixnum - * - * Returns the year for time (including the century\). - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.year #=> 2003 - */) - -directive(static) ident(VALUE) -ident(time_year)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - reserved(return) ident(LONG2NUM)operator((()pre_type(long)operator(\))ident(tobj)operator(->)ident(tm)operator(.)ident(tm_year)operator(+)integer(1900)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.wday => fixnum - * - * Returns an integer representing the day of the week, 0..6, with - * Sunday == 0. - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.wday #=> 3 - */) - -directive(static) ident(VALUE) -ident(time_wday)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_wday)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.yday => fixnum - * - * Returns an integer representing the day of the year, 1..366. - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.yday #=> 99 - */) - -directive(static) ident(VALUE) -ident(time_yday)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - reserved(return) ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_yday)operator(+)integer(1)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time.isdst => true or false - * time.dst? => true or false - * - * Returns true if time occurs during Daylight - * Saving Time in its time zone. - * - * Time.local(2000, 7, 1\).isdst #=> true - * Time.local(2000, 1, 1\).isdst #=> false - * Time.local(2000, 7, 1\).dst? #=> true - * Time.local(2000, 1, 1\).dst? #=> false - */) - -directive(static) ident(VALUE) -ident(time_isdst)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - reserved(return) ident(tobj)operator(->)ident(tm)operator(.)ident(tm_isdst)operator(?)ident(Qtrue)operator(:)ident(Qfalse)operator(;) -operator(}) - -comment(/* - * call-seq: - * time.zone => string - * - * Returns the name of the time zone used for time. As of Ruby - * 1.8, returns ``UTC'' rather than ``GMT'' for UTC times. - * - * t = Time.gm(2000, "jan", 1, 20, 15, 1\) - * t.zone #=> "UTC" - * t = Time.local(2000, "jan", 1, 20, 15, 1\) - * t.zone #=> "CST" - */) - -directive(static) ident(VALUE) -ident(time_zone)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) -preprocessor(#if) operator(!)ident(defined)operator(()ident(HAVE_TM_ZONE)operator(\)) operator(&&) operator((!)ident(defined)operator(()ident(HAVE_TZNAME)operator(\)) operator(||) operator(!)ident(defined)operator(()ident(HAVE_DAYLIGHT)operator(\)\)) - pre_type(char) ident(buf)operator([)integer(64)operator(];) - pre_type(int) ident(len)operator(;) -preprocessor(#endif) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - - reserved(if) operator(()ident(tobj)operator(->)ident(gmt) operator(==) integer(1)operator(\)) operator({) - reserved(return) ident(rb_str_new2)operator(()stringoperator(\);) - operator(}) -preprocessor(#if) ident(defined)operator(()ident(HAVE_TM_ZONE)operator(\)) - reserved(return) ident(rb_str_new2)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_zone)operator(\);) -preprocessor(#elif) ident(defined)operator(()ident(HAVE_TZNAME)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_DAYLIGHT)operator(\)) - reserved(return) ident(rb_str_new2)operator(()ident(tzname)operator([)ident(daylight) operator(&&) ident(tobj)operator(->)ident(tm)operator(.)ident(tm_isdst)operator(]\);) -preprocessor(#else) - ident(len) operator(=) ident(strftime)operator(()ident(buf)operator(,) integer(64)operator(,) stringoperator(,) operator(&)ident(tobj)operator(->)ident(tm)operator(\);) - reserved(return) ident(rb_str_new)operator(()ident(buf)operator(,) ident(len)operator(\);) -preprocessor(#endif) -operator(}) - -comment(/* - * call-seq: - * time.gmt_offset => fixnum - * time.gmtoff => fixnum - * time.utc_offset => fixnum - * - * Returns the offset in seconds between the timezone of time - * and UTC. - * - * t = Time.gm(2000,1,1,20,15,1\) #=> Sat Jan 01 20:15:01 UTC 2000 - * t.gmt_offset #=> 0 - * l = t.getlocal #=> Sat Jan 01 14:15:01 CST 2000 - * l.gmt_offset #=> -21600 - */) - -directive(static) ident(VALUE) -ident(time_utc_offset)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - - reserved(if) operator(()ident(tobj)operator(->)ident(gmt) operator(==) integer(1)operator(\)) operator({) - reserved(return) ident(INT2FIX)operator(()integer(0)operator(\);) - operator(}) - reserved(else) operator({) -preprocessor(#if) ident(defined)operator(()ident(HAVE_STRUCT_TM_TM_GMTOFF)operator(\)) - reserved(return) ident(INT2NUM)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_gmtoff)operator(\);) -preprocessor(#else) - reserved(struct) ident(tm) operator(*)ident(u)operator(,) operator(*)ident(l)operator(;) - ident(time_t) ident(t)operator(;) - pre_type(long) ident(off)operator(;) - ident(l) operator(=) operator(&)ident(tobj)operator(->)ident(tm)operator(;) - ident(t) operator(=) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec)operator(;) - ident(u) operator(=) ident(gmtime)operator((&)ident(t)operator(\);) - reserved(if) operator((!)ident(u)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(l)operator(->)ident(tm_year) operator(!=) ident(u)operator(->)ident(tm_year)operator(\)) - ident(off) operator(=) ident(l)operator(->)ident(tm_year) operator(<) ident(u)operator(->)ident(tm_year) operator(?) operator(-)integer(1) operator(:) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(l)operator(->)ident(tm_mon) operator(!=) ident(u)operator(->)ident(tm_mon)operator(\)) - ident(off) operator(=) ident(l)operator(->)ident(tm_mon) operator(<) ident(u)operator(->)ident(tm_mon) operator(?) operator(-)integer(1) operator(:) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(l)operator(->)ident(tm_mday) operator(!=) ident(u)operator(->)ident(tm_mday)operator(\)) - ident(off) operator(=) ident(l)operator(->)ident(tm_mday) operator(<) ident(u)operator(->)ident(tm_mday) operator(?) operator(-)integer(1) operator(:) integer(1)operator(;) - reserved(else) - ident(off) operator(=) integer(0)operator(;) - ident(off) operator(=) ident(off) operator(*) integer(24) operator(+) ident(l)operator(->)ident(tm_hour) operator(-) ident(u)operator(->)ident(tm_hour)operator(;) - ident(off) operator(=) ident(off) operator(*) integer(60) operator(+) ident(l)operator(->)ident(tm_min) operator(-) ident(u)operator(->)ident(tm_min)operator(;) - ident(off) operator(=) ident(off) operator(*) integer(60) operator(+) ident(l)operator(->)ident(tm_sec) operator(-) ident(u)operator(->)ident(tm_sec)operator(;) - reserved(return) ident(LONG2FIX)operator(()ident(off)operator(\);) -preprocessor(#endif) - operator(}) -operator(}) - -comment(/* - * call-seq: - * time.to_a => array - * - * Returns a ten-element array of values for time: - * {[ sec, min, hour, day, month, year, wday, yday, isdst, zone - * ]}. See the individual methods for an explanation of the - * valid ranges of each value. The ten elements can be passed directly - * to Time::utc or Time::local to create a - * new Time. - * - * now = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t = now.to_a #=> [4, 56, 8, 9, 4, 2003, 3, 99, true, "CDT"] - */) - -directive(static) ident(VALUE) -ident(time_to_a)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - reserved(return) ident(rb_ary_new3)operator(()integer(10)operator(,) - ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_sec)operator(\),) - ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_min)operator(\),) - ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_hour)operator(\),) - ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_mday)operator(\),) - ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_mon)operator(+)integer(1)operator(\),) - ident(LONG2NUM)operator((()pre_type(long)operator(\))ident(tobj)operator(->)ident(tm)operator(.)ident(tm_year)operator(+)integer(1900)operator(\),) - ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_wday)operator(\),) - ident(INT2FIX)operator(()ident(tobj)operator(->)ident(tm)operator(.)ident(tm_yday)operator(+)integer(1)operator(\),) - ident(tobj)operator(->)ident(tm)operator(.)ident(tm_isdst)operator(?)ident(Qtrue)operator(:)ident(Qfalse)operator(,) - ident(time_zone)operator(()ident(time)operator(\)\);) -operator(}) - -preprocessor(#define) ident(SMALLBUF) integer(100) -directive(static) pre_type(int) -ident(rb_strftime)operator(()ident(buf)operator(,) ident(format)operator(,) ident(time)operator(\)) - pre_type(char) operator(**)ident(buf)operator(;) - directive(const) pre_type(char) operator(*)ident(format)operator(;) - reserved(struct) ident(tm) operator(*)ident(time)operator(;) -operator({) - pre_type(int) ident(size)operator(,) ident(len)operator(,) ident(flen)operator(;) - - operator((*)ident(buf)operator(\)[)integer(0)operator(]) operator(=) char('\\0')operator(;) - ident(flen) operator(=) ident(strlen)operator(()ident(format)operator(\);) - reserved(if) operator(()ident(flen) operator(==) integer(0)operator(\)) operator({) - reserved(return) integer(0)operator(;) - operator(}) - ident(errno) operator(=) integer(0)operator(;) - ident(len) operator(=) ident(strftime)operator((*)ident(buf)operator(,) ident(SMALLBUF)operator(,) ident(format)operator(,) ident(time)operator(\);) - reserved(if) operator(()ident(len) operator(!=) integer(0) operator(||) operator((**)ident(buf) operator(==) char('\\0') operator(&&) ident(errno) operator(!=) ident(ERANGE)operator(\)\)) reserved(return) ident(len)operator(;) - reserved(for) operator(()ident(size)operator(=)integer(1024)operator(;) operator(;) ident(size)operator(*=)integer(2)operator(\)) operator({) - operator(*)ident(buf) operator(=) ident(xmalloc)operator(()ident(size)operator(\);) - operator((*)ident(buf)operator(\)[)integer(0)operator(]) operator(=) char('\\0')operator(;) - ident(len) operator(=) ident(strftime)operator((*)ident(buf)operator(,) ident(size)operator(,) ident(format)operator(,) ident(time)operator(\);) - comment(/* - * buflen can be zero EITHER because there's not enough - * room in the string, or because the control command - * goes to the empty string. Make a reasonable guess that - * if the buffer is 1024 times bigger than the length of the - * format string, it's not failing for lack of room. - */) - reserved(if) operator(()ident(len) operator(>) integer(0) operator(||) ident(size) operator(>=) integer(1024) operator(*) ident(flen)operator(\)) reserved(return) ident(len)operator(;) - ident(free)operator((*)ident(buf)operator(\);) - operator(}) - comment(/* not reached */) -operator(}) - -comment(/* - * call-seq: - * time.strftime( string \) => string - * - * Formats time according to the directives in the given format - * string. Any text not listed as a directive will be passed through - * to the output string. - * - * Format meaning: - * %a - The abbreviated weekday name (``Sun''\) - * %A - The full weekday name (``Sunday''\) - * %b - The abbreviated month name (``Jan''\) - * %B - The full month name (``January''\) - * %c - The preferred local date and time representation - * %d - Day of the month (01..31\) - * %H - Hour of the day, 24-hour clock (00..23\) - * %I - Hour of the day, 12-hour clock (01..12\) - * %j - Day of the year (001..366\) - * %m - Month of the year (01..12\) - * %M - Minute of the hour (00..59\) - * %p - Meridian indicator (``AM'' or ``PM''\) - * %S - Second of the minute (00..60\) - * %U - Week number of the current year, - * starting with the first Sunday as the first - * day of the first week (00..53\) - * %W - Week number of the current year, - * starting with the first Monday as the first - * day of the first week (00..53\) - * %w - Day of the week (Sunday is 0, 0..6\) - * %x - Preferred representation for the date alone, no time - * %X - Preferred representation for the time alone, no date - * %y - Year without a century (00..99\) - * %Y - Year with century - * %Z - Time zone name - * %% - Literal ``%'' character - * - * t = Time.now - * t.strftime("Printed on %m/%d/%Y"\) #=> "Printed on 04/09/2003" - * t.strftime("at %I:%M%p"\) #=> "at 08:56AM" - */) - -directive(static) ident(VALUE) -ident(time_strftime)operator(()ident(time)operator(,) ident(format)operator(\)) - ident(VALUE) ident(time)operator(,) ident(format)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - pre_type(char) ident(buffer)operator([)ident(SMALLBUF)operator(],) operator(*)ident(buf) operator(=) ident(buffer)operator(;) - directive(const) pre_type(char) operator(*)ident(fmt)operator(;) - pre_type(long) ident(len)operator(;) - ident(VALUE) ident(str)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - reserved(if) operator(()ident(tobj)operator(->)ident(tm_got) operator(==) integer(0)operator(\)) operator({) - ident(time_get_tm)operator(()ident(time)operator(,) ident(tobj)operator(->)ident(gmt)operator(\);) - operator(}) - ident(StringValue)operator(()ident(format)operator(\);) - ident(format) operator(=) ident(rb_str_new4)operator(()ident(format)operator(\);) - ident(fmt) operator(=) ident(RSTRING)operator(()ident(format)operator(\)->)ident(ptr)operator(;) - ident(len) operator(=) ident(RSTRING)operator(()ident(format)operator(\)->)ident(len)operator(;) - reserved(if) operator(()ident(len) operator(==) integer(0)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(strlen)operator(()ident(fmt)operator(\)) operator(<) ident(len)operator(\)) operator({) - comment(/* Ruby string may contain \\0's. */) - directive(const) pre_type(char) operator(*)ident(p) operator(=) ident(fmt)operator(,) operator(*)ident(pe) operator(=) ident(fmt) operator(+) ident(len)operator(;) - - ident(str) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) integer(0)operator(\);) - reserved(while) operator(()ident(p) operator(<) ident(pe)operator(\)) operator({) - ident(len) operator(=) ident(rb_strftime)operator((&)ident(buf)operator(,) ident(p)operator(,) operator(&)ident(tobj)operator(->)ident(tm)operator(\);) - ident(rb_str_cat)operator(()ident(str)operator(,) ident(buf)operator(,) ident(len)operator(\);) - ident(p) operator(+=) ident(strlen)operator(()ident(p)operator(\);) - reserved(if) operator(()ident(buf) operator(!=) ident(buffer)operator(\)) operator({) - ident(free)operator(()ident(buf)operator(\);) - ident(buf) operator(=) ident(buffer)operator(;) - operator(}) - reserved(for) operator(()ident(fmt) operator(=) ident(p)operator(;) ident(p) operator(<) ident(pe) operator(&&) operator(!*)ident(p)operator(;) operator(++)ident(p)operator(\);) - reserved(if) operator(()ident(p) operator(>) ident(fmt)operator(\)) ident(rb_str_cat)operator(()ident(str)operator(,) ident(fmt)operator(,) ident(p) operator(-) ident(fmt)operator(\);) - operator(}) - reserved(return) ident(str)operator(;) - operator(}) - reserved(else) operator({) - ident(len) operator(=) ident(rb_strftime)operator((&)ident(buf)operator(,) ident(RSTRING)operator(()ident(format)operator(\)->)ident(ptr)operator(,) operator(&)ident(tobj)operator(->)ident(tm)operator(\);) - operator(}) - ident(str) operator(=) ident(rb_str_new)operator(()ident(buf)operator(,) ident(len)operator(\);) - reserved(if) operator(()ident(buf) operator(!=) ident(buffer)operator(\)) ident(free)operator(()ident(buf)operator(\);) - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * call-seq: - * Time.times => struct_tms - * - * Deprecated in favor of Process::times - */) - -directive(static) ident(VALUE) -ident(time_s_times)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(rb_warn)operator(()stringoperator(\);) - reserved(return) ident(rb_proc_times)operator(()ident(obj)operator(\);) -operator(}) - -comment(/* - * undocumented - */) - -directive(static) ident(VALUE) -ident(time_mdump)operator(()ident(time)operator(\)) - ident(VALUE) ident(time)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - reserved(struct) ident(tm) operator(*)ident(tm)operator(;) - pre_type(unsigned) pre_type(long) ident(p)operator(,) ident(s)operator(;) - pre_type(char) ident(buf)operator([)integer(8)operator(];) - ident(time_t) ident(t)operator(;) - pre_type(int) ident(i)operator(;) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - - ident(t) operator(=) ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec)operator(;) - ident(tm) operator(=) ident(gmtime)operator((&)ident(t)operator(\);) - - reserved(if) operator((()ident(tm)operator(->)ident(tm_year) operator(&) hex(0xffff)operator(\)) operator(!=) ident(tm)operator(->)ident(tm_year)operator(\)) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - - ident(p) operator(=) hex(0x1)ident(UL) operator(<<) integer(31) operator(|) comment(/* 1 */) - ident(tobj)operator(->)ident(gmt) operator(<<) integer(30) operator(|) comment(/* 1 */) - ident(tm)operator(->)ident(tm_year) operator(<<) integer(14) operator(|) comment(/* 16 */) - ident(tm)operator(->)ident(tm_mon) operator(<<) integer(10) operator(|) comment(/* 4 */) - ident(tm)operator(->)ident(tm_mday) operator(<<) integer(5) operator(|) comment(/* 5 */) - ident(tm)operator(->)ident(tm_hour)operator(;) comment(/* 5 */) - ident(s) operator(=) ident(tm)operator(->)ident(tm_min) operator(<<) integer(26) operator(|) comment(/* 6 */) - ident(tm)operator(->)ident(tm_sec) operator(<<) integer(20) operator(|) comment(/* 6 */) - ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec)operator(;) comment(/* 20 */) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)integer(4)operator(;) ident(i)operator(++\)) operator({) - ident(buf)operator([)ident(i)operator(]) operator(=) ident(p) operator(&) hex(0xff)operator(;) - ident(p) operator(=) ident(RSHIFT)operator(()ident(p)operator(,) integer(8)operator(\);) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(4)operator(;) ident(i)operator(<)integer(8)operator(;) ident(i)operator(++\)) operator({) - ident(buf)operator([)ident(i)operator(]) operator(=) ident(s) operator(&) hex(0xff)operator(;) - ident(s) operator(=) ident(RSHIFT)operator(()ident(s)operator(,) integer(8)operator(\);) - operator(}) - - reserved(return) ident(rb_str_new)operator(()ident(buf)operator(,) integer(8)operator(\);) -operator(}) - -comment(/* - * call-seq: - * time._dump => string - * - * Dump _time_ for marshaling. - */) - -directive(static) ident(VALUE) -ident(time_dump)operator(()ident(argc)operator(,) ident(argv)operator(,) ident(time)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) - ident(VALUE) ident(time)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) integer(0)operator(\);) - ident(str) operator(=) ident(time_mdump)operator(()ident(time)operator(\);) - reserved(if) operator(()ident(FL_TEST)operator(()ident(time)operator(,) ident(FL_EXIVAR)operator(\)\)) operator({) - ident(rb_copy_generic_ivar)operator(()ident(str)operator(,) ident(time)operator(\);) - ident(FL_SET)operator(()ident(str)operator(,) ident(FL_EXIVAR)operator(\);) - operator(}) - - reserved(return) ident(str)operator(;) -operator(}) - -comment(/* - * undocumented - */) - -directive(static) ident(VALUE) -ident(time_mload)operator(()ident(time)operator(,) ident(str)operator(\)) - ident(VALUE) ident(time)operator(,) ident(str)operator(;) -operator({) - reserved(struct) ident(time_object) operator(*)ident(tobj)operator(;) - pre_type(unsigned) pre_type(long) ident(p)operator(,) ident(s)operator(;) - ident(time_t) ident(sec)operator(,) ident(usec)operator(;) - pre_type(unsigned) pre_type(char) operator(*)ident(buf)operator(;) - reserved(struct) ident(tm) ident(tm)operator(;) - pre_type(int) ident(i)operator(,) ident(gmt)operator(;) - - ident(time_modify)operator(()ident(time)operator(\);) - ident(StringValue)operator(()ident(str)operator(\);) - ident(buf) operator(=) operator(()pre_type(unsigned) pre_type(char) operator(*\))ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(!=) integer(8)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(\);) - operator(}) - - ident(p) operator(=) ident(s) operator(=) integer(0)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)integer(4)operator(;) ident(i)operator(++\)) operator({) - ident(p) operator(|=) ident(buf)operator([)ident(i)operator(]<<()integer(8)operator(*)ident(i)operator(\);) - operator(}) - reserved(for) operator(()ident(i)operator(=)integer(4)operator(;) ident(i)operator(<)integer(8)operator(;) ident(i)operator(++\)) operator({) - ident(s) operator(|=) ident(buf)operator([)ident(i)operator(]<<()integer(8)operator(*()ident(i)operator(-)integer(4)operator(\)\);) - operator(}) - - reserved(if) operator((()ident(p) operator(&) operator(()integer(1)ident(UL)operator(<<)integer(31)operator(\)\)) operator(==) integer(0)operator(\)) operator({) - ident(sec) operator(=) ident(p)operator(;) - ident(usec) operator(=) ident(s)operator(;) - operator(}) - reserved(else) operator({) - ident(p) operator(&=) operator(~()integer(1)ident(UL)operator(<<)integer(31)operator(\);) - ident(gmt) operator(=) operator(()ident(p) operator(>>) integer(30)operator(\)) operator(&) hex(0x1)operator(;) - ident(tm)operator(.)ident(tm_year) operator(=) operator(()ident(p) operator(>>) integer(14)operator(\)) operator(&) hex(0xffff)operator(;) - ident(tm)operator(.)ident(tm_mon) operator(=) operator(()ident(p) operator(>>) integer(10)operator(\)) operator(&) hex(0xf)operator(;) - ident(tm)operator(.)ident(tm_mday) operator(=) operator(()ident(p) operator(>>) integer(5)operator(\)) operator(&) hex(0x1f)operator(;) - ident(tm)operator(.)ident(tm_hour) operator(=) ident(p) operator(&) hex(0x1f)operator(;) - ident(tm)operator(.)ident(tm_min) operator(=) operator(()ident(s) operator(>>) integer(26)operator(\)) operator(&) hex(0x3f)operator(;) - ident(tm)operator(.)ident(tm_sec) operator(=) operator(()ident(s) operator(>>) integer(20)operator(\)) operator(&) hex(0x3f)operator(;) - ident(tm)operator(.)ident(tm_isdst) operator(=) integer(0)operator(;) - - ident(sec) operator(=) ident(make_time_t)operator((&)ident(tm)operator(,) ident(Qtrue)operator(\);) - ident(usec) operator(=) operator(()ident(time_t)operator(\)()ident(s) operator(&) hex(0xfffff)operator(\);) - operator(}) - ident(time_overflow_p)operator((&)ident(sec)operator(,) operator(&)ident(usec)operator(\);) - - ident(GetTimeval)operator(()ident(time)operator(,) ident(tobj)operator(\);) - ident(tobj)operator(->)ident(tm_got) operator(=) integer(0)operator(;) - ident(tobj)operator(->)ident(gmt) operator(=) ident(gmt)operator(;) - ident(tobj)operator(->)ident(tv)operator(.)ident(tv_sec) operator(=) ident(sec)operator(;) - ident(tobj)operator(->)ident(tv)operator(.)ident(tv_usec) operator(=) ident(usec)operator(;) - reserved(return) ident(time)operator(;) -operator(}) - -comment(/* - * call-seq: - * Time._load(string\) => time - * - * Unmarshal a dumped +Time+ object. - */) - -directive(static) ident(VALUE) -ident(time_load)operator(()ident(klass)operator(,) ident(str)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(str)operator(;) -operator({) - ident(VALUE) ident(time) operator(=) ident(time_s_alloc)operator(()ident(klass)operator(\);) - - reserved(if) operator(()ident(FL_TEST)operator(()ident(str)operator(,) ident(FL_EXIVAR)operator(\)\)) operator({) - ident(rb_copy_generic_ivar)operator(()ident(time)operator(,) ident(str)operator(\);) - ident(FL_SET)operator(()ident(time)operator(,) ident(FL_EXIVAR)operator(\);) - operator(}) - ident(time_mload)operator(()ident(time)operator(,) ident(str)operator(\);) - reserved(return) ident(time)operator(;) -operator(}) - -comment(/* - * Time is an abstraction of dates and times. Time is - * stored internally as the number of seconds and microseconds since - * the epoch, January 1, 1970 00:00 UTC. On some operating - * systems, this offset is allowed to be negative. Also see the - * library modules Date and ParseDate. The - * Time class treats GMT (Greenwich Mean Time\) and UTC - * (Coordinated Universal Time\)[Yes, UTC really does stand for - * Coordinated Universal Time. There was a committee involved.] - * as equivalent. GMT is the older way of referring to these - * baseline times but persists in the names of calls on Posix - * systems. - * - * All times are stored with some number of microseconds. Be aware of - * this fact when comparing times with each other---times that are - * apparently equal when displayed may be different when compared. - */) - -directive(void) -ident(Init_Time)operator((\)) -operator({) - ident(rb_cTime) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_cObject)operator(\);) - ident(rb_include_module)operator(()ident(rb_cTime)operator(,) ident(rb_mComparable)operator(\);) - - ident(rb_define_alloc_func)operator(()ident(rb_cTime)operator(,) ident(time_s_alloc)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(rb_class_new_instance)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_s_at)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_s_mkutc)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_s_mkutc)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_s_mktime)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_s_mktime)operator(,) operator(-)integer(1)operator(\);) - - ident(rb_define_singleton_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_s_times)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_to_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_to_f)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) string)delimiter(")>operator(,) ident(time_cmp)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_eql)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_hash)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_init)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_init_copy)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_localtime)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_gmtime)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_gmtime)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_getlocaltime)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_getgmtime)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_getgmtime)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_asctime)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_asctime)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_to_s)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_to_a)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_plus)operator(,) integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_minus)operator(,) integer(1)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_succ)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_sec)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_min)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_hour)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_mday)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_mday)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_mon)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_mon)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_year)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_wday)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_yday)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_isdst)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_isdst)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_zone)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_utc_offset)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_utc_offset)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_utc_offset)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_utc_p)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_utc_p)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_to_i)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_usec)operator(,) integer(0)operator(\);) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_usec)operator(,) integer(0)operator(\);) - - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_strftime)operator(,) integer(1)operator(\);) - - comment(/* methods for marshaling */) - ident(rb_define_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_dump)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_singleton_method)operator(()ident(rb_cTime)operator(,) stringoperator(,) ident(time_load)operator(,) integer(1)operator(\);) -comment(#if 0 - /* Time will support marshal_dump and marshal_load in the future (1.9 maybe\) */ - rb_define_method(rb_cTime, "marshal_dump", time_mdump, 0\); - rb_define_method(rb_cTime, "marshal_load", time_mload, 1\); -#endif) -operator(}) -comment(/********************************************************************** - - util.c - - - $Author: wyhaines $ - $Date: 2009-08-19 15:53:23 +0200 (Wed, 19 Aug 2009\) $ - created at: Fri Mar 10 17:22:34 JST 1995 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") - -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#ifdef) ident(_WIN32) -preprocessor(#include) include("missing/file.h") -preprocessor(#endif) - -preprocessor(#include) include("util.h") -preprocessor(#ifndef) ident(HAVE_STRING_H) -pre_type(char) operator(*)ident(strchr) ident(_)operator((()pre_type(char)operator(*,)pre_type(char)operator(\)\);) -preprocessor(#endif) - -pre_type(unsigned) pre_type(long) -ident(scan_oct)operator(()ident(start)operator(,) ident(len)operator(,) ident(retlen)operator(\)) - directive(const) pre_type(char) operator(*)ident(start)operator(;) - pre_type(int) ident(len)operator(;) - pre_type(int) operator(*)ident(retlen)operator(;) -operator({) - directive(register) directive(const) pre_type(char) operator(*)ident(s) operator(=) ident(start)operator(;) - directive(register) pre_type(unsigned) pre_type(long) ident(retval) operator(=) integer(0)operator(;) - - reserved(while) operator(()ident(len)operator(--) operator(&&) operator(*)ident(s) operator(>=) char('0') operator(&&) operator(*)ident(s) operator(<=) char('7')operator(\)) operator({) - ident(retval) operator(<<=) integer(3)operator(;) - ident(retval) operator(|=) operator(*)ident(s)operator(++) operator(-) char('0')operator(;) - operator(}) - operator(*)ident(retlen) operator(=) ident(s) operator(-) ident(start)operator(;) - reserved(return) ident(retval)operator(;) -operator(}) - -pre_type(unsigned) pre_type(long) -ident(scan_hex)operator(()ident(start)operator(,) ident(len)operator(,) ident(retlen)operator(\)) - directive(const) pre_type(char) operator(*)ident(start)operator(;) - pre_type(int) ident(len)operator(;) - pre_type(int) operator(*)ident(retlen)operator(;) -operator({) - directive(static) pre_type(char) ident(hexdigit)operator([]) operator(=) stringoperator(;) - directive(register) directive(const) pre_type(char) operator(*)ident(s) operator(=) ident(start)operator(;) - directive(register) pre_type(unsigned) pre_type(long) ident(retval) operator(=) integer(0)operator(;) - pre_type(char) operator(*)ident(tmp)operator(;) - - reserved(while) operator(()ident(len)operator(--) operator(&&) operator(*)ident(s) operator(&&) operator(()ident(tmp) operator(=) ident(strchr)operator(()ident(hexdigit)operator(,) operator(*)ident(s)operator(\)\)\)) operator({) - ident(retval) operator(<<=) integer(4)operator(;) - ident(retval) operator(|=) operator(()ident(tmp) operator(-) ident(hexdigit)operator(\)) operator(&) integer(15)operator(;) - ident(s)operator(++;) - operator(}) - operator(*)ident(retlen) operator(=) ident(s) operator(-) ident(start)operator(;) - reserved(return) ident(retval)operator(;) -operator(}) - -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#ifdef) ident(HAVE_UNISTD_H) -preprocessor(#include) include() -preprocessor(#endif) -preprocessor(#if) ident(defined)operator(()ident(HAVE_FCNTL_H)operator(\)) -preprocessor(#include) include() -preprocessor(#endif) - -preprocessor(#ifndef) ident(S_ISDIR) -preprocessor(# define) ident(S_ISDIR)operator(()ident(m)operator(\)) operator((()ident(m) operator(&) ident(S_IFMT)operator(\)) operator(==) ident(S_IFDIR)operator(\)) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(MSDOS)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN32__)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) -comment(/* - * Copyright (c\) 1993, Intergraph Corporation - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the perl README file. - * - * Various Unix compatibility functions and NT specific functions. - * - * Some of this code was derived from the MSDOS port(s\) and the OS/2 port. - * - */) - - -comment(/* - * Suffix appending for in-place editing under MS-DOS and OS/2 (and now NT!\). - * - * Here are the rules: - * - * Style 0: Append the suffix exactly as standard perl would do it. - * If the filesystem groks it, use it. (HPFS will always - * grok it. So will NTFS. FAT will rarely accept it.\) - * - * Style 1: The suffix begins with a '.'. The extension is replaced. - * If the name matches the original name, use the fallback method. - * - * Style 2: The suffix is a single character, not a '.'. Try to add the - * suffix to the following places, using the first one that works. - * [1] Append to extension. - * [2] Append to filename, - * [3] Replace end of extension, - * [4] Replace end of filename. - * If the name matches the original name, use the fallback method. - * - * Style 3: Any other case: Ignore the suffix completely and use the - * fallback method. - * - * Fallback method: Change the extension to ".$$$". If that matches the - * original name, then change the extension to ".~~~". - * - * If filename is more than 1000 characters long, we die a horrible - * death. Sorry. - * - * The filename restriction is a cheat so that we can use buf[] to store - * assorted temporary goo. - * - * Examples, assuming style 0 failed. - * - * suffix = ".bak" (style 1\) - * foo.bar => foo.bak - * foo.bak => foo.$$$ (fallback\) - * foo.$$$ => foo.~~~ (fallback\) - * makefile => makefile.bak - * - * suffix = "~" (style 2\) - * foo.c => foo.c~ - * foo.c~ => foo.c~~ - * foo.c~~ => foo~.c~~ - * foo~.c~~ => foo~~.c~~ - * foo~~~~~.c~~ => foo~~~~~.$$$ (fallback\) - * - * foo.pas => foo~.pas - * makefile => makefile.~ - * longname.fil => longname.fi~ - * longname.fi~ => longnam~.fi~ - * longnam~.fi~ => longnam~.$$$ - * - */) - - -directive(static) pre_type(int) ident(valid_filename)operator(()pre_type(char) operator(*)ident(s)operator(\);) - -directive(static) pre_type(char) ident(suffix1)operator([]) operator(=) stringoperator(;) -directive(static) pre_type(char) ident(suffix2)operator([]) operator(=) stringoperator(;) - -preprocessor(#define) ident(ext) operator((&)ident(buf)operator([)integer(1000)operator(]\)) - -preprocessor(#define) ident(strEQ)operator(()ident(s1)operator(,)ident(s2)operator(\)) operator(()ident(strcmp)operator(()ident(s1)operator(,)ident(s2)operator(\)) operator(==) integer(0)operator(\)) - -directive(void) -ident(ruby_add_suffix)operator(()ident(str)operator(,) ident(suffix)operator(\)) - ident(VALUE) ident(str)operator(;) - pre_type(char) operator(*)ident(suffix)operator(;) -operator({) - pre_type(int) ident(baselen)operator(;) - pre_type(int) ident(extlen) operator(=) ident(strlen)operator(()ident(suffix)operator(\);) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(t)operator(,) operator(*)ident(p)operator(;) - pre_type(long) ident(slen)operator(;) - pre_type(char) ident(buf)operator([)integer(1024)operator(];) - - reserved(if) operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(>) integer(1000)operator(\)) - ident(rb_fatal)operator(()stringoperator(,) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) - -preprocessor(#if) ident(defined)operator(()ident(DJGPP)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN32__)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) - comment(/* Style 0 */) - ident(slen) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(;) - ident(rb_str_cat)operator(()ident(str)operator(,) ident(suffix)operator(,) ident(extlen)operator(\);) -preprocessor(#if) ident(defined)operator(()ident(DJGPP)operator(\)) - reserved(if) operator(()ident(_USE_LFN)operator(\)) reserved(return)operator(;) -preprocessor(#else) - reserved(if) operator(()ident(valid_filename)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\)\)) reserved(return)operator(;) -preprocessor(#endif) - - comment(/* Fooey, style 0 failed. Fix str before continuing. */) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator([)ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) ident(slen)operator(]) operator(=) char('\\0')operator(;) -preprocessor(#endif) - - ident(slen) operator(=) ident(extlen)operator(;) - ident(t) operator(=) ident(buf)operator(;) ident(baselen) operator(=) integer(0)operator(;) ident(s) operator(=) ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(;) - reserved(while) operator(((*)ident(t) operator(=) operator(*)ident(s)operator(\)) operator(&&) operator(*)ident(s) operator(!=) char('.')operator(\)) operator({) - ident(baselen)operator(++;) - reserved(if) operator((*)ident(s) operator(==) char('\\\\') operator(||) operator(*)ident(s) operator(==) char('/')operator(\)) ident(baselen) operator(=) integer(0)operator(;) - ident(s)operator(++;) ident(t)operator(++;) - operator(}) - ident(p) operator(=) ident(t)operator(;) - - ident(t) operator(=) ident(ext)operator(;) ident(extlen) operator(=) integer(0)operator(;) - reserved(while) operator((*)ident(t)operator(++) operator(=) operator(*)ident(s)operator(++\)) ident(extlen)operator(++;) - reserved(if) operator(()ident(extlen) operator(==) integer(0)operator(\)) operator({) ident(ext)operator([)integer(0)operator(]) operator(=) char('.')operator(;) ident(ext)operator([)integer(1)operator(]) operator(=) integer(0)operator(;) ident(extlen)operator(++;) operator(}) - - reserved(if) operator((*)ident(suffix) operator(==) char('.')operator(\)) operator({) comment(/* Style 1 */) - reserved(if) operator(()ident(strEQ)operator(()ident(ext)operator(,) ident(suffix)operator(\)\)) reserved(goto) ident(fallback)operator(;) - ident(strcpy)operator(()ident(p)operator(,) ident(suffix)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(suffix)operator([)integer(1)operator(]) operator(==) char('\\0')operator(\)) operator({) comment(/* Style 2 */) - reserved(if) operator(()ident(extlen) operator(<) integer(4)operator(\)) operator({) - ident(ext)operator([)ident(extlen)operator(]) operator(=) operator(*)ident(suffix)operator(;) - ident(ext)operator([++)ident(extlen)operator(]) operator(=) char('\\0')operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(baselen) operator(<) integer(8)operator(\)) operator({) - operator(*)ident(p)operator(++) operator(=) operator(*)ident(suffix)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(ext)operator([)integer(3)operator(]) operator(!=) operator(*)ident(suffix)operator(\)) operator({) - ident(ext)operator([)integer(3)operator(]) operator(=) operator(*)ident(suffix)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(buf)operator([)integer(7)operator(]) operator(!=) operator(*)ident(suffix)operator(\)) operator({) - ident(buf)operator([)integer(7)operator(]) operator(=) operator(*)ident(suffix)operator(;) - operator(}) - reserved(else) reserved(goto) ident(fallback)operator(;) - ident(strcpy)operator(()ident(p)operator(,) ident(ext)operator(\);) - operator(}) - reserved(else) operator({) comment(/* Style 3: Panic */) -label(fallback:) - operator(()directive(void)operator(\))ident(memcpy)operator(()ident(p)operator(,) ident(strEQ)operator(()ident(ext)operator(,) ident(suffix1)operator(\)) operator(?) ident(suffix2) operator(:) ident(suffix1)operator(,) integer(5)operator(\);) - operator(}) - ident(rb_str_resize)operator(()ident(str)operator(,) ident(strlen)operator(()ident(buf)operator(\)\);) - ident(memcpy)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(,) ident(buf)operator(,) ident(RSTRING)operator(()ident(str)operator(\)->)ident(len)operator(\);) -operator(}) - -preprocessor(#if) ident(defined)operator(()ident(__CYGWIN32__)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) -directive(static) pre_type(int) -ident(valid_filename)operator(()pre_type(char) operator(*)ident(s)operator(\)) -operator({) - pre_type(int) ident(fd)operator(;) - - comment(/* - // if the file exists, then it's a valid filename! - */) - - reserved(if) operator(()ident(_access)operator(()ident(s)operator(,) integer(0)operator(\)) operator(==) integer(0)operator(\)) operator({) - reserved(return) integer(1)operator(;) - operator(}) - - comment(/* - // It doesn't exist, so see if we can open it. - */) - - reserved(if) operator((()ident(fd) operator(=) ident(_open)operator(()ident(s)operator(,) ident(O_CREAT)operator(,) oct(0666)operator(\)\)) operator(>=) integer(0)operator(\)) operator({) - ident(_close)operator(()ident(fd)operator(\);) - ident(_unlink)operator(()ident(s)operator(\);) comment(/* don't leave it laying around */) - reserved(return) integer(1)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) -preprocessor(#endif) -preprocessor(#endif) - -preprocessor(#if) ident(defined) ident(__DJGPP__) - -preprocessor(#include) include() - -directive(static) pre_type(char) ident(dbcs_table)operator([)integer(256)operator(];) - -pre_type(int) -ident(make_dbcs_table)operator((\)) -operator({) - ident(__dpmi_regs) ident(r)operator(;) - reserved(struct) operator({) - pre_type(unsigned) pre_type(char) ident(start)operator(;) - pre_type(unsigned) pre_type(char) ident(end)operator(;) - operator(}) ident(vec)operator(;) - pre_type(int) ident(offset)operator(;) - - ident(memset)operator((&)ident(r)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(r)operator(\)\);) - ident(r)operator(.)ident(x)operator(.)ident(ax) operator(=) hex(0x6300)operator(;) - ident(__dpmi_int)operator(()hex(0x21)operator(,) operator(&)ident(r)operator(\);) - ident(offset) operator(=) ident(r)operator(.)ident(x)operator(.)ident(ds) operator(*) integer(16) operator(+) ident(r)operator(.)ident(x)operator(.)ident(si)operator(;) - - reserved(for) operator((;;\)) operator({) - pre_type(int) ident(i)operator(;) - ident(dosmemget)operator(()ident(offset)operator(,) reserved(sizeof) ident(vec)operator(,) operator(&)ident(vec)operator(\);) - reserved(if) operator((!)ident(vec)operator(.)ident(start) operator(&&) operator(!)ident(vec)operator(.)ident(end)operator(\)) - reserved(break)operator(;) - reserved(for) operator(()ident(i) operator(=) ident(vec)operator(.)ident(start)operator(;) ident(i) operator(<=) ident(vec)operator(.)ident(end)operator(;) ident(i)operator(++\)) - ident(dbcs_table)operator([)ident(i)operator(]) operator(=) integer(1)operator(;) - ident(offset) operator(+=) integer(2)operator(;) - operator(}) -operator(}) - -pre_type(int) -ident(mblen)operator(()directive(const) pre_type(char) operator(*)ident(s)operator(,) ident(size_t) ident(n)operator(\)) -operator({) - directive(static) pre_type(int) ident(need_init) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(need_init)operator(\)) operator({) - ident(make_dbcs_table)operator((\);) - ident(need_init) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(s)operator(\)) operator({) - reserved(if) operator(()ident(n) operator(==) integer(0) operator(||) operator(*)ident(s) operator(==) integer(0)operator(\)) - reserved(return) integer(0)operator(;) - reserved(else) reserved(if) operator((!)ident(s)operator([)integer(1)operator(]\)) - reserved(return) integer(1)operator(;) - reserved(return) ident(dbcs_table)operator([()pre_type(unsigned) pre_type(char)operator(\)*)ident(s)operator(]) operator(+) integer(1)operator(;) - operator(}) - reserved(else) - reserved(return) integer(1)operator(;) -operator(}) - -reserved(struct) ident(PathList) operator({) - reserved(struct) ident(PathList) operator(*)ident(next)operator(;) - pre_type(char) operator(*)ident(path)operator(;) -operator(};) - -reserved(struct) ident(PathInfo) operator({) - reserved(struct) ident(PathList) operator(*)ident(head)operator(;) - pre_type(int) ident(count)operator(;) -operator(};) - -directive(static) pre_type(int) -ident(push_element)operator(()directive(const) pre_type(char) operator(*)ident(path)operator(,) ident(VALUE) ident(vinfo)operator(\)) -operator({) - reserved(struct) ident(PathList) operator(*)ident(p)operator(;) - reserved(struct) ident(PathInfo) operator(*)ident(info) operator(=) operator(()reserved(struct) ident(PathInfo) operator(*\))ident(vinfo)operator(;) - - ident(p) operator(=) ident(ALLOC)operator(()reserved(struct) ident(PathList)operator(\);) - ident(MEMZERO)operator(()ident(p)operator(,) reserved(struct) ident(PathList)operator(,) integer(1)operator(\);) - ident(p)operator(->)ident(path) operator(=) ident(ruby_strdup)operator(()ident(path)operator(\);) - ident(p)operator(->)ident(next) operator(=) ident(info)operator(->)ident(head)operator(;) - ident(info)operator(->)ident(head) operator(=) ident(p)operator(;) - ident(info)operator(->)ident(count)operator(++;) - - reserved(return) integer(0)operator(;) -operator(}) - -preprocessor(#include) include() -pre_type(int) ident(__opendir_flags) operator(=) ident(__OPENDIR_PRESERVE_CASE)operator(;) - -pre_type(char) operator(**) -ident(__crt0_glob_function)operator(()pre_type(char) operator(*)ident(path)operator(\)) -operator({) - pre_type(int) ident(len) operator(=) ident(strlen)operator(()ident(path)operator(\);) - pre_type(int) ident(i)operator(;) - pre_type(char) operator(**)ident(rv)operator(;) - pre_type(char) ident(path_buffer)operator([)ident(PATH_MAX)operator(];) - pre_type(char) operator(*)ident(buf) operator(=) ident(path_buffer)operator(;) - pre_type(char) operator(*)ident(p)operator(;) - reserved(struct) ident(PathInfo) ident(info)operator(;) - reserved(struct) ident(PathList) operator(*)ident(plist)operator(;) - - reserved(if) operator(()ident(PATH_MAX) operator(<=) ident(len)operator(\)) - ident(buf) operator(=) ident(ruby_xmalloc)operator(()ident(len) operator(+) integer(1)operator(\);) - - ident(strncpy)operator(()ident(buf)operator(,) ident(path)operator(,) ident(len)operator(\);) - ident(buf)operator([)ident(len)operator(]) operator(=) char('\\0')operator(;) - - reserved(for) operator(()ident(p) operator(=) ident(buf)operator(;) operator(*)ident(p)operator(;) ident(p) operator(+=) ident(mblen)operator(()ident(p)operator(,) ident(MB_CUR_MAX)operator(\)\)) - reserved(if) operator((*)ident(p) operator(==) char('\\\\')operator(\)) - operator(*)ident(p) operator(=) char('/')operator(;) - - ident(info)operator(.)ident(count) operator(=) integer(0)operator(;) - ident(info)operator(.)ident(head) operator(=) integer(0)operator(;) - - ident(ruby_glob)operator(()ident(buf)operator(,) integer(0)operator(,) ident(push_element)operator(,) operator(()ident(VALUE)operator(\)&)ident(info)operator(\);) - - reserved(if) operator(()ident(buf) operator(!=) ident(path_buffer)operator(\)) - ident(ruby_xfree)operator(()ident(buf)operator(\);) - - reserved(if) operator(()ident(info)operator(.)ident(count) operator(==) integer(0)operator(\)) - reserved(return) integer(0)operator(;) - - ident(rv) operator(=) ident(ruby_xmalloc)operator((()ident(info)operator(.)ident(count) operator(+) integer(1)operator(\)) operator(*) reserved(sizeof) operator(()pre_type(char) operator(*\)\);) - - ident(plist) operator(=) ident(info)operator(.)ident(head)operator(;) - ident(i) operator(=) integer(0)operator(;) - reserved(while) operator(()ident(plist)operator(\)) operator({) - reserved(struct) ident(PathList) operator(*)ident(cur)operator(;) - ident(rv)operator([)ident(i)operator(]) operator(=) ident(plist)operator(->)ident(path)operator(;) - ident(cur) operator(=) ident(plist)operator(;) - ident(plist) operator(=) ident(plist)operator(->)ident(next)operator(;) - ident(ruby_xfree)operator(()ident(cur)operator(\);) - ident(i)operator(++;) - operator(}) - ident(rv)operator([)ident(i)operator(]) operator(=) integer(0)operator(;) - reserved(return) ident(rv)operator(;) -operator(}) - -preprocessor(#endif) - -comment(/* mm.c */) - -preprocessor(#define) ident(A) operator((()pre_type(int)operator(*\))ident(a)operator(\)) -preprocessor(#define) ident(B) operator((()pre_type(int)operator(*\))ident(b)operator(\)) -preprocessor(#define) ident(C) operator((()pre_type(int)operator(*\))ident(c)operator(\)) -preprocessor(#define) ident(D) operator((()pre_type(int)operator(*\))ident(d)operator(\)) - -preprocessor(#define) ident(mmprepare)operator(()ident(base)operator(,) ident(size)operator(\)) reserved(do) operator({)\ - reserved(if) operator(((()pre_type(long)operator(\))ident(base) operator(&) operator(()hex(0x3)operator(\)\)) operator(==) integer(0)operator(\))\ - reserved(if) operator(()ident(size) operator(>=) integer(16)operator(\)) ident(mmkind) operator(=) integer(1)operator(;)\ - reserved(else) ident(mmkind) operator(=) integer(0)operator(;)\ - reserved(else) ident(mmkind) operator(=) operator(-)integer(1)operator(;)\ - ident(high) operator(=) operator(()ident(size) operator(&) operator((~)hex(0xf)operator(\)\);)\ - ident(low) operator(=) operator(()ident(size) operator(&) hex(0x0c)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\))\ - -preprocessor(#define) ident(mmarg) ident(mmkind)operator(,) ident(size)operator(,) ident(high)operator(,) ident(low) - -directive(static) directive(void) ident(mmswap_)operator(()ident(a)operator(,) ident(b)operator(,) ident(mmarg)operator(\)) - directive(register) pre_type(char) operator(*)ident(a)operator(,) operator(*)ident(b)operator(;) - pre_type(int) ident(mmarg)operator(;) -operator({) - directive(register) pre_type(int) ident(s)operator(;) - reserved(if) operator(()ident(a) operator(==) ident(b)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(mmkind) operator(>=) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(mmkind) operator(>) integer(0)operator(\)) operator({) - directive(register) pre_type(char) operator(*)ident(t) operator(=) ident(a) operator(+) ident(high)operator(;) - reserved(do) operator({) - ident(s) operator(=) ident(A)operator([)integer(0)operator(];) ident(A)operator([)integer(0)operator(]) operator(=) ident(B)operator([)integer(0)operator(];) ident(B)operator([)integer(0)operator(]) operator(=) ident(s)operator(;) - ident(s) operator(=) ident(A)operator([)integer(1)operator(];) ident(A)operator([)integer(1)operator(]) operator(=) ident(B)operator([)integer(1)operator(];) ident(B)operator([)integer(1)operator(]) operator(=) ident(s)operator(;) - ident(s) operator(=) ident(A)operator([)integer(2)operator(];) ident(A)operator([)integer(2)operator(]) operator(=) ident(B)operator([)integer(2)operator(];) ident(B)operator([)integer(2)operator(]) operator(=) ident(s)operator(;) - ident(s) operator(=) ident(A)operator([)integer(3)operator(];) ident(A)operator([)integer(3)operator(]) operator(=) ident(B)operator([)integer(3)operator(];) ident(B)operator([)integer(3)operator(]) operator(=) ident(s)operator(;) ident(a) operator(+=) integer(16)operator(;) ident(b) operator(+=) integer(16)operator(;) - operator(}) reserved(while) operator(()ident(a) operator(<) ident(t)operator(\);) - operator(}) - reserved(if) operator(()ident(low) operator(!=) integer(0)operator(\)) operator({) ident(s) operator(=) ident(A)operator([)integer(0)operator(];) ident(A)operator([)integer(0)operator(]) operator(=) ident(B)operator([)integer(0)operator(];) ident(B)operator([)integer(0)operator(]) operator(=) ident(s)operator(;) - reserved(if) operator(()ident(low) operator(>=) integer(8)operator(\)) operator({) ident(s) operator(=) ident(A)operator([)integer(1)operator(];) ident(A)operator([)integer(1)operator(]) operator(=) ident(B)operator([)integer(1)operator(];) ident(B)operator([)integer(1)operator(]) operator(=) ident(s)operator(;) - reserved(if) operator(()ident(low) operator(==) integer(12)operator(\)) operator({)ident(s) operator(=) ident(A)operator([)integer(2)operator(];) ident(A)operator([)integer(2)operator(]) operator(=) ident(B)operator([)integer(2)operator(];) ident(B)operator([)integer(2)operator(]) operator(=) ident(s)operator(;}}}) - operator(}) - reserved(else) operator({) - directive(register) pre_type(char) operator(*)ident(t) operator(=) ident(a) operator(+) ident(size)operator(;) - reserved(do) operator({)ident(s) operator(=) operator(*)ident(a)operator(;) operator(*)ident(a)operator(++) operator(=) operator(*)ident(b)operator(;) operator(*)ident(b)operator(++) operator(=) ident(s)operator(;}) reserved(while) operator(()ident(a) operator(<) ident(t)operator(\);) - operator(}) -operator(}) -preprocessor(#define) ident(mmswap)operator(()ident(a)operator(,)ident(b)operator(\)) ident(mmswap_)operator((()ident(a)operator(\),()ident(b)operator(\),)ident(mmarg)operator(\)) - -directive(static) directive(void) ident(mmrot3_)operator(()ident(a)operator(,) ident(b)operator(,) ident(c)operator(,) ident(mmarg)operator(\)) - directive(register) pre_type(char) operator(*)ident(a)operator(,) operator(*)ident(b)operator(,) operator(*)ident(c)operator(;) - pre_type(int) ident(mmarg)operator(;) -operator({) - directive(register) pre_type(int) ident(s)operator(;) - reserved(if) operator(()ident(mmkind) operator(>=) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(mmkind) operator(>) integer(0)operator(\)) operator({) - directive(register) pre_type(char) operator(*)ident(t) operator(=) ident(a) operator(+) ident(high)operator(;) - reserved(do) operator({) - ident(s) operator(=) ident(A)operator([)integer(0)operator(];) ident(A)operator([)integer(0)operator(]) operator(=) ident(B)operator([)integer(0)operator(];) ident(B)operator([)integer(0)operator(]) operator(=) ident(C)operator([)integer(0)operator(];) ident(C)operator([)integer(0)operator(]) operator(=) ident(s)operator(;) - ident(s) operator(=) ident(A)operator([)integer(1)operator(];) ident(A)operator([)integer(1)operator(]) operator(=) ident(B)operator([)integer(1)operator(];) ident(B)operator([)integer(1)operator(]) operator(=) ident(C)operator([)integer(1)operator(];) ident(C)operator([)integer(1)operator(]) operator(=) ident(s)operator(;) - ident(s) operator(=) ident(A)operator([)integer(2)operator(];) ident(A)operator([)integer(2)operator(]) operator(=) ident(B)operator([)integer(2)operator(];) ident(B)operator([)integer(2)operator(]) operator(=) ident(C)operator([)integer(2)operator(];) ident(C)operator([)integer(2)operator(]) operator(=) ident(s)operator(;) - ident(s) operator(=) ident(A)operator([)integer(3)operator(];) ident(A)operator([)integer(3)operator(]) operator(=) ident(B)operator([)integer(3)operator(];) ident(B)operator([)integer(3)operator(]) operator(=) ident(C)operator([)integer(3)operator(];) ident(C)operator([)integer(3)operator(]) operator(=) ident(s)operator(;) ident(a) operator(+=) integer(16)operator(;) ident(b) operator(+=) integer(16)operator(;) ident(c) operator(+=) integer(16)operator(;) - operator(}) reserved(while) operator(()ident(a) operator(<) ident(t)operator(\);) - operator(}) - reserved(if) operator(()ident(low) operator(!=) integer(0)operator(\)) operator({) ident(s) operator(=) ident(A)operator([)integer(0)operator(];) ident(A)operator([)integer(0)operator(]) operator(=) ident(B)operator([)integer(0)operator(];) ident(B)operator([)integer(0)operator(]) operator(=) ident(C)operator([)integer(0)operator(];) ident(C)operator([)integer(0)operator(]) operator(=) ident(s)operator(;) - reserved(if) operator(()ident(low) operator(>=) integer(8)operator(\)) operator({) ident(s) operator(=) ident(A)operator([)integer(1)operator(];) ident(A)operator([)integer(1)operator(]) operator(=) ident(B)operator([)integer(1)operator(];) ident(B)operator([)integer(1)operator(]) operator(=) ident(C)operator([)integer(1)operator(];) ident(C)operator([)integer(1)operator(]) operator(=) ident(s)operator(;) - reserved(if) operator(()ident(low) operator(==) integer(12)operator(\)) operator({)ident(s) operator(=) ident(A)operator([)integer(2)operator(];) ident(A)operator([)integer(2)operator(]) operator(=) ident(B)operator([)integer(2)operator(];) ident(B)operator([)integer(2)operator(]) operator(=) ident(C)operator([)integer(2)operator(];) ident(C)operator([)integer(2)operator(]) operator(=) ident(s)operator(;}}}) - operator(}) - reserved(else) operator({) - directive(register) pre_type(char) operator(*)ident(t) operator(=) ident(a) operator(+) ident(size)operator(;) - reserved(do) operator({)ident(s) operator(=) operator(*)ident(a)operator(;) operator(*)ident(a)operator(++) operator(=) operator(*)ident(b)operator(;) operator(*)ident(b)operator(++) operator(=) operator(*)ident(c)operator(;) operator(*)ident(c)operator(++) operator(=) ident(s)operator(;}) reserved(while) operator(()ident(a) operator(<) ident(t)operator(\);) - operator(}) -operator(}) -preprocessor(#define) ident(mmrot3)operator(()ident(a)operator(,)ident(b)operator(,)ident(c)operator(\)) ident(mmrot3_)operator((()ident(a)operator(\),()ident(b)operator(\),()ident(c)operator(\),)ident(mmarg)operator(\)) - -comment(/* qs6.c */) -comment(/*****************************************************/) -comment(/* */) -comment(/* qs6 (Quick sort function\) */) -comment(/* */) -comment(/* by Tomoyuki Kawamura 1995.4.21 */) -comment(/* kawamura@tokuyama.ac.jp */) -comment(/*****************************************************/) - -reserved(typedef) reserved(struct) operator({) pre_type(char) operator(*)ident(LL)operator(,) operator(*)ident(RR)operator(;) operator(}) ident(stack_node)operator(;) comment(/* Stack structure for L,l,R,r */) -preprocessor(#define) ident(PUSH)operator(()ident(ll)operator(,)ident(rr)operator(\)) reserved(do) operator({) ident(top)operator(->)ident(LL) operator(=) operator(()ident(ll)operator(\);) ident(top)operator(->)ident(RR) operator(=) operator(()ident(rr)operator(\);) operator(++)ident(top)operator(;) operator(}) reserved(while) operator(()integer(0)operator(\)) comment(/* Push L,l,R,r */) -preprocessor(#define) ident(POP)operator(()ident(ll)operator(,)ident(rr)operator(\)) reserved(do) operator({) operator(--)ident(top)operator(;) ident(ll) operator(=) ident(top)operator(->)ident(LL)operator(;) ident(rr) operator(=) ident(top)operator(->)ident(RR)operator(;) operator(}) reserved(while) operator(()integer(0)operator(\)) comment(/* Pop L,l,R,r */) - -preprocessor(#define) ident(med3)operator(()ident(a)operator(,)ident(b)operator(,)ident(c)operator(\)) operator(((*)ident(cmp)operator(\)()ident(a)operator(,)ident(b)operator(,)ident(d)operator(\)<)integer(0) operator(?) \ - operator(((*)ident(cmp)operator(\)()ident(b)operator(,)ident(c)operator(,)ident(d)operator(\)<)integer(0) operator(?) ident(b) operator(:) operator(((*)ident(cmp)operator(\)()ident(a)operator(,)ident(c)operator(,)ident(d)operator(\)<)integer(0) operator(?) ident(c) operator(:) ident(a)operator(\)\)) operator(:) \ - operator(((*)ident(cmp)operator(\)()ident(b)operator(,)ident(c)operator(,)ident(d)operator(\)>)integer(0) operator(?) ident(b) operator(:) operator(((*)ident(cmp)operator(\)()ident(a)operator(,)ident(c)operator(,)ident(d)operator(\)<)integer(0) operator(?) ident(a) operator(:) ident(c)operator(\)\)\)) - -directive(void) ident(ruby_qsort) operator(()ident(base)operator(,) ident(nel)operator(,) ident(size)operator(,) ident(cmp)operator(,) ident(d)operator(\)) - directive(void)operator(*) ident(base)operator(;) - directive(const) pre_type(int) ident(nel)operator(;) - directive(const) pre_type(int) ident(size)operator(;) - pre_type(int) operator((*)ident(cmp)operator(\)(\);) - directive(void) operator(*)ident(d)operator(;) -operator({) - directive(register) pre_type(char) operator(*)ident(l)operator(,) operator(*)ident(r)operator(,) operator(*)ident(m)operator(;) comment(/* l,r:left,right group m:median point */) - directive(register) pre_type(int) ident(t)operator(,) ident(eq_l)operator(,) ident(eq_r)operator(;) comment(/* eq_l: all items in left group are equal to S */) - pre_type(char) operator(*)ident(L) operator(=) ident(base)operator(;) comment(/* left end of curren region */) - pre_type(char) operator(*)ident(R) operator(=) operator(()pre_type(char)operator(*\))ident(base) operator(+) ident(size)operator(*()ident(nel)operator(-)integer(1)operator(\);) comment(/* right end of current region */) - pre_type(int) ident(chklim) operator(=) integer(63)operator(;) comment(/* threshold of ordering element check */) - ident(stack_node) ident(stack)operator([)integer(32)operator(],) operator(*)ident(top) operator(=) ident(stack)operator(;) comment(/* 32 is enough for 32bit CPU */) - pre_type(int) ident(mmkind)operator(,) ident(high)operator(,) ident(low)operator(;) - - reserved(if) operator(()ident(nel) operator(<=) integer(1)operator(\)) reserved(return)operator(;) comment(/* need not to sort */) - ident(mmprepare)operator(()ident(base)operator(,) ident(size)operator(\);) - reserved(goto) ident(start)operator(;) - - label(nxt:) - reserved(if) operator(()ident(stack) operator(==) ident(top)operator(\)) reserved(return)operator(;) comment(/* return if stack is empty */) - ident(POP)operator(()ident(L)operator(,)ident(R)operator(\);) - - reserved(for) operator((;;\)) operator({) - label(start:) - reserved(if) operator(()ident(L) operator(+) ident(size) operator(==) ident(R)operator(\)) operator({) comment(/* 2 elements */) - reserved(if) operator(((*)ident(cmp)operator(\)()ident(L)operator(,)ident(R)operator(,)ident(d)operator(\)) operator(>) integer(0)operator(\)) ident(mmswap)operator(()ident(L)operator(,)ident(R)operator(\);) reserved(goto) ident(nxt)operator(;) - operator(}) - - ident(l) operator(=) ident(L)operator(;) ident(r) operator(=) ident(R)operator(;) - ident(t) operator(=) operator(()ident(r) operator(-) ident(l) operator(+) ident(size)operator(\)) operator(/) ident(size)operator(;) comment(/* number of elements */) - ident(m) operator(=) ident(l) operator(+) ident(size) operator(*) operator(()ident(t) operator(>>) integer(1)operator(\);) comment(/* calculate median value */) - - reserved(if) operator(()ident(t) operator(>=) integer(60)operator(\)) operator({) - directive(register) pre_type(char) operator(*)ident(m1)operator(;) - directive(register) pre_type(char) operator(*)ident(m3)operator(;) - reserved(if) operator(()ident(t) operator(>=) integer(200)operator(\)) operator({) - ident(t) operator(=) ident(size)operator(*()ident(t)operator(>>)integer(3)operator(\);) comment(/* number of bytes in splitting 8 */) - operator({) - directive(register) pre_type(char) operator(*)ident(p1) operator(=) ident(l) operator(+) ident(t)operator(;) - directive(register) pre_type(char) operator(*)ident(p2) operator(=) ident(p1) operator(+) ident(t)operator(;) - directive(register) pre_type(char) operator(*)ident(p3) operator(=) ident(p2) operator(+) ident(t)operator(;) - ident(m1) operator(=) ident(med3)operator(()ident(p1)operator(,) ident(p2)operator(,) ident(p3)operator(\);) - ident(p1) operator(=) ident(m) operator(+) ident(t)operator(;) - ident(p2) operator(=) ident(p1) operator(+) ident(t)operator(;) - ident(p3) operator(=) ident(p2) operator(+) ident(t)operator(;) - ident(m3) operator(=) ident(med3)operator(()ident(p1)operator(,) ident(p2)operator(,) ident(p3)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - ident(t) operator(=) ident(size)operator(*()ident(t)operator(>>)integer(2)operator(\);) comment(/* number of bytes in splitting 4 */) - ident(m1) operator(=) ident(l) operator(+) ident(t)operator(;) - ident(m3) operator(=) ident(m) operator(+) ident(t)operator(;) - operator(}) - ident(m) operator(=) ident(med3)operator(()ident(m1)operator(,) ident(m)operator(,) ident(m3)operator(\);) - operator(}) - - reserved(if) operator((()ident(t) operator(=) operator((*)ident(cmp)operator(\)()ident(l)operator(,)ident(m)operator(,)ident(d)operator(\)\)) operator(<) integer(0)operator(\)) operator({) comment(/*3-5-?*/) - reserved(if) operator((()ident(t) operator(=) operator((*)ident(cmp)operator(\)()ident(m)operator(,)ident(r)operator(,)ident(d)operator(\)\)) operator(<) integer(0)operator(\)) operator({) comment(/*3-5-7*/) - reserved(if) operator(()ident(chklim) operator(&&) ident(nel) operator(>=) ident(chklim)operator(\)) operator({) comment(/* check if already ascending order */) - pre_type(char) operator(*)ident(p)operator(;) - ident(chklim) operator(=) integer(0)operator(;) - reserved(for) operator(()ident(p)operator(=)ident(l)operator(;) ident(p)operator(<)ident(r)operator(;) ident(p)operator(+=)ident(size)operator(\)) reserved(if) operator(((*)ident(cmp)operator(\)()ident(p)operator(,)ident(p)operator(+)ident(size)operator(,)ident(d)operator(\)) operator(>) integer(0)operator(\)) reserved(goto) ident(fail)operator(;) - reserved(goto) ident(nxt)operator(;) - operator(}) - label(fail:) reserved(goto) ident(loopA)operator(;) comment(/*3-5-7*/) - operator(}) - reserved(if) operator(()ident(t) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(((*)ident(cmp)operator(\)()ident(l)operator(,)ident(r)operator(,)ident(d)operator(\)) operator(<=) integer(0)operator(\)) operator({)ident(mmswap)operator(()ident(m)operator(,)ident(r)operator(\);) reserved(goto) ident(loopA)operator(;}) comment(/*3-5-4*/) - ident(mmrot3)operator(()ident(r)operator(,)ident(m)operator(,)ident(l)operator(\);) reserved(goto) ident(loopA)operator(;) comment(/*3-5-2*/) - operator(}) - reserved(goto) ident(loopB)operator(;) comment(/*3-5-5*/) - operator(}) - - reserved(if) operator(()ident(t) operator(>) integer(0)operator(\)) operator({) comment(/*7-5-?*/) - reserved(if) operator((()ident(t) operator(=) operator((*)ident(cmp)operator(\)()ident(m)operator(,)ident(r)operator(,)ident(d)operator(\)\)) operator(>) integer(0)operator(\)) operator({) comment(/*7-5-3*/) - reserved(if) operator(()ident(chklim) operator(&&) ident(nel) operator(>=) ident(chklim)operator(\)) operator({) comment(/* check if already ascending order */) - pre_type(char) operator(*)ident(p)operator(;) - ident(chklim) operator(=) integer(0)operator(;) - reserved(for) operator(()ident(p)operator(=)ident(l)operator(;) ident(p)operator(<)ident(r)operator(;) ident(p)operator(+=)ident(size)operator(\)) reserved(if) operator(((*)ident(cmp)operator(\)()ident(p)operator(,)ident(p)operator(+)ident(size)operator(,)ident(d)operator(\)) operator(<) integer(0)operator(\)) reserved(goto) ident(fail2)operator(;) - reserved(while) operator(()ident(l)operator(<)ident(r)operator(\)) operator({)ident(mmswap)operator(()ident(l)operator(,)ident(r)operator(\);) ident(l)operator(+=)ident(size)operator(;) ident(r)operator(-=)ident(size)operator(;}) comment(/* reverse region */) - reserved(goto) ident(nxt)operator(;) - operator(}) - label(fail2:) ident(mmswap)operator(()ident(l)operator(,)ident(r)operator(\);) reserved(goto) ident(loopA)operator(;) comment(/*7-5-3*/) - operator(}) - reserved(if) operator(()ident(t) operator(<) integer(0)operator(\)) operator({) - reserved(if) operator(((*)ident(cmp)operator(\)()ident(l)operator(,)ident(r)operator(,)ident(d)operator(\)) operator(<=) integer(0)operator(\)) operator({)ident(mmswap)operator(()ident(l)operator(,)ident(m)operator(\);) reserved(goto) ident(loopB)operator(;}) comment(/*7-5-8*/) - ident(mmrot3)operator(()ident(l)operator(,)ident(m)operator(,)ident(r)operator(\);) reserved(goto) ident(loopA)operator(;) comment(/*7-5-6*/) - operator(}) - ident(mmswap)operator(()ident(l)operator(,)ident(r)operator(\);) reserved(goto) ident(loopA)operator(;) comment(/*7-5-5*/) - operator(}) - - reserved(if) operator((()ident(t) operator(=) operator((*)ident(cmp)operator(\)()ident(m)operator(,)ident(r)operator(,)ident(d)operator(\)\)) operator(<) integer(0)operator(\)) operator({)reserved(goto) ident(loopA)operator(;}) comment(/*5-5-7*/) - reserved(if) operator(()ident(t) operator(>) integer(0)operator(\)) operator({)ident(mmswap)operator(()ident(l)operator(,)ident(r)operator(\);) reserved(goto) ident(loopB)operator(;}) comment(/*5-5-3*/) - - comment(/* determining splitting type in case 5-5-5 */) comment(/*5-5-5*/) - reserved(for) operator((;;\)) operator({) - reserved(if) operator((()ident(l) operator(+=) ident(size)operator(\)) operator(==) ident(r)operator(\)) reserved(goto) ident(nxt)operator(;) comment(/*5-5-5*/) - reserved(if) operator(()ident(l) operator(==) ident(m)operator(\)) reserved(continue)operator(;) - reserved(if) operator((()ident(t) operator(=) operator((*)ident(cmp)operator(\)()ident(l)operator(,)ident(m)operator(,)ident(d)operator(\)\)) operator(>) integer(0)operator(\)) operator({)ident(mmswap)operator(()ident(l)operator(,)ident(r)operator(\);) ident(l) operator(=) ident(L)operator(;) reserved(goto) ident(loopA)operator(;})comment(/*575-5*/) - reserved(if) operator(()ident(t) operator(<) integer(0)operator(\)) operator({)ident(mmswap)operator(()ident(L)operator(,)ident(l)operator(\);) ident(l) operator(=) ident(L)operator(;) reserved(goto) ident(loopB)operator(;}) comment(/*535-5*/) - operator(}) - - label(loopA:) ident(eq_l) operator(=) integer(1)operator(;) ident(eq_r) operator(=) integer(1)operator(;) comment(/* splitting type A */) comment(/* left <= median < right */) - reserved(for) operator((;;\)) operator({) - reserved(for) operator((;;\)) operator({) - reserved(if) operator((()ident(l) operator(+=) ident(size)operator(\)) operator(==) ident(r)operator(\)) - operator({)ident(l) operator(-=) ident(size)operator(;) reserved(if) operator(()ident(l) operator(!=) ident(m)operator(\)) ident(mmswap)operator(()ident(m)operator(,)ident(l)operator(\);) ident(l) operator(-=) ident(size)operator(;) reserved(goto) ident(fin)operator(;}) - reserved(if) operator(()ident(l) operator(==) ident(m)operator(\)) reserved(continue)operator(;) - reserved(if) operator((()ident(t) operator(=) operator((*)ident(cmp)operator(\)()ident(l)operator(,)ident(m)operator(,)ident(d)operator(\)\)) operator(>) integer(0)operator(\)) operator({)ident(eq_r) operator(=) integer(0)operator(;) reserved(break)operator(;}) - reserved(if) operator(()ident(t) operator(<) integer(0)operator(\)) ident(eq_l) operator(=) integer(0)operator(;) - operator(}) - reserved(for) operator((;;\)) operator({) - reserved(if) operator(()ident(l) operator(==) operator(()ident(r) operator(-=) ident(size)operator(\)\)) - operator({)ident(l) operator(-=) ident(size)operator(;) reserved(if) operator(()ident(l) operator(!=) ident(m)operator(\)) ident(mmswap)operator(()ident(m)operator(,)ident(l)operator(\);) ident(l) operator(-=) ident(size)operator(;) reserved(goto) ident(fin)operator(;}) - reserved(if) operator(()ident(r) operator(==) ident(m)operator(\)) operator({)ident(m) operator(=) ident(l)operator(;) reserved(break)operator(;}) - reserved(if) operator((()ident(t) operator(=) operator((*)ident(cmp)operator(\)()ident(r)operator(,)ident(m)operator(,)ident(d)operator(\)\)) operator(<) integer(0)operator(\)) operator({)ident(eq_l) operator(=) integer(0)operator(;) reserved(break)operator(;}) - reserved(if) operator(()ident(t) operator(==) integer(0)operator(\)) reserved(break)operator(;) - operator(}) - ident(mmswap)operator(()ident(l)operator(,)ident(r)operator(\);) comment(/* swap left and right */) - operator(}) - - label(loopB:) ident(eq_l) operator(=) integer(1)operator(;) ident(eq_r) operator(=) integer(1)operator(;) comment(/* splitting type B */) comment(/* left < median <= right */) - reserved(for) operator((;;\)) operator({) - reserved(for) operator((;;\)) operator({) - reserved(if) operator(()ident(l) operator(==) operator(()ident(r) operator(-=) ident(size)operator(\)\)) - operator({)ident(r) operator(+=) ident(size)operator(;) reserved(if) operator(()ident(r) operator(!=) ident(m)operator(\)) ident(mmswap)operator(()ident(r)operator(,)ident(m)operator(\);) ident(r) operator(+=) ident(size)operator(;) reserved(goto) ident(fin)operator(;}) - reserved(if) operator(()ident(r) operator(==) ident(m)operator(\)) reserved(continue)operator(;) - reserved(if) operator((()ident(t) operator(=) operator((*)ident(cmp)operator(\)()ident(r)operator(,)ident(m)operator(,)ident(d)operator(\)\)) operator(<) integer(0)operator(\)) operator({)ident(eq_l) operator(=) integer(0)operator(;) reserved(break)operator(;}) - reserved(if) operator(()ident(t) operator(>) integer(0)operator(\)) ident(eq_r) operator(=) integer(0)operator(;) - operator(}) - reserved(for) operator((;;\)) operator({) - reserved(if) operator((()ident(l) operator(+=) ident(size)operator(\)) operator(==) ident(r)operator(\)) - operator({)ident(r) operator(+=) ident(size)operator(;) reserved(if) operator(()ident(r) operator(!=) ident(m)operator(\)) ident(mmswap)operator(()ident(r)operator(,)ident(m)operator(\);) ident(r) operator(+=) ident(size)operator(;) reserved(goto) ident(fin)operator(;}) - reserved(if) operator(()ident(l) operator(==) ident(m)operator(\)) operator({)ident(m) operator(=) ident(r)operator(;) reserved(break)operator(;}) - reserved(if) operator((()ident(t) operator(=) operator((*)ident(cmp)operator(\)()ident(l)operator(,)ident(m)operator(,)ident(d)operator(\)\)) operator(>) integer(0)operator(\)) operator({)ident(eq_r) operator(=) integer(0)operator(;) reserved(break)operator(;}) - reserved(if) operator(()ident(t) operator(==) integer(0)operator(\)) reserved(break)operator(;) - operator(}) - ident(mmswap)operator(()ident(l)operator(,)ident(r)operator(\);) comment(/* swap left and right */) - operator(}) - - label(fin:) - reserved(if) operator(()ident(eq_l) operator(==) integer(0)operator(\)) comment(/* need to sort left side */) - reserved(if) operator(()ident(eq_r) operator(==) integer(0)operator(\)) comment(/* need to sort right side */) - reserved(if) operator(()ident(l)operator(-)ident(L) operator(<) ident(R)operator(-)ident(r)operator(\)) operator({)ident(PUSH)operator(()ident(r)operator(,)ident(R)operator(\);) ident(R) operator(=) ident(l)operator(;}) comment(/* sort left side first */) - reserved(else) operator({)ident(PUSH)operator(()ident(L)operator(,)ident(l)operator(\);) ident(L) operator(=) ident(r)operator(;}) comment(/* sort right side first */) - reserved(else) ident(R) operator(=) ident(l)operator(;) comment(/* need to sort left side only */) - reserved(else) reserved(if) operator(()ident(eq_r) operator(==) integer(0)operator(\)) ident(L) operator(=) ident(r)operator(;) comment(/* need to sort right side only */) - reserved(else) reserved(goto) ident(nxt)operator(;) comment(/* need not to sort both sides */) - operator(}) -operator(}) - -pre_type(char) operator(*) -ident(ruby_strdup)operator(()ident(str)operator(\)) - directive(const) pre_type(char) operator(*)ident(str)operator(;) -operator({) - pre_type(char) operator(*)ident(tmp)operator(;) - pre_type(int) ident(len) operator(=) ident(strlen)operator(()ident(str)operator(\)) operator(+) integer(1)operator(;) - - ident(tmp) operator(=) ident(xmalloc)operator(()ident(len)operator(\);) - ident(memcpy)operator(()ident(tmp)operator(,) ident(str)operator(,) ident(len)operator(\);) - - reserved(return) ident(tmp)operator(;) -operator(}) - -pre_type(char) operator(*) -ident(ruby_getcwd)operator((\)) -operator({) -preprocessor(#ifdef) ident(HAVE_GETCWD) - pre_type(int) ident(size) operator(=) integer(200)operator(;) - pre_type(char) operator(*)ident(buf) operator(=) ident(xmalloc)operator(()ident(size)operator(\);) - - reserved(while) operator((!)ident(getcwd)operator(()ident(buf)operator(,) ident(size)operator(\)\)) operator({) - reserved(if) operator(()ident(errno) operator(!=) ident(ERANGE)operator(\)) operator({) - ident(free)operator(()ident(buf)operator(\);) - ident(rb_sys_fail)operator(()stringoperator(\);) - operator(}) - ident(size) operator(*=) integer(2)operator(;) - ident(buf) operator(=) ident(xrealloc)operator(()ident(buf)operator(,) ident(size)operator(\);) - operator(}) -preprocessor(#else) -preprocessor(# ifndef) ident(PATH_MAX) -preprocessor(# define) ident(PATH_MAX) integer(8192) -preprocessor(# endif) - pre_type(char) operator(*)ident(buf) operator(=) ident(xmalloc)operator(()ident(PATH_MAX)operator(+)integer(1)operator(\);) - - reserved(if) operator((!)ident(getwd)operator(()ident(buf)operator(\)\)) operator({) - ident(free)operator(()ident(buf)operator(\);) - ident(rb_sys_fail)operator(()stringoperator(\);) - operator(}) -preprocessor(#endif) - reserved(return) ident(buf)operator(;) -operator(}) - - -comment(/**************************************************************** - * - * The author of this software is David M. Gay. - * - * Copyright (c\) 1991, 2000, 2001 by Lucent Technologies. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software and in all copies of the supporting - * documentation for such software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY - * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - ***************************************************************/) - -comment(/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."\). */) - -comment(/* On a machine with IEEE extended-precision registers, it is - * necessary to specify double-precision (53-bit\) rounding precision - * before invoking strtod or dtoa. If the machine uses (the equivalent - * of\) Intel 80x87 arithmetic, the call - * _control87(PC_53, MCW_PC\); - * does this with many compilers. Whether this or another call is - * appropriate depends on the compiler; for this to work, it may be - * necessary to #include "float.h" or another system-dependent header - * file. - */) - -comment(/* strtod for IEEE-, VAX-, and IBM-arithmetic machines. - * - * This strtod returns a nearest machine number to the input decimal - * string (or sets errno to ERANGE\). With IEEE arithmetic, ties are - * broken by the IEEE round-even rule. Otherwise ties are broken by - * biased rounding (add half and chop\). - * - * Inspired loosely by William D. Clinger's paper "How to Read Floating - * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101]. - * - * Modifications: - * - * 1. We only require IEEE, IBM, or VAX double-precision - * arithmetic (not IEEE double-extended\). - * 2. We get by with floating-point arithmetic in a case that - * Clinger missed -- when we're computing d * 10^n - * for a small integer d and the integer n is not too - * much larger than 22 (the maximum integer k for which - * we can represent 10^k exactly\), we may be able to - * compute (d*10^k\) * 10^(e-k\) with just one roundoff. - * 3. Rather than a bit-at-a-time adjustment of the binary - * result in the hard case, we use floating-point - * arithmetic to determine the adjustment to within - * one bit; only in really hard cases do we need to - * compute a second residual. - * 4. Because of 3., we don't need a large table of powers of 10 - * for ten-to-e (just some small tables, e.g. of 10^k - * for 0 <= k <= 22\). - */) - -comment(/* - * #define IEEE_LITTLE_ENDIAN for IEEE-arithmetic machines where the least - * significant byte has the lowest address. - * #define IEEE_BIG_ENDIAN for IEEE-arithmetic machines where the most - * significant byte has the lowest address. - * #define Long int on machines with 32-bit ints and 64-bit longs. - * #define IBM for IBM mainframe-style floating-point arithmetic. - * #define VAX for VAX-style floating-point arithmetic (D_floating\). - * #define No_leftright to omit left-right logic in fast floating-point - * computation of dtoa. - * #define Honor_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3 - * and strtod and dtoa should round accordingly. - * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3 - * and Honor_FLT_ROUNDS is not #defined. - * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines - * that use extended-precision instructions to compute rounded - * products and quotients\) with IBM. - * #define ROUND_BIASED for IEEE-format with biased rounding. - * #define Inaccurate_Divide for IEEE-format with correctly rounded - * products but inaccurate quotients, e.g., for Intel i860. - * #define NO_LONG_LONG on machines that do not have a "long long" - * integer type (of >= 64 bits\). On such machines, you can - * #define Just_16 to store 16 bits per 32-bit Long when doing - * high-precision integer arithmetic. Whether this speeds things - * up or slows things down depends on the machine and the number - * being converted. If long long is available and the name is - * something other than "long long", #define Llong to be the name, - * and if "unsigned Llong" does not work as an unsigned version of - * Llong, #define #ULLong to be the corresponding unsigned type. - * #define KR_headers for old-style C function headers. - * #define Bad_float_h if your system lacks a float.h or if it does not - * define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP, - * FLT_RADIX, FLT_ROUNDS, and DBL_MAX. - * #define MALLOC your_malloc, where your_malloc(n\) acts like malloc(n\) - * if memory is available and otherwise does something you deem - * appropriate. If MALLOC is undefined, malloc will be invoked - * directly -- and assumed always to succeed. - * #define Omit_Private_Memory to omit logic (added Jan. 1998\) for making - * memory allocations from a private pool of memory when possible. - * When used, the private pool is PRIVATE_MEM bytes long: 2304 bytes, - * unless #defined to be a different length. This default length - * suffices to get rid of MALLOC calls except for unusual cases, - * such as decimal-to-binary conversion of a very long string of - * digits. The longest string dtoa can return is about 751 bytes - * long. For conversions by strtod of strings of 800 digits and - * all dtoa conversions in single-threaded executions with 8-byte - * pointers, PRIVATE_MEM >= 7400 appears to suffice; with 4-byte - * pointers, PRIVATE_MEM >= 7112 appears adequate. - * #define INFNAN_CHECK on IEEE systems to cause strtod to check for - * Infinity and NaN (case insensitively\). On some systems (e.g., - * some HP systems\), it may be necessary to #define NAN_WORD0 - * appropriately -- to the most significant word of a quiet NaN. - * (On HP Series 700/800 machines, -DNAN_WORD0=0x7ff40000 works.\) - * When INFNAN_CHECK is #defined and No_Hex_NaN is not #defined, - * strtod also accepts (case insensitively\) strings of the form - * NaN(x\), where x is a string of hexadecimal digits and spaces; - * if there is only one string of hexadecimal digits, it is taken - * for the 52 fraction bits of the resulting NaN; if there are two - * or more strings of hex digits, the first is for the high 20 bits, - * the second and subsequent for the low 32 bits, with intervening - * white space ignored; but if this results in none of the 52 - * fraction bits being on (an IEEE Infinity symbol\), then NAN_WORD0 - * and NAN_WORD1 are used instead. - * #define MULTIPLE_THREADS if the system offers preemptively scheduled - * multiple threads. In this case, you must provide (or suitably - * #define\) two locks, acquired by ACQUIRE_DTOA_LOCK(n\) and freed - * by FREE_DTOA_LOCK(n\) for n = 0 or 1. (The second lock, accessed - * in pow5mult, ensures lazy evaluation of only one copy of high - * powers of 5; omitting this lock would introduce a small - * probability of wasting memory, but would otherwise be harmless.\) - * You must also invoke freedtoa(s\) to free the value s returned by - * dtoa. You may do so whether or not MULTIPLE_THREADS is #defined. - * #define NO_IEEE_Scale to disable new (Feb. 1997\) logic in strtod that - * avoids underflows on inputs whose result does not underflow. - * If you #define NO_IEEE_Scale on a machine that uses IEEE-format - * floating-point numbers and flushes underflows to zero rather - * than implementing gradual underflow, then you must also #define - * Sudden_Underflow. - * #define YES_ALIAS to permit aliasing certain double values with - * arrays of ULongs. This leads to slightly better code with - * some compilers and was always used prior to 19990916, but it - * is not strictly legal and can cause trouble with aggressively - * optimizing compilers (e.g., gcc 2.95.1 under -O2\). - * #define USE_LOCALE to use the current locale's decimal_point value. - * #define SET_INEXACT if IEEE arithmetic is being used and extra - * computation should be done to set the inexact flag when the - * result is inexact and avoid setting inexact when the result - * is exact. In this case, dtoa.c must be compiled in - * an environment, perhaps provided by #include "dtoa.c" in a - * suitable wrapper, that defines two functions, - * int get_inexact(void\); - * void clear_inexact(void\); - * such that get_inexact(\) returns a nonzero value if the - * inexact bit is already set, and clear_inexact(\) sets the - * inexact bit to 0. When SET_INEXACT is #defined, strtod - * also does extra computations to set the underflow and overflow - * flags when appropriate (i.e., when the result is tiny and - * inexact or when it is a numeric value rounded to +-infinity\). - * #define NO_ERRNO if strtod should not assign errno = ERANGE when - * the result overflows to +-Infinity or underflows to 0. - */) - -preprocessor(#ifdef) ident(WORDS_BIGENDIAN) -preprocessor(#define) ident(IEEE_BIG_ENDIAN) -preprocessor(#else) -preprocessor(#define) ident(IEEE_LITTLE_ENDIAN) -preprocessor(#endif) - -preprocessor(#ifdef) ident(__vax__) -preprocessor(#define) ident(VAX) -preprocessor(#undef) ident(IEEE_BIG_ENDIAN) -preprocessor(#undef) ident(IEEE_LITTLE_ENDIAN) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__arm__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__VFP_FP__)operator(\)) -preprocessor(#define) ident(IEEE_BIG_ENDIAN) -preprocessor(#undef) ident(IEEE_LITTLE_ENDIAN) -preprocessor(#endif) - -preprocessor(#undef) ident(Long) -preprocessor(#undef) ident(ULong) - -preprocessor(#if) ident(SIZEOF_INT) operator(==) integer(4) -preprocessor(#define) ident(Long) pre_type(int) -preprocessor(#define) ident(ULong) pre_type(unsigned) pre_type(int) -preprocessor(#elif) ident(SIZEOF_LONG) operator(==) integer(4) -preprocessor(#define) ident(Long) pre_type(long) pre_type(int) -preprocessor(#define) ident(ULong) pre_type(unsigned) pre_type(long) pre_type(int) -preprocessor(#endif) - -preprocessor(#if) ident(HAVE_LONG_LONG) -preprocessor(#define) ident(Llong) ident(LONG_LONG) -preprocessor(#endif) - -preprocessor(#ifdef) ident(DEBUG) -preprocessor(#include) include("stdio.h") -preprocessor(#define) ident(Bug)operator(()ident(x)operator(\)) operator({)ident(fprintf)operator(()ident(stderr)operator(,) stringoperator(,) ident(x)operator(\);) ident(exit)operator(()integer(1)operator(\);}) -preprocessor(#endif) - -preprocessor(#include) include("stdlib.h") -preprocessor(#include) include("string.h") - -preprocessor(#ifdef) ident(USE_LOCALE) -preprocessor(#include) include("locale.h") -preprocessor(#endif) - -preprocessor(#ifdef) ident(MALLOC) -directive(extern) directive(void) operator(*)ident(MALLOC)operator(()ident(size_t)operator(\);) -preprocessor(#else) -preprocessor(#define) ident(MALLOC) ident(malloc) -preprocessor(#endif) - -preprocessor(#ifndef) ident(Omit_Private_Memory) -preprocessor(#ifndef) ident(PRIVATE_MEM) -preprocessor(#define) ident(PRIVATE_MEM) integer(2304) -preprocessor(#endif) -preprocessor(#define) ident(PRIVATE_mem) operator((()ident(PRIVATE_MEM)operator(+)reserved(sizeof)operator(()pre_type(double)operator(\)-)integer(1)operator(\))operator(/)reserved(sizeof)operator(()pre_type(double)operator(\)\)) -directive(static) pre_type(double) ident(private_mem)operator([)ident(PRIVATE_mem)operator(],) operator(*)ident(pmem_next) operator(=) ident(private_mem)operator(;) -preprocessor(#endif) - -preprocessor(#undef) ident(IEEE_Arith) -preprocessor(#undef) ident(Avoid_Underflow) -preprocessor(#ifdef) ident(IEEE_BIG_ENDIAN) -preprocessor(#define) ident(IEEE_Arith) -preprocessor(#endif) -preprocessor(#ifdef) ident(IEEE_LITTLE_ENDIAN) -preprocessor(#define) ident(IEEE_Arith) -preprocessor(#endif) - -preprocessor(#include) include("errno.h") - -preprocessor(#ifdef) ident(Bad_float_h) - -preprocessor(#ifdef) ident(IEEE_Arith) -preprocessor(#define) ident(DBL_DIG) integer(15) -preprocessor(#define) ident(DBL_MAX_10_EXP) integer(308) -preprocessor(#define) ident(DBL_MAX_EXP) integer(1024) -preprocessor(#define) ident(FLT_RADIX) integer(2) -preprocessor(#endif) comment(/*IEEE_Arith*/) - -preprocessor(#ifdef) ident(IBM) -preprocessor(#define) ident(DBL_DIG) integer(16) -preprocessor(#define) ident(DBL_MAX_10_EXP) integer(75) -preprocessor(#define) ident(DBL_MAX_EXP) integer(63) -preprocessor(#define) ident(FLT_RADIX) integer(16) -preprocessor(#define) ident(DBL_MAX) float(7)float(.2370055773322621e+75) -preprocessor(#endif) - -preprocessor(#ifdef) ident(VAX) -preprocessor(#define) ident(DBL_DIG) integer(16) -preprocessor(#define) ident(DBL_MAX_10_EXP) integer(38) -preprocessor(#define) ident(DBL_MAX_EXP) integer(127) -preprocessor(#define) ident(FLT_RADIX) integer(2) -preprocessor(#define) ident(DBL_MAX) float(1)float(.7014118346046923e+38) -preprocessor(#endif) - -preprocessor(#ifndef) ident(LONG_MAX) -preprocessor(#define) ident(LONG_MAX) integer(2147483647) -preprocessor(#endif) - -preprocessor(#else) comment(/* ifndef Bad_float_h */) -preprocessor(#include) include("float.h") -preprocessor(#endif) comment(/* Bad_float_h */) - -preprocessor(#ifndef) ident(__MATH_H__) -preprocessor(#include) include("math.h") -preprocessor(#endif) - -preprocessor(#ifdef) ident(__cplusplus) -directive(extern) string operator({) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(IEEE_LITTLE_ENDIAN)operator(\)) operator(+) ident(defined)operator(()ident(IEEE_BIG_ENDIAN)operator(\)) operator(+) ident(defined)operator(()ident(VAX)operator(\)) operator(+) ident(defined)operator(()ident(IBM)operator(\)) operator(!=) integer(1) -ident(Exactly) ident(one) ident(of) ident(IEEE_LITTLE_ENDIAN)operator(,) ident(IEEE_BIG_ENDIAN)operator(,) ident(VAX)operator(,) ident(or) ident(IBM) ident(should) ident(be) ident(defined)operator(.) -preprocessor(#endif) - -reserved(typedef) reserved(union) operator({) pre_type(double) ident(d)operator(;) ident(ULong) ident(L)operator([)integer(2)operator(];) operator(}) ident(U)operator(;) - -preprocessor(#ifdef) ident(YES_ALIAS) -preprocessor(#define) ident(dval)operator(()ident(x)operator(\)) ident(x) -preprocessor(#ifdef) ident(IEEE_LITTLE_ENDIAN) -preprocessor(#define) ident(word0)operator(()ident(x)operator(\)) operator((()ident(ULong) operator(*\)&)ident(x)operator(\)[)integer(1)operator(]) -preprocessor(#define) ident(word1)operator(()ident(x)operator(\)) operator((()ident(ULong) operator(*\)&)ident(x)operator(\)[)integer(0)operator(]) -preprocessor(#else) -preprocessor(#define) ident(word0)operator(()ident(x)operator(\)) operator((()ident(ULong) operator(*\)&)ident(x)operator(\)[)integer(0)operator(]) -preprocessor(#define) ident(word1)operator(()ident(x)operator(\)) operator((()ident(ULong) operator(*\)&)ident(x)operator(\)[)integer(1)operator(]) -preprocessor(#endif) -preprocessor(#else) -preprocessor(#ifdef) ident(IEEE_LITTLE_ENDIAN) -preprocessor(#define) ident(word0)operator(()ident(x)operator(\)) operator((()ident(U)operator(*\)&)ident(x)operator(\)->)ident(L)operator([)integer(1)operator(]) -preprocessor(#define) ident(word1)operator(()ident(x)operator(\)) operator((()ident(U)operator(*\)&)ident(x)operator(\)->)ident(L)operator([)integer(0)operator(]) -preprocessor(#else) -preprocessor(#define) ident(word0)operator(()ident(x)operator(\)) operator((()ident(U)operator(*\)&)ident(x)operator(\)->)ident(L)operator([)integer(0)operator(]) -preprocessor(#define) ident(word1)operator(()ident(x)operator(\)) operator((()ident(U)operator(*\)&)ident(x)operator(\)->)ident(L)operator([)integer(1)operator(]) -preprocessor(#endif) -preprocessor(#define) ident(dval)operator(()ident(x)operator(\)) operator((()ident(U)operator(*\)&)ident(x)operator(\)->)ident(d) -preprocessor(#endif) - -comment(/* The following definition of Storeinc is appropriate for MIPS processors. - * An alternative that might be better on some machines is - * #define Storeinc(a,b,c\) (*a++ = b << 16 | c & 0xffff\) - */) -preprocessor(#if) ident(defined)operator(()ident(IEEE_LITTLE_ENDIAN)operator(\)) operator(+) ident(defined)operator(()ident(VAX)operator(\)) operator(+) ident(defined)operator(()ident(__arm__)operator(\)) -preprocessor(#define) ident(Storeinc)operator(()ident(a)operator(,)ident(b)operator(,)ident(c)operator(\)) operator(((()pre_type(unsigned) pre_type(short) operator(*\))ident(a)operator(\)[)integer(1)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(short)operator(\))ident(b)operator(,) \ -operator((()pre_type(unsigned) pre_type(short) operator(*\))ident(a)operator(\)[)integer(0)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(short)operator(\))ident(c)operator(,) ident(a)operator(++\)) -preprocessor(#else) -preprocessor(#define) ident(Storeinc)operator(()ident(a)operator(,)ident(b)operator(,)ident(c)operator(\)) operator(((()pre_type(unsigned) pre_type(short) operator(*\))ident(a)operator(\)[)integer(0)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(short)operator(\))ident(b)operator(,) \ -operator((()pre_type(unsigned) pre_type(short) operator(*\))ident(a)operator(\)[)integer(1)operator(]) operator(=) operator(()pre_type(unsigned) pre_type(short)operator(\))ident(c)operator(,) ident(a)operator(++\)) -preprocessor(#endif) - -comment(/* #define P DBL_MANT_DIG */) -comment(/* Ten_pmax = floor(P*log(2\)/log(5\)\) */) -comment(/* Bletch = (highest power of 2 < DBL_MAX_10_EXP\) / 16 */) -comment(/* Quick_max = floor((P-1\)*log(FLT_RADIX\)/log(10\) - 1\) */) -comment(/* Int_max = floor(P*log(FLT_RADIX\)/log(10\) - 1\) */) - -preprocessor(#ifdef) ident(IEEE_Arith) -preprocessor(#define) ident(Exp_shift) integer(20) -preprocessor(#define) ident(Exp_shift1) integer(20) -preprocessor(#define) ident(Exp_msk1) hex(0x100000) -preprocessor(#define) ident(Exp_msk11) hex(0x100000) -preprocessor(#define) ident(Exp_mask) hex(0x7ff00000) -preprocessor(#define) ident(P) integer(53) -preprocessor(#define) ident(Bias) integer(1023) -preprocessor(#define) ident(Emin) operator((-)integer(1022)operator(\)) -preprocessor(#define) ident(Exp_1) hex(0x3ff00000) -preprocessor(#define) ident(Exp_11) hex(0x3ff00000) -preprocessor(#define) ident(Ebits) integer(11) -preprocessor(#define) ident(Frac_mask) hex(0xfffff) -preprocessor(#define) ident(Frac_mask1) hex(0xfffff) -preprocessor(#define) ident(Ten_pmax) integer(22) -preprocessor(#define) ident(Bletch) hex(0x10) -preprocessor(#define) ident(Bndry_mask) hex(0xfffff) -preprocessor(#define) ident(Bndry_mask1) hex(0xfffff) -preprocessor(#define) ident(LSB) integer(1) -preprocessor(#define) ident(Sign_bit) hex(0x80000000) -preprocessor(#define) ident(Log2P) integer(1) -preprocessor(#define) ident(Tiny0) integer(0) -preprocessor(#define) ident(Tiny1) integer(1) -preprocessor(#define) ident(Quick_max) integer(14) -preprocessor(#define) ident(Int_max) integer(14) -preprocessor(#ifndef) ident(NO_IEEE_Scale) -preprocessor(#define) ident(Avoid_Underflow) -preprocessor(#ifdef) ident(Flush_Denorm) comment(/* debugging option */) -preprocessor(#undef) ident(Sudden_Underflow) -preprocessor(#endif) -preprocessor(#endif) - -preprocessor(#ifndef) ident(Flt_Rounds) -preprocessor(#ifdef) ident(FLT_ROUNDS) -preprocessor(#define) ident(Flt_Rounds) ident(FLT_ROUNDS) -preprocessor(#else) -preprocessor(#define) ident(Flt_Rounds) integer(1) -preprocessor(#endif) -preprocessor(#endif) comment(/*Flt_Rounds*/) - -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) -preprocessor(#define) ident(Rounding) ident(rounding) -preprocessor(#undef) ident(Check_FLT_ROUNDS) -preprocessor(#define) ident(Check_FLT_ROUNDS) -preprocessor(#else) -preprocessor(#define) ident(Rounding) ident(Flt_Rounds) -preprocessor(#endif) - -preprocessor(#else) comment(/* ifndef IEEE_Arith */) -preprocessor(#undef) ident(Check_FLT_ROUNDS) -preprocessor(#undef) ident(Honor_FLT_ROUNDS) -preprocessor(#undef) ident(SET_INEXACT) -preprocessor(#undef) ident(Sudden_Underflow) -preprocessor(#define) ident(Sudden_Underflow) -preprocessor(#ifdef) ident(IBM) -preprocessor(#undef) ident(Flt_Rounds) -preprocessor(#define) ident(Flt_Rounds) integer(0) -preprocessor(#define) ident(Exp_shift) integer(24) -preprocessor(#define) ident(Exp_shift1) integer(24) -preprocessor(#define) ident(Exp_msk1) hex(0x1000000) -preprocessor(#define) ident(Exp_msk11) hex(0x1000000) -preprocessor(#define) ident(Exp_mask) hex(0x7f000000) -preprocessor(#define) ident(P) integer(14) -preprocessor(#define) ident(Bias) integer(65) -preprocessor(#define) ident(Exp_1) hex(0x41000000) -preprocessor(#define) ident(Exp_11) hex(0x41000000) -preprocessor(#define) ident(Ebits) integer(8) comment(/* exponent has 7 bits, but 8 is the right value in b2d */) -preprocessor(#define) ident(Frac_mask) hex(0xffffff) -preprocessor(#define) ident(Frac_mask1) hex(0xffffff) -preprocessor(#define) ident(Bletch) integer(4) -preprocessor(#define) ident(Ten_pmax) integer(22) -preprocessor(#define) ident(Bndry_mask) hex(0xefffff) -preprocessor(#define) ident(Bndry_mask1) hex(0xffffff) -preprocessor(#define) ident(LSB) integer(1) -preprocessor(#define) ident(Sign_bit) hex(0x80000000) -preprocessor(#define) ident(Log2P) integer(4) -preprocessor(#define) ident(Tiny0) hex(0x100000) -preprocessor(#define) ident(Tiny1) integer(0) -preprocessor(#define) ident(Quick_max) integer(14) -preprocessor(#define) ident(Int_max) integer(15) -preprocessor(#else) comment(/* VAX */) -preprocessor(#undef) ident(Flt_Rounds) -preprocessor(#define) ident(Flt_Rounds) integer(1) -preprocessor(#define) ident(Exp_shift) integer(23) -preprocessor(#define) ident(Exp_shift1) integer(7) -preprocessor(#define) ident(Exp_msk1) hex(0x80) -preprocessor(#define) ident(Exp_msk11) hex(0x800000) -preprocessor(#define) ident(Exp_mask) hex(0x7f80) -preprocessor(#define) ident(P) integer(56) -preprocessor(#define) ident(Bias) integer(129) -preprocessor(#define) ident(Exp_1) hex(0x40800000) -preprocessor(#define) ident(Exp_11) hex(0x4080) -preprocessor(#define) ident(Ebits) integer(8) -preprocessor(#define) ident(Frac_mask) hex(0x7fffff) -preprocessor(#define) ident(Frac_mask1) hex(0xffff007f) -preprocessor(#define) ident(Ten_pmax) integer(24) -preprocessor(#define) ident(Bletch) integer(2) -preprocessor(#define) ident(Bndry_mask) hex(0xffff007f) -preprocessor(#define) ident(Bndry_mask1) hex(0xffff007f) -preprocessor(#define) ident(LSB) hex(0x10000) -preprocessor(#define) ident(Sign_bit) hex(0x8000) -preprocessor(#define) ident(Log2P) integer(1) -preprocessor(#define) ident(Tiny0) hex(0x80) -preprocessor(#define) ident(Tiny1) integer(0) -preprocessor(#define) ident(Quick_max) integer(15) -preprocessor(#define) ident(Int_max) integer(15) -preprocessor(#endif) comment(/* IBM, VAX */) -preprocessor(#endif) comment(/* IEEE_Arith */) - -preprocessor(#ifndef) ident(IEEE_Arith) -preprocessor(#define) ident(ROUND_BIASED) -preprocessor(#endif) - -preprocessor(#ifdef) ident(RND_PRODQUOT) -preprocessor(#define) ident(rounded_product)operator(()ident(a)operator(,)ident(b)operator(\)) ident(a) operator(=) ident(rnd_prod)operator(()ident(a)operator(,) ident(b)operator(\)) -preprocessor(#define) ident(rounded_quotient)operator(()ident(a)operator(,)ident(b)operator(\)) ident(a) operator(=) ident(rnd_quot)operator(()ident(a)operator(,) ident(b)operator(\)) -directive(extern) pre_type(double) ident(rnd_prod)operator(()pre_type(double)operator(,) pre_type(double)operator(\),) ident(rnd_quot)operator(()pre_type(double)operator(,) pre_type(double)operator(\);) -preprocessor(#else) -preprocessor(#define) ident(rounded_product)operator(()ident(a)operator(,)ident(b)operator(\)) ident(a) operator(*=) ident(b) -preprocessor(#define) ident(rounded_quotient)operator(()ident(a)operator(,)ident(b)operator(\)) ident(a) operator(/=) ident(b) -preprocessor(#endif) - -preprocessor(#define) ident(Big0) operator(()ident(Frac_mask1) operator(|) ident(Exp_msk1)operator(*()ident(DBL_MAX_EXP)operator(+)ident(Bias)operator(-)integer(1)operator(\)\)) -preprocessor(#define) ident(Big1) hex(0xffffffff) - -preprocessor(#ifndef) ident(Pack_32) -preprocessor(#define) ident(Pack_32) -preprocessor(#endif) - -preprocessor(#define) ident(FFFFFFFF) hex(0xffffffff)ident(UL) - -preprocessor(#ifdef) ident(NO_LONG_LONG) -preprocessor(#undef) ident(ULLong) -preprocessor(#ifdef) ident(Just_16) -preprocessor(#undef) ident(Pack_32) -comment(/* When Pack_32 is not defined, we store 16 bits per 32-bit Long. - * This makes some inner loops simpler and sometimes saves work - * during multiplications, but it often seems to make things slightly - * slower. Hence the default is now to store 32 bits per Long. - */) -preprocessor(#endif) -preprocessor(#else) comment(/* long long available */) -preprocessor(#ifndef) ident(Llong) -preprocessor(#define) ident(Llong) pre_type(long) pre_type(long) -preprocessor(#endif) -preprocessor(#ifndef) ident(ULLong) -preprocessor(#define) ident(ULLong) pre_type(unsigned) ident(Llong) -preprocessor(#endif) -preprocessor(#endif) comment(/* NO_LONG_LONG */) - -preprocessor(#ifndef) ident(MULTIPLE_THREADS) -preprocessor(#define) ident(ACQUIRE_DTOA_LOCK)operator(()ident(n)operator(\)) comment(/*nothing*/) -preprocessor(#define) ident(FREE_DTOA_LOCK)operator(()ident(n)operator(\)) comment(/*nothing*/) -preprocessor(#endif) - -preprocessor(#define) ident(Kmax) integer(15) - -reserved(struct) ident(Bigint) operator({) - reserved(struct) ident(Bigint) operator(*)ident(next)operator(;) - pre_type(int) ident(k)operator(,) ident(maxwds)operator(,) ident(sign)operator(,) ident(wds)operator(;) - ident(ULong) ident(x)operator([)integer(1)operator(];) -operator(};) - -reserved(typedef) reserved(struct) ident(Bigint) ident(Bigint)operator(;) - -directive(static) ident(Bigint) operator(*)ident(freelist)operator([)ident(Kmax)operator(+)integer(1)operator(];) - -directive(static) ident(Bigint) operator(*) -ident(Balloc)operator(()pre_type(int) ident(k)operator(\)) -operator({) - pre_type(int) ident(x)operator(;) - ident(Bigint) operator(*)ident(rv)operator(;) -preprocessor(#ifndef) ident(Omit_Private_Memory) - pre_type(unsigned) pre_type(int) ident(len)operator(;) -preprocessor(#endif) - - ident(ACQUIRE_DTOA_LOCK)operator(()integer(0)operator(\);) - reserved(if) operator((()ident(rv) operator(=) ident(freelist)operator([)ident(k)operator(]\)) operator(!=) integer(0)operator(\)) operator({) - ident(freelist)operator([)ident(k)operator(]) operator(=) ident(rv)operator(->)ident(next)operator(;) - operator(}) - reserved(else) operator({) - ident(x) operator(=) integer(1) operator(<<) ident(k)operator(;) -preprocessor(#ifdef) ident(Omit_Private_Memory) - ident(rv) operator(=) operator(()ident(Bigint) operator(*\))ident(MALLOC)operator(()reserved(sizeof)operator(()ident(Bigint)operator(\)) operator(+) operator(()ident(x)operator(-)integer(1)operator(\)*)reserved(sizeof)operator(()ident(ULong)operator(\)\);) -preprocessor(#else) - ident(len) operator(=) operator(()reserved(sizeof)operator(()ident(Bigint)operator(\)) operator(+) operator(()ident(x)operator(-)integer(1)operator(\)*)reserved(sizeof)operator(()ident(ULong)operator(\)) operator(+) reserved(sizeof)operator(()pre_type(double)operator(\)) operator(-) integer(1)operator(\)) - operator(/)reserved(sizeof)operator(()pre_type(double)operator(\);) - reserved(if) operator(()ident(pmem_next) operator(-) ident(private_mem) operator(+) ident(len) operator(<=) ident(PRIVATE_mem)operator(\)) operator({) - ident(rv) operator(=) operator(()ident(Bigint)operator(*\))ident(pmem_next)operator(;) - ident(pmem_next) operator(+=) ident(len)operator(;) - operator(}) - reserved(else) - ident(rv) operator(=) operator(()ident(Bigint)operator(*\))ident(MALLOC)operator(()ident(len)operator(*)reserved(sizeof)operator(()pre_type(double)operator(\)\);) -preprocessor(#endif) - ident(rv)operator(->)ident(k) operator(=) ident(k)operator(;) - ident(rv)operator(->)ident(maxwds) operator(=) ident(x)operator(;) - operator(}) - ident(FREE_DTOA_LOCK)operator(()integer(0)operator(\);) - ident(rv)operator(->)ident(sign) operator(=) ident(rv)operator(->)ident(wds) operator(=) integer(0)operator(;) - reserved(return) ident(rv)operator(;) -operator(}) - -directive(static) directive(void) -ident(Bfree)operator(()ident(Bigint) operator(*)ident(v)operator(\)) -operator({) - reserved(if) operator(()ident(v)operator(\)) operator({) - ident(ACQUIRE_DTOA_LOCK)operator(()integer(0)operator(\);) - ident(v)operator(->)ident(next) operator(=) ident(freelist)operator([)ident(v)operator(->)ident(k)operator(];) - ident(freelist)operator([)ident(v)operator(->)ident(k)operator(]) operator(=) ident(v)operator(;) - ident(FREE_DTOA_LOCK)operator(()integer(0)operator(\);) - operator(}) -operator(}) - -preprocessor(#define) ident(Bcopy)operator(()ident(x)operator(,)ident(y)operator(\)) ident(memcpy)operator((()pre_type(char) operator(*\)&)ident(x)operator(->)ident(sign)operator(,) operator(()pre_type(char) operator(*\)&)ident(y)operator(->)ident(sign)operator(,) \ -ident(y)operator(->)ident(wds)operator(*)reserved(sizeof)operator(()ident(Long)operator(\)) operator(+) integer(2)operator(*)reserved(sizeof)operator(()pre_type(int)operator(\)\)) - -directive(static) ident(Bigint) operator(*) -ident(multadd)operator(()ident(Bigint) operator(*)ident(b)operator(,) pre_type(int) ident(m)operator(,) pre_type(int) ident(a)operator(\)) comment(/* multiply by m and add a */) -operator({) - pre_type(int) ident(i)operator(,) ident(wds)operator(;) -preprocessor(#ifdef) ident(ULLong) - ident(ULong) operator(*)ident(x)operator(;) - ident(ULLong) ident(carry)operator(,) ident(y)operator(;) -preprocessor(#else) - ident(ULong) ident(carry)operator(,) operator(*)ident(x)operator(,) ident(y)operator(;) -preprocessor(#ifdef) ident(Pack_32) - ident(ULong) ident(xi)operator(,) ident(z)operator(;) -preprocessor(#endif) -preprocessor(#endif) - ident(Bigint) operator(*)ident(b1)operator(;) - - ident(wds) operator(=) ident(b)operator(->)ident(wds)operator(;) - ident(x) operator(=) ident(b)operator(->)ident(x)operator(;) - ident(i) operator(=) integer(0)operator(;) - ident(carry) operator(=) ident(a)operator(;) - reserved(do) operator({) -preprocessor(#ifdef) ident(ULLong) - ident(y) operator(=) operator(*)ident(x) operator(*) operator(()ident(ULLong)operator(\))ident(m) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(y) operator(>>) integer(32)operator(;) - operator(*)ident(x)operator(++) operator(=) ident(y) operator(&) ident(FFFFFFFF)operator(;) -preprocessor(#else) -preprocessor(#ifdef) ident(Pack_32) - ident(xi) operator(=) operator(*)ident(x)operator(;) - ident(y) operator(=) operator(()ident(xi) operator(&) hex(0xffff)operator(\)) operator(*) ident(m) operator(+) ident(carry)operator(;) - ident(z) operator(=) operator(()ident(xi) operator(>>) integer(16)operator(\)) operator(*) ident(m) operator(+) operator(()ident(y) operator(>>) integer(16)operator(\);) - ident(carry) operator(=) ident(z) operator(>>) integer(16)operator(;) - operator(*)ident(x)operator(++) operator(=) operator(()ident(z) operator(<<) integer(16)operator(\)) operator(+) operator(()ident(y) operator(&) hex(0xffff)operator(\);) -preprocessor(#else) - ident(y) operator(=) operator(*)ident(x) operator(*) ident(m) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(y) operator(>>) integer(16)operator(;) - operator(*)ident(x)operator(++) operator(=) ident(y) operator(&) hex(0xffff)operator(;) -preprocessor(#endif) -preprocessor(#endif) - operator(}) reserved(while) operator((++)ident(i) operator(<) ident(wds)operator(\);) - reserved(if) operator(()ident(carry)operator(\)) operator({) - reserved(if) operator(()ident(wds) operator(>=) ident(b)operator(->)ident(maxwds)operator(\)) operator({) - ident(b1) operator(=) ident(Balloc)operator(()ident(b)operator(->)ident(k)operator(+)integer(1)operator(\);) - ident(Bcopy)operator(()ident(b1)operator(,) ident(b)operator(\);) - ident(Bfree)operator(()ident(b)operator(\);) - ident(b) operator(=) ident(b1)operator(;) - operator(}) - ident(b)operator(->)ident(x)operator([)ident(wds)operator(++]) operator(=) ident(carry)operator(;) - ident(b)operator(->)ident(wds) operator(=) ident(wds)operator(;) - operator(}) - reserved(return) ident(b)operator(;) -operator(}) - -directive(static) ident(Bigint) operator(*) -ident(s2b)operator(()directive(const) pre_type(char) operator(*)ident(s)operator(,) pre_type(int) ident(nd0)operator(,) pre_type(int) ident(nd)operator(,) ident(ULong) ident(y9)operator(\)) -operator({) - ident(Bigint) operator(*)ident(b)operator(;) - pre_type(int) ident(i)operator(,) ident(k)operator(;) - ident(Long) ident(x)operator(,) ident(y)operator(;) - - ident(x) operator(=) operator(()ident(nd) operator(+) integer(8)operator(\)) operator(/) integer(9)operator(;) - reserved(for) operator(()ident(k) operator(=) integer(0)operator(,) ident(y) operator(=) integer(1)operator(;) ident(x) operator(>) ident(y)operator(;) ident(y) operator(<<=) integer(1)operator(,) ident(k)operator(++\)) operator(;) -preprocessor(#ifdef) ident(Pack_32) - ident(b) operator(=) ident(Balloc)operator(()ident(k)operator(\);) - ident(b)operator(->)ident(x)operator([)integer(0)operator(]) operator(=) ident(y9)operator(;) - ident(b)operator(->)ident(wds) operator(=) integer(1)operator(;) -preprocessor(#else) - ident(b) operator(=) ident(Balloc)operator(()ident(k)operator(+)integer(1)operator(\);) - ident(b)operator(->)ident(x)operator([)integer(0)operator(]) operator(=) ident(y9) operator(&) hex(0xffff)operator(;) - ident(b)operator(->)ident(wds) operator(=) operator(()ident(b)operator(->)ident(x)operator([)integer(1)operator(]) operator(=) ident(y9) operator(>>) integer(16)operator(\)) operator(?) integer(2) operator(:) integer(1)operator(;) -preprocessor(#endif) - - ident(i) operator(=) integer(9)operator(;) - reserved(if) operator(()integer(9) operator(<) ident(nd0)operator(\)) operator({) - ident(s) operator(+=) integer(9)operator(;) - reserved(do) operator({) - ident(b) operator(=) ident(multadd)operator(()ident(b)operator(,) integer(10)operator(,) operator(*)ident(s)operator(++) operator(-) char('0')operator(\);) - operator(}) reserved(while) operator((++)ident(i) operator(<) ident(nd0)operator(\);) - ident(s)operator(++;) - operator(}) - reserved(else) - ident(s) operator(+=) integer(10)operator(;) - reserved(for) operator((;) ident(i) operator(<) ident(nd)operator(;) ident(i)operator(++\)) - ident(b) operator(=) ident(multadd)operator(()ident(b)operator(,) integer(10)operator(,) operator(*)ident(s)operator(++) operator(-) char('0')operator(\);) - reserved(return) ident(b)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(hi0bits)operator(()directive(register) ident(ULong) ident(x)operator(\)) -operator({) - directive(register) pre_type(int) ident(k) operator(=) integer(0)operator(;) - - reserved(if) operator((!()ident(x) operator(&) hex(0xffff0000)operator(\)\)) operator({) - ident(k) operator(=) integer(16)operator(;) - ident(x) operator(<<=) integer(16)operator(;) - operator(}) - reserved(if) operator((!()ident(x) operator(&) hex(0xff000000)operator(\)\)) operator({) - ident(k) operator(+=) integer(8)operator(;) - ident(x) operator(<<=) integer(8)operator(;) - operator(}) - reserved(if) operator((!()ident(x) operator(&) hex(0xf0000000)operator(\)\)) operator({) - ident(k) operator(+=) integer(4)operator(;) - ident(x) operator(<<=) integer(4)operator(;) - operator(}) - reserved(if) operator((!()ident(x) operator(&) hex(0xc0000000)operator(\)\)) operator({) - ident(k) operator(+=) integer(2)operator(;) - ident(x) operator(<<=) integer(2)operator(;) - operator(}) - reserved(if) operator((!()ident(x) operator(&) hex(0x80000000)operator(\)\)) operator({) - ident(k)operator(++;) - reserved(if) operator((!()ident(x) operator(&) hex(0x40000000)operator(\)\)) - reserved(return) integer(32)operator(;) - operator(}) - reserved(return) ident(k)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(lo0bits)operator(()ident(ULong) operator(*)ident(y)operator(\)) -operator({) - directive(register) pre_type(int) ident(k)operator(;) - directive(register) ident(ULong) ident(x) operator(=) operator(*)ident(y)operator(;) - - reserved(if) operator(()ident(x) operator(&) integer(7)operator(\)) operator({) - reserved(if) operator(()ident(x) operator(&) integer(1)operator(\)) - reserved(return) integer(0)operator(;) - reserved(if) operator(()ident(x) operator(&) integer(2)operator(\)) operator({) - operator(*)ident(y) operator(=) ident(x) operator(>>) integer(1)operator(;) - reserved(return) integer(1)operator(;) - operator(}) - operator(*)ident(y) operator(=) ident(x) operator(>>) integer(2)operator(;) - reserved(return) integer(2)operator(;) - operator(}) - ident(k) operator(=) integer(0)operator(;) - reserved(if) operator((!()ident(x) operator(&) hex(0xffff)operator(\)\)) operator({) - ident(k) operator(=) integer(16)operator(;) - ident(x) operator(>>=) integer(16)operator(;) - operator(}) - reserved(if) operator((!()ident(x) operator(&) hex(0xff)operator(\)\)) operator({) - ident(k) operator(+=) integer(8)operator(;) - ident(x) operator(>>=) integer(8)operator(;) - operator(}) - reserved(if) operator((!()ident(x) operator(&) hex(0xf)operator(\)\)) operator({) - ident(k) operator(+=) integer(4)operator(;) - ident(x) operator(>>=) integer(4)operator(;) - operator(}) - reserved(if) operator((!()ident(x) operator(&) hex(0x3)operator(\)\)) operator({) - ident(k) operator(+=) integer(2)operator(;) - ident(x) operator(>>=) integer(2)operator(;) - operator(}) - reserved(if) operator((!()ident(x) operator(&) integer(1)operator(\)\)) operator({) - ident(k)operator(++;) - ident(x) operator(>>=) integer(1)operator(;) - reserved(if) operator((!)ident(x)operator(\)) - reserved(return) integer(32)operator(;) - operator(}) - operator(*)ident(y) operator(=) ident(x)operator(;) - reserved(return) ident(k)operator(;) -operator(}) - -directive(static) ident(Bigint) operator(*) -ident(i2b)operator(()pre_type(int) ident(i)operator(\)) -operator({) - ident(Bigint) operator(*)ident(b)operator(;) - - ident(b) operator(=) ident(Balloc)operator(()integer(1)operator(\);) - ident(b)operator(->)ident(x)operator([)integer(0)operator(]) operator(=) ident(i)operator(;) - ident(b)operator(->)ident(wds) operator(=) integer(1)operator(;) - reserved(return) ident(b)operator(;) -operator(}) - -directive(static) ident(Bigint) operator(*) -ident(mult)operator(()ident(Bigint) operator(*)ident(a)operator(,) ident(Bigint) operator(*)ident(b)operator(\)) -operator({) - ident(Bigint) operator(*)ident(c)operator(;) - pre_type(int) ident(k)operator(,) ident(wa)operator(,) ident(wb)operator(,) ident(wc)operator(;) - ident(ULong) operator(*)ident(x)operator(,) operator(*)ident(xa)operator(,) operator(*)ident(xae)operator(,) operator(*)ident(xb)operator(,) operator(*)ident(xbe)operator(,) operator(*)ident(xc)operator(,) operator(*)ident(xc0)operator(;) - ident(ULong) ident(y)operator(;) -preprocessor(#ifdef) ident(ULLong) - ident(ULLong) ident(carry)operator(,) ident(z)operator(;) -preprocessor(#else) - ident(ULong) ident(carry)operator(,) ident(z)operator(;) -preprocessor(#ifdef) ident(Pack_32) - ident(ULong) ident(z2)operator(;) -preprocessor(#endif) -preprocessor(#endif) - - reserved(if) operator(()ident(a)operator(->)ident(wds) operator(<) ident(b)operator(->)ident(wds)operator(\)) operator({) - ident(c) operator(=) ident(a)operator(;) - ident(a) operator(=) ident(b)operator(;) - ident(b) operator(=) ident(c)operator(;) - operator(}) - ident(k) operator(=) ident(a)operator(->)ident(k)operator(;) - ident(wa) operator(=) ident(a)operator(->)ident(wds)operator(;) - ident(wb) operator(=) ident(b)operator(->)ident(wds)operator(;) - ident(wc) operator(=) ident(wa) operator(+) ident(wb)operator(;) - reserved(if) operator(()ident(wc) operator(>) ident(a)operator(->)ident(maxwds)operator(\)) - ident(k)operator(++;) - ident(c) operator(=) ident(Balloc)operator(()ident(k)operator(\);) - reserved(for) operator(()ident(x) operator(=) ident(c)operator(->)ident(x)operator(,) ident(xa) operator(=) ident(x) operator(+) ident(wc)operator(;) ident(x) operator(<) ident(xa)operator(;) ident(x)operator(++\)) - operator(*)ident(x) operator(=) integer(0)operator(;) - ident(xa) operator(=) ident(a)operator(->)ident(x)operator(;) - ident(xae) operator(=) ident(xa) operator(+) ident(wa)operator(;) - ident(xb) operator(=) ident(b)operator(->)ident(x)operator(;) - ident(xbe) operator(=) ident(xb) operator(+) ident(wb)operator(;) - ident(xc0) operator(=) ident(c)operator(->)ident(x)operator(;) -preprocessor(#ifdef) ident(ULLong) - reserved(for) operator((;) ident(xb) operator(<) ident(xbe)operator(;) ident(xc0)operator(++\)) operator({) - reserved(if) operator((()ident(y) operator(=) operator(*)ident(xb)operator(++\)) operator(!=) integer(0)operator(\)) operator({) - ident(x) operator(=) ident(xa)operator(;) - ident(xc) operator(=) ident(xc0)operator(;) - ident(carry) operator(=) integer(0)operator(;) - reserved(do) operator({) - ident(z) operator(=) operator(*)ident(x)operator(++) operator(*) operator(()ident(ULLong)operator(\))ident(y) operator(+) operator(*)ident(xc) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(z) operator(>>) integer(32)operator(;) - operator(*)ident(xc)operator(++) operator(=) ident(z) operator(&) ident(FFFFFFFF)operator(;) - operator(}) reserved(while) operator(()ident(x) operator(<) ident(xae)operator(\);) - operator(*)ident(xc) operator(=) ident(carry)operator(;) - operator(}) - operator(}) -preprocessor(#else) -preprocessor(#ifdef) ident(Pack_32) - reserved(for) operator((;) ident(xb) operator(<) ident(xbe)operator(;) ident(xb)operator(++,) ident(xc0)operator(++\)) operator({) - reserved(if) operator(()ident(y) operator(=) operator(*)ident(xb) operator(&) hex(0xffff)operator(\)) operator({) - ident(x) operator(=) ident(xa)operator(;) - ident(xc) operator(=) ident(xc0)operator(;) - ident(carry) operator(=) integer(0)operator(;) - reserved(do) operator({) - ident(z) operator(=) operator((*)ident(x) operator(&) hex(0xffff)operator(\)) operator(*) ident(y) operator(+) operator((*)ident(xc) operator(&) hex(0xffff)operator(\)) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(z) operator(>>) integer(16)operator(;) - ident(z2) operator(=) operator((*)ident(x)operator(++) operator(>>) integer(16)operator(\)) operator(*) ident(y) operator(+) operator((*)ident(xc) operator(>>) integer(16)operator(\)) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(z2) operator(>>) integer(16)operator(;) - ident(Storeinc)operator(()ident(xc)operator(,) ident(z2)operator(,) ident(z)operator(\);) - operator(}) reserved(while) operator(()ident(x) operator(<) ident(xae)operator(\);) - operator(*)ident(xc) operator(=) ident(carry)operator(;) - operator(}) - reserved(if) operator(()ident(y) operator(=) operator(*)ident(xb) operator(>>) integer(16)operator(\)) operator({) - ident(x) operator(=) ident(xa)operator(;) - ident(xc) operator(=) ident(xc0)operator(;) - ident(carry) operator(=) integer(0)operator(;) - ident(z2) operator(=) operator(*)ident(xc)operator(;) - reserved(do) operator({) - ident(z) operator(=) operator((*)ident(x) operator(&) hex(0xffff)operator(\)) operator(*) ident(y) operator(+) operator((*)ident(xc) operator(>>) integer(16)operator(\)) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(z) operator(>>) integer(16)operator(;) - ident(Storeinc)operator(()ident(xc)operator(,) ident(z)operator(,) ident(z2)operator(\);) - ident(z2) operator(=) operator((*)ident(x)operator(++) operator(>>) integer(16)operator(\)) operator(*) ident(y) operator(+) operator((*)ident(xc) operator(&) hex(0xffff)operator(\)) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(z2) operator(>>) integer(16)operator(;) - operator(}) reserved(while) operator(()ident(x) operator(<) ident(xae)operator(\);) - operator(*)ident(xc) operator(=) ident(z2)operator(;) - operator(}) - operator(}) -preprocessor(#else) - reserved(for) operator((;) ident(xb) operator(<) ident(xbe)operator(;) ident(xc0)operator(++\)) operator({) - reserved(if) operator(()ident(y) operator(=) operator(*)ident(xb)operator(++\)) operator({) - ident(x) operator(=) ident(xa)operator(;) - ident(xc) operator(=) ident(xc0)operator(;) - ident(carry) operator(=) integer(0)operator(;) - reserved(do) operator({) - ident(z) operator(=) operator(*)ident(x)operator(++) operator(*) ident(y) operator(+) operator(*)ident(xc) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(z) operator(>>) integer(16)operator(;) - operator(*)ident(xc)operator(++) operator(=) ident(z) operator(&) hex(0xffff)operator(;) - operator(}) reserved(while) operator(()ident(x) operator(<) ident(xae)operator(\);) - operator(*)ident(xc) operator(=) ident(carry)operator(;) - operator(}) - operator(}) -preprocessor(#endif) -preprocessor(#endif) - reserved(for) operator(()ident(xc0) operator(=) ident(c)operator(->)ident(x)operator(,) ident(xc) operator(=) ident(xc0) operator(+) ident(wc)operator(;) ident(wc) operator(>) integer(0) operator(&&) operator(!*--)ident(xc)operator(;) operator(--)ident(wc)operator(\)) operator(;) - ident(c)operator(->)ident(wds) operator(=) ident(wc)operator(;) - reserved(return) ident(c)operator(;) -operator(}) - -directive(static) ident(Bigint) operator(*)ident(p5s)operator(;) - -directive(static) ident(Bigint) operator(*) -ident(pow5mult)operator(()ident(Bigint) operator(*)ident(b)operator(,) pre_type(int) ident(k)operator(\)) -operator({) - ident(Bigint) operator(*)ident(b1)operator(,) operator(*)ident(p5)operator(,) operator(*)ident(p51)operator(;) - pre_type(int) ident(i)operator(;) - directive(static) pre_type(int) ident(p05)operator([)integer(3)operator(]) operator(=) operator({) integer(5)operator(,) integer(25)operator(,) integer(125) operator(};) - - reserved(if) operator((()ident(i) operator(=) ident(k) operator(&) integer(3)operator(\)) operator(!=) integer(0)operator(\)) - ident(b) operator(=) ident(multadd)operator(()ident(b)operator(,) ident(p05)operator([)ident(i)operator(-)integer(1)operator(],) integer(0)operator(\);) - - reserved(if) operator((!()ident(k) operator(>>=) integer(2)operator(\)\)) - reserved(return) ident(b)operator(;) - reserved(if) operator((!()ident(p5) operator(=) ident(p5s)operator(\)\)) operator({) - comment(/* first time */) -preprocessor(#ifdef) ident(MULTIPLE_THREADS) - ident(ACQUIRE_DTOA_LOCK)operator(()integer(1)operator(\);) - reserved(if) operator((!()ident(p5) operator(=) ident(p5s)operator(\)\)) operator({) - ident(p5) operator(=) ident(p5s) operator(=) ident(i2b)operator(()integer(625)operator(\);) - ident(p5)operator(->)ident(next) operator(=) integer(0)operator(;) - operator(}) - ident(FREE_DTOA_LOCK)operator(()integer(1)operator(\);) -preprocessor(#else) - ident(p5) operator(=) ident(p5s) operator(=) ident(i2b)operator(()integer(625)operator(\);) - ident(p5)operator(->)ident(next) operator(=) integer(0)operator(;) -preprocessor(#endif) - operator(}) - reserved(for) operator((;;\)) operator({) - reserved(if) operator(()ident(k) operator(&) integer(1)operator(\)) operator({) - ident(b1) operator(=) ident(mult)operator(()ident(b)operator(,) ident(p5)operator(\);) - ident(Bfree)operator(()ident(b)operator(\);) - ident(b) operator(=) ident(b1)operator(;) - operator(}) - reserved(if) operator((!()ident(k) operator(>>=) integer(1)operator(\)\)) - reserved(break)operator(;) - reserved(if) operator((!()ident(p51) operator(=) ident(p5)operator(->)ident(next)operator(\)\)) operator({) -preprocessor(#ifdef) ident(MULTIPLE_THREADS) - ident(ACQUIRE_DTOA_LOCK)operator(()integer(1)operator(\);) - reserved(if) operator((!()ident(p51) operator(=) ident(p5)operator(->)ident(next)operator(\)\)) operator({) - ident(p51) operator(=) ident(p5)operator(->)ident(next) operator(=) ident(mult)operator(()ident(p5)operator(,)ident(p5)operator(\);) - ident(p51)operator(->)ident(next) operator(=) integer(0)operator(;) - operator(}) - ident(FREE_DTOA_LOCK)operator(()integer(1)operator(\);) -preprocessor(#else) - ident(p51) operator(=) ident(p5)operator(->)ident(next) operator(=) ident(mult)operator(()ident(p5)operator(,)ident(p5)operator(\);) - ident(p51)operator(->)ident(next) operator(=) integer(0)operator(;) -preprocessor(#endif) - operator(}) - ident(p5) operator(=) ident(p51)operator(;) - operator(}) - reserved(return) ident(b)operator(;) -operator(}) - -directive(static) ident(Bigint) operator(*) -ident(lshift)operator(()ident(Bigint) operator(*)ident(b)operator(,) pre_type(int) ident(k)operator(\)) -operator({) - pre_type(int) ident(i)operator(,) ident(k1)operator(,) ident(n)operator(,) ident(n1)operator(;) - ident(Bigint) operator(*)ident(b1)operator(;) - ident(ULong) operator(*)ident(x)operator(,) operator(*)ident(x1)operator(,) operator(*)ident(xe)operator(,) ident(z)operator(;) - -preprocessor(#ifdef) ident(Pack_32) - ident(n) operator(=) ident(k) operator(>>) integer(5)operator(;) -preprocessor(#else) - ident(n) operator(=) ident(k) operator(>>) integer(4)operator(;) -preprocessor(#endif) - ident(k1) operator(=) ident(b)operator(->)ident(k)operator(;) - ident(n1) operator(=) ident(n) operator(+) ident(b)operator(->)ident(wds) operator(+) integer(1)operator(;) - reserved(for) operator(()ident(i) operator(=) ident(b)operator(->)ident(maxwds)operator(;) ident(n1) operator(>) ident(i)operator(;) ident(i) operator(<<=) integer(1)operator(\)) - ident(k1)operator(++;) - ident(b1) operator(=) ident(Balloc)operator(()ident(k1)operator(\);) - ident(x1) operator(=) ident(b1)operator(->)ident(x)operator(;) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(n)operator(;) ident(i)operator(++\)) - operator(*)ident(x1)operator(++) operator(=) integer(0)operator(;) - ident(x) operator(=) ident(b)operator(->)ident(x)operator(;) - ident(xe) operator(=) ident(x) operator(+) ident(b)operator(->)ident(wds)operator(;) -preprocessor(#ifdef) ident(Pack_32) - reserved(if) operator(()ident(k) operator(&=) hex(0x1f)operator(\)) operator({) - ident(k1) operator(=) integer(32) operator(-) ident(k)operator(;) - ident(z) operator(=) integer(0)operator(;) - reserved(do) operator({) - operator(*)ident(x1)operator(++) operator(=) operator(*)ident(x) operator(<<) ident(k) operator(|) ident(z)operator(;) - ident(z) operator(=) operator(*)ident(x)operator(++) operator(>>) ident(k1)operator(;) - operator(}) reserved(while) operator(()ident(x) operator(<) ident(xe)operator(\);) - reserved(if) operator(((*)ident(x1) operator(=) ident(z)operator(\)) operator(!=) integer(0)operator(\)) - operator(++)ident(n1)operator(;) - operator(}) -preprocessor(#else) - reserved(if) operator(()ident(k) operator(&=) hex(0xf)operator(\)) operator({) - ident(k1) operator(=) integer(16) operator(-) ident(k)operator(;) - ident(z) operator(=) integer(0)operator(;) - reserved(do) operator({) - operator(*)ident(x1)operator(++) operator(=) operator(*)ident(x) operator(<<) ident(k) operator(&) hex(0xffff) operator(|) ident(z)operator(;) - ident(z) operator(=) operator(*)ident(x)operator(++) operator(>>) ident(k1)operator(;) - operator(}) reserved(while) operator(()ident(x) operator(<) ident(xe)operator(\);) - reserved(if) operator((*)ident(x1) operator(=) ident(z)operator(\)) - operator(++)ident(n1)operator(;) - operator(}) -preprocessor(#endif) - reserved(else) - reserved(do) operator({) - operator(*)ident(x1)operator(++) operator(=) operator(*)ident(x)operator(++;) - operator(}) reserved(while) operator(()ident(x) operator(<) ident(xe)operator(\);) - ident(b1)operator(->)ident(wds) operator(=) ident(n1) operator(-) integer(1)operator(;) - ident(Bfree)operator(()ident(b)operator(\);) - reserved(return) ident(b1)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(cmp)operator(()ident(Bigint) operator(*)ident(a)operator(,) ident(Bigint) operator(*)ident(b)operator(\)) -operator({) - ident(ULong) operator(*)ident(xa)operator(,) operator(*)ident(xa0)operator(,) operator(*)ident(xb)operator(,) operator(*)ident(xb0)operator(;) - pre_type(int) ident(i)operator(,) ident(j)operator(;) - - ident(i) operator(=) ident(a)operator(->)ident(wds)operator(;) - ident(j) operator(=) ident(b)operator(->)ident(wds)operator(;) -preprocessor(#ifdef) ident(DEBUG) - reserved(if) operator(()ident(i) operator(>) integer(1) operator(&&) operator(!)ident(a)operator(->)ident(x)operator([)ident(i)operator(-)integer(1)operator(]\)) - ident(Bug)operator(()stringx[a->wds-1] == 0)delimiter(")>operator(\);) - reserved(if) operator(()ident(j) operator(>) integer(1) operator(&&) operator(!)ident(b)operator(->)ident(x)operator([)ident(j)operator(-)integer(1)operator(]\)) - ident(Bug)operator(()stringx[b->wds-1] == 0)delimiter(")>operator(\);) -preprocessor(#endif) - reserved(if) operator(()ident(i) operator(-=) ident(j)operator(\)) - reserved(return) ident(i)operator(;) - ident(xa0) operator(=) ident(a)operator(->)ident(x)operator(;) - ident(xa) operator(=) ident(xa0) operator(+) ident(j)operator(;) - ident(xb0) operator(=) ident(b)operator(->)ident(x)operator(;) - ident(xb) operator(=) ident(xb0) operator(+) ident(j)operator(;) - reserved(for) operator((;;\)) operator({) - reserved(if) operator((*--)ident(xa) operator(!=) operator(*--)ident(xb)operator(\)) - reserved(return) operator(*)ident(xa) operator(<) operator(*)ident(xb) operator(?) operator(-)integer(1) operator(:) integer(1)operator(;) - reserved(if) operator(()ident(xa) operator(<=) ident(xa0)operator(\)) - reserved(break)operator(;) - operator(}) - reserved(return) integer(0)operator(;) -operator(}) - -directive(static) ident(Bigint) operator(*) -ident(diff)operator(()ident(Bigint) operator(*)ident(a)operator(,) ident(Bigint) operator(*)ident(b)operator(\)) -operator({) - ident(Bigint) operator(*)ident(c)operator(;) - pre_type(int) ident(i)operator(,) ident(wa)operator(,) ident(wb)operator(;) - ident(ULong) operator(*)ident(xa)operator(,) operator(*)ident(xae)operator(,) operator(*)ident(xb)operator(,) operator(*)ident(xbe)operator(,) operator(*)ident(xc)operator(;) -preprocessor(#ifdef) ident(ULLong) - ident(ULLong) ident(borrow)operator(,) ident(y)operator(;) -preprocessor(#else) - ident(ULong) ident(borrow)operator(,) ident(y)operator(;) -preprocessor(#ifdef) ident(Pack_32) - ident(ULong) ident(z)operator(;) -preprocessor(#endif) -preprocessor(#endif) - - ident(i) operator(=) ident(cmp)operator(()ident(a)operator(,)ident(b)operator(\);) - reserved(if) operator((!)ident(i)operator(\)) operator({) - ident(c) operator(=) ident(Balloc)operator(()integer(0)operator(\);) - ident(c)operator(->)ident(wds) operator(=) integer(1)operator(;) - ident(c)operator(->)ident(x)operator([)integer(0)operator(]) operator(=) integer(0)operator(;) - reserved(return) ident(c)operator(;) - operator(}) - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) operator({) - ident(c) operator(=) ident(a)operator(;) - ident(a) operator(=) ident(b)operator(;) - ident(b) operator(=) ident(c)operator(;) - ident(i) operator(=) integer(1)operator(;) - operator(}) - reserved(else) - ident(i) operator(=) integer(0)operator(;) - ident(c) operator(=) ident(Balloc)operator(()ident(a)operator(->)ident(k)operator(\);) - ident(c)operator(->)ident(sign) operator(=) ident(i)operator(;) - ident(wa) operator(=) ident(a)operator(->)ident(wds)operator(;) - ident(xa) operator(=) ident(a)operator(->)ident(x)operator(;) - ident(xae) operator(=) ident(xa) operator(+) ident(wa)operator(;) - ident(wb) operator(=) ident(b)operator(->)ident(wds)operator(;) - ident(xb) operator(=) ident(b)operator(->)ident(x)operator(;) - ident(xbe) operator(=) ident(xb) operator(+) ident(wb)operator(;) - ident(xc) operator(=) ident(c)operator(->)ident(x)operator(;) - ident(borrow) operator(=) integer(0)operator(;) -preprocessor(#ifdef) ident(ULLong) - reserved(do) operator({) - ident(y) operator(=) operator(()ident(ULLong)operator(\)*)ident(xa)operator(++) operator(-) operator(*)ident(xb)operator(++) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) ident(y) operator(>>) integer(32) operator(&) operator(()ident(ULong)operator(\))integer(1)operator(;) - operator(*)ident(xc)operator(++) operator(=) ident(y) operator(&) ident(FFFFFFFF)operator(;) - operator(}) reserved(while) operator(()ident(xb) operator(<) ident(xbe)operator(\);) - reserved(while) operator(()ident(xa) operator(<) ident(xae)operator(\)) operator({) - ident(y) operator(=) operator(*)ident(xa)operator(++) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) ident(y) operator(>>) integer(32) operator(&) operator(()ident(ULong)operator(\))integer(1)operator(;) - operator(*)ident(xc)operator(++) operator(=) ident(y) operator(&) ident(FFFFFFFF)operator(;) - operator(}) -preprocessor(#else) -preprocessor(#ifdef) ident(Pack_32) - reserved(do) operator({) - ident(y) operator(=) operator((*)ident(xa) operator(&) hex(0xffff)operator(\)) operator(-) operator((*)ident(xb) operator(&) hex(0xffff)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(y) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - ident(z) operator(=) operator((*)ident(xa)operator(++) operator(>>) integer(16)operator(\)) operator(-) operator((*)ident(xb)operator(++) operator(>>) integer(16)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(z) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - ident(Storeinc)operator(()ident(xc)operator(,) ident(z)operator(,) ident(y)operator(\);) - operator(}) reserved(while) operator(()ident(xb) operator(<) ident(xbe)operator(\);) - reserved(while) operator(()ident(xa) operator(<) ident(xae)operator(\)) operator({) - ident(y) operator(=) operator((*)ident(xa) operator(&) hex(0xffff)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(y) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - ident(z) operator(=) operator((*)ident(xa)operator(++) operator(>>) integer(16)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(z) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - ident(Storeinc)operator(()ident(xc)operator(,) ident(z)operator(,) ident(y)operator(\);) - operator(}) -preprocessor(#else) - reserved(do) operator({) - ident(y) operator(=) operator(*)ident(xa)operator(++) operator(-) operator(*)ident(xb)operator(++) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(y) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - operator(*)ident(xc)operator(++) operator(=) ident(y) operator(&) hex(0xffff)operator(;) - operator(}) reserved(while) operator(()ident(xb) operator(<) ident(xbe)operator(\);) - reserved(while) operator(()ident(xa) operator(<) ident(xae)operator(\)) operator({) - ident(y) operator(=) operator(*)ident(xa)operator(++) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(y) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - operator(*)ident(xc)operator(++) operator(=) ident(y) operator(&) hex(0xffff)operator(;) - operator(}) -preprocessor(#endif) -preprocessor(#endif) - reserved(while) operator((!*--)ident(xc)operator(\)) - ident(wa)operator(--;) - ident(c)operator(->)ident(wds) operator(=) ident(wa)operator(;) - reserved(return) ident(c)operator(;) -operator(}) - -directive(static) pre_type(double) -ident(ulp)operator(()pre_type(double) ident(x)operator(\)) -operator({) - directive(register) ident(Long) ident(L)operator(;) - pre_type(double) ident(a)operator(;) - - ident(L) operator(=) operator(()ident(word0)operator(()ident(x)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(-) operator(()ident(P)operator(-)integer(1)operator(\)*)ident(Exp_msk1)operator(;) -preprocessor(#ifndef) ident(Avoid_Underflow) -preprocessor(#ifndef) ident(Sudden_Underflow) - reserved(if) operator(()ident(L) operator(>) integer(0)operator(\)) operator({) -preprocessor(#endif) -preprocessor(#endif) -preprocessor(#ifdef) ident(IBM) - ident(L) operator(|=) ident(Exp_msk1) operator(>>) integer(4)operator(;) -preprocessor(#endif) - ident(word0)operator(()ident(a)operator(\)) operator(=) ident(L)operator(;) - ident(word1)operator(()ident(a)operator(\)) operator(=) integer(0)operator(;) -preprocessor(#ifndef) ident(Avoid_Underflow) -preprocessor(#ifndef) ident(Sudden_Underflow) - operator(}) - reserved(else) operator({) - ident(L) operator(=) operator(-)ident(L) operator(>>) ident(Exp_shift)operator(;) - reserved(if) operator(()ident(L) operator(<) ident(Exp_shift)operator(\)) operator({) - ident(word0)operator(()ident(a)operator(\)) operator(=) hex(0x80000) operator(>>) ident(L)operator(;) - ident(word1)operator(()ident(a)operator(\)) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(word0)operator(()ident(a)operator(\)) operator(=) integer(0)operator(;) - ident(L) operator(-=) ident(Exp_shift)operator(;) - ident(word1)operator(()ident(a)operator(\)) operator(=) ident(L) operator(>=) integer(31) operator(?) integer(1) operator(:) integer(1) operator(<<) integer(31) operator(-) ident(L)operator(;) - operator(}) - operator(}) -preprocessor(#endif) -preprocessor(#endif) - reserved(return) ident(dval)operator(()ident(a)operator(\);) -operator(}) - -directive(static) pre_type(double) -ident(b2d)operator(()ident(Bigint) operator(*)ident(a)operator(,) pre_type(int) operator(*)ident(e)operator(\)) -operator({) - ident(ULong) operator(*)ident(xa)operator(,) operator(*)ident(xa0)operator(,) ident(w)operator(,) ident(y)operator(,) ident(z)operator(;) - pre_type(int) ident(k)operator(;) - pre_type(double) ident(d)operator(;) -preprocessor(#ifdef) ident(VAX) - ident(ULong) ident(d0)operator(,) ident(d1)operator(;) -preprocessor(#else) -preprocessor(#define) ident(d0) ident(word0)operator(()ident(d)operator(\)) -preprocessor(#define) ident(d1) ident(word1)operator(()ident(d)operator(\)) -preprocessor(#endif) - - ident(xa0) operator(=) ident(a)operator(->)ident(x)operator(;) - ident(xa) operator(=) ident(xa0) operator(+) ident(a)operator(->)ident(wds)operator(;) - ident(y) operator(=) operator(*--)ident(xa)operator(;) -preprocessor(#ifdef) ident(DEBUG) - reserved(if) operator((!)ident(y)operator(\)) ident(Bug)operator(()stringoperator(\);) -preprocessor(#endif) - ident(k) operator(=) ident(hi0bits)operator(()ident(y)operator(\);) - operator(*)ident(e) operator(=) integer(32) operator(-) ident(k)operator(;) -preprocessor(#ifdef) ident(Pack_32) - reserved(if) operator(()ident(k) operator(<) ident(Ebits)operator(\)) operator({) - ident(d0) operator(=) ident(Exp_1) operator(|) ident(y) operator(>>) operator(()ident(Ebits) operator(-) ident(k)operator(\);) - ident(w) operator(=) ident(xa) operator(>) ident(xa0) operator(?) operator(*--)ident(xa) operator(:) integer(0)operator(;) - ident(d1) operator(=) ident(y) operator(<<) operator((()integer(32)operator(-)ident(Ebits)operator(\)) operator(+) ident(k)operator(\)) operator(|) ident(w) operator(>>) operator(()ident(Ebits) operator(-) ident(k)operator(\);) - reserved(goto) ident(ret_d)operator(;) - operator(}) - ident(z) operator(=) ident(xa) operator(>) ident(xa0) operator(?) operator(*--)ident(xa) operator(:) integer(0)operator(;) - reserved(if) operator(()ident(k) operator(-=) ident(Ebits)operator(\)) operator({) - ident(d0) operator(=) ident(Exp_1) operator(|) ident(y) operator(<<) ident(k) operator(|) ident(z) operator(>>) operator(()integer(32) operator(-) ident(k)operator(\);) - ident(y) operator(=) ident(xa) operator(>) ident(xa0) operator(?) operator(*--)ident(xa) operator(:) integer(0)operator(;) - ident(d1) operator(=) ident(z) operator(<<) ident(k) operator(|) ident(y) operator(>>) operator(()integer(32) operator(-) ident(k)operator(\);) - operator(}) - reserved(else) operator({) - ident(d0) operator(=) ident(Exp_1) operator(|) ident(y)operator(;) - ident(d1) operator(=) ident(z)operator(;) - operator(}) -preprocessor(#else) - reserved(if) operator(()ident(k) operator(<) ident(Ebits) operator(+) integer(16)operator(\)) operator({) - ident(z) operator(=) ident(xa) operator(>) ident(xa0) operator(?) operator(*--)ident(xa) operator(:) integer(0)operator(;) - ident(d0) operator(=) ident(Exp_1) operator(|) ident(y) operator(<<) ident(k) operator(-) ident(Ebits) operator(|) ident(z) operator(>>) ident(Ebits) operator(+) integer(16) operator(-) ident(k)operator(;) - ident(w) operator(=) ident(xa) operator(>) ident(xa0) operator(?) operator(*--)ident(xa) operator(:) integer(0)operator(;) - ident(y) operator(=) ident(xa) operator(>) ident(xa0) operator(?) operator(*--)ident(xa) operator(:) integer(0)operator(;) - ident(d1) operator(=) ident(z) operator(<<) ident(k) operator(+) integer(16) operator(-) ident(Ebits) operator(|) ident(w) operator(<<) ident(k) operator(-) ident(Ebits) operator(|) ident(y) operator(>>) integer(16) operator(+) ident(Ebits) operator(-) ident(k)operator(;) - reserved(goto) ident(ret_d)operator(;) - operator(}) - ident(z) operator(=) ident(xa) operator(>) ident(xa0) operator(?) operator(*--)ident(xa) operator(:) integer(0)operator(;) - ident(w) operator(=) ident(xa) operator(>) ident(xa0) operator(?) operator(*--)ident(xa) operator(:) integer(0)operator(;) - ident(k) operator(-=) ident(Ebits) operator(+) integer(16)operator(;) - ident(d0) operator(=) ident(Exp_1) operator(|) ident(y) operator(<<) ident(k) operator(+) integer(16) operator(|) ident(z) operator(<<) ident(k) operator(|) ident(w) operator(>>) integer(16) operator(-) ident(k)operator(;) - ident(y) operator(=) ident(xa) operator(>) ident(xa0) operator(?) operator(*--)ident(xa) operator(:) integer(0)operator(;) - ident(d1) operator(=) ident(w) operator(<<) ident(k) operator(+) integer(16) operator(|) ident(y) operator(<<) ident(k)operator(;) -preprocessor(#endif) -label(ret_d:) -preprocessor(#ifdef) ident(VAX) - ident(word0)operator(()ident(d)operator(\)) operator(=) ident(d0) operator(>>) integer(16) operator(|) ident(d0) operator(<<) integer(16)operator(;) - ident(word1)operator(()ident(d)operator(\)) operator(=) ident(d1) operator(>>) integer(16) operator(|) ident(d1) operator(<<) integer(16)operator(;) -preprocessor(#else) -preprocessor(#undef) ident(d0) -preprocessor(#undef) ident(d1) -preprocessor(#endif) - reserved(return) ident(dval)operator(()ident(d)operator(\);) -operator(}) - -directive(static) ident(Bigint) operator(*) -ident(d2b)operator(()pre_type(double) ident(d)operator(,) pre_type(int) operator(*)ident(e)operator(,) pre_type(int) operator(*)ident(bits)operator(\)) -operator({) - ident(Bigint) operator(*)ident(b)operator(;) - pre_type(int) ident(de)operator(,) ident(k)operator(;) - ident(ULong) operator(*)ident(x)operator(,) ident(y)operator(,) ident(z)operator(;) -preprocessor(#ifndef) ident(Sudden_Underflow) - pre_type(int) ident(i)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(VAX) - ident(ULong) ident(d0)operator(,) ident(d1)operator(;) - ident(d0) operator(=) ident(word0)operator(()ident(d)operator(\)) operator(>>) integer(16) operator(|) ident(word0)operator(()ident(d)operator(\)) operator(<<) integer(16)operator(;) - ident(d1) operator(=) ident(word1)operator(()ident(d)operator(\)) operator(>>) integer(16) operator(|) ident(word1)operator(()ident(d)operator(\)) operator(<<) integer(16)operator(;) -preprocessor(#else) -preprocessor(#define) ident(d0) ident(word0)operator(()ident(d)operator(\)) -preprocessor(#define) ident(d1) ident(word1)operator(()ident(d)operator(\)) -preprocessor(#endif) - -preprocessor(#ifdef) ident(Pack_32) - ident(b) operator(=) ident(Balloc)operator(()integer(1)operator(\);) -preprocessor(#else) - ident(b) operator(=) ident(Balloc)operator(()integer(2)operator(\);) -preprocessor(#endif) - ident(x) operator(=) ident(b)operator(->)ident(x)operator(;) - - ident(z) operator(=) ident(d0) operator(&) ident(Frac_mask)operator(;) - ident(d0) operator(&=) hex(0x7fffffff)operator(;) comment(/* clear sign bit, which we ignore */) -preprocessor(#ifdef) ident(Sudden_Underflow) - ident(de) operator(=) operator(()pre_type(int)operator(\)()ident(d0) operator(>>) ident(Exp_shift)operator(\);) -preprocessor(#ifndef) ident(IBM) - ident(z) operator(|=) ident(Exp_msk11)operator(;) -preprocessor(#endif) -preprocessor(#else) - reserved(if) operator((()ident(de) operator(=) operator(()pre_type(int)operator(\)()ident(d0) operator(>>) ident(Exp_shift)operator(\)\)) operator(!=) integer(0)operator(\)) - ident(z) operator(|=) ident(Exp_msk1)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(Pack_32) - reserved(if) operator((()ident(y) operator(=) ident(d1)operator(\)) operator(!=) integer(0)operator(\)) operator({) - reserved(if) operator((()ident(k) operator(=) ident(lo0bits)operator((&)ident(y)operator(\)\)) operator(!=) integer(0)operator(\)) operator({) - ident(x)operator([)integer(0)operator(]) operator(=) ident(y) operator(|) ident(z) operator(<<) operator(()integer(32) operator(-) ident(k)operator(\);) - ident(z) operator(>>=) ident(k)operator(;) - operator(}) - reserved(else) - ident(x)operator([)integer(0)operator(]) operator(=) ident(y)operator(;) -preprocessor(#ifndef) ident(Sudden_Underflow) - ident(i) operator(=) -preprocessor(#endif) - ident(b)operator(->)ident(wds) operator(=) operator(()ident(x)operator([)integer(1)operator(]) operator(=) ident(z)operator(\)) operator(?) integer(2) operator(:) integer(1)operator(;) - operator(}) - reserved(else) operator({) -preprocessor(#ifdef) ident(DEBUG) - reserved(if) operator((!)ident(z)operator(\)) - ident(Bug)operator(()stringoperator(\);) -preprocessor(#endif) - ident(k) operator(=) ident(lo0bits)operator((&)ident(z)operator(\);) - ident(x)operator([)integer(0)operator(]) operator(=) ident(z)operator(;) -preprocessor(#ifndef) ident(Sudden_Underflow) - ident(i) operator(=) -preprocessor(#endif) - ident(b)operator(->)ident(wds) operator(=) integer(1)operator(;) - ident(k) operator(+=) integer(32)operator(;) - operator(}) -preprocessor(#else) - reserved(if) operator(()ident(y) operator(=) ident(d1)operator(\)) operator({) - reserved(if) operator(()ident(k) operator(=) ident(lo0bits)operator((&)ident(y)operator(\)\)) - reserved(if) operator(()ident(k) operator(>=) integer(16)operator(\)) operator({) - ident(x)operator([)integer(0)operator(]) operator(=) ident(y) operator(|) ident(z) operator(<<) integer(32) operator(-) ident(k) operator(&) hex(0xffff)operator(;) - ident(x)operator([)integer(1)operator(]) operator(=) ident(z) operator(>>) ident(k) operator(-) integer(16) operator(&) hex(0xffff)operator(;) - ident(x)operator([)integer(2)operator(]) operator(=) ident(z) operator(>>) ident(k)operator(;) - ident(i) operator(=) integer(2)operator(;) - operator(}) - reserved(else) operator({) - ident(x)operator([)integer(0)operator(]) operator(=) ident(y) operator(&) hex(0xffff)operator(;) - ident(x)operator([)integer(1)operator(]) operator(=) ident(y) operator(>>) integer(16) operator(|) ident(z) operator(<<) integer(16) operator(-) ident(k) operator(&) hex(0xffff)operator(;) - ident(x)operator([)integer(2)operator(]) operator(=) ident(z) operator(>>) ident(k) operator(&) hex(0xffff)operator(;) - ident(x)operator([)integer(3)operator(]) operator(=) ident(z) operator(>>) ident(k)operator(+)integer(16)operator(;) - ident(i) operator(=) integer(3)operator(;) - operator(}) - reserved(else) operator({) - ident(x)operator([)integer(0)operator(]) operator(=) ident(y) operator(&) hex(0xffff)operator(;) - ident(x)operator([)integer(1)operator(]) operator(=) ident(y) operator(>>) integer(16)operator(;) - ident(x)operator([)integer(2)operator(]) operator(=) ident(z) operator(&) hex(0xffff)operator(;) - ident(x)operator([)integer(3)operator(]) operator(=) ident(z) operator(>>) integer(16)operator(;) - ident(i) operator(=) integer(3)operator(;) - operator(}) - operator(}) - reserved(else) operator({) -preprocessor(#ifdef) ident(DEBUG) - reserved(if) operator((!)ident(z)operator(\)) - ident(Bug)operator(()stringoperator(\);) -preprocessor(#endif) - ident(k) operator(=) ident(lo0bits)operator((&)ident(z)operator(\);) - reserved(if) operator(()ident(k) operator(>=) integer(16)operator(\)) operator({) - ident(x)operator([)integer(0)operator(]) operator(=) ident(z)operator(;) - ident(i) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - ident(x)operator([)integer(0)operator(]) operator(=) ident(z) operator(&) hex(0xffff)operator(;) - ident(x)operator([)integer(1)operator(]) operator(=) ident(z) operator(>>) integer(16)operator(;) - ident(i) operator(=) integer(1)operator(;) - operator(}) - ident(k) operator(+=) integer(32)operator(;) - operator(}) - reserved(while) operator((!)ident(x)operator([)ident(i)operator(]\)) - operator(--)ident(i)operator(;) - ident(b)operator(->)ident(wds) operator(=) ident(i) operator(+) integer(1)operator(;) -preprocessor(#endif) -preprocessor(#ifndef) ident(Sudden_Underflow) - reserved(if) operator(()ident(de)operator(\)) operator({) -preprocessor(#endif) -preprocessor(#ifdef) ident(IBM) - operator(*)ident(e) operator(=) operator(()ident(de) operator(-) ident(Bias) operator(-) operator(()ident(P)operator(-)integer(1)operator(\)) operator(<<) integer(2)operator(\)) operator(+) ident(k)operator(;) - operator(*)ident(bits) operator(=) integer(4)operator(*)ident(P) operator(+) integer(8) operator(-) ident(k) operator(-) ident(hi0bits)operator(()ident(word0)operator(()ident(d)operator(\)) operator(&) ident(Frac_mask)operator(\);) -preprocessor(#else) - operator(*)ident(e) operator(=) ident(de) operator(-) ident(Bias) operator(-) operator(()ident(P)operator(-)integer(1)operator(\)) operator(+) ident(k)operator(;) - operator(*)ident(bits) operator(=) ident(P) operator(-) ident(k)operator(;) -preprocessor(#endif) -preprocessor(#ifndef) ident(Sudden_Underflow) - operator(}) - reserved(else) operator({) - operator(*)ident(e) operator(=) ident(de) operator(-) ident(Bias) operator(-) operator(()ident(P)operator(-)integer(1)operator(\)) operator(+) integer(1) operator(+) ident(k)operator(;) -preprocessor(#ifdef) ident(Pack_32) - operator(*)ident(bits) operator(=) integer(32)operator(*)ident(i) operator(-) ident(hi0bits)operator(()ident(x)operator([)ident(i)operator(-)integer(1)operator(]\);) -preprocessor(#else) - operator(*)ident(bits) operator(=) operator(()ident(i)operator(+)integer(2)operator(\)*)integer(16) operator(-) ident(hi0bits)operator(()ident(x)operator([)ident(i)operator(]\);) -preprocessor(#endif) - operator(}) -preprocessor(#endif) - reserved(return) ident(b)operator(;) -operator(}) -preprocessor(#undef) ident(d0) -preprocessor(#undef) ident(d1) - -directive(static) pre_type(double) -ident(ratio)operator(()ident(Bigint) operator(*)ident(a)operator(,) ident(Bigint) operator(*)ident(b)operator(\)) -operator({) - pre_type(double) ident(da)operator(,) ident(db)operator(;) - pre_type(int) ident(k)operator(,) ident(ka)operator(,) ident(kb)operator(;) - - ident(dval)operator(()ident(da)operator(\)) operator(=) ident(b2d)operator(()ident(a)operator(,) operator(&)ident(ka)operator(\);) - ident(dval)operator(()ident(db)operator(\)) operator(=) ident(b2d)operator(()ident(b)operator(,) operator(&)ident(kb)operator(\);) -preprocessor(#ifdef) ident(Pack_32) - ident(k) operator(=) ident(ka) operator(-) ident(kb) operator(+) integer(32)operator(*()ident(a)operator(->)ident(wds) operator(-) ident(b)operator(->)ident(wds)operator(\);) -preprocessor(#else) - ident(k) operator(=) ident(ka) operator(-) ident(kb) operator(+) integer(16)operator(*()ident(a)operator(->)ident(wds) operator(-) ident(b)operator(->)ident(wds)operator(\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(IBM) - reserved(if) operator(()ident(k) operator(>) integer(0)operator(\)) operator({) - ident(word0)operator(()ident(da)operator(\)) operator(+=) operator(()ident(k) operator(>>) integer(2)operator(\)*)ident(Exp_msk1)operator(;) - reserved(if) operator(()ident(k) operator(&=) integer(3)operator(\)) - ident(dval)operator(()ident(da)operator(\)) operator(*=) integer(1) operator(<<) ident(k)operator(;) - operator(}) - reserved(else) operator({) - ident(k) operator(=) operator(-)ident(k)operator(;) - ident(word0)operator(()ident(db)operator(\)) operator(+=) operator(()ident(k) operator(>>) integer(2)operator(\)*)ident(Exp_msk1)operator(;) - reserved(if) operator(()ident(k) operator(&=) integer(3)operator(\)) - ident(dval)operator(()ident(db)operator(\)) operator(*=) integer(1) operator(<<) ident(k)operator(;) - operator(}) -preprocessor(#else) - reserved(if) operator(()ident(k) operator(>) integer(0)operator(\)) - ident(word0)operator(()ident(da)operator(\)) operator(+=) ident(k)operator(*)ident(Exp_msk1)operator(;) - reserved(else) operator({) - ident(k) operator(=) operator(-)ident(k)operator(;) - ident(word0)operator(()ident(db)operator(\)) operator(+=) ident(k)operator(*)ident(Exp_msk1)operator(;) - operator(}) -preprocessor(#endif) - reserved(return) ident(dval)operator(()ident(da)operator(\)) operator(/) ident(dval)operator(()ident(db)operator(\);) -operator(}) - -directive(static) directive(const) pre_type(double) -ident(tens)operator([]) operator(=) operator({) - float(1)ident(e0)operator(,) float(1)ident(e1)operator(,) float(1)ident(e2)operator(,) float(1)ident(e3)operator(,) float(1)ident(e4)operator(,) float(1)ident(e5)operator(,) float(1)ident(e6)operator(,) float(1)ident(e7)operator(,) float(1)ident(e8)operator(,) float(1)ident(e9)operator(,) - float(1)ident(e10)operator(,) float(1)ident(e11)operator(,) float(1)ident(e12)operator(,) float(1)ident(e13)operator(,) float(1)ident(e14)operator(,) float(1)ident(e15)operator(,) float(1)ident(e16)operator(,) float(1)ident(e17)operator(,) float(1)ident(e18)operator(,) float(1)ident(e19)operator(,) - float(1)ident(e20)operator(,) float(1)ident(e21)operator(,) float(1)ident(e22) -preprocessor(#ifdef) ident(VAX) - operator(,) float(1)ident(e23)operator(,) float(1)ident(e24) -preprocessor(#endif) -operator(};) - -directive(static) directive(const) pre_type(double) -preprocessor(#ifdef) ident(IEEE_Arith) -ident(bigtens)operator([]) operator(=) operator({) float(1)ident(e16)operator(,) float(1)ident(e32)operator(,) float(1)ident(e64)operator(,) float(1)ident(e128)operator(,) float(1)ident(e256) operator(};) -directive(static) directive(const) pre_type(double) ident(tinytens)operator([]) operator(=) operator({) float(1)ident(e)operator(-)integer(16)operator(,) float(1)ident(e)operator(-)integer(32)operator(,) float(1)ident(e)operator(-)integer(64)operator(,) float(1)ident(e)operator(-)integer(128)operator(,) -preprocessor(#ifdef) ident(Avoid_Underflow) - integer(900719925474099)float(2)operator(.)operator(*)integer(900719925474099)float(2)operator(.)ident(e)operator(-)integer(256) - comment(/* = 2^106 * 1e-53 */) -preprocessor(#else) - float(1)ident(e)operator(-)integer(256) -preprocessor(#endif) -operator(};) -comment(/* The factor of 2^53 in tinytens[4] helps us avoid setting the underflow */) -comment(/* flag unnecessarily. It leads to a song and dance at the end of strtod. */) -preprocessor(#define) ident(Scale_Bit) hex(0x10) -preprocessor(#define) ident(n_bigtens) integer(5) -preprocessor(#else) -preprocessor(#ifdef) ident(IBM) -ident(bigtens)operator([]) operator(=) operator({) float(1)ident(e16)operator(,) float(1)ident(e32)operator(,) float(1)ident(e64) operator(};) -directive(static) directive(const) pre_type(double) ident(tinytens)operator([]) operator(=) operator({) float(1)ident(e)operator(-)integer(16)operator(,) float(1)ident(e)operator(-)integer(32)operator(,) float(1)ident(e)operator(-)integer(64) operator(};) -preprocessor(#define) ident(n_bigtens) integer(3) -preprocessor(#else) -ident(bigtens)operator([]) operator(=) operator({) float(1)ident(e16)operator(,) float(1)ident(e32) operator(};) -directive(static) directive(const) pre_type(double) ident(tinytens)operator([]) operator(=) operator({) float(1)ident(e)operator(-)integer(16)operator(,) float(1)ident(e)operator(-)integer(32) operator(};) -preprocessor(#define) ident(n_bigtens) integer(2) -preprocessor(#endif) -preprocessor(#endif) - -preprocessor(#ifndef) ident(IEEE_Arith) -preprocessor(#undef) ident(INFNAN_CHECK) -preprocessor(#endif) - -preprocessor(#ifdef) ident(INFNAN_CHECK) - -preprocessor(#ifndef) ident(NAN_WORD0) -preprocessor(#define) ident(NAN_WORD0) hex(0x7ff80000) -preprocessor(#endif) - -preprocessor(#ifndef) ident(NAN_WORD1) -preprocessor(#define) ident(NAN_WORD1) integer(0) -preprocessor(#endif) - -directive(static) pre_type(int) -ident(match)operator(()directive(const) pre_type(char) operator(**)ident(sp)operator(,) pre_type(char) operator(*)ident(t)operator(\)) -operator({) - pre_type(int) ident(c)operator(,) ident(d)operator(;) - directive(const) pre_type(char) operator(*)ident(s) operator(=) operator(*)ident(sp)operator(;) - - reserved(while) operator(()ident(d) operator(=) operator(*)ident(t)operator(++\)) operator({) - reserved(if) operator((()ident(c) operator(=) operator(*++)ident(s)operator(\)) operator(>=) char('A') operator(&&) ident(c) operator(<=) char('Z')operator(\)) - ident(c) operator(+=) char('a') operator(-) char('A')operator(;) - reserved(if) operator(()ident(c) operator(!=) ident(d)operator(\)) - reserved(return) integer(0)operator(;) - operator(}) - operator(*)ident(sp) operator(=) ident(s) operator(+) integer(1)operator(;) - reserved(return) integer(1)operator(;) -operator(}) - -preprocessor(#ifndef) ident(No_Hex_NaN) -directive(static) directive(void) -ident(hexnan)operator(()pre_type(double) operator(*)ident(rvp)operator(,) directive(const) pre_type(char) operator(**)ident(sp)operator(\)) -operator({) - ident(ULong) ident(c)operator(,) ident(x)operator([)integer(2)operator(];) - directive(const) pre_type(char) operator(*)ident(s)operator(;) - pre_type(int) ident(havedig)operator(,) ident(udx0)operator(,) ident(xshift)operator(;) - - ident(x)operator([)integer(0)operator(]) operator(=) ident(x)operator([)integer(1)operator(]) operator(=) integer(0)operator(;) - ident(havedig) operator(=) ident(xshift) operator(=) integer(0)operator(;) - ident(udx0) operator(=) integer(1)operator(;) - ident(s) operator(=) operator(*)ident(sp)operator(;) - reserved(while) operator(()ident(c) operator(=) operator(*()directive(const) pre_type(unsigned) pre_type(char)operator(*\)++)ident(s)operator(\)) operator({) - reserved(if) operator(()ident(c) operator(>=) char('0') operator(&&) ident(c) operator(<=) char('9')operator(\)) - ident(c) operator(-=) char('0')operator(;) - reserved(else) reserved(if) operator(()ident(c) operator(>=) char('a') operator(&&) ident(c) operator(<=) char('f')operator(\)) - ident(c) operator(+=) integer(10) operator(-) char('a')operator(;) - reserved(else) reserved(if) operator(()ident(c) operator(>=) char('A') operator(&&) ident(c) operator(<=) char('F')operator(\)) - ident(c) operator(+=) integer(10) operator(-) char('A')operator(;) - reserved(else) reserved(if) operator(()ident(c) operator(<=) char(' ')operator(\)) operator({) - reserved(if) operator(()ident(udx0) operator(&&) ident(havedig)operator(\)) operator({) - ident(udx0) operator(=) integer(0)operator(;) - ident(xshift) operator(=) integer(1)operator(;) - operator(}) - reserved(continue)operator(;) - operator(}) - reserved(else) reserved(if) operator(()comment(/*(*/) ident(c) operator(==) char('\)') operator(&&) ident(havedig)operator(\)) operator({) - operator(*)ident(sp) operator(=) ident(s) operator(+) integer(1)operator(;) - reserved(break)operator(;) - operator(}) - reserved(else) - reserved(return)operator(;) comment(/* invalid form: don't change *sp */) - ident(havedig) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(xshift)operator(\)) operator({) - ident(xshift) operator(=) integer(0)operator(;) - ident(x)operator([)integer(0)operator(]) operator(=) ident(x)operator([)integer(1)operator(];) - ident(x)operator([)integer(1)operator(]) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(udx0)operator(\)) - ident(x)operator([)integer(0)operator(]) operator(=) operator(()ident(x)operator([)integer(0)operator(]) operator(<<) integer(4)operator(\)) operator(|) operator(()ident(x)operator([)integer(1)operator(]) operator(>>) integer(28)operator(\);) - ident(x)operator([)integer(1)operator(]) operator(=) operator(()ident(x)operator([)integer(1)operator(]) operator(<<) integer(4)operator(\)) operator(|) ident(c)operator(;) - operator(}) - reserved(if) operator((()ident(x)operator([)integer(0)operator(]) operator(&=) hex(0xfffff)operator(\)) operator(||) ident(x)operator([)integer(1)operator(]\)) operator({) - ident(word0)operator((*)ident(rvp)operator(\)) operator(=) ident(Exp_mask) operator(|) ident(x)operator([)integer(0)operator(];) - ident(word1)operator((*)ident(rvp)operator(\)) operator(=) ident(x)operator([)integer(1)operator(];) - operator(}) -operator(}) -preprocessor(#endif) comment(/*No_Hex_NaN*/) -preprocessor(#endif) comment(/* INFNAN_CHECK */) - -pre_type(double) -ident(ruby_strtod)operator(()directive(const) pre_type(char) operator(*)ident(s00)operator(,) pre_type(char) operator(**)ident(se)operator(\)) -operator({) -preprocessor(#ifdef) ident(Avoid_Underflow) - pre_type(int) ident(scale)operator(;) -preprocessor(#endif) - pre_type(int) ident(bb2)operator(,) ident(bb5)operator(,) ident(bbe)operator(,) ident(bd2)operator(,) ident(bd5)operator(,) ident(bbbits)operator(,) ident(bs2)operator(,) ident(c)operator(,) ident(dsign)operator(,) - ident(e)operator(,) ident(e1)operator(,) ident(esign)operator(,) ident(i)operator(,) ident(j)operator(,) ident(k)operator(,) ident(nd)operator(,) ident(nd0)operator(,) ident(nf)operator(,) ident(nz)operator(,) ident(nz0)operator(,) ident(sign)operator(;) - directive(const) pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(s0)operator(,) operator(*)ident(s1)operator(;) - pre_type(double) ident(aadj)operator(,) ident(aadj1)operator(,) ident(adj)operator(,) ident(rv)operator(,) ident(rv0)operator(;) - ident(Long) ident(L)operator(;) - ident(ULong) ident(y)operator(,) ident(z)operator(;) - ident(Bigint) operator(*)ident(bb)operator(,) operator(*)ident(bb1)operator(,) operator(*)ident(bd)operator(,) operator(*)ident(bd0)operator(,) operator(*)ident(bs)operator(,) operator(*)ident(delta)operator(;) -preprocessor(#ifdef) ident(SET_INEXACT) - pre_type(int) ident(inexact)operator(,) ident(oldinexact)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - pre_type(int) ident(rounding)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(USE_LOCALE) - directive(const) pre_type(char) operator(*)ident(s2)operator(;) -preprocessor(#endif) - - ident(sign) operator(=) ident(nz0) operator(=) ident(nz) operator(=) integer(0)operator(;) - ident(dval)operator(()ident(rv)operator(\)) operator(=) float(0)operator(.)operator(;) - reserved(for) operator(()ident(s) operator(=) ident(s00)operator(;;)ident(s)operator(++\)) - reserved(switch) operator((*)ident(s)operator(\)) operator({) - reserved(case) char('-')operator(:) - ident(sign) operator(=) integer(1)operator(;) - comment(/* no break */) - reserved(case) char('+')operator(:) - reserved(if) operator((*++)ident(s)operator(\)) - reserved(goto) ident(break2)operator(;) - comment(/* no break */) - reserved(case) integer(0)operator(:) - reserved(goto) ident(ret0)operator(;) - reserved(case) char('\\t')operator(:) - reserved(case) char('\\n')operator(:) - reserved(case) char('\\v')operator(:) - reserved(case) char('\\f')operator(:) - reserved(case) char('\\r')operator(:) - reserved(case) char(' ')operator(:) - reserved(continue)operator(;) - reserved(default)operator(:) - reserved(goto) ident(break2)operator(;) - operator(}) -label(break2:) - reserved(if) operator((*)ident(s) operator(==) char('0')operator(\)) operator({) - ident(nz0) operator(=) integer(1)operator(;) - reserved(while) operator((*++)ident(s) operator(==) char('0')operator(\)) operator(;) - reserved(if) operator((!*)ident(s)operator(\)) - reserved(goto) ident(ret)operator(;) - operator(}) - ident(s0) operator(=) ident(s)operator(;) - ident(y) operator(=) ident(z) operator(=) integer(0)operator(;) - reserved(for) operator(()ident(nd) operator(=) ident(nf) operator(=) integer(0)operator(;) operator(()ident(c) operator(=) operator(*)ident(s)operator(\)) operator(>=) char('0') operator(&&) ident(c) operator(<=) char('9')operator(;) ident(nd)operator(++,) ident(s)operator(++\)) - reserved(if) operator(()ident(nd) operator(<) integer(9)operator(\)) - ident(y) operator(=) integer(10)operator(*)ident(y) operator(+) ident(c) operator(-) char('0')operator(;) - reserved(else) reserved(if) operator(()ident(nd) operator(<) integer(16)operator(\)) - ident(z) operator(=) integer(10)operator(*)ident(z) operator(+) ident(c) operator(-) char('0')operator(;) - ident(nd0) operator(=) ident(nd)operator(;) -preprocessor(#ifdef) ident(USE_LOCALE) - ident(s1) operator(=) ident(localeconv)operator((\)->)ident(decimal_point)operator(;) - reserved(if) operator(()ident(c) operator(==) operator(*)ident(s1)operator(\)) operator({) - ident(c) operator(=) char('.')operator(;) - reserved(if) operator((*++)ident(s1)operator(\)) operator({) - ident(s2) operator(=) ident(s)operator(;) - reserved(for) operator((;;\)) operator({) - reserved(if) operator((*++)ident(s2) operator(!=) operator(*)ident(s1)operator(\)) operator({) - ident(c) operator(=) integer(0)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator((!*++)ident(s1)operator(\)) operator({) - ident(s) operator(=) ident(s2)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - operator(}) - operator(}) -preprocessor(#endif) - reserved(if) operator(()ident(c) operator(==) char('.')operator(\)) operator({) - reserved(if) operator((!)ident(ISDIGIT)operator(()ident(s)operator([)integer(1)operator(]\)\)) - reserved(goto) ident(dig_done)operator(;) - ident(c) operator(=) operator(*++)ident(s)operator(;) - reserved(if) operator((!)ident(nd)operator(\)) operator({) - reserved(for) operator((;) ident(c) operator(==) char('0')operator(;) ident(c) operator(=) operator(*++)ident(s)operator(\)) - ident(nz)operator(++;) - reserved(if) operator(()ident(c) operator(>) char('0') operator(&&) ident(c) operator(<=) char('9')operator(\)) operator({) - ident(s0) operator(=) ident(s)operator(;) - ident(nf) operator(+=) ident(nz)operator(;) - ident(nz) operator(=) integer(0)operator(;) - reserved(goto) ident(have_dig)operator(;) - operator(}) - reserved(goto) ident(dig_done)operator(;) - operator(}) - reserved(for) operator((;) ident(c) operator(>=) char('0') operator(&&) ident(c) operator(<=) char('9')operator(;) ident(c) operator(=) operator(*++)ident(s)operator(\)) operator({) -label(have_dig:) - ident(nz)operator(++;) - reserved(if) operator(()ident(c) operator(-=) char('0')operator(\)) operator({) - ident(nf) operator(+=) ident(nz)operator(;) - reserved(for) operator(()ident(i) operator(=) integer(1)operator(;) ident(i) operator(<) ident(nz)operator(;) ident(i)operator(++\)) - reserved(if) operator(()ident(nd)operator(++) operator(<) integer(9)operator(\)) - ident(y) operator(*=) integer(10)operator(;) - reserved(else) reserved(if) operator(()ident(nd) operator(<=) ident(DBL_DIG) operator(+) integer(1)operator(\)) - ident(z) operator(*=) integer(10)operator(;) - reserved(if) operator(()ident(nd)operator(++) operator(<) integer(9)operator(\)) - ident(y) operator(=) integer(10)operator(*)ident(y) operator(+) ident(c)operator(;) - reserved(else) reserved(if) operator(()ident(nd) operator(<=) ident(DBL_DIG) operator(+) integer(1)operator(\)) - ident(z) operator(=) integer(10)operator(*)ident(z) operator(+) ident(c)operator(;) - ident(nz) operator(=) integer(0)operator(;) - operator(}) - operator(}) - operator(}) -label(dig_done:) - ident(e) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(c) operator(==) char('e') operator(||) ident(c) operator(==) char('E')operator(\)) operator({) - reserved(if) operator((!)ident(nd) operator(&&) operator(!)ident(nz) operator(&&) operator(!)ident(nz0)operator(\)) operator({) - reserved(goto) ident(ret0)operator(;) - operator(}) - ident(s00) operator(=) ident(s)operator(;) - ident(esign) operator(=) integer(0)operator(;) - reserved(switch) operator(()ident(c) operator(=) operator(*++)ident(s)operator(\)) operator({) - reserved(case) char('-')operator(:) - ident(esign) operator(=) integer(1)operator(;) - reserved(case) char('+')operator(:) - ident(c) operator(=) operator(*++)ident(s)operator(;) - operator(}) - reserved(if) operator(()ident(c) operator(>=) char('0') operator(&&) ident(c) operator(<=) char('9')operator(\)) operator({) - reserved(while) operator(()ident(c) operator(==) char('0')operator(\)) - ident(c) operator(=) operator(*++)ident(s)operator(;) - reserved(if) operator(()ident(c) operator(>) char('0') operator(&&) ident(c) operator(<=) char('9')operator(\)) operator({) - ident(L) operator(=) ident(c) operator(-) char('0')operator(;) - ident(s1) operator(=) ident(s)operator(;) - reserved(while) operator((()ident(c) operator(=) operator(*++)ident(s)operator(\)) operator(>=) char('0') operator(&&) ident(c) operator(<=) char('9')operator(\)) - ident(L) operator(=) integer(10)operator(*)ident(L) operator(+) ident(c) operator(-) char('0')operator(;) - reserved(if) operator(()ident(s) operator(-) ident(s1) operator(>) integer(8) operator(||) ident(L) operator(>) integer(19999)operator(\)) - comment(/* Avoid confusion from exponents - * so large that e might overflow. - */) - ident(e) operator(=) integer(19999)operator(;) comment(/* safe for 16 bit ints */) - reserved(else) - ident(e) operator(=) operator(()pre_type(int)operator(\))ident(L)operator(;) - reserved(if) operator(()ident(esign)operator(\)) - ident(e) operator(=) operator(-)ident(e)operator(;) - operator(}) - reserved(else) - ident(e) operator(=) integer(0)operator(;) - operator(}) - reserved(else) - ident(s) operator(=) ident(s00)operator(;) - operator(}) - reserved(if) operator((!)ident(nd)operator(\)) operator({) - reserved(if) operator((!)ident(nz) operator(&&) operator(!)ident(nz0)operator(\)) operator({) -preprocessor(#ifdef) ident(INFNAN_CHECK) - comment(/* Check for Nan and Infinity */) - reserved(switch) operator(()ident(c)operator(\)) operator({) - reserved(case) char('i')operator(:) - reserved(case) char('I')operator(:) - reserved(if) operator(()ident(match)operator((&)ident(s)operator(,)stringoperator(\)\)) operator({) - operator(--)ident(s)operator(;) - reserved(if) operator((!)ident(match)operator((&)ident(s)operator(,)stringoperator(\)\)) - operator(++)ident(s)operator(;) - ident(word0)operator(()ident(rv)operator(\)) operator(=) hex(0x7ff00000)operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) integer(0)operator(;) - reserved(goto) ident(ret)operator(;) - operator(}) - reserved(break)operator(;) - reserved(case) char('n')operator(:) - reserved(case) char('N')operator(:) - reserved(if) operator(()ident(match)operator((&)ident(s)operator(,) stringoperator(\)\)) operator({) - ident(word0)operator(()ident(rv)operator(\)) operator(=) ident(NAN_WORD0)operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) ident(NAN_WORD1)operator(;) -preprocessor(#ifndef) ident(No_Hex_NaN) - reserved(if) operator((*)ident(s) operator(==) char('(')operator(\)) comment(/*\)*/) - ident(hexnan)operator((&)ident(rv)operator(,) operator(&)ident(s)operator(\);) -preprocessor(#endif) - reserved(goto) ident(ret)operator(;) - operator(}) - operator(}) -preprocessor(#endif) comment(/* INFNAN_CHECK */) -label(ret0:) - ident(s) operator(=) ident(s00)operator(;) - ident(sign) operator(=) integer(0)operator(;) - operator(}) - reserved(goto) ident(ret)operator(;) - operator(}) - ident(e1) operator(=) ident(e) operator(-=) ident(nf)operator(;) - - comment(/* Now we have nd0 digits, starting at s0, followed by a - * decimal point, followed by nd-nd0 digits. The number we're - * after is the integer represented by those digits times - * 10**e */) - - reserved(if) operator((!)ident(nd0)operator(\)) - ident(nd0) operator(=) ident(nd)operator(;) - ident(k) operator(=) ident(nd) operator(<) ident(DBL_DIG) operator(+) integer(1) operator(?) ident(nd) operator(:) ident(DBL_DIG) operator(+) integer(1)operator(;) - ident(dval)operator(()ident(rv)operator(\)) operator(=) ident(y)operator(;) - reserved(if) operator(()ident(k) operator(>) integer(9)operator(\)) operator({) -preprocessor(#ifdef) ident(SET_INEXACT) - reserved(if) operator(()ident(k) operator(>) ident(DBL_DIG)operator(\)) - ident(oldinexact) operator(=) ident(get_inexact)operator((\);) -preprocessor(#endif) - ident(dval)operator(()ident(rv)operator(\)) operator(=) ident(tens)operator([)ident(k) operator(-) integer(9)operator(]) operator(*) ident(dval)operator(()ident(rv)operator(\)) operator(+) ident(z)operator(;) - operator(}) - ident(bd0) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(nd) operator(<=) ident(DBL_DIG) -preprocessor(#ifndef) ident(RND_PRODQUOT) -preprocessor(#ifndef) ident(Honor_FLT_ROUNDS) - operator(&&) ident(Flt_Rounds) operator(==) integer(1) -preprocessor(#endif) -preprocessor(#endif) - operator(\)) operator({) - reserved(if) operator((!)ident(e)operator(\)) - reserved(goto) ident(ret)operator(;) - reserved(if) operator(()ident(e) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(e) operator(<=) ident(Ten_pmax)operator(\)) operator({) -preprocessor(#ifdef) ident(VAX) - reserved(goto) ident(vax_ovfl_check)operator(;) -preprocessor(#else) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - comment(/* round correctly FLT_ROUNDS = 2 or 3 */) - reserved(if) operator(()ident(sign)operator(\)) operator({) - ident(rv) operator(=) operator(-)ident(rv)operator(;) - ident(sign) operator(=) integer(0)operator(;) - operator(}) -preprocessor(#endif) - comment(/* rv = */) ident(rounded_product)operator(()ident(dval)operator(()ident(rv)operator(\),) ident(tens)operator([)ident(e)operator(]\);) - reserved(goto) ident(ret)operator(;) -preprocessor(#endif) - operator(}) - ident(i) operator(=) ident(DBL_DIG) operator(-) ident(nd)operator(;) - reserved(if) operator(()ident(e) operator(<=) ident(Ten_pmax) operator(+) ident(i)operator(\)) operator({) - comment(/* A fancier test would sometimes let us do - * this for larger i values. - */) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - comment(/* round correctly FLT_ROUNDS = 2 or 3 */) - reserved(if) operator(()ident(sign)operator(\)) operator({) - ident(rv) operator(=) operator(-)ident(rv)operator(;) - ident(sign) operator(=) integer(0)operator(;) - operator(}) -preprocessor(#endif) - ident(e) operator(-=) ident(i)operator(;) - ident(dval)operator(()ident(rv)operator(\)) operator(*=) ident(tens)operator([)ident(i)operator(];) -preprocessor(#ifdef) ident(VAX) - comment(/* VAX exponent range is so narrow we must - * worry about overflow here... - */) -label(vax_ovfl_check:) - ident(word0)operator(()ident(rv)operator(\)) operator(-=) ident(P)operator(*)ident(Exp_msk1)operator(;) - comment(/* rv = */) ident(rounded_product)operator(()ident(dval)operator(()ident(rv)operator(\),) ident(tens)operator([)ident(e)operator(]\);) - reserved(if) operator((()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) - operator(>) ident(Exp_msk1)operator(*()ident(DBL_MAX_EXP)operator(+)ident(Bias)operator(-)integer(1)operator(-)ident(P)operator(\)\)) - reserved(goto) ident(ovfl)operator(;) - ident(word0)operator(()ident(rv)operator(\)) operator(+=) ident(P)operator(*)ident(Exp_msk1)operator(;) -preprocessor(#else) - comment(/* rv = */) ident(rounded_product)operator(()ident(dval)operator(()ident(rv)operator(\),) ident(tens)operator([)ident(e)operator(]\);) -preprocessor(#endif) - reserved(goto) ident(ret)operator(;) - operator(}) - operator(}) -preprocessor(#ifndef) ident(Inaccurate_Divide) - reserved(else) reserved(if) operator(()ident(e) operator(>=) operator(-)ident(Ten_pmax)operator(\)) operator({) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - comment(/* round correctly FLT_ROUNDS = 2 or 3 */) - reserved(if) operator(()ident(sign)operator(\)) operator({) - ident(rv) operator(=) operator(-)ident(rv)operator(;) - ident(sign) operator(=) integer(0)operator(;) - operator(}) -preprocessor(#endif) - comment(/* rv = */) ident(rounded_quotient)operator(()ident(dval)operator(()ident(rv)operator(\),) ident(tens)operator([-)ident(e)operator(]\);) - reserved(goto) ident(ret)operator(;) - operator(}) -preprocessor(#endif) - operator(}) - ident(e1) operator(+=) ident(nd) operator(-) ident(k)operator(;) - -preprocessor(#ifdef) ident(IEEE_Arith) -preprocessor(#ifdef) ident(SET_INEXACT) - ident(inexact) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(k) operator(<=) ident(DBL_DIG)operator(\)) - ident(oldinexact) operator(=) ident(get_inexact)operator((\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(Avoid_Underflow) - ident(scale) operator(=) integer(0)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - reserved(if) operator((()ident(rounding) operator(=) ident(Flt_Rounds)operator(\)) operator(>=) integer(2)operator(\)) operator({) - reserved(if) operator(()ident(sign)operator(\)) - ident(rounding) operator(=) ident(rounding) operator(==) integer(2) operator(?) integer(0) operator(:) integer(2)operator(;) - reserved(else) - reserved(if) operator(()ident(rounding) operator(!=) integer(2)operator(\)) - ident(rounding) operator(=) integer(0)operator(;) - operator(}) -preprocessor(#endif) -preprocessor(#endif) comment(/*IEEE_Arith*/) - - comment(/* Get starting approximation = rv * 10**e1 */) - - reserved(if) operator(()ident(e1) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator((()ident(i) operator(=) ident(e1) operator(&) integer(15)operator(\)) operator(!=) integer(0)operator(\)) - ident(dval)operator(()ident(rv)operator(\)) operator(*=) ident(tens)operator([)ident(i)operator(];) - reserved(if) operator(()ident(e1) operator(&=) operator(~)integer(15)operator(\)) operator({) - reserved(if) operator(()ident(e1) operator(>) ident(DBL_MAX_10_EXP)operator(\)) operator({) -label(ovfl:) -preprocessor(#ifndef) ident(NO_ERRNO) - ident(errno) operator(=) ident(ERANGE)operator(;) -preprocessor(#endif) - comment(/* Can't trust HUGE_VAL */) -preprocessor(#ifdef) ident(IEEE_Arith) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - reserved(switch) operator(()ident(rounding)operator(\)) operator({) - reserved(case) integer(0)operator(:) comment(/* toward 0 */) - reserved(case) integer(3)operator(:) comment(/* toward -infinity */) - ident(word0)operator(()ident(rv)operator(\)) operator(=) ident(Big0)operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) ident(Big1)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - ident(word0)operator(()ident(rv)operator(\)) operator(=) ident(Exp_mask)operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) integer(0)operator(;) - operator(}) -preprocessor(#else) comment(/*Honor_FLT_ROUNDS*/) - ident(word0)operator(()ident(rv)operator(\)) operator(=) ident(Exp_mask)operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) integer(0)operator(;) -preprocessor(#endif) comment(/*Honor_FLT_ROUNDS*/) -preprocessor(#ifdef) ident(SET_INEXACT) - comment(/* set overflow bit */) - ident(dval)operator(()ident(rv0)operator(\)) operator(=) float(1)ident(e300)operator(;) - ident(dval)operator(()ident(rv0)operator(\)) operator(*=) ident(dval)operator(()ident(rv0)operator(\);) -preprocessor(#endif) -preprocessor(#else) comment(/*IEEE_Arith*/) - ident(word0)operator(()ident(rv)operator(\)) operator(=) ident(Big0)operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) ident(Big1)operator(;) -preprocessor(#endif) comment(/*IEEE_Arith*/) - reserved(if) operator(()ident(bd0)operator(\)) - reserved(goto) ident(retfree)operator(;) - reserved(goto) ident(ret)operator(;) - operator(}) - ident(e1) operator(>>=) integer(4)operator(;) - reserved(for) operator(()ident(j) operator(=) integer(0)operator(;) ident(e1) operator(>) integer(1)operator(;) ident(j)operator(++,) ident(e1) operator(>>=) integer(1)operator(\)) - reserved(if) operator(()ident(e1) operator(&) integer(1)operator(\)) - ident(dval)operator(()ident(rv)operator(\)) operator(*=) ident(bigtens)operator([)ident(j)operator(];) - comment(/* The last multiplication could overflow. */) - ident(word0)operator(()ident(rv)operator(\)) operator(-=) ident(P)operator(*)ident(Exp_msk1)operator(;) - ident(dval)operator(()ident(rv)operator(\)) operator(*=) ident(bigtens)operator([)ident(j)operator(];) - reserved(if) operator((()ident(z) operator(=) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) - operator(>) ident(Exp_msk1)operator(*()ident(DBL_MAX_EXP)operator(+)ident(Bias)operator(-)ident(P)operator(\)\)) - reserved(goto) ident(ovfl)operator(;) - reserved(if) operator(()ident(z) operator(>) ident(Exp_msk1)operator(*()ident(DBL_MAX_EXP)operator(+)ident(Bias)operator(-)integer(1)operator(-)ident(P)operator(\)\)) operator({) - comment(/* set to largest number */) - comment(/* (Can't trust DBL_MAX\) */) - ident(word0)operator(()ident(rv)operator(\)) operator(=) ident(Big0)operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) ident(Big1)operator(;) - operator(}) - reserved(else) - ident(word0)operator(()ident(rv)operator(\)) operator(+=) ident(P)operator(*)ident(Exp_msk1)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(e1) operator(<) integer(0)operator(\)) operator({) - ident(e1) operator(=) operator(-)ident(e1)operator(;) - reserved(if) operator((()ident(i) operator(=) ident(e1) operator(&) integer(15)operator(\)) operator(!=) integer(0)operator(\)) - ident(dval)operator(()ident(rv)operator(\)) operator(/=) ident(tens)operator([)ident(i)operator(];) - reserved(if) operator(()ident(e1) operator(>>=) integer(4)operator(\)) operator({) - reserved(if) operator(()ident(e1) operator(>=) integer(1) operator(<<) ident(n_bigtens)operator(\)) - reserved(goto) ident(undfl)operator(;) -preprocessor(#ifdef) ident(Avoid_Underflow) - reserved(if) operator(()ident(e1) operator(&) ident(Scale_Bit)operator(\)) - ident(scale) operator(=) integer(2)operator(*)ident(P)operator(;) - reserved(for) operator(()ident(j) operator(=) integer(0)operator(;) ident(e1) operator(>) integer(0)operator(;) ident(j)operator(++,) ident(e1) operator(>>=) integer(1)operator(\)) - reserved(if) operator(()ident(e1) operator(&) integer(1)operator(\)) - ident(dval)operator(()ident(rv)operator(\)) operator(*=) ident(tinytens)operator([)ident(j)operator(];) - reserved(if) operator(()ident(scale) operator(&&) operator(()ident(j) operator(=) integer(2)operator(*)ident(P) operator(+) integer(1) operator(-) operator((()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) - operator(>>) ident(Exp_shift)operator(\)\)) operator(>) integer(0)operator(\)) operator({) - comment(/* scaled rv is denormal; zap j low bits */) - reserved(if) operator(()ident(j) operator(>=) integer(32)operator(\)) operator({) - ident(word1)operator(()ident(rv)operator(\)) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(j) operator(>=) integer(53)operator(\)) - ident(word0)operator(()ident(rv)operator(\)) operator(=) operator(()ident(P)operator(+)integer(2)operator(\)*)ident(Exp_msk1)operator(;) - reserved(else) - ident(word0)operator(()ident(rv)operator(\)) operator(&=) hex(0xffffffff) operator(<<) operator(()ident(j)operator(-)integer(32)operator(\);) - operator(}) - reserved(else) - ident(word1)operator(()ident(rv)operator(\)) operator(&=) hex(0xffffffff) operator(<<) ident(j)operator(;) - operator(}) -preprocessor(#else) - reserved(for) operator(()ident(j) operator(=) integer(0)operator(;) ident(e1) operator(>) integer(1)operator(;) ident(j)operator(++,) ident(e1) operator(>>=) integer(1)operator(\)) - reserved(if) operator(()ident(e1) operator(&) integer(1)operator(\)) - ident(dval)operator(()ident(rv)operator(\)) operator(*=) ident(tinytens)operator([)ident(j)operator(];) - comment(/* The last multiplication could underflow. */) - ident(dval)operator(()ident(rv0)operator(\)) operator(=) ident(dval)operator(()ident(rv)operator(\);) - ident(dval)operator(()ident(rv)operator(\)) operator(*=) ident(tinytens)operator([)ident(j)operator(];) - reserved(if) operator((!)ident(dval)operator(()ident(rv)operator(\)\)) operator({) - ident(dval)operator(()ident(rv)operator(\)) operator(=) float(2)operator(.)operator(*)ident(dval)operator(()ident(rv0)operator(\);) - ident(dval)operator(()ident(rv)operator(\)) operator(*=) ident(tinytens)operator([)ident(j)operator(];) -preprocessor(#endif) - reserved(if) operator((!)ident(dval)operator(()ident(rv)operator(\)\)) operator({) -label(undfl:) - ident(dval)operator(()ident(rv)operator(\)) operator(=) float(0)operator(.)operator(;) -preprocessor(#ifndef) ident(NO_ERRNO) - ident(errno) operator(=) ident(ERANGE)operator(;) -preprocessor(#endif) - reserved(if) operator(()ident(bd0)operator(\)) - reserved(goto) ident(retfree)operator(;) - reserved(goto) ident(ret)operator(;) - operator(}) -preprocessor(#ifndef) ident(Avoid_Underflow) - ident(word0)operator(()ident(rv)operator(\)) operator(=) ident(Tiny0)operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) ident(Tiny1)operator(;) - comment(/* The refinement below will clean - * this approximation up. - */) - operator(}) -preprocessor(#endif) - operator(}) - operator(}) - - comment(/* Now the hard part -- adjusting rv to the correct value.*/) - - comment(/* Put digits into bd: true value = bd * 10^e */) - - ident(bd0) operator(=) ident(s2b)operator(()ident(s0)operator(,) ident(nd0)operator(,) ident(nd)operator(,) ident(y)operator(\);) - - reserved(for) operator((;;\)) operator({) - ident(bd) operator(=) ident(Balloc)operator(()ident(bd0)operator(->)ident(k)operator(\);) - ident(Bcopy)operator(()ident(bd)operator(,) ident(bd0)operator(\);) - ident(bb) operator(=) ident(d2b)operator(()ident(dval)operator(()ident(rv)operator(\),) operator(&)ident(bbe)operator(,) operator(&)ident(bbbits)operator(\);) comment(/* rv = bb * 2^bbe */) - ident(bs) operator(=) ident(i2b)operator(()integer(1)operator(\);) - - reserved(if) operator(()ident(e) operator(>=) integer(0)operator(\)) operator({) - ident(bb2) operator(=) ident(bb5) operator(=) integer(0)operator(;) - ident(bd2) operator(=) ident(bd5) operator(=) ident(e)operator(;) - operator(}) - reserved(else) operator({) - ident(bb2) operator(=) ident(bb5) operator(=) operator(-)ident(e)operator(;) - ident(bd2) operator(=) ident(bd5) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(bbe) operator(>=) integer(0)operator(\)) - ident(bb2) operator(+=) ident(bbe)operator(;) - reserved(else) - ident(bd2) operator(-=) ident(bbe)operator(;) - ident(bs2) operator(=) ident(bb2)operator(;) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - reserved(if) operator(()ident(rounding) operator(!=) integer(1)operator(\)) - ident(bs2)operator(++;) -preprocessor(#endif) -preprocessor(#ifdef) ident(Avoid_Underflow) - ident(j) operator(=) ident(bbe) operator(-) ident(scale)operator(;) - ident(i) operator(=) ident(j) operator(+) ident(bbbits) operator(-) integer(1)operator(;) comment(/* logb(rv\) */) - reserved(if) operator(()ident(i) operator(<) ident(Emin)operator(\)) comment(/* denormal */) - ident(j) operator(+=) ident(P) operator(-) ident(Emin)operator(;) - reserved(else) - ident(j) operator(=) ident(P) operator(+) integer(1) operator(-) ident(bbbits)operator(;) -preprocessor(#else) comment(/*Avoid_Underflow*/) -preprocessor(#ifdef) ident(Sudden_Underflow) -preprocessor(#ifdef) ident(IBM) - ident(j) operator(=) integer(1) operator(+) integer(4)operator(*)ident(P) operator(-) integer(3) operator(-) ident(bbbits) operator(+) operator((()ident(bbe) operator(+) ident(bbbits) operator(-) integer(1)operator(\)) operator(&) integer(3)operator(\);) -preprocessor(#else) - ident(j) operator(=) ident(P) operator(+) integer(1) operator(-) ident(bbbits)operator(;) -preprocessor(#endif) -preprocessor(#else) comment(/*Sudden_Underflow*/) - ident(j) operator(=) ident(bbe)operator(;) - ident(i) operator(=) ident(j) operator(+) ident(bbbits) operator(-) integer(1)operator(;) comment(/* logb(rv\) */) - reserved(if) operator(()ident(i) operator(<) ident(Emin)operator(\)) comment(/* denormal */) - ident(j) operator(+=) ident(P) operator(-) ident(Emin)operator(;) - reserved(else) - ident(j) operator(=) ident(P) operator(+) integer(1) operator(-) ident(bbbits)operator(;) -preprocessor(#endif) comment(/*Sudden_Underflow*/) -preprocessor(#endif) comment(/*Avoid_Underflow*/) - ident(bb2) operator(+=) ident(j)operator(;) - ident(bd2) operator(+=) ident(j)operator(;) -preprocessor(#ifdef) ident(Avoid_Underflow) - ident(bd2) operator(+=) ident(scale)operator(;) -preprocessor(#endif) - ident(i) operator(=) ident(bb2) operator(<) ident(bd2) operator(?) ident(bb2) operator(:) ident(bd2)operator(;) - reserved(if) operator(()ident(i) operator(>) ident(bs2)operator(\)) - ident(i) operator(=) ident(bs2)operator(;) - reserved(if) operator(()ident(i) operator(>) integer(0)operator(\)) operator({) - ident(bb2) operator(-=) ident(i)operator(;) - ident(bd2) operator(-=) ident(i)operator(;) - ident(bs2) operator(-=) ident(i)operator(;) - operator(}) - reserved(if) operator(()ident(bb5) operator(>) integer(0)operator(\)) operator({) - ident(bs) operator(=) ident(pow5mult)operator(()ident(bs)operator(,) ident(bb5)operator(\);) - ident(bb1) operator(=) ident(mult)operator(()ident(bs)operator(,) ident(bb)operator(\);) - ident(Bfree)operator(()ident(bb)operator(\);) - ident(bb) operator(=) ident(bb1)operator(;) - operator(}) - reserved(if) operator(()ident(bb2) operator(>) integer(0)operator(\)) - ident(bb) operator(=) ident(lshift)operator(()ident(bb)operator(,) ident(bb2)operator(\);) - reserved(if) operator(()ident(bd5) operator(>) integer(0)operator(\)) - ident(bd) operator(=) ident(pow5mult)operator(()ident(bd)operator(,) ident(bd5)operator(\);) - reserved(if) operator(()ident(bd2) operator(>) integer(0)operator(\)) - ident(bd) operator(=) ident(lshift)operator(()ident(bd)operator(,) ident(bd2)operator(\);) - reserved(if) operator(()ident(bs2) operator(>) integer(0)operator(\)) - ident(bs) operator(=) ident(lshift)operator(()ident(bs)operator(,) ident(bs2)operator(\);) - ident(delta) operator(=) ident(diff)operator(()ident(bb)operator(,) ident(bd)operator(\);) - ident(dsign) operator(=) ident(delta)operator(->)ident(sign)operator(;) - ident(delta)operator(->)ident(sign) operator(=) integer(0)operator(;) - ident(i) operator(=) ident(cmp)operator(()ident(delta)operator(,) ident(bs)operator(\);) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - reserved(if) operator(()ident(rounding) operator(!=) integer(1)operator(\)) operator({) - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) operator({) - comment(/* Error is less than an ulp */) - reserved(if) operator((!)ident(delta)operator(->)ident(x)operator([)integer(0)operator(]) operator(&&) ident(delta)operator(->)ident(wds) operator(<=) integer(1)operator(\)) operator({) - comment(/* exact */) -preprocessor(#ifdef) ident(SET_INEXACT) - ident(inexact) operator(=) integer(0)operator(;) -preprocessor(#endif) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(rounding)operator(\)) operator({) - reserved(if) operator(()ident(dsign)operator(\)) operator({) - ident(adj) operator(=) float(1)operator(.)operator(;) - reserved(goto) ident(apply_adj)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator((!)ident(dsign)operator(\)) operator({) - ident(adj) operator(=) operator(-)float(1)operator(.)operator(;) - reserved(if) operator((!)ident(word1)operator(()ident(rv)operator(\)) - operator(&&) operator(!()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Frac_mask)operator(\)\)) operator({) - ident(y) operator(=) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(;) -preprocessor(#ifdef) ident(Avoid_Underflow) - reserved(if) operator((!)ident(scale) operator(||) ident(y) operator(>) integer(2)operator(*)ident(P)operator(*)ident(Exp_msk1)operator(\)) -preprocessor(#else) - reserved(if) operator(()ident(y)operator(\)) -preprocessor(#endif) - operator({) - ident(delta) operator(=) ident(lshift)operator(()ident(delta)operator(,)ident(Log2P)operator(\);) - reserved(if) operator(()ident(cmp)operator(()ident(delta)operator(,) ident(bs)operator(\)) operator(<=) integer(0)operator(\)) - ident(adj) operator(=) operator(-)float(0)float(.5)operator(;) - operator(}) - operator(}) -label(apply_adj:) -preprocessor(#ifdef) ident(Avoid_Underflow) - reserved(if) operator(()ident(scale) operator(&&) operator(()ident(y) operator(=) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) - operator(<=) integer(2)operator(*)ident(P)operator(*)ident(Exp_msk1)operator(\)) - ident(word0)operator(()ident(adj)operator(\)) operator(+=) operator(()integer(2)operator(*)ident(P)operator(+)integer(1)operator(\)*)ident(Exp_msk1) operator(-) ident(y)operator(;) -preprocessor(#else) -preprocessor(#ifdef) ident(Sudden_Underflow) - reserved(if) operator((()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(<=) - ident(P)operator(*)ident(Exp_msk1)operator(\)) operator({) - ident(word0)operator(()ident(rv)operator(\)) operator(+=) ident(P)operator(*)ident(Exp_msk1)operator(;) - ident(dval)operator(()ident(rv)operator(\)) operator(+=) ident(adj)operator(*)ident(ulp)operator(()ident(dval)operator(()ident(rv)operator(\)\);) - ident(word0)operator(()ident(rv)operator(\)) operator(-=) ident(P)operator(*)ident(Exp_msk1)operator(;) - operator(}) - reserved(else) -preprocessor(#endif) comment(/*Sudden_Underflow*/) -preprocessor(#endif) comment(/*Avoid_Underflow*/) - ident(dval)operator(()ident(rv)operator(\)) operator(+=) ident(adj)operator(*)ident(ulp)operator(()ident(dval)operator(()ident(rv)operator(\)\);) - operator(}) - reserved(break)operator(;) - operator(}) - ident(adj) operator(=) ident(ratio)operator(()ident(delta)operator(,) ident(bs)operator(\);) - reserved(if) operator(()ident(adj) operator(<) float(1)operator(.)operator(\)) - ident(adj) operator(=) float(1)operator(.)operator(;) - reserved(if) operator(()ident(adj) operator(<=) hex(0x7ffffffe)operator(\)) operator({) - comment(/* adj = rounding ? ceil(adj\) : floor(adj\); */) - ident(y) operator(=) ident(adj)operator(;) - reserved(if) operator(()ident(y) operator(!=) ident(adj)operator(\)) operator({) - reserved(if) operator((!(()ident(rounding)operator(>>)integer(1)operator(\)) operator(^) ident(dsign)operator(\)\)) - ident(y)operator(++;) - ident(adj) operator(=) ident(y)operator(;) - operator(}) - operator(}) -preprocessor(#ifdef) ident(Avoid_Underflow) - reserved(if) operator(()ident(scale) operator(&&) operator(()ident(y) operator(=) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(<=) integer(2)operator(*)ident(P)operator(*)ident(Exp_msk1)operator(\)) - ident(word0)operator(()ident(adj)operator(\)) operator(+=) operator(()integer(2)operator(*)ident(P)operator(+)integer(1)operator(\)*)ident(Exp_msk1) operator(-) ident(y)operator(;) -preprocessor(#else) -preprocessor(#ifdef) ident(Sudden_Underflow) - reserved(if) operator((()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(<=) ident(P)operator(*)ident(Exp_msk1)operator(\)) operator({) - ident(word0)operator(()ident(rv)operator(\)) operator(+=) ident(P)operator(*)ident(Exp_msk1)operator(;) - ident(adj) operator(*=) ident(ulp)operator(()ident(dval)operator(()ident(rv)operator(\)\);) - reserved(if) operator(()ident(dsign)operator(\)) - ident(dval)operator(()ident(rv)operator(\)) operator(+=) ident(adj)operator(;) - reserved(else) - ident(dval)operator(()ident(rv)operator(\)) operator(-=) ident(adj)operator(;) - ident(word0)operator(()ident(rv)operator(\)) operator(-=) ident(P)operator(*)ident(Exp_msk1)operator(;) - reserved(goto) ident(cont)operator(;) - operator(}) -preprocessor(#endif) comment(/*Sudden_Underflow*/) -preprocessor(#endif) comment(/*Avoid_Underflow*/) - ident(adj) operator(*=) ident(ulp)operator(()ident(dval)operator(()ident(rv)operator(\)\);) - reserved(if) operator(()ident(dsign)operator(\)) - ident(dval)operator(()ident(rv)operator(\)) operator(+=) ident(adj)operator(;) - reserved(else) - ident(dval)operator(()ident(rv)operator(\)) operator(-=) ident(adj)operator(;) - reserved(goto) ident(cont)operator(;) - operator(}) -preprocessor(#endif) comment(/*Honor_FLT_ROUNDS*/) - - reserved(if) operator(()ident(i) operator(<) integer(0)operator(\)) operator({) - comment(/* Error is less than half an ulp -- check for - * special case of mantissa a power of two. - */) - reserved(if) operator(()ident(dsign) operator(||) ident(word1)operator(()ident(rv)operator(\)) operator(||) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Bndry_mask) -preprocessor(#ifdef) ident(IEEE_Arith) -preprocessor(#ifdef) ident(Avoid_Underflow) - operator(||) operator(()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(<=) operator(()integer(2)operator(*)ident(P)operator(+)integer(1)operator(\)*)ident(Exp_msk1) -preprocessor(#else) - operator(||) operator(()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(<=) ident(Exp_msk1) -preprocessor(#endif) -preprocessor(#endif) - operator(\)) operator({) -preprocessor(#ifdef) ident(SET_INEXACT) - reserved(if) operator((!)ident(delta)operator(->)ident(x)operator([)integer(0)operator(]) operator(&&) ident(delta)operator(->)ident(wds) operator(<=) integer(1)operator(\)) - ident(inexact) operator(=) integer(0)operator(;) -preprocessor(#endif) - reserved(break)operator(;) - operator(}) - reserved(if) operator((!)ident(delta)operator(->)ident(x)operator([)integer(0)operator(]) operator(&&) ident(delta)operator(->)ident(wds) operator(<=) integer(1)operator(\)) operator({) - comment(/* exact result */) -preprocessor(#ifdef) ident(SET_INEXACT) - ident(inexact) operator(=) integer(0)operator(;) -preprocessor(#endif) - reserved(break)operator(;) - operator(}) - ident(delta) operator(=) ident(lshift)operator(()ident(delta)operator(,)ident(Log2P)operator(\);) - reserved(if) operator(()ident(cmp)operator(()ident(delta)operator(,) ident(bs)operator(\)) operator(>) integer(0)operator(\)) - reserved(goto) ident(drop_down)operator(;) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(i) operator(==) integer(0)operator(\)) operator({) - comment(/* exactly half-way between */) - reserved(if) operator(()ident(dsign)operator(\)) operator({) - reserved(if) operator((()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Bndry_mask1)operator(\)) operator(==) ident(Bndry_mask1) - operator(&&) ident(word1)operator(()ident(rv)operator(\)) operator(==) operator(() -preprocessor(#ifdef) ident(Avoid_Underflow) - operator(()ident(scale) operator(&&) operator(()ident(y) operator(=) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(<=) integer(2)operator(*)ident(P)operator(*)ident(Exp_msk1)operator(\)) - operator(?) operator(()hex(0xffffffff) operator(&) operator(()hex(0xffffffff) operator(<<) operator(()integer(2)operator(*)ident(P)operator(+)integer(1)operator(-()ident(y)operator(>>)ident(Exp_shift)operator(\)\)\)\)) operator(:) -preprocessor(#endif) - hex(0xffffffff)operator(\)\)) operator({) - comment(/*boundary case -- increment exponent*/) - ident(word0)operator(()ident(rv)operator(\)) operator(=) operator(()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) - operator(+) ident(Exp_msk1) -preprocessor(#ifdef) ident(IBM) - operator(|) ident(Exp_msk1) operator(>>) integer(4) -preprocessor(#endif) - operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) integer(0)operator(;) -preprocessor(#ifdef) ident(Avoid_Underflow) - ident(dsign) operator(=) integer(0)operator(;) -preprocessor(#endif) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator((!()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Bndry_mask)operator(\)) operator(&&) operator(!)ident(word1)operator(()ident(rv)operator(\)\)) operator({) -label(drop_down:) - comment(/* boundary case -- decrement exponent */) -preprocessor(#ifdef) ident(Sudden_Underflow) comment(/*{{*/) - ident(L) operator(=) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(;) -preprocessor(#ifdef) ident(IBM) - reserved(if) operator(()ident(L) operator(<) ident(Exp_msk1)operator(\)) -preprocessor(#else) -preprocessor(#ifdef) ident(Avoid_Underflow) - reserved(if) operator(()ident(L) operator(<=) operator(()ident(scale) operator(?) operator(()integer(2)operator(*)ident(P)operator(+)integer(1)operator(\)*)ident(Exp_msk1) operator(:) ident(Exp_msk1)operator(\)\)) -preprocessor(#else) - reserved(if) operator(()ident(L) operator(<=) ident(Exp_msk1)operator(\)) -preprocessor(#endif) comment(/*Avoid_Underflow*/) -preprocessor(#endif) comment(/*IBM*/) - reserved(goto) ident(undfl)operator(;) - ident(L) operator(-=) ident(Exp_msk1)operator(;) -preprocessor(#else) comment(/*Sudden_Underflow}{*/) -preprocessor(#ifdef) ident(Avoid_Underflow) - reserved(if) operator(()ident(scale)operator(\)) operator({) - ident(L) operator(=) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(;) - reserved(if) operator(()ident(L) operator(<=) operator(()integer(2)operator(*)ident(P)operator(+)integer(1)operator(\)*)ident(Exp_msk1)operator(\)) operator({) - reserved(if) operator(()ident(L) operator(>) operator(()ident(P)operator(+)integer(2)operator(\)*)ident(Exp_msk1)operator(\)) - comment(/* round even ==> */) - comment(/* accept rv */) - reserved(break)operator(;) - comment(/* rv = smallest denormal */) - reserved(goto) ident(undfl)operator(;) - operator(}) - operator(}) -preprocessor(#endif) comment(/*Avoid_Underflow*/) - ident(L) operator(=) operator(()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(-) ident(Exp_msk1)operator(;) -preprocessor(#endif) comment(/*Sudden_Underflow}}*/) - ident(word0)operator(()ident(rv)operator(\)) operator(=) ident(L) operator(|) ident(Bndry_mask1)operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) hex(0xffffffff)operator(;) -preprocessor(#ifdef) ident(IBM) - reserved(goto) ident(cont)operator(;) -preprocessor(#else) - reserved(break)operator(;) -preprocessor(#endif) - operator(}) -preprocessor(#ifndef) ident(ROUND_BIASED) - reserved(if) operator((!()ident(word1)operator(()ident(rv)operator(\)) operator(&) ident(LSB)operator(\)\)) - reserved(break)operator(;) -preprocessor(#endif) - reserved(if) operator(()ident(dsign)operator(\)) - ident(dval)operator(()ident(rv)operator(\)) operator(+=) ident(ulp)operator(()ident(dval)operator(()ident(rv)operator(\)\);) -preprocessor(#ifndef) ident(ROUND_BIASED) - reserved(else) operator({) - ident(dval)operator(()ident(rv)operator(\)) operator(-=) ident(ulp)operator(()ident(dval)operator(()ident(rv)operator(\)\);) -preprocessor(#ifndef) ident(Sudden_Underflow) - reserved(if) operator((!)ident(dval)operator(()ident(rv)operator(\)\)) - reserved(goto) ident(undfl)operator(;) -preprocessor(#endif) - operator(}) -preprocessor(#ifdef) ident(Avoid_Underflow) - ident(dsign) operator(=) integer(1) operator(-) ident(dsign)operator(;) -preprocessor(#endif) -preprocessor(#endif) - reserved(break)operator(;) - operator(}) - reserved(if) operator((()ident(aadj) operator(=) ident(ratio)operator(()ident(delta)operator(,) ident(bs)operator(\)\)) operator(<=) float(2)operator(.)operator(\)) operator({) - reserved(if) operator(()ident(dsign)operator(\)) - ident(aadj) operator(=) ident(aadj1) operator(=) float(1)operator(.)operator(;) - reserved(else) reserved(if) operator(()ident(word1)operator(()ident(rv)operator(\)) operator(||) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Bndry_mask)operator(\)) operator({) -preprocessor(#ifndef) ident(Sudden_Underflow) - reserved(if) operator(()ident(word1)operator(()ident(rv)operator(\)) operator(==) ident(Tiny1) operator(&&) operator(!)ident(word0)operator(()ident(rv)operator(\)\)) - reserved(goto) ident(undfl)operator(;) -preprocessor(#endif) - ident(aadj) operator(=) float(1)operator(.)operator(;) - ident(aadj1) operator(=) operator(-)float(1)operator(.)operator(;) - operator(}) - reserved(else) operator({) - comment(/* special case -- power of FLT_RADIX to be */) - comment(/* rounded down... */) - - reserved(if) operator(()ident(aadj) operator(<) float(2)operator(.)operator(/)ident(FLT_RADIX)operator(\)) - ident(aadj) operator(=) float(1)operator(.)operator(/)ident(FLT_RADIX)operator(;) - reserved(else) - ident(aadj) operator(*=) float(0)float(.5)operator(;) - ident(aadj1) operator(=) operator(-)ident(aadj)operator(;) - operator(}) - operator(}) - reserved(else) operator({) - ident(aadj) operator(*=) float(0)float(.5)operator(;) - ident(aadj1) operator(=) ident(dsign) operator(?) ident(aadj) operator(:) operator(-)ident(aadj)operator(;) -preprocessor(#ifdef) ident(Check_FLT_ROUNDS) - reserved(switch) operator(()ident(Rounding)operator(\)) operator({) - reserved(case) integer(2)operator(:) comment(/* towards +infinity */) - ident(aadj1) operator(-=) float(0)float(.5)operator(;) - reserved(break)operator(;) - reserved(case) integer(0)operator(:) comment(/* towards 0 */) - reserved(case) integer(3)operator(:) comment(/* towards -infinity */) - ident(aadj1) operator(+=) float(0)float(.5)operator(;) - operator(}) -preprocessor(#else) - reserved(if) operator(()ident(Flt_Rounds) operator(==) integer(0)operator(\)) - ident(aadj1) operator(+=) float(0)float(.5)operator(;) -preprocessor(#endif) comment(/*Check_FLT_ROUNDS*/) - operator(}) - ident(y) operator(=) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(;) - - comment(/* Check for overflow */) - - reserved(if) operator(()ident(y) operator(==) ident(Exp_msk1)operator(*()ident(DBL_MAX_EXP)operator(+)ident(Bias)operator(-)integer(1)operator(\)\)) operator({) - ident(dval)operator(()ident(rv0)operator(\)) operator(=) ident(dval)operator(()ident(rv)operator(\);) - ident(word0)operator(()ident(rv)operator(\)) operator(-=) ident(P)operator(*)ident(Exp_msk1)operator(;) - ident(adj) operator(=) ident(aadj1) operator(*) ident(ulp)operator(()ident(dval)operator(()ident(rv)operator(\)\);) - ident(dval)operator(()ident(rv)operator(\)) operator(+=) ident(adj)operator(;) - reserved(if) operator((()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(>=) - ident(Exp_msk1)operator(*()ident(DBL_MAX_EXP)operator(+)ident(Bias)operator(-)ident(P)operator(\)\)) operator({) - reserved(if) operator(()ident(word0)operator(()ident(rv0)operator(\)) operator(==) ident(Big0) operator(&&) ident(word1)operator(()ident(rv0)operator(\)) operator(==) ident(Big1)operator(\)) - reserved(goto) ident(ovfl)operator(;) - ident(word0)operator(()ident(rv)operator(\)) operator(=) ident(Big0)operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) ident(Big1)operator(;) - reserved(goto) ident(cont)operator(;) - operator(}) - reserved(else) - ident(word0)operator(()ident(rv)operator(\)) operator(+=) ident(P)operator(*)ident(Exp_msk1)operator(;) - operator(}) - reserved(else) operator({) -preprocessor(#ifdef) ident(Avoid_Underflow) - reserved(if) operator(()ident(scale) operator(&&) ident(y) operator(<=) integer(2)operator(*)ident(P)operator(*)ident(Exp_msk1)operator(\)) operator({) - reserved(if) operator(()ident(aadj) operator(<=) hex(0x7fffffff)operator(\)) operator({) - reserved(if) operator((()ident(z) operator(=) ident(aadj)operator(\)) operator(<=) integer(0)operator(\)) - ident(z) operator(=) integer(1)operator(;) - ident(aadj) operator(=) ident(z)operator(;) - ident(aadj1) operator(=) ident(dsign) operator(?) ident(aadj) operator(:) operator(-)ident(aadj)operator(;) - operator(}) - ident(word0)operator(()ident(aadj1)operator(\)) operator(+=) operator(()integer(2)operator(*)ident(P)operator(+)integer(1)operator(\)*)ident(Exp_msk1) operator(-) ident(y)operator(;) - operator(}) - ident(adj) operator(=) ident(aadj1) operator(*) ident(ulp)operator(()ident(dval)operator(()ident(rv)operator(\)\);) - ident(dval)operator(()ident(rv)operator(\)) operator(+=) ident(adj)operator(;) -preprocessor(#else) -preprocessor(#ifdef) ident(Sudden_Underflow) - reserved(if) operator((()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(<=) ident(P)operator(*)ident(Exp_msk1)operator(\)) operator({) - ident(dval)operator(()ident(rv0)operator(\)) operator(=) ident(dval)operator(()ident(rv)operator(\);) - ident(word0)operator(()ident(rv)operator(\)) operator(+=) ident(P)operator(*)ident(Exp_msk1)operator(;) - ident(adj) operator(=) ident(aadj1) operator(*) ident(ulp)operator(()ident(dval)operator(()ident(rv)operator(\)\);) - ident(dval)operator(()ident(rv)operator(\)) operator(+=) ident(adj)operator(;) -preprocessor(#ifdef) ident(IBM) - reserved(if) operator((()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(<) ident(P)operator(*)ident(Exp_msk1)operator(\)) -preprocessor(#else) - reserved(if) operator((()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(<=) ident(P)operator(*)ident(Exp_msk1)operator(\)) -preprocessor(#endif) - operator({) - reserved(if) operator(()ident(word0)operator(()ident(rv0)operator(\)) operator(==) ident(Tiny0) operator(&&) ident(word1)operator(()ident(rv0)operator(\)) operator(==) ident(Tiny1)operator(\)) - reserved(goto) ident(undfl)operator(;) - ident(word0)operator(()ident(rv)operator(\)) operator(=) ident(Tiny0)operator(;) - ident(word1)operator(()ident(rv)operator(\)) operator(=) ident(Tiny1)operator(;) - reserved(goto) ident(cont)operator(;) - operator(}) - reserved(else) - ident(word0)operator(()ident(rv)operator(\)) operator(-=) ident(P)operator(*)ident(Exp_msk1)operator(;) - operator(}) - reserved(else) operator({) - ident(adj) operator(=) ident(aadj1) operator(*) ident(ulp)operator(()ident(dval)operator(()ident(rv)operator(\)\);) - ident(dval)operator(()ident(rv)operator(\)) operator(+=) ident(adj)operator(;) - operator(}) -preprocessor(#else) comment(/*Sudden_Underflow*/) - comment(/* Compute adj so that the IEEE rounding rules will - * correctly round rv + adj in some half-way cases. - * If rv * ulp(rv\) is denormalized (i.e., - * y <= (P-1\)*Exp_msk1\), we must adjust aadj to avoid - * trouble from bits lost to denormalization; - * example: 1.2e-307 . - */) - reserved(if) operator(()ident(y) operator(<=) operator(()ident(P)operator(-)integer(1)operator(\)*)ident(Exp_msk1) operator(&&) ident(aadj) operator(>) float(1)operator(.)operator(\)) operator({) - ident(aadj1) operator(=) operator(()pre_type(double)operator(\)()pre_type(int)operator(\)()ident(aadj) operator(+) float(0)float(.5)operator(\);) - reserved(if) operator((!)ident(dsign)operator(\)) - ident(aadj1) operator(=) operator(-)ident(aadj1)operator(;) - operator(}) - ident(adj) operator(=) ident(aadj1) operator(*) ident(ulp)operator(()ident(dval)operator(()ident(rv)operator(\)\);) - ident(dval)operator(()ident(rv)operator(\)) operator(+=) ident(adj)operator(;) -preprocessor(#endif) comment(/*Sudden_Underflow*/) -preprocessor(#endif) comment(/*Avoid_Underflow*/) - operator(}) - ident(z) operator(=) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(;) -preprocessor(#ifndef) ident(SET_INEXACT) -preprocessor(#ifdef) ident(Avoid_Underflow) - reserved(if) operator((!)ident(scale)operator(\)) -preprocessor(#endif) - reserved(if) operator(()ident(y) operator(==) ident(z)operator(\)) operator({) - comment(/* Can we stop now? */) - ident(L) operator(=) operator(()ident(Long)operator(\))ident(aadj)operator(;) - ident(aadj) operator(-=) ident(L)operator(;) - comment(/* The tolerances below are conservative. */) - reserved(if) operator(()ident(dsign) operator(||) ident(word1)operator(()ident(rv)operator(\)) operator(||) ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Bndry_mask)operator(\)) operator({) - reserved(if) operator(()ident(aadj) operator(<) float(.4999999) operator(||) ident(aadj) operator(>) float(.5000001)operator(\)) - reserved(break)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(aadj) operator(<) float(.4999999)operator(/)ident(FLT_RADIX)operator(\)) - reserved(break)operator(;) - operator(}) -preprocessor(#endif) -label(cont:) - ident(Bfree)operator(()ident(bb)operator(\);) - ident(Bfree)operator(()ident(bd)operator(\);) - ident(Bfree)operator(()ident(bs)operator(\);) - ident(Bfree)operator(()ident(delta)operator(\);) - operator(}) -preprocessor(#ifdef) ident(SET_INEXACT) - reserved(if) operator(()ident(inexact)operator(\)) operator({) - reserved(if) operator((!)ident(oldinexact)operator(\)) operator({) - ident(word0)operator(()ident(rv0)operator(\)) operator(=) ident(Exp_1) operator(+) operator(()integer(70) operator(<<) ident(Exp_shift)operator(\);) - ident(word1)operator(()ident(rv0)operator(\)) operator(=) integer(0)operator(;) - ident(dval)operator(()ident(rv0)operator(\)) operator(+=) float(1)operator(.)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator((!)ident(oldinexact)operator(\)) - ident(clear_inexact)operator((\);) -preprocessor(#endif) -preprocessor(#ifdef) ident(Avoid_Underflow) - reserved(if) operator(()ident(scale)operator(\)) operator({) - ident(word0)operator(()ident(rv0)operator(\)) operator(=) ident(Exp_1) operator(-) integer(2)operator(*)ident(P)operator(*)ident(Exp_msk1)operator(;) - ident(word1)operator(()ident(rv0)operator(\)) operator(=) integer(0)operator(;) - ident(dval)operator(()ident(rv)operator(\)) operator(*=) ident(dval)operator(()ident(rv0)operator(\);) -preprocessor(#ifndef) ident(NO_ERRNO) - comment(/* try to avoid the bug of testing an 8087 register value */) - reserved(if) operator(()ident(word0)operator(()ident(rv)operator(\)) operator(==) integer(0) operator(&&) ident(word1)operator(()ident(rv)operator(\)) operator(==) integer(0)operator(\)) - ident(errno) operator(=) ident(ERANGE)operator(;) -preprocessor(#endif) - operator(}) -preprocessor(#endif) comment(/* Avoid_Underflow */) -preprocessor(#ifdef) ident(SET_INEXACT) - reserved(if) operator(()ident(inexact) operator(&&) operator(!()ident(word0)operator(()ident(rv)operator(\)) operator(&) ident(Exp_mask)operator(\)\)) operator({) - comment(/* set underflow bit */) - ident(dval)operator(()ident(rv0)operator(\)) operator(=) float(1)ident(e)operator(-)integer(300)operator(;) - ident(dval)operator(()ident(rv0)operator(\)) operator(*=) ident(dval)operator(()ident(rv0)operator(\);) - operator(}) -preprocessor(#endif) -label(retfree:) - ident(Bfree)operator(()ident(bb)operator(\);) - ident(Bfree)operator(()ident(bd)operator(\);) - ident(Bfree)operator(()ident(bs)operator(\);) - ident(Bfree)operator(()ident(bd0)operator(\);) - ident(Bfree)operator(()ident(delta)operator(\);) -label(ret:) - reserved(if) operator(()ident(se)operator(\)) - operator(*)ident(se) operator(=) operator(()pre_type(char) operator(*\))ident(s)operator(;) - reserved(return) ident(sign) operator(?) operator(-)ident(dval)operator(()ident(rv)operator(\)) operator(:) ident(dval)operator(()ident(rv)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(quorem)operator(()ident(Bigint) operator(*)ident(b)operator(,) ident(Bigint) operator(*)ident(S)operator(\)) -operator({) - pre_type(int) ident(n)operator(;) - ident(ULong) operator(*)ident(bx)operator(,) operator(*)ident(bxe)operator(,) ident(q)operator(,) operator(*)ident(sx)operator(,) operator(*)ident(sxe)operator(;) -preprocessor(#ifdef) ident(ULLong) - ident(ULLong) ident(borrow)operator(,) ident(carry)operator(,) ident(y)operator(,) ident(ys)operator(;) -preprocessor(#else) - ident(ULong) ident(borrow)operator(,) ident(carry)operator(,) ident(y)operator(,) ident(ys)operator(;) -preprocessor(#ifdef) ident(Pack_32) - ident(ULong) ident(si)operator(,) ident(z)operator(,) ident(zs)operator(;) -preprocessor(#endif) -preprocessor(#endif) - - ident(n) operator(=) ident(S)operator(->)ident(wds)operator(;) -preprocessor(#ifdef) ident(DEBUG) - comment(/*debug*/) reserved(if) operator(()ident(b)operator(->)ident(wds) operator(>) ident(n)operator(\)) - comment(/*debug*/) ident(Bug)operator(()stringoperator(\);) -preprocessor(#endif) - reserved(if) operator(()ident(b)operator(->)ident(wds) operator(<) ident(n)operator(\)) - reserved(return) integer(0)operator(;) - ident(sx) operator(=) ident(S)operator(->)ident(x)operator(;) - ident(sxe) operator(=) ident(sx) operator(+) operator(--)ident(n)operator(;) - ident(bx) operator(=) ident(b)operator(->)ident(x)operator(;) - ident(bxe) operator(=) ident(bx) operator(+) ident(n)operator(;) - ident(q) operator(=) operator(*)ident(bxe) operator(/) operator((*)ident(sxe) operator(+) integer(1)operator(\);) comment(/* ensure q <= true quotient */) -preprocessor(#ifdef) ident(DEBUG) - comment(/*debug*/) reserved(if) operator(()ident(q) operator(>) integer(9)operator(\)) - comment(/*debug*/) ident(Bug)operator(()stringoperator(\);) -preprocessor(#endif) - reserved(if) operator(()ident(q)operator(\)) operator({) - ident(borrow) operator(=) integer(0)operator(;) - ident(carry) operator(=) integer(0)operator(;) - reserved(do) operator({) -preprocessor(#ifdef) ident(ULLong) - ident(ys) operator(=) operator(*)ident(sx)operator(++) operator(*) operator(()ident(ULLong)operator(\))ident(q) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(ys) operator(>>) integer(32)operator(;) - ident(y) operator(=) operator(*)ident(bx) operator(-) operator(()ident(ys) operator(&) ident(FFFFFFFF)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) ident(y) operator(>>) integer(32) operator(&) operator(()ident(ULong)operator(\))integer(1)operator(;) - operator(*)ident(bx)operator(++) operator(=) ident(y) operator(&) ident(FFFFFFFF)operator(;) -preprocessor(#else) -preprocessor(#ifdef) ident(Pack_32) - ident(si) operator(=) operator(*)ident(sx)operator(++;) - ident(ys) operator(=) operator(()ident(si) operator(&) hex(0xffff)operator(\)) operator(*) ident(q) operator(+) ident(carry)operator(;) - ident(zs) operator(=) operator(()ident(si) operator(>>) integer(16)operator(\)) operator(*) ident(q) operator(+) operator(()ident(ys) operator(>>) integer(16)operator(\);) - ident(carry) operator(=) ident(zs) operator(>>) integer(16)operator(;) - ident(y) operator(=) operator((*)ident(bx) operator(&) hex(0xffff)operator(\)) operator(-) operator(()ident(ys) operator(&) hex(0xffff)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(y) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - ident(z) operator(=) operator((*)ident(bx) operator(>>) integer(16)operator(\)) operator(-) operator(()ident(zs) operator(&) hex(0xffff)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(z) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - ident(Storeinc)operator(()ident(bx)operator(,) ident(z)operator(,) ident(y)operator(\);) -preprocessor(#else) - ident(ys) operator(=) operator(*)ident(sx)operator(++) operator(*) ident(q) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(ys) operator(>>) integer(16)operator(;) - ident(y) operator(=) operator(*)ident(bx) operator(-) operator(()ident(ys) operator(&) hex(0xffff)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(y) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - operator(*)ident(bx)operator(++) operator(=) ident(y) operator(&) hex(0xffff)operator(;) -preprocessor(#endif) -preprocessor(#endif) - operator(}) reserved(while) operator(()ident(sx) operator(<=) ident(sxe)operator(\);) - reserved(if) operator((!*)ident(bxe)operator(\)) operator({) - ident(bx) operator(=) ident(b)operator(->)ident(x)operator(;) - reserved(while) operator((--)ident(bxe) operator(>) ident(bx) operator(&&) operator(!*)ident(bxe)operator(\)) - operator(--)ident(n)operator(;) - ident(b)operator(->)ident(wds) operator(=) ident(n)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(cmp)operator(()ident(b)operator(,) ident(S)operator(\)) operator(>=) integer(0)operator(\)) operator({) - ident(q)operator(++;) - ident(borrow) operator(=) integer(0)operator(;) - ident(carry) operator(=) integer(0)operator(;) - ident(bx) operator(=) ident(b)operator(->)ident(x)operator(;) - ident(sx) operator(=) ident(S)operator(->)ident(x)operator(;) - reserved(do) operator({) -preprocessor(#ifdef) ident(ULLong) - ident(ys) operator(=) operator(*)ident(sx)operator(++) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(ys) operator(>>) integer(32)operator(;) - ident(y) operator(=) operator(*)ident(bx) operator(-) operator(()ident(ys) operator(&) ident(FFFFFFFF)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) ident(y) operator(>>) integer(32) operator(&) operator(()ident(ULong)operator(\))integer(1)operator(;) - operator(*)ident(bx)operator(++) operator(=) ident(y) operator(&) ident(FFFFFFFF)operator(;) -preprocessor(#else) -preprocessor(#ifdef) ident(Pack_32) - ident(si) operator(=) operator(*)ident(sx)operator(++;) - ident(ys) operator(=) operator(()ident(si) operator(&) hex(0xffff)operator(\)) operator(+) ident(carry)operator(;) - ident(zs) operator(=) operator(()ident(si) operator(>>) integer(16)operator(\)) operator(+) operator(()ident(ys) operator(>>) integer(16)operator(\);) - ident(carry) operator(=) ident(zs) operator(>>) integer(16)operator(;) - ident(y) operator(=) operator((*)ident(bx) operator(&) hex(0xffff)operator(\)) operator(-) operator(()ident(ys) operator(&) hex(0xffff)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(y) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - ident(z) operator(=) operator((*)ident(bx) operator(>>) integer(16)operator(\)) operator(-) operator(()ident(zs) operator(&) hex(0xffff)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(z) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - ident(Storeinc)operator(()ident(bx)operator(,) ident(z)operator(,) ident(y)operator(\);) -preprocessor(#else) - ident(ys) operator(=) operator(*)ident(sx)operator(++) operator(+) ident(carry)operator(;) - ident(carry) operator(=) ident(ys) operator(>>) integer(16)operator(;) - ident(y) operator(=) operator(*)ident(bx) operator(-) operator(()ident(ys) operator(&) hex(0xffff)operator(\)) operator(-) ident(borrow)operator(;) - ident(borrow) operator(=) operator(()ident(y) operator(&) hex(0x10000)operator(\)) operator(>>) integer(16)operator(;) - operator(*)ident(bx)operator(++) operator(=) ident(y) operator(&) hex(0xffff)operator(;) -preprocessor(#endif) -preprocessor(#endif) - operator(}) reserved(while) operator(()ident(sx) operator(<=) ident(sxe)operator(\);) - ident(bx) operator(=) ident(b)operator(->)ident(x)operator(;) - ident(bxe) operator(=) ident(bx) operator(+) ident(n)operator(;) - reserved(if) operator((!*)ident(bxe)operator(\)) operator({) - reserved(while) operator((--)ident(bxe) operator(>) ident(bx) operator(&&) operator(!*)ident(bxe)operator(\)) - operator(--)ident(n)operator(;) - ident(b)operator(->)ident(wds) operator(=) ident(n)operator(;) - operator(}) - operator(}) - reserved(return) ident(q)operator(;) -operator(}) - -preprocessor(#ifndef) ident(MULTIPLE_THREADS) -directive(static) pre_type(char) operator(*)ident(dtoa_result)operator(;) -preprocessor(#endif) - -directive(static) pre_type(char) operator(*) -ident(rv_alloc)operator(()pre_type(int) ident(i)operator(\)) -operator({) - pre_type(int) ident(j)operator(,) ident(k)operator(,) operator(*)ident(r)operator(;) - - ident(j) operator(=) reserved(sizeof)operator(()ident(ULong)operator(\);) - reserved(for) operator(()ident(k) operator(=) integer(0)operator(;) - reserved(sizeof)operator(()ident(Bigint)operator(\)) operator(-) reserved(sizeof)operator(()ident(ULong)operator(\)) operator(-) reserved(sizeof)operator(()pre_type(int)operator(\)) operator(+) ident(j) operator(<=) ident(i)operator(;) - ident(j) operator(<<=) integer(1)operator(\)) - ident(k)operator(++;) - ident(r) operator(=) operator(()pre_type(int)operator(*\))ident(Balloc)operator(()ident(k)operator(\);) - operator(*)ident(r) operator(=) ident(k)operator(;) - reserved(return) -preprocessor(#ifndef) ident(MULTIPLE_THREADS) - ident(dtoa_result) operator(=) -preprocessor(#endif) - operator(()pre_type(char) operator(*\)()ident(r)operator(+)integer(1)operator(\);) -operator(}) - -directive(static) pre_type(char) operator(*) -ident(nrv_alloc)operator(()pre_type(char) operator(*)ident(s)operator(,) pre_type(char) operator(**)ident(rve)operator(,) pre_type(int) ident(n)operator(\)) -operator({) - pre_type(char) operator(*)ident(rv)operator(,) operator(*)ident(t)operator(;) - - ident(t) operator(=) ident(rv) operator(=) ident(rv_alloc)operator(()ident(n)operator(\);) - reserved(while) operator(((*)ident(t) operator(=) operator(*)ident(s)operator(++\)) operator(!=) integer(0)operator(\)) ident(t)operator(++;) - reserved(if) operator(()ident(rve)operator(\)) - operator(*)ident(rve) operator(=) ident(t)operator(;) - reserved(return) ident(rv)operator(;) -operator(}) - -comment(/* freedtoa(s\) must be used to free values s returned by dtoa - * when MULTIPLE_THREADS is #defined. It should be used in all cases, - * but for consistency with earlier versions of dtoa, it is optional - * when MULTIPLE_THREADS is not defined. - */) - -directive(void) -ident(freedtoa)operator(()pre_type(char) operator(*)ident(s)operator(\)) -operator({) - ident(Bigint) operator(*)ident(b) operator(=) operator(()ident(Bigint) operator(*\)(()pre_type(int) operator(*\))ident(s) operator(-) integer(1)operator(\);) - ident(b)operator(->)ident(maxwds) operator(=) integer(1) operator(<<) operator(()ident(b)operator(->)ident(k) operator(=) operator(*()pre_type(int)operator(*\))ident(b)operator(\);) - ident(Bfree)operator(()ident(b)operator(\);) -preprocessor(#ifndef) ident(MULTIPLE_THREADS) - reserved(if) operator(()ident(s) operator(==) ident(dtoa_result)operator(\)) - ident(dtoa_result) operator(=) integer(0)operator(;) -preprocessor(#endif) -operator(}) - -comment(/* dtoa for IEEE arithmetic (dmg\): convert double to ASCII string. - * - * Inspired by "How to Print Floating-Point Numbers Accurately" by - * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 112-126]. - * - * Modifications: - * 1. Rather than iterating, we use a simple numeric overestimate - * to determine k = floor(log10(d\)\). We scale relevant - * quantities using O(log2(k\)\) rather than O(k\) multiplications. - * 2. For some modes > 2 (corresponding to ecvt and fcvt\), we don't - * try to generate digits strictly left to right. Instead, we - * compute with fewer bits and propagate the carry if necessary - * when rounding the final digit up. This is often faster. - * 3. Under the assumption that input will be rounded nearest, - * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. - * That is, we allow equality in stopping tests when the - * round-nearest rule will give the same floating-point value - * as would satisfaction of the stopping test with strict - * inequality. - * 4. We remove common factors of powers of 2 from relevant - * quantities. - * 5. When converting floating-point integers less than 1e16, - * we use floating-point arithmetic rather than resorting - * to multiple-precision integers. - * 6. When asked to produce fewer than 15 digits, we first try - * to get by with floating-point arithmetic; we resort to - * multiple-precision integer arithmetic only if we cannot - * guarantee that the floating-point calculation has given - * the correctly rounded result. For k requested digits and - * "uniformly" distributed input, the probability is - * something like 10^(k-15\) that we must resort to the Long - * calculation. - */) - -pre_type(char) operator(*) -ident(dtoa)operator(()pre_type(double) ident(d)operator(,) pre_type(int) ident(mode)operator(,) pre_type(int) ident(ndigits)operator(,) pre_type(int) operator(*)ident(decpt)operator(,) pre_type(int) operator(*)ident(sign)operator(,) pre_type(char) operator(**)ident(rve)operator(\)) -operator({) - comment(/* Arguments ndigits, decpt, sign are similar to those - of ecvt and fcvt; trailing zeros are suppressed from - the returned string. If not null, *rve is set to point - to the end of the return value. If d is +-Infinity or NaN, - then *decpt is set to 9999. - - mode: - 0 ==> shortest string that yields d when read in - and rounded to nearest. - 1 ==> like 0, but with Steele & White stopping rule; - e.g. with IEEE P754 arithmetic , mode 0 gives - 1e23 whereas mode 1 gives 9.999999999999999e22. - 2 ==> max(1,ndigits\) significant digits. This gives a - return value similar to that of ecvt, except - that trailing zeros are suppressed. - 3 ==> through ndigits past the decimal point. This - gives a return value similar to that from fcvt, - except that trailing zeros are suppressed, and - ndigits can be negative. - 4,5 ==> similar to 2 and 3, respectively, but (in - round-nearest mode\) with the tests of mode 0 to - possibly return a shorter string that rounds to d. - With IEEE arithmetic and compilation with - -DHonor_FLT_ROUNDS, modes 4 and 5 behave the same - as modes 2 and 3 when FLT_ROUNDS != 1. - 6-9 ==> Debugging modes similar to mode - 4: don't try - fast floating-point estimate (if applicable\). - - Values of mode other than 0-9 are treated as mode 0. - - Sufficient space is allocated to the return value - to hold the suppressed trailing zeros. - */) - - pre_type(int) ident(bbits)operator(,) ident(b2)operator(,) ident(b5)operator(,) ident(be)operator(,) ident(dig)operator(,) ident(i)operator(,) ident(ieps)operator(,) ident(ilim)operator(,) ident(ilim0)operator(,) ident(ilim1)operator(,) - ident(j)operator(,) ident(j1)operator(,) ident(k)operator(,) ident(k0)operator(,) ident(k_check)operator(,) ident(leftright)operator(,) ident(m2)operator(,) ident(m5)operator(,) ident(s2)operator(,) ident(s5)operator(,) - ident(spec_case)operator(,) ident(try_quick)operator(;) - ident(Long) ident(L)operator(;) -preprocessor(#ifndef) ident(Sudden_Underflow) - pre_type(int) ident(denorm)operator(;) - ident(ULong) ident(x)operator(;) -preprocessor(#endif) - ident(Bigint) operator(*)ident(b)operator(,) operator(*)ident(b1)operator(,) operator(*)ident(delta)operator(,) operator(*)ident(mlo)operator(,) operator(*)ident(mhi)operator(,) operator(*)ident(S)operator(;) - pre_type(double) ident(d2)operator(,) ident(ds)operator(,) ident(eps)operator(;) - pre_type(char) operator(*)ident(s)operator(,) operator(*)ident(s0)operator(;) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - pre_type(int) ident(rounding)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(SET_INEXACT) - pre_type(int) ident(inexact)operator(,) ident(oldinexact)operator(;) -preprocessor(#endif) - -preprocessor(#ifndef) ident(MULTIPLE_THREADS) - reserved(if) operator(()ident(dtoa_result)operator(\)) operator({) - ident(freedtoa)operator(()ident(dtoa_result)operator(\);) - ident(dtoa_result) operator(=) integer(0)operator(;) - operator(}) -preprocessor(#endif) - - reserved(if) operator(()ident(word0)operator(()ident(d)operator(\)) operator(&) ident(Sign_bit)operator(\)) operator({) - comment(/* set sign for everything, including 0's and NaNs */) - operator(*)ident(sign) operator(=) integer(1)operator(;) - ident(word0)operator(()ident(d)operator(\)) operator(&=) operator(~)ident(Sign_bit)operator(;) comment(/* clear sign bit */) - operator(}) - reserved(else) - operator(*)ident(sign) operator(=) integer(0)operator(;) - -preprocessor(#if) ident(defined)operator(()ident(IEEE_Arith)operator(\)) operator(+) ident(defined)operator(()ident(VAX)operator(\)) -preprocessor(#ifdef) ident(IEEE_Arith) - reserved(if) operator((()ident(word0)operator(()ident(d)operator(\)) operator(&) ident(Exp_mask)operator(\)) operator(==) ident(Exp_mask)operator(\)) -preprocessor(#else) - reserved(if) operator(()ident(word0)operator(()ident(d)operator(\)) operator(==) hex(0x8000)operator(\)) -preprocessor(#endif) - operator({) - comment(/* Infinity or NaN */) - operator(*)ident(decpt) operator(=) integer(9999)operator(;) -preprocessor(#ifdef) ident(IEEE_Arith) - reserved(if) operator((!)ident(word1)operator(()ident(d)operator(\)) operator(&&) operator(!()ident(word0)operator(()ident(d)operator(\)) operator(&) hex(0xfffff)operator(\)\)) - reserved(return) ident(nrv_alloc)operator(()stringoperator(,) ident(rve)operator(,) integer(8)operator(\);) -preprocessor(#endif) - reserved(return) ident(nrv_alloc)operator(()stringoperator(,) ident(rve)operator(,) integer(3)operator(\);) - operator(}) -preprocessor(#endif) -preprocessor(#ifdef) ident(IBM) - ident(dval)operator(()ident(d)operator(\)) operator(+=) integer(0)operator(;) comment(/* normalize */) -preprocessor(#endif) - reserved(if) operator((!)ident(dval)operator(()ident(d)operator(\)\)) operator({) - operator(*)ident(decpt) operator(=) integer(1)operator(;) - reserved(return) ident(nrv_alloc)operator(()stringoperator(,) ident(rve)operator(,) integer(1)operator(\);) - operator(}) - -preprocessor(#ifdef) ident(SET_INEXACT) - ident(try_quick) operator(=) ident(oldinexact) operator(=) ident(get_inexact)operator((\);) - ident(inexact) operator(=) integer(1)operator(;) -preprocessor(#endif) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - reserved(if) operator((()ident(rounding) operator(=) ident(Flt_Rounds)operator(\)) operator(>=) integer(2)operator(\)) operator({) - reserved(if) operator((*)ident(sign)operator(\)) - ident(rounding) operator(=) ident(rounding) operator(==) integer(2) operator(?) integer(0) operator(:) integer(2)operator(;) - reserved(else) - reserved(if) operator(()ident(rounding) operator(!=) integer(2)operator(\)) - ident(rounding) operator(=) integer(0)operator(;) - operator(}) -preprocessor(#endif) - - ident(b) operator(=) ident(d2b)operator(()ident(dval)operator(()ident(d)operator(\),) operator(&)ident(be)operator(,) operator(&)ident(bbits)operator(\);) -preprocessor(#ifdef) ident(Sudden_Underflow) - ident(i) operator(=) operator(()pre_type(int)operator(\)()ident(word0)operator(()ident(d)operator(\)) operator(>>) ident(Exp_shift1) operator(&) operator(()ident(Exp_mask)operator(>>)ident(Exp_shift1)operator(\)\);) -preprocessor(#else) - reserved(if) operator((()ident(i) operator(=) operator(()pre_type(int)operator(\)()ident(word0)operator(()ident(d)operator(\)) operator(>>) ident(Exp_shift1) operator(&) operator(()ident(Exp_mask)operator(>>)ident(Exp_shift1)operator(\)\)\)) operator(!=) integer(0)operator(\)) operator({) -preprocessor(#endif) - ident(dval)operator(()ident(d2)operator(\)) operator(=) ident(dval)operator(()ident(d)operator(\);) - ident(word0)operator(()ident(d2)operator(\)) operator(&=) ident(Frac_mask1)operator(;) - ident(word0)operator(()ident(d2)operator(\)) operator(|=) ident(Exp_11)operator(;) -preprocessor(#ifdef) ident(IBM) - reserved(if) operator(()ident(j) operator(=) integer(11) operator(-) ident(hi0bits)operator(()ident(word0)operator(()ident(d2)operator(\)) operator(&) ident(Frac_mask)operator(\)\)) - ident(dval)operator(()ident(d2)operator(\)) operator(/=) integer(1) operator(<<) ident(j)operator(;) -preprocessor(#endif) - - comment(/* log(x\) ~=~ log(1.5\) + (x-1.5\)/1.5 - * log10(x\) = log(x\) / log(10\) - * ~=~ log(1.5\)/log(10\) + (x-1.5\)/(1.5*log(10\)\) - * log10(d\) = (i-Bias\)*log(2\)/log(10\) + log10(d2\) - * - * This suggests computing an approximation k to log10(d\) by - * - * k = (i - Bias\)*0.301029995663981 - * + ( (d2-1.5\)*0.289529654602168 + 0.176091259055681 \); - * - * We want k to be too large rather than too small. - * The error in the first-order Taylor series approximation - * is in our favor, so we just round up the constant enough - * to compensate for any error in the multiplication of - * (i - Bias\) by 0.301029995663981; since |i - Bias| <= 1077, - * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, - * adding 1e-13 to the constant term more than suffices. - * Hence we adjust the constant term to 0.1760912590558. - * (We could get a more accurate k by invoking log10, - * but this is probably not worthwhile.\) - */) - - ident(i) operator(-=) ident(Bias)operator(;) -preprocessor(#ifdef) ident(IBM) - ident(i) operator(<<=) integer(2)operator(;) - ident(i) operator(+=) ident(j)operator(;) -preprocessor(#endif) -preprocessor(#ifndef) ident(Sudden_Underflow) - ident(denorm) operator(=) integer(0)operator(;) - operator(}) - reserved(else) operator({) - comment(/* d is denormalized */) - - ident(i) operator(=) ident(bbits) operator(+) ident(be) operator(+) operator(()ident(Bias) operator(+) operator(()ident(P)operator(-)integer(1)operator(\)) operator(-) integer(1)operator(\);) - ident(x) operator(=) ident(i) operator(>) integer(32) operator(?) ident(word0)operator(()ident(d)operator(\)) operator(<<) operator(()integer(64) operator(-) ident(i)operator(\)) operator(|) ident(word1)operator(()ident(d)operator(\)) operator(>>) operator(()ident(i) operator(-) integer(32)operator(\)) - operator(:) ident(word1)operator(()ident(d)operator(\)) operator(<<) operator(()integer(32) operator(-) ident(i)operator(\);) - ident(dval)operator(()ident(d2)operator(\)) operator(=) ident(x)operator(;) - ident(word0)operator(()ident(d2)operator(\)) operator(-=) integer(31)operator(*)ident(Exp_msk1)operator(;) comment(/* adjust exponent */) - ident(i) operator(-=) operator(()ident(Bias) operator(+) operator(()ident(P)operator(-)integer(1)operator(\)) operator(-) integer(1)operator(\)) operator(+) integer(1)operator(;) - ident(denorm) operator(=) integer(1)operator(;) - operator(}) -preprocessor(#endif) - ident(ds) operator(=) operator(()ident(dval)operator(()ident(d2)operator(\)-)float(1)float(.5)operator(\)*)float(0)float(.289529654602168) operator(+) float(0)float(.1760912590558) operator(+) ident(i)operator(*)float(0)float(.301029995663981)operator(;) - ident(k) operator(=) operator(()pre_type(int)operator(\))ident(ds)operator(;) - reserved(if) operator(()ident(ds) operator(<) float(0)operator(.) operator(&&) ident(ds) operator(!=) ident(k)operator(\)) - ident(k)operator(--;) comment(/* want k = floor(ds\) */) - ident(k_check) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(k) operator(>=) integer(0) operator(&&) ident(k) operator(<=) ident(Ten_pmax)operator(\)) operator({) - reserved(if) operator(()ident(dval)operator(()ident(d)operator(\)) operator(<) ident(tens)operator([)ident(k)operator(]\)) - ident(k)operator(--;) - ident(k_check) operator(=) integer(0)operator(;) - operator(}) - ident(j) operator(=) ident(bbits) operator(-) ident(i) operator(-) integer(1)operator(;) - reserved(if) operator(()ident(j) operator(>=) integer(0)operator(\)) operator({) - ident(b2) operator(=) integer(0)operator(;) - ident(s2) operator(=) ident(j)operator(;) - operator(}) - reserved(else) operator({) - ident(b2) operator(=) operator(-)ident(j)operator(;) - ident(s2) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(k) operator(>=) integer(0)operator(\)) operator({) - ident(b5) operator(=) integer(0)operator(;) - ident(s5) operator(=) ident(k)operator(;) - ident(s2) operator(+=) ident(k)operator(;) - operator(}) - reserved(else) operator({) - ident(b2) operator(-=) ident(k)operator(;) - ident(b5) operator(=) operator(-)ident(k)operator(;) - ident(s5) operator(=) integer(0)operator(;) - operator(}) - reserved(if) operator(()ident(mode) operator(<) integer(0) operator(||) ident(mode) operator(>) integer(9)operator(\)) - ident(mode) operator(=) integer(0)operator(;) - -preprocessor(#ifndef) ident(SET_INEXACT) -preprocessor(#ifdef) ident(Check_FLT_ROUNDS) - ident(try_quick) operator(=) ident(Rounding) operator(==) integer(1)operator(;) -preprocessor(#else) - ident(try_quick) operator(=) integer(1)operator(;) -preprocessor(#endif) -preprocessor(#endif) comment(/*SET_INEXACT*/) - - reserved(if) operator(()ident(mode) operator(>) integer(5)operator(\)) operator({) - ident(mode) operator(-=) integer(4)operator(;) - ident(try_quick) operator(=) integer(0)operator(;) - operator(}) - ident(leftright) operator(=) integer(1)operator(;) - ident(ilim) operator(=) ident(ilim1) operator(=) operator(-)integer(1)operator(;) - reserved(switch) operator(()ident(mode)operator(\)) operator({) - reserved(case) integer(0)operator(:) - reserved(case) integer(1)operator(:) - ident(i) operator(=) integer(18)operator(;) - ident(ndigits) operator(=) integer(0)operator(;) - reserved(break)operator(;) - reserved(case) integer(2)operator(:) - ident(leftright) operator(=) integer(0)operator(;) - comment(/* no break */) - reserved(case) integer(4)operator(:) - reserved(if) operator(()ident(ndigits) operator(<=) integer(0)operator(\)) - ident(ndigits) operator(=) integer(1)operator(;) - ident(ilim) operator(=) ident(ilim1) operator(=) ident(i) operator(=) ident(ndigits)operator(;) - reserved(break)operator(;) - reserved(case) integer(3)operator(:) - ident(leftright) operator(=) integer(0)operator(;) - comment(/* no break */) - reserved(case) integer(5)operator(:) - ident(i) operator(=) ident(ndigits) operator(+) ident(k) operator(+) integer(1)operator(;) - ident(ilim) operator(=) ident(i)operator(;) - ident(ilim1) operator(=) ident(i) operator(-) integer(1)operator(;) - reserved(if) operator(()ident(i) operator(<=) integer(0)operator(\)) - ident(i) operator(=) integer(1)operator(;) - operator(}) - ident(s) operator(=) ident(s0) operator(=) ident(rv_alloc)operator(()ident(i)operator(+)integer(1)operator(\);) - -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - reserved(if) operator(()ident(mode) operator(>) integer(1) operator(&&) ident(rounding) operator(!=) integer(1)operator(\)) - ident(leftright) operator(=) integer(0)operator(;) -preprocessor(#endif) - - reserved(if) operator(()ident(ilim) operator(>=) integer(0) operator(&&) ident(ilim) operator(<=) ident(Quick_max) operator(&&) ident(try_quick)operator(\)) operator({) - - comment(/* Try to get by with floating-point arithmetic. */) - - ident(i) operator(=) integer(0)operator(;) - ident(dval)operator(()ident(d2)operator(\)) operator(=) ident(dval)operator(()ident(d)operator(\);) - ident(k0) operator(=) ident(k)operator(;) - ident(ilim0) operator(=) ident(ilim)operator(;) - ident(ieps) operator(=) integer(2)operator(;) comment(/* conservative */) - reserved(if) operator(()ident(k) operator(>) integer(0)operator(\)) operator({) - ident(ds) operator(=) ident(tens)operator([)ident(k)operator(&)hex(0xf)operator(];) - ident(j) operator(=) ident(k) operator(>>) integer(4)operator(;) - reserved(if) operator(()ident(j) operator(&) ident(Bletch)operator(\)) operator({) - comment(/* prevent overflows */) - ident(j) operator(&=) ident(Bletch) operator(-) integer(1)operator(;) - ident(dval)operator(()ident(d)operator(\)) operator(/=) ident(bigtens)operator([)ident(n_bigtens)operator(-)integer(1)operator(];) - ident(ieps)operator(++;) - operator(}) - reserved(for) operator((;) ident(j)operator(;) ident(j) operator(>>=) integer(1)operator(,) ident(i)operator(++\)) - reserved(if) operator(()ident(j) operator(&) integer(1)operator(\)) operator({) - ident(ieps)operator(++;) - ident(ds) operator(*=) ident(bigtens)operator([)ident(i)operator(];) - operator(}) - ident(dval)operator(()ident(d)operator(\)) operator(/=) ident(ds)operator(;) - operator(}) - reserved(else) reserved(if) operator((()ident(j1) operator(=) operator(-)ident(k)operator(\)) operator(!=) integer(0)operator(\)) operator({) - ident(dval)operator(()ident(d)operator(\)) operator(*=) ident(tens)operator([)ident(j1) operator(&) hex(0xf)operator(];) - reserved(for) operator(()ident(j) operator(=) ident(j1) operator(>>) integer(4)operator(;) ident(j)operator(;) ident(j) operator(>>=) integer(1)operator(,) ident(i)operator(++\)) - reserved(if) operator(()ident(j) operator(&) integer(1)operator(\)) operator({) - ident(ieps)operator(++;) - ident(dval)operator(()ident(d)operator(\)) operator(*=) ident(bigtens)operator([)ident(i)operator(];) - operator(}) - operator(}) - reserved(if) operator(()ident(k_check) operator(&&) ident(dval)operator(()ident(d)operator(\)) operator(<) float(1)operator(.) operator(&&) ident(ilim) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(ilim1) operator(<=) integer(0)operator(\)) - reserved(goto) ident(fast_failed)operator(;) - ident(ilim) operator(=) ident(ilim1)operator(;) - ident(k)operator(--;) - ident(dval)operator(()ident(d)operator(\)) operator(*=) integer(1)float(0)operator(.)operator(;) - ident(ieps)operator(++;) - operator(}) - ident(dval)operator(()ident(eps)operator(\)) operator(=) ident(ieps)operator(*)ident(dval)operator(()ident(d)operator(\)) operator(+) float(7)operator(.)operator(;) - ident(word0)operator(()ident(eps)operator(\)) operator(-=) operator(()ident(P)operator(-)integer(1)operator(\)*)ident(Exp_msk1)operator(;) - reserved(if) operator(()ident(ilim) operator(==) integer(0)operator(\)) operator({) - ident(S) operator(=) ident(mhi) operator(=) integer(0)operator(;) - ident(dval)operator(()ident(d)operator(\)) operator(-=) float(5)operator(.)operator(;) - reserved(if) operator(()ident(dval)operator(()ident(d)operator(\)) operator(>) ident(dval)operator(()ident(eps)operator(\)\)) - reserved(goto) ident(one_digit)operator(;) - reserved(if) operator(()ident(dval)operator(()ident(d)operator(\)) operator(<) operator(-)ident(dval)operator(()ident(eps)operator(\)\)) - reserved(goto) ident(no_digits)operator(;) - reserved(goto) ident(fast_failed)operator(;) - operator(}) -preprocessor(#ifndef) ident(No_leftright) - reserved(if) operator(()ident(leftright)operator(\)) operator({) - comment(/* Use Steele & White method of only - * generating digits needed. - */) - ident(dval)operator(()ident(eps)operator(\)) operator(=) float(0)float(.5)operator(/)ident(tens)operator([)ident(ilim)operator(-)integer(1)operator(]) operator(-) ident(dval)operator(()ident(eps)operator(\);) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;;\)) operator({) - ident(L) operator(=) ident(dval)operator(()ident(d)operator(\);) - ident(dval)operator(()ident(d)operator(\)) operator(-=) ident(L)operator(;) - operator(*)ident(s)operator(++) operator(=) char('0') operator(+) operator(()pre_type(int)operator(\))ident(L)operator(;) - reserved(if) operator(()ident(dval)operator(()ident(d)operator(\)) operator(<) ident(dval)operator(()ident(eps)operator(\)\)) - reserved(goto) ident(ret1)operator(;) - reserved(if) operator(()float(1)operator(.) operator(-) ident(dval)operator(()ident(d)operator(\)) operator(<) ident(dval)operator(()ident(eps)operator(\)\)) - reserved(goto) ident(bump_up)operator(;) - reserved(if) operator((++)ident(i) operator(>=) ident(ilim)operator(\)) - reserved(break)operator(;) - ident(dval)operator(()ident(eps)operator(\)) operator(*=) integer(1)float(0)operator(.)operator(;) - ident(dval)operator(()ident(d)operator(\)) operator(*=) integer(1)float(0)operator(.)operator(;) - operator(}) - operator(}) - reserved(else) operator({) -preprocessor(#endif) - comment(/* Generate ilim digits, then fix them up. */) - ident(dval)operator(()ident(eps)operator(\)) operator(*=) ident(tens)operator([)ident(ilim)operator(-)integer(1)operator(];) - reserved(for) operator(()ident(i) operator(=) integer(1)operator(;;) ident(i)operator(++,) ident(dval)operator(()ident(d)operator(\)) operator(*=) integer(1)float(0)operator(.)operator(\)) operator({) - ident(L) operator(=) operator(()ident(Long)operator(\)()ident(dval)operator(()ident(d)operator(\)\);) - reserved(if) operator((!()ident(dval)operator(()ident(d)operator(\)) operator(-=) ident(L)operator(\)\)) - ident(ilim) operator(=) ident(i)operator(;) - operator(*)ident(s)operator(++) operator(=) char('0') operator(+) operator(()pre_type(int)operator(\))ident(L)operator(;) - reserved(if) operator(()ident(i) operator(==) ident(ilim)operator(\)) operator({) - reserved(if) operator(()ident(dval)operator(()ident(d)operator(\)) operator(>) float(0)float(.5) operator(+) ident(dval)operator(()ident(eps)operator(\)\)) - reserved(goto) ident(bump_up)operator(;) - reserved(else) reserved(if) operator(()ident(dval)operator(()ident(d)operator(\)) operator(<) float(0)float(.5) operator(-) ident(dval)operator(()ident(eps)operator(\)\)) operator({) - reserved(while) operator((*--)ident(s) operator(==) char('0')operator(\)) operator(;) - ident(s)operator(++;) - reserved(goto) ident(ret1)operator(;) - operator(}) - reserved(break)operator(;) - operator(}) - operator(}) -preprocessor(#ifndef) ident(No_leftright) - operator(}) -preprocessor(#endif) -label(fast_failed:) - ident(s) operator(=) ident(s0)operator(;) - ident(dval)operator(()ident(d)operator(\)) operator(=) ident(dval)operator(()ident(d2)operator(\);) - ident(k) operator(=) ident(k0)operator(;) - ident(ilim) operator(=) ident(ilim0)operator(;) - operator(}) - - comment(/* Do we have a "small" integer? */) - - reserved(if) operator(()ident(be) operator(>=) integer(0) operator(&&) ident(k) operator(<=) ident(Int_max)operator(\)) operator({) - comment(/* Yes. */) - ident(ds) operator(=) ident(tens)operator([)ident(k)operator(];) - reserved(if) operator(()ident(ndigits) operator(<) integer(0) operator(&&) ident(ilim) operator(<=) integer(0)operator(\)) operator({) - ident(S) operator(=) ident(mhi) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(ilim) operator(<) integer(0) operator(||) ident(dval)operator(()ident(d)operator(\)) operator(<=) integer(5)operator(*)ident(ds)operator(\)) - reserved(goto) ident(no_digits)operator(;) - reserved(goto) ident(one_digit)operator(;) - operator(}) - reserved(for) operator(()ident(i) operator(=) integer(1)operator(;;) ident(i)operator(++,) ident(dval)operator(()ident(d)operator(\)) operator(*=) integer(1)float(0)operator(.)operator(\)) operator({) - ident(L) operator(=) operator(()ident(Long)operator(\)()ident(dval)operator(()ident(d)operator(\)) operator(/) ident(ds)operator(\);) - ident(dval)operator(()ident(d)operator(\)) operator(-=) ident(L)operator(*)ident(ds)operator(;) -preprocessor(#ifdef) ident(Check_FLT_ROUNDS) - comment(/* If FLT_ROUNDS == 2, L will usually be high by 1 */) - reserved(if) operator(()ident(dval)operator(()ident(d)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(L)operator(--;) - ident(dval)operator(()ident(d)operator(\)) operator(+=) ident(ds)operator(;) - operator(}) -preprocessor(#endif) - operator(*)ident(s)operator(++) operator(=) char('0') operator(+) operator(()pre_type(int)operator(\))ident(L)operator(;) - reserved(if) operator((!)ident(dval)operator(()ident(d)operator(\)\)) operator({) -preprocessor(#ifdef) ident(SET_INEXACT) - ident(inexact) operator(=) integer(0)operator(;) -preprocessor(#endif) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(i) operator(==) ident(ilim)operator(\)) operator({) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - reserved(if) operator(()ident(mode) operator(>) integer(1)operator(\)) - reserved(switch) operator(()ident(rounding)operator(\)) operator({) - reserved(case) integer(0)operator(:) reserved(goto) ident(ret1)operator(;) - reserved(case) integer(2)operator(:) reserved(goto) ident(bump_up)operator(;) - operator(}) -preprocessor(#endif) - ident(dval)operator(()ident(d)operator(\)) operator(+=) ident(dval)operator(()ident(d)operator(\);) - reserved(if) operator(()ident(dval)operator(()ident(d)operator(\)) operator(>) ident(ds) operator(||) operator(()ident(dval)operator(()ident(d)operator(\)) operator(==) ident(ds) operator(&&) operator(()ident(L) operator(&) integer(1)operator(\)\)\)) operator({) -label(bump_up:) - reserved(while) operator((*--)ident(s) operator(==) char('9')operator(\)) - reserved(if) operator(()ident(s) operator(==) ident(s0)operator(\)) operator({) - ident(k)operator(++;) - operator(*)ident(s) operator(=) char('0')operator(;) - reserved(break)operator(;) - operator(}) - operator(++*)ident(s)operator(++;) - operator(}) - reserved(break)operator(;) - operator(}) - operator(}) - reserved(goto) ident(ret1)operator(;) - operator(}) - - ident(m2) operator(=) ident(b2)operator(;) - ident(m5) operator(=) ident(b5)operator(;) - ident(mhi) operator(=) ident(mlo) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(leftright)operator(\)) operator({) - ident(i) operator(=) -preprocessor(#ifndef) ident(Sudden_Underflow) - ident(denorm) operator(?) ident(be) operator(+) operator(()ident(Bias) operator(+) operator(()ident(P)operator(-)integer(1)operator(\)) operator(-) integer(1) operator(+) integer(1)operator(\)) operator(:) -preprocessor(#endif) -preprocessor(#ifdef) ident(IBM) - integer(1) operator(+) integer(4)operator(*)ident(P) operator(-) integer(3) operator(-) ident(bbits) operator(+) operator((()ident(bbits) operator(+) ident(be) operator(-) integer(1)operator(\)) operator(&) integer(3)operator(\);) -preprocessor(#else) - integer(1) operator(+) ident(P) operator(-) ident(bbits)operator(;) -preprocessor(#endif) - ident(b2) operator(+=) ident(i)operator(;) - ident(s2) operator(+=) ident(i)operator(;) - ident(mhi) operator(=) ident(i2b)operator(()integer(1)operator(\);) - operator(}) - reserved(if) operator(()ident(m2) operator(>) integer(0) operator(&&) ident(s2) operator(>) integer(0)operator(\)) operator({) - ident(i) operator(=) ident(m2) operator(<) ident(s2) operator(?) ident(m2) operator(:) ident(s2)operator(;) - ident(b2) operator(-=) ident(i)operator(;) - ident(m2) operator(-=) ident(i)operator(;) - ident(s2) operator(-=) ident(i)operator(;) - operator(}) - reserved(if) operator(()ident(b5) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(leftright)operator(\)) operator({) - reserved(if) operator(()ident(m5) operator(>) integer(0)operator(\)) operator({) - ident(mhi) operator(=) ident(pow5mult)operator(()ident(mhi)operator(,) ident(m5)operator(\);) - ident(b1) operator(=) ident(mult)operator(()ident(mhi)operator(,) ident(b)operator(\);) - ident(Bfree)operator(()ident(b)operator(\);) - ident(b) operator(=) ident(b1)operator(;) - operator(}) - reserved(if) operator((()ident(j) operator(=) ident(b5) operator(-) ident(m5)operator(\)) operator(!=) integer(0)operator(\)) - ident(b) operator(=) ident(pow5mult)operator(()ident(b)operator(,) ident(j)operator(\);) - operator(}) - reserved(else) - ident(b) operator(=) ident(pow5mult)operator(()ident(b)operator(,) ident(b5)operator(\);) - operator(}) - ident(S) operator(=) ident(i2b)operator(()integer(1)operator(\);) - reserved(if) operator(()ident(s5) operator(>) integer(0)operator(\)) - ident(S) operator(=) ident(pow5mult)operator(()ident(S)operator(,) ident(s5)operator(\);) - - comment(/* Check for special case that d is a normalized power of 2. */) - - ident(spec_case) operator(=) integer(0)operator(;) - reserved(if) operator((()ident(mode) operator(<) integer(2) operator(||) ident(leftright)operator(\)) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - operator(&&) ident(rounding) operator(==) integer(1) -preprocessor(#endif) - operator(\)) operator({) - reserved(if) operator((!)ident(word1)operator(()ident(d)operator(\)) operator(&&) operator(!()ident(word0)operator(()ident(d)operator(\)) operator(&) ident(Bndry_mask)operator(\)) -preprocessor(#ifndef) ident(Sudden_Underflow) - operator(&&) ident(word0)operator(()ident(d)operator(\)) operator(&) operator(()ident(Exp_mask) operator(&) operator(~)ident(Exp_msk1)operator(\)) -preprocessor(#endif) - operator(\)) operator({) - comment(/* The special case */) - ident(b2) operator(+=) ident(Log2P)operator(;) - ident(s2) operator(+=) ident(Log2P)operator(;) - ident(spec_case) operator(=) integer(1)operator(;) - operator(}) - operator(}) - - comment(/* Arrange for convenient computation of quotients: - * shift left if necessary so divisor has 4 leading 0 bits. - * - * Perhaps we should just compute leading 28 bits of S once - * and for all and pass them and a shift to quorem, so it - * can do shifts and ors to compute the numerator for q. - */) -preprocessor(#ifdef) ident(Pack_32) - reserved(if) operator((()ident(i) operator(=) operator((()ident(s5) operator(?) integer(32) operator(-) ident(hi0bits)operator(()ident(S)operator(->)ident(x)operator([)ident(S)operator(->)ident(wds)operator(-)integer(1)operator(]\)) operator(:) integer(1)operator(\)) operator(+) ident(s2)operator(\)) operator(&) hex(0x1f)operator(\)) operator(!=) integer(0)operator(\)) - ident(i) operator(=) integer(32) operator(-) ident(i)operator(;) -preprocessor(#else) - reserved(if) operator((()ident(i) operator(=) operator((()ident(s5) operator(?) integer(32) operator(-) ident(hi0bits)operator(()ident(S)operator(->)ident(x)operator([)ident(S)operator(->)ident(wds)operator(-)integer(1)operator(]\)) operator(:) integer(1)operator(\)) operator(+) ident(s2)operator(\)) operator(&) hex(0xf)operator(\)) operator(!=) integer(0)operator(\)) - ident(i) operator(=) integer(16) operator(-) ident(i)operator(;) -preprocessor(#endif) - reserved(if) operator(()ident(i) operator(>) integer(4)operator(\)) operator({) - ident(i) operator(-=) integer(4)operator(;) - ident(b2) operator(+=) ident(i)operator(;) - ident(m2) operator(+=) ident(i)operator(;) - ident(s2) operator(+=) ident(i)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(i) operator(<) integer(4)operator(\)) operator({) - ident(i) operator(+=) integer(28)operator(;) - ident(b2) operator(+=) ident(i)operator(;) - ident(m2) operator(+=) ident(i)operator(;) - ident(s2) operator(+=) ident(i)operator(;) - operator(}) - reserved(if) operator(()ident(b2) operator(>) integer(0)operator(\)) - ident(b) operator(=) ident(lshift)operator(()ident(b)operator(,) ident(b2)operator(\);) - reserved(if) operator(()ident(s2) operator(>) integer(0)operator(\)) - ident(S) operator(=) ident(lshift)operator(()ident(S)operator(,) ident(s2)operator(\);) - reserved(if) operator(()ident(k_check)operator(\)) operator({) - reserved(if) operator(()ident(cmp)operator(()ident(b)operator(,)ident(S)operator(\)) operator(<) integer(0)operator(\)) operator({) - ident(k)operator(--;) - ident(b) operator(=) ident(multadd)operator(()ident(b)operator(,) integer(10)operator(,) integer(0)operator(\);) comment(/* we botched the k estimate */) - reserved(if) operator(()ident(leftright)operator(\)) - ident(mhi) operator(=) ident(multadd)operator(()ident(mhi)operator(,) integer(10)operator(,) integer(0)operator(\);) - ident(ilim) operator(=) ident(ilim1)operator(;) - operator(}) - operator(}) - reserved(if) operator(()ident(ilim) operator(<=) integer(0) operator(&&) operator(()ident(mode) operator(==) integer(3) operator(||) ident(mode) operator(==) integer(5)operator(\)\)) operator({) - reserved(if) operator(()ident(ilim) operator(<) integer(0) operator(||) ident(cmp)operator(()ident(b)operator(,)ident(S) operator(=) ident(multadd)operator(()ident(S)operator(,)integer(5)operator(,)integer(0)operator(\)\)) operator(<=) integer(0)operator(\)) operator({) - comment(/* no digits, fcvt style */) -label(no_digits:) - ident(k) operator(=) operator(-)integer(1) operator(-) ident(ndigits)operator(;) - reserved(goto) ident(ret)operator(;) - operator(}) -label(one_digit:) - operator(*)ident(s)operator(++) operator(=) char('1')operator(;) - ident(k)operator(++;) - reserved(goto) ident(ret)operator(;) - operator(}) - reserved(if) operator(()ident(leftright)operator(\)) operator({) - reserved(if) operator(()ident(m2) operator(>) integer(0)operator(\)) - ident(mhi) operator(=) ident(lshift)operator(()ident(mhi)operator(,) ident(m2)operator(\);) - - comment(/* Compute mlo -- check for special case - * that d is a normalized power of 2. - */) - - ident(mlo) operator(=) ident(mhi)operator(;) - reserved(if) operator(()ident(spec_case)operator(\)) operator({) - ident(mhi) operator(=) ident(Balloc)operator(()ident(mhi)operator(->)ident(k)operator(\);) - ident(Bcopy)operator(()ident(mhi)operator(,) ident(mlo)operator(\);) - ident(mhi) operator(=) ident(lshift)operator(()ident(mhi)operator(,) ident(Log2P)operator(\);) - operator(}) - - reserved(for) operator(()ident(i) operator(=) integer(1)operator(;;)ident(i)operator(++\)) operator({) - ident(dig) operator(=) ident(quorem)operator(()ident(b)operator(,)ident(S)operator(\)) operator(+) char('0')operator(;) - comment(/* Do we yet have the shortest decimal string - * that will round to d? - */) - ident(j) operator(=) ident(cmp)operator(()ident(b)operator(,) ident(mlo)operator(\);) - ident(delta) operator(=) ident(diff)operator(()ident(S)operator(,) ident(mhi)operator(\);) - ident(j1) operator(=) ident(delta)operator(->)ident(sign) operator(?) integer(1) operator(:) ident(cmp)operator(()ident(b)operator(,) ident(delta)operator(\);) - ident(Bfree)operator(()ident(delta)operator(\);) -preprocessor(#ifndef) ident(ROUND_BIASED) - reserved(if) operator(()ident(j1) operator(==) integer(0) operator(&&) ident(mode) operator(!=) integer(1) operator(&&) operator(!()ident(word1)operator(()ident(d)operator(\)) operator(&) integer(1)operator(\)) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - operator(&&) ident(rounding) operator(>=) integer(1) -preprocessor(#endif) - operator(\)) operator({) - reserved(if) operator(()ident(dig) operator(==) char('9')operator(\)) - reserved(goto) ident(round_9_up)operator(;) - reserved(if) operator(()ident(j) operator(>) integer(0)operator(\)) - ident(dig)operator(++;) -preprocessor(#ifdef) ident(SET_INEXACT) - reserved(else) reserved(if) operator((!)ident(b)operator(->)ident(x)operator([)integer(0)operator(]) operator(&&) ident(b)operator(->)ident(wds) operator(<=) integer(1)operator(\)) - ident(inexact) operator(=) integer(0)operator(;) -preprocessor(#endif) - operator(*)ident(s)operator(++) operator(=) ident(dig)operator(;) - reserved(goto) ident(ret)operator(;) - operator(}) -preprocessor(#endif) - reserved(if) operator(()ident(j) operator(<) integer(0) operator(||) operator(()ident(j) operator(==) integer(0) operator(&&) ident(mode) operator(!=) integer(1) -preprocessor(#ifndef) ident(ROUND_BIASED) - operator(&&) operator(!()ident(word1)operator(()ident(d)operator(\)) operator(&) integer(1)operator(\)) -preprocessor(#endif) - operator(\)\)) operator({) - reserved(if) operator((!)ident(b)operator(->)ident(x)operator([)integer(0)operator(]) operator(&&) ident(b)operator(->)ident(wds) operator(<=) integer(1)operator(\)) operator({) -preprocessor(#ifdef) ident(SET_INEXACT) - ident(inexact) operator(=) integer(0)operator(;) -preprocessor(#endif) - reserved(goto) ident(accept_dig)operator(;) - operator(}) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - reserved(if) operator(()ident(mode) operator(>) integer(1)operator(\)) - reserved(switch) operator(()ident(rounding)operator(\)) operator({) - reserved(case) integer(0)operator(:) reserved(goto) ident(accept_dig)operator(;) - reserved(case) integer(2)operator(:) reserved(goto) ident(keep_dig)operator(;) - operator(}) -preprocessor(#endif) comment(/*Honor_FLT_ROUNDS*/) - reserved(if) operator(()ident(j1) operator(>) integer(0)operator(\)) operator({) - ident(b) operator(=) ident(lshift)operator(()ident(b)operator(,) integer(1)operator(\);) - ident(j1) operator(=) ident(cmp)operator(()ident(b)operator(,) ident(S)operator(\);) - reserved(if) operator((()ident(j1) operator(>) integer(0) operator(||) operator(()ident(j1) operator(==) integer(0) operator(&&) operator(()ident(dig) operator(&) integer(1)operator(\)\)\)) operator(&&) ident(dig)operator(++) operator(==) char('9')operator(\)) - reserved(goto) ident(round_9_up)operator(;) - operator(}) -label(accept_dig:) - operator(*)ident(s)operator(++) operator(=) ident(dig)operator(;) - reserved(goto) ident(ret)operator(;) - operator(}) - reserved(if) operator(()ident(j1) operator(>) integer(0)operator(\)) operator({) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - reserved(if) operator((!)ident(rounding)operator(\)) - reserved(goto) ident(accept_dig)operator(;) -preprocessor(#endif) - reserved(if) operator(()ident(dig) operator(==) char('9')operator(\)) operator({) comment(/* possible if i == 1 */) -label(round_9_up:) - operator(*)ident(s)operator(++) operator(=) char('9')operator(;) - reserved(goto) ident(roundoff)operator(;) - operator(}) - operator(*)ident(s)operator(++) operator(=) ident(dig) operator(+) integer(1)operator(;) - reserved(goto) ident(ret)operator(;) - operator(}) -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) -label(keep_dig:) -preprocessor(#endif) - operator(*)ident(s)operator(++) operator(=) ident(dig)operator(;) - reserved(if) operator(()ident(i) operator(==) ident(ilim)operator(\)) - reserved(break)operator(;) - ident(b) operator(=) ident(multadd)operator(()ident(b)operator(,) integer(10)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(mlo) operator(==) ident(mhi)operator(\)) - ident(mlo) operator(=) ident(mhi) operator(=) ident(multadd)operator(()ident(mhi)operator(,) integer(10)operator(,) integer(0)operator(\);) - reserved(else) operator({) - ident(mlo) operator(=) ident(multadd)operator(()ident(mlo)operator(,) integer(10)operator(,) integer(0)operator(\);) - ident(mhi) operator(=) ident(multadd)operator(()ident(mhi)operator(,) integer(10)operator(,) integer(0)operator(\);) - operator(}) - operator(}) - operator(}) - reserved(else) - reserved(for) operator(()ident(i) operator(=) integer(1)operator(;;) ident(i)operator(++\)) operator({) - operator(*)ident(s)operator(++) operator(=) ident(dig) operator(=) ident(quorem)operator(()ident(b)operator(,)ident(S)operator(\)) operator(+) char('0')operator(;) - reserved(if) operator((!)ident(b)operator(->)ident(x)operator([)integer(0)operator(]) operator(&&) ident(b)operator(->)ident(wds) operator(<=) integer(1)operator(\)) operator({) -preprocessor(#ifdef) ident(SET_INEXACT) - ident(inexact) operator(=) integer(0)operator(;) -preprocessor(#endif) - reserved(goto) ident(ret)operator(;) - operator(}) - reserved(if) operator(()ident(i) operator(>=) ident(ilim)operator(\)) - reserved(break)operator(;) - ident(b) operator(=) ident(multadd)operator(()ident(b)operator(,) integer(10)operator(,) integer(0)operator(\);) - operator(}) - - comment(/* Round off last digit */) - -preprocessor(#ifdef) ident(Honor_FLT_ROUNDS) - reserved(switch) operator(()ident(rounding)operator(\)) operator({) - reserved(case) integer(0)operator(:) reserved(goto) ident(trimzeros)operator(;) - reserved(case) integer(2)operator(:) reserved(goto) ident(roundoff)operator(;) - operator(}) -preprocessor(#endif) - ident(b) operator(=) ident(lshift)operator(()ident(b)operator(,) integer(1)operator(\);) - ident(j) operator(=) ident(cmp)operator(()ident(b)operator(,) ident(S)operator(\);) - reserved(if) operator(()ident(j) operator(>) integer(0) operator(||) operator(()ident(j) operator(==) integer(0) operator(&&) operator(()ident(dig) operator(&) integer(1)operator(\)\)\)) operator({) - label(roundoff:) - reserved(while) operator((*--)ident(s) operator(==) char('9')operator(\)) - reserved(if) operator(()ident(s) operator(==) ident(s0)operator(\)) operator({) - ident(k)operator(++;) - operator(*)ident(s)operator(++) operator(=) char('1')operator(;) - reserved(goto) ident(ret)operator(;) - operator(}) - operator(++*)ident(s)operator(++;) - operator(}) - reserved(else) operator({) - reserved(while) operator((*--)ident(s) operator(==) char('0')operator(\)) operator(;) - ident(s)operator(++;) - operator(}) -label(ret:) - ident(Bfree)operator(()ident(S)operator(\);) - reserved(if) operator(()ident(mhi)operator(\)) operator({) - reserved(if) operator(()ident(mlo) operator(&&) ident(mlo) operator(!=) ident(mhi)operator(\)) - ident(Bfree)operator(()ident(mlo)operator(\);) - ident(Bfree)operator(()ident(mhi)operator(\);) - operator(}) -label(ret1:) -preprocessor(#ifdef) ident(SET_INEXACT) - reserved(if) operator(()ident(inexact)operator(\)) operator({) - reserved(if) operator((!)ident(oldinexact)operator(\)) operator({) - ident(word0)operator(()ident(d)operator(\)) operator(=) ident(Exp_1) operator(+) operator(()integer(70) operator(<<) ident(Exp_shift)operator(\);) - ident(word1)operator(()ident(d)operator(\)) operator(=) integer(0)operator(;) - ident(dval)operator(()ident(d)operator(\)) operator(+=) float(1)operator(.)operator(;) - operator(}) - operator(}) - reserved(else) reserved(if) operator((!)ident(oldinexact)operator(\)) - ident(clear_inexact)operator((\);) -preprocessor(#endif) - ident(Bfree)operator(()ident(b)operator(\);) - operator(*)ident(s) operator(=) integer(0)operator(;) - operator(*)ident(decpt) operator(=) ident(k) operator(+) integer(1)operator(;) - reserved(if) operator(()ident(rve)operator(\)) - operator(*)ident(rve) operator(=) ident(s)operator(;) - reserved(return) ident(s0)operator(;) -operator(}) - -directive(void) -ident(ruby_each_words)operator(()directive(const) pre_type(char) operator(*)ident(str)operator(,) directive(void) operator((*)ident(func)operator(\)()directive(const) pre_type(char)operator(*,) pre_type(int)operator(,) directive(void)operator(*\),) directive(void) operator(*)ident(arg)operator(\)) -operator({) - directive(const) pre_type(char) operator(*)ident(end)operator(;) - pre_type(int) ident(len)operator(;) - - reserved(if) operator((!)ident(str)operator(\)) reserved(return)operator(;) - reserved(for) operator((;) operator(*)ident(str)operator(;) ident(str) operator(=) ident(end)operator(\)) operator({) - reserved(while) operator(()ident(ISSPACE)operator((*)ident(str)operator(\)) operator(||) operator(*)ident(str) operator(==) char(',')operator(\)) ident(str)operator(++;) - reserved(if) operator((!*)ident(str)operator(\)) reserved(break)operator(;) - ident(end) operator(=) ident(str)operator(;) - reserved(while) operator((*)ident(end) operator(&&) operator(!)ident(ISSPACE)operator((*)ident(end)operator(\)) operator(&&) operator(*)ident(end) operator(!=) char(',')operator(\)) ident(end)operator(++;) - ident(len) operator(=) ident(end) operator(-) ident(str)operator(;) - operator((*)ident(func)operator(\)()ident(str)operator(,) ident(len)operator(,) ident(arg)operator(\);) - operator(}) -operator(}) - -preprocessor(#ifdef) ident(__cplusplus) -operator(}) -preprocessor(#endif) -comment(/********************************************************************** - - variable.c - - - $Author: shyouhei $ - $Date: 2009-02-02 03:34:12 +0100 (Mon, 02 Feb 2009\) $ - created at: Tue Apr 19 23:55:15 JST 1994 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("env.h") -preprocessor(#include) include("node.h") -preprocessor(#include) include("st.h") -preprocessor(#include) include("util.h") - -ident(st_table) operator(*)ident(rb_global_tbl)operator(;) -ident(st_table) operator(*)ident(rb_class_tbl)operator(;) -directive(static) ident(ID) ident(autoload)operator(,) ident(classpath)operator(,) ident(tmp_classpath)operator(;) - -directive(void) -ident(Init_var_tables)operator((\)) -operator({) - ident(rb_global_tbl) operator(=) ident(st_init_numtable)operator((\);) - ident(rb_class_tbl) operator(=) ident(st_init_numtable)operator((\);) - ident(autoload) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(classpath) operator(=) ident(rb_intern)operator(()stringoperator(\);) - ident(tmp_classpath) operator(=) ident(rb_intern)operator(()stringoperator(\);) -operator(}) - -reserved(struct) ident(fc_result) operator({) - ident(ID) ident(name)operator(;) - ident(VALUE) ident(klass)operator(;) - ident(VALUE) ident(path)operator(;) - ident(VALUE) ident(track)operator(;) - reserved(struct) ident(fc_result) operator(*)ident(prev)operator(;) -operator(};) - -directive(static) ident(VALUE) -ident(fc_path)operator(()ident(fc)operator(,) ident(name)operator(\)) - reserved(struct) ident(fc_result) operator(*)ident(fc)operator(;) - ident(ID) ident(name)operator(;) -operator({) - ident(VALUE) ident(path)operator(,) ident(tmp)operator(;) - - ident(path) operator(=) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(name)operator(\)\);) - reserved(while) operator(()ident(fc)operator(\)) operator({) - reserved(if) operator(()ident(fc)operator(->)ident(track) operator(==) ident(rb_cObject)operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(ROBJECT)operator(()ident(fc)operator(->)ident(track)operator(\)->)ident(iv_tbl) operator(&&) - ident(st_lookup)operator(()ident(ROBJECT)operator(()ident(fc)operator(->)ident(track)operator(\)->)ident(iv_tbl)operator(,) ident(classpath)operator(,) operator(&)ident(tmp)operator(\)\)) operator({) - ident(tmp) operator(=) ident(rb_str_dup)operator(()ident(tmp)operator(\);) - ident(rb_str_cat2)operator(()ident(tmp)operator(,) stringoperator(\);) - ident(rb_str_append)operator(()ident(tmp)operator(,) ident(path)operator(\);) - - reserved(return) ident(tmp)operator(;) - operator(}) - ident(tmp) operator(=) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(fc)operator(->)ident(name)operator(\)\);) - ident(rb_str_cat2)operator(()ident(tmp)operator(,) stringoperator(\);) - ident(rb_str_append)operator(()ident(tmp)operator(,) ident(path)operator(\);) - ident(path) operator(=) ident(tmp)operator(;) - ident(fc) operator(=) ident(fc)operator(->)ident(prev)operator(;) - operator(}) - reserved(return) ident(path)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(fc_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(res)operator(\)) - ident(ID) ident(key)operator(;) - ident(VALUE) ident(value)operator(;) - reserved(struct) ident(fc_result) operator(*)ident(res)operator(;) -operator({) - reserved(if) operator((!)ident(rb_is_const_id)operator(()ident(key)operator(\)\)) reserved(return) ident(ST_CONTINUE)operator(;) - - reserved(if) operator(()ident(value) operator(==) ident(res)operator(->)ident(klass)operator(\)) operator({) - ident(res)operator(->)ident(path) operator(=) ident(fc_path)operator(()ident(res)operator(,) ident(key)operator(\);) - reserved(return) ident(ST_STOP)operator(;) - operator(}) - reserved(switch) operator(()ident(TYPE)operator(()ident(value)operator(\)\)) operator({) - reserved(case) ident(T_MODULE)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(if) operator((!)ident(RCLASS)operator(()ident(value)operator(\)->)ident(iv_tbl)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - reserved(else) operator({) - reserved(struct) ident(fc_result) ident(arg)operator(;) - reserved(struct) ident(fc_result) operator(*)ident(list)operator(;) - - ident(list) operator(=) ident(res)operator(;) - reserved(while) operator(()ident(list)operator(\)) operator({) - reserved(if) operator(()ident(list)operator(->)ident(track) operator(==) ident(value)operator(\)) reserved(return) ident(ST_CONTINUE)operator(;) - ident(list) operator(=) ident(list)operator(->)ident(prev)operator(;) - operator(}) - - ident(arg)operator(.)ident(name) operator(=) ident(key)operator(;) - ident(arg)operator(.)ident(path) operator(=) integer(0)operator(;) - ident(arg)operator(.)ident(klass) operator(=) ident(res)operator(->)ident(klass)operator(;) - ident(arg)operator(.)ident(track) operator(=) ident(value)operator(;) - ident(arg)operator(.)ident(prev) operator(=) ident(res)operator(;) - ident(st_foreach_safe)operator(()ident(RCLASS)operator(()ident(value)operator(\)->)ident(iv_tbl)operator(,) ident(fc_i)operator(,) operator(()ident(st_data_t)operator(\)&)ident(arg)operator(\);) - reserved(if) operator(()ident(arg)operator(.)ident(path)operator(\)) operator({) - ident(res)operator(->)ident(path) operator(=) ident(arg)operator(.)ident(path)operator(;) - reserved(return) ident(ST_STOP)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - - reserved(default)operator(:) - reserved(break)operator(;) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(find_class_path)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(struct) ident(fc_result) ident(arg)operator(;) - - ident(arg)operator(.)ident(name) operator(=) integer(0)operator(;) - ident(arg)operator(.)ident(path) operator(=) integer(0)operator(;) - ident(arg)operator(.)ident(klass) operator(=) ident(klass)operator(;) - ident(arg)operator(.)ident(track) operator(=) ident(rb_cObject)operator(;) - ident(arg)operator(.)ident(prev) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(RCLASS)operator(()ident(rb_cObject)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(st_foreach_safe)operator(()ident(RCLASS)operator(()ident(rb_cObject)operator(\)->)ident(iv_tbl)operator(,) ident(fc_i)operator(,) operator(()ident(st_data_t)operator(\)&)ident(arg)operator(\);) - operator(}) - reserved(if) operator(()ident(arg)operator(.)ident(path) operator(==) integer(0)operator(\)) operator({) - ident(st_foreach)operator(()ident(rb_class_tbl)operator(,) ident(fc_i)operator(,) operator(()ident(st_data_t)operator(\)&)ident(arg)operator(\);) - operator(}) - reserved(if) operator(()ident(arg)operator(.)ident(path)operator(\)) operator({) - reserved(if) operator((!)ident(ROBJECT)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(ROBJECT)operator(()ident(klass)operator(\)->)ident(iv_tbl) operator(=) ident(st_init_numtable)operator((\);) - operator(}) - ident(st_insert)operator(()ident(ROBJECT)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(,) ident(classpath)operator(,) ident(arg)operator(.)ident(path)operator(\);) - ident(st_delete)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(,) operator(&)ident(tmp_classpath)operator(,) integer(0)operator(\);) - reserved(return) ident(arg)operator(.)ident(path)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(classname)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(path) operator(=) ident(Qnil)operator(;) - - reserved(if) operator((!)ident(klass)operator(\)) ident(klass) operator(=) ident(rb_cObject)operator(;) - reserved(if) operator(()ident(ROBJECT)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(\)) operator({) - reserved(if) operator((!)ident(st_lookup)operator(()ident(ROBJECT)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(,) ident(classpath)operator(,) operator(&)ident(path)operator(\)\)) operator({) - ident(ID) ident(classid) operator(=) ident(rb_intern)operator(()stringoperator(\);) - - reserved(if) operator((!)ident(st_lookup)operator(()ident(ROBJECT)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(,) ident(classid)operator(,) operator(&)ident(path)operator(\)\)) operator({) - reserved(return) ident(find_class_path)operator(()ident(klass)operator(\);) - operator(}) - ident(path) operator(=) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(SYM2ID)operator(()ident(path)operator(\)\)\);) - ident(st_insert)operator(()ident(ROBJECT)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(,) ident(classpath)operator(,) ident(path)operator(\);) - ident(st_delete)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(classid)operator(,) integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(TYPE)operator(()ident(path)operator(\)) operator(!=) ident(T_STRING)operator(\)) operator({) - ident(rb_bug)operator(()stringoperator(\);) - operator(}) - reserved(return) ident(path)operator(;) - operator(}) - reserved(return) ident(find_class_path)operator(()ident(klass)operator(\);) -operator(}) - -comment(/* - * call-seq: - * mod.name => string - * - * Returns the name of the module mod. - */) - -ident(VALUE) -ident(rb_mod_name)operator(()ident(mod)operator(\)) - ident(VALUE) ident(mod)operator(;) -operator({) - ident(VALUE) ident(path) operator(=) ident(classname)operator(()ident(mod)operator(\);) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(path)operator(\)\)) reserved(return) ident(rb_str_dup)operator(()ident(path)operator(\);) - reserved(return) ident(rb_str_new)operator(()integer(0)operator(,)integer(0)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_class_path)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - ident(VALUE) ident(path) operator(=) ident(classname)operator(()ident(klass)operator(\);) - - reserved(if) operator((!)ident(NIL_P)operator(()ident(path)operator(\)\)) reserved(return) ident(path)operator(;) - reserved(if) operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl) operator(&&) ident(st_lookup)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(,) - ident(tmp_classpath)operator(,) operator(&)ident(path)operator(\)\)) operator({) - reserved(return) ident(path)operator(;) - operator(}) - reserved(else) operator({) - pre_type(char) operator(*)ident(s) operator(=) stringoperator(;) - ident(size_t) ident(len)operator(;) - - reserved(if) operator(()ident(TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_MODULE)operator(\)) operator({) - reserved(if) operator(()ident(rb_obj_class)operator(()ident(klass)operator(\)) operator(==) ident(rb_cModule)operator(\)) operator({) - ident(s) operator(=) stringoperator(;) - operator(}) - reserved(else) operator({) - ident(s) operator(=) ident(rb_class2name)operator(()ident(RBASIC)operator(()ident(klass)operator(\)->)ident(klass)operator(\);) - operator(}) - operator(}) - ident(len) operator(=) integer(2) operator(+) ident(strlen)operator(()ident(s)operator(\)) operator(+) integer(3) operator(+) integer(2) operator(*) ident(SIZEOF_LONG) operator(+) integer(1)operator(;) - ident(path) operator(=) ident(rb_str_new)operator(()integer(0)operator(,) ident(len)operator(\);) - ident(snprintf)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(,) ident(len)operator(+)integer(1)operator(,) string)delimiter(")>operator(,) ident(s)operator(,) ident(klass)operator(\);) - ident(RSTRING)operator(()ident(path)operator(\)->)ident(len) operator(=) ident(strlen)operator(()ident(RSTRING)operator(()ident(path)operator(\)->)ident(ptr)operator(\);) - ident(rb_ivar_set)operator(()ident(klass)operator(,) ident(tmp_classpath)operator(,) ident(path)operator(\);) - - reserved(return) ident(path)operator(;) - operator(}) -operator(}) - -directive(void) -ident(rb_set_class_path)operator(()ident(klass)operator(,) ident(under)operator(,) ident(name)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(under)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(VALUE) ident(str)operator(;) - - reserved(if) operator(()ident(under) operator(==) ident(rb_cObject)operator(\)) operator({) - ident(str) operator(=) ident(rb_str_new2)operator(()ident(name)operator(\);) - operator(}) - reserved(else) operator({) - ident(str) operator(=) ident(rb_str_dup)operator(()ident(rb_class_path)operator(()ident(under)operator(\)\);) - ident(rb_str_cat2)operator(()ident(str)operator(,) stringoperator(\);) - ident(rb_str_cat2)operator(()ident(str)operator(,) ident(name)operator(\);) - operator(}) - ident(rb_ivar_set)operator(()ident(klass)operator(,) ident(classpath)operator(,) ident(str)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_path2class)operator(()ident(path)operator(\)) - directive(const) pre_type(char) operator(*)ident(path)operator(;) -operator({) - directive(const) pre_type(char) operator(*)ident(pbeg)operator(,) operator(*)ident(p)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(c) operator(=) ident(rb_cObject)operator(;) - ident(VALUE) ident(str) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(path)operator([)integer(0)operator(]) operator(==) char('#')operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(path)operator(\);) - operator(}) - ident(pbeg) operator(=) ident(p) operator(=) ident(path)operator(;) - reserved(while) operator((*)ident(p)operator(\)) operator({) - reserved(while) operator((*)ident(p) operator(&&) operator(*)ident(p) operator(!=) char(':')operator(\)) ident(p)operator(++;) - reserved(if) operator(()ident(str)operator(\)) operator({) - ident(RSTRING)operator(()ident(str)operator(\)->)ident(len) operator(=) integer(0)operator(;) - ident(rb_str_cat)operator(()ident(str)operator(,) ident(pbeg)operator(,) ident(p)operator(-)ident(pbeg)operator(\);) - operator(}) - reserved(else) operator({) - ident(str) operator(=) ident(rb_str_new)operator(()ident(pbeg)operator(,) ident(p)operator(-)ident(pbeg)operator(\);) - operator(}) - ident(id) operator(=) ident(rb_intern)operator(()ident(RSTRING)operator(()ident(str)operator(\)->)ident(ptr)operator(\);) - reserved(if) operator(()ident(p)operator([)integer(0)operator(]) operator(==) char(':')operator(\)) operator({) - reserved(if) operator(()ident(p)operator([)integer(1)operator(]) operator(!=) char(':')operator(\)) reserved(goto) ident(undefined_class)operator(;) - ident(p) operator(+=) integer(2)operator(;) - ident(pbeg) operator(=) ident(p)operator(;) - operator(}) - reserved(if) operator((!)ident(rb_const_defined)operator(()ident(c)operator(,) ident(id)operator(\)\)) operator({) - label(undefined_class:) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(,) ident(p)operator(-)ident(path)operator(,) ident(path)operator(\);) - operator(}) - ident(c) operator(=) ident(rb_const_get_at)operator(()ident(c)operator(,) ident(id)operator(\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(c)operator(\)\)) operator({) - reserved(case) ident(T_MODULE)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(path)operator(\);) - operator(}) - operator(}) - - reserved(return) ident(c)operator(;) -operator(}) - -directive(void) -ident(rb_name_class)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(rb_iv_set)operator(()ident(klass)operator(,) stringoperator(,) ident(ID2SYM)operator(()ident(id)operator(\)\);) -operator(}) - -ident(VALUE) -ident(rb_class_name)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(return) ident(rb_class_path)operator(()ident(rb_class_real)operator(()ident(klass)operator(\)\);) -operator(}) - -pre_type(char) operator(*) -ident(rb_class2name)operator(()ident(klass)operator(\)) - ident(VALUE) ident(klass)operator(;) -operator({) - reserved(return) ident(RSTRING)operator(()ident(rb_class_name)operator(()ident(klass)operator(\)\)->)ident(ptr)operator(;) -operator(}) - -pre_type(char) operator(*) -ident(rb_obj_classname)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - reserved(return) ident(rb_class2name)operator(()ident(CLASS_OF)operator(()ident(obj)operator(\)\);) -operator(}) - -reserved(struct) ident(trace_var) operator({) - pre_type(int) ident(removed)operator(;) - directive(void) operator((*)ident(func)operator(\)(\);) - ident(VALUE) ident(data)operator(;) - reserved(struct) ident(trace_var) operator(*)ident(next)operator(;) -operator(};) - -reserved(struct) ident(global_variable) operator({) - pre_type(int) ident(counter)operator(;) - directive(void) operator(*)ident(data)operator(;) - ident(VALUE) operator((*)ident(getter)operator(\)(\);) - directive(void) operator((*)ident(setter)operator(\)(\);) - directive(void) operator((*)ident(marker)operator(\)(\);) - pre_type(int) ident(block_trace)operator(;) - reserved(struct) ident(trace_var) operator(*)ident(trace)operator(;) -operator(};) - -reserved(struct) ident(global_entry) operator({) - reserved(struct) ident(global_variable) operator(*)ident(var)operator(;) - ident(ID) ident(id)operator(;) -operator(};) - -directive(static) ident(VALUE) ident(undef_getter)operator((\);) -directive(static) directive(void) ident(undef_setter)operator((\);) -directive(static) directive(void) ident(undef_marker)operator((\);) - -directive(static) ident(VALUE) ident(val_getter)operator((\);) -directive(static) directive(void) ident(val_setter)operator((\);) -directive(static) directive(void) ident(val_marker)operator((\);) - -directive(static) ident(VALUE) ident(var_getter)operator((\);) -directive(static) directive(void) ident(var_setter)operator((\);) -directive(static) directive(void) ident(var_marker)operator((\);) - -reserved(struct) ident(global_entry)operator(*) -ident(rb_global_entry)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) - - reserved(if) operator((!)ident(st_lookup)operator(()ident(rb_global_tbl)operator(,) ident(id)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(entry)operator(\)\)) operator({) - reserved(struct) ident(global_variable) operator(*)ident(var)operator(;) - ident(entry) operator(=) ident(ALLOC)operator(()reserved(struct) ident(global_entry)operator(\);) - ident(var) operator(=) ident(ALLOC)operator(()reserved(struct) ident(global_variable)operator(\);) - ident(entry)operator(->)ident(id) operator(=) ident(id)operator(;) - ident(entry)operator(->)ident(var) operator(=) ident(var)operator(;) - ident(var)operator(->)ident(counter) operator(=) integer(1)operator(;) - ident(var)operator(->)ident(data) operator(=) integer(0)operator(;) - ident(var)operator(->)ident(getter) operator(=) ident(undef_getter)operator(;) - ident(var)operator(->)ident(setter) operator(=) ident(undef_setter)operator(;) - ident(var)operator(->)ident(marker) operator(=) ident(undef_marker)operator(;) - - ident(var)operator(->)ident(block_trace) operator(=) integer(0)operator(;) - ident(var)operator(->)ident(trace) operator(=) integer(0)operator(;) - ident(st_add_direct)operator(()ident(rb_global_tbl)operator(,) ident(id)operator(,) operator(()ident(st_data_t)operator(\))ident(entry)operator(\);) - operator(}) - reserved(return) ident(entry)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(undef_getter)operator(()ident(id)operator(\)) - ident(ID) ident(id)operator(;) -operator({) - ident(rb_warning)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) directive(void) -ident(undef_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(data)operator(,) ident(var)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - directive(void) operator(*)ident(data)operator(;) - reserved(struct) ident(global_variable) operator(*)ident(var)operator(;) -operator({) - ident(var)operator(->)ident(getter) operator(=) ident(val_getter)operator(;) - ident(var)operator(->)ident(setter) operator(=) ident(val_setter)operator(;) - ident(var)operator(->)ident(marker) operator(=) ident(val_marker)operator(;) - - ident(var)operator(->)ident(data) operator(=) operator(()directive(void)operator(*\))ident(val)operator(;) -operator(}) - -directive(static) directive(void) -ident(undef_marker)operator((\)) -operator({) -operator(}) - -directive(static) ident(VALUE) -ident(val_getter)operator(()ident(id)operator(,) ident(val)operator(\)) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(return) ident(val)operator(;) -operator(}) - -directive(static) directive(void) -ident(val_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(data)operator(,) ident(var)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - directive(void) operator(*)ident(data)operator(;) - reserved(struct) ident(global_variable) operator(*)ident(var)operator(;) -operator({) - ident(var)operator(->)ident(data) operator(=) operator(()directive(void)operator(*\))ident(val)operator(;) -operator(}) - -directive(static) directive(void) -ident(val_marker)operator(()ident(data)operator(\)) - ident(VALUE) ident(data)operator(;) -operator({) - reserved(if) operator(()ident(data)operator(\)) ident(rb_gc_mark_maybe)operator(()ident(data)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(var_getter)operator(()ident(id)operator(,) ident(var)operator(\)) - ident(ID) ident(id)operator(;) - ident(VALUE) operator(*)ident(var)operator(;) -operator({) - reserved(if) operator((!)ident(var)operator(\)) reserved(return) ident(Qnil)operator(;) - reserved(return) operator(*)ident(var)operator(;) -operator(}) - -directive(static) directive(void) -ident(var_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(var)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) operator(*)ident(var)operator(;) -operator({) - operator(*)ident(var) operator(=) ident(val)operator(;) -operator(}) - -directive(static) directive(void) -ident(var_marker)operator(()ident(var)operator(\)) - ident(VALUE) operator(*)ident(var)operator(;) -operator({) - reserved(if) operator(()ident(var)operator(\)) ident(rb_gc_mark_maybe)operator((*)ident(var)operator(\);) -operator(}) - -directive(static) directive(void) -ident(readonly_setter)operator(()ident(val)operator(,) ident(id)operator(,) ident(var)operator(\)) - ident(VALUE) ident(val)operator(;) - ident(ID) ident(id)operator(;) - directive(void) operator(*)ident(var)operator(;) -operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) -operator(}) - -directive(static) pre_type(int) -ident(mark_global_entry)operator(()ident(key)operator(,) ident(entry)operator(\)) - ident(ID) ident(key)operator(;) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) -operator({) - reserved(struct) ident(trace_var) operator(*)ident(trace)operator(;) - reserved(struct) ident(global_variable) operator(*)ident(var) operator(=) ident(entry)operator(->)ident(var)operator(;) - - operator((*)ident(var)operator(->)ident(marker)operator(\)()ident(var)operator(->)ident(data)operator(\);) - ident(trace) operator(=) ident(var)operator(->)ident(trace)operator(;) - reserved(while) operator(()ident(trace)operator(\)) operator({) - reserved(if) operator(()ident(trace)operator(->)ident(data)operator(\)) ident(rb_gc_mark_maybe)operator(()ident(trace)operator(->)ident(data)operator(\);) - ident(trace) operator(=) ident(trace)operator(->)ident(next)operator(;) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(void) -ident(rb_gc_mark_global_tbl)operator((\)) -operator({) - reserved(if) operator(()ident(rb_global_tbl)operator(\)) operator({) - ident(st_foreach)operator(()ident(rb_global_tbl)operator(,) ident(mark_global_entry)operator(,) integer(0)operator(\);) - operator(}) -operator(}) - -directive(static) ident(ID) -ident(global_id)operator(()ident(name)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(ID) ident(id)operator(;) - - reserved(if) operator(()ident(name)operator([)integer(0)operator(]) operator(==) char('$')operator(\)) ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - reserved(else) operator({) - pre_type(char) operator(*)ident(buf) operator(=) ident(ALLOCA_N)operator(()pre_type(char)operator(,) ident(strlen)operator(()ident(name)operator(\)+)integer(2)operator(\);) - ident(buf)operator([)integer(0)operator(]) operator(=) char('$')operator(;) - ident(strcpy)operator(()ident(buf)operator(+)integer(1)operator(,) ident(name)operator(\);) - ident(id) operator(=) ident(rb_intern)operator(()ident(buf)operator(\);) - operator(}) - reserved(return) ident(id)operator(;) -operator(}) - -directive(void) -ident(rb_define_hooked_variable)operator(()ident(name)operator(,) ident(var)operator(,) ident(getter)operator(,) ident(setter)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator(*)ident(var)operator(;) - ident(VALUE) operator((*)ident(getter)operator(\)(\);) - directive(void) operator((*)ident(setter)operator(\)(\);) -operator({) - reserved(struct) ident(global_variable) operator(*)ident(gvar)operator(;) - ident(ID) ident(id) operator(=) ident(global_id)operator(()ident(name)operator(\);) - - ident(gvar) operator(=) ident(rb_global_entry)operator(()ident(id)operator(\)->)ident(var)operator(;) - ident(gvar)operator(->)ident(data) operator(=) operator(()directive(void)operator(*\))ident(var)operator(;) - ident(gvar)operator(->)ident(getter) operator(=) ident(getter)operator(?)ident(getter)operator(:)ident(var_getter)operator(;) - ident(gvar)operator(->)ident(setter) operator(=) ident(setter)operator(?)ident(setter)operator(:)ident(var_setter)operator(;) - ident(gvar)operator(->)ident(marker) operator(=) ident(var_marker)operator(;) -operator(}) - -directive(void) -ident(rb_define_variable)operator(()ident(name)operator(,) ident(var)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator(*)ident(var)operator(;) -operator({) - ident(rb_define_hooked_variable)operator(()ident(name)operator(,) ident(var)operator(,) integer(0)operator(,) integer(0)operator(\);) -operator(}) - -directive(void) -ident(rb_define_readonly_variable)operator(()ident(name)operator(,) ident(var)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator(*)ident(var)operator(;) -operator({) - ident(rb_define_hooked_variable)operator(()ident(name)operator(,) ident(var)operator(,) integer(0)operator(,) ident(readonly_setter)operator(\);) -operator(}) - -directive(void) -ident(rb_define_virtual_variable)operator(()ident(name)operator(,) ident(getter)operator(,) ident(setter)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) operator((*)ident(getter)operator(\)(\);) - directive(void) operator((*)ident(setter)operator(\)(\);) -operator({) - reserved(if) operator((!)ident(getter)operator(\)) ident(getter) operator(=) ident(val_getter)operator(;) - reserved(if) operator((!)ident(setter)operator(\)) ident(setter) operator(=) ident(readonly_setter)operator(;) - ident(rb_define_hooked_variable)operator(()ident(name)operator(,) integer(0)operator(,) ident(getter)operator(,) ident(setter)operator(\);) -operator(}) - -directive(static) directive(void) -ident(rb_trace_eval)operator(()ident(cmd)operator(,) ident(val)operator(\)) - ident(VALUE) ident(cmd)operator(,) ident(val)operator(;) -operator({) - ident(rb_eval_cmd)operator(()ident(cmd)operator(,) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(val)operator(\),) integer(0)operator(\);) -operator(}) - -comment(/* - * call-seq: - * trace_var(symbol, cmd \) => nil - * trace_var(symbol\) {|val| block } => nil - * - * Controls tracing of assignments to global variables. The parameter - * +symbol_ identifies the variable (as either a string name or a - * symbol identifier\). _cmd_ (which may be a string or a - * +Proc+ object\) or block is executed whenever the variable - * is assigned. The block or +Proc+ object receives the - * variable's new value as a parameter. Also see - * Kernel::untrace_var. - * - * trace_var :$_, proc {|v| puts "$_ is now '#{v}'" } - * $_ = "hello" - * $_ = ' there' - * - * produces: - * - * $_ is now 'hello' - * $_ is now ' there' - */) - -ident(VALUE) -ident(rb_f_trace_var)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(var)operator(,) ident(cmd)operator(;) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) - reserved(struct) ident(trace_var) operator(*)ident(trace)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - reserved(if) operator(()ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(var)operator(,) operator(&)ident(cmd)operator(\)) operator(==) integer(1)operator(\)) operator({) - ident(cmd) operator(=) ident(rb_block_proc)operator((\);) - operator(}) - reserved(if) operator(()ident(NIL_P)operator(()ident(cmd)operator(\)\)) operator({) - reserved(return) ident(rb_f_untrace_var)operator(()ident(argc)operator(,) ident(argv)operator(\);) - operator(}) - ident(entry) operator(=) ident(rb_global_entry)operator(()ident(rb_to_id)operator(()ident(var)operator(\)\);) - reserved(if) operator(()ident(OBJ_TAINTED)operator(()ident(cmd)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator(}) - ident(trace) operator(=) ident(ALLOC)operator(()reserved(struct) ident(trace_var)operator(\);) - ident(trace)operator(->)ident(next) operator(=) ident(entry)operator(->)ident(var)operator(->)ident(trace)operator(;) - ident(trace)operator(->)ident(func) operator(=) ident(rb_trace_eval)operator(;) - ident(trace)operator(->)ident(data) operator(=) ident(cmd)operator(;) - ident(trace)operator(->)ident(removed) operator(=) integer(0)operator(;) - ident(entry)operator(->)ident(var)operator(->)ident(trace) operator(=) ident(trace)operator(;) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) directive(void) -ident(remove_trace)operator(()ident(var)operator(\)) - reserved(struct) ident(global_variable) operator(*)ident(var)operator(;) -operator({) - reserved(struct) ident(trace_var) operator(*)ident(trace) operator(=) ident(var)operator(->)ident(trace)operator(;) - reserved(struct) ident(trace_var) ident(t)operator(;) - reserved(struct) ident(trace_var) operator(*)ident(next)operator(;) - - ident(t)operator(.)ident(next) operator(=) ident(trace)operator(;) - ident(trace) operator(=) operator(&)ident(t)operator(;) - reserved(while) operator(()ident(trace)operator(->)ident(next)operator(\)) operator({) - ident(next) operator(=) ident(trace)operator(->)ident(next)operator(;) - reserved(if) operator(()ident(next)operator(->)ident(removed)operator(\)) operator({) - ident(trace)operator(->)ident(next) operator(=) ident(next)operator(->)ident(next)operator(;) - ident(free)operator(()ident(next)operator(\);) - operator(}) - reserved(else) operator({) - ident(trace) operator(=) ident(next)operator(;) - operator(}) - operator(}) - ident(var)operator(->)ident(trace) operator(=) ident(t)operator(.)ident(next)operator(;) -operator(}) - -comment(/* - * call-seq: - * untrace_var(symbol [, cmd] \) => array or nil - * - * Removes tracing for the specified command on the given global - * variable and returns +nil+. If no command is specified, - * removes all tracing for that variable and returns an array - * containing the commands actually removed. - */) - -ident(VALUE) -ident(rb_f_untrace_var)operator(()ident(argc)operator(,) ident(argv)operator(\)) - pre_type(int) ident(argc)operator(;) - ident(VALUE) operator(*)ident(argv)operator(;) -operator({) - ident(VALUE) ident(var)operator(,) ident(cmd)operator(;) - ident(ID) ident(id)operator(;) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) - reserved(struct) ident(trace_var) operator(*)ident(trace)operator(;) - - ident(rb_secure)operator(()integer(4)operator(\);) - ident(rb_scan_args)operator(()ident(argc)operator(,) ident(argv)operator(,) stringoperator(,) operator(&)ident(var)operator(,) operator(&)ident(cmd)operator(\);) - ident(id) operator(=) ident(rb_to_id)operator(()ident(var)operator(\);) - reserved(if) operator((!)ident(st_lookup)operator(()ident(rb_global_tbl)operator(,) ident(id)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(entry)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - - ident(trace) operator(=) ident(entry)operator(->)ident(var)operator(->)ident(trace)operator(;) - reserved(if) operator(()ident(NIL_P)operator(()ident(cmd)operator(\)\)) operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - reserved(while) operator(()ident(trace)operator(\)) operator({) - reserved(struct) ident(trace_var) operator(*)ident(next) operator(=) ident(trace)operator(->)ident(next)operator(;) - ident(rb_ary_push)operator(()ident(ary)operator(,) operator(()ident(VALUE)operator(\))ident(trace)operator(->)ident(data)operator(\);) - ident(trace)operator(->)ident(removed) operator(=) integer(1)operator(;) - ident(trace) operator(=) ident(next)operator(;) - operator(}) - - reserved(if) operator((!)ident(entry)operator(->)ident(var)operator(->)ident(block_trace)operator(\)) ident(remove_trace)operator(()ident(entry)operator(->)ident(var)operator(\);) - reserved(return) ident(ary)operator(;) - operator(}) - reserved(else) operator({) - reserved(while) operator(()ident(trace)operator(\)) operator({) - reserved(if) operator(()ident(trace)operator(->)ident(data) operator(==) ident(cmd)operator(\)) operator({) - ident(trace)operator(->)ident(removed) operator(=) integer(1)operator(;) - reserved(if) operator((!)ident(entry)operator(->)ident(var)operator(->)ident(block_trace)operator(\)) ident(remove_trace)operator(()ident(entry)operator(->)ident(var)operator(\);) - reserved(return) ident(rb_ary_new3)operator(()integer(1)operator(,) ident(cmd)operator(\);) - operator(}) - ident(trace) operator(=) ident(trace)operator(->)ident(next)operator(;) - operator(}) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -ident(VALUE) -ident(rb_gvar_get)operator(()ident(entry)operator(\)) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) -operator({) - reserved(struct) ident(global_variable) operator(*)ident(var) operator(=) ident(entry)operator(->)ident(var)operator(;) - reserved(return) operator((*)ident(var)operator(->)ident(getter)operator(\)()ident(entry)operator(->)ident(id)operator(,) ident(var)operator(->)ident(data)operator(,) ident(var)operator(\);) -operator(}) - -reserved(struct) ident(trace_data) operator({) - reserved(struct) ident(trace_var) operator(*)ident(trace)operator(;) - ident(VALUE) ident(val)operator(;) -operator(};) - -directive(static) ident(VALUE) -ident(trace_ev)operator(()ident(data)operator(\)) - reserved(struct) ident(trace_data) operator(*)ident(data)operator(;) -operator({) - reserved(struct) ident(trace_var) operator(*)ident(trace) operator(=) ident(data)operator(->)ident(trace)operator(;) - - reserved(while) operator(()ident(trace)operator(\)) operator({) - operator((*)ident(trace)operator(->)ident(func)operator(\)()ident(trace)operator(->)ident(data)operator(,) ident(data)operator(->)ident(val)operator(\);) - ident(trace) operator(=) ident(trace)operator(->)ident(next)operator(;) - operator(}) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -directive(static) ident(VALUE) -ident(trace_en)operator(()ident(var)operator(\)) - reserved(struct) ident(global_variable) operator(*)ident(var)operator(;) -operator({) - ident(var)operator(->)ident(block_trace) operator(=) integer(0)operator(;) - ident(remove_trace)operator(()ident(var)operator(\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -ident(VALUE) -ident(rb_gvar_set)operator(()ident(entry)operator(,) ident(val)operator(\)) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(struct) ident(trace_data) ident(trace)operator(;) - reserved(struct) ident(global_variable) operator(*)ident(var) operator(=) ident(entry)operator(->)ident(var)operator(;) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - operator((*)ident(var)operator(->)ident(setter)operator(\)()ident(val)operator(,) ident(entry)operator(->)ident(id)operator(,) ident(var)operator(->)ident(data)operator(,) ident(var)operator(\);) - - reserved(if) operator(()ident(var)operator(->)ident(trace) operator(&&) operator(!)ident(var)operator(->)ident(block_trace)operator(\)) operator({) - ident(var)operator(->)ident(block_trace) operator(=) integer(1)operator(;) - ident(trace)operator(.)ident(trace) operator(=) ident(var)operator(->)ident(trace)operator(;) - ident(trace)operator(.)ident(val) operator(=) ident(val)operator(;) - ident(rb_ensure)operator(()ident(trace_ev)operator(,) operator(()ident(VALUE)operator(\)&)ident(trace)operator(,) ident(trace_en)operator(,) operator(()ident(VALUE)operator(\))ident(var)operator(\);) - operator(}) - reserved(return) ident(val)operator(;) -operator(}) - -ident(VALUE) -ident(rb_gv_set)operator(()ident(name)operator(,) ident(val)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) - - ident(entry) operator(=) ident(rb_global_entry)operator(()ident(global_id)operator(()ident(name)operator(\)\);) - reserved(return) ident(rb_gvar_set)operator(()ident(entry)operator(,) ident(val)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_gv_get)operator(()ident(name)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) - - ident(entry) operator(=) ident(rb_global_entry)operator(()ident(global_id)operator(()ident(name)operator(\)\);) - reserved(return) ident(rb_gvar_get)operator(()ident(entry)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_gvar_defined)operator(()ident(entry)operator(\)) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) -operator({) - reserved(if) operator(()ident(entry)operator(->)ident(var)operator(->)ident(getter) operator(==) ident(undef_getter)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(gvar_i)operator(()ident(key)operator(,) ident(entry)operator(,) ident(ary)operator(\)) - ident(ID) ident(key)operator(;) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(key)operator(\)\)\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * global_variables => array - * - * Returns an array of the names of global variables. - * - * global_variables.grep /std/ #=> ["$stderr", "$stdout", "$stdin"] - */) - -ident(VALUE) -ident(rb_f_global_variables)operator((\)) -operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - pre_type(char) ident(buf)operator([)integer(4)operator(];) - pre_type(char) operator(*)ident(s) operator(=) stringoperator(;) - - ident(st_foreach)operator(()ident(rb_global_tbl)operator(,) ident(gvar_i)operator(,) ident(ary)operator(\);) - reserved(if) operator((!)ident(NIL_P)operator(()ident(rb_backref_get)operator((\)\)\)) operator({) - reserved(while) operator((*)ident(s)operator(\)) operator({) - ident(sprintf)operator(()ident(buf)operator(,) stringoperator(,) operator(*)ident(s)operator(++\);) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_str_new2)operator(()ident(buf)operator(\)\);) - operator(}) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -directive(void) -ident(rb_alias_variable)operator(()ident(name1)operator(,) ident(name2)operator(\)) - ident(ID) ident(name1)operator(;) - ident(ID) ident(name2)operator(;) -operator({) - reserved(struct) ident(global_entry) operator(*)ident(entry1)operator(,) operator(*)ident(entry2)operator(;) - - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - - ident(entry2) operator(=) ident(rb_global_entry)operator(()ident(name2)operator(\);) - reserved(if) operator((!)ident(st_lookup)operator(()ident(rb_global_tbl)operator(,) ident(name1)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(entry1)operator(\)\)) operator({) - ident(entry1) operator(=) ident(ALLOC)operator(()reserved(struct) ident(global_entry)operator(\);) - ident(entry1)operator(->)ident(id) operator(=) ident(name1)operator(;) - ident(st_add_direct)operator(()ident(rb_global_tbl)operator(,) ident(name1)operator(,) operator(()ident(st_data_t)operator(\))ident(entry1)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(entry1)operator(->)ident(var) operator(!=) ident(entry2)operator(->)ident(var)operator(\)) operator({) - reserved(struct) ident(global_variable) operator(*)ident(var) operator(=) ident(entry1)operator(->)ident(var)operator(;) - reserved(if) operator(()ident(var)operator(->)ident(block_trace)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - operator(}) - ident(var)operator(->)ident(counter)operator(--;) - reserved(if) operator(()ident(var)operator(->)ident(counter) operator(==) integer(0)operator(\)) operator({) - reserved(struct) ident(trace_var) operator(*)ident(trace) operator(=) ident(var)operator(->)ident(trace)operator(;) - reserved(while) operator(()ident(trace)operator(\)) operator({) - reserved(struct) ident(trace_var) operator(*)ident(next) operator(=) ident(trace)operator(->)ident(next)operator(;) - ident(free)operator(()ident(trace)operator(\);) - ident(trace) operator(=) ident(next)operator(;) - operator(}) - ident(free)operator(()ident(var)operator(\);) - operator(}) - operator(}) - reserved(else) operator({) - reserved(return)operator(;) - operator(}) - ident(entry2)operator(->)ident(var)operator(->)ident(counter)operator(++;) - ident(entry1)operator(->)ident(var) operator(=) ident(entry2)operator(->)ident(var)operator(;) -operator(}) - -directive(static) pre_type(int) ident(special_generic_ivar) operator(=) integer(0)operator(;) -directive(static) ident(st_table) operator(*)ident(generic_iv_tbl)operator(;) - -ident(st_table)operator(*) -ident(rb_generic_ivar_table)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - - reserved(if) operator((!)ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_EXIVAR)operator(\)\)) reserved(return) integer(0)operator(;) - reserved(if) operator((!)ident(generic_iv_tbl)operator(\)) reserved(return) integer(0)operator(;) - reserved(if) operator((!)ident(st_lookup)operator(()ident(generic_iv_tbl)operator(,) ident(obj)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(tbl)operator(\)\)) reserved(return) integer(0)operator(;) - reserved(return) ident(tbl)operator(;) -operator(}) - -directive(static) ident(VALUE) -ident(generic_ivar_get)operator(()ident(obj)operator(,) ident(id)operator(,) ident(warn)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) - pre_type(int) ident(warn)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - ident(VALUE) ident(val)operator(;) - - reserved(if) operator(()ident(generic_iv_tbl)operator(\)) operator({) - reserved(if) operator(()ident(st_lookup)operator(()ident(generic_iv_tbl)operator(,) ident(obj)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(tbl)operator(\)\)) operator({) - reserved(if) operator(()ident(st_lookup)operator(()ident(tbl)operator(,) ident(id)operator(,) operator(&)ident(val)operator(\)\)) operator({) - reserved(return) ident(val)operator(;) - operator(}) - operator(}) - operator(}) - reserved(if) operator(()ident(warn)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -directive(static) directive(void) -ident(generic_ivar_set)operator(()ident(obj)operator(,) ident(id)operator(,) ident(val)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - - reserved(if) operator(()ident(rb_special_const_p)operator(()ident(obj)operator(\)\)) operator({) - ident(special_generic_ivar) operator(=) integer(1)operator(;) - operator(}) - reserved(if) operator((!)ident(generic_iv_tbl)operator(\)) operator({) - ident(generic_iv_tbl) operator(=) ident(st_init_numtable)operator((\);) - operator(}) - - reserved(if) operator((!)ident(st_lookup)operator(()ident(generic_iv_tbl)operator(,) ident(obj)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(tbl)operator(\)\)) operator({) - ident(FL_SET)operator(()ident(obj)operator(,) ident(FL_EXIVAR)operator(\);) - ident(tbl) operator(=) ident(st_init_numtable)operator((\);) - ident(st_add_direct)operator(()ident(generic_iv_tbl)operator(,) ident(obj)operator(,) operator(()ident(st_data_t)operator(\))ident(tbl)operator(\);) - ident(st_add_direct)operator(()ident(tbl)operator(,) ident(id)operator(,) ident(val)operator(\);) - reserved(return)operator(;) - operator(}) - ident(st_insert)operator(()ident(tbl)operator(,) ident(id)operator(,) ident(val)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(generic_ivar_defined)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - ident(VALUE) ident(val)operator(;) - - reserved(if) operator((!)ident(generic_iv_tbl)operator(\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator((!)ident(st_lookup)operator(()ident(generic_iv_tbl)operator(,) ident(obj)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(tbl)operator(\)\)) reserved(return) ident(Qfalse)operator(;) - reserved(if) operator(()ident(st_lookup)operator(()ident(tbl)operator(,) ident(id)operator(,) operator(&)ident(val)operator(\)\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(generic_ivar_remove)operator(()ident(obj)operator(,) ident(id)operator(,) ident(valp)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) operator(*)ident(valp)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - pre_type(int) ident(status)operator(;) - - reserved(if) operator((!)ident(generic_iv_tbl)operator(\)) reserved(return) integer(0)operator(;) - reserved(if) operator((!)ident(st_lookup)operator(()ident(generic_iv_tbl)operator(,) ident(obj)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(tbl)operator(\)\)) reserved(return) integer(0)operator(;) - ident(status) operator(=) ident(st_delete)operator(()ident(tbl)operator(,) operator(&)ident(id)operator(,) ident(valp)operator(\);) - reserved(if) operator(()ident(tbl)operator(->)ident(num_entries) operator(==) integer(0)operator(\)) operator({) - ident(st_delete)operator(()ident(generic_iv_tbl)operator(,) operator(&)ident(obj)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(tbl)operator(\);) - ident(st_free_table)operator(()ident(tbl)operator(\);) - operator(}) - reserved(return) ident(status)operator(;) -operator(}) - -directive(void) -ident(rb_mark_generic_ivar)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - - reserved(if) operator((!)ident(generic_iv_tbl)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(st_lookup)operator(()ident(generic_iv_tbl)operator(,) ident(obj)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(tbl)operator(\)\)) operator({) - ident(rb_mark_tbl)operator(()ident(tbl)operator(\);) - operator(}) -operator(}) - -directive(static) pre_type(int) -ident(givar_mark_i)operator(()ident(key)operator(,) ident(value)operator(\)) - ident(ID) ident(key)operator(;) - ident(VALUE) ident(value)operator(;) -operator({) - ident(rb_gc_mark)operator(()ident(value)operator(\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(givar_i)operator(()ident(obj)operator(,) ident(tbl)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(st_table) operator(*)ident(tbl)operator(;) -operator({) - reserved(if) operator(()ident(rb_special_const_p)operator(()ident(obj)operator(\)\)) operator({) - ident(st_foreach)operator(()ident(tbl)operator(,) ident(givar_mark_i)operator(,) integer(0)operator(\);) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(void) -ident(rb_mark_generic_ivar_tbl)operator((\)) -operator({) - reserved(if) operator((!)ident(generic_iv_tbl)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(special_generic_ivar) operator(==) integer(0)operator(\)) reserved(return)operator(;) - ident(st_foreach_safe)operator(()ident(generic_iv_tbl)operator(,) ident(givar_i)operator(,) integer(0)operator(\);) -operator(}) - -directive(void) -ident(rb_free_generic_ivar)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - - reserved(if) operator(()ident(st_delete)operator(()ident(generic_iv_tbl)operator(,) operator(&)ident(obj)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(tbl)operator(\)\)) - ident(st_free_table)operator(()ident(tbl)operator(\);) -operator(}) - -directive(void) -ident(rb_copy_generic_ivar)operator(()ident(clone)operator(,) ident(obj)operator(\)) - ident(VALUE) ident(clone)operator(,) ident(obj)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - - reserved(if) operator((!)ident(generic_iv_tbl)operator(\)) reserved(return)operator(;) - reserved(if) operator(()ident(st_lookup)operator(()ident(generic_iv_tbl)operator(,) ident(obj)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(tbl)operator(\)\)) operator({) - ident(st_table) operator(*)ident(old)operator(;) - - reserved(if) operator(()ident(st_lookup)operator(()ident(generic_iv_tbl)operator(,) ident(clone)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(old)operator(\)\)) operator({) - ident(st_free_table)operator(()ident(old)operator(\);) - ident(st_insert)operator(()ident(generic_iv_tbl)operator(,) ident(clone)operator(,) operator(()ident(st_data_t)operator(\))ident(st_copy)operator(()ident(tbl)operator(\)\);) - operator(}) - reserved(else) operator({) - ident(st_add_direct)operator(()ident(generic_iv_tbl)operator(,) ident(clone)operator(,) operator(()ident(st_data_t)operator(\))ident(st_copy)operator(()ident(tbl)operator(\)\);) - operator(}) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(ivar_get)operator(()ident(obj)operator(,) ident(id)operator(,) ident(warn)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) - pre_type(int) ident(warn)operator(;) -operator({) - ident(VALUE) ident(val)operator(;) - - reserved(switch) operator(()ident(TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_OBJECT)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - reserved(if) operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl) operator(&&) ident(st_lookup)operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(,) ident(id)operator(,) operator(&)ident(val)operator(\)\)) - reserved(return) ident(val)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_EXIVAR)operator(\)) operator(||) ident(rb_special_const_p)operator(()ident(obj)operator(\)\)) - reserved(return) ident(generic_ivar_get)operator(()ident(obj)operator(,) ident(id)operator(,) ident(warn)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(if) operator(()ident(warn)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ivar_get)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(return) ident(ivar_get)operator(()ident(obj)operator(,) ident(id)operator(,) ident(Qtrue)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_attr_get)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(return) ident(ivar_get)operator(()ident(obj)operator(,) ident(id)operator(,) ident(Qfalse)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_ivar_set)operator(()ident(obj)operator(,) ident(id)operator(,) ident(val)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(obj)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(obj)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_OBJECT)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - reserved(if) operator((!)ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(\)) ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl) operator(=) ident(st_init_numtable)operator((\);) - ident(st_insert)operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(,) ident(id)operator(,) ident(val)operator(\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(generic_ivar_set)operator(()ident(obj)operator(,) ident(id)operator(,) ident(val)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(return) ident(val)operator(;) -operator(}) - -ident(VALUE) -ident(rb_ivar_defined)operator(()ident(obj)operator(,) ident(id)operator(\)) - ident(VALUE) ident(obj)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(switch) operator(()ident(TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_OBJECT)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - reserved(if) operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl) operator(&&) ident(st_lookup)operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(,) ident(id)operator(,) integer(0)operator(\)\)) - reserved(return) ident(Qtrue)operator(;) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_EXIVAR)operator(\)) operator(||) ident(rb_special_const_p)operator(()ident(obj)operator(\)\)) - reserved(return) ident(generic_ivar_defined)operator(()ident(obj)operator(,) ident(id)operator(\);) - reserved(break)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(ivar_i)operator(()ident(key)operator(,) ident(entry)operator(,) ident(ary)operator(\)) - ident(ID) ident(key)operator(;) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(rb_is_instance_id)operator(()ident(key)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(key)operator(\)\)\);) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.instance_variables => array - * - * Returns an array of instance variable names for the receiver. Note - * that simply defining an accessor does not create the corresponding - * instance variable. - * - * class Fred - * attr_accessor :a1 - * def initialize - * @iv = 3 - * end - * end - * Fred.new.instance_variables #=> ["@iv"] - */) - -ident(VALUE) -ident(rb_obj_instance_variables)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(ary)operator(;) - - ident(ary) operator(=) ident(rb_ary_new)operator((\);) - reserved(switch) operator(()ident(TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_OBJECT)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - reserved(if) operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(st_foreach_safe)operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(,) ident(ivar_i)operator(,) ident(ary)operator(\);) - operator(}) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(if) operator((!)ident(generic_iv_tbl)operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_EXIVAR)operator(\)) operator(||) ident(rb_special_const_p)operator(()ident(obj)operator(\)\)) operator({) - ident(st_table) operator(*)ident(tbl)operator(;) - - reserved(if) operator(()ident(st_lookup)operator(()ident(generic_iv_tbl)operator(,) ident(obj)operator(,) operator(()ident(st_data_t) operator(*\)&)ident(tbl)operator(\)\)) operator({) - ident(st_foreach_safe)operator(()ident(tbl)operator(,) ident(ivar_i)operator(,) ident(ary)operator(\);) - operator(}) - operator(}) - reserved(break)operator(;) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * obj.remove_instance_variable(symbol\) => obj - * - * Removes the named instance variable from obj, returning that - * variable's value. - * - * class Dummy - * attr_reader :var - * def initialize - * @var = 99 - * end - * def remove - * remove_instance_variable(:@var\) - * end - * end - * d = Dummy.new - * d.var #=> 99 - * d.remove #=> 99 - * d.var #=> nil - */) - -ident(VALUE) -ident(rb_obj_remove_instance_variable)operator(()ident(obj)operator(,) ident(name)operator(\)) - ident(VALUE) ident(obj)operator(,) ident(name)operator(;) -operator({) - ident(VALUE) ident(val) operator(=) ident(Qnil)operator(;) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(name)operator(\);) - - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(obj)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(obj)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - reserved(if) operator((!)ident(rb_is_instance_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - - reserved(switch) operator(()ident(TYPE)operator(()ident(obj)operator(\)\)) operator({) - reserved(case) ident(T_OBJECT)operator(:) - reserved(case) ident(T_CLASS)operator(:) - reserved(case) ident(T_MODULE)operator(:) - reserved(if) operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl) operator(&&) ident(st_delete)operator(()ident(ROBJECT)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(id)operator(,) operator(&)ident(val)operator(\)\)) operator({) - reserved(return) ident(val)operator(;) - operator(}) - reserved(break)operator(;) - reserved(default)operator(:) - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_EXIVAR)operator(\)) operator(||) ident(rb_special_const_p)operator(()ident(obj)operator(\)\)) operator({) - reserved(if) operator(()ident(generic_ivar_remove)operator(()ident(obj)operator(,) ident(id)operator(,) operator(&)ident(val)operator(\)\)) operator({) - reserved(return) ident(val)operator(;) - operator(}) - operator(}) - reserved(break)operator(;) - operator(}) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -ident(NORETURN)operator(()directive(static) directive(void) ident(uninitialized_constant) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\)\);) -directive(static) directive(void) -ident(uninitialized_constant)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(if) operator(()ident(klass) operator(&&) ident(klass) operator(!=) ident(rb_cObject)operator(\)) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) - ident(rb_class2name)operator(()ident(klass)operator(\),) - ident(rb_id2name)operator(()ident(id)operator(\)\);) - reserved(else) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) -operator(}) - -directive(static) ident(VALUE) -ident(const_missing)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(return) ident(rb_funcall)operator(()ident(klass)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(ID2SYM)operator(()ident(id)operator(\)\);) -operator(}) - - -comment(/* - * call-seq: - * mod.const_missing(sym\) => obj - * - * Invoked when a reference is made to an undefined constant in - * mod. It is passed a symbol for the undefined constant, and - * returns a value to be used for that constant. The - * following code is a (very bad\) example: if reference is made to - * an undefined constant, it attempts to load a file whose name is - * the lowercase version of the constant (thus class Fred is - * assumed to be in file fred.rb\). If found, it returns the - * value of the loaded class. It therefore implements a perverse - * kind of autoload facility. - * - * def Object.const_missing(name\) - * @looked_for ||= {} - * str_name = name.to_s - * raise "Class not found: #{name}" if @looked_for[str_name] - * @looked_for[str_name] = 1 - * file = str_name.downcase - * require file - * klass = const_get(name\) - * return klass if klass - * raise "Class not found: #{name}" - * end - * - */) - -ident(VALUE) -ident(rb_mod_const_missing)operator(()ident(klass)operator(,) ident(name)operator(\)) - ident(VALUE) ident(klass)operator(,) ident(name)operator(;) -operator({) - ident(ruby_frame) operator(=) ident(ruby_frame)operator(->)ident(prev)operator(;) comment(/* pop frame for "const_missing" */) - ident(uninitialized_constant)operator(()ident(klass)operator(,) ident(rb_to_id)operator(()ident(name)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -directive(static) reserved(struct) ident(st_table) operator(*) -ident(check_autoload_table)operator(()ident(av)operator(\)) - ident(VALUE) ident(av)operator(;) -operator({) - ident(Check_Type)operator(()ident(av)operator(,) ident(T_DATA)operator(\);) - reserved(if) operator(()ident(RDATA)operator(()ident(av)operator(\)->)ident(dmark) operator(!=) operator(()ident(RUBY_DATA_FUNC)operator(\))ident(rb_mark_tbl) operator(||) - ident(RDATA)operator(()ident(av)operator(\)->)ident(dfree) operator(!=) operator(()ident(RUBY_DATA_FUNC)operator(\))ident(st_free_table)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) ident(RSTRING)operator(()ident(rb_inspect)operator(()ident(av)operator(\)\)->)ident(ptr)operator(\);) - operator(}) - reserved(return) operator(()reserved(struct) ident(st_table) operator(*\))ident(DATA_PTR)operator(()ident(av)operator(\);) -operator(}) - -directive(void) -ident(rb_autoload)operator(()ident(mod)operator(,) ident(id)operator(,) ident(file)operator(\)) - ident(VALUE) ident(mod)operator(;) - ident(ID) ident(id)operator(;) - directive(const) pre_type(char) operator(*)ident(file)operator(;) -operator({) - ident(VALUE) ident(av)operator(,) ident(fn)operator(;) - reserved(struct) ident(st_table) operator(*)ident(tbl)operator(;) - - reserved(if) operator((!)ident(rb_is_const_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eNameError)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(if) operator((!)ident(file) operator(||) operator(!*)ident(file)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - - reserved(if) operator((()ident(tbl) operator(=) ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(\)) operator(&&) ident(st_lookup)operator(()ident(tbl)operator(,) ident(id)operator(,) operator(&)ident(av)operator(\)) operator(&&) ident(av) operator(!=) ident(Qundef)operator(\)) - reserved(return)operator(;) - - ident(rb_const_set)operator(()ident(mod)operator(,) ident(id)operator(,) ident(Qundef)operator(\);) - ident(tbl) operator(=) ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(;) - reserved(if) operator(()ident(st_lookup)operator(()ident(tbl)operator(,) ident(autoload)operator(,) operator(&)ident(av)operator(\)\)) operator({) - ident(tbl) operator(=) ident(check_autoload_table)operator(()ident(av)operator(\);) - operator(}) - reserved(else) operator({) - ident(av) operator(=) ident(Data_Wrap_Struct)operator(()integer(0) operator(,) ident(rb_mark_tbl)operator(,) ident(st_free_table)operator(,) integer(0)operator(\);) - ident(st_add_direct)operator(()ident(tbl)operator(,) ident(autoload)operator(,) ident(av)operator(\);) - ident(DATA_PTR)operator(()ident(av)operator(\)) operator(=) ident(tbl) operator(=) ident(st_init_numtable)operator((\);) - operator(}) - ident(fn) operator(=) ident(rb_str_new2)operator(()ident(file)operator(\);) - ident(FL_UNSET)operator(()ident(fn)operator(,) ident(FL_TAINT)operator(\);) - ident(OBJ_FREEZE)operator(()ident(fn)operator(\);) - ident(st_insert)operator(()ident(tbl)operator(,) ident(id)operator(,) operator(()ident(st_data_t)operator(\))ident(rb_node_newnode)operator(()ident(NODE_MEMO)operator(,) ident(fn)operator(,) ident(ruby_safe_level)operator(,) integer(0)operator(\)\);) -operator(}) - -directive(static) ident(NODE)operator(*) -ident(autoload_delete)operator(()ident(mod)operator(,) ident(id)operator(\)) - ident(VALUE) ident(mod)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(val)operator(;) - ident(st_data_t) ident(load) operator(=) integer(0)operator(;) - - ident(st_delete)operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(id)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(st_lookup)operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(,) ident(autoload)operator(,) operator(&)ident(val)operator(\)\)) operator({) - reserved(struct) ident(st_table) operator(*)ident(tbl) operator(=) ident(check_autoload_table)operator(()ident(val)operator(\);) - - ident(st_delete)operator(()ident(tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(id)operator(,) operator(&)ident(load)operator(\);) - - reserved(if) operator(()ident(tbl)operator(->)ident(num_entries) operator(==) integer(0)operator(\)) operator({) - ident(id) operator(=) ident(autoload)operator(;) - ident(st_delete)operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(id)operator(,) operator(&)ident(val)operator(\);) - operator(}) - operator(}) - - reserved(return) operator(()ident(NODE) operator(*\))ident(load)operator(;) -operator(}) - -ident(VALUE) -ident(rb_autoload_load)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(file)operator(;) - ident(NODE) operator(*)ident(load) operator(=) ident(autoload_delete)operator(()ident(klass)operator(,) ident(id)operator(\);) - - reserved(if) operator((!)ident(load) operator(||) operator(!()ident(file) operator(=) ident(load)operator(->)ident(nd_lit)operator(\)) operator(||) ident(rb_provided)operator(()ident(RSTRING)operator(()ident(file)operator(\)->)ident(ptr)operator(\)\)) operator({) - reserved(return) ident(Qfalse)operator(;) - operator(}) - reserved(return) ident(rb_require_safe)operator(()ident(file)operator(,) ident(load)operator(->)ident(nd_nth)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(autoload_file)operator(()ident(mod)operator(,) ident(id)operator(\)) - ident(VALUE) ident(mod)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(val)operator(,) ident(file)operator(;) - reserved(struct) ident(st_table) operator(*)ident(tbl)operator(;) - ident(st_data_t) ident(load)operator(;) - - reserved(if) operator((!)ident(st_lookup)operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(,) ident(autoload)operator(,) operator(&)ident(val)operator(\)) operator(||) - operator(!()ident(tbl) operator(=) ident(check_autoload_table)operator(()ident(val)operator(\)\)) operator(||) operator(!)ident(st_lookup)operator(()ident(tbl)operator(,) ident(id)operator(,) operator(&)ident(load)operator(\)\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - ident(file) operator(=) operator((()ident(NODE) operator(*\))ident(load)operator(\)->)ident(nd_lit)operator(;) - ident(Check_Type)operator(()ident(file)operator(,) ident(T_STRING)operator(\);) - reserved(if) operator((!)ident(RSTRING)operator(()ident(file)operator(\)->)ident(ptr) operator(||) operator(!*)ident(RSTRING)operator(()ident(file)operator(\)->)ident(ptr)operator(\)) operator({) - ident(rb_raise)operator(()ident(rb_eArgError)operator(,) stringoperator(\);) - operator(}) - reserved(if) operator((!)ident(rb_provided)operator(()ident(RSTRING)operator(()ident(file)operator(\)->)ident(ptr)operator(\)\)) operator({) - reserved(return) ident(file)operator(;) - operator(}) - - comment(/* already loaded but not defined */) - ident(st_delete)operator(()ident(tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(id)operator(,) integer(0)operator(\);) - reserved(if) operator((!)ident(tbl)operator(->)ident(num_entries)operator(\)) operator({) - ident(id) operator(=) ident(autoload)operator(;) - ident(st_delete)operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(id)operator(,) operator(&)ident(val)operator(\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - -ident(VALUE) -ident(rb_autoload_p)operator(()ident(mod)operator(,) ident(id)operator(\)) - ident(VALUE) ident(mod)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(struct) ident(st_table) operator(*)ident(tbl) operator(=) ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(;) - ident(VALUE) ident(val)operator(;) - - reserved(if) operator((!)ident(tbl) operator(||) operator(!)ident(st_lookup)operator(()ident(tbl)operator(,) ident(id)operator(,) operator(&)ident(val)operator(\)) operator(||) ident(val) operator(!=) ident(Qundef)operator(\)) operator({) - reserved(return) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(autoload_file)operator(()ident(mod)operator(,) ident(id)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(rb_const_get_0)operator(()ident(klass)operator(,) ident(id)operator(,) ident(exclude)operator(,) ident(recurse)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) - pre_type(int) ident(exclude)operator(,) ident(recurse)operator(;) -operator({) - ident(VALUE) ident(value)operator(,) ident(tmp)operator(;) - pre_type(int) ident(mod_retry) operator(=) integer(0)operator(;) - - ident(tmp) operator(=) ident(klass)operator(;) - label(retry:) - reserved(while) operator(()ident(tmp)operator(\)) operator({) - reserved(while) operator(()ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(iv_tbl) operator(&&) ident(st_lookup)operator(()ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(iv_tbl)operator(,)ident(id)operator(,&)ident(value)operator(\)\)) operator({) - reserved(if) operator(()ident(value) operator(==) ident(Qundef)operator(\)) operator({) - reserved(if) operator((!)ident(RTEST)operator(()ident(rb_autoload_load)operator(()ident(tmp)operator(,) ident(id)operator(\)\)\)) reserved(break)operator(;) - reserved(continue)operator(;) - operator(}) - reserved(if) operator(()ident(exclude) operator(&&) ident(tmp) operator(==) ident(rb_cObject) operator(&&) ident(klass) operator(!=) ident(rb_cObject)operator(\)) operator({) - ident(rb_warn)operator(()stringoperator(,) - ident(rb_id2name)operator(()ident(id)operator(\),) ident(rb_class2name)operator(()ident(klass)operator(\),) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(return) ident(value)operator(;) - operator(}) - reserved(if) operator((!)ident(recurse) operator(&&) ident(klass) operator(!=) ident(rb_cObject)operator(\)) reserved(break)operator(;) - ident(tmp) operator(=) ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(super)operator(;) - operator(}) - reserved(if) operator((!)ident(exclude) operator(&&) operator(!)ident(mod_retry) operator(&&) ident(BUILTIN_TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_MODULE)operator(\)) operator({) - ident(mod_retry) operator(=) integer(1)operator(;) - ident(tmp) operator(=) ident(rb_cObject)operator(;) - reserved(goto) ident(retry)operator(;) - operator(}) - - reserved(return) ident(const_missing)operator(()ident(klass)operator(,) ident(id)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_const_get_from)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(return) ident(rb_const_get_0)operator(()ident(klass)operator(,) ident(id)operator(,) ident(Qtrue)operator(,) ident(Qtrue)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_const_get)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(return) ident(rb_const_get_0)operator(()ident(klass)operator(,) ident(id)operator(,) ident(Qfalse)operator(,) ident(Qtrue)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_const_get_at)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(return) ident(rb_const_get_0)operator(()ident(klass)operator(,) ident(id)operator(,) ident(Qtrue)operator(,) ident(Qfalse)operator(\);) -operator(}) - -comment(/* - * call-seq: - * remove_const(sym\) => obj - * - * Removes the definition of the given constant, returning that - * constant's value. Predefined classes and singleton objects (such as - * true\) cannot be removed. - */) - -ident(VALUE) -ident(rb_mod_remove_const)operator(()ident(mod)operator(,) ident(name)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(name)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(name)operator(\);) - ident(VALUE) ident(val)operator(;) - - reserved(if) operator((!)ident(rb_is_const_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(mod)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(mod)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - - reserved(if) operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl) operator(&&) ident(st_delete)operator(()ident(ROBJECT)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(id)operator(,) operator(&)ident(val)operator(\)\)) operator({) - reserved(if) operator(()ident(val) operator(==) ident(Qundef)operator(\)) operator({) - ident(autoload_delete)operator(()ident(mod)operator(,) ident(id)operator(\);) - ident(val) operator(=) ident(Qnil)operator(;) - operator(}) - reserved(return) ident(val)operator(;) - operator(}) - reserved(if) operator(()ident(rb_const_defined_at)operator(()ident(mod)operator(,) ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) - ident(rb_class2name)operator(()ident(mod)operator(\),) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) - ident(rb_class2name)operator(()ident(mod)operator(\),) ident(rb_id2name)operator(()ident(id)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -directive(static) pre_type(int) -ident(sv_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(tbl)operator(\)) - ident(ID) ident(key)operator(;) - ident(VALUE) ident(value)operator(;) - ident(st_table) operator(*)ident(tbl)operator(;) -operator({) - reserved(if) operator(()ident(rb_is_const_id)operator(()ident(key)operator(\)\)) operator({) - reserved(if) operator((!)ident(st_lookup)operator(()ident(tbl)operator(,) ident(key)operator(,) integer(0)operator(\)\)) operator({) - ident(st_insert)operator(()ident(tbl)operator(,) ident(key)operator(,) ident(key)operator(\);) - operator(}) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -directive(void)operator(*) -ident(rb_mod_const_at)operator(()ident(mod)operator(,) ident(data)operator(\)) - ident(VALUE) ident(mod)operator(;) - directive(void) operator(*)ident(data)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl) operator(=) ident(data)operator(;) - reserved(if) operator((!)ident(tbl)operator(\)) operator({) - ident(tbl) operator(=) ident(st_init_numtable)operator((\);) - operator(}) - reserved(if) operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(st_foreach_safe)operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(,) ident(sv_i)operator(,) operator(()ident(st_data_t)operator(\))ident(tbl)operator(\);) - operator(}) - reserved(return) ident(tbl)operator(;) -operator(}) - -directive(void)operator(*) -ident(rb_mod_const_of)operator(()ident(mod)operator(,) ident(data)operator(\)) - ident(VALUE) ident(mod)operator(;) - directive(void) operator(*)ident(data)operator(;) -operator({) - ident(VALUE) ident(tmp) operator(=) ident(mod)operator(;) - reserved(for) operator((;;\)) operator({) - ident(data) operator(=) ident(rb_mod_const_at)operator(()ident(tmp)operator(,) ident(data)operator(\);) - ident(tmp) operator(=) ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(super)operator(;) - reserved(if) operator((!)ident(tmp)operator(\)) reserved(break)operator(;) - reserved(if) operator(()ident(tmp) operator(==) ident(rb_cObject) operator(&&) ident(mod) operator(!=) ident(rb_cObject)operator(\)) reserved(break)operator(;) - operator(}) - reserved(return) ident(data)operator(;) -operator(}) - -directive(static) pre_type(int) -ident(list_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(ary)operator(\)) - ident(ID) ident(key)operator(,) ident(value)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(key)operator(\)\)\);) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -ident(VALUE) -ident(rb_const_list)operator(()ident(data)operator(\)) - directive(void) operator(*)ident(data)operator(;) -operator({) - ident(st_table) operator(*)ident(tbl) operator(=) ident(data)operator(;) - ident(VALUE) ident(ary)operator(;) - - reserved(if) operator((!)ident(tbl)operator(\)) reserved(return) ident(rb_ary_new2)operator(()integer(0)operator(\);) - ident(ary) operator(=) ident(rb_ary_new2)operator(()ident(tbl)operator(->)ident(num_entries)operator(\);) - ident(st_foreach)operator(()ident(tbl)operator(,) ident(list_i)operator(,) ident(ary)operator(\);) - ident(st_free_table)operator(()ident(tbl)operator(\);) - - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.constants => array - * - * Returns an array of the names of the constants accessible in - * mod. This includes the names of constants in any included - * modules (example at start of section\). - */) - -ident(VALUE) -ident(rb_mod_constants)operator(()ident(mod)operator(\)) - ident(VALUE) ident(mod)operator(;) -operator({) - reserved(return) ident(rb_const_list)operator(()ident(rb_mod_const_of)operator(()ident(mod)operator(,) integer(0)operator(\)\);) -operator(}) - -directive(static) pre_type(int) -ident(rb_const_defined_0)operator(()ident(klass)operator(,) ident(id)operator(,) ident(exclude)operator(,) ident(recurse)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) - pre_type(int) ident(exclude)operator(,) ident(recurse)operator(;) -operator({) - ident(VALUE) ident(value)operator(,) ident(tmp)operator(;) - pre_type(int) ident(mod_retry) operator(=) integer(0)operator(;) - - ident(tmp) operator(=) ident(klass)operator(;) - label(retry:) - reserved(while) operator(()ident(tmp)operator(\)) operator({) - reserved(if) operator(()ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(iv_tbl) operator(&&) ident(st_lookup)operator(()ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(iv_tbl)operator(,) ident(id)operator(,) operator(&)ident(value)operator(\)\)) operator({) - reserved(if) operator(()ident(value) operator(==) ident(Qundef) operator(&&) ident(NIL_P)operator(()ident(autoload_file)operator(()ident(klass)operator(,) ident(id)operator(\)\)\)) - reserved(return) ident(Qfalse)operator(;) - reserved(return) ident(Qtrue)operator(;) - operator(}) - reserved(if) operator((!)ident(recurse) operator(&&) ident(klass) operator(!=) ident(rb_cObject)operator(\)) reserved(break)operator(;) - ident(tmp) operator(=) ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(super)operator(;) - operator(}) - reserved(if) operator((!)ident(exclude) operator(&&) operator(!)ident(mod_retry) operator(&&) ident(BUILTIN_TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_MODULE)operator(\)) operator({) - ident(mod_retry) operator(=) integer(1)operator(;) - ident(tmp) operator(=) ident(rb_cObject)operator(;) - reserved(goto) ident(retry)operator(;) - operator(}) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -pre_type(int) -ident(rb_const_defined_from)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(return) ident(rb_const_defined_0)operator(()ident(klass)operator(,) ident(id)operator(,) ident(Qtrue)operator(,) ident(Qtrue)operator(\);) -operator(}) - -pre_type(int) -ident(rb_const_defined)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(return) ident(rb_const_defined_0)operator(()ident(klass)operator(,) ident(id)operator(,) ident(Qfalse)operator(,) ident(Qtrue)operator(\);) -operator(}) - -pre_type(int) -ident(rb_const_defined_at)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - reserved(return) ident(rb_const_defined_0)operator(()ident(klass)operator(,) ident(id)operator(,) ident(Qtrue)operator(,) ident(Qfalse)operator(\);) -operator(}) - -directive(static) directive(void) -ident(mod_av_set)operator(()ident(klass)operator(,) ident(id)operator(,) ident(val)operator(,) ident(isconst)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(val)operator(;) - pre_type(int) ident(isconst)operator(;) -operator({) - pre_type(char) operator(*)ident(dest) operator(=) ident(isconst) operator(?) string operator(:) stringoperator(;) - - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(klass)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(,) ident(dest)operator(\);) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(klass)operator(\)\)) operator({) - reserved(if) operator(()ident(BUILTIN_TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_MODULE)operator(\)) operator({) - ident(rb_error_frozen)operator(()stringoperator(\);) - operator(}) - reserved(else) operator({) - ident(rb_error_frozen)operator(()stringoperator(\);) - operator(}) - operator(}) - reserved(if) operator((!)ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl) operator(=) ident(st_init_numtable)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(isconst)operator(\)) operator({) - ident(VALUE) ident(value) operator(=) ident(Qfalse)operator(;) - - reserved(if) operator(()ident(st_lookup)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(,) ident(id)operator(,) operator(&)ident(value)operator(\)\)) operator({) - reserved(if) operator(()ident(value) operator(==) ident(Qundef)operator(\)) - ident(autoload_delete)operator(()ident(klass)operator(,) ident(id)operator(\);) - reserved(else) - ident(rb_warn)operator(()stringoperator(,) ident(dest)operator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - operator(}) - - ident(st_insert)operator(()ident(RCLASS)operator(()ident(klass)operator(\)->)ident(iv_tbl)operator(,) ident(id)operator(,) ident(val)operator(\);) -operator(}) - -directive(void) -ident(rb_const_set)operator(()ident(klass)operator(,) ident(id)operator(,) ident(val)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - reserved(if) operator(()ident(NIL_P)operator(()ident(klass)operator(\)\)) operator({) - ident(rb_raise)operator(()ident(rb_eTypeError)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - ident(mod_av_set)operator(()ident(klass)operator(,) ident(id)operator(,) ident(val)operator(,) ident(Qtrue)operator(\);) -operator(}) - -directive(void) -ident(rb_define_const)operator(()ident(klass)operator(,) ident(name)operator(,) ident(val)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - - reserved(if) operator((!)ident(rb_is_const_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_warn)operator(()stringoperator(,) ident(name)operator(\);) - operator(}) - reserved(if) operator(()ident(klass) operator(==) ident(rb_cObject)operator(\)) operator({) - ident(rb_secure)operator(()integer(4)operator(\);) - operator(}) - ident(rb_const_set)operator(()ident(klass)operator(,) ident(id)operator(,) ident(val)operator(\);) -operator(}) - -directive(void) -ident(rb_define_global_const)operator(()ident(name)operator(,) ident(val)operator(\)) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(rb_define_const)operator(()ident(rb_cObject)operator(,) ident(name)operator(,) ident(val)operator(\);) -operator(}) - -directive(static) ident(VALUE) -ident(original_module)operator(()ident(c)operator(\)) - ident(VALUE) ident(c)operator(;) -operator({) - reserved(if) operator(()ident(TYPE)operator(()ident(c)operator(\)) operator(==) ident(T_ICLASS)operator(\)) - reserved(return) ident(RBASIC)operator(()ident(c)operator(\)->)ident(klass)operator(;) - reserved(return) ident(c)operator(;) -operator(}) - -directive(static) directive(void) -ident(cvar_override_check)operator(()ident(id)operator(,) ident(a)operator(\)) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(a)operator(;) -operator({) - ident(VALUE) ident(base) operator(=) ident(original_module)operator(()ident(a)operator(\);) - - ident(a) operator(=) ident(RCLASS)operator(()ident(a)operator(\)->)ident(super)operator(;) - reserved(while) operator(()ident(a)operator(\)) operator({) - reserved(if) operator(()ident(RCLASS)operator(()ident(a)operator(\)->)ident(iv_tbl)operator(\)) operator({) - reserved(if) operator(()ident(st_lookup)operator(()ident(RCLASS)operator(()ident(a)operator(\)->)ident(iv_tbl)operator(,)ident(id)operator(,)integer(0)operator(\)\)) operator({) - ident(rb_warning)operator(()stringoperator(,) - ident(rb_id2name)operator(()ident(id)operator(\),) ident(rb_class2name)operator(()ident(original_module)operator(()ident(a)operator(\)\),) - ident(rb_class2name)operator(()ident(base)operator(\)\);) - operator(}) - operator(}) - ident(a) operator(=) ident(RCLASS)operator(()ident(a)operator(\)->)ident(super)operator(;) - operator(}) -operator(}) - -directive(void) -ident(rb_cvar_set)operator(()ident(klass)operator(,) ident(id)operator(,) ident(val)operator(,) ident(warn)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(val)operator(;) - pre_type(int) ident(warn)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(;) - - ident(tmp) operator(=) ident(klass)operator(;) - reserved(while) operator(()ident(tmp)operator(\)) operator({) - reserved(if) operator(()ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(iv_tbl) operator(&&) ident(st_lookup)operator(()ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(iv_tbl)operator(,)ident(id)operator(,)integer(0)operator(\)\)) operator({) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(tmp)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(tmp)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(warn) operator(&&) ident(RTEST)operator(()ident(ruby_verbose)operator(\)) operator(&&) ident(klass) operator(!=) ident(tmp)operator(\)) operator({) - ident(rb_warning)operator(()stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - ident(st_insert)operator(()ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(iv_tbl)operator(,)ident(id)operator(,)ident(val)operator(\);) - reserved(if) operator(()ident(RTEST)operator(()ident(ruby_verbose)operator(\)\)) operator({) - ident(cvar_override_check)operator(()ident(id)operator(,) ident(tmp)operator(\);) - operator(}) - reserved(return)operator(;) - operator(}) - ident(tmp) operator(=) ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(super)operator(;) - operator(}) - - ident(mod_av_set)operator(()ident(klass)operator(,) ident(id)operator(,) ident(val)operator(,) ident(Qfalse)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_cvar_get)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(value)operator(;) - ident(VALUE) ident(tmp)operator(;) - - ident(tmp) operator(=) ident(klass)operator(;) - reserved(while) operator(()ident(tmp)operator(\)) operator({) - reserved(if) operator(()ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(iv_tbl)operator(\)) operator({) - reserved(if) operator(()ident(st_lookup)operator(()ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(iv_tbl)operator(,)ident(id)operator(,&)ident(value)operator(\)\)) operator({) - reserved(if) operator(()ident(RTEST)operator(()ident(ruby_verbose)operator(\)\)) operator({) - ident(cvar_override_check)operator(()ident(id)operator(,) ident(tmp)operator(\);) - operator(}) - reserved(return) ident(value)operator(;) - operator(}) - operator(}) - ident(tmp) operator(=) ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(super)operator(;) - operator(}) - - ident(rb_name_error)operator(()ident(id)operator(,)stringoperator(,) - ident(rb_id2name)operator(()ident(id)operator(\),) ident(rb_class2name)operator(()ident(klass)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -ident(VALUE) -ident(rb_cvar_defined)operator(()ident(klass)operator(,) ident(id)operator(\)) - ident(VALUE) ident(klass)operator(;) - ident(ID) ident(id)operator(;) -operator({) - ident(VALUE) ident(tmp)operator(;) - - ident(tmp) operator(=) ident(klass)operator(;) - reserved(while) operator(()ident(tmp)operator(\)) operator({) - reserved(if) operator(()ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(iv_tbl) operator(&&) ident(st_lookup)operator(()ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(iv_tbl)operator(,)ident(id)operator(,)integer(0)operator(\)\)) operator({) - reserved(return) ident(Qtrue)operator(;) - operator(}) - ident(tmp) operator(=) ident(RCLASS)operator(()ident(tmp)operator(\)->)ident(super)operator(;) - operator(}) - - reserved(return) ident(Qfalse)operator(;) -operator(}) - -directive(void) -ident(rb_cv_set)operator(()ident(klass)operator(,) ident(name)operator(,) ident(val)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - reserved(if) operator((!)ident(rb_is_class_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(name)operator(\);) - operator(}) - ident(rb_cvar_set)operator(()ident(klass)operator(,) ident(id)operator(,) ident(val)operator(,) ident(Qfalse)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_cv_get)operator(()ident(klass)operator(,) ident(name)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - reserved(if) operator((!)ident(rb_is_class_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(name)operator(\);) - operator(}) - reserved(return) ident(rb_cvar_get)operator(()ident(klass)operator(,) ident(id)operator(\);) -operator(}) - -directive(void) -ident(rb_define_class_variable)operator(()ident(klass)operator(,) ident(name)operator(,) ident(val)operator(\)) - ident(VALUE) ident(klass)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - - reserved(if) operator((!)ident(rb_is_class_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(name)operator(\);) - operator(}) - ident(rb_cvar_set)operator(()ident(klass)operator(,) ident(id)operator(,) ident(val)operator(,) ident(Qtrue)operator(\);) -operator(}) - -directive(static) pre_type(int) -ident(cv_i)operator(()ident(key)operator(,) ident(value)operator(,) ident(ary)operator(\)) - ident(ID) ident(key)operator(;) - ident(VALUE) ident(value)operator(;) - ident(VALUE) ident(ary)operator(;) -operator({) - reserved(if) operator(()ident(rb_is_class_id)operator(()ident(key)operator(\)\)) operator({) - ident(VALUE) ident(kval) operator(=) ident(rb_str_new2)operator(()ident(rb_id2name)operator(()ident(key)operator(\)\);) - reserved(if) operator((!)ident(rb_ary_includes)operator(()ident(ary)operator(,) ident(kval)operator(\)\)) operator({) - ident(rb_ary_push)operator(()ident(ary)operator(,) ident(kval)operator(\);) - operator(}) - operator(}) - reserved(return) ident(ST_CONTINUE)operator(;) -operator(}) - -comment(/* - * call-seq: - * mod.class_variables => array - * - * Returns an array of the names of class variables in mod and - * the ancestors of mod. - * - * class One - * @@var1 = 1 - * end - * class Two < One - * @@var2 = 2 - * end - * One.class_variables #=> ["@@var1"] - * Two.class_variables #=> ["@@var2", "@@var1"] - */) - -ident(VALUE) -ident(rb_mod_class_variables)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -operator({) - ident(VALUE) ident(ary) operator(=) ident(rb_ary_new)operator((\);) - - reserved(for) operator((;;\)) operator({) - reserved(if) operator(()ident(RCLASS)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(\)) operator({) - ident(st_foreach_safe)operator(()ident(RCLASS)operator(()ident(obj)operator(\)->)ident(iv_tbl)operator(,) ident(cv_i)operator(,) ident(ary)operator(\);) - operator(}) - ident(obj) operator(=) ident(RCLASS)operator(()ident(obj)operator(\)->)ident(super)operator(;) - reserved(if) operator((!)ident(obj)operator(\)) reserved(break)operator(;) - operator(}) - reserved(return) ident(ary)operator(;) -operator(}) - -comment(/* - * call-seq: - * remove_class_variable(sym\) => obj - * - * Removes the definition of the sym, returning that - * constant's value. - * - * class Dummy - * @@var = 99 - * puts @@var - * remove_class_variable(:@@var\) - * puts(defined? @@var\) - * end - * - * produces: - * - * 99 - * nil - */) - -ident(VALUE) -ident(rb_mod_remove_cvar)operator(()ident(mod)operator(,) ident(name)operator(\)) - ident(VALUE) ident(mod)operator(,) ident(name)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_to_id)operator(()ident(name)operator(\);) - ident(VALUE) ident(val)operator(;) - - reserved(if) operator((!)ident(rb_is_class_id)operator(()ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) ident(rb_id2name)operator(()ident(id)operator(\)\);) - operator(}) - reserved(if) operator((!)ident(OBJ_TAINTED)operator(()ident(mod)operator(\)) operator(&&) ident(rb_safe_level)operator((\)) operator(>=) integer(4)operator(\)) - ident(rb_raise)operator(()ident(rb_eSecurityError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(OBJ_FROZEN)operator(()ident(mod)operator(\)\)) ident(rb_error_frozen)operator(()stringoperator(\);) - - reserved(if) operator(()ident(RCLASS)operator(()ident(mod)operator(\)->)ident(iv_tbl) operator(&&) ident(st_delete)operator(()ident(ROBJECT)operator(()ident(mod)operator(\)->)ident(iv_tbl)operator(,) operator(()ident(st_data_t)operator(*\)&)ident(id)operator(,) operator(&)ident(val)operator(\)\)) operator({) - reserved(return) ident(val)operator(;) - operator(}) - reserved(if) operator(()ident(rb_cvar_defined)operator(()ident(mod)operator(,) ident(id)operator(\)\)) operator({) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(id)operator(\),) ident(rb_class2name)operator(()ident(mod)operator(\)\);) - operator(}) - ident(rb_name_error)operator(()ident(id)operator(,) stringoperator(,) - ident(rb_id2name)operator(()ident(id)operator(\),) ident(rb_class2name)operator(()ident(mod)operator(\)\);) - reserved(return) ident(Qnil)operator(;) comment(/* not reached */) -operator(}) - -ident(VALUE) -ident(rb_iv_get)operator(()ident(obj)operator(,) ident(name)operator(\)) - ident(VALUE) ident(obj)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - - reserved(return) ident(rb_ivar_get)operator(()ident(obj)operator(,) ident(id)operator(\);) -operator(}) - -ident(VALUE) -ident(rb_iv_set)operator(()ident(obj)operator(,) ident(name)operator(,) ident(val)operator(\)) - ident(VALUE) ident(obj)operator(;) - directive(const) pre_type(char) operator(*)ident(name)operator(;) - ident(VALUE) ident(val)operator(;) -operator({) - ident(ID) ident(id) operator(=) ident(rb_intern)operator(()ident(name)operator(\);) - - reserved(return) ident(rb_ivar_set)operator(()ident(obj)operator(,) ident(id)operator(,) ident(val)operator(\);) -operator(}) -comment(/********************************************************************** - - version.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007\) $ - created at: Thu Sep 30 20:08:01 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#include) include("ruby.h") -preprocessor(#include) include("version.h") -preprocessor(#include) include() - -directive(const) pre_type(char) ident(ruby_version)operator([]) operator(=) ident(RUBY_VERSION)operator(;) -directive(const) pre_type(char) ident(ruby_release_date)operator([]) operator(=) ident(RUBY_RELEASE_DATE)operator(;) -directive(const) pre_type(char) ident(ruby_platform)operator([]) operator(=) ident(RUBY_PLATFORM)operator(;) -directive(const) pre_type(int) ident(ruby_patchlevel) operator(=) ident(RUBY_PATCHLEVEL)operator(;) - -directive(void) -ident(Init_version)operator((\)) -operator({) - ident(VALUE) ident(v) operator(=) ident(rb_obj_freeze)operator(()ident(rb_str_new2)operator(()ident(ruby_version)operator(\)\);) - ident(VALUE) ident(d) operator(=) ident(rb_obj_freeze)operator(()ident(rb_str_new2)operator(()ident(ruby_release_date)operator(\)\);) - ident(VALUE) ident(p) operator(=) ident(rb_obj_freeze)operator(()ident(rb_str_new2)operator(()ident(ruby_platform)operator(\)\);) - - ident(rb_define_global_const)operator(()stringoperator(,) ident(v)operator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(d)operator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(p)operator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(INT2FIX)operator(()ident(RUBY_PATCHLEVEL)operator(\)\);) - - comment(/* obsolete constants */) - ident(rb_define_global_const)operator(()stringoperator(,) ident(v)operator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(d)operator(\);) - ident(rb_define_global_const)operator(()stringoperator(,) ident(p)operator(\);) -operator(}) - -directive(void) -ident(ruby_show_version)operator((\)) -operator({) - ident(printf)operator(()stringoperator(,) ident(RUBY_VERSION)operator(,) ident(RUBY_RELEASE_DATE)operator(,) ident(RUBY_PATCHLEVEL)operator(,) ident(RUBY_PLATFORM)operator(\);) - ident(fflush)operator(()ident(stdout)operator(\);) -operator(}) - -directive(void) -ident(ruby_show_copyright)operator((\)) -operator({) - ident(printf)operator(()stringoperator(,) ident(RUBY_RELEASE_YEAR)operator(\);) - ident(exit)operator(()integer(0)operator(\);) -operator(}) -preprocessor(#define) ident(PACKAGE_NAME) string -preprocessor(#define) ident(PACKAGE_TARNAME) string -preprocessor(#define) ident(PACKAGE_VERSION) string -preprocessor(#define) ident(PACKAGE_STRING) string -preprocessor(#define) ident(PACKAGE_BUGREPORT) string -preprocessor(#define) ident(USE_BUILTIN_FRAME_ADDRESS) integer(1) -preprocessor(#define) ident(STDC_HEADERS) integer(1) -preprocessor(#define) ident(HAVE_SYS_TYPES_H) integer(1) -preprocessor(#define) ident(HAVE_SYS_STAT_H) integer(1) -preprocessor(#define) ident(HAVE_STDLIB_H) integer(1) -preprocessor(#define) ident(HAVE_STRING_H) integer(1) -preprocessor(#define) ident(HAVE_MEMORY_H) integer(1) -preprocessor(#define) ident(HAVE_STRINGS_H) integer(1) -preprocessor(#define) ident(HAVE_INTTYPES_H) integer(1) -preprocessor(#define) ident(HAVE_STDINT_H) integer(1) -preprocessor(#define) ident(HAVE_UNISTD_H) integer(1) -preprocessor(#define) ident(HAVE_LONG_LONG) integer(1) -preprocessor(#define) ident(HAVE_OFF_T) integer(1) -preprocessor(#define) ident(SIZEOF_INT) integer(4) -preprocessor(#define) ident(SIZEOF_SHORT) integer(2) -preprocessor(#define) ident(SIZEOF_LONG) integer(4) -preprocessor(#define) ident(SIZEOF_LONG_LONG) integer(8) -preprocessor(#define) ident(SIZEOF___INT64) integer(0) -preprocessor(#define) ident(SIZEOF_OFF_T) integer(8) -preprocessor(#define) ident(SIZEOF_VOIDP) integer(4) -preprocessor(#define) ident(SIZEOF_FLOAT) integer(4) -preprocessor(#define) ident(SIZEOF_DOUBLE) integer(8) -preprocessor(#define) ident(SIZEOF_TIME_T) integer(4) -preprocessor(#define) ident(rb_pid_t) ident(pid_t) -preprocessor(#define) ident(rb_gid_t) ident(gid_t) -preprocessor(#define) ident(rb_uid_t) ident(uid_t) -preprocessor(#define) ident(HAVE_PROTOTYPES) integer(1) -preprocessor(#define) ident(TOKEN_PASTE)operator(()ident(x)operator(,)ident(y)operator(\)) ident(x)preprocessor(#)preprocessor(#y) -preprocessor(#define) ident(HAVE_STDARG_PROTOTYPES) integer(1) -preprocessor(#define) ident(NORETURN)operator(()ident(x)operator(\)) ident(__attribute__) operator((()ident(noreturn)operator(\)\)) ident(x) -preprocessor(#define) ident(NOINLINE)operator(()ident(x)operator(\)) ident(__attribute__) operator((()ident(noinline)operator(\)\)) ident(x) -preprocessor(#define) ident(HAVE_DECL_SYS_NERR) integer(1) -preprocessor(#define) ident(HAVE_LIBDL) integer(1) -preprocessor(#define) ident(HAVE_DIRENT_H) integer(1) -preprocessor(#define) ident(STDC_HEADERS) integer(1) -preprocessor(#define) ident(HAVE_SYS_WAIT_H) integer(1) -preprocessor(#define) ident(HAVE_STDLIB_H) integer(1) -preprocessor(#define) ident(HAVE_STRING_H) integer(1) -preprocessor(#define) ident(HAVE_UNISTD_H) integer(1) -preprocessor(#define) ident(HAVE_LIMITS_H) integer(1) -preprocessor(#define) ident(HAVE_SYS_FILE_H) integer(1) -preprocessor(#define) ident(HAVE_SYS_IOCTL_H) integer(1) -preprocessor(#define) ident(HAVE_SYS_SYSCALL_H) integer(1) -preprocessor(#define) ident(HAVE_FCNTL_H) integer(1) -preprocessor(#define) ident(HAVE_SYS_FCNTL_H) integer(1) -preprocessor(#define) ident(HAVE_SYS_SELECT_H) integer(1) -preprocessor(#define) ident(HAVE_SYS_TIME_H) integer(1) -preprocessor(#define) ident(HAVE_SYS_TIMES_H) integer(1) -preprocessor(#define) ident(HAVE_SYS_PARAM_H) integer(1) -preprocessor(#define) ident(HAVE_PWD_H) integer(1) -preprocessor(#define) ident(HAVE_GRP_H) integer(1) -preprocessor(#define) ident(HAVE_UTIME_H) integer(1) -preprocessor(#define) ident(HAVE_MEMORY_H) integer(1) -preprocessor(#define) ident(HAVE_SYS_RESOURCE_H) integer(1) -preprocessor(#define) ident(HAVE_NETINET_IN_SYSTM_H) integer(1) -preprocessor(#define) ident(HAVE_FLOAT_H) integer(1) -preprocessor(#define) ident(HAVE_PTHREAD_H) integer(1) -preprocessor(#define) ident(HAVE_UCONTEXT_H) integer(1) -preprocessor(#define) ident(SIZEOF_RLIM_T) integer(8) -preprocessor(#define) ident(HAVE_STRUCT_STAT_ST_BLKSIZE) integer(1) -preprocessor(#define) ident(HAVE_ST_BLKSIZE) integer(1) -preprocessor(#define) ident(HAVE_STRUCT_STAT_ST_BLOCKS) integer(1) -preprocessor(#define) ident(HAVE_ST_BLOCKS) integer(1) -preprocessor(#define) ident(HAVE_STRUCT_STAT_ST_RDEV) integer(1) -preprocessor(#define) ident(HAVE_ST_RDEV) integer(1) -preprocessor(#define) ident(GETGROUPS_T) ident(gid_t) -preprocessor(#define) ident(RETSIGTYPE) directive(void) -preprocessor(#define) ident(HAVE_ALLOCA_H) integer(1) -preprocessor(#define) ident(HAVE_ALLOCA) integer(1) -preprocessor(#define) ident(HAVE_FSEEKO) integer(1) -preprocessor(#define) ident(HAVE_FTELLO) integer(1) -preprocessor(#define) ident(HAVE_DUP2) integer(1) -preprocessor(#define) ident(HAVE_MEMMOVE) integer(1) -preprocessor(#define) ident(HAVE_STRCASECMP) integer(1) -preprocessor(#define) ident(HAVE_STRNCASECMP) integer(1) -preprocessor(#define) ident(HAVE_STRERROR) integer(1) -preprocessor(#define) ident(HAVE_STRFTIME) integer(1) -preprocessor(#define) ident(HAVE_STRCHR) integer(1) -preprocessor(#define) ident(HAVE_STRSTR) integer(1) -preprocessor(#define) ident(HAVE_STRTOUL) integer(1) -preprocessor(#define) ident(HAVE_CRYPT) integer(1) -preprocessor(#define) ident(HAVE_FLOCK) integer(1) -preprocessor(#define) ident(HAVE_VSNPRINTF) integer(1) -preprocessor(#define) ident(HAVE_ISNAN) integer(1) -preprocessor(#define) ident(HAVE_FINITE) integer(1) -preprocessor(#define) ident(HAVE_ISINF) integer(1) -preprocessor(#define) ident(HAVE_HYPOT) integer(1) -preprocessor(#define) ident(HAVE_ACOSH) integer(1) -preprocessor(#define) ident(HAVE_ERF) integer(1) -preprocessor(#define) ident(HAVE_FMOD) integer(1) -preprocessor(#define) ident(HAVE_KILLPG) integer(1) -preprocessor(#define) ident(HAVE_WAIT4) integer(1) -preprocessor(#define) ident(HAVE_WAITPID) integer(1) -preprocessor(#define) ident(HAVE_SYSCALL) integer(1) -preprocessor(#define) ident(HAVE_CHROOT) integer(1) -preprocessor(#define) ident(HAVE_FSYNC) integer(1) -preprocessor(#define) ident(HAVE_GETCWD) integer(1) -preprocessor(#define) ident(HAVE_TRUNCATE) integer(1) -preprocessor(#define) ident(HAVE_FTRUNCATE) integer(1) -preprocessor(#define) ident(HAVE_TIMES) integer(1) -preprocessor(#define) ident(HAVE_UTIMES) integer(1) -preprocessor(#define) ident(HAVE_FCNTL) integer(1) -preprocessor(#define) ident(HAVE_LOCKF) integer(1) -preprocessor(#define) ident(HAVE_LSTAT) integer(1) -preprocessor(#define) ident(HAVE_SYMLINK) integer(1) -preprocessor(#define) ident(HAVE_LINK) integer(1) -preprocessor(#define) ident(HAVE_READLINK) integer(1) -preprocessor(#define) ident(HAVE_SETITIMER) integer(1) -preprocessor(#define) ident(HAVE_SETRUID) integer(1) -preprocessor(#define) ident(HAVE_SETEUID) integer(1) -preprocessor(#define) ident(HAVE_SETREUID) integer(1) -preprocessor(#define) ident(HAVE_SETRGID) integer(1) -preprocessor(#define) ident(HAVE_SETEGID) integer(1) -preprocessor(#define) ident(HAVE_SETREGID) integer(1) -preprocessor(#define) ident(HAVE_ISSETUGID) integer(1) -preprocessor(#define) ident(HAVE_PAUSE) integer(1) -preprocessor(#define) ident(HAVE_LCHOWN) integer(1) -preprocessor(#define) ident(HAVE_LCHMOD) integer(1) -preprocessor(#define) ident(HAVE_GETPGRP) integer(1) -preprocessor(#define) ident(HAVE_SETPGRP) integer(1) -preprocessor(#define) ident(HAVE_GETPGID) integer(1) -preprocessor(#define) ident(HAVE_SETPGID) integer(1) -preprocessor(#define) ident(HAVE_INITGROUPS) integer(1) -preprocessor(#define) ident(HAVE_GETGROUPS) integer(1) -preprocessor(#define) ident(HAVE_SETGROUPS) integer(1) -preprocessor(#define) ident(HAVE_GETPRIORITY) integer(1) -preprocessor(#define) ident(HAVE_GETRLIMIT) integer(1) -preprocessor(#define) ident(HAVE_SETRLIMIT) integer(1) -preprocessor(#define) ident(HAVE_SYSCONF) integer(1) -preprocessor(#define) ident(HAVE_DLOPEN) integer(1) -preprocessor(#define) ident(HAVE_SIGPROCMASK) integer(1) -preprocessor(#define) ident(HAVE_SIGACTION) integer(1) -preprocessor(#define) ident(HAVE__SETJMP) integer(1) -preprocessor(#define) ident(HAVE_SETSID) integer(1) -preprocessor(#define) ident(HAVE_TELLDIR) integer(1) -preprocessor(#define) ident(HAVE_SEEKDIR) integer(1) -preprocessor(#define) ident(HAVE_FCHMOD) integer(1) -preprocessor(#define) ident(HAVE_MKTIME) integer(1) -preprocessor(#define) ident(HAVE_TIMEGM) integer(1) -preprocessor(#define) ident(HAVE_GETTIMEOFDAY) integer(1) -preprocessor(#define) ident(HAVE_COSH) integer(1) -preprocessor(#define) ident(HAVE_SINH) integer(1) -preprocessor(#define) ident(HAVE_TANH) integer(1) -preprocessor(#define) ident(HAVE_ROUND) integer(1) -preprocessor(#define) ident(HAVE_SETUID) integer(1) -preprocessor(#define) ident(HAVE_SETGID) integer(1) -preprocessor(#define) ident(HAVE_SETENV) integer(1) -preprocessor(#define) ident(HAVE_UNSETENV) integer(1) -preprocessor(#define) ident(HAVE_STRUCT_TM_TM_ZONE) integer(1) -preprocessor(#define) ident(HAVE_TM_ZONE) integer(1) -preprocessor(#define) ident(HAVE_STRUCT_TM_TM_GMTOFF) integer(1) -preprocessor(#define) ident(HAVE_DAYLIGHT) integer(1) -preprocessor(#define) ident(HAVE_VAR_TIMEZONE) integer(1) -preprocessor(#define) ident(TYPEOF_VAR_TIMEZONE) pre_type(long) -preprocessor(#define) ident(NEGATIVE_TIME_T) integer(1) -preprocessor(#define) ident(POSIX_SIGNAL) integer(1) -preprocessor(#define) ident(GETPGRP_VOID) integer(1) -preprocessor(#define) ident(SETPGRP_VOID) integer(1) -preprocessor(#define) ident(RSHIFT)operator(()ident(x)operator(,)ident(y)operator(\)) operator((()ident(x)operator(\)>>()pre_type(int)operator(\))ident(y)operator(\)) -preprocessor(#define) ident(FILE_COUNT) ident(_r) -preprocessor(#define) ident(FILE_READPTR) ident(_p) -preprocessor(#define) ident(NEED_IO_SEEK_BETWEEN_RW) integer(1) -preprocessor(#define) ident(HAVE__SC_CLK_TCK) integer(1) -preprocessor(#define) ident(STACK_GROW_DIRECTION) operator(-)integer(1) -preprocessor(#define) ident(DEFAULT_KCODE) ident(KCODE_NONE) -preprocessor(#define) ident(DLEXT_MAXLEN) integer(7) -preprocessor(#define) ident(DLEXT) string -preprocessor(#define) ident(RUBY_LIB) string -preprocessor(#define) ident(RUBY_SITE_LIB) string -preprocessor(#define) ident(RUBY_SITE_LIB2) string -preprocessor(#define) ident(RUBY_PLATFORM) string -preprocessor(#define) ident(RUBY_ARCHLIB) string -preprocessor(#define) ident(RUBY_SITE_ARCHLIB) string -comment(/************************************************ - - defines.h - - - $Author: shyouhei $ - $Date: 2008-06-15 16:06:16 +0200 (Sun, 15 Jun 2008\) $ - created at: Wed May 18 00:21:44 JST 1994 - -************************************************/) -preprocessor(#ifndef) ident(DEFINES_H) -preprocessor(#define) ident(DEFINES_H) - -preprocessor(#define) ident(RUBY) - -preprocessor(#ifdef) ident(__cplusplus) -preprocessor(# ifndef) ident(HAVE_PROTOTYPES) -preprocessor(# define) ident(HAVE_PROTOTYPES) integer(1) -preprocessor(# endif) -preprocessor(# ifndef) ident(HAVE_STDARG_PROTOTYPES) -preprocessor(# define) ident(HAVE_STDARG_PROTOTYPES) integer(1) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#undef) ident(_) -preprocessor(#ifdef) ident(HAVE_PROTOTYPES) -preprocessor(# define) ident(_)operator(()ident(args)operator(\)) ident(args) -preprocessor(#else) -preprocessor(# define) ident(_)operator(()ident(args)operator(\)) operator((\)) -preprocessor(#endif) - -preprocessor(#undef) ident(__) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -preprocessor(# define) ident(__)operator(()ident(args)operator(\)) ident(args) -preprocessor(#else) -preprocessor(# define) ident(__)operator(()ident(args)operator(\)) operator((\)) -preprocessor(#endif) - -preprocessor(#ifdef) ident(__cplusplus) -preprocessor(#define) ident(ANYARGS) operator(.)operator(.)operator(.) -preprocessor(#else) -preprocessor(#define) ident(ANYARGS) -preprocessor(#endif) - -preprocessor(#define) ident(xmalloc) ident(ruby_xmalloc) -preprocessor(#define) ident(xcalloc) ident(ruby_xcalloc) -preprocessor(#define) ident(xrealloc) ident(ruby_xrealloc) -preprocessor(#define) ident(xfree) ident(ruby_xfree) - -directive(void) operator(*)ident(xmalloc) ident(_)operator((()pre_type(long)operator(\)\);) -directive(void) operator(*)ident(xcalloc) ident(_)operator((()pre_type(long)operator(,)pre_type(long)operator(\)\);) -directive(void) operator(*)ident(xrealloc) ident(_)operator((()directive(void)operator(*,)pre_type(long)operator(\)\);) -directive(void) ident(xfree) ident(_)operator((()directive(void)operator(*\)\);) - -preprocessor(#if) ident(SIZEOF_LONG_LONG) operator(>) integer(0) -preprocessor(# define) ident(LONG_LONG) pre_type(long) pre_type(long) -preprocessor(#elif) ident(SIZEOF___INT64) operator(>) integer(0) -preprocessor(# define) ident(HAVE_LONG_LONG) integer(1) -preprocessor(# define) ident(LONG_LONG) ident(__int64) -preprocessor(# undef) ident(SIZEOF_LONG_LONG) -preprocessor(# define) ident(SIZEOF_LONG_LONG) ident(SIZEOF___INT64) -preprocessor(#endif) - -preprocessor(#if) ident(SIZEOF_INT)operator(*)integer(2) operator(<=) ident(SIZEOF_LONG_LONG) -preprocessor(# define) ident(BDIGIT) pre_type(unsigned) pre_type(int) -preprocessor(# define) ident(SIZEOF_BDIGITS) ident(SIZEOF_INT) -preprocessor(# define) ident(BDIGIT_DBL) pre_type(unsigned) ident(LONG_LONG) -preprocessor(# define) ident(BDIGIT_DBL_SIGNED) ident(LONG_LONG) -preprocessor(#elif) ident(SIZEOF_INT)operator(*)integer(2) operator(<=) ident(SIZEOF_LONG) -preprocessor(# define) ident(BDIGIT) pre_type(unsigned) pre_type(int) -preprocessor(# define) ident(SIZEOF_BDIGITS) ident(SIZEOF_INT) -preprocessor(# define) ident(BDIGIT_DBL) pre_type(unsigned) pre_type(long) -preprocessor(# define) ident(BDIGIT_DBL_SIGNED) pre_type(long) -preprocessor(#elif) ident(SIZEOF_SHORT)operator(*)integer(2) operator(<=) ident(SIZEOF_LONG) -preprocessor(# define) ident(BDIGIT) pre_type(unsigned) pre_type(short) -preprocessor(# define) ident(SIZEOF_BDIGITS) ident(SIZEOF_SHORT) -preprocessor(# define) ident(BDIGIT_DBL) pre_type(unsigned) pre_type(long) -preprocessor(# define) ident(BDIGIT_DBL_SIGNED) pre_type(long) -preprocessor(#else) -preprocessor(# define) ident(BDIGIT) pre_type(unsigned) pre_type(short) -preprocessor(# define) ident(SIZEOF_BDIGITS) operator(()ident(SIZEOF_LONG)operator(/)integer(2)operator(\)) -preprocessor(# define) ident(BDIGIT_DBL) pre_type(unsigned) pre_type(long) -preprocessor(# define) ident(BDIGIT_DBL_SIGNED) pre_type(long) -preprocessor(#endif) - -preprocessor(#ifdef) ident(__CYGWIN__) -preprocessor(#undef) ident(_WIN32) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(MSDOS)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) operator(||) ident(defined)operator(()ident(__human68k__)operator(\)) operator(||) ident(defined)operator(()ident(__EMX__)operator(\)) -preprocessor(#define) ident(DOSISH) integer(1) -preprocessor(#ifndef) ident(_WIN32_WCE) -preprocessor(# define) ident(DOSISH_DRIVE_LETTER) -preprocessor(#endif) -preprocessor(#endif) - -comment(/* define RUBY_USE_EUC/SJIS for default kanji-code */) -preprocessor(#ifndef) ident(DEFAULT_KCODE) -preprocessor(#if) ident(defined)operator(()ident(DOSISH)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN__)operator(\)) operator(||) ident(defined)operator(()ident(__MACOS__)operator(\)) operator(||) ident(defined)operator(()ident(OS2)operator(\)) -preprocessor(#define) ident(DEFAULT_KCODE) ident(KCODE_SJIS) -preprocessor(#else) -preprocessor(#define) ident(DEFAULT_KCODE) ident(KCODE_EUC) -preprocessor(#endif) -preprocessor(#endif) - -preprocessor(#ifdef) ident(__NeXT__) -comment(/* NextStep, OpenStep, Rhapsody */) -preprocessor(#ifndef) ident(S_IRUSR) -preprocessor(#define) ident(S_IRUSR) oct(0000400) comment(/* read permission, owner */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_IRGRP) -preprocessor(#define) ident(S_IRGRP) oct(0000040) comment(/* read permission, group */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_IROTH) -preprocessor(#define) ident(S_IROTH) oct(0000004) comment(/* read permission, other */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_IWUSR) -preprocessor(#define) ident(S_IWUSR) oct(0000200) comment(/* write permission, owner */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_IWGRP) -preprocessor(#define) ident(S_IWGRP) oct(0000020) comment(/* write permission, group */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_IWOTH) -preprocessor(#define) ident(S_IWOTH) oct(0000002) comment(/* write permission, other */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_IXUSR) -preprocessor(#define) ident(S_IXUSR) oct(0000100) comment(/* execute/search permission, owner */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_IXGRP) -preprocessor(#define) ident(S_IXGRP) oct(0000010) comment(/* execute/search permission, group */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_IXOTH) -preprocessor(#define) ident(S_IXOTH) oct(0000001) comment(/* execute/search permission, other */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_IRWXU) -preprocessor(#define) ident(S_IRWXU) oct(0000700) comment(/* read, write, execute permissions, owner */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_IRWXG) -preprocessor(#define) ident(S_IRWXG) oct(0000070) comment(/* read, write, execute permissions, group */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_IRWXO) -preprocessor(#define) ident(S_IRWXO) oct(0000007) comment(/* read, write, execute permissions, other */) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_ISBLK) -preprocessor(#define) ident(S_ISBLK)operator(()ident(mode)operator(\)) operator(((()ident(mode)operator(\)) operator(&) operator(()oct(0170000)operator(\)\)) operator(==) operator(()oct(0060000)operator(\)\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_ISCHR) -preprocessor(#define) ident(S_ISCHR)operator(()ident(mode)operator(\)) operator(((()ident(mode)operator(\)) operator(&) operator(()oct(0170000)operator(\)\)) operator(==) operator(()oct(0020000)operator(\)\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_ISDIR) -preprocessor(#define) ident(S_ISDIR)operator(()ident(mode)operator(\)) operator(((()ident(mode)operator(\)) operator(&) operator(()oct(0170000)operator(\)\)) operator(==) operator(()oct(0040000)operator(\)\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_ISFIFO) -preprocessor(#define) ident(S_ISFIFO)operator(()ident(mode)operator(\)) operator(((()ident(mode)operator(\)) operator(&) operator(()oct(0170000)operator(\)\)) operator(==) operator(()oct(0010000)operator(\)\)) -preprocessor(#endif) -preprocessor(#ifndef) ident(S_ISREG) -preprocessor(#define) ident(S_ISREG)operator(()ident(mode)operator(\)) operator(((()ident(mode)operator(\)) operator(&) operator(()oct(0170000)operator(\)\)) operator(==) operator(()oct(0100000)operator(\)\)) -preprocessor(#endif) -comment(/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may - result in a different endian. Instead trust __BIG_ENDIAN__ and - __LITTLE_ENDIAN__ which are set correctly by -arch. */) -preprocessor(#undef) ident(WORDS_BIGENDIAN) -preprocessor(#ifdef) ident(__BIG_ENDIAN__) -preprocessor(#define) ident(WORDS_BIGENDIAN) -preprocessor(#endif) -preprocessor(#ifndef) ident(__APPLE__) -comment(/* NextStep, OpenStep (but not Rhapsody\) */) -preprocessor(#ifndef) ident(GETPGRP_VOID) -preprocessor(#define) ident(GETPGRP_VOID) integer(1) -preprocessor(#endif) -preprocessor(#ifndef) ident(WNOHANG) -preprocessor(#define) ident(WNOHANG) oct(01) -preprocessor(#endif) -preprocessor(#ifndef) ident(WUNTRACED) -preprocessor(#define) ident(WUNTRACED) oct(02) -preprocessor(#endif) -preprocessor(#ifndef) ident(X_OK) -preprocessor(#define) ident(X_OK) integer(1) -preprocessor(#endif) -preprocessor(#endif) comment(/* __APPLE__ */) -preprocessor(#endif) comment(/* NeXT */) - -preprocessor(#ifdef) ident(_WIN32) -preprocessor(#include) include("win32/win32.h") -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__VMS)operator(\)) -preprocessor(#include) include("vms.h") -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__BEOS__)operator(\)) -preprocessor(#include) include() comment(/* intern.h needs fd_set definition */) -preprocessor(#endif) - -preprocessor(#ifdef) ident(RUBY_EXPORT) -preprocessor(#undef) ident(RUBY_EXTERN) -preprocessor(#endif) - -preprocessor(#ifndef) ident(RUBY_EXTERN) -preprocessor(#define) ident(RUBY_EXTERN) directive(extern) -preprocessor(#endif) - -preprocessor(#ifndef) ident(EXTERN) -preprocessor(#define) ident(EXTERN) ident(RUBY_EXTERN) comment(/* deprecated */) -preprocessor(#endif) - -preprocessor(#ifndef) ident(RUBY_MBCHAR_MAXSIZE) -preprocessor(#define) ident(RUBY_MBCHAR_MAXSIZE) ident(INT_MAX) - comment(/* MB_CUR_MAX will not work well in C locale */) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(sparc)operator(\)) operator(||) ident(defined)operator(()ident(__sparc__)operator(\)) -directive(static) directive(inline) directive(void) -ident(flush_register_windows)operator(()directive(void)operator(\)) -operator({) - reserved(asm) -preprocessor(#ifdef) ident(__GNUC__) - directive(volatile) -preprocessor(#endif) -preprocessor(# if) ident(defined)operator(()ident(__sparc_v9__)operator(\)) operator(||) ident(defined)operator(()ident(__sparcv9)operator(\)) operator(||) ident(defined)operator(()ident(__arch64__)operator(\)) - operator(()stringoperator(\)) -preprocessor(# else) - operator(()stringoperator(\)) -preprocessor(# endif) comment(/* trap always to flush register windows if we are on a Sparc system */) - operator(;) -operator(}) -preprocessor(# define) ident(FLUSH_REGISTER_WINDOWS) ident(flush_register_windows)operator((\)) -preprocessor(#elif) ident(defined)operator(()ident(__ia64)operator(\)) -directive(void) operator(*)ident(rb_ia64_bsp)operator(()directive(void)operator(\);) -directive(void) ident(rb_ia64_flushrs)operator(()directive(void)operator(\);) -preprocessor(# define) ident(FLUSH_REGISTER_WINDOWS) ident(rb_ia64_flushrs)operator((\)) -preprocessor(#else) -preprocessor(# define) ident(FLUSH_REGISTER_WINDOWS) operator((()directive(void)operator(\))integer(0)operator(\)) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(DOSISH)operator(\)) -preprocessor(#define) ident(PATH_SEP) string -preprocessor(#elif) ident(defined)operator(()ident(riscos)operator(\)) -preprocessor(#define) ident(PATH_SEP) string -preprocessor(#else) -preprocessor(#define) ident(PATH_SEP) string -preprocessor(#endif) -preprocessor(#define) ident(PATH_SEP_CHAR) ident(PATH_SEP)operator([)integer(0)operator(]) - -preprocessor(#if) ident(defined)operator(()ident(__human68k__)operator(\)) -preprocessor(#define) ident(PATH_ENV) string -preprocessor(#else) -preprocessor(#define) ident(PATH_ENV) string -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(DOSISH)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__human68k__)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__EMX__)operator(\)) -preprocessor(#define) ident(ENV_IGNORECASE) -preprocessor(#endif) - -preprocessor(#ifndef) ident(CASEFOLD_FILESYSTEM) -preprocessor(# if) ident(defined) ident(DOSISH) operator(||) ident(defined) ident(__VMS) -preprocessor(# define) ident(CASEFOLD_FILESYSTEM) integer(1) -preprocessor(# else) -preprocessor(# define) ident(CASEFOLD_FILESYSTEM) integer(0) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#ifndef) ident(DLEXT_MAXLEN) -preprocessor(#define) ident(DLEXT_MAXLEN) integer(4) -preprocessor(#endif) - -preprocessor(#ifndef) ident(RUBY_PLATFORM) -preprocessor(#define) ident(RUBY_PLATFORM) string -preprocessor(#endif) - -preprocessor(#endif) -comment(/********************************************************************** - - dln.h - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007\) $ - created at: Wed Jan 19 16:53:09 JST 1994 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#ifndef) ident(DLN_H) -preprocessor(#define) ident(DLN_H) - -preprocessor(#ifdef) ident(__cplusplus) -preprocessor(# ifndef) ident(HAVE_PROTOTYPES) -preprocessor(# define) ident(HAVE_PROTOTYPES) integer(1) -preprocessor(# endif) -preprocessor(# ifndef) ident(HAVE_STDARG_PROTOTYPES) -preprocessor(# define) ident(HAVE_STDARG_PROTOTYPES) integer(1) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#undef) ident(_) -preprocessor(#ifdef) ident(HAVE_PROTOTYPES) -preprocessor(# define) ident(_)operator(()ident(args)operator(\)) ident(args) -preprocessor(#else) -preprocessor(# define) ident(_)operator(()ident(args)operator(\)) operator((\)) -preprocessor(#endif) - -pre_type(char) operator(*)ident(dln_find_exe) ident(_)operator((()directive(const) pre_type(char)operator(*,)directive(const) pre_type(char)operator(*\)\);) -pre_type(char) operator(*)ident(dln_find_file) ident(_)operator((()directive(const) pre_type(char)operator(*,)directive(const) pre_type(char)operator(*\)\);) - -preprocessor(#ifdef) ident(USE_DLN_A_OUT) -directive(extern) pre_type(char) operator(*)ident(dln_argv0)operator(;) -preprocessor(#endif) - -directive(void) operator(*)ident(dln_load) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -preprocessor(#endif) -comment(/********************************************************************** - - env.h - - - $Author: knu $ - $Date: 2007-03-03 08:30:46 +0100 (Sat, 03 Mar 2007\) $ - created at: Mon Jul 11 11:53:03 JST 1994 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#ifndef) ident(ENV_H) -preprocessor(#define) ident(ENV_H) - -directive(extern) reserved(struct) ident(FRAME) operator({) - ident(VALUE) ident(self)operator(;) - pre_type(int) ident(argc)operator(;) - ident(ID) ident(last_func)operator(;) - ident(ID) ident(orig_func)operator(;) - ident(VALUE) ident(last_class)operator(;) - reserved(struct) ident(FRAME) operator(*)ident(prev)operator(;) - reserved(struct) ident(FRAME) operator(*)ident(tmp)operator(;) - reserved(struct) ident(RNode) operator(*)ident(node)operator(;) - pre_type(int) ident(iter)operator(;) - pre_type(int) ident(flags)operator(;) - pre_type(unsigned) pre_type(long) ident(uniq)operator(;) -operator(}) operator(*)ident(ruby_frame)operator(;) - -directive(void) ident(rb_gc_mark_frame) ident(_)operator((()reserved(struct) ident(FRAME) operator(*\)\);) - -preprocessor(#define) ident(FRAME_DMETH) integer(1) -preprocessor(#define) ident(FRAME_FUNC) integer(2) - -directive(extern) reserved(struct) ident(SCOPE) operator({) - reserved(struct) ident(RBasic) ident(super)operator(;) - ident(ID) operator(*)ident(local_tbl)operator(;) - ident(VALUE) operator(*)ident(local_vars)operator(;) - pre_type(int) ident(flags)operator(;) -operator(}) operator(*)ident(ruby_scope)operator(;) - -preprocessor(#define) ident(SCOPE_ALLOCA) integer(0) -preprocessor(#define) ident(SCOPE_MALLOC) integer(1) -preprocessor(#define) ident(SCOPE_NOSTACK) integer(2) -preprocessor(#define) ident(SCOPE_DONT_RECYCLE) integer(4) -preprocessor(#define) ident(SCOPE_CLONE) integer(8) - -directive(extern) pre_type(int) ident(ruby_in_eval)operator(;) - -directive(extern) ident(VALUE) ident(ruby_class)operator(;) - -reserved(struct) ident(RVarmap) operator({) - reserved(struct) ident(RBasic) ident(super)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(val)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(next)operator(;) -operator(};) -directive(extern) reserved(struct) ident(RVarmap) operator(*)ident(ruby_dyna_vars)operator(;) - -preprocessor(#endif) comment(/* ENV_H */) -comment(/********************************************************************** - - intern.h - - - $Author: shyouhei $ - $Date: 2009-01-22 07:18:48 +0100 (Thu, 22 Jan 2009\) $ - created at: Thu Jun 10 14:22:17 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -comment(/* - * Functions and variables that are used by more than one source file of - * the kernel. - */) - -preprocessor(#define) ident(ID_ALLOCATOR) integer(1) - -comment(/* array.c */) -directive(void) ident(rb_mem_clear) ident(_)operator((()directive(register) ident(VALUE)operator(*,) directive(register) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_assoc_new) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_check_array_type) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_new) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_ary_new2) ident(_)operator((()pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_ary_new3) ident(__)operator((()pre_type(long)operator(,)operator(.)operator(.)operator(.)operator(\)\);) -ident(VALUE) ident(rb_ary_new4) ident(_)operator((()pre_type(long)operator(,) directive(const) ident(VALUE) operator(*\)\);) -ident(VALUE) ident(rb_ary_freeze) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_aref) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -directive(void) ident(rb_ary_store) ident(_)operator((()ident(VALUE)operator(,) pre_type(long)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_dup) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_to_ary) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_to_s) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_push) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_pop) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_shift) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_unshift) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_entry) ident(_)operator((()ident(VALUE)operator(,) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_ary_each) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_join) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_print_on) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_reverse) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_sort) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_sort_bang) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_delete) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_delete_at) ident(_)operator((()ident(VALUE)operator(,) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_ary_clear) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_plus) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_concat) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_assoc) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_rassoc) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_includes) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ary_cmp) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_protect_inspect) ident(_)operator((()ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)ident(VALUE)operator(,)ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_inspecting_p) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_check_array_value) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_values_at) ident(_)operator((()ident(VALUE)operator(,) pre_type(long)operator(,) pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator((*\)) ident(_)operator((()ident(VALUE)operator(,)pre_type(long)operator(\)\)\)\);) -comment(/* bignum.c */) -ident(VALUE) ident(rb_big_clone) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_big_2comp) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_norm) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_uint2big) ident(_)operator((()pre_type(unsigned) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_int2big) ident(_)operator((()pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_uint2inum) ident(_)operator((()pre_type(unsigned) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_int2inum) ident(_)operator((()pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_cstr_to_inum) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(int)operator(,) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_str_to_inum) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(,) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_cstr2inum) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_str2inum) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_big2str) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_big2str0) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(,) pre_type(int)operator(\)\);) -pre_type(long) ident(rb_big2long) ident(_)operator((()ident(VALUE)operator(\)\);) -preprocessor(#define) ident(rb_big2int)operator(()ident(x)operator(\)) ident(rb_big2long)operator(()ident(x)operator(\)) -pre_type(unsigned) pre_type(long) ident(rb_big2ulong) ident(_)operator((()ident(VALUE)operator(\)\);) -preprocessor(#define) ident(rb_big2uint)operator(()ident(x)operator(\)) ident(rb_big2ulong)operator(()ident(x)operator(\)) -preprocessor(#if) ident(HAVE_LONG_LONG) -ident(VALUE) ident(rb_ll2inum) ident(_)operator((()ident(LONG_LONG)operator(\)\);) -ident(VALUE) ident(rb_ull2inum) ident(_)operator((()pre_type(unsigned) ident(LONG_LONG)operator(\)\);) -ident(LONG_LONG) ident(rb_big2ll) ident(_)operator((()ident(VALUE)operator(\)\);) -pre_type(unsigned) ident(LONG_LONG) ident(rb_big2ull) ident(_)operator((()ident(VALUE)operator(\)\);) -preprocessor(#endif) comment(/* HAVE_LONG_LONG */) -directive(void) ident(rb_quad_pack) ident(_)operator((()pre_type(char)operator(*,)ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_quad_unpack) ident(_)operator((()directive(const) pre_type(char)operator(*,)pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_dbl2big) ident(_)operator((()pre_type(double)operator(\)\);) -pre_type(double) ident(rb_big2dbl) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_plus) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_minus) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_mul) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_divmod) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_pow) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_and) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_or) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_xor) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_lshift) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_rand) ident(_)operator((()ident(VALUE)operator(,) pre_type(double)operator(*\)\);) -comment(/* class.c */) -ident(VALUE) ident(rb_class_boot) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_class_new) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_mod_init_copy) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_class_init_copy) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_singleton_class_clone) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_singleton_class_attached) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_make_metaclass) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -directive(void) ident(rb_check_inheritable) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_class_inherited) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_define_class_id) ident(_)operator((()ident(ID)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_module_new) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_define_module_id) ident(_)operator((()ident(ID)operator(\)\);) -ident(VALUE) ident(rb_mod_included_modules) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_mod_include_p) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_mod_ancestors) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_class_instance_methods) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_class_public_instance_methods) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_class_protected_instance_methods) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_big_rshift)operator(()ident(VALUE)operator(,) ident(VALUE)operator(\);) -ident(VALUE) ident(rb_class_private_instance_methods) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_singleton_methods) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -directive(void) ident(rb_define_method_id) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) ident(VALUE) operator((*\)()ident(ANYARGS)operator(\),) pre_type(int)operator(\)\);) -directive(void) ident(rb_frozen_class_p) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_undef) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -directive(void) ident(rb_define_protected_method) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) ident(VALUE) operator((*\)()ident(ANYARGS)operator(\),) pre_type(int)operator(\)\);) -directive(void) ident(rb_define_private_method) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) ident(VALUE) operator((*\)()ident(ANYARGS)operator(\),) pre_type(int)operator(\)\);) -directive(void) ident(rb_define_singleton_method) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_singleton_class) ident(_)operator((()ident(VALUE)operator(\)\);) -comment(/* compar.c */) -pre_type(int) ident(rb_cmpint) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_cmperr) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\)\);) -comment(/* enum.c */) -comment(/* error.c */) -ident(RUBY_EXTERN) pre_type(int) ident(ruby_nerrs)operator(;) -ident(VALUE) ident(rb_exc_new) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_exc_new2) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_exc_new3) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_loaderror) ident(__)operator((()directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_name_error) ident(__)operator((()ident(ID)operator(,) directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_invalid_str) ident(_)operator((()directive(const) pre_type(char)operator(*,) directive(const) pre_type(char)operator(*\)\)\);) -directive(void) ident(rb_compile_error) ident(__)operator((()directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\);) -directive(void) ident(rb_compile_error_append) ident(__)operator((()directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_load_fail) ident(_)operator((()directive(const) pre_type(char)operator(*\)\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_error_frozen) ident(_)operator((()directive(const) pre_type(char)operator(*\)\)\);) -directive(void) ident(rb_check_frozen) ident(_)operator((()ident(VALUE)operator(\)\);) -comment(/* eval.c */) -ident(RUBY_EXTERN) reserved(struct) ident(RNode) operator(*)ident(ruby_current_node)operator(;) -directive(void) ident(ruby_set_current_source) ident(_)operator((()directive(void)operator(\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_exc_raise) ident(_)operator((()ident(VALUE)operator(\)\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_exc_fatal) ident(_)operator((()ident(VALUE)operator(\)\)\);) -ident(VALUE) ident(rb_f_exit) ident(_)operator((()pre_type(int)operator(,)ident(VALUE)operator(*\)\);) -ident(VALUE) ident(rb_f_abort) ident(_)operator((()pre_type(int)operator(,)ident(VALUE)operator(*\)\);) -directive(void) ident(rb_remove_method) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*\)\);) -preprocessor(#define) ident(rb_disable_super)operator(()ident(klass)operator(,) ident(name)operator(\)) operator((()directive(void)operator(\))integer(0)operator(\)) -preprocessor(#define) ident(rb_enable_super)operator(()ident(klass)operator(,) ident(name)operator(\)) operator((()directive(void)operator(\))integer(0)operator(\)) -preprocessor(#define) ident(HAVE_RB_DEFINE_ALLOC_FUNC) integer(1) -directive(void) ident(rb_define_alloc_func) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE) operator((*\)()ident(VALUE)operator(\)\)\);) -directive(void) ident(rb_undef_alloc_func) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_clear_cache) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_clear_cache_by_class) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_alias) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) ident(ID)operator(\)\);) -directive(void) ident(rb_attr) ident(_)operator((()ident(VALUE)operator(,)ident(ID)operator(,)pre_type(int)operator(,)pre_type(int)operator(,)pre_type(int)operator(\)\);) -pre_type(int) ident(rb_method_boundp) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_dvar_defined) ident(_)operator((()ident(ID)operator(\)\);) -ident(VALUE) ident(rb_dvar_curr) ident(_)operator((()ident(ID)operator(\)\);) -ident(VALUE) ident(rb_dvar_ref) ident(_)operator((()ident(ID)operator(\)\);) -directive(void) ident(rb_dvar_asgn) ident(_)operator((()ident(ID)operator(,) ident(VALUE)operator(\)\);) -directive(void) ident(rb_dvar_push) ident(_)operator((()ident(ID)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) operator(*)ident(rb_svar) ident(_)operator((()pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_eval_cmd) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(,) pre_type(int)operator(\)\);) -pre_type(int) ident(rb_obj_respond_to) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) pre_type(int)operator(\)\);) -pre_type(int) ident(rb_respond_to) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -directive(void) ident(rb_interrupt) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_apply) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) ident(VALUE)operator(\)\);) -directive(void) ident(rb_backtrace) ident(_)operator((()directive(void)operator(\)\);) -ident(ID) ident(rb_frame_last_func) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_obj_instance_eval) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_mod_module_eval) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -directive(void) ident(rb_load) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(\)\);) -directive(void) ident(rb_load_protect) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(,) pre_type(int)operator(*\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_jump_tag) ident(_)operator((()pre_type(int)operator(\)\)\);) -pre_type(int) ident(rb_provided) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -directive(void) ident(rb_provide) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_f_require) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_require_safe) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(\)\);) -directive(void) ident(rb_obj_call_init) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(,) ident(VALUE)operator(*\)\);) -ident(VALUE) ident(rb_class_new_instance) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_block_proc) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_f_lambda) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_proc_new) ident(_)operator((()ident(VALUE) operator((*\)()ident(ANYARGS)comment(/* VALUE yieldarg[, VALUE procarg] */)operator(\),) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_protect) ident(_)operator((()ident(VALUE) operator((*\)()ident(VALUE)operator(\),) ident(VALUE)operator(,) pre_type(int)operator(*\)\);) -directive(void) ident(rb_set_end_proc) ident(_)operator((()directive(void) operator((*\)()ident(VALUE)operator(\),) ident(VALUE)operator(\)\);) -directive(void) ident(rb_mark_end_proc) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_exec_end_proc) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(ruby_finalize) ident(_)operator((()directive(void)operator(\)\);) -ident(NORETURN)operator(()directive(void) ident(ruby_stop) ident(_)operator((()pre_type(int)operator(\)\)\);) -pre_type(int) ident(ruby_cleanup) ident(_)operator((()pre_type(int)operator(\)\);) -pre_type(int) ident(ruby_exec) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_gc_mark_threads) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_thread_start_timer) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_thread_stop_timer) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_thread_schedule) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_thread_wait_fd) ident(_)operator((()pre_type(int)operator(\)\);) -pre_type(int) ident(rb_thread_fd_writable) ident(_)operator((()pre_type(int)operator(\)\);) -directive(void) ident(rb_thread_fd_close) ident(_)operator((()pre_type(int)operator(\)\);) -pre_type(int) ident(rb_thread_alone) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_thread_polling) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_thread_sleep) ident(_)operator((()pre_type(int)operator(\)\);) -directive(void) ident(rb_thread_sleep_forever) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_thread_stop) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_thread_wakeup) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_thread_wakeup_alive) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_thread_run) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_thread_kill) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_thread_alive_p) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_thread_create) ident(_)operator((()ident(VALUE) operator((*\)()ident(ANYARGS)operator(\),) directive(void)operator(*\)\);) -directive(void) ident(rb_thread_interrupt) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_thread_trap_eval) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(,) pre_type(int)operator(\)\);) -directive(void) ident(rb_thread_signal_raise) ident(_)operator((()pre_type(int)operator(\)\);) -directive(void) ident(rb_thread_signal_exit) ident(_)operator((()directive(void)operator(\)\);) -pre_type(int) ident(rb_thread_select) ident(_)operator((()pre_type(int)operator(,) ident(fd_set) operator(*,) ident(fd_set) operator(*,) ident(fd_set) operator(*,) reserved(struct) ident(timeval) operator(*\)\);) -directive(void) ident(rb_thread_wait_for) ident(_)operator((()reserved(struct) ident(timeval)operator(\)\);) -ident(VALUE) ident(rb_thread_current) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_thread_main) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_thread_local_aref) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -ident(VALUE) ident(rb_thread_local_aset) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) ident(VALUE)operator(\)\);) -directive(void) ident(rb_thread_atfork) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_funcall_rescue) ident(__)operator((()ident(VALUE)operator(,) ident(ID)operator(,) pre_type(int)operator(,) operator(.)operator(.)operator(.)operator(\)\);) -comment(/* file.c */) -ident(VALUE) ident(rb_file_s_expand_path) ident(_)operator((()pre_type(int)operator(,) ident(VALUE) operator(*\)\);) -ident(VALUE) ident(rb_file_expand_path) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -directive(void) ident(rb_file_const) ident(_)operator((()directive(const) pre_type(char)operator(*,) ident(VALUE)operator(\)\);) -pre_type(int) ident(rb_find_file_ext) ident(_)operator((()ident(VALUE)operator(*,) directive(const) pre_type(char)operator(*) directive(const)operator(*\)\);) -ident(VALUE) ident(rb_find_file) ident(_)operator((()ident(VALUE)operator(\)\);) -pre_type(char) operator(*)ident(rb_path_next) ident(_)operator((()directive(const) pre_type(char) operator(*\)\);) -pre_type(char) operator(*)ident(rb_path_skip_prefix) ident(_)operator((()directive(const) pre_type(char) operator(*\)\);) -pre_type(char) operator(*)ident(rb_path_last_separator) ident(_)operator((()directive(const) pre_type(char) operator(*\)\);) -pre_type(char) operator(*)ident(rb_path_end) ident(_)operator((()directive(const) pre_type(char) operator(*\)\);) -ident(VALUE) ident(rb_file_directory_p) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) -comment(/* gc.c */) -ident(NORETURN)operator(()directive(void) ident(rb_memerror) ident(__)operator((()directive(void)operator(\)\)\);) -pre_type(int) ident(ruby_stack_check) ident(_)operator((()directive(void)operator(\)\);) -ident(size_t) ident(ruby_stack_length) ident(_)operator((()ident(VALUE)operator(**\)\);) -pre_type(int) ident(rb_during_gc) ident(_)operator((()directive(void)operator(\)\);) -pre_type(char) operator(*)ident(rb_source_filename) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -directive(void) ident(rb_gc_mark_locations) ident(_)operator((()ident(VALUE)operator(*,) ident(VALUE)operator(*\)\);) -directive(void) ident(rb_mark_tbl) ident(_)operator((()reserved(struct) ident(st_table)operator(*\)\);) -directive(void) ident(rb_mark_set) ident(_)operator((()reserved(struct) ident(st_table)operator(*\)\);) -directive(void) ident(rb_mark_hash) ident(_)operator((()reserved(struct) ident(st_table)operator(*\)\);) -directive(void) ident(rb_gc_mark_maybe) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_gc_mark) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_gc_force_recycle) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_gc) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_gc_copy_finalizer) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) -directive(void) ident(rb_gc_finalize_deferred) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_gc_call_finalizer_at_exit) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_gc_enable) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_gc_disable) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_gc_start) ident(_)operator((()directive(void)operator(\)\);) -comment(/* hash.c */) -directive(void) ident(st_foreach_safe) ident(_)operator((()reserved(struct) ident(st_table) operator(*,) pre_type(int) operator((*\)()ident(ANYARGS)operator(\),) pre_type(unsigned) pre_type(long)operator(\)\);) -directive(void) ident(rb_hash_foreach) ident(_)operator((()ident(VALUE)operator(,) pre_type(int) operator((*\)()ident(ANYARGS)operator(\),) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_hash) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_hash_new) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_hash_freeze) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_hash_aref) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_hash_aset) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_hash_delete_if) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_hash_delete) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) -pre_type(int) ident(rb_path_check) ident(_)operator((()pre_type(char)operator(*\)\);) -pre_type(int) ident(rb_env_path_tainted) ident(_)operator((()directive(void)operator(\)\);) -comment(/* io.c */) -preprocessor(#define) ident(rb_defout) ident(rb_stdout) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_fs)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_output_fs)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_rs)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_default_rs)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_output_rs)operator(;) -ident(VALUE) ident(rb_io_write) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_io_gets) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_io_getc) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_io_ungetc) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_io_close) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_io_eof) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_io_binmode) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_io_addstr) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_io_printf) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_io_print) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_io_puts) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_file_open) ident(_)operator((()directive(const) pre_type(char)operator(*,) directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_gets) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_write_error) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -directive(void) ident(rb_write_error2) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(long)operator(\)\);) -comment(/* marshal.c */) -ident(VALUE) ident(rb_marshal_dump) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_marshal_load) ident(_)operator((()ident(VALUE)operator(\)\);) -comment(/* numeric.c */) -directive(void) ident(rb_num_zerodiv) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_num_coerce_bin) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_num_coerce_cmp) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_num_coerce_relop) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_float_new) ident(_)operator((()pre_type(double)operator(\)\);) -ident(VALUE) ident(rb_num2fix) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_fix2str) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_dbl_cmp) ident(_)operator((()pre_type(double)operator(,) pre_type(double)operator(\)\);) -comment(/* object.c */) -pre_type(int) ident(rb_eql) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_any_to_s) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_inspect) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_is_instance_of) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_is_kind_of) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_alloc) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_clone) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_dup) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_init_copy) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_taint) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_tainted) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_untaint) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_freeze) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_id) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_class) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_class_real) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_class_inherited_p) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_convert_type) ident(_)operator((()ident(VALUE)operator(,)pre_type(int)operator(,)directive(const) pre_type(char)operator(*,)directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_check_convert_type) ident(_)operator((()ident(VALUE)operator(,)pre_type(int)operator(,)directive(const) pre_type(char)operator(*,)directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_to_int) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_Integer) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_Float) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_String) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_Array) ident(_)operator((()ident(VALUE)operator(\)\);) -pre_type(double) ident(rb_cstr_to_dbl) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(int)operator(\)\);) -pre_type(double) ident(rb_str_to_dbl) ident(_)operator((()ident(VALUE)operator(,) pre_type(int)operator(\)\);) -comment(/* parse.y */) -ident(RUBY_EXTERN) pre_type(int) ident(ruby_sourceline)operator(;) -ident(RUBY_EXTERN) pre_type(char) operator(*)ident(ruby_sourcefile)operator(;) -pre_type(int) ident(ruby_yyparse) ident(_)operator((()directive(void)operator(\)\);) -ident(ID) ident(rb_id_attrset) ident(_)operator((()ident(ID)operator(\)\);) -directive(void) ident(rb_parser_append_print) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_parser_while_loop) ident(_)operator((()pre_type(int)operator(,) pre_type(int)operator(\)\);) -pre_type(int) ident(ruby_parser_stack_on_heap) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_gc_mark_parser) ident(_)operator((()directive(void)operator(\)\);) -pre_type(int) ident(rb_is_const_id) ident(_)operator((()ident(ID)operator(\)\);) -pre_type(int) ident(rb_is_instance_id) ident(_)operator((()ident(ID)operator(\)\);) -pre_type(int) ident(rb_is_class_id) ident(_)operator((()ident(ID)operator(\)\);) -pre_type(int) ident(rb_is_local_id) ident(_)operator((()ident(ID)operator(\)\);) -pre_type(int) ident(rb_is_junk_id) ident(_)operator((()ident(ID)operator(\)\);) -pre_type(int) ident(rb_symname_p) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -pre_type(int) ident(rb_sym_interned_p) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_backref_get) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_backref_set) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_lastline_get) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_lastline_set) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_sym_all_symbols) ident(_)operator((()directive(void)operator(\)\);) -comment(/* process.c */) -pre_type(int) ident(rb_proc_exec) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_f_exec) ident(_)operator((()pre_type(int)operator(,)ident(VALUE)operator(*\)\);) -pre_type(int) ident(rb_waitpid) ident(_)operator((()pre_type(int)operator(,)pre_type(int)operator(*,)pre_type(int)operator(\)\);) -directive(void) ident(rb_syswait) ident(_)operator((()pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_proc_times) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_detach_process) ident(_)operator((()pre_type(int)operator(\)\);) -comment(/* range.c */) -ident(VALUE) ident(rb_range_new) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(,) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_range_beg_len) ident(_)operator((()ident(VALUE)operator(,) pre_type(long)operator(*,) pre_type(long)operator(*,) pre_type(long)operator(,) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_length_by_each) ident(_)operator((()ident(VALUE)operator(\)\);) -comment(/* re.c */) -pre_type(int) ident(rb_memcmp) ident(_)operator((()directive(const) directive(void)operator(*,)directive(const) directive(void)operator(*,)pre_type(long)operator(\)\);) -pre_type(int) ident(rb_memcicmp) ident(_)operator((()directive(const) directive(void)operator(*,)directive(const) directive(void)operator(*,)pre_type(long)operator(\)\);) -pre_type(long) ident(rb_memsearch) ident(_)operator((()directive(const) directive(void)operator(*,)pre_type(long)operator(,)directive(const) directive(void)operator(*,)pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_reg_nth_defined) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_reg_nth_match) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_reg_last_match) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_reg_match_pre) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_reg_match_post) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_reg_match_last) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_reg_new) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(long)operator(,) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_reg_match) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_reg_match2) ident(_)operator((()ident(VALUE)operator(\)\);) -pre_type(int) ident(rb_reg_options) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_set_kcode) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -directive(const) pre_type(char)operator(*) ident(rb_get_kcode) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_kcode_set_option) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_kcode_reset_option) ident(_)operator((()directive(void)operator(\)\);) -comment(/* ruby.c */) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_argv)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_argv0)operator(;) -directive(void) ident(rb_load_file) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -directive(void) ident(ruby_script) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -directive(void) ident(ruby_prog_init) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(ruby_set_argv) ident(_)operator((()pre_type(int)operator(,) pre_type(char)operator(**\)\);) -directive(void) ident(ruby_process_options) ident(_)operator((()pre_type(int)operator(,) pre_type(char)operator(**\)\);) -directive(void) ident(ruby_load_script) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(ruby_init_loadpath) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(ruby_incpush) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -comment(/* signal.c */) -ident(VALUE) ident(rb_f_kill) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*\)\);) -directive(void) ident(rb_gc_mark_trap_list) ident(_)operator((()directive(void)operator(\)\);) -preprocessor(#ifdef) ident(POSIX_SIGNAL) -preprocessor(#define) ident(posix_signal) ident(ruby_posix_signal) -directive(void) ident(posix_signal) ident(_)operator((()pre_type(int)operator(,) ident(RETSIGTYPE) operator((*\)()pre_type(int)operator(\)\)\);) -preprocessor(#endif) -directive(void) ident(rb_trap_exit) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_trap_exec) ident(_)operator((()directive(void)operator(\)\);) -directive(const) pre_type(char) operator(*)ident(ruby_signal_name) ident(_)operator((()pre_type(int)operator(\)\);) -directive(void) ident(ruby_default_signal) ident(_)operator((()pre_type(int)operator(\)\);) -comment(/* sprintf.c */) -ident(VALUE) ident(rb_f_sprintf) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*\)\);) -ident(VALUE) ident(rb_str_format) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*,) ident(VALUE)operator(\)\);) -comment(/* string.c */) -ident(VALUE) ident(rb_str_new) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_str_new2) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_str_new3) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_new4) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_new5) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_tainted_str_new) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_tainted_str_new2) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_str_buf_new) ident(_)operator((()pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_str_buf_new2) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_str_buf_append) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_buf_cat) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_str_buf_cat2) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_obj_as_string) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_check_string_type) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_dup) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_locktmp) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_unlocktmp) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_dup_frozen) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_plus) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_times) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_substr) ident(_)operator((()ident(VALUE)operator(,) pre_type(long)operator(,) pre_type(long)operator(\)\);) -directive(void) ident(rb_str_modify) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_freeze) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_resize) ident(_)operator((()ident(VALUE)operator(,) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_str_cat) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_str_cat2) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_str_append) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_concat) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -pre_type(int) ident(rb_str_hash) ident(_)operator((()ident(VALUE)operator(\)\);) -pre_type(int) ident(rb_str_cmp) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_upto) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(,) pre_type(int)operator(\)\);) -directive(void) ident(rb_str_update) ident(_)operator((()ident(VALUE)operator(,) pre_type(long)operator(,) pre_type(long)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_inspect) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_dump) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_split) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*\)\);) -directive(void) ident(rb_str_associate) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_str_associated) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_str_setter) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) ident(VALUE)operator(*\)\);) -ident(VALUE) ident(rb_str_intern) ident(_)operator((()ident(VALUE)operator(\)\);) -comment(/* struct.c */) -ident(VALUE) ident(rb_struct_new) ident(__)operator((()ident(VALUE)operator(,) operator(.)operator(.)operator(.)operator(\)\);) -ident(VALUE) ident(rb_struct_define) ident(__)operator((()directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\);) -ident(VALUE) ident(rb_struct_alloc) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_struct_aref) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_struct_aset) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_struct_getmember) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -ident(VALUE) ident(rb_struct_iv_get) ident(_)operator((()ident(VALUE)operator(,) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_struct_s_members) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_struct_members) ident(_)operator((()ident(VALUE)operator(\)\);) -comment(/* time.c */) -ident(VALUE) ident(rb_time_new) ident(_)operator((()ident(time_t)operator(,) ident(time_t)operator(\)\);) -comment(/* variable.c */) -ident(VALUE) ident(rb_mod_name) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_class_path) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_set_class_path) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(,) directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_path2class) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -directive(void) ident(rb_name_class) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -ident(VALUE) ident(rb_class_name) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_autoload) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_autoload_load) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -ident(VALUE) ident(rb_autoload_p) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -directive(void) ident(rb_gc_mark_global_tbl) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_f_trace_var) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*\)\);) -ident(VALUE) ident(rb_f_untrace_var) ident(_)operator((()pre_type(int)operator(,) ident(VALUE)operator(*\)\);) -ident(VALUE) ident(rb_f_global_variables) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_alias_variable) ident(_)operator((()ident(ID)operator(,) ident(ID)operator(\)\);) -reserved(struct) ident(st_table)operator(*) ident(rb_generic_ivar_table) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_copy_generic_ivar) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) -directive(void) ident(rb_mark_generic_ivar) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_mark_generic_ivar_tbl) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_free_generic_ivar) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ivar_get) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -ident(VALUE) ident(rb_ivar_set) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_ivar_defined) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -ident(VALUE) ident(rb_iv_set) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_iv_get) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_attr_get) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -ident(VALUE) ident(rb_obj_instance_variables) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_obj_remove_instance_variable) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -directive(void) operator(*)ident(rb_mod_const_at) ident(_)operator((()ident(VALUE)operator(,) directive(void)operator(*\)\);) -directive(void) operator(*)ident(rb_mod_const_of) ident(_)operator((()ident(VALUE)operator(,) directive(void)operator(*\)\);) -ident(VALUE) ident(rb_const_list) ident(_)operator((()directive(void)operator(*\)\);) -ident(VALUE) ident(rb_mod_constants) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_mod_remove_const) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -pre_type(int) ident(rb_const_defined) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -pre_type(int) ident(rb_const_defined_at) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -pre_type(int) ident(rb_const_defined_from) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -ident(VALUE) ident(rb_const_get) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -ident(VALUE) ident(rb_const_get_at) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -ident(VALUE) ident(rb_const_get_from) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -directive(void) ident(rb_const_set) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_mod_constants) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_mod_const_missing) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_cvar_defined) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -preprocessor(#define) ident(RB_CVAR_SET_4ARGS) integer(1) -directive(void) ident(rb_cvar_set) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) ident(VALUE)operator(,) pre_type(int)operator(\)\);) -ident(VALUE) ident(rb_cvar_get) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(\)\);) -directive(void) ident(rb_cv_set) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_cv_get) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*\)\);) -directive(void) ident(rb_define_class_variable) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_mod_class_variables) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_mod_remove_cvar) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(\)\);) -comment(/* version.c */) -directive(void) ident(ruby_show_version) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(ruby_show_copyright) ident(_)operator((()directive(void)operator(\)\);) -comment(/************************************************ - - missing.h - prototype for *.c in ./missing, and - for missing timeval struct - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007\) $ - created at: Sat May 11 23:46:03 JST 2002 - -************************************************/) - -preprocessor(#ifndef) ident(MISSING_H) -preprocessor(#define) ident(MISSING_H) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_SYS_TIME_H)operator(\)) -preprocessor(# include) include() -preprocessor(#elif) operator(!)ident(defined)operator(()ident(_WIN32)operator(\)) -preprocessor(# define) ident(time_t) pre_type(long) -reserved(struct) ident(timeval) operator({) - ident(time_t) ident(tv_sec)operator(;) comment(/* seconds */) - ident(time_t) ident(tv_usec)operator(;) comment(/* microseconds */) -operator(};) -preprocessor(#endif) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SYS_TYPES_H)operator(\)) -preprocessor(# include) include() -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_ACOSH) -directive(extern) pre_type(double) ident(acosh) ident(_)operator((()pre_type(double)operator(\)\);) -directive(extern) pre_type(double) ident(asinh) ident(_)operator((()pre_type(double)operator(\)\);) -directive(extern) pre_type(double) ident(atanh) ident(_)operator((()pre_type(double)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_CRYPT) -directive(extern) pre_type(char) operator(*)ident(crypt) ident(_)operator((()pre_type(char) operator(*,) pre_type(char) operator(*\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_DUP2) -directive(extern) pre_type(int) ident(dup2) ident(_)operator((()pre_type(int)operator(,) pre_type(int)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_EACCESS) -directive(extern) pre_type(int) ident(eaccess) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(int)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_FINITE) -directive(extern) pre_type(int) ident(finite) ident(_)operator((()pre_type(double)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_FLOCK) -directive(extern) pre_type(int) ident(flock) ident(_)operator((()pre_type(int)operator(,) pre_type(int)operator(\)\);) -preprocessor(#endif) - -comment(/* -#ifndef HAVE_FREXP -extern double frexp _((double, int *\)\); -#endif -*/) - -preprocessor(#ifndef) ident(HAVE_HYPOT) -directive(extern) pre_type(double) ident(hypot) ident(_)operator((()pre_type(double)operator(,) pre_type(double)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_ERF) -directive(extern) pre_type(double) ident(erf) ident(_)operator((()pre_type(double)operator(\)\);) -directive(extern) pre_type(double) ident(erfc) ident(_)operator((()pre_type(double)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_ISINF) -preprocessor(# if) ident(defined)operator(()ident(HAVE_FINITE)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_ISNAN)operator(\)) -preprocessor(# define) ident(isinf)operator(()ident(x)operator(\)) operator((!)ident(finite)operator(()ident(x)operator(\)) operator(&&) operator(!)ident(isnan)operator(()ident(x)operator(\)\)) -preprocessor(# else) -directive(extern) pre_type(int) ident(isinf) ident(_)operator((()pre_type(double)operator(\)\);) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_ISNAN) -directive(extern) pre_type(int) ident(isnan) ident(_)operator((()pre_type(double)operator(\)\);) -preprocessor(#endif) - -comment(/* -#ifndef HAVE_MEMCMP -extern int memcmp _((char *, char *, int\)\); -#endif -*/) - -preprocessor(#ifndef) ident(HAVE_MEMMOVE) -directive(extern) directive(void) operator(*)ident(memmove) ident(_)operator((()directive(void) operator(*,) directive(void) operator(*,) pre_type(int)operator(\)\);) -preprocessor(#endif) - -comment(/* -#ifndef HAVE_MODF -extern double modf _((double, double *\)\); -#endif -*/) - -preprocessor(#ifndef) ident(HAVE_STRCASECMP) -directive(extern) pre_type(int) ident(strcasecmp) ident(_)operator((()pre_type(char) operator(*,) pre_type(char) operator(*\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_STRNCASECMP) -directive(extern) pre_type(int) ident(strncasecmp) ident(_)operator((()pre_type(char) operator(*,) pre_type(char) operator(*,) pre_type(int)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_STRCHR) -directive(extern) pre_type(char) operator(*)ident(strchr) ident(_)operator((()pre_type(char) operator(*,) pre_type(int)operator(\)\);) -directive(extern) pre_type(char) operator(*)ident(strrchr) ident(_)operator((()pre_type(char) operator(*,) pre_type(int)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_STRERROR) -directive(extern) pre_type(char) operator(*)ident(strerror) ident(_)operator((()pre_type(int)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_STRFTIME) -directive(extern) ident(size_t) ident(strftime) ident(_)operator((()pre_type(char) operator(*,) ident(size_t)operator(,) directive(const) pre_type(char) operator(*,) directive(const) reserved(struct) ident(tm) operator(*\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_STRSTR) -directive(extern) pre_type(char) operator(*)ident(strstr) ident(_)operator((()pre_type(char) operator(*,) pre_type(char) operator(*\)\);) -preprocessor(#endif) - -comment(/* -#ifndef HAVE_STRTOL -extern long strtol _((char *, char **, int\)\); -#endif -*/) - -preprocessor(#ifndef) ident(HAVE_STRTOUL) -directive(extern) pre_type(unsigned) pre_type(long) ident(strtoul) ident(_)operator((()pre_type(char) operator(*,) pre_type(char) operator(**,) pre_type(int)operator(\)\);) -preprocessor(#endif) - -preprocessor(#ifndef) ident(HAVE_VSNPRINTF) -preprocessor(# ifdef) ident(HAVE_STDARG_PROTOTYPES) -preprocessor(# include) include() -preprocessor(# else) -preprocessor(# include) include() -preprocessor(# endif) -directive(extern) pre_type(int) ident(snprintf) ident(__)operator((()pre_type(char) operator(*,) ident(size_t) ident(n)operator(,) pre_type(char) directive(const) operator(*,) operator(.)operator(.)operator(.)operator(\)\);) -directive(extern) pre_type(int) ident(vsnprintf) ident(_)operator((()pre_type(char) operator(*,) ident(size_t) ident(n)operator(,) pre_type(char) directive(const) operator(*,) ident(va_list)operator(\)\);) -preprocessor(#endif) - -preprocessor(#endif) comment(/* MISSING_H */) -comment(/********************************************************************** - - node.h - - - $Author: wyhaines $ - $Date: 2009-07-09 20:16:38 +0200 (Thu, 09 Jul 2009\) $ - created at: Fri May 28 15:14:02 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#ifndef) ident(NODE_H) -preprocessor(#define) ident(NODE_H) - -preprocessor(#if) ident(defined)operator(()ident(__cplusplus)operator(\)) -directive(extern) string operator({) -preprocessor(#endif) - -reserved(enum) ident(node_type) operator({) - ident(NODE_METHOD)operator(,) - ident(NODE_FBODY)operator(,) - ident(NODE_CFUNC)operator(,) - ident(NODE_SCOPE)operator(,) - ident(NODE_BLOCK)operator(,) - ident(NODE_IF)operator(,) - ident(NODE_CASE)operator(,) - ident(NODE_WHEN)operator(,) - ident(NODE_OPT_N)operator(,) - ident(NODE_WHILE)operator(,) - ident(NODE_UNTIL)operator(,) - ident(NODE_ITER)operator(,) - ident(NODE_FOR)operator(,) - ident(NODE_BREAK)operator(,) - ident(NODE_NEXT)operator(,) - ident(NODE_REDO)operator(,) - ident(NODE_RETRY)operator(,) - ident(NODE_BEGIN)operator(,) - ident(NODE_RESCUE)operator(,) - ident(NODE_RESBODY)operator(,) - ident(NODE_ENSURE)operator(,) - ident(NODE_AND)operator(,) - ident(NODE_OR)operator(,) - ident(NODE_NOT)operator(,) - ident(NODE_MASGN)operator(,) - ident(NODE_LASGN)operator(,) - ident(NODE_DASGN)operator(,) - ident(NODE_DASGN_CURR)operator(,) - ident(NODE_GASGN)operator(,) - ident(NODE_IASGN)operator(,) - ident(NODE_CDECL)operator(,) - ident(NODE_CVASGN)operator(,) - ident(NODE_CVDECL)operator(,) - ident(NODE_OP_ASGN1)operator(,) - ident(NODE_OP_ASGN2)operator(,) - ident(NODE_OP_ASGN_AND)operator(,) - ident(NODE_OP_ASGN_OR)operator(,) - ident(NODE_CALL)operator(,) - ident(NODE_FCALL)operator(,) - ident(NODE_VCALL)operator(,) - ident(NODE_SUPER)operator(,) - ident(NODE_ZSUPER)operator(,) - ident(NODE_ARRAY)operator(,) - ident(NODE_ZARRAY)operator(,) - ident(NODE_HASH)operator(,) - ident(NODE_RETURN)operator(,) - ident(NODE_YIELD)operator(,) - ident(NODE_LVAR)operator(,) - ident(NODE_DVAR)operator(,) - ident(NODE_GVAR)operator(,) - ident(NODE_IVAR)operator(,) - ident(NODE_CONST)operator(,) - ident(NODE_CVAR)operator(,) - ident(NODE_NTH_REF)operator(,) - ident(NODE_BACK_REF)operator(,) - ident(NODE_MATCH)operator(,) - ident(NODE_MATCH2)operator(,) - ident(NODE_MATCH3)operator(,) - ident(NODE_LIT)operator(,) - ident(NODE_STR)operator(,) - ident(NODE_DSTR)operator(,) - ident(NODE_XSTR)operator(,) - ident(NODE_DXSTR)operator(,) - ident(NODE_EVSTR)operator(,) - ident(NODE_DREGX)operator(,) - ident(NODE_DREGX_ONCE)operator(,) - ident(NODE_ARGS)operator(,) - ident(NODE_ARGSCAT)operator(,) - ident(NODE_ARGSPUSH)operator(,) - ident(NODE_SPLAT)operator(,) - ident(NODE_TO_ARY)operator(,) - ident(NODE_SVALUE)operator(,) - ident(NODE_BLOCK_ARG)operator(,) - ident(NODE_BLOCK_PASS)operator(,) - ident(NODE_DEFN)operator(,) - ident(NODE_DEFS)operator(,) - ident(NODE_ALIAS)operator(,) - ident(NODE_VALIAS)operator(,) - ident(NODE_UNDEF)operator(,) - ident(NODE_CLASS)operator(,) - ident(NODE_MODULE)operator(,) - ident(NODE_SCLASS)operator(,) - ident(NODE_COLON2)operator(,) - ident(NODE_COLON3)operator(,) - ident(NODE_CREF)operator(,) - ident(NODE_DOT2)operator(,) - ident(NODE_DOT3)operator(,) - ident(NODE_FLIP2)operator(,) - ident(NODE_FLIP3)operator(,) - ident(NODE_ATTRSET)operator(,) - ident(NODE_SELF)operator(,) - ident(NODE_NIL)operator(,) - ident(NODE_TRUE)operator(,) - ident(NODE_FALSE)operator(,) - ident(NODE_DEFINED)operator(,) - ident(NODE_NEWLINE)operator(,) - ident(NODE_POSTEXE)operator(,) - ident(NODE_ALLOCA)operator(,) - ident(NODE_DMETHOD)operator(,) - ident(NODE_BMETHOD)operator(,) - ident(NODE_MEMO)operator(,) - ident(NODE_IFUNC)operator(,) - ident(NODE_DSYM)operator(,) - ident(NODE_ATTRASGN)operator(,) - ident(NODE_LAST) -operator(};) - -reserved(typedef) reserved(struct) ident(RNode) operator({) - pre_type(unsigned) pre_type(long) ident(flags)operator(;) - pre_type(char) operator(*)ident(nd_file)operator(;) - reserved(union) operator({) - reserved(struct) ident(RNode) operator(*)ident(node)operator(;) - ident(ID) ident(id)operator(;) - ident(VALUE) ident(value)operator(;) - ident(VALUE) operator((*)ident(cfunc)operator(\)()ident(ANYARGS)operator(\);) - ident(ID) operator(*)ident(tbl)operator(;) - operator(}) ident(u1)operator(;) - reserved(union) operator({) - reserved(struct) ident(RNode) operator(*)ident(node)operator(;) - ident(ID) ident(id)operator(;) - pre_type(long) ident(argc)operator(;) - ident(VALUE) ident(value)operator(;) - operator(}) ident(u2)operator(;) - reserved(union) operator({) - reserved(struct) ident(RNode) operator(*)ident(node)operator(;) - ident(ID) ident(id)operator(;) - pre_type(long) ident(state)operator(;) - reserved(struct) ident(global_entry) operator(*)ident(entry)operator(;) - pre_type(long) ident(cnt)operator(;) - ident(VALUE) ident(value)operator(;) - operator(}) ident(u3)operator(;) -operator(}) ident(NODE)operator(;) - -directive(extern) ident(NODE) operator(*)ident(ruby_cref)operator(;) -directive(extern) ident(NODE) operator(*)ident(ruby_top_cref)operator(;) - -preprocessor(#define) ident(RNODE)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RNode)operator(\)()ident(obj)operator(\)\)) - -preprocessor(#define) ident(nd_type)operator(()ident(n)operator(\)) operator((()pre_type(int)operator(\)((()ident(RNODE)operator(()ident(n)operator(\)\)->)ident(flags)operator(>>)ident(FL_USHIFT)operator(\)&)hex(0xff)operator(\)\)) -preprocessor(#define) ident(nd_set_type)operator(()ident(n)operator(,)ident(t)operator(\)) \ - ident(RNODE)operator(()ident(n)operator(\)->)ident(flags)operator(=(()ident(RNODE)operator(()ident(n)operator(\)->)ident(flags)operator(&~)ident(FL_UMASK)operator(\)|((()ident(t)operator(\)<<)ident(FL_USHIFT)operator(\)&)ident(FL_UMASK)operator(\)\)) - -preprocessor(#define) ident(NODE_LSHIFT) operator(()ident(FL_USHIFT)operator(+)integer(8)operator(\)) -preprocessor(#define) ident(NODE_LMASK) operator(((()pre_type(long)operator(\))integer(1)operator(<<()reserved(sizeof)operator(()ident(NODE)operator(*\)*)ident(CHAR_BIT)operator(-)ident(NODE_LSHIFT)operator(\)\)-)integer(1)operator(\)) -preprocessor(#define) ident(nd_line)operator(()ident(n)operator(\)) operator((()pre_type(unsigned) pre_type(int)operator(\)((()ident(RNODE)operator(()ident(n)operator(\)\)->)ident(flags)operator(>>)ident(NODE_LSHIFT)operator(\)&)ident(NODE_LMASK)operator(\)\)) -preprocessor(#define) ident(nd_set_line)operator(()ident(n)operator(,)ident(l)operator(\)) \ - ident(RNODE)operator(()ident(n)operator(\)->)ident(flags)operator(=(()ident(RNODE)operator(()ident(n)operator(\)->)ident(flags)operator(&~(-)integer(1)operator(<<)ident(NODE_LSHIFT)operator(\)\)|((()ident(l)operator(\)&)ident(NODE_LMASK)operator(\)<<)ident(NODE_LSHIFT)operator(\)\)) - -preprocessor(#define) ident(nd_head) ident(u1)operator(.)ident(node) -preprocessor(#define) ident(nd_alen) ident(u2)operator(.)ident(argc) -preprocessor(#define) ident(nd_next) ident(u3)operator(.)ident(node) - -preprocessor(#define) ident(nd_cond) ident(u1)operator(.)ident(node) -preprocessor(#define) ident(nd_body) ident(u2)operator(.)ident(node) -preprocessor(#define) ident(nd_else) ident(u3)operator(.)ident(node) - -preprocessor(#define) ident(nd_orig) ident(u3)operator(.)ident(value) - -preprocessor(#define) ident(nd_resq) ident(u2)operator(.)ident(node) -preprocessor(#define) ident(nd_ensr) ident(u3)operator(.)ident(node) - -preprocessor(#define) ident(nd_1st) ident(u1)operator(.)ident(node) -preprocessor(#define) ident(nd_2nd) ident(u2)operator(.)ident(node) - -preprocessor(#define) ident(nd_stts) ident(u1)operator(.)ident(node) - -preprocessor(#define) ident(nd_entry) ident(u3)operator(.)ident(entry) -preprocessor(#define) ident(nd_vid) ident(u1)operator(.)ident(id) -preprocessor(#define) ident(nd_cflag) ident(u2)operator(.)ident(id) -preprocessor(#define) ident(nd_cval) ident(u3)operator(.)ident(value) - -preprocessor(#define) ident(nd_cnt) ident(u3)operator(.)ident(cnt) -preprocessor(#define) ident(nd_tbl) ident(u1)operator(.)ident(tbl) - -preprocessor(#define) ident(nd_var) ident(u1)operator(.)ident(node) -preprocessor(#define) ident(nd_ibdy) ident(u2)operator(.)ident(node) -preprocessor(#define) ident(nd_iter) ident(u3)operator(.)ident(node) - -preprocessor(#define) ident(nd_value) ident(u2)operator(.)ident(node) -preprocessor(#define) ident(nd_aid) ident(u3)operator(.)ident(id) - -preprocessor(#define) ident(nd_lit) ident(u1)operator(.)ident(value) - -preprocessor(#define) ident(nd_frml) ident(u1)operator(.)ident(node) -preprocessor(#define) ident(nd_rest) ident(u2)operator(.)ident(node) -preprocessor(#define) ident(nd_opt) ident(u1)operator(.)ident(node) - -preprocessor(#define) ident(nd_recv) ident(u1)operator(.)ident(node) -preprocessor(#define) ident(nd_mid) ident(u2)operator(.)ident(id) -preprocessor(#define) ident(nd_args) ident(u3)operator(.)ident(node) - -preprocessor(#define) ident(nd_noex) ident(u1)operator(.)ident(id) -preprocessor(#define) ident(nd_defn) ident(u3)operator(.)ident(node) - -preprocessor(#define) ident(nd_cfnc) ident(u1)operator(.)ident(cfunc) -preprocessor(#define) ident(nd_argc) ident(u2)operator(.)ident(argc) - -preprocessor(#define) ident(nd_cpath) ident(u1)operator(.)ident(node) -preprocessor(#define) ident(nd_super) ident(u3)operator(.)ident(node) - -preprocessor(#define) ident(nd_modl) ident(u1)operator(.)ident(id) -preprocessor(#define) ident(nd_clss) ident(u1)operator(.)ident(value) - -preprocessor(#define) ident(nd_beg) ident(u1)operator(.)ident(node) -preprocessor(#define) ident(nd_end) ident(u2)operator(.)ident(node) -preprocessor(#define) ident(nd_state) ident(u3)operator(.)ident(state) -preprocessor(#define) ident(nd_rval) ident(u2)operator(.)ident(value) - -preprocessor(#define) ident(nd_nth) ident(u2)operator(.)ident(argc) - -preprocessor(#define) ident(nd_tag) ident(u1)operator(.)ident(id) -preprocessor(#define) ident(nd_tval) ident(u2)operator(.)ident(value) - -preprocessor(#define) ident(NEW_NODE)operator(()ident(t)operator(,)ident(a0)operator(,)ident(a1)operator(,)ident(a2)operator(\)) ident(rb_node_newnode)operator((()ident(t)operator(\),()ident(VALUE)operator(\)()ident(a0)operator(\),()ident(VALUE)operator(\)()ident(a1)operator(\),()ident(VALUE)operator(\)()ident(a2)operator(\)\)) - -preprocessor(#define) ident(NEW_METHOD)operator(()ident(n)operator(,)ident(x)operator(\)) ident(NEW_NODE)operator(()ident(NODE_METHOD)operator(,)ident(x)operator(,)ident(n)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_FBODY)operator(()ident(n)operator(,)ident(i)operator(,)ident(o)operator(\)) ident(NEW_NODE)operator(()ident(NODE_FBODY)operator(,)ident(n)operator(,)ident(i)operator(,)ident(o)operator(\)) -preprocessor(#define) ident(NEW_DEFN)operator(()ident(i)operator(,)ident(a)operator(,)ident(d)operator(,)ident(p)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DEFN)operator(,)ident(p)operator(,)ident(i)operator(,)ident(NEW_RFUNC)operator(()ident(a)operator(,)ident(d)operator(\)\)) -preprocessor(#define) ident(NEW_DEFS)operator(()ident(r)operator(,)ident(i)operator(,)ident(a)operator(,)ident(d)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DEFS)operator(,)ident(r)operator(,)ident(i)operator(,)ident(NEW_RFUNC)operator(()ident(a)operator(,)ident(d)operator(\)\)) -preprocessor(#define) ident(NEW_CFUNC)operator(()ident(f)operator(,)ident(c)operator(\)) ident(NEW_NODE)operator(()ident(NODE_CFUNC)operator(,)ident(f)operator(,)ident(c)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_IFUNC)operator(()ident(f)operator(,)ident(c)operator(\)) ident(NEW_NODE)operator(()ident(NODE_IFUNC)operator(,)ident(f)operator(,)ident(c)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_RFUNC)operator(()ident(b1)operator(,)ident(b2)operator(\)) ident(NEW_SCOPE)operator(()ident(block_append)operator(()ident(b1)operator(,)ident(b2)operator(\)\)) -preprocessor(#define) ident(NEW_SCOPE)operator(()ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_SCOPE)operator(,)ident(local_tbl)operator((\),)integer(0)operator(,()ident(b)operator(\)\)) -preprocessor(#define) ident(NEW_BLOCK)operator(()ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_BLOCK)operator(,)ident(a)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_IF)operator(()ident(c)operator(,)ident(t)operator(,)ident(e)operator(\)) ident(NEW_NODE)operator(()ident(NODE_IF)operator(,)ident(c)operator(,)ident(t)operator(,)ident(e)operator(\)) -preprocessor(#define) ident(NEW_UNLESS)operator(()ident(c)operator(,)ident(t)operator(,)ident(e)operator(\)) ident(NEW_IF)operator(()ident(c)operator(,)ident(e)operator(,)ident(t)operator(\)) -preprocessor(#define) ident(NEW_CASE)operator(()ident(h)operator(,)ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_CASE)operator(,)ident(h)operator(,)ident(b)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_WHEN)operator(()ident(c)operator(,)ident(t)operator(,)ident(e)operator(\)) ident(NEW_NODE)operator(()ident(NODE_WHEN)operator(,)ident(c)operator(,)ident(t)operator(,)ident(e)operator(\)) -preprocessor(#define) ident(NEW_OPT_N)operator(()ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_OPT_N)operator(,)integer(0)operator(,)ident(b)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_WHILE)operator(()ident(c)operator(,)ident(b)operator(,)ident(n)operator(\)) ident(NEW_NODE)operator(()ident(NODE_WHILE)operator(,)ident(c)operator(,)ident(b)operator(,)ident(n)operator(\)) -preprocessor(#define) ident(NEW_UNTIL)operator(()ident(c)operator(,)ident(b)operator(,)ident(n)operator(\)) ident(NEW_NODE)operator(()ident(NODE_UNTIL)operator(,)ident(c)operator(,)ident(b)operator(,)ident(n)operator(\)) -preprocessor(#define) ident(NEW_FOR)operator(()ident(v)operator(,)ident(i)operator(,)ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_FOR)operator(,)ident(v)operator(,)ident(b)operator(,)ident(i)operator(\)) -preprocessor(#define) ident(NEW_ITER)operator(()ident(v)operator(,)ident(i)operator(,)ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_ITER)operator(,)ident(v)operator(,)ident(b)operator(,)ident(i)operator(\)) -preprocessor(#define) ident(NEW_BREAK)operator(()ident(s)operator(\)) ident(NEW_NODE)operator(()ident(NODE_BREAK)operator(,)ident(s)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_NEXT)operator(()ident(s)operator(\)) ident(NEW_NODE)operator(()ident(NODE_NEXT)operator(,)ident(s)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_REDO)operator((\)) ident(NEW_NODE)operator(()ident(NODE_REDO)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_RETRY)operator((\)) ident(NEW_NODE)operator(()ident(NODE_RETRY)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_BEGIN)operator(()ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_BEGIN)operator(,)integer(0)operator(,)ident(b)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_RESCUE)operator(()ident(b)operator(,)ident(res)operator(,)ident(e)operator(\)) ident(NEW_NODE)operator(()ident(NODE_RESCUE)operator(,)ident(b)operator(,)ident(res)operator(,)ident(e)operator(\)) -preprocessor(#define) ident(NEW_RESBODY)operator(()ident(a)operator(,)ident(ex)operator(,)ident(n)operator(\)) ident(NEW_NODE)operator(()ident(NODE_RESBODY)operator(,)ident(n)operator(,)ident(ex)operator(,)ident(a)operator(\)) -preprocessor(#define) ident(NEW_ENSURE)operator(()ident(b)operator(,)ident(en)operator(\)) ident(NEW_NODE)operator(()ident(NODE_ENSURE)operator(,)ident(b)operator(,)integer(0)operator(,)ident(en)operator(\)) -preprocessor(#define) ident(NEW_RETURN)operator(()ident(s)operator(\)) ident(NEW_NODE)operator(()ident(NODE_RETURN)operator(,)ident(s)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_YIELD)operator(()ident(a)operator(,)ident(s)operator(\)) ident(NEW_NODE)operator(()ident(NODE_YIELD)operator(,)ident(a)operator(,)integer(0)operator(,)ident(s)operator(\)) -preprocessor(#define) ident(NEW_LIST)operator(()ident(a)operator(\)) ident(NEW_ARRAY)operator(()ident(a)operator(\)) -preprocessor(#define) ident(NEW_ARRAY)operator(()ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_ARRAY)operator(,)ident(a)operator(,)integer(1)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_ZARRAY)operator((\)) ident(NEW_NODE)operator(()ident(NODE_ZARRAY)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_HASH)operator(()ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_HASH)operator(,)ident(a)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_NOT)operator(()ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_NOT)operator(,)integer(0)operator(,)ident(a)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_MASGN)operator(()ident(l)operator(,)ident(r)operator(\)) ident(NEW_NODE)operator(()ident(NODE_MASGN)operator(,)ident(l)operator(,)integer(0)operator(,)ident(r)operator(\)) -preprocessor(#define) ident(NEW_GASGN)operator(()ident(v)operator(,)ident(val)operator(\)) ident(NEW_NODE)operator(()ident(NODE_GASGN)operator(,)ident(v)operator(,)ident(val)operator(,)ident(rb_global_entry)operator(()ident(v)operator(\)\)) -preprocessor(#define) ident(NEW_LASGN)operator(()ident(v)operator(,)ident(val)operator(\)) ident(NEW_NODE)operator(()ident(NODE_LASGN)operator(,)ident(v)operator(,)ident(val)operator(,)ident(local_cnt)operator(()ident(v)operator(\)\)) -preprocessor(#define) ident(NEW_DASGN)operator(()ident(v)operator(,)ident(val)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DASGN)operator(,)ident(v)operator(,)ident(val)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_DASGN_CURR)operator(()ident(v)operator(,)ident(val)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DASGN_CURR)operator(,)ident(v)operator(,)ident(val)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_IASGN)operator(()ident(v)operator(,)ident(val)operator(\)) ident(NEW_NODE)operator(()ident(NODE_IASGN)operator(,)ident(v)operator(,)ident(val)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_CDECL)operator(()ident(v)operator(,)ident(val)operator(,)ident(path)operator(\)) ident(NEW_NODE)operator(()ident(NODE_CDECL)operator(,)ident(v)operator(,)ident(val)operator(,)ident(path)operator(\)) -preprocessor(#define) ident(NEW_CVASGN)operator(()ident(v)operator(,)ident(val)operator(\)) ident(NEW_NODE)operator(()ident(NODE_CVASGN)operator(,)ident(v)operator(,)ident(val)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_CVDECL)operator(()ident(v)operator(,)ident(val)operator(\)) ident(NEW_NODE)operator(()ident(NODE_CVDECL)operator(,)ident(v)operator(,)ident(val)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_OP_ASGN1)operator(()ident(p)operator(,)ident(id)operator(,)ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_OP_ASGN1)operator(,)ident(p)operator(,)ident(id)operator(,)ident(a)operator(\)) -preprocessor(#define) ident(NEW_OP_ASGN2)operator(()ident(r)operator(,)ident(i)operator(,)ident(o)operator(,)ident(val)operator(\)) ident(NEW_NODE)operator(()ident(NODE_OP_ASGN2)operator(,)ident(r)operator(,)ident(val)operator(,)ident(NEW_OP_ASGN22)operator(()ident(i)operator(,)ident(o)operator(\)\)) -preprocessor(#define) ident(NEW_OP_ASGN22)operator(()ident(i)operator(,)ident(o)operator(\)) ident(NEW_NODE)operator(()ident(NODE_OP_ASGN2)operator(,)ident(i)operator(,)ident(o)operator(,)ident(rb_id_attrset)operator(()ident(i)operator(\)\)) -preprocessor(#define) ident(NEW_OP_ASGN_OR)operator(()ident(i)operator(,)ident(val)operator(\)) ident(NEW_NODE)operator(()ident(NODE_OP_ASGN_OR)operator(,)ident(i)operator(,)ident(val)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_OP_ASGN_AND)operator(()ident(i)operator(,)ident(val)operator(\)) ident(NEW_NODE)operator(()ident(NODE_OP_ASGN_AND)operator(,)ident(i)operator(,)ident(val)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_GVAR)operator(()ident(v)operator(\)) ident(NEW_NODE)operator(()ident(NODE_GVAR)operator(,)ident(v)operator(,)integer(0)operator(,)ident(rb_global_entry)operator(()ident(v)operator(\)\)) -preprocessor(#define) ident(NEW_LVAR)operator(()ident(v)operator(\)) ident(NEW_NODE)operator(()ident(NODE_LVAR)operator(,)ident(v)operator(,)integer(0)operator(,)ident(local_cnt)operator(()ident(v)operator(\)\)) -preprocessor(#define) ident(NEW_DVAR)operator(()ident(v)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DVAR)operator(,)ident(v)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_IVAR)operator(()ident(v)operator(\)) ident(NEW_NODE)operator(()ident(NODE_IVAR)operator(,)ident(v)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_CONST)operator(()ident(v)operator(\)) ident(NEW_NODE)operator(()ident(NODE_CONST)operator(,)ident(v)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_CVAR)operator(()ident(v)operator(\)) ident(NEW_NODE)operator(()ident(NODE_CVAR)operator(,)ident(v)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_NTH_REF)operator(()ident(n)operator(\)) ident(NEW_NODE)operator(()ident(NODE_NTH_REF)operator(,)integer(0)operator(,)ident(n)operator(,)ident(local_cnt)operator(()char('~')operator(\)\)) -preprocessor(#define) ident(NEW_BACK_REF)operator(()ident(n)operator(\)) ident(NEW_NODE)operator(()ident(NODE_BACK_REF)operator(,)integer(0)operator(,)ident(n)operator(,)ident(local_cnt)operator(()char('~')operator(\)\)) -preprocessor(#define) ident(NEW_MATCH)operator(()ident(c)operator(\)) ident(NEW_NODE)operator(()ident(NODE_MATCH)operator(,)ident(c)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_MATCH2)operator(()ident(n1)operator(,)ident(n2)operator(\)) ident(NEW_NODE)operator(()ident(NODE_MATCH2)operator(,)ident(n1)operator(,)ident(n2)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_MATCH3)operator(()ident(r)operator(,)ident(n2)operator(\)) ident(NEW_NODE)operator(()ident(NODE_MATCH3)operator(,)ident(r)operator(,)ident(n2)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_LIT)operator(()ident(l)operator(\)) ident(NEW_NODE)operator(()ident(NODE_LIT)operator(,)ident(l)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_STR)operator(()ident(s)operator(\)) ident(NEW_NODE)operator(()ident(NODE_STR)operator(,)ident(s)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_DSTR)operator(()ident(s)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DSTR)operator(,)ident(s)operator(,)integer(1)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_XSTR)operator(()ident(s)operator(\)) ident(NEW_NODE)operator(()ident(NODE_XSTR)operator(,)ident(s)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_DXSTR)operator(()ident(s)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DXSTR)operator(,)ident(s)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_DSYM)operator(()ident(s)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DSYM)operator(,)ident(s)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_EVSTR)operator(()ident(n)operator(\)) ident(NEW_NODE)operator(()ident(NODE_EVSTR)operator(,)integer(0)operator(,()ident(n)operator(\),)integer(0)operator(\)) -preprocessor(#define) ident(NEW_CALL)operator(()ident(r)operator(,)ident(m)operator(,)ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_CALL)operator(,)ident(r)operator(,)ident(m)operator(,)ident(a)operator(\)) -preprocessor(#define) ident(NEW_FCALL)operator(()ident(m)operator(,)ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_FCALL)operator(,)integer(0)operator(,)ident(m)operator(,)ident(a)operator(\)) -preprocessor(#define) ident(NEW_VCALL)operator(()ident(m)operator(\)) ident(NEW_NODE)operator(()ident(NODE_VCALL)operator(,)integer(0)operator(,)ident(m)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_SUPER)operator(()ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_SUPER)operator(,)integer(0)operator(,)integer(0)operator(,)ident(a)operator(\)) -preprocessor(#define) ident(NEW_ZSUPER)operator((\)) ident(NEW_NODE)operator(()ident(NODE_ZSUPER)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_ARGS)operator(()ident(f)operator(,)ident(o)operator(,)ident(r)operator(\)) ident(NEW_NODE)operator(()ident(NODE_ARGS)operator(,)ident(o)operator(,)ident(r)operator(,)ident(f)operator(\)) -preprocessor(#define) ident(NEW_ARGSCAT)operator(()ident(a)operator(,)ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_ARGSCAT)operator(,)ident(a)operator(,)ident(b)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_ARGSPUSH)operator(()ident(a)operator(,)ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_ARGSPUSH)operator(,)ident(a)operator(,)ident(b)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_SPLAT)operator(()ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_SPLAT)operator(,)ident(a)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_TO_ARY)operator(()ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_TO_ARY)operator(,)ident(a)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_SVALUE)operator(()ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_SVALUE)operator(,)ident(a)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_BLOCK_ARG)operator(()ident(v)operator(\)) ident(NEW_NODE)operator(()ident(NODE_BLOCK_ARG)operator(,)ident(v)operator(,)integer(0)operator(,)ident(local_cnt)operator(()ident(v)operator(\)\)) -preprocessor(#define) ident(NEW_BLOCK_PASS)operator(()ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_BLOCK_PASS)operator(,)integer(0)operator(,)ident(b)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_ALIAS)operator(()ident(n)operator(,)ident(o)operator(\)) ident(NEW_NODE)operator(()ident(NODE_ALIAS)operator(,)ident(n)operator(,)ident(o)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_VALIAS)operator(()ident(n)operator(,)ident(o)operator(\)) ident(NEW_NODE)operator(()ident(NODE_VALIAS)operator(,)ident(n)operator(,)ident(o)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_UNDEF)operator(()ident(i)operator(\)) ident(NEW_NODE)operator(()ident(NODE_UNDEF)operator(,)integer(0)operator(,)ident(i)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_CLASS)operator(()ident(n)operator(,)ident(b)operator(,)ident(s)operator(\)) ident(NEW_NODE)operator(()ident(NODE_CLASS)operator(,)ident(n)operator(,)ident(NEW_SCOPE)operator(()ident(b)operator(\),()ident(s)operator(\)\)) -preprocessor(#define) ident(NEW_SCLASS)operator(()ident(r)operator(,)ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_SCLASS)operator(,)ident(r)operator(,)ident(NEW_SCOPE)operator(()ident(b)operator(\),)integer(0)operator(\)) -preprocessor(#define) ident(NEW_MODULE)operator(()ident(n)operator(,)ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_MODULE)operator(,)ident(n)operator(,)ident(NEW_SCOPE)operator(()ident(b)operator(\),)integer(0)operator(\)) -preprocessor(#define) ident(NEW_COLON2)operator(()ident(c)operator(,)ident(i)operator(\)) ident(NEW_NODE)operator(()ident(NODE_COLON2)operator(,)ident(c)operator(,)ident(i)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_COLON3)operator(()ident(i)operator(\)) ident(NEW_NODE)operator(()ident(NODE_COLON3)operator(,)integer(0)operator(,)ident(i)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_CREF)operator(()ident(c)operator(,)ident(n)operator(\)) ident(NEW_NODE)operator(()ident(NODE_CREF)operator(,)ident(c)operator(,)integer(0)operator(,)ident(n)operator(\)) -preprocessor(#define) ident(NEW_DOT2)operator(()ident(b)operator(,)ident(e)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DOT2)operator(,)ident(b)operator(,)ident(e)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_DOT3)operator(()ident(b)operator(,)ident(e)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DOT3)operator(,)ident(b)operator(,)ident(e)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_ATTRSET)operator(()ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_ATTRSET)operator(,)ident(a)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_SELF)operator((\)) ident(NEW_NODE)operator(()ident(NODE_SELF)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_NIL)operator((\)) ident(NEW_NODE)operator(()ident(NODE_NIL)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_TRUE)operator((\)) ident(NEW_NODE)operator(()ident(NODE_TRUE)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_FALSE)operator((\)) ident(NEW_NODE)operator(()ident(NODE_FALSE)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_DEFINED)operator(()ident(e)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DEFINED)operator(,)ident(e)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_NEWLINE)operator(()ident(n)operator(\)) ident(NEW_NODE)operator(()ident(NODE_NEWLINE)operator(,)integer(0)operator(,)integer(0)operator(,)ident(n)operator(\)) -preprocessor(#define) ident(NEW_PREEXE)operator(()ident(b)operator(\)) ident(NEW_SCOPE)operator(()ident(b)operator(\)) -preprocessor(#define) ident(NEW_POSTEXE)operator((\)) ident(NEW_NODE)operator(()ident(NODE_POSTEXE)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(\)) -preprocessor(#define) ident(NEW_DMETHOD)operator(()ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_DMETHOD)operator(,)integer(0)operator(,)integer(0)operator(,)ident(b)operator(\)) -preprocessor(#define) ident(NEW_BMETHOD)operator(()ident(b)operator(\)) ident(NEW_NODE)operator(()ident(NODE_BMETHOD)operator(,)integer(0)operator(,)integer(0)operator(,)ident(b)operator(\)) -preprocessor(#define) ident(NEW_ATTRASGN)operator(()ident(r)operator(,)ident(m)operator(,)ident(a)operator(\)) ident(NEW_NODE)operator(()ident(NODE_ATTRASGN)operator(,)ident(r)operator(,)ident(m)operator(,)ident(a)operator(\)) - -preprocessor(#define) ident(NOEX_PUBLIC) integer(0) -preprocessor(#define) ident(NOEX_NOSUPER) integer(1) -preprocessor(#define) ident(NOEX_PRIVATE) integer(2) -preprocessor(#define) ident(NOEX_PROTECTED) integer(4) -preprocessor(#define) ident(NOEX_MASK) integer(6) - -preprocessor(#define) ident(NOEX_UNDEF) ident(NOEX_NOSUPER) - -ident(NODE) operator(*)ident(rb_compile_cstr) ident(_)operator((()directive(const) pre_type(char)operator(*,) directive(const) pre_type(char)operator(*,) pre_type(int)operator(,) pre_type(int)operator(\)\);) -ident(NODE) operator(*)ident(rb_compile_string) ident(_)operator((()directive(const) pre_type(char)operator(*,) ident(VALUE)operator(,) pre_type(int)operator(\)\);) -ident(NODE) operator(*)ident(rb_compile_file) ident(_)operator((()directive(const) pre_type(char)operator(*,) ident(VALUE)operator(,) pre_type(int)operator(\)\);) - -directive(void) ident(rb_add_method) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) ident(NODE) operator(*,) pre_type(int)operator(\)\);) -ident(NODE) operator(*)ident(rb_node_newnode) ident(_)operator((()reserved(enum) ident(node_type)operator(,)ident(VALUE)operator(,)ident(VALUE)operator(,)ident(VALUE)operator(\)\);) - -ident(NODE)operator(*) ident(rb_method_node) ident(_)operator((()ident(VALUE) ident(klass)operator(,) ident(ID) ident(id)operator(\)\);) - -reserved(struct) ident(global_entry) operator(*)ident(rb_global_entry) ident(_)operator((()ident(ID)operator(\)\);) -ident(VALUE) ident(rb_gvar_get) ident(_)operator((()reserved(struct) ident(global_entry) operator(*\)\);) -ident(VALUE) ident(rb_gvar_set) ident(_)operator((()reserved(struct) ident(global_entry) operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_gvar_defined) ident(_)operator((()reserved(struct) ident(global_entry) operator(*\)\);) - -reserved(typedef) pre_type(unsigned) pre_type(int) ident(rb_event_t)operator(;) - -preprocessor(#define) ident(RUBY_EVENT_NONE) hex(0x00) -preprocessor(#define) ident(RUBY_EVENT_LINE) hex(0x01) -preprocessor(#define) ident(RUBY_EVENT_CLASS) hex(0x02) -preprocessor(#define) ident(RUBY_EVENT_END) hex(0x04) -preprocessor(#define) ident(RUBY_EVENT_CALL) hex(0x08) -preprocessor(#define) ident(RUBY_EVENT_RETURN) hex(0x10) -preprocessor(#define) ident(RUBY_EVENT_C_CALL) hex(0x20) -preprocessor(#define) ident(RUBY_EVENT_C_RETURN) hex(0x40) -preprocessor(#define) ident(RUBY_EVENT_RAISE) hex(0x80) -preprocessor(#define) ident(RUBY_EVENT_ALL) hex(0xff) - -reserved(typedef) directive(void) operator((*)ident(rb_event_hook_func_t)operator(\)) ident(_)operator((()ident(rb_event_t)operator(,)ident(NODE)operator(*,)ident(VALUE)operator(,)ident(ID)operator(,)ident(VALUE)operator(\)\);) -ident(NODE) operator(*)ident(rb_copy_node_scope) ident(_)operator((()ident(NODE) operator(*,) ident(NODE) operator(*\)\);) -directive(void) ident(rb_add_event_hook) ident(_)operator((()ident(rb_event_hook_func_t)operator(,)ident(rb_event_t)operator(\)\);) -pre_type(int) ident(rb_remove_event_hook) ident(_)operator((()ident(rb_event_hook_func_t)operator(\)\);) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_GETCONTEXT)operator(\)) operator(&&) ident(defined)operator(()ident(HAVE_SETCONTEXT)operator(\)) -preprocessor(#include) include() -preprocessor(#define) ident(USE_CONTEXT) -preprocessor(#endif) -preprocessor(#include) include() -preprocessor(#include) include("st.h") - -preprocessor(#ifdef) ident(USE_CONTEXT) -reserved(typedef) reserved(struct) operator({) - ident(ucontext_t) ident(context)operator(;) - directive(volatile) pre_type(int) ident(status)operator(;) -operator(}) ident(rb_jmpbuf_t)operator([)integer(1)operator(];) -preprocessor(#else) -reserved(typedef) ident(jmp_buf) ident(rb_jmpbuf_t)operator(;) -preprocessor(#endif) - -reserved(enum) ident(rb_thread_status) operator({) - ident(THREAD_TO_KILL)operator(,) - ident(THREAD_RUNNABLE)operator(,) - ident(THREAD_STOPPED)operator(,) - ident(THREAD_KILLED) -operator(};) - -reserved(typedef) reserved(struct) ident(rb_thread) operator(*)ident(rb_thread_t)operator(;) - -reserved(struct) ident(rb_thread) operator({) - ident(rb_thread_t) ident(next)operator(,) ident(prev)operator(;) - ident(rb_jmpbuf_t) ident(context)operator(;) -preprocessor(#if) operator(()ident(defined) ident(_WIN32) operator(&&) operator(!)ident(defined) ident(_WIN32_WCE)operator(\)) operator(||) ident(defined) ident(__CYGWIN__) - pre_type(unsigned) pre_type(long) ident(win32_exception_list)operator(;) -preprocessor(#endif) - - ident(VALUE) ident(result)operator(;) - - ident(size_t) ident(stk_len)operator(;) - ident(size_t) ident(stk_max)operator(;) - ident(VALUE) operator(*)ident(stk_ptr)operator(;) - ident(VALUE) operator(*)ident(stk_pos)operator(;) -preprocessor(#ifdef) ident(__ia64) - ident(size_t) ident(bstr_len)operator(;) - ident(size_t) ident(bstr_max)operator(;) - ident(VALUE) operator(*)ident(bstr_ptr)operator(;) - ident(VALUE) operator(*)ident(bstr_pos)operator(;) -preprocessor(#endif) - - reserved(struct) ident(FRAME) operator(*)ident(frame)operator(;) - reserved(struct) ident(SCOPE) operator(*)ident(scope)operator(;) - reserved(struct) ident(RVarmap) operator(*)ident(dyna_vars)operator(;) - reserved(struct) ident(BLOCK) operator(*)ident(block)operator(;) - reserved(struct) ident(iter) operator(*)ident(iter)operator(;) - reserved(struct) ident(tag) operator(*)ident(tag)operator(;) - ident(VALUE) ident(klass)operator(;) - ident(VALUE) ident(wrapper)operator(;) - ident(NODE) operator(*)ident(cref)operator(;) - - pre_type(int) ident(flags)operator(;) comment(/* misc. states (vmode/rb_trap_immediate/raised\) */) - - ident(NODE) operator(*)ident(node)operator(;) - - pre_type(int) ident(tracing)operator(;) - ident(VALUE) ident(errinfo)operator(;) - ident(VALUE) ident(last_status)operator(;) - ident(VALUE) ident(last_line)operator(;) - ident(VALUE) ident(last_match)operator(;) - - pre_type(int) ident(safe)operator(;) - - reserved(enum) ident(rb_thread_status) ident(status)operator(;) - pre_type(int) ident(wait_for)operator(;) - pre_type(int) ident(fd)operator(;) - ident(fd_set) ident(readfds)operator(;) - ident(fd_set) ident(writefds)operator(;) - ident(fd_set) ident(exceptfds)operator(;) - pre_type(int) ident(select_value)operator(;) - pre_type(double) ident(delay)operator(;) - ident(rb_thread_t) ident(join)operator(;) - - pre_type(int) ident(abort)operator(;) - pre_type(int) ident(priority)operator(;) - ident(VALUE) ident(thgroup)operator(;) - - reserved(struct) ident(st_table) operator(*)ident(locals)operator(;) - - ident(VALUE) ident(thread)operator(;) - - ident(VALUE) ident(sandbox)operator(;) -operator(};) - -directive(extern) ident(VALUE) operator((*)ident(ruby_sandbox_save)operator(\))ident(_)operator((()ident(rb_thread_t)operator(\)\);) -directive(extern) ident(VALUE) operator((*)ident(ruby_sandbox_restore)operator(\))ident(_)operator((()ident(rb_thread_t)operator(\)\);) -directive(extern) ident(rb_thread_t) ident(rb_curr_thread)operator(;) -directive(extern) ident(rb_thread_t) ident(rb_main_thread)operator(;) - -reserved(enum) operator({) - ident(RAISED_EXCEPTION) operator(=) hex(0x1000)operator(,) - ident(RAISED_STACKOVERFLOW) operator(=) hex(0x2000)operator(,) - ident(RAISED_NOMEMORY) operator(=) hex(0x4000)operator(,) - ident(RAISED_MASK) operator(=) hex(0xf000) -operator(};) -pre_type(int) ident(rb_thread_set_raised)operator(()ident(rb_thread_t) ident(th)operator(\);) -pre_type(int) ident(rb_thread_reset_raised)operator(()ident(rb_thread_t) ident(th)operator(\);) -preprocessor(#define) ident(rb_thread_raised_set)operator(()ident(th)operator(,) ident(f)operator(\)) operator((()ident(th)operator(\)->)ident(flags) operator(|=) operator(()ident(f)operator(\)\)) -preprocessor(#define) ident(rb_thread_raised_reset)operator(()ident(th)operator(,) ident(f)operator(\)) operator((()ident(th)operator(\)->)ident(flags) operator(&=) operator(~()ident(f)operator(\)\)) -preprocessor(#define) ident(rb_thread_raised_p)operator(()ident(th)operator(,) ident(f)operator(\)) operator(((()ident(th)operator(\)->)ident(flags) operator(&) operator(()ident(f)operator(\)\)) operator(!=) integer(0)operator(\)) -preprocessor(#define) ident(rb_thread_raised_clear)operator(()ident(th)operator(\)) operator(()ident(rb_thread_raised_reset)operator(()ident(th)operator(,) ident(RAISED_MASK)operator(\)\)) - -preprocessor(#if) ident(defined)operator(()ident(__cplusplus)operator(\)) -operator(}) comment(/* extern "C" { */) -preprocessor(#endif) - -preprocessor(#endif) -comment(/********************************************************************** - - re.h - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007\) $ - created at: Thu Sep 30 14:18:32 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#ifndef) ident(RE_H) -preprocessor(#define) ident(RE_H) - -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#include) include("regex.h") - -reserved(typedef) reserved(struct) ident(re_pattern_buffer) ident(Regexp)operator(;) - -reserved(struct) ident(RMatch) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - ident(VALUE) ident(str)operator(;) - reserved(struct) ident(re_registers) operator(*)ident(regs)operator(;) -operator(};) - -preprocessor(#define) ident(RMATCH)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RMatch)operator(\)()ident(obj)operator(\)\)) - -ident(VALUE) ident(rb_reg_regcomp) ident(_)operator((()ident(VALUE)operator(\)\);) -pre_type(long) ident(rb_reg_search) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(,) pre_type(long)operator(,) pre_type(long)operator(\)\);) -ident(VALUE) ident(rb_reg_regsub) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(,) reserved(struct) ident(re_registers) operator(*\)\);) -pre_type(long) ident(rb_reg_adjust_startpos) ident(_)operator((()ident(VALUE)operator(,) ident(VALUE)operator(,) pre_type(long)operator(,) pre_type(long)operator(\)\);) -directive(void) ident(rb_match_busy) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_reg_quote) ident(_)operator((()ident(VALUE)operator(\)\);) - -ident(RUBY_EXTERN) pre_type(int) ident(ruby_ignorecase)operator(;) - -pre_type(int) ident(rb_reg_mbclen2) ident(_)operator((()pre_type(unsigned) pre_type(int)operator(,) ident(VALUE)operator(\)\);) -preprocessor(#define) ident(mbclen2)operator(()ident(c)operator(,)ident(re)operator(\)) ident(rb_reg_mbclen2)operator((()ident(c)operator(\),()ident(re)operator(\)\)) -preprocessor(#endif) -comment(/* Definitions for data structures and routines for the regular - expression library, version 0.12. - Copyright (C\) 1985,89,90,91,92,93,95,96,97,98 Free Software Foundation, Inc. - - This file is part of the GNU C Library. Its master source is NOT part of - the C library, however. The master source lives in /gd/gnu/lib. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option\) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file LGPL. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */) -comment(/* Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto\) - Last change: May 21, 1993 by t^2 */) -comment(/* modified for Ruby by matz@netlab.co.jp */) - -preprocessor(#ifndef) ident(REGEX_H) -preprocessor(#define) ident(REGEX_H) - -comment(/* symbol mangling for ruby */) -preprocessor(#ifdef) ident(RUBY) -preprocessor(# define) ident(re_adjust_startpos) ident(ruby_re_adjust_startpos) -preprocessor(# define) ident(re_compile_fastmap) ident(ruby_re_compile_fastmap) -preprocessor(# define) ident(re_compile_pattern) ident(ruby_re_compile_pattern) -preprocessor(# define) ident(re_copy_registers) ident(ruby_re_copy_registers) -preprocessor(# define) ident(re_free_pattern) ident(ruby_re_free_pattern) -preprocessor(# define) ident(re_free_registers) ident(ruby_re_free_registers) -preprocessor(# define) ident(re_match) ident(ruby_re_match) -preprocessor(# define) ident(re_mbcinit) ident(ruby_re_mbcinit) -preprocessor(# define) ident(re_search) ident(ruby_re_search) -preprocessor(# define) ident(re_set_casetable) ident(ruby_re_set_casetable) -preprocessor(# define) ident(register_info_type) ident(ruby_register_info_type) -preprocessor(#endif) - -preprocessor(#include) include() - -comment(/* Define number of parens for which we record the beginnings and ends. - This affects how much space the `struct re_registers' type takes up. */) -preprocessor(#ifndef) ident(RE_NREGS) -preprocessor(#define) ident(RE_NREGS) integer(10) -preprocessor(#endif) - -preprocessor(#define) ident(BYTEWIDTH) integer(8) - -preprocessor(#define) ident(RE_REG_MAX) operator((()integer(1)operator(<<)ident(BYTEWIDTH)operator(\)-)integer(1)operator(\)) - -comment(/* Maximum number of duplicates an interval can allow. */) -preprocessor(#ifndef) ident(RE_DUP_MAX) -preprocessor(#define) ident(RE_DUP_MAX) operator((()integer(1) operator(<<) integer(15)operator(\)) operator(-) integer(1)operator(\)) -preprocessor(#endif) - - -comment(/* If this bit is set, then character classes are supported; they are: - [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:], - [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:]. - If not set, then character classes are not supported. */) -preprocessor(#define) ident(RE_CHAR_CLASSES) operator(()integer(1L) operator(<<) integer(9)operator(\)) - -comment(/* match will be done case insensetively */) -preprocessor(#define) ident(RE_OPTION_IGNORECASE) operator(()integer(1L)operator(\)) -comment(/* perl-style extended pattern available */) -preprocessor(#define) ident(RE_OPTION_EXTENDED) operator(()ident(RE_OPTION_IGNORECASE)operator(<<)integer(1)operator(\)) -comment(/* newline will be included for . */) -preprocessor(#define) ident(RE_OPTION_MULTILINE) operator(()ident(RE_OPTION_EXTENDED)operator(<<)integer(1)operator(\)) -comment(/* ^ and $ ignore newline */) -preprocessor(#define) ident(RE_OPTION_SINGLELINE) operator(()ident(RE_OPTION_MULTILINE)operator(<<)integer(1)operator(\)) -comment(/* search for longest match, in accord with POSIX regexp */) -preprocessor(#define) ident(RE_OPTION_LONGEST) operator(()ident(RE_OPTION_SINGLELINE)operator(<<)integer(1)operator(\)) - -preprocessor(#define) ident(RE_MAY_IGNORECASE) operator(()ident(RE_OPTION_LONGEST)operator(<<)integer(1)operator(\)) -preprocessor(#define) ident(RE_OPTIMIZE_ANCHOR) operator(()ident(RE_MAY_IGNORECASE)operator(<<)integer(1)operator(\)) -preprocessor(#define) ident(RE_OPTIMIZE_EXACTN) operator(()ident(RE_OPTIMIZE_ANCHOR)operator(<<)integer(1)operator(\)) -preprocessor(#define) ident(RE_OPTIMIZE_NO_BM) operator(()ident(RE_OPTIMIZE_EXACTN)operator(<<)integer(1)operator(\)) -preprocessor(#define) ident(RE_OPTIMIZE_BMATCH) operator(()ident(RE_OPTIMIZE_NO_BM)operator(<<)integer(1)operator(\)) - -comment(/* For multi-byte char support */) -preprocessor(#define) ident(MBCTYPE_ASCII) integer(0) -preprocessor(#define) ident(MBCTYPE_EUC) integer(1) -preprocessor(#define) ident(MBCTYPE_SJIS) integer(2) -preprocessor(#define) ident(MBCTYPE_UTF8) integer(3) - -directive(extern) -preprocessor(#if) ident(defined) ident(_WIN32) operator(&&) operator(!)ident(defined) ident(__GNUC__) operator(&&) operator(!)ident(defined) ident(RUBY_EXPORT) -ident(__declspec)operator(()ident(dllimport)operator(\)) -preprocessor(# endif) -directive(const) pre_type(unsigned) pre_type(char) operator(*)ident(re_mbctab)operator(;) -preprocessor(#if) ident(defined)operator(()ident(__STDC__)operator(\)) -directive(void) ident(re_mbcinit) operator(()pre_type(int)operator(\);) -preprocessor(#else) -directive(void) ident(re_mbcinit) operator((\);) -preprocessor(#endif) - -preprocessor(#undef) ident(ismbchar) -preprocessor(#define) ident(ismbchar)operator(()ident(c)operator(\)) ident(re_mbctab)operator([()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)]) -preprocessor(#define) ident(mbclen)operator(()ident(c)operator(\)) operator(()ident(re_mbctab)operator([()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)]+)integer(1)operator(\)) - -comment(/* Structure used in re_match(\) */) - -reserved(typedef) reserved(union) -operator({) - pre_type(unsigned) pre_type(char) operator(*)ident(word)operator(;) - reserved(struct) operator({) - pre_type(unsigned) ident(is_active) operator(:) integer(1)operator(;) - pre_type(unsigned) ident(matched_something) operator(:) integer(1)operator(;) - operator(}) ident(bits)operator(;) -operator(}) ident(register_info_type)operator(;) - -comment(/* This data structure is used to represent a compiled pattern. */) - -reserved(struct) ident(re_pattern_buffer) - operator({) - pre_type(char) operator(*)ident(buffer)operator(;) comment(/* Space holding the compiled pattern commands. */) - pre_type(int) ident(allocated)operator(;) comment(/* Size of space that `buffer' points to. */) - pre_type(int) ident(used)operator(;) comment(/* Length of portion of buffer actually occupied */) - pre_type(char) operator(*)ident(fastmap)operator(;) comment(/* Pointer to fastmap, if any, or zero if none. */) - comment(/* re_search uses the fastmap, if there is one, - to skip over totally implausible characters. */) - pre_type(char) operator(*)ident(must)operator(;) comment(/* Pointer to exact pattern which strings should have - to be matched. */) - pre_type(int) operator(*)ident(must_skip)operator(;) comment(/* Pointer to exact pattern skip table for bm_search */) - pre_type(long) ident(options)operator(;) comment(/* Flags for options such as extended_pattern. */) - pre_type(long) ident(re_nsub)operator(;) comment(/* Number of subexpressions found by the compiler. */) - pre_type(char) ident(fastmap_accurate)operator(;) - comment(/* Set to zero when a new pattern is stored, - set to one when the fastmap is updated from it. */) - pre_type(char) ident(can_be_null)operator(;) comment(/* Set to one by compiling fastmap - if this pattern might match the null string. - It does not necessarily match the null string - in that case, but if this is zero, it cannot. - 2 as value means can match null string - but at end of range or before a character - listed in the fastmap. */) - - comment(/* stack & working area for re_match(\) */) - pre_type(unsigned) pre_type(char) operator(**)ident(regstart)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(regend)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(old_regstart)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(old_regend)operator(;) - ident(register_info_type) operator(*)ident(reg_info)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(best_regstart)operator(;) - pre_type(unsigned) pre_type(char) operator(**)ident(best_regend)operator(;) - operator(};) - -reserved(typedef) reserved(struct) ident(re_pattern_buffer) ident(regex_t)operator(;) - -comment(/* Structure to store register contents data in. - - Pass the address of such a structure as an argument to re_match, etc., - if you want this information back. - - For i from 1 to RE_NREGS - 1, start[i] records the starting index in - the string of where the ith subexpression matched, and end[i] records - one after the ending index. start[0] and end[0] are analogous, for - the entire pattern. */) - -reserved(struct) ident(re_registers) - operator({) - pre_type(int) ident(allocated)operator(;) - pre_type(int) ident(num_regs)operator(;) - pre_type(int) operator(*)ident(beg)operator(;) - pre_type(int) operator(*)ident(end)operator(;) - operator(};) - -comment(/* Type for byte offsets within the string. POSIX mandates this. */) -reserved(typedef) ident(size_t) ident(regoff_t)operator(;) - -comment(/* POSIX specification for registers. Aside from the different names than - `re_registers', POSIX uses an array of structures, instead of a - structure of arrays. */) -reserved(typedef) reserved(struct) -operator({) - ident(regoff_t) ident(rm_so)operator(;) comment(/* Byte offset from string's start to substring's start. */) - ident(regoff_t) ident(rm_eo)operator(;) comment(/* Byte offset from string's start to substring's end. */) -operator(}) ident(regmatch_t)operator(;) - -preprocessor(#ifdef) ident(__STDC__) - -directive(extern) pre_type(char) operator(*)ident(re_compile_pattern) operator(()directive(const) pre_type(char) operator(*,) pre_type(int)operator(,) reserved(struct) ident(re_pattern_buffer) operator(*\);) -directive(void) ident(re_free_pattern) operator(()reserved(struct) ident(re_pattern_buffer) operator(*\);) -comment(/* Is this really advertised? */) -directive(extern) pre_type(int) ident(re_adjust_startpos) operator(()reserved(struct) ident(re_pattern_buffer) operator(*,) directive(const) pre_type(char)operator(*,) pre_type(int)operator(,) pre_type(int)operator(,) pre_type(int)operator(\);) -directive(extern) directive(void) ident(re_compile_fastmap) operator(()reserved(struct) ident(re_pattern_buffer) operator(*\);) -directive(extern) pre_type(int) ident(re_search) operator(()reserved(struct) ident(re_pattern_buffer) operator(*,) directive(const) pre_type(char)operator(*,) pre_type(int)operator(,) pre_type(int)operator(,) pre_type(int)operator(,) - reserved(struct) ident(re_registers) operator(*\);) -directive(extern) pre_type(int) ident(re_match) operator(()reserved(struct) ident(re_pattern_buffer) operator(*,) directive(const) pre_type(char) operator(*,) pre_type(int)operator(,) pre_type(int)operator(,) - reserved(struct) ident(re_registers) operator(*\);) -directive(extern) directive(void) ident(re_set_casetable) operator(()directive(const) pre_type(char) operator(*)ident(table)operator(\);) -directive(extern) directive(void) ident(re_copy_registers) operator(()reserved(struct) ident(re_registers)operator(*,) reserved(struct) ident(re_registers)operator(*\);) -directive(extern) directive(void) ident(re_free_registers) operator(()reserved(struct) ident(re_registers)operator(*\);) - -preprocessor(#ifndef) ident(RUBY) -comment(/* 4.2 bsd compatibility. */) -directive(extern) pre_type(char) operator(*)ident(re_comp) operator(()directive(const) pre_type(char) operator(*\);) -directive(extern) pre_type(int) ident(re_exec) operator(()directive(const) pre_type(char) operator(*\);) -preprocessor(#endif) - -preprocessor(#else) comment(/* !__STDC__ */) - -directive(extern) pre_type(char) operator(*)ident(re_compile_pattern) operator((\);) -directive(void) ident(re_free_regexp) operator((\);) -comment(/* Is this really advertised? */) -directive(extern) pre_type(int) ident(re_adjust_startpos) operator((\);) -directive(extern) directive(void) ident(re_compile_fastmap) operator((\);) -directive(extern) pre_type(int) ident(re_search) operator((\);) -directive(extern) pre_type(int) ident(re_match) operator((\);) -directive(extern) directive(void) ident(re_set_casetable) operator((\);) -directive(extern) directive(void) ident(re_copy_registers) operator((\);) -directive(extern) directive(void) ident(re_free_registers) operator((\);) - -preprocessor(#endif) comment(/* __STDC__ */) - -preprocessor(#endif) comment(/* !REGEX_H */) -comment(/********************************************************************** - - ruby.h - - - $Author: shyouhei $ - created at: Thu Jun 10 14:26:32 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - Copyright (C\) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C\) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/) - -preprocessor(#ifndef) ident(RUBY_H) -preprocessor(#define) ident(RUBY_H) - -preprocessor(#if) ident(defined)operator(()ident(__cplusplus)operator(\)) -directive(extern) string operator({) -comment(#if 0 -} /* satisfy cc-mode */ -#endif) -preprocessor(#endif) - -preprocessor(#include) include("config.h") -preprocessor(#ifdef) ident(RUBY_EXTCONF_H) -preprocessor(#include) ident(RUBY_EXTCONF_H) -preprocessor(#endif) - -preprocessor(#define) ident(NORETURN_STYLE_NEW) integer(1) -preprocessor(#ifndef) ident(NORETURN) -preprocessor(# define) ident(NORETURN)operator(()ident(x)operator(\)) ident(x) -preprocessor(#endif) -preprocessor(#ifndef) ident(NOINLINE) -preprocessor(# define) ident(NOINLINE)operator(()ident(x)operator(\)) ident(x) -preprocessor(#endif) - -preprocessor(#include) include("defines.h") - -preprocessor(#ifdef) ident(HAVE_STDLIB_H) -preprocessor(# include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_STRING_H) -preprocessor(# include) include() -preprocessor(#else) -preprocessor(# include) include() -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_INTRINSICS_H) -preprocessor(# include) include() -preprocessor(#endif) - -preprocessor(#include) include() -preprocessor(#include) include() - -comment(/* need to include to use these macros */) -preprocessor(#ifndef) ident(ISPRINT) -preprocessor(#define) ident(ISASCII)operator(()ident(c)operator(\)) ident(isascii)operator((()pre_type(int)operator(\)()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)) -preprocessor(#undef) ident(ISPRINT) -preprocessor(#define) ident(ISPRINT)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isprint)operator((()pre_type(int)operator(\)()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)\)) -preprocessor(#define) ident(ISSPACE)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isspace)operator((()pre_type(int)operator(\)()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)\)) -preprocessor(#define) ident(ISUPPER)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isupper)operator((()pre_type(int)operator(\)()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)\)) -preprocessor(#define) ident(ISLOWER)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(islower)operator((()pre_type(int)operator(\)()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)\)) -preprocessor(#define) ident(ISALNUM)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isalnum)operator((()pre_type(int)operator(\)()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)\)) -preprocessor(#define) ident(ISALPHA)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isalpha)operator((()pre_type(int)operator(\)()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)\)) -preprocessor(#define) ident(ISDIGIT)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isdigit)operator((()pre_type(int)operator(\)()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)\)) -preprocessor(#define) ident(ISXDIGIT)operator(()ident(c)operator(\)) operator(()ident(ISASCII)operator(()ident(c)operator(\)) operator(&&) ident(isxdigit)operator((()pre_type(int)operator(\)()pre_type(unsigned) pre_type(char)operator(\)()ident(c)operator(\)\)\)) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_ALLOCA_H)operator(\)) -preprocessor(#include) include() -preprocessor(#else) -preprocessor(# ifdef) ident(_AIX) -preprocessor(#pragma) ident(alloca) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__VMS)operator(\)) -preprocessor(# pragma) ident(builtins) -preprocessor(# define) ident(alloca) ident(__alloca) -preprocessor(#endif) - -preprocessor(#if) ident(SIZEOF_LONG) operator(!=) ident(SIZEOF_VOIDP) -preprocessor(# error) operator(---->>) ident(ruby) ident(requires) reserved(sizeof)operator(()directive(void)operator(*\)) operator(==) reserved(sizeof)operator(()pre_type(long)operator(\)) ident(to) ident(be) ident(compiled)operator(.) operator(<<----) -preprocessor(#else) -reserved(typedef) pre_type(unsigned) pre_type(long) ident(VALUE)operator(;) -reserved(typedef) pre_type(unsigned) pre_type(long) ident(ID)operator(;) -preprocessor(#endif) - -preprocessor(#ifdef) ident(__STDC__) -preprocessor(# include) include() -preprocessor(#else) -preprocessor(# ifndef) ident(LONG_MAX) -preprocessor(# ifdef) ident(HAVE_LIMITS_H) -preprocessor(# include) include() -preprocessor(# else) - comment(/* assuming 32bit(2's compliment\) long */) -preprocessor(# define) ident(LONG_MAX) integer(2147483647) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# ifndef) ident(LONG_MIN) -preprocessor(# define) ident(LONG_MIN) operator((-)ident(LONG_MAX)operator(-)integer(1)operator(\)) -preprocessor(# endif) -preprocessor(# ifndef) ident(CHAR_BIT) -preprocessor(# define) ident(CHAR_BIT) integer(8) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_LONG_LONG) -preprocessor(# ifndef) ident(LLONG_MAX) -preprocessor(# ifdef) ident(LONG_LONG_MAX) -preprocessor(# define) ident(LLONG_MAX) ident(LONG_LONG_MAX) -preprocessor(# else) -preprocessor(# ifdef) ident(_I64_MAX) -preprocessor(# define) ident(LLONG_MAX) ident(_I64_MAX) -preprocessor(# else) - comment(/* assuming 64bit(2's complement\) long long */) -preprocessor(# define) ident(LLONG_MAX) integer(9223372036854775807LL) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# ifndef) ident(LLONG_MIN) -preprocessor(# ifdef) ident(LONG_LONG_MIN) -preprocessor(# define) ident(LLONG_MIN) ident(LONG_LONG_MIN) -preprocessor(# else) -preprocessor(# ifdef) ident(_I64_MIN) -preprocessor(# define) ident(LLONG_MIN) ident(_I64_MIN) -preprocessor(# else) -preprocessor(# define) ident(LLONG_MIN) operator((-)ident(LLONG_MAX)operator(-)integer(1)operator(\)) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(# endif) -preprocessor(#endif) - -preprocessor(#define) ident(FIXNUM_MAX) operator(()ident(LONG_MAX)operator(>>)integer(1)operator(\)) -preprocessor(#define) ident(FIXNUM_MIN) ident(RSHIFT)operator((()pre_type(long)operator(\))ident(LONG_MIN)operator(,)integer(1)operator(\)) - -preprocessor(#define) ident(FIXNUM_FLAG) hex(0x01) -preprocessor(#define) ident(INT2FIX)operator(()ident(i)operator(\)) operator((()ident(VALUE)operator(\)((()pre_type(long)operator(\)()ident(i)operator(\)\)<<)integer(1) operator(|) ident(FIXNUM_FLAG)operator(\)\)) -preprocessor(#define) ident(LONG2FIX)operator(()ident(i)operator(\)) ident(INT2FIX)operator(()ident(i)operator(\)) -preprocessor(#define) ident(rb_fix_new)operator(()ident(v)operator(\)) ident(INT2FIX)operator(()ident(v)operator(\)) -ident(VALUE) ident(rb_int2inum) ident(_)operator((()pre_type(long)operator(\)\);) -preprocessor(#define) ident(INT2NUM)operator(()ident(v)operator(\)) ident(rb_int2inum)operator(()ident(v)operator(\)) -preprocessor(#define) ident(LONG2NUM)operator(()ident(v)operator(\)) ident(INT2NUM)operator(()ident(v)operator(\)) -preprocessor(#define) ident(rb_int_new)operator(()ident(v)operator(\)) ident(rb_int2inum)operator(()ident(v)operator(\)) -ident(VALUE) ident(rb_uint2inum) ident(_)operator((()pre_type(unsigned) pre_type(long)operator(\)\);) -preprocessor(#define) ident(UINT2NUM)operator(()ident(v)operator(\)) ident(rb_uint2inum)operator(()ident(v)operator(\)) -preprocessor(#define) ident(ULONG2NUM)operator(()ident(v)operator(\)) ident(UINT2NUM)operator(()ident(v)operator(\)) -preprocessor(#define) ident(rb_uint_new)operator(()ident(v)operator(\)) ident(rb_uint2inum)operator(()ident(v)operator(\)) - -preprocessor(#ifdef) ident(HAVE_LONG_LONG) -ident(VALUE) ident(rb_ll2inum) ident(_)operator((()ident(LONG_LONG)operator(\)\);) -preprocessor(#define) ident(LL2NUM)operator(()ident(v)operator(\)) ident(rb_ll2inum)operator(()ident(v)operator(\)) -ident(VALUE) ident(rb_ull2inum) ident(_)operator((()pre_type(unsigned) ident(LONG_LONG)operator(\)\);) -preprocessor(#define) ident(ULL2NUM)operator(()ident(v)operator(\)) ident(rb_ull2inum)operator(()ident(v)operator(\)) -preprocessor(#endif) - -preprocessor(#if) ident(SIZEOF_OFF_T) operator(>) ident(SIZEOF_LONG) operator(&&) ident(defined)operator(()ident(HAVE_LONG_LONG)operator(\)) -preprocessor(# define) ident(OFFT2NUM)operator(()ident(v)operator(\)) ident(LL2NUM)operator(()ident(v)operator(\)) -preprocessor(#elif) ident(SIZEOF_OFF_T) operator(==) ident(SIZEOF_LONG) -preprocessor(# define) ident(OFFT2NUM)operator(()ident(v)operator(\)) ident(LONG2NUM)operator(()ident(v)operator(\)) -preprocessor(#else) -preprocessor(# define) ident(OFFT2NUM)operator(()ident(v)operator(\)) ident(INT2NUM)operator(()ident(v)operator(\)) -preprocessor(#endif) - -preprocessor(#define) ident(FIX2LONG)operator(()ident(x)operator(\)) ident(RSHIFT)operator((()pre_type(long)operator(\))ident(x)operator(,)integer(1)operator(\)) -preprocessor(#define) ident(FIX2ULONG)operator(()ident(x)operator(\)) operator(((()pre_type(unsigned) pre_type(long)operator(\)()ident(x)operator(\)\)>>)integer(1)operator(\)) -preprocessor(#define) ident(FIXNUM_P)operator(()ident(f)operator(\)) operator(((()pre_type(long)operator(\)()ident(f)operator(\)\)&)ident(FIXNUM_FLAG)operator(\)) -preprocessor(#define) ident(POSFIXABLE)operator(()ident(f)operator(\)) operator((()ident(f)operator(\)) operator(<) ident(FIXNUM_MAX)operator(+)integer(1)operator(\)) -preprocessor(#define) ident(NEGFIXABLE)operator(()ident(f)operator(\)) operator((()ident(f)operator(\)) operator(>=) ident(FIXNUM_MIN)operator(\)) -preprocessor(#define) ident(FIXABLE)operator(()ident(f)operator(\)) operator(()ident(POSFIXABLE)operator(()ident(f)operator(\)) operator(&&) ident(NEGFIXABLE)operator(()ident(f)operator(\)\)) - -preprocessor(#define) ident(IMMEDIATE_MASK) hex(0x03) -preprocessor(#define) ident(IMMEDIATE_P)operator(()ident(x)operator(\)) operator((()ident(VALUE)operator(\)()ident(x)operator(\)) operator(&) ident(IMMEDIATE_MASK)operator(\)) - -preprocessor(#define) ident(SYMBOL_FLAG) hex(0x0e) -preprocessor(#define) ident(SYMBOL_P)operator(()ident(x)operator(\)) operator(((()ident(VALUE)operator(\)()ident(x)operator(\)&)hex(0xff)operator(\)==)ident(SYMBOL_FLAG)operator(\)) -preprocessor(#define) ident(ID2SYM)operator(()ident(x)operator(\)) operator((()ident(VALUE)operator(\)((()pre_type(long)operator(\)()ident(x)operator(\)\)<<)integer(8)operator(|)ident(SYMBOL_FLAG)operator(\)\)) -preprocessor(#define) ident(SYM2ID)operator(()ident(x)operator(\)) ident(RSHIFT)operator((()pre_type(unsigned) pre_type(long)operator(\))ident(x)operator(,)integer(8)operator(\)) - -comment(/* special contants - i.e. non-zero and non-fixnum constants */) -preprocessor(#define) ident(Qfalse) operator((()ident(VALUE)operator(\))integer(0)operator(\)) -preprocessor(#define) ident(Qtrue) operator((()ident(VALUE)operator(\))integer(2)operator(\)) -preprocessor(#define) ident(Qnil) operator((()ident(VALUE)operator(\))integer(4)operator(\)) -preprocessor(#define) ident(Qundef) operator((()ident(VALUE)operator(\))integer(6)operator(\)) comment(/* undefined value for placeholder */) - -preprocessor(#define) ident(RTEST)operator(()ident(v)operator(\)) operator(((()ident(VALUE)operator(\)()ident(v)operator(\)) operator(&) operator(~)ident(Qnil)operator(\)) operator(!=) integer(0)operator(\)) -preprocessor(#define) ident(NIL_P)operator(()ident(v)operator(\)) operator((()ident(VALUE)operator(\)()ident(v)operator(\)) operator(==) ident(Qnil)operator(\)) - -preprocessor(#define) ident(CLASS_OF)operator(()ident(v)operator(\)) ident(rb_class_of)operator((()ident(VALUE)operator(\)()ident(v)operator(\)\)) - -preprocessor(#define) ident(T_NONE) hex(0x00) - -preprocessor(#define) ident(T_NIL) hex(0x01) -preprocessor(#define) ident(T_OBJECT) hex(0x02) -preprocessor(#define) ident(T_CLASS) hex(0x03) -preprocessor(#define) ident(T_ICLASS) hex(0x04) -preprocessor(#define) ident(T_MODULE) hex(0x05) -preprocessor(#define) ident(T_FLOAT) hex(0x06) -preprocessor(#define) ident(T_STRING) hex(0x07) -preprocessor(#define) ident(T_REGEXP) hex(0x08) -preprocessor(#define) ident(T_ARRAY) hex(0x09) -preprocessor(#define) ident(T_FIXNUM) hex(0x0a) -preprocessor(#define) ident(T_HASH) hex(0x0b) -preprocessor(#define) ident(T_STRUCT) hex(0x0c) -preprocessor(#define) ident(T_BIGNUM) hex(0x0d) -preprocessor(#define) ident(T_FILE) hex(0x0e) - -preprocessor(#define) ident(T_TRUE) hex(0x20) -preprocessor(#define) ident(T_FALSE) hex(0x21) -preprocessor(#define) ident(T_DATA) hex(0x22) -preprocessor(#define) ident(T_MATCH) hex(0x23) -preprocessor(#define) ident(T_SYMBOL) hex(0x24) - -preprocessor(#define) ident(T_BLKTAG) hex(0x3b) -preprocessor(#define) ident(T_UNDEF) hex(0x3c) -preprocessor(#define) ident(T_VARMAP) hex(0x3d) -preprocessor(#define) ident(T_SCOPE) hex(0x3e) -preprocessor(#define) ident(T_NODE) hex(0x3f) - -preprocessor(#define) ident(T_MASK) hex(0x3f) - -preprocessor(#define) ident(BUILTIN_TYPE)operator(()ident(x)operator(\)) operator(((()reserved(struct) ident(RBasic)operator(*\)()ident(x)operator(\)\)->)ident(flags) operator(&) ident(T_MASK)operator(\)) - -preprocessor(#define) ident(TYPE)operator(()ident(x)operator(\)) ident(rb_type)operator((()ident(VALUE)operator(\)()ident(x)operator(\)\)) - -directive(void) ident(rb_check_type) ident(_)operator((()ident(VALUE)operator(,)pre_type(int)operator(\)\);) -preprocessor(#define) ident(Check_Type)operator(()ident(v)operator(,)ident(t)operator(\)) ident(rb_check_type)operator((()ident(VALUE)operator(\)()ident(v)operator(\),)ident(t)operator(\)) - -ident(VALUE) ident(rb_str_to_str) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_string_value) ident(_)operator((()directive(volatile) ident(VALUE)operator(*\)\);) -pre_type(char) operator(*)ident(rb_string_value_ptr) ident(_)operator((()directive(volatile) ident(VALUE)operator(*\)\);) -pre_type(char) operator(*)ident(rb_string_value_cstr) ident(_)operator((()directive(volatile) ident(VALUE)operator(*\)\);) - -preprocessor(#define) ident(StringValue)operator(()ident(v)operator(\)) ident(rb_string_value)operator((&()ident(v)operator(\)\)) -preprocessor(#define) ident(StringValuePtr)operator(()ident(v)operator(\)) ident(rb_string_value_ptr)operator((&()ident(v)operator(\)\)) -preprocessor(#define) ident(StringValueCStr)operator(()ident(v)operator(\)) ident(rb_string_value_cstr)operator((&()ident(v)operator(\)\)) - -directive(void) ident(rb_check_safe_obj) ident(_)operator((()ident(VALUE)operator(\)\);) -directive(void) ident(rb_check_safe_str) ident(_)operator((()ident(VALUE)operator(\)\);) -preprocessor(#define) ident(SafeStringValue)operator(()ident(v)operator(\)) reserved(do) operator({)\ - ident(StringValue)operator(()ident(v)operator(\);)\ - ident(rb_check_safe_obj)operator(()ident(v)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) -comment(/* obsolete macro - use SafeStringValue(v\) */) -preprocessor(#define) ident(Check_SafeStr)operator(()ident(v)operator(\)) ident(rb_check_safe_str)operator((()ident(VALUE)operator(\)()ident(v)operator(\)\)) - -directive(void) ident(rb_secure) ident(_)operator((()pre_type(int)operator(\)\);) -ident(RUBY_EXTERN) pre_type(int) ident(ruby_safe_level)operator(;) -preprocessor(#define) ident(rb_safe_level)operator((\)) operator(()ident(ruby_safe_level)operator(\)) -directive(void) ident(rb_set_safe_level) ident(_)operator((()pre_type(int)operator(\)\);) -directive(void) ident(rb_secure_update) ident(_)operator((()ident(VALUE)operator(\)\);) - -pre_type(long) ident(rb_num2long) ident(_)operator((()ident(VALUE)operator(\)\);) -pre_type(unsigned) pre_type(long) ident(rb_num2ulong) ident(_)operator((()ident(VALUE)operator(\)\);) -preprocessor(#define) ident(NUM2LONG)operator(()ident(x)operator(\)) operator(()ident(FIXNUM_P)operator(()ident(x)operator(\)?)ident(FIX2LONG)operator(()ident(x)operator(\):)ident(rb_num2long)operator((()ident(VALUE)operator(\))ident(x)operator(\)\)) -preprocessor(#define) ident(NUM2ULONG)operator(()ident(x)operator(\)) ident(rb_num2ulong)operator((()ident(VALUE)operator(\))ident(x)operator(\)) -preprocessor(#if) ident(SIZEOF_INT) operator(<) ident(SIZEOF_LONG) -pre_type(long) ident(rb_num2int) ident(_)operator((()ident(VALUE)operator(\)\);) -preprocessor(#define) ident(NUM2INT)operator(()ident(x)operator(\)) operator(()ident(FIXNUM_P)operator(()ident(x)operator(\)?)ident(FIX2INT)operator(()ident(x)operator(\):)ident(rb_num2int)operator((()ident(VALUE)operator(\))ident(x)operator(\)\)) -pre_type(long) ident(rb_fix2int) ident(_)operator((()ident(VALUE)operator(\)\);) -preprocessor(#define) ident(FIX2INT)operator(()ident(x)operator(\)) ident(rb_fix2int)operator((()ident(VALUE)operator(\))ident(x)operator(\)) -pre_type(unsigned) pre_type(long) ident(rb_num2uint) ident(_)operator((()ident(VALUE)operator(\)\);) -preprocessor(#define) ident(NUM2UINT)operator(()ident(x)operator(\)) ident(rb_num2uint)operator(()ident(x)operator(\)) -pre_type(unsigned) pre_type(long) ident(rb_fix2uint) ident(_)operator((()ident(VALUE)operator(\)\);) -preprocessor(#define) ident(FIX2UINT)operator(()ident(x)operator(\)) ident(rb_fix2uint)operator(()ident(x)operator(\)) -preprocessor(#else) -preprocessor(#define) ident(NUM2INT)operator(()ident(x)operator(\)) operator((()pre_type(int)operator(\))ident(NUM2LONG)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(NUM2UINT)operator(()ident(x)operator(\)) operator((()pre_type(unsigned) pre_type(int)operator(\))ident(NUM2ULONG)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(FIX2INT)operator(()ident(x)operator(\)) operator((()pre_type(int)operator(\))ident(FIX2LONG)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(FIX2UINT)operator(()ident(x)operator(\)) operator((()pre_type(unsigned) pre_type(int)operator(\))ident(FIX2ULONG)operator(()ident(x)operator(\)\)) -preprocessor(#endif) - -preprocessor(#ifdef) ident(HAVE_LONG_LONG) -ident(LONG_LONG) ident(rb_num2ll) ident(_)operator((()ident(VALUE)operator(\)\);) -pre_type(unsigned) ident(LONG_LONG) ident(rb_num2ull) ident(_)operator((()ident(VALUE)operator(\)\);) -preprocessor(# define) ident(NUM2LL)operator(()ident(x)operator(\)) operator(()ident(FIXNUM_P)operator(()ident(x)operator(\)?)ident(FIX2LONG)operator(()ident(x)operator(\):)ident(rb_num2ll)operator((()ident(VALUE)operator(\))ident(x)operator(\)\)) -preprocessor(# define) ident(NUM2ULL)operator(()ident(x)operator(\)) ident(rb_num2ull)operator((()ident(VALUE)operator(\))ident(x)operator(\)) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_LONG_LONG)operator(\)) operator(&&) ident(SIZEOF_OFF_T) operator(>) ident(SIZEOF_LONG) -preprocessor(# define) ident(NUM2OFFT)operator(()ident(x)operator(\)) operator((()ident(off_t)operator(\))ident(NUM2LL)operator(()ident(x)operator(\)\)) -preprocessor(#else) -preprocessor(# define) ident(NUM2OFFT)operator(()ident(x)operator(\)) ident(NUM2LONG)operator(()ident(x)operator(\)) -preprocessor(#endif) - -pre_type(double) ident(rb_num2dbl) ident(_)operator((()ident(VALUE)operator(\)\);) -preprocessor(#define) ident(NUM2DBL)operator(()ident(x)operator(\)) ident(rb_num2dbl)operator((()ident(VALUE)operator(\)()ident(x)operator(\)\)) - -comment(/* obsolete API - use StringValue(\) */) -pre_type(char) operator(*)ident(rb_str2cstr) ident(_)operator((()ident(VALUE)operator(,)pre_type(long)operator(*\)\);) -comment(/* obsolete API - use StringValuePtr(\) */) -preprocessor(#define) ident(STR2CSTR)operator(()ident(x)operator(\)) ident(rb_str2cstr)operator((()ident(VALUE)operator(\)()ident(x)operator(\),)integer(0)operator(\)) - -preprocessor(#define) ident(NUM2CHR)operator(()ident(x)operator(\)) operator(((()ident(TYPE)operator(()ident(x)operator(\)) operator(==) ident(T_STRING)operator(\)&&()ident(RSTRING)operator(()ident(x)operator(\)->)ident(len)operator(>=)integer(1)operator(\)\)?)\ - ident(RSTRING)operator(()ident(x)operator(\)->)ident(ptr)operator([)integer(0)operator(]:()pre_type(char)operator(\)()ident(NUM2INT)operator(()ident(x)operator(\)&)hex(0xff)operator(\)\)) -preprocessor(#define) ident(CHR2FIX)operator(()ident(x)operator(\)) ident(INT2FIX)operator((()pre_type(long)operator(\)(()ident(x)operator(\)&)hex(0xff)operator(\)\)) - -ident(VALUE) ident(rb_newobj) ident(_)operator((()directive(void)operator(\)\);) -preprocessor(#define) ident(NEWOBJ)operator(()ident(obj)operator(,)ident(type)operator(\)) ident(type) operator(*)ident(obj) operator(=) operator(()ident(type)operator(*\))ident(rb_newobj)operator((\)) -preprocessor(#define) ident(OBJSETUP)operator(()ident(obj)operator(,)ident(c)operator(,)ident(t)operator(\)) reserved(do) operator({)\ - ident(RBASIC)operator(()ident(obj)operator(\)->)ident(flags) operator(=) operator(()ident(t)operator(\);)\ - ident(RBASIC)operator(()ident(obj)operator(\)->)ident(klass) operator(=) operator(()ident(c)operator(\);)\ - reserved(if) operator(()ident(rb_safe_level)operator((\)) operator(>=) integer(3)operator(\)) ident(FL_SET)operator(()ident(obj)operator(,) ident(FL_TAINT)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#define) ident(CLONESETUP)operator(()ident(clone)operator(,)ident(obj)operator(\)) reserved(do) operator({)\ - ident(OBJSETUP)operator(()ident(clone)operator(,)ident(rb_singleton_class_clone)operator((()ident(VALUE)operator(\))ident(obj)operator(\),)ident(RBASIC)operator(()ident(obj)operator(\)->)ident(flags)operator(\);)\ - ident(rb_singleton_class_attached)operator(()ident(RBASIC)operator(()ident(clone)operator(\)->)ident(klass)operator(,) operator(()ident(VALUE)operator(\))ident(clone)operator(\);)\ - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_EXIVAR)operator(\)\)) ident(rb_copy_generic_ivar)operator((()ident(VALUE)operator(\))ident(clone)operator(,()ident(VALUE)operator(\))ident(obj)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#define) ident(DUPSETUP)operator(()ident(dup)operator(,)ident(obj)operator(\)) reserved(do) operator({)\ - ident(OBJSETUP)operator(()ident(dup)operator(,)ident(rb_obj_class)operator(()ident(obj)operator(\),()ident(RBASIC)operator(()ident(obj)operator(\)->)ident(flags)operator(\)&()ident(T_MASK)operator(|)ident(FL_EXIVAR)operator(|)ident(FL_TAINT)operator(\)\);)\ - reserved(if) operator(()ident(FL_TEST)operator(()ident(obj)operator(,) ident(FL_EXIVAR)operator(\)\)) ident(rb_copy_generic_ivar)operator((()ident(VALUE)operator(\))ident(dup)operator(,()ident(VALUE)operator(\))ident(obj)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -reserved(struct) ident(RBasic) operator({) - pre_type(unsigned) pre_type(long) ident(flags)operator(;) - ident(VALUE) ident(klass)operator(;) -operator(};) - -reserved(struct) ident(RObject) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - reserved(struct) ident(st_table) operator(*)ident(iv_tbl)operator(;) -operator(};) - -reserved(struct) ident(RClass) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - reserved(struct) ident(st_table) operator(*)ident(iv_tbl)operator(;) - reserved(struct) ident(st_table) operator(*)ident(m_tbl)operator(;) - ident(VALUE) ident(super)operator(;) -operator(};) - -reserved(struct) ident(RFloat) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - pre_type(double) ident(value)operator(;) -operator(};) - -preprocessor(#define) ident(ELTS_SHARED) ident(FL_USER2) - -reserved(struct) ident(RString) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - pre_type(long) ident(len)operator(;) - pre_type(char) operator(*)ident(ptr)operator(;) - reserved(union) operator({) - pre_type(long) ident(capa)operator(;) - ident(VALUE) ident(shared)operator(;) - operator(}) ident(aux)operator(;) -operator(};) -preprocessor(#define) ident(RSTRING_PTR)operator(()ident(s)operator(\)) operator(()ident(RSTRING)operator(()ident(s)operator(\)->)ident(ptr)operator(\)) -preprocessor(#define) ident(RSTRING_LEN)operator(()ident(s)operator(\)) operator(()ident(RSTRING)operator(()ident(s)operator(\)->)ident(len)operator(\)) - -reserved(struct) ident(RArray) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - pre_type(long) ident(len)operator(;) - reserved(union) operator({) - pre_type(long) ident(capa)operator(;) - ident(VALUE) ident(shared)operator(;) - operator(}) ident(aux)operator(;) - ident(VALUE) operator(*)ident(ptr)operator(;) -operator(};) -preprocessor(#define) ident(RARRAY_PTR)operator(()ident(s)operator(\)) operator(()ident(RARRAY)operator(()ident(s)operator(\)->)ident(ptr)operator(\)) -preprocessor(#define) ident(RARRAY_LEN)operator(()ident(s)operator(\)) operator(()ident(RARRAY)operator(()ident(s)operator(\)->)ident(len)operator(\)) - -reserved(struct) ident(RRegexp) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - reserved(struct) ident(re_pattern_buffer) operator(*)ident(ptr)operator(;) - pre_type(long) ident(len)operator(;) - pre_type(char) operator(*)ident(str)operator(;) -operator(};) - -reserved(struct) ident(RHash) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - reserved(struct) ident(st_table) operator(*)ident(tbl)operator(;) - pre_type(int) ident(iter_lev)operator(;) - ident(VALUE) ident(ifnone)operator(;) -operator(};) - -reserved(struct) ident(RFile) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - reserved(struct) ident(OpenFile) operator(*)ident(fptr)operator(;) -operator(};) - -reserved(struct) ident(RData) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - directive(void) operator((*)ident(dmark)operator(\)) ident(_)operator((()directive(void)operator(*\)\);) - directive(void) operator((*)ident(dfree)operator(\)) ident(_)operator((()directive(void)operator(*\)\);) - directive(void) operator(*)ident(data)operator(;) -operator(};) - -preprocessor(#define) ident(DATA_PTR)operator(()ident(dta)operator(\)) operator(()ident(RDATA)operator(()ident(dta)operator(\)->)ident(data)operator(\)) - -comment(/* -#define RUBY_DATA_FUNC(func\) ((void (*\)_((void*\)\)\)func\) -*/) -reserved(typedef) directive(void) operator((*)ident(RUBY_DATA_FUNC)operator(\)) ident(_)operator((()directive(void)operator(*\)\);) - -ident(VALUE) ident(rb_data_object_alloc) ident(_)operator((()ident(VALUE)operator(,)directive(void)operator(*,)ident(RUBY_DATA_FUNC)operator(,)ident(RUBY_DATA_FUNC)operator(\)\);) - -preprocessor(#define) ident(Data_Wrap_Struct)operator(()ident(klass)operator(,)ident(mark)operator(,)ident(free)operator(,)ident(sval)operator(\))\ - ident(rb_data_object_alloc)operator(()ident(klass)operator(,)ident(sval)operator(,()ident(RUBY_DATA_FUNC)operator(\))ident(mark)operator(,()ident(RUBY_DATA_FUNC)operator(\))ident(free)operator(\)) - -preprocessor(#define) ident(Data_Make_Struct)operator(()ident(klass)operator(,)ident(type)operator(,)ident(mark)operator(,)ident(free)operator(,)ident(sval)operator(\)) operator(()\ - ident(sval) operator(=) ident(ALLOC)operator(()ident(type)operator(\),)\ - ident(memset)operator(()ident(sval)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(type)operator(\)\),)\ - ident(Data_Wrap_Struct)operator(()ident(klass)operator(,)ident(mark)operator(,)ident(free)operator(,)ident(sval)operator(\))\ -operator(\)) - -preprocessor(#define) ident(Data_Get_Struct)operator(()ident(obj)operator(,)ident(type)operator(,)ident(sval)operator(\)) reserved(do) operator({)\ - ident(Check_Type)operator(()ident(obj)operator(,) ident(T_DATA)operator(\);) \ - ident(sval) operator(=) operator(()ident(type)operator(*\))ident(DATA_PTR)operator(()ident(obj)operator(\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -reserved(struct) ident(RStruct) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - pre_type(long) ident(len)operator(;) - ident(VALUE) operator(*)ident(ptr)operator(;) -operator(};) -preprocessor(#define) ident(RSTRUCT_LEN)operator(()ident(st)operator(\)) operator(()ident(RSTRUCT)operator(()ident(st)operator(\)->)ident(len)operator(\)) -preprocessor(#define) ident(RSTRUCT_PTR)operator(()ident(st)operator(\)) operator(()ident(RSTRUCT)operator(()ident(st)operator(\)->)ident(ptr)operator(\)) - -reserved(struct) ident(RBignum) operator({) - reserved(struct) ident(RBasic) ident(basic)operator(;) - pre_type(char) ident(sign)operator(;) - pre_type(long) ident(len)operator(;) - directive(void) operator(*)ident(digits)operator(;) -operator(};) - -preprocessor(#define) ident(R_CAST)operator(()ident(st)operator(\)) operator(()reserved(struct) ident(st)operator(*\)) -preprocessor(#define) ident(RBASIC)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RBasic)operator(\)()ident(obj)operator(\)\)) -preprocessor(#define) ident(ROBJECT)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RObject)operator(\)()ident(obj)operator(\)\)) -preprocessor(#define) ident(RCLASS)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RClass)operator(\)()ident(obj)operator(\)\)) -preprocessor(#define) ident(RMODULE)operator(()ident(obj)operator(\)) ident(RCLASS)operator(()ident(obj)operator(\)) -preprocessor(#define) ident(RFLOAT)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RFloat)operator(\)()ident(obj)operator(\)\)) -preprocessor(#define) ident(RSTRING)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RString)operator(\)()ident(obj)operator(\)\)) -preprocessor(#define) ident(RREGEXP)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RRegexp)operator(\)()ident(obj)operator(\)\)) -preprocessor(#define) ident(RARRAY)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RArray)operator(\)()ident(obj)operator(\)\)) -preprocessor(#define) ident(RHASH)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RHash)operator(\)()ident(obj)operator(\)\)) -preprocessor(#define) ident(RDATA)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RData)operator(\)()ident(obj)operator(\)\)) -preprocessor(#define) ident(RSTRUCT)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RStruct)operator(\)()ident(obj)operator(\)\)) -preprocessor(#define) ident(RBIGNUM)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RBignum)operator(\)()ident(obj)operator(\)\)) -preprocessor(#define) ident(RFILE)operator(()ident(obj)operator(\)) operator(()ident(R_CAST)operator(()ident(RFile)operator(\)()ident(obj)operator(\)\)) - -preprocessor(#define) ident(FL_SINGLETON) ident(FL_USER0) -preprocessor(#define) ident(FL_MARK) operator(()integer(1)operator(<<)integer(6)operator(\)) -preprocessor(#define) ident(FL_FINALIZE) operator(()integer(1)operator(<<)integer(7)operator(\)) -preprocessor(#define) ident(FL_TAINT) operator(()integer(1)operator(<<)integer(8)operator(\)) -preprocessor(#define) ident(FL_EXIVAR) operator(()integer(1)operator(<<)integer(9)operator(\)) -preprocessor(#define) ident(FL_FREEZE) operator(()integer(1)operator(<<)integer(10)operator(\)) - -preprocessor(#define) ident(FL_USHIFT) integer(11) - -preprocessor(#define) ident(FL_USER0) operator(()integer(1)operator(<<()ident(FL_USHIFT)operator(+)integer(0)operator(\)\)) -preprocessor(#define) ident(FL_USER1) operator(()integer(1)operator(<<()ident(FL_USHIFT)operator(+)integer(1)operator(\)\)) -preprocessor(#define) ident(FL_USER2) operator(()integer(1)operator(<<()ident(FL_USHIFT)operator(+)integer(2)operator(\)\)) -preprocessor(#define) ident(FL_USER3) operator(()integer(1)operator(<<()ident(FL_USHIFT)operator(+)integer(3)operator(\)\)) -preprocessor(#define) ident(FL_USER4) operator(()integer(1)operator(<<()ident(FL_USHIFT)operator(+)integer(4)operator(\)\)) -preprocessor(#define) ident(FL_USER5) operator(()integer(1)operator(<<()ident(FL_USHIFT)operator(+)integer(5)operator(\)\)) -preprocessor(#define) ident(FL_USER6) operator(()integer(1)operator(<<()ident(FL_USHIFT)operator(+)integer(6)operator(\)\)) -preprocessor(#define) ident(FL_USER7) operator(()integer(1)operator(<<()ident(FL_USHIFT)operator(+)integer(7)operator(\)\)) - -preprocessor(#define) ident(FL_UMASK) operator(()hex(0xff)operator(<<)ident(FL_USHIFT)operator(\)) - -preprocessor(#define) ident(SPECIAL_CONST_P)operator(()ident(x)operator(\)) operator(()ident(IMMEDIATE_P)operator(()ident(x)operator(\)) operator(||) operator(!)ident(RTEST)operator(()ident(x)operator(\)\)) - -preprocessor(#define) ident(FL_ABLE)operator(()ident(x)operator(\)) operator((!)ident(SPECIAL_CONST_P)operator(()ident(x)operator(\)\)) -preprocessor(#define) ident(FL_TEST)operator(()ident(x)operator(,)ident(f)operator(\)) operator(()ident(FL_ABLE)operator(()ident(x)operator(\)?()ident(RBASIC)operator(()ident(x)operator(\)->)ident(flags)operator(&()ident(f)operator(\)\):)integer(0)operator(\)) -preprocessor(#define) ident(FL_SET)operator(()ident(x)operator(,)ident(f)operator(\)) reserved(do) operator({)reserved(if) operator(()ident(FL_ABLE)operator(()ident(x)operator(\)\)) ident(RBASIC)operator(()ident(x)operator(\)->)ident(flags) operator(|=) operator(()ident(f)operator(\);}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#define) ident(FL_UNSET)operator(()ident(x)operator(,)ident(f)operator(\)) reserved(do) operator({)reserved(if) operator(()ident(FL_ABLE)operator(()ident(x)operator(\)\)) ident(RBASIC)operator(()ident(x)operator(\)->)ident(flags) operator(&=) operator(~()ident(f)operator(\);}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#define) ident(FL_REVERSE)operator(()ident(x)operator(,)ident(f)operator(\)) reserved(do) operator({)reserved(if) operator(()ident(FL_ABLE)operator(()ident(x)operator(\)\)) ident(RBASIC)operator(()ident(x)operator(\)->)ident(flags) operator(^=) operator(()ident(f)operator(\);}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(OBJ_TAINTED)operator(()ident(x)operator(\)) ident(FL_TEST)operator((()ident(x)operator(\),) ident(FL_TAINT)operator(\)) -preprocessor(#define) ident(OBJ_TAINT)operator(()ident(x)operator(\)) ident(FL_SET)operator((()ident(x)operator(\),) ident(FL_TAINT)operator(\)) -preprocessor(#define) ident(OBJ_INFECT)operator(()ident(x)operator(,)ident(s)operator(\)) reserved(do) operator({)reserved(if) operator(()ident(FL_ABLE)operator(()ident(x)operator(\)) operator(&&) ident(FL_ABLE)operator(()ident(s)operator(\)\)) ident(RBASIC)operator(()ident(x)operator(\)->)ident(flags) operator(|=) ident(RBASIC)operator(()ident(s)operator(\)->)ident(flags) operator(&) ident(FL_TAINT)operator(;}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(OBJ_FROZEN)operator(()ident(x)operator(\)) ident(FL_TEST)operator((()ident(x)operator(\),) ident(FL_FREEZE)operator(\)) -preprocessor(#define) ident(OBJ_FREEZE)operator(()ident(x)operator(\)) ident(FL_SET)operator((()ident(x)operator(\),) ident(FL_FREEZE)operator(\)) - -preprocessor(#define) ident(ALLOC_N)operator(()ident(type)operator(,)ident(n)operator(\)) operator(()ident(type)operator(*\))ident(xmalloc)operator(()reserved(sizeof)operator(()ident(type)operator(\)*()ident(n)operator(\)\)) -preprocessor(#define) ident(ALLOC)operator(()ident(type)operator(\)) operator(()ident(type)operator(*\))ident(xmalloc)operator(()reserved(sizeof)operator(()ident(type)operator(\)\)) -preprocessor(#define) ident(REALLOC_N)operator(()ident(var)operator(,)ident(type)operator(,)ident(n)operator(\)) operator(()ident(var)operator(\)=()ident(type)operator(*\))ident(xrealloc)operator((()pre_type(char)operator(*\)()ident(var)operator(\),)reserved(sizeof)operator(()ident(type)operator(\)*()ident(n)operator(\)\)) - -preprocessor(#define) ident(ALLOCA_N)operator(()ident(type)operator(,)ident(n)operator(\)) operator(()ident(type)operator(*\))ident(alloca)operator(()reserved(sizeof)operator(()ident(type)operator(\)*()ident(n)operator(\)\)) - -preprocessor(#define) ident(MEMZERO)operator(()ident(p)operator(,)ident(type)operator(,)ident(n)operator(\)) ident(memset)operator((()ident(p)operator(\),) integer(0)operator(,) reserved(sizeof)operator(()ident(type)operator(\)*()ident(n)operator(\)\)) -preprocessor(#define) ident(MEMCPY)operator(()ident(p1)operator(,)ident(p2)operator(,)ident(type)operator(,)ident(n)operator(\)) ident(memcpy)operator((()ident(p1)operator(\),) operator(()ident(p2)operator(\),) reserved(sizeof)operator(()ident(type)operator(\)*()ident(n)operator(\)\)) -preprocessor(#define) ident(MEMMOVE)operator(()ident(p1)operator(,)ident(p2)operator(,)ident(type)operator(,)ident(n)operator(\)) ident(memmove)operator((()ident(p1)operator(\),) operator(()ident(p2)operator(\),) reserved(sizeof)operator(()ident(type)operator(\)*()ident(n)operator(\)\)) -preprocessor(#define) ident(MEMCMP)operator(()ident(p1)operator(,)ident(p2)operator(,)ident(type)operator(,)ident(n)operator(\)) ident(memcmp)operator((()ident(p1)operator(\),) operator(()ident(p2)operator(\),) reserved(sizeof)operator(()ident(type)operator(\)*()ident(n)operator(\)\)) - -directive(void) ident(rb_obj_infect) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) - -reserved(typedef) pre_type(int) ident(ruby_glob_func)operator(()directive(const) pre_type(char)operator(*,)ident(VALUE)operator(\);) -directive(void) ident(rb_glob) ident(_)operator((()directive(const) pre_type(char)operator(*,)directive(void)operator((*\)()directive(const) pre_type(char)operator(*,)ident(VALUE)operator(\),)ident(VALUE)operator(\)\);) -directive(void) ident(rb_globi) ident(_)operator((()directive(const) pre_type(char)operator(*,)directive(void)operator((*\)()directive(const) pre_type(char)operator(*,)ident(VALUE)operator(\),)ident(VALUE)operator(\)\);) -pre_type(int) ident(ruby_brace_expand) ident(_)operator((()directive(const) pre_type(char)operator(*,)pre_type(int)operator(,)ident(ruby_glob_func)operator(*,)ident(VALUE)operator(\)\);) -pre_type(int) ident(ruby_brace_glob) ident(_)operator((()directive(const) pre_type(char)operator(*,)pre_type(int)operator(,)ident(ruby_glob_func)operator(*,)ident(VALUE)operator(\)\);) - -ident(VALUE) ident(rb_define_class) ident(_)operator((()directive(const) pre_type(char)operator(*,)ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_define_module) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_define_class_under) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_define_module_under) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*\)\);) - -directive(void) ident(rb_include_module) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) -directive(void) ident(rb_extend_object) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) - -directive(void) ident(rb_define_variable) ident(_)operator((()directive(const) pre_type(char)operator(*,)ident(VALUE)operator(*\)\);) -directive(void) ident(rb_define_virtual_variable) ident(_)operator((()directive(const) pre_type(char)operator(*,)ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)directive(void)operator((*\)()ident(ANYARGS)operator(\)\)\);) -directive(void) ident(rb_define_hooked_variable) ident(_)operator((()directive(const) pre_type(char)operator(*,)ident(VALUE)operator(*,)ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)directive(void)operator((*\)()ident(ANYARGS)operator(\)\)\);) -pre_type(int) ident(ruby_glob) ident(_)operator((()directive(const) pre_type(char)operator(*,)pre_type(int)operator(,)pre_type(int)operator((*\)()directive(const) pre_type(char)operator(*,)ident(VALUE)operator(\),)ident(VALUE)operator(\)\);) -pre_type(int) ident(ruby_globi) ident(_)operator((()directive(const) pre_type(char)operator(*,)pre_type(int)operator(,)pre_type(int)operator((*\)()directive(const) pre_type(char)operator(*,)ident(VALUE)operator(\),)ident(VALUE)operator(\)\);) -directive(void) ident(rb_define_readonly_variable) ident(_)operator((()directive(const) pre_type(char)operator(*,)ident(VALUE)operator(*\)\);) -directive(void) ident(rb_define_const) ident(_)operator((()ident(VALUE)operator(,)directive(const) pre_type(char)operator(*,)ident(VALUE)operator(\)\);) -directive(void) ident(rb_define_global_const) ident(_)operator((()directive(const) pre_type(char)operator(*,)ident(VALUE)operator(\)\);) - -preprocessor(#define) ident(RUBY_METHOD_FUNC)operator(()ident(func)operator(\)) operator((()ident(VALUE) operator((*\)()ident(ANYARGS)operator(\)\))ident(func)operator(\)) -directive(void) ident(rb_define_method) ident(_)operator((()ident(VALUE)operator(,)directive(const) pre_type(char)operator(*,)ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)pre_type(int)operator(\)\);) -directive(void) ident(rb_define_module_function) ident(_)operator((()ident(VALUE)operator(,)directive(const) pre_type(char)operator(*,)ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)pre_type(int)operator(\)\);) -directive(void) ident(rb_define_global_function) ident(_)operator((()directive(const) pre_type(char)operator(*,)ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)pre_type(int)operator(\)\);) - -directive(void) ident(rb_undef_method) ident(_)operator((()ident(VALUE)operator(,)directive(const) pre_type(char)operator(*\)\);) -directive(void) ident(rb_define_alias) ident(_)operator((()ident(VALUE)operator(,)directive(const) pre_type(char)operator(*,)directive(const) pre_type(char)operator(*\)\);) -directive(void) ident(rb_define_attr) ident(_)operator((()ident(VALUE)operator(,)directive(const) pre_type(char)operator(*,)pre_type(int)operator(,)pre_type(int)operator(\)\);) - -directive(void) ident(rb_global_variable) ident(_)operator((()ident(VALUE)operator(*\)\);) -directive(void) ident(rb_gc_register_address) ident(_)operator((()ident(VALUE)operator(*\)\);) -directive(void) ident(rb_gc_unregister_address) ident(_)operator((()ident(VALUE)operator(*\)\);) - -ident(ID) ident(rb_intern) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -pre_type(char) operator(*)ident(rb_id2name) ident(_)operator((()ident(ID)operator(\)\);) -ident(ID) ident(rb_to_id) ident(_)operator((()ident(VALUE)operator(\)\);) - -pre_type(char) operator(*)ident(rb_class2name) ident(_)operator((()ident(VALUE)operator(\)\);) -pre_type(char) operator(*)ident(rb_obj_classname) ident(_)operator((()ident(VALUE)operator(\)\);) - -directive(void) ident(rb_p) ident(_)operator((()ident(VALUE)operator(\)\);) - -ident(VALUE) ident(rb_eval_string) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_eval_string_protect) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(int)operator(*\)\);) -ident(VALUE) ident(rb_eval_string_wrap) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(int)operator(*\)\);) -ident(VALUE) ident(rb_funcall) ident(__)operator((()ident(VALUE)operator(,) ident(ID)operator(,) pre_type(int)operator(,) operator(.)operator(.)operator(.)operator(\)\);) -ident(VALUE) ident(rb_funcall2) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) pre_type(int)operator(,) directive(const) ident(VALUE)operator(*\)\);) -ident(VALUE) ident(rb_funcall3) ident(_)operator((()ident(VALUE)operator(,) ident(ID)operator(,) pre_type(int)operator(,) directive(const) ident(VALUE)operator(*\)\);) -pre_type(int) ident(rb_scan_args) ident(__)operator((()pre_type(int)operator(,) directive(const) ident(VALUE)operator(*,) directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\);) -ident(VALUE) ident(rb_call_super) ident(_)operator((()pre_type(int)operator(,) directive(const) ident(VALUE)operator(*\)\);) - -ident(VALUE) ident(rb_gv_set) ident(_)operator((()directive(const) pre_type(char)operator(*,) ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_gv_get) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_iv_get) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*\)\);) -ident(VALUE) ident(rb_iv_set) ident(_)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) ident(VALUE)operator(\)\);) - -ident(VALUE) ident(rb_equal) ident(_)operator((()ident(VALUE)operator(,)ident(VALUE)operator(\)\);) - -ident(RUBY_EXTERN) ident(VALUE) ident(ruby_verbose)operator(,) ident(ruby_debug)operator(;) - -ident(NORETURN)operator(()directive(void) ident(rb_raise) ident(__)operator((()ident(VALUE)operator(,) directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_fatal) ident(__)operator((()directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_bug) ident(__)operator((()directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_sys_fail) ident(_)operator((()directive(const) pre_type(char)operator(*\)\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_iter_break) ident(_)operator((()directive(void)operator(\)\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_exit) ident(_)operator((()pre_type(int)operator(\)\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_notimplement) ident(_)operator((()directive(void)operator(\)\)\);) - -directive(void) ident(rb_warning) ident(__)operator((()directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\);) comment(/* reports if `-w' specified */) -directive(void) ident(rb_sys_warning) ident(__)operator((()directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\);) comment(/* reports if `-w' specified */) -directive(void) ident(rb_warn) ident(__)operator((()directive(const) pre_type(char)operator(*,) operator(.)operator(.)operator(.)operator(\)\);) comment(/* reports always */) - -ident(VALUE) ident(rb_each) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_yield) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_yield_values) ident(__)operator((()pre_type(int) ident(n)operator(,) operator(.)operator(.)operator(.)operator(\)\);) -ident(VALUE) ident(rb_yield_splat) ident(_)operator((()ident(VALUE)operator(\)\);) -pre_type(int) ident(rb_block_given_p) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(rb_need_block) ident(_)operator((()directive(void)operator(\)\);) -ident(VALUE) ident(rb_iterate) ident(_)operator((()ident(VALUE)operator((*\)()ident(VALUE)operator(\),)ident(VALUE)operator(,)ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_rescue) ident(_)operator((()ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)ident(VALUE)operator(,)ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_rescue2) ident(__)operator((()ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)ident(VALUE)operator(,)ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)ident(VALUE)operator(,)operator(.)operator(.)operator(.)operator(\)\);) -ident(VALUE) ident(rb_ensure) ident(_)operator((()ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)ident(VALUE)operator(,)ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)ident(VALUE)operator(\)\);) -ident(VALUE) ident(rb_catch) ident(_)operator((()directive(const) pre_type(char)operator(*,)ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)ident(VALUE)operator(\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_throw) ident(_)operator((()directive(const) pre_type(char)operator(*,)ident(VALUE)operator(\)\)\);) - -ident(VALUE) ident(rb_require) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) - -preprocessor(#ifdef) ident(__ia64) -directive(void) ident(ruby_init_stack)operator(()ident(VALUE)operator(*,) directive(void)operator(*\);) -preprocessor(#define) ident(RUBY_INIT_STACK) \ - ident(VALUE) ident(variable_in_this_stack_frame)operator(;) \ - ident(ruby_init_stack)operator((&)ident(variable_in_this_stack_frame)operator(,) ident(rb_ia64_bsp)operator((\)\);) -preprocessor(#else) -directive(void) ident(ruby_init_stack)operator(()ident(VALUE)operator(*\);) -preprocessor(#define) ident(RUBY_INIT_STACK) \ - ident(VALUE) ident(variable_in_this_stack_frame)operator(;) \ - ident(ruby_init_stack)operator((&)ident(variable_in_this_stack_frame)operator(\);) -preprocessor(#endif) -directive(void) ident(ruby_init) ident(_)operator((()directive(void)operator(\)\);) -directive(void) ident(ruby_options) ident(_)operator((()pre_type(int)operator(,) pre_type(char)operator(**\)\);) -ident(NORETURN)operator(()directive(void) ident(ruby_run) ident(_)operator((()directive(void)operator(\)\)\);) - -ident(RUBY_EXTERN) ident(VALUE) ident(rb_mKernel)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_mComparable)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_mEnumerable)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_mPrecision)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_mErrno)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_mFileTest)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_mGC)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_mMath)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_mProcess)operator(;) - -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cObject)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cArray)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cBignum)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cBinding)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cClass)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cCont)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cDir)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cData)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cFalseClass)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cFile)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cFixnum)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cFloat)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cHash)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cInteger)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cIO)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cMatch)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cMethod)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cModule)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cNameErrorMesg)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cNilClass)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cNumeric)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cProc)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cRange)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cRegexp)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cStat)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cString)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cStruct)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cSymbol)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cThread)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cTime)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cTrueClass)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_cUnboundMethod)operator(;) - -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eException)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eStandardError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eSystemExit)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eInterrupt)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eSignal)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eFatal)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eArgError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eEOFError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eIndexError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eRangeError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eIOError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eRuntimeError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eSecurityError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eSystemCallError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eThreadError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eTypeError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eZeroDivError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eNotImpError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eNoMemError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eNoMethodError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eFloatDomainError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eLocalJumpError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eSysStackError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eRegexpError)operator(;) - -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eScriptError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eNameError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eSyntaxError)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(rb_eLoadError)operator(;) - -ident(RUBY_EXTERN) ident(VALUE) ident(rb_stdin)operator(,) ident(rb_stdout)operator(,) ident(rb_stderr)operator(;) -ident(RUBY_EXTERN) ident(VALUE) ident(ruby_errinfo)operator(;) - -directive(static) directive(inline) ident(VALUE) -preprocessor(#if) ident(defined)operator(()ident(HAVE_PROTOTYPES)operator(\)) -ident(rb_class_of)operator(()ident(VALUE) ident(obj)operator(\)) -preprocessor(#else) -ident(rb_class_of)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -preprocessor(#endif) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(obj)operator(\)\)) reserved(return) ident(rb_cFixnum)operator(;) - reserved(if) operator(()ident(obj) operator(==) ident(Qnil)operator(\)) reserved(return) ident(rb_cNilClass)operator(;) - reserved(if) operator(()ident(obj) operator(==) ident(Qfalse)operator(\)) reserved(return) ident(rb_cFalseClass)operator(;) - reserved(if) operator(()ident(obj) operator(==) ident(Qtrue)operator(\)) reserved(return) ident(rb_cTrueClass)operator(;) - reserved(if) operator(()ident(SYMBOL_P)operator(()ident(obj)operator(\)\)) reserved(return) ident(rb_cSymbol)operator(;) - - reserved(return) ident(RBASIC)operator(()ident(obj)operator(\)->)ident(klass)operator(;) -operator(}) - -directive(static) directive(inline) pre_type(int) -preprocessor(#if) ident(defined)operator(()ident(HAVE_PROTOTYPES)operator(\)) -ident(rb_type)operator(()ident(VALUE) ident(obj)operator(\)) -preprocessor(#else) -ident(rb_type)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -preprocessor(#endif) -operator({) - reserved(if) operator(()ident(FIXNUM_P)operator(()ident(obj)operator(\)\)) reserved(return) ident(T_FIXNUM)operator(;) - reserved(if) operator(()ident(obj) operator(==) ident(Qnil)operator(\)) reserved(return) ident(T_NIL)operator(;) - reserved(if) operator(()ident(obj) operator(==) ident(Qfalse)operator(\)) reserved(return) ident(T_FALSE)operator(;) - reserved(if) operator(()ident(obj) operator(==) ident(Qtrue)operator(\)) reserved(return) ident(T_TRUE)operator(;) - reserved(if) operator(()ident(obj) operator(==) ident(Qundef)operator(\)) reserved(return) ident(T_UNDEF)operator(;) - reserved(if) operator(()ident(SYMBOL_P)operator(()ident(obj)operator(\)\)) reserved(return) ident(T_SYMBOL)operator(;) - reserved(return) ident(BUILTIN_TYPE)operator(()ident(obj)operator(\);) -operator(}) - -directive(static) directive(inline) pre_type(int) -preprocessor(#if) ident(defined)operator(()ident(HAVE_PROTOTYPES)operator(\)) -ident(rb_special_const_p)operator(()ident(VALUE) ident(obj)operator(\)) -preprocessor(#else) -ident(rb_special_const_p)operator(()ident(obj)operator(\)) - ident(VALUE) ident(obj)operator(;) -preprocessor(#endif) -operator({) - reserved(if) operator(()ident(SPECIAL_CONST_P)operator(()ident(obj)operator(\)\)) reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qfalse)operator(;) -operator(}) - -preprocessor(#include) include("missing.h") -preprocessor(#include) include("intern.h") - -preprocessor(#if) ident(defined)operator(()ident(EXTLIB)operator(\)) operator(&&) ident(defined)operator(()ident(USE_DLN_A_OUT)operator(\)) -comment(/* hook for external modules */) -directive(static) pre_type(char) operator(*)ident(dln_libs_to_be_linked)operator([]) operator(=) operator({) ident(EXTLIB)operator(,) integer(0) operator(};) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(HAVE_LIBPTHREAD)operator(\)) -preprocessor(#ifdef) ident(HAVE_PTHREAD_H) -preprocessor(#include) include() -preprocessor(#endif) -reserved(typedef) ident(pthread_t) ident(rb_nativethread_t)operator(;) -preprocessor(# define) ident(NATIVETHREAD_CURRENT)operator((\)) ident(pthread_self)operator((\)) -preprocessor(# define) ident(NATIVETHREAD_EQUAL)operator(()ident(t1)operator(,)ident(t2)operator(\)) ident(pthread_equal)operator((()ident(t1)operator(\),()ident(t2)operator(\)\)) -preprocessor(# define) ident(HAVE_NATIVETHREAD) - -preprocessor(# define) ident(NATIVETHREAD_KILL)operator(()ident(th)operator(,)ident(sig)operator(\)) ident(pthread_kill)operator((()ident(th)operator(\),()ident(sig)operator(\)\)) -preprocessor(# define) ident(HAVE_NATIVETHREAD_KILL) -preprocessor(#elif) ident(defined)operator(()ident(_WIN32)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32_WCE)operator(\)) -reserved(typedef) ident(DWORD) ident(rb_nativethread_t)operator(;) -preprocessor(# define) ident(NATIVETHREAD_CURRENT)operator((\)) ident(GetCurrentThreadId)operator((\)) -preprocessor(# define) ident(NATIVETHREAD_EQUAL)operator(()ident(t1)operator(,)ident(t2)operator(\)) operator((()ident(t1)operator(\)) operator(==) operator(()ident(t2)operator(\)\)) -preprocessor(# define) ident(HAVE_NATIVETHREAD) -preprocessor(#endif) -preprocessor(#ifdef) ident(HAVE_NATIVETHREAD) -pre_type(int) ident(is_ruby_native_thread) ident(_)operator((()directive(void)operator(\)\);) -preprocessor(#else) -preprocessor(#define) ident(is_ruby_native_thread)operator((\)) operator(()integer(1)operator(\)) -preprocessor(#endif) -preprocessor(#ifdef) ident(HAVE_NATIVETHREAD_KILL) -directive(void) ident(ruby_native_thread_kill) ident(_)operator((()pre_type(int)operator(\)\);) -preprocessor(#endif) - -preprocessor(#if) ident(defined)operator(()ident(__cplusplus)operator(\)) -comment(#if 0 -{ /* satisfy cc-mode */ -#endif) -operator(}) comment(/* extern "C" { */) -preprocessor(#endif) - -preprocessor(#endif) comment(/* ifndef RUBY_H */) -comment(/********************************************************************** - - rubyio.h - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007\) $ - created at: Fri Nov 12 16:47:09 JST 1993 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#ifndef) ident(RUBYIO_H) -preprocessor(#define) ident(RUBYIO_H) - -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#if) ident(defined)operator(()ident(HAVE_STDIO_EXT_H)operator(\)) -preprocessor(#include) include() -preprocessor(#endif) - -reserved(typedef) reserved(struct) ident(OpenFile) operator({) - ident(FILE) operator(*)ident(f)operator(;) comment(/* stdio ptr for read/write */) - ident(FILE) operator(*)ident(f2)operator(;) comment(/* additional ptr for rw pipes */) - pre_type(int) ident(mode)operator(;) comment(/* mode flags */) - pre_type(int) ident(pid)operator(;) comment(/* child's pid (for pipes\) */) - pre_type(int) ident(lineno)operator(;) comment(/* number of lines read */) - pre_type(char) operator(*)ident(path)operator(;) comment(/* pathname for file */) - directive(void) operator((*)ident(finalize)operator(\)) ident(_)operator((()reserved(struct) ident(OpenFile)operator(*,)pre_type(int)operator(\)\);) comment(/* finalize proc */) -operator(}) ident(OpenFile)operator(;) - -preprocessor(#define) ident(FMODE_READABLE) integer(1) -preprocessor(#define) ident(FMODE_WRITABLE) integer(2) -preprocessor(#define) ident(FMODE_READWRITE) integer(3) -preprocessor(#define) ident(FMODE_APPEND) integer(64) -preprocessor(#define) ident(FMODE_CREATE) integer(128) -preprocessor(#define) ident(FMODE_BINMODE) integer(4) -preprocessor(#define) ident(FMODE_SYNC) integer(8) -preprocessor(#define) ident(FMODE_WBUF) integer(16) -preprocessor(#define) ident(FMODE_RBUF) integer(32) -preprocessor(#define) ident(FMODE_WSPLIT) hex(0x200) -preprocessor(#define) ident(FMODE_WSPLIT_INITIALIZED) hex(0x400) - -preprocessor(#define) ident(GetOpenFile)operator(()ident(obj)operator(,)ident(fp)operator(\)) ident(rb_io_check_closed)operator((()ident(fp)operator(\)) operator(=) ident(RFILE)operator(()ident(rb_io_taint_check)operator(()ident(obj)operator(\)\)->)ident(fptr)operator(\)) - -preprocessor(#define) ident(MakeOpenFile)operator(()ident(obj)operator(,) ident(fp)operator(\)) reserved(do) operator({)\ - reserved(if) operator(()ident(RFILE)operator(()ident(obj)operator(\)->)ident(fptr)operator(\)) operator({)\ - ident(rb_io_close)operator(()ident(obj)operator(\);)\ - ident(free)operator(()ident(RFILE)operator(()ident(obj)operator(\)->)ident(fptr)operator(\);)\ - ident(RFILE)operator(()ident(obj)operator(\)->)ident(fptr) operator(=) integer(0)operator(;)\ - operator(})\ - ident(fp) operator(=) integer(0)operator(;)\ - ident(fp) operator(=) ident(RFILE)operator(()ident(obj)operator(\)->)ident(fptr) operator(=) ident(ALLOC)operator(()ident(OpenFile)operator(\);)\ - ident(fp)operator(->)ident(f) operator(=) ident(fp)operator(->)ident(f2) operator(=) pre_constant(NULL)operator(;)\ - ident(fp)operator(->)ident(mode) operator(=) integer(0)operator(;)\ - ident(fp)operator(->)ident(pid) operator(=) integer(0)operator(;)\ - ident(fp)operator(->)ident(lineno) operator(=) integer(0)operator(;)\ - ident(fp)operator(->)ident(path) operator(=) pre_constant(NULL)operator(;)\ - ident(fp)operator(->)ident(finalize) operator(=) integer(0)operator(;)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(#define) ident(GetReadFile)operator(()ident(fptr)operator(\)) operator((()ident(fptr)operator(\)->)ident(f)operator(\)) -preprocessor(#define) ident(GetWriteFile)operator(()ident(fptr)operator(\)) operator(((()ident(fptr)operator(\)->)ident(f2)operator(\)) operator(?) operator(()ident(fptr)operator(\)->)ident(f2) operator(:) operator(()ident(fptr)operator(\)->)ident(f)operator(\)) - -ident(FILE) operator(*)ident(rb_fopen) ident(_)operator((()directive(const) pre_type(char)operator(*,) directive(const) pre_type(char)operator(*\)\);) -ident(FILE) operator(*)ident(rb_fdopen) ident(_)operator((()pre_type(int)operator(,) directive(const) pre_type(char)operator(*\)\);) -pre_type(int) ident(rb_getc) ident(_)operator((()ident(FILE)operator(*\)\);) -pre_type(long) ident(rb_io_fread) ident(_)operator((()pre_type(char) operator(*,) pre_type(long)operator(,) ident(FILE) operator(*\)\);) -pre_type(long) ident(rb_io_fwrite) ident(_)operator((()directive(const) pre_type(char) operator(*,) pre_type(long)operator(,) ident(FILE) operator(*\)\);) -pre_type(int) ident(rb_io_mode_flags) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -pre_type(int) ident(rb_io_modenum_flags) ident(_)operator((()pre_type(int)operator(\)\);) -directive(void) ident(rb_io_check_writable) ident(_)operator((()ident(OpenFile)operator(*\)\);) -directive(void) ident(rb_io_check_readable) ident(_)operator((()ident(OpenFile)operator(*\)\);) -directive(void) ident(rb_io_fptr_finalize) ident(_)operator((()ident(OpenFile)operator(*\)\);) -directive(void) ident(rb_io_synchronized) ident(_)operator((()ident(OpenFile)operator(*\)\);) -directive(void) ident(rb_io_check_initialized) ident(_)operator((()ident(OpenFile)operator(*\)\);) -directive(void) ident(rb_io_check_closed) ident(_)operator((()ident(OpenFile)operator(*\)\);) -pre_type(int) ident(rb_io_wait_readable) ident(_)operator((()pre_type(int)operator(\)\);) -pre_type(int) ident(rb_io_wait_writable) ident(_)operator((()pre_type(int)operator(\)\);) -directive(void) ident(rb_io_set_nonblock)operator(()ident(OpenFile) operator(*)ident(fptr)operator(\);) - -ident(VALUE) ident(rb_io_taint_check) ident(_)operator((()ident(VALUE)operator(\)\);) -ident(NORETURN)operator(()directive(void) ident(rb_eof_error) ident(_)operator((()directive(void)operator(\)\)\);) - -directive(void) ident(rb_read_check) ident(_)operator((()ident(FILE)operator(*\)\);) -pre_type(int) ident(rb_read_pending) ident(_)operator((()ident(FILE)operator(*\)\);) -preprocessor(#endif) -comment(/********************************************************************** - - rubysig.h - - - $Author: shyouhei $ - $Date: 2009-01-05 03:13:40 +0100 (Mon, 05 Jan 2009\) $ - created at: Wed Aug 16 01:15:38 JST 1995 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#ifndef) ident(SIG_H) -preprocessor(#define) ident(SIG_H) -preprocessor(#include) include() - -preprocessor(#ifdef) ident(_WIN32) -reserved(typedef) ident(LONG) ident(rb_atomic_t)operator(;) - -preprocessor(# define) ident(ATOMIC_TEST)operator(()ident(var)operator(\)) ident(InterlockedExchange)operator((&()ident(var)operator(\),) integer(0)operator(\)) -preprocessor(# define) ident(ATOMIC_SET)operator(()ident(var)operator(,) ident(val)operator(\)) ident(InterlockedExchange)operator((&()ident(var)operator(\),) operator(()ident(val)operator(\)\)) -preprocessor(# define) ident(ATOMIC_INC)operator(()ident(var)operator(\)) ident(InterlockedIncrement)operator((&()ident(var)operator(\)\)) -preprocessor(# define) ident(ATOMIC_DEC)operator(()ident(var)operator(\)) ident(InterlockedDecrement)operator((&()ident(var)operator(\)\)) - -comment(/* Windows doesn't allow interrupt while system calls */) -preprocessor(# define) ident(TRAP_BEG) reserved(do) operator({)\ - pre_type(int) ident(saved_errno) operator(=) integer(0)operator(;)\ - ident(rb_atomic_t) ident(trap_immediate) operator(=) ident(ATOMIC_SET)operator(()ident(rb_trap_immediate)operator(,) integer(1)operator(\)) -preprocessor(# define) ident(TRAP_END)\ - ident(ATOMIC_SET)operator(()ident(rb_trap_immediate)operator(,) ident(trap_immediate)operator(\);)\ - ident(saved_errno) operator(=) ident(errno)operator(;)\ - ident(CHECK_INTS)operator(;)\ - ident(errno) operator(=) ident(saved_errno)operator(;)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(# define) ident(RUBY_CRITICAL)operator(()ident(statements)operator(\)) reserved(do) operator({)\ - ident(rb_w32_enter_critical)operator((\);)\ - ident(statements)operator(;)\ - ident(rb_w32_leave_critical)operator((\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#else) -reserved(typedef) pre_type(int) ident(rb_atomic_t)operator(;) - -preprocessor(# define) ident(ATOMIC_TEST)operator(()ident(var)operator(\)) operator((()ident(var)operator(\)) operator(?) operator((()ident(var)operator(\)) operator(=) integer(0)operator(,) integer(1)operator(\)) operator(:) integer(0)operator(\)) -preprocessor(# define) ident(ATOMIC_SET)operator(()ident(var)operator(,) ident(val)operator(\)) operator((()ident(var)operator(\)) operator(=) operator(()ident(val)operator(\)\)) -preprocessor(# define) ident(ATOMIC_INC)operator(()ident(var)operator(\)) operator((++()ident(var)operator(\)\)) -preprocessor(# define) ident(ATOMIC_DEC)operator(()ident(var)operator(\)) operator((--()ident(var)operator(\)\)) - -preprocessor(# define) ident(TRAP_BEG) reserved(do) operator({)\ - pre_type(int) ident(saved_errno) operator(=) integer(0)operator(;)\ - pre_type(int) ident(trap_immediate) operator(=) ident(rb_trap_immediate)operator(;)\ - ident(rb_trap_immediate) operator(=) integer(1) -preprocessor(# define) ident(TRAP_END) ident(rb_trap_immediate) operator(=) ident(trap_immediate)operator(;)\ - ident(saved_errno) operator(=) ident(errno)operator(;)\ - ident(CHECK_INTS)operator(;)\ - ident(errno) operator(=) ident(saved_errno)operator(;)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) - -preprocessor(# define) ident(RUBY_CRITICAL)operator(()ident(statements)operator(\)) reserved(do) operator({)\ - pre_type(int) ident(trap_immediate) operator(=) ident(rb_trap_immediate)operator(;)\ - ident(rb_trap_immediate) operator(=) integer(0)operator(;)\ - ident(statements)operator(;)\ - ident(rb_trap_immediate) operator(=) ident(trap_immediate)operator(;)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#endif) -ident(RUBY_EXTERN) ident(rb_atomic_t) ident(rb_trap_immediate)operator(;) - -ident(RUBY_EXTERN) pre_type(int) ident(rb_prohibit_interrupt)operator(;) -preprocessor(#define) ident(DEFER_INTS) operator(()ident(rb_prohibit_interrupt)operator(++\)) -preprocessor(#define) ident(ALLOW_INTS) reserved(do) operator({)\ - ident(rb_prohibit_interrupt)operator(--;)\ - ident(CHECK_INTS)operator(;)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#define) ident(ENABLE_INTS) operator(()ident(rb_prohibit_interrupt)operator(--\)) - -ident(VALUE) ident(rb_with_disable_interrupt) ident(_)operator((()ident(VALUE)operator((*\)()ident(ANYARGS)operator(\),)ident(VALUE)operator(\)\);) - -ident(RUBY_EXTERN) ident(rb_atomic_t) ident(rb_trap_pending)operator(;) -directive(void) ident(rb_trap_restore_mask) ident(_)operator((()directive(void)operator(\)\);) - -ident(RUBY_EXTERN) pre_type(int) ident(rb_thread_critical)operator(;) -ident(RUBY_EXTERN) pre_type(int) ident(rb_thread_pending)operator(;) -directive(void) ident(rb_thread_schedule) ident(_)operator((()directive(void)operator(\)\);) -preprocessor(#if) ident(defined)operator(()ident(HAVE_SETITIMER)operator(\)) operator(||) ident(defined)operator(()ident(_THREAD_SAFE)operator(\)) -preprocessor(# define) ident(CHECK_INTS) reserved(do) operator({)\ - reserved(if) operator((!()ident(rb_prohibit_interrupt) operator(||) ident(rb_thread_critical)operator(\)\)) operator({)\ - reserved(if) operator(()ident(rb_thread_pending)operator(\)) ident(rb_thread_schedule)operator((\);)\ - reserved(if) operator(()ident(rb_trap_pending)operator(\)) ident(rb_trap_exec)operator((\);)\ - operator(})\ -operator(}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#else) -comment(/* pseudo preemptive thread switching */) -ident(RUBY_EXTERN) pre_type(int) ident(rb_thread_tick)operator(;) -preprocessor(#define) ident(THREAD_TICK) integer(500) -preprocessor(#define) ident(CHECK_INTS) reserved(do) operator({)\ - reserved(if) operator((!()ident(rb_prohibit_interrupt) operator(||) ident(rb_thread_critical)operator(\)\)) operator({)\ - reserved(if) operator(()ident(rb_thread_pending) operator(||) ident(rb_thread_tick)operator(--) operator(<=) integer(0)operator(\)) operator({)\ - ident(rb_thread_tick) operator(=) ident(THREAD_TICK)operator(;)\ - ident(rb_thread_schedule)operator((\);)\ - operator(})\ - operator(})\ - reserved(if) operator(()ident(rb_trap_pending)operator(\)) ident(rb_trap_exec)operator((\);)\ -operator(}) reserved(while) operator(()integer(0)operator(\)) -preprocessor(#endif) - -preprocessor(#endif) -comment(/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */) - -comment(/* @(#\) st.h 5.1 89/12/14 */) - -preprocessor(#ifndef) ident(ST_INCLUDED) - -preprocessor(#define) ident(ST_INCLUDED) - -preprocessor(#if) ident(SIZEOF_LONG) operator(==) ident(SIZEOF_VOIDP) -reserved(typedef) pre_type(unsigned) pre_type(long) ident(st_data_t)operator(;) -preprocessor(#elif) ident(SIZEOF_LONG_LONG) operator(==) ident(SIZEOF_VOIDP) -reserved(typedef) pre_type(unsigned) ident(LONG_LONG) ident(st_data_t)operator(;) -preprocessor(#else) -preprocessor(# error) operator(---->>) ident(st)operator(.)ident(c) ident(requires) reserved(sizeof)operator(()directive(void)operator(*\)) operator(==) reserved(sizeof)operator(()pre_type(long)operator(\)) ident(to) ident(be) ident(compiled)operator(.) operator(<<---) -operator(-) -preprocessor(#endif) -preprocessor(#define) ident(ST_DATA_T_DEFINED) - -reserved(typedef) reserved(struct) ident(st_table) ident(st_table)operator(;) - -reserved(struct) ident(st_hash_type) operator({) - pre_type(int) operator((*)ident(compare)operator(\)(\);) - pre_type(int) operator((*)ident(hash)operator(\)(\);) -operator(};) - -reserved(struct) ident(st_table) operator({) - reserved(struct) ident(st_hash_type) operator(*)ident(type)operator(;) - pre_type(int) ident(num_bins)operator(;) - pre_type(int) ident(num_entries)operator(;) - reserved(struct) ident(st_table_entry) operator(**)ident(bins)operator(;) -operator(};) - -preprocessor(#define) ident(st_is_member)operator(()ident(table)operator(,)ident(key)operator(\)) ident(st_lookup)operator(()ident(table)operator(,)ident(key)operator(,()ident(st_data_t) operator(*\))integer(0)operator(\)) - -reserved(enum) ident(st_retval) operator({)ident(ST_CONTINUE)operator(,) ident(ST_STOP)operator(,) ident(ST_DELETE)operator(,) ident(ST_CHECK)operator(};) - -preprocessor(#ifndef) ident(_) -preprocessor(# define) ident(_)operator(()ident(args)operator(\)) ident(args) -preprocessor(#endif) -preprocessor(#ifndef) ident(ANYARGS) -preprocessor(# ifdef) ident(__cplusplus) -preprocessor(# define) ident(ANYARGS) operator(.)operator(.)operator(.) -preprocessor(# else) -preprocessor(# define) ident(ANYARGS) -preprocessor(# endif) -preprocessor(#endif) - -ident(st_table) operator(*)ident(st_init_table) ident(_)operator((()reserved(struct) ident(st_hash_type) operator(*\)\);) -ident(st_table) operator(*)ident(st_init_table_with_size) ident(_)operator((()reserved(struct) ident(st_hash_type) operator(*,) pre_type(int)operator(\)\);) -ident(st_table) operator(*)ident(st_init_numtable) ident(_)operator((()directive(void)operator(\)\);) -ident(st_table) operator(*)ident(st_init_numtable_with_size) ident(_)operator((()pre_type(int)operator(\)\);) -ident(st_table) operator(*)ident(st_init_strtable) ident(_)operator((()directive(void)operator(\)\);) -ident(st_table) operator(*)ident(st_init_strtable_with_size) ident(_)operator((()pre_type(int)operator(\)\);) -pre_type(int) ident(st_delete) ident(_)operator((()ident(st_table) operator(*,) ident(st_data_t) operator(*,) ident(st_data_t) operator(*\)\);) -pre_type(int) ident(st_delete_safe) ident(_)operator((()ident(st_table) operator(*,) ident(st_data_t) operator(*,) ident(st_data_t) operator(*,) ident(st_data_t)operator(\)\);) -pre_type(int) ident(st_insert) ident(_)operator((()ident(st_table) operator(*,) ident(st_data_t)operator(,) ident(st_data_t)operator(\)\);) -pre_type(int) ident(st_lookup) ident(_)operator((()ident(st_table) operator(*,) ident(st_data_t)operator(,) ident(st_data_t) operator(*\)\);) -pre_type(int) ident(st_foreach) ident(_)operator((()ident(st_table) operator(*,) pre_type(int) operator((*\)()ident(ANYARGS)operator(\),) ident(st_data_t)operator(\)\);) -directive(void) ident(st_add_direct) ident(_)operator((()ident(st_table) operator(*,) ident(st_data_t)operator(,) ident(st_data_t)operator(\)\);) -directive(void) ident(st_free_table) ident(_)operator((()ident(st_table) operator(*\)\);) -directive(void) ident(st_cleanup_safe) ident(_)operator((()ident(st_table) operator(*,) ident(st_data_t)operator(\)\);) -ident(st_table) operator(*)ident(st_copy) ident(_)operator((()ident(st_table) operator(*\)\);) - -preprocessor(#define) ident(ST_NUMCMP) operator((()pre_type(int) operator((*\)(\)\)) integer(0)operator(\)) -preprocessor(#define) ident(ST_NUMHASH) operator((()pre_type(int) operator((*\)(\)\)) operator(-)integer(2)operator(\)) - -preprocessor(#define) ident(st_numcmp) ident(ST_NUMCMP) -preprocessor(#define) ident(st_numhash) ident(ST_NUMHASH) - -pre_type(int) ident(st_strhash)operator((\);) - -preprocessor(#endif) comment(/* ST_INCLUDED */) -comment(/********************************************************************** - - util.h - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007\) $ - created at: Thu Mar 9 11:55:53 JST 1995 - - Copyright (C\) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/) - -preprocessor(#ifndef) ident(UTIL_H) -preprocessor(#define) ident(UTIL_H) - -preprocessor(#ifndef) ident(_) -preprocessor(#ifdef) ident(__cplusplus) -preprocessor(# ifndef) ident(HAVE_PROTOTYPES) -preprocessor(# define) ident(HAVE_PROTOTYPES) integer(1) -preprocessor(# endif) -preprocessor(# ifndef) ident(HAVE_STDARG_PROTOTYPES) -preprocessor(# define) ident(HAVE_STDARG_PROTOTYPES) integer(1) -preprocessor(# endif) -preprocessor(#endif) -preprocessor(#ifdef) ident(HAVE_PROTOTYPES) -preprocessor(# define) ident(_)operator(()ident(args)operator(\)) ident(args) -preprocessor(#else) -preprocessor(# define) ident(_)operator(()ident(args)operator(\)) operator((\)) -preprocessor(#endif) -preprocessor(#ifdef) ident(HAVE_STDARG_PROTOTYPES) -preprocessor(# define) ident(__)operator(()ident(args)operator(\)) ident(args) -preprocessor(#else) -preprocessor(# define) ident(__)operator(()ident(args)operator(\)) operator((\)) -preprocessor(#endif) -preprocessor(#endif) - -preprocessor(#define) ident(scan_oct) ident(ruby_scan_oct) -pre_type(unsigned) pre_type(long) ident(scan_oct) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(int)operator(,) pre_type(int)operator(*\)\);) -preprocessor(#define) ident(scan_hex) ident(ruby_scan_hex) -pre_type(unsigned) pre_type(long) ident(scan_hex) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(int)operator(,) pre_type(int)operator(*\)\);) - -preprocessor(#if) ident(defined)operator(()ident(MSDOS)operator(\)) operator(||) ident(defined)operator(()ident(__CYGWIN32__)operator(\)) operator(||) ident(defined)operator(()ident(_WIN32)operator(\)) -directive(void) ident(ruby_add_suffix)operator((\);) -preprocessor(#endif) - -directive(void) ident(ruby_qsort) ident(_)operator((()directive(void)operator(*,) directive(const) pre_type(int)operator(,) directive(const) pre_type(int)operator(,) pre_type(int) operator((*\)(\),) directive(void)operator(*\)\);) -preprocessor(#define) ident(qsort)operator(()ident(b)operator(,)ident(n)operator(,)ident(s)operator(,)ident(c)operator(,)ident(d)operator(\)) ident(ruby_qsort)operator(()ident(b)operator(,)ident(n)operator(,)ident(s)operator(,)ident(c)operator(,)ident(d)operator(\)) - -directive(void) ident(ruby_setenv) ident(_)operator((()directive(const) pre_type(char)operator(*,) directive(const) pre_type(char)operator(*\)\);) -directive(void) ident(ruby_unsetenv) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -preprocessor(#undef) ident(setenv) -preprocessor(#undef) ident(unsetenv) -preprocessor(#define) ident(setenv)operator(()ident(name)operator(,)ident(val)operator(\)) ident(ruby_setenv)operator(()ident(name)operator(,)ident(val)operator(\)) -preprocessor(#define) ident(unsetenv)operator(()ident(name)operator(,)ident(val)operator(\)) ident(ruby_unsetenv)operator(()ident(name)operator(\);) - -pre_type(char) operator(*)ident(ruby_strdup) ident(_)operator((()directive(const) pre_type(char)operator(*\)\);) -preprocessor(#undef) ident(strdup) -preprocessor(#define) ident(strdup)operator(()ident(s)operator(\)) ident(ruby_strdup)operator(()ident(s)operator(\)) - -pre_type(char) operator(*)ident(ruby_getcwd) ident(_)operator((()directive(void)operator(\)\);) -preprocessor(#define) ident(my_getcwd)operator((\)) ident(ruby_getcwd)operator((\)) - -pre_type(double) ident(ruby_strtod) ident(_)operator((()directive(const) pre_type(char)operator(*,) pre_type(char) operator(**\)\);) -preprocessor(#undef) ident(strtod) -preprocessor(#define) ident(strtod)operator(()ident(s)operator(,)ident(e)operator(\)) ident(ruby_strtod)operator(()ident(s)operator(,)ident(e)operator(\)) - -preprocessor(#endif) comment(/* UTIL_H */) -preprocessor(#define) ident(RUBY_VERSION) string -preprocessor(#define) ident(RUBY_RELEASE_DATE) string -preprocessor(#define) ident(RUBY_VERSION_CODE) integer(186) -preprocessor(#define) ident(RUBY_RELEASE_CODE) integer(20090909) -preprocessor(#define) ident(RUBY_PATCHLEVEL) integer(388) - -preprocessor(#define) ident(RUBY_VERSION_MAJOR) integer(1) -preprocessor(#define) ident(RUBY_VERSION_MINOR) integer(8) -preprocessor(#define) ident(RUBY_VERSION_TEENY) integer(6) -preprocessor(#define) ident(RUBY_RELEASE_YEAR) integer(2009) -preprocessor(#define) ident(RUBY_RELEASE_MONTH) integer(9) -preprocessor(#define) ident(RUBY_RELEASE_DAY) integer(9) - -preprocessor(#ifdef) ident(RUBY_EXTERN) -ident(RUBY_EXTERN) directive(const) pre_type(char) ident(ruby_version)operator([];) -ident(RUBY_EXTERN) directive(const) pre_type(char) ident(ruby_release_date)operator([];) -ident(RUBY_EXTERN) directive(const) pre_type(char) ident(ruby_platform)operator([];) -ident(RUBY_EXTERN) directive(const) pre_type(int) ident(ruby_patchlevel)operator(;) -preprocessor(#endif) - diff --git a/test/scanners/c/ruby.in.c b/test/scanners/c/ruby.in.c deleted file mode 100644 index 868ea59..0000000 --- a/test/scanners/c/ruby.in.c +++ /dev/null @@ -1,96308 +0,0 @@ -/********************************************************************** - - array.c - - - $Author: shyouhei $ - $Date: 2009-02-05 00:55:01 +0100 (Thu, 05 Feb 2009) $ - created at: Fri Aug 6 09:46:12 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#include "ruby.h" -#include "util.h" -#include "st.h" - -VALUE rb_cArray; -static ID id_cmp; - -#define ARY_DEFAULT_SIZE 16 -#define ARY_MAX_SIZE (LONG_MAX / sizeof(VALUE)) - -void -rb_mem_clear(mem, size) - register VALUE *mem; - register long size; -{ - while (size--) { - *mem++ = Qnil; - } -} - -static inline void -memfill(mem, size, val) - register VALUE *mem; - register long size; - register VALUE val; -{ - while (size--) { - *mem++ = val; - } -} - -#define ARY_TMPLOCK FL_USER1 - -static inline void -rb_ary_modify_check(ary) - VALUE ary; -{ - if (OBJ_FROZEN(ary)) rb_error_frozen("array"); - if (FL_TEST(ary, ARY_TMPLOCK)) - rb_raise(rb_eRuntimeError, "can't modify array during iteration"); - if (!OBJ_TAINTED(ary) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't modify array"); -} - -static void -rb_ary_modify(ary) - VALUE ary; -{ - VALUE *ptr; - - rb_ary_modify_check(ary); - if (FL_TEST(ary, ELTS_SHARED)) { - ptr = ALLOC_N(VALUE, RARRAY(ary)->len); - FL_UNSET(ary, ELTS_SHARED); - RARRAY(ary)->aux.capa = RARRAY(ary)->len; - MEMCPY(ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len); - RARRAY(ary)->ptr = ptr; - } -} - -VALUE -rb_ary_freeze(ary) - VALUE ary; -{ - return rb_obj_freeze(ary); -} - -/* - * call-seq: - * array.frozen? -> true or false - * - * Return true if this array is frozen (or temporarily frozen - * while being sorted). - */ - -static VALUE -rb_ary_frozen_p(ary) - VALUE ary; -{ - if (OBJ_FROZEN(ary)) return Qtrue; - if (FL_TEST(ary, ARY_TMPLOCK)) return Qtrue; - return Qfalse; -} - -static VALUE ary_alloc _((VALUE)); -static VALUE -ary_alloc(klass) - VALUE klass; -{ - NEWOBJ(ary, struct RArray); - OBJSETUP(ary, klass, T_ARRAY); - - ary->len = 0; - ary->ptr = 0; - ary->aux.capa = 0; - - return (VALUE)ary; -} - -static VALUE -ary_new(klass, len) - VALUE klass; - long len; -{ - VALUE ary = ary_alloc(klass); - - if (len < 0) { - rb_raise(rb_eArgError, "negative array size (or size too big)"); - } - if (len > ARY_MAX_SIZE) { - rb_raise(rb_eArgError, "array size too big"); - } - if (len == 0) len++; - RARRAY(ary)->ptr = ALLOC_N(VALUE, len); - RARRAY(ary)->aux.capa = len; - - return ary; -} - -VALUE -rb_ary_new2(len) - long len; -{ - return ary_new(rb_cArray, len); -} - - -VALUE -rb_ary_new() -{ - return rb_ary_new2(ARY_DEFAULT_SIZE); -} - -#ifdef HAVE_STDARG_PROTOTYPES -#include -#define va_init_list(a,b) va_start(a,b) -#else -#include -#define va_init_list(a,b) va_start(a) -#endif - -VALUE -#ifdef HAVE_STDARG_PROTOTYPES -rb_ary_new3(long n, ...) -#else -rb_ary_new3(n, va_alist) - long n; - va_dcl -#endif -{ - va_list ar; - VALUE ary; - long i; - - ary = rb_ary_new2(n); - - va_init_list(ar, n); - for (i=0; iptr[i] = va_arg(ar, VALUE); - } - va_end(ar); - - RARRAY(ary)->len = n; - return ary; -} - -VALUE -rb_ary_new4(n, elts) - long n; - const VALUE *elts; -{ - VALUE ary; - - ary = rb_ary_new2(n); - if (n > 0 && elts) { - MEMCPY(RARRAY(ary)->ptr, elts, VALUE, n); - } - - /* This assignment to len will be moved to the above "if" block in Ruby 1.9 */ - RARRAY(ary)->len = n; - - return ary; -} - -VALUE -rb_assoc_new(car, cdr) - VALUE car, cdr; -{ - VALUE ary; - - ary = rb_ary_new2(2); - RARRAY(ary)->ptr[0] = car; - RARRAY(ary)->ptr[1] = cdr; - RARRAY(ary)->len = 2; - - return ary; -} - -static VALUE -to_ary(ary) - VALUE ary; -{ - return rb_convert_type(ary, T_ARRAY, "Array", "to_ary"); -} - -VALUE -rb_check_array_type(ary) - VALUE ary; -{ - return rb_check_convert_type(ary, T_ARRAY, "Array", "to_ary"); -} - -static VALUE rb_ary_replace _((VALUE, VALUE)); - -/* - * call-seq: - * Array.new(size=0, obj=nil) - * Array.new(array) - * Array.new(size) {|index| block } - * - * Returns a new array. In the first form, the new array is - * empty. In the second it is created with _size_ copies of _obj_ - * (that is, _size_ references to the same - * _obj_). The third form creates a copy of the array - * passed as a parameter (the array is generated by calling - * to_ary on the parameter). In the last form, an array - * of the given size is created. Each element in this array is - * calculated by passing the element's index to the given block and - * storing the return value. - * - * Array.new - * Array.new(2) - * Array.new(5, "A") - * - * # only one copy of the object is created - * a = Array.new(2, Hash.new) - * a[0]['cat'] = 'feline' - * a - * a[1]['cat'] = 'Felix' - * a - * - * # here multiple copies are created - * a = Array.new(2) { Hash.new } - * a[0]['cat'] = 'feline' - * a - * - * squares = Array.new(5) {|i| i*i} - * squares - * - * copy = Array.new(squares) - */ - -static VALUE -rb_ary_initialize(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - long len; - VALUE size, val; - - rb_ary_modify(ary); - if (rb_scan_args(argc, argv, "02", &size, &val) == 0) { - RARRAY(ary)->len = 0; - if (rb_block_given_p()) { - rb_warning("given block not used"); - } - return ary; - } - - if (argc == 1 && !FIXNUM_P(size)) { - val = rb_check_array_type(size); - if (!NIL_P(val)) { - rb_ary_replace(ary, val); - return ary; - } - } - - len = NUM2LONG(size); - if (len < 0) { - rb_raise(rb_eArgError, "negative array size"); - } - if (len > ARY_MAX_SIZE) { - rb_raise(rb_eArgError, "array size too big"); - } - if (len > RARRAY(ary)->aux.capa) { - REALLOC_N(RARRAY(ary)->ptr, VALUE, len); - RARRAY(ary)->aux.capa = len; - } - if (rb_block_given_p()) { - long i; - - if (argc == 2) { - rb_warn("block supersedes default value argument"); - } - for (i=0; ilen = i + 1; - } - } - else { - memfill(RARRAY(ary)->ptr, len, val); - RARRAY(ary)->len = len; - } - - return ary; -} - - -/* -* Returns a new array populated with the given objects. -* -* Array.[]( 1, 'a', /^A/ ) -* Array[ 1, 'a', /^A/ ] -* [ 1, 'a', /^A/ ] -*/ - -static VALUE -rb_ary_s_create(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - VALUE ary = ary_alloc(klass); - - if (argc > 0) { - RARRAY(ary)->ptr = ALLOC_N(VALUE, argc); - MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc); - } - RARRAY(ary)->len = RARRAY(ary)->aux.capa = argc; - - return ary; -} - -void -rb_ary_store(ary, idx, val) - VALUE ary; - long idx; - VALUE val; -{ - if (idx < 0) { - idx += RARRAY(ary)->len; - if (idx < 0) { - rb_raise(rb_eIndexError, "index %ld out of array", - idx - RARRAY(ary)->len); - } - } - else if (idx >= ARY_MAX_SIZE) { - rb_raise(rb_eIndexError, "index %ld too big", idx); - } - - rb_ary_modify(ary); - if (idx >= RARRAY(ary)->aux.capa) { - long new_capa = RARRAY(ary)->aux.capa / 2; - - if (new_capa < ARY_DEFAULT_SIZE) { - new_capa = ARY_DEFAULT_SIZE; - } - if (new_capa >= ARY_MAX_SIZE - idx) { - new_capa = (ARY_MAX_SIZE - idx) / 2; - } - new_capa += idx; - REALLOC_N(RARRAY(ary)->ptr, VALUE, new_capa); - RARRAY(ary)->aux.capa = new_capa; - } - if (idx > RARRAY(ary)->len) { - rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, - idx-RARRAY(ary)->len + 1); - } - - if (idx >= RARRAY(ary)->len) { - RARRAY(ary)->len = idx + 1; - } - RARRAY(ary)->ptr[idx] = val; -} - -/* - * call-seq: - * array << obj -> array - * - * Append---Pushes the given object on to the end of this array. This - * expression returns the array itself, so several appends - * may be chained together. - * - * [ 1, 2 ] << "c" << "d" << [ 3, 4 ] - * #=> [ 1, 2, "c", "d", [ 3, 4 ] ] - * - */ - -VALUE -rb_ary_push(ary, item) - VALUE ary; - VALUE item; -{ - rb_ary_store(ary, RARRAY(ary)->len, item); - return ary; -} - -/* - * call-seq: - * array.push(obj, ... ) -> array - * - * Append---Pushes the given object(s) on to the end of this array. This - * expression returns the array itself, so several appends - * may be chained together. - * - * a = [ "a", "b", "c" ] - * a.push("d", "e", "f") - * #=> ["a", "b", "c", "d", "e", "f"] - */ - -static VALUE -rb_ary_push_m(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - while (argc--) { - rb_ary_push(ary, *argv++); - } - return ary; -} - -/* - * call-seq: - * array.pop -> obj or nil - * - * Removes the last element from self and returns it, or - * nil if the array is empty. - * - * a = [ "a", "m", "z" ] - * a.pop #=> "z" - * a #=> ["a", "m"] - */ - -VALUE -rb_ary_pop(ary) - VALUE ary; -{ - rb_ary_modify_check(ary); - if (RARRAY(ary)->len == 0) return Qnil; - if (!FL_TEST(ary, ELTS_SHARED) && - RARRAY(ary)->len * 2 < RARRAY(ary)->aux.capa && - RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) { - RARRAY(ary)->aux.capa = RARRAY(ary)->len * 2; - REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa); - } - return RARRAY(ary)->ptr[--RARRAY(ary)->len]; -} - -static VALUE -ary_make_shared(ary) - VALUE ary; -{ - if (!FL_TEST(ary, ELTS_SHARED)) { - NEWOBJ(shared, struct RArray); - OBJSETUP(shared, rb_cArray, T_ARRAY); - - shared->len = RARRAY(ary)->len; - shared->ptr = RARRAY(ary)->ptr; - shared->aux.capa = RARRAY(ary)->aux.capa; - RARRAY(ary)->aux.shared = (VALUE)shared; - FL_SET(ary, ELTS_SHARED); - OBJ_FREEZE(shared); - return (VALUE)shared; - } - else { - return RARRAY(ary)->aux.shared; - } -} - -/* - * call-seq: - * array.shift -> obj or nil - * - * Returns the first element of self and removes it (shifting all - * other elements down by one). Returns nil if the array - * is empty. - * - * args = [ "-m", "-q", "filename" ] - * args.shift #=> "-m" - * args #=> ["-q", "filename"] - */ - -VALUE -rb_ary_shift(ary) - VALUE ary; -{ - VALUE top; - - rb_ary_modify_check(ary); - if (RARRAY(ary)->len == 0) return Qnil; - top = RARRAY(ary)->ptr[0]; - if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE && !FL_TEST(ary, ELTS_SHARED)) { - MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+1, VALUE, RARRAY_LEN(ary)-1); - } - else { - if (!FL_TEST(ary, ELTS_SHARED)) { - RARRAY(ary)->ptr[0] = Qnil; - } - ary_make_shared(ary); - RARRAY(ary)->ptr++; /* shift ptr */ - } - RARRAY(ary)->len--; - - return top; -} - -VALUE -rb_ary_unshift(ary, item) - VALUE ary, item; -{ - rb_ary_modify(ary); - if (RARRAY(ary)->len == RARRAY(ary)->aux.capa) { - long capa_inc = RARRAY(ary)->aux.capa / 2; - if (capa_inc < ARY_DEFAULT_SIZE) { - capa_inc = ARY_DEFAULT_SIZE; - } - RARRAY(ary)->aux.capa += capa_inc; - REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa); - } - - /* sliding items */ - MEMMOVE(RARRAY(ary)->ptr + 1, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len); - - RARRAY(ary)->len++; - RARRAY(ary)->ptr[0] = item; - - return ary; -} - -/* - * call-seq: - * array.unshift(obj, ...) -> array - * - * Prepends objects to the front of array. - * other elements up one. - * - * a = [ "b", "c", "d" ] - * a.unshift("a") #=> ["a", "b", "c", "d"] - * a.unshift(1, 2) #=> [ 1, 2, "a", "b", "c", "d"] - */ - -static VALUE -rb_ary_unshift_m(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - long len = RARRAY(ary)->len; - - if (argc == 0) return ary; - - /* make rooms by setting the last item */ - rb_ary_store(ary, len + argc - 1, Qnil); - - /* sliding items */ - MEMMOVE(RARRAY(ary)->ptr + argc, RARRAY(ary)->ptr, VALUE, len); - MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc); - - return ary; -} - -/* faster version - use this if you don't need to treat negative offset */ -static inline VALUE -rb_ary_elt(ary, offset) - VALUE ary; - long offset; -{ - if (RARRAY(ary)->len == 0) return Qnil; - if (offset < 0 || RARRAY(ary)->len <= offset) { - return Qnil; - } - return RARRAY(ary)->ptr[offset]; -} - -VALUE -rb_ary_entry(ary, offset) - VALUE ary; - long offset; -{ - if (offset < 0) { - offset += RARRAY(ary)->len; - } - return rb_ary_elt(ary, offset); -} - -static VALUE -rb_ary_subseq(ary, beg, len) - VALUE ary; - long beg, len; -{ - VALUE klass, ary2, shared; - VALUE *ptr; - - if (beg > RARRAY(ary)->len) return Qnil; - if (beg < 0 || len < 0) return Qnil; - - if (RARRAY(ary)->len < len || RARRAY(ary)->len < beg + len) { - len = RARRAY(ary)->len - beg; - if (len < 0) - len = 0; - } - klass = rb_obj_class(ary); - if (len == 0) return ary_new(klass, 0); - - shared = ary_make_shared(ary); - ptr = RARRAY(ary)->ptr; - ary2 = ary_alloc(klass); - RARRAY(ary2)->ptr = ptr + beg; - RARRAY(ary2)->len = len; - RARRAY(ary2)->aux.shared = shared; - FL_SET(ary2, ELTS_SHARED); - - return ary2; -} - -/* - * call-seq: - * array[index] -> obj or nil - * array[start, length] -> an_array or nil - * array[range] -> an_array or nil - * array.slice(index) -> obj or nil - * array.slice(start, length) -> an_array or nil - * array.slice(range) -> an_array or nil - * - * Element Reference---Returns the element at _index_, - * or returns a subarray starting at _start_ and - * continuing for _length_ elements, or returns a subarray - * specified by _range_. - * Negative indices count backward from the end of the - * array (-1 is the last element). Returns nil if the index - * (or starting index) are out of range. - * - * a = [ "a", "b", "c", "d", "e" ] - * a[2] + a[0] + a[1] #=> "cab" - * a[6] #=> nil - * a[1, 2] #=> [ "b", "c" ] - * a[1..3] #=> [ "b", "c", "d" ] - * a[4..7] #=> [ "e" ] - * a[6..10] #=> nil - * a[-3, 3] #=> [ "c", "d", "e" ] - * # special cases - * a[5] #=> nil - * a[5, 1] #=> [] - * a[5..10] #=> [] - * - */ - -VALUE -rb_ary_aref(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - VALUE arg; - long beg, len; - - if (argc == 2) { - if (SYMBOL_P(argv[0])) { - rb_raise(rb_eTypeError, "Symbol as array index"); - } - beg = NUM2LONG(argv[0]); - len = NUM2LONG(argv[1]); - if (beg < 0) { - beg += RARRAY(ary)->len; - } - return rb_ary_subseq(ary, beg, len); - } - if (argc != 1) { - rb_scan_args(argc, argv, "11", 0, 0); - } - arg = argv[0]; - /* special case - speeding up */ - if (FIXNUM_P(arg)) { - return rb_ary_entry(ary, FIX2LONG(arg)); - } - if (SYMBOL_P(arg)) { - rb_raise(rb_eTypeError, "Symbol as array index"); - } - /* check if idx is Range */ - switch (rb_range_beg_len(arg, &beg, &len, RARRAY(ary)->len, 0)) { - case Qfalse: - break; - case Qnil: - return Qnil; - default: - return rb_ary_subseq(ary, beg, len); - } - return rb_ary_entry(ary, NUM2LONG(arg)); -} - -/* - * call-seq: - * array.at(index) -> obj or nil - * - * Returns the element at _index_. A - * negative index counts from the end of _self_. Returns +nil+ - * if the index is out of range. See also Array#[]. - * (Array#at is slightly faster than Array#[], - * as it does not accept ranges and so on.) - * - * a = [ "a", "b", "c", "d", "e" ] - * a.at(0) #=> "a" - * a.at(-1) #=> "e" - */ - -static VALUE -rb_ary_at(ary, pos) - VALUE ary, pos; -{ - return rb_ary_entry(ary, NUM2LONG(pos)); -} - -/* - * call-seq: - * array.first -> obj or nil - * array.first(n) -> an_array - * - * Returns the first element, or the first +n+ elements, of the array. - * If the array is empty, the first form returns nil, and the - * second form returns an empty array. - * - * a = [ "q", "r", "s", "t" ] - * a.first #=> "q" - * a.first(1) #=> ["q"] - * a.first(3) #=> ["q", "r", "s"] - */ - -static VALUE -rb_ary_first(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - if (argc == 0) { - if (RARRAY(ary)->len == 0) return Qnil; - return RARRAY(ary)->ptr[0]; - } - else { - VALUE nv, result; - long n, i; - - rb_scan_args(argc, argv, "01", &nv); - n = NUM2LONG(nv); - if (n > RARRAY(ary)->len) n = RARRAY(ary)->len; - result = rb_ary_new2(n); - for (i=0; iptr[i]); - } - return result; - } -} - -/* - * call-seq: - * array.last -> obj or nil - * array.last(n) -> an_array - * - * Returns the last element(s) of self. If the array is empty, - * the first form returns nil. - * - * [ "w", "x", "y", "z" ].last #=> "z" - */ - -static VALUE -rb_ary_last(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - if (argc == 0) { - if (RARRAY(ary)->len == 0) return Qnil; - return RARRAY(ary)->ptr[RARRAY(ary)->len-1]; - } - else { - VALUE nv, result; - long n, i; - - rb_scan_args(argc, argv, "01", &nv); - n = NUM2LONG(nv); - if (n > RARRAY(ary)->len) n = RARRAY(ary)->len; - result = rb_ary_new2(n); - for (i=RARRAY(ary)->len-n; n--; i++) { - rb_ary_push(result, RARRAY(ary)->ptr[i]); - } - return result; - } -} - -/* - * call-seq: - * array.fetch(index) -> obj - * array.fetch(index, default ) -> obj - * array.fetch(index) {|index| block } -> obj - * - * Tries to return the element at position index. If the index - * lies outside the array, the first form throws an - * IndexError exception, the second form returns - * default, and the third form returns the value of invoking - * the block, passing in the index. Negative values of index - * count from the end of the array. - * - * a = [ 11, 22, 33, 44 ] - * a.fetch(1) #=> 22 - * a.fetch(-1) #=> 44 - * a.fetch(4, 'cat') #=> "cat" - * a.fetch(4) { |i| i*i } #=> 16 - */ - -static VALUE -rb_ary_fetch(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - VALUE pos, ifnone; - long block_given; - long idx; - - rb_scan_args(argc, argv, "11", &pos, &ifnone); - block_given = rb_block_given_p(); - if (block_given && argc == 2) { - rb_warn("block supersedes default value argument"); - } - idx = NUM2LONG(pos); - - if (idx < 0) { - idx += RARRAY(ary)->len; - } - if (idx < 0 || RARRAY(ary)->len <= idx) { - if (block_given) return rb_yield(pos); - if (argc == 1) { - rb_raise(rb_eIndexError, "index %ld out of array", idx); - } - return ifnone; - } - return RARRAY(ary)->ptr[idx]; -} - -/* - * call-seq: - * array.index(obj) -> int or nil - * - * Returns the index of the first object in self such that is - * == to obj. Returns nil if - * no match is found. - * - * a = [ "a", "b", "c" ] - * a.index("b") #=> 1 - * a.index("z") #=> nil - */ - -static VALUE -rb_ary_index(ary, val) - VALUE ary; - VALUE val; -{ - long i; - - for (i=0; ilen; i++) { - if (rb_equal(RARRAY(ary)->ptr[i], val)) - return LONG2NUM(i); - } - return Qnil; -} - -/* - * call-seq: - * array.rindex(obj) -> int or nil - * - * Returns the index of the last object in array - * == to obj. Returns nil if - * no match is found. - * - * a = [ "a", "b", "b", "b", "c" ] - * a.rindex("b") #=> 3 - * a.rindex("z") #=> nil - */ - -static VALUE -rb_ary_rindex(ary, val) - VALUE ary; - VALUE val; -{ - long i = RARRAY(ary)->len; - - while (i--) { - if (i > RARRAY(ary)->len) { - i = RARRAY(ary)->len; - continue; - } - if (rb_equal(RARRAY(ary)->ptr[i], val)) - return LONG2NUM(i); - } - return Qnil; -} - -/* - * call-seq: - * array.indexes( i1, i2, ... iN ) -> an_array - * array.indices( i1, i2, ... iN ) -> an_array - * - * Deprecated; use Array#values_at. - */ - -static VALUE -rb_ary_indexes(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - VALUE new_ary; - long i; - - rb_warn("Array#%s is deprecated; use Array#values_at", rb_id2name(rb_frame_last_func())); - new_ary = rb_ary_new2(argc); - for (i=0; ilen; - if (beg < 0) { - beg -= RARRAY(ary)->len; - rb_raise(rb_eIndexError, "index %ld out of array", beg); - } - } - if (RARRAY(ary)->len < len || RARRAY(ary)->len < beg + len) { - len = RARRAY(ary)->len - beg; - } - - if (NIL_P(rpl)) { - rlen = 0; - } - else { - rpl = rb_ary_to_ary(rpl); - rlen = RARRAY(rpl)->len; - } - rb_ary_modify(ary); - - if (beg >= RARRAY(ary)->len) { - if (beg > ARY_MAX_SIZE - rlen) { - rb_raise(rb_eIndexError, "index %ld too big", beg); - } - len = beg + rlen; - if (len >= RARRAY(ary)->aux.capa) { - REALLOC_N(RARRAY(ary)->ptr, VALUE, len); - RARRAY(ary)->aux.capa = len; - } - rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, beg - RARRAY(ary)->len); - if (rlen > 0) { - MEMCPY(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen); - } - RARRAY(ary)->len = len; - } - else { - long alen; - - if (beg + len > RARRAY(ary)->len) { - len = RARRAY(ary)->len - beg; - } - - alen = RARRAY(ary)->len + rlen - len; - if (alen >= RARRAY(ary)->aux.capa) { - REALLOC_N(RARRAY(ary)->ptr, VALUE, alen); - RARRAY(ary)->aux.capa = alen; - } - - if (len != rlen) { - MEMMOVE(RARRAY(ary)->ptr + beg + rlen, RARRAY(ary)->ptr + beg + len, - VALUE, RARRAY(ary)->len - (beg + len)); - RARRAY(ary)->len = alen; - } - if (rlen > 0) { - MEMMOVE(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen); - } - } -} - -/* - * call-seq: - * array[index] = obj -> obj - * array[start, length] = obj or an_array or nil -> obj or an_array or nil - * array[range] = obj or an_array or nil -> obj or an_array or nil - * - * Element Assignment---Sets the element at _index_, - * or replaces a subarray starting at _start_ and - * continuing for _length_ elements, or replaces a subarray - * specified by _range_. If indices are greater than - * the current capacity of the array, the array grows - * automatically. A negative indices will count backward - * from the end of the array. Inserts elements if _length_ is - * zero. If +nil+ is used in the second and third form, - * deletes elements from _self_. An +IndexError+ is raised if a - * negative index points past the beginning of the array. See also - * Array#push, and Array#unshift. - * - * a = Array.new - * a[4] = "4"; #=> [nil, nil, nil, nil, "4"] - * a[0, 3] = [ 'a', 'b', 'c' ] #=> ["a", "b", "c", nil, "4"] - * a[1..2] = [ 1, 2 ] #=> ["a", 1, 2, nil, "4"] - * a[0, 2] = "?" #=> ["?", 2, nil, "4"] - * a[0..2] = "A" #=> ["A", "4"] - * a[-1] = "Z" #=> ["A", "Z"] - * a[1..-1] = nil #=> ["A"] - */ - -static VALUE -rb_ary_aset(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - long offset, beg, len; - - if (argc == 3) { - if (SYMBOL_P(argv[0])) { - rb_raise(rb_eTypeError, "Symbol as array index"); - } - if (SYMBOL_P(argv[1])) { - rb_raise(rb_eTypeError, "Symbol as subarray length"); - } - rb_ary_splice(ary, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]); - return argv[2]; - } - if (argc != 2) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc); - } - if (FIXNUM_P(argv[0])) { - offset = FIX2LONG(argv[0]); - goto fixnum; - } - if (SYMBOL_P(argv[0])) { - rb_raise(rb_eTypeError, "Symbol as array index"); - } - if (rb_range_beg_len(argv[0], &beg, &len, RARRAY(ary)->len, 1)) { - /* check if idx is Range */ - rb_ary_splice(ary, beg, len, argv[1]); - return argv[1]; - } - - offset = NUM2LONG(argv[0]); -fixnum: - rb_ary_store(ary, offset, argv[1]); - return argv[1]; -} - -/* - * call-seq: - * array.insert(index, obj...) -> array - * - * Inserts the given values before the element with the given index - * (which may be negative). - * - * a = %w{ a b c d } - * a.insert(2, 99) #=> ["a", "b", 99, "c", "d"] - * a.insert(-2, 1, 2, 3) #=> ["a", "b", 99, "c", 1, 2, 3, "d"] - */ - -static VALUE -rb_ary_insert(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - long pos; - - if (argc == 1) return ary; - if (argc < 1) { - rb_raise(rb_eArgError, "wrong number of arguments (at least 1)"); - } - pos = NUM2LONG(argv[0]); - if (pos == -1) { - pos = RARRAY(ary)->len; - } - if (pos < 0) { - pos++; - } - rb_ary_splice(ary, pos, 0, rb_ary_new4(argc - 1, argv + 1)); - return ary; -} - -/* - * call-seq: - * array.each {|item| block } -> array - * - * Calls block once for each element in self, passing that - * element as a parameter. - * - * a = [ "a", "b", "c" ] - * a.each {|x| print x, " -- " } - * - * produces: - * - * a -- b -- c -- - */ - -VALUE -rb_ary_each(ary) - VALUE ary; -{ - long i; - - for (i=0; ilen; i++) { - rb_yield(RARRAY(ary)->ptr[i]); - } - return ary; -} - -/* - * call-seq: - * array.each_index {|index| block } -> array - * - * Same as Array#each, but passes the index of the element - * instead of the element itself. - * - * a = [ "a", "b", "c" ] - * a.each_index {|x| print x, " -- " } - * - * produces: - * - * 0 -- 1 -- 2 -- - */ - -static VALUE -rb_ary_each_index(ary) - VALUE ary; -{ - long i; - - for (i=0; ilen; i++) { - rb_yield(LONG2NUM(i)); - } - return ary; -} - -/* - * call-seq: - * array.reverse_each {|item| block } - * - * Same as Array#each, but traverses self in reverse - * order. - * - * a = [ "a", "b", "c" ] - * a.reverse_each {|x| print x, " " } - * - * produces: - * - * c b a - */ - -static VALUE -rb_ary_reverse_each(ary) - VALUE ary; -{ - long len = RARRAY(ary)->len; - - while (len--) { - rb_yield(RARRAY(ary)->ptr[len]); - if (RARRAY(ary)->len < len) { - len = RARRAY(ary)->len; - } - } - return ary; -} - -/* - * call-seq: - * array.length -> int - * - * Returns the number of elements in self. May be zero. - * - * [ 1, 2, 3, 4, 5 ].length #=> 5 - */ - -static VALUE -rb_ary_length(ary) - VALUE ary; -{ - return LONG2NUM(RARRAY(ary)->len); -} - -/* - * call-seq: - * array.empty? -> true or false - * - * Returns true if self array contains no elements. - * - * [].empty? #=> true - */ - -static VALUE -rb_ary_empty_p(ary) - VALUE ary; -{ - if (RARRAY(ary)->len == 0) - return Qtrue; - return Qfalse; -} - -VALUE -rb_ary_dup(ary) - VALUE ary; -{ - VALUE dup = rb_ary_new2(RARRAY(ary)->len); - - DUPSETUP(dup, ary); - MEMCPY(RARRAY(dup)->ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len); - RARRAY(dup)->len = RARRAY(ary)->len; - return dup; -} - -extern VALUE rb_output_fs; - -static VALUE -inspect_join(ary, arg) - VALUE ary; - VALUE *arg; -{ - return rb_ary_join(arg[0], arg[1]); -} - -VALUE -rb_ary_join(ary, sep) - VALUE ary, sep; -{ - long len = 1, i; - int taint = Qfalse; - VALUE result, tmp; - - if (RARRAY(ary)->len == 0) return rb_str_new(0, 0); - if (OBJ_TAINTED(ary) || OBJ_TAINTED(sep)) taint = Qtrue; - - for (i=0; ilen; i++) { - tmp = rb_check_string_type(RARRAY(ary)->ptr[i]); - len += NIL_P(tmp) ? 10 : RSTRING(tmp)->len; - } - if (!NIL_P(sep)) { - StringValue(sep); - len += RSTRING(sep)->len * (RARRAY(ary)->len - 1); - } - result = rb_str_buf_new(len); - for (i=0; ilen; i++) { - tmp = RARRAY(ary)->ptr[i]; - switch (TYPE(tmp)) { - case T_STRING: - break; - case T_ARRAY: - if (tmp == ary || rb_inspecting_p(tmp)) { - tmp = rb_str_new2("[...]"); - } - else { - VALUE args[2]; - - args[0] = tmp; - args[1] = sep; - tmp = rb_protect_inspect(inspect_join, ary, (VALUE)args); - } - break; - default: - tmp = rb_obj_as_string(tmp); - } - if (i > 0 && !NIL_P(sep)) - rb_str_buf_append(result, sep); - rb_str_buf_append(result, tmp); - if (OBJ_TAINTED(tmp)) taint = Qtrue; - } - - if (taint) OBJ_TAINT(result); - return result; -} - -/* - * call-seq: - * array.join(sep=$,) -> str - * - * Returns a string created by converting each element of the array to - * a string, separated by sep. - * - * [ "a", "b", "c" ].join #=> "abc" - * [ "a", "b", "c" ].join("-") #=> "a-b-c" - */ - -static VALUE -rb_ary_join_m(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - VALUE sep; - - rb_scan_args(argc, argv, "01", &sep); - if (NIL_P(sep)) sep = rb_output_fs; - - return rb_ary_join(ary, sep); -} - -/* - * call-seq: - * array.to_s -> string - * - * Returns _self_.join. - * - * [ "a", "e", "i", "o" ].to_s #=> "aeio" - * - */ - -VALUE -rb_ary_to_s(ary) - VALUE ary; -{ - if (RARRAY(ary)->len == 0) return rb_str_new(0, 0); - - return rb_ary_join(ary, rb_output_fs); -} - -static ID inspect_key; - -struct inspect_arg { - VALUE (*func)(); - VALUE arg1, arg2; -}; - -static VALUE -inspect_call(arg) - struct inspect_arg *arg; -{ - return (*arg->func)(arg->arg1, arg->arg2); -} - -static VALUE -get_inspect_tbl(create) - int create; -{ - VALUE inspect_tbl = rb_thread_local_aref(rb_thread_current(), inspect_key); - - if (NIL_P(inspect_tbl)) { - if (create) { - tbl_init: - inspect_tbl = rb_ary_new(); - rb_thread_local_aset(rb_thread_current(), inspect_key, inspect_tbl); - } - } - else if (TYPE(inspect_tbl) != T_ARRAY) { - rb_warn("invalid inspect_tbl value"); - if (create) goto tbl_init; - rb_thread_local_aset(rb_thread_current(), inspect_key, Qnil); - return Qnil; - } - return inspect_tbl; -} - -static VALUE -inspect_ensure(obj) - VALUE obj; -{ - VALUE inspect_tbl; - - inspect_tbl = get_inspect_tbl(Qfalse); - if (!NIL_P(inspect_tbl)) { - rb_ary_pop(inspect_tbl); - } - return 0; -} - -VALUE -rb_protect_inspect(func, obj, arg) - VALUE (*func)(ANYARGS); - VALUE obj, arg; -{ - struct inspect_arg iarg; - VALUE inspect_tbl; - VALUE id; - - inspect_tbl = get_inspect_tbl(Qtrue); - id = rb_obj_id(obj); - if (rb_ary_includes(inspect_tbl, id)) { - return (*func)(obj, arg); - } - rb_ary_push(inspect_tbl, id); - iarg.func = func; - iarg.arg1 = obj; - iarg.arg2 = arg; - - return rb_ensure(inspect_call, (VALUE)&iarg, inspect_ensure, obj); -} - -VALUE -rb_inspecting_p(obj) - VALUE obj; -{ - VALUE inspect_tbl; - - inspect_tbl = get_inspect_tbl(Qfalse); - if (NIL_P(inspect_tbl)) return Qfalse; - return rb_ary_includes(inspect_tbl, rb_obj_id(obj)); -} - -static VALUE -inspect_ary(ary) - VALUE ary; -{ - int tainted = OBJ_TAINTED(ary); - long i; - VALUE s, str; - - str = rb_str_buf_new2("["); - for (i=0; ilen; i++) { - s = rb_inspect(RARRAY(ary)->ptr[i]); - if (OBJ_TAINTED(s)) tainted = Qtrue; - if (i > 0) rb_str_buf_cat2(str, ", "); - rb_str_buf_append(str, s); - } - rb_str_buf_cat2(str, "]"); - if (tainted) OBJ_TAINT(str); - return str; -} - -/* - * call-seq: - * array.inspect -> string - * - * Create a printable version of array. - */ - -static VALUE -rb_ary_inspect(ary) - VALUE ary; -{ - if (RARRAY(ary)->len == 0) return rb_str_new2("[]"); - if (rb_inspecting_p(ary)) return rb_str_new2("[...]"); - return rb_protect_inspect(inspect_ary, ary, 0); -} - -/* - * call-seq: - * array.to_a -> array - * - * Returns _self_. If called on a subclass of Array, converts - * the receiver to an Array object. - */ - -static VALUE -rb_ary_to_a(ary) - VALUE ary; -{ - if (rb_obj_class(ary) != rb_cArray) { - VALUE dup = rb_ary_new2(RARRAY(ary)->len); - rb_ary_replace(dup, ary); - return dup; - } - return ary; -} - -/* - * call-seq: - * array.to_ary -> array - * - * Returns _self_. - */ - -static VALUE -rb_ary_to_ary_m(ary) - VALUE ary; -{ - return ary; -} - -VALUE -rb_ary_reverse(ary) - VALUE ary; -{ - VALUE *p1, *p2; - VALUE tmp; - - rb_ary_modify(ary); - if (RARRAY(ary)->len > 1) { - p1 = RARRAY(ary)->ptr; - p2 = p1 + RARRAY(ary)->len - 1; /* points last item */ - - while (p1 < p2) { - tmp = *p1; - *p1++ = *p2; - *p2-- = tmp; - } - } - return ary; -} - -/* - * call-seq: - * array.reverse! -> array - * - * Reverses _self_ in place. - * - * a = [ "a", "b", "c" ] - * a.reverse! #=> ["c", "b", "a"] - * a #=> ["c", "b", "a"] - */ - -static VALUE -rb_ary_reverse_bang(ary) - VALUE ary; -{ - return rb_ary_reverse(ary); -} - -/* - * call-seq: - * array.reverse -> an_array - * - * Returns a new array containing self's elements in reverse order. - * - * [ "a", "b", "c" ].reverse #=> ["c", "b", "a"] - * [ 1 ].reverse #=> [1] - */ - -static VALUE -rb_ary_reverse_m(ary) - VALUE ary; -{ - return rb_ary_reverse(rb_ary_dup(ary)); -} - -struct ary_sort_data { - VALUE ary; - VALUE *ptr; - long len; -}; - -static void -ary_sort_check(data) - struct ary_sort_data *data; -{ - if (RARRAY(data->ary)->ptr != data->ptr || RARRAY(data->ary)->len != data->len) { - rb_raise(rb_eArgError, "array modified during sort"); - } -} - -static int -sort_1(a, b, data) - VALUE *a, *b; - struct ary_sort_data *data; -{ - VALUE retval = rb_yield_values(2, *a, *b); - int n; - - n = rb_cmpint(retval, *a, *b); - ary_sort_check(data); - return n; -} - -static int -sort_2(ap, bp, data) - VALUE *ap, *bp; - struct ary_sort_data *data; -{ - VALUE retval; - VALUE a = *ap, b = *bp; - int n; - - if (FIXNUM_P(a) && FIXNUM_P(b)) { - if ((long)a > (long)b) return 1; - if ((long)a < (long)b) return -1; - return 0; - } - if (TYPE(a) == T_STRING) { - if (TYPE(b) == T_STRING) return rb_str_cmp(a, b); - } - - retval = rb_funcall(a, id_cmp, 1, b); - n = rb_cmpint(retval, a, b); - ary_sort_check(data); - - return n; -} - -static VALUE -sort_internal(ary) - VALUE ary; -{ - struct ary_sort_data data; - - data.ary = ary; - data.ptr = RARRAY(ary)->ptr; data.len = RARRAY(ary)->len; - qsort(RARRAY(ary)->ptr, RARRAY(ary)->len, sizeof(VALUE), - rb_block_given_p()?sort_1:sort_2, &data); - return ary; -} - -static VALUE -sort_unlock(ary) - VALUE ary; -{ - FL_UNSET(ary, ARY_TMPLOCK); - return ary; -} - -/* - * call-seq: - * array.sort! -> array - * array.sort! {| a,b | block } -> array - * - * Sorts _self_. Comparisons for - * the sort will be done using the <=> operator or using - * an optional code block. The block implements a comparison between - * a and b, returning -1, 0, or +1. See also - * Enumerable#sort_by. - * - * a = [ "d", "a", "e", "c", "b" ] - * a.sort #=> ["a", "b", "c", "d", "e"] - * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"] - */ - -VALUE -rb_ary_sort_bang(ary) - VALUE ary; -{ - rb_ary_modify(ary); - if (RARRAY(ary)->len > 1) { - FL_SET(ary, ARY_TMPLOCK); /* prohibit modification during sort */ - rb_ensure(sort_internal, ary, sort_unlock, ary); - } - return ary; -} - -/* - * call-seq: - * array.sort -> an_array - * array.sort {| a,b | block } -> an_array - * - * Returns a new array created by sorting self. Comparisons for - * the sort will be done using the <=> operator or using - * an optional code block. The block implements a comparison between - * a and b, returning -1, 0, or +1. See also - * Enumerable#sort_by. - * - * a = [ "d", "a", "e", "c", "b" ] - * a.sort #=> ["a", "b", "c", "d", "e"] - * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"] - */ - -VALUE -rb_ary_sort(ary) - VALUE ary; -{ - ary = rb_ary_dup(ary); - rb_ary_sort_bang(ary); - return ary; -} - -/* - * call-seq: - * array.collect {|item| block } -> an_array - * array.map {|item| block } -> an_array - * - * Invokes block once for each element of self. Creates a - * new array containing the values returned by the block. - * See also Enumerable#collect. - * - * a = [ "a", "b", "c", "d" ] - * a.collect {|x| x + "!" } #=> ["a!", "b!", "c!", "d!"] - * a #=> ["a", "b", "c", "d"] - */ - -static VALUE -rb_ary_collect(ary) - VALUE ary; -{ - long i; - VALUE collect; - - if (!rb_block_given_p()) { - return rb_ary_new4(RARRAY(ary)->len, RARRAY(ary)->ptr); - } - - collect = rb_ary_new2(RARRAY(ary)->len); - for (i = 0; i < RARRAY(ary)->len; i++) { - rb_ary_push(collect, rb_yield(RARRAY(ary)->ptr[i])); - } - return collect; -} - -/* - * call-seq: - * array.collect! {|item| block } -> array - * array.map! {|item| block } -> array - * - * Invokes the block once for each element of _self_, replacing the - * element with the value returned by _block_. - * See also Enumerable#collect. - * - * a = [ "a", "b", "c", "d" ] - * a.collect! {|x| x + "!" } - * a #=> [ "a!", "b!", "c!", "d!" ] - */ - -static VALUE -rb_ary_collect_bang(ary) - VALUE ary; -{ - long i; - - rb_ary_modify(ary); - for (i = 0; i < RARRAY(ary)->len; i++) { - rb_ary_store(ary, i, rb_yield(RARRAY(ary)->ptr[i])); - } - return ary; -} - -VALUE -rb_values_at(obj, olen, argc, argv, func) - VALUE obj; - long olen; - int argc; - VALUE *argv; - VALUE (*func) _((VALUE,long)); -{ - VALUE result = rb_ary_new2(argc); - long beg, len, i, j; - - for (i=0; i an_array - * - * Returns an array containing the elements in - * _self_ corresponding to the given selector(s). The selectors - * may be either integer indices or ranges. - * See also Array#select. - * - * a = %w{ a b c d e f } - * a.values_at(1, 3, 5) - * a.values_at(1, 3, 5, 7) - * a.values_at(-1, -3, -5, -7) - * a.values_at(1..3, 2...5) - */ - -static VALUE -rb_ary_values_at(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - return rb_values_at(ary, RARRAY(ary)->len, argc, argv, rb_ary_entry); -} - -/* - * call-seq: - * array.select {|item| block } -> an_array - * - * Invokes the block passing in successive elements from array, - * returning an array containing those elements for which the block - * returns a true value (equivalent to Enumerable#select). - * - * a = %w{ a b c d e f } - * a.select {|v| v =~ /[aeiou]/} #=> ["a", "e"] - */ - -static VALUE -rb_ary_select(ary) - VALUE ary; -{ - VALUE result; - long i; - - result = rb_ary_new2(RARRAY(ary)->len); - for (i = 0; i < RARRAY(ary)->len; i++) { - if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) { - rb_ary_push(result, rb_ary_elt(ary, i)); - } - } - return result; -} - -/* - * call-seq: - * array.delete(obj) -> obj or nil - * array.delete(obj) { block } -> obj or nil - * - * Deletes items from self that are equal to obj. If - * the item is not found, returns nil. If the optional - * code block is given, returns the result of block if the item - * is not found. - * - * a = [ "a", "b", "b", "b", "c" ] - * a.delete("b") #=> "b" - * a #=> ["a", "c"] - * a.delete("z") #=> nil - * a.delete("z") { "not found" } #=> "not found" - */ - -VALUE -rb_ary_delete(ary, item) - VALUE ary; - VALUE item; -{ - long i1, i2; - - for (i1 = i2 = 0; i1 < RARRAY(ary)->len; i1++) { - VALUE e = RARRAY(ary)->ptr[i1]; - - if (rb_equal(e, item)) continue; - if (i1 != i2) { - rb_ary_store(ary, i2, e); - } - i2++; - } - if (RARRAY(ary)->len == i2) { - if (rb_block_given_p()) { - return rb_yield(item); - } - return Qnil; - } - - rb_ary_modify(ary); - if (RARRAY(ary)->len > i2) { - RARRAY(ary)->len = i2; - if (i2 * 2 < RARRAY(ary)->aux.capa && - RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) { - REALLOC_N(RARRAY(ary)->ptr, VALUE, i2 * 2); - RARRAY(ary)->aux.capa = i2 * 2; - } - } - - return item; -} - -VALUE -rb_ary_delete_at(ary, pos) - VALUE ary; - long pos; -{ - long i, len = RARRAY(ary)->len; - VALUE del; - - if (pos >= len) return Qnil; - if (pos < 0) { - pos += len; - if (pos < 0) return Qnil; - } - - rb_ary_modify(ary); - del = RARRAY(ary)->ptr[pos]; - for (i = pos + 1; i < len; i++, pos++) { - RARRAY(ary)->ptr[pos] = RARRAY(ary)->ptr[i]; - } - RARRAY(ary)->len = pos; - - return del; -} - -/* - * call-seq: - * array.delete_at(index) -> obj or nil - * - * Deletes the element at the specified index, returning that element, - * or nil if the index is out of range. See also - * Array#slice!. - * - * a = %w( ant bat cat dog ) - * a.delete_at(2) #=> "cat" - * a #=> ["ant", "bat", "dog"] - * a.delete_at(99) #=> nil - */ - -static VALUE -rb_ary_delete_at_m(ary, pos) - VALUE ary, pos; -{ - return rb_ary_delete_at(ary, NUM2LONG(pos)); -} - -/* - * call-seq: - * array.slice!(index) -> obj or nil - * array.slice!(start, length) -> sub_array or nil - * array.slice!(range) -> sub_array or nil - * - * Deletes the element(s) given by an index (optionally with a length) - * or by a range. Returns the deleted object, subarray, or - * nil if the index is out of range. Equivalent to: - * - * def slice!(*args) - * result = self[*args] - * self[*args] = nil - * result - * end - * - * a = [ "a", "b", "c" ] - * a.slice!(1) #=> "b" - * a #=> ["a", "c"] - * a.slice!(-1) #=> "c" - * a #=> ["a"] - * a.slice!(100) #=> nil - * a #=> ["a"] - */ - -static VALUE -rb_ary_slice_bang(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - VALUE arg1, arg2; - long pos, len; - - if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2) { - pos = NUM2LONG(arg1); - len = NUM2LONG(arg2); - delete_pos_len: - if (pos < 0) { - pos = RARRAY(ary)->len + pos; - } - arg2 = rb_ary_subseq(ary, pos, len); - rb_ary_splice(ary, pos, len, Qnil); /* Qnil/rb_ary_new2(0) */ - return arg2; - } - - if (!FIXNUM_P(arg1) && rb_range_beg_len(arg1, &pos, &len, RARRAY(ary)->len, 1)) { - goto delete_pos_len; - } - - return rb_ary_delete_at(ary, NUM2LONG(arg1)); -} - -/* - * call-seq: - * array.reject! {|item| block } -> array or nil - * - * Equivalent to Array#delete_if, deleting elements from - * _self_ for which the block evaluates to true, but returns - * nil if no changes were made. Also see - * Enumerable#reject. - */ - -static VALUE -rb_ary_reject_bang(ary) - VALUE ary; -{ - long i1, i2; - - rb_ary_modify(ary); - for (i1 = i2 = 0; i1 < RARRAY(ary)->len; i1++) { - VALUE v = RARRAY(ary)->ptr[i1]; - if (RTEST(rb_yield(v))) continue; - if (i1 != i2) { - rb_ary_store(ary, i2, v); - } - i2++; - } - if (RARRAY(ary)->len == i2) return Qnil; - if (i2 < RARRAY(ary)->len) - RARRAY(ary)->len = i2; - - return ary; -} - -/* - * call-seq: - * array.reject {|item| block } -> an_array - * - * Returns a new array containing the items in _self_ - * for which the block is not true. - */ - -static VALUE -rb_ary_reject(ary) - VALUE ary; -{ - ary = rb_ary_dup(ary); - rb_ary_reject_bang(ary); - return ary; -} - -/* - * call-seq: - * array.delete_if {|item| block } -> array - * - * Deletes every element of self for which block evaluates - * to true. - * - * a = [ "a", "b", "c" ] - * a.delete_if {|x| x >= "b" } #=> ["a"] - */ - -static VALUE -rb_ary_delete_if(ary) - VALUE ary; -{ - rb_ary_reject_bang(ary); - return ary; -} - -/* - * call-seq: - * array.zip(arg, ...) -> an_array - * array.zip(arg, ...) {| arr | block } -> nil - * - * Converts any arguments to arrays, then merges elements of - * self with corresponding elements from each argument. This - * generates a sequence of self.size n-element - * arrays, where n is one more that the count of arguments. If - * the size of any argument is less than enumObj.size, - * nil values are supplied. If a block given, it is - * invoked for each output array, otherwise an array of arrays is - * returned. - * - * a = [ 4, 5, 6 ] - * b = [ 7, 8, 9 ] - * - * [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]] - * [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]] - * a.zip([1,2],[8]) #=> [[4,1,8], [5,2,nil], [6,nil,nil]] - */ - -static VALUE -rb_ary_zip(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - int i, j; - long len; - VALUE result; - - for (i=0; ilen; i++) { - VALUE tmp = rb_ary_new2(argc+1); - - rb_ary_push(tmp, rb_ary_elt(ary, i)); - for (j=0; jlen; - result = rb_ary_new2(len); - for (i=0; i an_array - * - * Assumes that self is an array of arrays and transposes the - * rows and columns. - * - * a = [[1,2], [3,4], [5,6]] - * a.transpose #=> [[1, 3, 5], [2, 4, 6]] - */ - -static VALUE -rb_ary_transpose(ary) - VALUE ary; -{ - long elen = -1, alen, i, j; - VALUE tmp, result = 0; - - alen = RARRAY(ary)->len; - if (alen == 0) return rb_ary_dup(ary); - for (i=0; ilen; - result = rb_ary_new2(elen); - for (j=0; jlen) { - rb_raise(rb_eIndexError, "element size differs (%d should be %d)", - RARRAY(tmp)->len, elen); - } - for (j=0; j array - * - * Replaces the contents of self with the contents of - * other_array, truncating or expanding if necessary. - * - * a = [ "a", "b", "c", "d", "e" ] - * a.replace([ "x", "y", "z" ]) #=> ["x", "y", "z"] - * a #=> ["x", "y", "z"] - */ - -static VALUE -rb_ary_replace(copy, orig) - VALUE copy, orig; -{ - VALUE shared; - - rb_ary_modify(copy); - orig = to_ary(orig); - if (copy == orig) return copy; - shared = ary_make_shared(orig); - if (RARRAY(copy)->ptr && !FL_TEST(copy, ELTS_SHARED)) - free(RARRAY(copy)->ptr); - RARRAY(copy)->ptr = RARRAY(orig)->ptr; - RARRAY(copy)->len = RARRAY(orig)->len; - RARRAY(copy)->aux.shared = shared; - FL_SET(copy, ELTS_SHARED); - - return copy; -} - -/* - * call-seq: - * array.clear -> array - * - * Removes all elements from _self_. - * - * a = [ "a", "b", "c", "d", "e" ] - * a.clear #=> [ ] - */ - -VALUE -rb_ary_clear(ary) - VALUE ary; -{ - rb_ary_modify(ary); - RARRAY(ary)->len = 0; - if (ARY_DEFAULT_SIZE * 2 < RARRAY(ary)->aux.capa) { - REALLOC_N(RARRAY(ary)->ptr, VALUE, ARY_DEFAULT_SIZE * 2); - RARRAY(ary)->aux.capa = ARY_DEFAULT_SIZE * 2; - } - return ary; -} - -/* - * call-seq: - * array.fill(obj) -> array - * array.fill(obj, start [, length]) -> array - * array.fill(obj, range ) -> array - * array.fill {|index| block } -> array - * array.fill(start [, length] ) {|index| block } -> array - * array.fill(range) {|index| block } -> array - * - * The first three forms set the selected elements of self (which - * may be the entire array) to obj. A start of - * nil is equivalent to zero. A length of - * nil is equivalent to self.length. The last three - * forms fill the array with the value of the block. The block is - * passed the absolute index of each element to be filled. - * - * a = [ "a", "b", "c", "d" ] - * a.fill("x") #=> ["x", "x", "x", "x"] - * a.fill("z", 2, 2) #=> ["x", "x", "z", "z"] - * a.fill("y", 0..1) #=> ["y", "y", "z", "z"] - * a.fill {|i| i*i} #=> [0, 1, 4, 9] - * a.fill(-2) {|i| i*i*i} #=> [0, 1, 8, 27] - */ - -static VALUE -rb_ary_fill(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - VALUE item, arg1, arg2; - long beg = 0, end = 0, len = 0; - VALUE *p, *pend; - int block_p = Qfalse; - - if (rb_block_given_p()) { - block_p = Qtrue; - rb_scan_args(argc, argv, "02", &arg1, &arg2); - argc += 1; /* hackish */ - } - else { - rb_scan_args(argc, argv, "12", &item, &arg1, &arg2); - } - switch (argc) { - case 1: - beg = 0; - len = RARRAY(ary)->len; - break; - case 2: - if (rb_range_beg_len(arg1, &beg, &len, RARRAY(ary)->len, 1)) { - break; - } - /* fall through */ - case 3: - beg = NIL_P(arg1) ? 0 : NUM2LONG(arg1); - if (beg < 0) { - beg = RARRAY(ary)->len + beg; - if (beg < 0) beg = 0; - } - len = NIL_P(arg2) ? RARRAY(ary)->len - beg : NUM2LONG(arg2); - break; - } - rb_ary_modify(ary); - if (len < 0) { - return ary; - } - if (beg >= ARY_MAX_SIZE || len > ARY_MAX_SIZE - beg) { - rb_raise(rb_eArgError, "argument too big"); - } - end = beg + len; - if (end > RARRAY(ary)->len) { - if (end >= RARRAY(ary)->aux.capa) { - REALLOC_N(RARRAY(ary)->ptr, VALUE, end); - RARRAY(ary)->aux.capa = end; - } - rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, end - RARRAY(ary)->len); - RARRAY(ary)->len = end; - } - - if (block_p) { - VALUE v; - long i; - - for (i=beg; i=RARRAY(ary)->len) break; - RARRAY(ary)->ptr[i] = v; - } - } - else { - p = RARRAY(ary)->ptr + beg; - pend = p + len; - while (p < pend) { - *p++ = item; - } - } - return ary; -} - -/* - * call-seq: - * array + other_array -> an_array - * - * Concatenation---Returns a new array built by concatenating the - * two arrays together to produce a third array. - * - * [ 1, 2, 3 ] + [ 4, 5 ] #=> [ 1, 2, 3, 4, 5 ] - */ - -VALUE -rb_ary_plus(x, y) - VALUE x, y; -{ - VALUE z; - long len; - - y = to_ary(y); - len = RARRAY(x)->len + RARRAY(y)->len; - z = rb_ary_new2(len); - MEMCPY(RARRAY(z)->ptr, RARRAY(x)->ptr, VALUE, RARRAY(x)->len); - MEMCPY(RARRAY(z)->ptr + RARRAY(x)->len, RARRAY(y)->ptr, VALUE, RARRAY(y)->len); - RARRAY(z)->len = len; - return z; -} - -/* - * call-seq: - * array.concat(other_array) -> array - * - * Appends the elements in other_array to _self_. - * - * [ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ] - */ - - -VALUE -rb_ary_concat(x, y) - VALUE x, y; -{ - y = to_ary(y); - if (RARRAY(y)->len > 0) { - rb_ary_splice(x, RARRAY(x)->len, 0, y); - } - return x; -} - - -/* - * call-seq: - * array * int -> an_array - * array * str -> a_string - * - * Repetition---With a String argument, equivalent to - * self.join(str). Otherwise, returns a new array - * built by concatenating the _int_ copies of _self_. - * - * - * [ 1, 2, 3 ] * 3 #=> [ 1, 2, 3, 1, 2, 3, 1, 2, 3 ] - * [ 1, 2, 3 ] * "," #=> "1,2,3" - * - */ - -static VALUE -rb_ary_times(ary, times) - VALUE ary, times; -{ - VALUE ary2, tmp; - long i, len; - - tmp = rb_check_string_type(times); - if (!NIL_P(tmp)) { - return rb_ary_join(ary, tmp); - } - - len = NUM2LONG(times); - if (len == 0) return ary_new(rb_obj_class(ary), 0); - if (len < 0) { - rb_raise(rb_eArgError, "negative argument"); - } - if (ARY_MAX_SIZE/len < RARRAY(ary)->len) { - rb_raise(rb_eArgError, "argument too big"); - } - len *= RARRAY(ary)->len; - - ary2 = ary_new(rb_obj_class(ary), len); - RARRAY(ary2)->len = len; - - for (i=0; ilen) { - MEMCPY(RARRAY(ary2)->ptr+i, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len); - } - OBJ_INFECT(ary2, ary); - - return ary2; -} - -/* - * call-seq: - * array.assoc(obj) -> an_array or nil - * - * Searches through an array whose elements are also arrays - * comparing _obj_ with the first element of each contained array - * using obj.==. - * Returns the first contained array that matches (that - * is, the first associated array), - * or +nil+ if no match is found. - * See also Array#rassoc. - * - * s1 = [ "colors", "red", "blue", "green" ] - * s2 = [ "letters", "a", "b", "c" ] - * s3 = "foo" - * a = [ s1, s2, s3 ] - * a.assoc("letters") #=> [ "letters", "a", "b", "c" ] - * a.assoc("foo") #=> nil - */ - -VALUE -rb_ary_assoc(ary, key) - VALUE ary, key; -{ - long i; - VALUE v; - - for (i = 0; i < RARRAY(ary)->len; ++i) { - v = RARRAY(ary)->ptr[i]; - if (TYPE(v) == T_ARRAY && - RARRAY(v)->len > 0 && - rb_equal(RARRAY(v)->ptr[0], key)) - return v; - } - return Qnil; -} - -/* - * call-seq: - * array.rassoc(key) -> an_array or nil - * - * Searches through the array whose elements are also arrays. Compares - * key with the second element of each contained array using - * ==. Returns the first contained array that matches. See - * also Array#assoc. - * - * a = [ [ 1, "one"], [2, "two"], [3, "three"], ["ii", "two"] ] - * a.rassoc("two") #=> [2, "two"] - * a.rassoc("four") #=> nil - */ - -VALUE -rb_ary_rassoc(ary, value) - VALUE ary, value; -{ - long i; - VALUE v; - - for (i = 0; i < RARRAY(ary)->len; ++i) { - v = RARRAY(ary)->ptr[i]; - if (TYPE(v) == T_ARRAY && - RARRAY(v)->len > 1 && - rb_equal(RARRAY(v)->ptr[1], value)) - return v; - } - return Qnil; -} - -static VALUE -recursive_equal(ary1, ary2) - VALUE ary1, ary2; -{ - long i; - - for (i=0; ilen; i++) { - if (!rb_equal(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i))) - return Qfalse; - } - return Qtrue; -} - -/* - * call-seq: - * array == other_array -> bool - * - * Equality---Two arrays are equal if they contain the same number - * of elements and if each element is equal to (according to - * Object.==) the corresponding element in the other array. - * - * [ "a", "c" ] == [ "a", "c", 7 ] #=> false - * [ "a", "c", 7 ] == [ "a", "c", 7 ] #=> true - * [ "a", "c", 7 ] == [ "a", "d", "f" ] #=> false - * - */ - -static VALUE -rb_ary_equal(ary1, ary2) - VALUE ary1, ary2; -{ - if (ary1 == ary2) return Qtrue; - if (TYPE(ary2) != T_ARRAY) { - if (!rb_respond_to(ary2, rb_intern("to_ary"))) { - return Qfalse; - } - return rb_equal(ary2, ary1); - } - if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse; - if (rb_inspecting_p(ary1)) return Qfalse; - return rb_protect_inspect(recursive_equal, ary1, ary2); -} - -static VALUE -recursive_eql(ary1, ary2) - VALUE ary1, ary2; -{ - long i; - - for (i=0; ilen; i++) { - if (!rb_eql(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i))) - return Qfalse; - } - return Qtrue; -} - -/* - * call-seq: - * array.eql?(other) -> true or false - * - * Returns true if _array_ and _other_ are the same object, - * or are both arrays with the same content. - */ - -static VALUE -rb_ary_eql(ary1, ary2) - VALUE ary1, ary2; -{ - if (ary1 == ary2) return Qtrue; - if (TYPE(ary2) != T_ARRAY) return Qfalse; - if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse; - if (rb_inspecting_p(ary1)) return Qfalse; - return rb_protect_inspect(recursive_eql, ary1, ary2); -} - -static VALUE recursive_hash _((VALUE ary)); - -static VALUE -recursive_hash(ary) - VALUE ary; -{ - long i, h; - VALUE n; - - h = RARRAY(ary)->len; - for (i=0; ilen; i++) { - h = (h << 1) | (h<0 ? 1 : 0); - n = rb_hash(RARRAY(ary)->ptr[i]); - h ^= NUM2LONG(n); - } - return LONG2FIX(h); -} - -/* - * call-seq: - * array.hash -> fixnum - * - * Compute a hash-code for this array. Two arrays with the same content - * will have the same hash code (and will compare using eql?). - */ - -static VALUE -rb_ary_hash(ary) - VALUE ary; -{ - if (rb_inspecting_p(ary)) { - return LONG2FIX(0); - } - return rb_protect_inspect(recursive_hash, ary, 0); -} - -/* - * call-seq: - * array.include?(obj) -> true or false - * - * Returns true if the given object is present in - * self (that is, if any object == anObject), - * false otherwise. - * - * a = [ "a", "b", "c" ] - * a.include?("b") #=> true - * a.include?("z") #=> false - */ - -VALUE -rb_ary_includes(ary, item) - VALUE ary; - VALUE item; -{ - long i; - - for (i=0; ilen; i++) { - if (rb_equal(RARRAY(ary)->ptr[i], item)) { - return Qtrue; - } - } - return Qfalse; -} - -VALUE -recursive_cmp(ary1, ary2) - VALUE ary1, ary2; -{ - long i, len; - - len = RARRAY(ary1)->len; - if (len > RARRAY(ary2)->len) { - len = RARRAY(ary2)->len; - } - for (i=0; i other_array -> -1, 0, +1 - * - * Comparison---Returns an integer (-1, 0, - * or +1) if this array is less than, equal to, or greater than - * other_array. Each object in each array is compared - * (using <=>). If any value isn't - * equal, then that inequality is the return value. If all the - * values found are equal, then the return is based on a - * comparison of the array lengths. Thus, two arrays are - * ``equal'' according to Array#<=> if and only if they have - * the same length and the value of each element is equal to the - * value of the corresponding element in the other array. - * - * [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1 - * [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1 - * - */ - -VALUE -rb_ary_cmp(ary1, ary2) - VALUE ary1, ary2; -{ - long len; - VALUE v; - - ary2 = to_ary(ary2); - if (ary1 == ary2) return INT2FIX(0); - if (rb_inspecting_p(ary1)) return INT2FIX(0); - v = rb_protect_inspect(recursive_cmp, ary1, ary2); - if (v != Qundef) return v; - len = RARRAY(ary1)->len - RARRAY(ary2)->len; - if (len == 0) return INT2FIX(0); - if (len > 0) return INT2FIX(1); - return INT2FIX(-1); -} - -static VALUE -ary_make_hash(ary1, ary2) - VALUE ary1, ary2; -{ - VALUE hash = rb_hash_new(); - long i; - - for (i=0; ilen; i++) { - rb_hash_aset(hash, RARRAY(ary1)->ptr[i], Qtrue); - } - if (ary2) { - for (i=0; ilen; i++) { - rb_hash_aset(hash, RARRAY(ary2)->ptr[i], Qtrue); - } - } - return hash; -} - -/* - * call-seq: - * array - other_array -> an_array - * - * Array Difference---Returns a new array that is a copy of - * the original array, removing any items that also appear in - * other_array. (If you need set-like behavior, see the - * library class Set.) - * - * [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ] - */ - -static VALUE -rb_ary_diff(ary1, ary2) - VALUE ary1, ary2; -{ - VALUE ary3; - volatile VALUE hash; - long i; - - hash = ary_make_hash(to_ary(ary2), 0); - ary3 = rb_ary_new(); - - for (i=0; ilen; i++) { - if (st_lookup(RHASH(hash)->tbl, RARRAY(ary1)->ptr[i], 0)) continue; - rb_ary_push(ary3, rb_ary_elt(ary1, i)); - } - return ary3; -} - -/* - * call-seq: - * array & other_array - * - * Set Intersection---Returns a new array - * containing elements common to the two arrays, with no duplicates. - * - * [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ] - */ - - -static VALUE -rb_ary_and(ary1, ary2) - VALUE ary1, ary2; -{ - VALUE hash, ary3, v, vv; - long i; - - ary2 = to_ary(ary2); - ary3 = rb_ary_new2(RARRAY(ary1)->len < RARRAY(ary2)->len ? - RARRAY(ary1)->len : RARRAY(ary2)->len); - hash = ary_make_hash(ary2, 0); - - for (i=0; ilen; i++) { - v = vv = rb_ary_elt(ary1, i); - if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) { - rb_ary_push(ary3, v); - } - } - - return ary3; -} - -/* - * call-seq: - * array | other_array -> an_array - * - * Set Union---Returns a new array by joining this array with - * other_array, removing duplicates. - * - * [ "a", "b", "c" ] | [ "c", "d", "a" ] - * #=> [ "a", "b", "c", "d" ] - */ - -static VALUE -rb_ary_or(ary1, ary2) - VALUE ary1, ary2; -{ - VALUE hash, ary3; - VALUE v, vv; - long i; - - ary2 = to_ary(ary2); - ary3 = rb_ary_new2(RARRAY(ary1)->len+RARRAY(ary2)->len); - hash = ary_make_hash(ary1, ary2); - - for (i=0; ilen; i++) { - v = vv = rb_ary_elt(ary1, i); - if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) { - rb_ary_push(ary3, v); - } - } - for (i=0; ilen; i++) { - v = vv = rb_ary_elt(ary2, i); - if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) { - rb_ary_push(ary3, v); - } - } - return ary3; -} - -/* - * call-seq: - * array.uniq! -> array or nil - * - * Removes duplicate elements from _self_. - * Returns nil if no changes are made (that is, no - * duplicates are found). - * - * a = [ "a", "a", "b", "b", "c" ] - * a.uniq! #=> ["a", "b", "c"] - * b = [ "a", "b", "c" ] - * b.uniq! #=> nil - */ - -static VALUE -rb_ary_uniq_bang(ary) - VALUE ary; -{ - VALUE hash, v, vv; - long i, j; - - hash = ary_make_hash(ary, 0); - - if (RARRAY(ary)->len == RHASH(hash)->tbl->num_entries) { - return Qnil; - } - for (i=j=0; ilen; i++) { - v = vv = rb_ary_elt(ary, i); - if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) { - rb_ary_store(ary, j++, v); - } - } - RARRAY(ary)->len = j; - - return ary; -} - -/* - * call-seq: - * array.uniq -> an_array - * - * Returns a new array by removing duplicate values in self. - * - * a = [ "a", "a", "b", "b", "c" ] - * a.uniq #=> ["a", "b", "c"] - */ - -static VALUE -rb_ary_uniq(ary) - VALUE ary; -{ - ary = rb_ary_dup(ary); - rb_ary_uniq_bang(ary); - return ary; -} - -/* - * call-seq: - * array.compact! -> array or nil - * - * Removes +nil+ elements from array. - * Returns +nil+ if no changes were made. - * - * [ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ] - * [ "a", "b", "c" ].compact! #=> nil - */ - -static VALUE -rb_ary_compact_bang(ary) - VALUE ary; -{ - VALUE *p, *t, *end; - - rb_ary_modify(ary); - p = t = RARRAY(ary)->ptr; - end = p + RARRAY(ary)->len; - - while (t < end) { - if (NIL_P(*t)) t++; - else *p++ = *t++; - } - if (RARRAY(ary)->len == (p - RARRAY(ary)->ptr)) { - return Qnil; - } - RARRAY(ary)->len = RARRAY(ary)->aux.capa = (p - RARRAY(ary)->ptr); - REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len); - - return ary; -} - -/* - * call-seq: - * array.compact -> an_array - * - * Returns a copy of _self_ with all +nil+ elements removed. - * - * [ "a", nil, "b", nil, "c", nil ].compact - * #=> [ "a", "b", "c" ] - */ - -static VALUE -rb_ary_compact(ary) - VALUE ary; -{ - ary = rb_ary_dup(ary); - rb_ary_compact_bang(ary); - return ary; -} - -/* - * call-seq: - * array.nitems -> int - * - * Returns the number of non-nil elements in _self_. - * May be zero. - * - * [ 1, nil, 3, nil, 5 ].nitems #=> 3 - */ - -static VALUE -rb_ary_nitems(ary) - VALUE ary; -{ - long n = 0; - VALUE *p, *pend; - - p = RARRAY(ary)->ptr; - pend = p + RARRAY(ary)->len; - - while (p < pend) { - if (!NIL_P(*p)) n++; - p++; - } - return LONG2NUM(n); -} - -static long -flatten(ary, idx, ary2, memo) - VALUE ary; - long idx; - VALUE ary2, memo; -{ - VALUE id; - long i = idx; - long n, lim = idx + RARRAY(ary2)->len; - - id = rb_obj_id(ary2); - if (rb_ary_includes(memo, id)) { - rb_raise(rb_eArgError, "tried to flatten recursive array"); - } - rb_ary_push(memo, id); - rb_ary_splice(ary, idx, 1, ary2); - while (i < lim) { - VALUE tmp; - - tmp = rb_check_array_type(rb_ary_elt(ary, i)); - if (!NIL_P(tmp)) { - n = flatten(ary, i, tmp, memo); - i += n; lim += n; - } - i++; - } - rb_ary_pop(memo); - - return lim - idx - 1; /* returns number of increased items */ -} - -/* - * call-seq: - * array.flatten! -> array or nil - * - * Flattens _self_ in place. - * Returns nil if no modifications were made (i.e., - * array contains no subarrays.) - * - * a = [ 1, 2, [3, [4, 5] ] ] - * a.flatten! #=> [1, 2, 3, 4, 5] - * a.flatten! #=> nil - * a #=> [1, 2, 3, 4, 5] - */ - -static VALUE -rb_ary_flatten_bang(ary) - VALUE ary; -{ - long i = 0; - int mod = 0; - VALUE memo = Qnil; - - while (ilen) { - VALUE ary2 = RARRAY(ary)->ptr[i]; - VALUE tmp; - - tmp = rb_check_array_type(ary2); - if (!NIL_P(tmp)) { - if (NIL_P(memo)) { - memo = rb_ary_new(); - } - i += flatten(ary, i, tmp, memo); - mod = 1; - } - i++; - } - if (mod == 0) return Qnil; - return ary; -} - -/* - * call-seq: - * array.flatten -> an_array - * - * Returns a new array that is a one-dimensional flattening of this - * array (recursively). That is, for every element that is an array, - * extract its elements into the new array. - * - * s = [ 1, 2, 3 ] #=> [1, 2, 3] - * t = [ 4, 5, 6, [7, 8] ] #=> [4, 5, 6, [7, 8]] - * a = [ s, t, 9, 10 ] #=> [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10] - * a.flatten #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 - */ - -static VALUE -rb_ary_flatten(ary) - VALUE ary; -{ - ary = rb_ary_dup(ary); - rb_ary_flatten_bang(ary); - return ary; -} - - -/* Arrays are ordered, integer-indexed collections of any object. - * Array indexing starts at 0, as in C or Java. A negative index is - * assumed to be relative to the end of the array---that is, an index of -1 - * indicates the last element of the array, -2 is the next to last - * element in the array, and so on. - */ - -void -Init_Array() -{ - rb_cArray = rb_define_class("Array", rb_cObject); - rb_include_module(rb_cArray, rb_mEnumerable); - - rb_define_alloc_func(rb_cArray, ary_alloc); - rb_define_singleton_method(rb_cArray, "[]", rb_ary_s_create, -1); - rb_define_method(rb_cArray, "initialize", rb_ary_initialize, -1); - rb_define_method(rb_cArray, "initialize_copy", rb_ary_replace, 1); - - rb_define_method(rb_cArray, "to_s", rb_ary_to_s, 0); - rb_define_method(rb_cArray, "inspect", rb_ary_inspect, 0); - rb_define_method(rb_cArray, "to_a", rb_ary_to_a, 0); - rb_define_method(rb_cArray, "to_ary", rb_ary_to_ary_m, 0); - rb_define_method(rb_cArray, "frozen?", rb_ary_frozen_p, 0); - - rb_define_method(rb_cArray, "==", rb_ary_equal, 1); - rb_define_method(rb_cArray, "eql?", rb_ary_eql, 1); - rb_define_method(rb_cArray, "hash", rb_ary_hash, 0); - - rb_define_method(rb_cArray, "[]", rb_ary_aref, -1); - rb_define_method(rb_cArray, "[]=", rb_ary_aset, -1); - rb_define_method(rb_cArray, "at", rb_ary_at, 1); - rb_define_method(rb_cArray, "fetch", rb_ary_fetch, -1); - rb_define_method(rb_cArray, "first", rb_ary_first, -1); - rb_define_method(rb_cArray, "last", rb_ary_last, -1); - rb_define_method(rb_cArray, "concat", rb_ary_concat, 1); - rb_define_method(rb_cArray, "<<", rb_ary_push, 1); - rb_define_method(rb_cArray, "push", rb_ary_push_m, -1); - rb_define_method(rb_cArray, "pop", rb_ary_pop, 0); - rb_define_method(rb_cArray, "shift", rb_ary_shift, 0); - rb_define_method(rb_cArray, "unshift", rb_ary_unshift_m, -1); - rb_define_method(rb_cArray, "insert", rb_ary_insert, -1); - rb_define_method(rb_cArray, "each", rb_ary_each, 0); - rb_define_method(rb_cArray, "each_index", rb_ary_each_index, 0); - rb_define_method(rb_cArray, "reverse_each", rb_ary_reverse_each, 0); - rb_define_method(rb_cArray, "length", rb_ary_length, 0); - rb_define_alias(rb_cArray, "size", "length"); - rb_define_method(rb_cArray, "empty?", rb_ary_empty_p, 0); - rb_define_method(rb_cArray, "index", rb_ary_index, 1); - rb_define_method(rb_cArray, "rindex", rb_ary_rindex, 1); - rb_define_method(rb_cArray, "indexes", rb_ary_indexes, -1); - rb_define_method(rb_cArray, "indices", rb_ary_indexes, -1); - rb_define_method(rb_cArray, "join", rb_ary_join_m, -1); - rb_define_method(rb_cArray, "reverse", rb_ary_reverse_m, 0); - rb_define_method(rb_cArray, "reverse!", rb_ary_reverse_bang, 0); - rb_define_method(rb_cArray, "sort", rb_ary_sort, 0); - rb_define_method(rb_cArray, "sort!", rb_ary_sort_bang, 0); - rb_define_method(rb_cArray, "collect", rb_ary_collect, 0); - rb_define_method(rb_cArray, "collect!", rb_ary_collect_bang, 0); - rb_define_method(rb_cArray, "map", rb_ary_collect, 0); - rb_define_method(rb_cArray, "map!", rb_ary_collect_bang, 0); - rb_define_method(rb_cArray, "select", rb_ary_select, 0); - rb_define_method(rb_cArray, "values_at", rb_ary_values_at, -1); - rb_define_method(rb_cArray, "delete", rb_ary_delete, 1); - rb_define_method(rb_cArray, "delete_at", rb_ary_delete_at_m, 1); - rb_define_method(rb_cArray, "delete_if", rb_ary_delete_if, 0); - rb_define_method(rb_cArray, "reject", rb_ary_reject, 0); - rb_define_method(rb_cArray, "reject!", rb_ary_reject_bang, 0); - rb_define_method(rb_cArray, "zip", rb_ary_zip, -1); - rb_define_method(rb_cArray, "transpose", rb_ary_transpose, 0); - rb_define_method(rb_cArray, "replace", rb_ary_replace, 1); - rb_define_method(rb_cArray, "clear", rb_ary_clear, 0); - rb_define_method(rb_cArray, "fill", rb_ary_fill, -1); - rb_define_method(rb_cArray, "include?", rb_ary_includes, 1); - rb_define_method(rb_cArray, "<=>", rb_ary_cmp, 1); - - rb_define_method(rb_cArray, "slice", rb_ary_aref, -1); - rb_define_method(rb_cArray, "slice!", rb_ary_slice_bang, -1); - - rb_define_method(rb_cArray, "assoc", rb_ary_assoc, 1); - rb_define_method(rb_cArray, "rassoc", rb_ary_rassoc, 1); - - rb_define_method(rb_cArray, "+", rb_ary_plus, 1); - rb_define_method(rb_cArray, "*", rb_ary_times, 1); - - rb_define_method(rb_cArray, "-", rb_ary_diff, 1); - rb_define_method(rb_cArray, "&", rb_ary_and, 1); - rb_define_method(rb_cArray, "|", rb_ary_or, 1); - - rb_define_method(rb_cArray, "uniq", rb_ary_uniq, 0); - rb_define_method(rb_cArray, "uniq!", rb_ary_uniq_bang, 0); - rb_define_method(rb_cArray, "compact", rb_ary_compact, 0); - rb_define_method(rb_cArray, "compact!", rb_ary_compact_bang, 0); - rb_define_method(rb_cArray, "flatten", rb_ary_flatten, 0); - rb_define_method(rb_cArray, "flatten!", rb_ary_flatten_bang, 0); - rb_define_method(rb_cArray, "nitems", rb_ary_nitems, 0); - - id_cmp = rb_intern("<=>"); - inspect_key = rb_intern("__inspect_key__"); -} -/********************************************************************** - - bignum.c - - - $Author: wyhaines $ - $Date: 2009-07-14 17:05:27 +0200 (Tue, 14 Jul 2009) $ - created at: Fri Jun 10 00:48:55 JST 1994 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include "rubysig.h" - -#include -#include -#ifdef HAVE_IEEEFP_H -#include -#endif - -VALUE rb_cBignum; - -#if defined __MINGW32__ -#define USHORT _USHORT -#endif - -#define BDIGITS(x) ((BDIGIT*)RBIGNUM(x)->digits) -#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT) -#define BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG) -#define DIGSPERLONG ((unsigned int)(SIZEOF_LONG/SIZEOF_BDIGITS)) -#if HAVE_LONG_LONG -# define DIGSPERLL ((unsigned int)(SIZEOF_LONG_LONG/SIZEOF_BDIGITS)) -#endif -#define BIGUP(x) ((BDIGIT_DBL)(x) << BITSPERDIG) -#define BIGDN(x) RSHIFT(x,BITSPERDIG) -#define BIGLO(x) ((BDIGIT)((x) & (BIGRAD-1))) -#define BDIGMAX ((BDIGIT)-1) - -#define BIGZEROP(x) (RBIGNUM(x)->len == 0 || \ - (BDIGITS(x)[0] == 0 && \ - (RBIGNUM(x)->len == 1 || bigzero_p(x)))) - -static int bigzero_p(VALUE); -static int -bigzero_p(x) - VALUE x; -{ - long i; - for (i = 0; i < RBIGNUM(x)->len; ++i) { - if (BDIGITS(x)[i]) return 0; - } - return 1; -} - -static VALUE -bignew_1(klass, len, sign) - VALUE klass; - long len; - int sign; -{ - NEWOBJ(big, struct RBignum); - OBJSETUP(big, klass, T_BIGNUM); - big->sign = sign?1:0; - big->len = len; - big->digits = ALLOC_N(BDIGIT, len); - - return (VALUE)big; -} - -#define bignew(len,sign) bignew_1(rb_cBignum,len,sign) - -VALUE -rb_big_clone(x) - VALUE x; -{ - VALUE z = bignew_1(CLASS_OF(x), RBIGNUM(x)->len, RBIGNUM(x)->sign); - - MEMCPY(BDIGITS(z), BDIGITS(x), BDIGIT, RBIGNUM(x)->len); - return z; -} - -/* modify a bignum by 2's complement */ -static void -get2comp(x) - VALUE x; -{ - long i = RBIGNUM(x)->len; - BDIGIT *ds = BDIGITS(x); - BDIGIT_DBL num; - - if (!i) return; - while (i--) ds[i] = ~ds[i]; - i = 0; num = 1; - do { - num += ds[i]; - ds[i++] = BIGLO(num); - num = BIGDN(num); - } while (i < RBIGNUM(x)->len); - if (num != 0) { - REALLOC_N(RBIGNUM(x)->digits, BDIGIT, ++RBIGNUM(x)->len); - ds = BDIGITS(x); - ds[RBIGNUM(x)->len-1] = RBIGNUM(x)->sign ? ~0 : 1; - } -} - -void -rb_big_2comp(x) /* get 2's complement */ - VALUE x; -{ - get2comp(x); -} - -static VALUE -bigtrunc(x) - VALUE x; -{ - long len = RBIGNUM(x)->len; - BDIGIT *ds = BDIGITS(x); - - if (len == 0) return x; - while (--len && !ds[len]); - RBIGNUM(x)->len = ++len; - return x; -} - -static VALUE -bigfixize(VALUE x) -{ - long len = RBIGNUM(x)->len; - BDIGIT *ds = BDIGITS(x); - - if (len*SIZEOF_BDIGITS <= sizeof(VALUE)) { - long num = 0; - while (len--) { - num = BIGUP(num) + ds[len]; - } - if (num >= 0) { - if (RBIGNUM(x)->sign) { - if (POSFIXABLE(num)) return LONG2FIX(num); - } - else { - if (NEGFIXABLE(-(long)num)) return LONG2FIX(-(long)num); - } - } - } - return x; -} - -static VALUE -bignorm(VALUE x) -{ - if (!FIXNUM_P(x) && TYPE(x) == T_BIGNUM) { - x = bigfixize(bigtrunc(x)); - } - return x; -} - -VALUE -rb_big_norm(x) - VALUE x; -{ - return bignorm(x); -} - -VALUE -rb_uint2big(n) - unsigned long n; -{ - BDIGIT_DBL num = n; - long i = 0; - BDIGIT *digits; - VALUE big; - - big = bignew(DIGSPERLONG, 1); - digits = BDIGITS(big); - while (i < DIGSPERLONG) { - digits[i++] = BIGLO(num); - num = BIGDN(num); - } - - i = DIGSPERLONG; - while (--i && !digits[i]) ; - RBIGNUM(big)->len = i+1; - return big; -} - -VALUE -rb_int2big(n) - long n; -{ - long neg = 0; - VALUE big; - - if (n < 0) { - n = -n; - neg = 1; - } - big = rb_uint2big(n); - if (neg) { - RBIGNUM(big)->sign = 0; - } - return big; -} - -VALUE -rb_uint2inum(n) - unsigned long n; -{ - if (POSFIXABLE(n)) return LONG2FIX(n); - return rb_uint2big(n); -} - -VALUE -rb_int2inum(n) - long n; -{ - if (FIXABLE(n)) return LONG2FIX(n); - return rb_int2big(n); -} - -#ifdef HAVE_LONG_LONG - -void -rb_quad_pack(buf, val) - char *buf; - VALUE val; -{ - LONG_LONG q; - - val = rb_to_int(val); - if (FIXNUM_P(val)) { - q = FIX2LONG(val); - } - else { - long len = RBIGNUM(val)->len; - BDIGIT *ds; - - if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS) - rb_raise(rb_eRangeError, "bignum too big to convert into `quad int'"); - ds = BDIGITS(val); - q = 0; - while (len--) { - q = BIGUP(q); - q += ds[len]; - } - if (!RBIGNUM(val)->sign) q = -q; - } - memcpy(buf, (char*)&q, SIZEOF_LONG_LONG); -} - -VALUE -rb_quad_unpack(buf, sign) - const char *buf; - int sign; -{ - unsigned LONG_LONG q; - long neg = 0; - long i; - BDIGIT *digits; - VALUE big; - - memcpy(&q, buf, SIZEOF_LONG_LONG); - if (sign) { - if (FIXABLE((LONG_LONG)q)) return LONG2FIX((LONG_LONG)q); - if ((LONG_LONG)q < 0) { - q = -(LONG_LONG)q; - neg = 1; - } - } - else { - if (POSFIXABLE(q)) return LONG2FIX(q); - } - - i = 0; - big = bignew(DIGSPERLL, 1); - digits = BDIGITS(big); - while (i < DIGSPERLL) { - digits[i++] = BIGLO(q); - q = BIGDN(q); - } - - i = DIGSPERLL; - while (i-- && !digits[i]) ; - RBIGNUM(big)->len = i+1; - - if (neg) { - RBIGNUM(big)->sign = 0; - } - return bignorm(big); -} - -#else - -#define QUAD_SIZE 8 - -void -rb_quad_pack(buf, val) - char *buf; - VALUE val; -{ - long len; - - memset(buf, 0, QUAD_SIZE); - val = rb_to_int(val); - if (FIXNUM_P(val)) { - val = rb_int2big(FIX2LONG(val)); - } - len = RBIGNUM(val)->len * SIZEOF_BDIGITS; - if (len > QUAD_SIZE) { - rb_raise(rb_eRangeError, "bignum too big to convert into `quad int'"); - } - memcpy(buf, (char*)BDIGITS(val), len); - if (!RBIGNUM(val)->sign) { - len = QUAD_SIZE; - while (len--) { - *buf = ~*buf; - buf++; - } - } -} - -#define BNEG(b) (RSHIFT(((BDIGIT*)b)[QUAD_SIZE/SIZEOF_BDIGITS-1],BITSPERDIG-1) != 0) - -VALUE -rb_quad_unpack(buf, sign) - const char *buf; - int sign; -{ - VALUE big = bignew(QUAD_SIZE/SIZEOF_BDIGITS, 1); - - memcpy((char*)BDIGITS(big), buf, QUAD_SIZE); - if (sign && BNEG(buf)) { - long len = QUAD_SIZE; - char *tmp = (char*)BDIGITS(big); - - RBIGNUM(big)->sign = 0; - while (len--) { - *tmp = ~*tmp; - tmp++; - } - } - - return bignorm(big); -} - -#endif - -VALUE -rb_cstr_to_inum(str, base, badcheck) - const char *str; - int base; - int badcheck; -{ - const char *s = str; - char *end; - char sign = 1, nondigit = 0; - int c; - BDIGIT_DBL num; - long len, blen = 1; - long i; - VALUE z; - BDIGIT *zds; - -#define conv_digit(c) \ - (!ISASCII(c) ? -1 : \ - isdigit(c) ? ((c) - '0') : \ - islower(c) ? ((c) - 'a' + 10) : \ - isupper(c) ? ((c) - 'A' + 10) : \ - -1) - - if (!str) { - if (badcheck) goto bad; - return INT2FIX(0); - } - if (badcheck) { - while (ISSPACE(*str)) str++; - } - else { - while (ISSPACE(*str) || *str == '_') str++; - } - - if (str[0] == '+') { - str++; - } - else if (str[0] == '-') { - str++; - sign = 0; - } - if (str[0] == '+' || str[0] == '-') { - if (badcheck) goto bad; - return INT2FIX(0); - } - if (base <= 0) { - if (str[0] == '0') { - switch (str[1]) { - case 'x': case 'X': - base = 16; - break; - case 'b': case 'B': - base = 2; - break; - case 'o': case 'O': - base = 8; - break; - case 'd': case 'D': - base = 10; - break; - default: - base = 8; - } - } - else if (base < -1) { - base = -base; - } - else { - base = 10; - } - } - switch (base) { - case 2: - len = 1; - if (str[0] == '0' && (str[1] == 'b'||str[1] == 'B')) { - str += 2; - } - break; - case 3: - len = 2; - break; - case 8: - if (str[0] == '0' && (str[1] == 'o'||str[1] == 'O')) { - str += 2; - } - case 4: case 5: case 6: case 7: - len = 3; - break; - case 10: - if (str[0] == '0' && (str[1] == 'd'||str[1] == 'D')) { - str += 2; - } - case 9: case 11: case 12: case 13: case 14: case 15: - len = 4; - break; - case 16: - len = 4; - if (str[0] == '0' && (str[1] == 'x'||str[1] == 'X')) { - str += 2; - } - break; - default: - if (base < 2 || 36 < base) { - rb_raise(rb_eArgError, "illegal radix %d", base); - } - if (base <= 32) { - len = 5; - } - else { - len = 6; - } - break; - } - if (*str == '0') { /* squeeze preceeding 0s */ - while (*++str == '0'); - if (!(c = *str) || ISSPACE(c)) --str; - } - c = *str; - c = conv_digit(c); - if (c < 0 || c >= base) { - if (badcheck) goto bad; - return INT2FIX(0); - } - len *= strlen(str)*sizeof(char); - - if (len <= (sizeof(VALUE)*CHAR_BIT)) { - unsigned long val = strtoul((char*)str, &end, base); - - if (*end == '_') goto bigparse; - if (badcheck) { - if (end == str) goto bad; /* no number */ - while (*end && ISSPACE(*end)) end++; - if (*end) goto bad; /* trailing garbage */ - } - - if (POSFIXABLE(val)) { - if (sign) return LONG2FIX(val); - else { - long result = -(long)val; - return LONG2FIX(result); - } - } - else { - VALUE big = rb_uint2big(val); - RBIGNUM(big)->sign = sign; - return bignorm(big); - } - } - bigparse: - len = (len/BITSPERDIG)+1; - if (badcheck && *str == '_') goto bad; - - z = bignew(len, sign); - zds = BDIGITS(z); - for (i=len;i--;) zds[i]=0; - while ((c = *str++) != 0) { - if (c == '_') { - if (badcheck) { - if (nondigit) goto bad; - nondigit = c; - } - continue; - } - else if ((c = conv_digit(c)) < 0) { - break; - } - if (c >= base) break; - nondigit = 0; - i = 0; - num = c; - for (;;) { - while (iptr; - } - if (s) { - len = RSTRING(str)->len; - if (s[len]) { /* no sentinel somehow */ - char *p = ALLOCA_N(char, len+1); - - MEMCPY(p, s, char, len); - p[len] = '\0'; - s = p; - } - } - return rb_cstr_to_inum(s, base, badcheck); -} - -#if HAVE_LONG_LONG - -VALUE -rb_ull2big(n) - unsigned LONG_LONG n; -{ - BDIGIT_DBL num = n; - long i = 0; - BDIGIT *digits; - VALUE big; - - big = bignew(DIGSPERLL, 1); - digits = BDIGITS(big); - while (i < DIGSPERLL) { - digits[i++] = BIGLO(num); - num = BIGDN(num); - } - - i = DIGSPERLL; - while (i-- && !digits[i]) ; - RBIGNUM(big)->len = i+1; - return big; -} - -VALUE -rb_ll2big(n) - LONG_LONG n; -{ - long neg = 0; - VALUE big; - - if (n < 0) { - n = -n; - neg = 1; - } - big = rb_ull2big(n); - if (neg) { - RBIGNUM(big)->sign = 0; - } - return big; -} - -VALUE -rb_ull2inum(n) - unsigned LONG_LONG n; -{ - if (POSFIXABLE(n)) return LONG2FIX(n); - return rb_ull2big(n); -} - -VALUE -rb_ll2inum(n) - LONG_LONG n; -{ - if (FIXABLE(n)) return LONG2FIX(n); - return rb_ll2big(n); -} - -#endif /* HAVE_LONG_LONG */ - -VALUE -rb_cstr2inum(str, base) - const char *str; - int base; -{ - return rb_cstr_to_inum(str, base, base==0); -} - -VALUE -rb_str2inum(str, base) - VALUE str; - int base; -{ - return rb_str_to_inum(str, base, base==0); -} - -const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz"; -VALUE -rb_big2str0(x, base, trim) - VALUE x; - int base; - int trim; -{ - volatile VALUE t; - BDIGIT *ds; - long i, j, hbase; - VALUE ss; - char *s; - - if (FIXNUM_P(x)) { - return rb_fix2str(x, base); - } - i = RBIGNUM(x)->len; - if (BIGZEROP(x)) { - return rb_str_new2("0"); - } - if (i >= LONG_MAX/SIZEOF_BDIGITS/CHAR_BIT) { - rb_raise(rb_eRangeError, "bignum too big to convert into `string'"); - } - j = SIZEOF_BDIGITS*CHAR_BIT*i; - switch (base) { - case 2: break; - case 3: - j = j * 53L / 84 + 1; - break; - case 4: case 5: case 6: case 7: - j = (j + 1) / 2; - break; - case 8: case 9: - j = (j + 2) / 3; - break; - case 10: case 11: case 12: case 13: case 14: case 15: - j = j * 28L / 93 + 1; - break; - case 16: case 17: case 18: case 19: case 20: case 21: - case 22: case 23: case 24: case 25: case 26: case 27: - case 28: case 29: case 30: case 31: - j = (j + 3) / 4; - break; - case 32: case 33: case 34: case 35: case 36: - j = (j + 4) / 5; - break; - default: - rb_raise(rb_eArgError, "illegal radix %d", base); - break; - } - j++; /* space for sign */ - - hbase = base * base; -#if SIZEOF_BDIGITS > 2 - hbase *= hbase; -#endif - - t = rb_big_clone(x); - ds = BDIGITS(t); - ss = rb_str_new(0, j+1); - s = RSTRING(ss)->ptr; - - s[0] = RBIGNUM(x)->sign ? '+' : '-'; - TRAP_BEG; - while (i && j > 1) { - long k = i; - BDIGIT_DBL num = 0; - - while (k--) { - num = BIGUP(num) + ds[k]; - ds[k] = (BDIGIT)(num / hbase); - num %= hbase; - } - if (trim && ds[i-1] == 0) i--; - k = SIZEOF_BDIGITS; - while (k--) { - s[--j] = ruby_digitmap[num % base]; - num /= base; - if (!trim && j <= 1) break; - if (trim && i == 0 && num == 0) break; - } - } - if (trim) {while (s[j] == '0') j++;} - i = RSTRING(ss)->len - j; - if (RBIGNUM(x)->sign) { - memmove(s, s+j, i); - RSTRING(ss)->len = i-1; - } - else { - memmove(s+1, s+j, i); - RSTRING(ss)->len = i; - } - s[RSTRING(ss)->len] = '\0'; - TRAP_END; - - return ss; -} - -VALUE -rb_big2str(VALUE x, int base) -{ - return rb_big2str0(x, base, Qtrue); -} - -/* - * call-seq: - * big.to_s(base=10) => string - * - * Returns a string containing the representation of big radix - * base (2 through 36). - * - * 12345654321.to_s #=> "12345654321" - * 12345654321.to_s(2) #=> "1011011111110110111011110000110001" - * 12345654321.to_s(8) #=> "133766736061" - * 12345654321.to_s(16) #=> "2dfdbbc31" - * 78546939656932.to_s(36) #=> "rubyrules" - */ - -static VALUE -rb_big_to_s(argc, argv, x) - int argc; - VALUE *argv; - VALUE x; -{ - VALUE b; - int base; - - rb_scan_args(argc, argv, "01", &b); - if (argc == 0) base = 10; - else base = NUM2INT(b); - return rb_big2str(x, base); -} - -static unsigned long -big2ulong(x, type) - VALUE x; - char *type; -{ - long len = RBIGNUM(x)->len; - BDIGIT_DBL num; - BDIGIT *ds; - - if (len > SIZEOF_LONG/SIZEOF_BDIGITS) - rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type); - ds = BDIGITS(x); - num = 0; - while (len--) { - num = BIGUP(num); - num += ds[len]; - } - return num; -} - -unsigned long -rb_big2ulong_pack(x) - VALUE x; -{ - unsigned long num = big2ulong(x, "unsigned long"); - if (!RBIGNUM(x)->sign) { - return -num; - } - return num; -} - -unsigned long -rb_big2ulong(x) - VALUE x; -{ - unsigned long num = big2ulong(x, "unsigned long"); - - if (!RBIGNUM(x)->sign) { - if ((long)num < 0) { - rb_raise(rb_eRangeError, "bignum out of range of unsigned long"); - } - return -num; - } - return num; -} - -long -rb_big2long(x) - VALUE x; -{ - unsigned long num = big2ulong(x, "long"); - - if ((long)num < 0 && (RBIGNUM(x)->sign || (long)num != LONG_MIN)) { - rb_raise(rb_eRangeError, "bignum too big to convert into `long'"); - } - if (!RBIGNUM(x)->sign) return -(long)num; - return num; -} - -#if HAVE_LONG_LONG - -static unsigned LONG_LONG -big2ull(x, type) - VALUE x; - char *type; -{ - long len = RBIGNUM(x)->len; - BDIGIT_DBL num; - BDIGIT *ds; - - if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS) - rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type); - ds = BDIGITS(x); - num = 0; - while (len--) { - num = BIGUP(num); - num += ds[len]; - } - return num; -} - -unsigned LONG_LONG -rb_big2ull(x) - VALUE x; -{ - unsigned LONG_LONG num = big2ull(x, "unsigned long long"); - - if (!RBIGNUM(x)->sign) return -num; - return num; -} - -LONG_LONG -rb_big2ll(x) - VALUE x; -{ - unsigned LONG_LONG num = big2ull(x, "long long"); - - if ((LONG_LONG)num < 0 && (RBIGNUM(x)->sign - || (LONG_LONG)num != LLONG_MIN)) { - rb_raise(rb_eRangeError, "bignum too big to convert into `long long'"); - } - if (!RBIGNUM(x)->sign) return -(LONG_LONG)num; - return num; -} - -#endif /* HAVE_LONG_LONG */ - -static VALUE -dbl2big(d) - double d; -{ - long i = 0; - BDIGIT c; - BDIGIT *digits; - VALUE z; - double u = (d < 0)?-d:d; - - if (isinf(d)) { - rb_raise(rb_eFloatDomainError, d < 0 ? "-Infinity" : "Infinity"); - } - if (isnan(d)) { - rb_raise(rb_eFloatDomainError, "NaN"); - } - - while (!POSFIXABLE(u) || 0 != (long)u) { - u /= (double)(BIGRAD); - i++; - } - z = bignew(i, d>=0); - digits = BDIGITS(z); - while (i--) { - u *= BIGRAD; - c = (BDIGIT)u; - u -= c; - digits[i] = c; - } - - return z; -} - -VALUE -rb_dbl2big(d) - double d; -{ - return bignorm(dbl2big(d)); -} - -double -rb_big2dbl(x) - VALUE x; -{ - double d = 0.0; - long i = RBIGNUM(x)->len; - BDIGIT *ds = BDIGITS(x); - - while (i--) { - d = ds[i] + BIGRAD*d; - } - if (isinf(d)) { - rb_warn("Bignum out of Float range"); - d = HUGE_VAL; - } - if (!RBIGNUM(x)->sign) d = -d; - return d; -} - -/* - * call-seq: - * big.to_f -> float - * - * Converts big to a Float. If big doesn't - * fit in a Float, the result is infinity. - * - */ - -static VALUE -rb_big_to_f(x) - VALUE x; -{ - return rb_float_new(rb_big2dbl(x)); -} - -/* - * call-seq: - * big <=> numeric => -1, 0, +1 - * - * Comparison---Returns -1, 0, or +1 depending on whether big is - * less than, equal to, or greater than numeric. This is the - * basis for the tests in Comparable. - * - */ - -static VALUE -rb_big_cmp(x, y) - VALUE x, y; -{ - long xlen = RBIGNUM(x)->len; - - switch (TYPE(y)) { - case T_FIXNUM: - y = rb_int2big(FIX2LONG(y)); - break; - - case T_BIGNUM: - break; - - case T_FLOAT: - { - double a = RFLOAT(y)->value; - - if (isinf(a)) { - if (a > 0.0) return INT2FIX(-1); - else return INT2FIX(1); - } - return rb_dbl_cmp(rb_big2dbl(x), a); - } - - default: - return rb_num_coerce_cmp(x, y); - } - - if (RBIGNUM(x)->sign > RBIGNUM(y)->sign) return INT2FIX(1); - if (RBIGNUM(x)->sign < RBIGNUM(y)->sign) return INT2FIX(-1); - if (xlen < RBIGNUM(y)->len) - return (RBIGNUM(x)->sign) ? INT2FIX(-1) : INT2FIX(1); - if (xlen > RBIGNUM(y)->len) - return (RBIGNUM(x)->sign) ? INT2FIX(1) : INT2FIX(-1); - - while(xlen-- && (BDIGITS(x)[xlen]==BDIGITS(y)[xlen])); - if (-1 == xlen) return INT2FIX(0); - return (BDIGITS(x)[xlen] > BDIGITS(y)[xlen]) ? - (RBIGNUM(x)->sign ? INT2FIX(1) : INT2FIX(-1)) : - (RBIGNUM(x)->sign ? INT2FIX(-1) : INT2FIX(1)); -} - -/* - * call-seq: - * big == obj => true or false - * - * Returns true only if obj has the same value - * as big. Contrast this with Bignum#eql?, which - * requires obj to be a Bignum. - * - * 68719476736 == 68719476736.0 #=> true - */ - -static VALUE -rb_big_eq(x, y) - VALUE x, y; -{ - switch (TYPE(y)) { - case T_FIXNUM: - y = rb_int2big(FIX2LONG(y)); - break; - case T_BIGNUM: - break; - case T_FLOAT: - { - volatile double a, b; - - a = RFLOAT(y)->value; - if (isnan(a)) return Qfalse; - b = rb_big2dbl(x); - return (a == b)?Qtrue:Qfalse; - } - default: - return rb_equal(y, x); - } - if (RBIGNUM(x)->sign != RBIGNUM(y)->sign) return Qfalse; - if (RBIGNUM(x)->len != RBIGNUM(y)->len) return Qfalse; - if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM(y)->len) != 0) return Qfalse; - return Qtrue; -} - -/* - * call-seq: - * big.eql?(obj) => true or false - * - * Returns true only if obj is a - * Bignum with the same value as big. Contrast this - * with Bignum#==, which performs type conversions. - * - * 68719476736.eql?(68719476736.0) #=> false - */ - -static VALUE -rb_big_eql(x, y) - VALUE x, y; -{ - if (TYPE(y) != T_BIGNUM) return Qfalse; - if (RBIGNUM(x)->sign != RBIGNUM(y)->sign) return Qfalse; - if (RBIGNUM(x)->len != RBIGNUM(y)->len) return Qfalse; - if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM(y)->len) != 0) return Qfalse; - return Qtrue; -} - -/* - * call-seq: - * -big => other_big - * - * Unary minus (returns a new Bignum whose value is 0-big) - */ - -static VALUE -rb_big_uminus(x) - VALUE x; -{ - VALUE z = rb_big_clone(x); - - RBIGNUM(z)->sign = !RBIGNUM(x)->sign; - - return bignorm(z); -} - -/* - * call-seq: - * ~big => integer - * - * Inverts the bits in big. As Bignums are conceptually infinite - * length, the result acts as if it had an infinite number of one - * bits to the left. In hex representations, this is displayed - * as two periods to the left of the digits. - * - * sprintf("%X", ~0x1122334455) #=> "..FEEDDCCBBAA" - */ - -static VALUE -rb_big_neg(x) - VALUE x; -{ - VALUE z = rb_big_clone(x); - long i; - BDIGIT *ds; - - if (!RBIGNUM(x)->sign) get2comp(z); - ds = BDIGITS(z); - i = RBIGNUM(x)->len; - if (!i) return INT2FIX(~0); - while (i--) ds[i] = ~ds[i]; - RBIGNUM(z)->sign = !RBIGNUM(z)->sign; - if (RBIGNUM(x)->sign) get2comp(z); - - return bignorm(z); -} - -static VALUE -bigsub(x, y) - VALUE x, y; -{ - VALUE z = 0; - BDIGIT *zds; - BDIGIT_DBL_SIGNED num; - long i = RBIGNUM(x)->len; - - /* if x is larger than y, swap */ - if (RBIGNUM(x)->len < RBIGNUM(y)->len) { - z = x; x = y; y = z; /* swap x y */ - } - else if (RBIGNUM(x)->len == RBIGNUM(y)->len) { - while (i > 0) { - i--; - if (BDIGITS(x)[i] > BDIGITS(y)[i]) { - break; - } - if (BDIGITS(x)[i] < BDIGITS(y)[i]) { - z = x; x = y; y = z; /* swap x y */ - break; - } - } - } - - z = bignew(RBIGNUM(x)->len, z==0); - zds = BDIGITS(z); - - for (i = 0, num = 0; i < RBIGNUM(y)->len; i++) { - num += (BDIGIT_DBL_SIGNED)BDIGITS(x)[i] - BDIGITS(y)[i]; - zds[i] = BIGLO(num); - num = BIGDN(num); - } - while (num && i < RBIGNUM(x)->len) { - num += BDIGITS(x)[i]; - zds[i++] = BIGLO(num); - num = BIGDN(num); - } - while (i < RBIGNUM(x)->len) { - zds[i] = BDIGITS(x)[i]; - i++; - } - - return z; -} - -static VALUE -bigadd(x, y, sign) - VALUE x, y; - int sign; -{ - VALUE z; - BDIGIT_DBL num; - long i, len; - - sign = (sign == RBIGNUM(y)->sign); - if (RBIGNUM(x)->sign != sign) { - if (sign) return bigsub(y, x); - return bigsub(x, y); - } - - if (RBIGNUM(x)->len > RBIGNUM(y)->len) { - len = RBIGNUM(x)->len + 1; - z = x; x = y; y = z; - } - else { - len = RBIGNUM(y)->len + 1; - } - z = bignew(len, sign); - - len = RBIGNUM(x)->len; - for (i = 0, num = 0; i < len; i++) { - num += (BDIGIT_DBL)BDIGITS(x)[i] + BDIGITS(y)[i]; - BDIGITS(z)[i] = BIGLO(num); - num = BIGDN(num); - } - len = RBIGNUM(y)->len; - while (num && i < len) { - num += BDIGITS(y)[i]; - BDIGITS(z)[i++] = BIGLO(num); - num = BIGDN(num); - } - while (i < len) { - BDIGITS(z)[i] = BDIGITS(y)[i]; - i++; - } - BDIGITS(z)[i] = (BDIGIT)num; - - return z; -} - -/* - * call-seq: - * big + other => Numeric - * - * Adds big and other, returning the result. - */ - -VALUE -rb_big_plus(x, y) - VALUE x, y; -{ - switch (TYPE(y)) { - case T_FIXNUM: - y = rb_int2big(FIX2LONG(y)); - /* fall through */ - case T_BIGNUM: - return bignorm(bigadd(x, y, 1)); - - case T_FLOAT: - return rb_float_new(rb_big2dbl(x) + RFLOAT(y)->value); - - default: - return rb_num_coerce_bin(x, y); - } -} - -/* - * call-seq: - * big - other => Numeric - * - * Subtracts other from big, returning the result. - */ - -VALUE -rb_big_minus(x, y) - VALUE x, y; -{ - switch (TYPE(y)) { - case T_FIXNUM: - y = rb_int2big(FIX2LONG(y)); - /* fall through */ - case T_BIGNUM: - return bignorm(bigadd(x, y, 0)); - - case T_FLOAT: - return rb_float_new(rb_big2dbl(x) - RFLOAT(y)->value); - - default: - return rb_num_coerce_bin(x, y); - } -} - -VALUE -rb_big_mul0(x, y) - VALUE x, y; -{ - long i, j; - BDIGIT_DBL n = 0; - VALUE z; - BDIGIT *zds; - - if (FIXNUM_P(x)) x = rb_int2big(FIX2LONG(x)); - switch (TYPE(y)) { - case T_FIXNUM: - y = rb_int2big(FIX2LONG(y)); - break; - - case T_BIGNUM: - break; - - case T_FLOAT: - return rb_float_new(rb_big2dbl(x) * RFLOAT(y)->value); - - default: - return rb_num_coerce_bin(x, y); - } - - j = RBIGNUM(x)->len + RBIGNUM(y)->len + 1; - z = bignew(j, RBIGNUM(x)->sign==RBIGNUM(y)->sign); - zds = BDIGITS(z); - while (j--) zds[j] = 0; - for (i = 0; i < RBIGNUM(x)->len; i++) { - BDIGIT_DBL dd = BDIGITS(x)[i]; - if (dd == 0) continue; - n = 0; - for (j = 0; j < RBIGNUM(y)->len; j++) { - BDIGIT_DBL ee = n + (BDIGIT_DBL)dd * BDIGITS(y)[j]; - n = zds[i + j] + ee; - if (ee) zds[i + j] = BIGLO(n); - n = BIGDN(n); - } - if (n) { - zds[i + j] = n; - } - } - - return z; -} - -/* - * call-seq: - * big * other => Numeric - * - * Multiplies big and other, returning the result. - */ - -VALUE -rb_big_mul(x, y) - VALUE x, y; -{ - return bignorm(rb_big_mul0(x, y)); -} - -static void -bigdivrem(x, y, divp, modp) - VALUE x, y; - VALUE *divp, *modp; -{ - long nx = RBIGNUM(x)->len, ny = RBIGNUM(y)->len; - long i, j; - VALUE yy, z; - BDIGIT *xds, *yds, *zds, *tds; - BDIGIT_DBL t2; - BDIGIT_DBL_SIGNED num; - BDIGIT dd, q; - - if (BIGZEROP(y)) rb_num_zerodiv(); - yds = BDIGITS(y); - if (nx < ny || (nx == ny && BDIGITS(x)[nx - 1] < BDIGITS(y)[ny - 1])) { - if (divp) *divp = rb_int2big(0); - if (modp) *modp = x; - return; - } - xds = BDIGITS(x); - if (ny == 1) { - dd = yds[0]; - z = rb_big_clone(x); - zds = BDIGITS(z); - t2 = 0; i = nx; - while (i--) { - t2 = BIGUP(t2) + zds[i]; - zds[i] = (BDIGIT)(t2 / dd); - t2 %= dd; - } - RBIGNUM(z)->sign = RBIGNUM(x)->sign==RBIGNUM(y)->sign; - if (modp) { - *modp = rb_uint2big((unsigned long)t2); - RBIGNUM(*modp)->sign = RBIGNUM(x)->sign; - } - if (divp) *divp = z; - return; - } - z = bignew(nx==ny?nx+2:nx+1, RBIGNUM(x)->sign==RBIGNUM(y)->sign); - zds = BDIGITS(z); - if (nx==ny) zds[nx+1] = 0; - while (!yds[ny-1]) ny--; - - dd = 0; - q = yds[ny-1]; - while ((q & (1<<(BITSPERDIG-1))) == 0) { - q <<= 1; - dd++; - } - if (dd) { - yy = rb_big_clone(y); - tds = BDIGITS(yy); - j = 0; - t2 = 0; - while (j= ny); - if (divp) { /* move quotient down in z */ - *divp = rb_big_clone(z); - zds = BDIGITS(*divp); - j = (nx==ny ? nx+2 : nx+1) - ny; - for (i = 0;i < j;i++) zds[i] = zds[i+ny]; - RBIGNUM(*divp)->len = i; - } - if (modp) { /* normalize remainder */ - *modp = rb_big_clone(z); - zds = BDIGITS(*modp); - while (--ny && !zds[ny]); ++ny; - if (dd) { - t2 = 0; i = ny; - while(i--) { - t2 = (t2 | zds[i]) >> dd; - q = zds[i]; - zds[i] = BIGLO(t2); - t2 = BIGUP(q); - } - } - RBIGNUM(*modp)->len = ny; - RBIGNUM(*modp)->sign = RBIGNUM(x)->sign; - } -} - -static void -bigdivmod(x, y, divp, modp) - VALUE x, y; - VALUE *divp, *modp; -{ - VALUE mod; - - bigdivrem(x, y, divp, &mod); - if (RBIGNUM(x)->sign != RBIGNUM(y)->sign && !BIGZEROP(mod)) { - if (divp) *divp = bigadd(*divp, rb_int2big(1), 0); - if (modp) *modp = bigadd(mod, y, 1); - } - else { - if (divp) *divp = *divp; - if (modp) *modp = mod; - } -} - -/* - * call-seq: - * big / other => Numeric - * big.div(other) => Numeric - * - * Divides big by other, returning the result. - */ - -static VALUE -rb_big_div(x, y) - VALUE x, y; -{ - VALUE z; - - switch (TYPE(y)) { - case T_FIXNUM: - y = rb_int2big(FIX2LONG(y)); - break; - - case T_BIGNUM: - break; - - case T_FLOAT: - return rb_float_new(rb_big2dbl(x) / RFLOAT(y)->value); - - default: - return rb_num_coerce_bin(x, y); - } - bigdivmod(x, y, &z, 0); - - return bignorm(z); -} - -/* - * call-seq: - * big % other => Numeric - * big.modulo(other) => Numeric - * - * Returns big modulo other. See Numeric.divmod for more - * information. - */ - -static VALUE -rb_big_modulo(x, y) - VALUE x, y; -{ - VALUE z; - - switch (TYPE(y)) { - case T_FIXNUM: - y = rb_int2big(FIX2LONG(y)); - break; - - case T_BIGNUM: - break; - - default: - return rb_num_coerce_bin(x, y); - } - bigdivmod(x, y, 0, &z); - - return bignorm(z); -} - -/* - * call-seq: - * big.remainder(numeric) => number - * - * Returns the remainder after dividing big by numeric. - * - * -1234567890987654321.remainder(13731) #=> -6966 - * -1234567890987654321.remainder(13731.24) #=> -9906.22531493148 - */ -static VALUE -rb_big_remainder(x, y) - VALUE x, y; -{ - VALUE z; - - switch (TYPE(y)) { - case T_FIXNUM: - y = rb_int2big(FIX2LONG(y)); - break; - - case T_BIGNUM: - break; - - default: - return rb_num_coerce_bin(x, y); - } - bigdivrem(x, y, 0, &z); - - return bignorm(z); -} - -static VALUE big_lshift _((VALUE, unsigned long)); -static VALUE big_rshift _((VALUE, unsigned long)); - -static VALUE big_shift(x, n) - VALUE x; - int n; -{ - if (n < 0) - return big_lshift(x, (unsigned int)n); - else if (n > 0) - return big_rshift(x, (unsigned int)n); - return x; -} - -/* - * call-seq: - * big.divmod(numeric) => array - * - * See Numeric#divmod. - * - */ -VALUE -rb_big_divmod(x, y) - VALUE x, y; -{ - VALUE div, mod; - - switch (TYPE(y)) { - case T_FIXNUM: - y = rb_int2big(FIX2LONG(y)); - break; - - case T_BIGNUM: - break; - - default: - return rb_num_coerce_bin(x, y); - } - bigdivmod(x, y, &div, &mod); - - return rb_assoc_new(bignorm(div), bignorm(mod)); -} - -/* - * call-seq: - * big.quo(numeric) -> float - * - * Returns the floating point result of dividing big by - * numeric. - * - * -1234567890987654321.quo(13731) #=> -89910996357705.5 - * -1234567890987654321.quo(13731.24) #=> -89909424858035.7 - * - */ - -static VALUE -rb_big_quo(x, y) - VALUE x, y; -{ - double dx = rb_big2dbl(x); - double dy; - - switch (TYPE(y)) { - case T_FIXNUM: - dy = (double)FIX2LONG(y); - break; - - case T_BIGNUM: - dy = rb_big2dbl(y); - break; - - case T_FLOAT: - dy = RFLOAT(y)->value; - break; - - default: - return rb_num_coerce_bin(x, y); - } - return rb_float_new(dx / dy); -} - -/* - * call-seq: - * big ** exponent #=> numeric - * - * Raises _big_ to the _exponent_ power (which may be an integer, float, - * or anything that will coerce to a number). The result may be - * a Fixnum, Bignum, or Float - * - * 123456789 ** 2 #=> 15241578750190521 - * 123456789 ** 1.2 #=> 5126464716.09932 - * 123456789 ** -2 #=> 6.5610001194102e-17 - */ - -VALUE -rb_big_pow(x, y) - VALUE x, y; -{ - double d; - long yy; - - if (y == INT2FIX(0)) return INT2FIX(1); - switch (TYPE(y)) { - case T_FLOAT: - d = RFLOAT(y)->value; - break; - - case T_BIGNUM: - rb_warn("in a**b, b may be too big"); - d = rb_big2dbl(y); - break; - - case T_FIXNUM: - yy = FIX2LONG(y); - if (yy > 0) { - VALUE z = x; - const long BIGLEN_LIMIT = 1024*1024 / SIZEOF_BDIGITS; - - if ((RBIGNUM(x)->len > BIGLEN_LIMIT) || - (RBIGNUM(x)->len > BIGLEN_LIMIT / yy)) { - rb_warn("in a**b, b may be too big"); - d = (double)yy; - break; - } - for (;;) { - yy -= 1; - if (yy == 0) break; - while (yy % 2 == 0) { - yy /= 2; - x = rb_big_mul0(x, x); - bigtrunc(x); - } - z = rb_big_mul0(z, x); - bigtrunc(z); - } - return bignorm(z); - } - d = (double)yy; - break; - - default: - return rb_num_coerce_bin(x, y); - } - return rb_float_new(pow(rb_big2dbl(x), d)); -} - -/* - * call-seq: - * big & numeric => integer - * - * Performs bitwise +and+ between _big_ and _numeric_. - */ - -VALUE -rb_big_and(xx, yy) - VALUE xx, yy; -{ - volatile VALUE x, y, z; - BDIGIT *ds1, *ds2, *zds; - long i, l1, l2; - char sign; - - x = xx; - y = rb_to_int(yy); - if (FIXNUM_P(y)) { - y = rb_int2big(FIX2LONG(y)); - } - if (!RBIGNUM(y)->sign) { - y = rb_big_clone(y); - get2comp(y); - } - if (!RBIGNUM(x)->sign) { - x = rb_big_clone(x); - get2comp(x); - } - if (RBIGNUM(x)->len > RBIGNUM(y)->len) { - l1 = RBIGNUM(y)->len; - l2 = RBIGNUM(x)->len; - ds1 = BDIGITS(y); - ds2 = BDIGITS(x); - sign = RBIGNUM(y)->sign; - } - else { - l1 = RBIGNUM(x)->len; - l2 = RBIGNUM(y)->len; - ds1 = BDIGITS(x); - ds2 = BDIGITS(y); - sign = RBIGNUM(x)->sign; - } - z = bignew(l2, RBIGNUM(x)->sign || RBIGNUM(y)->sign); - zds = BDIGITS(z); - - for (i=0; isign) get2comp(z); - return bignorm(z); -} - -/* - * call-seq: - * big | numeric => integer - * - * Performs bitwise +or+ between _big_ and _numeric_. - */ - -VALUE -rb_big_or(xx, yy) - VALUE xx, yy; -{ - volatile VALUE x, y, z; - BDIGIT *ds1, *ds2, *zds; - long i, l1, l2; - char sign; - - x = xx; - y = rb_to_int(yy); - if (FIXNUM_P(y)) { - y = rb_int2big(FIX2LONG(y)); - } - if (!RBIGNUM(y)->sign) { - y = rb_big_clone(y); - get2comp(y); - } - if (!RBIGNUM(x)->sign) { - x = rb_big_clone(x); - get2comp(x); - } - if (RBIGNUM(x)->len > RBIGNUM(y)->len) { - l1 = RBIGNUM(y)->len; - l2 = RBIGNUM(x)->len; - ds1 = BDIGITS(y); - ds2 = BDIGITS(x); - sign = RBIGNUM(y)->sign; - } - else { - l1 = RBIGNUM(x)->len; - l2 = RBIGNUM(y)->len; - ds1 = BDIGITS(x); - ds2 = BDIGITS(y); - sign = RBIGNUM(x)->sign; - } - z = bignew(l2, RBIGNUM(x)->sign && RBIGNUM(y)->sign); - zds = BDIGITS(z); - - for (i=0; isign) get2comp(z); - - return bignorm(z); -} - -/* - * call-seq: - * big ^ numeric => integer - * - * Performs bitwise +exclusive or+ between _big_ and _numeric_. - */ - -VALUE -rb_big_xor(xx, yy) - VALUE xx, yy; -{ - volatile VALUE x, y; - VALUE z; - BDIGIT *ds1, *ds2, *zds; - long i, l1, l2; - char sign; - - x = xx; - y = rb_to_int(yy); - if (FIXNUM_P(y)) { - y = rb_int2big(FIX2LONG(y)); - } - if (!RBIGNUM(y)->sign) { - y = rb_big_clone(y); - get2comp(y); - } - if (!RBIGNUM(x)->sign) { - x = rb_big_clone(x); - get2comp(x); - } - if (RBIGNUM(x)->len > RBIGNUM(y)->len) { - l1 = RBIGNUM(y)->len; - l2 = RBIGNUM(x)->len; - ds1 = BDIGITS(y); - ds2 = BDIGITS(x); - sign = RBIGNUM(y)->sign; - } - else { - l1 = RBIGNUM(x)->len; - l2 = RBIGNUM(y)->len; - ds1 = BDIGITS(x); - ds2 = BDIGITS(y); - sign = RBIGNUM(x)->sign; - } - RBIGNUM(x)->sign = RBIGNUM(x)->sign?1:0; - RBIGNUM(y)->sign = RBIGNUM(y)->sign?1:0; - z = bignew(l2, !(RBIGNUM(x)->sign ^ RBIGNUM(y)->sign)); - zds = BDIGITS(z); - - for (i=0; isign) get2comp(z); - - return bignorm(z); -} - -static VALUE -check_shiftdown(VALUE y, VALUE x) -{ - if (!RBIGNUM(x)->len) return INT2FIX(0); - if (RBIGNUM(y)->len > SIZEOF_LONG / SIZEOF_BDIGITS) { - return RBIGNUM(x)->sign ? INT2FIX(0) : INT2FIX(-1); - } - return Qnil; -} - -/* - * call-seq: - * big << numeric => integer - * - * Shifts big left _numeric_ positions (right if _numeric_ is negative). - */ - -VALUE -rb_big_lshift(x, y) - VALUE x, y; -{ - long shift; - int neg = 0; - - for (;;) { - if (FIXNUM_P(y)) { - shift = FIX2LONG(y); - if (shift < 0) { - neg = 1; - shift = -shift; - } - break; - } - else if (TYPE(y) == T_BIGNUM) { - if (!RBIGNUM(y)->sign) { - VALUE t = check_shiftdown(y, x); - if (!NIL_P(t)) return t; - neg = 1; - } - shift = big2ulong(y, "long", Qtrue); - break; - } - y = rb_to_int(y); - } - - if (neg) return big_rshift(x, shift); - return big_lshift(x, shift); -} - -static VALUE -big_lshift(x, shift) - VALUE x; - unsigned long shift; -{ - BDIGIT *xds, *zds; - long s1 = shift/BITSPERDIG; - int s2 = shift%BITSPERDIG; - VALUE z; - BDIGIT_DBL num = 0; - long len, i; - - len = RBIGNUM(x)->len; - z = bignew(len+s1+1, RBIGNUM(x)->sign); - zds = BDIGITS(z); - for (i=0; i> numeric => integer - * - * Shifts big right _numeric_ positions (left if _numeric_ is negative). - */ - -VALUE -rb_big_rshift(x, y) - VALUE x, y; -{ - long shift; - int neg = 0; - - for (;;) { - if (FIXNUM_P(y)) { - shift = FIX2LONG(y); - if (shift < 0) { - neg = 1; - shift = -shift; - } - break; - } - else if (TYPE(y) == T_BIGNUM) { - if (RBIGNUM(y)->sign) { - VALUE t = check_shiftdown(y, x); - if (!NIL_P(t)) return t; - } - else { - neg = 1; - } - shift = big2ulong(y, "long", Qtrue); - break; - } - y = rb_to_int(y); - } - - if (neg) return big_lshift(x, shift); - return big_rshift(x, shift); -} - -static VALUE -big_rshift(x, shift) - VALUE x; - unsigned long shift; -{ - BDIGIT *xds, *zds; - long s1 = shift/BITSPERDIG; - int s2 = shift%BITSPERDIG; - VALUE z; - BDIGIT_DBL num = 0; - long i, j; - volatile VALUE save_x; - - if (s1 > RBIGNUM(x)->len) { - if (RBIGNUM(x)->sign) - return INT2FIX(0); - else - return INT2FIX(-1); - } - if (!RBIGNUM(x)->sign) { - save_x = x = rb_big_clone(x); - get2comp(x); - } - xds = BDIGITS(x); - i = RBIGNUM(x)->len; j = i - s1; - if (j == 0) { - if (RBIGNUM(x)->sign) return INT2FIX(0); - else return INT2FIX(-1); - } - z = bignew(j, RBIGNUM(x)->sign); - if (!RBIGNUM(x)->sign) { - num = ((BDIGIT_DBL)~0) << BITSPERDIG; - } - zds = BDIGITS(z); - while (i--, j--) { - num = (num | xds[i]) >> s2; - zds[j] = BIGLO(num); - num = BIGUP(xds[i]); - } - if (!RBIGNUM(x)->sign) { - get2comp(z); - } - return bignorm(z); -} - -/* - * call-seq: - * big[n] -> 0, 1 - * - * Bit Reference---Returns the nth bit in the (assumed) binary - * representation of big, where big[0] is the least - * significant bit. - * - * a = 9**15 - * 50.downto(0) do |n| - * print a[n] - * end - * - * produces: - * - * 000101110110100000111000011110010100111100010111001 - * - */ - -static VALUE -rb_big_aref(x, y) - VALUE x, y; -{ - BDIGIT *xds; - BDIGIT_DBL num; - unsigned long shift; - long i, s1, s2; - - if (TYPE(y) == T_BIGNUM) { - if (!RBIGNUM(y)->sign) - return INT2FIX(0); - if (RBIGNUM(bigtrunc(y))->len > SIZEOF_LONG/SIZEOF_BDIGITS) { - out_of_range: - return RBIGNUM(x)->sign ? INT2FIX(0) : INT2FIX(1); - } - shift = big2ulong(y, "long", Qfalse); - } - else { - i = NUM2LONG(y); - if (i < 0) return INT2FIX(0); - shift = (VALUE)i; - } - s1 = shift/BITSPERDIG; - s2 = shift%BITSPERDIG; - - if (s1 >= RBIGNUM(x)->len) goto out_of_range; - if (!RBIGNUM(x)->sign) { - xds = BDIGITS(x); - i = 0; num = 1; - while (num += ~xds[i], ++i <= s1) { - num = BIGDN(num); - } - } - else { - num = BDIGITS(x)[s1]; - } - if (num & ((BDIGIT_DBL)1< fixnum - * - * Compute a hash based on the value of _big_. - */ - -static VALUE -rb_big_hash(x) - VALUE x; -{ - long i, len, key; - BDIGIT *digits; - - key = 0; digits = BDIGITS(x); len = RBIGNUM(x)->len; - for (i=0; i aBignum - * - * Returns the absolute value of big. - * - * -1234567890987654321.abs #=> 1234567890987654321 - */ - -static VALUE -rb_big_abs(x) - VALUE x; -{ - if (!RBIGNUM(x)->sign) { - x = rb_big_clone(x); - RBIGNUM(x)->sign = 1; - } - return x; -} - -VALUE -rb_big_rand(max, rand_buf) - VALUE max; - double *rand_buf; -{ - VALUE v; - long len = RBIGNUM(max)->len; - - if (BIGZEROP(max)) { - return rb_float_new(rand_buf[0]); - } - v = bignew(len,1); - len--; - BDIGITS(v)[len] = BDIGITS(max)[len] * rand_buf[len]; - while (len--) { - BDIGITS(v)[len] = ((BDIGIT)~0) * rand_buf[len]; - } - - return v; -} - -/* - * call-seq: - * big.size -> integer - * - * Returns the number of bytes in the machine representation of - * big. - * - * (256**10 - 1).size #=> 12 - * (256**20 - 1).size #=> 20 - * (256**40 - 1).size #=> 40 - */ - -static VALUE -rb_big_size(big) - VALUE big; -{ - return LONG2FIX(RBIGNUM(big)->len*SIZEOF_BDIGITS); -} - -/* - * Bignum objects hold integers outside the range of - * Fixnum. Bignum objects are created - * automatically when integer calculations would otherwise overflow a - * Fixnum. When a calculation involving - * Bignum objects returns a result that will fit in a - * Fixnum, the result is automatically converted. - * - * For the purposes of the bitwise operations and [], a - * Bignum is treated as if it were an infinite-length - * bitstring with 2's complement representation. - * - * While Fixnum values are immediate, Bignum - * objects are not---assignment and parameter passing work with - * references to objects, not the objects themselves. - * - */ - -void -Init_Bignum() -{ - rb_cBignum = rb_define_class("Bignum", rb_cInteger); - - rb_define_method(rb_cBignum, "to_s", rb_big_to_s, -1); - rb_define_method(rb_cBignum, "coerce", rb_big_coerce, 1); - rb_define_method(rb_cBignum, "-@", rb_big_uminus, 0); - rb_define_method(rb_cBignum, "+", rb_big_plus, 1); - rb_define_method(rb_cBignum, "-", rb_big_minus, 1); - rb_define_method(rb_cBignum, "*", rb_big_mul, 1); - rb_define_method(rb_cBignum, "/", rb_big_div, 1); - rb_define_method(rb_cBignum, "%", rb_big_modulo, 1); - rb_define_method(rb_cBignum, "div", rb_big_div, 1); - rb_define_method(rb_cBignum, "divmod", rb_big_divmod, 1); - rb_define_method(rb_cBignum, "modulo", rb_big_modulo, 1); - rb_define_method(rb_cBignum, "remainder", rb_big_remainder, 1); - rb_define_method(rb_cBignum, "quo", rb_big_quo, 1); - rb_define_method(rb_cBignum, "**", rb_big_pow, 1); - rb_define_method(rb_cBignum, "&", rb_big_and, 1); - rb_define_method(rb_cBignum, "|", rb_big_or, 1); - rb_define_method(rb_cBignum, "^", rb_big_xor, 1); - rb_define_method(rb_cBignum, "~", rb_big_neg, 0); - rb_define_method(rb_cBignum, "<<", rb_big_lshift, 1); - rb_define_method(rb_cBignum, ">>", rb_big_rshift, 1); - rb_define_method(rb_cBignum, "[]", rb_big_aref, 1); - - rb_define_method(rb_cBignum, "<=>", rb_big_cmp, 1); - rb_define_method(rb_cBignum, "==", rb_big_eq, 1); - rb_define_method(rb_cBignum, "eql?", rb_big_eql, 1); - rb_define_method(rb_cBignum, "hash", rb_big_hash, 0); - rb_define_method(rb_cBignum, "to_f", rb_big_to_f, 0); - rb_define_method(rb_cBignum, "abs", rb_big_abs, 0); - rb_define_method(rb_cBignum, "size", rb_big_size, 0); -} -/********************************************************************** - - class.c - - - $Author: shyouhei $ - $Date: 2009-01-16 02:58:45 +0100 (Fri, 16 Jan 2009) $ - created at: Tue Aug 10 15:05:44 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include "rubysig.h" -#include "node.h" -#include "st.h" -#include - -extern st_table *rb_class_tbl; - -VALUE -rb_class_boot(super) - VALUE super; -{ - NEWOBJ(klass, struct RClass); - OBJSETUP(klass, rb_cClass, T_CLASS); - - klass->super = super; - klass->iv_tbl = 0; - klass->m_tbl = 0; /* safe GC */ - klass->m_tbl = st_init_numtable(); - - OBJ_INFECT(klass, super); - return (VALUE)klass; -} - -VALUE -rb_class_new(super) - VALUE super; -{ - Check_Type(super, T_CLASS); - if (super == rb_cClass) { - rb_raise(rb_eTypeError, "can't make subclass of Class"); - } - if (FL_TEST(super, FL_SINGLETON)) { - rb_raise(rb_eTypeError, "can't make subclass of virtual class"); - } - return rb_class_boot(super); -} - -struct clone_method_data { - st_table *tbl; - VALUE klass; -}; - -static int -clone_method(mid, body, data) - ID mid; - NODE *body; - struct clone_method_data *data; -{ - NODE *fbody = body->nd_body; - - if (fbody && nd_type(fbody) == NODE_SCOPE) { - NODE *cref = (NODE*)fbody->nd_rval; - - if (cref) cref = cref->nd_next; - fbody = rb_copy_node_scope(fbody, NEW_CREF(data->klass, cref)); - } - st_insert(data->tbl, mid, (st_data_t)NEW_METHOD(fbody, body->nd_noex)); - return ST_CONTINUE; -} - -/* :nodoc: */ -VALUE -rb_mod_init_copy(clone, orig) - VALUE clone, orig; -{ - rb_obj_init_copy(clone, orig); - if (!FL_TEST(CLASS_OF(clone), FL_SINGLETON)) { - RBASIC(clone)->klass = RBASIC(orig)->klass; - RBASIC(clone)->klass = rb_singleton_class_clone(clone); - } - RCLASS(clone)->super = RCLASS(orig)->super; - if (RCLASS(orig)->iv_tbl) { - ID id; - - RCLASS(clone)->iv_tbl = st_copy(RCLASS(orig)->iv_tbl); - id = rb_intern("__classpath__"); - st_delete(RCLASS(clone)->iv_tbl, (st_data_t*)&id, 0); - id = rb_intern("__classid__"); - st_delete(RCLASS(clone)->iv_tbl, (st_data_t*)&id, 0); - } - if (RCLASS(orig)->m_tbl) { - struct clone_method_data data; - - data.tbl = RCLASS(clone)->m_tbl = st_init_numtable(); - data.klass = (VALUE)clone; - - st_foreach(RCLASS(orig)->m_tbl, clone_method, (st_data_t)&data); - } - - return clone; -} - -/* :nodoc: */ -VALUE -rb_class_init_copy(clone, orig) - VALUE clone, orig; -{ - if (RCLASS(clone)->super != 0) { - rb_raise(rb_eTypeError, "already initialized class"); - } - if (FL_TEST(orig, FL_SINGLETON)) { - rb_raise(rb_eTypeError, "can't copy singleton class"); - } - return rb_mod_init_copy(clone, orig); -} - -VALUE -rb_singleton_class_clone(obj) - VALUE obj; -{ - VALUE klass = RBASIC(obj)->klass; - - if (!FL_TEST(klass, FL_SINGLETON)) - return klass; - else { - /* copy singleton(unnamed) class */ - NEWOBJ(clone, struct RClass); - OBJSETUP(clone, 0, RBASIC(klass)->flags); - - if (BUILTIN_TYPE(obj) == T_CLASS) { - RBASIC(clone)->klass = (VALUE)clone; - } - else { - RBASIC(clone)->klass = rb_singleton_class_clone(klass); - } - - clone->super = RCLASS(klass)->super; - clone->iv_tbl = 0; - clone->m_tbl = 0; - if (RCLASS(klass)->iv_tbl) { - clone->iv_tbl = st_copy(RCLASS(klass)->iv_tbl); - } - { - struct clone_method_data data; - - data.tbl = clone->m_tbl = st_init_numtable(); - switch (TYPE(obj)) { - case T_CLASS: - case T_MODULE: - data.klass = obj; - break; - default: - data.klass = 0; - break; - } - - st_foreach(RCLASS(klass)->m_tbl, clone_method, (st_data_t)&data); - } - rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone); - FL_SET(clone, FL_SINGLETON); - return (VALUE)clone; - } -} - -void -rb_singleton_class_attached(klass, obj) - VALUE klass, obj; -{ - if (FL_TEST(klass, FL_SINGLETON)) { - if (!RCLASS(klass)->iv_tbl) { - RCLASS(klass)->iv_tbl = st_init_numtable(); - } - st_insert(RCLASS(klass)->iv_tbl, rb_intern("__attached__"), obj); - } -} - -VALUE -rb_make_metaclass(obj, super) - VALUE obj, super; -{ - VALUE klass = rb_class_boot(super); - FL_SET(klass, FL_SINGLETON); - RBASIC(obj)->klass = klass; - rb_singleton_class_attached(klass, obj); - if (BUILTIN_TYPE(obj) == T_CLASS && FL_TEST(obj, FL_SINGLETON)) { - RBASIC(klass)->klass = klass; - RCLASS(klass)->super = RBASIC(rb_class_real(RCLASS(obj)->super))->klass; - } - else { - VALUE metasuper = RBASIC(rb_class_real(super))->klass; - - /* metaclass of a superclass may be NULL at boot time */ - if (metasuper) { - RBASIC(klass)->klass = metasuper; - } - } - - return klass; -} - -VALUE -rb_define_class_id(id, super) - ID id; - VALUE super; -{ - VALUE klass; - - if (!super) super = rb_cObject; - klass = rb_class_new(super); - rb_make_metaclass(klass, RBASIC(super)->klass); - - return klass; -} - -void -rb_check_inheritable(super) - VALUE super; -{ - if (TYPE(super) != T_CLASS) { - rb_raise(rb_eTypeError, "superclass must be a Class (%s given)", - rb_obj_classname(super)); - } - if (RBASIC(super)->flags & FL_SINGLETON) { - rb_raise(rb_eTypeError, "can't make subclass of virtual class"); - } -} - -VALUE -rb_class_inherited(super, klass) - VALUE super, klass; -{ - if (!super) super = rb_cObject; - return rb_funcall(super, rb_intern("inherited"), 1, klass); -} - -VALUE -rb_define_class(name, super) - const char *name; - VALUE super; -{ - VALUE klass; - ID id; - - id = rb_intern(name); - if (rb_const_defined(rb_cObject, id)) { - klass = rb_const_get(rb_cObject, id); - if (TYPE(klass) != T_CLASS) { - rb_raise(rb_eTypeError, "%s is not a class", name); - } - if (rb_class_real(RCLASS(klass)->super) != super) { - rb_name_error(id, "%s is already defined", name); - } - return klass; - } - if (!super) { - rb_warn("no super class for `%s', Object assumed", name); - } - klass = rb_define_class_id(id, super); - st_add_direct(rb_class_tbl, id, klass); - rb_name_class(klass, id); - rb_const_set(rb_cObject, id, klass); - rb_class_inherited(super, klass); - - return klass; -} - -VALUE -rb_define_class_under(outer, name, super) - VALUE outer; - const char *name; - VALUE super; -{ - VALUE klass; - ID id; - - id = rb_intern(name); - if (rb_const_defined_at(outer, id)) { - klass = rb_const_get_at(outer, id); - if (TYPE(klass) != T_CLASS) { - rb_raise(rb_eTypeError, "%s is not a class", name); - } - if (rb_class_real(RCLASS(klass)->super) != super) { - rb_name_error(id, "%s is already defined", name); - } - return klass; - } - if (!super) { - rb_warn("no super class for `%s::%s', Object assumed", - rb_class2name(outer), name); - } - klass = rb_define_class_id(id, super); - rb_set_class_path(klass, outer, name); - rb_const_set(outer, id, klass); - rb_class_inherited(super, klass); - - return klass; -} - -VALUE -rb_module_new() -{ - NEWOBJ(mdl, struct RClass); - OBJSETUP(mdl, rb_cModule, T_MODULE); - - mdl->super = 0; - mdl->iv_tbl = 0; - mdl->m_tbl = 0; - mdl->m_tbl = st_init_numtable(); - - return (VALUE)mdl; -} - -VALUE -rb_define_module_id(id) - ID id; -{ - VALUE mdl; - - mdl = rb_module_new(); - rb_name_class(mdl, id); - - return mdl; -} - -VALUE -rb_define_module(name) - const char *name; -{ - VALUE module; - ID id; - - id = rb_intern(name); - if (rb_const_defined(rb_cObject, id)) { - module = rb_const_get(rb_cObject, id); - if (TYPE(module) == T_MODULE) - return module; - rb_raise(rb_eTypeError, "%s is not a module", rb_obj_classname(module)); - } - module = rb_define_module_id(id); - st_add_direct(rb_class_tbl, id, module); - rb_const_set(rb_cObject, id, module); - - return module; -} - -VALUE -rb_define_module_under(outer, name) - VALUE outer; - const char *name; -{ - VALUE module; - ID id; - - id = rb_intern(name); - if (rb_const_defined_at(outer, id)) { - module = rb_const_get_at(outer, id); - if (TYPE(module) == T_MODULE) - return module; - rb_raise(rb_eTypeError, "%s::%s is not a module", - rb_class2name(outer), rb_obj_classname(module)); - } - module = rb_define_module_id(id); - rb_const_set(outer, id, module); - rb_set_class_path(module, outer, name); - - return module; -} - -static VALUE -include_class_new(module, super) - VALUE module, super; -{ - NEWOBJ(klass, struct RClass); - OBJSETUP(klass, rb_cClass, T_ICLASS); - - if (BUILTIN_TYPE(module) == T_ICLASS) { - module = RBASIC(module)->klass; - } - if (!RCLASS(module)->iv_tbl) { - RCLASS(module)->iv_tbl = st_init_numtable(); - } - klass->iv_tbl = RCLASS(module)->iv_tbl; - klass->m_tbl = RCLASS(module)->m_tbl; - klass->super = super; - if (TYPE(module) == T_ICLASS) { - RBASIC(klass)->klass = RBASIC(module)->klass; - } - else { - RBASIC(klass)->klass = module; - } - OBJ_INFECT(klass, module); - OBJ_INFECT(klass, super); - - return (VALUE)klass; -} - -void -rb_include_module(klass, module) - VALUE klass, module; -{ - VALUE p, c; - int changed = 0; - - rb_frozen_class_p(klass); - if (!OBJ_TAINTED(klass)) { - rb_secure(4); - } - - if (TYPE(module) != T_MODULE) { - Check_Type(module, T_MODULE); - } - - OBJ_INFECT(klass, module); - c = klass; - while (module) { - int superclass_seen = Qfalse; - - if (RCLASS(klass)->m_tbl == RCLASS(module)->m_tbl) - rb_raise(rb_eArgError, "cyclic include detected"); - /* ignore if the module included already in superclasses */ - for (p = RCLASS(klass)->super; p; p = RCLASS(p)->super) { - switch (BUILTIN_TYPE(p)) { - case T_ICLASS: - if (RCLASS(p)->m_tbl == RCLASS(module)->m_tbl) { - if (!superclass_seen) { - c = p; /* move insertion point */ - } - goto skip; - } - break; - case T_CLASS: - superclass_seen = Qtrue; - break; - } - } - c = RCLASS(c)->super = include_class_new(module, RCLASS(c)->super); - changed = 1; - skip: - module = RCLASS(module)->super; - } - if (changed) rb_clear_cache(); -} - -/* - * call-seq: - * mod.included_modules -> array - * - * Returns the list of modules included in mod. - * - * module Mixin - * end - * - * module Outer - * include Mixin - * end - * - * Mixin.included_modules #=> [] - * Outer.included_modules #=> [Mixin] - */ - -VALUE -rb_mod_included_modules(mod) - VALUE mod; -{ - VALUE ary = rb_ary_new(); - VALUE p; - - for (p = RCLASS(mod)->super; p; p = RCLASS(p)->super) { - if (BUILTIN_TYPE(p) == T_ICLASS) { - rb_ary_push(ary, RBASIC(p)->klass); - } - } - return ary; -} - -/* - * call-seq: - * mod.include?(module) => true or false - * - * Returns true if module is included in - * mod or one of mod's ancestors. - * - * module A - * end - * class B - * include A - * end - * class C < B - * end - * B.include?(A) #=> true - * C.include?(A) #=> true - * A.include?(A) #=> false - */ - -VALUE -rb_mod_include_p(mod, mod2) - VALUE mod; - VALUE mod2; -{ - VALUE p; - - Check_Type(mod2, T_MODULE); - for (p = RCLASS(mod)->super; p; p = RCLASS(p)->super) { - if (BUILTIN_TYPE(p) == T_ICLASS) { - if (RBASIC(p)->klass == mod2) return Qtrue; - } - } - return Qfalse; -} - -/* - * call-seq: - * mod.ancestors -> array - * - * Returns a list of modules included in mod (including - * mod itself). - * - * module Mod - * include Math - * include Comparable - * end - * - * Mod.ancestors #=> [Mod, Comparable, Math] - * Math.ancestors #=> [Math] - */ - -VALUE -rb_mod_ancestors(mod) - VALUE mod; -{ - VALUE p, ary = rb_ary_new(); - - for (p = mod; p; p = RCLASS(p)->super) { - if (FL_TEST(p, FL_SINGLETON)) - continue; - if (BUILTIN_TYPE(p) == T_ICLASS) { - rb_ary_push(ary, RBASIC(p)->klass); - } - else { - rb_ary_push(ary, p); - } - } - return ary; -} - -#define VISI(x) ((x)&NOEX_MASK) -#define VISI_CHECK(x,f) (VISI(x) == (f)) - -static int -ins_methods_push(name, type, ary, visi) - ID name; - long type; - VALUE ary; - long visi; -{ - if (type == -1) return ST_CONTINUE; - switch (visi) { - case NOEX_PRIVATE: - case NOEX_PROTECTED: - case NOEX_PUBLIC: - visi = (type == visi); - break; - default: - visi = (type != NOEX_PRIVATE); - break; - } - if (visi) { - rb_ary_push(ary, rb_str_new2(rb_id2name(name))); - } - return ST_CONTINUE; -} - -static int -ins_methods_i(name, type, ary) - ID name; - long type; - VALUE ary; -{ - return ins_methods_push(name, type, ary, -1); /* everything but private */ -} - -static int -ins_methods_prot_i(name, type, ary) - ID name; - long type; - VALUE ary; -{ - return ins_methods_push(name, type, ary, NOEX_PROTECTED); -} - -static int -ins_methods_priv_i(name, type, ary) - ID name; - long type; - VALUE ary; -{ - return ins_methods_push(name, type, ary, NOEX_PRIVATE); -} - -static int -ins_methods_pub_i(name, type, ary) - ID name; - long type; - VALUE ary; -{ - return ins_methods_push(name, type, ary, NOEX_PUBLIC); -} - -static int -method_entry(key, body, list) - ID key; - NODE *body; - st_table *list; -{ - long type; - - if (key == ID_ALLOCATOR) return ST_CONTINUE; - if (!st_lookup(list, key, 0)) { - if (!body->nd_body) type = -1; /* none */ - else type = VISI(body->nd_noex); - st_add_direct(list, key, type); - } - return ST_CONTINUE; -} - -static VALUE -class_instance_method_list(argc, argv, mod, func) - int argc; - VALUE *argv; - VALUE mod; - int (*func) _((ID, long, VALUE)); -{ - VALUE ary; - int recur; - st_table *list; - - if (argc == 0) { - recur = Qtrue; - } - else { - VALUE r; - rb_scan_args(argc, argv, "01", &r); - recur = RTEST(r); - } - - list = st_init_numtable(); - for (; mod; mod = RCLASS(mod)->super) { - st_foreach(RCLASS(mod)->m_tbl, method_entry, (st_data_t)list); - if (BUILTIN_TYPE(mod) == T_ICLASS) continue; - if (FL_TEST(mod, FL_SINGLETON)) continue; - if (!recur) break; - } - ary = rb_ary_new(); - st_foreach(list, func, ary); - st_free_table(list); - - return ary; -} - -/* - * call-seq: - * mod.instance_methods(include_super=true) => array - * - * Returns an array containing the names of public instance methods in - * the receiver. For a module, these are the public methods; for a - * class, they are the instance (not singleton) methods. With no - * argument, or with an argument that is false, the - * instance methods in mod are returned, otherwise the methods - * in mod and mod's superclasses are returned. - * - * module A - * def method1() end - * end - * class B - * def method2() end - * end - * class C < B - * def method3() end - * end - * - * A.instance_methods #=> ["method1"] - * B.instance_methods(false) #=> ["method2"] - * C.instance_methods(false) #=> ["method3"] - * C.instance_methods(true).length #=> 43 - */ - -VALUE -rb_class_instance_methods(argc, argv, mod) - int argc; - VALUE *argv; - VALUE mod; -{ - return class_instance_method_list(argc, argv, mod, ins_methods_i); -} - -/* - * call-seq: - * mod.protected_instance_methods(include_super=true) => array - * - * Returns a list of the protected instance methods defined in - * mod. If the optional parameter is not false, the - * methods of any ancestors are included. - */ - -VALUE -rb_class_protected_instance_methods(argc, argv, mod) - int argc; - VALUE *argv; - VALUE mod; -{ - return class_instance_method_list(argc, argv, mod, ins_methods_prot_i); -} - -/* - * call-seq: - * mod.private_instance_methods(include_super=true) => array - * - * Returns a list of the private instance methods defined in - * mod. If the optional parameter is not false, the - * methods of any ancestors are included. - * - * module Mod - * def method1() end - * private :method1 - * def method2() end - * end - * Mod.instance_methods #=> ["method2"] - * Mod.private_instance_methods #=> ["method1"] - */ - -VALUE -rb_class_private_instance_methods(argc, argv, mod) - int argc; - VALUE *argv; - VALUE mod; -{ - return class_instance_method_list(argc, argv, mod, ins_methods_priv_i); -} - -/* - * call-seq: - * mod.public_instance_methods(include_super=true) => array - * - * Returns a list of the public instance methods defined in mod. - * If the optional parameter is not false, the methods of - * any ancestors are included. - */ - -VALUE -rb_class_public_instance_methods(argc, argv, mod) - int argc; - VALUE *argv; - VALUE mod; -{ - return class_instance_method_list(argc, argv, mod, ins_methods_pub_i); -} - -/* - * call-seq: - * obj.singleton_methods(all=true) => array - * - * Returns an array of the names of singleton methods for obj. - * If the optional all parameter is true, the list will include - * methods in modules included in obj. - * - * module Other - * def three() end - * end - * - * class Single - * def Single.four() end - * end - * - * a = Single.new - * - * def a.one() - * end - * - * class << a - * include Other - * def two() - * end - * end - * - * Single.singleton_methods #=> ["four"] - * a.singleton_methods(false) #=> ["two", "one"] - * a.singleton_methods #=> ["two", "one", "three"] - */ - -VALUE -rb_obj_singleton_methods(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - VALUE recur, ary, klass; - st_table *list; - - rb_scan_args(argc, argv, "01", &recur); - if (argc == 0) { - recur = Qtrue; - } - klass = CLASS_OF(obj); - list = st_init_numtable(); - if (klass && FL_TEST(klass, FL_SINGLETON)) { - st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list); - klass = RCLASS(klass)->super; - } - if (RTEST(recur)) { - while (klass && (FL_TEST(klass, FL_SINGLETON) || TYPE(klass) == T_ICLASS)) { - st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list); - klass = RCLASS(klass)->super; - } - } - ary = rb_ary_new(); - st_foreach(list, ins_methods_i, ary); - st_free_table(list); - - return ary; -} - -void -rb_define_method_id(klass, name, func, argc) - VALUE klass; - ID name; - VALUE (*func)(); - int argc; -{ - rb_add_method(klass, name, NEW_CFUNC(func,argc), NOEX_PUBLIC); -} - -void -rb_define_method(klass, name, func, argc) - VALUE klass; - const char *name; - VALUE (*func)(); - int argc; -{ - ID id = rb_intern(name); - int ex = NOEX_PUBLIC; - - - rb_add_method(klass, id, NEW_CFUNC(func, argc), ex); -} - -void -rb_define_protected_method(klass, name, func, argc) - VALUE klass; - const char *name; - VALUE (*func)(); - int argc; -{ - rb_add_method(klass, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PROTECTED); -} - -void -rb_define_private_method(klass, name, func, argc) - VALUE klass; - const char *name; - VALUE (*func)(); - int argc; -{ - rb_add_method(klass, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PRIVATE); -} - -void -rb_undef_method(klass, name) - VALUE klass; - const char *name; -{ - rb_add_method(klass, rb_intern(name), 0, NOEX_UNDEF); -} - -#define SPECIAL_SINGLETON(x,c) do {\ - if (obj == (x)) {\ - return c;\ - }\ -} while (0) - -VALUE -rb_singleton_class(obj) - VALUE obj; -{ - VALUE klass; - - if (FIXNUM_P(obj) || SYMBOL_P(obj)) { - rb_raise(rb_eTypeError, "can't define singleton"); - } - if (rb_special_const_p(obj)) { - SPECIAL_SINGLETON(Qnil, rb_cNilClass); - SPECIAL_SINGLETON(Qfalse, rb_cFalseClass); - SPECIAL_SINGLETON(Qtrue, rb_cTrueClass); - rb_bug("unknown immediate %ld", obj); - } - - DEFER_INTS; - if (FL_TEST(RBASIC(obj)->klass, FL_SINGLETON) && - rb_iv_get(RBASIC(obj)->klass, "__attached__") == obj) { - klass = RBASIC(obj)->klass; - } - else { - klass = rb_make_metaclass(obj, RBASIC(obj)->klass); - } - if (OBJ_TAINTED(obj)) { - OBJ_TAINT(klass); - } - else { - FL_UNSET(klass, FL_TAINT); - } - if (OBJ_FROZEN(obj)) OBJ_FREEZE(klass); - ALLOW_INTS; - - return klass; -} - -void -rb_define_singleton_method(obj, name, func, argc) - VALUE obj; - const char *name; - VALUE (*func)(); - int argc; -{ - rb_define_method(rb_singleton_class(obj), name, func, argc); -} - -void -rb_define_module_function(module, name, func, argc) - VALUE module; - const char *name; - VALUE (*func)(); - int argc; -{ - rb_define_private_method(module, name, func, argc); - rb_define_singleton_method(module, name, func, argc); -} - -void -rb_define_global_function(name, func, argc) - const char *name; - VALUE (*func)(); - int argc; -{ - rb_define_module_function(rb_mKernel, name, func, argc); -} - -void -rb_define_alias(klass, name1, name2) - VALUE klass; - const char *name1, *name2; -{ - rb_alias(klass, rb_intern(name1), rb_intern(name2)); -} - -void -rb_define_attr(klass, name, read, write) - VALUE klass; - const char *name; - int read, write; -{ - rb_attr(klass, rb_intern(name), read, write, Qfalse); -} - -#ifdef HAVE_STDARG_PROTOTYPES -#include -#define va_init_list(a,b) va_start(a,b) -#else -#include -#define va_init_list(a,b) va_start(a) -#endif - -int -#ifdef HAVE_STDARG_PROTOTYPES -rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...) -#else -rb_scan_args(argc, argv, fmt, va_alist) - int argc; - const VALUE *argv; - const char *fmt; - va_dcl -#endif -{ - int n, i = 0; - const char *p = fmt; - VALUE *var; - va_list vargs; - - va_init_list(vargs, fmt); - - if (*p == '*') goto rest_arg; - - if (ISDIGIT(*p)) { - n = *p - '0'; - if (n > argc) - rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, n); - for (i=0; i i) { - if (var) *var = argv[i]; - } - else { - if (var) *var = Qnil; - } - } - p++; - } - - if(*p == '*') { - rest_arg: - var = va_arg(vargs, VALUE*); - if (argc > i) { - if (var) *var = rb_ary_new4(argc-i, argv+i); - i = argc; - } - else { - if (var) *var = rb_ary_new(); - } - p++; - } - - if (*p == '&') { - var = va_arg(vargs, VALUE*); - if (rb_block_given_p()) { - *var = rb_block_proc(); - } - else { - *var = Qnil; - } - p++; - } - va_end(vargs); - - if (*p != '\0') { - goto error; - } - - if (argc > i) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, i); - } - - return argc; - - error: - rb_fatal("bad scan arg format: %s", fmt); - return 0; -} -/********************************************************************** - - compar.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007) $ - created at: Thu Aug 26 14:39:48 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" - -VALUE rb_mComparable; - -static ID cmp; - -int -rb_cmpint(val, a, b) - VALUE val, a, b; -{ - if (NIL_P(val)) { - rb_cmperr(a, b); - } - if (FIXNUM_P(val)) return FIX2INT(val); - if (TYPE(val) == T_BIGNUM) { - if (RBIGNUM(val)->sign) return 1; - return -1; - } - if (RTEST(rb_funcall(val, '>', 1, INT2FIX(0)))) return 1; - if (RTEST(rb_funcall(val, '<', 1, INT2FIX(0)))) return -1; - return 0; -} - -void -rb_cmperr(x, y) - VALUE x, y; -{ - const char *classname; - - if (SPECIAL_CONST_P(y)) { - y = rb_inspect(y); - classname = StringValuePtr(y); - } - else { - classname = rb_obj_classname(y); - } - rb_raise(rb_eArgError, "comparison of %s with %s failed", - rb_obj_classname(x), classname); -} - -#define cmperr() (rb_cmperr(x, y), Qnil) - -static VALUE -cmp_eq(a) - VALUE *a; -{ - VALUE c = rb_funcall(a[0], cmp, 1, a[1]); - - if (NIL_P(c)) return Qnil; - if (rb_cmpint(c, a[0], a[1]) == 0) return Qtrue; - return Qfalse; -} - -static VALUE -cmp_failed() -{ - return Qnil; -} - -/* - * call-seq: - * obj == other => true or false - * - * Compares two objects based on the receiver's <=> - * method, returning true if it returns 0. Also returns true if - * _obj_ and _other_ are the same object. - */ - -static VALUE -cmp_equal(x, y) - VALUE x, y; -{ - VALUE a[2]; - - if (x == y) return Qtrue; - - a[0] = x; a[1] = y; - return rb_rescue(cmp_eq, (VALUE)a, cmp_failed, 0); -} - -/* - * call-seq: - * obj > other => true or false - * - * Compares two objects based on the receiver's <=> - * method, returning true if it returns 1. - */ - -static VALUE -cmp_gt(x, y) - VALUE x, y; -{ - VALUE c = rb_funcall(x, cmp, 1, y); - - if (NIL_P(c)) return cmperr(); - if (rb_cmpint(c, x, y) > 0) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * obj >= other => true or false - * - * Compares two objects based on the receiver's <=> - * method, returning true if it returns 0 or 1. - */ - -static VALUE -cmp_ge(x, y) - VALUE x, y; -{ - VALUE c = rb_funcall(x, cmp, 1, y); - - if (NIL_P(c)) return cmperr(); - if (rb_cmpint(c, x, y) >= 0) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * obj < other => true or false - * - * Compares two objects based on the receiver's <=> - * method, returning true if it returns -1. - */ - -static VALUE -cmp_lt(x, y) - VALUE x, y; -{ - VALUE c = rb_funcall(x, cmp, 1, y); - - if (NIL_P(c)) return cmperr(); - if (rb_cmpint(c, x, y) < 0) return Qtrue; - return Qfalse; -} - - -/* - * call-seq: - * obj <= other => true or false - * - * Compares two objects based on the receiver's <=> - * method, returning true if it returns -1 or 0. - */ - -static VALUE -cmp_le(x, y) - VALUE x, y; -{ - VALUE c = rb_funcall(x, cmp, 1, y); - - if (NIL_P(c)) return cmperr(); - if (rb_cmpint(c, x, y) <= 0) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * obj.between?(min, max) => true or false - * - * Returns false if obj <=> - * min is less than zero or if anObject <=> - * max is greater than zero, true otherwise. - * - * 3.between?(1, 5) #=> true - * 6.between?(1, 5) #=> false - * 'cat'.between?('ant', 'dog') #=> true - * 'gnu'.between?('ant', 'dog') #=> false - * - */ - -static VALUE -cmp_between(x, min, max) - VALUE x, min, max; -{ - if (RTEST(cmp_lt(x, min))) return Qfalse; - if (RTEST(cmp_gt(x, max))) return Qfalse; - return Qtrue; -} - -/* - * The Comparable mixin is used by classes whose objects - * may be ordered. The class must define the <=> operator, - * which compares the receiver against another object, returning -1, 0, - * or +1 depending on whether the receiver is less than, equal to, or - * greater than the other object. Comparable uses - * <=> to implement the conventional comparison operators - * (<, <=, ==, >=, - * and >) and the method between?. - * - * class SizeMatters - * include Comparable - * attr :str - * def <=>(anOther) - * str.size <=> anOther.str.size - * end - * def initialize(str) - * @str = str - * end - * def inspect - * @str - * end - * end - * - * s1 = SizeMatters.new("Z") - * s2 = SizeMatters.new("YY") - * s3 = SizeMatters.new("XXX") - * s4 = SizeMatters.new("WWWW") - * s5 = SizeMatters.new("VVVVV") - * - * s1 < s2 #=> true - * s4.between?(s1, s3) #=> false - * s4.between?(s3, s5) #=> true - * [ s3, s2, s5, s4, s1 ].sort #=> [Z, YY, XXX, WWWW, VVVVV] - * - */ - -void -Init_Comparable() -{ - rb_mComparable = rb_define_module("Comparable"); - rb_define_method(rb_mComparable, "==", cmp_equal, 1); - rb_define_method(rb_mComparable, ">", cmp_gt, 1); - rb_define_method(rb_mComparable, ">=", cmp_ge, 1); - rb_define_method(rb_mComparable, "<", cmp_lt, 1); - rb_define_method(rb_mComparable, "<=", cmp_le, 1); - rb_define_method(rb_mComparable, "between?", cmp_between, 2); - - cmp = rb_intern("<=>"); -} -/********************************************************************** - - dir.c - - - $Author: shyouhei $ - $Date: 2009-02-04 06:26:31 +0100 (Wed, 04 Feb 2009) $ - created at: Wed Jan 5 09:51:01 JST 1994 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#include "ruby.h" - -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -#if defined HAVE_DIRENT_H && !defined _WIN32 -# include -# define NAMLEN(dirent) strlen((dirent)->d_name) -#elif defined HAVE_DIRECT_H && !defined _WIN32 -# include -# define NAMLEN(dirent) strlen((dirent)->d_name) -#else -# define dirent direct -# if !defined __NeXT__ -# define NAMLEN(dirent) (dirent)->d_namlen -# else -# /* On some versions of NextStep, d_namlen is always zero, so avoid it. */ -# define NAMLEN(dirent) strlen((dirent)->d_name) -# endif -# if HAVE_SYS_NDIR_H -# include -# endif -# if HAVE_SYS_DIR_H -# include -# endif -# if HAVE_NDIR_H -# include -# endif -# ifdef _WIN32 -# include "win32/dir.h" -# endif -#endif - -#include - -#ifndef HAVE_STDLIB_H -char *getenv(); -#endif - -#ifndef HAVE_STRING_H -char *strchr _((char*,char)); -#endif - -#include - -#include "util.h" - -#if !defined HAVE_LSTAT && !defined lstat -#define lstat stat -#endif - -#ifndef CASEFOLD_FILESYSTEM -# if defined DOSISH || defined __VMS -# define CASEFOLD_FILESYSTEM 1 -# else -# define CASEFOLD_FILESYSTEM 0 -# endif -#endif - -#define FNM_NOESCAPE 0x01 -#define FNM_PATHNAME 0x02 -#define FNM_DOTMATCH 0x04 -#define FNM_CASEFOLD 0x08 -#if CASEFOLD_FILESYSTEM -#define FNM_SYSCASE FNM_CASEFOLD -#else -#define FNM_SYSCASE 0 -#endif - -#define FNM_NOMATCH 1 -#define FNM_ERROR 2 - -#define downcase(c) (nocase && ISUPPER(c) ? tolower(c) : (c)) -#define compare(c1, c2) (((unsigned char)(c1)) - ((unsigned char)(c2))) - -/* caution: in case *p == '\0' - Next(p) == p + 1 in single byte environment - Next(p) == p in multi byte environment -*/ -#if defined(CharNext) -# define Next(p) CharNext(p) -#elif defined(DJGPP) -# define Next(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE)) -#elif defined(__EMX__) -# define Next(p) ((p) + emx_mblen(p)) -static inline int -emx_mblen(const char *p) -{ - int n = mblen(p, RUBY_MBCHAR_MAXSIZE); - return (n < 0) ? 1 : n; -} -#endif - -#ifndef Next /* single byte environment */ -# define Next(p) ((p) + 1) -# define Inc(p) (++(p)) -# define Compare(p1, p2) (compare(downcase(*(p1)), downcase(*(p2)))) -#else /* multi byte environment */ -# define Inc(p) ((p) = Next(p)) -# define Compare(p1, p2) (CompareImpl(p1, p2, nocase)) -static int -CompareImpl(const char *p1, const char *p2, int nocase) -{ - const int len1 = Next(p1) - p1; - const int len2 = Next(p2) - p2; -#ifdef _WIN32 - char buf1[10], buf2[10]; /* large enough? */ -#endif - - if (len1 < 0 || len2 < 0) { - rb_fatal("CompareImpl: negative len"); - } - - if (len1 == 0) return len2; - if (len2 == 0) return -len1; - -#ifdef _WIN32 - if (nocase && rb_w32_iswinnt()) { - if (len1 > 1) { - if (len1 >= sizeof(buf1)) { - rb_fatal("CompareImpl: too large len"); - } - memcpy(buf1, p1, len1); - buf1[len1] = '\0'; - CharLower(buf1); - p1 = buf1; /* trick */ - } - if (len2 > 1) { - if (len2 >= sizeof(buf2)) { - rb_fatal("CompareImpl: too large len"); - } - memcpy(buf2, p2, len2); - buf2[len2] = '\0'; - CharLower(buf2); - p2 = buf2; /* trick */ - } - } -#endif - if (len1 == 1) - if (len2 == 1) - return compare(downcase(*p1), downcase(*p2)); - else { - const int ret = compare(downcase(*p1), *p2); - return ret ? ret : -1; - } - else - if (len2 == 1) { - const int ret = compare(*p1, downcase(*p2)); - return ret ? ret : 1; - } - else { - const int ret = memcmp(p1, p2, len1 < len2 ? len1 : len2); - return ret ? ret : len1 - len2; - } -} -#endif /* environment */ - -static char * -bracket(p, s, flags) - const char *p; /* pattern (next to '[') */ - const char *s; /* string */ - int flags; -{ - const int nocase = flags & FNM_CASEFOLD; - const int escape = !(flags & FNM_NOESCAPE); - - int ok = 0, not = 0; - - if (*p == '!' || *p == '^') { - not = 1; - p++; - } - - while (*p != ']') { - const char *t1 = p; - if (escape && *t1 == '\\') - t1++; - if (!*t1) - return NULL; - p = Next(t1); - if (p[0] == '-' && p[1] != ']') { - const char *t2 = p + 1; - if (escape && *t2 == '\\') - t2++; - if (!*t2) - return NULL; - p = Next(t2); - if (!ok && Compare(t1, s) <= 0 && Compare(s, t2) <= 0) - ok = 1; - } - else - if (!ok && Compare(t1, s) == 0) - ok = 1; - } - - return ok == not ? NULL : (char *)p + 1; -} - -/* If FNM_PATHNAME is set, only path element will be matched. (upto '/' or '\0') - Otherwise, entire string will be matched. - End marker itself won't be compared. - And if function succeeds, *pcur reaches end marker. -*/ -#define UNESCAPE(p) (escape && *(p) == '\\' ? (p) + 1 : (p)) -#define ISEND(p) (!*(p) || (pathname && *(p) == '/')) -#define RETURN(val) return *pcur = p, *scur = s, (val); - -static int -fnmatch_helper(pcur, scur, flags) - const char **pcur; /* pattern */ - const char **scur; /* string */ - int flags; -{ - const int period = !(flags & FNM_DOTMATCH); - const int pathname = flags & FNM_PATHNAME; - const int escape = !(flags & FNM_NOESCAPE); - const int nocase = flags & FNM_CASEFOLD; - - const char *ptmp = 0; - const char *stmp = 0; - - const char *p = *pcur; - const char *s = *scur; - - if (period && *s == '.' && *UNESCAPE(p) != '.') /* leading period */ - RETURN(FNM_NOMATCH); - - while (1) { - switch (*p) { - case '*': - do { p++; } while (*p == '*'); - if (ISEND(UNESCAPE(p))) { - p = UNESCAPE(p); - RETURN(0); - } - if (ISEND(s)) - RETURN(FNM_NOMATCH); - ptmp = p; - stmp = s; - continue; - - case '?': - if (ISEND(s)) - RETURN(FNM_NOMATCH); - p++; - Inc(s); - continue; - - case '[': { - const char *t; - if (ISEND(s)) - RETURN(FNM_NOMATCH); - if (t = bracket(p + 1, s, flags)) { - p = t; - Inc(s); - continue; - } - goto failed; - } - } - - /* ordinary */ - p = UNESCAPE(p); - if (ISEND(s)) - RETURN(ISEND(p) ? 0 : FNM_NOMATCH); - if (ISEND(p)) - goto failed; - if (Compare(p, s) != 0) - goto failed; - Inc(p); - Inc(s); - continue; - - failed: /* try next '*' position */ - if (ptmp && stmp) { - p = ptmp; - Inc(stmp); /* !ISEND(*stmp) */ - s = stmp; - continue; - } - RETURN(FNM_NOMATCH); - } -} - -static int -fnmatch(p, s, flags) - const char *p; /* pattern */ - const char *s; /* string */ - int flags; -{ - const int period = !(flags & FNM_DOTMATCH); - const int pathname = flags & FNM_PATHNAME; - - const char *ptmp = 0; - const char *stmp = 0; - - if (pathname) { - while (1) { - if (p[0] == '*' && p[1] == '*' && p[2] == '/') { - do { p += 3; } while (p[0] == '*' && p[1] == '*' && p[2] == '/'); - ptmp = p; - stmp = s; - } - if (fnmatch_helper(&p, &s, flags) == 0) { - while (*s && *s != '/') Inc(s); - if (*p && *s) { - p++; - s++; - continue; - } - if (!*p && !*s) - return 0; - } - /* failed : try next recursion */ - if (ptmp && stmp && !(period && *stmp == '.')) { - while (*stmp && *stmp != '/') Inc(stmp); - if (*stmp) { - p = ptmp; - stmp++; - s = stmp; - continue; - } - } - return FNM_NOMATCH; - } - } - else - return fnmatch_helper(&p, &s, flags); -} - -VALUE rb_cDir; - -struct dir_data { - DIR *dir; - char *path; -}; - -static void -free_dir(dir) - struct dir_data *dir; -{ - if (dir) { - if (dir->dir) closedir(dir->dir); - if (dir->path) free(dir->path); - } - free(dir); -} - -static VALUE dir_close _((VALUE)); - -static VALUE dir_s_alloc _((VALUE)); -static VALUE -dir_s_alloc(klass) - VALUE klass; -{ - struct dir_data *dirp; - VALUE obj = Data_Make_Struct(klass, struct dir_data, 0, free_dir, dirp); - - dirp->dir = NULL; - dirp->path = NULL; - - return obj; -} - -/* - * call-seq: - * Dir.new( string ) -> aDir - * - * Returns a new directory object for the named directory. - */ -static VALUE -dir_initialize(dir, dirname) - VALUE dir, dirname; -{ - struct dir_data *dp; - - SafeStringValue(dirname); - Data_Get_Struct(dir, struct dir_data, dp); - if (dp->dir) closedir(dp->dir); - if (dp->path) free(dp->path); - dp->dir = NULL; - dp->path = NULL; - dp->dir = opendir(RSTRING(dirname)->ptr); - if (dp->dir == NULL) { - if (errno == EMFILE || errno == ENFILE) { - rb_gc(); - dp->dir = opendir(RSTRING(dirname)->ptr); - } - if (dp->dir == NULL) { - rb_sys_fail(RSTRING(dirname)->ptr); - } - } - dp->path = strdup(RSTRING(dirname)->ptr); - - return dir; -} - -/* - * call-seq: - * Dir.open( string ) => aDir - * Dir.open( string ) {| aDir | block } => anObject - * - * With no block, open is a synonym for - * Dir::new. If a block is present, it is passed - * aDir as a parameter. The directory is closed at the end of - * the block, and Dir::open returns the value of the - * block. - */ - -static VALUE -dir_s_open(klass, dirname) - VALUE klass, dirname; -{ - struct dir_data *dp; - VALUE dir = Data_Make_Struct(klass, struct dir_data, 0, free_dir, dp); - - dir_initialize(dir, dirname); - if (rb_block_given_p()) { - return rb_ensure(rb_yield, dir, dir_close, dir); - } - - return dir; -} - -static void -dir_closed() -{ - rb_raise(rb_eIOError, "closed directory"); -} - -static void -dir_check(dir) - VALUE dir; -{ - if (!OBJ_TAINTED(dir) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: operation on untainted Dir"); - rb_check_frozen(dir); -} - -#define GetDIR(obj, dirp) do {\ - dir_check(dir);\ - Data_Get_Struct(obj, struct dir_data, dirp);\ - if (dirp->dir == NULL) dir_closed();\ -} while (0) - -/* - * call-seq: - * dir.inspect => string - * - * Return a string describing this Dir object. - */ -static VALUE -dir_inspect(dir) - VALUE dir; -{ - struct dir_data *dirp; - - GetDIR(dir, dirp); - if (dirp->path) { - char *c = rb_obj_classname(dir); - int len = strlen(c) + strlen(dirp->path) + 4; - VALUE s = rb_str_new(0, len); - snprintf(RSTRING_PTR(s), len+1, "#<%s:%s>", c, dirp->path); - return s; - } - return rb_funcall(dir, rb_intern("to_s"), 0, 0); -} - -/* - * call-seq: - * dir.path => string or nil - * - * Returns the path parameter passed to dir's constructor. - * - * d = Dir.new("..") - * d.path #=> ".." - */ -static VALUE -dir_path(dir) - VALUE dir; -{ - struct dir_data *dirp; - - GetDIR(dir, dirp); - if (!dirp->path) return Qnil; - return rb_str_new2(dirp->path); -} - -/* - * call-seq: - * dir.read => string or nil - * - * Reads the next entry from dir and returns it as a string. - * Returns nil at the end of the stream. - * - * d = Dir.new("testdir") - * d.read #=> "." - * d.read #=> ".." - * d.read #=> "config.h" - */ -static VALUE -dir_read(dir) - VALUE dir; -{ - struct dir_data *dirp; - struct dirent *dp; - - GetDIR(dir, dirp); - errno = 0; - dp = readdir(dirp->dir); - if (dp) { - return rb_tainted_str_new(dp->d_name, NAMLEN(dp)); - } - else if (errno == 0) { /* end of stream */ - return Qnil; - } - else { - rb_sys_fail(0); - } - return Qnil; /* not reached */ -} - -/* - * call-seq: - * dir.each { |filename| block } => dir - * - * Calls the block once for each entry in this directory, passing the - * filename of each entry as a parameter to the block. - * - * d = Dir.new("testdir") - * d.each {|x| puts "Got #{x}" } - * - * produces: - * - * Got . - * Got .. - * Got config.h - * Got main.rb - */ -static VALUE -dir_each(dir) - VALUE dir; -{ - struct dir_data *dirp; - struct dirent *dp; - - GetDIR(dir, dirp); - rewinddir(dirp->dir); - for (dp = readdir(dirp->dir); dp != NULL; dp = readdir(dirp->dir)) { - rb_yield(rb_tainted_str_new(dp->d_name, NAMLEN(dp))); - if (dirp->dir == NULL) dir_closed(); - } - return dir; -} - -/* - * call-seq: - * dir.pos => integer - * dir.tell => integer - * - * Returns the current position in dir. See also - * Dir#seek. - * - * d = Dir.new("testdir") - * d.tell #=> 0 - * d.read #=> "." - * d.tell #=> 12 - */ -static VALUE -dir_tell(dir) - VALUE dir; -{ -#ifdef HAVE_TELLDIR - struct dir_data *dirp; - long pos; - - GetDIR(dir, dirp); - pos = telldir(dirp->dir); - return rb_int2inum(pos); -#else - rb_notimplement(); -#endif -} - -/* - * call-seq: - * dir.seek( integer ) => dir - * - * Seeks to a particular location in dir. integer - * must be a value returned by Dir#tell. - * - * d = Dir.new("testdir") #=> # - * d.read #=> "." - * i = d.tell #=> 12 - * d.read #=> ".." - * d.seek(i) #=> # - * d.read #=> ".." - */ -static VALUE -dir_seek(dir, pos) - VALUE dir, pos; -{ - struct dir_data *dirp; - off_t p = NUM2OFFT(pos); - - GetDIR(dir, dirp); -#ifdef HAVE_SEEKDIR - seekdir(dirp->dir, p); - return dir; -#else - rb_notimplement(); -#endif -} - -/* - * call-seq: - * dir.pos( integer ) => integer - * - * Synonym for Dir#seek, but returns the position - * parameter. - * - * d = Dir.new("testdir") #=> # - * d.read #=> "." - * i = d.pos #=> 12 - * d.read #=> ".." - * d.pos = i #=> 12 - * d.read #=> ".." - */ -static VALUE -dir_set_pos(dir, pos) - VALUE dir, pos; -{ - dir_seek(dir, pos); - return pos; -} - -/* - * call-seq: - * dir.rewind => dir - * - * Repositions dir to the first entry. - * - * d = Dir.new("testdir") - * d.read #=> "." - * d.rewind #=> # - * d.read #=> "." - */ -static VALUE -dir_rewind(dir) - VALUE dir; -{ - struct dir_data *dirp; - - if (rb_safe_level() >= 4 && !OBJ_TAINTED(dir)) { - rb_raise(rb_eSecurityError, "Insecure: can't close"); - } - GetDIR(dir, dirp); - rewinddir(dirp->dir); - return dir; -} - -/* - * call-seq: - * dir.close => nil - * - * Closes the directory stream. Any further attempts to access - * dir will raise an IOError. - * - * d = Dir.new("testdir") - * d.close #=> nil - */ -static VALUE -dir_close(dir) - VALUE dir; -{ - struct dir_data *dirp; - - GetDIR(dir, dirp); - closedir(dirp->dir); - dirp->dir = NULL; - - return Qnil; -} - -static void -dir_chdir(path) - VALUE path; -{ - if (chdir(RSTRING(path)->ptr) < 0) - rb_sys_fail(RSTRING(path)->ptr); -} - -static int chdir_blocking = 0; -static VALUE chdir_thread = Qnil; - -struct chdir_data { - VALUE old_path, new_path; - int done; -}; - -static VALUE -chdir_yield(args) - struct chdir_data *args; -{ - dir_chdir(args->new_path); - args->done = Qtrue; - chdir_blocking++; - if (chdir_thread == Qnil) - chdir_thread = rb_thread_current(); - return rb_yield(args->new_path); -} - -static VALUE -chdir_restore(args) - struct chdir_data *args; -{ - if (args->done) { - chdir_blocking--; - if (chdir_blocking == 0) - chdir_thread = Qnil; - dir_chdir(args->old_path); - } - return Qnil; -} - -/* - * call-seq: - * Dir.chdir( [ string] ) => 0 - * Dir.chdir( [ string] ) {| path | block } => anObject - * - * Changes the current working directory of the process to the given - * string. When called without an argument, changes the directory to - * the value of the environment variable HOME, or - * LOGDIR. SystemCallError (probably - * Errno::ENOENT) if the target directory does not exist. - * - * If a block is given, it is passed the name of the new current - * directory, and the block is executed with that as the current - * directory. The original working directory is restored when the block - * exits. The return value of chdir is the value of the - * block. chdir blocks can be nested, but in a - * multi-threaded program an error will be raised if a thread attempts - * to open a chdir block while another thread has one - * open. - * - * Dir.chdir("/var/spool/mail") - * puts Dir.pwd - * Dir.chdir("/tmp") do - * puts Dir.pwd - * Dir.chdir("/usr") do - * puts Dir.pwd - * end - * puts Dir.pwd - * end - * puts Dir.pwd - * - * produces: - * - * /var/spool/mail - * /tmp - * /usr - * /tmp - * /var/spool/mail - */ -static VALUE -dir_s_chdir(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - VALUE path = Qnil; - - rb_secure(2); - if (rb_scan_args(argc, argv, "01", &path) == 1) { - SafeStringValue(path); - } - else { - const char *dist = getenv("HOME"); - if (!dist) { - dist = getenv("LOGDIR"); - if (!dist) rb_raise(rb_eArgError, "HOME/LOGDIR not set"); - } - path = rb_str_new2(dist); - } - - if (chdir_blocking > 0) { - if (!rb_block_given_p() || rb_thread_current() != chdir_thread) - rb_warn("conflicting chdir during another chdir block"); - } - - if (rb_block_given_p()) { - struct chdir_data args; - char *cwd = my_getcwd(); - - args.old_path = rb_tainted_str_new2(cwd); free(cwd); - args.new_path = path; - args.done = Qfalse; - return rb_ensure(chdir_yield, (VALUE)&args, chdir_restore, (VALUE)&args); - } - dir_chdir(path); - - return INT2FIX(0); -} - -/* - * call-seq: - * Dir.getwd => string - * Dir.pwd => string - * - * Returns the path to the current working directory of this process as - * a string. - * - * Dir.chdir("/tmp") #=> 0 - * Dir.getwd #=> "/tmp" - */ -static VALUE -dir_s_getwd(dir) - VALUE dir; -{ - char *path; - VALUE cwd; - - rb_secure(4); - path = my_getcwd(); - cwd = rb_tainted_str_new2(path); - - free(path); - return cwd; -} - -static void check_dirname _((volatile VALUE *)); -static void -check_dirname(dir) - volatile VALUE *dir; -{ - char *path, *pend; - - SafeStringValue(*dir); - rb_secure(2); - path = RSTRING(*dir)->ptr; - if (path && *(pend = rb_path_end(rb_path_skip_prefix(path)))) { - *dir = rb_str_new(path, pend - path); - } -} - -/* - * call-seq: - * Dir.chroot( string ) => 0 - * - * Changes this process's idea of the file system root. Only a - * privileged process may make this call. Not available on all - * platforms. On Unix systems, see chroot(2) for more - * information. - */ -static VALUE -dir_s_chroot(dir, path) - VALUE dir, path; -{ -#if defined(HAVE_CHROOT) && !defined(__CHECKER__) - check_dirname(&path); - - if (chroot(RSTRING(path)->ptr) == -1) - rb_sys_fail(RSTRING(path)->ptr); - - return INT2FIX(0); -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif -} - -/* - * call-seq: - * Dir.mkdir( string [, integer] ) => 0 - * - * Makes a new directory named by string, with permissions - * specified by the optional parameter anInteger. The - * permissions may be modified by the value of - * File::umask, and are ignored on NT. Raises a - * SystemCallError if the directory cannot be created. See - * also the discussion of permissions in the class documentation for - * File. - * - */ -static VALUE -dir_s_mkdir(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - VALUE path, vmode; - int mode; - - if (rb_scan_args(argc, argv, "11", &path, &vmode) == 2) { - mode = NUM2INT(vmode); - } - else { - mode = 0777; - } - - check_dirname(&path); - if (mkdir(RSTRING(path)->ptr, mode) == -1) - rb_sys_fail(RSTRING(path)->ptr); - - return INT2FIX(0); -} - -/* - * call-seq: - * Dir.delete( string ) => 0 - * Dir.rmdir( string ) => 0 - * Dir.unlink( string ) => 0 - * - * Deletes the named directory. Raises a subclass of - * SystemCallError if the directory isn't empty. - */ -static VALUE -dir_s_rmdir(obj, dir) - VALUE obj, dir; -{ - check_dirname(&dir); - if (rmdir(RSTRING(dir)->ptr) < 0) - rb_sys_fail(RSTRING(dir)->ptr); - - return INT2FIX(0); -} - -static void -sys_warning_1(mesg) - const char* mesg; -{ - rb_sys_warning("%s", mesg); -} - -#define GLOB_VERBOSE (1UL << (sizeof(int) * CHAR_BIT - 1)) -#define sys_warning(val) \ - (void)((flags & GLOB_VERBOSE) && rb_protect((VALUE (*)_((VALUE)))sys_warning_1, (VALUE)(val), 0)) - -#define GLOB_ALLOC(type) (type *)malloc(sizeof(type)) -#define GLOB_ALLOC_N(type, n) (type *)malloc(sizeof(type) * (n)) -#define GLOB_JUMP_TAG(status) ((status == -1) ? rb_memerror() : rb_jump_tag(status)) - -/* - * ENOTDIR can be returned by stat(2) if a non-leaf element of the path - * is not a directory. - */ -#define to_be_ignored(e) ((e) == ENOENT || (e) == ENOTDIR) - -/* System call with warning */ -static int -do_stat(const char *path, struct stat *pst, int flags) - -{ - int ret = stat(path, pst); - if (ret < 0 && !to_be_ignored(errno)) - sys_warning(path); - - return ret; -} - -static int -do_lstat(const char *path, struct stat *pst, int flags) -{ - int ret = lstat(path, pst); - if (ret < 0 && !to_be_ignored(errno)) - sys_warning(path); - - return ret; -} - -static DIR * -do_opendir(const char *path, int flags) -{ - DIR *dirp = opendir(path); - if (dirp == NULL && !to_be_ignored(errno)) - sys_warning(path); - - return dirp; -} - -/* Return nonzero if S has any special globbing chars in it. */ -static int -has_magic(s, flags) - const char *s; - int flags; -{ - const int escape = !(flags & FNM_NOESCAPE); - const int nocase = flags & FNM_CASEFOLD; - - register const char *p = s; - register char c; - - while (c = *p++) { - switch (c) { - case '*': - case '?': - case '[': - return 1; - - case '\\': - if (escape && !(c = *p++)) - return 0; - continue; - - default: - if (!FNM_SYSCASE && ISALPHA(c) && nocase) - return 1; - } - - p = Next(p-1); - } - - return 0; -} - -/* Find separator in globbing pattern. */ -static char * -find_dirsep(const char *s, int flags) -{ - const int escape = !(flags & FNM_NOESCAPE); - - register const char *p = s; - register char c; - int open = 0; - - while (c = *p++) { - switch (c) { - case '[': - open = 1; - continue; - case ']': - open = 0; - continue; - - case '/': - if (!open) - return (char *)p-1; - continue; - - case '\\': - if (escape && !(c = *p++)) - return (char *)p-1; - continue; - } - - p = Next(p-1); - } - - return (char *)p-1; -} - -/* Remove escaping backslashes */ -static void -remove_backslashes(p) - char *p; -{ - char *t = p; - char *s = p; - - while (*p) { - if (*p == '\\') { - if (t != s) - memmove(t, s, p - s); - t += p - s; - s = ++p; - if (!*p) break; - } - Inc(p); - } - - while (*p++); - - if (t != s) - memmove(t, s, p - s); /* move '\0' too */ -} - -/* Globing pattern */ -enum glob_pattern_type { PLAIN, MAGICAL, RECURSIVE, MATCH_ALL, MATCH_DIR }; - -struct glob_pattern { - char *str; - enum glob_pattern_type type; - struct glob_pattern *next; -}; - -static void glob_free_pattern(struct glob_pattern *list); - -static struct glob_pattern * -glob_make_pattern(const char *p, int flags) -{ - struct glob_pattern *list, *tmp, **tail = &list; - int dirsep = 0; /* pattern is terminated with '/' */ - - while (*p) { - tmp = GLOB_ALLOC(struct glob_pattern); - if (!tmp) goto error; - if (p[0] == '*' && p[1] == '*' && p[2] == '/') { - /* fold continuous RECURSIVEs (needed in glob_helper) */ - do { p += 3; } while (p[0] == '*' && p[1] == '*' && p[2] == '/'); - tmp->type = RECURSIVE; - tmp->str = 0; - dirsep = 1; - } - else { - const char *m = find_dirsep(p, flags); - char *buf = GLOB_ALLOC_N(char, m-p+1); - if (!buf) { - free(tmp); - goto error; - } - memcpy(buf, p, m-p); - buf[m-p] = '\0'; - tmp->type = has_magic(buf, flags) ? MAGICAL : PLAIN; - tmp->str = buf; - if (*m) { - dirsep = 1; - p = m + 1; - } - else { - dirsep = 0; - p = m; - } - } - *tail = tmp; - tail = &tmp->next; - } - - tmp = GLOB_ALLOC(struct glob_pattern); - if (!tmp) { - error: - *tail = 0; - glob_free_pattern(list); - return 0; - } - tmp->type = dirsep ? MATCH_DIR : MATCH_ALL; - tmp->str = 0; - *tail = tmp; - tmp->next = 0; - - return list; -} - -static void -glob_free_pattern(struct glob_pattern *list) -{ - while (list) { - struct glob_pattern *tmp = list; - list = list->next; - if (tmp->str) - free(tmp->str); - free(tmp); - } -} - -static char * -join_path(const char *path, int dirsep, const char *name) -{ - long len = strlen(path); - char *buf = GLOB_ALLOC_N(char, len+strlen(name)+(dirsep?1:0)+1); - - if (!buf) return 0; - memcpy(buf, path, len); - if (dirsep) { - strcpy(buf+len, "/"); - len++; - } - strcpy(buf+len, name); - return buf; -} - -enum answer { YES, NO, UNKNOWN }; - -#ifndef S_ISLNK -# ifndef S_IFLNK -# define S_ISLNK(m) (0) -# else -# define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK) -# endif -#endif - -#ifndef S_ISDIR -# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR) -#endif - -struct glob_args { - void (*func) _((const char*, VALUE)); - const char *c; - VALUE v; -}; - -static VALUE glob_func_caller _((VALUE)); - -static VALUE -glob_func_caller(val) - VALUE val; -{ - struct glob_args *args = (struct glob_args *)val; - - (*args->func)(args->c, args->v); - return Qnil; -} - -#define glob_call_func(func, path, arg) (*func)(path, arg) - -static int glob_helper _((const char *, int, enum answer, enum answer, struct glob_pattern **, struct glob_pattern **, int, ruby_glob_func *, VALUE)); - -static int -glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg) - const char *path; - int dirsep; /* '/' should be placed before appending child entry's name to 'path'. */ - enum answer exist; /* Does 'path' indicate an existing entry? */ - enum answer isdir; /* Does 'path' indicate a directory or a symlink to a directory? */ - struct glob_pattern **beg; - struct glob_pattern **end; - int flags; - ruby_glob_func *func; - VALUE arg; -{ - struct stat st; - int status = 0; - struct glob_pattern **cur, **new_beg, **new_end; - int plain = 0, magical = 0, recursive = 0, match_all = 0, match_dir = 0; - int escape = !(flags & FNM_NOESCAPE); - - for (cur = beg; cur < end; ++cur) { - struct glob_pattern *p = *cur; - if (p->type == RECURSIVE) { - recursive = 1; - p = p->next; - } - switch (p->type) { - case PLAIN: - plain = 1; - break; - case MAGICAL: - magical = 1; - break; - case MATCH_ALL: - match_all = 1; - break; - case MATCH_DIR: - match_dir = 1; - break; - case RECURSIVE: - rb_bug("continuous RECURSIVEs"); - } - } - - if (*path) { - if (match_all && exist == UNKNOWN) { - if (do_lstat(path, &st, flags) == 0) { - exist = YES; - isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO; - } - else { - exist = NO; - isdir = NO; - } - } - if (match_dir && isdir == UNKNOWN) { - if (do_stat(path, &st, flags) == 0) { - exist = YES; - isdir = S_ISDIR(st.st_mode) ? YES : NO; - } - else { - exist = NO; - isdir = NO; - } - } - if (match_all && exist == YES) { - status = glob_call_func(func, path, arg); - if (status) return status; - } - if (match_dir && isdir == YES) { - char *tmp = join_path(path, dirsep, ""); - if (!tmp) return -1; - status = glob_call_func(func, tmp, arg); - free(tmp); - if (status) return status; - } - } - - if (exist == NO || isdir == NO) return 0; - - if (magical || recursive) { - struct dirent *dp; - DIR *dirp = do_opendir(*path ? path : ".", flags); - if (dirp == NULL) return 0; - - for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) { - char *buf = join_path(path, dirsep, dp->d_name); - enum answer new_isdir = UNKNOWN; - - if (!buf) { - status = -1; - break; - } - if (recursive && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0 - && fnmatch("*", dp->d_name, flags) == 0) { -#ifndef _WIN32 - if (do_lstat(buf, &st, flags) == 0) - new_isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO; - else - new_isdir = NO; -#else - new_isdir = dp->d_isdir ? (!dp->d_isrep ? YES : UNKNOWN) : NO; -#endif - } - - new_beg = new_end = GLOB_ALLOC_N(struct glob_pattern *, (end - beg) * 2); - if (!new_beg) { - status = -1; - break; - } - - for (cur = beg; cur < end; ++cur) { - struct glob_pattern *p = *cur; - if (p->type == RECURSIVE) { - if (new_isdir == YES) /* not symlink but real directory */ - *new_end++ = p; /* append recursive pattern */ - p = p->next; /* 0 times recursion */ - } - if (p->type == PLAIN || p->type == MAGICAL) { - if (fnmatch(p->str, dp->d_name, flags) == 0) - *new_end++ = p->next; - } - } - - status = glob_helper(buf, 1, YES, new_isdir, new_beg, new_end, flags, func, arg); - free(buf); - free(new_beg); - if (status) break; - } - - closedir(dirp); - } - else if (plain) { - struct glob_pattern **copy_beg, **copy_end, **cur2; - - copy_beg = copy_end = GLOB_ALLOC_N(struct glob_pattern *, end - beg); - if (!copy_beg) return -1; - for (cur = beg; cur < end; ++cur) - *copy_end++ = (*cur)->type == PLAIN ? *cur : 0; - - for (cur = copy_beg; cur < copy_end; ++cur) { - if (*cur) { - char *buf; - char *name; - name = GLOB_ALLOC_N(char, strlen((*cur)->str) + 1); - if (!name) { - status = -1; - break; - } - strcpy(name, (*cur)->str); - if (escape) remove_backslashes(name); - - new_beg = new_end = GLOB_ALLOC_N(struct glob_pattern *, end - beg); - if (!new_beg) { - free(name); - status = -1; - break; - } - *new_end++ = (*cur)->next; - for (cur2 = cur + 1; cur2 < copy_end; ++cur2) { - if (*cur2 && fnmatch((*cur2)->str, name, flags) == 0) { - *new_end++ = (*cur2)->next; - *cur2 = 0; - } - } - - buf = join_path(path, dirsep, name); - free(name); - if (!buf) { - free(new_beg); - status = -1; - break; - } - status = glob_helper(buf, 1, UNKNOWN, UNKNOWN, new_beg, new_end, flags, func, arg); - free(buf); - free(new_beg); - if (status) break; - } - } - - free(copy_beg); - } - - return status; -} - -static int -ruby_glob0(path, flags, func, arg) - const char *path; - int flags; - ruby_glob_func *func; - VALUE arg; -{ - struct glob_pattern *list; - const char *root, *start; - char *buf; - int n; - int status; - - start = root = path; - flags |= FNM_SYSCASE; -#if defined DOSISH - root = rb_path_skip_prefix(root); -#endif - - if (root && *root == '/') root++; - - n = root - start; - buf = GLOB_ALLOC_N(char, n + 1); - if (!buf) return -1; - MEMCPY(buf, start, char, n); - buf[n] = '\0'; - - list = glob_make_pattern(root, flags); - if (!list) { - free(buf); - return -1; - } - status = glob_helper(buf, 0, UNKNOWN, UNKNOWN, &list, &list + 1, flags, func, arg); - glob_free_pattern(list); - free(buf); - - return status; -} - -int -ruby_glob(path, flags, func, arg) - const char *path; - int flags; - ruby_glob_func *func; - VALUE arg; -{ - return ruby_glob0(path, flags & ~GLOB_VERBOSE, func, arg); -} - -static int rb_glob_caller _((const char *, VALUE)); - -static int -rb_glob_caller(path, a) - const char *path; - VALUE a; -{ - int status; - struct glob_args *args = (struct glob_args *)a; - - args->c = path; - rb_protect(glob_func_caller, a, &status); - return status; -} - -static int -rb_glob2(path, flags, func, arg) - const char *path; - int flags; - void (*func) _((const char *, VALUE)); - VALUE arg; -{ - struct glob_args args; - - args.func = func; - args.v = arg; - - if (flags & FNM_SYSCASE) { - rb_warning("Dir.glob() ignores File::FNM_CASEFOLD"); - } - - return ruby_glob0(path, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args); -} - -void -rb_glob(path, func, arg) - const char *path; - void (*func) _((const char*, VALUE)); - VALUE arg; -{ - int status = rb_glob2(path, 0, func, arg); - if (status) GLOB_JUMP_TAG(status); -} - -static void push_pattern _((const char* path, VALUE ary)); -static void -push_pattern(path, ary) - const char *path; - VALUE ary; -{ - rb_ary_push(ary, rb_tainted_str_new2(path)); -} - -int -ruby_brace_expand(str, flags, func, arg) - const char *str; - int flags; - ruby_glob_func *func; - VALUE arg; -{ - const int escape = !(flags & FNM_NOESCAPE); - const char *p = str; - const char *s = p; - const char *lbrace = 0, *rbrace = 0; - int nest = 0, status = 0; - - while (*p) { - if (*p == '{' && nest++ == 0) { - lbrace = p; - } - if (*p == '}' && --nest <= 0) { - rbrace = p; - break; - } - if (*p == '\\' && escape) { - if (!*++p) break; - } - Inc(p); - } - - if (lbrace && rbrace) { - char *buf = GLOB_ALLOC_N(char, strlen(s) + 1); - long shift; - - if (!buf) return -1; - memcpy(buf, s, lbrace-s); - shift = (lbrace-s); - p = lbrace; - while (p < rbrace) { - const char *t = ++p; - nest = 0; - while (p < rbrace && !(*p == ',' && nest == 0)) { - if (*p == '{') nest++; - if (*p == '}') nest--; - if (*p == '\\' && escape) { - if (++p == rbrace) break; - } - Inc(p); - } - memcpy(buf+shift, t, p-t); - strcpy(buf+shift+(p-t), rbrace+1); - status = ruby_brace_expand(buf, flags, func, arg); - if (status) break; - } - free(buf); - } - else if (!lbrace && !rbrace) { - status = (*func)(s, arg); - } - - return status; -} - -struct brace_args { - ruby_glob_func *func; - VALUE value; - int flags; -}; - -static int glob_brace _((const char *, VALUE)); -static int -glob_brace(path, val) - const char *path; - VALUE val; -{ - struct brace_args *arg = (struct brace_args *)val; - - return ruby_glob0(path, arg->flags, arg->func, arg->value); -} - -static int -ruby_brace_glob0(str, flags, func, arg) - const char *str; - int flags; - ruby_glob_func *func; - VALUE arg; -{ - struct brace_args args; - - args.func = func; - args.value = arg; - args.flags = flags; - return ruby_brace_expand(str, flags, glob_brace, (VALUE)&args); -} - -int -ruby_brace_glob(str, flags, func, arg) - const char *str; - int flags; - ruby_glob_func *func; - VALUE arg; -{ - return ruby_brace_glob0(str, flags & ~GLOB_VERBOSE, func, arg); -} - -static int -push_glob(VALUE ary, const char *str, int flags) -{ - struct glob_args args; - - args.func = push_pattern; - args.v = ary; - return ruby_brace_glob0(str, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args); -} - -static VALUE -rb_push_glob(str, flags) /* '\0' is delimiter */ - VALUE str; - int flags; -{ - long offset = 0; - VALUE ary; - - ary = rb_ary_new(); - SafeStringValue(str); - - while (offset < RSTRING_LEN(str)) { - int status = push_glob(ary, RSTRING(str)->ptr + offset, flags); - char *p, *pend; - if (status) GLOB_JUMP_TAG(status); - if (offset >= RSTRING_LEN(str)) break; - p = RSTRING(str)->ptr + offset; - p += strlen(p) + 1; - pend = RSTRING(str)->ptr + RSTRING_LEN(str); - while (p < pend && !*p) - p++; - offset = p - RSTRING(str)->ptr; - } - - return ary; -} - -static VALUE -dir_globs(argc, argv, flags) - long argc; - VALUE *argv; - int flags; -{ - VALUE ary = rb_ary_new(); - long i; - - for (i = 0; i < argc; ++i) { - int status; - VALUE str = argv[i]; - SafeStringValue(str); - status = push_glob(ary, RSTRING(str)->ptr, flags); - if (status) GLOB_JUMP_TAG(status); - } - - return ary; -} - -/* - * call-seq: - * Dir[ array ] => array - * Dir[ string [, string ...] ] => array - * - * Equivalent to calling - * Dir.glob(array,0) and - * Dir.glob([string,...],0). - * - */ -static VALUE -dir_s_aref(int argc, VALUE *argv, VALUE obj) - { - if (argc == 1) { - return rb_push_glob(argv[0], 0); - } - return dir_globs(argc, argv, 0); - } - -/* - * call-seq: - * Dir.glob( pattern, [flags] ) => array - * Dir.glob( pattern, [flags] ) {| filename | block } => nil - * - * Returns the filenames found by expanding pattern which is - * an +Array+ of the patterns or the pattern +String+, either as an - * array or as parameters to the block. Note that this pattern - * is not a regexp (it's closer to a shell glob). See - * File::fnmatch for the meaning of the flags - * parameter. Note that case sensitivity depends on your system (so - * File::FNM_CASEFOLD is ignored) - * - * *:: Matches any file. Can be restricted by - * other values in the glob. * - * will match all files; c* will - * match all files beginning with - * c; *c will match - * all files ending with c; and - * *c* will match all files that - * have c in them (including at - * the beginning or end). Equivalent to - * / .* /x in regexp. - * **:: Matches directories recursively. - * ?:: Matches any one character. Equivalent to - * /.{1}/ in regexp. - * [set]:: Matches any one character in +set+. - * Behaves exactly like character sets in - * Regexp, including set negation - * ([^a-z]). - * {p,q}:: Matches either literal p or - * literal q. Matching literals - * may be more than one character in length. - * More than two literals may be specified. - * Equivalent to pattern alternation in - * regexp. - * \:: Escapes the next metacharacter. - * - * Dir["config.?"] #=> ["config.h"] - * Dir.glob("config.?") #=> ["config.h"] - * Dir.glob("*.[a-z][a-z]") #=> ["main.rb"] - * Dir.glob("*.[^r]*") #=> ["config.h"] - * Dir.glob("*.{rb,h}") #=> ["main.rb", "config.h"] - * Dir.glob("*") #=> ["config.h", "main.rb"] - * Dir.glob("*", File::FNM_DOTMATCH) #=> [".", "..", "config.h", "main.rb"] - * - * rbfiles = File.join("**", "*.rb") - * Dir.glob(rbfiles) #=> ["main.rb", - * "lib/song.rb", - * "lib/song/karaoke.rb"] - * libdirs = File.join("**", "lib") - * Dir.glob(libdirs) #=> ["lib"] - * - * librbfiles = File.join("**", "lib", "**", "*.rb") - * Dir.glob(librbfiles) #=> ["lib/song.rb", - * "lib/song/karaoke.rb"] - * - * librbfiles = File.join("**", "lib", "*.rb") - * Dir.glob(librbfiles) #=> ["lib/song.rb"] - */ -static VALUE -dir_s_glob(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - VALUE str, rflags, ary; - int flags; - - if (rb_scan_args(argc, argv, "11", &str, &rflags) == 2) - flags = NUM2INT(rflags); - else - flags = 0; - - ary = rb_check_array_type(str); - if (NIL_P(ary)) { - ary = rb_push_glob(str, flags); - } - else { - volatile VALUE v = ary; - ary = dir_globs(RARRAY_LEN(v), RARRAY_PTR(v), flags); - } - - if (rb_block_given_p()) { - rb_ary_each(ary); - return Qnil; - } - return ary; -} - -static VALUE -dir_open_dir(path) - VALUE path; -{ - VALUE dir = rb_funcall(rb_cDir, rb_intern("open"), 1, path); - - if (TYPE(dir) != T_DATA || - RDATA(dir)->dfree != (RUBY_DATA_FUNC)free_dir) { - rb_raise(rb_eTypeError, "wrong argument type %s (expected Dir)", - rb_obj_classname(dir)); - } - return dir; -} - - -/* - * call-seq: - * Dir.foreach( dirname ) {| filename | block } => nil - * - * Calls the block once for each entry in the named directory, passing - * the filename of each entry as a parameter to the block. - * - * Dir.foreach("testdir") {|x| puts "Got #{x}" } - * - * produces: - * - * Got . - * Got .. - * Got config.h - * Got main.rb - * - */ -static VALUE -dir_foreach(io, dirname) - VALUE io, dirname; -{ - VALUE dir; - - dir = dir_open_dir(dirname); - rb_ensure(dir_each, dir, dir_close, dir); - return Qnil; -} - -/* - * call-seq: - * Dir.entries( dirname ) => array - * - * Returns an array containing all of the filenames in the given - * directory. Will raise a SystemCallError if the named - * directory doesn't exist. - * - * Dir.entries("testdir") #=> [".", "..", "config.h", "main.rb"] - * - */ -static VALUE -dir_entries(io, dirname) - VALUE io, dirname; -{ - VALUE dir; - - dir = dir_open_dir(dirname); - return rb_ensure(rb_Array, dir, dir_close, dir); -} - -/* - * call-seq: - * File.fnmatch( pattern, path, [flags] ) => (true or false) - * File.fnmatch?( pattern, path, [flags] ) => (true or false) - * - * Returns true if path matches against pattern The - * pattern is not a regular expression; instead it follows rules - * similar to shell filename globbing. It may contain the following - * metacharacters: - * - * *:: Matches any file. Can be restricted by - * other values in the glob. * - * will match all files; c* will - * match all files beginning with - * c; *c will match - * all files ending with c; and - * *c* will match all files that - * have c in them (including at - * the beginning or end). Equivalent to - * / .* /x in regexp. - * **:: Matches directories recursively or files - * expansively. - * ?:: Matches any one character. Equivalent to - * /.{1}/ in regexp. - * [set]:: Matches any one character in +set+. - * Behaves exactly like character sets in - * Regexp, including set negation - * ([^a-z]). - * \:: Escapes the next metacharacter. - * - * flags is a bitwise OR of the FNM_xxx - * parameters. The same glob pattern and flags are used by - * Dir::glob. - * - * File.fnmatch('cat', 'cat') #=> true : match entire string - * File.fnmatch('cat', 'category') #=> false : only match partial string - * File.fnmatch('c{at,ub}s', 'cats') #=> false : { } isn't supported - * - * File.fnmatch('c?t', 'cat') #=> true : '?' match only 1 character - * File.fnmatch('c??t', 'cat') #=> false : ditto - * File.fnmatch('c*', 'cats') #=> true : '*' match 0 or more characters - * File.fnmatch('c*t', 'c/a/b/t') #=> true : ditto - * File.fnmatch('ca[a-z]', 'cat') #=> true : inclusive bracket expression - * File.fnmatch('ca[^t]', 'cat') #=> false : exclusive bracket expression ('^' or '!') - * - * File.fnmatch('cat', 'CAT') #=> false : case sensitive - * File.fnmatch('cat', 'CAT', File::FNM_CASEFOLD) #=> true : case insensitive - * - * File.fnmatch('?', '/', File::FNM_PATHNAME) #=> false : wildcard doesn't match '/' on FNM_PATHNAME - * File.fnmatch('*', '/', File::FNM_PATHNAME) #=> false : ditto - * File.fnmatch('[/]', '/', File::FNM_PATHNAME) #=> false : ditto - * - * File.fnmatch('\?', '?') #=> true : escaped wildcard becomes ordinary - * File.fnmatch('\a', 'a') #=> true : escaped ordinary remains ordinary - * File.fnmatch('\a', '\a', File::FNM_NOESCAPE) #=> true : FNM_NOESACPE makes '\' ordinary - * File.fnmatch('[\?]', '?') #=> true : can escape inside bracket expression - * - * File.fnmatch('*', '.profile') #=> false : wildcard doesn't match leading - * File.fnmatch('*', '.profile', File::FNM_DOTMATCH) #=> true period by default. - * File.fnmatch('.*', '.profile') #=> true - * - * rbfiles = '**' '/' '*.rb' # you don't have to do like this. just write in single string. - * File.fnmatch(rbfiles, 'main.rb') #=> false - * File.fnmatch(rbfiles, './main.rb') #=> false - * File.fnmatch(rbfiles, 'lib/song.rb') #=> true - * File.fnmatch('**.rb', 'main.rb') #=> true - * File.fnmatch('**.rb', './main.rb') #=> false - * File.fnmatch('**.rb', 'lib/song.rb') #=> true - * File.fnmatch('*', 'dave/.profile') #=> true - * - * pattern = '*' '/' '*' - * File.fnmatch(pattern, 'dave/.profile', File::FNM_PATHNAME) #=> false - * File.fnmatch(pattern, 'dave/.profile', File::FNM_PATHNAME | File::FNM_DOTMATCH) #=> true - * - * pattern = '**' '/' 'foo' - * File.fnmatch(pattern, 'a/b/c/foo', File::FNM_PATHNAME) #=> true - * File.fnmatch(pattern, '/a/b/c/foo', File::FNM_PATHNAME) #=> true - * File.fnmatch(pattern, 'c:/a/b/c/foo', File::FNM_PATHNAME) #=> true - * File.fnmatch(pattern, 'a/.b/c/foo', File::FNM_PATHNAME) #=> false - * File.fnmatch(pattern, 'a/.b/c/foo', File::FNM_PATHNAME | File::FNM_DOTMATCH) #=> true - */ -static VALUE -file_s_fnmatch(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - VALUE pattern, path; - VALUE rflags; - int flags; - - if (rb_scan_args(argc, argv, "21", &pattern, &path, &rflags) == 3) - flags = NUM2INT(rflags); - else - flags = 0; - - StringValue(pattern); - StringValue(path); - - if (fnmatch(RSTRING(pattern)->ptr, RSTRING(path)->ptr, flags) == 0) - return Qtrue; - - return Qfalse; -} - -/* - * Objects of class Dir are directory streams representing - * directories in the underlying file system. They provide a variety of - * ways to list directories and their contents. See also - * File. - * - * The directory used in these examples contains the two regular files - * (config.h and main.rb), the parent - * directory (..), and the directory itself - * (.). - */ -void -Init_Dir() -{ - rb_cDir = rb_define_class("Dir", rb_cObject); - - rb_include_module(rb_cDir, rb_mEnumerable); - - rb_define_alloc_func(rb_cDir, dir_s_alloc); - rb_define_singleton_method(rb_cDir, "open", dir_s_open, 1); - rb_define_singleton_method(rb_cDir, "foreach", dir_foreach, 1); - rb_define_singleton_method(rb_cDir, "entries", dir_entries, 1); - - rb_define_method(rb_cDir,"initialize", dir_initialize, 1); - rb_define_method(rb_cDir,"path", dir_path, 0); - rb_define_method(rb_cDir,"read", dir_read, 0); - rb_define_method(rb_cDir,"each", dir_each, 0); - rb_define_method(rb_cDir,"rewind", dir_rewind, 0); - rb_define_method(rb_cDir,"tell", dir_tell, 0); - rb_define_method(rb_cDir,"seek", dir_seek, 1); - rb_define_method(rb_cDir,"pos", dir_tell, 0); - rb_define_method(rb_cDir,"pos=", dir_set_pos, 1); - rb_define_method(rb_cDir,"close", dir_close, 0); - - rb_define_singleton_method(rb_cDir,"chdir", dir_s_chdir, -1); - rb_define_singleton_method(rb_cDir,"getwd", dir_s_getwd, 0); - rb_define_singleton_method(rb_cDir,"pwd", dir_s_getwd, 0); - rb_define_singleton_method(rb_cDir,"chroot", dir_s_chroot, 1); - rb_define_singleton_method(rb_cDir,"mkdir", dir_s_mkdir, -1); - rb_define_singleton_method(rb_cDir,"rmdir", dir_s_rmdir, 1); - rb_define_singleton_method(rb_cDir,"delete", dir_s_rmdir, 1); - rb_define_singleton_method(rb_cDir,"unlink", dir_s_rmdir, 1); - - rb_define_singleton_method(rb_cDir,"glob", dir_s_glob, -1); - rb_define_singleton_method(rb_cDir,"[]", dir_s_aref, -1); - - rb_define_singleton_method(rb_cFile,"fnmatch", file_s_fnmatch, -1); - rb_define_singleton_method(rb_cFile,"fnmatch?", file_s_fnmatch, -1); - - rb_file_const("FNM_NOESCAPE", INT2FIX(FNM_NOESCAPE)); - rb_file_const("FNM_PATHNAME", INT2FIX(FNM_PATHNAME)); - rb_file_const("FNM_DOTMATCH", INT2FIX(FNM_DOTMATCH)); - rb_file_const("FNM_CASEFOLD", INT2FIX(FNM_CASEFOLD)); - rb_file_const("FNM_SYSCASE", INT2FIX(FNM_SYSCASE)); -} -/********************************************************************** - - dln.c - - - $Author: shyouhei $ - $Date: 2008-06-15 15:25:08 +0200 (Sun, 15 Jun 2008) $ - created at: Tue Jan 18 17:05:06 JST 1994 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include "dln.h" - -#ifdef HAVE_STDLIB_H -# include -#endif - -#ifdef __CHECKER__ -#undef HAVE_DLOPEN -#undef USE_DLN_A_OUT -#undef USE_DLN_DLOPEN -#endif - -#ifdef USE_DLN_A_OUT -char *dln_argv0; -#endif - -#if defined(HAVE_ALLOCA_H) -#include -#endif - -#ifdef HAVE_STRING_H -# include -#else -# include -#endif - -#ifndef xmalloc -void *xmalloc(); -void *xcalloc(); -void *xrealloc(); -#endif - -#include -#if defined(_WIN32) || defined(__VMS) -#include "missing/file.h" -#endif -#include -#include - -#ifndef S_ISDIR -# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR) -#endif - -#ifdef HAVE_SYS_PARAM_H -# include -#endif -#ifndef MAXPATHLEN -# define MAXPATHLEN 1024 -#endif - -#ifdef HAVE_UNISTD_H -# include -#endif - -#ifndef _WIN32 -char *getenv(); -#endif - -#if defined(__VMS) -#pragma builtins -#include -#endif - -#ifdef __MACOS__ -# include -# include -# include -# include "macruby_private.h" -#endif - -#ifdef __BEOS__ -# include -#endif - -#ifndef NO_DLN_LOAD - -#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(__APPLE__) && !defined(_UNICOSMP) -/* dynamic load with dlopen() */ -# define USE_DLN_DLOPEN -#endif - -#ifndef FUNCNAME_PATTERN -# if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && !defined(__ELF__)) || (defined(__OpenBSD__) && !defined(__ELF__)) || defined(NeXT) || defined(__WATCOMC__) || defined(__APPLE__) -# define FUNCNAME_PATTERN "_Init_%s" -# else -# define FUNCNAME_PATTERN "Init_%s" -# endif -#endif - -static int -init_funcname_len(buf, file) - char **buf; - const char *file; -{ - char *p; - const char *slash; - int len; - - /* Load the file as an object one */ - for (slash = file-1; *file; file++) /* Find position of last '/' */ -#ifdef __MACOS__ - if (*file == ':') slash = file; -#else - if (*file == '/') slash = file; -#endif - - len = strlen(FUNCNAME_PATTERN) + strlen(slash + 1); - *buf = xmalloc(len); - snprintf(*buf, len, FUNCNAME_PATTERN, slash + 1); - for (p = *buf; *p; p++) { /* Delete suffix if it exists */ - if (*p == '.') { - *p = '\0'; break; - } - } - return p - *buf; -} - -#define init_funcname(buf, file) do {\ - int len = init_funcname_len(buf, file);\ - char *tmp = ALLOCA_N(char, len+1);\ - if (!tmp) {\ - free(*buf);\ - rb_memerror();\ - }\ - strcpy(tmp, *buf);\ - free(*buf);\ - *buf = tmp;\ -} while (0) - -#ifdef USE_DLN_A_OUT - -#ifndef LIBC_NAME -# define LIBC_NAME "libc.a" -#endif - -#ifndef DLN_DEFAULT_LIB_PATH -# define DLN_DEFAULT_LIB_PATH "/lib:/usr/lib:/usr/local/lib:." -#endif - -#include - -static int dln_errno; - -#define DLN_ENOEXEC ENOEXEC /* Exec format error */ -#define DLN_ECONFL 1201 /* Symbol name conflict */ -#define DLN_ENOINIT 1202 /* No initializer given */ -#define DLN_EUNDEF 1203 /* Undefine symbol remains */ -#define DLN_ENOTLIB 1204 /* Not a library file */ -#define DLN_EBADLIB 1205 /* Malformed library file */ -#define DLN_EINIT 1206 /* Not initialized */ - -static int dln_init_p = 0; - -#include -#include -#ifndef N_COMM -# define N_COMM 0x12 -#endif -#ifndef N_MAGIC -# define N_MAGIC(x) (x).a_magic -#endif - -#define INVALID_OBJECT(h) (N_MAGIC(h) != OMAGIC) - -#include "util.h" -#include "st.h" - -static st_table *sym_tbl; -static st_table *undef_tbl; - -static int load_lib(); - -static int -load_header(fd, hdrp, disp) - int fd; - struct exec *hdrp; - long disp; -{ - int size; - - lseek(fd, disp, 0); - size = read(fd, hdrp, sizeof(struct exec)); - if (size == -1) { - dln_errno = errno; - return -1; - } - if (size != sizeof(struct exec) || N_BADMAG(*hdrp)) { - dln_errno = DLN_ENOEXEC; - return -1; - } - return 0; -} - -#if defined(sequent) -#define RELOC_SYMBOL(r) ((r)->r_symbolnum) -#define RELOC_MEMORY_SUB_P(r) ((r)->r_bsr) -#define RELOC_PCREL_P(r) ((r)->r_pcrel || (r)->r_bsr) -#define RELOC_TARGET_SIZE(r) ((r)->r_length) -#endif - -/* Default macros */ -#ifndef RELOC_ADDRESS -#define RELOC_ADDRESS(r) ((r)->r_address) -#define RELOC_EXTERN_P(r) ((r)->r_extern) -#define RELOC_SYMBOL(r) ((r)->r_symbolnum) -#define RELOC_MEMORY_SUB_P(r) 0 -#define RELOC_PCREL_P(r) ((r)->r_pcrel) -#define RELOC_TARGET_SIZE(r) ((r)->r_length) -#endif - -#if defined(sun) && defined(sparc) -/* Sparc (Sun 4) macros */ -# undef relocation_info -# define relocation_info reloc_info_sparc -# define R_RIGHTSHIFT(r) (reloc_r_rightshift[(r)->r_type]) -# define R_BITSIZE(r) (reloc_r_bitsize[(r)->r_type]) -# define R_LENGTH(r) (reloc_r_length[(r)->r_type]) -static int reloc_r_rightshift[] = { - 0, 0, 0, 0, 0, 0, 2, 2, 10, 0, 0, 0, 0, 0, 0, -}; -static int reloc_r_bitsize[] = { - 8, 16, 32, 8, 16, 32, 30, 22, 22, 22, 13, 10, 32, 32, 16, -}; -static int reloc_r_length[] = { - 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -}; -# define R_PCREL(r) \ - ((r)->r_type >= RELOC_DISP8 && (r)->r_type <= RELOC_WDISP22) -# define R_SYMBOL(r) ((r)->r_index) -#endif - -#if defined(sequent) -#define R_SYMBOL(r) ((r)->r_symbolnum) -#define R_MEMORY_SUB(r) ((r)->r_bsr) -#define R_PCREL(r) ((r)->r_pcrel || (r)->r_bsr) -#define R_LENGTH(r) ((r)->r_length) -#endif - -#ifndef R_SYMBOL -# define R_SYMBOL(r) ((r)->r_symbolnum) -# define R_MEMORY_SUB(r) 0 -# define R_PCREL(r) ((r)->r_pcrel) -# define R_LENGTH(r) ((r)->r_length) -#endif - -static struct relocation_info * -load_reloc(fd, hdrp, disp) - int fd; - struct exec *hdrp; - long disp; -{ - struct relocation_info *reloc; - int size; - - lseek(fd, disp + N_TXTOFF(*hdrp) + hdrp->a_text + hdrp->a_data, 0); - size = hdrp->a_trsize + hdrp->a_drsize; - reloc = (struct relocation_info*)xmalloc(size); - if (reloc == NULL) { - dln_errno = errno; - return NULL; - } - - if (read(fd, reloc, size) != size) { - dln_errno = errno; - free(reloc); - return NULL; - } - - return reloc; -} - -static struct nlist * -load_sym(fd, hdrp, disp) - int fd; - struct exec *hdrp; - long disp; -{ - struct nlist * buffer; - struct nlist * sym; - struct nlist * end; - long displ; - int size; - - lseek(fd, N_SYMOFF(*hdrp) + hdrp->a_syms + disp, 0); - if (read(fd, &size, sizeof(int)) != sizeof(int)) { - goto err_noexec; - } - - buffer = (struct nlist*)xmalloc(hdrp->a_syms + size); - if (buffer == NULL) { - dln_errno = errno; - return NULL; - } - - lseek(fd, disp + N_SYMOFF(*hdrp), 0); - if (read(fd, buffer, hdrp->a_syms + size) != hdrp->a_syms + size) { - free(buffer); - goto err_noexec; - } - - sym = buffer; - end = sym + hdrp->a_syms / sizeof(struct nlist); - displ = (long)buffer + (long)(hdrp->a_syms); - - while (sym < end) { - sym->n_un.n_name = (char*)sym->n_un.n_strx + displ; - sym++; - } - return buffer; - - err_noexec: - dln_errno = DLN_ENOEXEC; - return NULL; -} - -static st_table * -sym_hash(hdrp, syms) - struct exec *hdrp; - struct nlist *syms; -{ - st_table *tbl; - struct nlist *sym = syms; - struct nlist *end = syms + (hdrp->a_syms / sizeof(struct nlist)); - - tbl = st_init_strtable(); - if (tbl == NULL) { - dln_errno = errno; - return NULL; - } - - while (sym < end) { - st_insert(tbl, sym->n_un.n_name, sym); - sym++; - } - return tbl; -} - -static int -dln_init(prog) - const char *prog; -{ - char *file; - int fd; - struct exec hdr; - struct nlist *syms; - - if (dln_init_p == 1) return 0; - - file = dln_find_exe(prog, NULL); - if (file == NULL || (fd = open(file, O_RDONLY)) < 0) { - dln_errno = errno; - return -1; - } - - if (load_header(fd, &hdr, 0) == -1) return -1; - syms = load_sym(fd, &hdr, 0); - if (syms == NULL) { - close(fd); - return -1; - } - sym_tbl = sym_hash(&hdr, syms); - if (sym_tbl == NULL) { /* file may be start with #! */ - char c = '\0'; - char buf[MAXPATHLEN]; - char *p; - - free(syms); - lseek(fd, 0L, 0); - if (read(fd, &c, 1) == -1) { - dln_errno = errno; - return -1; - } - if (c != '#') goto err_noexec; - if (read(fd, &c, 1) == -1) { - dln_errno = errno; - return -1; - } - if (c != '!') goto err_noexec; - - p = buf; - /* skip forwarding spaces */ - while (read(fd, &c, 1) == 1) { - if (c == '\n') goto err_noexec; - if (c != '\t' && c != ' ') { - *p++ = c; - break; - } - } - /* read in command name */ - while (read(fd, p, 1) == 1) { - if (*p == '\n' || *p == '\t' || *p == ' ') break; - p++; - if (p-buf >= MAXPATHLEN) { - dln_errno = ENAMETOOLONG; - return -1; - } - } - *p = '\0'; - - return dln_init(buf); - } - dln_init_p = 1; - undef_tbl = st_init_strtable(); - close(fd); - return 0; - - err_noexec: - close(fd); - dln_errno = DLN_ENOEXEC; - return -1; -} - -static long -load_text_data(fd, hdrp, bss, disp) - int fd; - struct exec *hdrp; - int bss; - long disp; -{ - int size; - unsigned char* addr; - - lseek(fd, disp + N_TXTOFF(*hdrp), 0); - size = hdrp->a_text + hdrp->a_data; - - if (bss == -1) size += hdrp->a_bss; - else if (bss > 1) size += bss; - - addr = (unsigned char*)xmalloc(size); - if (addr == NULL) { - dln_errno = errno; - return 0; - } - - if (read(fd, addr, size) != size) { - dln_errno = errno; - free(addr); - return 0; - } - - if (bss == -1) { - memset(addr + hdrp->a_text + hdrp->a_data, 0, hdrp->a_bss); - } - else if (bss > 0) { - memset(addr + hdrp->a_text + hdrp->a_data, 0, bss); - } - - return (long)addr; -} - -static int -undef_print(key, value) - char *key, *value; -{ - fprintf(stderr, " %s\n", key); - return ST_CONTINUE; -} - -static void -dln_print_undef() -{ - fprintf(stderr, " Undefined symbols:\n"); - st_foreach(undef_tbl, undef_print, NULL); -} - -static void -dln_undefined() -{ - if (undef_tbl->num_entries > 0) { - fprintf(stderr, "dln: Calling undefined function\n"); - dln_print_undef(); - rb_exit(1); - } -} - -struct undef { - char *name; - struct relocation_info reloc; - long base; - char *addr; - union { - char c; - short s; - long l; - } u; -}; - -static st_table *reloc_tbl = NULL; -static void -link_undef(name, base, reloc) - const char *name; - long base; - struct relocation_info *reloc; -{ - static int u_no = 0; - struct undef *obj; - char *addr = (char*)(reloc->r_address + base); - - obj = (struct undef*)xmalloc(sizeof(struct undef)); - obj->name = strdup(name); - obj->reloc = *reloc; - obj->base = base; - switch (R_LENGTH(reloc)) { - case 0: /* byte */ - obj->u.c = *addr; - break; - case 1: /* word */ - obj->u.s = *(short*)addr; - break; - case 2: /* long */ - obj->u.l = *(long*)addr; - break; - } - if (reloc_tbl == NULL) { - reloc_tbl = st_init_numtable(); - } - st_insert(reloc_tbl, u_no++, obj); -} - -struct reloc_arg { - const char *name; - long value; -}; - -static int -reloc_undef(no, undef, arg) - int no; - struct undef *undef; - struct reloc_arg *arg; -{ - int datum; - char *address; -#if defined(sun) && defined(sparc) - unsigned int mask = 0; -#endif - - if (strcmp(arg->name, undef->name) != 0) return ST_CONTINUE; - address = (char*)(undef->base + undef->reloc.r_address); - datum = arg->value; - - if (R_PCREL(&(undef->reloc))) datum -= undef->base; -#if defined(sun) && defined(sparc) - datum += undef->reloc.r_addend; - datum >>= R_RIGHTSHIFT(&(undef->reloc)); - mask = (1 << R_BITSIZE(&(undef->reloc))) - 1; - mask |= mask -1; - datum &= mask; - switch (R_LENGTH(&(undef->reloc))) { - case 0: - *address = undef->u.c; - *address &= ~mask; - *address |= datum; - break; - case 1: - *(short *)address = undef->u.s; - *(short *)address &= ~mask; - *(short *)address |= datum; - break; - case 2: - *(long *)address = undef->u.l; - *(long *)address &= ~mask; - *(long *)address |= datum; - break; - } -#else - switch (R_LENGTH(&(undef->reloc))) { - case 0: /* byte */ - if (R_MEMORY_SUB(&(undef->reloc))) - *address = datum - *address; - else *address = undef->u.c + datum; - break; - case 1: /* word */ - if (R_MEMORY_SUB(&(undef->reloc))) - *(short*)address = datum - *(short*)address; - else *(short*)address = undef->u.s + datum; - break; - case 2: /* long */ - if (R_MEMORY_SUB(&(undef->reloc))) - *(long*)address = datum - *(long*)address; - else *(long*)address = undef->u.l + datum; - break; - } -#endif - free(undef->name); - free(undef); - return ST_DELETE; -} - -static void -unlink_undef(name, value) - const char *name; - long value; -{ - struct reloc_arg arg; - - arg.name = name; - arg.value = value; - st_foreach(reloc_tbl, reloc_undef, &arg); -} - -#ifdef N_INDR -struct indr_data { - char *name0, *name1; -}; - -static int -reloc_repl(no, undef, data) - int no; - struct undef *undef; - struct indr_data *data; -{ - if (strcmp(data->name0, undef->name) == 0) { - free(undef->name); - undef->name = strdup(data->name1); - } - return ST_CONTINUE; -} -#endif - -static int -load_1(fd, disp, need_init) - int fd; - long disp; - const char *need_init; -{ - static char *libc = LIBC_NAME; - struct exec hdr; - struct relocation_info *reloc = NULL; - long block = 0; - long new_common = 0; /* Length of new common */ - struct nlist *syms = NULL; - struct nlist *sym; - struct nlist *end; - int init_p = 0; - - if (load_header(fd, &hdr, disp) == -1) return -1; - if (INVALID_OBJECT(hdr)) { - dln_errno = DLN_ENOEXEC; - return -1; - } - reloc = load_reloc(fd, &hdr, disp); - if (reloc == NULL) return -1; - - syms = load_sym(fd, &hdr, disp); - if (syms == NULL) { - free(reloc); - return -1; - } - - sym = syms; - end = syms + (hdr.a_syms / sizeof(struct nlist)); - while (sym < end) { - struct nlist *old_sym; - int value = sym->n_value; - -#ifdef N_INDR - if (sym->n_type == (N_INDR | N_EXT)) { - char *key = sym->n_un.n_name; - - if (st_lookup(sym_tbl, sym[1].n_un.n_name, &old_sym)) { - if (st_delete(undef_tbl, (st_data_t*)&key, NULL)) { - unlink_undef(key, old_sym->n_value); - free(key); - } - } - else { - struct indr_data data; - - data.name0 = sym->n_un.n_name; - data.name1 = sym[1].n_un.n_name; - st_foreach(reloc_tbl, reloc_repl, &data); - - st_insert(undef_tbl, strdup(sym[1].n_un.n_name), NULL); - if (st_delete(undef_tbl, (st_data_t*)&key, NULL)) { - free(key); - } - } - sym += 2; - continue; - } -#endif - if (sym->n_type == (N_UNDF | N_EXT)) { - if (st_lookup(sym_tbl, sym->n_un.n_name, &old_sym) == 0) { - old_sym = NULL; - } - - if (value) { - if (old_sym) { - sym->n_type = N_EXT | N_COMM; - sym->n_value = old_sym->n_value; - } - else { - int rnd = - value >= sizeof(double) ? sizeof(double) - 1 - : value >= sizeof(long) ? sizeof(long) - 1 - : sizeof(short) - 1; - - sym->n_type = N_COMM; - new_common += rnd; - new_common &= ~(long)rnd; - sym->n_value = new_common; - new_common += value; - } - } - else { - if (old_sym) { - sym->n_type = N_EXT | N_COMM; - sym->n_value = old_sym->n_value; - } - else { - sym->n_value = (long)dln_undefined; - st_insert(undef_tbl, strdup(sym->n_un.n_name), NULL); - } - } - } - sym++; - } - - block = load_text_data(fd, &hdr, hdr.a_bss + new_common, disp); - if (block == 0) goto err_exit; - - sym = syms; - while (sym < end) { - struct nlist *new_sym; - char *key; - - switch (sym->n_type) { - case N_COMM: - sym->n_value += hdr.a_text + hdr.a_data; - case N_TEXT|N_EXT: - case N_DATA|N_EXT: - - sym->n_value += block; - - if (st_lookup(sym_tbl, sym->n_un.n_name, &new_sym) != 0 - && new_sym->n_value != (long)dln_undefined) { - dln_errno = DLN_ECONFL; - goto err_exit; - } - - key = sym->n_un.n_name; - if (st_delete(undef_tbl, (st_data_t*)&key, NULL) != 0) { - unlink_undef(key, sym->n_value); - free(key); - } - - new_sym = (struct nlist*)xmalloc(sizeof(struct nlist)); - *new_sym = *sym; - new_sym->n_un.n_name = strdup(sym->n_un.n_name); - st_insert(sym_tbl, new_sym->n_un.n_name, new_sym); - break; - - case N_TEXT: - case N_DATA: - sym->n_value += block; - break; - } - sym++; - } - - /* - * First comes the text-relocation - */ - { - struct relocation_info * rel = reloc; - struct relocation_info * rel_beg = reloc + - (hdr.a_trsize/sizeof(struct relocation_info)); - struct relocation_info * rel_end = reloc + - (hdr.a_trsize+hdr.a_drsize)/sizeof(struct relocation_info); - - while (rel < rel_end) { - char *address = (char*)(rel->r_address + block); - long datum = 0; -#if defined(sun) && defined(sparc) - unsigned int mask = 0; -#endif - - if(rel >= rel_beg) - address += hdr.a_text; - - if (rel->r_extern) { /* Look it up in symbol-table */ - sym = &(syms[R_SYMBOL(rel)]); - switch (sym->n_type) { - case N_EXT|N_UNDF: - link_undef(sym->n_un.n_name, block, rel); - case N_EXT|N_COMM: - case N_COMM: - datum = sym->n_value; - break; - default: - goto err_exit; - } - } /* end.. look it up */ - else { /* is static */ - switch (R_SYMBOL(rel)) { - case N_TEXT: - case N_DATA: - datum = block; - break; - case N_BSS: - datum = block + new_common; - break; - case N_ABS: - break; - } - } /* end .. is static */ - if (R_PCREL(rel)) datum -= block; - -#if defined(sun) && defined(sparc) - datum += rel->r_addend; - datum >>= R_RIGHTSHIFT(rel); - mask = (1 << R_BITSIZE(rel)) - 1; - mask |= mask -1; - datum &= mask; - - switch (R_LENGTH(rel)) { - case 0: - *address &= ~mask; - *address |= datum; - break; - case 1: - *(short *)address &= ~mask; - *(short *)address |= datum; - break; - case 2: - *(long *)address &= ~mask; - *(long *)address |= datum; - break; - } -#else - switch (R_LENGTH(rel)) { - case 0: /* byte */ - if (datum < -128 || datum > 127) goto err_exit; - *address += datum; - break; - case 1: /* word */ - *(short *)address += datum; - break; - case 2: /* long */ - *(long *)address += datum; - break; - } -#endif - rel++; - } - } - - if (need_init) { - int len; - char **libs_to_be_linked = 0; - char *buf; - - if (undef_tbl->num_entries > 0) { - if (load_lib(libc) == -1) goto err_exit; - } - - init_funcname(&buf, need_init); - len = strlen(buf); - - for (sym = syms; symn_un.n_name; - if (name[0] == '_' && sym->n_value >= block) { - if (strcmp(name+1, "dln_libs_to_be_linked") == 0) { - libs_to_be_linked = (char**)sym->n_value; - } - else if (strcmp(name+1, buf) == 0) { - init_p = 1; - ((int (*)())sym->n_value)(); - } - } - } - if (libs_to_be_linked && undef_tbl->num_entries > 0) { - while (*libs_to_be_linked) { - load_lib(*libs_to_be_linked); - libs_to_be_linked++; - } - } - } - free(reloc); - free(syms); - if (need_init) { - if (init_p == 0) { - dln_errno = DLN_ENOINIT; - return -1; - } - if (undef_tbl->num_entries > 0) { - if (load_lib(libc) == -1) goto err_exit; - if (undef_tbl->num_entries > 0) { - dln_errno = DLN_EUNDEF; - return -1; - } - } - } - return 0; - - err_exit: - if (syms) free(syms); - if (reloc) free(reloc); - if (block) free((char*)block); - return -1; -} - -static int target_offset; -static int -search_undef(key, value, lib_tbl) - const char *key; - int value; - st_table *lib_tbl; -{ - long offset; - - if (st_lookup(lib_tbl, key, &offset) == 0) return ST_CONTINUE; - target_offset = offset; - return ST_STOP; -} - -struct symdef { - int rb_str_index; - int lib_offset; -}; - -char *dln_librrb_ary_path = DLN_DEFAULT_LIB_PATH; - -static int -load_lib(lib) - const char *lib; -{ - char *path, *file; - char armagic[SARMAG]; - int fd, size; - struct ar_hdr ahdr; - st_table *lib_tbl = NULL; - int *data, nsym; - struct symdef *base; - char *name_base; - - if (dln_init_p == 0) { - dln_errno = DLN_ENOINIT; - return -1; - } - - if (undef_tbl->num_entries == 0) return 0; - dln_errno = DLN_EBADLIB; - - if (lib[0] == '-' && lib[1] == 'l') { - long len = strlen(lib) + 4; - char *p = alloca(len); - snprintf(p, len, "lib%s.a", lib+2); - lib = p; - } - - /* library search path: */ - /* look for environment variable DLN_LIBRARY_PATH first. */ - /* then variable dln_librrb_ary_path. */ - /* if path is still NULL, use "." for path. */ - path = getenv("DLN_LIBRARY_PATH"); - if (path == NULL) path = dln_librrb_ary_path; - - file = dln_find_file(lib, path); - fd = open(file, O_RDONLY); - if (fd == -1) goto syserr; - size = read(fd, armagic, SARMAG); - if (size == -1) goto syserr; - - if (size != SARMAG) { - dln_errno = DLN_ENOTLIB; - goto badlib; - } - size = read(fd, &ahdr, sizeof(ahdr)); - if (size == -1) goto syserr; - if (size != sizeof(ahdr) || sscanf(ahdr.ar_size, "%d", &size) != 1) { - goto badlib; - } - - if (strncmp(ahdr.ar_name, "__.SYMDEF", 9) == 0) { - /* make hash table from __.SYMDEF */ - - lib_tbl = st_init_strtable(); - data = (int*)xmalloc(size); - if (data == NULL) goto syserr; - size = read(fd, data, size); - nsym = *data / sizeof(struct symdef); - base = (struct symdef*)(data + 1); - name_base = (char*)(base + nsym) + sizeof(int); - while (nsym > 0) { - char *name = name_base + base->rb_str_index; - - st_insert(lib_tbl, name, base->lib_offset + sizeof(ahdr)); - nsym--; - base++; - } - for (;;) { - target_offset = -1; - st_foreach(undef_tbl, search_undef, lib_tbl); - if (target_offset == -1) break; - if (load_1(fd, target_offset, 0) == -1) { - st_free_table(lib_tbl); - free(data); - goto badlib; - } - if (undef_tbl->num_entries == 0) break; - } - free(data); - st_free_table(lib_tbl); - } - else { - /* linear library, need to scan (FUTURE) */ - - for (;;) { - int offset = SARMAG; - int found = 0; - struct exec hdr; - struct nlist *syms, *sym, *end; - - while (undef_tbl->num_entries > 0) { - found = 0; - lseek(fd, offset, 0); - size = read(fd, &ahdr, sizeof(ahdr)); - if (size == -1) goto syserr; - if (size == 0) break; - if (size != sizeof(ahdr) - || sscanf(ahdr.ar_size, "%d", &size) != 1) { - goto badlib; - } - offset += sizeof(ahdr); - if (load_header(fd, &hdr, offset) == -1) - goto badlib; - syms = load_sym(fd, &hdr, offset); - if (syms == NULL) goto badlib; - sym = syms; - end = syms + (hdr.a_syms / sizeof(struct nlist)); - while (sym < end) { - if (sym->n_type == N_EXT|N_TEXT - && st_lookup(undef_tbl, sym->n_un.n_name, NULL)) { - break; - } - sym++; - } - if (sym < end) { - found++; - free(syms); - if (load_1(fd, offset, 0) == -1) { - goto badlib; - } - } - offset += size; - if (offset & 1) offset++; - } - if (found) break; - } - } - close(fd); - return 0; - - syserr: - dln_errno = errno; - badlib: - if (fd >= 0) close(fd); - return -1; -} - -static int -load(file) - const char *file; -{ - int fd; - int result; - - if (dln_init_p == 0) { - if (dln_init(dln_argv0) == -1) return -1; - } - result = strlen(file); - if (file[result-1] == 'a') { - return load_lib(file); - } - - fd = open(file, O_RDONLY); - if (fd == -1) { - dln_errno = errno; - return -1; - } - result = load_1(fd, 0, file); - close(fd); - - return result; -} - -void* -dln_sym(name) - const char *name; -{ - struct nlist *sym; - - if (st_lookup(sym_tbl, name, &sym)) - return (void*)sym->n_value; - return NULL; -} - -#endif /* USE_DLN_A_OUT */ - -#ifdef USE_DLN_DLOPEN -# if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ < 105000000 -# include -# include -# else -# include -# endif -#endif - -#ifdef __hpux -#include -#include "dl.h" -#endif - -#if defined(_AIX) -#include /* for isdigit() */ -#include /* for global errno */ -#include -#endif - -#ifdef NeXT -#if NS_TARGET_MAJOR < 4 -#include -#else -#include -#ifndef NSLINKMODULE_OPTION_BINDNOW -#define NSLINKMODULE_OPTION_BINDNOW 1 -#endif -#endif -#else -#ifdef __APPLE__ -#include -#endif -#endif - -#if defined _WIN32 && !defined __CYGWIN__ -#include -#endif - -#ifdef _WIN32_WCE -#undef FormatMessage -#define FormatMessage FormatMessageA -#undef LoadLibrary -#define LoadLibrary LoadLibraryA -#undef GetProcAddress -#define GetProcAddress GetProcAddressA -#endif - -static const char * -dln_strerror() -{ -#ifdef USE_DLN_A_OUT - char *strerror(); - - switch (dln_errno) { - case DLN_ECONFL: - return "Symbol name conflict"; - case DLN_ENOINIT: - return "No initializer given"; - case DLN_EUNDEF: - return "Unresolved symbols"; - case DLN_ENOTLIB: - return "Not a library file"; - case DLN_EBADLIB: - return "Malformed library file"; - case DLN_EINIT: - return "Not initialized"; - default: - return strerror(dln_errno); - } -#endif - -#ifdef USE_DLN_DLOPEN - return (char*)dlerror(); -#endif - -#if defined _WIN32 && !defined __CYGWIN__ - static char message[1024]; - int error = GetLastError(); - char *p = message; - p += sprintf(message, "%d: ", error); - FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - error, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - p, - sizeof message - strlen(message), - NULL); - - for (p = message; *p; p++) { - if (*p == '\n' || *p == '\r') - *p = ' '; - } - return message; -#endif -} - - -#if defined(_AIX) && ! defined(_IA64) -static void -aix_loaderror(const char *pathname) -{ - char *message[8], errbuf[1024]; - int i,j; - - struct errtab { - int errnum; - char *errstr; - } load_errtab[] = { - {L_ERROR_TOOMANY, "too many errors, rest skipped."}, - {L_ERROR_NOLIB, "can't load library:"}, - {L_ERROR_UNDEF, "can't find symbol in library:"}, - {L_ERROR_RLDBAD, - "RLD index out of range or bad relocation type:"}, - {L_ERROR_FORMAT, "not a valid, executable xcoff file:"}, - {L_ERROR_MEMBER, - "file not an archive or does not contain requested member:"}, - {L_ERROR_TYPE, "symbol table mismatch:"}, - {L_ERROR_ALIGN, "text alignment in file is wrong."}, - {L_ERROR_SYSTEM, "System error:"}, - {L_ERROR_ERRNO, NULL} - }; - -#define LOAD_ERRTAB_LEN (sizeof(load_errtab)/sizeof(load_errtab[0])) -#define ERRBUF_APPEND(s) strncat(errbuf, s, sizeof(errbuf)-strlen(errbuf)-1) - - snprintf(errbuf, 1024, "load failed - %s ", pathname); - - if (!loadquery(1, &message[0], sizeof(message))) - ERRBUF_APPEND(strerror(errno)); - for(i = 0; message[i] && *message[i]; i++) { - int nerr = atoi(message[i]); - for (j=0; j -#include -#include -#include -#include -#include - -static char *vms_filespec; -static int vms_fileact(char *filespec, int type); -static long vms_fisexh(long *sigarr, long *mecarr); -#endif - -#endif /* NO_DLN_LOAD */ - -void* -dln_load(file) - const char *file; -{ -#ifdef NO_DLN_LOAD - rb_raise(rb_eLoadError, "this executable file can't load extension libraries"); -#else - -#if !defined(_AIX) && !defined(NeXT) - const char *error = 0; -#define DLN_ERROR() (error = dln_strerror(), strcpy(ALLOCA_N(char, strlen(error) + 1), error)) -#endif - -#if defined _WIN32 && !defined __CYGWIN__ - HINSTANCE handle; - char winfile[MAXPATHLEN]; - void (*init_fct)(); - char *buf; - - if (strlen(file) >= MAXPATHLEN) rb_loaderror("filename too long"); - - /* Load the file as an object one */ - init_funcname(&buf, file); - - strcpy(winfile, file); - - /* Load file */ - if ((handle = LoadLibrary(winfile)) == NULL) { - error = dln_strerror(); - goto failed; - } - - if ((init_fct = (void(*)())GetProcAddress(handle, buf)) == NULL) { - rb_loaderror("%s - %s\n%s", dln_strerror(), buf, file); - } - - /* Call the init code */ - (*init_fct)(); - return handle; -#else -#ifdef USE_DLN_A_OUT - if (load(file) == -1) { - error = dln_strerror(); - goto failed; - } - return 0; -#else - - char *buf; - /* Load the file as an object one */ - init_funcname(&buf, file); - -#ifdef USE_DLN_DLOPEN -#define DLN_DEFINED - { - void *handle; - void (*init_fct)(); - -#ifndef RTLD_LAZY -# define RTLD_LAZY 1 -#endif -#ifdef __INTERIX -# undef RTLD_GLOBAL -#endif -#ifndef RTLD_GLOBAL -# define RTLD_GLOBAL 0 -#endif - - /* Load file */ - if ((handle = (void*)dlopen(file, RTLD_LAZY|RTLD_GLOBAL)) == NULL) { - error = dln_strerror(); - goto failed; - } - - init_fct = (void(*)())dlsym(handle, buf); - if (init_fct == NULL) { - error = DLN_ERROR(); - dlclose(handle); - goto failed; - } - /* Call the init code */ - (*init_fct)(); - - return handle; - } -#endif /* USE_DLN_DLOPEN */ - -#ifdef __hpux -#define DLN_DEFINED - { - shl_t lib = NULL; - int flags; - void (*init_fct)(); - - flags = BIND_DEFERRED; - lib = shl_load(file, flags, 0); - if (lib == NULL) { - extern int errno; - rb_loaderror("%s - %s", strerror(errno), file); - } - shl_findsym(&lib, buf, TYPE_PROCEDURE, (void*)&init_fct); - if (init_fct == NULL) { - shl_findsym(&lib, buf, TYPE_UNDEFINED, (void*)&init_fct); - if (init_fct == NULL) { - errno = ENOSYM; - rb_loaderror("%s - %s", strerror(ENOSYM), file); - } - } - (*init_fct)(); - return (void*)lib; - } -#endif /* hpux */ - -#if defined(_AIX) && ! defined(_IA64) -#define DLN_DEFINED - { - void (*init_fct)(); - - init_fct = (void(*)())load((char*)file, 1, 0); - if (init_fct == NULL) { - aix_loaderror(file); - } - if (loadbind(0, (void*)dln_load, (void*)init_fct) == -1) { - aix_loaderror(file); - } - (*init_fct)(); - return (void*)init_fct; - } -#endif /* _AIX */ - -#if defined(NeXT) || defined(__APPLE__) -#define DLN_DEFINED -/*---------------------------------------------------- - By SHIROYAMA Takayuki Psi@fortune.nest.or.jp - - Special Thanks... - Yu tomoak-i@is.aist-nara.ac.jp, - Mi hisho@tasihara.nest.or.jp, - sunshine@sunshineco.com, - and... Miss ARAI Akino(^^;) - ----------------------------------------------------*/ -#if defined(NeXT) && (NS_TARGET_MAJOR < 4)/* NeXTSTEP rld functions */ - - { - NXStream* s; - unsigned long init_address; - char *object_files[2] = {NULL, NULL}; - - void (*init_fct)(); - - object_files[0] = (char*)file; - - s = NXOpenFile(2,NX_WRITEONLY); - - /* Load object file, if return value ==0 , load failed*/ - if(rld_load(s, NULL, object_files, NULL) == 0) { - NXFlush(s); - NXClose(s); - rb_loaderror("Failed to load %.200s", file); - } - - /* lookup the initial function */ - if(rld_lookup(s, buf, &init_address) == 0) { - NXFlush(s); - NXClose(s); - rb_loaderror("Failed to lookup Init function %.200s", file); - } - - NXFlush(s); - NXClose(s); - - /* Cannot call *init_address directory, so copy this value to - funtion pointer */ - init_fct = (void(*)())init_address; - (*init_fct)(); - return (void*)init_address; - } -#else/* OPENSTEP dyld functions */ - { - int dyld_result; - NSObjectFileImage obj_file; /* handle, but not use it */ - /* "file" is module file name . - "buf" is pointer to initial function name with "_" . */ - - void (*init_fct)(); - - - dyld_result = NSCreateObjectFileImageFromFile(file, &obj_file); - - if (dyld_result != NSObjectFileImageSuccess) { - rb_loaderror("Failed to load %.200s", file); - } - - NSLinkModule(obj_file, file, NSLINKMODULE_OPTION_BINDNOW); - - /* lookup the initial function */ - if(!NSIsSymbolNameDefined(buf)) { - rb_loaderror("Failed to lookup Init function %.200s",file); - } - init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf)); - (*init_fct)(); - - return (void*)init_fct; - } -#endif /* rld or dyld */ -#endif - -#ifdef __BEOS__ -# define DLN_DEFINED - { - status_t err_stat; /* BeOS error status code */ - image_id img_id; /* extention module unique id */ - void (*init_fct)(); /* initialize function for extention module */ - - /* load extention module */ - img_id = load_add_on(file); - if (img_id <= 0) { - rb_loaderror("Failed to load %.200s", file); - } - - /* find symbol for module initialize function. */ - /* The Be Book KernelKit Images section described to use - B_SYMBOL_TYPE_TEXT for symbol of function, not - B_SYMBOL_TYPE_CODE. Why ? */ - /* strcat(init_fct_symname, "__Fv"); */ /* parameter nothing. */ - /* "__Fv" dont need! The Be Book Bug ? */ - err_stat = get_image_symbol(img_id, buf, - B_SYMBOL_TYPE_TEXT, (void **)&init_fct); - - if (err_stat != B_NO_ERROR) { - char real_name[MAXPATHLEN]; - - strcpy(real_name, buf); - strcat(real_name, "__Fv"); - err_stat = get_image_symbol(img_id, real_name, - B_SYMBOL_TYPE_TEXT, (void **)&init_fct); - } - - if ((B_BAD_IMAGE_ID == err_stat) || (B_BAD_INDEX == err_stat)) { - unload_add_on(img_id); - rb_loaderror("Failed to lookup Init function %.200s", file); - } - else if (B_NO_ERROR != err_stat) { - char errmsg[] = "Internal of BeOS version. %.200s (symbol_name = %s)"; - unload_add_on(img_id); - rb_loaderror(errmsg, strerror(err_stat), buf); - } - - /* call module initialize function. */ - (*init_fct)(); - return (void*)img_id; - } -#endif /* __BEOS__*/ - -#ifdef __MACOS__ -# define DLN_DEFINED - { - OSErr err; - FSSpec libspec; - CFragConnectionID connID; - Ptr mainAddr; - char errMessage[1024]; - Boolean isfolder, didsomething; - Str63 fragname; - Ptr symAddr; - CFragSymbolClass class; - void (*init_fct)(); - char fullpath[MAXPATHLEN]; - - strcpy(fullpath, file); - - /* resolve any aliases to find the real file */ - c2pstr(fullpath); - (void)FSMakeFSSpec(0, 0, fullpath, &libspec); - err = ResolveAliasFile(&libspec, 1, &isfolder, &didsomething); - if (err) { - rb_loaderror("Unresolved Alias - %s", file); - } - - /* Load the fragment (or return the connID if it is already loaded */ - fragname[0] = 0; - err = GetDiskFragment(&libspec, 0, 0, fragname, - kLoadCFrag, &connID, &mainAddr, - errMessage); - if (err) { - p2cstr(errMessage); - rb_loaderror("%s - %s",errMessage , file); - } - - /* Locate the address of the correct init function */ - c2pstr(buf); - err = FindSymbol(connID, buf, &symAddr, &class); - if (err) { - rb_loaderror("Unresolved symbols - %s" , file); - } - init_fct = (void (*)())symAddr; - (*init_fct)(); - return (void*)init_fct; - } -#endif /* __MACOS__ */ - -#if defined(__VMS) -#define DLN_DEFINED - { - long status; - void (*init_fct)(); - char *fname, *p1, *p2; - - $DESCRIPTOR(fname_d, ""); - $DESCRIPTOR(image_d, ""); - $DESCRIPTOR(buf_d, ""); - - decc$to_vms(file, vms_fileact, 0, 0); - - fname = (char *)__alloca(strlen(file)+1); - strcpy(fname,file); - if (p1 = strrchr(fname,'/')) - fname = p1 + 1; - if (p2 = strrchr(fname,'.')) - *p2 = '\0'; - - fname_d.dsc$w_length = strlen(fname); - fname_d.dsc$a_pointer = fname; - image_d.dsc$w_length = strlen(vms_filespec); - image_d.dsc$a_pointer = vms_filespec; - buf_d.dsc$w_length = strlen(buf); - buf_d.dsc$a_pointer = buf; - - lib$establish(vms_fisexh); - - status = lib$find_image_symbol ( - &fname_d, - &buf_d, - &init_fct, - &image_d); - - lib$establish(0); - - if (status == RMS$_FNF) { - error = dln_strerror(); - goto failed; - } else if (!$VMS_STATUS_SUCCESS(status)) { - error = DLN_ERROR(); - goto failed; - } - - /* Call the init code */ - (*init_fct)(); - - return 1; - } -#endif /* __VMS */ - -#ifndef DLN_DEFINED - rb_notimplement(); -#endif - -#endif /* USE_DLN_A_OUT */ -#endif -#if !defined(_AIX) && !defined(NeXT) - failed: - rb_loaderror("%s - %s", error, file); -#endif - -#endif /* NO_DLN_LOAD */ - return 0; /* dummy return */ -} - -static char *dln_find_1(); - -char * -dln_find_exe(fname, path) - const char *fname; - const char *path; -{ - if (!path) { - path = getenv(PATH_ENV); - } - - if (!path) { -#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__MACOS__) - path = "/usr/local/bin;/usr/ucb;/usr/bin;/bin;."; -#else - path = "/usr/local/bin:/usr/ucb:/usr/bin:/bin:."; -#endif - } - return dln_find_1(fname, path, 1); -} - -char * -dln_find_file(fname, path) - const char *fname; - const char *path; -{ -#ifndef __MACOS__ - if (!path) path = "."; - return dln_find_1(fname, path, 0); -#else - if (!path) path = "."; - return _macruby_path_conv_posix_to_macos(dln_find_1(fname, path, 0)); -#endif -} - -static char fbuf[MAXPATHLEN]; - -static char * -dln_find_1(fname, path, exe_flag) - char *fname; - char *path; - int exe_flag; /* non 0 if looking for executable. */ -{ - register char *dp; - register char *ep; - register char *bp; - struct stat st; -#ifdef __MACOS__ - const char* mac_fullpath; -#endif - - if (!fname) return fname; - if (fname[0] == '/') return fname; - if (strncmp("./", fname, 2) == 0 || strncmp("../", fname, 3) == 0) - return fname; - if (exe_flag && strchr(fname, '/')) return fname; -#ifdef DOSISH - if (fname[0] == '\\') return fname; -# ifdef DOSISH_DRIVE_LETTER - if (strlen(fname) > 2 && fname[1] == ':') return fname; -# endif - if (strncmp(".\\", fname, 2) == 0 || strncmp("..\\", fname, 3) == 0) - return fname; - if (exe_flag && strchr(fname, '\\')) return fname; -#endif - - for (dp = path;; dp = ++ep) { - register int l; - int i; - int fspace; - - /* extract a component */ - ep = strchr(dp, PATH_SEP[0]); - if (ep == NULL) - ep = dp+strlen(dp); - - /* find the length of that component */ - l = ep - dp; - bp = fbuf; - fspace = sizeof fbuf - 2; - if (l > 0) { - /* - ** If the length of the component is zero length, - ** start from the current directory. If the - ** component begins with "~", start from the - ** user's $HOME environment variable. Otherwise - ** take the path literally. - */ - - if (*dp == '~' && (l == 1 || -#if defined(DOSISH) - dp[1] == '\\' || -#endif - dp[1] == '/')) { - char *home; - - home = getenv("HOME"); - if (home != NULL) { - i = strlen(home); - if ((fspace -= i) < 0) - goto toolong; - memcpy(bp, home, i); - bp += i; - } - dp++; - l--; - } - if (l > 0) { - if ((fspace -= l) < 0) - goto toolong; - memcpy(bp, dp, l); - bp += l; - } - - /* add a "/" between directory and filename */ - if (ep[-1] != '/') - *bp++ = '/'; - } - - /* now append the file name */ - i = strlen(fname); - if ((fspace -= i) < 0) { - toolong: - fprintf(stderr, "openpath: pathname too long (ignored)\n"); - *bp = '\0'; - fprintf(stderr, "\tDirectory \"%s\"\n", fbuf); - fprintf(stderr, "\tFile \"%s\"\n", fname); - goto next; - } - memcpy(bp, fname, i + 1); - -#if defined(DOSISH) - if (exe_flag) { - static const char extension[][5] = { -#if defined(MSDOS) - ".com", ".exe", ".bat", -#if defined(DJGPP) - ".btm", ".sh", ".ksh", ".pl", ".sed", -#endif -#elif defined(__EMX__) || defined(_WIN32) - ".exe", ".com", ".cmd", ".bat", -/* end of __EMX__ or _WIN32 */ -#else - ".r", ".R", ".x", ".X", ".bat", ".BAT", -/* __human68k__ */ -#endif - }; - int j; - - for (j = 0; j < sizeof(extension) / sizeof(extension[0]); j++) { - if (fspace < strlen(extension[j])) { - fprintf(stderr, "openpath: pathname too long (ignored)\n"); - fprintf(stderr, "\tDirectory \"%.*s\"\n", (int) (bp - fbuf), fbuf); - fprintf(stderr, "\tFile \"%s%s\"\n", fname, extension[j]); - continue; - } - strcpy(bp + i, extension[j]); -#ifndef __MACOS__ - if (stat(fbuf, &st) == 0) - return fbuf; -#else - if (mac_fullpath = _macruby_exist_file_in_libdir_as_posix_name(fbuf)) - return mac_fullpath; - -#endif - } - goto next; - } -#endif /* MSDOS or _WIN32 or __human68k__ or __EMX__ */ - -#ifndef __MACOS__ - if (stat(fbuf, &st) == 0) { - if (exe_flag == 0) return fbuf; - /* looking for executable */ - if (!S_ISDIR(st.st_mode) && eaccess(fbuf, X_OK) == 0) - return fbuf; - } -#else - if (mac_fullpath = _macruby_exist_file_in_libdir_as_posix_name(fbuf)) { - if (exe_flag == 0) return mac_fullpath; - /* looking for executable */ - if (stat(mac_fullpath, &st) == 0) { - if (!S_ISDIR(st.st_mode) && eaccess(mac_fullpath, X_OK) == 0) - return mac_fullpath; - } - } -#endif - - next: - /* if not, and no other alternatives, life is bleak */ - if (*ep == '\0') { - return NULL; - } - - /* otherwise try the next component in the search path */ - } -} - -#if defined(__VMS) - -/* action routine for decc$to_vms */ -static int vms_fileact(char *filespec, int type) -{ - if (vms_filespec) - free(vms_filespec); - vms_filespec = malloc(strlen(filespec)+1); - strcpy(vms_filespec, filespec); - return 1; -} - -/* exception handler for LIB$FIND_IMAGE_SYMBOL */ -static long vms_fisexh(long *sigarr, long *mecarr) -{ - sys$unwind(1, 0); - return 1; -} - -#endif /* __VMS */ -#define NO_DLN_LOAD 1 -#include "dln.c" -void -Init_ext() -{ -} -/********************************************************************** - - enum.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007) $ - created at: Fri Oct 1 15:15:19 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include "node.h" -#include "util.h" - -VALUE rb_mEnumerable; -static ID id_each, id_eqq, id_cmp; - -VALUE -rb_each(obj) - VALUE obj; -{ - return rb_funcall(obj, id_each, 0, 0); -} - -static VALUE -grep_i(i, arg) - VALUE i, *arg; -{ - if (RTEST(rb_funcall(arg[0], id_eqq, 1, i))) { - rb_ary_push(arg[1], i); - } - return Qnil; -} - -static VALUE -grep_iter_i(i, arg) - VALUE i, *arg; -{ - if (RTEST(rb_funcall(arg[0], id_eqq, 1, i))) { - rb_ary_push(arg[1], rb_yield(i)); - } - return Qnil; -} - -/* - * call-seq: - * enum.grep(pattern) => array - * enum.grep(pattern) {| obj | block } => array - * - * Returns an array of every element in enum for which - * Pattern === element. If the optional block is - * supplied, each matching element is passed to it, and the block's - * result is stored in the output array. - * - * (1..100).grep 38..44 #=> [38, 39, 40, 41, 42, 43, 44] - * c = IO.constants - * c.grep(/SEEK/) #=> ["SEEK_END", "SEEK_SET", "SEEK_CUR"] - * res = c.grep(/SEEK/) {|v| IO.const_get(v) } - * res #=> [2, 0, 1] - * - */ - -static VALUE -enum_grep(obj, pat) - VALUE obj, pat; -{ - VALUE ary = rb_ary_new(); - VALUE arg[2]; - - arg[0] = pat; - arg[1] = ary; - - rb_iterate(rb_each, obj, rb_block_given_p() ? grep_iter_i : grep_i, (VALUE)arg); - - return ary; -} - -static VALUE -find_i(i, memo) - VALUE i; - VALUE *memo; -{ - if (RTEST(rb_yield(i))) { - *memo = i; - rb_iter_break(); - } - return Qnil; -} - -/* - * call-seq: - * enum.detect(ifnone = nil) {| obj | block } => obj or nil - * enum.find(ifnone = nil) {| obj | block } => obj or nil - * - * Passes each entry in enum to block. Returns the - * first for which block is not false. If no - * object matches, calls ifnone and returns its result when it - * is specified, or returns nil - * - * (1..10).detect {|i| i % 5 == 0 and i % 7 == 0 } #=> nil - * (1..100).detect {|i| i % 5 == 0 and i % 7 == 0 } #=> 35 - * - */ - -static VALUE -enum_find(argc, argv, obj) - int argc; - VALUE* argv; - VALUE obj; -{ - VALUE memo = Qundef; - VALUE if_none; - - rb_scan_args(argc, argv, "01", &if_none); - rb_iterate(rb_each, obj, find_i, (VALUE)&memo); - if (memo != Qundef) { - return memo; - } - if (!NIL_P(if_none)) { - return rb_funcall(if_none, rb_intern("call"), 0, 0); - } - return Qnil; -} - -static VALUE -find_all_i(i, ary) - VALUE i, ary; -{ - if (RTEST(rb_yield(i))) { - rb_ary_push(ary, i); - } - return Qnil; -} - -/* - * call-seq: - * enum.find_all {| obj | block } => array - * enum.select {| obj | block } => array - * - * Returns an array containing all elements of enum for which - * block is not false (see also - * Enumerable#reject). - * - * (1..10).find_all {|i| i % 3 == 0 } #=> [3, 6, 9] - * - */ - -static VALUE -enum_find_all(obj) - VALUE obj; -{ - VALUE ary = rb_ary_new(); - - rb_iterate(rb_each, obj, find_all_i, ary); - - return ary; -} - -static VALUE -reject_i(i, ary) - VALUE i, ary; -{ - if (!RTEST(rb_yield(i))) { - rb_ary_push(ary, i); - } - return Qnil; -} - -/* - * call-seq: - * enum.reject {| obj | block } => array - * - * Returns an array for all elements of enum for which - * block is false (see also Enumerable#find_all). - * - * (1..10).reject {|i| i % 3 == 0 } #=> [1, 2, 4, 5, 7, 8, 10] - * - */ - -static VALUE -enum_reject(obj) - VALUE obj; -{ - VALUE ary = rb_ary_new(); - - rb_iterate(rb_each, obj, reject_i, ary); - - return ary; -} - -static VALUE -collect_i(i, ary) - VALUE i, ary; -{ - rb_ary_push(ary, rb_yield(i)); - - return Qnil; -} - -static VALUE -collect_all(i, ary) - VALUE i, ary; -{ - rb_ary_push(ary, i); - - return Qnil; -} - -/* - * call-seq: - * enum.collect {| obj | block } => array - * enum.map {| obj | block } => array - * - * Returns a new array with the results of running block once - * for every element in enum. - * - * (1..4).collect {|i| i*i } #=> [1, 4, 9, 16] - * (1..4).collect { "cat" } #=> ["cat", "cat", "cat", "cat"] - * - */ - -static VALUE -enum_collect(obj) - VALUE obj; -{ - VALUE ary = rb_ary_new(); - - rb_iterate(rb_each, obj, rb_block_given_p() ? collect_i : collect_all, ary); - - return ary; -} - -/* - * call-seq: - * enum.to_a => array - * enum.entries => array - * - * Returns an array containing the items in enum. - * - * (1..7).to_a #=> [1, 2, 3, 4, 5, 6, 7] - * { 'a'=>1, 'b'=>2, 'c'=>3 }.to_a #=> [["a", 1], ["b", 2], ["c", 3]] - */ -static VALUE -enum_to_a(obj) - VALUE obj; -{ - VALUE ary = rb_ary_new(); - - rb_iterate(rb_each, obj, collect_all, ary); - - return ary; -} - -static VALUE -inject_i(i, memo) - VALUE i; - VALUE *memo; -{ - if (*memo == Qundef) { - *memo = i; - } - else { - *memo = rb_yield_values(2, *memo, i); - } - return Qnil; -} - -/* - * call-seq: - * enum.inject(initial) {| memo, obj | block } => obj - * enum.inject {| memo, obj | block } => obj - * - * Combines the elements of enum by applying the block to an - * accumulator value (memo) and each element in turn. At each - * step, memo is set to the value returned by the block. The - * first form lets you supply an initial value for memo. The - * second form uses the first element of the collection as a the - * initial value (and skips that element while iterating). - * - * # Sum some numbers - * (5..10).inject {|sum, n| sum + n } #=> 45 - * # Multiply some numbers - * (5..10).inject(1) {|product, n| product * n } #=> 151200 - * - * # find the longest word - * longest = %w{ cat sheep bear }.inject do |memo,word| - * memo.length > word.length ? memo : word - * end - * longest #=> "sheep" - * - * # find the length of the longest word - * longest = %w{ cat sheep bear }.inject(0) do |memo,word| - * memo >= word.length ? memo : word.length - * end - * longest #=> 5 - * - */ - -static VALUE -enum_inject(argc, argv, obj) - int argc; - VALUE *argv, obj; -{ - VALUE memo = Qundef; - - if (rb_scan_args(argc, argv, "01", &memo) == 0) - memo = Qundef; - rb_iterate(rb_each, obj, inject_i, (VALUE)&memo); - if (memo == Qundef) return Qnil; - return memo; -} - -static VALUE -partition_i(i, ary) - VALUE i, *ary; -{ - if (RTEST(rb_yield(i))) { - rb_ary_push(ary[0], i); - } - else { - rb_ary_push(ary[1], i); - } - return Qnil; -} - -/* - * call-seq: - * enum.partition {| obj | block } => [ true_array, false_array ] - * - * Returns two arrays, the first containing the elements of - * enum for which the block evaluates to true, the second - * containing the rest. - * - * (1..6).partition {|i| (i&1).zero?} #=> [[2, 4, 6], [1, 3, 5]] - * - */ - -static VALUE -enum_partition(obj) - VALUE obj; -{ - VALUE ary[2]; - - ary[0] = rb_ary_new(); - ary[1] = rb_ary_new(); - rb_iterate(rb_each, obj, partition_i, (VALUE)ary); - - return rb_assoc_new(ary[0], ary[1]); -} - -/* - * call-seq: - * enum.sort => array - * enum.sort {| a, b | block } => array - * - * Returns an array containing the items in enum sorted, - * either according to their own <=> method, or by using - * the results of the supplied block. The block should return -1, 0, or - * +1 depending on the comparison between a and b. As of - * Ruby 1.8, the method Enumerable#sort_by implements a - * built-in Schwartzian Transform, useful when key computation or - * comparison is expensive.. - * - * %w(rhea kea flea).sort #=> ["flea", "kea", "rhea"] - * (1..10).sort {|a,b| b <=> a} #=> [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] - */ - -static VALUE -enum_sort(obj) - VALUE obj; -{ - return rb_ary_sort(enum_to_a(obj)); -} - -static VALUE -sort_by_i(i, ary) - VALUE i, ary; -{ - VALUE v; - NODE *memo; - - v = rb_yield(i); - if (RBASIC(ary)->klass) { - rb_raise(rb_eRuntimeError, "sort_by reentered"); - } - memo = rb_node_newnode(NODE_MEMO, v, i, 0); - rb_ary_push(ary, (VALUE)memo); - return Qnil; -} - -static int -sort_by_cmp(aa, bb) - NODE **aa, **bb; -{ - VALUE a = aa[0]->u1.value; - VALUE b = bb[0]->u1.value; - - return rb_cmpint(rb_funcall(a, id_cmp, 1, b), a, b); -} - -/* - * call-seq: - * enum.sort_by {| obj | block } => array - * - * Sorts enum using a set of keys generated by mapping the - * values in enum through the given block. - * - * %w{ apple pear fig }.sort_by {|word| word.length} - #=> ["fig", "pear", "apple"] - * - * The current implementation of sort_by generates an - * array of tuples containing the original collection element and the - * mapped value. This makes sort_by fairly expensive when - * the keysets are simple - * - * require 'benchmark' - * include Benchmark - * - * a = (1..100000).map {rand(100000)} - * - * bm(10) do |b| - * b.report("Sort") { a.sort } - * b.report("Sort by") { a.sort_by {|a| a} } - * end - * - * produces: - * - * user system total real - * Sort 0.180000 0.000000 0.180000 ( 0.175469) - * Sort by 1.980000 0.040000 2.020000 ( 2.013586) - * - * However, consider the case where comparing the keys is a non-trivial - * operation. The following code sorts some files on modification time - * using the basic sort method. - * - * files = Dir["*"] - * sorted = files.sort {|a,b| File.new(a).mtime <=> File.new(b).mtime} - * sorted #=> ["mon", "tues", "wed", "thurs"] - * - * This sort is inefficient: it generates two new File - * objects during every comparison. A slightly better technique is to - * use the Kernel#test method to generate the modification - * times directly. - * - * files = Dir["*"] - * sorted = files.sort { |a,b| - * test(?M, a) <=> test(?M, b) - * } - * sorted #=> ["mon", "tues", "wed", "thurs"] - * - * This still generates many unnecessary Time objects. A - * more efficient technique is to cache the sort keys (modification - * times in this case) before the sort. Perl users often call this - * approach a Schwartzian Transform, after Randal Schwartz. We - * construct a temporary array, where each element is an array - * containing our sort key along with the filename. We sort this array, - * and then extract the filename from the result. - * - * sorted = Dir["*"].collect { |f| - * [test(?M, f), f] - * }.sort.collect { |f| f[1] } - * sorted #=> ["mon", "tues", "wed", "thurs"] - * - * This is exactly what sort_by does internally. - * - * sorted = Dir["*"].sort_by {|f| test(?M, f)} - * sorted #=> ["mon", "tues", "wed", "thurs"] - */ - -static VALUE -enum_sort_by(obj) - VALUE obj; -{ - VALUE ary; - long i; - - if (TYPE(obj) == T_ARRAY) { - ary = rb_ary_new2(RARRAY(obj)->len); - } - else { - ary = rb_ary_new(); - } - RBASIC(ary)->klass = 0; - rb_iterate(rb_each, obj, sort_by_i, ary); - if (RARRAY(ary)->len > 1) { - qsort(RARRAY(ary)->ptr, RARRAY(ary)->len, sizeof(VALUE), sort_by_cmp, 0); - } - if (RBASIC(ary)->klass) { - rb_raise(rb_eRuntimeError, "sort_by reentered"); - } - for (i=0; ilen; i++) { - RARRAY(ary)->ptr[i] = RNODE(RARRAY(ary)->ptr[i])->u2.value; - } - RBASIC(ary)->klass = rb_cArray; - return ary; -} - -static VALUE -all_iter_i(i, memo) - VALUE i; - VALUE *memo; -{ - if (!RTEST(rb_yield(i))) { - *memo = Qfalse; - rb_iter_break(); - } - return Qnil; -} - -static VALUE -all_i(i, memo) - VALUE i; - VALUE *memo; -{ - if (!RTEST(i)) { - *memo = Qfalse; - rb_iter_break(); - } - return Qnil; -} - -/* - * call-seq: - * enum.all? [{|obj| block } ] => true or false - * - * Passes each element of the collection to the given block. The method - * returns true if the block never returns - * false or nil. If the block is not given, - * Ruby adds an implicit block of {|obj| obj} (that is - * all? will return true only if none of the - * collection members are false or nil.) - * - * %w{ ant bear cat}.all? {|word| word.length >= 3} #=> true - * %w{ ant bear cat}.all? {|word| word.length >= 4} #=> false - * [ nil, true, 99 ].all? #=> false - * - */ - -static VALUE -enum_all(obj) - VALUE obj; -{ - VALUE result = Qtrue; - - rb_iterate(rb_each, obj, rb_block_given_p() ? all_iter_i : all_i, (VALUE)&result); - return result; -} - -static VALUE -any_iter_i(i, memo) - VALUE i; - VALUE *memo; -{ - if (RTEST(rb_yield(i))) { - *memo = Qtrue; - rb_iter_break(); - } - return Qnil; -} - -static VALUE -any_i(i, memo) - VALUE i; - VALUE *memo; -{ - if (RTEST(i)) { - *memo = Qtrue; - rb_iter_break(); - } - return Qnil; -} - -/* - * call-seq: - * enum.any? [{|obj| block } ] => true or false - * - * Passes each element of the collection to the given block. The method - * returns true if the block ever returns a value other - * than false or nil. If the block is not - * given, Ruby adds an implicit block of {|obj| obj} (that - * is any? will return true if at least one - * of the collection members is not false or - * nil. - * - * %w{ ant bear cat}.any? {|word| word.length >= 3} #=> true - * %w{ ant bear cat}.any? {|word| word.length >= 4} #=> true - * [ nil, true, 99 ].any? #=> true - * - */ - -static VALUE -enum_any(obj) - VALUE obj; -{ - VALUE result = Qfalse; - - rb_iterate(rb_each, obj, rb_block_given_p() ? any_iter_i : any_i, (VALUE)&result); - return result; -} - -static VALUE -min_i(i, memo) - VALUE i; - VALUE *memo; -{ - VALUE cmp; - - if (*memo == Qundef) { - *memo = i; - } - else { - cmp = rb_funcall(i, id_cmp, 1, *memo); - if (rb_cmpint(cmp, i, *memo) < 0) { - *memo = i; - } - } - return Qnil; -} - -static VALUE -min_ii(i, memo) - VALUE i; - VALUE *memo; -{ - VALUE cmp; - - if (*memo == Qundef) { - *memo = i; - } - else { - cmp = rb_yield_values(2, i, *memo); - if (rb_cmpint(cmp, i, *memo) < 0) { - *memo = i; - } - } - return Qnil; -} - - -/* - * call-seq: - * enum.min => obj - * enum.min {| a,b | block } => obj - * - * Returns the object in enum with the minimum value. The - * first form assumes all objects implement Comparable; - * the second uses the block to return a <=> b. - * - * a = %w(albatross dog horse) - * a.min #=> "albatross" - * a.min {|a,b| a.length <=> b.length } #=> "dog" - */ - -static VALUE -enum_min(obj) - VALUE obj; -{ - VALUE result = Qundef; - - rb_iterate(rb_each, obj, rb_block_given_p() ? min_ii : min_i, (VALUE)&result); - if (result == Qundef) return Qnil; - return result; -} - -/* - * call-seq: - * enum.max => obj - * enum.max {| a,b | block } => obj - * - * Returns the object in enum with the maximum value. The - * first form assumes all objects implement Comparable; - * the second uses the block to return a <=> b. - * - * a = %w(albatross dog horse) - * a.max #=> "horse" - * a.max {|a,b| a.length <=> b.length } #=> "albatross" - */ - -static VALUE -max_i(i, memo) - VALUE i; - VALUE *memo; -{ - VALUE cmp; - - if (*memo == Qundef) { - *memo = i; - } - else { - cmp = rb_funcall(i, id_cmp, 1, *memo); - if (rb_cmpint(cmp, i, *memo) > 0) { - *memo = i; - } - } - return Qnil; -} - -static VALUE -max_ii(i, memo) - VALUE i; - VALUE *memo; -{ - VALUE cmp; - - if (*memo == Qundef) { - *memo = i; - } - else { - cmp = rb_yield_values(2, i, *memo); - if (rb_cmpint(cmp, i, *memo) > 0) { - *memo = i; - } - } - return Qnil; -} - -/* - * call-seq: - * enum.max => obj - * enum.max {|a,b| block } => obj - * - * Returns the object in _enum_ with the maximum value. The - * first form assumes all objects implement Comparable; - * the second uses the block to return a <=> b. - * - * a = %w(albatross dog horse) - * a.max #=> "horse" - * a.max {|a,b| a.length <=> b.length } #=> "albatross" - */ - -static VALUE -enum_max(obj) - VALUE obj; -{ - VALUE result = Qundef; - - rb_iterate(rb_each, obj, rb_block_given_p() ? max_ii : max_i, (VALUE)&result); - if (result == Qundef) return Qnil; - return result; -} - -static VALUE -member_i(item, memo) - VALUE item; - VALUE *memo; -{ - if (rb_equal(item, memo[0])) { - memo[1] = Qtrue; - rb_iter_break(); - } - return Qnil; -} - -/* - * call-seq: - * enum.include?(obj) => true or false - * enum.member?(obj) => true or false - * - * Returns true if any member of enum equals - * obj. Equality is tested using ==. - * - * IO.constants.include? "SEEK_SET" #=> true - * IO.constants.include? "SEEK_NO_FURTHER" #=> false - * - */ - -static VALUE -enum_member(obj, val) - VALUE obj, val; -{ - VALUE memo[2]; - - memo[0] = val; - memo[1] = Qfalse; - rb_iterate(rb_each, obj, member_i, (VALUE)memo); - return memo[1]; -} - -static VALUE -each_with_index_i(val, memo) - VALUE val; - VALUE *memo; -{ - rb_yield_values(2, val, INT2FIX(*memo)); - ++*memo; - return Qnil; -} - -/* - * call-seq: - * enum.each_with_index {|obj, i| block } -> enum - * - * Calls block with two arguments, the item and its index, for - * each item in enum. - * - * hash = Hash.new - * %w(cat dog wombat).each_with_index {|item, index| - * hash[item] = index - * } - * hash #=> {"cat"=>0, "wombat"=>2, "dog"=>1} - * - */ - -static VALUE -enum_each_with_index(obj) - VALUE obj; -{ - VALUE memo = 0; - - rb_need_block(); - rb_iterate(rb_each, obj, each_with_index_i, (VALUE)&memo); - return obj; -} - -static VALUE -zip_i(val, memo) - VALUE val; - VALUE *memo; -{ - VALUE result = memo[0]; - VALUE args = memo[1]; - int idx = memo[2]++; - VALUE tmp; - int i; - - tmp = rb_ary_new2(RARRAY(args)->len + 1); - rb_ary_store(tmp, 0, val); - for (i=0; ilen; i++) { - rb_ary_push(tmp, rb_ary_entry(RARRAY(args)->ptr[i], idx)); - } - if (rb_block_given_p()) { - rb_yield(tmp); - } - else { - rb_ary_push(result, tmp); - } - return Qnil; -} - -/* - * call-seq: - * enum.zip(arg, ...) => array - * enum.zip(arg, ...) {|arr| block } => nil - * - * Converts any arguments to arrays, then merges elements of - * enum with corresponding elements from each argument. This - * generates a sequence of enum#size n-element - * arrays, where n is one more that the count of arguments. If - * the size of any argument is less than enum#size, - * nil values are supplied. If a block given, it is - * invoked for each output array, otherwise an array of arrays is - * returned. - * - * a = [ 4, 5, 6 ] - * b = [ 7, 8, 9 ] - * - * (1..3).zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]] - * "cat\ndog".zip([1]) #=> [["cat\n", 1], ["dog", nil]] - * (1..3).zip #=> [[1], [2], [3]] - * - */ - -static VALUE -enum_zip(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - int i; - VALUE result; - VALUE memo[3]; - - for (i=0; iEnumerable mixin provides collection classes with - * several traversal and searching methods, and with the ability to - * sort. The class must provide a method each, which - * yields successive members of the collection. If - * Enumerable#max, #min, or - * #sort is used, the objects in the collection must also - * implement a meaningful <=> operator, as these methods - * rely on an ordering between members of the collection. - */ - -void -Init_Enumerable() -{ - rb_mEnumerable = rb_define_module("Enumerable"); - - rb_define_method(rb_mEnumerable,"to_a", enum_to_a, 0); - rb_define_method(rb_mEnumerable,"entries", enum_to_a, 0); - - rb_define_method(rb_mEnumerable,"sort", enum_sort, 0); - rb_define_method(rb_mEnumerable,"sort_by", enum_sort_by, 0); - rb_define_method(rb_mEnumerable,"grep", enum_grep, 1); - rb_define_method(rb_mEnumerable,"find", enum_find, -1); - rb_define_method(rb_mEnumerable,"detect", enum_find, -1); - rb_define_method(rb_mEnumerable,"find_all", enum_find_all, 0); - rb_define_method(rb_mEnumerable,"select", enum_find_all, 0); - rb_define_method(rb_mEnumerable,"reject", enum_reject, 0); - rb_define_method(rb_mEnumerable,"collect", enum_collect, 0); - rb_define_method(rb_mEnumerable,"map", enum_collect, 0); - rb_define_method(rb_mEnumerable,"inject", enum_inject, -1); - rb_define_method(rb_mEnumerable,"partition", enum_partition, 0); - rb_define_method(rb_mEnumerable,"all?", enum_all, 0); - rb_define_method(rb_mEnumerable,"any?", enum_any, 0); - rb_define_method(rb_mEnumerable,"min", enum_min, 0); - rb_define_method(rb_mEnumerable,"max", enum_max, 0); - rb_define_method(rb_mEnumerable,"member?", enum_member, 1); - rb_define_method(rb_mEnumerable,"include?", enum_member, 1); - rb_define_method(rb_mEnumerable,"each_with_index", enum_each_with_index, 0); - rb_define_method(rb_mEnumerable, "zip", enum_zip, -1); - - id_eqq = rb_intern("==="); - id_each = rb_intern("each"); - id_cmp = rb_intern("<=>"); -} - -/********************************************************************** - - error.c - - - $Author: shyouhei $ - $Date: 2008-08-04 05:16:55 +0200 (Mon, 04 Aug 2008) $ - created at: Mon Aug 9 16:11:34 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include "env.h" -#include "st.h" - -#include -#ifdef HAVE_STDARG_PROTOTYPES -#include -#define va_init_list(a,b) va_start(a,b) -#else -#include -#define va_init_list(a,b) va_start(a) -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif - -extern const char ruby_version[], ruby_release_date[], ruby_platform[]; - -int ruby_nerrs; - -static int -err_position(buf, len) - char *buf; - long len; -{ - ruby_set_current_source(); - if (!ruby_sourcefile) { - return 0; - } - else if (ruby_sourceline == 0) { - return snprintf(buf, len, "%s: ", ruby_sourcefile); - } - else { - return snprintf(buf, len, "%s:%d: ", ruby_sourcefile, ruby_sourceline); - } -} - -static void -err_snprintf(buf, len, fmt, args) - char *buf; - long len; - const char *fmt; - va_list args; -{ - long n; - - n = err_position(buf, len); - if (len > n) { - vsnprintf((char*)buf+n, len-n, fmt, args); - } -} - -static void err_append _((const char*)); -static void -err_print(fmt, args) - const char *fmt; - va_list args; -{ - char buf[BUFSIZ]; - - err_snprintf(buf, BUFSIZ, fmt, args); - err_append(buf); -} - -void -#ifdef HAVE_STDARG_PROTOTYPES -rb_compile_error(const char *fmt, ...) -#else -rb_compile_error(fmt, va_alist) - const char *fmt; - va_dcl -#endif -{ - va_list args; - - va_init_list(args, fmt); - err_print(fmt, args); - va_end(args); - ruby_nerrs++; -} - -void -#ifdef HAVE_STDARG_PROTOTYPES -rb_compile_error_append(const char *fmt, ...) -#else -rb_compile_error_append(fmt, va_alist) - const char *fmt; - va_dcl -#endif -{ - va_list args; - char buf[BUFSIZ]; - - va_init_list(args, fmt); - vsnprintf(buf, BUFSIZ, fmt, args); - va_end(args); - err_append(buf); -} - -static void -warn_print(fmt, args) - const char *fmt; - va_list args; -{ - char buf[BUFSIZ]; - int len; - - err_snprintf(buf, BUFSIZ, fmt, args); - len = strlen(buf); - buf[len++] = '\n'; - rb_write_error2(buf, len); -} - -void -#ifdef HAVE_STDARG_PROTOTYPES -rb_warn(const char *fmt, ...) -#else -rb_warn(fmt, va_alist) - const char *fmt; - va_dcl -#endif -{ - char buf[BUFSIZ]; - va_list args; - - if (NIL_P(ruby_verbose)) return; - - snprintf(buf, BUFSIZ, "warning: %s", fmt); - - va_init_list(args, fmt); - warn_print(buf, args); - va_end(args); -} - -/* rb_warning() reports only in verbose mode */ -void -#ifdef HAVE_STDARG_PROTOTYPES -rb_warning(const char *fmt, ...) -#else -rb_warning(fmt, va_alist) - const char *fmt; - va_dcl -#endif -{ - char buf[BUFSIZ]; - va_list args; - - if (!RTEST(ruby_verbose)) return; - - snprintf(buf, BUFSIZ, "warning: %s", fmt); - - va_init_list(args, fmt); - warn_print(buf, args); - va_end(args); -} - -/* - * call-seq: - * warn(msg) => nil - * - * Display the given message (followed by a newline) on STDERR unless - * warnings are disabled (for example with the -W0 flag). - */ - -static VALUE -rb_warn_m(self, mesg) - VALUE self, mesg; -{ - if (!NIL_P(ruby_verbose)) { - rb_io_write(rb_stderr, mesg); - rb_io_write(rb_stderr, rb_default_rs); - } - return Qnil; -} - -void -#ifdef HAVE_STDARG_PROTOTYPES -rb_bug(const char *fmt, ...) -#else -rb_bug(fmt, va_alist) - const char *fmt; - va_dcl -#endif -{ - char buf[BUFSIZ]; - va_list args; - FILE *out = stderr; - int len = err_position(buf, BUFSIZ); - - if (fwrite(buf, 1, len, out) == len || - fwrite(buf, 1, len, (out = stdout)) == len) { - fputs("[BUG] ", out); - va_init_list(args, fmt); - vfprintf(out, fmt, args); - va_end(args); - fprintf(out, "\nruby %s (%s) [%s]\n\n", - ruby_version, ruby_release_date, ruby_platform); - } - abort(); -} - -static struct types { - int type; - const char *name; -} builtin_types[] = { - {T_NIL, "nil"}, - {T_OBJECT, "Object"}, - {T_CLASS, "Class"}, - {T_ICLASS, "iClass"}, /* internal use: mixed-in module holder */ - {T_MODULE, "Module"}, - {T_FLOAT, "Float"}, - {T_STRING, "String"}, - {T_REGEXP, "Regexp"}, - {T_ARRAY, "Array"}, - {T_FIXNUM, "Fixnum"}, - {T_HASH, "Hash"}, - {T_STRUCT, "Struct"}, - {T_BIGNUM, "Bignum"}, - {T_FILE, "File"}, - {T_TRUE, "true"}, - {T_FALSE, "false"}, - {T_SYMBOL, "Symbol"}, /* :symbol */ - {T_DATA, "Data"}, /* internal use: wrapped C pointers */ - {T_MATCH, "MatchData"}, /* data of $~ */ - {T_VARMAP, "Varmap"}, /* internal use: dynamic variables */ - {T_SCOPE, "Scope"}, /* internal use: variable scope */ - {T_NODE, "Node"}, /* internal use: syntax tree node */ - {T_UNDEF, "undef"}, /* internal use: #undef; should not happen */ - {-1, 0} -}; - -void -rb_check_type(x, t) - VALUE x; - int t; -{ - struct types *type = builtin_types; - - if (x == Qundef) { - rb_bug("undef leaked to the Ruby space"); - } - - if (TYPE(x) != t) { - while (type->type >= 0) { - if (type->type == t) { - char *etype; - - if (NIL_P(x)) { - etype = "nil"; - } - else if (FIXNUM_P(x)) { - etype = "Fixnum"; - } - else if (SYMBOL_P(x)) { - etype = "Symbol"; - } - else if (rb_special_const_p(x)) { - etype = RSTRING(rb_obj_as_string(x))->ptr; - } - else { - etype = rb_obj_classname(x); - } - rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)", - etype, type->name); - } - type++; - } - rb_bug("unknown type 0x%x", t); - } -} - -/* exception classes */ -#include - -VALUE rb_eException; -VALUE rb_eSystemExit; -VALUE rb_eInterrupt; -VALUE rb_eSignal; -VALUE rb_eFatal; -VALUE rb_eStandardError; -VALUE rb_eRuntimeError; -VALUE rb_eTypeError; -VALUE rb_eArgError; -VALUE rb_eIndexError; -VALUE rb_eRangeError; -VALUE rb_eNameError; -VALUE rb_eNoMethodError; -VALUE rb_eSecurityError; -VALUE rb_eNotImpError; -VALUE rb_eNoMemError; -VALUE rb_cNameErrorMesg; - -VALUE rb_eScriptError; -VALUE rb_eSyntaxError; -VALUE rb_eLoadError; - -VALUE rb_eSystemCallError; -VALUE rb_mErrno; - -VALUE -rb_exc_new(etype, ptr, len) - VALUE etype; - const char *ptr; - long len; -{ - return rb_funcall(etype, rb_intern("new"), 1, rb_str_new(ptr, len)); -} - -VALUE -rb_exc_new2(etype, s) - VALUE etype; - const char *s; -{ - return rb_exc_new(etype, s, strlen(s)); -} - -VALUE -rb_exc_new3(etype, str) - VALUE etype, str; -{ - StringValue(str); - return rb_funcall(etype, rb_intern("new"), 1, str); -} - -/* - * call-seq: - * Exception.new(msg = nil) => exception - * - * Construct a new Exception object, optionally passing in - * a message. - */ - -static VALUE -exc_initialize(argc, argv, exc) - int argc; - VALUE *argv; - VALUE exc; -{ - VALUE arg; - - rb_scan_args(argc, argv, "01", &arg); - rb_iv_set(exc, "mesg", arg); - rb_iv_set(exc, "bt", Qnil); - - return exc; -} - -/* - * Document-method: exception - * - * call-seq: - * exc.exception(string) -> an_exception or exc - * - * With no argument, or if the argument is the same as the receiver, - * return the receiver. Otherwise, create a new - * exception object of the same class as the receiver, but with a - * message equal to string.to_str. - * - */ - -static VALUE -exc_exception(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; -{ - VALUE exc; - - if (argc == 0) return self; - if (argc == 1 && self == argv[0]) return self; - exc = rb_obj_clone(self); - exc_initialize(argc, argv, exc); - - return exc; -} - -/* - * call-seq: - * exception.to_s => string - * - * Returns exception's message (or the name of the exception if - * no message is set). - */ - -static VALUE -exc_to_s(exc) - VALUE exc; -{ - VALUE mesg = rb_attr_get(exc, rb_intern("mesg")); - - if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc)); - if (OBJ_TAINTED(exc)) OBJ_TAINT(mesg); - return mesg; -} - -/* - * call-seq: - * exception.message => string - * exception.to_str => string - * - * Returns the result of invoking exception.to_s. - * Normally this returns the exception's message or name. By - * supplying a to_str method, exceptions are agreeing to - * be used where Strings are expected. - */ - -static VALUE -exc_to_str(exc) - VALUE exc; -{ - return rb_funcall(exc, rb_intern("to_s"), 0, 0); -} - -/* - * call-seq: - * exception.inspect => string - * - * Return this exception's class name an message - */ - -static VALUE -exc_inspect(exc) - VALUE exc; -{ - VALUE str, klass; - - klass = CLASS_OF(exc); - exc = rb_obj_as_string(exc); - if (RSTRING(exc)->len == 0) { - return rb_str_dup(rb_class_name(klass)); - } - - str = rb_str_buf_new2("#<"); - klass = rb_class_name(klass); - rb_str_buf_append(str, klass); - rb_str_buf_cat(str, ": ", 2); - rb_str_buf_append(str, exc); - rb_str_buf_cat(str, ">", 1); - - return str; -} - -/* - * call-seq: - * exception.backtrace => array - * - * Returns any backtrace associated with the exception. The backtrace - * is an array of strings, each containing either ``filename:lineNo: in - * `method''' or ``filename:lineNo.'' - * - * def a - * raise "boom" - * end - * - * def b - * a() - * end - * - * begin - * b() - * rescue => detail - * print detail.backtrace.join("\n") - * end - * - * produces: - * - * prog.rb:2:in `a' - * prog.rb:6:in `b' - * prog.rb:10 -*/ - -static VALUE -exc_backtrace(exc) - VALUE exc; -{ - static ID bt; - - if (!bt) bt = rb_intern("bt"); - return rb_attr_get(exc, bt); -} - -VALUE -rb_check_backtrace(bt) - VALUE bt; -{ - long i; - static char *err = "backtrace must be Array of String"; - - if (!NIL_P(bt)) { - int t = TYPE(bt); - - if (t == T_STRING) return rb_ary_new3(1, bt); - if (t != T_ARRAY) { - rb_raise(rb_eTypeError, err); - } - for (i=0;ilen;i++) { - if (TYPE(RARRAY(bt)->ptr[i]) != T_STRING) { - rb_raise(rb_eTypeError, err); - } - } - } - return bt; -} - -/* - * call-seq: - * exc.set_backtrace(array) => array - * - * Sets the backtrace information associated with exc. The - * argument must be an array of String objects in the - * format described in Exception#backtrace. - * - */ - -static VALUE -exc_set_backtrace(exc, bt) - VALUE exc; - VALUE bt; -{ - return rb_iv_set(exc, "bt", rb_check_backtrace(bt)); -} - -/* - * call-seq: - * SystemExit.new(status=0) => system_exit - * - * Create a new +SystemExit+ exception with the given status. - */ - -static VALUE -exit_initialize(argc, argv, exc) - int argc; - VALUE *argv; - VALUE exc; -{ - VALUE status = INT2FIX(EXIT_SUCCESS); - if (argc > 0 && FIXNUM_P(argv[0])) { - status = *argv++; - --argc; - } - rb_call_super(argc, argv); - rb_iv_set(exc, "status", status); - return exc; -} - - -/* - * call-seq: - * system_exit.status => fixnum - * - * Return the status value associated with this system exit. - */ - -static VALUE -exit_status(exc) - VALUE exc; -{ - return rb_attr_get(exc, rb_intern("status")); -} - - -/* - * call-seq: - * system_exit.success? => true or false - * - * Returns +true+ if exiting successful, +false+ if not. - */ - -static VALUE -exit_success_p(exc) - VALUE exc; -{ - VALUE status = rb_attr_get(exc, rb_intern("status")); - if (NIL_P(status)) return Qtrue; - if (status == INT2FIX(EXIT_SUCCESS)) return Qtrue; - return Qfalse; -} - -void -#ifdef HAVE_STDARG_PROTOTYPES -rb_name_error(ID id, const char *fmt, ...) -#else -rb_name_error(id, fmt, va_alist) - ID id; - const char *fmt; - va_dcl -#endif -{ - VALUE exc, argv[2]; - va_list args; - char buf[BUFSIZ]; - - va_init_list(args, fmt); - vsnprintf(buf, BUFSIZ, fmt, args); - va_end(args); - - argv[0] = rb_str_new2(buf); - argv[1] = ID2SYM(id); - exc = rb_class_new_instance(2, argv, rb_eNameError); - rb_exc_raise(exc); -} - -/* - * call-seq: - * NameError.new(msg [, name]) => name_error - * - * Construct a new NameError exception. If given the name - * parameter may subsequently be examined using the NameError.name - * method. - */ - -static VALUE -name_err_initialize(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; -{ - VALUE name; - - name = (argc > 1) ? argv[--argc] : Qnil; - rb_call_super(argc, argv); - rb_iv_set(self, "name", name); - return self; -} - -/* - * call-seq: - * name_error.name => string or nil - * - * Return the name associated with this NameError exception. - */ - -static VALUE -name_err_name(self) - VALUE self; -{ - return rb_attr_get(self, rb_intern("name")); -} - -/* - * call-seq: - * name_error.to_s => string - * - * Produce a nicely-formated string representing the +NameError+. - */ - -static VALUE -name_err_to_s(exc) - VALUE exc; -{ - VALUE mesg = rb_attr_get(exc, rb_intern("mesg")), str = mesg; - - if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc)); - StringValue(str); - if (str != mesg) { - rb_iv_set(exc, "mesg", mesg = str); - } - if (OBJ_TAINTED(exc)) OBJ_TAINT(mesg); - return mesg; -} - -/* - * call-seq: - * NoMethodError.new(msg, name [, args]) => no_method_error - * - * Construct a NoMethodError exception for a method of the given name - * called with the given arguments. The name may be accessed using - * the #name method on the resulting object, and the - * arguments using the #args method. - */ - -static VALUE -nometh_err_initialize(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; -{ - VALUE args = (argc > 2) ? argv[--argc] : Qnil; - name_err_initialize(argc, argv, self); - rb_iv_set(self, "args", args); - return self; -} - -/* :nodoc: */ -static void -name_err_mesg_mark(ptr) - VALUE *ptr; -{ - rb_gc_mark_locations(ptr, ptr+3); -} - -/* :nodoc: */ -static VALUE -name_err_mesg_new(obj, mesg, recv, method) - VALUE obj, mesg, recv, method; -{ - VALUE *ptr = ALLOC_N(VALUE, 3); - - ptr[0] = mesg; - ptr[1] = recv; - ptr[2] = method; - return Data_Wrap_Struct(rb_cNameErrorMesg, name_err_mesg_mark, -1, ptr); -} - -/* :nodoc: */ -static VALUE -name_err_mesg_to_str(obj) - VALUE obj; -{ - VALUE *ptr, mesg; - Data_Get_Struct(obj, VALUE, ptr); - - mesg = ptr[0]; - if (NIL_P(mesg)) return Qnil; - else { - char *desc = 0; - VALUE d = 0, args[3]; - - obj = ptr[1]; - switch (TYPE(obj)) { - case T_NIL: - desc = "nil"; - break; - case T_TRUE: - desc = "true"; - break; - case T_FALSE: - desc = "false"; - break; - default: - d = rb_protect(rb_inspect, obj, 0); - if (NIL_P(d) || RSTRING(d)->len > 65) { - d = rb_any_to_s(obj); - } - desc = RSTRING(d)->ptr; - break; - } - if (desc && desc[0] != '#') { - d = rb_str_new2(desc); - rb_str_cat2(d, ":"); - rb_str_cat2(d, rb_obj_classname(obj)); - } - args[0] = mesg; - args[1] = ptr[2]; - args[2] = d; - mesg = rb_f_sprintf(3, args); - } - if (OBJ_TAINTED(obj)) OBJ_TAINT(mesg); - return mesg; -} - -/* :nodoc: */ -static VALUE -name_err_mesg_load(klass, str) - VALUE klass, str; -{ - return str; -} - -/* - * call-seq: - * no_method_error.args => obj - * - * Return the arguments passed in as the third parameter to - * the constructor. - */ - -static VALUE -nometh_err_args(self) - VALUE self; -{ - return rb_attr_get(self, rb_intern("args")); -} - -void -rb_invalid_str(str, type) - const char *str, *type; -{ - VALUE s = rb_str_inspect(rb_str_new2(str)); - - rb_raise(rb_eArgError, "invalid value for %s: %s", type, RSTRING(s)->ptr); -} - -/* - * Document-module: Errno - * - * Ruby exception objects are subclasses of Exception. - * However, operating systems typically report errors using plain - * integers. Module Errno is created dynamically to map - * these operating system errors to Ruby classes, with each error - * number generating its own subclass of SystemCallError. - * As the subclass is created in module Errno, its name - * will start Errno::. - * - * The names of the Errno:: classes depend on - * the environment in which Ruby runs. On a typical Unix or Windows - * platform, there are Errno classes such as - * Errno::EACCES, Errno::EAGAIN, - * Errno::EINTR, and so on. - * - * The integer operating system error number corresponding to a - * particular error is available as the class constant - * Errno::error::Errno. - * - * Errno::EACCES::Errno #=> 13 - * Errno::EAGAIN::Errno #=> 11 - * Errno::EINTR::Errno #=> 4 - * - * The full list of operating system errors on your particular platform - * are available as the constants of Errno. - * - * Errno.constants #=> E2BIG, EACCES, EADDRINUSE, EADDRNOTAVAIL, ... - */ - -static st_table *syserr_tbl; - -static VALUE -set_syserr(n, name) - int n; - const char *name; -{ - VALUE error; - - if (!st_lookup(syserr_tbl, n, &error)) { - error = rb_define_class_under(rb_mErrno, name, rb_eSystemCallError); - rb_define_const(error, "Errno", INT2NUM(n)); - st_add_direct(syserr_tbl, n, error); - } - else { - rb_define_const(rb_mErrno, name, error); - } - return error; -} - -static VALUE -get_syserr(n) - int n; -{ - VALUE error; - - if (!st_lookup(syserr_tbl, n, &error)) { - char name[8]; /* some Windows' errno have 5 digits. */ - - snprintf(name, sizeof(name), "E%03d", n); - error = set_syserr(n, name); - } - return error; -} - -/* - * call-seq: - * SystemCallError.new(msg, errno) => system_call_error_subclass - * - * If _errno_ corresponds to a known system error code, constructs - * the appropriate Errno class for that error, otherwise - * constructs a generic SystemCallError object. The - * error number is subsequently available via the errno - * method. - */ - -static VALUE -syserr_initialize(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; -{ -#if !defined(_WIN32) && !defined(__VMS) - char *strerror(); -#endif - char *err; - VALUE mesg, error; - VALUE klass = rb_obj_class(self); - - if (klass == rb_eSystemCallError) { - rb_scan_args(argc, argv, "11", &mesg, &error); - if (argc == 1 && FIXNUM_P(mesg)) { - error = mesg; mesg = Qnil; - } - if (!NIL_P(error) && st_lookup(syserr_tbl, NUM2LONG(error), &klass)) { - /* change class */ - if (TYPE(self) != T_OBJECT) { /* insurance to avoid type crash */ - rb_raise(rb_eTypeError, "invalid instance type"); - } - RBASIC(self)->klass = klass; - } - } - else { - rb_scan_args(argc, argv, "01", &mesg); - error = rb_const_get(klass, rb_intern("Errno")); - } - if (!NIL_P(error)) err = strerror(NUM2LONG(error)); - else err = "unknown error"; - if (!NIL_P(mesg)) { - VALUE str = mesg; - size_t len; - - StringValue(str); - len = strlen(err)+RSTRING(str)->len+3; - mesg = rb_str_new(0, len); - snprintf(RSTRING(mesg)->ptr, len+1, "%s - %.*s", err, - (int)RSTRING(str)->len, RSTRING(str)->ptr); - rb_str_resize(mesg, strlen(RSTRING(mesg)->ptr)); - } - else { - mesg = rb_str_new2(err); - } - rb_call_super(1, &mesg); - rb_iv_set(self, "errno", error); - return self; -} - -/* - * call-seq: - * system_call_error.errno => fixnum - * - * Return this SystemCallError's error number. - */ - -static VALUE -syserr_errno(self) - VALUE self; -{ - return rb_attr_get(self, rb_intern("errno")); -} - -/* - * call-seq: - * system_call_error === other => true or false - * - * Return +true+ if the receiver is a generic +SystemCallError+, or - * if the error numbers _self_ and _other_ are the same. - */ - - -static VALUE -syserr_eqq(self, exc) - VALUE self, exc; -{ - VALUE num, e; - - if (!rb_obj_is_kind_of(exc, rb_eSystemCallError)) return Qfalse; - if (self == rb_eSystemCallError) return Qtrue; - - num = rb_attr_get(exc, rb_intern("errno")); - if (NIL_P(num)) { - VALUE klass = CLASS_OF(exc); - - while (TYPE(klass) == T_ICLASS || FL_TEST(klass, FL_SINGLETON)) { - klass = (VALUE)RCLASS(klass)->super; - } - num = rb_const_get(klass, rb_intern("Errno")); - } - e = rb_const_get(self, rb_intern("Errno")); - if (FIXNUM_P(num) ? num == e : rb_equal(num, e)) - return Qtrue; - return Qfalse; -} - -/* - * Descendents of class Exception are used to communicate - * between raise methods and rescue - * statements in begin/end blocks. Exception - * objects carry information about the exception---its type (the - * exception's class name), an optional descriptive string, and - * optional traceback information. Programs may subclass - * Exception to add additional information. - */ - -void -Init_Exception() -{ - rb_eException = rb_define_class("Exception", rb_cObject); - rb_define_singleton_method(rb_eException, "exception", rb_class_new_instance, -1); - rb_define_method(rb_eException, "exception", exc_exception, -1); - rb_define_method(rb_eException, "initialize", exc_initialize, -1); - rb_define_method(rb_eException, "to_s", exc_to_s, 0); - rb_define_method(rb_eException, "to_str", exc_to_str, 0); - rb_define_method(rb_eException, "message", exc_to_str, 0); - rb_define_method(rb_eException, "inspect", exc_inspect, 0); - rb_define_method(rb_eException, "backtrace", exc_backtrace, 0); - rb_define_method(rb_eException, "set_backtrace", exc_set_backtrace, 1); - - rb_eSystemExit = rb_define_class("SystemExit", rb_eException); - rb_define_method(rb_eSystemExit, "initialize", exit_initialize, -1); - rb_define_method(rb_eSystemExit, "status", exit_status, 0); - rb_define_method(rb_eSystemExit, "success?", exit_success_p, 0); - - rb_eFatal = rb_define_class("fatal", rb_eException); - rb_eSignal = rb_define_class("SignalException", rb_eException); - rb_eInterrupt = rb_define_class("Interrupt", rb_eSignal); - - rb_eStandardError = rb_define_class("StandardError", rb_eException); - rb_eTypeError = rb_define_class("TypeError", rb_eStandardError); - rb_eArgError = rb_define_class("ArgumentError", rb_eStandardError); - rb_eIndexError = rb_define_class("IndexError", rb_eStandardError); - rb_eRangeError = rb_define_class("RangeError", rb_eStandardError); - rb_eNameError = rb_define_class("NameError", rb_eStandardError); - rb_define_method(rb_eNameError, "initialize", name_err_initialize, -1); - rb_define_method(rb_eNameError, "name", name_err_name, 0); - rb_define_method(rb_eNameError, "to_s", name_err_to_s, 0); - rb_cNameErrorMesg = rb_define_class_under(rb_eNameError, "message", rb_cData); - rb_define_singleton_method(rb_cNameErrorMesg, "!", name_err_mesg_new, 3); - rb_define_method(rb_cNameErrorMesg, "to_str", name_err_mesg_to_str, 0); - rb_define_method(rb_cNameErrorMesg, "_dump", name_err_mesg_to_str, 1); - rb_define_singleton_method(rb_cNameErrorMesg, "_load", name_err_mesg_load, 1); - rb_eNoMethodError = rb_define_class("NoMethodError", rb_eNameError); - rb_define_method(rb_eNoMethodError, "initialize", nometh_err_initialize, -1); - rb_define_method(rb_eNoMethodError, "args", nometh_err_args, 0); - - rb_eScriptError = rb_define_class("ScriptError", rb_eException); - rb_eSyntaxError = rb_define_class("SyntaxError", rb_eScriptError); - rb_eLoadError = rb_define_class("LoadError", rb_eScriptError); - rb_eNotImpError = rb_define_class("NotImplementedError", rb_eScriptError); - - rb_eRuntimeError = rb_define_class("RuntimeError", rb_eStandardError); - rb_eSecurityError = rb_define_class("SecurityError", rb_eStandardError); - rb_eNoMemError = rb_define_class("NoMemoryError", rb_eException); - - syserr_tbl = st_init_numtable(); - rb_eSystemCallError = rb_define_class("SystemCallError", rb_eStandardError); - rb_define_method(rb_eSystemCallError, "initialize", syserr_initialize, -1); - rb_define_method(rb_eSystemCallError, "errno", syserr_errno, 0); - rb_define_singleton_method(rb_eSystemCallError, "===", syserr_eqq, 1); - - rb_mErrno = rb_define_module("Errno"); - - rb_define_global_function("warn", rb_warn_m, 1); -} - -void -#ifdef HAVE_STDARG_PROTOTYPES -rb_raise(VALUE exc, const char *fmt, ...) -#else -rb_raise(exc, fmt, va_alist) - VALUE exc; - const char *fmt; - va_dcl -#endif -{ - va_list args; - char buf[BUFSIZ]; - - va_init_list(args,fmt); - vsnprintf(buf, BUFSIZ, fmt, args); - va_end(args); - rb_exc_raise(rb_exc_new2(exc, buf)); -} - -void -#ifdef HAVE_STDARG_PROTOTYPES -rb_loaderror(const char *fmt, ...) -#else -rb_loaderror(fmt, va_alist) - const char *fmt; - va_dcl -#endif -{ - va_list args; - char buf[BUFSIZ]; - - va_init_list(args, fmt); - vsnprintf(buf, BUFSIZ, fmt, args); - va_end(args); - rb_exc_raise(rb_exc_new2(rb_eLoadError, buf)); -} - -void -rb_notimplement() -{ - rb_raise(rb_eNotImpError, - "%s() function is unimplemented on this machine", - rb_id2name(ruby_frame->last_func)); -} - -void -#ifdef HAVE_STDARG_PROTOTYPES -rb_fatal(const char *fmt, ...) -#else -rb_fatal(fmt, va_alist) - const char *fmt; - va_dcl -#endif -{ - va_list args; - char buf[BUFSIZ]; - - va_init_list(args, fmt); - vsnprintf(buf, BUFSIZ, fmt, args); - va_end(args); - - ruby_in_eval = 0; - rb_exc_fatal(rb_exc_new2(rb_eFatal, buf)); -} - -void -rb_sys_fail(mesg) - const char *mesg; -{ - int n = errno; - VALUE arg; - - errno = 0; - if (n == 0) { - rb_bug("rb_sys_fail(%s) - errno == 0", mesg ? mesg : ""); - } - - arg = mesg ? rb_str_new2(mesg) : Qnil; - rb_exc_raise(rb_class_new_instance(1, &arg, get_syserr(n))); -} - -void -#ifdef HAVE_STDARG_PROTOTYPES -rb_sys_warning(const char *fmt, ...) -#else -rb_sys_warning(fmt, va_alist) - const char *fmt; - va_dcl -#endif -{ - char buf[BUFSIZ]; - va_list args; - int errno_save; - - errno_save = errno; - - if (!RTEST(ruby_verbose)) return; - - snprintf(buf, BUFSIZ, "warning: %s", fmt); - snprintf(buf+strlen(buf), BUFSIZ-strlen(buf), ": %s", strerror(errno_save)); - - va_init_list(args, fmt); - warn_print(buf, args); - va_end(args); - errno = errno_save; -} - -void -rb_load_fail(path) - const char *path; -{ - rb_loaderror("%s -- %s", strerror(errno), path); -} - -void -rb_error_frozen(what) - const char *what; -{ - rb_raise(rb_eTypeError, "can't modify frozen %s", what); -} - -void -rb_check_frozen(obj) - VALUE obj; -{ - if (OBJ_FROZEN(obj)) rb_error_frozen(rb_obj_classname(obj)); -} - -void -Init_syserr() -{ -#ifdef EPERM - set_syserr(EPERM, "EPERM"); -#endif -#ifdef ENOENT - set_syserr(ENOENT, "ENOENT"); -#endif -#ifdef ESRCH - set_syserr(ESRCH, "ESRCH"); -#endif -#ifdef EINTR - set_syserr(EINTR, "EINTR"); -#endif -#ifdef EIO - set_syserr(EIO, "EIO"); -#endif -#ifdef ENXIO - set_syserr(ENXIO, "ENXIO"); -#endif -#ifdef E2BIG - set_syserr(E2BIG, "E2BIG"); -#endif -#ifdef ENOEXEC - set_syserr(ENOEXEC, "ENOEXEC"); -#endif -#ifdef EBADF - set_syserr(EBADF, "EBADF"); -#endif -#ifdef ECHILD - set_syserr(ECHILD, "ECHILD"); -#endif -#ifdef EAGAIN - set_syserr(EAGAIN, "EAGAIN"); -#endif -#ifdef ENOMEM - set_syserr(ENOMEM, "ENOMEM"); -#endif -#ifdef EACCES - set_syserr(EACCES, "EACCES"); -#endif -#ifdef EFAULT - set_syserr(EFAULT, "EFAULT"); -#endif -#ifdef ENOTBLK - set_syserr(ENOTBLK, "ENOTBLK"); -#endif -#ifdef EBUSY - set_syserr(EBUSY, "EBUSY"); -#endif -#ifdef EEXIST - set_syserr(EEXIST, "EEXIST"); -#endif -#ifdef EXDEV - set_syserr(EXDEV, "EXDEV"); -#endif -#ifdef ENODEV - set_syserr(ENODEV, "ENODEV"); -#endif -#ifdef ENOTDIR - set_syserr(ENOTDIR, "ENOTDIR"); -#endif -#ifdef EISDIR - set_syserr(EISDIR, "EISDIR"); -#endif -#ifdef EINVAL - set_syserr(EINVAL, "EINVAL"); -#endif -#ifdef ENFILE - set_syserr(ENFILE, "ENFILE"); -#endif -#ifdef EMFILE - set_syserr(EMFILE, "EMFILE"); -#endif -#ifdef ENOTTY - set_syserr(ENOTTY, "ENOTTY"); -#endif -#ifdef ETXTBSY - set_syserr(ETXTBSY, "ETXTBSY"); -#endif -#ifdef EFBIG - set_syserr(EFBIG, "EFBIG"); -#endif -#ifdef ENOSPC - set_syserr(ENOSPC, "ENOSPC"); -#endif -#ifdef ESPIPE - set_syserr(ESPIPE, "ESPIPE"); -#endif -#ifdef EROFS - set_syserr(EROFS, "EROFS"); -#endif -#ifdef EMLINK - set_syserr(EMLINK, "EMLINK"); -#endif -#ifdef EPIPE - set_syserr(EPIPE, "EPIPE"); -#endif -#ifdef EDOM - set_syserr(EDOM, "EDOM"); -#endif -#ifdef ERANGE - set_syserr(ERANGE, "ERANGE"); -#endif -#ifdef EDEADLK - set_syserr(EDEADLK, "EDEADLK"); -#endif -#ifdef ENAMETOOLONG - set_syserr(ENAMETOOLONG, "ENAMETOOLONG"); -#endif -#ifdef ENOLCK - set_syserr(ENOLCK, "ENOLCK"); -#endif -#ifdef ENOSYS - set_syserr(ENOSYS, "ENOSYS"); -#endif -#ifdef ENOTEMPTY - set_syserr(ENOTEMPTY, "ENOTEMPTY"); -#endif -#ifdef ELOOP - set_syserr(ELOOP, "ELOOP"); -#endif -#ifdef EWOULDBLOCK - set_syserr(EWOULDBLOCK, "EWOULDBLOCK"); -#endif -#ifdef ENOMSG - set_syserr(ENOMSG, "ENOMSG"); -#endif -#ifdef EIDRM - set_syserr(EIDRM, "EIDRM"); -#endif -#ifdef ECHRNG - set_syserr(ECHRNG, "ECHRNG"); -#endif -#ifdef EL2NSYNC - set_syserr(EL2NSYNC, "EL2NSYNC"); -#endif -#ifdef EL3HLT - set_syserr(EL3HLT, "EL3HLT"); -#endif -#ifdef EL3RST - set_syserr(EL3RST, "EL3RST"); -#endif -#ifdef ELNRNG - set_syserr(ELNRNG, "ELNRNG"); -#endif -#ifdef EUNATCH - set_syserr(EUNATCH, "EUNATCH"); -#endif -#ifdef ENOCSI - set_syserr(ENOCSI, "ENOCSI"); -#endif -#ifdef EL2HLT - set_syserr(EL2HLT, "EL2HLT"); -#endif -#ifdef EBADE - set_syserr(EBADE, "EBADE"); -#endif -#ifdef EBADR - set_syserr(EBADR, "EBADR"); -#endif -#ifdef EXFULL - set_syserr(EXFULL, "EXFULL"); -#endif -#ifdef ENOANO - set_syserr(ENOANO, "ENOANO"); -#endif -#ifdef EBADRQC - set_syserr(EBADRQC, "EBADRQC"); -#endif -#ifdef EBADSLT - set_syserr(EBADSLT, "EBADSLT"); -#endif -#ifdef EDEADLOCK - set_syserr(EDEADLOCK, "EDEADLOCK"); -#endif -#ifdef EBFONT - set_syserr(EBFONT, "EBFONT"); -#endif -#ifdef ENOSTR - set_syserr(ENOSTR, "ENOSTR"); -#endif -#ifdef ENODATA - set_syserr(ENODATA, "ENODATA"); -#endif -#ifdef ETIME - set_syserr(ETIME, "ETIME"); -#endif -#ifdef ENOSR - set_syserr(ENOSR, "ENOSR"); -#endif -#ifdef ENONET - set_syserr(ENONET, "ENONET"); -#endif -#ifdef ENOPKG - set_syserr(ENOPKG, "ENOPKG"); -#endif -#ifdef EREMOTE - set_syserr(EREMOTE, "EREMOTE"); -#endif -#ifdef ENOLINK - set_syserr(ENOLINK, "ENOLINK"); -#endif -#ifdef EADV - set_syserr(EADV, "EADV"); -#endif -#ifdef ESRMNT - set_syserr(ESRMNT, "ESRMNT"); -#endif -#ifdef ECOMM - set_syserr(ECOMM, "ECOMM"); -#endif -#ifdef EPROTO - set_syserr(EPROTO, "EPROTO"); -#endif -#ifdef EMULTIHOP - set_syserr(EMULTIHOP, "EMULTIHOP"); -#endif -#ifdef EDOTDOT - set_syserr(EDOTDOT, "EDOTDOT"); -#endif -#ifdef EBADMSG - set_syserr(EBADMSG, "EBADMSG"); -#endif -#ifdef EOVERFLOW - set_syserr(EOVERFLOW, "EOVERFLOW"); -#endif -#ifdef ENOTUNIQ - set_syserr(ENOTUNIQ, "ENOTUNIQ"); -#endif -#ifdef EBADFD - set_syserr(EBADFD, "EBADFD"); -#endif -#ifdef EREMCHG - set_syserr(EREMCHG, "EREMCHG"); -#endif -#ifdef ELIBACC - set_syserr(ELIBACC, "ELIBACC"); -#endif -#ifdef ELIBBAD - set_syserr(ELIBBAD, "ELIBBAD"); -#endif -#ifdef ELIBSCN - set_syserr(ELIBSCN, "ELIBSCN"); -#endif -#ifdef ELIBMAX - set_syserr(ELIBMAX, "ELIBMAX"); -#endif -#ifdef ELIBEXEC - set_syserr(ELIBEXEC, "ELIBEXEC"); -#endif -#ifdef EILSEQ - set_syserr(EILSEQ, "EILSEQ"); -#endif -#ifdef ERESTART - set_syserr(ERESTART, "ERESTART"); -#endif -#ifdef ESTRPIPE - set_syserr(ESTRPIPE, "ESTRPIPE"); -#endif -#ifdef EUSERS - set_syserr(EUSERS, "EUSERS"); -#endif -#ifdef ENOTSOCK - set_syserr(ENOTSOCK, "ENOTSOCK"); -#endif -#ifdef EDESTADDRREQ - set_syserr(EDESTADDRREQ, "EDESTADDRREQ"); -#endif -#ifdef EMSGSIZE - set_syserr(EMSGSIZE, "EMSGSIZE"); -#endif -#ifdef EPROTOTYPE - set_syserr(EPROTOTYPE, "EPROTOTYPE"); -#endif -#ifdef ENOPROTOOPT - set_syserr(ENOPROTOOPT, "ENOPROTOOPT"); -#endif -#ifdef EPROTONOSUPPORT - set_syserr(EPROTONOSUPPORT, "EPROTONOSUPPORT"); -#endif -#ifdef ESOCKTNOSUPPORT - set_syserr(ESOCKTNOSUPPORT, "ESOCKTNOSUPPORT"); -#endif -#ifdef EOPNOTSUPP - set_syserr(EOPNOTSUPP, "EOPNOTSUPP"); -#endif -#ifdef EPFNOSUPPORT - set_syserr(EPFNOSUPPORT, "EPFNOSUPPORT"); -#endif -#ifdef EAFNOSUPPORT - set_syserr(EAFNOSUPPORT, "EAFNOSUPPORT"); -#endif -#ifdef EADDRINUSE - set_syserr(EADDRINUSE, "EADDRINUSE"); -#endif -#ifdef EADDRNOTAVAIL - set_syserr(EADDRNOTAVAIL, "EADDRNOTAVAIL"); -#endif -#ifdef ENETDOWN - set_syserr(ENETDOWN, "ENETDOWN"); -#endif -#ifdef ENETUNREACH - set_syserr(ENETUNREACH, "ENETUNREACH"); -#endif -#ifdef ENETRESET - set_syserr(ENETRESET, "ENETRESET"); -#endif -#ifdef ECONNABORTED - set_syserr(ECONNABORTED, "ECONNABORTED"); -#endif -#ifdef ECONNRESET - set_syserr(ECONNRESET, "ECONNRESET"); -#endif -#ifdef ENOBUFS - set_syserr(ENOBUFS, "ENOBUFS"); -#endif -#ifdef EISCONN - set_syserr(EISCONN, "EISCONN"); -#endif -#ifdef ENOTCONN - set_syserr(ENOTCONN, "ENOTCONN"); -#endif -#ifdef ESHUTDOWN - set_syserr(ESHUTDOWN, "ESHUTDOWN"); -#endif -#ifdef ETOOMANYREFS - set_syserr(ETOOMANYREFS, "ETOOMANYREFS"); -#endif -#ifdef ETIMEDOUT - set_syserr(ETIMEDOUT, "ETIMEDOUT"); -#endif -#ifdef ECONNREFUSED - set_syserr(ECONNREFUSED, "ECONNREFUSED"); -#endif -#ifdef EHOSTDOWN - set_syserr(EHOSTDOWN, "EHOSTDOWN"); -#endif -#ifdef EHOSTUNREACH - set_syserr(EHOSTUNREACH, "EHOSTUNREACH"); -#endif -#ifdef EALREADY - set_syserr(EALREADY, "EALREADY"); -#endif -#ifdef EINPROGRESS - set_syserr(EINPROGRESS, "EINPROGRESS"); -#endif -#ifdef ESTALE - set_syserr(ESTALE, "ESTALE"); -#endif -#ifdef EUCLEAN - set_syserr(EUCLEAN, "EUCLEAN"); -#endif -#ifdef ENOTNAM - set_syserr(ENOTNAM, "ENOTNAM"); -#endif -#ifdef ENAVAIL - set_syserr(ENAVAIL, "ENAVAIL"); -#endif -#ifdef EISNAM - set_syserr(EISNAM, "EISNAM"); -#endif -#ifdef EREMOTEIO - set_syserr(EREMOTEIO, "EREMOTEIO"); -#endif -#ifdef EDQUOT - set_syserr(EDQUOT, "EDQUOT"); -#endif -} - -static void -err_append(s) - const char *s; -{ - extern VALUE ruby_errinfo; - - if (ruby_in_eval) { - if (NIL_P(ruby_errinfo)) { - ruby_errinfo = rb_exc_new2(rb_eSyntaxError, s); - } - else { - VALUE str = rb_obj_as_string(ruby_errinfo); - - rb_str_cat2(str, "\n"); - rb_str_cat2(str, s); - ruby_errinfo = rb_exc_new3(rb_eSyntaxError, str); - } - } - else { - rb_write_error(s); - rb_write_error("\n"); - } -} -/********************************************************************** - - eval.c - - - $Author: wyhaines $ - $Date: 2009-08-20 19:22:00 +0200 (Thu, 20 Aug 2009) $ - created at: Thu Jun 10 14:22:17 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#include "ruby.h" -#include "node.h" -#include "env.h" -#include "util.h" -#include "rubysig.h" - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif -#ifndef EXIT_FAILURE -#define EXIT_FAILURE 1 -#endif - -#include - -#include "st.h" -#include "dln.h" - -#ifdef __APPLE__ -#include -#endif - -/* Make alloca work the best possible way. */ -#ifdef __GNUC__ -# ifndef atarist -# ifndef alloca -# define alloca __builtin_alloca -# endif -# endif /* atarist */ -#else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifndef _AIX -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (); -# endif -# endif /* AIX */ -# endif /* HAVE_ALLOCA_H */ -#endif /* __GNUC__ */ - -#ifdef HAVE_STDARG_PROTOTYPES -#include -#define va_init_list(a,b) va_start(a,b) -#else -#include -#define va_init_list(a,b) va_start(a) -#endif - -#ifndef HAVE_STRING_H -char *strrchr _((const char*,const char)); -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#include - -#if defined(HAVE_FCNTL_H) || defined(_WIN32) -#include -#elif defined(HAVE_SYS_FCNTL_H) -#include -#endif -#ifdef __CYGWIN__ -#include -#endif - -#if defined(__BEOS__) && !defined(BONE) -#include -#endif - -#ifdef __MACOS__ -#include "macruby_private.h" -#endif - -#ifdef __VMS -#include "vmsruby_private.h" -#endif - -#ifdef USE_CONTEXT - -NORETURN(static void rb_jump_context(rb_jmpbuf_t, int)); -static inline void -rb_jump_context(env, val) - rb_jmpbuf_t env; - int val; -{ - env->status = val; - setcontext(&env->context); - abort(); /* ensure noreturn */ -} -/* - * PRE_GETCONTEXT and POST_GETCONTEXT is a magic for getcontext, gcc, - * IA64 register stack and SPARC register window combination problem. - * - * Assume following code sequence. - * - * 1. set a register in the register stack/window such as r32/l0. - * 2. call getcontext. - * 3. use the register. - * 4. update the register for other use. - * 5. call setcontext indirectly (or directly). - * - * This code should be run as 1->2->3->4->5->3->4. - * But after second getcontext return (second 3), - * the register is broken (updated). - * It's because getcontext/setcontext doesn't preserve the content of the - * register stack/window. - * - * setjmp also doesn't preserve the content of the register stack/window. - * But it has not the problem because gcc knows setjmp may return twice. - * gcc detects setjmp and generates setjmp safe code. - * - * So setjmp calls before and after the getcontext call makes the code - * somewhat safe. - * It fix the problem on IA64. - * It is not required that setjmp is called at run time, since the problem is - * register usage. - * - * Since the magic setjmp is not enough for SPARC, - * inline asm is used to prohibit registers in register windows. - * - * Since the problem is fixed at gcc 4.0.3, the magic is applied only for - * prior versions of gcc. - * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21957 - * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22127 - */ -# define GCC_VERSION_BEFORE(major, minor, patchlevel) \ - (defined(__GNUC__) && !defined(__INTEL_COMPILER) && \ - ((__GNUC__ < (major)) || \ - (__GNUC__ == (major) && __GNUC_MINOR__ < (minor)) || \ - (__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ < (patchlevel)))) -# if GCC_VERSION_BEFORE(4,0,3) && (defined(sparc) || defined(__sparc__)) -# ifdef __pic__ -/* - * %l7 is excluded for PIC because it is PIC register. - * http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html - */ -# define PRE_GETCONTEXT \ - ({ __asm__ volatile ("" : : : \ - "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \ - "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", \ - "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); }) -# else -# define PRE_GETCONTEXT \ - ({ __asm__ volatile ("" : : : \ - "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \ - "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \ - "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); }) -# endif -# define POST_GETCONTEXT PRE_GETCONTEXT -# elif GCC_VERSION_BEFORE(4,0,3) && defined(__ia64) -static jmp_buf function_call_may_return_twice_jmp_buf; -int function_call_may_return_twice_false_1 = 0; -int function_call_may_return_twice_false_2 = 0; -# define PRE_GETCONTEXT \ - (function_call_may_return_twice_false_1 ? \ - setjmp(function_call_may_return_twice_jmp_buf) : \ - 0) -# define POST_GETCONTEXT \ - (function_call_may_return_twice_false_2 ? \ - setjmp(function_call_may_return_twice_jmp_buf) : \ - 0) -# elif defined(__FreeBSD__) && __FreeBSD__ < 7 -/* - * workaround for FreeBSD/i386 getcontext/setcontext bug. - * clear the carry flag by (0 ? ... : ...). - * FreeBSD PR 92110 http://www.freebsd.org/cgi/query-pr.cgi?pr=92110 - * [ruby-dev:28263] - */ -static int volatile freebsd_clear_carry_flag = 0; -# define PRE_GETCONTEXT \ - (freebsd_clear_carry_flag ? (freebsd_clear_carry_flag = 0) : 0) -# endif -# ifndef PRE_GETCONTEXT -# define PRE_GETCONTEXT 0 -# endif -# ifndef POST_GETCONTEXT -# define POST_GETCONTEXT 0 -# endif -# define ruby_longjmp(env, val) rb_jump_context(env, val) -# define ruby_setjmp(just_before_setjmp, j) ((j)->status = 0, \ - (just_before_setjmp), \ - PRE_GETCONTEXT, \ - getcontext(&(j)->context), \ - POST_GETCONTEXT, \ - (j)->status) -#else -# if !defined(setjmp) && defined(HAVE__SETJMP) -# define ruby_setjmp(just_before_setjmp, env) \ - ((just_before_setjmp), _setjmp(env)) -# define ruby_longjmp(env,val) _longjmp(env,val) -# else -# define ruby_setjmp(just_before_setjmp, env) \ - ((just_before_setjmp), setjmp(env)) -# define ruby_longjmp(env,val) longjmp(env,val) -# endif -#endif - -#include -#include -#include - -#if defined(__VMS) -#pragma nostandard -#endif - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -#include - -VALUE rb_cProc; -VALUE rb_cBinding; -static VALUE proc_invoke _((VALUE,VALUE,VALUE,VALUE)); -static VALUE rb_f_binding _((VALUE)); -static void rb_f_END _((void)); -static VALUE rb_f_block_given_p _((void)); -static VALUE block_pass _((VALUE,NODE*)); - -VALUE rb_cMethod; -static VALUE method_call _((int, VALUE*, VALUE)); -VALUE rb_cUnboundMethod; -static VALUE umethod_bind _((VALUE, VALUE)); -static VALUE rb_mod_define_method _((int, VALUE*, VALUE)); -NORETURN(static void rb_raise_jump _((VALUE))); -static VALUE rb_make_exception _((int argc, VALUE *argv)); - -static int scope_vmode; -#define SCOPE_PUBLIC 0 -#define SCOPE_PRIVATE 1 -#define SCOPE_PROTECTED 2 -#define SCOPE_MODFUNC 5 -#define SCOPE_MASK 7 -#define SCOPE_SET(f) (scope_vmode=(f)) -#define SCOPE_TEST(f) (scope_vmode&(f)) - -VALUE (*ruby_sandbox_save)_((rb_thread_t)); -VALUE (*ruby_sandbox_restore)_((rb_thread_t)); -NODE* ruby_current_node; -int ruby_safe_level = 0; -/* safe-level: - 0 - strings from streams/environment/ARGV are tainted (default) - 1 - no dangerous operation by tainted value - 2 - process/file operations prohibited - 3 - all generated objects are tainted - 4 - no global (non-tainted) variable modification/no direct output -*/ - -static VALUE safe_getter _((void)); -static void safe_setter _((VALUE val)); - -void -rb_secure(level) - int level; -{ - if (level <= ruby_safe_level) { - if (ruby_frame->last_func) { - rb_raise(rb_eSecurityError, "Insecure operation `%s' at level %d", - rb_id2name(ruby_frame->last_func), ruby_safe_level); - } - else { - rb_raise(rb_eSecurityError, "Insecure operation at level %d", ruby_safe_level); - } - } -} - -void -rb_secure_update(obj) - VALUE obj; -{ - if (!OBJ_TAINTED(obj)) rb_secure(4); -} - -void -rb_check_safe_obj(x) - VALUE x; -{ - if (ruby_safe_level > 0 && OBJ_TAINTED(x)){ - if (ruby_frame->last_func) { - rb_raise(rb_eSecurityError, "Insecure operation - %s", - rb_id2name(ruby_frame->last_func)); - } - else { - rb_raise(rb_eSecurityError, "Insecure operation: -r"); - } - } - rb_secure(4); -} - -void -rb_check_safe_str(x) - VALUE x; -{ - rb_check_safe_obj(x); - if (TYPE(x)!= T_STRING) { - rb_raise(rb_eTypeError, "wrong argument type %s (expected String)", - rb_obj_classname(x)); - } -} - -NORETURN(static void print_undef _((VALUE, ID))); -static void -print_undef(klass, id) - VALUE klass; - ID id; -{ - rb_name_error(id, "undefined method `%s' for %s `%s'", - rb_id2name(id), - (TYPE(klass) == T_MODULE) ? "module" : "class", - rb_class2name(klass)); -} - -static ID removed, singleton_removed, undefined, singleton_undefined; - -#define CACHE_SIZE 0x800 -#define CACHE_MASK 0x7ff -#define EXPR1(c,m) ((((c)>>3)^(m))&CACHE_MASK) - -struct cache_entry { /* method hash table. */ - ID mid; /* method's id */ - ID mid0; /* method's original id */ - VALUE klass; /* receiver's class */ - VALUE origin; /* where method defined */ - NODE *method; - int noex; -}; - -static struct cache_entry cache[CACHE_SIZE]; -static int ruby_running = 0; - -void -rb_clear_cache() -{ - struct cache_entry *ent, *end; - - if (!ruby_running) return; - ent = cache; end = ent + CACHE_SIZE; - while (ent < end) { - ent->mid = 0; - ent++; - } -} - -static void -rb_clear_cache_for_undef(klass, id) - VALUE klass; - ID id; -{ - struct cache_entry *ent, *end; - - if (!ruby_running) return; - ent = cache; end = ent + CACHE_SIZE; - while (ent < end) { - if (ent->mid == id && - RCLASS(ent->origin)->m_tbl == RCLASS(klass)->m_tbl) { - ent->mid = 0; - } - ent++; - } -} - -static void -rb_clear_cache_by_id(id) - ID id; -{ - struct cache_entry *ent, *end; - - if (!ruby_running) return; - ent = cache; end = ent + CACHE_SIZE; - while (ent < end) { - if (ent->mid == id) { - ent->mid = 0; - } - ent++; - } -} - -void -rb_clear_cache_by_class(klass) - VALUE klass; -{ - struct cache_entry *ent, *end; - - if (!ruby_running) return; - ent = cache; end = ent + CACHE_SIZE; - while (ent < end) { - if (ent->klass == klass || ent->origin == klass) { - ent->mid = 0; - } - ent++; - } -} - -static ID init, eqq, each, aref, aset, match, missing; -static ID added, singleton_added; -static ID __id__, __send__, respond_to; - -#define NOEX_TAINTED 8 -#define NOEX_SAFE(n) ((n) >> 4) -#define NOEX_WITH(n, v) ((n) | (v) << 4) -#define NOEX_WITH_SAFE(n) NOEX_WITH(n, ruby_safe_level) - -void -rb_add_method(klass, mid, node, noex) - VALUE klass; - ID mid; - NODE *node; - int noex; -{ - NODE *body; - - if (NIL_P(klass)) klass = rb_cObject; - if (ruby_safe_level >= 4 && (klass == rb_cObject || !OBJ_TAINTED(klass))) { - rb_raise(rb_eSecurityError, "Insecure: can't define method"); - } - if (!FL_TEST(klass, FL_SINGLETON) && - node && nd_type(node) != NODE_ZSUPER && - (mid == rb_intern("initialize" )|| mid == rb_intern("initialize_copy"))) { - noex = NOEX_PRIVATE | noex; - } - else if (FL_TEST(klass, FL_SINGLETON) && node && nd_type(node) == NODE_CFUNC && - mid == rb_intern("allocate")) { - rb_warn("defining %s.allocate is deprecated; use rb_define_alloc_func()", - rb_class2name(rb_iv_get(klass, "__attached__"))); - mid = ID_ALLOCATOR; - } - if (OBJ_FROZEN(klass)) rb_error_frozen("class/module"); - rb_clear_cache_by_id(mid); - body = NEW_METHOD(node, NOEX_WITH_SAFE(noex)); - st_insert(RCLASS(klass)->m_tbl, mid, (st_data_t)body); - if (node && mid != ID_ALLOCATOR && ruby_running) { - if (FL_TEST(klass, FL_SINGLETON)) { - rb_funcall(rb_iv_get(klass, "__attached__"), singleton_added, 1, ID2SYM(mid)); - } - else { - rb_funcall(klass, added, 1, ID2SYM(mid)); - } - } -} - -void -rb_define_alloc_func(klass, func) - VALUE klass; - VALUE (*func) _((VALUE)); -{ - Check_Type(klass, T_CLASS); - rb_add_method(rb_singleton_class(klass), ID_ALLOCATOR, NEW_CFUNC(func, 0), - NOEX_PRIVATE); -} - -void -rb_undef_alloc_func(klass) - VALUE klass; -{ - Check_Type(klass, T_CLASS); - rb_add_method(rb_singleton_class(klass), ID_ALLOCATOR, 0, NOEX_UNDEF); -} - -static NODE* -search_method(klass, id, origin) - VALUE klass, *origin; - ID id; -{ - st_data_t body; - - if (!klass) return 0; - while (!st_lookup(RCLASS(klass)->m_tbl, id, &body)) { - klass = RCLASS(klass)->super; - if (!klass) return 0; - } - - if (origin) *origin = klass; - return (NODE *)body; -} - -static NODE* -rb_get_method_body(klassp, idp, noexp) - VALUE *klassp; - ID *idp; - int *noexp; -{ - ID id = *idp; - VALUE klass = *klassp; - VALUE origin; - NODE * volatile body; - struct cache_entry *ent; - - if ((body = search_method(klass, id, &origin)) == 0 || !body->nd_body) { - /* store empty info in cache */ - ent = cache + EXPR1(klass, id); - ent->klass = klass; - ent->origin = klass; - ent->mid = ent->mid0 = id; - ent->noex = 0; - ent->method = 0; - - return 0; - } - - if (ruby_running) { - /* store in cache */ - ent = cache + EXPR1(klass, id); - ent->klass = klass; - ent->noex = body->nd_noex; - if (noexp) *noexp = body->nd_noex; - body = body->nd_body; - if (nd_type(body) == NODE_FBODY) { - ent->mid = id; - *klassp = body->nd_orig; - ent->origin = body->nd_orig; - *idp = ent->mid0 = body->nd_mid; - body = ent->method = body->nd_head; - } - else { - *klassp = origin; - ent->origin = origin; - ent->mid = ent->mid0 = id; - ent->method = body; - } - } - else { - if (noexp) *noexp = body->nd_noex; - body = body->nd_body; - if (nd_type(body) == NODE_FBODY) { - *klassp = body->nd_orig; - *idp = body->nd_mid; - body = body->nd_head; - } - else { - *klassp = origin; - } - } - - return body; -} - -NODE* -rb_method_node(klass, id) - VALUE klass; - ID id; -{ - int noex; - - return rb_get_method_body(&klass, &id, &noex); -} - -static void -remove_method(klass, mid) - VALUE klass; - ID mid; -{ - st_data_t data; - NODE *body = 0; - - if (klass == rb_cObject) { - rb_secure(4); - } - if (ruby_safe_level >= 4 && !OBJ_TAINTED(klass)) { - rb_raise(rb_eSecurityError, "Insecure: can't remove method"); - } - if (OBJ_FROZEN(klass)) rb_error_frozen("class/module"); - if (mid == __id__ || mid == __send__ || mid == init) { - rb_warn("removing `%s' may cause serious problem", rb_id2name(mid)); - } - if (st_lookup(RCLASS(klass)->m_tbl, mid, &data)) { - body = (NODE *)data; - if (!body || !body->nd_body) body = 0; - else { - st_delete(RCLASS(klass)->m_tbl, &mid, &data); - } - } - if (!body) { - rb_name_error(mid, "method `%s' not defined in %s", - rb_id2name(mid), rb_class2name(klass)); - } - rb_clear_cache_for_undef(klass, mid); - if (FL_TEST(klass, FL_SINGLETON)) { - rb_funcall(rb_iv_get(klass, "__attached__"), singleton_removed, 1, ID2SYM(mid)); - } - else { - rb_funcall(klass, removed, 1, ID2SYM(mid)); - } -} - -void -rb_remove_method(klass, name) - VALUE klass; - const char *name; -{ - remove_method(klass, rb_intern(name)); -} - -/* - * call-seq: - * remove_method(symbol) => self - * - * Removes the method identified by _symbol_ from the current - * class. For an example, see Module.undef_method. - */ - -static VALUE -rb_mod_remove_method(argc, argv, mod) - int argc; - VALUE *argv; - VALUE mod; -{ - int i; - - for (i=0; ind_body) { - print_undef(klass, name); - } - if (body->nd_noex != noex) { - if (klass == origin) { - body->nd_noex = noex; - } - else { - rb_add_method(klass, name, NEW_ZSUPER(), noex); - } - } -} - -int -rb_method_boundp(klass, id, ex) - VALUE klass; - ID id; - int ex; -{ - struct cache_entry *ent; - int noex; - - /* is it in the method cache? */ - ent = cache + EXPR1(klass, id); - if (ent->mid == id && ent->klass == klass) { - if (ex && (ent->noex & NOEX_PRIVATE)) - return Qfalse; - if (!ent->method) return Qfalse; - return Qtrue; - } - if (rb_get_method_body(&klass, &id, &noex)) { - if (ex && (noex & NOEX_PRIVATE)) - return Qfalse; - return Qtrue; - } - return Qfalse; -} - -void -rb_attr(klass, id, read, write, ex) - VALUE klass; - ID id; - int read, write, ex; -{ - const char *name; - char *buf; - ID attriv; - int noex; - size_t len; - - if (!ex) noex = NOEX_PUBLIC; - else { - if (SCOPE_TEST(SCOPE_PRIVATE)) { - noex = NOEX_PRIVATE; - rb_warning((scope_vmode == SCOPE_MODFUNC) ? - "attribute accessor as module_function" : - "private attribute?"); - } - else if (SCOPE_TEST(SCOPE_PROTECTED)) { - noex = NOEX_PROTECTED; - } - else { - noex = NOEX_PUBLIC; - } - } - - if (!rb_is_local_id(id) && !rb_is_const_id(id)) { - rb_name_error(id, "invalid attribute name `%s'", rb_id2name(id)); - } - name = rb_id2name(id); - if (!name) { - rb_raise(rb_eArgError, "argument needs to be symbol or string"); - } - len = strlen(name)+2; - buf = ALLOCA_N(char,len); - snprintf(buf, len, "@%s", name); - attriv = rb_intern(buf); - if (read) { - rb_add_method(klass, id, NEW_IVAR(attriv), noex); - } - if (write) { - rb_add_method(klass, rb_id_attrset(id), NEW_ATTRSET(attriv), noex); - } -} - -extern int ruby_in_compile; - -VALUE ruby_errinfo = Qnil; -extern NODE *ruby_eval_tree_begin; -extern NODE *ruby_eval_tree; -extern int ruby_nerrs; - -VALUE rb_eLocalJumpError; -VALUE rb_eSysStackError; - -extern VALUE ruby_top_self; - -struct FRAME *ruby_frame; -struct SCOPE *ruby_scope; -static struct FRAME *top_frame; -static struct SCOPE *top_scope; - -static unsigned long frame_unique = 0; - -#define PUSH_FRAME() do { \ - volatile struct FRAME _frame; \ - _frame.prev = ruby_frame; \ - _frame.tmp = 0; \ - _frame.node = ruby_current_node; \ - _frame.iter = ruby_iter->iter; \ - _frame.argc = 0; \ - _frame.flags = 0; \ - _frame.uniq = frame_unique++; \ - ruby_frame = &_frame - -#define POP_FRAME() \ - ruby_current_node = _frame.node; \ - ruby_frame = _frame.prev; \ -} while (0) - -struct BLOCK { - NODE *var; - NODE *body; - VALUE self; - struct FRAME frame; - struct SCOPE *scope; - VALUE klass; - NODE *cref; - int iter; - int vmode; - int flags; - int uniq; - struct RVarmap *dyna_vars; - VALUE orig_thread; - VALUE wrapper; - VALUE block_obj; - struct BLOCK *outer; - struct BLOCK *prev; -}; - -#define BLOCK_D_SCOPE 1 -#define BLOCK_LAMBDA 2 - -static struct BLOCK *ruby_block; -static unsigned long block_unique = 1; - -#define PUSH_BLOCK(v,b) do { \ - struct BLOCK _block; \ - _block.var = (v); \ - _block.body = (b); \ - _block.self = self; \ - _block.frame = *ruby_frame; \ - _block.klass = ruby_class; \ - _block.cref = ruby_cref; \ - _block.frame.node = ruby_current_node;\ - _block.scope = ruby_scope; \ - _block.prev = ruby_block; \ - _block.outer = ruby_block; \ - _block.iter = ruby_iter->iter; \ - _block.vmode = scope_vmode; \ - _block.flags = BLOCK_D_SCOPE; \ - _block.dyna_vars = ruby_dyna_vars; \ - _block.wrapper = ruby_wrapper; \ - _block.block_obj = 0; \ - _block.uniq = (b)?block_unique++:0; \ - if (b) { \ - prot_tag->blkid = _block.uniq; \ - } \ - ruby_block = &_block - -#define POP_BLOCK() \ - ruby_block = _block.prev; \ -} while (0) - -struct RVarmap *ruby_dyna_vars; -#define PUSH_VARS() do { \ - struct RVarmap * volatile _old; \ - _old = ruby_dyna_vars; \ - ruby_dyna_vars = 0 - -#define POP_VARS() \ - if (_old && (ruby_scope->flags & SCOPE_DONT_RECYCLE)) {\ - if (RBASIC(_old)->flags) /* unless it's already recycled */ \ - FL_SET(_old, DVAR_DONT_RECYCLE); \ - }\ - ruby_dyna_vars = _old; \ -} while (0) - -#define DVAR_DONT_RECYCLE FL_USER2 - -#define DMETHOD_P() (ruby_frame->flags & FRAME_DMETH) - -static struct RVarmap* -new_dvar(id, value, prev) - ID id; - VALUE value; - struct RVarmap *prev; -{ - NEWOBJ(vars, struct RVarmap); - OBJSETUP(vars, 0, T_VARMAP); - vars->id = id; - vars->val = value; - vars->next = prev; - - return vars; -} - -VALUE -rb_dvar_defined(id) - ID id; -{ - struct RVarmap *vars = ruby_dyna_vars; - - while (vars) { - if (vars->id == id) return Qtrue; - vars = vars->next; - } - return Qfalse; -} - -VALUE -rb_dvar_curr(id) - ID id; -{ - struct RVarmap *vars = ruby_dyna_vars; - - while (vars) { - if (vars->id == 0) break; - if (vars->id == id) return Qtrue; - vars = vars->next; - } - return Qfalse; -} - -VALUE -rb_dvar_ref(id) - ID id; -{ - struct RVarmap *vars = ruby_dyna_vars; - - while (vars) { - if (vars->id == id) { - return vars->val; - } - vars = vars->next; - } - return Qnil; -} - -void -rb_dvar_push(id, value) - ID id; - VALUE value; -{ - ruby_dyna_vars = new_dvar(id, value, ruby_dyna_vars); -} - -static void -dvar_asgn_internal(id, value, curr) - ID id; - VALUE value; - int curr; -{ - int n = 0; - struct RVarmap *vars = ruby_dyna_vars; - - while (vars) { - if (curr && vars->id == 0) { - /* first null is a dvar header */ - n++; - if (n == 2) break; - } - if (vars->id == id) { - vars->val = value; - return; - } - vars = vars->next; - } - if (!ruby_dyna_vars) { - ruby_dyna_vars = new_dvar(id, value, 0); - } - else { - vars = new_dvar(id, value, ruby_dyna_vars->next); - ruby_dyna_vars->next = vars; - } -} - -static inline void -dvar_asgn(id, value) - ID id; - VALUE value; -{ - dvar_asgn_internal(id, value, 0); -} - -static inline void -dvar_asgn_curr(id, value) - ID id; - VALUE value; -{ - dvar_asgn_internal(id, value, 1); -} - -VALUE * -rb_svar(cnt) - int cnt; -{ - struct RVarmap *vars = ruby_dyna_vars; - ID id; - - if (!ruby_scope->local_tbl) return NULL; - if (cnt >= ruby_scope->local_tbl[0]) return NULL; - id = ruby_scope->local_tbl[cnt+1]; - while (vars) { - if (vars->id == id) return &vars->val; - vars = vars->next; - } - if (ruby_scope->local_vars == 0) return NULL; - return &ruby_scope->local_vars[cnt]; -} - -struct iter { - int iter; - struct iter *prev; -}; -static struct iter *ruby_iter; - -#define ITER_NOT 0 -#define ITER_PRE 1 -#define ITER_CUR 2 -#define ITER_PAS 3 - -#define PUSH_ITER(i) do { \ - struct iter _iter; \ - _iter.prev = ruby_iter; \ - _iter.iter = (i); \ - ruby_iter = &_iter - -#define POP_ITER() \ - ruby_iter = _iter.prev; \ -} while (0) - -struct tag { - rb_jmpbuf_t buf; - struct FRAME *frame; - struct iter *iter; - VALUE tag; - VALUE retval; - struct SCOPE *scope; - VALUE dst; - struct tag *prev; - int blkid; -}; -static struct tag *prot_tag; - -#define PUSH_TAG(ptag) do { \ - struct tag _tag; \ - _tag.retval = Qnil; \ - _tag.frame = ruby_frame; \ - _tag.iter = ruby_iter; \ - _tag.prev = prot_tag; \ - _tag.scope = ruby_scope; \ - _tag.tag = ptag; \ - _tag.dst = 0; \ - _tag.blkid = 0; \ - prot_tag = &_tag - -#define PROT_NONE Qfalse /* 0 */ -#define PROT_THREAD Qtrue /* 2 */ -#define PROT_FUNC INT2FIX(0) /* 1 */ -#define PROT_LOOP INT2FIX(1) /* 3 */ -#define PROT_LAMBDA INT2FIX(2) /* 5 */ -#define PROT_YIELD INT2FIX(3) /* 7 */ - -#define EXEC_TAG() (FLUSH_REGISTER_WINDOWS, ruby_setjmp(((void)0), prot_tag->buf)) - -#define JUMP_TAG(st) do { \ - ruby_frame = prot_tag->frame; \ - ruby_iter = prot_tag->iter; \ - ruby_longjmp(prot_tag->buf,(st)); \ -} while (0) - -#define POP_TAG() \ - prot_tag = _tag.prev; \ -} while (0) - -#define TAG_DST() (_tag.dst == (VALUE)ruby_frame->uniq) - -#define TAG_RETURN 0x1 -#define TAG_BREAK 0x2 -#define TAG_NEXT 0x3 -#define TAG_RETRY 0x4 -#define TAG_REDO 0x5 -#define TAG_RAISE 0x6 -#define TAG_THROW 0x7 -#define TAG_FATAL 0x8 -#define TAG_MASK 0xf - -VALUE ruby_class; -static VALUE ruby_wrapper; /* security wrapper */ - -#define PUSH_CLASS(c) do { \ - volatile VALUE _class = ruby_class; \ - ruby_class = (c) - -#define POP_CLASS() ruby_class = _class; \ -} while (0) - -NODE *ruby_cref = 0; -NODE *ruby_top_cref; -#define PUSH_CREF(c) ruby_cref = NEW_CREF(c,ruby_cref) -#define POP_CREF() ruby_cref = ruby_cref->nd_next - -#define PUSH_SCOPE() do { \ - volatile int _vmode = scope_vmode; \ - struct SCOPE * volatile _old; \ - NEWOBJ(_scope, struct SCOPE); \ - OBJSETUP(_scope, 0, T_SCOPE); \ - _scope->local_tbl = 0; \ - _scope->local_vars = 0; \ - _scope->flags = 0; \ - _old = ruby_scope; \ - ruby_scope = _scope; \ - scope_vmode = SCOPE_PUBLIC - -rb_thread_t rb_curr_thread; -rb_thread_t rb_main_thread; -#define main_thread rb_main_thread -#define curr_thread rb_curr_thread - -static void scope_dup _((struct SCOPE *)); - -#define POP_SCOPE() \ - if (ruby_scope->flags & SCOPE_DONT_RECYCLE) {\ - if (_old) scope_dup(_old); \ - } \ - if (!(ruby_scope->flags & SCOPE_MALLOC)) {\ - ruby_scope->local_vars = 0; \ - ruby_scope->local_tbl = 0; \ - if (!(ruby_scope->flags & SCOPE_DONT_RECYCLE) && \ - ruby_scope != top_scope) { \ - rb_gc_force_recycle((VALUE)ruby_scope);\ - } \ - } \ - ruby_scope->flags |= SCOPE_NOSTACK; \ - ruby_scope = _old; \ - scope_vmode = _vmode; \ -} while (0) - -static VALUE rb_eval _((VALUE,NODE*)); -static VALUE eval _((VALUE,VALUE,VALUE,char*,int)); -static NODE *compile _((VALUE, char*, int)); - -static VALUE rb_yield_0 _((VALUE, VALUE, VALUE, int, int)); - -#define YIELD_LAMBDA_CALL 1 -#define YIELD_PROC_CALL 2 -#define YIELD_PUBLIC_DEF 4 -#define YIELD_FUNC_AVALUE 1 -#define YIELD_FUNC_SVALUE 2 - -static VALUE rb_call _((VALUE,VALUE,ID,int,const VALUE*,int,VALUE)); -static VALUE module_setup _((VALUE,NODE*)); - -static VALUE massign _((VALUE,NODE*,VALUE,int)); -static void assign _((VALUE,NODE*,VALUE,int)); - -typedef struct event_hook { - rb_event_hook_func_t func; - rb_event_t events; - struct event_hook *next; -} rb_event_hook_t; - -static rb_event_hook_t *event_hooks; - -#define EXEC_EVENT_HOOK(event, node, self, id, klass) \ - do { \ - rb_event_hook_t *hook = event_hooks; \ - rb_event_hook_func_t hook_func; \ - rb_event_t events; \ - \ - while (hook) { \ - hook_func = hook->func; \ - events = hook->events; \ - hook = hook->next; \ - if (events & event) \ - (*hook_func)(event, node, self, id, klass); \ - } \ - } while (0) - -static VALUE trace_func = 0; -static int tracing = 0; -static void call_trace_func _((rb_event_t,NODE*,VALUE,ID,VALUE)); - -#if 0 -#define SET_CURRENT_SOURCE() (ruby_sourcefile = ruby_current_node->nd_file, \ - ruby_sourceline = nd_line(ruby_current_node)) -#else -#define SET_CURRENT_SOURCE() ((void)0) -#endif - -void -ruby_set_current_source() -{ - if (ruby_current_node) { - ruby_sourcefile = ruby_current_node->nd_file; - ruby_sourceline = nd_line(ruby_current_node); - } -} - -static void -#ifdef HAVE_STDARG_PROTOTYPES -warn_printf(const char *fmt, ...) -#else -warn_printf(fmt, va_alist) - const char *fmt; - va_dcl -#endif -{ - char buf[BUFSIZ]; - va_list args; - - va_init_list(args, fmt); - vsnprintf(buf, BUFSIZ, fmt, args); - va_end(args); - rb_write_error(buf); -} - -#define warn_print(x) rb_write_error(x) -#define warn_print2(x,l) rb_write_error2(x,l) - -static void -error_pos() -{ - ruby_set_current_source(); - if (ruby_sourcefile) { - if (ruby_frame->last_func) { - warn_printf("%s:%d:in `%s'", ruby_sourcefile, ruby_sourceline, - rb_id2name(ruby_frame->orig_func)); - } - else if (ruby_sourceline == 0) { - warn_printf("%s", ruby_sourcefile); - } - else { - warn_printf("%s:%d", ruby_sourcefile, ruby_sourceline); - } - } -} - -VALUE rb_check_backtrace(VALUE); - -static VALUE -get_backtrace(info) - VALUE info; -{ - if (NIL_P(info)) return Qnil; - info = rb_funcall(info, rb_intern("backtrace"), 0); - if (NIL_P(info)) return Qnil; - return rb_check_backtrace(info); -} - -static void -set_backtrace(info, bt) - VALUE info, bt; -{ - rb_funcall(info, rb_intern("set_backtrace"), 1, bt); -} - -static void -error_print() -{ - VALUE errat = Qnil; /* OK */ - volatile VALUE eclass, e; - char *einfo; - long elen; - - if (NIL_P(ruby_errinfo)) return; - - PUSH_TAG(PROT_NONE); - if (EXEC_TAG() == 0) { - errat = get_backtrace(ruby_errinfo); - } - else { - errat = Qnil; - } - if (EXEC_TAG()) goto error; - if (NIL_P(errat)){ - ruby_set_current_source(); - if (ruby_sourcefile) - warn_printf("%s:%d", ruby_sourcefile, ruby_sourceline); - else - warn_printf("%d", ruby_sourceline); - } - else if (RARRAY(errat)->len == 0) { - error_pos(); - } - else { - VALUE mesg = RARRAY(errat)->ptr[0]; - - if (NIL_P(mesg)) error_pos(); - else { - warn_print2(RSTRING(mesg)->ptr, RSTRING(mesg)->len); - } - } - - eclass = CLASS_OF(ruby_errinfo); - if (EXEC_TAG() == 0) { - e = rb_funcall(ruby_errinfo, rb_intern("message"), 0, 0); - StringValue(e); - einfo = RSTRING(e)->ptr; - elen = RSTRING(e)->len; - } - else { - einfo = ""; - elen = 0; - } - if (EXEC_TAG()) goto error; - if (eclass == rb_eRuntimeError && elen == 0) { - warn_print(": unhandled exception\n"); - } - else { - VALUE epath; - - epath = rb_class_name(eclass); - if (elen == 0) { - warn_print(": "); - warn_print2(RSTRING(epath)->ptr, RSTRING(epath)->len); - warn_print("\n"); - } - else { - char *tail = 0; - long len = elen; - - if (RSTRING(epath)->ptr[0] == '#') epath = 0; - if ((tail = memchr(einfo, '\n', elen)) != 0) { - len = tail - einfo; - tail++; /* skip newline */ - } - warn_print(": "); - warn_print2(einfo, len); - if (epath) { - warn_print(" ("); - warn_print2(RSTRING(epath)->ptr, RSTRING(epath)->len); - warn_print(")\n"); - } - if (tail && elen>len+1) { - warn_print2(tail, elen-len-1); - if (einfo[elen-1] != '\n') warn_print2("\n", 1); - } - } - } - - if (!NIL_P(errat)) { - long i; - struct RArray *ep = RARRAY(errat); - -#define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5) -#define TRACE_HEAD 8 -#define TRACE_TAIL 5 - - ep = RARRAY(errat); - for (i=1; ilen; i++) { - if (TYPE(ep->ptr[i]) == T_STRING) { - warn_printf("\tfrom %s\n", RSTRING(ep->ptr[i])->ptr); - } - if (i == TRACE_HEAD && ep->len > TRACE_MAX) { - warn_printf("\t ... %ld levels...\n", - ep->len - TRACE_HEAD - TRACE_TAIL); - i = ep->len - TRACE_TAIL; - } - } - } - error: - POP_TAG(); -} - -#if defined(__APPLE__) -#define environ (*_NSGetEnviron()) -#elif !defined(_WIN32) && !defined(__MACOS__) || defined(_WIN32_WCE) -extern char **environ; -#endif -char **rb_origenviron; - -void rb_call_inits _((void)); -void Init_stack _((VALUE*)); -void Init_heap _((void)); -void Init_ext _((void)); - -#ifdef HAVE_NATIVETHREAD -static rb_nativethread_t ruby_thid; -int -is_ruby_native_thread() { - return NATIVETHREAD_EQUAL(ruby_thid, NATIVETHREAD_CURRENT()); -} - -# ifdef HAVE_NATIVETHREAD_KILL -void -ruby_native_thread_kill(sig) - int sig; -{ - NATIVETHREAD_KILL(ruby_thid, sig); -} -# endif -#endif - -void -ruby_init() -{ - static int initialized = 0; - static struct FRAME frame; - static struct iter iter; - int state; - - if (initialized) - return; - initialized = 1; -#ifdef HAVE_NATIVETHREAD - ruby_thid = NATIVETHREAD_CURRENT(); -#endif - - ruby_frame = top_frame = &frame; - ruby_iter = &iter; - -#ifdef __MACOS__ - rb_origenviron = 0; -#else - rb_origenviron = environ; -#endif - - Init_stack((void*)&state); - Init_heap(); - PUSH_SCOPE(); - ruby_scope->local_vars = 0; - ruby_scope->local_tbl = 0; - top_scope = ruby_scope; - /* default visibility is private at toplevel */ - SCOPE_SET(SCOPE_PRIVATE); - - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - rb_call_inits(); - ruby_class = rb_cObject; - ruby_frame->self = ruby_top_self; - ruby_top_cref = rb_node_newnode(NODE_CREF,rb_cObject,0,0); - ruby_cref = ruby_top_cref; - rb_define_global_const("TOPLEVEL_BINDING", rb_f_binding(ruby_top_self)); -#ifdef __MACOS__ - _macruby_init(); -#elif defined(__VMS) - _vmsruby_init(); -#endif - ruby_prog_init(); - ALLOW_INTS; - } - POP_TAG(); - if (state) { - error_print(); - exit(EXIT_FAILURE); - } - POP_SCOPE(); - ruby_scope = top_scope; - top_scope->flags &= ~SCOPE_NOSTACK; - ruby_running = 1; -} - -static VALUE -eval_node(self, node) - VALUE self; - NODE *node; -{ - NODE *beg_tree = ruby_eval_tree_begin; - - ruby_eval_tree_begin = 0; - if (beg_tree) { - rb_eval(self, beg_tree); - } - - if (!node) return Qnil; - return rb_eval(self, node); -} - -int ruby_in_eval; - -static void rb_thread_cleanup _((void)); -static void rb_thread_wait_other_threads _((void)); - -static int thread_no_ensure _((void)); - -static VALUE exception_error; -static VALUE sysstack_error; - -static int -sysexit_status(err) - VALUE err; -{ - VALUE st = rb_iv_get(err, "status"); - return NUM2INT(st); -} - -static int -error_handle(ex) - int ex; -{ - int status = EXIT_FAILURE; - rb_thread_t th = curr_thread; - - if (rb_thread_set_raised(th)) - return EXIT_FAILURE; - switch (ex & TAG_MASK) { - case 0: - status = EXIT_SUCCESS; - break; - - case TAG_RETURN: - error_pos(); - warn_print(": unexpected return\n"); - break; - case TAG_NEXT: - error_pos(); - warn_print(": unexpected next\n"); - break; - case TAG_BREAK: - error_pos(); - warn_print(": unexpected break\n"); - break; - case TAG_REDO: - error_pos(); - warn_print(": unexpected redo\n"); - break; - case TAG_RETRY: - error_pos(); - warn_print(": retry outside of rescue clause\n"); - break; - case TAG_THROW: - if (prot_tag && prot_tag->frame && prot_tag->frame->node) { - NODE *tag = prot_tag->frame->node; - warn_printf("%s:%d: uncaught throw\n", - tag->nd_file, nd_line(tag)); - } - else { - error_pos(); - warn_printf(": unexpected throw\n"); - } - break; - case TAG_RAISE: - case TAG_FATAL: - if (rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) { - status = sysexit_status(ruby_errinfo); - } - else if (rb_obj_is_instance_of(ruby_errinfo, rb_eSignal)) { - /* no message when exiting by signal */ - } - else { - error_print(); - } - break; - default: - rb_bug("Unknown longjmp status %d", ex); - break; - } - rb_thread_reset_raised(th); - return status; -} - -void -ruby_options(argc, argv) - int argc; - char **argv; -{ - int state; - - Init_stack((void*)&state); - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - ruby_process_options(argc, argv); - } - else { - trace_func = 0; - tracing = 0; - exit(error_handle(state)); - } - POP_TAG(); -} - -void rb_exec_end_proc _((void)); - -static void -ruby_finalize_0() -{ - PUSH_TAG(PROT_NONE); - if (EXEC_TAG() == 0) { - rb_trap_exit(); - } - POP_TAG(); - rb_exec_end_proc(); -} - -static void -ruby_finalize_1() -{ - signal(SIGINT, SIG_DFL); - ruby_errinfo = 0; - rb_gc_call_finalizer_at_exit(); - trace_func = 0; - tracing = 0; -} - -void -ruby_finalize() -{ - ruby_finalize_0(); - ruby_finalize_1(); -} - -int -ruby_cleanup(ex) - int ex; -{ - int state; - volatile VALUE errs[2]; - int nerr; - - errs[1] = ruby_errinfo; - ruby_safe_level = 0; - Init_stack((void *)&state); - ruby_finalize_0(); - errs[0] = ruby_errinfo; - PUSH_TAG(PROT_NONE); - PUSH_ITER(ITER_NOT); - if ((state = EXEC_TAG()) == 0) { - rb_thread_cleanup(); - rb_thread_wait_other_threads(); - } - else if (ex == 0) { - ex = state; - } - POP_ITER(); - ruby_errinfo = errs[1]; - ex = error_handle(ex); - ruby_finalize_1(); - POP_TAG(); - - for (nerr = 0; nerr < sizeof(errs) / sizeof(errs[0]); ++nerr) { - VALUE err = errs[nerr]; - - if (!RTEST(err)) continue; - - if (rb_obj_is_kind_of(err, rb_eSystemExit)) { - return sysexit_status(err); - } - else if (rb_obj_is_kind_of(err, rb_eSignal)) { - VALUE sig = rb_iv_get(err, "signo"); - ruby_default_signal(NUM2INT(sig)); - } - else if (ex == 0) { - ex = 1; - } - } - -#if EXIT_SUCCESS != 0 || EXIT_FAILURE != 1 - switch (ex) { -#if EXIT_SUCCESS != 0 - case 0: return EXIT_SUCCESS; -#endif -#if EXIT_FAILURE != 1 - case 1: return EXIT_FAILURE; -#endif - } -#endif - - return ex; -} - -static int -ruby_exec_internal() -{ - int state; - - PUSH_TAG(PROT_NONE); - PUSH_ITER(ITER_NOT); - /* default visibility is private at toplevel */ - SCOPE_SET(SCOPE_PRIVATE); - if ((state = EXEC_TAG()) == 0) { - eval_node(ruby_top_self, ruby_eval_tree); - } - POP_ITER(); - POP_TAG(); - return state; -} - -void -ruby_stop(ex) - int ex; -{ - exit(ruby_cleanup(ex)); -} - -int -ruby_exec() -{ - volatile NODE *tmp; - - Init_stack((void*)&tmp); - return ruby_exec_internal(); -} - -void -ruby_run() -{ - int state; - static int ex; - - if (ruby_nerrs > 0) exit(EXIT_FAILURE); - state = ruby_exec(); - if (state && !ex) ex = state; - ruby_stop(ex); -} - -static void -compile_error(at) - const char *at; -{ - VALUE str; - - ruby_nerrs = 0; - str = rb_str_buf_new2("compile error"); - if (at) { - rb_str_buf_cat2(str, " in "); - rb_str_buf_cat2(str, at); - } - rb_str_buf_cat(str, "\n", 1); - if (!NIL_P(ruby_errinfo)) { - rb_str_append(str, rb_obj_as_string(ruby_errinfo)); - } - rb_exc_raise(rb_exc_new3(rb_eSyntaxError, str)); -} - -VALUE -rb_eval_string(str) - const char *str; -{ - VALUE v; - NODE *oldsrc = ruby_current_node; - - ruby_current_node = 0; - ruby_sourcefile = rb_source_filename("(eval)"); - v = eval(ruby_top_self, rb_str_new2(str), Qnil, 0, 0); - ruby_current_node = oldsrc; - - return v; -} - -VALUE -rb_eval_string_protect(str, state) - const char *str; - int *state; -{ - return rb_protect((VALUE (*)_((VALUE)))rb_eval_string, (VALUE)str, state); -} - -VALUE -rb_eval_string_wrap(str, state) - const char *str; - int *state; -{ - int status; - VALUE self = ruby_top_self; - VALUE wrapper = ruby_wrapper; - VALUE val; - - PUSH_CLASS(ruby_wrapper = rb_module_new()); - ruby_top_self = rb_obj_clone(ruby_top_self); - rb_extend_object(ruby_top_self, ruby_wrapper); - PUSH_FRAME(); - ruby_frame->last_func = 0; - ruby_frame->last_class = 0; - ruby_frame->self = self; - PUSH_CREF(ruby_wrapper); - PUSH_SCOPE(); - - val = rb_eval_string_protect(str, &status); - ruby_top_self = self; - - POP_SCOPE(); - POP_FRAME(); - POP_CLASS(); - ruby_wrapper = wrapper; - if (state) { - *state = status; - } - else if (status) { - JUMP_TAG(status); - } - return val; -} - -NORETURN(static void localjump_error(const char*, VALUE, int)); -static void -localjump_error(mesg, value, reason) - const char *mesg; - VALUE value; - int reason; -{ - VALUE exc = rb_exc_new2(rb_eLocalJumpError, mesg); - ID id; - - rb_iv_set(exc, "@exit_value", value); - switch (reason) { - case TAG_BREAK: - id = rb_intern("break"); break; - case TAG_REDO: - id = rb_intern("redo"); break; - case TAG_RETRY: - id = rb_intern("retry"); break; - case TAG_NEXT: - id = rb_intern("next"); break; - case TAG_RETURN: - id = rb_intern("return"); break; - default: - id = rb_intern("noreason"); break; - } - rb_iv_set(exc, "@reason", ID2SYM(id)); - rb_exc_raise(exc); -} - -/* - * call_seq: - * local_jump_error.exit_value => obj - * - * Returns the exit value associated with this +LocalJumpError+. - */ -static VALUE -localjump_xvalue(exc) - VALUE exc; -{ - return rb_iv_get(exc, "@exit_value"); -} - -/* - * call-seq: - * local_jump_error.reason => symbol - * - * The reason this block was terminated: - * :break, :redo, :retry, :next, :return, or :noreason. - */ - -static VALUE -localjump_reason(exc) - VALUE exc; -{ - return rb_iv_get(exc, "@reason"); -} - -NORETURN(static void jump_tag_but_local_jump _((int,VALUE))); -static void -jump_tag_but_local_jump(state, val) - int state; - VALUE val; -{ - - if (val == Qundef) val = prot_tag->retval; - switch (state) { - case 0: - break; - case TAG_RETURN: - localjump_error("unexpected return", val, state); - break; - case TAG_BREAK: - localjump_error("unexpected break", val, state); - break; - case TAG_NEXT: - localjump_error("unexpected next", val, state); - break; - case TAG_REDO: - localjump_error("unexpected redo", Qnil, state); - break; - case TAG_RETRY: - localjump_error("retry outside of rescue clause", Qnil, state); - break; - default: - break; - } - JUMP_TAG(state); -} - -VALUE -rb_eval_cmd(cmd, arg, level) - VALUE cmd, arg; - int level; -{ - int state; - VALUE val = Qnil; /* OK */ - struct SCOPE *saved_scope; - volatile int safe = ruby_safe_level; - - if (OBJ_TAINTED(cmd)) { - level = 4; - } - if (TYPE(cmd) != T_STRING) { - PUSH_ITER(ITER_NOT); - PUSH_TAG(PROT_NONE); - ruby_safe_level = level; - if ((state = EXEC_TAG()) == 0) { - val = rb_funcall2(cmd, rb_intern("call"), RARRAY(arg)->len, RARRAY(arg)->ptr); - } - ruby_safe_level = safe; - POP_TAG(); - POP_ITER(); - if (state) JUMP_TAG(state); - return val; - } - - saved_scope = ruby_scope; - ruby_scope = top_scope; - PUSH_FRAME(); - ruby_frame->last_func = 0; - ruby_frame->last_class = 0; - ruby_frame->self = ruby_top_self; - PUSH_CREF(ruby_wrapper ? ruby_wrapper : rb_cObject); - - ruby_safe_level = level; - - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - val = eval(ruby_top_self, cmd, Qnil, 0, 0); - } - if (ruby_scope->flags & SCOPE_DONT_RECYCLE) - scope_dup(saved_scope); - ruby_scope = saved_scope; - ruby_safe_level = safe; - POP_TAG(); - POP_FRAME(); - - if (state) jump_tag_but_local_jump(state, val); - return val; -} - -#define ruby_cbase (ruby_cref->nd_clss) - -static VALUE -ev_const_defined(cref, id, self) - NODE *cref; - ID id; - VALUE self; -{ - NODE *cbase = cref; - VALUE result; - - while (cbase && cbase->nd_next) { - struct RClass *klass = RCLASS(cbase->nd_clss); - - if (!NIL_P(klass)) { - if (klass->iv_tbl && st_lookup(klass->iv_tbl, id, &result)) { - if (result == Qundef && NIL_P(rb_autoload_p((VALUE)klass, id))) { - return Qfalse; - } - return Qtrue; - } - } - cbase = cbase->nd_next; - } - return rb_const_defined(cref->nd_clss, id); -} - -static VALUE -ev_const_get(cref, id, self) - NODE *cref; - ID id; - VALUE self; -{ - NODE *cbase = cref; - VALUE result; - - while (cbase && cbase->nd_next) { - VALUE klass = cbase->nd_clss; - - if (!NIL_P(klass)) { - while (RCLASS(klass)->iv_tbl && - st_lookup(RCLASS(klass)->iv_tbl, id, &result)) { - if (result == Qundef) { - if (!RTEST(rb_autoload_load(klass, id))) break; - continue; - } - return result; - } - } - cbase = cbase->nd_next; - } - return rb_const_get(NIL_P(cref->nd_clss) ? CLASS_OF(self): cref->nd_clss, id); -} - -static VALUE -cvar_cbase() -{ - NODE *cref = ruby_cref; - - while (cref && cref->nd_next && (NIL_P(cref->nd_clss) || FL_TEST(cref->nd_clss, FL_SINGLETON))) { - cref = cref->nd_next; - if (!cref->nd_next) { - rb_warn("class variable access from toplevel singleton method"); - } - } - if (NIL_P(cref->nd_clss)) { - rb_raise(rb_eTypeError, "no class variables available"); - } - return cref->nd_clss; -} - -/* - * call-seq: - * Module.nesting => array - * - * Returns the list of +Modules+ nested at the point of call. - * - * module M1 - * module M2 - * $a = Module.nesting - * end - * end - * $a #=> [M1::M2, M1] - * $a[0].name #=> "M1::M2" - */ - -static VALUE -rb_mod_nesting() -{ - NODE *cbase = ruby_cref; - VALUE ary = rb_ary_new(); - - while (cbase && cbase->nd_next) { - if (!NIL_P(cbase->nd_clss)) rb_ary_push(ary, cbase->nd_clss); - cbase = cbase->nd_next; - } - if (ruby_wrapper && RARRAY(ary)->len == 0) { - rb_ary_push(ary, ruby_wrapper); - } - return ary; -} - -/* - * call-seq: - * Module.constants => array - * - * Returns an array of the names of all constants defined in the - * system. This list includes the names of all modules and classes. - * - * p Module.constants.sort[1..5] - * - * produces: - * - * ["ARGV", "ArgumentError", "Array", "Bignum", "Binding"] - */ - -static VALUE -rb_mod_s_constants() -{ - NODE *cbase = ruby_cref; - void *data = 0; - - while (cbase) { - if (!NIL_P(cbase->nd_clss)) { - data = rb_mod_const_at(cbase->nd_clss, data); - } - cbase = cbase->nd_next; - } - - if (!NIL_P(ruby_cbase)) { - data = rb_mod_const_of(ruby_cbase, data); - } - return rb_const_list(data); -} - -void -rb_frozen_class_p(klass) - VALUE klass; -{ - char *desc = "something(?!)"; - - if (OBJ_FROZEN(klass)) { - if (FL_TEST(klass, FL_SINGLETON)) - desc = "object"; - else { - switch (TYPE(klass)) { - case T_MODULE: - case T_ICLASS: - desc = "module"; break; - case T_CLASS: - desc = "class"; break; - } - } - rb_error_frozen(desc); - } -} - -void -rb_undef(klass, id) - VALUE klass; - ID id; -{ - VALUE origin; - NODE *body; - - if (ruby_cbase == rb_cObject && klass == rb_cObject) { - rb_secure(4); - } - if (ruby_safe_level >= 4 && !OBJ_TAINTED(klass)) { - rb_raise(rb_eSecurityError, "Insecure: can't undef `%s'", rb_id2name(id)); - } - rb_frozen_class_p(klass); - if (id == __id__ || id == __send__ || id == init) { - rb_warn("undefining `%s' may cause serious problem", rb_id2name(id)); - } - body = search_method(klass, id, &origin); - if (!body || !body->nd_body) { - char *s0 = " class"; - VALUE c = klass; - - if (FL_TEST(c, FL_SINGLETON)) { - VALUE obj = rb_iv_get(klass, "__attached__"); - - switch (TYPE(obj)) { - case T_MODULE: - case T_CLASS: - c = obj; - s0 = ""; - } - } - else if (TYPE(c) == T_MODULE) { - s0 = " module"; - } - rb_name_error(id, "undefined method `%s' for%s `%s'", - rb_id2name(id),s0,rb_class2name(c)); - } - rb_add_method(klass, id, 0, NOEX_PUBLIC); - if (FL_TEST(klass, FL_SINGLETON)) { - rb_funcall(rb_iv_get(klass, "__attached__"), - singleton_undefined, 1, ID2SYM(id)); - } - else { - rb_funcall(klass, undefined, 1, ID2SYM(id)); - } -} - -/* - * call-seq: - * undef_method(symbol) => self - * - * Prevents the current class from responding to calls to the named - * method. Contrast this with remove_method, which deletes - * the method from the particular class; Ruby will still search - * superclasses and mixed-in modules for a possible receiver. - * - * class Parent - * def hello - * puts "In parent" - * end - * end - * class Child < Parent - * def hello - * puts "In child" - * end - * end - * - * - * c = Child.new - * c.hello - * - * - * class Child - * remove_method :hello # remove from child, still in parent - * end - * c.hello - * - * - * class Child - * undef_method :hello # prevent any calls to 'hello' - * end - * c.hello - * - * produces: - * - * In child - * In parent - * prog.rb:23: undefined method `hello' for # (NoMethodError) - */ - -static VALUE -rb_mod_undef_method(argc, argv, mod) - int argc; - VALUE *argv; - VALUE mod; -{ - int i; - - for (i=0; ind_body) { - if (TYPE(klass) == T_MODULE) { - orig = search_method(rb_cObject, def, &origin); - } - } - if (!orig || !orig->nd_body) { - print_undef(klass, def); - } - if (FL_TEST(klass, FL_SINGLETON)) { - singleton = rb_iv_get(klass, "__attached__"); - } - body = orig->nd_body; - orig->nd_cnt++; - if (nd_type(body) == NODE_FBODY) { /* was alias */ - def = body->nd_mid; - origin = body->nd_orig; - body = body->nd_head; - } - - rb_clear_cache_by_id(name); - if (RTEST(ruby_verbose) && st_lookup(RCLASS(klass)->m_tbl, name, &data)) { - node = (NODE *)data; - if (node->nd_cnt == 0 && node->nd_body) { - rb_warning("discarding old %s", rb_id2name(name)); - } - } - st_insert(RCLASS(klass)->m_tbl, name, - (st_data_t)NEW_METHOD(NEW_FBODY(body, def, origin), - NOEX_WITH_SAFE(orig->nd_noex))); - - if (!ruby_running) return; - - if (singleton) { - rb_funcall(singleton, singleton_added, 1, ID2SYM(name)); - } - else { - rb_funcall(klass, added, 1, ID2SYM(name)); - } -} - -/* - * call-seq: - * alias_method(new_name, old_name) => self - * - * Makes new_name a new copy of the method old_name. This can - * be used to retain access to methods that are overridden. - * - * module Mod - * alias_method :orig_exit, :exit - * def exit(code=0) - * puts "Exiting with code #{code}" - * orig_exit(code) - * end - * end - * include Mod - * exit(99) - * - * produces: - * - * Exiting with code 99 - */ - -static VALUE -rb_mod_alias_method(mod, newname, oldname) - VALUE mod, newname, oldname; -{ - rb_alias(mod, rb_to_id(newname), rb_to_id(oldname)); - return mod; -} - -NODE * -rb_copy_node_scope(node, rval) - NODE *node; - NODE *rval; -{ - NODE *copy = NEW_NODE(NODE_SCOPE,0,rval,node->nd_next); - - if (node->nd_tbl) { - copy->nd_tbl = ALLOC_N(ID, node->nd_tbl[0]+1); - MEMCPY(copy->nd_tbl, node->nd_tbl, ID, node->nd_tbl[0]+1); - } - else { - copy->nd_tbl = 0; - } - return copy; -} - -#ifdef C_ALLOCA -# define TMP_PROTECT NODE * volatile tmp__protect_tmp=0 -# define TMP_ALLOC(n) \ - (tmp__protect_tmp = NEW_NODE(NODE_ALLOCA, \ - ALLOC_N(VALUE,n),tmp__protect_tmp,n), \ - (void*)tmp__protect_tmp->nd_head) -#else -# define TMP_PROTECT typedef int foobazzz -# define TMP_ALLOC(n) ALLOCA_N(VALUE,n) -#endif - -#define SETUP_ARGS0(anode,extra) do {\ - NODE *n = anode;\ - if (!n) {\ - argc = 0;\ - argv = 0;\ - }\ - else if (nd_type(n) == NODE_ARRAY) {\ - argc=anode->nd_alen;\ - if (argc > 0) {\ - int i;\ - n = anode;\ - argv = TMP_ALLOC(argc+extra);\ - for (i=0;ind_head);\ - n=n->nd_next;\ - }\ - }\ - else {\ - argc = 0;\ - argv = 0;\ - }\ - }\ - else {\ - VALUE args = rb_eval(self,n);\ - if (TYPE(args) != T_ARRAY)\ - args = rb_ary_to_ary(args);\ - argc = RARRAY(args)->len;\ - argv = TMP_ALLOC(argc+extra);\ - MEMCPY(argv, RARRAY(args)->ptr, VALUE, argc);\ - }\ -} while (0) - -#define SETUP_ARGS(anode) SETUP_ARGS0(anode,0) - -#define BEGIN_CALLARGS do {\ - struct BLOCK *tmp_block = ruby_block;\ - int tmp_iter = ruby_iter->iter;\ - switch (tmp_iter) {\ - case ITER_PRE:\ - if (ruby_block) ruby_block = ruby_block->outer;\ - case ITER_PAS:\ - tmp_iter = ITER_NOT;\ - }\ - PUSH_ITER(tmp_iter) - -#define END_CALLARGS \ - ruby_block = tmp_block;\ - POP_ITER();\ -} while (0) - -#define MATCH_DATA *rb_svar(node->nd_cnt) - -static char* is_defined _((VALUE, NODE*, char*)); - -static char* -arg_defined(self, node, buf, type) - VALUE self; - NODE *node; - char *buf; - char *type; -{ - int argc; - int i; - - if (!node) return type; /* no args */ - if (nd_type(node) == NODE_ARRAY) { - argc=node->nd_alen; - if (argc > 0) { - for (i=0;ind_head, buf)) - return 0; - node = node->nd_next; - } - } - } - else if (!is_defined(self, node, buf)) { - return 0; - } - return type; -} - -static char* -is_defined(self, node, buf) - VALUE self; - NODE *node; /* OK */ - char *buf; -{ - VALUE val; /* OK */ - int state; - - again: - if (!node) return "expression"; - switch (nd_type(node)) { - case NODE_SUPER: - case NODE_ZSUPER: - if (ruby_frame->last_func == 0) return 0; - else if (ruby_frame->last_class == 0) return 0; - val = ruby_frame->last_class; - if (rb_method_boundp(RCLASS(val)->super, ruby_frame->orig_func, 0)) { - if (nd_type(node) == NODE_SUPER) { - return arg_defined(self, node->nd_args, buf, "super"); - } - return "super"; - } - break; - - case NODE_VCALL: - case NODE_FCALL: - val = self; - goto check_bound; - - case NODE_ATTRASGN: - val = self; - if (node->nd_recv == (NODE *)1) goto check_bound; - case NODE_CALL: - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - val = rb_eval(self, node->nd_recv); - } - POP_TAG(); - if (state) { - ruby_errinfo = Qnil; - return 0; - } - check_bound: - { - int call = nd_type(node)==NODE_CALL; - - val = CLASS_OF(val); - if (call) { - int noex; - ID id = node->nd_mid; - - if (!rb_get_method_body(&val, &id, &noex)) - break; - if ((noex & NOEX_PRIVATE)) - break; - if ((noex & NOEX_PROTECTED) && - !rb_obj_is_kind_of(self, rb_class_real(val))) - break; - } - else if (!rb_method_boundp(val, node->nd_mid, call)) - break; - return arg_defined(self, node->nd_args, buf, - nd_type(node) == NODE_ATTRASGN ? - "assignment" : "method"); - } - break; - - case NODE_MATCH2: - case NODE_MATCH3: - return "method"; - - case NODE_YIELD: - if (rb_block_given_p()) { - return "yield"; - } - break; - - case NODE_SELF: - return "self"; - - case NODE_NIL: - return "nil"; - - case NODE_TRUE: - return "true"; - - case NODE_FALSE: - return "false"; - - case NODE_ATTRSET: - case NODE_OP_ASGN1: - case NODE_OP_ASGN2: - case NODE_OP_ASGN_OR: - case NODE_OP_ASGN_AND: - case NODE_MASGN: - case NODE_LASGN: - case NODE_DASGN: - case NODE_DASGN_CURR: - case NODE_GASGN: - case NODE_IASGN: - case NODE_CDECL: - case NODE_CVDECL: - case NODE_CVASGN: - return "assignment"; - - case NODE_LVAR: - return "local-variable"; - case NODE_DVAR: - return "local-variable(in-block)"; - - case NODE_GVAR: - if (rb_gvar_defined(node->nd_entry)) { - return "global-variable"; - } - break; - - case NODE_IVAR: - if (rb_ivar_defined(self, node->nd_vid)) { - return "instance-variable"; - } - break; - - case NODE_CONST: - if (ev_const_defined(ruby_cref, node->nd_vid, self)) { - return "constant"; - } - break; - - case NODE_CVAR: - if (rb_cvar_defined(cvar_cbase(), node->nd_vid)) { - return "class variable"; - } - break; - - case NODE_COLON2: - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - val = rb_eval(self, node->nd_head); - } - POP_TAG(); - if (state) { - ruby_errinfo = Qnil; - return 0; - } - else { - switch (TYPE(val)) { - case T_CLASS: - case T_MODULE: - if (rb_const_defined_from(val, node->nd_mid)) - return "constant"; - break; - default: - if (rb_method_boundp(CLASS_OF(val), node->nd_mid, 1)) { - return "method"; - } - } - } - break; - - case NODE_COLON3: - if (rb_const_defined_from(rb_cObject, node->nd_mid)) { - return "constant"; - } - break; - - case NODE_NTH_REF: - if (RTEST(rb_reg_nth_defined(node->nd_nth, MATCH_DATA))) { - sprintf(buf, "$%d", (int)node->nd_nth); - return buf; - } - break; - - case NODE_BACK_REF: - if (RTEST(rb_reg_nth_defined(0, MATCH_DATA))) { - sprintf(buf, "$%c", (char)node->nd_nth); - return buf; - } - break; - - case NODE_NEWLINE: - node = node->nd_next; - goto again; - - default: - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - rb_eval(self, node); - } - POP_TAG(); - if (!state) { - return "expression"; - } - ruby_errinfo = Qnil; - break; - } - return 0; -} - -static int handle_rescue _((VALUE,NODE*)); - -static void blk_free(); - -static VALUE -rb_obj_is_proc(proc) - VALUE proc; -{ - if (TYPE(proc) == T_DATA && RDATA(proc)->dfree == (RUBY_DATA_FUNC)blk_free) { - return Qtrue; - } - return Qfalse; -} - -void -rb_add_event_hook(func, events) - rb_event_hook_func_t func; - rb_event_t events; -{ - rb_event_hook_t *hook; - - hook = ALLOC(rb_event_hook_t); - hook->func = func; - hook->events = events; - hook->next = event_hooks; - event_hooks = hook; -} - -int -rb_remove_event_hook(func) - rb_event_hook_func_t func; -{ - rb_event_hook_t *prev, *hook; - - prev = NULL; - hook = event_hooks; - while (hook) { - if (hook->func == func) { - if (prev) { - prev->next = hook->next; - } - else { - event_hooks = hook->next; - } - xfree(hook); - return 0; - } - prev = hook; - hook = hook->next; - } - return -1; -} - -/* - * call-seq: - * set_trace_func(proc) => proc - * set_trace_func(nil) => nil - * - * Establishes _proc_ as the handler for tracing, or disables - * tracing if the parameter is +nil+. _proc_ takes up - * to six parameters: an event name, a filename, a line number, an - * object id, a binding, and the name of a class. _proc_ is - * invoked whenever an event occurs. Events are: c-call - * (call a C-language routine), c-return (return from a - * C-language routine), call (call a Ruby method), - * class (start a class or module definition), - * end (finish a class or module definition), - * line (execute code on a new line), raise - * (raise an exception), and return (return from a Ruby - * method). Tracing is disabled within the context of _proc_. - * - * class Test - * def test - * a = 1 - * b = 2 - * end - * end - * - * set_trace_func proc { |event, file, line, id, binding, classname| - * printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname - * } - * t = Test.new - * t.test - * - * line prog.rb:11 false - * c-call prog.rb:11 new Class - * c-call prog.rb:11 initialize Object - * c-return prog.rb:11 initialize Object - * c-return prog.rb:11 new Class - * line prog.rb:12 false - * call prog.rb:2 test Test - * line prog.rb:3 test Test - * line prog.rb:4 test Test - * return prog.rb:4 test Test - */ - - -static VALUE -set_trace_func(obj, trace) - VALUE obj, trace; -{ - rb_event_hook_t *hook; - - rb_secure(4); - if (NIL_P(trace)) { - trace_func = 0; - rb_remove_event_hook(call_trace_func); - return Qnil; - } - if (!rb_obj_is_proc(trace)) { - rb_raise(rb_eTypeError, "trace_func needs to be Proc"); - } - trace_func = trace; - for (hook = event_hooks; hook; hook = hook->next) { - if (hook->func == call_trace_func) - return trace; - } - rb_add_event_hook(call_trace_func, RUBY_EVENT_ALL); - return trace; -} - -static char * -get_event_name(rb_event_t event) -{ - switch (event) { - case RUBY_EVENT_LINE: - return "line"; - case RUBY_EVENT_CLASS: - return "class"; - case RUBY_EVENT_END: - return "end"; - case RUBY_EVENT_CALL: - return "call"; - case RUBY_EVENT_RETURN: - return "return"; - case RUBY_EVENT_C_CALL: - return "c-call"; - case RUBY_EVENT_C_RETURN: - return "c-return"; - case RUBY_EVENT_RAISE: - return "raise"; - default: - return "unknown"; - } -} - -static void -call_trace_func(event, node, self, id, klass) - rb_event_t event; - NODE *node; - VALUE self; - ID id; - VALUE klass; /* OK */ -{ - int state, raised; - struct FRAME *prev; - NODE *node_save; - VALUE srcfile; - char *event_name; - rb_thread_t th = curr_thread; - - if (!trace_func) return; - if (tracing) return; - if (ruby_in_compile) return; - if (id == ID_ALLOCATOR) return; - - if (!(node_save = ruby_current_node)) { - node_save = NEW_NEWLINE(0); - } - tracing = 1; - prev = ruby_frame; - PUSH_FRAME(); - *ruby_frame = *prev; - ruby_frame->prev = prev; - ruby_frame->iter = 0; /* blocks not available anyway */ - - if (node) { - ruby_current_node = node; - ruby_frame->node = node; - ruby_sourcefile = node->nd_file; - ruby_sourceline = nd_line(node); - } - if (klass) { - if (TYPE(klass) == T_ICLASS) { - klass = RBASIC(klass)->klass; - } - else if (FL_TEST(klass, FL_SINGLETON)) { - klass = rb_iv_get(klass, "__attached__"); - } - } - PUSH_TAG(PROT_NONE); - raised = rb_thread_reset_raised(th); - if ((state = EXEC_TAG()) == 0) { - srcfile = rb_str_new2(ruby_sourcefile?ruby_sourcefile:"(ruby)"); - event_name = get_event_name(event); - proc_invoke(trace_func, rb_ary_new3(6, rb_str_new2(event_name), - srcfile, - INT2FIX(ruby_sourceline), - id?ID2SYM(id):Qnil, - self?rb_f_binding(self):Qnil, - klass), - Qundef, 0); - } - if (raised) rb_thread_set_raised(th); - POP_TAG(); - POP_FRAME(); - - tracing = 0; - ruby_current_node = node_save; - SET_CURRENT_SOURCE(); - if (state) JUMP_TAG(state); -} - -static VALUE -avalue_to_svalue(v) - VALUE v; -{ - VALUE tmp, top; - - tmp = rb_check_array_type(v); - if (NIL_P(tmp)) { - return v; - } - if (RARRAY(tmp)->len == 0) { - return Qundef; - } - if (RARRAY(tmp)->len == 1) { - top = rb_check_array_type(RARRAY(tmp)->ptr[0]); - if (NIL_P(top)) { - return RARRAY(tmp)->ptr[0]; - } - if (RARRAY(top)->len > 1) { - return v; - } - return top; - } - return tmp; -} - -static VALUE -svalue_to_avalue(v) - VALUE v; -{ - VALUE tmp, top; - - if (v == Qundef) return rb_ary_new2(0); - tmp = rb_check_array_type(v); - if (NIL_P(tmp)) { - return rb_ary_new3(1, v); - } - if (RARRAY(tmp)->len == 1) { - top = rb_check_array_type(RARRAY(tmp)->ptr[0]); - if (!NIL_P(top) && RARRAY(top)->len > 1) { - return tmp; - } - return rb_ary_new3(1, v); - } - return tmp; -} - -static VALUE -svalue_to_mrhs(v, lhs) - VALUE v; - NODE *lhs; -{ - VALUE tmp; - - if (v == Qundef) return rb_ary_new2(0); - tmp = rb_check_array_type(v); - if (NIL_P(tmp)) { - return rb_ary_new3(1, v); - } - /* no lhs means splat lhs only */ - if (!lhs) { - return rb_ary_new3(1, v); - } - return tmp; -} - -static VALUE -avalue_splat(v) - VALUE v; -{ - if (RARRAY(v)->len == 0) { - return Qundef; - } - if (RARRAY(v)->len == 1) { - return RARRAY(v)->ptr[0]; - } - return v; -} - -#if 1 -VALUE -rb_Array(val) - VALUE val; -{ - VALUE tmp = rb_check_array_type(val); - - if (NIL_P(tmp)) { - /* hack to avoid invoke Object#to_a */ - VALUE origin; - ID id = rb_intern("to_a"); - - if (search_method(CLASS_OF(val), id, &origin) && - RCLASS(origin)->m_tbl != RCLASS(rb_mKernel)->m_tbl) { /* exclude Kernel#to_a */ - val = rb_funcall(val, id, 0); - if (TYPE(val) != T_ARRAY) { - rb_raise(rb_eTypeError, "`to_a' did not return Array"); - } - return val; - } - else { - return rb_ary_new3(1, val); - } - } - return tmp; -} -#endif - -static VALUE -splat_value(v) - VALUE v; -{ - if (NIL_P(v)) return rb_ary_new3(1, Qnil); - return rb_Array(v); -} - -static VALUE -class_prefix(self, cpath) - VALUE self; - NODE *cpath; -{ - if (!cpath) { - rb_bug("class path missing"); - } - if (cpath->nd_head) { - VALUE c = rb_eval(self, cpath->nd_head); - switch (TYPE(c)) { - case T_CLASS: - case T_MODULE: - break; - default: - rb_raise(rb_eTypeError, "%s is not a class/module", - RSTRING(rb_obj_as_string(c))->ptr); - } - return c; - } - else if (nd_type(cpath) == NODE_COLON2) { - return ruby_cbase; - } - else if (ruby_wrapper) { - return ruby_wrapper; - } - else { - return rb_cObject; - } -} - -#define return_value(v) do {\ - if ((prot_tag->retval = (v)) == Qundef) {\ - prot_tag->retval = Qnil;\ - }\ -} while (0) - -NORETURN(static void return_jump _((VALUE))); -NORETURN(static void break_jump _((VALUE))); -NORETURN(static void next_jump _((VALUE))); -NORETURN(static void unknown_node _((NODE * volatile))); - -static void -unknown_node(node) - NODE *volatile node; -{ - ruby_current_node = 0; - if (node->flags == 0) { - rb_bug("terminated node (0x%lx)", node); - } - else if (BUILTIN_TYPE(node) != T_NODE) { - rb_bug("not a node 0x%02lx (0x%lx)", BUILTIN_TYPE(node), node); - } - else { - rb_bug("unknown node type %d (0x%lx)", nd_type(node), node); - } -} - -static VALUE -rb_eval(self, n) - VALUE self; - NODE *n; -{ - NODE * volatile contnode = 0; - NODE * volatile node = n; - int state; - volatile VALUE result = Qnil; - st_data_t data; - -#define RETURN(v) do { \ - result = (v); \ - goto finish; \ -} while (0) - - again: - if (!node) RETURN(Qnil); - - ruby_current_node = node; - switch (nd_type(node)) { - case NODE_BLOCK: - if (contnode) { - result = rb_eval(self, node); - break; - } - contnode = node->nd_next; - node = node->nd_head; - goto again; - - case NODE_POSTEXE: - rb_f_END(); - nd_set_type(node, NODE_NIL); /* exec just once */ - result = Qnil; - break; - - /* begin .. end without clauses */ - case NODE_BEGIN: - node = node->nd_body; - goto again; - - /* nodes for speed-up(default match) */ - case NODE_MATCH: - result = rb_reg_match2(node->nd_lit); - break; - - /* nodes for speed-up(literal match) */ - case NODE_MATCH2: - { - VALUE l = rb_eval(self,node->nd_recv); - VALUE r = rb_eval(self,node->nd_value); - result = rb_reg_match(l, r); - } - break; - - /* nodes for speed-up(literal match) */ - case NODE_MATCH3: - { - VALUE r = rb_eval(self,node->nd_recv); - VALUE l = rb_eval(self,node->nd_value); - if (TYPE(l) == T_STRING) { - result = rb_reg_match(r, l); - } - else { - result = rb_funcall(l, match, 1, r); - } - } - break; - - /* node for speed-up(top-level loop for -n/-p) */ - case NODE_OPT_N: - PUSH_TAG(PROT_LOOP); - switch (state = EXEC_TAG()) { - case 0: - opt_n_next: - while (!NIL_P(rb_gets())) { - opt_n_redo: - rb_eval(self, node->nd_body); - } - break; - - case TAG_REDO: - state = 0; - goto opt_n_redo; - case TAG_NEXT: - state = 0; - goto opt_n_next; - case TAG_BREAK: - state = 0; - default: - break; - } - POP_TAG(); - if (state) JUMP_TAG(state); - RETURN(Qnil); - - case NODE_SELF: - RETURN(self); - - case NODE_NIL: - RETURN(Qnil); - - case NODE_TRUE: - RETURN(Qtrue); - - case NODE_FALSE: - RETURN(Qfalse); - - case NODE_IF: - EXEC_EVENT_HOOK(RUBY_EVENT_LINE, node, self, - ruby_frame->last_func, - ruby_frame->last_class); - if (RTEST(rb_eval(self, node->nd_cond))) { - node = node->nd_body; - } - else { - node = node->nd_else; - } - goto again; - - case NODE_WHEN: - while (node) { - NODE *tag; - - if (nd_type(node) != NODE_WHEN) goto again; - tag = node->nd_head; - while (tag) { - EXEC_EVENT_HOOK(RUBY_EVENT_LINE, tag, self, - ruby_frame->last_func, - ruby_frame->last_class); - if (tag->nd_head && nd_type(tag->nd_head) == NODE_WHEN) { - VALUE v = rb_eval(self, tag->nd_head->nd_head); - long i; - - if (TYPE(v) != T_ARRAY) v = rb_ary_to_ary(v); - for (i=0; ilen; i++) { - if (RTEST(RARRAY(v)->ptr[i])) { - node = node->nd_body; - goto again; - } - } - tag = tag->nd_next; - continue; - } - if (RTEST(rb_eval(self, tag->nd_head))) { - node = node->nd_body; - goto again; - } - tag = tag->nd_next; - } - node = node->nd_next; - } - RETURN(Qnil); - - case NODE_CASE: - { - VALUE val; - - val = rb_eval(self, node->nd_head); - node = node->nd_body; - while (node) { - NODE *tag; - - if (nd_type(node) != NODE_WHEN) { - goto again; - } - tag = node->nd_head; - while (tag) { - EXEC_EVENT_HOOK(RUBY_EVENT_LINE, tag, self, - ruby_frame->last_func, - ruby_frame->last_class); - if (tag->nd_head && nd_type(tag->nd_head) == NODE_WHEN) { - VALUE v = rb_eval(self, tag->nd_head->nd_head); - long i; - - if (TYPE(v) != T_ARRAY) v = rb_ary_to_ary(v); - for (i=0; ilen; i++) { - if (RTEST(rb_funcall2(RARRAY(v)->ptr[i], eqq, 1, &val))){ - node = node->nd_body; - goto again; - } - } - tag = tag->nd_next; - continue; - } - if (RTEST(rb_funcall2(rb_eval(self, tag->nd_head), eqq, 1, &val))) { - node = node->nd_body; - goto again; - } - tag = tag->nd_next; - } - node = node->nd_next; - } - } - RETURN(Qnil); - - case NODE_WHILE: - PUSH_TAG(PROT_LOOP); - result = Qnil; - switch (state = EXEC_TAG()) { - case 0: - if (node->nd_state && !RTEST(rb_eval(self, node->nd_cond))) - goto while_out; - do { - while_redo: - rb_eval(self, node->nd_body); - while_next: - ; - } while (RTEST(rb_eval(self, node->nd_cond))); - break; - - case TAG_REDO: - state = 0; - goto while_redo; - case TAG_NEXT: - state = 0; - goto while_next; - case TAG_BREAK: - if (TAG_DST()) { - state = 0; - result = prot_tag->retval; - } - /* fall through */ - default: - break; - } - while_out: - POP_TAG(); - if (state) JUMP_TAG(state); - RETURN(result); - - case NODE_UNTIL: - PUSH_TAG(PROT_LOOP); - result = Qnil; - switch (state = EXEC_TAG()) { - case 0: - if (node->nd_state && RTEST(rb_eval(self, node->nd_cond))) - goto until_out; - do { - until_redo: - rb_eval(self, node->nd_body); - until_next: - ; - } while (!RTEST(rb_eval(self, node->nd_cond))); - break; - - case TAG_REDO: - state = 0; - goto until_redo; - case TAG_NEXT: - state = 0; - goto until_next; - case TAG_BREAK: - if (TAG_DST()) { - state = 0; - result = prot_tag->retval; - } - /* fall through */ - default: - break; - } - until_out: - POP_TAG(); - if (state) JUMP_TAG(state); - RETURN(result); - - case NODE_BLOCK_PASS: - result = block_pass(self, node); - break; - - case NODE_ITER: - case NODE_FOR: - { - PUSH_TAG(PROT_LOOP); - PUSH_BLOCK(node->nd_var, node->nd_body); - - state = EXEC_TAG(); - if (state == 0) { - iter_retry: - PUSH_ITER(ITER_PRE); - if (nd_type(node) == NODE_ITER) { - result = rb_eval(self, node->nd_iter); - } - else { - VALUE recv; - - _block.flags &= ~BLOCK_D_SCOPE; - BEGIN_CALLARGS; - recv = rb_eval(self, node->nd_iter); - END_CALLARGS; - ruby_current_node = node; - SET_CURRENT_SOURCE(); - result = rb_call(CLASS_OF(recv),recv,each,0,0,0,self); - } - POP_ITER(); - } - else if (state == TAG_BREAK && TAG_DST()) { - result = prot_tag->retval; - state = 0; - } - else if (state == TAG_RETRY) { - state = 0; - goto iter_retry; - } - POP_BLOCK(); - POP_TAG(); - switch (state) { - case 0: - break; - default: - JUMP_TAG(state); - } - } - break; - - case NODE_BREAK: - break_jump(rb_eval(self, node->nd_stts)); - break; - - case NODE_NEXT: - CHECK_INTS; - next_jump(rb_eval(self, node->nd_stts)); - break; - - case NODE_REDO: - CHECK_INTS; - JUMP_TAG(TAG_REDO); - break; - - case NODE_RETRY: - CHECK_INTS; - JUMP_TAG(TAG_RETRY); - break; - - case NODE_SPLAT: - result = splat_value(rb_eval(self, node->nd_head)); - break; - - case NODE_TO_ARY: - result = rb_ary_to_ary(rb_eval(self, node->nd_head)); - break; - - case NODE_SVALUE: - result = avalue_splat(rb_eval(self, node->nd_head)); - if (result == Qundef) result = Qnil; - break; - - case NODE_YIELD: - if (node->nd_head) { - result = rb_eval(self, node->nd_head); - ruby_current_node = node; - } - else { - result = Qundef; /* no arg */ - } - SET_CURRENT_SOURCE(); - result = rb_yield_0(result, 0, 0, 0, node->nd_state); - break; - - case NODE_RESCUE: - { - volatile VALUE e_info = ruby_errinfo; - volatile int rescuing = 0; - - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - retry_entry: - result = rb_eval(self, node->nd_head); - } - else if (rescuing) { - if (rescuing < 0) { - /* in rescue argument, just reraise */ - } - else if (state == TAG_RETRY) { - rescuing = state = 0; - ruby_errinfo = e_info; - goto retry_entry; - } - else if (state != TAG_RAISE) { - result = prot_tag->retval; - } - } - else if (state == TAG_RAISE) { - NODE *resq = node->nd_resq; - - rescuing = -1; - while (resq) { - ruby_current_node = resq; - if (handle_rescue(self, resq)) { - state = 0; - rescuing = 1; - result = rb_eval(self, resq->nd_body); - break; - } - resq = resq->nd_head; /* next rescue */ - } - } - else { - result = prot_tag->retval; - } - POP_TAG(); - if (state != TAG_RAISE) ruby_errinfo = e_info; - if (state) { - JUMP_TAG(state); - } - /* no exception raised */ - if (!rescuing && (node = node->nd_else)) { /* else clause given */ - goto again; - } - } - break; - - case NODE_ENSURE: - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - result = rb_eval(self, node->nd_head); - } - POP_TAG(); - if (node->nd_ensr && !thread_no_ensure()) { - VALUE retval = prot_tag->retval; /* save retval */ - VALUE errinfo = ruby_errinfo; - - rb_eval(self, node->nd_ensr); - return_value(retval); - ruby_errinfo = errinfo; - } - if (state) JUMP_TAG(state); - break; - - case NODE_AND: - result = rb_eval(self, node->nd_1st); - if (!RTEST(result)) break; - node = node->nd_2nd; - goto again; - - case NODE_OR: - result = rb_eval(self, node->nd_1st); - if (RTEST(result)) break; - node = node->nd_2nd; - goto again; - - case NODE_NOT: - if (RTEST(rb_eval(self, node->nd_body))) result = Qfalse; - else result = Qtrue; - break; - - case NODE_DOT2: - case NODE_DOT3: - { - VALUE beg = rb_eval(self, node->nd_beg); - VALUE end = rb_eval(self, node->nd_end); - result = rb_range_new(beg, end, nd_type(node) == NODE_DOT3); - } - break; - - case NODE_FLIP2: /* like AWK */ - { - VALUE *flip = rb_svar(node->nd_cnt); - if (!flip) rb_bug("unexpected local variable"); - if (!RTEST(*flip)) { - if (RTEST(rb_eval(self, node->nd_beg))) { - *flip = RTEST(rb_eval(self, node->nd_end))?Qfalse:Qtrue; - result = Qtrue; - } - else { - result = Qfalse; - } - } - else { - if (RTEST(rb_eval(self, node->nd_end))) { - *flip = Qfalse; - } - result = Qtrue; - } - } - break; - - case NODE_FLIP3: /* like SED */ - { - VALUE *flip = rb_svar(node->nd_cnt); - if (!flip) rb_bug("unexpected local variable"); - if (!RTEST(*flip)) { - result = RTEST(rb_eval(self, node->nd_beg)) ? Qtrue : Qfalse; - *flip = result; - } - else { - if (RTEST(rb_eval(self, node->nd_end))) { - *flip = Qfalse; - } - result = Qtrue; - } - } - break; - - case NODE_RETURN: - return_jump(rb_eval(self, node->nd_stts)); - break; - - case NODE_ARGSCAT: - { - VALUE args = rb_eval(self, node->nd_head); - result = rb_ary_concat(args, splat_value(rb_eval(self, node->nd_body))); - } - break; - - case NODE_ARGSPUSH: - { - VALUE args = rb_ary_dup(rb_eval(self, node->nd_head)); - result = rb_ary_push(args, rb_eval(self, node->nd_body)); - } - break; - - case NODE_ATTRASGN: - { - VALUE recv; - int argc; VALUE *argv; /* used in SETUP_ARGS */ - int scope; - TMP_PROTECT; - - BEGIN_CALLARGS; - if (node->nd_recv == (NODE *)1) { - recv = self; - scope = 1; - } - else { - recv = rb_eval(self, node->nd_recv); - scope = 0; - } - SETUP_ARGS(node->nd_args); - END_CALLARGS; - - ruby_current_node = node; - SET_CURRENT_SOURCE(); - rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,scope,self); - result = argv[argc-1]; - } - break; - - case NODE_CALL: - { - VALUE recv; - int argc; VALUE *argv; /* used in SETUP_ARGS */ - TMP_PROTECT; - - BEGIN_CALLARGS; - recv = rb_eval(self, node->nd_recv); - SETUP_ARGS(node->nd_args); - END_CALLARGS; - - ruby_current_node = node; - SET_CURRENT_SOURCE(); - result = rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,0,self); - } - break; - - case NODE_FCALL: - { - int argc; VALUE *argv; /* used in SETUP_ARGS */ - TMP_PROTECT; - - BEGIN_CALLARGS; - SETUP_ARGS(node->nd_args); - END_CALLARGS; - - ruby_current_node = node; - SET_CURRENT_SOURCE(); - result = rb_call(CLASS_OF(self),self,node->nd_mid,argc,argv,1,self); - } - break; - - case NODE_VCALL: - SET_CURRENT_SOURCE(); - result = rb_call(CLASS_OF(self),self,node->nd_mid,0,0,2,self); - break; - - case NODE_SUPER: - case NODE_ZSUPER: - { - int argc; VALUE *argv; /* used in SETUP_ARGS */ - TMP_PROTECT; - - if (ruby_frame->last_class == 0) { - if (ruby_frame->last_func) { - rb_name_error(ruby_frame->last_func, - "superclass method `%s' disabled", - rb_id2name(ruby_frame->orig_func)); - } - else { - rb_raise(rb_eNoMethodError, "super called outside of method"); - } - } - if (nd_type(node) == NODE_ZSUPER) { - argc = ruby_frame->argc; - if (argc && DMETHOD_P()) { - if (TYPE(RBASIC(ruby_scope)->klass) != T_ARRAY || - RARRAY(RBASIC(ruby_scope)->klass)->len != argc) { - rb_raise(rb_eRuntimeError, - "super: specify arguments explicitly"); - } - argv = RARRAY(RBASIC(ruby_scope)->klass)->ptr; - } - else if (!ruby_scope->local_vars) { - argc = 0; - argv = 0; - } - else { - argv = ruby_scope->local_vars + 2; - } - } - else { - BEGIN_CALLARGS; - SETUP_ARGS(node->nd_args); - END_CALLARGS; - ruby_current_node = node; - } - - SET_CURRENT_SOURCE(); - result = rb_call_super(argc, argv); - } - break; - - case NODE_SCOPE: - { - struct FRAME frame; - NODE *saved_cref = 0; - - frame = *ruby_frame; - frame.tmp = ruby_frame; - ruby_frame = &frame; - - PUSH_SCOPE(); - PUSH_TAG(PROT_NONE); - if (node->nd_rval) { - saved_cref = ruby_cref; - ruby_cref = (NODE*)node->nd_rval; - } - if (node->nd_tbl) { - VALUE *vars = ALLOCA_N(VALUE, node->nd_tbl[0]+1); - *vars++ = (VALUE)node; - ruby_scope->local_vars = vars; - rb_mem_clear(ruby_scope->local_vars, node->nd_tbl[0]); - ruby_scope->local_tbl = node->nd_tbl; - } - else { - ruby_scope->local_vars = 0; - ruby_scope->local_tbl = 0; - } - if ((state = EXEC_TAG()) == 0) { - result = rb_eval(self, node->nd_next); - } - POP_TAG(); - POP_SCOPE(); - ruby_frame = frame.tmp; - if (saved_cref) - ruby_cref = saved_cref; - if (state) JUMP_TAG(state); - } - break; - - case NODE_OP_ASGN1: - { - int argc; VALUE *argv; /* used in SETUP_ARGS */ - VALUE recv, val, tmp; - NODE *rval; - TMP_PROTECT; - - recv = rb_eval(self, node->nd_recv); - rval = node->nd_args->nd_head; - SETUP_ARGS0(node->nd_args->nd_body, 1); - val = rb_funcall3(recv, aref, argc, argv); - switch (node->nd_mid) { - case 0: /* OR */ - if (RTEST(val)) RETURN(val); - val = rb_eval(self, rval); - break; - case 1: /* AND */ - if (!RTEST(val)) RETURN(val); - val = rb_eval(self, rval); - break; - default: - tmp = rb_eval(self, rval); - val = rb_funcall3(val, node->nd_mid, 1, &tmp); - } - argv[argc] = val; - rb_funcall2(recv, aset, argc+1, argv); - result = val; - } - break; - - case NODE_OP_ASGN2: - { - ID id = node->nd_next->nd_vid; - VALUE recv, val, tmp; - - recv = rb_eval(self, node->nd_recv); - val = rb_funcall3(recv, id, 0, 0); - switch (node->nd_next->nd_mid) { - case 0: /* OR */ - if (RTEST(val)) RETURN(val); - val = rb_eval(self, node->nd_value); - break; - case 1: /* AND */ - if (!RTEST(val)) RETURN(val); - val = rb_eval(self, node->nd_value); - break; - default: - tmp = rb_eval(self, node->nd_value); - val = rb_funcall3(val, node->nd_next->nd_mid, 1, &tmp); - } - - rb_funcall2(recv, node->nd_next->nd_aid, 1, &val); - result = val; - } - break; - - case NODE_OP_ASGN_AND: - result = rb_eval(self, node->nd_head); - if (!RTEST(result)) break; - node = node->nd_value; - goto again; - - case NODE_OP_ASGN_OR: - if ((node->nd_aid && !is_defined(self, node->nd_head, 0)) || - !RTEST(result = rb_eval(self, node->nd_head))) { - node = node->nd_value; - goto again; - } - break; - - case NODE_MASGN: - result = massign(self, node, rb_eval(self, node->nd_value), 0); - break; - - case NODE_LASGN: - if (ruby_scope->local_vars == 0) - rb_bug("unexpected local variable assignment"); - result = rb_eval(self, node->nd_value); - ruby_scope->local_vars[node->nd_cnt] = result; - break; - - case NODE_DASGN: - result = rb_eval(self, node->nd_value); - dvar_asgn(node->nd_vid, result); - break; - - case NODE_DASGN_CURR: - result = rb_eval(self, node->nd_value); - dvar_asgn_curr(node->nd_vid, result); - break; - - case NODE_GASGN: - result = rb_eval(self, node->nd_value); - rb_gvar_set(node->nd_entry, result); - break; - - case NODE_IASGN: - result = rb_eval(self, node->nd_value); - rb_ivar_set(self, node->nd_vid, result); - break; - - case NODE_CDECL: - result = rb_eval(self, node->nd_value); - if (node->nd_vid == 0) { - rb_const_set(class_prefix(self, node->nd_else), node->nd_else->nd_mid, result); - } - else { - rb_const_set(ruby_cbase, node->nd_vid, result); - } - break; - - case NODE_CVDECL: - if (NIL_P(ruby_cbase)) { - rb_raise(rb_eTypeError, "no class/module to define class variable"); - } - result = rb_eval(self, node->nd_value); - rb_cvar_set(cvar_cbase(), node->nd_vid, result, Qtrue); - break; - - case NODE_CVASGN: - result = rb_eval(self, node->nd_value); - rb_cvar_set(cvar_cbase(), node->nd_vid, result, Qfalse); - break; - - case NODE_LVAR: - if (ruby_scope->local_vars == 0) { - rb_bug("unexpected local variable"); - } - result = ruby_scope->local_vars[node->nd_cnt]; - break; - - case NODE_DVAR: - result = rb_dvar_ref(node->nd_vid); - break; - - case NODE_GVAR: - result = rb_gvar_get(node->nd_entry); - break; - - case NODE_IVAR: - result = rb_ivar_get(self, node->nd_vid); - break; - - case NODE_CONST: - result = ev_const_get(ruby_cref, node->nd_vid, self); - break; - - case NODE_CVAR: - result = rb_cvar_get(cvar_cbase(), node->nd_vid); - break; - - case NODE_BLOCK_ARG: - if (ruby_scope->local_vars == 0) - rb_bug("unexpected block argument"); - if (rb_block_given_p()) { - result = rb_block_proc(); - ruby_scope->local_vars[node->nd_cnt] = result; - } - else { - result = Qnil; - } - break; - - case NODE_COLON2: - { - VALUE klass; - - klass = rb_eval(self, node->nd_head); - if (rb_is_const_id(node->nd_mid)) { - switch (TYPE(klass)) { - case T_CLASS: - case T_MODULE: - result = rb_const_get_from(klass, node->nd_mid); - break; - default: - rb_raise(rb_eTypeError, "%s is not a class/module", - RSTRING(rb_obj_as_string(klass))->ptr); - break; - } - } - else { - result = rb_funcall(klass, node->nd_mid, 0, 0); - } - } - break; - - case NODE_COLON3: - result = rb_const_get_from(rb_cObject, node->nd_mid); - break; - - case NODE_NTH_REF: - result = rb_reg_nth_match(node->nd_nth, MATCH_DATA); - break; - - case NODE_BACK_REF: - switch (node->nd_nth) { - case '&': - result = rb_reg_last_match(MATCH_DATA); - break; - case '`': - result = rb_reg_match_pre(MATCH_DATA); - break; - case '\'': - result = rb_reg_match_post(MATCH_DATA); - break; - case '+': - result = rb_reg_match_last(MATCH_DATA); - break; - default: - rb_bug("unexpected back-ref"); - } - break; - - case NODE_HASH: - { - NODE *list; - VALUE hash = rb_hash_new(); - VALUE key, val; - - list = node->nd_head; - while (list) { - key = rb_eval(self, list->nd_head); - list = list->nd_next; - if (list == 0) - rb_bug("odd number list for Hash"); - val = rb_eval(self, list->nd_head); - list = list->nd_next; - rb_hash_aset(hash, key, val); - } - result = hash; - } - break; - - case NODE_ZARRAY: /* zero length list */ - result = rb_ary_new(); - break; - - case NODE_ARRAY: - { - VALUE ary; - long i; - - i = node->nd_alen; - ary = rb_ary_new2(i); - for (i=0;node;node=node->nd_next) { - RARRAY(ary)->ptr[i++] = rb_eval(self, node->nd_head); - RARRAY(ary)->len = i; - } - - result = ary; - } - break; - - case NODE_STR: - result = rb_str_new3(node->nd_lit); - break; - - case NODE_EVSTR: - result = rb_obj_as_string(rb_eval(self, node->nd_body)); - break; - - case NODE_DSTR: - case NODE_DXSTR: - case NODE_DREGX: - case NODE_DREGX_ONCE: - case NODE_DSYM: - { - VALUE str, str2; - NODE *list = node->nd_next; - - str = rb_str_new3(node->nd_lit); - while (list) { - if (list->nd_head) { - switch (nd_type(list->nd_head)) { - case NODE_STR: - str2 = list->nd_head->nd_lit; - break; - default: - str2 = rb_eval(self, list->nd_head); - break; - } - rb_str_append(str, str2); - OBJ_INFECT(str, str2); - } - list = list->nd_next; - } - switch (nd_type(node)) { - case NODE_DREGX: - result = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len, - node->nd_cflag); - break; - case NODE_DREGX_ONCE: /* regexp expand once */ - result = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len, - node->nd_cflag); - nd_set_type(node, NODE_LIT); - node->nd_lit = result; - break; - case NODE_LIT: - /* other thread may replace NODE_DREGX_ONCE to NODE_LIT */ - goto again; - case NODE_DXSTR: - result = rb_funcall(self, '`', 1, str); - break; - case NODE_DSYM: - result = rb_str_intern(str); - break; - default: - result = str; - break; - } - } - break; - - case NODE_XSTR: - result = rb_funcall(self, '`', 1, rb_str_new3(node->nd_lit)); - break; - - case NODE_LIT: - result = node->nd_lit; - break; - - case NODE_DEFN: - if (node->nd_defn) { - NODE *body, *defn; - VALUE origin; - int noex; - - if (NIL_P(ruby_class)) { - rb_raise(rb_eTypeError, "no class/module to add method"); - } - if (ruby_class == rb_cObject && node->nd_mid == init) { - rb_warn("redefining Object#initialize may cause infinite loop"); - } - if (node->nd_mid == __id__ || node->nd_mid == __send__) { - rb_warn("redefining `%s' may cause serious problem", - rb_id2name(node->nd_mid)); - } - rb_frozen_class_p(ruby_class); - body = search_method(ruby_class, node->nd_mid, &origin); - if (body){ - if (RTEST(ruby_verbose) && ruby_class == origin && body->nd_cnt == 0 && body->nd_body) { - rb_warning("method redefined; discarding old %s", rb_id2name(node->nd_mid)); - } - } - - if (SCOPE_TEST(SCOPE_PRIVATE) || node->nd_mid == init) { - noex = NOEX_PRIVATE; - } - else if (SCOPE_TEST(SCOPE_PROTECTED)) { - noex = NOEX_PROTECTED; - } - else { - noex = NOEX_PUBLIC; - } - if (body && origin == ruby_class && body->nd_body == 0) { - noex |= NOEX_NOSUPER; - } - - defn = rb_copy_node_scope(node->nd_defn, ruby_cref); - rb_add_method(ruby_class, node->nd_mid, defn, noex); - if (scope_vmode == SCOPE_MODFUNC) { - rb_add_method(rb_singleton_class(ruby_class), - node->nd_mid, defn, NOEX_PUBLIC); - } - result = Qnil; - } - break; - - case NODE_DEFS: - if (node->nd_defn) { - VALUE recv = rb_eval(self, node->nd_recv); - VALUE klass; - NODE *body = 0, *defn; - - if (ruby_safe_level >= 4 && !OBJ_TAINTED(recv)) { - rb_raise(rb_eSecurityError, "Insecure: can't define singleton method"); - } - if (FIXNUM_P(recv) || SYMBOL_P(recv)) { - rb_raise(rb_eTypeError, - "can't define singleton method \"%s\" for %s", - rb_id2name(node->nd_mid), - rb_obj_classname(recv)); - } - - if (OBJ_FROZEN(recv)) rb_error_frozen("object"); - klass = rb_singleton_class(recv); - if (st_lookup(RCLASS(klass)->m_tbl, node->nd_mid, &data)) { - body = (NODE *)data; - if (ruby_safe_level >= 4) { - rb_raise(rb_eSecurityError, "redefining method prohibited"); - } - if (RTEST(ruby_verbose)) { - rb_warning("redefine %s", rb_id2name(node->nd_mid)); - } - } - defn = rb_copy_node_scope(node->nd_defn, ruby_cref); - rb_add_method(klass, node->nd_mid, defn, - NOEX_PUBLIC|(body?body->nd_noex&NOEX_UNDEF:0)); - result = Qnil; - } - break; - - case NODE_UNDEF: - if (NIL_P(ruby_class)) { - rb_raise(rb_eTypeError, "no class to undef method"); - } - rb_undef(ruby_class, rb_to_id(rb_eval(self, node->u2.node))); - result = Qnil; - break; - - case NODE_ALIAS: - if (NIL_P(ruby_class)) { - rb_raise(rb_eTypeError, "no class to make alias"); - } - rb_alias(ruby_class, rb_to_id(rb_eval(self, node->u1.node)), - rb_to_id(rb_eval(self, node->u2.node))); - result = Qnil; - break; - - case NODE_VALIAS: - rb_alias_variable(node->u1.id, node->u2.id); - result = Qnil; - break; - - case NODE_CLASS: - { - VALUE super, klass, tmp, cbase; - ID cname; - int gen = Qfalse; - - cbase = class_prefix(self, node->nd_cpath); - cname = node->nd_cpath->nd_mid; - - if (NIL_P(ruby_cbase)) { - rb_raise(rb_eTypeError, "no outer class/module"); - } - if (node->nd_super) { - super = rb_eval(self, node->nd_super); - rb_check_inheritable(super); - } - else { - super = 0; - } - - if (rb_const_defined_at(cbase, cname)) { - klass = rb_const_get_at(cbase, cname); - if (TYPE(klass) != T_CLASS) { - rb_raise(rb_eTypeError, "%s is not a class", - rb_id2name(cname)); - } - if (super) { - tmp = rb_class_real(RCLASS(klass)->super); - if (tmp != super) { - rb_raise(rb_eTypeError, "superclass mismatch for class %s", - rb_id2name(cname)); - } - super = 0; - } - if (ruby_safe_level >= 4) { - rb_raise(rb_eSecurityError, "extending class prohibited"); - } - } - else { - if (!super) super = rb_cObject; - klass = rb_define_class_id(cname, super); - rb_set_class_path(klass, cbase, rb_id2name(cname)); - rb_const_set(cbase, cname, klass); - gen = Qtrue; - } - if (ruby_wrapper) { - rb_extend_object(klass, ruby_wrapper); - rb_include_module(klass, ruby_wrapper); - } - if (super && gen) { - rb_class_inherited(super, klass); - } - result = module_setup(klass, node); - } - break; - - case NODE_MODULE: - { - VALUE module, cbase; - ID cname; - - if (NIL_P(ruby_cbase)) { - rb_raise(rb_eTypeError, "no outer class/module"); - } - cbase = class_prefix(self, node->nd_cpath); - cname = node->nd_cpath->nd_mid; - if (rb_const_defined_at(cbase, cname)) { - module = rb_const_get_at(cbase, cname); - if (TYPE(module) != T_MODULE) { - rb_raise(rb_eTypeError, "%s is not a module", - rb_id2name(cname)); - } - if (ruby_safe_level >= 4) { - rb_raise(rb_eSecurityError, "extending module prohibited"); - } - } - else { - module = rb_define_module_id(cname); - rb_set_class_path(module, cbase, rb_id2name(cname)); - rb_const_set(cbase, cname, module); - } - if (ruby_wrapper) { - rb_extend_object(module, ruby_wrapper); - rb_include_module(module, ruby_wrapper); - } - - result = module_setup(module, node); - } - break; - - case NODE_SCLASS: - { - VALUE klass; - - result = rb_eval(self, node->nd_recv); - if (FIXNUM_P(result) || SYMBOL_P(result)) { - rb_raise(rb_eTypeError, "no virtual class for %s", - rb_obj_classname(result)); - } - if (ruby_safe_level >= 4 && !OBJ_TAINTED(result)) - rb_raise(rb_eSecurityError, "Insecure: can't extend object"); - klass = rb_singleton_class(result); - - if (ruby_wrapper) { - rb_extend_object(klass, ruby_wrapper); - rb_include_module(klass, ruby_wrapper); - } - - result = module_setup(klass, node); - } - break; - - case NODE_DEFINED: - { - char buf[20]; - char *desc = is_defined(self, node->nd_head, buf); - - if (desc) result = rb_str_new2(desc); - else result = Qnil; - } - break; - - case NODE_NEWLINE: - EXEC_EVENT_HOOK(RUBY_EVENT_LINE, node, self, - ruby_frame->last_func, - ruby_frame->last_class); - node = node->nd_next; - goto again; - - default: - unknown_node(node); - } - finish: - CHECK_INTS; - if (contnode) { - node = contnode; - contnode = 0; - goto again; - } - return result; -} - -static VALUE -module_setup(module, n) - VALUE module; - NODE *n; -{ - NODE * volatile node = n->nd_body; - int state; - struct FRAME frame; - VALUE result = Qnil; /* OK */ - TMP_PROTECT; - - frame = *ruby_frame; - frame.tmp = ruby_frame; - ruby_frame = &frame; - - PUSH_CLASS(module); - PUSH_SCOPE(); - PUSH_VARS(); - - if (node->nd_tbl) { - VALUE *vars = TMP_ALLOC(node->nd_tbl[0]+1); - *vars++ = (VALUE)node; - ruby_scope->local_vars = vars; - rb_mem_clear(ruby_scope->local_vars, node->nd_tbl[0]); - ruby_scope->local_tbl = node->nd_tbl; - } - else { - ruby_scope->local_vars = 0; - ruby_scope->local_tbl = 0; - } - - PUSH_CREF(module); - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - EXEC_EVENT_HOOK(RUBY_EVENT_CLASS, n, ruby_cbase, - ruby_frame->last_func, ruby_frame->last_class); - result = rb_eval(ruby_cbase, node->nd_next); - } - POP_TAG(); - POP_CREF(); - POP_VARS(); - POP_SCOPE(); - POP_CLASS(); - - ruby_frame = frame.tmp; - EXEC_EVENT_HOOK(RUBY_EVENT_END, n, 0, - ruby_frame->last_func, ruby_frame->last_class); - if (state) JUMP_TAG(state); - - return result; -} - -static NODE *basic_respond_to = 0; - -int -rb_obj_respond_to(obj, id, priv) - VALUE obj; - ID id; - int priv; -{ - VALUE klass = CLASS_OF(obj); - - if (rb_method_node(klass, respond_to) == basic_respond_to) { - return rb_method_boundp(klass, id, !priv); - } - else { - VALUE args[2]; - int n = 0; - args[n++] = ID2SYM(id); - if (priv) args[n++] = Qtrue; - return RTEST(rb_funcall2(obj, respond_to, n, args)); - } -} - -int -rb_respond_to(obj, id) - VALUE obj; - ID id; -{ - return rb_obj_respond_to(obj, id, Qfalse); -} - -/* - * call-seq: - * obj.respond_to?(symbol, include_private=false) => true or false - * - * Returns +true+> if _obj_ responds to the given - * method. Private methods are included in the search only if the - * optional second parameter evaluates to +true+. - */ - -static VALUE -obj_respond_to(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - VALUE mid, priv; - ID id; - - rb_scan_args(argc, argv, "11", &mid, &priv); - id = rb_to_id(mid); - if (rb_method_boundp(CLASS_OF(obj), id, !RTEST(priv))) { - return Qtrue; - } - return Qfalse; -} - -/* - * call-seq: - * mod.method_defined?(symbol) => true or false - * - * Returns +true+ if the named method is defined by - * _mod_ (or its included modules and, if _mod_ is a class, - * its ancestors). Public and protected methods are matched. - * - * module A - * def method1() end - * end - * class B - * def method2() end - * end - * class C < B - * include A - * def method3() end - * end - * - * A.method_defined? :method1 #=> true - * C.method_defined? "method1" #=> true - * C.method_defined? "method2" #=> true - * C.method_defined? "method3" #=> true - * C.method_defined? "method4" #=> false - */ - -static VALUE -rb_mod_method_defined(mod, mid) - VALUE mod, mid; -{ - return rb_method_boundp(mod, rb_to_id(mid), 1); -} - -#define VISI_CHECK(x,f) (((x)&NOEX_MASK) == (f)) - -/* - * call-seq: - * mod.public_method_defined?(symbol) => true or false - * - * Returns +true+ if the named public method is defined by - * _mod_ (or its included modules and, if _mod_ is a class, - * its ancestors). - * - * module A - * def method1() end - * end - * class B - * protected - * def method2() end - * end - * class C < B - * include A - * def method3() end - * end - * - * A.method_defined? :method1 #=> true - * C.public_method_defined? "method1" #=> true - * C.public_method_defined? "method2" #=> false - * C.method_defined? "method2" #=> true - */ - -static VALUE -rb_mod_public_method_defined(mod, mid) - VALUE mod, mid; -{ - ID id = rb_to_id(mid); - int noex; - - if (rb_get_method_body(&mod, &id, &noex)) { - if (VISI_CHECK(noex, NOEX_PUBLIC)) - return Qtrue; - } - return Qfalse; -} - -/* - * call-seq: - * mod.private_method_defined?(symbol) => true or false - * - * Returns +true+ if the named private method is defined by - * _ mod_ (or its included modules and, if _mod_ is a class, - * its ancestors). - * - * module A - * def method1() end - * end - * class B - * private - * def method2() end - * end - * class C < B - * include A - * def method3() end - * end - * - * A.method_defined? :method1 #=> true - * C.private_method_defined? "method1" #=> false - * C.private_method_defined? "method2" #=> true - * C.method_defined? "method2" #=> false - */ - -static VALUE -rb_mod_private_method_defined(mod, mid) - VALUE mod, mid; -{ - ID id = rb_to_id(mid); - int noex; - - if (rb_get_method_body(&mod, &id, &noex)) { - if (VISI_CHECK(noex, NOEX_PRIVATE)) - return Qtrue; - } - return Qfalse; -} - -/* - * call-seq: - * mod.protected_method_defined?(symbol) => true or false - * - * Returns +true+ if the named protected method is defined - * by _mod_ (or its included modules and, if _mod_ is a - * class, its ancestors). - * - * module A - * def method1() end - * end - * class B - * protected - * def method2() end - * end - * class C < B - * include A - * def method3() end - * end - * - * A.method_defined? :method1 #=> true - * C.protected_method_defined? "method1" #=> false - * C.protected_method_defined? "method2" #=> true - * C.method_defined? "method2" #=> true - */ - -static VALUE -rb_mod_protected_method_defined(mod, mid) - VALUE mod, mid; -{ - ID id = rb_to_id(mid); - int noex; - - if (rb_get_method_body(&mod, &id, &noex)) { - if (VISI_CHECK(noex, NOEX_PROTECTED)) - return Qtrue; - } - return Qfalse; -} - -NORETURN(static VALUE terminate_process _((int, VALUE))); -static VALUE -terminate_process(status, mesg) - int status; - VALUE mesg; -{ - VALUE args[2]; - args[0] = INT2NUM(status); - args[1] = mesg; - - rb_exc_raise(rb_class_new_instance(2, args, rb_eSystemExit)); -} - -void -rb_exit(status) - int status; -{ - if (prot_tag) { - terminate_process(status, rb_str_new("exit", 4)); - } - ruby_finalize(); - exit(status); -} - - -/* - * call-seq: - * exit(integer=0) - * Kernel::exit(integer=0) - * Process::exit(integer=0) - * - * Initiates the termination of the Ruby script by raising the - * SystemExit exception. This exception may be caught. The - * optional parameter is used to return a status code to the invoking - * environment. - * - * begin - * exit - * puts "never get here" - * rescue SystemExit - * puts "rescued a SystemExit exception" - * end - * puts "after begin block" - * - * produces: - * - * rescued a SystemExit exception - * after begin block - * - * Just prior to termination, Ruby executes any at_exit functions - * (see Kernel::at_exit) and runs any object finalizers (see - * ObjectSpace::define_finalizer). - * - * at_exit { puts "at_exit function" } - * ObjectSpace.define_finalizer("string", proc { puts "in finalizer" }) - * exit - * - * produces: - * - * at_exit function - * in finalizer - */ - -VALUE -rb_f_exit(argc, argv) - int argc; - VALUE *argv; -{ - VALUE status; - int istatus; - - rb_secure(4); - if (rb_scan_args(argc, argv, "01", &status) == 1) { - switch (status) { - case Qtrue: - istatus = EXIT_SUCCESS; - break; - case Qfalse: - istatus = EXIT_FAILURE; - break; - default: - istatus = NUM2INT(status); -#if EXIT_SUCCESS != 0 - if (istatus == 0) istatus = EXIT_SUCCESS; -#endif - break; - } - } - else { - istatus = EXIT_SUCCESS; - } - rb_exit(istatus); - return Qnil; /* not reached */ -} - - -/* - * call-seq: - * abort - * Kernel::abort - * Process::abort - * - * Terminate execution immediately, effectively by calling - * Kernel.exit(1). If _msg_ is given, it is written - * to STDERR prior to terminating. - */ - -VALUE -rb_f_abort(argc, argv) - int argc; - VALUE *argv; -{ - rb_secure(4); - if (argc == 0) { - if (!NIL_P(ruby_errinfo)) { - error_print(); - } - rb_exit(EXIT_FAILURE); - } - else { - VALUE mesg; - - rb_scan_args(argc, argv, "1", &mesg); - StringValue(mesg); - rb_io_puts(1, &mesg, rb_stderr); - terminate_process(EXIT_FAILURE, mesg); - } - return Qnil; /* not reached */ -} - -void -rb_iter_break() -{ - break_jump(Qnil); -} - -NORETURN(static void rb_longjmp _((int, VALUE))); -static VALUE make_backtrace _((void)); - -static void -rb_longjmp(tag, mesg) - int tag; - VALUE mesg; -{ - VALUE at; - rb_thread_t th = curr_thread; - - if (rb_thread_set_raised(th)) { - ruby_errinfo = exception_error; - JUMP_TAG(TAG_FATAL); - } - if (NIL_P(mesg)) mesg = ruby_errinfo; - if (NIL_P(mesg)) { - mesg = rb_exc_new(rb_eRuntimeError, 0, 0); - } - - ruby_set_current_source(); - if (ruby_sourcefile && !NIL_P(mesg)) { - at = get_backtrace(mesg); - if (NIL_P(at)) { - at = make_backtrace(); - if (OBJ_FROZEN(mesg)) { - mesg = rb_obj_dup(mesg); - } - set_backtrace(mesg, at); - } - } - if (!NIL_P(mesg)) { - ruby_errinfo = mesg; - } - - if (RTEST(ruby_debug) && !NIL_P(ruby_errinfo) - && !rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) { - VALUE e = ruby_errinfo; - int status; - - PUSH_TAG(PROT_NONE); - if ((status = EXEC_TAG()) == 0) { - StringValue(e); - warn_printf("Exception `%s' at %s:%d - %s\n", - rb_obj_classname(ruby_errinfo), - ruby_sourcefile, ruby_sourceline, - RSTRING(e)->ptr); - } - POP_TAG(); - if (status == TAG_FATAL && ruby_errinfo == exception_error) { - ruby_errinfo = mesg; - } - else if (status) { - rb_thread_reset_raised(th); - JUMP_TAG(status); - } - } - - rb_trap_restore_mask(); - if (tag != TAG_FATAL) { - EXEC_EVENT_HOOK(RUBY_EVENT_RAISE, ruby_current_node, - ruby_frame->self, - ruby_frame->last_func, - ruby_frame->last_class); - } - if (!prot_tag) { - error_print(); - } - rb_thread_raised_clear(th); - JUMP_TAG(tag); -} - -void -rb_exc_jump(mesg) - VALUE mesg; -{ - rb_thread_raised_clear(rb_curr_thread); - ruby_errinfo = mesg; - JUMP_TAG(TAG_RAISE); -} - -void -rb_exc_raise(mesg) - VALUE mesg; -{ - rb_longjmp(TAG_RAISE, mesg); -} - -void -rb_exc_fatal(mesg) - VALUE mesg; -{ - rb_longjmp(TAG_FATAL, mesg); -} - -void -rb_interrupt() -{ - rb_raise(rb_eInterrupt, ""); -} - -/* - * call-seq: - * raise - * raise(string) - * raise(exception [, string [, array]]) - * fail - * fail(string) - * fail(exception [, string [, array]]) - * - * With no arguments, raises the exception in $! or raises - * a RuntimeError if $! is +nil+. - * With a single +String+ argument, raises a - * +RuntimeError+ with the string as a message. Otherwise, - * the first parameter should be the name of an +Exception+ - * class (or an object that returns an +Exception+ object when sent - * an +exception+ message). The optional second parameter sets the - * message associated with the exception, and the third parameter is an - * array of callback information. Exceptions are caught by the - * +rescue+ clause of begin...end blocks. - * - * raise "Failed to create socket" - * raise ArgumentError, "No parameters", caller - */ - -static VALUE -rb_f_raise(argc, argv) - int argc; - VALUE *argv; -{ - rb_raise_jump(rb_make_exception(argc, argv)); - return Qnil; /* not reached */ -} - -static VALUE -rb_make_exception(argc, argv) - int argc; - VALUE *argv; -{ - VALUE mesg; - ID exception; - int n; - - mesg = Qnil; - switch (argc) { - case 0: - mesg = Qnil; - break; - case 1: - if (NIL_P(argv[0])) break; - if (TYPE(argv[0]) == T_STRING) { - mesg = rb_exc_new3(rb_eRuntimeError, argv[0]); - break; - } - n = 0; - goto exception_call; - - case 2: - case 3: - n = 1; - exception_call: - exception = rb_intern("exception"); - if (!rb_respond_to(argv[0], exception)) { - rb_raise(rb_eTypeError, "exception class/object expected"); - } - mesg = rb_funcall(argv[0], exception, n, argv[1]); - break; - default: - rb_raise(rb_eArgError, "wrong number of arguments"); - break; - } - if (argc > 0) { - if (!rb_obj_is_kind_of(mesg, rb_eException)) - rb_raise(rb_eTypeError, "exception object expected"); - if (argc>2) - set_backtrace(mesg, argv[2]); - } - - return mesg; -} - -static void -rb_raise_jump(mesg) - VALUE mesg; -{ - if (ruby_frame != top_frame) { - PUSH_FRAME(); /* fake frame */ - *ruby_frame = *_frame.prev->prev; - rb_longjmp(TAG_RAISE, mesg); - POP_FRAME(); - } - rb_longjmp(TAG_RAISE, mesg); -} - -void -rb_jump_tag(tag) - int tag; -{ - JUMP_TAG(tag); -} - -int -rb_block_given_p() -{ - if (ruby_frame->iter == ITER_CUR && ruby_block) - return Qtrue; - return Qfalse; -} - -int -rb_iterator_p() -{ - return rb_block_given_p(); -} - -/* - * call-seq: - * block_given? => true or false - * iterator? => true or false - * - * Returns true if yield would execute a - * block in the current context. The iterator? form - * is mildly deprecated. - * - * def try - * if block_given? - * yield - * else - * "no block" - * end - * end - * try #=> "no block" - * try { "hello" } #=> "hello" - * try do "hello" end #=> "hello" - */ - - -static VALUE -rb_f_block_given_p() -{ - if (ruby_frame->prev && ruby_frame->prev->iter == ITER_CUR && ruby_block) - return Qtrue; - return Qfalse; -} - -VALUE rb_eThreadError; - -NORETURN(static void proc_jump_error(int, VALUE)); -static void -proc_jump_error(state, result) - int state; - VALUE result; -{ - char mesg[32]; - char *statement; - - switch (state) { - case TAG_BREAK: - statement = "break"; break; - case TAG_RETURN: - statement = "return"; break; - case TAG_RETRY: - statement = "retry"; break; - default: - statement = "local-jump"; break; /* should not happen */ - } - snprintf(mesg, sizeof mesg, "%s from proc-closure", statement); - localjump_error(mesg, result, state); -} - -static void -return_jump(retval) - VALUE retval; -{ - struct tag *tt = prot_tag; - int yield = Qfalse; - - if (retval == Qundef) retval = Qnil; - while (tt) { - if (tt->tag == PROT_YIELD) { - yield = Qtrue; - tt = tt->prev; - } - if (tt->tag == PROT_FUNC && tt->frame->uniq == ruby_frame->uniq) { - tt->dst = (VALUE)ruby_frame->uniq; - tt->retval = retval; - JUMP_TAG(TAG_RETURN); - } - if (tt->tag == PROT_LAMBDA && !yield) { - tt->dst = (VALUE)tt->frame->uniq; - tt->retval = retval; - JUMP_TAG(TAG_RETURN); - } - if (tt->tag == PROT_THREAD) { - rb_raise(rb_eThreadError, "return can't jump across threads"); - } - tt = tt->prev; - } - localjump_error("unexpected return", retval, TAG_RETURN); -} - -static void -break_jump(retval) - VALUE retval; -{ - struct tag *tt = prot_tag; - - if (retval == Qundef) retval = Qnil; - while (tt) { - switch (tt->tag) { - case PROT_THREAD: - case PROT_YIELD: - case PROT_LOOP: - case PROT_LAMBDA: - tt->dst = (VALUE)tt->frame->uniq; - tt->retval = retval; - JUMP_TAG(TAG_BREAK); - break; - case PROT_FUNC: - tt = 0; - continue; - default: - break; - } - tt = tt->prev; - } - localjump_error("unexpected break", retval, TAG_BREAK); -} - -static void -next_jump(retval) - VALUE retval; -{ - struct tag *tt = prot_tag; - - if (retval == Qundef) retval = Qnil; - while (tt) { - switch (tt->tag) { - case PROT_THREAD: - case PROT_YIELD: - case PROT_LOOP: - case PROT_LAMBDA: - case PROT_FUNC: - tt->dst = (VALUE)tt->frame->uniq; - tt->retval = retval; - JUMP_TAG(TAG_NEXT); - break; - default: - break; - } - tt = tt->prev; - } - localjump_error("unexpected next", retval, TAG_NEXT); -} - -void -rb_need_block() -{ - if (!rb_block_given_p()) { - localjump_error("no block given", Qnil, 0); - } -} - -static VALUE -rb_yield_0(val, self, klass, flags, avalue) - VALUE val, self, klass; /* OK */ - int flags, avalue; -{ - NODE *node; - volatile VALUE result = Qnil; - volatile VALUE old_cref; - volatile VALUE old_wrapper; - struct BLOCK * volatile block; - struct SCOPE * volatile old_scope; - int old_vmode; - struct FRAME frame; - NODE *cnode = ruby_current_node; - int lambda = flags & YIELD_LAMBDA_CALL; - int state; - - rb_need_block(); - - PUSH_VARS(); - block = ruby_block; - frame = block->frame; - frame.prev = ruby_frame; - frame.node = cnode; - ruby_frame = &(frame); - old_cref = (VALUE)ruby_cref; - ruby_cref = block->cref; - old_wrapper = ruby_wrapper; - ruby_wrapper = block->wrapper; - old_scope = ruby_scope; - ruby_scope = block->scope; - old_vmode = scope_vmode; - scope_vmode = (flags & YIELD_PUBLIC_DEF) ? SCOPE_PUBLIC : block->vmode; - ruby_block = block->prev; - if (block->flags & BLOCK_D_SCOPE) { - /* put place holder for dynamic (in-block) local variables */ - ruby_dyna_vars = new_dvar(0, 0, block->dyna_vars); - } - else { - /* FOR does not introduce new scope */ - ruby_dyna_vars = block->dyna_vars; - } - PUSH_CLASS(klass ? klass : block->klass); - if (!klass) { - self = block->self; - } - node = block->body; - - if (block->var) { - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - if (block->var == (NODE*)1) { /* no parameter || */ - if (lambda && RARRAY(val)->len != 0) { - rb_raise(rb_eArgError, "wrong number of arguments (%ld for 0)", - RARRAY(val)->len); - } - } - else if (block->var == (NODE*)2) { - if (TYPE(val) == T_ARRAY && RARRAY(val)->len != 0) { - rb_raise(rb_eArgError, "wrong number of arguments (%ld for 0)", - RARRAY(val)->len); - } - } - else if (nd_type(block->var) == NODE_MASGN) { - if (!avalue) { - val = svalue_to_mrhs(val, block->var->nd_head); - } - massign(self, block->var, val, lambda); - } - else { - int len = 0; - if (avalue) { - len = RARRAY(val)->len; - if (len == 0) { - goto zero_arg; - } - if (len == 1) { - val = RARRAY(val)->ptr[0]; - } - else { - goto multi_values; - } - } - else if (val == Qundef) { - zero_arg: - val = Qnil; - multi_values: - { - ruby_current_node = block->var; - rb_warn("multiple values for a block parameter (%d for 1)\n\tfrom %s:%d", - len, cnode->nd_file, nd_line(cnode)); - ruby_current_node = cnode; - } - } - assign(self, block->var, val, lambda); - } - } - POP_TAG(); - if (state) goto pop_state; - } - if (!node) { - state = 0; - goto pop_state; - } - ruby_current_node = node; - - PUSH_ITER(block->iter); - PUSH_TAG(lambda ? PROT_NONE : PROT_YIELD); - if ((state = EXEC_TAG()) == 0) { - redo: - if (nd_type(node) == NODE_CFUNC || nd_type(node) == NODE_IFUNC) { - if (node->nd_state == YIELD_FUNC_AVALUE) { - if (!avalue) { - val = svalue_to_avalue(val); - } - } - else { - if (avalue) { - val = avalue_to_svalue(val); - } - if (val == Qundef && node->nd_state != YIELD_FUNC_SVALUE) - val = Qnil; - } - result = (*node->nd_cfnc)(val, node->nd_tval, self); - } - else { - result = rb_eval(self, node); - } - } - else { - switch (state) { - case TAG_REDO: - state = 0; - CHECK_INTS; - goto redo; - case TAG_NEXT: - if (!lambda) { - state = 0; - result = prot_tag->retval; - } - break; - case TAG_BREAK: - if (TAG_DST()) { - result = prot_tag->retval; - } - else { - lambda = Qtrue; /* just pass TAG_BREAK */ - } - break; - default: - break; - } - } - POP_TAG(); - POP_ITER(); - pop_state: - POP_CLASS(); - if (ruby_dyna_vars && (block->flags & BLOCK_D_SCOPE) && - !FL_TEST(ruby_dyna_vars, DVAR_DONT_RECYCLE)) { - struct RVarmap *vars = ruby_dyna_vars; - - if (ruby_dyna_vars->id == 0) { - vars = ruby_dyna_vars->next; - rb_gc_force_recycle((VALUE)ruby_dyna_vars); - while (vars && vars->id != 0 && vars != block->dyna_vars) { - struct RVarmap *tmp = vars->next; - rb_gc_force_recycle((VALUE)vars); - vars = tmp; - } - } - } - POP_VARS(); - ruby_block = block; - ruby_frame = ruby_frame->prev; - ruby_cref = (NODE*)old_cref; - ruby_wrapper = old_wrapper; - if (ruby_scope->flags & SCOPE_DONT_RECYCLE) - scope_dup(old_scope); - ruby_scope = old_scope; - scope_vmode = old_vmode; - switch (state) { - case 0: - break; - case TAG_BREAK: - if (!lambda) { - struct tag *tt = prot_tag; - - while (tt) { - if (tt->tag == PROT_LOOP && tt->blkid == ruby_block->uniq) { - tt->dst = (VALUE)tt->frame->uniq; - tt->retval = result; - JUMP_TAG(TAG_BREAK); - } - tt = tt->prev; - } - proc_jump_error(TAG_BREAK, result); - } - /* fall through */ - default: - JUMP_TAG(state); - break; - } - ruby_current_node = cnode; - return result; -} - -VALUE -rb_yield(val) - VALUE val; -{ - return rb_yield_0(val, 0, 0, 0, Qfalse); -} - -VALUE -#ifdef HAVE_STDARG_PROTOTYPES -rb_yield_values(int n, ...) -#else -rb_yield_values(n, va_alist) - int n; - va_dcl -#endif -{ - va_list args; - VALUE ary; - - if (n == 0) { - return rb_yield_0(Qundef, 0, 0, 0, Qfalse); - } - ary = rb_ary_new2(n); - va_init_list(args, n); - while (n--) { - rb_ary_push(ary, va_arg(args, VALUE)); - } - va_end(args); - return rb_yield_0(ary, 0, 0, 0, Qtrue); -} - -VALUE -rb_yield_splat(values) - VALUE values; -{ - int avalue = Qfalse; - - if (TYPE(values) == T_ARRAY) { - if (RARRAY(values)->len == 0) { - values = Qundef; - } - else { - avalue = Qtrue; - } - } - return rb_yield_0(values, 0, 0, 0, avalue); -} - -/* - * call-seq: - * loop {|| block } - * - * Repeatedly executes the block. - * - * loop do - * print "Input: " - * line = gets - * break if !line or line =~ /^qQ/ - * # ... - * end - */ - -static VALUE -rb_f_loop() -{ - for (;;) { - rb_yield_0(Qundef, 0, 0, 0, Qfalse); - CHECK_INTS; - } - return Qnil; /* dummy */ -} - -static VALUE -massign(self, node, val, pcall) - VALUE self; - NODE *node; - VALUE val; - int pcall; -{ - NODE *list; - long i = 0, len; - - len = RARRAY(val)->len; - list = node->nd_head; - for (; list && ind_head, RARRAY(val)->ptr[i], pcall); - list = list->nd_next; - } - if (pcall && list) goto arg_error; - if (node->nd_args) { - if ((long)(node->nd_args) == -1) { - /* no check for mere `*' */ - } - else if (!list && ind_args, rb_ary_new4(len-i, RARRAY(val)->ptr+i), pcall); - } - else { - assign(self, node->nd_args, rb_ary_new2(0), pcall); - } - } - else if (pcall && i < len) { - goto arg_error; - } - - while (list) { - i++; - assign(self, list->nd_head, Qnil, pcall); - list = list->nd_next; - } - return val; - - arg_error: - while (list) { - i++; - list = list->nd_next; - } - rb_raise(rb_eArgError, "wrong number of arguments (%ld for %ld)", len, i); -} - -static void -assign(self, lhs, val, pcall) - VALUE self; - NODE *lhs; - VALUE val; - int pcall; -{ - ruby_current_node = lhs; - if (val == Qundef) { - rb_warning("assigning void value"); - val = Qnil; - } - switch (nd_type(lhs)) { - case NODE_GASGN: - rb_gvar_set(lhs->nd_entry, val); - break; - - case NODE_IASGN: - rb_ivar_set(self, lhs->nd_vid, val); - break; - - case NODE_LASGN: - if (ruby_scope->local_vars == 0) - rb_bug("unexpected local variable assignment"); - ruby_scope->local_vars[lhs->nd_cnt] = val; - break; - - case NODE_DASGN: - dvar_asgn(lhs->nd_vid, val); - break; - - case NODE_DASGN_CURR: - dvar_asgn_curr(lhs->nd_vid, val); - break; - - case NODE_CDECL: - if (lhs->nd_vid == 0) { - rb_const_set(class_prefix(self, lhs->nd_else), lhs->nd_else->nd_mid, val); - } - else { - rb_const_set(ruby_cbase, lhs->nd_vid, val); - } - break; - - case NODE_CVDECL: - if (RTEST(ruby_verbose) && FL_TEST(ruby_cbase, FL_SINGLETON)) { - rb_warn("declaring singleton class variable"); - } - rb_cvar_set(cvar_cbase(), lhs->nd_vid, val, Qtrue); - break; - - case NODE_CVASGN: - rb_cvar_set(cvar_cbase(), lhs->nd_vid, val, Qfalse); - break; - - case NODE_MASGN: - massign(self, lhs, svalue_to_mrhs(val, lhs->nd_head), pcall); - break; - - case NODE_CALL: - case NODE_ATTRASGN: - { - VALUE recv; - int scope; - if (lhs->nd_recv == (NODE *)1) { - recv = self; - scope = 1; - } - else { - recv = rb_eval(self, lhs->nd_recv); - scope = 0; - } - if (!lhs->nd_args) { - /* attr set */ - ruby_current_node = lhs; - SET_CURRENT_SOURCE(); - rb_call(CLASS_OF(recv), recv, lhs->nd_mid, 1, &val, scope, self); - } - else { - /* array set */ - VALUE args; - - args = rb_eval(self, lhs->nd_args); - rb_ary_push(args, val); - ruby_current_node = lhs; - SET_CURRENT_SOURCE(); - rb_call(CLASS_OF(recv), recv, lhs->nd_mid, - RARRAY(args)->len, RARRAY(args)->ptr, scope, self); - } - } - break; - - default: - rb_bug("bug in variable assignment"); - break; - } -} - -VALUE -rb_iterate(it_proc, data1, bl_proc, data2) - VALUE (*it_proc) _((VALUE)), (*bl_proc)(ANYARGS); - VALUE data1, data2; -{ - int state; - volatile VALUE retval = Qnil; - NODE *node = NEW_IFUNC(bl_proc, data2); - VALUE self = ruby_top_self; - - PUSH_TAG(PROT_LOOP); - PUSH_BLOCK(0, node); - PUSH_ITER(ITER_PRE); - state = EXEC_TAG(); - if (state == 0) { - iter_retry: - retval = (*it_proc)(data1); - } - else if (state == TAG_BREAK && TAG_DST()) { - retval = prot_tag->retval; - state = 0; - } - else if (state == TAG_RETRY) { - state = 0; - goto iter_retry; - } - POP_ITER(); - POP_BLOCK(); - POP_TAG(); - - switch (state) { - case 0: - break; - default: - JUMP_TAG(state); - } - return retval; -} - -static int -handle_rescue(self, node) - VALUE self; - NODE *node; -{ - int argc; VALUE *argv; /* used in SETUP_ARGS */ - TMP_PROTECT; - - if (!node->nd_args) { - return rb_obj_is_kind_of(ruby_errinfo, rb_eStandardError); - } - - BEGIN_CALLARGS; - SETUP_ARGS(node->nd_args); - END_CALLARGS; - - while (argc--) { - if (!rb_obj_is_kind_of(argv[0], rb_cModule)) { - rb_raise(rb_eTypeError, "class or module required for rescue clause"); - } - if (RTEST(rb_funcall(*argv, eqq, 1, ruby_errinfo))) return 1; - argv++; - } - return 0; -} - -VALUE -#ifdef HAVE_STDARG_PROTOTYPES -rb_rescue2(VALUE (*b_proc)(ANYARGS), VALUE data1, VALUE (*r_proc)(ANYARGS), VALUE data2, ...) -#else -rb_rescue2(b_proc, data1, r_proc, data2, va_alist) - VALUE (*b_proc)(ANYARGS), (*r_proc)(ANYARGS); - VALUE data1, data2; - va_dcl -#endif -{ - int state; - volatile VALUE result; - volatile VALUE e_info = ruby_errinfo; - volatile int handle = Qfalse; - VALUE eclass; - va_list args; - - PUSH_TAG(PROT_NONE); - switch (state = EXEC_TAG()) { - case TAG_RETRY: - if (!handle) break; - handle = Qfalse; - state = 0; - ruby_errinfo = Qnil; - case 0: - result = (*b_proc)(data1); - break; - case TAG_RAISE: - if (handle) break; - handle = Qfalse; - va_init_list(args, data2); - while ((eclass = va_arg(args, VALUE)) != 0) { - if (rb_obj_is_kind_of(ruby_errinfo, eclass)) { - handle = Qtrue; - break; - } - } - va_end(args); - - if (handle) { - state = 0; - if (r_proc) { - result = (*r_proc)(data2, ruby_errinfo); - } - else { - result = Qnil; - } - ruby_errinfo = e_info; - } - } - POP_TAG(); - if (state) JUMP_TAG(state); - - return result; -} - -VALUE -rb_rescue(b_proc, data1, r_proc, data2) - VALUE (*b_proc)(), (*r_proc)(); - VALUE data1, data2; -{ - return rb_rescue2(b_proc, data1, r_proc, data2, rb_eStandardError, (VALUE)0); -} - -static VALUE cont_protect; - -VALUE -rb_protect(proc, data, state) - VALUE (*proc) _((VALUE)); - VALUE data; - int *state; -{ - VALUE result = Qnil; /* OK */ - int status; - - PUSH_TAG(PROT_NONE); - cont_protect = (VALUE)rb_node_newnode(NODE_MEMO, cont_protect, 0, 0); - if ((status = EXEC_TAG()) == 0) { - result = (*proc)(data); - } - cont_protect = ((NODE *)cont_protect)->u1.value; - POP_TAG(); - if (state) { - *state = status; - } - if (status != 0) { - return Qnil; - } - - return result; -} - -VALUE -rb_ensure(b_proc, data1, e_proc, data2) - VALUE (*b_proc)(); - VALUE data1; - VALUE (*e_proc)(); - VALUE data2; -{ - int state; - volatile VALUE result = Qnil; - VALUE retval; - - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - result = (*b_proc)(data1); - } - POP_TAG(); - retval = prot_tag ? prot_tag->retval : Qnil; /* save retval */ - if (!thread_no_ensure()) { - (*e_proc)(data2); - } - if (prot_tag) return_value(retval); - if (state) JUMP_TAG(state); - return result; -} - -VALUE -rb_with_disable_interrupt(proc, data) - VALUE (*proc)(); - VALUE data; -{ - VALUE result = Qnil; /* OK */ - int status; - - DEFER_INTS; - { - int thr_critical = rb_thread_critical; - - rb_thread_critical = Qtrue; - PUSH_TAG(PROT_NONE); - if ((status = EXEC_TAG()) == 0) { - result = (*proc)(data); - } - POP_TAG(); - rb_thread_critical = thr_critical; - } - ENABLE_INTS; - if (status) JUMP_TAG(status); - - return result; -} - -static void -stack_check() -{ - rb_thread_t th = rb_curr_thread; - - if (!rb_thread_raised_p(th, RAISED_STACKOVERFLOW) && ruby_stack_check()) { - rb_thread_raised_set(th, RAISED_STACKOVERFLOW); - rb_exc_raise(sysstack_error); - } -} - -static int last_call_status; - -#define CSTAT_PRIV 1 -#define CSTAT_PROT 2 -#define CSTAT_VCALL 4 -#define CSTAT_SUPER 8 - -/* - * call-seq: - * obj.method_missing(symbol [, *args] ) => result - * - * Invoked by Ruby when obj is sent a message it cannot handle. - * symbol is the symbol for the method called, and args - * are any arguments that were passed to it. By default, the interpreter - * raises an error when this method is called. However, it is possible - * to override the method to provide more dynamic behavior. - * The example below creates - * a class Roman, which responds to methods with names - * consisting of roman numerals, returning the corresponding integer - * values. - * - * class Roman - * def romanToInt(str) - * # ... - * end - * def method_missing(methId) - * str = methId.id2name - * romanToInt(str) - * end - * end - * - * r = Roman.new - * r.iv #=> 4 - * r.xxiii #=> 23 - * r.mm #=> 2000 - */ - -static VALUE -rb_method_missing(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - ID id; - VALUE exc = rb_eNoMethodError; - char *format = 0; - NODE *cnode = ruby_current_node; - - if (argc == 0 || !SYMBOL_P(argv[0])) { - rb_raise(rb_eArgError, "no id given"); - } - - stack_check(); - - id = SYM2ID(argv[0]); - - if (last_call_status & CSTAT_PRIV) { - format = "private method `%s' called for %s"; - } - else if (last_call_status & CSTAT_PROT) { - format = "protected method `%s' called for %s"; - } - else if (last_call_status & CSTAT_VCALL) { - format = "undefined local variable or method `%s' for %s"; - exc = rb_eNameError; - } - else if (last_call_status & CSTAT_SUPER) { - format = "super: no superclass method `%s'"; - } - if (!format) { - format = "undefined method `%s' for %s"; - } - - ruby_current_node = cnode; - { - int n = 0; - VALUE args[3]; - - args[n++] = rb_funcall(rb_const_get(exc, rb_intern("message")), '!', - 3, rb_str_new2(format), obj, argv[0]); - args[n++] = argv[0]; - if (exc == rb_eNoMethodError) { - args[n++] = rb_ary_new4(argc-1, argv+1); - } - exc = rb_class_new_instance(n, args, exc); - ruby_frame = ruby_frame->prev; /* pop frame for "method_missing" */ - rb_exc_raise(exc); - } - - return Qnil; /* not reached */ -} - -static VALUE -method_missing(obj, id, argc, argv, call_status) - VALUE obj; - ID id; - int argc; - const VALUE *argv; - int call_status; -{ - VALUE *nargv; - - last_call_status = call_status; - - if (id == missing) { - PUSH_FRAME(); - rb_method_missing(argc, argv, obj); - POP_FRAME(); - } - else if (id == ID_ALLOCATOR) { - rb_raise(rb_eTypeError, "allocator undefined for %s", rb_class2name(obj)); - } - if (argc < 0) { - VALUE tmp; - - argc = -argc-1; - tmp = splat_value(argv[argc]); - nargv = ALLOCA_N(VALUE, argc + RARRAY(tmp)->len + 1); - MEMCPY(nargv+1, argv, VALUE, argc); - MEMCPY(nargv+1+argc, RARRAY(tmp)->ptr, VALUE, RARRAY(tmp)->len); - argc += RARRAY(tmp)->len; - } - else { - nargv = ALLOCA_N(VALUE, argc+1); - MEMCPY(nargv+1, argv, VALUE, argc); - } - nargv[0] = ID2SYM(id); - return rb_funcall2(obj, missing, argc+1, nargv); -} - -static inline VALUE -call_cfunc(func, recv, len, argc, argv) - VALUE (*func)(); - VALUE recv; - int len, argc; - VALUE *argv; -{ - if (len >= 0 && argc != len) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", - argc, len); - } - - switch (len) { - case -2: - return (*func)(recv, rb_ary_new4(argc, argv)); - break; - case -1: - return (*func)(argc, argv, recv); - break; - case 0: - return (*func)(recv); - break; - case 1: - return (*func)(recv, argv[0]); - break; - case 2: - return (*func)(recv, argv[0], argv[1]); - break; - case 3: - return (*func)(recv, argv[0], argv[1], argv[2]); - break; - case 4: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3]); - break; - case 5: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4]); - break; - case 6: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4], - argv[5]); - break; - case 7: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4], - argv[5], argv[6]); - break; - case 8: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4], - argv[5], argv[6], argv[7]); - break; - case 9: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4], - argv[5], argv[6], argv[7], argv[8]); - break; - case 10: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4], - argv[5], argv[6], argv[7], argv[8], argv[9]); - break; - case 11: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4], - argv[5], argv[6], argv[7], argv[8], argv[9], argv[10]); - break; - case 12: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4], - argv[5], argv[6], argv[7], argv[8], argv[9], - argv[10], argv[11]); - break; - case 13: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4], - argv[5], argv[6], argv[7], argv[8], argv[9], argv[10], - argv[11], argv[12]); - break; - case 14: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4], - argv[5], argv[6], argv[7], argv[8], argv[9], argv[10], - argv[11], argv[12], argv[13]); - break; - case 15: - return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4], - argv[5], argv[6], argv[7], argv[8], argv[9], argv[10], - argv[11], argv[12], argv[13], argv[14]); - break; - default: - rb_raise(rb_eArgError, "too many arguments (%d)", len); - break; - } - return Qnil; /* not reached */ -} - -static VALUE -rb_call0(klass, recv, id, oid, argc, argv, body, flags) - VALUE klass, recv; - ID id; - ID oid; - int argc; /* OK */ - VALUE *argv; /* OK */ - NODE * volatile body; - int flags; -{ - NODE *b2; /* OK */ - volatile VALUE result = Qnil; - int itr; - static int tick; - TMP_PROTECT; - volatile int safe = -1; - - if (NOEX_SAFE(flags) > ruby_safe_level && NOEX_SAFE(flags) > 2) { - rb_raise(rb_eSecurityError, "calling insecure method: %s", - rb_id2name(id)); - } - switch (ruby_iter->iter) { - case ITER_PRE: - case ITER_PAS: - itr = ITER_CUR; - break; - case ITER_CUR: - default: - itr = ITER_NOT; - break; - } - - if ((++tick & 0xff) == 0) { - CHECK_INTS; /* better than nothing */ - stack_check(); - rb_gc_finalize_deferred(); - } - if (argc < 0) { - VALUE tmp; - VALUE *nargv; - - argc = -argc-1; - tmp = splat_value(argv[argc]); - nargv = TMP_ALLOC(argc + RARRAY(tmp)->len); - MEMCPY(nargv, argv, VALUE, argc); - MEMCPY(nargv+argc, RARRAY(tmp)->ptr, VALUE, RARRAY(tmp)->len); - argc += RARRAY(tmp)->len; - argv = nargv; - } - PUSH_ITER(itr); - PUSH_FRAME(); - - ruby_frame->last_func = id; - ruby_frame->orig_func = oid; - ruby_frame->last_class = (flags & NOEX_NOSUPER)?0:klass; - ruby_frame->self = recv; - ruby_frame->argc = argc; - ruby_frame->flags = 0; - - switch (nd_type(body)) { - case NODE_CFUNC: - { - int len = body->nd_argc; - - if (len < -2) { - rb_bug("bad argc (%d) specified for `%s(%s)'", - len, rb_class2name(klass), rb_id2name(id)); - } - if (event_hooks) { - int state; - - EXEC_EVENT_HOOK(RUBY_EVENT_C_CALL, ruby_current_node, - recv, id, klass); - PUSH_TAG(PROT_FUNC); - if ((state = EXEC_TAG()) == 0) { - result = call_cfunc(body->nd_cfnc, recv, len, argc, argv); - } - POP_TAG(); - ruby_current_node = ruby_frame->node; - EXEC_EVENT_HOOK(RUBY_EVENT_C_RETURN, ruby_current_node, - recv, id, klass); - if (state) JUMP_TAG(state); - } - else { - result = call_cfunc(body->nd_cfnc, recv, len, argc, argv); - } - } - break; - - /* for attr get/set */ - case NODE_IVAR: - if (argc != 0) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc); - } - result = rb_attr_get(recv, body->nd_vid); - break; - - case NODE_ATTRSET: - if (argc != 1) - rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc); - result = rb_ivar_set(recv, body->nd_vid, argv[0]); - break; - - case NODE_ZSUPER: - result = rb_call_super(argc, argv); - break; - - case NODE_DMETHOD: - result = method_call(argc, argv, umethod_bind(body->nd_cval, recv)); - break; - - case NODE_BMETHOD: - ruby_frame->flags |= FRAME_DMETH; - if (event_hooks) { - struct BLOCK *data; - Data_Get_Struct(body->nd_cval, struct BLOCK, data); - EXEC_EVENT_HOOK(RUBY_EVENT_CALL, data->body, recv, id, klass); - } - result = proc_invoke(body->nd_cval, rb_ary_new4(argc, argv), recv, klass); - if (event_hooks) { - EXEC_EVENT_HOOK(RUBY_EVENT_RETURN, body, recv, id, klass); - } - break; - - case NODE_SCOPE: - { - int state; - VALUE *local_vars; /* OK */ - NODE *saved_cref = 0; - - PUSH_SCOPE(); - if (body->nd_rval) { - saved_cref = ruby_cref; - ruby_cref = (NODE*)body->nd_rval; - } - PUSH_CLASS(ruby_cbase); - if (body->nd_tbl) { - local_vars = TMP_ALLOC(body->nd_tbl[0]+1); - *local_vars++ = (VALUE)body; - rb_mem_clear(local_vars, body->nd_tbl[0]); - ruby_scope->local_tbl = body->nd_tbl; - ruby_scope->local_vars = local_vars; - } - else { - local_vars = ruby_scope->local_vars = 0; - ruby_scope->local_tbl = 0; - } - b2 = body = body->nd_next; - - if (NOEX_SAFE(flags) > ruby_safe_level) { - safe = ruby_safe_level; - ruby_safe_level = NOEX_SAFE(flags); - } - PUSH_VARS(); - PUSH_TAG(PROT_FUNC); - if ((state = EXEC_TAG()) == 0) { - NODE *node = 0; - int i, nopt = 0; - - if (nd_type(body) == NODE_ARGS) { - node = body; - body = 0; - } - else if (nd_type(body) == NODE_BLOCK) { - node = body->nd_head; - body = body->nd_next; - } - if (node) { - if (nd_type(node) != NODE_ARGS) { - rb_bug("no argument-node"); - } - - i = node->nd_cnt; - if (i > argc) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", - argc, i); - } - if (!node->nd_rest) { - NODE *optnode = node->nd_opt; - - nopt = i; - while (optnode) { - nopt++; - optnode = optnode->nd_next; - } - if (nopt < argc) { - rb_raise(rb_eArgError, - "wrong number of arguments (%d for %d)", - argc, nopt); - } - } - if (local_vars) { - if (i > 0) { - /* +2 for $_ and $~ */ - MEMCPY(local_vars+2, argv, VALUE, i); - } - } - argv += i; argc -= i; - if (node->nd_opt) { - NODE *opt = node->nd_opt; - - while (opt && argc) { - assign(recv, opt->nd_head, *argv, 1); - argv++; argc--; - ++i; - opt = opt->nd_next; - } - if (opt) { - rb_eval(recv, opt); - while (opt) { - opt = opt->nd_next; - ++i; - } - } - } - if (!node->nd_rest) { - i = nopt; - } - else { - VALUE v; - - if (argc > 0) { - v = rb_ary_new4(argc,argv); - i = -i - 1; - } - else { - v = rb_ary_new2(0); - } - assign(recv, node->nd_rest, v, 1); - } - ruby_frame->argc = i; - } - if (event_hooks) { - EXEC_EVENT_HOOK(RUBY_EVENT_CALL, b2, recv, id, klass); - } - result = rb_eval(recv, body); - } - else if (state == TAG_RETURN && TAG_DST()) { - result = prot_tag->retval; - state = 0; - } - POP_TAG(); - if (event_hooks) { - EXEC_EVENT_HOOK(RUBY_EVENT_RETURN, body, recv, id, klass); - } - POP_VARS(); - POP_CLASS(); - POP_SCOPE(); - ruby_cref = saved_cref; - if (safe >= 0) ruby_safe_level = safe; - switch (state) { - case 0: - break; - - case TAG_BREAK: - case TAG_RETURN: - JUMP_TAG(state); - break; - - case TAG_RETRY: - if (rb_block_given_p()) JUMP_TAG(state); - /* fall through */ - default: - jump_tag_but_local_jump(state, result); - break; - } - } - break; - - default: - unknown_node(body); - break; - } - POP_FRAME(); - POP_ITER(); - return result; -} - -static VALUE -rb_call(klass, recv, mid, argc, argv, scope, self) - VALUE klass, recv; - ID mid; - int argc; /* OK */ - const VALUE *argv; /* OK */ - int scope; - VALUE self; -{ - NODE *body; /* OK */ - int noex; - ID id = mid; - struct cache_entry *ent; - - if (!klass) { - rb_raise(rb_eNotImpError, "method `%s' called on terminated object (0x%lx)", - rb_id2name(mid), recv); - } - /* is it in the method cache? */ - ent = cache + EXPR1(klass, mid); - if (ent->mid == mid && ent->klass == klass) { - if (!ent->method) - return method_missing(recv, mid, argc, argv, scope==2?CSTAT_VCALL:0); - klass = ent->origin; - id = ent->mid0; - noex = ent->noex; - body = ent->method; - } - else if ((body = rb_get_method_body(&klass, &id, &noex)) == 0) { - if (scope == 3) { - return method_missing(recv, mid, argc, argv, CSTAT_SUPER); - } - return method_missing(recv, mid, argc, argv, scope==2?CSTAT_VCALL:0); - } - - if (mid != missing && scope == 0) { - /* receiver specified form for private method */ - if (noex & NOEX_PRIVATE) - return method_missing(recv, mid, argc, argv, CSTAT_PRIV); - - /* self must be kind of a specified form for protected method */ - if (noex & NOEX_PROTECTED) { - VALUE defined_class = klass; - - if (self == Qundef) self = ruby_frame->self; - if (TYPE(defined_class) == T_ICLASS) { - defined_class = RBASIC(defined_class)->klass; - } - if (!rb_obj_is_kind_of(self, rb_class_real(defined_class))) - return method_missing(recv, mid, argc, argv, CSTAT_PROT); - } - } - - return rb_call0(klass, recv, mid, id, argc, argv, body, noex); -} - -VALUE -rb_apply(recv, mid, args) - VALUE recv; - ID mid; - VALUE args; -{ - int argc; - VALUE *argv; - - argc = RARRAY(args)->len; /* Assigns LONG, but argc is INT */ - argv = ALLOCA_N(VALUE, argc); - MEMCPY(argv, RARRAY(args)->ptr, VALUE, argc); - return rb_call(CLASS_OF(recv), recv, mid, argc, argv, 1, Qundef); -} - -/* - * call-seq: - * obj.send(symbol [, args...]) => obj - * obj.__send__(symbol [, args...]) => obj - * - * Invokes the method identified by _symbol_, passing it any - * arguments specified. You can use \_\_send__ if the name - * +send+ clashes with an existing method in _obj_. - * - * class Klass - * def hello(*args) - * "Hello " + args.join(' ') - * end - * end - * k = Klass.new - * k.send :hello, "gentle", "readers" #=> "Hello gentle readers" - */ - -static VALUE -rb_f_send(argc, argv, recv) - int argc; - VALUE *argv; - VALUE recv; -{ - VALUE vid; - - if (argc == 0) rb_raise(rb_eArgError, "no method name given"); - - vid = *argv++; argc--; - PUSH_ITER(rb_block_given_p()?ITER_PRE:ITER_NOT); - vid = rb_call(CLASS_OF(recv), recv, rb_to_id(vid), argc, argv, 1, Qundef); - POP_ITER(); - - return vid; -} - -static VALUE -vafuncall(recv, mid, n, ar) - VALUE recv; - ID mid; - int n; - va_list *ar; -{ - VALUE *argv; - - if (n > 0) { - long i; - - argv = ALLOCA_N(VALUE, n); - - for (i=0;ilast_class == 0) { - rb_name_error(ruby_frame->last_func, "calling `super' from `%s' is prohibited", - rb_id2name(ruby_frame->orig_func)); - } - - self = ruby_frame->self; - klass = ruby_frame->last_class; - if (RCLASS(klass)->super == 0) { - return method_missing(self, ruby_frame->orig_func, argc, argv, CSTAT_SUPER); - } - - PUSH_ITER(ruby_iter->iter ? ITER_PRE : ITER_NOT); - result = rb_call(RCLASS(klass)->super, self, ruby_frame->orig_func, argc, argv, 3, Qundef); - POP_ITER(); - - return result; -} - -static VALUE -backtrace(lev) - int lev; -{ - struct FRAME *frame = ruby_frame; - char buf[BUFSIZ]; - VALUE ary; - NODE *n; - - ary = rb_ary_new(); - if (frame->last_func == ID_ALLOCATOR) { - frame = frame->prev; - } - if (lev < 0) { - ruby_set_current_source(); - if (frame->last_func) { - snprintf(buf, BUFSIZ, "%s:%d:in `%s'", - ruby_sourcefile, ruby_sourceline, - rb_id2name(frame->last_func)); - } - else if (ruby_sourceline == 0) { - snprintf(buf, BUFSIZ, "%s", ruby_sourcefile); - } - else { - snprintf(buf, BUFSIZ, "%s:%d", ruby_sourcefile, ruby_sourceline); - } - rb_ary_push(ary, rb_str_new2(buf)); - if (lev < -1) return ary; - } - else { - while (lev-- > 0) { - frame = frame->prev; - if (!frame) { - ary = Qnil; - break; - } - } - } - for (; frame && (n = frame->node); frame = frame->prev) { - if (frame->prev && frame->prev->last_func) { - if (frame->prev->node == n) { - if (frame->prev->last_func == frame->last_func) continue; - } - snprintf(buf, BUFSIZ, "%s:%d:in `%s'", - n->nd_file, nd_line(n), - rb_id2name(frame->prev->last_func)); - } - else { - snprintf(buf, BUFSIZ, "%s:%d", n->nd_file, nd_line(n)); - } - rb_ary_push(ary, rb_str_new2(buf)); - } - - return ary; -} - -/* - * call-seq: - * caller(start=1) => array - * - * Returns the current execution stack---an array containing strings in - * the form ``file:line'' or ``file:line: in - * `method'''. The optional _start_ parameter - * determines the number of initial stack entries to omit from the - * result. - * - * def a(skip) - * caller(skip) - * end - * def b(skip) - * a(skip) - * end - * def c(skip) - * b(skip) - * end - * c(0) #=> ["prog:2:in `a'", "prog:5:in `b'", "prog:8:in `c'", "prog:10"] - * c(1) #=> ["prog:5:in `b'", "prog:8:in `c'", "prog:11"] - * c(2) #=> ["prog:8:in `c'", "prog:12"] - * c(3) #=> ["prog:13"] - */ - -static VALUE -rb_f_caller(argc, argv) - int argc; - VALUE *argv; -{ - VALUE level; - int lev; - - rb_scan_args(argc, argv, "01", &level); - - if (NIL_P(level)) lev = 1; - else lev = NUM2INT(level); - if (lev < 0) rb_raise(rb_eArgError, "negative level (%d)", lev); - - return backtrace(lev); -} - -void -rb_backtrace() -{ - long i; - VALUE ary; - - ary = backtrace(-1); - for (i=0; ilen; i++) { - printf("\tfrom %s\n", RSTRING(RARRAY(ary)->ptr[i])->ptr); - } -} - -static VALUE -make_backtrace() -{ - return backtrace(-1); -} - -ID -rb_frame_last_func() -{ - return ruby_frame->last_func; -} - -static NODE* -compile(src, file, line) - VALUE src; - char *file; - int line; -{ - NODE *node; - int critical; - - ruby_nerrs = 0; - StringValue(src); - critical = rb_thread_critical; - rb_thread_critical = Qtrue; - node = rb_compile_string(file, src, line); - rb_thread_critical = critical; - - if (ruby_nerrs == 0) return node; - return 0; -} - -static VALUE -eval(self, src, scope, file, line) - VALUE self, src, scope; - char *file; - int line; -{ - struct BLOCK *data = NULL; - volatile VALUE result = Qnil; - struct SCOPE * volatile old_scope; - struct BLOCK * volatile old_block; - struct RVarmap * volatile old_dyna_vars; - VALUE volatile old_cref; - int volatile old_vmode; - volatile VALUE old_wrapper; - struct FRAME frame; - NODE *nodesave = ruby_current_node; - volatile int iter = ruby_frame->iter; - volatile int safe = ruby_safe_level; - int state; - - if (!NIL_P(scope)) { - if (!rb_obj_is_proc(scope)) { - rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc/Binding)", - rb_obj_classname(scope)); - } - - Data_Get_Struct(scope, struct BLOCK, data); - /* PUSH BLOCK from data */ - frame = data->frame; - frame.tmp = ruby_frame; /* gc protection */ - ruby_frame = &(frame); - old_scope = ruby_scope; - ruby_scope = data->scope; - old_block = ruby_block; - ruby_block = data->prev; - old_dyna_vars = ruby_dyna_vars; - ruby_dyna_vars = data->dyna_vars; - old_vmode = scope_vmode; - scope_vmode = data->vmode; - old_cref = (VALUE)ruby_cref; - ruby_cref = data->cref; - old_wrapper = ruby_wrapper; - ruby_wrapper = data->wrapper; - if ((file == 0 || (line == 1 && strcmp(file, "(eval)") == 0)) && data->frame.node) { - file = data->frame.node->nd_file; - if (!file) file = "__builtin__"; - line = nd_line(data->frame.node); - } - - self = data->self; - ruby_frame->iter = data->iter; - } - else { - if (ruby_frame->prev) { - ruby_frame->iter = ruby_frame->prev->iter; - } - } - if (file == 0) { - ruby_set_current_source(); - file = ruby_sourcefile; - line = ruby_sourceline; - } - PUSH_CLASS(data ? data->klass : ruby_class); - ruby_in_eval++; - if (TYPE(ruby_class) == T_ICLASS) { - ruby_class = RBASIC(ruby_class)->klass; - } - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - NODE *node; - - ruby_safe_level = 0; - result = ruby_errinfo; - ruby_errinfo = Qnil; - node = compile(src, file, line); - ruby_safe_level = safe; - if (ruby_nerrs > 0) { - compile_error(0); - } - if (!NIL_P(result)) ruby_errinfo = result; - result = eval_node(self, node); - } - POP_TAG(); - POP_CLASS(); - ruby_in_eval--; - if (!NIL_P(scope)) { - int dont_recycle = ruby_scope->flags & SCOPE_DONT_RECYCLE; - - ruby_wrapper = old_wrapper; - ruby_cref = (NODE*)old_cref; - ruby_frame = frame.tmp; - ruby_scope = old_scope; - ruby_block = old_block; - ruby_dyna_vars = old_dyna_vars; - data->vmode = scope_vmode; /* write back visibility mode */ - scope_vmode = old_vmode; - if (dont_recycle) { - struct tag *tag; - struct RVarmap *vars; - - scope_dup(ruby_scope); - for (tag=prot_tag; tag; tag=tag->prev) { - scope_dup(tag->scope); - } - for (vars = ruby_dyna_vars; vars; vars = vars->next) { - FL_SET(vars, DVAR_DONT_RECYCLE); - } - } - } - else { - ruby_frame->iter = iter; - } - ruby_current_node = nodesave; - ruby_set_current_source(); - if (state) { - if (state == TAG_RAISE) { - if (strcmp(file, "(eval)") == 0) { - VALUE mesg, errat, bt2; - - errat = get_backtrace(ruby_errinfo); - mesg = rb_attr_get(ruby_errinfo, rb_intern("mesg")); - if (!NIL_P(errat) && TYPE(errat) == T_ARRAY && - (bt2 = backtrace(-2), RARRAY(bt2)->len > 0)) { - if (!NIL_P(mesg) && TYPE(mesg) == T_STRING) { - rb_str_update(mesg, 0, 0, rb_str_new2(": ")); - rb_str_update(mesg, 0, 0, RARRAY(errat)->ptr[0]); - } - RARRAY(errat)->ptr[0] = RARRAY(bt2)->ptr[0]; - } - } - rb_exc_raise(ruby_errinfo); - } - JUMP_TAG(state); - } - - return result; -} - -/* - * call-seq: - * eval(string [, binding [, filename [,lineno]]]) => obj - * - * Evaluates the Ruby expression(s) in string. If - * binding is given, the evaluation is performed in its - * context. The binding may be a Binding object or a - * Proc object. If the optional filename and - * lineno parameters are present, they will be used when - * reporting syntax errors. - * - * def getBinding(str) - * return binding - * end - * str = "hello" - * eval "str + ' Fred'" #=> "hello Fred" - * eval "str + ' Fred'", getBinding("bye") #=> "bye Fred" - */ - -static VALUE -rb_f_eval(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; -{ - VALUE src, scope, vfile, vline; - char *file = "(eval)"; - int line = 1; - - rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &vline); - if (ruby_safe_level >= 4) { - StringValue(src); - if (!NIL_P(scope) && !OBJ_TAINTED(scope)) { - rb_raise(rb_eSecurityError, "Insecure: can't modify trusted binding"); - } - } - else { - SafeStringValue(src); - } - if (argc >= 3) { - StringValue(vfile); - } - if (argc >= 4) { - line = NUM2INT(vline); - } - - if (!NIL_P(vfile)) file = RSTRING(vfile)->ptr; - if (NIL_P(scope) && ruby_frame->prev) { - struct FRAME *prev; - VALUE val; - - prev = ruby_frame; - PUSH_FRAME(); - *ruby_frame = *prev->prev; - ruby_frame->prev = prev; - val = eval(self, src, scope, file, line); - POP_FRAME(); - - return val; - } - return eval(self, src, scope, file, line); -} - -/* function to call func under the specified class/module context */ -static VALUE -exec_under(func, under, cbase, args) - VALUE (*func)(); - VALUE under, cbase; - void *args; -{ - VALUE val = Qnil; /* OK */ - int state; - int mode; - struct FRAME *f = ruby_frame; - - PUSH_CLASS(under); - PUSH_FRAME(); - ruby_frame->self = f->self; - ruby_frame->last_func = f->last_func; - ruby_frame->orig_func = f->orig_func; - ruby_frame->last_class = f->last_class; - ruby_frame->argc = f->argc; - if (cbase) { - PUSH_CREF(cbase); - } - - mode = scope_vmode; - SCOPE_SET(SCOPE_PUBLIC); - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - val = (*func)(args); - } - POP_TAG(); - if (cbase) POP_CREF(); - SCOPE_SET(mode); - POP_FRAME(); - POP_CLASS(); - if (state) JUMP_TAG(state); - - return val; -} - -static VALUE -eval_under_i(args) - VALUE *args; -{ - struct FRAME *f = ruby_frame; - - if (f && (f = f->prev) && (f = f->prev)) { - ruby_frame = f; - } - return eval(args[0], args[1], Qnil, (char*)args[2], (int)args[3]); -} - -/* string eval under the class/module context */ -static VALUE -eval_under(under, self, src, file, line) - VALUE under, self, src; - const char *file; - int line; -{ - VALUE args[4]; - - if (ruby_safe_level >= 4) { - StringValue(src); - } - else { - SafeStringValue(src); - } - args[0] = self; - args[1] = src; - args[2] = (VALUE)file; - args[3] = (VALUE)line; - return exec_under(eval_under_i, under, under, args); -} - -static VALUE -yield_under_i(self) - VALUE self; -{ - return rb_yield_0(self, self, ruby_class, YIELD_PUBLIC_DEF, Qfalse); -} - -/* block eval under the class/module context */ -static VALUE -yield_under(under, self) - VALUE under, self; -{ - return exec_under(yield_under_i, under, 0, self); -} - -static VALUE -specific_eval(argc, argv, klass, self) - int argc; - VALUE *argv; - VALUE klass, self; -{ - if (rb_block_given_p()) { - if (argc > 0) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc); - } - return yield_under(klass, self); - } - else { - char *file = "(eval)"; - int line = 1; - - if (argc == 0) { - rb_raise(rb_eArgError, "block not supplied"); - } - else { - if (ruby_safe_level >= 4) { - StringValue(argv[0]); - } - else { - SafeStringValue(argv[0]); - } - if (argc > 3) { - rb_raise(rb_eArgError, "wrong number of arguments: %s(src) or %s{..}", - rb_id2name(ruby_frame->last_func), - rb_id2name(ruby_frame->last_func)); - } - if (argc > 2) line = NUM2INT(argv[2]); - if (argc > 1) { - file = StringValuePtr(argv[1]); - } - } - return eval_under(klass, self, argv[0], file, line); - } -} - -/* - * call-seq: - * obj.instance_eval(string [, filename [, lineno]] ) => obj - * obj.instance_eval {| | block } => obj - * - * Evaluates a string containing Ruby source code, or the given block, - * within the context of the receiver (_obj_). In order to set the - * context, the variable +self+ is set to _obj_ while - * the code is executing, giving the code access to _obj_'s - * instance variables. In the version of instance_eval - * that takes a +String+, the optional second and third - * parameters supply a filename and starting line number that are used - * when reporting compilation errors. - * - * class Klass - * def initialize - * @secret = 99 - * end - * end - * k = Klass.new - * k.instance_eval { @secret } #=> 99 - */ - -VALUE -rb_obj_instance_eval(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; -{ - VALUE klass; - - if (SPECIAL_CONST_P(self)) { - klass = Qnil; - } - else { - klass = rb_singleton_class(self); - } - return specific_eval(argc, argv, klass, self); -} - -/* - * call-seq: - * mod.class_eval(string [, filename [, lineno]]) => obj - * mod.module_eval {|| block } => obj - * - * Evaluates the string or block in the context of _mod_. This can - * be used to add methods to a class. module_eval returns - * the result of evaluating its argument. The optional _filename_ - * and _lineno_ parameters set the text for error messages. - * - * class Thing - * end - * a = %q{def hello() "Hello there!" end} - * Thing.module_eval(a) - * puts Thing.new.hello() - * Thing.module_eval("invalid code", "dummy", 123) - * - * produces: - * - * Hello there! - * dummy:123:in `module_eval': undefined local variable - * or method `code' for Thing:Class - */ - -VALUE -rb_mod_module_eval(argc, argv, mod) - int argc; - VALUE *argv; - VALUE mod; -{ - return specific_eval(argc, argv, mod, mod); -} - -VALUE rb_load_path; - -NORETURN(static void load_failed _((VALUE))); - -void -rb_load(fname, wrap) - VALUE fname; - int wrap; -{ - VALUE tmp; - int state; - volatile int prohibit_int = rb_prohibit_interrupt; - volatile ID last_func; - volatile VALUE wrapper = ruby_wrapper; - volatile VALUE self = ruby_top_self; - NODE *volatile last_node; - NODE *saved_cref = ruby_cref; - - if (wrap && ruby_safe_level >= 4) { - StringValue(fname); - } - else { - SafeStringValue(fname); - } - fname = rb_str_new4(fname); - tmp = rb_find_file(fname); - if (!tmp) { - load_failed(fname); - } - fname = tmp; - - ruby_errinfo = Qnil; /* ensure */ - PUSH_VARS(); - PUSH_CLASS(ruby_wrapper); - ruby_cref = ruby_top_cref; - if (!wrap) { - rb_secure(4); /* should alter global state */ - ruby_class = rb_cObject; - ruby_wrapper = 0; - } - else { - /* load in anonymous module as toplevel */ - ruby_class = ruby_wrapper = rb_module_new(); - self = rb_obj_clone(ruby_top_self); - rb_extend_object(self, ruby_wrapper); - PUSH_CREF(ruby_wrapper); - } - PUSH_ITER(ITER_NOT); - PUSH_FRAME(); - ruby_frame->last_func = 0; - ruby_frame->last_class = 0; - ruby_frame->self = self; - PUSH_SCOPE(); - /* default visibility is private at loading toplevel */ - SCOPE_SET(SCOPE_PRIVATE); - PUSH_TAG(PROT_NONE); - state = EXEC_TAG(); - last_func = ruby_frame->last_func; - last_node = ruby_current_node; - if (!ruby_current_node && ruby_sourcefile) { - last_node = NEW_NEWLINE(0); - } - ruby_current_node = 0; - if (state == 0) { - NODE *node; - volatile int critical; - - DEFER_INTS; - ruby_in_eval++; - critical = rb_thread_critical; - rb_thread_critical = Qtrue; - rb_load_file(RSTRING(fname)->ptr); - ruby_in_eval--; - node = ruby_eval_tree; - rb_thread_critical = critical; - ALLOW_INTS; - if (ruby_nerrs == 0) { - eval_node(self, node); - } - } - ruby_frame->last_func = last_func; - ruby_current_node = last_node; - ruby_sourcefile = 0; - ruby_set_current_source(); - if (ruby_scope->flags == SCOPE_ALLOCA && ruby_class == rb_cObject) { - if (ruby_scope->local_tbl) /* toplevel was empty */ - free(ruby_scope->local_tbl); - } - POP_TAG(); - rb_prohibit_interrupt = prohibit_int; - ruby_cref = saved_cref; - POP_SCOPE(); - POP_FRAME(); - POP_ITER(); - POP_CLASS(); - POP_VARS(); - ruby_wrapper = wrapper; - if (ruby_nerrs > 0) { - ruby_nerrs = 0; - rb_exc_raise(ruby_errinfo); - } - if (state) jump_tag_but_local_jump(state, Qundef); - if (!NIL_P(ruby_errinfo)) /* exception during load */ - rb_exc_raise(ruby_errinfo); -} - -void -rb_load_protect(fname, wrap, state) - VALUE fname; - int wrap; - int *state; -{ - int status; - - PUSH_TAG(PROT_NONE); - if ((status = EXEC_TAG()) == 0) { - rb_load(fname, wrap); - } - POP_TAG(); - if (state) *state = status; -} - -/* - * call-seq: - * load(filename, wrap=false) => true - * - * Loads and executes the Ruby - * program in the file _filename_. If the filename does not - * resolve to an absolute path, the file is searched for in the library - * directories listed in $:. If the optional _wrap_ - * parameter is +true+, the loaded script will be executed - * under an anonymous module, protecting the calling program's global - * namespace. In no circumstance will any local variables in the loaded - * file be propagated to the loading environment. - */ - - -static VALUE -rb_f_load(argc, argv) - int argc; - VALUE *argv; -{ - VALUE fname, wrap; - - rb_scan_args(argc, argv, "11", &fname, &wrap); - rb_load(fname, RTEST(wrap)); - return Qtrue; -} - -VALUE ruby_dln_librefs; -static VALUE rb_features; -static st_table *loading_tbl; - -#define IS_SOEXT(e) (strcmp(e, ".so") == 0 || strcmp(e, ".o") == 0) -#ifdef DLEXT2 -#define IS_DLEXT(e) (strcmp(e, DLEXT) == 0 || strcmp(e, DLEXT2) == 0) -#else -#define IS_DLEXT(e) (strcmp(e, DLEXT) == 0) -#endif - - -static const char *const loadable_ext[] = { - ".rb", DLEXT, -#ifdef DLEXT2 - DLEXT2, -#endif - 0 -}; - -static int rb_feature_p _((const char **, const char *, int)); -static int search_required _((VALUE, VALUE *, VALUE *)); - -static int -rb_feature_p(ftptr, ext, rb) - const char **ftptr, *ext; - int rb; -{ - VALUE v; - const char *f, *e, *feature = *ftptr; - long i, len, elen; - - if (ext) { - len = ext - feature; - elen = strlen(ext); - } - else { - len = strlen(feature); - elen = 0; - } - for (i = 0; i < RARRAY_LEN(rb_features); ++i) { - v = RARRAY_PTR(rb_features)[i]; - f = StringValuePtr(v); - if (RSTRING_LEN(v) < len || strncmp(f, feature, len) != 0) - continue; - if (!*(e = f + len)) { - if (ext) continue; - *ftptr = 0; - return 'u'; - } - if (*e != '.') continue; - if ((!rb || !ext) && (IS_SOEXT(e) || IS_DLEXT(e))) { - *ftptr = 0; - return 's'; - } - if ((rb || !ext) && (strcmp(e, ".rb") == 0)) { - *ftptr = 0; - return 'r'; - } - } - if (loading_tbl) { - if (st_lookup(loading_tbl, (st_data_t)feature, (st_data_t *)ftptr)) { - if (!ext) return 'u'; - return strcmp(ext, ".rb") ? 's' : 'r'; - } - else { - char *buf; - - if (ext && *ext) return 0; - buf = ALLOCA_N(char, len + DLEXT_MAXLEN + 1); - MEMCPY(buf, feature, char, len); - for (i = 0; (e = loadable_ext[i]) != 0; i++) { - strncpy(buf + len, e, DLEXT_MAXLEN + 1); - if (st_lookup(loading_tbl, (st_data_t)buf, (st_data_t *)ftptr)) { - return i ? 's' : 'r'; - } - } - } - } - return 0; -} -#define rb_feature_p(feature, ext, rb) rb_feature_p(&feature, ext, rb) - -int -rb_provided(feature) - const char *feature; -{ - const char *ext = strrchr(feature, '.'); - - if (ext && !strchr(ext, '/')) { - if (strcmp(".rb", ext) == 0) { - if (rb_feature_p(feature, ext, Qtrue)) return Qtrue; - return Qfalse; - } - else if (IS_SOEXT(ext) || IS_DLEXT(ext)) { - if (rb_feature_p(feature, ext, Qfalse)) return Qtrue; - return Qfalse; - } - } - if (rb_feature_p(feature, feature + strlen(feature), Qtrue)) - return Qtrue; - - return Qfalse; -} - -static void -rb_provide_feature(feature) - VALUE feature; -{ - rb_ary_push(rb_features, feature); -} - -void -rb_provide(feature) - const char *feature; -{ - rb_provide_feature(rb_str_new2(feature)); -} - -static char * -load_lock(ftptr) - const char *ftptr; -{ - st_data_t th; - - if (!loading_tbl || - !st_lookup(loading_tbl, (st_data_t)ftptr, &th)) - { - /* loading ruby library should be serialized. */ - if (!loading_tbl) { - loading_tbl = st_init_strtable(); - } - /* partial state */ - ftptr = ruby_strdup(ftptr); - st_insert(loading_tbl, (st_data_t)ftptr, (st_data_t)curr_thread); - return (char *)ftptr; - } - do { - rb_thread_t owner = (rb_thread_t)th; - if (owner == curr_thread) return 0; - rb_thread_join(owner->thread, -1.0); - } while (st_lookup(loading_tbl, (st_data_t)ftptr, &th)); - return 0; -} - -static void -load_unlock(const char *ftptr) -{ - if (ftptr) { - st_data_t key = (st_data_t)ftptr; - - if (st_delete(loading_tbl, &key, 0)) { - free((char *)key); - } - } -} - -/* - * call-seq: - * require(string) => true or false - * - * Ruby tries to load the library named _string_, returning - * +true+ if successful. If the filename does not resolve to - * an absolute path, it will be searched for in the directories listed - * in $:. If the file has the extension ``.rb'', it is - * loaded as a source file; if the extension is ``.so'', ``.o'', or - * ``.dll'', or whatever the default shared library extension is on - * the current platform, Ruby loads the shared library as a Ruby - * extension. Otherwise, Ruby tries adding ``.rb'', ``.so'', and so on - * to the name. The name of the loaded feature is added to the array in - * $". A feature will not be loaded if it's name already - * appears in $". However, the file name is not converted - * to an absolute path, so that ``require 'a';require - * './a''' will load a.rb twice. - * - * require "my-library.rb" - * require "db-driver" - */ - -VALUE -rb_f_require(obj, fname) - VALUE obj, fname; -{ - return rb_require_safe(fname, ruby_safe_level); -} - -static int -search_required(fname, featurep, path) - VALUE fname, *featurep, *path; -{ - VALUE tmp; - const char *ext, *ftptr; - int type; - - *featurep = fname; - *path = 0; - ext = strrchr(ftptr = RSTRING_PTR(fname), '.'); - if (ext && !strchr(ext, '/')) { - if (strcmp(".rb", ext) == 0) { - if (rb_feature_p(ftptr, ext, Qtrue)) { - if (ftptr) *path = rb_str_new2(ftptr); - return 'r'; - } - if ((*path = rb_find_file(fname)) != 0) return 'r'; - return 0; - } - else if (IS_SOEXT(ext)) { - if (rb_feature_p(ftptr, ext, Qfalse)) { - if (ftptr) *path = rb_str_new2(ftptr); - return 's'; - } - tmp = rb_str_new(RSTRING_PTR(fname), ext-RSTRING_PTR(fname)); - *featurep = tmp; -#ifdef DLEXT2 - OBJ_FREEZE(tmp); - if (rb_find_file_ext(&tmp, loadable_ext+1)) { - *featurep = tmp; - *path = rb_find_file(tmp); - return 's'; - } -#else - rb_str_cat2(tmp, DLEXT); - OBJ_FREEZE(tmp); - if ((*path = rb_find_file(tmp)) != 0) { - return 's'; - } -#endif - } - else if (IS_DLEXT(ext)) { - if (rb_feature_p(ftptr, ext, Qfalse)) { - if (ftptr) *path = rb_str_new2(ftptr); - return 's'; - } - if ((*path = rb_find_file(fname)) != 0) return 's'; - } - } - tmp = fname; - type = rb_find_file_ext(&tmp, loadable_ext); - *featurep = tmp; - switch (type) { - case 0: - type = rb_feature_p(ftptr, 0, Qfalse); - if (type && ftptr) *path = rb_str_new2(ftptr); - return type; - - default: - ext = strrchr(ftptr = RSTRING(tmp)->ptr, '.'); - if (!rb_feature_p(ftptr, ext, !--type)) - *path = rb_find_file(tmp); - else if (ftptr) - *path = rb_str_new2(ftptr); - } - return type ? 's' : 'r'; -} - -static void -load_failed(fname) - VALUE fname; -{ - rb_raise(rb_eLoadError, "no such file to load -- %s", RSTRING(fname)->ptr); -} - -VALUE -rb_require_safe(fname, safe) - VALUE fname; - int safe; -{ - VALUE result = Qnil; - volatile VALUE errinfo = ruby_errinfo; - int state; - struct { - NODE *node; - ID func; - int vmode, safe; - } volatile saved; - char *volatile ftptr = 0; - - if (OBJ_TAINTED(fname)) { - rb_check_safe_obj(fname); - } - StringValue(fname); - fname = rb_str_new4(fname); - saved.vmode = scope_vmode; - saved.node = ruby_current_node; - saved.func = ruby_frame->last_func; - saved.safe = ruby_safe_level; - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - VALUE feature, path; - long handle; - int found; - - ruby_safe_level = safe; - found = search_required(fname, &feature, &path); - if (found) { - if (!path || !(ftptr = load_lock(RSTRING_PTR(feature)))) { - result = Qfalse; - } - else { - ruby_safe_level = 0; - switch (found) { - case 'r': - rb_load(path, 0); - break; - - case 's': - ruby_current_node = 0; - ruby_sourcefile = rb_source_filename(RSTRING(path)->ptr); - ruby_sourceline = 0; - ruby_frame->last_func = 0; - SCOPE_SET(SCOPE_PUBLIC); - handle = (long)dln_load(RSTRING(path)->ptr); - rb_ary_push(ruby_dln_librefs, LONG2NUM(handle)); - break; - } - rb_provide_feature(feature); - result = Qtrue; - } - } - } - POP_TAG(); - ruby_current_node = saved.node; - ruby_set_current_source(); - ruby_frame->last_func = saved.func; - SCOPE_SET(saved.vmode); - ruby_safe_level = saved.safe; - load_unlock(ftptr); - if (state) JUMP_TAG(state); - if (NIL_P(result)) { - load_failed(fname); - } - ruby_errinfo = errinfo; - - return result; -} - -VALUE -rb_require(fname) - const char *fname; -{ - VALUE fn = rb_str_new2(fname); - OBJ_FREEZE(fn); - return rb_require_safe(fn, ruby_safe_level); -} - -void -ruby_init_ext(name, init) - const char *name; - void (*init) _((void)); -{ - ruby_current_node = 0; - ruby_sourcefile = rb_source_filename(name); - ruby_sourceline = 0; - ruby_frame->last_func = 0; - ruby_frame->orig_func = 0; - SCOPE_SET(SCOPE_PUBLIC); - if (load_lock(name)) { - (*init)(); - rb_provide(name); - load_unlock(name); - } -} - -static void -secure_visibility(self) - VALUE self; -{ - if (ruby_safe_level >= 4 && !OBJ_TAINTED(self)) { - rb_raise(rb_eSecurityError, "Insecure: can't change method visibility"); - } -} - -static void -set_method_visibility(self, argc, argv, ex) - VALUE self; - int argc; - VALUE *argv; - ID ex; -{ - int i; - - secure_visibility(self); - for (i=0; i self - * public(symbol, ...) => self - * - * With no arguments, sets the default visibility for subsequently - * defined methods to public. With arguments, sets the named methods to - * have public visibility. - */ - -static VALUE -rb_mod_public(argc, argv, module) - int argc; - VALUE *argv; - VALUE module; -{ - secure_visibility(module); - if (argc == 0) { - SCOPE_SET(SCOPE_PUBLIC); - } - else { - set_method_visibility(module, argc, argv, NOEX_PUBLIC); - } - return module; -} - -/* - * call-seq: - * protected => self - * protected(symbol, ...) => self - * - * With no arguments, sets the default visibility for subsequently - * defined methods to protected. With arguments, sets the named methods - * to have protected visibility. - */ - -static VALUE -rb_mod_protected(argc, argv, module) - int argc; - VALUE *argv; - VALUE module; -{ - secure_visibility(module); - if (argc == 0) { - SCOPE_SET(SCOPE_PROTECTED); - } - else { - set_method_visibility(module, argc, argv, NOEX_PROTECTED); - } - return module; -} - -/* - * call-seq: - * private => self - * private(symbol, ...) => self - * - * With no arguments, sets the default visibility for subsequently - * defined methods to private. With arguments, sets the named methods - * to have private visibility. - * - * module Mod - * def a() end - * def b() end - * private - * def c() end - * private :a - * end - * Mod.private_instance_methods #=> ["a", "c"] - */ - -static VALUE -rb_mod_private(argc, argv, module) - int argc; - VALUE *argv; - VALUE module; -{ - secure_visibility(module); - if (argc == 0) { - SCOPE_SET(SCOPE_PRIVATE); - } - else { - set_method_visibility(module, argc, argv, NOEX_PRIVATE); - } - return module; -} - -/* - * call-seq: - * mod.public_class_method(symbol, ...) => mod - * - * Makes a list of existing class methods public. - */ - -static VALUE -rb_mod_public_method(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - set_method_visibility(CLASS_OF(obj), argc, argv, NOEX_PUBLIC); - return obj; -} - -/* - * call-seq: - * mod.private_class_method(symbol, ...) => mod - * - * Makes existing class methods private. Often used to hide the default - * constructor new. - * - * class SimpleSingleton # Not thread safe - * private_class_method :new - * def SimpleSingleton.create(*args, &block) - * @me = new(*args, &block) if ! @me - * @me - * end - * end - */ - -static VALUE -rb_mod_private_method(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - set_method_visibility(CLASS_OF(obj), argc, argv, NOEX_PRIVATE); - return obj; -} - -/* - * call-seq: - * public - * public(symbol, ...) - * - * With no arguments, sets the default visibility for subsequently - * defined methods to public. With arguments, sets the named methods to - * have public visibility. - */ - -static VALUE -top_public(argc, argv) - int argc; - VALUE *argv; -{ - return rb_mod_public(argc, argv, rb_cObject); -} - -static VALUE -top_private(argc, argv) - int argc; - VALUE *argv; -{ - return rb_mod_private(argc, argv, rb_cObject); -} - -/* - * call-seq: - * module_function(symbol, ...) => self - * - * Creates module functions for the named methods. These functions may - * be called with the module as a receiver, and also become available - * as instance methods to classes that mix in the module. Module - * functions are copies of the original, and so may be changed - * independently. The instance-method versions are made private. If - * used with no arguments, subsequently defined methods become module - * functions. - * - * module Mod - * def one - * "This is one" - * end - * module_function :one - * end - * class Cls - * include Mod - * def callOne - * one - * end - * end - * Mod.one #=> "This is one" - * c = Cls.new - * c.callOne #=> "This is one" - * module Mod - * def one - * "This is the new one" - * end - * end - * Mod.one #=> "This is one" - * c.callOne #=> "This is the new one" - */ - -static VALUE -rb_mod_modfunc(argc, argv, module) - int argc; - VALUE *argv; - VALUE module; -{ - int i; - ID id; - NODE *body; - - if (TYPE(module) != T_MODULE) { - rb_raise(rb_eTypeError, "module_function must be called for modules"); - } - - secure_visibility(module); - if (argc == 0) { - SCOPE_SET(SCOPE_MODFUNC); - return module; - } - - set_method_visibility(module, argc, argv, NOEX_PRIVATE); - for (i=0; ind_body == 0) { - print_undef(module, id); - } - if (nd_type(body->nd_body) != NODE_ZSUPER) { - break; /* normal case: need not to follow 'super' link */ - } - m = RCLASS(m)->super; - if (!m) break; - } - rb_add_method(rb_singleton_class(module), id, body->nd_body, NOEX_PUBLIC); - } - return module; -} - -/* - * call-seq: - * append_features(mod) => mod - * - * When this module is included in another, Ruby calls - * append_features in this module, passing it the - * receiving module in _mod_. Ruby's default implementation is - * to add the constants, methods, and module variables of this module - * to _mod_ if this module has not already been added to - * _mod_ or one of its ancestors. See also Module#include. - */ - -static VALUE -rb_mod_append_features(module, include) - VALUE module, include; -{ - switch (TYPE(include)) { - case T_CLASS: - case T_MODULE: - break; - default: - Check_Type(include, T_CLASS); - break; - } - rb_include_module(include, module); - - return module; -} - -/* - * call-seq: - * include(module, ...) => self - * - * Invokes Module.append_features on each parameter in turn. - */ - -static VALUE -rb_mod_include(argc, argv, module) - int argc; - VALUE *argv; - VALUE module; -{ - int i; - - for (i=0; i obj - * - * Extends the specified object by adding this module's constants and - * methods (which are added as singleton methods). This is the callback - * method used by Object#extend. - * - * module Picky - * def Picky.extend_object(o) - * if String === o - * puts "Can't add Picky to a String" - * else - * puts "Picky added to #{o.class}" - * super - * end - * end - * end - * (s = Array.new).extend Picky # Call Object.extend - * (s = "quick brown fox").extend Picky - * - * produces: - * - * Picky added to Array - * Can't add Picky to a String - */ - -static VALUE -rb_mod_extend_object(mod, obj) - VALUE mod, obj; -{ - rb_extend_object(obj, mod); - return obj; -} - -/* - * call-seq: - * obj.extend(module, ...) => obj - * - * Adds to _obj_ the instance methods from each module given as a - * parameter. - * - * module Mod - * def hello - * "Hello from Mod.\n" - * end - * end - * - * class Klass - * def hello - * "Hello from Klass.\n" - * end - * end - * - * k = Klass.new - * k.hello #=> "Hello from Klass.\n" - * k.extend(Mod) #=> # - * k.hello #=> "Hello from Mod.\n" - */ - -static VALUE -rb_obj_extend(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - int i; - - if (argc == 0) { - rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)"); - } - for (i=0; i self - * - * Invokes Module.append_features - * on each parameter in turn. Effectively adds the methods and constants - * in each module to the receiver. - */ - -static VALUE -top_include(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; -{ - rb_secure(4); - if (ruby_wrapper) { - rb_warning("main#include in the wrapped load is effective only in wrapper module"); - return rb_mod_include(argc, argv, ruby_wrapper); - } - return rb_mod_include(argc, argv, rb_cObject); -} - -VALUE rb_f_trace_var(); -VALUE rb_f_untrace_var(); - -static void -errinfo_setter(val, id, var) - VALUE val; - ID id; - VALUE *var; -{ - if (!NIL_P(val) && !rb_obj_is_kind_of(val, rb_eException)) { - rb_raise(rb_eTypeError, "assigning non-exception to $!"); - } - *var = val; -} - -static VALUE -errat_getter(id) - ID id; -{ - return get_backtrace(ruby_errinfo); -} - -static void -errat_setter(val, id, var) - VALUE val; - ID id; - VALUE *var; -{ - if (NIL_P(ruby_errinfo)) { - rb_raise(rb_eArgError, "$! not set"); - } - set_backtrace(ruby_errinfo, val); -} - -/* - * call-seq: - * local_variables => array - * - * Returns the names of the current local variables. - * - * fred = 1 - * for i in 1..10 - * # ... - * end - * local_variables #=> ["fred", "i"] - */ - -static VALUE -rb_f_local_variables() -{ - ID *tbl; - int n, i; - VALUE ary = rb_ary_new(); - struct RVarmap *vars; - - tbl = ruby_scope->local_tbl; - if (tbl) { - n = *tbl++; - for (i=2; iid && rb_is_local_id(vars->id)) { /* skip $_, $~ and flip states */ - rb_ary_push(ary, rb_str_new2(rb_id2name(vars->id))); - } - vars = vars->next; - } - - return ary; -} - -static VALUE rb_f_catch _((VALUE,VALUE)); -NORETURN(static VALUE rb_f_throw _((int,VALUE*))); - -struct end_proc_data { - void (*func)(); - VALUE data; - int safe; - struct end_proc_data *next; -}; - -static struct end_proc_data *end_procs, *ephemeral_end_procs, *tmp_end_procs; - -void -rb_set_end_proc(func, data) - void (*func) _((VALUE)); - VALUE data; -{ - struct end_proc_data *link = ALLOC(struct end_proc_data); - struct end_proc_data **list; - - if (ruby_wrapper) list = &ephemeral_end_procs; - else list = &end_procs; - link->next = *list; - link->func = func; - link->data = data; - link->safe = ruby_safe_level; - *list = link; -} - -void -rb_mark_end_proc() -{ - struct end_proc_data *link; - - link = end_procs; - while (link) { - rb_gc_mark(link->data); - link = link->next; - } - link = ephemeral_end_procs; - while (link) { - rb_gc_mark(link->data); - link = link->next; - } - link = tmp_end_procs; - while (link) { - rb_gc_mark(link->data); - link = link->next; - } -} - -static void call_end_proc _((VALUE data)); - -static void -call_end_proc(data) - VALUE data; -{ - PUSH_ITER(ITER_NOT); - PUSH_FRAME(); - ruby_frame->self = ruby_frame->prev->self; - ruby_frame->node = 0; - ruby_frame->last_func = 0; - ruby_frame->last_class = 0; - proc_invoke(data, rb_ary_new2(0), Qundef, 0); - POP_FRAME(); - POP_ITER(); -} - -static void -rb_f_END() -{ - PUSH_FRAME(); - ruby_frame->argc = 0; - ruby_frame->iter = ITER_CUR; - rb_set_end_proc(call_end_proc, rb_block_proc()); - POP_FRAME(); -} - -/* - * call-seq: - * at_exit { block } -> proc - * - * Converts _block_ to a +Proc+ object (and therefore - * binds it at the point of call) and registers it for execution when - * the program exits. If multiple handlers are registered, they are - * executed in reverse order of registration. - * - * def do_at_exit(str1) - * at_exit { print str1 } - * end - * at_exit { puts "cruel world" } - * do_at_exit("goodbye ") - * exit - * - * produces: - * - * goodbye cruel world - */ - -static VALUE -rb_f_at_exit() -{ - VALUE proc; - - if (!rb_block_given_p()) { - rb_raise(rb_eArgError, "called without a block"); - } - proc = rb_block_proc(); - rb_set_end_proc(call_end_proc, proc); - return proc; -} - -void -rb_exec_end_proc() -{ - struct end_proc_data *link, *tmp; - int status; - volatile int safe = ruby_safe_level; - - while (ephemeral_end_procs) { - tmp_end_procs = link = ephemeral_end_procs; - ephemeral_end_procs = 0; - while (link) { - PUSH_TAG(PROT_NONE); - if ((status = EXEC_TAG()) == 0) { - ruby_safe_level = link->safe; - (*link->func)(link->data); - } - POP_TAG(); - if (status) { - error_handle(status); - } - tmp = link; - tmp_end_procs = link = link->next; - free(tmp); - } - } - while (end_procs) { - tmp_end_procs = link = end_procs; - end_procs = 0; - while (link) { - PUSH_TAG(PROT_NONE); - if ((status = EXEC_TAG()) == 0) { - ruby_safe_level = link->safe; - (*link->func)(link->data); - } - POP_TAG(); - if (status) { - error_handle(status); - } - tmp = link; - tmp_end_procs = link = link->next; - free(tmp); - } - } - ruby_safe_level = safe; -} - -void -Init_eval() -{ - init = rb_intern("initialize"); - eqq = rb_intern("==="); - each = rb_intern("each"); - - aref = rb_intern("[]"); - aset = rb_intern("[]="); - match = rb_intern("=~"); - missing = rb_intern("method_missing"); - added = rb_intern("method_added"); - singleton_added = rb_intern("singleton_method_added"); - removed = rb_intern("method_removed"); - singleton_removed = rb_intern("singleton_method_removed"); - undefined = rb_intern("method_undefined"); - singleton_undefined = rb_intern("singleton_method_undefined"); - - __id__ = rb_intern("__id__"); - __send__ = rb_intern("__send__"); - - rb_global_variable((void *)&top_scope); - rb_global_variable((void *)&ruby_eval_tree_begin); - - rb_global_variable((void *)&ruby_eval_tree); - rb_global_variable((void *)&ruby_dyna_vars); - - rb_define_virtual_variable("$@", errat_getter, errat_setter); - rb_define_hooked_variable("$!", &ruby_errinfo, 0, errinfo_setter); - - rb_define_global_function("eval", rb_f_eval, -1); - rb_define_global_function("iterator?", rb_f_block_given_p, 0); - rb_define_global_function("block_given?", rb_f_block_given_p, 0); - rb_define_global_function("method_missing", rb_method_missing, -1); - rb_define_global_function("loop", rb_f_loop, 0); - - rb_define_method(rb_mKernel, "respond_to?", obj_respond_to, -1); - respond_to = rb_intern("respond_to?"); - rb_global_variable((void *)&basic_respond_to); - basic_respond_to = rb_method_node(rb_cObject, respond_to); - - rb_define_global_function("raise", rb_f_raise, -1); - rb_define_global_function("fail", rb_f_raise, -1); - - rb_define_global_function("caller", rb_f_caller, -1); - - rb_define_global_function("exit", rb_f_exit, -1); - rb_define_global_function("abort", rb_f_abort, -1); - - rb_define_global_function("at_exit", rb_f_at_exit, 0); - - rb_define_global_function("catch", rb_f_catch, 1); - rb_define_global_function("throw", rb_f_throw, -1); - rb_define_global_function("global_variables", rb_f_global_variables, 0); /* in variable.c */ - rb_define_global_function("local_variables", rb_f_local_variables, 0); - - rb_define_method(rb_mKernel, "send", rb_f_send, -1); - rb_define_method(rb_mKernel, "__send__", rb_f_send, -1); - rb_define_method(rb_mKernel, "instance_eval", rb_obj_instance_eval, -1); - - rb_define_private_method(rb_cModule, "append_features", rb_mod_append_features, 1); - rb_define_private_method(rb_cModule, "extend_object", rb_mod_extend_object, 1); - rb_define_private_method(rb_cModule, "include", rb_mod_include, -1); - rb_define_private_method(rb_cModule, "public", rb_mod_public, -1); - rb_define_private_method(rb_cModule, "protected", rb_mod_protected, -1); - rb_define_private_method(rb_cModule, "private", rb_mod_private, -1); - rb_define_private_method(rb_cModule, "module_function", rb_mod_modfunc, -1); - rb_define_method(rb_cModule, "method_defined?", rb_mod_method_defined, 1); - rb_define_method(rb_cModule, "public_method_defined?", rb_mod_public_method_defined, 1); - rb_define_method(rb_cModule, "private_method_defined?", rb_mod_private_method_defined, 1); - rb_define_method(rb_cModule, "protected_method_defined?", rb_mod_protected_method_defined, 1); - rb_define_method(rb_cModule, "public_class_method", rb_mod_public_method, -1); - rb_define_method(rb_cModule, "private_class_method", rb_mod_private_method, -1); - rb_define_method(rb_cModule, "module_eval", rb_mod_module_eval, -1); - rb_define_method(rb_cModule, "class_eval", rb_mod_module_eval, -1); - - rb_undef_method(rb_cClass, "module_function"); - - rb_define_private_method(rb_cModule, "remove_method", rb_mod_remove_method, -1); - rb_define_private_method(rb_cModule, "undef_method", rb_mod_undef_method, -1); - rb_define_private_method(rb_cModule, "alias_method", rb_mod_alias_method, 2); - rb_define_private_method(rb_cModule, "define_method", rb_mod_define_method, -1); - - rb_define_singleton_method(rb_cModule, "nesting", rb_mod_nesting, 0); - rb_define_singleton_method(rb_cModule, "constants", rb_mod_s_constants, 0); - - rb_define_singleton_method(ruby_top_self, "include", top_include, -1); - rb_define_singleton_method(ruby_top_self, "public", top_public, -1); - rb_define_singleton_method(ruby_top_self, "private", top_private, -1); - - rb_define_method(rb_mKernel, "extend", rb_obj_extend, -1); - - rb_define_global_function("trace_var", rb_f_trace_var, -1); /* in variable.c */ - rb_define_global_function("untrace_var", rb_f_untrace_var, -1); /* in variable.c */ - - rb_define_global_function("set_trace_func", set_trace_func, 1); - rb_global_variable(&trace_func); - - rb_define_virtual_variable("$SAFE", safe_getter, safe_setter); -} - -/* - * call-seq: - * mod.autoload(name, filename) => nil - * - * Registers _filename_ to be loaded (using Kernel::require) - * the first time that _name_ (which may be a String or - * a symbol) is accessed in the namespace of _mod_. - * - * module A - * end - * A.autoload(:B, "b") - * A::B.doit # autoloads "b" - */ - -static VALUE -rb_mod_autoload(mod, sym, file) - VALUE mod; - VALUE sym; - VALUE file; -{ - ID id = rb_to_id(sym); - - Check_SafeStr(file); - rb_autoload(mod, id, RSTRING(file)->ptr); - return Qnil; -} - -/* - * call-seq: - * mod.autoload?(name) => String or nil - * - * Returns _filename_ to be loaded if _name_ is registered as - * +autoload+ in the namespace of _mod_. - * - * module A - * end - * A.autoload(:B, "b") - * A.autoload?(:B) # => "b" - */ - -static VALUE -rb_mod_autoload_p(mod, sym) - VALUE mod, sym; -{ - return rb_autoload_p(mod, rb_to_id(sym)); -} - -/* - * call-seq: - * autoload(module, filename) => nil - * - * Registers _filename_ to be loaded (using Kernel::require) - * the first time that _module_ (which may be a String or - * a symbol) is accessed. - * - * autoload(:MyModule, "/usr/local/lib/modules/my_module.rb") - */ - -static VALUE -rb_f_autoload(obj, sym, file) - VALUE obj; - VALUE sym; - VALUE file; -{ - if (NIL_P(ruby_cbase)) { - rb_raise(rb_eTypeError, "no class/module for autoload target"); - } - return rb_mod_autoload(ruby_cbase, sym, file); -} - -/* - * call-seq: - * autoload(module, filename) => nil - * - * Registers _filename_ to be loaded (using Kernel::require) - * the first time that _module_ (which may be a String or - * a symbol) is accessed. - * - * autoload(:MyModule, "/usr/local/lib/modules/my_module.rb") - */ - -static VALUE -rb_f_autoload_p(obj, sym) - VALUE obj; - VALUE sym; -{ - /* use ruby_cbase as same as rb_f_autoload. */ - if (NIL_P(ruby_cbase)) { - return Qfalse; - } - return rb_mod_autoload_p(ruby_cbase, sym); -} - -void -Init_load() -{ - rb_define_readonly_variable("$:", &rb_load_path); - rb_define_readonly_variable("$-I", &rb_load_path); - rb_define_readonly_variable("$LOAD_PATH", &rb_load_path); - rb_load_path = rb_ary_new(); - - rb_define_readonly_variable("$\"", &rb_features); - rb_define_readonly_variable("$LOADED_FEATURES", &rb_features); - rb_features = rb_ary_new(); - - rb_define_global_function("load", rb_f_load, -1); - rb_define_global_function("require", rb_f_require, 1); - rb_define_method(rb_cModule, "autoload", rb_mod_autoload, 2); - rb_define_method(rb_cModule, "autoload?", rb_mod_autoload_p, 1); - rb_define_global_function("autoload", rb_f_autoload, 2); - rb_define_global_function("autoload?", rb_f_autoload_p, 1); - rb_global_variable(&ruby_wrapper); - - rb_global_variable(&ruby_dln_librefs); - ruby_dln_librefs = rb_ary_new(); -} - -static void -scope_dup(scope) - struct SCOPE *scope; -{ - ID *tbl; - VALUE *vars; - - scope->flags |= SCOPE_DONT_RECYCLE; - if (scope->flags & SCOPE_MALLOC) return; - - if (scope->local_tbl) { - tbl = scope->local_tbl; - vars = ALLOC_N(VALUE, tbl[0]+1); - *vars++ = scope->local_vars[-1]; - MEMCPY(vars, scope->local_vars, VALUE, tbl[0]); - scope->local_vars = vars; - scope->flags |= SCOPE_MALLOC; - } -} - -static void -blk_mark(data) - struct BLOCK *data; -{ - while (data) { - rb_gc_mark_frame(&data->frame); - rb_gc_mark((VALUE)data->scope); - rb_gc_mark((VALUE)data->var); - rb_gc_mark((VALUE)data->body); - rb_gc_mark((VALUE)data->self); - rb_gc_mark((VALUE)data->dyna_vars); - rb_gc_mark((VALUE)data->cref); - rb_gc_mark(data->wrapper); - rb_gc_mark(data->block_obj); - data = data->prev; - } -} - -static void -frame_free(frame) - struct FRAME *frame; -{ - struct FRAME *tmp; - - frame = frame->prev; - while (frame) { - tmp = frame; - frame = frame->prev; - free(tmp); - } -} - -static void -blk_free(data) - struct BLOCK *data; -{ - void *tmp; - - while (data) { - frame_free(&data->frame); - tmp = data; - data = data->prev; - free(tmp); - } -} - -static void -frame_dup(frame) - struct FRAME *frame; -{ - struct FRAME *tmp; - - for (;;) { - frame->tmp = 0; /* should not preserve tmp */ - if (!frame->prev) break; - tmp = ALLOC(struct FRAME); - *tmp = *frame->prev; - frame->prev = tmp; - frame = tmp; - } -} - - -static void -blk_copy_prev(block) - struct BLOCK *block; -{ - struct BLOCK *tmp; - struct RVarmap* vars; - - while (block->prev) { - tmp = ALLOC_N(struct BLOCK, 1); - MEMCPY(tmp, block->prev, struct BLOCK, 1); - scope_dup(tmp->scope); - frame_dup(&tmp->frame); - - for (vars = tmp->dyna_vars; vars; vars = vars->next) { - if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break; - FL_SET(vars, DVAR_DONT_RECYCLE); - } - - block->prev = tmp; - block = tmp; - } -} - - -static void -blk_dup(dup, orig) - struct BLOCK *dup, *orig; -{ - MEMCPY(dup, orig, struct BLOCK, 1); - frame_dup(&dup->frame); - - if (dup->iter) { - blk_copy_prev(dup); - } - else { - dup->prev = 0; - } -} - -/* - * MISSING: documentation - */ - -static VALUE -proc_clone(self) - VALUE self; -{ - struct BLOCK *orig, *data; - VALUE bind; - - Data_Get_Struct(self, struct BLOCK, orig); - bind = Data_Make_Struct(rb_obj_class(self),struct BLOCK,blk_mark,blk_free,data); - CLONESETUP(bind, self); - blk_dup(data, orig); - - return bind; -} - -/* - * MISSING: documentation - */ - -#define PROC_TSHIFT (FL_USHIFT+1) -#define PROC_TMASK (FL_USER1|FL_USER2|FL_USER3) -#define PROC_TMAX (PROC_TMASK >> PROC_TSHIFT) - -static int proc_get_safe_level(VALUE); - -static VALUE -proc_dup(self) - VALUE self; -{ - struct BLOCK *orig, *data; - VALUE bind; - int safe = proc_get_safe_level(self); - - Data_Get_Struct(self, struct BLOCK, orig); - bind = Data_Make_Struct(rb_obj_class(self),struct BLOCK,blk_mark,blk_free,data); - blk_dup(data, orig); - if (safe > PROC_TMAX) safe = PROC_TMAX; - FL_SET(bind, (safe << PROC_TSHIFT) & PROC_TMASK); - - return bind; -} - -/* - * call-seq: - * binding -> a_binding - * - * Returns a +Binding+ object, describing the variable and - * method bindings at the point of call. This object can be used when - * calling +eval+ to execute the evaluated command in this - * environment. Also see the description of class +Binding+. - * - * def getBinding(param) - * return binding - * end - * b = getBinding("hello") - * eval("param", b) #=> "hello" - */ - -static VALUE -rb_f_binding(self) - VALUE self; -{ - struct BLOCK *data, *p; - struct RVarmap *vars; - VALUE bind; - - PUSH_BLOCK(0,0); - bind = Data_Make_Struct(rb_cBinding,struct BLOCK,blk_mark,blk_free,data); - *data = *ruby_block; - - data->orig_thread = rb_thread_current(); - data->wrapper = ruby_wrapper; - data->iter = rb_f_block_given_p(); - frame_dup(&data->frame); - if (ruby_frame->prev) { - data->frame.last_func = ruby_frame->prev->last_func; - data->frame.last_class = ruby_frame->prev->last_class; - data->frame.orig_func = ruby_frame->prev->orig_func; - } - - if (data->iter) { - blk_copy_prev(data); - } - else { - data->prev = 0; - } - - for (p = data; p; p = p->prev) { - for (vars = p->dyna_vars; vars; vars = vars->next) { - if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break; - FL_SET(vars, DVAR_DONT_RECYCLE); - } - } - scope_dup(data->scope); - POP_BLOCK(); - - return bind; -} - -#define SAFE_LEVEL_MAX PROC_TMASK - -static void -proc_save_safe_level(data) - VALUE data; -{ - int safe = ruby_safe_level; - if (safe > PROC_TMAX) safe = PROC_TMAX; - FL_SET(data, (safe << PROC_TSHIFT) & PROC_TMASK); -} - -static int -proc_get_safe_level(data) - VALUE data; -{ - return (RBASIC(data)->flags & PROC_TMASK) >> PROC_TSHIFT; -} - -static void -proc_set_safe_level(data) - VALUE data; -{ - ruby_safe_level = proc_get_safe_level(data); -} - -static VALUE -proc_alloc(klass, proc) - VALUE klass; - int proc; -{ - volatile VALUE block; - struct BLOCK *data, *p; - struct RVarmap *vars; - - if (!rb_block_given_p() && !rb_f_block_given_p()) { - rb_raise(rb_eArgError, "tried to create Proc object without a block"); - } - if (proc && !rb_block_given_p()) { - rb_warn("tried to create Proc object without a block"); - } - - if (!proc && ruby_block->block_obj && CLASS_OF(ruby_block->block_obj) == klass) { - return ruby_block->block_obj; - } - block = Data_Make_Struct(klass, struct BLOCK, blk_mark, blk_free, data); - *data = *ruby_block; - - data->orig_thread = rb_thread_current(); - data->wrapper = ruby_wrapper; - data->iter = data->prev?Qtrue:Qfalse; - data->block_obj = block; - frame_dup(&data->frame); - if (data->iter) { - blk_copy_prev(data); - } - else { - data->prev = 0; - } - - for (p = data; p; p = p->prev) { - for (vars = p->dyna_vars; vars; vars = vars->next) { - if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break; - FL_SET(vars, DVAR_DONT_RECYCLE); - } - } - scope_dup(data->scope); - proc_save_safe_level(block); - if (proc) { - data->flags |= BLOCK_LAMBDA; - } - else { - ruby_block->block_obj = block; - } - - return block; -} - -/* - * call-seq: - * Proc.new {|...| block } => a_proc - * Proc.new => a_proc - * - * Creates a new Proc object, bound to the current - * context. Proc::new may be called without a block only - * within a method with an attached block, in which case that block is - * converted to the Proc object. - * - * def proc_from - * Proc.new - * end - * proc = proc_from { "hello" } - * proc.call #=> "hello" - */ - -static VALUE -proc_s_new(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - VALUE block = proc_alloc(klass, Qfalse); - - rb_obj_call_init(block, argc, argv); - return block; -} - -VALUE -rb_block_proc() -{ - return proc_alloc(rb_cProc, Qfalse); -} - -VALUE -rb_f_lambda() -{ - rb_warn("rb_f_lambda() is deprecated; use rb_block_proc() instead"); - return proc_alloc(rb_cProc, Qtrue); -} - -/* - * call-seq: - * proc { |...| block } => a_proc - * lambda { |...| block } => a_proc - * - * Equivalent to Proc.new, except the resulting Proc objects - * check the number of parameters passed when called. - */ - -static VALUE -proc_lambda() -{ - return proc_alloc(rb_cProc, Qtrue); -} - -static int -block_orphan(data) - struct BLOCK *data; -{ - if (data->scope->flags & SCOPE_NOSTACK) { - return 1; - } - if (data->orig_thread != rb_thread_current()) { - return 1; - } - return 0; -} - -static VALUE -proc_invoke(proc, args, self, klass) - VALUE proc, args; /* OK */ - VALUE self, klass; -{ - struct BLOCK * volatile old_block; - struct BLOCK _block; - struct BLOCK *data; - volatile VALUE result = Qundef; - int state; - volatile int safe = ruby_safe_level; - volatile VALUE old_wrapper = ruby_wrapper; - volatile int pcall, avalue = Qtrue; - volatile VALUE tmp = args; - - if (rb_block_given_p() && ruby_frame->last_func) { - if (klass != ruby_frame->last_class) - klass = rb_obj_class(proc); - rb_warning("block for %s#%s is useless", - rb_class2name(klass), - rb_id2name(ruby_frame->last_func)); - } - - Data_Get_Struct(proc, struct BLOCK, data); - pcall = (data->flags & BLOCK_LAMBDA) ? YIELD_LAMBDA_CALL : 0; - if (!pcall && RARRAY(args)->len == 1) { - avalue = Qfalse; - args = RARRAY(args)->ptr[0]; - } - - PUSH_VARS(); - ruby_wrapper = data->wrapper; - ruby_dyna_vars = data->dyna_vars; - /* PUSH BLOCK from data */ - old_block = ruby_block; - _block = *data; - if (self != Qundef) _block.frame.self = self; - if (klass) _block.frame.last_class = klass; - _block.frame.argc = RARRAY(tmp)->len; - _block.frame.flags = ruby_frame->flags; - if (_block.frame.argc && DMETHOD_P()) { - NEWOBJ(scope, struct SCOPE); - OBJSETUP(scope, tmp, T_SCOPE); - scope->local_tbl = _block.scope->local_tbl; - scope->local_vars = _block.scope->local_vars; - scope->flags |= SCOPE_CLONE | (_block.scope->flags & SCOPE_MALLOC); - _block.scope = scope; - } - /* modify current frame */ - ruby_block = &_block; - PUSH_ITER(ITER_CUR); - ruby_frame->iter = ITER_CUR; - PUSH_TAG(pcall ? PROT_LAMBDA : PROT_NONE); - state = EXEC_TAG(); - if (state == 0) { - proc_set_safe_level(proc); - result = rb_yield_0(args, self, (self!=Qundef)?CLASS_OF(self):0, pcall, avalue); - } - else if (TAG_DST()) { - result = prot_tag->retval; - } - POP_TAG(); - POP_ITER(); - ruby_block = old_block; - ruby_wrapper = old_wrapper; - POP_VARS(); - ruby_safe_level = safe; - - switch (state) { - case 0: - break; - case TAG_RETRY: - proc_jump_error(TAG_RETRY, Qnil); /* xxx */ - JUMP_TAG(state); - break; - case TAG_NEXT: - case TAG_BREAK: - if (!pcall && result != Qundef) { - proc_jump_error(state, result); - } - case TAG_RETURN: - if (result != Qundef) { - if (pcall) break; - return_jump(result); - } - default: - JUMP_TAG(state); - } - return result; -} - -/* CHECKME: are the argument checking semantics correct? */ - -/* - * call-seq: - * prc.call(params,...) => obj - * prc[params,...] => obj - * - * Invokes the block, setting the block's parameters to the values in - * params using something close to method calling semantics. - * Generates a warning if multiple values are passed to a proc that - * expects just one (previously this silently converted the parameters - * to an array). - * - * For procs created using Kernel.proc, generates an - * error if the wrong number of parameters - * are passed to a proc with multiple parameters. For procs created using - * Proc.new, extra parameters are silently discarded. - * - * Returns the value of the last expression evaluated in the block. See - * also Proc#yield. - * - * a_proc = Proc.new {|a, *b| b.collect {|i| i*a }} - * a_proc.call(9, 1, 2, 3) #=> [9, 18, 27] - * a_proc[9, 1, 2, 3] #=> [9, 18, 27] - * a_proc = Proc.new {|a,b| a} - * a_proc.call(1,2,3) - * - * produces: - * - * prog.rb:5: wrong number of arguments (3 for 2) (ArgumentError) - * from prog.rb:4:in `call' - * from prog.rb:5 - */ - -static VALUE -proc_call(proc, args) - VALUE proc, args; /* OK */ -{ - return proc_invoke(proc, args, Qundef, 0); -} - -static VALUE bmcall _((VALUE, VALUE)); -static VALUE method_arity _((VALUE)); - -/* - * call-seq: - * prc.arity -> fixnum - * - * Returns the number of arguments that would not be ignored. If the block - * is declared to take no arguments, returns 0. If the block is known - * to take exactly n arguments, returns n. If the block has optional - * arguments, return -n-1, where n is the number of mandatory - * arguments. A proc with no argument declarations - * is the same a block declaring || as its arguments. - * - * Proc.new {}.arity #=> 0 - * Proc.new {||}.arity #=> 0 - * Proc.new {|a|}.arity #=> 1 - * Proc.new {|a,b|}.arity #=> 2 - * Proc.new {|a,b,c|}.arity #=> 3 - * Proc.new {|*a|}.arity #=> -1 - * Proc.new {|a,*b|}.arity #=> -2 - */ - -static VALUE -proc_arity(proc) - VALUE proc; -{ - struct BLOCK *data; - NODE *list; - int n; - - Data_Get_Struct(proc, struct BLOCK, data); - if (data->var == 0) { - if (data->body && nd_type(data->body) == NODE_IFUNC && - data->body->nd_cfnc == bmcall) { - return method_arity(data->body->nd_tval); - } - return INT2FIX(-1); - } - if (data->var == (NODE*)1) return INT2FIX(0); - if (data->var == (NODE*)2) return INT2FIX(0); - switch (nd_type(data->var)) { - default: - return INT2FIX(1); - case NODE_MASGN: - list = data->var->nd_head; - n = 0; - while (list) { - n++; - list = list->nd_next; - } - if (data->var->nd_args) return INT2FIX(-n-1); - return INT2FIX(n); - } -} - -/* - * call-seq: - * prc == other_proc => true or false - * - * Return true if prc is the same object as - * other_proc, or if they are both procs with the same body. - */ - -static VALUE -proc_eq(self, other) - VALUE self, other; -{ - struct BLOCK *data, *data2; - - if (self == other) return Qtrue; - if (TYPE(other) != T_DATA) return Qfalse; - if (RDATA(other)->dmark != (RUBY_DATA_FUNC)blk_mark) return Qfalse; - if (CLASS_OF(self) != CLASS_OF(other)) return Qfalse; - Data_Get_Struct(self, struct BLOCK, data); - Data_Get_Struct(other, struct BLOCK, data2); - if (data->body != data2->body) return Qfalse; - if (data->var != data2->var) return Qfalse; - if (data->scope != data2->scope) return Qfalse; - if (data->dyna_vars != data2->dyna_vars) return Qfalse; - if (data->flags != data2->flags) return Qfalse; - - return Qtrue; -} - -/* - * call-seq: - * prc.to_s => string - * - * Shows the unique identifier for this proc, along with - * an indication of where the proc was defined. - */ - -static VALUE -proc_to_s(self) - VALUE self; -{ - struct BLOCK *data; - NODE *node; - char *cname = rb_obj_classname(self); - const int w = (sizeof(VALUE) * CHAR_BIT) / 4; - long len = strlen(cname)+6+w; /* 6:tags 16:addr */ - VALUE str; - - Data_Get_Struct(self, struct BLOCK, data); - if ((node = data->frame.node) || (node = data->body)) { - len += strlen(node->nd_file) + 2 + (SIZEOF_LONG*CHAR_BIT-NODE_LSHIFT)/3; - str = rb_str_new(0, len); - snprintf(RSTRING(str)->ptr, len+1, - "#<%s:0x%.*lx@%s:%d>", cname, w, (VALUE)data->body, - node->nd_file, nd_line(node)); - } - else { - str = rb_str_new(0, len); - snprintf(RSTRING(str)->ptr, len+1, - "#<%s:0x%.*lx>", cname, w, (VALUE)data->body); - } - RSTRING(str)->len = strlen(RSTRING(str)->ptr); - if (OBJ_TAINTED(self)) OBJ_TAINT(str); - - return str; -} - -/* - * call-seq: - * prc.to_proc -> prc - * - * Part of the protocol for converting objects to Proc - * objects. Instances of class Proc simply return - * themselves. - */ - -static VALUE -proc_to_self(self) - VALUE self; -{ - return self; -} - -/* - * call-seq: - * prc.binding => binding - * - * Returns the binding associated with prc. Note that - * Kernel#eval accepts either a Proc or a - * Binding object as its second parameter. - * - * def fred(param) - * proc {} - * end - * - * b = fred(99) - * eval("param", b.binding) #=> 99 - * eval("param", b) #=> 99 - */ - -static VALUE -proc_binding(proc) - VALUE proc; -{ - struct BLOCK *orig, *data; - VALUE bind; - - Data_Get_Struct(proc, struct BLOCK, orig); - bind = Data_Make_Struct(rb_cBinding,struct BLOCK,blk_mark,blk_free,data); - MEMCPY(data, orig, struct BLOCK, 1); - frame_dup(&data->frame); - - if (data->iter) { - blk_copy_prev(data); - } - else { - data->prev = 0; - } - - return bind; -} - -static VALUE -block_pass(self, node) - VALUE self; - NODE *node; -{ - VALUE proc = rb_eval(self, node->nd_body); /* OK */ - VALUE b; - struct BLOCK * volatile old_block; - struct BLOCK _block; - struct BLOCK *data; - volatile VALUE result = Qnil; - int state; - volatile int orphan; - volatile int safe = ruby_safe_level; - - if (NIL_P(proc)) { - PUSH_ITER(ITER_NOT); - result = rb_eval(self, node->nd_iter); - POP_ITER(); - return result; - } - if (!rb_obj_is_proc(proc)) { - b = rb_check_convert_type(proc, T_DATA, "Proc", "to_proc"); - if (!rb_obj_is_proc(b)) { - rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)", - rb_obj_classname(proc)); - } - proc = b; - } - - if (ruby_safe_level >= 1 && OBJ_TAINTED(proc) && - ruby_safe_level > proc_get_safe_level(proc)) { - rb_raise(rb_eSecurityError, "Insecure: tainted block value"); - } - - if (ruby_block && ruby_block->block_obj == proc) { - PUSH_ITER(ITER_PAS); - result = rb_eval(self, node->nd_iter); - POP_ITER(); - return result; - } - - Data_Get_Struct(proc, struct BLOCK, data); - orphan = block_orphan(data); - - /* PUSH BLOCK from data */ - old_block = ruby_block; - _block = *data; - _block.outer = ruby_block; - if (orphan) _block.uniq = block_unique++; - ruby_block = &_block; - PUSH_ITER(ITER_PRE); - if (ruby_frame->iter == ITER_NOT) - ruby_frame->iter = ITER_PRE; - - PUSH_TAG(PROT_LOOP); - state = EXEC_TAG(); - if (state == 0) { - retry: - proc_set_safe_level(proc); - if (safe > ruby_safe_level) - ruby_safe_level = safe; - result = rb_eval(self, node->nd_iter); - } - else if (state == TAG_BREAK && TAG_DST()) { - result = prot_tag->retval; - state = 0; - } - else if (state == TAG_RETRY) { - state = 0; - goto retry; - } - POP_TAG(); - POP_ITER(); - ruby_block = old_block; - ruby_safe_level = safe; - - switch (state) {/* escape from orphan block */ - case 0: - break; - case TAG_RETURN: - if (orphan) { - proc_jump_error(state, prot_tag->retval); - } - default: - JUMP_TAG(state); - } - - return result; -} - -struct METHOD { - VALUE klass, rklass; - VALUE recv; - ID id, oid; - int safe_level; - NODE *body; -}; - -static void -bm_mark(data) - struct METHOD *data; -{ - rb_gc_mark(data->rklass); - rb_gc_mark(data->klass); - rb_gc_mark(data->recv); - rb_gc_mark((VALUE)data->body); -} - -static VALUE -mnew(klass, obj, id, mklass) - VALUE klass, obj, mklass; - ID id; -{ - VALUE method; - NODE *body; - int noex; - struct METHOD *data; - VALUE rklass = klass; - ID oid = id; - - again: - if ((body = rb_get_method_body(&klass, &id, &noex)) == 0) { - print_undef(rklass, oid); - } - - if (nd_type(body) == NODE_ZSUPER) { - klass = RCLASS(klass)->super; - goto again; - } - - while (rklass != klass && - (FL_TEST(rklass, FL_SINGLETON) || TYPE(rklass) == T_ICLASS)) { - rklass = RCLASS(rklass)->super; - } - method = Data_Make_Struct(mklass, struct METHOD, bm_mark, free, data); - data->klass = klass; - data->recv = obj; - data->id = id; - data->body = body; - data->rklass = rklass; - data->oid = oid; - data->safe_level = NOEX_WITH_SAFE(noex); - OBJ_INFECT(method, klass); - - return method; -} - - -/********************************************************************** - * - * Document-class : Method - * - * Method objects are created by Object#method, and are - * associated with a particular object (not just with a class). They - * may be used to invoke the method within the object, and as a block - * associated with an iterator. They may also be unbound from one - * object (creating an UnboundMethod) and bound to - * another. - * - * class Thing - * def square(n) - * n*n - * end - * end - * thing = Thing.new - * meth = thing.method(:square) - * - * meth.call(9) #=> 81 - * [ 1, 2, 3 ].collect(&meth) #=> [1, 4, 9] - * - */ - -/* - * call-seq: - * meth == other_meth => true or false - * - * Two method objects are equal if that are bound to the same - * object and contain the same body. - */ - - -static VALUE -method_eq(method, other) - VALUE method, other; -{ - struct METHOD *m1, *m2; - - if (TYPE(other) != T_DATA || RDATA(other)->dmark != (RUBY_DATA_FUNC)bm_mark) - return Qfalse; - if (CLASS_OF(method) != CLASS_OF(other)) - return Qfalse; - - Data_Get_Struct(method, struct METHOD, m1); - Data_Get_Struct(other, struct METHOD, m2); - - if (m1->klass != m2->klass || m1->rklass != m2->rklass || - m1->recv != m2->recv || m1->body != m2->body) - return Qfalse; - - return Qtrue; -} - -/* - * call-seq: - * meth.unbind => unbound_method - * - * Dissociates meth from it's current receiver. The resulting - * UnboundMethod can subsequently be bound to a new object - * of the same class (see UnboundMethod). - */ - -static VALUE -method_unbind(obj) - VALUE obj; -{ - VALUE method; - struct METHOD *orig, *data; - - Data_Get_Struct(obj, struct METHOD, orig); - method = Data_Make_Struct(rb_cUnboundMethod, struct METHOD, bm_mark, free, data); - data->klass = orig->klass; - data->recv = Qundef; - data->id = orig->id; - data->body = orig->body; - data->rklass = orig->rklass; - data->oid = orig->oid; - OBJ_INFECT(method, obj); - - return method; -} - -/* - * call-seq: - * obj.method(sym) => method - * - * Looks up the named method as a receiver in obj, returning a - * Method object (or raising NameError). The - * Method object acts as a closure in obj's object - * instance, so instance variables and the value of self - * remain available. - * - * class Demo - * def initialize(n) - * @iv = n - * end - * def hello() - * "Hello, @iv = #{@iv}" - * end - * end - * - * k = Demo.new(99) - * m = k.method(:hello) - * m.call #=> "Hello, @iv = 99" - * - * l = Demo.new('Fred') - * m = l.method("hello") - * m.call #=> "Hello, @iv = Fred" - */ - -static VALUE -rb_obj_method(obj, vid) - VALUE obj; - VALUE vid; -{ - return mnew(CLASS_OF(obj), obj, rb_to_id(vid), rb_cMethod); -} - -/* - * call-seq: - * mod.instance_method(symbol) => unbound_method - * - * Returns an +UnboundMethod+ representing the given - * instance method in _mod_. - * - * class Interpreter - * def do_a() print "there, "; end - * def do_d() print "Hello "; end - * def do_e() print "!\n"; end - * def do_v() print "Dave"; end - * Dispatcher = { - * ?a => instance_method(:do_a), - * ?d => instance_method(:do_d), - * ?e => instance_method(:do_e), - * ?v => instance_method(:do_v) - * } - * def interpret(string) - * string.each_byte {|b| Dispatcher[b].bind(self).call } - * end - * end - * - * - * interpreter = Interpreter.new - * interpreter.interpret('dave') - * - * produces: - * - * Hello there, Dave! - */ - -static VALUE -rb_mod_method(mod, vid) - VALUE mod; - VALUE vid; -{ - return mnew(mod, Qundef, rb_to_id(vid), rb_cUnboundMethod); -} - -/* - * MISSING: documentation - */ - -static VALUE -method_clone(self) - VALUE self; -{ - VALUE clone; - struct METHOD *orig, *data; - - Data_Get_Struct(self, struct METHOD, orig); - clone = Data_Make_Struct(CLASS_OF(self),struct METHOD, bm_mark, free, data); - CLONESETUP(clone, self); - *data = *orig; - - return clone; -} - -/* - * call-seq: - * meth.call(args, ...) => obj - * meth[args, ...] => obj - * - * Invokes the meth with the specified arguments, returning the - * method's return value. - * - * m = 12.method("+") - * m.call(3) #=> 15 - * m.call(20) #=> 32 - */ - -static VALUE -method_call(argc, argv, method) - int argc; - VALUE *argv; - VALUE method; -{ - VALUE result = Qnil; /* OK */ - struct METHOD *data; - int safe; - - Data_Get_Struct(method, struct METHOD, data); - if (data->recv == Qundef) { - rb_raise(rb_eTypeError, "can't call unbound method; bind first"); - } - if (OBJ_TAINTED(method)) { - safe = NOEX_WITH(data->safe_level, 4)|NOEX_TAINTED; - } - else { - safe = data->safe_level; - } - PUSH_ITER(rb_block_given_p()?ITER_PRE:ITER_NOT); - result = rb_call0(data->klass,data->recv,data->id,data->oid,argc,argv,data->body,safe); - POP_ITER(); - return result; -} - -/********************************************************************** - * - * Document-class: UnboundMethod - * - * Ruby supports two forms of objectified methods. Class - * Method is used to represent methods that are associated - * with a particular object: these method objects are bound to that - * object. Bound method objects for an object can be created using - * Object#method. - * - * Ruby also supports unbound methods; methods objects that are not - * associated with a particular object. These can be created either by - * calling Module#instance_method or by calling - * unbind on a bound method object. The result of both of - * these is an UnboundMethod object. - * - * Unbound methods can only be called after they are bound to an - * object. That object must be be a kind_of? the method's original - * class. - * - * class Square - * def area - * @side * @side - * end - * def initialize(side) - * @side = side - * end - * end - * - * area_un = Square.instance_method(:area) - * - * s = Square.new(12) - * area = area_un.bind(s) - * area.call #=> 144 - * - * Unbound methods are a reference to the method at the time it was - * objectified: subsequent changes to the underlying class will not - * affect the unbound method. - * - * class Test - * def test - * :original - * end - * end - * um = Test.instance_method(:test) - * class Test - * def test - * :modified - * end - * end - * t = Test.new - * t.test #=> :modified - * um.bind(t).call #=> :original - * - */ - -/* - * call-seq: - * umeth.bind(obj) -> method - * - * Bind umeth to obj. If Klass was the class - * from which umeth was obtained, - * obj.kind_of?(Klass) must be true. - * - * class A - * def test - * puts "In test, class = #{self.class}" - * end - * end - * class B < A - * end - * class C < B - * end - * - * - * um = B.instance_method(:test) - * bm = um.bind(C.new) - * bm.call - * bm = um.bind(B.new) - * bm.call - * bm = um.bind(A.new) - * bm.call - * - * produces: - * - * In test, class = C - * In test, class = B - * prog.rb:16:in `bind': bind argument must be an instance of B (TypeError) - * from prog.rb:16 - */ - -static VALUE -umethod_bind(method, recv) - VALUE method, recv; -{ - struct METHOD *data, *bound; - VALUE rklass = CLASS_OF(recv); - - Data_Get_Struct(method, struct METHOD, data); - if (data->rklass != rklass) { - if (FL_TEST(data->rklass, FL_SINGLETON)) { - rb_raise(rb_eTypeError, "singleton method bound for a different object"); - } - if (TYPE(data->rklass) == T_MODULE) { - st_table *m_tbl = RCLASS(data->rklass)->m_tbl; - while (RCLASS(rklass)->m_tbl != m_tbl) { - rklass = RCLASS(rklass)->super; - if (!rklass) goto not_instace; - } - } - else if (!rb_obj_is_kind_of(recv, data->rklass)) { - not_instace: - rb_raise(rb_eTypeError, "bind argument must be an instance of %s", - rb_class2name(data->rklass)); - } - } - - method = Data_Make_Struct(rb_cMethod,struct METHOD,bm_mark,free,bound); - *bound = *data; - bound->recv = recv; - bound->rklass = rklass; - - return method; -} - -/* - * call-seq: - * meth.arity => fixnum - * - * Returns an indication of the number of arguments accepted by a - * method. Returns a nonnegative integer for methods that take a fixed - * number of arguments. For Ruby methods that take a variable number of - * arguments, returns -n-1, where n is the number of required - * arguments. For methods written in C, returns -1 if the call takes a - * variable number of arguments. - * - * class C - * def one; end - * def two(a); end - * def three(*a); end - * def four(a, b); end - * def five(a, b, *c); end - * def six(a, b, *c, &d); end - * end - * c = C.new - * c.method(:one).arity #=> 0 - * c.method(:two).arity #=> 1 - * c.method(:three).arity #=> -1 - * c.method(:four).arity #=> 2 - * c.method(:five).arity #=> -3 - * c.method(:six).arity #=> -3 - * - * "cat".method(:size).arity #=> 0 - * "cat".method(:replace).arity #=> 1 - * "cat".method(:squeeze).arity #=> -1 - * "cat".method(:count).arity #=> -1 - */ - -static VALUE -method_arity(method) - VALUE method; -{ - struct METHOD *data; - NODE *body; - int n; - - Data_Get_Struct(method, struct METHOD, data); - - body = data->body; - switch (nd_type(body)) { - case NODE_CFUNC: - if (body->nd_argc < 0) return INT2FIX(-1); - return INT2FIX(body->nd_argc); - case NODE_ZSUPER: - return INT2FIX(-1); - case NODE_ATTRSET: - return INT2FIX(1); - case NODE_IVAR: - return INT2FIX(0); - case NODE_BMETHOD: - return proc_arity(body->nd_cval); - case NODE_DMETHOD: - return method_arity(body->nd_cval); - case NODE_SCOPE: - body = body->nd_next; /* skip NODE_SCOPE */ - if (nd_type(body) == NODE_BLOCK) - body = body->nd_head; - if (!body) return INT2FIX(0); - n = body->nd_cnt; - if (body->nd_opt || body->nd_rest) - n = -n-1; - return INT2FIX(n); - default: - rb_raise(rb_eArgError, "invalid node 0x%x", nd_type(body)); - } -} - -/* - * call-seq: - * meth.to_s => string - * meth.inspect => string - * - * Show the name of the underlying method. - * - * "cat".method(:count).inspect #=> "#" - */ - -static VALUE -method_inspect(method) - VALUE method; -{ - struct METHOD *data; - VALUE str; - const char *s; - char *sharp = "#"; - - Data_Get_Struct(method, struct METHOD, data); - str = rb_str_buf_new2("#<"); - s = rb_obj_classname(method); - rb_str_buf_cat2(str, s); - rb_str_buf_cat2(str, ": "); - - if (FL_TEST(data->klass, FL_SINGLETON)) { - VALUE v = rb_iv_get(data->klass, "__attached__"); - - if (data->recv == Qundef) { - rb_str_buf_append(str, rb_inspect(data->klass)); - } - else if (data->recv == v) { - rb_str_buf_append(str, rb_inspect(v)); - sharp = "."; - } - else { - rb_str_buf_append(str, rb_inspect(data->recv)); - rb_str_buf_cat2(str, "("); - rb_str_buf_append(str, rb_inspect(v)); - rb_str_buf_cat2(str, ")"); - sharp = "."; - } - } - else { - rb_str_buf_cat2(str, rb_class2name(data->rklass)); - if (data->rklass != data->klass) { - VALUE klass = data -> klass; - if (TYPE(klass) == T_ICLASS) { - klass = RBASIC(klass)->klass; - } - rb_str_buf_cat2(str, "("); - rb_str_buf_cat2(str, rb_class2name(klass)); - rb_str_buf_cat2(str, ")"); - } - } - rb_str_buf_cat2(str, sharp); - rb_str_buf_cat2(str, rb_id2name(data->oid)); - rb_str_buf_cat2(str, ">"); - - return str; -} - -static VALUE -mproc(method) - VALUE method; -{ - VALUE proc; - - /* emulate ruby's method call */ - PUSH_ITER(ITER_CUR); - PUSH_FRAME(); - proc = rb_block_proc(); - POP_FRAME(); - POP_ITER(); - - return proc; -} - -static VALUE -bmcall(args, method) - VALUE args, method; -{ - volatile VALUE a; - VALUE ret; - - a = svalue_to_avalue(args); - ret = method_call(RARRAY(a)->len, RARRAY(a)->ptr, method); - a = Qnil; /* prevent tail call */ - return ret; -} - -VALUE -rb_proc_new(func, val) - VALUE (*func)(ANYARGS); /* VALUE yieldarg[, VALUE procarg] */ - VALUE val; -{ - struct BLOCK *data; - VALUE proc = rb_iterate((VALUE(*)_((VALUE)))mproc, 0, func, val); - - Data_Get_Struct(proc, struct BLOCK, data); - data->body->nd_state = YIELD_FUNC_AVALUE; - return proc; -} - -/* - * call-seq: - * meth.to_proc => prc - * - * Returns a Proc object corresponding to this method. - */ - -static VALUE -method_proc(method) - VALUE method; -{ - VALUE proc; - struct METHOD *mdata; - struct BLOCK *bdata; - - proc = rb_iterate((VALUE(*)_((VALUE)))mproc, 0, bmcall, method); - Data_Get_Struct(method, struct METHOD, mdata); - Data_Get_Struct(proc, struct BLOCK, bdata); - bdata->body->nd_file = mdata->body->nd_file; - nd_set_line(bdata->body, nd_line(mdata->body)); - bdata->body->nd_state = YIELD_FUNC_SVALUE; - - return proc; -} - -static VALUE -rb_obj_is_method(m) - VALUE m; -{ - if (TYPE(m) == T_DATA && RDATA(m)->dmark == (RUBY_DATA_FUNC)bm_mark) { - return Qtrue; - } - return Qfalse; -} - -/* - * call-seq: - * define_method(symbol, method) => new_method - * define_method(symbol) { block } => proc - * - * Defines an instance method in the receiver. The _method_ - * parameter can be a +Proc+ or +Method+ object. - * If a block is specified, it is used as the method body. This block - * is evaluated using instance_eval, a point that is - * tricky to demonstrate because define_method is private. - * (This is why we resort to the +send+ hack in this example.) - * - * class A - * def fred - * puts "In Fred" - * end - * def create_method(name, &block) - * self.class.send(:define_method, name, &block) - * end - * define_method(:wilma) { puts "Charge it!" } - * end - * class B < A - * define_method(:barney, instance_method(:fred)) - * end - * a = B.new - * a.barney - * a.wilma - * a.create_method(:betty) { p self } - * a.betty - * - * produces: - * - * In Fred - * Charge it! - * # - */ - -static VALUE -rb_mod_define_method(argc, argv, mod) - int argc; - VALUE *argv; - VALUE mod; -{ - ID id; - VALUE body; - NODE *node; - int noex; - - if (argc == 1) { - id = rb_to_id(argv[0]); - body = proc_lambda(); - } - else if (argc == 2) { - id = rb_to_id(argv[0]); - body = argv[1]; - if (!rb_obj_is_method(body) && !rb_obj_is_proc(body)) { - rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc/Method)", - rb_obj_classname(body)); - } - } - else { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc); - } - if (RDATA(body)->dmark == (RUBY_DATA_FUNC)bm_mark) { - node = NEW_DMETHOD(method_unbind(body)); - } - else if (RDATA(body)->dmark == (RUBY_DATA_FUNC)blk_mark) { - struct BLOCK *block; - - body = proc_clone(body); - Data_Get_Struct(body, struct BLOCK, block); - block->frame.last_func = id; - block->frame.orig_func = id; - block->frame.last_class = mod; - node = NEW_BMETHOD(body); - } - else { - /* type error */ - rb_raise(rb_eTypeError, "wrong argument type (expected Proc/Method)"); - } - - noex = NOEX_PUBLIC; - if (ruby_cbase == mod) { - if (SCOPE_TEST(SCOPE_PRIVATE)) { - noex = NOEX_PRIVATE; - } - else if (SCOPE_TEST(SCOPE_PROTECTED)) { - noex = NOEX_PROTECTED; - } - } - rb_add_method(mod, id, node, noex); - return body; -} - -/* - * Proc objects are blocks of code that have been bound to - * a set of local variables. Once bound, the code may be called in - * different contexts and still access those variables. - * - * def gen_times(factor) - * return Proc.new {|n| n*factor } - * end - * - * times3 = gen_times(3) - * times5 = gen_times(5) - * - * times3.call(12) #=> 36 - * times5.call(5) #=> 25 - * times3.call(times5.call(4)) #=> 60 - * - */ - -void -Init_Proc() -{ - rb_eLocalJumpError = rb_define_class("LocalJumpError", rb_eStandardError); - rb_define_method(rb_eLocalJumpError, "exit_value", localjump_xvalue, 0); - rb_define_method(rb_eLocalJumpError, "reason", localjump_reason, 0); - - rb_global_variable(&exception_error); - exception_error = rb_exc_new3(rb_eFatal, - rb_obj_freeze(rb_str_new2("exception reentered"))); - OBJ_TAINT(exception_error); - OBJ_FREEZE(exception_error); - - rb_eSysStackError = rb_define_class("SystemStackError", rb_eStandardError); - rb_global_variable(&sysstack_error); - sysstack_error = rb_exc_new3(rb_eSysStackError, - rb_obj_freeze(rb_str_new2("stack level too deep"))); - OBJ_TAINT(sysstack_error); - OBJ_FREEZE(sysstack_error); - - rb_cProc = rb_define_class("Proc", rb_cObject); - rb_undef_alloc_func(rb_cProc); - rb_define_singleton_method(rb_cProc, "new", proc_s_new, -1); - - rb_define_method(rb_cProc, "clone", proc_clone, 0); - rb_define_method(rb_cProc, "dup", proc_dup, 0); - rb_define_method(rb_cProc, "call", proc_call, -2); - rb_define_method(rb_cProc, "arity", proc_arity, 0); - rb_define_method(rb_cProc, "[]", proc_call, -2); - rb_define_method(rb_cProc, "==", proc_eq, 1); - rb_define_method(rb_cProc, "to_s", proc_to_s, 0); - rb_define_method(rb_cProc, "to_proc", proc_to_self, 0); - rb_define_method(rb_cProc, "binding", proc_binding, 0); - - rb_define_global_function("proc", proc_lambda, 0); - rb_define_global_function("lambda", proc_lambda, 0); - - rb_cMethod = rb_define_class("Method", rb_cObject); - rb_undef_alloc_func(rb_cMethod); - rb_undef_method(CLASS_OF(rb_cMethod), "new"); - rb_define_method(rb_cMethod, "==", method_eq, 1); - rb_define_method(rb_cMethod, "clone", method_clone, 0); - rb_define_method(rb_cMethod, "call", method_call, -1); - rb_define_method(rb_cMethod, "[]", method_call, -1); - rb_define_method(rb_cMethod, "arity", method_arity, 0); - rb_define_method(rb_cMethod, "inspect", method_inspect, 0); - rb_define_method(rb_cMethod, "to_s", method_inspect, 0); - rb_define_method(rb_cMethod, "to_proc", method_proc, 0); - rb_define_method(rb_cMethod, "unbind", method_unbind, 0); - rb_define_method(rb_mKernel, "method", rb_obj_method, 1); - - rb_cUnboundMethod = rb_define_class("UnboundMethod", rb_cObject); - rb_undef_alloc_func(rb_cUnboundMethod); - rb_undef_method(CLASS_OF(rb_cUnboundMethod), "new"); - rb_define_method(rb_cUnboundMethod, "==", method_eq, 1); - rb_define_method(rb_cUnboundMethod, "clone", method_clone, 0); - rb_define_method(rb_cUnboundMethod, "arity", method_arity, 0); - rb_define_method(rb_cUnboundMethod, "inspect", method_inspect, 0); - rb_define_method(rb_cUnboundMethod, "to_s", method_inspect, 0); - rb_define_method(rb_cUnboundMethod, "bind", umethod_bind, 1); - rb_define_method(rb_cModule, "instance_method", rb_mod_method, 1); -} - -/* - * Objects of class Binding encapsulate the execution - * context at some particular place in the code and retain this context - * for future use. The variables, methods, value of self, - * and possibly an iterator block that can be accessed in this context - * are all retained. Binding objects can be created using - * Kernel#binding, and are made available to the callback - * of Kernel#set_trace_func. - * - * These binding objects can be passed as the second argument of the - * Kernel#eval method, establishing an environment for the - * evaluation. - * - * class Demo - * def initialize(n) - * @secret = n - * end - * def getBinding - * return binding() - * end - * end - * - * k1 = Demo.new(99) - * b1 = k1.getBinding - * k2 = Demo.new(-3) - * b2 = k2.getBinding - * - * eval("@secret", b1) #=> 99 - * eval("@secret", b2) #=> -3 - * eval("@secret") #=> nil - * - * Binding objects have no class-specific methods. - * - */ - -void -Init_Binding() -{ - rb_cBinding = rb_define_class("Binding", rb_cObject); - rb_undef_alloc_func(rb_cBinding); - rb_undef_method(CLASS_OF(rb_cBinding), "new"); - rb_define_method(rb_cBinding, "clone", proc_clone, 0); - rb_define_method(rb_cBinding, "dup", proc_dup, 0); - rb_define_global_function("binding", rb_f_binding, 0); -} - -/* Windows SEH refers data on the stack. */ -#undef SAVE_WIN32_EXCEPTION_LIST -#if defined _WIN32 || defined __CYGWIN__ -#if defined __CYGWIN__ -typedef unsigned long DWORD; -#endif - -static inline DWORD -win32_get_exception_list() -{ - DWORD p; -# if defined _MSC_VER -# ifdef _M_IX86 -# define SAVE_WIN32_EXCEPTION_LIST -# if _MSC_VER >= 1310 - /* warning: unsafe assignment to fs:0 ... this is ok */ -# pragma warning(disable: 4733) -# endif - __asm mov eax, fs:[0]; - __asm mov p, eax; -# endif -# elif defined __GNUC__ -# ifdef __i386__ -# define SAVE_WIN32_EXCEPTION_LIST - __asm__("movl %%fs:0,%0" : "=r"(p)); -# endif -# elif defined __BORLANDC__ -# define SAVE_WIN32_EXCEPTION_LIST - __emit__(0x64, 0xA1, 0, 0, 0, 0); /* mov eax, fs:[0] */ - p = _EAX; -# endif - return p; -} - -static inline void -win32_set_exception_list(p) - DWORD p; -{ -# if defined _MSC_VER -# ifdef _M_IX86 - __asm mov eax, p; - __asm mov fs:[0], eax; -# endif -# elif defined __GNUC__ -# ifdef __i386__ - __asm__("movl %0,%%fs:0" :: "r"(p)); -# endif -# elif defined __BORLANDC__ - _EAX = p; - __emit__(0x64, 0xA3, 0, 0, 0, 0); /* mov fs:[0], eax */ -# endif -} - -#if !defined SAVE_WIN32_EXCEPTION_LIST && !defined _WIN32_WCE -# error unsupported platform -#endif -#endif - -int rb_thread_pending = 0; - -VALUE rb_cThread; - -extern VALUE rb_last_status; - -#define WAIT_FD (1<<0) -#define WAIT_SELECT (1<<1) -#define WAIT_TIME (1<<2) -#define WAIT_JOIN (1<<3) -#define WAIT_PID (1<<4) - -/* +infty, for this purpose */ -#define DELAY_INFTY 1E30 - -#if !defined HAVE_PAUSE -# if defined _WIN32 && !defined __CYGWIN__ -# define pause() Sleep(INFINITE) -# else -# define pause() sleep(0x7fffffff) -# endif -#endif - -#define THREAD_TERMINATING 0x400 /* persistent flag */ -#define THREAD_NO_ENSURE 0x800 /* persistent flag */ -#define THREAD_FLAGS_MASK 0xfc00 /* mask for persistent flags */ - -#define FOREACH_THREAD_FROM(f,x) x = f; do { x = x->next; -#define END_FOREACH_FROM(f,x) } while (x != f) - -#define FOREACH_THREAD(x) FOREACH_THREAD_FROM(curr_thread,x) -#define END_FOREACH(x) END_FOREACH_FROM(curr_thread,x) - -struct thread_status_t { - NODE *node; - - int tracing; - VALUE errinfo; - VALUE last_status; - VALUE last_line; - VALUE last_match; - - int safe; - - enum rb_thread_status status; - int wait_for; - int fd; - fd_set readfds; - fd_set writefds; - fd_set exceptfds; - int select_value; - double delay; - rb_thread_t join; -}; - -#define THREAD_COPY_STATUS(src, dst) (void)( \ - (dst)->node = (src)->node, \ - \ - (dst)->tracing = (src)->tracing, \ - (dst)->errinfo = (src)->errinfo, \ - (dst)->last_status = (src)->last_status, \ - (dst)->last_line = (src)->last_line, \ - (dst)->last_match = (src)->last_match, \ - \ - (dst)->safe = (src)->safe, \ - \ - (dst)->status = (src)->status, \ - (dst)->wait_for = (src)->wait_for, \ - (dst)->fd = (src)->fd, \ - (dst)->readfds = (src)->readfds, \ - (dst)->writefds = (src)->writefds, \ - (dst)->exceptfds = (src)->exceptfds, \ - (dst)->select_value = (src)->select_value, \ - (dst)->delay = (src)->delay, \ - (dst)->join = (src)->join, \ - 0) - -int -rb_thread_set_raised(th) - rb_thread_t th; -{ - if (th->flags & RAISED_EXCEPTION) { - return 1; - } - th->flags |= RAISED_EXCEPTION; - return 0; -} - -int -rb_thread_reset_raised(th) - rb_thread_t th; -{ - if (!(th->flags & RAISED_EXCEPTION)) { - return 0; - } - th->flags &= ~RAISED_EXCEPTION; - return 1; -} - -static int -thread_no_ensure() -{ - return ((curr_thread->flags & THREAD_NO_ENSURE) == THREAD_NO_ENSURE); -} - -static void rb_thread_ready _((rb_thread_t)); - -static VALUE run_trap_eval _((VALUE)); -static VALUE -run_trap_eval(arg) - VALUE arg; -{ - VALUE *p = (VALUE *)arg; - return rb_eval_cmd(p[0], p[1], (int)p[2]); -} - -static VALUE -rb_trap_eval(cmd, sig, safe) - VALUE cmd; - int sig, safe; -{ - int state; - VALUE val = Qnil; /* OK */ - volatile struct thread_status_t save; - VALUE arg[3]; - - arg[0] = cmd; - arg[1] = rb_ary_new3(1, INT2FIX(sig)); - arg[2] = (VALUE)safe; - THREAD_COPY_STATUS(curr_thread, &save); - rb_thread_ready(curr_thread); - PUSH_ITER(ITER_NOT); - val = rb_protect(run_trap_eval, (VALUE)&arg, &state); - POP_ITER(); - THREAD_COPY_STATUS(&save, curr_thread); - - if (state) { - rb_trap_immediate = 0; - rb_thread_ready(curr_thread); - JUMP_TAG(state); - } - - if (curr_thread->status == THREAD_STOPPED) { - rb_thread_schedule(); - } - errno = EINTR; - - return val; -} - -static const char * -thread_status_name(status) - enum rb_thread_status status; -{ - switch (status) { - case THREAD_RUNNABLE: - return "run"; - case THREAD_STOPPED: - return "sleep"; - case THREAD_TO_KILL: - return "aborting"; - case THREAD_KILLED: - return "dead"; - default: - return "unknown"; - } -} - -/* $SAFE accessor */ -void -rb_set_safe_level(level) - int level; -{ - if (level > ruby_safe_level) { - if (level > SAFE_LEVEL_MAX) level = SAFE_LEVEL_MAX; - ruby_safe_level = level; - curr_thread->safe = level; - } -} - -static VALUE -safe_getter() -{ - return INT2NUM(ruby_safe_level); -} - -static void -safe_setter(val) - VALUE val; -{ - int level = NUM2INT(val); - - if (level < ruby_safe_level) { - rb_raise(rb_eSecurityError, "tried to downgrade safe level from %d to %d", - ruby_safe_level, level); - } - if (level > SAFE_LEVEL_MAX) level = SAFE_LEVEL_MAX; - ruby_safe_level = level; - curr_thread->safe = level; -} - -/* Return the current time as a floating-point number */ -static double -timeofday() -{ - struct timeval tv; -#ifdef CLOCK_MONOTONIC - struct timespec tp; - - if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) { - return (double)tp.tv_sec + (double)tp.tv_nsec * 1e-9; - } -#endif - gettimeofday(&tv, NULL); - return (double)tv.tv_sec + (double)tv.tv_usec * 1e-6; -} - -#define STACK(addr) (th->stk_pos<(VALUE*)(addr) && (VALUE*)(addr)stk_pos+th->stk_len) -#define ADJ(addr) (void*)(STACK(addr)?(((VALUE*)(addr)-th->stk_pos)+th->stk_ptr):(VALUE*)(addr)) -static void -thread_mark(th) - rb_thread_t th; -{ - struct FRAME *frame; - struct BLOCK *block; - - rb_gc_mark(th->result); - rb_gc_mark(th->thread); - if (th->join) rb_gc_mark(th->join->thread); - - rb_gc_mark(th->klass); - rb_gc_mark(th->wrapper); - rb_gc_mark((VALUE)th->cref); - - rb_gc_mark((VALUE)th->scope); - rb_gc_mark((VALUE)th->dyna_vars); - rb_gc_mark(th->errinfo); - rb_gc_mark(th->last_status); - rb_gc_mark(th->last_line); - rb_gc_mark(th->last_match); - rb_mark_tbl(th->locals); - rb_gc_mark(th->thgroup); - rb_gc_mark_maybe(th->sandbox); - - /* mark data in copied stack */ - if (th == curr_thread) return; - if (th->status == THREAD_KILLED) return; - if (th->stk_len == 0) return; /* stack not active, no need to mark. */ - if (th->stk_ptr) { - rb_gc_mark_locations(th->stk_ptr, th->stk_ptr+th->stk_len); -#if defined(THINK_C) || defined(__human68k__) - rb_gc_mark_locations(th->stk_ptr+2, th->stk_ptr+th->stk_len+2); -#endif -#ifdef __ia64 - if (th->bstr_ptr) { - rb_gc_mark_locations(th->bstr_ptr, th->bstr_ptr+th->bstr_len); - } -#endif - } - frame = th->frame; - while (frame && frame != top_frame) { - frame = ADJ(frame); - rb_gc_mark_frame(frame); - if (frame->tmp) { - struct FRAME *tmp = frame->tmp; - - while (tmp && tmp != top_frame) { - tmp = ADJ(tmp); - rb_gc_mark_frame(tmp); - tmp = tmp->prev; - } - } - frame = frame->prev; - } - block = th->block; - while (block) { - block = ADJ(block); - rb_gc_mark_frame(&block->frame); - block = block->prev; - } -} - -static int -mark_loading_thread(key, value, lev) - ID key; - VALUE value; - int lev; -{ - rb_gc_mark(((rb_thread_t)value)->thread); - return ST_CONTINUE; -} - -void -rb_gc_mark_threads() -{ - rb_thread_t th; - - /* static global mark */ - rb_gc_mark((VALUE)ruby_cref); - - if (!curr_thread) return; - rb_gc_mark(main_thread->thread); - rb_gc_mark(curr_thread->thread); - FOREACH_THREAD_FROM(main_thread, th) { - switch (th->status) { - case THREAD_TO_KILL: - case THREAD_RUNNABLE: - break; - case THREAD_STOPPED: - if (th->wait_for) break; - default: - continue; - } - rb_gc_mark(th->thread); - } END_FOREACH_FROM(main_thread, th); - if (loading_tbl) st_foreach(loading_tbl, mark_loading_thread, 0); -} - -void -rb_gc_abort_threads() -{ - rb_thread_t th; - - if (!main_thread) - return; - - FOREACH_THREAD_FROM(main_thread, th) { - if (FL_TEST(th->thread, FL_MARK)) continue; - if (th->status == THREAD_STOPPED) { - th->status = THREAD_TO_KILL; - rb_gc_mark(th->thread); - } - } END_FOREACH_FROM(main_thread, th); -} - -static inline void -stack_free(th) - rb_thread_t th; -{ - if (th->stk_ptr) free(th->stk_ptr); - th->stk_ptr = 0; -#ifdef __ia64 - if (th->bstr_ptr) free(th->bstr_ptr); - th->bstr_ptr = 0; -#endif -} - -static void -thread_free(th) - rb_thread_t th; -{ - stack_free(th); - if (th->locals) st_free_table(th->locals); - if (th->status != THREAD_KILLED) { - if (th->prev) th->prev->next = th->next; - if (th->next) th->next->prev = th->prev; - } - if (th != main_thread) free(th); -} - -static rb_thread_t -rb_thread_check(data) - VALUE data; -{ - if (TYPE(data) != T_DATA || RDATA(data)->dmark != (RUBY_DATA_FUNC)thread_mark) { - rb_raise(rb_eTypeError, "wrong argument type %s (expected Thread)", - rb_obj_classname(data)); - } - return (rb_thread_t)RDATA(data)->data; -} - -static VALUE rb_thread_raise _((int, VALUE*, rb_thread_t)); - -static VALUE th_raise_exception; -static NODE *th_raise_node; -static VALUE th_cmd; -static int th_sig, th_safe; - -#define RESTORE_NORMAL 1 -#define RESTORE_FATAL 2 -#define RESTORE_INTERRUPT 3 -#define RESTORE_TRAP 4 -#define RESTORE_RAISE 5 -#define RESTORE_SIGNAL 6 -#define RESTORE_EXIT 7 - -extern VALUE *rb_gc_stack_start; -#ifdef __ia64 -extern VALUE *rb_gc_register_stack_start; -#endif - -static void -rb_thread_save_context(th) - rb_thread_t th; -{ - VALUE *pos; - size_t len; - static VALUE tval; - - len = ruby_stack_length(&pos); - th->stk_len = 0; - th->stk_pos = pos; - if (len > th->stk_max) { - VALUE *ptr = realloc(th->stk_ptr, sizeof(VALUE) * len); - if (!ptr) rb_memerror(); - th->stk_ptr = ptr; - th->stk_max = len; - } - th->stk_len = len; - FLUSH_REGISTER_WINDOWS; - MEMCPY(th->stk_ptr, th->stk_pos, VALUE, th->stk_len); -#ifdef __ia64 - th->bstr_pos = rb_gc_register_stack_start; - len = (VALUE*)rb_ia64_bsp() - th->bstr_pos; - th->bstr_len = 0; - if (len > th->bstr_max) { - VALUE *ptr = realloc(th->bstr_ptr, sizeof(VALUE) * len); - if (!ptr) rb_memerror(); - th->bstr_ptr = ptr; - th->bstr_max = len; - } - th->bstr_len = len; - rb_ia64_flushrs(); - MEMCPY(th->bstr_ptr, th->bstr_pos, VALUE, th->bstr_len); -#endif -#ifdef SAVE_WIN32_EXCEPTION_LIST - th->win32_exception_list = win32_get_exception_list(); -#endif - - th->frame = ruby_frame; - th->scope = ruby_scope; - ruby_scope->flags |= SCOPE_DONT_RECYCLE; - th->klass = ruby_class; - th->wrapper = ruby_wrapper; - th->cref = ruby_cref; - th->dyna_vars = ruby_dyna_vars; - th->block = ruby_block; - th->flags &= THREAD_FLAGS_MASK; - th->flags |= (rb_trap_immediate<<8) | scope_vmode; - th->iter = ruby_iter; - th->tag = prot_tag; - th->tracing = tracing; - th->errinfo = ruby_errinfo; - th->last_status = rb_last_status; - tval = rb_lastline_get(); - rb_lastline_set(th->last_line); - th->last_line = tval; - tval = rb_backref_get(); - rb_backref_set(th->last_match); - th->last_match = tval; - th->safe = ruby_safe_level; - - th->node = ruby_current_node; - if (ruby_sandbox_save != NULL) { - ruby_sandbox_save(th); - } -} - -static int -rb_thread_switch(n) - int n; -{ - rb_trap_immediate = (curr_thread->flags&0x100)?1:0; - switch (n) { - case 0: - return 0; - case RESTORE_FATAL: - JUMP_TAG(TAG_FATAL); - break; - case RESTORE_INTERRUPT: - rb_interrupt(); - break; - case RESTORE_TRAP: - rb_trap_eval(th_cmd, th_sig, th_safe); - break; - case RESTORE_RAISE: - ruby_frame->last_func = 0; - ruby_current_node = th_raise_node; - rb_raise_jump(th_raise_exception); - break; - case RESTORE_SIGNAL: - rb_thread_signal_raise(th_sig); - break; - case RESTORE_EXIT: - ruby_errinfo = th_raise_exception; - ruby_current_node = th_raise_node; - if (!rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) { - terminate_process(EXIT_FAILURE, ruby_errinfo); - } - rb_exc_raise(th_raise_exception); - break; - case RESTORE_NORMAL: - default: - break; - } - return 1; -} - -#define THREAD_SAVE_CONTEXT(th) \ - (rb_thread_switch((FLUSH_REGISTER_WINDOWS, ruby_setjmp(rb_thread_save_context(th), (th)->context)))) - -NORETURN(static void rb_thread_restore_context _((rb_thread_t,int))); -NORETURN(NOINLINE(static void rb_thread_restore_context_0(rb_thread_t,int))); -NORETURN(NOINLINE(static void stack_extend(rb_thread_t, int))); - -static void -rb_thread_restore_context_0(rb_thread_t th, int exit) -{ - static rb_thread_t tmp; - static int ex; - static VALUE tval; - - rb_trap_immediate = 0; /* inhibit interrupts from here */ - if (ruby_sandbox_restore != NULL) { - ruby_sandbox_restore(th); - } - ruby_frame = th->frame; - ruby_scope = th->scope; - ruby_class = th->klass; - ruby_wrapper = th->wrapper; - ruby_cref = th->cref; - ruby_dyna_vars = th->dyna_vars; - ruby_block = th->block; - scope_vmode = th->flags&SCOPE_MASK; - ruby_iter = th->iter; - prot_tag = th->tag; - tracing = th->tracing; - ruby_errinfo = th->errinfo; - rb_last_status = th->last_status; - ruby_safe_level = th->safe; - - ruby_current_node = th->node; - -#ifdef SAVE_WIN32_EXCEPTION_LIST - win32_set_exception_list(th->win32_exception_list); -#endif - tmp = th; - ex = exit; - FLUSH_REGISTER_WINDOWS; - MEMCPY(tmp->stk_pos, tmp->stk_ptr, VALUE, tmp->stk_len); -#ifdef __ia64 - MEMCPY(tmp->bstr_pos, tmp->bstr_ptr, VALUE, tmp->bstr_len); -#endif - - tval = rb_lastline_get(); - rb_lastline_set(tmp->last_line); - tmp->last_line = tval; - tval = rb_backref_get(); - rb_backref_set(tmp->last_match); - tmp->last_match = tval; - - ruby_longjmp(tmp->context, ex); -} - -#ifdef __ia64 -#define C(a) rse_##a##0, rse_##a##1, rse_##a##2, rse_##a##3, rse_##a##4 -#define E(a) rse_##a##0= rse_##a##1= rse_##a##2= rse_##a##3= rse_##a##4 -static volatile int C(a), C(b), C(c), C(d), C(e); -static volatile int C(f), C(g), C(h), C(i), C(j); -static volatile int C(k), C(l), C(m), C(n), C(o); -static volatile int C(p), C(q), C(r), C(s), C(t); -int rb_dummy_false = 0; -NORETURN(NOINLINE(static void register_stack_extend(rb_thread_t, int, VALUE *))); -static void -register_stack_extend(rb_thread_t th, int exit, VALUE *curr_bsp) -{ - if (rb_dummy_false) { - /* use registers as much as possible */ - E(a) = E(b) = E(c) = E(d) = E(e) = - E(f) = E(g) = E(h) = E(i) = E(j) = - E(k) = E(l) = E(m) = E(n) = E(o) = - E(p) = E(q) = E(r) = E(s) = E(t) = 0; - E(a) = E(b) = E(c) = E(d) = E(e) = - E(f) = E(g) = E(h) = E(i) = E(j) = - E(k) = E(l) = E(m) = E(n) = E(o) = - E(p) = E(q) = E(r) = E(s) = E(t) = 0; - } - if (curr_bsp < th->bstr_pos+th->bstr_len) { - register_stack_extend(th, exit, (VALUE*)rb_ia64_bsp()); - } - stack_extend(th, exit); -} -#undef C -#undef E -#endif - -static void -stack_extend(rb_thread_t th, int exit) -{ -#define STACK_PAD_SIZE 1024 - volatile VALUE space[STACK_PAD_SIZE], *sp = space; - -#if !STACK_GROW_DIRECTION - if (space < rb_gc_stack_start) { - /* Stack grows downward */ -#endif -#if STACK_GROW_DIRECTION <= 0 - if (space > th->stk_pos) { -# ifdef HAVE_ALLOCA - sp = ALLOCA_N(VALUE, &space[0] - th->stk_pos); -# else - stack_extend(th, exit); -# endif - } -#endif -#if !STACK_GROW_DIRECTION - } - else { - /* Stack grows upward */ -#endif -#if STACK_GROW_DIRECTION >= 0 - if (&space[STACK_PAD_SIZE] < th->stk_pos + th->stk_len) { -# ifdef HAVE_ALLOCA - sp = ALLOCA_N(VALUE, th->stk_pos + th->stk_len - &space[STACK_PAD_SIZE]); -# else - stack_extend(th, exit); -# endif - } -#endif -#if !STACK_GROW_DIRECTION - } -#endif - rb_thread_restore_context_0(th, exit); -} -#ifdef __ia64 -#define stack_extend(th, exit) register_stack_extend(th, exit, (VALUE*)rb_ia64_bsp()) -#endif - -static void -rb_thread_restore_context(th, exit) - rb_thread_t th; - int exit; -{ - if (!th->stk_ptr) rb_bug("unsaved context"); - stack_extend(th, exit); -} - -static void -rb_thread_ready(th) - rb_thread_t th; -{ - th->wait_for = 0; - if (th->status != THREAD_TO_KILL) { - th->status = THREAD_RUNNABLE; - } -} - -static void -rb_thread_die(th) - rb_thread_t th; -{ - th->thgroup = 0; - th->status = THREAD_KILLED; - stack_free(th); -} - -static void -rb_thread_remove(th) - rb_thread_t th; -{ - if (th->status == THREAD_KILLED) return; - - rb_thread_ready(th); - rb_thread_die(th); - th->prev->next = th->next; - th->next->prev = th->prev; -} - -static int -rb_thread_dead(th) - rb_thread_t th; -{ - return th->status == THREAD_KILLED; -} - -void -rb_thread_fd_close(fd) - int fd; -{ - rb_thread_t th; - - FOREACH_THREAD(th) { - if (((th->wait_for & WAIT_FD) && fd == th->fd) || - ((th->wait_for & WAIT_SELECT) && (fd < th->fd) && - (FD_ISSET(fd, &th->readfds) || - FD_ISSET(fd, &th->writefds) || - FD_ISSET(fd, &th->exceptfds)))) { - VALUE exc = rb_exc_new2(rb_eIOError, "stream closed"); - rb_thread_raise(1, &exc, th); - } - } - END_FOREACH(th); -} - -NORETURN(static void rb_thread_main_jump _((VALUE, int))); -static void -rb_thread_main_jump(err, tag) - VALUE err; - int tag; -{ - curr_thread = main_thread; - th_raise_exception = err; - th_raise_node = ruby_current_node; - rb_thread_restore_context(main_thread, tag); -} - -NORETURN(static void rb_thread_deadlock _((void))); -static void -rb_thread_deadlock() -{ - char msg[21+SIZEOF_LONG*2]; - VALUE e; - - sprintf(msg, "Thread(0x%lx): deadlock", curr_thread->thread); - e = rb_exc_new2(rb_eFatal, msg); - if (curr_thread == main_thread) { - rb_exc_raise(e); - } - rb_thread_main_jump(e, RESTORE_RAISE); -} - -static void -copy_fds(dst, src, max) - fd_set *dst, *src; - int max; -{ - int n = 0; - int i; - - for (i=0; i<=max; i++) { - if (FD_ISSET(i, src)) { - n = i; - FD_SET(i, dst); - } - } -} - -static int -match_fds(dst, src, max) - fd_set *dst, *src; - int max; -{ - int i; - - for (i=0; i<=max; i++) { - if (FD_ISSET(i, src) && FD_ISSET(i, dst)) { - return Qtrue; - } - } - return Qfalse; -} - -static int -intersect_fds(src, dst, max) - fd_set *src, *dst; - int max; -{ - int i, n = 0; - - for (i=0; i<=max; i++) { - if (FD_ISSET(i, dst)) { - if (FD_ISSET(i, src)) { - /* Wake up only one thread per fd. */ - FD_CLR(i, src); - n++; - } - else { - FD_CLR(i, dst); - } - } - } - return n; -} - -static int -find_bad_fds(dst, src, max) - fd_set *dst, *src; - int max; -{ - int i, test = Qfalse; - - for (i=0; i<=max; i++) { - if (FD_ISSET(i, src) && !FD_ISSET(i, dst)) { - FD_CLR(i, src); - test = Qtrue; - } - } - return test; -} - -void -rb_thread_schedule() -{ - rb_thread_t next; /* OK */ - rb_thread_t th; - rb_thread_t curr; - rb_thread_t th_found = 0; - int found = 0; - - fd_set readfds; - fd_set writefds; - fd_set exceptfds; - struct timeval delay_tv, *delay_ptr; - double delay, now; /* OK */ - int n, max; - int need_select = 0; - int select_timeout = 0; - -#ifdef HAVE_NATIVETHREAD - if (!is_ruby_native_thread()) { - rb_bug("cross-thread violation on rb_thread_schedule()"); - } -#endif - rb_thread_pending = 0; - rb_gc_finalize_deferred(); - if (curr_thread == curr_thread->next - && curr_thread->status == THREAD_RUNNABLE) - return; - - next = 0; - curr = curr_thread; /* starting thread */ - - while (curr->status == THREAD_KILLED) { - curr = curr->prev; - } - - again: - max = -1; - FD_ZERO(&readfds); - FD_ZERO(&writefds); - FD_ZERO(&exceptfds); - delay = DELAY_INFTY; - now = -1.0; - - FOREACH_THREAD_FROM(curr, th) { - if (!found && th->status <= THREAD_RUNNABLE) { - found = 1; - } - if (th->status != THREAD_STOPPED) continue; - if (th->wait_for & WAIT_JOIN) { - if (rb_thread_dead(th->join)) { - th->status = THREAD_RUNNABLE; - found = 1; - } - } - if (th->wait_for & WAIT_FD) { - FD_SET(th->fd, &readfds); - if (max < th->fd) max = th->fd; - need_select = 1; - } - if (th->wait_for & WAIT_SELECT) { - copy_fds(&readfds, &th->readfds, th->fd); - copy_fds(&writefds, &th->writefds, th->fd); - copy_fds(&exceptfds, &th->exceptfds, th->fd); - if (max < th->fd) max = th->fd; - need_select = 1; - if (th->wait_for & WAIT_TIME) { - select_timeout = 1; - } - th->select_value = 0; - } - if (th->wait_for & WAIT_TIME) { - double th_delay; - - if (now < 0.0) now = timeofday(); - th_delay = th->delay - now; - if (th_delay <= 0.0) { - th->status = THREAD_RUNNABLE; - found = 1; - } - else if (th_delay < delay) { - delay = th_delay; - need_select = 1; - } - else if (th->delay == DELAY_INFTY) { - need_select = 1; - } - } - } - END_FOREACH_FROM(curr, th); - - /* Do the select if needed */ - if (need_select) { - /* Convert delay to a timeval */ - /* If a thread is runnable, just poll */ - if (found) { - delay_tv.tv_sec = 0; - delay_tv.tv_usec = 0; - delay_ptr = &delay_tv; - } - else if (delay == DELAY_INFTY) { - delay_ptr = 0; - } - else { - delay_tv.tv_sec = delay; - delay_tv.tv_usec = (delay - (double)delay_tv.tv_sec)*1e6; - delay_ptr = &delay_tv; - } - - n = select(max+1, &readfds, &writefds, &exceptfds, delay_ptr); - if (n < 0) { - int e = errno; - - if (rb_trap_pending) rb_trap_exec(); - if (e == EINTR) goto again; -#ifdef ERESTART - if (e == ERESTART) goto again; -#endif - if (e == EBADF) { - int badfd = -1; - int fd; - int dummy; - for (fd = 0; fd <= max; fd++) { - if ((FD_ISSET(fd, &readfds) || - FD_ISSET(fd, &writefds) || - FD_ISSET(fd, &exceptfds)) && - fcntl(fd, F_GETFD, &dummy) == -1 && - errno == EBADF) { - badfd = fd; - break; - } - } - if (badfd != -1) { - FOREACH_THREAD_FROM(curr, th) { - if (th->wait_for & WAIT_FD) { - if (th->fd == badfd) { - found = 1; - th->status = THREAD_RUNNABLE; - th->fd = 0; - break; - } - } - if (th->wait_for & WAIT_SELECT) { - if (FD_ISSET(badfd, &th->readfds) || - FD_ISSET(badfd, &th->writefds) || - FD_ISSET(badfd, &th->exceptfds)) { - found = 1; - th->status = THREAD_RUNNABLE; - th->select_value = -EBADF; - break; - } - } - } - END_FOREACH_FROM(curr, th); - } - } - else { - FOREACH_THREAD_FROM(curr, th) { - if (th->wait_for & WAIT_SELECT) { - int v = 0; - - v |= find_bad_fds(&readfds, &th->readfds, th->fd); - v |= find_bad_fds(&writefds, &th->writefds, th->fd); - v |= find_bad_fds(&exceptfds, &th->exceptfds, th->fd); - if (v) { - th->select_value = n; - n = max; - } - } - } - END_FOREACH_FROM(curr, th); - } - } - if (select_timeout && n == 0) { - if (now < 0.0) now = timeofday(); - FOREACH_THREAD_FROM(curr, th) { - if (((th->wait_for&(WAIT_SELECT|WAIT_TIME)) == (WAIT_SELECT|WAIT_TIME)) && - th->delay <= now) { - th->status = THREAD_RUNNABLE; - th->wait_for = 0; - th->select_value = 0; - found = 1; - intersect_fds(&readfds, &th->readfds, max); - intersect_fds(&writefds, &th->writefds, max); - intersect_fds(&exceptfds, &th->exceptfds, max); - } - } - END_FOREACH_FROM(curr, th); - } - if (n > 0) { - now = -1.0; - /* Some descriptors are ready. - * Choose a thread which may run next. - * Don't change the status of threads which don't run next. - */ - FOREACH_THREAD_FROM(curr, th) { - if ((th->wait_for&WAIT_FD) && FD_ISSET(th->fd, &readfds)) { - th_found = th; - found = 1; - break; - } - if ((th->wait_for&WAIT_SELECT) && - (match_fds(&readfds, &th->readfds, max) || - match_fds(&writefds, &th->writefds, max) || - match_fds(&exceptfds, &th->exceptfds, max))) { - th_found = th; - found = 1; - break; - } - } - END_FOREACH_FROM(curr, th); - } - /* The delays for some of the threads should have expired. - Go through the loop once more, to check the delays. */ - if (!found && delay != DELAY_INFTY) - goto again; - } - - FOREACH_THREAD_FROM(curr, th) { - if (th->status == THREAD_TO_KILL) { - next = th; - break; - } - if ((th->status == THREAD_RUNNABLE || th == th_found) && th->stk_ptr) { - if (!next || next->priority < th->priority) { - if (th == th_found) { - th_found->status = THREAD_RUNNABLE; - th_found->wait_for = 0; - if (th->wait_for&WAIT_FD) { - th_found->fd = 0; - } - else { /* th->wait_for&WAIT_SELECT */ - n = intersect_fds(&readfds, &th_found->readfds, max) + - intersect_fds(&writefds, &th_found->writefds, max) + - intersect_fds(&exceptfds, &th_found->exceptfds, max); - th_found->select_value = n; - } - } - next = th; - } - } - } - END_FOREACH_FROM(curr, th); - - if (!next) { - /* raise fatal error to main thread */ - curr_thread->node = ruby_current_node; - if (curr->next == curr) { - TRAP_BEG; - pause(); - TRAP_END; - } - FOREACH_THREAD_FROM(curr, th) { - warn_printf("deadlock 0x%lx: %s:", - th->thread, thread_status_name(th->status)); - if (th->wait_for & WAIT_FD) warn_printf("F(%d)", th->fd); - if (th->wait_for & WAIT_SELECT) warn_printf("S"); - if (th->wait_for & WAIT_TIME) warn_printf("T(%f)", th->delay); - if (th->wait_for & WAIT_JOIN) - warn_printf("J(0x%lx)", th->join ? th->join->thread : 0); - if (th->wait_for & WAIT_PID) warn_printf("P"); - if (!th->wait_for) warn_printf("-"); - warn_printf(" %s - %s:%d\n", - th==main_thread ? "(main)" : "", - th->node->nd_file, nd_line(th->node)); - } - END_FOREACH_FROM(curr, th); - next = main_thread; - rb_thread_ready(next); - next->status = THREAD_TO_KILL; - if (!rb_thread_dead(curr_thread)) { - rb_thread_save_context(curr_thread); - } - rb_thread_deadlock(); - } - next->wait_for = 0; - if (next->status == THREAD_RUNNABLE && next == curr_thread) { - return; - } - - /* context switch */ - if (curr == curr_thread) { - if (THREAD_SAVE_CONTEXT(curr)) { - return; - } - } - - curr_thread = next; - if (next->status == THREAD_TO_KILL) { - if (!(next->flags & THREAD_TERMINATING)) { - next->flags |= THREAD_TERMINATING; - /* terminate; execute ensure-clause if any */ - rb_thread_restore_context(next, RESTORE_FATAL); - } - } - rb_thread_restore_context(next, RESTORE_NORMAL); -} - -void -rb_thread_wait_fd(fd) - int fd; -{ - if (rb_thread_critical) return; - if (ruby_in_compile) return; - if (curr_thread == curr_thread->next) return; - if (curr_thread->status == THREAD_TO_KILL) return; - - curr_thread->status = THREAD_STOPPED; - curr_thread->fd = fd; - curr_thread->wait_for = WAIT_FD; - rb_thread_schedule(); -} - -int -rb_thread_fd_writable(fd) - int fd; -{ - if (rb_thread_critical) return Qtrue; - if (curr_thread == curr_thread->next) return Qtrue; - if (curr_thread->status == THREAD_TO_KILL) return Qtrue; - if (curr_thread->status == THREAD_KILLED) return Qtrue; - - curr_thread->status = THREAD_STOPPED; - FD_ZERO(&curr_thread->readfds); - FD_ZERO(&curr_thread->writefds); - FD_SET(fd, &curr_thread->writefds); - FD_ZERO(&curr_thread->exceptfds); - curr_thread->fd = fd+1; - curr_thread->wait_for = WAIT_SELECT; - rb_thread_schedule(); - return Qfalse; -} - -void -rb_thread_wait_for(time) - struct timeval time; -{ - double date; - - if (rb_thread_critical || - curr_thread == curr_thread->next || - curr_thread->status == THREAD_TO_KILL) { - int n; - int thr_critical = rb_thread_critical; -#ifndef linux - double d, limit; - limit = timeofday()+(double)time.tv_sec+(double)time.tv_usec*1e-6; -#endif - for (;;) { - rb_thread_critical = Qtrue; - TRAP_BEG; - n = select(0, 0, 0, 0, &time); - rb_thread_critical = thr_critical; - TRAP_END; - if (n == 0) return; - if (n < 0) { - switch (errno) { - case EINTR: -#ifdef ERESTART - case ERESTART: -#endif - break; - default: - rb_sys_fail("sleep"); - } - } -#ifndef linux - d = limit - timeofday(); - - time.tv_sec = (int)d; - time.tv_usec = (int)((d - (int)d)*1e6); - if (time.tv_usec < 0) { - time.tv_usec += (long)1e6; - time.tv_sec -= 1; - } - if (time.tv_sec < 0) return; -#endif - } - } - - date = timeofday() + (double)time.tv_sec + (double)time.tv_usec*1e-6; - curr_thread->status = THREAD_STOPPED; - curr_thread->delay = date; - curr_thread->wait_for = WAIT_TIME; - rb_thread_schedule(); -} - -void rb_thread_sleep_forever _((void)); - -int -rb_thread_alone() -{ - return curr_thread == curr_thread->next; -} - -int -rb_thread_select(max, read, write, except, timeout) - int max; - fd_set *read, *write, *except; - struct timeval *timeout; -{ -#ifndef linux - double limit; -#endif - int n; - - if (!read && !write && !except) { - if (!timeout) { - rb_thread_sleep_forever(); - return 0; - } - rb_thread_wait_for(*timeout); - return 0; - } - -#ifndef linux - if (timeout) { - limit = timeofday()+ - (double)timeout->tv_sec+(double)timeout->tv_usec*1e-6; - } -#endif - - if (rb_thread_critical || - curr_thread == curr_thread->next || - curr_thread->status == THREAD_TO_KILL) { -#ifndef linux - struct timeval tv, *tvp = timeout; - - if (timeout) { - tv = *timeout; - tvp = &tv; - } -#else - struct timeval *const tvp = timeout; -#endif - for (;;) { - TRAP_BEG; - n = select(max, read, write, except, tvp); - TRAP_END; - if (n < 0) { - switch (errno) { - case EINTR: -#ifdef ERESTART - case ERESTART: -#endif -#ifndef linux - if (timeout) { - double d = limit - timeofday(); - - tv.tv_sec = (unsigned int)d; - tv.tv_usec = (long)((d-(double)tv.tv_sec)*1e6); - if (tv.tv_sec < 0) tv.tv_sec = 0; - if (tv.tv_usec < 0) tv.tv_usec = 0; - } -#endif - continue; - default: - break; - } - } - return n; - } - } - - curr_thread->status = THREAD_STOPPED; - if (read) curr_thread->readfds = *read; - else FD_ZERO(&curr_thread->readfds); - if (write) curr_thread->writefds = *write; - else FD_ZERO(&curr_thread->writefds); - if (except) curr_thread->exceptfds = *except; - else FD_ZERO(&curr_thread->exceptfds); - curr_thread->fd = max; - curr_thread->wait_for = WAIT_SELECT; - if (timeout) { - curr_thread->delay = timeofday() + - (double)timeout->tv_sec + (double)timeout->tv_usec*1e-6; - curr_thread->wait_for |= WAIT_TIME; - } - rb_thread_schedule(); - if (read) *read = curr_thread->readfds; - if (write) *write = curr_thread->writefds; - if (except) *except = curr_thread->exceptfds; - if (curr_thread->select_value < 0) { - errno = -curr_thread->select_value; - return -1; - } - return curr_thread->select_value; -} - -static int rb_thread_join0 _((rb_thread_t, double)); -int rb_thread_join _((VALUE, double)); - -static int -rb_thread_join0(th, limit) - rb_thread_t th; - double limit; -{ - enum rb_thread_status last_status = THREAD_RUNNABLE; - - if (rb_thread_critical) rb_thread_deadlock(); - if (!rb_thread_dead(th)) { - if (th == curr_thread) - rb_raise(rb_eThreadError, "thread 0x%lx tried to join itself", - th->thread); - if ((th->wait_for & WAIT_JOIN) && th->join == curr_thread) - rb_raise(rb_eThreadError, "Thread#join: deadlock 0x%lx - mutual join(0x%lx)", - curr_thread->thread, th->thread); - if (curr_thread->status == THREAD_TO_KILL) - last_status = THREAD_TO_KILL; - if (limit == 0) return Qfalse; - curr_thread->status = THREAD_STOPPED; - curr_thread->join = th; - curr_thread->wait_for = WAIT_JOIN; - curr_thread->delay = timeofday() + limit; - if (limit < DELAY_INFTY) curr_thread->wait_for |= WAIT_TIME; - rb_thread_schedule(); - curr_thread->status = last_status; - if (!rb_thread_dead(th)) return Qfalse; - } - - if (!NIL_P(th->errinfo) && (th->flags & RAISED_EXCEPTION)) { - VALUE oldbt = get_backtrace(th->errinfo); - VALUE errat = make_backtrace(); - VALUE errinfo = rb_obj_dup(th->errinfo); - - if (TYPE(oldbt) == T_ARRAY && RARRAY(oldbt)->len > 0) { - rb_ary_unshift(errat, rb_ary_entry(oldbt, 0)); - } - set_backtrace(errinfo, errat); - rb_exc_raise(errinfo); - } - - return Qtrue; -} - -int -rb_thread_join(thread, limit) - VALUE thread; - double limit; -{ - if (limit < 0) limit = DELAY_INFTY; - return rb_thread_join0(rb_thread_check(thread), limit); -} - - -/* - * call-seq: - * thr.join => thr - * thr.join(limit) => thr - * - * The calling thread will suspend execution and run thr. Does not - * return until thr exits or until limit seconds have passed. If - * the time limit expires, nil will be returned, otherwise - * thr is returned. - * - * Any threads not joined will be killed when the main program exits. If - * thr had previously raised an exception and the - * abort_on_exception and $DEBUG flags are not set - * (so the exception has not yet been processed) it will be processed at this - * time. - * - * a = Thread.new { print "a"; sleep(10); print "b"; print "c" } - * x = Thread.new { print "x"; Thread.pass; print "y"; print "z" } - * x.join # Let x thread finish, a will be killed on exit. - * - * produces: - * - * axyz - * - * The following example illustrates the limit parameter. - * - * y = Thread.new { 4.times { sleep 0.1; puts 'tick... ' }} - * puts "Waiting" until y.join(0.15) - * - * produces: - * - * tick... - * Waiting - * tick... - * Waitingtick... - * - * - * tick... - */ - -static VALUE -rb_thread_join_m(argc, argv, thread) - int argc; - VALUE *argv; - VALUE thread; -{ - VALUE limit; - double delay = DELAY_INFTY; - - rb_scan_args(argc, argv, "01", &limit); - if (!NIL_P(limit)) delay = rb_num2dbl(limit); - if (!rb_thread_join0(rb_thread_check(thread), delay)) - return Qnil; - return thread; -} - - -/* - * call-seq: - * Thread.current => thread - * - * Returns the currently executing thread. - * - * Thread.current #=> # - */ - -VALUE -rb_thread_current() -{ - return curr_thread->thread; -} - - -/* - * call-seq: - * Thread.main => thread - * - * Returns the main thread for the process. - * - * Thread.main #=> # - */ - -VALUE -rb_thread_main() -{ - return main_thread->thread; -} - - -/* - * call-seq: - * Thread.list => array - * - * Returns an array of Thread objects for all threads that are - * either runnable or stopped. - * - * Thread.new { sleep(200) } - * Thread.new { 1000000.times {|i| i*i } } - * Thread.new { Thread.stop } - * Thread.list.each {|t| p t} - * - * produces: - * - * # - * # - * # - * # - */ - -VALUE -rb_thread_list() -{ - rb_thread_t th; - VALUE ary = rb_ary_new(); - - FOREACH_THREAD(th) { - switch (th->status) { - case THREAD_RUNNABLE: - case THREAD_STOPPED: - case THREAD_TO_KILL: - rb_ary_push(ary, th->thread); - default: - break; - } - } - END_FOREACH(th); - - return ary; -} - - -/* - * call-seq: - * thr.wakeup => thr - * - * Marks thr as eligible for scheduling (it may still remain blocked on - * I/O, however). Does not invoke the scheduler (see Thread#run). - * - * c = Thread.new { Thread.stop; puts "hey!" } - * c.wakeup - * - * produces: - * - * hey! - */ - -VALUE -rb_thread_wakeup(thread) - VALUE thread; -{ - if (!RTEST(rb_thread_wakeup_alive(thread))) - rb_raise(rb_eThreadError, "killed thread"); - return thread; -} - -VALUE -rb_thread_wakeup_alive(thread) - VALUE thread; -{ - rb_thread_t th = rb_thread_check(thread); - - if (th->status == THREAD_KILLED) - return Qnil; - rb_thread_ready(th); - - return thread; -} - - -/* - * call-seq: - * thr.run => thr - * - * Wakes up thr, making it eligible for scheduling. If not in a critical - * section, then invokes the scheduler. - * - * a = Thread.new { puts "a"; Thread.stop; puts "c" } - * Thread.pass - * puts "Got here" - * a.run - * a.join - * - * produces: - * - * a - * Got here - * c - */ - -VALUE -rb_thread_run(thread) - VALUE thread; -{ - rb_thread_wakeup(thread); - if (!rb_thread_critical) rb_thread_schedule(); - - return thread; -} - - -static void -rb_kill_thread(th, flags) - rb_thread_t th; - int flags; -{ - if (th != curr_thread && th->safe < 4) { - rb_secure(4); - } - if (th->status == THREAD_TO_KILL || th->status == THREAD_KILLED) - return; - if (th == th->next || th == main_thread) rb_exit(EXIT_SUCCESS); - - rb_thread_ready(th); - th->flags |= flags; - th->status = THREAD_TO_KILL; - if (!rb_thread_critical) rb_thread_schedule(); -} - - -/* - * call-seq: - * thr.exit => thr - * thr.kill => thr - * thr.terminate => thr - * - * Terminates thr and schedules another thread to be run, returning - * the terminated Thread. If this is the main thread, or the - * last thread, exits the process. - */ - -VALUE -rb_thread_kill(thread) - VALUE thread; -{ - rb_thread_t th = rb_thread_check(thread); - - rb_kill_thread(th, 0); - return thread; -} - - -/* - * call-seq: - * thr.exit! => thr - * thr.kill! => thr - * thr.terminate! => thr - * - * Terminates thr without calling ensure clauses and schedules - * another thread to be run, returning the terminated Thread. - * If this is the main thread, or the last thread, exits the process. - * - * See Thread#exit for the safer version. - */ - -static VALUE -rb_thread_kill_bang(thread) - VALUE thread; -{ - rb_thread_t th = rb_thread_check(thread); - rb_kill_thread(th, THREAD_NO_ENSURE); - return thread; -} - -/* - * call-seq: - * Thread.kill(thread) => thread - * - * Causes the given thread to exit (see Thread::exit). - * - * count = 0 - * a = Thread.new { loop { count += 1 } } - * sleep(0.1) #=> 0 - * Thread.kill(a) #=> # - * count #=> 93947 - * a.alive? #=> false - */ - -static VALUE -rb_thread_s_kill(obj, th) - VALUE obj, th; -{ - return rb_thread_kill(th); -} - - -/* - * call-seq: - * Thread.exit => thread - * - * Terminates the currently running thread and schedules another thread to be - * run. If this thread is already marked to be killed, exit - * returns the Thread. If this is the main thread, or the last - * thread, exit the process. - */ - -static VALUE -rb_thread_exit() -{ - return rb_thread_kill(curr_thread->thread); -} - - -/* - * call-seq: - * Thread.pass => nil - * - * Invokes the thread scheduler to pass execution to another thread. - * - * a = Thread.new { print "a"; Thread.pass; - * print "b"; Thread.pass; - * print "c" } - * b = Thread.new { print "x"; Thread.pass; - * print "y"; Thread.pass; - * print "z" } - * a.join - * b.join - * - * produces: - * - * axbycz - */ - -static VALUE -rb_thread_pass() -{ - rb_thread_schedule(); - return Qnil; -} - - -/* - * call-seq: - * Thread.stop => nil - * - * Stops execution of the current thread, putting it into a ``sleep'' state, - * and schedules execution of another thread. Resets the ``critical'' condition - * to false. - * - * a = Thread.new { print "a"; Thread.stop; print "c" } - * Thread.pass - * print "b" - * a.run - * a.join - * - * produces: - * - * abc - */ - -VALUE -rb_thread_stop() -{ - enum rb_thread_status last_status = THREAD_RUNNABLE; - - rb_thread_critical = 0; - if (curr_thread == curr_thread->next) { - rb_raise(rb_eThreadError, "stopping only thread\n\tnote: use sleep to stop forever"); - } - if (curr_thread->status == THREAD_TO_KILL) - last_status = THREAD_TO_KILL; - curr_thread->status = THREAD_STOPPED; - rb_thread_schedule(); - curr_thread->status = last_status; - - return Qnil; -} - -struct timeval rb_time_timeval(); - -void -rb_thread_polling() -{ - if (curr_thread != curr_thread->next) { - curr_thread->status = THREAD_STOPPED; - curr_thread->delay = timeofday() + (double)0.06; - curr_thread->wait_for = WAIT_TIME; - rb_thread_schedule(); - } -} - -void -rb_thread_sleep(sec) - int sec; -{ - if (curr_thread == curr_thread->next) { - TRAP_BEG; - sleep(sec); - TRAP_END; - return; - } - rb_thread_wait_for(rb_time_timeval(INT2FIX(sec))); -} - -void -rb_thread_sleep_forever() -{ - int thr_critical = rb_thread_critical; - if (curr_thread == curr_thread->next || - curr_thread->status == THREAD_TO_KILL) { - rb_thread_critical = Qtrue; - TRAP_BEG; - pause(); - rb_thread_critical = thr_critical; - TRAP_END; - return; - } - - curr_thread->delay = DELAY_INFTY; - curr_thread->wait_for = WAIT_TIME; - curr_thread->status = THREAD_STOPPED; - rb_thread_schedule(); -} - - -/* - * call-seq: - * thr.priority => integer - * - * Returns the priority of thr. Default is inherited from the - * current thread which creating the new thread, or zero for the - * initial main thread; higher-priority threads will run before - * lower-priority threads. - * - * Thread.current.priority #=> 0 - */ - -static VALUE -rb_thread_priority(thread) - VALUE thread; -{ - return INT2NUM(rb_thread_check(thread)->priority); -} - - -/* - * call-seq: - * thr.priority= integer => thr - * - * Sets the priority of thr to integer. Higher-priority threads - * will run before lower-priority threads. - * - * count1 = count2 = 0 - * a = Thread.new do - * loop { count1 += 1 } - * end - * a.priority = -1 - * - * b = Thread.new do - * loop { count2 += 1 } - * end - * b.priority = -2 - * sleep 1 #=> 1 - * Thread.critical = 1 - * count1 #=> 622504 - * count2 #=> 5832 - */ - -static VALUE -rb_thread_priority_set(thread, prio) - VALUE thread, prio; -{ - rb_thread_t th; - - rb_secure(4); - th = rb_thread_check(thread); - - th->priority = NUM2INT(prio); - rb_thread_schedule(); - return prio; -} - - -/* - * call-seq: - * thr.safe_level => integer - * - * Returns the safe level in effect for thr. Setting thread-local safe - * levels can help when implementing sandboxes which run insecure code. - * - * thr = Thread.new { $SAFE = 3; sleep } - * Thread.current.safe_level #=> 0 - * thr.safe_level #=> 3 - */ - -static VALUE -rb_thread_safe_level(thread) - VALUE thread; -{ - rb_thread_t th; - - th = rb_thread_check(thread); - if (th == curr_thread) { - return INT2NUM(ruby_safe_level); - } - return INT2NUM(th->safe); -} - -static int ruby_thread_abort; -static VALUE thgroup_default; - - -/* - * call-seq: - * Thread.abort_on_exception => true or false - * - * Returns the status of the global ``abort on exception'' condition. The - * default is false. When set to true, or if the - * global $DEBUG flag is true (perhaps because the - * command line option -d was specified) all threads will abort - * (the process will exit(0)) if an exception is raised in any - * thread. See also Thread::abort_on_exception=. - */ - -static VALUE -rb_thread_s_abort_exc() -{ - return ruby_thread_abort?Qtrue:Qfalse; -} - - -/* - * call-seq: - * Thread.abort_on_exception= boolean => true or false - * - * When set to true, all threads will abort if an exception is - * raised. Returns the new state. - * - * Thread.abort_on_exception = true - * t1 = Thread.new do - * puts "In new thread" - * raise "Exception from thread" - * end - * sleep(1) - * puts "not reached" - * - * produces: - * - * In new thread - * prog.rb:4: Exception from thread (RuntimeError) - * from prog.rb:2:in `initialize' - * from prog.rb:2:in `new' - * from prog.rb:2 - */ - -static VALUE -rb_thread_s_abort_exc_set(self, val) - VALUE self, val; -{ - rb_secure(4); - ruby_thread_abort = RTEST(val); - return val; -} - - -/* - * call-seq: - * thr.abort_on_exception => true or false - * - * Returns the status of the thread-local ``abort on exception'' condition for - * thr. The default is false. See also - * Thread::abort_on_exception=. - */ - -static VALUE -rb_thread_abort_exc(thread) - VALUE thread; -{ - return rb_thread_check(thread)->abort?Qtrue:Qfalse; -} - - -/* - * call-seq: - * thr.abort_on_exception= boolean => true or false - * - * When set to true, causes all threads (including the main - * program) to abort if an exception is raised in thr. The process will - * effectively exit(0). - */ - -static VALUE -rb_thread_abort_exc_set(thread, val) - VALUE thread, val; -{ - rb_secure(4); - rb_thread_check(thread)->abort = RTEST(val); - return val; -} - - -enum rb_thread_status -rb_thread_status(thread) - VALUE thread; -{ - rb_thread_t th = rb_thread_check(thread); - return th->status; -} - - -/* - * call-seq: - * thr.group => thgrp or nil - * - * Returns the ThreadGroup which contains thr, or nil if - * the thread is not a member of any group. - * - * Thread.main.group #=> # - */ - -VALUE -rb_thread_group(thread) - VALUE thread; -{ - VALUE group = rb_thread_check(thread)->thgroup; - if (!group) { - group = Qnil; - } - return group; -} - -#ifdef __ia64 -# define IA64_INIT(x) x -#else -# define IA64_INIT(x) -#endif - -#define THREAD_ALLOC(th) do {\ - th = ALLOC(struct rb_thread);\ -\ - th->next = 0;\ - th->prev = 0;\ -\ - th->status = THREAD_RUNNABLE;\ - th->result = 0;\ - th->flags = 0;\ -\ - th->stk_ptr = 0;\ - th->stk_len = 0;\ - th->stk_max = 0;\ - th->wait_for = 0;\ - IA64_INIT(th->bstr_ptr = 0);\ - IA64_INIT(th->bstr_len = 0);\ - IA64_INIT(th->bstr_max = 0);\ - FD_ZERO(&th->readfds);\ - FD_ZERO(&th->writefds);\ - FD_ZERO(&th->exceptfds);\ - th->delay = 0.0;\ - th->join = 0;\ -\ - th->frame = 0;\ - th->scope = 0;\ - th->klass = 0;\ - th->wrapper = 0;\ - th->cref = ruby_cref;\ - th->dyna_vars = ruby_dyna_vars;\ - th->block = 0;\ - th->iter = 0;\ - th->tag = 0;\ - th->tracing = 0;\ - th->errinfo = Qnil;\ - th->last_status = 0;\ - th->last_line = 0;\ - th->last_match = Qnil;\ - th->abort = 0;\ - th->priority = 0;\ - th->thgroup = thgroup_default;\ - th->locals = 0;\ - th->thread = 0;\ - if (curr_thread == 0) {\ - th->sandbox = Qnil;\ - } else {\ - th->sandbox = curr_thread->sandbox;\ - }\ -} while (0) - -static rb_thread_t -rb_thread_alloc(klass) - VALUE klass; -{ - rb_thread_t th; - struct RVarmap *vars; - - THREAD_ALLOC(th); - th->thread = Data_Wrap_Struct(klass, thread_mark, thread_free, th); - - for (vars = th->dyna_vars; vars; vars = vars->next) { - if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break; - FL_SET(vars, DVAR_DONT_RECYCLE); - } - return th; -} - -static int thread_init; - -#if defined(_THREAD_SAFE) -static void -catch_timer(sig) - int sig; -{ -#if !defined(POSIX_SIGNAL) && !defined(BSD_SIGNAL) - signal(sig, catch_timer); -#endif - /* cause EINTR */ -} - -static int time_thread_alive_p = 0; -static pthread_t time_thread; - -static void* -thread_timer(dummy) - void *dummy; -{ -#ifdef _THREAD_SAFE -#define test_cancel() pthread_testcancel() -#else -#define test_cancel() /* void */ -#endif - - sigset_t all_signals; - - sigfillset(&all_signals); - pthread_sigmask(SIG_BLOCK, &all_signals, 0); - - for (;;) { -#ifdef HAVE_NANOSLEEP - struct timespec req, rem; - - test_cancel(); - req.tv_sec = 0; - req.tv_nsec = 10000000; - nanosleep(&req, &rem); -#else - struct timeval tv; - - test_cancel(); - tv.tv_sec = 0; - tv.tv_usec = 10000; - select(0, NULL, NULL, NULL, &tv); -#endif - if (!rb_thread_critical) { - rb_thread_pending = 1; - if (rb_trap_immediate) { - pthread_kill(ruby_thid, SIGVTALRM); - } - } - } -#undef test_cancel -} - -void -rb_thread_start_timer() -{ -} - -void -rb_thread_stop_timer() -{ -} - -void -rb_child_atfork() -{ - time_thread_alive_p = 0; -} - -void -rb_thread_cancel_timer() -{ -#ifdef _THREAD_SAFE - if( time_thread_alive_p ) - { - pthread_cancel( time_thread ); - pthread_join( time_thread, NULL ); - time_thread_alive_p = 0; - } - thread_init = 0; -#endif -} -#elif defined(HAVE_SETITIMER) -static void -catch_timer(sig) - int sig; -{ -#if !defined(POSIX_SIGNAL) && !defined(BSD_SIGNAL) - signal(sig, catch_timer); -#endif - if (!rb_thread_critical) { - rb_thread_pending = 1; - } - /* cause EINTR */ -} - -void -rb_thread_start_timer() -{ - struct itimerval tval; - - if (!thread_init) return; - tval.it_interval.tv_sec = 0; - tval.it_interval.tv_usec = 10000; - tval.it_value = tval.it_interval; - setitimer(ITIMER_VIRTUAL, &tval, NULL); -} - -void -rb_thread_stop_timer() -{ - struct itimerval tval; - - if (!thread_init) return; - tval.it_interval.tv_sec = 0; - tval.it_interval.tv_usec = 0; - tval.it_value = tval.it_interval; - setitimer(ITIMER_VIRTUAL, &tval, NULL); -} - -void -rb_thread_cancel_timer() -{ -} - -#else /* !(_THREAD_SAFE || HAVE_SETITIMER) */ -int rb_thread_tick = THREAD_TICK; - -void -rb_thread_cancel_timer() -{ -} -#endif - -static VALUE -rb_thread_start_0(fn, arg, th) - VALUE (*fn)(); - void *arg; - rb_thread_t th; -{ - volatile rb_thread_t th_save = th; - volatile VALUE thread = th->thread; - struct BLOCK *volatile saved_block = 0; - enum rb_thread_status status; - int state; - - if (OBJ_FROZEN(curr_thread->thgroup)) { - rb_raise(rb_eThreadError, - "can't start a new thread (frozen ThreadGroup)"); - } - - if (!thread_init) { - thread_init = 1; -#if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE) -#if defined(POSIX_SIGNAL) - posix_signal(SIGVTALRM, catch_timer); -#else - signal(SIGVTALRM, catch_timer); -#endif - -#ifdef _THREAD_SAFE - pthread_create(&time_thread, 0, thread_timer, 0); - time_thread_alive_p = 1; - pthread_atfork(0, 0, rb_child_atfork); -#else - rb_thread_start_timer(); -#endif -#endif - } - - if (THREAD_SAVE_CONTEXT(curr_thread)) { - return thread; - } - - if (ruby_block) { /* should nail down higher blocks */ - struct BLOCK dummy; - - dummy.prev = ruby_block; - blk_copy_prev(&dummy); - saved_block = ruby_block = dummy.prev; - } - scope_dup(ruby_scope); - - if (!th->next) { - /* merge in thread list */ - th->prev = curr_thread; - curr_thread->next->prev = th; - th->next = curr_thread->next; - curr_thread->next = th; - th->priority = curr_thread->priority; - th->thgroup = curr_thread->thgroup; - } - - PUSH_TAG(PROT_THREAD); - if ((state = EXEC_TAG()) == 0) { - if (THREAD_SAVE_CONTEXT(th) == 0) { - curr_thread = th; - th->result = (*fn)(arg, th); - } - th = th_save; - } - else if (TAG_DST()) { - th = th_save; - th->result = prot_tag->retval; - } - POP_TAG(); - status = th->status; - - if (th == main_thread) ruby_stop(state); - rb_thread_remove(th); - - if (saved_block) { - blk_free(saved_block); - } - - if (state && status != THREAD_TO_KILL && !NIL_P(ruby_errinfo)) { - th->flags |= RAISED_EXCEPTION; - if (state == TAG_FATAL) { - /* fatal error within this thread, need to stop whole script */ - main_thread->errinfo = ruby_errinfo; - rb_thread_cleanup(); - } - else if (rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) { - if (th->safe >= 4) { - char buf[32]; - - sprintf(buf, "Insecure exit at level %d", th->safe); - th->errinfo = rb_exc_new2(rb_eSecurityError, buf); - } - else { - /* delegate exception to main_thread */ - rb_thread_main_jump(ruby_errinfo, RESTORE_RAISE); - } - } - else if (th->safe < 4 && (ruby_thread_abort || th->abort || RTEST(ruby_debug))) { - /* exit on main_thread */ - error_print(); - rb_thread_main_jump(ruby_errinfo, RESTORE_EXIT); - } - else { - th->errinfo = ruby_errinfo; - } - } - rb_thread_schedule(); - ruby_stop(0); /* last thread termination */ - return 0; /* not reached */ -} - -VALUE -rb_thread_create(fn, arg) - VALUE (*fn)(); - void *arg; -{ - Init_stack((void *)&arg); - return rb_thread_start_0(fn, arg, rb_thread_alloc(rb_cThread)); -} - -static VALUE -rb_thread_yield(arg, th) - VALUE arg; - rb_thread_t th; -{ - const ID *tbl; - - scope_dup(ruby_block->scope); - - tbl = ruby_scope->local_tbl; - if (tbl) { - int n = *tbl++; - for (tbl += 2, n -= 2; n > 0; --n) { /* skip first 2 ($_ and $~) */ - ID id = *tbl++; - if (id != 0 && !rb_is_local_id(id)) /* push flip states */ - rb_dvar_push(id, Qfalse); - } - } - rb_dvar_push('_', Qnil); - rb_dvar_push('~', Qnil); - ruby_block->dyna_vars = ruby_dyna_vars; - - return rb_yield_0(arg, 0, 0, YIELD_LAMBDA_CALL, Qtrue); -} - -/* - * call-seq: - * Thread.new([arg]*) {|args| block } => thread - * - * Creates and runs a new thread to execute the instructions given in - * block. Any arguments passed to Thread::new are passed - * into the block. - * - * x = Thread.new { sleep 0.1; print "x"; print "y"; print "z" } - * a = Thread.new { print "a"; print "b"; sleep 0.2; print "c" } - * x.join # Let the threads finish before - * a.join # main thread exits... - * - * produces: - * - * abxyzc - */ - -static VALUE -rb_thread_s_new(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - rb_thread_t th = rb_thread_alloc(klass); - volatile VALUE *pos; - - pos = th->stk_pos; - rb_obj_call_init(th->thread, argc, argv); - if (th->stk_pos == 0) { - rb_raise(rb_eThreadError, "uninitialized thread - check `%s#initialize'", - rb_class2name(klass)); - } - - return th->thread; -} - - -/* - * call-seq: - * Thread.new([arg]*) {|args| block } => thread - * - * Creates and runs a new thread to execute the instructions given in - * block. Any arguments passed to Thread::new are passed - * into the block. - * - * x = Thread.new { sleep 0.1; print "x"; print "y"; print "z" } - * a = Thread.new { print "a"; print "b"; sleep 0.2; print "c" } - * x.join # Let the threads finish before - * a.join # main thread exits... - * - * produces: - * - * abxyzc - */ - -static VALUE -rb_thread_initialize(thread, args) - VALUE thread, args; -{ - rb_thread_t th; - - if (!rb_block_given_p()) { - rb_raise(rb_eThreadError, "must be called with a block"); - } - th = rb_thread_check(thread); - if (th->stk_max) { - NODE *node = th->node; - if (!node) { - rb_raise(rb_eThreadError, "already initialized thread"); - } - rb_raise(rb_eThreadError, "already initialized thread - %s:%d", - node->nd_file, nd_line(node)); - } - return rb_thread_start_0(rb_thread_yield, args, th); -} - - -/* - * call-seq: - * Thread.start([args]*) {|args| block } => thread - * Thread.fork([args]*) {|args| block } => thread - * - * Basically the same as Thread::new. However, if class - * Thread is subclassed, then calling start in that - * subclass will not invoke the subclass's initialize method. - */ - -static VALUE -rb_thread_start(klass, args) - VALUE klass, args; -{ - if (!rb_block_given_p()) { - rb_raise(rb_eThreadError, "must be called with a block"); - } - return rb_thread_start_0(rb_thread_yield, args, rb_thread_alloc(klass)); -} - - -/* - * call-seq: - * thr.value => obj - * - * Waits for thr to complete (via Thread#join) and returns - * its value. - * - * a = Thread.new { 2 + 2 } - * a.value #=> 4 - */ - -static VALUE -rb_thread_value(thread) - VALUE thread; -{ - rb_thread_t th = rb_thread_check(thread); - - while (!rb_thread_join0(th, DELAY_INFTY)); - - return th->result; -} - - -/* - * call-seq: - * thr.status => string, false or nil - * - * Returns the status of thr: ``sleep'' if thr is - * sleeping or waiting on I/O, ``run'' if thr is executing, - * ``aborting'' if thr is aborting, false if - * thr terminated normally, and nil if thr - * terminated with an exception. - * - * a = Thread.new { raise("die now") } - * b = Thread.new { Thread.stop } - * c = Thread.new { Thread.exit } - * d = Thread.new { sleep } - * Thread.critical = true - * d.kill #=> # - * a.status #=> nil - * b.status #=> "sleep" - * c.status #=> false - * d.status #=> "aborting" - * Thread.current.status #=> "run" - */ - -static VALUE -rb_thread_status_name(thread) - VALUE thread; -{ - rb_thread_t th = rb_thread_check(thread); - - if (rb_thread_dead(th)) { - if (!NIL_P(th->errinfo) && (th->flags & RAISED_EXCEPTION)) - return Qnil; - return Qfalse; - } - - return rb_str_new2(thread_status_name(th->status)); -} - - -/* - * call-seq: - * thr.alive? => true or false - * - * Returns true if thr is running or sleeping. - * - * thr = Thread.new { } - * thr.join #=> # - * Thread.current.alive? #=> true - * thr.alive? #=> false - */ - -VALUE -rb_thread_alive_p(thread) - VALUE thread; -{ - rb_thread_t th = rb_thread_check(thread); - - if (rb_thread_dead(th)) return Qfalse; - return Qtrue; -} - - -/* - * call-seq: - * thr.stop? => true or false - * - * Returns true if thr is dead or sleeping. - * - * a = Thread.new { Thread.stop } - * b = Thread.current - * a.stop? #=> true - * b.stop? #=> false - */ - -static VALUE -rb_thread_stop_p(thread) - VALUE thread; -{ - rb_thread_t th = rb_thread_check(thread); - - if (rb_thread_dead(th)) return Qtrue; - if (th->status == THREAD_STOPPED) return Qtrue; - return Qfalse; -} - -static void -rb_thread_wait_other_threads() -{ - rb_thread_t th; - int found; - - /* wait other threads to terminate */ - while (curr_thread != curr_thread->next) { - found = 0; - FOREACH_THREAD(th) { - if (th != curr_thread && th->status != THREAD_STOPPED) { - found = 1; - break; - } - } - END_FOREACH(th); - if (!found) return; - rb_thread_schedule(); - } -} - -static void -rb_thread_cleanup() -{ - rb_thread_t curr, th; - - curr = curr_thread; - while (curr->status == THREAD_KILLED) { - curr = curr->prev; - } - - FOREACH_THREAD_FROM(curr, th) { - if (th->status != THREAD_KILLED) { - rb_thread_ready(th); - if (th != main_thread) { - th->thgroup = 0; - th->priority = 0; - th->status = THREAD_TO_KILL; - RDATA(th->thread)->dfree = NULL; - } - } - } - END_FOREACH_FROM(curr, th); -} - -int rb_thread_critical; - - -/* - * call-seq: - * Thread.critical => true or false - * - * Returns the status of the global ``thread critical'' condition. - */ - -static VALUE -rb_thread_critical_get() -{ - return rb_thread_critical?Qtrue:Qfalse; -} - - -/* - * call-seq: - * Thread.critical= boolean => true or false - * - * Sets the status of the global ``thread critical'' condition and returns - * it. When set to true, prohibits scheduling of any existing - * thread. Does not block new threads from being created and run. Certain - * thread operations (such as stopping or killing a thread, sleeping in the - * current thread, and raising an exception) may cause a thread to be scheduled - * even when in a critical section. Thread::critical is not - * intended for daily use: it is primarily there to support folks writing - * threading libraries. - */ - -static VALUE -rb_thread_critical_set(obj, val) - VALUE obj, val; -{ - rb_thread_critical = RTEST(val); - return val; -} - -void -rb_thread_interrupt() -{ - rb_thread_critical = 0; - rb_thread_ready(main_thread); - if (curr_thread == main_thread) { - rb_interrupt(); - } - if (!rb_thread_dead(curr_thread)) { - if (THREAD_SAVE_CONTEXT(curr_thread)) { - return; - } - } - curr_thread = main_thread; - rb_thread_restore_context(curr_thread, RESTORE_INTERRUPT); -} - -void -rb_thread_signal_raise(sig) - int sig; -{ - rb_thread_critical = 0; - if (curr_thread == main_thread) { - VALUE argv[1]; - - rb_thread_ready(curr_thread); - argv[0] = INT2FIX(sig); - rb_exc_raise(rb_class_new_instance(1, argv, rb_eSignal)); - } - rb_thread_ready(main_thread); - if (!rb_thread_dead(curr_thread)) { - if (THREAD_SAVE_CONTEXT(curr_thread)) { - return; - } - } - th_sig = sig; - curr_thread = main_thread; - rb_thread_restore_context(curr_thread, RESTORE_SIGNAL); -} - -void -rb_thread_trap_eval(cmd, sig, safe) - VALUE cmd; - int sig, safe; -{ - rb_thread_critical = 0; - if (curr_thread == main_thread) { - rb_trap_eval(cmd, sig, safe); - return; - } - if (!rb_thread_dead(curr_thread)) { - if (THREAD_SAVE_CONTEXT(curr_thread)) { - return; - } - } - th_cmd = cmd; - th_sig = sig; - th_safe = safe; - curr_thread = main_thread; - rb_thread_restore_context(curr_thread, RESTORE_TRAP); -} - -void -rb_thread_signal_exit() -{ - VALUE args[2]; - - rb_thread_critical = 0; - if (curr_thread == main_thread) { - rb_thread_ready(curr_thread); - rb_exit(EXIT_SUCCESS); - } - args[0] = INT2NUM(EXIT_SUCCESS); - args[1] = rb_str_new2("exit"); - rb_thread_ready(main_thread); - if (!rb_thread_dead(curr_thread)) { - if (THREAD_SAVE_CONTEXT(curr_thread)) { - return; - } - } - rb_thread_main_jump(rb_class_new_instance(2, args, rb_eSystemExit), - RESTORE_EXIT); -} - -static VALUE -rb_thread_raise(argc, argv, th) - int argc; - VALUE *argv; - rb_thread_t th; -{ - volatile rb_thread_t th_save = th; - VALUE exc; - - if (!th->next) { - rb_raise(rb_eArgError, "unstarted thread"); - } - if (rb_thread_dead(th)) return Qnil; - exc = rb_make_exception(argc, argv); - if (curr_thread == th) { - rb_raise_jump(exc); - } - - if (!rb_thread_dead(curr_thread)) { - if (THREAD_SAVE_CONTEXT(curr_thread)) { - return th_save->thread; - } - } - - rb_thread_ready(th); - curr_thread = th; - - th_raise_exception = exc; - th_raise_node = ruby_current_node; - rb_thread_restore_context(curr_thread, RESTORE_RAISE); - return Qnil; /* not reached */ -} - - -/* - * call-seq: - * thr.raise(exception) - * - * Raises an exception (see Kernel::raise) from thr. The - * caller does not have to be thr. - * - * Thread.abort_on_exception = true - * a = Thread.new { sleep(200) } - * a.raise("Gotcha") - * - * produces: - * - * prog.rb:3: Gotcha (RuntimeError) - * from prog.rb:2:in `initialize' - * from prog.rb:2:in `new' - * from prog.rb:2 - */ - -static VALUE -rb_thread_raise_m(argc, argv, thread) - int argc; - VALUE *argv; - VALUE thread; -{ - rb_thread_t th = rb_thread_check(thread); - - if (ruby_safe_level > th->safe) { - rb_secure(4); - } - rb_thread_raise(argc, argv, th); - return Qnil; /* not reached */ -} - -VALUE -rb_thread_local_aref(thread, id) - VALUE thread; - ID id; -{ - rb_thread_t th; - VALUE val; - - th = rb_thread_check(thread); - if (ruby_safe_level >= 4 && th != curr_thread) { - rb_raise(rb_eSecurityError, "Insecure: thread locals"); - } - if (!th->locals) return Qnil; - if (st_lookup(th->locals, id, &val)) { - return val; - } - return Qnil; -} - - -/* - * call-seq: - * thr[sym] => obj or nil - * - * Attribute Reference---Returns the value of a thread-local variable, using - * either a symbol or a string name. If the specified variable does not exist, - * returns nil. - * - * a = Thread.new { Thread.current["name"] = "A"; Thread.stop } - * b = Thread.new { Thread.current[:name] = "B"; Thread.stop } - * c = Thread.new { Thread.current["name"] = "C"; Thread.stop } - * Thread.list.each {|x| puts "#{x.inspect}: #{x[:name]}" } - * - * produces: - * - * #: C - * #: B - * #: A - * #: - */ - -static VALUE -rb_thread_aref(thread, id) - VALUE thread, id; -{ - return rb_thread_local_aref(thread, rb_to_id(id)); -} - -VALUE -rb_thread_local_aset(thread, id, val) - VALUE thread; - ID id; - VALUE val; -{ - rb_thread_t th = rb_thread_check(thread); - - if (ruby_safe_level >= 4 && th != curr_thread) { - rb_raise(rb_eSecurityError, "Insecure: can't modify thread locals"); - } - if (OBJ_FROZEN(thread)) rb_error_frozen("thread locals"); - - if (!th->locals) { - th->locals = st_init_numtable(); - } - if (NIL_P(val)) { - st_delete(th->locals, (st_data_t*)&id, 0); - return Qnil; - } - st_insert(th->locals, id, val); - - return val; -} - - -/* - * call-seq: - * thr[sym] = obj => obj - * - * Attribute Assignment---Sets or creates the value of a thread-local variable, - * using either a symbol or a string. See also Thread#[]. - */ - -static VALUE -rb_thread_aset(thread, id, val) - VALUE thread, id, val; -{ - return rb_thread_local_aset(thread, rb_to_id(id), val); -} - - -/* - * call-seq: - * thr.key?(sym) => true or false - * - * Returns true if the given string (or symbol) exists as a - * thread-local variable. - * - * me = Thread.current - * me[:oliver] = "a" - * me.key?(:oliver) #=> true - * me.key?(:stanley) #=> false - */ - -static VALUE -rb_thread_key_p(thread, id) - VALUE thread, id; -{ - rb_thread_t th = rb_thread_check(thread); - - if (!th->locals) return Qfalse; - if (st_lookup(th->locals, rb_to_id(id), 0)) - return Qtrue; - return Qfalse; -} - -static int -thread_keys_i(key, value, ary) - ID key; - VALUE value, ary; -{ - rb_ary_push(ary, ID2SYM(key)); - return ST_CONTINUE; -} - - -/* - * call-seq: - * thr.keys => array - * - * Returns an an array of the names of the thread-local variables (as Symbols). - * - * thr = Thread.new do - * Thread.current[:cat] = 'meow' - * Thread.current["dog"] = 'woof' - * end - * thr.join #=> # - * thr.keys #=> [:dog, :cat] - */ - -static VALUE -rb_thread_keys(thread) - VALUE thread; -{ - rb_thread_t th = rb_thread_check(thread); - VALUE ary = rb_ary_new(); - - if (th->locals) { - st_foreach(th->locals, thread_keys_i, ary); - } - return ary; -} - -/* - * call-seq: - * thr.inspect => string - * - * Dump the name, id, and status of _thr_ to a string. - */ - -static VALUE -rb_thread_inspect(thread) - VALUE thread; -{ - char *cname = rb_obj_classname(thread); - rb_thread_t th = rb_thread_check(thread); - const char *status = thread_status_name(th->status); - VALUE str; - size_t len = strlen(cname)+7+16+9+1; - - str = rb_str_new(0, len); /* 7:tags 16:addr 9:status 1:nul */ - snprintf(RSTRING(str)->ptr, len, "#<%s:0x%lx %s>", cname, thread, status); - RSTRING(str)->len = strlen(RSTRING(str)->ptr); - OBJ_INFECT(str, thread); - - return str; -} - -void -rb_thread_atfork() -{ - rb_thread_t th; - - if (rb_thread_alone()) return; - FOREACH_THREAD(th) { - if (th != curr_thread) { - rb_thread_die(th); - } - } - END_FOREACH(th); - main_thread = curr_thread; - curr_thread->next = curr_thread; - curr_thread->prev = curr_thread; -} - - -static void -cc_purge(cc) - rb_thread_t cc; -{ - /* free continuation's stack if it has just died */ - if (NIL_P(cc->thread)) return; - if (rb_thread_check(cc->thread)->status == THREAD_KILLED) { - cc->thread = Qnil; - rb_thread_die(cc); /* can't possibly activate this stack */ - } -} - -static void -cc_mark(cc) - rb_thread_t cc; -{ - /* mark this continuation's stack only if its parent thread is still alive */ - cc_purge(cc); - thread_mark(cc); -} - -static rb_thread_t -rb_cont_check(data) - VALUE data; -{ - if (TYPE(data) != T_DATA || RDATA(data)->dmark != (RUBY_DATA_FUNC)cc_mark) { - rb_raise(rb_eTypeError, "wrong argument type %s (expected Continuation)", - rb_obj_classname(data)); - } - return (rb_thread_t)RDATA(data)->data; -} - -/* - * Document-class: Continuation - * - * Continuation objects are generated by - * Kernel#callcc. They hold a return address and execution - * context, allowing a nonlocal return to the end of the - * callcc block from anywhere within a program. - * Continuations are somewhat analogous to a structured version of C's - * setjmp/longjmp (although they contain more state, so - * you might consider them closer to threads). - * - * For instance: - * - * arr = [ "Freddie", "Herbie", "Ron", "Max", "Ringo" ] - * callcc{|$cc|} - * puts(message = arr.shift) - * $cc.call unless message =~ /Max/ - * - * produces: - * - * Freddie - * Herbie - * Ron - * Max - * - * This (somewhat contrived) example allows the inner loop to abandon - * processing early: - * - * callcc {|cont| - * for i in 0..4 - * print "\n#{i}: " - * for j in i*5...(i+1)*5 - * cont.call() if j == 17 - * printf "%3d", j - * end - * end - * } - * print "\n" - * - * produces: - * - * 0: 0 1 2 3 4 - * 1: 5 6 7 8 9 - * 2: 10 11 12 13 14 - * 3: 15 16 - */ - -VALUE rb_cCont; - -/* - * call-seq: - * callcc {|cont| block } => obj - * - * Generates a Continuation object, which it passes to the - * associated block. Performing a cont.call will - * cause the callcc to return (as will falling through the - * end of the block). The value returned by the callcc is - * the value of the block, or the value passed to - * cont.call. See class Continuation - * for more details. Also see Kernel::throw for - * an alternative mechanism for unwinding a call stack. - */ - -static VALUE -rb_callcc(self) - VALUE self; -{ - volatile VALUE cont; - rb_thread_t th; - volatile rb_thread_t th_save; - struct tag *tag; - struct RVarmap *vars; - - THREAD_ALLOC(th); - /* must finish th initialization before any possible gc. - * brent@mbari.org */ - th->thread = curr_thread->thread; - th->thgroup = cont_protect; - cont = Data_Wrap_Struct(rb_cCont, cc_mark, thread_free, th); - - scope_dup(ruby_scope); - for (tag=prot_tag; tag; tag=tag->prev) { - scope_dup(tag->scope); - } - - for (vars = ruby_dyna_vars; vars; vars = vars->next) { - if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break; - FL_SET(vars, DVAR_DONT_RECYCLE); - } - th_save = th; - if (THREAD_SAVE_CONTEXT(th)) { - return th_save->result; - } - else { - return rb_yield(cont); - } -} - -/* - * call-seq: - * cont.call(args, ...) - * cont[args, ...] - * - * Invokes the continuation. The program continues from the end of the - * callcc block. If no arguments are given, the original - * callcc returns nil. If one argument is - * given, callcc returns it. Otherwise, an array - * containing args is returned. - * - * callcc {|cont| cont.call } #=> nil - * callcc {|cont| cont.call 1 } #=> 1 - * callcc {|cont| cont.call 1, 2, 3 } #=> [1, 2, 3] - */ - -static VALUE -rb_cont_call(argc, argv, cont) - int argc; - VALUE *argv; - VALUE cont; -{ - rb_thread_t th = rb_cont_check(cont); - - if (th->thread != curr_thread->thread) { - rb_raise(rb_eRuntimeError, "continuation called across threads"); - } - if (th->thgroup != cont_protect) { - rb_raise(rb_eRuntimeError, "continuation called across trap"); - } - switch (argc) { - case 0: - th->result = Qnil; - break; - case 1: - th->result = argv[0]; - break; - default: - th->result = rb_ary_new4(argc, argv); - break; - } - - rb_thread_restore_context(th, RESTORE_NORMAL); - return Qnil; -} - -struct thgroup { - int enclosed; - VALUE group; -}; - - -/* - * Document-class: ThreadGroup - * - * ThreadGroup provides a means of keeping track of a number of - * threads as a group. A Thread can belong to only one - * ThreadGroup at a time; adding a thread to a new group will - * remove it from any previous group. - * - * Newly created threads belong to the same group as the thread from which they - * were created. - */ - -static VALUE thgroup_s_alloc _((VALUE)); -static VALUE -thgroup_s_alloc(klass) - VALUE klass; -{ - VALUE group; - struct thgroup *data; - - group = Data_Make_Struct(klass, struct thgroup, 0, free, data); - data->enclosed = 0; - data->group = group; - - return group; -} - - -/* - * call-seq: - * thgrp.list => array - * - * Returns an array of all existing Thread objects that belong to - * this group. - * - * ThreadGroup::Default.list #=> [#] - */ - -static VALUE -thgroup_list(group) - VALUE group; -{ - struct thgroup *data; - rb_thread_t th; - VALUE ary; - - Data_Get_Struct(group, struct thgroup, data); - ary = rb_ary_new(); - - FOREACH_THREAD(th) { - if (th->thgroup == data->group) { - rb_ary_push(ary, th->thread); - } - } - END_FOREACH(th); - - return ary; -} - - -/* - * call-seq: - * thgrp.enclose => thgrp - * - * Prevents threads from being added to or removed from the receiving - * ThreadGroup. New threads can still be started in an enclosed - * ThreadGroup. - * - * ThreadGroup::Default.enclose #=> # - * thr = Thread::new { Thread.stop } #=> # - * tg = ThreadGroup::new #=> # - * tg.add thr - * - * produces: - * - * ThreadError: can't move from the enclosed thread group - */ - -static VALUE -thgroup_enclose(group) - VALUE group; -{ - struct thgroup *data; - - Data_Get_Struct(group, struct thgroup, data); - data->enclosed = 1; - - return group; -} - - -/* - * call-seq: - * thgrp.enclosed? => true or false - * - * Returns true if thgrp is enclosed. See also - * ThreadGroup#enclose. - */ - -static VALUE -thgroup_enclosed_p(group) - VALUE group; -{ - struct thgroup *data; - - Data_Get_Struct(group, struct thgroup, data); - if (data->enclosed) return Qtrue; - return Qfalse; -} - - -/* - * call-seq: - * thgrp.add(thread) => thgrp - * - * Adds the given thread to this group, removing it from any other - * group to which it may have previously belonged. - * - * puts "Initial group is #{ThreadGroup::Default.list}" - * tg = ThreadGroup.new - * t1 = Thread.new { sleep } - * t2 = Thread.new { sleep } - * puts "t1 is #{t1}" - * puts "t2 is #{t2}" - * tg.add(t1) - * puts "Initial group now #{ThreadGroup::Default.list}" - * puts "tg group now #{tg.list}" - * - * produces: - * - * Initial group is # - * t1 is # - * t2 is # - * Initial group now ## - * tg group now # - */ - -static VALUE -thgroup_add(group, thread) - VALUE group, thread; -{ - rb_thread_t th; - struct thgroup *data; - - rb_secure(4); - th = rb_thread_check(thread); - - if (OBJ_FROZEN(group)) { - rb_raise(rb_eThreadError, "can't move to the frozen thread group"); - } - Data_Get_Struct(group, struct thgroup, data); - if (data->enclosed) { - rb_raise(rb_eThreadError, "can't move to the enclosed thread group"); - } - - if (!th->thgroup) { - return Qnil; - } - if (OBJ_FROZEN(th->thgroup)) { - rb_raise(rb_eThreadError, "can't move from the frozen thread group"); - } - Data_Get_Struct(th->thgroup, struct thgroup, data); - if (data->enclosed) { - rb_raise(rb_eThreadError, "can't move from the enclosed thread group"); - } - - th->thgroup = group; - return group; -} - - -/* - * +Thread+ encapsulates the behavior of a thread of - * execution, including the main thread of the Ruby script. - * - * In the descriptions of the methods in this class, the parameter _sym_ - * refers to a symbol, which is either a quoted string or a - * +Symbol+ (such as :name). - */ - -void -Init_Thread() -{ - VALUE cThGroup; - - rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError); - rb_cThread = rb_define_class("Thread", rb_cObject); - rb_undef_alloc_func(rb_cThread); - - rb_define_singleton_method(rb_cThread, "new", rb_thread_s_new, -1); - rb_define_method(rb_cThread, "initialize", rb_thread_initialize, -2); - rb_define_singleton_method(rb_cThread, "start", rb_thread_start, -2); - rb_define_singleton_method(rb_cThread, "fork", rb_thread_start, -2); - - rb_define_singleton_method(rb_cThread, "stop", rb_thread_stop, 0); - rb_define_singleton_method(rb_cThread, "kill", rb_thread_s_kill, 1); - rb_define_singleton_method(rb_cThread, "exit", rb_thread_exit, 0); - rb_define_singleton_method(rb_cThread, "pass", rb_thread_pass, 0); - rb_define_singleton_method(rb_cThread, "current", rb_thread_current, 0); - rb_define_singleton_method(rb_cThread, "main", rb_thread_main, 0); - rb_define_singleton_method(rb_cThread, "list", rb_thread_list, 0); - - rb_define_singleton_method(rb_cThread, "critical", rb_thread_critical_get, 0); - rb_define_singleton_method(rb_cThread, "critical=", rb_thread_critical_set, 1); - - rb_define_singleton_method(rb_cThread, "abort_on_exception", rb_thread_s_abort_exc, 0); - rb_define_singleton_method(rb_cThread, "abort_on_exception=", rb_thread_s_abort_exc_set, 1); - - rb_define_method(rb_cThread, "run", rb_thread_run, 0); - rb_define_method(rb_cThread, "wakeup", rb_thread_wakeup, 0); - rb_define_method(rb_cThread, "kill", rb_thread_kill, 0); - rb_define_method(rb_cThread, "terminate", rb_thread_kill, 0); - rb_define_method(rb_cThread, "exit", rb_thread_kill, 0); - rb_define_method(rb_cThread, "kill!", rb_thread_kill_bang, 0); - rb_define_method(rb_cThread, "terminate!", rb_thread_kill_bang, 0); - rb_define_method(rb_cThread, "exit!", rb_thread_kill_bang, 0); - rb_define_method(rb_cThread, "value", rb_thread_value, 0); - rb_define_method(rb_cThread, "status", rb_thread_status_name, 0); - rb_define_method(rb_cThread, "join", rb_thread_join_m, -1); - rb_define_method(rb_cThread, "alive?", rb_thread_alive_p, 0); - rb_define_method(rb_cThread, "stop?", rb_thread_stop_p, 0); - rb_define_method(rb_cThread, "raise", rb_thread_raise_m, -1); - - rb_define_method(rb_cThread, "abort_on_exception", rb_thread_abort_exc, 0); - rb_define_method(rb_cThread, "abort_on_exception=", rb_thread_abort_exc_set, 1); - - rb_define_method(rb_cThread, "priority", rb_thread_priority, 0); - rb_define_method(rb_cThread, "priority=", rb_thread_priority_set, 1); - rb_define_method(rb_cThread, "safe_level", rb_thread_safe_level, 0); - rb_define_method(rb_cThread, "group", rb_thread_group, 0); - - rb_define_method(rb_cThread, "[]", rb_thread_aref, 1); - rb_define_method(rb_cThread, "[]=", rb_thread_aset, 2); - rb_define_method(rb_cThread, "key?", rb_thread_key_p, 1); - rb_define_method(rb_cThread, "keys", rb_thread_keys, 0); - - rb_define_method(rb_cThread, "inspect", rb_thread_inspect, 0); - - rb_cCont = rb_define_class("Continuation", rb_cObject); - rb_undef_alloc_func(rb_cCont); - rb_undef_method(CLASS_OF(rb_cCont), "new"); - rb_define_method(rb_cCont, "call", rb_cont_call, -1); - rb_define_method(rb_cCont, "[]", rb_cont_call, -1); - rb_define_global_function("callcc", rb_callcc, 0); - rb_global_variable(&cont_protect); - - cThGroup = rb_define_class("ThreadGroup", rb_cObject); - rb_define_alloc_func(cThGroup, thgroup_s_alloc); - rb_define_method(cThGroup, "list", thgroup_list, 0); - rb_define_method(cThGroup, "enclose", thgroup_enclose, 0); - rb_define_method(cThGroup, "enclosed?", thgroup_enclosed_p, 0); - rb_define_method(cThGroup, "add", thgroup_add, 1); - rb_global_variable(&thgroup_default); - thgroup_default = rb_obj_alloc(cThGroup); - rb_define_const(cThGroup, "Default", thgroup_default); - - /* allocate main thread */ - main_thread = rb_thread_alloc(rb_cThread); - curr_thread = main_thread->prev = main_thread->next = main_thread; -} - -/* - * call-seq: - * catch(symbol) {| | block } > obj - * - * +catch+ executes its block. If a +throw+ is - * executed, Ruby searches up its stack for a +catch+ block - * with a tag corresponding to the +throw+'s - * _symbol_. If found, that block is terminated, and - * +catch+ returns the value given to +throw+. If - * +throw+ is not called, the block terminates normally, and - * the value of +catch+ is the value of the last expression - * evaluated. +catch+ expressions may be nested, and the - * +throw+ call need not be in lexical scope. - * - * def routine(n) - * puts n - * throw :done if n <= 0 - * routine(n-1) - * end - * - * - * catch(:done) { routine(3) } - * - * produces: - * - * 3 - * 2 - * 1 - * 0 - */ - -static VALUE -rb_f_catch(dmy, tag) - VALUE dmy, tag; -{ - int state; - VALUE val = Qnil; /* OK */ - - tag = ID2SYM(rb_to_id(tag)); - PUSH_TAG(tag); - if ((state = EXEC_TAG()) == 0) { - val = rb_yield_0(tag, 0, 0, 0, Qfalse); - } - else if (state == TAG_THROW && tag == prot_tag->dst) { - val = prot_tag->retval; - state = 0; - } - POP_TAG(); - if (state) JUMP_TAG(state); - - return val; -} - -static VALUE -catch_i(tag) - VALUE tag; -{ - return rb_funcall(Qnil, rb_intern("catch"), 1, tag); -} - -VALUE -rb_catch(tag, func, data) - const char *tag; - VALUE (*func)(); - VALUE data; -{ - return rb_iterate((VALUE(*)_((VALUE)))catch_i, ID2SYM(rb_intern(tag)), func, data); -} - -/* - * call-seq: - * throw(symbol [, obj]) - * - * Transfers control to the end of the active +catch+ block - * waiting for _symbol_. Raises +NameError+ if there - * is no +catch+ block for the symbol. The optional second - * parameter supplies a return value for the +catch+ block, - * which otherwise defaults to +nil+. For examples, see - * Kernel::catch. - */ - -static VALUE -rb_f_throw(argc, argv) - int argc; - VALUE *argv; -{ - VALUE tag, value; - struct tag *tt = prot_tag; - - rb_scan_args(argc, argv, "11", &tag, &value); - tag = ID2SYM(rb_to_id(tag)); - - while (tt) { - if (tt->tag == tag) { - tt->dst = tag; - tt->retval = value; - break; - } - if (tt->tag == PROT_THREAD) { - rb_raise(rb_eThreadError, "uncaught throw `%s' in thread 0x%lx", - rb_id2name(SYM2ID(tag)), - curr_thread); - } - tt = tt->prev; - } - if (!tt) { - rb_name_error(SYM2ID(tag), "uncaught throw `%s'", rb_id2name(SYM2ID(tag))); - } - rb_trap_restore_mask(); - JUMP_TAG(TAG_THROW); -#ifndef __GNUC__ - return Qnil; /* not reached */ -#endif -} - -void -rb_throw(tag, val) - const char *tag; - VALUE val; -{ - VALUE argv[2]; - - argv[0] = ID2SYM(rb_intern(tag)); - argv[1] = val; - rb_f_throw(2, argv); -} -/********************************************************************** - - file.c - - - $Author: wyhaines $ - $Date: 2009-08-25 20:37:21 +0200 (Tue, 25 Aug 2009) $ - created at: Mon Nov 15 12:24:34 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#ifdef _WIN32 -#include "missing/file.h" -#endif -#ifdef __CYGWIN__ -#define OpenFile WINAPI_OpenFile -#include -#include -#undef OpenFile -#endif - -#include "ruby.h" -#include "rubyio.h" -#include "rubysig.h" -#include "util.h" -#include "dln.h" -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_SYS_FILE_H -# include -#else -int flock _((int, int)); -#endif - -#ifdef HAVE_SYS_PARAM_H -# include -#endif -#ifndef MAXPATHLEN -# define MAXPATHLEN 1024 -#endif - -#include - -VALUE rb_time_new _((time_t, time_t)); - -#ifdef HAVE_UTIME_H -#include -#elif defined HAVE_SYS_UTIME_H -#include -#endif - -#ifdef HAVE_PWD_H -#include -#endif - -#ifndef HAVE_STRING_H -char *strrchr _((const char*,const char)); -#endif - -#include -#include - -#ifdef HAVE_SYS_MKDEV_H -#include -#endif - -#if defined(HAVE_FCNTL_H) -#include -#endif - -#if !defined HAVE_LSTAT && !defined lstat -#define lstat stat -#endif -#if !HAVE_FSEEKO && !defined(fseeko) -# define fseeko fseek -#endif - -#ifdef __BEOS__ /* should not change ID if -1 */ -static int -be_chown(const char *path, uid_t owner, gid_t group) -{ - if (owner == -1 || group == -1) { - struct stat st; - if (stat(path, &st) < 0) return -1; - if (owner == -1) owner = st.st_uid; - if (group == -1) group = st.st_gid; - } - return chown(path, owner, group); -} -#define chown be_chown -static int -be_fchown(int fd, uid_t owner, gid_t group) -{ - if (owner == -1 || group == -1) { - struct stat st; - if (fstat(fd, &st) < 0) return -1; - if (owner == -1) owner = st.st_uid; - if (group == -1) group = st.st_gid; - } - return fchown(fd, owner, group); -} -#define fchown be_fchown -#endif /* __BEOS__ */ - -VALUE rb_cFile; -VALUE rb_mFileTest; -VALUE rb_cStat; - -static long apply2files _((void (*)(const char *, void *), VALUE, void *)); -static long -apply2files(func, vargs, arg) - void (*func)_((const char *, void *)); - VALUE vargs; - void *arg; -{ - long i; - VALUE path; - struct RArray *args = RARRAY(vargs); - - for (i=0; ilen; i++) { - path = args->ptr[i]; - SafeStringValue(path); - (*func)(StringValueCStr(path), arg); - } - - return args->len; -} - -/* - * call-seq: - * file.path -> filename - * - * Returns the pathname used to create file as a string. Does - * not normalize the name. - * - * File.new("testfile").path #=> "testfile" - * File.new("/tmp/../tmp/xxx", "w").path #=> "/tmp/../tmp/xxx" - * - */ - -static VALUE -rb_file_path(obj) - VALUE obj; -{ - OpenFile *fptr; - - fptr = RFILE(rb_io_taint_check(obj))->fptr; - rb_io_check_initialized(fptr); - if (!fptr->path) return Qnil; - return rb_tainted_str_new2(fptr->path); -} - -static VALUE -stat_new_0(klass, st) - VALUE klass; - struct stat *st; -{ - struct stat *nst = 0; - - if (st) { - nst = ALLOC(struct stat); - *nst = *st; - } - return Data_Wrap_Struct(klass, NULL, free, nst); -} - -static VALUE -stat_new(st) - struct stat *st; -{ - return stat_new_0(rb_cStat, st); -} - -static struct stat* -get_stat(self) - VALUE self; -{ - struct stat* st; - Data_Get_Struct(self, struct stat, st); - if (!st) rb_raise(rb_eTypeError, "uninitialized File::Stat"); - return st; -} - -/* - * call-seq: - * stat <=> other_stat => -1, 0, 1 - * - * Compares File::Stat objects by comparing their - * respective modification times. - * - * f1 = File.new("f1", "w") - * sleep 1 - * f2 = File.new("f2", "w") - * f1.stat <=> f2.stat #=> -1 - */ - -static VALUE -rb_stat_cmp(self, other) - VALUE self, other; -{ - if (rb_obj_is_kind_of(other, rb_obj_class(self))) { - time_t t1 = get_stat(self)->st_mtime; - time_t t2 = get_stat(other)->st_mtime; - if (t1 == t2) - return INT2FIX(0); - else if (t1 < t2) - return INT2FIX(-1); - else - return INT2FIX(1); - } - return Qnil; -} - -static VALUE rb_stat_dev _((VALUE)); -static VALUE rb_stat_ino _((VALUE)); -static VALUE rb_stat_mode _((VALUE)); -static VALUE rb_stat_nlink _((VALUE)); -static VALUE rb_stat_uid _((VALUE)); -static VALUE rb_stat_gid _((VALUE)); -static VALUE rb_stat_rdev _((VALUE)); -static VALUE rb_stat_size _((VALUE)); -static VALUE rb_stat_blksize _((VALUE)); -static VALUE rb_stat_blocks _((VALUE)); -static VALUE rb_stat_atime _((VALUE)); -static VALUE rb_stat_mtime _((VALUE)); -static VALUE rb_stat_ctime _((VALUE)); - -/* - * call-seq: - * stat.dev => fixnum - * - * Returns an integer representing the device on which stat - * resides. - * - * File.stat("testfile").dev #=> 774 - */ - -static VALUE -rb_stat_dev(self) - VALUE self; -{ - return INT2NUM(get_stat(self)->st_dev); -} - -/* - * call-seq: - * stat.dev_major => fixnum - * - * Returns the major part of File_Stat#dev or - * nil. - * - * File.stat("/dev/fd1").dev_major #=> 2 - * File.stat("/dev/tty").dev_major #=> 5 - */ - -static VALUE -rb_stat_dev_major(self) - VALUE self; -{ -#if defined(major) - long dev = get_stat(self)->st_dev; - return ULONG2NUM(major(dev)); -#else - return Qnil; -#endif -} - -/* - * call-seq: - * stat.dev_minor => fixnum - * - * Returns the minor part of File_Stat#dev or - * nil. - * - * File.stat("/dev/fd1").dev_minor #=> 1 - * File.stat("/dev/tty").dev_minor #=> 0 - */ - -static VALUE -rb_stat_dev_minor(self) - VALUE self; -{ -#if defined(minor) - long dev = get_stat(self)->st_dev; - return ULONG2NUM(minor(dev)); -#else - return Qnil; -#endif -} - -/* - * call-seq: - * stat.ino => fixnum - * - * Returns the inode number for stat. - * - * File.stat("testfile").ino #=> 1083669 - * - */ - -static VALUE -rb_stat_ino(self) - VALUE self; -{ -#ifdef HUGE_ST_INO - return ULL2NUM(get_stat(self)->st_ino); -#else - return ULONG2NUM(get_stat(self)->st_ino); -#endif -} - -/* - * call-seq: - * stat.mode => fixnum - * - * Returns an integer representing the permission bits of - * stat. The meaning of the bits is platform dependent; on - * Unix systems, see stat(2). - * - * File.chmod(0644, "testfile") #=> 1 - * s = File.stat("testfile") - * sprintf("%o", s.mode) #=> "100644" - */ - -static VALUE -rb_stat_mode(self) - VALUE self; -{ -#ifdef __BORLANDC__ - return UINT2NUM((unsigned short)(get_stat(self)->st_mode)); -#else - return UINT2NUM(get_stat(self)->st_mode); -#endif -} - -/* - * call-seq: - * stat.nlink => fixnum - * - * Returns the number of hard links to stat. - * - * File.stat("testfile").nlink #=> 1 - * File.link("testfile", "testfile.bak") #=> 0 - * File.stat("testfile").nlink #=> 2 - * - */ - -static VALUE -rb_stat_nlink(self) - VALUE self; -{ - return UINT2NUM(get_stat(self)->st_nlink); -} - -/* - * call-seq: - * stat.uid => fixnum - * - * Returns the numeric user id of the owner of stat. - * - * File.stat("testfile").uid #=> 501 - * - */ - -static VALUE -rb_stat_uid(self) - VALUE self; -{ - return UINT2NUM(get_stat(self)->st_uid); -} - -/* - * call-seq: - * stat.gid => fixnum - * - * Returns the numeric group id of the owner of stat. - * - * File.stat("testfile").gid #=> 500 - * - */ - -static VALUE -rb_stat_gid(self) - VALUE self; -{ - return UINT2NUM(get_stat(self)->st_gid); -} - -/* - * call-seq: - * stat.rdev => fixnum or nil - * - * Returns an integer representing the device type on which - * stat resides. Returns nil if the operating - * system doesn't support this feature. - * - * File.stat("/dev/fd1").rdev #=> 513 - * File.stat("/dev/tty").rdev #=> 1280 - */ - -static VALUE -rb_stat_rdev(self) - VALUE self; -{ -#ifdef HAVE_ST_RDEV - return ULONG2NUM(get_stat(self)->st_rdev); -#else - return Qnil; -#endif -} - -/* - * call-seq: - * stat.rdev_major => fixnum - * - * Returns the major part of File_Stat#rdev or - * nil. - * - * File.stat("/dev/fd1").rdev_major #=> 2 - * File.stat("/dev/tty").rdev_major #=> 5 - */ - -static VALUE -rb_stat_rdev_major(self) - VALUE self; -{ -#if defined(HAVE_ST_RDEV) && defined(major) - long rdev = get_stat(self)->st_rdev; - return ULONG2NUM(major(rdev)); -#else - return Qnil; -#endif -} - -/* - * call-seq: - * stat.rdev_minor => fixnum - * - * Returns the minor part of File_Stat#rdev or - * nil. - * - * File.stat("/dev/fd1").rdev_minor #=> 1 - * File.stat("/dev/tty").rdev_minor #=> 0 - */ - -static VALUE -rb_stat_rdev_minor(self) - VALUE self; -{ -#if defined(HAVE_ST_RDEV) && defined(minor) - long rdev = get_stat(self)->st_rdev; - return ULONG2NUM(minor(rdev)); -#else - return Qnil; -#endif -} - -/* - * call-seq: - * stat.size => fixnum - * - * Returns the size of stat in bytes. - * - * File.stat("testfile").size #=> 66 - */ - -static VALUE -rb_stat_size(self) - VALUE self; -{ - return OFFT2NUM(get_stat(self)->st_size); -} - -/* - * call-seq: - * stat.blksize => integer or nil - * - * Returns the native file system's block size. Will return nil - * on platforms that don't support this information. - * - * File.stat("testfile").blksize #=> 4096 - * - */ - -static VALUE -rb_stat_blksize(self) - VALUE self; -{ -#ifdef HAVE_ST_BLKSIZE - return ULONG2NUM(get_stat(self)->st_blksize); -#else - return Qnil; -#endif -} - -/* - * call-seq: - * stat.blocks => integer or nil - * - * Returns the number of native file system blocks allocated for this - * file, or nil if the operating system doesn't - * support this feature. - * - * File.stat("testfile").blocks #=> 2 - */ - -static VALUE -rb_stat_blocks(self) - VALUE self; -{ -#ifdef HAVE_ST_BLOCKS - return ULONG2NUM(get_stat(self)->st_blocks); -#else - return Qnil; -#endif -} - -/* - * call-seq: - * stat.atime => time - * - * Returns the last access time for this file as an object of class - * Time. - * - * File.stat("testfile").atime #=> Wed Dec 31 18:00:00 CST 1969 - * - */ - -static VALUE -rb_stat_atime(self) - VALUE self; -{ - return rb_time_new(get_stat(self)->st_atime, 0); -} - -/* - * call-seq: - * stat.mtime -> aTime - * - * Returns the modification time of stat. - * - * File.stat("testfile").mtime #=> Wed Apr 09 08:53:14 CDT 2003 - * - */ - -static VALUE -rb_stat_mtime(self) - VALUE self; -{ - return rb_time_new(get_stat(self)->st_mtime, 0); -} - -/* - * call-seq: - * stat.ctime -> aTime - * - * Returns the change time for stat (that is, the time - * directory information about the file was changed, not the file - * itself). - * - * File.stat("testfile").ctime #=> Wed Apr 09 08:53:14 CDT 2003 - * - */ - -static VALUE -rb_stat_ctime(self) - VALUE self; -{ - return rb_time_new(get_stat(self)->st_ctime, 0); -} - -/* - * call-seq: - * stat.inspect => string - * - * Produce a nicely formatted description of stat. - * - * File.stat("/etc/passwd").inspect - * #=> "#" - */ - -static VALUE -rb_stat_inspect(self) - VALUE self; -{ - VALUE str; - int i; - static const struct { - const char *name; - VALUE (*func)_((VALUE)); - } member[] = { - {"dev", rb_stat_dev}, - {"ino", rb_stat_ino}, - {"mode", rb_stat_mode}, - {"nlink", rb_stat_nlink}, - {"uid", rb_stat_uid}, - {"gid", rb_stat_gid}, - {"rdev", rb_stat_rdev}, - {"size", rb_stat_size}, - {"blksize", rb_stat_blksize}, - {"blocks", rb_stat_blocks}, - {"atime", rb_stat_atime}, - {"mtime", rb_stat_mtime}, - {"ctime", rb_stat_ctime}, - }; - - str = rb_str_buf_new2("#<"); - rb_str_buf_cat2(str, rb_obj_classname(self)); - rb_str_buf_cat2(str, " "); - - for (i = 0; i < sizeof(member)/sizeof(member[0]); i++) { - VALUE v; - - if (i > 0) { - rb_str_buf_cat2(str, ", "); - } - rb_str_buf_cat2(str, member[i].name); - rb_str_buf_cat2(str, "="); - v = (*member[i].func)(self); - if (i == 2) { /* mode */ - char buf[32]; - - sprintf(buf, "0%lo", NUM2ULONG(v)); - rb_str_buf_cat2(str, buf); - } - else if (i == 0 || i == 6) { /* dev/rdev */ - char buf[32]; - - sprintf(buf, "0x%lx", NUM2ULONG(v)); - rb_str_buf_cat2(str, buf); - } - else { - rb_str_append(str, rb_inspect(v)); - } - } - rb_str_buf_cat2(str, ">"); - OBJ_INFECT(str, self); - - return str; -} - -static int -rb_stat(file, st) - VALUE file; - struct stat *st; -{ - VALUE tmp; - - tmp = rb_check_convert_type(file, T_FILE, "IO", "to_io"); - if (!NIL_P(tmp)) { - OpenFile *fptr; - - rb_secure(2); - GetOpenFile(tmp, fptr); - return fstat(fileno(fptr->f), st); - } - SafeStringValue(file); - return stat(StringValueCStr(file), st); -} - -#ifdef _WIN32 -static HANDLE -w32_io_info(file, st) - VALUE *file; - BY_HANDLE_FILE_INFORMATION *st; -{ - VALUE tmp; - HANDLE f, ret = 0; - - tmp = rb_check_convert_type(*file, T_FILE, "IO", "to_io"); - if (!NIL_P(tmp)) { - OpenFile *fptr; - - GetOpenFile(tmp, fptr); - f = (HANDLE)rb_w32_get_osfhandle(fileno(fptr->f)); - if (f == (HANDLE)-1) return INVALID_HANDLE_VALUE; - } - else { - SafeStringValue(*file); - f = CreateFile(StringValueCStr(*file), 0, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, - rb_w32_iswin95() ? 0 : FILE_FLAG_BACKUP_SEMANTICS, NULL); - if (f == INVALID_HANDLE_VALUE) return f; - ret = f; - } - if (GetFileType(f) == FILE_TYPE_DISK) { - ZeroMemory(st, sizeof(*st)); - if (GetFileInformationByHandle(f, st)) return ret; - } - if (ret) CloseHandle(ret); - return INVALID_HANDLE_VALUE; -} -#endif - -/* - * call-seq: - * File.stat(file_name) => stat - * - * Returns a File::Stat object for the named file (see - * File::Stat). - * - * File.stat("testfile").mtime #=> Tue Apr 08 12:58:04 CDT 2003 - * - */ - -static VALUE -rb_file_s_stat(klass, fname) - VALUE klass, fname; -{ - struct stat st; - - SafeStringValue(fname); - if (rb_stat(fname, &st) < 0) { - rb_sys_fail(StringValueCStr(fname)); - } - return stat_new(&st); -} - -/* - * call-seq: - * ios.stat => stat - * - * Returns status information for ios as an object of type - * File::Stat. - * - * f = File.new("testfile") - * s = f.stat - * "%o" % s.mode #=> "100644" - * s.blksize #=> 4096 - * s.atime #=> Wed Apr 09 08:53:54 CDT 2003 - * - */ - -static VALUE -rb_io_stat(obj) - VALUE obj; -{ - OpenFile *fptr; - struct stat st; - - GetOpenFile(obj, fptr); - if (fstat(fileno(fptr->f), &st) == -1) { - rb_sys_fail(fptr->path); - } - return stat_new(&st); -} - -/* - * call-seq: - * File.lstat(file_name) => stat - * - * Same as File::stat, but does not follow the last symbolic - * link. Instead, reports on the link itself. - * - * File.symlink("testfile", "link2test") #=> 0 - * File.stat("testfile").size #=> 66 - * File.lstat("link2test").size #=> 8 - * File.stat("link2test").size #=> 66 - * - */ - -static VALUE -rb_file_s_lstat(klass, fname) - VALUE klass, fname; -{ -#ifdef HAVE_LSTAT - struct stat st; - - SafeStringValue(fname); - if (lstat(StringValueCStr(fname), &st) == -1) { - rb_sys_fail(RSTRING(fname)->ptr); - } - return stat_new(&st); -#else - return rb_file_s_stat(klass, fname); -#endif -} - -/* - * call-seq: - * file.lstat => stat - * - * Same as IO#stat, but does not follow the last symbolic - * link. Instead, reports on the link itself. - * - * File.symlink("testfile", "link2test") #=> 0 - * File.stat("testfile").size #=> 66 - * f = File.new("link2test") - * f.lstat.size #=> 8 - * f.stat.size #=> 66 - */ - -static VALUE -rb_file_lstat(obj) - VALUE obj; -{ -#ifdef HAVE_LSTAT - OpenFile *fptr; - struct stat st; - - rb_secure(2); - GetOpenFile(obj, fptr); - if (!fptr->path) return Qnil; - if (lstat(fptr->path, &st) == -1) { - rb_sys_fail(fptr->path); - } - return stat_new(&st); -#else - return rb_io_stat(obj); -#endif -} - -#ifndef HAVE_GROUP_MEMBER -static int -group_member(gid) - GETGROUPS_T gid; -{ -#ifndef _WIN32 - if (getgid() == gid || getegid() == gid) - return Qtrue; - -# ifdef HAVE_GETGROUPS -# ifndef NGROUPS -# ifdef NGROUPS_MAX -# define NGROUPS NGROUPS_MAX -# else -# define NGROUPS 32 -# endif -# endif - { - GETGROUPS_T gary[NGROUPS]; - int anum; - - anum = getgroups(NGROUPS, gary); - while (--anum >= 0) - if (gary[anum] == gid) - return Qtrue; - } -# endif -#endif - return Qfalse; -} -#endif - -#ifndef S_IXUGO -# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) -#endif - -#if defined(S_IXGRP) && !defined(_WIN32) && !defined(__CYGWIN__) -#define USE_GETEUID 1 -#endif - -#ifndef HAVE_EACCESS -int -eaccess(path, mode) - const char *path; - int mode; -{ -#ifdef USE_GETEUID - struct stat st; - int euid; - - if (stat(path, &st) < 0) return -1; - - euid = geteuid(); - - if (euid == 0) { - /* Root can read or write any file. */ - if (!(mode & X_OK)) - return 0; - - /* Root can execute any file that has any one of the execute - bits set. */ - if (st.st_mode & S_IXUGO) - return 0; - - return -1; - } - - if (st.st_uid == euid) /* owner */ - mode <<= 6; - else if (group_member(st.st_gid)) - mode <<= 3; - - if ((st.st_mode & mode) == mode) return 0; - - return -1; -#else -# if _MSC_VER >= 1400 - mode &= 6; -# endif - return access(path, mode); -#endif -} -#endif - - -/* - * Document-class: FileTest - * - * FileTest implements file test operations similar to - * those used in File::Stat. It exists as a standalone - * module, and its methods are also insinuated into the File - * class. (Note that this is not done by inclusion: the interpreter cheats). - * - */ - -/* - * call-seq: - * File.directory?(file_name) => true or false - * - * Returns true if the named file is a directory, - * false otherwise. - * - * File.directory?(".") - */ - -static VALUE -test_d(obj, fname) - VALUE obj, fname; -{ -#ifndef S_ISDIR -# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR) -#endif - - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qfalse; - if (S_ISDIR(st.st_mode)) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * File.pipe?(file_name) => true or false - * - * Returns true if the named file is a pipe. - */ - -static VALUE -test_p(obj, fname) - VALUE obj, fname; -{ -#ifdef S_IFIFO -# ifndef S_ISFIFO -# define S_ISFIFO(m) ((m & S_IFMT) == S_IFIFO) -# endif - - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qfalse; - if (S_ISFIFO(st.st_mode)) return Qtrue; - -#endif - return Qfalse; -} - -/* - * call-seq: - * File.symlink?(file_name) => true or false - * - * Returns true if the named file is a symbolic link. - */ - -static VALUE -test_l(obj, fname) - VALUE obj, fname; -{ -#ifndef S_ISLNK -# ifdef _S_ISLNK -# define S_ISLNK(m) _S_ISLNK(m) -# elif defined __BORLANDC__ -# ifdef _S_IFLNK -# define S_ISLNK(m) (((unsigned short)(m) & S_IFMT) == _S_IFLNK) -# else -# ifdef S_IFLNK -# define S_ISLNK(m) (((unsigned short)(m) & S_IFMT) == S_IFLNK) -# endif -# endif -# else -# ifdef _S_IFLNK -# define S_ISLNK(m) ((m & S_IFMT) == _S_IFLNK) -# else -# ifdef S_IFLNK -# define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK) -# endif -# endif -# endif -#endif - -#ifdef S_ISLNK - struct stat st; - - SafeStringValue(fname); - if (lstat(StringValueCStr(fname), &st) < 0) return Qfalse; - if (S_ISLNK(st.st_mode)) return Qtrue; -#endif - - return Qfalse; -} - -/* - * call-seq: - * File.socket?(file_name) => true or false - * - * Returns true if the named file is a socket. - */ - -static VALUE -test_S(obj, fname) - VALUE obj, fname; -{ -#ifndef S_ISSOCK -# ifdef _S_ISSOCK -# define S_ISSOCK(m) _S_ISSOCK(m) -# elif defined __BORLANDC__ -# ifdef _S_IFSOCK -# define S_ISSOCK(m) (((unsigned short)(m) & S_IFMT) == _S_IFSOCK) -# else -# ifdef S_IFSOCK -# define S_ISSOCK(m) (((unsigned short)(m) & S_IFMT) == S_IFSOCK) -# endif -# endif -# else -# ifdef _S_IFSOCK -# define S_ISSOCK(m) ((m & S_IFMT) == _S_IFSOCK) -# else -# ifdef S_IFSOCK -# define S_ISSOCK(m) ((m & S_IFMT) == S_IFSOCK) -# endif -# endif -# endif -#endif - -#ifdef S_ISSOCK - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qfalse; - if (S_ISSOCK(st.st_mode)) return Qtrue; - -#endif - return Qfalse; -} - -/* - * call-seq: - * File.blockdev?(file_name) => true or false - * - * Returns true if the named file is a block device. - */ - -static VALUE -test_b(obj, fname) - VALUE obj, fname; -{ -#ifndef S_ISBLK -# ifdef S_IFBLK -# define S_ISBLK(m) ((m & S_IFMT) == S_IFBLK) -# else -# define S_ISBLK(m) (0) /* anytime false */ -# endif -#endif - -#ifdef S_ISBLK - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qfalse; - if (S_ISBLK(st.st_mode)) return Qtrue; - -#endif - return Qfalse; -} - -/* - * call-seq: - * File.chardev?(file_name) => true or false - * - * Returns true if the named file is a character device. - */ -static VALUE -test_c(obj, fname) - VALUE obj, fname; -{ -#ifndef S_ISCHR -# define S_ISCHR(m) ((m & S_IFMT) == S_IFCHR) -#endif - - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qfalse; - if (S_ISCHR(st.st_mode)) return Qtrue; - - return Qfalse; -} - -/* - * call-seq: - * File.exist?(file_name) => true or false - * File.exists?(file_name) => true or false (obsolete) - * - * Return true if the named file exists. - */ - -static VALUE -test_e(obj, fname) - VALUE obj, fname; -{ - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qfalse; - return Qtrue; -} - -/* - * call-seq: - * File.readable?(file_name) => true or false - * - * Returns true if the named file is readable by the effective - * user id of this process. - */ - -static VALUE -test_r(obj, fname) - VALUE obj, fname; -{ - SafeStringValue(fname); - if (eaccess(StringValueCStr(fname), R_OK) < 0) return Qfalse; - return Qtrue; -} - -/* - * call-seq: - * File.readable_real?(file_name) => true or false - * - * Returns true if the named file is readable by the real - * user id of this process. - */ - -static VALUE -test_R(obj, fname) - VALUE obj, fname; -{ - SafeStringValue(fname); - if (access(StringValueCStr(fname), R_OK) < 0) return Qfalse; - return Qtrue; -} - -/* - * call-seq: - * File.writable?(file_name) => true or false - * - * Returns true if the named file is writable by the effective - * user id of this process. - */ - -static VALUE -test_w(obj, fname) - VALUE obj, fname; -{ - SafeStringValue(fname); - if (eaccess(StringValueCStr(fname), W_OK) < 0) return Qfalse; - return Qtrue; -} - -/* - * call-seq: - * File.writable_real?(file_name) => true or false - * - * Returns true if the named file is writable by the real - * user id of this process. - */ - -static VALUE -test_W(obj, fname) - VALUE obj, fname; -{ - SafeStringValue(fname); - if (access(StringValueCStr(fname), W_OK) < 0) return Qfalse; - return Qtrue; -} - -/* - * call-seq: - * File.executable?(file_name) => true or false - * - * Returns true if the named file is executable by the effective - * user id of this process. - */ - -static VALUE -test_x(obj, fname) - VALUE obj, fname; -{ - SafeStringValue(fname); - if (eaccess(StringValueCStr(fname), X_OK) < 0) return Qfalse; - return Qtrue; -} - -/* - * call-seq: - * File.executable_real?(file_name) => true or false - * - * Returns true if the named file is executable by the real - * user id of this process. - */ - -static VALUE -test_X(obj, fname) - VALUE obj, fname; -{ - SafeStringValue(fname); - if (access(StringValueCStr(fname), X_OK) < 0) return Qfalse; - return Qtrue; -} - -#ifndef S_ISREG -# define S_ISREG(m) ((m & S_IFMT) == S_IFREG) -#endif - -/* - * call-seq: - * File.file?(file_name) => true or false - * - * Returns true if the named file exists and is a - * regular file. - */ - -static VALUE -test_f(obj, fname) - VALUE obj, fname; -{ - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qfalse; - if (S_ISREG(st.st_mode)) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * File.zero?(file_name) => true or false - * - * Returns true if the named file exists and has - * a zero size. - */ - -static VALUE -test_z(obj, fname) - VALUE obj, fname; -{ - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qfalse; - if (st.st_size == 0) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * File.size?(file_name) => Integer or nil - * - * Returns +nil+ if +file_name+ doesn't exist or has zero size, the size of the - * file otherwise. - */ - -static VALUE -test_s(obj, fname) - VALUE obj, fname; -{ - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qnil; - if (st.st_size == 0) return Qnil; - return OFFT2NUM(st.st_size); -} - -/* - * call-seq: - * File.owned?(file_name) => true or false - * - * Returns true if the named file exists and the - * effective used id of the calling process is the owner of - * the file. - */ - -static VALUE -test_owned(obj, fname) - VALUE obj, fname; -{ - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qfalse; - if (st.st_uid == geteuid()) return Qtrue; - return Qfalse; -} - -static VALUE -test_rowned(obj, fname) - VALUE obj, fname; -{ - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qfalse; - if (st.st_uid == getuid()) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * File.grpowned?(file_name) => true or false - * - * Returns true if the named file exists and the - * effective group id of the calling process is the owner of - * the file. Returns false on Windows. - */ - -static VALUE -test_grpowned(obj, fname) - VALUE obj, fname; -{ -#ifndef _WIN32 - struct stat st; - - if (rb_stat(fname, &st) < 0) return Qfalse; - if (group_member(st.st_gid)) return Qtrue; -#endif - return Qfalse; -} - -#if defined(S_ISUID) || defined(S_ISGID) || defined(S_ISVTX) -static VALUE -check3rdbyte(fname, mode) - VALUE fname; - int mode; -{ - struct stat st; - - SafeStringValue(fname); - if (stat(StringValueCStr(fname), &st) < 0) return Qfalse; - if (st.st_mode & mode) return Qtrue; - return Qfalse; -} -#endif - -/* - * call-seq: - * File.setuid?(file_name) => true or false - * - * Returns true if the named file has the setuid bit set. - */ - -static VALUE -test_suid(obj, fname) - VALUE obj, fname; -{ -#ifdef S_ISUID - return check3rdbyte(fname, S_ISUID); -#else - return Qfalse; -#endif -} - -/* - * call-seq: - * File.setgid?(file_name) => true or false - * - * Returns true if the named file has the setgid bit set. - */ - -static VALUE -test_sgid(obj, fname) - VALUE obj, fname; -{ -#ifdef S_ISGID - return check3rdbyte(fname, S_ISGID); -#else - return Qfalse; -#endif -} - -/* - * call-seq: - * File.sticky?(file_name) => true or false - * - * Returns true if the named file has the sticky bit set. - */ - -static VALUE -test_sticky(obj, fname) - VALUE obj, fname; -{ -#ifdef S_ISVTX - return check3rdbyte(fname, S_ISVTX); -#else - return Qnil; -#endif -} - -/* - * call-seq: - * File.identical?(file_1, file_2) => true or false - * - * Returns true if the named files are identical. - * - * open("a", "w") {} - * p File.identical?("a", "a") #=> true - * p File.identical?("a", "./a") #=> true - * File.link("a", "b") - * p File.identical?("a", "b") #=> true - * File.symlink("a", "c") - * p File.identical?("a", "c") #=> true - * open("d", "w") {} - * p File.identical?("a", "d") #=> false - */ - -static VALUE -test_identical(obj, fname1, fname2) - VALUE obj, fname1, fname2; -{ -#ifndef DOSISH - struct stat st1, st2; - - if (rb_stat(fname1, &st1) < 0) return Qfalse; - if (rb_stat(fname2, &st2) < 0) return Qfalse; - if (st1.st_dev != st2.st_dev) return Qfalse; - if (st1.st_ino != st2.st_ino) return Qfalse; -#else -#ifdef _WIN32 - BY_HANDLE_FILE_INFORMATION st1, st2; - HANDLE f1 = 0, f2 = 0; -#endif - - rb_secure(2); -#ifdef _WIN32 - f1 = w32_io_info(&fname1, &st1); - if (f1 == INVALID_HANDLE_VALUE) return Qfalse; - f2 = w32_io_info(&fname2, &st2); - if (f1) CloseHandle(f1); - if (f2 == INVALID_HANDLE_VALUE) return Qfalse; - if (f2) CloseHandle(f2); - - if (st1.dwVolumeSerialNumber == st2.dwVolumeSerialNumber && - st1.nFileIndexHigh == st2.nFileIndexHigh && - st1.nFileIndexLow == st2.nFileIndexLow) - return Qtrue; - if (!f1 || !f2) return Qfalse; - if (rb_w32_iswin95()) return Qfalse; -#else - SafeStringValue(fname1); - fname1 = rb_str_new4(fname1); - SafeStringValue(fname2); - if (access(RSTRING(fname1)->ptr, 0)) return Qfalse; - if (access(RSTRING(fname2)->ptr, 0)) return Qfalse; -#endif - fname1 = rb_file_expand_path(fname1, Qnil); - fname2 = rb_file_expand_path(fname2, Qnil); - if (RSTRING(fname1)->len != RSTRING(fname2)->len) return Qfalse; - if (rb_memcicmp(RSTRING(fname1)->ptr, RSTRING(fname2)->ptr, RSTRING(fname1)->len)) - return Qfalse; -#endif - return Qtrue; -} - -/* - * call-seq: - * File.size(file_name) => integer - * - * Returns the size of file_name. - */ - -static VALUE -rb_file_s_size(klass, fname) - VALUE klass, fname; -{ - struct stat st; - - if (rb_stat(fname, &st) < 0) - rb_sys_fail(StringValueCStr(fname)); - return OFFT2NUM(st.st_size); -} - -static VALUE -rb_file_ftype(st) - struct stat *st; -{ - char *t; - - if (S_ISREG(st->st_mode)) { - t = "file"; - } - else if (S_ISDIR(st->st_mode)) { - t = "directory"; - } - else if (S_ISCHR(st->st_mode)) { - t = "characterSpecial"; - } -#ifdef S_ISBLK - else if (S_ISBLK(st->st_mode)) { - t = "blockSpecial"; - } -#endif -#ifdef S_ISFIFO - else if (S_ISFIFO(st->st_mode)) { - t = "fifo"; - } -#endif -#ifdef S_ISLNK - else if (S_ISLNK(st->st_mode)) { - t = "link"; - } -#endif -#ifdef S_ISSOCK - else if (S_ISSOCK(st->st_mode)) { - t = "socket"; - } -#endif - else { - t = "unknown"; - } - - return rb_str_new2(t); -} - -/* - * call-seq: - * File.ftype(file_name) => string - * - * Identifies the type of the named file; the return string is one of - * ``file'', ``directory'', - * ``characterSpecial'', ``blockSpecial'', - * ``fifo'', ``link'', - * ``socket'', or ``unknown''. - * - * File.ftype("testfile") #=> "file" - * File.ftype("/dev/tty") #=> "characterSpecial" - * File.ftype("/tmp/.X11-unix/X0") #=> "socket" - */ - -static VALUE -rb_file_s_ftype(klass, fname) - VALUE klass, fname; -{ - struct stat st; - - SafeStringValue(fname); - if (lstat(StringValueCStr(fname), &st) == -1) { - rb_sys_fail(RSTRING(fname)->ptr); - } - - return rb_file_ftype(&st); -} - -/* - * call-seq: - * File.atime(file_name) => time - * - * Returns the last access time for the named file as a Time object). - * - * File.atime("testfile") #=> Wed Apr 09 08:51:48 CDT 2003 - * - */ - -static VALUE -rb_file_s_atime(klass, fname) - VALUE klass, fname; -{ - struct stat st; - - if (rb_stat(fname, &st) < 0) - rb_sys_fail(StringValueCStr(fname)); - return rb_time_new(st.st_atime, 0); -} - -/* - * call-seq: - * file.atime => time - * - * Returns the last access time (a Time object) - * for file, or epoch if file has not been accessed. - * - * File.new("testfile").atime #=> Wed Dec 31 18:00:00 CST 1969 - * - */ - -static VALUE -rb_file_atime(obj) - VALUE obj; -{ - OpenFile *fptr; - struct stat st; - - GetOpenFile(obj, fptr); - if (fstat(fileno(fptr->f), &st) == -1) { - rb_sys_fail(fptr->path); - } - return rb_time_new(st.st_atime, 0); -} - -/* - * call-seq: - * File.mtime(file_name) => time - * - * Returns the modification time for the named file as a Time object. - * - * File.mtime("testfile") #=> Tue Apr 08 12:58:04 CDT 2003 - * - */ - -static VALUE -rb_file_s_mtime(klass, fname) - VALUE klass, fname; -{ - struct stat st; - - if (rb_stat(fname, &st) < 0) - rb_sys_fail(RSTRING(fname)->ptr); - return rb_time_new(st.st_mtime, 0); -} - -/* - * call-seq: - * file.mtime -> time - * - * Returns the modification time for file. - * - * File.new("testfile").mtime #=> Wed Apr 09 08:53:14 CDT 2003 - * - */ - -static VALUE -rb_file_mtime(obj) - VALUE obj; -{ - OpenFile *fptr; - struct stat st; - - GetOpenFile(obj, fptr); - if (fstat(fileno(fptr->f), &st) == -1) { - rb_sys_fail(fptr->path); - } - return rb_time_new(st.st_mtime, 0); -} - -/* - * call-seq: - * File.ctime(file_name) => time - * - * Returns the change time for the named file (the time at which - * directory information about the file was changed, not the file - * itself). - * - * File.ctime("testfile") #=> Wed Apr 09 08:53:13 CDT 2003 - * - */ - -static VALUE -rb_file_s_ctime(klass, fname) - VALUE klass, fname; -{ - struct stat st; - - if (rb_stat(fname, &st) < 0) - rb_sys_fail(RSTRING(fname)->ptr); - return rb_time_new(st.st_ctime, 0); -} - -/* - * call-seq: - * file.ctime -> time - * - * Returns the change time for file (that is, the time directory - * information about the file was changed, not the file itself). - * - * File.new("testfile").ctime #=> Wed Apr 09 08:53:14 CDT 2003 - * - */ - -static VALUE -rb_file_ctime(obj) - VALUE obj; -{ - OpenFile *fptr; - struct stat st; - - GetOpenFile(obj, fptr); - if (fstat(fileno(fptr->f), &st) == -1) { - rb_sys_fail(fptr->path); - } - return rb_time_new(st.st_ctime, 0); -} - -static void chmod_internal _((const char *, void *)); -static void -chmod_internal(path, mode) - const char *path; - void *mode; -{ - if (chmod(path, *(int *)mode) < 0) - rb_sys_fail(path); -} - -/* - * call-seq: - * File.chmod(mode_int, file_name, ... ) -> integer - * - * Changes permission bits on the named file(s) to the bit pattern - * represented by mode_int. Actual effects are operating system - * dependent (see the beginning of this section). On Unix systems, see - * chmod(2) for details. Returns the number of files - * processed. - * - * File.chmod(0644, "testfile", "out") #=> 2 - */ - -static VALUE -rb_file_s_chmod(argc, argv) - int argc; - VALUE *argv; -{ - VALUE vmode; - VALUE rest; - int mode; - long n; - - rb_secure(2); - rb_scan_args(argc, argv, "1*", &vmode, &rest); - mode = NUM2INT(vmode); - - n = apply2files(chmod_internal, rest, &mode); - return LONG2FIX(n); -} - -/* - * call-seq: - * file.chmod(mode_int) => 0 - * - * Changes permission bits on file to the bit pattern - * represented by mode_int. Actual effects are platform - * dependent; on Unix systems, see chmod(2) for details. - * Follows symbolic links. Also see File#lchmod. - * - * f = File.new("out", "w"); - * f.chmod(0644) #=> 0 - */ - -static VALUE -rb_file_chmod(obj, vmode) - VALUE obj, vmode; -{ - OpenFile *fptr; - int mode; - - rb_secure(2); - mode = NUM2INT(vmode); - - GetOpenFile(obj, fptr); -#ifdef HAVE_FCHMOD - if (fchmod(fileno(fptr->f), mode) == -1) - rb_sys_fail(fptr->path); -#else - if (!fptr->path) return Qnil; - if (chmod(fptr->path, mode) == -1) - rb_sys_fail(fptr->path); -#endif - - return INT2FIX(0); -} - -#if defined(HAVE_LCHMOD) -static void lchmod_internal _((const char *, void *)); -static void -lchmod_internal(path, mode) - const char *path; - void *mode; -{ - if (lchmod(path, (int)mode) < 0) - rb_sys_fail(path); -} - -/* - * call-seq: - * File.lchmod(mode_int, file_name, ...) => integer - * - * Equivalent to File::chmod, but does not follow symbolic - * links (so it will change the permissions associated with the link, - * not the file referenced by the link). Often not available. - * - */ - -static VALUE -rb_file_s_lchmod(argc, argv) - int argc; - VALUE *argv; -{ - VALUE vmode; - VALUE rest; - long mode, n; - - rb_secure(2); - rb_scan_args(argc, argv, "1*", &vmode, &rest); - mode = NUM2INT(vmode); - - n = apply2files(lchmod_internal, rest, (void *)(long)mode); - return LONG2FIX(n); -} -#else -static VALUE -rb_file_s_lchmod(argc, argv) - int argc; - VALUE *argv; -{ - rb_notimplement(); - return Qnil; /* not reached */ -} -#endif - -struct chown_args { - int owner, group; -}; - -static void chown_internal _((const char *, void *)); -static void -chown_internal(path, argp) - const char *path; - void *argp; -{ - struct chown_args *args = (struct chown_args *)argp; - if (chown(path, args->owner, args->group) < 0) - rb_sys_fail(path); -} - -/* - * call-seq: - * File.chown(owner_int, group_int, file_name,... ) -> integer - * - * Changes the owner and group of the named file(s) to the given - * numeric owner and group id's. Only a process with superuser - * privileges may change the owner of a file. The current owner of a - * file may change the file's group to any group to which the owner - * belongs. A nil or -1 owner or group id is ignored. - * Returns the number of files processed. - * - * File.chown(nil, 100, "testfile") - * - */ - -static VALUE -rb_file_s_chown(argc, argv) - int argc; - VALUE *argv; -{ - VALUE o, g, rest; - struct chown_args arg; - long n; - - rb_secure(2); - rb_scan_args(argc, argv, "2*", &o, &g, &rest); - if (NIL_P(o)) { - arg.owner = -1; - } - else { - arg.owner = NUM2INT(o); - } - if (NIL_P(g)) { - arg.group = -1; - } - else { - arg.group = NUM2INT(g); - } - - n = apply2files(chown_internal, rest, &arg); - return LONG2FIX(n); -} - -/* - * call-seq: - * file.chown(owner_int, group_int ) => 0 - * - * Changes the owner and group of file to the given numeric - * owner and group id's. Only a process with superuser privileges may - * change the owner of a file. The current owner of a file may change - * the file's group to any group to which the owner belongs. A - * nil or -1 owner or group id is ignored. Follows - * symbolic links. See also File#lchown. - * - * File.new("testfile").chown(502, 1000) - * - */ - -static VALUE -rb_file_chown(obj, owner, group) - VALUE obj, owner, group; -{ - OpenFile *fptr; - int o, g; - - rb_secure(2); - o = NIL_P(owner) ? -1 : NUM2INT(owner); - g = NIL_P(group) ? -1 : NUM2INT(group); - GetOpenFile(obj, fptr); -#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32) || defined(__EMX__) - if (!fptr->path) return Qnil; - if (chown(fptr->path, o, g) == -1) - rb_sys_fail(fptr->path); -#else - if (fchown(fileno(fptr->f), o, g) == -1) - rb_sys_fail(fptr->path); -#endif - - return INT2FIX(0); -} - -#if defined(HAVE_LCHOWN) && !defined(__CHECKER__) -static void lchown_internal _((const char *, void *)); -static void -lchown_internal(path, argp) - const char *path; - void *argp; -{ - struct chown_args *args = (struct chown_args *)argp; - if (lchown(path, args->owner, args->group) < 0) - rb_sys_fail(path); -} - -/* - * call-seq: - * file.lchown(owner_int, group_int, file_name,..) => integer - * - * Equivalent to File::chown, but does not follow symbolic - * links (so it will change the owner associated with the link, not the - * file referenced by the link). Often not available. Returns number - * of files in the argument list. - * - */ - -static VALUE -rb_file_s_lchown(argc, argv) - int argc; - VALUE *argv; -{ - VALUE o, g, rest; - struct chown_args arg; - long n; - - rb_secure(2); - rb_scan_args(argc, argv, "2*", &o, &g, &rest); - if (NIL_P(o)) { - arg.owner = -1; - } - else { - arg.owner = NUM2INT(o); - } - if (NIL_P(g)) { - arg.group = -1; - } - else { - arg.group = NUM2INT(g); - } - - n = apply2files(lchown_internal, rest, &arg); - return LONG2FIX(n); -} -#else -static VALUE -rb_file_s_lchown(argc, argv) - int argc; - VALUE *argv; -{ - rb_notimplement(); -} -#endif - -struct timeval rb_time_timeval(); - -static void utime_internal _((const char *, void *)); - -#if defined(HAVE_UTIMES) && !defined(__CHECKER__) - -static void -utime_internal(path, arg) - const char *path; - void *arg; -{ - struct timeval *tvp = arg; - if (utimes(path, tvp) < 0) - rb_sys_fail(path); -} - -/* - * call-seq: - * File.utime(atime, mtime, file_name,...) => integer - * - * Sets the access and modification times of each - * named file to the first two arguments. Returns - * the number of file names in the argument list. - */ - -static VALUE -rb_file_s_utime(argc, argv) - int argc; - VALUE *argv; -{ - VALUE atime, mtime, rest; - struct timeval tvs[2], *tvp = NULL; - long n; - - rb_scan_args(argc, argv, "2*", &atime, &mtime, &rest); - - if (!NIL_P(atime) || !NIL_P(mtime)) { - tvp = tvs; - tvp[0] = rb_time_timeval(atime); - tvp[1] = rb_time_timeval(mtime); - } - - n = apply2files(utime_internal, rest, tvp); - return LONG2FIX(n); -} - -#else - -#if !defined HAVE_UTIME_H && !defined HAVE_SYS_UTIME_H -struct utimbuf { - long actime; - long modtime; -}; -#endif - -static void -utime_internal(path, arg) - const char *path; - void *arg; -{ - struct utimbuf *utp = arg; - if (utime(path, utp) < 0) - rb_sys_fail(path); -} - -static VALUE -rb_file_s_utime(argc, argv) - int argc; - VALUE *argv; -{ - VALUE atime, mtime, rest; - long n; - struct timeval tv; - struct utimbuf utbuf, *utp = NULL; - - rb_scan_args(argc, argv, "2*", &atime, &mtime, &rest); - - if (!NIL_P(atime) || !NIL_P(mtime)) { - utp = &utbuf; - tv = rb_time_timeval(atime); - utp->actime = tv.tv_sec; - tv = rb_time_timeval(mtime); - utp->modtime = tv.tv_sec; - } - - n = apply2files(utime_internal, rest, utp); - return LONG2FIX(n); -} - -#endif - -NORETURN(static void sys_fail2 _((VALUE,VALUE))); -static void -sys_fail2(s1, s2) - VALUE s1, s2; -{ - char *buf; - int len; - - len = RSTRING(s1)->len + RSTRING(s2)->len + 5; - buf = ALLOCA_N(char, len); - snprintf(buf, len, "%s or %s", RSTRING(s1)->ptr, RSTRING(s2)->ptr); - rb_sys_fail(buf); -} - -/* - * call-seq: - * File.link(old_name, new_name) => 0 - * - * Creates a new name for an existing file using a hard link. Will not - * overwrite new_name if it already exists (raising a subclass - * of SystemCallError). Not available on all platforms. - * - * File.link("testfile", ".testfile") #=> 0 - * IO.readlines(".testfile")[0] #=> "This is line one\n" - */ - -static VALUE -rb_file_s_link(klass, from, to) - VALUE klass, from, to; -{ -#ifdef HAVE_LINK - SafeStringValue(from); - SafeStringValue(to); - - if (link(StringValueCStr(from), StringValueCStr(to)) < 0) { - sys_fail2(from, to); - } - return INT2FIX(0); -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif -} - -/* - * call-seq: - * File.symlink(old_name, new_name) => 0 - * - * Creates a symbolic link called new_name for the existing file - * old_name. Raises a NotImplemented exception on - * platforms that do not support symbolic links. - * - * File.symlink("testfile", "link2test") #=> 0 - * - */ - -static VALUE -rb_file_s_symlink(klass, from, to) - VALUE klass, from, to; -{ -#ifdef HAVE_SYMLINK - SafeStringValue(from); - SafeStringValue(to); - - if (symlink(StringValueCStr(from), StringValueCStr(to)) < 0) { - sys_fail2(from, to); - } - return INT2FIX(0); -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif -} - -/* - * call-seq: - * File.readlink(link_name) -> file_name - * - * Returns the name of the file referenced by the given link. - * Not available on all platforms. - * - * File.symlink("testfile", "link2test") #=> 0 - * File.readlink("link2test") #=> "testfile" - */ - -static VALUE -rb_file_s_readlink(klass, path) - VALUE klass, path; -{ -#ifdef HAVE_READLINK - char *buf; - int size = 100; - int rv; - VALUE v; - - SafeStringValue(path); - buf = xmalloc(size); - while ((rv = readlink(RSTRING(path)->ptr, buf, size)) == size -#ifdef _AIX - || (rv < 0 && errno == ERANGE) /* quirky behavior of GPFS */ -#endif - ) { - size *= 2; - buf = xrealloc(buf, size); - } - if (rv < 0) { - free(buf); - rb_sys_fail(RSTRING(path)->ptr); - } - v = rb_tainted_str_new(buf, rv); - free(buf); - - return v; -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif -} - -static void unlink_internal _((const char *, void *)); -static void -unlink_internal(path, arg) - const char *path; - void *arg; -{ - if (unlink(path) < 0) - rb_sys_fail(path); -} - -/* - * call-seq: - * File.delete(file_name, ...) => integer - * File.unlink(file_name, ...) => integer - * - * Deletes the named files, returning the number of names - * passed as arguments. Raises an exception on any error. - * See also Dir::rmdir. - */ - -static VALUE -rb_file_s_unlink(klass, args) - VALUE klass, args; -{ - long n; - - rb_secure(2); - n = apply2files(unlink_internal, args, 0); - return LONG2FIX(n); -} - -/* - * call-seq: - * File.rename(old_name, new_name) => 0 - * - * Renames the given file to the new name. Raises a - * SystemCallError if the file cannot be renamed. - * - * File.rename("afile", "afile.bak") #=> 0 - */ - -static VALUE -rb_file_s_rename(klass, from, to) - VALUE klass, from, to; -{ - const char *src, *dst; - SafeStringValue(from); - SafeStringValue(to); - - src = StringValueCStr(from); - dst = StringValueCStr(to); -#if defined __CYGWIN__ - errno = 0; -#endif - if (rename(src, dst) < 0) { -#if defined DOSISH && !defined _WIN32 - switch (errno) { - case EEXIST: -#if defined (__EMX__) - case EACCES: -#endif - if (chmod(dst, 0666) == 0 && - unlink(dst) == 0 && - rename(src, dst) == 0) - return INT2FIX(0); - } -#endif - sys_fail2(from, to); - } - - return INT2FIX(0); -} - -/* - * call-seq: - * File.umask() => integer - * File.umask(integer) => integer - * - * Returns the current umask value for this process. If the optional - * argument is given, set the umask to that value and return the - * previous value. Umask values are subtracted from the - * default permissions, so a umask of 0222 would make a - * file read-only for everyone. - * - * File.umask(0006) #=> 18 - * File.umask #=> 6 - */ - -static VALUE -rb_file_s_umask(argc, argv) - int argc; - VALUE *argv; -{ - int omask = 0; - - rb_secure(2); - if (argc == 0) { - omask = umask(0); - umask(omask); - } - else if (argc == 1) { - omask = umask(NUM2INT(argv[0])); - } - else { - rb_raise(rb_eArgError, "wrong number of arguments"); - } - return INT2FIX(omask); -} - -#ifdef __CYGWIN__ -#undef DOSISH -#endif -#if defined __CYGWIN__ || defined DOSISH -#define DOSISH_UNC -#define DOSISH_DRIVE_LETTER -#define isdirsep(x) ((x) == '/' || (x) == '\\') -#else -#define isdirsep(x) ((x) == '/') -#endif - -#if defined _WIN32 || defined __CYGWIN__ -#define USE_NTFS 1 -#else -#define USE_NTFS 0 -#endif - -#if USE_NTFS -#define istrailinggabage(x) ((x) == '.' || (x) == ' ') -#else -#define istrailinggabage(x) 0 -#endif - -#ifndef CharNext /* defined as CharNext[AW] on Windows. */ -# if defined(DJGPP) -# define CharNext(p) ((p) + mblen(p, MB_CUR_MAX)) -# else -# define CharNext(p) ((p) + 1) -# endif -#endif - -#ifdef DOSISH_DRIVE_LETTER -static inline int -has_drive_letter(buf) - const char *buf; -{ - if (ISALPHA(buf[0]) && buf[1] == ':') { - return 1; - } - else { - return 0; - } -} - -static char* -getcwdofdrv(drv) - int drv; -{ - char drive[4]; - char *drvcwd, *oldcwd; - - drive[0] = drv; - drive[1] = ':'; - drive[2] = '\0'; - - /* the only way that I know to get the current directory - of a particular drive is to change chdir() to that drive, - so save the old cwd before chdir() - */ - oldcwd = my_getcwd(); - if (chdir(drive) == 0) { - drvcwd = my_getcwd(); - chdir(oldcwd); - free(oldcwd); - } - else { - /* perhaps the drive is not exist. we return only drive letter */ - drvcwd = strdup(drive); - } - return drvcwd; -} -#endif - -static inline char * -skiproot(path) - const char *path; -{ -#ifdef DOSISH_DRIVE_LETTER - if (has_drive_letter(path)) path += 2; -#endif - while (isdirsep(*path)) path++; - return (char *)path; -} - -#define nextdirsep rb_path_next -char * -rb_path_next(s) - const char *s; -{ - while (*s && !isdirsep(*s)) { - s = CharNext(s); - } - return (char *)s; -} - -#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER) -#define skipprefix rb_path_skip_prefix -#else -#define skipprefix(path) (path) -#endif -char * -rb_path_skip_prefix(path) - const char *path; -{ -#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER) -#ifdef DOSISH_UNC - if (isdirsep(path[0]) && isdirsep(path[1])) { - path += 2; - while (isdirsep(*path)) path++; - if (*(path = nextdirsep(path)) && path[1] && !isdirsep(path[1])) - path = nextdirsep(path + 1); - return (char *)path; - } -#endif -#ifdef DOSISH_DRIVE_LETTER - if (has_drive_letter(path)) - return (char *)(path + 2); -#endif -#endif - return (char *)path; -} - -#define strrdirsep rb_path_last_separator -char * -rb_path_last_separator(path) - const char *path; -{ - char *last = NULL; - while (*path) { - if (isdirsep(*path)) { - const char *tmp = path++; - while (isdirsep(*path)) path++; - if (!*path) break; - last = (char *)tmp; - } - else { - path = CharNext(path); - } - } - return last; -} - -static char * -chompdirsep(path) - const char *path; -{ - while (*path) { - if (isdirsep(*path)) { - const char *last = path++; - while (isdirsep(*path)) path++; - if (!*path) return (char *)last; - } - else { - path = CharNext(path); - } - } - return (char *)path; -} - -char * -rb_path_end(path) - const char *path; -{ - if (isdirsep(*path)) path++; - return chompdirsep(path); -} - -#if USE_NTFS -static char * -ntfs_tail(const char *path) -{ - while (*path == '.') path++; - while (*path && *path != ':') { - if (istrailinggabage(*path)) { - const char *last = path++; - while (istrailinggabage(*path)) path++; - if (!*path || *path == ':') return (char *)last; - } - else if (isdirsep(*path)) { - const char *last = path++; - while (isdirsep(*path)) path++; - if (!*path) return (char *)last; - if (*path == ':') path++; - } - else { - path = CharNext(path); - } - } - return (char *)path; -} -#endif - -#define BUFCHECK(cond) do {\ - long bdiff = p - buf;\ - if (cond) {\ - do {buflen *= 2;} while (cond);\ - rb_str_resize(result, buflen);\ - buf = RSTRING(result)->ptr;\ - p = buf + bdiff;\ - pend = buf + buflen;\ - }\ -} while (0) - -#define BUFINIT() (\ - p = buf = RSTRING(result)->ptr,\ - buflen = RSTRING(result)->len,\ - pend = p + buflen) - -#if !defined(TOLOWER) -#define TOLOWER(c) (ISUPPER(c) ? tolower(c) : (c)) -#endif - -static int is_absolute_path _((const char*)); - -static VALUE -file_expand_path(fname, dname, result) - VALUE fname, dname, result; -{ - const char *s, *b; - char *buf, *p, *pend, *root; - long buflen, dirlen; - int tainted; - - s = StringValuePtr(fname); - BUFINIT(); - tainted = OBJ_TAINTED(fname); - - if (s[0] == '~') { - if (isdirsep(s[1]) || s[1] == '\0') { - char *dir = getenv("HOME"); - - if (!dir) { - rb_raise(rb_eArgError, "couldn't find HOME environment -- expanding `%s'", s); - } - dirlen = strlen(dir); - BUFCHECK(dirlen > buflen); - strcpy(buf, dir); -#if defined DOSISH || defined __CYGWIN__ - for (p = buf; *p; p = CharNext(p)) { - if (*p == '\\') { - *p = '/'; - } - } -#else - p = buf + strlen(dir); -#endif - s++; - tainted = 1; - } - else { -#ifdef HAVE_PWD_H - struct passwd *pwPtr; - s++; -#endif - s = nextdirsep(b = s); - BUFCHECK(bdiff + (s-b) >= buflen); - memcpy(p, b, s-b); - p += s-b; - *p = '\0'; -#ifdef HAVE_PWD_H - pwPtr = getpwnam(buf); - if (!pwPtr) { - endpwent(); - rb_raise(rb_eArgError, "user %s doesn't exist", buf); - } - dirlen = strlen(pwPtr->pw_dir); - BUFCHECK(dirlen > buflen); - strcpy(buf, pwPtr->pw_dir); - p = buf + strlen(pwPtr->pw_dir); - endpwent(); -#endif - } - } -#ifdef DOSISH_DRIVE_LETTER - /* skip drive letter */ - else if (has_drive_letter(s)) { - if (isdirsep(s[2])) { - /* specified drive letter, and full path */ - /* skip drive letter */ - BUFCHECK(bdiff + 2 >= buflen); - memcpy(p, s, 2); - p += 2; - s += 2; - } - else { - /* specified drive, but not full path */ - int same = 0; - if (!NIL_P(dname)) { - file_expand_path(dname, Qnil, result); - BUFINIT(); - if (has_drive_letter(p) && TOLOWER(p[0]) == TOLOWER(s[0])) { - /* ok, same drive */ - same = 1; - } - } - if (!same) { - char *dir = getcwdofdrv(*s); - - tainted = 1; - dirlen = strlen(dir); - BUFCHECK(dirlen > buflen); - strcpy(buf, dir); - free(dir); - } - p = chompdirsep(skiproot(buf)); - s += 2; - } - } -#endif - else if (!is_absolute_path(s)) { - if (!NIL_P(dname)) { - file_expand_path(dname, Qnil, result); - BUFINIT(); - } - else { - char *dir = my_getcwd(); - - tainted = 1; - dirlen = strlen(dir); - BUFCHECK(dirlen > buflen); - strcpy(buf, dir); - free(dir); - } -#if defined DOSISH || defined __CYGWIN__ - if (isdirsep(*s)) { - /* specified full path, but not drive letter nor UNC */ - /* we need to get the drive letter or UNC share name */ - p = skipprefix(buf); - } - else -#endif - p = chompdirsep(skiproot(buf)); - } - else { - b = s; - do s++; while (isdirsep(*s)); - p = buf + (s - b); - BUFCHECK(bdiff >= buflen); - memset(buf, '/', p - buf); - } - if (p > buf && p[-1] == '/') - --p; - else - *p = '/'; - - p[1] = 0; - root = skipprefix(buf); - - b = s; - while (*s) { - switch (*s) { - case '.': - if (b == s++) { /* beginning of path element */ - switch (*s) { - case '\0': - b = s; - break; - case '.': - if (*(s+1) == '\0' || isdirsep(*(s+1))) { - /* We must go back to the parent */ - char *n; - *p = '\0'; - if (!(n = strrdirsep(root))) { - *p = '/'; - } - else { - p = n; - } - b = ++s; - } -#if USE_NTFS - else { - do *++s; while (istrailinggabage(*s)); - } -#endif - break; - case '/': -#if defined DOSISH || defined __CYGWIN__ - case '\\': -#endif - b = ++s; - break; - default: - /* ordinary path element, beginning don't move */ - break; - } - } -#if USE_NTFS - else { - --s; - case ' ': { - const char *e = s; - while (istrailinggabage(*s)) s++; - if (!*s) { - s = e; - goto endpath; - } - } - } -#endif - break; - case '/': -#if defined DOSISH || defined __CYGWIN__ - case '\\': -#endif - if (s > b) { - long rootdiff = root - buf; - BUFCHECK(bdiff + (s-b+1) >= buflen); - root = buf + rootdiff; - memcpy(++p, b, s-b); - p += s-b; - *p = '/'; - } - b = ++s; - break; - default: - s = CharNext(s); - break; - } - } - - if (s > b) { -#if USE_NTFS - endpath: - if (s > b + 6 && strncasecmp(s - 6, ":$DATA", 6) == 0) { - /* alias of stream */ - /* get rid of a bug of x64 VC++ */ - if (*(s-7) == ':') s -= 7; /* prime */ - else if (memchr(b, ':', s - 6 - b)) s -= 6; /* alternative */ - } -#endif - BUFCHECK(bdiff + (s-b) >= buflen); - memcpy(++p, b, s-b); - p += s-b; - } - if (p == skiproot(buf) - 1) p++; - -#if USE_NTFS - *p = '\0'; - if ((s = strrdirsep(b = buf)) != 0 && !strpbrk(s, "*?")) { - size_t len; - WIN32_FIND_DATA wfd; -#ifdef __CYGWIN__ - int lnk_added = 0, is_symlink = 0; - struct stat st; - char w32buf[MAXPATHLEN]; - p = (char *)s; - if (lstat(buf, &st) == 0 && S_ISLNK(st.st_mode)) { - is_symlink = 1; - *p = '\0'; - } - if (cygwin_conv_to_win32_path((*buf ? buf : "/"), w32buf) == 0) { - b = w32buf; - } - if (is_symlink && b == w32buf) { - *p = '\\'; - strlcat(w32buf, p, sizeof(w32buf)); - len = strlen(p); - if (len > 4 && strcasecmp(p + len - 4, ".lnk") != 0) { - lnk_added = 1; - strlcat(w32buf, ".lnk", sizeof(w32buf)); - } - } - *p = '/'; -#endif - HANDLE h = FindFirstFile(b, &wfd); - if (h != INVALID_HANDLE_VALUE) { - FindClose(h); - len = strlen(wfd.cFileName); -#ifdef __CYGWIN__ - if (lnk_added && len > 4 && - strcasecmp(wfd.cFileName + len - 4, ".lnk") == 0) { - wfd.cFileName[len -= 4] = '\0'; - } -#else - p = (char *)s; -#endif - ++p; - BUFCHECK(bdiff + len >= buflen); - memcpy(p, wfd.cFileName, len + 1); - p += len; - } -#ifdef __CYGWIN__ - else { - p += strlen(p); - } -#endif - } -#endif - - if (tainted) OBJ_TAINT(result); - RSTRING(result)->len = p - buf; - RSTRING(result)->ptr[p - buf] = '\0'; - return result; -} - -VALUE -rb_file_expand_path(fname, dname) - VALUE fname, dname; -{ - return file_expand_path(fname, dname, rb_str_new(0, MAXPATHLEN + 2)); -} - -/* - * call-seq: - * File.expand_path(file_name [, dir_string] ) -> abs_file_name - * - * Converts a pathname to an absolute pathname. Relative paths are - * referenced from the current working directory of the process unless - * dir_string is given, in which case it will be used as the - * starting point. The given pathname may start with a - * ``~'', which expands to the process owner's home - * directory (the environment variable HOME must be set - * correctly). ``~user'' expands to the named - * user's home directory. - * - * File.expand_path("~oracle/bin") #=> "/home/oracle/bin" - * File.expand_path("../../bin", "/tmp/x") #=> "/bin" - */ - -VALUE -rb_file_s_expand_path(argc, argv) - int argc; - VALUE *argv; -{ - VALUE fname, dname; - - if (argc == 1) { - return rb_file_expand_path(argv[0], Qnil); - } - rb_scan_args(argc, argv, "11", &fname, &dname); - - return rb_file_expand_path(fname, dname); -} - -static int -rmext(p, l1, e) - const char *p, *e; - int l1; -{ - int l2; - - if (!e) return 0; - - l2 = strlen(e); - if (l2 == 2 && e[1] == '*') { - unsigned char c = *e; - e = p + l1; - do { - if (e <= p) return 0; - } while (*--e != c); - return e - p; - } - if (l1 < l2) return l1; - -#if CASEFOLD_FILESYSTEM -#define fncomp strncasecmp -#else -#define fncomp strncmp -#endif - if (fncomp(p+l1-l2, e, l2) == 0) { - return l1-l2; - } - return 0; -} - -/* - * call-seq: - * File.basename(file_name [, suffix] ) -> base_name - * - * Returns the last component of the filename given in file_name, - * which must be formed using forward slashes (``/'') - * regardless of the separator used on the local file system. If - * suffix is given and present at the end of file_name, - * it is removed. - * - * File.basename("/home/gumby/work/ruby.rb") #=> "ruby.rb" - * File.basename("/home/gumby/work/ruby.rb", ".rb") #=> "ruby" - */ - -static VALUE -rb_file_s_basename(argc, argv) - int argc; - VALUE *argv; -{ - VALUE fname, fext, basename; - char *name, *p; -#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC - char *root; -#endif - int f, n; - - if (rb_scan_args(argc, argv, "11", &fname, &fext) == 2) { - StringValue(fext); - } - StringValue(fname); - if (RSTRING(fname)->len == 0 || !*(name = RSTRING(fname)->ptr)) - return fname; - name = skipprefix(name); -#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC - root = name; -#endif - while (isdirsep(*name)) - name++; - if (!*name) { - p = name - 1; - f = 1; -#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC - if (name != root) { - /* has slashes */ - } -#ifdef DOSISH_DRIVE_LETTER - else if (*p == ':') { - p++; - f = 0; - } -#endif -#ifdef DOSISH_UNC - else { - p = "/"; - } -#endif -#endif - } - else { - if (!(p = strrdirsep(name))) { - p = name; - } - else { - while (isdirsep(*p)) p++; /* skip last / */ - } -#if USE_NTFS - n = ntfs_tail(p) - p; -#else - n = chompdirsep(p) - p; -#endif - if (NIL_P(fext) || !(f = rmext(p, n, StringValueCStr(fext)))) { - f = n; - } - if (f == RSTRING_LEN(fname)) return fname; - } - basename = rb_str_new(p, f); - OBJ_INFECT(basename, fname); - return basename; -} - -/* - * call-seq: - * File.dirname(file_name ) -> dir_name - * - * Returns all components of the filename given in file_name - * except the last one. The filename must be formed using forward - * slashes (``/'') regardless of the separator used on the - * local file system. - * - * File.dirname("/home/gumby/work/ruby.rb") #=> "/home/gumby/work" - */ - -static VALUE -rb_file_s_dirname(klass, fname) - VALUE klass, fname; -{ - const char *name, *root, *p; - VALUE dirname; - - name = StringValueCStr(fname); - root = skiproot(name); -#ifdef DOSISH_UNC - if (root > name + 1 && isdirsep(*name)) - root = skipprefix(name = root - 2); -#else - if (root > name + 1) - name = root - 1; -#endif - p = strrdirsep(root); - if (!p) { - p = root; - } - if (p == name) - return rb_str_new2("."); -#ifdef DOSISH_DRIVE_LETTER - if (has_drive_letter(name) && isdirsep(*(name + 2))) { - const char *top = skiproot(name + 2); - dirname = rb_str_new(name, 3); - rb_str_cat(dirname, top, p - top); - } - else -#endif - dirname = rb_str_new(name, p - name); -#ifdef DOSISH_DRIVE_LETTER - if (has_drive_letter(name) && root == name + 2 && p - name == 2) - rb_str_cat(dirname, ".", 1); -#endif - OBJ_INFECT(dirname, fname); - return dirname; -} - -/* - * call-seq: - * File.extname(path) -> string - * - * Returns the extension (the portion of file name in path - * after the period). - * - * File.extname("test.rb") #=> ".rb" - * File.extname("a/b/d/test.rb") #=> ".rb" - * File.extname("test") #=> "" - * File.extname(".profile") #=> "" - * - */ - -static VALUE -rb_file_s_extname(klass, fname) - VALUE klass, fname; -{ - const char *name, *p, *e; - VALUE extname; - - name = StringValueCStr(fname); - p = strrdirsep(name); /* get the last path component */ - if (!p) - p = name; - else - name = ++p; - - e = 0; - while (*p) { - if (*p == '.' || istrailinggabage(*p)) { -#if USE_NTFS - const char *last = p++, *dot = last; - while (istrailinggabage(*p)) { - if (*p == '.') dot = p; - p++; - } - if (!*p || *p == ':') { - p = last; - break; - } - if (*last == '.' || dot > last) e = dot; - continue; -#else - e = p; /* get the last dot of the last component */ -#endif - } -#if USE_NTFS - else if (*p == ':') { - break; - } -#endif - else if (isdirsep(*p)) - break; - p = CharNext(p); - } - if (!e || e == name || e+1 == p) /* no dot, or the only dot is first or end? */ - return rb_str_new(0, 0); - extname = rb_str_new(e, p - e); /* keep the dot, too! */ - OBJ_INFECT(extname, fname); - return extname; -} - -/* - * call-seq: - * File.split(file_name) => array - * - * Splits the given string into a directory and a file component and - * returns them in a two-element array. See also - * File::dirname and File::basename. - * - * File.split("/home/gumby/.profile") #=> ["/home/gumby", ".profile"] - */ - -static VALUE -rb_file_s_split(klass, path) - VALUE klass, path; -{ - StringValue(path); /* get rid of converting twice */ - return rb_assoc_new(rb_file_s_dirname(Qnil, path), rb_file_s_basename(1,&path)); -} - -static VALUE separator; - -static VALUE rb_file_join _((VALUE ary, VALUE sep)); - -static VALUE -file_inspect_join(ary, arg) - VALUE ary; - VALUE *arg; -{ - return rb_file_join(arg[0], arg[1]); -} - -static VALUE -rb_file_join(ary, sep) - VALUE ary, sep; -{ - long len, i; - int taint = 0; - VALUE result, tmp; - char *name, *tail; - - if (RARRAY(ary)->len == 0) return rb_str_new(0, 0); - if (OBJ_TAINTED(ary)) taint = 1; - if (OBJ_TAINTED(sep)) taint = 1; - - len = 1; - for (i=0; ilen; i++) { - if (TYPE(RARRAY(ary)->ptr[i]) == T_STRING) { - len += RSTRING(RARRAY(ary)->ptr[i])->len; - } - else { - len += 10; - } - } - if (!NIL_P(sep) && TYPE(sep) == T_STRING) { - len += RSTRING(sep)->len * RARRAY(ary)->len - 1; - } - result = rb_str_buf_new(len); - for (i=0; ilen; i++) { - tmp = RARRAY(ary)->ptr[i]; - switch (TYPE(tmp)) { - case T_STRING: - break; - case T_ARRAY: - if (rb_inspecting_p(tmp)) { - tmp = rb_str_new2("[...]"); - } - else { - VALUE args[2]; - - args[0] = tmp; - args[1] = sep; - tmp = rb_protect_inspect(file_inspect_join, ary, (VALUE)args); - } - break; - default: - StringValueCStr(tmp); - } - name = StringValueCStr(result); - if (i > 0 && !NIL_P(sep)) { - tail = chompdirsep(name); - if (RSTRING(tmp)->ptr && isdirsep(RSTRING(tmp)->ptr[0])) { - RSTRING(result)->len = tail - name; - } - else if (!*tail) { - rb_str_buf_append(result, sep); - } - } - rb_str_buf_append(result, tmp); - if (OBJ_TAINTED(tmp)) taint = 1; - } - - if (taint) OBJ_TAINT(result); - return result; -} - -/* - * call-seq: - * File.join(string, ...) -> path - * - * Returns a new string formed by joining the strings using - * File::SEPARATOR. - * - * File.join("usr", "mail", "gumby") #=> "usr/mail/gumby" - * - */ - -static VALUE -rb_file_s_join(klass, args) - VALUE klass, args; -{ - return rb_file_join(args, separator); -} - -/* - * call-seq: - * File.truncate(file_name, integer) => 0 - * - * Truncates the file file_name to be at most integer - * bytes long. Not available on all platforms. - * - * f = File.new("out", "w") - * f.write("1234567890") #=> 10 - * f.close #=> nil - * File.truncate("out", 5) #=> 0 - * File.size("out") #=> 5 - * - */ - -static VALUE -rb_file_s_truncate(klass, path, len) - VALUE klass, path, len; -{ - off_t pos; - - rb_secure(2); - pos = NUM2OFFT(len); - SafeStringValue(path); - -#ifdef HAVE_TRUNCATE - if (truncate(StringValueCStr(path), pos) < 0) - rb_sys_fail(RSTRING(path)->ptr); -#else -# ifdef HAVE_CHSIZE - { - int tmpfd; - -# ifdef _WIN32 - if ((tmpfd = open(StringValueCStr(path), O_RDWR)) < 0) { - rb_sys_fail(RSTRING(path)->ptr); - } -# else - if ((tmpfd = open(StringValueCStr(path), 0)) < 0) { - rb_sys_fail(RSTRING(path)->ptr); - } -# endif - if (chsize(tmpfd, pos) < 0) { - close(tmpfd); - rb_sys_fail(RSTRING(path)->ptr); - } - close(tmpfd); - } -# else - rb_notimplement(); -# endif -#endif - return INT2FIX(0); -} - -/* - * call-seq: - * file.truncate(integer) => 0 - * - * Truncates file to at most integer bytes. The file - * must be opened for writing. Not available on all platforms. - * - * f = File.new("out", "w") - * f.syswrite("1234567890") #=> 10 - * f.truncate(5) #=> 0 - * f.close() #=> nil - * File.size("out") #=> 5 - */ - -static VALUE -rb_file_truncate(obj, len) - VALUE obj, len; -{ - OpenFile *fptr; - FILE *f; - off_t pos; - - rb_secure(2); - pos = NUM2OFFT(len); - GetOpenFile(obj, fptr); - if (!(fptr->mode & FMODE_WRITABLE)) { - rb_raise(rb_eIOError, "not opened for writing"); - } - f = GetWriteFile(fptr); - fflush(f); - fseeko(f, (off_t)0, SEEK_CUR); -#ifdef HAVE_FTRUNCATE - if (ftruncate(fileno(f), pos) < 0) - rb_sys_fail(fptr->path); -#else -# ifdef HAVE_CHSIZE - if (chsize(fileno(f), pos) < 0) - rb_sys_fail(fptr->path); -# else - rb_notimplement(); -# endif -#endif - return INT2FIX(0); -} - -# ifndef LOCK_SH -# define LOCK_SH 1 -# endif -# ifndef LOCK_EX -# define LOCK_EX 2 -# endif -# ifndef LOCK_NB -# define LOCK_NB 4 -# endif -# ifndef LOCK_UN -# define LOCK_UN 8 -# endif - -#ifdef __CYGWIN__ -#include -extern unsigned long __attribute__((stdcall)) GetLastError(void); - -static int -cygwin_flock(int fd, int op) -{ - int old_errno = errno; - int ret = flock(fd, op); - if (GetLastError() == ERROR_NOT_LOCKED) { - ret = 0; - errno = old_errno; - } - return ret; -} -# define flock(fd, op) cygwin_flock(fd, op) -#endif - -static int -rb_thread_flock(fd, op, fptr) - int fd, op; - OpenFile *fptr; -{ - if (rb_thread_alone() || (op & LOCK_NB)) { - int ret; - TRAP_BEG; - ret = flock(fd, op); - TRAP_END; - return ret; - } - op |= LOCK_NB; - while (flock(fd, op) < 0) { - switch (errno) { - case EAGAIN: - case EACCES: -#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN - case EWOULDBLOCK: -#endif - rb_thread_polling(); /* busy wait */ - rb_io_check_closed(fptr); - continue; - default: - return -1; - } - } - return 0; -} -#ifdef __CYGWIN__ -# undef flock -#endif -#define flock(fd, op) rb_thread_flock(fd, op, fptr) - -/* - * call-seq: - * file.flock (locking_constant ) => 0 or false - * - * Locks or unlocks a file according to locking_constant (a - * logical or of the values in the table below). - * Returns false if File::LOCK_NB is - * specified and the operation would otherwise have blocked. Not - * available on all platforms. - * - * Locking constants (in class File): - * - * LOCK_EX | Exclusive lock. Only one process may hold an - * | exclusive lock for a given file at a time. - * ----------+------------------------------------------------ - * LOCK_NB | Don't block when locking. May be combined - * | with other lock options using logical or. - * ----------+------------------------------------------------ - * LOCK_SH | Shared lock. Multiple processes may each hold a - * | shared lock for a given file at the same time. - * ----------+------------------------------------------------ - * LOCK_UN | Unlock. - * - * Example: - * - * File.new("testfile").flock(File::LOCK_UN) #=> 0 - * - */ - -static VALUE -rb_file_flock(obj, operation) - VALUE obj; - VALUE operation; -{ -#ifndef __CHECKER__ - OpenFile *fptr; - int op; - - rb_secure(2); - op = NUM2INT(operation); - GetOpenFile(obj, fptr); - - if (fptr->mode & FMODE_WRITABLE) { - fflush(GetWriteFile(fptr)); - } - retry: - if (flock(fileno(fptr->f), op) < 0) { - switch (errno) { - case EAGAIN: - case EACCES: -#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN - case EWOULDBLOCK: -#endif - return Qfalse; - case EINTR: -#if defined(ERESTART) - case ERESTART: -#endif - goto retry; - } - rb_sys_fail(fptr->path); - } -#endif - return INT2FIX(0); -} -#undef flock - -static void -test_check(n, argc, argv) - int n, argc; - VALUE *argv; -{ - int i; - - n+=1; - if (n != argc) rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, n); - for (i=1; i obj - * - * Uses the integer aCmd to perform various tests on - * file1 (first table below) or on file1 and - * file2 (second table). - * - * File tests on a single file: - * - * Test Returns Meaning - * ?A | Time | Last access time for file1 - * ?b | boolean | True if file1 is a block device - * ?c | boolean | True if file1 is a character device - * ?C | Time | Last change time for file1 - * ?d | boolean | True if file1 exists and is a directory - * ?e | boolean | True if file1 exists - * ?f | boolean | True if file1 exists and is a regular file - * ?g | boolean | True if file1 has the \CF{setgid} bit - * | | set (false under NT) - * ?G | boolean | True if file1 exists and has a group - * | | ownership equal to the caller's group - * ?k | boolean | True if file1 exists and has the sticky bit set - * ?l | boolean | True if file1 exists and is a symbolic link - * ?M | Time | Last modification time for file1 - * ?o | boolean | True if file1 exists and is owned by - * | | the caller's effective uid - * ?O | boolean | True if file1 exists and is owned by - * | | the caller's real uid - * ?p | boolean | True if file1 exists and is a fifo - * ?r | boolean | True if file1 is readable by the effective - * | | uid/gid of the caller - * ?R | boolean | True if file is readable by the real - * | | uid/gid of the caller - * ?s | int/nil | If file1 has nonzero size, return the size, - * | | otherwise return nil - * ?S | boolean | True if file1 exists and is a socket - * ?u | boolean | True if file1 has the setuid bit set - * ?w | boolean | True if file1 exists and is writable by - * | | the effective uid/gid - * ?W | boolean | True if file1 exists and is writable by - * | | the real uid/gid - * ?x | boolean | True if file1 exists and is executable by - * | | the effective uid/gid - * ?X | boolean | True if file1 exists and is executable by - * | | the real uid/gid - * ?z | boolean | True if file1 exists and has a zero length - * - * Tests that take two files: - * - * ?- | boolean | True if file1 and file2 are identical - * ?= | boolean | True if the modification times of file1 - * | | and file2 are equal - * ?< | boolean | True if the modification time of file1 - * | | is prior to that of file2 - * ?> | boolean | True if the modification time of file1 - * | | is after that of file2 - */ - -static VALUE -rb_f_test(argc, argv) - int argc; - VALUE *argv; -{ - int cmd; - - if (argc == 0) rb_raise(rb_eArgError, "wrong number of arguments"); -#if 0 /* 1.7 behavior? */ - if (argc == 1) { - return RTEST(argv[0]) ? Qtrue : Qfalse; - } -#endif - cmd = NUM2CHR(argv[0]); - if (cmd == 0) return Qfalse; - if (strchr("bcdefgGkloOprRsSuwWxXz", cmd)) { - CHECK(1); - switch (cmd) { - case 'b': - return test_b(0, argv[1]); - - case 'c': - return test_c(0, argv[1]); - - case 'd': - return test_d(0, argv[1]); - - case 'a': - case 'e': - return test_e(0, argv[1]); - - case 'f': - return test_f(0, argv[1]); - - case 'g': - return test_sgid(0, argv[1]); - - case 'G': - return test_grpowned(0, argv[1]); - - case 'k': - return test_sticky(0, argv[1]); - - case 'l': - return test_l(0, argv[1]); - - case 'o': - return test_owned(0, argv[1]); - - case 'O': - return test_rowned(0, argv[1]); - - case 'p': - return test_p(0, argv[1]); - - case 'r': - return test_r(0, argv[1]); - - case 'R': - return test_R(0, argv[1]); - - case 's': - return test_s(0, argv[1]); - - case 'S': - return test_S(0, argv[1]); - - case 'u': - return test_suid(0, argv[1]); - - case 'w': - return test_w(0, argv[1]); - - case 'W': - return test_W(0, argv[1]); - - case 'x': - return test_x(0, argv[1]); - - case 'X': - return test_X(0, argv[1]); - - case 'z': - return test_z(0, argv[1]); - } - } - - if (strchr("MAC", cmd)) { - struct stat st; - - CHECK(1); - if (rb_stat(argv[1], &st) == -1) { - rb_sys_fail(RSTRING(argv[1])->ptr); - } - - switch (cmd) { - case 'A': - return rb_time_new(st.st_atime, 0); - case 'M': - return rb_time_new(st.st_mtime, 0); - case 'C': - return rb_time_new(st.st_ctime, 0); - } - } - - if (cmd == '-') { - CHECK(2); - return test_identical(0, argv[1], argv[2]); - } - - if (strchr("=<>", cmd)) { - struct stat st1, st2; - - CHECK(2); - if (rb_stat(argv[1], &st1) < 0) return Qfalse; - if (rb_stat(argv[2], &st2) < 0) return Qfalse; - - switch (cmd) { - case '=': - if (st1.st_mtime == st2.st_mtime) return Qtrue; - return Qfalse; - - case '>': - if (st1.st_mtime > st2.st_mtime) return Qtrue; - return Qfalse; - - case '<': - if (st1.st_mtime < st2.st_mtime) return Qtrue; - return Qfalse; - } - } - /* unknown command */ - rb_raise(rb_eArgError, "unknown command ?%c", cmd); - return Qnil; /* not reached */ -} - - -/* - * Document-class: File::Stat - * - * Objects of class File::Stat encapsulate common status - * information for File objects. The information is - * recorded at the moment the File::Stat object is - * created; changes made to the file after that point will not be - * reflected. File::Stat objects are returned by - * IO#stat, File::stat, - * File#lstat, and File::lstat. Many of these - * methods return platform-specific values, and not all values are - * meaningful on all systems. See also Kernel#test. - */ - -static VALUE rb_stat_s_alloc _((VALUE)); -static VALUE -rb_stat_s_alloc(klass) - VALUE klass; -{ - return stat_new_0(klass, 0); -} - -/* - * call-seq: - * - * File::Stat.new(file_name) => stat - * - * Create a File::Stat object for the given file name (raising an - * exception if the file doesn't exist). - */ - -static VALUE -rb_stat_init(obj, fname) - VALUE obj, fname; -{ - struct stat st, *nst; - - SafeStringValue(fname); - - if (stat(StringValueCStr(fname), &st) == -1) { - rb_sys_fail(RSTRING(fname)->ptr); - } - if (DATA_PTR(obj)) { - free(DATA_PTR(obj)); - DATA_PTR(obj) = NULL; - } - nst = ALLOC(struct stat); - *nst = st; - DATA_PTR(obj) = nst; - - return Qnil; -} - -/* :nodoc: */ -static VALUE -rb_stat_init_copy(copy, orig) - VALUE copy, orig; -{ - struct stat *nst; - - if (copy == orig) return orig; - rb_check_frozen(copy); - /* need better argument type check */ - if (!rb_obj_is_instance_of(orig, rb_obj_class(copy))) { - rb_raise(rb_eTypeError, "wrong argument class"); - } - if (DATA_PTR(copy)) { - free(DATA_PTR(copy)); - DATA_PTR(copy) = 0; - } - if (DATA_PTR(orig)) { - nst = ALLOC(struct stat); - *nst = *(struct stat*)DATA_PTR(orig); - DATA_PTR(copy) = nst; - } - - return copy; -} - -/* - * call-seq: - * stat.ftype => string - * - * Identifies the type of stat. The return string is one of: - * ``file'', ``directory'', - * ``characterSpecial'', ``blockSpecial'', - * ``fifo'', ``link'', - * ``socket'', or ``unknown''. - * - * File.stat("/dev/tty").ftype #=> "characterSpecial" - * - */ - -static VALUE -rb_stat_ftype(obj) - VALUE obj; -{ - return rb_file_ftype(get_stat(obj)); -} - -/* - * call-seq: - * stat.directory? => true or false - * - * Returns true if stat is a directory, - * false otherwise. - * - * File.stat("testfile").directory? #=> false - * File.stat(".").directory? #=> true - */ - -static VALUE -rb_stat_d(obj) - VALUE obj; -{ - if (S_ISDIR(get_stat(obj)->st_mode)) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * stat.pipe? => true or false - * - * Returns true if the operating system supports pipes and - * stat is a pipe; false otherwise. - */ - -static VALUE -rb_stat_p(obj) - VALUE obj; -{ -#ifdef S_IFIFO - if (S_ISFIFO(get_stat(obj)->st_mode)) return Qtrue; - -#endif - return Qfalse; -} - -/* - * call-seq: - * stat.symlink? => true or false - * - * Returns true if stat is a symbolic link, - * false if it isn't or if the operating system doesn't - * support this feature. As File::stat automatically - * follows symbolic links, symlink? will always be - * false for an object returned by - * File::stat. - * - * File.symlink("testfile", "alink") #=> 0 - * File.stat("alink").symlink? #=> false - * File.lstat("alink").symlink? #=> true - * - */ - -static VALUE -rb_stat_l(obj) - VALUE obj; -{ -#ifdef S_ISLNK - if (S_ISLNK(get_stat(obj)->st_mode)) return Qtrue; -#endif - return Qfalse; -} - -/* - * call-seq: - * stat.socket? => true or false - * - * Returns true if stat is a socket, - * false if it isn't or if the operating system doesn't - * support this feature. - * - * File.stat("testfile").socket? #=> false - * - */ - -static VALUE -rb_stat_S(obj) - VALUE obj; -{ -#ifdef S_ISSOCK - if (S_ISSOCK(get_stat(obj)->st_mode)) return Qtrue; - -#endif - return Qfalse; -} - -/* - * call-seq: - * stat.blockdev? => true or false - * - * Returns true if the file is a block device, - * false if it isn't or if the operating system doesn't - * support this feature. - * - * File.stat("testfile").blockdev? #=> false - * File.stat("/dev/hda1").blockdev? #=> true - * - */ - -static VALUE -rb_stat_b(obj) - VALUE obj; -{ -#ifdef S_ISBLK - if (S_ISBLK(get_stat(obj)->st_mode)) return Qtrue; - -#endif - return Qfalse; -} - -/* - * call-seq: - * stat.chardev? => true or false - * - * Returns true if the file is a character device, - * false if it isn't or if the operating system doesn't - * support this feature. - * - * File.stat("/dev/tty").chardev? #=> true - * - */ - -static VALUE -rb_stat_c(obj) - VALUE obj; -{ - if (S_ISCHR(get_stat(obj)->st_mode)) return Qtrue; - - return Qfalse; -} - -/* - * call-seq: - * stat.owned? => true or false - * - * Returns true if the effective user id of the process is - * the same as the owner of stat. - * - * File.stat("testfile").owned? #=> true - * File.stat("/etc/passwd").owned? #=> false - * - */ - -static VALUE -rb_stat_owned(obj) - VALUE obj; -{ - if (get_stat(obj)->st_uid == geteuid()) return Qtrue; - return Qfalse; -} - -static VALUE -rb_stat_rowned(obj) - VALUE obj; -{ - if (get_stat(obj)->st_uid == getuid()) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * stat.grpowned? => true or false - * - * Returns true if the effective group id of the process is the same as - * the group id of stat. On Windows NT, returns false. - * - * File.stat("testfile").grpowned? #=> true - * File.stat("/etc/passwd").grpowned? #=> false - * - */ - -static VALUE -rb_stat_grpowned(obj) - VALUE obj; -{ -#ifndef _WIN32 - if (group_member(get_stat(obj)->st_gid)) return Qtrue; -#endif - return Qfalse; -} - -/* - * call-seq: - * stat.readable? => true or false - * - * Returns true if stat is readable by the - * effective user id of this process. - * - * File.stat("testfile").readable? #=> true - * - */ - -static VALUE -rb_stat_r(obj) - VALUE obj; -{ - struct stat *st = get_stat(obj); - -#ifdef USE_GETEUID - if (geteuid() == 0) return Qtrue; -#endif -#ifdef S_IRUSR - if (rb_stat_owned(obj)) - return st->st_mode & S_IRUSR ? Qtrue : Qfalse; -#endif -#ifdef S_IRGRP - if (rb_stat_grpowned(obj)) - return st->st_mode & S_IRGRP ? Qtrue : Qfalse; -#endif -#ifdef S_IROTH - if (!(st->st_mode & S_IROTH)) return Qfalse; -#endif - return Qtrue; -} - -/* - * call-seq: - * stat.readable_real? -> true or false - * - * Returns true if stat is readable by the real - * user id of this process. - * - * File.stat("testfile").readable_real? #=> true - * - */ - -static VALUE -rb_stat_R(obj) - VALUE obj; -{ - struct stat *st = get_stat(obj); - -#ifdef USE_GETEUID - if (getuid() == 0) return Qtrue; -#endif -#ifdef S_IRUSR - if (rb_stat_rowned(obj)) - return st->st_mode & S_IRUSR ? Qtrue : Qfalse; -#endif -#ifdef S_IRGRP - if (group_member(get_stat(obj)->st_gid)) - return st->st_mode & S_IRGRP ? Qtrue : Qfalse; -#endif -#ifdef S_IROTH - if (!(st->st_mode & S_IROTH)) return Qfalse; -#endif - return Qtrue; -} - -/* - * call-seq: - * stat.writable? -> true or false - * - * Returns true if stat is writable by the - * effective user id of this process. - * - * File.stat("testfile").writable? #=> true - * - */ - -static VALUE -rb_stat_w(obj) - VALUE obj; -{ - struct stat *st = get_stat(obj); - -#ifdef USE_GETEUID - if (geteuid() == 0) return Qtrue; -#endif -#ifdef S_IWUSR - if (rb_stat_owned(obj)) - return st->st_mode & S_IWUSR ? Qtrue : Qfalse; -#endif -#ifdef S_IWGRP - if (rb_stat_grpowned(obj)) - return st->st_mode & S_IWGRP ? Qtrue : Qfalse; -#endif -#ifdef S_IWOTH - if (!(st->st_mode & S_IWOTH)) return Qfalse; -#endif - return Qtrue; -} - -/* - * call-seq: - * stat.writable_real? -> true or false - * - * Returns true if stat is writable by the real - * user id of this process. - * - * File.stat("testfile").writable_real? #=> true - * - */ - -static VALUE -rb_stat_W(obj) - VALUE obj; -{ - struct stat *st = get_stat(obj); - -#ifdef USE_GETEUID - if (getuid() == 0) return Qtrue; -#endif -#ifdef S_IWUSR - if (rb_stat_rowned(obj)) - return st->st_mode & S_IWUSR ? Qtrue : Qfalse; -#endif -#ifdef S_IWGRP - if (group_member(get_stat(obj)->st_gid)) - return st->st_mode & S_IWGRP ? Qtrue : Qfalse; -#endif -#ifdef S_IWOTH - if (!(st->st_mode & S_IWOTH)) return Qfalse; -#endif - return Qtrue; -} - -/* - * call-seq: - * stat.executable? => true or false - * - * Returns true if stat is executable or if the - * operating system doesn't distinguish executable files from - * nonexecutable files. The tests are made using the effective owner of - * the process. - * - * File.stat("testfile").executable? #=> false - * - */ - -static VALUE -rb_stat_x(obj) - VALUE obj; -{ - struct stat *st = get_stat(obj); - -#ifdef USE_GETEUID - if (geteuid() == 0) { - return st->st_mode & S_IXUGO ? Qtrue : Qfalse; - } -#endif -#ifdef S_IXUSR - if (rb_stat_owned(obj)) - return st->st_mode & S_IXUSR ? Qtrue : Qfalse; -#endif -#ifdef S_IXGRP - if (rb_stat_grpowned(obj)) - return st->st_mode & S_IXGRP ? Qtrue : Qfalse; -#endif -#ifdef S_IXOTH - if (!(st->st_mode & S_IXOTH)) return Qfalse; -#endif - return Qtrue; -} - -/* - * call-seq: - * stat.executable_real? => true or false - * - * Same as executable?, but tests using the real owner of - * the process. - */ - -static VALUE -rb_stat_X(obj) - VALUE obj; -{ - struct stat *st = get_stat(obj); - -#ifdef USE_GETEUID - if (getuid() == 0) { - return st->st_mode & S_IXUGO ? Qtrue : Qfalse; - } -#endif -#ifdef S_IXUSR - if (rb_stat_rowned(obj)) - return st->st_mode & S_IXUSR ? Qtrue : Qfalse; -#endif -#ifdef S_IXGRP - if (group_member(get_stat(obj)->st_gid)) - return st->st_mode & S_IXGRP ? Qtrue : Qfalse; -#endif -#ifdef S_IXOTH - if (!(st->st_mode & S_IXOTH)) return Qfalse; -#endif - return Qtrue; -} - -/* - * call-seq: - * stat.file? => true or false - * - * Returns true if stat is a regular file (not - * a device file, pipe, socket, etc.). - * - * File.stat("testfile").file? #=> true - * - */ - -static VALUE -rb_stat_f(obj) - VALUE obj; -{ - if (S_ISREG(get_stat(obj)->st_mode)) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * stat.zero? => true or false - * - * Returns true if stat is a zero-length file; - * false otherwise. - * - * File.stat("testfile").zero? #=> false - * - */ - -static VALUE -rb_stat_z(obj) - VALUE obj; -{ - if (get_stat(obj)->st_size == 0) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * state.size => integer - * - * Returns the size of stat in bytes. - * - * File.stat("testfile").size #=> 66 - * - */ - -static VALUE -rb_stat_s(obj) - VALUE obj; -{ - off_t size = get_stat(obj)->st_size; - - if (size == 0) return Qnil; - return OFFT2NUM(size); -} - -/* - * call-seq: - * stat.setuid? => true or false - * - * Returns true if stat has the set-user-id - * permission bit set, false if it doesn't or if the - * operating system doesn't support this feature. - * - * File.stat("/bin/su").setuid? #=> true - */ - -static VALUE -rb_stat_suid(obj) - VALUE obj; -{ -#ifdef S_ISUID - if (get_stat(obj)->st_mode & S_ISUID) return Qtrue; -#endif - return Qfalse; -} - -/* - * call-seq: - * stat.setgid? => true or false - * - * Returns true if stat has the set-group-id - * permission bit set, false if it doesn't or if the - * operating system doesn't support this feature. - * - * File.stat("/usr/sbin/lpc").setgid? #=> true - * - */ - -static VALUE -rb_stat_sgid(obj) - VALUE obj; -{ -#ifdef S_ISGID - if (get_stat(obj)->st_mode & S_ISGID) return Qtrue; -#endif - return Qfalse; -} - -/* - * call-seq: - * stat.sticky? => true or false - * - * Returns true if stat has its sticky bit set, - * false if it doesn't or if the operating system doesn't - * support this feature. - * - * File.stat("testfile").sticky? #=> false - * - */ - -static VALUE -rb_stat_sticky(obj) - VALUE obj; -{ -#ifdef S_ISVTX - if (get_stat(obj)->st_mode & S_ISVTX) return Qtrue; -#endif - return Qfalse; -} - -VALUE rb_mFConst; - -void -rb_file_const(name, value) - const char *name; - VALUE value; -{ - rb_define_const(rb_mFConst, name, value); -} - -static int -is_absolute_path(path) - const char *path; -{ -#ifdef DOSISH_DRIVE_LETTER - if (has_drive_letter(path) && isdirsep(path[2])) return 1; -#endif -#ifdef DOSISH_UNC - if (isdirsep(path[0]) && isdirsep(path[1])) return 1; -#endif -#ifndef DOSISH - if (path[0] == '/') return 1; -#endif - return 0; -} - -#ifndef ENABLE_PATH_CHECK -# if defined DOSISH || defined __CYGWIN__ -# define ENABLE_PATH_CHECK 0 -# else -# define ENABLE_PATH_CHECK 1 -# endif -#endif - -#if ENABLE_PATH_CHECK -static int -path_check_0(fpath, execpath) - VALUE fpath; - int execpath; -{ - struct stat st; - char *p0 = StringValueCStr(fpath); - char *p = 0, *s; - - if (!is_absolute_path(p0)) { - char *buf = my_getcwd(); - VALUE newpath; - - newpath = rb_str_new2(buf); - free(buf); - - rb_str_cat2(newpath, "/"); - rb_str_cat2(newpath, p0); - p0 = RSTRING(fpath = newpath)->ptr; - } - for (;;) { -#ifndef S_IWOTH -# define S_IWOTH 002 -#endif - if (stat(p0, &st) == 0 && S_ISDIR(st.st_mode) && (st.st_mode & S_IWOTH) -#ifdef S_ISVTX - && !(p && execpath && (st.st_mode & S_ISVTX)) -#endif - ) { - rb_warn("Insecure world writable dir %s in %sPATH, mode 0%o", - p0, (execpath ? "" : "LOAD_"), st.st_mode); - if (p) *p = '/'; - return 0; - } - s = strrdirsep(p0); - if (p) *p = '/'; - if (!s || s == p0) return 1; - p = s; - *p = '\0'; - } -} -#endif - -static int -fpath_check(path) - char *path; -{ -#if ENABLE_PATH_CHECK - return path_check_0(rb_str_new2(path), Qfalse); -#else - return 1; -#endif -} - -int -rb_path_check(path) - char *path; -{ -#if ENABLE_PATH_CHECK - char *p0, *p, *pend; - const char sep = PATH_SEP_CHAR; - - if (!path) return 1; - - pend = path + strlen(path); - p0 = path; - p = strchr(path, sep); - if (!p) p = pend; - - for (;;) { - if (!path_check_0(rb_str_new(p0, p - p0), Qtrue)) { - return 0; /* not safe */ - } - p0 = p + 1; - if (p0 > pend) break; - p = strchr(p0, sep); - if (!p) p = pend; - } -#endif - return 1; -} - -#if defined(__MACOS__) || defined(riscos) -static int -is_macos_native_path(path) - const char *path; -{ - if (strchr(path, ':')) return 1; - return 0; -} -#endif - -static int -file_load_ok(file) - char *file; -{ - int ret = 1; - int fd = open(file, O_RDONLY); - if (fd == -1) return 0; -#if !defined DOSISH - { - struct stat st; - if (fstat(fd, &st) || !S_ISREG(st.st_mode)) { - ret = 0; - } - } -#endif - (void)close(fd); - return ret; -} - -extern VALUE rb_load_path; - -int -rb_find_file_ext(filep, ext) - VALUE *filep; - const char * const *ext; -{ - char *path, *found; - char *f = RSTRING(*filep)->ptr; - VALUE fname; - long i, j; - - if (f[0] == '~') { - fname = rb_file_expand_path(*filep, Qnil); - if (rb_safe_level() >= 2 && OBJ_TAINTED(fname)) { - rb_raise(rb_eSecurityError, "loading from unsafe file %s", f); - } - OBJ_FREEZE(fname); - f = StringValueCStr(fname); - *filep = fname; - } - - if (is_absolute_path(f)) { - for (i=0; ext[i]; i++) { - fname = rb_str_dup(*filep); - rb_str_cat2(fname, ext[i]); - OBJ_FREEZE(fname); - if (file_load_ok(StringValueCStr(fname))) { - *filep = fname; - return i+1; - } - } - return 0; - } - - if (!rb_load_path) return 0; - - Check_Type(rb_load_path, T_ARRAY); - for (i=0;ilen;i++) { - VALUE str = RARRAY(rb_load_path)->ptr[i]; - - SafeStringValue(str); - if (RSTRING(str)->len == 0) continue; - path = RSTRING(str)->ptr; - for (j=0; ext[j]; j++) { - fname = rb_str_dup(*filep); - rb_str_cat2(fname, ext[j]); - OBJ_FREEZE(fname); - found = dln_find_file(StringValueCStr(fname), path); - if (found && file_load_ok(found)) { - *filep = fname; - return j+1; - } - } - } - return 0; -} - -VALUE -rb_find_file(path) - VALUE path; -{ - VALUE tmp; - char *f = StringValueCStr(path); - char *lpath; - - if (f[0] == '~') { - path = rb_file_expand_path(path, Qnil); - if (rb_safe_level() >= 1 && OBJ_TAINTED(path)) { - rb_raise(rb_eSecurityError, "loading from unsafe path %s", f); - } - OBJ_FREEZE(path); - f = StringValueCStr(path); - } - -#if defined(__MACOS__) || defined(riscos) - if (is_macos_native_path(f)) { - if (rb_safe_level() >= 1 && !fpath_check(f)) { - rb_raise(rb_eSecurityError, "loading from unsafe file %s", f); - } - if (file_load_ok(f)) return path; - } -#endif - - if (is_absolute_path(f)) { - if (rb_safe_level() >= 1 && !fpath_check(f)) { - rb_raise(rb_eSecurityError, "loading from unsafe file %s", f); - } - if (file_load_ok(f)) return path; - } - - if (rb_safe_level() >= 4) { - rb_raise(rb_eSecurityError, "loading from non-absolute path %s", f); - } - - if (rb_load_path) { - long i; - - Check_Type(rb_load_path, T_ARRAY); - tmp = rb_ary_new(); - for (i=0;ilen;i++) { - VALUE str = RARRAY(rb_load_path)->ptr[i]; - SafeStringValue(str); - if (RSTRING(str)->len > 0) { - rb_ary_push(tmp, str); - } - } - tmp = rb_ary_join(tmp, rb_str_new2(PATH_SEP)); - if (RSTRING(tmp)->len == 0) { - lpath = 0; - } - else { - lpath = RSTRING(tmp)->ptr; - } - } - else { - lpath = 0; - } - - if (!lpath) { - return 0; /* no path, no load */ - } - if (!(f = dln_find_file(f, lpath))) { - return 0; - } - if (rb_safe_level() >= 1 && !fpath_check(f)) { - rb_raise(rb_eSecurityError, "loading from unsafe file %s", f); - } - if (file_load_ok(f)) { - tmp = rb_str_new2(f); - OBJ_FREEZE(tmp); - return tmp; - } - return 0; -} - -static void -define_filetest_function(name, func, argc) - const char *name; - VALUE (*func)(); - int argc; -{ - rb_define_module_function(rb_mFileTest, name, func, argc); - rb_define_singleton_method(rb_cFile, name, func, argc); -} - - -/* - * A File is an abstraction of any file object accessible - * by the program and is closely associated with class IO - * File includes the methods of module - * FileTest as class methods, allowing you to write (for - * example) File.exist?("foo"). - * - * In the description of File methods, - * permission bits are a platform-specific - * set of bits that indicate permissions of a file. On Unix-based - * systems, permissions are viewed as a set of three octets, for the - * owner, the group, and the rest of the world. For each of these - * entities, permissions may be set to read, write, or execute the - * file: - * - * The permission bits 0644 (in octal) would thus be - * interpreted as read/write for owner, and read-only for group and - * other. Higher-order bits may also be used to indicate the type of - * file (plain, directory, pipe, socket, and so on) and various other - * special features. If the permissions are for a directory, the - * meaning of the execute bit changes; when set the directory can be - * searched. - * - * On non-Posix operating systems, there may be only the ability to - * make a file read-only or read-write. In this case, the remaining - * permission bits will be synthesized to resemble typical values. For - * instance, on Windows NT the default permission bits are - * 0644, which means read/write for owner, read-only for - * all others. The only change that can be made is to make the file - * read-only, which is reported as 0444. - */ - -void -Init_File() -{ - rb_mFileTest = rb_define_module("FileTest"); - rb_cFile = rb_define_class("File", rb_cIO); - - define_filetest_function("directory?", test_d, 1); - define_filetest_function("exist?", test_e, 1); - define_filetest_function("exists?", test_e, 1); /* temporary */ - define_filetest_function("readable?", test_r, 1); - define_filetest_function("readable_real?", test_R, 1); - define_filetest_function("writable?", test_w, 1); - define_filetest_function("writable_real?", test_W, 1); - define_filetest_function("executable?", test_x, 1); - define_filetest_function("executable_real?", test_X, 1); - define_filetest_function("file?", test_f, 1); - define_filetest_function("zero?", test_z, 1); - define_filetest_function("size?", test_s, 1); - define_filetest_function("size", rb_file_s_size, 1); - define_filetest_function("owned?", test_owned, 1); - define_filetest_function("grpowned?", test_grpowned, 1); - - define_filetest_function("pipe?", test_p, 1); - define_filetest_function("symlink?", test_l, 1); - define_filetest_function("socket?", test_S, 1); - - define_filetest_function("blockdev?", test_b, 1); - define_filetest_function("chardev?", test_c, 1); - - define_filetest_function("setuid?", test_suid, 1); - define_filetest_function("setgid?", test_sgid, 1); - define_filetest_function("sticky?", test_sticky, 1); - - define_filetest_function("identical?", test_identical, 2); - - rb_define_singleton_method(rb_cFile, "stat", rb_file_s_stat, 1); - rb_define_singleton_method(rb_cFile, "lstat", rb_file_s_lstat, 1); - rb_define_singleton_method(rb_cFile, "ftype", rb_file_s_ftype, 1); - - rb_define_singleton_method(rb_cFile, "atime", rb_file_s_atime, 1); - rb_define_singleton_method(rb_cFile, "mtime", rb_file_s_mtime, 1); - rb_define_singleton_method(rb_cFile, "ctime", rb_file_s_ctime, 1); - - rb_define_singleton_method(rb_cFile, "utime", rb_file_s_utime, -1); - rb_define_singleton_method(rb_cFile, "chmod", rb_file_s_chmod, -1); - rb_define_singleton_method(rb_cFile, "chown", rb_file_s_chown, -1); - rb_define_singleton_method(rb_cFile, "lchmod", rb_file_s_lchmod, -1); - rb_define_singleton_method(rb_cFile, "lchown", rb_file_s_lchown, -1); - - rb_define_singleton_method(rb_cFile, "link", rb_file_s_link, 2); - rb_define_singleton_method(rb_cFile, "symlink", rb_file_s_symlink, 2); - rb_define_singleton_method(rb_cFile, "readlink", rb_file_s_readlink, 1); - - rb_define_singleton_method(rb_cFile, "unlink", rb_file_s_unlink, -2); - rb_define_singleton_method(rb_cFile, "delete", rb_file_s_unlink, -2); - rb_define_singleton_method(rb_cFile, "rename", rb_file_s_rename, 2); - rb_define_singleton_method(rb_cFile, "umask", rb_file_s_umask, -1); - rb_define_singleton_method(rb_cFile, "truncate", rb_file_s_truncate, 2); - rb_define_singleton_method(rb_cFile, "expand_path", rb_file_s_expand_path, -1); - rb_define_singleton_method(rb_cFile, "basename", rb_file_s_basename, -1); - rb_define_singleton_method(rb_cFile, "dirname", rb_file_s_dirname, 1); - rb_define_singleton_method(rb_cFile, "extname", rb_file_s_extname, 1); - - separator = rb_obj_freeze(rb_str_new2("/")); - rb_define_const(rb_cFile, "Separator", separator); - rb_define_const(rb_cFile, "SEPARATOR", separator); - rb_define_singleton_method(rb_cFile, "split", rb_file_s_split, 1); - rb_define_singleton_method(rb_cFile, "join", rb_file_s_join, -2); - -#ifdef DOSISH - rb_define_const(rb_cFile, "ALT_SEPARATOR", rb_obj_freeze(rb_str_new2("\\"))); -#else - rb_define_const(rb_cFile, "ALT_SEPARATOR", Qnil); -#endif - rb_define_const(rb_cFile, "PATH_SEPARATOR", rb_obj_freeze(rb_str_new2(PATH_SEP))); - - rb_define_method(rb_cIO, "stat", rb_io_stat, 0); /* this is IO's method */ - rb_define_method(rb_cFile, "lstat", rb_file_lstat, 0); - - rb_define_method(rb_cFile, "atime", rb_file_atime, 0); - rb_define_method(rb_cFile, "mtime", rb_file_mtime, 0); - rb_define_method(rb_cFile, "ctime", rb_file_ctime, 0); - - rb_define_method(rb_cFile, "chmod", rb_file_chmod, 1); - rb_define_method(rb_cFile, "chown", rb_file_chown, 2); - rb_define_method(rb_cFile, "truncate", rb_file_truncate, 1); - - rb_define_method(rb_cFile, "flock", rb_file_flock, 1); - - rb_mFConst = rb_define_module_under(rb_cFile, "Constants"); - rb_include_module(rb_cIO, rb_mFConst); - rb_file_const("LOCK_SH", INT2FIX(LOCK_SH)); - rb_file_const("LOCK_EX", INT2FIX(LOCK_EX)); - rb_file_const("LOCK_UN", INT2FIX(LOCK_UN)); - rb_file_const("LOCK_NB", INT2FIX(LOCK_NB)); - - rb_define_method(rb_cFile, "path", rb_file_path, 0); - rb_define_global_function("test", rb_f_test, -1); - - rb_cStat = rb_define_class_under(rb_cFile, "Stat", rb_cObject); - rb_define_alloc_func(rb_cStat, rb_stat_s_alloc); - rb_define_method(rb_cStat, "initialize", rb_stat_init, 1); - rb_define_method(rb_cStat, "initialize_copy", rb_stat_init_copy, 1); - - rb_include_module(rb_cStat, rb_mComparable); - - rb_define_method(rb_cStat, "<=>", rb_stat_cmp, 1); - - rb_define_method(rb_cStat, "dev", rb_stat_dev, 0); - rb_define_method(rb_cStat, "dev_major", rb_stat_dev_major, 0); - rb_define_method(rb_cStat, "dev_minor", rb_stat_dev_minor, 0); - rb_define_method(rb_cStat, "ino", rb_stat_ino, 0); - rb_define_method(rb_cStat, "mode", rb_stat_mode, 0); - rb_define_method(rb_cStat, "nlink", rb_stat_nlink, 0); - rb_define_method(rb_cStat, "uid", rb_stat_uid, 0); - rb_define_method(rb_cStat, "gid", rb_stat_gid, 0); - rb_define_method(rb_cStat, "rdev", rb_stat_rdev, 0); - rb_define_method(rb_cStat, "rdev_major", rb_stat_rdev_major, 0); - rb_define_method(rb_cStat, "rdev_minor", rb_stat_rdev_minor, 0); - rb_define_method(rb_cStat, "size", rb_stat_size, 0); - rb_define_method(rb_cStat, "blksize", rb_stat_blksize, 0); - rb_define_method(rb_cStat, "blocks", rb_stat_blocks, 0); - rb_define_method(rb_cStat, "atime", rb_stat_atime, 0); - rb_define_method(rb_cStat, "mtime", rb_stat_mtime, 0); - rb_define_method(rb_cStat, "ctime", rb_stat_ctime, 0); - - rb_define_method(rb_cStat, "inspect", rb_stat_inspect, 0); - - rb_define_method(rb_cStat, "ftype", rb_stat_ftype, 0); - - rb_define_method(rb_cStat, "directory?", rb_stat_d, 0); - rb_define_method(rb_cStat, "readable?", rb_stat_r, 0); - rb_define_method(rb_cStat, "readable_real?", rb_stat_R, 0); - rb_define_method(rb_cStat, "writable?", rb_stat_w, 0); - rb_define_method(rb_cStat, "writable_real?", rb_stat_W, 0); - rb_define_method(rb_cStat, "executable?", rb_stat_x, 0); - rb_define_method(rb_cStat, "executable_real?", rb_stat_X, 0); - rb_define_method(rb_cStat, "file?", rb_stat_f, 0); - rb_define_method(rb_cStat, "zero?", rb_stat_z, 0); - rb_define_method(rb_cStat, "size?", rb_stat_s, 0); - rb_define_method(rb_cStat, "owned?", rb_stat_owned, 0); - rb_define_method(rb_cStat, "grpowned?", rb_stat_grpowned, 0); - - rb_define_method(rb_cStat, "pipe?", rb_stat_p, 0); - rb_define_method(rb_cStat, "symlink?", rb_stat_l, 0); - rb_define_method(rb_cStat, "socket?", rb_stat_S, 0); - - rb_define_method(rb_cStat, "blockdev?", rb_stat_b, 0); - rb_define_method(rb_cStat, "chardev?", rb_stat_c, 0); - - rb_define_method(rb_cStat, "setuid?", rb_stat_suid, 0); - rb_define_method(rb_cStat, "setgid?", rb_stat_sgid, 0); - rb_define_method(rb_cStat, "sticky?", rb_stat_sticky, 0); -} -/********************************************************************** - - gc.c - - - $Author: wyhaines $ - $Date: 2009-07-10 20:31:58 +0200 (Fri, 10 Jul 2009) $ - created at: Tue Oct 5 09:44:46 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#include "ruby.h" -#include "rubysig.h" -#include "st.h" -#include "node.h" -#include "env.h" -#include "re.h" -#include -#include -#include - -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif - -#if defined _WIN32 || defined __CYGWIN__ -#include -#endif - -void re_free_registers _((struct re_registers*)); -void rb_io_fptr_finalize _((struct OpenFile*)); - -#if !defined(setjmp) && defined(HAVE__SETJMP) -#define setjmp(env) _setjmp(env) -#endif - -/* Make alloca work the best possible way. */ -#ifdef __GNUC__ -# ifndef atarist -# ifndef alloca -# define alloca __builtin_alloca -# endif -# endif /* atarist */ -#else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifndef _AIX -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (); -# endif -# endif /* AIX */ -# endif /* HAVE_ALLOCA_H */ -#endif /* __GNUC__ */ - -#ifndef GC_MALLOC_LIMIT -#if defined(MSDOS) || defined(__human68k__) -#define GC_MALLOC_LIMIT 200000 -#else -#define GC_MALLOC_LIMIT 8000000 -#endif -#endif - -static unsigned long malloc_increase = 0; -static unsigned long malloc_limit = GC_MALLOC_LIMIT; -static void run_final(); -static VALUE nomem_error; -static void garbage_collect(); - -NORETURN(void rb_exc_jump _((VALUE))); - -void -rb_memerror() -{ - rb_thread_t th = rb_curr_thread; - - if (!nomem_error || - (rb_thread_raised_p(th, RAISED_NOMEMORY) && rb_safe_level() < 4)) { - fprintf(stderr, "[FATAL] failed to allocate memory\n"); - exit(1); - } - if (rb_thread_raised_p(th, RAISED_NOMEMORY)) { - rb_exc_jump(nomem_error); - } - rb_thread_raised_set(th, RAISED_NOMEMORY); - rb_exc_raise(nomem_error); -} - -void * -ruby_xmalloc(size) - long size; -{ - void *mem; - - if (size < 0) { - rb_raise(rb_eNoMemError, "negative allocation size (or too big)"); - } - if (size == 0) size = 1; - - if ((malloc_increase+size) > malloc_limit) { - garbage_collect(); - } - RUBY_CRITICAL(mem = malloc(size)); - if (!mem) { - garbage_collect(); - RUBY_CRITICAL(mem = malloc(size)); - if (!mem) { - rb_memerror(); - } - } - malloc_increase += size; - - return mem; -} - -void * -ruby_xcalloc(n, size) - long n, size; -{ - void *mem; - - mem = xmalloc(n * size); - memset(mem, 0, n * size); - - return mem; -} - -void * -ruby_xrealloc(ptr, size) - void *ptr; - long size; -{ - void *mem; - - if (size < 0) { - rb_raise(rb_eArgError, "negative re-allocation size"); - } - if (!ptr) return xmalloc(size); - if (size == 0) size = 1; - RUBY_CRITICAL(mem = realloc(ptr, size)); - if (!mem) { - garbage_collect(); - RUBY_CRITICAL(mem = realloc(ptr, size)); - if (!mem) { - rb_memerror(); - } - } - malloc_increase += size; - - return mem; -} - -void -ruby_xfree(x) - void *x; -{ - if (x) - RUBY_CRITICAL(free(x)); -} - -extern int ruby_in_compile; -static int dont_gc; -static int during_gc; -static int need_call_final = 0; -static st_table *finalizer_table = 0; - - -/* - * call-seq: - * GC.enable => true or false - * - * Enables garbage collection, returning true if garbage - * collection was previously disabled. - * - * GC.disable #=> false - * GC.enable #=> true - * GC.enable #=> false - * - */ - -VALUE -rb_gc_enable() -{ - int old = dont_gc; - - dont_gc = Qfalse; - return old; -} - -/* - * call-seq: - * GC.disable => true or false - * - * Disables garbage collection, returning true if garbage - * collection was already disabled. - * - * GC.disable #=> false - * GC.disable #=> true - * - */ - -VALUE -rb_gc_disable() -{ - int old = dont_gc; - - dont_gc = Qtrue; - return old; -} - -VALUE rb_mGC; - -static struct gc_list { - VALUE *varptr; - struct gc_list *next; -} *global_List = 0; - -void -rb_gc_register_address(addr) - VALUE *addr; -{ - struct gc_list *tmp; - - tmp = ALLOC(struct gc_list); - tmp->next = global_List; - tmp->varptr = addr; - global_List = tmp; -} - -void -rb_gc_unregister_address(addr) - VALUE *addr; -{ - struct gc_list *tmp = global_List; - - if (tmp->varptr == addr) { - global_List = tmp->next; - RUBY_CRITICAL(free(tmp)); - return; - } - while (tmp->next) { - if (tmp->next->varptr == addr) { - struct gc_list *t = tmp->next; - - tmp->next = tmp->next->next; - RUBY_CRITICAL(free(t)); - break; - } - tmp = tmp->next; - } -} - -#undef GC_DEBUG - -void -rb_global_variable(var) - VALUE *var; -{ - rb_gc_register_address(var); -} - -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__) -#pragma pack(push, 1) /* magic for reducing sizeof(RVALUE): 24 -> 20 */ -#endif - -typedef struct RVALUE { - union { - struct { - unsigned long flags; /* always 0 for freed obj */ - struct RVALUE *next; - } free; - struct RBasic basic; - struct RObject object; - struct RClass klass; - struct RFloat flonum; - struct RString string; - struct RArray array; - struct RRegexp regexp; - struct RHash hash; - struct RData data; - struct RStruct rstruct; - struct RBignum bignum; - struct RFile file; - struct RNode node; - struct RMatch match; - struct RVarmap varmap; - struct SCOPE scope; - } as; -#ifdef GC_DEBUG - char *file; - int line; -#endif -} RVALUE; - -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__) -#pragma pack(pop) -#endif - -static RVALUE *freelist = 0; -static RVALUE *deferred_final_list = 0; - -#define HEAPS_INCREMENT 10 -static struct heaps_slot { - void *membase; - RVALUE *slot; - int limit; -} *heaps; -static int heaps_length = 0; -static int heaps_used = 0; - -#define HEAP_MIN_SLOTS 10000 -static int heap_slots = HEAP_MIN_SLOTS; - -#define FREE_MIN 4096 - -static RVALUE *himem, *lomem; - -static void -add_heap() -{ - RVALUE *p, *pend; - - if (heaps_used == heaps_length) { - /* Realloc heaps */ - struct heaps_slot *p; - int length; - - heaps_length += HEAPS_INCREMENT; - length = heaps_length*sizeof(struct heaps_slot); - RUBY_CRITICAL( - if (heaps_used > 0) { - p = (struct heaps_slot *)realloc(heaps, length); - if (p) heaps = p; - } - else { - p = heaps = (struct heaps_slot *)malloc(length); - }); - if (p == 0) rb_memerror(); - } - - for (;;) { - RUBY_CRITICAL(p = (RVALUE*)malloc(sizeof(RVALUE)*(heap_slots+1))); - if (p == 0) { - if (heap_slots == HEAP_MIN_SLOTS) { - rb_memerror(); - } - heap_slots = HEAP_MIN_SLOTS; - continue; - } - heaps[heaps_used].membase = p; - if ((VALUE)p % sizeof(RVALUE) == 0) - heap_slots += 1; - else - p = (RVALUE*)((VALUE)p + sizeof(RVALUE) - ((VALUE)p % sizeof(RVALUE))); - heaps[heaps_used].slot = p; - heaps[heaps_used].limit = heap_slots; - break; - } - pend = p + heap_slots; - if (lomem == 0 || lomem > p) lomem = p; - if (himem < pend) himem = pend; - heaps_used++; - heap_slots *= 1.8; - if (heap_slots <= 0) heap_slots = HEAP_MIN_SLOTS; - - while (p < pend) { - p->as.free.flags = 0; - p->as.free.next = freelist; - freelist = p; - p++; - } -} -#define RANY(o) ((RVALUE*)(o)) - -int -rb_during_gc() -{ - return during_gc; -} - -VALUE -rb_newobj() -{ - VALUE obj; - - if (during_gc) - rb_bug("object allocation during garbage collection phase"); - - if (!freelist) garbage_collect(); - - obj = (VALUE)freelist; - freelist = freelist->as.free.next; - MEMZERO((void*)obj, RVALUE, 1); -#ifdef GC_DEBUG - RANY(obj)->file = ruby_sourcefile; - RANY(obj)->line = ruby_sourceline; -#endif - return obj; -} - -VALUE -rb_data_object_alloc(klass, datap, dmark, dfree) - VALUE klass; - void *datap; - RUBY_DATA_FUNC dmark; - RUBY_DATA_FUNC dfree; -{ - NEWOBJ(data, struct RData); - if (klass) Check_Type(klass, T_CLASS); - OBJSETUP(data, klass, T_DATA); - data->data = datap; - data->dfree = dfree; - data->dmark = dmark; - - return (VALUE)data; -} - -extern st_table *rb_class_tbl; -VALUE *rb_gc_stack_start = 0; -#ifdef __ia64 -VALUE *rb_gc_register_stack_start = 0; -#endif - -#ifdef DJGPP -/* set stack size (http://www.delorie.com/djgpp/v2faq/faq15_9.html) */ -unsigned int _stklen = 0x180000; /* 1.5 kB */ -#endif - -#if defined(DJGPP) || defined(_WIN32_WCE) -static unsigned int STACK_LEVEL_MAX = 65535; -#elif defined(__human68k__) -unsigned int _stacksize = 262144; -# define STACK_LEVEL_MAX (_stacksize - 4096) -# undef HAVE_GETRLIMIT -#elif defined(HAVE_GETRLIMIT) || defined(_WIN32) -static size_t STACK_LEVEL_MAX = 655300; -#else -# define STACK_LEVEL_MAX 655300 -#endif - -#ifdef C_ALLOCA -# define SET_STACK_END VALUE stack_end; alloca(0); -# define STACK_END (&stack_end) -#else -# if defined(__GNUC__) && defined(USE_BUILTIN_FRAME_ADDRESS) && !defined(__ia64) -# if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 -__attribute__ ((noinline)) -# endif -static void -stack_end_address(VALUE **stack_end_p) -{ - VALUE stack_end; - *stack_end_p = &stack_end; -} -# define SET_STACK_END VALUE *stack_end; stack_end_address(&stack_end) -# else -# define SET_STACK_END VALUE *stack_end = alloca(1) -# endif -# define STACK_END (stack_end) -#endif -#if STACK_GROW_DIRECTION < 0 -# define STACK_LENGTH (rb_gc_stack_start - STACK_END) -#elif STACK_GROW_DIRECTION > 0 -# define STACK_LENGTH (STACK_END - rb_gc_stack_start + 1) -#else -# define STACK_LENGTH ((STACK_END < rb_gc_stack_start) ? rb_gc_stack_start - STACK_END\ - : STACK_END - rb_gc_stack_start + 1) -#endif -#if STACK_GROW_DIRECTION > 0 -# define STACK_UPPER(x, a, b) a -#elif STACK_GROW_DIRECTION < 0 -# define STACK_UPPER(x, a, b) b -#else -static int grow_direction; -static int -stack_grow_direction(addr) - VALUE *addr; -{ - SET_STACK_END; - - if (STACK_END > addr) return grow_direction = 1; - return grow_direction = -1; -} -# define stack_growup_p(x) ((grow_direction ? grow_direction : stack_grow_direction(x)) > 0) -# define STACK_UPPER(x, a, b) (stack_growup_p(x) ? a : b) -#endif - -#define GC_WATER_MARK 512 - -#define CHECK_STACK(ret) do {\ - SET_STACK_END;\ - (ret) = (STACK_LENGTH > STACK_LEVEL_MAX + GC_WATER_MARK);\ -} while (0) - -size_t -ruby_stack_length(p) - VALUE **p; -{ - SET_STACK_END; - if (p) *p = STACK_UPPER(STACK_END, rb_gc_stack_start, STACK_END); - return STACK_LENGTH; -} - -int -ruby_stack_check() -{ - int ret; - - CHECK_STACK(ret); - return ret; -} - -#define MARK_STACK_MAX 1024 -static VALUE mark_stack[MARK_STACK_MAX]; -static VALUE *mark_stack_ptr; -static int mark_stack_overflow; - -static void -init_mark_stack() -{ - mark_stack_overflow = 0; - mark_stack_ptr = mark_stack; -} - -#define MARK_STACK_EMPTY (mark_stack_ptr == mark_stack) - -static st_table *source_filenames; - -char * -rb_source_filename(f) - const char *f; -{ - st_data_t name; - - if (!st_lookup(source_filenames, (st_data_t)f, &name)) { - long len = strlen(f) + 1; - char *ptr = ALLOC_N(char, len + 1); - name = (st_data_t)ptr; - *ptr++ = 0; - MEMCPY(ptr, f, char, len); - st_add_direct(source_filenames, (st_data_t)ptr, name); - return ptr; - } - return (char *)name + 1; -} - -static void -mark_source_filename(f) - char *f; -{ - if (f) { - f[-1] = 1; - } -} - -static int -sweep_source_filename(key, value) - char *key, *value; -{ - if (*value) { - *value = 0; - return ST_CONTINUE; - } - else { - free(value); - return ST_DELETE; - } -} - -static void gc_mark _((VALUE ptr, int lev)); -static void gc_mark_children _((VALUE ptr, int lev)); - -static void -gc_mark_all() -{ - RVALUE *p, *pend; - int i; - - init_mark_stack(); - for (i = 0; i < heaps_used; i++) { - p = heaps[i].slot; pend = p + heaps[i].limit; - while (p < pend) { - if ((p->as.basic.flags & FL_MARK) && - (p->as.basic.flags != FL_MARK)) { - gc_mark_children((VALUE)p, 0); - } - p++; - } - } -} - -static void -gc_mark_rest() -{ - VALUE tmp_arry[MARK_STACK_MAX]; - VALUE *p; - - p = (mark_stack_ptr - mark_stack) + tmp_arry; - MEMCPY(tmp_arry, mark_stack, VALUE, MARK_STACK_MAX); - - init_mark_stack(); - while(p != tmp_arry){ - p--; - gc_mark_children(*p, 0); - } -} - -static inline int -is_pointer_to_heap(ptr) - void *ptr; -{ - register RVALUE *p = RANY(ptr); - register RVALUE *heap_org; - register long i; - - if (p < lomem || p > himem) return Qfalse; - if ((VALUE)p % sizeof(RVALUE) != 0) return Qfalse; - - /* check if p looks like a pointer */ - for (i=0; i < heaps_used; i++) { - heap_org = heaps[i].slot; - if (heap_org <= p && p < heap_org + heaps[i].limit) - return Qtrue; - } - return Qfalse; -} - -static void -mark_locations_array(x, n) - register VALUE *x; - register long n; -{ - VALUE v; - while (n--) { - v = *x; - if (is_pointer_to_heap((void *)v)) { - gc_mark(v, 0); - } - x++; - } -} - -void -rb_gc_mark_locations(start, end) - VALUE *start, *end; -{ - long n; - - n = end - start; - mark_locations_array(start,n); -} - -static int -mark_entry(key, value, lev) - ID key; - VALUE value; - int lev; -{ - gc_mark(value, lev); - return ST_CONTINUE; -} - -static void -mark_tbl(tbl, lev) - st_table *tbl; - int lev; -{ - if (!tbl) return; - st_foreach(tbl, mark_entry, lev); -} - -void -rb_mark_tbl(tbl) - st_table *tbl; -{ - mark_tbl(tbl, 0); -} - -static int -mark_key(key, value, lev) - VALUE key, value; - int lev; -{ - gc_mark(key, lev); - return ST_CONTINUE; -} - -static void -mark_set(tbl, lev) - st_table *tbl; - int lev; -{ - if (!tbl) return; - st_foreach(tbl, mark_key, lev); -} - -void -rb_mark_set(tbl) - st_table *tbl; -{ - mark_set(tbl, 0); -} - -static int -mark_keyvalue(key, value, lev) - VALUE key; - VALUE value; - int lev; -{ - gc_mark(key, lev); - gc_mark(value, lev); - return ST_CONTINUE; -} - -static void -mark_hash(tbl, lev) - st_table *tbl; - int lev; -{ - if (!tbl) return; - st_foreach(tbl, mark_keyvalue, lev); -} - -void -rb_mark_hash(tbl) - st_table *tbl; -{ - mark_hash(tbl, 0); -} - -void -rb_gc_mark_maybe(obj) - VALUE obj; -{ - if (is_pointer_to_heap((void *)obj)) { - gc_mark(obj, 0); - } -} - -#define GC_LEVEL_MAX 250 - -static void -gc_mark(ptr, lev) - VALUE ptr; - int lev; -{ - register RVALUE *obj; - - obj = RANY(ptr); - if (rb_special_const_p(ptr)) return; /* special const not marked */ - if (obj->as.basic.flags == 0) return; /* free cell */ - if (obj->as.basic.flags & FL_MARK) return; /* already marked */ - obj->as.basic.flags |= FL_MARK; - - if (lev > GC_LEVEL_MAX || (lev == 0 && ruby_stack_check())) { - if (!mark_stack_overflow) { - if (mark_stack_ptr - mark_stack < MARK_STACK_MAX) { - *mark_stack_ptr = ptr; - mark_stack_ptr++; - } - else { - mark_stack_overflow = 1; - } - } - return; - } - gc_mark_children(ptr, lev+1); -} - -void -rb_gc_mark(ptr) - VALUE ptr; -{ - gc_mark(ptr, 0); -} - -static void -gc_mark_children(ptr, lev) - VALUE ptr; - int lev; -{ - register RVALUE *obj = RANY(ptr); - - goto marking; /* skip */ - - again: - obj = RANY(ptr); - if (rb_special_const_p(ptr)) return; /* special const not marked */ - if (obj->as.basic.flags == 0) return; /* free cell */ - if (obj->as.basic.flags & FL_MARK) return; /* already marked */ - obj->as.basic.flags |= FL_MARK; - - marking: - if (FL_TEST(obj, FL_EXIVAR)) { - rb_mark_generic_ivar(ptr); - } - - switch (obj->as.basic.flags & T_MASK) { - case T_NIL: - case T_FIXNUM: - rb_bug("rb_gc_mark() called for broken object"); - break; - - case T_NODE: - mark_source_filename(obj->as.node.nd_file); - switch (nd_type(obj)) { - case NODE_IF: /* 1,2,3 */ - case NODE_FOR: - case NODE_ITER: - case NODE_CREF: - case NODE_WHEN: - case NODE_MASGN: - case NODE_RESCUE: - case NODE_RESBODY: - case NODE_CLASS: - gc_mark((VALUE)obj->as.node.u2.node, lev); - /* fall through */ - case NODE_BLOCK: /* 1,3 */ - case NODE_ARRAY: - case NODE_DSTR: - case NODE_DXSTR: - case NODE_DREGX: - case NODE_DREGX_ONCE: - case NODE_FBODY: - case NODE_ENSURE: - case NODE_CALL: - case NODE_DEFS: - case NODE_OP_ASGN1: - gc_mark((VALUE)obj->as.node.u1.node, lev); - /* fall through */ - case NODE_SUPER: /* 3 */ - case NODE_FCALL: - case NODE_DEFN: - case NODE_NEWLINE: - ptr = (VALUE)obj->as.node.u3.node; - goto again; - - case NODE_WHILE: /* 1,2 */ - case NODE_UNTIL: - case NODE_AND: - case NODE_OR: - case NODE_CASE: - case NODE_SCLASS: - case NODE_DOT2: - case NODE_DOT3: - case NODE_FLIP2: - case NODE_FLIP3: - case NODE_MATCH2: - case NODE_MATCH3: - case NODE_OP_ASGN_OR: - case NODE_OP_ASGN_AND: - case NODE_MODULE: - case NODE_ALIAS: - case NODE_VALIAS: - case NODE_ARGS: - gc_mark((VALUE)obj->as.node.u1.node, lev); - /* fall through */ - case NODE_METHOD: /* 2 */ - case NODE_NOT: - case NODE_GASGN: - case NODE_LASGN: - case NODE_DASGN: - case NODE_DASGN_CURR: - case NODE_IASGN: - case NODE_CVDECL: - case NODE_CVASGN: - case NODE_COLON3: - case NODE_OPT_N: - case NODE_EVSTR: - case NODE_UNDEF: - ptr = (VALUE)obj->as.node.u2.node; - goto again; - - case NODE_HASH: /* 1 */ - case NODE_LIT: - case NODE_STR: - case NODE_XSTR: - case NODE_DEFINED: - case NODE_MATCH: - case NODE_RETURN: - case NODE_BREAK: - case NODE_NEXT: - case NODE_YIELD: - case NODE_COLON2: - case NODE_SPLAT: - case NODE_TO_ARY: - case NODE_SVALUE: - ptr = (VALUE)obj->as.node.u1.node; - goto again; - - case NODE_SCOPE: /* 2,3 */ - case NODE_BLOCK_PASS: - case NODE_CDECL: - gc_mark((VALUE)obj->as.node.u3.node, lev); - ptr = (VALUE)obj->as.node.u2.node; - goto again; - - case NODE_ZARRAY: /* - */ - case NODE_ZSUPER: - case NODE_CFUNC: - case NODE_VCALL: - case NODE_GVAR: - case NODE_LVAR: - case NODE_DVAR: - case NODE_IVAR: - case NODE_CVAR: - case NODE_NTH_REF: - case NODE_BACK_REF: - case NODE_REDO: - case NODE_RETRY: - case NODE_SELF: - case NODE_NIL: - case NODE_TRUE: - case NODE_FALSE: - case NODE_ATTRSET: - case NODE_BLOCK_ARG: - case NODE_POSTEXE: - break; - case NODE_ALLOCA: - mark_locations_array((VALUE*)obj->as.node.u1.value, - obj->as.node.u3.cnt); - ptr = (VALUE)obj->as.node.u2.node; - goto again; - - default: /* unlisted NODE */ - if (is_pointer_to_heap(obj->as.node.u1.node)) { - gc_mark((VALUE)obj->as.node.u1.node, lev); - } - if (is_pointer_to_heap(obj->as.node.u2.node)) { - gc_mark((VALUE)obj->as.node.u2.node, lev); - } - if (is_pointer_to_heap(obj->as.node.u3.node)) { - gc_mark((VALUE)obj->as.node.u3.node, lev); - } - } - return; /* no need to mark class. */ - } - - gc_mark(obj->as.basic.klass, lev); - switch (obj->as.basic.flags & T_MASK) { - case T_ICLASS: - case T_CLASS: - case T_MODULE: - mark_tbl(obj->as.klass.m_tbl, lev); - mark_tbl(obj->as.klass.iv_tbl, lev); - ptr = obj->as.klass.super; - goto again; - - case T_ARRAY: - if (FL_TEST(obj, ELTS_SHARED)) { - ptr = obj->as.array.aux.shared; - goto again; - } - else { - long i, len = obj->as.array.len; - VALUE *ptr = obj->as.array.ptr; - - for (i=0; i < len; i++) { - gc_mark(*ptr++, lev); - } - } - break; - - case T_HASH: - mark_hash(obj->as.hash.tbl, lev); - ptr = obj->as.hash.ifnone; - goto again; - - case T_STRING: -#define STR_ASSOC FL_USER3 /* copied from string.c */ - if (FL_TEST(obj, ELTS_SHARED|STR_ASSOC)) { - ptr = obj->as.string.aux.shared; - goto again; - } - break; - - case T_DATA: - if (obj->as.data.dmark) (*obj->as.data.dmark)(DATA_PTR(obj)); - break; - - case T_OBJECT: - mark_tbl(obj->as.object.iv_tbl, lev); - break; - - case T_FILE: - case T_REGEXP: - case T_FLOAT: - case T_BIGNUM: - case T_BLKTAG: - break; - - case T_MATCH: - if (obj->as.match.str) { - ptr = obj->as.match.str; - goto again; - } - break; - - case T_VARMAP: - gc_mark(obj->as.varmap.val, lev); - ptr = (VALUE)obj->as.varmap.next; - goto again; - - case T_SCOPE: - if (obj->as.scope.local_vars && (obj->as.scope.flags & SCOPE_MALLOC)) { - int n = obj->as.scope.local_tbl[0]+1; - VALUE *vars = &obj->as.scope.local_vars[-1]; - - while (n--) { - gc_mark(*vars++, lev); - } - } - break; - - case T_STRUCT: - { - long len = obj->as.rstruct.len; - VALUE *ptr = obj->as.rstruct.ptr; - - while (len--) { - gc_mark(*ptr++, lev); - } - } - break; - - default: - rb_bug("rb_gc_mark(): unknown data type 0x%lx(0x%lx) %s", - obj->as.basic.flags & T_MASK, obj, - is_pointer_to_heap(obj) ? "corrupted object" : "non object"); - } -} - -static int obj_free _((VALUE)); - -static inline void -add_freelist(p) - RVALUE *p; -{ - p->as.free.flags = 0; - p->as.free.next = freelist; - freelist = p; -} - -static void -finalize_list(p) - RVALUE *p; -{ - while (p) { - RVALUE *tmp = p->as.free.next; - run_final((VALUE)p); - if (!FL_TEST(p, FL_SINGLETON)) { /* not freeing page */ - add_freelist(p); - } - p = tmp; - } -} - -static void -free_unused_heaps() -{ - int i, j; - - for (i = j = 1; j < heaps_used; i++) { - if (heaps[i].limit == 0) { - free(heaps[i].membase); - heaps_used--; - } - else { - if (i != j) { - heaps[j] = heaps[i]; - } - j++; - } - } -} - -#define T_DEFERRED 0x3a - -void rb_gc_abort_threads(void); - -static void -gc_sweep() -{ - RVALUE *p, *pend, *final_list; - int freed = 0; - int i; - unsigned long live = 0; - unsigned long free_min = 0; - - for (i = 0; i < heaps_used; i++) { - free_min += heaps[i].limit; - } - free_min = free_min * 0.2; - if (free_min < FREE_MIN) - free_min = FREE_MIN; - - if (ruby_in_compile && ruby_parser_stack_on_heap()) { - /* should not reclaim nodes during compilation - if yacc's semantic stack is not allocated on machine stack */ - for (i = 0; i < heaps_used; i++) { - p = heaps[i].slot; pend = p + heaps[i].limit; - while (p < pend) { - if (!(p->as.basic.flags&FL_MARK) && BUILTIN_TYPE(p) == T_NODE) - gc_mark((VALUE)p, 0); - p++; - } - } - } - - mark_source_filename(ruby_sourcefile); - if (source_filenames) { - st_foreach(source_filenames, sweep_source_filename, 0); - } - - freelist = 0; - final_list = deferred_final_list; - deferred_final_list = 0; - for (i = 0; i < heaps_used; i++) { - int n = 0; - RVALUE *free = freelist; - RVALUE *final = final_list; - int deferred; - - p = heaps[i].slot; pend = p + heaps[i].limit; - while (p < pend) { - if (!(p->as.basic.flags & FL_MARK)) { - if (p->as.basic.flags && - ((deferred = obj_free((VALUE)p)) || - ((FL_TEST(p, FL_FINALIZE)) && need_call_final))) { - if (!deferred) { - p->as.free.flags = T_DEFERRED; - RDATA(p)->dfree = 0; - } - p->as.free.flags |= FL_MARK; - p->as.free.next = final_list; - final_list = p; - } - else { - add_freelist(p); - } - n++; - } - else if (BUILTIN_TYPE(p) == T_DEFERRED) { - /* objects to be finalized */ - /* do nothing remain marked */ - } - else { - RBASIC(p)->flags &= ~FL_MARK; - live++; - } - p++; - } - if (n == heaps[i].limit && freed > free_min) { - RVALUE *pp; - - heaps[i].limit = 0; - for (pp = final_list; pp != final; pp = pp->as.free.next) { - pp->as.free.flags |= FL_SINGLETON; /* freeing page mark */ - } - freelist = free; /* cancel this page from freelist */ - } - else { - freed += n; - } - } - if (malloc_increase > malloc_limit) { - malloc_limit += (malloc_increase - malloc_limit) * (double)live / (live + freed); - if (malloc_limit < GC_MALLOC_LIMIT) malloc_limit = GC_MALLOC_LIMIT; - } - malloc_increase = 0; - if (freed < free_min) { - add_heap(); - } - during_gc = 0; - - /* clear finalization list */ - if (final_list) { - deferred_final_list = final_list; - rb_thread_pending = 1; - return; - } - free_unused_heaps(); -} - -void -rb_gc_force_recycle(p) - VALUE p; -{ - add_freelist((RVALUE*)p); -} - -static inline void -make_deferred(p) - RVALUE *p; -{ - p->as.basic.flags = (p->as.basic.flags & ~T_MASK) | T_DEFERRED; -} - -static int -obj_free(obj) - VALUE obj; -{ - switch (BUILTIN_TYPE(obj)) { - case T_NIL: - case T_FIXNUM: - case T_TRUE: - case T_FALSE: - rb_bug("obj_free() called for broken object"); - break; - } - - if (FL_TEST(obj, FL_EXIVAR)) { - rb_free_generic_ivar((VALUE)obj); - } - - switch (BUILTIN_TYPE(obj)) { - case T_OBJECT: - if (RANY(obj)->as.object.iv_tbl) { - st_free_table(RANY(obj)->as.object.iv_tbl); - } - break; - case T_MODULE: - case T_CLASS: - rb_clear_cache_by_class((VALUE)obj); - st_free_table(RANY(obj)->as.klass.m_tbl); - if (RANY(obj)->as.object.iv_tbl) { - st_free_table(RANY(obj)->as.object.iv_tbl); - } - break; - case T_STRING: - if (RANY(obj)->as.string.ptr && !FL_TEST(obj, ELTS_SHARED)) { - RUBY_CRITICAL(free(RANY(obj)->as.string.ptr)); - } - break; - case T_ARRAY: - if (RANY(obj)->as.array.ptr && !FL_TEST(obj, ELTS_SHARED)) { - RUBY_CRITICAL(free(RANY(obj)->as.array.ptr)); - } - break; - case T_HASH: - if (RANY(obj)->as.hash.tbl) { - st_free_table(RANY(obj)->as.hash.tbl); - } - break; - case T_REGEXP: - if (RANY(obj)->as.regexp.ptr) { - re_free_pattern(RANY(obj)->as.regexp.ptr); - } - if (RANY(obj)->as.regexp.str) { - RUBY_CRITICAL(free(RANY(obj)->as.regexp.str)); - } - break; - case T_DATA: - if (DATA_PTR(obj)) { - if ((long)RANY(obj)->as.data.dfree == -1) { - RUBY_CRITICAL(free(DATA_PTR(obj))); - } - else if (RANY(obj)->as.data.dfree) { - make_deferred(RANY(obj)); - return 1; - } - } - break; - case T_MATCH: - if (RANY(obj)->as.match.regs) { - re_free_registers(RANY(obj)->as.match.regs); - RUBY_CRITICAL(free(RANY(obj)->as.match.regs)); - } - break; - case T_FILE: - if (RANY(obj)->as.file.fptr) { - struct rb_io_t *fptr = RANY(obj)->as.file.fptr; - make_deferred(RANY(obj)); - RDATA(obj)->dfree = (void (*)(void*))rb_io_fptr_finalize; - RDATA(obj)->data = fptr; - return 1; - } - break; - case T_ICLASS: - /* iClass shares table with the module */ - break; - - case T_FLOAT: - case T_VARMAP: - case T_BLKTAG: - break; - - case T_BIGNUM: - if (RANY(obj)->as.bignum.digits) { - RUBY_CRITICAL(free(RANY(obj)->as.bignum.digits)); - } - break; - case T_NODE: - switch (nd_type(obj)) { - case NODE_SCOPE: - if (RANY(obj)->as.node.u1.tbl) { - RUBY_CRITICAL(free(RANY(obj)->as.node.u1.tbl)); - } - break; - case NODE_ALLOCA: - RUBY_CRITICAL(free(RANY(obj)->as.node.u1.node)); - break; - } - break; /* no need to free iv_tbl */ - - case T_SCOPE: - if (RANY(obj)->as.scope.local_vars && - RANY(obj)->as.scope.flags != SCOPE_ALLOCA) { - VALUE *vars = RANY(obj)->as.scope.local_vars-1; - if (!(RANY(obj)->as.scope.flags & SCOPE_CLONE) && vars[0] == 0) - RUBY_CRITICAL(free(RANY(obj)->as.scope.local_tbl)); - if ((RANY(obj)->as.scope.flags & (SCOPE_MALLOC|SCOPE_CLONE)) == SCOPE_MALLOC) - RUBY_CRITICAL(free(vars)); - } - break; - - case T_STRUCT: - if (RANY(obj)->as.rstruct.ptr) { - RUBY_CRITICAL(free(RANY(obj)->as.rstruct.ptr)); - } - break; - - default: - rb_bug("gc_sweep(): unknown data type 0x%lx(0x%lx)", - RANY(obj)->as.basic.flags & T_MASK, obj); - } - - return 0; -} - -void -rb_gc_mark_frame(frame) - struct FRAME *frame; -{ - gc_mark((VALUE)frame->node, 0); -} - -#ifdef __GNUC__ -#if defined(__human68k__) || defined(DJGPP) -#if defined(__human68k__) -typedef unsigned long rb_jmp_buf[8]; -__asm__ (".even\n\ -_rb_setjmp:\n\ - move.l 4(sp),a0\n\ - movem.l d3-d7/a3-a5,(a0)\n\ - moveq.l #0,d0\n\ - rts"); -#ifdef setjmp -#undef setjmp -#endif -#else -#if defined(DJGPP) -typedef unsigned long rb_jmp_buf[6]; -__asm__ (".align 4\n\ -_rb_setjmp:\n\ - pushl %ebp\n\ - movl %esp,%ebp\n\ - movl 8(%ebp),%ebp\n\ - movl %eax,(%ebp)\n\ - movl %ebx,4(%ebp)\n\ - movl %ecx,8(%ebp)\n\ - movl %edx,12(%ebp)\n\ - movl %esi,16(%ebp)\n\ - movl %edi,20(%ebp)\n\ - popl %ebp\n\ - xorl %eax,%eax\n\ - ret"); -#endif -#endif -int rb_setjmp (rb_jmp_buf); -#define jmp_buf rb_jmp_buf -#define setjmp rb_setjmp -#endif /* __human68k__ or DJGPP */ -#endif /* __GNUC__ */ - -static void -garbage_collect() -{ - struct gc_list *list; - struct FRAME * volatile frame; /* gcc 2.7.2.3 -O2 bug?? */ - jmp_buf save_regs_gc_mark; - SET_STACK_END; - -#ifdef HAVE_NATIVETHREAD - if (!is_ruby_native_thread()) { - rb_bug("cross-thread violation on rb_gc()"); - } -#endif - if (dont_gc || during_gc) { - if (!freelist) { - add_heap(); - } - return; - } - if (during_gc) return; - during_gc++; - - init_mark_stack(); - - gc_mark((VALUE)ruby_current_node, 0); - - /* mark frame stack */ - for (frame = ruby_frame; frame; frame = frame->prev) { - rb_gc_mark_frame(frame); - if (frame->tmp) { - struct FRAME *tmp = frame->tmp; - while (tmp) { - rb_gc_mark_frame(tmp); - tmp = tmp->prev; - } - } - } - gc_mark((VALUE)ruby_scope, 0); - gc_mark((VALUE)ruby_dyna_vars, 0); - if (finalizer_table) { - mark_tbl(finalizer_table, 0); - } - - FLUSH_REGISTER_WINDOWS; - /* This assumes that all registers are saved into the jmp_buf (and stack) */ - setjmp(save_regs_gc_mark); - mark_locations_array((VALUE*)save_regs_gc_mark, sizeof(save_regs_gc_mark) / sizeof(VALUE *)); -#if STACK_GROW_DIRECTION < 0 - rb_gc_mark_locations((VALUE*)STACK_END, rb_gc_stack_start); -#elif STACK_GROW_DIRECTION > 0 - rb_gc_mark_locations(rb_gc_stack_start, (VALUE*)STACK_END + 1); -#else - if ((VALUE*)STACK_END < rb_gc_stack_start) - rb_gc_mark_locations((VALUE*)STACK_END, rb_gc_stack_start); - else - rb_gc_mark_locations(rb_gc_stack_start, (VALUE*)STACK_END + 1); -#endif -#ifdef __ia64 - /* mark backing store (flushed register window on the stack) */ - /* the basic idea from guile GC code */ - rb_gc_mark_locations(rb_gc_register_stack_start, (VALUE*)rb_ia64_bsp()); -#endif -#if defined(__human68k__) || defined(__mc68000__) - rb_gc_mark_locations((VALUE*)((char*)STACK_END + 2), - (VALUE*)((char*)rb_gc_stack_start + 2)); -#endif - rb_gc_mark_threads(); - - /* mark protected global variables */ - for (list = global_List; list; list = list->next) { - rb_gc_mark_maybe(*list->varptr); - } - rb_mark_end_proc(); - rb_gc_mark_global_tbl(); - - rb_mark_tbl(rb_class_tbl); - rb_gc_mark_trap_list(); - - /* mark generic instance variables for special constants */ - rb_mark_generic_ivar_tbl(); - - rb_gc_mark_parser(); - - /* gc_mark objects whose marking are not completed*/ - do { - while (!MARK_STACK_EMPTY) { - if (mark_stack_overflow){ - gc_mark_all(); - } - else { - gc_mark_rest(); - } - } - rb_gc_abort_threads(); - } while (!MARK_STACK_EMPTY); - - gc_sweep(); -} - -void -rb_gc() -{ - garbage_collect(); - rb_gc_finalize_deferred(); -} - -/* - * call-seq: - * GC.start => nil - * gc.garbage_collect => nil - * ObjectSpace.garbage_collect => nil - * - * Initiates garbage collection, unless manually disabled. - * - */ - -VALUE -rb_gc_start() -{ - rb_gc(); - return Qnil; -} - -void -ruby_set_stack_size(size) - size_t size; -{ -#ifndef STACK_LEVEL_MAX - STACK_LEVEL_MAX = size / sizeof(VALUE); -#endif -} - -void -Init_stack(addr) - VALUE *addr; -{ -#ifdef __ia64 - if (rb_gc_register_stack_start == 0) { -# if defined(__FreeBSD__) - /* - * FreeBSD/ia64 currently does not have a way for a process to get the - * base address for the RSE backing store, so hardcode it. - */ - rb_gc_register_stack_start = (4ULL<<61); -# elif defined(HAVE___LIBC_IA64_REGISTER_BACKING_STORE_BASE) -# pragma weak __libc_ia64_register_backing_store_base - extern unsigned long __libc_ia64_register_backing_store_base; - rb_gc_register_stack_start = (VALUE*)__libc_ia64_register_backing_store_base; -# endif - } - { - VALUE *bsp = (VALUE*)rb_ia64_bsp(); - if (rb_gc_register_stack_start == 0 || - bsp < rb_gc_register_stack_start) { - rb_gc_register_stack_start = bsp; - } - } -#endif -#if defined(_WIN32) || defined(__CYGWIN__) - MEMORY_BASIC_INFORMATION m; - memset(&m, 0, sizeof(m)); - VirtualQuery(&m, &m, sizeof(m)); - rb_gc_stack_start = - STACK_UPPER((VALUE *)&m, (VALUE *)m.BaseAddress, - (VALUE *)((char *)m.BaseAddress + m.RegionSize) - 1); -#elif defined(STACK_END_ADDRESS) - { - extern void *STACK_END_ADDRESS; - rb_gc_stack_start = STACK_END_ADDRESS; - } -#else - if (!addr) addr = (void *)&addr; - STACK_UPPER(&addr, addr, ++addr); - if (rb_gc_stack_start) { - if (STACK_UPPER(&addr, - rb_gc_stack_start > addr, - rb_gc_stack_start < addr)) - rb_gc_stack_start = addr; - return; - } - rb_gc_stack_start = addr; -#endif -#ifdef HAVE_GETRLIMIT - { - struct rlimit rlim; - - if (getrlimit(RLIMIT_STACK, &rlim) == 0) { - unsigned int space = rlim.rlim_cur/5; - - if (space > 1024*1024) space = 1024*1024; - STACK_LEVEL_MAX = (rlim.rlim_cur - space) / sizeof(VALUE); - } - } -#endif -} - -void ruby_init_stack(VALUE *addr -#ifdef __ia64 - , void *bsp -#endif - ) -{ - if (!rb_gc_stack_start || - STACK_UPPER(&addr, - rb_gc_stack_start > addr, - rb_gc_stack_start < addr)) { - rb_gc_stack_start = addr; - } -#ifdef __ia64 - if (!rb_gc_register_stack_start || - (VALUE*)bsp < rb_gc_register_stack_start) { - rb_gc_register_stack_start = (VALUE*)bsp; - } -#endif -#ifdef HAVE_GETRLIMIT - { - struct rlimit rlim; - - if (getrlimit(RLIMIT_STACK, &rlim) == 0) { - unsigned int space = rlim.rlim_cur/5; - - if (space > 1024*1024) space = 1024*1024; - STACK_LEVEL_MAX = (rlim.rlim_cur - space) / sizeof(VALUE); - } - } -#elif defined _WIN32 - { - MEMORY_BASIC_INFORMATION mi; - DWORD size; - DWORD space; - - if (VirtualQuery(&mi, &mi, sizeof(mi))) { - size = (char *)mi.BaseAddress - (char *)mi.AllocationBase; - space = size / 5; - if (space > 1024*1024) space = 1024*1024; - STACK_LEVEL_MAX = (size - space) / sizeof(VALUE); - } - } -#endif -} - -/* - * Document-class: ObjectSpace - * - * The ObjectSpace module contains a number of routines - * that interact with the garbage collection facility and allow you to - * traverse all living objects with an iterator. - * - * ObjectSpace also provides support for object - * finalizers, procs that will be called when a specific object is - * about to be destroyed by garbage collection. - * - * include ObjectSpace - * - * - * a = "A" - * b = "B" - * c = "C" - * - * - * define_finalizer(a, proc {|id| puts "Finalizer one on #{id}" }) - * define_finalizer(a, proc {|id| puts "Finalizer two on #{id}" }) - * define_finalizer(b, proc {|id| puts "Finalizer three on #{id}" }) - * - * produces: - * - * Finalizer three on 537763470 - * Finalizer one on 537763480 - * Finalizer two on 537763480 - * - */ - -void -Init_heap() -{ - if (!rb_gc_stack_start) { - Init_stack(0); - } - add_heap(); -} - -static VALUE -os_obj_of(of) - VALUE of; -{ - int i; - int n = 0; - - for (i = 0; i < heaps_used; i++) { - RVALUE *p, *pend; - - p = heaps[i].slot; pend = p + heaps[i].limit; - for (;p < pend; p++) { - if (p->as.basic.flags) { - switch (BUILTIN_TYPE(p)) { - case T_NONE: - case T_ICLASS: - case T_VARMAP: - case T_SCOPE: - case T_NODE: - case T_DEFERRED: - continue; - case T_CLASS: - if (FL_TEST(p, FL_SINGLETON)) continue; - default: - if (!p->as.basic.klass) continue; - if (!of || rb_obj_is_kind_of((VALUE)p, of)) { - rb_yield((VALUE)p); - n++; - } - } - } - } - } - - return INT2FIX(n); -} - -/* - * call-seq: - * ObjectSpace.each_object([module]) {|obj| ... } => fixnum - * - * Calls the block once for each living, nonimmediate object in this - * Ruby process. If module is specified, calls the block - * for only those classes or modules that match (or are a subclass of) - * module. Returns the number of objects found. Immediate - * objects (Fixnums, Symbols - * true, false, and nil) are - * never returned. In the example below, each_object - * returns both the numbers we defined and several constants defined in - * the Math module. - * - * a = 102.7 - * b = 95 # Won't be returned - * c = 12345678987654321 - * count = ObjectSpace.each_object(Numeric) {|x| p x } - * puts "Total count: #{count}" - * - * produces: - * - * 12345678987654321 - * 102.7 - * 2.71828182845905 - * 3.14159265358979 - * 2.22044604925031e-16 - * 1.7976931348623157e+308 - * 2.2250738585072e-308 - * Total count: 7 - * - */ - -static VALUE -os_each_obj(argc, argv) - int argc; - VALUE *argv; -{ - VALUE of; - - rb_secure(4); - if (rb_scan_args(argc, argv, "01", &of) == 0) { - of = 0; - } - return os_obj_of(of); -} - -static VALUE finalizers; - -/* deprecated - */ - -static VALUE -add_final(os, block) - VALUE os, block; -{ - rb_warn("ObjectSpace::add_finalizer is deprecated; use define_finalizer"); - if (!rb_respond_to(block, rb_intern("call"))) { - rb_raise(rb_eArgError, "wrong type argument %s (should be callable)", - rb_obj_classname(block)); - } - rb_ary_push(finalizers, block); - return block; -} - -/* - * deprecated - */ -static VALUE -rm_final(os, block) - VALUE os, block; -{ - rb_warn("ObjectSpace::remove_finalizer is deprecated; use undefine_finalizer"); - rb_ary_delete(finalizers, block); - return block; -} - -/* - * deprecated - */ -static VALUE -finals() -{ - rb_warn("ObjectSpace::finalizers is deprecated"); - return finalizers; -} - -/* - * deprecated - */ - -static VALUE -call_final(os, obj) - VALUE os, obj; -{ - rb_warn("ObjectSpace::call_finalizer is deprecated; use define_finalizer"); - need_call_final = 1; - FL_SET(obj, FL_FINALIZE); - return obj; -} - -/* - * call-seq: - * ObjectSpace.undefine_finalizer(obj) - * - * Removes all finalizers for obj. - * - */ - -static VALUE -undefine_final(os, obj) - VALUE os, obj; -{ - if (finalizer_table) { - st_delete(finalizer_table, (st_data_t*)&obj, 0); - } - return obj; -} - -/* - * call-seq: - * ObjectSpace.define_finalizer(obj, aProc=proc()) - * - * Adds aProc as a finalizer, to be called after obj - * was destroyed. - * - */ - -static VALUE -define_final(argc, argv, os) - int argc; - VALUE *argv; - VALUE os; -{ - VALUE obj, block, table; - - rb_scan_args(argc, argv, "11", &obj, &block); - if (argc == 1) { - block = rb_block_proc(); - } - else if (!rb_respond_to(block, rb_intern("call"))) { - rb_raise(rb_eArgError, "wrong type argument %s (should be callable)", - rb_obj_classname(block)); - } - need_call_final = 1; - if (!FL_ABLE(obj)) { - rb_raise(rb_eArgError, "cannot define finalizer for %s", - rb_obj_classname(obj)); - } - RBASIC(obj)->flags |= FL_FINALIZE; - - block = rb_ary_new3(2, INT2FIX(ruby_safe_level), block); - OBJ_FREEZE(block); - - if (!finalizer_table) { - finalizer_table = st_init_numtable(); - } - if (st_lookup(finalizer_table, obj, &table)) { - rb_ary_push(table, block); - } - else { - table = rb_ary_new3(1, block); - RBASIC(table)->klass = 0; - st_add_direct(finalizer_table, obj, table); - } - return block; -} - -void -rb_gc_copy_finalizer(dest, obj) - VALUE dest, obj; -{ - VALUE table; - - if (!finalizer_table) return; - if (!FL_TEST(obj, FL_FINALIZE)) return; - if (st_lookup(finalizer_table, obj, &table)) { - st_insert(finalizer_table, dest, table); - } - RBASIC(dest)->flags |= FL_FINALIZE; -} - -static VALUE -run_single_final(args) - VALUE *args; -{ - rb_eval_cmd(args[0], args[1], (int)args[2]); - return Qnil; -} - -static void -run_final(obj) - VALUE obj; -{ - long i; - int status, critical_save = rb_thread_critical; - VALUE args[3], table, objid; - - objid = rb_obj_id(obj); /* make obj into id */ - rb_thread_critical = Qtrue; - /* NOTE: This change below, adding DATA_PTR(obj) to the if line, is a stopgap fix for segfaults; the reason for DATA_PTR(obj) == 0 needs to be found and fixed. */ - if (BUILTIN_TYPE(obj) == T_DEFERRED && RDATA(obj)->dfree && DATA_PTR(obj)) { - (*RDATA(obj)->dfree)(DATA_PTR(obj)); - } - args[1] = 0; - args[2] = (VALUE)ruby_safe_level; - for (i=0; ilen; i++) { - args[0] = RARRAY(finalizers)->ptr[i]; - if (!args[1]) args[1] = rb_ary_new3(1, objid); - rb_protect((VALUE(*)_((VALUE)))run_single_final, (VALUE)args, &status); - } - if (finalizer_table && st_delete(finalizer_table, (st_data_t*)&obj, &table)) { - for (i=0; ilen; i++) { - VALUE final = RARRAY(table)->ptr[i]; - args[0] = RARRAY(final)->ptr[1]; - if (!args[1]) args[1] = rb_ary_new3(1, objid); - args[2] = FIX2INT(RARRAY(final)->ptr[0]); - rb_protect((VALUE(*)_((VALUE)))run_single_final, (VALUE)args, &status); - } - } - rb_thread_critical = critical_save; -} - -void -rb_gc_finalize_deferred() -{ - RVALUE *p = deferred_final_list; - - deferred_final_list = 0; - if (p) { - finalize_list(p); - free_unused_heaps(); - } -} - -static int -chain_finalized_object(st_data_t key, st_data_t val, st_data_t arg) -{ - RVALUE *p = (RVALUE *)key, **final_list = (RVALUE **)arg; - if ((p->as.basic.flags & (FL_FINALIZE|FL_MARK)) == FL_FINALIZE) { - if (BUILTIN_TYPE(p) != T_DEFERRED) { - p->as.free.flags = FL_MARK | T_DEFERRED; /* remain marked */ - RDATA(p)->dfree = 0; - } - p->as.free.next = *final_list; - *final_list = p; - } - return ST_CONTINUE; -} - -void -rb_gc_call_finalizer_at_exit() -{ - RVALUE *p, *pend; - int i; - - /* run finalizers */ - if (need_call_final) { - do { - p = deferred_final_list; - deferred_final_list = 0; - finalize_list(p); - mark_tbl(finalizer_table, 0); - st_foreach(finalizer_table, chain_finalized_object, - (st_data_t)&deferred_final_list); - } while (deferred_final_list); - } - /* run data object's finalizers */ - for (i = 0; i < heaps_used; i++) { - p = heaps[i].slot; pend = p + heaps[i].limit; - while (p < pend) { - if (BUILTIN_TYPE(p) == T_DATA && - DATA_PTR(p) && RANY(p)->as.data.dfree && - RANY(p)->as.basic.klass != rb_cThread) { - p->as.free.flags = 0; - if ((long)RANY(p)->as.data.dfree == -1) { - RUBY_CRITICAL(free(DATA_PTR(p))); - } - else if (RANY(p)->as.data.dfree) { - (*RANY(p)->as.data.dfree)(DATA_PTR(p)); - } - } - else if (BUILTIN_TYPE(p) == T_FILE) { - p->as.free.flags = 0; - rb_io_fptr_finalize(RANY(p)->as.file.fptr); - } - p++; - } - } -} - -/* - * call-seq: - * ObjectSpace._id2ref(object_id) -> an_object - * - * Converts an object id to a reference to the object. May not be - * called on an object id passed as a parameter to a finalizer. - * - * s = "I am a string" #=> "I am a string" - * r = ObjectSpace._id2ref(s.object_id) #=> "I am a string" - * r == s #=> true - * - */ - -static VALUE -id2ref(obj, objid) - VALUE obj, objid; -{ - unsigned long ptr, p0; - int type; - - rb_secure(4); - p0 = ptr = NUM2ULONG(objid); - if (ptr == Qtrue) return Qtrue; - if (ptr == Qfalse) return Qfalse; - if (ptr == Qnil) return Qnil; - if (FIXNUM_P(ptr)) return (VALUE)ptr; - ptr = objid ^ FIXNUM_FLAG; /* unset FIXNUM_FLAG */ - - if ((ptr % sizeof(RVALUE)) == (4 << 2)) { - ID symid = ptr / sizeof(RVALUE); - if (rb_id2name(symid) == 0) - rb_raise(rb_eRangeError, "%p is not symbol id value", p0); - return ID2SYM(symid); - } - - if (!is_pointer_to_heap((void *)ptr)|| - (type = BUILTIN_TYPE(ptr)) > T_SYMBOL || type == T_ICLASS) { - rb_raise(rb_eRangeError, "0x%lx is not id value", p0); - } - if (BUILTIN_TYPE(ptr) == 0 || RBASIC(ptr)->klass == 0) { - rb_raise(rb_eRangeError, "0x%lx is recycled object", p0); - } - return (VALUE)ptr; -} - -/* - * Document-method: __id__ - * Document-method: object_id - * - * call-seq: - * obj.__id__ => fixnum - * obj.object_id => fixnum - * - * Returns an integer identifier for obj. The same number will - * be returned on all calls to id for a given object, and - * no two active objects will share an id. - * Object#object_id is a different concept from the - * :name notation, which returns the symbol id of - * name. Replaces the deprecated Object#id. - */ - -/* - * call-seq: - * obj.hash => fixnum - * - * Generates a Fixnum hash value for this object. This - * function must have the property that a.eql?(b) implies - * a.hash == b.hash. The hash value is used by class - * Hash. Any hash value that exceeds the capacity of a - * Fixnum will be truncated before being used. - */ - -VALUE -rb_obj_id(VALUE obj) -{ - /* - * 32-bit VALUE space - * MSB ------------------------ LSB - * false 00000000000000000000000000000000 - * true 00000000000000000000000000000010 - * nil 00000000000000000000000000000100 - * undef 00000000000000000000000000000110 - * symbol ssssssssssssssssssssssss00001110 - * object oooooooooooooooooooooooooooooo00 = 0 (mod sizeof(RVALUE)) - * fixnum fffffffffffffffffffffffffffffff1 - * - * object_id space - * LSB - * false 00000000000000000000000000000000 - * true 00000000000000000000000000000010 - * nil 00000000000000000000000000000100 - * undef 00000000000000000000000000000110 - * symbol 000SSSSSSSSSSSSSSSSSSSSSSSSSSS0 S...S % A = 4 (S...S = s...s * A + 4) - * object oooooooooooooooooooooooooooooo0 o...o % A = 0 - * fixnum fffffffffffffffffffffffffffffff1 bignum if required - * - * where A = sizeof(RVALUE)/4 - * - * sizeof(RVALUE) is - * 20 if 32-bit, double is 4-byte aligned - * 24 if 32-bit, double is 8-byte aligned - * 40 if 64-bit - */ - if (TYPE(obj) == T_SYMBOL) { - return (SYM2ID(obj) * sizeof(RVALUE) + (4 << 2)) | FIXNUM_FLAG; - } - if (SPECIAL_CONST_P(obj)) { - return LONG2NUM((long)obj); - } - return (VALUE)((long)obj|FIXNUM_FLAG); -} - -/* - * The GC module provides an interface to Ruby's mark and - * sweep garbage collection mechanism. Some of the underlying methods - * are also available via the ObjectSpace module. - */ - -void -Init_GC() -{ - VALUE rb_mObSpace; - - rb_mGC = rb_define_module("GC"); - rb_define_singleton_method(rb_mGC, "start", rb_gc_start, 0); - rb_define_singleton_method(rb_mGC, "enable", rb_gc_enable, 0); - rb_define_singleton_method(rb_mGC, "disable", rb_gc_disable, 0); - rb_define_method(rb_mGC, "garbage_collect", rb_gc_start, 0); - - rb_mObSpace = rb_define_module("ObjectSpace"); - rb_define_module_function(rb_mObSpace, "each_object", os_each_obj, -1); - rb_define_module_function(rb_mObSpace, "garbage_collect", rb_gc_start, 0); - rb_define_module_function(rb_mObSpace, "add_finalizer", add_final, 1); - rb_define_module_function(rb_mObSpace, "remove_finalizer", rm_final, 1); - rb_define_module_function(rb_mObSpace, "finalizers", finals, 0); - rb_define_module_function(rb_mObSpace, "call_finalizer", call_final, 1); - - rb_define_module_function(rb_mObSpace, "define_finalizer", define_final, -1); - rb_define_module_function(rb_mObSpace, "undefine_finalizer", undefine_final, 1); - - rb_define_module_function(rb_mObSpace, "_id2ref", id2ref, 1); - - rb_gc_register_address(&rb_mObSpace); - rb_global_variable(&finalizers); - rb_gc_unregister_address(&rb_mObSpace); - finalizers = rb_ary_new(); - - source_filenames = st_init_strtable(); - - rb_global_variable(&nomem_error); - nomem_error = rb_exc_new3(rb_eNoMemError, - rb_obj_freeze(rb_str_new2("failed to allocate memory"))); - OBJ_TAINT(nomem_error); - OBJ_FREEZE(nomem_error); - - rb_define_method(rb_mKernel, "hash", rb_obj_id, 0); - rb_define_method(rb_mKernel, "__id__", rb_obj_id, 0); - rb_define_method(rb_mKernel, "object_id", rb_obj_id, 0); -} -/********************************************************************** - - hash.c - - - $Author: shyouhei $ - $Date: 2007-08-22 05:42:36 +0200 (Wed, 22 Aug 2007) $ - created at: Mon Nov 22 18:51:18 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#include "ruby.h" -#include "st.h" -#include "util.h" -#include "rubysig.h" - -#ifdef __APPLE__ -#include -#endif - -#define HASH_DELETED FL_USER1 -#define HASH_PROC_DEFAULT FL_USER2 - -static void -rb_hash_modify(hash) - VALUE hash; -{ - if (!RHASH(hash)->tbl) rb_raise(rb_eTypeError, "uninitialized Hash"); - if (OBJ_FROZEN(hash)) rb_error_frozen("hash"); - if (!OBJ_TAINTED(hash) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't modify hash"); -} - -VALUE -rb_hash_freeze(hash) - VALUE hash; -{ - return rb_obj_freeze(hash); -} - -VALUE rb_cHash; - -static VALUE envtbl; -static ID id_hash, id_call, id_default; - -static VALUE -eql(args) - VALUE *args; -{ - return (VALUE)rb_eql(args[0], args[1]); -} - -static int -rb_any_cmp(a, b) - VALUE a, b; -{ - VALUE args[2]; - - if (a == b) return 0; - if (FIXNUM_P(a) && FIXNUM_P(b)) { - return a != b; - } - if (TYPE(a) == T_STRING && RBASIC(a)->klass == rb_cString && - TYPE(b) == T_STRING && RBASIC(b)->klass == rb_cString) { - return rb_str_cmp(a, b); - } - if (a == Qundef || b == Qundef) return -1; - if (SYMBOL_P(a) && SYMBOL_P(b)) { - return a != b; - } - - args[0] = a; - args[1] = b; - return !rb_with_disable_interrupt(eql, (VALUE)args); -} - -VALUE -rb_hash(obj) - VALUE obj; -{ - return rb_funcall(obj, id_hash, 0); -} - -static int -rb_any_hash(a) - VALUE a; -{ - VALUE hval; - - switch (TYPE(a)) { - case T_FIXNUM: - case T_SYMBOL: - return (int)a; - break; - - case T_STRING: - return rb_str_hash(a); - break; - - default: - hval = rb_funcall(a, id_hash, 0); - if (!FIXNUM_P(hval)) { - hval = rb_funcall(hval, '%', 1, INT2FIX(536870923)); - } - return (int)FIX2LONG(hval); - } -} - -static struct st_hash_type objhash = { - rb_any_cmp, - rb_any_hash, -}; - -struct foreach_safe_arg { - st_table *tbl; - int (*func)(); - st_data_t arg; -}; - -static int -foreach_safe_i(key, value, arg) - st_data_t key, value; - struct foreach_safe_arg *arg; -{ - int status; - - if (key == Qundef) return ST_CONTINUE; - status = (*arg->func)(key, value, arg->arg); - if (status == ST_CONTINUE) { - return ST_CHECK; - } - return status; -} - -void -st_foreach_safe(table, func, a) - st_table *table; - int (*func)(); - st_data_t a; -{ - struct foreach_safe_arg arg; - - arg.tbl = table; - arg.func = func; - arg.arg = a; - if (st_foreach(table, foreach_safe_i, (st_data_t)&arg)) { - rb_raise(rb_eRuntimeError, "hash modified during iteration"); - } -} - -struct hash_foreach_arg { - VALUE hash; - int (*func)(); - VALUE arg; -}; - -static int -hash_foreach_iter(key, value, arg) - VALUE key, value; - struct hash_foreach_arg *arg; -{ - int status; - st_table *tbl; - - tbl = RHASH(arg->hash)->tbl; - if (key == Qundef) return ST_CONTINUE; - status = (*arg->func)(key, value, arg->arg); - if (RHASH(arg->hash)->tbl != tbl) { - rb_raise(rb_eRuntimeError, "rehash occurred during iteration"); - } - switch (status) { - case ST_DELETE: - st_delete_safe(tbl, (st_data_t*)&key, 0, Qundef); - FL_SET(arg->hash, HASH_DELETED); - case ST_CONTINUE: - break; - case ST_STOP: - return ST_STOP; - } - return ST_CHECK; -} - -static VALUE -hash_foreach_ensure(hash) - VALUE hash; -{ - RHASH(hash)->iter_lev--; - - if (RHASH(hash)->iter_lev == 0) { - if (FL_TEST(hash, HASH_DELETED)) { - st_cleanup_safe(RHASH(hash)->tbl, Qundef); - FL_UNSET(hash, HASH_DELETED); - } - } - return 0; -} - -static VALUE -hash_foreach_call(arg) - struct hash_foreach_arg *arg; -{ - if (st_foreach(RHASH(arg->hash)->tbl, hash_foreach_iter, (st_data_t)arg)) { - rb_raise(rb_eRuntimeError, "hash modified during iteration"); - } - return Qnil; -} - -void -rb_hash_foreach(hash, func, farg) - VALUE hash; - int (*func)(); - VALUE farg; -{ - struct hash_foreach_arg arg; - - RHASH(hash)->iter_lev++; - arg.hash = hash; - arg.func = func; - arg.arg = farg; - rb_ensure(hash_foreach_call, (VALUE)&arg, hash_foreach_ensure, hash); -} - -static VALUE hash_alloc0 _((VALUE)); -static VALUE hash_alloc _((VALUE)); -static VALUE -hash_alloc0(klass) - VALUE klass; -{ - NEWOBJ(hash, struct RHash); - OBJSETUP(hash, klass, T_HASH); - - hash->ifnone = Qnil; - - return (VALUE)hash; -} - -static VALUE -hash_alloc(klass) - VALUE klass; -{ - VALUE hash = hash_alloc0(klass); - - RHASH(hash)->tbl = st_init_table(&objhash); - - return hash; -} - -VALUE -rb_hash_new() -{ - return hash_alloc(rb_cHash); -} - -/* - * call-seq: - * Hash.new => hash - * Hash.new(obj) => aHash - * Hash.new {|hash, key| block } => aHash - * - * Returns a new, empty hash. If this hash is subsequently accessed by - * a key that doesn't correspond to a hash entry, the value returned - * depends on the style of new used to create the hash. In - * the first form, the access returns nil. If - * obj is specified, this single object will be used for - * all default values. If a block is specified, it will be - * called with the hash object and the key, and should return the - * default value. It is the block's responsibility to store the value - * in the hash if required. - * - * h = Hash.new("Go Fish") - * h["a"] = 100 - * h["b"] = 200 - * h["a"] #=> 100 - * h["c"] #=> "Go Fish" - * # The following alters the single default object - * h["c"].upcase! #=> "GO FISH" - * h["d"] #=> "GO FISH" - * h.keys #=> ["a", "b"] - * - * # While this creates a new default object each time - * h = Hash.new { |hash, key| hash[key] = "Go Fish: #{key}" } - * h["c"] #=> "Go Fish: c" - * h["c"].upcase! #=> "GO FISH: C" - * h["d"] #=> "Go Fish: d" - * h.keys #=> ["c", "d"] - * - */ - -static VALUE -rb_hash_initialize(argc, argv, hash) - int argc; - VALUE *argv; - VALUE hash; -{ - VALUE ifnone; - - rb_hash_modify(hash); - if (rb_block_given_p()) { - if (argc > 0) { - rb_raise(rb_eArgError, "wrong number of arguments"); - } - RHASH(hash)->ifnone = rb_block_proc(); - FL_SET(hash, HASH_PROC_DEFAULT); - } - else { - rb_scan_args(argc, argv, "01", &ifnone); - RHASH(hash)->ifnone = ifnone; - } - - return hash; -} - -/* - * call-seq: - * Hash[ [key =>|, value]* ] => hash - * - * Creates a new hash populated with the given objects. Equivalent to - * the literal { key, value, ... }. Keys and - * values occur in pairs, so there must be an even number of arguments. - * - * Hash["a", 100, "b", 200] #=> {"a"=>100, "b"=>200} - * Hash["a" => 100, "b" => 200] #=> {"a"=>100, "b"=>200} - * { "a" => 100, "b" => 200 } #=> {"a"=>100, "b"=>200} - */ - -static VALUE -rb_hash_s_create(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - VALUE hash; - int i; - - if (argc == 1 && TYPE(argv[0]) == T_HASH) { - hash = hash_alloc0(klass); - RHASH(hash)->tbl = st_copy(RHASH(argv[0])->tbl); - - return hash; - } - - if (argc % 2 != 0) { - rb_raise(rb_eArgError, "odd number of arguments for Hash"); - } - - hash = hash_alloc(klass); - for (i=0; i hsh - * - * Rebuilds the hash based on the current hash values for each key. If - * values of key objects have changed since they were inserted, this - * method will reindex hsh. If Hash#rehash is - * called while an iterator is traversing the hash, an - * IndexError will be raised in the iterator. - * - * a = [ "a", "b" ] - * c = [ "c", "d" ] - * h = { a => 100, c => 300 } - * h[a] #=> 100 - * a[0] = "z" - * h[a] #=> nil - * h.rehash #=> {["z", "b"]=>100, ["c", "d"]=>300} - * h[a] #=> 100 - */ - -static VALUE -rb_hash_rehash(hash) - VALUE hash; -{ - st_table *tbl; - - rb_hash_modify(hash); - tbl = st_init_table_with_size(&objhash, RHASH(hash)->tbl->num_entries); - rb_hash_foreach(hash, rb_hash_rehash_i, (st_data_t)tbl); - st_free_table(RHASH(hash)->tbl); - RHASH(hash)->tbl = tbl; - - return hash; -} - -/* - * call-seq: - * hsh[key] => value - * - * Element Reference---Retrieves the value object corresponding - * to the key object. If not found, returns the a default value (see - * Hash::new for details). - * - * h = { "a" => 100, "b" => 200 } - * h["a"] #=> 100 - * h["c"] #=> nil - * - */ - -VALUE -rb_hash_aref(hash, key) - VALUE hash, key; -{ - VALUE val; - - if (!st_lookup(RHASH(hash)->tbl, key, &val)) { - return rb_funcall(hash, id_default, 1, key); - } - return val; -} - -/* - * call-seq: - * hsh.fetch(key [, default] ) => obj - * hsh.fetch(key) {| key | block } => obj - * - * Returns a value from the hash for the given key. If the key can't be - * found, there are several options: With no other arguments, it will - * raise an IndexError exception; if default is - * given, then that will be returned; if the optional code block is - * specified, then that will be run and its result returned. - * - * h = { "a" => 100, "b" => 200 } - * h.fetch("a") #=> 100 - * h.fetch("z", "go fish") #=> "go fish" - * h.fetch("z") { |el| "go fish, #{el}"} #=> "go fish, z" - * - * The following example shows that an exception is raised if the key - * is not found and a default value is not supplied. - * - * h = { "a" => 100, "b" => 200 } - * h.fetch("z") - * - * produces: - * - * prog.rb:2:in `fetch': key not found (IndexError) - * from prog.rb:2 - * - */ - -static VALUE -rb_hash_fetch(argc, argv, hash) - int argc; - VALUE *argv; - VALUE hash; -{ - VALUE key, if_none; - VALUE val; - long block_given; - - rb_scan_args(argc, argv, "11", &key, &if_none); - - block_given = rb_block_given_p(); - if (block_given && argc == 2) { - rb_warn("block supersedes default value argument"); - } - if (!st_lookup(RHASH(hash)->tbl, key, &val)) { - if (block_given) return rb_yield(key); - if (argc == 1) { - rb_raise(rb_eIndexError, "key not found"); - } - return if_none; - } - return val; -} - -/* - * call-seq: - * hsh.default(key=nil) => obj - * - * Returns the default value, the value that would be returned by - * hsh[key] if key did not exist in hsh. - * See also Hash::new and Hash#default=. - * - * h = Hash.new #=> {} - * h.default #=> nil - * h.default(2) #=> nil - * - * h = Hash.new("cat") #=> {} - * h.default #=> "cat" - * h.default(2) #=> "cat" - * - * h = Hash.new {|h,k| h[k] = k.to_i*10} #=> {} - * h.default #=> 0 - * h.default(2) #=> 20 - */ - -static VALUE -rb_hash_default(argc, argv, hash) - int argc; - VALUE *argv; - VALUE hash; -{ - VALUE key; - - rb_scan_args(argc, argv, "01", &key); - if (FL_TEST(hash, HASH_PROC_DEFAULT)) { - if (argc == 0) return Qnil; - return rb_funcall(RHASH(hash)->ifnone, id_call, 2, hash, key); - } - return RHASH(hash)->ifnone; -} - -/* - * call-seq: - * hsh.default = obj => hsh - * - * Sets the default value, the value returned for a key that does not - * exist in the hash. It is not possible to set the a default to a - * Proc that will be executed on each key lookup. - * - * h = { "a" => 100, "b" => 200 } - * h.default = "Go fish" - * h["a"] #=> 100 - * h["z"] #=> "Go fish" - * # This doesn't do what you might hope... - * h.default = proc do |hash, key| - * hash[key] = key + key - * end - * h[2] #=> # - * h["cat"] #=> # - */ - -static VALUE -rb_hash_set_default(hash, ifnone) - VALUE hash, ifnone; -{ - rb_hash_modify(hash); - RHASH(hash)->ifnone = ifnone; - FL_UNSET(hash, HASH_PROC_DEFAULT); - return ifnone; -} - -/* - * call-seq: - * hsh.default_proc -> anObject - * - * If Hash::new was invoked with a block, return that - * block, otherwise return nil. - * - * h = Hash.new {|h,k| h[k] = k*k } #=> {} - * p = h.default_proc #=> # - * a = [] #=> [] - * p.call(a, 2) - * a #=> [nil, nil, 4] - */ - - -static VALUE -rb_hash_default_proc(hash) - VALUE hash; -{ - if (FL_TEST(hash, HASH_PROC_DEFAULT)) { - return RHASH(hash)->ifnone; - } - return Qnil; -} - -static int -index_i(key, value, args) - VALUE key, value; - VALUE *args; -{ - if (rb_equal(value, args[0])) { - args[1] = key; - return ST_STOP; - } - return ST_CONTINUE; -} - -static VALUE -rb_hash_delete_key(hash, key) - VALUE hash, key; -{ - st_data_t ktmp = (st_data_t)key, val; - - if (RHASH(hash)->iter_lev > 0) { - if (st_delete_safe(RHASH(hash)->tbl, &ktmp, &val, Qundef)) { - FL_SET(hash, HASH_DELETED); - return (VALUE)val; - } - } - else if (st_delete(RHASH(hash)->tbl, &ktmp, &val)) - return (VALUE)val; - return Qundef; -} - -/* - * call-seq: - * hsh.index(value) => key - * - * Returns the key for a given value. If not found, returns nil. - * - * h = { "a" => 100, "b" => 200 } - * h.index(200) #=> "b" - * h.index(999) #=> nil - * - */ - -static VALUE -rb_hash_index(hash, value) - VALUE hash, value; -{ - VALUE args[2]; - - args[0] = value; - args[1] = Qnil; - - rb_hash_foreach(hash, index_i, (st_data_t)args); - - return args[1]; -} - -/* - * call-seq: - * hsh.indexes(key, ...) => array - * hsh.indices(key, ...) => array - * - * Deprecated in favor of Hash#select. - * - */ - -static VALUE -rb_hash_indexes(argc, argv, hash) - int argc; - VALUE *argv; - VALUE hash; -{ - VALUE indexes; - int i; - - rb_warn("Hash#%s is deprecated; use Hash#values_at", - rb_id2name(rb_frame_last_func())); - indexes = rb_ary_new2(argc); - for (i=0; iptr[i] = rb_hash_aref(hash, argv[i]); - RARRAY(indexes)->len++; - } - return indexes; -} - -/* - * call-seq: - * hsh.delete(key) => value - * hsh.delete(key) {| key | block } => value - * - * Deletes and returns a key-value pair from hsh whose key is - * equal to key. If the key is not found, returns the - * default value. If the optional code block is given and the - * key is not found, pass in the key and return the result of - * block. - * - * h = { "a" => 100, "b" => 200 } - * h.delete("a") #=> 100 - * h.delete("z") #=> nil - * h.delete("z") { |el| "#{el} not found" } #=> "z not found" - * - */ - -VALUE -rb_hash_delete(hash, key) - VALUE hash, key; -{ - VALUE val; - - rb_hash_modify(hash); - val = rb_hash_delete_key(hash, key); - if (val != Qundef) return val; - if (rb_block_given_p()) { - return rb_yield(key); - } - return Qnil; -} - -struct shift_var { - VALUE key; - VALUE val; -}; - -static int -shift_i(key, value, var) - VALUE key, value; - struct shift_var *var; -{ - if (key == Qundef) return ST_CONTINUE; - if (var->key != Qundef) return ST_STOP; - var->key = key; - var->val = value; - return ST_DELETE; -} - -static int -shift_i_safe(key, value, var) - VALUE key, value; - struct shift_var *var; -{ - if (key == Qundef) return ST_CONTINUE; - var->key = key; - var->val = value; - return ST_STOP; -} - -/* - * call-seq: - * hsh.shift -> anArray or obj - * - * Removes a key-value pair from hsh and returns it as the - * two-item array [ key, value ], or - * the hash's default value if the hash is empty. - * - * h = { 1 => "a", 2 => "b", 3 => "c" } - * h.shift #=> [1, "a"] - * h #=> {2=>"b", 3=>"c"} - */ - -static VALUE -rb_hash_shift(hash) - VALUE hash; -{ - struct shift_var var; - - rb_hash_modify(hash); - var.key = Qundef; - if (RHASH(hash)->iter_lev > 0) { - rb_hash_foreach(hash, shift_i_safe, (st_data_t)&var); - if (var.key != Qundef) { - st_data_t key = var.key; - if (st_delete_safe(RHASH(hash)->tbl, &key, 0, Qundef)) { - FL_SET(hash, HASH_DELETED); - } - } - } - else { - rb_hash_foreach(hash, shift_i, (st_data_t)&var); - } - - if (var.key != Qundef) { - return rb_assoc_new(var.key, var.val); - } - else if (FL_TEST(hash, HASH_PROC_DEFAULT)) { - return rb_funcall(RHASH(hash)->ifnone, id_call, 2, hash, Qnil); - } - else { - return RHASH(hash)->ifnone; - } -} - -static int -delete_if_i(key, value, hash) - VALUE key, value, hash; -{ - if (key == Qundef) return ST_CONTINUE; - if (RTEST(rb_yield_values(2, key, value))) { - rb_hash_delete_key(hash, key); - } - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.delete_if {| key, value | block } -> hsh - * - * Deletes every key-value pair from hsh for which block - * evaluates to true. - * - * h = { "a" => 100, "b" => 200, "c" => 300 } - * h.delete_if {|key, value| key >= "b" } #=> {"a"=>100} - * - */ - -VALUE -rb_hash_delete_if(hash) - VALUE hash; -{ - rb_hash_modify(hash); - rb_hash_foreach(hash, delete_if_i, hash); - return hash; -} - -/* - * call-seq: - * hsh.reject! {| key, value | block } -> hsh or nil - * - * Equivalent to Hash#delete_if, but returns - * nil if no changes were made. - */ - -VALUE -rb_hash_reject_bang(hash) - VALUE hash; -{ - int n = RHASH(hash)->tbl->num_entries; - rb_hash_delete_if(hash); - if (n == RHASH(hash)->tbl->num_entries) return Qnil; - return hash; -} - -/* - * call-seq: - * hsh.reject {| key, value | block } -> a_hash - * - * Same as Hash#delete_if, but works on (and returns) a - * copy of the hsh. Equivalent to - * hsh.dup.delete_if. - * - */ - -static VALUE -rb_hash_reject(hash) - VALUE hash; -{ - return rb_hash_delete_if(rb_obj_dup(hash)); -} - -static int -select_i(key, value, result) - VALUE key, value, result; -{ - if (key == Qundef) return ST_CONTINUE; - if (RTEST(rb_yield_values(2, key, value))) - rb_ary_push(result, rb_assoc_new(key, value)); - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.values_at(key, ...) => array - * - * Return an array containing the values associated with the given keys. - * Also see Hash.select. - * - * h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" } - * h.values_at("cow", "cat") #=> ["bovine", "feline"] -*/ - -VALUE -rb_hash_values_at(argc, argv, hash) - int argc; - VALUE *argv; - VALUE hash; -{ - VALUE result = rb_ary_new(); - long i; - - for (i=0; i array - * - * Returns a new array consisting of [key,value] - * pairs for which the block returns true. - * Also see Hash.values_at. - * - * h = { "a" => 100, "b" => 200, "c" => 300 } - * h.select {|k,v| k > "a"} #=> [["b", 200], ["c", 300]] - * h.select {|k,v| v < 200} #=> [["a", 100]] - */ - -VALUE -rb_hash_select(argc, argv, hash) - int argc; - VALUE *argv; - VALUE hash; -{ - VALUE result; - - if (argc > 0) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc); - } - result = rb_ary_new(); - rb_hash_foreach(hash, select_i, result); - return result; -} - -static int -clear_i(key, value, dummy) - VALUE key, value, dummy; -{ - return ST_DELETE; -} - -/* - * call-seq: - * hsh.clear -> hsh - * - * Removes all key-value pairs from hsh. - * - * h = { "a" => 100, "b" => 200 } #=> {"a"=>100, "b"=>200} - * h.clear #=> {} - * - */ - -static VALUE -rb_hash_clear(hash) - VALUE hash; -{ - rb_hash_modify(hash); - if (RHASH(hash)->tbl->num_entries > 0) { - rb_hash_foreach(hash, clear_i, 0); - } - - return hash; -} - -/* - * call-seq: - * hsh[key] = value => value - * hsh.store(key, value) => value - * - * Element Assignment---Associates the value given by - * value with the key given by key. - * key should not have its value changed while it is in - * use as a key (a String passed as a key will be - * duplicated and frozen). - * - * h = { "a" => 100, "b" => 200 } - * h["a"] = 9 - * h["c"] = 4 - * h #=> {"a"=>9, "b"=>200, "c"=>4} - * - */ - -VALUE -rb_hash_aset(hash, key, val) - VALUE hash, key, val; -{ - rb_hash_modify(hash); - if (TYPE(key) != T_STRING || st_lookup(RHASH(hash)->tbl, key, 0)) { - st_insert(RHASH(hash)->tbl, key, val); - } - else { - st_add_direct(RHASH(hash)->tbl, rb_str_new4(key), val); - } - return val; -} - -static int -replace_i(key, val, hash) - VALUE key, val, hash; -{ - if (key != Qundef) { - rb_hash_aset(hash, key, val); - } - - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.replace(other_hash) -> hsh - * - * Replaces the contents of hsh with the contents of - * other_hash. - * - * h = { "a" => 100, "b" => 200 } - * h.replace({ "c" => 300, "d" => 400 }) #=> {"c"=>300, "d"=>400} - * - */ - -static VALUE -rb_hash_replace(hash, hash2) - VALUE hash, hash2; -{ - hash2 = to_hash(hash2); - if (hash == hash2) return hash; - rb_hash_clear(hash); - rb_hash_foreach(hash2, replace_i, hash); - RHASH(hash)->ifnone = RHASH(hash2)->ifnone; - if (FL_TEST(hash2, HASH_PROC_DEFAULT)) { - FL_SET(hash, HASH_PROC_DEFAULT); - } - else { - FL_UNSET(hash, HASH_PROC_DEFAULT); - } - - return hash; -} - -/* - * call-seq: - * hsh.length => fixnum - * hsh.size => fixnum - * - * Returns the number of key-value pairs in the hash. - * - * h = { "d" => 100, "a" => 200, "v" => 300, "e" => 400 } - * h.length #=> 4 - * h.delete("a") #=> 200 - * h.length #=> 3 - */ - -static VALUE -rb_hash_size(hash) - VALUE hash; -{ - return INT2FIX(RHASH(hash)->tbl->num_entries); -} - - -/* - * call-seq: - * hsh.empty? => true or false - * - * Returns true if hsh contains no key-value pairs. - * - * {}.empty? #=> true - * - */ - -static VALUE -rb_hash_empty_p(hash) - VALUE hash; -{ - if (RHASH(hash)->tbl->num_entries == 0) - return Qtrue; - return Qfalse; -} - -static int -each_value_i(key, value) - VALUE key, value; -{ - if (key == Qundef) return ST_CONTINUE; - rb_yield(value); - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.each_value {| value | block } -> hsh - * - * Calls block once for each key in hsh, passing the - * value as a parameter. - * - * h = { "a" => 100, "b" => 200 } - * h.each_value {|value| puts value } - * - * produces: - * - * 100 - * 200 - */ - -static VALUE -rb_hash_each_value(hash) - VALUE hash; -{ - rb_hash_foreach(hash, each_value_i, 0); - return hash; -} - -static int -each_key_i(key, value) - VALUE key, value; -{ - if (key == Qundef) return ST_CONTINUE; - rb_yield(key); - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.each_key {| key | block } -> hsh - * - * Calls block once for each key in hsh, passing the key - * as a parameter. - * - * h = { "a" => 100, "b" => 200 } - * h.each_key {|key| puts key } - * - * produces: - * - * a - * b - */ -static VALUE -rb_hash_each_key(hash) - VALUE hash; -{ - rb_hash_foreach(hash, each_key_i, 0); - return hash; -} - -static int -each_pair_i(key, value) - VALUE key, value; -{ - if (key == Qundef) return ST_CONTINUE; - rb_yield_values(2, key, value); - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.each_pair {| key_value_array | block } -> hsh - * - * Calls block once for each key in hsh, passing the key - * and value as parameters. - * - * h = { "a" => 100, "b" => 200 } - * h.each_pair {|key, value| puts "#{key} is #{value}" } - * - * produces: - * - * a is 100 - * b is 200 - * - */ - -static VALUE -rb_hash_each_pair(hash) - VALUE hash; -{ - rb_hash_foreach(hash, each_pair_i, 0); - return hash; -} - -static int -each_i(key, value) - VALUE key, value; -{ - if (key == Qundef) return ST_CONTINUE; - rb_yield(rb_assoc_new(key, value)); - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.each {| key, value | block } -> hsh - * - * Calls block once for each key in hsh, passing the key - * and value to the block as a two-element array. Because of the assignment - * semantics of block parameters, these elements will be split out if the - * block has two formal parameters. Also see Hash.each_pair, which - * will be marginally more efficient for blocks with two parameters. - * - * h = { "a" => 100, "b" => 200 } - * h.each {|key, value| puts "#{key} is #{value}" } - * - * produces: - * - * a is 100 - * b is 200 - * - */ - -static VALUE -rb_hash_each(hash) - VALUE hash; -{ - rb_hash_foreach(hash, each_i, 0); - return hash; -} - -static int -to_a_i(key, value, ary) - VALUE key, value, ary; -{ - if (key == Qundef) return ST_CONTINUE; - rb_ary_push(ary, rb_assoc_new(key, value)); - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.to_a -> array - * - * Converts hsh to a nested array of [ key, - * value ] arrays. - * - * h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 } - * h.to_a #=> [["a", 100], ["c", 300], ["d", 400]] - */ - -static VALUE -rb_hash_to_a(hash) - VALUE hash; -{ - VALUE ary; - - ary = rb_ary_new(); - rb_hash_foreach(hash, to_a_i, ary); - if (OBJ_TAINTED(hash)) OBJ_TAINT(ary); - - return ary; -} - -/* - * call-seq: - * hsh.sort => array - * hsh.sort {| a, b | block } => array - * - * Converts hsh to a nested array of [ key, - * value ] arrays and sorts it, using - * Array#sort. - * - * h = { "a" => 20, "b" => 30, "c" => 10 } - * h.sort #=> [["a", 20], ["b", 30], ["c", 10]] - * h.sort {|a,b| a[1]<=>b[1]} #=> [["c", 10], ["a", 20], ["b", 30]] - * - */ - -static VALUE -rb_hash_sort(hash) - VALUE hash; -{ - VALUE entries = rb_hash_to_a(hash); - rb_ary_sort_bang(entries); - return entries; -} - -static int -inspect_i(key, value, str) - VALUE key, value, str; -{ - VALUE str2; - - if (key == Qundef) return ST_CONTINUE; - if (RSTRING(str)->len > 1) { - rb_str_cat2(str, ", "); - } - str2 = rb_inspect(key); - rb_str_buf_append(str, str2); - OBJ_INFECT(str, str2); - rb_str_buf_cat2(str, "=>"); - str2 = rb_inspect(value); - rb_str_buf_append(str, str2); - OBJ_INFECT(str, str2); - - return ST_CONTINUE; -} - -static VALUE -inspect_hash(hash) - VALUE hash; -{ - VALUE str; - - str = rb_str_buf_new2("{"); - rb_hash_foreach(hash, inspect_i, str); - rb_str_buf_cat2(str, "}"); - OBJ_INFECT(str, hash); - - return str; -} - -/* - * call-seq: - * hsh.inspect => string - * - * Return the contents of this hash as a string. - */ - -static VALUE -rb_hash_inspect(hash) - VALUE hash; -{ - if (RHASH(hash)->tbl == 0 || RHASH(hash)->tbl->num_entries == 0) - return rb_str_new2("{}"); - if (rb_inspecting_p(hash)) return rb_str_new2("{...}"); - return rb_protect_inspect(inspect_hash, hash, 0); -} - -static VALUE -to_s_hash(hash) - VALUE hash; -{ - return rb_ary_to_s(rb_hash_to_a(hash)); -} - -/* - * call-seq: - * hsh.to_s => string - * - * Converts hsh to a string by converting the hash to an array - * of [ key, value ] pairs and then - * converting that array to a string using Array#join with - * the default separator. - * - * h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 } - * h.to_s #=> "a100c300d400" - */ - -static VALUE -rb_hash_to_s(hash) - VALUE hash; -{ - if (rb_inspecting_p(hash)) return rb_str_new2("{...}"); - return rb_protect_inspect(to_s_hash, hash, 0); -} - -/* - * call-seq: - * hsh.to_hash => hsh - * - * Returns self. - */ - -static VALUE -rb_hash_to_hash(hash) - VALUE hash; -{ - return hash; -} - -static int -keys_i(key, value, ary) - VALUE key, value, ary; -{ - if (key == Qundef) return ST_CONTINUE; - rb_ary_push(ary, key); - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.keys => array - * - * Returns a new array populated with the keys from this hash. See also - * Hash#values. - * - * h = { "a" => 100, "b" => 200, "c" => 300, "d" => 400 } - * h.keys #=> ["a", "b", "c", "d"] - * - */ - -static VALUE -rb_hash_keys(hash) - VALUE hash; -{ - VALUE ary; - - ary = rb_ary_new(); - rb_hash_foreach(hash, keys_i, ary); - - return ary; -} - -static int -values_i(key, value, ary) - VALUE key, value, ary; -{ - if (key == Qundef) return ST_CONTINUE; - rb_ary_push(ary, value); - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.values => array - * - * Returns a new array populated with the values from hsh. See - * also Hash#keys. - * - * h = { "a" => 100, "b" => 200, "c" => 300 } - * h.values #=> [100, 200, 300] - * - */ - -static VALUE -rb_hash_values(hash) - VALUE hash; -{ - VALUE ary; - - ary = rb_ary_new(); - rb_hash_foreach(hash, values_i, ary); - - return ary; -} - -/* - * call-seq: - * hsh.has_key?(key) => true or false - * hsh.include?(key) => true or false - * hsh.key?(key) => true or false - * hsh.member?(key) => true or false - * - * Returns true if the given key is present in hsh. - * - * h = { "a" => 100, "b" => 200 } - * h.has_key?("a") #=> true - * h.has_key?("z") #=> false - * - */ - -static VALUE -rb_hash_has_key(hash, key) - VALUE hash; - VALUE key; -{ - if (st_lookup(RHASH(hash)->tbl, key, 0)) { - return Qtrue; - } - return Qfalse; -} - -static int -rb_hash_search_value(key, value, data) - VALUE key, value, *data; -{ - if (key == Qundef) return ST_CONTINUE; - if (rb_equal(value, data[1])) { - data[0] = Qtrue; - return ST_STOP; - } - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.has_value?(value) => true or false - * hsh.value?(value) => true or false - * - * Returns true if the given value is present for some key - * in hsh. - * - * h = { "a" => 100, "b" => 200 } - * h.has_value?(100) #=> true - * h.has_value?(999) #=> false - */ - -static VALUE -rb_hash_has_value(hash, val) - VALUE hash; - VALUE val; -{ - VALUE data[2]; - - data[0] = Qfalse; - data[1] = val; - rb_hash_foreach(hash, rb_hash_search_value, (st_data_t)data); - return data[0]; -} - -struct equal_data { - int result; - st_table *tbl; -}; - -static int -equal_i(key, val1, data) - VALUE key, val1; - struct equal_data *data; -{ - VALUE val2; - - if (key == Qundef) return ST_CONTINUE; - if (!st_lookup(data->tbl, key, &val2)) { - data->result = Qfalse; - return ST_STOP; - } - if (!rb_equal(val1, val2)) { - data->result = Qfalse; - return ST_STOP; - } - return ST_CONTINUE; -} - -static VALUE -hash_equal(hash1, hash2, eql) - VALUE hash1, hash2; - int eql; /* compare default value if true */ -{ - struct equal_data data; - - if (hash1 == hash2) return Qtrue; - if (TYPE(hash2) != T_HASH) { - if (!rb_respond_to(hash2, rb_intern("to_hash"))) { - return Qfalse; - } - return rb_equal(hash2, hash1); - } - if (RHASH(hash1)->tbl->num_entries != RHASH(hash2)->tbl->num_entries) - return Qfalse; - if (eql) { - if (!(rb_equal(RHASH(hash1)->ifnone, RHASH(hash2)->ifnone) && - FL_TEST(hash1, HASH_PROC_DEFAULT) == FL_TEST(hash2, HASH_PROC_DEFAULT))) - return Qfalse; - } - - data.tbl = RHASH(hash2)->tbl; - data.result = Qtrue; - rb_hash_foreach(hash1, equal_i, (st_data_t)&data); - - return data.result; -} - -/* - * call-seq: - * hsh == other_hash => true or false - * - * Equality---Two hashes are equal if they each contain the same number - * of keys and if each key-value pair is equal to (according to - * Object#==) the corresponding elements in the other - * hash. - * - * h1 = { "a" => 1, "c" => 2 } - * h2 = { 7 => 35, "c" => 2, "a" => 1 } - * h3 = { "a" => 1, "c" => 2, 7 => 35 } - * h4 = { "a" => 1, "d" => 2, "f" => 35 } - * h1 == h2 #=> false - * h2 == h3 #=> true - * h3 == h4 #=> false - * - */ - -static VALUE -rb_hash_equal(hash1, hash2) - VALUE hash1, hash2; -{ - return hash_equal(hash1, hash2, Qfalse); -} - -static int -rb_hash_invert_i(key, value, hash) - VALUE key, value; - VALUE hash; -{ - if (key == Qundef) return ST_CONTINUE; - rb_hash_aset(hash, value, key); - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.invert -> aHash - * - * Returns a new hash created by using hsh's values as keys, and - * the keys as values. - * - * h = { "n" => 100, "m" => 100, "y" => 300, "d" => 200, "a" => 0 } - * h.invert #=> {0=>"a", 100=>"n", 200=>"d", 300=>"y"} - * - */ - -static VALUE -rb_hash_invert(hash) - VALUE hash; -{ - VALUE h = rb_hash_new(); - - rb_hash_foreach(hash, rb_hash_invert_i, h); - return h; -} - -static int -rb_hash_update_i(key, value, hash) - VALUE key, value; - VALUE hash; -{ - if (key == Qundef) return ST_CONTINUE; - rb_hash_aset(hash, key, value); - return ST_CONTINUE; -} - -static int -rb_hash_update_block_i(key, value, hash) - VALUE key, value; - VALUE hash; -{ - if (key == Qundef) return ST_CONTINUE; - if (rb_hash_has_key(hash, key)) { - value = rb_yield_values(3, key, rb_hash_aref(hash, key), value); - } - rb_hash_aset(hash, key, value); - return ST_CONTINUE; -} - -/* - * call-seq: - * hsh.merge!(other_hash) => hsh - * hsh.update(other_hash) => hsh - * hsh.merge!(other_hash){|key, oldval, newval| block} => hsh - * hsh.update(other_hash){|key, oldval, newval| block} => hsh - * - * Adds the contents of other_hash to hsh, overwriting - * entries with duplicate keys with those from other_hash. - * - * h1 = { "a" => 100, "b" => 200 } - * h2 = { "b" => 254, "c" => 300 } - * h1.merge!(h2) #=> {"a"=>100, "b"=>254, "c"=>300} - */ - -static VALUE -rb_hash_update(hash1, hash2) - VALUE hash1, hash2; -{ - hash2 = to_hash(hash2); - if (rb_block_given_p()) { - rb_hash_foreach(hash2, rb_hash_update_block_i, hash1); - } - else { - rb_hash_foreach(hash2, rb_hash_update_i, hash1); - } - return hash1; -} - -/* - * call-seq: - * hsh.merge(other_hash) -> a_hash - * hsh.merge(other_hash){|key, oldval, newval| block} -> a_hash - * - * Returns a new hash containing the contents of other_hash and - * the contents of hsh, overwriting entries in hsh with - * duplicate keys with those from other_hash. - * - * h1 = { "a" => 100, "b" => 200 } - * h2 = { "b" => 254, "c" => 300 } - * h1.merge(h2) #=> {"a"=>100, "b"=>254, "c"=>300} - * h1 #=> {"a"=>100, "b"=>200} - * - */ - -static VALUE -rb_hash_merge(hash1, hash2) - VALUE hash1, hash2; -{ - return rb_hash_update(rb_obj_dup(hash1), hash2); -} - -static int path_tainted = -1; - -static char **origenviron; -#ifdef _WIN32 -#define GET_ENVIRON(e) (e = rb_w32_get_environ()) -#define FREE_ENVIRON(e) rb_w32_free_environ(e) -static char **my_environ; -#undef environ -#define environ my_environ -#elif defined(__APPLE__) -#undef environ -#define environ (*_NSGetEnviron()) -#define GET_ENVIRON(e) (e) -#define FREE_ENVIRON(e) -#else -extern char **environ; -#define GET_ENVIRON(e) (e) -#define FREE_ENVIRON(e) -#endif - -static VALUE -env_str_new(ptr, len) - const char *ptr; - long len; -{ - VALUE str = rb_tainted_str_new(ptr, len); - - rb_obj_freeze(str); - return str; -} - -static VALUE -env_str_new2(ptr) - const char *ptr; -{ - if (!ptr) return Qnil; - return env_str_new(ptr, strlen(ptr)); -} - -static VALUE -env_delete(obj, name) - VALUE obj, name; -{ - char *nam, *val; - - rb_secure(4); - SafeStringValue(name); - nam = RSTRING(name)->ptr; - if (strlen(nam) != RSTRING(name)->len) { - rb_raise(rb_eArgError, "bad environment variable name"); - } - val = getenv(nam); - if (val) { - VALUE value = env_str_new2(val); - - ruby_setenv(nam, 0); -#ifdef ENV_IGNORECASE - if (strcasecmp(nam, PATH_ENV) == 0) -#else - if (strcmp(nam, PATH_ENV) == 0) -#endif - { - path_tainted = 0; - } - return value; - } - return Qnil; -} - -static VALUE -env_delete_m(obj, name) - VALUE obj, name; -{ - VALUE val; - - val = env_delete(obj, name); - if (NIL_P(val) && rb_block_given_p()) rb_yield(name); - return val; -} - -static VALUE -rb_f_getenv(obj, name) - VALUE obj, name; -{ - char *nam, *env; - - StringValue(name); - nam = RSTRING(name)->ptr; - if (strlen(nam) != RSTRING(name)->len) { - rb_raise(rb_eArgError, "bad environment variable name"); - } - env = getenv(nam); - if (env) { -#ifdef ENV_IGNORECASE - if (strcasecmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted()) -#else - if (strcmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted()) -#endif - { - VALUE str = rb_str_new2(env); - - rb_obj_freeze(str); - return str; - } - return env_str_new2(env); - } - return Qnil; -} - -static VALUE -env_fetch(argc, argv) - int argc; - VALUE *argv; -{ - VALUE key, if_none; - long block_given; - char *nam, *env; - - rb_scan_args(argc, argv, "11", &key, &if_none); - block_given = rb_block_given_p(); - if (block_given && argc == 2) { - rb_warn("block supersedes default value argument"); - } - StringValue(key); - nam = RSTRING(key)->ptr; - if (strlen(nam) != RSTRING(key)->len) { - rb_raise(rb_eArgError, "bad environment variable name"); - } - env = getenv(nam); - if (!env) { - if (block_given) return rb_yield(key); - if (argc == 1) { - rb_raise(rb_eIndexError, "key not found"); - } - return if_none; - } -#ifdef ENV_IGNORECASE - if (strcasecmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted()) -#else - if (strcmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted()) -#endif - return rb_str_new2(env); - return env_str_new2(env); -} - -static void -path_tainted_p(path) - char *path; -{ - path_tainted = rb_path_check(path)?0:1; -} - -int -rb_env_path_tainted() -{ - if (path_tainted < 0) { - path_tainted_p(getenv(PATH_ENV)); - } - return path_tainted; -} - -static int -envix(nam) - const char *nam; -{ - register int i, len = strlen(nam); - char **env; - - env = GET_ENVIRON(environ); - for (i = 0; env[i]; i++) { - if ( -#ifdef ENV_IGNORECASE - strncasecmp(env[i],nam,len) == 0 -#else - memcmp(env[i],nam,len) == 0 -#endif - && env[i][len] == '=') - break; /* memcmp must come first to avoid */ - } /* potential SEGV's */ - FREE_ENVIRON(environ); - return i; -} - -void -ruby_setenv(name, value) - const char *name; - const char *value; -{ -#if defined(_WIN32) - /* The sane way to deal with the environment. - * Has these advantages over putenv() & co.: - * * enables us to store a truly empty value in the - * environment (like in UNIX). - * * we don't have to deal with RTL globals, bugs and leaks. - * * Much faster. - * Why you may want to enable USE_WIN32_RTL_ENV: - * * environ[] and RTL functions will not reflect changes, - * which might be an issue if extensions want to access - * the env. via RTL. This cuts both ways, since RTL will - * not see changes made by extensions that call the Win32 - * functions directly, either. - * GSAR 97-06-07 - * - * REMARK: USE_WIN32_RTL_ENV is already obsoleted since we don't use - * RTL's environ global variable directly yet. - */ - SetEnvironmentVariable(name,value); -#elif defined(HAVE_SETENV) && defined(HAVE_UNSETENV) -#undef setenv -#undef unsetenv - if (value) - setenv(name,value,1); - else - unsetenv(name); -#else /* WIN32 */ - size_t len; - int i=envix(name); /* where does it go? */ - - if (environ == origenviron) { /* need we copy environment? */ - int j; - int max; - char **tmpenv; - - for (max = i; environ[max]; max++) ; - tmpenv = ALLOC_N(char*, max+2); - for (j=0; j= 4) { - rb_raise(rb_eSecurityError, "can't change environment variable"); - } - - if (NIL_P(val)) { - env_delete(obj, nm); - return Qnil; - } - - StringValue(nm); - StringValue(val); - name = RSTRING(nm)->ptr; - value = RSTRING(val)->ptr; - if (strlen(name) != RSTRING(nm)->len) - rb_raise(rb_eArgError, "bad environment variable name"); - if (strlen(value) != RSTRING(val)->len) - rb_raise(rb_eArgError, "bad environment variable value"); - - ruby_setenv(name, value); -#ifdef ENV_IGNORECASE - if (strcasecmp(name, PATH_ENV) == 0) { -#else - if (strcmp(name, PATH_ENV) == 0) { -#endif - if (OBJ_TAINTED(val)) { - /* already tainted, no check */ - path_tainted = 1; - return val; - } - else { - path_tainted_p(value); - } - } - return val; -} - -static VALUE -env_keys() -{ - char **env; - VALUE ary = rb_ary_new(); - - env = GET_ENVIRON(environ); - while (*env) { - char *s = strchr(*env, '='); - if (s) { - rb_ary_push(ary, env_str_new(*env, s-*env)); - } - env++; - } - FREE_ENVIRON(environ); - return ary; -} - -static VALUE -env_each_key(ehash) - VALUE ehash; -{ - VALUE keys = env_keys(); - long i; - - for (i=0; ilen; i++) { - rb_yield(RARRAY(keys)->ptr[i]); - } - return ehash; -} - -static VALUE -env_values() -{ - char **env; - VALUE ary = rb_ary_new(); - - env = GET_ENVIRON(environ); - while (*env) { - char *s = strchr(*env, '='); - if (s) { - rb_ary_push(ary, env_str_new2(s+1)); - } - env++; - } - FREE_ENVIRON(environ); - return ary; -} - -static VALUE -env_each_value(ehash) - VALUE ehash; -{ - VALUE values = env_values(); - long i; - - for (i=0; ilen; i++) { - rb_yield(RARRAY(values)->ptr[i]); - } - return ehash; -} - -static VALUE -env_each_i(ehash, values) - VALUE ehash; - int values; -{ - char **env; - VALUE ary = rb_ary_new(); - long i; - - env = GET_ENVIRON(environ); - while (*env) { - char *s = strchr(*env, '='); - if (s) { - rb_ary_push(ary, env_str_new(*env, s-*env)); - rb_ary_push(ary, env_str_new2(s+1)); - } - env++; - } - FREE_ENVIRON(environ); - - for (i=0; ilen; i+=2) { - if (values) { - rb_yield_values(2, RARRAY(ary)->ptr[i], RARRAY(ary)->ptr[i+1]); - } - else { - rb_yield(rb_assoc_new(RARRAY(ary)->ptr[i], RARRAY(ary)->ptr[i+1])); - } - } - return ehash; -} - -static VALUE -env_each(ehash) - VALUE ehash; -{ - return env_each_i(ehash, Qfalse); -} - -static VALUE -env_each_pair(ehash) - VALUE ehash; -{ - return env_each_i(ehash, Qtrue); -} - -static VALUE -env_reject_bang() -{ - volatile VALUE keys; - long i; - int del = 0; - - rb_secure(4); - keys = env_keys(); - - for (i=0; ilen; i++) { - VALUE val = rb_f_getenv(Qnil, RARRAY(keys)->ptr[i]); - if (!NIL_P(val)) { - if (RTEST(rb_yield_values(2, RARRAY(keys)->ptr[i], val))) { - FL_UNSET(RARRAY(keys)->ptr[i], FL_TAINT); - env_delete(Qnil, RARRAY(keys)->ptr[i]); - del++; - } - } - } - if (del == 0) return Qnil; - return envtbl; -} - -static VALUE -env_delete_if() -{ - env_reject_bang(); - return envtbl; -} - -static VALUE -env_values_at(argc, argv) - int argc; - VALUE *argv; -{ - VALUE result = rb_ary_new(); - long i; - - for (i=0; i 0) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc); - } - result = rb_ary_new(); - env = GET_ENVIRON(environ); - while (*env) { - char *s = strchr(*env, '='); - if (s) { - VALUE k = env_str_new(*env, s-*env); - VALUE v = env_str_new2(s+1); - if (RTEST(rb_yield_values(2, k, v))) { - rb_ary_push(result, rb_assoc_new(k, v)); - } - } - env++; - } - FREE_ENVIRON(environ); - - return result; -} - -static VALUE -env_clear() -{ - volatile VALUE keys; - long i; - - rb_secure(4); - keys = env_keys(); - - for (i=0; ilen; i++) { - VALUE val = rb_f_getenv(Qnil, RARRAY(keys)->ptr[i]); - if (!NIL_P(val)) { - env_delete(Qnil, RARRAY(keys)->ptr[i]); - } - } - return envtbl; -} - -static VALUE -env_to_s() -{ - return rb_str_new2("ENV"); -} - -static VALUE -env_inspect() -{ - char **env; - VALUE str = rb_str_buf_new2("{"); - VALUE i; - - env = GET_ENVIRON(environ); - while (*env) { - char *s = strchr(*env, '='); - - if (env != environ) { - rb_str_buf_cat2(str, ", "); - } - if (s) { - rb_str_buf_cat2(str, "\""); - rb_str_buf_cat(str, *env, s-*env); - rb_str_buf_cat2(str, "\"=>"); - i = rb_inspect(rb_str_new2(s+1)); - rb_str_buf_append(str, i); - } - env++; - } - FREE_ENVIRON(environ); - rb_str_buf_cat2(str, "}"); - OBJ_TAINT(str); - - return str; -} - -static VALUE -env_to_a() -{ - char **env; - VALUE ary = rb_ary_new(); - - env = GET_ENVIRON(environ); - while (*env) { - char *s = strchr(*env, '='); - if (s) { - rb_ary_push(ary, rb_assoc_new(env_str_new(*env, s-*env), - env_str_new2(s+1))); - } - env++; - } - FREE_ENVIRON(environ); - return ary; -} - -static VALUE -env_none() -{ - return Qnil; -} - -static VALUE -env_size() -{ - int i; - char **env; - - env = GET_ENVIRON(environ); - for(i=0; env[i]; i++) - ; - FREE_ENVIRON(environ); - return INT2FIX(i); -} - -static VALUE -env_empty_p() -{ - char **env; - - env = GET_ENVIRON(environ); - if (env[0] == 0) { - FREE_ENVIRON(environ); - return Qtrue; - } - FREE_ENVIRON(environ); - return Qfalse; -} - -static VALUE -env_has_key(env, key) - VALUE env, key; -{ - char *s; - - s = StringValuePtr(key); - if (strlen(s) != RSTRING(key)->len) - rb_raise(rb_eArgError, "bad environment variable name"); - if (getenv(s)) return Qtrue; - return Qfalse; -} - -static VALUE -env_has_value(dmy, value) - VALUE dmy, value; -{ - char **env; - - if (TYPE(value) != T_STRING) return Qfalse; - env = GET_ENVIRON(environ); - while (*env) { - char *s = strchr(*env, '='); - if (s++) { - long len = strlen(s); - if (RSTRING(value)->len == len && strncmp(s, RSTRING(value)->ptr, len) == 0) { - FREE_ENVIRON(environ); - return Qtrue; - } - } - env++; - } - FREE_ENVIRON(environ); - return Qfalse; -} - -static VALUE -env_index(dmy, value) - VALUE dmy, value; -{ - char **env; - VALUE str; - - StringValue(value); - env = GET_ENVIRON(environ); - while (*env) { - char *s = strchr(*env, '='); - if (s++) { - long len = strlen(s); - if (RSTRING(value)->len == len && strncmp(s, RSTRING(value)->ptr, len) == 0) { - str = env_str_new(*env, s-*env-1); - FREE_ENVIRON(environ); - return str; - } - } - env++; - } - FREE_ENVIRON(environ); - return Qnil; -} - -static VALUE -env_indexes(argc, argv) - int argc; - VALUE *argv; -{ - int i; - VALUE indexes = rb_ary_new2(argc); - - rb_warn("ENV.%s is deprecated; use ENV.values_at", - rb_id2name(rb_frame_last_func())); - for (i=0;iptr[i] = Qnil; - } - else { - RARRAY(indexes)->ptr[i] = env_str_new2(getenv(RSTRING(tmp)->ptr)); - } - RARRAY(indexes)->len = i+1; - } - - return indexes; -} - -static VALUE -env_to_hash() -{ - char **env; - VALUE hash = rb_hash_new(); - - env = GET_ENVIRON(environ); - while (*env) { - char *s = strchr(*env, '='); - if (s) { - rb_hash_aset(hash, env_str_new(*env, s-*env), - env_str_new2(s+1)); - } - env++; - } - FREE_ENVIRON(environ); - return hash; -} - -static VALUE -env_reject() -{ - return rb_hash_delete_if(env_to_hash()); -} - -static VALUE -env_shift() -{ - char **env; - - env = GET_ENVIRON(environ); - if (*env) { - char *s = strchr(*env, '='); - if (s) { - VALUE key = env_str_new(*env, s-*env); - VALUE val = env_str_new2(getenv(RSTRING(key)->ptr)); - env_delete(Qnil, key); - return rb_assoc_new(key, val); - } - } - FREE_ENVIRON(environ); - return Qnil; -} - -static VALUE -env_invert() -{ - return rb_hash_invert(env_to_hash()); -} - -static int -env_replace_i(key, val, keys) - VALUE key, val, keys; -{ - if (key != Qundef) { - env_aset(Qnil, key, val); - if (rb_ary_includes(keys, key)) { - rb_ary_delete(keys, key); - } - } - return ST_CONTINUE; -} - -static VALUE -env_replace(env, hash) - VALUE env, hash; -{ - volatile VALUE keys = env_keys(); - long i; - - if (env == hash) return env; - hash = to_hash(hash); - rb_hash_foreach(hash, env_replace_i, keys); - - for (i=0; ilen; i++) { - env_delete(env, RARRAY(keys)->ptr[i]); - } - return env; -} - -static int -env_update_i(key, val) - VALUE key, val; -{ - if (key != Qundef) { - if (rb_block_given_p()) { - val = rb_yield_values(3, key, rb_f_getenv(Qnil, key), val); - } - env_aset(Qnil, key, val); - } - return ST_CONTINUE; -} - -static VALUE -env_update(env, hash) - VALUE env, hash; -{ - if (env == hash) return env; - hash = to_hash(hash); - rb_hash_foreach(hash, env_update_i, 0); - return env; -} - -/* - * A Hash is a collection of key-value pairs. It is - * similar to an Array, except that indexing is done via - * arbitrary keys of any object type, not an integer index. The order - * in which you traverse a hash by either key or value may seem - * arbitrary, and will generally not be in the insertion order. - * - * Hashes have a default value that is returned when accessing - * keys that do not exist in the hash. By default, that value is - * nil. - * - * Hash uses key.eql? to test keys for equality. - * If you need to use instances of your own classes as keys in a Hash, - * it is recommended that you define both the eql? and hash - * methods. The hash method must have the property that - * a.eql?(b) implies a.hash == b.hash. - * - * class MyClass - * attr_reader :str - * def initialize(str) - * @str = str - * end - * def eql?(o) - * o.is_a?(MyClass) && str == o.str - * end - * def hash - * @str.hash - * end - * end - * - * a = MyClass.new("some string") - * b = MyClass.new("some string") - * a.eql? b #=> true - * - * h = {} - * - * h[a] = 1 - * h[a] #=> 1 - * h[b] #=> 1 - * - * h[b] = 2 - * h[a] #=> 2 - * h[b] #=> 2 - */ - -void -Init_Hash() -{ - id_hash = rb_intern("hash"); - id_call = rb_intern("call"); - id_default = rb_intern("default"); - - rb_cHash = rb_define_class("Hash", rb_cObject); - - rb_include_module(rb_cHash, rb_mEnumerable); - - rb_define_alloc_func(rb_cHash, hash_alloc); - rb_define_singleton_method(rb_cHash, "[]", rb_hash_s_create, -1); - rb_define_method(rb_cHash,"initialize", rb_hash_initialize, -1); - rb_define_method(rb_cHash,"initialize_copy", rb_hash_replace, 1); - rb_define_method(rb_cHash,"rehash", rb_hash_rehash, 0); - - rb_define_method(rb_cHash,"to_hash", rb_hash_to_hash, 0); - rb_define_method(rb_cHash,"to_a", rb_hash_to_a, 0); - rb_define_method(rb_cHash,"to_s", rb_hash_to_s, 0); - rb_define_method(rb_cHash,"inspect", rb_hash_inspect, 0); - - rb_define_method(rb_cHash,"==", rb_hash_equal, 1); - rb_define_method(rb_cHash,"[]", rb_hash_aref, 1); - rb_define_method(rb_cHash,"fetch", rb_hash_fetch, -1); - rb_define_method(rb_cHash,"[]=", rb_hash_aset, 2); - rb_define_method(rb_cHash,"store", rb_hash_aset, 2); - rb_define_method(rb_cHash,"default", rb_hash_default, -1); - rb_define_method(rb_cHash,"default=", rb_hash_set_default, 1); - rb_define_method(rb_cHash,"default_proc", rb_hash_default_proc, 0); - rb_define_method(rb_cHash,"index", rb_hash_index, 1); - rb_define_method(rb_cHash,"indexes", rb_hash_indexes, -1); - rb_define_method(rb_cHash,"indices", rb_hash_indexes, -1); - rb_define_method(rb_cHash,"size", rb_hash_size, 0); - rb_define_method(rb_cHash,"length", rb_hash_size, 0); - rb_define_method(rb_cHash,"empty?", rb_hash_empty_p, 0); - - rb_define_method(rb_cHash,"each", rb_hash_each, 0); - rb_define_method(rb_cHash,"each_value", rb_hash_each_value, 0); - rb_define_method(rb_cHash,"each_key", rb_hash_each_key, 0); - rb_define_method(rb_cHash,"each_pair", rb_hash_each_pair, 0); - rb_define_method(rb_cHash,"sort", rb_hash_sort, 0); - - rb_define_method(rb_cHash,"keys", rb_hash_keys, 0); - rb_define_method(rb_cHash,"values", rb_hash_values, 0); - rb_define_method(rb_cHash,"values_at", rb_hash_values_at, -1); - - rb_define_method(rb_cHash,"shift", rb_hash_shift, 0); - rb_define_method(rb_cHash,"delete", rb_hash_delete, 1); - rb_define_method(rb_cHash,"delete_if", rb_hash_delete_if, 0); - rb_define_method(rb_cHash,"select", rb_hash_select, -1); - rb_define_method(rb_cHash,"reject", rb_hash_reject, 0); - rb_define_method(rb_cHash,"reject!", rb_hash_reject_bang, 0); - rb_define_method(rb_cHash,"clear", rb_hash_clear, 0); - rb_define_method(rb_cHash,"invert", rb_hash_invert, 0); - rb_define_method(rb_cHash,"update", rb_hash_update, 1); - rb_define_method(rb_cHash,"replace", rb_hash_replace, 1); - rb_define_method(rb_cHash,"merge!", rb_hash_update, 1); - rb_define_method(rb_cHash,"merge", rb_hash_merge, 1); - - rb_define_method(rb_cHash,"include?", rb_hash_has_key, 1); - rb_define_method(rb_cHash,"member?", rb_hash_has_key, 1); - rb_define_method(rb_cHash,"has_key?", rb_hash_has_key, 1); - rb_define_method(rb_cHash,"has_value?", rb_hash_has_value, 1); - rb_define_method(rb_cHash,"key?", rb_hash_has_key, 1); - rb_define_method(rb_cHash,"value?", rb_hash_has_value, 1); - -#ifndef __MACOS__ /* environment variables nothing on MacOS. */ - origenviron = environ; - envtbl = rb_obj_alloc(rb_cObject); - rb_extend_object(envtbl, rb_mEnumerable); - - rb_define_singleton_method(envtbl,"[]", rb_f_getenv, 1); - rb_define_singleton_method(envtbl,"fetch", env_fetch, -1); - rb_define_singleton_method(envtbl,"[]=", env_aset, 2); - rb_define_singleton_method(envtbl,"store", env_aset, 2); - rb_define_singleton_method(envtbl,"each", env_each, 0); - rb_define_singleton_method(envtbl,"each_pair", env_each_pair, 0); - rb_define_singleton_method(envtbl,"each_key", env_each_key, 0); - rb_define_singleton_method(envtbl,"each_value", env_each_value, 0); - rb_define_singleton_method(envtbl,"delete", env_delete_m, 1); - rb_define_singleton_method(envtbl,"delete_if", env_delete_if, 0); - rb_define_singleton_method(envtbl,"clear", env_clear, 0); - rb_define_singleton_method(envtbl,"reject", env_reject, 0); - rb_define_singleton_method(envtbl,"reject!", env_reject_bang, 0); - rb_define_singleton_method(envtbl,"select", env_select, -1); - rb_define_singleton_method(envtbl,"shift", env_shift, 0); - rb_define_singleton_method(envtbl,"invert", env_invert, 0); - rb_define_singleton_method(envtbl,"replace", env_replace, 1); - rb_define_singleton_method(envtbl,"update", env_update, 1); - rb_define_singleton_method(envtbl,"inspect", env_inspect, 0); - rb_define_singleton_method(envtbl,"rehash", env_none, 0); - rb_define_singleton_method(envtbl,"to_a", env_to_a, 0); - rb_define_singleton_method(envtbl,"to_s", env_to_s, 0); - rb_define_singleton_method(envtbl,"index", env_index, 1); - rb_define_singleton_method(envtbl,"indexes", env_indexes, -1); - rb_define_singleton_method(envtbl,"indices", env_indexes, -1); - rb_define_singleton_method(envtbl,"size", env_size, 0); - rb_define_singleton_method(envtbl,"length", env_size, 0); - rb_define_singleton_method(envtbl,"empty?", env_empty_p, 0); - rb_define_singleton_method(envtbl,"keys", env_keys, 0); - rb_define_singleton_method(envtbl,"values", env_values, 0); - rb_define_singleton_method(envtbl,"values_at", env_values_at, -1); - rb_define_singleton_method(envtbl,"include?", env_has_key, 1); - rb_define_singleton_method(envtbl,"member?", env_has_key, 1); - rb_define_singleton_method(envtbl,"has_key?", env_has_key, 1); - rb_define_singleton_method(envtbl,"has_value?", env_has_value, 1); - rb_define_singleton_method(envtbl,"key?", env_has_key, 1); - rb_define_singleton_method(envtbl,"value?", env_has_value, 1); - rb_define_singleton_method(envtbl,"to_hash", env_to_hash, 0); - - rb_define_global_const("ENV", envtbl); -#else /* __MACOS__ */ - envtbl = rb_hash_s_new(0, NULL, rb_cHash); - rb_define_global_const("ENV", envtbl); -#endif /* ifndef __MACOS__ environment variables nothing on MacOS. */ -} -/********************************************************************** - - inits.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007) $ - created at: Tue Dec 28 16:01:58 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" - -void Init_Array _((void)); -void Init_Bignum _((void)); -void Init_Binding _((void)); -void Init_Comparable _((void)); -void Init_Dir _((void)); -void Init_Enumerable _((void)); -void Init_Exception _((void)); -void Init_syserr _((void)); -void Init_eval _((void)); -void Init_load _((void)); -void Init_Proc _((void)); -void Init_Thread _((void)); -void Init_File _((void)); -void Init_GC _((void)); -void Init_Hash _((void)); -void Init_IO _((void)); -void Init_Math _((void)); -void Init_marshal _((void)); -void Init_Numeric _((void)); -void Init_Object _((void)); -void Init_pack _((void)); -void Init_Precision _((void)); -void Init_sym _((void)); -void Init_process _((void)); -void Init_Random _((void)); -void Init_Range _((void)); -void Init_Regexp _((void)); -void Init_signal _((void)); -void Init_String _((void)); -void Init_Struct _((void)); -void Init_Time _((void)); -void Init_var_tables _((void)); -void Init_version _((void)); - -void -rb_call_inits() -{ - Init_sym(); - Init_var_tables(); - Init_Object(); - Init_Comparable(); - Init_Enumerable(); - Init_Precision(); - Init_eval(); - Init_String(); - Init_Exception(); - Init_Thread(); - Init_Numeric(); - Init_Bignum(); - Init_syserr(); - Init_Array(); - Init_Hash(); - Init_Struct(); - Init_Regexp(); - Init_pack(); - Init_Range(); - Init_IO(); - Init_Dir(); - Init_Time(); - Init_Random(); - Init_signal(); - Init_process(); - Init_load(); - Init_Proc(); - Init_Binding(); - Init_Math(); - Init_GC(); - Init_marshal(); - Init_version(); -} -/********************************************************************** - - io.c - - - $Author: shyouhei $ - $Date: 2009-03-09 01:52:15 +0100 (Mon, 09 Mar 2009) $ - created at: Fri Oct 15 18:08:59 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#if defined(__VMS) -#define _XOPEN_SOURCE -#define _POSIX_C_SOURCE 2 -#endif - -#include "ruby.h" -#include "rubyio.h" -#include "rubysig.h" -#include "env.h" -#include -#include - -#if defined(MSDOS) || defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__) || defined(__BEOS__) -# define NO_SAFE_RENAME -#endif - -#if defined(MSDOS) || defined(__CYGWIN__) || defined(_WIN32) -# define NO_LONG_FNAME -#endif - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(sun) || defined(_nec_ews) -# define USE_SETVBUF -#endif - -#ifdef __QNXNTO__ -#include "unix.h" -#endif - -#include -#if defined(HAVE_SYS_IOCTL_H) && !defined(DJGPP) && !defined(_WIN32) && !defined(__human68k__) -#include -#endif -#if defined(HAVE_FCNTL_H) || defined(_WIN32) -#include -#elif defined(HAVE_SYS_FCNTL_H) -#include -#endif - -#if !HAVE_OFF_T && !defined(off_t) -# define off_t long -#endif -#if !HAVE_FSEEKO && !defined(fseeko) -# define fseeko fseek -#endif -#if !HAVE_FTELLO && !defined(ftello) -# define ftello ftell -#endif - -#include - -/* EMX has sys/param.h, but.. */ -#if defined(HAVE_SYS_PARAM_H) && !(defined(__EMX__) || defined(__HIUX_MPP__)) -# include -#endif - -#if !defined NOFILE -# define NOFILE 64 -#endif - -#ifdef HAVE_UNISTD_H -#ifdef HAVE_SYSCALL_H -#include -#elif defined HAVE_SYS_SYSCALL_H -#include -#endif - -#include -#endif - -extern void Init_File _((void)); - -#ifdef __BEOS__ -# ifndef NOFILE -# define NOFILE (OPEN_MAX) -# endif -#include -#endif - -#include "util.h" - -#ifndef O_ACCMODE -#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) -#endif - -#if SIZEOF_OFF_T > SIZEOF_LONG && !defined(HAVE_LONG_LONG) -# error off_t is bigger than long, but you have no long long... -#endif - -#ifndef PIPE_BUF -# ifdef _POSIX_PIPE_BUF -# define PIPE_BUF _POSIX_PIPE_BUF -# else -# define PIPE_BUF 512 /* is this ok? */ -# endif -#endif - -VALUE rb_cIO; -VALUE rb_eEOFError; -VALUE rb_eIOError; - -VALUE rb_stdin, rb_stdout, rb_stderr; -VALUE rb_deferr; /* rescue VIM plugin */ -static VALUE orig_stdout, orig_stderr; - -VALUE rb_output_fs; -VALUE rb_rs; -VALUE rb_output_rs; -VALUE rb_default_rs; - -static VALUE argf; - -static ID id_write, id_read, id_getc; - -extern char *ruby_inplace_mode; - -struct timeval rb_time_interval _((VALUE)); - -static VALUE filename, current_file; -static int gets_lineno; -static int init_p = 0, next_p = 0; -static VALUE lineno = INT2FIX(0); - -#ifdef _STDIO_USES_IOSTREAM /* GNU libc */ -# ifdef _IO_fpos_t -# define READ_DATA_PENDING(fp) ((fp)->_IO_read_ptr != (fp)->_IO_read_end) -# define READ_DATA_PENDING_COUNT(fp) ((fp)->_IO_read_end - (fp)->_IO_read_ptr) -# define READ_DATA_PENDING_PTR(fp) ((fp)->_IO_read_ptr) -# else -# define READ_DATA_PENDING(fp) ((fp)->_gptr < (fp)->_egptr) -# define READ_DATA_PENDING_COUNT(fp) ((fp)->_egptr - (fp)->_gptr) -# define READ_DATA_PENDING_PTR(fp) ((fp)->_gptr) -# endif -#elif defined(_LP64) && (defined(__sun__) || defined(__sun)) -typedef struct _FILE64 { - unsigned char *_ptr; /* next character from/to here in buffer */ - unsigned char *_base; /* the buffer */ - unsigned char *_end; /* the end of the buffer */ - ssize_t _cnt; /* number of available characters in buffer */ - int _file; /* UNIX System file descriptor */ - unsigned int _flag; /* the state of the stream */ - char __fill[80]; /* filler to bring size to 128 bytes */ -} FILE64; -# define READ_DATA_PENDING(fp) (((FILE64*)(fp))->_cnt > 0) -# define READ_DATA_PENDING_COUNT(fp) (((FILE64*)(fp))->_cnt) -# define READ_DATA_PENDING_PTR(fp) ((char *)((FILE64*)(fp))->_ptr) -#elif defined(FILE_COUNT) -# define READ_DATA_PENDING(fp) ((fp)->FILE_COUNT > 0) -# define READ_DATA_PENDING_COUNT(fp) ((fp)->FILE_COUNT) -#elif defined(FILE_READEND) -# define READ_DATA_PENDING(fp) ((fp)->FILE_READPTR < (fp)->FILE_READEND) -# define READ_DATA_PENDING_COUNT(fp) ((fp)->FILE_READEND - (fp)->FILE_READPTR) -#elif defined(__BEOS__) -# define READ_DATA_PENDING(fp) (fp->_state._eof == 0) -#elif defined(__VMS) -# define READ_DATA_PENDING_COUNT(fp) ((unsigned int)(*(fp))->_cnt) -# define READ_DATA_PENDING(fp) (((unsigned int)(*(fp))->_cnt) > 0) -# define READ_DATA_BUFFERED(fp) 0 -#elif defined(__DragonFly__) -/* FILE is an incomplete struct type since DragonFly BSD 1.4.0 */ -# define READ_DATA_PENDING(fp) (((struct __FILE_public *)(fp))->_r > 0) -# define READ_DATA_PENDING_COUNT(fp) (((struct __FILE_public *)(fp))->_r) -#else -/* requires systems own version of the ReadDataPending() */ -extern int ReadDataPending(); -# define READ_DATA_PENDING(fp) (!feof(fp)) -# define READ_DATA_BUFFERED(fp) 0 -#endif -#ifndef READ_DATA_BUFFERED -# define READ_DATA_BUFFERED(fp) READ_DATA_PENDING(fp) -#endif - -#ifndef READ_DATA_PENDING_PTR -# ifdef FILE_READPTR -# define READ_DATA_PENDING_PTR(fp) ((char *)(fp)->FILE_READPTR) -# endif -#endif - -#if defined __DJGPP__ -# undef READ_DATA_PENDING_COUNT -# undef READ_DATA_PENDING_PTR -#endif - -#define READ_CHECK(fp) do {\ - if (!READ_DATA_PENDING(fp)) {\ - rb_thread_wait_fd(fileno(fp));\ - rb_io_check_closed(fptr);\ - }\ -} while(0) - -void -rb_eof_error() -{ - rb_raise(rb_eEOFError, "end of file reached"); -} - -VALUE -rb_io_taint_check(io) - VALUE io; -{ - if (!OBJ_TAINTED(io) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO"); - rb_check_frozen(io); - return io; -} - -void -rb_io_check_initialized(fptr) - OpenFile *fptr; -{ - if (!fptr) { - rb_raise(rb_eIOError, "uninitialized stream"); - } -} - -void -rb_io_check_closed(fptr) - OpenFile *fptr; -{ - rb_io_check_initialized(fptr); - if (!fptr->f && !fptr->f2) { - rb_raise(rb_eIOError, "closed stream"); - } -} - -static void io_fflush _((FILE *, OpenFile *)); - -static OpenFile * -flush_before_seek(fptr) - OpenFile *fptr; -{ - if (fptr->mode & FMODE_WBUF) { - io_fflush(GetWriteFile(fptr), fptr); - } - errno = 0; - return fptr; -} - -#define io_seek(fptr, ofs, whence) fseeko(flush_before_seek(fptr)->f, ofs, whence) -#define io_tell(fptr) ftello(flush_before_seek(fptr)->f) - -#ifndef SEEK_CUR -# define SEEK_SET 0 -# define SEEK_CUR 1 -# define SEEK_END 2 -#endif - -#define FMODE_SYNCWRITE (FMODE_SYNC|FMODE_WRITABLE) - -void -rb_io_check_readable(fptr) - OpenFile *fptr; -{ - rb_io_check_closed(fptr); - if (!(fptr->mode & FMODE_READABLE)) { - rb_raise(rb_eIOError, "not opened for reading"); - } -#ifdef NEED_IO_SEEK_BETWEEN_RW - if (((fptr->mode & FMODE_WBUF) || - (fptr->mode & (FMODE_SYNCWRITE|FMODE_RBUF)) == FMODE_SYNCWRITE) && - !feof(fptr->f) && - !fptr->f2) { - io_seek(fptr, 0, SEEK_CUR); - } -#endif - fptr->mode |= FMODE_RBUF; -} - -void -rb_io_check_writable(fptr) - OpenFile *fptr; -{ - rb_io_check_closed(fptr); - if (!(fptr->mode & FMODE_WRITABLE)) { - rb_raise(rb_eIOError, "not opened for writing"); - } - if ((fptr->mode & FMODE_RBUF) && !feof(fptr->f) && !fptr->f2) { - io_seek(fptr, 0, SEEK_CUR); - } - if (!fptr->f2) { - fptr->mode &= ~FMODE_RBUF; - } -} - -int -rb_read_pending(fp) - FILE *fp; -{ - return READ_DATA_PENDING(fp); -} - -void -rb_read_check(fp) - FILE *fp; -{ - if (!READ_DATA_PENDING(fp)) { - rb_thread_wait_fd(fileno(fp)); - } -} - -static int -ruby_dup(orig) - int orig; -{ - int fd; - - fd = dup(orig); - if (fd < 0) { - if (errno == EMFILE || errno == ENFILE || errno == ENOMEM) { - rb_gc(); - fd = dup(orig); - } - if (fd < 0) { - rb_sys_fail(0); - } - } - return fd; -} - -static VALUE io_alloc _((VALUE)); -static VALUE -io_alloc(klass) - VALUE klass; -{ - NEWOBJ(io, struct RFile); - OBJSETUP(io, klass, T_FILE); - - io->fptr = 0; - - return (VALUE)io; -} - -static void -io_fflush(f, fptr) - FILE *f; - OpenFile *fptr; -{ - int n; - - if (!rb_thread_fd_writable(fileno(f))) { - rb_io_check_closed(fptr); - } - for (;;) { - TRAP_BEG; - n = fflush(f); - TRAP_END; - if (n != EOF) break; - if (!rb_io_wait_writable(fileno(f))) - rb_sys_fail(fptr->path); - } - fptr->mode &= ~FMODE_WBUF; -} - -int -rb_io_wait_readable(f) - int f; -{ - fd_set rfds; - - switch (errno) { - case EINTR: -#if defined(ERESTART) - case ERESTART: -#endif - rb_thread_wait_fd(f); - return Qtrue; - - case EAGAIN: -#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN - case EWOULDBLOCK: -#endif - FD_ZERO(&rfds); - FD_SET(f, &rfds); - rb_thread_select(f + 1, &rfds, NULL, NULL, NULL); - return Qtrue; - - default: - return Qfalse; - } -} - -int -rb_io_wait_writable(f) - int f; -{ - fd_set wfds; - - switch (errno) { - case EINTR: -#if defined(ERESTART) - case ERESTART: -#endif - rb_thread_fd_writable(f); - return Qtrue; - - case EAGAIN: -#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN - case EWOULDBLOCK: -#endif - FD_ZERO(&wfds); - FD_SET(f, &wfds); - rb_thread_select(f + 1, NULL, &wfds, NULL, NULL); - return Qtrue; - - default: - return Qfalse; - } -} - -#ifndef S_ISREG -# define S_ISREG(m) ((m & S_IFMT) == S_IFREG) -#endif - -static int -wsplit_p(OpenFile *fptr) -{ - FILE *f = GetWriteFile(fptr); - int r; - if (!(fptr->mode & FMODE_WSPLIT_INITIALIZED)) { - struct stat buf; - if (fstat(fileno(f), &buf) == 0 && - !S_ISREG(buf.st_mode) -#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK) - && (r = fcntl(fileno(f), F_GETFL)) != -1 && - !(r & O_NONBLOCK) -#endif - ) { - fptr->mode |= FMODE_WSPLIT; - } - fptr->mode |= FMODE_WSPLIT_INITIALIZED; - } - return fptr->mode & FMODE_WSPLIT; -} - -/* writing functions */ -static long -io_fwrite(str, fptr) - VALUE str; - OpenFile *fptr; -{ - long len, n, r, l, offset = 0; - FILE *f = GetWriteFile(fptr); - - len = RSTRING(str)->len; - if ((n = len) <= 0) return n; - if (fptr->mode & FMODE_SYNC) { - io_fflush(f, fptr); - if (!rb_thread_fd_writable(fileno(f))) { - rb_io_check_closed(fptr); - } - retry: - l = n; - if (PIPE_BUF < l && - !rb_thread_critical && - !rb_thread_alone() && - wsplit_p(fptr)) { - l = PIPE_BUF; - } - TRAP_BEG; - r = write(fileno(f), RSTRING(str)->ptr+offset, l); - TRAP_END; - if (r == n) return len; - if (0 <= r) { - offset += r; - n -= r; - errno = EAGAIN; - } - if (rb_io_wait_writable(fileno(f))) { - rb_io_check_closed(fptr); - if (offset < RSTRING(str)->len) - goto retry; - } - return -1L; - } -#if defined(__human68k__) || defined(__vms) - do { - if (fputc(RSTRING(str)->ptr[offset++], f) == EOF) { - if (ferror(f)) return -1L; - break; - } - } while (--n > 0); -#else - while (errno = 0, offset += (r = fwrite(RSTRING(str)->ptr+offset, 1, n, f)), (n -= r) > 0) { - if (ferror(f) -#if defined __BORLANDC__ - || errno -#endif - ) { -#ifdef __hpux - if (!errno) errno = EAGAIN; -#elif defined(_WIN32) && !defined(__BORLANDC__) - /* workaround for MSVCRT's bug */ - if (!errno) { - if (GetLastError() == ERROR_NO_DATA) - errno = EPIPE; - else - errno = EBADF; - } -#endif - if (rb_io_wait_writable(fileno(f))) { - rb_io_check_closed(fptr); - clearerr(f); - if (offset < RSTRING(str)->len) - continue; - } - return -1L; - } - } -#endif - return len - n; -} - -long -rb_io_fwrite(ptr, len, f) - const char *ptr; - long len; - FILE *f; -{ - OpenFile of; - - of.f = f; - of.f2 = NULL; - of.mode = FMODE_WRITABLE; - of.path = NULL; - return io_fwrite(rb_str_new(ptr, len), &of); -} - -/* - * call-seq: - * ios.write(string) => integer - * - * Writes the given string to ios. The stream must be opened - * for writing. If the argument is not a string, it will be converted - * to a string using to_s. Returns the number of bytes - * written. - * - * count = $stdout.write( "This is a test\n" ) - * puts "That was #{count} bytes of data" - * - * produces: - * - * This is a test - * That was 15 bytes of data - */ - -static VALUE -io_write(io, str) - VALUE io, str; -{ - OpenFile *fptr; - long n; - - rb_secure(4); - if (TYPE(str) != T_STRING) - str = rb_obj_as_string(str); - - if (TYPE(io) != T_FILE) { - /* port is not IO, call write method for it. */ - return rb_funcall(io, id_write, 1, str); - } - if (RSTRING(str)->len == 0) return INT2FIX(0); - - GetOpenFile(io, fptr); - rb_io_check_writable(fptr); - - n = io_fwrite(str, fptr); - if (n == -1L) rb_sys_fail(fptr->path); - if (!(fptr->mode & FMODE_SYNC)) { - fptr->mode |= FMODE_WBUF; - } - - return LONG2FIX(n); -} - -VALUE -rb_io_write(io, str) - VALUE io, str; -{ - return rb_funcall(io, id_write, 1, str); -} - -/* - * call-seq: - * ios << obj => ios - * - * String Output---Writes obj to ios. - * obj will be converted to a string using - * to_s. - * - * $stdout << "Hello " << "world!\n" - * - * produces: - * - * Hello world! - */ - -VALUE -rb_io_addstr(io, str) - VALUE io, str; -{ - rb_io_write(io, str); - return io; -} - -/* - * call-seq: - * ios.flush => ios - * - * Flushes any buffered data within ios to the underlying - * operating system (note that this is Ruby internal buffering only; - * the OS may buffer the data as well). - * - * $stdout.print "no newline" - * $stdout.flush - * - * produces: - * - * no newline - */ - -static VALUE -rb_io_flush(io) - VALUE io; -{ - OpenFile *fptr; - FILE *f; - - GetOpenFile(io, fptr); - rb_io_check_writable(fptr); - f = GetWriteFile(fptr); - - io_fflush(f, fptr); - - return io; -} - -/* - * call-seq: - * ios.pos => integer - * ios.tell => integer - * - * Returns the current offset (in bytes) of ios. - * - * f = File.new("testfile") - * f.pos #=> 0 - * f.gets #=> "This is line one\n" - * f.pos #=> 17 - */ - -static VALUE -rb_io_tell(io) - VALUE io; -{ - OpenFile *fptr; - off_t pos; - - GetOpenFile(io, fptr); - pos = io_tell(fptr); - if (pos < 0 && errno) rb_sys_fail(fptr->path); - return OFFT2NUM(pos); -} - -static VALUE -rb_io_seek(io, offset, whence) - VALUE io, offset; - int whence; -{ - OpenFile *fptr; - off_t pos; - - pos = NUM2OFFT(offset); - GetOpenFile(io, fptr); - pos = io_seek(fptr, pos, whence); - if (pos < 0 && errno) rb_sys_fail(fptr->path); - clearerr(fptr->f); - - return INT2FIX(0); -} - -/* - * call-seq: - * ios.seek(amount, whence=SEEK_SET) -> 0 - * - * Seeks to a given offset anInteger in the stream according to - * the value of whence: - * - * IO::SEEK_CUR | Seeks to _amount_ plus current position - * --------------+---------------------------------------------------- - * IO::SEEK_END | Seeks to _amount_ plus end of stream (you probably - * | want a negative value for _amount_) - * --------------+---------------------------------------------------- - * IO::SEEK_SET | Seeks to the absolute location given by _amount_ - * - * Example: - * - * f = File.new("testfile") - * f.seek(-13, IO::SEEK_END) #=> 0 - * f.readline #=> "And so on...\n" - */ - -static VALUE -rb_io_seek_m(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE offset, ptrname; - int whence = SEEK_SET; - - if (rb_scan_args(argc, argv, "11", &offset, &ptrname) == 2) { - whence = NUM2INT(ptrname); - } - - return rb_io_seek(io, offset, whence); -} - -/* - * call-seq: - * ios.pos = integer => integer - * - * Seeks to the given position (in bytes) in ios. - * - * f = File.new("testfile") - * f.pos = 17 - * f.gets #=> "This is line two\n" - */ - -static VALUE -rb_io_set_pos(io, offset) - VALUE io, offset; -{ - OpenFile *fptr; - off_t pos; - - pos = NUM2OFFT(offset); - GetOpenFile(io, fptr); - pos = io_seek(fptr, pos, SEEK_SET); - if (pos != 0) rb_sys_fail(fptr->path); - clearerr(fptr->f); - - return OFFT2NUM(pos); -} - -/* - * call-seq: - * ios.rewind => 0 - * - * Positions ios to the beginning of input, resetting - * lineno to zero. - * - * f = File.new("testfile") - * f.readline #=> "This is line one\n" - * f.rewind #=> 0 - * f.lineno #=> 0 - * f.readline #=> "This is line one\n" - */ - -static VALUE -rb_io_rewind(io) - VALUE io; -{ - OpenFile *fptr; - - GetOpenFile(io, fptr); - if (io_seek(fptr, 0L, 0) != 0) rb_sys_fail(fptr->path); - clearerr(fptr->f); - if (io == current_file) { - gets_lineno -= fptr->lineno; - } - fptr->lineno = 0; - - return INT2FIX(0); -} - -/* - * call-seq: - * ios.eof => true or false - * ios.eof? => true or false - * - * Returns true if ios is at end of file that means - * there are no more data to read. - * The stream must be opened for reading or an IOError will be - * raised. - * - * f = File.new("testfile") - * dummy = f.readlines - * f.eof #=> true - * - * If ios is a stream such as pipe or socket, IO#eof? - * blocks until the other end sends some data or closes it. - * - * r, w = IO.pipe - * Thread.new { sleep 1; w.close } - * r.eof? #=> true after 1 second blocking - * - * r, w = IO.pipe - * Thread.new { sleep 1; w.puts "a" } - * r.eof? #=> false after 1 second blocking - * - * r, w = IO.pipe - * r.eof? # blocks forever - * - * Note that IO#eof? reads data to a input buffer. - * So IO#sysread doesn't work with IO#eof?. - */ - -VALUE -rb_io_eof(io) - VALUE io; -{ - OpenFile *fptr; - int ch; - - GetOpenFile(io, fptr); - rb_io_check_readable(fptr); - - if (feof(fptr->f)) return Qtrue; - if (READ_DATA_PENDING(fptr->f)) return Qfalse; - READ_CHECK(fptr->f); - clearerr(fptr->f); - TRAP_BEG; - ch = getc(fptr->f); - TRAP_END; - - if (ch != EOF) { - ungetc(ch, fptr->f); - return Qfalse; - } - rb_io_check_closed(fptr); - clearerr(fptr->f); - return Qtrue; -} - -/* - * call-seq: - * ios.sync => true or false - * - * Returns the current ``sync mode'' of ios. When sync mode is - * true, all output is immediately flushed to the underlying operating - * system and is not buffered by Ruby internally. See also - * IO#fsync. - * - * f = File.new("testfile") - * f.sync #=> false - */ - -static VALUE -rb_io_sync(io) - VALUE io; -{ - OpenFile *fptr; - - GetOpenFile(io, fptr); - return (fptr->mode & FMODE_SYNC) ? Qtrue : Qfalse; -} - -/* - * call-seq: - * ios.sync = boolean => boolean - * - * Sets the ``sync mode'' to true or false. - * When sync mode is true, all output is immediately flushed to the - * underlying operating system and is not buffered internally. Returns - * the new state. See also IO#fsync. - * - * f = File.new("testfile") - * f.sync = true - * - * (produces no output) - */ - -static VALUE -rb_io_set_sync(io, mode) - VALUE io, mode; -{ - OpenFile *fptr; - - GetOpenFile(io, fptr); - if (RTEST(mode)) { - fptr->mode |= FMODE_SYNC; - } - else { - fptr->mode &= ~FMODE_SYNC; - } - return mode; -} - -/* - * call-seq: - * ios.fsync => 0 or nil - * - * Immediately writes all buffered data in ios to disk. - * Returns nil if the underlying operating system does not - * support fsync(2). Note that fsync differs from - * using IO#sync=. The latter ensures that data is flushed - * from Ruby's buffers, but doesn't not guarantee that the underlying - * operating system actually writes it to disk. - */ - -static VALUE -rb_io_fsync(io) - VALUE io; -{ -#ifdef HAVE_FSYNC - OpenFile *fptr; - FILE *f; - - GetOpenFile(io, fptr); - f = GetWriteFile(fptr); - - io_fflush(f, fptr); - if (fsync(fileno(f)) < 0) - rb_sys_fail(fptr->path); - return INT2FIX(0); -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif -} - -/* - * call-seq: - * ios.fileno => fixnum - * ios.to_i => fixnum - * - * Returns an integer representing the numeric file descriptor for - * ios. - * - * $stdin.fileno #=> 0 - * $stdout.fileno #=> 1 - */ - -static VALUE -rb_io_fileno(io) - VALUE io; -{ - OpenFile *fptr; - int fd; - - GetOpenFile(io, fptr); - fd = fileno(fptr->f); - return INT2FIX(fd); -} - -/* - * call-seq: - * ios.pid => fixnum - * - * Returns the process ID of a child process associated with - * ios. This will be set by IO::popen. - * - * pipe = IO.popen("-") - * if pipe - * $stderr.puts "In parent, child pid is #{pipe.pid}" - * else - * $stderr.puts "In child, pid is #{$$}" - * end - * - * produces: - * - * In child, pid is 26209 - * In parent, child pid is 26209 - */ - -static VALUE -rb_io_pid(io) - VALUE io; -{ - OpenFile *fptr; - - GetOpenFile(io, fptr); - if (!fptr->pid) - return Qnil; - return INT2FIX(fptr->pid); -} - -/* - * call-seq: - * ios.inspect => string - * - * Return a string describing this IO object. - */ - -static VALUE -rb_io_inspect(obj) - VALUE obj; -{ - OpenFile *fptr; - char *buf, *cname, *st = ""; - long len; - - fptr = RFILE(rb_io_taint_check(obj))->fptr; - if (!fptr || !fptr->path) return rb_any_to_s(obj); - cname = rb_obj_classname(obj); - len = strlen(cname) + strlen(fptr->path) + 5; - if (!(fptr->f || fptr->f2)) { - st = " (closed)"; - len += 9; - } - buf = ALLOCA_N(char, len); - snprintf(buf, len, "#<%s:%s%s>", cname, fptr->path, st); - return rb_str_new2(buf); -} - -/* - * call-seq: - * ios.to_io -> ios - * - * Returns ios. - */ - -static VALUE -rb_io_to_io(io) - VALUE io; -{ - return io; -} - -/* reading functions */ -static long -read_buffered_data(ptr, len, f) - char *ptr; - long len; - FILE *f; -{ - long n; - -#ifdef READ_DATA_PENDING_COUNT - n = READ_DATA_PENDING_COUNT(f); - if (n <= 0) return 0; - if (n > len) n = len; - return fread(ptr, 1, n, f); -#else - int c; - - for (n = 0; n < len && READ_DATA_PENDING(f) && (c = getc(f)) != EOF; ++n) { - *ptr++ = c; - } - return n; -#endif -} - -static long -io_fread(ptr, len, fptr) - char *ptr; - long len; - OpenFile *fptr; -{ - long n = len; - int c; - int saved_errno; - - while (n > 0) { - c = read_buffered_data(ptr, n, fptr->f); - if (c < 0) goto eof; - if (c > 0) { - ptr += c; - if ((n -= c) <= 0) break; - } - rb_thread_wait_fd(fileno(fptr->f)); - rb_io_check_closed(fptr); - clearerr(fptr->f); - TRAP_BEG; - c = getc(fptr->f); - TRAP_END; - if (c == EOF) { - eof: - if (ferror(fptr->f)) { - switch (errno) { - case EINTR: -#if defined(ERESTART) - case ERESTART: -#endif - clearerr(fptr->f); - continue; - case EAGAIN: -#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN - case EWOULDBLOCK: -#endif - if (len > n) { - clearerr(fptr->f); - } - saved_errno = errno; - rb_warning("nonblocking IO#read is obsolete; use IO#readpartial or IO#sysread"); - errno = saved_errno; - } - if (len == n) return 0; - } - break; - } - *ptr++ = c; - n--; - } - return len - n; -} - -long -rb_io_fread(ptr, len, f) - char *ptr; - long len; - FILE *f; -{ - OpenFile of; - - of.f = f; - of.f2 = NULL; - return io_fread(ptr, len, &of); -} - -#define SMALLBUF 100 - -static long -remain_size(fptr) - OpenFile *fptr; -{ - struct stat st; - off_t siz = BUFSIZ; - off_t pos; - - if (feof(fptr->f)) return 0; - if (fstat(fileno(fptr->f), &st) == 0 && S_ISREG(st.st_mode) -#ifdef __BEOS__ - && (st.st_dev > 3) -#endif - ) - { - pos = io_tell(fptr); - if (st.st_size >= pos && pos >= 0) { - siz = st.st_size - pos + 1; - if (siz > LONG_MAX) { - rb_raise(rb_eIOError, "file too big for single read"); - } - } - } - return (long)siz; -} - -static VALUE -read_all(fptr, siz, str) - OpenFile *fptr; - long siz; - VALUE str; -{ - long bytes = 0; - long n; - - if (siz == 0) siz = BUFSIZ; - if (NIL_P(str)) { - str = rb_str_new(0, siz); - } - else { - rb_str_resize(str, siz); - } - for (;;) { - rb_str_locktmp(str); - READ_CHECK(fptr->f); - n = io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr); - rb_str_unlocktmp(str); - if (n == 0 && bytes == 0) { - if (!fptr->f) break; - if (feof(fptr->f)) break; - if (!ferror(fptr->f)) break; - rb_sys_fail(fptr->path); - } - bytes += n; - if (bytes < siz) break; - siz += BUFSIZ; - rb_str_resize(str, siz); - } - if (bytes != siz) rb_str_resize(str, bytes); - OBJ_TAINT(str); - - return str; -} - -void rb_io_set_nonblock(OpenFile *fptr) -{ - int flags; -#ifdef F_GETFL - flags = fcntl(fileno(fptr->f), F_GETFL); - if (flags == -1) { - rb_sys_fail(fptr->path); - } -#else - flags = 0; -#endif - if ((flags & O_NONBLOCK) == 0) { - flags |= O_NONBLOCK; - if (fcntl(fileno(fptr->f), F_SETFL, flags) == -1) { - rb_sys_fail(fptr->path); - } - } - if (fptr->f2) { -#ifdef F_GETFL - flags = fcntl(fileno(fptr->f2), F_GETFL); - if (flags == -1) { - rb_sys_fail(fptr->path); - } -#else - flags = 0; -#endif - if ((flags & O_NONBLOCK) == 0) { - flags |= O_NONBLOCK; - if (fcntl(fileno(fptr->f2), F_SETFL, flags) == -1) { - rb_sys_fail(fptr->path); - } - } - } -} - -static VALUE -io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock) -{ - OpenFile *fptr; - VALUE length, str; - long n, len; - - rb_scan_args(argc, argv, "11", &length, &str); - - if ((len = NUM2LONG(length)) < 0) { - rb_raise(rb_eArgError, "negative length %ld given", len); - } - - if (NIL_P(str)) { - str = rb_str_new(0, len); - } - else { - StringValue(str); - rb_str_modify(str); - rb_str_resize(str, len); - } - OBJ_TAINT(str); - - GetOpenFile(io, fptr); - rb_io_check_readable(fptr); - - if (len == 0) - return str; - - if (!nonblock) { - READ_CHECK(fptr->f); - } - if (RSTRING(str)->len != len) { - modified: - rb_raise(rb_eRuntimeError, "buffer string modified"); - } - n = read_buffered_data(RSTRING(str)->ptr, len, fptr->f); - if (n <= 0) { - again: - if (RSTRING(str)->len != len) goto modified; - if (nonblock) { - rb_io_set_nonblock(fptr); - n = read(fileno(fptr->f), RSTRING(str)->ptr, len); - } - else { - TRAP_BEG; - n = read(fileno(fptr->f), RSTRING(str)->ptr, len); - TRAP_END; - } - if (n < 0) { - if (!nonblock && rb_io_wait_readable(fileno(fptr->f))) - goto again; - rb_sys_fail(fptr->path); - } - if (fptr->f) /* update pos in FILE structure [ruby-core:21561] */ - fflush(fptr->f); - } - rb_str_resize(str, n); - - if (n == 0) - return Qnil; - else - return str; -} - -/* - * call-seq: - * ios.readpartial(maxlen) => string - * ios.readpartial(maxlen, outbuf) => outbuf - * - * Reads at most maxlen bytes from the I/O stream. - * It blocks only if ios has no data immediately available. - * It doesn't block if some data available. - * If the optional outbuf argument is present, - * it must reference a String, which will receive the data. - * It raises EOFError on end of file. - * - * readpartial is designed for streams such as pipe, socket, tty, etc. - * It blocks only when no data immediately available. - * This means that it blocks only when following all conditions hold. - * * the buffer in the IO object is empty. - * * the content of the stream is empty. - * * the stream is not reached to EOF. - * - * When readpartial blocks, it waits data or EOF on the stream. - * If some data is reached, readpartial returns with the data. - * If EOF is reached, readpartial raises EOFError. - * - * When readpartial doesn't blocks, it returns or raises immediately. - * If the buffer is not empty, it returns the data in the buffer. - * Otherwise if the stream has some content, - * it returns the data in the stream. - * Otherwise if the stream is reached to EOF, it raises EOFError. - * - * r, w = IO.pipe # buffer pipe content - * w << "abc" # "" "abc". - * r.readpartial(4096) #=> "abc" "" "" - * r.readpartial(4096) # blocks because buffer and pipe is empty. - * - * r, w = IO.pipe # buffer pipe content - * w << "abc" # "" "abc" - * w.close # "" "abc" EOF - * r.readpartial(4096) #=> "abc" "" EOF - * r.readpartial(4096) # raises EOFError - * - * r, w = IO.pipe # buffer pipe content - * w << "abc\ndef\n" # "" "abc\ndef\n" - * r.gets #=> "abc\n" "def\n" "" - * w << "ghi\n" # "def\n" "ghi\n" - * r.readpartial(4096) #=> "def\n" "" "ghi\n" - * r.readpartial(4096) #=> "ghi\n" "" "" - * - * Note that readpartial behaves similar to sysread. - * The differences are: - * * If the buffer is not empty, read from the buffer instead of "sysread for buffered IO (IOError)". - * * It doesn't cause Errno::EAGAIN and Errno::EINTR. When readpartial meets EAGAIN and EINTR by read system call, readpartial retry the system call. - * - * The later means that readpartial is nonblocking-flag insensitive. - * It blocks on the situation IO#sysread causes Errno::EAGAIN as if the fd is blocking mode. - * - */ - -static VALUE -io_readpartial(int argc, VALUE *argv, VALUE io) -{ - VALUE ret; - - ret = io_getpartial(argc, argv, io, 0); - if (NIL_P(ret)) - rb_eof_error(); - else - return ret; -} - -/* - * call-seq: - * ios.read_nonblock(maxlen) => string - * ios.read_nonblock(maxlen, outbuf) => outbuf - * - * Reads at most maxlen bytes from ios using - * read(2) system call after O_NONBLOCK is set for - * the underlying file descriptor. - * - * If the optional outbuf argument is present, - * it must reference a String, which will receive the data. - * - * read_nonblock just calls read(2). - * It causes all errors read(2) causes: EAGAIN, EINTR, etc. - * The caller should care such errors. - * - * read_nonblock causes EOFError on EOF. - * - * If the read buffer is not empty, - * read_nonblock reads from the buffer like readpartial. - * In this case, read(2) is not called. - * - */ - -static VALUE -io_read_nonblock(int argc, VALUE *argv, VALUE io) -{ - VALUE ret; - - ret = io_getpartial(argc, argv, io, 1); - if (NIL_P(ret)) - rb_eof_error(); - else - return ret; -} - -/* - * call-seq: - * ios.write_nonblock(string) => integer - * - * Writes the given string to ios using - * write(2) system call after O_NONBLOCK is set for - * the underlying file descriptor. - * - * write_nonblock just calls write(2). - * It causes all errors write(2) causes: EAGAIN, EINTR, etc. - * The result may also be smaller than string.length (partial write). - * The caller should care such errors and partial write. - * - */ - -static VALUE -rb_io_write_nonblock(VALUE io, VALUE str) -{ - OpenFile *fptr; - FILE *f; - long n; - - rb_secure(4); - if (TYPE(str) != T_STRING) - str = rb_obj_as_string(str); - - GetOpenFile(io, fptr); - rb_io_check_writable(fptr); - - f = GetWriteFile(fptr); - - rb_io_set_nonblock(fptr); - n = write(fileno(f), RSTRING(str)->ptr, RSTRING(str)->len); - - if (n == -1) rb_sys_fail(fptr->path); - - return LONG2FIX(n); -} - -/* - * call-seq: - * ios.read([length [, buffer]]) => string, buffer, or nil - * - * Reads at most length bytes from the I/O stream, or to the - * end of file if length is omitted or is nil. - * length must be a non-negative integer or nil. - * If the optional buffer argument is present, it must reference - * a String, which will receive the data. - * - * At end of file, it returns nil or "" - * depend on length. - * ios.read() and - * ios.read(nil) returns "". - * ios.read(positive-integer) returns nil. - * - * f = File.new("testfile") - * f.read(16) #=> "This is line one" - */ - -static VALUE -io_read(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - OpenFile *fptr; - long n, len; - VALUE length, str; - - rb_scan_args(argc, argv, "02", &length, &str); - - if (NIL_P(length)) { - if (!NIL_P(str)) StringValue(str); - GetOpenFile(io, fptr); - rb_io_check_readable(fptr); - return read_all(fptr, remain_size(fptr), str); - } - len = NUM2LONG(length); - if (len < 0) { - rb_raise(rb_eArgError, "negative length %ld given", len); - } - - if (NIL_P(str)) { - str = rb_tainted_str_new(0, len); - } - else { - StringValue(str); - rb_str_modify(str); - rb_str_resize(str,len); - } - - GetOpenFile(io, fptr); - rb_io_check_readable(fptr); - if (feof(fptr->f)) return Qnil; - if (len == 0) return str; - - rb_str_locktmp(str); - READ_CHECK(fptr->f); - if (RSTRING(str)->len != len) { - rb_raise(rb_eRuntimeError, "buffer string modified"); - } - n = io_fread(RSTRING(str)->ptr, len, fptr); - rb_str_unlocktmp(str); - if (n == 0) { - if (!fptr->f) return Qnil; - if (feof(fptr->f)) { - rb_str_resize(str, 0); - return Qnil; - } - if (len > 0) rb_sys_fail(fptr->path); - } - rb_str_resize(str, n); - RSTRING(str)->len = n; - RSTRING(str)->ptr[n] = '\0'; - OBJ_TAINT(str); - - return str; -} - -static int -appendline(fptr, delim, strp) - OpenFile *fptr; - int delim; - VALUE *strp; -{ - FILE *f = fptr->f; - VALUE str = *strp; - int c = EOF; -#ifndef READ_DATA_PENDING_PTR - char buf[8192]; - char *bp = buf, *bpe = buf + sizeof buf - 3; - int update = Qfalse; -#endif - - do { -#ifdef READ_DATA_PENDING_PTR - long pending = READ_DATA_PENDING_COUNT(f); - if (pending > 0) { - const char *p = READ_DATA_PENDING_PTR(f); - const char *e = memchr(p, delim, pending); - long last = 0, len = (c != EOF); - if (e) pending = e - p + 1; - len += pending; - if (!NIL_P(str)) { - last = RSTRING(str)->len; - rb_str_resize(str, last + len); - } - else { - *strp = str = rb_str_buf_new(len); - RSTRING(str)->len = len; - RSTRING(str)->ptr[len] = '\0'; - } - if (c != EOF) { - RSTRING(str)->ptr[last++] = c; - } - fread(RSTRING(str)->ptr + last, 1, pending, f); /* must not fail */ - if (e) return delim; - } - else if (c != EOF) { - if (!NIL_P(str)) { - char ch = c; - rb_str_buf_cat(str, &ch, 1); - } - else { - *strp = str = rb_str_buf_new(1); - RSTRING(str)->ptr[RSTRING(str)->len++] = c; - } - } - rb_thread_wait_fd(fileno(f)); - rb_io_check_closed(fptr); -#else - READ_CHECK(f); -#endif - clearerr(f); - TRAP_BEG; - c = getc(f); - TRAP_END; - if (c == EOF) { - if (ferror(f)) { - clearerr(f); - if (!rb_io_wait_readable(fileno(f))) - rb_sys_fail(fptr->path); - continue; - } -#ifdef READ_DATA_PENDING_PTR - return c; -#endif - } -#ifndef READ_DATA_PENDING_PTR - if (c == EOF || (*bp++ = c) == delim || bp == bpe) { - int cnt = bp - buf; - - if (cnt > 0) { - if (!NIL_P(str)) - rb_str_cat(str, buf, cnt); - else - *strp = str = rb_str_new(buf, cnt); - } - if (c == EOF) { - if (update) - return (int)RSTRING(str)->ptr[RSTRING(str)->len-1]; - return c; - } - bp = buf; - } - update = Qtrue; -#endif - } while (c != delim); - -#ifdef READ_DATA_PENDING_PTR - { - char ch = c; - if (!NIL_P(str)) { - rb_str_cat(str, &ch, 1); - } - else { - *strp = str = rb_str_new(&ch, 1); - } - } -#endif - - return c; -} - -static inline int -swallow(fptr, term) - OpenFile *fptr; - int term; -{ - FILE *f = fptr->f; - int c; - - do { -#ifdef READ_DATA_PENDING_PTR - long cnt; - while ((cnt = READ_DATA_PENDING_COUNT(f)) > 0) { - char buf[1024]; - const char *p = READ_DATA_PENDING_PTR(f); - int i; - if (cnt > sizeof buf) cnt = sizeof buf; - if (*p != term) return Qtrue; - i = cnt; - while (--i && *++p == term); - if (!fread(buf, 1, cnt - i, f)) /* must not fail */ - rb_sys_fail(fptr->path); - } - rb_thread_wait_fd(fileno(f)); - rb_io_check_closed(fptr); -#else - READ_CHECK(f); -#endif - clearerr(f); - TRAP_BEG; - c = getc(f); - TRAP_END; - if (c != term) { - ungetc(c, f); - return Qtrue; - } - } while (c != EOF); - return Qfalse; -} - -static VALUE -rb_io_getline_fast(fptr, delim) - OpenFile *fptr; - unsigned char delim; -{ - VALUE str = Qnil; - int c; - - while ((c = appendline(fptr, delim, &str)) != EOF && c != delim); - - if (!NIL_P(str)) { - fptr->lineno++; - lineno = INT2FIX(fptr->lineno); - OBJ_TAINT(str); - } - - return str; -} - -static int -rscheck(rsptr, rslen, rs) - char *rsptr; - long rslen; - VALUE rs; -{ - if (RSTRING(rs)->ptr != rsptr && RSTRING(rs)->len != rslen) - rb_raise(rb_eRuntimeError, "rs modified"); - return 1; -} - -static VALUE rb_io_getline(VALUE rs, VALUE io); - -static VALUE -rb_io_getline(rs, io) - VALUE rs, io; -{ - VALUE str = Qnil; - OpenFile *fptr; - - GetOpenFile(io, fptr); - rb_io_check_readable(fptr); - if (NIL_P(rs)) { - str = read_all(fptr, 0, Qnil); - if (RSTRING(str)->len == 0) return Qnil; - } - else if (rs == rb_default_rs) { - return rb_io_getline_fast(fptr, '\n'); - } - else { - int c, newline; - char *rsptr; - long rslen; - int rspara = 0; - - rslen = RSTRING(rs)->len; - if (rslen == 0) { - rsptr = "\n\n"; - rslen = 2; - rspara = 1; - swallow(fptr, '\n'); - } - else if (rslen == 1) { - return rb_io_getline_fast(fptr, (unsigned char)RSTRING(rs)->ptr[0]); - } - else { - rsptr = RSTRING(rs)->ptr; - } - newline = rsptr[rslen - 1]; - - while ((c = appendline(fptr, newline, &str)) != EOF && - (c != newline || RSTRING(str)->len < rslen || - ((rspara || rscheck(rsptr,rslen,rs)) && 0) || - memcmp(RSTRING(str)->ptr+RSTRING(str)->len-rslen,rsptr,rslen))); - - if (rspara) { - if (c != EOF) { - swallow(fptr, '\n'); - } - } - } - - if (!NIL_P(str)) { - fptr->lineno++; - lineno = INT2FIX(fptr->lineno); - OBJ_TAINT(str); - } - - return str; -} - -VALUE -rb_io_gets(io) - VALUE io; -{ - OpenFile *fptr; - - GetOpenFile(io, fptr); - rb_io_check_readable(fptr); - return rb_io_getline_fast(fptr, '\n'); -} - -/* - * call-seq: - * ios.gets(sep_string=$/) => string or nil - * - * Reads the next ``line'' from the I/O stream; lines are separated by - * sep_string. A separator of nil reads the entire - * contents, and a zero-length separator reads the input a paragraph at - * a time (two successive newlines in the input separate paragraphs). - * The stream must be opened for reading or an IOError - * will be raised. The line read in will be returned and also assigned - * to $_. Returns nil if called at end of - * file. - * - * File.new("testfile").gets #=> "This is line one\n" - * $_ #=> "This is line one\n" - */ - -static VALUE -rb_io_gets_m(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE rs, str; - - if (argc == 0) { - rs = rb_rs; - } - else { - rb_scan_args(argc, argv, "1", &rs); - if (!NIL_P(rs)) StringValue(rs); - } - str = rb_io_getline(rs, io); - rb_lastline_set(str); - - return str; -} - -/* - * call-seq: - * ios.lineno => integer - * - * Returns the current line number in ios. The stream must be - * opened for reading. lineno counts the number of times - * gets is called, rather than the number of newlines - * encountered. The two values will differ if gets is - * called with a separator other than newline. See also the - * $. variable. - * - * f = File.new("testfile") - * f.lineno #=> 0 - * f.gets #=> "This is line one\n" - * f.lineno #=> 1 - * f.gets #=> "This is line two\n" - * f.lineno #=> 2 - */ - -static VALUE -rb_io_lineno(io) - VALUE io; -{ - OpenFile *fptr; - - GetOpenFile(io, fptr); - rb_io_check_readable(fptr); - return INT2NUM(fptr->lineno); -} - -/* - * call-seq: - * ios.lineno = integer => integer - * - * Manually sets the current line number to the given value. - * $. is updated only on the next read. - * - * f = File.new("testfile") - * f.gets #=> "This is line one\n" - * $. #=> 1 - * f.lineno = 1000 - * f.lineno #=> 1000 - * $. # lineno of last read #=> 1 - * f.gets #=> "This is line two\n" - * $. # lineno of last read #=> 1001 - */ - -static VALUE -rb_io_set_lineno(io, lineno) - VALUE io, lineno; -{ - OpenFile *fptr; - - GetOpenFile(io, fptr); - rb_io_check_readable(fptr); - fptr->lineno = NUM2INT(lineno); - return lineno; -} - -static void -lineno_setter(val, id, var) - VALUE val; - ID id; - VALUE *var; -{ - gets_lineno = NUM2INT(val); - *var = INT2FIX(gets_lineno); -} - -static VALUE -argf_set_lineno(argf, val) - VALUE argf, val; -{ - gets_lineno = NUM2INT(val); - lineno = INT2FIX(gets_lineno); - return Qnil; -} - -static VALUE -argf_lineno() -{ - return lineno; -} - -/* - * call-seq: - * ios.readline(sep_string=$/) => string - * - * Reads a line as with IO#gets, but raises an - * EOFError on end of file. - */ - -static VALUE -rb_io_readline(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE line = rb_io_gets_m(argc, argv, io); - - if (NIL_P(line)) { - rb_eof_error(); - } - return line; -} - -/* - * call-seq: - * ios.readlines(sep_string=$/) => array - * - * Reads all of the lines in ios, and returns them in - * anArray. Lines are separated by the optional - * sep_string. If sep_string is nil, the - * rest of the stream is returned as a single record. - * The stream must be opened for reading or an - * IOError will be raised. - * - * f = File.new("testfile") - * f.readlines[0] #=> "This is line one\n" - */ - -static VALUE -rb_io_readlines(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE line, ary; - VALUE rs; - - if (argc == 0) { - rs = rb_rs; - } - else { - rb_scan_args(argc, argv, "1", &rs); - if (!NIL_P(rs)) StringValue(rs); - } - ary = rb_ary_new(); - while (!NIL_P(line = rb_io_getline(rs, io))) { - rb_ary_push(ary, line); - } - return ary; -} - -/* - * call-seq: - * ios.each(sep_string=$/) {|line| block } => ios - * ios.each_line(sep_string=$/) {|line| block } => ios - * - * Executes the block for every line in ios, where lines are - * separated by sep_string. ios must be opened for - * reading or an IOError will be raised. - * - * f = File.new("testfile") - * f.each {|line| puts "#{f.lineno}: #{line}" } - * - * produces: - * - * 1: This is line one - * 2: This is line two - * 3: This is line three - * 4: And so on... - */ - -static VALUE -rb_io_each_line(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE str; - VALUE rs; - - if (argc == 0) { - rs = rb_rs; - } - else { - rb_scan_args(argc, argv, "1", &rs); - if (!NIL_P(rs)) StringValue(rs); - } - while (!NIL_P(str = rb_io_getline(rs, io))) { - rb_yield(str); - } - return io; -} - -/* - * call-seq: - * ios.each_byte {|byte| block } => nil - * - * Calls the given block once for each byte (0..255) in ios, - * passing the byte as an argument. The stream must be opened for - * reading or an IOError will be raised. - * - * f = File.new("testfile") - * checksum = 0 - * f.each_byte {|x| checksum ^= x } #=> # - * checksum #=> 12 - */ - -static VALUE -rb_io_each_byte(io) - VALUE io; -{ - OpenFile *fptr; - FILE *f; - int c; - - GetOpenFile(io, fptr); - - for (;;) { - rb_io_check_readable(fptr); - f = fptr->f; - READ_CHECK(f); - clearerr(f); - TRAP_BEG; - c = getc(f); - TRAP_END; - if (c == EOF) { - if (ferror(f)) { - clearerr(f); - if (!rb_io_wait_readable(fileno(f))) - rb_sys_fail(fptr->path); - continue; - } - break; - } - rb_yield(INT2FIX(c & 0xff)); - } - if (ferror(f)) rb_sys_fail(fptr->path); - return io; -} - -/* - * call-seq: - * ios.getc => fixnum or nil - * - * Gets the next 8-bit byte (0..255) from ios. Returns - * nil if called at end of file. - * - * f = File.new("testfile") - * f.getc #=> 84 - * f.getc #=> 104 - */ - -VALUE -rb_io_getc(io) - VALUE io; -{ - OpenFile *fptr; - FILE *f; - int c; - - GetOpenFile(io, fptr); - rb_io_check_readable(fptr); - f = fptr->f; - - retry: - READ_CHECK(f); - clearerr(f); - TRAP_BEG; - c = getc(f); - TRAP_END; - - if (c == EOF) { - if (ferror(f)) { - clearerr(f); - if (!rb_io_wait_readable(fileno(f))) - rb_sys_fail(fptr->path); - goto retry; - } - return Qnil; - } - return INT2FIX(c & 0xff); -} - -int -rb_getc(f) - FILE *f; -{ - int c; - - if (!READ_DATA_PENDING(f)) { - rb_thread_wait_fd(fileno(f)); - } - clearerr(f); - TRAP_BEG; - c = getc(f); - TRAP_END; - - return c; -} - -/* - * call-seq: - * ios.readchar => fixnum - * - * Reads a character as with IO#getc, but raises an - * EOFError on end of file. - */ - -static VALUE -rb_io_readchar(io) - VALUE io; -{ - VALUE c = rb_io_getc(io); - - if (NIL_P(c)) { - rb_eof_error(); - } - return c; -} - -/* - * call-seq: - * ios.ungetc(integer) => nil - * - * Pushes back one character (passed as a parameter) onto ios, - * such that a subsequent buffered read will return it. Only one character - * may be pushed back before a subsequent read operation (that is, - * you will be able to read only the last of several characters that have been pushed - * back). Has no effect with unbuffered reads (such as IO#sysread). - * - * f = File.new("testfile") #=> # - * c = f.getc #=> 84 - * f.ungetc(c) #=> nil - * f.getc #=> 84 - */ - -VALUE -rb_io_ungetc(io, c) - VALUE io, c; -{ - OpenFile *fptr; - int cc = NUM2INT(c); - - GetOpenFile(io, fptr); - if (!(fptr->mode & FMODE_RBUF)) - rb_raise(rb_eIOError, "unread stream"); - rb_io_check_readable(fptr); - - if (ungetc(cc, fptr->f) == EOF && cc != EOF) { - rb_raise(rb_eIOError, "ungetc failed"); - } - return Qnil; -} - -/* - * call-seq: - * ios.isatty => true or false - * ios.tty? => true or false - * - * Returns true if ios is associated with a - * terminal device (tty), false otherwise. - * - * File.new("testfile").isatty #=> false - * File.new("/dev/tty").isatty #=> true - */ - -static VALUE -rb_io_isatty(io) - VALUE io; -{ - OpenFile *fptr; - - GetOpenFile(io, fptr); - if (isatty(fileno(fptr->f)) == 0) - return Qfalse; - return Qtrue; -} - -static void -fptr_finalize(fptr, noraise) - OpenFile *fptr; - int noraise; -{ - int n1 = 0, n2 = 0, f1, f2 = -1; - - errno = 0; - if (fptr->f2) { - f2 = fileno(fptr->f2); - while (n2 = 0, fflush(fptr->f2) < 0) { - n2 = errno; - if (!rb_io_wait_writable(f2)) { - break; - } - if (!fptr->f2) break; - } - if (fclose(fptr->f2) < 0 && n2 == 0) { - n2 = errno; - } - fptr->f2 = 0; - } - if (fptr->f) { - f1 = fileno(fptr->f); - if ((f2 == -1) && (fptr->mode & FMODE_WBUF)) { - while (n1 = 0, fflush(fptr->f) < 0) { - n1 = errno; - if (!rb_io_wait_writable(f1)) break; - if (!fptr->f) break; - } - } - if (fclose(fptr->f) < 0 && n1 == 0) { - n1 = errno; - } - fptr->f = 0; - if (n1 == EBADF && f1 == f2) { - n1 = 0; - } - } - if (!noraise && (n1 || n2)) { - errno = (n1 ? n1 : n2); - rb_sys_fail(fptr->path); - } -} - -static void -rb_io_fptr_cleanup(fptr, noraise) - OpenFile *fptr; - int noraise; -{ - if (fptr->finalize) { - (*fptr->finalize)(fptr, noraise); - } - else { - fptr_finalize(fptr, noraise); - } -} - -void -rb_io_fptr_finalize(fptr) - OpenFile *fptr; -{ - if (!fptr) return; - if (fptr->path) { - free(fptr->path); - } - if (!fptr->f && !fptr->f2) return; - if (fileno(fptr->f) < 3) return; - - rb_io_fptr_cleanup(fptr, Qtrue); -} - -VALUE -rb_io_close(io) - VALUE io; -{ - OpenFile *fptr; - int fd, fd2; - - fptr = RFILE(io)->fptr; - if (!fptr) return Qnil; - if (fptr->f2) { - fd2 = fileno(fptr->f2); - } - else { - if (!fptr->f) return Qnil; - fd2 = -1; - } - - fd = fileno(fptr->f); - rb_io_fptr_cleanup(fptr, Qfalse); - rb_thread_fd_close(fd); - if (fd2 >= 0) rb_thread_fd_close(fd2); - - if (fptr->pid) { - rb_syswait(fptr->pid); - fptr->pid = 0; - } - - return Qnil; -} - -/* - * call-seq: - * ios.close => nil - * - * Closes ios and flushes any pending writes to the operating - * system. The stream is unavailable for any further data operations; - * an IOError is raised if such an attempt is made. I/O - * streams are automatically closed when they are claimed by the - * garbage collector. - * - * If ios is opened by IO.popen, - * close sets $?. - */ - -static VALUE -rb_io_close_m(io) - VALUE io; -{ - if (rb_safe_level() >= 4 && !OBJ_TAINTED(io)) { - rb_raise(rb_eSecurityError, "Insecure: can't close"); - } - rb_io_check_closed(RFILE(io)->fptr); - rb_io_close(io); - return Qnil; -} - -static VALUE -io_call_close(io) - VALUE io; -{ - return rb_funcall(io, rb_intern("close"), 0, 0); -} - -static VALUE -io_close(io) - VALUE io; -{ - return rb_rescue(io_call_close, io, 0, 0); -} - -/* - * call-seq: - * ios.closed? => true or false - * - * Returns true if ios is completely closed (for - * duplex streams, both reader and writer), false - * otherwise. - * - * f = File.new("testfile") - * f.close #=> nil - * f.closed? #=> true - * f = IO.popen("/bin/sh","r+") - * f.close_write #=> nil - * f.closed? #=> false - * f.close_read #=> nil - * f.closed? #=> true - */ - -static VALUE -rb_io_closed(io) - VALUE io; -{ - OpenFile *fptr; - - fptr = RFILE(io)->fptr; - rb_io_check_initialized(fptr); - return (fptr->f || fptr->f2)?Qfalse:Qtrue; -} - -/* - * call-seq: - * ios.close_read => nil - * - * Closes the read end of a duplex I/O stream (i.e., one that contains - * both a read and a write stream, such as a pipe). Will raise an - * IOError if the stream is not duplexed. - * - * f = IO.popen("/bin/sh","r+") - * f.close_read - * f.readlines - * - * produces: - * - * prog.rb:3:in `readlines': not opened for reading (IOError) - * from prog.rb:3 - */ - -static VALUE -rb_io_close_read(io) - VALUE io; -{ - OpenFile *fptr; - int n; - - if (rb_safe_level() >= 4 && !OBJ_TAINTED(io)) { - rb_raise(rb_eSecurityError, "Insecure: can't close"); - } - GetOpenFile(io, fptr); - if (fptr->f2 == 0 && (fptr->mode & FMODE_WRITABLE)) { - rb_raise(rb_eIOError, "closing non-duplex IO for reading"); - } - if (fptr->f2 == 0) { - return rb_io_close(io); - } - n = fclose(fptr->f); - fptr->mode &= ~FMODE_READABLE; - fptr->f = fptr->f2; - fptr->f2 = 0; - if (n != 0) rb_sys_fail(fptr->path); - - return Qnil; -} - -/* - * call-seq: - * ios.close_write => nil - * - * Closes the write end of a duplex I/O stream (i.e., one that contains - * both a read and a write stream, such as a pipe). Will raise an - * IOError if the stream is not duplexed. - * - * f = IO.popen("/bin/sh","r+") - * f.close_write - * f.print "nowhere" - * - * produces: - * - * prog.rb:3:in `write': not opened for writing (IOError) - * from prog.rb:3:in `print' - * from prog.rb:3 - */ - -static VALUE -rb_io_close_write(io) - VALUE io; -{ - OpenFile *fptr; - int n; - - if (rb_safe_level() >= 4 && !OBJ_TAINTED(io)) { - rb_raise(rb_eSecurityError, "Insecure: can't close"); - } - GetOpenFile(io, fptr); - if (fptr->f2 == 0 && (fptr->mode & FMODE_READABLE)) { - rb_raise(rb_eIOError, "closing non-duplex IO for writing"); - } - if (fptr->f2 == 0) { - return rb_io_close(io); - } - n = fclose(fptr->f2); - fptr->f2 = 0; - fptr->mode &= ~FMODE_WRITABLE; - if (n != 0) rb_sys_fail(fptr->path); - - return Qnil; -} - -/* - * call-seq: - * ios.sysseek(offset, whence=SEEK_SET) => integer - * - * Seeks to a given offset in the stream according to the value - * of whence (see IO#seek for values of - * whence). Returns the new offset into the file. - * - * f = File.new("testfile") - * f.sysseek(-13, IO::SEEK_END) #=> 53 - * f.sysread(10) #=> "And so on." - */ - -static VALUE -rb_io_sysseek(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE offset, ptrname; - int whence = SEEK_SET; - OpenFile *fptr; - off_t pos; - - if (rb_scan_args(argc, argv, "11", &offset, &ptrname) == 2) { - whence = NUM2INT(ptrname); - } - pos = NUM2OFFT(offset); - GetOpenFile(io, fptr); - if ((fptr->mode & FMODE_READABLE) && READ_DATA_BUFFERED(fptr->f)) { - rb_raise(rb_eIOError, "sysseek for buffered IO"); - } - if ((fptr->mode & FMODE_WRITABLE) && (fptr->mode & FMODE_WBUF)) { - rb_warn("sysseek for buffered IO"); - } - pos = lseek(fileno(fptr->f), pos, whence); - if (pos == -1) rb_sys_fail(fptr->path); - clearerr(fptr->f); - - return OFFT2NUM(pos); -} - -/* - * call-seq: - * ios.syswrite(string) => integer - * - * Writes the given string to ios using a low-level write. - * Returns the number of bytes written. Do not mix with other methods - * that write to ios or you may get unpredictable results. - * Raises SystemCallError on error. - * - * f = File.new("out", "w") - * f.syswrite("ABCDEF") #=> 6 - */ - -static VALUE -rb_io_syswrite(io, str) - VALUE io, str; -{ - OpenFile *fptr; - FILE *f; - long n; - - rb_secure(4); - if (TYPE(str) != T_STRING) - str = rb_obj_as_string(str); - - GetOpenFile(io, fptr); - rb_io_check_writable(fptr); - f = GetWriteFile(fptr); - - if (fptr->mode & FMODE_WBUF) { - rb_warn("syswrite for buffered IO"); - } - if (!rb_thread_fd_writable(fileno(f))) { - rb_io_check_closed(fptr); - } - TRAP_BEG; - n = write(fileno(f), RSTRING(str)->ptr, RSTRING(str)->len); - TRAP_END; - - if (n == -1) rb_sys_fail(fptr->path); - - return LONG2FIX(n); -} - -/* - * call-seq: - * ios.sysread(integer ) => string - * - * Reads integer bytes from ios using a low-level - * read and returns them as a string. Do not mix with other methods - * that read from ios or you may get unpredictable results. - * Raises SystemCallError on error and - * EOFError at end of file. - * - * f = File.new("testfile") - * f.sysread(16) #=> "This is line one" - */ - -static VALUE -rb_io_sysread(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE len, str; - OpenFile *fptr; - long n, ilen; - - rb_scan_args(argc, argv, "11", &len, &str); - ilen = NUM2LONG(len); - - if (NIL_P(str)) { - str = rb_str_new(0, ilen); - } - else { - StringValue(str); - rb_str_modify(str); - rb_str_resize(str, ilen); - } - if (ilen == 0) return str; - - GetOpenFile(io, fptr); - rb_io_check_readable(fptr); - - if (READ_DATA_BUFFERED(fptr->f)) { - rb_raise(rb_eIOError, "sysread for buffered IO"); - } - rb_str_locktmp(str); - - n = fileno(fptr->f); - rb_thread_wait_fd(fileno(fptr->f)); - rb_io_check_closed(fptr); - if (RSTRING(str)->len != ilen) { - rb_raise(rb_eRuntimeError, "buffer string modified"); - } - TRAP_BEG; - n = read(fileno(fptr->f), RSTRING(str)->ptr, ilen); - TRAP_END; - - rb_str_unlocktmp(str); - if (n == -1) { - rb_sys_fail(fptr->path); - } - rb_str_resize(str, n); - if (n == 0 && ilen > 0) { - rb_eof_error(); - } - RSTRING(str)->len = n; - RSTRING(str)->ptr[n] = '\0'; - OBJ_TAINT(str); - - return str; -} - -/* - * call-seq: - * ios.binmode => ios - * - * Puts ios into binary mode. This is useful only in - * MS-DOS/Windows environments. Once a stream is in binary mode, it - * cannot be reset to nonbinary mode. - */ - -VALUE -rb_io_binmode(io) - VALUE io; -{ -#if defined(_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__EMX__) - OpenFile *fptr; - - GetOpenFile(io, fptr); -#ifdef __human68k__ - if (fptr->f) - fmode(fptr->f, _IOBIN); - if (fptr->f2) - fmode(fptr->f2, _IOBIN); -#else - if (fptr->f && setmode(fileno(fptr->f), O_BINARY) == -1) - rb_sys_fail(fptr->path); - if (fptr->f2 && setmode(fileno(fptr->f2), O_BINARY) == -1) - rb_sys_fail(fptr->path); -#endif - - fptr->mode |= FMODE_BINMODE; -#endif - return io; -} - -char* -rb_io_flags_mode(flags) - int flags; -{ -#ifdef O_BINARY -# define MODE_BINMODE(a,b) ((flags & FMODE_BINMODE) ? (b) : (a)) -#else -# define MODE_BINMODE(a,b) (a) -#endif - if (flags & FMODE_APPEND) { - if ((flags & FMODE_READWRITE) == FMODE_READWRITE) { - return MODE_BINMODE("a+", "ab+"); - } - return MODE_BINMODE("a", "ab"); - } - switch (flags & FMODE_READWRITE) { - case FMODE_READABLE: - return MODE_BINMODE("r", "rb"); - case FMODE_WRITABLE: - return MODE_BINMODE("w", "wb"); - case FMODE_READWRITE: - if (flags & FMODE_CREATE) { - return MODE_BINMODE("w+", "wb+"); - } - return MODE_BINMODE("r+", "rb+"); - } - rb_raise(rb_eArgError, "illegal access modenum %o", flags); - return NULL; /* not reached */ -} - -int -rb_io_mode_flags(mode) - const char *mode; -{ - int flags = 0; - const char *m = mode; - - switch (*m++) { - case 'r': - flags |= FMODE_READABLE; - break; - case 'w': - flags |= FMODE_WRITABLE | FMODE_CREATE; - break; - case 'a': - flags |= FMODE_WRITABLE | FMODE_APPEND | FMODE_CREATE; - break; - default: - error: - rb_raise(rb_eArgError, "illegal access mode %s", mode); - } - - while (*m) { - switch (*m++) { - case 'b': - flags |= FMODE_BINMODE; - break; - case '+': - flags |= FMODE_READWRITE; - break; - default: - goto error; - } - } - - return flags; -} - -int -rb_io_modenum_flags(mode) - int mode; -{ - int flags = 0; - - switch (mode & (O_RDONLY|O_WRONLY|O_RDWR)) { - case O_RDONLY: - flags = FMODE_READABLE; - break; - case O_WRONLY: - flags = FMODE_WRITABLE; - break; - case O_RDWR: - flags = FMODE_READWRITE; - break; - } - - if (mode & O_APPEND) { - flags |= FMODE_APPEND; - } - if (mode & O_CREAT) { - flags |= FMODE_CREATE; - } -#ifdef O_BINARY - if (mode & O_BINARY) { - flags |= FMODE_BINMODE; - } -#endif - - return flags; -} - -static int -rb_io_mode_modenum(mode) - const char *mode; -{ - int flags = 0; - const char *m = mode; - - switch (*m++) { - case 'r': - flags |= O_RDONLY; - break; - case 'w': - flags |= O_WRONLY | O_CREAT | O_TRUNC; - break; - case 'a': - flags |= O_WRONLY | O_CREAT | O_APPEND; - break; - default: - error: - rb_raise(rb_eArgError, "illegal access mode %s", mode); - } - - while (*m) { - switch (*m++) { - case 'b': -#ifdef O_BINARY - flags |= O_BINARY; -#endif - break; - case '+': - flags = (flags & ~O_ACCMODE) | O_RDWR; - break; - default: - goto error; - } - } - - return flags; -} - -#define MODENUM_MAX 4 - -static char* -rb_io_modenum_mode(flags) - int flags; -{ -#ifdef O_BINARY -# define MODE_BINARY(a,b) ((flags & O_BINARY) ? (b) : (a)) -#else -# define MODE_BINARY(a,b) (a) -#endif - if (flags & O_APPEND) { - if ((flags & O_RDWR) == O_RDWR) { - return MODE_BINARY("a+", "ab+"); - } - return MODE_BINARY("a", "ab"); - } - switch (flags & (O_RDONLY|O_WRONLY|O_RDWR)) { - case O_RDONLY: - return MODE_BINARY("r", "rb"); - case O_WRONLY: - return MODE_BINARY("w", "wb"); - case O_RDWR: - return MODE_BINARY("r+", "rb+"); - } - rb_raise(rb_eArgError, "illegal access modenum %o", flags); - return NULL; /* not reached */ -} - -static int -rb_sysopen(fname, flags, mode) - char *fname; - int flags; - unsigned int mode; -{ - int fd; - - fd = open(fname, flags, mode); - if (fd < 0) { - if (errno == EMFILE || errno == ENFILE) { - rb_gc(); - fd = open(fname, flags, mode); - } - if (fd < 0) { - rb_sys_fail(fname); - } - } - return fd; -} - -FILE * -rb_fopen(fname, mode) - const char *fname; - const char *mode; -{ - FILE *file; - - file = fopen(fname, mode); - if (!file) { - if (errno == EMFILE || errno == ENFILE) { - rb_gc(); - file = fopen(fname, mode); - } - if (!file) { - rb_sys_fail(fname); - } - } -#ifdef USE_SETVBUF - if (setvbuf(file, NULL, _IOFBF, 0) != 0) - rb_warn("setvbuf() can't be honoured for %s", fname); -#endif -#ifdef __human68k__ - fmode(file, _IOTEXT); -#endif - return file; -} - -FILE * -rb_fdopen(fd, mode) - int fd; - const char *mode; -{ - FILE *file; - -#if defined(sun) - errno = 0; -#endif - file = fdopen(fd, mode); - if (!file) { -#if defined(sun) - if (errno == 0 || errno == EMFILE || errno == ENFILE) { -#else - if (errno == EMFILE || errno == ENFILE) { -#endif - rb_gc(); -#if defined(sun) - errno = 0; -#endif - file = fdopen(fd, mode); - } - if (!file) { -#ifdef _WIN32 - if (errno == 0) errno = EINVAL; -#endif -#if defined(sun) - if (errno == 0) errno = EMFILE; -#endif - rb_sys_fail(0); - } - } - -#ifdef USE_SETVBUF - if (setvbuf(file, NULL, _IOFBF, 0) != 0) - rb_warn("setvbuf() can't be honoured (fd=%d)", fd); -#endif - return file; -} - -static VALUE -rb_file_open_internal(io, fname, mode) - VALUE io; - const char *fname, *mode; -{ - OpenFile *fptr; - - MakeOpenFile(io, fptr); - - fptr->mode = rb_io_mode_flags(mode); - fptr->path = strdup(fname); - fptr->f = rb_fopen(fptr->path, rb_io_flags_mode(fptr->mode)); - - return io; -} - -VALUE -rb_file_open(fname, mode) - const char *fname, *mode; -{ - return rb_file_open_internal(io_alloc(rb_cFile), fname, mode); -} - -static VALUE -rb_file_sysopen_internal(io, fname, flags, mode) - VALUE io; - char *fname; - int flags, mode; -{ - OpenFile *fptr; - int fd; - char *m; - - MakeOpenFile(io, fptr); - - fptr->path = strdup(fname); - m = rb_io_modenum_mode(flags); - fptr->mode = rb_io_modenum_flags(flags); - fd = rb_sysopen(fptr->path, flags, mode); - fptr->f = rb_fdopen(fd, m); - - return io; -} - -VALUE -rb_file_sysopen(fname, flags, mode) - const char *fname; - int flags, mode; -{ - return rb_file_sysopen_internal(io_alloc(rb_cFile), fname, flags, mode); -} - -#if defined (_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__VMS) -static struct pipe_list { - OpenFile *fptr; - struct pipe_list *next; -} *pipe_list; - -static void -pipe_add_fptr(fptr) - OpenFile *fptr; -{ - struct pipe_list *list; - - list = ALLOC(struct pipe_list); - list->fptr = fptr; - list->next = pipe_list; - pipe_list = list; -} - -static void -pipe_del_fptr(fptr) - OpenFile *fptr; -{ - struct pipe_list *list = pipe_list; - struct pipe_list *tmp; - - if (list->fptr == fptr) { - pipe_list = list->next; - free(list); - return; - } - - while (list->next) { - if (list->next->fptr == fptr) { - tmp = list->next; - list->next = list->next->next; - free(tmp); - return; - } - list = list->next; - } -} - -static void -pipe_atexit _((void)) -{ - struct pipe_list *list = pipe_list; - struct pipe_list *tmp; - - while (list) { - tmp = list->next; - rb_io_fptr_finalize(list->fptr); - list = tmp; - } -} - -static void pipe_finalize _((OpenFile *fptr,int)); - -static void -pipe_finalize(fptr, noraise) - OpenFile *fptr; - int noraise; -{ -#if !defined (__CYGWIN__) && !defined(_WIN32) - extern VALUE rb_last_status; - int status; - if (fptr->f) { - status = pclose(fptr->f); - } - if (fptr->f2) { - status = pclose(fptr->f2); - } - fptr->f = fptr->f2 = 0; -#if defined DJGPP - status <<= 8; -#endif - rb_last_status = INT2FIX(status); -#else - fptr_finalize(fptr, noraise); -#endif - pipe_del_fptr(fptr); -} -#endif - -void -rb_io_synchronized(fptr) - OpenFile *fptr; -{ - fptr->mode |= FMODE_SYNC; -} - -void -rb_io_unbuffered(fptr) - OpenFile *fptr; -{ - rb_io_synchronized(fptr); -} - -static VALUE pipe_open(VALUE pstr, char *pname, char *mode); - -static VALUE -pipe_open(pstr, pname, mode) - VALUE pstr; - char *pname, *mode; -{ - int modef = rb_io_mode_flags(mode); - OpenFile *fptr; -#if defined(DJGPP) || defined(__human68k__) || defined(__VMS) - FILE *f; -#else - int pid; -#ifdef _WIN32 - FILE *fpr, *fpw; -#else - int pr[2], pw[2]; -#endif -#endif - volatile int doexec; - - if (!pname) pname = StringValueCStr(pstr); - doexec = (strcmp("-", pname) != 0); - -#if defined(DJGPP) || defined(__human68k__) || defined(__VMS) || defined(_WIN32) - if (!doexec) { - rb_raise(rb_eNotImpError, - "fork() function is unimplemented on this machine"); - } -#endif - -#if defined(DJGPP) || defined(__human68k__) || defined(__VMS) - f = popen(pname, mode); - - if (!f) rb_sys_fail(pname); - else { - VALUE port = io_alloc(rb_cIO); - - MakeOpenFile(port, fptr); - fptr->finalize = pipe_finalize; - fptr->mode = modef; - - pipe_add_fptr(fptr); - if (modef & FMODE_READABLE) fptr->f = f; - if (modef & FMODE_WRITABLE) { - if (fptr->f) fptr->f2 = f; - else fptr->f = f; - rb_io_synchronized(fptr); - } - return (VALUE)port; - } -#else -#ifdef _WIN32 -retry: - pid = pipe_exec(pname, rb_io_mode_modenum(mode), &fpr, &fpw); - if (pid == -1) { /* exec failed */ - if (errno == EAGAIN) { - rb_thread_sleep(1); - goto retry; - } - rb_sys_fail(pname); - } - else { - VALUE port = io_alloc(rb_cIO); - - MakeOpenFile(port, fptr); - fptr->mode = modef; - fptr->mode |= FMODE_SYNC; - fptr->pid = pid; - - if (modef & FMODE_READABLE) { - fptr->f = fpr; - } - if (modef & FMODE_WRITABLE) { - if (fptr->f) fptr->f2 = fpw; - else fptr->f = fpw; - } - fptr->finalize = pipe_finalize; - pipe_add_fptr(fptr); - return (VALUE)port; - } -#else - if (((modef & FMODE_READABLE) && pipe(pr) == -1) || - ((modef & FMODE_WRITABLE) && pipe(pw) == -1)) - rb_sys_fail(pname); - - if (!doexec) { - fflush(stdin); /* is it really needed? */ - fflush(stdout); - fflush(stderr); - } - - retry: - switch ((pid = fork())) { - case 0: /* child */ - if (modef & FMODE_READABLE) { - close(pr[0]); - if (pr[1] != 1) { - dup2(pr[1], 1); - close(pr[1]); - } - } - if (modef & FMODE_WRITABLE) { - close(pw[1]); - if (pw[0] != 0) { - dup2(pw[0], 0); - close(pw[0]); - } - } - - if (doexec) { - int fd; - - for (fd = 3; fd < NOFILE; fd++) - close(fd); - rb_proc_exec(pname); - fprintf(stderr, "%s:%d: command not found: %s\n", - ruby_sourcefile, ruby_sourceline, pname); - _exit(127); - } - rb_io_synchronized(RFILE(orig_stdout)->fptr); - rb_io_synchronized(RFILE(orig_stderr)->fptr); - return Qnil; - - case -1: /* fork failed */ - if (errno == EAGAIN) { - rb_thread_sleep(1); - goto retry; - } - else { - int e = errno; - if ((modef & FMODE_READABLE)) { - close(pr[0]); - close(pr[1]); - } - if ((modef & FMODE_WRITABLE)) { - close(pw[0]); - close(pw[1]); - } - errno = e; - rb_sys_fail(pname); - } - break; - - default: /* parent */ - if (pid < 0) rb_sys_fail(pname); - else { - VALUE port = io_alloc(rb_cIO); - - MakeOpenFile(port, fptr); - fptr->mode = modef; - fptr->mode |= FMODE_SYNC; - fptr->pid = pid; - - if (modef & FMODE_READABLE) { - close(pr[1]); - fptr->f = rb_fdopen(pr[0], "r"); - } - if (modef & FMODE_WRITABLE) { - FILE *f = rb_fdopen(pw[1], "w"); - - close(pw[0]); - if (fptr->f) fptr->f2 = f; - else fptr->f = f; - } -#if defined (__CYGWIN__) - fptr->finalize = pipe_finalize; - pipe_add_fptr(fptr); -#endif - return port; - } - } -#endif -#endif -} - -/* - * call-seq: - * IO.popen(cmd_string, mode="r" ) => io - * IO.popen(cmd_string, mode="r" ) {|io| block } => obj - * - * Runs the specified command string as a subprocess; the subprocess's - * standard input and output will be connected to the returned - * IO object. If cmd_string starts with a - * ``-'', then a new instance of Ruby is started as the - * subprocess. The default mode for the new file object is ``r'', but - * mode may be set to any of the modes listed in the description - * for class IO. - * - * If a block is given, Ruby will run the command as a child connected - * to Ruby with a pipe. Ruby's end of the pipe will be passed as a - * parameter to the block. - * At the end of block, Ruby close the pipe and sets $?. - * In this case IO::popen returns - * the value of the block. - * - * If a block is given with a cmd_string of ``-'', - * the block will be run in two separate processes: once in the parent, - * and once in a child. The parent process will be passed the pipe - * object as a parameter to the block, the child version of the block - * will be passed nil, and the child's standard in and - * standard out will be connected to the parent through the pipe. Not - * available on all platforms. - * - * f = IO.popen("uname") - * p f.readlines - * puts "Parent is #{Process.pid}" - * IO.popen ("date") { |f| puts f.gets } - * IO.popen("-") {|f| $stderr.puts "#{Process.pid} is here, f is #{f}"} - * p $? - * - * produces: - * - * ["Linux\n"] - * Parent is 26166 - * Wed Apr 9 08:53:52 CDT 2003 - * 26169 is here, f is - * 26166 is here, f is # - * # - */ - -static VALUE -rb_io_s_popen(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - char *mode; - VALUE pname, pmode, port; - - if (rb_scan_args(argc, argv, "11", &pname, &pmode) == 1) { - mode = "r"; - } - else if (FIXNUM_P(pmode)) { - mode = rb_io_modenum_mode(FIX2INT(pmode)); - } - else { - mode = rb_io_flags_mode(rb_io_mode_flags(StringValueCStr(pmode))); - } - SafeStringValue(pname); - port = pipe_open(pname, 0, mode); - if (NIL_P(port)) { - /* child */ - if (rb_block_given_p()) { - rb_yield(Qnil); - fflush(stdout); - fflush(stderr); - _exit(0); - } - return Qnil; - } - RBASIC(port)->klass = klass; - if (rb_block_given_p()) { - return rb_ensure(rb_yield, port, io_close, port); - } - return port; -} - -static VALUE -rb_open_file(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE fname, vmode, perm; - char *path, *mode; - int flags; - unsigned int fmode; - - rb_scan_args(argc, argv, "12", &fname, &vmode, &perm); - SafeStringValue(fname); - - path = StringValueCStr(fname); - if (FIXNUM_P(vmode) || !NIL_P(perm)) { - if (FIXNUM_P(vmode)) { - flags = FIX2INT(vmode); - } - else { - SafeStringValue(vmode); - flags = rb_io_mode_modenum(RSTRING(vmode)->ptr); - } - fmode = NIL_P(perm) ? 0666 : NUM2UINT(perm); - - rb_file_sysopen_internal(io, path, flags, fmode); - } - else { - mode = NIL_P(vmode) ? "r" : StringValueCStr(vmode); - rb_file_open_internal(io, path, mode); - } - return io; -} - -/* - * call-seq: - * IO.open(fd, mode_string="r" ) => io - * IO.open(fd, mode_string="r" ) {|io| block } => obj - * - * With no associated block, open is a synonym for - * IO::new. If the optional code block is given, it will - * be passed io as an argument, and the IO object will - * automatically be closed when the block terminates. In this instance, - * IO::open returns the value of the block. - * - */ - -static VALUE -rb_io_s_open(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - VALUE io = rb_class_new_instance(argc, argv, klass); - - if (rb_block_given_p()) { - return rb_ensure(rb_yield, io, io_close, io); - } - - return io; -} - -/* - * call-seq: - * IO.sysopen(path, [mode, [perm]]) => fixnum - * - * Opens the given path, returning the underlying file descriptor as a - * Fixnum. - * - * IO.sysopen("testfile") #=> 3 - * - */ - -static VALUE -rb_io_s_sysopen(argc, argv) - int argc; - VALUE *argv; -{ - VALUE fname, vmode, perm; - int flags, fd; - unsigned int fmode; - char *path; - - rb_scan_args(argc, argv, "12", &fname, &vmode, &perm); - SafeStringValue(fname); - - if (NIL_P(vmode)) flags = O_RDONLY; - else if (FIXNUM_P(vmode)) flags = FIX2INT(vmode); - else { - SafeStringValue(vmode); - flags = rb_io_mode_modenum(RSTRING(vmode)->ptr); - } - if (NIL_P(perm)) fmode = 0666; - else fmode = NUM2UINT(perm); - - path = ALLOCA_N(char, strlen(RSTRING(fname)->ptr)+1); - strcpy(path, RSTRING(fname)->ptr); - fd = rb_sysopen(path, flags, fmode); - return INT2NUM(fd); -} - -/* - * call-seq: - * open(path [, mode [, perm]] ) => io or nil - * open(path [, mode [, perm]] ) {|io| block } => obj - * - * Creates an IO object connected to the given stream, - * file, or subprocess. - * - * If path does not start with a pipe character - * (``|''), treat it as the name of a file to open using - * the specified mode (defaulting to ``r''). (See the table - * of valid modes on page 331.) If a file is being created, its initial - * permissions may be set using the integer third parameter. - * - * If a block is specified, it will be invoked with the - * File object as a parameter, and the file will be - * automatically closed when the block terminates. The call - * returns the value of the block. - * - * If path starts with a pipe character, a subprocess is - * created, connected to the caller by a pair of pipes. The returned - * IO object may be used to write to the standard input - * and read from the standard output of this subprocess. If the command - * following the ``|'' is a single minus sign, Ruby forks, - * and this subprocess is connected to the parent. In the subprocess, - * the open call returns nil. If the command - * is not ``-'', the subprocess runs the command. If a - * block is associated with an open("|-") call, that block - * will be run twice---once in the parent and once in the child. The - * block parameter will be an IO object in the parent and - * nil in the child. The parent's IO object - * will be connected to the child's $stdin and - * $stdout. The subprocess will be terminated at the end - * of the block. - * - * open("testfile") do |f| - * print f.gets - * end - * - * produces: - * - * This is line one - * - * Open a subprocess and read its output: - * - * cmd = open("|date") - * print cmd.gets - * cmd.close - * - * produces: - * - * Wed Apr 9 08:56:31 CDT 2003 - * - * Open a subprocess running the same Ruby program: - * - * f = open("|-", "w+") - * if f == nil - * puts "in Child" - * exit - * else - * puts "Got: #{f.gets}" - * end - * - * produces: - * - * Got: in Child - * - * Open a subprocess using a block to receive the I/O object: - * - * open("|-") do |f| - * if f == nil - * puts "in Child" - * else - * puts "Got: #{f.gets}" - * end - * end - * - * produces: - * - * Got: in Child - */ - -static VALUE -rb_f_open(argc, argv) - int argc; - VALUE *argv; -{ - if (argc >= 1) { - char *str = StringValuePtr(argv[0]); - - if (str[0] == '|') { - VALUE tmp = rb_str_new(str+1, RSTRING(argv[0])->len-1); - OBJ_INFECT(tmp, argv[0]); - argv[0] = tmp; - return rb_io_s_popen(argc, argv, rb_cIO); - } - } - return rb_io_s_open(argc, argv, rb_cFile); -} - -static VALUE -rb_io_open(fname, mode) - char *fname, *mode; -{ - if (fname[0] == '|') { - return pipe_open(0, fname+1, mode); - } - else { - return rb_file_open(fname, mode); - } -} - -static VALUE -rb_io_get_io(io) - VALUE io; -{ - return rb_convert_type(io, T_FILE, "IO", "to_io"); -} - -static VALUE -rb_io_check_io(io) - VALUE io; -{ - return rb_check_convert_type(io, T_FILE, "IO", "to_io"); -} - -static char* -rb_io_mode_string(fptr) - OpenFile *fptr; -{ - switch (fptr->mode & FMODE_READWRITE) { - case FMODE_READABLE: - default: - return "r"; - case FMODE_WRITABLE: - return "w"; - case FMODE_READWRITE: - return "r+"; - } -} - -static VALUE -io_reopen(io, nfile) - VALUE io, nfile; -{ - OpenFile *fptr, *orig; - char *mode; - int fd, fd2; - off_t pos = 0; - - nfile = rb_io_get_io(nfile); - if (rb_safe_level() >= 4 && (!OBJ_TAINTED(io) || !OBJ_TAINTED(nfile))) { - rb_raise(rb_eSecurityError, "Insecure: can't reopen"); - } - GetOpenFile(io, fptr); - GetOpenFile(nfile, orig); - - if (fptr == orig) return io; - if (orig->mode & FMODE_READABLE) { - pos = io_tell(orig); - } - if (orig->f2) { - io_fflush(orig->f2, orig); - } - else if (orig->mode & FMODE_WRITABLE) { - io_fflush(orig->f, orig); - } - if (fptr->mode & FMODE_WRITABLE) { - io_fflush(GetWriteFile(fptr), fptr); - } - - /* copy OpenFile structure */ - fptr->mode = orig->mode; - fptr->pid = orig->pid; - fptr->lineno = orig->lineno; - if (fptr->path) free(fptr->path); - if (orig->path) fptr->path = strdup(orig->path); - else fptr->path = 0; - fptr->finalize = orig->finalize; - - mode = rb_io_mode_string(fptr); - fd = fileno(fptr->f); - fd2 = fileno(orig->f); - if (fd != fd2) { - if (fptr->f == stdin || fptr->f == stdout || fptr->f == stderr) { - clearerr(fptr->f); - /* need to keep stdio objects */ - if (dup2(fd2, fd) < 0) - rb_sys_fail(orig->path); - } - else { - FILE *f2 = fptr->f2; - int m = fptr->mode; - fclose(fptr->f); - fptr->f = f2; - fptr->f2 = NULL; - fptr->mode &= (m & FMODE_READABLE) ? ~FMODE_READABLE : ~FMODE_WRITABLE; - if (dup2(fd2, fd) < 0) - rb_sys_fail(orig->path); - if (f2) { - fptr->f = rb_fdopen(fd, "r"); - fptr->f2 = f2; - } - else { - fptr->f = rb_fdopen(fd, mode); - } - fptr->mode = m; - } - rb_thread_fd_close(fd); - if ((orig->mode & FMODE_READABLE) && pos >= 0) { - io_seek(fptr, pos, SEEK_SET); - io_seek(orig, pos, SEEK_SET); - } - } - - if (fptr->f2 && fd != fileno(fptr->f2)) { - fd = fileno(fptr->f2); - if (!orig->f2) { - fclose(fptr->f2); - rb_thread_fd_close(fd); - fptr->f2 = 0; - } - else if (fd != (fd2 = fileno(orig->f2))) { - fclose(fptr->f2); - rb_thread_fd_close(fd); - if (dup2(fd2, fd) < 0) - rb_sys_fail(orig->path); - fptr->f2 = rb_fdopen(fd, "w"); - } - } - - if (fptr->mode & FMODE_BINMODE) { - rb_io_binmode(io); - } - - RBASIC(io)->klass = RBASIC(nfile)->klass; - return io; -} - -/* - * call-seq: - * ios.reopen(other_IO) => ios - * ios.reopen(path, mode_str) => ios - * - * Reassociates ios with the I/O stream given in - * other_IO or to a new stream opened on path. This may - * dynamically change the actual class of this stream. - * - * f1 = File.new("testfile") - * f2 = File.new("testfile") - * f2.readlines[0] #=> "This is line one\n" - * f2.reopen(f1) #=> # - * f2.readlines[0] #=> "This is line one\n" - */ - -static VALUE -rb_io_reopen(argc, argv, file) - int argc; - VALUE *argv; - VALUE file; -{ - VALUE fname, nmode; - char *mode; - OpenFile *fptr; - - rb_secure(4); - if (rb_scan_args(argc, argv, "11", &fname, &nmode) == 1) { - VALUE tmp = rb_io_check_io(fname); - if (!NIL_P(tmp)) { - return io_reopen(file, tmp); - } - } - - SafeStringValue(fname); - rb_io_taint_check(file); - fptr = RFILE(file)->fptr; - if (!fptr) { - fptr = RFILE(file)->fptr = ALLOC(OpenFile); - MEMZERO(fptr, OpenFile, 1); - } - - if (!NIL_P(nmode)) { - fptr->mode = rb_io_mode_flags(StringValueCStr(nmode)); - } - - if (fptr->path) { - free(fptr->path); - fptr->path = 0; - } - - fptr->path = strdup(StringValueCStr(fname)); - mode = rb_io_flags_mode(fptr->mode); - if (!fptr->f) { - fptr->f = rb_fopen(fptr->path, mode); - if (fptr->f2) { - fclose(fptr->f2); - fptr->f2 = 0; - } - return file; - } - - if (freopen(fptr->path, mode, fptr->f) == 0) { - rb_sys_fail(fptr->path); - } -#ifdef USE_SETVBUF - if (setvbuf(fptr->f, NULL, _IOFBF, 0) != 0) - rb_warn("setvbuf() can't be honoured for %s", fptr->path); -#endif - - if (fptr->f2) { - if (freopen(fptr->path, "w", fptr->f2) == 0) { - rb_sys_fail(fptr->path); - } - } - - return file; -} - -/* :nodoc: */ -static VALUE -rb_io_init_copy(dest, io) - VALUE dest, io; -{ - OpenFile *fptr, *orig; - int fd; - char *mode; - - io = rb_io_get_io(io); - if (dest == io) return dest; - GetOpenFile(io, orig); - MakeOpenFile(dest, fptr); - - if (orig->f2) { - io_fflush(orig->f2, orig); - fseeko(orig->f, 0L, SEEK_CUR); - } - else if (orig->mode & FMODE_WRITABLE) { - io_fflush(orig->f, orig); - } - else { - fseeko(orig->f, 0L, SEEK_CUR); - } - - /* copy OpenFile structure */ - fptr->mode = orig->mode; - fptr->pid = orig->pid; - fptr->lineno = orig->lineno; - if (orig->path) fptr->path = strdup(orig->path); - fptr->finalize = orig->finalize; - - switch (fptr->mode & FMODE_READWRITE) { - case FMODE_READABLE: - default: - mode = "r"; break; - case FMODE_WRITABLE: - mode = "w"; break; - case FMODE_READWRITE: - if (orig->f2) mode = "r"; - else mode = "r+"; - break; - } - fd = ruby_dup(fileno(orig->f)); - fptr->f = rb_fdopen(fd, mode); - fseeko(fptr->f, ftello(orig->f), SEEK_SET); - if (orig->f2) { - if (fileno(orig->f) != fileno(orig->f2)) { - fd = ruby_dup(fileno(orig->f2)); - } - fptr->f2 = rb_fdopen(fd, "w"); - fseeko(fptr->f2, ftello(orig->f2), SEEK_SET); - } - if (fptr->mode & FMODE_BINMODE) { - rb_io_binmode(dest); - } - - return dest; -} - -/* - * call-seq: - * ios.printf(format_string [, obj, ...] ) => nil - * - * Formats and writes to ios, converting parameters under - * control of the format string. See Kernel#sprintf - * for details. - */ - -VALUE -rb_io_printf(argc, argv, out) - int argc; - VALUE argv[]; - VALUE out; -{ - rb_io_write(out, rb_f_sprintf(argc, argv)); - return Qnil; -} - -/* - * call-seq: - * printf(io, string [, obj ... ] ) => nil - * printf(string [, obj ... ] ) => nil - * - * Equivalent to: - * io.write(sprintf(string, obj, ...) - * or - * $stdout.write(sprintf(string, obj, ...) - */ - -static VALUE -rb_f_printf(argc, argv) - int argc; - VALUE argv[]; -{ - VALUE out; - - if (argc == 0) return Qnil; - if (TYPE(argv[0]) == T_STRING) { - out = rb_stdout; - } - else { - out = argv[0]; - argv++; - argc--; - } - rb_io_write(out, rb_f_sprintf(argc, argv)); - - return Qnil; -} - -/* - * call-seq: - * ios.print() => nil - * ios.print(obj, ...) => nil - * - * Writes the given object(s) to ios. The stream must be - * opened for writing. If the output record separator ($\\) - * is not nil, it will be appended to the output. If no - * arguments are given, prints $_. Objects that aren't - * strings will be converted by calling their to_s method. - * With no argument, prints the contents of the variable $_. - * Returns nil. - * - * $stdout.print("This is ", 100, " percent.\n") - * - * produces: - * - * This is 100 percent. - */ - -VALUE -rb_io_print(argc, argv, out) - int argc; - VALUE *argv; - VALUE out; -{ - int i; - VALUE line; - - /* if no argument given, print `$_' */ - if (argc == 0) { - argc = 1; - line = rb_lastline_get(); - argv = &line; - } - for (i=0; i0) { - rb_io_write(out, rb_output_fs); - } - switch (TYPE(argv[i])) { - case T_NIL: - rb_io_write(out, rb_str_new2("nil")); - break; - default: - rb_io_write(out, argv[i]); - break; - } - } - if (!NIL_P(rb_output_rs)) { - rb_io_write(out, rb_output_rs); - } - - return Qnil; -} - -/* - * call-seq: - * print(obj, ...) => nil - * - * Prints each object in turn to $stdout. If the output - * field separator ($,) is not +nil+, its - * contents will appear between each field. If the output record - * separator ($\\) is not +nil+, it will be - * appended to the output. If no arguments are given, prints - * $_. Objects that aren't strings will be converted by - * calling their to_s method. - * - * print "cat", [1,2,3], 99, "\n" - * $, = ", " - * $\ = "\n" - * print "cat", [1,2,3], 99 - * - * produces: - * - * cat12399 - * cat, 1, 2, 3, 99 - */ - -static VALUE -rb_f_print(argc, argv) - int argc; - VALUE *argv; -{ - rb_io_print(argc, argv, rb_stdout); - return Qnil; -} - -/* - * call-seq: - * ios.putc(obj) => obj - * - * If obj is Numeric, write the character whose - * code is obj, otherwise write the first character of the - * string representation of obj to ios. - * - * $stdout.putc "A" - * $stdout.putc 65 - * - * produces: - * - * AA - */ - -static VALUE -rb_io_putc(io, ch) - VALUE io, ch; -{ - char c = NUM2CHR(ch); - - rb_io_write(io, rb_str_new(&c, 1)); - return ch; -} - -/* - * call-seq: - * putc(int) => int - * - * Equivalent to: - * - * $stdout.putc(int) - */ - -static VALUE -rb_f_putc(recv, ch) - VALUE recv, ch; -{ - return rb_io_putc(rb_stdout, ch); -} - -static VALUE -io_puts_ary(ary, out) - VALUE ary, out; -{ - VALUE tmp; - long i; - - for (i=0; ilen; i++) { - tmp = RARRAY(ary)->ptr[i]; - if (rb_inspecting_p(tmp)) { - tmp = rb_str_new2("[...]"); - } - rb_io_puts(1, &tmp, out); - } - return Qnil; -} - -/* - * call-seq: - * ios.puts(obj, ...) => nil - * - * Writes the given objects to ios as with - * IO#print. Writes a record separator (typically a - * newline) after any that do not already end with a newline sequence. - * If called with an array argument, writes each element on a new line. - * If called without arguments, outputs a single record separator. - * - * $stdout.puts("this", "is", "a", "test") - * - * produces: - * - * this - * is - * a - * test - */ - -VALUE -rb_io_puts(argc, argv, out) - int argc; - VALUE *argv; - VALUE out; -{ - int i; - VALUE line; - - /* if no argument given, print newline. */ - if (argc == 0) { - rb_io_write(out, rb_default_rs); - return Qnil; - } - for (i=0; ilen == 0 || - RSTRING(line)->ptr[RSTRING(line)->len-1] != '\n') { - rb_io_write(out, rb_default_rs); - } - } - - return Qnil; -} - -/* - * call-seq: - * puts(obj, ...) => nil - * - * Equivalent to - * - * $stdout.puts(obj, ...) - */ - -static VALUE -rb_f_puts(argc, argv) - int argc; - VALUE *argv; -{ - rb_io_puts(argc, argv, rb_stdout); - return Qnil; -} - -void -rb_p(obj) /* for debug print within C code */ - VALUE obj; -{ - rb_io_write(rb_stdout, rb_obj_as_string(rb_inspect(obj))); - rb_io_write(rb_stdout, rb_default_rs); -} - -/* - * call-seq: - * p(obj, ...) => nil - * - * For each object, directly writes - * _obj_.+inspect+ followed by the current output - * record separator to the program's standard output. - * - * S = Struct.new(:name, :state) - * s = S['dave', 'TX'] - * p s - * - * produces: - * - * # - */ - -static VALUE -rb_f_p(argc, argv) - int argc; - VALUE *argv; -{ - int i; - - for (i=0; i) => nil - * - * Prints obj on the given port (default $>). - * Equivalent to: - * - * def display(port=$>) - * port.write self - * end - * - * For example: - * - * 1.display - * "cat".display - * [ 4, 5, 6 ].display - * puts - * - * produces: - * - * 1cat456 - */ - -static VALUE -rb_obj_display(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; -{ - VALUE out; - - if (rb_scan_args(argc, argv, "01", &out) == 0) { - out = rb_stdout; - } - - rb_io_write(out, self); - - return Qnil; -} - -void -rb_write_error2(mesg, len) - const char *mesg; - long len; -{ - rb_io_write(rb_stderr, rb_str_new(mesg, len)); -} - -void -rb_write_error(mesg) - const char *mesg; -{ - rb_write_error2(mesg, strlen(mesg)); -} - -static void -must_respond_to(mid, val, id) - ID mid; - VALUE val; - ID id; -{ - if (!rb_respond_to(val, mid)) { - rb_raise(rb_eTypeError, "%s must have %s method, %s given", - rb_id2name(id), rb_id2name(mid), - rb_obj_classname(val)); - } -} - -static void -stdout_setter(val, id, variable) - VALUE val; - ID id; - VALUE *variable; -{ - must_respond_to(id_write, val, id); - *variable = val; -} - -static void -defout_setter(val, id, variable) - VALUE val; - ID id; - VALUE *variable; -{ - stdout_setter(val, id, variable); - rb_warn("$defout is obsolete; use $stdout instead"); -} - -static void -deferr_setter(val, id, variable) - VALUE val; - ID id; - VALUE *variable; -{ - stdout_setter(val, id, variable); - rb_warn("$deferr is obsolete; use $stderr instead"); -} - -static VALUE -prep_stdio(f, mode, klass) - FILE *f; - int mode; - VALUE klass; -{ - OpenFile *fp; - VALUE io = io_alloc(klass); - - MakeOpenFile(io, fp); -#ifdef __CYGWIN__ - if (!isatty(fileno(f))) { - mode |= O_BINARY; - setmode(fileno(f), O_BINARY); - } -#endif - fp->f = f; - fp->mode = mode; - - return io; -} - -static void -prep_path(io, path) - VALUE io; - char *path; -{ - OpenFile *fptr; - - GetOpenFile(io, fptr); - if (fptr->path) rb_bug("illegal prep_path() call"); - fptr->path = strdup(path); -} - -/* - * call-seq: - * IO.new(fd, mode) => io - * - * Returns a new IO object (a stream) for the given - * integer file descriptor and mode string. See also - * IO#fileno and IO::for_fd. - * - * a = IO.new(2,"w") # '2' is standard error - * $stderr.puts "Hello" - * a.puts "World" - * - * produces: - * - * Hello - * World - */ - -static VALUE -rb_io_initialize(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE fnum, mode; - OpenFile *fp; - int fd, flags; - - rb_secure(4); - rb_scan_args(argc, argv, "11", &fnum, &mode); - fd = NUM2INT(fnum); - if (argc == 2) { - if (FIXNUM_P(mode)) { - flags = FIX2LONG(mode); - } - else { - SafeStringValue(mode); - flags = rb_io_mode_modenum(StringValueCStr(mode)); - } - } - else { -#if defined(HAVE_FCNTL) && defined(F_GETFL) - flags = fcntl(fd, F_GETFL); - if (flags == -1) rb_sys_fail(0); -#else - flags = O_RDONLY; -#endif - } - MakeOpenFile(io, fp); - fp->mode = rb_io_modenum_flags(flags); - fp->f = rb_fdopen(fd, rb_io_modenum_mode(flags)); - - return io; -} - -/* - * call-seq: - * File.new(filename, mode="r") => file - * File.new(filename [, mode [, perm]]) => file - * - - * Opens the file named by _filename_ according to - * _mode_ (default is ``r'') and returns a new - * File object. See the description of class +IO+ for - * a description of _mode_. The file mode may optionally be - * specified as a +Fixnum+ by _or_-ing together the - * flags (O_RDONLY etc, again described under +IO+). Optional - * permission bits may be given in _perm_. These mode and permission - * bits are platform dependent; on Unix systems, see - * open(2) for details. - * - * f = File.new("testfile", "r") - * f = File.new("newfile", "w+") - * f = File.new("newfile", File::CREAT|File::TRUNC|File::RDWR, 0644) - */ - -static VALUE -rb_file_initialize(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - if (RFILE(io)->fptr) { - rb_raise(rb_eRuntimeError, "reinitializing File"); - } - if (0 < argc && argc < 3) { - VALUE fd = rb_check_convert_type(argv[0], T_FIXNUM, "Fixnum", "to_int"); - - if (!NIL_P(fd)) { - argv[0] = fd; - return rb_io_initialize(argc, argv, io); - } - } - rb_open_file(argc, argv, io); - - return io; -} - -/* - * call-seq: - * IO.new(fd, mode_string) => io - * - * Returns a new IO object (a stream) for the given - * integer file descriptor and mode string. See also - * IO#fileno and IO::for_fd. - * - * a = IO.new(2,"w") # '2' is standard error - * $stderr.puts "Hello" - * a.puts "World" - * - * produces: - * - * Hello - * World - */ - -static VALUE -rb_io_s_new(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - if (rb_block_given_p()) { - char *cname = rb_class2name(klass); - - rb_warn("%s::new() does not take block; use %s::open() instead", - cname, cname); - } - return rb_class_new_instance(argc, argv, klass); -} - -/* - * call-seq: - * IO.for_fd(fd, mode) => io - * - * Synonym for IO::new. - * - */ - -static VALUE -rb_io_s_for_fd(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - VALUE io = rb_obj_alloc(klass); - rb_io_initialize(argc, argv, io); - return io; -} - -static int binmode = 0; - -static VALUE -argf_forward(int argc, VALUE *argv) -{ - return rb_funcall3(current_file, ruby_frame->last_func, argc, argv); -} - -#define ARGF_FORWARD(argc, argv) do {\ - if (TYPE(current_file) != T_FILE)\ - return argf_forward(argc, argv);\ -} while (0) -#define NEXT_ARGF_FORWARD(argc, argv) do {\ - if (!next_argv()) return Qnil;\ - ARGF_FORWARD(argc, argv);\ -} while (0) - -static void -argf_close(file) - VALUE file; -{ - if (TYPE(file) == T_FILE) - rb_io_close(file); - else - rb_funcall3(file, rb_intern("close"), 0, 0); -} - -static int -next_argv() -{ - extern VALUE rb_argv; - char *fn; - OpenFile *fptr; - int stdout_binmode = 0; - - if (TYPE(rb_stdout) == T_FILE) { - GetOpenFile(rb_stdout, fptr); - if (fptr->mode & FMODE_BINMODE) - stdout_binmode = 1; - } - - if (init_p == 0) { - if (RARRAY(rb_argv)->len > 0) { - next_p = 1; - } - else { - next_p = -1; - } - init_p = 1; - gets_lineno = 0; - } - - if (next_p == 1) { - next_p = 0; - retry: - if (RARRAY(rb_argv)->len > 0) { - filename = rb_ary_shift(rb_argv); - fn = StringValueCStr(filename); - if (strlen(fn) == 1 && fn[0] == '-') { - current_file = rb_stdin; - if (ruby_inplace_mode) { - rb_warn("Can't do inplace edit for stdio; skipping"); - goto retry; - } - } - else { - FILE *fr = rb_fopen(fn, "r"); - - if (ruby_inplace_mode) { - struct stat st, st2; - VALUE str; - FILE *fw; - - if (TYPE(rb_stdout) == T_FILE && rb_stdout != orig_stdout) { - rb_io_close(rb_stdout); - } - fstat(fileno(fr), &st); - if (*ruby_inplace_mode) { - str = rb_str_new2(fn); -#ifdef NO_LONG_FNAME - ruby_add_suffix(str, ruby_inplace_mode); -#else - rb_str_cat2(str, ruby_inplace_mode); -#endif -#ifdef NO_SAFE_RENAME - (void)fclose(fr); - (void)unlink(RSTRING(str)->ptr); - (void)rename(fn, RSTRING(str)->ptr); - fr = rb_fopen(RSTRING(str)->ptr, "r"); -#else - if (rename(fn, RSTRING(str)->ptr) < 0) { - rb_warn("Can't rename %s to %s: %s, skipping file", - fn, RSTRING(str)->ptr, strerror(errno)); - fclose(fr); - goto retry; - } -#endif - } - else { -#ifdef NO_SAFE_RENAME - rb_fatal("Can't do inplace edit without backup"); -#else - if (unlink(fn) < 0) { - rb_warn("Can't remove %s: %s, skipping file", - fn, strerror(errno)); - fclose(fr); - goto retry; - } -#endif - } - fw = rb_fopen(fn, "w"); -#ifndef NO_SAFE_RENAME - fstat(fileno(fw), &st2); -#ifdef HAVE_FCHMOD - fchmod(fileno(fw), st.st_mode); -#else - chmod(fn, st.st_mode); -#endif - if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { - fchown(fileno(fw), st.st_uid, st.st_gid); - } -#endif - rb_stdout = prep_stdio(fw, FMODE_WRITABLE, rb_cFile); - prep_path(rb_stdout, fn); - if (stdout_binmode) rb_io_binmode(rb_stdout); - } - current_file = prep_stdio(fr, FMODE_READABLE, rb_cFile); - prep_path(current_file, fn); - } - if (binmode) rb_io_binmode(current_file); - } - else { - next_p = 1; - return Qfalse; - } - } - else if (next_p == -1) { - current_file = rb_stdin; - filename = rb_str_new2("-"); - if (ruby_inplace_mode) { - rb_warn("Can't do inplace edit for stdio"); - rb_stdout = orig_stdout; - } - } - return Qtrue; -} - -static VALUE -argf_getline(argc, argv) - int argc; - VALUE *argv; -{ - VALUE line; - - retry: - if (!next_argv()) return Qnil; - if (argc == 0 && rb_rs == rb_default_rs) { - line = rb_io_gets(current_file); - } - else { - VALUE rs; - - if (argc == 0) { - rs = rb_rs; - } - else { - rb_scan_args(argc, argv, "1", &rs); - if (!NIL_P(rs)) StringValue(rs); - } - line = rb_io_getline(rs, current_file); - } - if (NIL_P(line) && next_p != -1) { - argf_close(current_file); - next_p = 1; - goto retry; - } - if (!NIL_P(line)) { - gets_lineno++; - lineno = INT2FIX(gets_lineno); - } - return line; -} - -/* - * call-seq: - * gets(separator=$/) => string or nil - * - * Returns (and assigns to $_) the next line from the list - * of files in +ARGV+ (or $*), or from standard - * input if no files are present on the command line. Returns - * +nil+ at end of file. The optional argument specifies the - * record separator. The separator is included with the contents of - * each record. A separator of +nil+ reads the entire - * contents, and a zero-length separator reads the input one paragraph - * at a time, where paragraphs are divided by two consecutive newlines. - * If multiple filenames are present in +ARGV+, - * +gets(nil)+ will read the contents one file at a time. - * - * ARGV << "testfile" - * print while gets - * - * produces: - * - * This is line one - * This is line two - * This is line three - * And so on... - * - * The style of programming using $_ as an implicit - * parameter is gradually losing favor in the Ruby community. - */ - -static VALUE -rb_f_gets(argc, argv) - int argc; - VALUE *argv; -{ - VALUE line; - - if (!next_argv()) return Qnil; - if (TYPE(current_file) != T_FILE) { - line = rb_funcall3(current_file, rb_intern("gets"), argc, argv); - } - else { - line = argf_getline(argc, argv); - } - rb_lastline_set(line); - return line; -} - -VALUE -rb_gets() -{ - VALUE line; - - if (rb_rs != rb_default_rs) { - return rb_f_gets(0, 0); - } - - retry: - if (!next_argv()) return Qnil; - line = rb_io_gets(current_file); - if (NIL_P(line) && next_p != -1) { - argf_close(current_file); - next_p = 1; - goto retry; - } - rb_lastline_set(line); - if (!NIL_P(line)) { - gets_lineno++; - lineno = INT2FIX(gets_lineno); - } - - return line; -} - -/* - * call-seq: - * readline(separator=$/) => string - * - * Equivalent to Kernel::gets, except - * +readline+ raises +EOFError+ at end of file. - */ - -static VALUE -rb_f_readline(argc, argv) - int argc; - VALUE *argv; -{ - VALUE line; - - if (!next_argv()) rb_eof_error(); - ARGF_FORWARD(argc, argv); - line = rb_f_gets(argc, argv); - if (NIL_P(line)) { - rb_eof_error(); - } - - return line; -} - -/* - * obsolete - */ - -static VALUE -rb_f_getc() -{ - rb_warn("getc is obsolete; use STDIN.getc instead"); - if (TYPE(rb_stdin) != T_FILE) { - return rb_funcall3(rb_stdin, rb_intern("getc"), 0, 0); - } - return rb_io_getc(rb_stdin); -} - -/* - * call-seq: - * readlines(separator=$/) => array - * - * Returns an array containing the lines returned by calling - * Kernel.gets(separator) until the end of file. - */ - -static VALUE -rb_f_readlines(argc, argv) - int argc; - VALUE *argv; -{ - VALUE line, ary; - - NEXT_ARGF_FORWARD(argc, argv); - ary = rb_ary_new(); - while (!NIL_P(line = argf_getline(argc, argv))) { - rb_ary_push(ary, line); - } - - return ary; -} - -/* - * call-seq: - * `cmd` => string - * - * Returns the standard output of running _cmd_ in a subshell. - * The built-in syntax %x{...} uses - * this method. Sets $? to the process status. - * - * `date` #=> "Wed Apr 9 08:56:30 CDT 2003\n" - * `ls testdir`.split[1] #=> "main.rb" - * `echo oops && exit 99` #=> "oops\n" - * $?.exitstatus #=> 99 - */ - -static VALUE -rb_f_backquote(obj, str) - VALUE obj, str; -{ - volatile VALUE port; - VALUE result; - OpenFile *fptr; - - SafeStringValue(str); - port = pipe_open(str, 0, "r"); - if (NIL_P(port)) return rb_str_new(0,0); - - GetOpenFile(port, fptr); - result = read_all(fptr, remain_size(fptr), Qnil); - rb_io_close(port); - - return result; -} - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -/* - * call-seq: - * IO.select(read_array - * [, write_array - * [, error_array - * [, timeout]]] ) => array or nil - * - * See Kernel#select. - */ - -static VALUE -rb_f_select(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - VALUE read, write, except, timeout, res, list; - fd_set rset, wset, eset, pset; - fd_set *rp, *wp, *ep; - struct timeval *tp, timerec; - OpenFile *fptr; - long i; - int max = 0, n; - int interrupt_flag = 0; - int pending = 0; - - rb_scan_args(argc, argv, "13", &read, &write, &except, &timeout); - if (NIL_P(timeout)) { - tp = 0; - } - else { - timerec = rb_time_interval(timeout); - tp = &timerec; - } - - FD_ZERO(&pset); - if (!NIL_P(read)) { - Check_Type(read, T_ARRAY); - rp = &rset; - FD_ZERO(rp); - for (i=0; ilen; i++) { - GetOpenFile(rb_io_get_io(RARRAY(read)->ptr[i]), fptr); - FD_SET(fileno(fptr->f), rp); - if (READ_DATA_PENDING(fptr->f)) { /* check for buffered data */ - pending++; - FD_SET(fileno(fptr->f), &pset); - } - if (max < fileno(fptr->f)) max = fileno(fptr->f); - } - if (pending) { /* no blocking if there's buffered data */ - timerec.tv_sec = timerec.tv_usec = 0; - tp = &timerec; - } - } - else - rp = 0; - - if (!NIL_P(write)) { - Check_Type(write, T_ARRAY); - wp = &wset; - FD_ZERO(wp); - for (i=0; ilen; i++) { - GetOpenFile(rb_io_get_io(RARRAY(write)->ptr[i]), fptr); - FD_SET(fileno(fptr->f), wp); - if (max < fileno(fptr->f)) max = fileno(fptr->f); - if (fptr->f2) { - FD_SET(fileno(fptr->f2), wp); - if (max < fileno(fptr->f2)) max = fileno(fptr->f2); - } - } - } - else - wp = 0; - - if (!NIL_P(except)) { - Check_Type(except, T_ARRAY); - ep = &eset; - FD_ZERO(ep); - for (i=0; ilen; i++) { - GetOpenFile(rb_io_get_io(RARRAY(except)->ptr[i]), fptr); - FD_SET(fileno(fptr->f), ep); - if (max < fileno(fptr->f)) max = fileno(fptr->f); - if (fptr->f2) { - FD_SET(fileno(fptr->f2), ep); - if (max < fileno(fptr->f2)) max = fileno(fptr->f2); - } - } - } - else { - ep = 0; - } - - max++; - - n = rb_thread_select(max, rp, wp, ep, tp); - if (n < 0) { - rb_sys_fail(0); - } - if (!pending && n == 0) return Qnil; /* returns nil on timeout */ - - res = rb_ary_new2(3); - rb_ary_push(res, rp?rb_ary_new():rb_ary_new2(0)); - rb_ary_push(res, wp?rb_ary_new():rb_ary_new2(0)); - rb_ary_push(res, ep?rb_ary_new():rb_ary_new2(0)); - - if (interrupt_flag == 0) { - if (rp) { - list = RARRAY(res)->ptr[0]; - for (i=0; i< RARRAY(read)->len; i++) { - GetOpenFile(rb_io_get_io(RARRAY(read)->ptr[i]), fptr); - if (FD_ISSET(fileno(fptr->f), rp) - || FD_ISSET(fileno(fptr->f), &pset)) { - rb_ary_push(list, rb_ary_entry(read, i)); - } - } - } - - if (wp) { - list = RARRAY(res)->ptr[1]; - for (i=0; i< RARRAY(write)->len; i++) { - GetOpenFile(rb_io_get_io(RARRAY(write)->ptr[i]), fptr); - if (FD_ISSET(fileno(fptr->f), wp)) { - rb_ary_push(list, rb_ary_entry(write, i)); - } - else if (fptr->f2 && FD_ISSET(fileno(fptr->f2), wp)) { - rb_ary_push(list, rb_ary_entry(write, i)); - } - } - } - - if (ep) { - list = RARRAY(res)->ptr[2]; - for (i=0; i< RARRAY(except)->len; i++) { - GetOpenFile(rb_io_get_io(RARRAY(except)->ptr[i]), fptr); - if (FD_ISSET(fileno(fptr->f), ep)) { - rb_ary_push(list, rb_ary_entry(except, i)); - } - else if (fptr->f2 && FD_ISSET(fileno(fptr->f2), ep)) { - rb_ary_push(list, rb_ary_entry(except, i)); - } - } - } - } - - return res; /* returns an empty array on interrupt */ -} - -#if !defined(MSDOS) && !defined(__human68k__) -static int -io_cntl(fd, cmd, narg, io_p) - int fd, cmd, io_p; - long narg; -{ - int retval; - -#ifdef HAVE_FCNTL - TRAP_BEG; -# if defined(__CYGWIN__) - retval = io_p?ioctl(fd, cmd, (void*)narg):fcntl(fd, cmd, narg); -# else - retval = io_p?ioctl(fd, cmd, narg):fcntl(fd, cmd, narg); -# endif - TRAP_END; -#else - if (!io_p) { - rb_notimplement(); - } - TRAP_BEG; - retval = ioctl(fd, cmd, narg); - TRAP_END; -#endif - return retval; -} -#endif - -static VALUE -rb_io_ctl(io, req, arg, io_p) - VALUE io, req, arg; - int io_p; -{ -#if !defined(MSDOS) && !defined(__human68k__) - int cmd = NUM2ULONG(req); - OpenFile *fptr; - long len = 0; - long narg = 0; - int retval; - - rb_secure(2); - - if (NIL_P(arg) || arg == Qfalse) { - narg = 0; - } - else if (FIXNUM_P(arg)) { - narg = FIX2LONG(arg); - } - else if (arg == Qtrue) { - narg = 1; - } - else { - VALUE tmp = rb_check_string_type(arg); - - if (NIL_P(tmp)) { - narg = NUM2LONG(arg); - } - else { - arg = tmp; -#ifdef IOCPARM_MASK -#ifndef IOCPARM_LEN -#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) -#endif -#endif -#ifdef IOCPARM_LEN - len = IOCPARM_LEN(cmd); /* on BSDish systems we're safe */ -#else - len = 256; /* otherwise guess at what's safe */ -#endif - rb_str_modify(arg); - - if (len <= RSTRING(arg)->len) { - len = RSTRING(arg)->len; - } - if (RSTRING(arg)->len < len) { - rb_str_resize(arg, len+1); - } - RSTRING(arg)->ptr[len] = 17; /* a little sanity check here */ - narg = (long)RSTRING(arg)->ptr; - } - } - GetOpenFile(io, fptr); - retval = io_cntl(fileno(fptr->f), cmd, narg, io_p); - if (retval < 0) rb_sys_fail(fptr->path); - if (TYPE(arg) == T_STRING && RSTRING(arg)->ptr[len] != 17) { - rb_raise(rb_eArgError, "return value overflowed string"); - } - - if (fptr->f2 && fileno(fptr->f) != fileno(fptr->f2)) { - /* call on f2 too; ignore result */ - io_cntl(fileno(fptr->f2), cmd, narg, io_p); - } - - if (!io_p && cmd == F_SETFL) { - if (narg & O_NONBLOCK) { - fptr->mode |= FMODE_WSPLIT_INITIALIZED; - fptr->mode &= ~FMODE_WSPLIT; - } - else { - fptr->mode &= ~(FMODE_WSPLIT_INITIALIZED|FMODE_WSPLIT); - } - } - - return INT2NUM(retval); -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif -} - -/* - * call-seq: - * ios.ioctl(integer_cmd, arg) => integer - * - * Provides a mechanism for issuing low-level commands to control or - * query I/O devices. Arguments and results are platform dependent. If - * arg is a number, its value is passed directly. If it is a - * string, it is interpreted as a binary sequence of bytes. On Unix - * platforms, see ioctl(2) for details. Not implemented on - * all platforms. - */ - -static VALUE -rb_io_ioctl(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE req, arg; - - rb_scan_args(argc, argv, "11", &req, &arg); - return rb_io_ctl(io, req, arg, 1); -} - -/* - * call-seq: - * ios.fcntl(integer_cmd, arg) => integer - * - * Provides a mechanism for issuing low-level commands to control or - * query file-oriented I/O streams. Arguments and results are platform - * dependent. If arg is a number, its value is passed - * directly. If it is a string, it is interpreted as a binary sequence - * of bytes (Array#pack might be a useful way to build this - * string). On Unix platforms, see fcntl(2) for details. - * Not implemented on all platforms. - */ - -static VALUE -rb_io_fcntl(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ -#ifdef HAVE_FCNTL - VALUE req, arg; - - rb_scan_args(argc, argv, "11", &req, &arg); - return rb_io_ctl(io, req, arg, 0); -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif -} - -/* - * call-seq: - * syscall(fixnum [, args...]) => integer - * - * Calls the operating system function identified by _fixnum_, - * passing in the arguments, which must be either +String+ - * objects, or +Integer+ objects that ultimately fit within - * a native +long+. Up to nine parameters may be passed (14 - * on the Atari-ST). The function identified by _fixnum_ is system - * dependent. On some Unix systems, the numbers may be obtained from a - * header file called syscall.h. - * - * syscall 4, 1, "hello\n", 6 # '4' is write(2) on our box - * - * produces: - * - * hello - */ - -static VALUE -rb_f_syscall(argc, argv) - int argc; - VALUE *argv; -{ -#if defined(HAVE_SYSCALL) && !defined(__CHECKER__) -#ifdef atarist - unsigned long arg[14]; /* yes, we really need that many ! */ -#else - unsigned long arg[8]; -#endif - int retval = -1; - int i = 1; - int items = argc - 1; - - /* This probably won't work on machines where sizeof(long) != sizeof(int) - * or where sizeof(long) != sizeof(char*). But such machines will - * not likely have syscall implemented either, so who cares? - */ - - rb_secure(2); - if (argc == 0) - rb_raise(rb_eArgError, "too few arguments for syscall"); - if (argc > sizeof(arg) / sizeof(arg[0])) - rb_raise(rb_eArgError, "too many arguments for syscall"); - arg[0] = NUM2LONG(argv[0]); argv++; - while (items--) { - VALUE v = rb_check_string_type(*argv); - - if (!NIL_P(v)) { - StringValue(v); - rb_str_modify(v); - arg[i] = (unsigned long)StringValueCStr(v); - } - else { - arg[i] = (unsigned long)NUM2LONG(*argv); - } - argv++; - i++; - } - TRAP_BEG; - switch (argc) { - case 1: - retval = syscall(arg[0]); - break; - case 2: - retval = syscall(arg[0],arg[1]); - break; - case 3: - retval = syscall(arg[0],arg[1],arg[2]); - break; - case 4: - retval = syscall(arg[0],arg[1],arg[2],arg[3]); - break; - case 5: - retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4]); - break; - case 6: - retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5]); - break; - case 7: - retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]); - break; - case 8: - retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6], - arg[7]); - break; -#ifdef atarist - case 9: - retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6], - arg[7], arg[8]); - break; - case 10: - retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6], - arg[7], arg[8], arg[9]); - break; - case 11: - retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6], - arg[7], arg[8], arg[9], arg[10]); - break; - case 12: - retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6], - arg[7], arg[8], arg[9], arg[10], arg[11]); - break; - case 13: - retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6], - arg[7], arg[8], arg[9], arg[10], arg[11], arg[12]); - break; - case 14: - retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6], - arg[7], arg[8], arg[9], arg[10], arg[11], arg[12], arg[13]); - break; -#endif /* atarist */ - } - TRAP_END; - if (retval < 0) rb_sys_fail(0); - return INT2NUM(retval); -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif -} - -static VALUE io_new_instance _((VALUE)); -static VALUE -io_new_instance(args) - VALUE args; -{ - return rb_class_new_instance(2, (VALUE*)args+1, *(VALUE*)args); -} - -/* - * call-seq: - * IO.pipe -> array - * - * Creates a pair of pipe endpoints (connected to each other) and - * returns them as a two-element array of IO objects: - * [ read_file, write_file ]. Not - * available on all platforms. - * - * In the example below, the two processes close the ends of the pipe - * that they are not using. This is not just a cosmetic nicety. The - * read end of a pipe will not generate an end of file condition if - * there are any writers with the pipe still open. In the case of the - * parent process, the rd.read will never return if it - * does not first issue a wr.close. - * - * rd, wr = IO.pipe - * - * if fork - * wr.close - * puts "Parent got: <#{rd.read}>" - * rd.close - * Process.wait - * else - * rd.close - * puts "Sending message to parent" - * wr.write "Hi Dad" - * wr.close - * end - * - * produces: - * - * Sending message to parent - * Parent got: - */ - -static VALUE -rb_io_s_pipe(klass) - VALUE klass; -{ -#ifndef __human68k__ - int pipes[2], state; - VALUE r, w, args[3]; - -#ifdef _WIN32 - if (_pipe(pipes, 1024, O_BINARY) == -1) -#else - if (pipe(pipes) == -1) -#endif - rb_sys_fail(0); - - args[0] = klass; - args[1] = INT2NUM(pipes[0]); - args[2] = INT2FIX(O_RDONLY); - r = rb_protect(io_new_instance, (VALUE)args, &state); - if (state) { - close(pipes[0]); - close(pipes[1]); - rb_jump_tag(state); - } - args[1] = INT2NUM(pipes[1]); - args[2] = INT2FIX(O_WRONLY); - w = rb_protect(io_new_instance, (VALUE)args, &state); - if (state) { - close(pipes[1]); - if (!NIL_P(r)) rb_io_close(r); - rb_jump_tag(state); - } - rb_io_synchronized(RFILE(w)->fptr); - - return rb_assoc_new(r, w); -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif -} - -struct foreach_arg { - int argc; - VALUE sep; - VALUE io; -}; - -static VALUE -io_s_foreach(arg) - struct foreach_arg *arg; -{ - VALUE str; - - while (!NIL_P(str = rb_io_getline(arg->sep, arg->io))) { - rb_yield(str); - } - return Qnil; -} - -/* - * call-seq: - * IO.foreach(name, sep_string=$/) {|line| block } => nil - * - * Executes the block for every line in the named I/O port, where lines - * are separated by sep_string. - * - * IO.foreach("testfile") {|x| print "GOT ", x } - * - * produces: - * - * GOT This is line one - * GOT This is line two - * GOT This is line three - * GOT And so on... - */ - -static VALUE -rb_io_s_foreach(argc, argv) - int argc; - VALUE *argv; -{ - VALUE fname; - struct foreach_arg arg; - - rb_scan_args(argc, argv, "11", &fname, &arg.sep); - SafeStringValue(fname); - - if (argc == 1) { - arg.sep = rb_default_rs; - } - else if (!NIL_P(arg.sep)) { - StringValue(arg.sep); - } - arg.io = rb_io_open(StringValueCStr(fname), "r"); - if (NIL_P(arg.io)) return Qnil; - - return rb_ensure(io_s_foreach, (VALUE)&arg, rb_io_close, arg.io); -} - -static VALUE -io_s_readlines(arg) - struct foreach_arg *arg; -{ - return rb_io_readlines(arg->argc, &arg->sep, arg->io); -} - -/* - * call-seq: - * IO.readlines(name, sep_string=$/) => array - * - * Reads the entire file specified by name as individual - * lines, and returns those lines in an array. Lines are separated by - * sep_string. - * - * a = IO.readlines("testfile") - * a[0] #=> "This is line one\n" - * - */ - -static VALUE -rb_io_s_readlines(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE fname; - struct foreach_arg arg; - - rb_scan_args(argc, argv, "11", &fname, &arg.sep); - SafeStringValue(fname); - - arg.argc = argc - 1; - arg.io = rb_io_open(StringValueCStr(fname), "r"); - if (NIL_P(arg.io)) return Qnil; - return rb_ensure(io_s_readlines, (VALUE)&arg, rb_io_close, arg.io); -} - -static VALUE -io_s_read(arg) - struct foreach_arg *arg; -{ - return io_read(arg->argc, &arg->sep, arg->io); -} - -/* - * call-seq: - * IO.read(name, [length [, offset]] ) => string - * - * Opens the file, optionally seeks to the given offset, then returns - * length bytes (defaulting to the rest of the file). - * read ensures the file is closed before returning. - * - * IO.read("testfile") #=> "This is line one\nThis is line two\nThis is line three\nAnd so on...\n" - * IO.read("testfile", 20) #=> "This is line one\nThi" - * IO.read("testfile", 20, 10) #=> "ne one\nThis is line " - */ - -static VALUE -rb_io_s_read(argc, argv, io) - int argc; - VALUE *argv; - VALUE io; -{ - VALUE fname, offset; - struct foreach_arg arg; - - rb_scan_args(argc, argv, "12", &fname, &arg.sep, &offset); - SafeStringValue(fname); - - arg.argc = argc ? 1 : 0; - arg.io = rb_io_open(StringValueCStr(fname), "r"); - if (NIL_P(arg.io)) return Qnil; - if (!NIL_P(offset)) { - rb_io_seek(arg.io, offset, SEEK_SET); - } - return rb_ensure(io_s_read, (VALUE)&arg, rb_io_close, arg.io); -} - -static VALUE -argf_tell() -{ - if (!next_argv()) { - rb_raise(rb_eArgError, "no stream to tell"); - } - ARGF_FORWARD(0, 0); - return rb_io_tell(current_file); -} - -static VALUE -argf_seek_m(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; -{ - if (!next_argv()) { - rb_raise(rb_eArgError, "no stream to seek"); - } - ARGF_FORWARD(argc, argv); - return rb_io_seek_m(argc, argv, current_file); -} - -static VALUE -argf_set_pos(self, offset) - VALUE self, offset; -{ - if (!next_argv()) { - rb_raise(rb_eArgError, "no stream to set position"); - } - ARGF_FORWARD(1, &offset); - return rb_io_set_pos(current_file, offset); -} - -static VALUE -argf_rewind() -{ - if (!next_argv()) { - rb_raise(rb_eArgError, "no stream to rewind"); - } - ARGF_FORWARD(0, 0); - return rb_io_rewind(current_file); -} - -static VALUE -argf_fileno() -{ - if (!next_argv()) { - rb_raise(rb_eArgError, "no stream"); - } - ARGF_FORWARD(0, 0); - return rb_io_fileno(current_file); -} - -static VALUE -argf_to_io() -{ - next_argv(); - ARGF_FORWARD(0, 0); - return current_file; -} - -static VALUE -argf_eof() -{ - if (current_file) { - if (init_p == 0) return Qtrue; - ARGF_FORWARD(0, 0); - if (rb_io_eof(current_file)) { - return Qtrue; - } - } - return Qfalse; -} - -static VALUE -argf_read(argc, argv) - int argc; - VALUE *argv; -{ - VALUE tmp, str, length; - long len = 0; - - rb_scan_args(argc, argv, "02", &length, &str); - if (!NIL_P(length)) { - len = NUM2LONG(argv[0]); - } - if (!NIL_P(str)) { - StringValue(str); - rb_str_resize(str,0); - argv[1] = Qnil; - } - - retry: - if (!next_argv()) { - return str; - } - if (TYPE(current_file) != T_FILE) { - tmp = argf_forward(argc, argv); - } - else { - tmp = io_read(argc, argv, current_file); - } - if (NIL_P(str)) str = tmp; - else if (!NIL_P(tmp)) rb_str_append(str, tmp); - if (NIL_P(tmp) || NIL_P(length)) { - if (next_p != -1) { - argf_close(current_file); - next_p = 1; - goto retry; - } - } - else if (argc >= 1) { - if (RSTRING(str)->len < len) { - len -= RSTRING(str)->len; - argv[0] = INT2NUM(len); - goto retry; - } - } - return str; -} - -static VALUE -argf_getc() -{ - VALUE byte; - - retry: - if (!next_argv()) return Qnil; - if (TYPE(current_file) != T_FILE) { - byte = rb_funcall3(current_file, rb_intern("getc"), 0, 0); - } - else { - byte = rb_io_getc(current_file); - } - if (NIL_P(byte) && next_p != -1) { - argf_close(current_file); - next_p = 1; - goto retry; - } - - return byte; -} - -static VALUE -argf_readchar() -{ - VALUE c; - - NEXT_ARGF_FORWARD(0, 0); - c = argf_getc(); - if (NIL_P(c)) { - rb_eof_error(); - } - return c; -} - -static VALUE -argf_each_line(argc, argv) - int argc; - VALUE *argv; -{ - VALUE str; - - if (!next_argv()) return Qnil; - if (TYPE(current_file) != T_FILE) { - for (;;) { - if (!next_argv()) return argf; - rb_iterate(rb_each, current_file, rb_yield, 0); - next_p = 1; - } - } - while (!NIL_P(str = argf_getline(argc, argv))) { - rb_yield(str); - } - return argf; -} - -static VALUE -argf_each_byte() -{ - VALUE byte; - - while (!NIL_P(byte = argf_getc())) { - rb_yield(byte); - } - return argf; -} - -static VALUE -argf_filename() -{ - next_argv(); - return filename; -} - -static VALUE -argf_file() -{ - next_argv(); - return current_file; -} - -static VALUE -argf_binmode() -{ - binmode = 1; - next_argv(); - ARGF_FORWARD(0, 0); - rb_io_binmode(current_file); - return argf; -} - -static VALUE -argf_skip() -{ - if (next_p != -1) { - argf_close(current_file); - next_p = 1; - } - return argf; -} - -static VALUE -argf_close_m() -{ - next_argv(); - argf_close(current_file); - if (next_p != -1) { - next_p = 1; - } - gets_lineno = 0; - return argf; -} - -static VALUE -argf_closed() -{ - next_argv(); - ARGF_FORWARD(0, 0); - return rb_io_closed(current_file); -} - -static VALUE -argf_to_s() -{ - return rb_str_new2("ARGF"); -} - -static VALUE -opt_i_get() -{ - if (!ruby_inplace_mode) return Qnil; - return rb_str_new2(ruby_inplace_mode); -} - -static void -opt_i_set(val) - VALUE val; -{ - if (!RTEST(val)) { - if (ruby_inplace_mode) free(ruby_inplace_mode); - ruby_inplace_mode = 0; - return; - } - StringValue(val); - if (ruby_inplace_mode) free(ruby_inplace_mode); - ruby_inplace_mode = 0; - ruby_inplace_mode = strdup(StringValueCStr(val)); -} - -/* - * Class IO is the basis for all input and output in Ruby. - * An I/O stream may be duplexed (that is, bidirectional), and - * so may use more than one native operating system stream. - * - * Many of the examples in this section use class File, - * the only standard subclass of IO. The two classes are - * closely associated. - * - * As used in this section, portname may take any of the - * following forms. - * - * * A plain string represents a filename suitable for the underlying - * operating system. - * - * * A string starting with ``|'' indicates a subprocess. - * The remainder of the string following the ``|'' is - * invoked as a process with appropriate input/output channels - * connected to it. - * - * * A string equal to ``|-'' will create another Ruby - * instance as a subprocess. - * - * Ruby will convert pathnames between different operating system - * conventions if possible. For instance, on a Windows system the - * filename ``/gumby/ruby/test.rb'' will be opened as - * ``\gumby\ruby\test.rb''. When specifying a - * Windows-style filename in a Ruby string, remember to escape the - * backslashes: - * - * "c:\\gumby\\ruby\\test.rb" - * - * Our examples here will use the Unix-style forward slashes; - * File::SEPARATOR can be used to get the - * platform-specific separator character. - * - * I/O ports may be opened in any one of several different modes, which - * are shown in this section as mode. The mode may - * either be a Fixnum or a String. If numeric, it should be - * one of the operating system specific constants (O_RDONLY, - * O_WRONLY, O_RDWR, O_APPEND and so on). See man open(2) for - * more information. - * - * If the mode is given as a String, it must be one of the - * values listed in the following table. - * - * Mode | Meaning - * -----+-------------------------------------------------------- - * "r" | Read-only, starts at beginning of file (default mode). - * -----+-------------------------------------------------------- - * "r+" | Read-write, starts at beginning of file. - * -----+-------------------------------------------------------- - * "w" | Write-only, truncates existing file - * | to zero length or creates a new file for writing. - * -----+-------------------------------------------------------- - * "w+" | Read-write, truncates existing file to zero length - * | or creates a new file for reading and writing. - * -----+-------------------------------------------------------- - * "a" | Write-only, starts at end of file if file exists, - * | otherwise creates a new file for writing. - * -----+-------------------------------------------------------- - * "a+" | Read-write, starts at end of file if file exists, - * | otherwise creates a new file for reading and - * | writing. - * -----+-------------------------------------------------------- - * "b" | (DOS/Windows only) Binary file mode (may appear with - * | any of the key letters listed above). - * - * - * The global constant ARGF (also accessible as $<) provides an - * IO-like stream which allows access to all files mentioned on the - * command line (or STDIN if no files are mentioned). ARGF provides - * the methods #path and #filename to access - * the name of the file currently being read. - */ - -void -Init_IO() -{ -#ifdef __CYGWIN__ -#include - static struct __cygwin_perfile pf[] = - { - {"", O_RDONLY | O_BINARY}, - {"", O_WRONLY | O_BINARY}, - {"", O_RDWR | O_BINARY}, - {"", O_APPEND | O_BINARY}, - {NULL, 0} - }; - cygwin_internal(CW_PERFILE, pf); -#endif - - rb_eIOError = rb_define_class("IOError", rb_eStandardError); - rb_eEOFError = rb_define_class("EOFError", rb_eIOError); - - id_write = rb_intern("write"); - id_read = rb_intern("read"); - id_getc = rb_intern("getc"); - - rb_define_global_function("syscall", rb_f_syscall, -1); - - rb_define_global_function("open", rb_f_open, -1); - rb_define_global_function("printf", rb_f_printf, -1); - rb_define_global_function("print", rb_f_print, -1); - rb_define_global_function("putc", rb_f_putc, 1); - rb_define_global_function("puts", rb_f_puts, -1); - rb_define_global_function("gets", rb_f_gets, -1); - rb_define_global_function("readline", rb_f_readline, -1); - rb_define_global_function("getc", rb_f_getc, 0); - rb_define_global_function("select", rb_f_select, -1); - - rb_define_global_function("readlines", rb_f_readlines, -1); - - rb_define_global_function("`", rb_f_backquote, 1); - - rb_define_global_function("p", rb_f_p, -1); - rb_define_method(rb_mKernel, "display", rb_obj_display, -1); - - rb_cIO = rb_define_class("IO", rb_cObject); - rb_include_module(rb_cIO, rb_mEnumerable); - - rb_define_alloc_func(rb_cIO, io_alloc); - rb_define_singleton_method(rb_cIO, "new", rb_io_s_new, -1); - rb_define_singleton_method(rb_cIO, "open", rb_io_s_open, -1); - rb_define_singleton_method(rb_cIO, "sysopen", rb_io_s_sysopen, -1); - rb_define_singleton_method(rb_cIO, "for_fd", rb_io_s_for_fd, -1); - rb_define_singleton_method(rb_cIO, "popen", rb_io_s_popen, -1); - rb_define_singleton_method(rb_cIO, "foreach", rb_io_s_foreach, -1); - rb_define_singleton_method(rb_cIO, "readlines", rb_io_s_readlines, -1); - rb_define_singleton_method(rb_cIO, "read", rb_io_s_read, -1); - rb_define_singleton_method(rb_cIO, "select", rb_f_select, -1); - rb_define_singleton_method(rb_cIO, "pipe", rb_io_s_pipe, 0); - - rb_define_method(rb_cIO, "initialize", rb_io_initialize, -1); - - rb_output_fs = Qnil; - rb_define_hooked_variable("$,", &rb_output_fs, 0, rb_str_setter); - - rb_global_variable(&rb_default_rs); - rb_rs = rb_default_rs = rb_str_new2("\n"); - rb_output_rs = Qnil; - OBJ_FREEZE(rb_default_rs); /* avoid modifying RS_default */ - rb_define_hooked_variable("$/", &rb_rs, 0, rb_str_setter); - rb_define_hooked_variable("$-0", &rb_rs, 0, rb_str_setter); - rb_define_hooked_variable("$\\", &rb_output_rs, 0, rb_str_setter); - - rb_define_hooked_variable("$.", &lineno, 0, lineno_setter); - rb_define_virtual_variable("$_", rb_lastline_get, rb_lastline_set); - - rb_define_method(rb_cIO, "initialize_copy", rb_io_init_copy, 1); - rb_define_method(rb_cIO, "reopen", rb_io_reopen, -1); - - rb_define_method(rb_cIO, "print", rb_io_print, -1); - rb_define_method(rb_cIO, "putc", rb_io_putc, 1); - rb_define_method(rb_cIO, "puts", rb_io_puts, -1); - rb_define_method(rb_cIO, "printf", rb_io_printf, -1); - - rb_define_method(rb_cIO, "each", rb_io_each_line, -1); - rb_define_method(rb_cIO, "each_line", rb_io_each_line, -1); - rb_define_method(rb_cIO, "each_byte", rb_io_each_byte, 0); - - rb_define_method(rb_cIO, "syswrite", rb_io_syswrite, 1); - rb_define_method(rb_cIO, "sysread", rb_io_sysread, -1); - - rb_define_method(rb_cIO, "fileno", rb_io_fileno, 0); - rb_define_alias(rb_cIO, "to_i", "fileno"); - rb_define_method(rb_cIO, "to_io", rb_io_to_io, 0); - - rb_define_method(rb_cIO, "fsync", rb_io_fsync, 0); - rb_define_method(rb_cIO, "sync", rb_io_sync, 0); - rb_define_method(rb_cIO, "sync=", rb_io_set_sync, 1); - - rb_define_method(rb_cIO, "lineno", rb_io_lineno, 0); - rb_define_method(rb_cIO, "lineno=", rb_io_set_lineno, 1); - - rb_define_method(rb_cIO, "readlines", rb_io_readlines, -1); - - rb_define_method(rb_cIO, "read_nonblock", io_read_nonblock, -1); - rb_define_method(rb_cIO, "write_nonblock", rb_io_write_nonblock, 1); - rb_define_method(rb_cIO, "readpartial", io_readpartial, -1); - rb_define_method(rb_cIO, "read", io_read, -1); - rb_define_method(rb_cIO, "write", io_write, 1); - rb_define_method(rb_cIO, "gets", rb_io_gets_m, -1); - rb_define_method(rb_cIO, "readline", rb_io_readline, -1); - rb_define_method(rb_cIO, "getc", rb_io_getc, 0); - rb_define_method(rb_cIO, "readchar", rb_io_readchar, 0); - rb_define_method(rb_cIO, "ungetc",rb_io_ungetc, 1); - rb_define_method(rb_cIO, "<<", rb_io_addstr, 1); - rb_define_method(rb_cIO, "flush", rb_io_flush, 0); - rb_define_method(rb_cIO, "tell", rb_io_tell, 0); - rb_define_method(rb_cIO, "seek", rb_io_seek_m, -1); - rb_define_const(rb_cIO, "SEEK_SET", INT2FIX(SEEK_SET)); - rb_define_const(rb_cIO, "SEEK_CUR", INT2FIX(SEEK_CUR)); - rb_define_const(rb_cIO, "SEEK_END", INT2FIX(SEEK_END)); - rb_define_method(rb_cIO, "rewind", rb_io_rewind, 0); - rb_define_method(rb_cIO, "pos", rb_io_tell, 0); - rb_define_method(rb_cIO, "pos=", rb_io_set_pos, 1); - rb_define_method(rb_cIO, "eof", rb_io_eof, 0); - rb_define_method(rb_cIO, "eof?", rb_io_eof, 0); - - rb_define_method(rb_cIO, "close", rb_io_close_m, 0); - rb_define_method(rb_cIO, "closed?", rb_io_closed, 0); - rb_define_method(rb_cIO, "close_read", rb_io_close_read, 0); - rb_define_method(rb_cIO, "close_write", rb_io_close_write, 0); - - rb_define_method(rb_cIO, "isatty", rb_io_isatty, 0); - rb_define_method(rb_cIO, "tty?", rb_io_isatty, 0); - rb_define_method(rb_cIO, "binmode", rb_io_binmode, 0); - rb_define_method(rb_cIO, "sysseek", rb_io_sysseek, -1); - - rb_define_method(rb_cIO, "ioctl", rb_io_ioctl, -1); - rb_define_method(rb_cIO, "fcntl", rb_io_fcntl, -1); - rb_define_method(rb_cIO, "pid", rb_io_pid, 0); - rb_define_method(rb_cIO, "inspect", rb_io_inspect, 0); - - rb_define_variable("$stdin", &rb_stdin); - rb_stdin = prep_stdio(stdin, FMODE_READABLE, rb_cIO); - rb_define_hooked_variable("$stdout", &rb_stdout, 0, stdout_setter); - rb_stdout = prep_stdio(stdout, FMODE_WRITABLE, rb_cIO); - rb_define_hooked_variable("$stderr", &rb_stderr, 0, stdout_setter); - rb_stderr = prep_stdio(stderr, FMODE_WRITABLE, rb_cIO); - rb_define_hooked_variable("$>", &rb_stdout, 0, stdout_setter); - orig_stdout = rb_stdout; - rb_deferr = orig_stderr = rb_stderr; - - /* variables to be removed in 1.8.1 */ - rb_define_hooked_variable("$defout", &rb_stdout, 0, defout_setter); - rb_define_hooked_variable("$deferr", &rb_stderr, 0, deferr_setter); - - /* constants to hold original stdin/stdout/stderr */ - rb_define_global_const("STDIN", rb_stdin); - rb_define_global_const("STDOUT", rb_stdout); - rb_define_global_const("STDERR", rb_stderr); - - rb_define_readonly_variable("$<", &argf); - argf = rb_obj_alloc(rb_cObject); - rb_extend_object(argf, rb_mEnumerable); - rb_define_global_const("ARGF", argf); - - rb_define_singleton_method(argf, "to_s", argf_to_s, 0); - - rb_define_singleton_method(argf, "fileno", argf_fileno, 0); - rb_define_singleton_method(argf, "to_i", argf_fileno, 0); - rb_define_singleton_method(argf, "to_io", argf_to_io, 0); - rb_define_singleton_method(argf, "each", argf_each_line, -1); - rb_define_singleton_method(argf, "each_line", argf_each_line, -1); - rb_define_singleton_method(argf, "each_byte", argf_each_byte, 0); - - rb_define_singleton_method(argf, "read", argf_read, -1); - rb_define_singleton_method(argf, "readlines", rb_f_readlines, -1); - rb_define_singleton_method(argf, "to_a", rb_f_readlines, -1); - rb_define_singleton_method(argf, "gets", rb_f_gets, -1); - rb_define_singleton_method(argf, "readline", rb_f_readline, -1); - rb_define_singleton_method(argf, "getc", argf_getc, 0); - rb_define_singleton_method(argf, "readchar", argf_readchar, 0); - rb_define_singleton_method(argf, "tell", argf_tell, 0); - rb_define_singleton_method(argf, "seek", argf_seek_m, -1); - rb_define_singleton_method(argf, "rewind", argf_rewind, 0); - rb_define_singleton_method(argf, "pos", argf_tell, 0); - rb_define_singleton_method(argf, "pos=", argf_set_pos, 1); - rb_define_singleton_method(argf, "eof", argf_eof, 0); - rb_define_singleton_method(argf, "eof?", argf_eof, 0); - rb_define_singleton_method(argf, "binmode", argf_binmode, 0); - - rb_define_singleton_method(argf, "filename", argf_filename, 0); - rb_define_singleton_method(argf, "path", argf_filename, 0); - rb_define_singleton_method(argf, "file", argf_file, 0); - rb_define_singleton_method(argf, "skip", argf_skip, 0); - rb_define_singleton_method(argf, "close", argf_close_m, 0); - rb_define_singleton_method(argf, "closed?", argf_closed, 0); - - rb_define_singleton_method(argf, "lineno", argf_lineno, 0); - rb_define_singleton_method(argf, "lineno=", argf_set_lineno, 1); - - rb_global_variable(¤t_file); - rb_define_readonly_variable("$FILENAME", &filename); - filename = rb_str_new2("-"); - - rb_define_virtual_variable("$-i", opt_i_get, opt_i_set); - -#if defined (_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) - atexit(pipe_atexit); -#endif - - Init_File(); - - rb_define_method(rb_cFile, "initialize", rb_file_initialize, -1); - - rb_file_const("RDONLY", INT2FIX(O_RDONLY)); - rb_file_const("WRONLY", INT2FIX(O_WRONLY)); - rb_file_const("RDWR", INT2FIX(O_RDWR)); - rb_file_const("APPEND", INT2FIX(O_APPEND)); - rb_file_const("CREAT", INT2FIX(O_CREAT)); - rb_file_const("EXCL", INT2FIX(O_EXCL)); -#if defined(O_NDELAY) || defined(O_NONBLOCK) -# ifdef O_NONBLOCK - rb_file_const("NONBLOCK", INT2FIX(O_NONBLOCK)); -# else - rb_file_const("NONBLOCK", INT2FIX(O_NDELAY)); -# endif -#endif - rb_file_const("TRUNC", INT2FIX(O_TRUNC)); -#ifdef O_NOCTTY - rb_file_const("NOCTTY", INT2FIX(O_NOCTTY)); -#endif -#ifdef O_BINARY - rb_file_const("BINARY", INT2FIX(O_BINARY)); -#endif -#ifdef O_SYNC - rb_file_const("SYNC", INT2FIX(O_SYNC)); -#endif -} -/* C code produced by gperf version 2.7.2 */ -/* Command-line: gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' ./keywords */ -struct kwtable {char *name; int id[2]; enum lex_state state;}; - -#define TOTAL_KEYWORDS 40 -#define MIN_WORD_LENGTH 2 -#define MAX_WORD_LENGTH 8 -#define MIN_HASH_VALUE 6 -#define MAX_HASH_VALUE 55 -/* maximum key range = 50, duplicates = 0 */ - -#ifdef __GNUC__ -__inline -#else -#ifdef __cplusplus -inline -#endif -#endif -static unsigned int -hash (str, len) - register const char *str; - register unsigned int len; -{ - static unsigned char asso_values[] = - { - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 11, 56, 56, 36, 56, 1, 37, - 31, 1, 56, 56, 56, 56, 29, 56, 1, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 1, 56, 32, 1, 2, - 1, 1, 4, 23, 56, 17, 56, 20, 9, 2, - 9, 26, 14, 56, 5, 1, 1, 16, 56, 21, - 20, 9, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56 - }; - register int hval = len; - - switch (hval) - { - default: - case 3: - hval += asso_values[(unsigned char)str[2]]; - case 2: - case 1: - hval += asso_values[(unsigned char)str[0]]; - break; - } - return hval + asso_values[(unsigned char)str[len - 1]]; -} - -#ifdef __GNUC__ -__inline -#endif -struct kwtable * -rb_reserved_word (str, len) - register const char *str; - register unsigned int len; -{ - static struct kwtable wordlist[] = - { - {""}, {""}, {""}, {""}, {""}, {""}, - {"end", {kEND, kEND}, EXPR_END}, - {"else", {kELSE, kELSE}, EXPR_BEG}, - {"case", {kCASE, kCASE}, EXPR_BEG}, - {"ensure", {kENSURE, kENSURE}, EXPR_BEG}, - {"module", {kMODULE, kMODULE}, EXPR_BEG}, - {"elsif", {kELSIF, kELSIF}, EXPR_BEG}, - {"def", {kDEF, kDEF}, EXPR_FNAME}, - {"rescue", {kRESCUE, kRESCUE_MOD}, EXPR_MID}, - {"not", {kNOT, kNOT}, EXPR_BEG}, - {"then", {kTHEN, kTHEN}, EXPR_BEG}, - {"yield", {kYIELD, kYIELD}, EXPR_ARG}, - {"for", {kFOR, kFOR}, EXPR_BEG}, - {"self", {kSELF, kSELF}, EXPR_END}, - {"false", {kFALSE, kFALSE}, EXPR_END}, - {"retry", {kRETRY, kRETRY}, EXPR_END}, - {"return", {kRETURN, kRETURN}, EXPR_MID}, - {"true", {kTRUE, kTRUE}, EXPR_END}, - {"if", {kIF, kIF_MOD}, EXPR_BEG}, - {"defined?", {kDEFINED, kDEFINED}, EXPR_ARG}, - {"super", {kSUPER, kSUPER}, EXPR_ARG}, - {"undef", {kUNDEF, kUNDEF}, EXPR_FNAME}, - {"break", {kBREAK, kBREAK}, EXPR_MID}, - {"in", {kIN, kIN}, EXPR_BEG}, - {"do", {kDO, kDO}, EXPR_BEG}, - {"nil", {kNIL, kNIL}, EXPR_END}, - {"until", {kUNTIL, kUNTIL_MOD}, EXPR_BEG}, - {"unless", {kUNLESS, kUNLESS_MOD}, EXPR_BEG}, - {"or", {kOR, kOR}, EXPR_BEG}, - {"next", {kNEXT, kNEXT}, EXPR_MID}, - {"when", {kWHEN, kWHEN}, EXPR_BEG}, - {"redo", {kREDO, kREDO}, EXPR_END}, - {"and", {kAND, kAND}, EXPR_BEG}, - {"begin", {kBEGIN, kBEGIN}, EXPR_BEG}, - {"__LINE__", {k__LINE__, k__LINE__}, EXPR_END}, - {"class", {kCLASS, kCLASS}, EXPR_CLASS}, - {"__FILE__", {k__FILE__, k__FILE__}, EXPR_END}, - {"END", {klEND, klEND}, EXPR_END}, - {"BEGIN", {klBEGIN, klBEGIN}, EXPR_END}, - {"while", {kWHILE, kWHILE_MOD}, EXPR_BEG}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"alias", {kALIAS, kALIAS}, EXPR_FNAME} - }; - - if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) - { - register int key = hash (str, len); - - if (key <= MAX_HASH_VALUE && key >= 0) - { - register const char *s = wordlist[key].name; - - if (*str == *s && !strcmp (str + 1, s + 1)) - return &wordlist[key]; - } - } - return 0; -} -/********************************************************************** - - main.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007) $ - created at: Fri Aug 19 13:19:58 JST 1994 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" - -#ifdef __human68k__ -int _stacksize = 262144; -#endif - -#if defined __MINGW32__ -int _CRT_glob = 0; -#endif - -#if defined(__MACOS__) && defined(__MWERKS__) -#include -#endif - -/* to link startup code with ObjC support */ -#if (defined(__APPLE__) || defined(__NeXT__)) && defined(__MACH__) -static void objcdummyfunction( void ) { objc_msgSend(); } -#endif - -int -main(argc, argv, envp) - int argc; - char **argv, **envp; -{ -#ifdef _WIN32 - NtInitialize(&argc, &argv); -#endif -#if defined(__MACOS__) && defined(__MWERKS__) - argc = ccommand(&argv); -#endif - - { - RUBY_INIT_STACK - ruby_init(); - ruby_options(argc, argv); - ruby_run(); - } - return 0; -} -/********************************************************************** - - marshal.c - - - $Author: shyouhei $ - $Date: 2009-01-28 12:59:58 +0100 (Wed, 28 Jan 2009) $ - created at: Thu Apr 27 16:30:01 JST 1995 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include "rubyio.h" -#include "st.h" -#include "util.h" - -#include -#ifdef HAVE_FLOAT_H -#include -#endif -#ifdef HAVE_IEEEFP_H -#include -#endif - -#define BITSPERSHORT (2*CHAR_BIT) -#define SHORTMASK ((1<wrapper)) { - rb_raise(rb_eRuntimeError, "Marshal.dump reentered at %s", - rb_id2name(sym)); - } -} - -static void -mark_dump_arg(ptr) - void *ptr; -{ - struct dump_arg *p = ptr; - if (!ptr) - return; - rb_mark_set(p->data); -} - -static VALUE -class2path(klass) - VALUE klass; -{ - VALUE path = rb_class_path(klass); - char *n = RSTRING(path)->ptr; - - if (n[0] == '#') { - rb_raise(rb_eTypeError, "can't dump anonymous %s %s", - (TYPE(klass) == T_CLASS ? "class" : "module"), - n); - } - if (rb_path2class(n) != rb_class_real(klass)) { - rb_raise(rb_eTypeError, "%s can't be referred", n); - } - return path; -} - -static void w_long _((long, struct dump_arg*)); - -static void -w_nbyte(s, n, arg) - char *s; - int n; - struct dump_arg *arg; -{ - VALUE buf = arg->str; - rb_str_buf_cat(buf, s, n); - if (arg->dest && RSTRING(buf)->len >= BUFSIZ) { - if (arg->taint) OBJ_TAINT(buf); - rb_io_write(arg->dest, buf); - rb_str_resize(buf, 0); - } -} - -static void -w_byte(c, arg) - char c; - struct dump_arg *arg; -{ - w_nbyte(&c, 1, arg); -} - -static void -w_bytes(s, n, arg) - char *s; - int n; - struct dump_arg *arg; -{ - w_long(n, arg); - w_nbyte(s, n, arg); -} - -static void -w_short(x, arg) - int x; - struct dump_arg *arg; -{ - w_byte((x >> 0) & 0xff, arg); - w_byte((x >> 8) & 0xff, arg); -} - -static void -w_long(x, arg) - long x; - struct dump_arg *arg; -{ - char buf[sizeof(long)+1]; - int i, len = 0; - -#if SIZEOF_LONG > 4 - if (!(RSHIFT(x, 31) == 0 || RSHIFT(x, 31) == -1)) { - /* big long does not fit in 4 bytes */ - rb_raise(rb_eTypeError, "long too big to dump"); - } -#endif - - if (x == 0) { - w_byte(0, arg); - return; - } - if (0 < x && x < 123) { - w_byte(x + 5, arg); - return; - } - if (-124 < x && x < 0) { - w_byte((x - 5)&0xff, arg); - return; - } - for (i=1;i 32 -#define MANT_BITS 32 -#elif DBL_MANT_DIG > 24 -#define MANT_BITS 24 -#elif DBL_MANT_DIG > 16 -#define MANT_BITS 16 -#else -#define MANT_BITS 8 -#endif - -static int -save_mantissa(d, buf) - double d; - char *buf; -{ - int e, i = 0; - unsigned long m; - double n; - - d = modf(ldexp(frexp(fabs(d), &e), DECIMAL_MANT), &d); - if (d > 0) { - buf[i++] = 0; - do { - d = modf(ldexp(d, MANT_BITS), &n); - m = (unsigned long)n; -#if MANT_BITS > 24 - buf[i++] = m >> 24; -#endif -#if MANT_BITS > 16 - buf[i++] = m >> 16; -#endif -#if MANT_BITS > 8 - buf[i++] = m >> 8; -#endif - buf[i++] = m; - } while (d > 0); - while (!buf[i - 1]) --i; - } - return i; -} - -static double -load_mantissa(d, buf, len) - double d; - const char *buf; - int len; -{ - if (--len > 0 && !*buf++) { /* binary mantissa mark */ - int e, s = d < 0, dig = 0; - unsigned long m; - - modf(ldexp(frexp(fabs(d), &e), DECIMAL_MANT), &d); - do { - m = 0; - switch (len) { - default: m = *buf++ & 0xff; -#if MANT_BITS > 24 - case 3: m = (m << 8) | (*buf++ & 0xff); -#endif -#if MANT_BITS > 16 - case 2: m = (m << 8) | (*buf++ & 0xff); -#endif -#if MANT_BITS > 8 - case 1: m = (m << 8) | (*buf++ & 0xff); -#endif - } - dig -= len < MANT_BITS / 8 ? 8 * (unsigned)len : MANT_BITS; - d += ldexp((double)m, dig); - } while ((len -= MANT_BITS / 8) > 0); - d = ldexp(d, e - DECIMAL_MANT); - if (s) d = -d; - } - return d; -} -#else -#define load_mantissa(d, buf, len) (d) -#define save_mantissa(d, buf) 0 -#endif - -#ifdef DBL_DIG -#define FLOAT_DIG (DBL_DIG+2) -#else -#define FLOAT_DIG 17 -#endif - -static void -w_float(d, arg) - double d; - struct dump_arg *arg; -{ - char buf[100]; - - if (isinf(d)) { - if (d < 0) strcpy(buf, "-inf"); - else strcpy(buf, "inf"); - } - else if (isnan(d)) { - strcpy(buf, "nan"); - } - else if (d == 0.0) { - if (1.0/d < 0) strcpy(buf, "-0"); - else strcpy(buf, "0"); - } - else { - int len; - - /* xxx: should not use system's sprintf(3) */ - sprintf(buf, "%.*g", FLOAT_DIG, d); - len = strlen(buf); - w_bytes(buf, len + save_mantissa(d, buf + len), arg); - return; - } - w_bytes(buf, strlen(buf), arg); -} - -static void -w_symbol(id, arg) - ID id; - struct dump_arg *arg; -{ - char *sym = rb_id2name(id); - st_data_t num; - - if (st_lookup(arg->symbols, id, &num)) { - w_byte(TYPE_SYMLINK, arg); - w_long((long)num, arg); - } - else { - w_byte(TYPE_SYMBOL, arg); - w_bytes(sym, strlen(sym), arg); - st_add_direct(arg->symbols, id, arg->symbols->num_entries); - } -} - -static void -w_unique(s, arg) - char *s; - struct dump_arg *arg; -{ - if (s[0] == '#') { - rb_raise(rb_eTypeError, "can't dump anonymous class %s", s); - } - w_symbol(rb_intern(s), arg); -} - -static void w_object _((VALUE,struct dump_arg*,int)); - -static int -hash_each(key, value, arg) - VALUE key, value; - struct dump_call_arg *arg; -{ - w_object(key, arg->arg, arg->limit); - w_object(value, arg->arg, arg->limit); - return ST_CONTINUE; -} - -static void -w_extended(klass, arg, check) - VALUE klass; - struct dump_arg *arg; - int check; -{ - char *path; - - if (check && FL_TEST(klass, FL_SINGLETON)) { - if (RCLASS(klass)->m_tbl->num_entries || - (RCLASS(klass)->iv_tbl && RCLASS(klass)->iv_tbl->num_entries > 1)) { - rb_raise(rb_eTypeError, "singleton can't be dumped"); - } - klass = RCLASS(klass)->super; - } - while (BUILTIN_TYPE(klass) == T_ICLASS) { - path = rb_class2name(RBASIC(klass)->klass); - w_byte(TYPE_EXTENDED, arg); - w_unique(path, arg); - klass = RCLASS(klass)->super; - } -} - -static void -w_class(type, obj, arg, check) - int type; - VALUE obj; - struct dump_arg *arg; - int check; -{ - char *path; - - VALUE klass = CLASS_OF(obj); - w_extended(klass, arg, check); - w_byte(type, arg); - path = RSTRING(class2path(rb_class_real(klass)))->ptr; - w_unique(path, arg); -} - -static void -w_uclass(obj, base_klass, arg) - VALUE obj, base_klass; - struct dump_arg *arg; -{ - VALUE klass = CLASS_OF(obj); - - w_extended(klass, arg, Qtrue); - klass = rb_class_real(klass); - if (klass != base_klass) { - w_byte(TYPE_UCLASS, arg); - w_unique(RSTRING(class2path(klass))->ptr, arg); - } -} - -static int -w_obj_each(id, value, arg) - ID id; - VALUE value; - struct dump_call_arg *arg; -{ - w_symbol(id, arg->arg); - w_object(value, arg->arg, arg->limit); - return ST_CONTINUE; -} - -static void -w_ivar(tbl, arg) - st_table *tbl; - struct dump_call_arg *arg; -{ - if (tbl) { - w_long(tbl->num_entries, arg->arg); - st_foreach_safe(tbl, w_obj_each, (st_data_t)arg); - } - else { - w_long(0, arg->arg); - } -} - -static void -w_object(obj, arg, limit) - VALUE obj; - struct dump_arg *arg; - int limit; -{ - struct dump_call_arg c_arg; - st_table *ivtbl = 0; - st_data_t num; - - if (limit == 0) { - rb_raise(rb_eArgError, "exceed depth limit"); - } - - limit--; - c_arg.limit = limit; - c_arg.arg = arg; - - if (st_lookup(arg->data, obj, &num)) { - w_byte(TYPE_LINK, arg); - w_long((long)num, arg); - return; - } - - if ((ivtbl = rb_generic_ivar_table(obj)) != 0) { - w_byte(TYPE_IVAR, arg); - } - if (obj == Qnil) { - w_byte(TYPE_NIL, arg); - } - else if (obj == Qtrue) { - w_byte(TYPE_TRUE, arg); - } - else if (obj == Qfalse) { - w_byte(TYPE_FALSE, arg); - } - else if (FIXNUM_P(obj)) { -#if SIZEOF_LONG <= 4 - w_byte(TYPE_FIXNUM, arg); - w_long(FIX2INT(obj), arg); -#else - if (RSHIFT((long)obj, 31) == 0 || RSHIFT((long)obj, 31) == -1) { - w_byte(TYPE_FIXNUM, arg); - w_long(FIX2LONG(obj), arg); - } - else { - w_object(rb_int2big(FIX2LONG(obj)), arg, limit); - } -#endif - } - else if (SYMBOL_P(obj)) { - w_symbol(SYM2ID(obj), arg); - } - else { - if (OBJ_TAINTED(obj)) arg->taint = Qtrue; - - st_add_direct(arg->data, obj, arg->data->num_entries); - if (rb_respond_to(obj, s_mdump)) { - volatile VALUE v; - - v = rb_funcall(obj, s_mdump, 0, 0); - check_dump_arg(arg, s_mdump); - w_class(TYPE_USRMARSHAL, obj, arg, Qfalse); - w_object(v, arg, limit); - if (ivtbl) w_ivar(0, &c_arg); - return; - } - if (rb_respond_to(obj, s_dump)) { - VALUE v; - - v = rb_funcall(obj, s_dump, 1, INT2NUM(limit)); - check_dump_arg(arg, s_dump); - if (TYPE(v) != T_STRING) { - rb_raise(rb_eTypeError, "_dump() must return string"); - } - if (!ivtbl && (ivtbl = rb_generic_ivar_table(v))) { - w_byte(TYPE_IVAR, arg); - } - w_class(TYPE_USERDEF, obj, arg, Qfalse); - w_bytes(RSTRING(v)->ptr, RSTRING(v)->len, arg); - if (ivtbl) { - w_ivar(ivtbl, &c_arg); - } - return; - } - - switch (BUILTIN_TYPE(obj)) { - case T_CLASS: - if (FL_TEST(obj, FL_SINGLETON)) { - rb_raise(rb_eTypeError, "singleton class can't be dumped"); - } - w_byte(TYPE_CLASS, arg); - { - VALUE path = class2path(obj); - w_bytes(RSTRING(path)->ptr, RSTRING(path)->len, arg); - } - break; - - case T_MODULE: - w_byte(TYPE_MODULE, arg); - { - VALUE path = class2path(obj); - w_bytes(RSTRING(path)->ptr, RSTRING(path)->len, arg); - } - break; - - case T_FLOAT: - w_byte(TYPE_FLOAT, arg); - w_float(RFLOAT(obj)->value, arg); - break; - - case T_BIGNUM: - w_byte(TYPE_BIGNUM, arg); - { - char sign = RBIGNUM(obj)->sign ? '+' : '-'; - long len = RBIGNUM(obj)->len; - BDIGIT *d = RBIGNUM(obj)->digits; - - w_byte(sign, arg); - w_long(SHORTLEN(len), arg); /* w_short? */ - while (len--) { -#if SIZEOF_BDIGITS > SIZEOF_SHORT - BDIGIT num = *d; - int i; - - for (i=0; iptr, RSTRING(obj)->len, arg); - break; - - case T_REGEXP: - w_uclass(obj, rb_cRegexp, arg); - w_byte(TYPE_REGEXP, arg); - w_bytes(RREGEXP(obj)->str, RREGEXP(obj)->len, arg); - w_byte(rb_reg_options(obj), arg); - break; - - case T_ARRAY: - w_uclass(obj, rb_cArray, arg); - w_byte(TYPE_ARRAY, arg); - { - long len = RARRAY(obj)->len; - VALUE *ptr = RARRAY(obj)->ptr; - - w_long(len, arg); - while (len--) { - w_object(*ptr, arg, limit); - ptr++; - } - } - break; - - case T_HASH: - w_uclass(obj, rb_cHash, arg); - if (NIL_P(RHASH(obj)->ifnone)) { - w_byte(TYPE_HASH, arg); - } - else if (FL_TEST(obj, FL_USER2)) { - /* FL_USER2 means HASH_PROC_DEFAULT (see hash.c) */ - rb_raise(rb_eTypeError, "can't dump hash with default proc"); - } - else { - w_byte(TYPE_HASH_DEF, arg); - } - w_long(RHASH(obj)->tbl->num_entries, arg); - rb_hash_foreach(obj, hash_each, (st_data_t)&c_arg); - if (!NIL_P(RHASH(obj)->ifnone)) { - w_object(RHASH(obj)->ifnone, arg, limit); - } - break; - - case T_STRUCT: - w_class(TYPE_STRUCT, obj, arg, Qtrue); - { - long len = RSTRUCT(obj)->len; - VALUE mem; - long i; - - w_long(len, arg); - mem = rb_struct_members(obj); - for (i=0; iptr[i]), arg); - w_object(RSTRUCT(obj)->ptr[i], arg, limit); - } - } - break; - - case T_OBJECT: - w_class(TYPE_OBJECT, obj, arg, Qtrue); - w_ivar(ROBJECT(obj)->iv_tbl, &c_arg); - break; - - case T_DATA: - { - VALUE v; - - if (!rb_respond_to(obj, s_dump_data)) { - rb_raise(rb_eTypeError, - "no marshal_dump is defined for class %s", - rb_obj_classname(obj)); - } - v = rb_funcall(obj, s_dump_data, 0); - check_dump_arg(arg, s_dump_data); - w_class(TYPE_DATA, obj, arg, Qtrue); - w_object(v, arg, limit); - } - break; - - default: - rb_raise(rb_eTypeError, "can't dump %s", - rb_obj_classname(obj)); - break; - } - } - if (ivtbl) { - w_ivar(ivtbl, &c_arg); - } -} - -static VALUE -dump(arg) - struct dump_call_arg *arg; -{ - w_object(arg->obj, arg->arg, arg->limit); - if (arg->arg->dest) { - rb_io_write(arg->arg->dest, arg->arg->str); - rb_str_resize(arg->arg->str, 0); - } - return 0; -} - -static VALUE -dump_ensure(arg) - struct dump_arg *arg; -{ - if (!DATA_PTR(arg->wrapper)) return 0; - st_free_table(arg->symbols); - st_free_table(arg->data); - DATA_PTR(arg->wrapper) = 0; - arg->wrapper = 0; - if (arg->taint) { - OBJ_TAINT(arg->str); - } - - return 0; -} - -/* - * call-seq: - * dump( obj [, anIO] , limit=--1 ) => anIO - * - * Serializes obj and all descendent objects. If anIO is - * specified, the serialized data will be written to it, otherwise the - * data will be returned as a String. If limit is specified, the - * traversal of subobjects will be limited to that depth. If limit is - * negative, no checking of depth will be performed. - * - * class Klass - * def initialize(str) - * @str = str - * end - * def sayHello - * @str - * end - * end - * - * (produces no output) - * - * o = Klass.new("hello\n") - * data = Marshal.dump(o) - * obj = Marshal.load(data) - * obj.sayHello #=> "hello\n" - */ -static VALUE -marshal_dump(argc, argv) - int argc; - VALUE* argv; -{ - VALUE obj, port, a1, a2; - int limit = -1; - struct dump_arg arg; - struct dump_call_arg c_arg; - - port = Qnil; - rb_scan_args(argc, argv, "12", &obj, &a1, &a2); - if (argc == 3) { - if (!NIL_P(a2)) limit = NUM2INT(a2); - if (NIL_P(a1)) goto type_error; - port = a1; - } - else if (argc == 2) { - if (FIXNUM_P(a1)) limit = FIX2INT(a1); - else if (NIL_P(a1)) goto type_error; - else port = a1; - } - arg.dest = 0; - arg.symbols = st_init_numtable(); - arg.data = st_init_numtable(); - arg.taint = Qfalse; - arg.str = rb_str_buf_new(0); - RBASIC(arg.str)->klass = 0; - arg.wrapper = Data_Wrap_Struct(rb_cData, mark_dump_arg, 0, &arg); - if (!NIL_P(port)) { - if (!rb_respond_to(port, s_write)) { - type_error: - rb_raise(rb_eTypeError, "instance of IO needed"); - } - arg.dest = port; - if (rb_respond_to(port, s_binmode)) { - rb_funcall2(port, s_binmode, 0, 0); - check_dump_arg(&arg, s_binmode); - } - } - else { - port = arg.str; - } - - c_arg.obj = obj; - c_arg.arg = &arg; - c_arg.limit = limit; - - w_byte(MARSHAL_MAJOR, &arg); - w_byte(MARSHAL_MINOR, &arg); - - rb_ensure(dump, (VALUE)&c_arg, dump_ensure, (VALUE)&arg); - RBASIC(arg.str)->klass = rb_cString; - - return port; -} - -struct load_arg { - VALUE src; - long offset; - st_table *symbols; - st_table *data; - VALUE proc; - int taint; - VALUE wrapper; -}; - -static void -check_load_arg(arg, sym) - struct load_arg *arg; - ID sym; -{ - if (!DATA_PTR(arg->wrapper)) { - rb_raise(rb_eRuntimeError, "Marshal.load reentered at %s", - rb_id2name(sym)); - } -} - -static void -mark_load_arg(ptr) - void *ptr; -{ - struct load_arg *p = ptr; - if (!ptr) - return; - rb_mark_tbl(p->data); -} - -static VALUE r_object _((struct load_arg *arg)); - -static int -r_byte(arg) - struct load_arg *arg; -{ - int c; - - if (TYPE(arg->src) == T_STRING) { - if (RSTRING(arg->src)->len > arg->offset) { - c = (unsigned char)RSTRING(arg->src)->ptr[arg->offset++]; - } - else { - rb_raise(rb_eArgError, "marshal data too short"); - } - } - else { - VALUE src = arg->src; - VALUE v = rb_funcall2(src, s_getc, 0, 0); - check_load_arg(arg, s_getc); - if (NIL_P(v)) rb_eof_error(); - c = (unsigned char)FIX2INT(v); - } - return c; -} - -static void -long_toobig(size) - int size; -{ - rb_raise(rb_eTypeError, "long too big for this architecture (size %d, given %d)", - sizeof(long), size); -} - -#undef SIGN_EXTEND_CHAR -#if __STDC__ -# define SIGN_EXTEND_CHAR(c) ((signed char)(c)) -#else /* not __STDC__ */ -/* As in Harbison and Steele. */ -# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128) -#endif - -static long -r_long(arg) - struct load_arg *arg; -{ - register long x; - int c = SIGN_EXTEND_CHAR(r_byte(arg)); - long i; - - if (c == 0) return 0; - if (c > 0) { - if (4 < c && c < 128) { - return c - 5; - } - if (c > sizeof(long)) long_toobig(c); - x = 0; - for (i=0;i sizeof(long)) long_toobig(c); - x = -1; - for (i=0;isrc) == T_STRING) { - if (RSTRING(arg->src)->len - arg->offset >= len) { - str = rb_str_new(RSTRING(arg->src)->ptr+arg->offset, len); - arg->offset += len; - } - else { - too_short: - rb_raise(rb_eArgError, "marshal data too short"); - } - } - else { - VALUE src = arg->src; - VALUE n = LONG2NUM(len); - str = rb_funcall2(src, s_read, 1, &n); - check_load_arg(arg, s_read); - if (NIL_P(str)) goto too_short; - StringValue(str); - if (RSTRING(str)->len != len) goto too_short; - if (OBJ_TAINTED(str)) arg->taint = Qtrue; - } - return str; -} - -static ID -r_symlink(arg) - struct load_arg *arg; -{ - ID id; - long num = r_long(arg); - - if (st_lookup(arg->symbols, num, &id)) { - return id; - } - rb_raise(rb_eArgError, "bad symbol"); -} - -static ID -r_symreal(arg) - struct load_arg *arg; -{ - ID id; - - id = rb_intern(RSTRING(r_bytes(arg))->ptr); - st_insert(arg->symbols, arg->symbols->num_entries, id); - - return id; -} - -static ID -r_symbol(arg) - struct load_arg *arg; -{ - if (r_byte(arg) == TYPE_SYMLINK) { - return r_symlink(arg); - } - return r_symreal(arg); -} - -static char* -r_unique(arg) - struct load_arg *arg; -{ - return rb_id2name(r_symbol(arg)); -} - -static VALUE -r_string(arg) - struct load_arg *arg; -{ - return r_bytes(arg); -} - -static VALUE -r_entry(v, arg) - VALUE v; - struct load_arg *arg; -{ - st_insert(arg->data, arg->data->num_entries, (st_data_t)v); - if (arg->taint) OBJ_TAINT(v); - return v; -} - -static void -r_ivar(obj, arg) - VALUE obj; - struct load_arg *arg; -{ - long len; - - len = r_long(arg); - if (len > 0) { - while (len--) { - ID id = r_symbol(arg); - VALUE val = r_object(arg); - rb_ivar_set(obj, id, val); - } - } -} - -static VALUE -path2class(path) - char *path; -{ - VALUE v = rb_path2class(path); - - if (TYPE(v) != T_CLASS) { - rb_raise(rb_eArgError, "%s does not refer class", path); - } - return v; -} - -static VALUE -path2module(path) - char *path; -{ - VALUE v = rb_path2class(path); - - if (TYPE(v) != T_MODULE) { - rb_raise(rb_eArgError, "%s does not refer module", path); - } - return v; -} - -static VALUE -r_object0(arg, proc, ivp, extmod) - struct load_arg *arg; - VALUE proc; - int *ivp; - VALUE extmod; -{ - VALUE v = Qnil; - int type = r_byte(arg); - long id; - st_data_t link; - - switch (type) { - case TYPE_LINK: - id = r_long(arg); - if (!st_lookup(arg->data, (st_data_t)id, &link)) { - rb_raise(rb_eArgError, "dump format error (unlinked)"); - } - v = (st_data_t)link; - return v; - - case TYPE_IVAR: - { - int ivar = Qtrue; - - v = r_object0(arg, 0, &ivar, extmod); - if (ivar) r_ivar(v, arg); - } - break; - - case TYPE_EXTENDED: - { - VALUE m = path2module(r_unique(arg)); - - if (NIL_P(extmod)) extmod = rb_ary_new2(0); - rb_ary_push(extmod, m); - - v = r_object0(arg, 0, 0, extmod); - while (RARRAY(extmod)->len > 0) { - m = rb_ary_pop(extmod); - rb_extend_object(v, m); - } - } - break; - - case TYPE_UCLASS: - { - VALUE c = path2class(r_unique(arg)); - - if (FL_TEST(c, FL_SINGLETON)) { - rb_raise(rb_eTypeError, "singleton can't be loaded"); - } - v = r_object0(arg, 0, 0, extmod); - if (rb_special_const_p(v) || TYPE(v) == T_OBJECT || TYPE(v) == T_CLASS) { - format_error: - rb_raise(rb_eArgError, "dump format error (user class)"); - } - if (TYPE(v) == T_MODULE || !RTEST(rb_class_inherited_p(c, RBASIC(v)->klass))) { - VALUE tmp = rb_obj_alloc(c); - - if (TYPE(v) != TYPE(tmp)) goto format_error; - } - RBASIC(v)->klass = c; - } - break; - - case TYPE_NIL: - v = Qnil; - break; - - case TYPE_TRUE: - v = Qtrue; - break; - - case TYPE_FALSE: - v = Qfalse; - break; - - case TYPE_FIXNUM: - { - long i = r_long(arg); - v = LONG2FIX(i); - } - break; - - case TYPE_FLOAT: - { - double d, t = 0.0; - VALUE str = r_bytes(arg); - const char *ptr = RSTRING(str)->ptr; - - if (strcmp(ptr, "nan") == 0) { - d = t / t; - } - else if (strcmp(ptr, "inf") == 0) { - d = 1.0 / t; - } - else if (strcmp(ptr, "-inf") == 0) { - d = -1.0 / t; - } - else { - char *e; - d = strtod(ptr, &e); - d = load_mantissa(d, e, RSTRING(str)->len - (e - ptr)); - } - v = rb_float_new(d); - r_entry(v, arg); - } - break; - - case TYPE_BIGNUM: - { - long len; - BDIGIT *digits; - volatile VALUE data; - - NEWOBJ(big, struct RBignum); - OBJSETUP(big, rb_cBignum, T_BIGNUM); - big->sign = (r_byte(arg) == '+'); - len = r_long(arg); - data = r_bytes0(len * 2, arg); -#if SIZEOF_BDIGITS == SIZEOF_SHORT - big->len = len; -#else - big->len = (len + 1) * 2 / sizeof(BDIGIT); -#endif - big->digits = digits = ALLOC_N(BDIGIT, big->len); - MEMCPY(digits, RSTRING(data)->ptr, char, len * 2); -#if SIZEOF_BDIGITS > SIZEOF_SHORT - MEMZERO((char *)digits + len * 2, char, - big->len * sizeof(BDIGIT) - len * 2); -#endif - len = big->len; - while (len > 0) { - unsigned char *p = (unsigned char *)digits; - BDIGIT num = 0; -#if SIZEOF_BDIGITS > SIZEOF_SHORT - int shift = 0; - int i; - - for (i=0; iptr, RSTRING(str)->len, options), arg); - } - break; - - case TYPE_ARRAY: - { - volatile long len = r_long(arg); /* gcc 2.7.2.3 -O2 bug?? */ - - v = rb_ary_new2(len); - r_entry(v, arg); - while (len--) { - rb_ary_push(v, r_object(arg)); - } - } - break; - - case TYPE_HASH: - case TYPE_HASH_DEF: - { - long len = r_long(arg); - - v = rb_hash_new(); - r_entry(v, arg); - while (len--) { - VALUE key = r_object(arg); - VALUE value = r_object(arg); - rb_hash_aset(v, key, value); - } - if (type == TYPE_HASH_DEF) { - RHASH(v)->ifnone = r_object(arg); - } - } - break; - - case TYPE_STRUCT: - { - VALUE klass, mem, values; - volatile long i; /* gcc 2.7.2.3 -O2 bug?? */ - long len; - ID slot; - - klass = path2class(r_unique(arg)); - mem = rb_struct_s_members(klass); - if (mem == Qnil) { - rb_raise(rb_eTypeError, "uninitialized struct"); - } - len = r_long(arg); - - values = rb_ary_new2(len); - for (i=0; iptr[i] != ID2SYM(slot)) { - rb_raise(rb_eTypeError, "struct %s not compatible (:%s for :%s)", - rb_class2name(klass), - rb_id2name(slot), - rb_id2name(SYM2ID(RARRAY(mem)->ptr[i]))); - } - rb_struct_aset(v, LONG2FIX(i), r_object(arg)); - } - } - break; - - case TYPE_USERDEF: - { - VALUE klass = path2class(r_unique(arg)); - VALUE data; - - if (!rb_respond_to(klass, s_load)) { - rb_raise(rb_eTypeError, "class %s needs to have method `_load'", - rb_class2name(klass)); - } - data = r_string(arg); - if (ivp) { - r_ivar(data, arg); - *ivp = Qfalse; - } - v = rb_funcall(klass, s_load, 1, data); - check_load_arg(arg, s_load); - r_entry(v, arg); - } - break; - - case TYPE_USRMARSHAL: - { - VALUE klass = path2class(r_unique(arg)); - VALUE data; - - v = rb_obj_alloc(klass); - if (! NIL_P(extmod)) { - while (RARRAY(extmod)->len > 0) { - VALUE m = rb_ary_pop(extmod); - rb_extend_object(v, m); - } - } - if (!rb_respond_to(v, s_mload)) { - rb_raise(rb_eTypeError, "instance of %s needs to have method `marshal_load'", - rb_class2name(klass)); - } - r_entry(v, arg); - data = r_object(arg); - rb_funcall(v, s_mload, 1, data); - check_load_arg(arg, s_mload); - } - break; - - case TYPE_OBJECT: - { - VALUE klass = path2class(r_unique(arg)); - - v = rb_obj_alloc(klass); - if (TYPE(v) != T_OBJECT) { - rb_raise(rb_eArgError, "dump format error"); - } - r_entry(v, arg); - r_ivar(v, arg); - } - break; - - case TYPE_DATA: - { - VALUE klass = path2class(r_unique(arg)); - if (rb_respond_to(klass, s_alloc)) { - static int warn = Qtrue; - if (warn) { - rb_warn("define `allocate' instead of `_alloc'"); - warn = Qfalse; - } - v = rb_funcall(klass, s_alloc, 0); - check_load_arg(arg, s_alloc); - } - else { - v = rb_obj_alloc(klass); - } - if (TYPE(v) != T_DATA) { - rb_raise(rb_eArgError, "dump format error"); - } - r_entry(v, arg); - if (!rb_respond_to(v, s_load_data)) { - rb_raise(rb_eTypeError, - "class %s needs to have instance method `_load_data'", - rb_class2name(klass)); - } - rb_funcall(v, s_load_data, 1, r_object0(arg, 0, 0, extmod)); - check_load_arg(arg, s_load_data); - } - break; - - case TYPE_MODULE_OLD: - { - volatile VALUE str = r_bytes(arg); - - v = rb_path2class(RSTRING(str)->ptr); - r_entry(v, arg); - } - break; - - case TYPE_CLASS: - { - volatile VALUE str = r_bytes(arg); - - v = path2class(RSTRING(str)->ptr); - r_entry(v, arg); - } - break; - - case TYPE_MODULE: - { - volatile VALUE str = r_bytes(arg); - - v = path2module(RSTRING(str)->ptr); - r_entry(v, arg); - } - break; - - case TYPE_SYMBOL: - v = ID2SYM(r_symreal(arg)); - break; - - case TYPE_SYMLINK: - return ID2SYM(r_symlink(arg)); - - default: - rb_raise(rb_eArgError, "dump format error(0x%x)", type); - break; - } - if (proc) { - rb_funcall(proc, s_call, 1, v); - check_load_arg(arg, s_call); - } - return v; -} - -static VALUE -r_object(arg) - struct load_arg *arg; -{ - return r_object0(arg, arg->proc, 0, Qnil); -} - -static VALUE -load(arg) - struct load_arg *arg; -{ - return r_object(arg); -} - -static VALUE -load_ensure(arg) - struct load_arg *arg; -{ - if (!DATA_PTR(arg->wrapper)) return 0; - st_free_table(arg->symbols); - st_free_table(arg->data); - DATA_PTR(arg->wrapper) = 0; - arg->wrapper = 0; - return 0; -} - -/* - * call-seq: - * load( source [, proc] ) => obj - * restore( source [, proc] ) => obj - * - * Returns the result of converting the serialized data in source into a - * Ruby object (possibly with associated subordinate objects). source - * may be either an instance of IO or an object that responds to - * to_str. If proc is specified, it will be passed each object as it - * is deserialized. - */ -static VALUE -marshal_load(argc, argv) - int argc; - VALUE *argv; -{ - VALUE port, proc; - int major, minor; - VALUE v; - struct load_arg arg; - - rb_scan_args(argc, argv, "11", &port, &proc); - v = rb_check_string_type(port); - if (!NIL_P(v)) { - arg.taint = OBJ_TAINTED(port); /* original taintedness */ - port = v; - } - else if (rb_respond_to(port, s_getc) && rb_respond_to(port, s_read)) { - if (rb_respond_to(port, s_binmode)) { - rb_funcall2(port, s_binmode, 0, 0); - } - arg.taint = Qtrue; - } - else { - rb_raise(rb_eTypeError, "instance of IO needed"); - } - arg.src = port; - arg.offset = 0; - arg.symbols = st_init_numtable(); - arg.data = st_init_numtable(); - arg.proc = 0; - arg.wrapper = Data_Wrap_Struct(rb_cData, mark_load_arg, 0, &arg); - - major = r_byte(&arg); - minor = r_byte(&arg); - if (major != MARSHAL_MAJOR || minor > MARSHAL_MINOR) { - rb_raise(rb_eTypeError, "incompatible marshal file format (can't be read)\n\ -\tformat version %d.%d required; %d.%d given", - MARSHAL_MAJOR, MARSHAL_MINOR, major, minor); - } - if (RTEST(ruby_verbose) && minor != MARSHAL_MINOR) { - rb_warn("incompatible marshal file format (can be read)\n\ -\tformat version %d.%d required; %d.%d given", - MARSHAL_MAJOR, MARSHAL_MINOR, major, minor); - } - - if (!NIL_P(proc)) arg.proc = proc; - v = rb_ensure(load, (VALUE)&arg, load_ensure, (VALUE)&arg); - - return v; -} - -/* - * The marshaling library converts collections of Ruby objects into a - * byte stream, allowing them to be stored outside the currently - * active script. This data may subsequently be read and the original - * objects reconstituted. - * Marshaled data has major and minor version numbers stored along - * with the object information. In normal use, marshaling can only - * load data written with the same major version number and an equal - * or lower minor version number. If Ruby's ``verbose'' flag is set - * (normally using -d, -v, -w, or --verbose) the major and minor - * numbers must match exactly. Marshal versioning is independent of - * Ruby's version numbers. You can extract the version by reading the - * first two bytes of marshaled data. - * - * str = Marshal.dump("thing") - * RUBY_VERSION #=> "1.8.0" - * str[0] #=> 4 - * str[1] #=> 8 - * - * Some objects cannot be dumped: if the objects to be dumped include - * bindings, procedure or method objects, instances of class IO, or - * singleton objects, a TypeError will be raised. - * If your class has special serialization needs (for example, if you - * want to serialize in some specific format), or if it contains - * objects that would otherwise not be serializable, you can implement - * your own serialization strategy by defining two methods, _dump and - * _load: - * The instance method _dump should return a String object containing - * all the information necessary to reconstitute objects of this class - * and all referenced objects up to a maximum depth given as an integer - * parameter (a value of -1 implies that you should disable depth checking). - * The class method _load should take a String and return an object of this class. - */ -void -Init_marshal() -{ - VALUE rb_mMarshal = rb_define_module("Marshal"); - - s_dump = rb_intern("_dump"); - s_load = rb_intern("_load"); - s_mdump = rb_intern("marshal_dump"); - s_mload = rb_intern("marshal_load"); - s_dump_data = rb_intern("_dump_data"); - s_load_data = rb_intern("_load_data"); - s_alloc = rb_intern("_alloc"); - s_call = rb_intern("call"); - s_getc = rb_intern("getc"); - s_read = rb_intern("read"); - s_write = rb_intern("write"); - s_binmode = rb_intern("binmode"); - - rb_define_module_function(rb_mMarshal, "dump", marshal_dump, -1); - rb_define_module_function(rb_mMarshal, "load", marshal_load, -1); - rb_define_module_function(rb_mMarshal, "restore", marshal_load, -1); - - rb_define_const(rb_mMarshal, "MAJOR_VERSION", INT2FIX(MARSHAL_MAJOR)); - rb_define_const(rb_mMarshal, "MINOR_VERSION", INT2FIX(MARSHAL_MINOR)); -} - -VALUE -rb_marshal_dump(obj, port) - VALUE obj, port; -{ - int argc = 1; - VALUE argv[2]; - - argv[0] = obj; - argv[1] = port; - if (!NIL_P(port)) argc = 2; - return marshal_dump(argc, argv); -} - -VALUE -rb_marshal_load(port) - VALUE port; -{ - return marshal_load(1, &port); -} -/********************************************************************** - - math.c - - - $Author: shyouhei $ - $Date: 2008-07-02 11:25:48 +0200 (Wed, 02 Jul 2008) $ - created at: Tue Jan 25 14:12:56 JST 1994 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include -#include - -VALUE rb_mMath; - -#define Need_Float(x) (x) = rb_Float(x) -#define Need_Float2(x,y) do {\ - Need_Float(x);\ - Need_Float(y);\ -} while (0) - -static void -domain_check(x, msg) - double x; - char *msg; -{ - while(1) { - if (errno) { - rb_sys_fail(msg); - } - if (isnan(x)) { -#if defined(EDOM) - errno = EDOM; -#elif defined(ERANGE) - errno = ERANGE; -#endif - continue; - } - break; - } -} - - -/* - * call-seq: - * Math.atan2(y, x) => float - * - * Computes the arc tangent given y and x. Returns - * -PI..PI. - * - */ - -static VALUE -math_atan2(obj, y, x) - VALUE obj, x, y; -{ - Need_Float2(y, x); - return rb_float_new(atan2(RFLOAT(y)->value, RFLOAT(x)->value)); -} - - -/* - * call-seq: - * Math.cos(x) => float - * - * Computes the cosine of x (expressed in radians). Returns - * -1..1. - */ - -static VALUE -math_cos(obj, x) - VALUE obj, x; -{ - Need_Float(x); - return rb_float_new(cos(RFLOAT(x)->value)); -} - -/* - * call-seq: - * Math.sin(x) => float - * - * Computes the sine of x (expressed in radians). Returns - * -1..1. - */ - -static VALUE -math_sin(obj, x) - VALUE obj, x; -{ - Need_Float(x); - - return rb_float_new(sin(RFLOAT(x)->value)); -} - - -/* - * call-seq: - * Math.tan(x) => float - * - * Returns the tangent of x (expressed in radians). - */ - -static VALUE -math_tan(obj, x) - VALUE obj, x; -{ - Need_Float(x); - - return rb_float_new(tan(RFLOAT(x)->value)); -} - -/* - * call-seq: - * Math.acos(x) => float - * - * Computes the arc cosine of x. Returns 0..PI. - */ - -static VALUE -math_acos(obj, x) - VALUE obj, x; -{ - double d; - - Need_Float(x); - errno = 0; - d = acos(RFLOAT(x)->value); - domain_check(d, "acos"); - return rb_float_new(d); -} - -/* - * call-seq: - * Math.asin(x) => float - * - * Computes the arc sine of x. Returns 0..PI. - */ - -static VALUE -math_asin(obj, x) - VALUE obj, x; -{ - double d; - - Need_Float(x); - errno = 0; - d = asin(RFLOAT(x)->value); - domain_check(d, "asin"); - return rb_float_new(d); -} - -/* - * call-seq: - * Math.atan(x) => float - * - * Computes the arc tangent of x. Returns -{PI/2} .. {PI/2}. - */ - -static VALUE -math_atan(obj, x) - VALUE obj, x; -{ - Need_Float(x); - return rb_float_new(atan(RFLOAT(x)->value)); -} - -#ifndef HAVE_COSH -double -cosh(x) - double x; -{ - return (exp(x) + exp(-x)) / 2; -} -#endif - -/* - * call-seq: - * Math.cosh(x) => float - * - * Computes the hyperbolic cosine of x (expressed in radians). - */ - -static VALUE -math_cosh(obj, x) - VALUE obj, x; -{ - Need_Float(x); - - return rb_float_new(cosh(RFLOAT(x)->value)); -} - -#ifndef HAVE_SINH -double -sinh(x) - double x; -{ - return (exp(x) - exp(-x)) / 2; -} -#endif - -/* - * call-seq: - * Math.sinh(x) => float - * - * Computes the hyperbolic sine of x (expressed in - * radians). - */ - -static VALUE -math_sinh(obj, x) - VALUE obj, x; -{ - Need_Float(x); - return rb_float_new(sinh(RFLOAT(x)->value)); -} - -#ifndef HAVE_TANH -double -tanh(x) - double x; -{ - return sinh(x) / cosh(x); -} -#endif - -/* - * call-seq: - * Math.tanh() => float - * - * Computes the hyperbolic tangent of x (expressed in - * radians). - */ - -static VALUE -math_tanh(obj, x) - VALUE obj, x; -{ - Need_Float(x); - return rb_float_new(tanh(RFLOAT(x)->value)); -} - -/* - * call-seq: - * Math.acosh(x) => float - * - * Computes the inverse hyperbolic cosine of x. - */ - -static VALUE -math_acosh(obj, x) - VALUE obj, x; -{ - double d; - - Need_Float(x); - errno = 0; - d = acosh(RFLOAT(x)->value); - domain_check(d, "acosh"); - return rb_float_new(d); -} - -/* - * call-seq: - * Math.asinh(x) => float - * - * Computes the inverse hyperbolic sine of x. - */ - -static VALUE -math_asinh(obj, x) - VALUE obj, x; -{ - Need_Float(x); - return rb_float_new(asinh(RFLOAT(x)->value)); -} - -/* - * call-seq: - * Math.atanh(x) => float - * - * Computes the inverse hyperbolic tangent of x. - */ - -static VALUE -math_atanh(obj, x) - VALUE obj, x; -{ - double d; - - Need_Float(x); - errno = 0; - d = atanh(RFLOAT(x)->value); - domain_check(d, "atanh"); - return rb_float_new(d); -} - -/* - * call-seq: - * Math.exp(x) => float - * - * Returns e**x. - */ - -static VALUE -math_exp(obj, x) - VALUE obj, x; -{ - Need_Float(x); - return rb_float_new(exp(RFLOAT(x)->value)); -} - -#if defined __CYGWIN__ -# include -# if CYGWIN_VERSION_DLL_MAJOR < 1005 -# define nan(x) nan() -# endif -# define log(x) ((x) < 0.0 ? nan("") : log(x)) -# define log10(x) ((x) < 0.0 ? nan("") : log10(x)) -#endif - -/* - * call-seq: - * Math.log(numeric) => float - * - * Returns the natural logarithm of numeric. - */ - -static VALUE -math_log(obj, x) - VALUE obj, x; -{ - double d; - - Need_Float(x); - errno = 0; - d = log(RFLOAT(x)->value); - domain_check(d, "log"); - return rb_float_new(d); -} - -/* - * call-seq: - * Math.log10(numeric) => float - * - * Returns the base 10 logarithm of numeric. - */ - -static VALUE -math_log10(obj, x) - VALUE obj, x; -{ - double d; - - Need_Float(x); - errno = 0; - d = log10(RFLOAT(x)->value); - domain_check(d, "log10"); - return rb_float_new(d); -} - -/* - * call-seq: - * Math.sqrt(numeric) => float - * - * Returns the non-negative square root of numeric. - */ - -static VALUE -math_sqrt(obj, x) - VALUE obj, x; -{ - double d; - - Need_Float(x); - errno = 0; - d = sqrt(RFLOAT(x)->value); - domain_check(d, "sqrt"); - return rb_float_new(d); -} - -/* - * call-seq: - * Math.frexp(numeric) => [ fraction, exponent ] - * - * Returns a two-element array containing the normalized fraction (a - * Float) and exponent (a Fixnum) of - * numeric. - * - * fraction, exponent = Math.frexp(1234) #=> [0.6025390625, 11] - * fraction * 2**exponent #=> 1234.0 - */ - -static VALUE -math_frexp(obj, x) - VALUE obj, x; -{ - double d; - int exp; - - Need_Float(x); - - d = frexp(RFLOAT(x)->value, &exp); - return rb_assoc_new(rb_float_new(d), INT2NUM(exp)); -} - -/* - * call-seq: - * Math.ldexp(flt, int) -> float - * - * Returns the value of flt*(2**int). - * - * fraction, exponent = Math.frexp(1234) - * Math.ldexp(fraction, exponent) #=> 1234.0 - */ - -static VALUE -math_ldexp(obj, x, n) - VALUE obj, x, n; -{ - Need_Float(x); - return rb_float_new(ldexp(RFLOAT(x)->value, NUM2INT(n))); -} - -/* - * call-seq: - * Math.hypot(x, y) => float - * - * Returns sqrt(x**2 + y**2), the hypotenuse of a right-angled triangle - * with sides x and y. - * - * Math.hypot(3, 4) #=> 5.0 - */ - -static VALUE -math_hypot(obj, x, y) - VALUE obj, x, y; -{ - Need_Float2(x, y); - return rb_float_new(hypot(RFLOAT(x)->value, RFLOAT(y)->value)); -} - -/* - * call-seq: - * Math.erf(x) => float - * - * Calculates the error function of x. - */ - -static VALUE -math_erf(obj, x) - VALUE obj, x; -{ - Need_Float(x); - return rb_float_new(erf(RFLOAT(x)->value)); -} - -/* - * call-seq: - * Math.erfc(x) => float - * - * Calculates the complementary error function of x. - */ - -static VALUE -math_erfc(obj, x) - VALUE obj, x; -{ - Need_Float(x); - return rb_float_new(erfc(RFLOAT(x)->value)); -} - -/* - * The Math module contains module functions for basic - * trigonometric and transcendental functions. See class - * Float for a list of constants that - * define Ruby's floating point accuracy. - */ - - -void -Init_Math() -{ - rb_mMath = rb_define_module("Math"); - -#ifdef M_PI - rb_define_const(rb_mMath, "PI", rb_float_new(M_PI)); -#else - rb_define_const(rb_mMath, "PI", rb_float_new(atan(1.0)*4.0)); -#endif - -#ifdef M_E - rb_define_const(rb_mMath, "E", rb_float_new(M_E)); -#else - rb_define_const(rb_mMath, "E", rb_float_new(exp(1.0))); -#endif - - rb_define_module_function(rb_mMath, "atan2", math_atan2, 2); - rb_define_module_function(rb_mMath, "cos", math_cos, 1); - rb_define_module_function(rb_mMath, "sin", math_sin, 1); - rb_define_module_function(rb_mMath, "tan", math_tan, 1); - - rb_define_module_function(rb_mMath, "acos", math_acos, 1); - rb_define_module_function(rb_mMath, "asin", math_asin, 1); - rb_define_module_function(rb_mMath, "atan", math_atan, 1); - - rb_define_module_function(rb_mMath, "cosh", math_cosh, 1); - rb_define_module_function(rb_mMath, "sinh", math_sinh, 1); - rb_define_module_function(rb_mMath, "tanh", math_tanh, 1); - - rb_define_module_function(rb_mMath, "acosh", math_acosh, 1); - rb_define_module_function(rb_mMath, "asinh", math_asinh, 1); - rb_define_module_function(rb_mMath, "atanh", math_atanh, 1); - - rb_define_module_function(rb_mMath, "exp", math_exp, 1); - rb_define_module_function(rb_mMath, "log", math_log, 1); - rb_define_module_function(rb_mMath, "log10", math_log10, 1); - rb_define_module_function(rb_mMath, "sqrt", math_sqrt, 1); - - rb_define_module_function(rb_mMath, "frexp", math_frexp, 1); - rb_define_module_function(rb_mMath, "ldexp", math_ldexp, 2); - - rb_define_module_function(rb_mMath, "hypot", math_hypot, 2); - - rb_define_module_function(rb_mMath, "erf", math_erf, 1); - rb_define_module_function(rb_mMath, "erfc", math_erfc, 1); -} -/********************************************************************** - - numeric.c - - - $Author: wyhaines $ - $Date: 2009-07-14 17:05:27 +0200 (Tue, 14 Jul 2009) $ - created at: Fri Aug 13 18:33:09 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include "env.h" -#include -#include -#include - -#if defined(__FreeBSD__) && __FreeBSD__ < 4 -#include -#endif - -#ifdef HAVE_FLOAT_H -#include -#endif - -#ifdef HAVE_IEEEFP_H -#include -#endif - -/* use IEEE 64bit values if not defined */ -#ifndef FLT_RADIX -#define FLT_RADIX 2 -#endif -#ifndef FLT_ROUNDS -#define FLT_ROUNDS 1 -#endif -#ifndef DBL_MIN -#define DBL_MIN 2.2250738585072014e-308 -#endif -#ifndef DBL_MAX -#define DBL_MAX 1.7976931348623157e+308 -#endif -#ifndef DBL_MIN_EXP -#define DBL_MIN_EXP (-1021) -#endif -#ifndef DBL_MAX_EXP -#define DBL_MAX_EXP 1024 -#endif -#ifndef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP (-307) -#endif -#ifndef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 308 -#endif -#ifndef DBL_DIG -#define DBL_DIG 15 -#endif -#ifndef DBL_MANT_DIG -#define DBL_MANT_DIG 53 -#endif -#ifndef DBL_EPSILON -#define DBL_EPSILON 2.2204460492503131e-16 -#endif - -#ifndef HAVE_ROUND -double -round(x) - double x; -{ - double f; - - if (x > 0.0) { - f = floor(x); - x = f + (x - f >= 0.5); - } - else if (x < 0.0) { - f = ceil(x); - x = f - (f - x >= 0.5); - } - return x; -} -#endif - -static ID id_coerce, id_to_i, id_eq; - -VALUE rb_cNumeric; -VALUE rb_cFloat; -VALUE rb_cInteger; -VALUE rb_cFixnum; - -VALUE rb_eZeroDivError; -VALUE rb_eFloatDomainError; - -void -rb_num_zerodiv() -{ - rb_raise(rb_eZeroDivError, "divided by 0"); -} - - -/* - * call-seq: - * num.coerce(numeric) => array - * - * If aNumeric is the same type as num, returns an array - * containing aNumeric and num. Otherwise, returns an - * array with both aNumeric and num represented as - * Float objects. This coercion mechanism is used by - * Ruby to handle mixed-type numeric operations: it is intended to - * find a compatible common type between the two operands of the operator. - * - * 1.coerce(2.5) #=> [2.5, 1.0] - * 1.2.coerce(3) #=> [3.0, 1.2] - * 1.coerce(2) #=> [2, 1] - */ - -static VALUE -num_coerce(x, y) - VALUE x, y; -{ - if (CLASS_OF(x) == CLASS_OF(y)) - return rb_assoc_new(y, x); - x = rb_Float(x); - y = rb_Float(y); - return rb_assoc_new(y, x); -} - -static VALUE -coerce_body(x) - VALUE *x; -{ - return rb_funcall(x[1], id_coerce, 1, x[0]); -} - -static VALUE -coerce_rescue(x) - VALUE *x; -{ - volatile VALUE v = rb_inspect(x[1]); - - rb_raise(rb_eTypeError, "%s can't be coerced into %s", - rb_special_const_p(x[1])? - RSTRING(v)->ptr: - rb_obj_classname(x[1]), - rb_obj_classname(x[0])); - return Qnil; /* dummy */ -} - -static int -do_coerce(x, y, err) - VALUE *x, *y; - int err; -{ - VALUE ary; - VALUE a[2]; - - a[0] = *x; a[1] = *y; - - ary = rb_rescue(coerce_body, (VALUE)a, err?coerce_rescue:0, (VALUE)a); - if (TYPE(ary) != T_ARRAY || RARRAY(ary)->len != 2) { - if (err) { - rb_raise(rb_eTypeError, "coerce must return [x, y]"); - } - return Qfalse; - } - - *x = RARRAY(ary)->ptr[0]; - *y = RARRAY(ary)->ptr[1]; - return Qtrue; -} - -VALUE -rb_num_coerce_bin(x, y) - VALUE x, y; -{ - do_coerce(&x, &y, Qtrue); - return rb_funcall(x, ruby_frame->orig_func, 1, y); -} - -VALUE -rb_num_coerce_cmp(x, y) - VALUE x, y; -{ - if (do_coerce(&x, &y, Qfalse)) - return rb_funcall(x, ruby_frame->orig_func, 1, y); - return Qnil; -} - -VALUE -rb_num_coerce_relop(x, y) - VALUE x, y; -{ - VALUE c, x0 = x, y0 = y; - - if (!do_coerce(&x, &y, Qfalse) || - NIL_P(c = rb_funcall(x, ruby_frame->orig_func, 1, y))) { - rb_cmperr(x0, y0); - return Qnil; /* not reached */ - } - return c; -} - -/* - * Trap attempts to add methods to Numeric objects. Always - * raises a TypeError - */ - -static VALUE -num_sadded(x, name) - VALUE x, name; -{ - ruby_frame = ruby_frame->prev; /* pop frame for "singleton_method_added" */ - /* Numerics should be values; singleton_methods should not be added to them */ - rb_raise(rb_eTypeError, - "can't define singleton method \"%s\" for %s", - rb_id2name(rb_to_id(name)), - rb_obj_classname(x)); - return Qnil; /* not reached */ -} - -/* :nodoc: */ -static VALUE -num_init_copy(x, y) - VALUE x, y; -{ - /* Numerics are immutable values, which should not be copied */ - rb_raise(rb_eTypeError, "can't copy %s", rb_obj_classname(x)); - return Qnil; /* not reached */ -} - -/* - * call-seq: - * +num => num - * - * Unary Plus---Returns the receiver's value. - */ - -static VALUE -num_uplus(num) - VALUE num; -{ - return num; -} - -/* - * call-seq: - * -num => numeric - * - * Unary Minus---Returns the receiver's value, negated. - */ - -static VALUE -num_uminus(num) - VALUE num; -{ - VALUE zero; - - zero = INT2FIX(0); - do_coerce(&zero, &num, Qtrue); - - return rb_funcall(zero, '-', 1, num); -} - -/* - * call-seq: - * num.quo(numeric) => result - * - * Equivalent to Numeric#/, but overridden in subclasses. - */ - -static VALUE -num_quo(x, y) - VALUE x, y; -{ - return rb_funcall(x, '/', 1, y); -} - - -static VALUE num_floor(VALUE num); - -/* - * call-seq: - * num.div(numeric) => integer - * - * Uses / to perform division, then converts the result to - * an integer. Numeric does not define the / - * operator; this is left to subclasses. - */ - -static VALUE -num_div(x, y) - VALUE x, y; -{ - return num_floor(rb_funcall(x, '/', 1, y)); -} - - - -/* - * call-seq: - * num.divmod( aNumeric ) -> anArray - * - * Returns an array containing the quotient and modulus obtained by - * dividing num by aNumeric. If q, r = - * x.divmod(y), then - * - * q = floor(float(x)/float(y)) - * x = q*y + r - * - * The quotient is rounded toward -infinity, as shown in the following table: - * - * a | b | a.divmod(b) | a/b | a.modulo(b) | a.remainder(b) - * ------+-----+---------------+---------+-------------+--------------- - * 13 | 4 | 3, 1 | 3 | 1 | 1 - * ------+-----+---------------+---------+-------------+--------------- - * 13 | -4 | -4, -3 | -3 | -3 | 1 - * ------+-----+---------------+---------+-------------+--------------- - * -13 | 4 | -4, 3 | -4 | 3 | -1 - * ------+-----+---------------+---------+-------------+--------------- - * -13 | -4 | 3, -1 | 3 | -1 | -1 - * ------+-----+---------------+---------+-------------+--------------- - * 11.5 | 4 | 2, 3.5 | 2.875 | 3.5 | 3.5 - * ------+-----+---------------+---------+-------------+--------------- - * 11.5 | -4 | -3, -0.5 | -2.875 | -0.5 | 3.5 - * ------+-----+---------------+---------+-------------+--------------- - * -11.5 | 4 | -3, 0.5 | -2.875 | 0.5 | -3.5 - * ------+-----+---------------+---------+-------------+--------------- - * -11.5 | -4 | 2 -3.5 | 2.875 | -3.5 | -3.5 - * - * - * Examples - * 11.divmod(3) #=> [3, 2] - * 11.divmod(-3) #=> [-4, -1] - * 11.divmod(3.5) #=> [3, 0.5] - * (-11).divmod(3.5) #=> [-4, 3.0] - * (11.5).divmod(3.5) #=> [3, 1.0] - */ - -static VALUE -num_divmod(x, y) - VALUE x, y; -{ - return rb_assoc_new(num_div(x, y), rb_funcall(x, '%', 1, y)); -} - -/* - * call-seq: - * num.modulo(numeric) => result - * - * Equivalent to - * num.divmod(aNumeric)[1]. - */ - -static VALUE -num_modulo(x, y) - VALUE x, y; -{ - return rb_funcall(x, '%', 1, y); -} - -/* - * call-seq: - * num.remainder(numeric) => result - * - * If num and numeric have different signs, returns - * mod-numeric; otherwise, returns mod. In - * both cases mod is the value - * num.modulo(numeric). The - * differences between remainder and modulo - * (%) are shown in the table under Numeric#divmod. - */ - -static VALUE -num_remainder(x, y) - VALUE x, y; -{ - VALUE z = rb_funcall(x, '%', 1, y); - - if ((!rb_equal(z, INT2FIX(0))) && - ((RTEST(rb_funcall(x, '<', 1, INT2FIX(0))) && - RTEST(rb_funcall(y, '>', 1, INT2FIX(0)))) || - (RTEST(rb_funcall(x, '>', 1, INT2FIX(0))) && - RTEST(rb_funcall(y, '<', 1, INT2FIX(0)))))) { - return rb_funcall(z, '-', 1, y); - } - return z; -} - -/* - * call-seq: - * num.integer? -> true or false - * - * Returns true if num is an Integer - * (including Fixnum and Bignum). - */ - -static VALUE -num_int_p(num) - VALUE num; -{ - return Qfalse; -} - -/* - * call-seq: - * num.abs => num or numeric - * - * Returns the absolute value of num. - * - * 12.abs #=> 12 - * (-34.56).abs #=> 34.56 - * -34.56.abs #=> 34.56 - */ - -static VALUE -num_abs(num) - VALUE num; -{ - if (RTEST(rb_funcall(num, '<', 1, INT2FIX(0)))) { - return rb_funcall(num, rb_intern("-@"), 0); - } - return num; -} - - -/* - * call-seq: - * num.zero? => true or false - * - * Returns true if num has a zero value. - */ - -static VALUE -num_zero_p(num) - VALUE num; -{ - if (rb_equal(num, INT2FIX(0))) { - return Qtrue; - } - return Qfalse; -} - - -/* - * call-seq: - * num.nonzero? => num or nil - * - * Returns num if num is not zero, nil - * otherwise. This behavior is useful when chaining comparisons: - * - * a = %w( z Bb bB bb BB a aA Aa AA A ) - * b = a.sort {|a,b| (a.downcase <=> b.downcase).nonzero? || a <=> b } - * b #=> ["A", "a", "AA", "Aa", "aA", "BB", "Bb", "bB", "bb", "z"] - */ - -static VALUE -num_nonzero_p(num) - VALUE num; -{ - if (RTEST(rb_funcall(num, rb_intern("zero?"), 0, 0))) { - return Qnil; - } - return num; -} - -/* - * call-seq: - * num.to_int => integer - * - * Invokes the child class's to_i method to convert - * num to an integer. - */ - -static VALUE -num_to_int(num) - VALUE num; -{ - return rb_funcall(num, id_to_i, 0, 0); -} - - -/******************************************************************** - * - * Document-class: Float - * - * Float objects represent real numbers using the native - * architecture's double-precision floating point representation. - */ - -VALUE -rb_float_new(d) - double d; -{ - NEWOBJ(flt, struct RFloat); - OBJSETUP(flt, rb_cFloat, T_FLOAT); - - flt->value = d; - return (VALUE)flt; -} - -/* - * call-seq: - * flt.to_s => string - * - * Returns a string containing a representation of self. As well as a - * fixed or exponential form of the number, the call may return - * ``NaN'', ``Infinity'', and - * ``-Infinity''. - */ - -static VALUE -flo_to_s(flt) - VALUE flt; -{ - char buf[32]; - double value = RFLOAT(flt)->value; - char *p, *e; - - if (isinf(value)) - return rb_str_new2(value < 0 ? "-Infinity" : "Infinity"); - else if(isnan(value)) - return rb_str_new2("NaN"); - - sprintf(buf, "%#.15g", value); /* ensure to print decimal point */ - if (!(e = strchr(buf, 'e'))) { - e = buf + strlen(buf); - } - if (!ISDIGIT(e[-1])) { /* reformat if ended with decimal point (ex 111111111111111.) */ - sprintf(buf, "%#.14e", value); - if (!(e = strchr(buf, 'e'))) { - e = buf + strlen(buf); - } - } - p = e; - while (p[-1]=='0' && ISDIGIT(p[-2])) - p--; - memmove(p, e, strlen(e)+1); - return rb_str_new2(buf); -} - -/* - * MISSING: documentation - */ - -static VALUE -flo_coerce(x, y) - VALUE x, y; -{ - return rb_assoc_new(rb_Float(y), x); -} - -/* - * call-seq: - * -float => float - * - * Returns float, negated. - */ - -static VALUE -flo_uminus(flt) - VALUE flt; -{ - return rb_float_new(-RFLOAT(flt)->value); -} - -/* - * call-seq: - * float + other => float - * - * Returns a new float which is the sum of float - * and other. - */ - -static VALUE -flo_plus(x, y) - VALUE x, y; -{ - switch (TYPE(y)) { - case T_FIXNUM: - return rb_float_new(RFLOAT(x)->value + (double)FIX2LONG(y)); - case T_BIGNUM: - return rb_float_new(RFLOAT(x)->value + rb_big2dbl(y)); - case T_FLOAT: - return rb_float_new(RFLOAT(x)->value + RFLOAT(y)->value); - default: - return rb_num_coerce_bin(x, y); - } -} - -/* - * call-seq: - * float + other => float - * - * Returns a new float which is the difference of float - * and other. - */ - -static VALUE -flo_minus(x, y) - VALUE x, y; -{ - switch (TYPE(y)) { - case T_FIXNUM: - return rb_float_new(RFLOAT(x)->value - (double)FIX2LONG(y)); - case T_BIGNUM: - return rb_float_new(RFLOAT(x)->value - rb_big2dbl(y)); - case T_FLOAT: - return rb_float_new(RFLOAT(x)->value - RFLOAT(y)->value); - default: - return rb_num_coerce_bin(x, y); - } -} - -/* - * call-seq: - * float * other => float - * - * Returns a new float which is the product of float - * and other. - */ - -static VALUE -flo_mul(x, y) - VALUE x, y; -{ - switch (TYPE(y)) { - case T_FIXNUM: - return rb_float_new(RFLOAT(x)->value * (double)FIX2LONG(y)); - case T_BIGNUM: - return rb_float_new(RFLOAT(x)->value * rb_big2dbl(y)); - case T_FLOAT: - return rb_float_new(RFLOAT(x)->value * RFLOAT(y)->value); - default: - return rb_num_coerce_bin(x, y); - } -} - -/* - * call-seq: - * float / other => float - * - * Returns a new float which is the result of dividing - * float by other. - */ - -static VALUE -flo_div(x, y) - VALUE x, y; -{ - long f_y; - double d; - - switch (TYPE(y)) { - case T_FIXNUM: - f_y = FIX2LONG(y); - return rb_float_new(RFLOAT(x)->value / (double)f_y); - case T_BIGNUM: - d = rb_big2dbl(y); - return rb_float_new(RFLOAT(x)->value / d); - case T_FLOAT: - return rb_float_new(RFLOAT(x)->value / RFLOAT(y)->value); - default: - return rb_num_coerce_bin(x, y); - } -} - - -static void -flodivmod(x, y, divp, modp) - double x, y; - double *divp, *modp; -{ - double div, mod; - -#ifdef HAVE_FMOD - mod = fmod(x, y); -#else - { - double z; - - modf(x/y, &z); - mod = x - z * y; - } -#endif - if (isinf(x) && !isinf(y) && !isnan(y)) - div = x; - else - div = (x - mod) / y; - if (y*mod < 0) { - mod += y; - div -= 1.0; - } - if (modp) *modp = mod; - if (divp) *divp = div; -} - - -/* - * call-seq: - * flt % other => float - * flt.modulo(other) => float - * - * Return the modulo after division of flt by other. - * - * 6543.21.modulo(137) #=> 104.21 - * 6543.21.modulo(137.24) #=> 92.9299999999996 - */ - -static VALUE -flo_mod(x, y) - VALUE x, y; -{ - double fy, mod; - - switch (TYPE(y)) { - case T_FIXNUM: - fy = (double)FIX2LONG(y); - break; - case T_BIGNUM: - fy = rb_big2dbl(y); - break; - case T_FLOAT: - fy = RFLOAT(y)->value; - break; - default: - return rb_num_coerce_bin(x, y); - } - flodivmod(RFLOAT(x)->value, fy, 0, &mod); - return rb_float_new(mod); -} - -/* - * call-seq: - * flt.divmod(numeric) => array - * - * See Numeric#divmod. - */ - -static VALUE -flo_divmod(x, y) - VALUE x, y; -{ - double fy, div, mod, val; - volatile VALUE a, b; - - switch (TYPE(y)) { - case T_FIXNUM: - fy = (double)FIX2LONG(y); - break; - case T_BIGNUM: - fy = rb_big2dbl(y); - break; - case T_FLOAT: - fy = RFLOAT(y)->value; - break; - default: - return rb_num_coerce_bin(x, y); - } - flodivmod(RFLOAT(x)->value, fy, &div, &mod); - if (FIXABLE(div)) { - val = round(div); - a = LONG2FIX(val); - } - else { - a = rb_dbl2big(div); - } - b = rb_float_new(mod); - return rb_assoc_new(a, b); -} - -/* - * call-seq: - * - * flt ** other => float - * - * Raises float the other power. - */ - -static VALUE -flo_pow(x, y) - VALUE x, y; -{ - switch (TYPE(y)) { - case T_FIXNUM: - return rb_float_new(pow(RFLOAT(x)->value, (double)FIX2LONG(y))); - case T_BIGNUM: - return rb_float_new(pow(RFLOAT(x)->value, rb_big2dbl(y))); - case T_FLOAT: - return rb_float_new(pow(RFLOAT(x)->value, RFLOAT(y)->value)); - default: - return rb_num_coerce_bin(x, y); - } -} - -/* - * call-seq: - * num.eql?(numeric) => true or false - * - * Returns true if num and numeric are the - * same type and have equal values. - * - * 1 == 1.0 #=> true - * 1.eql?(1.0) #=> false - * (1.0).eql?(1.0) #=> true - */ - -static VALUE -num_eql(x, y) - VALUE x, y; -{ - if (TYPE(x) != TYPE(y)) return Qfalse; - - return rb_equal(x, y); -} - -/* - * call-seq: - * num <=> other -> 0 or nil - * - * Returns zero if num equals other, nil - * otherwise. - */ - -static VALUE -num_cmp(x, y) - VALUE x, y; -{ - if (x == y) return INT2FIX(0); - return Qnil; -} - -static VALUE -num_equal(x, y) - VALUE x, y; -{ - if (x == y) return Qtrue; - return rb_funcall(y, id_eq, 1, x); -} - -/* - * call-seq: - * flt == obj => true or false - * - * Returns true only if obj has the same value - * as flt. Contrast this with Float#eql?, which - * requires obj to be a Float. - * - * 1.0 == 1 #=> true - * - */ - -static VALUE -flo_eq(x, y) - VALUE x, y; -{ - volatile double a, b; - - switch (TYPE(y)) { - case T_FIXNUM: - b = FIX2LONG(y); - break; - case T_BIGNUM: - b = rb_big2dbl(y); - break; - case T_FLOAT: - b = RFLOAT(y)->value; - if (isnan(b)) return Qfalse; - break; - default: - return num_equal(x, y); - } - a = RFLOAT(x)->value; - if (isnan(a)) return Qfalse; - return (a == b)?Qtrue:Qfalse; -} - -/* - * call-seq: - * flt.hash => integer - * - * Returns a hash code for this float. - */ - -static VALUE -flo_hash(num) - VALUE num; -{ - double d; - char *c; - int i, hash; - - d = RFLOAT(num)->value; - if (d == 0) d = fabs(d); - c = (char*)&d; - for (hash=0, i=0; i b) return INT2FIX(1); - if (a < b) return INT2FIX(-1); - return Qnil; -} - -/* - * call-seq: - * flt <=> numeric => -1, 0, +1 - * - * Returns -1, 0, or +1 depending on whether flt is less than, - * equal to, or greater than numeric. This is the basis for the - * tests in Comparable. - */ - -static VALUE -flo_cmp(x, y) - VALUE x, y; -{ - double a, b; - - a = RFLOAT(x)->value; - switch (TYPE(y)) { - case T_FIXNUM: - b = (double)FIX2LONG(y); - break; - - case T_BIGNUM: - if (isinf(a)) { - if (a > 0.0) return INT2FIX(1); - else return INT2FIX(-1); - } - b = rb_big2dbl(y); - break; - - case T_FLOAT: - b = RFLOAT(y)->value; - break; - - default: - return rb_num_coerce_cmp(x, y); - } - return rb_dbl_cmp(a, b); -} - -/* - * call-seq: - * flt > other => true or false - * - * true if flt is greater than other. - */ - -static VALUE -flo_gt(x, y) - VALUE x, y; -{ - double a, b; - - a = RFLOAT(x)->value; - switch (TYPE(y)) { - case T_FIXNUM: - b = (double)FIX2LONG(y); - break; - - case T_BIGNUM: - b = rb_big2dbl(y); - break; - - case T_FLOAT: - b = RFLOAT(y)->value; - if (isnan(b)) return Qfalse; - break; - - default: - return rb_num_coerce_relop(x, y); - } - if (isnan(a)) return Qfalse; - return (a > b)?Qtrue:Qfalse; -} - -/* - * call-seq: - * flt >= other => true or false - * - * true if flt is greater than - * or equal to other. - */ - -static VALUE -flo_ge(x, y) - VALUE x, y; -{ - double a, b; - - a = RFLOAT(x)->value; - switch (TYPE(y)) { - case T_FIXNUM: - b = (double)FIX2LONG(y); - break; - - case T_BIGNUM: - b = rb_big2dbl(y); - break; - - case T_FLOAT: - b = RFLOAT(y)->value; - if (isnan(b)) return Qfalse; - break; - - default: - return rb_num_coerce_relop(x, y); - } - if (isnan(a)) return Qfalse; - return (a >= b)?Qtrue:Qfalse; -} - -/* - * call-seq: - * flt < other => true or false - * - * true if flt is less than other. - */ - -static VALUE -flo_lt(x, y) - VALUE x, y; -{ - double a, b; - - a = RFLOAT(x)->value; - switch (TYPE(y)) { - case T_FIXNUM: - b = (double)FIX2LONG(y); - break; - - case T_BIGNUM: - b = rb_big2dbl(y); - break; - - case T_FLOAT: - b = RFLOAT(y)->value; - if (isnan(b)) return Qfalse; - break; - - default: - return rb_num_coerce_relop(x, y); - } - if (isnan(a)) return Qfalse; - return (a < b)?Qtrue:Qfalse; -} - -/* - * call-seq: - * flt <= other => true or false - * - * true if flt is less than - * or equal to other. - */ - -static VALUE -flo_le(x, y) - VALUE x, y; -{ - double a, b; - - a = RFLOAT(x)->value; - switch (TYPE(y)) { - case T_FIXNUM: - b = (double)FIX2LONG(y); - break; - - case T_BIGNUM: - b = rb_big2dbl(y); - break; - - case T_FLOAT: - b = RFLOAT(y)->value; - if (isnan(b)) return Qfalse; - break; - - default: - return rb_num_coerce_relop(x, y); - } - if (isnan(a)) return Qfalse; - return (a <= b)?Qtrue:Qfalse; -} - -/* - * call-seq: - * flt.eql?(obj) => true or false - * - * Returns true only if obj is a - * Float with the same value as flt. Contrast this - * with Float#==, which performs type conversions. - * - * 1.0.eql?(1) #=> false - */ - -static VALUE -flo_eql(x, y) - VALUE x, y; -{ - if (TYPE(y) == T_FLOAT) { - double a = RFLOAT(x)->value; - double b = RFLOAT(y)->value; - - if (isnan(a) || isnan(b)) return Qfalse; - if (a == b) return Qtrue; - } - return Qfalse; -} - -/* - * call-seq: - * flt.to_f => flt - * - * As flt is already a float, returns self. - */ - -static VALUE -flo_to_f(num) - VALUE num; -{ - return num; -} - -/* - * call-seq: - * flt.abs => float - * - * Returns the absolute value of flt. - * - * (-34.56).abs #=> 34.56 - * -34.56.abs #=> 34.56 - * - */ - -static VALUE -flo_abs(flt) - VALUE flt; -{ - double val = fabs(RFLOAT(flt)->value); - return rb_float_new(val); -} - -/* - * call-seq: - * flt.zero? -> true or false - * - * Returns true if flt is 0.0. - * - */ - -static VALUE -flo_zero_p(num) - VALUE num; -{ - if (RFLOAT(num)->value == 0.0) { - return Qtrue; - } - return Qfalse; -} - -/* - * call-seq: - * flt.nan? -> true or false - * - * Returns true if flt is an invalid IEEE floating - * point number. - * - * a = -1.0 #=> -1.0 - * a.nan? #=> false - * a = 0.0/0.0 #=> NaN - * a.nan? #=> true - */ - -static VALUE -flo_is_nan_p(num) - VALUE num; -{ - double value = RFLOAT(num)->value; - - return isnan(value) ? Qtrue : Qfalse; -} - -/* - * call-seq: - * flt.infinite? -> nil, -1, +1 - * - * Returns nil, -1, or +1 depending on whether flt - * is finite, -infinity, or +infinity. - * - * (0.0).infinite? #=> nil - * (-1.0/0.0).infinite? #=> -1 - * (+1.0/0.0).infinite? #=> 1 - */ - -static VALUE -flo_is_infinite_p(num) - VALUE num; -{ - double value = RFLOAT(num)->value; - - if (isinf(value)) { - return INT2FIX( value < 0 ? -1 : 1 ); - } - - return Qnil; -} - -/* - * call-seq: - * flt.finite? -> true or false - * - * Returns true if flt is a valid IEEE floating - * point number (it is not infinite, and nan? is - * false). - * - */ - -static VALUE -flo_is_finite_p(num) - VALUE num; -{ - double value = RFLOAT(num)->value; - -#if HAVE_FINITE - if (!finite(value)) - return Qfalse; -#else - if (isinf(value) || isnan(value)) - return Qfalse; -#endif - - return Qtrue; -} - -/* - * call-seq: - * flt.floor => integer - * - * Returns the largest integer less than or equal to flt. - * - * 1.2.floor #=> 1 - * 2.0.floor #=> 2 - * (-1.2).floor #=> -2 - * (-2.0).floor #=> -2 - */ - -static VALUE -flo_floor(num) - VALUE num; -{ - double f = floor(RFLOAT(num)->value); - long val; - - if (!FIXABLE(f)) { - return rb_dbl2big(f); - } - val = f; - return LONG2FIX(val); -} - -/* - * call-seq: - * flt.ceil => integer - * - * Returns the smallest Integer greater than or equal to - * flt. - * - * 1.2.ceil #=> 2 - * 2.0.ceil #=> 2 - * (-1.2).ceil #=> -1 - * (-2.0).ceil #=> -2 - */ - -static VALUE -flo_ceil(num) - VALUE num; -{ - double f = ceil(RFLOAT(num)->value); - long val; - - if (!FIXABLE(f)) { - return rb_dbl2big(f); - } - val = f; - return LONG2FIX(val); -} - -/* - * call-seq: - * flt.round => integer - * - * Rounds flt to the nearest integer. Equivalent to: - * - * def round - * return (self+0.5).floor if self > 0.0 - * return (self-0.5).ceil if self < 0.0 - * return 0 - * end - * - * 1.5.round #=> 2 - * (-1.5).round #=> -2 - * - */ - -static VALUE -flo_round(num) - VALUE num; -{ - double f = RFLOAT(num)->value; - long val; - - f = round(f); - - if (!FIXABLE(f)) { - return rb_dbl2big(f); - } - val = f; - return LONG2FIX(val); -} - -/* - * call-seq: - * flt.to_i => integer - * flt.to_int => integer - * flt.truncate => integer - * - * Returns flt truncated to an Integer. - */ - -static VALUE -flo_truncate(num) - VALUE num; -{ - double f = RFLOAT(num)->value; - long val; - - if (f > 0.0) f = floor(f); - if (f < 0.0) f = ceil(f); - - if (!FIXABLE(f)) { - return rb_dbl2big(f); - } - val = f; - return LONG2FIX(val); -} - - -/* - * call-seq: - * num.floor => integer - * - * Returns the largest integer less than or equal to num. - * Numeric implements this by converting anInteger - * to a Float and invoking Float#floor. - * - * 1.floor #=> 1 - * (-1).floor #=> -1 - */ - -static VALUE -num_floor(num) - VALUE num; -{ - return flo_floor(rb_Float(num)); -} - - -/* - * call-seq: - * num.ceil => integer - * - * Returns the smallest Integer greater than or equal to - * num. Class Numeric achieves this by converting - * itself to a Float then invoking - * Float#ceil. - * - * 1.ceil #=> 1 - * 1.2.ceil #=> 2 - * (-1.2).ceil #=> -1 - * (-1.0).ceil #=> -1 - */ - -static VALUE -num_ceil(num) - VALUE num; -{ - return flo_ceil(rb_Float(num)); -} - -/* - * call-seq: - * num.round => integer - * - * Rounds num to the nearest integer. Numeric - * implements this by converting itself to a - * Float and invoking Float#round. - */ - -static VALUE -num_round(num) - VALUE num; -{ - return flo_round(rb_Float(num)); -} - -/* - * call-seq: - * num.truncate => integer - * - * Returns num truncated to an integer. Numeric - * implements this by converting its value to a float and invoking - * Float#truncate. - */ - -static VALUE -num_truncate(num) - VALUE num; -{ - return flo_truncate(rb_Float(num)); -} - - -/* - * call-seq: - * num.step(limit, step ) {|i| block } => num - * - * Invokes block with the sequence of numbers starting at - * num, incremented by step on each call. The loop - * finishes when the value to be passed to the block is greater than - * limit (if step is positive) or less than - * limit (if step is negative). If all the arguments are - * integers, the loop operates using an integer counter. If any of the - * arguments are floating point numbers, all are converted to floats, - * and the loop is executed floor(n + n*epsilon)+ 1 times, - * where n = (limit - num)/step. Otherwise, the loop - * starts at num, uses either the < or - * > operator to compare the counter against - * limit, and increments itself using the + - * operator. - * - * 1.step(10, 2) { |i| print i, " " } - * Math::E.step(Math::PI, 0.2) { |f| print f, " " } - * - * produces: - * - * 1 3 5 7 9 - * 2.71828182845905 2.91828182845905 3.11828182845905 - */ - -static VALUE -num_step(argc, argv, from) - int argc; - VALUE *argv; - VALUE from; -{ - VALUE to, step; - - if (argc == 1) { - to = argv[0]; - step = INT2FIX(1); - } - else { - if (argc == 2) { - to = argv[0]; - step = argv[1]; - } - else { - rb_raise(rb_eArgError, "wrong number of arguments"); - } - if (rb_equal(step, INT2FIX(0))) { - rb_raise(rb_eArgError, "step can't be 0"); - } - } - - if (FIXNUM_P(from) && FIXNUM_P(to) && FIXNUM_P(step)) { - long i, end, diff; - - i = FIX2LONG(from); - end = FIX2LONG(to); - diff = FIX2LONG(step); - - if (diff > 0) { - while (i <= end) { - rb_yield(LONG2FIX(i)); - i += diff; - } - } - else { - while (i >= end) { - rb_yield(LONG2FIX(i)); - i += diff; - } - } - } - else if (TYPE(from) == T_FLOAT || TYPE(to) == T_FLOAT || TYPE(step) == T_FLOAT) { - const double epsilon = DBL_EPSILON; - double beg = NUM2DBL(from); - double end = NUM2DBL(to); - double unit = NUM2DBL(step); - double n = (end - beg)/unit; - double err = (fabs(beg) + fabs(end) + fabs(end-beg)) / fabs(unit) * epsilon; - long i; - - if (err>0.5) err=0.5; - n = floor(n + err) + 1; - for (i=0; i', 1, INT2FIX(0)))) { - cmp = '>'; - } - else { - cmp = '<'; - } - for (;;) { - if (RTEST(rb_funcall(i, cmp, 1, to))) break; - rb_yield(i); - i = rb_funcall(i, '+', 1, step); - } - } - return from; -} - -long -rb_num2long(val) - VALUE val; -{ - again: - if (NIL_P(val)) { - rb_raise(rb_eTypeError, "no implicit conversion from nil to integer"); - } - - if (FIXNUM_P(val)) return FIX2LONG(val); - - switch (TYPE(val)) { - case T_FLOAT: - if (RFLOAT(val)->value <= (double)LONG_MAX - && RFLOAT(val)->value >= (double)LONG_MIN) { - return (long)(RFLOAT(val)->value); - } - else { - char buf[24]; - char *s; - - sprintf(buf, "%-.10g", RFLOAT(val)->value); - if ((s = strchr(buf, ' ')) != 0) *s = '\0'; - rb_raise(rb_eRangeError, "float %s out of range of integer", buf); - } - - case T_BIGNUM: - return rb_big2long(val); - - default: - val = rb_to_int(val); - goto again; - } -} - -unsigned long -rb_num2ulong(val) - VALUE val; -{ - if (TYPE(val) == T_BIGNUM) { - return rb_big2ulong(val); - } - return (unsigned long)rb_num2long(val); -} - -#if SIZEOF_INT < SIZEOF_LONG -static void -check_int(num) - long num; -{ - const char *s; - - if (num < INT_MIN) { - s = "small"; - } - else if (num > INT_MAX) { - s = "big"; - } - else { - return; - } - rb_raise(rb_eRangeError, "integer %ld too %s to convert to `int'", num, s); -} - -static void -check_uint(num, sign) - unsigned long num; - VALUE sign; -{ - static const unsigned long mask = ~(unsigned long)UINT_MAX; - - if (RTEST(sign)) { - /* minus */ - if ((num & mask) != mask || (num & ~mask) <= INT_MAX + 1UL) - rb_raise(rb_eRangeError, "integer %ld too small to convert to `unsigned int'", num); - } - else { - /* plus */ - if ((num & mask) != 0) - rb_raise(rb_eRangeError, "integer %lu too big to convert to `unsigned int'", num); - } -} - -long -rb_num2int(val) - VALUE val; -{ - long num = rb_num2long(val); - - check_int(num); - return num; -} - -long -rb_fix2int(val) - VALUE val; -{ - long num = FIXNUM_P(val)?FIX2LONG(val):rb_num2long(val); - - check_int(num); - return num; -} - -unsigned long -rb_num2uint(val) - VALUE val; -{ - unsigned long num = rb_num2ulong(val); - - check_uint(num, rb_funcall(val, '<', 1, INT2FIX(0))); - return num; -} - -unsigned long -rb_fix2uint(val) - VALUE val; -{ - unsigned long num; - - if (!FIXNUM_P(val)) { - return rb_num2uint(val); - } - num = FIX2ULONG(val); - - check_uint(num, rb_funcall(val, '<', 1, INT2FIX(0))); - return num; -} -#else -long -rb_num2int(val) - VALUE val; -{ - return rb_num2long(val); -} - -long -rb_fix2int(val) - VALUE val; -{ - return FIX2INT(val); -} -#endif - -VALUE -rb_num2fix(val) - VALUE val; -{ - long v; - - if (FIXNUM_P(val)) return val; - - v = rb_num2long(val); - if (!FIXABLE(v)) - rb_raise(rb_eRangeError, "integer %ld out of range of fixnum", v); - return LONG2FIX(v); -} - -#if HAVE_LONG_LONG - -LONG_LONG -rb_num2ll(val) - VALUE val; -{ - if (NIL_P(val)) { - rb_raise(rb_eTypeError, "no implicit conversion from nil"); - } - - if (FIXNUM_P(val)) return (LONG_LONG)FIX2LONG(val); - - switch (TYPE(val)) { - case T_FLOAT: - if (RFLOAT(val)->value <= (double)LLONG_MAX - && RFLOAT(val)->value >= (double)LLONG_MIN) { - return (LONG_LONG)(RFLOAT(val)->value); - } - else { - char buf[24]; - char *s; - - sprintf(buf, "%-.10g", RFLOAT(val)->value); - if ((s = strchr(buf, ' ')) != 0) *s = '\0'; - rb_raise(rb_eRangeError, "float %s out of range of long long", buf); - } - - case T_BIGNUM: - return rb_big2ll(val); - - case T_STRING: - rb_raise(rb_eTypeError, "no implicit conversion from string"); - return Qnil; /* not reached */ - - case T_TRUE: - case T_FALSE: - rb_raise(rb_eTypeError, "no implicit conversion from boolean"); - return Qnil; /* not reached */ - - default: - val = rb_to_int(val); - return NUM2LL(val); - } -} - -unsigned LONG_LONG -rb_num2ull(val) - VALUE val; -{ - if (TYPE(val) == T_BIGNUM) { - return rb_big2ull(val); - } - return (unsigned LONG_LONG)rb_num2ll(val); -} - -#endif /* HAVE_LONG_LONG */ - - -/* - * Document-class: Integer - * - * Integer is the basis for the two concrete classes that - * hold whole numbers, Bignum and Fixnum. - * - */ - - -/* - * call-seq: - * int.to_i => int - * int.to_int => int - * int.floor => int - * int.ceil => int - * int.round => int - * int.truncate => int - * - * As int is already an Integer, all these - * methods simply return the receiver. - */ - -static VALUE -int_to_i(num) - VALUE num; -{ - return num; -} - -/* - * call-seq: - * int.integer? -> true - * - * Always returns true. - */ - -static VALUE -int_int_p(num) - VALUE num; -{ - return Qtrue; -} - -/* - * call-seq: - * int.next => integer - * int.succ => integer - * - * Returns the Integer equal to int + 1. - * - * 1.next #=> 2 - * (-1).next #=> 0 - */ - -static VALUE -int_succ(num) - VALUE num; -{ - if (FIXNUM_P(num)) { - long i = FIX2LONG(num) + 1; - return LONG2NUM(i); - } - return rb_funcall(num, '+', 1, INT2FIX(1)); -} - -/* - * call-seq: - * int.chr => string - * - * Returns a string containing the ASCII character represented by the - * receiver's value. - * - * 65.chr #=> "A" - * ?a.chr #=> "a" - * 230.chr #=> "\346" - */ - -static VALUE -int_chr(num) - VALUE num; -{ - char c; - long i = NUM2LONG(num); - - if (i < 0 || 0xff < i) - rb_raise(rb_eRangeError, "%ld out of char range", i); - c = i; - return rb_str_new(&c, 1); -} - -/******************************************************************** - * - * Document-class: Fixnum - * - * A Fixnum holds Integer values that can be - * represented in a native machine word (minus 1 bit). If any operation - * on a Fixnum exceeds this range, the value is - * automatically converted to a Bignum. - * - * Fixnum objects have immediate value. This means that - * when they are assigned or passed as parameters, the actual object is - * passed, rather than a reference to that object. Assignment does not - * alias Fixnum objects. There is effectively only one - * Fixnum object instance for any given integer value, so, - * for example, you cannot add a singleton method to a - * Fixnum. - */ - - -/* - * call-seq: - * Fixnum.induced_from(obj) => fixnum - * - * Convert obj to a Fixnum. Works with numeric parameters. - * Also works with Symbols, but this is deprecated. - */ - -static VALUE -rb_fix_induced_from(klass, x) - VALUE klass, x; -{ - return rb_num2fix(x); -} - -/* - * call-seq: - * Integer.induced_from(obj) => fixnum, bignum - * - * Convert obj to an Integer. - */ - -static VALUE -rb_int_induced_from(klass, x) - VALUE klass, x; -{ - switch (TYPE(x)) { - case T_FIXNUM: - case T_BIGNUM: - return x; - case T_FLOAT: - return rb_funcall(x, id_to_i, 0); - default: - rb_raise(rb_eTypeError, "failed to convert %s into Integer", - rb_obj_classname(x)); - } -} - -/* - * call-seq: - * Float.induced_from(obj) => float - * - * Convert obj to a float. - */ - -static VALUE -rb_flo_induced_from(klass, x) - VALUE klass, x; -{ - switch (TYPE(x)) { - case T_FIXNUM: - case T_BIGNUM: - return rb_funcall(x, rb_intern("to_f"), 0); - case T_FLOAT: - return x; - default: - rb_raise(rb_eTypeError, "failed to convert %s into Float", - rb_obj_classname(x)); - } -} - -/* - * call-seq: - * -fix => integer - * - * Negates fix (which might return a Bignum). - */ - -static VALUE -fix_uminus(num) - VALUE num; -{ - return LONG2NUM(-FIX2LONG(num)); -} - -VALUE -rb_fix2str(x, base) - VALUE x; - int base; -{ - extern const char ruby_digitmap[]; - char buf[SIZEOF_LONG*CHAR_BIT + 2], *b = buf + sizeof buf; - long val = FIX2LONG(x); - int neg = 0; - - if (base < 2 || 36 < base) { - rb_raise(rb_eArgError, "illegal radix %d", base); - } - if (val == 0) { - return rb_str_new2("0"); - } - if (val < 0) { - val = -val; - neg = 1; - } - *--b = '\0'; - do { - *--b = ruby_digitmap[(int)(val % base)]; - } while (val /= base); - if (neg) { - *--b = '-'; - } - - return rb_str_new2(b); -} - -/* - * call-seq: - * fix.to_s( base=10 ) -> aString - * - * Returns a string containing the representation of fix radix - * base (between 2 and 36). - * - * 12345.to_s #=> "12345" - * 12345.to_s(2) #=> "11000000111001" - * 12345.to_s(8) #=> "30071" - * 12345.to_s(10) #=> "12345" - * 12345.to_s(16) #=> "3039" - * 12345.to_s(36) #=> "9ix" - * - */ -static VALUE -fix_to_s(argc, argv, x) - int argc; - VALUE *argv; - VALUE x; -{ - VALUE b; - int base; - - rb_scan_args(argc, argv, "01", &b); - if (argc == 0) base = 10; - else base = NUM2INT(b); - - return rb_fix2str(x, base); -} - -/* - * call-seq: - * fix + numeric => numeric_result - * - * Performs addition: the class of the resulting object depends on - * the class of numeric and on the magnitude of the - * result. - */ - -static VALUE -fix_plus(x, y) - VALUE x, y; -{ - if (FIXNUM_P(y)) { - long a, b, c; - VALUE r; - - a = FIX2LONG(x); - b = FIX2LONG(y); - c = a + b; - r = LONG2NUM(c); - - return r; - } - if (TYPE(y) == T_FLOAT) { - return rb_float_new((double)FIX2LONG(x) + RFLOAT(y)->value); - } - return rb_num_coerce_bin(x, y); -} - -/* - * call-seq: - * fix - numeric => numeric_result - * - * Performs subtraction: the class of the resulting object depends on - * the class of numeric and on the magnitude of the - * result. - */ - -static VALUE -fix_minus(x, y) - VALUE x, y; -{ - if (FIXNUM_P(y)) { - long a, b, c; - VALUE r; - - a = FIX2LONG(x); - b = FIX2LONG(y); - c = a - b; - r = LONG2NUM(c); - - return r; - } - if (TYPE(y) == T_FLOAT) { - return rb_float_new((double)FIX2LONG(x) - RFLOAT(y)->value); - } - return rb_num_coerce_bin(x, y); -} - -/* - * call-seq: - * fix * numeric => numeric_result - * - * Performs multiplication: the class of the resulting object depends on - * the class of numeric and on the magnitude of the - * result. - */ - -static VALUE -fix_mul(x, y) - VALUE x, y; -{ - if (FIXNUM_P(y)) { -#ifdef __HP_cc - /* avoids an optimization bug of HP aC++/ANSI C B3910B A.06.05 [Jul 25 2005] */ - volatile -#endif - long a, b, c; - VALUE r; - - a = FIX2LONG(x); - if (a == 0) return x; - - b = FIX2LONG(y); - c = a * b; - r = LONG2FIX(c); - - if (FIX2LONG(r) != c || c/a != b) { - r = rb_big_mul(rb_int2big(a), rb_int2big(b)); - } - return r; - } - if (TYPE(y) == T_FLOAT) { - return rb_float_new((double)FIX2LONG(x) * RFLOAT(y)->value); - } - return rb_num_coerce_bin(x, y); -} - -static void -fixdivmod(x, y, divp, modp) - long x, y; - long *divp, *modp; -{ - long div, mod; - - if (y == 0) rb_num_zerodiv(); - if (y < 0) { - if (x < 0) - div = -x / -y; - else - div = - (x / -y); - } - else { - if (x < 0) - div = - (-x / y); - else - div = x / y; - } - mod = x - div*y; - if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) { - mod += y; - div -= 1; - } - if (divp) *divp = div; - if (modp) *modp = mod; -} - -/* - * call-seq: - * fix.quo(numeric) => float - * - * Returns the floating point result of dividing fix by - * numeric. - * - * 654321.quo(13731) #=> 47.6528293642124 - * 654321.quo(13731.24) #=> 47.6519964693647 - * - */ - -static VALUE -fix_quo(x, y) - VALUE x, y; -{ - if (FIXNUM_P(y)) { - return rb_float_new((double)FIX2LONG(x) / (double)FIX2LONG(y)); - } - return rb_num_coerce_bin(x, y); -} - -/* - * call-seq: - * fix / numeric => numeric_result - * fix.div(numeric) => numeric_result - * - * Performs division: the class of the resulting object depends on - * the class of numeric and on the magnitude of the - * result. - */ - -static VALUE -fix_div(x, y) - VALUE x, y; -{ - if (FIXNUM_P(y)) { - long div; - - fixdivmod(FIX2LONG(x), FIX2LONG(y), &div, 0); - return LONG2NUM(div); - } - return rb_num_coerce_bin(x, y); -} - -/* - * call-seq: - * fix % other => Numeric - * fix.modulo(other) => Numeric - * - * Returns fix modulo other. - * See Numeric.divmod for more information. - */ - -static VALUE -fix_mod(x, y) - VALUE x, y; -{ - if (FIXNUM_P(y)) { - long mod; - - fixdivmod(FIX2LONG(x), FIX2LONG(y), 0, &mod); - return LONG2NUM(mod); - } - return rb_num_coerce_bin(x, y); -} - -/* - * call-seq: - * fix.divmod(numeric) => array - * - * See Numeric#divmod. - */ -static VALUE -fix_divmod(x, y) - VALUE x, y; -{ - if (FIXNUM_P(y)) { - long div, mod; - - fixdivmod(FIX2LONG(x), FIX2LONG(y), &div, &mod); - - return rb_assoc_new(LONG2NUM(div), LONG2NUM(mod)); - } - return rb_num_coerce_bin(x, y); -} - -static VALUE -int_even_p(VALUE num) -{ - if (rb_funcall(num, '%', 1, INT2FIX(2)) == INT2FIX(0)) { - return Qtrue; - } - return Qfalse; -} - -/* - * call-seq: - * fix ** other => Numeric - * - * Raises fix to the other power, which may - * be negative or fractional. - * - * 2 ** 3 #=> 8 - * 2 ** -1 #=> 0.5 - * 2 ** 0.5 #=> 1.4142135623731 - */ - -static VALUE -fix_pow(x, y) - VALUE x, y; -{ - static const double zero = 0.0; - long a = FIX2LONG(x); - - if (FIXNUM_P(y)) { - long b; - - b = FIX2LONG(y); - if (b == 0) return INT2FIX(1); - if (b == 1) return x; - a = FIX2LONG(x); - if (a == 0) { - if (b > 0) return INT2FIX(0); - return rb_float_new(1.0 / zero); - } - if (a == 1) return INT2FIX(1); - if (a == -1) { - if (b % 2 == 0) - return INT2FIX(1); - else - return INT2FIX(-1); - } - if (b > 0) { - return rb_big_pow(rb_int2big(a), y); - } - return rb_float_new(pow((double)a, (double)b)); - } - switch (TYPE(y)) { - case T_BIGNUM: - if (a == 0) return INT2FIX(0); - if (a == 1) return INT2FIX(1); - if (a == -1) { - if (int_even_p(y)) return INT2FIX(1); - else return INT2FIX(-1); - } - x = rb_int2big(FIX2LONG(x)); - return rb_big_pow(x, y); - case T_FLOAT: - if (a == 0) { - return rb_float_new(RFLOAT(y)->value < 0 ? (1.0 / zero) : 0.0); - } - if (a == 1) return rb_float_new(1.0); - return rb_float_new(pow((double)a, RFLOAT(y)->value)); - default: - return rb_num_coerce_bin(x, y); - } -} - -/* - * call-seq: - * fix == other - * - * Return true if fix equals other - * numerically. - * - * 1 == 2 #=> false - * 1 == 1.0 #=> true - */ - -static VALUE -fix_equal(x, y) - VALUE x, y; -{ - if (x == y) return Qtrue; - if (FIXNUM_P(y)) return Qfalse; - return num_equal(x, y); -} - -/* - * call-seq: - * fix <=> numeric => -1, 0, +1 - * - * Comparison---Returns -1, 0, or +1 depending on whether fix is - * less than, equal to, or greater than numeric. This is the - * basis for the tests in Comparable. - */ - -static VALUE -fix_cmp(x, y) - VALUE x, y; -{ - if (x == y) return INT2FIX(0); - if (FIXNUM_P(y)) { - long a = FIX2LONG(x), b = FIX2LONG(y); - - if (a > b) return INT2FIX(1); - return INT2FIX(-1); - } - else { - return rb_num_coerce_cmp(x, y); - } -} - -/* - * call-seq: - * fix > other => true or false - * - * Returns true if the value of fix is - * greater than that of other. - */ - -static VALUE -fix_gt(x, y) - VALUE x, y; -{ - if (FIXNUM_P(y)) { - long a = FIX2LONG(x), b = FIX2LONG(y); - - if (a > b) return Qtrue; - return Qfalse; - } - else { - return rb_num_coerce_relop(x, y); - } -} - -/* - * call-seq: - * fix >= other => true or false - * - * Returns true if the value of fix is - * greater than or equal to that of other. - */ - -static VALUE -fix_ge(x, y) - VALUE x, y; -{ - if (FIXNUM_P(y)) { - long a = FIX2LONG(x), b = FIX2LONG(y); - - if (a >= b) return Qtrue; - return Qfalse; - } - else { - return rb_num_coerce_relop(x, y); - } -} - -/* - * call-seq: - * fix < other => true or false - * - * Returns true if the value of fix is - * less than that of other. - */ - -static VALUE -fix_lt(x, y) - VALUE x, y; -{ - if (FIXNUM_P(y)) { - long a = FIX2LONG(x), b = FIX2LONG(y); - - if (a < b) return Qtrue; - return Qfalse; - } - else { - return rb_num_coerce_relop(x, y); - } -} - -/* - * call-seq: - * fix <= other => true or false - * - * Returns true if the value of fix is - * less thanor equal to that of other. - */ - -static VALUE -fix_le(x, y) - VALUE x, y; -{ - if (FIXNUM_P(y)) { - long a = FIX2LONG(x), b = FIX2LONG(y); - - if (a <= b) return Qtrue; - return Qfalse; - } - else { - return rb_num_coerce_relop(x, y); - } -} - -/* - * call-seq: - * ~fix => integer - * - * One's complement: returns a number where each bit is flipped. - */ - -static VALUE -fix_rev(num) - VALUE num; -{ - long val = FIX2LONG(num); - - val = ~val; - return LONG2NUM(val); -} - -static VALUE -fix_coerce(x) - VALUE x; -{ - while (!FIXNUM_P(x) && TYPE(x) != T_BIGNUM) { - x = rb_to_int(x); - } - return x; -} - -/* - * call-seq: - * fix & other => integer - * - * Bitwise AND. - */ - -static VALUE -fix_and(x, y) - VALUE x, y; -{ - long val; - - if (!FIXNUM_P(y = fix_coerce(y))) { - return rb_big_and(y, x); - } - val = FIX2LONG(x) & FIX2LONG(y); - return LONG2NUM(val); -} - -/* - * call-seq: - * fix | other => integer - * - * Bitwise OR. - */ - -static VALUE -fix_or(x, y) - VALUE x, y; -{ - long val; - - if (!FIXNUM_P(y = fix_coerce(y))) { - return rb_big_or(y, x); - } - val = FIX2LONG(x) | FIX2LONG(y); - return LONG2NUM(val); -} - -/* - * call-seq: - * fix ^ other => integer - * - * Bitwise EXCLUSIVE OR. - */ - -static VALUE -fix_xor(x, y) - VALUE x, y; -{ - long val; - - if (!FIXNUM_P(y = fix_coerce(y))) { - return rb_big_xor(y, x); - } - val = FIX2LONG(x) ^ FIX2LONG(y); - return LONG2NUM(val); -} - -static VALUE fix_lshift _((long, unsigned long)); -static VALUE fix_rshift _((long, unsigned long)); - -/* - * call-seq: - * fix << count => integer - * - * Shifts _fix_ left _count_ positions (right if _count_ is negative). - */ - -static VALUE -rb_fix_lshift(x, y) - VALUE x, y; -{ - long val, width; - - val = NUM2LONG(x); - if (!FIXNUM_P(y)) - return rb_big_lshift(rb_int2big(val), y); - width = FIX2LONG(y); - if (width < 0) - return fix_rshift(val, (unsigned long)-width); - return fix_lshift(val, width); -} - -static VALUE -fix_lshift(val, width) - long val; - unsigned long width; -{ - if (width > (sizeof(VALUE)*CHAR_BIT-1) - || ((unsigned long)val)>>(sizeof(VALUE)*CHAR_BIT-1-width) > 0) { - return rb_big_lshift(rb_int2big(val), ULONG2NUM(width)); - } - val = val << width; - return LONG2NUM(val); -} - -/* - * call-seq: - * fix >> count => integer - * - * Shifts _fix_ right _count_ positions (left if _count_ is negative). - */ - -static VALUE -rb_fix_rshift(x, y) - VALUE x, y; -{ - long i, val; - - val = FIX2LONG(x); - if (!FIXNUM_P(y)) - return rb_big_rshift(rb_int2big(val), y); - i = FIX2LONG(y); - if (i == 0) return x; - if (i < 0) - return fix_lshift(val, (unsigned long)-i); - return fix_rshift(val, i); -} - -static VALUE -fix_rshift(long val, unsigned long i) -{ - if (i >= sizeof(long)*CHAR_BIT-1) { - if (val < 0) return INT2FIX(-1); - return INT2FIX(0); - } - val = RSHIFT(val, i); - return LONG2FIX(val); -} - -/* - * call-seq: - * fix[n] => 0, 1 - * - * Bit Reference---Returns the nth bit in the binary - * representation of fix, where fix[0] is the least - * significant bit. - * - * a = 0b11001100101010 - * 30.downto(0) do |n| print a[n] end - * - * produces: - * - * 0000000000000000011001100101010 - */ - -static VALUE -fix_aref(fix, idx) - VALUE fix, idx; -{ - long val = FIX2LONG(fix); - long i; - - if (!FIXNUM_P(idx = fix_coerce(idx))) { - idx = rb_big_norm(idx); - if (!FIXNUM_P(idx)) { - if (!RBIGNUM(idx)->sign || val >= 0) - return INT2FIX(0); - return INT2FIX(1); - } - } - i = FIX2LONG(idx); - - if (i < 0) return INT2FIX(0); - if (sizeof(VALUE)*CHAR_BIT-1 < i) { - if (val < 0) return INT2FIX(1); - return INT2FIX(0); - } - if (val & (1L< float - * - * Converts fix to a Float. - * - */ - -static VALUE -fix_to_f(num) - VALUE num; -{ - double val; - - val = (double)FIX2LONG(num); - - return rb_float_new(val); -} - -/* - * call-seq: - * fix.abs -> aFixnum - * - * Returns the absolute value of fix. - * - * -12345.abs #=> 12345 - * 12345.abs #=> 12345 - * - */ - -static VALUE -fix_abs(fix) - VALUE fix; -{ - long i = FIX2LONG(fix); - - if (i < 0) i = -i; - - return LONG2NUM(i); -} - -/* - * call-seq: - * fix.id2name -> string or nil - * - * Returns the name of the object whose symbol id is fix. If - * there is no symbol in the symbol table with this value, returns - * nil. id2name has nothing to do with the - * Object.id method. See also Fixnum#to_sym, - * String#intern, and class Symbol. - * - * symbol = :@inst_var #=> :@inst_var - * id = symbol.to_i #=> 9818 - * id.id2name #=> "@inst_var" - */ - -static VALUE -fix_id2name(fix) - VALUE fix; -{ - char *name = rb_id2name(FIX2UINT(fix)); - if (name) return rb_str_new2(name); - return Qnil; -} - - -/* - * call-seq: - * fix.to_sym -> aSymbol - * - * Returns the symbol whose integer value is fix. See also - * Fixnum#id2name. - * - * fred = :fred.to_i - * fred.id2name #=> "fred" - * fred.to_sym #=> :fred - */ - -static VALUE -fix_to_sym(fix) - VALUE fix; -{ - ID id = FIX2UINT(fix); - - if (rb_id2name(id)) { - return ID2SYM(id); - } - return Qnil; -} - - -/* - * call-seq: - * fix.size -> fixnum - * - * Returns the number of bytes in the machine representation - * of a Fixnum. - * - * 1.size #=> 4 - * -1.size #=> 4 - * 2147483647.size #=> 4 - */ - -static VALUE -fix_size(fix) - VALUE fix; -{ - return INT2FIX(sizeof(long)); -} - -/* - * call-seq: - * int.upto(limit) {|i| block } => int - * - * Iterates block, passing in integer values from int - * up to and including limit. - * - * 5.upto(10) { |i| print i, " " } - * - * produces: - * - * 5 6 7 8 9 10 - */ - -static VALUE -int_upto(from, to) - VALUE from, to; -{ - if (FIXNUM_P(from) && FIXNUM_P(to)) { - long i, end; - - end = FIX2LONG(to); - for (i = FIX2LONG(from); i <= end; i++) { - rb_yield(LONG2FIX(i)); - } - } - else { - VALUE i = from, c; - - while (!(c = rb_funcall(i, '>', 1, to))) { - rb_yield(i); - i = rb_funcall(i, '+', 1, INT2FIX(1)); - } - if (NIL_P(c)) rb_cmperr(i, to); - } - return from; -} - -/* - * call-seq: - * int.downto(limit) {|i| block } => int - * - * Iterates block, passing decreasing values from int - * down to and including limit. - * - * 5.downto(1) { |n| print n, ".. " } - * print " Liftoff!\n" - * - * produces: - * - * 5.. 4.. 3.. 2.. 1.. Liftoff! - */ - -static VALUE -int_downto(from, to) - VALUE from, to; -{ - if (FIXNUM_P(from) && FIXNUM_P(to)) { - long i, end; - - end = FIX2LONG(to); - for (i=FIX2LONG(from); i >= end; i--) { - rb_yield(LONG2FIX(i)); - } - } - else { - VALUE i = from, c; - - while (!(c = rb_funcall(i, '<', 1, to))) { - rb_yield(i); - i = rb_funcall(i, '-', 1, INT2FIX(1)); - } - if (NIL_P(c)) rb_cmperr(i, to); - } - return from; -} - -/* - * call-seq: - * int.times {|i| block } => int - * - * Iterates block int times, passing in values from zero to - * int - 1. - * - * 5.times do |i| - * print i, " " - * end - * - * produces: - * - * 0 1 2 3 4 - */ - -static VALUE -int_dotimes(num) - VALUE num; -{ - if (FIXNUM_P(num)) { - long i, end; - - end = FIX2LONG(num); - for (i=0; i true or false - * - * Returns true if fix is zero. - * - */ - -static VALUE -fix_zero_p(num) - VALUE num; -{ - if (FIX2LONG(num) == 0) { - return Qtrue; - } - return Qfalse; -} - -void -Init_Numeric() -{ -#if defined(__FreeBSD__) && __FreeBSD__ < 4 - /* allow divide by zero -- Inf */ - fpsetmask(fpgetmask() & ~(FP_X_DZ|FP_X_INV|FP_X_OFL)); -#elif defined(_UNICOSMP) - /* Turn off floating point exceptions for divide by zero, etc. */ - _set_Creg(0, 0); -#elif defined(__BORLANDC__) - /* Turn off floating point exceptions for overflow, etc. */ - _control87(MCW_EM, MCW_EM); -#endif - id_coerce = rb_intern("coerce"); - id_to_i = rb_intern("to_i"); - id_eq = rb_intern("=="); - - rb_eZeroDivError = rb_define_class("ZeroDivisionError", rb_eStandardError); - rb_eFloatDomainError = rb_define_class("FloatDomainError", rb_eRangeError); - rb_cNumeric = rb_define_class("Numeric", rb_cObject); - - rb_define_method(rb_cNumeric, "singleton_method_added", num_sadded, 1); - rb_include_module(rb_cNumeric, rb_mComparable); - rb_define_method(rb_cNumeric, "initialize_copy", num_init_copy, 1); - rb_define_method(rb_cNumeric, "coerce", num_coerce, 1); - - rb_define_method(rb_cNumeric, "+@", num_uplus, 0); - rb_define_method(rb_cNumeric, "-@", num_uminus, 0); - rb_define_method(rb_cNumeric, "<=>", num_cmp, 1); - rb_define_method(rb_cNumeric, "eql?", num_eql, 1); - rb_define_method(rb_cNumeric, "quo", num_quo, 1); - rb_define_method(rb_cNumeric, "div", num_div, 1); - rb_define_method(rb_cNumeric, "divmod", num_divmod, 1); - rb_define_method(rb_cNumeric, "modulo", num_modulo, 1); - rb_define_method(rb_cNumeric, "remainder", num_remainder, 1); - rb_define_method(rb_cNumeric, "abs", num_abs, 0); - rb_define_method(rb_cNumeric, "to_int", num_to_int, 0); - - rb_define_method(rb_cNumeric, "integer?", num_int_p, 0); - rb_define_method(rb_cNumeric, "zero?", num_zero_p, 0); - rb_define_method(rb_cNumeric, "nonzero?", num_nonzero_p, 0); - - rb_define_method(rb_cNumeric, "floor", num_floor, 0); - rb_define_method(rb_cNumeric, "ceil", num_ceil, 0); - rb_define_method(rb_cNumeric, "round", num_round, 0); - rb_define_method(rb_cNumeric, "truncate", num_truncate, 0); - rb_define_method(rb_cNumeric, "step", num_step, -1); - - rb_cInteger = rb_define_class("Integer", rb_cNumeric); - rb_undef_alloc_func(rb_cInteger); - rb_undef_method(CLASS_OF(rb_cInteger), "new"); - - rb_define_method(rb_cInteger, "integer?", int_int_p, 0); - rb_define_method(rb_cInteger, "upto", int_upto, 1); - rb_define_method(rb_cInteger, "downto", int_downto, 1); - rb_define_method(rb_cInteger, "times", int_dotimes, 0); - rb_include_module(rb_cInteger, rb_mPrecision); - rb_define_method(rb_cInteger, "succ", int_succ, 0); - rb_define_method(rb_cInteger, "next", int_succ, 0); - rb_define_method(rb_cInteger, "chr", int_chr, 0); - rb_define_method(rb_cInteger, "to_i", int_to_i, 0); - rb_define_method(rb_cInteger, "to_int", int_to_i, 0); - rb_define_method(rb_cInteger, "floor", int_to_i, 0); - rb_define_method(rb_cInteger, "ceil", int_to_i, 0); - rb_define_method(rb_cInteger, "round", int_to_i, 0); - rb_define_method(rb_cInteger, "truncate", int_to_i, 0); - - rb_cFixnum = rb_define_class("Fixnum", rb_cInteger); - rb_include_module(rb_cFixnum, rb_mPrecision); - rb_define_singleton_method(rb_cFixnum, "induced_from", rb_fix_induced_from, 1); - rb_define_singleton_method(rb_cInteger, "induced_from", rb_int_induced_from, 1); - - rb_define_method(rb_cFixnum, "to_s", fix_to_s, -1); - - rb_define_method(rb_cFixnum, "id2name", fix_id2name, 0); - rb_define_method(rb_cFixnum, "to_sym", fix_to_sym, 0); - - rb_define_method(rb_cFixnum, "-@", fix_uminus, 0); - rb_define_method(rb_cFixnum, "+", fix_plus, 1); - rb_define_method(rb_cFixnum, "-", fix_minus, 1); - rb_define_method(rb_cFixnum, "*", fix_mul, 1); - rb_define_method(rb_cFixnum, "/", fix_div, 1); - rb_define_method(rb_cFixnum, "div", fix_div, 1); - rb_define_method(rb_cFixnum, "%", fix_mod, 1); - rb_define_method(rb_cFixnum, "modulo", fix_mod, 1); - rb_define_method(rb_cFixnum, "divmod", fix_divmod, 1); - rb_define_method(rb_cFixnum, "quo", fix_quo, 1); - rb_define_method(rb_cFixnum, "**", fix_pow, 1); - - rb_define_method(rb_cFixnum, "abs", fix_abs, 0); - - rb_define_method(rb_cFixnum, "==", fix_equal, 1); - rb_define_method(rb_cFixnum, "<=>", fix_cmp, 1); - rb_define_method(rb_cFixnum, ">", fix_gt, 1); - rb_define_method(rb_cFixnum, ">=", fix_ge, 1); - rb_define_method(rb_cFixnum, "<", fix_lt, 1); - rb_define_method(rb_cFixnum, "<=", fix_le, 1); - - rb_define_method(rb_cFixnum, "~", fix_rev, 0); - rb_define_method(rb_cFixnum, "&", fix_and, 1); - rb_define_method(rb_cFixnum, "|", fix_or, 1); - rb_define_method(rb_cFixnum, "^", fix_xor, 1); - rb_define_method(rb_cFixnum, "[]", fix_aref, 1); - - rb_define_method(rb_cFixnum, "<<", rb_fix_lshift, 1); - rb_define_method(rb_cFixnum, ">>", rb_fix_rshift, 1); - - rb_define_method(rb_cFixnum, "to_f", fix_to_f, 0); - rb_define_method(rb_cFixnum, "size", fix_size, 0); - rb_define_method(rb_cFixnum, "zero?", fix_zero_p, 0); - - rb_cFloat = rb_define_class("Float", rb_cNumeric); - - rb_undef_alloc_func(rb_cFloat); - rb_undef_method(CLASS_OF(rb_cFloat), "new"); - - rb_define_singleton_method(rb_cFloat, "induced_from", rb_flo_induced_from, 1); - rb_include_module(rb_cFloat, rb_mPrecision); - - rb_define_const(rb_cFloat, "ROUNDS", INT2FIX(FLT_ROUNDS)); - rb_define_const(rb_cFloat, "RADIX", INT2FIX(FLT_RADIX)); - rb_define_const(rb_cFloat, "MANT_DIG", INT2FIX(DBL_MANT_DIG)); - rb_define_const(rb_cFloat, "DIG", INT2FIX(DBL_DIG)); - rb_define_const(rb_cFloat, "MIN_EXP", INT2FIX(DBL_MIN_EXP)); - rb_define_const(rb_cFloat, "MAX_EXP", INT2FIX(DBL_MAX_EXP)); - rb_define_const(rb_cFloat, "MIN_10_EXP", INT2FIX(DBL_MIN_10_EXP)); - rb_define_const(rb_cFloat, "MAX_10_EXP", INT2FIX(DBL_MAX_10_EXP)); - rb_define_const(rb_cFloat, "MIN", rb_float_new(DBL_MIN)); - rb_define_const(rb_cFloat, "MAX", rb_float_new(DBL_MAX)); - rb_define_const(rb_cFloat, "EPSILON", rb_float_new(DBL_EPSILON)); - - rb_define_method(rb_cFloat, "to_s", flo_to_s, 0); - rb_define_method(rb_cFloat, "coerce", flo_coerce, 1); - rb_define_method(rb_cFloat, "-@", flo_uminus, 0); - rb_define_method(rb_cFloat, "+", flo_plus, 1); - rb_define_method(rb_cFloat, "-", flo_minus, 1); - rb_define_method(rb_cFloat, "*", flo_mul, 1); - rb_define_method(rb_cFloat, "/", flo_div, 1); - rb_define_method(rb_cFloat, "%", flo_mod, 1); - rb_define_method(rb_cFloat, "modulo", flo_mod, 1); - rb_define_method(rb_cFloat, "divmod", flo_divmod, 1); - rb_define_method(rb_cFloat, "**", flo_pow, 1); - rb_define_method(rb_cFloat, "==", flo_eq, 1); - rb_define_method(rb_cFloat, "<=>", flo_cmp, 1); - rb_define_method(rb_cFloat, ">", flo_gt, 1); - rb_define_method(rb_cFloat, ">=", flo_ge, 1); - rb_define_method(rb_cFloat, "<", flo_lt, 1); - rb_define_method(rb_cFloat, "<=", flo_le, 1); - rb_define_method(rb_cFloat, "eql?", flo_eql, 1); - rb_define_method(rb_cFloat, "hash", flo_hash, 0); - rb_define_method(rb_cFloat, "to_f", flo_to_f, 0); - rb_define_method(rb_cFloat, "abs", flo_abs, 0); - rb_define_method(rb_cFloat, "zero?", flo_zero_p, 0); - - rb_define_method(rb_cFloat, "to_i", flo_truncate, 0); - rb_define_method(rb_cFloat, "to_int", flo_truncate, 0); - rb_define_method(rb_cFloat, "floor", flo_floor, 0); - rb_define_method(rb_cFloat, "ceil", flo_ceil, 0); - rb_define_method(rb_cFloat, "round", flo_round, 0); - rb_define_method(rb_cFloat, "truncate", flo_truncate, 0); - - rb_define_method(rb_cFloat, "nan?", flo_is_nan_p, 0); - rb_define_method(rb_cFloat, "infinite?", flo_is_infinite_p, 0); - rb_define_method(rb_cFloat, "finite?", flo_is_finite_p, 0); -} -/********************************************************************** - - object.c - - - $Author: shyouhei $ - $Date: 2008-06-18 08:21:30 +0200 (Wed, 18 Jun 2008) $ - created at: Thu Jul 15 12:01:24 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#include "ruby.h" -#include "st.h" -#include "util.h" -#include -#include -#include -#include - -VALUE rb_mKernel; -VALUE rb_cObject; -VALUE rb_cModule; -VALUE rb_cClass; -VALUE rb_cData; - -VALUE rb_cNilClass; -VALUE rb_cTrueClass; -VALUE rb_cFalseClass; -VALUE rb_cSymbol; - -static ID id_eq, id_eql, id_inspect, id_init_copy; - -/* - * call-seq: - * obj === other => true or false - * - * Case Equality---For class Object, effectively the same - * as calling #==, but typically overridden by descendents - * to provide meaningful semantics in case statements. - */ - -VALUE -rb_equal(obj1, obj2) - VALUE obj1, obj2; -{ - VALUE result; - - if (obj1 == obj2) return Qtrue; - result = rb_funcall(obj1, id_eq, 1, obj2); - if (RTEST(result)) return Qtrue; - return Qfalse; -} - -int -rb_eql(obj1, obj2) - VALUE obj1, obj2; -{ - return RTEST(rb_funcall(obj1, id_eql, 1, obj2)); -} - -/* - * call-seq: - * obj == other => true or false - * obj.equal?(other) => true or false - * obj.eql?(other) => true or false - * - * Equality---At the Object level, == returns - * true only if obj and other are the - * same object. Typically, this method is overridden in descendent - * classes to provide class-specific meaning. - * - * Unlike ==, the equal? method should never be - * overridden by subclasses: it is used to determine object identity - * (that is, a.equal?(b) iff a is the same - * object as b). - * - * The eql? method returns true if - obj and anObject have the - * same value. Used by Hash to test members for equality. - * For objects of class Object, eql? is - * synonymous with ==. Subclasses normally continue this - * tradition, but there are exceptions. Numeric types, for - * example, perform type conversion across ==, but not - * across eql?, so: - * - * 1 == 1.0 #=> true - * 1.eql? 1.0 #=> false - */ - -static VALUE -rb_obj_equal(obj1, obj2) - VALUE obj1, obj2; -{ - if (obj1 == obj2) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * obj.id => fixnum - * - * Soon-to-be deprecated version of Object#object_id. - */ - -VALUE -rb_obj_id_obsolete(obj) - VALUE obj; -{ - rb_warn("Object#id will be deprecated; use Object#object_id"); - return rb_obj_id(obj); -} - -VALUE -rb_class_real(cl) - VALUE cl; -{ - while (FL_TEST(cl, FL_SINGLETON) || TYPE(cl) == T_ICLASS) { - cl = RCLASS(cl)->super; - } - return cl; -} - -/* - * call-seq: - * obj.type => class - * - * Deprecated synonym for Object#class. - */ - -VALUE -rb_obj_type(obj) - VALUE obj; -{ - rb_warn("Object#type is deprecated; use Object#class"); - return rb_class_real(CLASS_OF(obj)); -} - - -/* - * call-seq: - * obj.class => class - * - * Returns the class of obj, now preferred over - * Object#type, as an object's type in Ruby is only - * loosely tied to that object's class. This method must always be - * called with an explicit receiver, as class is also a - * reserved word in Ruby. - * - * 1.class #=> Fixnum - * self.class #=> Object - */ - -VALUE -rb_obj_class(obj) - VALUE obj; -{ - return rb_class_real(CLASS_OF(obj)); -} - -static void -init_copy(dest, obj) - VALUE dest, obj; -{ - if (OBJ_FROZEN(dest)) { - rb_raise(rb_eTypeError, "[bug] frozen object (%s) allocated", rb_obj_classname(dest)); - } - RBASIC(dest)->flags &= ~(T_MASK|FL_EXIVAR); - RBASIC(dest)->flags |= RBASIC(obj)->flags & (T_MASK|FL_EXIVAR|FL_TAINT); - if (FL_TEST(obj, FL_EXIVAR)) { - rb_copy_generic_ivar(dest, obj); - } - rb_gc_copy_finalizer(dest, obj); - switch (TYPE(obj)) { - case T_OBJECT: - case T_CLASS: - case T_MODULE: - if (ROBJECT(dest)->iv_tbl) { - st_free_table(ROBJECT(dest)->iv_tbl); - ROBJECT(dest)->iv_tbl = 0; - } - if (ROBJECT(obj)->iv_tbl) { - ROBJECT(dest)->iv_tbl = st_copy(ROBJECT(obj)->iv_tbl); - } - } - rb_funcall(dest, id_init_copy, 1, obj); -} - -/* - * call-seq: - * obj.clone -> an_object - * - * Produces a shallow copy of obj---the instance variables of - * obj are copied, but not the objects they reference. Copies - * the frozen and tainted state of obj. See also the discussion - * under Object#dup. - * - * class Klass - * attr_accessor :str - * end - * s1 = Klass.new #=> # - * s1.str = "Hello" #=> "Hello" - * s2 = s1.clone #=> # - * s2.str[1,4] = "i" #=> "i" - * s1.inspect #=> "#" - * s2.inspect #=> "#" - * - * This method may have class-specific behavior. If so, that - * behavior will be documented under the #+initialize_copy+ method of - * the class. - */ - -VALUE -rb_obj_clone(obj) - VALUE obj; -{ - VALUE clone; - - if (rb_special_const_p(obj)) { - rb_raise(rb_eTypeError, "can't clone %s", rb_obj_classname(obj)); - } - clone = rb_obj_alloc(rb_obj_class(obj)); - RBASIC(clone)->klass = rb_singleton_class_clone(obj); - RBASIC(clone)->flags = (RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT)) & ~(FL_FREEZE|FL_FINALIZE); - init_copy(clone, obj); - RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE; - - return clone; -} - -/* - * call-seq: - * obj.dup -> an_object - * - * Produces a shallow copy of obj---the instance variables of - * obj are copied, but not the objects they reference. - * dup copies the tainted state of obj. See also - * the discussion under Object#clone. In general, - * clone and dup may have different semantics - * in descendent classes. While clone is used to duplicate - * an object, including its internal state, dup typically - * uses the class of the descendent object to create the new instance. - * - * This method may have class-specific behavior. If so, that - * behavior will be documented under the #+initialize_copy+ method of - * the class. - */ - -VALUE -rb_obj_dup(obj) - VALUE obj; -{ - VALUE dup; - - if (rb_special_const_p(obj)) { - rb_raise(rb_eTypeError, "can't dup %s", rb_obj_classname(obj)); - } - dup = rb_obj_alloc(rb_obj_class(obj)); - init_copy(dup, obj); - - return dup; -} - -/* :nodoc: */ -VALUE -rb_obj_init_copy(obj, orig) - VALUE obj, orig; -{ - if (obj == orig) return obj; - rb_check_frozen(obj); - if (TYPE(obj) != TYPE(orig) || rb_obj_class(obj) != rb_obj_class(orig)) { - rb_raise(rb_eTypeError, "initialize_copy should take same class object"); - } - return obj; -} - -/* - * call-seq: - * obj.to_a -> anArray - * - * Returns an array representation of obj. For objects of class - * Object and others that don't explicitly override the - * method, the return value is an array containing self. - * However, this latter behavior will soon be obsolete. - * - * self.to_a #=> -:1: warning: default `to_a' will be obsolete - * "hello".to_a #=> ["hello"] - * Time.new.to_a #=> [39, 54, 8, 9, 4, 2003, 3, 99, true, "CDT"] - */ - - -static VALUE -rb_any_to_a(obj) - VALUE obj; -{ - rb_warn("default `to_a' will be obsolete"); - return rb_ary_new3(1, obj); -} - - -/* - * call-seq: - * obj.to_s => string - * - * Returns a string representing obj. The default - * to_s prints the object's class and an encoding of the - * object id. As a special case, the top-level object that is the - * initial execution context of Ruby programs returns ``main.'' - */ - -VALUE -rb_any_to_s(obj) - VALUE obj; -{ - char *cname = rb_obj_classname(obj); - size_t len; - VALUE str; - - len = strlen(cname)+6+16; - str = rb_str_new(0, len); /* 6:tags 16:addr */ - snprintf(RSTRING(str)->ptr, len+1, "#<%s:0x%lx>", cname, obj); - RSTRING(str)->len = strlen(RSTRING(str)->ptr); - if (OBJ_TAINTED(obj)) OBJ_TAINT(str); - - return str; -} - -VALUE -rb_inspect(obj) - VALUE obj; -{ - return rb_obj_as_string(rb_funcall(obj, id_inspect, 0, 0)); -} - -static int -inspect_i(id, value, str) - ID id; - VALUE value; - VALUE str; -{ - VALUE str2; - char *ivname; - - /* need not to show internal data */ - if (CLASS_OF(value) == 0) return ST_CONTINUE; - if (!rb_is_instance_id(id)) return ST_CONTINUE; - if (RSTRING(str)->ptr[0] == '-') { /* first element */ - RSTRING(str)->ptr[0] = '#'; - rb_str_cat2(str, " "); - } - else { - rb_str_cat2(str, ", "); - } - ivname = rb_id2name(id); - rb_str_cat2(str, ivname); - rb_str_cat2(str, "="); - str2 = rb_inspect(value); - rb_str_append(str, str2); - OBJ_INFECT(str, str2); - - return ST_CONTINUE; -} - -static VALUE -inspect_obj(obj, str) - VALUE obj, str; -{ - st_foreach_safe(ROBJECT(obj)->iv_tbl, inspect_i, str); - rb_str_cat2(str, ">"); - RSTRING(str)->ptr[0] = '#'; - OBJ_INFECT(str, obj); - - return str; -} - -/* - * call-seq: - * obj.inspect => string - * - * Returns a string containing a human-readable representation of - * obj. If not overridden, uses the to_s method to - * generate the string. - * - * [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" - * Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003" - */ - - -static VALUE -rb_obj_inspect(obj) - VALUE obj; -{ - if (TYPE(obj) == T_OBJECT - && ROBJECT(obj)->iv_tbl - && ROBJECT(obj)->iv_tbl->num_entries > 0) { - VALUE str; - size_t len; - char *c; - - c = rb_obj_classname(obj); - if (rb_inspecting_p(obj)) { - len = strlen(c)+10+16+1; - str = rb_str_new(0, len); /* 10:tags 16:addr 1:nul */ - snprintf(RSTRING(str)->ptr, len, "#<%s:0x%lx ...>", c, obj); - RSTRING(str)->len = strlen(RSTRING(str)->ptr); - return str; - } - len = strlen(c)+6+16+1; - str = rb_str_new(0, len); /* 6:tags 16:addr 1:nul */ - snprintf(RSTRING(str)->ptr, len, "-<%s:0x%lx", c, obj); - RSTRING(str)->len = strlen(RSTRING(str)->ptr); - return rb_protect_inspect(inspect_obj, obj, str); - } - return rb_funcall(obj, rb_intern("to_s"), 0, 0); -} - - -/* - * call-seq: - * obj.instance_of?(class) => true or false - * - * Returns true if obj is an instance of the given - * class. See also Object#kind_of?. - */ - -VALUE -rb_obj_is_instance_of(obj, c) - VALUE obj, c; -{ - switch (TYPE(c)) { - case T_MODULE: - case T_CLASS: - case T_ICLASS: - break; - default: - rb_raise(rb_eTypeError, "class or module required"); - } - - if (rb_obj_class(obj) == c) return Qtrue; - return Qfalse; -} - - -/* - * call-seq: - * obj.is_a?(class) => true or false - * obj.kind_of?(class) => true or false - * - * Returns true if class is the class of - * obj, or if class is one of the superclasses of - * obj or modules included in obj. - * - * module M; end - * class A - * include M - * end - * class B < A; end - * class C < B; end - * b = B.new - * b.instance_of? A #=> false - * b.instance_of? B #=> true - * b.instance_of? C #=> false - * b.instance_of? M #=> false - * b.kind_of? A #=> true - * b.kind_of? B #=> true - * b.kind_of? C #=> false - * b.kind_of? M #=> true - */ - -VALUE -rb_obj_is_kind_of(obj, c) - VALUE obj, c; -{ - VALUE cl = CLASS_OF(obj); - - switch (TYPE(c)) { - case T_MODULE: - case T_CLASS: - case T_ICLASS: - break; - - default: - rb_raise(rb_eTypeError, "class or module required"); - } - - while (cl) { - if (cl == c || RCLASS(cl)->m_tbl == RCLASS(c)->m_tbl) - return Qtrue; - cl = RCLASS(cl)->super; - } - return Qfalse; -} - - -/* - * Document-method: inherited - * - * call-seq: - * inherited(subclass) - * - * Callback invoked whenever a subclass of the current class is created. - * - * Example: - * - * class Foo - * def self.inherited(subclass) - * puts "New subclass: #{subclass}" - * end - * end - * - * class Bar < Foo - * end - * - * class Baz < Bar - * end - * - * produces: - * - * New subclass: Bar - * New subclass: Baz - */ - -/* - * Document-method: singleton_method_added - * - * call-seq: - * singleton_method_added(symbol) - * - * Invoked as a callback whenever a singleton method is added to the - * receiver. - * - * module Chatty - * def Chatty.singleton_method_added(id) - * puts "Adding #{id.id2name}" - * end - * def self.one() end - * def two() end - * def Chatty.three() end - * end - * - * produces: - * - * Adding singleton_method_added - * Adding one - * Adding three - * - */ - -/* - * Document-method: singleton_method_removed - * - * call-seq: - * singleton_method_removed(symbol) - * - * Invoked as a callback whenever a singleton method is removed from - * the receiver. - * - * module Chatty - * def Chatty.singleton_method_removed(id) - * puts "Removing #{id.id2name}" - * end - * def self.one() end - * def two() end - * def Chatty.three() end - * class <produces: - * - * Removing three - * Removing one - */ - -/* - * Document-method: singleton_method_undefined - * - * call-seq: - * singleton_method_undefined(symbol) - * - * Invoked as a callback whenever a singleton method is undefined in - * the receiver. - * - * module Chatty - * def Chatty.singleton_method_undefined(id) - * puts "Undefining #{id.id2name}" - * end - * def Chatty.one() end - * class << self - * undef_method(:one) - * end - * end - * - * produces: - * - * Undefining one - */ - - -/* - * Document-method: included - * - * call-seq: - * included( othermod ) - * - * Callback invoked whenever the receiver is included in another - * module or class. This should be used in preference to - * Module.append_features if your code wants to perform some - * action when a module is included in another. - * - * module A - * def A.included(mod) - * puts "#{self} included in #{mod}" - * end - * end - * module Enumerable - * include A - * end - */ - - -/* - * Not documented - */ - -static VALUE -rb_obj_dummy() -{ - return Qnil; -} - -/* - * call-seq: - * obj.tainted? => true or false - * - * Returns true if the object is tainted. - */ - -VALUE -rb_obj_tainted(obj) - VALUE obj; -{ - if (OBJ_TAINTED(obj)) - return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * obj.taint -> obj - * - * Marks obj as tainted---if the $SAFE level is - * set appropriately, many method calls which might alter the running - * programs environment will refuse to accept tainted strings. - */ - -VALUE -rb_obj_taint(obj) - VALUE obj; -{ - rb_secure(4); - if (!OBJ_TAINTED(obj)) { - if (OBJ_FROZEN(obj)) { - rb_error_frozen("object"); - } - OBJ_TAINT(obj); - } - return obj; -} - - -/* - * call-seq: - * obj.untaint => obj - * - * Removes the taint from obj. - */ - -VALUE -rb_obj_untaint(obj) - VALUE obj; -{ - rb_secure(3); - if (OBJ_TAINTED(obj)) { - if (OBJ_FROZEN(obj)) { - rb_error_frozen("object"); - } - FL_UNSET(obj, FL_TAINT); - } - return obj; -} - -void -rb_obj_infect(obj1, obj2) - VALUE obj1, obj2; -{ - OBJ_INFECT(obj1, obj2); -} - - -/* - * call-seq: - * obj.freeze => obj - * - * Prevents further modifications to obj. A - * TypeError will be raised if modification is attempted. - * There is no way to unfreeze a frozen object. See also - * Object#frozen?. - * - * a = [ "a", "b", "c" ] - * a.freeze - * a << "z" - * - * produces: - * - * prog.rb:3:in `<<': can't modify frozen array (TypeError) - * from prog.rb:3 - */ - -VALUE -rb_obj_freeze(obj) - VALUE obj; -{ - if (!OBJ_FROZEN(obj)) { - if (rb_safe_level() >= 4 && !OBJ_TAINTED(obj)) { - rb_raise(rb_eSecurityError, "Insecure: can't freeze object"); - } - OBJ_FREEZE(obj); - } - return obj; -} - -/* - * call-seq: - * obj.frozen? => true or false - * - * Returns the freeze status of obj. - * - * a = [ "a", "b", "c" ] - * a.freeze #=> ["a", "b", "c"] - * a.frozen? #=> true - */ - -static VALUE -rb_obj_frozen_p(obj) - VALUE obj; -{ - if (OBJ_FROZEN(obj)) return Qtrue; - return Qfalse; -} - - -/* - * Document-class: NilClass - * - * The class of the singleton object nil. - */ - -/* - * call-seq: - * nil.to_i => 0 - * - * Always returns zero. - * - * nil.to_i #=> 0 - */ - - -static VALUE -nil_to_i(obj) - VALUE obj; -{ - return INT2FIX(0); -} - -/* - * call-seq: - * nil.to_f => 0.0 - * - * Always returns zero. - * - * nil.to_f #=> 0.0 - */ - -static VALUE -nil_to_f(obj) - VALUE obj; -{ - return rb_float_new(0.0); -} - -/* - * call-seq: - * nil.to_s => "" - * - * Always returns the empty string. - * - * nil.to_s #=> "" - */ - -static VALUE -nil_to_s(obj) - VALUE obj; -{ - return rb_str_new2(""); -} - -/* - * call-seq: - * nil.to_a => [] - * - * Always returns an empty array. - * - * nil.to_a #=> [] - */ - -static VALUE -nil_to_a(obj) - VALUE obj; -{ - return rb_ary_new2(0); -} - -/* - * call-seq: - * nil.inspect => "nil" - * - * Always returns the string "nil". - */ - -static VALUE -nil_inspect(obj) - VALUE obj; -{ - return rb_str_new2("nil"); -} - -static VALUE -main_to_s(obj) - VALUE obj; -{ - return rb_str_new2("main"); -} - - -/*********************************************************************** - * Document-class: TrueClass - * - * The global value true is the only instance of class - * TrueClass and represents a logically true value in - * boolean expressions. The class provides operators allowing - * true to be used in logical expressions. - */ - - -/* - * call-seq: - * true.to_s => "true" - * - * The string representation of true is "true". - */ - -static VALUE -true_to_s(obj) - VALUE obj; -{ - return rb_str_new2("true"); -} - - -/* - * call-seq: - * true & obj => true or false - * - * And---Returns false if obj is - * nil or false, true otherwise. - */ - -static VALUE -true_and(obj, obj2) - VALUE obj, obj2; -{ - return RTEST(obj2)?Qtrue:Qfalse; -} - -/* - * call-seq: - * true | obj => true - * - * Or---Returns true. As anObject is an argument to - * a method call, it is always evaluated; there is no short-circuit - * evaluation in this case. - * - * true | puts("or") - * true || puts("logical or") - * - * produces: - * - * or - */ - -static VALUE -true_or(obj, obj2) - VALUE obj, obj2; -{ - return Qtrue; -} - - -/* - * call-seq: - * true ^ obj => !obj - * - * Exclusive Or---Returns true if obj is - * nil or false, false - * otherwise. - */ - -static VALUE -true_xor(obj, obj2) - VALUE obj, obj2; -{ - return RTEST(obj2)?Qfalse:Qtrue; -} - - -/* - * Document-class: FalseClass - * - * The global value false is the only instance of class - * FalseClass and represents a logically false value in - * boolean expressions. The class provides operators allowing - * false to participate correctly in logical expressions. - * - */ - -/* - * call-seq: - * false.to_s => "false" - * - * 'nuf said... - */ - -static VALUE -false_to_s(obj) - VALUE obj; -{ - return rb_str_new2("false"); -} - -/* - * call-seq: - * false & obj => false - * nil & obj => false - * - * And---Returns false. obj is always - * evaluated as it is the argument to a method call---there is no - * short-circuit evaluation in this case. - */ - -static VALUE -false_and(obj, obj2) - VALUE obj, obj2; -{ - return Qfalse; -} - - -/* - * call-seq: - * false | obj => true or false - * nil | obj => true or false - * - * Or---Returns false if obj is - * nil or false; true otherwise. - */ - -static VALUE -false_or(obj, obj2) - VALUE obj, obj2; -{ - return RTEST(obj2)?Qtrue:Qfalse; -} - - - -/* - * call-seq: - * false ^ obj => true or false - * nil ^ obj => true or false - * - * Exclusive Or---If obj is nil or - * false, returns false; otherwise, returns - * true. - * - */ - -static VALUE -false_xor(obj, obj2) - VALUE obj, obj2; -{ - return RTEST(obj2)?Qtrue:Qfalse; -} - -/* - * call_seq: - * nil.nil? => true - * - * Only the object nil responds true to nil?. - */ - -static VALUE -rb_true(obj) - VALUE obj; -{ - return Qtrue; -} - -/* - * call_seq: - * nil.nil? => true - * .nil? => false - * - * Only the object nil responds true to nil?. - */ - - -static VALUE -rb_false(obj) - VALUE obj; -{ - return Qfalse; -} - - -/* - * call-seq: - * obj =~ other => false - * - * Pattern Match---Overridden by descendents (notably - * Regexp and String) to provide meaningful - * pattern-match semantics. - */ - -static VALUE -rb_obj_pattern_match(obj1, obj2) - VALUE obj1, obj2; -{ - return Qfalse; -} - -/********************************************************************** - * Document-class: Symbol - * - * Symbol objects represent names and some strings - * inside the Ruby - * interpreter. They are generated using the :name and - * :"string" literals - * syntax, and by the various to_sym methods. The same - * Symbol object will be created for a given name or string - * for the duration of a program's execution, regardless of the context - * or meaning of that name. Thus if Fred is a constant in - * one context, a method in another, and a class in a third, the - * Symbol :Fred will be the same object in - * all three contexts. - * - * module One - * class Fred - * end - * $f1 = :Fred - * end - * module Two - * Fred = 1 - * $f2 = :Fred - * end - * def Fred() - * end - * $f3 = :Fred - * $f1.id #=> 2514190 - * $f2.id #=> 2514190 - * $f3.id #=> 2514190 - * - */ - -/* - * call-seq: - * sym.to_i => fixnum - * - * Returns an integer that is unique for each symbol within a - * particular execution of a program. - * - * :fred.to_i #=> 9809 - * "fred".to_sym.to_i #=> 9809 - */ - -static VALUE -sym_to_i(sym) - VALUE sym; -{ - ID id = SYM2ID(sym); - - return LONG2FIX(id); -} - - -/* :nodoc: */ - -static VALUE -sym_to_int(sym) - VALUE sym; -{ - rb_warning("treating Symbol as an integer"); - return sym_to_i(sym); -} - - -/* - * call-seq: - * sym.inspect => string - * - * Returns the representation of sym as a symbol literal. - * - * :fred.inspect #=> ":fred" - */ - -static VALUE -sym_inspect(sym) - VALUE sym; -{ - VALUE str; - char *name; - ID id = SYM2ID(sym); - - name = rb_id2name(id); - str = rb_str_new(0, strlen(name)+1); - RSTRING(str)->ptr[0] = ':'; - strcpy(RSTRING(str)->ptr+1, name); - if (!rb_symname_p(name)) { - str = rb_str_dump(str); - strncpy(RSTRING(str)->ptr, ":\"", 2); - } - return str; -} - - -/* - * call-seq: - * sym.id2name => string - * sym.to_s => string - * - * Returns the name or string corresponding to sym. - * - * :fred.id2name #=> "fred" - */ - - -static VALUE -sym_to_s(sym) - VALUE sym; -{ - return rb_str_new2(rb_id2name(SYM2ID(sym))); -} - - -/* - * call-seq: - * sym.to_sym => sym - * - * In general, to_sym returns the Symbol corresponding - * to an object. As sym is already a symbol, self is returned - * in this case. - */ - -static VALUE -sym_to_sym(sym) - VALUE sym; -{ - return sym; -} - - -/*********************************************************************** - * - * Document-class: Module - * - * A Module is a collection of methods and constants. The - * methods in a module may be instance methods or module methods. - * Instance methods appear as methods in a class when the module is - * included, module methods do not. Conversely, module methods may be - * called without creating an encapsulating object, while instance - * methods may not. (See Module#module_function) - * - * In the descriptions that follow, the parameter syml refers - * to a symbol, which is either a quoted string or a - * Symbol (such as :name). - * - * module Mod - * include Math - * CONST = 1 - * def meth - * # ... - * end - * end - * Mod.class #=> Module - * Mod.constants #=> ["E", "PI", "CONST"] - * Mod.instance_methods #=> ["meth"] - * - */ - -/* - * call-seq: - * mod.to_s => string - * - * Return a string representing this module or class. For basic - * classes and modules, this is the name. For singletons, we - * show information on the thing we're attached to as well. - */ - -static VALUE -rb_mod_to_s(klass) - VALUE klass; - -{ - if (FL_TEST(klass, FL_SINGLETON)) { - VALUE s = rb_str_new2("#<"); - VALUE v = rb_iv_get(klass, "__attached__"); - - rb_str_cat2(s, "Class:"); - switch (TYPE(v)) { - case T_CLASS: case T_MODULE: - rb_str_append(s, rb_inspect(v)); - break; - default: - rb_str_append(s, rb_any_to_s(v)); - break; - } - rb_str_cat2(s, ">"); - - return s; - } - return rb_str_dup(rb_class_name(klass)); -} - -/* - * call-seq: - * mod.freeze - * - * Prevents further modifications to mod. - */ - -static VALUE -rb_mod_freeze(mod) - VALUE mod; -{ - rb_mod_to_s(mod); - return rb_obj_freeze(mod); -} - -/* - * call-seq: - * mod === obj => true or false - * - * Case Equality---Returns true if anObject is an - * instance of mod or one of mod's descendents. Of - * limited use for modules, but can be used in case - * statements to classify objects by class. - */ - -static VALUE -rb_mod_eqq(mod, arg) - VALUE mod, arg; -{ - return rb_obj_is_kind_of(arg, mod); -} - -/* - * call-seq: - * mod <= other => true, false, or nil - * - * Returns true if mod is a subclass of other or - * is the same as other. Returns - * nil if there's no relationship between the two. - * (Think of the relationship in terms of the class definition: - * "class Am_tbl == RCLASS(arg)->m_tbl) - return Qtrue; - mod = RBASIC(mod)->klass; - } - while (mod) { - if (RCLASS(mod)->m_tbl == RCLASS(arg)->m_tbl) - return Qtrue; - mod = RCLASS(mod)->super; - } - /* not mod < arg; check if mod > arg */ - while (arg) { - if (RCLASS(arg)->m_tbl == RCLASS(start)->m_tbl) - return Qfalse; - arg = RCLASS(arg)->super; - } - return Qnil; -} - -/* - * call-seq: - * mod < other => true, false, or nil - * - * Returns true if mod is a subclass of other. Returns - * nil if there's no relationship between the two. - * (Think of the relationship in terms of the class definition: - * "class A= other => true, false, or nil - * - * Returns true if mod is an ancestor of other, or the - * two modules are the same. Returns - * nil if there's no relationship between the two. - * (Think of the relationship in terms of the class definition: - * "class AA"). - * - */ - -static VALUE -rb_mod_ge(mod, arg) - VALUE mod, arg; -{ - switch (TYPE(arg)) { - case T_MODULE: - case T_CLASS: - break; - default: - rb_raise(rb_eTypeError, "compared with non class/module"); - } - - return rb_class_inherited_p(arg, mod); -} - -/* - * call-seq: - * mod > other => true, false, or nil - * - * Returns true if mod is an ancestor of other. Returns - * nil if there's no relationship between the two. - * (Think of the relationship in terms of the class definition: - * "class AA"). - * - */ - -static VALUE -rb_mod_gt(mod, arg) - VALUE mod, arg; -{ - if (mod == arg) return Qfalse; - return rb_mod_ge(mod, arg); -} - -/* - * call-seq: - * mod <=> other_mod => -1, 0, +1, or nil - * - * Comparison---Returns -1 if mod includes other_mod, 0 if - * mod is the same as other_mod, and +1 if mod is - * included by other_mod or if mod has no relationship with - * other_mod. Returns nil if other_mod is - * not a module. - */ - -static VALUE -rb_mod_cmp(mod, arg) - VALUE mod, arg; -{ - VALUE cmp; - - if (mod == arg) return INT2FIX(0); - switch (TYPE(arg)) { - case T_MODULE: - case T_CLASS: - break; - default: - return Qnil; - } - - cmp = rb_class_inherited_p(mod, arg); - if (NIL_P(cmp)) return Qnil; - if (cmp) { - return INT2FIX(-1); - } - return INT2FIX(1); -} - -static VALUE rb_module_s_alloc _((VALUE)); -static VALUE -rb_module_s_alloc(klass) - VALUE klass; -{ - VALUE mod = rb_module_new(); - - RBASIC(mod)->klass = klass; - return mod; -} - -static VALUE rb_class_s_alloc _((VALUE)); -static VALUE -rb_class_s_alloc(klass) - VALUE klass; -{ - return rb_class_boot(0); -} - -/* - * call-seq: - * Module.new => mod - * Module.new {|mod| block } => mod - * - * Creates a new anonymous module. If a block is given, it is passed - * the module object, and the block is evaluated in the context of this - * module using module_eval. - * - * Fred = Module.new do - * def meth1 - * "hello" - * end - * def meth2 - * "bye" - * end - * end - * a = "my string" - * a.extend(Fred) #=> "my string" - * a.meth1 #=> "hello" - * a.meth2 #=> "bye" - */ - -static VALUE -rb_mod_initialize(module) - VALUE module; -{ - if (rb_block_given_p()) { - rb_mod_module_eval(0, 0, module); - } - return Qnil; -} - -/* - * call-seq: - * Class.new(super_class=Object) => a_class - * - * Creates a new anonymous (unnamed) class with the given superclass - * (or Object if no parameter is given). You can give a - * class a name by assigning the class object to a constant. - * - */ - -static VALUE -rb_class_initialize(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - VALUE super; - - if (RCLASS(klass)->super != 0) { - rb_raise(rb_eTypeError, "already initialized class"); - } - if (rb_scan_args(argc, argv, "01", &super) == 0) { - super = rb_cObject; - } - else { - rb_check_inheritable(super); - } - RCLASS(klass)->super = super; - rb_make_metaclass(klass, RBASIC(super)->klass); - rb_mod_initialize(klass); - rb_class_inherited(super, klass); - - return klass; -} - -/* - * call-seq: - * class.allocate() => obj - * - * Allocates space for a new object of class's class. The - * returned object must be an instance of class. - * - */ - -VALUE -rb_obj_alloc(klass) - VALUE klass; -{ - VALUE obj; - - if (RCLASS(klass)->super == 0) { - rb_raise(rb_eTypeError, "can't instantiate uninitialized class"); - } - if (FL_TEST(klass, FL_SINGLETON)) { - rb_raise(rb_eTypeError, "can't create instance of virtual class"); - } - obj = rb_funcall(klass, ID_ALLOCATOR, 0, 0); - if (rb_obj_class(obj) != rb_class_real(klass)) { - rb_raise(rb_eTypeError, "wrong instance allocation"); - } - return obj; -} - -static VALUE rb_class_allocate_instance _((VALUE)); -static VALUE -rb_class_allocate_instance(klass) - VALUE klass; -{ - NEWOBJ(obj, struct RObject); - OBJSETUP(obj, klass, T_OBJECT); - return (VALUE)obj; -} - -/* - * call-seq: - * class.new(args, ...) => obj - * - * Calls allocate to create a new object of - * class's class, then invokes that object's - * initialize method, passing it args. - * This is the method that ends up getting called whenever - * an object is constructed using .new. - * - */ - -VALUE -rb_class_new_instance(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - VALUE obj; - - obj = rb_obj_alloc(klass); - rb_obj_call_init(obj, argc, argv); - - return obj; -} - -/* - * call-seq: - * class.superclass -> a_super_class or nil - * - * Returns the superclass of class, or nil. - * - * File.superclass #=> IO - * IO.superclass #=> Object - * Object.superclass #=> nil - * - */ - -static VALUE -rb_class_superclass(klass) - VALUE klass; -{ - VALUE super = RCLASS(klass)->super; - - if (!super) { - rb_raise(rb_eTypeError, "uninitialized class"); - } - if (FL_TEST(klass, FL_SINGLETON)) { - super = RBASIC(klass)->klass; - } - while (TYPE(super) == T_ICLASS) { - super = RCLASS(super)->super; - } - if (!super) { - return Qnil; - } - return super; -} - -static ID -str_to_id(str) - VALUE str; -{ - VALUE sym = rb_str_intern(str); - - return SYM2ID(sym); -} - -ID -rb_to_id(name) - VALUE name; -{ - VALUE tmp; - ID id; - - switch (TYPE(name)) { - case T_STRING: - return str_to_id(name); - case T_FIXNUM: - rb_warn("do not use Fixnums as Symbols"); - id = FIX2LONG(name); - if (!rb_id2name(id)) { - rb_raise(rb_eArgError, "%ld is not a symbol", id); - } - break; - case T_SYMBOL: - id = SYM2ID(name); - break; - default: - tmp = rb_check_string_type(name); - if (!NIL_P(tmp)) { - return str_to_id(tmp); - } - rb_raise(rb_eTypeError, "%s is not a symbol", RSTRING(rb_inspect(name))->ptr); - } - return id; -} - -/* - * call-seq: - * attr(symbol, writable=false) => nil - * - * Defines a named attribute for this module, where the name is - * symbol.id2name, creating an instance variable - * (@name) and a corresponding access method to read it. - * If the optional writable argument is true, also - * creates a method called name= to set the attribute. - * - * module Mod - * attr :size, true - * end - * - * is equivalent to: - * - * module Mod - * def size - * @size - * end - * def size=(val) - * @size = val - * end - * end - */ - -static VALUE -rb_mod_attr(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - VALUE name, pub; - - rb_scan_args(argc, argv, "11", &name, &pub); - rb_attr(klass, rb_to_id(name), 1, RTEST(pub), Qtrue); - return Qnil; -} - -/* - * call-seq: - * attr_reader(symbol, ...) => nil - * - * Creates instance variables and corresponding methods that return the - * value of each instance variable. Equivalent to calling - * ``attr:name'' on each name in turn. - */ - -static VALUE -rb_mod_attr_reader(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - int i; - - for (i=0; i nil - * - * Creates an accessor method to allow assignment to the attribute - * aSymbol.id2name. - */ - -static VALUE -rb_mod_attr_writer(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - int i; - - for (i=0; i nil - * - * Equivalent to calling ``attrsymbol, - * true'' on each symbol in turn. - * - * module Mod - * attr_accessor(:one, :two) - * end - * Mod.instance_methods.sort #=> ["one", "one=", "two", "two="] - */ - -static VALUE -rb_mod_attr_accessor(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - int i; - - for (i=0; i obj - * - * Returns the value of the named constant in mod. - * - * Math.const_get(:PI) #=> 3.14159265358979 - */ - -static VALUE -rb_mod_const_get(mod, name) - VALUE mod, name; -{ - ID id = rb_to_id(name); - - if (!rb_is_const_id(id)) { - rb_name_error(id, "wrong constant name %s", rb_id2name(id)); - } - return rb_const_get(mod, id); -} - -/* - * call-seq: - * mod.const_set(sym, obj) => obj - * - * Sets the named constant to the given object, returning that object. - * Creates a new constant if no constant with the given name previously - * existed. - * - * Math.const_set("HIGH_SCHOOL_PI", 22.0/7.0) #=> 3.14285714285714 - * Math::HIGH_SCHOOL_PI - Math::PI #=> 0.00126448926734968 - */ - -static VALUE -rb_mod_const_set(mod, name, value) - VALUE mod, name, value; -{ - ID id = rb_to_id(name); - - if (!rb_is_const_id(id)) { - rb_name_error(id, "wrong constant name %s", rb_id2name(id)); - } - rb_const_set(mod, id, value); - return value; -} - -/* - * call-seq: - * mod.const_defined?(sym) => true or false - * - * Returns true if a constant with the given name is - * defined by mod. - * - * Math.const_defined? "PI" #=> true - */ - -static VALUE -rb_mod_const_defined(mod, name) - VALUE mod, name; -{ - ID id = rb_to_id(name); - - if (!rb_is_const_id(id)) { - rb_name_error(id, "wrong constant name %s", rb_id2name(id)); - } - return rb_const_defined_at(mod, id); -} - -/* - * call-seq: - * obj.methods => array - * - * Returns a list of the names of methods publicly accessible in - * obj. This will include all the methods accessible in - * obj's ancestors. - * - * class Klass - * def kMethod() - * end - * end - * k = Klass.new - * k.methods[0..9] #=> ["kMethod", "freeze", "nil?", "is_a?", - * "class", "instance_variable_set", - * "methods", "extend", "__send__", "instance_eval"] - * k.methods.length #=> 42 - */ - -static VALUE -rb_obj_methods(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - retry: - if (argc == 0) { - VALUE args[1]; - - args[0] = Qtrue; - return rb_class_instance_methods(1, args, CLASS_OF(obj)); - } - else { - VALUE recur; - - rb_scan_args(argc, argv, "1", &recur); - if (RTEST(recur)) { - argc = 0; - goto retry; - } - return rb_obj_singleton_methods(argc, argv, obj); - } -} - -/* - * call-seq: - * obj.protected_methods(all=true) => array - * - * Returns the list of protected methods accessible to obj. If - * the all parameter is set to false, only those methods - * in the receiver will be listed. - */ - -static VALUE -rb_obj_protected_methods(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - if (argc == 0) { /* hack to stop warning */ - VALUE args[1]; - - args[0] = Qtrue; - return rb_class_protected_instance_methods(1, args, CLASS_OF(obj)); - } - return rb_class_protected_instance_methods(argc, argv, CLASS_OF(obj)); -} - -/* - * call-seq: - * obj.private_methods(all=true) => array - * - * Returns the list of private methods accessible to obj. If - * the all parameter is set to false, only those methods - * in the receiver will be listed. - */ - -static VALUE -rb_obj_private_methods(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - if (argc == 0) { /* hack to stop warning */ - VALUE args[1]; - - args[0] = Qtrue; - return rb_class_private_instance_methods(1, args, CLASS_OF(obj)); - } - return rb_class_private_instance_methods(argc, argv, CLASS_OF(obj)); -} - -/* - * call-seq: - * obj.public_methods(all=true) => array - * - * Returns the list of public methods accessible to obj. If - * the all parameter is set to false, only those methods - * in the receiver will be listed. - */ - -static VALUE -rb_obj_public_methods(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - if (argc == 0) { /* hack to stop warning */ - VALUE args[1]; - - args[0] = Qtrue; - return rb_class_public_instance_methods(1, args, CLASS_OF(obj)); - } - return rb_class_public_instance_methods(argc, argv, CLASS_OF(obj)); -} - -/* - * call-seq: - * obj.instance_variable_get(symbol) => obj - * - * Returns the value of the given instance variable, or nil if the - * instance variable is not set. The @ part of the - * variable name should be included for regular instance - * variables. Throws a NameError exception if the - * supplied symbol is not valid as an instance variable name. - * - * class Fred - * def initialize(p1, p2) - * @a, @b = p1, p2 - * end - * end - * fred = Fred.new('cat', 99) - * fred.instance_variable_get(:@a) #=> "cat" - * fred.instance_variable_get("@b") #=> 99 - */ - -static VALUE -rb_obj_ivar_get(obj, iv) - VALUE obj, iv; -{ - ID id = rb_to_id(iv); - - if (!rb_is_instance_id(id)) { - rb_name_error(id, "`%s' is not allowed as an instance variable name", rb_id2name(id)); - } - return rb_ivar_get(obj, id); -} - -/* - * call-seq: - * obj.instance_variable_set(symbol, obj) => obj - * - * Sets the instance variable names by symbol to - * object, thereby frustrating the efforts of the class's - * author to attempt to provide proper encapsulation. The variable - * did not have to exist prior to this call. - * - * class Fred - * def initialize(p1, p2) - * @a, @b = p1, p2 - * end - * end - * fred = Fred.new('cat', 99) - * fred.instance_variable_set(:@a, 'dog') #=> "dog" - * fred.instance_variable_set(:@c, 'cat') #=> "cat" - * fred.inspect #=> "#" - */ - -static VALUE -rb_obj_ivar_set(obj, iv, val) - VALUE obj, iv, val; -{ - ID id = rb_to_id(iv); - - if (!rb_is_instance_id(id)) { - rb_name_error(id, "`%s' is not allowed as an instance variable name", rb_id2name(id)); - } - return rb_ivar_set(obj, id, val); -} - -/* - * call-seq: - * obj.instance_variable_defined?(symbol) => true or false - * - * Returns true if the given instance variable is - * defined in obj. - * - * class Fred - * def initialize(p1, p2) - * @a, @b = p1, p2 - * end - * end - * fred = Fred.new('cat', 99) - * fred.instance_variable_defined?(:@a) #=> true - * fred.instance_variable_defined?("@b") #=> true - * fred.instance_variable_defined?("@c") #=> false - */ - -static VALUE -rb_obj_ivar_defined(obj, iv) - VALUE obj, iv; -{ - ID id = rb_to_id(iv); - - if (!rb_is_instance_id(id)) { - rb_name_error(id, "`%s' is not allowed as an instance variable name", rb_id2name(id)); - } - return rb_ivar_defined(obj, id); -} - -/* - * call-seq: - * mod.class_variable_get(symbol) => obj - * - * Returns the value of the given class variable (or throws a - * NameError exception). The @@ part of the - * variable name should be included for regular class variables - * - * class Fred - * @@foo = 99 - * end - * - * def Fred.foo - * class_variable_get(:@@foo) #=> 99 - * end - */ - -static VALUE -rb_mod_cvar_get(obj, iv) - VALUE obj, iv; -{ - ID id = rb_to_id(iv); - - if (!rb_is_class_id(id)) { - rb_name_error(id, "`%s' is not allowed as a class variable name", rb_id2name(id)); - } - return rb_cvar_get(obj, id); -} - -/* - * call-seq: - * obj.class_variable_set(symbol, obj) => obj - * - * Sets the class variable names by symbol to - * object. - * - * class Fred - * @@foo = 99 - * def foo - * @@foo - * end - * end - * - * def Fred.foo - * class_variable_set(:@@foo, 101) #=> 101 - * end - * Fred.foo - * Fred.new.foo #=> 101 - */ - -static VALUE -rb_mod_cvar_set(obj, iv, val) - VALUE obj, iv, val; -{ - ID id = rb_to_id(iv); - - if (!rb_is_class_id(id)) { - rb_name_error(id, "`%s' is not allowed as a class variable name", rb_id2name(id)); - } - rb_cvar_set(obj, id, val, Qfalse); - return val; -} - -/* - * call-seq: - * obj.class_variable_defined?(symbol) => true or false - * - * Returns true if the given class variable is defined - * in obj. - * - * class Fred - * @@foo = 99 - * end - * Fred.class_variable_defined?(:@@foo) #=> true - * Fred.class_variable_defined?(:@@bar) #=> false - */ - -static VALUE -rb_mod_cvar_defined(obj, iv) - VALUE obj, iv; -{ - ID id = rb_to_id(iv); - - if (!rb_is_class_id(id)) { - rb_name_error(id, "`%s' is not allowed as a class variable name", rb_id2name(id)); - } - return rb_cvar_defined(obj, id); -} - -static VALUE -convert_type(val, tname, method, raise) - VALUE val; - const char *tname, *method; - int raise; -{ - ID m; - - m = rb_intern(method); - if (!rb_respond_to(val, m)) { - if (raise) { - rb_raise(rb_eTypeError, "can't convert %s into %s", - NIL_P(val) ? "nil" : - val == Qtrue ? "true" : - val == Qfalse ? "false" : - rb_obj_classname(val), - tname); - } - else { - return Qnil; - } - } - return rb_funcall(val, m, 0); -} - -VALUE -rb_convert_type(val, type, tname, method) - VALUE val; - int type; - const char *tname, *method; -{ - VALUE v; - - if (TYPE(val) == type) return val; - v = convert_type(val, tname, method, Qtrue); - if (TYPE(v) != type) { - rb_raise(rb_eTypeError, "%s#%s should return %s", - rb_obj_classname(val), method, tname); - } - return v; -} - -VALUE -rb_check_convert_type(val, type, tname, method) - VALUE val; - int type; - const char *tname, *method; -{ - VALUE v; - - /* always convert T_DATA */ - if (TYPE(val) == type && type != T_DATA) return val; - v = convert_type(val, tname, method, Qfalse); - if (NIL_P(v)) return Qnil; - if (TYPE(v) != type) { - rb_raise(rb_eTypeError, "%s#%s should return %s", - rb_obj_classname(val), method, tname); - } - return v; -} - - -static VALUE -rb_to_integer(val, method) - VALUE val; - const char *method; -{ - VALUE v = convert_type(val, "Integer", method, Qtrue); - if (!rb_obj_is_kind_of(v, rb_cInteger)) { - rb_raise(rb_eTypeError, "%s#%s should return Integer", - rb_obj_classname(val), method); - } - return v; -} - -VALUE -rb_to_int(val) - VALUE val; -{ - return rb_to_integer(val, "to_int"); -} - -VALUE -rb_Integer(val) - VALUE val; -{ - VALUE tmp; - - switch (TYPE(val)) { - case T_FLOAT: - if (RFLOAT(val)->value <= (double)FIXNUM_MAX - && RFLOAT(val)->value >= (double)FIXNUM_MIN) { - break; - } - return rb_dbl2big(RFLOAT(val)->value); - - case T_FIXNUM: - case T_BIGNUM: - return val; - - case T_STRING: - return rb_str_to_inum(val, 0, Qtrue); - - default: - break; - } - tmp = convert_type(val, "Integer", "to_int", Qfalse); - if (NIL_P(tmp)) { - return rb_to_integer(val, "to_i"); - } - return tmp; -} - -/* - * call-seq: - * Integer(arg) => integer - * - * Converts arg to a Fixnum or Bignum. - * Numeric types are converted directly (with floating point numbers - * being truncated). If arg is a String, leading - * radix indicators (0, 0b, and - * 0x) are honored. Others are converted using - * to_int and to_i. This behavior is - * different from that of String#to_i. - * - * Integer(123.999) #=> 123 - * Integer("0x1a") #=> 26 - * Integer(Time.new) #=> 1049896590 - */ - -static VALUE -rb_f_integer(obj, arg) - VALUE obj, arg; -{ - return rb_Integer(arg); -} - -double -rb_cstr_to_dbl(p, badcheck) - const char *p; - int badcheck; -{ - const char *q; - char *end; - double d; - const char *ellipsis = ""; - int w; -#define OutOfRange() (((w = end - p) > 20) ? (w = 20, ellipsis = "...") : (ellipsis = "")) - - if (!p) return 0.0; - q = p; - if (badcheck) { - while (ISSPACE(*p)) p++; - } - else { - while (ISSPACE(*p) || *p == '_') p++; - } - errno = 0; - d = strtod(p, &end); - if (errno == ERANGE) { - OutOfRange(); - rb_warn("Float %.*s%s out of range", w, p, ellipsis); - errno = 0; - } - if (p == end) { - if (badcheck) { - bad: - rb_invalid_str(q, "Float()"); - } - return d; - } - if (*end) { - char *buf = ALLOCA_N(char, strlen(p)+1); - char *n = buf; - - while (p < end) *n++ = *p++; - while (*p) { - if (*p == '_') { - /* remove underscores between digits */ - if (badcheck) { - if (n == buf || !ISDIGIT(n[-1])) goto bad; - ++p; - if (!ISDIGIT(*p)) goto bad; - } - else { - while (*++p == '_'); - continue; - } - } - *n++ = *p++; - } - *n = '\0'; - p = buf; - d = strtod(p, &end); - if (errno == ERANGE) { - OutOfRange(); - rb_warn("Float %.*s%s out of range", w, p, ellipsis); - errno = 0; - } - if (badcheck) { - if (!end || p == end) goto bad; - while (*end && ISSPACE(*end)) end++; - if (*end) goto bad; - } - } - if (errno == ERANGE) { - errno = 0; - OutOfRange(); - rb_raise(rb_eArgError, "Float %.*s%s out of range", w, q, ellipsis); - } - return d; -} - -double -rb_str_to_dbl(str, badcheck) - VALUE str; - int badcheck; -{ - char *s; - long len; - - StringValue(str); - s = RSTRING(str)->ptr; - len = RSTRING(str)->len; - if (s) { - if (s[len]) { /* no sentinel somehow */ - char *p = ALLOCA_N(char, len+1); - - MEMCPY(p, s, char, len); - p[len] = '\0'; - s = p; - } - if (badcheck && len != strlen(s)) { - rb_raise(rb_eArgError, "string for Float contains null byte"); - } - } - return rb_cstr_to_dbl(s, badcheck); -} - -VALUE -rb_Float(val) - VALUE val; -{ - switch (TYPE(val)) { - case T_FIXNUM: - return rb_float_new((double)FIX2LONG(val)); - - case T_FLOAT: - return val; - - case T_BIGNUM: - return rb_float_new(rb_big2dbl(val)); - - case T_STRING: - return rb_float_new(rb_str_to_dbl(val, Qtrue)); - - case T_NIL: - rb_raise(rb_eTypeError, "can't convert nil into Float"); - break; - - default: - { - VALUE f = rb_convert_type(val, T_FLOAT, "Float", "to_f"); - if (isnan(RFLOAT(f)->value)) { - rb_raise(rb_eArgError, "invalid value for Float()"); - } - return f; - } - } -} - -/* - * call-seq: - * Float(arg) => float - * - * Returns arg converted to a float. Numeric types are converted - * directly, the rest are converted using arg.to_f. As of Ruby - * 1.8, converting nil generates a TypeError. - * - * Float(1) #=> 1.0 - * Float("123.456") #=> 123.456 - */ - -static VALUE -rb_f_float(obj, arg) - VALUE obj, arg; -{ - return rb_Float(arg); -} - -double -rb_num2dbl(val) - VALUE val; -{ - switch (TYPE(val)) { - case T_FLOAT: - return RFLOAT(val)->value; - - case T_STRING: - rb_raise(rb_eTypeError, "no implicit conversion to float from string"); - break; - - case T_NIL: - rb_raise(rb_eTypeError, "no implicit conversion to float from nil"); - break; - - default: - break; - } - - return RFLOAT(rb_Float(val))->value; -} - -char* -rb_str2cstr(str, len) - VALUE str; - long *len; -{ - StringValue(str); - if (len) *len = RSTRING(str)->len; - else if (RTEST(ruby_verbose) && RSTRING(str)->len != strlen(RSTRING(str)->ptr)) { - rb_warn("string contains \\0 character"); - } - return RSTRING(str)->ptr; -} - -VALUE -rb_String(val) - VALUE val; -{ - return rb_convert_type(val, T_STRING, "String", "to_s"); -} - - -/* - * call-seq: - * String(arg) => string - * - * Converts arg to a String by calling its - * to_s method. - * - * String(self) #=> "main" - * String(self.class #=> "Object" - * String(123456) #=> "123456" - */ - -static VALUE -rb_f_string(obj, arg) - VALUE obj, arg; -{ - return rb_String(arg); -} - -#if 0 -VALUE -rb_Array(val) - VALUE val; -{ - VALUE tmp = rb_check_array_type(val); - - if (NIL_P(tmp)) { - tmp = rb_check_convert_type(val, T_ARRAY, "Array", "to_a"); - if (NIL_P(tmp)) { - return rb_ary_new3(1, val); - } - } - return tmp; -} -#endif - -/* - * call-seq: - * Array(arg) => array - * - * Returns arg as an Array. First tries to call - * arg.to_ary, then arg.to_a. - * If both fail, creates a single element array containing arg - * (unless arg is nil). - * - * Array(1..5) #=> [1, 2, 3, 4, 5] - */ - -static VALUE -rb_f_array(obj, arg) - VALUE obj, arg; -{ - return rb_Array(arg); -} - -static VALUE -boot_defclass(name, super) - char *name; - VALUE super; -{ - extern st_table *rb_class_tbl; - VALUE obj = rb_class_boot(super); - ID id = rb_intern(name); - - rb_name_class(obj, id); - st_add_direct(rb_class_tbl, id, obj); - rb_const_set((rb_cObject ? rb_cObject : obj), id, obj); - return obj; -} - -VALUE ruby_top_self; - -/* - * Document-class: Class - * - * Classes in Ruby are first-class objects---each is an instance of - * class Class. - * - * When a new class is created (typically using class Name ... - * end), an object of type Class is created and - * assigned to a global constant (Name in this case). When - * Name.new is called to create a new object, the - * new method in Class is run by default. - * This can be demonstrated by overriding new in - * Class: - * - * class Class - * alias oldNew new - * def new(*args) - * print "Creating a new ", self.name, "\n" - * oldNew(*args) - * end - * end - * - * - * class Name - * end - * - * - * n = Name.new - * - * produces: - * - * Creating a new Name - * - * Classes, modules, and objects are interrelated. In the diagram - * that follows, the vertical arrows represent inheritance, and the - * parentheses meta-classes. All metaclasses are instances - * of the class `Class'. - * - * +------------------+ - * | | - * Object---->(Object) | - * ^ ^ ^ ^ | - * | | | | | - * | | +-----+ +---------+ | - * | | | | | - * | +-----------+ | | - * | | | | | - * +------+ | Module--->(Module) | - * | | ^ ^ | - * OtherClass-->(OtherClass) | | | - * | | | - * Class---->(Class) | - * ^ | - * | | - * +----------------+ - */ - - -/* - * Object is the parent class of all classes in Ruby. Its - * methods are therefore available to all objects unless explicitly - * overridden. - * - * Object mixes in the Kernel module, making - * the built-in kernel functions globally accessible. Although the - * instance methods of Object are defined by the - * Kernel module, we have chosen to document them here for - * clarity. - * - * In the descriptions of Object's methods, the parameter symbol refers - * to a symbol, which is either a quoted string or a - * Symbol (such as :name). - */ - -void -Init_Object() -{ - VALUE metaclass; - - rb_cObject = boot_defclass("Object", 0); - rb_cModule = boot_defclass("Module", rb_cObject); - rb_cClass = boot_defclass("Class", rb_cModule); - - metaclass = rb_make_metaclass(rb_cObject, rb_cClass); - metaclass = rb_make_metaclass(rb_cModule, metaclass); - metaclass = rb_make_metaclass(rb_cClass, metaclass); - - rb_mKernel = rb_define_module("Kernel"); - rb_include_module(rb_cObject, rb_mKernel); - rb_define_alloc_func(rb_cObject, rb_class_allocate_instance); - rb_define_private_method(rb_cObject, "initialize", rb_obj_dummy, 0); - rb_define_private_method(rb_cClass, "inherited", rb_obj_dummy, 1); - rb_define_private_method(rb_cModule, "included", rb_obj_dummy, 1); - rb_define_private_method(rb_cModule, "extended", rb_obj_dummy, 1); - rb_define_private_method(rb_cModule, "method_added", rb_obj_dummy, 1); - rb_define_private_method(rb_cModule, "method_removed", rb_obj_dummy, 1); - rb_define_private_method(rb_cModule, "method_undefined", rb_obj_dummy, 1); - - - rb_define_method(rb_mKernel, "nil?", rb_false, 0); - rb_define_method(rb_mKernel, "==", rb_obj_equal, 1); - rb_define_method(rb_mKernel, "equal?", rb_obj_equal, 1); - rb_define_method(rb_mKernel, "===", rb_equal, 1); - rb_define_method(rb_mKernel, "=~", rb_obj_pattern_match, 1); - - rb_define_method(rb_mKernel, "eql?", rb_obj_equal, 1); - - rb_define_method(rb_mKernel, "id", rb_obj_id_obsolete, 0); - rb_define_method(rb_mKernel, "type", rb_obj_type, 0); - rb_define_method(rb_mKernel, "class", rb_obj_class, 0); - - rb_define_method(rb_mKernel, "clone", rb_obj_clone, 0); - rb_define_method(rb_mKernel, "dup", rb_obj_dup, 0); - rb_define_method(rb_mKernel, "initialize_copy", rb_obj_init_copy, 1); - - rb_define_method(rb_mKernel, "taint", rb_obj_taint, 0); - rb_define_method(rb_mKernel, "tainted?", rb_obj_tainted, 0); - rb_define_method(rb_mKernel, "untaint", rb_obj_untaint, 0); - rb_define_method(rb_mKernel, "freeze", rb_obj_freeze, 0); - rb_define_method(rb_mKernel, "frozen?", rb_obj_frozen_p, 0); - - rb_define_method(rb_mKernel, "to_a", rb_any_to_a, 0); /* to be removed */ - rb_define_method(rb_mKernel, "to_s", rb_any_to_s, 0); - rb_define_method(rb_mKernel, "inspect", rb_obj_inspect, 0); - rb_define_method(rb_mKernel, "methods", rb_obj_methods, -1); - rb_define_method(rb_mKernel, "singleton_methods", - rb_obj_singleton_methods, -1); /* in class.c */ - rb_define_method(rb_mKernel, "protected_methods", - rb_obj_protected_methods, -1); - rb_define_method(rb_mKernel, "private_methods", rb_obj_private_methods, -1); - rb_define_method(rb_mKernel, "public_methods", rb_obj_public_methods, -1); - rb_define_method(rb_mKernel, "instance_variables", - rb_obj_instance_variables, 0); /* in variable.c */ - rb_define_method(rb_mKernel, "instance_variable_get", rb_obj_ivar_get, 1); - rb_define_method(rb_mKernel, "instance_variable_set", rb_obj_ivar_set, 2); - rb_define_method(rb_mKernel, "instance_variable_defined?", rb_obj_ivar_defined, 1); - rb_define_private_method(rb_mKernel, "remove_instance_variable", - rb_obj_remove_instance_variable, 1); /* in variable.c */ - - rb_define_method(rb_mKernel, "instance_of?", rb_obj_is_instance_of, 1); - rb_define_method(rb_mKernel, "kind_of?", rb_obj_is_kind_of, 1); - rb_define_method(rb_mKernel, "is_a?", rb_obj_is_kind_of, 1); - - rb_define_private_method(rb_mKernel, "singleton_method_added", rb_obj_dummy, 1); - rb_define_private_method(rb_mKernel, "singleton_method_removed", rb_obj_dummy, 1); - rb_define_private_method(rb_mKernel, "singleton_method_undefined", rb_obj_dummy, 1); - - rb_define_global_function("sprintf", rb_f_sprintf, -1); /* in sprintf.c */ - rb_define_global_function("format", rb_f_sprintf, -1); /* in sprintf.c */ - - rb_define_global_function("Integer", rb_f_integer, 1); - rb_define_global_function("Float", rb_f_float, 1); - - rb_define_global_function("String", rb_f_string, 1); - rb_define_global_function("Array", rb_f_array, 1); - - rb_cNilClass = rb_define_class("NilClass", rb_cObject); - rb_define_method(rb_cNilClass, "to_i", nil_to_i, 0); - rb_define_method(rb_cNilClass, "to_f", nil_to_f, 0); - rb_define_method(rb_cNilClass, "to_s", nil_to_s, 0); - rb_define_method(rb_cNilClass, "to_a", nil_to_a, 0); - rb_define_method(rb_cNilClass, "inspect", nil_inspect, 0); - rb_define_method(rb_cNilClass, "&", false_and, 1); - rb_define_method(rb_cNilClass, "|", false_or, 1); - rb_define_method(rb_cNilClass, "^", false_xor, 1); - - rb_define_method(rb_cNilClass, "nil?", rb_true, 0); - rb_undef_alloc_func(rb_cNilClass); - rb_undef_method(CLASS_OF(rb_cNilClass), "new"); - rb_define_global_const("NIL", Qnil); - - rb_cSymbol = rb_define_class("Symbol", rb_cObject); - rb_define_singleton_method(rb_cSymbol, "all_symbols", - rb_sym_all_symbols, 0); /* in parse.y */ - rb_undef_alloc_func(rb_cSymbol); - rb_undef_method(CLASS_OF(rb_cSymbol), "new"); - - rb_define_method(rb_cSymbol, "to_i", sym_to_i, 0); - rb_define_method(rb_cSymbol, "to_int", sym_to_int, 0); - rb_define_method(rb_cSymbol, "inspect", sym_inspect, 0); - rb_define_method(rb_cSymbol, "to_s", sym_to_s, 0); - rb_define_method(rb_cSymbol, "id2name", sym_to_s, 0); - rb_define_method(rb_cSymbol, "to_sym", sym_to_sym, 0); - rb_define_method(rb_cSymbol, "===", rb_obj_equal, 1); - - rb_define_method(rb_cModule, "freeze", rb_mod_freeze, 0); - rb_define_method(rb_cModule, "===", rb_mod_eqq, 1); - rb_define_method(rb_cModule, "==", rb_obj_equal, 1); - rb_define_method(rb_cModule, "<=>", rb_mod_cmp, 1); - rb_define_method(rb_cModule, "<", rb_mod_lt, 1); - rb_define_method(rb_cModule, "<=", rb_class_inherited_p, 1); - rb_define_method(rb_cModule, ">", rb_mod_gt, 1); - rb_define_method(rb_cModule, ">=", rb_mod_ge, 1); - rb_define_method(rb_cModule, "initialize_copy", rb_mod_init_copy, 1); /* in class.c */ - rb_define_method(rb_cModule, "to_s", rb_mod_to_s, 0); - rb_define_method(rb_cModule, "included_modules", - rb_mod_included_modules, 0); /* in class.c */ - rb_define_method(rb_cModule, "include?", rb_mod_include_p, 1); /* in class.c */ - rb_define_method(rb_cModule, "name", rb_mod_name, 0); /* in variable.c */ - rb_define_method(rb_cModule, "ancestors", rb_mod_ancestors, 0); /* in class.c */ - - rb_define_private_method(rb_cModule, "attr", rb_mod_attr, -1); - rb_define_private_method(rb_cModule, "attr_reader", rb_mod_attr_reader, -1); - rb_define_private_method(rb_cModule, "attr_writer", rb_mod_attr_writer, -1); - rb_define_private_method(rb_cModule, "attr_accessor", rb_mod_attr_accessor, -1); - - rb_define_alloc_func(rb_cModule, rb_module_s_alloc); - rb_define_method(rb_cModule, "initialize", rb_mod_initialize, 0); - rb_define_method(rb_cModule, "instance_methods", - rb_class_instance_methods, -1); /* in class.c */ - rb_define_method(rb_cModule, "public_instance_methods", - rb_class_public_instance_methods, -1); /* in class.c */ - rb_define_method(rb_cModule, "protected_instance_methods", - rb_class_protected_instance_methods, -1); /* in class.c */ - rb_define_method(rb_cModule, "private_instance_methods", - rb_class_private_instance_methods, -1); /* in class.c */ - - rb_define_method(rb_cModule, "class_variable_defined?", rb_mod_cvar_defined, 1); - rb_define_method(rb_cModule, "constants", rb_mod_constants, 0); /* in variable.c */ - rb_define_method(rb_cModule, "const_get", rb_mod_const_get, 1); - rb_define_method(rb_cModule, "const_set", rb_mod_const_set, 2); - rb_define_method(rb_cModule, "const_defined?", rb_mod_const_defined, 1); - rb_define_private_method(rb_cModule, "remove_const", - rb_mod_remove_const, 1); /* in variable.c */ - rb_define_method(rb_cModule, "const_missing", - rb_mod_const_missing, 1); /* in variable.c */ - rb_define_method(rb_cModule, "class_variables", - rb_mod_class_variables, 0); /* in variable.c */ - rb_define_private_method(rb_cModule, "remove_class_variable", - rb_mod_remove_cvar, 1); /* in variable.c */ - rb_define_private_method(rb_cModule, "class_variable_get", rb_mod_cvar_get, 1); - rb_define_private_method(rb_cModule, "class_variable_set", rb_mod_cvar_set, 2); - - rb_define_method(rb_cClass, "allocate", rb_obj_alloc, 0); - rb_define_method(rb_cClass, "new", rb_class_new_instance, -1); - rb_define_method(rb_cClass, "initialize", rb_class_initialize, -1); - rb_define_method(rb_cClass, "initialize_copy", rb_class_init_copy, 1); /* in class.c */ - rb_define_method(rb_cClass, "superclass", rb_class_superclass, 0); - rb_define_alloc_func(rb_cClass, rb_class_s_alloc); - rb_undef_method(rb_cClass, "extend_object"); - rb_undef_method(rb_cClass, "append_features"); - - rb_cData = rb_define_class("Data", rb_cObject); - rb_undef_alloc_func(rb_cData); - - rb_global_variable(&ruby_top_self); - ruby_top_self = rb_obj_alloc(rb_cObject); - rb_define_singleton_method(ruby_top_self, "to_s", main_to_s, 0); - - rb_cTrueClass = rb_define_class("TrueClass", rb_cObject); - rb_define_method(rb_cTrueClass, "to_s", true_to_s, 0); - rb_define_method(rb_cTrueClass, "&", true_and, 1); - rb_define_method(rb_cTrueClass, "|", true_or, 1); - rb_define_method(rb_cTrueClass, "^", true_xor, 1); - rb_undef_alloc_func(rb_cTrueClass); - rb_undef_method(CLASS_OF(rb_cTrueClass), "new"); - rb_define_global_const("TRUE", Qtrue); - - rb_cFalseClass = rb_define_class("FalseClass", rb_cObject); - rb_define_method(rb_cFalseClass, "to_s", false_to_s, 0); - rb_define_method(rb_cFalseClass, "&", false_and, 1); - rb_define_method(rb_cFalseClass, "|", false_or, 1); - rb_define_method(rb_cFalseClass, "^", false_xor, 1); - rb_undef_alloc_func(rb_cFalseClass); - rb_undef_method(CLASS_OF(rb_cFalseClass), "new"); - rb_define_global_const("FALSE", Qfalse); - - id_eq = rb_intern("=="); - id_eql = rb_intern("eql?"); - id_inspect = rb_intern("inspect"); - id_init_copy = rb_intern("initialize_copy"); -} -/********************************************************************** - - pack.c - - - $Author: shyouhei $ - $Date: 2009-02-19 10:01:35 +0100 (Thu, 19 Feb 2009) $ - created at: Thu Feb 10 15:17:05 JST 1994 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include -#include - -#define SIZE16 2 -#define SIZE32 4 - -#if SIZEOF_SHORT != 2 || SIZEOF_LONG != 4 -# define NATINT_PACK -#endif - -#ifdef NATINT_PACK -# define OFF16B(p) ((char*)(p) + (natint?0:(sizeof(short) - SIZE16))) -# define OFF32B(p) ((char*)(p) + (natint?0:(sizeof(long) - SIZE32))) -# define NATINT_LEN(type,len) (natint?sizeof(type):(len)) -# ifdef WORDS_BIGENDIAN -# define OFF16(p) OFF16B(p) -# define OFF32(p) OFF32B(p) -# endif -# define NATINT_HTOVS(x) (natint?htovs(x):htov16(x)) -# define NATINT_HTOVL(x) (natint?htovl(x):htov32(x)) -# define NATINT_HTONS(x) (natint?htons(x):hton16(x)) -# define NATINT_HTONL(x) (natint?htonl(x):hton32(x)) -#else -# define NATINT_LEN(type,len) sizeof(type) -# define NATINT_HTOVS(x) htovs(x) -# define NATINT_HTOVL(x) htovl(x) -# define NATINT_HTONS(x) htons(x) -# define NATINT_HTONL(x) htonl(x) -#endif - -#ifndef OFF16 -# define OFF16(p) (char*)(p) -# define OFF32(p) (char*)(p) -#endif -#ifndef OFF16B -# define OFF16B(p) (char*)(p) -# define OFF32B(p) (char*)(p) -#endif - -#define define_swapx(x, xtype) \ -static xtype \ -TOKEN_PASTE(swap,x)(z) \ - xtype z; \ -{ \ - xtype r; \ - xtype *zp; \ - unsigned char *s, *t; \ - int i; \ - \ - zp = xmalloc(sizeof(xtype)); \ - *zp = z; \ - s = (unsigned char*)zp; \ - t = xmalloc(sizeof(xtype)); \ - for (i=0; i>8)&0xFF)) -#endif -#if SIZEOF_SHORT == 2 -#define swaps(x) swap16(x) -#else -#if SIZEOF_SHORT == 4 -#define swaps(x) ((((x)&0xFF)<<24) \ - |(((x)>>24)&0xFF) \ - |(((x)&0x0000FF00)<<8) \ - |(((x)&0x00FF0000)>>8) ) -#else -define_swapx(s,short) -#endif -#endif - -#ifndef swap32 -#define swap32(x) ((((x)&0xFF)<<24) \ - |(((x)>>24)&0xFF) \ - |(((x)&0x0000FF00)<<8) \ - |(((x)&0x00FF0000)>>8) ) -#endif -#if SIZEOF_LONG == 4 -#define swapl(x) swap32(x) -#else -#if SIZEOF_LONG == 8 -#define swapl(x) ((((x)&0x00000000000000FF)<<56) \ - |(((x)&0xFF00000000000000)>>56) \ - |(((x)&0x000000000000FF00)<<40) \ - |(((x)&0x00FF000000000000)>>40) \ - |(((x)&0x0000000000FF0000)<<24) \ - |(((x)&0x0000FF0000000000)>>24) \ - |(((x)&0x00000000FF000000)<<8) \ - |(((x)&0x000000FF00000000)>>8)) -#else -define_swapx(l,long) -#endif -#endif - -#if SIZEOF_FLOAT == 4 -#if SIZEOF_LONG == 4 /* SIZEOF_FLOAT == 4 == SIZEOF_LONG */ -#define swapf(x) swapl(x) -#define FLOAT_SWAPPER unsigned long -#else -#if SIZEOF_SHORT == 4 /* SIZEOF_FLOAT == 4 == SIZEOF_SHORT */ -#define swapf(x) swaps(x) -#define FLOAT_SWAPPER unsigned short -#else /* SIZEOF_FLOAT == 4 but undivide by known size of int */ -define_swapx(f,float) -#endif /* #if SIZEOF_SHORT == 4 */ -#endif /* #if SIZEOF_LONG == 4 */ -#else /* SIZEOF_FLOAT != 4 */ -define_swapx(f,float) -#endif /* #if SIZEOF_FLOAT == 4 */ - -#if SIZEOF_DOUBLE == 8 -#if SIZEOF_LONG == 8 /* SIZEOF_DOUBLE == 8 == SIZEOF_LONG */ -#define swapd(x) swapl(x) -#define DOUBLE_SWAPPER unsigned long -#else -#if SIZEOF_LONG == 4 /* SIZEOF_DOUBLE == 8 && 4 == SIZEOF_LONG */ -static double -swapd(d) - const double d; -{ - double dtmp = d; - unsigned long utmp[2]; - unsigned long utmp0; - - utmp[0] = 0; utmp[1] = 0; - memcpy(utmp,&dtmp,sizeof(double)); - utmp0 = utmp[0]; - utmp[0] = swapl(utmp[1]); - utmp[1] = swapl(utmp0); - memcpy(&dtmp,utmp,sizeof(double)); - return dtmp; -} -#else -#if SIZEOF_SHORT == 4 /* SIZEOF_DOUBLE == 8 && 4 == SIZEOF_SHORT */ -static double -swapd(d) - const double d; -{ - double dtmp = d; - unsigned short utmp[2]; - unsigned short utmp0; - - utmp[0] = 0; utmp[1] = 0; - memcpy(utmp,&dtmp,sizeof(double)); - utmp0 = utmp[0]; - utmp[0] = swaps(utmp[1]); - utmp[1] = swaps(utmp0); - memcpy(&dtmp,utmp,sizeof(double)); - return dtmp; -} -#else /* SIZEOF_DOUBLE == 8 but undivied by known size of int */ -define_swapx(d, double) -#endif /* #if SIZEOF_SHORT == 4 */ -#endif /* #if SIZEOF_LONG == 4 */ -#endif /* #if SIZEOF_LONG == 8 */ -#else /* SIZEOF_DOUBLE != 8 */ -define_swapx(d, double) -#endif /* #if SIZEOF_DOUBLE == 8 */ - -#undef define_swapx - -#ifdef DYNAMIC_ENDIAN -#ifdef ntohs -#undef ntohs -#undef ntohl -#undef htons -#undef htonl -#endif -static int -endian() -{ - static int init = 0; - static int endian_value; - char *p; - - if (init) return endian_value; - init = 1; - p = (char*)&init; - return endian_value = p[0]?0:1; -} - -#define ntohs(x) (endian()?(x):swaps(x)) -#define ntohl(x) (endian()?(x):swapl(x)) -#define ntohf(x) (endian()?(x):swapf(x)) -#define ntohd(x) (endian()?(x):swapd(x)) -#define htons(x) (endian()?(x):swaps(x)) -#define htonl(x) (endian()?(x):swapl(x)) -#define htonf(x) (endian()?(x):swapf(x)) -#define htond(x) (endian()?(x):swapd(x)) -#define htovs(x) (endian()?swaps(x):(x)) -#define htovl(x) (endian()?swapl(x):(x)) -#define htovf(x) (endian()?swapf(x):(x)) -#define htovd(x) (endian()?swapd(x):(x)) -#define vtohs(x) (endian()?swaps(x):(x)) -#define vtohl(x) (endian()?swapl(x):(x)) -#define vtohf(x) (endian()?swapf(x):(x)) -#define vtohd(x) (endian()?swapd(x):(x)) -# ifdef NATINT_PACK -#define htov16(x) (endian()?swap16(x):(x)) -#define htov32(x) (endian()?swap32(x):(x)) -#define hton16(x) (endian()?(x):swap16(x)) -#define hton32(x) (endian()?(x):swap32(x)) -# endif -#else -#ifdef WORDS_BIGENDIAN -#ifndef ntohs -#define ntohs(x) (x) -#define ntohl(x) (x) -#define htons(x) (x) -#define htonl(x) (x) -#endif -#define ntohf(x) (x) -#define ntohd(x) (x) -#define htonf(x) (x) -#define htond(x) (x) -#define htovs(x) swaps(x) -#define htovl(x) swapl(x) -#define htovf(x) swapf(x) -#define htovd(x) swapd(x) -#define vtohs(x) swaps(x) -#define vtohl(x) swapl(x) -#define vtohf(x) swapf(x) -#define vtohd(x) swapd(x) -# ifdef NATINT_PACK -#define htov16(x) swap16(x) -#define htov32(x) swap32(x) -#define hton16(x) (x) -#define hton32(x) (x) -# endif -#else /* LITTLE ENDIAN */ -#ifdef ntohs -#undef ntohs -#undef ntohl -#undef htons -#undef htonl -#endif -#define ntohs(x) swaps(x) -#define ntohl(x) swapl(x) -#define htons(x) swaps(x) -#define htonl(x) swapl(x) -#define ntohf(x) swapf(x) -#define ntohd(x) swapd(x) -#define htonf(x) swapf(x) -#define htond(x) swapd(x) -#define htovs(x) (x) -#define htovl(x) (x) -#define htovf(x) (x) -#define htovd(x) (x) -#define vtohs(x) (x) -#define vtohl(x) (x) -#define vtohf(x) (x) -#define vtohd(x) (x) -# ifdef NATINT_PACK -#define htov16(x) (x) -#define htov32(x) (x) -#define hton16(x) swap16(x) -#define hton32(x) swap32(x) -# endif -#endif -#endif - -#ifdef FLOAT_SWAPPER -#define FLOAT_CONVWITH(y) FLOAT_SWAPPER y; -#define HTONF(x,y) (memcpy(&y,&x,sizeof(float)), \ - y = htonf((FLOAT_SWAPPER)y), \ - memcpy(&x,&y,sizeof(float)), \ - x) -#define HTOVF(x,y) (memcpy(&y,&x,sizeof(float)), \ - y = htovf((FLOAT_SWAPPER)y), \ - memcpy(&x,&y,sizeof(float)), \ - x) -#define NTOHF(x,y) (memcpy(&y,&x,sizeof(float)), \ - y = ntohf((FLOAT_SWAPPER)y), \ - memcpy(&x,&y,sizeof(float)), \ - x) -#define VTOHF(x,y) (memcpy(&y,&x,sizeof(float)), \ - y = vtohf((FLOAT_SWAPPER)y), \ - memcpy(&x,&y,sizeof(float)), \ - x) -#else -#define FLOAT_CONVWITH(y) -#define HTONF(x,y) htonf(x) -#define HTOVF(x,y) htovf(x) -#define NTOHF(x,y) ntohf(x) -#define VTOHF(x,y) vtohf(x) -#endif - -#ifdef DOUBLE_SWAPPER -#define DOUBLE_CONVWITH(y) DOUBLE_SWAPPER y; -#define HTOND(x,y) (memcpy(&y,&x,sizeof(double)), \ - y = htond((DOUBLE_SWAPPER)y), \ - memcpy(&x,&y,sizeof(double)), \ - x) -#define HTOVD(x,y) (memcpy(&y,&x,sizeof(double)), \ - y = htovd((DOUBLE_SWAPPER)y), \ - memcpy(&x,&y,sizeof(double)), \ - x) -#define NTOHD(x,y) (memcpy(&y,&x,sizeof(double)), \ - y = ntohd((DOUBLE_SWAPPER)y), \ - memcpy(&x,&y,sizeof(double)), \ - x) -#define VTOHD(x,y) (memcpy(&y,&x,sizeof(double)), \ - y = vtohd((DOUBLE_SWAPPER)y), \ - memcpy(&x,&y,sizeof(double)), \ - x) -#else -#define DOUBLE_CONVWITH(y) -#define HTOND(x,y) htond(x) -#define HTOVD(x,y) htovd(x) -#define NTOHD(x,y) ntohd(x) -#define VTOHD(x,y) vtohd(x) -#endif - -unsigned long rb_big2ulong_pack _((VALUE x)); - -static unsigned long -num2i32(x) - VALUE x; -{ - x = rb_to_int(x); /* is nil OK? (should not) */ - - if (FIXNUM_P(x)) return FIX2LONG(x); - if (TYPE(x) == T_BIGNUM) { - return rb_big2ulong_pack(x); - } - rb_raise(rb_eTypeError, "can't convert %s to `integer'", rb_obj_classname(x)); - return 0; /* not reached */ -} - -#if SIZEOF_LONG == SIZE32 -# define EXTEND32(x) -#else -/* invariant in modulo 1<<31 */ -# define EXTEND32(x) do { if (!natint) {(x) = (((1L<<31)-1-(x))^~(~0L<<31));}} while(0) -#endif -#if SIZEOF_SHORT == SIZE16 -# define EXTEND16(x) -#else -# define EXTEND16(x) do { if (!natint) {(x) = (short)(((1<<15)-1-(x))^~(~0<<15));}} while(0) -#endif - -#ifdef HAVE_LONG_LONG -# define QUAD_SIZE sizeof(LONG_LONG) -#else -# define QUAD_SIZE 8 -#endif -static const char toofew[] = "too few arguments"; - -static void encodes _((VALUE,char*,long,int)); -static void qpencode _((VALUE,VALUE,long)); - -static int uv_to_utf8 _((char*,unsigned long)); -static unsigned long utf8_to_uv _((char*,long*)); - -/* - * call-seq: - * arr.pack ( aTemplateString ) -> aBinaryString - * - * Packs the contents of arr into a binary sequence according to - * the directives in aTemplateString (see the table below) - * Directives ``A,'' ``a,'' and ``Z'' may be followed by a count, - * which gives the width of the resulting field. The remaining - * directives also may take a count, indicating the number of array - * elements to convert. If the count is an asterisk - * (``*''), all remaining array elements will be - * converted. Any of the directives ``sSiIlL'' may be - * followed by an underscore (``_'') to use the underlying - * platform's native size for the specified type; otherwise, they use a - * platform-independent size. Spaces are ignored in the template - * string. See also String#unpack. - * - * a = [ "a", "b", "c" ] - * n = [ 65, 66, 67 ] - * a.pack("A3A3A3") #=> "a b c " - * a.pack("a3a3a3") #=> "a\000\000b\000\000c\000\000" - * n.pack("ccc") #=> "ABC" - * - * Directives for +pack+. - * - * Directive Meaning - * --------------------------------------------------------------- - * @ | Moves to absolute position - * A | ASCII string (space padded, count is width) - * a | ASCII string (null padded, count is width) - * B | Bit string (descending bit order) - * b | Bit string (ascending bit order) - * C | Unsigned char - * c | Char - * D, d | Double-precision float, native format - * E | Double-precision float, little-endian byte order - * e | Single-precision float, little-endian byte order - * F, f | Single-precision float, native format - * G | Double-precision float, network (big-endian) byte order - * g | Single-precision float, network (big-endian) byte order - * H | Hex string (high nibble first) - * h | Hex string (low nibble first) - * I | Unsigned integer - * i | Integer - * L | Unsigned long - * l | Long - * M | Quoted printable, MIME encoding (see RFC2045) - * m | Base64 encoded string - * N | Long, network (big-endian) byte order - * n | Short, network (big-endian) byte-order - * P | Pointer to a structure (fixed-length string) - * p | Pointer to a null-terminated string - * Q, q | 64-bit number - * S | Unsigned short - * s | Short - * U | UTF-8 - * u | UU-encoded string - * V | Long, little-endian byte order - * v | Short, little-endian byte order - * w | BER-compressed integer\fnm - * X | Back up a byte - * x | Null byte - * Z | Same as ``a'', except that null is added with * - */ - -static VALUE -pack_pack(ary, fmt) - VALUE ary, fmt; -{ - static char *nul10 = "\0\0\0\0\0\0\0\0\0\0"; - static char *spc10 = " "; - char *p, *pend; - VALUE res, from, associates = 0; - char type; - long items, len, idx, plen; - char *ptr; -#ifdef NATINT_PACK - int natint; /* native integer */ -#endif - - StringValue(fmt); - p = RSTRING(fmt)->ptr; - pend = p + RSTRING(fmt)->len; - res = rb_str_buf_new(0); - - items = RARRAY(ary)->len; - idx = 0; - -#define TOO_FEW (rb_raise(rb_eArgError, toofew), 0) -#define THISFROM (items > 0 ? RARRAY(ary)->ptr[idx] : TOO_FEW) -#define NEXTFROM (items-- > 0 ? RARRAY(ary)->ptr[idx++] : TOO_FEW) - - while (p < pend) { - if (RSTRING(fmt)->ptr + RSTRING(fmt)->len != pend) { - rb_raise(rb_eRuntimeError, "format string modified"); - } - type = *p++; /* get data type */ -#ifdef NATINT_PACK - natint = 0; -#endif - - if (ISSPACE(type)) continue; - if (type == '#') { - while ((p < pend) && (*p != '\n')) { - p++; - } - continue; - } - if (*p == '_' || *p == '!') { - const char *natstr = "sSiIlL"; - - if (strchr(natstr, type)) { -#ifdef NATINT_PACK - natint = 1; -#endif - p++; - } - else { - rb_raise(rb_eArgError, "'%c' allowed only after types %s", *p, natstr); - } - } - if (*p == '*') { /* set data length */ - len = strchr("@Xxu", type) ? 0 - : strchr("PMm", type) ? 1 - : items; - p++; - } - else if (ISDIGIT(*p)) { - len = strtoul(p, (char**)&p, 10); - } - else { - len = 1; - } - - switch (type) { - case 'A': case 'a': case 'Z': - case 'B': case 'b': - case 'H': case 'h': - from = NEXTFROM; - if (NIL_P(from)) { - ptr = ""; - plen = 0; - } - else { - StringValue(from); - ptr = RSTRING(from)->ptr; - plen = RSTRING(from)->len; - OBJ_INFECT(res, from); - } - - if (p[-1] == '*') - len = plen; - - switch (type) { - case 'a': /* arbitrary binary string (null padded) */ - case 'A': /* ASCII string (space padded) */ - case 'Z': /* null terminated ASCII string */ - if (plen >= len) { - rb_str_buf_cat(res, ptr, len); - if (p[-1] == '*' && type == 'Z') - rb_str_buf_cat(res, nul10, 1); - } - else { - rb_str_buf_cat(res, ptr, plen); - len -= plen; - while (len >= 10) { - rb_str_buf_cat(res, (type == 'A')?spc10:nul10, 10); - len -= 10; - } - rb_str_buf_cat(res, (type == 'A')?spc10:nul10, len); - } - break; - - case 'b': /* bit string (ascending) */ - { - int byte = 0; - long i, j = 0; - - if (len > plen) { - j = (len - plen + 1)/2; - len = plen; - } - for (i=0; i++ < len; ptr++) { - if (*ptr & 1) - byte |= 128; - if (i & 7) - byte >>= 1; - else { - char c = byte & 0xff; - rb_str_buf_cat(res, &c, 1); - byte = 0; - } - } - if (len & 7) { - char c; - byte >>= 7 - (len & 7); - c = byte & 0xff; - rb_str_buf_cat(res, &c, 1); - } - len = j; - goto grow; - } - break; - - case 'B': /* bit string (descending) */ - { - int byte = 0; - long i, j = 0; - - if (len > plen) { - j = (len - plen + 1)/2; - len = plen; - } - for (i=0; i++ < len; ptr++) { - byte |= *ptr & 1; - if (i & 7) - byte <<= 1; - else { - char c = byte & 0xff; - rb_str_buf_cat(res, &c, 1); - byte = 0; - } - } - if (len & 7) { - char c; - byte <<= 7 - (len & 7); - c = byte & 0xff; - rb_str_buf_cat(res, &c, 1); - } - len = j; - goto grow; - } - break; - - case 'h': /* hex string (low nibble first) */ - { - int byte = 0; - long i, j = 0; - - if (len > plen) { - j = (len + 1) / 2 - (plen + 1) / 2; - len = plen; - } - for (i=0; i++ < len; ptr++) { - if (ISALPHA(*ptr)) - byte |= (((*ptr & 15) + 9) & 15) << 4; - else - byte |= (*ptr & 15) << 4; - if (i & 1) - byte >>= 4; - else { - char c = byte & 0xff; - rb_str_buf_cat(res, &c, 1); - byte = 0; - } - } - if (len & 1) { - char c = byte & 0xff; - rb_str_buf_cat(res, &c, 1); - } - len = j; - goto grow; - } - break; - - case 'H': /* hex string (high nibble first) */ - { - int byte = 0; - long i, j = 0; - - if (len > plen) { - j = (len + 1) / 2 - (plen + 1) / 2; - len = plen; - } - for (i=0; i++ < len; ptr++) { - if (ISALPHA(*ptr)) - byte |= ((*ptr & 15) + 9) & 15; - else - byte |= *ptr & 15; - if (i & 1) - byte <<= 4; - else { - char c = byte & 0xff; - rb_str_buf_cat(res, &c, 1); - byte = 0; - } - } - if (len & 1) { - char c = byte & 0xff; - rb_str_buf_cat(res, &c, 1); - } - len = j; - goto grow; - } - break; - } - break; - - case 'c': /* signed char */ - case 'C': /* unsigned char */ - while (len-- > 0) { - char c; - - from = NEXTFROM; - c = num2i32(from); - rb_str_buf_cat(res, &c, sizeof(char)); - } - break; - - case 's': /* signed short */ - case 'S': /* unsigned short */ - while (len-- > 0) { - short s; - - from = NEXTFROM; - s = num2i32(from); - rb_str_buf_cat(res, OFF16(&s), NATINT_LEN(short,2)); - } - break; - - case 'i': /* signed int */ - case 'I': /* unsigned int */ - while (len-- > 0) { - long i; - - from = NEXTFROM; - i = num2i32(from); - rb_str_buf_cat(res, OFF32(&i), NATINT_LEN(int,4)); - } - break; - - case 'l': /* signed long */ - case 'L': /* unsigned long */ - while (len-- > 0) { - long l; - - from = NEXTFROM; - l = num2i32(from); - rb_str_buf_cat(res, OFF32(&l), NATINT_LEN(long,4)); - } - break; - - case 'q': /* signed quad (64bit) int */ - case 'Q': /* unsigned quad (64bit) int */ - while (len-- > 0) { - char tmp[QUAD_SIZE]; - - from = NEXTFROM; - rb_quad_pack(tmp, from); - rb_str_buf_cat(res, (char*)&tmp, QUAD_SIZE); - } - break; - - case 'n': /* unsigned short (network byte-order) */ - while (len-- > 0) { - unsigned short s; - - from = NEXTFROM; - s = num2i32(from); - s = NATINT_HTONS(s); - rb_str_buf_cat(res, OFF16(&s), NATINT_LEN(short,2)); - } - break; - - case 'N': /* unsigned long (network byte-order) */ - while (len-- > 0) { - unsigned long l; - - from = NEXTFROM; - l = num2i32(from); - l = NATINT_HTONL(l); - rb_str_buf_cat(res, OFF32(&l), NATINT_LEN(long,4)); - } - break; - - case 'v': /* unsigned short (VAX byte-order) */ - while (len-- > 0) { - unsigned short s; - - from = NEXTFROM; - s = num2i32(from); - s = NATINT_HTOVS(s); - rb_str_buf_cat(res, OFF16(&s), NATINT_LEN(short,2)); - } - break; - - case 'V': /* unsigned long (VAX byte-order) */ - while (len-- > 0) { - unsigned long l; - - from = NEXTFROM; - l = num2i32(from); - l = NATINT_HTOVL(l); - rb_str_buf_cat(res, OFF32(&l), NATINT_LEN(long,4)); - } - break; - - case 'f': /* single precision float in native format */ - case 'F': /* ditto */ - while (len-- > 0) { - float f; - - from = NEXTFROM; - f = RFLOAT(rb_Float(from))->value; - rb_str_buf_cat(res, (char*)&f, sizeof(float)); - } - break; - - case 'e': /* single precision float in VAX byte-order */ - while (len-- > 0) { - float f; - FLOAT_CONVWITH(ftmp); - - from = NEXTFROM; - f = RFLOAT(rb_Float(from))->value; - f = HTOVF(f,ftmp); - rb_str_buf_cat(res, (char*)&f, sizeof(float)); - } - break; - - case 'E': /* double precision float in VAX byte-order */ - while (len-- > 0) { - double d; - DOUBLE_CONVWITH(dtmp); - - from = NEXTFROM; - d = RFLOAT(rb_Float(from))->value; - d = HTOVD(d,dtmp); - rb_str_buf_cat(res, (char*)&d, sizeof(double)); - } - break; - - case 'd': /* double precision float in native format */ - case 'D': /* ditto */ - while (len-- > 0) { - double d; - - from = NEXTFROM; - d = RFLOAT(rb_Float(from))->value; - rb_str_buf_cat(res, (char*)&d, sizeof(double)); - } - break; - - case 'g': /* single precision float in network byte-order */ - while (len-- > 0) { - float f; - FLOAT_CONVWITH(ftmp); - - from = NEXTFROM; - f = RFLOAT(rb_Float(from))->value; - f = HTONF(f,ftmp); - rb_str_buf_cat(res, (char*)&f, sizeof(float)); - } - break; - - case 'G': /* double precision float in network byte-order */ - while (len-- > 0) { - double d; - DOUBLE_CONVWITH(dtmp); - - from = NEXTFROM; - d = RFLOAT(rb_Float(from))->value; - d = HTOND(d,dtmp); - rb_str_buf_cat(res, (char*)&d, sizeof(double)); - } - break; - - case 'x': /* null byte */ - grow: - while (len >= 10) { - rb_str_buf_cat(res, nul10, 10); - len -= 10; - } - rb_str_buf_cat(res, nul10, len); - break; - - case 'X': /* back up byte */ - shrink: - plen = RSTRING(res)->len; - if (plen < len) - rb_raise(rb_eArgError, "X outside of string"); - RSTRING(res)->len = plen - len; - RSTRING(res)->ptr[plen - len] = '\0'; - break; - - case '@': /* null fill to absolute position */ - len -= RSTRING(res)->len; - if (len > 0) goto grow; - len = -len; - if (len > 0) goto shrink; - break; - - case '%': - rb_raise(rb_eArgError, "%% is not supported"); - break; - - case 'U': /* Unicode character */ - while (len-- > 0) { - long l; - char buf[8]; - int le; - - from = NEXTFROM; - from = rb_to_int(from); - l = NUM2INT(from); - if (l < 0) { - rb_raise(rb_eRangeError, "pack(U): value out of range"); - } - le = uv_to_utf8(buf, l); - rb_str_buf_cat(res, (char*)buf, le); - } - break; - - case 'u': /* uuencoded string */ - case 'm': /* base64 encoded string */ - from = NEXTFROM; - StringValue(from); - ptr = RSTRING(from)->ptr; - plen = RSTRING(from)->len; - - if (len <= 2) - len = 45; - else - len = len / 3 * 3; - while (plen > 0) { - long todo; - - if (plen > len) - todo = len; - else - todo = plen; - encodes(res, ptr, todo, type); - plen -= todo; - ptr += todo; - } - break; - - case 'M': /* quoted-printable encoded string */ - from = rb_obj_as_string(NEXTFROM); - if (len <= 1) - len = 72; - qpencode(res, from, len); - break; - - case 'P': /* pointer to packed byte string */ - from = THISFROM; - if (!NIL_P(from)) { - StringValue(from); - if (RSTRING(from)->len < len) { - rb_raise(rb_eArgError, "too short buffer for P(%ld for %ld)", - RSTRING(from)->len, len); - } - } - len = 1; - /* FALL THROUGH */ - case 'p': /* pointer to string */ - while (len-- > 0) { - char *t; - from = NEXTFROM; - if (NIL_P(from)) { - t = 0; - } - else { - t = StringValuePtr(from); - } - if (!associates) { - associates = rb_ary_new(); - } - rb_ary_push(associates, from); - rb_obj_taint(from); - rb_str_buf_cat(res, (char*)&t, sizeof(char*)); - } - break; - - case 'w': /* BER compressed integer */ - while (len-- > 0) { - unsigned long ul; - VALUE buf = rb_str_new(0, 0); - char c, *bufs, *bufe; - - from = NEXTFROM; - if (TYPE(from) == T_BIGNUM) { - VALUE big128 = rb_uint2big(128); - while (TYPE(from) == T_BIGNUM) { - from = rb_big_divmod(from, big128); - c = NUM2INT(RARRAY(from)->ptr[1]) | 0x80; /* mod */ - rb_str_buf_cat(buf, &c, sizeof(char)); - from = RARRAY(from)->ptr[0]; /* div */ - } - } - - { - long l = NUM2LONG(from); - if (l < 0) { - rb_raise(rb_eArgError, "can't compress negative numbers"); - } - ul = l; - } - - while (ul) { - c = ((ul & 0x7f) | 0x80); - rb_str_buf_cat(buf, &c, sizeof(char)); - ul >>= 7; - } - - if (RSTRING(buf)->len) { - bufs = RSTRING(buf)->ptr; - bufe = bufs + RSTRING(buf)->len - 1; - *bufs &= 0x7f; /* clear continue bit */ - while (bufs < bufe) { /* reverse */ - c = *bufs; - *bufs++ = *bufe; - *bufe-- = c; - } - rb_str_buf_cat(res, RSTRING(buf)->ptr, RSTRING(buf)->len); - } - else { - c = 0; - rb_str_buf_cat(res, &c, sizeof(char)); - } - } - break; - - default: - break; - } - } - - if (associates) { - rb_str_associate(res, associates); - } - OBJ_INFECT(res, fmt); - return res; -} - -static char uu_table[] = -"`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"; -static char b64_table[] = -"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -static void -encodes(str, s, len, type) - VALUE str; - char *s; - long len; - int type; -{ - char *buff = ALLOCA_N(char, len * 4 / 3 + 6); - long i = 0; - char *trans = type == 'u' ? uu_table : b64_table; - int padding; - - if (type == 'u') { - buff[i++] = len + ' '; - padding = '`'; - } - else { - padding = '='; - } - while (len >= 3) { - buff[i++] = trans[077 & (*s >> 2)]; - buff[i++] = trans[077 & (((*s << 4) & 060) | ((s[1] >> 4) & 017))]; - buff[i++] = trans[077 & (((s[1] << 2) & 074) | ((s[2] >> 6) & 03))]; - buff[i++] = trans[077 & s[2]]; - s += 3; - len -= 3; - } - if (len == 2) { - buff[i++] = trans[077 & (*s >> 2)]; - buff[i++] = trans[077 & (((*s << 4) & 060) | ((s[1] >> 4) & 017))]; - buff[i++] = trans[077 & (((s[1] << 2) & 074) | (('\0' >> 6) & 03))]; - buff[i++] = padding; - } - else if (len == 1) { - buff[i++] = trans[077 & (*s >> 2)]; - buff[i++] = trans[077 & (((*s << 4) & 060) | (('\0' >> 4) & 017))]; - buff[i++] = padding; - buff[i++] = padding; - } - buff[i++] = '\n'; - rb_str_buf_cat(str, buff, i); -} - -static char hex_table[] = "0123456789ABCDEF"; - -static void -qpencode(str, from, len) - VALUE str, from; - long len; -{ - char buff[1024]; - long i = 0, n = 0, prev = EOF; - unsigned char *s = (unsigned char*)RSTRING(from)->ptr; - unsigned char *send = s + RSTRING(from)->len; - - while (s < send) { - if ((*s > 126) || - (*s < 32 && *s != '\n' && *s != '\t') || - (*s == '=')) { - buff[i++] = '='; - buff[i++] = hex_table[*s >> 4]; - buff[i++] = hex_table[*s & 0x0f]; - n += 3; - prev = EOF; - } - else if (*s == '\n') { - if (prev == ' ' || prev == '\t') { - buff[i++] = '='; - buff[i++] = *s; - } - buff[i++] = *s; - n = 0; - prev = *s; - } - else { - buff[i++] = *s; - n++; - prev = *s; - } - if (n > len) { - buff[i++] = '='; - buff[i++] = '\n'; - n = 0; - prev = '\n'; - } - if (i > 1024 - 5) { - rb_str_buf_cat(str, buff, i); - i = 0; - } - s++; - } - if (n > 0) { - buff[i++] = '='; - buff[i++] = '\n'; - } - if (i > 0) { - rb_str_buf_cat(str, buff, i); - } -} - -static inline int -hex2num(c) - char c; -{ - switch (c) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - return c - '0'; - case 'a': case 'b': case 'c': - case 'd': case 'e': case 'f': - return c - 'a' + 10; - case 'A': case 'B': case 'C': - case 'D': case 'E': case 'F': - return c - 'A' + 10; - default: - return -1; - } -} - -#define PACK_LENGTH_ADJUST_SIZE(sz) do { \ - tmp = 0; \ - if (len > (send-s)/sz) { \ - if (!star) { \ - tmp = len-(send-s)/sz; \ - } \ - len = (send-s)/sz; \ - } \ -} while (0) - -#ifdef NATINT_PACK -#define PACK_LENGTH_ADJUST(type,sz) do { \ - int t__len = NATINT_LEN(type,(sz)); \ - PACK_LENGTH_ADJUST_SIZE(t__len); \ -} while (0) -#else -#define PACK_LENGTH_ADJUST(type,sz) \ - PACK_LENGTH_ADJUST_SIZE(sizeof(type)) -#endif - -#define PACK_ITEM_ADJUST() while (tmp--) rb_ary_push(ary, Qnil) - -static VALUE -infected_str_new(ptr, len, str) - const char *ptr; - long len; - VALUE str; -{ - VALUE s = rb_str_new(ptr, len); - - OBJ_INFECT(s, str); - return s; -} - -/* - * call-seq: - * str.unpack(format) => anArray - * - * Decodes str (which may contain binary data) according to the - * format string, returning an array of each value extracted. The - * format string consists of a sequence of single-character directives, - * summarized in the table at the end of this entry. - * Each directive may be followed - * by a number, indicating the number of times to repeat with this - * directive. An asterisk (``*'') will use up all - * remaining elements. The directives sSiIlL may each be - * followed by an underscore (``_'') to use the underlying - * platform's native size for the specified type; otherwise, it uses a - * platform-independent consistent size. Spaces are ignored in the - * format string. See also Array#pack. - * - * "abc \0\0abc \0\0".unpack('A6Z6') #=> ["abc", "abc "] - * "abc \0\0".unpack('a3a3') #=> ["abc", " \000\000"] - * "abc \0abc \0".unpack('Z*Z*') #=> ["abc ", "abc "] - * "aa".unpack('b8B8') #=> ["10000110", "01100001"] - * "aaa".unpack('h2H2c') #=> ["16", "61", 97] - * "\xfe\xff\xfe\xff".unpack('sS') #=> [-2, 65534] - * "now=20is".unpack('M*') #=> ["now is"] - * "whole".unpack('xax2aX2aX1aX2a') #=> ["h", "e", "l", "l", "o"] - * - * This table summarizes the various formats and the Ruby classes - * returned by each. - * - * Format | Returns | Function - * -------+---------+----------------------------------------- - * A | String | with trailing nulls and spaces removed - * -------+---------+----------------------------------------- - * a | String | string - * -------+---------+----------------------------------------- - * B | String | extract bits from each character (msb first) - * -------+---------+----------------------------------------- - * b | String | extract bits from each character (lsb first) - * -------+---------+----------------------------------------- - * C | Fixnum | extract a character as an unsigned integer - * -------+---------+----------------------------------------- - * c | Fixnum | extract a character as an integer - * -------+---------+----------------------------------------- - * d,D | Float | treat sizeof(double) characters as - * | | a native double - * -------+---------+----------------------------------------- - * E | Float | treat sizeof(double) characters as - * | | a double in little-endian byte order - * -------+---------+----------------------------------------- - * e | Float | treat sizeof(float) characters as - * | | a float in little-endian byte order - * -------+---------+----------------------------------------- - * f,F | Float | treat sizeof(float) characters as - * | | a native float - * -------+---------+----------------------------------------- - * G | Float | treat sizeof(double) characters as - * | | a double in network byte order - * -------+---------+----------------------------------------- - * g | Float | treat sizeof(float) characters as a - * | | float in network byte order - * -------+---------+----------------------------------------- - * H | String | extract hex nibbles from each character - * | | (most significant first) - * -------+---------+----------------------------------------- - * h | String | extract hex nibbles from each character - * | | (least significant first) - * -------+---------+----------------------------------------- - * I | Integer | treat sizeof(int) (modified by _) - * | | successive characters as an unsigned - * | | native integer - * -------+---------+----------------------------------------- - * i | Integer | treat sizeof(int) (modified by _) - * | | successive characters as a signed - * | | native integer - * -------+---------+----------------------------------------- - * L | Integer | treat four (modified by _) successive - * | | characters as an unsigned native - * | | long integer - * -------+---------+----------------------------------------- - * l | Integer | treat four (modified by _) successive - * | | characters as a signed native - * | | long integer - * -------+---------+----------------------------------------- - * M | String | quoted-printable - * -------+---------+----------------------------------------- - * m | String | base64-encoded - * -------+---------+----------------------------------------- - * N | Integer | treat four characters as an unsigned - * | | long in network byte order - * -------+---------+----------------------------------------- - * n | Fixnum | treat two characters as an unsigned - * | | short in network byte order - * -------+---------+----------------------------------------- - * P | String | treat sizeof(char *) characters as a - * | | pointer, and return \emph{len} characters - * | | from the referenced location - * -------+---------+----------------------------------------- - * p | String | treat sizeof(char *) characters as a - * | | pointer to a null-terminated string - * -------+---------+----------------------------------------- - * Q | Integer | treat 8 characters as an unsigned - * | | quad word (64 bits) - * -------+---------+----------------------------------------- - * q | Integer | treat 8 characters as a signed - * | | quad word (64 bits) - * -------+---------+----------------------------------------- - * S | Fixnum | treat two (different if _ used) - * | | successive characters as an unsigned - * | | short in native byte order - * -------+---------+----------------------------------------- - * s | Fixnum | Treat two (different if _ used) - * | | successive characters as a signed short - * | | in native byte order - * -------+---------+----------------------------------------- - * U | Integer | UTF-8 characters as unsigned integers - * -------+---------+----------------------------------------- - * u | String | UU-encoded - * -------+---------+----------------------------------------- - * V | Fixnum | treat four characters as an unsigned - * | | long in little-endian byte order - * -------+---------+----------------------------------------- - * v | Fixnum | treat two characters as an unsigned - * | | short in little-endian byte order - * -------+---------+----------------------------------------- - * w | Integer | BER-compressed integer (see Array.pack) - * -------+---------+----------------------------------------- - * X | --- | skip backward one character - * -------+---------+----------------------------------------- - * x | --- | skip forward one character - * -------+---------+----------------------------------------- - * Z | String | with trailing nulls removed - * | | upto first null with * - * -------+---------+----------------------------------------- - * @ | --- | skip to the offset given by the - * | | length argument - * -------+---------+----------------------------------------- - */ - -static VALUE -pack_unpack(str, fmt) - VALUE str, fmt; -{ - static char *hexdigits = "0123456789abcdef0123456789ABCDEFx"; - char *s, *send; - char *p, *pend; - VALUE ary; - char type; - long len; - int tmp, star; -#ifdef NATINT_PACK - int natint; /* native integer */ -#endif - - StringValue(str); - StringValue(fmt); - s = RSTRING(str)->ptr; - send = s + RSTRING(str)->len; - p = RSTRING(fmt)->ptr; - pend = p + RSTRING(fmt)->len; - - ary = rb_ary_new(); - while (p < pend) { - type = *p++; -#ifdef NATINT_PACK - natint = 0; -#endif - - if (ISSPACE(type)) continue; - if (type == '#') { - while ((p < pend) && (*p != '\n')) { - p++; - } - continue; - } - star = 0; - if (*p == '_' || *p == '!') { - char *natstr = "sSiIlL"; - - if (strchr(natstr, type)) { -#ifdef NATINT_PACK - natint = 1; -#endif - p++; - } - else { - rb_raise(rb_eArgError, "'%c' allowed only after types %s", *p, natstr); - } - } - if (p >= pend) - len = 1; - else if (*p == '*') { - star = 1; - len = send - s; - p++; - } - else if (ISDIGIT(*p)) { - len = strtoul(p, (char**)&p, 10); - } - else { - len = (type != '@'); - } - - switch (type) { - case '%': - rb_raise(rb_eArgError, "%% is not supported"); - break; - - case 'A': - if (len > send - s) len = send - s; - { - long end = len; - char *t = s + len - 1; - - while (t >= s) { - if (*t != ' ' && *t != '\0') break; - t--; len--; - } - rb_ary_push(ary, infected_str_new(s, len, str)); - s += end; - } - break; - - case 'Z': - { - char *t = s; - - if (len > send-s) len = send-s; - while (t < s+len && *t) t++; - rb_ary_push(ary, infected_str_new(s, t-s, str)); - if (t < send) t++; - s = star ? t : s+len; - } - break; - - case 'a': - if (len > send - s) len = send - s; - rb_ary_push(ary, infected_str_new(s, len, str)); - s += len; - break; - - case 'b': - { - VALUE bitstr; - char *t; - int bits; - long i; - - if (p[-1] == '*' || len > (send - s) * 8) - len = (send - s) * 8; - bits = 0; - rb_ary_push(ary, bitstr = rb_str_new(0, len)); - t = RSTRING(bitstr)->ptr; - for (i=0; i>= 1; - else bits = *s++; - *t++ = (bits & 1) ? '1' : '0'; - } - } - break; - - case 'B': - { - VALUE bitstr; - char *t; - int bits; - long i; - - if (p[-1] == '*' || len > (send - s) * 8) - len = (send - s) * 8; - bits = 0; - rb_ary_push(ary, bitstr = rb_str_new(0, len)); - t = RSTRING(bitstr)->ptr; - for (i=0; i (send - s) * 2) - len = (send - s) * 2; - bits = 0; - rb_ary_push(ary, bitstr = rb_str_new(0, len)); - t = RSTRING(bitstr)->ptr; - for (i=0; i>= 4; - else - bits = *s++; - *t++ = hexdigits[bits & 15]; - } - } - break; - - case 'H': - { - VALUE bitstr; - char *t; - int bits; - long i; - - if (p[-1] == '*' || len > (send - s) * 2) - len = (send - s) * 2; - bits = 0; - rb_ary_push(ary, bitstr = rb_str_new(0, len)); - t = RSTRING(bitstr)->ptr; - for (i=0; i> 4) & 15]; - } - } - break; - - case 'c': - PACK_LENGTH_ADJUST(char,sizeof(char)); - while (len-- > 0) { - int c = *s++; - if (c > (char)127) c-=256; - rb_ary_push(ary, INT2FIX(c)); - } - PACK_ITEM_ADJUST(); - break; - - case 'C': - PACK_LENGTH_ADJUST(unsigned char,sizeof(unsigned char)); - while (len-- > 0) { - unsigned char c = *s++; - rb_ary_push(ary, INT2FIX(c)); - } - PACK_ITEM_ADJUST(); - break; - - case 's': - PACK_LENGTH_ADJUST(short,2); - while (len-- > 0) { - short tmp = 0; - memcpy(OFF16(&tmp), s, NATINT_LEN(short,2)); - EXTEND16(tmp); - s += NATINT_LEN(short,2); - rb_ary_push(ary, INT2FIX(tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'S': - PACK_LENGTH_ADJUST(unsigned short,2); - while (len-- > 0) { - unsigned short tmp = 0; - memcpy(OFF16(&tmp), s, NATINT_LEN(unsigned short,2)); - s += NATINT_LEN(unsigned short,2); - rb_ary_push(ary, INT2FIX(tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'i': - PACK_LENGTH_ADJUST(int,sizeof(int)); - while (len-- > 0) { - int tmp; - memcpy(&tmp, s, sizeof(int)); - s += sizeof(int); - rb_ary_push(ary, INT2NUM(tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'I': - PACK_LENGTH_ADJUST(unsigned int,sizeof(unsigned int)); - while (len-- > 0) { - unsigned int tmp; - memcpy(&tmp, s, sizeof(unsigned int)); - s += sizeof(unsigned int); - rb_ary_push(ary, UINT2NUM(tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'l': - PACK_LENGTH_ADJUST(long,4); - while (len-- > 0) { - long tmp = 0; - memcpy(OFF32(&tmp), s, NATINT_LEN(long,4)); - EXTEND32(tmp); - s += NATINT_LEN(long,4); - rb_ary_push(ary, LONG2NUM(tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'L': - PACK_LENGTH_ADJUST(unsigned long,4); - while (len-- > 0) { - unsigned long tmp = 0; - memcpy(OFF32(&tmp), s, NATINT_LEN(unsigned long,4)); - s += NATINT_LEN(unsigned long,4); - rb_ary_push(ary, ULONG2NUM(tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'q': - PACK_LENGTH_ADJUST_SIZE(QUAD_SIZE); - while (len-- > 0) { - char *tmp = (char*)s; - s += QUAD_SIZE; - rb_ary_push(ary, rb_quad_unpack(tmp, 1)); - } - PACK_ITEM_ADJUST(); - break; - - case 'Q': - PACK_LENGTH_ADJUST_SIZE(QUAD_SIZE); - while (len-- > 0) { - char *tmp = (char*)s; - s += QUAD_SIZE; - rb_ary_push(ary, rb_quad_unpack(tmp, 0)); - } - break; - - case 'n': - PACK_LENGTH_ADJUST(unsigned short,2); - while (len-- > 0) { - unsigned short tmp = 0; - memcpy(OFF16B(&tmp), s, NATINT_LEN(unsigned short,2)); - s += NATINT_LEN(unsigned short,2); - rb_ary_push(ary, UINT2NUM(ntohs(tmp))); - } - PACK_ITEM_ADJUST(); - break; - - case 'N': - PACK_LENGTH_ADJUST(unsigned long,4); - while (len-- > 0) { - unsigned long tmp = 0; - memcpy(OFF32B(&tmp), s, NATINT_LEN(unsigned long,4)); - s += NATINT_LEN(unsigned long,4); - rb_ary_push(ary, ULONG2NUM(ntohl(tmp))); - } - PACK_ITEM_ADJUST(); - break; - - case 'v': - PACK_LENGTH_ADJUST(unsigned short,2); - while (len-- > 0) { - unsigned short tmp = 0; - memcpy(OFF16(&tmp), s, NATINT_LEN(unsigned short,2)); - s += NATINT_LEN(unsigned short,2); - rb_ary_push(ary, UINT2NUM(vtohs(tmp))); - } - PACK_ITEM_ADJUST(); - break; - - case 'V': - PACK_LENGTH_ADJUST(unsigned long,4); - while (len-- > 0) { - unsigned long tmp = 0; - memcpy(OFF32(&tmp), s, NATINT_LEN(long,4)); - s += NATINT_LEN(long,4); - rb_ary_push(ary, ULONG2NUM(vtohl(tmp))); - } - PACK_ITEM_ADJUST(); - break; - - case 'f': - case 'F': - PACK_LENGTH_ADJUST(float,sizeof(float)); - while (len-- > 0) { - float tmp; - memcpy(&tmp, s, sizeof(float)); - s += sizeof(float); - rb_ary_push(ary, rb_float_new((double)tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'e': - PACK_LENGTH_ADJUST(float,sizeof(float)); - while (len-- > 0) { - float tmp; - FLOAT_CONVWITH(ftmp); - - memcpy(&tmp, s, sizeof(float)); - s += sizeof(float); - tmp = VTOHF(tmp,ftmp); - rb_ary_push(ary, rb_float_new((double)tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'E': - PACK_LENGTH_ADJUST(double,sizeof(double)); - while (len-- > 0) { - double tmp; - DOUBLE_CONVWITH(dtmp); - - memcpy(&tmp, s, sizeof(double)); - s += sizeof(double); - tmp = VTOHD(tmp,dtmp); - rb_ary_push(ary, rb_float_new(tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'D': - case 'd': - PACK_LENGTH_ADJUST(double,sizeof(double)); - while (len-- > 0) { - double tmp; - memcpy(&tmp, s, sizeof(double)); - s += sizeof(double); - rb_ary_push(ary, rb_float_new(tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'g': - PACK_LENGTH_ADJUST(float,sizeof(float)); - while (len-- > 0) { - float tmp; - FLOAT_CONVWITH(ftmp;) - - memcpy(&tmp, s, sizeof(float)); - s += sizeof(float); - tmp = NTOHF(tmp,ftmp); - rb_ary_push(ary, rb_float_new((double)tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'G': - PACK_LENGTH_ADJUST(double,sizeof(double)); - while (len-- > 0) { - double tmp; - DOUBLE_CONVWITH(dtmp); - - memcpy(&tmp, s, sizeof(double)); - s += sizeof(double); - tmp = NTOHD(tmp,dtmp); - rb_ary_push(ary, rb_float_new(tmp)); - } - PACK_ITEM_ADJUST(); - break; - - case 'U': - if (len > send - s) len = send - s; - while (len > 0 && s < send) { - long alen = send - s; - unsigned long l; - - l = utf8_to_uv(s, &alen); - s += alen; len--; - rb_ary_push(ary, ULONG2NUM(l)); - } - break; - - case 'u': - { - VALUE buf = infected_str_new(0, (send - s)*3/4, str); - char *ptr = RSTRING(buf)->ptr; - long total = 0; - - while (s < send && *s > ' ' && *s < 'a') { - long a,b,c,d; - char hunk[4]; - - hunk[3] = '\0'; - len = (*s++ - ' ') & 077; - total += len; - if (total > RSTRING(buf)->len) { - len -= total - RSTRING(buf)->len; - total = RSTRING(buf)->len; - } - - while (len > 0) { - long mlen = len > 3 ? 3 : len; - - if (s < send && *s >= ' ') - a = (*s++ - ' ') & 077; - else - a = 0; - if (s < send && *s >= ' ') - b = (*s++ - ' ') & 077; - else - b = 0; - if (s < send && *s >= ' ') - c = (*s++ - ' ') & 077; - else - c = 0; - if (s < send && *s >= ' ') - d = (*s++ - ' ') & 077; - else - d = 0; - hunk[0] = a << 2 | b >> 4; - hunk[1] = b << 4 | c >> 2; - hunk[2] = c << 6 | d; - memcpy(ptr, hunk, mlen); - ptr += mlen; - len -= mlen; - } - if (*s == '\r') s++; - if (*s == '\n') s++; - else if (s < send && (s+1 == send || s[1] == '\n')) - s += 2; /* possible checksum byte */ - } - - RSTRING(buf)->ptr[total] = '\0'; - RSTRING(buf)->len = total; - rb_ary_push(ary, buf); - } - break; - - case 'm': - { - VALUE buf = infected_str_new(0, (send - s)*3/4, str); - char *ptr = RSTRING(buf)->ptr; - int a = -1,b = -1,c = 0,d; - static int first = 1; - static int b64_xtable[256]; - - if (first) { - int i; - first = 0; - - for (i = 0; i < 256; i++) { - b64_xtable[i] = -1; - } - for (i = 0; i < 64; i++) { - b64_xtable[(int)b64_table[i]] = i; - } - } - while (s < send) { - a = b = c = d = -1; - while((a = b64_xtable[(int)(*(unsigned char*)s)]) == -1 && s < send) { s++; } - if( s >= send ) break; - s++; - while((b = b64_xtable[(int)(*(unsigned char*)s)]) == -1 && s < send) { s++; } - if( s >= send ) break; - s++; - while((c = b64_xtable[(int)(*(unsigned char*)s)]) == -1 && s < send) { if( *s == '=' ) break; s++; } - if( *s == '=' || s >= send ) break; - s++; - while((d = b64_xtable[(int)(*(unsigned char*)s)]) == -1 && s < send) { if( *s == '=' ) break; s++; } - if( *s == '=' || s >= send ) break; - s++; - *ptr++ = a << 2 | b >> 4; - *ptr++ = b << 4 | c >> 2; - *ptr++ = c << 6 | d; - } - if (a != -1 && b != -1) { - if (c == -1 && *s == '=') - *ptr++ = a << 2 | b >> 4; - else if (c != -1 && *s == '=') { - *ptr++ = a << 2 | b >> 4; - *ptr++ = b << 4 | c >> 2; - } - } - *ptr = '\0'; - RSTRING(buf)->len = ptr - RSTRING(buf)->ptr; - rb_ary_push(ary, buf); - } - break; - - case 'M': - { - VALUE buf = infected_str_new(0, send - s, str); - char *ptr = RSTRING(buf)->ptr; - int c1, c2; - - while (s < send) { - if (*s == '=') { - if (++s == send) break; - if (s+1 < send && *s == '\r' && *(s+1) == '\n') - s++; - if (*s != '\n') { - if ((c1 = hex2num(*s)) == -1) break; - if (++s == send) break; - if ((c2 = hex2num(*s)) == -1) break; - *ptr++ = c1 << 4 | c2; - } - } - else { - *ptr++ = *s; - } - s++; - } - *ptr = '\0'; - RSTRING(buf)->len = ptr - RSTRING(buf)->ptr; - rb_ary_push(ary, buf); - } - break; - - case '@': - if (len > RSTRING(str)->len) - rb_raise(rb_eArgError, "@ outside of string"); - s = RSTRING(str)->ptr + len; - break; - - case 'X': - if (len > s - RSTRING(str)->ptr) - rb_raise(rb_eArgError, "X outside of string"); - s -= len; - break; - - case 'x': - if (len > send - s) - rb_raise(rb_eArgError, "x outside of string"); - s += len; - break; - - case 'P': - if (sizeof(char *) <= send - s) { - char *t; - VALUE tmp; - - memcpy(&t, s, sizeof(char *)); - s += sizeof(char *); - - if (t) { - VALUE a, *p, *pend; - - if (!(a = rb_str_associated(str))) { - rb_raise(rb_eArgError, "no associated pointer"); - } - p = RARRAY(a)->ptr; - pend = p + RARRAY(a)->len; - while (p < pend) { - if (TYPE(*p) == T_STRING && RSTRING(*p)->ptr == t) { - if (len < RSTRING(*p)->len) { - tmp = rb_tainted_str_new(t, len); - rb_str_associate(tmp, a); - } - else { - tmp = *p; - } - break; - } - p++; - } - if (p == pend) { - rb_raise(rb_eArgError, "non associated pointer"); - } - } - else { - tmp = Qnil; - } - rb_ary_push(ary, tmp); - } - break; - - case 'p': - if (len > (send - s) / sizeof(char *)) - len = (send - s) / sizeof(char *); - while (len-- > 0) { - if (send - s < sizeof(char *)) - break; - else { - VALUE tmp; - char *t; - - memcpy(&t, s, sizeof(char *)); - s += sizeof(char *); - - if (t) { - VALUE a, *p, *pend; - - if (!(a = rb_str_associated(str))) { - rb_raise(rb_eArgError, "no associated pointer"); - } - p = RARRAY(a)->ptr; - pend = p + RARRAY(a)->len; - while (p < pend) { - if (TYPE(*p) == T_STRING && RSTRING(*p)->ptr == t) { - tmp = *p; - break; - } - p++; - } - if (p == pend) { - rb_raise(rb_eArgError, "non associated pointer"); - } - } - else { - tmp = Qnil; - } - rb_ary_push(ary, tmp); - } - } - break; - - case 'w': - { - unsigned long ul = 0; - unsigned long ulmask = 0xfeUL << ((sizeof(unsigned long) - 1) * 8); - - while (len > 0 && s < send) { - ul <<= 7; - ul |= (*s & 0x7f); - if (!(*s++ & 0x80)) { - rb_ary_push(ary, ULONG2NUM(ul)); - len--; - ul = 0; - } - else if (ul & ulmask) { - VALUE big = rb_uint2big(ul); - VALUE big128 = rb_uint2big(128); - while (s < send) { - big = rb_big_mul(big, big128); - big = rb_big_plus(big, rb_uint2big(*s & 0x7f)); - if (!(*s++ & 0x80)) { - rb_ary_push(ary, big); - len--; - ul = 0; - break; - } - } - } - } - } - break; - - default: - break; - } - } - - return ary; -} - -#define BYTEWIDTH 8 - -static int -uv_to_utf8(buf, uv) - char *buf; - unsigned long uv; -{ - if (uv <= 0x7f) { - buf[0] = (char)uv; - return 1; - } - if (uv <= 0x7ff) { - buf[0] = ((uv>>6)&0xff)|0xc0; - buf[1] = (uv&0x3f)|0x80; - return 2; - } - if (uv <= 0xffff) { - buf[0] = ((uv>>12)&0xff)|0xe0; - buf[1] = ((uv>>6)&0x3f)|0x80; - buf[2] = (uv&0x3f)|0x80; - return 3; - } - if (uv <= 0x1fffff) { - buf[0] = ((uv>>18)&0xff)|0xf0; - buf[1] = ((uv>>12)&0x3f)|0x80; - buf[2] = ((uv>>6)&0x3f)|0x80; - buf[3] = (uv&0x3f)|0x80; - return 4; - } - if (uv <= 0x3ffffff) { - buf[0] = ((uv>>24)&0xff)|0xf8; - buf[1] = ((uv>>18)&0x3f)|0x80; - buf[2] = ((uv>>12)&0x3f)|0x80; - buf[3] = ((uv>>6)&0x3f)|0x80; - buf[4] = (uv&0x3f)|0x80; - return 5; - } - if (uv <= 0x7fffffff) { - buf[0] = ((uv>>30)&0xff)|0xfc; - buf[1] = ((uv>>24)&0x3f)|0x80; - buf[2] = ((uv>>18)&0x3f)|0x80; - buf[3] = ((uv>>12)&0x3f)|0x80; - buf[4] = ((uv>>6)&0x3f)|0x80; - buf[5] = (uv&0x3f)|0x80; - return 6; - } - rb_raise(rb_eRangeError, "pack(U): value out of range"); -} - -static const unsigned long utf8_limits[] = { - 0x0, /* 1 */ - 0x80, /* 2 */ - 0x800, /* 3 */ - 0x10000, /* 4 */ - 0x200000, /* 5 */ - 0x4000000, /* 6 */ - 0x80000000, /* 7 */ -}; - -static unsigned long -utf8_to_uv(p, lenp) - char *p; - long *lenp; -{ - int c = *p++ & 0xff; - unsigned long uv = c; - long n; - - if (!(uv & 0x80)) { - *lenp = 1; - return uv; - } - if (!(uv & 0x40)) { - *lenp = 1; - rb_raise(rb_eArgError, "malformed UTF-8 character"); - } - - if (!(uv & 0x20)) { n = 2; uv &= 0x1f; } - else if (!(uv & 0x10)) { n = 3; uv &= 0x0f; } - else if (!(uv & 0x08)) { n = 4; uv &= 0x07; } - else if (!(uv & 0x04)) { n = 5; uv &= 0x03; } - else if (!(uv & 0x02)) { n = 6; uv &= 0x01; } - else { - *lenp = 1; - rb_raise(rb_eArgError, "malformed UTF-8 character"); - } - if (n > *lenp) { - rb_raise(rb_eArgError, "malformed UTF-8 character (expected %d bytes, given %d bytes)", - n, *lenp); - } - *lenp = n--; - if (n != 0) { - while (n--) { - c = *p++ & 0xff; - if ((c & 0xc0) != 0x80) { - *lenp -= n + 1; - rb_raise(rb_eArgError, "malformed UTF-8 character"); - } - else { - c &= 0x3f; - uv = uv << 6 | c; - } - } - } - n = *lenp - 1; - if (uv < utf8_limits[n]) { - rb_raise(rb_eArgError, "redundant UTF-8 sequence"); - } - return uv; -} - -void -Init_pack() -{ - rb_define_method(rb_cArray, "pack", pack_pack, 1); - rb_define_method(rb_cString, "unpack", pack_unpack, 1); -} -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - kCLASS = 258, - kMODULE = 259, - kDEF = 260, - kUNDEF = 261, - kBEGIN = 262, - kRESCUE = 263, - kENSURE = 264, - kEND = 265, - kIF = 266, - kUNLESS = 267, - kTHEN = 268, - kELSIF = 269, - kELSE = 270, - kCASE = 271, - kWHEN = 272, - kWHILE = 273, - kUNTIL = 274, - kFOR = 275, - kBREAK = 276, - kNEXT = 277, - kREDO = 278, - kRETRY = 279, - kIN = 280, - kDO = 281, - kDO_COND = 282, - kDO_BLOCK = 283, - kRETURN = 284, - kYIELD = 285, - kSUPER = 286, - kSELF = 287, - kNIL = 288, - kTRUE = 289, - kFALSE = 290, - kAND = 291, - kOR = 292, - kNOT = 293, - kIF_MOD = 294, - kUNLESS_MOD = 295, - kWHILE_MOD = 296, - kUNTIL_MOD = 297, - kRESCUE_MOD = 298, - kALIAS = 299, - kDEFINED = 300, - klBEGIN = 301, - klEND = 302, - k__LINE__ = 303, - k__FILE__ = 304, - tIDENTIFIER = 305, - tFID = 306, - tGVAR = 307, - tIVAR = 308, - tCONSTANT = 309, - tCVAR = 310, - tINTEGER = 311, - tFLOAT = 312, - tSTRING_CONTENT = 313, - tNTH_REF = 314, - tBACK_REF = 315, - tREGEXP_END = 316, - tUPLUS = 317, - tUMINUS = 318, - tPOW = 319, - tCMP = 320, - tEQ = 321, - tEQQ = 322, - tNEQ = 323, - tGEQ = 324, - tLEQ = 325, - tANDOP = 326, - tOROP = 327, - tMATCH = 328, - tNMATCH = 329, - tDOT2 = 330, - tDOT3 = 331, - tAREF = 332, - tASET = 333, - tLSHFT = 334, - tRSHFT = 335, - tCOLON2 = 336, - tCOLON3 = 337, - tOP_ASGN = 338, - tASSOC = 339, - tLPAREN = 340, - tLPAREN_ARG = 341, - tRPAREN = 342, - tLBRACK = 343, - tLBRACE = 344, - tLBRACE_ARG = 345, - tSTAR = 346, - tAMPER = 347, - tSYMBEG = 348, - tSTRING_BEG = 349, - tXSTRING_BEG = 350, - tREGEXP_BEG = 351, - tWORDS_BEG = 352, - tQWORDS_BEG = 353, - tSTRING_DBEG = 354, - tSTRING_DVAR = 355, - tSTRING_END = 356, - tLOWEST = 357, - tUMINUS_NUM = 358, - tLAST_TOKEN = 359 - }; -#endif -/* Tokens. */ -#define kCLASS 258 -#define kMODULE 259 -#define kDEF 260 -#define kUNDEF 261 -#define kBEGIN 262 -#define kRESCUE 263 -#define kENSURE 264 -#define kEND 265 -#define kIF 266 -#define kUNLESS 267 -#define kTHEN 268 -#define kELSIF 269 -#define kELSE 270 -#define kCASE 271 -#define kWHEN 272 -#define kWHILE 273 -#define kUNTIL 274 -#define kFOR 275 -#define kBREAK 276 -#define kNEXT 277 -#define kREDO 278 -#define kRETRY 279 -#define kIN 280 -#define kDO 281 -#define kDO_COND 282 -#define kDO_BLOCK 283 -#define kRETURN 284 -#define kYIELD 285 -#define kSUPER 286 -#define kSELF 287 -#define kNIL 288 -#define kTRUE 289 -#define kFALSE 290 -#define kAND 291 -#define kOR 292 -#define kNOT 293 -#define kIF_MOD 294 -#define kUNLESS_MOD 295 -#define kWHILE_MOD 296 -#define kUNTIL_MOD 297 -#define kRESCUE_MOD 298 -#define kALIAS 299 -#define kDEFINED 300 -#define klBEGIN 301 -#define klEND 302 -#define k__LINE__ 303 -#define k__FILE__ 304 -#define tIDENTIFIER 305 -#define tFID 306 -#define tGVAR 307 -#define tIVAR 308 -#define tCONSTANT 309 -#define tCVAR 310 -#define tINTEGER 311 -#define tFLOAT 312 -#define tSTRING_CONTENT 313 -#define tNTH_REF 314 -#define tBACK_REF 315 -#define tREGEXP_END 316 -#define tUPLUS 317 -#define tUMINUS 318 -#define tPOW 319 -#define tCMP 320 -#define tEQ 321 -#define tEQQ 322 -#define tNEQ 323 -#define tGEQ 324 -#define tLEQ 325 -#define tANDOP 326 -#define tOROP 327 -#define tMATCH 328 -#define tNMATCH 329 -#define tDOT2 330 -#define tDOT3 331 -#define tAREF 332 -#define tASET 333 -#define tLSHFT 334 -#define tRSHFT 335 -#define tCOLON2 336 -#define tCOLON3 337 -#define tOP_ASGN 338 -#define tASSOC 339 -#define tLPAREN 340 -#define tLPAREN_ARG 341 -#define tRPAREN 342 -#define tLBRACK 343 -#define tLBRACE 344 -#define tLBRACE_ARG 345 -#define tSTAR 346 -#define tAMPER 347 -#define tSYMBEG 348 -#define tSTRING_BEG 349 -#define tXSTRING_BEG 350 -#define tREGEXP_BEG 351 -#define tWORDS_BEG 352 -#define tQWORDS_BEG 353 -#define tSTRING_DBEG 354 -#define tSTRING_DVAR 355 -#define tSTRING_END 356 -#define tLOWEST 357 -#define tUMINUS_NUM 358 -#define tLAST_TOKEN 359 - - - - -/* Copy the first part of user declarations. */ -#line 13 "parse.y" - - -#define YYDEBUG 1 -#define YYERROR_VERBOSE 1 -#ifndef YYSTACK_USE_ALLOCA -#define YYSTACK_USE_ALLOCA 0 -#endif - -#include "ruby.h" -#include "env.h" -#include "intern.h" -#include "node.h" -#include "st.h" -#include -#include -#include - -#define YYMALLOC rb_parser_malloc -#define YYREALLOC rb_parser_realloc -#define YYCALLOC rb_parser_calloc -#define YYFREE rb_parser_free -#define malloc YYMALLOC -#define realloc YYREALLOC -#define calloc YYCALLOC -#define free YYFREE -static void *rb_parser_malloc _((size_t)); -static void *rb_parser_realloc _((void *, size_t)); -static void *rb_parser_calloc _((size_t, size_t)); -static void rb_parser_free _((void *)); - -#define yyparse ruby_yyparse -#define yylex ruby_yylex -#define yyerror ruby_yyerror -#define yylval ruby_yylval -#define yychar ruby_yychar -#define yydebug ruby_yydebug - -#define ID_SCOPE_SHIFT 3 -#define ID_SCOPE_MASK 0x07 -#define ID_LOCAL 0x01 -#define ID_INSTANCE 0x02 -#define ID_GLOBAL 0x03 -#define ID_ATTRSET 0x04 -#define ID_CONST 0x05 -#define ID_CLASS 0x06 -#define ID_JUNK 0x07 -#define ID_INTERNAL ID_JUNK - -#define is_notop_id(id) ((id)>tLAST_TOKEN) -#define is_local_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL) -#define is_global_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL) -#define is_instance_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE) -#define is_attrset_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_ATTRSET) -#define is_const_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CONST) -#define is_class_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CLASS) -#define is_junk_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_JUNK) - -#define is_asgn_or_id(id) ((is_notop_id(id)) && \ - (((id)&ID_SCOPE_MASK) == ID_GLOBAL || \ - ((id)&ID_SCOPE_MASK) == ID_INSTANCE || \ - ((id)&ID_SCOPE_MASK) == ID_CLASS)) - -NODE *ruby_eval_tree_begin = 0; -NODE *ruby_eval_tree = 0; - -char *ruby_sourcefile; /* current source file */ -int ruby_sourceline; /* current line no. */ - -static int yylex(); -static int yyerror(); - -static enum lex_state { - EXPR_BEG, /* ignore newline, +/- is a sign. */ - EXPR_END, /* newline significant, +/- is an operator. */ - EXPR_ARG, /* newline significant, +/- is an operator. */ - EXPR_CMDARG, /* newline significant, +/- is an operator. */ - EXPR_ENDARG, /* newline significant, +/- is an operator. */ - EXPR_MID, /* newline significant, +/- is an operator. */ - EXPR_FNAME, /* ignore newline, no reserved words. */ - EXPR_DOT, /* right after `.' or `::', no reserved words. */ - EXPR_CLASS, /* immediate after `class', no here document. */ -} lex_state; -static NODE *lex_strterm; - -#ifdef HAVE_LONG_LONG -typedef unsigned LONG_LONG stack_type; -#else -typedef unsigned long stack_type; -#endif - -#define BITSTACK_PUSH(stack, n) (stack = (stack<<1)|((n)&1)) -#define BITSTACK_POP(stack) (stack >>= 1) -#define BITSTACK_LEXPOP(stack) (stack = (stack >> 1) | (stack & 1)) -#define BITSTACK_SET_P(stack) (stack&1) - -static stack_type cond_stack = 0; -#define COND_PUSH(n) BITSTACK_PUSH(cond_stack, n) -#define COND_POP() BITSTACK_POP(cond_stack) -#define COND_LEXPOP() BITSTACK_LEXPOP(cond_stack) -#define COND_P() BITSTACK_SET_P(cond_stack) - -static stack_type cmdarg_stack = 0; -#define CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, n) -#define CMDARG_POP() BITSTACK_POP(cmdarg_stack) -#define CMDARG_LEXPOP() BITSTACK_LEXPOP(cmdarg_stack) -#define CMDARG_P() BITSTACK_SET_P(cmdarg_stack) - -static int class_nest = 0; -static int in_single = 0; -static int in_def = 0; -static int compile_for_eval = 0; -static ID cur_mid = 0; -static int command_start = Qtrue; - -static NODE *deferred_nodes; - -static NODE *cond(); -static NODE *logop(); -static int cond_negative(); - -static NODE *newline_node(); -static void fixpos(); - -static int value_expr0(); -static void void_expr0(); -static void void_stmts(); -static NODE *remove_begin(); -#define value_expr(node) value_expr0((node) = remove_begin(node)) -#define void_expr(node) void_expr0((node) = remove_begin(node)) - -static NODE *block_append(); -static NODE *list_append(); -static NODE *list_concat(); -static NODE *arg_concat(); -static NODE *arg_prepend(); -static NODE *literal_concat(); -static NODE *new_evstr(); -static NODE *evstr2dstr(); -static NODE *call_op(); -static int in_defined = 0; - -static NODE *negate_lit(); -static NODE *ret_args(); -static NODE *arg_blk_pass(); -static NODE *new_call(); -static NODE *new_fcall(); -static NODE *new_super(); -static NODE *new_yield(); - -static NODE *gettable(); -static NODE *assignable(); -static NODE *aryset(); -static NODE *attrset(); -static void rb_backref_error(); -static NODE *node_assign(); - -static NODE *match_gen(); -static void local_push(); -static void local_pop(); -static int local_append(); -static int local_cnt(); -static int local_id(); -static ID *local_tbl(); -static ID internal_id(); - -static struct RVarmap *dyna_push(); -static void dyna_pop(); -static int dyna_in_block(); -static NODE *dyna_init(); - -static void top_local_init(); -static void top_local_setup(); - -static void fixup_nodes(); - -#define RE_OPTION_ONCE 0x80 - -#define NODE_STRTERM NODE_ZARRAY /* nothing to gc */ -#define NODE_HEREDOC NODE_ARRAY /* 1, 3 to gc */ -#define SIGN_EXTEND(x,n) (((1<<(n)-1)^((x)&~(~0<<(n))))-(1<<(n)-1)) -#define nd_func u1.id -#if SIZEOF_SHORT == 2 -#define nd_term(node) ((signed short)(node)->u2.id) -#else -#define nd_term(node) SIGN_EXTEND((node)->u2.id, CHAR_BIT*2) -#endif -#define nd_paren(node) (char)((node)->u2.id >> CHAR_BIT*2) -#define nd_nest u3.id - -/* Older versions of Yacc set YYMAXDEPTH to a very low value by default (150, - for instance). This is too low for Ruby to parse some files, such as - date/format.rb, therefore bump the value up to at least Bison's default. */ -#ifdef OLD_YACC -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif -#endif - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 213 "parse.y" -{ - NODE *node; - ID id; - int num; - struct RVarmap *vars; -} -/* Line 193 of yacc.c. */ -#line 511 "parse.c" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 216 of yacc.c. */ -#line 524 "parse.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 9550 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 132 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 144 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 501 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 895 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 359 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 129, 117, 2, 2, 2, 115, 110, 2, - 128, 125, 113, 111, 126, 112, 124, 114, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 105, 131, - 107, 103, 106, 104, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 122, 2, 123, 109, 2, 127, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 120, 108, 121, 118, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 116, 119 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 4, 7, 12, 15, 17, 19, 23, - 26, 27, 32, 36, 40, 44, 47, 51, 55, 59, - 63, 67, 68, 74, 79, 83, 87, 91, 98, 104, - 110, 116, 120, 124, 128, 132, 134, 136, 140, 144, - 147, 150, 152, 154, 156, 158, 161, 164, 167, 169, - 174, 179, 180, 181, 188, 191, 195, 200, 206, 211, - 217, 220, 223, 225, 229, 231, 235, 237, 240, 244, - 247, 250, 252, 254, 258, 261, 265, 267, 272, 276, - 280, 284, 288, 291, 293, 295, 300, 304, 308, 312, - 316, 319, 321, 323, 325, 328, 330, 334, 336, 338, - 340, 342, 344, 346, 348, 350, 352, 354, 355, 360, - 362, 364, 366, 368, 370, 372, 374, 376, 378, 380, - 382, 384, 386, 388, 390, 392, 394, 396, 398, 400, - 402, 404, 406, 408, 410, 412, 414, 416, 418, 420, - 422, 424, 426, 428, 430, 432, 434, 436, 438, 440, - 442, 444, 446, 448, 450, 452, 454, 456, 458, 460, - 462, 464, 466, 468, 470, 472, 474, 476, 478, 480, - 482, 484, 486, 488, 490, 492, 496, 502, 506, 513, - 519, 525, 531, 537, 542, 546, 550, 554, 558, 562, - 566, 570, 574, 578, 583, 588, 591, 594, 598, 602, - 606, 610, 614, 618, 622, 626, 630, 634, 638, 642, - 646, 649, 652, 656, 660, 664, 668, 669, 674, 680, - 682, 684, 686, 689, 692, 698, 701, 705, 709, 714, - 719, 726, 728, 730, 732, 735, 741, 744, 750, 755, - 763, 767, 769, 774, 778, 784, 792, 795, 801, 806, - 813, 821, 831, 835, 837, 838, 841, 843, 844, 848, - 849, 854, 857, 860, 862, 864, 868, 872, 877, 880, - 882, 884, 886, 888, 890, 892, 894, 896, 898, 899, - 904, 905, 911, 915, 919, 922, 927, 931, 935, 937, - 942, 946, 948, 949, 956, 959, 961, 964, 971, 978, - 979, 980, 988, 989, 990, 998, 1004, 1009, 1015, 1016, - 1017, 1027, 1028, 1035, 1036, 1037, 1046, 1047, 1053, 1054, - 1061, 1062, 1063, 1073, 1075, 1077, 1079, 1081, 1083, 1085, - 1087, 1089, 1092, 1094, 1096, 1098, 1100, 1106, 1108, 1111, - 1113, 1115, 1117, 1120, 1122, 1126, 1127, 1128, 1135, 1138, - 1143, 1148, 1151, 1156, 1161, 1165, 1168, 1170, 1171, 1172, - 1179, 1180, 1181, 1188, 1194, 1196, 1201, 1204, 1206, 1208, - 1215, 1217, 1219, 1221, 1223, 1226, 1228, 1231, 1233, 1235, - 1237, 1239, 1241, 1243, 1246, 1250, 1254, 1258, 1262, 1266, - 1267, 1271, 1273, 1276, 1280, 1284, 1285, 1289, 1290, 1293, - 1294, 1297, 1299, 1300, 1304, 1305, 1310, 1312, 1314, 1316, - 1318, 1321, 1323, 1325, 1327, 1329, 1333, 1335, 1337, 1340, - 1343, 1345, 1347, 1349, 1351, 1353, 1355, 1357, 1359, 1361, - 1363, 1365, 1367, 1369, 1371, 1373, 1375, 1376, 1381, 1384, - 1389, 1392, 1399, 1404, 1409, 1412, 1417, 1420, 1423, 1425, - 1426, 1428, 1430, 1432, 1434, 1436, 1438, 1442, 1446, 1448, - 1452, 1454, 1456, 1459, 1461, 1463, 1465, 1468, 1471, 1473, - 1475, 1476, 1482, 1484, 1487, 1490, 1492, 1496, 1500, 1502, - 1504, 1506, 1508, 1510, 1512, 1514, 1516, 1518, 1520, 1522, - 1524, 1525, 1527, 1528, 1530, 1531, 1533, 1535, 1537, 1539, - 1541, 1544 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 133, 0, -1, -1, 134, 136, -1, 136, 219, 203, - 222, -1, 137, 270, -1, 275, -1, 138, -1, 137, - 274, 138, -1, 1, 138, -1, -1, 44, 160, 139, - 160, -1, 44, 52, 52, -1, 44, 52, 60, -1, - 44, 52, 59, -1, 6, 161, -1, 138, 39, 142, - -1, 138, 40, 142, -1, 138, 41, 142, -1, 138, - 42, 142, -1, 138, 43, 138, -1, -1, 46, 140, - 120, 136, 121, -1, 47, 120, 136, 121, -1, 155, - 103, 143, -1, 149, 103, 143, -1, 246, 83, 143, - -1, 199, 122, 168, 123, 83, 143, -1, 199, 124, - 50, 83, 143, -1, 199, 124, 54, 83, 143, -1, - 199, 81, 50, 83, 143, -1, 247, 83, 143, -1, - 155, 103, 181, -1, 149, 103, 167, -1, 149, 103, - 181, -1, 141, -1, 143, -1, 141, 36, 141, -1, - 141, 37, 141, -1, 38, 141, -1, 117, 143, -1, - 165, -1, 141, -1, 148, -1, 144, -1, 29, 171, - -1, 21, 171, -1, 22, 171, -1, 209, -1, 209, - 124, 267, 173, -1, 209, 81, 267, 173, -1, -1, - -1, 90, 146, 205, 147, 136, 121, -1, 266, 173, - -1, 266, 173, 145, -1, 199, 124, 267, 173, -1, - 199, 124, 267, 173, 145, -1, 199, 81, 267, 173, - -1, 199, 81, 267, 173, 145, -1, 31, 173, -1, - 30, 173, -1, 151, -1, 85, 150, 125, -1, 151, - -1, 85, 150, 125, -1, 153, -1, 153, 152, -1, - 153, 91, 154, -1, 153, 91, -1, 91, 154, -1, - 91, -1, 154, -1, 85, 150, 125, -1, 152, 126, - -1, 153, 152, 126, -1, 244, -1, 199, 122, 168, - 123, -1, 199, 124, 50, -1, 199, 81, 50, -1, - 199, 124, 54, -1, 199, 81, 54, -1, 82, 54, - -1, 247, -1, 244, -1, 199, 122, 168, 123, -1, - 199, 124, 50, -1, 199, 81, 50, -1, 199, 124, - 54, -1, 199, 81, 54, -1, 82, 54, -1, 247, - -1, 50, -1, 54, -1, 82, 156, -1, 156, -1, - 199, 81, 156, -1, 50, -1, 54, -1, 51, -1, - 163, -1, 164, -1, 158, -1, 240, -1, 159, -1, - 242, -1, 160, -1, -1, 161, 126, 162, 160, -1, - 108, -1, 109, -1, 110, -1, 65, -1, 66, -1, - 67, -1, 73, -1, 106, -1, 69, -1, 107, -1, - 70, -1, 79, -1, 80, -1, 111, -1, 112, -1, - 113, -1, 91, -1, 114, -1, 115, -1, 64, -1, - 118, -1, 62, -1, 63, -1, 77, -1, 78, -1, - 127, -1, 48, -1, 49, -1, 46, -1, 47, -1, - 44, -1, 36, -1, 7, -1, 21, -1, 16, -1, - 3, -1, 5, -1, 45, -1, 26, -1, 15, -1, - 14, -1, 10, -1, 9, -1, 35, -1, 20, -1, - 25, -1, 4, -1, 22, -1, 33, -1, 38, -1, - 37, -1, 23, -1, 8, -1, 24, -1, 29, -1, - 32, -1, 31, -1, 13, -1, 34, -1, 6, -1, - 17, -1, 30, -1, 11, -1, 12, -1, 18, -1, - 19, -1, 155, 103, 165, -1, 155, 103, 165, 43, - 165, -1, 246, 83, 165, -1, 199, 122, 168, 123, - 83, 165, -1, 199, 124, 50, 83, 165, -1, 199, - 124, 54, 83, 165, -1, 199, 81, 50, 83, 165, - -1, 199, 81, 54, 83, 165, -1, 82, 54, 83, - 165, -1, 247, 83, 165, -1, 165, 75, 165, -1, - 165, 76, 165, -1, 165, 111, 165, -1, 165, 112, - 165, -1, 165, 113, 165, -1, 165, 114, 165, -1, - 165, 115, 165, -1, 165, 64, 165, -1, 116, 56, - 64, 165, -1, 116, 57, 64, 165, -1, 62, 165, - -1, 63, 165, -1, 165, 108, 165, -1, 165, 109, - 165, -1, 165, 110, 165, -1, 165, 65, 165, -1, - 165, 106, 165, -1, 165, 69, 165, -1, 165, 107, - 165, -1, 165, 70, 165, -1, 165, 66, 165, -1, - 165, 67, 165, -1, 165, 68, 165, -1, 165, 73, - 165, -1, 165, 74, 165, -1, 117, 165, -1, 118, - 165, -1, 165, 79, 165, -1, 165, 80, 165, -1, - 165, 71, 165, -1, 165, 72, 165, -1, -1, 45, - 271, 166, 165, -1, 165, 104, 165, 105, 165, -1, - 182, -1, 165, -1, 275, -1, 148, 271, -1, 180, - 272, -1, 180, 126, 91, 165, 271, -1, 264, 272, - -1, 91, 165, 271, -1, 128, 275, 125, -1, 128, - 171, 271, 125, -1, 128, 209, 271, 125, -1, 128, - 180, 126, 209, 271, 125, -1, 275, -1, 169, -1, - 148, -1, 180, 179, -1, 180, 126, 91, 167, 179, - -1, 264, 179, -1, 264, 126, 91, 167, 179, -1, - 180, 126, 264, 179, -1, 180, 126, 264, 126, 91, - 165, 179, -1, 91, 167, 179, -1, 178, -1, 167, - 126, 180, 179, -1, 167, 126, 178, -1, 167, 126, - 91, 167, 179, -1, 167, 126, 180, 126, 91, 167, - 179, -1, 264, 179, -1, 264, 126, 91, 167, 179, - -1, 167, 126, 264, 179, -1, 167, 126, 180, 126, - 264, 179, -1, 167, 126, 264, 126, 91, 167, 179, - -1, 167, 126, 180, 126, 264, 126, 91, 167, 179, - -1, 91, 167, 179, -1, 178, -1, -1, 174, 175, - -1, 171, -1, -1, 86, 176, 125, -1, -1, 86, - 172, 177, 125, -1, 92, 167, -1, 126, 178, -1, - 275, -1, 167, -1, 180, 126, 167, -1, 180, 126, - 167, -1, 180, 126, 91, 167, -1, 91, 167, -1, - 223, -1, 224, -1, 227, -1, 228, -1, 229, -1, - 232, -1, 245, -1, 247, -1, 51, -1, -1, 7, - 183, 135, 10, -1, -1, 86, 141, 184, 271, 125, - -1, 85, 136, 125, -1, 199, 81, 54, -1, 82, - 54, -1, 199, 122, 168, 123, -1, 88, 168, 123, - -1, 89, 263, 121, -1, 29, -1, 30, 128, 171, - 125, -1, 30, 128, 125, -1, 30, -1, -1, 45, - 271, 128, 185, 141, 125, -1, 266, 211, -1, 210, - -1, 210, 211, -1, 11, 142, 200, 136, 202, 10, - -1, 12, 142, 200, 136, 203, 10, -1, -1, -1, - 18, 186, 142, 201, 187, 136, 10, -1, -1, -1, - 19, 188, 142, 201, 189, 136, 10, -1, 16, 142, - 270, 216, 10, -1, 16, 270, 216, 10, -1, 16, - 270, 15, 136, 10, -1, -1, -1, 20, 204, 25, - 190, 142, 201, 191, 136, 10, -1, -1, 3, 157, - 248, 192, 135, 10, -1, -1, -1, 3, 79, 141, - 193, 273, 194, 135, 10, -1, -1, 4, 157, 195, - 135, 10, -1, -1, 5, 158, 196, 250, 135, 10, - -1, -1, -1, 5, 261, 269, 197, 158, 198, 250, - 135, 10, -1, 21, -1, 22, -1, 23, -1, 24, - -1, 182, -1, 273, -1, 105, -1, 13, -1, 273, - 13, -1, 273, -1, 105, -1, 27, -1, 203, -1, - 14, 142, 200, 136, 202, -1, 275, -1, 15, 136, - -1, 155, -1, 149, -1, 275, -1, 108, 108, -1, - 72, -1, 108, 204, 108, -1, -1, -1, 28, 207, - 205, 208, 136, 10, -1, 148, 206, -1, 209, 124, - 267, 170, -1, 209, 81, 267, 170, -1, 266, 169, - -1, 199, 124, 267, 170, -1, 199, 81, 267, 169, - -1, 199, 81, 268, -1, 31, 169, -1, 31, -1, - -1, -1, 120, 212, 205, 213, 136, 121, -1, -1, - -1, 26, 214, 205, 215, 136, 10, -1, 17, 217, - 200, 136, 218, -1, 180, -1, 180, 126, 91, 167, - -1, 91, 167, -1, 203, -1, 216, -1, 8, 220, - 221, 200, 136, 219, -1, 275, -1, 167, -1, 181, - -1, 275, -1, 84, 155, -1, 275, -1, 9, 136, - -1, 275, -1, 243, -1, 240, -1, 242, -1, 225, - -1, 226, -1, 225, 226, -1, 94, 234, 101, -1, - 95, 235, 101, -1, 96, 235, 61, -1, 97, 129, - 101, -1, 97, 230, 101, -1, -1, 230, 231, 129, - -1, 236, -1, 231, 236, -1, 98, 129, 101, -1, - 98, 233, 101, -1, -1, 233, 58, 129, -1, -1, - 234, 236, -1, -1, 235, 236, -1, 58, -1, -1, - 100, 237, 239, -1, -1, 99, 238, 136, 121, -1, - 52, -1, 53, -1, 55, -1, 247, -1, 93, 241, - -1, 158, -1, 53, -1, 52, -1, 55, -1, 93, - 235, 101, -1, 56, -1, 57, -1, 116, 56, -1, - 116, 57, -1, 50, -1, 53, -1, 52, -1, 54, - -1, 55, -1, 33, -1, 32, -1, 34, -1, 35, - -1, 49, -1, 48, -1, 244, -1, 244, -1, 59, - -1, 60, -1, 273, -1, -1, 107, 249, 142, 273, - -1, 1, 273, -1, 128, 251, 271, 125, -1, 251, - 273, -1, 253, 126, 255, 126, 257, 260, -1, 253, - 126, 255, 260, -1, 253, 126, 257, 260, -1, 253, - 260, -1, 255, 126, 257, 260, -1, 255, 260, -1, - 257, 260, -1, 259, -1, -1, 54, -1, 53, -1, - 52, -1, 55, -1, 50, -1, 252, -1, 253, 126, - 252, -1, 50, 103, 167, -1, 254, -1, 255, 126, - 254, -1, 113, -1, 91, -1, 256, 50, -1, 256, - -1, 110, -1, 92, -1, 258, 50, -1, 126, 259, - -1, 275, -1, 245, -1, -1, 128, 262, 141, 271, - 125, -1, 275, -1, 264, 272, -1, 180, 272, -1, - 265, -1, 264, 126, 265, -1, 167, 84, 167, -1, - 50, -1, 54, -1, 51, -1, 50, -1, 54, -1, - 51, -1, 163, -1, 50, -1, 51, -1, 163, -1, - 124, -1, 81, -1, -1, 274, -1, -1, 130, -1, - -1, 130, -1, 126, -1, 131, -1, 130, -1, 273, - -1, 274, 131, -1, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 350, 350, 350, 375, 395, 403, 404, 408, 412, - 418, 418, 422, 426, 433, 438, 442, 451, 460, 472, - 484, 490, 489, 503, 511, 515, 521, 546, 562, 574, - 586, 598, 603, 607, 612, 617, 620, 621, 625, 629, - 633, 637, 640, 647, 648, 649, 653, 657, 663, 664, - 668, 675, 679, 674, 689, 694, 706, 711, 723, 728, - 740, 745, 752, 753, 759, 760, 766, 770, 774, 778, - 782, 786, 792, 793, 799, 803, 809, 813, 817, 821, - 825, 829, 835, 841, 848, 852, 856, 860, 864, 868, - 874, 880, 887, 891, 894, 898, 902, 908, 909, 910, - 911, 916, 923, 924, 927, 931, 934, 938, 938, 944, - 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, - 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, - 965, 966, 967, 968, 969, 972, 972, 972, 972, 973, - 973, 973, 973, 973, 973, 973, 974, 974, 974, 974, - 974, 974, 974, 975, 975, 975, 975, 975, 975, 976, - 976, 976, 976, 976, 976, 976, 977, 977, 977, 977, - 977, 978, 978, 978, 978, 981, 985, 989, 1014, 1030, - 1042, 1054, 1066, 1071, 1076, 1081, 1091, 1101, 1105, 1109, - 1113, 1117, 1121, 1125, 1129, 1133, 1142, 1146, 1150, 1154, - 1158, 1162, 1166, 1170, 1174, 1178, 1182, 1186, 1190, 1194, - 1198, 1202, 1206, 1210, 1214, 1218, 1222, 1222, 1227, 1232, - 1238, 1245, 1246, 1251, 1255, 1260, 1264, 1271, 1275, 1279, - 1284, 1291, 1292, 1295, 1300, 1304, 1309, 1314, 1319, 1324, - 1330, 1334, 1337, 1341, 1345, 1350, 1355, 1360, 1365, 1370, - 1375, 1380, 1385, 1389, 1392, 1392, 1404, 1405, 1405, 1410, - 1410, 1417, 1423, 1427, 1430, 1434, 1440, 1444, 1448, 1454, - 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1467, 1466, - 1479, 1479, 1484, 1489, 1493, 1497, 1505, 1514, 1518, 1522, - 1526, 1530, 1534, 1534, 1539, 1545, 1546, 1555, 1568, 1581, - 1581, 1581, 1591, 1591, 1591, 1601, 1608, 1612, 1616, 1616, - 1616, 1624, 1623, 1640, 1645, 1639, 1662, 1661, 1678, 1677, - 1695, 1696, 1695, 1710, 1714, 1718, 1722, 1728, 1735, 1736, - 1737, 1738, 1741, 1742, 1743, 1746, 1747, 1756, 1757, 1763, - 1764, 1767, 1768, 1772, 1776, 1783, 1787, 1782, 1797, 1806, - 1810, 1816, 1821, 1826, 1831, 1835, 1839, 1846, 1850, 1845, - 1858, 1862, 1857, 1871, 1878, 1879, 1883, 1889, 1890, 1893, - 1904, 1907, 1911, 1912, 1915, 1919, 1922, 1930, 1933, 1934, - 1938, 1941, 1954, 1955, 1961, 1967, 1990, 2023, 2027, 2034, - 2037, 2043, 2044, 2050, 2054, 2061, 2064, 2071, 2074, 2081, - 2084, 2090, 2092, 2091, 2103, 2102, 2123, 2124, 2125, 2126, - 2129, 2136, 2137, 2138, 2139, 2142, 2176, 2177, 2178, 2182, - 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195, 2196, 2197, - 2198, 2201, 2207, 2213, 2214, 2217, 2222, 2221, 2229, 2232, - 2238, 2244, 2248, 2252, 2256, 2260, 2264, 2268, 2272, 2277, - 2282, 2286, 2290, 2294, 2298, 2309, 2310, 2316, 2326, 2331, - 2337, 2338, 2341, 2352, 2363, 2364, 2367, 2377, 2381, 2384, - 2389, 2389, 2414, 2415, 2419, 2428, 2429, 2435, 2441, 2442, - 2443, 2446, 2447, 2448, 2449, 2452, 2453, 2454, 2457, 2458, - 2461, 2462, 2465, 2466, 2469, 2470, 2471, 2474, 2475, 2478, - 2479, 2482 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "kCLASS", "kMODULE", "kDEF", "kUNDEF", - "kBEGIN", "kRESCUE", "kENSURE", "kEND", "kIF", "kUNLESS", "kTHEN", - "kELSIF", "kELSE", "kCASE", "kWHEN", "kWHILE", "kUNTIL", "kFOR", - "kBREAK", "kNEXT", "kREDO", "kRETRY", "kIN", "kDO", "kDO_COND", - "kDO_BLOCK", "kRETURN", "kYIELD", "kSUPER", "kSELF", "kNIL", "kTRUE", - "kFALSE", "kAND", "kOR", "kNOT", "kIF_MOD", "kUNLESS_MOD", "kWHILE_MOD", - "kUNTIL_MOD", "kRESCUE_MOD", "kALIAS", "kDEFINED", "klBEGIN", "klEND", - "k__LINE__", "k__FILE__", "tIDENTIFIER", "tFID", "tGVAR", "tIVAR", - "tCONSTANT", "tCVAR", "tINTEGER", "tFLOAT", "tSTRING_CONTENT", - "tNTH_REF", "tBACK_REF", "tREGEXP_END", "tUPLUS", "tUMINUS", "tPOW", - "tCMP", "tEQ", "tEQQ", "tNEQ", "tGEQ", "tLEQ", "tANDOP", "tOROP", - "tMATCH", "tNMATCH", "tDOT2", "tDOT3", "tAREF", "tASET", "tLSHFT", - "tRSHFT", "tCOLON2", "tCOLON3", "tOP_ASGN", "tASSOC", "tLPAREN", - "tLPAREN_ARG", "tRPAREN", "tLBRACK", "tLBRACE", "tLBRACE_ARG", "tSTAR", - "tAMPER", "tSYMBEG", "tSTRING_BEG", "tXSTRING_BEG", "tREGEXP_BEG", - "tWORDS_BEG", "tQWORDS_BEG", "tSTRING_DBEG", "tSTRING_DVAR", - "tSTRING_END", "tLOWEST", "'='", "'?'", "':'", "'>'", "'<'", "'|'", - "'^'", "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "tUMINUS_NUM", "'!'", - "'~'", "tLAST_TOKEN", "'{'", "'}'", "'['", "']'", "'.'", "')'", "','", - "'`'", "'('", "' '", "'\\n'", "';'", "$accept", "program", "@1", - "bodystmt", "compstmt", "stmts", "stmt", "@2", "@3", "expr", - "expr_value", "command_call", "block_command", "cmd_brace_block", "@4", - "@5", "command", "mlhs", "mlhs_entry", "mlhs_basic", "mlhs_item", - "mlhs_head", "mlhs_node", "lhs", "cname", "cpath", "fname", "fsym", - "fitem", "undef_list", "@6", "op", "reswords", "arg", "@7", "arg_value", - "aref_args", "paren_args", "opt_paren_args", "call_args", "call_args2", - "command_args", "@8", "open_args", "@9", "@10", "block_arg", - "opt_block_arg", "args", "mrhs", "primary", "@11", "@12", "@13", "@14", - "@15", "@16", "@17", "@18", "@19", "@20", "@21", "@22", "@23", "@24", - "@25", "@26", "primary_value", "then", "do", "if_tail", "opt_else", - "block_var", "opt_block_var", "do_block", "@27", "@28", "block_call", - "method_call", "brace_block", "@29", "@30", "@31", "@32", "case_body", - "when_args", "cases", "opt_rescue", "exc_list", "exc_var", "opt_ensure", - "literal", "strings", "string", "string1", "xstring", "regexp", "words", - "word_list", "word", "qwords", "qword_list", "string_contents", - "xstring_contents", "string_content", "@33", "@34", "string_dvar", - "symbol", "sym", "dsym", "numeric", "variable", "var_ref", "var_lhs", - "backref", "superclass", "@35", "f_arglist", "f_args", "f_norm_arg", - "f_arg", "f_opt", "f_optarg", "restarg_mark", "f_rest_arg", - "blkarg_mark", "f_block_arg", "opt_f_block_arg", "singleton", "@36", - "assoc_list", "assocs", "assoc", "operation", "operation2", "operation3", - "dot_or_colon", "opt_terms", "opt_nl", "trailer", "term", "terms", - "none", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 61, 63, 58, 62, 60, 124, 94, - 38, 43, 45, 42, 47, 37, 358, 33, 126, 359, - 123, 125, 91, 93, 46, 41, 44, 96, 40, 32, - 10, 59 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = -{ - 0, 132, 134, 133, 135, 136, 137, 137, 137, 137, - 139, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 140, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 141, 141, 141, 141, - 141, 141, 142, 143, 143, 143, 143, 143, 144, 144, - 144, 146, 147, 145, 148, 148, 148, 148, 148, 148, - 148, 148, 149, 149, 150, 150, 151, 151, 151, 151, - 151, 151, 152, 152, 153, 153, 154, 154, 154, 154, - 154, 154, 154, 154, 155, 155, 155, 155, 155, 155, - 155, 155, 156, 156, 157, 157, 157, 158, 158, 158, - 158, 158, 159, 159, 160, 160, 161, 162, 161, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 166, 165, 165, 165, - 167, 168, 168, 168, 168, 168, 168, 169, 169, 169, - 169, 170, 170, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 174, 173, 175, 176, 175, 177, - 175, 178, 179, 179, 180, 180, 181, 181, 181, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 183, 182, - 184, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 185, 182, 182, 182, 182, 182, 182, 186, - 187, 182, 188, 189, 182, 182, 182, 182, 190, 191, - 182, 192, 182, 193, 194, 182, 195, 182, 196, 182, - 197, 198, 182, 182, 182, 182, 182, 199, 200, 200, - 200, 200, 201, 201, 201, 202, 202, 203, 203, 204, - 204, 205, 205, 205, 205, 207, 208, 206, 209, 209, - 209, 210, 210, 210, 210, 210, 210, 212, 213, 211, - 214, 215, 211, 216, 217, 217, 217, 218, 218, 219, - 219, 220, 220, 220, 221, 221, 222, 222, 223, 223, - 223, 224, 225, 225, 226, 227, 228, 229, 229, 230, - 230, 231, 231, 232, 232, 233, 233, 234, 234, 235, - 235, 236, 237, 236, 238, 236, 239, 239, 239, 239, - 240, 241, 241, 241, 241, 242, 243, 243, 243, 243, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 245, 246, 247, 247, 248, 249, 248, 248, 250, - 250, 251, 251, 251, 251, 251, 251, 251, 251, 251, - 252, 252, 252, 252, 252, 253, 253, 254, 255, 255, - 256, 256, 257, 257, 258, 258, 259, 260, 260, 261, - 262, 261, 263, 263, 263, 264, 264, 265, 266, 266, - 266, 267, 267, 267, 267, 268, 268, 268, 269, 269, - 270, 270, 271, 271, 272, 272, 272, 273, 273, 274, - 274, 275 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 4, 2, 1, 1, 3, 2, - 0, 4, 3, 3, 3, 2, 3, 3, 3, 3, - 3, 0, 5, 4, 3, 3, 3, 6, 5, 5, - 5, 3, 3, 3, 3, 1, 1, 3, 3, 2, - 2, 1, 1, 1, 1, 2, 2, 2, 1, 4, - 4, 0, 0, 6, 2, 3, 4, 5, 4, 5, - 2, 2, 1, 3, 1, 3, 1, 2, 3, 2, - 2, 1, 1, 3, 2, 3, 1, 4, 3, 3, - 3, 3, 2, 1, 1, 4, 3, 3, 3, 3, - 2, 1, 1, 1, 2, 1, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 4, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 5, 3, 6, 5, - 5, 5, 5, 4, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 4, 4, 2, 2, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 3, 3, 3, 3, 0, 4, 5, 1, - 1, 1, 2, 2, 5, 2, 3, 3, 4, 4, - 6, 1, 1, 1, 2, 5, 2, 5, 4, 7, - 3, 1, 4, 3, 5, 7, 2, 5, 4, 6, - 7, 9, 3, 1, 0, 2, 1, 0, 3, 0, - 4, 2, 2, 1, 1, 3, 3, 4, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, - 0, 5, 3, 3, 2, 4, 3, 3, 1, 4, - 3, 1, 0, 6, 2, 1, 2, 6, 6, 0, - 0, 7, 0, 0, 7, 5, 4, 5, 0, 0, - 9, 0, 6, 0, 0, 8, 0, 5, 0, 6, - 0, 0, 9, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 5, 1, 2, 1, - 1, 1, 2, 1, 3, 0, 0, 6, 2, 4, - 4, 2, 4, 4, 3, 2, 1, 0, 0, 6, - 0, 0, 6, 5, 1, 4, 2, 1, 1, 6, - 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, - 1, 1, 1, 2, 3, 3, 3, 3, 3, 0, - 3, 1, 2, 3, 3, 0, 3, 0, 2, 0, - 2, 1, 0, 3, 0, 4, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 3, 1, 1, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 4, 2, 4, - 2, 6, 4, 4, 2, 4, 2, 2, 1, 0, - 1, 1, 1, 1, 1, 1, 3, 3, 1, 3, - 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, - 0, 5, 1, 2, 2, 1, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, - 2, 0 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint16 yydefact[] = -{ - 2, 0, 0, 1, 0, 0, 0, 0, 0, 278, - 0, 0, 490, 299, 302, 0, 323, 324, 325, 326, - 288, 291, 356, 426, 425, 427, 428, 0, 0, 492, - 21, 0, 430, 429, 420, 277, 422, 421, 423, 424, - 416, 417, 433, 434, 0, 0, 0, 0, 0, 501, - 501, 71, 399, 397, 399, 399, 389, 395, 0, 0, - 0, 3, 490, 7, 35, 36, 44, 43, 0, 62, - 0, 66, 72, 0, 41, 219, 0, 48, 295, 269, - 270, 381, 382, 271, 272, 273, 274, 379, 380, 378, - 431, 275, 0, 276, 254, 6, 9, 323, 324, 288, - 291, 356, 492, 92, 93, 0, 0, 0, 0, 95, - 0, 327, 0, 431, 276, 0, 316, 144, 155, 145, - 168, 141, 161, 151, 150, 171, 172, 166, 149, 148, - 143, 169, 173, 174, 153, 142, 156, 160, 162, 154, - 147, 163, 170, 165, 164, 157, 167, 152, 140, 159, - 158, 139, 146, 137, 138, 135, 136, 97, 99, 98, - 130, 131, 128, 112, 113, 114, 117, 119, 115, 132, - 133, 120, 121, 125, 116, 118, 109, 110, 111, 122, - 123, 124, 126, 127, 129, 134, 470, 318, 100, 101, - 469, 0, 164, 157, 167, 152, 135, 136, 97, 98, - 102, 104, 106, 15, 103, 105, 0, 0, 42, 0, - 0, 0, 431, 0, 276, 0, 498, 497, 490, 0, - 499, 491, 0, 0, 0, 340, 339, 0, 0, 431, - 276, 0, 0, 0, 233, 220, 264, 46, 241, 501, - 501, 475, 47, 45, 0, 61, 0, 501, 355, 60, - 39, 0, 10, 493, 216, 0, 0, 195, 0, 196, - 284, 0, 0, 0, 62, 280, 0, 492, 0, 494, - 494, 221, 494, 0, 494, 472, 0, 70, 0, 76, - 83, 413, 412, 414, 411, 0, 410, 0, 0, 0, - 0, 0, 0, 0, 418, 419, 40, 210, 211, 5, - 491, 0, 0, 0, 0, 0, 0, 0, 345, 348, - 0, 74, 0, 69, 67, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 501, 0, 0, 0, 360, 357, 296, - 383, 0, 0, 351, 54, 294, 0, 313, 92, 93, - 94, 418, 419, 0, 436, 311, 435, 0, 501, 0, - 0, 0, 449, 489, 488, 320, 107, 0, 501, 284, - 330, 329, 0, 328, 0, 0, 501, 0, 0, 0, - 0, 0, 0, 0, 0, 500, 0, 0, 284, 0, - 501, 0, 308, 501, 261, 0, 0, 234, 263, 0, - 236, 290, 0, 257, 256, 255, 233, 492, 501, 492, - 0, 12, 14, 13, 0, 292, 0, 0, 0, 0, - 0, 0, 0, 282, 63, 492, 492, 222, 286, 496, - 495, 223, 496, 225, 496, 474, 287, 473, 82, 0, - 501, 0, 401, 404, 402, 415, 400, 384, 398, 385, - 386, 387, 388, 0, 391, 393, 0, 394, 0, 0, - 8, 16, 17, 18, 19, 20, 37, 38, 501, 0, - 25, 33, 0, 34, 0, 68, 75, 24, 175, 264, - 32, 192, 200, 205, 206, 207, 202, 204, 214, 215, - 208, 209, 185, 186, 212, 213, 0, 201, 203, 197, - 198, 199, 187, 188, 189, 190, 191, 481, 486, 482, - 487, 254, 354, 0, 481, 483, 482, 484, 501, 481, - 482, 254, 254, 501, 501, 26, 177, 31, 184, 51, - 55, 0, 438, 0, 0, 92, 93, 96, 0, 0, - 501, 0, 492, 454, 452, 451, 450, 453, 461, 465, - 464, 460, 449, 0, 0, 455, 501, 458, 501, 463, - 501, 0, 448, 0, 0, 279, 501, 501, 370, 501, - 331, 175, 485, 283, 0, 481, 482, 501, 0, 0, - 0, 364, 0, 306, 334, 333, 300, 332, 303, 485, - 283, 0, 481, 482, 0, 0, 240, 477, 0, 265, - 262, 501, 0, 0, 476, 289, 0, 41, 0, 259, - 0, 253, 501, 0, 0, 0, 0, 0, 227, 11, - 0, 217, 0, 23, 183, 63, 0, 226, 0, 265, - 79, 81, 0, 481, 482, 0, 0, 390, 392, 396, - 193, 194, 343, 0, 346, 341, 268, 0, 73, 0, - 0, 0, 0, 353, 58, 285, 0, 0, 232, 352, - 56, 231, 350, 50, 349, 49, 361, 358, 501, 314, - 0, 0, 285, 317, 0, 0, 492, 0, 440, 0, - 444, 468, 0, 446, 462, 0, 447, 466, 321, 108, - 371, 372, 501, 373, 0, 501, 337, 0, 0, 335, - 0, 285, 0, 0, 0, 305, 307, 366, 0, 0, - 0, 0, 285, 0, 501, 0, 238, 501, 501, 0, - 0, 258, 0, 246, 228, 0, 492, 501, 501, 229, - 0, 22, 281, 492, 77, 0, 406, 407, 408, 403, - 409, 342, 0, 0, 0, 266, 176, 218, 30, 181, - 182, 59, 0, 28, 179, 29, 180, 57, 0, 0, - 52, 0, 437, 312, 471, 457, 0, 319, 456, 501, - 501, 467, 0, 459, 501, 449, 0, 0, 375, 338, - 0, 4, 377, 0, 297, 0, 298, 0, 501, 0, - 0, 309, 235, 0, 237, 252, 0, 243, 501, 501, - 260, 0, 0, 293, 224, 405, 344, 0, 267, 27, - 178, 0, 0, 0, 0, 439, 0, 442, 443, 445, - 0, 0, 374, 0, 84, 91, 0, 376, 0, 365, - 367, 368, 363, 301, 304, 0, 501, 501, 0, 242, - 0, 248, 501, 230, 347, 362, 359, 0, 315, 501, - 0, 90, 0, 501, 0, 501, 501, 0, 239, 244, - 0, 501, 0, 247, 53, 441, 322, 485, 89, 0, - 481, 482, 369, 336, 310, 501, 0, 249, 501, 85, - 245, 0, 250, 501, 251 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 1, 2, 377, 378, 62, 63, 424, 255, 64, - 209, 65, 66, 540, 678, 823, 67, 68, 263, 69, - 70, 71, 72, 210, 109, 110, 200, 201, 202, 203, - 574, 527, 189, 74, 426, 236, 268, 668, 669, 237, - 619, 245, 246, 415, 620, 730, 610, 407, 269, 483, - 75, 206, 435, 630, 222, 720, 223, 721, 604, 845, - 544, 541, 771, 370, 372, 573, 785, 258, 382, 596, - 708, 709, 228, 654, 309, 478, 753, 77, 78, 355, - 534, 769, 533, 768, 394, 592, 842, 577, 702, 787, - 791, 79, 80, 81, 82, 83, 84, 85, 291, 463, - 86, 293, 287, 285, 456, 646, 645, 749, 87, 286, - 88, 89, 212, 91, 213, 214, 365, 543, 563, 564, - 565, 566, 567, 568, 569, 570, 571, 781, 690, 191, - 371, 273, 270, 241, 115, 548, 522, 375, 219, 254, - 441, 383, 221, 95 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -654 -static const yytype_int16 yypact[] = -{ - -654, 73, 2254, -654, 5471, 7939, 8236, 3906, 5121, -654, - 6810, 6810, 3777, -654, -654, 8038, 5677, 5677, -654, -654, - 5677, 4436, 4539, -654, -654, -654, -654, 6810, 4996, -44, - -654, -3, -654, -654, 2117, 4024, -654, -654, 4127, -654, - -654, -654, -654, -654, 7634, 7634, 50, 3187, 6810, 6913, - 7634, 8335, 4871, -654, -654, -654, -18, -1, 94, 7737, - 7634, -654, 124, 757, 249, -654, -654, 104, 74, -654, - 57, 8137, -654, 96, 9349, 171, 485, 11, 32, -654, - -654, 120, -654, -654, -654, -654, -654, -654, -654, -654, - 10, -654, 64, 38, 42, -654, 757, -654, -654, -654, - 99, 111, -44, 129, 140, 6810, 90, 3318, 325, -654, - 78, -654, 549, -654, -654, 42, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, 95, 148, 282, 333, -654, -654, - -654, -654, -654, -654, -654, 336, 337, 465, -654, 473, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, 495, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, 147, -654, -654, 2615, 225, 249, 48, - 188, 558, 31, 213, 258, 48, -654, -654, 124, 88, - -654, 209, 6810, 6810, 288, -654, -654, 559, 324, 66, - 245, 7634, 7634, 7634, -654, 9349, 274, -654, -654, 262, - 269, -654, -654, -654, 5363, -654, 5780, 5677, -654, -654, - -654, 222, -654, -654, 275, 285, 3449, -654, 571, 366, - 476, 3187, 310, 315, 342, 249, 7634, -44, 371, 392, - 401, -654, 480, 375, 401, -654, 470, -654, 586, 595, - 618, -654, -654, -654, -654, 231, -654, 482, 515, 674, - 425, 565, 444, 30, 493, 499, -654, -654, -654, -654, - 3674, 6810, 6810, 6810, 6810, 5471, 6810, 6810, -654, -654, - 7016, -654, 3187, 8335, 438, 7016, 7634, 7634, 7634, 7634, - 7634, 7634, 7634, 7634, 7634, 7634, 7634, 7634, 7634, 7634, - 7634, 7634, 7634, 7634, 7634, 7634, 7634, 7634, 7634, 7634, - 7634, 7634, 1612, 6913, 8489, 8555, 8555, -654, -654, -654, - -654, 7737, 7737, -654, 501, -654, 275, 249, -654, 623, - -654, -654, -654, 124, -654, -654, -654, 8621, 6913, 8555, - 2615, 6810, 419, -654, -654, -654, -654, 583, 596, 283, - -654, -654, 2737, 590, 7634, 8687, 6913, 8753, 7634, 7634, - 2981, 601, 3571, 7119, 611, -654, 18, 18, 252, 8819, - 6913, 8885, -654, 498, -654, 7634, 5883, -654, -654, 5986, - -654, -654, 503, 5574, -654, -654, 104, -44, 510, 9, - 512, -654, -654, -654, 5121, -654, 7634, 3449, 528, 8687, - 8753, 7634, 529, -654, 527, -44, 9213, -654, -654, 7222, - -654, -654, 7634, -654, 7634, -654, -654, -654, 623, 8951, - 6913, 9017, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, 25, -654, -654, 534, -654, 7634, 7634, - 757, -654, -654, -654, -654, -654, -654, -654, 37, 7634, - -654, 544, 546, -654, 550, -654, -654, -654, 1775, -654, - -654, 366, 9418, 9418, 9418, 9418, 547, 547, 9435, 1667, - 9418, 9418, 9366, 9366, 394, 394, 2464, 547, 547, 714, - 714, 437, 43, 43, 366, 366, 366, 2365, 4642, 2484, - 4745, 111, -654, 554, 487, -654, 585, -654, 4539, -654, - -654, 1899, 1899, 37, 37, -654, 9349, -654, 9349, -654, - -654, 124, -654, 6810, 2615, 141, 477, -654, 111, 562, - 111, 681, 35, 597, -654, -654, -654, -654, -654, -654, - -654, -654, 429, 2615, 124, -654, 575, -654, 577, 655, - 588, 665, -654, 5246, 5121, -654, 7325, 703, -654, 398, - -654, 2345, 4230, 4333, 599, 344, 416, 703, 726, 734, - 7634, 626, 48, -654, -654, -654, -654, -654, -654, 60, - 85, 635, 259, 354, 6810, 657, -654, -654, 7634, 274, - -654, 628, 7634, 274, -654, -654, 7634, 9265, 16, -654, - 636, -654, 634, 643, 6089, 8555, 8555, 645, -654, -654, - 6810, 9349, 656, -654, 9349, 296, 658, -654, 7634, -654, - 141, 477, 661, 340, 351, 3449, 671, -654, -654, -654, - 366, 366, -654, 7840, -654, -654, -654, 7428, -654, 7634, - 7634, 7737, 7634, -654, 501, 624, 7737, 7737, -654, -654, - 501, -654, -654, -654, -654, -654, -654, -654, 37, -654, - 124, 776, -654, -654, 663, 7634, -44, 781, -654, 429, - -654, -654, 452, -654, -654, -12, -654, -654, -654, -654, - 544, -654, 708, -654, 3084, 792, -654, 6810, 797, -654, - 7634, 432, 7634, 7634, 798, -654, -654, -654, 7531, 2859, - 3571, 3571, 367, 18, 498, 6192, -654, 498, 498, 6295, - 685, -654, 6398, -654, -654, 104, 9, 111, 111, -654, - 101, -654, -654, 9213, 631, 690, -654, -654, -654, -654, - -654, -654, 709, 3571, 7634, 692, 9349, 9349, -654, 9349, - 9349, -654, 7737, -654, 9349, -654, 9349, -654, 3571, 3449, - -654, 2615, -654, -654, -654, -654, 691, -654, -654, 693, - 588, -654, 597, -654, 588, 419, 8434, 48, -654, -654, - 3571, -654, -654, 48, -654, 7634, -654, 7634, 165, 810, - 812, -654, -654, 7634, -654, -654, 7634, -654, 705, 710, - -654, 7634, 712, -654, -654, -654, -654, 825, -654, -654, - 9349, 830, 720, 3449, 832, -654, 452, -654, -654, -654, - 2615, 789, -654, 640, 595, 618, 2615, -654, 2737, -654, - -654, -654, -654, -654, -654, 3571, 9286, 498, 6501, -654, - 6604, -654, 498, -654, -654, -654, -654, 724, -654, 588, - 838, 623, 9083, 6913, 9149, 596, 398, 839, -654, -654, - 7634, 727, 7634, -654, -654, -654, -654, 41, 477, 732, - 76, 93, -654, -654, -654, 498, 6707, -654, 498, 631, - -654, 7634, -654, 498, -654 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -654, -654, -654, -360, 431, -654, 59, -654, -654, 958, - 44, 23, -654, -569, -654, -654, 1, -6, -183, 22, - 779, -654, -25, 927, -70, 853, 7, -654, 21, -654, - -654, -5, -654, -16, -654, 1378, -338, -7, -479, 82, - -654, 2, -654, -654, -654, -654, -9, 158, 110, -278, - 26, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, 185, -209, -372, - 0, -520, 208, -458, -654, -654, -654, -228, -654, 785, - -654, -654, -654, -654, -356, -654, -654, 3, -654, -654, - -654, -654, -654, -654, 784, -654, -654, -654, -654, -654, - -654, -654, -654, 458, -217, -654, -654, -654, 12, -654, - 14, -654, 627, 860, 1246, 1107, -654, -654, 84, 309, - 183, -654, -653, 184, -654, -608, -654, -321, -504, -654, - -654, -654, -4, -382, 755, -226, -654, -654, -24, 20, - 467, 53, 814, 756 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -502 -static const yytype_int16 yytable[] = -{ - 235, 235, 188, 188, 235, 523, 390, 238, 238, 225, - 551, 238, 240, 240, 187, 248, 240, 234, 234, 419, - 204, 234, 205, 188, 249, 598, 277, 614, 257, 259, - 549, 111, 111, 235, 235, 588, 360, 490, 299, 783, - 204, 111, 205, 297, 298, 594, 274, 188, 584, 252, - 267, 572, 672, 674, -87, 215, 218, 705, 347, 284, - 614, 380, 601, 96, 693, 220, 696, 714, 347, 264, - 458, 306, 307, 3, 464, 676, 677, 111, 432, 363, - 559, 780, 296, 452, 784, -87, 253, 353, 466, -86, - 625, -84, 345, -432, 248, 761, 354, 111, 560, 242, - 405, 767, 243, 392, 260, 393, -88, 316, 353, 652, - -89, 290, 642, -84, -432, 220, 521, 256, 528, 531, - 532, 352, 356, 595, 453, 454, 239, 239, 292, 484, - 239, 467, 308, 626, -84, 346, -76, 306, 307, 253, - 358, -91, 729, 550, 359, 653, -87, 351, 216, 217, - 294, 295, 348, 381, 647, -478, 339, 340, 341, 521, - 272, 528, 348, 366, -83, 253, -479, -485, -87, -481, - 247, -87, -87, 783, -84, 550, -426, 310, 216, 217, - 704, -86, 393, 311, 681, 364, -79, 76, -481, 76, - 112, 112, -76, -89, 391, 211, 211, 211, -88, 315, - 227, 211, 211, 687, 550, 211, -86, -86, 216, 217, - -420, -81, 211, -482, 53, 235, 235, 297, 859, -426, - 770, -423, -485, -88, -88, 550, 813, 244, 235, -425, - 235, 235, 76, 211, 211, 238, 278, 238, 238, 247, - 240, 572, 240, 240, 211, 234, 648, 234, 416, -478, - 436, -420, -327, -420, 216, 217, 278, -478, 672, 674, - -479, -485, -423, -485, -423, -485, 396, 397, -479, -481, - -91, 220, -425, 376, 421, 827, 828, -90, 840, 379, - 829, 422, 423, 264, -86, 306, 307, 437, 485, 452, - 211, 384, 76, -327, 235, -327, 388, 547, 701, 488, - 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 412, 235, 414, 417, - 453, 454, 455, 480, 264, 536, 538, 520, 487, 111, - 395, 389, 398, 614, 267, 471, 472, 473, 474, 402, - 614, 801, 235, -91, 239, 875, 239, 418, 405, 470, - -90, -91, 520, -427, 475, -78, 431, -86, 581, 267, - 235, -83, 536, 538, 535, 537, -80, 235, -82, -88, - 520, 361, 362, 719, 235, -78, -90, 267, 406, 235, - 235, 76, -85, 235, 520, 409, 736, 617, 410, 737, - 738, 267, 611, 425, 621, 427, -427, 211, 211, 622, - 631, 824, 707, 704, -428, 634, 542, -430, -429, 188, - 482, -65, -73, 235, 520, 482, 235, 712, 235, 211, - 316, 211, 211, 61, 235, 433, 204, 623, 205, 627, - 434, 76, 841, -78, 520, 629, 76, -86, -78, 597, - 597, 267, 650, 651, -80, 636, 637, -428, 316, -80, - -430, -429, -88, 235, 572, -78, -78, -64, 614, 553, - 860, 554, 555, 556, 557, -85, -80, -80, 262, 553, - -80, 554, 555, 556, 557, 76, 211, 211, 211, 211, - 76, 211, 211, -77, 438, 211, 446, 76, 278, 713, - 211, 316, 782, 591, 614, 337, 338, 339, 340, 341, - 558, 559, 288, 289, 663, 795, 329, 330, 439, -88, - 558, 559, 440, 664, 448, 879, 461, 442, 211, 560, - 670, 440, 561, 673, 675, -85, 211, 211, 262, 560, - 452, 663, 561, 558, 559, 465, -420, 562, 337, 338, - 339, 340, 341, 211, -423, 76, 211, 468, -283, 431, - 235, 606, 560, 469, 486, 561, 342, 76, 188, 188, - 666, 211, 684, 452, 235, 76, 373, 76, 836, -90, - 698, 453, 454, 457, 838, 211, 204, 680, 205, -420, - -86, 539, 235, 575, 679, 699, 235, -423, 211, -283, - 235, -283, -82, 580, 576, -482, 444, 343, 235, 344, - 440, 316, 76, -78, 453, 454, 459, 688, 393, 374, - 611, 593, 743, 452, 605, 735, 329, 330, 615, 90, - 367, 90, 113, 113, 113, 211, 624, 628, 550, 385, - 399, 235, 229, 756, 757, 759, 760, 225, 723, 633, - 764, 766, 429, -73, 635, 334, 335, 336, 337, 338, - 339, 340, 341, 649, 453, 454, 462, 449, 667, 235, - -264, 368, 657, 369, 90, 658, -431, 665, 279, 111, - 386, 400, 387, 401, 758, 682, 482, 428, -88, 763, - 765, 683, 262, 386, 759, 430, 764, 766, 279, -276, - 685, 689, 235, 692, -284, 694, 776, 762, 450, 235, - 451, -80, -285, 235, 695, 697, 235, -431, 704, -431, - 807, 862, 711, 746, 747, 809, 748, -85, 211, 76, - 42, 43, 452, 772, 90, 460, 715, 443, 235, 445, - -276, 447, -276, 262, 716, -284, 820, -284, 76, 232, - -77, 793, 718, -285, 725, -285, 812, 94, 722, 94, - 732, 731, 863, 814, 864, 94, 94, 94, 734, 726, - 739, 94, 94, 453, 454, 94, 597, 741, 316, 820, - 733, 235, 94, 742, 744, 819, 773, 846, 774, 211, - 235, 777, 786, 329, 330, 235, 301, 302, 303, 304, - 305, 790, 94, 94, 94, 271, 275, 794, 796, 211, - 810, 815, 111, 579, 94, 211, 825, 816, -265, 826, - 843, 587, 844, 589, 336, 337, 338, 339, 340, 341, - 76, 848, 235, 90, 235, 854, 850, 853, 227, 808, - 855, 856, 858, 861, 871, 874, 211, 235, 876, 884, - 314, 211, 211, 886, 235, 889, 235, 520, 632, 116, - 94, 752, 94, 349, 267, 350, 883, 190, 882, 830, - 235, 686, 778, 779, 0, 235, 300, 0, 0, 0, - 0, 0, 802, 90, 0, 804, 805, 0, 90, 76, - 0, 0, 211, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 76, 76, 76, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 90, 0, 73, - 0, 73, 90, 0, 0, 0, 0, 0, 76, 90, - 279, 0, 226, 0, 0, 0, 0, 211, 0, 0, - 0, 0, 0, 76, 76, 0, 76, 0, 0, 0, - 0, 94, 0, 0, 0, 0, 849, 851, 208, 208, - 208, 833, 0, 0, 73, 76, 0, 94, 94, 0, - 0, 0, 0, 0, 0, 250, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 408, 408, 90, 0, 94, - 0, 94, 94, 420, 868, 869, 265, 0, 76, 90, - 873, 94, 0, 0, 0, 76, 94, 90, 0, 90, - 0, 76, 0, 76, 0, 0, 0, 0, 0, 887, - 76, 0, 0, 0, 73, 0, 0, 0, 0, 0, - 0, 0, 0, 890, 0, 0, 892, 0, 211, 0, - 0, 894, 0, 0, 90, 94, 94, 94, 94, 94, - 94, 94, 94, 357, 0, 94, 0, 94, 0, 0, - 94, 0, 0, 0, 0, 0, 745, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 94, 271, - 0, 0, 0, 0, 0, 0, 94, 94, 0, 93, - 0, 93, 114, 114, 0, 0, 0, 0, 0, 0, - 0, 0, 230, 94, 271, 94, 94, 0, 0, 0, - 0, 0, 0, 73, 578, 789, 0, 94, 0, 0, - 0, 94, 271, 0, 0, 94, 0, 94, 0, 0, - 798, 799, 800, 0, 93, 94, 271, 0, 280, 408, - 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, - 0, 90, 0, 0, 408, 0, 0, 0, 280, 0, - 208, 208, 94, 73, 817, 0, 0, 0, 73, 0, - 90, 0, 0, 0, 0, 0, 0, 0, 0, 821, - 822, 0, 0, 0, 0, 94, 271, 0, 0, 0, - 0, 0, 0, 0, 93, 0, 0, 0, 0, 0, - 0, 837, 0, 0, 0, 0, 0, 73, 0, 0, - 0, 0, 73, 0, 655, 0, 0, 0, 0, 73, - 0, 0, 0, 0, 0, 0, 0, 0, 92, 0, - 92, 0, 0, 0, 857, 0, 0, 0, 0, 208, - 208, 208, 208, 0, 476, 477, 0, 865, 0, 866, - 0, 0, 90, 0, 0, 0, 867, 0, 0, 0, - 229, 0, 0, 0, 671, 0, 0, 671, 671, 655, - 655, 0, 0, 92, 0, 0, 0, 73, 94, 94, - 0, 0, 0, 0, 0, 0, 671, 0, 0, 73, - 0, 0, 0, 93, 0, 0, 0, 73, 94, 73, - 0, 0, 691, 0, 691, 0, 691, 0, 0, 552, - 0, 90, 703, 706, 0, 706, 0, 0, 0, 0, - 0, 0, 0, 706, 0, 0, 90, 90, 90, 0, - 0, 0, 0, 92, 73, 0, 0, 0, 0, 94, - 0, 0, 0, 93, 0, 0, 0, 408, 93, 0, - 0, 265, 0, 0, 0, 0, 0, 0, 408, 94, - 90, 0, 0, 0, 0, 94, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 90, 90, 0, 90, 0, - 94, 0, 0, 0, 0, 0, 0, 93, 0, 0, - 0, 0, 93, 834, 0, 0, 94, 90, 0, 93, - 280, 94, 94, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 655, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 90, 0, 92, 0, 0, 0, 0, 90, 788, 94, - 0, 792, 94, 90, 0, 90, 0, 0, 0, 0, - 0, 73, 90, 0, 94, 94, 94, 93, 0, 0, - 408, 0, 0, 408, 408, 0, 0, 0, 0, 93, - 73, 0, 0, 671, 671, 0, 0, 93, 0, 93, - 0, 208, 92, 0, 0, 0, 0, 92, 94, 0, - 0, 0, 0, 0, 0, 0, 0, 94, 0, 0, - 0, 0, 0, 94, 94, 0, 94, 0, 0, 0, - 0, 0, 0, 0, 93, 691, 691, 0, 0, 0, - 691, 0, 0, 0, 0, 94, 92, 0, 0, 0, - 0, 92, 0, 0, 706, 0, 0, 0, 92, 0, - 0, 0, 208, 0, 408, 408, 0, 0, 0, 0, - 0, 0, 73, 0, 0, 0, 0, 0, 94, 0, - 226, 0, 0, 0, 0, 94, 0, 0, 740, 0, - 0, 94, 0, 94, 0, 0, 0, 0, 0, 0, - 94, 0, 408, 408, 0, 0, 0, 0, 408, 403, - 404, 0, 0, 0, 0, 691, 92, 0, 94, 271, - 0, 578, 706, 0, 0, 0, 0, 408, 92, 0, - 0, 73, 0, 0, 0, 0, 92, 0, 92, 0, - 0, 408, 0, 0, 408, 0, 73, 73, 73, 408, - 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 517, 518, 0, 208, 519, 0, 0, 0, - 93, 0, 0, 92, 160, 161, 162, 163, 164, 165, - 73, 166, 167, 0, 0, 168, 0, 0, 481, 169, - 170, 171, 172, 489, 0, 73, 73, 0, 73, 0, - 0, 0, 0, 173, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 832, 0, 0, 0, 73, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 0, 0, - 184, 316, 317, 318, 319, 320, 321, 322, 323, 185, - 325, 326, 0, 0, 0, 0, 329, 330, 0, 0, - 73, 0, 93, 750, 0, 0, 0, 73, 0, 0, - 230, 0, 0, 73, 0, 73, 0, 0, 0, 0, - 0, 489, 73, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 607, 609, 0, 0, 613, 0, 0, - 92, 618, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, - 0, 93, 0, 0, 0, 0, 0, 639, 659, 0, - 613, 0, 639, 0, 0, 0, 93, 93, 93, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 0, 0, 329, 330, 0, 656, 0, 0, - 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 93, 93, 0, 93, 331, - 0, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 92, 0, 835, 0, 0, 0, 93, 0, -501, - 0, -220, 0, 0, 0, 0, 0, -501, -501, -501, - 0, 0, -501, -501, -501, 0, -501, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -501, 0, 0, 0, - 93, 0, 0, 0, 0, -501, -501, 93, -501, -501, - -501, -501, -501, 93, 0, 93, 0, 0, 0, 0, - 92, 0, 93, 0, 700, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 92, 92, 92, 717, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -501, 0, 0, 0, 0, 0, 724, 0, 0, 0, - 727, 0, 0, 0, 728, 0, 0, 0, 0, 92, - 0, 0, 609, 0, -501, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 92, 92, 0, 92, 0, 0, - -501, 0, 0, -501, -501, 0, 0, 247, 0, -501, - -501, 0, 0, 0, 0, 755, 92, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 775, 0, 0, 0, 0, 0, 92, - 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, - 0, 0, 92, 0, 92, 0, 0, 0, 0, 0, - 0, 92, 0, 0, 0, 0, 639, 0, 0, 0, - 0, 0, 0, 613, 0, 0, 0, 0, 0, 0, - 613, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -478, -478, -478, 0, -478, 0, 0, 0, -478, -478, - 0, 0, 818, -478, 0, -478, -478, -478, -478, -478, - -478, -478, 0, -478, 0, 0, -478, -478, -478, -478, - -478, -478, -478, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -478, 0, 0, -478, -478, -478, -478, -478, - -478, -478, -478, -478, -478, 839, -478, -478, 0, -478, - -478, 0, 0, 0, 847, 0, 0, 0, 0, 852, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -478, - 0, 0, -478, -478, 0, -478, -478, 0, -478, -478, - -478, -478, -478, -478, -478, -478, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 609, 0, 613, 0, - 0, 0, 0, -478, -478, -478, 0, -478, 0, 0, - 0, 0, 0, 0, 0, -478, 0, 0, 885, 0, - 888, 0, 0, 0, -501, 4, 0, 5, 6, 7, - 8, 9, 0, 0, 613, 10, 11, 0, 0, 893, - 12, 0, 13, 14, 15, 16, 17, 18, 19, 0, - 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, - 0, 0, 27, 0, 0, 0, 0, 0, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 0, 42, 43, 0, 44, 45, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 46, 0, 0, 47, - 48, 0, 49, 50, 0, 51, 0, 52, 53, 54, - 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -485, 0, 0, 0, 0, - 58, 59, 60, -485, -485, -485, 0, 0, 0, -485, - -485, 0, -485, 0, -501, -501, 0, 0, 659, 0, - 0, -485, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -485, -485, 0, -485, -485, -485, -485, -485, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 0, 0, 329, 330, 0, 0, 0, -485, - -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, - -485, -485, 0, 0, -485, -485, -485, 0, 661, 331, - 0, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 0, 0, 0, 0, 0, 0, 0, -87, -485, - 0, -485, -485, -485, -485, -485, -485, -485, -485, -485, - -485, 0, 0, 0, -283, -485, -485, -485, 0, -485, - -485, -79, -283, -283, -283, -485, -485, 0, -283, -283, - 0, -283, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -283, -283, 0, -283, -283, -283, -283, -283, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 0, 0, 329, 330, 0, 0, 0, -283, -283, - -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, - -283, 0, 0, -283, -283, -283, 0, 662, 331, 660, - 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 0, 0, 0, 0, 0, 0, 0, -89, -283, 0, - -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, - 0, 0, 0, 0, 0, -283, -283, 0, -283, -283, - -81, 0, 0, 0, -283, -283, 4, 0, 5, 6, - 7, 8, 9, -501, -501, -501, 10, 11, 0, 0, - -501, 12, 0, 13, 14, 15, 16, 17, 18, 19, - 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, - 26, 0, 0, 27, 0, 0, 0, 0, 0, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 0, 42, 43, 0, 44, 45, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, - 47, 48, 0, 49, 50, 0, 51, 0, 52, 53, - 54, 55, 56, 57, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 58, 59, 60, 0, 0, 0, 0, 4, 0, - 5, 6, 7, 8, 9, -501, -501, -501, 10, 11, - 0, -501, -501, 12, 0, 13, 14, 15, 16, 17, - 18, 19, 0, 0, 0, 0, 20, 21, 22, 23, - 24, 25, 26, 0, 0, 27, 0, 0, 0, 0, - 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 0, 42, 43, 0, 44, - 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, - 0, 0, 47, 48, 0, 49, 50, 0, 51, 0, - 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 58, 59, 60, 0, 0, 0, 0, - 4, 0, 5, 6, 7, 8, 9, -501, -501, -501, - 10, 11, 0, 0, -501, 12, -501, 13, 14, 15, - 16, 17, 18, 19, 0, 0, 0, 0, 20, 21, - 22, 23, 24, 25, 26, 0, 0, 27, 0, 0, - 0, 0, 0, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 0, 42, 43, - 0, 44, 45, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 46, 0, 0, 47, 48, 0, 49, 50, 0, - 51, 0, 52, 53, 54, 55, 56, 57, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 58, 59, 60, 0, 0, - 0, 0, 4, 0, 5, 6, 7, 8, 9, -501, - -501, -501, 10, 11, 0, 0, -501, 12, 0, 13, - 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, - 20, 21, 22, 23, 24, 25, 26, 0, 0, 27, - 0, 0, 0, 0, 0, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 0, - 42, 43, 0, 44, 45, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 46, 0, 0, 47, 48, 0, 49, - 50, 0, 51, 0, 52, 53, 54, 55, 56, 57, - 0, 0, 0, 0, 0, 4, 0, 5, 6, 7, - 8, 9, 0, -501, -501, 10, 11, 58, 59, 60, - 12, 0, 13, 14, 15, 16, 17, 18, 19, 0, - 0, -501, -501, 20, 21, 22, 23, 24, 25, 26, - 0, 0, 27, 0, 0, 0, 0, 0, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 0, 42, 43, 0, 44, 45, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 46, 0, 0, 47, - 48, 0, 49, 50, 0, 51, 0, 52, 53, 54, - 55, 56, 57, 0, 0, 0, 0, 0, 4, 0, - 5, 6, 7, 8, 9, 0, 0, 0, 10, 11, - 58, 59, 60, 12, 0, 13, 14, 15, 16, 17, - 18, 19, 0, 0, -501, -501, 20, 21, 22, 23, - 24, 25, 26, 0, 0, 27, 0, 0, 0, 0, - 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 0, 42, 43, 0, 44, - 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, - 0, 0, 261, 48, 0, 49, 50, 0, 51, 0, - 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 58, 59, 60, 0, 0, 0, 0, - 0, 0, -501, 0, 0, 0, 0, -501, -501, 4, - 0, 5, 6, 7, 8, 9, 0, 0, 0, 10, - 11, 0, 0, 0, 12, 0, 13, 14, 15, 16, - 17, 18, 19, 0, 0, 0, 0, 20, 21, 22, - 23, 24, 25, 26, 0, 0, 27, 0, 0, 0, - 0, 0, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 0, 42, 43, 0, - 44, 45, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 46, 0, 0, 47, 48, 0, 49, 50, 0, 51, - 0, 52, 53, 54, 55, 56, 57, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 58, 59, 60, 0, 0, 0, - 0, 0, 0, -501, 0, 0, 0, 0, -501, -501, - 4, 0, 5, 6, 7, 8, 9, 0, 0, 0, - 10, 11, 0, 0, 0, 12, 0, 13, 14, 15, - 16, 17, 18, 19, 0, 0, 0, 0, 20, 21, - 22, 23, 24, 25, 26, 0, 0, 27, 0, 0, - 0, 0, 0, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 0, 42, 43, - 0, 44, 45, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 46, 0, 0, 47, 48, 0, 49, 50, 0, - 51, 0, 52, 53, 54, 55, 56, 57, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 58, 59, 60, 0, 0, - -501, 0, 4, 0, 5, 6, 7, 8, 9, -501, - -501, -501, 10, 11, 0, 0, 0, 12, 0, 13, - 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, - 20, 21, 22, 23, 24, 25, 26, 0, 0, 27, - 0, 0, 0, 0, 0, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 0, - 42, 43, 0, 44, 45, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 46, 0, 0, 47, 48, 0, 49, - 50, 0, 51, 0, 52, 53, 54, 55, 56, 57, - 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, - 8, 9, 0, 0, 0, 10, 11, 58, 59, 60, - 12, 0, 13, 14, 15, 16, 17, 18, 19, 0, - 0, -501, -501, 20, 21, 22, 23, 24, 25, 26, - 0, 0, 27, 0, 0, 0, 0, 0, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 0, 42, 43, 0, 44, 45, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 46, 0, 0, 47, - 48, 0, 49, 50, 0, 51, 0, 52, 53, 54, - 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, - 5, 6, 7, 0, 9, 0, 0, 0, 10, 11, - 58, 59, 60, 12, 0, 13, 14, 15, 16, 17, - 18, 19, 0, 0, 0, 395, 20, 21, 22, 23, - 24, 25, 26, 0, 0, 27, 0, 0, 0, 0, - 0, 0, 29, 0, 0, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 0, 42, 43, 0, 44, - 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 207, - 0, 0, 107, 48, 0, 49, 50, 0, 0, 0, - 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 58, 59, 60, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 216, 217, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 0, 0, 0, 0, 0, - 151, 152, 153, 154, 155, 156, 157, 158, 36, 37, - 159, 39, 0, 0, 0, 0, 0, 0, 160, 161, - 162, 163, 164, 165, 0, 166, 167, 0, 0, 168, - 0, 0, 0, 169, 170, 171, 172, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 173, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 0, 0, 184, 0, 0, -480, -480, -480, - 0, -480, 0, 185, 186, -480, -480, 0, 0, 0, - -480, 0, -480, -480, -480, -480, -480, -480, -480, 0, - -480, 0, 0, -480, -480, -480, -480, -480, -480, -480, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -480, - 0, 0, -480, -480, -480, -480, -480, -480, -480, -480, - -480, -480, 0, -480, -480, 0, -480, -480, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -480, 0, 0, -480, - -480, 0, -480, -480, 0, -480, -480, -480, -480, -480, - -480, -480, -480, 0, 0, 0, 0, 0, 0, 0, - -479, -479, -479, 0, -479, 0, 0, 0, -479, -479, - -480, -480, -480, -479, -480, -479, -479, -479, -479, -479, - -479, -479, -480, -479, 0, 0, -479, -479, -479, -479, - -479, -479, -479, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -479, 0, 0, -479, -479, -479, -479, -479, - -479, -479, -479, -479, -479, 0, -479, -479, 0, -479, - -479, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -479, - 0, 0, -479, -479, 0, -479, -479, 0, -479, -479, - -479, -479, -479, -479, -479, -479, 0, 0, 0, 0, - 0, 0, 0, -481, -481, -481, 0, -481, 0, 0, - 0, -481, -481, -479, -479, -479, -481, -479, -481, -481, - -481, -481, -481, -481, -481, -479, 0, 0, 0, -481, - -481, -481, -481, -481, -481, -481, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -481, 0, 0, -481, -481, - -481, -481, -481, -481, -481, -481, -481, -481, 0, -481, - -481, 0, -481, -481, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -481, 710, 0, -481, -481, 0, -481, -481, - 0, -481, -481, -481, -481, -481, -481, -481, -481, 0, - 0, 0, 0, -87, 0, 0, -482, -482, -482, 0, - -482, 0, 0, 0, -482, -482, -481, -481, -481, -482, - 0, -482, -482, -482, -482, -482, -482, -482, -481, 0, - 0, 0, -482, -482, -482, -482, -482, -482, -482, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -482, 0, - 0, -482, -482, -482, -482, -482, -482, -482, -482, -482, - -482, 0, -482, -482, 0, -482, -482, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -482, 662, 0, -482, -482, - 0, -482, -482, 0, -482, -482, -482, -482, -482, -482, - -482, -482, 0, 0, 0, 0, -89, 0, 0, -254, - -254, -254, 0, -254, 0, 0, 0, -254, -254, -482, - -482, -482, -254, 0, -254, -254, -254, -254, -254, -254, - -254, -482, 0, 0, 0, -254, -254, -254, -254, -254, - -254, -254, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -254, 0, 0, -254, -254, -254, -254, -254, -254, - -254, -254, -254, -254, 0, -254, -254, 0, -254, -254, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -254, 0, - 0, -254, -254, 0, -254, -254, 0, -254, -254, -254, - -254, -254, -254, -254, -254, 0, 0, 0, 0, 0, - 0, 0, -254, -254, -254, 0, -254, 0, 0, 0, - -254, -254, -254, -254, -254, -254, 0, -254, -254, -254, - -254, -254, -254, -254, 244, 0, 0, 0, -254, -254, - -254, -254, -254, -254, -254, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -254, 0, 0, -254, -254, -254, - -254, -254, -254, -254, -254, -254, -254, 0, -254, -254, - 0, -254, -254, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -254, 0, 0, -254, -254, 0, -254, -254, 0, - -254, -254, -254, -254, -254, -254, -254, -254, 0, 0, - 0, 0, 0, 0, 0, -483, -483, -483, 0, -483, - 0, 0, 0, -483, -483, -254, -254, -254, -483, 0, - -483, -483, -483, -483, -483, -483, -483, 247, 0, 0, - 0, -483, -483, -483, -483, -483, -483, -483, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -483, 0, 0, - -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, - 0, -483, -483, 0, -483, -483, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -483, 0, 0, -483, -483, 0, - -483, -483, 0, -483, -483, -483, -483, -483, -483, -483, - -483, 0, 0, 0, 0, 0, 0, 0, -484, -484, - -484, 0, -484, 0, 0, 0, -484, -484, -483, -483, - -483, -484, 0, -484, -484, -484, -484, -484, -484, -484, - -483, 0, 0, 0, -484, -484, -484, -484, -484, -484, - -484, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -484, 0, 0, -484, -484, -484, -484, -484, -484, -484, - -484, -484, -484, 0, -484, -484, 0, -484, -484, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -484, 0, 0, - -484, -484, 0, -484, -484, 0, -484, -484, -484, -484, - -484, -484, -484, -484, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -484, -484, -484, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -484, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 141, 142, 143, 192, 193, 194, 195, 148, 149, 150, - 0, 0, 0, 0, 0, 151, 152, 153, 154, 196, - 197, 198, 158, 281, 282, 199, 283, 0, 0, 0, - 0, 0, 0, 160, 161, 162, 163, 164, 165, 0, - 166, 167, 0, 0, 168, 0, 0, 0, 169, 170, - 171, 172, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 173, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 0, 0, 184, - 0, 0, 0, 0, 0, 0, 0, 0, 185, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 141, 142, 143, 192, 193, - 194, 195, 148, 149, 150, 0, 0, 0, 0, 0, - 151, 152, 153, 154, 196, 197, 198, 158, 251, 0, - 199, 0, 0, 0, 0, 0, 0, 0, 160, 161, - 162, 163, 164, 165, 0, 166, 167, 0, 0, 168, - 0, 0, 0, 169, 170, 171, 172, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 173, 0, 52, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 0, 0, 184, 0, 0, 0, 0, 0, - 0, 0, 0, 185, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 141, 142, 143, 192, 193, 194, 195, 148, 149, 150, - 0, 0, 0, 0, 0, 151, 152, 153, 154, 196, - 197, 198, 158, 0, 0, 199, 0, 0, 0, 0, - 0, 0, 0, 160, 161, 162, 163, 164, 165, 0, - 166, 167, 0, 0, 168, 0, 0, 0, 169, 170, - 171, 172, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 173, 0, 52, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 0, 0, 184, - 0, 0, 0, 0, 0, 0, 0, 0, 185, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 141, 142, 143, 192, 193, - 194, 195, 148, 149, 150, 0, 0, 0, 0, 0, - 151, 152, 153, 154, 196, 197, 198, 158, 0, 0, - 199, 0, 0, 0, 0, 0, 0, 0, 160, 161, - 162, 163, 164, 165, 0, 166, 167, 0, 0, 168, - 0, 0, 0, 169, 170, 171, 172, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 173, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 0, 0, 184, 0, 5, 6, 7, 0, - 9, 0, 0, 185, 10, 11, 0, 0, 0, 12, - 0, 13, 14, 15, 97, 98, 18, 19, 0, 0, - 0, 0, 99, 21, 22, 23, 24, 25, 26, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, - 0, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 0, 42, 43, 0, 44, 45, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 207, 0, 0, 107, 48, - 0, 49, 50, 0, 231, 232, 52, 53, 54, 55, - 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 5, 6, 7, 8, 9, 58, - 233, 60, 10, 11, 0, 0, 0, 12, 411, 13, - 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, - 20, 21, 22, 23, 24, 25, 26, 0, 0, 27, - 0, 0, 0, 0, 0, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 0, - 42, 43, 0, 44, 45, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 46, 0, 0, 47, 48, 0, 49, - 50, 0, 51, 0, 52, 53, 54, 55, 56, 57, - 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, - 0, 9, 0, 0, 0, 10, 11, 58, 59, 60, - 12, 0, 13, 14, 15, 16, 17, 18, 19, 0, - 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, - 0, 0, 27, 0, 0, 0, 0, 0, 0, 29, - 0, 0, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 0, 42, 43, 0, 44, 45, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 207, 0, 0, 107, - 48, 0, 49, 50, 0, 616, 232, 52, 53, 54, - 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, - 5, 6, 7, 0, 9, 0, 0, 0, 10, 11, - 58, 59, 60, 12, 0, 13, 14, 15, 97, 98, - 18, 19, 0, 0, 0, 0, 99, 21, 22, 23, - 24, 25, 26, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 29, 0, 0, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 0, 42, 43, 0, 44, - 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 207, - 0, 0, 107, 48, 0, 49, 50, 0, 231, 232, - 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 5, 6, 7, 0, 9, 0, 0, - 0, 10, 11, 58, 233, 60, 12, 0, 13, 14, - 15, 97, 98, 18, 19, 0, 0, 0, 0, 99, - 21, 22, 23, 24, 25, 26, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 29, 0, 0, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 0, 42, - 43, 0, 44, 45, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 207, 0, 0, 107, 413, 0, 49, 50, - 0, 231, 232, 52, 53, 54, 55, 56, 57, 0, - 0, 0, 0, 0, 0, 0, 5, 6, 7, 0, - 9, 0, 0, 0, 10, 11, 58, 233, 60, 12, - 0, 13, 14, 15, 97, 98, 18, 19, 0, 0, - 0, 0, 99, 100, 101, 23, 24, 25, 26, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, - 0, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 0, 42, 43, 0, 44, 45, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 207, 0, 0, 107, 48, - 0, 49, 50, 0, 608, 232, 52, 53, 54, 55, - 56, 57, 0, 0, 0, 0, 0, 0, 0, 5, - 6, 7, 0, 9, 0, 0, 0, 10, 11, 58, - 233, 60, 12, 0, 13, 14, 15, 97, 98, 18, - 19, 0, 0, 0, 0, 99, 100, 101, 23, 24, - 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 29, 0, 0, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 0, 42, 43, 0, 44, 45, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 207, 0, - 0, 107, 48, 0, 49, 50, 0, 612, 232, 52, - 53, 54, 55, 56, 57, 0, 0, 0, 0, 0, - 0, 0, 5, 6, 7, 0, 9, 0, 0, 0, - 10, 11, 58, 233, 60, 12, 0, 13, 14, 15, - 97, 98, 18, 19, 0, 0, 0, 0, 99, 21, - 22, 23, 24, 25, 26, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 29, 0, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 0, 42, 43, - 0, 44, 45, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 207, 0, 0, 107, 48, 0, 49, 50, 0, - 608, 232, 52, 53, 54, 55, 56, 57, 0, 0, - 0, 0, 0, 0, 0, 5, 6, 7, 0, 9, - 0, 0, 0, 10, 11, 58, 233, 60, 12, 0, - 13, 14, 15, 97, 98, 18, 19, 0, 0, 0, - 0, 99, 100, 101, 23, 24, 25, 26, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 0, 42, 43, 0, 44, 45, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 207, 0, 0, 107, 48, 0, - 49, 50, 0, 803, 232, 52, 53, 54, 55, 56, - 57, 0, 0, 0, 0, 0, 0, 0, 5, 6, - 7, 0, 9, 0, 0, 0, 10, 11, 58, 233, - 60, 12, 0, 13, 14, 15, 97, 98, 18, 19, - 0, 0, 0, 0, 99, 100, 101, 23, 24, 25, - 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 29, 0, 0, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 0, 42, 43, 0, 44, 45, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 207, 0, 0, - 107, 48, 0, 49, 50, 0, 806, 232, 52, 53, - 54, 55, 56, 57, 0, 0, 0, 0, 0, 0, - 0, 5, 6, 7, 0, 9, 0, 0, 0, 10, - 11, 58, 233, 60, 12, 0, 13, 14, 15, 97, - 98, 18, 19, 0, 0, 0, 0, 99, 100, 101, - 23, 24, 25, 26, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 29, 0, 0, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 0, 42, 43, 0, - 44, 45, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 207, 0, 0, 107, 48, 0, 49, 50, 0, 811, - 232, 52, 53, 54, 55, 56, 57, 0, 0, 0, - 0, 0, 0, 0, 5, 6, 7, 0, 9, 0, - 0, 0, 10, 11, 58, 233, 60, 12, 0, 13, - 14, 15, 97, 98, 18, 19, 0, 0, 0, 0, - 99, 100, 101, 23, 24, 25, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 29, 0, 0, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 0, - 42, 43, 0, 44, 45, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 207, 0, 0, 107, 48, 0, 49, - 50, 0, 870, 232, 52, 53, 54, 55, 56, 57, - 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, - 0, 9, 0, 0, 0, 10, 11, 58, 233, 60, - 12, 0, 13, 14, 15, 97, 98, 18, 19, 0, - 0, 0, 0, 99, 100, 101, 23, 24, 25, 26, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, - 0, 0, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 0, 42, 43, 0, 44, 45, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 207, 0, 0, 107, - 48, 0, 49, 50, 0, 872, 232, 52, 53, 54, - 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, - 5, 6, 7, 0, 9, 0, 0, 0, 10, 11, - 58, 233, 60, 12, 0, 13, 14, 15, 97, 98, - 18, 19, 0, 0, 0, 0, 99, 100, 101, 23, - 24, 25, 26, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 29, 0, 0, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 0, 42, 43, 0, 44, - 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 207, - 0, 0, 107, 48, 0, 49, 50, 0, 891, 232, - 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 5, 6, 7, 0, 9, 0, 0, - 0, 10, 11, 58, 233, 60, 12, 0, 13, 14, - 15, 16, 17, 18, 19, 0, 0, 0, 0, 20, - 21, 22, 23, 24, 25, 26, 0, 0, 27, 0, - 0, 0, 0, 0, 0, 29, 0, 0, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 0, 42, - 43, 0, 44, 45, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 207, 0, 0, 107, 48, 0, 49, 50, - 0, 0, 0, 52, 53, 54, 55, 56, 57, 0, - 0, 0, 0, 0, 0, 0, 5, 6, 7, 0, - 9, 0, 0, 0, 10, 11, 58, 59, 60, 12, - 0, 13, 14, 15, 97, 98, 18, 19, 0, 0, - 0, 0, 99, 21, 22, 23, 24, 25, 26, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, - 0, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 0, 42, 43, 0, 44, 45, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 207, 0, 0, 107, 48, - 0, 49, 50, 0, 266, 0, 52, 53, 54, 55, - 56, 57, 0, 0, 0, 0, 0, 0, 0, 5, - 6, 7, 0, 9, 0, 0, 0, 10, 11, 58, - 233, 60, 12, 0, 13, 14, 15, 16, 17, 18, - 19, 0, 0, 0, 0, 20, 21, 22, 23, 24, - 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 29, 0, 0, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 0, 42, 43, 0, 44, 45, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 207, 0, - 0, 107, 48, 0, 49, 50, 0, 479, 0, 52, - 53, 54, 55, 56, 57, 0, 0, 0, 0, 0, - 0, 0, 5, 6, 7, 0, 9, 0, 0, 0, - 10, 11, 58, 233, 60, 12, 0, 13, 14, 15, - 97, 98, 18, 19, 0, 0, 0, 0, 99, 100, - 101, 23, 24, 25, 26, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 29, 0, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 0, 42, 43, - 0, 44, 45, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 207, 0, 0, 107, 48, 0, 49, 50, 0, - 590, 0, 52, 53, 54, 55, 56, 57, 0, 0, - 0, 0, 0, 0, 0, 5, 6, 7, 0, 9, - 0, 0, 0, 10, 11, 58, 233, 60, 12, 0, - 13, 14, 15, 97, 98, 18, 19, 0, 0, 0, - 0, 99, 100, 101, 23, 24, 25, 26, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 0, 42, 43, 0, 44, 45, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 207, 0, 0, 107, 48, 0, - 49, 50, 0, 638, 0, 52, 53, 54, 55, 56, - 57, 0, 0, 0, 0, 0, 0, 0, 5, 6, - 7, 0, 9, 0, 0, 0, 10, 11, 58, 233, - 60, 12, 0, 13, 14, 15, 97, 98, 18, 19, - 0, 0, 0, 0, 99, 100, 101, 23, 24, 25, - 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 29, 0, 0, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 0, 42, 43, 0, 44, 45, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 207, 0, 0, - 107, 48, 0, 49, 50, 0, 479, 0, 52, 53, - 54, 55, 56, 57, 0, 0, 0, 0, 0, 0, - 0, 5, 6, 7, 0, 9, 0, 0, 0, 10, - 11, 58, 233, 60, 12, 0, 13, 14, 15, 97, - 98, 18, 19, 0, 0, 0, 0, 99, 100, 101, - 23, 24, 25, 26, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 29, 0, 0, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 0, 42, 43, 0, - 44, 45, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 207, 0, 0, 107, 48, 0, 49, 50, 0, 754, - 0, 52, 53, 54, 55, 56, 57, 0, 0, 0, - 0, 0, 0, 0, 5, 6, 7, 0, 9, 0, - 0, 0, 10, 11, 58, 233, 60, 12, 0, 13, - 14, 15, 97, 98, 18, 19, 0, 0, 0, 0, - 99, 100, 101, 23, 24, 25, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 29, 0, 0, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 0, - 42, 43, 0, 44, 45, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 207, 0, 0, 107, 48, 0, 49, - 50, 0, 797, 0, 52, 53, 54, 55, 56, 57, - 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, - 0, 9, 0, 0, 0, 10, 11, 58, 233, 60, - 12, 0, 13, 14, 15, 97, 98, 18, 19, 0, - 0, 0, 0, 99, 100, 101, 23, 24, 25, 26, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, - 0, 0, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 0, 42, 43, 0, 44, 45, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 207, 0, 0, 107, - 48, 0, 49, 50, 0, 0, 0, 52, 53, 54, - 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, - 5, 6, 7, 0, 9, 0, 0, 0, 10, 11, - 58, 233, 60, 12, 0, 13, 14, 15, 16, 17, - 18, 19, 0, 0, 0, 0, 20, 21, 22, 23, - 24, 25, 26, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 29, 0, 0, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 0, 42, 43, 0, 44, - 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 207, - 0, 0, 107, 48, 0, 49, 50, 0, 0, 0, - 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 5, 6, 7, 0, 9, 0, 0, - 0, 10, 11, 58, 233, 60, 12, 0, 13, 14, - 15, 97, 98, 18, 19, 0, 0, 0, 0, 99, - 100, 101, 23, 24, 25, 26, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 102, 0, 0, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 0, 42, - 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 224, 0, 0, 47, 48, 0, 49, 50, - 0, 51, 0, 52, 53, 54, 55, 56, 57, 0, - 0, 0, 5, 6, 7, 0, 9, 0, 751, 0, - 10, 11, 0, 0, 0, 12, 108, 13, 14, 15, - 97, 98, 18, 19, 0, 0, 0, 0, 99, 100, - 101, 23, 24, 25, 26, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 102, 0, 0, 32, 33, 103, - 35, 36, 37, 104, 39, 40, 41, 0, 42, 43, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 105, 0, - 0, 106, 0, 0, 107, 48, 0, 49, 50, 0, - 0, 0, 52, 53, 54, 55, 56, 57, 0, 0, - 0, 5, 6, 7, 0, 9, 0, 0, 0, 10, - 11, 0, 0, 0, 12, 108, 13, 14, 15, 97, - 98, 18, 19, 0, 0, 0, 0, 99, 100, 101, - 23, 24, 25, 26, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 102, 0, 0, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 0, 42, 43, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 224, 0, 0, 47, 48, 0, 49, 50, 0, 51, - 0, 52, 53, 54, 55, 56, 57, 0, 0, 0, - 5, 6, 7, 0, 9, 0, 0, 0, 10, 11, - 0, 0, 0, 12, 108, 13, 14, 15, 97, 98, - 18, 19, 0, 0, 0, 0, 99, 100, 101, 23, - 24, 25, 26, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 102, 0, 0, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 0, 42, 43, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, - 0, 0, 312, 48, 0, 49, 50, 0, 313, 0, - 52, 53, 54, 55, 56, 57, 0, 0, 0, 5, - 6, 7, 0, 9, 0, 0, 0, 10, 11, 0, - 0, 0, 12, 108, 13, 14, 15, 97, 98, 18, - 19, 0, 0, 0, 0, 99, 100, 101, 23, 24, - 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 102, 0, 0, 32, 33, 103, 35, 36, 37, - 104, 39, 40, 41, 0, 42, 43, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 106, 0, - 0, 107, 48, 0, 49, 50, 0, 0, 0, 52, - 53, 54, 55, 56, 57, 0, 0, 0, 5, 6, - 7, 0, 9, 0, 0, 0, 10, 11, 0, 0, - 0, 12, 108, 13, 14, 15, 97, 98, 18, 19, - 0, 0, 0, 0, 99, 100, 101, 23, 24, 25, - 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 102, 0, 0, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 0, 42, 43, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 276, 0, 0, - 107, 48, 0, 49, 50, 0, 0, 0, 52, 53, - 54, 55, 56, 57, 0, 0, 0, 5, 6, 7, - 0, 9, 0, 0, 0, 10, 11, 0, 0, 0, - 12, 108, 13, 14, 15, 97, 98, 18, 19, 0, - 0, 0, 0, 99, 100, 101, 23, 24, 25, 26, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, - 0, 0, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 0, 42, 43, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 831, 0, 0, 107, - 48, 0, 49, 50, 0, 0, 0, 52, 53, 54, - 55, 56, 57, 0, 0, 0, 0, 0, 0, 524, - 525, 0, 0, 526, 0, 0, 0, 0, 0, 0, - 108, 160, 161, 162, 163, 164, 165, 0, 166, 167, - 0, 0, 168, 0, 0, 0, 169, 170, 171, 172, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 529, 525, 184, 0, 530, - 0, 0, 0, 0, 0, 0, 185, 160, 161, 162, - 163, 164, 165, 0, 166, 167, 0, 0, 168, 0, - 0, 0, 169, 170, 171, 172, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 173, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 545, 518, 184, 0, 546, 0, 0, 0, 0, - 0, 0, 185, 160, 161, 162, 163, 164, 165, 0, - 166, 167, 0, 0, 168, 0, 0, 0, 169, 170, - 171, 172, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 173, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 582, 518, 184, - 0, 583, 0, 0, 0, 0, 0, 0, 185, 160, - 161, 162, 163, 164, 165, 0, 166, 167, 0, 0, - 168, 0, 0, 0, 169, 170, 171, 172, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 173, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 585, 525, 184, 0, 586, 0, 0, - 0, 0, 0, 0, 185, 160, 161, 162, 163, 164, - 165, 0, 166, 167, 0, 0, 168, 0, 0, 0, - 169, 170, 171, 172, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 173, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 599, - 518, 184, 0, 600, 0, 0, 0, 0, 0, 0, - 185, 160, 161, 162, 163, 164, 165, 0, 166, 167, - 0, 0, 168, 0, 0, 0, 169, 170, 171, 172, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 602, 525, 184, 0, 603, - 0, 0, 0, 0, 0, 0, 185, 160, 161, 162, - 163, 164, 165, 0, 166, 167, 0, 0, 168, 0, - 0, 0, 169, 170, 171, 172, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 173, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 640, 518, 184, 0, 641, 0, 0, 0, 0, - 0, 0, 185, 160, 161, 162, 163, 164, 165, 0, - 166, 167, 0, 0, 168, 0, 0, 0, 169, 170, - 171, 172, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 173, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 643, 525, 184, - 0, 644, 0, 0, 0, 0, 0, 0, 185, 160, - 161, 162, 163, 164, 165, 0, 166, 167, 0, 0, - 168, 0, 0, 0, 169, 170, 171, 172, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 173, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 877, 518, 184, 0, 878, 0, 0, - 0, 0, 0, 0, 185, 160, 161, 162, 163, 164, - 165, 0, 166, 167, 0, 0, 168, 0, 0, 0, - 169, 170, 171, 172, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 173, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 880, - 525, 184, 0, 881, 0, 0, 0, 0, 0, 0, - 185, 160, 161, 162, 163, 164, 165, 0, 166, 167, - 0, 0, 168, 0, 0, 0, 169, 170, 171, 172, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 0, 0, 184, 0, 0, - 0, 0, 0, 0, 0, 0, 185, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 0, 0, 329, 330, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 331, 0, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 0, 253, 329, 330, 0, 0, 0, -220, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 0, 0, 329, 330, 0, 0, 331, - 0, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 331, -220, 332, 333, 334, 335, 336, 337, 338, 339, - 340, 341, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 605, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 0, 0, 329, 330, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, -502, -502, 0, 0, 329, 330, 0, 0, 0, - 0, 0, 0, 331, 0, 332, 333, 334, 335, 336, - 337, 338, 339, 340, 341, 0, 0, 0, 0, 0, - 0, 0, 332, 333, 334, 335, 336, 337, 338, 339, - 340, 341, 316, -502, -502, -502, -502, 321, 322, 0, - 0, -502, -502, 0, 0, 0, 0, 329, 330, 316, - 317, 318, 319, 320, 321, 322, 0, 0, 325, 326, - 0, 0, 0, 0, 329, 330, 0, 0, 0, 0, - 0, 0, 0, 0, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 0, 0, 0, 0, 0, 0, - 0, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341 -}; - -static const yytype_int16 yycheck[] = -{ - 16, 17, 7, 8, 20, 343, 215, 16, 17, 15, - 370, 20, 16, 17, 7, 22, 20, 16, 17, 247, - 8, 20, 8, 28, 22, 397, 51, 409, 44, 45, - 368, 5, 6, 49, 50, 391, 106, 315, 62, 692, - 28, 15, 28, 59, 60, 27, 50, 52, 386, 28, - 49, 372, 531, 532, 13, 11, 12, 577, 26, 52, - 442, 13, 400, 4, 568, 12, 570, 587, 26, 47, - 287, 36, 37, 0, 291, 533, 534, 51, 261, 1, - 92, 689, 59, 58, 692, 25, 130, 94, 58, 13, - 81, 25, 81, 83, 101, 664, 94, 71, 110, 17, - 84, 670, 20, 15, 54, 17, 13, 64, 115, 72, - 25, 129, 450, 103, 83, 62, 342, 120, 344, 345, - 346, 83, 102, 105, 99, 100, 16, 17, 129, 312, - 20, 101, 28, 124, 103, 124, 126, 36, 37, 130, - 50, 103, 126, 369, 54, 108, 105, 83, 130, 131, - 56, 57, 120, 105, 129, 26, 113, 114, 115, 385, - 50, 387, 120, 110, 126, 130, 26, 26, 108, 128, - 128, 130, 131, 826, 108, 401, 81, 103, 130, 131, - 15, 105, 17, 126, 544, 107, 126, 2, 128, 4, - 5, 6, 126, 108, 218, 10, 11, 12, 105, 103, - 15, 16, 17, 563, 430, 20, 130, 131, 130, 131, - 81, 126, 27, 128, 94, 231, 232, 233, 826, 124, - 678, 81, 81, 130, 131, 451, 125, 128, 244, 81, - 246, 247, 47, 48, 49, 244, 51, 246, 247, 128, - 244, 562, 246, 247, 59, 244, 463, 246, 247, 120, - 266, 122, 81, 124, 130, 131, 71, 128, 737, 738, - 120, 120, 122, 122, 124, 124, 222, 223, 128, 128, - 25, 218, 124, 126, 52, 779, 780, 25, 798, 54, - 784, 59, 60, 261, 25, 36, 37, 267, 313, 58, - 105, 103, 107, 122, 310, 124, 83, 367, 576, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, 338, 339, 340, 341, 244, 343, 246, 247, - 99, 100, 101, 310, 312, 351, 352, 342, 315, 313, - 131, 83, 54, 725, 343, 301, 302, 303, 304, 25, - 732, 723, 368, 108, 244, 859, 246, 247, 84, 300, - 108, 103, 367, 81, 305, 25, 83, 108, 384, 368, - 386, 126, 388, 389, 351, 352, 25, 393, 126, 25, - 385, 56, 57, 592, 400, 126, 103, 386, 126, 405, - 406, 206, 25, 409, 399, 126, 624, 413, 240, 625, - 626, 400, 406, 128, 413, 120, 124, 222, 223, 413, - 426, 771, 14, 15, 81, 431, 363, 81, 81, 424, - 310, 125, 126, 439, 429, 315, 442, 83, 444, 244, - 64, 246, 247, 2, 450, 125, 424, 417, 424, 419, - 125, 256, 798, 103, 449, 424, 261, 103, 108, 396, - 397, 450, 468, 469, 103, 435, 436, 124, 64, 108, - 124, 124, 108, 479, 785, 125, 126, 125, 850, 50, - 830, 52, 53, 54, 55, 108, 125, 126, 47, 50, - 126, 52, 53, 54, 55, 300, 301, 302, 303, 304, - 305, 306, 307, 126, 123, 310, 121, 312, 313, 83, - 315, 64, 50, 393, 886, 111, 112, 113, 114, 115, - 91, 92, 54, 55, 521, 83, 79, 80, 126, 103, - 91, 92, 130, 521, 54, 863, 101, 126, 343, 110, - 528, 130, 113, 531, 532, 103, 351, 352, 107, 110, - 58, 548, 113, 91, 92, 101, 81, 128, 111, 112, - 113, 114, 115, 368, 81, 370, 371, 64, 81, 83, - 576, 403, 110, 64, 126, 113, 81, 382, 573, 574, - 83, 386, 552, 58, 590, 390, 81, 392, 787, 103, - 573, 99, 100, 101, 793, 400, 574, 543, 574, 124, - 103, 90, 608, 10, 541, 574, 612, 124, 413, 122, - 616, 124, 126, 13, 8, 128, 126, 122, 624, 124, - 130, 64, 427, 126, 99, 100, 101, 564, 17, 124, - 624, 10, 638, 58, 126, 624, 79, 80, 125, 2, - 81, 4, 5, 6, 7, 450, 126, 125, 864, 81, - 81, 657, 15, 659, 660, 661, 662, 653, 604, 121, - 666, 667, 81, 126, 125, 108, 109, 110, 111, 112, - 113, 114, 115, 129, 99, 100, 101, 81, 83, 685, - 126, 122, 126, 124, 47, 125, 81, 123, 51, 653, - 122, 122, 124, 124, 661, 123, 576, 256, 103, 666, - 667, 10, 261, 122, 710, 124, 712, 713, 71, 81, - 103, 126, 718, 126, 81, 50, 686, 83, 122, 725, - 124, 126, 81, 729, 126, 50, 732, 122, 15, 124, - 729, 81, 123, 52, 53, 729, 55, 103, 543, 544, - 59, 60, 58, 680, 107, 61, 10, 270, 754, 272, - 122, 274, 124, 312, 10, 122, 762, 124, 563, 92, - 126, 707, 126, 122, 126, 124, 736, 2, 123, 4, - 126, 125, 122, 743, 124, 10, 11, 12, 125, 611, - 125, 16, 17, 99, 100, 20, 723, 121, 64, 795, - 622, 797, 27, 125, 123, 762, 10, 803, 125, 604, - 806, 10, 84, 79, 80, 811, 39, 40, 41, 42, - 43, 9, 47, 48, 49, 49, 50, 10, 10, 624, - 125, 121, 786, 382, 59, 630, 125, 108, 126, 126, - 10, 390, 10, 392, 110, 111, 112, 113, 114, 115, - 645, 126, 848, 206, 850, 10, 126, 125, 653, 729, - 10, 121, 10, 54, 848, 121, 661, 863, 10, 10, - 71, 666, 667, 126, 870, 123, 872, 862, 427, 6, - 105, 653, 107, 78, 863, 81, 866, 7, 865, 785, - 886, 562, 689, 689, -1, 891, 62, -1, -1, -1, - -1, -1, 724, 256, -1, 727, 728, -1, 261, 704, - -1, -1, 707, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 719, 720, 721, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 300, -1, 2, - -1, 4, 305, -1, -1, -1, -1, -1, 753, 312, - 313, -1, 15, -1, -1, -1, -1, 762, -1, -1, - -1, -1, -1, 768, 769, -1, 771, -1, -1, -1, - -1, 206, -1, -1, -1, -1, 808, 809, 10, 11, - 12, 786, -1, -1, 47, 790, -1, 222, 223, -1, - -1, -1, -1, -1, -1, 27, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 239, 240, 370, -1, 244, - -1, 246, 247, 247, 846, 847, 48, -1, 823, 382, - 852, 256, -1, -1, -1, 830, 261, 390, -1, 392, - -1, 836, -1, 838, -1, -1, -1, -1, -1, 871, - 845, -1, -1, -1, 107, -1, -1, -1, -1, -1, - -1, -1, -1, 885, -1, -1, 888, -1, 863, -1, - -1, 893, -1, -1, 427, 300, 301, 302, 303, 304, - 305, 306, 307, 105, -1, 310, -1, 312, -1, -1, - 315, -1, -1, -1, -1, -1, 645, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 343, 343, - -1, -1, -1, -1, -1, -1, 351, 352, -1, 2, - -1, 4, 5, 6, -1, -1, -1, -1, -1, -1, - -1, -1, 15, 368, 368, 370, 371, -1, -1, -1, - -1, -1, -1, 206, 378, 704, -1, 382, -1, -1, - -1, 386, 386, -1, -1, 390, -1, 392, -1, -1, - 719, 720, 721, -1, 47, 400, 400, -1, 51, 403, - -1, -1, -1, -1, -1, -1, -1, -1, 413, -1, - -1, 544, -1, -1, 418, -1, -1, -1, 71, -1, - 222, 223, 427, 256, 753, -1, -1, -1, 261, -1, - 563, -1, -1, -1, -1, -1, -1, -1, -1, 768, - 769, -1, -1, -1, -1, 450, 450, -1, -1, -1, - -1, -1, -1, -1, 107, -1, -1, -1, -1, -1, - -1, 790, -1, -1, -1, -1, -1, 300, -1, -1, - -1, -1, 305, -1, 478, -1, -1, -1, -1, 312, - -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, - 4, -1, -1, -1, 823, -1, -1, -1, -1, 301, - 302, 303, 304, -1, 306, 307, -1, 836, -1, 838, - -1, -1, 645, -1, -1, -1, 845, -1, -1, -1, - 653, -1, -1, -1, 528, -1, -1, 531, 532, 533, - 534, -1, -1, 47, -1, -1, -1, 370, 543, 544, - -1, -1, -1, -1, -1, -1, 550, -1, -1, 382, - -1, -1, -1, 206, -1, -1, -1, 390, 563, 392, - -1, -1, 566, -1, 568, -1, 570, -1, -1, 371, - -1, 704, 576, 577, -1, 579, -1, -1, -1, -1, - -1, -1, -1, 587, -1, -1, 719, 720, 721, -1, - -1, -1, -1, 107, 427, -1, -1, -1, -1, 604, - -1, -1, -1, 256, -1, -1, -1, 611, 261, -1, - -1, 413, -1, -1, -1, -1, -1, -1, 622, 624, - 753, -1, -1, -1, -1, 630, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 768, 769, -1, 771, -1, - 645, -1, -1, -1, -1, -1, -1, 300, -1, -1, - -1, -1, 305, 786, -1, -1, 661, 790, -1, 312, - 313, 666, 667, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 678, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 823, -1, 206, -1, -1, -1, -1, 830, 702, 704, - -1, 705, 707, 836, -1, 838, -1, -1, -1, -1, - -1, 544, 845, -1, 719, 720, 721, 370, -1, -1, - 724, -1, -1, 727, 728, -1, -1, -1, -1, 382, - 563, -1, -1, 737, 738, -1, -1, 390, -1, 392, - -1, 543, 256, -1, -1, -1, -1, 261, 753, -1, - -1, -1, -1, -1, -1, -1, -1, 762, -1, -1, - -1, -1, -1, 768, 769, -1, 771, -1, -1, -1, - -1, -1, -1, -1, 427, 779, 780, -1, -1, -1, - 784, -1, -1, -1, -1, 790, 300, -1, -1, -1, - -1, 305, -1, -1, 798, -1, -1, -1, 312, -1, - -1, -1, 604, -1, 808, 809, -1, -1, -1, -1, - -1, -1, 645, -1, -1, -1, -1, -1, 823, -1, - 653, -1, -1, -1, -1, 830, -1, -1, 630, -1, - -1, 836, -1, 838, -1, -1, -1, -1, -1, -1, - 845, -1, 846, 847, -1, -1, -1, -1, 852, 231, - 232, -1, -1, -1, -1, 859, 370, -1, 863, 863, - -1, 865, 866, -1, -1, -1, -1, 871, 382, -1, - -1, 704, -1, -1, -1, -1, 390, -1, 392, -1, - -1, 885, -1, -1, 888, -1, 719, 720, 721, 893, - -1, 544, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 50, 51, -1, 707, 54, -1, -1, -1, - 563, -1, -1, 427, 62, 63, 64, 65, 66, 67, - 753, 69, 70, -1, -1, 73, -1, -1, 310, 77, - 78, 79, 80, 315, -1, 768, 769, -1, 771, -1, - -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 786, -1, -1, -1, 790, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, -1, -1, - 118, 64, 65, 66, 67, 68, 69, 70, 71, 127, - 73, 74, -1, -1, -1, -1, 79, 80, -1, -1, - 823, -1, 645, 646, -1, -1, -1, 830, -1, -1, - 653, -1, -1, 836, -1, 838, -1, -1, -1, -1, - -1, 393, 845, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 405, 406, -1, -1, 409, -1, -1, - 544, 413, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 563, - -1, 704, -1, -1, -1, -1, -1, 439, 43, -1, - 442, -1, 444, -1, -1, -1, 719, 720, 721, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, -1, -1, 79, 80, -1, 479, -1, -1, - 753, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 768, 769, -1, 771, 104, - -1, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 645, -1, 786, -1, -1, -1, 790, -1, 0, - -1, 126, -1, -1, -1, -1, -1, 8, 9, 10, - -1, -1, 13, 14, 15, -1, 17, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 27, -1, -1, -1, - 823, -1, -1, -1, -1, 36, 37, 830, 39, 40, - 41, 42, 43, 836, -1, 838, -1, -1, -1, -1, - 704, -1, 845, -1, 576, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 719, 720, 721, 590, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 81, -1, -1, -1, -1, -1, 608, -1, -1, -1, - 612, -1, -1, -1, 616, -1, -1, -1, -1, 753, - -1, -1, 624, -1, 105, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 768, 769, -1, 771, -1, -1, - 121, -1, -1, 124, 125, -1, -1, 128, -1, 130, - 131, -1, -1, -1, -1, 657, 790, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 685, -1, -1, -1, -1, -1, 823, - -1, -1, -1, -1, -1, -1, 830, -1, -1, -1, - -1, -1, 836, -1, 838, -1, -1, -1, -1, -1, - -1, 845, -1, -1, -1, -1, 718, -1, -1, -1, - -1, -1, -1, 725, -1, -1, -1, -1, -1, -1, - 732, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 3, 4, 5, -1, 7, -1, -1, -1, 11, 12, - -1, -1, 754, 16, -1, 18, 19, 20, 21, 22, - 23, 24, -1, 26, -1, -1, 29, 30, 31, 32, - 33, 34, 35, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 45, -1, -1, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 797, 59, 60, -1, 62, - 63, -1, -1, -1, 806, -1, -1, -1, -1, 811, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, - -1, -1, 85, 86, -1, 88, 89, -1, 91, 92, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 848, -1, 850, -1, - -1, -1, -1, 116, 117, 118, -1, 120, -1, -1, - -1, -1, -1, -1, -1, 128, -1, -1, 870, -1, - 872, -1, -1, -1, 0, 1, -1, 3, 4, 5, - 6, 7, -1, -1, 886, 11, 12, -1, -1, 891, - 16, -1, 18, 19, 20, 21, 22, 23, 24, -1, - -1, -1, -1, 29, 30, 31, 32, 33, 34, 35, - -1, -1, 38, -1, -1, -1, -1, -1, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, -1, 62, 63, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 82, -1, -1, 85, - 86, -1, 88, 89, -1, 91, -1, 93, 94, 95, - 96, 97, 98, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, - 116, 117, 118, 8, 9, 10, -1, -1, -1, 14, - 15, -1, 17, -1, 130, 131, -1, -1, 43, -1, - -1, 26, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 36, 37, -1, 39, 40, 41, 42, 43, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, -1, -1, 79, 80, -1, -1, -1, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, -1, -1, 79, 80, 81, -1, 83, 104, - -1, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, -1, -1, -1, -1, -1, -1, -1, 103, 104, - -1, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, -1, -1, -1, 0, 120, 121, 122, -1, 124, - 125, 126, 8, 9, 10, 130, 131, -1, 14, 15, - -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 36, 37, -1, 39, 40, 41, 42, 43, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, -1, -1, 79, 80, -1, -1, -1, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, -1, -1, 79, 80, 81, -1, 83, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - -1, -1, -1, -1, -1, -1, -1, 103, 104, -1, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - -1, -1, -1, -1, -1, 121, 122, -1, 124, 125, - 126, -1, -1, -1, 130, 131, 1, -1, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, - 15, 16, -1, 18, 19, 20, 21, 22, 23, 24, - -1, -1, -1, -1, 29, 30, 31, 32, 33, 34, - 35, -1, -1, 38, -1, -1, -1, -1, -1, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, -1, 59, 60, -1, 62, 63, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, - 85, 86, -1, 88, 89, -1, 91, -1, 93, 94, - 95, 96, 97, 98, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 116, 117, 118, -1, -1, -1, -1, 1, -1, - 3, 4, 5, 6, 7, 130, 131, 10, 11, 12, - -1, 14, 15, 16, -1, 18, 19, 20, 21, 22, - 23, 24, -1, -1, -1, -1, 29, 30, 31, 32, - 33, 34, 35, -1, -1, 38, -1, -1, -1, -1, - -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, -1, 62, - 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, - -1, -1, 85, 86, -1, 88, 89, -1, 91, -1, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 116, 117, 118, -1, -1, -1, -1, - 1, -1, 3, 4, 5, 6, 7, 130, 131, 10, - 11, 12, -1, -1, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, 35, -1, -1, 38, -1, -1, - -1, -1, -1, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, - -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 82, -1, -1, 85, 86, -1, 88, 89, -1, - 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 116, 117, 118, -1, -1, - -1, -1, 1, -1, 3, 4, 5, 6, 7, 130, - 131, 10, 11, 12, -1, -1, 15, 16, -1, 18, - 19, 20, 21, 22, 23, 24, -1, -1, -1, -1, - 29, 30, 31, 32, 33, 34, 35, -1, -1, 38, - -1, -1, -1, -1, -1, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 82, -1, -1, 85, 86, -1, 88, - 89, -1, 91, -1, 93, 94, 95, 96, 97, 98, - -1, -1, -1, -1, -1, 1, -1, 3, 4, 5, - 6, 7, -1, 9, 10, 11, 12, 116, 117, 118, - 16, -1, 18, 19, 20, 21, 22, 23, 24, -1, - -1, 130, 131, 29, 30, 31, 32, 33, 34, 35, - -1, -1, 38, -1, -1, -1, -1, -1, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, -1, 62, 63, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 82, -1, -1, 85, - 86, -1, 88, 89, -1, 91, -1, 93, 94, 95, - 96, 97, 98, -1, -1, -1, -1, -1, 1, -1, - 3, 4, 5, 6, 7, -1, -1, -1, 11, 12, - 116, 117, 118, 16, -1, 18, 19, 20, 21, 22, - 23, 24, -1, -1, 130, 131, 29, 30, 31, 32, - 33, 34, 35, -1, -1, 38, -1, -1, -1, -1, - -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, -1, 62, - 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, - -1, -1, 85, 86, -1, 88, 89, -1, 91, -1, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 116, 117, 118, -1, -1, -1, -1, - -1, -1, 125, -1, -1, -1, -1, 130, 131, 1, - -1, 3, 4, 5, 6, 7, -1, -1, -1, 11, - 12, -1, -1, -1, 16, -1, 18, 19, 20, 21, - 22, 23, 24, -1, -1, -1, -1, 29, 30, 31, - 32, 33, 34, 35, -1, -1, 38, -1, -1, -1, - -1, -1, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 60, -1, - 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 82, -1, -1, 85, 86, -1, 88, 89, -1, 91, - -1, 93, 94, 95, 96, 97, 98, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 116, 117, 118, -1, -1, -1, - -1, -1, -1, 125, -1, -1, -1, -1, 130, 131, - 1, -1, 3, 4, 5, 6, 7, -1, -1, -1, - 11, 12, -1, -1, -1, 16, -1, 18, 19, 20, - 21, 22, 23, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, 35, -1, -1, 38, -1, -1, - -1, -1, -1, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, - -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 82, -1, -1, 85, 86, -1, 88, 89, -1, - 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 116, 117, 118, -1, -1, - 121, -1, 1, -1, 3, 4, 5, 6, 7, 130, - 131, 10, 11, 12, -1, -1, -1, 16, -1, 18, - 19, 20, 21, 22, 23, 24, -1, -1, -1, -1, - 29, 30, 31, 32, 33, 34, 35, -1, -1, 38, - -1, -1, -1, -1, -1, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 82, -1, -1, 85, 86, -1, 88, - 89, -1, 91, -1, 93, 94, 95, 96, 97, 98, - -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, - 6, 7, -1, -1, -1, 11, 12, 116, 117, 118, - 16, -1, 18, 19, 20, 21, 22, 23, 24, -1, - -1, 130, 131, 29, 30, 31, 32, 33, 34, 35, - -1, -1, 38, -1, -1, -1, -1, -1, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, -1, 62, 63, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 82, -1, -1, 85, - 86, -1, 88, 89, -1, 91, -1, 93, 94, 95, - 96, 97, 98, -1, -1, -1, -1, -1, -1, -1, - 3, 4, 5, -1, 7, -1, -1, -1, 11, 12, - 116, 117, 118, 16, -1, 18, 19, 20, 21, 22, - 23, 24, -1, -1, -1, 131, 29, 30, 31, 32, - 33, 34, 35, -1, -1, 38, -1, -1, -1, -1, - -1, -1, 45, -1, -1, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, -1, 62, - 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, - -1, -1, 85, 86, -1, 88, 89, -1, -1, -1, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 116, 117, 118, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 130, 131, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, -1, -1, -1, -1, -1, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, -1, -1, -1, -1, -1, -1, 62, 63, - 64, 65, 66, 67, -1, 69, 70, -1, -1, 73, - -1, -1, -1, 77, 78, 79, 80, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, -1, -1, 118, -1, -1, 3, 4, 5, - -1, 7, -1, 127, 128, 11, 12, -1, -1, -1, - 16, -1, 18, 19, 20, 21, 22, 23, 24, -1, - 26, -1, -1, 29, 30, 31, 32, 33, 34, 35, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, - -1, -1, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, -1, 62, 63, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 82, -1, -1, 85, - 86, -1, 88, 89, -1, 91, 92, 93, 94, 95, - 96, 97, 98, -1, -1, -1, -1, -1, -1, -1, - 3, 4, 5, -1, 7, -1, -1, -1, 11, 12, - 116, 117, 118, 16, 120, 18, 19, 20, 21, 22, - 23, 24, 128, 26, -1, -1, 29, 30, 31, 32, - 33, 34, 35, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 45, -1, -1, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, -1, 62, - 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, - -1, -1, 85, 86, -1, 88, 89, -1, 91, 92, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, 3, 4, 5, -1, 7, -1, -1, - -1, 11, 12, 116, 117, 118, 16, 120, 18, 19, - 20, 21, 22, 23, 24, 128, -1, -1, -1, 29, - 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 45, -1, -1, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 82, 83, -1, 85, 86, -1, 88, 89, - -1, 91, 92, 93, 94, 95, 96, 97, 98, -1, - -1, -1, -1, 103, -1, -1, 3, 4, 5, -1, - 7, -1, -1, -1, 11, 12, 116, 117, 118, 16, - -1, 18, 19, 20, 21, 22, 23, 24, 128, -1, - -1, -1, 29, 30, 31, 32, 33, 34, 35, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, - -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, -1, 59, 60, -1, 62, 63, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 82, 83, -1, 85, 86, - -1, 88, 89, -1, 91, 92, 93, 94, 95, 96, - 97, 98, -1, -1, -1, -1, 103, -1, -1, 3, - 4, 5, -1, 7, -1, -1, -1, 11, 12, 116, - 117, 118, 16, -1, 18, 19, 20, 21, 22, 23, - 24, 128, -1, -1, -1, 29, 30, 31, 32, 33, - 34, 35, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 45, -1, -1, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 60, -1, 62, 63, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, - -1, 85, 86, -1, 88, 89, -1, 91, 92, 93, - 94, 95, 96, 97, 98, -1, -1, -1, -1, -1, - -1, -1, 3, 4, 5, -1, 7, -1, -1, -1, - 11, 12, 116, 117, 118, 16, -1, 18, 19, 20, - 21, 22, 23, 24, 128, -1, -1, -1, 29, 30, - 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 45, -1, -1, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, - -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 82, -1, -1, 85, 86, -1, 88, 89, -1, - 91, 92, 93, 94, 95, 96, 97, 98, -1, -1, - -1, -1, -1, -1, -1, 3, 4, 5, -1, 7, - -1, -1, -1, 11, 12, 116, 117, 118, 16, -1, - 18, 19, 20, 21, 22, 23, 24, 128, -1, -1, - -1, 29, 30, 31, 32, 33, 34, 35, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - -1, 59, 60, -1, 62, 63, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 82, -1, -1, 85, 86, -1, - 88, 89, -1, 91, 92, 93, 94, 95, 96, 97, - 98, -1, -1, -1, -1, -1, -1, -1, 3, 4, - 5, -1, 7, -1, -1, -1, 11, 12, 116, 117, - 118, 16, -1, 18, 19, 20, 21, 22, 23, 24, - 128, -1, -1, -1, 29, 30, 31, 32, 33, 34, - 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 45, -1, -1, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, -1, 59, 60, -1, 62, 63, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, - 85, 86, -1, 88, 89, -1, 91, 92, 93, 94, - 95, 96, 97, 98, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 116, 117, 118, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 128, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - -1, -1, -1, -1, -1, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, -1, -1, -1, - -1, -1, -1, 62, 63, 64, 65, 66, 67, -1, - 69, 70, -1, -1, 73, -1, -1, -1, 77, 78, - 79, 80, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, -1, -1, 118, - -1, -1, -1, -1, -1, -1, -1, -1, 127, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, -1, -1, -1, -1, -1, - 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, - 54, -1, -1, -1, -1, -1, -1, -1, 62, 63, - 64, 65, 66, 67, -1, 69, 70, -1, -1, 73, - -1, -1, -1, 77, 78, 79, 80, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 91, -1, 93, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, -1, -1, 118, -1, -1, -1, -1, -1, - -1, -1, -1, 127, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - -1, -1, -1, -1, -1, 44, 45, 46, 47, 48, - 49, 50, 51, -1, -1, 54, -1, -1, -1, -1, - -1, -1, -1, 62, 63, 64, 65, 66, 67, -1, - 69, 70, -1, -1, 73, -1, -1, -1, 77, 78, - 79, 80, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 91, -1, 93, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, -1, -1, 118, - -1, -1, -1, -1, -1, -1, -1, -1, 127, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, -1, -1, -1, -1, -1, - 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, - 54, -1, -1, -1, -1, -1, -1, -1, 62, 63, - 64, 65, 66, 67, -1, 69, 70, -1, -1, 73, - -1, -1, -1, 77, 78, 79, 80, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, -1, -1, 118, -1, 3, 4, 5, -1, - 7, -1, -1, 127, 11, 12, -1, -1, -1, 16, - -1, 18, 19, 20, 21, 22, 23, 24, -1, -1, - -1, -1, 29, 30, 31, 32, 33, 34, 35, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, - -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, -1, 59, 60, -1, 62, 63, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 82, -1, -1, 85, 86, - -1, 88, 89, -1, 91, 92, 93, 94, 95, 96, - 97, 98, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 3, 4, 5, 6, 7, 116, - 117, 118, 11, 12, -1, -1, -1, 16, 125, 18, - 19, 20, 21, 22, 23, 24, -1, -1, -1, -1, - 29, 30, 31, 32, 33, 34, 35, -1, -1, 38, - -1, -1, -1, -1, -1, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 82, -1, -1, 85, 86, -1, 88, - 89, -1, 91, -1, 93, 94, 95, 96, 97, 98, - -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, - -1, 7, -1, -1, -1, 11, 12, 116, 117, 118, - 16, -1, 18, 19, 20, 21, 22, 23, 24, -1, - -1, -1, -1, 29, 30, 31, 32, 33, 34, 35, - -1, -1, 38, -1, -1, -1, -1, -1, -1, 45, - -1, -1, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, -1, 62, 63, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 82, -1, -1, 85, - 86, -1, 88, 89, -1, 91, 92, 93, 94, 95, - 96, 97, 98, -1, -1, -1, -1, -1, -1, -1, - 3, 4, 5, -1, 7, -1, -1, -1, 11, 12, - 116, 117, 118, 16, -1, 18, 19, 20, 21, 22, - 23, 24, -1, -1, -1, -1, 29, 30, 31, 32, - 33, 34, 35, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 45, -1, -1, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, -1, 62, - 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, - -1, -1, 85, 86, -1, 88, 89, -1, 91, 92, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, 3, 4, 5, -1, 7, -1, -1, - -1, 11, 12, 116, 117, 118, 16, -1, 18, 19, - 20, 21, 22, 23, 24, -1, -1, -1, -1, 29, - 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 45, -1, -1, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 82, -1, -1, 85, 86, -1, 88, 89, - -1, 91, 92, 93, 94, 95, 96, 97, 98, -1, - -1, -1, -1, -1, -1, -1, 3, 4, 5, -1, - 7, -1, -1, -1, 11, 12, 116, 117, 118, 16, - -1, 18, 19, 20, 21, 22, 23, 24, -1, -1, - -1, -1, 29, 30, 31, 32, 33, 34, 35, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, - -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, -1, 59, 60, -1, 62, 63, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 82, -1, -1, 85, 86, - -1, 88, 89, -1, 91, 92, 93, 94, 95, 96, - 97, 98, -1, -1, -1, -1, -1, -1, -1, 3, - 4, 5, -1, 7, -1, -1, -1, 11, 12, 116, - 117, 118, 16, -1, 18, 19, 20, 21, 22, 23, - 24, -1, -1, -1, -1, 29, 30, 31, 32, 33, - 34, 35, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 45, -1, -1, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 60, -1, 62, 63, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, - -1, 85, 86, -1, 88, 89, -1, 91, 92, 93, - 94, 95, 96, 97, 98, -1, -1, -1, -1, -1, - -1, -1, 3, 4, 5, -1, 7, -1, -1, -1, - 11, 12, 116, 117, 118, 16, -1, 18, 19, 20, - 21, 22, 23, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 45, -1, -1, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, - -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 82, -1, -1, 85, 86, -1, 88, 89, -1, - 91, 92, 93, 94, 95, 96, 97, 98, -1, -1, - -1, -1, -1, -1, -1, 3, 4, 5, -1, 7, - -1, -1, -1, 11, 12, 116, 117, 118, 16, -1, - 18, 19, 20, 21, 22, 23, 24, -1, -1, -1, - -1, 29, 30, 31, 32, 33, 34, 35, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - -1, 59, 60, -1, 62, 63, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 82, -1, -1, 85, 86, -1, - 88, 89, -1, 91, 92, 93, 94, 95, 96, 97, - 98, -1, -1, -1, -1, -1, -1, -1, 3, 4, - 5, -1, 7, -1, -1, -1, 11, 12, 116, 117, - 118, 16, -1, 18, 19, 20, 21, 22, 23, 24, - -1, -1, -1, -1, 29, 30, 31, 32, 33, 34, - 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 45, -1, -1, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, -1, 59, 60, -1, 62, 63, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, - 85, 86, -1, 88, 89, -1, 91, 92, 93, 94, - 95, 96, 97, 98, -1, -1, -1, -1, -1, -1, - -1, 3, 4, 5, -1, 7, -1, -1, -1, 11, - 12, 116, 117, 118, 16, -1, 18, 19, 20, 21, - 22, 23, 24, -1, -1, -1, -1, 29, 30, 31, - 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 45, -1, -1, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 60, -1, - 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 82, -1, -1, 85, 86, -1, 88, 89, -1, 91, - 92, 93, 94, 95, 96, 97, 98, -1, -1, -1, - -1, -1, -1, -1, 3, 4, 5, -1, 7, -1, - -1, -1, 11, 12, 116, 117, 118, 16, -1, 18, - 19, 20, 21, 22, 23, 24, -1, -1, -1, -1, - 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 45, -1, -1, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 82, -1, -1, 85, 86, -1, 88, - 89, -1, 91, 92, 93, 94, 95, 96, 97, 98, - -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, - -1, 7, -1, -1, -1, 11, 12, 116, 117, 118, - 16, -1, 18, 19, 20, 21, 22, 23, 24, -1, - -1, -1, -1, 29, 30, 31, 32, 33, 34, 35, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, - -1, -1, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, -1, 62, 63, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 82, -1, -1, 85, - 86, -1, 88, 89, -1, 91, 92, 93, 94, 95, - 96, 97, 98, -1, -1, -1, -1, -1, -1, -1, - 3, 4, 5, -1, 7, -1, -1, -1, 11, 12, - 116, 117, 118, 16, -1, 18, 19, 20, 21, 22, - 23, 24, -1, -1, -1, -1, 29, 30, 31, 32, - 33, 34, 35, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 45, -1, -1, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, -1, 62, - 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, - -1, -1, 85, 86, -1, 88, 89, -1, 91, 92, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, 3, 4, 5, -1, 7, -1, -1, - -1, 11, 12, 116, 117, 118, 16, -1, 18, 19, - 20, 21, 22, 23, 24, -1, -1, -1, -1, 29, - 30, 31, 32, 33, 34, 35, -1, -1, 38, -1, - -1, -1, -1, -1, -1, 45, -1, -1, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 60, -1, 62, 63, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 82, -1, -1, 85, 86, -1, 88, 89, - -1, -1, -1, 93, 94, 95, 96, 97, 98, -1, - -1, -1, -1, -1, -1, -1, 3, 4, 5, -1, - 7, -1, -1, -1, 11, 12, 116, 117, 118, 16, - -1, 18, 19, 20, 21, 22, 23, 24, -1, -1, - -1, -1, 29, 30, 31, 32, 33, 34, 35, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, - -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, -1, 59, 60, -1, 62, 63, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 82, -1, -1, 85, 86, - -1, 88, 89, -1, 91, -1, 93, 94, 95, 96, - 97, 98, -1, -1, -1, -1, -1, -1, -1, 3, - 4, 5, -1, 7, -1, -1, -1, 11, 12, 116, - 117, 118, 16, -1, 18, 19, 20, 21, 22, 23, - 24, -1, -1, -1, -1, 29, 30, 31, 32, 33, - 34, 35, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 45, -1, -1, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 60, -1, 62, 63, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, - -1, 85, 86, -1, 88, 89, -1, 91, -1, 93, - 94, 95, 96, 97, 98, -1, -1, -1, -1, -1, - -1, -1, 3, 4, 5, -1, 7, -1, -1, -1, - 11, 12, 116, 117, 118, 16, -1, 18, 19, 20, - 21, 22, 23, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 45, -1, -1, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, - -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 82, -1, -1, 85, 86, -1, 88, 89, -1, - 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, - -1, -1, -1, -1, -1, 3, 4, 5, -1, 7, - -1, -1, -1, 11, 12, 116, 117, 118, 16, -1, - 18, 19, 20, 21, 22, 23, 24, -1, -1, -1, - -1, 29, 30, 31, 32, 33, 34, 35, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - -1, 59, 60, -1, 62, 63, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 82, -1, -1, 85, 86, -1, - 88, 89, -1, 91, -1, 93, 94, 95, 96, 97, - 98, -1, -1, -1, -1, -1, -1, -1, 3, 4, - 5, -1, 7, -1, -1, -1, 11, 12, 116, 117, - 118, 16, -1, 18, 19, 20, 21, 22, 23, 24, - -1, -1, -1, -1, 29, 30, 31, 32, 33, 34, - 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 45, -1, -1, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, -1, 59, 60, -1, 62, 63, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, - 85, 86, -1, 88, 89, -1, 91, -1, 93, 94, - 95, 96, 97, 98, -1, -1, -1, -1, -1, -1, - -1, 3, 4, 5, -1, 7, -1, -1, -1, 11, - 12, 116, 117, 118, 16, -1, 18, 19, 20, 21, - 22, 23, 24, -1, -1, -1, -1, 29, 30, 31, - 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 45, -1, -1, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 60, -1, - 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 82, -1, -1, 85, 86, -1, 88, 89, -1, 91, - -1, 93, 94, 95, 96, 97, 98, -1, -1, -1, - -1, -1, -1, -1, 3, 4, 5, -1, 7, -1, - -1, -1, 11, 12, 116, 117, 118, 16, -1, 18, - 19, 20, 21, 22, 23, 24, -1, -1, -1, -1, - 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 45, -1, -1, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 82, -1, -1, 85, 86, -1, 88, - 89, -1, 91, -1, 93, 94, 95, 96, 97, 98, - -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, - -1, 7, -1, -1, -1, 11, 12, 116, 117, 118, - 16, -1, 18, 19, 20, 21, 22, 23, 24, -1, - -1, -1, -1, 29, 30, 31, 32, 33, 34, 35, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, - -1, -1, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, -1, 62, 63, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 82, -1, -1, 85, - 86, -1, 88, 89, -1, -1, -1, 93, 94, 95, - 96, 97, 98, -1, -1, -1, -1, -1, -1, -1, - 3, 4, 5, -1, 7, -1, -1, -1, 11, 12, - 116, 117, 118, 16, -1, 18, 19, 20, 21, 22, - 23, 24, -1, -1, -1, -1, 29, 30, 31, 32, - 33, 34, 35, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 45, -1, -1, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, -1, 62, - 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, - -1, -1, 85, 86, -1, 88, 89, -1, -1, -1, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, 3, 4, 5, -1, 7, -1, -1, - -1, 11, 12, 116, 117, 118, 16, -1, 18, 19, - 20, 21, 22, 23, 24, -1, -1, -1, -1, 29, - 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 45, -1, -1, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 60, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 82, -1, -1, 85, 86, -1, 88, 89, - -1, 91, -1, 93, 94, 95, 96, 97, 98, -1, - -1, -1, 3, 4, 5, -1, 7, -1, 108, -1, - 11, 12, -1, -1, -1, 16, 116, 18, 19, 20, - 21, 22, 23, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 45, -1, -1, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 79, -1, - -1, 82, -1, -1, 85, 86, -1, 88, 89, -1, - -1, -1, 93, 94, 95, 96, 97, 98, -1, -1, - -1, 3, 4, 5, -1, 7, -1, -1, -1, 11, - 12, -1, -1, -1, 16, 116, 18, 19, 20, 21, - 22, 23, 24, -1, -1, -1, -1, 29, 30, 31, - 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 45, -1, -1, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 60, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 82, -1, -1, 85, 86, -1, 88, 89, -1, 91, - -1, 93, 94, 95, 96, 97, 98, -1, -1, -1, - 3, 4, 5, -1, 7, -1, -1, -1, 11, 12, - -1, -1, -1, 16, 116, 18, 19, 20, 21, 22, - 23, 24, -1, -1, -1, -1, 29, 30, 31, 32, - 33, 34, 35, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 45, -1, -1, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, - -1, -1, 85, 86, -1, 88, 89, -1, 91, -1, - 93, 94, 95, 96, 97, 98, -1, -1, -1, 3, - 4, 5, -1, 7, -1, -1, -1, 11, 12, -1, - -1, -1, 16, 116, 18, 19, 20, 21, 22, 23, - 24, -1, -1, -1, -1, 29, 30, 31, 32, 33, - 34, 35, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 45, -1, -1, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 60, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, - -1, 85, 86, -1, 88, 89, -1, -1, -1, 93, - 94, 95, 96, 97, 98, -1, -1, -1, 3, 4, - 5, -1, 7, -1, -1, -1, 11, 12, -1, -1, - -1, 16, 116, 18, 19, 20, 21, 22, 23, 24, - -1, -1, -1, -1, 29, 30, 31, 32, 33, 34, - 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 45, -1, -1, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, -1, 59, 60, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, - 85, 86, -1, 88, 89, -1, -1, -1, 93, 94, - 95, 96, 97, 98, -1, -1, -1, 3, 4, 5, - -1, 7, -1, -1, -1, 11, 12, -1, -1, -1, - 16, 116, 18, 19, 20, 21, 22, 23, 24, -1, - -1, -1, -1, 29, 30, 31, 32, 33, 34, 35, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, - -1, -1, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 82, -1, -1, 85, - 86, -1, 88, 89, -1, -1, -1, 93, 94, 95, - 96, 97, 98, -1, -1, -1, -1, -1, -1, 50, - 51, -1, -1, 54, -1, -1, -1, -1, -1, -1, - 116, 62, 63, 64, 65, 66, 67, -1, 69, 70, - -1, -1, 73, -1, -1, -1, 77, 78, 79, 80, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 50, 51, 118, -1, 54, - -1, -1, -1, -1, -1, -1, 127, 62, 63, 64, - 65, 66, 67, -1, 69, 70, -1, -1, 73, -1, - -1, -1, 77, 78, 79, 80, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 50, 51, 118, -1, 54, -1, -1, -1, -1, - -1, -1, 127, 62, 63, 64, 65, 66, 67, -1, - 69, 70, -1, -1, 73, -1, -1, -1, 77, 78, - 79, 80, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 50, 51, 118, - -1, 54, -1, -1, -1, -1, -1, -1, 127, 62, - 63, 64, 65, 66, 67, -1, 69, 70, -1, -1, - 73, -1, -1, -1, 77, 78, 79, 80, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 50, 51, 118, -1, 54, -1, -1, - -1, -1, -1, -1, 127, 62, 63, 64, 65, 66, - 67, -1, 69, 70, -1, -1, 73, -1, -1, -1, - 77, 78, 79, 80, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 50, - 51, 118, -1, 54, -1, -1, -1, -1, -1, -1, - 127, 62, 63, 64, 65, 66, 67, -1, 69, 70, - -1, -1, 73, -1, -1, -1, 77, 78, 79, 80, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 50, 51, 118, -1, 54, - -1, -1, -1, -1, -1, -1, 127, 62, 63, 64, - 65, 66, 67, -1, 69, 70, -1, -1, 73, -1, - -1, -1, 77, 78, 79, 80, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 50, 51, 118, -1, 54, -1, -1, -1, -1, - -1, -1, 127, 62, 63, 64, 65, 66, 67, -1, - 69, 70, -1, -1, 73, -1, -1, -1, 77, 78, - 79, 80, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 50, 51, 118, - -1, 54, -1, -1, -1, -1, -1, -1, 127, 62, - 63, 64, 65, 66, 67, -1, 69, 70, -1, -1, - 73, -1, -1, -1, 77, 78, 79, 80, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 50, 51, 118, -1, 54, -1, -1, - -1, -1, -1, -1, 127, 62, 63, 64, 65, 66, - 67, -1, 69, 70, -1, -1, 73, -1, -1, -1, - 77, 78, 79, 80, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 50, - 51, 118, -1, 54, -1, -1, -1, -1, -1, -1, - 127, 62, 63, 64, 65, 66, 67, -1, 69, 70, - -1, -1, 73, -1, -1, -1, 77, 78, 79, 80, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, -1, -1, 118, -1, -1, - -1, -1, -1, -1, -1, -1, 127, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - -1, -1, 79, 80, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 104, -1, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, -1, 130, 79, 80, -1, -1, -1, 84, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, -1, -1, 79, 80, -1, -1, 104, - -1, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 104, 126, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 126, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, -1, -1, 79, 80, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, -1, -1, 79, 80, -1, -1, -1, - -1, -1, -1, 104, -1, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, -1, -1, -1, -1, -1, - -1, -1, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 64, 65, 66, 67, 68, 69, 70, -1, - -1, 73, 74, -1, -1, -1, -1, 79, 80, 64, - 65, 66, 67, 68, 69, 70, -1, -1, 73, 74, - -1, -1, -1, -1, 79, 80, -1, -1, -1, -1, - -1, -1, -1, -1, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, -1, -1, -1, -1, -1, -1, - -1, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint16 yystos[] = -{ - 0, 133, 134, 0, 1, 3, 4, 5, 6, 7, - 11, 12, 16, 18, 19, 20, 21, 22, 23, 24, - 29, 30, 31, 32, 33, 34, 35, 38, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 59, 60, 62, 63, 82, 85, 86, 88, - 89, 91, 93, 94, 95, 96, 97, 98, 116, 117, - 118, 136, 137, 138, 141, 143, 144, 148, 149, 151, - 152, 153, 154, 155, 165, 182, 199, 209, 210, 223, - 224, 225, 226, 227, 228, 229, 232, 240, 242, 243, - 244, 245, 246, 247, 266, 275, 138, 21, 22, 29, - 30, 31, 45, 50, 54, 79, 82, 85, 116, 156, - 157, 182, 199, 244, 247, 266, 157, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 44, 45, 46, 47, 48, 49, 50, 51, 54, - 62, 63, 64, 65, 66, 67, 69, 70, 73, 77, - 78, 79, 80, 91, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 118, 127, 128, 158, 163, 164, - 245, 261, 32, 33, 34, 35, 48, 49, 50, 54, - 158, 159, 160, 161, 240, 242, 183, 82, 141, 142, - 155, 199, 244, 246, 247, 142, 130, 131, 142, 270, - 273, 274, 186, 188, 82, 149, 155, 199, 204, 244, - 247, 91, 92, 117, 148, 165, 167, 171, 178, 180, - 264, 265, 171, 171, 128, 173, 174, 128, 169, 173, - 141, 52, 160, 130, 271, 140, 120, 165, 199, 165, - 54, 85, 136, 150, 151, 141, 91, 148, 168, 180, - 264, 275, 180, 263, 264, 275, 82, 154, 199, 244, - 247, 52, 53, 55, 158, 235, 241, 234, 235, 235, - 129, 230, 129, 233, 56, 57, 143, 165, 165, 270, - 274, 39, 40, 41, 42, 43, 36, 37, 28, 206, - 103, 126, 85, 91, 152, 103, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 79, - 80, 104, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 81, 122, 124, 81, 124, 26, 120, 211, - 226, 83, 83, 169, 173, 211, 271, 141, 50, 54, - 156, 56, 57, 1, 107, 248, 273, 81, 122, 124, - 195, 262, 196, 81, 124, 269, 126, 135, 136, 54, - 13, 105, 200, 273, 103, 81, 122, 124, 83, 83, - 200, 270, 15, 17, 216, 131, 142, 142, 54, 81, - 122, 124, 25, 167, 167, 84, 126, 179, 275, 126, - 179, 125, 171, 86, 171, 175, 148, 171, 180, 209, - 275, 52, 59, 60, 139, 128, 166, 120, 136, 81, - 124, 83, 150, 125, 125, 184, 165, 271, 123, 126, - 130, 272, 126, 272, 126, 272, 121, 272, 54, 81, - 122, 124, 58, 99, 100, 101, 236, 101, 236, 101, - 61, 101, 101, 231, 236, 101, 58, 101, 64, 64, - 138, 142, 142, 142, 142, 138, 141, 141, 207, 91, - 143, 167, 180, 181, 150, 154, 126, 143, 165, 167, - 181, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 50, 51, 54, - 163, 267, 268, 168, 50, 51, 54, 163, 267, 50, - 54, 267, 267, 214, 212, 143, 165, 143, 165, 90, - 145, 193, 273, 249, 192, 50, 54, 156, 267, 168, - 267, 135, 141, 50, 52, 53, 54, 55, 91, 92, - 110, 113, 128, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 197, 162, 10, 8, 219, 275, 136, - 13, 165, 50, 54, 168, 50, 54, 136, 216, 136, - 91, 180, 217, 10, 27, 105, 201, 273, 201, 50, - 54, 168, 50, 54, 190, 126, 179, 167, 91, 167, - 178, 264, 91, 167, 265, 125, 91, 165, 167, 172, - 176, 178, 264, 271, 126, 81, 124, 271, 125, 160, - 185, 165, 136, 121, 165, 125, 271, 271, 91, 167, - 50, 54, 168, 50, 54, 238, 237, 129, 236, 129, - 165, 165, 72, 108, 205, 275, 167, 126, 125, 43, - 105, 83, 83, 169, 173, 123, 83, 83, 169, 170, - 173, 275, 170, 173, 170, 173, 205, 205, 146, 273, - 142, 135, 123, 10, 271, 103, 251, 135, 273, 126, - 260, 275, 126, 260, 50, 126, 260, 50, 158, 160, - 167, 181, 220, 275, 15, 203, 275, 14, 202, 203, - 83, 123, 83, 83, 203, 10, 10, 167, 126, 200, - 187, 189, 123, 142, 167, 126, 179, 167, 167, 126, - 177, 125, 126, 179, 125, 148, 209, 267, 267, 125, - 141, 121, 125, 165, 123, 136, 52, 53, 55, 239, - 247, 108, 204, 208, 91, 167, 165, 165, 143, 165, - 165, 145, 83, 143, 165, 143, 165, 145, 215, 213, - 205, 194, 273, 10, 125, 167, 271, 10, 252, 255, - 257, 259, 50, 254, 257, 198, 84, 221, 275, 136, - 9, 222, 275, 142, 10, 83, 10, 91, 136, 136, - 136, 201, 179, 91, 179, 179, 91, 178, 180, 264, - 125, 91, 271, 125, 271, 121, 108, 136, 167, 143, - 165, 136, 136, 147, 135, 125, 126, 260, 260, 260, - 250, 82, 155, 199, 244, 247, 200, 136, 200, 167, - 203, 216, 218, 10, 10, 191, 165, 167, 126, 179, - 126, 179, 167, 125, 10, 10, 121, 136, 10, 257, - 135, 54, 81, 122, 124, 136, 136, 136, 179, 179, - 91, 264, 91, 179, 121, 260, 10, 50, 54, 168, - 50, 54, 219, 202, 10, 167, 126, 179, 167, 123, - 179, 91, 179, 167, 179 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 350 "parse.y" - { - lex_state = EXPR_BEG; - top_local_init(); - if (ruby_class == rb_cObject) class_nest = 0; - else class_nest = 1; - } - break; - - case 3: -#line 357 "parse.y" - { - if ((yyvsp[(2) - (2)].node) && !compile_for_eval) { - /* last expression should not be void */ - if (nd_type((yyvsp[(2) - (2)].node)) != NODE_BLOCK) void_expr((yyvsp[(2) - (2)].node)); - else { - NODE *node = (yyvsp[(2) - (2)].node); - while (node->nd_next) { - node = node->nd_next; - } - void_expr(node->nd_head); - } - } - ruby_eval_tree = block_append(ruby_eval_tree, (yyvsp[(2) - (2)].node)); - top_local_setup(); - class_nest = 0; - } - break; - - case 4: -#line 379 "parse.y" - { - (yyval.node) = (yyvsp[(1) - (4)].node); - if ((yyvsp[(2) - (4)].node)) { - (yyval.node) = NEW_RESCUE((yyvsp[(1) - (4)].node), (yyvsp[(2) - (4)].node), (yyvsp[(3) - (4)].node)); - } - else if ((yyvsp[(3) - (4)].node)) { - rb_warn("else without rescue is useless"); - (yyval.node) = block_append((yyval.node), (yyvsp[(3) - (4)].node)); - } - if ((yyvsp[(4) - (4)].node)) { - (yyval.node) = NEW_ENSURE((yyval.node), (yyvsp[(4) - (4)].node)); - } - fixpos((yyval.node), (yyvsp[(1) - (4)].node)); - } - break; - - case 5: -#line 396 "parse.y" - { - void_stmts((yyvsp[(1) - (2)].node)); - fixup_nodes(&deferred_nodes); - (yyval.node) = (yyvsp[(1) - (2)].node); - } - break; - - case 7: -#line 405 "parse.y" - { - (yyval.node) = newline_node((yyvsp[(1) - (1)].node)); - } - break; - - case 8: -#line 409 "parse.y" - { - (yyval.node) = block_append((yyvsp[(1) - (3)].node), newline_node((yyvsp[(3) - (3)].node))); - } - break; - - case 9: -#line 413 "parse.y" - { - (yyval.node) = remove_begin((yyvsp[(2) - (2)].node)); - } - break; - - case 10: -#line 418 "parse.y" - {lex_state = EXPR_FNAME;} - break; - - case 11: -#line 419 "parse.y" - { - (yyval.node) = NEW_ALIAS((yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].node)); - } - break; - - case 12: -#line 423 "parse.y" - { - (yyval.node) = NEW_VALIAS((yyvsp[(2) - (3)].id), (yyvsp[(3) - (3)].id)); - } - break; - - case 13: -#line 427 "parse.y" - { - char buf[3]; - - sprintf(buf, "$%c", (char)(yyvsp[(3) - (3)].node)->nd_nth); - (yyval.node) = NEW_VALIAS((yyvsp[(2) - (3)].id), rb_intern(buf)); - } - break; - - case 14: -#line 434 "parse.y" - { - yyerror("can't make alias for the number variables"); - (yyval.node) = 0; - } - break; - - case 15: -#line 439 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (2)].node); - } - break; - - case 16: -#line 443 "parse.y" - { - (yyval.node) = NEW_IF(cond((yyvsp[(3) - (3)].node)), remove_begin((yyvsp[(1) - (3)].node)), 0); - fixpos((yyval.node), (yyvsp[(3) - (3)].node)); - if (cond_negative(&(yyval.node)->nd_cond)) { - (yyval.node)->nd_else = (yyval.node)->nd_body; - (yyval.node)->nd_body = 0; - } - } - break; - - case 17: -#line 452 "parse.y" - { - (yyval.node) = NEW_UNLESS(cond((yyvsp[(3) - (3)].node)), remove_begin((yyvsp[(1) - (3)].node)), 0); - fixpos((yyval.node), (yyvsp[(3) - (3)].node)); - if (cond_negative(&(yyval.node)->nd_cond)) { - (yyval.node)->nd_body = (yyval.node)->nd_else; - (yyval.node)->nd_else = 0; - } - } - break; - - case 18: -#line 461 "parse.y" - { - if ((yyvsp[(1) - (3)].node) && nd_type((yyvsp[(1) - (3)].node)) == NODE_BEGIN) { - (yyval.node) = NEW_WHILE(cond((yyvsp[(3) - (3)].node)), (yyvsp[(1) - (3)].node)->nd_body, 0); - } - else { - (yyval.node) = NEW_WHILE(cond((yyvsp[(3) - (3)].node)), (yyvsp[(1) - (3)].node), 1); - } - if (cond_negative(&(yyval.node)->nd_cond)) { - nd_set_type((yyval.node), NODE_UNTIL); - } - } - break; - - case 19: -#line 473 "parse.y" - { - if ((yyvsp[(1) - (3)].node) && nd_type((yyvsp[(1) - (3)].node)) == NODE_BEGIN) { - (yyval.node) = NEW_UNTIL(cond((yyvsp[(3) - (3)].node)), (yyvsp[(1) - (3)].node)->nd_body, 0); - } - else { - (yyval.node) = NEW_UNTIL(cond((yyvsp[(3) - (3)].node)), (yyvsp[(1) - (3)].node), 1); - } - if (cond_negative(&(yyval.node)->nd_cond)) { - nd_set_type((yyval.node), NODE_WHILE); - } - } - break; - - case 20: -#line 485 "parse.y" - { - NODE *resq = NEW_RESBODY(0, remove_begin((yyvsp[(3) - (3)].node)), 0); - (yyval.node) = NEW_RESCUE(remove_begin((yyvsp[(1) - (3)].node)), resq, 0); - } - break; - - case 21: -#line 490 "parse.y" - { - if (in_def || in_single) { - yyerror("BEGIN in method"); - } - local_push(0); - } - break; - - case 22: -#line 497 "parse.y" - { - ruby_eval_tree_begin = block_append(ruby_eval_tree_begin, - NEW_PREEXE((yyvsp[(4) - (5)].node))); - local_pop(); - (yyval.node) = 0; - } - break; - - case 23: -#line 504 "parse.y" - { - if (in_def || in_single) { - rb_warn("END in method; use at_exit"); - } - - (yyval.node) = NEW_ITER(0, NEW_POSTEXE(), (yyvsp[(3) - (4)].node)); - } - break; - - case 24: -#line 512 "parse.y" - { - (yyval.node) = node_assign((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 25: -#line 516 "parse.y" - { - value_expr((yyvsp[(3) - (3)].node)); - (yyvsp[(1) - (3)].node)->nd_value = ((yyvsp[(1) - (3)].node)->nd_head) ? NEW_TO_ARY((yyvsp[(3) - (3)].node)) : NEW_ARRAY((yyvsp[(3) - (3)].node)); - (yyval.node) = (yyvsp[(1) - (3)].node); - } - break; - - case 26: -#line 522 "parse.y" - { - value_expr((yyvsp[(3) - (3)].node)); - if ((yyvsp[(1) - (3)].node)) { - ID vid = (yyvsp[(1) - (3)].node)->nd_vid; - if ((yyvsp[(2) - (3)].id) == tOROP) { - (yyvsp[(1) - (3)].node)->nd_value = (yyvsp[(3) - (3)].node); - (yyval.node) = NEW_OP_ASGN_OR(gettable(vid), (yyvsp[(1) - (3)].node)); - if (is_asgn_or_id(vid)) { - (yyval.node)->nd_aid = vid; - } - } - else if ((yyvsp[(2) - (3)].id) == tANDOP) { - (yyvsp[(1) - (3)].node)->nd_value = (yyvsp[(3) - (3)].node); - (yyval.node) = NEW_OP_ASGN_AND(gettable(vid), (yyvsp[(1) - (3)].node)); - } - else { - (yyval.node) = (yyvsp[(1) - (3)].node); - (yyval.node)->nd_value = call_op(gettable(vid),(yyvsp[(2) - (3)].id),1,(yyvsp[(3) - (3)].node)); - } - } - else { - (yyval.node) = 0; - } - } - break; - - case 27: -#line 547 "parse.y" - { - NODE *args; - - value_expr((yyvsp[(6) - (6)].node)); - if (!(yyvsp[(3) - (6)].node)) (yyvsp[(3) - (6)].node) = NEW_ZARRAY(); - args = arg_concat((yyvsp[(6) - (6)].node), (yyvsp[(3) - (6)].node)); - if ((yyvsp[(5) - (6)].id) == tOROP) { - (yyvsp[(5) - (6)].id) = 0; - } - else if ((yyvsp[(5) - (6)].id) == tANDOP) { - (yyvsp[(5) - (6)].id) = 1; - } - (yyval.node) = NEW_OP_ASGN1((yyvsp[(1) - (6)].node), (yyvsp[(5) - (6)].id), args); - fixpos((yyval.node), (yyvsp[(1) - (6)].node)); - } - break; - - case 28: -#line 563 "parse.y" - { - value_expr((yyvsp[(5) - (5)].node)); - if ((yyvsp[(4) - (5)].id) == tOROP) { - (yyvsp[(4) - (5)].id) = 0; - } - else if ((yyvsp[(4) - (5)].id) == tANDOP) { - (yyvsp[(4) - (5)].id) = 1; - } - (yyval.node) = NEW_OP_ASGN2((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].id), (yyvsp[(5) - (5)].node)); - fixpos((yyval.node), (yyvsp[(1) - (5)].node)); - } - break; - - case 29: -#line 575 "parse.y" - { - value_expr((yyvsp[(5) - (5)].node)); - if ((yyvsp[(4) - (5)].id) == tOROP) { - (yyvsp[(4) - (5)].id) = 0; - } - else if ((yyvsp[(4) - (5)].id) == tANDOP) { - (yyvsp[(4) - (5)].id) = 1; - } - (yyval.node) = NEW_OP_ASGN2((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].id), (yyvsp[(5) - (5)].node)); - fixpos((yyval.node), (yyvsp[(1) - (5)].node)); - } - break; - - case 30: -#line 587 "parse.y" - { - value_expr((yyvsp[(5) - (5)].node)); - if ((yyvsp[(4) - (5)].id) == tOROP) { - (yyvsp[(4) - (5)].id) = 0; - } - else if ((yyvsp[(4) - (5)].id) == tANDOP) { - (yyvsp[(4) - (5)].id) = 1; - } - (yyval.node) = NEW_OP_ASGN2((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].id), (yyvsp[(5) - (5)].node)); - fixpos((yyval.node), (yyvsp[(1) - (5)].node)); - } - break; - - case 31: -#line 599 "parse.y" - { - rb_backref_error((yyvsp[(1) - (3)].node)); - (yyval.node) = 0; - } - break; - - case 32: -#line 604 "parse.y" - { - (yyval.node) = node_assign((yyvsp[(1) - (3)].node), NEW_SVALUE((yyvsp[(3) - (3)].node))); - } - break; - - case 33: -#line 608 "parse.y" - { - (yyvsp[(1) - (3)].node)->nd_value = ((yyvsp[(1) - (3)].node)->nd_head) ? NEW_TO_ARY((yyvsp[(3) - (3)].node)) : NEW_ARRAY((yyvsp[(3) - (3)].node)); - (yyval.node) = (yyvsp[(1) - (3)].node); - } - break; - - case 34: -#line 613 "parse.y" - { - (yyvsp[(1) - (3)].node)->nd_value = (yyvsp[(3) - (3)].node); - (yyval.node) = (yyvsp[(1) - (3)].node); - } - break; - - case 37: -#line 622 "parse.y" - { - (yyval.node) = logop(NODE_AND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 38: -#line 626 "parse.y" - { - (yyval.node) = logop(NODE_OR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 39: -#line 630 "parse.y" - { - (yyval.node) = NEW_NOT(cond((yyvsp[(2) - (2)].node))); - } - break; - - case 40: -#line 634 "parse.y" - { - (yyval.node) = NEW_NOT(cond((yyvsp[(2) - (2)].node))); - } - break; - - case 42: -#line 641 "parse.y" - { - value_expr((yyval.node)); - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 45: -#line 650 "parse.y" - { - (yyval.node) = NEW_RETURN(ret_args((yyvsp[(2) - (2)].node))); - } - break; - - case 46: -#line 654 "parse.y" - { - (yyval.node) = NEW_BREAK(ret_args((yyvsp[(2) - (2)].node))); - } - break; - - case 47: -#line 658 "parse.y" - { - (yyval.node) = NEW_NEXT(ret_args((yyvsp[(2) - (2)].node))); - } - break; - - case 49: -#line 665 "parse.y" - { - (yyval.node) = new_call((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].id), (yyvsp[(4) - (4)].node)); - } - break; - - case 50: -#line 669 "parse.y" - { - (yyval.node) = new_call((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].id), (yyvsp[(4) - (4)].node)); - } - break; - - case 51: -#line 675 "parse.y" - { - (yyval.vars) = dyna_push(); - (yyvsp[(1) - (1)].num) = ruby_sourceline; - } - break; - - case 52: -#line 679 "parse.y" - {(yyval.vars) = ruby_dyna_vars;} - break; - - case 53: -#line 682 "parse.y" - { - (yyval.node) = NEW_ITER((yyvsp[(3) - (6)].node), 0, dyna_init((yyvsp[(5) - (6)].node), (yyvsp[(4) - (6)].vars))); - nd_set_line((yyval.node), (yyvsp[(1) - (6)].num)); - dyna_pop((yyvsp[(2) - (6)].vars)); - } - break; - - case 54: -#line 690 "parse.y" - { - (yyval.node) = new_fcall((yyvsp[(1) - (2)].id), (yyvsp[(2) - (2)].node)); - fixpos((yyval.node), (yyvsp[(2) - (2)].node)); - } - break; - - case 55: -#line 695 "parse.y" - { - (yyval.node) = new_fcall((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].node)); - if ((yyvsp[(3) - (3)].node)) { - if (nd_type((yyval.node)) == NODE_BLOCK_PASS) { - rb_compile_error("both block arg and actual block given"); - } - (yyvsp[(3) - (3)].node)->nd_iter = (yyval.node); - (yyval.node) = (yyvsp[(3) - (3)].node); - } - fixpos((yyval.node), (yyvsp[(2) - (3)].node)); - } - break; - - case 56: -#line 707 "parse.y" - { - (yyval.node) = new_call((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].id), (yyvsp[(4) - (4)].node)); - fixpos((yyval.node), (yyvsp[(1) - (4)].node)); - } - break; - - case 57: -#line 712 "parse.y" - { - (yyval.node) = new_call((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].node)); - if ((yyvsp[(5) - (5)].node)) { - if (nd_type((yyval.node)) == NODE_BLOCK_PASS) { - rb_compile_error("both block arg and actual block given"); - } - (yyvsp[(5) - (5)].node)->nd_iter = (yyval.node); - (yyval.node) = (yyvsp[(5) - (5)].node); - } - fixpos((yyval.node), (yyvsp[(1) - (5)].node)); - } - break; - - case 58: -#line 724 "parse.y" - { - (yyval.node) = new_call((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].id), (yyvsp[(4) - (4)].node)); - fixpos((yyval.node), (yyvsp[(1) - (4)].node)); - } - break; - - case 59: -#line 729 "parse.y" - { - (yyval.node) = new_call((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].node)); - if ((yyvsp[(5) - (5)].node)) { - if (nd_type((yyval.node)) == NODE_BLOCK_PASS) { - rb_compile_error("both block arg and actual block given"); - } - (yyvsp[(5) - (5)].node)->nd_iter = (yyval.node); - (yyval.node) = (yyvsp[(5) - (5)].node); - } - fixpos((yyval.node), (yyvsp[(1) - (5)].node)); - } - break; - - case 60: -#line 741 "parse.y" - { - (yyval.node) = new_super((yyvsp[(2) - (2)].node)); - fixpos((yyval.node), (yyvsp[(2) - (2)].node)); - } - break; - - case 61: -#line 746 "parse.y" - { - (yyval.node) = new_yield((yyvsp[(2) - (2)].node)); - fixpos((yyval.node), (yyvsp[(2) - (2)].node)); - } - break; - - case 63: -#line 754 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (3)].node); - } - break; - - case 65: -#line 761 "parse.y" - { - (yyval.node) = NEW_MASGN(NEW_LIST((yyvsp[(2) - (3)].node)), 0); - } - break; - - case 66: -#line 767 "parse.y" - { - (yyval.node) = NEW_MASGN((yyvsp[(1) - (1)].node), 0); - } - break; - - case 67: -#line 771 "parse.y" - { - (yyval.node) = NEW_MASGN(list_append((yyvsp[(1) - (2)].node),(yyvsp[(2) - (2)].node)), 0); - } - break; - - case 68: -#line 775 "parse.y" - { - (yyval.node) = NEW_MASGN((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 69: -#line 779 "parse.y" - { - (yyval.node) = NEW_MASGN((yyvsp[(1) - (2)].node), -1); - } - break; - - case 70: -#line 783 "parse.y" - { - (yyval.node) = NEW_MASGN(0, (yyvsp[(2) - (2)].node)); - } - break; - - case 71: -#line 787 "parse.y" - { - (yyval.node) = NEW_MASGN(0, -1); - } - break; - - case 73: -#line 794 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (3)].node); - } - break; - - case 74: -#line 800 "parse.y" - { - (yyval.node) = NEW_LIST((yyvsp[(1) - (2)].node)); - } - break; - - case 75: -#line 804 "parse.y" - { - (yyval.node) = list_append((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].node)); - } - break; - - case 76: -#line 810 "parse.y" - { - (yyval.node) = assignable((yyvsp[(1) - (1)].id), 0); - } - break; - - case 77: -#line 814 "parse.y" - { - (yyval.node) = aryset((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node)); - } - break; - - case 78: -#line 818 "parse.y" - { - (yyval.node) = attrset((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].id)); - } - break; - - case 79: -#line 822 "parse.y" - { - (yyval.node) = attrset((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].id)); - } - break; - - case 80: -#line 826 "parse.y" - { - (yyval.node) = attrset((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].id)); - } - break; - - case 81: -#line 830 "parse.y" - { - if (in_def || in_single) - yyerror("dynamic constant assignment"); - (yyval.node) = NEW_CDECL(0, 0, NEW_COLON2((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].id))); - } - break; - - case 82: -#line 836 "parse.y" - { - if (in_def || in_single) - yyerror("dynamic constant assignment"); - (yyval.node) = NEW_CDECL(0, 0, NEW_COLON3((yyvsp[(2) - (2)].id))); - } - break; - - case 83: -#line 842 "parse.y" - { - rb_backref_error((yyvsp[(1) - (1)].node)); - (yyval.node) = 0; - } - break; - - case 84: -#line 849 "parse.y" - { - (yyval.node) = assignable((yyvsp[(1) - (1)].id), 0); - } - break; - - case 85: -#line 853 "parse.y" - { - (yyval.node) = aryset((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node)); - } - break; - - case 86: -#line 857 "parse.y" - { - (yyval.node) = attrset((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].id)); - } - break; - - case 87: -#line 861 "parse.y" - { - (yyval.node) = attrset((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].id)); - } - break; - - case 88: -#line 865 "parse.y" - { - (yyval.node) = attrset((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].id)); - } - break; - - case 89: -#line 869 "parse.y" - { - if (in_def || in_single) - yyerror("dynamic constant assignment"); - (yyval.node) = NEW_CDECL(0, 0, NEW_COLON2((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].id))); - } - break; - - case 90: -#line 875 "parse.y" - { - if (in_def || in_single) - yyerror("dynamic constant assignment"); - (yyval.node) = NEW_CDECL(0, 0, NEW_COLON3((yyvsp[(2) - (2)].id))); - } - break; - - case 91: -#line 881 "parse.y" - { - rb_backref_error((yyvsp[(1) - (1)].node)); - (yyval.node) = 0; - } - break; - - case 92: -#line 888 "parse.y" - { - yyerror("class/module name must be CONSTANT"); - } - break; - - case 94: -#line 895 "parse.y" - { - (yyval.node) = NEW_COLON3((yyvsp[(2) - (2)].id)); - } - break; - - case 95: -#line 899 "parse.y" - { - (yyval.node) = NEW_COLON2(0, (yyval.node)); - } - break; - - case 96: -#line 903 "parse.y" - { - (yyval.node) = NEW_COLON2((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].id)); - } - break; - - case 100: -#line 912 "parse.y" - { - lex_state = EXPR_END; - (yyval.id) = (yyvsp[(1) - (1)].id); - } - break; - - case 101: -#line 917 "parse.y" - { - lex_state = EXPR_END; - (yyval.id) = (yyvsp[(1) - (1)].id); - } - break; - - case 104: -#line 928 "parse.y" - { - (yyval.node) = NEW_LIT(ID2SYM((yyvsp[(1) - (1)].id))); - } - break; - - case 106: -#line 935 "parse.y" - { - (yyval.node) = NEW_UNDEF((yyvsp[(1) - (1)].node)); - } - break; - - case 107: -#line 938 "parse.y" - {lex_state = EXPR_FNAME;} - break; - - case 108: -#line 939 "parse.y" - { - (yyval.node) = block_append((yyvsp[(1) - (4)].node), NEW_UNDEF((yyvsp[(4) - (4)].node))); - } - break; - - case 109: -#line 944 "parse.y" - { (yyval.id) = '|'; } - break; - - case 110: -#line 945 "parse.y" - { (yyval.id) = '^'; } - break; - - case 111: -#line 946 "parse.y" - { (yyval.id) = '&'; } - break; - - case 112: -#line 947 "parse.y" - { (yyval.id) = tCMP; } - break; - - case 113: -#line 948 "parse.y" - { (yyval.id) = tEQ; } - break; - - case 114: -#line 949 "parse.y" - { (yyval.id) = tEQQ; } - break; - - case 115: -#line 950 "parse.y" - { (yyval.id) = tMATCH; } - break; - - case 116: -#line 951 "parse.y" - { (yyval.id) = '>'; } - break; - - case 117: -#line 952 "parse.y" - { (yyval.id) = tGEQ; } - break; - - case 118: -#line 953 "parse.y" - { (yyval.id) = '<'; } - break; - - case 119: -#line 954 "parse.y" - { (yyval.id) = tLEQ; } - break; - - case 120: -#line 955 "parse.y" - { (yyval.id) = tLSHFT; } - break; - - case 121: -#line 956 "parse.y" - { (yyval.id) = tRSHFT; } - break; - - case 122: -#line 957 "parse.y" - { (yyval.id) = '+'; } - break; - - case 123: -#line 958 "parse.y" - { (yyval.id) = '-'; } - break; - - case 124: -#line 959 "parse.y" - { (yyval.id) = '*'; } - break; - - case 125: -#line 960 "parse.y" - { (yyval.id) = '*'; } - break; - - case 126: -#line 961 "parse.y" - { (yyval.id) = '/'; } - break; - - case 127: -#line 962 "parse.y" - { (yyval.id) = '%'; } - break; - - case 128: -#line 963 "parse.y" - { (yyval.id) = tPOW; } - break; - - case 129: -#line 964 "parse.y" - { (yyval.id) = '~'; } - break; - - case 130: -#line 965 "parse.y" - { (yyval.id) = tUPLUS; } - break; - - case 131: -#line 966 "parse.y" - { (yyval.id) = tUMINUS; } - break; - - case 132: -#line 967 "parse.y" - { (yyval.id) = tAREF; } - break; - - case 133: -#line 968 "parse.y" - { (yyval.id) = tASET; } - break; - - case 134: -#line 969 "parse.y" - { (yyval.id) = '`'; } - break; - - case 175: -#line 982 "parse.y" - { - (yyval.node) = node_assign((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 176: -#line 986 "parse.y" - { - (yyval.node) = node_assign((yyvsp[(1) - (5)].node), NEW_RESCUE((yyvsp[(3) - (5)].node), NEW_RESBODY(0,(yyvsp[(5) - (5)].node),0), 0)); - } - break; - - case 177: -#line 990 "parse.y" - { - value_expr((yyvsp[(3) - (3)].node)); - if ((yyvsp[(1) - (3)].node)) { - ID vid = (yyvsp[(1) - (3)].node)->nd_vid; - if ((yyvsp[(2) - (3)].id) == tOROP) { - (yyvsp[(1) - (3)].node)->nd_value = (yyvsp[(3) - (3)].node); - (yyval.node) = NEW_OP_ASGN_OR(gettable(vid), (yyvsp[(1) - (3)].node)); - if (is_asgn_or_id(vid)) { - (yyval.node)->nd_aid = vid; - } - } - else if ((yyvsp[(2) - (3)].id) == tANDOP) { - (yyvsp[(1) - (3)].node)->nd_value = (yyvsp[(3) - (3)].node); - (yyval.node) = NEW_OP_ASGN_AND(gettable(vid), (yyvsp[(1) - (3)].node)); - } - else { - (yyval.node) = (yyvsp[(1) - (3)].node); - (yyval.node)->nd_value = call_op(gettable(vid),(yyvsp[(2) - (3)].id),1,(yyvsp[(3) - (3)].node)); - } - } - else { - (yyval.node) = 0; - } - } - break; - - case 178: -#line 1015 "parse.y" - { - NODE *args; - - value_expr((yyvsp[(6) - (6)].node)); - if (!(yyvsp[(3) - (6)].node)) (yyvsp[(3) - (6)].node) = NEW_ZARRAY(); - args = arg_concat((yyvsp[(6) - (6)].node), (yyvsp[(3) - (6)].node)); - if ((yyvsp[(5) - (6)].id) == tOROP) { - (yyvsp[(5) - (6)].id) = 0; - } - else if ((yyvsp[(5) - (6)].id) == tANDOP) { - (yyvsp[(5) - (6)].id) = 1; - } - (yyval.node) = NEW_OP_ASGN1((yyvsp[(1) - (6)].node), (yyvsp[(5) - (6)].id), args); - fixpos((yyval.node), (yyvsp[(1) - (6)].node)); - } - break; - - case 179: -#line 1031 "parse.y" - { - value_expr((yyvsp[(5) - (5)].node)); - if ((yyvsp[(4) - (5)].id) == tOROP) { - (yyvsp[(4) - (5)].id) = 0; - } - else if ((yyvsp[(4) - (5)].id) == tANDOP) { - (yyvsp[(4) - (5)].id) = 1; - } - (yyval.node) = NEW_OP_ASGN2((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].id), (yyvsp[(5) - (5)].node)); - fixpos((yyval.node), (yyvsp[(1) - (5)].node)); - } - break; - - case 180: -#line 1043 "parse.y" - { - value_expr((yyvsp[(5) - (5)].node)); - if ((yyvsp[(4) - (5)].id) == tOROP) { - (yyvsp[(4) - (5)].id) = 0; - } - else if ((yyvsp[(4) - (5)].id) == tANDOP) { - (yyvsp[(4) - (5)].id) = 1; - } - (yyval.node) = NEW_OP_ASGN2((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].id), (yyvsp[(5) - (5)].node)); - fixpos((yyval.node), (yyvsp[(1) - (5)].node)); - } - break; - - case 181: -#line 1055 "parse.y" - { - value_expr((yyvsp[(5) - (5)].node)); - if ((yyvsp[(4) - (5)].id) == tOROP) { - (yyvsp[(4) - (5)].id) = 0; - } - else if ((yyvsp[(4) - (5)].id) == tANDOP) { - (yyvsp[(4) - (5)].id) = 1; - } - (yyval.node) = NEW_OP_ASGN2((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].id), (yyvsp[(5) - (5)].node)); - fixpos((yyval.node), (yyvsp[(1) - (5)].node)); - } - break; - - case 182: -#line 1067 "parse.y" - { - yyerror("constant re-assignment"); - (yyval.node) = 0; - } - break; - - case 183: -#line 1072 "parse.y" - { - yyerror("constant re-assignment"); - (yyval.node) = 0; - } - break; - - case 184: -#line 1077 "parse.y" - { - rb_backref_error((yyvsp[(1) - (3)].node)); - (yyval.node) = 0; - } - break; - - case 185: -#line 1082 "parse.y" - { - value_expr((yyvsp[(1) - (3)].node)); - value_expr((yyvsp[(3) - (3)].node)); - (yyval.node) = NEW_DOT2((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - if (nd_type((yyvsp[(1) - (3)].node)) == NODE_LIT && FIXNUM_P((yyvsp[(1) - (3)].node)->nd_lit) && - nd_type((yyvsp[(3) - (3)].node)) == NODE_LIT && FIXNUM_P((yyvsp[(3) - (3)].node)->nd_lit)) { - deferred_nodes = list_append(deferred_nodes, (yyval.node)); - } - } - break; - - case 186: -#line 1092 "parse.y" - { - value_expr((yyvsp[(1) - (3)].node)); - value_expr((yyvsp[(3) - (3)].node)); - (yyval.node) = NEW_DOT3((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - if (nd_type((yyvsp[(1) - (3)].node)) == NODE_LIT && FIXNUM_P((yyvsp[(1) - (3)].node)->nd_lit) && - nd_type((yyvsp[(3) - (3)].node)) == NODE_LIT && FIXNUM_P((yyvsp[(3) - (3)].node)->nd_lit)) { - deferred_nodes = list_append(deferred_nodes, (yyval.node)); - } - } - break; - - case 187: -#line 1102 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), '+', 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 188: -#line 1106 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), '-', 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 189: -#line 1110 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), '*', 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 190: -#line 1114 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), '/', 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 191: -#line 1118 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), '%', 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 192: -#line 1122 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), tPOW, 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 193: -#line 1126 "parse.y" - { - (yyval.node) = call_op(call_op((yyvsp[(2) - (4)].node), tPOW, 1, (yyvsp[(4) - (4)].node)), tUMINUS, 0, 0); - } - break; - - case 194: -#line 1130 "parse.y" - { - (yyval.node) = call_op(call_op((yyvsp[(2) - (4)].node), tPOW, 1, (yyvsp[(4) - (4)].node)), tUMINUS, 0, 0); - } - break; - - case 195: -#line 1134 "parse.y" - { - if ((yyvsp[(2) - (2)].node) && nd_type((yyvsp[(2) - (2)].node)) == NODE_LIT) { - (yyval.node) = (yyvsp[(2) - (2)].node); - } - else { - (yyval.node) = call_op((yyvsp[(2) - (2)].node), tUPLUS, 0, 0); - } - } - break; - - case 196: -#line 1143 "parse.y" - { - (yyval.node) = call_op((yyvsp[(2) - (2)].node), tUMINUS, 0, 0); - } - break; - - case 197: -#line 1147 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), '|', 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 198: -#line 1151 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), '^', 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 199: -#line 1155 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), '&', 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 200: -#line 1159 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), tCMP, 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 201: -#line 1163 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), '>', 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 202: -#line 1167 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), tGEQ, 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 203: -#line 1171 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), '<', 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 204: -#line 1175 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), tLEQ, 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 205: -#line 1179 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), tEQ, 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 206: -#line 1183 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), tEQQ, 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 207: -#line 1187 "parse.y" - { - (yyval.node) = NEW_NOT(call_op((yyvsp[(1) - (3)].node), tEQ, 1, (yyvsp[(3) - (3)].node))); - } - break; - - case 208: -#line 1191 "parse.y" - { - (yyval.node) = match_gen((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 209: -#line 1195 "parse.y" - { - (yyval.node) = NEW_NOT(match_gen((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node))); - } - break; - - case 210: -#line 1199 "parse.y" - { - (yyval.node) = NEW_NOT(cond((yyvsp[(2) - (2)].node))); - } - break; - - case 211: -#line 1203 "parse.y" - { - (yyval.node) = call_op((yyvsp[(2) - (2)].node), '~', 0, 0); - } - break; - - case 212: -#line 1207 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), tLSHFT, 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 213: -#line 1211 "parse.y" - { - (yyval.node) = call_op((yyvsp[(1) - (3)].node), tRSHFT, 1, (yyvsp[(3) - (3)].node)); - } - break; - - case 214: -#line 1215 "parse.y" - { - (yyval.node) = logop(NODE_AND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 215: -#line 1219 "parse.y" - { - (yyval.node) = logop(NODE_OR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 216: -#line 1222 "parse.y" - {in_defined = 1;} - break; - - case 217: -#line 1223 "parse.y" - { - in_defined = 0; - (yyval.node) = NEW_DEFINED((yyvsp[(4) - (4)].node)); - } - break; - - case 218: -#line 1228 "parse.y" - { - (yyval.node) = NEW_IF(cond((yyvsp[(1) - (5)].node)), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node)); - fixpos((yyval.node), (yyvsp[(1) - (5)].node)); - } - break; - - case 219: -#line 1233 "parse.y" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 220: -#line 1239 "parse.y" - { - value_expr((yyvsp[(1) - (1)].node)); - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 222: -#line 1247 "parse.y" - { - rb_warn("parenthesize argument(s) for future version"); - (yyval.node) = NEW_LIST((yyvsp[(1) - (2)].node)); - } - break; - - case 223: -#line 1252 "parse.y" - { - (yyval.node) = (yyvsp[(1) - (2)].node); - } - break; - - case 224: -#line 1256 "parse.y" - { - value_expr((yyvsp[(4) - (5)].node)); - (yyval.node) = arg_concat((yyvsp[(1) - (5)].node), (yyvsp[(4) - (5)].node)); - } - break; - - case 225: -#line 1261 "parse.y" - { - (yyval.node) = NEW_LIST(NEW_HASH((yyvsp[(1) - (2)].node))); - } - break; - - case 226: -#line 1265 "parse.y" - { - value_expr((yyvsp[(2) - (3)].node)); - (yyval.node) = NEW_NEWLINE(NEW_SPLAT((yyvsp[(2) - (3)].node))); - } - break; - - case 227: -#line 1272 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (3)].node); - } - break; - - case 228: -#line 1276 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (4)].node); - } - break; - - case 229: -#line 1280 "parse.y" - { - rb_warn("parenthesize argument for future version"); - (yyval.node) = NEW_LIST((yyvsp[(2) - (4)].node)); - } - break; - - case 230: -#line 1285 "parse.y" - { - rb_warn("parenthesize argument for future version"); - (yyval.node) = list_append((yyvsp[(2) - (6)].node), (yyvsp[(4) - (6)].node)); - } - break; - - case 233: -#line 1296 "parse.y" - { - rb_warn("parenthesize argument(s) for future version"); - (yyval.node) = NEW_LIST((yyvsp[(1) - (1)].node)); - } - break; - - case 234: -#line 1301 "parse.y" - { - (yyval.node) = arg_blk_pass((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); - } - break; - - case 235: -#line 1305 "parse.y" - { - (yyval.node) = arg_concat((yyvsp[(1) - (5)].node), (yyvsp[(4) - (5)].node)); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(5) - (5)].node)); - } - break; - - case 236: -#line 1310 "parse.y" - { - (yyval.node) = NEW_LIST(NEW_HASH((yyvsp[(1) - (2)].node))); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(2) - (2)].node)); - } - break; - - case 237: -#line 1315 "parse.y" - { - (yyval.node) = arg_concat(NEW_LIST(NEW_HASH((yyvsp[(1) - (5)].node))), (yyvsp[(4) - (5)].node)); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(5) - (5)].node)); - } - break; - - case 238: -#line 1320 "parse.y" - { - (yyval.node) = list_append((yyvsp[(1) - (4)].node), NEW_HASH((yyvsp[(3) - (4)].node))); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(4) - (4)].node)); - } - break; - - case 239: -#line 1325 "parse.y" - { - value_expr((yyvsp[(6) - (7)].node)); - (yyval.node) = arg_concat(list_append((yyvsp[(1) - (7)].node), NEW_HASH((yyvsp[(3) - (7)].node))), (yyvsp[(6) - (7)].node)); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(7) - (7)].node)); - } - break; - - case 240: -#line 1331 "parse.y" - { - (yyval.node) = arg_blk_pass(NEW_SPLAT((yyvsp[(2) - (3)].node)), (yyvsp[(3) - (3)].node)); - } - break; - - case 242: -#line 1338 "parse.y" - { - (yyval.node) = arg_blk_pass(list_concat(NEW_LIST((yyvsp[(1) - (4)].node)),(yyvsp[(3) - (4)].node)), (yyvsp[(4) - (4)].node)); - } - break; - - case 243: -#line 1342 "parse.y" - { - (yyval.node) = arg_blk_pass((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 244: -#line 1346 "parse.y" - { - (yyval.node) = arg_concat(NEW_LIST((yyvsp[(1) - (5)].node)), (yyvsp[(4) - (5)].node)); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(5) - (5)].node)); - } - break; - - case 245: -#line 1351 "parse.y" - { - (yyval.node) = arg_concat(list_concat(NEW_LIST((yyvsp[(1) - (7)].node)),(yyvsp[(3) - (7)].node)), (yyvsp[(6) - (7)].node)); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(7) - (7)].node)); - } - break; - - case 246: -#line 1356 "parse.y" - { - (yyval.node) = NEW_LIST(NEW_HASH((yyvsp[(1) - (2)].node))); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(2) - (2)].node)); - } - break; - - case 247: -#line 1361 "parse.y" - { - (yyval.node) = arg_concat(NEW_LIST(NEW_HASH((yyvsp[(1) - (5)].node))), (yyvsp[(4) - (5)].node)); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(5) - (5)].node)); - } - break; - - case 248: -#line 1366 "parse.y" - { - (yyval.node) = list_append(NEW_LIST((yyvsp[(1) - (4)].node)), NEW_HASH((yyvsp[(3) - (4)].node))); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(4) - (4)].node)); - } - break; - - case 249: -#line 1371 "parse.y" - { - (yyval.node) = list_append(list_concat(NEW_LIST((yyvsp[(1) - (6)].node)),(yyvsp[(3) - (6)].node)), NEW_HASH((yyvsp[(5) - (6)].node))); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(6) - (6)].node)); - } - break; - - case 250: -#line 1376 "parse.y" - { - (yyval.node) = arg_concat(list_append(NEW_LIST((yyvsp[(1) - (7)].node)), NEW_HASH((yyvsp[(3) - (7)].node))), (yyvsp[(6) - (7)].node)); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(7) - (7)].node)); - } - break; - - case 251: -#line 1381 "parse.y" - { - (yyval.node) = arg_concat(list_append(list_concat(NEW_LIST((yyvsp[(1) - (9)].node)), (yyvsp[(3) - (9)].node)), NEW_HASH((yyvsp[(5) - (9)].node))), (yyvsp[(8) - (9)].node)); - (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[(9) - (9)].node)); - } - break; - - case 252: -#line 1386 "parse.y" - { - (yyval.node) = arg_blk_pass(NEW_SPLAT((yyvsp[(2) - (3)].node)), (yyvsp[(3) - (3)].node)); - } - break; - - case 254: -#line 1392 "parse.y" - { - (yyval.num) = cmdarg_stack; - CMDARG_PUSH(1); - } - break; - - case 255: -#line 1397 "parse.y" - { - /* CMDARG_POP() */ - cmdarg_stack = (yyvsp[(1) - (2)].num); - (yyval.node) = (yyvsp[(2) - (2)].node); - } - break; - - case 257: -#line 1405 "parse.y" - {lex_state = EXPR_ENDARG;} - break; - - case 258: -#line 1406 "parse.y" - { - rb_warn("don't put space before argument parentheses"); - (yyval.node) = 0; - } - break; - - case 259: -#line 1410 "parse.y" - {lex_state = EXPR_ENDARG;} - break; - - case 260: -#line 1411 "parse.y" - { - rb_warn("don't put space before argument parentheses"); - (yyval.node) = (yyvsp[(2) - (4)].node); - } - break; - - case 261: -#line 1418 "parse.y" - { - (yyval.node) = NEW_BLOCK_PASS((yyvsp[(2) - (2)].node)); - } - break; - - case 262: -#line 1424 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (2)].node); - } - break; - - case 264: -#line 1431 "parse.y" - { - (yyval.node) = NEW_LIST((yyvsp[(1) - (1)].node)); - } - break; - - case 265: -#line 1435 "parse.y" - { - (yyval.node) = list_append((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 266: -#line 1441 "parse.y" - { - (yyval.node) = list_append((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 267: -#line 1445 "parse.y" - { - (yyval.node) = arg_concat((yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node)); - } - break; - - case 268: -#line 1449 "parse.y" - { - (yyval.node) = NEW_SPLAT((yyvsp[(2) - (2)].node)); - } - break; - - case 277: -#line 1463 "parse.y" - { - (yyval.node) = NEW_FCALL((yyvsp[(1) - (1)].id), 0); - } - break; - - case 278: -#line 1467 "parse.y" - { - (yyvsp[(1) - (1)].num) = ruby_sourceline; - } - break; - - case 279: -#line 1472 "parse.y" - { - if ((yyvsp[(3) - (4)].node) == NULL) - (yyval.node) = NEW_NIL(); - else - (yyval.node) = NEW_BEGIN((yyvsp[(3) - (4)].node)); - nd_set_line((yyval.node), (yyvsp[(1) - (4)].num)); - } - break; - - case 280: -#line 1479 "parse.y" - {lex_state = EXPR_ENDARG;} - break; - - case 281: -#line 1480 "parse.y" - { - rb_warning("(...) interpreted as grouped expression"); - (yyval.node) = (yyvsp[(2) - (5)].node); - } - break; - - case 282: -#line 1485 "parse.y" - { - if (!(yyvsp[(2) - (3)].node)) (yyval.node) = NEW_NIL(); - else (yyval.node) = (yyvsp[(2) - (3)].node); - } - break; - - case 283: -#line 1490 "parse.y" - { - (yyval.node) = NEW_COLON2((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].id)); - } - break; - - case 284: -#line 1494 "parse.y" - { - (yyval.node) = NEW_COLON3((yyvsp[(2) - (2)].id)); - } - break; - - case 285: -#line 1498 "parse.y" - { - if ((yyvsp[(1) - (4)].node) && nd_type((yyvsp[(1) - (4)].node)) == NODE_SELF) - (yyval.node) = NEW_FCALL(tAREF, (yyvsp[(3) - (4)].node)); - else - (yyval.node) = NEW_CALL((yyvsp[(1) - (4)].node), tAREF, (yyvsp[(3) - (4)].node)); - fixpos((yyval.node), (yyvsp[(1) - (4)].node)); - } - break; - - case 286: -#line 1506 "parse.y" - { - if ((yyvsp[(2) - (3)].node) == 0) { - (yyval.node) = NEW_ZARRAY(); /* zero length array*/ - } - else { - (yyval.node) = (yyvsp[(2) - (3)].node); - } - } - break; - - case 287: -#line 1515 "parse.y" - { - (yyval.node) = NEW_HASH((yyvsp[(2) - (3)].node)); - } - break; - - case 288: -#line 1519 "parse.y" - { - (yyval.node) = NEW_RETURN(0); - } - break; - - case 289: -#line 1523 "parse.y" - { - (yyval.node) = new_yield((yyvsp[(3) - (4)].node)); - } - break; - - case 290: -#line 1527 "parse.y" - { - (yyval.node) = NEW_YIELD(0, Qfalse); - } - break; - - case 291: -#line 1531 "parse.y" - { - (yyval.node) = NEW_YIELD(0, Qfalse); - } - break; - - case 292: -#line 1534 "parse.y" - {in_defined = 1;} - break; - - case 293: -#line 1535 "parse.y" - { - in_defined = 0; - (yyval.node) = NEW_DEFINED((yyvsp[(5) - (6)].node)); - } - break; - - case 294: -#line 1540 "parse.y" - { - (yyvsp[(2) - (2)].node)->nd_iter = NEW_FCALL((yyvsp[(1) - (2)].id), 0); - (yyval.node) = (yyvsp[(2) - (2)].node); - fixpos((yyvsp[(2) - (2)].node)->nd_iter, (yyvsp[(2) - (2)].node)); - } - break; - - case 296: -#line 1547 "parse.y" - { - if ((yyvsp[(1) - (2)].node) && nd_type((yyvsp[(1) - (2)].node)) == NODE_BLOCK_PASS) { - rb_compile_error("both block arg and actual block given"); - } - (yyvsp[(2) - (2)].node)->nd_iter = (yyvsp[(1) - (2)].node); - (yyval.node) = (yyvsp[(2) - (2)].node); - fixpos((yyval.node), (yyvsp[(1) - (2)].node)); - } - break; - - case 297: -#line 1559 "parse.y" - { - (yyval.node) = NEW_IF(cond((yyvsp[(2) - (6)].node)), (yyvsp[(4) - (6)].node), (yyvsp[(5) - (6)].node)); - fixpos((yyval.node), (yyvsp[(2) - (6)].node)); - if (cond_negative(&(yyval.node)->nd_cond)) { - NODE *tmp = (yyval.node)->nd_body; - (yyval.node)->nd_body = (yyval.node)->nd_else; - (yyval.node)->nd_else = tmp; - } - } - break; - - case 298: -#line 1572 "parse.y" - { - (yyval.node) = NEW_UNLESS(cond((yyvsp[(2) - (6)].node)), (yyvsp[(4) - (6)].node), (yyvsp[(5) - (6)].node)); - fixpos((yyval.node), (yyvsp[(2) - (6)].node)); - if (cond_negative(&(yyval.node)->nd_cond)) { - NODE *tmp = (yyval.node)->nd_body; - (yyval.node)->nd_body = (yyval.node)->nd_else; - (yyval.node)->nd_else = tmp; - } - } - break; - - case 299: -#line 1581 "parse.y" - {COND_PUSH(1);} - break; - - case 300: -#line 1581 "parse.y" - {COND_POP();} - break; - - case 301: -#line 1584 "parse.y" - { - (yyval.node) = NEW_WHILE(cond((yyvsp[(3) - (7)].node)), (yyvsp[(6) - (7)].node), 1); - fixpos((yyval.node), (yyvsp[(3) - (7)].node)); - if (cond_negative(&(yyval.node)->nd_cond)) { - nd_set_type((yyval.node), NODE_UNTIL); - } - } - break; - - case 302: -#line 1591 "parse.y" - {COND_PUSH(1);} - break; - - case 303: -#line 1591 "parse.y" - {COND_POP();} - break; - - case 304: -#line 1594 "parse.y" - { - (yyval.node) = NEW_UNTIL(cond((yyvsp[(3) - (7)].node)), (yyvsp[(6) - (7)].node), 1); - fixpos((yyval.node), (yyvsp[(3) - (7)].node)); - if (cond_negative(&(yyval.node)->nd_cond)) { - nd_set_type((yyval.node), NODE_WHILE); - } - } - break; - - case 305: -#line 1604 "parse.y" - { - (yyval.node) = NEW_CASE((yyvsp[(2) - (5)].node), (yyvsp[(4) - (5)].node)); - fixpos((yyval.node), (yyvsp[(2) - (5)].node)); - } - break; - - case 306: -#line 1609 "parse.y" - { - (yyval.node) = (yyvsp[(3) - (4)].node); - } - break; - - case 307: -#line 1613 "parse.y" - { - (yyval.node) = (yyvsp[(4) - (5)].node); - } - break; - - case 308: -#line 1616 "parse.y" - {COND_PUSH(1);} - break; - - case 309: -#line 1616 "parse.y" - {COND_POP();} - break; - - case 310: -#line 1619 "parse.y" - { - (yyval.node) = NEW_FOR((yyvsp[(2) - (9)].node), (yyvsp[(5) - (9)].node), (yyvsp[(8) - (9)].node)); - fixpos((yyval.node), (yyvsp[(2) - (9)].node)); - } - break; - - case 311: -#line 1624 "parse.y" - { - if (in_def || in_single) - yyerror("class definition in method body"); - class_nest++; - local_push(0); - (yyval.num) = ruby_sourceline; - } - break; - - case 312: -#line 1633 "parse.y" - { - (yyval.node) = NEW_CLASS((yyvsp[(2) - (6)].node), (yyvsp[(5) - (6)].node), (yyvsp[(3) - (6)].node)); - nd_set_line((yyval.node), (yyvsp[(4) - (6)].num)); - local_pop(); - class_nest--; - } - break; - - case 313: -#line 1640 "parse.y" - { - (yyval.num) = in_def; - in_def = 0; - } - break; - - case 314: -#line 1645 "parse.y" - { - (yyval.num) = in_single; - in_single = 0; - class_nest++; - local_push(0); - } - break; - - case 315: -#line 1653 "parse.y" - { - (yyval.node) = NEW_SCLASS((yyvsp[(3) - (8)].node), (yyvsp[(7) - (8)].node)); - fixpos((yyval.node), (yyvsp[(3) - (8)].node)); - local_pop(); - class_nest--; - in_def = (yyvsp[(4) - (8)].num); - in_single = (yyvsp[(6) - (8)].num); - } - break; - - case 316: -#line 1662 "parse.y" - { - if (in_def || in_single) - yyerror("module definition in method body"); - class_nest++; - local_push(0); - (yyval.num) = ruby_sourceline; - } - break; - - case 317: -#line 1671 "parse.y" - { - (yyval.node) = NEW_MODULE((yyvsp[(2) - (5)].node), (yyvsp[(4) - (5)].node)); - nd_set_line((yyval.node), (yyvsp[(3) - (5)].num)); - local_pop(); - class_nest--; - } - break; - - case 318: -#line 1678 "parse.y" - { - (yyval.id) = cur_mid; - cur_mid = (yyvsp[(2) - (2)].id); - in_def++; - local_push(0); - } - break; - - case 319: -#line 1687 "parse.y" - { - if (!(yyvsp[(5) - (6)].node)) (yyvsp[(5) - (6)].node) = NEW_NIL(); - (yyval.node) = NEW_DEFN((yyvsp[(2) - (6)].id), (yyvsp[(4) - (6)].node), (yyvsp[(5) - (6)].node), NOEX_PRIVATE); - fixpos((yyval.node), (yyvsp[(4) - (6)].node)); - local_pop(); - in_def--; - cur_mid = (yyvsp[(3) - (6)].id); - } - break; - - case 320: -#line 1695 "parse.y" - {lex_state = EXPR_FNAME;} - break; - - case 321: -#line 1696 "parse.y" - { - in_single++; - local_push(0); - lex_state = EXPR_END; /* force for args */ - } - break; - - case 322: -#line 1704 "parse.y" - { - (yyval.node) = NEW_DEFS((yyvsp[(2) - (9)].node), (yyvsp[(5) - (9)].id), (yyvsp[(7) - (9)].node), (yyvsp[(8) - (9)].node)); - fixpos((yyval.node), (yyvsp[(2) - (9)].node)); - local_pop(); - in_single--; - } - break; - - case 323: -#line 1711 "parse.y" - { - (yyval.node) = NEW_BREAK(0); - } - break; - - case 324: -#line 1715 "parse.y" - { - (yyval.node) = NEW_NEXT(0); - } - break; - - case 325: -#line 1719 "parse.y" - { - (yyval.node) = NEW_REDO(); - } - break; - - case 326: -#line 1723 "parse.y" - { - (yyval.node) = NEW_RETRY(); - } - break; - - case 327: -#line 1729 "parse.y" - { - value_expr((yyvsp[(1) - (1)].node)); - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 336: -#line 1750 "parse.y" - { - (yyval.node) = NEW_IF(cond((yyvsp[(2) - (5)].node)), (yyvsp[(4) - (5)].node), (yyvsp[(5) - (5)].node)); - fixpos((yyval.node), (yyvsp[(2) - (5)].node)); - } - break; - - case 338: -#line 1758 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (2)].node); - } - break; - - case 342: -#line 1769 "parse.y" - { - (yyval.node) = (NODE*)1; - } - break; - - case 343: -#line 1773 "parse.y" - { - (yyval.node) = (NODE*)1; - } - break; - - case 344: -#line 1777 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (3)].node); - } - break; - - case 345: -#line 1783 "parse.y" - { - (yyval.vars) = dyna_push(); - (yyvsp[(1) - (1)].num) = ruby_sourceline; - } - break; - - case 346: -#line 1787 "parse.y" - {(yyval.vars) = ruby_dyna_vars;} - break; - - case 347: -#line 1790 "parse.y" - { - (yyval.node) = NEW_ITER((yyvsp[(3) - (6)].node), 0, dyna_init((yyvsp[(5) - (6)].node), (yyvsp[(4) - (6)].vars))); - nd_set_line((yyval.node), (yyvsp[(1) - (6)].num)); - dyna_pop((yyvsp[(2) - (6)].vars)); - } - break; - - case 348: -#line 1798 "parse.y" - { - if ((yyvsp[(1) - (2)].node) && nd_type((yyvsp[(1) - (2)].node)) == NODE_BLOCK_PASS) { - rb_compile_error("both block arg and actual block given"); - } - (yyvsp[(2) - (2)].node)->nd_iter = (yyvsp[(1) - (2)].node); - (yyval.node) = (yyvsp[(2) - (2)].node); - fixpos((yyval.node), (yyvsp[(1) - (2)].node)); - } - break; - - case 349: -#line 1807 "parse.y" - { - (yyval.node) = new_call((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].id), (yyvsp[(4) - (4)].node)); - } - break; - - case 350: -#line 1811 "parse.y" - { - (yyval.node) = new_call((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].id), (yyvsp[(4) - (4)].node)); - } - break; - - case 351: -#line 1817 "parse.y" - { - (yyval.node) = new_fcall((yyvsp[(1) - (2)].id), (yyvsp[(2) - (2)].node)); - fixpos((yyval.node), (yyvsp[(2) - (2)].node)); - } - break; - - case 352: -#line 1822 "parse.y" - { - (yyval.node) = new_call((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].id), (yyvsp[(4) - (4)].node)); - fixpos((yyval.node), (yyvsp[(1) - (4)].node)); - } - break; - - case 353: -#line 1827 "parse.y" - { - (yyval.node) = new_call((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].id), (yyvsp[(4) - (4)].node)); - fixpos((yyval.node), (yyvsp[(1) - (4)].node)); - } - break; - - case 354: -#line 1832 "parse.y" - { - (yyval.node) = new_call((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].id), 0); - } - break; - - case 355: -#line 1836 "parse.y" - { - (yyval.node) = new_super((yyvsp[(2) - (2)].node)); - } - break; - - case 356: -#line 1840 "parse.y" - { - (yyval.node) = NEW_ZSUPER(); - } - break; - - case 357: -#line 1846 "parse.y" - { - (yyval.vars) = dyna_push(); - (yyvsp[(1) - (1)].num) = ruby_sourceline; - } - break; - - case 358: -#line 1850 "parse.y" - {(yyval.vars) = ruby_dyna_vars;} - break; - - case 359: -#line 1852 "parse.y" - { - (yyval.node) = NEW_ITER((yyvsp[(3) - (6)].node), 0, dyna_init((yyvsp[(5) - (6)].node), (yyvsp[(4) - (6)].vars))); - nd_set_line((yyval.node), (yyvsp[(1) - (6)].num)); - dyna_pop((yyvsp[(2) - (6)].vars)); - } - break; - - case 360: -#line 1858 "parse.y" - { - (yyval.vars) = dyna_push(); - (yyvsp[(1) - (1)].num) = ruby_sourceline; - } - break; - - case 361: -#line 1862 "parse.y" - {(yyval.vars) = ruby_dyna_vars;} - break; - - case 362: -#line 1864 "parse.y" - { - (yyval.node) = NEW_ITER((yyvsp[(3) - (6)].node), 0, dyna_init((yyvsp[(5) - (6)].node), (yyvsp[(4) - (6)].vars))); - nd_set_line((yyval.node), (yyvsp[(1) - (6)].num)); - dyna_pop((yyvsp[(2) - (6)].vars)); - } - break; - - case 363: -#line 1874 "parse.y" - { - (yyval.node) = NEW_WHEN((yyvsp[(2) - (5)].node), (yyvsp[(4) - (5)].node), (yyvsp[(5) - (5)].node)); - } - break; - - case 365: -#line 1880 "parse.y" - { - (yyval.node) = list_append((yyvsp[(1) - (4)].node), NEW_WHEN((yyvsp[(4) - (4)].node), 0, 0)); - } - break; - - case 366: -#line 1884 "parse.y" - { - (yyval.node) = NEW_LIST(NEW_WHEN((yyvsp[(2) - (2)].node), 0, 0)); - } - break; - - case 369: -#line 1896 "parse.y" - { - if ((yyvsp[(3) - (6)].node)) { - (yyvsp[(3) - (6)].node) = node_assign((yyvsp[(3) - (6)].node), NEW_GVAR(rb_intern("$!"))); - (yyvsp[(5) - (6)].node) = block_append((yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node)); - } - (yyval.node) = NEW_RESBODY((yyvsp[(2) - (6)].node), (yyvsp[(5) - (6)].node), (yyvsp[(6) - (6)].node)); - fixpos((yyval.node), (yyvsp[(2) - (6)].node)?(yyvsp[(2) - (6)].node):(yyvsp[(5) - (6)].node)); - } - break; - - case 371: -#line 1908 "parse.y" - { - (yyval.node) = NEW_LIST((yyvsp[(1) - (1)].node)); - } - break; - - case 374: -#line 1916 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (2)].node); - } - break; - - case 376: -#line 1923 "parse.y" - { - if ((yyvsp[(2) - (2)].node)) - (yyval.node) = (yyvsp[(2) - (2)].node); - else - /* place holder */ - (yyval.node) = NEW_NIL(); - } - break; - - case 379: -#line 1935 "parse.y" - { - (yyval.node) = NEW_LIT(ID2SYM((yyvsp[(1) - (1)].id))); - } - break; - - case 381: -#line 1942 "parse.y" - { - NODE *node = (yyvsp[(1) - (1)].node); - if (!node) { - node = NEW_STR(rb_str_new(0, 0)); - } - else { - node = evstr2dstr(node); - } - (yyval.node) = node; - } - break; - - case 383: -#line 1956 "parse.y" - { - (yyval.node) = literal_concat((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); - } - break; - - case 384: -#line 1962 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (3)].node); - } - break; - - case 385: -#line 1968 "parse.y" - { - NODE *node = (yyvsp[(2) - (3)].node); - if (!node) { - node = NEW_XSTR(rb_str_new(0, 0)); - } - else { - switch (nd_type(node)) { - case NODE_STR: - nd_set_type(node, NODE_XSTR); - break; - case NODE_DSTR: - nd_set_type(node, NODE_DXSTR); - break; - default: - node = NEW_NODE(NODE_DXSTR, rb_str_new(0, 0), 1, NEW_LIST(node)); - break; - } - } - (yyval.node) = node; - } - break; - - case 386: -#line 1991 "parse.y" - { - int options = (yyvsp[(3) - (3)].num); - NODE *node = (yyvsp[(2) - (3)].node); - if (!node) { - node = NEW_LIT(rb_reg_new("", 0, options & ~RE_OPTION_ONCE)); - } - else switch (nd_type(node)) { - case NODE_STR: - { - VALUE src = node->nd_lit; - nd_set_type(node, NODE_LIT); - node->nd_lit = rb_reg_new(RSTRING(src)->ptr, - RSTRING(src)->len, - options & ~RE_OPTION_ONCE); - } - break; - default: - node = NEW_NODE(NODE_DSTR, rb_str_new(0, 0), 1, NEW_LIST(node)); - case NODE_DSTR: - if (options & RE_OPTION_ONCE) { - nd_set_type(node, NODE_DREGX_ONCE); - } - else { - nd_set_type(node, NODE_DREGX); - } - node->nd_cflag = options & ~RE_OPTION_ONCE; - break; - } - (yyval.node) = node; - } - break; - - case 387: -#line 2024 "parse.y" - { - (yyval.node) = NEW_ZARRAY(); - } - break; - - case 388: -#line 2028 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (3)].node); - } - break; - - case 389: -#line 2034 "parse.y" - { - (yyval.node) = 0; - } - break; - - case 390: -#line 2038 "parse.y" - { - (yyval.node) = list_append((yyvsp[(1) - (3)].node), evstr2dstr((yyvsp[(2) - (3)].node))); - } - break; - - case 392: -#line 2045 "parse.y" - { - (yyval.node) = literal_concat((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); - } - break; - - case 393: -#line 2051 "parse.y" - { - (yyval.node) = NEW_ZARRAY(); - } - break; - - case 394: -#line 2055 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (3)].node); - } - break; - - case 395: -#line 2061 "parse.y" - { - (yyval.node) = 0; - } - break; - - case 396: -#line 2065 "parse.y" - { - (yyval.node) = list_append((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].node)); - } - break; - - case 397: -#line 2071 "parse.y" - { - (yyval.node) = 0; - } - break; - - case 398: -#line 2075 "parse.y" - { - (yyval.node) = literal_concat((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); - } - break; - - case 399: -#line 2081 "parse.y" - { - (yyval.node) = 0; - } - break; - - case 400: -#line 2085 "parse.y" - { - (yyval.node) = literal_concat((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); - } - break; - - case 402: -#line 2092 "parse.y" - { - (yyval.node) = lex_strterm; - lex_strterm = 0; - lex_state = EXPR_BEG; - } - break; - - case 403: -#line 2098 "parse.y" - { - lex_strterm = (yyvsp[(2) - (3)].node); - (yyval.node) = NEW_EVSTR((yyvsp[(3) - (3)].node)); - } - break; - - case 404: -#line 2103 "parse.y" - { - (yyval.node) = lex_strterm; - lex_strterm = 0; - lex_state = EXPR_BEG; - COND_PUSH(0); - CMDARG_PUSH(0); - } - break; - - case 405: -#line 2111 "parse.y" - { - lex_strterm = (yyvsp[(2) - (4)].node); - COND_LEXPOP(); - CMDARG_LEXPOP(); - if (((yyval.node) = (yyvsp[(3) - (4)].node)) && nd_type((yyval.node)) == NODE_NEWLINE) { - (yyval.node) = (yyval.node)->nd_next; - rb_gc_force_recycle((VALUE)(yyvsp[(3) - (4)].node)); - } - (yyval.node) = new_evstr((yyval.node)); - } - break; - - case 406: -#line 2123 "parse.y" - {(yyval.node) = NEW_GVAR((yyvsp[(1) - (1)].id));} - break; - - case 407: -#line 2124 "parse.y" - {(yyval.node) = NEW_IVAR((yyvsp[(1) - (1)].id));} - break; - - case 408: -#line 2125 "parse.y" - {(yyval.node) = NEW_CVAR((yyvsp[(1) - (1)].id));} - break; - - case 410: -#line 2130 "parse.y" - { - lex_state = EXPR_END; - (yyval.id) = (yyvsp[(2) - (2)].id); - } - break; - - case 415: -#line 2143 "parse.y" - { - lex_state = EXPR_END; - if (!((yyval.node) = (yyvsp[(2) - (3)].node))) { - (yyval.node) = NEW_NIL(); - yyerror("empty symbol literal"); - } - else { - VALUE lit; - - switch (nd_type((yyval.node))) { - case NODE_DSTR: - nd_set_type((yyval.node), NODE_DSYM); - break; - case NODE_STR: - lit = (yyval.node)->nd_lit; - if (RSTRING(lit)->len == 0) { - yyerror("empty symbol literal"); - break; - } - if (strlen(RSTRING(lit)->ptr) == RSTRING(lit)->len) { - (yyval.node)->nd_lit = ID2SYM(rb_intern(RSTRING((yyval.node)->nd_lit)->ptr)); - nd_set_type((yyval.node), NODE_LIT); - break; - } - /* fall through */ - default: - (yyval.node) = NEW_NODE(NODE_DSYM, rb_str_new(0, 0), 1, NEW_LIST((yyval.node))); - break; - } - } - } - break; - - case 418: -#line 2179 "parse.y" - { - (yyval.node) = negate_lit((yyvsp[(2) - (2)].node)); - } - break; - - case 419: -#line 2183 "parse.y" - { - (yyval.node) = negate_lit((yyvsp[(2) - (2)].node)); - } - break; - - case 425: -#line 2193 "parse.y" - {(yyval.id) = kNIL;} - break; - - case 426: -#line 2194 "parse.y" - {(yyval.id) = kSELF;} - break; - - case 427: -#line 2195 "parse.y" - {(yyval.id) = kTRUE;} - break; - - case 428: -#line 2196 "parse.y" - {(yyval.id) = kFALSE;} - break; - - case 429: -#line 2197 "parse.y" - {(yyval.id) = k__FILE__;} - break; - - case 430: -#line 2198 "parse.y" - {(yyval.id) = k__LINE__;} - break; - - case 431: -#line 2202 "parse.y" - { - (yyval.node) = gettable((yyvsp[(1) - (1)].id)); - } - break; - - case 432: -#line 2208 "parse.y" - { - (yyval.node) = assignable((yyvsp[(1) - (1)].id), 0); - } - break; - - case 435: -#line 2218 "parse.y" - { - (yyval.node) = 0; - } - break; - - case 436: -#line 2222 "parse.y" - { - lex_state = EXPR_BEG; - } - break; - - case 437: -#line 2226 "parse.y" - { - (yyval.node) = (yyvsp[(3) - (4)].node); - } - break; - - case 438: -#line 2229 "parse.y" - {yyerrok; (yyval.node) = 0;} - break; - - case 439: -#line 2233 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (4)].node); - lex_state = EXPR_BEG; - command_start = Qtrue; - } - break; - - case 440: -#line 2239 "parse.y" - { - (yyval.node) = (yyvsp[(1) - (2)].node); - } - break; - - case 441: -#line 2245 "parse.y" - { - (yyval.node) = block_append(NEW_ARGS((yyvsp[(1) - (6)].num), (yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node)), (yyvsp[(6) - (6)].node)); - } - break; - - case 442: -#line 2249 "parse.y" - { - (yyval.node) = block_append(NEW_ARGS((yyvsp[(1) - (4)].num), (yyvsp[(3) - (4)].node), 0), (yyvsp[(4) - (4)].node)); - } - break; - - case 443: -#line 2253 "parse.y" - { - (yyval.node) = block_append(NEW_ARGS((yyvsp[(1) - (4)].num), 0, (yyvsp[(3) - (4)].node)), (yyvsp[(4) - (4)].node)); - } - break; - - case 444: -#line 2257 "parse.y" - { - (yyval.node) = block_append(NEW_ARGS((yyvsp[(1) - (2)].num), 0, 0), (yyvsp[(2) - (2)].node)); - } - break; - - case 445: -#line 2261 "parse.y" - { - (yyval.node) = block_append(NEW_ARGS(0, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node)), (yyvsp[(4) - (4)].node)); - } - break; - - case 446: -#line 2265 "parse.y" - { - (yyval.node) = block_append(NEW_ARGS(0, (yyvsp[(1) - (2)].node), 0), (yyvsp[(2) - (2)].node)); - } - break; - - case 447: -#line 2269 "parse.y" - { - (yyval.node) = block_append(NEW_ARGS(0, 0, (yyvsp[(1) - (2)].node)), (yyvsp[(2) - (2)].node)); - } - break; - - case 448: -#line 2273 "parse.y" - { - (yyval.node) = block_append(NEW_ARGS(0, 0, 0), (yyvsp[(1) - (1)].node)); - } - break; - - case 449: -#line 2277 "parse.y" - { - (yyval.node) = NEW_ARGS(0, 0, 0); - } - break; - - case 450: -#line 2283 "parse.y" - { - yyerror("formal argument cannot be a constant"); - } - break; - - case 451: -#line 2287 "parse.y" - { - yyerror("formal argument cannot be an instance variable"); - } - break; - - case 452: -#line 2291 "parse.y" - { - yyerror("formal argument cannot be a global variable"); - } - break; - - case 453: -#line 2295 "parse.y" - { - yyerror("formal argument cannot be a class variable"); - } - break; - - case 454: -#line 2299 "parse.y" - { - if (!is_local_id((yyvsp[(1) - (1)].id))) - yyerror("formal argument must be local variable"); - else if (local_id((yyvsp[(1) - (1)].id))) - yyerror("duplicate argument name"); - local_cnt((yyvsp[(1) - (1)].id)); - (yyval.num) = 1; - } - break; - - case 456: -#line 2311 "parse.y" - { - (yyval.num) += 1; - } - break; - - case 457: -#line 2317 "parse.y" - { - if (!is_local_id((yyvsp[(1) - (3)].id))) - yyerror("formal argument must be local variable"); - else if (local_id((yyvsp[(1) - (3)].id))) - yyerror("duplicate optional argument name"); - (yyval.node) = assignable((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].node)); - } - break; - - case 458: -#line 2327 "parse.y" - { - (yyval.node) = NEW_BLOCK((yyvsp[(1) - (1)].node)); - (yyval.node)->nd_end = (yyval.node); - } - break; - - case 459: -#line 2332 "parse.y" - { - (yyval.node) = block_append((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 462: -#line 2342 "parse.y" - { - if (!is_local_id((yyvsp[(2) - (2)].id))) - yyerror("rest argument must be local variable"); - else if (local_id((yyvsp[(2) - (2)].id))) - yyerror("duplicate rest argument name"); - if (dyna_in_block()) { - rb_dvar_push((yyvsp[(2) - (2)].id), Qnil); - } - (yyval.node) = assignable((yyvsp[(2) - (2)].id), 0); - } - break; - - case 463: -#line 2353 "parse.y" - { - if (dyna_in_block()) { - (yyval.node) = NEW_DASGN_CURR(internal_id(), 0); - } - else { - (yyval.node) = NEW_NODE(NODE_LASGN,0,0,local_append(0)); - } - } - break; - - case 466: -#line 2368 "parse.y" - { - if (!is_local_id((yyvsp[(2) - (2)].id))) - yyerror("block argument must be local variable"); - else if (local_id((yyvsp[(2) - (2)].id))) - yyerror("duplicate block argument name"); - (yyval.node) = NEW_BLOCK_ARG((yyvsp[(2) - (2)].id)); - } - break; - - case 467: -#line 2378 "parse.y" - { - (yyval.node) = (yyvsp[(2) - (2)].node); - } - break; - - case 469: -#line 2385 "parse.y" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - value_expr((yyval.node)); - } - break; - - case 470: -#line 2389 "parse.y" - {lex_state = EXPR_BEG;} - break; - - case 471: -#line 2390 "parse.y" - { - if ((yyvsp[(3) - (5)].node) == 0) { - yyerror("can't define singleton method for ()."); - } - else { - switch (nd_type((yyvsp[(3) - (5)].node))) { - case NODE_STR: - case NODE_DSTR: - case NODE_XSTR: - case NODE_DXSTR: - case NODE_DREGX: - case NODE_LIT: - case NODE_ARRAY: - case NODE_ZARRAY: - yyerror("can't define singleton method for literals"); - default: - value_expr((yyvsp[(3) - (5)].node)); - break; - } - } - (yyval.node) = (yyvsp[(3) - (5)].node); - } - break; - - case 473: -#line 2416 "parse.y" - { - (yyval.node) = (yyvsp[(1) - (2)].node); - } - break; - - case 474: -#line 2420 "parse.y" - { - if ((yyvsp[(1) - (2)].node)->nd_alen%2 != 0) { - yyerror("odd number list for Hash"); - } - (yyval.node) = (yyvsp[(1) - (2)].node); - } - break; - - case 476: -#line 2430 "parse.y" - { - (yyval.node) = list_concat((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 477: -#line 2436 "parse.y" - { - (yyval.node) = list_append(NEW_LIST((yyvsp[(1) - (3)].node)), (yyvsp[(3) - (3)].node)); - } - break; - - case 497: -#line 2474 "parse.y" - {yyerrok;} - break; - - case 500: -#line 2479 "parse.y" - {yyerrok;} - break; - - case 501: -#line 2482 "parse.y" - {(yyval.node) = 0;} - break; - - -/* Line 1267 of yacc.c. */ -#line 7259 "parse.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -#line 2484 "parse.y" - -#ifdef yystacksize -#undef YYMALLOC -#endif - -#include "regex.h" -#include "util.h" - -/* We remove any previous definition of `SIGN_EXTEND_CHAR', - since ours (we hope) works properly with all combinations of - machines, compilers, `char' and `unsigned char' argument types. - (Per Bothner suggested the basic approach.) */ -#undef SIGN_EXTEND_CHAR -#if __STDC__ -# define SIGN_EXTEND_CHAR(c) ((signed char)(c)) -#else /* not __STDC__ */ -/* As in Harbison and Steele. */ -# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128) -#endif -#define is_identchar(c) (SIGN_EXTEND_CHAR(c)!=-1&&(ISALNUM(c) || (c) == '_' || ismbchar(c))) - -static char *tokenbuf = NULL; -static int tokidx, toksiz = 0; - -#define LEAVE_BS 1 - -static VALUE (*lex_gets)(); /* gets function */ -static VALUE lex_input; /* non-nil if File */ -static VALUE lex_lastline; /* gc protect */ -static char *lex_pbeg; -static char *lex_p; -static char *lex_pend; - -static int -yyerror(msg) - const char *msg; -{ - const int max_line_margin = 30; - const char *p, *pe; - char *buf; - int len, i; - - rb_compile_error("%s", msg); - p = lex_p; - while (lex_pbeg <= p) { - if (*p == '\n') break; - p--; - } - p++; - - pe = lex_p; - while (pe < lex_pend) { - if (*pe == '\n') break; - pe++; - } - - len = pe - p; - if (len > 4) { - char *p2; - const char *pre = "", *post = ""; - - if (len > max_line_margin * 2 + 10) { - int re_mbc_startpos _((const char *, int, int, int)); - if ((len = lex_p - p) > max_line_margin) { - p = p + re_mbc_startpos(p, len, len - max_line_margin, 0); - pre = "..."; - } - if ((len = pe - lex_p) > max_line_margin) { - pe = lex_p + re_mbc_startpos(lex_p, len, max_line_margin, 1); - post = "..."; - } - len = pe - p; - } - buf = ALLOCA_N(char, len+2); - MEMCPY(buf, p, char, len); - buf[len] = '\0'; - rb_compile_error_append("%s%s%s", pre, buf, post); - - i = lex_p - p; - p2 = buf; pe = buf + len; - - while (p2 < pe) { - if (*p2 != '\t') *p2 = ' '; - p2++; - } - buf[i] = '^'; - buf[i+1] = '\0'; - rb_compile_error_append("%s", buf); - } - - return 0; -} - -static int heredoc_end; - -int ruby_in_compile = 0; -int ruby__end__seen; - -static VALUE ruby_debug_lines; -#ifdef YYMALLOC -static NODE *parser_heap; -#endif - -static NODE* -yycompile(f, line) - char *f; - int line; -{ - int n; - NODE *node = 0; - struct RVarmap *vp, *vars = ruby_dyna_vars; - - ruby_in_compile = 1; - if (!compile_for_eval && rb_safe_level() == 0 && - rb_const_defined(rb_cObject, rb_intern("SCRIPT_LINES__"))) { - VALUE hash, fname; - - hash = rb_const_get(rb_cObject, rb_intern("SCRIPT_LINES__")); - if (TYPE(hash) == T_HASH) { - fname = rb_str_new2(f); - ruby_debug_lines = rb_ary_new(); - rb_hash_aset(hash, fname, ruby_debug_lines); - } - if (line > 1) { - VALUE str = rb_str_new(0,0); - while (line > 1) { - rb_ary_push(ruby_debug_lines, str); - line--; - } - } - } - - ruby__end__seen = 0; - ruby_eval_tree = 0; - ruby_eval_tree_begin = 0; - heredoc_end = 0; - lex_strterm = 0; - ruby_current_node = 0; - ruby_sourcefile = rb_source_filename(f); - deferred_nodes = 0; - n = yyparse(); - ruby_debug_lines = 0; - compile_for_eval = 0; - ruby_in_compile = 0; - cond_stack = 0; - cmdarg_stack = 0; - command_start = 1; - class_nest = 0; - in_single = 0; - in_def = 0; - cur_mid = 0; - deferred_nodes = 0; - - vp = ruby_dyna_vars; - ruby_dyna_vars = vars; - lex_strterm = 0; - while (vp && vp != vars) { - struct RVarmap *tmp = vp; - vp = vp->next; - rb_gc_force_recycle((VALUE)tmp); - } - if (n == 0) node = ruby_eval_tree; - if (ruby_nerrs) ruby_eval_tree_begin = 0; - return node; -} - -static int lex_gets_ptr; - -static VALUE -lex_get_str(s) - VALUE s; -{ - char *beg, *end, *pend; - - beg = RSTRING(s)->ptr; - if (lex_gets_ptr) { - if (RSTRING(s)->len == lex_gets_ptr) return Qnil; - beg += lex_gets_ptr; - } - pend = RSTRING(s)->ptr + RSTRING(s)->len; - end = beg; - while (end < pend) { - if (*end++ == '\n') break; - } - lex_gets_ptr = end - RSTRING(s)->ptr; - return rb_str_new(beg, end - beg); -} - -static VALUE -lex_getline() -{ - VALUE line = (*lex_gets)(lex_input); - if (ruby_debug_lines && !NIL_P(line)) { - rb_ary_push(ruby_debug_lines, line); - } - return line; -} - -NODE* -rb_compile_string(f, s, line) - const char *f; - VALUE s; - int line; -{ - lex_gets = lex_get_str; - lex_gets_ptr = 0; - lex_input = s; - lex_pbeg = lex_p = lex_pend = 0; - ruby_sourceline = line - 1; - compile_for_eval = ruby_in_eval; - - return yycompile(f, line); -} - -NODE* -rb_compile_cstr(f, s, len, line) - const char *f, *s; - int len, line; -{ - return rb_compile_string(f, rb_str_new(s, len), line); -} - -NODE* -rb_compile_file(f, file, start) - const char *f; - VALUE file; - int start; -{ - lex_gets = rb_io_gets; - lex_input = file; - lex_pbeg = lex_p = lex_pend = 0; - ruby_sourceline = start - 1; - - return yycompile(f, start); -} - -static inline int -nextc() -{ - int c; - - if (lex_p == lex_pend) { - if (lex_input) { - VALUE v = lex_getline(); - - if (NIL_P(v)) return -1; - if (heredoc_end > 0) { - ruby_sourceline = heredoc_end; - heredoc_end = 0; - } - ruby_sourceline++; - lex_pbeg = lex_p = RSTRING(v)->ptr; - lex_pend = lex_p + RSTRING(v)->len; - lex_lastline = v; - } - else { - lex_lastline = 0; - return -1; - } - } - c = (unsigned char)*lex_p++; - if (c == '\r' && lex_p < lex_pend && *lex_p == '\n') { - lex_p++; - c = '\n'; - } - - return c; -} - -static void -pushback(c) - int c; -{ - if (c == -1) return; - lex_p--; -} - -#define was_bol() (lex_p == lex_pbeg + 1) -#define peek(c) (lex_p != lex_pend && (c) == *lex_p) - -#define tokfix() (tokenbuf[tokidx]='\0') -#define tok() tokenbuf -#define toklen() tokidx -#define toklast() (tokidx>0?tokenbuf[tokidx-1]:0) - -static char* -newtok() -{ - tokidx = 0; - if (!tokenbuf) { - toksiz = 60; - tokenbuf = ALLOC_N(char, 60); - } - if (toksiz > 4096) { - toksiz = 60; - REALLOC_N(tokenbuf, char, 60); - } - return tokenbuf; -} - -static void -tokadd(c) - char c; -{ - tokenbuf[tokidx++] = c; - if (tokidx >= toksiz) { - toksiz *= 2; - REALLOC_N(tokenbuf, char, toksiz); - } -} - -static int -read_escape() -{ - int c; - - switch (c = nextc()) { - case '\\': /* Backslash */ - return c; - - case 'n': /* newline */ - return '\n'; - - case 't': /* horizontal tab */ - return '\t'; - - case 'r': /* carriage-return */ - return '\r'; - - case 'f': /* form-feed */ - return '\f'; - - case 'v': /* vertical tab */ - return '\13'; - - case 'a': /* alarm(bell) */ - return '\007'; - - case 'e': /* escape */ - return 033; - - case '0': case '1': case '2': case '3': /* octal constant */ - case '4': case '5': case '6': case '7': - { - int numlen; - - pushback(c); - c = scan_oct(lex_p, 3, &numlen); - lex_p += numlen; - } - return c; - - case 'x': /* hex constant */ - { - int numlen; - - c = scan_hex(lex_p, 2, &numlen); - if (numlen == 0) { - yyerror("Invalid escape character syntax"); - return 0; - } - lex_p += numlen; - } - return c; - - case 'b': /* backspace */ - return '\010'; - - case 's': /* space */ - return ' '; - - case 'M': - if ((c = nextc()) != '-') { - yyerror("Invalid escape character syntax"); - pushback(c); - return '\0'; - } - if ((c = nextc()) == '\\') { - return read_escape() | 0x80; - } - else if (c == -1) goto eof; - else { - return ((c & 0xff) | 0x80); - } - - case 'C': - if ((c = nextc()) != '-') { - yyerror("Invalid escape character syntax"); - pushback(c); - return '\0'; - } - case 'c': - if ((c = nextc())== '\\') { - c = read_escape(); - } - else if (c == '?') - return 0177; - else if (c == -1) goto eof; - return c & 0x9f; - - eof: - case -1: - yyerror("Invalid escape character syntax"); - return '\0'; - - default: - return c; - } -} - -static int -tokadd_escape(term) - int term; -{ - int c; - - switch (c = nextc()) { - case '\n': - return 0; /* just ignore */ - - case '0': case '1': case '2': case '3': /* octal constant */ - case '4': case '5': case '6': case '7': - { - int i; - - tokadd('\\'); - tokadd(c); - for (i=0; i<2; i++) { - c = nextc(); - if (c == -1) goto eof; - if (c < '0' || '7' < c) { - pushback(c); - break; - } - tokadd(c); - } - } - return 0; - - case 'x': /* hex constant */ - { - int numlen; - - tokadd('\\'); - tokadd(c); - scan_hex(lex_p, 2, &numlen); - if (numlen == 0) { - yyerror("Invalid escape character syntax"); - return -1; - } - while (numlen--) - tokadd(nextc()); - } - return 0; - - case 'M': - if ((c = nextc()) != '-') { - yyerror("Invalid escape character syntax"); - pushback(c); - return 0; - } - tokadd('\\'); tokadd('M'); tokadd('-'); - goto escaped; - - case 'C': - if ((c = nextc()) != '-') { - yyerror("Invalid escape character syntax"); - pushback(c); - return 0; - } - tokadd('\\'); tokadd('C'); tokadd('-'); - goto escaped; - - case 'c': - tokadd('\\'); tokadd('c'); - escaped: - if ((c = nextc()) == '\\') { - return tokadd_escape(term); - } - else if (c == -1) goto eof; - tokadd(c); - return 0; - - eof: - case -1: - yyerror("Invalid escape character syntax"); - return -1; - - default: - if (c != '\\' || c != term) - tokadd('\\'); - tokadd(c); - } - return 0; -} - -static int -regx_options() -{ - char kcode = 0; - int options = 0; - int c; - - newtok(); - while (c = nextc(), ISALPHA(c)) { - switch (c) { - case 'i': - options |= RE_OPTION_IGNORECASE; - break; - case 'x': - options |= RE_OPTION_EXTENDED; - break; - case 'm': - options |= RE_OPTION_MULTILINE; - break; - case 'o': - options |= RE_OPTION_ONCE; - break; - case 'n': - kcode = 16; - break; - case 'e': - kcode = 32; - break; - case 's': - kcode = 48; - break; - case 'u': - kcode = 64; - break; - default: - tokadd(c); - break; - } - } - pushback(c); - if (toklen()) { - tokfix(); - rb_compile_error("unknown regexp option%s - %s", - toklen() > 1 ? "s" : "", tok()); - } - return options | kcode; -} - -#define STR_FUNC_ESCAPE 0x01 -#define STR_FUNC_EXPAND 0x02 -#define STR_FUNC_REGEXP 0x04 -#define STR_FUNC_QWORDS 0x08 -#define STR_FUNC_SYMBOL 0x10 -#define STR_FUNC_INDENT 0x20 - -enum string_type { - str_squote = (0), - str_dquote = (STR_FUNC_EXPAND), - str_xquote = (STR_FUNC_EXPAND), - str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND), - str_sword = (STR_FUNC_QWORDS), - str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND), - str_ssym = (STR_FUNC_SYMBOL), - str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND), -}; - -static void -dispose_string(str) - VALUE str; -{ - xfree(RSTRING(str)->ptr); - rb_gc_force_recycle(str); -} - -static int -tokadd_string(func, term, paren, nest) - int func, term, paren, *nest; -{ - int c; - - while ((c = nextc()) != -1) { - if (paren && c == paren) { - ++*nest; - } - else if (c == term) { - if (!nest || !*nest) { - pushback(c); - break; - } - --*nest; - } - else if ((func & STR_FUNC_EXPAND) && c == '#' && lex_p < lex_pend) { - int c2 = *lex_p; - if (c2 == '$' || c2 == '@' || c2 == '{') { - pushback(c); - break; - } - } - else if (c == '\\') { - c = nextc(); - switch (c) { - case '\n': - if (func & STR_FUNC_QWORDS) break; - if (func & STR_FUNC_EXPAND) continue; - tokadd('\\'); - break; - - case '\\': - if (func & STR_FUNC_ESCAPE) tokadd(c); - break; - - default: - if (func & STR_FUNC_REGEXP) { - pushback(c); - if (tokadd_escape(term) < 0) - return -1; - continue; - } - else if (func & STR_FUNC_EXPAND) { - pushback(c); - if (func & STR_FUNC_ESCAPE) tokadd('\\'); - c = read_escape(); - } - else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) { - /* ignore backslashed spaces in %w */ - } - else if (c != term && !(paren && c == paren)) { - tokadd('\\'); - } - } - } - else if (ismbchar(c)) { - int i, len = mbclen(c)-1; - - for (i = 0; i < len; i++) { - tokadd(c); - c = nextc(); - } - } - else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) { - pushback(c); - break; - } - if (!c && (func & STR_FUNC_SYMBOL)) { - func &= ~STR_FUNC_SYMBOL; - rb_compile_error("symbol cannot contain '\\0'"); - continue; - } - tokadd(c); - } - return c; -} - -#define NEW_STRTERM(func, term, paren) \ - rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0) - -static int -parse_string(quote) - NODE *quote; -{ - int func = quote->nd_func; - int term = nd_term(quote); - int paren = nd_paren(quote); - int c, space = 0; - - if (func == -1) return tSTRING_END; - c = nextc(); - if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) { - do {c = nextc();} while (ISSPACE(c)); - space = 1; - } - if (c == term && !quote->nd_nest) { - if (func & STR_FUNC_QWORDS) { - quote->nd_func = -1; - return ' '; - } - if (!(func & STR_FUNC_REGEXP)) return tSTRING_END; - yylval.num = regx_options(); - return tREGEXP_END; - } - if (space) { - pushback(c); - return ' '; - } - newtok(); - if ((func & STR_FUNC_EXPAND) && c == '#') { - switch (c = nextc()) { - case '$': - case '@': - pushback(c); - return tSTRING_DVAR; - case '{': - return tSTRING_DBEG; - } - tokadd('#'); - } - pushback(c); - if (tokadd_string(func, term, paren, "e->nd_nest) == -1) { - ruby_sourceline = nd_line(quote); - rb_compile_error("unterminated string meets end of file"); - return tSTRING_END; - } - - tokfix(); - yylval.node = NEW_STR(rb_str_new(tok(), toklen())); - return tSTRING_CONTENT; -} - -static int -heredoc_identifier() -{ - int c = nextc(), term, func = 0, len; - - if (c == '-') { - c = nextc(); - func = STR_FUNC_INDENT; - } - switch (c) { - case '\'': - func |= str_squote; goto quoted; - case '"': - func |= str_dquote; goto quoted; - case '`': - func |= str_xquote; - quoted: - newtok(); - tokadd(func); - term = c; - while ((c = nextc()) != -1 && c != term) { - len = mbclen(c); - do {tokadd(c);} while (--len > 0 && (c = nextc()) != -1); - } - if (c == -1) { - rb_compile_error("unterminated here document identifier"); - return 0; - } - break; - - default: - if (!is_identchar(c)) { - pushback(c); - if (func & STR_FUNC_INDENT) { - pushback('-'); - } - return 0; - } - newtok(); - term = '"'; - tokadd(func |= str_dquote); - do { - len = mbclen(c); - do {tokadd(c);} while (--len > 0 && (c = nextc()) != -1); - } while ((c = nextc()) != -1 && is_identchar(c)); - pushback(c); - break; - } - - tokfix(); - len = lex_p - lex_pbeg; - lex_p = lex_pend; - lex_strterm = rb_node_newnode(NODE_HEREDOC, - rb_str_new(tok(), toklen()), /* nd_lit */ - len, /* nd_nth */ - lex_lastline); /* nd_orig */ - return term == '`' ? tXSTRING_BEG : tSTRING_BEG; -} - -static void -heredoc_restore(here) - NODE *here; -{ - VALUE line = here->nd_orig; - lex_lastline = line; - lex_pbeg = RSTRING(line)->ptr; - lex_pend = lex_pbeg + RSTRING(line)->len; - lex_p = lex_pbeg + here->nd_nth; - heredoc_end = ruby_sourceline; - ruby_sourceline = nd_line(here); - dispose_string(here->nd_lit); - rb_gc_force_recycle((VALUE)here); -} - -static int -whole_match_p(eos, len, indent) - char *eos; - int len, indent; -{ - char *p = lex_pbeg; - int n; - - if (indent) { - while (*p && ISSPACE(*p)) p++; - } - n= lex_pend - (p + len); - if (n < 0 || (n > 0 && p[len] != '\n' && p[len] != '\r')) return Qfalse; - if (strncmp(eos, p, len) == 0) return Qtrue; - return Qfalse; -} - -static int -here_document(here) - NODE *here; -{ - int c, func, indent = 0; - char *eos, *p, *pend; - long len; - VALUE str = 0; - - eos = RSTRING(here->nd_lit)->ptr; - len = RSTRING(here->nd_lit)->len - 1; - indent = (func = *eos++) & STR_FUNC_INDENT; - - if ((c = nextc()) == -1) { - error: - rb_compile_error("can't find string \"%s\" anywhere before EOF", eos); - heredoc_restore(lex_strterm); - lex_strterm = 0; - return 0; - } - if (was_bol() && whole_match_p(eos, len, indent)) { - heredoc_restore(lex_strterm); - return tSTRING_END; - } - - if (!(func & STR_FUNC_EXPAND)) { - do { - p = RSTRING(lex_lastline)->ptr; - pend = lex_pend; - if (pend > p) { - switch (pend[-1]) { - case '\n': - if (--pend == p || pend[-1] != '\r') { - pend++; - break; - } - case '\r': - --pend; - } - } - if (str) - rb_str_cat(str, p, pend - p); - else - str = rb_str_new(p, pend - p); - if (pend < lex_pend) rb_str_cat(str, "\n", 1); - lex_p = lex_pend; - if (nextc() == -1) { - if (str) dispose_string(str); - goto error; - } - } while (!whole_match_p(eos, len, indent)); - } - else { - newtok(); - if (c == '#') { - switch (c = nextc()) { - case '$': - case '@': - pushback(c); - return tSTRING_DVAR; - case '{': - return tSTRING_DBEG; - } - tokadd('#'); - } - do { - pushback(c); - if ((c = tokadd_string(func, '\n', 0, NULL)) == -1) goto error; - if (c != '\n') { - yylval.node = NEW_STR(rb_str_new(tok(), toklen())); - return tSTRING_CONTENT; - } - tokadd(nextc()); - if ((c = nextc()) == -1) goto error; - } while (!whole_match_p(eos, len, indent)); - str = rb_str_new(tok(), toklen()); - } - heredoc_restore(lex_strterm); - lex_strterm = NEW_STRTERM(-1, 0, 0); - yylval.node = NEW_STR(str); - return tSTRING_CONTENT; -} - -#include "lex.c" - -static void -arg_ambiguous() -{ - rb_warning("ambiguous first argument; put parentheses or even spaces"); -} - -#define IS_ARG() (lex_state == EXPR_ARG || lex_state == EXPR_CMDARG) -#define IS_BEG() (lex_state == EXPR_BEG || lex_state == EXPR_MID || lex_state == EXPR_CLASS) - -static int -yylex() -{ - register int c; - int space_seen = 0; - int cmd_state; - enum lex_state last_state; - - if (lex_strterm) { - int token; - if (nd_type(lex_strterm) == NODE_HEREDOC) { - token = here_document(lex_strterm); - if (token == tSTRING_END) { - lex_strterm = 0; - lex_state = EXPR_END; - } - } - else { - token = parse_string(lex_strterm); - if (token == tSTRING_END || token == tREGEXP_END) { - rb_gc_force_recycle((VALUE)lex_strterm); - lex_strterm = 0; - lex_state = EXPR_END; - } - } - return token; - } - cmd_state = command_start; - command_start = Qfalse; - retry: - switch (c = nextc()) { - case '\0': /* NUL */ - case '\004': /* ^D */ - case '\032': /* ^Z */ - case -1: /* end of script. */ - return 0; - - /* white spaces */ - case ' ': case '\t': case '\f': case '\r': - case '\13': /* '\v' */ - space_seen++; - goto retry; - - case '#': /* it's a comment */ - while ((c = nextc()) != '\n') { - if (c == -1) - return 0; - } - /* fall through */ - case '\n': - switch (lex_state) { - case EXPR_BEG: - case EXPR_FNAME: - case EXPR_DOT: - case EXPR_CLASS: - goto retry; - default: - break; - } - command_start = Qtrue; - lex_state = EXPR_BEG; - return '\n'; - - case '*': - if ((c = nextc()) == '*') { - if ((c = nextc()) == '=') { - yylval.id = tPOW; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - pushback(c); - c = tPOW; - } - else { - if (c == '=') { - yylval.id = '*'; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - pushback(c); - if (IS_ARG() && space_seen && !ISSPACE(c)){ - rb_warning("`*' interpreted as argument prefix"); - c = tSTAR; - } - else if (IS_BEG()) { - c = tSTAR; - } - else { - c = '*'; - } - } - switch (lex_state) { - case EXPR_FNAME: case EXPR_DOT: - lex_state = EXPR_ARG; break; - default: - lex_state = EXPR_BEG; break; - } - return c; - - case '!': - lex_state = EXPR_BEG; - if ((c = nextc()) == '=') { - return tNEQ; - } - if (c == '~') { - return tNMATCH; - } - pushback(c); - return '!'; - - case '=': - if (was_bol()) { - /* skip embedded rd document */ - if (strncmp(lex_p, "begin", 5) == 0 && ISSPACE(lex_p[5])) { - for (;;) { - lex_p = lex_pend; - c = nextc(); - if (c == -1) { - rb_compile_error("embedded document meets end of file"); - return 0; - } - if (c != '=') continue; - if (strncmp(lex_p, "end", 3) == 0 && - (lex_p + 3 == lex_pend || ISSPACE(lex_p[3]))) { - break; - } - } - lex_p = lex_pend; - goto retry; - } - } - - switch (lex_state) { - case EXPR_FNAME: case EXPR_DOT: - lex_state = EXPR_ARG; break; - default: - lex_state = EXPR_BEG; break; - } - if ((c = nextc()) == '=') { - if ((c = nextc()) == '=') { - return tEQQ; - } - pushback(c); - return tEQ; - } - if (c == '~') { - return tMATCH; - } - else if (c == '>') { - return tASSOC; - } - pushback(c); - return '='; - - case '<': - c = nextc(); - if (c == '<' && - lex_state != EXPR_END && - lex_state != EXPR_DOT && - lex_state != EXPR_ENDARG && - lex_state != EXPR_CLASS && - (!IS_ARG() || space_seen)) { - int token = heredoc_identifier(); - if (token) return token; - } - switch (lex_state) { - case EXPR_FNAME: case EXPR_DOT: - lex_state = EXPR_ARG; break; - default: - lex_state = EXPR_BEG; break; - } - if (c == '=') { - if ((c = nextc()) == '>') { - return tCMP; - } - pushback(c); - return tLEQ; - } - if (c == '<') { - if ((c = nextc()) == '=') { - yylval.id = tLSHFT; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - pushback(c); - return tLSHFT; - } - pushback(c); - return '<'; - - case '>': - switch (lex_state) { - case EXPR_FNAME: case EXPR_DOT: - lex_state = EXPR_ARG; break; - default: - lex_state = EXPR_BEG; break; - } - if ((c = nextc()) == '=') { - return tGEQ; - } - if (c == '>') { - if ((c = nextc()) == '=') { - yylval.id = tRSHFT; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - pushback(c); - return tRSHFT; - } - pushback(c); - return '>'; - - case '"': - lex_strterm = NEW_STRTERM(str_dquote, '"', 0); - return tSTRING_BEG; - - case '`': - if (lex_state == EXPR_FNAME) { - lex_state = EXPR_END; - return c; - } - if (lex_state == EXPR_DOT) { - if (cmd_state) - lex_state = EXPR_CMDARG; - else - lex_state = EXPR_ARG; - return c; - } - lex_strterm = NEW_STRTERM(str_xquote, '`', 0); - return tXSTRING_BEG; - - case '\'': - lex_strterm = NEW_STRTERM(str_squote, '\'', 0); - return tSTRING_BEG; - - case '?': - if (lex_state == EXPR_END || lex_state == EXPR_ENDARG) { - lex_state = EXPR_BEG; - return '?'; - } - c = nextc(); - if (c == -1) { - rb_compile_error("incomplete character syntax"); - return 0; - } - if (ISSPACE(c)){ - if (!IS_ARG()){ - int c2 = 0; - switch (c) { - case ' ': - c2 = 's'; - break; - case '\n': - c2 = 'n'; - break; - case '\t': - c2 = 't'; - break; - case '\v': - c2 = 'v'; - break; - case '\r': - c2 = 'r'; - break; - case '\f': - c2 = 'f'; - break; - } - if (c2) { - rb_warn("invalid character syntax; use ?\\%c", c2); - } - } - ternary: - pushback(c); - lex_state = EXPR_BEG; - return '?'; - } - else if (ismbchar(c)) { - rb_warn("multibyte character literal not supported yet; use ?\\%.3o", c); - goto ternary; - } - else if ((ISALNUM(c) || c == '_') && lex_p < lex_pend && is_identchar(*lex_p)) { - goto ternary; - } - else if (c == '\\') { - c = read_escape(); - } - c &= 0xff; - lex_state = EXPR_END; - yylval.node = NEW_LIT(INT2FIX(c)); - return tINTEGER; - - case '&': - if ((c = nextc()) == '&') { - lex_state = EXPR_BEG; - if ((c = nextc()) == '=') { - yylval.id = tANDOP; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - pushback(c); - return tANDOP; - } - else if (c == '=') { - yylval.id = '&'; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - pushback(c); - if (IS_ARG() && space_seen && !ISSPACE(c)){ - rb_warning("`&' interpreted as argument prefix"); - c = tAMPER; - } - else if (IS_BEG()) { - c = tAMPER; - } - else { - c = '&'; - } - switch (lex_state) { - case EXPR_FNAME: case EXPR_DOT: - lex_state = EXPR_ARG; break; - default: - lex_state = EXPR_BEG; - } - return c; - - case '|': - if ((c = nextc()) == '|') { - lex_state = EXPR_BEG; - if ((c = nextc()) == '=') { - yylval.id = tOROP; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - pushback(c); - return tOROP; - } - if (c == '=') { - yylval.id = '|'; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) { - lex_state = EXPR_ARG; - } - else { - lex_state = EXPR_BEG; - } - pushback(c); - return '|'; - - case '+': - c = nextc(); - if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) { - lex_state = EXPR_ARG; - if (c == '@') { - return tUPLUS; - } - pushback(c); - return '+'; - } - if (c == '=') { - yylval.id = '+'; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - if (IS_BEG() || - (IS_ARG() && space_seen && !ISSPACE(c))) { - if (IS_ARG()) arg_ambiguous(); - lex_state = EXPR_BEG; - pushback(c); - if (ISDIGIT(c)) { - c = '+'; - goto start_num; - } - return tUPLUS; - } - lex_state = EXPR_BEG; - pushback(c); - return '+'; - - case '-': - c = nextc(); - if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) { - lex_state = EXPR_ARG; - if (c == '@') { - return tUMINUS; - } - pushback(c); - return '-'; - } - if (c == '=') { - yylval.id = '-'; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - if (IS_BEG() || - (IS_ARG() && space_seen && !ISSPACE(c))) { - if (IS_ARG()) arg_ambiguous(); - lex_state = EXPR_BEG; - pushback(c); - if (ISDIGIT(c)) { - return tUMINUS_NUM; - } - return tUMINUS; - } - lex_state = EXPR_BEG; - pushback(c); - return '-'; - - case '.': - lex_state = EXPR_BEG; - if ((c = nextc()) == '.') { - if ((c = nextc()) == '.') { - return tDOT3; - } - pushback(c); - return tDOT2; - } - pushback(c); - if (ISDIGIT(c)) { - yyerror("no . floating literal anymore; put 0 before dot"); - } - lex_state = EXPR_DOT; - return '.'; - - start_num: - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - { - int is_float, seen_point, seen_e, nondigit; - - is_float = seen_point = seen_e = nondigit = 0; - lex_state = EXPR_END; - newtok(); - if (c == '-' || c == '+') { - tokadd(c); - c = nextc(); - } - if (c == '0') { - int start = toklen(); - c = nextc(); - if (c == 'x' || c == 'X') { - /* hexadecimal */ - c = nextc(); - if (ISXDIGIT(c)) { - do { - if (c == '_') { - if (nondigit) break; - nondigit = c; - continue; - } - if (!ISXDIGIT(c)) break; - nondigit = 0; - tokadd(c); - } while ((c = nextc()) != -1); - } - pushback(c); - tokfix(); - if (toklen() == start) { - yyerror("numeric literal without digits"); - } - else if (nondigit) goto trailing_uc; - yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 16, Qfalse)); - return tINTEGER; - } - if (c == 'b' || c == 'B') { - /* binary */ - c = nextc(); - if (c == '0' || c == '1') { - do { - if (c == '_') { - if (nondigit) break; - nondigit = c; - continue; - } - if (c != '0' && c != '1') break; - nondigit = 0; - tokadd(c); - } while ((c = nextc()) != -1); - } - pushback(c); - tokfix(); - if (toklen() == start) { - yyerror("numeric literal without digits"); - } - else if (nondigit) goto trailing_uc; - yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 2, Qfalse)); - return tINTEGER; - } - if (c == 'd' || c == 'D') { - /* decimal */ - c = nextc(); - if (ISDIGIT(c)) { - do { - if (c == '_') { - if (nondigit) break; - nondigit = c; - continue; - } - if (!ISDIGIT(c)) break; - nondigit = 0; - tokadd(c); - } while ((c = nextc()) != -1); - } - pushback(c); - tokfix(); - if (toklen() == start) { - yyerror("numeric literal without digits"); - } - else if (nondigit) goto trailing_uc; - yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 10, Qfalse)); - return tINTEGER; - } - if (c == '_') { - /* 0_0 */ - goto octal_number; - } - if (c == 'o' || c == 'O') { - /* prefixed octal */ - c = nextc(); - if (c == '_') { - yyerror("numeric literal without digits"); - } - } - if (c >= '0' && c <= '7') { - /* octal */ - octal_number: - do { - if (c == '_') { - if (nondigit) break; - nondigit = c; - continue; - } - if (c < '0' || c > '9') break; - if (c > '7') goto invalid_octal; - nondigit = 0; - tokadd(c); - } while ((c = nextc()) != -1); - if (toklen() > start) { - pushback(c); - tokfix(); - if (nondigit) goto trailing_uc; - yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 8, Qfalse)); - return tINTEGER; - } - if (nondigit) { - pushback(c); - goto trailing_uc; - } - } - if (c > '7' && c <= '9') { - invalid_octal: - yyerror("Illegal octal digit"); - } - else if (c == '.' || c == 'e' || c == 'E') { - tokadd('0'); - } - else { - pushback(c); - yylval.node = NEW_LIT(INT2FIX(0)); - return tINTEGER; - } - } - - for (;;) { - switch (c) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - nondigit = 0; - tokadd(c); - break; - - case '.': - if (nondigit) goto trailing_uc; - if (seen_point || seen_e) { - goto decode_num; - } - else { - int c0 = nextc(); - if (!ISDIGIT(c0)) { - pushback(c0); - goto decode_num; - } - c = c0; - } - tokadd('.'); - tokadd(c); - is_float++; - seen_point++; - nondigit = 0; - break; - - case 'e': - case 'E': - if (nondigit) { - pushback(c); - c = nondigit; - goto decode_num; - } - if (seen_e) { - goto decode_num; - } - tokadd(c); - seen_e++; - is_float++; - nondigit = c; - c = nextc(); - if (c != '-' && c != '+') continue; - tokadd(c); - nondigit = c; - break; - - case '_': /* `_' in number just ignored */ - if (nondigit) goto decode_num; - nondigit = c; - break; - - default: - goto decode_num; - } - c = nextc(); - } - - decode_num: - pushback(c); - tokfix(); - if (nondigit) { - char tmp[30]; - trailing_uc: - sprintf(tmp, "trailing `%c' in number", nondigit); - yyerror(tmp); - } - if (is_float) { - double d = strtod(tok(), 0); - if (errno == ERANGE) { - rb_warn("Float %s out of range", tok()); - errno = 0; - } - yylval.node = NEW_LIT(rb_float_new(d)); - return tFLOAT; - } - yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 10, Qfalse)); - return tINTEGER; - } - - case ']': - case '}': - case ')': - COND_LEXPOP(); - CMDARG_LEXPOP(); - lex_state = EXPR_END; - return c; - - case ':': - c = nextc(); - if (c == ':') { - if (IS_BEG() || (IS_ARG() && space_seen)) { - lex_state = EXPR_BEG; - return tCOLON3; - } - lex_state = EXPR_DOT; - return tCOLON2; - } - if (lex_state == EXPR_END || lex_state == EXPR_ENDARG || ISSPACE(c)) { - pushback(c); - lex_state = EXPR_BEG; - return ':'; - } - switch (c) { - case '\'': - lex_strterm = NEW_STRTERM(str_ssym, c, 0); - break; - case '"': - lex_strterm = NEW_STRTERM(str_dsym, c, 0); - break; - default: - pushback(c); - break; - } - lex_state = EXPR_FNAME; - return tSYMBEG; - - case '/': - if (IS_BEG()) { - lex_strterm = NEW_STRTERM(str_regexp, '/', 0); - return tREGEXP_BEG; - } - if ((c = nextc()) == '=') { - yylval.id = '/'; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - pushback(c); - if (IS_ARG() && space_seen) { - if (!ISSPACE(c)) { - arg_ambiguous(); - lex_strterm = NEW_STRTERM(str_regexp, '/', 0); - return tREGEXP_BEG; - } - } - switch (lex_state) { - case EXPR_FNAME: case EXPR_DOT: - lex_state = EXPR_ARG; break; - default: - lex_state = EXPR_BEG; break; - } - return '/'; - - case '^': - if ((c = nextc()) == '=') { - yylval.id = '^'; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - switch (lex_state) { - case EXPR_FNAME: case EXPR_DOT: - lex_state = EXPR_ARG; break; - default: - lex_state = EXPR_BEG; break; - } - pushback(c); - return '^'; - - case ';': - command_start = Qtrue; - case ',': - lex_state = EXPR_BEG; - return c; - - case '~': - if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) { - if ((c = nextc()) != '@') { - pushback(c); - } - } - switch (lex_state) { - case EXPR_FNAME: case EXPR_DOT: - lex_state = EXPR_ARG; break; - default: - lex_state = EXPR_BEG; break; - } - return '~'; - - case '(': - command_start = Qtrue; - if (IS_BEG()) { - c = tLPAREN; - } - else if (space_seen) { - if (lex_state == EXPR_CMDARG) { - c = tLPAREN_ARG; - } - else if (lex_state == EXPR_ARG) { - rb_warn("don't put space before argument parentheses"); - c = '('; - } - } - COND_PUSH(0); - CMDARG_PUSH(0); - lex_state = EXPR_BEG; - return c; - - case '[': - if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) { - lex_state = EXPR_ARG; - if ((c = nextc()) == ']') { - if ((c = nextc()) == '=') { - return tASET; - } - pushback(c); - return tAREF; - } - pushback(c); - return '['; - } - else if (IS_BEG()) { - c = tLBRACK; - } - else if (IS_ARG() && space_seen) { - c = tLBRACK; - } - lex_state = EXPR_BEG; - COND_PUSH(0); - CMDARG_PUSH(0); - return c; - - case '{': - if (IS_ARG() || lex_state == EXPR_END) - c = '{'; /* block (primary) */ - else if (lex_state == EXPR_ENDARG) - c = tLBRACE_ARG; /* block (expr) */ - else - c = tLBRACE; /* hash */ - COND_PUSH(0); - CMDARG_PUSH(0); - lex_state = EXPR_BEG; - return c; - - case '\\': - c = nextc(); - if (c == '\n') { - space_seen = 1; - goto retry; /* skip \\n */ - } - pushback(c); - return '\\'; - - case '%': - if (IS_BEG()) { - int term; - int paren; - - c = nextc(); - quotation: - if (!ISALNUM(c)) { - term = c; - c = 'Q'; - } - else { - term = nextc(); - if (ISALNUM(term) || ismbchar(term)) { - yyerror("unknown type of %string"); - return 0; - } - } - if (c == -1 || term == -1) { - rb_compile_error("unterminated quoted string meets end of file"); - return 0; - } - paren = term; - if (term == '(') term = ')'; - else if (term == '[') term = ']'; - else if (term == '{') term = '}'; - else if (term == '<') term = '>'; - else paren = 0; - - switch (c) { - case 'Q': - lex_strterm = NEW_STRTERM(str_dquote, term, paren); - return tSTRING_BEG; - - case 'q': - lex_strterm = NEW_STRTERM(str_squote, term, paren); - return tSTRING_BEG; - - case 'W': - lex_strterm = NEW_STRTERM(str_dword, term, paren); - do {c = nextc();} while (ISSPACE(c)); - pushback(c); - return tWORDS_BEG; - - case 'w': - lex_strterm = NEW_STRTERM(str_sword, term, paren); - do {c = nextc();} while (ISSPACE(c)); - pushback(c); - return tQWORDS_BEG; - - case 'x': - lex_strterm = NEW_STRTERM(str_xquote, term, paren); - return tXSTRING_BEG; - - case 'r': - lex_strterm = NEW_STRTERM(str_regexp, term, paren); - return tREGEXP_BEG; - - case 's': - lex_strterm = NEW_STRTERM(str_ssym, term, paren); - lex_state = EXPR_FNAME; - return tSYMBEG; - - default: - yyerror("unknown type of %string"); - return 0; - } - } - if ((c = nextc()) == '=') { - yylval.id = '%'; - lex_state = EXPR_BEG; - return tOP_ASGN; - } - if (IS_ARG() && space_seen && !ISSPACE(c)) { - goto quotation; - } - switch (lex_state) { - case EXPR_FNAME: case EXPR_DOT: - lex_state = EXPR_ARG; break; - default: - lex_state = EXPR_BEG; break; - } - pushback(c); - return '%'; - - case '$': - last_state = lex_state; - lex_state = EXPR_END; - newtok(); - c = nextc(); - switch (c) { - case '_': /* $_: last read line string */ - c = nextc(); - if (is_identchar(c)) { - tokadd('$'); - tokadd('_'); - break; - } - pushback(c); - c = '_'; - /* fall through */ - case '~': /* $~: match-data */ - local_cnt(c); - /* fall through */ - case '*': /* $*: argv */ - case '$': /* $$: pid */ - case '?': /* $?: last status */ - case '!': /* $!: error string */ - case '@': /* $@: error position */ - case '/': /* $/: input record separator */ - case '\\': /* $\: output record separator */ - case ';': /* $;: field separator */ - case ',': /* $,: output field separator */ - case '.': /* $.: last read line number */ - case '=': /* $=: ignorecase */ - case ':': /* $:: load path */ - case '<': /* $<: reading filename */ - case '>': /* $>: default output handle */ - case '\"': /* $": already loaded files */ - tokadd('$'); - tokadd(c); - tokfix(); - yylval.id = rb_intern(tok()); - return tGVAR; - - case '-': - tokadd('$'); - tokadd(c); - c = nextc(); - if (is_identchar(c)) { - tokadd(c); - } - else { - pushback(c); - } - gvar: - tokfix(); - yylval.id = rb_intern(tok()); - /* xxx shouldn't check if valid option variable */ - return tGVAR; - - case '&': /* $&: last match */ - case '`': /* $`: string before last match */ - case '\'': /* $': string after last match */ - case '+': /* $+: string matches last paren. */ - if (last_state == EXPR_FNAME) { - tokadd('$'); - tokadd(c); - goto gvar; - } - yylval.node = NEW_BACK_REF(c); - return tBACK_REF; - - case '1': case '2': case '3': - case '4': case '5': case '6': - case '7': case '8': case '9': - tokadd('$'); - do { - tokadd(c); - c = nextc(); - } while (ISDIGIT(c)); - pushback(c); - if (last_state == EXPR_FNAME) goto gvar; - tokfix(); - yylval.node = NEW_NTH_REF(atoi(tok()+1)); - return tNTH_REF; - - default: - if (!is_identchar(c)) { - pushback(c); - return '$'; - } - case '0': - tokadd('$'); - } - break; - - case '@': - c = nextc(); - newtok(); - tokadd('@'); - if (c == '@') { - tokadd('@'); - c = nextc(); - } - if (ISDIGIT(c)) { - if (tokidx == 1) { - rb_compile_error("`@%c' is not allowed as an instance variable name", c); - } - else { - rb_compile_error("`@@%c' is not allowed as a class variable name", c); - } - return 0; - } - if (!is_identchar(c)) { - pushback(c); - return '@'; - } - break; - - case '_': - if (was_bol() && whole_match_p("__END__", 7, 0)) { - ruby__end__seen = 1; - lex_lastline = 0; - return -1; - } - newtok(); - break; - - default: - if (!is_identchar(c)) { - rb_compile_error("Invalid char `\\%03o' in expression", c); - goto retry; - } - - newtok(); - break; - } - - do { - tokadd(c); - if (ismbchar(c)) { - int i, len = mbclen(c)-1; - - for (i = 0; i < len; i++) { - c = nextc(); - tokadd(c); - } - } - c = nextc(); - } while (is_identchar(c)); - if ((c == '!' || c == '?') && is_identchar(tok()[0]) && !peek('=')) { - tokadd(c); - } - else { - pushback(c); - } - tokfix(); - - { - int result = 0; - - last_state = lex_state; - switch (tok()[0]) { - case '$': - lex_state = EXPR_END; - result = tGVAR; - break; - case '@': - lex_state = EXPR_END; - if (tok()[1] == '@') - result = tCVAR; - else - result = tIVAR; - break; - - default: - if (toklast() == '!' || toklast() == '?') { - result = tFID; - } - else { - if (lex_state == EXPR_FNAME) { - if ((c = nextc()) == '=' && !peek('~') && !peek('>') && - (!peek('=') || (lex_p + 1 < lex_pend && lex_p[1] == '>'))) { - result = tIDENTIFIER; - tokadd(c); - tokfix(); - } - else { - pushback(c); - } - } - if (result == 0 && ISUPPER(tok()[0])) { - result = tCONSTANT; - } - else { - result = tIDENTIFIER; - } - } - - if (lex_state != EXPR_DOT) { - struct kwtable *kw; - - /* See if it is a reserved word. */ - kw = rb_reserved_word(tok(), toklen()); - if (kw) { - enum lex_state state = lex_state; - lex_state = kw->state; - if (state == EXPR_FNAME) { - yylval.id = rb_intern(kw->name); - return kw->id[0]; - } - if (kw->id[0] == kDO) { - if (COND_P()) return kDO_COND; - if (CMDARG_P() && state != EXPR_CMDARG) - return kDO_BLOCK; - if (state == EXPR_ENDARG) - return kDO_BLOCK; - return kDO; - } - if (state == EXPR_BEG) - return kw->id[0]; - else { - if (kw->id[0] != kw->id[1]) - lex_state = EXPR_BEG; - return kw->id[1]; - } - } - } - - if (lex_state == EXPR_BEG || - lex_state == EXPR_MID || - lex_state == EXPR_DOT || - lex_state == EXPR_ARG || - lex_state == EXPR_CLASS || - lex_state == EXPR_CMDARG) { - if (cmd_state) { - lex_state = EXPR_CMDARG; - } - else { - lex_state = EXPR_ARG; - } - } - else { - lex_state = EXPR_END; - } - } - yylval.id = rb_intern(tok()); - if (is_local_id(yylval.id) && - last_state != EXPR_DOT && - ((dyna_in_block() && rb_dvar_defined(yylval.id)) || local_id(yylval.id))) { - lex_state = EXPR_END; - } - return result; - } -} - -NODE* -rb_node_newnode(type, a0, a1, a2) - enum node_type type; - VALUE a0, a1, a2; -{ - NODE *n = (NODE*)rb_newobj(); - - n->flags |= T_NODE; - nd_set_type(n, type); - nd_set_line(n, ruby_sourceline); - n->nd_file = ruby_sourcefile; - - n->u1.value = a0; - n->u2.value = a1; - n->u3.value = a2; - - return n; -} - -static enum node_type -nodetype(node) /* for debug */ - NODE *node; -{ - return (enum node_type)nd_type(node); -} - -static int -nodeline(node) - NODE *node; -{ - return nd_line(node); -} - -static NODE* -newline_node(node) - NODE *node; -{ - NODE *nl = 0; - if (node) { - int line; - if (nd_type(node) == NODE_NEWLINE) return node; - line = nd_line(node); - node = remove_begin(node); - nl = NEW_NEWLINE(node); - nd_set_line(nl, line); - nl->nd_nth = line; - } - return nl; -} - -static void -fixpos(node, orig) - NODE *node, *orig; -{ - if (!node) return; - if (!orig) return; - if (orig == (NODE*)1) return; - node->nd_file = orig->nd_file; - nd_set_line(node, nd_line(orig)); -} - -static void -parser_warning(node, mesg) - NODE *node; - const char *mesg; -{ - int line = ruby_sourceline; - ruby_sourceline = nd_line(node); - rb_warning("%s", mesg); - ruby_sourceline = line; -} - -static void -parser_warn(node, mesg) - NODE *node; - const char *mesg; -{ - int line = ruby_sourceline; - ruby_sourceline = nd_line(node); - rb_warn("%s", mesg); - ruby_sourceline = line; -} - -static NODE* -block_append(head, tail) - NODE *head, *tail; -{ - NODE *end, *h = head; - - if (tail == 0) return head; - - again: - if (h == 0) return tail; - switch (nd_type(h)) { - case NODE_NEWLINE: - h = h->nd_next; - goto again; - case NODE_LIT: - case NODE_STR: - parser_warning(h, "unused literal ignored"); - return tail; - default: - h = end = NEW_BLOCK(head); - end->nd_end = end; - fixpos(end, head); - head = end; - break; - case NODE_BLOCK: - end = h->nd_end; - break; - } - - if (RTEST(ruby_verbose)) { - NODE *nd = end->nd_head; - newline: - switch (nd_type(nd)) { - case NODE_RETURN: - case NODE_BREAK: - case NODE_NEXT: - case NODE_REDO: - case NODE_RETRY: - parser_warning(nd, "statement not reached"); - break; - - case NODE_NEWLINE: - nd = nd->nd_next; - goto newline; - - default: - break; - } - } - - if (nd_type(tail) != NODE_BLOCK) { - tail = NEW_BLOCK(tail); - tail->nd_end = tail; - } - end->nd_next = tail; - h->nd_end = tail->nd_end; - return head; -} - -/* append item to the list */ -static NODE* -list_append(list, item) - NODE *list, *item; -{ - NODE *last; - - if (list == 0) return NEW_LIST(item); - if (list->nd_next) { - last = list->nd_next->nd_end; - } - else { - last = list; - } - - list->nd_alen += 1; - last->nd_next = NEW_LIST(item); - list->nd_next->nd_end = last->nd_next; - return list; -} - -/* concat two lists */ -static NODE* -list_concat(head, tail) - NODE *head, *tail; -{ - NODE *last; - - if (head->nd_next) { - last = head->nd_next->nd_end; - } - else { - last = head; - } - - head->nd_alen += tail->nd_alen; - last->nd_next = tail; - if (tail->nd_next) { - head->nd_next->nd_end = tail->nd_next->nd_end; - } - else { - head->nd_next->nd_end = tail; - } - - return head; -} - -/* concat two string literals */ -static NODE * -literal_concat(head, tail) - NODE *head, *tail; -{ - enum node_type htype; - - if (!head) return tail; - if (!tail) return head; - - htype = nd_type(head); - if (htype == NODE_EVSTR) { - NODE *node = NEW_DSTR(rb_str_new(0, 0)); - head = list_append(node, head); - } - switch (nd_type(tail)) { - case NODE_STR: - if (htype == NODE_STR) { - rb_str_concat(head->nd_lit, tail->nd_lit); - rb_gc_force_recycle((VALUE)tail); - } - else { - list_append(head, tail); - } - break; - - case NODE_DSTR: - if (htype == NODE_STR) { - rb_str_concat(head->nd_lit, tail->nd_lit); - tail->nd_lit = head->nd_lit; - rb_gc_force_recycle((VALUE)head); - head = tail; - } - else { - nd_set_type(tail, NODE_ARRAY); - tail->nd_head = NEW_STR(tail->nd_lit); - list_concat(head, tail); - } - break; - - case NODE_EVSTR: - if (htype == NODE_STR) { - nd_set_type(head, NODE_DSTR); - head->nd_alen = 1; - } - list_append(head, tail); - break; - } - return head; -} - -static NODE * -evstr2dstr(node) - NODE *node; -{ - if (nd_type(node) == NODE_EVSTR) { - node = list_append(NEW_DSTR(rb_str_new(0, 0)), node); - } - return node; -} - -static NODE * -new_evstr(node) - NODE *node; -{ - NODE *head = node; - - again: - if (node) { - switch (nd_type(node)) { - case NODE_STR: case NODE_DSTR: case NODE_EVSTR: - return node; - case NODE_NEWLINE: - node = node->nd_next; - goto again; - } - } - return NEW_EVSTR(head); -} - -static NODE * -call_op(recv, id, narg, arg1) - NODE *recv; - ID id; - int narg; - NODE *arg1; -{ - value_expr(recv); - if (narg == 1) { - value_expr(arg1); - arg1 = NEW_LIST(arg1); - } - else { - arg1 = 0; - } - return NEW_CALL(recv, id, arg1); -} - -static NODE* -match_gen(node1, node2) - NODE *node1; - NODE *node2; -{ - local_cnt('~'); - - value_expr(node1); - value_expr(node2); - if (node1) { - switch (nd_type(node1)) { - case NODE_DREGX: - case NODE_DREGX_ONCE: - return NEW_MATCH2(node1, node2); - - case NODE_LIT: - if (TYPE(node1->nd_lit) == T_REGEXP) { - return NEW_MATCH2(node1, node2); - } - } - } - - if (node2) { - switch (nd_type(node2)) { - case NODE_DREGX: - case NODE_DREGX_ONCE: - return NEW_MATCH3(node2, node1); - - case NODE_LIT: - if (TYPE(node2->nd_lit) == T_REGEXP) { - return NEW_MATCH3(node2, node1); - } - } - } - - return NEW_CALL(node1, tMATCH, NEW_LIST(node2)); -} - -static NODE* -gettable(id) - ID id; -{ - if (id == kSELF) { - return NEW_SELF(); - } - else if (id == kNIL) { - return NEW_NIL(); - } - else if (id == kTRUE) { - return NEW_TRUE(); - } - else if (id == kFALSE) { - return NEW_FALSE(); - } - else if (id == k__FILE__) { - return NEW_STR(rb_str_new2(ruby_sourcefile)); - } - else if (id == k__LINE__) { - return NEW_LIT(INT2FIX(ruby_sourceline)); - } - else if (is_local_id(id)) { - if (dyna_in_block() && rb_dvar_defined(id)) return NEW_DVAR(id); - if (local_id(id)) return NEW_LVAR(id); - /* method call without arguments */ -#if 0 - /* Rite will warn this */ - rb_warn("ambiguous identifier; %s() or self.%s is better for method call", - rb_id2name(id), rb_id2name(id)); -#endif - return NEW_VCALL(id); - } - else if (is_global_id(id)) { - return NEW_GVAR(id); - } - else if (is_instance_id(id)) { - return NEW_IVAR(id); - } - else if (is_const_id(id)) { - return NEW_CONST(id); - } - else if (is_class_id(id)) { - return NEW_CVAR(id); - } - rb_compile_error("identifier %s is not valid", rb_id2name(id)); - return 0; -} - -static VALUE dyna_var_lookup _((ID id)); - -static NODE* -assignable(id, val) - ID id; - NODE *val; -{ - value_expr(val); - if (id == kSELF) { - yyerror("Can't change the value of self"); - } - else if (id == kNIL) { - yyerror("Can't assign to nil"); - } - else if (id == kTRUE) { - yyerror("Can't assign to true"); - } - else if (id == kFALSE) { - yyerror("Can't assign to false"); - } - else if (id == k__FILE__) { - yyerror("Can't assign to __FILE__"); - } - else if (id == k__LINE__) { - yyerror("Can't assign to __LINE__"); - } - else if (is_local_id(id)) { - if (rb_dvar_curr(id)) { - return NEW_DASGN_CURR(id, val); - } - else if (dyna_var_lookup(id)) { - return NEW_DASGN(id, val); - } - else if (local_id(id) || !dyna_in_block()) { - return NEW_LASGN(id, val); - } - else{ - rb_dvar_push(id, Qnil); - return NEW_DASGN_CURR(id, val); - } - } - else if (is_global_id(id)) { - return NEW_GASGN(id, val); - } - else if (is_instance_id(id)) { - return NEW_IASGN(id, val); - } - else if (is_const_id(id)) { - if (in_def || in_single) - yyerror("dynamic constant assignment"); - return NEW_CDECL(id, val, 0); - } - else if (is_class_id(id)) { - if (in_def || in_single) return NEW_CVASGN(id, val); - return NEW_CVDECL(id, val); - } - else { - rb_compile_error("identifier %s is not valid", rb_id2name(id)); - } - return 0; -} - -static NODE * -aryset(recv, idx) - NODE *recv, *idx; -{ - if (recv && nd_type(recv) == NODE_SELF) - recv = (NODE *)1; - else - value_expr(recv); - return NEW_ATTRASGN(recv, tASET, idx); -} - -ID -rb_id_attrset(id) - ID id; -{ - id &= ~ID_SCOPE_MASK; - id |= ID_ATTRSET; - return id; -} - -static NODE * -attrset(recv, id) - NODE *recv; - ID id; -{ - if (recv && nd_type(recv) == NODE_SELF) - recv = (NODE *)1; - else - value_expr(recv); - return NEW_ATTRASGN(recv, rb_id_attrset(id), 0); -} - -static void -rb_backref_error(node) - NODE *node; -{ - switch (nd_type(node)) { - case NODE_NTH_REF: - rb_compile_error("Can't set variable $%d", node->nd_nth); - break; - case NODE_BACK_REF: - rb_compile_error("Can't set variable $%c", (int)node->nd_nth); - break; - } -} - -static NODE * -arg_concat(node1, node2) - NODE *node1; - NODE *node2; -{ - if (!node2) return node1; - return NEW_ARGSCAT(node1, node2); -} - -static NODE * -arg_add(node1, node2) - NODE *node1; - NODE *node2; -{ - if (!node1) return NEW_LIST(node2); - if (nd_type(node1) == NODE_ARRAY) { - return list_append(node1, node2); - } - else { - return NEW_ARGSPUSH(node1, node2); - } -} - -static NODE* -node_assign(lhs, rhs) - NODE *lhs, *rhs; -{ - if (!lhs) return 0; - - value_expr(rhs); - switch (nd_type(lhs)) { - case NODE_GASGN: - case NODE_IASGN: - case NODE_LASGN: - case NODE_DASGN: - case NODE_DASGN_CURR: - case NODE_MASGN: - case NODE_CDECL: - case NODE_CVDECL: - case NODE_CVASGN: - lhs->nd_value = rhs; - break; - - case NODE_ATTRASGN: - case NODE_CALL: - lhs->nd_args = arg_add(lhs->nd_args, rhs); - break; - - default: - /* should not happen */ - break; - } - - return lhs; -} - -static int -value_expr0(node) - NODE *node; -{ - int cond = 0; - - while (node) { - switch (nd_type(node)) { - case NODE_DEFN: - case NODE_DEFS: - parser_warning(node, "void value expression"); - return Qfalse; - - case NODE_RETURN: - case NODE_BREAK: - case NODE_NEXT: - case NODE_REDO: - case NODE_RETRY: - if (!cond) yyerror("void value expression"); - /* or "control never reach"? */ - return Qfalse; - - case NODE_BLOCK: - while (node->nd_next) { - node = node->nd_next; - } - node = node->nd_head; - break; - - case NODE_BEGIN: - node = node->nd_body; - break; - - case NODE_IF: - if (!value_expr(node->nd_body)) return Qfalse; - node = node->nd_else; - break; - - case NODE_AND: - case NODE_OR: - cond = 1; - node = node->nd_2nd; - break; - - case NODE_NEWLINE: - node = node->nd_next; - break; - - default: - return Qtrue; - } - } - - return Qtrue; -} - -static void -void_expr0(node) - NODE *node; -{ - char *useless = 0; - - if (!RTEST(ruby_verbose)) return; - - again: - if (!node) return; - switch (nd_type(node)) { - case NODE_NEWLINE: - node = node->nd_next; - goto again; - - case NODE_CALL: - switch (node->nd_mid) { - case '+': - case '-': - case '*': - case '/': - case '%': - case tPOW: - case tUPLUS: - case tUMINUS: - case '|': - case '^': - case '&': - case tCMP: - case '>': - case tGEQ: - case '<': - case tLEQ: - case tEQ: - case tNEQ: - useless = rb_id2name(node->nd_mid); - break; - } - break; - - case NODE_LVAR: - case NODE_DVAR: - case NODE_GVAR: - case NODE_IVAR: - case NODE_CVAR: - case NODE_NTH_REF: - case NODE_BACK_REF: - useless = "a variable"; - break; - case NODE_CONST: - case NODE_CREF: - useless = "a constant"; - break; - case NODE_LIT: - case NODE_STR: - case NODE_DSTR: - case NODE_DREGX: - case NODE_DREGX_ONCE: - useless = "a literal"; - break; - case NODE_COLON2: - case NODE_COLON3: - useless = "::"; - break; - case NODE_DOT2: - useless = ".."; - break; - case NODE_DOT3: - useless = "..."; - break; - case NODE_SELF: - useless = "self"; - break; - case NODE_NIL: - useless = "nil"; - break; - case NODE_TRUE: - useless = "true"; - break; - case NODE_FALSE: - useless = "false"; - break; - case NODE_DEFINED: - useless = "defined?"; - break; - } - - if (useless) { - int line = ruby_sourceline; - - ruby_sourceline = nd_line(node); - rb_warn("useless use of %s in void context", useless); - ruby_sourceline = line; - } -} - -static void -void_stmts(node) - NODE *node; -{ - if (!RTEST(ruby_verbose)) return; - if (!node) return; - if (nd_type(node) != NODE_BLOCK) return; - - for (;;) { - if (!node->nd_next) return; - void_expr0(node->nd_head); - node = node->nd_next; - } -} - -static NODE * -remove_begin(node) - NODE *node; -{ - NODE **n = &node; - while (*n) { - switch (nd_type(*n)) { - case NODE_NEWLINE: - n = &(*n)->nd_next; - continue; - case NODE_BEGIN: - *n = (*n)->nd_body; - default: - return node; - } - } - return node; -} - -static int -assign_in_cond(node) - NODE *node; -{ - switch (nd_type(node)) { - case NODE_MASGN: - yyerror("multiple assignment in conditional"); - return 1; - - case NODE_LASGN: - case NODE_DASGN: - case NODE_GASGN: - case NODE_IASGN: - break; - - case NODE_NEWLINE: - default: - return 0; - } - - switch (nd_type(node->nd_value)) { - case NODE_LIT: - case NODE_STR: - case NODE_NIL: - case NODE_TRUE: - case NODE_FALSE: - /* reports always */ - parser_warn(node->nd_value, "found = in conditional, should be =="); - return 1; - - case NODE_DSTR: - case NODE_XSTR: - case NODE_DXSTR: - case NODE_EVSTR: - case NODE_DREGX: - default: - break; - } -#if 0 - if (assign_in_cond(node->nd_value) == 0) { - parser_warning(node->nd_value, "assignment in condition"); - } -#endif - return 1; -} - -static int -e_option_supplied() -{ - if (strcmp(ruby_sourcefile, "-e") == 0) - return Qtrue; - return Qfalse; -} - -static void -warn_unless_e_option(node, str) - NODE *node; - const char *str; -{ - if (!e_option_supplied()) parser_warn(node, str); -} - -static void -warning_unless_e_option(node, str) - NODE *node; - const char *str; -{ - if (!e_option_supplied()) parser_warning(node, str); -} - -static void -fixup_nodes(rootnode) - NODE **rootnode; -{ - NODE *node, *next, *head; - - for (node = *rootnode; node; node = next) { - enum node_type type; - VALUE val; - - next = node->nd_next; - head = node->nd_head; - rb_gc_force_recycle((VALUE)node); - *rootnode = next; - switch (type = nd_type(head)) { - case NODE_DOT2: - case NODE_DOT3: - val = rb_range_new(head->nd_beg->nd_lit, head->nd_end->nd_lit, - type == NODE_DOT3 ? Qtrue : Qfalse); - rb_gc_force_recycle((VALUE)head->nd_beg); - rb_gc_force_recycle((VALUE)head->nd_end); - nd_set_type(head, NODE_LIT); - head->nd_lit = val; - break; - default: - break; - } - } -} - -static NODE *cond0(); - -static NODE* -range_op(node) - NODE *node; -{ - enum node_type type; - - if (node == 0) return 0; - - type = nd_type(node); - if (type == NODE_NEWLINE) { - node = node->nd_next; - type = nd_type(node); - } - value_expr(node); - if (type == NODE_LIT && FIXNUM_P(node->nd_lit)) { - warn_unless_e_option(node, "integer literal in conditional range"); - return call_op(node,tEQ,1,NEW_GVAR(rb_intern("$."))); - } - return cond0(node); -} - -static int -literal_node(node) - NODE *node; -{ - if (!node) return 1; /* same as NODE_NIL */ - switch (nd_type(node)) { - case NODE_LIT: - case NODE_STR: - case NODE_DSTR: - case NODE_EVSTR: - case NODE_DREGX: - case NODE_DREGX_ONCE: - case NODE_DSYM: - return 2; - case NODE_TRUE: - case NODE_FALSE: - case NODE_NIL: - return 1; - } - return 0; -} - -static NODE* -cond0(node) - NODE *node; -{ - if (node == 0) return 0; - assign_in_cond(node); - - switch (nd_type(node)) { - case NODE_DSTR: - case NODE_EVSTR: - case NODE_STR: - rb_warn("string literal in condition"); - break; - - case NODE_DREGX: - case NODE_DREGX_ONCE: - warning_unless_e_option(node, "regex literal in condition"); - local_cnt('_'); - local_cnt('~'); - return NEW_MATCH2(node, NEW_GVAR(rb_intern("$_"))); - - case NODE_AND: - case NODE_OR: - node->nd_1st = cond0(node->nd_1st); - node->nd_2nd = cond0(node->nd_2nd); - break; - - case NODE_DOT2: - case NODE_DOT3: - node->nd_beg = range_op(node->nd_beg); - node->nd_end = range_op(node->nd_end); - if (nd_type(node) == NODE_DOT2) nd_set_type(node,NODE_FLIP2); - else if (nd_type(node) == NODE_DOT3) nd_set_type(node, NODE_FLIP3); - node->nd_cnt = local_append(internal_id()); - if (!e_option_supplied()) { - int b = literal_node(node->nd_beg); - int e = literal_node(node->nd_end); - if ((b == 1 && e == 1) || (b + e >= 2 && RTEST(ruby_verbose))) { - parser_warn(node, "range literal in condition"); - } - } - break; - - case NODE_DSYM: - parser_warning(node, "literal in condition"); - break; - - case NODE_LIT: - if (TYPE(node->nd_lit) == T_REGEXP) { - warn_unless_e_option(node, "regex literal in condition"); - nd_set_type(node, NODE_MATCH); - local_cnt('_'); - local_cnt('~'); - } - else { - parser_warning(node, "literal in condition"); - } - default: - break; - } - return node; -} - -static NODE* -cond(node) - NODE *node; -{ - if (node == 0) return 0; - value_expr(node); - if (nd_type(node) == NODE_NEWLINE){ - node->nd_next = cond0(node->nd_next); - return node; - } - return cond0(node); -} - -static NODE* -logop(type, left, right) - enum node_type type; - NODE *left, *right; -{ - value_expr(left); - if (left && nd_type(left) == type) { - NODE *node = left, *second; - while ((second = node->nd_2nd) != 0 && nd_type(second) == type) { - node = second; - } - node->nd_2nd = NEW_NODE(type, second, right, 0); - return left; - } - return NEW_NODE(type, left, right, 0); -} - -static int -cond_negative(nodep) - NODE **nodep; -{ - NODE *c = *nodep; - - if (!c) return 0; - switch (nd_type(c)) { - case NODE_NOT: - *nodep = c->nd_body; - return 1; - case NODE_NEWLINE: - if (c->nd_next && nd_type(c->nd_next) == NODE_NOT) { - c->nd_next = c->nd_next->nd_body; - return 1; - } - } - return 0; -} - -static void -no_blockarg(node) - NODE *node; -{ - if (node && nd_type(node) == NODE_BLOCK_PASS) { - rb_compile_error("block argument should not be given"); - } -} - -static NODE * -ret_args(node) - NODE *node; -{ - if (node) { - no_blockarg(node); - if (nd_type(node) == NODE_ARRAY && node->nd_next == 0) { - node = node->nd_head; - } - if (node && nd_type(node) == NODE_SPLAT) { - node = NEW_SVALUE(node); - } - } - return node; -} - -static NODE * -new_yield(node) - NODE *node; -{ - long state = Qtrue; - - if (node) { - no_blockarg(node); - if (nd_type(node) == NODE_ARRAY && node->nd_next == 0) { - node = node->nd_head; - state = Qfalse; - } - if (node && nd_type(node) == NODE_SPLAT) { - state = Qtrue; - } - } - else { - state = Qfalse; - } - return NEW_YIELD(node, state); -} - -static NODE* -negate_lit(node) - NODE *node; -{ - switch (TYPE(node->nd_lit)) { - case T_FIXNUM: - node->nd_lit = LONG2FIX(-FIX2LONG(node->nd_lit)); - break; - case T_BIGNUM: - node->nd_lit = rb_funcall(node->nd_lit,tUMINUS,0,0); - break; - case T_FLOAT: - RFLOAT(node->nd_lit)->value = -RFLOAT(node->nd_lit)->value; - break; - default: - break; - } - return node; -} - -static NODE * -arg_blk_pass(node1, node2) - NODE *node1; - NODE *node2; -{ - if (node2) { - node2->nd_head = node1; - return node2; - } - return node1; -} - -static NODE* -arg_prepend(node1, node2) - NODE *node1, *node2; -{ - switch (nd_type(node2)) { - case NODE_ARRAY: - return list_concat(NEW_LIST(node1), node2); - - case NODE_SPLAT: - return arg_concat(node1, node2->nd_head); - - case NODE_BLOCK_PASS: - node2->nd_body = arg_prepend(node1, node2->nd_body); - return node2; - - default: - rb_bug("unknown nodetype(%d) for arg_prepend", nd_type(node2)); - } - return 0; /* not reached */ -} - -static NODE* -new_call(r,m,a) - NODE *r; - ID m; - NODE *a; -{ - if (a && nd_type(a) == NODE_BLOCK_PASS) { - a->nd_iter = NEW_CALL(r,m,a->nd_head); - return a; - } - return NEW_CALL(r,m,a); -} - -static NODE* -new_fcall(m,a) - ID m; - NODE *a; -{ - if (a && nd_type(a) == NODE_BLOCK_PASS) { - a->nd_iter = NEW_FCALL(m,a->nd_head); - return a; - } - return NEW_FCALL(m,a); -} - -static NODE* -new_super(a) - NODE *a; -{ - if (a && nd_type(a) == NODE_BLOCK_PASS) { - a->nd_iter = NEW_SUPER(a->nd_head); - return a; - } - return NEW_SUPER(a); -} - -static struct local_vars { - ID *tbl; - int nofree; - int cnt; - int dlev; - struct RVarmap* dyna_vars; - struct local_vars *prev; -} *lvtbl; - -static void -local_push(top) - int top; -{ - struct local_vars *local; - - local = ALLOC(struct local_vars); - local->prev = lvtbl; - local->nofree = 0; - local->cnt = 0; - local->tbl = 0; - local->dlev = 0; - local->dyna_vars = ruby_dyna_vars; - lvtbl = local; - if (!top) { - /* preserve reference for GC, but link should be cut. */ - rb_dvar_push(0, (VALUE)ruby_dyna_vars); - ruby_dyna_vars->next = 0; - } -} - -static void -local_pop() -{ - struct local_vars *local = lvtbl->prev; - - if (lvtbl->tbl) { - if (!lvtbl->nofree) xfree(lvtbl->tbl); - else lvtbl->tbl[0] = lvtbl->cnt; - } - ruby_dyna_vars = lvtbl->dyna_vars; - xfree(lvtbl); - lvtbl = local; -} - -static ID* -local_tbl() -{ - lvtbl->nofree = 1; - return lvtbl->tbl; -} - -static int -local_append(id) - ID id; -{ - if (lvtbl->tbl == 0) { - lvtbl->tbl = ALLOC_N(ID, 4); - lvtbl->tbl[0] = 0; - lvtbl->tbl[1] = '_'; - lvtbl->tbl[2] = '~'; - lvtbl->cnt = 2; - if (id == '_') return 0; - if (id == '~') return 1; - } - else { - REALLOC_N(lvtbl->tbl, ID, lvtbl->cnt+2); - } - - lvtbl->tbl[lvtbl->cnt+1] = id; - return lvtbl->cnt++; -} - -static int -local_cnt(id) - ID id; -{ - int cnt, max; - - if (id == 0) return lvtbl->cnt; - - for (cnt=1, max=lvtbl->cnt+1; cnttbl[cnt] == id) return cnt-1; - } - return local_append(id); -} - -static int -local_id(id) - ID id; -{ - int i, max; - - if (lvtbl == 0) return Qfalse; - for (i=3, max=lvtbl->cnt+1; itbl[i] == id) return Qtrue; - } - return Qfalse; -} - -static void -top_local_init() -{ - local_push(1); - lvtbl->cnt = ruby_scope->local_tbl?ruby_scope->local_tbl[0]:0; - if (lvtbl->cnt > 0) { - lvtbl->tbl = ALLOC_N(ID, lvtbl->cnt+3); - MEMCPY(lvtbl->tbl, ruby_scope->local_tbl, ID, lvtbl->cnt+1); - } - else { - lvtbl->tbl = 0; - } - if (ruby_dyna_vars) - lvtbl->dlev = 1; - else - lvtbl->dlev = 0; -} - -static void -top_local_setup() -{ - int len = lvtbl->cnt; - int i; - - if (len > 0) { - i = ruby_scope->local_tbl?ruby_scope->local_tbl[0]:0; - - if (i < len) { - if (i == 0 || (ruby_scope->flags & SCOPE_MALLOC) == 0) { - VALUE *vars = ALLOC_N(VALUE, len+1); - if (ruby_scope->local_vars) { - *vars++ = ruby_scope->local_vars[-1]; - MEMCPY(vars, ruby_scope->local_vars, VALUE, i); - rb_mem_clear(vars+i, len-i); - } - else { - *vars++ = 0; - rb_mem_clear(vars, len); - } - ruby_scope->local_vars = vars; - ruby_scope->flags |= SCOPE_MALLOC; - } - else { - VALUE *vars = ruby_scope->local_vars-1; - REALLOC_N(vars, VALUE, len+1); - ruby_scope->local_vars = vars+1; - rb_mem_clear(ruby_scope->local_vars+i, len-i); - } - if (ruby_scope->local_tbl && ruby_scope->local_vars[-1] == 0) { - if (!(ruby_scope->flags & SCOPE_CLONE)) - xfree(ruby_scope->local_tbl); - } - ruby_scope->local_vars[-1] = 0; /* no reference needed */ - ruby_scope->local_tbl = local_tbl(); - } - } - local_pop(); -} - -#define DVAR_USED FL_USER6 - -static VALUE -dyna_var_lookup(id) - ID id; -{ - struct RVarmap *vars = ruby_dyna_vars; - - while (vars) { - if (vars->id == id) { - FL_SET(vars, DVAR_USED); - return Qtrue; - } - vars = vars->next; - } - return Qfalse; -} - -static struct RVarmap* -dyna_push() -{ - struct RVarmap* vars = ruby_dyna_vars; - - rb_dvar_push(0, 0); - lvtbl->dlev++; - return vars; -} - -static void -dyna_pop(vars) - struct RVarmap* vars; -{ - lvtbl->dlev--; - ruby_dyna_vars = vars; -} - -static int -dyna_in_block() -{ - return (lvtbl->dlev > 0); -} - -static NODE * -dyna_init(node, pre) - NODE *node; - struct RVarmap *pre; -{ - struct RVarmap *post = ruby_dyna_vars; - NODE *var; - - if (!node || !post || pre == post) return node; - for (var = 0; post != pre && post->id; post = post->next) { - if (FL_TEST(post, DVAR_USED)) { - var = NEW_DASGN_CURR(post->id, var); - } - } - return block_append(var, node); -} - -int -ruby_parser_stack_on_heap() -{ -#if defined(YYMALLOC) - return Qfalse; -#else - return Qtrue; -#endif -} - -void -rb_gc_mark_parser() -{ -#if defined YYMALLOC - rb_gc_mark((VALUE)parser_heap); -#elif defined yystacksize - if (yyvsp) rb_gc_mark_locations((VALUE *)yyvs, (VALUE *)yyvsp); -#endif - - if (!ruby_in_compile) return; - - rb_gc_mark_maybe((VALUE)yylval.node); - rb_gc_mark(ruby_debug_lines); - rb_gc_mark(lex_lastline); - rb_gc_mark(lex_input); - rb_gc_mark((VALUE)lex_strterm); - rb_gc_mark((VALUE)deferred_nodes); -} - -void -rb_parser_append_print() -{ - ruby_eval_tree = - block_append(ruby_eval_tree, - NEW_FCALL(rb_intern("print"), - NEW_ARRAY(NEW_GVAR(rb_intern("$_"))))); -} - -void -rb_parser_while_loop(chop, split) - int chop, split; -{ - if (split) { - ruby_eval_tree = - block_append(NEW_GASGN(rb_intern("$F"), - NEW_CALL(NEW_GVAR(rb_intern("$_")), - rb_intern("split"), 0)), - ruby_eval_tree); - } - if (chop) { - ruby_eval_tree = - block_append(NEW_CALL(NEW_GVAR(rb_intern("$_")), - rb_intern("chop!"), 0), ruby_eval_tree); - } - ruby_eval_tree = NEW_OPT_N(ruby_eval_tree); -} - -static struct { - ID token; - char *name; -} op_tbl[] = { - {tDOT2, ".."}, - {tDOT3, "..."}, - {'+', "+"}, - {'-', "-"}, - {'+', "+(binary)"}, - {'-', "-(binary)"}, - {'*', "*"}, - {'/', "/"}, - {'%', "%"}, - {tPOW, "**"}, - {tUPLUS, "+@"}, - {tUMINUS, "-@"}, - {tUPLUS, "+(unary)"}, - {tUMINUS, "-(unary)"}, - {'|', "|"}, - {'^', "^"}, - {'&', "&"}, - {tCMP, "<=>"}, - {'>', ">"}, - {tGEQ, ">="}, - {'<', "<"}, - {tLEQ, "<="}, - {tEQ, "=="}, - {tEQQ, "==="}, - {tNEQ, "!="}, - {tMATCH, "=~"}, - {tNMATCH, "!~"}, - {'!', "!"}, - {'~', "~"}, - {'!', "!(unary)"}, - {'~', "~(unary)"}, - {'!', "!@"}, - {'~', "~@"}, - {tAREF, "[]"}, - {tASET, "[]="}, - {tLSHFT, "<<"}, - {tRSHFT, ">>"}, - {tCOLON2, "::"}, - {'`', "`"}, - {0, 0} -}; - -static st_table *sym_tbl; -static st_table *sym_rev_tbl; - -void -Init_sym() -{ - sym_tbl = st_init_strtable_with_size(200); - sym_rev_tbl = st_init_numtable_with_size(200); -} - -static ID last_id = tLAST_TOKEN; - -static ID -internal_id() -{ - return ID_INTERNAL | (++last_id << ID_SCOPE_SHIFT); -} - -static int -is_special_global_name(m) - const char *m; -{ - switch (*m) { - case '~': case '*': case '$': case '?': case '!': case '@': - case '/': case '\\': case ';': case ',': case '.': case '=': - case ':': case '<': case '>': case '\"': - case '&': case '`': case '\'': case '+': - case '0': - ++m; - break; - case '-': - ++m; - if (is_identchar(*m)) m += mbclen(*m); - break; - default: - if (!ISDIGIT(*m)) return 0; - do ++m; while (ISDIGIT(*m)); - } - return !*m; -} - -int -rb_symname_p(name) - const char *name; -{ - const char *m = name; - int localid = Qfalse; - - if (!m) return Qfalse; - switch (*m) { - case '\0': - return Qfalse; - - case '$': - if (is_special_global_name(++m)) return Qtrue; - goto id; - - case '@': - if (*++m == '@') ++m; - goto id; - - case '<': - switch (*++m) { - case '<': ++m; break; - case '=': if (*++m == '>') ++m; break; - default: break; - } - break; - - case '>': - switch (*++m) { - case '>': case '=': ++m; break; - } - break; - - case '=': - switch (*++m) { - case '~': ++m; break; - case '=': if (*++m == '=') ++m; break; - default: return Qfalse; - } - break; - - case '*': - if (*++m == '*') ++m; - break; - - case '+': case '-': - if (*++m == '@') ++m; - break; - - case '|': case '^': case '&': case '/': case '%': case '~': case '`': - ++m; - break; - - case '[': - if (*++m != ']') return Qfalse; - if (*++m == '=') ++m; - break; - - default: - localid = !ISUPPER(*m); - id: - if (*m != '_' && !ISALPHA(*m) && !ismbchar(*m)) return Qfalse; - while (is_identchar(*m)) m += mbclen(*m); - if (localid) { - switch (*m) { - case '!': case '?': case '=': ++m; - } - } - break; - } - return *m ? Qfalse : Qtrue; -} - -int -rb_sym_interned_p(str) - VALUE str; -{ - ID id; - - if (st_lookup(sym_tbl, (st_data_t)RSTRING(str)->ptr, (st_data_t *)&id)) - return Qtrue; - return Qfalse; -} - -ID -rb_intern(name) - const char *name; -{ - const char *m = name; - ID id; - int last; - - if (st_lookup(sym_tbl, (st_data_t)name, (st_data_t *)&id)) - return id; - - last = strlen(name)-1; - id = 0; - switch (*name) { - case '$': - id |= ID_GLOBAL; - if (is_special_global_name(++m)) goto new_id; - break; - case '@': - if (name[1] == '@') { - m++; - id |= ID_CLASS; - } - else { - id |= ID_INSTANCE; - } - m++; - break; - default: - if (name[0] != '_' && ISASCII(name[0]) && !ISALNUM(name[0])) { - /* operators */ - int i; - - for (i=0; op_tbl[i].token; i++) { - if (*op_tbl[i].name == *name && - strcmp(op_tbl[i].name, name) == 0) { - id = op_tbl[i].token; - goto id_regist; - } - } - } - - if (name[last] == '=') { - /* attribute assignment */ - char *buf = ALLOCA_N(char,last+1); - - strncpy(buf, name, last); - buf[last] = '\0'; - id = rb_intern(buf); - if (id > tLAST_TOKEN && !is_attrset_id(id)) { - id = rb_id_attrset(id); - goto id_regist; - } - id = ID_ATTRSET; - } - else if (ISUPPER(name[0])) { - id = ID_CONST; - } - else { - id = ID_LOCAL; - } - break; - } - if (!ISDIGIT(*m)) { - while (m <= name + last && is_identchar(*m)) { - m += mbclen(*m); - } - } - if (*m) id = ID_JUNK; - new_id: - id |= ++last_id << ID_SCOPE_SHIFT; - id_regist: - name = strdup(name); - st_add_direct(sym_tbl, (st_data_t)name, id); - st_add_direct(sym_rev_tbl, id, (st_data_t)name); - return id; -} - -char * -rb_id2name(id) - ID id; -{ - char *name; - st_data_t data; - - if (id < tLAST_TOKEN) { - int i; - - for (i=0; op_tbl[i].token; i++) { - if (op_tbl[i].token == id) - return op_tbl[i].name; - } - } - - if (st_lookup(sym_rev_tbl, id, &data)) - return (char *)data; - - if (is_attrset_id(id)) { - ID id2 = (id & ~ID_SCOPE_MASK) | ID_LOCAL; - - again: - name = rb_id2name(id2); - if (name) { - char *buf = ALLOCA_N(char, strlen(name)+2); - - strcpy(buf, name); - strcat(buf, "="); - rb_intern(buf); - return rb_id2name(id); - } - if (is_local_id(id2)) { - id2 = (id & ~ID_SCOPE_MASK) | ID_CONST; - goto again; - } - } - return 0; -} - -static int -symbols_i(key, value, ary) - char *key; - ID value; - VALUE ary; -{ - rb_ary_push(ary, ID2SYM(value)); - return ST_CONTINUE; -} - -/* - * call-seq: - * Symbol.all_symbols => array - * - * Returns an array of all the symbols currently in Ruby's symbol - * table. - * - * Symbol.all_symbols.size #=> 903 - * Symbol.all_symbols[1,20] #=> [:floor, :ARGV, :Binding, :symlink, - * :chown, :EOFError, :$;, :String, - * :LOCK_SH, :"setuid?", :$<, - * :default_proc, :compact, :extend, - * :Tms, :getwd, :$=, :ThreadGroup, - * :wait2, :$>] - */ - -VALUE -rb_sym_all_symbols() -{ - VALUE ary = rb_ary_new2(sym_tbl->num_entries); - - st_foreach(sym_tbl, symbols_i, ary); - return ary; -} - -int -rb_is_const_id(id) - ID id; -{ - if (is_const_id(id)) return Qtrue; - return Qfalse; -} - -int -rb_is_class_id(id) - ID id; -{ - if (is_class_id(id)) return Qtrue; - return Qfalse; -} - -int -rb_is_instance_id(id) - ID id; -{ - if (is_instance_id(id)) return Qtrue; - return Qfalse; -} - -int -rb_is_local_id(id) - ID id; -{ - if (is_local_id(id)) return Qtrue; - return Qfalse; -} - -int -rb_is_junk_id(id) - ID id; -{ - if (is_junk_id(id)) return Qtrue; - return Qfalse; -} - -static void -special_local_set(c, val) - char c; - VALUE val; -{ - int cnt; - - top_local_init(); - cnt = local_cnt(c); - top_local_setup(); - ruby_scope->local_vars[cnt] = val; -} - -VALUE -rb_backref_get() -{ - VALUE *var = rb_svar(1); - if (var) { - return *var; - } - return Qnil; -} - -void -rb_backref_set(val) - VALUE val; -{ - VALUE *var = rb_svar(1); - if (var) { - *var = val; - } - else { - special_local_set('~', val); - } -} - -VALUE -rb_lastline_get() -{ - VALUE *var = rb_svar(0); - if (var) { - return *var; - } - return Qnil; -} - -void -rb_lastline_set(val) - VALUE val; -{ - VALUE *var = rb_svar(0); - if (var) { - *var = val; - } - else { - special_local_set('_', val); - } -} - -#ifdef YYMALLOC -#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE)) -#define NEWHEAP() rb_node_newnode(NODE_ALLOCA, 0, (VALUE)parser_heap, 0) -#define ADD2HEAP(n, c, p) ((parser_heap = (n))->u1.node = (p), \ - (n)->u3.cnt = (c), (p)) - -static void * -rb_parser_malloc(size) - size_t size; -{ - size_t cnt = HEAPCNT(1, size); - NODE *n = NEWHEAP(); - void *ptr = xmalloc(size); - - return ADD2HEAP(n, cnt, ptr); -} - -static void * -rb_parser_calloc(nelem, size) - size_t nelem, size; -{ - size_t cnt = HEAPCNT(nelem, size); - NODE *n = NEWHEAP(); - void *ptr = xcalloc(nelem, size); - - return ADD2HEAP(n, cnt, ptr); -} - -static void * -rb_parser_realloc(ptr, size) - void *ptr; - size_t size; -{ - NODE *n; - size_t cnt = HEAPCNT(1, size); - - if (ptr && (n = parser_heap) != NULL) { - do { - if (n->u1.node == ptr) { - n->u1.node = ptr = xrealloc(ptr, size); - if (n->u3.cnt) n->u3.cnt = cnt; - return ptr; - } - } while ((n = n->u2.node) != NULL); - } - n = NEWHEAP(); - ptr = xrealloc(ptr, size); - return ADD2HEAP(n, cnt, ptr); -} - -static void -rb_parser_free(ptr) - void *ptr; -{ - NODE **prev = &parser_heap, *n; - - while ((n = *prev) != 0) { - if (n->u1.node == ptr) { - *prev = n->u2.node; - rb_gc_force_recycle((VALUE)n); - break; - } - prev = &n->u2.node; - } - xfree(ptr); -} -#endif - -/********************************************************************** - - prec.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007) $ - created at: Tue Jan 26 02:40:41 2000 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" - -VALUE rb_mPrecision; - -static ID prc_pr, prc_if; - - -/* - * call-seq: - * num.prec(klass) => a_klass - * - * Converts _self_ into an instance of _klass_. By default, - * +prec+ invokes - * - * klass.induced_from(num) - * - * and returns its value. So, if klass.induced_from - * doesn't return an instance of _klass_, it will be necessary - * to reimplement +prec+. - */ - -static VALUE -prec_prec(x, klass) - VALUE x, klass; -{ - return rb_funcall(klass, prc_if, 1, x); -} - -/* - * call-seq: - * num.prec_i => Integer - * - * Returns an +Integer+ converted from _num_. It is equivalent - * to prec(Integer). - */ - -static VALUE -prec_prec_i(x) - VALUE x; -{ - VALUE klass = rb_cInteger; - - return rb_funcall(x, prc_pr, 1, klass); -} - -/* - * call-seq: - * num.prec_f => Float - * - * Returns a +Float+ converted from _num_. It is equivalent - * to prec(Float). - */ - -static VALUE -prec_prec_f(x) - VALUE x; -{ - VALUE klass = rb_cFloat; - - return rb_funcall(x, prc_pr, 1, klass); -} - -/* - * call-seq: - * Mod.induced_from(number) => a_mod - * - * Creates an instance of mod from. This method is overridden - * by concrete +Numeric+ classes, so that (for example) - * - * Fixnum.induced_from(9.9) #=> 9 - * - * Note that a use of +prec+ in a redefinition may cause - * an infinite loop. - */ - -static VALUE -prec_induced_from(module, x) - VALUE module, x; -{ - rb_raise(rb_eTypeError, "undefined conversion from %s into %s", - rb_obj_classname(x), rb_class2name(module)); - return Qnil; /* not reached */ -} - -/* - * call_seq: - * included - * - * When the +Precision+ module is mixed-in to a class, this +included+ - * method is used to add our default +induced_from+ implementation - * to the host class. - */ - -static VALUE -prec_included(module, include) - VALUE module, include; -{ - switch (TYPE(include)) { - case T_CLASS: - case T_MODULE: - break; - default: - Check_Type(include, T_CLASS); - break; - } - rb_define_singleton_method(include, "induced_from", prec_induced_from, 1); - return module; -} - -/* - * Precision is a mixin for concrete numeric classes with - * precision. Here, `precision' means the fineness of approximation - * of a real number, so, this module should not be included into - * anything which is not a subset of Real (so it should not be - * included in classes such as +Complex+ or +Matrix+). -*/ - -void -Init_Precision() -{ - rb_mPrecision = rb_define_module("Precision"); - rb_define_singleton_method(rb_mPrecision, "included", prec_included, 1); - rb_define_method(rb_mPrecision, "prec", prec_prec, 1); - rb_define_method(rb_mPrecision, "prec_i", prec_prec_i, 0); - rb_define_method(rb_mPrecision, "prec_f", prec_prec_f, 0); - - prc_pr = rb_intern("prec"); - prc_if = rb_intern("induced_from"); -} -/********************************************************************** - - process.c - - - $Author: shyouhei $ - $Date: 2008-06-29 11:33:11 +0200 (Sun, 29 Jun 2008) $ - created at: Tue Aug 10 14:30:50 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#include "ruby.h" -#include "rubysig.h" -#include -#include -#include -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef __DJGPP__ -#include -#endif - -#include -#include - -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif -#ifndef EXIT_FAILURE -#define EXIT_FAILURE 1 -#endif - -struct timeval rb_time_interval _((VALUE)); - -#ifdef HAVE_SYS_WAIT_H -# include -#endif -#ifdef HAVE_SYS_RESOURCE_H -# include -#endif -#include "st.h" - -#ifdef __EMX__ -#undef HAVE_GETPGRP -#endif - -#ifdef HAVE_SYS_TIMES_H -#include -#endif - -#ifdef HAVE_GRP_H -#include -#endif - -#if defined(HAVE_TIMES) || defined(_WIN32) -static VALUE S_Tms; -#endif - -#ifndef WIFEXITED -#define WIFEXITED(w) (((w) & 0xff) == 0) -#endif -#ifndef WIFSIGNALED -#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) -#endif -#ifndef WIFSTOPPED -#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) -#endif -#ifndef WEXITSTATUS -#define WEXITSTATUS(w) (((w) >> 8) & 0xff) -#endif -#ifndef WTERMSIG -#define WTERMSIG(w) ((w) & 0x7f) -#endif -#ifndef WSTOPSIG -#define WSTOPSIG WEXITSTATUS -#endif - -#if defined(__APPLE__) && ( defined(__MACH__) || defined(__DARWIN__) ) && !defined(__MacOS_X__) -#define __MacOS_X__ 1 -#endif - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) -#define HAVE_44BSD_SETUID 1 -#define HAVE_44BSD_SETGID 1 -#endif - -#ifdef __NetBSD__ -#undef HAVE_SETRUID -#undef HAVE_SETRGID -#endif - -#if defined(__MacOS_X__) || defined(__bsdi__) -#define BROKEN_SETREUID 1 -#define BROKEN_SETREGID 1 -#endif - -#ifdef BROKEN_SETREUID -#define setreuid ruby_setreuid -#endif -#ifdef BROKEN_SETREGID -#define setregid ruby_setregid -#endif - -#if defined(HAVE_44BSD_SETUID) || defined(__MacOS_X__) -#if !defined(USE_SETREUID) && !defined(BROKEN_SETREUID) -#define OBSOLETE_SETREUID 1 -#endif -#if !defined(USE_SETREGID) && !defined(BROKEN_SETREGID) -#define OBSOLETE_SETREGID 1 -#endif -#endif - -#define preserving_errno(stmts) \ - do {int saved_errno = errno; stmts; errno = saved_errno;} while (0) - - -/* - * call-seq: - * Process.pid => fixnum - * - * Returns the process id of this process. Not available on all - * platforms. - * - * Process.pid #=> 27415 - */ - -static VALUE -get_pid() -{ - rb_secure(2); - return INT2FIX(getpid()); -} - - -/* - * call-seq: - * Process.ppid => fixnum - * - * Returns the process id of the parent of this process. Always - * returns 0 on NT. Not available on all platforms. - * - * puts "I am #{Process.pid}" - * Process.fork { puts "Dad is #{Process.ppid}" } - * - * produces: - * - * I am 27417 - * Dad is 27417 - */ - -static VALUE -get_ppid() -{ - rb_secure(2); -#ifdef _WIN32 - return INT2FIX(0); -#else - return INT2FIX(getppid()); -#endif -} - - -/********************************************************************* - * - * Document-class: Process::Status - * - * Process::Status encapsulates the information on the - * status of a running or terminated system process. The built-in - * variable $? is either +nil+ or a - * Process::Status object. - * - * fork { exit 99 } #=> 26557 - * Process.wait #=> 26557 - * $?.class #=> Process::Status - * $?.to_i #=> 25344 - * $? >> 8 #=> 99 - * $?.stopped? #=> false - * $?.exited? #=> true - * $?.exitstatus #=> 99 - * - * Posix systems record information on processes using a 16-bit - * integer. The lower bits record the process status (stopped, - * exited, signaled) and the upper bits possibly contain additional - * information (for example the program's return code in the case of - * exited processes). Pre Ruby 1.8, these bits were exposed directly - * to the Ruby program. Ruby now encapsulates these in a - * Process::Status object. To maximize compatibility, - * however, these objects retain a bit-oriented interface. In the - * descriptions that follow, when we talk about the integer value of - * _stat_, we're referring to this 16 bit value. - */ - -static VALUE rb_cProcStatus; -VALUE rb_last_status = Qnil; - -static void -last_status_set(status, pid) - int status, pid; -{ - rb_last_status = rb_obj_alloc(rb_cProcStatus); - rb_iv_set(rb_last_status, "status", INT2FIX(status)); - rb_iv_set(rb_last_status, "pid", INT2FIX(pid)); -} - - -/* - * call-seq: - * stat.to_i => fixnum - * stat.to_int => fixnum - * - * Returns the bits in _stat_ as a Fixnum. Poking - * around in these bits is platform dependent. - * - * fork { exit 0xab } #=> 26566 - * Process.wait #=> 26566 - * sprintf('%04x', $?.to_i) #=> "ab00" - */ - -static VALUE -pst_to_i(st) - VALUE st; -{ - return rb_iv_get(st, "status"); -} - - -/* - * call-seq: - * stat.to_s => string - * - * Equivalent to _stat_.to_i.to_s. - */ - -static VALUE -pst_to_s(st) - VALUE st; -{ - return rb_fix2str(pst_to_i(st), 10); -} - - -/* - * call-seq: - * stat.pid => fixnum - * - * Returns the process ID that this status object represents. - * - * fork { exit } #=> 26569 - * Process.wait #=> 26569 - * $?.pid #=> 26569 - */ - -static VALUE -pst_pid(st) - VALUE st; -{ - return rb_iv_get(st, "pid"); -} - - -/* - * call-seq: - * stat.inspect => string - * - * Override the inspection method. - */ - -static VALUE -pst_inspect(st) - VALUE st; -{ - VALUE pid; - int status; - VALUE str; - char buf[256]; - - pid = pst_pid(st); - status = NUM2INT(st); - - snprintf(buf, sizeof(buf), "#<%s: pid=%ld", rb_class2name(CLASS_OF(st)), NUM2LONG(pid)); - str = rb_str_new2(buf); - if (WIFSTOPPED(status)) { - int stopsig = WSTOPSIG(status); - const char *signame = ruby_signal_name(stopsig); - if (signame) { - snprintf(buf, sizeof(buf), ",stopped(SIG%s=%d)", signame, stopsig); - } - else { - snprintf(buf, sizeof(buf), ",stopped(%d)", stopsig); - } - rb_str_cat2(str, buf); - } - if (WIFSIGNALED(status)) { - int termsig = WTERMSIG(status); - const char *signame = ruby_signal_name(termsig); - if (signame) { - snprintf(buf, sizeof(buf), ",signaled(SIG%s=%d)", signame, termsig); - } - else { - snprintf(buf, sizeof(buf), ",signaled(%d)", termsig); - } - rb_str_cat2(str, buf); - } - if (WIFEXITED(status)) { - snprintf(buf, sizeof(buf), ",exited(%d)", WEXITSTATUS(status)); - rb_str_cat2(str, buf); - } -#ifdef WCOREDUMP - if (WCOREDUMP(status)) { - rb_str_cat2(str, ",coredumped"); - } -#endif - rb_str_cat2(str, ">"); - return str; -} - - -/* - * call-seq: - * stat == other => true or false - * - * Returns +true+ if the integer value of _stat_ - * equals other. - */ - -static VALUE -pst_equal(st1, st2) - VALUE st1, st2; -{ - if (st1 == st2) return Qtrue; - return rb_equal(pst_to_i(st1), st2); -} - - -/* - * call-seq: - * stat & num => fixnum - * - * Logical AND of the bits in _stat_ with num. - * - * fork { exit 0x37 } - * Process.wait - * sprintf('%04x', $?.to_i) #=> "3700" - * sprintf('%04x', $? & 0x1e00) #=> "1600" - */ - -static VALUE -pst_bitand(st1, st2) - VALUE st1, st2; -{ - int status = NUM2INT(st1) & NUM2INT(st2); - - return INT2NUM(status); -} - - -/* - * call-seq: - * stat >> num => fixnum - * - * Shift the bits in _stat_ right num places. - * - * fork { exit 99 } #=> 26563 - * Process.wait #=> 26563 - * $?.to_i #=> 25344 - * $? >> 8 #=> 99 - */ - -static VALUE -pst_rshift(st1, st2) - VALUE st1, st2; -{ - int status = NUM2INT(st1) >> NUM2INT(st2); - - return INT2NUM(status); -} - - -/* - * call-seq: - * stat.stopped? => true or false - * - * Returns +true+ if this process is stopped. This is only - * returned if the corresponding wait call had the - * WUNTRACED flag set. - */ - -static VALUE -pst_wifstopped(st) - VALUE st; -{ - int status = NUM2INT(st); - - if (WIFSTOPPED(status)) - return Qtrue; - else - return Qfalse; -} - - -/* - * call-seq: - * stat.stopsig => fixnum or nil - * - * Returns the number of the signal that caused _stat_ to stop - * (or +nil+ if self is not stopped). - */ - -static VALUE -pst_wstopsig(st) - VALUE st; -{ - int status = NUM2INT(st); - - if (WIFSTOPPED(status)) - return INT2NUM(WSTOPSIG(status)); - return Qnil; -} - - -/* - * call-seq: - * stat.signaled? => true or false - * - * Returns +true+ if _stat_ terminated because of - * an uncaught signal. - */ - -static VALUE -pst_wifsignaled(st) - VALUE st; -{ - int status = NUM2INT(st); - - if (WIFSIGNALED(status)) - return Qtrue; - else - return Qfalse; -} - - -/* - * call-seq: - * stat.termsig => fixnum or nil - * - * Returns the number of the signal that caused _stat_ to - * terminate (or +nil+ if self was not terminated by an - * uncaught signal). - */ - -static VALUE -pst_wtermsig(st) - VALUE st; -{ - int status = NUM2INT(st); - - if (WIFSIGNALED(status)) - return INT2NUM(WTERMSIG(status)); - return Qnil; -} - - -/* - * call-seq: - * stat.exited? => true or false - * - * Returns +true+ if _stat_ exited normally (for - * example using an exit() call or finishing the - * program). - */ - -static VALUE -pst_wifexited(st) - VALUE st; -{ - int status = NUM2INT(st); - - if (WIFEXITED(status)) - return Qtrue; - else - return Qfalse; -} - - -/* - * call-seq: - * stat.exitstatus => fixnum or nil - * - * Returns the least significant eight bits of the return code of - * _stat_. Only available if exited? is - * +true+. - * - * fork { } #=> 26572 - * Process.wait #=> 26572 - * $?.exited? #=> true - * $?.exitstatus #=> 0 - * - * fork { exit 99 } #=> 26573 - * Process.wait #=> 26573 - * $?.exited? #=> true - * $?.exitstatus #=> 99 - */ - -static VALUE -pst_wexitstatus(st) - VALUE st; -{ - int status = NUM2INT(st); - - if (WIFEXITED(status)) - return INT2NUM(WEXITSTATUS(status)); - return Qnil; -} - - -/* - * call-seq: - * stat.success? => true, false or nil - * - * Returns +true+ if _stat_ is successful, +false+ if not. - * Returns +nil+ if exited? is not +true+. - */ - -static VALUE -pst_success_p(st) - VALUE st; -{ - int status = NUM2INT(st); - - if (!WIFEXITED(status)) - return Qnil; - return WEXITSTATUS(status) == EXIT_SUCCESS ? Qtrue : Qfalse; -} - - -/* - * call-seq: - * stat.coredump? => true or false - * - * Returns +true+ if _stat_ generated a coredump - * when it terminated. Not available on all platforms. - */ - -static VALUE -pst_wcoredump(st) - VALUE st; -{ -#ifdef WCOREDUMP - int status = NUM2INT(st); - - if (WCOREDUMP(status)) - return Qtrue; - else - return Qfalse; -#else - return Qfalse; -#endif -} - -#if !defined(HAVE_WAITPID) && !defined(HAVE_WAIT4) -#define NO_WAITPID -static st_table *pid_tbl; -#endif - -int -rb_waitpid(pid, st, flags) - int pid; - int *st; - int flags; -{ - int result; -#ifndef NO_WAITPID - int oflags = flags; - if (!rb_thread_alone()) { /* there're other threads to run */ - flags |= WNOHANG; - } - - retry: - TRAP_BEG; -#ifdef HAVE_WAITPID - result = waitpid(pid, st, flags); -#else /* HAVE_WAIT4 */ - result = wait4(pid, st, flags, NULL); -#endif - TRAP_END; - if (result < 0) { - if (errno == EINTR) { - rb_thread_polling(); - goto retry; - } - return -1; - } - if (result == 0) { - if (oflags & WNOHANG) return 0; - rb_thread_polling(); - if (rb_thread_alone()) flags = oflags; - goto retry; - } -#else /* NO_WAITPID */ - if (pid_tbl && st_lookup(pid_tbl, pid, st)) { - last_status_set(*st, pid); - st_delete(pid_tbl, (st_data_t*)&pid, NULL); - return pid; - } - - if (flags) { - rb_raise(rb_eArgError, "can't do waitpid with flags"); - } - - for (;;) { - TRAP_BEG; - result = wait(st); - TRAP_END; - if (result < 0) { - if (errno == EINTR) { - rb_thread_schedule(); - continue; - } - return -1; - } - if (result == pid) { - break; - } - if (!pid_tbl) - pid_tbl = st_init_numtable(); - st_insert(pid_tbl, pid, st); - if (!rb_thread_alone()) rb_thread_schedule(); - } -#endif - if (result > 0) { - last_status_set(*st, result); - } - return result; -} - -#ifdef NO_WAITPID -struct wait_data { - int pid; - int status; -}; - -static int -wait_each(pid, status, data) - int pid, status; - struct wait_data *data; -{ - if (data->status != -1) return ST_STOP; - - data->pid = pid; - data->status = status; - return ST_DELETE; -} - -static int -waitall_each(pid, status, ary) - int pid, status; - VALUE ary; -{ - last_status_set(status, pid); - rb_ary_push(ary, rb_assoc_new(INT2NUM(pid), rb_last_status)); - return ST_DELETE; -} -#endif - - -/* [MG]:FIXME: I wasn't sure how this should be done, since ::wait() - has historically been documented as if it didn't take any arguments - despite the fact that it's just an alias for ::waitpid(). The way I - have it below is more truthful, but a little confusing. - - I also took the liberty of putting in the pid values, as they're - pretty useful, and it looked as if the original 'ri' output was - supposed to contain them after "[...]depending on the value of - aPid:". - - The 'ansi' and 'bs' formats of the ri output don't display the - definition list for some reason, but the plain text one does. - */ - -/* - * call-seq: - * Process.wait() => fixnum - * Process.wait(pid=-1, flags=0) => fixnum - * Process.waitpid(pid=-1, flags=0) => fixnum - * - * Waits for a child process to exit, returns its process id, and - * sets $? to a Process::Status object - * containing information on that process. Which child it waits on - * depends on the value of _pid_: - * - * > 0:: Waits for the child whose process ID equals _pid_. - * - * 0:: Waits for any child whose process group ID equals that of the - * calling process. - * - * -1:: Waits for any child process (the default if no _pid_ is - * given). - * - * < -1:: Waits for any child whose process group ID equals the absolute - * value of _pid_. - * - * The _flags_ argument may be a logical or of the flag values - * Process::WNOHANG (do not block if no child available) - * or Process::WUNTRACED (return stopped children that - * haven't been reported). Not all flags are available on all - * platforms, but a flag value of zero will work on all platforms. - * - * Calling this method raises a SystemError if there are - * no child processes. Not available on all platforms. - * - * include Process - * fork { exit 99 } #=> 27429 - * wait #=> 27429 - * $?.exitstatus #=> 99 - * - * pid = fork { sleep 3 } #=> 27440 - * Time.now #=> Wed Apr 09 08:57:09 CDT 2003 - * waitpid(pid, Process::WNOHANG) #=> nil - * Time.now #=> Wed Apr 09 08:57:09 CDT 2003 - * waitpid(pid, 0) #=> 27440 - * Time.now #=> Wed Apr 09 08:57:12 CDT 2003 - */ - -static VALUE -proc_wait(argc, argv) - int argc; - VALUE *argv; -{ - VALUE vpid, vflags; - int pid, flags, status; - - rb_secure(2); - flags = 0; - rb_scan_args(argc, argv, "02", &vpid, &vflags); - if (argc == 0) { - pid = -1; - } - else { - pid = NUM2INT(vpid); - if (argc == 2 && !NIL_P(vflags)) { - flags = NUM2UINT(vflags); - } - } - if ((pid = rb_waitpid(pid, &status, flags)) < 0) - rb_sys_fail(0); - if (pid == 0) { - return rb_last_status = Qnil; - } - return INT2FIX(pid); -} - - -/* - * call-seq: - * Process.wait2(pid=-1, flags=0) => [pid, status] - * Process.waitpid2(pid=-1, flags=0) => [pid, status] - * - * Waits for a child process to exit (see Process::waitpid for exact - * semantics) and returns an array containing the process id and the - * exit status (a Process::Status object) of that - * child. Raises a SystemError if there are no child - * processes. - * - * Process.fork { exit 99 } #=> 27437 - * pid, status = Process.wait2 - * pid #=> 27437 - * status.exitstatus #=> 99 - */ - -static VALUE -proc_wait2(argc, argv) - int argc; - VALUE *argv; -{ - VALUE pid = proc_wait(argc, argv); - if (NIL_P(pid)) return Qnil; - return rb_assoc_new(pid, rb_last_status); -} - - -/* - * call-seq: - * Process.waitall => [ [pid1,status1], ...] - * - * Waits for all children, returning an array of - * _pid_/_status_ pairs (where _status_ is a - * Process::Status object). - * - * fork { sleep 0.2; exit 2 } #=> 27432 - * fork { sleep 0.1; exit 1 } #=> 27433 - * fork { exit 0 } #=> 27434 - * p Process.waitall - * - * produces: - * - * [[27434, #], - * [27433, #], - * [27432, #]] - */ - -static VALUE -proc_waitall() -{ - VALUE result; - int pid, status; - - rb_secure(2); - result = rb_ary_new(); -#ifdef NO_WAITPID - if (pid_tbl) { - st_foreach(pid_tbl, waitall_each, result); - } - - for (pid = -1;;) { - pid = wait(&status); - if (pid == -1) { - if (errno == ECHILD) - break; - if (errno == EINTR) { - rb_thread_schedule(); - continue; - } - rb_sys_fail(0); - } - last_status_set(status, pid); - rb_ary_push(result, rb_assoc_new(INT2NUM(pid), rb_last_status)); - } -#else - rb_last_status = Qnil; - for (pid = -1;;) { - pid = rb_waitpid(-1, &status, 0); - if (pid == -1) { - if (errno == ECHILD) - break; - rb_sys_fail(0); - } - rb_ary_push(result, rb_assoc_new(INT2NUM(pid), rb_last_status)); - } -#endif - return result; -} - -static VALUE -detach_process_watcher(arg) - void *arg; -{ - int pid = (int)(VALUE)arg, status; - - while (rb_waitpid(pid, &status, WNOHANG) == 0) { - rb_thread_sleep(1); - } - return rb_last_status; -} - -VALUE -rb_detach_process(pid) - int pid; -{ - return rb_thread_create(detach_process_watcher, (void*)(VALUE)pid); -} - - -/* - * call-seq: - * Process.detach(pid) => thread - * - * Some operating systems retain the status of terminated child - * processes until the parent collects that status (normally using - * some variant of wait(). If the parent never collects - * this status, the child stays around as a zombie process. - * Process::detach prevents this by setting up a - * separate Ruby thread whose sole job is to reap the status of the - * process _pid_ when it terminates. Use detach - * only when you do not intent to explicitly wait for the child to - * terminate. detach only checks the status - * periodically (currently once each second). - * - * The waiting thread returns the exit status of the detached process - * when it terminates, so you can use Thread#join to - * know the result. If specified _pid_ is not a valid child process - * ID, the thread returns +nil+ immediately. - * - * In this first example, we don't reap the first child process, so - * it appears as a zombie in the process status display. - * - * p1 = fork { sleep 0.1 } - * p2 = fork { sleep 0.2 } - * Process.waitpid(p2) - * sleep 2 - * system("ps -ho pid,state -p #{p1}") - * - * produces: - * - * 27389 Z - * - * In the next example, Process::detach is used to reap - * the child automatically. - * - * p1 = fork { sleep 0.1 } - * p2 = fork { sleep 0.2 } - * Process.detach(p1) - * Process.waitpid(p2) - * sleep 2 - * system("ps -ho pid,state -p #{p1}") - * - * (produces no output) - */ - -static VALUE -proc_detach(VALUE obj, VALUE pid) -{ - rb_secure(2); - return rb_detach_process(NUM2INT(pid)); -} - -#ifndef HAVE_STRING_H -char *strtok(); -#endif - -#ifdef HAVE_SETITIMER -#define before_exec() rb_thread_stop_timer() -#define after_exec() rb_thread_start_timer() -#else -#define before_exec() -#define after_exec() -#endif - -extern char *dln_find_exe(); - -static void -security(str) - char *str; -{ - if (rb_env_path_tainted()) { - if (rb_safe_level() > 0) { - rb_raise(rb_eSecurityError, "Insecure PATH - %s", str); - } - } -} - -static int -proc_exec_v(argv, prog) - char **argv; - char *prog; -{ - if (!prog) - prog = argv[0]; - security(prog); - prog = dln_find_exe(prog, 0); - if (!prog) - return -1; - -#if (defined(MSDOS) && !defined(DJGPP)) || defined(__human68k__) || defined(__EMX__) || defined(OS2) - { -#if defined(__human68k__) -#define COMMAND "command.x" -#endif -#if defined(__EMX__) || defined(OS2) /* OS/2 emx */ -#define COMMAND "cmd.exe" -#endif -#if (defined(MSDOS) && !defined(DJGPP)) -#define COMMAND "command.com" -#endif - char *extension; - - if ((extension = strrchr(prog, '.')) != NULL && strcasecmp(extension, ".bat") == 0) { - char **new_argv; - char *p; - int n; - - for (n = 0; argv[n]; n++) - /* no-op */; - new_argv = ALLOCA_N(char*, n + 2); - for (; n > 0; n--) - new_argv[n + 1] = argv[n]; - new_argv[1] = strcpy(ALLOCA_N(char, strlen(argv[0]) + 1), argv[0]); - for (p = new_argv[1]; *p != '\0'; p++) - if (*p == '/') - *p = '\\'; - new_argv[0] = COMMAND; - argv = new_argv; - prog = dln_find_exe(argv[0], 0); - if (!prog) { - errno = ENOENT; - return -1; - } - } - } -#endif /* MSDOS or __human68k__ or __EMX__ */ - before_exec(); - rb_thread_cancel_timer(); - execv(prog, argv); - preserving_errno(after_exec()); - return -1; -} - -static int -proc_exec_n(argc, argv, progv) - int argc; - VALUE *argv; - VALUE progv; -{ - char *prog = 0; - char **args; - int i; - - if (progv) { - prog = RSTRING(progv)->ptr; - } - args = ALLOCA_N(char*, argc+1); - for (i=0; iptr; - } - args[i] = 0; - if (args[0]) { - return proc_exec_v(args, prog); - } - return -1; -} - -int -rb_proc_exec(str) - const char *str; -{ - const char *s = str; - char *ss, *t; - char **argv, **a; - - while (*str && ISSPACE(*str)) - str++; - -#ifdef _WIN32 - before_exec(); - do_spawn(P_OVERLAY, (char *)str); - after_exec(); -#else - for (s=str; *s; s++) { - if (*s != ' ' && !ISALPHA(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) { -#if defined(MSDOS) - int status; - before_exec(); - status = system(str); - after_exec(); - if (status != -1) - exit(status); -#else -#if defined(__human68k__) || defined(__CYGWIN32__) || defined(__EMX__) - char *shell = dln_find_exe("sh", 0); - int status = -1; - before_exec(); - if (shell) - execl(shell, "sh", "-c", str, (char *) NULL); - else - status = system(str); - after_exec(); - if (status != -1) - exit(status); -#else - before_exec(); - execl("/bin/sh", "sh", "-c", str, (char *)NULL); - preserving_errno(after_exec()); -#endif -#endif - return -1; - } - } - a = argv = ALLOCA_N(char*, (s-str)/2+2); - ss = ALLOCA_N(char, s-str+1); - strcpy(ss, str); - if ((*a++ = strtok(ss, " \t")) != 0) { - while ((t = strtok(NULL, " \t")) != 0) { - *a++ = t; - } - *a = NULL; - } - if (argv[0]) { - return proc_exec_v(argv, 0); - } - errno = ENOENT; -#endif /* _WIN32 */ - return -1; -} - -#if defined(__human68k__) || defined(__DJGPP__) || defined(_WIN32) -static int -proc_spawn_v(argv, prog) - char **argv; - char *prog; -{ - char *extension; - int status; - - if (!prog) - prog = argv[0]; - security(prog); - prog = dln_find_exe(prog, 0); - if (!prog) - return -1; - -#if defined(__human68k__) - if ((extension = strrchr(prog, '.')) != NULL && strcasecmp(extension, ".bat") == 0) { - char **new_argv; - char *p; - int n; - - for (n = 0; argv[n]; n++) - /* no-op */; - new_argv = ALLOCA_N(char*, n + 2); - for (; n > 0; n--) - new_argv[n + 1] = argv[n]; - new_argv[1] = strcpy(ALLOCA_N(char, strlen(argv[0]) + 1), argv[0]); - for (p = new_argv[1]; *p != '\0'; p++) - if (*p == '/') - *p = '\\'; - new_argv[0] = COMMAND; - argv = new_argv; - prog = dln_find_exe(argv[0], 0); - if (!prog) { - errno = ENOENT; - return -1; - } - } -#endif - before_exec(); -#if defined(_WIN32) - status = do_aspawn(P_WAIT, prog, argv); -#else - status = spawnv(P_WAIT, prog, argv); -#endif - after_exec(); - return status; -} - -static int -proc_spawn_n(argc, argv, prog) - int argc; - VALUE *argv; - VALUE prog; -{ - char **args; - int i; - - args = ALLOCA_N(char*, argc + 1); - for (i = 0; i < argc; i++) { - SafeStringValue(argv[i]); - args[i] = StringValueCStr(argv[i]); - } - if (prog) - SafeStringValue(prog); - args[i] = (char*) 0; - if (args[0]) - return proc_spawn_v(args, prog ? StringValueCStr(prog) : 0); - return -1; -} - -#if !defined(_WIN32) -static int -proc_spawn(sv) - VALUE sv; -{ - char *str; - char *s, *t; - char **argv, **a; - int status; - - SafeStringValue(sv); - str = s = StringValueCStr(sv); - for (s = str; *s; s++) { - if (*s != ' ' && !ISALPHA(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) { - char *shell = dln_find_exe("sh", 0); - before_exec(); - status = shell?spawnl(P_WAIT,shell,"sh","-c",str,(char*)NULL):system(str); - after_exec(); - return status; - } - } - a = argv = ALLOCA_N(char*, (s - str) / 2 + 2); - s = ALLOCA_N(char, s - str + 1); - strcpy(s, str); - if (*a++ = strtok(s, " \t")) { - while (t = strtok(NULL, " \t")) - *a++ = t; - *a = NULL; - } - return argv[0] ? proc_spawn_v(argv, 0) : -1; -} -#endif -#endif - -struct rb_exec_arg { - int argc; - VALUE *argv; - VALUE prog; -}; - -static void -proc_prepare_args(e, argc, argv, prog) - struct rb_exec_arg *e; - int argc; - VALUE *argv; - VALUE prog; -{ - int i; - - MEMZERO(e, struct rb_exec_arg, 1); - if (prog) { - SafeStringValue(prog); - StringValueCStr(prog); - } - for (i = 0; i < argc; i++) { - SafeStringValue(argv[i]); - StringValueCStr(argv[i]); - } - security(RSTRING(prog ? prog : argv[0])->ptr); - e->prog = prog; - e->argc = argc; - e->argv = argv; -} - -static VALUE -proc_exec_args(earg) - VALUE earg; -{ - struct rb_exec_arg *e = (struct rb_exec_arg *)earg; - int argc = e->argc; - VALUE *argv = e->argv; - VALUE prog = e->prog; - - if (argc == 1 && prog == 0) { - return (VALUE)rb_proc_exec(RSTRING(argv[0])->ptr); - } - else { - return (VALUE)proc_exec_n(argc, argv, prog); - } -} - -/* - * call-seq: - * exec(command [, arg, ...]) - * - * Replaces the current process by running the given external _command_. - * If +exec+ is given a single argument, that argument is - * taken as a line that is subject to shell expansion before being - * executed. If multiple arguments are given, the second and subsequent - * arguments are passed as parameters to _command_ with no shell - * expansion. If the first argument is a two-element array, the first - * element is the command to be executed, and the second argument is - * used as the argv[0] value, which may show up in process - * listings. In MSDOS environments, the command is executed in a - * subshell; otherwise, one of the exec(2) system calls is - * used, so the running command may inherit some of the environment of - * the original program (including open file descriptors). - * - * exec "echo *" # echoes list of files in current directory - * # never get here - * - * - * exec "echo", "*" # echoes an asterisk - * # never get here - */ - -VALUE -rb_f_exec(argc, argv) - int argc; - VALUE *argv; -{ - VALUE prog = 0; - VALUE tmp; - struct rb_exec_arg earg; - - if (argc == 0) { - rb_last_status = Qnil; - rb_raise(rb_eArgError, "wrong number of arguments"); - } - - tmp = rb_check_array_type(argv[0]); - if (!NIL_P(tmp)) { - if (RARRAY(tmp)->len != 2) { - rb_raise(rb_eArgError, "wrong first argument"); - } - prog = RARRAY(tmp)->ptr[0]; - argv[0] = RARRAY(tmp)->ptr[1]; - SafeStringValue(prog); - } - proc_prepare_args(&earg, argc, argv, prog); - proc_exec_args((VALUE)&earg); - rb_sys_fail(RSTRING(argv[0])->ptr); - return Qnil; /* dummy */ -} - - -/* - * call-seq: - * Kernel.fork [{ block }] => fixnum or nil - * Process.fork [{ block }] => fixnum or nil - * - * Creates a subprocess. If a block is specified, that block is run - * in the subprocess, and the subprocess terminates with a status of - * zero. Otherwise, the +fork+ call returns twice, once in - * the parent, returning the process ID of the child, and once in - * the child, returning _nil_. The child process can exit using - * Kernel.exit! to avoid running any - * at_exit functions. The parent process should - * use Process.wait to collect the termination statuses - * of its children or use Process.detach to register - * disinterest in their status; otherwise, the operating system - * may accumulate zombie processes. - * - * The thread calling fork is the only thread in the created child process. - * fork doesn't copy other threads. - */ - -static VALUE -rb_f_fork(obj) - VALUE obj; -{ -#if !defined(__human68k__) && !defined(_WIN32) && !defined(__MACOS__) && !defined(__EMX__) && !defined(__VMS) - int pid; - - rb_secure(2); - -#ifndef __VMS - fflush(stdout); - fflush(stderr); -#endif - - switch (pid = fork()) { - case 0: -#ifdef linux - after_exec(); -#endif - rb_thread_atfork(); - if (rb_block_given_p()) { - int status; - - rb_protect(rb_yield, Qundef, &status); - ruby_stop(status); - } - return Qnil; - - case -1: - rb_sys_fail("fork(2)"); - return Qnil; - - default: - return INT2FIX(pid); - } -#else - rb_notimplement(); -#endif -} - - -/* - * call-seq: - * Process.exit!(fixnum=-1) - * - * Exits the process immediately. No exit handlers are - * run. fixnum is returned to the underlying system as the - * exit status. - * - * Process.exit!(0) - */ - -static VALUE -rb_f_exit_bang(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - VALUE status; - int istatus; - - rb_secure(4); - if (rb_scan_args(argc, argv, "01", &status) == 1) { - switch (status) { - case Qtrue: - istatus = EXIT_SUCCESS; - break; - case Qfalse: - istatus = EXIT_FAILURE; - break; - default: - istatus = NUM2INT(status); - break; - } - } - else { - istatus = EXIT_FAILURE; - } - _exit(istatus); - - return Qnil; /* not reached */ -} - -#if defined(sun) -#define signal(a,b) sigset(a,b) -#endif - -void -rb_syswait(pid) - int pid; -{ - static int overriding; -#ifdef SIGHUP - RETSIGTYPE (*hfunc)_((int)); -#endif -#ifdef SIGQUIT - RETSIGTYPE (*qfunc)_((int)); -#endif - RETSIGTYPE (*ifunc)_((int)); - int status; - int i, hooked = Qfalse; - - if (!overriding) { -#ifdef SIGHUP - hfunc = signal(SIGHUP, SIG_IGN); -#endif -#ifdef SIGQUIT - qfunc = signal(SIGQUIT, SIG_IGN); -#endif - ifunc = signal(SIGINT, SIG_IGN); - overriding = Qtrue; - hooked = Qtrue; - } - - do { - i = rb_waitpid(pid, &status, 0); - } while (i == -1 && errno == EINTR); - - if (hooked) { -#ifdef SIGHUP - signal(SIGHUP, hfunc); -#endif -#ifdef SIGQUIT - signal(SIGQUIT, qfunc); -#endif - signal(SIGINT, ifunc); - overriding = Qfalse; - } -} - -/* - * call-seq: - * system(cmd [, arg, ...]) => true or false - * - * Executes _cmd_ in a subshell, returning +true+ if - * the command was found and ran successfully, +false+ - * otherwise. An error status is available in $?. The - * arguments are processed in the same way as for - * Kernel::exec. - * - * system("echo *") - * system("echo", "*") - * - * produces: - * - * config.h main.rb - * * - */ - -static VALUE -rb_f_system(argc, argv) - int argc; - VALUE *argv; -{ - int status; -#if defined(__EMX__) - VALUE cmd; - - fflush(stdout); - fflush(stderr); - if (argc == 0) { - rb_last_status = Qnil; - rb_raise(rb_eArgError, "wrong number of arguments"); - } - - if (TYPE(argv[0]) == T_ARRAY) { - if (RARRAY(argv[0])->len != 2) { - rb_raise(rb_eArgError, "wrong first argument"); - } - argv[0] = RARRAY(argv[0])->ptr[0]; - } - cmd = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" ")); - - SafeStringValue(cmd); - status = do_spawn(RSTRING(cmd)->ptr); - last_status_set(status, 0); -#elif defined(__human68k__) || defined(__DJGPP__) || defined(_WIN32) - volatile VALUE prog = 0; - - fflush(stdout); - fflush(stderr); - if (argc == 0) { - rb_last_status = Qnil; - rb_raise(rb_eArgError, "wrong number of arguments"); - } - - if (TYPE(argv[0]) == T_ARRAY) { - if (RARRAY(argv[0])->len != 2) { - rb_raise(rb_eArgError, "wrong first argument"); - } - prog = RARRAY(argv[0])->ptr[0]; - argv[0] = RARRAY(argv[0])->ptr[1]; - } - - if (argc == 1 && prog == 0) { -#if defined(_WIN32) - SafeStringValue(argv[0]); - status = do_spawn(P_WAIT, StringValueCStr(argv[0])); -#else - status = proc_spawn(argv[0]); -#endif - } - else { - status = proc_spawn_n(argc, argv, prog); - } -#if !defined(_WIN32) - last_status_set(status == -1 ? 127 : status, 0); -#else - if (status == -1) - last_status_set(0x7f << 8, 0); -#endif -#elif defined(__VMS) - VALUE cmd; - - if (argc == 0) { - rb_last_status = Qnil; - rb_raise(rb_eArgError, "wrong number of arguments"); - } - - if (TYPE(argv[0]) == T_ARRAY) { - if (RARRAY(argv[0])->len != 2) { - rb_raise(rb_eArgError, "wrong first argument"); - } - argv[0] = RARRAY(argv[0])->ptr[0]; - } - cmd = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" ")); - - SafeStringValue(cmd); - status = system(StringValueCStr(cmd)); - last_status_set((status & 0xff) << 8, 0); -#else - volatile VALUE prog = 0; - int pid; - struct rb_exec_arg earg; - RETSIGTYPE (*chfunc)(int); - - fflush(stdout); - fflush(stderr); - if (argc == 0) { - rb_last_status = Qnil; - rb_raise(rb_eArgError, "wrong number of arguments"); - } - - if (TYPE(argv[0]) == T_ARRAY) { - if (RARRAY(argv[0])->len != 2) { - rb_raise(rb_eArgError, "wrong first argument"); - } - prog = RARRAY(argv[0])->ptr[0]; - argv[0] = RARRAY(argv[0])->ptr[1]; - } - proc_prepare_args(&earg, argc, argv, prog); - - chfunc = signal(SIGCHLD, SIG_DFL); - retry: - pid = fork(); - if (pid == 0) { - /* child process */ - rb_thread_atfork(); - rb_protect(proc_exec_args, (VALUE)&earg, NULL); - _exit(127); - } - if (pid < 0) { - if (errno == EAGAIN) { - rb_thread_sleep(1); - goto retry; - } - } - else { - rb_syswait(pid); - } - signal(SIGCHLD, chfunc); - if (pid < 0) rb_sys_fail(0); - status = NUM2INT(rb_last_status); -#endif - - if (status == EXIT_SUCCESS) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * sleep([duration]) => fixnum - * - * Suspends the current thread for _duration_ seconds (which may be any number, - * including a +Float+ with fractional seconds). Returns the actual number of - * seconds slept (rounded), which may be less than that asked for if another - * thread calls Thread#run. Zero arguments causes +sleep+ to sleep - * forever. - * - * Time.new #=> Wed Apr 09 08:56:32 CDT 2003 - * sleep 1.2 #=> 1 - * Time.new #=> Wed Apr 09 08:56:33 CDT 2003 - * sleep 1.9 #=> 2 - * Time.new #=> Wed Apr 09 08:56:35 CDT 2003 - */ - -static VALUE -rb_f_sleep(argc, argv) - int argc; - VALUE *argv; -{ - int beg, end; - - beg = time(0); - if (argc == 0) { - rb_thread_sleep_forever(); - } - else if (argc == 1) { - rb_thread_wait_for(rb_time_interval(argv[0])); - } - else { - rb_raise(rb_eArgError, "wrong number of arguments"); - } - - end = time(0) - beg; - - return INT2FIX(end); -} - - -/* - * call-seq: - * Process.getpgrp => integer - * - * Returns the process group ID for this process. Not available on - * all platforms. - * - * Process.getpgid(0) #=> 25527 - * Process.getpgrp #=> 25527 - */ - -#if defined(SIGCLD) && !defined(SIGCHLD) -# define SIGCHLD SIGCLD -#endif - -static VALUE -proc_getpgrp() -{ - int pgrp; - - rb_secure(2); -#if defined(HAVE_GETPGRP) && defined(GETPGRP_VOID) - pgrp = getpgrp(); - if (pgrp < 0) rb_sys_fail(0); - return INT2FIX(pgrp); -#else -# ifdef HAVE_GETPGID - pgrp = getpgid(0); - if (pgrp < 0) rb_sys_fail(0); - return INT2FIX(pgrp); -# else - rb_notimplement(); -# endif -#endif -} - - -/* - * call-seq: - * Process.setpgrp => 0 - * - * Equivalent to setpgid(0,0). Not available on all - * platforms. - */ - -static VALUE -proc_setpgrp() -{ - rb_secure(2); - /* check for posix setpgid() first; this matches the posix */ - /* getpgrp() above. It appears that configure will set SETPGRP_VOID */ - /* even though setpgrp(0,0) would be prefered. The posix call avoids */ - /* this confusion. */ -#ifdef HAVE_SETPGID - if (setpgid(0,0) < 0) rb_sys_fail(0); -#elif defined(HAVE_SETPGRP) && defined(SETPGRP_VOID) - if (setpgrp() < 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return INT2FIX(0); -} - - -/* - * call-seq: - * Process.getpgid(pid) => integer - * - * Returns the process group ID for the given process id. Not - * available on all platforms. - * - * Process.getpgid(Process.ppid()) #=> 25527 - */ - -static VALUE -proc_getpgid(obj, pid) - VALUE obj, pid; -{ -#if defined(HAVE_GETPGID) && !defined(__CHECKER__) - int i; - - rb_secure(2); - i = getpgid(NUM2INT(pid)); - if (i < 0) rb_sys_fail(0); - return INT2NUM(i); -#else - rb_notimplement(); -#endif -} - - -/* - * call-seq: - * Process.setpgid(pid, integer) => 0 - * - * Sets the process group ID of _pid_ (0 indicates this - * process) to integer. Not available on all platforms. - */ - -static VALUE -proc_setpgid(obj, pid, pgrp) - VALUE obj, pid, pgrp; -{ -#ifdef HAVE_SETPGID - int ipid, ipgrp; - - rb_secure(2); - ipid = NUM2INT(pid); - ipgrp = NUM2INT(pgrp); - - if (setpgid(ipid, ipgrp) < 0) rb_sys_fail(0); - return INT2FIX(0); -#else - rb_notimplement(); -#endif -} - - -/* - * call-seq: - * Process.setsid => fixnum - * - * Establishes this process as a new session and process group - * leader, with no controlling tty. Returns the session id. Not - * available on all platforms. - * - * Process.setsid #=> 27422 - */ - -static VALUE -proc_setsid() -{ -#if defined(HAVE_SETSID) - int pid; - - rb_secure(2); - pid = setsid(); - if (pid < 0) rb_sys_fail(0); - return INT2FIX(pid); -#elif defined(HAVE_SETPGRP) && defined(TIOCNOTTY) - rb_pid_t pid; - int ret; - - rb_secure(2); - pid = getpid(); -#if defined(SETPGRP_VOID) - ret = setpgrp(); - /* If `pid_t setpgrp(void)' is equivalent to setsid(), - `ret' will be the same value as `pid', and following open() will fail. - In Linux, `int setpgrp(void)' is equivalent to setpgid(0, 0). */ -#else - ret = setpgrp(0, pid); -#endif - if (ret == -1) rb_sys_fail(0); - - if ((fd = open("/dev/tty", O_RDWR)) >= 0) { - ioctl(fd, TIOCNOTTY, NULL); - close(fd); - } - return INT2FIX(pid); -#else - rb_notimplement(); -#endif -} - - -/* - * call-seq: - * Process.getpriority(kind, integer) => fixnum - * - * Gets the scheduling priority for specified process, process group, - * or user. kind indicates the kind of entity to find: one - * of Process::PRIO_PGRP, - * Process::PRIO_USER, or - * Process::PRIO_PROCESS. _integer_ is an id - * indicating the particular process, process group, or user (an id - * of 0 means _current_). Lower priorities are more favorable - * for scheduling. Not available on all platforms. - * - * Process.getpriority(Process::PRIO_USER, 0) #=> 19 - * Process.getpriority(Process::PRIO_PROCESS, 0) #=> 19 - */ - -static VALUE -proc_getpriority(obj, which, who) - VALUE obj, which, who; -{ -#ifdef HAVE_GETPRIORITY - int prio, iwhich, iwho; - - rb_secure(2); - iwhich = NUM2INT(which); - iwho = NUM2INT(who); - - errno = 0; - prio = getpriority(iwhich, iwho); - if (errno) rb_sys_fail(0); - return INT2FIX(prio); -#else - rb_notimplement(); -#endif -} - - -/* - * call-seq: - * Process.setpriority(kind, integer, priority) => 0 - * - * See Process#getpriority. - * - * Process.setpriority(Process::PRIO_USER, 0, 19) #=> 0 - * Process.setpriority(Process::PRIO_PROCESS, 0, 19) #=> 0 - * Process.getpriority(Process::PRIO_USER, 0) #=> 19 - * Process.getpriority(Process::PRIO_PROCESS, 0) #=> 19 - */ - -static VALUE -proc_setpriority(obj, which, who, prio) - VALUE obj, which, who, prio; -{ -#ifdef HAVE_GETPRIORITY - int iwhich, iwho, iprio; - - rb_secure(2); - iwhich = NUM2INT(which); - iwho = NUM2INT(who); - iprio = NUM2INT(prio); - - if (setpriority(iwhich, iwho, iprio) < 0) - rb_sys_fail(0); - return INT2FIX(0); -#else - rb_notimplement(); -#endif -} - -#if SIZEOF_RLIM_T == SIZEOF_INT -# define RLIM2NUM(v) UINT2NUM(v) -# define NUM2RLIM(v) NUM2UINT(v) -#elif SIZEOF_RLIM_T == SIZEOF_LONG -# define RLIM2NUM(v) ULONG2NUM(v) -# define NUM2RLIM(v) NUM2ULONG(v) -#elif SIZEOF_RLIM_T == SIZEOF_LONG_LONG -# define RLIM2NUM(v) ULL2NUM(v) -# define NUM2RLIM(v) NUM2ULL(v) -#endif - -/* - * call-seq: - * Process.getrlimit(resource) => [cur_limit, max_limit] - * - * Gets the resource limit of the process. - * _cur_limit_ means current (soft) limit and - * _max_limit_ means maximum (hard) limit. - * - * _resource_ indicates the kind of resource to limit: - * such as Process::RLIMIT_CORE, - * Process::RLIMIT_CPU, etc. - * See Process.setrlimit for details. - * - * _cur_limit_ and _max_limit_ may be Process::RLIM_INFINITY, - * Process::RLIM_SAVED_MAX or - * Process::RLIM_SAVED_CUR. - * See Process.setrlimit and the system getrlimit(2) manual for details. - */ - -static VALUE -proc_getrlimit(VALUE obj, VALUE resource) -{ -#if defined(HAVE_GETRLIMIT) && defined(RLIM2NUM) - struct rlimit rlim; - - rb_secure(2); - - if (getrlimit(NUM2INT(resource), &rlim) < 0) { - rb_sys_fail("getrlimit"); - } - return rb_assoc_new(RLIM2NUM(rlim.rlim_cur), RLIM2NUM(rlim.rlim_max)); -#else - rb_notimplement(); -#endif -} - -/* - * call-seq: - * Process.setrlimit(resource, cur_limit, max_limit) => nil - * Process.setrlimit(resource, cur_limit) => nil - * - * Sets the resource limit of the process. - * _cur_limit_ means current (soft) limit and - * _max_limit_ means maximum (hard) limit. - * - * If _max_limit_ is not given, _cur_limit_ is used. - * - * _resource_ indicates the kind of resource to limit. - * The list of resources are OS dependent. - * Ruby may support following resources. - * - * [Process::RLIMIT_CORE] core size (bytes) (SUSv3) - * [Process::RLIMIT_CPU] CPU time (seconds) (SUSv3) - * [Process::RLIMIT_DATA] data segment (bytes) (SUSv3) - * [Process::RLIMIT_FSIZE] file size (bytes) (SUSv3) - * [Process::RLIMIT_NOFILE] file descriptors (number) (SUSv3) - * [Process::RLIMIT_STACK] stack size (bytes) (SUSv3) - * [Process::RLIMIT_AS] total available memory (bytes) (SUSv3, NetBSD, FreeBSD, OpenBSD but 4.4BSD-Lite) - * [Process::RLIMIT_MEMLOCK] total size for mlock(2) (bytes) (4.4BSD, GNU/Linux) - * [Process::RLIMIT_NPROC] number of processes for the user (number) (4.4BSD, GNU/Linux) - * [Process::RLIMIT_RSS] resident memory size (bytes) (4.2BSD, GNU/Linux) - * [Process::RLIMIT_SBSIZE] all socket buffers (bytes) (NetBSD, FreeBSD) - * - * Other Process::RLIMIT_??? constants may be defined. - * - * _cur_limit_ and _max_limit_ may be Process::RLIM_INFINITY, - * which means that the resource is not limited. - * They may be Process::RLIM_SAVED_MAX or - * Process::RLIM_SAVED_CUR too. - * See system setrlimit(2) manual for details. - * - */ - -static VALUE -proc_setrlimit(int argc, VALUE *argv, VALUE obj) -{ -#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM) - VALUE resource, rlim_cur, rlim_max; - struct rlimit rlim; - - rb_secure(2); - - rb_scan_args(argc, argv, "21", &resource, &rlim_cur, &rlim_max); - if (rlim_max == Qnil) - rlim_max = rlim_cur; - - rlim.rlim_cur = NUM2RLIM(rlim_cur); - rlim.rlim_max = NUM2RLIM(rlim_max); - - if (setrlimit(NUM2INT(resource), &rlim) < 0) { - rb_sys_fail("setrlimit"); - } - return Qnil; -#else - rb_notimplement(); -#endif -} - -static int under_uid_switch = 0; -static void -check_uid_switch() -{ - rb_secure(2); - if (under_uid_switch) { - rb_raise(rb_eRuntimeError, "can't handle UID while evaluating block given to Process::UID.switch method"); - } -} - -static int under_gid_switch = 0; -static void -check_gid_switch() -{ - rb_secure(2); - if (under_gid_switch) { - rb_raise(rb_eRuntimeError, "can't handle GID while evaluating block given to Process::UID.switch method"); - } -} - - -/********************************************************************* - * Document-class: Process::Sys - * - * The Process::Sys module contains UID and GID - * functions which provide direct bindings to the system calls of the - * same names instead of the more-portable versions of the same - * functionality found in the Process, - * Process::UID, and Process::GID modules. - */ - - -/* - * call-seq: - * Process::Sys.setuid(integer) => nil - * - * Set the user ID of the current process to _integer_. Not - * available on all platforms. - * - */ - -static VALUE -p_sys_setuid(obj, id) - VALUE obj, id; -{ -#if defined HAVE_SETUID - check_uid_switch(); - if (setuid(NUM2INT(id)) != 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return Qnil; -} - - - -/* - * call-seq: - * Process::Sys.setruid(integer) => nil - * - * Set the real user ID of the calling process to _integer_. - * Not available on all platforms. - * - */ - -static VALUE -p_sys_setruid(obj, id) - VALUE obj, id; -{ -#if defined HAVE_SETRUID - check_uid_switch(); - if (setruid(NUM2INT(id)) != 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return Qnil; -} - - -/* - * call-seq: - * Process::Sys.seteuid(integer) => nil - * - * Set the effective user ID of the calling process to - * _integer_. Not available on all platforms. - * - */ - -static VALUE -p_sys_seteuid(obj, id) - VALUE obj, id; -{ -#if defined HAVE_SETEUID - check_uid_switch(); - if (seteuid(NUM2INT(id)) != 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return Qnil; -} - - -/* - * call-seq: - * Process::Sys.setreuid(rid, eid) => nil - * - * Sets the (integer) real and/or effective user IDs of the current - * process to _rid_ and _eid_, respectively. A value of - * -1 for either means to leave that ID unchanged. Not - * available on all platforms. - * - */ - -static VALUE -p_sys_setreuid(obj, rid, eid) - VALUE obj, rid, eid; -{ -#if defined HAVE_SETREUID - check_uid_switch(); - if (setreuid(NUM2INT(rid),NUM2INT(eid)) != 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return Qnil; -} - - -/* - * call-seq: - * Process::Sys.setresuid(rid, eid, sid) => nil - * - * Sets the (integer) real, effective, and saved user IDs of the - * current process to _rid_, _eid_, and _sid_ respectively. A - * value of -1 for any value means to - * leave that ID unchanged. Not available on all platforms. - * - */ - -static VALUE -p_sys_setresuid(obj, rid, eid, sid) - VALUE obj, rid, eid, sid; -{ -#if defined HAVE_SETRESUID - check_uid_switch(); - if (setresuid(NUM2INT(rid),NUM2INT(eid),NUM2INT(sid)) != 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return Qnil; -} - - -/* - * call-seq: - * Process.uid => fixnum - * Process::UID.rid => fixnum - * Process::Sys.getuid => fixnum - * - * Returns the (real) user ID of this process. - * - * Process.uid #=> 501 - */ - -static VALUE -proc_getuid(obj) - VALUE obj; -{ - int uid = getuid(); - return INT2FIX(uid); -} - - -/* - * call-seq: - * Process.uid= integer => numeric - * - * Sets the (integer) user ID for this process. Not available on all - * platforms. - */ - -static VALUE -proc_setuid(obj, id) - VALUE obj, id; -{ - int uid = NUM2INT(id); - - check_uid_switch(); -#if defined(HAVE_SETRESUID) && !defined(__CHECKER__) - if (setresuid(uid, -1, -1) < 0) rb_sys_fail(0); -#elif defined HAVE_SETREUID - if (setreuid(uid, -1) < 0) rb_sys_fail(0); -#elif defined HAVE_SETRUID - if (setruid(uid) < 0) rb_sys_fail(0); -#elif defined HAVE_SETUID - { - if (geteuid() == uid) { - if (setuid(uid) < 0) rb_sys_fail(0); - } - else { - rb_notimplement(); - } - } -#else - rb_notimplement(); -#endif - return INT2FIX(uid); -} - - -/******************************************************************** - * - * Document-class: Process::UID - * - * The Process::UID module contains a collection of - * module functions which can be used to portably get, set, and - * switch the current process's real, effective, and saved user IDs. - * - */ - -static int SAVED_USER_ID = -1; - -#ifdef BROKEN_SETREUID -int -setreuid(ruid, euid) - rb_uid_t ruid, euid; -{ - if (ruid != -1 && ruid != getuid()) { - if (euid == -1) euid = geteuid(); - if (setuid(ruid) < 0) return -1; - } - if (euid != -1 && euid != geteuid()) { - if (seteuid(euid) < 0) return -1; - } - return 0; -} -#endif - -/* - * call-seq: - * Process::UID.change_privilege(integer) => fixnum - * - * Change the current process's real and effective user ID to that - * specified by _integer_. Returns the new user ID. Not - * available on all platforms. - * - * [Process.uid, Process.euid] #=> [0, 0] - * Process::UID.change_privilege(31) #=> 31 - * [Process.uid, Process.euid] #=> [31, 31] - */ - -static VALUE -p_uid_change_privilege(obj, id) - VALUE obj, id; -{ - int uid; - - check_uid_switch(); - - uid = NUM2INT(id); - - if (geteuid() == 0) { /* root-user */ -#if defined(HAVE_SETRESUID) - if (setresuid(uid, uid, uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; -#elif defined(HAVE_SETUID) - if (setuid(uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; -#elif defined(HAVE_SETREUID) && !defined(OBSOLETE_SETREUID) - if (getuid() == uid) { - if (SAVED_USER_ID == uid) { - if (setreuid(-1, uid) < 0) rb_sys_fail(0); - } else { - if (uid == 0) { /* (r,e,s) == (root, root, x) */ - if (setreuid(-1, SAVED_USER_ID) < 0) rb_sys_fail(0); - if (setreuid(SAVED_USER_ID, 0) < 0) rb_sys_fail(0); - SAVED_USER_ID = 0; /* (r,e,s) == (x, root, root) */ - if (setreuid(uid, uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - } else { - if (setreuid(0, -1) < 0) rb_sys_fail(0); - SAVED_USER_ID = 0; - if (setreuid(uid, uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - } - } - } else { - if (setreuid(uid, uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - } -#elif defined(HAVE_SETRUID) && defined(HAVE_SETEUID) - if (getuid() == uid) { - if (SAVED_USER_ID == uid) { - if (seteuid(uid) < 0) rb_sys_fail(0); - } else { - if (uid == 0) { - if (setruid(SAVED_USER_ID) < 0) rb_sys_fail(0); - SAVED_USER_ID = 0; - if (setruid(0) < 0) rb_sys_fail(0); - } else { - if (setruid(0) < 0) rb_sys_fail(0); - SAVED_USER_ID = 0; - if (seteuid(uid) < 0) rb_sys_fail(0); - if (setruid(uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - } - } - } else { - if (seteuid(uid) < 0) rb_sys_fail(0); - if (setruid(uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - } -#else - rb_notimplement(); -#endif - } else { /* unprivileged user */ -#if defined(HAVE_SETRESUID) - if (setresuid((getuid() == uid)? -1: uid, - (geteuid() == uid)? -1: uid, - (SAVED_USER_ID == uid)? -1: uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; -#elif defined(HAVE_SETREUID) && !defined(OBSOLETE_SETREUID) - if (SAVED_USER_ID == uid) { - if (setreuid((getuid() == uid)? -1: uid, - (geteuid() == uid)? -1: uid) < 0) rb_sys_fail(0); - } else if (getuid() != uid) { - if (setreuid(uid, (geteuid() == uid)? -1: uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - } else if (/* getuid() == uid && */ geteuid() != uid) { - if (setreuid(geteuid(), uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - if (setreuid(uid, -1) < 0) rb_sys_fail(0); - } else { /* getuid() == uid && geteuid() == uid */ - if (setreuid(-1, SAVED_USER_ID) < 0) rb_sys_fail(0); - if (setreuid(SAVED_USER_ID, uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - if (setreuid(uid, -1) < 0) rb_sys_fail(0); - } -#elif defined(HAVE_SETRUID) && defined(HAVE_SETEUID) - if (SAVED_USER_ID == uid) { - if (geteuid() != uid && seteuid(uid) < 0) rb_sys_fail(0); - if (getuid() != uid && setruid(uid) < 0) rb_sys_fail(0); - } else if (/* SAVED_USER_ID != uid && */ geteuid() == uid) { - if (getuid() != uid) { - if (setruid(uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - } else { - if (setruid(SAVED_USER_ID) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - if (setruid(uid) < 0) rb_sys_fail(0); - } - } else if (/* geteuid() != uid && */ getuid() == uid) { - if (seteuid(uid) < 0) rb_sys_fail(0); - if (setruid(SAVED_USER_ID) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - if (setruid(uid) < 0) rb_sys_fail(0); - } else { - errno = EPERM; - rb_sys_fail(0); - } -#elif defined HAVE_44BSD_SETUID - if (getuid() == uid) { - /* (r,e,s)==(uid,?,?) ==> (uid,uid,uid) */ - if (setuid(uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; - } else { - errno = EPERM; - rb_sys_fail(0); - } -#elif defined HAVE_SETEUID - if (getuid() == uid && SAVED_USER_ID == uid) { - if (seteuid(uid) < 0) rb_sys_fail(0); - } else { - errno = EPERM; - rb_sys_fail(0); - } -#elif defined HAVE_SETUID - if (getuid() == uid && SAVED_USER_ID == uid) { - if (setuid(uid) < 0) rb_sys_fail(0); - } else { - errno = EPERM; - rb_sys_fail(0); - } -#else - rb_notimplement(); -#endif - } - return INT2FIX(uid); -} - - - -/* - * call-seq: - * Process::Sys.setgid(integer) => nil - * - * Set the group ID of the current process to _integer_. Not - * available on all platforms. - * - */ - -static VALUE -p_sys_setgid(obj, id) - VALUE obj, id; -{ -#if defined HAVE_SETGID - check_gid_switch(); - if (setgid(NUM2INT(id)) != 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return Qnil; -} - - -/* - * call-seq: - * Process::Sys.setrgid(integer) => nil - * - * Set the real group ID of the calling process to _integer_. - * Not available on all platforms. - * - */ - -static VALUE -p_sys_setrgid(obj, id) - VALUE obj, id; -{ -#if defined HAVE_SETRGID - check_gid_switch(); - if (setrgid(NUM2INT(id)) != 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return Qnil; -} - - - -/* - * call-seq: - * Process::Sys.setegid(integer) => nil - * - * Set the effective group ID of the calling process to - * _integer_. Not available on all platforms. - * - */ - -static VALUE -p_sys_setegid(obj, id) - VALUE obj, id; -{ -#if defined HAVE_SETEGID - check_gid_switch(); - if (setegid(NUM2INT(id)) != 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return Qnil; -} - - -/* - * call-seq: - * Process::Sys.setregid(rid, eid) => nil - * - * Sets the (integer) real and/or effective group IDs of the current - * process to rid and eid, respectively. A value of - * -1 for either means to leave that ID unchanged. Not - * available on all platforms. - * - */ - -static VALUE -p_sys_setregid(obj, rid, eid) - VALUE obj, rid, eid; -{ -#if defined HAVE_SETREGID - check_gid_switch(); - if (setregid(NUM2INT(rid),NUM2INT(eid)) != 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return Qnil; -} - -/* - * call-seq: - * Process::Sys.setresgid(rid, eid, sid) => nil - * - * Sets the (integer) real, effective, and saved user IDs of the - * current process to rid, eid, and sid - * respectively. A value of -1 for any value means to - * leave that ID unchanged. Not available on all platforms. - * - */ - -static VALUE -p_sys_setresgid(obj, rid, eid, sid) - VALUE obj, rid, eid, sid; -{ -#if defined HAVE_SETRESGID - check_gid_switch(); - if (setresgid(NUM2INT(rid),NUM2INT(eid),NUM2INT(sid)) != 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return Qnil; -} - - -/* - * call-seq: - * Process::Sys.issetugid => true or false - * - * Returns +true+ if the process was created as a result - * of an execve(2) system call which had either of the setuid or - * setgid bits set (and extra privileges were given as a result) or - * if it has changed any of its real, effective or saved user or - * group IDs since it began execution. - * - */ - -static VALUE -p_sys_issetugid(obj) - VALUE obj; -{ -#if defined HAVE_ISSETUGID - rb_secure(2); - if (issetugid()) { - return Qtrue; - } else { - return Qfalse; - } -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif -} - - -/* - * call-seq: - * Process.gid => fixnum - * Process::GID.rid => fixnum - * Process::Sys.getgid => fixnum - * - * Returns the (real) group ID for this process. - * - * Process.gid #=> 500 - */ - -static VALUE -proc_getgid(obj) - VALUE obj; -{ - int gid = getgid(); - return INT2FIX(gid); -} - - -/* - * call-seq: - * Process.gid= fixnum => fixnum - * - * Sets the group ID for this process. - */ - -static VALUE -proc_setgid(obj, id) - VALUE obj, id; -{ - int gid = NUM2INT(id); - - check_gid_switch(); -#if defined(HAVE_SETRESGID) && !defined(__CHECKER__) - if (setresgid(gid, -1, -1) < 0) rb_sys_fail(0); -#elif defined HAVE_SETREGID - if (setregid(gid, -1) < 0) rb_sys_fail(0); -#elif defined HAVE_SETRGID - if (setrgid(gid) < 0) rb_sys_fail(0); -#elif defined HAVE_SETGID - { - if (getegid() == gid) { - if (setgid(gid) < 0) rb_sys_fail(0); - } - else { - rb_notimplement(); - } - } -#else - rb_notimplement(); -#endif - return INT2FIX(gid); -} - - -static size_t maxgroups = 32; - - -/* - * call-seq: - * Process.groups => array - * - * Get an Array of the gids of groups in the - * supplemental group access list for this process. - * - * Process.groups #=> [27, 6, 10, 11] - * - */ - -static VALUE -proc_getgroups(VALUE obj) -{ -#ifdef HAVE_GETGROUPS - VALUE ary; - size_t ngroups; - rb_gid_t *groups; - int i; - - groups = ALLOCA_N(rb_gid_t, maxgroups); - - ngroups = getgroups(maxgroups, groups); - if (ngroups == -1) - rb_sys_fail(0); - - ary = rb_ary_new(); - for (i = 0; i < ngroups; i++) - rb_ary_push(ary, INT2NUM(groups[i])); - - return ary; -#else - rb_notimplement(); - return Qnil; -#endif -} - - -/* - * call-seq: - * Process.groups= array => array - * - * Set the supplemental group access list to the given - * Array of group IDs. - * - * Process.groups #=> [0, 1, 2, 3, 4, 6, 10, 11, 20, 26, 27] - * Process.groups = [27, 6, 10, 11] #=> [27, 6, 10, 11] - * Process.groups #=> [27, 6, 10, 11] - * - */ - -static VALUE -proc_setgroups(VALUE obj, VALUE ary) -{ -#ifdef HAVE_SETGROUPS - size_t ngroups; - rb_gid_t *groups; - int i; - struct group *gr; - - Check_Type(ary, T_ARRAY); - - ngroups = RARRAY(ary)->len; - if (ngroups > maxgroups) - rb_raise(rb_eArgError, "too many groups, %d max", maxgroups); - - groups = ALLOCA_N(rb_gid_t, ngroups); - - for (i = 0; i < ngroups && i < RARRAY(ary)->len; i++) { - VALUE g = RARRAY(ary)->ptr[i]; - - if (FIXNUM_P(g)) { - groups[i] = FIX2INT(g); - } - else { - VALUE tmp = rb_check_string_type(g); - - if (NIL_P(tmp)) { - groups[i] = NUM2INT(g); - } - else { - gr = getgrnam(RSTRING(tmp)->ptr); - if (gr == NULL) - rb_raise(rb_eArgError, - "can't find group for %s", RSTRING(tmp)->ptr); - groups[i] = gr->gr_gid; - } - } - } - - i = setgroups(ngroups, groups); - if (i == -1) - rb_sys_fail(0); - - return proc_getgroups(obj); -#else - rb_notimplement(); - return Qnil; -#endif -} - - -/* - * call-seq: - * Process.initgroups(username, gid) => array - * - * Initializes the supplemental group access list by reading the - * system group database and using all groups of which the given user - * is a member. The group with the specified gid is also - * added to the list. Returns the resulting Array of the - * gids of all the groups in the supplementary group access list. Not - * available on all platforms. - * - * Process.groups #=> [0, 1, 2, 3, 4, 6, 10, 11, 20, 26, 27] - * Process.initgroups( "mgranger", 30 ) #=> [30, 6, 10, 11] - * Process.groups #=> [30, 6, 10, 11] - * - */ - -static VALUE -proc_initgroups(obj, uname, base_grp) - VALUE obj, uname, base_grp; -{ -#ifdef HAVE_INITGROUPS - if (initgroups(StringValuePtr(uname), (rb_gid_t)NUM2INT(base_grp)) != 0) { - rb_sys_fail(0); - } - return proc_getgroups(obj); -#else - rb_notimplement(); - return Qnil; -#endif -} - - -/* - * call-seq: - * Process.maxgroups => fixnum - * - * Returns the maximum number of gids allowed in the supplemental - * group access list. - * - * Process.maxgroups #=> 32 - */ - -static VALUE -proc_getmaxgroups(obj) - VALUE obj; -{ - return INT2FIX(maxgroups); -} - - -/* - * call-seq: - * Process.maxgroups= fixnum => fixnum - * - * Sets the maximum number of gids allowed in the supplemental group - * access list. - */ - -static VALUE -proc_setmaxgroups(VALUE obj, VALUE val) -{ - size_t ngroups = FIX2INT(val); - - if (ngroups > 4096) - ngroups = 4096; - - maxgroups = ngroups; - - return INT2FIX(maxgroups); -} - - -/******************************************************************** - * - * Document-class: Process::GID - * - * The Process::GID module contains a collection of - * module functions which can be used to portably get, set, and - * switch the current process's real, effective, and saved group IDs. - * - */ - -static int SAVED_GROUP_ID = -1; - -#ifdef BROKEN_SETREGID -int -setregid(rgid, egid) - rb_gid_t rgid, egid; -{ - if (rgid != -1 && rgid != getgid()) { - if (egid == -1) egid = getegid(); - if (setgid(rgid) < 0) return -1; - } - if (egid != -1 && egid != getegid()) { - if (setegid(egid) < 0) return -1; - } - return 0; -} -#endif - -/* - * call-seq: - * Process::GID.change_privilege(integer) => fixnum - * - * Change the current process's real and effective group ID to that - * specified by _integer_. Returns the new group ID. Not - * available on all platforms. - * - * [Process.gid, Process.egid] #=> [0, 0] - * Process::GID.change_privilege(33) #=> 33 - * [Process.gid, Process.egid] #=> [33, 33] - */ - -static VALUE -p_gid_change_privilege(obj, id) - VALUE obj, id; -{ - int gid; - - check_gid_switch(); - - gid = NUM2INT(id); - - if (geteuid() == 0) { /* root-user */ -#if defined(HAVE_SETRESGID) - if (setresgid(gid, gid, gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; -#elif defined HAVE_SETGID - if (setgid(gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; -#elif defined(HAVE_SETREGID) && !defined(OBSOLETE_SETREGID) - if (getgid() == gid) { - if (SAVED_GROUP_ID == gid) { - if (setregid(-1, gid) < 0) rb_sys_fail(0); - } else { - if (gid == 0) { /* (r,e,s) == (root, y, x) */ - if (setregid(-1, SAVED_GROUP_ID) < 0) rb_sys_fail(0); - if (setregid(SAVED_GROUP_ID, 0) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = 0; /* (r,e,s) == (x, root, root) */ - if (setregid(gid, gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - } else { /* (r,e,s) == (z, y, x) */ - if (setregid(0, 0) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = 0; - if (setregid(gid, gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - } - } - } else { - if (setregid(gid, gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - } -#elif defined(HAVE_SETRGID) && defined (HAVE_SETEGID) - if (getgid() == gid) { - if (SAVED_GROUP_ID == gid) { - if (setegid(gid) < 0) rb_sys_fail(0); - } else { - if (gid == 0) { - if (setegid(gid) < 0) rb_sys_fail(0); - if (setrgid(SAVED_GROUP_ID) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = 0; - if (setrgid(0) < 0) rb_sys_fail(0); - } else { - if (setrgid(0) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = 0; - if (setegid(gid) < 0) rb_sys_fail(0); - if (setrgid(gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - } - } - } else { - if (setegid(gid) < 0) rb_sys_fail(0); - if (setrgid(gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - } -#else - rb_notimplement(); -#endif - } else { /* unprivileged user */ -#if defined(HAVE_SETRESGID) - if (setresgid((getgid() == gid)? -1: gid, - (getegid() == gid)? -1: gid, - (SAVED_GROUP_ID == gid)? -1: gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; -#elif defined(HAVE_SETREGID) && !defined(OBSOLETE_SETREGID) - if (SAVED_GROUP_ID == gid) { - if (setregid((getgid() == gid)? -1: gid, - (getegid() == gid)? -1: gid) < 0) rb_sys_fail(0); - } else if (getgid() != gid) { - if (setregid(gid, (getegid() == gid)? -1: gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - } else if (/* getgid() == gid && */ getegid() != gid) { - if (setregid(getegid(), gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - if (setregid(gid, -1) < 0) rb_sys_fail(0); - } else { /* getgid() == gid && getegid() == gid */ - if (setregid(-1, SAVED_GROUP_ID) < 0) rb_sys_fail(0); - if (setregid(SAVED_GROUP_ID, gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - if (setregid(gid, -1) < 0) rb_sys_fail(0); - } -#elif defined(HAVE_SETRGID) && defined(HAVE_SETEGID) - if (SAVED_GROUP_ID == gid) { - if (getegid() != gid && setegid(gid) < 0) rb_sys_fail(0); - if (getgid() != gid && setrgid(gid) < 0) rb_sys_fail(0); - } else if (/* SAVED_GROUP_ID != gid && */ getegid() == gid) { - if (getgid() != gid) { - if (setrgid(gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - } else { - if (setrgid(SAVED_GROUP_ID) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - if (setrgid(gid) < 0) rb_sys_fail(0); - } - } else if (/* getegid() != gid && */ getgid() == gid) { - if (setegid(gid) < 0) rb_sys_fail(0); - if (setrgid(SAVED_GROUP_ID) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - if (setrgid(gid) < 0) rb_sys_fail(0); - } else { - errno = EPERM; - rb_sys_fail(0); - } -#elif defined HAVE_44BSD_SETGID - if (getgid() == gid) { - /* (r,e,s)==(gid,?,?) ==> (gid,gid,gid) */ - if (setgid(gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; - } else { - errno = EPERM; - rb_sys_fail(0); - } -#elif defined HAVE_SETEGID - if (getgid() == gid && SAVED_GROUP_ID == gid) { - if (setegid(gid) < 0) rb_sys_fail(0); - } else { - errno = EPERM; - rb_sys_fail(0); - } -#elif defined HAVE_SETGID - if (getgid() == gid && SAVED_GROUP_ID == gid) { - if (setgid(gid) < 0) rb_sys_fail(0); - } else { - errno = EPERM; - rb_sys_fail(0); - } -#else - rb_notimplement(); -#endif - } - return INT2FIX(gid); -} - - -/* - * call-seq: - * Process.euid => fixnum - * Process::UID.eid => fixnum - * Process::Sys.geteuid => fixnum - * - * Returns the effective user ID for this process. - * - * Process.euid #=> 501 - */ - -static VALUE -proc_geteuid(obj) - VALUE obj; -{ - int euid = geteuid(); - return INT2FIX(euid); -} - - -/* - * call-seq: - * Process.euid= integer - * - * Sets the effective user ID for this process. Not available on all - * platforms. - */ - -static VALUE -proc_seteuid(obj, euid) - VALUE obj, euid; -{ - check_uid_switch(); -#if defined(HAVE_SETRESUID) && !defined(__CHECKER__) - if (setresuid(-1, NUM2INT(euid), -1) < 0) rb_sys_fail(0); -#elif defined HAVE_SETREUID - if (setreuid(-1, NUM2INT(euid)) < 0) rb_sys_fail(0); -#elif defined HAVE_SETEUID - if (seteuid(NUM2INT(euid)) < 0) rb_sys_fail(0); -#elif defined HAVE_SETUID - euid = NUM2INT(euid); - if (euid == getuid()) { - if (setuid(euid) < 0) rb_sys_fail(0); - } - else { - rb_notimplement(); - } -#else - rb_notimplement(); -#endif - return euid; -} - -static VALUE -rb_seteuid_core(euid) - int euid; -{ - int uid; - - check_uid_switch(); - - uid = getuid(); - -#if defined(HAVE_SETRESUID) && !defined(__CHECKER__) - if (uid != euid) { - if (setresuid(-1,euid,euid) < 0) rb_sys_fail(0); - SAVED_USER_ID = euid; - } else { - if (setresuid(-1,euid,-1) < 0) rb_sys_fail(0); - } -#elif defined(HAVE_SETREUID) && !defined(OBSOLETE_SETREUID) - if (setreuid(-1, euid) < 0) rb_sys_fail(0); - if (uid != euid) { - if (setreuid(euid,uid) < 0) rb_sys_fail(0); - if (setreuid(uid,euid) < 0) rb_sys_fail(0); - SAVED_USER_ID = euid; - } -#elif defined HAVE_SETEUID - if (seteuid(euid) < 0) rb_sys_fail(0); -#elif defined HAVE_SETUID - if (geteuid() == 0) rb_sys_fail(0); - if (setuid(euid) < 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return INT2FIX(euid); -} - - -/* - * call-seq: - * Process::UID.grant_privilege(integer) => fixnum - * Process::UID.eid= integer => fixnum - * - * Set the effective user ID, and if possible, the saved user ID of - * the process to the given _integer_. Returns the new - * effective user ID. Not available on all platforms. - * - * [Process.uid, Process.euid] #=> [0, 0] - * Process::UID.grant_privilege(31) #=> 31 - * [Process.uid, Process.euid] #=> [0, 31] - */ - -static VALUE -p_uid_grant_privilege(obj, id) - VALUE obj, id; -{ - return rb_seteuid_core(NUM2INT(id)); -} - - -/* - * call-seq: - * Process.egid => fixnum - * Process::GID.eid => fixnum - * Process::Sys.geteid => fixnum - * - * Returns the effective group ID for this process. Not available on - * all platforms. - * - * Process.egid #=> 500 - */ - -static VALUE -proc_getegid(obj) - VALUE obj; -{ - int egid = getegid(); - - return INT2FIX(egid); -} - - -/* - * call-seq: - * Process.egid = fixnum => fixnum - * - * Sets the effective group ID for this process. Not available on all - * platforms. - */ - -static VALUE -proc_setegid(obj, egid) - VALUE obj, egid; -{ - check_gid_switch(); - -#if defined(HAVE_SETRESGID) && !defined(__CHECKER__) - if (setresgid(-1, NUM2INT(egid), -1) < 0) rb_sys_fail(0); -#elif defined HAVE_SETREGID - if (setregid(-1, NUM2INT(egid)) < 0) rb_sys_fail(0); -#elif defined HAVE_SETEGID - if (setegid(NUM2INT(egid)) < 0) rb_sys_fail(0); -#elif defined HAVE_SETGID - egid = NUM2INT(egid); - if (egid == getgid()) { - if (setgid(egid) < 0) rb_sys_fail(0); - } - else { - rb_notimplement(); - } -#else - rb_notimplement(); -#endif - return egid; -} - -static VALUE -rb_setegid_core(egid) - int egid; -{ - int gid; - - check_gid_switch(); - - gid = getgid(); - -#if defined(HAVE_SETRESGID) && !defined(__CHECKER__) - if (gid != egid) { - if (setresgid(-1,egid,egid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = egid; - } else { - if (setresgid(-1,egid,-1) < 0) rb_sys_fail(0); - } -#elif defined(HAVE_SETREGID) && !defined(OBSOLETE_SETREGID) - if (setregid(-1, egid) < 0) rb_sys_fail(0); - if (gid != egid) { - if (setregid(egid,gid) < 0) rb_sys_fail(0); - if (setregid(gid,egid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = egid; - } -#elif defined HAVE_SETEGID - if (setegid(egid) < 0) rb_sys_fail(0); -#elif defined HAVE_SETGID - if (geteuid() == 0 /* root user */) rb_sys_fail(0); - if (setgid(egid) < 0) rb_sys_fail(0); -#else - rb_notimplement(); -#endif - return INT2FIX(egid); -} - - -/* - * call-seq: - * Process::GID.grant_privilege(integer) => fixnum - * Process::GID.eid = integer => fixnum - * - * Set the effective group ID, and if possible, the saved group ID of - * the process to the given _integer_. Returns the new - * effective group ID. Not available on all platforms. - * - * [Process.gid, Process.egid] #=> [0, 0] - * Process::GID.grant_privilege(31) #=> 33 - * [Process.gid, Process.egid] #=> [0, 33] - */ - -static VALUE -p_gid_grant_privilege(obj, id) - VALUE obj, id; -{ - return rb_setegid_core(NUM2INT(id)); -} - - -/* - * call-seq: - * Process::UID.re_exchangeable? => true or false - * - * Returns +true+ if the real and effective user IDs of a - * process may be exchanged on the current platform. - * - */ - -static VALUE -p_uid_exchangeable() -{ -#if defined(HAVE_SETRESUID) && !defined(__CHECKER__) - return Qtrue; -#elif defined(HAVE_SETREUID) && !defined(OBSOLETE_SETREUID) - return Qtrue; -#else - return Qfalse; -#endif -} - - -/* - * call-seq: - * Process::UID.re_exchange => fixnum - * - * Exchange real and effective user IDs and return the new effective - * user ID. Not available on all platforms. - * - * [Process.uid, Process.euid] #=> [0, 31] - * Process::UID.re_exchange #=> 0 - * [Process.uid, Process.euid] #=> [31, 0] - */ - -static VALUE -p_uid_exchange(obj) - VALUE obj; -{ - int uid, euid; - - check_uid_switch(); - - uid = getuid(); - euid = geteuid(); - -#if defined(HAVE_SETRESUID) && !defined(__CHECKER__) - if (setresuid(euid, uid, uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; -#elif defined(HAVE_SETREUID) && !defined(OBSOLETE_SETREUID) - if (setreuid(euid,uid) < 0) rb_sys_fail(0); - SAVED_USER_ID = uid; -#else - rb_notimplement(); -#endif - return INT2FIX(uid); -} - - -/* - * call-seq: - * Process::GID.re_exchangeable? => true or false - * - * Returns +true+ if the real and effective group IDs of a - * process may be exchanged on the current platform. - * - */ - -static VALUE -p_gid_exchangeable() -{ -#if defined(HAVE_SETRESGID) && !defined(__CHECKER__) - return Qtrue; -#elif defined(HAVE_SETREGID) && !defined(OBSOLETE_SETREGID) - return Qtrue; -#else - return Qfalse; -#endif -} - - -/* - * call-seq: - * Process::GID.re_exchange => fixnum - * - * Exchange real and effective group IDs and return the new effective - * group ID. Not available on all platforms. - * - * [Process.gid, Process.egid] #=> [0, 33] - * Process::GID.re_exchange #=> 0 - * [Process.gid, Process.egid] #=> [33, 0] - */ - -static VALUE -p_gid_exchange(obj) - VALUE obj; -{ - int gid, egid; - - check_gid_switch(); - - gid = getgid(); - egid = getegid(); - -#if defined(HAVE_SETRESGID) && !defined(__CHECKER__) - if (setresgid(egid, gid, gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; -#elif defined(HAVE_SETREGID) && !defined(OBSOLETE_SETREGID) - if (setregid(egid,gid) < 0) rb_sys_fail(0); - SAVED_GROUP_ID = gid; -#else - rb_notimplement(); -#endif - return INT2FIX(gid); -} - -/* [MG] :FIXME: Is this correct? I'm not sure how to phrase this. */ - -/* - * call-seq: - * Process::UID.sid_available? => true or false - * - * Returns +true+ if the current platform has saved user - * ID functionality. - * - */ - -static VALUE -p_uid_have_saved_id() -{ -#if defined(HAVE_SETRESUID) || defined(HAVE_SETEUID) || defined(_POSIX_SAVED_IDS) - return Qtrue; -#else - return Qfalse; -#endif -} - - -#if defined(HAVE_SETRESUID) || defined(HAVE_SETEUID) || defined(_POSIX_SAVED_IDS) -static VALUE -p_uid_sw_ensure(id) - int id; -{ - under_uid_switch = 0; - return rb_seteuid_core(id); -} - - -/* - * call-seq: - * Process::UID.switch => fixnum - * Process::UID.switch {|| block} => object - * - * Switch the effective and real user IDs of the current process. If - * a block is given, the user IDs will be switched back - * after the block is executed. Returns the new effective user ID if - * called without a block, and the return value of the block if one - * is given. - * - */ - -static VALUE -p_uid_switch(obj) - VALUE obj; -{ - int uid, euid; - - check_uid_switch(); - - uid = getuid(); - euid = geteuid(); - - if (uid != euid) { - proc_seteuid(obj, INT2FIX(uid)); - if (rb_block_given_p()) { - under_uid_switch = 1; - return rb_ensure(rb_yield, Qnil, p_uid_sw_ensure, SAVED_USER_ID); - } else { - return INT2FIX(euid); - } - } else if (euid != SAVED_USER_ID) { - proc_seteuid(obj, INT2FIX(SAVED_USER_ID)); - if (rb_block_given_p()) { - under_uid_switch = 1; - return rb_ensure(rb_yield, Qnil, p_uid_sw_ensure, euid); - } else { - return INT2FIX(uid); - } - } else { - errno = EPERM; - rb_sys_fail(0); - } - -#else -static VALUE -p_uid_sw_ensure(obj) - VALUE obj; -{ - under_uid_switch = 0; - return p_uid_exchange(obj); -} - -static VALUE -p_uid_switch(obj) - VALUE obj; -{ - int uid, euid; - - check_uid_switch(); - - uid = getuid(); - euid = geteuid(); - - if (uid == euid) { - errno = EPERM; - rb_sys_fail(0); - } - p_uid_exchange(obj); - if (rb_block_given_p()) { - under_uid_switch = 1; - return rb_ensure(rb_yield, Qnil, p_uid_sw_ensure, obj); - } else { - return INT2FIX(euid); - } -#endif -} - - -/* [MG] :FIXME: Is this correct? I'm not sure how to phrase this. */ - -/* - * call-seq: - * Process::GID.sid_available? => true or false - * - * Returns +true+ if the current platform has saved group - * ID functionality. - * - */ - -static VALUE -p_gid_have_saved_id() -{ -#if defined(HAVE_SETRESGID) || defined(HAVE_SETEGID) || defined(_POSIX_SAVED_IDS) - return Qtrue; -#else - return Qfalse; -#endif -} - -#if defined(HAVE_SETRESGID) || defined(HAVE_SETEGID) || defined(_POSIX_SAVED_IDS) -static VALUE -p_gid_sw_ensure(id) - int id; -{ - under_gid_switch = 0; - return rb_setegid_core(id); -} - - -/* - * call-seq: - * Process::GID.switch => fixnum - * Process::GID.switch {|| block} => object - * - * Switch the effective and real group IDs of the current process. If - * a block is given, the group IDs will be switched back - * after the block is executed. Returns the new effective group ID if - * called without a block, and the return value of the block if one - * is given. - * - */ - -static VALUE -p_gid_switch(obj) - VALUE obj; -{ - int gid, egid; - - check_gid_switch(); - - gid = getgid(); - egid = getegid(); - - if (gid != egid) { - proc_setegid(obj, INT2FIX(gid)); - if (rb_block_given_p()) { - under_gid_switch = 1; - return rb_ensure(rb_yield, Qnil, p_gid_sw_ensure, SAVED_GROUP_ID); - } else { - return INT2FIX(egid); - } - } else if (egid != SAVED_GROUP_ID) { - proc_setegid(obj, INT2FIX(SAVED_GROUP_ID)); - if (rb_block_given_p()) { - under_gid_switch = 1; - return rb_ensure(rb_yield, Qnil, p_gid_sw_ensure, egid); - } else { - return INT2FIX(gid); - } - } else { - errno = EPERM; - rb_sys_fail(0); - } -#else -static VALUE -p_gid_sw_ensure(obj) - VALUE obj; -{ - under_gid_switch = 0; - return p_gid_exchange(obj); -} - -static VALUE -p_gid_switch(obj) - VALUE obj; -{ - int gid, egid; - - check_gid_switch(); - - gid = getgid(); - egid = getegid(); - - if (gid == egid) { - errno = EPERM; - rb_sys_fail(0); - } - p_gid_exchange(obj); - if (rb_block_given_p()) { - under_gid_switch = 1; - return rb_ensure(rb_yield, Qnil, p_gid_sw_ensure, obj); - } else { - return INT2FIX(egid); - } -#endif -} - - -/* - * call-seq: - * Process.times => aStructTms - * - * Returns a Tms structure (see Struct::Tms - * on page 388) that contains user and system CPU times for this - * process. - * - * t = Process.times - * [ t.utime, t.stime ] #=> [0.0, 0.02] - */ - -VALUE -rb_proc_times(obj) - VALUE obj; -{ -#if defined(HAVE_TIMES) && !defined(__CHECKER__) - const double hertz = -#ifdef HAVE__SC_CLK_TCK - (double)sysconf(_SC_CLK_TCK); -#else -#ifndef HZ -# ifdef CLK_TCK -# define HZ CLK_TCK -# else -# define HZ 60 -# endif -#endif /* HZ */ - HZ; -#endif - struct tms buf; - volatile VALUE utime, stime, cutime, sctime; - - times(&buf); - return rb_struct_new(S_Tms, - utime = rb_float_new(buf.tms_utime / hertz), - stime = rb_float_new(buf.tms_stime / hertz), - cutime = rb_float_new(buf.tms_cutime / hertz), - sctime = rb_float_new(buf.tms_cstime / hertz)); -#else - rb_notimplement(); -#endif -} - -VALUE rb_mProcess; -VALUE rb_mProcUID; -VALUE rb_mProcGID; -VALUE rb_mProcID_Syscall; - - -/* - * The Process module is a collection of methods used to - * manipulate processes. - */ - -void -Init_process() -{ - rb_define_virtual_variable("$$", get_pid, 0); - rb_define_readonly_variable("$?", &rb_last_status); - rb_define_global_function("exec", rb_f_exec, -1); - rb_define_global_function("fork", rb_f_fork, 0); - rb_define_global_function("exit!", rb_f_exit_bang, -1); - rb_define_global_function("system", rb_f_system, -1); - rb_define_global_function("sleep", rb_f_sleep, -1); - - rb_mProcess = rb_define_module("Process"); - -#if !defined(_WIN32) && !defined(DJGPP) -#ifdef WNOHANG - rb_define_const(rb_mProcess, "WNOHANG", INT2FIX(WNOHANG)); -#else - rb_define_const(rb_mProcess, "WNOHANG", INT2FIX(0)); -#endif -#ifdef WUNTRACED - rb_define_const(rb_mProcess, "WUNTRACED", INT2FIX(WUNTRACED)); -#else - rb_define_const(rb_mProcess, "WUNTRACED", INT2FIX(0)); -#endif -#endif - - rb_define_singleton_method(rb_mProcess, "fork", rb_f_fork, 0); - rb_define_singleton_method(rb_mProcess, "exit!", rb_f_exit_bang, -1); - rb_define_singleton_method(rb_mProcess, "exit", rb_f_exit, -1); /* in eval.c */ - rb_define_singleton_method(rb_mProcess, "abort", rb_f_abort, -1); /* in eval.c */ - - rb_define_module_function(rb_mProcess, "kill", rb_f_kill, -1); /* in signal.c */ - rb_define_module_function(rb_mProcess, "wait", proc_wait, -1); - rb_define_module_function(rb_mProcess, "wait2", proc_wait2, -1); - rb_define_module_function(rb_mProcess, "waitpid", proc_wait, -1); - rb_define_module_function(rb_mProcess, "waitpid2", proc_wait2, -1); - rb_define_module_function(rb_mProcess, "waitall", proc_waitall, 0); - rb_define_module_function(rb_mProcess, "detach", proc_detach, 1); - - rb_cProcStatus = rb_define_class_under(rb_mProcess, "Status", rb_cObject); - rb_undef_method(CLASS_OF(rb_cProcStatus), "new"); - - rb_define_method(rb_cProcStatus, "==", pst_equal, 1); - rb_define_method(rb_cProcStatus, "&", pst_bitand, 1); - rb_define_method(rb_cProcStatus, ">>", pst_rshift, 1); - rb_define_method(rb_cProcStatus, "to_i", pst_to_i, 0); - rb_define_method(rb_cProcStatus, "to_int", pst_to_i, 0); - rb_define_method(rb_cProcStatus, "to_s", pst_to_s, 0); - rb_define_method(rb_cProcStatus, "inspect", pst_inspect, 0); - - rb_define_method(rb_cProcStatus, "pid", pst_pid, 0); - - rb_define_method(rb_cProcStatus, "stopped?", pst_wifstopped, 0); - rb_define_method(rb_cProcStatus, "stopsig", pst_wstopsig, 0); - rb_define_method(rb_cProcStatus, "signaled?", pst_wifsignaled, 0); - rb_define_method(rb_cProcStatus, "termsig", pst_wtermsig, 0); - rb_define_method(rb_cProcStatus, "exited?", pst_wifexited, 0); - rb_define_method(rb_cProcStatus, "exitstatus", pst_wexitstatus, 0); - rb_define_method(rb_cProcStatus, "success?", pst_success_p, 0); - rb_define_method(rb_cProcStatus, "coredump?", pst_wcoredump, 0); - - rb_define_module_function(rb_mProcess, "pid", get_pid, 0); - rb_define_module_function(rb_mProcess, "ppid", get_ppid, 0); - - rb_define_module_function(rb_mProcess, "getpgrp", proc_getpgrp, 0); - rb_define_module_function(rb_mProcess, "setpgrp", proc_setpgrp, 0); - rb_define_module_function(rb_mProcess, "getpgid", proc_getpgid, 1); - rb_define_module_function(rb_mProcess, "setpgid", proc_setpgid, 2); - - rb_define_module_function(rb_mProcess, "setsid", proc_setsid, 0); - - rb_define_module_function(rb_mProcess, "getpriority", proc_getpriority, 2); - rb_define_module_function(rb_mProcess, "setpriority", proc_setpriority, 3); - -#ifdef HAVE_GETPRIORITY - rb_define_const(rb_mProcess, "PRIO_PROCESS", INT2FIX(PRIO_PROCESS)); - rb_define_const(rb_mProcess, "PRIO_PGRP", INT2FIX(PRIO_PGRP)); - rb_define_const(rb_mProcess, "PRIO_USER", INT2FIX(PRIO_USER)); -#endif - - rb_define_module_function(rb_mProcess, "getrlimit", proc_getrlimit, 1); - rb_define_module_function(rb_mProcess, "setrlimit", proc_setrlimit, -1); -#ifdef RLIM2NUM -#ifdef RLIM_INFINITY - rb_define_const(rb_mProcess, "RLIM_INFINITY", RLIM2NUM(RLIM_INFINITY)); -#endif -#ifdef RLIM_SAVED_MAX - rb_define_const(rb_mProcess, "RLIM_SAVED_MAX", RLIM2NUM(RLIM_SAVED_MAX)); -#endif -#ifdef RLIM_SAVED_CUR - rb_define_const(rb_mProcess, "RLIM_SAVED_CUR", RLIM2NUM(RLIM_SAVED_CUR)); -#endif -#ifdef RLIMIT_CORE - rb_define_const(rb_mProcess, "RLIMIT_CORE", INT2FIX(RLIMIT_CORE)); -#endif -#ifdef RLIMIT_CPU - rb_define_const(rb_mProcess, "RLIMIT_CPU", INT2FIX(RLIMIT_CPU)); -#endif -#ifdef RLIMIT_DATA - rb_define_const(rb_mProcess, "RLIMIT_DATA", INT2FIX(RLIMIT_DATA)); -#endif -#ifdef RLIMIT_FSIZE - rb_define_const(rb_mProcess, "RLIMIT_FSIZE", INT2FIX(RLIMIT_FSIZE)); -#endif -#ifdef RLIMIT_NOFILE - rb_define_const(rb_mProcess, "RLIMIT_NOFILE", INT2FIX(RLIMIT_NOFILE)); -#endif -#ifdef RLIMIT_STACK - rb_define_const(rb_mProcess, "RLIMIT_STACK", INT2FIX(RLIMIT_STACK)); -#endif -#ifdef RLIMIT_AS - rb_define_const(rb_mProcess, "RLIMIT_AS", INT2FIX(RLIMIT_AS)); -#endif -#ifdef RLIMIT_MEMLOCK - rb_define_const(rb_mProcess, "RLIMIT_MEMLOCK", INT2FIX(RLIMIT_MEMLOCK)); -#endif -#ifdef RLIMIT_NPROC - rb_define_const(rb_mProcess, "RLIMIT_NPROC", INT2FIX(RLIMIT_NPROC)); -#endif -#ifdef RLIMIT_RSS - rb_define_const(rb_mProcess, "RLIMIT_RSS", INT2FIX(RLIMIT_RSS)); -#endif -#ifdef RLIMIT_SBSIZE - rb_define_const(rb_mProcess, "RLIMIT_SBSIZE", INT2FIX(RLIMIT_SBSIZE)); -#endif -#endif - - rb_define_module_function(rb_mProcess, "uid", proc_getuid, 0); - rb_define_module_function(rb_mProcess, "uid=", proc_setuid, 1); - rb_define_module_function(rb_mProcess, "gid", proc_getgid, 0); - rb_define_module_function(rb_mProcess, "gid=", proc_setgid, 1); - rb_define_module_function(rb_mProcess, "euid", proc_geteuid, 0); - rb_define_module_function(rb_mProcess, "euid=", proc_seteuid, 1); - rb_define_module_function(rb_mProcess, "egid", proc_getegid, 0); - rb_define_module_function(rb_mProcess, "egid=", proc_setegid, 1); - rb_define_module_function(rb_mProcess, "initgroups", proc_initgroups, 2); - rb_define_module_function(rb_mProcess, "groups", proc_getgroups, 0); - rb_define_module_function(rb_mProcess, "groups=", proc_setgroups, 1); - rb_define_module_function(rb_mProcess, "maxgroups", proc_getmaxgroups, 0); - rb_define_module_function(rb_mProcess, "maxgroups=", proc_setmaxgroups, 1); - - rb_define_module_function(rb_mProcess, "times", rb_proc_times, 0); - -#if defined(HAVE_TIMES) || defined(_WIN32) - S_Tms = rb_struct_define("Tms", "utime", "stime", "cutime", "cstime", NULL); -#endif - - SAVED_USER_ID = geteuid(); - SAVED_GROUP_ID = getegid(); - - rb_mProcUID = rb_define_module_under(rb_mProcess, "UID"); - rb_mProcGID = rb_define_module_under(rb_mProcess, "GID"); - - rb_define_module_function(rb_mProcUID, "rid", proc_getuid, 0); - rb_define_module_function(rb_mProcGID, "rid", proc_getgid, 0); - rb_define_module_function(rb_mProcUID, "eid", proc_geteuid, 0); - rb_define_module_function(rb_mProcGID, "eid", proc_getegid, 0); - rb_define_module_function(rb_mProcUID, "change_privilege", p_uid_change_privilege, 1); - rb_define_module_function(rb_mProcGID, "change_privilege", p_gid_change_privilege, 1); - rb_define_module_function(rb_mProcUID, "grant_privilege", p_uid_grant_privilege, 1); - rb_define_module_function(rb_mProcGID, "grant_privilege", p_gid_grant_privilege, 1); - rb_define_alias(rb_singleton_class(rb_mProcUID), "eid=", "grant_privilege"); - rb_define_alias(rb_singleton_class(rb_mProcGID), "eid=", "grant_privilege"); - rb_define_module_function(rb_mProcUID, "re_exchange", p_uid_exchange, 0); - rb_define_module_function(rb_mProcGID, "re_exchange", p_gid_exchange, 0); - rb_define_module_function(rb_mProcUID, "re_exchangeable?", p_uid_exchangeable, 0); - rb_define_module_function(rb_mProcGID, "re_exchangeable?", p_gid_exchangeable, 0); - rb_define_module_function(rb_mProcUID, "sid_available?", p_uid_have_saved_id, 0); - rb_define_module_function(rb_mProcGID, "sid_available?", p_gid_have_saved_id, 0); - rb_define_module_function(rb_mProcUID, "switch", p_uid_switch, 0); - rb_define_module_function(rb_mProcGID, "switch", p_gid_switch, 0); - - rb_mProcID_Syscall = rb_define_module_under(rb_mProcess, "Sys"); - - rb_define_module_function(rb_mProcID_Syscall, "getuid", proc_getuid, 0); - rb_define_module_function(rb_mProcID_Syscall, "geteuid", proc_geteuid, 0); - rb_define_module_function(rb_mProcID_Syscall, "getgid", proc_getgid, 0); - rb_define_module_function(rb_mProcID_Syscall, "getegid", proc_getegid, 0); - - rb_define_module_function(rb_mProcID_Syscall, "setuid", p_sys_setuid, 1); - rb_define_module_function(rb_mProcID_Syscall, "setgid", p_sys_setgid, 1); - - rb_define_module_function(rb_mProcID_Syscall, "setruid", p_sys_setruid, 1); - rb_define_module_function(rb_mProcID_Syscall, "setrgid", p_sys_setrgid, 1); - - rb_define_module_function(rb_mProcID_Syscall, "seteuid", p_sys_seteuid, 1); - rb_define_module_function(rb_mProcID_Syscall, "setegid", p_sys_setegid, 1); - - rb_define_module_function(rb_mProcID_Syscall, "setreuid", p_sys_setreuid, 2); - rb_define_module_function(rb_mProcID_Syscall, "setregid", p_sys_setregid, 2); - - rb_define_module_function(rb_mProcID_Syscall, "setresuid", p_sys_setresuid, 3); - rb_define_module_function(rb_mProcID_Syscall, "setresgid", p_sys_setresgid, 3); - rb_define_module_function(rb_mProcID_Syscall, "issetugid", p_sys_issetugid, 0); -} -/********************************************************************** - - random.c - - - $Author: shyouhei $ - $Date: 2009-01-17 04:15:36 +0100 (Sat, 17 Jan 2009) $ - created at: Fri Dec 24 16:39:21 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -/* -This is based on trimmed version of MT19937. To get the original version, -contact . - -The original copyright notice follows. - - A C-program for MT19937, with initialization improved 2002/2/10. - Coded by Takuji Nishimura and Makoto Matsumoto. - This is a faster version by taking Shawn Cokus's optimization, - Matthe Bellew's simplification, Isaku Wada's real version. - - Before using, initialize the state by using init_genrand(seed) - or init_by_array(init_key, key_length). - - Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The names of its contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - Any feedback is very welcome. - http://www.math.keio.ac.jp/matumoto/emt.html - email: matumoto@math.keio.ac.jp -*/ - -/* Period parameters */ -#define N 624 -#define M 397 -#define MATRIX_A 0x9908b0dfUL /* constant vector a */ -#define UMASK 0x80000000UL /* most significant w-r bits */ -#define LMASK 0x7fffffffUL /* least significant r bits */ -#define MIXBITS(u,v) ( ((u) & UMASK) | ((v) & LMASK) ) -#define TWIST(u,v) ((MIXBITS(u,v) >> 1) ^ ((v)&1UL ? MATRIX_A : 0UL)) - -static unsigned long state[N]; /* the array for the state vector */ -static int left = 1; -static int initf = 0; -static unsigned long *next; - -/* initializes state[N] with a seed */ -static void -init_genrand(s) - unsigned long s; -{ - int j; - state[0]= s & 0xffffffffUL; - for (j=1; j> 30)) + j); - /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ - /* In the previous versions, MSBs of the seed affect */ - /* only MSBs of the array state[]. */ - /* 2002/01/09 modified by Makoto Matsumoto */ - state[j] &= 0xffffffffUL; /* for >32 bit machines */ - } - left = 1; initf = 1; -} - -/* initialize by an array with array-length */ -/* init_key is the array for initializing keys */ -/* key_length is its length */ -/* slight change for C++, 2004/2/26 */ -static void -init_by_array(unsigned long init_key[], int key_length) -{ - int i, j, k; - init_genrand(19650218UL); - i=1; j=0; - k = (N>key_length ? N : key_length); - for (; k; k--) { - state[i] = (state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1664525UL)) - + init_key[j] + j; /* non linear */ - state[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ - i++; j++; - if (i>=N) { state[0] = state[N-1]; i=1; } - if (j>=key_length) j=0; - } - for (k=N-1; k; k--) { - state[i] = (state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL)) - - i; /* non linear */ - state[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ - i++; - if (i>=N) { state[0] = state[N-1]; i=1; } - } - - state[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */ - left = 1; initf = 1; -} - -static void -next_state() -{ - unsigned long *p=state; - int j; - - /* if init_genrand() has not been called, */ - /* a default initial seed is used */ - if (initf==0) init_genrand(5489UL); - - left = N; - next = state; - - for (j=N-M+1; --j; p++) - *p = p[M] ^ TWIST(p[0], p[1]); - - for (j=M; --j; p++) - *p = p[M-N] ^ TWIST(p[0], p[1]); - - *p = p[M-N] ^ TWIST(p[0], state[0]); -} - -/* generates a random number on [0,0xffffffff]-interval */ -static unsigned long -genrand_int32(void) -{ - unsigned long y; - - if (--left == 0) next_state(); - y = *next++; - - /* Tempering */ - y ^= (y >> 11); - y ^= (y << 7) & 0x9d2c5680UL; - y ^= (y << 15) & 0xefc60000UL; - y ^= (y >> 18); - - return y; -} - -/* generates a random number on [0,1) with 53-bit resolution*/ -static double -genrand_real(void) -{ - unsigned long a=genrand_int32()>>5, b=genrand_int32()>>6; - return(a*67108864.0+b)*(1.0/9007199254740992.0); -} -/* These real versions are due to Isaku Wada, 2002/01/09 added */ - -#undef N -#undef M - -/* These real versions are due to Isaku Wada, 2002/01/09 added */ - -#include "ruby.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#ifdef HAVE_FCNTL_H -#include -#endif - -static VALUE saved_seed = INT2FIX(0); - -static VALUE -rand_init(vseed) - VALUE vseed; -{ - volatile VALUE seed; - VALUE old; - long len; - unsigned long *buf; - - seed = rb_to_int(vseed); - switch (TYPE(seed)) { - case T_FIXNUM: - len = sizeof(VALUE); - break; - case T_BIGNUM: - len = RBIGNUM(seed)->len * SIZEOF_BDIGITS; - if (len == 0) - len = 4; - break; - default: - rb_raise(rb_eTypeError, "failed to convert %s into Integer", - rb_obj_classname(vseed)); - } - len = (len + 3) / 4; /* number of 32bit words */ - buf = ALLOC_N(unsigned long, len); /* allocate longs for init_by_array */ - memset(buf, 0, len * sizeof(long)); - if (FIXNUM_P(seed)) { - buf[0] = FIX2ULONG(seed) & 0xffffffff; -#if SIZEOF_LONG > 4 - buf[1] = FIX2ULONG(seed) >> 32; -#endif - } - else { - int i, j; - for (i = RBIGNUM(seed)->len-1; 0 <= i; i--) { - j = i * SIZEOF_BDIGITS / 4; -#if SIZEOF_BDIGITS < 4 - buf[j] <<= SIZEOF_BDIGITS * 8; -#endif - buf[j] |= ((BDIGIT *)RBIGNUM(seed)->digits)[i]; - } - } - while (1 < len && buf[len-1] == 0) { - len--; - } - if (len <= 1) { - init_genrand(buf[0]); - } - else { - if (buf[len-1] == 1) /* remove leading-zero-guard */ - len--; - init_by_array(buf, len); - } - old = saved_seed; - saved_seed = seed; - free(buf); - return old; -} - -static VALUE -random_seed() -{ - static int n = 0; - struct timeval tv; - int fd; - struct stat statbuf; - - int seed_len; - BDIGIT *digits; - unsigned long *seed; - NEWOBJ(big, struct RBignum); - OBJSETUP(big, rb_cBignum, T_BIGNUM); - - seed_len = 4 * sizeof(long); - big->sign = 1; - big->len = seed_len / SIZEOF_BDIGITS + 1; - digits = big->digits = ALLOC_N(BDIGIT, big->len); - seed = (unsigned long *)big->digits; - - memset(digits, 0, big->len * SIZEOF_BDIGITS); - -#ifdef S_ISCHR - if ((fd = open("/dev/urandom", O_RDONLY -#ifdef O_NONBLOCK - |O_NONBLOCK -#endif -#ifdef O_NOCTTY - |O_NOCTTY -#endif -#ifdef O_NOFOLLOW - |O_NOFOLLOW -#endif - )) >= 0) { - if (fstat(fd, &statbuf) == 0 && S_ISCHR(statbuf.st_mode)) { - read(fd, seed, seed_len); - } - close(fd); - } -#endif - - gettimeofday(&tv, 0); - seed[0] ^= tv.tv_usec; - seed[1] ^= tv.tv_sec; - seed[2] ^= getpid() ^ (n++ << 16); - seed[3] ^= (unsigned long)&seed; - - /* set leading-zero-guard if need. */ - digits[big->len-1] = digits[big->len-2] <= 1 ? 1 : 0; - - return rb_big_norm((VALUE)big); -} - -/* - * call-seq: - * srand(number=0) => old_seed - * - * Seeds the pseudorandom number generator to the value of - * number.to_i.abs. If number is omitted, - * seeds the generator using a combination of the time, the - * process id, and a sequence number. (This is also the behavior if - * Kernel::rand is called without previously calling - * srand, but without the sequence.) By setting the seed - * to a known value, scripts can be made deterministic during testing. - * The previous seed value is returned. Also see Kernel::rand. - */ - -static VALUE -rb_f_srand(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - VALUE seed, old; - - rb_secure(4); - if (rb_scan_args(argc, argv, "01", &seed) == 0) { - seed = random_seed(); - } - old = rand_init(seed); - - return old; -} - -static unsigned long -make_mask(unsigned long x) -{ - x = x | x >> 1; - x = x | x >> 2; - x = x | x >> 4; - x = x | x >> 8; - x = x | x >> 16; -#if 4 < SIZEOF_LONG - x = x | x >> 32; -#endif - return x; -} - -static unsigned long -limited_rand(unsigned long limit) -{ - unsigned long mask = make_mask(limit); - int i; - unsigned long val; - - retry: - val = 0; - for (i = SIZEOF_LONG/4-1; 0 <= i; i--) { - if (mask >> (i * 32)) { - val |= genrand_int32() << (i * 32); - val &= mask; - if (limit < val) - goto retry; - } - } - return val; -} - -static VALUE -limited_big_rand(struct RBignum *limit) -{ - unsigned long mask, lim, rnd; - struct RBignum *val; - int i, len, boundary; - - len = (limit->len * SIZEOF_BDIGITS + 3) / 4; - val = (struct RBignum *)rb_big_clone((VALUE)limit); - val->sign = 1; -#if SIZEOF_BDIGITS == 2 -# define BIG_GET32(big,i) (((BDIGIT *)(big)->digits)[(i)*2] | \ - ((i)*2+1 < (big)->len ? (((BDIGIT *)(big)->digits)[(i)*2+1] << 16) \ - : 0)) -# define BIG_SET32(big,i,d) ((((BDIGIT *)(big)->digits)[(i)*2] = (d) & 0xffff), \ - ((i)*2+1 < (big)->len ? (((BDIGIT *)(big)->digits)[(i)*2+1] = (d) >> 16) \ - : 0)) -#else - /* SIZEOF_BDIGITS == 4 */ -# define BIG_GET32(big,i) (((BDIGIT *)(big)->digits)[i]) -# define BIG_SET32(big,i,d) (((BDIGIT *)(big)->digits)[i] = (d)) -#endif - retry: - mask = 0; - boundary = 1; - for (i = len-1; 0 <= i; i--) { - lim = BIG_GET32(limit, i); - mask = mask ? 0xffffffff : make_mask(lim); - if (mask) { - rnd = genrand_int32() & mask; - if (boundary) { - if (lim < rnd) - goto retry; - if (rnd < lim) - boundary = 0; - } - } - else { - rnd = 0; - } - BIG_SET32(val, i, rnd); - } - return rb_big_norm((VALUE)val); -} - -/* - * call-seq: - * rand(max=0) => number - * - * Converts max to an integer using max1 = - * max.to_i.abs. If the result is zero, returns a - * pseudorandom floating point number greater than or equal to 0.0 and - * less than 1.0. Otherwise, returns a pseudorandom integer greater - * than or equal to zero and less than max1. Kernel::srand - * may be used to ensure repeatable sequences of random numbers between - * different runs of the program. Ruby currently uses a modified - * Mersenne Twister with a period of 2**19937-1. - * - * srand 1234 #=> 0 - * [ rand, rand ] #=> [0.191519450163469, 0.49766366626136] - * [ rand(10), rand(1000) ] #=> [6, 817] - * srand 1234 #=> 1234 - * [ rand, rand ] #=> [0.191519450163469, 0.49766366626136] - */ - -static VALUE -rb_f_rand(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - VALUE vmax; - long val, max; - - rb_scan_args(argc, argv, "01", &vmax); - switch (TYPE(vmax)) { - case T_FLOAT: - if (RFLOAT(vmax)->value <= LONG_MAX && RFLOAT(vmax)->value >= LONG_MIN) { - max = (long)RFLOAT(vmax)->value; - break; - } - if (RFLOAT(vmax)->value < 0) - vmax = rb_dbl2big(-RFLOAT(vmax)->value); - else - vmax = rb_dbl2big(RFLOAT(vmax)->value); - /* fall through */ - case T_BIGNUM: - bignum: - { - struct RBignum *limit = (struct RBignum *)vmax; - if (!limit->sign) { - limit = (struct RBignum *)rb_big_clone(vmax); - limit->sign = 1; - } - limit = (struct RBignum *)rb_big_minus((VALUE)limit, INT2FIX(1)); - if (FIXNUM_P((VALUE)limit)) { - if (FIX2LONG((VALUE)limit) == -1) - return rb_float_new(genrand_real()); - return LONG2NUM(limited_rand(FIX2LONG((VALUE)limit))); - } - return limited_big_rand(limit); - } - case T_NIL: - max = 0; - break; - default: - vmax = rb_Integer(vmax); - if (TYPE(vmax) == T_BIGNUM) goto bignum; - /* fall through */ - case T_FIXNUM: - max = FIX2LONG(vmax); - break; - } - - if (max == 0) { - return rb_float_new(genrand_real()); - } - if (max < 0) max = -max; - val = limited_rand(max-1); - return LONG2NUM(val); -} - -void -Init_Random() -{ - rand_init(random_seed()); - rb_define_global_function("srand", rb_f_srand, -1); - rb_define_global_function("rand", rb_f_rand, -1); - rb_global_variable(&saved_seed); -} -/********************************************************************** - - range.c - - - $Author: shyouhei $ - $Date: 2007-09-16 21:38:27 +0200 (Sun, 16 Sep 2007) $ - created at: Thu Aug 19 17:46:47 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" - -VALUE rb_cRange; -static ID id_cmp, id_succ, id_beg, id_end, id_excl; - -#define EXCL(r) RTEST(rb_ivar_get((r), id_excl)) -#define SET_EXCL(r,v) rb_ivar_set((r), id_excl, (v) ? Qtrue : Qfalse) - -static VALUE -range_failed() -{ - rb_raise(rb_eArgError, "bad value for range"); - return Qnil; /* dummy */ -} - -static VALUE -range_check(args) - VALUE *args; -{ - return rb_funcall(args[0], id_cmp, 1, args[1]); -} - -static void -range_init(range, beg, end, exclude_end) - VALUE range, beg, end; - int exclude_end; -{ - VALUE args[2]; - - args[0] = beg; - args[1] = end; - - if (!FIXNUM_P(beg) || !FIXNUM_P(end)) { - VALUE v; - - v = rb_rescue(range_check, (VALUE)args, range_failed, 0); - if (NIL_P(v)) range_failed(); - } - - SET_EXCL(range, exclude_end); - rb_ivar_set(range, id_beg, beg); - rb_ivar_set(range, id_end, end); -} - -VALUE -rb_range_new(beg, end, exclude_end) - VALUE beg, end; - int exclude_end; -{ - VALUE range = rb_obj_alloc(rb_cRange); - - range_init(range, beg, end, exclude_end); - return range; -} - -/* - * call-seq: - * Range.new(start, end, exclusive=false) => range - * - * Constructs a range using the given start and end. If the third - * parameter is omitted or is false, the range will include - * the end object; otherwise, it will be excluded. - */ - -static VALUE -range_initialize(argc, argv, range) - int argc; - VALUE *argv; - VALUE range; -{ - VALUE beg, end, flags; - - rb_scan_args(argc, argv, "21", &beg, &end, &flags); - /* Ranges are immutable, so that they should be initialized only once. */ - if (rb_ivar_defined(range, id_beg)) { - rb_name_error(rb_intern("initialize"), "`initialize' called twice"); - } - range_init(range, beg, end, RTEST(flags)); - return Qnil; -} - - -/* - * call-seq: - * rng.exclude_end? => true or false - * - * Returns true if rng excludes its end value. - */ - -static VALUE -range_exclude_end_p(range) - VALUE range; -{ - return EXCL(range) ? Qtrue : Qfalse; -} - - -/* - * call-seq: - * rng == obj => true or false - * - * Returns true only if obj is a Range, has equivalent - * beginning and end items (by comparing them with ==), and has - * the same #exclude_end? setting as rng. - * - * (0..2) == (0..2) #=> true - * (0..2) == Range.new(0,2) #=> true - * (0..2) == (0...2) #=> false - * - */ - -static VALUE -range_eq(range, obj) - VALUE range, obj; -{ - if (range == obj) return Qtrue; - if (!rb_obj_is_instance_of(obj, rb_obj_class(range))) - return Qfalse; - - if (!rb_equal(rb_ivar_get(range, id_beg), rb_ivar_get(obj, id_beg))) - return Qfalse; - if (!rb_equal(rb_ivar_get(range, id_end), rb_ivar_get(obj, id_end))) - return Qfalse; - - if (EXCL(range) != EXCL(obj)) return Qfalse; - - return Qtrue; -} - -static int -r_lt(a, b) - VALUE a, b; -{ - VALUE r = rb_funcall(a, id_cmp, 1, b); - - if (NIL_P(r)) return Qfalse; - if (rb_cmpint(r, a, b) < 0) return Qtrue; - return Qfalse; -} - -static int -r_le(a, b) - VALUE a, b; -{ - int c; - VALUE r = rb_funcall(a, id_cmp, 1, b); - - if (NIL_P(r)) return Qfalse; - c = rb_cmpint(r, a, b); - if (c == 0) return INT2FIX(0); - if (c < 0) return Qtrue; - return Qfalse; -} - - -/* - * call-seq: - * rng.eql?(obj) => true or false - * - * Returns true only if obj is a Range, has equivalent - * beginning and end items (by comparing them with #eql?), and has the same - * #exclude_end? setting as rng. - * - * (0..2) == (0..2) #=> true - * (0..2) == Range.new(0,2) #=> true - * (0..2) == (0...2) #=> false - * - */ - -static VALUE -range_eql(range, obj) - VALUE range, obj; -{ - if (range == obj) return Qtrue; - if (!rb_obj_is_instance_of(obj, rb_obj_class(range))) - return Qfalse; - - if (!rb_eql(rb_ivar_get(range, id_beg), rb_ivar_get(obj, id_beg))) - return Qfalse; - if (!rb_eql(rb_ivar_get(range, id_end), rb_ivar_get(obj, id_end))) - return Qfalse; - - if (EXCL(range) != EXCL(obj)) return Qfalse; - - return Qtrue; -} - -/* - * call-seq: - * rng.hash => fixnum - * - * Generate a hash value such that two ranges with the same start and - * end points, and the same value for the "exclude end" flag, generate - * the same hash value. - */ - -static VALUE -range_hash(range) - VALUE range; -{ - long hash = EXCL(range); - VALUE v; - - v = rb_hash(rb_ivar_get(range, id_beg)); - hash ^= v << 1; - v = rb_hash(rb_ivar_get(range, id_end)); - hash ^= v << 9; - hash ^= EXCL(range) << 24; - - return LONG2FIX(hash); -} - -static VALUE -str_step(args) - VALUE *args; -{ - return rb_str_upto(args[0], args[1], EXCL(args[2])); -} - -static void -range_each_func(range, func, v, e, arg) - VALUE range; - void (*func) _((VALUE, void*)); - VALUE v, e; - void *arg; -{ - int c; - - if (EXCL(range)) { - while (r_lt(v, e)) { - (*func)(v, arg); - v = rb_funcall(v, id_succ, 0, 0); - } - } - else { - while (RTEST(c = r_le(v, e))) { - (*func)(v, arg); - if (c == INT2FIX(0)) break; - v = rb_funcall(v, id_succ, 0, 0); - } - } -} - -static VALUE -step_i(i, iter) - VALUE i; - long *iter; -{ - iter[0]--; - if (iter[0] == 0) { - rb_yield(i); - iter[0] = iter[1]; - } - return Qnil; -} - -/* - * call-seq: - * rng.step(n=1) {| obj | block } => rng - * - * Iterates over rng, passing each nth element to the block. If - * the range contains numbers or strings, natural ordering is used. Otherwise - * step invokes succ to iterate through range - * elements. The following code uses class Xs, which is defined - * in the class-level documentation. - * - * range = Xs.new(1)..Xs.new(10) - * range.step(2) {|x| puts x} - * range.step(3) {|x| puts x} - * - * produces: - * - * 1 x - * 3 xxx - * 5 xxxxx - * 7 xxxxxxx - * 9 xxxxxxxxx - * 1 x - * 4 xxxx - * 7 xxxxxxx - * 10 xxxxxxxxxx - */ - - -static VALUE -range_step(argc, argv, range) - int argc; - VALUE *argv; - VALUE range; -{ - VALUE b, e, step; - long unit; - - b = rb_ivar_get(range, id_beg); - e = rb_ivar_get(range, id_end); - if (rb_scan_args(argc, argv, "01", &step) == 0) { - step = INT2FIX(1); - } - - unit = NUM2LONG(step); - if (unit < 0) { - rb_raise(rb_eArgError, "step can't be negative"); - } - if (FIXNUM_P(b) && FIXNUM_P(e)) { /* fixnums are special */ - long end = FIX2LONG(e); - long i; - - if (unit == 0) rb_raise(rb_eArgError, "step can't be 0"); - if (!EXCL(range)) end += 1; - i = FIX2LONG(b); - while (i < end) { - rb_yield(LONG2NUM(i)); - if (i + unit < i) break; - i += unit; - } - } - else { - VALUE tmp = rb_check_string_type(b); - - if (!NIL_P(tmp)) { - VALUE args[5]; - long iter[2]; - - b = tmp; - if (unit == 0) rb_raise(rb_eArgError, "step can't be 0"); - args[0] = b; args[1] = e; args[2] = range; - iter[0] = 1; iter[1] = unit; - rb_iterate((VALUE(*)_((VALUE)))str_step, (VALUE)args, step_i, - (VALUE)iter); - } - else if (rb_obj_is_kind_of(b, rb_cNumeric)) { - ID c = rb_intern(EXCL(range) ? "<" : "<="); - - if (rb_equal(step, INT2FIX(0))) rb_raise(rb_eArgError, "step can't be 0"); - while (RTEST(rb_funcall(b, c, 1, e))) { - rb_yield(b); - b = rb_funcall(b, '+', 1, step); - } - } - else { - long args[2]; - - if (unit == 0) rb_raise(rb_eArgError, "step can't be 0"); - if (!rb_respond_to(b, id_succ)) { - rb_raise(rb_eTypeError, "can't iterate from %s", - rb_obj_classname(b)); - } - - args[0] = 1; - args[1] = unit; - range_each_func(range, step_i, b, e, args); - } - } - return range; -} - -static void -each_i(v, arg) - VALUE v; - void *arg; -{ - rb_yield(v); -} - -/* - * call-seq: - * rng.each {| i | block } => rng - * - * Iterates over the elements rng, passing each in turn to the - * block. You can only iterate if the start object of the range - * supports the +succ+ method (which means that you can't iterate over - * ranges of +Float+ objects). - * - * (10..15).each do |n| - * print n, ' ' - * end - * - * produces: - * - * 10 11 12 13 14 15 - */ - -static VALUE -range_each(range) - VALUE range; -{ - VALUE beg, end; - - beg = rb_ivar_get(range, id_beg); - end = rb_ivar_get(range, id_end); - - if (!rb_respond_to(beg, id_succ)) { - rb_raise(rb_eTypeError, "can't iterate from %s", - rb_obj_classname(beg)); - } - if (FIXNUM_P(beg) && FIXNUM_P(end)) { /* fixnums are special */ - long lim = FIX2LONG(end); - long i; - - if (!EXCL(range)) lim += 1; - for (i=FIX2LONG(beg); i obj - * rng.begin => obj - * - * Returns the first object in rng. - */ - -static VALUE -range_first(range) - VALUE range; -{ - return rb_ivar_get(range, id_beg); -} - - -/* - * call-seq: - * rng.end => obj - * rng.last => obj - * - * Returns the object that defines the end of rng. - * - * (1..10).end #=> 10 - * (1...10).end #=> 10 - */ - - -static VALUE -range_last(range) - VALUE range; -{ - return rb_ivar_get(range, id_end); -} - -VALUE -rb_range_beg_len(range, begp, lenp, len, err) - VALUE range; - long *begp, *lenp; - long len; - int err; -{ - long beg, end, b, e; - - if (!rb_obj_is_kind_of(range, rb_cRange)) return Qfalse; - - beg = b = NUM2LONG(rb_ivar_get(range, id_beg)); - end = e = NUM2LONG(rb_ivar_get(range, id_end)); - - if (beg < 0) { - beg += len; - if (beg < 0) goto out_of_range; - } - if (err == 0 || err == 2) { - if (beg > len) goto out_of_range; - if (end > len) end = len; - } - if (end < 0) end += len; - if (!EXCL(range)) end++; /* include end point */ - len = end - beg; - if (len < 0) len = 0; - - *begp = beg; - *lenp = len; - return Qtrue; - - out_of_range: - if (err) { - rb_raise(rb_eRangeError, "%ld..%s%ld out of range", - b, EXCL(range)? "." : "", e); - } - return Qnil; -} - -/* - * call-seq: - * rng.to_s => string - * - * Convert this range object to a printable form. - */ - -static VALUE -range_to_s(range) - VALUE range; -{ - VALUE str, str2; - - str = rb_obj_as_string(rb_ivar_get(range, id_beg)); - str2 = rb_obj_as_string(rb_ivar_get(range, id_end)); - str = rb_str_dup(str); - rb_str_cat(str, "...", EXCL(range)?3:2); - rb_str_append(str, str2); - OBJ_INFECT(str, str2); - - return str; -} - -/* - * call-seq: - * rng.inspect => string - * - * Convert this range object to a printable form (using - * inspect to convert the start and end - * objects). - */ - - -static VALUE -range_inspect(range) - VALUE range; -{ - VALUE str, str2; - - str = rb_inspect(rb_ivar_get(range, id_beg)); - str2 = rb_inspect(rb_ivar_get(range, id_end)); - str = rb_str_dup(str); - rb_str_cat(str, "...", EXCL(range)?3:2); - rb_str_append(str, str2); - OBJ_INFECT(str, str2); - - return str; -} - -/* - * call-seq: - * rng === obj => true or false - * rng.member?(val) => true or false - * rng.include?(val) => true or false - * - * Returns true if obj is an element of - * rng, false otherwise. Conveniently, - * === is the comparison operator used by - * case statements. - * - * case 79 - * when 1..50 then print "low\n" - * when 51..75 then print "medium\n" - * when 76..100 then print "high\n" - * end - * - * produces: - * - * high - */ - -static VALUE -range_include(range, val) - VALUE range, val; -{ - VALUE beg, end; - - beg = rb_ivar_get(range, id_beg); - end = rb_ivar_get(range, id_end); - if (r_le(beg, val)) { - if (EXCL(range)) { - if (r_lt(val, end)) return Qtrue; - } - else { - if (r_le(val, end)) return Qtrue; - } - } - return Qfalse; -} - - -/* A Range represents an interval---a set of values with a - * start and an end. Ranges may be constructed using the - * s..e and - * s...e literals, or with - * Range::new. Ranges constructed using .. - * run from the start to the end inclusively. Those created using - * ... exclude the end value. When used as an iterator, - * ranges return each value in the sequence. - * - * (-1..-5).to_a #=> [] - * (-5..-1).to_a #=> [-5, -4, -3, -2, -1] - * ('a'..'e').to_a #=> ["a", "b", "c", "d", "e"] - * ('a'...'e').to_a #=> ["a", "b", "c", "d"] - * - * Ranges can be constructed using objects of any type, as long as the - * objects can be compared using their <=> operator and - * they support the succ method to return the next object - * in sequence. - * - * class Xs # represent a string of 'x's - * include Comparable - * attr :length - * def initialize(n) - * @length = n - * end - * def succ - * Xs.new(@length + 1) - * end - * def <=>(other) - * @length <=> other.length - * end - * def to_s - * sprintf "%2d #{inspect}", @length - * end - * def inspect - * 'x' * @length - * end - * end - * - * r = Xs.new(3)..Xs.new(6) #=> xxx..xxxxxx - * r.to_a #=> [xxx, xxxx, xxxxx, xxxxxx] - * r.member?(Xs.new(5)) #=> true - * - * In the previous code example, class Xs includes the - * Comparable module. This is because - * Enumerable#member? checks for equality using - * ==. Including Comparable ensures that the - * == method is defined in terms of the <=> - * method implemented in Xs. - * - */ - -void -Init_Range() -{ - rb_cRange = rb_define_class("Range", rb_cObject); - rb_include_module(rb_cRange, rb_mEnumerable); - rb_define_method(rb_cRange, "initialize", range_initialize, -1); - rb_define_method(rb_cRange, "==", range_eq, 1); - rb_define_method(rb_cRange, "===", range_include, 1); - rb_define_method(rb_cRange, "eql?", range_eql, 1); - rb_define_method(rb_cRange, "hash", range_hash, 0); - rb_define_method(rb_cRange, "each", range_each, 0); - rb_define_method(rb_cRange, "step", range_step, -1); - rb_define_method(rb_cRange, "first", range_first, 0); - rb_define_method(rb_cRange, "last", range_last, 0); - rb_define_method(rb_cRange, "begin", range_first, 0); - rb_define_method(rb_cRange, "end", range_last, 0); - rb_define_method(rb_cRange, "to_s", range_to_s, 0); - rb_define_method(rb_cRange, "inspect", range_inspect, 0); - - rb_define_method(rb_cRange, "exclude_end?", range_exclude_end_p, 0); - - rb_define_method(rb_cRange, "member?", range_include, 1); - rb_define_method(rb_cRange, "include?", range_include, 1); - - id_cmp = rb_intern("<=>"); - id_succ = rb_intern("succ"); - id_beg = rb_intern("begin"); - id_end = rb_intern("end"); - id_excl = rb_intern("excl"); -} -/********************************************************************** - - re.c - - - $Author: shyouhei $ - created at: Mon Aug 9 18:24:49 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include "re.h" -#include - -VALUE rb_eRegexpError; - -#define BEG(no) regs->beg[no] -#define END(no) regs->end[no] - -#if 'a' == 97 /* it's ascii */ -static const char casetable[] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - /* ' ' '!' '"' '#' '$' '%' '&' ''' */ - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - /* '(' ')' '*' '+' ',' '-' '.' '/' */ - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - /* '0' '1' '2' '3' '4' '5' '6' '7' */ - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - /* '8' '9' ':' ';' '<' '=' '>' '?' */ - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - /* '@' 'A' 'B' 'C' 'D' 'E' 'F' 'G' */ - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - /* 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O' */ - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - /* 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' */ - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - /* 'X' 'Y' 'Z' '[' '\' ']' '^' '_' */ - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - /* '`' 'a' 'b' 'c' 'd' 'e' 'f' 'g' */ - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - /* 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' */ - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - /* 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' */ - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - /* 'x' 'y' 'z' '{' '|' '}' '~' */ - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', - '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', -}; -#else -# error >>> "You lose. You will need a translation table for your character set." <<< -#endif - -int -rb_memcicmp(x, y, len) - const void *x, *y; - long len; -{ - const unsigned char *p1 = x, *p2 = y; - int tmp; - - while (len--) { - if ((tmp = casetable[(unsigned)*p1++] - casetable[(unsigned)*p2++]) != 0) - return tmp; - } - return 0; -} - -int -rb_memcmp(p1, p2, len) - const void *p1, *p2; - long len; -{ - if (!ruby_ignorecase) { - return memcmp(p1, p2, len); - } - return rb_memcicmp(p1, p2, len); -} - -long -rb_memsearch(x0, m, y0, n) - const void *x0, *y0; - long m, n; -{ - const unsigned char *x = (unsigned char *)x0, *y = (unsigned char *)y0; - const unsigned char *s, *e; - long i; - int d; - unsigned long hx, hy; - -#define KR_REHASH(a, b, h) (((h) << 1) - (((unsigned long)(a))< n) return -1; - s = y; e = s + n - m; - - /* Preprocessing */ - /* computes d = 2^(m-1) with - the left-shift operator */ - d = sizeof(hx) * CHAR_BIT - 1; - if (d > m) d = m; - - if (ruby_ignorecase) { - if (n == m) { - return rb_memcicmp(x, s, m) == 0 ? 0 : -1; - } - /* Prepare hash value */ - for (hy = hx = i = 0; i < d; ++i) { - hx = KR_REHASH(0, casetable[x[i]], hx); - hy = KR_REHASH(0, casetable[s[i]], hy); - } - /* Searching */ - while (hx != hy || rb_memcicmp(x, s, m)) { - if (s >= e) return -1; - hy = KR_REHASH(casetable[*s], casetable[*(s+d)], hy); - s++; - } - } - else { - if (n == m) { - return memcmp(x, s, m) == 0 ? 0 : -1; - } - /* Prepare hash value */ - for (hy = hx = i = 0; i < d; ++i) { - hx = KR_REHASH(0, x[i], hx); - hy = KR_REHASH(0, s[i], hy); - } - /* Searching */ - while (hx != hy || memcmp(x, s, m)) { - if (s >= e) return -1; - hy = KR_REHASH(*s, *(s+d), hy); - s++; - } - } - return s-y; -} - -#define REG_LITERAL FL_USER5 -#define REG_CASESTATE FL_USER0 -#define KCODE_NONE 0 -#define KCODE_EUC FL_USER1 -#define KCODE_SJIS FL_USER2 -#define KCODE_UTF8 FL_USER3 -#define KCODE_FIXED FL_USER4 -#define KCODE_MASK (KCODE_EUC|KCODE_SJIS|KCODE_UTF8) - -static int reg_kcode = DEFAULT_KCODE; - -static void -kcode_euc(re) - struct RRegexp *re; -{ - FL_UNSET(re, KCODE_MASK); - FL_SET(re, KCODE_EUC); - FL_SET(re, KCODE_FIXED); -} - -static void -kcode_sjis(re) - struct RRegexp *re; -{ - FL_UNSET(re, KCODE_MASK); - FL_SET(re, KCODE_SJIS); - FL_SET(re, KCODE_FIXED); -} - -static void -kcode_utf8(re) - struct RRegexp *re; -{ - FL_UNSET(re, KCODE_MASK); - FL_SET(re, KCODE_UTF8); - FL_SET(re, KCODE_FIXED); -} - -static void -kcode_none(re) - struct RRegexp *re; -{ - FL_UNSET(re, KCODE_MASK); - FL_SET(re, KCODE_FIXED); -} - -static int curr_kcode; - -void -rb_kcode_set_option(re) - VALUE re; -{ - if (!FL_TEST(re, KCODE_FIXED)) return; - - curr_kcode = RBASIC(re)->flags & KCODE_MASK; - if (reg_kcode == curr_kcode) return; - switch (curr_kcode) { - case KCODE_NONE: - re_mbcinit(MBCTYPE_ASCII); - break; - case KCODE_EUC: - re_mbcinit(MBCTYPE_EUC); - break; - case KCODE_SJIS: - re_mbcinit(MBCTYPE_SJIS); - break; - case KCODE_UTF8: - re_mbcinit(MBCTYPE_UTF8); - break; - } -} - -void -rb_kcode_reset_option() -{ - if (reg_kcode == curr_kcode) return; - switch (reg_kcode) { - case KCODE_NONE: - re_mbcinit(MBCTYPE_ASCII); - break; - case KCODE_EUC: - re_mbcinit(MBCTYPE_EUC); - break; - case KCODE_SJIS: - re_mbcinit(MBCTYPE_SJIS); - break; - case KCODE_UTF8: - re_mbcinit(MBCTYPE_UTF8); - break; - } -} - -int -rb_reg_mbclen2(c, re) - unsigned int c; - VALUE re; -{ - int len; - - if (!FL_TEST(re, KCODE_FIXED)) - return mbclen(c); - rb_kcode_set_option(re); - len = mbclen(c); - rb_kcode_reset_option(); - return len; -} - -static void -rb_reg_check(re) - VALUE re; -{ - if (!RREGEXP(re)->ptr || !RREGEXP(re)->str) { - rb_raise(rb_eTypeError, "uninitialized Regexp"); - } -} - -extern int ruby_in_compile; - -static void -rb_reg_expr_str(str, s, len) - VALUE str; - const char *s; - long len; -{ - const char *p, *pend; - int need_escape = 0; - - p = s; pend = p + len; - while (pptr->options & RE_OPTION_MULTILINE) - rb_str_buf_cat2(str, "m"); - if (RREGEXP(re)->ptr->options & RE_OPTION_IGNORECASE) - rb_str_buf_cat2(str, "i"); - if (RREGEXP(re)->ptr->options & RE_OPTION_EXTENDED) - rb_str_buf_cat2(str, "x"); - - if (FL_TEST(re, KCODE_FIXED)) { - switch ((RBASIC(re)->flags & KCODE_MASK)) { - case KCODE_NONE: - rb_str_buf_cat2(str, "n"); - break; - case KCODE_EUC: - rb_str_buf_cat2(str, "e"); - break; - case KCODE_SJIS: - rb_str_buf_cat2(str, "s"); - break; - case KCODE_UTF8: - rb_str_buf_cat2(str, "u"); - break; - } - } - } - OBJ_INFECT(str, re); - return str; -} - - -/* - * call-seq: - * rxp.source => str - * - * Returns the original string of the pattern. - * - * /ab+c/ix.source #=> "ab+c" - */ - -static VALUE -rb_reg_source(re) - VALUE re; -{ - VALUE str; - - rb_reg_check(re); - str = rb_str_new(RREGEXP(re)->str,RREGEXP(re)->len); - if (OBJ_TAINTED(re)) OBJ_TAINT(str); - return str; -} - -/* - * call-seq: - * rxp.inspect => string - * - * Produce a nicely formatted string-version of _rxp_. Perhaps surprisingly, - * #inspect actually produces the more natural version of - * the string than #to_s. - * - * /ab+c/ix.to_s #=> /ab+c/ix -*/ - -static VALUE -rb_reg_inspect(re) - VALUE re; -{ - rb_reg_check(re); - return rb_reg_desc(RREGEXP(re)->str, RREGEXP(re)->len, re); -} - - -/* - * call-seq: - * rxp.to_s => str - * - * Returns a string containing the regular expression and its options (using the - * (?xxx:yyy) notation. This string can be fed back in to - * Regexp::new to a regular expression with the same semantics as - * the original. (However, Regexp#== may not return true when - * comparing the two, as the source of the regular expression itself may - * differ, as the example shows). Regexp#inspect produces a - * generally more readable version of rxp. - * - * r1 = /ab+c/ix #=> /ab+c/ix - * s1 = r1.to_s #=> "(?ix-m:ab+c)" - * r2 = Regexp.new(s1) #=> /(?ix-m:ab+c)/ - * r1 == r2 #=> false - * r1.source #=> "ab+c" - * r2.source #=> "(?ix-m:ab+c)" - */ - -static VALUE -rb_reg_to_s(re) - VALUE re; -{ - int options; - const int embeddable = RE_OPTION_MULTILINE|RE_OPTION_IGNORECASE|RE_OPTION_EXTENDED; - long len; - const char* ptr; - VALUE str = rb_str_buf_new2("(?"); - - rb_reg_check(re); - - options = RREGEXP(re)->ptr->options; - ptr = RREGEXP(re)->str; - len = RREGEXP(re)->len; - again: - if (len >= 4 && ptr[0] == '(' && ptr[1] == '?') { - int err = 1; - ptr += 2; - if ((len -= 2) > 0) { - do { - if (*ptr == 'm') { - options |= RE_OPTION_MULTILINE; - } - else if (*ptr == 'i') { - options |= RE_OPTION_IGNORECASE; - } - else if (*ptr == 'x') { - options |= RE_OPTION_EXTENDED; - } - else break; - ++ptr; - } while (--len > 0); - } - if (len > 1 && *ptr == '-') { - ++ptr; - --len; - do { - if (*ptr == 'm') { - options &= ~RE_OPTION_MULTILINE; - } - else if (*ptr == 'i') { - options &= ~RE_OPTION_IGNORECASE; - } - else if (*ptr == 'x') { - options &= ~RE_OPTION_EXTENDED; - } - else break; - ++ptr; - } while (--len > 0); - } - if (*ptr == ')') { - --len; - ++ptr; - goto again; - } - if (*ptr == ':' && ptr[len-1] == ')') { - Regexp *rp; - rb_kcode_set_option(re); - rp = ALLOC(Regexp); - MEMZERO((char *)rp, Regexp, 1); - err = re_compile_pattern(++ptr, len -= 2, rp) != 0; - rb_kcode_reset_option(); - re_free_pattern(rp); - } - if (err) { - options = RREGEXP(re)->ptr->options; - ptr = RREGEXP(re)->str; - len = RREGEXP(re)->len; - } - } - - if (options & RE_OPTION_MULTILINE) rb_str_buf_cat2(str, "m"); - if (options & RE_OPTION_IGNORECASE) rb_str_buf_cat2(str, "i"); - if (options & RE_OPTION_EXTENDED) rb_str_buf_cat2(str, "x"); - - if ((options & embeddable) != embeddable) { - rb_str_buf_cat2(str, "-"); - if (!(options & RE_OPTION_MULTILINE)) rb_str_buf_cat2(str, "m"); - if (!(options & RE_OPTION_IGNORECASE)) rb_str_buf_cat2(str, "i"); - if (!(options & RE_OPTION_EXTENDED)) rb_str_buf_cat2(str, "x"); - } - - rb_str_buf_cat2(str, ":"); - rb_reg_expr_str(str, ptr, len); - rb_str_buf_cat2(str, ")"); - - OBJ_INFECT(str, re); - return str; -} - -static void -rb_reg_raise(s, len, err, re) - const char *s; - long len; - const char *err; - VALUE re; -{ - VALUE desc = rb_reg_desc(s, len, re); - - if (ruby_in_compile) - rb_compile_error("%s: %s", err, RSTRING(desc)->ptr); - else - rb_raise(rb_eRegexpError, "%s: %s", err, RSTRING(desc)->ptr); -} - - -/* - * call-seq: - * rxp.casefold? => true or false - * - * Returns the value of the case-insensitive flag. - */ - -static VALUE -rb_reg_casefold_p(re) - VALUE re; -{ - rb_reg_check(re); - if (RREGEXP(re)->ptr->options & RE_OPTION_IGNORECASE) return Qtrue; - return Qfalse; -} - - -/* - * call-seq: - * rxp.options => fixnum - * - * Returns the set of bits corresponding to the options used when creating this - * Regexp (see Regexp::new for details. Note that additional bits - * may be set in the returned options: these are used internally by the regular - * expression code. These extra bits are ignored if the options are passed to - * Regexp::new. - * - * Regexp::IGNORECASE #=> 1 - * Regexp::EXTENDED #=> 2 - * Regexp::MULTILINE #=> 4 - * - * /cat/.options #=> 128 - * /cat/ix.options #=> 131 - * Regexp.new('cat', true).options #=> 129 - * Regexp.new('cat', 0, 's').options #=> 384 - * - * r = /cat/ix - * Regexp.new(r.source, r.options) #=> /cat/ix - */ - -static VALUE -rb_reg_options_m(re) - VALUE re; -{ - int options = rb_reg_options(re); - return INT2NUM(options); -} - - -/* - * call-seq: - * rxp.kcode => str - * - * Returns the character set code for the regexp. - */ - -static VALUE -rb_reg_kcode_m(re) - VALUE re; -{ - char *kcode; - - if (FL_TEST(re, KCODE_FIXED)) { - switch (RBASIC(re)->flags & KCODE_MASK) { - case KCODE_NONE: - kcode = "none"; break; - case KCODE_EUC: - kcode = "euc"; break; - case KCODE_SJIS: - kcode = "sjis"; break; - case KCODE_UTF8: - kcode = "utf8"; break; - default: - rb_bug("unknown kcode - should not happen"); - break; - } - return rb_str_new2(kcode); - } - return Qnil; -} - -static Regexp* -make_regexp(s, len, flags) - const char *s; - long len; - int flags; -{ - Regexp *rp; - char *err; - - /* Handle escaped characters first. */ - - /* Build a copy of the string (in dest) with the - escaped characters translated, and generate the regex - from that. - */ - - rp = ALLOC(Regexp); - MEMZERO((char *)rp, Regexp, 1); - rp->buffer = ALLOC_N(char, 16); - rp->allocated = 16; - rp->fastmap = ALLOC_N(char, 256); - if (flags) { - rp->options = flags; - } - err = re_compile_pattern(s, len, rp); - - if (err != NULL) { - re_free_pattern(rp); - rb_reg_raise(s, len, err, 0); - return 0; - } - return rp; -} - - -/* - * Document-class: MatchData - * - * MatchData is the type of the special variable $~, - * and is the type of the object returned by Regexp#match and - * Regexp#last_match. It encapsulates all the results of a pattern - * match, results normally accessed through the special variables - * $&, $', $`, $1, - * $2, and so on. Matchdata is also known as - * MatchingData. - * - */ - -VALUE rb_cMatch; - -static VALUE match_alloc _((VALUE)); -static VALUE -match_alloc(klass) - VALUE klass; -{ - NEWOBJ(match, struct RMatch); - OBJSETUP(match, klass, T_MATCH); - - match->str = 0; - match->regs = 0; - match->regs = ALLOC(struct re_registers); - MEMZERO(match->regs, struct re_registers, 1); - - return (VALUE)match; -} - -static void -match_check(VALUE match) -{ - if (!RMATCH(match)->str) { - rb_raise(rb_eTypeError, "uninitialized Match"); - } -} - -/* :nodoc: */ -static VALUE -match_init_copy(obj, orig) - VALUE obj, orig; -{ - if (obj == orig) return obj; - - if (!rb_obj_is_instance_of(orig, rb_obj_class(obj))) { - rb_raise(rb_eTypeError, "wrong argument class"); - } - RMATCH(obj)->str = RMATCH(orig)->str; - re_free_registers(RMATCH(obj)->regs); - RMATCH(obj)->regs->allocated = 0; - re_copy_registers(RMATCH(obj)->regs, RMATCH(orig)->regs); - - return obj; -} - - -/* - * call-seq: - * mtch.length => integer - * mtch.size => integer - * - * Returns the number of elements in the match array. - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138.") - * m.length #=> 5 - * m.size #=> 5 - */ - -static VALUE -match_size(match) - VALUE match; -{ - match_check(match); - return INT2FIX(RMATCH(match)->regs->num_regs); -} - - -/* - * call-seq: - * mtch.offset(n) => array - * - * Returns a two-element array containing the beginning and ending offsets of - * the nth match. - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138.") - * m.offset(0) #=> [1, 7] - * m.offset(4) #=> [6, 7] - */ - -static VALUE -match_offset(match, n) - VALUE match, n; -{ - int i = NUM2INT(n); - - match_check(match); - if (i < 0 || RMATCH(match)->regs->num_regs <= i) - rb_raise(rb_eIndexError, "index %d out of matches", i); - - if (RMATCH(match)->regs->beg[i] < 0) - return rb_assoc_new(Qnil, Qnil); - - return rb_assoc_new(INT2FIX(RMATCH(match)->regs->beg[i]), - INT2FIX(RMATCH(match)->regs->end[i])); -} - - -/* - * call-seq: - * mtch.begin(n) => integer - * - * Returns the offset of the start of the nth element of the match - * array in the string. - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138.") - * m.begin(0) #=> 1 - * m.begin(2) #=> 2 - */ - -static VALUE -match_begin(match, n) - VALUE match, n; -{ - int i = NUM2INT(n); - - match_check(match); - if (i < 0 || RMATCH(match)->regs->num_regs <= i) - rb_raise(rb_eIndexError, "index %d out of matches", i); - - if (RMATCH(match)->regs->beg[i] < 0) - return Qnil; - - return INT2FIX(RMATCH(match)->regs->beg[i]); -} - - -/* - * call-seq: - * mtch.end(n) => integer - * - * Returns the offset of the character immediately following the end of the - * nth element of the match array in the string. - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138.") - * m.end(0) #=> 7 - * m.end(2) #=> 3 - */ - -static VALUE -match_end(match, n) - VALUE match, n; -{ - int i = NUM2INT(n); - - match_check(match); - if (i < 0 || RMATCH(match)->regs->num_regs <= i) - rb_raise(rb_eIndexError, "index %d out of matches", i); - - if (RMATCH(match)->regs->beg[i] < 0) - return Qnil; - - return INT2FIX(RMATCH(match)->regs->end[i]); -} - -#define MATCH_BUSY FL_USER2 - -void -rb_match_busy(match) - VALUE match; -{ - FL_SET(match, MATCH_BUSY); -} - -int ruby_ignorecase; -static int may_need_recompile; - -static void -rb_reg_prepare_re(re) - VALUE re; -{ - int need_recompile = 0; - int state; - - rb_reg_check(re); - state = FL_TEST(re, REG_CASESTATE); - /* ignorecase status */ - if (ruby_ignorecase && !state) { - FL_SET(re, REG_CASESTATE); - RREGEXP(re)->ptr->options |= RE_OPTION_IGNORECASE; - need_recompile = 1; - } - if (!ruby_ignorecase && state) { - FL_UNSET(re, REG_CASESTATE); - RREGEXP(re)->ptr->options &= ~RE_OPTION_IGNORECASE; - need_recompile = 1; - } - - if (!FL_TEST(re, KCODE_FIXED) && - (RBASIC(re)->flags & KCODE_MASK) != reg_kcode) { - need_recompile = 1; - RBASIC(re)->flags &= ~KCODE_MASK; - RBASIC(re)->flags |= reg_kcode; - } - - if (need_recompile) { - char *err; - - if (FL_TEST(re, KCODE_FIXED)) - rb_kcode_set_option(re); - rb_reg_check(re); - RREGEXP(re)->ptr->fastmap_accurate = 0; - err = re_compile_pattern(RREGEXP(re)->str, RREGEXP(re)->len, RREGEXP(re)->ptr); - if (err != NULL) { - rb_reg_raise(RREGEXP(re)->str, RREGEXP(re)->len, err, re); - } - } -} - -long -rb_reg_adjust_startpos(re, str, pos, reverse) - VALUE re, str; - long pos, reverse; -{ - long range; - - rb_reg_check(re); - if (may_need_recompile) rb_reg_prepare_re(re); - - if (FL_TEST(re, KCODE_FIXED)) - rb_kcode_set_option(re); - else if (reg_kcode != curr_kcode) - rb_kcode_reset_option(); - - if (reverse) { - range = -pos; - } - else { - range = RSTRING(str)->len - pos; - } - return re_adjust_startpos(RREGEXP(re)->ptr, - RSTRING(str)->ptr, RSTRING(str)->len, - pos, range); -} - -long -rb_reg_search(re, str, pos, reverse) - VALUE re, str; - long pos, reverse; -{ - long result; - VALUE match; - struct re_registers regs; - long range; - - if (pos > RSTRING(str)->len || pos < 0) { - rb_backref_set(Qnil); - return -1; - } - - rb_reg_check(re); - if (may_need_recompile) rb_reg_prepare_re(re); - - if (FL_TEST(re, KCODE_FIXED)) - rb_kcode_set_option(re); - else if (reg_kcode != curr_kcode) - rb_kcode_reset_option(); - - if (reverse) { - range = -pos; - } - else { - range = RSTRING(str)->len - pos; - } - MEMZERO(®s, struct re_registers, 1); - result = re_search(RREGEXP(re)->ptr,RSTRING(str)->ptr,RSTRING(str)->len, - pos, range, ®s); - - if (FL_TEST(re, KCODE_FIXED)) - rb_kcode_reset_option(); - - if (result == -2) { - rb_reg_raise(RREGEXP(re)->str, RREGEXP(re)->len, - "Stack overflow in regexp matcher", re); - } - - if (result < 0) { - re_free_registers(®s); - rb_backref_set(Qnil); - return result; - } - - match = rb_backref_get(); - if (NIL_P(match) || FL_TEST(match, MATCH_BUSY)) { - match = match_alloc(rb_cMatch); - } - else { - if (rb_safe_level() >= 3) - OBJ_TAINT(match); - else - FL_UNSET(match, FL_TAINT); - } - - re_copy_registers(RMATCH(match)->regs, ®s); - re_free_registers(®s); - RMATCH(match)->str = rb_str_new4(str); - rb_backref_set(match); - - OBJ_INFECT(match, re); - OBJ_INFECT(match, str); - return result; -} - -VALUE -rb_reg_nth_defined(nth, match) - int nth; - VALUE match; -{ - if (NIL_P(match)) return Qnil; - match_check(match); - if (nth >= RMATCH(match)->regs->num_regs) { - return Qnil; - } - if (nth < 0) { - nth += RMATCH(match)->regs->num_regs; - if (nth <= 0) return Qnil; - } - if (RMATCH(match)->BEG(nth) == -1) return Qfalse; - return Qtrue; -} - -VALUE -rb_reg_nth_match(nth, match) - int nth; - VALUE match; -{ - VALUE str; - long start, end, len; - - if (NIL_P(match)) return Qnil; - match_check(match); - if (nth >= RMATCH(match)->regs->num_regs) { - return Qnil; - } - if (nth < 0) { - nth += RMATCH(match)->regs->num_regs; - if (nth <= 0) return Qnil; - } - start = RMATCH(match)->BEG(nth); - if (start == -1) return Qnil; - end = RMATCH(match)->END(nth); - len = end - start; - str = rb_str_substr(RMATCH(match)->str, start, len); - OBJ_INFECT(str, match); - return str; -} - -VALUE -rb_reg_last_match(match) - VALUE match; -{ - return rb_reg_nth_match(0, match); -} - - -/* - * call-seq: - * mtch.pre_match => str - * - * Returns the portion of the original string before the current match. - * Equivalent to the special variable $`. - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138.") - * m.pre_match #=> "T" - */ - -VALUE -rb_reg_match_pre(match) - VALUE match; -{ - VALUE str; - - if (NIL_P(match)) return Qnil; - match_check(match); - if (RMATCH(match)->BEG(0) == -1) return Qnil; - str = rb_str_substr(RMATCH(match)->str, 0, RMATCH(match)->BEG(0)); - if (OBJ_TAINTED(match)) OBJ_TAINT(str); - return str; -} - - -/* - * call-seq: - * mtch.post_match => str - * - * Returns the portion of the original string after the current match. - * Equivalent to the special variable $'. - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie") - * m.post_match #=> ": The Movie" - */ - -VALUE -rb_reg_match_post(match) - VALUE match; -{ - VALUE str; - long pos; - - if (NIL_P(match)) return Qnil; - match_check(match); - if (RMATCH(match)->BEG(0) == -1) return Qnil; - str = RMATCH(match)->str; - pos = RMATCH(match)->END(0); - str = rb_str_substr(str, pos, RSTRING(str)->len - pos); - if (OBJ_TAINTED(match)) OBJ_TAINT(str); - return str; -} - -VALUE -rb_reg_match_last(match) - VALUE match; -{ - int i; - - if (NIL_P(match)) return Qnil; - match_check(match); - if (RMATCH(match)->BEG(0) == -1) return Qnil; - - for (i=RMATCH(match)->regs->num_regs-1; RMATCH(match)->BEG(i) == -1 && i > 0; i--) - ; - if (i == 0) return Qnil; - return rb_reg_nth_match(i, match); -} - -static VALUE -last_match_getter() -{ - return rb_reg_last_match(rb_backref_get()); -} - -static VALUE -prematch_getter() -{ - return rb_reg_match_pre(rb_backref_get()); -} - -static VALUE -postmatch_getter() -{ - return rb_reg_match_post(rb_backref_get()); -} - -static VALUE -last_paren_match_getter() -{ - return rb_reg_match_last(rb_backref_get()); -} - -static VALUE -match_array(match, start) - VALUE match; - int start; -{ - struct re_registers *regs; - VALUE ary; - VALUE target; - int i; - int taint = OBJ_TAINTED(match); - - match_check(match); - regs = RMATCH(match)->regs; - ary = rb_ary_new2(regs->num_regs); - target = RMATCH(match)->str; - - for (i=start; inum_regs; i++) { - if (regs->beg[i] == -1) { - rb_ary_push(ary, Qnil); - } - else { - VALUE str = rb_str_substr(target, regs->beg[i], regs->end[i]-regs->beg[i]); - if (taint) OBJ_TAINT(str); - rb_ary_push(ary, str); - } - } - return ary; -} - - -/* [MG]:FIXME: I put parens around the /.../.match() in the first line of the - second example to prevent the '*' followed by a '/' from ending the - comment. */ - -/* - * call-seq: - * mtch.to_a => anArray - * - * Returns the array of matches. - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138.") - * m.to_a #=> ["HX1138", "H", "X", "113", "8"] - * - * Because to_a is called when expanding - * *variable, there's a useful assignment - * shortcut for extracting matched fields. This is slightly slower than - * accessing the fields directly (as an intermediate array is - * generated). - * - * all,f1,f2,f3 = *(/(.)(.)(\d+)(\d)/.match("THX1138.")) - * all #=> "HX1138" - * f1 #=> "H" - * f2 #=> "X" - * f3 #=> "113" - */ - -static VALUE -match_to_a(match) - VALUE match; -{ - return match_array(match, 0); -} - - -/* - * call-seq: - * mtch.captures => array - * - * Returns the array of captures; equivalent to mtch.to_a[1..-1]. - * - * f1,f2,f3,f4 = /(.)(.)(\d+)(\d)/.match("THX1138.").captures - * f1 #=> "H" - * f2 #=> "X" - * f3 #=> "113" - * f4 #=> "8" - */ -static VALUE -match_captures(match) - VALUE match; -{ - return match_array(match, 1); -} - - -/* - * call-seq: - * mtch[i] => obj - * mtch[start, length] => array - * mtch[range] => array - * - * Match Reference---MatchData acts as an array, and may be - * accessed using the normal array indexing techniques. mtch[0] is - * equivalent to the special variable $&, and returns the entire - * matched string. mtch[1], mtch[2], and so on return the values - * of the matched backreferences (portions of the pattern between parentheses). - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138.") - * m[0] #=> "HX1138" - * m[1, 2] #=> ["H", "X"] - * m[1..3] #=> ["H", "X", "113"] - * m[-3, 2] #=> ["X", "113"] - */ - -static VALUE -match_aref(argc, argv, match) - int argc; - VALUE *argv; - VALUE match; -{ - VALUE idx, rest; - - rb_scan_args(argc, argv, "11", &idx, &rest); - - if (!NIL_P(rest) || !FIXNUM_P(idx) || FIX2INT(idx) < 0) { - return rb_ary_aref(argc, argv, match_to_a(match)); - } - return rb_reg_nth_match(FIX2INT(idx), match); -} - -static VALUE match_entry _((VALUE, long)); -static VALUE -match_entry(match, n) - VALUE match; - long n; -{ - return rb_reg_nth_match(n, match); -} - - -/* - * call-seq: - * mtch.select([index]*) => array - * - * Uses each index to access the matching values, returning an array of - * the corresponding matches. - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie") - * m.to_a #=> ["HX1138", "H", "X", "113", "8"] - * m.select(0, 2, -2) #=> ["HX1138", "X", "113"] - */ - -static VALUE -match_values_at(argc, argv, match) - int argc; - VALUE *argv; - VALUE match; -{ - match_check(match); - return rb_values_at(match, RMATCH(match)->regs->num_regs, argc, argv, match_entry); -} - - -/* - * call-seq: - * mtch.select([index]*) => array - * - * Uses each index to access the matching values, returning an - * array of the corresponding matches. - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie") - * m.to_a #=> ["HX1138", "H", "X", "113", "8"] - * m.select(0, 2, -2) #=> ["HX1138", "X", "113"] - */ - -static VALUE -match_select(argc, argv, match) - int argc; - VALUE *argv; - VALUE match; -{ - if (argc > 0) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc); - } - else { - struct re_registers *regs; - VALUE target; - VALUE result = rb_ary_new(); - int i; - int taint = OBJ_TAINTED(match); - - match_check(match); - regs = RMATCH(match)->regs; - target = RMATCH(match)->str; - - for (i=0; inum_regs; i++) { - VALUE str = rb_str_substr(target, regs->beg[i], regs->end[i]-regs->beg[i]); - if (taint) OBJ_TAINT(str); - if (RTEST(rb_yield(str))) { - rb_ary_push(result, str); - } - } - return result; - } -} - - -/* - * call-seq: - * mtch.to_s => str - * - * Returns the entire matched string. - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138.") - * m.to_s #=> "HX1138" - */ - -static VALUE -match_to_s(match) - VALUE match; -{ - VALUE str = rb_reg_last_match(match); - - if (NIL_P(str)) str = rb_str_new(0,0); - if (OBJ_TAINTED(match)) OBJ_TAINT(str); - if (OBJ_TAINTED(RMATCH(match)->str)) OBJ_TAINT(str); - return str; -} - - -/* - * call-seq: - * mtch.string => str - * - * Returns a frozen copy of the string passed in to match. - * - * m = /(.)(.)(\d+)(\d)/.match("THX1138.") - * m.string #=> "THX1138." - */ - -static VALUE -match_string(match) - VALUE match; -{ - match_check(match); - return RMATCH(match)->str; /* str is frozen */ -} - -VALUE rb_cRegexp; - -static void -rb_reg_initialize(obj, s, len, options) - VALUE obj; - const char *s; - long len; - int options; /* CASEFOLD = 1 */ - /* EXTENDED = 2 */ - /* MULTILINE = 4 */ - /* CODE_NONE = 16 */ - /* CODE_EUC = 32 */ - /* CODE_SJIS = 48 */ - /* CODE_UTF8 = 64 */ -{ - struct RRegexp *re = RREGEXP(obj); - - if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't modify regexp"); - rb_check_frozen(obj); - if (FL_TEST(obj, REG_LITERAL)) - rb_raise(rb_eSecurityError, "can't modify literal regexp"); - if (re->ptr) re_free_pattern(re->ptr); - if (re->str) free(re->str); - re->ptr = 0; - re->str = 0; - - switch (options & ~0xf) { - case 0: - default: - FL_SET(re, reg_kcode); - break; - case 16: - kcode_none(re); - break; - case 32: - kcode_euc(re); - break; - case 48: - kcode_sjis(re); - break; - case 64: - kcode_utf8(re); - break; - } - - if (options & ~0xf) { - rb_kcode_set_option((VALUE)re); - } - if (ruby_ignorecase) { - options |= RE_OPTION_IGNORECASE; - FL_SET(re, REG_CASESTATE); - } - re->ptr = make_regexp(s, len, options & 0xf); - re->str = ALLOC_N(char, len+1); - memcpy(re->str, s, len); - re->str[len] = '\0'; - re->len = len; - if (options & ~0xf) { - rb_kcode_reset_option(); - } - if (ruby_in_compile) FL_SET(obj, REG_LITERAL); -} - -static VALUE rb_reg_s_alloc _((VALUE)); -static VALUE -rb_reg_s_alloc(klass) - VALUE klass; -{ - NEWOBJ(re, struct RRegexp); - OBJSETUP(re, klass, T_REGEXP); - - re->ptr = 0; - re->len = 0; - re->str = 0; - - return (VALUE)re; -} - -VALUE -rb_reg_new(s, len, options) - const char *s; - long len; - int options; -{ - VALUE re = rb_reg_s_alloc(rb_cRegexp); - - rb_reg_initialize(re, s, len, options); - return (VALUE)re; -} - -static int case_cache; -static int kcode_cache; -static VALUE reg_cache; - -VALUE -rb_reg_regcomp(str) - VALUE str; -{ - volatile VALUE save_str = str; - if (reg_cache && RREGEXP(reg_cache)->len == RSTRING(str)->len - && case_cache == ruby_ignorecase - && kcode_cache == reg_kcode - && memcmp(RREGEXP(reg_cache)->str, RSTRING(str)->ptr, RSTRING(str)->len) == 0) - return reg_cache; - - case_cache = ruby_ignorecase; - kcode_cache = reg_kcode; - return reg_cache = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len, - ruby_ignorecase); -} - -static int -rb_reg_cur_kcode(re) - VALUE re; -{ - if (FL_TEST(re, KCODE_FIXED)) { - return RBASIC(re)->flags & KCODE_MASK; - } - return 0; -} - -/* - * call-seq: - * rxp.hash => fixnum - * - * Produce a hash based on the text and options of this regular expression. - */ - -static VALUE -rb_reg_hash(re) - VALUE re; -{ - int hashval, len; - char *p; - - rb_reg_check(re); - hashval = RREGEXP(re)->ptr->options; - len = RREGEXP(re)->len; - p = RREGEXP(re)->str; - while (len--) { - hashval = hashval * 33 + *p++; - } - hashval = hashval + (hashval>>5); - - return INT2FIX(hashval); -} - - -/* - * call-seq: - * rxp == other_rxp => true or false - * rxp.eql?(other_rxp) => true or false - * - * Equality---Two regexps are equal if their patterns are identical, they have - * the same character set code, and their casefold? values are the - * same. - * - * /abc/ == /abc/x #=> false - * /abc/ == /abc/i #=> false - * /abc/u == /abc/n #=> false - */ - -static VALUE -rb_reg_equal(re1, re2) - VALUE re1, re2; -{ - if (re1 == re2) return Qtrue; - if (TYPE(re2) != T_REGEXP) return Qfalse; - rb_reg_check(re1); rb_reg_check(re2); - if (RREGEXP(re1)->len != RREGEXP(re2)->len) return Qfalse; - if (memcmp(RREGEXP(re1)->str, RREGEXP(re2)->str, RREGEXP(re1)->len) == 0 && - rb_reg_cur_kcode(re1) == rb_reg_cur_kcode(re2) && - RREGEXP(re1)->ptr->options == RREGEXP(re2)->ptr->options) { - return Qtrue; - } - return Qfalse; -} - - -/* - * call-seq: - * rxp.match(str) => matchdata or nil - * - * Returns a MatchData object describing the match, or - * nil if there was no match. This is equivalent to retrieving the - * value of the special variable $~ following a normal match. - * - * /(.)(.)(.)/.match("abc")[2] #=> "b" - */ - -VALUE -rb_reg_match(re, str) - VALUE re, str; -{ - long start; - - if (NIL_P(str)) { - rb_backref_set(Qnil); - return Qnil; - } - StringValue(str); - start = rb_reg_search(re, str, 0, 0); - if (start < 0) { - return Qnil; - } - return LONG2FIX(start); -} - - -/* - * call-seq: - * rxp === str => true or false - * - * Case Equality---Synonym for Regexp#=~ used in case statements. - * - * a = "HELLO" - * case a - * when /^[a-z]*$/; print "Lower case\n" - * when /^[A-Z]*$/; print "Upper case\n" - * else; print "Mixed case\n" - * end - * - * produces: - * - * Upper case - */ - -VALUE -rb_reg_eqq(re, str) - VALUE re, str; -{ - long start; - - if (TYPE(str) != T_STRING) { - str = rb_check_string_type(str); - if (NIL_P(str)) { - rb_backref_set(Qnil); - return Qfalse; - } - } - StringValue(str); - start = rb_reg_search(re, str, 0, 0); - if (start < 0) { - return Qfalse; - } - return Qtrue; -} - - -/* - * call-seq: - * ~ rxp => integer or nil - * - * Match---Matches rxp against the contents of $_. - * Equivalent to rxp =~ $_. - * - * $_ = "input data" - * ~ /at/ #=> 7 - */ - -VALUE -rb_reg_match2(re) - VALUE re; -{ - long start; - VALUE line = rb_lastline_get(); - - if (TYPE(line) != T_STRING) { - rb_backref_set(Qnil); - return Qnil; - } - - start = rb_reg_search(re, line, 0, 0); - if (start < 0) { - return Qnil; - } - return LONG2FIX(start); -} - - -/* - * call-seq: - * rxp.match(str) => matchdata or nil - * - * Returns a MatchData object describing the match, or - * nil if there was no match. This is equivalent to retrieving the - * value of the special variable $~ following a normal match. - * - * /(.)(.)(.)/.match("abc")[2] #=> "b" - */ - -static VALUE -rb_reg_match_m(re, str) - VALUE re, str; -{ - VALUE result = rb_reg_match(re, str); - - if (NIL_P(result)) return Qnil; - result = rb_backref_get(); - rb_match_busy(result); - return result; -} - -/* - * Document-method: compile - * - * Synonym for Regexp.new - */ - -/* - * call-seq: - * Regexp.new(string [, options [, lang]]) => regexp - * Regexp.new(regexp) => regexp - * Regexp.compile(string [, options [, lang]]) => regexp - * Regexp.compile(regexp) => regexp - * - * Constructs a new regular expression from pattern, which can be either - * a String or a Regexp (in which case that regexp's - * options are propagated, and new options may not be specified (a change as of - * Ruby 1.8). If options is a Fixnum, it should be one or - * more of the constants Regexp::EXTENDED, - * Regexp::IGNORECASE, and Regexp::MULTILINE, - * or-ed together. Otherwise, if options is not - * nil, the regexp will be case insensitive. The lang - * parameter enables multibyte support for the regexp: `n', `N' = none, `e', - * `E' = EUC, `s', `S' = SJIS, `u', `U' = UTF-8. - * - * r1 = Regexp.new('^a-z+:\\s+\w+') #=> /^a-z+:\s+\w+/ - * r2 = Regexp.new('cat', true) #=> /cat/i - * r3 = Regexp.new('dog', Regexp::EXTENDED) #=> /dog/x - * r4 = Regexp.new(r2) #=> /cat/i - */ - -static VALUE -rb_reg_initialize_m(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; -{ - const char *s; - long len; - int flags = 0; - - if (argc == 0 || argc > 3) { - rb_raise(rb_eArgError, "wrong number of arguments"); - } - if (TYPE(argv[0]) == T_REGEXP) { - if (argc > 1) { - rb_warn("flags%s ignored", (argc == 3) ? " and encoding": ""); - } - rb_reg_check(argv[0]); - flags = RREGEXP(argv[0])->ptr->options & 0xf; - if (FL_TEST(argv[0], KCODE_FIXED)) { - switch (RBASIC(argv[0])->flags & KCODE_MASK) { - case KCODE_NONE: - flags |= 16; - break; - case KCODE_EUC: - flags |= 32; - break; - case KCODE_SJIS: - flags |= 48; - break; - case KCODE_UTF8: - flags |= 64; - break; - default: - break; - } - } - s = RREGEXP(argv[0])->str; - len = RREGEXP(argv[0])->len; - } - else { - if (argc >= 2) { - if (FIXNUM_P(argv[1])) flags = FIX2INT(argv[1]); - else if (RTEST(argv[1])) flags = RE_OPTION_IGNORECASE; - } - if (argc == 3 && !NIL_P(argv[2])) { - char *kcode = StringValuePtr(argv[2]); - - flags &= ~0x70; - switch (kcode[0]) { - case 'n': case 'N': - flags |= 16; - break; - case 'e': case 'E': - flags |= 32; - break; - case 's': case 'S': - flags |= 48; - break; - case 'u': case 'U': - flags |= 64; - break; - default: - break; - } - } - s = StringValuePtr(argv[0]); - len = RSTRING(argv[0])->len; - } - rb_reg_initialize(self, s, len, flags); - return self; -} - -VALUE -rb_reg_quote(str) - VALUE str; -{ - char *s, *send, *t; - VALUE tmp; - int c; - - s = RSTRING(str)->ptr; - send = s + RSTRING(str)->len; - for (; s < send; s++) { - c = *s; - if (ismbchar(c)) { - int n = mbclen(c); - - while (n-- && s < send) - s++; - s--; - continue; - } - switch (c) { - case '[': case ']': case '{': case '}': - case '(': case ')': case '|': case '-': - case '*': case '.': case '\\': - case '?': case '+': case '^': case '$': - case ' ': case '#': - case '\t': case '\f': case '\n': case '\r': - goto meta_found; - } - } - return rb_str_new3(str); - - meta_found: - tmp = rb_str_new(0, RSTRING(str)->len*2); - t = RSTRING(tmp)->ptr; - /* copy upto metacharacter */ - memcpy(t, RSTRING(str)->ptr, s - RSTRING(str)->ptr); - t += s - RSTRING(str)->ptr; - - for (; s < send; s++) { - c = *s; - if (ismbchar(c)) { - int n = mbclen(c); - - while (n-- && s < send) - *t++ = *s++; - s--; - continue; - } - switch (c) { - case '[': case ']': case '{': case '}': - case '(': case ')': case '|': case '-': - case '*': case '.': case '\\': - case '?': case '+': case '^': case '$': - case '#': - *t++ = '\\'; - break; - case ' ': - *t++ = '\\'; - *t++ = ' '; - continue; - case '\t': - *t++ = '\\'; - *t++ = 't'; - continue; - case '\n': - *t++ = '\\'; - *t++ = 'n'; - continue; - case '\r': - *t++ = '\\'; - *t++ = 'r'; - continue; - case '\f': - *t++ = '\\'; - *t++ = 'f'; - continue; - } - *t++ = c; - } - rb_str_resize(tmp, t - RSTRING(tmp)->ptr); - OBJ_INFECT(tmp, str); - return tmp; -} - - -/* - * call-seq: - * Regexp.escape(str) => a_str - * Regexp.quote(str) => a_str - * - * Escapes any characters that would have special meaning in a regular - * expression. Returns a new escaped string, or self if no characters are - * escaped. For any string, - * Regexp.escape(str)=~str will be true. - * - * Regexp.escape('\\*?{}.') #=> \\\\\*\?\{\}\. - */ - -static VALUE -rb_reg_s_quote(argc, argv) - int argc; - VALUE *argv; -{ - VALUE str, kcode; - int kcode_saved = reg_kcode; - - rb_scan_args(argc, argv, "11", &str, &kcode); - if (!NIL_P(kcode)) { - rb_set_kcode(StringValuePtr(kcode)); - curr_kcode = reg_kcode; - reg_kcode = kcode_saved; - } - StringValue(str); - str = rb_reg_quote(str); - rb_kcode_reset_option(); - return str; -} - -int -rb_kcode() -{ - switch (reg_kcode) { - case KCODE_EUC: - return MBCTYPE_EUC; - case KCODE_SJIS: - return MBCTYPE_SJIS; - case KCODE_UTF8: - return MBCTYPE_UTF8; - case KCODE_NONE: - return MBCTYPE_ASCII; - } - rb_bug("wrong reg_kcode value (0x%x)", reg_kcode); -} - -static int -rb_reg_get_kcode(re) - VALUE re; -{ - switch (RBASIC(re)->flags & KCODE_MASK) { - case KCODE_NONE: - return 16; - case KCODE_EUC: - return 32; - case KCODE_SJIS: - return 48; - case KCODE_UTF8: - return 64; - default: - return 0; - } -} - -int -rb_reg_options(re) - VALUE re; -{ - int options; - - rb_reg_check(re); - options = RREGEXP(re)->ptr->options & - (RE_OPTION_IGNORECASE|RE_OPTION_MULTILINE|RE_OPTION_EXTENDED); - if (FL_TEST(re, KCODE_FIXED)) { - options |= rb_reg_get_kcode(re); - } - return options; -} - - -/* - * call-seq: - * Regexp.union([pattern]*) => new_str - * - * Return a Regexp object that is the union of the given - * patterns, i.e., will match any of its parts. The patterns - * can be Regexp objects, in which case their options will be preserved, or - * Strings. If no arguments are given, returns /(?!)/. - * - * Regexp.union #=> /(?!)/ - * Regexp.union("penzance") #=> /penzance/ - * Regexp.union("skiing", "sledding") #=> /skiing|sledding/ - * Regexp.union(/dogs/, /cats/i) #=> /(?-mix:dogs)|(?i-mx:cats)/ - */ -static VALUE -rb_reg_s_union(argc, argv) - int argc; - VALUE *argv; -{ - if (argc == 0) { - VALUE args[1]; - args[0] = rb_str_new2("(?!)"); - return rb_class_new_instance(1, args, rb_cRegexp); - } - else if (argc == 1) { - VALUE v; - v = rb_check_convert_type(argv[0], T_REGEXP, "Regexp", "to_regexp"); - if (!NIL_P(v)) - return v; - else { - VALUE args[1]; - args[0] = rb_reg_s_quote(argc, argv); - return rb_class_new_instance(1, args, rb_cRegexp); - } - } - else { - int i, kcode = -1; - VALUE kcode_re = Qnil; - VALUE source = rb_str_buf_new(0); - VALUE args[3]; - for (i = 0; i < argc; i++) { - volatile VALUE v; - if (0 < i) - rb_str_buf_cat2(source, "|"); - v = rb_check_convert_type(argv[i], T_REGEXP, "Regexp", "to_regexp"); - if (!NIL_P(v)) { - if (FL_TEST(v, KCODE_FIXED)) { - if (kcode == -1) { - kcode_re = v; - kcode = RBASIC(v)->flags & KCODE_MASK; - } - else if ((RBASIC(v)->flags & KCODE_MASK) != kcode) { - volatile VALUE str1, str2; - str1 = rb_inspect(kcode_re); - str2 = rb_inspect(v); - rb_raise(rb_eArgError, "mixed kcode: %s and %s", - RSTRING(str1)->ptr, RSTRING(str2)->ptr); - } - } - v = rb_reg_to_s(v); - } - else { - args[0] = argv[i]; - v = rb_reg_s_quote(1, args); - } - rb_str_buf_append(source, v); - } - args[0] = source; - args[1] = Qnil; - switch (kcode) { - case -1: - args[2] = Qnil; - break; - case KCODE_NONE: - args[2] = rb_str_new2("n"); - break; - case KCODE_EUC: - args[2] = rb_str_new2("e"); - break; - case KCODE_SJIS: - args[2] = rb_str_new2("s"); - break; - case KCODE_UTF8: - args[2] = rb_str_new2("u"); - break; - } - return rb_class_new_instance(3, args, rb_cRegexp); - } -} - -/* :nodoc: */ -static VALUE -rb_reg_init_copy(copy, re) - VALUE copy, re; -{ - if (copy == re) return copy; - rb_check_frozen(copy); - /* need better argument type check */ - if (!rb_obj_is_instance_of(re, rb_obj_class(copy))) { - rb_raise(rb_eTypeError, "wrong argument type"); - } - rb_reg_check(re); - rb_reg_initialize(copy, RREGEXP(re)->str, RREGEXP(re)->len, - rb_reg_options(re)); - return copy; -} - -VALUE -rb_reg_regsub(str, src, regs) - VALUE str, src; - struct re_registers *regs; -{ - VALUE val = 0; - char *p, *s, *e, c; - int no; - - p = s = RSTRING(str)->ptr; - e = s + RSTRING(str)->len; - - while (s < e) { - char *ss = s; - - c = *s++; - if (ismbchar(c)) { - s += mbclen(c) - 1; - continue; - } - if (c != '\\' || s == e) continue; - - if (!val) { - val = rb_str_buf_new(ss-p); - rb_str_buf_cat(val, p, ss-p); - } - else { - rb_str_buf_cat(val, p, ss-p); - } - - c = *s++; - p = s; - switch (c) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - no = c - '0'; - break; - case '&': - no = 0; - break; - - case '`': - rb_str_buf_cat(val, RSTRING(src)->ptr, BEG(0)); - continue; - - case '\'': - rb_str_buf_cat(val, RSTRING(src)->ptr+END(0), RSTRING(src)->len-END(0)); - continue; - - case '+': - no = regs->num_regs-1; - while (BEG(no) == -1 && no > 0) no--; - if (no == 0) continue; - break; - - case '\\': - rb_str_buf_cat(val, s-1, 1); - continue; - - default: - rb_str_buf_cat(val, s-2, 2); - continue; - } - - if (no >= 0) { - if (no >= regs->num_regs) continue; - if (BEG(no) == -1) continue; - rb_str_buf_cat(val, RSTRING(src)->ptr+BEG(no), END(no)-BEG(no)); - } - } - - if (p < e) { - if (!val) { - val = rb_str_buf_new(e-p); - rb_str_buf_cat(val, p, e-p); - } - else { - rb_str_buf_cat(val, p, e-p); - } - } - if (!val) return str; - - return val; -} - -const char* -rb_get_kcode() -{ - switch (reg_kcode) { - case KCODE_SJIS: - return "SJIS"; - case KCODE_EUC: - return "EUC"; - case KCODE_UTF8: - return "UTF8"; - default: - return "NONE"; - } -} - -static VALUE -kcode_getter() -{ - return rb_str_new2(rb_get_kcode()); -} - -void -rb_set_kcode(code) - const char *code; -{ - if (code == 0) goto set_no_conversion; - - switch (code[0]) { - case 'E': - case 'e': - reg_kcode = KCODE_EUC; - re_mbcinit(MBCTYPE_EUC); - break; - case 'S': - case 's': - reg_kcode = KCODE_SJIS; - re_mbcinit(MBCTYPE_SJIS); - break; - case 'U': - case 'u': - reg_kcode = KCODE_UTF8; - re_mbcinit(MBCTYPE_UTF8); - break; - default: - case 'N': - case 'n': - case 'A': - case 'a': - set_no_conversion: - reg_kcode = KCODE_NONE; - re_mbcinit(MBCTYPE_ASCII); - break; - } -} - -static void -kcode_setter(val) - VALUE val; -{ - may_need_recompile = 1; - rb_set_kcode(StringValuePtr(val)); -} - -static VALUE -ignorecase_getter() -{ - return ruby_ignorecase?Qtrue:Qfalse; -} - -static void -ignorecase_setter(val, id) - VALUE val; - ID id; -{ - rb_warn("modifying %s is deprecated", rb_id2name(id)); - may_need_recompile = 1; - ruby_ignorecase = RTEST(val); -} - -static VALUE -match_getter() -{ - VALUE match = rb_backref_get(); - - if (NIL_P(match)) return Qnil; - rb_match_busy(match); - return match; -} - -static void -match_setter(val) - VALUE val; -{ - if (!NIL_P(val)) { - Check_Type(val, T_MATCH); - } - rb_backref_set(val); -} - -/* - * call-seq: - * Regexp.last_match => matchdata - * Regexp.last_match(fixnum) => str - * - * The first form returns the MatchData object generated by the - * last successful pattern match. Equivalent to reading the global variable - * $~. The second form returns the nth field in this - * MatchData object. - * - * /c(.)t/ =~ 'cat' #=> 0 - * Regexp.last_match #=> # - * Regexp.last_match(0) #=> "cat" - * Regexp.last_match(1) #=> "a" - * Regexp.last_match(2) #=> nil - */ - -static VALUE -rb_reg_s_last_match(argc, argv) - int argc; - VALUE *argv; -{ - VALUE nth; - - if (rb_scan_args(argc, argv, "01", &nth) == 1) { - return rb_reg_nth_match(NUM2INT(nth), rb_backref_get()); - } - return match_getter(); -} - - -/* - * Document-class: Regexp - * - * A Regexp holds a regular expression, used to match a pattern - * against strings. Regexps are created using the /.../ and - * %r{...} literals, and by the Regexp::new - * constructor. - * - */ - -void -Init_Regexp() -{ - rb_eRegexpError = rb_define_class("RegexpError", rb_eStandardError); - - re_set_casetable(casetable); -#if DEFAULT_KCODE == KCODE_EUC - re_mbcinit(MBCTYPE_EUC); -#else -#if DEFAULT_KCODE == KCODE_SJIS - re_mbcinit(MBCTYPE_SJIS); -#else -#if DEFAULT_KCODE == KCODE_UTF8 - re_mbcinit(MBCTYPE_UTF8); -#else - re_mbcinit(MBCTYPE_ASCII); -#endif -#endif -#endif - - rb_define_virtual_variable("$~", match_getter, match_setter); - rb_define_virtual_variable("$&", last_match_getter, 0); - rb_define_virtual_variable("$`", prematch_getter, 0); - rb_define_virtual_variable("$'", postmatch_getter, 0); - rb_define_virtual_variable("$+", last_paren_match_getter, 0); - - rb_define_virtual_variable("$=", ignorecase_getter, ignorecase_setter); - rb_define_virtual_variable("$KCODE", kcode_getter, kcode_setter); - rb_define_virtual_variable("$-K", kcode_getter, kcode_setter); - - rb_cRegexp = rb_define_class("Regexp", rb_cObject); - rb_define_alloc_func(rb_cRegexp, rb_reg_s_alloc); - rb_define_singleton_method(rb_cRegexp, "compile", rb_class_new_instance, -1); - rb_define_singleton_method(rb_cRegexp, "quote", rb_reg_s_quote, -1); - rb_define_singleton_method(rb_cRegexp, "escape", rb_reg_s_quote, -1); - rb_define_singleton_method(rb_cRegexp, "union", rb_reg_s_union, -1); - rb_define_singleton_method(rb_cRegexp, "last_match", rb_reg_s_last_match, -1); - - rb_define_method(rb_cRegexp, "initialize", rb_reg_initialize_m, -1); - rb_define_method(rb_cRegexp, "initialize_copy", rb_reg_init_copy, 1); - rb_define_method(rb_cRegexp, "hash", rb_reg_hash, 0); - rb_define_method(rb_cRegexp, "eql?", rb_reg_equal, 1); - rb_define_method(rb_cRegexp, "==", rb_reg_equal, 1); - rb_define_method(rb_cRegexp, "=~", rb_reg_match, 1); - rb_define_method(rb_cRegexp, "===", rb_reg_eqq, 1); - rb_define_method(rb_cRegexp, "~", rb_reg_match2, 0); - rb_define_method(rb_cRegexp, "match", rb_reg_match_m, 1); - rb_define_method(rb_cRegexp, "to_s", rb_reg_to_s, 0); - rb_define_method(rb_cRegexp, "inspect", rb_reg_inspect, 0); - rb_define_method(rb_cRegexp, "source", rb_reg_source, 0); - rb_define_method(rb_cRegexp, "casefold?", rb_reg_casefold_p, 0); - rb_define_method(rb_cRegexp, "options", rb_reg_options_m, 0); - rb_define_method(rb_cRegexp, "kcode", rb_reg_kcode_m, 0); - - rb_define_const(rb_cRegexp, "IGNORECASE", INT2FIX(RE_OPTION_IGNORECASE)); - rb_define_const(rb_cRegexp, "EXTENDED", INT2FIX(RE_OPTION_EXTENDED)); - rb_define_const(rb_cRegexp, "MULTILINE", INT2FIX(RE_OPTION_MULTILINE)); - - rb_global_variable(®_cache); - - rb_cMatch = rb_define_class("MatchData", rb_cObject); - rb_define_global_const("MatchingData", rb_cMatch); - rb_define_alloc_func(rb_cMatch, match_alloc); - rb_undef_method(CLASS_OF(rb_cMatch), "new"); - - rb_define_method(rb_cMatch, "initialize_copy", match_init_copy, 1); - rb_define_method(rb_cMatch, "size", match_size, 0); - rb_define_method(rb_cMatch, "length", match_size, 0); - rb_define_method(rb_cMatch, "offset", match_offset, 1); - rb_define_method(rb_cMatch, "begin", match_begin, 1); - rb_define_method(rb_cMatch, "end", match_end, 1); - rb_define_method(rb_cMatch, "to_a", match_to_a, 0); - rb_define_method(rb_cMatch, "[]", match_aref, -1); - rb_define_method(rb_cMatch, "captures", match_captures, 0); - rb_define_method(rb_cMatch, "select", match_select, -1); - rb_define_method(rb_cMatch, "values_at", match_values_at, -1); - rb_define_method(rb_cMatch, "pre_match", rb_reg_match_pre, 0); - rb_define_method(rb_cMatch, "post_match", rb_reg_match_post, 0); - rb_define_method(rb_cMatch, "to_s", match_to_s, 0); - rb_define_method(rb_cMatch, "inspect", rb_any_to_s, 0); /* in object.c */ - rb_define_method(rb_cMatch, "string", match_string, 0); -} -/* Extended regular expression matching and search library. - Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file LGPL. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ -/* Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto) - Last change: May 21, 1993 by t^2 */ -/* removed gapped buffer support, multiple syntax support by matz */ -/* Perl5 extension added by matz */ -/* UTF-8 extension added Jan 16 1999 by Yoshida Masato */ - -#include "config.h" - -#ifdef HAVE_STRING_H -# include -#else -# include -#endif - -/* We write fatal error messages on standard error. */ -#include - -/* isalpha(3) etc. are used for the character classes. */ -#include -#include - -#ifndef PARAMS -# if defined __GNUC__ || (defined __STDC__ && __STDC__) -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif /* GCC. */ -#endif /* Not PARAMS. */ - -#if defined(STDC_HEADERS) -# include -#else -/* We need this for `regex.h', and perhaps for the Emacs include files. */ -# include -#endif -#ifdef HAVE_STDLIB_H -# include -#endif - -#if !defined(__STDC__) && !defined(_MSC_VER) -# define volatile -#endif - -#ifdef HAVE_PROTOTYPES -# define _(args) args -#else -# define _(args) () -#endif - -#ifdef RUBY_PLATFORM -#include "defines.h" -#undef xmalloc -#undef xrealloc -#undef xcalloc -#undef xfree - -# define RUBY -extern int rb_prohibit_interrupt; -extern int rb_trap_pending; -void rb_trap_exec _((void)); - -# define CHECK_INTS do {\ - if (!rb_prohibit_interrupt) {\ - if (rb_trap_pending) rb_trap_exec();\ - }\ -} while (0) -#endif - -/* Make alloca work the best possible way. */ -#ifdef __GNUC__ -# ifndef atarist -# ifndef alloca -# define alloca __builtin_alloca -# endif -# endif /* atarist */ -#else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (); -# endif -# endif /* AIX */ -# endif /* HAVE_ALLOCA_H */ - -#endif /* __GNUC__ */ - -#ifdef HAVE_STRING_H -# include -#else -# include -#endif - -#define xmalloc malloc -#define xrealloc realloc -#define xcalloc calloc -#define xfree free - -#ifdef C_ALLOCA -#define FREE_VARIABLES() alloca(0) -#else -#define FREE_VARIABLES() -#endif - -#define FREE_AND_RETURN_VOID(stackb) do { \ - FREE_VARIABLES(); \ - if (stackb != stacka) xfree(stackb); \ - return; \ -} while(0) - -#define FREE_AND_RETURN(stackb,val) do { \ - FREE_VARIABLES(); \ - if (stackb != stacka) xfree(stackb); \ - return(val); \ -} while(0) - -#define DOUBLE_STACK(type) do { \ - type *stackx; \ - unsigned int xlen = stacke - stackb; \ - if (stackb == stacka) { \ - stackx = (type*)xmalloc(2 * xlen * sizeof(type)); \ - if (!stackx) goto memory_exhausted; \ - memcpy(stackx, stackb, xlen * sizeof (type)); \ - } \ - else { \ - stackx = (type*)xrealloc(stackb, 2 * xlen * sizeof(type)); \ - if (!stackx) goto memory_exhausted; \ - } \ - /* Rearrange the pointers. */ \ - stackp = stackx + (stackp - stackb); \ - stackb = stackx; \ - stacke = stackb + 2 * xlen; \ -} while (0) - -#define RE_TALLOC(n,t) ((t*)alloca((n)*sizeof(t))) -#define TMALLOC(n,t) ((t*)xmalloc((n)*sizeof(t))) -#define TREALLOC(s,n,t) (s=((t*)xrealloc(s,(n)*sizeof(t)))) - -#define EXPAND_FAIL_STACK() DOUBLE_STACK(unsigned char*) -#define ENSURE_FAIL_STACK(n) \ - do { \ - if (stacke - stackp <= (n)) { \ - /* if (len > re_max_failures * MAX_NUM_FAILURE_ITEMS) \ - { \ - FREE_AND_RETURN(stackb,(-2)); \ - }*/ \ - \ - /* Roughly double the size of the stack. */ \ - EXPAND_FAIL_STACK(); \ - } \ - } while (0) - -/* Get the interface, including the syntax bits. */ -#include "regex.h" - -/* Subroutines for re_compile_pattern. */ -static void store_jump _((char*, int, char*)); -static void insert_jump _((int, char*, char*, char*)); -static void store_jump_n _((char*, int, char*, unsigned)); -static void insert_jump_n _((int, char*, char*, char*, unsigned)); -static void insert_op _((int, char*, char*)); -static void insert_op_2 _((int, char*, char*, int, int)); -static int memcmp_translate _((unsigned char*, unsigned char*, int)); - -/* Define the syntax stuff, so we can do the \<, \>, etc. */ - -/* This must be nonzero for the wordchar and notwordchar pattern - commands in re_match. */ -#define Sword 1 -#define Sword2 2 - -#define SYNTAX(c) re_syntax_table[c] - -static char re_syntax_table[256]; -static void init_syntax_once _((void)); -static const unsigned char *translate = 0; -static void init_regs _((struct re_registers*, unsigned int)); -static void bm_init_skip _((int *, unsigned char*, int, const unsigned char*)); -static int current_mbctype = MBCTYPE_ASCII; - -#undef P - -#ifdef RUBY -#include "util.h" -void rb_warn _((const char*, ...)); -# define re_warning(x) rb_warn(x) -#endif - -#ifndef re_warning -# define re_warning(x) -#endif - -static void -init_syntax_once() -{ - register int c; - static int done = 0; - - if (done) - return; - - memset(re_syntax_table, 0, sizeof re_syntax_table); - - for (c=0; c<=0x7f; c++) - if (isalnum(c)) - re_syntax_table[c] = Sword; - re_syntax_table['_'] = Sword; - - for (c=0x80; c<=0xff; c++) - if (isalnum(c)) - re_syntax_table[c] = Sword2; - done = 1; -} - -void -re_set_casetable(table) - const char *table; -{ - translate = (const unsigned char*)table; -} - -/* Jim Meyering writes: - - "... Some ctype macros are valid only for character codes that - isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when - using /bin/cc or gcc but without giving an ansi option). So, all - ctype uses should be through macros like ISPRINT... If - STDC_HEADERS is defined, then autoconf has verified that the ctype - macros don't need to be guarded with references to isascii. ... - Defining isascii to 1 should let any compiler worth its salt - eliminate the && through constant folding." - Solaris defines some of these symbols so we must undefine them first. */ - -#undef ISASCII -#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII) -# define ISASCII(c) 1 -#else -# define ISASCII(c) isascii(c) -#endif - -#ifdef isblank -# define ISBLANK(c) (ISASCII(c) && isblank(c)) -#else -# define ISBLANK(c) ((c) == ' ' || (c) == '\t') -#endif -#ifdef isgraph -# define ISGRAPH(c) (ISASCII(c) && isgraph(c)) -#else -# define ISGRAPH(c) (ISASCII(c) && isprint(c) && !isspace(c)) -#endif - -#undef ISPRINT -#define ISPRINT(c) (ISASCII(c) && isprint(c)) -#define ISDIGIT(c) (ISASCII(c) && isdigit(c)) -#define ISALNUM(c) (ISASCII(c) && isalnum(c)) -#define ISALPHA(c) (ISASCII(c) && isalpha(c)) -#define ISCNTRL(c) (ISASCII(c) && iscntrl(c)) -#define ISLOWER(c) (ISASCII(c) && islower(c)) -#define ISPUNCT(c) (ISASCII(c) && ispunct(c)) -#define ISSPACE(c) (ISASCII(c) && isspace(c)) -#define ISUPPER(c) (ISASCII(c) && isupper(c)) -#define ISXDIGIT(c) (ISASCII(c) && isxdigit(c)) - -#ifndef NULL -# define NULL (void *)0 -#endif - -/* We remove any previous definition of `SIGN_EXTEND_CHAR', - since ours (we hope) works properly with all combinations of - machines, compilers, `char' and `unsigned char' argument types. - (Per Bothner suggested the basic approach.) */ -#undef SIGN_EXTEND_CHAR -#if __STDC__ -# define SIGN_EXTEND_CHAR(c) ((signed char)(c)) -#else /* not __STDC__ */ -/* As in Harbison and Steele. */ -# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128) -#endif - -/* These are the command codes that appear in compiled regular - expressions, one per byte. Some command codes are followed by - argument bytes. A command code can specify any interpretation - whatsoever for its arguments. Zero-bytes may appear in the compiled - regular expression. - - The value of `exactn' is needed in search.c (search_buffer) in emacs. - So regex.h defines a symbol `RE_EXACTN_VALUE' to be 1; the value of - `exactn' we use here must also be 1. */ - -enum regexpcode - { - unused=0, - exactn=1, /* Followed by one byte giving n, then by n literal bytes. */ - begline, /* Fail unless at beginning of line. */ - endline, /* Fail unless at end of line. */ - begbuf, /* Succeeds if at beginning of buffer (if emacs) or at beginning - of string to be matched (if not). */ - endbuf, /* Analogously, for end of buffer/string. */ - endbuf2, /* End of buffer/string, or newline just before it. */ - begpos, /* Matches where last scan//gsub left off. */ - jump, /* Followed by two bytes giving relative address to jump to. */ - jump_past_alt,/* Same as jump, but marks the end of an alternative. */ - on_failure_jump, /* Followed by two bytes giving relative address of - place to resume at in case of failure. */ - finalize_jump, /* Throw away latest failure point and then jump to - address. */ - maybe_finalize_jump, /* Like jump but finalize if safe to do so. - This is used to jump back to the beginning - of a repeat. If the command that follows - this jump is clearly incompatible with the - one at the beginning of the repeat, such that - we can be sure that there is no use backtracking - out of repetitions already completed, - then we finalize. */ - dummy_failure_jump, /* Jump, and push a dummy failure point. This - failure point will be thrown away if an attempt - is made to use it for a failure. A + construct - makes this before the first repeat. Also - use it as an intermediary kind of jump when - compiling an or construct. */ - push_dummy_failure, /* Push a dummy failure point and continue. Used at the end of - alternatives. */ - succeed_n, /* Used like on_failure_jump except has to succeed n times; - then gets turned into an on_failure_jump. The relative - address following it is useless until then. The - address is followed by two bytes containing n. */ - jump_n, /* Similar to jump, but jump n times only; also the relative - address following is in turn followed by yet two more bytes - containing n. */ - try_next, /* Jump to next pattern for the first time, - leaving this pattern on the failure stack. */ - finalize_push, /* Finalize stack and push the beginning of the pattern - on the stack to retry (used for non-greedy match) */ - finalize_push_n, /* Similar to finalize_push, buf finalize n time only */ - set_number_at, /* Set the following relative location to the - subsequent number. */ - anychar, /* Matches any (more or less) one character excluding newlines. */ - anychar_repeat, /* Matches sequence of characters excluding newlines. */ - charset, /* Matches any one char belonging to specified set. - First following byte is number of bitmap bytes. - Then come bytes for a bitmap saying which chars are in. - Bits in each byte are ordered low-bit-first. - A character is in the set if its bit is 1. - A character too large to have a bit in the map - is automatically not in the set. */ - charset_not, /* Same parameters as charset, but match any character - that is not one of those specified. */ - start_memory, /* Start remembering the text that is matched, for - storing in a memory register. Followed by one - byte containing the register number. Register numbers - must be in the range 0 through RE_NREGS. */ - stop_memory, /* Stop remembering the text that is matched - and store it in a memory register. Followed by - one byte containing the register number. Register - numbers must be in the range 0 through RE_NREGS. */ - start_paren, /* Place holder at the start of (?:..). */ - stop_paren, /* Place holder at the end of (?:..). */ - casefold_on, /* Turn on casefold flag. */ - casefold_off, /* Turn off casefold flag. */ - option_set, /* Turn on multi line match (match with newlines). */ - start_nowidth, /* Save string point to the stack. */ - stop_nowidth, /* Restore string place at the point start_nowidth. */ - pop_and_fail, /* Fail after popping nowidth entry from stack. */ - stop_backtrack, /* Restore backtrack stack at the point start_nowidth. */ - duplicate, /* Match a duplicate of something remembered. - Followed by one byte containing the index of the memory - register. */ - wordchar, /* Matches any word-constituent character. */ - notwordchar, /* Matches any char that is not a word-constituent. */ - wordbeg, /* Succeeds if at word beginning. */ - wordend, /* Succeeds if at word end. */ - wordbound, /* Succeeds if at a word boundary. */ - notwordbound /* Succeeds if not at a word boundary. */ - }; - - -/* Number of failure points to allocate space for initially, - when matching. If this number is exceeded, more space is allocated, - so it is not a hard limit. */ - -#ifndef NFAILURES -#define NFAILURES 160 -#endif - -/* Store NUMBER in two contiguous bytes starting at DESTINATION. */ -#define STORE_NUMBER(destination, number) \ - do { (destination)[0] = (number) & 0377; \ - (destination)[1] = (number) >> 8; } while (0) - -/* Same as STORE_NUMBER, except increment the destination pointer to - the byte after where the number is stored. Watch out that values for - DESTINATION such as p + 1 won't work, whereas p will. */ -#define STORE_NUMBER_AND_INCR(destination, number) \ - do { STORE_NUMBER(destination, number); \ - (destination) += 2; } while (0) - - -/* Put into DESTINATION a number stored in two contingous bytes starting - at SOURCE. */ -#define EXTRACT_NUMBER(destination, source) \ - do { (destination) = *(source) & 0377; \ - (destination) += SIGN_EXTEND_CHAR(*(char*)((source) + 1)) << 8; } while (0) - -/* Same as EXTRACT_NUMBER, except increment the pointer for source to - point to second byte of SOURCE. Note that SOURCE has to be a value - such as p, not, e.g., p + 1. */ -#define EXTRACT_NUMBER_AND_INCR(destination, source) \ - do { EXTRACT_NUMBER(destination, source); \ - (source) += 2; } while (0) - - -/* Specify the precise syntax of regexps for compilation. This provides - for compatibility for various utilities which historically have - different, incompatible syntaxes. - - The argument SYNTAX is a bit-mask comprised of the various bits - defined in regex.h. */ - -long -re_set_syntax(syntax) - long syntax; -{ - /* obsolete */ - return 0; -} - -/* Macros for re_compile_pattern, which is found below these definitions. */ - -#define TRANSLATE_P() ((options&RE_OPTION_IGNORECASE) && translate) -#define MAY_TRANSLATE() ((bufp->options&(RE_OPTION_IGNORECASE|RE_MAY_IGNORECASE)) && translate) -/* Fetch the next character in the uncompiled pattern---translating it - if necessary. Also cast from a signed character in the constant - string passed to us by the user to an unsigned char that we can use - as an array index (in, e.g., `translate'). */ -#define PATFETCH(c) \ - do {if (p == pend) goto end_of_pattern; \ - c = (unsigned char) *p++; \ - if (TRANSLATE_P()) c = (unsigned char)translate[c]; \ - } while (0) - -/* Fetch the next character in the uncompiled pattern, with no - translation. */ -#define PATFETCH_RAW(c) \ - do {if (p == pend) goto end_of_pattern; \ - c = (unsigned char)*p++; \ - } while (0) - -/* Go backwards one character in the pattern. */ -#define PATUNFETCH p-- - -#define MBC2WC(c, p) \ - do { \ - if (current_mbctype == MBCTYPE_UTF8) { \ - int n = mbclen(c) - 1; \ - c &= (1<<(BYTEWIDTH-2-n)) - 1; \ - while (n--) { \ - c = c << 6 | (*p++ & ((1<<6)-1)); \ - } \ - } \ - else { \ - c <<= 8; \ - c |= (unsigned char)*(p)++; \ - } \ - } while (0) - -#define PATFETCH_MBC(c) \ - do { \ - if (p + mbclen(c) - 1 >= pend) goto end_of_pattern; \ - MBC2WC(c, p); \ - } while(0) - -#define WC2MBC1ST(c) \ - ((current_mbctype != MBCTYPE_UTF8) ? ((c<0x100) ? (c) : (((c)>>8)&0xff)) : utf8_firstbyte(c)) - -typedef unsigned int (*mbc_startpos_func_t) _((const char *string, unsigned int pos)); - -static unsigned int asc_startpos _((const char *string, unsigned int pos)); -static unsigned int euc_startpos _((const char *string, unsigned int pos)); -static unsigned int sjis_startpos _((const char *string, unsigned int pos)); -static unsigned int utf8_startpos _((const char *string, unsigned int pos)); - -static const mbc_startpos_func_t mbc_startpos_func[4] = { - asc_startpos, euc_startpos, sjis_startpos, utf8_startpos -}; - -#define mbc_startpos(start, pos) (*mbc_startpos_func[current_mbctype])((start), (pos)) - -static unsigned int -utf8_firstbyte(c) - unsigned long c; -{ - if (c < 0x80) return c; - if (c <= 0x7ff) return ((c>>6)&0xff)|0xc0; - if (c <= 0xffff) return ((c>>12)&0xff)|0xe0; - if (c <= 0x1fffff) return ((c>>18)&0xff)|0xf0; - if (c <= 0x3ffffff) return ((c>>24)&0xff)|0xf8; - if (c <= 0x7fffffff) return ((c>>30)&0xff)|0xfc; -#if SIZEOF_INT > 4 - if (c <= 0xfffffffff) return 0xfe; -#else - return 0xfe; -#endif -} - -static void -print_mbc(c) - unsigned int c; -{ - if (current_mbctype == MBCTYPE_UTF8) { - if (c < 0x80) - printf("%c", (int)c); - else if (c <= 0x7ff) - printf("%c%c", (int)utf8_firstbyte(c), (int)(c & 0x3f)); - else if (c <= 0xffff) - printf("%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 6) & 0x3f), - (int)(c & 0x3f)); - else if (c <= 0x1fffff) - printf("%c%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 12) & 0x3f), - (int)((c >> 6) & 0x3f), (int)(c & 0x3f)); - else if (c <= 0x3ffffff) - printf("%c%c%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 18) & 0x3f), - (int)((c >> 12) & 0x3f), (int)((c >> 6) & 0x3f), (int)(c & 0x3f)); - else if (c <= 0x7fffffff) - printf("%c%c%c%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 24) & 0x3f), - (int)((c >> 18) & 0x3f), (int)((c >> 12) & 0x3f), - (int)((c >> 6) & 0x3f), (int)(c & 0x3f)); - } - else if (c < 0xff) { - printf("\\%o", (int)c); - } - else { - printf("%c%c", (int)(c >> BYTEWIDTH), (int)(c &0xff)); - } -} - -/* If the buffer isn't allocated when it comes in, use this. */ -#define INIT_BUF_SIZE 28 - -/* Make sure we have at least N more bytes of space in buffer. */ -#define GET_BUFFER_SPACE(n) \ - do { \ - while (b - bufp->buffer + (n) >= bufp->allocated) \ - EXTEND_BUFFER; \ - } while (0) - -/* Make sure we have one more byte of buffer space and then add CH to it. */ -#define BUFPUSH(ch) \ - do { \ - GET_BUFFER_SPACE(1); \ - *b++ = (char)(ch); \ - } while (0) - -/* Extend the buffer by twice its current size via reallociation and - reset the pointers that pointed into the old allocation to point to - the correct places in the new allocation. If extending the buffer - results in it being larger than 1 << 16, then flag memory exhausted. */ -#define EXTEND_BUFFER \ - do { char *old_buffer = bufp->buffer; \ - if (bufp->allocated == (1L<<16)) goto too_big; \ - bufp->allocated *= 2; \ - if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); \ - bufp->buffer = (char*)xrealloc(bufp->buffer, bufp->allocated); \ - if (bufp->buffer == 0) \ - goto memory_exhausted; \ - b = (b - old_buffer) + bufp->buffer; \ - if (fixup_alt_jump) \ - fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; \ - if (laststart) \ - laststart = (laststart - old_buffer) + bufp->buffer; \ - begalt = (begalt - old_buffer) + bufp->buffer; \ - if (pending_exact) \ - pending_exact = (pending_exact - old_buffer) + bufp->buffer; \ - } while (0) - - -/* Set the bit for character C in a character set list. */ -#define SET_LIST_BIT(c) \ - (b[(unsigned char)(c) / BYTEWIDTH] \ - |= 1 << ((unsigned char)(c) % BYTEWIDTH)) - -/* Get the next unsigned number in the uncompiled pattern. */ -#define GET_UNSIGNED_NUMBER(num) \ - do { if (p != pend) { \ - PATFETCH(c); \ - while (ISDIGIT(c)) { \ - if (num < 0) \ - num = 0; \ - num = num * 10 + c - '0'; \ - if (p == pend) \ - break; \ - PATFETCH(c); \ - } \ - } \ - } while (0) - -#define STREQ(s1, s2) ((strcmp(s1, s2) == 0)) - -#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ - -#define IS_CHAR_CLASS(string) \ - (STREQ(string, "alpha") || STREQ(string, "upper") \ - || STREQ(string, "lower") || STREQ(string, "digit") \ - || STREQ(string, "alnum") || STREQ(string, "xdigit") \ - || STREQ(string, "space") || STREQ(string, "print") \ - || STREQ(string, "punct") || STREQ(string, "graph") \ - || STREQ(string, "cntrl") || STREQ(string, "blank")) - -#define STORE_MBC(p, c) \ - do { \ - (p)[0] = (unsigned char)(((c) >>24) & 0xff); \ - (p)[1] = (unsigned char)(((c) >>16) & 0xff); \ - (p)[2] = (unsigned char)(((c) >> 8) & 0xff); \ - (p)[3] = (unsigned char)(((c) >> 0) & 0xff); \ - } while (0) - -#define STORE_MBC_AND_INCR(p, c) \ - do { \ - *(p)++ = (unsigned char)(((c) >>24) & 0xff); \ - *(p)++ = (unsigned char)(((c) >>16) & 0xff); \ - *(p)++ = (unsigned char)(((c) >> 8) & 0xff); \ - *(p)++ = (unsigned char)(((c) >> 0) & 0xff); \ - } while (0) - -#define EXTRACT_MBC(p) \ - ((unsigned int)((unsigned char)(p)[0] << 24 | \ - (unsigned char)(p)[1] << 16 | \ - (unsigned char)(p)[2] << 8 | \ - (unsigned char)(p)[3])) - -#define EXTRACT_MBC_AND_INCR(p) \ - ((unsigned int)((p) += 4, \ - (unsigned char)(p)[-4] << 24 | \ - (unsigned char)(p)[-3] << 16 | \ - (unsigned char)(p)[-2] << 8 | \ - (unsigned char)(p)[-1])) - -#define EXTRACT_UNSIGNED(p) \ - ((unsigned char)(p)[0] | (unsigned char)(p)[1] << 8) -#define EXTRACT_UNSIGNED_AND_INCR(p) \ - ((p) += 2, (unsigned char)(p)[-2] | (unsigned char)(p)[-1] << 8) - -/* Handle (mb)?charset(_not)?. - - Structure of mbcharset(_not)? in compiled pattern. - - struct { - unsinged char id; mbcharset(_not)? - unsigned char sbc_size; - unsigned char sbc_map[sbc_size]; same as charset(_not)? up to here. - unsigned short mbc_size; number of intervals. - struct { - unsigned long beg; beginning of interval. - unsigned long end; end of interval. - } intervals[mbc_size]; - }; */ - -static void -set_list_bits(c1, c2, b) - unsigned long c1, c2; - unsigned char *b; -{ - unsigned char sbc_size = b[-1]; - unsigned short mbc_size = EXTRACT_UNSIGNED(&b[sbc_size]); - unsigned short beg, end, upb; - - if (c1 > c2) - return; - b = &b[sbc_size + 2]; - - for (beg = 0, upb = mbc_size; beg < upb; ) { - unsigned short mid = (unsigned short)(beg + upb) >> 1; - - if ((int)c1 - 1 > (int)EXTRACT_MBC(&b[mid*8+4])) - beg = mid + 1; - else - upb = mid; - } - - for (end = beg, upb = mbc_size; end < upb; ) { - unsigned short mid = (unsigned short)(end + upb) >> 1; - - if ((int)c2 >= (int)EXTRACT_MBC(&b[mid*8]) - 1) - end = mid + 1; - else - upb = mid; - } - - if (beg != end) { - if (c1 > EXTRACT_MBC(&b[beg*8])) - c1 = EXTRACT_MBC(&b[beg*8]); - if (c2 < EXTRACT_MBC(&b[(end - 1)*8+4])) - c2 = EXTRACT_MBC(&b[(end - 1)*8+4]); - } - if (end < mbc_size && end != beg + 1) - /* NOTE: memcpy() would not work here. */ - memmove(&b[(beg + 1)*8], &b[end*8], (mbc_size - end)*8); - STORE_MBC(&b[beg*8 + 0], c1); - STORE_MBC(&b[beg*8 + 4], c2); - mbc_size += beg - end + 1; - STORE_NUMBER(&b[-2], mbc_size); -} - -static int -is_in_list_sbc(c, b) - unsigned long c; - const unsigned char *b; -{ - unsigned short size; - - size = *b++; - return ((int)c / BYTEWIDTH < (int)size && b[c / BYTEWIDTH] & 1 << c % BYTEWIDTH); -} - -static int -is_in_list_mbc(c, b) - unsigned long c; - const unsigned char *b; -{ - unsigned short size; - unsigned short i, j; - - size = *b++; - b += size + 2; - size = EXTRACT_UNSIGNED(&b[-2]); - if (size == 0) return 0; - - for (i = 0, j = size; i < j; ) { - unsigned short k = (unsigned short)(i + j) >> 1; - - if (c > EXTRACT_MBC(&b[k*8+4])) - i = k + 1; - else - j = k; - } - if (i < size && EXTRACT_MBC(&b[i*8]) <= c) - return 1; - - return 0; -} - -static int -is_in_list(c, b) - unsigned long c; - const unsigned char *b; -{ - return is_in_list_sbc(c, b) || (current_mbctype ? is_in_list_mbc(c, b) : 0); -} - -static void -print_partial_compiled_pattern(start, end) - unsigned char *start; - unsigned char *end; -{ - int mcnt, mcnt2; - unsigned char *p = start; - unsigned char *pend = end; - - if (start == NULL) { - printf("(null)\n"); - return; - } - - /* Loop over pattern commands. */ - while (p < pend) { - switch ((enum regexpcode)*p++) { - case unused: - printf("/unused"); - break; - - case exactn: - mcnt = *p++; - printf("/exactn/%d", mcnt); - do { - putchar('/'); - printf("%c", *p++); - } - while (--mcnt); - break; - - case start_memory: - mcnt = *p++; - printf("/start_memory/%d/%d", mcnt, *p++); - break; - - case stop_memory: - mcnt = *p++; - printf("/stop_memory/%d/%d", mcnt, *p++); - break; - - case start_paren: - printf("/start_paren"); - break; - - case stop_paren: - printf("/stop_paren"); - break; - - case casefold_on: - printf("/casefold_on"); - break; - - case casefold_off: - printf("/casefold_off"); - break; - - case option_set: - printf("/option_set/%d", *p++); - break; - - case start_nowidth: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - printf("/start_nowidth//%d", mcnt); - break; - - case stop_nowidth: - printf("/stop_nowidth//"); - p += 2; - break; - - case pop_and_fail: - printf("/pop_and_fail"); - break; - - case stop_backtrack: - printf("/stop_backtrack//"); - p += 2; - break; - - case duplicate: - printf("/duplicate/%d", *p++); - break; - - case anychar: - printf("/anychar"); - break; - - case anychar_repeat: - printf("/anychar_repeat"); - break; - - case charset: - case charset_not: - { - register int c; - - printf("/charset%s", - (enum regexpcode)*(p - 1) == charset_not ? "_not" : ""); - - mcnt = *p++; - printf("/%d", mcnt); - for (c = 0; c < mcnt; c++) { - unsigned bit; - unsigned char map_byte = p[c]; - - putchar('/'); - - for (bit = 0; bit < BYTEWIDTH; bit++) - if (map_byte & (1 << bit)) - printf("%c", c * BYTEWIDTH + bit); - } - p += mcnt; - mcnt = EXTRACT_UNSIGNED_AND_INCR(p); - putchar('/'); - while (mcnt--) { - print_mbc(EXTRACT_MBC_AND_INCR(p)); - putchar('-'); - print_mbc(EXTRACT_MBC_AND_INCR(p)); - } - break; - } - - case begline: - printf("/begline"); - break; - - case endline: - printf("/endline"); - break; - - case on_failure_jump: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - printf("/on_failure_jump//%d", mcnt); - break; - - case dummy_failure_jump: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - printf("/dummy_failure_jump//%d", mcnt); - break; - - case push_dummy_failure: - printf("/push_dummy_failure"); - break; - - case finalize_jump: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - printf("/finalize_jump//%d", mcnt); - break; - - case maybe_finalize_jump: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - printf("/maybe_finalize_jump//%d", mcnt); - break; - - case jump_past_alt: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - printf("/jump_past_alt//%d", mcnt); - break; - - case jump: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - printf("/jump//%d", mcnt); - break; - - case succeed_n: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - EXTRACT_NUMBER_AND_INCR(mcnt2, p); - printf("/succeed_n//%d//%d", mcnt, mcnt2); - break; - - case jump_n: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - EXTRACT_NUMBER_AND_INCR(mcnt2, p); - printf("/jump_n//%d//%d", mcnt, mcnt2); - break; - - case set_number_at: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - EXTRACT_NUMBER_AND_INCR(mcnt2, p); - printf("/set_number_at//%d//%d", mcnt, mcnt2); - break; - - case try_next: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - printf("/try_next//%d", mcnt); - break; - - case finalize_push: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - printf("/finalize_push//%d", mcnt); - break; - - case finalize_push_n: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - EXTRACT_NUMBER_AND_INCR(mcnt2, p); - printf("/finalize_push_n//%d//%d", mcnt, mcnt2); - break; - - case wordbound: - printf("/wordbound"); - break; - - case notwordbound: - printf("/notwordbound"); - break; - - case wordbeg: - printf("/wordbeg"); - break; - - case wordend: - printf("/wordend"); - - case wordchar: - printf("/wordchar"); - break; - - case notwordchar: - printf("/notwordchar"); - break; - - case begbuf: - printf("/begbuf"); - break; - - case endbuf: - printf("/endbuf"); - break; - - case endbuf2: - printf("/endbuf2"); - break; - - case begpos: - printf("/begpos"); - break; - - default: - printf("?%d", *(p-1)); - } - } - printf("/\n"); -} - - -static void -print_compiled_pattern(bufp) - struct re_pattern_buffer *bufp; -{ - unsigned char *buffer = (unsigned char*)bufp->buffer; - - print_partial_compiled_pattern(buffer, buffer + bufp->used); -} - -static char* -calculate_must_string(start, end) - char *start; - char *end; -{ - int mcnt; - int max = 0; - unsigned char *p = (unsigned char *)start; - unsigned char *pend = (unsigned char *)end; - char *must = 0; - - if (start == NULL) return 0; - - /* Loop over pattern commands. */ - while (p < pend) { - switch ((enum regexpcode)*p++) { - case unused: - break; - - case exactn: - mcnt = *p; - if (mcnt > max) { - must = (char *)p; - max = mcnt; - } - p += mcnt+1; - break; - - case start_memory: - case stop_memory: - p += 2; - break; - - case duplicate: - case option_set: - p++; - break; - - case casefold_on: - case casefold_off: - return 0; /* should not check must_string */ - - case pop_and_fail: - case anychar: - case anychar_repeat: - case begline: - case endline: - case wordbound: - case notwordbound: - case wordbeg: - case wordend: - case wordchar: - case notwordchar: - case begbuf: - case endbuf: - case endbuf2: - case begpos: - case push_dummy_failure: - case start_paren: - case stop_paren: - break; - - case charset: - case charset_not: - mcnt = *p++; - p += mcnt; - mcnt = EXTRACT_UNSIGNED_AND_INCR(p); - while (mcnt--) { - p += 8; - } - break; - - case on_failure_jump: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - if (mcnt > 0) p += mcnt; - if ((enum regexpcode)p[-3] == jump) { - p -= 2; - EXTRACT_NUMBER_AND_INCR(mcnt, p); - if (mcnt > 0) p += mcnt; - } - break; - - case dummy_failure_jump: - case succeed_n: - case try_next: - case jump: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - if (mcnt > 0) p += mcnt; - break; - - case start_nowidth: - case stop_nowidth: - case stop_backtrack: - case finalize_jump: - case maybe_finalize_jump: - case finalize_push: - p += 2; - break; - - case jump_n: - case set_number_at: - case finalize_push_n: - p += 4; - break; - - default: - break; - } - } - return must; -} - -static unsigned int -read_backslash(c) - int c; -{ - switch (c) { - case 'n': - return '\n'; - - case 't': - return '\t'; - - case 'r': - return '\r'; - - case 'f': - return '\f'; - - case 'v': - return '\v'; - - case 'a': - return '\007'; - - case 'b': - return '\010'; - - case 'e': - return '\033'; - } - return c; -} - -static unsigned int -read_special(p, pend, pp) - const char *p, *pend, **pp; -{ - int c; - - PATFETCH_RAW(c); - switch (c) { - case 'M': - PATFETCH_RAW(c); - if (c != '-') return -1; - PATFETCH_RAW(c); - *pp = p; - if (c == '\\') { - return read_special(--p, pend, pp) | 0x80; - } - else if (c == -1) return ~0; - else { - return ((c & 0xff) | 0x80); - } - - case 'C': - PATFETCH_RAW(c); - if (c != '-') return ~0; - case 'c': - PATFETCH_RAW(c); - *pp = p; - if (c == '\\') { - c = read_special(--p, pend, pp); - } - else if (c == '?') return 0177; - else if (c == -1) return ~0; - return c & 0x9f; - default: - *pp = p + 1; - return read_backslash(c); - } - - end_of_pattern: - return ~0; -} - -/* re_compile_pattern takes a regular-expression string - and converts it into a buffer full of byte commands for matching. - - PATTERN is the address of the pattern string - SIZE is the length of it. - BUFP is a struct re_pattern_buffer * which points to the info - on where to store the byte commands. - This structure contains a char * which points to the - actual space, which should have been obtained with malloc. - re_compile_pattern may use realloc to grow the buffer space. - - The number of bytes of commands can be found out by looking in - the `struct re_pattern_buffer' that bufp pointed to, after - re_compile_pattern returns. */ - -char * -re_compile_pattern(pattern, size, bufp) - const char *pattern; - int size; - struct re_pattern_buffer *bufp; -{ - register char *b = bufp->buffer; - register const char *p = pattern; - const char *nextp; - const char *pend = pattern + size; - register unsigned int c, c1 = 0; - const char *p0; - int numlen; -#define ERROR_MSG_MAX_SIZE 200 - static char error_msg[ERROR_MSG_MAX_SIZE+1]; - - /* Address of the count-byte of the most recently inserted `exactn' - command. This makes it possible to tell whether a new exact-match - character can be added to that command or requires a new `exactn' - command. */ - - char *pending_exact = 0; - - /* Address of the place where a forward-jump should go to the end of - the containing expression. Each alternative of an `or', except the - last, ends with a forward-jump of this sort. */ - - char *fixup_alt_jump = 0; - - /* Address of start of the most recently finished expression. - This tells postfix * where to find the start of its operand. */ - - char *laststart = 0; - - /* In processing a repeat, 1 means zero matches is allowed. */ - - char zero_times_ok; - - /* In processing a repeat, 1 means many matches is allowed. */ - - char many_times_ok; - - /* In processing a repeat, 1 means non-greedy matches. */ - - char greedy; - - /* Address of beginning of regexp, or inside of last (. */ - - char *begalt = b; - - /* Place in the uncompiled pattern (i.e., the {) to - which to go back if the interval is invalid. */ - const char *beg_interval; - - /* In processing an interval, at least this many matches must be made. */ - int lower_bound; - - /* In processing an interval, at most this many matches can be made. */ - int upper_bound; - - /* Stack of information saved by ( and restored by ). - Five stack elements are pushed by each (: - First, the value of b. - Second, the value of fixup_alt_jump. - Third, the value of begalt. - Fourth, the value of regnum. - Fifth, the type of the paren. */ - - int stacka[40]; - int *stackb = stacka; - int *stackp = stackb; - int *stacke = stackb + 40; - - /* Counts ('s as they are encountered. Remembered for the matching ), - where it becomes the register number to put in the stop_memory - command. */ - - int regnum = 1; - - int range = 0; - int had_mbchar = 0; - int had_num_literal = 0; - int had_char_class = 0; - - int options = bufp->options; - - bufp->fastmap_accurate = 0; - bufp->must = 0; - bufp->must_skip = 0; - - /* Initialize the syntax table. */ - init_syntax_once(); - - if (bufp->allocated == 0) { - bufp->allocated = INIT_BUF_SIZE; - /* EXTEND_BUFFER loses when bufp->allocated is 0. */ - bufp->buffer = (char*)xrealloc(bufp->buffer, INIT_BUF_SIZE); - if (!bufp->buffer) goto memory_exhausted; /* this not happen */ - begalt = b = bufp->buffer; - } - - while (p != pend) { - PATFETCH(c); - - switch (c) { - case '$': - if (bufp->options & RE_OPTION_SINGLELINE) { - BUFPUSH(endbuf); - } - else { - p0 = p; - /* When testing what follows the $, - look past the \-constructs that don't consume anything. */ - - while (p0 != pend) { - if (*p0 == '\\' && p0 + 1 != pend - && (p0[1] == 'b' || p0[1] == 'B')) - p0 += 2; - else - break; - } - BUFPUSH(endline); - } - break; - - case '^': - if (bufp->options & RE_OPTION_SINGLELINE) - BUFPUSH(begbuf); - else - BUFPUSH(begline); - break; - - case '+': - case '?': - case '*': - /* If there is no previous pattern, char not special. */ - if (!laststart) { - snprintf(error_msg, ERROR_MSG_MAX_SIZE, - "invalid regular expression; there's no previous pattern, to which '%c' would define cardinality at %d", - c, p-pattern); - FREE_AND_RETURN(stackb, error_msg); - } - /* If there is a sequence of repetition chars, - collapse it down to just one. */ - zero_times_ok = c != '+'; - many_times_ok = c != '?'; - greedy = 1; - if (p != pend) { - PATFETCH(c); - switch (c) { - case '?': - greedy = 0; - break; - case '*': - case '+': - goto nested_meta; - default: - PATUNFETCH; - break; - } - } - - repeat: - /* Star, etc. applied to an empty pattern is equivalent - to an empty pattern. */ - if (!laststart) - break; - - if (greedy && many_times_ok && *laststart == anychar && b - laststart <= 2) { - if (b[-1] == stop_paren) - b--; - if (zero_times_ok) - *laststart = anychar_repeat; - else { - BUFPUSH(anychar_repeat); - } - break; - } - /* Now we know whether or not zero matches is allowed - and also whether or not two or more matches is allowed. */ - if (many_times_ok) { - /* If more than one repetition is allowed, put in at the - end a backward relative jump from b to before the next - jump we're going to put in below (which jumps from - laststart to after this jump). */ - GET_BUFFER_SPACE(3); - store_jump(b,greedy?maybe_finalize_jump:finalize_push,laststart-3); - b += 3; /* Because store_jump put stuff here. */ - } - - /* On failure, jump from laststart to next pattern, which will be the - end of the buffer after this jump is inserted. */ - GET_BUFFER_SPACE(3); - insert_jump(on_failure_jump, laststart, b + 3, b); - b += 3; - - if (zero_times_ok) { - if (greedy == 0) { - GET_BUFFER_SPACE(3); - insert_jump(try_next, laststart, b + 3, b); - b += 3; - } - } - else { - /* At least one repetition is required, so insert a - `dummy_failure_jump' before the initial - `on_failure_jump' instruction of the loop. This - effects a skip over that instruction the first time - we hit that loop. */ - GET_BUFFER_SPACE(3); - insert_jump(dummy_failure_jump, laststart, laststart + 6, b); - b += 3; - } - break; - - case '.': - laststart = b; - BUFPUSH(anychar); - break; - - case '[': - if (p == pend) - FREE_AND_RETURN(stackb, "invalid regular expression; '[' can't be the last character ie. can't start range at the end of pattern"); - while ((b - bufp->buffer + 9 + (1 << BYTEWIDTH) / BYTEWIDTH) - > bufp->allocated) - EXTEND_BUFFER; - - laststart = b; - if (*p == '^') { - BUFPUSH(charset_not); - p++; - } - else - BUFPUSH(charset); - p0 = p; - - BUFPUSH((1 << BYTEWIDTH) / BYTEWIDTH); - /* Clear the whole map */ - memset(b, 0, (1 << BYTEWIDTH) / BYTEWIDTH + 2); - - had_mbchar = 0; - had_num_literal = 0; - had_char_class = 0; - - /* Read in characters and ranges, setting map bits. */ - for (;;) { - int size; - unsigned last = (unsigned)-1; - - if ((size = EXTRACT_UNSIGNED(&b[(1 << BYTEWIDTH) / BYTEWIDTH])) || current_mbctype) { - /* Ensure the space is enough to hold another interval - of multi-byte chars in charset(_not)?. */ - size = (1 << BYTEWIDTH) / BYTEWIDTH + 2 + size*8 + 8; - while (b + size + 1 > bufp->buffer + bufp->allocated) - EXTEND_BUFFER; - } - range_retry: - if (range && had_char_class) { - FREE_AND_RETURN(stackb, "invalid regular expression; can't use character class as an end value of range"); - } - PATFETCH_RAW(c); - - if (c == ']') { - if (p == p0 + 1) { - if (p == pend) - FREE_AND_RETURN(stackb, "invalid regular expression; empty character class"); - re_warning("character class has `]' without escape"); - } - else - /* Stop if this isn't merely a ] inside a bracket - expression, but rather the end of a bracket - expression. */ - break; - } - /* Look ahead to see if it's a range when the last thing - was a character class. */ - if (had_char_class && c == '-' && *p != ']') - FREE_AND_RETURN(stackb, "invalid regular expression; can't use character class as a start value of range"); - if (ismbchar(c)) { - PATFETCH_MBC(c); - had_mbchar++; - } - had_char_class = 0; - - if (c == '-' && ((p != p0 + 1 && *p != ']') || - (p[0] == '-' && p[1] != ']') || - range)) - re_warning("character class has `-' without escape"); - if (c == '[' && *p != ':') - re_warning("character class has `[' without escape"); - - /* \ escapes characters when inside [...]. */ - if (c == '\\') { - PATFETCH_RAW(c); - switch (c) { - case 'w': - for (c = 0; c < (1 << BYTEWIDTH); c++) { - if (SYNTAX(c) == Sword || - (!current_mbctype && SYNTAX(c) == Sword2)) - SET_LIST_BIT(c); - } - if (current_mbctype) { - set_list_bits(0x80, 0xffffffff, b); - } - had_char_class = 1; - last = -1; - continue; - - case 'W': - for (c = 0; c < (1 << BYTEWIDTH); c++) { - if (SYNTAX(c) != Sword && - ((current_mbctype && !re_mbctab[c]) || - (!current_mbctype && SYNTAX(c) != Sword2))) - SET_LIST_BIT(c); - } - had_char_class = 1; - last = -1; - continue; - - case 's': - for (c = 0; c < 256; c++) - if (ISSPACE(c)) - SET_LIST_BIT(c); - had_char_class = 1; - last = -1; - continue; - - case 'S': - for (c = 0; c < 256; c++) - if (!ISSPACE(c)) - SET_LIST_BIT(c); - if (current_mbctype) - set_list_bits(0x80, 0xffffffff, b); - had_char_class = 1; - last = -1; - continue; - - case 'd': - for (c = '0'; c <= '9'; c++) - SET_LIST_BIT(c); - had_char_class = 1; - last = -1; - continue; - - case 'D': - for (c = 0; c < 256; c++) - if (!ISDIGIT(c)) - SET_LIST_BIT(c); - if (current_mbctype) - set_list_bits(0x80, 0xffffffff, b); - had_char_class = 1; - last = -1; - continue; - - case 'x': - c = scan_hex(p, 2, &numlen); - if (numlen == 0) goto invalid_escape; - p += numlen; - had_num_literal = 1; - break; - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - PATUNFETCH; - c = scan_oct(p, 3, &numlen); - p += numlen; - had_num_literal = 1; - break; - - case 'M': - case 'C': - case 'c': - { - const char *pp; - - --p; - c = read_special(p, pend, &pp); - if (c > 255) goto invalid_escape; - p = pp; - had_num_literal = 1; - } - break; - - default: - c = read_backslash(c); - if (ismbchar(c)) { - PATFETCH_MBC(c); - had_mbchar++; - } - break; - } - } - else if (c == '[' && *p == ':') { /* [:...:] */ - /* Leave room for the null. */ - char str[CHAR_CLASS_MAX_LENGTH + 1]; - - PATFETCH_RAW(c); - c1 = 0; - - /* If pattern is `[[:'. */ - if (p == pend) - FREE_AND_RETURN(stackb, "invalid regular expression; re can't end '[[:'"); - - for (;;) { - PATFETCH_RAW(c); - if (c == ':' || c == ']' || p == pend - || c1 == CHAR_CLASS_MAX_LENGTH) - break; - str[c1++] = c; - } - str[c1] = '\0'; - - /* If isn't a word bracketed by `[:' and `:]': - undo the ending character, the letters, and - the leading `:' and `['. */ - if (c == ':' && *p == ']') { - int ch; - char is_alnum = STREQ(str, "alnum"); - char is_alpha = STREQ(str, "alpha"); - char is_blank = STREQ(str, "blank"); - char is_cntrl = STREQ(str, "cntrl"); - char is_digit = STREQ(str, "digit"); - char is_graph = STREQ(str, "graph"); - char is_lower = STREQ(str, "lower"); - char is_print = STREQ(str, "print"); - char is_punct = STREQ(str, "punct"); - char is_space = STREQ(str, "space"); - char is_upper = STREQ(str, "upper"); - char is_xdigit = STREQ(str, "xdigit"); - - if (!IS_CHAR_CLASS(str)){ - snprintf(error_msg, ERROR_MSG_MAX_SIZE, - "invalid regular expression; [:%s:] is not a character class", str); - FREE_AND_RETURN(stackb, error_msg); - } - - /* Throw away the ] at the end of the character class. */ - PATFETCH(c); - - if (p == pend) - FREE_AND_RETURN(stackb, "invalid regular expression; range doesn't have ending ']' after a character class"); - - for (ch = 0; ch < 1 << BYTEWIDTH; ch++) { - if ( (is_alnum && ISALNUM(ch)) - || (is_alpha && ISALPHA(ch)) - || (is_blank && ISBLANK(ch)) - || (is_cntrl && ISCNTRL(ch)) - || (is_digit && ISDIGIT(ch)) - || (is_graph && ISGRAPH(ch)) - || (is_lower && ISLOWER(ch)) - || (is_print && ISPRINT(ch)) - || (is_punct && ISPUNCT(ch)) - || (is_space && ISSPACE(ch)) - || (is_upper && ISUPPER(ch)) - || (is_xdigit && ISXDIGIT(ch))) - SET_LIST_BIT(ch); - } - had_char_class = 1; - continue; - } - else { - c1 += 2; - while (c1--) - PATUNFETCH; - re_warning("character class has `[' without escape"); - c = '['; - } - } - - /* Get a range. */ - if (range) { - if (last > c) - goto invalid_pattern; - - range = 0; - if (had_mbchar == 0) { - if (TRANSLATE_P()) { - for (;last<=c;last++) - SET_LIST_BIT(translate[last]); - } - else { - for (;last<=c;last++) - SET_LIST_BIT(last); - } - } - else if (had_mbchar == 2) { - set_list_bits(last, c, b); - } - else { - /* restriction: range between sbc and mbc */ - goto invalid_pattern; - } - } - else if (p[0] == '-' && p[1] != ']') { - last = c; - PATFETCH_RAW(c1); - range = 1; - goto range_retry; - } - else { - if (TRANSLATE_P() && c < 0x100) c = (unsigned char)translate[c]; - if (had_mbchar == 0 && (!current_mbctype || !had_num_literal)) { - SET_LIST_BIT(c); - had_num_literal = 0; - } - else { - set_list_bits(c, c, b); - } - } - had_mbchar = 0; - } - - /* Discard any character set/class bitmap bytes that are all - 0 at the end of the map. Decrement the map-length byte too. */ - while ((int)b[-1] > 0 && b[b[-1] - 1] == 0) - b[-1]--; - if (b[-1] != (1 << BYTEWIDTH) / BYTEWIDTH) - memmove(&b[(unsigned char)b[-1]], &b[(1 << BYTEWIDTH) / BYTEWIDTH], - 2 + EXTRACT_UNSIGNED(&b[(1 << BYTEWIDTH) / BYTEWIDTH])*8); - b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[(unsigned char)b[-1]])*8; - had_num_literal = 0; - break; - - case '(': - { - int old_options = options; - int push_option = 0; - int casefold = 0; - - PATFETCH(c); - if (c == '?') { - int negative = 0; - - PATFETCH_RAW(c); - switch (c) { - case 'x': case 'm': case 'i': case '-': - for (;;) { - switch (c) { - case '-': - negative = 1; - break; - - case ':': - case ')': - break; - - case 'x': - if (negative) - options &= ~RE_OPTION_EXTENDED; - else - options |= RE_OPTION_EXTENDED; - break; - - case 'm': - if (negative) { - if (options&RE_OPTION_MULTILINE) { - options &= ~RE_OPTION_MULTILINE; - } - } - else if (!(options&RE_OPTION_MULTILINE)) { - options |= RE_OPTION_MULTILINE; - } - push_option = 1; - break; - - case 'i': - if (negative) { - if (options&RE_OPTION_IGNORECASE) { - options &= ~RE_OPTION_IGNORECASE; - } - } - else if (!(options&RE_OPTION_IGNORECASE)) { - options |= RE_OPTION_IGNORECASE; - } - casefold = 1; - break; - - default: - FREE_AND_RETURN(stackb, "undefined (?...) inline option"); - } - if (c == ')') { - c = '#'; /* read whole in-line options */ - break; - } - if (c == ':') break; - PATFETCH_RAW(c); - } - break; - - case '#': - for (;;) { - PATFETCH(c); - if (c == ')') break; - } - c = '#'; - break; - - case ':': - case '=': - case '!': - case '>': - break; - - default: - FREE_AND_RETURN(stackb, "undefined (?...) sequence"); - } - } - else { - PATUNFETCH; - c = '('; - } - if (c == '#') { - if (push_option) { - BUFPUSH(option_set); - BUFPUSH(options); - } - if (casefold) { - if (options & RE_OPTION_IGNORECASE) - BUFPUSH(casefold_on); - else - BUFPUSH(casefold_off); - } - break; - } - if (stackp+8 >= stacke) { - DOUBLE_STACK(int); - } - - /* Laststart should point to the start_memory that we are about - to push (unless the pattern has RE_NREGS or more ('s). */ - /* obsolete: now RE_NREGS is just a default register size. */ - *stackp++ = b - bufp->buffer; - *stackp++ = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; - *stackp++ = begalt - bufp->buffer; - switch (c) { - case '(': - BUFPUSH(start_memory); - BUFPUSH(regnum); - *stackp++ = regnum++; - *stackp++ = b - bufp->buffer; - BUFPUSH(0); - /* too many ()'s to fit in a byte. (max 254) */ - if (regnum >= RE_REG_MAX) goto too_big; - break; - - case '=': - case '!': - case '>': - BUFPUSH(start_nowidth); - *stackp++ = b - bufp->buffer; - BUFPUSH(0); /* temporary value */ - BUFPUSH(0); - if (c != '!') break; - - BUFPUSH(on_failure_jump); - *stackp++ = b - bufp->buffer; - BUFPUSH(0); /* temporary value */ - BUFPUSH(0); - break; - - case ':': - BUFPUSH(start_paren); - pending_exact = 0; - default: - break; - } - if (push_option) { - BUFPUSH(option_set); - BUFPUSH(options); - } - if (casefold) { - if (options & RE_OPTION_IGNORECASE) - BUFPUSH(casefold_on); - else - BUFPUSH(casefold_off); - } - *stackp++ = c; - *stackp++ = old_options; - fixup_alt_jump = 0; - laststart = 0; - begalt = b; - } - break; - - case ')': - if (stackp == stackb) - FREE_AND_RETURN(stackb, "unmatched )"); - - pending_exact = 0; - if (fixup_alt_jump) { - /* Push a dummy failure point at the end of the - alternative for a possible future - `finalize_jump' to pop. See comments at - `push_dummy_failure' in `re_match'. */ - BUFPUSH(push_dummy_failure); - - /* We allocated space for this jump when we assigned - to `fixup_alt_jump', in the `handle_alt' case below. */ - store_jump(fixup_alt_jump, jump, b); - } - if (options != stackp[-1]) { - if ((options ^ stackp[-1]) & RE_OPTION_IGNORECASE) { - BUFPUSH((options&RE_OPTION_IGNORECASE)?casefold_off:casefold_on); - } - if ((options ^ stackp[-1]) != RE_OPTION_IGNORECASE) { - BUFPUSH(option_set); - BUFPUSH(stackp[-1]); - } - } - p0 = b; - options = *--stackp; - switch (c = *--stackp) { - case '(': - { - char *loc = bufp->buffer + *--stackp; - *loc = regnum - stackp[-1]; - BUFPUSH(stop_memory); - BUFPUSH(stackp[-1]); - BUFPUSH(regnum - stackp[-1]); - stackp--; - } - break; - - case '!': - BUFPUSH(pop_and_fail); - /* back patch */ - STORE_NUMBER(bufp->buffer+stackp[-1], b - bufp->buffer - stackp[-1] - 2); - stackp--; - /* fall through */ - case '=': - BUFPUSH(stop_nowidth); - /* tell stack-pos place to start_nowidth */ - STORE_NUMBER(bufp->buffer+stackp[-1], b - bufp->buffer - stackp[-1] - 2); - BUFPUSH(0); /* space to hold stack pos */ - BUFPUSH(0); - stackp--; - break; - - case '>': - BUFPUSH(stop_backtrack); - /* tell stack-pos place to start_nowidth */ - STORE_NUMBER(bufp->buffer+stackp[-1], b - bufp->buffer - stackp[-1] - 2); - BUFPUSH(0); /* space to hold stack pos */ - BUFPUSH(0); - stackp--; - break; - - case ':': - BUFPUSH(stop_paren); - break; - - default: - break; - } - begalt = *--stackp + bufp->buffer; - stackp--; - fixup_alt_jump = *stackp ? *stackp + bufp->buffer - 1 : 0; - laststart = *--stackp + bufp->buffer; - if (c == '!' || c == '=') laststart = b; - break; - - case '|': - /* Insert before the previous alternative a jump which - jumps to this alternative if the former fails. */ - GET_BUFFER_SPACE(3); - insert_jump(on_failure_jump, begalt, b + 6, b); - pending_exact = 0; - b += 3; - /* The alternative before this one has a jump after it - which gets executed if it gets matched. Adjust that - jump so it will jump to this alternative's analogous - jump (put in below, which in turn will jump to the next - (if any) alternative's such jump, etc.). The last such - jump jumps to the correct final destination. A picture: - _____ _____ - | | | | - | v | v - a | b | c - - If we are at `b', then fixup_alt_jump right now points to a - three-byte space after `a'. We'll put in the jump, set - fixup_alt_jump to right after `b', and leave behind three - bytes which we'll fill in when we get to after `c'. */ - - if (fixup_alt_jump) - store_jump(fixup_alt_jump, jump_past_alt, b); - - /* Mark and leave space for a jump after this alternative, - to be filled in later either by next alternative or - when know we're at the end of a series of alternatives. */ - fixup_alt_jump = b; - GET_BUFFER_SPACE(3); - b += 3; - - laststart = 0; - begalt = b; - break; - - case '{': - /* If there is no previous pattern, this is an invalid pattern. */ - if (!laststart) { - snprintf(error_msg, ERROR_MSG_MAX_SIZE, - "invalid regular expression; there's no previous pattern, to which '{' would define cardinality at %d", - p-pattern); - FREE_AND_RETURN(stackb, error_msg); - } - if( p == pend) - FREE_AND_RETURN(stackb, "invalid regular expression; '{' can't be last character" ); - - beg_interval = p - 1; - - lower_bound = -1; /* So can see if are set. */ - upper_bound = -1; - GET_UNSIGNED_NUMBER(lower_bound); - if (c == ',') { - GET_UNSIGNED_NUMBER(upper_bound); - } - else - /* Interval such as `{1}' => match exactly once. */ - upper_bound = lower_bound; - - if (lower_bound < 0 || c != '}') - goto unfetch_interval; - - if (lower_bound >= RE_DUP_MAX || upper_bound >= RE_DUP_MAX) - FREE_AND_RETURN(stackb, "too big quantifier in {,}"); - if (upper_bound < 0) upper_bound = RE_DUP_MAX; - if (lower_bound > upper_bound) - FREE_AND_RETURN(stackb, "can't do {n,m} with n > m"); - - beg_interval = 0; - pending_exact = 0; - - greedy = 1; - if (p != pend) { - PATFETCH(c); - if (c == '?') greedy = 0; - else PATUNFETCH; - } - - if (lower_bound == 0) { - zero_times_ok = 1; - if (upper_bound == RE_DUP_MAX) { - many_times_ok = 1; - goto repeat; - } - if (upper_bound == 1) { - many_times_ok = 0; - goto repeat; - } - } - if (lower_bound == 1) { - if (upper_bound == 1) { - /* No need to repeat */ - break; - } - if (upper_bound == RE_DUP_MAX) { - many_times_ok = 1; - zero_times_ok = 0; - goto repeat; - } - } - - /* If upper_bound is zero, don't want to succeed at all; - jump from laststart to b + 3, which will be the end of - the buffer after this jump is inserted. */ - - if (upper_bound == 0) { - GET_BUFFER_SPACE(3); - insert_jump(jump, laststart, b + 3, b); - b += 3; - break; - } - - /* If lower_bound == upper_bound, repeat count can be removed */ - if (lower_bound == upper_bound) { - int mcnt; - int skip_stop_paren = 0; - - if (b[-1] == stop_paren) { - skip_stop_paren = 1; - b--; - } - - if (*laststart == exactn && laststart[1]+2 == b - laststart - && laststart[1]*lower_bound < 256) { - mcnt = laststart[1]; - GET_BUFFER_SPACE((lower_bound-1)*mcnt); - laststart[1] = lower_bound*mcnt; - while (--lower_bound) { - memcpy(b, laststart+2, mcnt); - b += mcnt; - } - if (skip_stop_paren) BUFPUSH(stop_paren); - break; - } - - if (lower_bound < 5 && b - laststart < 10) { - /* 5 and 10 are the magic numbers */ - - mcnt = b - laststart; - GET_BUFFER_SPACE((lower_bound-1)*mcnt); - while (--lower_bound) { - memcpy(b, laststart, mcnt); - b += mcnt; - } - if (skip_stop_paren) BUFPUSH(stop_paren); - break; - } - if (skip_stop_paren) b++; /* push back stop_paren */ - } - - /* Otherwise, we have a nontrivial interval. When - we're all done, the pattern will look like: - set_number_at - set_number_at - succeed_n - - jump_n - (The upper bound and `jump_n' are omitted if - `upper_bound' is 1, though.) */ - { /* If the upper bound is > 1, we need to insert - more at the end of the loop. */ - unsigned nbytes = upper_bound == 1 ? 10 : 20; - - GET_BUFFER_SPACE(nbytes); - /* Initialize lower bound of the `succeed_n', even - though it will be set during matching by its - attendant `set_number_at' (inserted next), - because `re_compile_fastmap' needs to know. - Jump to the `jump_n' we might insert below. */ - insert_jump_n(succeed_n, laststart, b + (nbytes/2), - b, lower_bound); - b += 5; /* Just increment for the succeed_n here. */ - - /* Code to initialize the lower bound. Insert - before the `succeed_n'. The `5' is the last two - bytes of this `set_number_at', plus 3 bytes of - the following `succeed_n'. */ - insert_op_2(set_number_at, laststart, b, 5, lower_bound); - b += 5; - - if (upper_bound > 1) { - /* More than one repetition is allowed, so - append a backward jump to the `succeed_n' - that starts this interval. - - When we've reached this during matching, - we'll have matched the interval once, so - jump back only `upper_bound - 1' times. */ - GET_BUFFER_SPACE(5); - store_jump_n(b, greedy?jump_n:finalize_push_n, laststart + 5, - upper_bound - 1); - b += 5; - - /* The location we want to set is the second - parameter of the `jump_n'; that is `b-2' as - an absolute address. `laststart' will be - the `set_number_at' we're about to insert; - `laststart+3' the number to set, the source - for the relative address. But we are - inserting into the middle of the pattern -- - so everything is getting moved up by 5. - Conclusion: (b - 2) - (laststart + 3) + 5, - i.e., b - laststart. - - We insert this at the beginning of the loop - so that if we fail during matching, we'll - reinitialize the bounds. */ - insert_op_2(set_number_at, laststart, b, b - laststart, - upper_bound - 1); - b += 5; - } - } - break; - - unfetch_interval: - /* If an invalid interval, match the characters as literals. */ - re_warning("regexp has invalid interval"); - p = beg_interval; - beg_interval = 0; - - /* normal_char and normal_backslash need `c'. */ - PATFETCH(c); - goto normal_char; - - case '\\': - if (p == pend) - FREE_AND_RETURN(stackb, "invalid regular expression; '\\' can't be last character"); - /* Do not translate the character after the \, so that we can - distinguish, e.g., \B from \b, even if we normally would - translate, e.g., B to b. */ - PATFETCH_RAW(c); - switch (c) { - case 's': - case 'S': - case 'd': - case 'D': - while (b - bufp->buffer + 9 + (1 << BYTEWIDTH) / BYTEWIDTH - > bufp->allocated) - EXTEND_BUFFER; - - laststart = b; - if (c == 's' || c == 'd') { - BUFPUSH(charset); - } - else { - BUFPUSH(charset_not); - } - - BUFPUSH((1 << BYTEWIDTH) / BYTEWIDTH); - memset(b, 0, (1 << BYTEWIDTH) / BYTEWIDTH + 2); - if (c == 's' || c == 'S') { - SET_LIST_BIT(' '); - SET_LIST_BIT('\t'); - SET_LIST_BIT('\n'); - SET_LIST_BIT('\r'); - SET_LIST_BIT('\f'); - } - else { - char cc; - - for (cc = '0'; cc <= '9'; cc++) { - SET_LIST_BIT(cc); - } - } - - while ((int)b[-1] > 0 && b[b[-1] - 1] == 0) - b[-1]--; - if (b[-1] != (1 << BYTEWIDTH) / BYTEWIDTH) - memmove(&b[(unsigned char)b[-1]], &b[(1 << BYTEWIDTH) / BYTEWIDTH], - 2 + EXTRACT_UNSIGNED(&b[(1 << BYTEWIDTH) / BYTEWIDTH])*8); - b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[(unsigned char)b[-1]])*8; - break; - - case 'w': - laststart = b; - BUFPUSH(wordchar); - break; - - case 'W': - laststart = b; - BUFPUSH(notwordchar); - break; - -#ifndef RUBY - case '<': - BUFPUSH(wordbeg); - break; - - case '>': - BUFPUSH(wordend); - break; -#endif - - case 'b': - BUFPUSH(wordbound); - break; - - case 'B': - BUFPUSH(notwordbound); - break; - - case 'A': - BUFPUSH(begbuf); - break; - - case 'Z': - if ((bufp->options & RE_OPTION_SINGLELINE) == 0) { - BUFPUSH(endbuf2); - break; - } - /* fall through */ - case 'z': - BUFPUSH(endbuf); - break; - - case 'G': - BUFPUSH(begpos); - break; - - /* hex */ - case 'x': - had_mbchar = 0; - c = scan_hex(p, 2, &numlen); - if (numlen == 0) goto invalid_escape; - p += numlen; - had_num_literal = 1; - goto numeric_char; - - /* octal */ - case '0': - had_mbchar = 0; - c = scan_oct(p, 2, &numlen); - p += numlen; - had_num_literal = 1; - goto numeric_char; - - /* back-ref or octal */ - case '1': case '2': case '3': - case '4': case '5': case '6': - case '7': case '8': case '9': - PATUNFETCH; - p0 = p; - - had_mbchar = 0; - c1 = 0; - GET_UNSIGNED_NUMBER(c1); - if (!ISDIGIT(c)) PATUNFETCH; - - if (9 < c1 && c1 >= regnum) { - /* need to get octal */ - c = scan_oct(p0, 3, &numlen) & 0xff; - p = p0 + numlen; - c1 = 0; - had_num_literal = 1; - goto numeric_char; - } - - laststart = b; - BUFPUSH(duplicate); - BUFPUSH(c1); - break; - - case 'M': - case 'C': - case 'c': - p0 = --p; - c = read_special(p, pend, &p0); - if (c > 255) goto invalid_escape; - p = p0; - had_num_literal = 1; - goto numeric_char; - - default: - c = read_backslash(c); - goto normal_char; - } - break; - - case '#': - if (options & RE_OPTION_EXTENDED) { - while (p != pend) { - PATFETCH(c); - if (c == '\n') break; - } - break; - } - goto normal_char; - - case ' ': - case '\t': - case '\f': - case '\r': - case '\n': - if (options & RE_OPTION_EXTENDED) - break; - - default: - if (c == ']') - re_warning("regexp has `]' without escape"); - else if (c == '}') - re_warning("regexp has `}' without escape"); - normal_char: /* Expects the character in `c'. */ - had_mbchar = 0; - if (ismbchar(c)) { - had_mbchar = 1; - c1 = p - pattern; - } - numeric_char: - nextp = p + mbclen(c) - 1; - if (!pending_exact || pending_exact + *pending_exact + 1 != b - || *pending_exact >= (c1 ? 0176 : 0177) - || (nextp < pend && - ( *nextp == '+' || *nextp == '?' - || *nextp == '*' || *nextp == '^' - || *nextp == '{'))) { - laststart = b; - BUFPUSH(exactn); - pending_exact = b; - BUFPUSH(0); - } - if (had_num_literal || c == 0xff) { - BUFPUSH(0xff); - (*pending_exact)++; - had_num_literal = 0; - } - BUFPUSH(c); - (*pending_exact)++; - if (had_mbchar) { - int len = mbclen(c) - 1; - while (len--) { - PATFETCH_RAW(c); - BUFPUSH(c); - (*pending_exact)++; - } - } - } - } - - if (fixup_alt_jump) - store_jump(fixup_alt_jump, jump, b); - - if (stackp != stackb) - FREE_AND_RETURN(stackb, "unmatched ("); - - /* set optimize flags */ - laststart = bufp->buffer; - if (laststart != b) { - if (*laststart == dummy_failure_jump) laststart += 3; - else if (*laststart == try_next) laststart += 3; - if (*laststart == anychar_repeat) { - bufp->options |= RE_OPTIMIZE_ANCHOR; - } - } - - bufp->used = b - bufp->buffer; - bufp->re_nsub = regnum; - laststart = bufp->buffer; - if (laststart != b) { - if (*laststart == start_memory) laststart += 3; - if (*laststart == exactn) { - bufp->options |= RE_OPTIMIZE_EXACTN; - bufp->must = laststart+1; - } - } - if (!bufp->must) { - bufp->must = calculate_must_string(bufp->buffer, b); - } - if (current_mbctype == MBCTYPE_SJIS) bufp->options |= RE_OPTIMIZE_NO_BM; - else if (bufp->must) { - int i; - int len = (unsigned char)bufp->must[0]; - - for (i=1; imust[i] == 0xff || - (current_mbctype && ismbchar(bufp->must[i]))) { - bufp->options |= RE_OPTIMIZE_NO_BM; - break; - } - } - if (!(bufp->options & RE_OPTIMIZE_NO_BM)) { - bufp->must_skip = (int *) xmalloc((1 << BYTEWIDTH)*sizeof(int)); - bm_init_skip(bufp->must_skip, (unsigned char*)bufp->must+1, - (unsigned char)bufp->must[0], - (unsigned char*)(MAY_TRANSLATE()?translate:0)); - } - } - - bufp->regstart = TMALLOC(regnum, unsigned char*); - bufp->regend = TMALLOC(regnum, unsigned char*); - bufp->old_regstart = TMALLOC(regnum, unsigned char*); - bufp->old_regend = TMALLOC(regnum, unsigned char*); - bufp->reg_info = TMALLOC(regnum, register_info_type); - bufp->best_regstart = TMALLOC(regnum, unsigned char*); - bufp->best_regend = TMALLOC(regnum, unsigned char*); - FREE_AND_RETURN(stackb, 0); - - invalid_pattern: - FREE_AND_RETURN(stackb, "invalid regular expression"); - - end_of_pattern: - FREE_AND_RETURN(stackb, "premature end of regular expression"); - - too_big: - FREE_AND_RETURN(stackb, "regular expression too big"); - - memory_exhausted: - FREE_AND_RETURN(stackb, "memory exhausted"); - - nested_meta: - FREE_AND_RETURN(stackb, "nested *?+ in regexp"); - - invalid_escape: - FREE_AND_RETURN(stackb, "Invalid escape character syntax"); -} - -void -re_free_pattern(bufp) - struct re_pattern_buffer *bufp; -{ - xfree(bufp->buffer); - xfree(bufp->fastmap); - if (bufp->must_skip) xfree(bufp->must_skip); - - xfree(bufp->regstart); - xfree(bufp->regend); - xfree(bufp->old_regstart); - xfree(bufp->old_regend); - xfree(bufp->best_regstart); - xfree(bufp->best_regend); - xfree(bufp->reg_info); - xfree(bufp); -} - -/* Store a jump of the form . - Store in the location FROM a jump operation to jump to relative - address FROM - TO. OPCODE is the opcode to store. */ - -static void -store_jump(from, opcode, to) - char *from, *to; - int opcode; -{ - from[0] = (char)opcode; - STORE_NUMBER(from + 1, to - (from + 3)); -} - - -/* Open up space before char FROM, and insert there a jump to TO. - CURRENT_END gives the end of the storage not in use, so we know - how much data to copy up. OP is the opcode of the jump to insert. - - If you call this function, you must zero out pending_exact. */ - -static void -insert_jump(op, from, to, current_end) - int op; - char *from, *to, *current_end; -{ - register char *pfrom = current_end; /* Copy from here... */ - register char *pto = current_end + 3; /* ...to here. */ - - while (pfrom != from) - *--pto = *--pfrom; - store_jump(from, op, to); -} - - -/* Store a jump of the form . - - Store in the location FROM a jump operation to jump to relative - address FROM - TO. OPCODE is the opcode to store, N is a number the - jump uses, say, to decide how many times to jump. - - If you call this function, you must zero out pending_exact. */ - -static void -store_jump_n(from, opcode, to, n) - char *from, *to; - int opcode; - unsigned n; -{ - from[0] = (char)opcode; - STORE_NUMBER(from + 1, to - (from + 3)); - STORE_NUMBER(from + 3, n); -} - - -/* Similar to insert_jump, but handles a jump which needs an extra - number to handle minimum and maximum cases. Open up space at - location FROM, and insert there a jump to TO. CURRENT_END gives the - end of the storage in use, so we know how much data to copy up. OP is - the opcode of the jump to insert. - - If you call this function, you must zero out pending_exact. */ - -static void -insert_jump_n(op, from, to, current_end, n) - int op; - char *from, *to, *current_end; - unsigned n; -{ - register char *pfrom = current_end; /* Copy from here... */ - register char *pto = current_end + 5; /* ...to here. */ - - while (pfrom != from) - *--pto = *--pfrom; - store_jump_n(from, op, to, n); -} - - -/* Open up space at location THERE, and insert operation OP. - CURRENT_END gives the end of the storage in use, so - we know how much data to copy up. - - If you call this function, you must zero out pending_exact. */ - -static void -insert_op(op, there, current_end) - int op; - char *there, *current_end; -{ - register char *pfrom = current_end; /* Copy from here... */ - register char *pto = current_end + 1; /* ...to here. */ - - while (pfrom != there) - *--pto = *--pfrom; - - there[0] = (char)op; -} - - -/* Open up space at location THERE, and insert operation OP followed by - NUM_1 and NUM_2. CURRENT_END gives the end of the storage in use, so - we know how much data to copy up. - - If you call this function, you must zero out pending_exact. */ - -static void -insert_op_2(op, there, current_end, num_1, num_2) - int op; - char *there, *current_end; - int num_1, num_2; -{ - register char *pfrom = current_end; /* Copy from here... */ - register char *pto = current_end + 5; /* ...to here. */ - - while (pfrom != there) - *--pto = *--pfrom; - - there[0] = (char)op; - STORE_NUMBER(there + 1, num_1); - STORE_NUMBER(there + 3, num_2); -} - - -#define trans_eq(c1, c2, translate) (translate?(translate[c1]==translate[c2]):((c1)==(c2))) -static int -slow_match(little, lend, big, bend, translate) - const unsigned char *little, *lend; - const unsigned char *big, *bend; - const unsigned char *translate; -{ - int c; - - while (little < lend && big < bend) { - c = *little++; - if (c == 0xff) - c = *little++; - if (!trans_eq(*big++, c, translate)) break; - } - if (little == lend) return 1; - return 0; -} - -static int -slow_search(little, llen, big, blen, translate) - const unsigned char *little; - int llen; - const unsigned char *big; - int blen; - const char *translate; -{ - const unsigned char *bsave = big; - const unsigned char *bend = big + blen; - register int c; - int fescape = 0; - - c = *little; - if (c == 0xff) { - c = little[1]; - fescape = 1; - } - else if (translate && !ismbchar(c)) { - c = translate[c]; - } - - while (big < bend) { - /* look for first character */ - if (fescape) { - while (big < bend) { - if (*big == c) break; - big++; - } - } - else if (translate && !ismbchar(c)) { - while (big < bend) { - if (ismbchar(*big)) big+=mbclen(*big)-1; - else if (translate[*big] == c) break; - big++; - } - } - else { - while (big < bend) { - if (*big == c) break; - if (ismbchar(*big)) big+=mbclen(*big)-1; - big++; - } - } - - if (slow_match(little, little+llen, big, bend, (unsigned char *)translate)) - return big - bsave; - - big+=mbclen(*big); - } - return -1; -} - -static void -bm_init_skip(skip, pat, m, translate) - int *skip; - unsigned char *pat; - int m; - const unsigned char *translate; -{ - int j, c; - - for (c=0; c<256; c++) { - skip[c] = m; - } - if (translate) { - for (j=0; j= 0 && translate[big[k]] == translate[little[j]]) { - k--; - j--; - } - if (j < 0) return k+1; - - i += skip[translate[big[i]]]; - } - return -1; - } - while (i < blen) { - k = i; - j = llen-1; - while (j >= 0 && big[k] == little[j]) { - k--; - j--; - } - if (j < 0) return k+1; - - i += skip[big[i]]; - } - return -1; -} - -/* Given a pattern, compute a fastmap from it. The fastmap records - which of the (1 << BYTEWIDTH) possible characters can start a string - that matches the pattern. This fastmap is used by re_search to skip - quickly over totally implausible text. - - The caller must supply the address of a (1 << BYTEWIDTH)-byte data - area as bufp->fastmap. - The other components of bufp describe the pattern to be used. */ -static int -re_compile_fastmap0(bufp) - struct re_pattern_buffer *bufp; -{ - unsigned char *pattern = (unsigned char*)bufp->buffer; - int size = bufp->used; - register char *fastmap = bufp->fastmap; - register unsigned char *p = pattern; - register unsigned char *pend = pattern + size; - register int j, k; - unsigned is_a_succeed_n; - - - unsigned char *stacka[NFAILURES]; - unsigned char **stackb = stacka; - unsigned char **stackp = stackb; - unsigned char **stacke = stackb + NFAILURES; - int options = bufp->options; - - memset(fastmap, 0, (1 << BYTEWIDTH)); - bufp->fastmap_accurate = 1; - bufp->can_be_null = 0; - - while (p) { - is_a_succeed_n = 0; - if (p == pend) { - bufp->can_be_null = 1; - break; - } -#ifdef SWITCH_ENUM_BUG - switch ((int)((enum regexpcode)*p++)) -#else - switch ((enum regexpcode)*p++) -#endif - { - case exactn: - if (p[1] == 0xff) { - if (TRANSLATE_P()) - fastmap[translate[p[2]]] = 2; - else - fastmap[p[2]] = 2; - bufp->options |= RE_OPTIMIZE_BMATCH; - } - else if (TRANSLATE_P()) - fastmap[translate[p[1]]] = 1; - else - fastmap[p[1]] = 1; - break; - - case begline: - case begbuf: - case begpos: - case endbuf: - case endbuf2: - case wordbound: - case notwordbound: - case wordbeg: - case wordend: - case pop_and_fail: - case push_dummy_failure: - case start_paren: - case stop_paren: - continue; - - case casefold_on: - bufp->options |= RE_MAY_IGNORECASE; - options |= RE_OPTION_IGNORECASE; - continue; - - case casefold_off: - options &= ~RE_OPTION_IGNORECASE; - continue; - - case option_set: - options = *p++; - continue; - - case endline: - if (TRANSLATE_P()) - fastmap[translate['\n']] = 1; - else - fastmap['\n'] = 1; - if ((options & RE_OPTION_SINGLELINE) == 0 && bufp->can_be_null == 0) - bufp->can_be_null = 2; - break; - - case jump_n: - case finalize_jump: - case maybe_finalize_jump: - case jump: - case jump_past_alt: - case dummy_failure_jump: - case finalize_push: - case finalize_push_n: - EXTRACT_NUMBER_AND_INCR(j, p); - p += j; - if (j > 0) - continue; - /* Jump backward reached implies we just went through - the body of a loop and matched nothing. - Opcode jumped to should be an on_failure_jump. - Just treat it like an ordinary jump. - For a * loop, it has pushed its failure point already; - If so, discard that as redundant. */ - - if ((enum regexpcode)*p != on_failure_jump - && (enum regexpcode)*p != try_next - && (enum regexpcode)*p != succeed_n) - continue; - p++; - EXTRACT_NUMBER_AND_INCR(j, p); - p += j; - if (stackp != stackb && *stackp == p) - stackp--; /* pop */ - continue; - - case try_next: - case start_nowidth: - case stop_nowidth: - case stop_backtrack: - p += 2; - continue; - - case succeed_n: - is_a_succeed_n = 1; - /* Get to the number of times to succeed. */ - EXTRACT_NUMBER(k, p + 2); - /* Increment p past the n for when k != 0. */ - if (k != 0) { - p += 4; - continue; - } - /* fall through */ - - case on_failure_jump: - EXTRACT_NUMBER_AND_INCR(j, p); - if (p + j < pend) { - if (stackp == stacke) { - EXPAND_FAIL_STACK(); - } - *++stackp = p + j; /* push */ - } - else { - bufp->can_be_null = 1; - } - if (is_a_succeed_n) - EXTRACT_NUMBER_AND_INCR(k, p); /* Skip the n. */ - continue; - - case set_number_at: - p += 4; - continue; - - case start_memory: - case stop_memory: - p += 2; - continue; - - case duplicate: - bufp->can_be_null = 1; - if (*p >= bufp->re_nsub) break; - fastmap['\n'] = 1; - case anychar_repeat: - case anychar: - for (j = 0; j < (1 << BYTEWIDTH); j++) { - if (j != '\n' || (options & RE_OPTION_MULTILINE)) - fastmap[j] = 1; - } - if (bufp->can_be_null) { - FREE_AND_RETURN(stackb, 0); - } - /* Don't return; check the alternative paths - so we can set can_be_null if appropriate. */ - if ((enum regexpcode)p[-1] == anychar_repeat) { - continue; - } - break; - - case wordchar: - for (j = 0; j < 0x80; j++) { - if (SYNTAX(j) == Sword) - fastmap[j] = 1; - } - switch (current_mbctype) { - case MBCTYPE_ASCII: - for (j = 0x80; j < (1 << BYTEWIDTH); j++) { - if (SYNTAX(j) == Sword2) - fastmap[j] = 1; - } - break; - case MBCTYPE_EUC: - case MBCTYPE_SJIS: - case MBCTYPE_UTF8: - for (j = 0x80; j < (1 << BYTEWIDTH); j++) { - if (re_mbctab[j]) - fastmap[j] = 1; - } - break; - } - break; - - case notwordchar: - for (j = 0; j < 0x80; j++) - if (SYNTAX(j) != Sword) - fastmap[j] = 1; - switch (current_mbctype) { - case MBCTYPE_ASCII: - for (j = 0x80; j < (1 << BYTEWIDTH); j++) { - if (SYNTAX(j) != Sword2) - fastmap[j] = 1; - } - break; - case MBCTYPE_EUC: - case MBCTYPE_SJIS: - case MBCTYPE_UTF8: - for (j = 0x80; j < (1 << BYTEWIDTH); j++) { - if (!re_mbctab[j]) - fastmap[j] = 1; - } - break; - } - break; - - case charset: - /* NOTE: Charset for single-byte chars never contain - multi-byte char. See set_list_bits(). */ - for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) - if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) { - int tmp = TRANSLATE_P()?translate[j]:j; - fastmap[tmp] = 1; - } - { - unsigned short size; - unsigned long c, beg, end; - - p += p[-1] + 2; - size = EXTRACT_UNSIGNED(&p[-2]); - for (j = 0; j < (int)size; j++) { - c = EXTRACT_MBC(&p[j*8]); - beg = WC2MBC1ST(c); - c = EXTRACT_MBC(&p[j*8+4]); - end = WC2MBC1ST(c); - /* set bits for 1st bytes of multi-byte chars. */ - while (beg <= end) { - /* NOTE: Charset for multi-byte chars might contain - single-byte chars. We must reject them. */ - if (c < 0x100) { - fastmap[beg] = 2; - bufp->options |= RE_OPTIMIZE_BMATCH; - } - else if (ismbchar(beg)) - fastmap[beg] = 1; - beg++; - } - } - } - break; - - case charset_not: - /* S: set of all single-byte chars. - M: set of all first bytes that can start multi-byte chars. - s: any set of single-byte chars. - m: any set of first bytes that can start multi-byte chars. - - We assume S+M = U. - ___ _ _ - s+m = (S*s+M*m). */ - /* Chars beyond end of map must be allowed */ - /* NOTE: Charset_not for single-byte chars might contain - multi-byte chars. See set_list_bits(). */ - for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++) - if (!ismbchar(j)) - fastmap[j] = 1; - - for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) - if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) { - if (!ismbchar(j)) - fastmap[j] = 1; - } - { - unsigned short size; - unsigned long c, beg; - int num_literal = 0; - - p += p[-1] + 2; - size = EXTRACT_UNSIGNED(&p[-2]); - if (size == 0) { - for (j = 0x80; j < (1 << BYTEWIDTH); j++) - if (ismbchar(j)) - fastmap[j] = 1; - break; - } - for (j = 0,c = 0;j < (int)size; j++) { - unsigned int cc = EXTRACT_MBC(&p[j*8]); - beg = WC2MBC1ST(cc); - while (c <= beg) { - if (ismbchar(c)) - fastmap[c] = 1; - c++; - } - - cc = EXTRACT_MBC(&p[j*8+4]); - if (cc < 0xff) { - num_literal = 1; - while (c <= cc) { - if (ismbchar(c)) - fastmap[c] = 1; - c++; - } - } - c = WC2MBC1ST(cc); - } - - for (j = c; j < (1 << BYTEWIDTH); j++) { - if (num_literal) - fastmap[j] = 1; - if (ismbchar(j)) - fastmap[j] = 1; - } - } - break; - - case unused: /* pacify gcc -Wall */ - break; - } - - /* Get here means we have successfully found the possible starting - characters of one path of the pattern. We need not follow this - path any farther. Instead, look at the next alternative - remembered in the stack. */ - if (stackp != stackb) - p = *stackp--; /* pop */ - else - break; - } - FREE_AND_RETURN(stackb, 0); - memory_exhausted: - FREE_AND_RETURN(stackb, -2); -} - -void -re_compile_fastmap(bufp) - struct re_pattern_buffer *bufp; -{ - (void)re_compile_fastmap0(bufp); -} - -/* adjust startpos value to the position between characters. */ -int -re_mbc_startpos(string, size, startpos, range) - const char *string; - int size, startpos, range; -{ - int i = mbc_startpos(string, startpos); - - if (i < startpos) { - if (range > 0) { - startpos = i + mbclen(string[i]); - } - else { - int len = mbclen(string[i]); - if (i + len <= startpos) - startpos = i + len; - else - startpos = i; - } - } - return startpos; -} - -int -re_adjust_startpos(bufp, string, size, startpos, range) - struct re_pattern_buffer *bufp; - const char *string; - int size, startpos, range; -{ - /* Update the fastmap now if not correct already. */ - if (!bufp->fastmap_accurate) { - int ret = re_compile_fastmap0(bufp); - if (ret) return ret; - } - - /* Adjust startpos for mbc string */ - if (current_mbctype && startpos>0 && !(bufp->options&RE_OPTIMIZE_BMATCH)) { - startpos = re_mbc_startpos(string, size, startpos, range); - } - return startpos; -} - - -static int re_match_exec _((struct re_pattern_buffer *, const char *, int, int, int, - struct re_registers *)); - -/* Using the compiled pattern in BUFP->buffer, first tries to match - STRING, starting first at index STARTPOS, then at STARTPOS + 1, and - so on. RANGE is the number of places to try before giving up. If - RANGE is negative, it searches backwards, i.e., the starting - positions tried are STARTPOS, STARTPOS - 1, etc. STRING is of SIZE. - In REGS, return the indices of STRING that matched the entire - BUFP->buffer and its contained subexpressions. - - The value returned is the position in the strings at which the match - was found, or -1 if no match was found, or -2 if error (such as - failure stack overflow). */ - -int -re_search(bufp, string, size, startpos, range, regs) - struct re_pattern_buffer *bufp; - const char *string; - int size, startpos, range; - struct re_registers *regs; -{ - register char *fastmap = bufp->fastmap; - int val, anchor = 0, initpos = startpos; - - /* Check for out-of-range starting position. */ - if (startpos < 0 || startpos > size) - return -1; - if (!string) { - if (size == 0) string = ""; - else return -1; - } - - /* Update the fastmap now if not correct already. */ - if (fastmap && !bufp->fastmap_accurate) { - int ret = re_compile_fastmap0(bufp); - if (ret) return ret; - } - - - /* If the search isn't to be a backwards one, don't waste time in a - search for a pattern that must be anchored. */ - if (bufp->used > 0) { - switch ((enum regexpcode)bufp->buffer[0]) { - case begbuf: - begbuf_match: - if (range > 0) { - if (startpos > 0) return -1; - else { - val = re_match(bufp, string, size, 0, regs); - if (val >= 0) return 0; - return val; - } - } - break; - - case begline: - anchor = 1; - break; - - case begpos: - val = re_match(bufp, string, size, startpos, regs); - if (val >= 0) return startpos; - return val; - - default: - break; - } - } - if (bufp->options & RE_OPTIMIZE_ANCHOR) { - if (bufp->options&RE_OPTION_MULTILINE && range > 0) { - goto begbuf_match; - } - anchor = 1; - } - - if (bufp->must) { - int len = ((unsigned char*)bufp->must)[0]; - int pos, pbeg, pend; - - pbeg = startpos; - pend = startpos + range; - if (pbeg > pend) { /* swap pbeg,pend */ - pos = pend; pend = pbeg; pbeg = pos; - } - pend = size; - if (bufp->options & RE_OPTIMIZE_NO_BM) { - pos = slow_search((unsigned char *)(bufp->must+1), len, - (unsigned char*)(string+pbeg), pend-pbeg, - (char *)(MAY_TRANSLATE()?translate:0)); - } - else { - pos = bm_search((unsigned char *)(bufp->must+1), len, - (unsigned char *)(string+pbeg), pend-pbeg, - bufp->must_skip, - MAY_TRANSLATE()?translate:0); - } - if (pos == -1) return -1; - if (range > 0 && (bufp->options & RE_OPTIMIZE_EXACTN)) { - startpos += pos; - range -= pos; - if (range < 0) return -1; - } - } - - for (;;) { - /* If a fastmap is supplied, skip quickly over characters that - cannot possibly be the start of a match. Note, however, that - if the pattern can possibly match the null string, we must - test it at each starting point so that we take the first null - string we get. */ - - if (fastmap && startpos < size - && bufp->can_be_null != 1 && !(anchor && startpos == 0)) { - if (range > 0) { /* Searching forwards. */ - register unsigned char *p, c; - int irange = range; - - p = (unsigned char*)string+startpos; - - while (range > 0) { - c = *p++; - if (ismbchar(c)) { - int len; - - if (fastmap[c]) - break; - len = mbclen(c) - 1; - while (len--) { - c = *p++; - range--; - if (fastmap[c] == 2) - goto startpos_adjust; - } - } - else { - if (fastmap[MAY_TRANSLATE() ? translate[c] : c]) - break; - } - range--; - } - startpos_adjust: - startpos += irange - range; - } - else { /* Searching backwards. */ - register unsigned char c; - - c = string[startpos]; - c &= 0xff; - if (MAY_TRANSLATE() ? !fastmap[translate[c]] : !fastmap[c]) - goto advance; - } - } - - if (startpos > size) return -1; - if ((anchor || !bufp->can_be_null) && range > 0 && size > 0 && startpos == size) - return -1; - val = re_match_exec(bufp, string, size, startpos, initpos, regs); - if (val >= 0) return startpos; - if (val == -2) return -2; - -#ifndef NO_ALLOCA -#ifdef C_ALLOCA - alloca(0); -#endif /* C_ALLOCA */ -#endif /* NO_ALLOCA */ - - if (range > 0) { - if (anchor && startpos < size && - (startpos < 1 || string[startpos-1] != '\n')) { - while (range > 0 && string[startpos] != '\n') { - range--; - startpos++; - } - } - } - - advance: - if (!range) - break; - else if (range > 0) { - const char *d = string + startpos; - - if (ismbchar(*d)) { - int len = mbclen(*d) - 1; - range-=len, startpos+=len; - if (!range) - break; - } - range--, startpos++; - } - else { - range++, startpos--; - { - const char *s, *d, *p; - - s = string; d = string + startpos; - for (p = d; p-- > s && ismbchar(*p); ) - /* --p >= s would not work on 80[12]?86. - (when the offset of s equals 0 other than huge model.) */ - ; - if (!((d - p) & 1)) { - if (!range) - break; - range++, startpos--; - } - } - } - } - return -1; -} - - - - -/* The following are used for re_match, defined below: */ - -/* Accessing macros used in re_match: */ - -#define IS_ACTIVE(R) ((R).bits.is_active) -#define MATCHED_SOMETHING(R) ((R).bits.matched_something) - - -/* Macros used by re_match: */ - -/* I.e., regstart, regend, and reg_info. */ -#define NUM_REG_ITEMS 3 - -/* I.e., ptr and count. */ -#define NUM_COUNT_ITEMS 2 - -/* Individual items aside from the registers. */ -#define NUM_NONREG_ITEMS 4 - -/* We push at most this many things on the stack whenever we - fail. The `+ 2' refers to PATTERN_PLACE and STRING_PLACE, which are - arguments to the PUSH_FAILURE_POINT macro. */ -#define MAX_NUM_FAILURE_ITEMS (num_regs * NUM_REG_ITEMS + NUM_NONREG_ITEMS) - -/* We push this many things on the stack whenever we fail. */ -#define NUM_FAILURE_ITEMS (last_used_reg * NUM_REG_ITEMS + NUM_NONREG_ITEMS + 1) - -/* This pushes counter information for succeed_n and jump_n */ -#define PUSH_FAILURE_COUNT(ptr) \ - do { \ - int c; \ - EXTRACT_NUMBER(c, ptr); \ - ENSURE_FAIL_STACK(NUM_COUNT_ITEMS); \ - *stackp++ = (unsigned char*)(long)c; \ - *stackp++ = (ptr); \ - num_failure_counts++; \ - } while (0) - -/* This pushes most of the information about the current state we will want - if we ever fail back to it. */ - -#define PUSH_FAILURE_POINT(pattern_place, string_place) \ - do { \ - long last_used_reg, this_reg; \ - \ - /* Find out how many registers are active or have been matched. \ - (Aside from register zero, which is only set at the end.) */ \ - for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--)\ - if (!REG_UNSET(regstart[last_used_reg])) \ - break; \ - \ - ENSURE_FAIL_STACK(NUM_FAILURE_ITEMS); \ - *stackp++ = (unsigned char*)(long)num_failure_counts; \ - num_failure_counts = 0; \ - \ - /* Now push the info for each of those registers. */ \ - for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { \ - *stackp++ = regstart[this_reg]; \ - *stackp++ = regend[this_reg]; \ - *stackp++ = reg_info[this_reg].word; \ - } \ - \ - /* Push how many registers we saved. */ \ - *stackp++ = (unsigned char*)last_used_reg; \ - \ - *stackp++ = pattern_place; \ - *stackp++ = string_place; \ - *stackp++ = (unsigned char*)(long)options; /* current option status */ \ - *stackp++ = (unsigned char*)0; /* non-greedy flag */ \ - } while(0) - -#define NON_GREEDY ((unsigned char*)1) - -#define POP_FAILURE_COUNT() \ - do { \ - unsigned char *ptr = *--stackp; \ - int count = (long)*--stackp; \ - STORE_NUMBER(ptr, count); \ - } while (0) - -/* This pops what PUSH_FAILURE_POINT pushes. */ - -#define POP_FAILURE_POINT() \ - do { \ - long temp; \ - stackp -= NUM_NONREG_ITEMS; /* Remove failure points (and flag). */ \ - temp = (long)*--stackp; /* How many regs pushed. */ \ - temp *= NUM_REG_ITEMS; /* How much to take off the stack. */ \ - stackp -= temp; /* Remove the register info. */ \ - temp = (long)*--stackp; /* How many counters pushed. */ \ - while (temp--) { \ - POP_FAILURE_COUNT(); /* Remove the counter info. */ \ - } \ - num_failure_counts = 0; /* Reset num_failure_counts. */ \ - } while(0) - - /* Registers are set to a sentinel when they haven't yet matched. */ -#define REG_UNSET_VALUE ((unsigned char*)-1) -#define REG_UNSET(e) ((e) == REG_UNSET_VALUE) - -#define PREFETCH if (d == dend) goto fail - - /* Call this when have matched something; it sets `matched' flags for the - registers corresponding to the subexpressions of which we currently - are inside. */ -#define SET_REGS_MATCHED \ - do { unsigned this_reg; \ - for (this_reg = 0; this_reg < num_regs; this_reg++) { \ - if (IS_ACTIVE(reg_info[this_reg])) \ - MATCHED_SOMETHING(reg_info[this_reg]) = 1; \ - else \ - MATCHED_SOMETHING(reg_info[this_reg]) = 0; \ - } \ - } while(0) - -#define AT_STRINGS_BEG(d) ((d) == string) -#define AT_STRINGS_END(d) ((d) == dend) - -#define IS_A_LETTER(d) (SYNTAX(*(d)) == Sword || \ - (current_mbctype ? \ - (re_mbctab[*(d)] && ((d)+mbclen(*(d)))<=dend): \ - SYNTAX(*(d)) == Sword2)) - -#define PREV_IS_A_LETTER(d) ((current_mbctype == MBCTYPE_SJIS)? \ - IS_A_LETTER((d)-(!AT_STRINGS_BEG((d)-1)&& \ - ismbchar((d)[-2])?2:1)): \ - ((current_mbctype && ((d)[-1] >= 0x80)) || \ - IS_A_LETTER((d)-1))) - -static void -init_regs(regs, num_regs) - struct re_registers *regs; - unsigned int num_regs; -{ - int i; - - regs->num_regs = num_regs; - if (num_regs < RE_NREGS) - num_regs = RE_NREGS; - - if (regs->allocated == 0) { - regs->beg = TMALLOC(num_regs, int); - regs->end = TMALLOC(num_regs, int); - regs->allocated = num_regs; - } - else if (regs->allocated < num_regs) { - TREALLOC(regs->beg, num_regs, int); - TREALLOC(regs->end, num_regs, int); - regs->allocated = num_regs; - } - for (i=0; ibeg[i] = regs->end[i] = -1; - } -} - -/* Match the pattern described by BUFP against STRING, which is of - SIZE. Start the match at index POS in STRING. In REGS, return the - indices of STRING that matched the entire BUFP->buffer and its - contained subexpressions. - - If bufp->fastmap is nonzero, then it had better be up to date. - - The reason that the data to match are specified as two components - which are to be regarded as concatenated is so this function can be - used directly on the contents of an Emacs buffer. - - -1 is returned if there is no match. -2 is returned if there is an - error (such as match stack overflow). Otherwise the value is the - length of the substring which was matched. */ - -int -re_match(bufp, string_arg, size, pos, regs) - struct re_pattern_buffer *bufp; - const char *string_arg; - int size, pos; - struct re_registers *regs; -{ - return re_match_exec(bufp, string_arg, size, pos, pos, regs); -} - -static int -re_match_exec(bufp, string_arg, size, pos, beg, regs) - struct re_pattern_buffer *bufp; - const char *string_arg; - int size, pos, beg; - struct re_registers *regs; -{ - register unsigned char *p = (unsigned char*)bufp->buffer; - unsigned char *p1; - - /* Pointer to beyond end of buffer. */ - register unsigned char *pend = p + bufp->used; - - unsigned num_regs = bufp->re_nsub; - - unsigned char *string = (unsigned char*)string_arg; - - register unsigned char *d, *dend; - register int mcnt; /* Multipurpose. */ - int options = bufp->options; - - /* Failure point stack. Each place that can handle a failure further - down the line pushes a failure point on this stack. It consists of - restart, regend, and reg_info for all registers corresponding to the - subexpressions we're currently inside, plus the number of such - registers, and, finally, two char *'s. The first char * is where to - resume scanning the pattern; the second one is where to resume - scanning the strings. If the latter is zero, the failure point is a - ``dummy''; if a failure happens and the failure point is a dummy, it - gets discarded and the next next one is tried. */ - - unsigned char **const stacka = 0; - unsigned char **stackb; - unsigned char **stackp; - unsigned char **stacke; - - /* Information on the contents of registers. These are pointers into - the input strings; they record just what was matched (on this - attempt) by a subexpression part of the pattern, that is, the - regnum-th regstart pointer points to where in the pattern we began - matching and the regnum-th regend points to right after where we - stopped matching the regnum-th subexpression. (The zeroth register - keeps track of what the whole pattern matches.) */ - - unsigned char **regstart = bufp->regstart; - unsigned char **regend = bufp->regend; - - /* If a group that's operated upon by a repetition operator fails to - match anything, then the register for its start will need to be - restored because it will have been set to wherever in the string we - are when we last see its open-group operator. Similarly for a - register's end. */ - unsigned char **old_regstart = bufp->old_regstart; - unsigned char **old_regend = bufp->old_regend; - - /* The is_active field of reg_info helps us keep track of which (possibly - nested) subexpressions we are currently in. The matched_something - field of reg_info[reg_num] helps us tell whether or not we have - matched any of the pattern so far this time through the reg_num-th - subexpression. These two fields get reset each time through any - loop their register is in. */ - - register_info_type *reg_info = bufp->reg_info; - - /* The following record the register info as found in the above - variables when we find a match better than any we've seen before. - This happens as we backtrack through the failure points, which in - turn happens only if we have not yet matched the entire string. */ - - unsigned best_regs_set = 0; - unsigned char **best_regstart = bufp->best_regstart; - unsigned char **best_regend = bufp->best_regend; - - int num_failure_counts = 0; - - if (regs) { - init_regs(regs, num_regs); - } - - /* Initialize the stack. */ - stackb = TMALLOC(MAX_NUM_FAILURE_ITEMS * NFAILURES, unsigned char*); - stackp = stackb; - stacke = &stackb[MAX_NUM_FAILURE_ITEMS * NFAILURES]; - -#ifdef DEBUG_REGEX - fprintf(stderr, "Entering re_match(%s)\n", string_arg); -#endif - - /* Initialize subexpression text positions to -1 to mark ones that no - ( or ( and ) or ) has been seen for. Also set all registers to - inactive and mark them as not having matched anything or ever - failed. */ - for (mcnt = 0; mcnt < num_regs; mcnt++) { - regstart[mcnt] = regend[mcnt] - = old_regstart[mcnt] = old_regend[mcnt] - = best_regstart[mcnt] = best_regend[mcnt] = REG_UNSET_VALUE; -#ifdef __CHECKER__ - reg_info[mcnt].word = 0; -#endif - IS_ACTIVE (reg_info[mcnt]) = 0; - MATCHED_SOMETHING (reg_info[mcnt]) = 0; - } - - /* Set up pointers to ends of strings. - Don't allow the second string to be empty unless both are empty. */ - - - /* `p' scans through the pattern as `d' scans through the data. `dend' - is the end of the input string that `d' points within. `d' is - advanced into the following input string whenever necessary, but - this happens before fetching; therefore, at the beginning of the - loop, `d' can be pointing at the end of a string, but it cannot - equal string2. */ - - d = string + pos, dend = string + size; - - /* This loops over pattern commands. It exits by returning from the - function if match is complete, or it drops through if match fails - at this starting point in the input data. */ - - for (;;) { -#ifdef DEBUG_REGEX - fprintf(stderr, - "regex loop(%d): matching 0x%02d\n", - p - (unsigned char*)bufp->buffer, - *p); -#endif - /* End of pattern means we might have succeeded. */ - if (p == pend) { - /* If not end of string, try backtracking. Otherwise done. */ - if ((bufp->options & RE_OPTION_LONGEST) && d != dend) { - if (best_regs_set) /* non-greedy, no need to backtrack */ - goto restore_best_regs; - while (stackp != stackb && stackp[-1] == NON_GREEDY) { - if (best_regs_set) /* non-greedy, no need to backtrack */ - goto restore_best_regs; - POP_FAILURE_POINT(); - } - if (stackp != stackb) { - /* More failure points to try. */ - - /* If exceeds best match so far, save it. */ - if (! best_regs_set || (d > best_regend[0])) { - best_regs_set = 1; - best_regend[0] = d; /* Never use regstart[0]. */ - - for (mcnt = 1; mcnt < num_regs; mcnt++) { - best_regstart[mcnt] = regstart[mcnt]; - best_regend[mcnt] = regend[mcnt]; - } - } - goto fail; - } - /* If no failure points, don't restore garbage. */ - else if (best_regs_set) { - restore_best_regs: - /* Restore best match. */ - d = best_regend[0]; - - for (mcnt = 0; mcnt < num_regs; mcnt++) { - regstart[mcnt] = best_regstart[mcnt]; - regend[mcnt] = best_regend[mcnt]; - } - } - } - - /* If caller wants register contents data back, convert it - to indices. */ - if (regs) { - regs->beg[0] = pos; - regs->end[0] = d - string; - for (mcnt = 1; mcnt < num_regs; mcnt++) { - if (REG_UNSET(regend[mcnt])) { - regs->beg[mcnt] = -1; - regs->end[mcnt] = -1; - continue; - } - regs->beg[mcnt] = regstart[mcnt] - string; - regs->end[mcnt] = regend[mcnt] - string; - } - } - FREE_AND_RETURN(stackb, (d - pos - string)); - } - - /* Otherwise match next pattern command. */ -#ifdef SWITCH_ENUM_BUG - switch ((int)((enum regexpcode)*p++)) -#else - switch ((enum regexpcode)*p++) -#endif - { - /* ( [or `(', as appropriate] is represented by start_memory, - ) by stop_memory. Both of those commands are followed by - a register number in the next byte. The text matched - within the ( and ) is recorded under that number. */ - case start_memory: - old_regstart[*p] = regstart[*p]; - regstart[*p] = d; - IS_ACTIVE(reg_info[*p]) = 1; - MATCHED_SOMETHING(reg_info[*p]) = 0; - p += 2; - continue; - - case stop_memory: - old_regend[*p] = regend[*p]; - regend[*p] = d; - IS_ACTIVE(reg_info[*p]) = 0; - p += 2; - continue; - - case start_paren: - case stop_paren: - break; - - /* \ has been turned into a `duplicate' command which is - followed by the numeric value of as the register number. */ - case duplicate: - { - int regno = *p++; /* Get which register to match against */ - register unsigned char *d2, *dend2; - - /* Check if there's corresponding group */ - if (regno >= num_regs) goto fail; - /* Check if corresponding group is still open */ - if (IS_ACTIVE(reg_info[regno])) goto fail; - - /* Where in input to try to start matching. */ - d2 = regstart[regno]; - if (REG_UNSET(d2)) goto fail; - - /* Where to stop matching; if both the place to start and - the place to stop matching are in the same string, then - set to the place to stop, otherwise, for now have to use - the end of the first string. */ - - dend2 = regend[regno]; - if (REG_UNSET(dend2)) goto fail; - for (;;) { - /* At end of register contents => success */ - if (d2 == dend2) break; - - /* If necessary, advance to next segment in data. */ - PREFETCH; - - /* How many characters left in this segment to match. */ - mcnt = dend - d; - - /* Want how many consecutive characters we can match in - one shot, so, if necessary, adjust the count. */ - if (mcnt > dend2 - d2) - mcnt = dend2 - d2; - - /* Compare that many; failure if mismatch, else move - past them. */ - if ((options & RE_OPTION_IGNORECASE) - ? memcmp_translate(d, d2, mcnt) - : memcmp((char*)d, (char*)d2, mcnt)) - goto fail; - d += mcnt, d2 += mcnt; - } - } - break; - - case start_nowidth: - PUSH_FAILURE_POINT(0, d); - if (stackp - stackb > RE_DUP_MAX) { - FREE_AND_RETURN(stackb,(-2)); - } - EXTRACT_NUMBER_AND_INCR(mcnt, p); - STORE_NUMBER(p+mcnt, stackp - stackb); - continue; - - case stop_nowidth: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - stackp = stackb + mcnt; - d = stackp[-3]; - POP_FAILURE_POINT(); - continue; - - case stop_backtrack: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - stackp = stackb + mcnt; - POP_FAILURE_POINT(); - continue; - - case pop_and_fail: - EXTRACT_NUMBER(mcnt, p+1); - stackp = stackb + mcnt; - POP_FAILURE_POINT(); - goto fail; - - case anychar: - PREFETCH; - if (ismbchar(*d)) { - if (d + mbclen(*d) > dend) - goto fail; - SET_REGS_MATCHED; - d += mbclen(*d); - break; - } - if (!(options&RE_OPTION_MULTILINE) - && (TRANSLATE_P() ? translate[*d] : *d) == '\n') - goto fail; - SET_REGS_MATCHED; - d++; - break; - - case anychar_repeat: - for (;;) { - PUSH_FAILURE_POINT(p, d); - PREFETCH; - if (ismbchar(*d)) { - if (d + mbclen(*d) > dend) - goto fail; - SET_REGS_MATCHED; - d += mbclen(*d); - continue; - } - if (!(options&RE_OPTION_MULTILINE) && - (TRANSLATE_P() ? translate[*d] : *d) == '\n') - goto fail; - SET_REGS_MATCHED; - d++; - } - break; - - case charset: - case charset_not: - { - int not; /* Nonzero for charset_not. */ - int part = 0; /* true if matched part of mbc */ - unsigned char *dsave = d + 1; - int cc, c; - - PREFETCH; - c = (unsigned char)*d++; - if (ismbchar(c)) { - if (d + mbclen(c) - 1 <= dend) { - cc = c; - MBC2WC(c, d); - not = is_in_list_mbc(c, p); - if (!not) { - part = not = is_in_list_sbc(cc, p); - } - } else { - not = is_in_list(c, p); - } - } - else { - if (TRANSLATE_P()) - c = (unsigned char)translate[c]; - not = is_in_list(c, p); - } - - if (*(p - 1) == (unsigned char)charset_not) { - not = !not; - } - if (!not) goto fail; - - p += 1 + *p + 2 + EXTRACT_UNSIGNED(&p[1 + *p])*8; - SET_REGS_MATCHED; - - if (part) d = dsave; - break; - } - - case begline: - if (size == 0 || AT_STRINGS_BEG(d)) - break; - if (d[-1] == '\n' && !AT_STRINGS_END(d)) - break; - goto fail; - - case endline: - if (AT_STRINGS_END(d)) { - break; - } - else if (*d == '\n') - break; - goto fail; - - /* Match at the very beginning of the string. */ - case begbuf: - if (AT_STRINGS_BEG(d)) - break; - goto fail; - - /* Match at the very end of the data. */ - case endbuf: - if (AT_STRINGS_END(d)) - break; - goto fail; - - /* Match at the very end of the data. */ - case endbuf2: - if (AT_STRINGS_END(d)) { - break; - } - /* .. or newline just before the end of the data. */ - if (*d == '\n' && AT_STRINGS_END(d+1)) - break; - goto fail; - - /* `or' constructs are handled by starting each alternative with - an on_failure_jump that points to the start of the next - alternative. Each alternative except the last ends with a - jump to the joining point. (Actually, each jump except for - the last one really jumps to the following jump, because - tensioning the jumps is a hassle.) */ - - /* The start of a stupid repeat has an on_failure_jump that points - past the end of the repeat text. This makes a failure point so - that on failure to match a repetition, matching restarts past - as many repetitions have been found with no way to fail and - look for another one. */ - - /* A smart repeat is similar but loops back to the on_failure_jump - so that each repetition makes another failure point. */ - - /* Match at the starting position. */ - case begpos: - if (d - string == beg) - break; - goto fail; - - case on_failure_jump: - on_failure: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - PUSH_FAILURE_POINT(p + mcnt, d); - continue; - - /* The end of a smart repeat has a maybe_finalize_jump back. - Change it either to a finalize_jump or an ordinary jump. */ - case maybe_finalize_jump: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - p1 = p; - - /* Compare the beginning of the repeat with what in the - pattern follows its end. If we can establish that there - is nothing that they would both match, i.e., that we - would have to backtrack because of (as in, e.g., `a*a') - then we can change to finalize_jump, because we'll - never have to backtrack. - - This is not true in the case of alternatives: in - `(a|ab)*' we do need to backtrack to the `ab' alternative - (e.g., if the string was `ab'). But instead of trying to - detect that here, the alternative has put on a dummy - failure point which is what we will end up popping. */ - - /* Skip over open/close-group commands. */ - while (p1 + 2 < pend) { - if ((enum regexpcode)*p1 == stop_memory || - (enum regexpcode)*p1 == start_memory) - p1 += 3; /* Skip over args, too. */ - else if (/*(enum regexpcode)*p1 == start_paren ||*/ - (enum regexpcode)*p1 == stop_paren) - p1 += 1; - else - break; - } - - if (p1 == pend) - p[-3] = (unsigned char)finalize_jump; - else if (*p1 == (unsigned char)exactn || - *p1 == (unsigned char)endline) { - register int c = *p1 == (unsigned char)endline ? '\n' : p1[2]; - register unsigned char *p2 = p + mcnt; - /* p2[0] ... p2[2] are an on_failure_jump. - Examine what follows that. */ - if (p2[3] == (unsigned char)exactn && p2[5] != c) - p[-3] = (unsigned char)finalize_jump; - else if (p2[3] == (unsigned char)charset || - p2[3] == (unsigned char)charset_not) { - int not; - if (ismbchar(c)) { - unsigned char *pp = p1+3; - MBC2WC(c, pp); - } - /* `is_in_list()' is TRUE if c would match */ - /* That means it is not safe to finalize. */ - not = is_in_list(c, p2 + 4); - if (p2[3] == (unsigned char)charset_not) - not = !not; - if (!not) - p[-3] = (unsigned char)finalize_jump; - } - } - p -= 2; /* Point at relative address again. */ - if (p[-1] != (unsigned char)finalize_jump) { - p[-1] = (unsigned char)jump; - goto nofinalize; - } - /* Note fall through. */ - - /* The end of a stupid repeat has a finalize_jump back to the - start, where another failure point will be made which will - point to after all the repetitions found so far. */ - - /* Take off failure points put on by matching on_failure_jump - because didn't fail. Also remove the register information - put on by the on_failure_jump. */ - case finalize_jump: - if (stackp > stackb && stackp[-3] == d) { - p = stackp[-4]; - POP_FAILURE_POINT(); - continue; - } - POP_FAILURE_POINT(); - /* Note fall through. */ - - /* We need this opcode so we can detect where alternatives end - in `group_match_null_string_p' et al. */ - case jump_past_alt: - /* fall through */ - - /* Jump without taking off any failure points. */ - case jump: - nofinalize: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - if (mcnt < 0 && stackp > stackb && stackp[-3] == d) /* avoid infinite loop */ - goto fail; - p += mcnt; - continue; - - case dummy_failure_jump: - /* Normally, the on_failure_jump pushes a failure point, which - then gets popped at finalize_jump. We will end up at - finalize_jump, also, and with a pattern of, say, `a+', we - are skipping over the on_failure_jump, so we have to push - something meaningless for finalize_jump to pop. */ - PUSH_FAILURE_POINT(0, 0); - goto nofinalize; - - /* At the end of an alternative, we need to push a dummy failure - point in case we are followed by a `finalize_jump', because - we don't want the failure point for the alternative to be - popped. For example, matching `(a|ab)*' against `aab' - requires that we match the `ab' alternative. */ - case push_dummy_failure: - /* See comments just above at `dummy_failure_jump' about the - two zeroes. */ - p1 = p; - /* Skip over open/close-group commands. */ - while (p1 + 2 < pend) { - if ((enum regexpcode)*p1 == stop_memory || - (enum regexpcode)*p1 == start_memory) - p1 += 3; /* Skip over args, too. */ - else if (/*(enum regexpcode)*p1 == start_paren ||*/ - (enum regexpcode)*p1 == stop_paren) - p1 += 1; - else - break; - } - if (p1 < pend && (enum regexpcode)*p1 == jump) - p[-1] = unused; - else - PUSH_FAILURE_POINT(0, 0); - break; - - /* Have to succeed matching what follows at least n times. Then - just handle like an on_failure_jump. */ - case succeed_n: - EXTRACT_NUMBER(mcnt, p + 2); - /* Originally, this is how many times we HAVE to succeed. */ - if (mcnt != 0) { - mcnt--; - p += 2; - PUSH_FAILURE_COUNT(p); - STORE_NUMBER_AND_INCR(p, mcnt); - PUSH_FAILURE_POINT(0, 0); - } - else { - goto on_failure; - } - continue; - - case jump_n: - EXTRACT_NUMBER(mcnt, p + 2); - /* Originally, this is how many times we CAN jump. */ - if (mcnt) { - mcnt--; - PUSH_FAILURE_COUNT(p + 2); - STORE_NUMBER(p + 2, mcnt); - goto nofinalize; /* Do the jump without taking off - any failure points. */ - } - /* If don't have to jump any more, skip over the rest of command. */ - else - p += 4; - continue; - - case set_number_at: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - p1 = p + mcnt; - EXTRACT_NUMBER_AND_INCR(mcnt, p); - STORE_NUMBER(p1, mcnt); - continue; - - case try_next: - EXTRACT_NUMBER_AND_INCR(mcnt, p); - if (p + mcnt < pend) { - PUSH_FAILURE_POINT(p, d); - stackp[-1] = NON_GREEDY; - } - p += mcnt; - continue; - - case finalize_push: - POP_FAILURE_POINT(); - EXTRACT_NUMBER_AND_INCR(mcnt, p); - if (mcnt < 0 && stackp > stackb && stackp[-3] == d) /* avoid infinite loop */ - goto fail; - PUSH_FAILURE_POINT(p + mcnt, d); - stackp[-1] = NON_GREEDY; - continue; - - case finalize_push_n: - EXTRACT_NUMBER(mcnt, p + 2); - /* Originally, this is how many times we CAN jump. */ - if (mcnt) { - int pos, i; - - mcnt--; - STORE_NUMBER(p + 2, mcnt); - EXTRACT_NUMBER(pos, p); - EXTRACT_NUMBER(i, p+pos+5); - if (i > 0) goto nofinalize; - POP_FAILURE_POINT(); - EXTRACT_NUMBER_AND_INCR(mcnt, p); - PUSH_FAILURE_POINT(p + mcnt, d); - stackp[-1] = NON_GREEDY; - p += 2; /* skip n */ - } - /* If don't have to push any more, skip over the rest of command. */ - else - p += 4; - continue; - - /* Ignore these. Used to ignore the n of succeed_n's which - currently have n == 0. */ - case unused: - continue; - - case casefold_on: - options |= RE_OPTION_IGNORECASE; - continue; - - case casefold_off: - options &= ~RE_OPTION_IGNORECASE; - continue; - - case option_set: - options = *p++; - continue; - - case wordbound: - if (AT_STRINGS_BEG(d)) { - if (AT_STRINGS_END(d)) goto fail; - if (IS_A_LETTER(d)) break; - else goto fail; - } - if (AT_STRINGS_END(d)) { - if (PREV_IS_A_LETTER(d)) break; - else goto fail; - } - if (PREV_IS_A_LETTER(d) != IS_A_LETTER(d)) - break; - goto fail; - - case notwordbound: - if (AT_STRINGS_BEG(d)) { - if (IS_A_LETTER(d)) goto fail; - else break; - } - if (AT_STRINGS_END(d)) { - if (PREV_IS_A_LETTER(d)) goto fail; - else break; - } - if (PREV_IS_A_LETTER(d) != IS_A_LETTER(d)) - goto fail; - break; - - case wordbeg: - if (IS_A_LETTER(d) && (AT_STRINGS_BEG(d) || !PREV_IS_A_LETTER(d))) - break; - goto fail; - - case wordend: - if (!AT_STRINGS_BEG(d) && PREV_IS_A_LETTER(d) - && (!IS_A_LETTER(d) || AT_STRINGS_END(d))) - break; - goto fail; - - case wordchar: - PREFETCH; - if (!IS_A_LETTER(d)) - goto fail; - if (ismbchar(*d) && d + mbclen(*d) - 1 < dend) - d += mbclen(*d) - 1; - d++; - SET_REGS_MATCHED; - break; - - case notwordchar: - PREFETCH; - if (IS_A_LETTER(d)) - goto fail; - if (ismbchar(*d) && d + mbclen(*d) - 1 < dend) - d += mbclen(*d) - 1; - d++; - SET_REGS_MATCHED; - break; - - case exactn: - /* Match the next few pattern characters exactly. - mcnt is how many characters to match. */ - mcnt = *p++; - /* This is written out as an if-else so we don't waste time - testing `translate' inside the loop. */ - if (TRANSLATE_P()) { - do { - unsigned char c; - - PREFETCH; - if (*p == 0xff) { - p++; - if (!--mcnt - || AT_STRINGS_END(d) - || (unsigned char)*d++ != (unsigned char)*p++) - goto fail; - continue; - } - c = *d++; - if (ismbchar(c)) { - int n; - - if (c != (unsigned char)*p++) - goto fail; - for (n = mbclen(c) - 1; n > 0; n--) - if (!--mcnt /* redundant check if pattern was - compiled properly. */ - || AT_STRINGS_END(d) - || (unsigned char)*d++ != (unsigned char)*p++) - goto fail; - continue; - } - /* compiled code translation needed for ruby */ - if ((unsigned char)translate[c] != (unsigned char)translate[*p++]) - goto fail; - } - while (--mcnt); - } - else { - do { - PREFETCH; - if (*p == 0xff) {p++; mcnt--;} - if (*d++ != *p++) goto fail; - } - while (--mcnt); - } - SET_REGS_MATCHED; - break; - } -#ifdef RUBY - CHECK_INTS; -#endif - continue; /* Successfully executed one pattern command; keep going. */ - - /* Jump here if any matching operation fails. */ - fail: - if (stackp != stackb) { - /* A restart point is known. Restart there and pop it. */ - short last_used_reg, this_reg; - - /* If this failure point is from a dummy_failure_point, just - skip it. */ - if (stackp[-4] == 0 || (best_regs_set && stackp[-1] == NON_GREEDY)) { - POP_FAILURE_POINT(); - goto fail; - } - stackp--; /* discard greedy flag */ - options = (long)*--stackp; - d = *--stackp; - p = *--stackp; - /* Restore register info. */ - last_used_reg = (long)*--stackp; - - /* Make the ones that weren't saved -1 or 0 again. */ - for (this_reg = num_regs - 1; this_reg > last_used_reg; this_reg--) { - regend[this_reg] = REG_UNSET_VALUE; - regstart[this_reg] = REG_UNSET_VALUE; - IS_ACTIVE(reg_info[this_reg]) = 0; - MATCHED_SOMETHING(reg_info[this_reg]) = 0; - } - - /* And restore the rest from the stack. */ - for ( ; this_reg > 0; this_reg--) { - reg_info[this_reg].word = *--stackp; - regend[this_reg] = *--stackp; - regstart[this_reg] = *--stackp; - } - mcnt = (long)*--stackp; - while (mcnt--) { - POP_FAILURE_COUNT(); - } - if (p < pend) { - int is_a_jump_n = 0; - int failed_paren = 0; - - p1 = p; - /* If failed to a backwards jump that's part of a repetition - loop, need to pop this failure point and use the next one. */ - switch ((enum regexpcode)*p1) { - case jump_n: - case finalize_push_n: - is_a_jump_n = 1; - case maybe_finalize_jump: - case finalize_jump: - case finalize_push: - case jump: - p1++; - EXTRACT_NUMBER_AND_INCR(mcnt, p1); - - if (mcnt >= 0) break; /* should be backward jump */ - p1 += mcnt; - - if (( is_a_jump_n && (enum regexpcode)*p1 == succeed_n) || - (!is_a_jump_n && (enum regexpcode)*p1 == on_failure_jump)) { - if (failed_paren) { - p1++; - EXTRACT_NUMBER_AND_INCR(mcnt, p1); - PUSH_FAILURE_POINT(p1 + mcnt, d); - } - goto fail; - } - break; - default: - /* do nothing */; - } - } - } - else - break; /* Matching at this starting point really fails. */ - } - - if (best_regs_set) - goto restore_best_regs; - - FREE_AND_RETURN(stackb,(-1)); /* Failure to match. */ - memory_exhausted: - FREE_AND_RETURN(stackb,(-2)); -} - - -static int -memcmp_translate(s1, s2, len) - unsigned char *s1, *s2; - register int len; -{ - register unsigned char *p1 = s1, *p2 = s2, c; - while (len) { - c = *p1++; - if (ismbchar(c)) { - int n; - - if (c != *p2++) return 1; - for (n = mbclen(c) - 1; n > 0; n--) - if (!--len || *p1++ != *p2++) - return 1; - } - else - if (translate[c] != translate[*p2++]) - return 1; - len--; - } - return 0; -} - -void -re_copy_registers(regs1, regs2) - struct re_registers *regs1, *regs2; -{ - int i; - - if (regs1 == regs2) return; - if (regs1->allocated == 0) { - regs1->beg = TMALLOC(regs2->num_regs, int); - regs1->end = TMALLOC(regs2->num_regs, int); - regs1->allocated = regs2->num_regs; - } - else if (regs1->allocated < regs2->num_regs) { - TREALLOC(regs1->beg, regs2->num_regs, int); - TREALLOC(regs1->end, regs2->num_regs, int); - regs1->allocated = regs2->num_regs; - } - for (i=0; inum_regs; i++) { - regs1->beg[i] = regs2->beg[i]; - regs1->end[i] = regs2->end[i]; - } - regs1->num_regs = regs2->num_regs; -} - -void -re_free_registers(regs) - struct re_registers *regs; -{ - if (regs->allocated == 0) return; - if (regs->beg) xfree(regs->beg); - if (regs->end) xfree(regs->end); -} - -/* Functions for multi-byte support. - Created for grep multi-byte extension Jul., 1993 by t^2 (Takahiro Tanimoto) - Last change: Jul. 9, 1993 by t^2 */ -static const unsigned char mbctab_ascii[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - -static const unsigned char mbctab_euc[] = { /* 0xA1-0xFE */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, -}; - -static const unsigned char mbctab_sjis[] = { /* 0x81-0x9F,0xE0-0xFC */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 -}; - -static const unsigned char mbctab_sjis_trail[] = { /* 0x40-0x7E,0x80-0xFC */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 -}; - -static const unsigned char mbctab_utf8[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 0, 0, -}; - -const unsigned char *re_mbctab = mbctab_ascii; - -void -re_mbcinit(mbctype) - int mbctype; -{ - switch (mbctype) { - case MBCTYPE_ASCII: - re_mbctab = mbctab_ascii; - current_mbctype = MBCTYPE_ASCII; - break; - case MBCTYPE_EUC: - re_mbctab = mbctab_euc; - current_mbctype = MBCTYPE_EUC; - break; - case MBCTYPE_SJIS: - re_mbctab = mbctab_sjis; - current_mbctype = MBCTYPE_SJIS; - break; - case MBCTYPE_UTF8: - re_mbctab = mbctab_utf8; - current_mbctype = MBCTYPE_UTF8; - break; - } -} - -#define mbc_isfirst(t, c) (t)[(unsigned char)(c)] -#define mbc_len(t, c) ((t)[(unsigned char)(c)]+1) - -static unsigned int -asc_startpos(string, pos) - const char *string; - unsigned int pos; -{ - return pos; -} - -#define euc_islead(c) ((unsigned char)((c) - 0xa1) > 0xfe - 0xa1) -#define euc_mbclen(c) mbc_len(mbctab_euc, (c)) -static unsigned int -euc_startpos(string, pos) - const char *string; - unsigned int pos; -{ - unsigned int i = pos, w; - - while (i > 0 && !euc_islead(string[i])) { - --i; - } - if (i == pos || i + (w = euc_mbclen(string[i])) > pos) { - return i; - } - i += w; - return i + ((pos - i) & ~1); -} - -#define sjis_isfirst(c) mbc_isfirst(mbctab_sjis, (c)) -#define sjis_istrail(c) mbctab_sjis_trail[(unsigned char)(c)] -#define sjis_mbclen(c) mbc_len(mbctab_sjis, (c)) -static unsigned int -sjis_startpos(string, pos) - const char *string; - unsigned int pos; -{ - unsigned int i = pos, w; - - if (i > 0 && sjis_istrail(string[i])) { - do { - if (!sjis_isfirst(string[--i])) { - ++i; - break; - } - } while (i > 0); - } - if (i == pos || i + (w = sjis_mbclen(string[i])) > pos) { - return i; - } - i += w; - return i + ((pos - i) & ~1); -} - -#define utf8_islead(c) ((unsigned char)((c) & 0xc0) != 0x80) -#define utf8_mbclen(c) mbc_len(mbctab_utf8, (c)) -static unsigned int -utf8_startpos(string, pos) - const char *string; - unsigned int pos; -{ - unsigned int i = pos, w; - - while (i > 0 && !utf8_islead(string[i])) { - --i; - } - if (i == pos || i + (w = utf8_mbclen(string[i])) > pos) { - return i; - } - return i + w; -} - -/* - vi: sw=2 ts=8 - Local variables: - mode : C - c-file-style : "gnu" - tab-width : 8 - End -*/ -/********************************************************************** - - ruby.c - - - $Author: shyouhei $ - $Date: 2008-07-10 11:36:08 +0200 (Thu, 10 Jul 2008) $ - created at: Tue Aug 10 12:47:31 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#if defined _WIN32 || defined __CYGWIN__ -#include -#endif -#if defined __CYGWIN__ -#include -#endif -#ifdef _WIN32_WCE -#include -#include "wince.h" -#endif -#include "ruby.h" -#include "dln.h" -#include "node.h" -#include -#include -#include - -#ifdef __hpux -#include -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifndef HAVE_STRING_H -char *strchr _((const char*,const char)); -char *strrchr _((const char*,const char)); -char *strstr _((const char*,const char*)); -#endif - -#include "util.h" - -#ifndef HAVE_STDLIB_H -char *getenv(); -#endif - -VALUE ruby_debug = Qfalse; -VALUE ruby_verbose = Qfalse; -static int sflag = 0; -static int xflag = 0; -extern int ruby_yydebug; - -char *ruby_inplace_mode = Qfalse; - -static void load_stdin _((void)); -static void load_file _((const char *, int)); -static void forbid_setid _((const char *)); - -static VALUE do_loop = Qfalse, do_print = Qfalse; -static VALUE do_check = Qfalse, do_line = Qfalse; -static VALUE do_split = Qfalse; - -static char *script; - -static int origargc; -static char **origargv; - -static void -usage(name) - const char *name; -{ - /* This message really ought to be max 23 lines. - * Removed -h because the user already knows that option. Others? */ - - static char *usage_msg[] = { -"-0[octal] specify record separator (\\0, if no argument)", -"-a autosplit mode with -n or -p (splits $_ into $F)", -"-c check syntax only", -"-Cdirectory cd to directory, before executing your script", -"-d set debugging flags (set $DEBUG to true)", -"-e 'command' one line of script. Several -e's allowed. Omit [programfile]", -"-Fpattern split() pattern for autosplit (-a)", -"-i[extension] edit ARGV files in place (make backup if extension supplied)", -"-Idirectory specify $LOAD_PATH directory (may be used more than once)", -"-Kkcode specifies KANJI (Japanese) code-set", -"-l enable line ending processing", -"-n assume 'while gets(); ... end' loop around your script", -"-p assume loop like -n but print line also like sed", -"-rlibrary require the library, before executing your script", -"-s enable some switch parsing for switches after script name", -"-S look for the script using PATH environment variable", -"-T[level] turn on tainting checks", -"-v print version number, then turn on verbose mode", -"-w turn warnings on for your script", -"-W[level] set warning level; 0=silence, 1=medium, 2=verbose (default)", -"-x[directory] strip off text before #!ruby line and perhaps cd to directory", -"--copyright print the copyright", -"--version print the version", -NULL -}; - char **p = usage_msg; - - printf("Usage: %s [switches] [--] [programfile] [arguments]\n", name); - while (*p) - printf(" %s\n", *p++); -} - -extern VALUE rb_load_path; - -#ifndef CharNext /* defined as CharNext[AW] on Windows. */ -#define CharNext(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE)) -#endif - -#if defined DOSISH || defined __CYGWIN__ -static inline void -translate_char(char *p, int from, int to) -{ - while (*p) { - if ((unsigned char)*p == from) - *p = to; - p = CharNext(p); - } -} -#endif - -#if defined _WIN32 || defined __CYGWIN__ || defined __DJGPP__ -static VALUE -rubylib_mangled_path(const char *s, unsigned int l) -{ - static char *newp, *oldp; - static int newl, oldl, notfound; - char *ptr; - VALUE ret; - - if (!newp && !notfound) { - newp = getenv("RUBYLIB_PREFIX"); - if (newp) { - oldp = newp = strdup(newp); - while (*newp && !ISSPACE(*newp) && *newp != ';') { - newp = CharNext(newp); /* Skip digits. */ - } - oldl = newp - oldp; - while (*newp && (ISSPACE(*newp) || *newp == ';')) { - newp = CharNext(newp); /* Skip whitespace. */ - } - newl = strlen(newp); - if (newl == 0 || oldl == 0) { - rb_fatal("malformed RUBYLIB_PREFIX"); - } - translate_char(newp, '\\', '/'); - } - else { - notfound = 1; - } - } - if (!newp || l < oldl || strncasecmp(oldp, s, oldl) != 0) { - return rb_str_new(s, l); - } - ret = rb_str_new(0, l + newl - oldl); - ptr = RSTRING_PTR(ret); - memcpy(ptr, newp, newl); - memcpy(ptr + newl, s + oldl, l - oldl); - ptr[l + newl - oldl] = 0; - return ret; -} - -static VALUE -rubylib_mangled_path2(const char *s) -{ - return rubylib_mangled_path(s, strlen(s)); -} -#else -#define rubylib_mangled_path rb_str_new -#define rubylib_mangled_path2 rb_str_new2 -#endif - -static void push_include _((const char *path)); - -static void -push_include(path) - const char *path; -{ - const char sep = PATH_SEP_CHAR; - const char *p, *s; - - p = path; - while (*p) { - while (*p == sep) - p++; - if (!*p) break; - for (s = p; *s && *s != sep; s = CharNext(s)); - rb_ary_push(rb_load_path, rubylib_mangled_path(p, s - p)); - p = s; - } -} - -#ifdef __CYGWIN__ -static void -push_include_cygwin(const char *path) -{ - const char *p, *s; - char rubylib[FILENAME_MAX]; - VALUE buf = 0; - - p = path; - while (*p) { - unsigned int len; - while (*p == ';') - p++; - if (!*p) break; - for (s = p; *s && *s != ';'; s = CharNext(s)); - len = s - p; - if (*s) { - if (!buf) { - buf = rb_str_new(p, len); - p = RSTRING_PTR(buf); - } - else { - rb_str_resize(buf, len); - p = strncpy(RSTRING_PTR(buf), p, len); - } - } - if (cygwin_conv_to_posix_path(p, rubylib) == 0) - p = rubylib; - push_include(p); - if (!*s) break; - p = s + 1; - } -} - -#define push_include push_include_cygwin -#endif - -void -ruby_incpush(path) - const char *path; -{ - if (path == 0) - return; - push_include(path); -} - -#if defined DOSISH || defined __CYGWIN__ -#define LOAD_RELATIVE 1 -#endif - -void -ruby_init_loadpath() -{ -#if defined LOAD_RELATIVE - char libpath[FILENAME_MAX+1]; - char *p; - int rest; -#if defined _WIN32 || defined __CYGWIN__ - HMODULE libruby = NULL; - MEMORY_BASIC_INFORMATION m; - -#ifndef _WIN32_WCE - memset(&m, 0, sizeof(m)); - if (VirtualQuery(ruby_init_loadpath, &m, sizeof(m)) && m.State == MEM_COMMIT) - libruby = (HMODULE)m.AllocationBase; -#endif - GetModuleFileName(libruby, libpath, sizeof libpath); -#elif defined(DJGPP) - extern char *__dos_argv0; - strncpy(libpath, __dos_argv0, FILENAME_MAX); -#elif defined(__human68k__) - extern char **_argv; - strncpy(libpath, _argv[0], FILENAME_MAX); -#elif defined(__EMX__) - _execname(libpath, FILENAME_MAX); -#endif - - libpath[FILENAME_MAX] = '\0'; -#if defined DOSISH - translate_char(libpath, '\\', '/'); -#elif defined __CYGWIN__ - { - char rubylib[FILENAME_MAX]; - cygwin_conv_to_posix_path(libpath, rubylib); - strncpy(libpath, rubylib, sizeof(libpath)); - } -#endif - p = strrchr(libpath, '/'); - if (p) { - *p = 0; - if (p - libpath > 3 && !strcasecmp(p - 4, "/bin")) { - p -= 4; - *p = 0; - } - } - else { - strcpy(libpath, "."); - p = libpath + 1; - } - - rest = FILENAME_MAX - (p - libpath); - -#define RUBY_RELATIVE(path) (strncpy(p, (path), rest), libpath) -#else -#define RUBY_RELATIVE(path) (path) -#endif -#define incpush(path) rb_ary_push(rb_load_path, rubylib_mangled_path2(path)) - - if (rb_safe_level() == 0) { - ruby_incpush(getenv("RUBYLIB")); - } - -#ifdef RUBY_SEARCH_PATH - incpush(RUBY_RELATIVE(RUBY_SEARCH_PATH)); -#endif - - incpush(RUBY_RELATIVE(RUBY_SITE_LIB2)); -#ifdef RUBY_SITE_THIN_ARCHLIB - incpush(RUBY_RELATIVE(RUBY_SITE_THIN_ARCHLIB)); -#endif - incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB)); - incpush(RUBY_RELATIVE(RUBY_SITE_LIB)); - - incpush(RUBY_RELATIVE(RUBY_LIB)); -#ifdef RUBY_THIN_ARCHLIB - incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB)); -#endif - incpush(RUBY_RELATIVE(RUBY_ARCHLIB)); - - if (rb_safe_level() == 0) { - incpush("."); - } -} - -struct req_list { - char *name; - struct req_list *next; -}; -static struct req_list req_list_head, *req_list_last = &req_list_head; - -static void -add_modules(mod) - const char *mod; -{ - struct req_list *list; - - list = ALLOC(struct req_list); - list->name = ALLOC_N(char, strlen(mod)+1); - strcpy(list->name, mod); - list->next = 0; - req_list_last->next = list; - req_list_last = list; -} - -extern void Init_ext _((void)); - -static void -require_libraries() -{ - extern NODE *ruby_eval_tree; - extern NODE *ruby_eval_tree_begin; - NODE *save[3]; - struct req_list *list = req_list_head.next; - struct req_list *tmp; - - save[0] = ruby_eval_tree; - save[1] = ruby_eval_tree_begin; - save[2] = NEW_NEWLINE(0); - ruby_eval_tree = ruby_eval_tree_begin = 0; - ruby_current_node = 0; - Init_ext(); /* should be called here for some reason :-( */ - ruby_current_node = save[2]; - ruby_set_current_source(); - req_list_last = 0; - while (list) { - int state; - - ruby_current_node = 0; - rb_protect((VALUE (*)(VALUE))rb_require, (VALUE)list->name, &state); - if (state) rb_jump_tag(state); - tmp = list->next; - free(list->name); - free(list); - list = tmp; - ruby_current_node = save[2]; - ruby_set_current_source(); - } - req_list_head.next = 0; - ruby_eval_tree = save[0]; - ruby_eval_tree_begin = save[1]; - rb_gc_force_recycle((VALUE)save[2]); - ruby_current_node = 0; -} - -static void -process_sflag() -{ - if (sflag) { - long n; - VALUE *args; - - n = RARRAY(rb_argv)->len; - args = RARRAY(rb_argv)->ptr; - while (n > 0) { - VALUE v = *args++; - char *s = StringValuePtr(v); - char *p; - int hyphen = Qfalse; - - if (s[0] != '-') break; - n--; - if (s[1] == '-' && s[2] == '\0') break; - - v = Qtrue; - /* check if valid name before replacing - with _ */ - for (p = s + 1; *p; p++) { - if (*p == '=') { - *p++ = '\0'; - v = rb_str_new2(p); - break; - } - if (*p == '-') { - hyphen = Qtrue; - } - else if (*p != '_' && !ISALNUM(*p)) { - VALUE name_error[2]; - name_error[0] = rb_str_new2("invalid name for global variable - "); - if (!(p = strchr(p, '='))) { - rb_str_cat2(name_error[0], s); - } - else { - rb_str_cat(name_error[0], s, p - s); - } - name_error[1] = args[-1]; - rb_exc_raise(rb_class_new_instance(2, name_error, rb_eNameError)); - } - } - s[0] = '$'; - if (hyphen) { - for (p = s + 1; *p; ++p) { - if (*p == '-') *p = '_'; - } - } - rb_gv_set(s, v); - } - n = RARRAY(rb_argv)->len - n; - while (n--) { - rb_ary_shift(rb_argv); - } - } - sflag = 0; -} - -static void proc_options _((int argc, char **argv)); - -static char* -moreswitches(s) - char *s; -{ - int argc; char *argv[3]; - char *p = s; - - argc = 2; argv[0] = argv[2] = 0; - while (*s && !ISSPACE(*s)) - s++; - argv[1] = ALLOCA_N(char, s-p+2); - argv[1][0] = '-'; - strncpy(argv[1]+1, p, s-p); - argv[1][s-p+1] = '\0'; - proc_options(argc, argv); - while (*s && ISSPACE(*s)) - s++; - return s; -} - -static void -proc_options(argc, argv) - int argc; - char **argv; -{ - char *argv0 = argv[0]; - int do_search; - char *s; - NODE *volatile script_node = 0; - - int version = 0; - int copyright = 0; - int verbose = 0; - VALUE e_script = Qfalse; - - if (argc == 0) return; - - do_search = Qfalse; - - for (argc--,argv++; argc > 0; argc--,argv++) { - if (argv[0][0] != '-' || !argv[0][1]) break; - - s = argv[0]+1; - reswitch: - switch (*s) { - case 'a': - do_split = Qtrue; - s++; - goto reswitch; - - case 'p': - do_print = Qtrue; - /* through */ - case 'n': - do_loop = Qtrue; - s++; - goto reswitch; - - case 'd': - ruby_debug = Qtrue; - ruby_verbose = Qtrue; - s++; - goto reswitch; - - case 'y': - ruby_yydebug = 1; - s++; - goto reswitch; - - case 'v': - if (argv0 == 0 || verbose) { - s++; - goto reswitch; - } - ruby_show_version(); - verbose = 1; - case 'w': - ruby_verbose = Qtrue; - s++; - goto reswitch; - - case 'W': - { - int numlen; - int v = 2; /* -W as -W2 */ - - if (*++s) { - v = scan_oct(s, 1, &numlen); - if (numlen == 0) v = 1; - s += numlen; - } - switch (v) { - case 0: - ruby_verbose = Qnil; break; - case 1: - ruby_verbose = Qfalse; break; - default: - ruby_verbose = Qtrue; break; - } - } - goto reswitch; - - case 'c': - do_check = Qtrue; - s++; - goto reswitch; - - case 's': - forbid_setid("-s"); - sflag = 1; - s++; - goto reswitch; - - case 'h': - usage(origargv[0]); - exit(0); - - case 'l': - do_line = Qtrue; - rb_output_rs = rb_rs; - s++; - goto reswitch; - - case 'S': - forbid_setid("-S"); - do_search = Qtrue; - s++; - goto reswitch; - - case 'e': - forbid_setid("-e"); - if (!*++s) { - s = argv[1]; - argc--,argv++; - } - if (!s) { - fprintf(stderr, "%s: no code specified for -e\n", origargv[0]); - exit(2); - } - if (!e_script) { - e_script = rb_str_new(0,0); - if (script == 0) script = "-e"; - } - rb_str_cat2(e_script, s); - rb_str_cat2(e_script, "\n"); - break; - - case 'r': - forbid_setid("-r"); - if (*++s) { - add_modules(s); - } - else if (argv[1]) { - add_modules(argv[1]); - argc--,argv++; - } - break; - - case 'i': - forbid_setid("-i"); - if (ruby_inplace_mode) free(ruby_inplace_mode); - ruby_inplace_mode = strdup(s+1); - break; - - case 'x': - xflag = Qtrue; - s++; - if (*s && chdir(s) < 0) { - rb_fatal("Can't chdir to %s", s); - } - break; - - case 'C': - case 'X': - s++; - if (!*s) { - s = argv[1]; - argc--,argv++; - } - if (!s || !*s) { - rb_fatal("Can't chdir"); - } - if (chdir(s) < 0) { - rb_fatal("Can't chdir to %s", s); - } - break; - - case 'F': - if (*++s) { - rb_fs = rb_reg_new(s, strlen(s), 0); - } - break; - - case 'K': - if (*++s) { - rb_set_kcode(s); - s++; - } - goto reswitch; - - case 'T': - { - int numlen; - int v = 1; - - if (*++s) { - v = scan_oct(s, 2, &numlen); - if (numlen == 0) v = 1; - s += numlen; - } - rb_set_safe_level(v); - } - goto reswitch; - - case 'I': - forbid_setid("-I"); - if (*++s) - ruby_incpush(s); - else if (argv[1]) { - ruby_incpush(argv[1]); - argc--,argv++; - } - break; - - case '0': - { - int numlen; - int v; - char c; - - v = scan_oct(s, 4, &numlen); - s += numlen; - if (v > 0377) rb_rs = Qnil; - else if (v == 0 && numlen >= 2) { - rb_rs = rb_str_new2("\n\n"); - } - else { - c = v & 0xff; - rb_rs = rb_str_new(&c, 1); - } - } - goto reswitch; - - case '-': - if (!s[1] || (s[1] == '\r' && !s[2])) { - argc--,argv++; - goto switch_end; - } - s++; - if (strcmp("copyright", s) == 0) - copyright = 1; - else if (strcmp("debug", s) == 0) { - ruby_debug = Qtrue; - ruby_verbose = Qtrue; - } - else if (strcmp("version", s) == 0) - version = 1; - else if (strcmp("verbose", s) == 0) { - verbose = 1; - ruby_verbose = Qtrue; - } - else if (strcmp("yydebug", s) == 0) - ruby_yydebug = 1; - else if (strcmp("help", s) == 0) { - usage(origargv[0]); - exit(0); - } - else { - fprintf(stderr, "%s: invalid option --%s (-h will show valid options)\n", - origargv[0], s); - exit(2); - } - break; - - case '\r': - if (!s[1]) break; - - default: - { - const char *format; - if (ISPRINT(*s)) { - format = "%s: invalid option -%c (-h will show valid options)\n"; - } - else { - format = "%s: invalid option -\\%03o (-h will show valid options)\n"; - } - fprintf(stderr, format, origargv[0], (int)(unsigned char)*s); - } - exit(2); - - case 0: - break; - } - } - - switch_end: - if (argv0 == 0) return; - - if (rb_safe_level() == 0 && (s = getenv("RUBYOPT"))) { - while (ISSPACE(*s)) s++; - if (*s == 'T' || (*s == '-' && *(s+1) == 'T')) { - int numlen; - int v = 1; - - if (*s != 'T') ++s; - if (*++s) { - v = scan_oct(s, 2, &numlen); - if (numlen == 0) v = 1; - } - rb_set_safe_level(v); - } - else { - while (s && *s) { - if (*s == '-') { - s++; - if (ISSPACE(*s)) { - do {s++;} while (ISSPACE(*s)); - continue; - } - } - if (!*s) break; - if (!strchr("IdvwWrK", *s)) - rb_raise(rb_eRuntimeError, "illegal switch in RUBYOPT: -%c", *s); - s = moreswitches(s); - } - } - } - - if (version) { - ruby_show_version(); - exit(0); - } - if (copyright) { - ruby_show_copyright(); - } - - if (rb_safe_level() >= 4) { - OBJ_TAINT(rb_argv); - OBJ_TAINT(rb_load_path); - } - - if (!e_script) { - if (argc == 0) { /* no more args */ - if (verbose) exit(0); - script = "-"; - } - else { - script = argv[0]; - if (script[0] == '\0') { - script = "-"; - } - else if (do_search) { - char *path = getenv("RUBYPATH"); - - script = 0; - if (path) { - script = dln_find_file(argv[0], path); - } - if (!script) { - script = dln_find_file(argv[0], getenv(PATH_ENV)); - } - if (!script) script = argv[0]; - script = ruby_sourcefile = rb_source_filename(script); - script_node = NEW_NEWLINE(0); - } -#if defined DOSISH || defined __CYGWIN__ - translate_char(script, '\\', '/'); -#endif - argc--; argv++; - } - } - - ruby_script(script); - ruby_set_argv(argc, argv); - process_sflag(); - - ruby_init_loadpath(); - ruby_sourcefile = rb_source_filename(argv0); - if (e_script) { - require_libraries(); - rb_compile_string(script, e_script, 1); - } - else if (strlen(script) == 1 && script[0] == '-') { - load_stdin(); - } - else { - load_file(script, 1); - } - - process_sflag(); - xflag = 0; - - if (rb_safe_level() >= 4) { - FL_UNSET(rb_argv, FL_TAINT); - FL_UNSET(rb_load_path, FL_TAINT); - } -} - -extern int ruby__end__seen; - -static void -load_file(fname, script) - const char *fname; - int script; -{ - extern VALUE rb_stdin; - VALUE f; - int line_start = 1; - - if (!fname) rb_load_fail(fname); - if (strcmp(fname, "-") == 0) { - f = rb_stdin; - } - else { - FILE *fp = fopen(fname, "r"); - - if (fp == NULL) { - rb_load_fail(fname); - } - fclose(fp); - - f = rb_file_open(fname, "r"); -#if defined DOSISH || defined __CYGWIN__ - { - char *ext = strrchr(fname, '.'); - if (ext && strcasecmp(ext, ".exe") == 0) - rb_io_binmode(f); - } -#endif - } - - if (script) { - VALUE c = 1; /* something not nil */ - VALUE line; - char *p; - - if (xflag) { - forbid_setid("-x"); - xflag = Qfalse; - while (!NIL_P(line = rb_io_gets(f))) { - line_start++; - if (RSTRING(line)->len > 2 - && RSTRING(line)->ptr[0] == '#' - && RSTRING(line)->ptr[1] == '!') { - if ((p = strstr(RSTRING(line)->ptr, "ruby")) != 0) { - goto start_read; - } - } - } - rb_raise(rb_eLoadError, "no Ruby script found in input"); - } - - c = rb_io_getc(f); - if (c == INT2FIX('#')) { - line = rb_io_gets(f); - if (NIL_P(line)) return; - line_start++; - - if (RSTRING(line)->len > 2 && RSTRING(line)->ptr[0] == '!') { - if ((p = strstr(RSTRING(line)->ptr, "ruby")) == 0) { - /* not ruby script, kick the program */ - char **argv; - char *path; - char *pend = RSTRING(line)->ptr + RSTRING(line)->len; - - p = RSTRING(line)->ptr + 1; /* skip `#!' */ - if (pend[-1] == '\n') pend--; /* chomp line */ - if (pend[-1] == '\r') pend--; - *pend = '\0'; - while (p < pend && ISSPACE(*p)) - p++; - path = p; /* interpreter path */ - while (p < pend && !ISSPACE(*p)) - p++; - *p++ = '\0'; - if (p < pend) { - argv = ALLOCA_N(char*, origargc+3); - argv[1] = p; - MEMCPY(argv+2, origargv+1, char*, origargc); - } - else { - argv = origargv; - } - argv[0] = path; - execv(path, argv); - - ruby_sourcefile = rb_source_filename(fname); - ruby_sourceline = 1; - rb_fatal("Can't exec %s", path); - } - - start_read: - p += 4; - RSTRING(line)->ptr[RSTRING(line)->len-1] = '\0'; - if (RSTRING(line)->ptr[RSTRING(line)->len-2] == '\r') - RSTRING(line)->ptr[RSTRING(line)->len-2] = '\0'; - if ((p = strstr(p, " -")) != 0) { - p++; /* skip space before `-' */ - while (*p == '-') { - p = moreswitches(p+1); - } - } - } - } - else if (!NIL_P(c)) { - rb_io_ungetc(f, c); - } - require_libraries(); /* Why here? unnatural */ - if (NIL_P(c)) return; - } - rb_compile_file(fname, f, line_start); - if (script && ruby__end__seen) { - rb_define_global_const("DATA", f); - } - else if (f != rb_stdin) { - rb_io_close(f); - } - - if (ruby_parser_stack_on_heap()) { - rb_gc(); - } -} - -void -rb_load_file(fname) - const char *fname; -{ - load_file(fname, 0); -} - -static void -load_stdin() -{ - forbid_setid("program input from stdin"); - load_file("-", 1); -} - -VALUE rb_progname; -VALUE rb_argv; -VALUE rb_argv0; - -#if defined(PSTAT_SETCMD) || defined(HAVE_SETPROCTITLE) -#elif defined(_WIN32) -#elif defined(HAVE_SETENV) && defined(HAVE_UNSETENV) -#else -#define USE_ENVSPACE_FOR_ARG0 -#endif - -#ifdef USE_ENVSPACE_FOR_ARG0 -static struct { - char *begin, *end; -} envspace; -extern char **environ; - -static void -set_arg0space() -{ - char *s; - int i; - - if (!environ || (s = environ[0]) == NULL) return; - envspace.begin = s; - s += strlen(s); - for (i = 1; environ[i]; i++) { - if (environ[i] == s + 1) { - s++; - s += strlen(s); /* this one is ok too */ - } - } - envspace.end = s; -} -#else -#define set_arg0space() ((void)0) -#endif - -static int -get_arglen(int argc, char **argv) -{ - char *s = argv[0]; - int i; - - if (!argc) return 0; - s += strlen(s); - /* See if all the arguments are contiguous in memory */ - for (i = 1; i < argc; i++) { - if (argv[i] == s + 1) { - s++; - s += strlen(s); /* this one is ok too */ - } - else { - break; - } - } -#if defined(USE_ENVSPACE_FOR_ARG0) - if (environ && (s == environ[0])) { - s += strlen(s); - for (i = 1; environ[i]; i++) { - if (environ[i] == s + 1) { - s++; - s += strlen(s); /* this one is ok too */ - } - } - ruby_setenv("", NULL); /* duplicate environ vars */ - } -#endif - return s - argv[0]; -} - -static void -set_arg0(val, id) - VALUE val; - ID id; -{ - VALUE progname; - char *s; - long i; - int j; -#if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE) - static int len = 0; -#endif - - if (origargv == 0) rb_raise(rb_eRuntimeError, "$0 not initialized"); - StringValue(val); - s = RSTRING(val)->ptr; - i = RSTRING(val)->len; -#if defined(PSTAT_SETCMD) - if (i >= PST_CLEN) { - union pstun j; - j.pst_command = s; - i = PST_CLEN; - RSTRING(val)->len = i; - *(s + i) = '\0'; - pstat(PSTAT_SETCMD, j, PST_CLEN, 0, 0); - } - else { - union pstun j; - j.pst_command = s; - pstat(PSTAT_SETCMD, j, i, 0, 0); - } - progname = rb_tainted_str_new(s, i); -#elif defined(HAVE_SETPROCTITLE) - setproctitle("%.*s", (int)i, s); - progname = rb_tainted_str_new(s, i); -#else - if (len == 0) { - len = get_arglen(origargc, origargv); - } - - if (i >= len) { - i = len; - } - memcpy(origargv[0], s, i); - s = origargv[0] + i; - *s = '\0'; - if (++i < len) memset(s + 1, ' ', len - i); - for (i = len-1, j = origargc-1; j > 0 && i >= 0; --i, --j) { - origargv[j] = origargv[0] + i; - *origargv[j] = '\0'; - } - progname = rb_tainted_str_new2(origargv[0]); -#endif - rb_progname = rb_obj_freeze(progname); -} - -void -ruby_script(name) - const char *name; -{ - if (name) { - rb_progname = rb_obj_freeze(rb_tainted_str_new2(name)); - ruby_sourcefile = rb_source_filename(name); - } -} - -static int uid, euid, gid, egid; - -static void -init_ids() -{ - uid = (int)getuid(); - euid = (int)geteuid(); - gid = (int)getgid(); - egid = (int)getegid(); -#ifdef VMS - uid |= gid << 16; - euid |= egid << 16; -#endif - if (uid && (euid != uid || egid != gid)) { - rb_set_safe_level(1); - } -} - -static void -forbid_setid(s) - const char *s; -{ - if (euid != uid) - rb_raise(rb_eSecurityError, "no %s allowed while running setuid", s); - if (egid != gid) - rb_raise(rb_eSecurityError, "no %s allowed while running setgid", s); - if (rb_safe_level() > 0) - rb_raise(rb_eSecurityError, "no %s allowed in tainted mode", s); -} - -static void -verbose_setter(val, id, variable) - VALUE val; - ID id; - VALUE *variable; -{ - ruby_verbose = RTEST(val) ? Qtrue : val; -} - -void -ruby_prog_init() -{ - init_ids(); - - ruby_sourcefile = rb_source_filename("ruby"); - rb_define_hooked_variable("$VERBOSE", &ruby_verbose, 0, verbose_setter); - rb_define_hooked_variable("$-v", &ruby_verbose, 0, verbose_setter); - rb_define_hooked_variable("$-w", &ruby_verbose, 0, verbose_setter); - rb_define_variable("$DEBUG", &ruby_debug); - rb_define_variable("$-d", &ruby_debug); - rb_define_readonly_variable("$-p", &do_print); - rb_define_readonly_variable("$-l", &do_line); - - rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0); - rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0); - - rb_define_readonly_variable("$*", &rb_argv); - rb_argv = rb_ary_new(); - rb_define_global_const("ARGV", rb_argv); - rb_define_readonly_variable("$-a", &do_split); - rb_global_variable(&rb_argv0); - -#ifdef MSDOS - /* - * There is no way we can refer to them from ruby, so close them to save - * space. - */ - (void)fclose(stdaux); - (void)fclose(stdprn); -#endif -} - -void -ruby_set_argv(argc, argv) - int argc; - char **argv; -{ - int i; - -#if defined(USE_DLN_A_OUT) - if (origargv) dln_argv0 = origargv[0]; - else dln_argv0 = argv[0]; -#endif - rb_ary_clear(rb_argv); - for (i=0; i < argc; i++) { - VALUE arg = rb_tainted_str_new2(argv[i]); - - OBJ_FREEZE(arg); - rb_ary_push(rb_argv, arg); - } -} - -void -ruby_process_options(argc, argv) - int argc; - char **argv; -{ - origargc = argc; origargv = argv; - - ruby_script(argv[0]); /* for the time being */ - rb_argv0 = rb_progname; -#if defined(USE_DLN_A_OUT) - dln_argv0 = argv[0]; -#endif - set_arg0space(); - proc_options(argc, argv); - - if (do_check && ruby_nerrs == 0) { - printf("Syntax OK\n"); - exit(0); - } - if (do_print) { - rb_parser_append_print(); - } - if (do_loop) { - rb_parser_while_loop(do_line, do_split); - } -} -/********************************************************************** - - signal.c - - - $Author: shyouhei $ - $Date: 2008-06-29 09:52:47 +0200 (Sun, 29 Jun 2008) $ - created at: Tue Dec 20 10:13:44 JST 1994 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#include "ruby.h" -#include "rubysig.h" -#include -#include - -#ifdef __BEOS__ -#undef SIGBUS -#endif - -#if defined HAVE_SIGPROCMASK || defined HAVE_SIGSETMASK -#define USE_TRAP_MASK 1 -#else -#define USE_TRAP_MASK 0 -#endif - -#ifndef NSIG -# ifdef DJGPP -# define NSIG SIGMAX -# else -# define NSIG (_SIGMAX + 1) /* For QNX */ -# endif -#endif - -static struct signals { - char *signm; - int signo; -} siglist [] = { - {"EXIT", 0}, -#ifdef SIGHUP - {"HUP", SIGHUP}, -#endif - {"INT", SIGINT}, -#ifdef SIGQUIT - {"QUIT", SIGQUIT}, -#endif -#ifdef SIGILL - {"ILL", SIGILL}, -#endif -#ifdef SIGTRAP - {"TRAP", SIGTRAP}, -#endif -#ifdef SIGIOT - {"IOT", SIGIOT}, -#endif -#ifdef SIGABRT - {"ABRT", SIGABRT}, -#endif -#ifdef SIGEMT - {"EMT", SIGEMT}, -#endif -#ifdef SIGFPE - {"FPE", SIGFPE}, -#endif -#ifdef SIGKILL - {"KILL", SIGKILL}, -#endif -#ifdef SIGBUS - {"BUS", SIGBUS}, -#endif -#ifdef SIGSEGV - {"SEGV", SIGSEGV}, -#endif -#ifdef SIGSYS - {"SYS", SIGSYS}, -#endif -#ifdef SIGPIPE - {"PIPE", SIGPIPE}, -#endif -#ifdef SIGALRM - {"ALRM", SIGALRM}, -#endif -#ifdef SIGTERM - {"TERM", SIGTERM}, -#endif -#ifdef SIGURG - {"URG", SIGURG}, -#endif -#ifdef SIGSTOP - {"STOP", SIGSTOP}, -#endif -#ifdef SIGTSTP - {"TSTP", SIGTSTP}, -#endif -#ifdef SIGCONT - {"CONT", SIGCONT}, -#endif -#ifdef SIGCHLD - {"CHLD", SIGCHLD}, -#endif -#ifdef SIGCLD - {"CLD", SIGCLD}, -#else -# ifdef SIGCHLD - {"CLD", SIGCHLD}, -# endif -#endif -#ifdef SIGTTIN - {"TTIN", SIGTTIN}, -#endif -#ifdef SIGTTOU - {"TTOU", SIGTTOU}, -#endif -#ifdef SIGIO - {"IO", SIGIO}, -#endif -#ifdef SIGXCPU - {"XCPU", SIGXCPU}, -#endif -#ifdef SIGXFSZ - {"XFSZ", SIGXFSZ}, -#endif -#ifdef SIGVTALRM - {"VTALRM", SIGVTALRM}, -#endif -#ifdef SIGPROF - {"PROF", SIGPROF}, -#endif -#ifdef SIGWINCH - {"WINCH", SIGWINCH}, -#endif -#ifdef SIGUSR1 - {"USR1", SIGUSR1}, -#endif -#ifdef SIGUSR2 - {"USR2", SIGUSR2}, -#endif -#ifdef SIGLOST - {"LOST", SIGLOST}, -#endif -#ifdef SIGMSG - {"MSG", SIGMSG}, -#endif -#ifdef SIGPWR - {"PWR", SIGPWR}, -#endif -#ifdef SIGPOLL - {"POLL", SIGPOLL}, -#endif -#ifdef SIGDANGER - {"DANGER", SIGDANGER}, -#endif -#ifdef SIGMIGRATE - {"MIGRATE", SIGMIGRATE}, -#endif -#ifdef SIGPRE - {"PRE", SIGPRE}, -#endif -#ifdef SIGGRANT - {"GRANT", SIGGRANT}, -#endif -#ifdef SIGRETRACT - {"RETRACT", SIGRETRACT}, -#endif -#ifdef SIGSOUND - {"SOUND", SIGSOUND}, -#endif -#ifdef SIGINFO - {"INFO", SIGINFO}, -#endif - {NULL, 0} -}; - -static int -signm2signo(nm) - const char *nm; -{ - struct signals *sigs; - - for (sigs = siglist; sigs->signm; sigs++) - if (strcmp(sigs->signm, nm) == 0) - return sigs->signo; - return 0; -} - -static char* -signo2signm(no) - int no; -{ - struct signals *sigs; - - for (sigs = siglist; sigs->signm; sigs++) - if (sigs->signo == no) - return sigs->signm; - return 0; -} - -const char * -ruby_signal_name(no) - int no; -{ - return signo2signm(no); -} - -/* - * call-seq: - * SignalException.new(sig) => signal_exception - * - * Construct a new SignalException object. +sig+ should be a known - * signal name, or a signal number. - */ - -static VALUE -esignal_init(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; -{ - int argnum = 1; - VALUE sig = Qnil; - int signo; - const char *signm; - char tmpnm[(sizeof(int)*CHAR_BIT)/3+4]; - - if (argc > 0) { - sig = argv[0]; - if (FIXNUM_P(sig)) argnum = 2; - } - if (argc < 1 || argnum < argc) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", - argc, argnum); - } - if (argnum == 2) { - signo = FIX2INT(sig); - if (signo < 0 || signo > NSIG) { - rb_raise(rb_eArgError, "invalid signal number (%d)", signo); - } - if (argc > 1) { - sig = argv[1]; - } - else { - signm = signo2signm(signo); - if (signm) { - snprintf(tmpnm, sizeof(tmpnm), "SIG%s", signm); - } - else { - snprintf(tmpnm, sizeof(tmpnm), "SIG%u", signo); - } - sig = rb_str_new2(signm = tmpnm); - } - } - else { - signm = SYMBOL_P(sig) ? rb_id2name(SYM2ID(sig)) : StringValuePtr(sig); - if (strncmp(signm, "SIG", 3) == 0) signm += 3; - signo = signm2signo(signm); - if (!signo) { - rb_raise(rb_eArgError, "unsupported name `SIG%s'", signm); - } - if (SYMBOL_P(sig)) { - sig = rb_str_new2(signm); - } - } - rb_call_super(1, &sig); - rb_iv_set(self, "signo", INT2NUM(signo)); - - return self; -} - -static VALUE -interrupt_init(self, mesg) - VALUE self, mesg; -{ - VALUE argv[2]; - - argv[0] = INT2FIX(SIGINT); - argv[1] = mesg; - return rb_call_super(2, argv); -} - -void -ruby_default_signal(sig) - int sig; -{ -#ifndef MACOS_UNUSE_SIGNAL - extern rb_pid_t getpid _((void)); - - signal(sig, SIG_DFL); - kill(getpid(), sig); -#endif -} - -/* - * call-seq: - * Process.kill(signal, pid, ...) => fixnum - * - * Sends the given signal to the specified process id(s), or to the - * current process if _pid_ is zero. _signal_ may be an - * integer signal number or a POSIX signal name (either with or without - * a +SIG+ prefix). If _signal_ is negative (or starts - * with a minus sign), kills process groups instead of - * processes. Not all signals are available on all platforms. - * - * pid = fork do - * Signal.trap("HUP") { puts "Ouch!"; exit } - * # ... do some work ... - * end - * # ... - * Process.kill("HUP", pid) - * Process.wait - * - * produces: - * - * Ouch! - */ - -VALUE -rb_f_kill(argc, argv) - int argc; - VALUE *argv; -{ - int negative = 0; - int sig; - int i; - char *s; - - rb_secure(2); - if (argc < 2) - rb_raise(rb_eArgError, "wrong number of arguments -- kill(sig, pid...)"); - switch (TYPE(argv[0])) { - case T_FIXNUM: - sig = FIX2INT(argv[0]); - break; - - case T_SYMBOL: - s = rb_id2name(SYM2ID(argv[0])); - if (!s) rb_raise(rb_eArgError, "bad signal"); - goto str_signal; - - case T_STRING: - s = RSTRING(argv[0])->ptr; - if (s[0] == '-') { - negative++; - s++; - } - str_signal: - if (strncmp("SIG", s, 3) == 0) - s += 3; - if((sig = signm2signo(s)) == 0) - rb_raise(rb_eArgError, "unsupported name `SIG%s'", s); - - if (negative) - sig = -sig; - break; - - default: - { - VALUE str; - - str = rb_check_string_type(argv[0]); - if (!NIL_P(str)) { - s = RSTRING(str)->ptr; - goto str_signal; - } - rb_raise(rb_eArgError, "bad signal type %s", - rb_obj_classname(argv[0])); - } - break; - } - - if (sig < 0) { - sig = -sig; - for (i=1; i= NSIG) { - rb_bug("trap_handler: Bad signal %d", sig); - } - -#if defined(HAVE_NATIVETHREAD) && defined(HAVE_NATIVETHREAD_KILL) - if (!is_ruby_native_thread() && !rb_trap_accept_nativethreads[sig]) { - sigsend_to_ruby_thread(sig); - return; - } -#endif - -#if !defined(BSD_SIGNAL) && !defined(POSIX_SIGNAL) - if (rb_trap_accept_nativethreads[sig]) { - ruby_nativethread_signal(sig, sighandler); - } - else { - ruby_signal(sig, sighandler); - } -#endif - - if (trap_list[sig].cmd == 0 && ATOMIC_TEST(rb_trap_immediate)) { - IN_MAIN_CONTEXT(signal_exec, sig); - ATOMIC_SET(rb_trap_immediate, 1); - } - else { - ATOMIC_INC(rb_trap_pending); - ATOMIC_INC(trap_pending_list[sig]); -#ifdef _WIN32 - rb_w32_interrupted(); -#endif - } -} - -#ifdef SIGBUS -static RETSIGTYPE sigbus _((int)); -static RETSIGTYPE -sigbus(sig) - int sig; -{ -#if defined(HAVE_NATIVETHREAD) && defined(HAVE_NATIVETHREAD_KILL) - if (!is_ruby_native_thread() && !rb_trap_accept_nativethreads[sig]) { - sigsend_to_ruby_thread(sig); - return; - } -#endif - - rb_bug("Bus Error"); -} -#endif - -#ifdef SIGSEGV -static RETSIGTYPE sigsegv _((int)); -static RETSIGTYPE -sigsegv(sig) - int sig; -{ -#if defined(HAVE_NATIVETHREAD) && defined(HAVE_NATIVETHREAD_KILL) - if (!is_ruby_native_thread() && !rb_trap_accept_nativethreads[sig]) { - sigsend_to_ruby_thread(sig); - return; - } -#endif - - rb_bug("Segmentation fault"); -} -#endif - -#ifdef SIGPIPE -static RETSIGTYPE sigpipe _((int)); -static RETSIGTYPE -sigpipe(sig) - int sig; -{ - /* do nothing */ -} -#endif - -void -rb_trap_exit() -{ -#ifndef MACOS_UNUSE_SIGNAL - if (trap_list[0].cmd) { - VALUE trap_exit = trap_list[0].cmd; - - trap_list[0].cmd = 0; - rb_eval_cmd(trap_exit, rb_ary_new3(1, INT2FIX(0)), trap_list[0].safe); - } -#endif -} - -void -rb_trap_exec() -{ -#ifndef MACOS_UNUSE_SIGNAL - int i; - - for (i=0; icmd; - if (NIL_P(command)) { - func = SIG_IGN; - } - else if (TYPE(command) == T_STRING) { - SafeStringValue(command); /* taint check */ - if (RSTRING(command)->len == 0) { - func = SIG_IGN; - } - else if (RSTRING(command)->len == 7) { - if (strncmp(RSTRING(command)->ptr, "SIG_IGN", 7) == 0) { - func = SIG_IGN; - } - else if (strncmp(RSTRING(command)->ptr, "SIG_DFL", 7) == 0) { - func = SIG_DFL; - } - else if (strncmp(RSTRING(command)->ptr, "DEFAULT", 7) == 0) { - func = SIG_DFL; - } - } - else if (RSTRING(command)->len == 6) { - if (strncmp(RSTRING(command)->ptr, "IGNORE", 6) == 0) { - func = SIG_IGN; - } - } - else if (RSTRING(command)->len == 4) { - if (strncmp(RSTRING(command)->ptr, "EXIT", 4) == 0) { - func = sigexit; - } - } - } - if (func == SIG_IGN || func == SIG_DFL) { - command = 0; - } - - switch (TYPE(arg->sig)) { - case T_FIXNUM: - sig = FIX2INT(arg->sig); - break; - - case T_SYMBOL: - s = rb_id2name(SYM2ID(arg->sig)); - if (!s) rb_raise(rb_eArgError, "bad signal"); - goto str_signal; - - case T_STRING: - s = RSTRING(arg->sig)->ptr; - - str_signal: - if (strncmp("SIG", s, 3) == 0) - s += 3; - sig = signm2signo(s); - if (sig == 0 && strcmp(s, "EXIT") != 0) - rb_raise(rb_eArgError, "unsupported signal SIG%s", s); - } - - if (sig < 0 || sig >= NSIG) { - rb_raise(rb_eArgError, "invalid signal number (%d)", sig); - } -#if defined(HAVE_SETITIMER) - if (sig == SIGVTALRM) { - rb_raise(rb_eArgError, "SIGVTALRM reserved for Thread; can't set handler"); - } -#endif - if (func == SIG_DFL) { - switch (sig) { - case SIGINT: -#ifdef SIGHUP - case SIGHUP: -#endif -#ifdef SIGQUIT - case SIGQUIT: -#endif -#ifdef SIGTERM - case SIGTERM: -#endif -#ifdef SIGALRM - case SIGALRM: -#endif -#ifdef SIGUSR1 - case SIGUSR1: -#endif -#ifdef SIGUSR2 - case SIGUSR2: -#endif - func = sighandler; - break; -#ifdef SIGBUS - case SIGBUS: - func = sigbus; - break; -#endif -#ifdef SIGSEGV - case SIGSEGV: - func = sigsegv; - break; -#endif -#ifdef SIGPIPE - case SIGPIPE: - func = sigpipe; - break; -#endif - } - } - oldfunc = ruby_signal(sig, func); - oldcmd = trap_list[sig].cmd; - if (!oldcmd) { - if (oldfunc == SIG_IGN) oldcmd = rb_str_new2("IGNORE"); - else if (oldfunc == sighandler) oldcmd = rb_str_new2("DEFAULT"); - else oldcmd = Qnil; - } - - trap_list[sig].cmd = command; - trap_list[sig].safe = ruby_safe_level; - /* enable at least specified signal. */ -#if USE_TRAP_MASK -#ifdef HAVE_SIGPROCMASK - sigdelset(&arg->mask, sig); -#else - arg->mask &= ~sigmask(sig); -#endif -#endif - return oldcmd; -} - -#if USE_TRAP_MASK -static VALUE -trap_ensure(arg) - struct trap_arg *arg; -{ - /* enable interrupt */ -#ifdef HAVE_SIGPROCMASK - sigprocmask(SIG_SETMASK, &arg->mask, NULL); -#else - sigsetmask(arg->mask); -#endif - trap_last_mask = arg->mask; - return 0; -} -#endif - -void -rb_trap_restore_mask() -{ -#if USE_TRAP_MASK -# ifdef HAVE_SIGPROCMASK - sigprocmask(SIG_SETMASK, &trap_last_mask, NULL); -# else - sigsetmask(trap_last_mask); -# endif -#endif -} - -/* - * call-seq: - * Signal.trap( signal, proc ) => obj - * Signal.trap( signal ) {| | block } => obj - * - * Specifies the handling of signals. The first parameter is a signal - * name (a string such as ``SIGALRM'', ``SIGUSR1'', and so on) or a - * signal number. The characters ``SIG'' may be omitted from the - * signal name. The command or block specifies code to be run when the - * signal is raised. If the command is the string ``IGNORE'' or - * ``SIG_IGN'', the signal will be ignored. If the command is - * ``DEFAULT'' or ``SIG_DFL'', the operating system's default handler - * will be invoked. If the command is ``EXIT'', the script will be - * terminated by the signal. Otherwise, the given command or block - * will be run. - * The special signal name ``EXIT'' or signal number zero will be - * invoked just prior to program termination. - * trap returns the previous handler for the given signal. - * - * Signal.trap(0, proc { puts "Terminating: #{$$}" }) - * Signal.trap("CLD") { puts "Child died" } - * fork && Process.wait - * - * produces: - * Terminating: 27461 - * Child died - * Terminating: 27460 - */ -static VALUE -sig_trap(argc, argv) - int argc; - VALUE *argv; -{ - struct trap_arg arg; - - rb_secure(2); - if (argc == 0 || argc > 2) { - rb_raise(rb_eArgError, "wrong number of arguments -- trap(sig, cmd)/trap(sig){...}"); - } - - arg.sig = argv[0]; - if (argc == 1) { - arg.cmd = rb_block_proc(); - } - else if (argc == 2) { - arg.cmd = argv[1]; - } - - if (OBJ_TAINTED(arg.cmd)) { - rb_raise(rb_eSecurityError, "Insecure: tainted signal trap"); - } -#if USE_TRAP_MASK - /* disable interrupt */ -# ifdef HAVE_SIGPROCMASK - sigfillset(&arg.mask); - sigprocmask(SIG_BLOCK, &arg.mask, &arg.mask); -# else - arg.mask = sigblock(~0); -# endif - - return rb_ensure(trap, (VALUE)&arg, trap_ensure, (VALUE)&arg); -#else - return trap(&arg); -#endif -} - -/* - * call-seq: - * Signal.list => a_hash - * - * Returns a list of signal names mapped to the corresponding - * underlying signal numbers. - * - * Signal.list #=> {"ABRT"=>6, "ALRM"=>14, "BUS"=>7, "CHLD"=>17, "CLD"=>17, "CONT"=>18, "FPE"=>8, "HUP"=>1, "ILL"=>4, "INT"=>2, "IO"=>29, "IOT"=>6, "KILL"=>9, "PIPE"=>13, "POLL"=>29, "PROF"=>27, "PWR"=>30, "QUIT"=>3, "SEGV"=>11, "STOP"=>19, "SYS"=>31, "TERM"=>15, "TRAP"=>5, "TSTP"=>20, "TTIN"=>21, "TTOU"=>22, "URG"=>23, "USR1"=>10, "USR2"=>12, "VTALRM"=>26, "WINCH"=>28, "XCPU"=>24, "XFSZ"=>25} - */ -static VALUE -sig_list() -{ - VALUE h = rb_hash_new(); - struct signals *sigs; - - for (sigs = siglist; sigs->signm; sigs++) { - rb_hash_aset(h, rb_str_new2(sigs->signm), INT2FIX(sigs->signo)); - } - return h; -} - -static void -install_sighandler(signum, handler) - int signum; - sighandler_t handler; -{ - sighandler_t old; - - old = ruby_signal(signum, handler); - if (old != SIG_DFL) { - ruby_signal(signum, old); - } -} - -#if 0 -/* - * If you write a handler which works on any native thread - * (even if the thread is NOT a ruby's one), please enable - * this function and use it to install the handler, instead - * of `install_sighandler()'. - */ -#ifdef HAVE_NATIVETHREAD -static void -install_nativethread_sighandler(signum, handler) - int signum; - sighandler_t handler; -{ - sighandler_t old; - int old_st; - - old_st = rb_trap_accept_nativethreads[signum]; - old = ruby_nativethread_signal(signum, handler); - if (old != SIG_DFL) { - if (old_st) { - ruby_nativethread_signal(signum, old); - } else { - ruby_signal(signum, old); - } - } -} -#endif -#endif - -static void -init_sigchld(sig) - int sig; -{ - sighandler_t oldfunc; -#if USE_TRAP_MASK -# ifdef HAVE_SIGPROCMASK - sigset_t mask; -# else - int mask; -# endif -#endif - -#if USE_TRAP_MASK - /* disable interrupt */ -# ifdef HAVE_SIGPROCMASK - sigfillset(&mask); - sigprocmask(SIG_BLOCK, &mask, &mask); -# else - mask = sigblock(~0); -# endif -#endif - - oldfunc = ruby_signal(sig, SIG_DFL); - if (oldfunc != SIG_DFL && oldfunc != SIG_IGN) { - ruby_signal(sig, oldfunc); - } else { - trap_list[sig].cmd = 0; - } - -#if USE_TRAP_MASK -#ifdef HAVE_SIGPROCMASK - sigdelset(&mask, sig); - sigprocmask(SIG_SETMASK, &mask, NULL); -#else - mask &= ~sigmask(sig); - sigsetmask(mask); -#endif - trap_last_mask = mask; -#endif -} - -/* - * Many operating systems allow signals to be sent to running - * processes. Some signals have a defined effect on the process, while - * others may be trapped at the code level and acted upon. For - * example, your process may trap the USR1 signal and use it to toggle - * debugging, and may use TERM to initiate a controlled shutdown. - * - * pid = fork do - * Signal.trap("USR1") do - * $debug = !$debug - * puts "Debug now: #$debug" - * end - * Signal.trap("TERM") do - * puts "Terminating..." - * shutdown() - * end - * # . . . do some work . . . - * end - * - * Process.detach(pid) - * - * # Controlling program: - * Process.kill("USR1", pid) - * # ... - * Process.kill("USR1", pid) - * # ... - * Process.kill("TERM", pid) - * - * produces: - * Debug now: true - * Debug now: false - * Terminating... - * - * The list of available signal names and their interpretation is - * system dependent. Signal delivery semantics may also vary between - * systems; in particular signal delivery may not always be reliable. - */ -void -Init_signal() -{ -#ifndef MACOS_UNUSE_SIGNAL - VALUE mSignal = rb_define_module("Signal"); - - rb_define_global_function("trap", sig_trap, -1); - rb_define_module_function(mSignal, "trap", sig_trap, -1); - rb_define_module_function(mSignal, "list", sig_list, 0); - - rb_define_method(rb_eSignal, "initialize", esignal_init, -1); - rb_attr(rb_eSignal, rb_intern("signo"), 1, 0, 0); - rb_alias(rb_eSignal, rb_intern("signm"), rb_intern("message")); - rb_define_method(rb_eInterrupt, "initialize", interrupt_init, 1); - - install_sighandler(SIGINT, sighandler); -#ifdef SIGHUP - install_sighandler(SIGHUP, sighandler); -#endif -#ifdef SIGQUIT - install_sighandler(SIGQUIT, sighandler); -#endif -#ifdef SIGTERM - install_sighandler(SIGTERM, sighandler); -#endif -#ifdef SIGALRM - install_sighandler(SIGALRM, sighandler); -#endif -#ifdef SIGUSR1 - install_sighandler(SIGUSR1, sighandler); -#endif -#ifdef SIGUSR2 - install_sighandler(SIGUSR2, sighandler); -#endif - -#ifdef SIGBUS - install_sighandler(SIGBUS, sigbus); -#endif -#ifdef SIGSEGV - install_sighandler(SIGSEGV, sigsegv); -#endif -#ifdef SIGPIPE - install_sighandler(SIGPIPE, sigpipe); -#endif - -#if defined(SIGCLD) - init_sigchld(SIGCLD); -#elif defined(SIGCHLD) - init_sigchld(SIGCHLD); -#endif - -#endif /* MACOS_UNUSE_SIGNAL */ -} -/********************************************************************** - - sprintf.c - - - $Author: shyouhei $ - $Date: 2008-06-20 01:12:46 +0200 (Fri, 20 Jun 2008) $ - created at: Fri Oct 15 10:39:26 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#include "ruby.h" -#include "re.h" -#include -#include - -#define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */ -#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT) -#define EXTENDSIGN(n, l) (((~0 << (n)) >> (((n)*(l)) % BITSPERDIG)) & ~(~0 << (n))) - -static void fmt_setup _((char*,int,int,int,int)); - -static char* -remove_sign_bits(str, base) - char *str; - int base; -{ - char *s, *t; - - s = t = str; - - if (base == 16) { - while (*t == 'f') { - t++; - } - } - else if (base == 8) { - *t |= EXTENDSIGN(3, strlen(t)); - while (*t == '7') { - t++; - } - } - else if (base == 2) { - while (*t == '1') { - t++; - } - } - if (t > s) { - while (*t) *s++ = *t++; - *s = '\0'; - } - - return str; -} - -static char -sign_bits(base, p) - int base; - const char *p; -{ - char c = '.'; - - switch (base) { - case 16: - if (*p == 'X') c = 'F'; - else c = 'f'; - break; - case 8: - c = '7'; break; - case 2: - c = '1'; break; - } - return c; -} - -#define FNONE 0 -#define FSHARP 1 -#define FMINUS 2 -#define FPLUS 4 -#define FZERO 8 -#define FSPACE 16 -#define FWIDTH 32 -#define FPREC 64 -#define FPREC0 128 - -#define CHECK(l) do {\ - while (blen + (l) >= bsiz) {\ - bsiz*=2;\ - }\ - rb_str_resize(result, bsiz);\ - buf = RSTRING(result)->ptr;\ -} while (0) - -#define PUSH(s, l) do { \ - CHECK(l);\ - memcpy(&buf[blen], s, l);\ - blen += (l);\ -} while (0) - -#define GETARG() (nextvalue != Qundef ? nextvalue : \ - posarg < 0 ? \ - (rb_raise(rb_eArgError, "unnumbered(%d) mixed with numbered", nextarg), 0) : \ - (posarg = nextarg++, GETNTHARG(posarg))) - -#define GETPOSARG(n) (posarg > 0 ? \ - (rb_raise(rb_eArgError, "numbered(%d) after unnumbered(%d)", n, posarg), 0) : \ - ((n < 1) ? (rb_raise(rb_eArgError, "invalid index - %d$", n), 0) : \ - (posarg = -1, GETNTHARG(n)))) - -#define GETNTHARG(nth) \ - ((nth >= argc) ? (rb_raise(rb_eArgError, "too few arguments"), 0) : argv[nth]) - -#define GETNUM(n, val) \ - for (; p < end && ISDIGIT(*p); p++) { \ - int next_n = 10 * n + (*p - '0'); \ - if (next_n / 10 != n) {\ - rb_raise(rb_eArgError, #val " too big"); \ - } \ - n = next_n; \ - } \ - if (p >= end) { \ - rb_raise(rb_eArgError, "malformed format string - %%*[0-9]"); \ - } - -#define GETASTER(val) do { \ - t = p++; \ - n = 0; \ - GETNUM(n, val); \ - if (*p == '$') { \ - tmp = GETPOSARG(n); \ - } \ - else { \ - tmp = GETARG(); \ - p = t; \ - } \ - val = NUM2INT(tmp); \ -} while (0) - - -/* - * call-seq: - * format(format_string [, arguments...] ) => string - * sprintf(format_string [, arguments...] ) => string - * - * Returns the string resulting from applying format_string to - * any additional arguments. Within the format string, any characters - * other than format sequences are copied to the result. A format - * sequence consists of a percent sign, followed by optional flags, - * width, and precision indicators, then terminated with a field type - * character. The field type controls how the corresponding - * sprintf argument is to be interpreted, while the flags - * modify that interpretation. The field type characters are listed - * in the table at the end of this section. The flag characters are: - * - * Flag | Applies to | Meaning - * ---------+--------------+----------------------------------------- - * space | bdeEfgGiouxX | Leave a space at the start of - * | | positive numbers. - * ---------+--------------+----------------------------------------- - * (digit)$ | all | Specifies the absolute argument number - * | | for this field. Absolute and relative - * | | argument numbers cannot be mixed in a - * | | sprintf string. - * ---------+--------------+----------------------------------------- - * # | beEfgGoxX | Use an alternative format. For the - * | | conversions `o', `x', `X', and `b', - * | | prefix the result with ``0'', ``0x'', ``0X'', - * | | and ``0b'', respectively. For `e', - * | | `E', `f', `g', and 'G', force a decimal - * | | point to be added, even if no digits follow. - * | | For `g' and 'G', do not remove trailing zeros. - * ---------+--------------+----------------------------------------- - * + | bdeEfgGiouxX | Add a leading plus sign to positive numbers. - * ---------+--------------+----------------------------------------- - * - | all | Left-justify the result of this conversion. - * ---------+--------------+----------------------------------------- - * 0 (zero) | bdeEfgGiouxX | Pad with zeros, not spaces. - * ---------+--------------+----------------------------------------- - * * | all | Use the next argument as the field width. - * | | If negative, left-justify the result. If the - * | | asterisk is followed by a number and a dollar - * | | sign, use the indicated argument as the width. - * - * - * The field width is an optional integer, followed optionally by a - * period and a precision. The width specifies the minimum number of - * characters that will be written to the result for this field. For - * numeric fields, the precision controls the number of decimal places - * displayed. For string fields, the precision determines the maximum - * number of characters to be copied from the string. (Thus, the format - * sequence %10.10s will always contribute exactly ten - * characters to the result.) - * - * The field types are: - * - * Field | Conversion - * ------+-------------------------------------------------------------- - * b | Convert argument as a binary number. - * c | Argument is the numeric code for a single character. - * d | Convert argument as a decimal number. - * E | Equivalent to `e', but uses an uppercase E to indicate - * | the exponent. - * e | Convert floating point argument into exponential notation - * | with one digit before the decimal point. The precision - * | determines the number of fractional digits (defaulting to six). - * f | Convert floating point argument as [-]ddd.ddd, - * | where the precision determines the number of digits after - * | the decimal point. - * G | Equivalent to `g', but use an uppercase `E' in exponent form. - * g | Convert a floating point number using exponential form - * | if the exponent is less than -4 or greater than or - * | equal to the precision, or in d.dddd form otherwise. - * i | Identical to `d'. - * o | Convert argument as an octal number. - * p | The valuing of argument.inspect. - * s | Argument is a string to be substituted. If the format - * | sequence contains a precision, at most that many characters - * | will be copied. - * u | Treat argument as an unsigned decimal number. Negative integers - * | are displayed as a 32 bit two's complement plus one for the - * | underlying architecture; that is, 2 ** 32 + n. However, since - * | Ruby has no inherent limit on bits used to represent the - * | integer, this value is preceded by two dots (..) in order to - * | indicate a infinite number of leading sign bits. - * X | Convert argument as a hexadecimal number using uppercase - * | letters. Negative numbers will be displayed with two - * | leading periods (representing an infinite string of - * | leading 'FF's. - * x | Convert argument as a hexadecimal number. - * | Negative numbers will be displayed with two - * | leading periods (representing an infinite string of - * | leading 'ff's. - * - * Examples: - * - * sprintf("%d %04x", 123, 123) #=> "123 007b" - * sprintf("%08b '%4s'", 123, 123) #=> "01111011 ' 123'" - * sprintf("%1$*2$s %2$d %1$s", "hello", 8) #=> " hello 8 hello" - * sprintf("%1$*2$s %2$d", "hello", -8) #=> "hello -8" - * sprintf("%+g:% g:%-g", 1.23, 1.23, 1.23) #=> "+1.23: 1.23:1.23" - * sprintf("%u", -123) #=> "..4294967173" - */ - -VALUE -rb_f_sprintf(argc, argv) - int argc; - VALUE *argv; -{ - return rb_str_format(argc - 1, argv + 1, GETNTHARG(0)); -} - -VALUE -rb_str_format(argc, argv, fmt) - int argc; - VALUE *argv; - VALUE fmt; -{ - const char *p, *end; - char *buf; - int blen, bsiz; - VALUE result; - - int width, prec, flags = FNONE; - int nextarg = 1; - int posarg = 0; - int tainted = 0; - VALUE nextvalue; - VALUE tmp; - VALUE str; - -#define CHECK_FOR_WIDTH(f) \ - if ((f) & FWIDTH) { \ - rb_raise(rb_eArgError, "width given twice"); \ - } \ - if ((f) & FPREC0) { \ - rb_raise(rb_eArgError, "width after precision"); \ - } -#define CHECK_FOR_FLAGS(f) \ - if ((f) & FWIDTH) { \ - rb_raise(rb_eArgError, "flag after width"); \ - } \ - if ((f) & FPREC0) { \ - rb_raise(rb_eArgError, "flag after precision"); \ - } - - ++argc; - --argv; - if (OBJ_TAINTED(fmt)) tainted = 1; - StringValue(fmt); - fmt = rb_str_new4(fmt); - p = RSTRING(fmt)->ptr; - end = p + RSTRING(fmt)->len; - blen = 0; - bsiz = 120; - result = rb_str_buf_new(bsiz); - buf = RSTRING(result)->ptr; - - for (; p < end; p++) { - const char *t; - int n; - - for (t = p; t < end && *t != '%'; t++) ; - PUSH(p, t - p); - if (t >= end) { - /* end of fmt string */ - goto sprint_exit; - } - p = t + 1; /* skip `%' */ - - width = prec = -1; - nextvalue = Qundef; - retry: - switch (*p) { - default: - if (ISPRINT(*p)) - rb_raise(rb_eArgError, "malformed format string - %%%c", *p); - else - rb_raise(rb_eArgError, "malformed format string"); - break; - - case ' ': - CHECK_FOR_FLAGS(flags); - flags |= FSPACE; - p++; - goto retry; - - case '#': - CHECK_FOR_FLAGS(flags); - flags |= FSHARP; - p++; - goto retry; - - case '+': - CHECK_FOR_FLAGS(flags); - flags |= FPLUS; - p++; - goto retry; - - case '-': - CHECK_FOR_FLAGS(flags); - flags |= FMINUS; - p++; - goto retry; - - case '0': - CHECK_FOR_FLAGS(flags); - flags |= FZERO; - p++; - goto retry; - - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - n = 0; - GETNUM(n, width); - if (*p == '$') { - if (nextvalue != Qundef) { - rb_raise(rb_eArgError, "value given twice - %d$", n); - } - nextvalue = GETPOSARG(n); - p++; - goto retry; - } - CHECK_FOR_WIDTH(flags); - width = n; - flags |= FWIDTH; - goto retry; - - case '*': - CHECK_FOR_WIDTH(flags); - flags |= FWIDTH; - GETASTER(width); - if (width < 0) { - flags |= FMINUS; - width = -width; - } - p++; - goto retry; - - case '.': - if (flags & FPREC0) { - rb_raise(rb_eArgError, "precision given twice"); - } - flags |= FPREC|FPREC0; - - prec = 0; - p++; - if (*p == '*') { - GETASTER(prec); - if (prec < 0) { /* ignore negative precision */ - flags &= ~FPREC; - } - p++; - goto retry; - } - - GETNUM(prec, precision); - goto retry; - - case '\n': - case '\0': - p--; - case '%': - if (flags != FNONE) { - rb_raise(rb_eArgError, "illegal format character - %%"); - } - PUSH("%", 1); - break; - - case 'c': - { - VALUE val = GETARG(); - char c; - - if (!(flags & FMINUS)) - while (--width > 0) - PUSH(" ", 1); - c = NUM2INT(val) & 0xff; - PUSH(&c, 1); - while (--width > 0) - PUSH(" ", 1); - } - break; - - case 's': - case 'p': - { - VALUE arg = GETARG(); - long len; - - if (*p == 'p') arg = rb_inspect(arg); - str = rb_obj_as_string(arg); - if (OBJ_TAINTED(str)) tainted = 1; - len = RSTRING(str)->len; - if (flags&FPREC) { - if (prec < len) { - len = prec; - } - } - /* need to adjust multi-byte string pos */ - if (flags&FWIDTH) { - if (width > len) { - CHECK(width); - width -= len; - if (!(flags&FMINUS)) { - while (width--) { - buf[blen++] = ' '; - } - } - memcpy(&buf[blen], RSTRING_PTR(str), len); - blen += len; - if (flags&FMINUS) { - while (width--) { - buf[blen++] = ' '; - } - } - break; - } - } - PUSH(RSTRING(str)->ptr, len); - } - break; - - case 'd': - case 'i': - case 'o': - case 'x': - case 'X': - case 'b': - case 'B': - case 'u': - { - volatile VALUE val = GETARG(); - char fbuf[32], nbuf[64], *s, *t; - const char *prefix = 0; - int sign = 0; - char sc = 0; - long v = 0; - int base, bignum = 0; - int len, pos; - volatile VALUE tmp; - volatile VALUE tmp1; - - switch (*p) { - case 'd': - case 'i': - sign = 1; break; - case 'o': - case 'x': - case 'X': - case 'b': - case 'B': - case 'u': - default: - if (flags&(FPLUS|FSPACE)) sign = 1; - break; - } - if (flags & FSHARP) { - switch (*p) { - case 'o': - prefix = "0"; break; - case 'x': - prefix = "0x"; break; - case 'X': - prefix = "0X"; break; - case 'b': - prefix = "0b"; break; - case 'B': - prefix = "0B"; break; - } - if (prefix) { - width -= strlen(prefix); - } - } - - bin_retry: - switch (TYPE(val)) { - case T_FLOAT: - val = rb_dbl2big(RFLOAT(val)->value); - if (FIXNUM_P(val)) goto bin_retry; - bignum = 1; - break; - case T_STRING: - val = rb_str_to_inum(val, 0, Qtrue); - goto bin_retry; - case T_BIGNUM: - bignum = 1; - break; - case T_FIXNUM: - v = FIX2LONG(val); - break; - default: - val = rb_Integer(val); - goto bin_retry; - } - - switch (*p) { - case 'o': - base = 8; break; - case 'x': - case 'X': - base = 16; break; - case 'b': - case 'B': - base = 2; break; - case 'u': - case 'd': - case 'i': - default: - base = 10; break; - } - - if (!bignum) { - if (base == 2) { - val = rb_int2big(v); - goto bin_retry; - } - if (sign) { - char c = *p; - if (c == 'i') c = 'd'; /* %d and %i are identical */ - if (v < 0) { - v = -v; - sc = '-'; - width--; - } - else if (flags & FPLUS) { - sc = '+'; - width--; - } - else if (flags & FSPACE) { - sc = ' '; - width--; - } - sprintf(fbuf, "%%l%c", c); - sprintf(nbuf, fbuf, v); - s = nbuf; - goto format_integer; - } - s = nbuf; - if (v < 0) { - if (base == 10) { - rb_warning("negative number for %%u specifier"); - } - if (!(flags&(FPREC|FZERO))) { - strcpy(s, ".."); - s += 2; - } - } - sprintf(fbuf, "%%l%c", *p == 'X' ? 'x' : *p); - sprintf(s, fbuf, v); - if (v < 0) { - char d = 0; - - remove_sign_bits(s, base); - switch (base) { - case 16: - d = 'f'; break; - case 8: - d = '7'; break; - } - if (d && *s != d) { - memmove(s+1, s, strlen(s)+1); - *s = d; - } - } - s = nbuf; - goto format_integer; - } - - if (sign) { - tmp = rb_big2str(val, base); - s = RSTRING(tmp)->ptr; - if (s[0] == '-') { - s++; - sc = '-'; - width--; - } - else if (flags & FPLUS) { - sc = '+'; - width--; - } - else if (flags & FSPACE) { - sc = ' '; - width--; - } - goto format_integer; - } - if (!RBIGNUM(val)->sign) { - val = rb_big_clone(val); - rb_big_2comp(val); - } - tmp1 = tmp = rb_big2str0(val, base, RBIGNUM(val)->sign); - s = RSTRING(tmp)->ptr; - if (*s == '-') { - if (base == 10) { - rb_warning("negative number for %%u specifier"); - } - remove_sign_bits(++s, base); - tmp = rb_str_new(0, 3+strlen(s)); - t = RSTRING(tmp)->ptr; - if (!(flags&(FPREC|FZERO))) { - strcpy(t, ".."); - t += 2; - } - switch (base) { - case 16: - if (s[0] != 'f') strcpy(t++, "f"); break; - case 8: - if (s[0] != '7') strcpy(t++, "7"); break; - case 2: - if (s[0] != '1') strcpy(t++, "1"); break; - } - strcpy(t, s); - bignum = 2; - } - s = RSTRING(tmp)->ptr; - - format_integer: - pos = -1; - len = strlen(s); - - if (*p == 'X') { - char *pp = s; - while (*pp) { - *pp = toupper(*pp); - pp++; - } - } - if ((flags&(FZERO|FPREC)) == FZERO) { - prec = width; - width = 0; - } - else { - if (prec < len) prec = len; - width -= prec; - } - if (!(flags&FMINUS)) { - CHECK(width); - while (width-- > 0) { - buf[blen++] = ' '; - } - } - if (sc) PUSH(&sc, 1); - if (prefix) { - int plen = strlen(prefix); - PUSH(prefix, plen); - } - CHECK(prec - len); - if (!bignum && v < 0) { - char c = sign_bits(base, p); - while (len < prec--) { - buf[blen++] = c; - } - } - else { - char c; - - if (!sign && bignum && !RBIGNUM(val)->sign) - c = sign_bits(base, p); - else - c = '0'; - while (len < prec--) { - buf[blen++] = c; - } - } - PUSH(s, len); - CHECK(width); - while (width-- > 0) { - buf[blen++] = ' '; - } - } - break; - - case 'f': - case 'g': - case 'G': - case 'e': - case 'E': - { - VALUE val = GETARG(); - double fval; - int i, need = 6; - char fbuf[32]; - - fval = RFLOAT(rb_Float(val))->value; -#if defined(_WIN32) && !defined(__BORLANDC__) - if (isnan(fval) || isinf(fval)) { - char *expr; - - if (isnan(fval)) { - expr = "NaN"; - } - else { - expr = "Inf"; - } - need = strlen(expr); - if ((!isnan(fval) && fval < 0.0) || (flags & FPLUS)) - need++; - else if (flags & FSPACE) - need++; - if ((flags & FWIDTH) && need < width) - need = width; - - CHECK(need); - sprintf(&buf[blen], "%*s", need, ""); - if (flags & FMINUS) { - if (!isnan(fval) && fval < 0.0) - buf[blen++] = '-'; - else if (flags & FPLUS) - buf[blen++] = '+'; - else if (flags & FSPACE) - blen++; - strncpy(&buf[blen], expr, strlen(expr)); - } - else if (flags & FZERO) { - if (!isnan(fval) && fval < 0.0) { - buf[blen++] = '-'; - need--; - } - else if (flags & FPLUS) { - buf[blen++] = '+'; - need--; - } - else if (flags & FSPACE) { - blen++; - need--; - } - while (need-- - strlen(expr) > 0) { - buf[blen++] = '0'; - } - strncpy(&buf[blen], expr, strlen(expr)); - } - else { - if (!isnan(fval) && fval < 0.0) - buf[blen + need - strlen(expr) - 1] = '-'; - else if (flags & FPLUS) - buf[blen + need - strlen(expr) - 1] = '+'; - strncpy(&buf[blen + need - strlen(expr)], expr, - strlen(expr)); - } - blen += strlen(&buf[blen]); - break; - } -#endif /* defined(_WIN32) && !defined(__BORLANDC__) */ - fmt_setup(fbuf, *p, flags, width, prec); - need = 0; - if (*p != 'e' && *p != 'E') { - i = INT_MIN; - frexp(fval, &i); - if (i > 0) - need = BIT_DIGITS(i); - } - need += (flags&FPREC) ? prec : 6; - if ((flags&FWIDTH) && need < width) - need = width; - need += 20; - - CHECK(need); - sprintf(&buf[blen], fbuf, fval); - blen += strlen(&buf[blen]); - } - break; - } - flags = FNONE; - } - - sprint_exit: - /* XXX - We cannot validiate the number of arguments if (digit)$ style used. - */ - if (posarg >= 0 && nextarg < argc) { - const char *mesg = "too many arguments for format string"; - if (RTEST(ruby_debug)) rb_raise(rb_eArgError, mesg); - if (RTEST(ruby_verbose)) rb_warn(mesg); - } - rb_str_resize(result, blen); - - if (tainted) OBJ_TAINT(result); - return result; -} - -static void -fmt_setup(buf, c, flags, width, prec) - char *buf; - int c; - int flags, width, prec; -{ - *buf++ = '%'; - if (flags & FSHARP) *buf++ = '#'; - if (flags & FPLUS) *buf++ = '+'; - if (flags & FMINUS) *buf++ = '-'; - if (flags & FZERO) *buf++ = '0'; - if (flags & FSPACE) *buf++ = ' '; - - if (flags & FWIDTH) { - sprintf(buf, "%d", width); - buf += strlen(buf); - } - - if (flags & FPREC) { - sprintf(buf, ".%d", prec); - buf += strlen(buf); - } - - *buf++ = c; - *buf = '\0'; -} -/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */ - -/* static char sccsid[] = "@(#) st.c 5.1 89/12/14 Crucible"; */ - -#include "config.h" -#include "defines.h" -#include -#ifdef HAVE_STDLIB_H -#include -#endif -#include -#include "st.h" - -typedef struct st_table_entry st_table_entry; - -struct st_table_entry { - unsigned int hash; - st_data_t key; - st_data_t record; - st_table_entry *next; -}; - -#define ST_DEFAULT_MAX_DENSITY 5 -#define ST_DEFAULT_INIT_TABLE_SIZE 11 - - /* - * DEFAULT_MAX_DENSITY is the default for the largest we allow the - * average number of items per bin before increasing the number of - * bins - * - * DEFAULT_INIT_TABLE_SIZE is the default for the number of bins - * allocated initially - * - */ -static int numcmp(long, long); -static int numhash(long); -static struct st_hash_type type_numhash = { - numcmp, - numhash, -}; - -/* extern int strcmp(const char *, const char *); */ -static int strhash(const char *); -static struct st_hash_type type_strhash = { - strcmp, - strhash, -}; - -static void rehash(st_table *); - -#ifdef RUBY -#define malloc xmalloc -#define calloc xcalloc -#endif - -#define alloc(type) (type*)malloc((unsigned)sizeof(type)) -#define Calloc(n,s) (char*)calloc((n),(s)) - -#define EQUAL(table,x,y) ((x)==(y) || (*table->type->compare)((x),(y)) == 0) - -#define do_hash(key,table) (unsigned int)(*(table)->type->hash)((key)) -#define do_hash_bin(key,table) (do_hash(key, table)%(table)->num_bins) - -/* - * MINSIZE is the minimum size of a dictionary. - */ - -#define MINSIZE 8 - -/* -Table of prime numbers 2^n+a, 2<=n<=30. -*/ -static long primes[] = { - 8 + 3, - 16 + 3, - 32 + 5, - 64 + 3, - 128 + 3, - 256 + 27, - 512 + 9, - 1024 + 9, - 2048 + 5, - 4096 + 3, - 8192 + 27, - 16384 + 43, - 32768 + 3, - 65536 + 45, - 131072 + 29, - 262144 + 3, - 524288 + 21, - 1048576 + 7, - 2097152 + 17, - 4194304 + 15, - 8388608 + 9, - 16777216 + 43, - 33554432 + 35, - 67108864 + 15, - 134217728 + 29, - 268435456 + 3, - 536870912 + 11, - 1073741824 + 85, - 0 -}; - -static int -new_size(size) - int size; -{ - int i; - -#if 0 - for (i=3; i<31; i++) { - if ((1< size) return 1< size) return primes[i]; - } - /* Ran out of polynomials */ - return -1; /* should raise exception */ -#endif -} - -#ifdef HASH_LOG -static int collision = 0; -static int init_st = 0; - -static void -stat_col() -{ - FILE *f = fopen("/tmp/col", "w"); - fprintf(f, "collision: %d\n", collision); - fclose(f); -} -#endif - -st_table* -st_init_table_with_size(type, size) - struct st_hash_type *type; - int size; -{ - st_table *tbl; - -#ifdef HASH_LOG - if (init_st == 0) { - init_st = 1; - atexit(stat_col); - } -#endif - - size = new_size(size); /* round up to prime number */ - - tbl = alloc(st_table); - tbl->type = type; - tbl->num_entries = 0; - tbl->num_bins = size; - tbl->bins = (st_table_entry **)Calloc(size, sizeof(st_table_entry*)); - - return tbl; -} - -st_table* -st_init_table(type) - struct st_hash_type *type; -{ - return st_init_table_with_size(type, 0); -} - -st_table* -st_init_numtable(void) -{ - return st_init_table(&type_numhash); -} - -st_table* -st_init_numtable_with_size(size) - int size; -{ - return st_init_table_with_size(&type_numhash, size); -} - -st_table* -st_init_strtable(void) -{ - return st_init_table(&type_strhash); -} - -st_table* -st_init_strtable_with_size(size) - int size; -{ - return st_init_table_with_size(&type_strhash, size); -} - -void -st_free_table(table) - st_table *table; -{ - register st_table_entry *ptr, *next; - int i; - - for(i = 0; i < table->num_bins; i++) { - ptr = table->bins[i]; - while (ptr != 0) { - next = ptr->next; - free(ptr); - ptr = next; - } - } - free(table->bins); - free(table); -} - -#define PTR_NOT_EQUAL(table, ptr, hash_val, key) \ -((ptr) != 0 && (ptr->hash != (hash_val) || !EQUAL((table), (key), (ptr)->key))) - -#ifdef HASH_LOG -#define COLLISION collision++ -#else -#define COLLISION -#endif - -#define FIND_ENTRY(table, ptr, hash_val, bin_pos) do {\ - bin_pos = hash_val%(table)->num_bins;\ - ptr = (table)->bins[bin_pos];\ - if (PTR_NOT_EQUAL(table, ptr, hash_val, key)) {\ - COLLISION;\ - while (PTR_NOT_EQUAL(table, ptr->next, hash_val, key)) {\ - ptr = ptr->next;\ - }\ - ptr = ptr->next;\ - }\ -} while (0) - -int -st_lookup(table, key, value) - st_table *table; - register st_data_t key; - st_data_t *value; -{ - unsigned int hash_val, bin_pos; - register st_table_entry *ptr; - - hash_val = do_hash(key, table); - FIND_ENTRY(table, ptr, hash_val, bin_pos); - - if (ptr == 0) { - return 0; - } - else { - if (value != 0) *value = ptr->record; - return 1; - } -} - -#define ADD_DIRECT(table, key, value, hash_val, bin_pos)\ -do {\ - st_table_entry *entry;\ - if (table->num_entries/(table->num_bins) > ST_DEFAULT_MAX_DENSITY) {\ - rehash(table);\ - bin_pos = hash_val % table->num_bins;\ - }\ - \ - entry = alloc(st_table_entry);\ - \ - entry->hash = hash_val;\ - entry->key = key;\ - entry->record = value;\ - entry->next = table->bins[bin_pos];\ - table->bins[bin_pos] = entry;\ - table->num_entries++;\ -} while (0) - -int -st_insert(table, key, value) - register st_table *table; - register st_data_t key; - st_data_t value; -{ - unsigned int hash_val, bin_pos; - register st_table_entry *ptr; - - hash_val = do_hash(key, table); - FIND_ENTRY(table, ptr, hash_val, bin_pos); - - if (ptr == 0) { - ADD_DIRECT(table, key, value, hash_val, bin_pos); - return 0; - } - else { - ptr->record = value; - return 1; - } -} - -void -st_add_direct(table, key, value) - st_table *table; - st_data_t key; - st_data_t value; -{ - unsigned int hash_val, bin_pos; - - hash_val = do_hash(key, table); - bin_pos = hash_val % table->num_bins; - ADD_DIRECT(table, key, value, hash_val, bin_pos); -} - -static void -rehash(table) - register st_table *table; -{ - register st_table_entry *ptr, *next, **new_bins; - int i, old_num_bins = table->num_bins, new_num_bins; - unsigned int hash_val; - - new_num_bins = new_size(old_num_bins+1); - new_bins = (st_table_entry**)Calloc(new_num_bins, sizeof(st_table_entry*)); - - for(i = 0; i < old_num_bins; i++) { - ptr = table->bins[i]; - while (ptr != 0) { - next = ptr->next; - hash_val = ptr->hash % new_num_bins; - ptr->next = new_bins[hash_val]; - new_bins[hash_val] = ptr; - ptr = next; - } - } - free(table->bins); - table->num_bins = new_num_bins; - table->bins = new_bins; -} - -st_table* -st_copy(old_table) - st_table *old_table; -{ - st_table *new_table; - st_table_entry *ptr, *entry; - int i, num_bins = old_table->num_bins; - - new_table = alloc(st_table); - if (new_table == 0) { - return 0; - } - - *new_table = *old_table; - new_table->bins = (st_table_entry**) - Calloc((unsigned)num_bins, sizeof(st_table_entry*)); - - if (new_table->bins == 0) { - free(new_table); - return 0; - } - - for(i = 0; i < num_bins; i++) { - new_table->bins[i] = 0; - ptr = old_table->bins[i]; - while (ptr != 0) { - entry = alloc(st_table_entry); - if (entry == 0) { - free(new_table->bins); - free(new_table); - return 0; - } - *entry = *ptr; - entry->next = new_table->bins[i]; - new_table->bins[i] = entry; - ptr = ptr->next; - } - } - return new_table; -} - -int -st_delete(table, key, value) - register st_table *table; - register st_data_t *key; - st_data_t *value; -{ - unsigned int hash_val; - st_table_entry *tmp; - register st_table_entry *ptr; - - hash_val = do_hash_bin(*key, table); - ptr = table->bins[hash_val]; - - if (ptr == 0) { - if (value != 0) *value = 0; - return 0; - } - - if (EQUAL(table, *key, ptr->key)) { - table->bins[hash_val] = ptr->next; - table->num_entries--; - if (value != 0) *value = ptr->record; - *key = ptr->key; - free(ptr); - return 1; - } - - for(; ptr->next != 0; ptr = ptr->next) { - if (EQUAL(table, ptr->next->key, *key)) { - tmp = ptr->next; - ptr->next = ptr->next->next; - table->num_entries--; - if (value != 0) *value = tmp->record; - *key = tmp->key; - free(tmp); - return 1; - } - } - - return 0; -} - -int -st_delete_safe(table, key, value, never) - register st_table *table; - register st_data_t *key; - st_data_t *value; - st_data_t never; -{ - unsigned int hash_val; - register st_table_entry *ptr; - - hash_val = do_hash_bin(*key, table); - ptr = table->bins[hash_val]; - - if (ptr == 0) { - if (value != 0) *value = 0; - return 0; - } - - for(; ptr != 0; ptr = ptr->next) { - if ((ptr->key != never) && EQUAL(table, ptr->key, *key)) { - table->num_entries--; - *key = ptr->key; - if (value != 0) *value = ptr->record; - ptr->key = ptr->record = never; - return 1; - } - } - - return 0; -} - -static int -delete_never(key, value, never) - st_data_t key, value, never; -{ - if (value == never) return ST_DELETE; - return ST_CONTINUE; -} - -void -st_cleanup_safe(table, never) - st_table *table; - st_data_t never; -{ - int num_entries = table->num_entries; - - st_foreach(table, delete_never, never); - table->num_entries = num_entries; -} - -int -st_foreach(table, func, arg) - st_table *table; - int (*func)(); - st_data_t arg; -{ - st_table_entry *ptr, *last, *tmp; - enum st_retval retval; - int i; - - for(i = 0; i < table->num_bins; i++) { - last = 0; - for(ptr = table->bins[i]; ptr != 0;) { - retval = (*func)(ptr->key, ptr->record, arg); - switch (retval) { - case ST_CHECK: /* check if hash is modified during iteration */ - tmp = 0; - if (i < table->num_bins) { - for (tmp = table->bins[i]; tmp; tmp=tmp->next) { - if (tmp == ptr) break; - } - } - if (!tmp) { - /* call func with error notice */ - return 1; - } - /* fall through */ - case ST_CONTINUE: - last = ptr; - ptr = ptr->next; - break; - case ST_STOP: - return 0; - case ST_DELETE: - tmp = ptr; - if (last == 0) { - table->bins[i] = ptr->next; - } - else { - last->next = ptr->next; - } - ptr = ptr->next; - free(tmp); - table->num_entries--; - } - } - } - return 0; -} - -static int -strhash(string) - register const char *string; -{ - register int c; - -#ifdef HASH_ELFHASH - register unsigned int h = 0, g; - - while ((c = *string++) != '\0') { - h = ( h << 4 ) + c; - if ( g = h & 0xF0000000 ) - h ^= g >> 24; - h &= ~g; - } - return h; -#elif defined(HASH_PERL) - register int val = 0; - - while ((c = *string++) != '\0') { - val += c; - val += (val << 10); - val ^= (val >> 6); - } - val += (val << 3); - val ^= (val >> 11); - - return val + (val << 15); -#else - register int val = 0; - - while ((c = *string++) != '\0') { - val = val*997 + c; - } - - return val + (val>>5); -#endif -} - -static int -numcmp(x, y) - long x, y; -{ - return x != y; -} - -static int -numhash(n) - long n; -{ - return n; -} -/********************************************************************** - - string.c - - - $Author: shyouhei $ - $Date: 2009-02-17 03:58:28 +0100 (Tue, 17 Feb 2009) $ - created at: Mon Aug 9 17:12:58 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#include "ruby.h" -#include "re.h" - -#define BEG(no) regs->beg[no] -#define END(no) regs->end[no] - -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -VALUE rb_cString; - -#define STR_TMPLOCK FL_USER1 -#define STR_ASSOC FL_USER3 -#define STR_NOCAPA (ELTS_SHARED|STR_ASSOC) - -#define RESIZE_CAPA(str,capacity) do {\ - REALLOC_N(RSTRING(str)->ptr, char, (capacity)+1);\ - if (!FL_TEST(str, STR_NOCAPA))\ - RSTRING(str)->aux.capa = (capacity);\ -} while (0) - -VALUE rb_fs; - -static inline void -str_mod_check(s, p, len) - VALUE s; - char *p; - long len; -{ - if (RSTRING(s)->ptr != p || RSTRING(s)->len != len) { - rb_raise(rb_eRuntimeError, "string modified"); - } -} - -static inline void -str_frozen_check(s) - VALUE s; -{ - if (OBJ_FROZEN(s)) { - rb_raise(rb_eRuntimeError, "string frozen"); - } -} - -static VALUE str_alloc _((VALUE)); -static VALUE -str_alloc(klass) - VALUE klass; -{ - NEWOBJ(str, struct RString); - OBJSETUP(str, klass, T_STRING); - - str->ptr = 0; - str->len = 0; - str->aux.capa = 0; - - return (VALUE)str; -} - -static VALUE -str_new(klass, ptr, len) - VALUE klass; - const char *ptr; - long len; -{ - VALUE str; - - if (len < 0) { - rb_raise(rb_eArgError, "negative string size (or size too big)"); - } - - str = str_alloc(klass); - RSTRING(str)->len = len; - RSTRING(str)->aux.capa = len; - RSTRING(str)->ptr = ALLOC_N(char,len+1); - if (ptr) { - memcpy(RSTRING(str)->ptr, ptr, len); - } - RSTRING(str)->ptr[len] = '\0'; - return str; -} - -VALUE -rb_str_new(ptr, len) - const char *ptr; - long len; -{ - return str_new(rb_cString, ptr, len); -} - -VALUE -rb_str_new2(ptr) - const char *ptr; -{ - if (!ptr) { - rb_raise(rb_eArgError, "NULL pointer given"); - } - return rb_str_new(ptr, strlen(ptr)); -} - -VALUE -rb_tainted_str_new(ptr, len) - const char *ptr; - long len; -{ - VALUE str = rb_str_new(ptr, len); - - OBJ_TAINT(str); - return str; -} - -VALUE -rb_tainted_str_new2(ptr) - const char *ptr; -{ - VALUE str = rb_str_new2(ptr); - - OBJ_TAINT(str); - return str; -} - -static VALUE -str_new3(klass, str) - VALUE klass, str; -{ - VALUE str2 = str_alloc(klass); - - RSTRING(str2)->len = RSTRING(str)->len; - RSTRING(str2)->ptr = RSTRING(str)->ptr; - RSTRING(str2)->aux.shared = str; - FL_SET(str2, ELTS_SHARED); - - return str2; -} - -VALUE -rb_str_new3(str) - VALUE str; -{ - VALUE str2 = str_new3(rb_obj_class(str), str); - - OBJ_INFECT(str2, str); - return str2; -} - -static VALUE -str_new4(klass, str) - VALUE klass, str; -{ - VALUE str2 = str_alloc(klass); - - RSTRING(str2)->len = RSTRING(str)->len; - RSTRING(str2)->ptr = RSTRING(str)->ptr; - if (FL_TEST(str, ELTS_SHARED)) { - FL_SET(str2, ELTS_SHARED); - RSTRING(str2)->aux.shared = RSTRING(str)->aux.shared; - } - else { - FL_SET(str, ELTS_SHARED); - RSTRING(str)->aux.shared = str2; - } - - return str2; -} - -VALUE -rb_str_new4(orig) - VALUE orig; -{ - VALUE klass, str; - - if (OBJ_FROZEN(orig)) return orig; - klass = rb_obj_class(orig); - if (FL_TEST(orig, ELTS_SHARED) && (str = RSTRING(orig)->aux.shared) && klass == RBASIC(str)->klass) { - long ofs; - ofs = RSTRING(str)->len - RSTRING(orig)->len; - if ((ofs > 0) || (!OBJ_TAINTED(str) && OBJ_TAINTED(orig))) { - str = str_new3(klass, str); - RSTRING(str)->ptr += ofs; - RSTRING(str)->len -= ofs; - } - } - else if (FL_TEST(orig, STR_ASSOC)) { - str = str_new(klass, RSTRING(orig)->ptr, RSTRING(orig)->len); - } - else { - str = str_new4(klass, orig); - } - OBJ_INFECT(str, orig); - OBJ_FREEZE(str); - return str; -} - -VALUE -rb_str_new5(obj, ptr, len) - VALUE obj; - const char *ptr; - long len; -{ - return str_new(rb_obj_class(obj), ptr, len); -} - -#define STR_BUF_MIN_SIZE 128 - -VALUE -rb_str_buf_new(capa) - long capa; -{ - VALUE str = str_alloc(rb_cString); - - if (capa < STR_BUF_MIN_SIZE) { - capa = STR_BUF_MIN_SIZE; - } - RSTRING(str)->ptr = 0; - RSTRING(str)->len = 0; - RSTRING(str)->aux.capa = capa; - RSTRING(str)->ptr = ALLOC_N(char, capa+1); - RSTRING(str)->ptr[0] = '\0'; - - return str; -} - -VALUE -rb_str_buf_new2(ptr) - const char *ptr; -{ - VALUE str; - long len = strlen(ptr); - - str = rb_str_buf_new(len); - rb_str_buf_cat(str, ptr, len); - - return str; -} - -VALUE -rb_str_to_str(str) - VALUE str; -{ - return rb_convert_type(str, T_STRING, "String", "to_str"); -} - -static void -rb_str_shared_replace(str, str2) - VALUE str, str2; -{ - if (str == str2) return; - rb_str_modify(str); - if (!FL_TEST(str, ELTS_SHARED)) free(RSTRING(str)->ptr); - if (NIL_P(str2)) { - RSTRING(str)->ptr = 0; - RSTRING(str)->len = 0; - RSTRING(str)->aux.capa = 0; - FL_UNSET(str, STR_NOCAPA); - return; - } - RSTRING(str)->ptr = RSTRING(str2)->ptr; - RSTRING(str)->len = RSTRING(str2)->len; - FL_UNSET(str, STR_NOCAPA); - if (FL_TEST(str2, STR_NOCAPA)) { - FL_SET(str, RBASIC(str2)->flags & STR_NOCAPA); - RSTRING(str)->aux.shared = RSTRING(str2)->aux.shared; - } - else { - RSTRING(str)->aux.capa = RSTRING(str2)->aux.capa; - } - RSTRING(str2)->ptr = 0; /* abandon str2 */ - RSTRING(str2)->len = 0; - RSTRING(str2)->aux.capa = 0; - FL_UNSET(str2, STR_NOCAPA); - if (OBJ_TAINTED(str2)) OBJ_TAINT(str); -} - -static ID id_to_s; - -VALUE -rb_obj_as_string(obj) - VALUE obj; -{ - VALUE str; - - if (TYPE(obj) == T_STRING) { - return obj; - } - str = rb_funcall(obj, id_to_s, 0); - if (TYPE(str) != T_STRING) - return rb_any_to_s(obj); - if (OBJ_TAINTED(obj)) OBJ_TAINT(str); - return str; -} - -static VALUE rb_str_s_alloc _((VALUE)); -static VALUE rb_str_replace _((VALUE, VALUE)); - -VALUE -rb_str_dup(str) - VALUE str; -{ - VALUE dup = str_alloc(rb_obj_class(str)); - rb_str_replace(dup, str); - return dup; -} - - -/* - * call-seq: - * String.new(str="") => new_str - * - * Returns a new string object containing a copy of str. - */ - -static VALUE -rb_str_init(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - VALUE orig; - - if (rb_scan_args(argc, argv, "01", &orig) == 1) - rb_str_replace(str, orig); - return str; -} - -/* - * call-seq: - * str.length => integer - * - * Returns the length of str. - */ - -static VALUE -rb_str_length(str) - VALUE str; -{ - return LONG2NUM(RSTRING(str)->len); -} - -/* - * call-seq: - * str.empty? => true or false - * - * Returns true if str has a length of zero. - * - * "hello".empty? #=> false - * "".empty? #=> true - */ - -static VALUE -rb_str_empty(str) - VALUE str; -{ - if (RSTRING(str)->len == 0) - return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * str + other_str => new_str - * - * Concatenation---Returns a new String containing - * other_str concatenated to str. - * - * "Hello from " + self.to_s #=> "Hello from main" - */ - -VALUE -rb_str_plus(str1, str2) - VALUE str1, str2; -{ - VALUE str3; - - StringValue(str2); - str3 = rb_str_new(0, RSTRING(str1)->len+RSTRING(str2)->len); - memcpy(RSTRING(str3)->ptr, RSTRING(str1)->ptr, RSTRING(str1)->len); - memcpy(RSTRING(str3)->ptr + RSTRING(str1)->len, - RSTRING(str2)->ptr, RSTRING(str2)->len); - RSTRING(str3)->ptr[RSTRING(str3)->len] = '\0'; - - if (OBJ_TAINTED(str1) || OBJ_TAINTED(str2)) - OBJ_TAINT(str3); - return str3; -} - -/* - * call-seq: - * str * integer => new_str - * - * Copy---Returns a new String containing integer copies of - * the receiver. - * - * "Ho! " * 3 #=> "Ho! Ho! Ho! " - */ - -VALUE -rb_str_times(str, times) - VALUE str; - VALUE times; -{ - VALUE str2; - long i, len; - - len = NUM2LONG(times); - if (len < 0) { - rb_raise(rb_eArgError, "negative argument"); - } - if (len && LONG_MAX/len < RSTRING(str)->len) { - rb_raise(rb_eArgError, "argument too big"); - } - - str2 = rb_str_new5(str,0, len *= RSTRING(str)->len); - for (i = 0; i < len; i += RSTRING(str)->len) { - memcpy(RSTRING(str2)->ptr + i, - RSTRING(str)->ptr, RSTRING(str)->len); - } - RSTRING(str2)->ptr[RSTRING(str2)->len] = '\0'; - - OBJ_INFECT(str2, str); - - return str2; -} - -/* - * call-seq: - * str % arg => new_str - * - * Format---Uses str as a format specification, and returns the result - * of applying it to arg. If the format specification contains more than - * one substitution, then arg must be an Array containing - * the values to be substituted. See Kernel::sprintf for details - * of the format string. - * - * "%05d" % 123 #=> "00123" - * "%-5s: %08x" % [ "ID", self.id ] #=> "ID : 200e14d6" - */ - -static VALUE -rb_str_format_m(str, arg) - VALUE str, arg; -{ - volatile VALUE tmp = rb_check_array_type(arg); - - if (!NIL_P(tmp)) { - return rb_str_format(RARRAY_LEN(tmp), RARRAY_PTR(tmp), str); - } - return rb_str_format(1, &arg, str); -} - -static const char null_str[] = ""; - -static int -str_independent(str) - VALUE str; -{ - if (FL_TEST(str, STR_TMPLOCK)) { - rb_raise(rb_eRuntimeError, "can't modify string; temporarily locked"); - } - if (OBJ_FROZEN(str)) rb_error_frozen("string"); - if (!OBJ_TAINTED(str) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't modify string"); - if (RSTRING(str)->ptr == null_str) return 0; - if (!FL_TEST(str, ELTS_SHARED)) return 1; - return 0; -} - -static void -str_make_independent(str) - VALUE str; -{ - char *ptr; - - ptr = ALLOC_N(char, RSTRING(str)->len+1); - if (RSTRING(str)->ptr) { - memcpy(ptr, RSTRING(str)->ptr, RSTRING(str)->len); - } - ptr[RSTRING(str)->len] = 0; - RSTRING(str)->ptr = ptr; - RSTRING(str)->aux.capa = RSTRING(str)->len; - FL_UNSET(str, STR_NOCAPA); -} - -void -rb_str_modify(str) - VALUE str; -{ - if (!str_independent(str)) - str_make_independent(str); -} - -void -rb_str_associate(str, add) - VALUE str, add; -{ - if (FL_TEST(str, STR_ASSOC)) { - /* already associated */ - rb_ary_concat(RSTRING(str)->aux.shared, add); - } - else { - if (FL_TEST(str, ELTS_SHARED)) { - str_make_independent(str); - } - else if (RSTRING(str)->aux.capa != RSTRING(str)->len) { - RESIZE_CAPA(str, RSTRING(str)->len); - } - RSTRING(str)->aux.shared = add; - FL_SET(str, STR_ASSOC); - } -} - -VALUE -rb_str_associated(str) - VALUE str; -{ - if (FL_TEST(str, STR_ASSOC)) { - return RSTRING(str)->aux.shared; - } - return Qfalse; -} - -#define make_null_str(s) do { \ - FL_SET(s, ELTS_SHARED); \ - RSTRING(s)->ptr = (char *)null_str; \ - RSTRING(s)->aux.shared = 0; \ - } while (0) - -static VALUE -rb_str_s_alloc(klass) - VALUE klass; -{ - VALUE str = str_alloc(klass); - make_null_str(str); - return str; -} - -VALUE -rb_string_value(ptr) - volatile VALUE *ptr; -{ - VALUE s = *ptr; - if (TYPE(s) != T_STRING) { - s = rb_str_to_str(s); - *ptr = s; - } - if (!RSTRING(s)->ptr) { - make_null_str(s); - } - return s; -} - -char * -rb_string_value_ptr(ptr) - volatile VALUE *ptr; -{ - return RSTRING(rb_string_value(ptr))->ptr; -} - -char * -rb_string_value_cstr(ptr) - volatile VALUE *ptr; -{ - VALUE str = rb_string_value(ptr); - char *s = RSTRING(str)->ptr; - - if (!s || RSTRING(str)->len != strlen(s)) { - rb_raise(rb_eArgError, "string contains null byte"); - } - return s; -} - -VALUE -rb_check_string_type(str) - VALUE str; -{ - str = rb_check_convert_type(str, T_STRING, "String", "to_str"); - if (!NIL_P(str) && !RSTRING(str)->ptr) { - make_null_str(str); - } - return str; -} - -VALUE -rb_str_substr(str, beg, len) - VALUE str; - long beg, len; -{ - VALUE str2; - - if (len < 0) return Qnil; - if (beg > RSTRING(str)->len) return Qnil; - if (beg < 0) { - beg += RSTRING(str)->len; - if (beg < 0) return Qnil; - } - if (beg + len > RSTRING(str)->len) { - len = RSTRING(str)->len - beg; - } - if (len < 0) { - len = 0; - } - if (len == 0) { - str2 = rb_str_new5(str,0,0); - } - else if (len > sizeof(struct RString)/2 && - beg + len == RSTRING(str)->len && !FL_TEST(str, STR_ASSOC)) { - str2 = rb_str_new4(str); - str2 = str_new3(rb_obj_class(str2), str2); - RSTRING(str2)->ptr += RSTRING(str2)->len - len; - RSTRING(str2)->len = len; - } - else { - str2 = rb_str_new5(str, RSTRING(str)->ptr+beg, len); - } - OBJ_INFECT(str2, str); - - return str2; -} - -VALUE -rb_str_freeze(str) - VALUE str; -{ - return rb_obj_freeze(str); -} - -VALUE -rb_str_dup_frozen(str) - VALUE str; -{ - if (FL_TEST(str, ELTS_SHARED) && RSTRING(str)->aux.shared) { - VALUE shared = RSTRING(str)->aux.shared; - if (RSTRING(shared)->len == RSTRING(str)->len) { - OBJ_FREEZE(shared); - return shared; - } - } - if (OBJ_FROZEN(str)) return str; - str = rb_str_dup(str); - OBJ_FREEZE(str); - return str; -} - -VALUE -rb_str_locktmp(str) - VALUE str; -{ - if (FL_TEST(str, STR_TMPLOCK)) { - rb_raise(rb_eRuntimeError, "temporal locking already locked string"); - } - FL_SET(str, STR_TMPLOCK); - return str; -} - -VALUE -rb_str_unlocktmp(str) - VALUE str; -{ - if (!FL_TEST(str, STR_TMPLOCK)) { - rb_raise(rb_eRuntimeError, "temporal unlocking already unlocked string"); - } - FL_UNSET(str, STR_TMPLOCK); - return str; -} - -VALUE -rb_str_resize(str, len) - VALUE str; - long len; -{ - if (len < 0) { - rb_raise(rb_eArgError, "negative string size (or size too big)"); - } - - rb_str_modify(str); - if (len != RSTRING(str)->len) { - if (RSTRING(str)->len < len || RSTRING(str)->len - len > 1024) { - REALLOC_N(RSTRING(str)->ptr, char, len+1); - if (!FL_TEST(str, STR_NOCAPA)) { - RSTRING(str)->aux.capa = len; - } - } - RSTRING(str)->len = len; - RSTRING(str)->ptr[len] = '\0'; /* sentinel */ - } - return str; -} - -static VALUE -str_buf_cat(str, ptr, len) - VALUE str; - const char *ptr; - long len; -{ - long capa, total, off = -1;; - - rb_str_modify(str); - if (ptr >= RSTRING(str)->ptr && ptr <= RSTRING(str)->ptr + RSTRING(str)->len) { - off = ptr - RSTRING(str)->ptr; - } - if (len == 0) return 0; - if (FL_TEST(str, STR_ASSOC)) { - FL_UNSET(str, STR_ASSOC); - capa = RSTRING(str)->aux.capa = RSTRING(str)->len; - } - else { - capa = RSTRING(str)->aux.capa; - } - if (RSTRING(str)->len >= LONG_MAX - len) { - rb_raise(rb_eArgError, "string sizes too big"); - } - total = RSTRING(str)->len+len; - if (capa <= total) { - while (total > capa) { - if (capa + 1 >= LONG_MAX / 2) { - capa = total; - break; - } - capa = (capa + 1) * 2; - } - RESIZE_CAPA(str, capa); - } - if (off != -1) { - ptr = RSTRING(str)->ptr + off; - } - memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len); - RSTRING(str)->len = total; - RSTRING(str)->ptr[total] = '\0'; /* sentinel */ - - return str; -} - -VALUE -rb_str_buf_cat(str, ptr, len) - VALUE str; - const char *ptr; - long len; -{ - if (len == 0) return str; - if (len < 0) { - rb_raise(rb_eArgError, "negative string size (or size too big)"); - } - return str_buf_cat(str, ptr, len); -} - -VALUE -rb_str_buf_cat2(str, ptr) - VALUE str; - const char *ptr; -{ - return rb_str_buf_cat(str, ptr, strlen(ptr)); -} - -VALUE -rb_str_cat(str, ptr, len) - VALUE str; - const char *ptr; - long len; -{ - if (len < 0) { - rb_raise(rb_eArgError, "negative string size (or size too big)"); - } - if (FL_TEST(str, STR_ASSOC)) { - rb_str_modify(str); - REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len+len+1); - memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len); - RSTRING(str)->len += len; - RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; /* sentinel */ - return str; - } - - return rb_str_buf_cat(str, ptr, len); -} - -VALUE -rb_str_cat2(str, ptr) - VALUE str; - const char *ptr; -{ - return rb_str_cat(str, ptr, strlen(ptr)); -} - -VALUE -rb_str_buf_append(str, str2) - VALUE str, str2; -{ - str_buf_cat(str, RSTRING(str2)->ptr, RSTRING(str2)->len); - OBJ_INFECT(str, str2); - return str; -} - -VALUE -rb_str_append(str, str2) - VALUE str, str2; -{ - StringValue(str2); - rb_str_modify(str); - if (RSTRING(str2)->len > 0) { - if (FL_TEST(str, STR_ASSOC)) { - long len = RSTRING(str)->len+RSTRING(str2)->len; - REALLOC_N(RSTRING(str)->ptr, char, len+1); - memcpy(RSTRING(str)->ptr + RSTRING(str)->len, - RSTRING(str2)->ptr, RSTRING(str2)->len); - RSTRING(str)->ptr[len] = '\0'; /* sentinel */ - RSTRING(str)->len = len; - } - else { - return rb_str_buf_append(str, str2); - } - } - OBJ_INFECT(str, str2); - return str; -} - - -/* - * call-seq: - * str << fixnum => str - * str.concat(fixnum) => str - * str << obj => str - * str.concat(obj) => str - * - * Append---Concatenates the given object to str. If the object is a - * Fixnum between 0 and 255, it is converted to a character before - * concatenation. - * - * a = "hello " - * a << "world" #=> "hello world" - * a.concat(33) #=> "hello world!" - */ - -VALUE -rb_str_concat(str1, str2) - VALUE str1, str2; -{ - if (FIXNUM_P(str2)) { - int i = FIX2INT(str2); - if (0 <= i && i <= 0xff) { /* byte */ - char c = i; - return rb_str_cat(str1, &c, 1); - } - } - str1 = rb_str_append(str1, str2); - - return str1; -} - -int -rb_str_hash(str) - VALUE str; -{ - register long len = RSTRING(str)->len; - register char *p = RSTRING(str)->ptr; - register int key = 0; - -#if defined(HASH_ELFHASH) - register unsigned int g; - - while (len--) { - key = (key << 4) + *p++; - if (g = key & 0xF0000000) - key ^= g >> 24; - key &= ~g; - } -#elif defined(HASH_PERL) - while (len--) { - key += *p++; - key += (key << 10); - key ^= (key >> 6); - } - key += (key << 3); - key ^= (key >> 11); - key += (key << 15); -#else - while (len--) { - key = key*65599 + *p; - p++; - } - key = key + (key>>5); -#endif - return key; -} - -/* - * call-seq: - * str.hash => fixnum - * - * Return a hash based on the string's length and content. - */ - -static VALUE -rb_str_hash_m(str) - VALUE str; -{ - int key = rb_str_hash(str); - return INT2FIX(key); -} - -#define lesser(a,b) (((a)>(b))?(b):(a)) - -int -rb_str_cmp(str1, str2) - VALUE str1, str2; -{ - long len; - int retval; - - len = lesser(RSTRING(str1)->len, RSTRING(str2)->len); - retval = rb_memcmp(RSTRING(str1)->ptr, RSTRING(str2)->ptr, len); - if (retval == 0) { - if (RSTRING(str1)->len == RSTRING(str2)->len) return 0; - if (RSTRING(str1)->len > RSTRING(str2)->len) return 1; - return -1; - } - if (retval > 0) return 1; - return -1; -} - - -/* - * call-seq: - * str == obj => true or false - * - * Equality---If obj is not a String, returns - * false. Otherwise, returns true if str - * <=> obj returns zero. - */ - -static VALUE -rb_str_equal(str1, str2) - VALUE str1, str2; -{ - if (str1 == str2) return Qtrue; - if (TYPE(str2) != T_STRING) { - if (!rb_respond_to(str2, rb_intern("to_str"))) { - return Qfalse; - } - return rb_equal(str2, str1); - } - if (RSTRING(str1)->len == RSTRING(str2)->len && - rb_str_cmp(str1, str2) == 0) { - return Qtrue; - } - return Qfalse; -} - -#define IS_EVSTR(p,e) ((p) < (e) && (*(p) == '$' || *(p) == '@' || *(p) == '{')) - -/* - * call-seq: - * str.eql?(other) => true or false - * - * Two strings are equal if the have the same length and content. - */ - -static VALUE -rb_str_eql(str1, str2) - VALUE str1, str2; -{ - if (TYPE(str2) != T_STRING || RSTRING(str1)->len != RSTRING(str2)->len) - return Qfalse; - - if (memcmp(RSTRING(str1)->ptr, RSTRING(str2)->ptr, - lesser(RSTRING(str1)->len, RSTRING(str2)->len)) == 0) - return Qtrue; - - return Qfalse; -} - -/* - * call-seq: - * str <=> other_str => -1, 0, +1 - * - * Comparison---Returns -1 if other_str is less than, 0 if - * other_str is equal to, and +1 if other_str is greater than - * str. If the strings are of different lengths, and the strings are - * equal when compared up to the shortest length, then the longer string is - * considered greater than the shorter one. If the variable $= is - * false, the comparison is based on comparing the binary values - * of each character in the string. In older versions of Ruby, setting - * $= allowed case-insensitive comparisons; this is now deprecated - * in favor of using String#casecmp. - * - * <=> is the basis for the methods <, - * <=, >, >=, and between?, - * included from module Comparable. The method - * String#== does not use Comparable#==. - * - * "abcdef" <=> "abcde" #=> 1 - * "abcdef" <=> "abcdef" #=> 0 - * "abcdef" <=> "abcdefg" #=> -1 - * "abcdef" <=> "ABCDEF" #=> 1 - */ - -static VALUE -rb_str_cmp_m(str1, str2) - VALUE str1, str2; -{ - long result; - - if (TYPE(str2) != T_STRING) { - if (!rb_respond_to(str2, rb_intern("to_str"))) { - return Qnil; - } - else if (!rb_respond_to(str2, rb_intern("<=>"))) { - return Qnil; - } - else { - VALUE tmp = rb_funcall(str2, rb_intern("<=>"), 1, str1); - - if (NIL_P(tmp)) return Qnil; - if (!FIXNUM_P(tmp)) { - return rb_funcall(LONG2FIX(0), '-', 1, tmp); - } - result = -FIX2LONG(tmp); - } - } - else { - result = rb_str_cmp(str1, str2); - } - return LONG2NUM(result); -} - -/* - * call-seq: - * str.casecmp(other_str) => -1, 0, +1 - * - * Case-insensitive version of String#<=>. - * - * "abcdef".casecmp("abcde") #=> 1 - * "aBcDeF".casecmp("abcdef") #=> 0 - * "abcdef".casecmp("abcdefg") #=> -1 - * "abcdef".casecmp("ABCDEF") #=> 0 - */ - -static VALUE -rb_str_casecmp(str1, str2) - VALUE str1, str2; -{ - long len; - int retval; - - StringValue(str2); - len = lesser(RSTRING(str1)->len, RSTRING(str2)->len); - retval = rb_memcicmp(RSTRING(str1)->ptr, RSTRING(str2)->ptr, len); - if (retval == 0) { - if (RSTRING(str1)->len == RSTRING(str2)->len) return INT2FIX(0); - if (RSTRING(str1)->len > RSTRING(str2)->len) return INT2FIX(1); - return INT2FIX(-1); - } - if (retval == 0) return INT2FIX(0); - if (retval > 0) return INT2FIX(1); - return INT2FIX(-1); -} - -static long -rb_str_index(str, sub, offset) - VALUE str, sub; - long offset; -{ - long pos; - - if (offset < 0) { - offset += RSTRING(str)->len; - if (offset < 0) return -1; - } - if (RSTRING(str)->len - offset < RSTRING(sub)->len) return -1; - if (RSTRING(sub)->len == 0) return offset; - pos = rb_memsearch(RSTRING(sub)->ptr, RSTRING(sub)->len, - RSTRING(str)->ptr+offset, RSTRING(str)->len-offset); - if (pos < 0) return pos; - return pos + offset; -} - - -/* - * call-seq: - * str.index(substring [, offset]) => fixnum or nil - * str.index(fixnum [, offset]) => fixnum or nil - * str.index(regexp [, offset]) => fixnum or nil - * - * Returns the index of the first occurrence of the given substring, - * character (fixnum), or pattern (regexp) in str. Returns - * nil if not found. If the second parameter is present, it - * specifies the position in the string to begin the search. - * - * "hello".index('e') #=> 1 - * "hello".index('lo') #=> 3 - * "hello".index('a') #=> nil - * "hello".index(101) #=> 1 - * "hello".index(/[aeiou]/, -3) #=> 4 - */ - -static VALUE -rb_str_index_m(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - VALUE sub; - VALUE initpos; - long pos; - - if (rb_scan_args(argc, argv, "11", &sub, &initpos) == 2) { - pos = NUM2LONG(initpos); - } - else { - pos = 0; - } - if (pos < 0) { - pos += RSTRING(str)->len; - if (pos < 0) { - if (TYPE(sub) == T_REGEXP) { - rb_backref_set(Qnil); - } - return Qnil; - } - } - - switch (TYPE(sub)) { - case T_REGEXP: - pos = rb_reg_adjust_startpos(sub, str, pos, 0); - pos = rb_reg_search(sub, str, pos, 0); - break; - - case T_FIXNUM: - { - int c = FIX2INT(sub); - long len = RSTRING(str)->len; - unsigned char *p = (unsigned char*)RSTRING(str)->ptr; - - for (;poslen; - char *s, *sbeg, *t; - - /* substring longer than string */ - if (RSTRING(str)->len < len) return -1; - if (RSTRING(str)->len - pos < len) { - pos = RSTRING(str)->len - len; - } - sbeg = RSTRING(str)->ptr; - s = RSTRING(str)->ptr + pos; - t = RSTRING(sub)->ptr; - if (len) { - while (sbeg <= s) { - if (rb_memcmp(s, t, len) == 0) { - return s - RSTRING(str)->ptr; - } - s--; - } - return -1; - } - else { - return pos; - } -} - - -/* - * call-seq: - * str.rindex(substring [, fixnum]) => fixnum or nil - * str.rindex(fixnum [, fixnum]) => fixnum or nil - * str.rindex(regexp [, fixnum]) => fixnum or nil - * - * Returns the index of the last occurrence of the given substring, - * character (fixnum), or pattern (regexp) in str. Returns - * nil if not found. If the second parameter is present, it - * specifies the position in the string to end the search---characters beyond - * this point will not be considered. - * - * "hello".rindex('e') #=> 1 - * "hello".rindex('l') #=> 3 - * "hello".rindex('a') #=> nil - * "hello".rindex(101) #=> 1 - * "hello".rindex(/[aeiou]/, -2) #=> 1 - */ - -static VALUE -rb_str_rindex_m(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - VALUE sub; - VALUE position; - long pos; - - if (rb_scan_args(argc, argv, "11", &sub, &position) == 2) { - pos = NUM2LONG(position); - if (pos < 0) { - pos += RSTRING(str)->len; - if (pos < 0) { - if (TYPE(sub) == T_REGEXP) { - rb_backref_set(Qnil); - } - return Qnil; - } - } - if (pos > RSTRING(str)->len) pos = RSTRING(str)->len; - } - else { - pos = RSTRING(str)->len; - } - - switch (TYPE(sub)) { - case T_REGEXP: - if (RREGEXP(sub)->len) { - pos = rb_reg_adjust_startpos(sub, str, pos, 1); - pos = rb_reg_search(sub, str, pos, 1); - } - if (pos >= 0) return LONG2NUM(pos); - break; - - case T_STRING: - pos = rb_str_rindex(str, sub, pos); - if (pos >= 0) return LONG2NUM(pos); - break; - - case T_FIXNUM: - { - int c = FIX2INT(sub); - unsigned char *p = (unsigned char*)RSTRING(str)->ptr + pos; - unsigned char *pbeg = (unsigned char*)RSTRING(str)->ptr; - - if (pos == RSTRING(str)->len) { - if (pos == 0) return Qnil; - --p; - } - while (pbeg <= p) { - if (*p == c) return LONG2NUM((char*)p - RSTRING(str)->ptr); - p--; - } - return Qnil; - } - - default: - rb_raise(rb_eTypeError, "type mismatch: %s given", - rb_obj_classname(sub)); - } - return Qnil; -} - -/* - * call-seq: - * str =~ obj => fixnum or nil - * - * Match---If obj is a Regexp, use it as a pattern to match - * against str,and returns the position the match starts, or - * nil if there is no match. Otherwise, invokes - * obj.=~, passing str as an argument. The default - * =~ in Object returns false. - * - * "cat o' 9 tails" =~ /\d/ #=> 7 - * "cat o' 9 tails" =~ 9 #=> false - */ - -static VALUE -rb_str_match(x, y) - VALUE x, y; -{ - switch (TYPE(y)) { - case T_STRING: - rb_raise(rb_eTypeError, "type mismatch: String given"); - - case T_REGEXP: - return rb_reg_match(y, x); - - default: - return rb_funcall(y, rb_intern("=~"), 1, x); - } -} - - -static VALUE get_pat _((VALUE, int)); - - -/* - * call-seq: - * str.match(pattern) => matchdata or nil - * - * Converts pattern to a Regexp (if it isn't already one), - * then invokes its match method on str. - * - * 'hello'.match('(.)\1') #=> # - * 'hello'.match('(.)\1')[0] #=> "ll" - * 'hello'.match(/(.)\1/)[0] #=> "ll" - * 'hello'.match('xx') #=> nil - */ - -static VALUE -rb_str_match_m(str, re) - VALUE str, re; -{ - return rb_funcall(get_pat(re, 0), rb_intern("match"), 1, str); -} - -static char -succ_char(s) - char *s; -{ - char c = *s; - - /* numerics */ - if ('0' <= c && c < '9') (*s)++; - else if (c == '9') { - *s = '0'; - return '1'; - } - /* small alphabets */ - else if ('a' <= c && c < 'z') (*s)++; - else if (c == 'z') { - return *s = 'a'; - } - /* capital alphabets */ - else if ('A' <= c && c < 'Z') (*s)++; - else if (c == 'Z') { - return *s = 'A'; - } - return 0; -} - - -/* - * call-seq: - * str.succ => new_str - * str.next => new_str - * - * Returns the successor to str. The successor is calculated by - * incrementing characters starting from the rightmost alphanumeric (or - * the rightmost character if there are no alphanumerics) in the - * string. Incrementing a digit always results in another digit, and - * incrementing a letter results in another letter of the same case. - * Incrementing nonalphanumerics uses the underlying character set's - * collating sequence. - * - * If the increment generates a ``carry,'' the character to the left of - * it is incremented. This process repeats until there is no carry, - * adding an additional character if necessary. - * - * "abcd".succ #=> "abce" - * "THX1138".succ #=> "THX1139" - * "<>".succ #=> "<>" - * "1999zzz".succ #=> "2000aaa" - * "ZZZ9999".succ #=> "AAAA0000" - * "***".succ #=> "**+" - */ - -static VALUE -rb_str_succ(orig) - VALUE orig; -{ - VALUE str; - char *sbeg, *s; - int c = -1; - long n = 0; - - str = rb_str_new5(orig, RSTRING(orig)->ptr, RSTRING(orig)->len); - OBJ_INFECT(str, orig); - if (RSTRING(str)->len == 0) return str; - - sbeg = RSTRING(str)->ptr; s = sbeg + RSTRING(str)->len - 1; - - while (sbeg <= s) { - if (ISALNUM(*s)) { - if ((c = succ_char(s)) == 0) break; - n = s - sbeg; - } - s--; - } - if (c == -1) { /* str contains no alnum */ - sbeg = RSTRING(str)->ptr; s = sbeg + RSTRING(str)->len - 1; - c = '\001'; - while (sbeg <= s) { - if ((*s += 1) != 0) break; - s--; - } - } - if (s < sbeg) { - RESIZE_CAPA(str, RSTRING(str)->len + 1); - s = RSTRING(str)->ptr + n; - memmove(s+1, s, RSTRING(str)->len - n); - *s = c; - RSTRING(str)->len += 1; - RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; - } - - return str; -} - - -/* - * call-seq: - * str.succ! => str - * str.next! => str - * - * Equivalent to String#succ, but modifies the receiver in - * place. - */ - -static VALUE -rb_str_succ_bang(str) - VALUE str; -{ - rb_str_shared_replace(str, rb_str_succ(str)); - - return str; -} - -VALUE -rb_str_upto(beg, end, excl) - VALUE beg, end; - int excl; -{ - VALUE current, after_end; - ID succ = rb_intern("succ"); - int n; - - StringValue(end); - n = rb_str_cmp(beg, end); - if (n > 0 || (excl && n == 0)) return beg; - after_end = rb_funcall(end, succ, 0, 0); - current = beg; - while (!rb_str_equal(current, after_end)) { - rb_yield(current); - if (!excl && rb_str_equal(current, end)) break; - current = rb_funcall(current, succ, 0, 0); - StringValue(current); - if (excl && rb_str_equal(current, end)) break; - StringValue(current); - if (RSTRING(current)->len > RSTRING(end)->len || RSTRING(current)->len == 0) - break; - } - - return beg; -} - - -/* - * call-seq: - * str.upto(other_str) {|s| block } => str - * - * Iterates through successive values, starting at str and - * ending at other_str inclusive, passing each value in turn to - * the block. The String#succ method is used to generate - * each value. - * - * "a8".upto("b6") {|s| print s, ' ' } - * for s in "a8".."b6" - * print s, ' ' - * end - * - * produces: - * - * a8 a9 b0 b1 b2 b3 b4 b5 b6 - * a8 a9 b0 b1 b2 b3 b4 b5 b6 - */ - -static VALUE -rb_str_upto_m(beg, end) - VALUE beg, end; -{ - return rb_str_upto(beg, end, Qfalse); -} - -static VALUE -rb_str_subpat(str, re, nth) - VALUE str, re; - int nth; -{ - if (rb_reg_search(re, str, 0, 0) >= 0) { - return rb_reg_nth_match(nth, rb_backref_get()); - } - return Qnil; -} - -static VALUE -rb_str_aref(str, indx) - VALUE str; - VALUE indx; -{ - long idx; - - switch (TYPE(indx)) { - case T_FIXNUM: - idx = FIX2LONG(indx); - - num_index: - if (idx < 0) { - idx = RSTRING(str)->len + idx; - } - if (idx < 0 || RSTRING(str)->len <= idx) { - return Qnil; - } - return INT2FIX(RSTRING(str)->ptr[idx] & 0xff); - - case T_REGEXP: - return rb_str_subpat(str, indx, 0); - - case T_STRING: - if (rb_str_index(str, indx, 0) != -1) - return rb_str_dup(indx); - return Qnil; - - default: - /* check if indx is Range */ - { - long beg, len; - VALUE tmp; - - switch (rb_range_beg_len(indx, &beg, &len, RSTRING(str)->len, 0)) { - case Qfalse: - break; - case Qnil: - return Qnil; - default: - tmp = rb_str_substr(str, beg, len); - OBJ_INFECT(tmp, indx); - return tmp; - } - } - idx = NUM2LONG(indx); - goto num_index; - } - return Qnil; /* not reached */ -} - - -/* - * call-seq: - * str[fixnum] => fixnum or nil - * str[fixnum, fixnum] => new_str or nil - * str[range] => new_str or nil - * str[regexp] => new_str or nil - * str[regexp, fixnum] => new_str or nil - * str[other_str] => new_str or nil - * str.slice(fixnum) => fixnum or nil - * str.slice(fixnum, fixnum) => new_str or nil - * str.slice(range) => new_str or nil - * str.slice(regexp) => new_str or nil - * str.slice(regexp, fixnum) => new_str or nil - * str.slice(other_str) => new_str or nil - * - * Element Reference---If passed a single Fixnum, returns the code - * of the character at that position. If passed two Fixnum - * objects, returns a substring starting at the offset given by the first, and - * a length given by the second. If given a range, a substring containing - * characters at offsets given by the range is returned. In all three cases, if - * an offset is negative, it is counted from the end of str. Returns - * nil if the initial offset falls outside the string, the length - * is negative, or the beginning of the range is greater than the end. - * - * If a Regexp is supplied, the matching portion of str is - * returned. If a numeric parameter follows the regular expression, that - * component of the MatchData is returned instead. If a - * String is given, that string is returned if it occurs in - * str. In both cases, nil is returned if there is no - * match. - * - * a = "hello there" - * a[1] #=> 101 - * a[1,3] #=> "ell" - * a[1..3] #=> "ell" - * a[-3,2] #=> "er" - * a[-4..-2] #=> "her" - * a[12..-1] #=> nil - * a[-2..-4] #=> "" - * a[/[aeiou](.)\1/] #=> "ell" - * a[/[aeiou](.)\1/, 0] #=> "ell" - * a[/[aeiou](.)\1/, 1] #=> "l" - * a[/[aeiou](.)\1/, 2] #=> nil - * a["lo"] #=> "lo" - * a["bye"] #=> nil - */ - -static VALUE -rb_str_aref_m(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - if (argc == 2) { - if (TYPE(argv[0]) == T_REGEXP) { - return rb_str_subpat(str, argv[0], NUM2INT(argv[1])); - } - return rb_str_substr(str, NUM2LONG(argv[0]), NUM2LONG(argv[1])); - } - if (argc != 1) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc); - } - return rb_str_aref(str, argv[0]); -} - -static void -rb_str_splice(str, beg, len, val) - VALUE str; - long beg, len; - VALUE val; -{ - if (len < 0) rb_raise(rb_eIndexError, "negative length %ld", len); - - StringValue(val); - rb_str_modify(str); - - if (RSTRING(str)->len < beg) { - out_of_range: - rb_raise(rb_eIndexError, "index %ld out of string", beg); - } - if (beg < 0) { - if (-beg > RSTRING(str)->len) { - goto out_of_range; - } - beg += RSTRING(str)->len; - } - if (RSTRING(str)->len < len || RSTRING(str)->len < beg + len) { - len = RSTRING(str)->len - beg; - } - - if (len < RSTRING(val)->len) { - /* expand string */ - RESIZE_CAPA(str, RSTRING(str)->len + RSTRING(val)->len - len + 1); - } - - if (RSTRING(val)->len != len) { - memmove(RSTRING(str)->ptr + beg + RSTRING(val)->len, - RSTRING(str)->ptr + beg + len, - RSTRING(str)->len - (beg + len)); - } - if (RSTRING(str)->len < beg && len < 0) { - MEMZERO(RSTRING(str)->ptr + RSTRING(str)->len, char, -len); - } - if (RSTRING(val)->len > 0) { - memmove(RSTRING(str)->ptr+beg, RSTRING(val)->ptr, RSTRING(val)->len); - } - RSTRING(str)->len += RSTRING(val)->len - len; - if (RSTRING(str)->ptr) { - RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; - } - OBJ_INFECT(str, val); -} - -void -rb_str_update(str, beg, len, val) - VALUE str; - long beg, len; - VALUE val; -{ - rb_str_splice(str, beg, len, val); -} - -static void -rb_str_subpat_set(str, re, nth, val) - VALUE str, re; - int nth; - VALUE val; -{ - VALUE match; - long start, end, len; - - if (rb_reg_search(re, str, 0, 0) < 0) { - rb_raise(rb_eIndexError, "regexp not matched"); - } - match = rb_backref_get(); - if (nth >= RMATCH(match)->regs->num_regs) { - out_of_range: - rb_raise(rb_eIndexError, "index %d out of regexp", nth); - } - if (nth < 0) { - if (-nth >= RMATCH(match)->regs->num_regs) { - goto out_of_range; - } - nth += RMATCH(match)->regs->num_regs; - } - - start = RMATCH(match)->BEG(nth); - if (start == -1) { - rb_raise(rb_eIndexError, "regexp group %d not matched", nth); - } - end = RMATCH(match)->END(nth); - len = end - start; - rb_str_splice(str, start, len, val); -} - -static VALUE -rb_str_aset(str, indx, val) - VALUE str; - VALUE indx, val; -{ - long idx, beg; - - switch (TYPE(indx)) { - case T_FIXNUM: - idx = FIX2LONG(indx); - num_index: - if (RSTRING(str)->len <= idx) { - out_of_range: - rb_raise(rb_eIndexError, "index %ld out of string", idx); - } - if (idx < 0) { - if (-idx > RSTRING(str)->len) - goto out_of_range; - idx += RSTRING(str)->len; - } - if (FIXNUM_P(val)) { - rb_str_modify(str); - if (RSTRING(str)->len == idx) { - RSTRING(str)->len += 1; - RESIZE_CAPA(str, RSTRING(str)->len); - } - RSTRING(str)->ptr[idx] = FIX2INT(val) & 0xff; - } - else { - rb_str_splice(str, idx, 1, val); - } - return val; - - case T_REGEXP: - rb_str_subpat_set(str, indx, 0, val); - return val; - - case T_STRING: - beg = rb_str_index(str, indx, 0); - if (beg < 0) { - rb_raise(rb_eIndexError, "string not matched"); - } - rb_str_splice(str, beg, RSTRING(indx)->len, val); - return val; - - default: - /* check if indx is Range */ - { - long beg, len; - if (rb_range_beg_len(indx, &beg, &len, RSTRING(str)->len, 2)) { - rb_str_splice(str, beg, len, val); - return val; - } - } - idx = NUM2LONG(indx); - goto num_index; - } -} - -/* - * call-seq: - * str[fixnum] = fixnum - * str[fixnum] = new_str - * str[fixnum, fixnum] = new_str - * str[range] = aString - * str[regexp] = new_str - * str[regexp, fixnum] = new_str - * str[other_str] = new_str - * - * Element Assignment---Replaces some or all of the content of str. The - * portion of the string affected is determined using the same criteria as - * String#[]. If the replacement string is not the same length as - * the text it is replacing, the string will be adjusted accordingly. If the - * regular expression or string is used as the index doesn't match a position - * in the string, IndexError is raised. If the regular expression - * form is used, the optional second Fixnum allows you to specify - * which portion of the match to replace (effectively using the - * MatchData indexing rules. The forms that take a - * Fixnum will raise an IndexError if the value is - * out of range; the Range form will raise a - * RangeError, and the Regexp and String - * forms will silently ignore the assignment. - */ - -static VALUE -rb_str_aset_m(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - if (argc == 3) { - if (TYPE(argv[0]) == T_REGEXP) { - rb_str_subpat_set(str, argv[0], NUM2INT(argv[1]), argv[2]); - } - else { - rb_str_splice(str, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]); - } - return argv[2]; - } - if (argc != 2) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc); - } - return rb_str_aset(str, argv[0], argv[1]); -} - -/* - * call-seq: - * str.insert(index, other_str) => str - * - * Inserts other_str before the character at the given - * index, modifying str. Negative indices count from the - * end of the string, and insert after the given character. - * The intent is insert aString so that it starts at the given - * index. - * - * "abcd".insert(0, 'X') #=> "Xabcd" - * "abcd".insert(3, 'X') #=> "abcXd" - * "abcd".insert(4, 'X') #=> "abcdX" - * "abcd".insert(-3, 'X') #=> "abXcd" - * "abcd".insert(-1, 'X') #=> "abcdX" - */ - -static VALUE -rb_str_insert(str, idx, str2) - VALUE str, idx, str2; -{ - long pos = NUM2LONG(idx); - - if (pos == -1) { - pos = RSTRING(str)->len; - } - else if (pos < 0) { - pos++; - } - rb_str_splice(str, pos, 0, str2); - return str; -} - -/* - * call-seq: - * str.slice!(fixnum) => fixnum or nil - * str.slice!(fixnum, fixnum) => new_str or nil - * str.slice!(range) => new_str or nil - * str.slice!(regexp) => new_str or nil - * str.slice!(other_str) => new_str or nil - * - * Deletes the specified portion from str, and returns the portion - * deleted. The forms that take a Fixnum will raise an - * IndexError if the value is out of range; the Range - * form will raise a RangeError, and the Regexp and - * String forms will silently ignore the assignment. - * - * string = "this is a string" - * string.slice!(2) #=> 105 - * string.slice!(3..6) #=> " is " - * string.slice!(/s.*t/) #=> "sa st" - * string.slice!("r") #=> "r" - * string #=> "thing" - */ - -static VALUE -rb_str_slice_bang(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - VALUE result; - VALUE buf[3]; - int i; - - if (argc < 1 || 2 < argc) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc); - } - for (i=0; i str or nil - * str.sub!(pattern) {|match| block } => str or nil - * - * Performs the substitutions of String#sub in place, - * returning str, or nil if no substitutions were - * performed. - */ - -static VALUE -rb_str_sub_bang(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - VALUE pat, repl, match; - struct re_registers *regs; - int iter = 0; - int tainted = 0; - long plen; - - if (argc == 1 && rb_block_given_p()) { - iter = 1; - } - else if (argc == 2) { - repl = argv[1]; - StringValue(repl); - if (OBJ_TAINTED(repl)) tainted = 1; - } - else { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc); - } - - pat = get_pat(argv[0], 1); - if (rb_reg_search(pat, str, 0, 0) >= 0) { - match = rb_backref_get(); - regs = RMATCH(match)->regs; - - if (iter) { - char *p = RSTRING(str)->ptr; long len = RSTRING(str)->len; - - rb_match_busy(match); - repl = rb_obj_as_string(rb_yield(rb_reg_nth_match(0, match))); - str_mod_check(str, p, len); - str_frozen_check(str); - rb_backref_set(match); - } - else { - repl = rb_reg_regsub(repl, str, regs); - } - rb_str_modify(str); - if (OBJ_TAINTED(repl)) tainted = 1; - plen = END(0) - BEG(0); - if (RSTRING(repl)->len > plen) { - RESIZE_CAPA(str, RSTRING(str)->len + RSTRING(repl)->len - plen); - } - if (RSTRING(repl)->len != plen) { - memmove(RSTRING(str)->ptr + BEG(0) + RSTRING(repl)->len, - RSTRING(str)->ptr + BEG(0) + plen, - RSTRING(str)->len - BEG(0) - plen); - } - memcpy(RSTRING(str)->ptr + BEG(0), - RSTRING(repl)->ptr, RSTRING(repl)->len); - RSTRING(str)->len += RSTRING(repl)->len - plen; - RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; - if (tainted) OBJ_TAINT(str); - - return str; - } - return Qnil; -} - - -/* - * call-seq: - * str.sub(pattern, replacement) => new_str - * str.sub(pattern) {|match| block } => new_str - * - * Returns a copy of str with the first occurrence of - * pattern replaced with either replacement or the value of the - * block. The pattern will typically be a Regexp; if it is - * a String then no regular expression metacharacters will be - * interpreted (that is /\d/ will match a digit, but - * '\d' will match a backslash followed by a 'd'). - * - * If the method call specifies replacement, special variables such as - * $& will not be useful, as substitution into the string occurs - * before the pattern match starts. However, the sequences \1, - * \2, etc., may be used. - * - * In the block form, the current match string is passed in as a parameter, and - * variables such as $1, $2, $`, - * $&, and $' will be set appropriately. The value - * returned by the block will be substituted for the match on each call. - * - * The result inherits any tainting in the original string or any supplied - * replacement string. - * - * "hello".sub(/[aeiou]/, '*') #=> "h*llo" - * "hello".sub(/([aeiou])/, '<\1>') #=> "hllo" - * "hello".sub(/./) {|s| s[0].to_s + ' ' } #=> "104 ello" - */ - -static VALUE -rb_str_sub(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - str = rb_str_dup(str); - rb_str_sub_bang(argc, argv, str); - return str; -} - -static VALUE -str_gsub(argc, argv, str, bang) - int argc; - VALUE *argv; - VALUE str; - int bang; -{ - VALUE pat, val, repl, match, dest; - struct re_registers *regs; - long beg, n; - long offset, blen, slen, len; - int iter = 0; - char *buf, *bp, *sp, *cp; - int tainted = 0; - - if (argc == 1 && rb_block_given_p()) { - iter = 1; - } - else if (argc == 2) { - repl = argv[1]; - StringValue(repl); - if (OBJ_TAINTED(repl)) tainted = 1; - } - else { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc); - } - - pat = get_pat(argv[0], 1); - offset=0; n=0; - beg = rb_reg_search(pat, str, 0, 0); - if (beg < 0) { - if (bang) return Qnil; /* no match, no substitution */ - return rb_str_dup(str); - } - - blen = RSTRING(str)->len + 30; /* len + margin */ - dest = str_new(0, 0, blen); - buf = RSTRING(dest)->ptr; - bp = buf; - sp = cp = RSTRING(str)->ptr; - slen = RSTRING(str)->len; - - rb_str_locktmp(dest); - while (beg >= 0) { - n++; - match = rb_backref_get(); - regs = RMATCH(match)->regs; - if (iter) { - rb_match_busy(match); - val = rb_obj_as_string(rb_yield(rb_reg_nth_match(0, match))); - str_mod_check(str, sp, slen); - if (bang) str_frozen_check(str); - if (val == dest) { /* paranoid chack [ruby-dev:24827] */ - rb_raise(rb_eRuntimeError, "block should not cheat"); - } - rb_backref_set(match); - } - else { - val = rb_reg_regsub(repl, str, regs); - } - if (OBJ_TAINTED(val)) tainted = 1; - len = (bp - buf) + (beg - offset) + RSTRING(val)->len + 3; - if (blen < len) { - while (blen < len) blen *= 2; - len = bp - buf; - RESIZE_CAPA(dest, blen); - RSTRING(dest)->len = blen; - buf = RSTRING(dest)->ptr; - bp = buf + len; - } - len = beg - offset; /* copy pre-match substr */ - memcpy(bp, cp, len); - bp += len; - memcpy(bp, RSTRING(val)->ptr, RSTRING(val)->len); - bp += RSTRING(val)->len; - offset = END(0); - if (BEG(0) == END(0)) { - /* - * Always consume at least one character of the input string - * in order to prevent infinite loops. - */ - if (RSTRING(str)->len <= END(0)) break; - len = mbclen2(RSTRING(str)->ptr[END(0)], pat); - memcpy(bp, RSTRING(str)->ptr+END(0), len); - bp += len; - offset = END(0) + len; - } - cp = RSTRING(str)->ptr + offset; - if (offset > RSTRING(str)->len) break; - beg = rb_reg_search(pat, str, offset, 0); - } - if (RSTRING(str)->len > offset) { - len = bp - buf; - if (blen - len < RSTRING(str)->len - offset) { - blen = len + RSTRING(str)->len - offset; - RESIZE_CAPA(dest, blen); - buf = RSTRING(dest)->ptr; - bp = buf + len; - } - memcpy(bp, cp, RSTRING(str)->len - offset); - bp += RSTRING(str)->len - offset; - } - rb_backref_set(match); - *bp = '\0'; - rb_str_unlocktmp(dest); - if (bang) { - if (str_independent(str)) { - free(RSTRING(str)->ptr); - } - FL_UNSET(str, STR_NOCAPA); - RSTRING(str)->ptr = buf; - RSTRING(str)->aux.capa = blen; - RSTRING(dest)->ptr = 0; - RSTRING(dest)->len = 0; - } - else { - RBASIC(dest)->klass = rb_obj_class(str); - OBJ_INFECT(dest, str); - str = dest; - } - RSTRING(str)->len = bp - buf; - - if (tainted) OBJ_TAINT(str); - return str; -} - - -/* - * call-seq: - * str.gsub!(pattern, replacement) => str or nil - * str.gsub!(pattern) {|match| block } => str or nil - * - * Performs the substitutions of String#gsub in place, returning - * str, or nil if no substitutions were performed. - */ - -static VALUE -rb_str_gsub_bang(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - return str_gsub(argc, argv, str, 1); -} - - -/* - * call-seq: - * str.gsub(pattern, replacement) => new_str - * str.gsub(pattern) {|match| block } => new_str - * - * Returns a copy of str with all occurrences of pattern - * replaced with either replacement or the value of the block. The - * pattern will typically be a Regexp; if it is a - * String then no regular expression metacharacters will be - * interpreted (that is /\d/ will match a digit, but - * '\d' will match a backslash followed by a 'd'). - * - * If a string is used as the replacement, special variables from the match - * (such as $& and $1) cannot be substituted into it, - * as substitution into the string occurs before the pattern match - * starts. However, the sequences \1, \2, and so on - * may be used to interpolate successive groups in the match. - * - * In the block form, the current match string is passed in as a parameter, and - * variables such as $1, $2, $`, - * $&, and $' will be set appropriately. The value - * returned by the block will be substituted for the match on each call. - * - * The result inherits any tainting in the original string or any supplied - * replacement string. - * - * "hello".gsub(/[aeiou]/, '*') #=> "h*ll*" - * "hello".gsub(/([aeiou])/, '<\1>') #=> "hll" - * "hello".gsub(/./) {|s| s[0].to_s + ' '} #=> "104 101 108 108 111 " - */ - -static VALUE -rb_str_gsub(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - return str_gsub(argc, argv, str, 0); -} - - -/* - * call-seq: - * str.replace(other_str) => str - * - * Replaces the contents and taintedness of str with the corresponding - * values in other_str. - * - * s = "hello" #=> "hello" - * s.replace "world" #=> "world" - */ - -static VALUE -rb_str_replace(str, str2) - VALUE str, str2; -{ - if (str == str2) return str; - - StringValue(str2); - if (FL_TEST(str2, ELTS_SHARED)) { - if (str_independent(str)) { - free(RSTRING(str)->ptr); - } - RSTRING(str)->len = RSTRING(str2)->len; - RSTRING(str)->ptr = RSTRING(str2)->ptr; - FL_SET(str, ELTS_SHARED); - FL_UNSET(str, STR_ASSOC); - RSTRING(str)->aux.shared = RSTRING(str2)->aux.shared; - } - else { - if (str_independent(str)) { - rb_str_resize(str, RSTRING(str2)->len); - memcpy(RSTRING(str)->ptr, RSTRING(str2)->ptr, RSTRING(str2)->len); - if (!RSTRING(str)->ptr) { - make_null_str(str); - } - } - else { - RSTRING(str)->ptr = RSTRING(str2)->ptr; - RSTRING(str)->len = RSTRING(str2)->len; - str_make_independent(str); - } - if (FL_TEST(str2, STR_ASSOC)) { - FL_SET(str, STR_ASSOC); - RSTRING(str)->aux.shared = RSTRING(str2)->aux.shared; - } - } - - OBJ_INFECT(str, str2); - return str; -} - -static VALUE -uscore_get() -{ - VALUE line; - - line = rb_lastline_get(); - if (TYPE(line) != T_STRING) { - rb_raise(rb_eTypeError, "$_ value need to be String (%s given)", - NIL_P(line) ? "nil" : rb_obj_classname(line)); - } - return line; -} - -/* - * call-seq: - * sub!(pattern, replacement) => $_ or nil - * sub!(pattern) {|...| block } => $_ or nil - * - * Equivalent to $_.sub!(args). - */ - -static VALUE -rb_f_sub_bang(argc, argv) - int argc; - VALUE *argv; -{ - return rb_str_sub_bang(argc, argv, uscore_get()); -} - -/* - * call-seq: - * sub(pattern, replacement) => $_ - * sub(pattern) { block } => $_ - * - * Equivalent to $_.sub(args), except that - * $_ will be updated if substitution occurs. - */ - -static VALUE -rb_f_sub(argc, argv) - int argc; - VALUE *argv; -{ - VALUE str = rb_str_dup(uscore_get()); - - if (NIL_P(rb_str_sub_bang(argc, argv, str))) - return str; - rb_lastline_set(str); - return str; -} - -/* - * call-seq: - * gsub!(pattern, replacement) => string or nil - * gsub!(pattern) {|...| block } => string or nil - * - * Equivalent to Kernel::gsub, except nil is - * returned if $_ is not modified. - * - * $_ = "quick brown fox" - * gsub! /cat/, '*' #=> nil - * $_ #=> "quick brown fox" - */ - -static VALUE -rb_f_gsub_bang(argc, argv) - int argc; - VALUE *argv; -{ - return rb_str_gsub_bang(argc, argv, uscore_get()); -} - -/* - * call-seq: - * gsub(pattern, replacement) => string - * gsub(pattern) {|...| block } => string - * - * Equivalent to $_.gsub..., except that $_ - * receives the modified result. - * - * $_ = "quick brown fox" - * gsub /[aeiou]/, '*' #=> "q**ck br*wn f*x" - * $_ #=> "q**ck br*wn f*x" - */ - -static VALUE -rb_f_gsub(argc, argv) - int argc; - VALUE *argv; -{ - VALUE str = rb_str_dup(uscore_get()); - - if (NIL_P(rb_str_gsub_bang(argc, argv, str))) - return str; - rb_lastline_set(str); - return str; -} - - -/* - * call-seq: - * str.reverse! => str - * - * Reverses str in place. - */ - -static VALUE -rb_str_reverse_bang(str) - VALUE str; -{ - char *s, *e; - char c; - - if (RSTRING(str)->len > 1) { - rb_str_modify(str); - s = RSTRING(str)->ptr; - e = s + RSTRING(str)->len - 1; - while (s < e) { - c = *s; - *s++ = *e; - *e-- = c; - } - } - return str; -} - - -/* - * call-seq: - * str.reverse => new_str - * - * Returns a new string with the characters from str in reverse order. - * - * "stressed".reverse #=> "desserts" - */ - -static VALUE -rb_str_reverse(str) - VALUE str; -{ - VALUE obj; - char *s, *e, *p; - - if (RSTRING(str)->len <= 1) return rb_str_dup(str); - - obj = rb_str_new5(str, 0, RSTRING(str)->len); - s = RSTRING(str)->ptr; e = s + RSTRING(str)->len - 1; - p = RSTRING(obj)->ptr; - - while (e >= s) { - *p++ = *e--; - } - OBJ_INFECT(obj, str); - - return obj; -} - - -/* - * call-seq: - * str.include? other_str => true or false - * str.include? fixnum => true or false - * - * Returns true if str contains the given string or - * character. - * - * "hello".include? "lo" #=> true - * "hello".include? "ol" #=> false - * "hello".include? ?h #=> true - */ - -static VALUE -rb_str_include(str, arg) - VALUE str, arg; -{ - long i; - - if (FIXNUM_P(arg)) { - if (memchr(RSTRING(str)->ptr, FIX2INT(arg), RSTRING(str)->len)) - return Qtrue; - return Qfalse; - } - - StringValue(arg); - i = rb_str_index(str, arg, 0); - - if (i == -1) return Qfalse; - return Qtrue; -} - - -/* - * call-seq: - * str.to_i(base=10) => integer - * - * Returns the result of interpreting leading characters in str as an - * integer base base (2, 8, 10, or 16). Extraneous characters past the - * end of a valid number are ignored. If there is not a valid number at the - * start of str, 0 is returned. This method never raises an - * exception. - * - * "12345".to_i #=> 12345 - * "99 red balloons".to_i #=> 99 - * "0a".to_i #=> 0 - * "0a".to_i(16) #=> 10 - * "hello".to_i #=> 0 - * "1100101".to_i(2) #=> 101 - * "1100101".to_i(8) #=> 294977 - * "1100101".to_i(10) #=> 1100101 - * "1100101".to_i(16) #=> 17826049 - */ - -static VALUE -rb_str_to_i(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - VALUE b; - int base; - - rb_scan_args(argc, argv, "01", &b); - if (argc == 0) base = 10; - else base = NUM2INT(b); - - if (base < 0) { - rb_raise(rb_eArgError, "illegal radix %d", base); - } - return rb_str_to_inum(str, base, Qfalse); -} - - -/* - * call-seq: - * str.to_f => float - * - * Returns the result of interpreting leading characters in str as a - * floating point number. Extraneous characters past the end of a valid number - * are ignored. If there is not a valid number at the start of str, - * 0.0 is returned. This method never raises an exception. - * - * "123.45e1".to_f #=> 1234.5 - * "45.67 degrees".to_f #=> 45.67 - * "thx1138".to_f #=> 0.0 - */ - -static VALUE -rb_str_to_f(str) - VALUE str; -{ - return rb_float_new(rb_str_to_dbl(str, Qfalse)); -} - - -/* - * call-seq: - * str.to_s => str - * str.to_str => str - * - * Returns the receiver. - */ - -static VALUE -rb_str_to_s(str) - VALUE str; -{ - if (rb_obj_class(str) != rb_cString) { - VALUE dup = str_alloc(rb_cString); - rb_str_replace(dup, str); - return dup; - } - return str; -} - -/* - * call-seq: - * str.inspect => string - * - * Returns a printable version of _str_, with special characters - * escaped. - * - * str = "hello" - * str[3] = 8 - * str.inspect #=> "hel\010o" - */ - -VALUE -rb_str_inspect(str) - VALUE str; -{ - char *p, *pend; - VALUE result = rb_str_buf_new2("\""); - char s[5]; - - p = RSTRING(str)->ptr; pend = p + RSTRING(str)->len; - while (p < pend) { - char c = *p++; - if (ismbchar(c) && p < pend) { - int len = mbclen(c); - rb_str_buf_cat(result, p - 1, len); - p += len - 1; - } - else if (c == '"'|| c == '\\' || (c == '#' && IS_EVSTR(p, pend))) { - s[0] = '\\'; s[1] = c; - rb_str_buf_cat(result, s, 2); - } - else if (ISPRINT(c)) { - s[0] = c; - rb_str_buf_cat(result, s, 1); - } - else if (c == '\n') { - s[0] = '\\'; s[1] = 'n'; - rb_str_buf_cat(result, s, 2); - } - else if (c == '\r') { - s[0] = '\\'; s[1] = 'r'; - rb_str_buf_cat(result, s, 2); - } - else if (c == '\t') { - s[0] = '\\'; s[1] = 't'; - rb_str_buf_cat(result, s, 2); - } - else if (c == '\f') { - s[0] = '\\'; s[1] = 'f'; - rb_str_buf_cat(result, s, 2); - } - else if (c == '\013') { - s[0] = '\\'; s[1] = 'v'; - rb_str_buf_cat(result, s, 2); - } - else if (c == '\010') { - s[0] = '\\'; s[1] = 'b'; - rb_str_buf_cat(result, s, 2); - } - else if (c == '\007') { - s[0] = '\\'; s[1] = 'a'; - rb_str_buf_cat(result, s, 2); - } - else if (c == 033) { - s[0] = '\\'; s[1] = 'e'; - rb_str_buf_cat(result, s, 2); - } - else { - sprintf(s, "\\%03o", c & 0377); - rb_str_buf_cat2(result, s); - } - } - rb_str_buf_cat2(result, "\""); - - OBJ_INFECT(result, str); - return result; -} - - -/* - * call-seq: - * str.dump => new_str - * - * Produces a version of str with all nonprinting characters replaced by - * \nnn notation and all special characters escaped. - */ - -VALUE -rb_str_dump(str) - VALUE str; -{ - long len; - char *p, *pend; - char *q, *qend; - VALUE result; - - len = 2; /* "" */ - p = RSTRING(str)->ptr; pend = p + RSTRING(str)->len; - while (p < pend) { - char c = *p++; - switch (c) { - case '"': case '\\': - case '\n': case '\r': - case '\t': case '\f': - case '\013': case '\010': case '\007': case '\033': - len += 2; - break; - - case '#': - len += IS_EVSTR(p, pend) ? 2 : 1; - break; - - default: - if (ISPRINT(c)) { - len++; - } - else { - len += 4; /* \nnn */ - } - break; - } - } - - result = rb_str_new5(str, 0, len); - p = RSTRING(str)->ptr; pend = p + RSTRING(str)->len; - q = RSTRING(result)->ptr; qend = q + len; - - *q++ = '"'; - while (p < pend) { - char c = *p++; - - if (c == '"' || c == '\\') { - *q++ = '\\'; - *q++ = c; - } - else if (c == '#') { - if (IS_EVSTR(p, pend)) *q++ = '\\'; - *q++ = '#'; - } - else if (ISPRINT(c)) { - *q++ = c; - } - else if (c == '\n') { - *q++ = '\\'; - *q++ = 'n'; - } - else if (c == '\r') { - *q++ = '\\'; - *q++ = 'r'; - } - else if (c == '\t') { - *q++ = '\\'; - *q++ = 't'; - } - else if (c == '\f') { - *q++ = '\\'; - *q++ = 'f'; - } - else if (c == '\013') { - *q++ = '\\'; - *q++ = 'v'; - } - else if (c == '\010') { - *q++ = '\\'; - *q++ = 'b'; - } - else if (c == '\007') { - *q++ = '\\'; - *q++ = 'a'; - } - else if (c == '\033') { - *q++ = '\\'; - *q++ = 'e'; - } - else { - *q++ = '\\'; - sprintf(q, "%03o", c&0xff); - q += 3; - } - } - *q++ = '"'; - - OBJ_INFECT(result, str); - return result; -} - - -/* - * call-seq: - * str.upcase! => str or nil - * - * Upcases the contents of str, returning nil if no changes - * were made. - */ - -static VALUE -rb_str_upcase_bang(str) - VALUE str; -{ - char *s, *send; - int modify = 0; - - rb_str_modify(str); - s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; - while (s < send) { - if (ismbchar(*s)) { - s+=mbclen(*s) - 1; - } - else if (ISLOWER(*s)) { - *s = toupper(*s); - modify = 1; - } - s++; - } - - if (modify) return str; - return Qnil; -} - - -/* - * call-seq: - * str.upcase => new_str - * - * Returns a copy of str with all lowercase letters replaced with their - * uppercase counterparts. The operation is locale insensitive---only - * characters ``a'' to ``z'' are affected. - * - * "hEllO".upcase #=> "HELLO" - */ - -static VALUE -rb_str_upcase(str) - VALUE str; -{ - str = rb_str_dup(str); - rb_str_upcase_bang(str); - return str; -} - - -/* - * call-seq: - * str.downcase! => str or nil - * - * Downcases the contents of str, returning nil if no - * changes were made. - */ - -static VALUE -rb_str_downcase_bang(str) - VALUE str; -{ - char *s, *send; - int modify = 0; - - rb_str_modify(str); - s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; - while (s < send) { - if (ismbchar(*s)) { - s+=mbclen(*s) - 1; - } - else if (ISUPPER(*s)) { - *s = tolower(*s); - modify = 1; - } - s++; - } - - if (modify) return str; - return Qnil; -} - - -/* - * call-seq: - * str.downcase => new_str - * - * Returns a copy of str with all uppercase letters replaced with their - * lowercase counterparts. The operation is locale insensitive---only - * characters ``A'' to ``Z'' are affected. - * - * "hEllO".downcase #=> "hello" - */ - -static VALUE -rb_str_downcase(str) - VALUE str; -{ - str = rb_str_dup(str); - rb_str_downcase_bang(str); - return str; -} - - -/* - * call-seq: - * str.capitalize! => str or nil - * - * Modifies str by converting the first character to uppercase and the - * remainder to lowercase. Returns nil if no changes are made. - * - * a = "hello" - * a.capitalize! #=> "Hello" - * a #=> "Hello" - * a.capitalize! #=> nil - */ - -static VALUE -rb_str_capitalize_bang(str) - VALUE str; -{ - char *s, *send; - int modify = 0; - - rb_str_modify(str); - if (RSTRING(str)->len == 0 || !RSTRING(str)->ptr) return Qnil; - s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; - if (ISLOWER(*s)) { - *s = toupper(*s); - modify = 1; - } - while (++s < send) { - if (ismbchar(*s)) { - s+=mbclen(*s) - 1; - } - else if (ISUPPER(*s)) { - *s = tolower(*s); - modify = 1; - } - } - if (modify) return str; - return Qnil; -} - - -/* - * call-seq: - * str.capitalize => new_str - * - * Returns a copy of str with the first character converted to uppercase - * and the remainder to lowercase. - * - * "hello".capitalize #=> "Hello" - * "HELLO".capitalize #=> "Hello" - * "123ABC".capitalize #=> "123abc" - */ - -static VALUE -rb_str_capitalize(str) - VALUE str; -{ - str = rb_str_dup(str); - rb_str_capitalize_bang(str); - return str; -} - - -/* - * call-seq: - * str.swapcase! => str or nil - * - * Equivalent to String#swapcase, but modifies the receiver in - * place, returning str, or nil if no changes were made. - */ - -static VALUE -rb_str_swapcase_bang(str) - VALUE str; -{ - char *s, *send; - int modify = 0; - - rb_str_modify(str); - s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; - while (s < send) { - if (ismbchar(*s)) { - s+=mbclen(*s) - 1; - } - else if (ISUPPER(*s)) { - *s = tolower(*s); - modify = 1; - } - else if (ISLOWER(*s)) { - *s = toupper(*s); - modify = 1; - } - s++; - } - - if (modify) return str; - return Qnil; -} - - -/* - * call-seq: - * str.swapcase => new_str - * - * Returns a copy of str with uppercase alphabetic characters converted - * to lowercase and lowercase characters converted to uppercase. - * - * "Hello".swapcase #=> "hELLO" - * "cYbEr_PuNk11".swapcase #=> "CyBeR_pUnK11" - */ - -static VALUE -rb_str_swapcase(str) - VALUE str; -{ - str = rb_str_dup(str); - rb_str_swapcase_bang(str); - return str; -} - -typedef unsigned char *USTR; - -struct tr { - int gen, now, max; - char *p, *pend; -}; - -static int -trnext(t) - struct tr *t; -{ - for (;;) { - if (!t->gen) { - if (t->p == t->pend) return -1; - if (t->p < t->pend - 1 && *t->p == '\\') { - t->p++; - } - t->now = *(USTR)t->p++; - if (t->p < t->pend - 1 && *t->p == '-') { - t->p++; - if (t->p < t->pend) { - if (t->now > *(USTR)t->p) { - t->p++; - continue; - } - t->gen = 1; - t->max = *(USTR)t->p++; - } - } - return t->now; - } - else if (++t->now < t->max) { - return t->now; - } - else { - t->gen = 0; - return t->max; - } - } -} - -static VALUE rb_str_delete_bang _((int,VALUE*,VALUE)); - -static VALUE -tr_trans(str, src, repl, sflag) - VALUE str, src, repl; - int sflag; -{ - struct tr trsrc, trrepl; - int cflag = 0; - int trans[256]; - int i, c, modify = 0; - char *s, *send; - - StringValue(src); - StringValue(repl); - if (RSTRING(str)->len == 0 || !RSTRING(str)->ptr) return Qnil; - trsrc.p = RSTRING(src)->ptr; trsrc.pend = trsrc.p + RSTRING(src)->len; - if (RSTRING(src)->len >= 2 && RSTRING(src)->ptr[0] == '^') { - cflag++; - trsrc.p++; - } - if (RSTRING(repl)->len == 0) { - return rb_str_delete_bang(1, &src, str); - } - trrepl.p = RSTRING(repl)->ptr; - trrepl.pend = trrepl.p + RSTRING(repl)->len; - trsrc.gen = trrepl.gen = 0; - trsrc.now = trrepl.now = 0; - trsrc.max = trrepl.max = 0; - - if (cflag) { - for (i=0; i<256; i++) { - trans[i] = 1; - } - while ((c = trnext(&trsrc)) >= 0) { - trans[c & 0xff] = -1; - } - while ((c = trnext(&trrepl)) >= 0) - /* retrieve last replacer */; - for (i=0; i<256; i++) { - if (trans[i] >= 0) { - trans[i] = trrepl.now; - } - } - } - else { - int r; - - for (i=0; i<256; i++) { - trans[i] = -1; - } - while ((c = trnext(&trsrc)) >= 0) { - r = trnext(&trrepl); - if (r == -1) r = trrepl.now; - trans[c & 0xff] = r; - } - } - - rb_str_modify(str); - s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; - if (sflag) { - char *t = s; - int c0, last = -1; - - while (s < send) { - c0 = *s++; - if ((c = trans[c0 & 0xff]) >= 0) { - if (last == c) continue; - last = c; - *t++ = c & 0xff; - modify = 1; - } - else { - last = -1; - *t++ = c0; - } - } - if (RSTRING(str)->len > (t - RSTRING(str)->ptr)) { - RSTRING(str)->len = (t - RSTRING(str)->ptr); - modify = 1; - *t = '\0'; - } - } - else { - while (s < send) { - if ((c = trans[*s & 0xff]) >= 0) { - *s = c & 0xff; - modify = 1; - } - s++; - } - } - - if (modify) return str; - return Qnil; -} - - -/* - * call-seq: - * str.tr!(from_str, to_str) => str or nil - * - * Translates str in place, using the same rules as - * String#tr. Returns str, or nil if no - * changes were made. - */ - -static VALUE -rb_str_tr_bang(str, src, repl) - VALUE str, src, repl; -{ - return tr_trans(str, src, repl, 0); -} - - -/* - * call-seq: - * str.tr(from_str, to_str) => new_str - * - * Returns a copy of str with the characters in from_str replaced - * by the corresponding characters in to_str. If to_str is - * shorter than from_str, it is padded with its last character. Both - * strings may use the c1--c2 notation to denote ranges of characters, and - * from_str may start with a ^, which denotes all - * characters except those listed. - * - * "hello".tr('aeiou', '*') #=> "h*ll*" - * "hello".tr('^aeiou', '*') #=> "*e**o" - * "hello".tr('el', 'ip') #=> "hippo" - * "hello".tr('a-y', 'b-z') #=> "ifmmp" - */ - -static VALUE -rb_str_tr(str, src, repl) - VALUE str, src, repl; -{ - str = rb_str_dup(str); - tr_trans(str, src, repl, 0); - return str; -} - -static void -tr_setup_table(str, table, init) - VALUE str; - char table[256]; - int init; -{ - char buf[256]; - struct tr tr; - int i, c; - int cflag = 0; - - tr.p = RSTRING(str)->ptr; tr.pend = tr.p + RSTRING(str)->len; - tr.gen = tr.now = tr.max = 0; - if (RSTRING(str)->len > 1 && RSTRING(str)->ptr[0] == '^') { - cflag = 1; - tr.p++; - } - - if (init) { - for (i=0; i<256; i++) { - table[i] = 1; - } - } - for (i=0; i<256; i++) { - buf[i] = cflag; - } - while ((c = trnext(&tr)) >= 0) { - buf[c & 0xff] = !cflag; - } - for (i=0; i<256; i++) { - table[i] = table[i] && buf[i]; - } -} - - -/* - * call-seq: - * str.delete!([other_str]+>) => str or nil - * - * Performs a delete operation in place, returning str, or - * nil if str was not modified. - */ - -static VALUE -rb_str_delete_bang(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - char *s, *send, *t; - char squeez[256]; - int modify = 0; - int init = 1; - int i; - - if (argc < 1) { - rb_raise(rb_eArgError, "wrong number of arguments"); - } - for (i=0; iptr; - if (!s || RSTRING(str)->len == 0) return Qnil; - send = s + RSTRING(str)->len; - while (s < send) { - if (squeez[*s & 0xff]) - modify = 1; - else - *t++ = *s; - s++; - } - *t = '\0'; - RSTRING(str)->len = t - RSTRING(str)->ptr; - - if (modify) return str; - return Qnil; -} - - -/* - * call-seq: - * str.delete([other_str]+) => new_str - * - * Returns a copy of str with all characters in the intersection of its - * arguments deleted. Uses the same rules for building the set of characters as - * String#count. - * - * "hello".delete "l","lo" #=> "heo" - * "hello".delete "lo" #=> "he" - * "hello".delete "aeiou", "^e" #=> "hell" - * "hello".delete "ej-m" #=> "ho" - */ - -static VALUE -rb_str_delete(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - str = rb_str_dup(str); - rb_str_delete_bang(argc, argv, str); - return str; -} - - -/* - * call-seq: - * str.squeeze!([other_str]*) => str or nil - * - * Squeezes str in place, returning either str, or - * nil if no changes were made. - */ - -static VALUE -rb_str_squeeze_bang(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - char squeez[256]; - char *s, *send, *t; - int c, save, modify = 0; - int init = 1; - int i; - - if (argc == 0) { - for (i=0; i<256; i++) { - squeez[i] = 1; - } - } - else { - for (i=0; iptr; - if (!s || RSTRING(str)->len == 0) return Qnil; - send = s + RSTRING(str)->len; - save = -1; - while (s < send) { - c = *s++ & 0xff; - if (c != save || !squeez[c]) { - *t++ = save = c; - } - } - *t = '\0'; - if (t - RSTRING(str)->ptr != RSTRING(str)->len) { - RSTRING(str)->len = t - RSTRING(str)->ptr; - modify = 1; - } - - if (modify) return str; - return Qnil; -} - - -/* - * call-seq: - * str.squeeze([other_str]*) => new_str - * - * Builds a set of characters from the other_str parameter(s) using the - * procedure described for String#count. Returns a new string - * where runs of the same character that occur in this set are replaced by a - * single character. If no arguments are given, all runs of identical - * characters are replaced by a single character. - * - * "yellow moon".squeeze #=> "yelow mon" - * " now is the".squeeze(" ") #=> " now is the" - * "putters shoot balls".squeeze("m-z") #=> "puters shot balls" - */ - -static VALUE -rb_str_squeeze(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - str = rb_str_dup(str); - rb_str_squeeze_bang(argc, argv, str); - return str; -} - - -/* - * call-seq: - * str.tr_s!(from_str, to_str) => str or nil - * - * Performs String#tr_s processing on str in place, - * returning str, or nil if no changes were made. - */ - -static VALUE -rb_str_tr_s_bang(str, src, repl) - VALUE str, src, repl; -{ - return tr_trans(str, src, repl, 1); -} - - -/* - * call-seq: - * str.tr_s(from_str, to_str) => new_str - * - * Processes a copy of str as described under String#tr, - * then removes duplicate characters in regions that were affected by the - * translation. - * - * "hello".tr_s('l', 'r') #=> "hero" - * "hello".tr_s('el', '*') #=> "h*o" - * "hello".tr_s('el', 'hx') #=> "hhxo" - */ - -static VALUE -rb_str_tr_s(str, src, repl) - VALUE str, src, repl; -{ - str = rb_str_dup(str); - tr_trans(str, src, repl, 1); - return str; -} - - -/* - * call-seq: - * str.count([other_str]+) => fixnum - * - * Each other_str parameter defines a set of characters to count. The - * intersection of these sets defines the characters to count in - * str. Any other_str that starts with a caret (^) is - * negated. The sequence c1--c2 means all characters between c1 and c2. - * - * a = "hello world" - * a.count "lo" #=> 5 - * a.count "lo", "o" #=> 2 - * a.count "hello", "^l" #=> 4 - * a.count "ej-m" #=> 4 - */ - -static VALUE -rb_str_count(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - char table[256]; - char *s, *send; - int init = 1; - int i; - - if (argc < 1) { - rb_raise(rb_eArgError, "wrong number of arguments"); - } - for (i=0; iptr; - if (!s || RSTRING(str)->len == 0) return INT2FIX(0); - send = s + RSTRING(str)->len; - i = 0; - while (s < send) { - if (table[*s++ & 0xff]) { - i++; - } - } - return INT2NUM(i); -} - - -/* - * call-seq: - * str.split(pattern=$;, [limit]) => anArray - * - * Divides str into substrings based on a delimiter, returning an array - * of these substrings. - * - * If pattern is a String, then its contents are used as - * the delimiter when splitting str. If pattern is a single - * space, str is split on whitespace, with leading whitespace and runs - * of contiguous whitespace characters ignored. - * - * If pattern is a Regexp, str is divided where the - * pattern matches. Whenever the pattern matches a zero-length string, - * str is split into individual characters. - * - * If pattern is omitted, the value of $; is used. If - * $; is nil (which is the default), str is - * split on whitespace as if ` ' were specified. - * - * If the limit parameter is omitted, trailing null fields are - * suppressed. If limit is a positive number, at most that number of - * fields will be returned (if limit is 1, the entire - * string is returned as the only entry in an array). If negative, there is no - * limit to the number of fields returned, and trailing null fields are not - * suppressed. - * - * " now's the time".split #=> ["now's", "the", "time"] - * " now's the time".split(' ') #=> ["now's", "the", "time"] - * " now's the time".split(/ /) #=> ["", "now's", "", "the", "time"] - * "1, 2.34,56, 7".split(%r{,\s*}) #=> ["1", "2.34", "56", "7"] - * "hello".split(//) #=> ["h", "e", "l", "l", "o"] - * "hello".split(//, 3) #=> ["h", "e", "llo"] - * "hi mom".split(%r{\s*}) #=> ["h", "i", "m", "o", "m"] - * - * "mellow yellow".split("ello") #=> ["m", "w y", "w"] - * "1,2,,3,4,,".split(',') #=> ["1", "2", "", "3", "4"] - * "1,2,,3,4,,".split(',', 4) #=> ["1", "2", "", "3,4,,"] - * "1,2,,3,4,,".split(',', -4) #=> ["1", "2", "", "3", "4", "", ""] - */ - -static VALUE -rb_str_split_m(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - VALUE spat; - VALUE limit; - int awk_split = Qfalse; - long beg, end, i = 0; - int lim = 0; - VALUE result, tmp; - - if (rb_scan_args(argc, argv, "02", &spat, &limit) == 2) { - lim = NUM2INT(limit); - if (lim <= 0) limit = Qnil; - else if (lim == 1) { - if (RSTRING(str)->len == 0) - return rb_ary_new2(0); - return rb_ary_new3(1, str); - } - i = 1; - } - - if (NIL_P(spat)) { - if (!NIL_P(rb_fs)) { - spat = rb_fs; - goto fs_set; - } - awk_split = Qtrue; - } - else { - fs_set: - if (TYPE(spat) == T_STRING && RSTRING(spat)->len == 1) { - if (RSTRING(spat)->ptr[0] == ' ') { - awk_split = Qtrue; - } - else { - spat = rb_reg_regcomp(rb_reg_quote(spat)); - } - } - else { - spat = get_pat(spat, 1); - } - } - - result = rb_ary_new(); - beg = 0; - if (awk_split) { - char *ptr = RSTRING(str)->ptr; - long len = RSTRING(str)->len; - char *eptr = ptr + len; - int skip = 1; - - for (end = beg = 0; ptr= 0) { - regs = RMATCH(rb_backref_get())->regs; - if (start == end && BEG(0) == END(0)) { - if (!RSTRING(str)->ptr) { - rb_ary_push(result, rb_str_new("", 0)); - break; - } - else if (last_null == 1) { - rb_ary_push(result, rb_str_substr(str, beg, mbclen2(RSTRING(str)->ptr[beg],spat))); - beg = start; - } - else { - start += mbclen2(RSTRING(str)->ptr[start],spat); - last_null = 1; - continue; - } - } - else { - rb_ary_push(result, rb_str_substr(str, beg, end-beg)); - beg = start = END(0); - } - last_null = 0; - - for (idx=1; idx < regs->num_regs; idx++) { - if (BEG(idx) == -1) continue; - if (BEG(idx) == END(idx)) - tmp = rb_str_new5(str, 0, 0); - else - tmp = rb_str_substr(str, BEG(idx), END(idx)-BEG(idx)); - rb_ary_push(result, tmp); - } - if (!NIL_P(limit) && lim <= ++i) break; - } - } - if (RSTRING(str)->len > 0 && (!NIL_P(limit) || RSTRING(str)->len > beg || lim < 0)) { - if (RSTRING(str)->len == beg) - tmp = rb_str_new5(str, 0, 0); - else - tmp = rb_str_substr(str, beg, RSTRING(str)->len-beg); - rb_ary_push(result, tmp); - } - if (NIL_P(limit) && lim == 0) { - while (RARRAY(result)->len > 0 && - RSTRING(RARRAY(result)->ptr[RARRAY(result)->len-1])->len == 0) - rb_ary_pop(result); - } - - return result; -} - -VALUE -rb_str_split(str, sep0) - VALUE str; - const char *sep0; -{ - VALUE sep; - - StringValue(str); - sep = rb_str_new2(sep0); - return rb_str_split_m(1, &sep, str); -} - -/* - * call-seq: - * split([pattern [, limit]]) => array - * - * Equivalent to $_.split(pattern, limit). - * See String#split. - */ - -static VALUE -rb_f_split(argc, argv) - int argc; - VALUE *argv; -{ - return rb_str_split_m(argc, argv, uscore_get()); -} - -/* - * call-seq: - * str.each(separator=$/) {|substr| block } => str - * str.each_line(separator=$/) {|substr| block } => str - * - * Splits str using the supplied parameter as the record separator - * ($/ by default), passing each substring in turn to the supplied - * block. If a zero-length record separator is supplied, the string is split on - * \n characters, except that multiple successive newlines are - * appended together. - * - * print "Example one\n" - * "hello\nworld".each {|s| p s} - * print "Example two\n" - * "hello\nworld".each('l') {|s| p s} - * print "Example three\n" - * "hello\n\n\nworld".each('') {|s| p s} - * - * produces: - * - * Example one - * "hello\n" - * "world" - * Example two - * "hel" - * "l" - * "o\nworl" - * "d" - * Example three - * "hello\n\n\n" - * "world" - */ - -static VALUE -rb_str_each_line(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - VALUE rs; - int newline; - char *p = RSTRING(str)->ptr, *pend = p + RSTRING(str)->len, *s; - char *ptr = p; - long len = RSTRING(str)->len, rslen; - VALUE line; - - if (rb_scan_args(argc, argv, "01", &rs) == 0) { - rs = rb_rs; - } - - if (NIL_P(rs)) { - rb_yield(str); - return str; - } - StringValue(rs); - rslen = RSTRING(rs)->len; - if (rslen == 0) { - newline = '\n'; - } - else { - newline = RSTRING(rs)->ptr[rslen-1]; - } - - for (s = p, p += rslen; p < pend; p++) { - if (rslen == 0 && *p == '\n') { - if (*++p != '\n') continue; - while (*p == '\n') p++; - } - if (RSTRING(str)->ptr < p && p[-1] == newline && - (rslen <= 1 || - rb_memcmp(RSTRING(rs)->ptr, p-rslen, rslen) == 0)) { - line = rb_str_new5(str, s, p - s); - OBJ_INFECT(line, str); - rb_yield(line); - str_mod_check(str, ptr, len); - s = p; - } - } - - if (s != pend) { - if (p > pend) p = pend; - line = rb_str_new5(str, s, p - s); - OBJ_INFECT(line, str); - rb_yield(line); - } - - return str; -} - - -/* - * call-seq: - * str.each_byte {|fixnum| block } => str - * - * Passes each byte in str to the given block. - * - * "hello".each_byte {|c| print c, ' ' } - * - * produces: - * - * 104 101 108 108 111 - */ - -static VALUE -rb_str_each_byte(str) - VALUE str; -{ - long i; - - for (i=0; ilen; i++) { - rb_yield(INT2FIX(RSTRING(str)->ptr[i] & 0xff)); - } - return str; -} - - -/* - * call-seq: - * str.chop! => str or nil - * - * Processes str as for String#chop, returning str, - * or nil if str is the empty string. See also - * String#chomp!. - */ - -static VALUE -rb_str_chop_bang(str) - VALUE str; -{ - if (RSTRING(str)->len > 0) { - rb_str_modify(str); - RSTRING(str)->len--; - if (RSTRING(str)->ptr[RSTRING(str)->len] == '\n') { - if (RSTRING(str)->len > 0 && - RSTRING(str)->ptr[RSTRING(str)->len-1] == '\r') { - RSTRING(str)->len--; - } - } - RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; - return str; - } - return Qnil; -} - - -/* - * call-seq: - * str.chop => new_str - * - * Returns a new String with the last character removed. If the - * string ends with \r\n, both characters are removed. Applying - * chop to an empty string returns an empty - * string. String#chomp is often a safer alternative, as it leaves - * the string unchanged if it doesn't end in a record separator. - * - * "string\r\n".chop #=> "string" - * "string\n\r".chop #=> "string\n" - * "string\n".chop #=> "string" - * "string".chop #=> "strin" - * "x".chop.chop #=> "" - */ - -static VALUE -rb_str_chop(str) - VALUE str; -{ - str = rb_str_dup(str); - rb_str_chop_bang(str); - return str; -} - - -/* - * call-seq: - * chop! => $_ or nil - * - * Equivalent to $_.chop!. - * - * a = "now\r\n" - * $_ = a - * chop! #=> "now" - * chop! #=> "no" - * chop! #=> "n" - * chop! #=> "" - * chop! #=> nil - * $_ #=> "" - * a #=> "" - */ - -static VALUE -rb_f_chop_bang(str) - VALUE str; -{ - return rb_str_chop_bang(uscore_get()); -} - -/* - * call-seq: - * chop => string - * - * Equivalent to ($_.dup).chop!, except nil - * is never returned. See String#chop!. - * - * a = "now\r\n" - * $_ = a - * chop #=> "now" - * $_ #=> "now" - * chop #=> "no" - * chop #=> "n" - * chop #=> "" - * chop #=> "" - * a #=> "now\r\n" - */ - -static VALUE -rb_f_chop() -{ - VALUE str = uscore_get(); - - if (RSTRING(str)->len > 0) { - str = rb_str_dup(str); - rb_str_chop_bang(str); - rb_lastline_set(str); - } - return str; -} - - -/* - * call-seq: - * str.chomp!(separator=$/) => str or nil - * - * Modifies str in place as described for String#chomp, - * returning str, or nil if no modifications were made. - */ - -static VALUE -rb_str_chomp_bang(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - VALUE rs; - int newline; - char *p; - long len, rslen; - - if (rb_scan_args(argc, argv, "01", &rs) == 0) { - len = RSTRING(str)->len; - if (len == 0) return Qnil; - p = RSTRING(str)->ptr; - rs = rb_rs; - if (rs == rb_default_rs) { - smart_chomp: - rb_str_modify(str); - if (RSTRING(str)->ptr[len-1] == '\n') { - RSTRING(str)->len--; - if (RSTRING(str)->len > 0 && - RSTRING(str)->ptr[RSTRING(str)->len-1] == '\r') { - RSTRING(str)->len--; - } - } - else if (RSTRING(str)->ptr[len-1] == '\r') { - RSTRING(str)->len--; - } - else { - return Qnil; - } - RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; - return str; - } - } - if (NIL_P(rs)) return Qnil; - StringValue(rs); - len = RSTRING(str)->len; - if (len == 0) return Qnil; - p = RSTRING(str)->ptr; - rslen = RSTRING(rs)->len; - if (rslen == 0) { - while (len>0 && p[len-1] == '\n') { - len--; - if (len>0 && p[len-1] == '\r') - len--; - } - if (len < RSTRING(str)->len) { - rb_str_modify(str); - RSTRING(str)->len = len; - RSTRING(str)->ptr[len] = '\0'; - return str; - } - return Qnil; - } - if (rslen > len) return Qnil; - newline = RSTRING(rs)->ptr[rslen-1]; - if (rslen == 1 && newline == '\n') - goto smart_chomp; - - if (p[len-1] == newline && - (rslen <= 1 || - rb_memcmp(RSTRING(rs)->ptr, p+len-rslen, rslen) == 0)) { - rb_str_modify(str); - RSTRING(str)->len -= rslen; - RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; - return str; - } - return Qnil; -} - - -/* - * call-seq: - * str.chomp(separator=$/) => new_str - * - * Returns a new String with the given record separator removed - * from the end of str (if present). If $/ has not been - * changed from the default Ruby record separator, then chomp also - * removes carriage return characters (that is it will remove \n, - * \r, and \r\n). - * - * "hello".chomp #=> "hello" - * "hello\n".chomp #=> "hello" - * "hello\r\n".chomp #=> "hello" - * "hello\n\r".chomp #=> "hello\n" - * "hello\r".chomp #=> "hello" - * "hello \n there".chomp #=> "hello \n there" - * "hello".chomp("llo") #=> "he" - */ - -static VALUE -rb_str_chomp(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - str = rb_str_dup(str); - rb_str_chomp_bang(argc, argv, str); - return str; -} - -/* - * call-seq: - * chomp! => $_ or nil - * chomp!(string) => $_ or nil - * - * Equivalent to $_.chomp!(string). See - * String#chomp! - * - * $_ = "now\n" - * chomp! #=> "now" - * $_ #=> "now" - * chomp! "x" #=> nil - * $_ #=> "now" - */ - -static VALUE -rb_f_chomp_bang(argc, argv) - int argc; - VALUE *argv; -{ - return rb_str_chomp_bang(argc, argv, uscore_get()); -} - -/* - * call-seq: - * chomp => $_ - * chomp(string) => $_ - * - * Equivalent to $_ = $_.chomp(string). See - * String#chomp. - * - * $_ = "now\n" - * chomp #=> "now" - * $_ #=> "now" - * chomp "ow" #=> "n" - * $_ #=> "n" - * chomp "xxx" #=> "n" - * $_ #=> "n" - */ - -static VALUE -rb_f_chomp(argc, argv) - int argc; - VALUE *argv; -{ - VALUE str = uscore_get(); - VALUE dup = rb_str_dup(str); - - if (NIL_P(rb_str_chomp_bang(argc, argv, dup))) - return str; - rb_lastline_set(dup); - return dup; -} - - -/* - * call-seq: - * str.lstrip! => self or nil - * - * Removes leading whitespace from str, returning nil if no - * change was made. See also String#rstrip! and - * String#strip!. - * - * " hello ".lstrip #=> "hello " - * "hello".lstrip! #=> nil - */ - -static VALUE -rb_str_lstrip_bang(str) - VALUE str; -{ - char *s, *t, *e; - - s = RSTRING(str)->ptr; - if (!s || RSTRING(str)->len == 0) return Qnil; - e = t = s + RSTRING(str)->len; - /* remove spaces at head */ - while (s < t && ISSPACE(*s)) s++; - - if (s > RSTRING(str)->ptr) { - rb_str_modify(str); - RSTRING(str)->len = t-s; - memmove(RSTRING(str)->ptr, s, RSTRING(str)->len); - RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; - return str; - } - return Qnil; -} - - -/* - * call-seq: - * str.lstrip => new_str - * - * Returns a copy of str with leading whitespace removed. See also - * String#rstrip and String#strip. - * - * " hello ".lstrip #=> "hello " - * "hello".lstrip #=> "hello" - */ - -static VALUE -rb_str_lstrip(str) - VALUE str; -{ - str = rb_str_dup(str); - rb_str_lstrip_bang(str); - return str; -} - - -/* - * call-seq: - * str.rstrip! => self or nil - * - * Removes trailing whitespace from str, returning nil if - * no change was made. See also String#lstrip! and - * String#strip!. - * - * " hello ".rstrip #=> " hello" - * "hello".rstrip! #=> nil - */ - -static VALUE -rb_str_rstrip_bang(str) - VALUE str; -{ - char *s, *t, *e; - - s = RSTRING(str)->ptr; - if (!s || RSTRING(str)->len == 0) return Qnil; - e = t = s + RSTRING(str)->len; - - /* remove trailing '\0's */ - while (s < t && t[-1] == '\0') t--; - - /* remove trailing spaces */ - while (s < t && ISSPACE(*(t-1))) t--; - - if (t < e) { - rb_str_modify(str); - RSTRING(str)->len = t-s; - RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; - return str; - } - return Qnil; -} - - -/* - * call-seq: - * str.rstrip => new_str - * - * Returns a copy of str with trailing whitespace removed. See also - * String#lstrip and String#strip. - * - * " hello ".rstrip #=> " hello" - * "hello".rstrip #=> "hello" - */ - -static VALUE -rb_str_rstrip(str) - VALUE str; -{ - str = rb_str_dup(str); - rb_str_rstrip_bang(str); - return str; -} - - -/* - * call-seq: - * str.strip! => str or nil - * - * Removes leading and trailing whitespace from str. Returns - * nil if str was not altered. - */ - -static VALUE -rb_str_strip_bang(str) - VALUE str; -{ - VALUE l = rb_str_lstrip_bang(str); - VALUE r = rb_str_rstrip_bang(str); - - if (NIL_P(l) && NIL_P(r)) return Qnil; - return str; -} - - -/* - * call-seq: - * str.strip => new_str - * - * Returns a copy of str with leading and trailing whitespace removed. - * - * " hello ".strip #=> "hello" - * "\tgoodbye\r\n".strip #=> "goodbye" - */ - -static VALUE -rb_str_strip(str) - VALUE str; -{ - str = rb_str_dup(str); - rb_str_strip_bang(str); - return str; -} - -static VALUE -scan_once(str, pat, start) - VALUE str, pat; - long *start; -{ - VALUE result, match; - struct re_registers *regs; - long i; - - if (rb_reg_search(pat, str, *start, 0) >= 0) { - match = rb_backref_get(); - regs = RMATCH(match)->regs; - if (BEG(0) == END(0)) { - /* - * Always consume at least one character of the input string - */ - if (RSTRING(str)->len > END(0)) - *start = END(0)+mbclen2(RSTRING(str)->ptr[END(0)],pat); - else - *start = END(0)+1; - } - else { - *start = END(0); - } - if (regs->num_regs == 1) { - return rb_reg_nth_match(0, match); - } - result = rb_ary_new2(regs->num_regs); - for (i=1; i < regs->num_regs; i++) { - rb_ary_push(result, rb_reg_nth_match(i, match)); - } - - return result; - } - return Qnil; -} - - -/* - * call-seq: - * str.scan(pattern) => array - * str.scan(pattern) {|match, ...| block } => str - * - * Both forms iterate through str, matching the pattern (which may be a - * Regexp or a String). For each match, a result is - * generated and either added to the result array or passed to the block. If - * the pattern contains no groups, each individual result consists of the - * matched string, $&. If the pattern contains groups, each - * individual result is itself an array containing one entry per group. - * - * a = "cruel world" - * a.scan(/\w+/) #=> ["cruel", "world"] - * a.scan(/.../) #=> ["cru", "el ", "wor"] - * a.scan(/(...)/) #=> [["cru"], ["el "], ["wor"]] - * a.scan(/(..)(..)/) #=> [["cr", "ue"], ["l ", "wo"]] - * - * And the block form: - * - * a.scan(/\w+/) {|w| print "<<#{w}>> " } - * print "\n" - * a.scan(/(.)(.)/) {|x,y| print y, x } - * print "\n" - * - * produces: - * - * <> <> - * rceu lowlr - */ - -static VALUE -rb_str_scan(str, pat) - VALUE str, pat; -{ - VALUE result; - long start = 0; - VALUE match = Qnil; - char *p = RSTRING(str)->ptr; long len = RSTRING(str)->len; - - pat = get_pat(pat, 1); - if (!rb_block_given_p()) { - VALUE ary = rb_ary_new(); - - while (!NIL_P(result = scan_once(str, pat, &start))) { - match = rb_backref_get(); - rb_ary_push(ary, result); - } - rb_backref_set(match); - return ary; - } - - while (!NIL_P(result = scan_once(str, pat, &start))) { - match = rb_backref_get(); - rb_match_busy(match); - rb_yield(result); - str_mod_check(str, p, len); - rb_backref_set(match); /* restore $~ value */ - } - rb_backref_set(match); - return str; -} - -/* - * call-seq: - * scan(pattern) => array - * scan(pattern) {|///| block } => $_ - * - * Equivalent to calling $_.scan. See - * String#scan. - */ - -static VALUE -rb_f_scan(self, pat) - VALUE self, pat; -{ - return rb_str_scan(uscore_get(), pat); -} - - -/* - * call-seq: - * str.hex => integer - * - * Treats leading characters from str as a string of hexadecimal digits - * (with an optional sign and an optional 0x) and returns the - * corresponding number. Zero is returned on error. - * - * "0x0a".hex #=> 10 - * "-1234".hex #=> -4660 - * "0".hex #=> 0 - * "wombat".hex #=> 0 - */ - -static VALUE -rb_str_hex(str) - VALUE str; -{ - return rb_str_to_inum(str, 16, Qfalse); -} - - -/* - * call-seq: - * str.oct => integer - * - * Treats leading characters of str as a string of octal digits (with an - * optional sign) and returns the corresponding number. Returns 0 if the - * conversion fails. - * - * "123".oct #=> 83 - * "-377".oct #=> -255 - * "bad".oct #=> 0 - * "0377bad".oct #=> 255 - */ - -static VALUE -rb_str_oct(str) - VALUE str; -{ - return rb_str_to_inum(str, -8, Qfalse); -} - - -/* - * call-seq: - * str.crypt(other_str) => new_str - * - * Applies a one-way cryptographic hash to str by invoking the standard - * library function crypt. The argument is the salt string, which - * should be two characters long, each character drawn from - * [a-zA-Z0-9./]. - */ - -static VALUE -rb_str_crypt(str, salt) - VALUE str, salt; -{ - extern char *crypt(); - VALUE result; - char *s; - - StringValue(salt); - if (RSTRING(salt)->len < 2) - rb_raise(rb_eArgError, "salt too short(need >=2 bytes)"); - - if (RSTRING(str)->ptr) s = RSTRING(str)->ptr; - else s = ""; - result = rb_str_new2(crypt(s, RSTRING(salt)->ptr)); - OBJ_INFECT(result, str); - OBJ_INFECT(result, salt); - return result; -} - - -/* - * call-seq: - * str.intern => symbol - * str.to_sym => symbol - * - * Returns the Symbol corresponding to str, creating the - * symbol if it did not previously exist. See Symbol#id2name. - * - * "Koala".intern #=> :Koala - * s = 'cat'.to_sym #=> :cat - * s == :cat #=> true - * s = '@cat'.to_sym #=> :@cat - * s == :@cat #=> true - * - * This can also be used to create symbols that cannot be represented using the - * :xxx notation. - * - * 'cat and dog'.to_sym #=> :"cat and dog" - */ - -VALUE -rb_str_intern(s) - VALUE s; -{ - volatile VALUE str = s; - ID id; - - if (!RSTRING(str)->ptr || RSTRING(str)->len == 0) { - rb_raise(rb_eArgError, "interning empty string"); - } - if (strlen(RSTRING(str)->ptr) != RSTRING(str)->len) - rb_raise(rb_eArgError, "symbol string may not contain `\\0'"); - if (OBJ_TAINTED(str) && rb_safe_level() >= 1 && !rb_sym_interned_p(str)) { - rb_raise(rb_eSecurityError, "Insecure: can't intern tainted string"); - } - id = rb_intern(RSTRING(str)->ptr); - return ID2SYM(id); -} - - -/* - * call-seq: - * str.sum(n=16) => integer - * - * Returns a basic n-bit checksum of the characters in str, - * where n is the optional Fixnum parameter, defaulting - * to 16. The result is simply the sum of the binary value of each character in - * str modulo 2n - 1. This is not a particularly good - * checksum. - */ - -static VALUE -rb_str_sum(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - VALUE vbits; - int bits; - char *ptr, *p, *pend; - long len; - - if (rb_scan_args(argc, argv, "01", &vbits) == 0) { - bits = 16; - } - else bits = NUM2INT(vbits); - - ptr = p = RSTRING(str)->ptr; - len = RSTRING(str)->len; - pend = p + len; - if (bits >= sizeof(long)*CHAR_BIT) { - VALUE sum = INT2FIX(0); - - while (p < pend) { - str_mod_check(str, ptr, len); - sum = rb_funcall(sum, '+', 1, INT2FIX((unsigned char)*p)); - p++; - } - if (bits != 0) { - VALUE mod; - - mod = rb_funcall(INT2FIX(1), rb_intern("<<"), 1, INT2FIX(bits)); - mod = rb_funcall(mod, '-', 1, INT2FIX(1)); - sum = rb_funcall(sum, '&', 1, mod); - } - return sum; - } - else { - unsigned long sum = 0; - - while (p < pend) { - str_mod_check(str, ptr, len); - sum += (unsigned char)*p; - p++; - } - if (bits != 0) { - sum &= (((unsigned long)1)<ptr; - flen = RSTRING(pad)->len; - if (flen == 0) { - rb_raise(rb_eArgError, "zero width padding"); - } - } - if (width < 0 || RSTRING(str)->len >= width) return rb_str_dup(str); - res = rb_str_new5(str, 0, width); - p = RSTRING(res)->ptr; - if (jflag != 'l') { - n = width - RSTRING(str)->len; - pend = p + ((jflag == 'r') ? n : n/2); - if (flen <= 1) { - while (p < pend) { - *p++ = *f; - } - } - else { - char *q = f; - while (p + flen <= pend) { - memcpy(p,f,flen); - p += flen; - } - while (p < pend) { - *p++ = *q++; - } - } - } - memcpy(p, RSTRING(str)->ptr, RSTRING(str)->len); - if (jflag != 'r') { - p += RSTRING(str)->len; pend = RSTRING(res)->ptr + width; - if (flen <= 1) { - while (p < pend) { - *p++ = *f; - } - } - else { - while (p + flen <= pend) { - memcpy(p,f,flen); - p += flen; - } - while (p < pend) { - *p++ = *f++; - } - } - } - OBJ_INFECT(res, str); - if (flen > 0) OBJ_INFECT(res, pad); - return res; -} - - -/* - * call-seq: - * str.ljust(integer, padstr=' ') => new_str - * - * If integer is greater than the length of str, returns a new - * String of length integer with str left justified - * and padded with padstr; otherwise, returns str. - * - * "hello".ljust(4) #=> "hello" - * "hello".ljust(20) #=> "hello " - * "hello".ljust(20, '1234') #=> "hello123412341234123" - */ - -static VALUE -rb_str_ljust(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - return rb_str_justify(argc, argv, str, 'l'); -} - - -/* - * call-seq: - * str.rjust(integer, padstr=' ') => new_str - * - * If integer is greater than the length of str, returns a new - * String of length integer with str right justified - * and padded with padstr; otherwise, returns str. - * - * "hello".rjust(4) #=> "hello" - * "hello".rjust(20) #=> " hello" - * "hello".rjust(20, '1234') #=> "123412341234123hello" - */ - -static VALUE -rb_str_rjust(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - return rb_str_justify(argc, argv, str, 'r'); -} - - -/* - * call-seq: - * str.center(integer, padstr) => new_str - * - * If integer is greater than the length of str, returns a new - * String of length integer with str centered and - * padded with padstr; otherwise, returns str. - * - * "hello".center(4) #=> "hello" - * "hello".center(20) #=> " hello " - * "hello".center(20, '123') #=> "1231231hello12312312" - */ - -static VALUE -rb_str_center(argc, argv, str) - int argc; - VALUE *argv; - VALUE str; -{ - return rb_str_justify(argc, argv, str, 'c'); -} - -void -rb_str_setter(val, id, var) - VALUE val; - ID id; - VALUE *var; -{ - if (!NIL_P(val) && TYPE(val) != T_STRING) { - rb_raise(rb_eTypeError, "value of %s must be String", rb_id2name(id)); - } - *var = val; -} - - -/* - * A String object holds and manipulates an arbitrary sequence of - * bytes, typically representing characters. String objects may be created - * using String::new or as literals. - * - * Because of aliasing issues, users of strings should be aware of the methods - * that modify the contents of a String object. Typically, - * methods with names ending in ``!'' modify their receiver, while those - * without a ``!'' return a new String. However, there are - * exceptions, such as String#[]=. - * - */ - -void -Init_String() -{ - rb_cString = rb_define_class("String", rb_cObject); - rb_include_module(rb_cString, rb_mComparable); - rb_include_module(rb_cString, rb_mEnumerable); - rb_define_alloc_func(rb_cString, rb_str_s_alloc); - rb_define_method(rb_cString, "initialize", rb_str_init, -1); - rb_define_method(rb_cString, "initialize_copy", rb_str_replace, 1); - rb_define_method(rb_cString, "<=>", rb_str_cmp_m, 1); - rb_define_method(rb_cString, "==", rb_str_equal, 1); - rb_define_method(rb_cString, "eql?", rb_str_eql, 1); - rb_define_method(rb_cString, "hash", rb_str_hash_m, 0); - rb_define_method(rb_cString, "casecmp", rb_str_casecmp, 1); - rb_define_method(rb_cString, "+", rb_str_plus, 1); - rb_define_method(rb_cString, "*", rb_str_times, 1); - rb_define_method(rb_cString, "%", rb_str_format_m, 1); - rb_define_method(rb_cString, "[]", rb_str_aref_m, -1); - rb_define_method(rb_cString, "[]=", rb_str_aset_m, -1); - rb_define_method(rb_cString, "insert", rb_str_insert, 2); - rb_define_method(rb_cString, "length", rb_str_length, 0); - rb_define_method(rb_cString, "size", rb_str_length, 0); - rb_define_method(rb_cString, "empty?", rb_str_empty, 0); - rb_define_method(rb_cString, "=~", rb_str_match, 1); - rb_define_method(rb_cString, "match", rb_str_match_m, 1); - rb_define_method(rb_cString, "succ", rb_str_succ, 0); - rb_define_method(rb_cString, "succ!", rb_str_succ_bang, 0); - rb_define_method(rb_cString, "next", rb_str_succ, 0); - rb_define_method(rb_cString, "next!", rb_str_succ_bang, 0); - rb_define_method(rb_cString, "upto", rb_str_upto_m, 1); - rb_define_method(rb_cString, "index", rb_str_index_m, -1); - rb_define_method(rb_cString, "rindex", rb_str_rindex_m, -1); - rb_define_method(rb_cString, "replace", rb_str_replace, 1); - - rb_define_method(rb_cString, "to_i", rb_str_to_i, -1); - rb_define_method(rb_cString, "to_f", rb_str_to_f, 0); - rb_define_method(rb_cString, "to_s", rb_str_to_s, 0); - rb_define_method(rb_cString, "to_str", rb_str_to_s, 0); - rb_define_method(rb_cString, "inspect", rb_str_inspect, 0); - rb_define_method(rb_cString, "dump", rb_str_dump, 0); - - rb_define_method(rb_cString, "upcase", rb_str_upcase, 0); - rb_define_method(rb_cString, "downcase", rb_str_downcase, 0); - rb_define_method(rb_cString, "capitalize", rb_str_capitalize, 0); - rb_define_method(rb_cString, "swapcase", rb_str_swapcase, 0); - - rb_define_method(rb_cString, "upcase!", rb_str_upcase_bang, 0); - rb_define_method(rb_cString, "downcase!", rb_str_downcase_bang, 0); - rb_define_method(rb_cString, "capitalize!", rb_str_capitalize_bang, 0); - rb_define_method(rb_cString, "swapcase!", rb_str_swapcase_bang, 0); - - rb_define_method(rb_cString, "hex", rb_str_hex, 0); - rb_define_method(rb_cString, "oct", rb_str_oct, 0); - rb_define_method(rb_cString, "split", rb_str_split_m, -1); - rb_define_method(rb_cString, "reverse", rb_str_reverse, 0); - rb_define_method(rb_cString, "reverse!", rb_str_reverse_bang, 0); - rb_define_method(rb_cString, "concat", rb_str_concat, 1); - rb_define_method(rb_cString, "<<", rb_str_concat, 1); - rb_define_method(rb_cString, "crypt", rb_str_crypt, 1); - rb_define_method(rb_cString, "intern", rb_str_intern, 0); - rb_define_method(rb_cString, "to_sym", rb_str_intern, 0); - - rb_define_method(rb_cString, "include?", rb_str_include, 1); - - rb_define_method(rb_cString, "scan", rb_str_scan, 1); - - rb_define_method(rb_cString, "ljust", rb_str_ljust, -1); - rb_define_method(rb_cString, "rjust", rb_str_rjust, -1); - rb_define_method(rb_cString, "center", rb_str_center, -1); - - rb_define_method(rb_cString, "sub", rb_str_sub, -1); - rb_define_method(rb_cString, "gsub", rb_str_gsub, -1); - rb_define_method(rb_cString, "chop", rb_str_chop, 0); - rb_define_method(rb_cString, "chomp", rb_str_chomp, -1); - rb_define_method(rb_cString, "strip", rb_str_strip, 0); - rb_define_method(rb_cString, "lstrip", rb_str_lstrip, 0); - rb_define_method(rb_cString, "rstrip", rb_str_rstrip, 0); - - rb_define_method(rb_cString, "sub!", rb_str_sub_bang, -1); - rb_define_method(rb_cString, "gsub!", rb_str_gsub_bang, -1); - rb_define_method(rb_cString, "chop!", rb_str_chop_bang, 0); - rb_define_method(rb_cString, "chomp!", rb_str_chomp_bang, -1); - rb_define_method(rb_cString, "strip!", rb_str_strip_bang, 0); - rb_define_method(rb_cString, "lstrip!", rb_str_lstrip_bang, 0); - rb_define_method(rb_cString, "rstrip!", rb_str_rstrip_bang, 0); - - rb_define_method(rb_cString, "tr", rb_str_tr, 2); - rb_define_method(rb_cString, "tr_s", rb_str_tr_s, 2); - rb_define_method(rb_cString, "delete", rb_str_delete, -1); - rb_define_method(rb_cString, "squeeze", rb_str_squeeze, -1); - rb_define_method(rb_cString, "count", rb_str_count, -1); - - rb_define_method(rb_cString, "tr!", rb_str_tr_bang, 2); - rb_define_method(rb_cString, "tr_s!", rb_str_tr_s_bang, 2); - rb_define_method(rb_cString, "delete!", rb_str_delete_bang, -1); - rb_define_method(rb_cString, "squeeze!", rb_str_squeeze_bang, -1); - - rb_define_method(rb_cString, "each_line", rb_str_each_line, -1); - rb_define_method(rb_cString, "each", rb_str_each_line, -1); - rb_define_method(rb_cString, "each_byte", rb_str_each_byte, 0); - - rb_define_method(rb_cString, "sum", rb_str_sum, -1); - - rb_define_global_function("sub", rb_f_sub, -1); - rb_define_global_function("gsub", rb_f_gsub, -1); - - rb_define_global_function("sub!", rb_f_sub_bang, -1); - rb_define_global_function("gsub!", rb_f_gsub_bang, -1); - - rb_define_global_function("chop", rb_f_chop, 0); - rb_define_global_function("chop!", rb_f_chop_bang, 0); - - rb_define_global_function("chomp", rb_f_chomp, -1); - rb_define_global_function("chomp!", rb_f_chomp_bang, -1); - - rb_define_global_function("split", rb_f_split, -1); - rb_define_global_function("scan", rb_f_scan, 1); - - rb_define_method(rb_cString, "slice", rb_str_aref_m, -1); - rb_define_method(rb_cString, "slice!", rb_str_slice_bang, -1); - - id_to_s = rb_intern("to_s"); - - rb_fs = Qnil; - rb_define_variable("$;", &rb_fs); - rb_define_variable("$-F", &rb_fs); -} -/********************************************************************** - - struct.c - - - $Author: shyouhei $ - $Date: 2008-06-15 15:44:44 +0200 (Sun, 15 Jun 2008) $ - created at: Tue Mar 22 18:44:30 JST 1995 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include "env.h" - -VALUE rb_cStruct; - -static VALUE struct_alloc _((VALUE)); - -VALUE -rb_struct_iv_get(c, name) - VALUE c; - char *name; -{ - ID id; - - id = rb_intern(name); - for (;;) { - if (rb_ivar_defined(c, id)) - return rb_ivar_get(c, id); - c = RCLASS(c)->super; - if (c == 0 || c == rb_cStruct) - return Qnil; - } -} - -VALUE -rb_struct_s_members(klass) - VALUE klass; -{ - VALUE members = rb_struct_iv_get(klass, "__members__"); - - if (NIL_P(members)) { - rb_bug("non-initialized struct"); - } - return members; -} - -VALUE -rb_struct_members(s) - VALUE s; -{ - VALUE members = rb_struct_s_members(rb_obj_class(s)); - - if (RSTRUCT(s)->len != RARRAY(members)->len) { - rb_raise(rb_eTypeError, "struct size differs (%d required %d given)", - RARRAY(members)->len, RSTRUCT(s)->len); - } - return members; -} - -static VALUE -rb_struct_s_members_m(klass) - VALUE klass; -{ - VALUE members, ary; - VALUE *p, *pend; - - members = rb_struct_s_members(klass); - ary = rb_ary_new2(RARRAY(members)->len); - p = RARRAY(members)->ptr; pend = p + RARRAY(members)->len; - while (p < pend) { - rb_ary_push(ary, rb_str_new2(rb_id2name(SYM2ID(*p)))); - p++; - } - - return ary; -} - -/* - * call-seq: - * struct.members => array - * - * Returns an array of strings representing the names of the instance - * variables. - * - * Customer = Struct.new(:name, :address, :zip) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) - * joe.members #=> ["name", "address", "zip"] - */ - -static VALUE -rb_struct_members_m(obj) - VALUE obj; -{ - return rb_struct_s_members_m(rb_obj_class(obj)); -} - -VALUE -rb_struct_getmember(obj, id) - VALUE obj; - ID id; -{ - VALUE members, slot; - long i; - - members = rb_struct_members(obj); - slot = ID2SYM(id); - for (i=0; ilen; i++) { - if (RARRAY(members)->ptr[i] == slot) { - return RSTRUCT(obj)->ptr[i]; - } - } - rb_name_error(id, "%s is not struct member", rb_id2name(id)); - return Qnil; /* not reached */ -} - -static VALUE -rb_struct_ref(obj) - VALUE obj; -{ - return rb_struct_getmember(obj, ruby_frame->orig_func); -} - -static VALUE rb_struct_ref0(obj) VALUE obj; {return RSTRUCT(obj)->ptr[0];} -static VALUE rb_struct_ref1(obj) VALUE obj; {return RSTRUCT(obj)->ptr[1];} -static VALUE rb_struct_ref2(obj) VALUE obj; {return RSTRUCT(obj)->ptr[2];} -static VALUE rb_struct_ref3(obj) VALUE obj; {return RSTRUCT(obj)->ptr[3];} -static VALUE rb_struct_ref4(obj) VALUE obj; {return RSTRUCT(obj)->ptr[4];} -static VALUE rb_struct_ref5(obj) VALUE obj; {return RSTRUCT(obj)->ptr[5];} -static VALUE rb_struct_ref6(obj) VALUE obj; {return RSTRUCT(obj)->ptr[6];} -static VALUE rb_struct_ref7(obj) VALUE obj; {return RSTRUCT(obj)->ptr[7];} -static VALUE rb_struct_ref8(obj) VALUE obj; {return RSTRUCT(obj)->ptr[8];} -static VALUE rb_struct_ref9(obj) VALUE obj; {return RSTRUCT(obj)->ptr[9];} - -static VALUE (*ref_func[10])() = { - rb_struct_ref0, - rb_struct_ref1, - rb_struct_ref2, - rb_struct_ref3, - rb_struct_ref4, - rb_struct_ref5, - rb_struct_ref6, - rb_struct_ref7, - rb_struct_ref8, - rb_struct_ref9, -}; - -static void -rb_struct_modify(s) - VALUE s; -{ - if (OBJ_FROZEN(s)) rb_error_frozen("Struct"); - if (!OBJ_TAINTED(s) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't modify Struct"); -} - -static VALUE -rb_struct_set(obj, val) - VALUE obj, val; -{ - VALUE members, slot; - ID id; - long i; - - members = rb_struct_members(obj); - rb_struct_modify(obj); - id = ruby_frame->orig_func; - for (i=0; ilen; i++) { - slot = RARRAY(members)->ptr[i]; - if (rb_id_attrset(SYM2ID(slot)) == id) { - return RSTRUCT(obj)->ptr[i] = val; - } - } - rb_name_error(ruby_frame->last_func, "`%s' is not a struct member", - rb_id2name(id)); - return Qnil; /* not reached */ -} - -static VALUE -make_struct(name, members, klass) - VALUE name, members, klass; -{ - VALUE nstr; - ID id; - long i; - - OBJ_FREEZE(members); - if (NIL_P(name)) { - nstr = rb_class_new(klass); - rb_make_metaclass(nstr, RBASIC(klass)->klass); - rb_class_inherited(klass, nstr); - } - else { - char *cname = StringValuePtr(name); - id = rb_intern(cname); - if (!rb_is_const_id(id)) { - rb_name_error(id, "identifier %s needs to be constant", cname); - } - if (rb_const_defined_at(klass, id)) { - rb_warn("redefining constant Struct::%s", cname); - rb_mod_remove_const(klass, ID2SYM(id)); - } - nstr = rb_define_class_under(klass, rb_id2name(id), klass); - } - rb_iv_set(nstr, "__size__", LONG2NUM(RARRAY(members)->len)); - rb_iv_set(nstr, "__members__", members); - - rb_define_alloc_func(nstr, struct_alloc); - rb_define_singleton_method(nstr, "new", rb_class_new_instance, -1); - rb_define_singleton_method(nstr, "[]", rb_class_new_instance, -1); - rb_define_singleton_method(nstr, "members", rb_struct_s_members_m, 0); - for (i=0; i< RARRAY(members)->len; i++) { - ID id = SYM2ID(RARRAY(members)->ptr[i]); - if (rb_is_local_id(id) || rb_is_const_id(id)) { - if (i<10) { - rb_define_method_id(nstr, id, ref_func[i], 0); - } - else { - rb_define_method_id(nstr, id, rb_struct_ref, 0); - } - rb_define_method_id(nstr, rb_id_attrset(id), rb_struct_set, 1); - } - } - - return nstr; -} - -#ifdef HAVE_STDARG_PROTOTYPES -#include -#define va_init_list(a,b) va_start(a,b) -#else -#include -#define va_init_list(a,b) va_start(a) -#endif - -VALUE -#ifdef HAVE_STDARG_PROTOTYPES -rb_struct_define(const char *name, ...) -#else -rb_struct_define(name, va_alist) - const char *name; - va_dcl -#endif -{ - va_list ar; - VALUE nm, ary; - char *mem; - - if (!name) nm = Qnil; - else nm = rb_str_new2(name); - ary = rb_ary_new(); - - va_init_list(ar, name); - while ((mem = va_arg(ar, char*)) != 0) { - ID slot = rb_intern(mem); - rb_ary_push(ary, ID2SYM(slot)); - } - va_end(ar); - - return make_struct(nm, ary, rb_cStruct); -} - -/* - * call-seq: - * Struct.new( [aString] [, aSym]+> ) => StructClass - * StructClass.new(arg, ...) => obj - * StructClass[arg, ...] => obj - * - * Creates a new class, named by aString, containing accessor - * methods for the given symbols. If the name aString is - * omitted, an anonymous structure class will be created. Otherwise, - * the name of this struct will appear as a constant in class - * Struct, so it must be unique for all - * Structs in the system and should start with a capital - * letter. Assigning a structure class to a constant effectively gives - * the class the name of the constant. - * - * Struct::new returns a new Class object, - * which can then be used to create specific instances of the new - * structure. The number of actual parameters must be - * less than or equal to the number of attributes defined for this - * class; unset parameters default to \nil{}. Passing too many - * parameters will raise an \E{ArgumentError}. - * - * The remaining methods listed in this section (class and instance) - * are defined for this generated class. - * - * # Create a structure with a name in Struct - * Struct.new("Customer", :name, :address) #=> Struct::Customer - * Struct::Customer.new("Dave", "123 Main") #=> # - * - * # Create a structure named by its constant - * Customer = Struct.new(:name, :address) #=> Customer - * Customer.new("Dave", "123 Main") #=> # - */ - -static VALUE -rb_struct_s_def(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - VALUE name, rest; - long i; - VALUE st; - ID id; - - rb_scan_args(argc, argv, "1*", &name, &rest); - if (!NIL_P(name) && SYMBOL_P(name)) { - rb_ary_unshift(rest, name); - name = Qnil; - } - for (i=0; ilen; i++) { - id = rb_to_id(RARRAY(rest)->ptr[i]); - RARRAY(rest)->ptr[i] = ID2SYM(id); - } - st = make_struct(name, rest, klass); - if (rb_block_given_p()) { - rb_mod_module_eval(0, 0, st); - } - - return st; -} - -/* - */ - -static VALUE -rb_struct_initialize(self, values) - VALUE self, values; -{ - VALUE klass = rb_obj_class(self); - VALUE size; - long n; - - rb_struct_modify(self); - size = rb_struct_iv_get(klass, "__size__"); - n = FIX2LONG(size); - if (n < RARRAY(values)->len) { - rb_raise(rb_eArgError, "struct size differs"); - } - MEMCPY(RSTRUCT(self)->ptr, RARRAY(values)->ptr, VALUE, RARRAY(values)->len); - if (n > RARRAY(values)->len) { - rb_mem_clear(RSTRUCT(self)->ptr+RARRAY(values)->len, - n-RARRAY(values)->len); - } - return Qnil; -} - -static VALUE -struct_alloc(klass) - VALUE klass; -{ - VALUE size; - long n; - NEWOBJ(st, struct RStruct); - OBJSETUP(st, klass, T_STRUCT); - - size = rb_struct_iv_get(klass, "__size__"); - n = FIX2LONG(size); - - st->ptr = ALLOC_N(VALUE, n); - rb_mem_clear(st->ptr, n); - st->len = n; - - return (VALUE)st; -} - -VALUE -rb_struct_alloc(klass, values) - VALUE klass, values; -{ - return rb_class_new_instance(RARRAY(values)->len, RARRAY(values)->ptr, klass); -} - -VALUE -#ifdef HAVE_STDARG_PROTOTYPES -rb_struct_new(VALUE klass, ...) -#else -rb_struct_new(klass, va_alist) - VALUE klass; - va_dcl -#endif -{ - VALUE sz, *mem; - long size, i; - va_list args; - - sz = rb_struct_iv_get(klass, "__size__"); - size = FIX2LONG(sz); - mem = ALLOCA_N(VALUE, size); - va_init_list(args, klass); - for (i=0; i struct - * - * Calls block once for each instance variable, passing the - * value as a parameter. - * - * Customer = Struct.new(:name, :address, :zip) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) - * joe.each {|x| puts(x) } - * - * produces: - * - * Joe Smith - * 123 Maple, Anytown NC - * 12345 - */ - -static VALUE -rb_struct_each(s) - VALUE s; -{ - long i; - - for (i=0; ilen; i++) { - rb_yield(RSTRUCT(s)->ptr[i]); - } - return s; -} - -/* - * call-seq: - * struct.each_pair {|sym, obj| block } => struct - * - * Calls block once for each instance variable, passing the name - * (as a symbol) and the value as parameters. - * - * Customer = Struct.new(:name, :address, :zip) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) - * joe.each_pair {|name, value| puts("#{name} => #{value}") } - * - * produces: - * - * name => Joe Smith - * address => 123 Maple, Anytown NC - * zip => 12345 - */ - -static VALUE -rb_struct_each_pair(s) - VALUE s; -{ - VALUE members; - long i; - - members = rb_struct_members(s); - for (i=0; ilen; i++) { - rb_yield_values(2, rb_ary_entry(members, i), RSTRUCT(s)->ptr[i]); - } - return s; -} - -static VALUE -inspect_struct(s) - VALUE s; -{ - char *cname = rb_class2name(rb_obj_class(s)); - VALUE str, members; - long i; - - members = rb_struct_members(s); - str = rb_str_buf_new2("#len; i++) { - VALUE slot; - ID id; - char *p; - - if (i > 0) { - rb_str_cat2(str, ", "); - } - slot = RARRAY(members)->ptr[i]; - id = SYM2ID(slot); - if (rb_is_local_id(id) || rb_is_const_id(id)) { - p = rb_id2name(id); - rb_str_cat2(str, p); - } - else { - rb_str_append(str, rb_inspect(slot)); - } - rb_str_cat2(str, "="); - rb_str_append(str, rb_inspect(RSTRUCT(s)->ptr[i])); - } - rb_str_cat2(str, ">"); - OBJ_INFECT(str, s); - - return str; -} - -/* - * call-seq: - * struct.to_s => string - * struct.inspect => string - * - * Describe the contents of this struct in a string. - */ - -static VALUE -rb_struct_inspect(s) - VALUE s; -{ - if (rb_inspecting_p(s)) { - char *cname = rb_class2name(rb_obj_class(s)); - size_t len = strlen(cname) + 14; - VALUE str = rb_str_new(0, len); - - snprintf(RSTRING(str)->ptr, len+1, "#", cname); - RSTRING(str)->len = strlen(RSTRING(str)->ptr); - return str; - } - return rb_protect_inspect(inspect_struct, s, 0); -} - -/* - * call-seq: - * struct.to_a => array - * struct.values => array - * - * Returns the values for this instance as an array. - * - * Customer = Struct.new(:name, :address, :zip) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) - * joe.to_a[1] #=> "123 Maple, Anytown NC" - */ - -static VALUE -rb_struct_to_a(s) - VALUE s; -{ - return rb_ary_new4(RSTRUCT(s)->len, RSTRUCT(s)->ptr); -} - -/* :nodoc: */ -static VALUE -rb_struct_init_copy(copy, s) - VALUE copy, s; -{ - if (copy == s) return copy; - rb_check_frozen(copy); - if (!rb_obj_is_instance_of(s, rb_obj_class(copy))) { - rb_raise(rb_eTypeError, "wrong argument class"); - } - if (RSTRUCT(copy)->len != RSTRUCT(s)->len) { - rb_raise(rb_eTypeError, "struct size mismatch"); - } - MEMCPY(RSTRUCT(copy)->ptr, RSTRUCT(s)->ptr, VALUE, RSTRUCT(copy)->len); - - return copy; -} - -static VALUE -rb_struct_aref_id(s, id) - VALUE s; - ID id; -{ - VALUE members; - long i, len; - - members = rb_struct_members(s); - len = RARRAY(members)->len; - for (i=0; iptr[i]) == id) { - return RSTRUCT(s)->ptr[i]; - } - } - rb_name_error(id, "no member '%s' in struct", rb_id2name(id)); - return Qnil; /* not reached */ -} - -/* - * call-seq: - * struct[symbol] => anObject - * struct[fixnum] => anObject - * - * Attribute Reference---Returns the value of the instance variable - * named by symbol, or indexed (0..length-1) by - * fixnum. Will raise NameError if the named - * variable does not exist, or IndexError if the index is - * out of range. - * - * Customer = Struct.new(:name, :address, :zip) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) - * - * joe["name"] #=> "Joe Smith" - * joe[:name] #=> "Joe Smith" - * joe[0] #=> "Joe Smith" - */ - -VALUE -rb_struct_aref(s, idx) - VALUE s, idx; -{ - long i; - - if (TYPE(idx) == T_STRING || TYPE(idx) == T_SYMBOL) { - return rb_struct_aref_id(s, rb_to_id(idx)); - } - - i = NUM2LONG(idx); - if (i < 0) i = RSTRUCT(s)->len + i; - if (i < 0) - rb_raise(rb_eIndexError, "offset %ld too small for struct(size:%ld)", - i, RSTRUCT(s)->len); - if (RSTRUCT(s)->len <= i) - rb_raise(rb_eIndexError, "offset %ld too large for struct(size:%ld)", - i, RSTRUCT(s)->len); - return RSTRUCT(s)->ptr[i]; -} - -static VALUE -rb_struct_aset_id(s, id, val) - VALUE s, val; - ID id; -{ - VALUE members; - long i, len; - - members = rb_struct_members(s); - rb_struct_modify(s); - len = RARRAY(members)->len; - if (RSTRUCT(s)->len != RARRAY(members)->len) { - rb_raise(rb_eTypeError, "struct size differs (%d required %d given)", - RARRAY(members)->len, RSTRUCT(s)->len); - } - for (i=0; iptr[i]) == id) { - RSTRUCT(s)->ptr[i] = val; - return val; - } - } - rb_name_error(id, "no member '%s' in struct", rb_id2name(id)); -} - -/* - * call-seq: - * struct[symbol] = obj => obj - * struct[fixnum] = obj => obj - * - * Attribute Assignment---Assigns to the instance variable named by - * symbol or fixnum the value obj and - * returns it. Will raise a NameError if the named - * variable does not exist, or an IndexError if the index - * is out of range. - * - * Customer = Struct.new(:name, :address, :zip) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) - * - * joe["name"] = "Luke" - * joe[:zip] = "90210" - * - * joe.name #=> "Luke" - * joe.zip #=> "90210" - */ - -VALUE -rb_struct_aset(s, idx, val) - VALUE s, idx, val; -{ - long i; - - if (TYPE(idx) == T_STRING || TYPE(idx) == T_SYMBOL) { - return rb_struct_aset_id(s, rb_to_id(idx), val); - } - - i = NUM2LONG(idx); - if (i < 0) i = RSTRUCT(s)->len + i; - if (i < 0) { - rb_raise(rb_eIndexError, "offset %ld too small for struct(size:%ld)", - i, RSTRUCT(s)->len); - } - if (RSTRUCT(s)->len <= i) { - rb_raise(rb_eIndexError, "offset %ld too large for struct(size:%ld)", - i, RSTRUCT(s)->len); - } - rb_struct_modify(s); - return RSTRUCT(s)->ptr[i] = val; -} - -static VALUE struct_entry _((VALUE, long)); -static VALUE -struct_entry(s, n) - VALUE s; - long n; -{ - return rb_struct_aref(s, LONG2NUM(n)); -} - -/* - * call-seq: - * struct.values_at(selector,... ) => an_array - * - * Returns an array containing the elements in - * _self_ corresponding to the given selector(s). The selectors - * may be either integer indices or ranges. - * See also .select. - * - * a = %w{ a b c d e f } - * a.values_at(1, 3, 5) - * a.values_at(1, 3, 5, 7) - * a.values_at(-1, -3, -5, -7) - * a.values_at(1..3, 2...5) - */ - -static VALUE -rb_struct_values_at(argc, argv, s) - int argc; - VALUE *argv; - VALUE s; -{ - return rb_values_at(s, RSTRUCT(s)->len, argc, argv, struct_entry); -} - -/* - * call-seq: - * struct.select {|i| block } => array - * - * Invokes the block passing in successive elements from - * struct, returning an array containing those elements - * for which the block returns a true value (equivalent to - * Enumerable#select). - * - * Lots = Struct.new(:a, :b, :c, :d, :e, :f) - * l = Lots.new(11, 22, 33, 44, 55, 66) - * l.select {|v| (v % 2).zero? } #=> [22, 44, 66] - */ - -static VALUE -rb_struct_select(argc, argv, s) - int argc; - VALUE *argv; - VALUE s; -{ - VALUE result; - long i; - - if (argc > 0) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc); - } - result = rb_ary_new(); - for (i = 0; i < RSTRUCT(s)->len; i++) { - if (RTEST(rb_yield(RSTRUCT(s)->ptr[i]))) { - rb_ary_push(result, RSTRUCT(s)->ptr[i]); - } - } - - return result; -} - -/* - * call-seq: - * struct == other_struct => true or false - * - * Equality---Returns true if other_struct is - * equal to this one: they must be of the same class as generated by - * Struct::new, and the values of all instance variables - * must be equal (according to Object#==). - * - * Customer = Struct.new(:name, :address, :zip) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) - * joejr = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) - * jane = Customer.new("Jane Doe", "456 Elm, Anytown NC", 12345) - * joe == joejr #=> true - * joe == jane #=> false - */ - -static VALUE -rb_struct_equal(s, s2) - VALUE s, s2; -{ - long i; - - if (s == s2) return Qtrue; - if (TYPE(s2) != T_STRUCT) return Qfalse; - if (rb_obj_class(s) != rb_obj_class(s2)) return Qfalse; - if (RSTRUCT(s)->len != RSTRUCT(s2)->len) { - rb_bug("inconsistent struct"); /* should never happen */ - } - - for (i=0; ilen; i++) { - if (!rb_equal(RSTRUCT(s)->ptr[i], RSTRUCT(s2)->ptr[i])) return Qfalse; - } - return Qtrue; -} - -/* - * call-seq: - * struct.hash => fixnum - * - * Return a hash value based on this struct's contents. - */ - -static VALUE -rb_struct_hash(s) - VALUE s; -{ - long i, h; - VALUE n; - - h = rb_hash(rb_obj_class(s)); - for (i = 0; i < RSTRUCT(s)->len; i++) { - h = (h << 1) | (h<0 ? 1 : 0); - n = rb_hash(RSTRUCT(s)->ptr[i]); - h ^= NUM2LONG(n); - } - return LONG2FIX(h); -} - -/* - * code-seq: - * struct.eql?(other) => true or false - * - * Two structures are equal if they are the same object, or if all their - * fields are equal (using eql?). - */ - -static VALUE -rb_struct_eql(s, s2) - VALUE s, s2; -{ - long i; - - if (s == s2) return Qtrue; - if (TYPE(s2) != T_STRUCT) return Qfalse; - if (rb_obj_class(s) != rb_obj_class(s2)) return Qfalse; - if (RSTRUCT(s)->len != RSTRUCT(s2)->len) { - rb_bug("inconsistent struct"); /* should never happen */ - } - - for (i=0; ilen; i++) { - if (!rb_eql(RSTRUCT(s)->ptr[i], RSTRUCT(s2)->ptr[i])) return Qfalse; - } - return Qtrue; -} - -/* - * call-seq: - * struct.length => fixnum - * struct.size => fixnum - * - * Returns the number of instance variables. - * - * Customer = Struct.new(:name, :address, :zip) - * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) - * joe.length #=> 3 - */ - -static VALUE -rb_struct_size(s) - VALUE s; -{ - return LONG2FIX(RSTRUCT(s)->len); -} - -/* - * A Struct is a convenient way to bundle a number of - * attributes together, using accessor methods, without having to write - * an explicit class. - * - * The Struct class is a generator of specific classes, - * each one of which is defined to hold a set of variables and their - * accessors. In these examples, we'll call the generated class - * ``CustomerClass,'' and we'll show an example instance of that - * class as ``CustomerInst.'' - * - * In the descriptions that follow, the parameter symbol refers - * to a symbol, which is either a quoted string or a - * Symbol (such as :name). - */ -void -Init_Struct() -{ - rb_cStruct = rb_define_class("Struct", rb_cObject); - rb_include_module(rb_cStruct, rb_mEnumerable); - - rb_undef_alloc_func(rb_cStruct); - rb_define_singleton_method(rb_cStruct, "new", rb_struct_s_def, -1); - - rb_define_method(rb_cStruct, "initialize", rb_struct_initialize, -2); - rb_define_method(rb_cStruct, "initialize_copy", rb_struct_init_copy, 1); - - rb_define_method(rb_cStruct, "==", rb_struct_equal, 1); - rb_define_method(rb_cStruct, "eql?", rb_struct_eql, 1); - rb_define_method(rb_cStruct, "hash", rb_struct_hash, 0); - - rb_define_method(rb_cStruct, "to_s", rb_struct_inspect, 0); - rb_define_method(rb_cStruct, "inspect", rb_struct_inspect, 0); - rb_define_method(rb_cStruct, "to_a", rb_struct_to_a, 0); - rb_define_method(rb_cStruct, "values", rb_struct_to_a, 0); - rb_define_method(rb_cStruct, "size", rb_struct_size, 0); - rb_define_method(rb_cStruct, "length", rb_struct_size, 0); - - rb_define_method(rb_cStruct, "each", rb_struct_each, 0); - rb_define_method(rb_cStruct, "each_pair", rb_struct_each_pair, 0); - rb_define_method(rb_cStruct, "[]", rb_struct_aref, 1); - rb_define_method(rb_cStruct, "[]=", rb_struct_aset, 2); - rb_define_method(rb_cStruct, "select", rb_struct_select, -1); - rb_define_method(rb_cStruct, "values_at", rb_struct_values_at, -1); - - rb_define_method(rb_cStruct, "members", rb_struct_members_m, 0); -} -/********************************************************************** - - time.c - - - $Author: shyouhei $ - $Date: 2009-02-02 12:03:25 +0100 (Mon, 02 Feb 2009) $ - created at: Tue Dec 28 14:31:59 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif - -#include -#include - -VALUE rb_cTime; - -struct time_object { - struct timeval tv; - struct tm tm; - int gmt; - int tm_got; -}; - -#define GetTimeval(obj, tobj) \ - Data_Get_Struct(obj, struct time_object, tobj) - -static void time_free _((void *)); -static VALUE time_utc_offset _((VALUE)); - -static void -time_free(tobj) - void *tobj; -{ - if (tobj) free(tobj); -} - -static VALUE time_s_alloc _((VALUE)); -static VALUE -time_s_alloc(klass) - VALUE klass; -{ - VALUE obj; - struct time_object *tobj; - - obj = Data_Make_Struct(klass, struct time_object, 0, time_free, tobj); - tobj->tm_got=0; - tobj->tv.tv_sec = 0; - tobj->tv.tv_usec = 0; - - return obj; -} - -static void -time_modify(time) - VALUE time; -{ - rb_check_frozen(time); - if (!OBJ_TAINTED(time) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't modify Time"); -} - -/* - * Document-method: now - * - * Synonym for Time.new. Returns a +Time+ object - * initialized tot he current system time. - * - * call-seq: - * Time.new -> time - * - * Returns a Time object initialized to the current system - * time. Note: The object created will be created using the - * resolution available on your system clock, and so may include - * fractional seconds. - * - * a = Time.new #=> Wed Apr 09 08:56:03 CDT 2003 - * b = Time.new #=> Wed Apr 09 08:56:03 CDT 2003 - * a == b #=> false - * "%.6f" % a.to_f #=> "1049896563.230740" - * "%.6f" % b.to_f #=> "1049896563.231466" - * - */ - -static VALUE -time_init(time) - VALUE time; -{ - struct time_object *tobj; - - time_modify(time); - GetTimeval(time, tobj); - tobj->tm_got=0; - tobj->tv.tv_sec = 0; - tobj->tv.tv_usec = 0; - if (gettimeofday(&tobj->tv, 0) < 0) { - rb_sys_fail("gettimeofday"); - } - - return time; -} - -#define NDIV(x,y) (-(-((x)+1)/(y))-1) -#define NMOD(x,y) ((y)-(-((x)+1)%(y))-1) - -static void -time_overflow_p(secp, usecp) - time_t *secp, *usecp; -{ - time_t tmp, sec = *secp, usec = *usecp; - - if (usec >= 1000000) { /* usec positive overflow */ - tmp = sec + usec / 1000000; - usec %= 1000000; - if (sec > 0 && tmp < 0) { - rb_raise(rb_eRangeError, "out of Time range"); - } - sec = tmp; - } - if (usec < 0) { /* usec negative overflow */ - tmp = sec + NDIV(usec,1000000); /* negative div */ - usec = NMOD(usec,1000000); /* negative mod */ - if (sec < 0 && tmp > 0) { - rb_raise(rb_eRangeError, "out of Time range"); - } - sec = tmp; - } -#ifndef NEGATIVE_TIME_T - if (sec < 0 || (sec == 0 && usec < 0)) - rb_raise(rb_eArgError, "time must be positive"); -#endif - *secp = sec; - *usecp = usec; -} - -static VALUE time_new_internal _((VALUE, time_t, time_t)); -static VALUE -time_new_internal(klass, sec, usec) - VALUE klass; - time_t sec, usec; -{ - VALUE time = time_s_alloc(klass); - struct time_object *tobj; - - GetTimeval(time, tobj); - time_overflow_p(&sec, &usec); - tobj->tv.tv_sec = sec; - tobj->tv.tv_usec = usec; - - return time; -} - -VALUE -rb_time_new(sec, usec) - time_t sec, usec; -{ - return time_new_internal(rb_cTime, sec, usec); -} - -static struct timeval -time_timeval(time, interval) - VALUE time; - int interval; -{ - struct timeval t; - char *tstr = interval ? "time interval" : "time"; - -#ifndef NEGATIVE_TIME_T - interval = 1; -#endif - - switch (TYPE(time)) { - case T_FIXNUM: - t.tv_sec = FIX2LONG(time); - if (interval && t.tv_sec < 0) - rb_raise(rb_eArgError, "%s must be positive", tstr); - t.tv_usec = 0; - break; - - case T_FLOAT: - if (interval && RFLOAT(time)->value < 0.0) - rb_raise(rb_eArgError, "%s must be positive", tstr); - else { - double f, d; - - d = modf(RFLOAT(time)->value, &f); - if (d < 0) { - d += 1; - f -= 1; - } - t.tv_sec = (time_t)f; - if (f != t.tv_sec) { - rb_raise(rb_eRangeError, "%f out of Time range", RFLOAT(time)->value); - } - t.tv_usec = (time_t)(d*1e6+0.5); - } - break; - - case T_BIGNUM: - t.tv_sec = NUM2LONG(time); - if (interval && t.tv_sec < 0) - rb_raise(rb_eArgError, "%s must be positive", tstr); - t.tv_usec = 0; - break; - - default: - rb_raise(rb_eTypeError, "can't convert %s into %s", - rb_obj_classname(time), tstr); - break; - } - return t; -} - -struct timeval -rb_time_interval(time) - VALUE time; -{ - return time_timeval(time, Qtrue); -} - -struct timeval -rb_time_timeval(time) - VALUE time; -{ - struct time_object *tobj; - struct timeval t; - - if (TYPE(time) == T_DATA && RDATA(time)->dfree == time_free) { - GetTimeval(time, tobj); - t = tobj->tv; - return t; - } - return time_timeval(time, Qfalse); -} - -/* - * call-seq: - * Time.at( aTime ) => time - * Time.at( seconds [, microseconds] ) => time - * - * Creates a new time object with the value given by aTime, or - * the given number of seconds (and optional - * microseconds) from epoch. A non-portable feature allows the - * offset to be negative on some systems. - * - * Time.at(0) #=> Wed Dec 31 18:00:00 CST 1969 - * Time.at(946702800) #=> Fri Dec 31 23:00:00 CST 1999 - * Time.at(-284061600) #=> Sat Dec 31 00:00:00 CST 1960 - */ - -static VALUE -time_s_at(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - struct timeval tv; - VALUE time, t; - - if (rb_scan_args(argc, argv, "11", &time, &t) == 2) { - tv.tv_sec = NUM2LONG(time); - tv.tv_usec = NUM2LONG(t); - } - else { - tv = rb_time_timeval(time); - } - t = time_new_internal(klass, tv.tv_sec, tv.tv_usec); - if (TYPE(time) == T_DATA && RDATA(time)->dfree == time_free) { - struct time_object *tobj, *tobj2; - - GetTimeval(time, tobj); - GetTimeval(t, tobj2); - tobj2->gmt = tobj->gmt; - } - return t; -} - -static char *months [12] = { - "jan", "feb", "mar", "apr", "may", "jun", - "jul", "aug", "sep", "oct", "nov", "dec", -}; - -static long -obj2long(obj) - VALUE obj; -{ - if (TYPE(obj) == T_STRING) { - obj = rb_str_to_inum(obj, 10, Qfalse); - } - - return NUM2LONG(obj); -} - -static void -time_arg(argc, argv, tm, usec) - int argc; - VALUE *argv; - struct tm *tm; - time_t *usec; -{ - VALUE v[8]; - int i; - long year; - - MEMZERO(tm, struct tm, 1); - *usec = 0; - if (argc == 10) { - v[0] = argv[5]; - v[1] = argv[4]; - v[2] = argv[3]; - v[3] = argv[2]; - v[4] = argv[1]; - v[5] = argv[0]; - v[6] = Qnil; - tm->tm_isdst = RTEST(argv[8]) ? 1 : 0; - } - else { - rb_scan_args(argc, argv, "17", &v[0],&v[1],&v[2],&v[3],&v[4],&v[5],&v[6],&v[7]); - /* v[6] may be usec or zone (parsedate) */ - /* v[7] is wday (parsedate; ignored) */ - tm->tm_wday = -1; - tm->tm_isdst = -1; - } - - year = obj2long(v[0]); - - if (0 <= year && year < 39) { - year += 100; - rb_warning("2 digits year is used"); - } - else if (69 <= year && year < 139) { - rb_warning("2 or 3 digits year is used"); - } - else { - year -= 1900; - } - - tm->tm_year = year; - - if (NIL_P(v[1])) { - tm->tm_mon = 0; - } - else { - VALUE s = rb_check_string_type(v[1]); - if (!NIL_P(s)) { - tm->tm_mon = -1; - for (i=0; i<12; i++) { - if (RSTRING(s)->len == 3 && - strcasecmp(months[i], RSTRING(s)->ptr) == 0) { - tm->tm_mon = i; - break; - } - } - if (tm->tm_mon == -1) { - char c = RSTRING(s)->ptr[0]; - - if ('0' <= c && c <= '9') { - tm->tm_mon = obj2long(s)-1; - } - } - } - else { - tm->tm_mon = obj2long(v[1])-1; - } - } - if (NIL_P(v[2])) { - tm->tm_mday = 1; - } - else { - tm->tm_mday = obj2long(v[2]); - } - tm->tm_hour = NIL_P(v[3])?0:obj2long(v[3]); - tm->tm_min = NIL_P(v[4])?0:obj2long(v[4]); - tm->tm_sec = NIL_P(v[5])?0:obj2long(v[5]); - if (!NIL_P(v[6])) { - if (argc == 8) { - /* v[6] is timezone, but ignored */ - } - else if (argc == 7) { - *usec = obj2long(v[6]); - } - } - - /* value validation */ - if ( - tm->tm_year != year || -#ifndef NEGATIVE_TIME_T - tm->tm_year < 69 || -#endif - tm->tm_mon < 0 || tm->tm_mon > 11 - || tm->tm_mday < 1 || tm->tm_mday > 31 - || tm->tm_hour < 0 || tm->tm_hour > 23 - || tm->tm_min < 0 || tm->tm_min > 59 - || tm->tm_sec < 0 || tm->tm_sec > 60) - rb_raise(rb_eArgError, "argument out of range"); -} - -static VALUE time_gmtime _((VALUE)); -static VALUE time_localtime _((VALUE)); -static VALUE time_get_tm _((VALUE, int)); - -static int -leap_year_p(y) - long y; -{ - return ((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0); -} - -#define DIV(n,d) ((n)<0 ? NDIV((n),(d)) : (n)/(d)) - -static time_t -timegm_noleapsecond(tm) - struct tm *tm; -{ - static int common_year_yday_offset[] = { - -1, - -1 + 31, - -1 + 31 + 28, - -1 + 31 + 28 + 31, - -1 + 31 + 28 + 31 + 30, - -1 + 31 + 28 + 31 + 30 + 31, - -1 + 31 + 28 + 31 + 30 + 31 + 30, - -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31, - -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31, - -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, - -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, - -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 - /* 1 2 3 4 5 6 7 8 9 10 11 */ - }; - static int leap_year_yday_offset[] = { - -1, - -1 + 31, - -1 + 31 + 29, - -1 + 31 + 29 + 31, - -1 + 31 + 29 + 31 + 30, - -1 + 31 + 29 + 31 + 30 + 31, - -1 + 31 + 29 + 31 + 30 + 31 + 30, - -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31, - -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31, - -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30, - -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, - -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 - /* 1 2 3 4 5 6 7 8 9 10 11 */ - }; - - long tm_year = tm->tm_year; - int tm_yday = tm->tm_mday; - if (leap_year_p(tm_year + 1900)) - tm_yday += leap_year_yday_offset[tm->tm_mon]; - else - tm_yday += common_year_yday_offset[tm->tm_mon]; - - /* - * `Seconds Since the Epoch' in SUSv3: - * tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 + - * (tm_year-70)*31536000 + ((tm_year-69)/4)*86400 - - * ((tm_year-1)/100)*86400 + ((tm_year+299)/400)*86400 - */ - return tm->tm_sec + tm->tm_min*60 + tm->tm_hour*3600 + - (time_t)(tm_yday + - (tm_year-70)*365 + - DIV(tm_year-69,4) - - DIV(tm_year-1,100) + - DIV(tm_year+299,400))*86400; -} - -static int -tmcmp(a, b) - struct tm *a; - struct tm *b; -{ - if (a->tm_year != b->tm_year) - return a->tm_year < b->tm_year ? -1 : 1; - else if (a->tm_mon != b->tm_mon) - return a->tm_mon < b->tm_mon ? -1 : 1; - else if (a->tm_mday != b->tm_mday) - return a->tm_mday < b->tm_mday ? -1 : 1; - else if (a->tm_hour != b->tm_hour) - return a->tm_hour < b->tm_hour ? -1 : 1; - else if (a->tm_min != b->tm_min) - return a->tm_min < b->tm_min ? -1 : 1; - else if (a->tm_sec != b->tm_sec) - return a->tm_sec < b->tm_sec ? -1 : 1; - else - return 0; -} - -#if SIZEOF_TIME_T == SIZEOF_LONG -typedef unsigned long unsigned_time_t; -#elif SIZEOF_TIME_T == SIZEOF_INT -typedef unsigned int unsigned_time_t; -#elif SIZEOF_TIME_T == SIZEOF_LONG_LONG -typedef unsigned LONG_LONG unsigned_time_t; -#else -# error cannot find integer type which size is same as time_t. -#endif - -static time_t -search_time_t(tptr, utc_p) - struct tm *tptr; - int utc_p; -{ - time_t guess, guess_lo, guess_hi; - struct tm *tm, tm_lo, tm_hi; - int d, have_guess; - int find_dst; - - find_dst = 0 < tptr->tm_isdst; - -#ifdef NEGATIVE_TIME_T - guess_lo = (time_t)~((unsigned_time_t)~(time_t)0 >> 1); -#else - guess_lo = 0; -#endif - guess_hi = ((time_t)-1) < ((time_t)0) ? - (time_t)((unsigned_time_t)~(time_t)0 >> 1) : - ~(time_t)0; - - guess = timegm_noleapsecond(tptr); - tm = (utc_p ? gmtime : localtime)(&guess); - if (tm) { - d = tmcmp(tptr, tm); - if (d == 0) return guess; - if (d < 0) { - guess_hi = guess; - guess -= 24 * 60 * 60; - } - else { - guess_lo = guess; - guess += 24 * 60 * 60; - } - if (guess_lo < guess && guess < guess_hi && - (tm = (utc_p ? gmtime : localtime)(&guess)) != NULL) { - d = tmcmp(tptr, tm); - if (d == 0) return guess; - if (d < 0) - guess_hi = guess; - else - guess_lo = guess; - } - } - - tm = (utc_p ? gmtime : localtime)(&guess_lo); - if (!tm) goto error; - d = tmcmp(tptr, tm); - if (d < 0) goto out_of_range; - if (d == 0) return guess_lo; - tm_lo = *tm; - - tm = (utc_p ? gmtime : localtime)(&guess_hi); - if (!tm) goto error; - d = tmcmp(tptr, tm); - if (d > 0) goto out_of_range; - if (d == 0) return guess_hi; - tm_hi = *tm; - - have_guess = 0; - - while (guess_lo + 1 < guess_hi) { - /* there is a gap between guess_lo and guess_hi. */ - unsigned long range = 0; - if (!have_guess) { - int a, b; - /* - Try precious guess by a linear interpolation at first. - `a' and `b' is a coefficient of guess_lo and guess_hi as: - - guess = (guess_lo * a + guess_hi * b) / (a + b) - - However this causes overflow in most cases, following assignment - is used instead: - - guess = guess_lo / d * a + (guess_lo % d) * a / d - + guess_hi / d * b + (guess_hi % d) * b / d - where d = a + b - - To avoid overflow in this assignment, `d' is restricted to less than - sqrt(2**31). By this restriction and other reasons, the guess is - not accurate and some error is expected. `range' approximates - the maximum error. - - When these parameters are not suitable, i.e. guess is not within - guess_lo and guess_hi, simple guess by binary search is used. - */ - range = 366 * 24 * 60 * 60; - a = (tm_hi.tm_year - tptr->tm_year); - b = (tptr->tm_year - tm_lo.tm_year); - /* 46000 is selected as `some big number less than sqrt(2**31)'. */ - if (a + b <= 46000 / 12) { - range = 31 * 24 * 60 * 60; - a *= 12; - b *= 12; - a += tm_hi.tm_mon - tptr->tm_mon; - b += tptr->tm_mon - tm_lo.tm_mon; - if (a + b <= 46000 / 31) { - range = 24 * 60 * 60; - a *= 31; - b *= 31; - a += tm_hi.tm_mday - tptr->tm_mday; - b += tptr->tm_mday - tm_lo.tm_mday; - if (a + b <= 46000 / 24) { - range = 60 * 60; - a *= 24; - b *= 24; - a += tm_hi.tm_hour - tptr->tm_hour; - b += tptr->tm_hour - tm_lo.tm_hour; - if (a + b <= 46000 / 60) { - range = 60; - a *= 60; - b *= 60; - a += tm_hi.tm_min - tptr->tm_min; - b += tptr->tm_min - tm_lo.tm_min; - if (a + b <= 46000 / 60) { - range = 1; - a *= 60; - b *= 60; - a += tm_hi.tm_sec - tptr->tm_sec; - b += tptr->tm_sec - tm_lo.tm_sec; - } - } - } - } - } - if (a <= 0) a = 1; - if (b <= 0) b = 1; - d = a + b; - /* - Although `/' and `%' may produce unexpected result with negative - argument, it doesn't cause serious problem because there is a - fail safe. - */ - guess = guess_lo / d * a + (guess_lo % d) * a / d - + guess_hi / d * b + (guess_hi % d) * b / d; - have_guess = 1; - } - - if (guess <= guess_lo || guess_hi <= guess) { - /* Precious guess is invalid. try binary search. */ - guess = guess_lo / 2 + guess_hi / 2; - if (guess <= guess_lo) - guess = guess_lo + 1; - else if (guess >= guess_hi) - guess = guess_hi - 1; - range = 0; - } - - tm = (utc_p ? gmtime : localtime)(&guess); - if (!tm) goto error; - have_guess = 0; - - d = tmcmp(tptr, tm); - if (d < 0) { - guess_hi = guess; - tm_hi = *tm; - if (range) { - guess = guess - range; - range = 0; - if (guess_lo < guess && guess < guess_hi) - have_guess = 1; - } - } - else if (d > 0) { - guess_lo = guess; - tm_lo = *tm; - if (range) { - guess = guess + range; - range = 0; - if (guess_lo < guess && guess < guess_hi) - have_guess = 1; - } - } - else { - if (!utc_p) { - /* If localtime is nonmonotonic, another result may exist. */ - time_t guess2; - if (find_dst) { - guess2 = guess - 2 * 60 * 60; - tm = localtime(&guess2); - if (tm) { - if (tptr->tm_hour != (tm->tm_hour + 2) % 24 || - tptr->tm_min != tm->tm_min || - tptr->tm_sec != tm->tm_sec) { - guess2 -= (tm->tm_hour - tptr->tm_hour) * 60 * 60 + - (tm->tm_min - tptr->tm_min) * 60 + - (tm->tm_sec - tptr->tm_sec); - if (tptr->tm_mday != tm->tm_mday) - guess2 += 24 * 60 * 60; - if (guess != guess2) { - tm = localtime(&guess2); - if (tmcmp(tptr, tm) == 0) { - if (guess < guess2) - return guess; - else - return guess2; - } - } - } - } - } - else { - guess2 = guess + 2 * 60 * 60; - tm = localtime(&guess2); - if (tm) { - if ((tptr->tm_hour + 2) % 24 != tm->tm_hour || - tptr->tm_min != tm->tm_min || - tptr->tm_sec != tm->tm_sec) { - guess2 -= (tm->tm_hour - tptr->tm_hour) * 60 * 60 + - (tm->tm_min - tptr->tm_min) * 60 + - (tm->tm_sec - tptr->tm_sec); - if (tptr->tm_mday != tm->tm_mday) - guess2 -= 24 * 60 * 60; - if (guess != guess2) { - tm = localtime(&guess2); - if (tmcmp(tptr, tm) == 0) { - if (guess < guess2) - return guess2; - else - return guess; - } - } - } - } - } - } - return guess; - } - } - /* Given argument has no corresponding time_t. Let's outerpolation. */ - if (tm_lo.tm_year == tptr->tm_year && tm_lo.tm_mon == tptr->tm_mon) { - return guess_lo + - (tptr->tm_mday - tm_lo.tm_mday) * 24 * 60 * 60 + - (tptr->tm_hour - tm_lo.tm_hour) * 60 * 60 + - (tptr->tm_min - tm_lo.tm_min) * 60 + - (tptr->tm_sec - tm_lo.tm_sec); - } - else if (tm_hi.tm_year == tptr->tm_year && tm_hi.tm_mon == tptr->tm_mon) { - return guess_hi + - (tptr->tm_mday - tm_hi.tm_mday) * 24 * 60 * 60 + - (tptr->tm_hour - tm_hi.tm_hour) * 60 * 60 + - (tptr->tm_min - tm_hi.tm_min) * 60 + - (tptr->tm_sec - tm_hi.tm_sec); - } - - out_of_range: - rb_raise(rb_eArgError, "time out of range"); - - error: - rb_raise(rb_eArgError, "gmtime/localtime error"); - return 0; /* not reached */ -} - -static time_t -make_time_t(tptr, utc_p) - struct tm *tptr; - int utc_p; -{ - time_t t; - struct tm *tmp, buf; - buf = *tptr; - if (utc_p) { -#if defined(HAVE_TIMEGM) - if ((t = timegm(&buf)) != -1) - return t; -#ifdef NEGATIVE_TIME_T - if ((tmp = gmtime(&t)) && - tptr->tm_year == tmp->tm_year && - tptr->tm_mon == tmp->tm_mon && - tptr->tm_mday == tmp->tm_mday && - tptr->tm_hour == tmp->tm_hour && - tptr->tm_min == tmp->tm_min && - tptr->tm_sec == tmp->tm_sec) - return t; -#endif -#endif - return search_time_t(&buf, utc_p); - } - else { -#if defined(HAVE_MKTIME) - if ((t = mktime(&buf)) != -1) - return t; -#ifdef NEGATIVE_TIME_T - if ((tmp = localtime(&t)) && - tptr->tm_year == tmp->tm_year && - tptr->tm_mon == tmp->tm_mon && - tptr->tm_mday == tmp->tm_mday && - tptr->tm_hour == tmp->tm_hour && - tptr->tm_min == tmp->tm_min && - tptr->tm_sec == tmp->tm_sec) - return t; -#endif -#endif - return search_time_t(&buf, utc_p); - } -} - -static VALUE -time_utc_or_local(argc, argv, utc_p, klass) - int argc; - VALUE *argv; - int utc_p; - VALUE klass; -{ - struct tm tm; - VALUE time; - time_t usec; - - time_arg(argc, argv, &tm, &usec); - time = time_new_internal(klass, make_time_t(&tm, utc_p), usec); - if (utc_p) return time_gmtime(time); - return time_localtime(time); -} - -/* - * call-seq: - * Time.utc( year [, month, day, hour, min, sec, usec] ) => time - * Time.utc( sec, min, hour, day, month, year, wday, yday, isdst, tz - * ) => time - * Time.gm( year [, month, day, hour, min, sec, usec] ) => time - * Time.gm( sec, min, hour, day, month, year, wday, yday, isdst, tz - * ) => time - * - * Creates a time based on given values, interpreted as UTC (GMT). The - * year must be specified. Other values default to the minimum value - * for that field (and may be nil or omitted). Months may - * be specified by numbers from 1 to 12, or by the three-letter English - * month names. Hours are specified on a 24-hour clock (0..23). Raises - * an ArgumentError if any values are out of range. Will - * also accept ten arguments in the order output by - * Time#to_a. - * - * Time.utc(2000,"jan",1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000 - * Time.gm(2000,"jan",1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000 - */ -static VALUE -time_s_mkutc(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - return time_utc_or_local(argc, argv, Qtrue, klass); -} - -/* - * call-seq: - * Time.local( year [, month, day, hour, min, sec, usec] ) => time - * Time.local( sec, min, hour, day, month, year, wday, yday, isdst, - * tz ) => time - * Time.mktime( year, month, day, hour, min, sec, usec ) => time - * - * Same as Time::gm, but interprets the values in the - * local time zone. - * - * Time.local(2000,"jan",1,20,15,1) #=> Sat Jan 01 20:15:01 CST 2000 - */ - -static VALUE -time_s_mktime(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - return time_utc_or_local(argc, argv, Qfalse, klass); -} - -/* - * call-seq: - * time.to_i => int - * time.tv_sec => int - * - * Returns the value of time as an integer number of seconds - * since epoch. - * - * t = Time.now - * "%10.5f" % t.to_f #=> "1049896564.17839" - * t.to_i #=> 1049896564 - */ - -static VALUE -time_to_i(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - return LONG2NUM(tobj->tv.tv_sec); -} - -/* - * call-seq: - * time.to_f => float - * - * Returns the value of time as a floating point number of - * seconds since epoch. - * - * t = Time.now - * "%10.5f" % t.to_f #=> "1049896564.13654" - * t.to_i #=> 1049896564 - */ - -static VALUE -time_to_f(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - return rb_float_new((double)tobj->tv.tv_sec+(double)tobj->tv.tv_usec/1e6); -} - -/* - * call-seq: - * time.usec => int - * time.tv_usec => int - * - * Returns just the number of microseconds for time. - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * "%10.6f" % t.to_f #=> "1049896564.259970" - * t.usec #=> 259970 - */ - -static VALUE -time_usec(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - return LONG2NUM(tobj->tv.tv_usec); -} - -/* - * call-seq: - * time <=> other_time => -1, 0, +1 - * time <=> numeric => -1, 0, +1 - * - * Comparison---Compares time with other_time or with - * numeric, which is the number of seconds (possibly - * fractional) since epoch. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t2 = t + 2592000 #=> Fri May 09 08:56:03 CDT 2003 - * t <=> t2 #=> -1 - * t2 <=> t #=> 1 - * t <=> t #=> 0 - */ - -static VALUE -time_cmp(time1, time2) - VALUE time1, time2; -{ - struct time_object *tobj1, *tobj2; - - GetTimeval(time1, tobj1); - if (TYPE(time2) == T_DATA && RDATA(time2)->dfree == time_free) { - GetTimeval(time2, tobj2); - if (tobj1->tv.tv_sec == tobj2->tv.tv_sec) { - if (tobj1->tv.tv_usec == tobj2->tv.tv_usec) return INT2FIX(0); - if (tobj1->tv.tv_usec > tobj2->tv.tv_usec) return INT2FIX(1); - return INT2FIX(-1); - } - if (tobj1->tv.tv_sec > tobj2->tv.tv_sec) return INT2FIX(1); - return INT2FIX(-1); - } - - return Qnil; -} - -/* - * call-seq: - * time.eql?(other_time) - * - * Return true if time and other_time are - * both Time objects with the same seconds and fractional - * seconds. - */ - -static VALUE -time_eql(time1, time2) - VALUE time1, time2; -{ - struct time_object *tobj1, *tobj2; - - GetTimeval(time1, tobj1); - if (TYPE(time2) == T_DATA && RDATA(time2)->dfree == time_free) { - GetTimeval(time2, tobj2); - if (tobj1->tv.tv_sec == tobj2->tv.tv_sec) { - if (tobj1->tv.tv_usec == tobj2->tv.tv_usec) return Qtrue; - } - } - return Qfalse; -} - -/* - * call-seq: - * time.utc? => true or false - * time.gmt? => true or false - * - * Returns true if time represents a time in UTC - * (GMT). - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.utc? #=> false - * t = Time.gm(2000,"jan",1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000 - * t.utc? #=> true - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.gmt? #=> false - * t = Time.gm(2000,1,1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000 - * t.gmt? #=> true - */ - -static VALUE -time_utc_p(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->gmt) return Qtrue; - return Qfalse; -} - -/* - * call-seq: - * time.hash => fixnum - * - * Return a hash code for this time object. - */ - -static VALUE -time_hash(time) - VALUE time; -{ - struct time_object *tobj; - long hash; - - GetTimeval(time, tobj); - hash = tobj->tv.tv_sec ^ tobj->tv.tv_usec; - return LONG2FIX(hash); -} - -/* :nodoc: */ -static VALUE -time_init_copy(copy, time) - VALUE copy, time; -{ - struct time_object *tobj, *tcopy; - - if (copy == time) return copy; - time_modify(copy); - if (TYPE(time) != T_DATA || RDATA(time)->dfree != time_free) { - rb_raise(rb_eTypeError, "wrong argument type"); - } - GetTimeval(time, tobj); - GetTimeval(copy, tcopy); - MEMCPY(tcopy, tobj, struct time_object, 1); - - return copy; -} - -static VALUE -time_dup(time) - VALUE time; -{ - VALUE dup = time_s_alloc(CLASS_OF(time)); - time_init_copy(dup, time); - return dup; -} - -/* - * call-seq: - * time.localtime => time - * - * Converts time to local time (using the local time zone in - * effect for this process) modifying the receiver. - * - * t = Time.gm(2000, "jan", 1, 20, 15, 1) - * t.gmt? #=> true - * t.localtime #=> Sat Jan 01 14:15:01 CST 2000 - * t.gmt? #=> false - */ - -static VALUE -time_localtime(time) - VALUE time; -{ - struct time_object *tobj; - struct tm *tm_tmp; - time_t t; - - GetTimeval(time, tobj); - if (!tobj->gmt) { - if (tobj->tm_got) - return time; - } - else { - time_modify(time); - } - t = tobj->tv.tv_sec; - tm_tmp = localtime(&t); - if (!tm_tmp) - rb_raise(rb_eArgError, "localtime error"); - tobj->tm = *tm_tmp; - tobj->tm_got = 1; - tobj->gmt = 0; - return time; -} - -/* - * call-seq: - * time.gmtime => time - * time.utc => time - * - * Converts time to UTC (GMT), modifying the receiver. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.gmt? #=> false - * t.gmtime #=> Wed Apr 09 13:56:03 UTC 2003 - * t.gmt? #=> true - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.utc? #=> false - * t.utc #=> Wed Apr 09 13:56:04 UTC 2003 - * t.utc? #=> true - */ - -static VALUE -time_gmtime(time) - VALUE time; -{ - struct time_object *tobj; - struct tm *tm_tmp; - time_t t; - - GetTimeval(time, tobj); - if (tobj->gmt) { - if (tobj->tm_got) - return time; - } - else { - time_modify(time); - } - t = tobj->tv.tv_sec; - tm_tmp = gmtime(&t); - if (!tm_tmp) - rb_raise(rb_eArgError, "gmtime error"); - tobj->tm = *tm_tmp; - tobj->tm_got = 1; - tobj->gmt = 1; - return time; -} - -/* - * call-seq: - * time.getlocal => new_time - * - * Returns a new new_time object representing time in - * local time (using the local time zone in effect for this process). - * - * t = Time.gm(2000,1,1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000 - * t.gmt? #=> true - * l = t.getlocal #=> Sat Jan 01 14:15:01 CST 2000 - * l.gmt? #=> false - * t == l #=> true - */ - -static VALUE -time_getlocaltime(time) - VALUE time; -{ - return time_localtime(time_dup(time)); -} - -/* - * call-seq: - * time.getgm => new_time - * time.getutc => new_time - * - * Returns a new new_time object representing time in - * UTC. - * - * t = Time.local(2000,1,1,20,15,1) #=> Sat Jan 01 20:15:01 CST 2000 - * t.gmt? #=> false - * y = t.getgm #=> Sun Jan 02 02:15:01 UTC 2000 - * y.gmt? #=> true - * t == y #=> true - */ - -static VALUE -time_getgmtime(time) - VALUE time; -{ - return time_gmtime(time_dup(time)); -} - -static VALUE -time_get_tm(time, gmt) - VALUE time; - int gmt; -{ - if (gmt) return time_gmtime(time); - return time_localtime(time); -} - -/* - * call-seq: - * time.asctime => string - * time.ctime => string - * - * Returns a canonical string representation of time. - * - * Time.now.asctime #=> "Wed Apr 9 08:56:03 2003" - */ - -static VALUE -time_asctime(time) - VALUE time; -{ - struct time_object *tobj; - char *s; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - s = asctime(&tobj->tm); - if (s[24] == '\n') s[24] = '\0'; - - return rb_str_new2(s); -} - -/* - * call-seq: - * time.inspect => string - * time.to_s => string - * - * Returns a string representing time. Equivalent to calling - * Time#strftime with a format string of ``%a - * %b %d %H:%M:%S - * %Z %Y''. - * - * Time.now.to_s #=> "Wed Apr 09 08:56:04 CDT 2003" - */ - -static VALUE -time_to_s(time) - VALUE time; -{ - struct time_object *tobj; - char buf[128]; - int len; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - if (tobj->gmt == 1) { - len = strftime(buf, 128, "%a %b %d %H:%M:%S UTC %Y", &tobj->tm); - } - else { - time_t off; - char buf2[32]; - char sign = '+'; -#if defined(HAVE_STRUCT_TM_TM_GMTOFF) - off = tobj->tm.tm_gmtoff; -#else - VALUE tmp = time_utc_offset(time); - off = NUM2INT(tmp); -#endif - if (off < 0) { - sign = '-'; - off = -off; - } - sprintf(buf2, "%%a %%b %%d %%H:%%M:%%S %c%02d%02d %%Y", - sign, (int)(off/3600), (int)(off%3600/60)); - len = strftime(buf, 128, buf2, &tobj->tm); - } - return rb_str_new(buf, len); -} - -static VALUE -time_add(tobj, offset, sign) - struct time_object *tobj; - VALUE offset; - int sign; -{ - double v = NUM2DBL(offset); - double f, d; - unsigned_time_t sec_off; - time_t usec_off, sec, usec; - VALUE result; - - if (v < 0) { - v = -v; - sign = -sign; - } - d = modf(v, &f); - sec_off = (unsigned_time_t)f; - if (f != (double)sec_off) - rb_raise(rb_eRangeError, "time %s %f out of Time range", - sign < 0 ? "-" : "+", v); - usec_off = (time_t)(d*1e6+0.5); - - if (sign < 0) { - sec = tobj->tv.tv_sec - sec_off; - usec = tobj->tv.tv_usec - usec_off; - if (sec > tobj->tv.tv_sec) - rb_raise(rb_eRangeError, "time - %f out of Time range", v); - } - else { - sec = tobj->tv.tv_sec + sec_off; - usec = tobj->tv.tv_usec + usec_off; - if (sec < tobj->tv.tv_sec) - rb_raise(rb_eRangeError, "time + %f out of Time range", v); - } - result = rb_time_new(sec, usec); - if (tobj->gmt) { - GetTimeval(result, tobj); - tobj->gmt = 1; - } - return result; -} - -/* - * call-seq: - * time + numeric => time - * - * Addition---Adds some number of seconds (possibly fractional) to - * time and returns that value as a new time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t + (60 * 60 * 24) #=> Thu Apr 10 08:56:03 CDT 2003 - */ - -static VALUE -time_plus(time1, time2) - VALUE time1, time2; -{ - struct time_object *tobj; - GetTimeval(time1, tobj); - - if (TYPE(time2) == T_DATA && RDATA(time2)->dfree == time_free) { - rb_raise(rb_eTypeError, "time + time?"); - } - return time_add(tobj, time2, 1); -} - -/* - * call-seq: - * time - other_time => float - * time - numeric => time - * - * Difference---Returns a new time that represents the difference - * between two times, or subtracts the given number of seconds in - * numeric from time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t2 = t + 2592000 #=> Fri May 09 08:56:03 CDT 2003 - * t2 - t #=> 2592000.0 - * t2 - 2592000 #=> Wed Apr 09 08:56:03 CDT 2003 - */ - -static VALUE -time_minus(time1, time2) - VALUE time1, time2; -{ - struct time_object *tobj; - - GetTimeval(time1, tobj); - if (TYPE(time2) == T_DATA && RDATA(time2)->dfree == time_free) { - struct time_object *tobj2; - double f; - - GetTimeval(time2, tobj2); - f = (double)tobj->tv.tv_sec - (double)tobj2->tv.tv_sec; - f += ((double)tobj->tv.tv_usec - (double)tobj2->tv.tv_usec)*1e-6; - /* XXX: should check float overflow on 64bit time_t platforms */ - - return rb_float_new(f); - } - return time_add(tobj, time2, -1); -} - -/* - * call-seq: - * time.succ => new_time - * - * Return a new time object, one second later than time. - */ - -static VALUE -time_succ(time) - VALUE time; -{ - struct time_object *tobj; - int gmt; - - GetTimeval(time, tobj); - gmt = tobj->gmt; - time = rb_time_new(tobj->tv.tv_sec + 1, tobj->tv.tv_usec); - GetTimeval(time, tobj); - tobj->gmt = gmt; - return time; -} - -/* - * call-seq: - * time.sec => fixnum - * - * Returns the second of the minute (0..60)[Yes, seconds really can - * range from zero to 60. This allows the system to inject leap seconds - * every now and then to correct for the fact that years are not really - * a convenient number of hours long.] for time. - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.sec #=> 4 - */ - -static VALUE -time_sec(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - return INT2FIX(tobj->tm.tm_sec); -} - -/* - * call-seq: - * time.min => fixnum - * - * Returns the minute of the hour (0..59) for time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.min #=> 56 - */ - -static VALUE -time_min(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - return INT2FIX(tobj->tm.tm_min); -} - -/* - * call-seq: - * time.hour => fixnum - * - * Returns the hour of the day (0..23) for time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.hour #=> 8 - */ - -static VALUE -time_hour(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - return INT2FIX(tobj->tm.tm_hour); -} - -/* - * call-seq: - * time.day => fixnum - * time.mday => fixnum - * - * Returns the day of the month (1..n) for time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.day #=> 9 - * t.mday #=> 9 - */ - -static VALUE -time_mday(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - return INT2FIX(tobj->tm.tm_mday); -} - -/* - * call-seq: - * time.mon => fixnum - * time.month => fixnum - * - * Returns the month of the year (1..12) for time. - * - * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 - * t.mon #=> 4 - * t.month #=> 4 - */ - -static VALUE -time_mon(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - return INT2FIX(tobj->tm.tm_mon+1); -} - -/* - * call-seq: - * time.year => fixnum - * - * Returns the year for time (including the century). - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.year #=> 2003 - */ - -static VALUE -time_year(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - return LONG2NUM((long)tobj->tm.tm_year+1900); -} - -/* - * call-seq: - * time.wday => fixnum - * - * Returns an integer representing the day of the week, 0..6, with - * Sunday == 0. - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.wday #=> 3 - */ - -static VALUE -time_wday(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - return INT2FIX(tobj->tm.tm_wday); -} - -/* - * call-seq: - * time.yday => fixnum - * - * Returns an integer representing the day of the year, 1..366. - * - * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t.yday #=> 99 - */ - -static VALUE -time_yday(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - return INT2FIX(tobj->tm.tm_yday+1); -} - -/* - * call-seq: - * time.isdst => true or false - * time.dst? => true or false - * - * Returns true if time occurs during Daylight - * Saving Time in its time zone. - * - * Time.local(2000, 7, 1).isdst #=> true - * Time.local(2000, 1, 1).isdst #=> false - * Time.local(2000, 7, 1).dst? #=> true - * Time.local(2000, 1, 1).dst? #=> false - */ - -static VALUE -time_isdst(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - return tobj->tm.tm_isdst?Qtrue:Qfalse; -} - -/* - * call-seq: - * time.zone => string - * - * Returns the name of the time zone used for time. As of Ruby - * 1.8, returns ``UTC'' rather than ``GMT'' for UTC times. - * - * t = Time.gm(2000, "jan", 1, 20, 15, 1) - * t.zone #=> "UTC" - * t = Time.local(2000, "jan", 1, 20, 15, 1) - * t.zone #=> "CST" - */ - -static VALUE -time_zone(time) - VALUE time; -{ - struct time_object *tobj; -#if !defined(HAVE_TM_ZONE) && (!defined(HAVE_TZNAME) || !defined(HAVE_DAYLIGHT)) - char buf[64]; - int len; -#endif - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - - if (tobj->gmt == 1) { - return rb_str_new2("UTC"); - } -#if defined(HAVE_TM_ZONE) - return rb_str_new2(tobj->tm.tm_zone); -#elif defined(HAVE_TZNAME) && defined(HAVE_DAYLIGHT) - return rb_str_new2(tzname[daylight && tobj->tm.tm_isdst]); -#else - len = strftime(buf, 64, "%Z", &tobj->tm); - return rb_str_new(buf, len); -#endif -} - -/* - * call-seq: - * time.gmt_offset => fixnum - * time.gmtoff => fixnum - * time.utc_offset => fixnum - * - * Returns the offset in seconds between the timezone of time - * and UTC. - * - * t = Time.gm(2000,1,1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000 - * t.gmt_offset #=> 0 - * l = t.getlocal #=> Sat Jan 01 14:15:01 CST 2000 - * l.gmt_offset #=> -21600 - */ - -static VALUE -time_utc_offset(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - - if (tobj->gmt == 1) { - return INT2FIX(0); - } - else { -#if defined(HAVE_STRUCT_TM_TM_GMTOFF) - return INT2NUM(tobj->tm.tm_gmtoff); -#else - struct tm *u, *l; - time_t t; - long off; - l = &tobj->tm; - t = tobj->tv.tv_sec; - u = gmtime(&t); - if (!u) - rb_raise(rb_eArgError, "gmtime error"); - if (l->tm_year != u->tm_year) - off = l->tm_year < u->tm_year ? -1 : 1; - else if (l->tm_mon != u->tm_mon) - off = l->tm_mon < u->tm_mon ? -1 : 1; - else if (l->tm_mday != u->tm_mday) - off = l->tm_mday < u->tm_mday ? -1 : 1; - else - off = 0; - off = off * 24 + l->tm_hour - u->tm_hour; - off = off * 60 + l->tm_min - u->tm_min; - off = off * 60 + l->tm_sec - u->tm_sec; - return LONG2FIX(off); -#endif - } -} - -/* - * call-seq: - * time.to_a => array - * - * Returns a ten-element array of values for time: - * {[ sec, min, hour, day, month, year, wday, yday, isdst, zone - * ]}. See the individual methods for an explanation of the - * valid ranges of each value. The ten elements can be passed directly - * to Time::utc or Time::local to create a - * new Time. - * - * now = Time.now #=> Wed Apr 09 08:56:04 CDT 2003 - * t = now.to_a #=> [4, 56, 8, 9, 4, 2003, 3, 99, true, "CDT"] - */ - -static VALUE -time_to_a(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - return rb_ary_new3(10, - INT2FIX(tobj->tm.tm_sec), - INT2FIX(tobj->tm.tm_min), - INT2FIX(tobj->tm.tm_hour), - INT2FIX(tobj->tm.tm_mday), - INT2FIX(tobj->tm.tm_mon+1), - LONG2NUM((long)tobj->tm.tm_year+1900), - INT2FIX(tobj->tm.tm_wday), - INT2FIX(tobj->tm.tm_yday+1), - tobj->tm.tm_isdst?Qtrue:Qfalse, - time_zone(time)); -} - -#define SMALLBUF 100 -static int -rb_strftime(buf, format, time) - char **buf; - const char *format; - struct tm *time; -{ - int size, len, flen; - - (*buf)[0] = '\0'; - flen = strlen(format); - if (flen == 0) { - return 0; - } - errno = 0; - len = strftime(*buf, SMALLBUF, format, time); - if (len != 0 || (**buf == '\0' && errno != ERANGE)) return len; - for (size=1024; ; size*=2) { - *buf = xmalloc(size); - (*buf)[0] = '\0'; - len = strftime(*buf, size, format, time); - /* - * buflen can be zero EITHER because there's not enough - * room in the string, or because the control command - * goes to the empty string. Make a reasonable guess that - * if the buffer is 1024 times bigger than the length of the - * format string, it's not failing for lack of room. - */ - if (len > 0 || size >= 1024 * flen) return len; - free(*buf); - } - /* not reached */ -} - -/* - * call-seq: - * time.strftime( string ) => string - * - * Formats time according to the directives in the given format - * string. Any text not listed as a directive will be passed through - * to the output string. - * - * Format meaning: - * %a - The abbreviated weekday name (``Sun'') - * %A - The full weekday name (``Sunday'') - * %b - The abbreviated month name (``Jan'') - * %B - The full month name (``January'') - * %c - The preferred local date and time representation - * %d - Day of the month (01..31) - * %H - Hour of the day, 24-hour clock (00..23) - * %I - Hour of the day, 12-hour clock (01..12) - * %j - Day of the year (001..366) - * %m - Month of the year (01..12) - * %M - Minute of the hour (00..59) - * %p - Meridian indicator (``AM'' or ``PM'') - * %S - Second of the minute (00..60) - * %U - Week number of the current year, - * starting with the first Sunday as the first - * day of the first week (00..53) - * %W - Week number of the current year, - * starting with the first Monday as the first - * day of the first week (00..53) - * %w - Day of the week (Sunday is 0, 0..6) - * %x - Preferred representation for the date alone, no time - * %X - Preferred representation for the time alone, no date - * %y - Year without a century (00..99) - * %Y - Year with century - * %Z - Time zone name - * %% - Literal ``%'' character - * - * t = Time.now - * t.strftime("Printed on %m/%d/%Y") #=> "Printed on 04/09/2003" - * t.strftime("at %I:%M%p") #=> "at 08:56AM" - */ - -static VALUE -time_strftime(time, format) - VALUE time, format; -{ - struct time_object *tobj; - char buffer[SMALLBUF], *buf = buffer; - const char *fmt; - long len; - VALUE str; - - GetTimeval(time, tobj); - if (tobj->tm_got == 0) { - time_get_tm(time, tobj->gmt); - } - StringValue(format); - format = rb_str_new4(format); - fmt = RSTRING(format)->ptr; - len = RSTRING(format)->len; - if (len == 0) { - rb_warning("strftime called with empty format string"); - } - else if (strlen(fmt) < len) { - /* Ruby string may contain \0's. */ - const char *p = fmt, *pe = fmt + len; - - str = rb_str_new(0, 0); - while (p < pe) { - len = rb_strftime(&buf, p, &tobj->tm); - rb_str_cat(str, buf, len); - p += strlen(p); - if (buf != buffer) { - free(buf); - buf = buffer; - } - for (fmt = p; p < pe && !*p; ++p); - if (p > fmt) rb_str_cat(str, fmt, p - fmt); - } - return str; - } - else { - len = rb_strftime(&buf, RSTRING(format)->ptr, &tobj->tm); - } - str = rb_str_new(buf, len); - if (buf != buffer) free(buf); - return str; -} - -/* - * call-seq: - * Time.times => struct_tms - * - * Deprecated in favor of Process::times - */ - -static VALUE -time_s_times(obj) - VALUE obj; -{ - rb_warn("obsolete method Time::times; use Process::times"); - return rb_proc_times(obj); -} - -/* - * undocumented - */ - -static VALUE -time_mdump(time) - VALUE time; -{ - struct time_object *tobj; - struct tm *tm; - unsigned long p, s; - char buf[8]; - time_t t; - int i; - - GetTimeval(time, tobj); - - t = tobj->tv.tv_sec; - tm = gmtime(&t); - - if ((tm->tm_year & 0xffff) != tm->tm_year) - rb_raise(rb_eArgError, "year too big to marshal"); - - p = 0x1UL << 31 | /* 1 */ - tobj->gmt << 30 | /* 1 */ - tm->tm_year << 14 | /* 16 */ - tm->tm_mon << 10 | /* 4 */ - tm->tm_mday << 5 | /* 5 */ - tm->tm_hour; /* 5 */ - s = tm->tm_min << 26 | /* 6 */ - tm->tm_sec << 20 | /* 6 */ - tobj->tv.tv_usec; /* 20 */ - - for (i=0; i<4; i++) { - buf[i] = p & 0xff; - p = RSHIFT(p, 8); - } - for (i=4; i<8; i++) { - buf[i] = s & 0xff; - s = RSHIFT(s, 8); - } - - return rb_str_new(buf, 8); -} - -/* - * call-seq: - * time._dump => string - * - * Dump _time_ for marshaling. - */ - -static VALUE -time_dump(argc, argv, time) - int argc; - VALUE *argv; - VALUE time; -{ - VALUE str; - - rb_scan_args(argc, argv, "01", 0); - str = time_mdump(time); - if (FL_TEST(time, FL_EXIVAR)) { - rb_copy_generic_ivar(str, time); - FL_SET(str, FL_EXIVAR); - } - - return str; -} - -/* - * undocumented - */ - -static VALUE -time_mload(time, str) - VALUE time, str; -{ - struct time_object *tobj; - unsigned long p, s; - time_t sec, usec; - unsigned char *buf; - struct tm tm; - int i, gmt; - - time_modify(time); - StringValue(str); - buf = (unsigned char *)RSTRING(str)->ptr; - if (RSTRING(str)->len != 8) { - rb_raise(rb_eTypeError, "marshaled time format differ"); - } - - p = s = 0; - for (i=0; i<4; i++) { - p |= buf[i]<<(8*i); - } - for (i=4; i<8; i++) { - s |= buf[i]<<(8*(i-4)); - } - - if ((p & (1UL<<31)) == 0) { - sec = p; - usec = s; - } - else { - p &= ~(1UL<<31); - gmt = (p >> 30) & 0x1; - tm.tm_year = (p >> 14) & 0xffff; - tm.tm_mon = (p >> 10) & 0xf; - tm.tm_mday = (p >> 5) & 0x1f; - tm.tm_hour = p & 0x1f; - tm.tm_min = (s >> 26) & 0x3f; - tm.tm_sec = (s >> 20) & 0x3f; - tm.tm_isdst = 0; - - sec = make_time_t(&tm, Qtrue); - usec = (time_t)(s & 0xfffff); - } - time_overflow_p(&sec, &usec); - - GetTimeval(time, tobj); - tobj->tm_got = 0; - tobj->gmt = gmt; - tobj->tv.tv_sec = sec; - tobj->tv.tv_usec = usec; - return time; -} - -/* - * call-seq: - * Time._load(string) => time - * - * Unmarshal a dumped +Time+ object. - */ - -static VALUE -time_load(klass, str) - VALUE klass, str; -{ - VALUE time = time_s_alloc(klass); - - if (FL_TEST(str, FL_EXIVAR)) { - rb_copy_generic_ivar(time, str); - FL_SET(time, FL_EXIVAR); - } - time_mload(time, str); - return time; -} - -/* - * Time is an abstraction of dates and times. Time is - * stored internally as the number of seconds and microseconds since - * the epoch, January 1, 1970 00:00 UTC. On some operating - * systems, this offset is allowed to be negative. Also see the - * library modules Date and ParseDate. The - * Time class treats GMT (Greenwich Mean Time) and UTC - * (Coordinated Universal Time)[Yes, UTC really does stand for - * Coordinated Universal Time. There was a committee involved.] - * as equivalent. GMT is the older way of referring to these - * baseline times but persists in the names of calls on Posix - * systems. - * - * All times are stored with some number of microseconds. Be aware of - * this fact when comparing times with each other---times that are - * apparently equal when displayed may be different when compared. - */ - -void -Init_Time() -{ - rb_cTime = rb_define_class("Time", rb_cObject); - rb_include_module(rb_cTime, rb_mComparable); - - rb_define_alloc_func(rb_cTime, time_s_alloc); - rb_define_singleton_method(rb_cTime, "now", rb_class_new_instance, -1); - rb_define_singleton_method(rb_cTime, "at", time_s_at, -1); - rb_define_singleton_method(rb_cTime, "utc", time_s_mkutc, -1); - rb_define_singleton_method(rb_cTime, "gm", time_s_mkutc, -1); - rb_define_singleton_method(rb_cTime, "local", time_s_mktime, -1); - rb_define_singleton_method(rb_cTime, "mktime", time_s_mktime, -1); - - rb_define_singleton_method(rb_cTime, "times", time_s_times, 0); - - rb_define_method(rb_cTime, "to_i", time_to_i, 0); - rb_define_method(rb_cTime, "to_f", time_to_f, 0); - rb_define_method(rb_cTime, "<=>", time_cmp, 1); - rb_define_method(rb_cTime, "eql?", time_eql, 1); - rb_define_method(rb_cTime, "hash", time_hash, 0); - rb_define_method(rb_cTime, "initialize", time_init, 0); - rb_define_method(rb_cTime, "initialize_copy", time_init_copy, 1); - - rb_define_method(rb_cTime, "localtime", time_localtime, 0); - rb_define_method(rb_cTime, "gmtime", time_gmtime, 0); - rb_define_method(rb_cTime, "utc", time_gmtime, 0); - rb_define_method(rb_cTime, "getlocal", time_getlocaltime, 0); - rb_define_method(rb_cTime, "getgm", time_getgmtime, 0); - rb_define_method(rb_cTime, "getutc", time_getgmtime, 0); - - rb_define_method(rb_cTime, "ctime", time_asctime, 0); - rb_define_method(rb_cTime, "asctime", time_asctime, 0); - rb_define_method(rb_cTime, "to_s", time_to_s, 0); - rb_define_method(rb_cTime, "inspect", time_to_s, 0); - rb_define_method(rb_cTime, "to_a", time_to_a, 0); - - rb_define_method(rb_cTime, "+", time_plus, 1); - rb_define_method(rb_cTime, "-", time_minus, 1); - - rb_define_method(rb_cTime, "succ", time_succ, 0); - rb_define_method(rb_cTime, "sec", time_sec, 0); - rb_define_method(rb_cTime, "min", time_min, 0); - rb_define_method(rb_cTime, "hour", time_hour, 0); - rb_define_method(rb_cTime, "mday", time_mday, 0); - rb_define_method(rb_cTime, "day", time_mday, 0); - rb_define_method(rb_cTime, "mon", time_mon, 0); - rb_define_method(rb_cTime, "month", time_mon, 0); - rb_define_method(rb_cTime, "year", time_year, 0); - rb_define_method(rb_cTime, "wday", time_wday, 0); - rb_define_method(rb_cTime, "yday", time_yday, 0); - rb_define_method(rb_cTime, "isdst", time_isdst, 0); - rb_define_method(rb_cTime, "dst?", time_isdst, 0); - rb_define_method(rb_cTime, "zone", time_zone, 0); - rb_define_method(rb_cTime, "gmtoff", time_utc_offset, 0); - rb_define_method(rb_cTime, "gmt_offset", time_utc_offset, 0); - rb_define_method(rb_cTime, "utc_offset", time_utc_offset, 0); - - rb_define_method(rb_cTime, "utc?", time_utc_p, 0); - rb_define_method(rb_cTime, "gmt?", time_utc_p, 0); - - rb_define_method(rb_cTime, "tv_sec", time_to_i, 0); - rb_define_method(rb_cTime, "tv_usec", time_usec, 0); - rb_define_method(rb_cTime, "usec", time_usec, 0); - - rb_define_method(rb_cTime, "strftime", time_strftime, 1); - - /* methods for marshaling */ - rb_define_method(rb_cTime, "_dump", time_dump, -1); - rb_define_singleton_method(rb_cTime, "_load", time_load, 1); -#if 0 - /* Time will support marshal_dump and marshal_load in the future (1.9 maybe) */ - rb_define_method(rb_cTime, "marshal_dump", time_mdump, 0); - rb_define_method(rb_cTime, "marshal_load", time_mload, 1); -#endif -} -/********************************************************************** - - util.c - - - $Author: wyhaines $ - $Date: 2009-08-19 15:53:23 +0200 (Wed, 19 Aug 2009) $ - created at: Fri Mar 10 17:22:34 JST 1995 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" - -#include -#include -#include -#include -#include - -#ifdef _WIN32 -#include "missing/file.h" -#endif - -#include "util.h" -#ifndef HAVE_STRING_H -char *strchr _((char*,char)); -#endif - -unsigned long -scan_oct(start, len, retlen) - const char *start; - int len; - int *retlen; -{ - register const char *s = start; - register unsigned long retval = 0; - - while (len-- && *s >= '0' && *s <= '7') { - retval <<= 3; - retval |= *s++ - '0'; - } - *retlen = s - start; - return retval; -} - -unsigned long -scan_hex(start, len, retlen) - const char *start; - int len; - int *retlen; -{ - static char hexdigit[] = "0123456789abcdef0123456789ABCDEF"; - register const char *s = start; - register unsigned long retval = 0; - char *tmp; - - while (len-- && *s && (tmp = strchr(hexdigit, *s))) { - retval <<= 4; - retval |= (tmp - hexdigit) & 15; - s++; - } - *retlen = s - start; - return retval; -} - -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#if defined(HAVE_FCNTL_H) -#include -#endif - -#ifndef S_ISDIR -# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR) -#endif - -#if defined(MSDOS) || defined(__CYGWIN32__) || defined(_WIN32) -/* - * Copyright (c) 1993, Intergraph Corporation - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the perl README file. - * - * Various Unix compatibility functions and NT specific functions. - * - * Some of this code was derived from the MSDOS port(s) and the OS/2 port. - * - */ - - -/* - * Suffix appending for in-place editing under MS-DOS and OS/2 (and now NT!). - * - * Here are the rules: - * - * Style 0: Append the suffix exactly as standard perl would do it. - * If the filesystem groks it, use it. (HPFS will always - * grok it. So will NTFS. FAT will rarely accept it.) - * - * Style 1: The suffix begins with a '.'. The extension is replaced. - * If the name matches the original name, use the fallback method. - * - * Style 2: The suffix is a single character, not a '.'. Try to add the - * suffix to the following places, using the first one that works. - * [1] Append to extension. - * [2] Append to filename, - * [3] Replace end of extension, - * [4] Replace end of filename. - * If the name matches the original name, use the fallback method. - * - * Style 3: Any other case: Ignore the suffix completely and use the - * fallback method. - * - * Fallback method: Change the extension to ".$$$". If that matches the - * original name, then change the extension to ".~~~". - * - * If filename is more than 1000 characters long, we die a horrible - * death. Sorry. - * - * The filename restriction is a cheat so that we can use buf[] to store - * assorted temporary goo. - * - * Examples, assuming style 0 failed. - * - * suffix = ".bak" (style 1) - * foo.bar => foo.bak - * foo.bak => foo.$$$ (fallback) - * foo.$$$ => foo.~~~ (fallback) - * makefile => makefile.bak - * - * suffix = "~" (style 2) - * foo.c => foo.c~ - * foo.c~ => foo.c~~ - * foo.c~~ => foo~.c~~ - * foo~.c~~ => foo~~.c~~ - * foo~~~~~.c~~ => foo~~~~~.$$$ (fallback) - * - * foo.pas => foo~.pas - * makefile => makefile.~ - * longname.fil => longname.fi~ - * longname.fi~ => longnam~.fi~ - * longnam~.fi~ => longnam~.$$$ - * - */ - - -static int valid_filename(char *s); - -static char suffix1[] = ".$$$"; -static char suffix2[] = ".~~~"; - -#define ext (&buf[1000]) - -#define strEQ(s1,s2) (strcmp(s1,s2) == 0) - -void -ruby_add_suffix(str, suffix) - VALUE str; - char *suffix; -{ - int baselen; - int extlen = strlen(suffix); - char *s, *t, *p; - long slen; - char buf[1024]; - - if (RSTRING(str)->len > 1000) - rb_fatal("Cannot do inplace edit on long filename (%ld characters)", - RSTRING(str)->len); - -#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32) - /* Style 0 */ - slen = RSTRING(str)->len; - rb_str_cat(str, suffix, extlen); -#if defined(DJGPP) - if (_USE_LFN) return; -#else - if (valid_filename(RSTRING(str)->ptr)) return; -#endif - - /* Fooey, style 0 failed. Fix str before continuing. */ - RSTRING(str)->ptr[RSTRING(str)->len = slen] = '\0'; -#endif - - slen = extlen; - t = buf; baselen = 0; s = RSTRING(str)->ptr; - while ((*t = *s) && *s != '.') { - baselen++; - if (*s == '\\' || *s == '/') baselen = 0; - s++; t++; - } - p = t; - - t = ext; extlen = 0; - while (*t++ = *s++) extlen++; - if (extlen == 0) { ext[0] = '.'; ext[1] = 0; extlen++; } - - if (*suffix == '.') { /* Style 1 */ - if (strEQ(ext, suffix)) goto fallback; - strcpy(p, suffix); - } - else if (suffix[1] == '\0') { /* Style 2 */ - if (extlen < 4) { - ext[extlen] = *suffix; - ext[++extlen] = '\0'; - } - else if (baselen < 8) { - *p++ = *suffix; - } - else if (ext[3] != *suffix) { - ext[3] = *suffix; - } - else if (buf[7] != *suffix) { - buf[7] = *suffix; - } - else goto fallback; - strcpy(p, ext); - } - else { /* Style 3: Panic */ -fallback: - (void)memcpy(p, strEQ(ext, suffix1) ? suffix2 : suffix1, 5); - } - rb_str_resize(str, strlen(buf)); - memcpy(RSTRING(str)->ptr, buf, RSTRING(str)->len); -} - -#if defined(__CYGWIN32__) || defined(_WIN32) -static int -valid_filename(char *s) -{ - int fd; - - /* - // if the file exists, then it's a valid filename! - */ - - if (_access(s, 0) == 0) { - return 1; - } - - /* - // It doesn't exist, so see if we can open it. - */ - - if ((fd = _open(s, O_CREAT, 0666)) >= 0) { - _close(fd); - _unlink(s); /* don't leave it laying around */ - return 1; - } - return 0; -} -#endif -#endif - -#if defined __DJGPP__ - -#include - -static char dbcs_table[256]; - -int -make_dbcs_table() -{ - __dpmi_regs r; - struct { - unsigned char start; - unsigned char end; - } vec; - int offset; - - memset(&r, 0, sizeof(r)); - r.x.ax = 0x6300; - __dpmi_int(0x21, &r); - offset = r.x.ds * 16 + r.x.si; - - for (;;) { - int i; - dosmemget(offset, sizeof vec, &vec); - if (!vec.start && !vec.end) - break; - for (i = vec.start; i <= vec.end; i++) - dbcs_table[i] = 1; - offset += 2; - } -} - -int -mblen(const char *s, size_t n) -{ - static int need_init = 1; - if (need_init) { - make_dbcs_table(); - need_init = 0; - } - if (s) { - if (n == 0 || *s == 0) - return 0; - else if (!s[1]) - return 1; - return dbcs_table[(unsigned char)*s] + 1; - } - else - return 1; -} - -struct PathList { - struct PathList *next; - char *path; -}; - -struct PathInfo { - struct PathList *head; - int count; -}; - -static int -push_element(const char *path, VALUE vinfo) -{ - struct PathList *p; - struct PathInfo *info = (struct PathInfo *)vinfo; - - p = ALLOC(struct PathList); - MEMZERO(p, struct PathList, 1); - p->path = ruby_strdup(path); - p->next = info->head; - info->head = p; - info->count++; - - return 0; -} - -#include -int __opendir_flags = __OPENDIR_PRESERVE_CASE; - -char ** -__crt0_glob_function(char *path) -{ - int len = strlen(path); - int i; - char **rv; - char path_buffer[PATH_MAX]; - char *buf = path_buffer; - char *p; - struct PathInfo info; - struct PathList *plist; - - if (PATH_MAX <= len) - buf = ruby_xmalloc(len + 1); - - strncpy(buf, path, len); - buf[len] = '\0'; - - for (p = buf; *p; p += mblen(p, MB_CUR_MAX)) - if (*p == '\\') - *p = '/'; - - info.count = 0; - info.head = 0; - - ruby_glob(buf, 0, push_element, (VALUE)&info); - - if (buf != path_buffer) - ruby_xfree(buf); - - if (info.count == 0) - return 0; - - rv = ruby_xmalloc((info.count + 1) * sizeof (char *)); - - plist = info.head; - i = 0; - while (plist) { - struct PathList *cur; - rv[i] = plist->path; - cur = plist; - plist = plist->next; - ruby_xfree(cur); - i++; - } - rv[i] = 0; - return rv; -} - -#endif - -/* mm.c */ - -#define A ((int*)a) -#define B ((int*)b) -#define C ((int*)c) -#define D ((int*)d) - -#define mmprepare(base, size) do {\ - if (((long)base & (0x3)) == 0)\ - if (size >= 16) mmkind = 1;\ - else mmkind = 0;\ - else mmkind = -1;\ - high = (size & (~0xf));\ - low = (size & 0x0c);\ -} while (0)\ - -#define mmarg mmkind, size, high, low - -static void mmswap_(a, b, mmarg) - register char *a, *b; - int mmarg; -{ - register int s; - if (a == b) return; - if (mmkind >= 0) { - if (mmkind > 0) { - register char *t = a + high; - do { - s = A[0]; A[0] = B[0]; B[0] = s; - s = A[1]; A[1] = B[1]; B[1] = s; - s = A[2]; A[2] = B[2]; B[2] = s; - s = A[3]; A[3] = B[3]; B[3] = s; a += 16; b += 16; - } while (a < t); - } - if (low != 0) { s = A[0]; A[0] = B[0]; B[0] = s; - if (low >= 8) { s = A[1]; A[1] = B[1]; B[1] = s; - if (low == 12) {s = A[2]; A[2] = B[2]; B[2] = s;}}} - } - else { - register char *t = a + size; - do {s = *a; *a++ = *b; *b++ = s;} while (a < t); - } -} -#define mmswap(a,b) mmswap_((a),(b),mmarg) - -static void mmrot3_(a, b, c, mmarg) - register char *a, *b, *c; - int mmarg; -{ - register int s; - if (mmkind >= 0) { - if (mmkind > 0) { - register char *t = a + high; - do { - s = A[0]; A[0] = B[0]; B[0] = C[0]; C[0] = s; - s = A[1]; A[1] = B[1]; B[1] = C[1]; C[1] = s; - s = A[2]; A[2] = B[2]; B[2] = C[2]; C[2] = s; - s = A[3]; A[3] = B[3]; B[3] = C[3]; C[3] = s; a += 16; b += 16; c += 16; - } while (a < t); - } - if (low != 0) { s = A[0]; A[0] = B[0]; B[0] = C[0]; C[0] = s; - if (low >= 8) { s = A[1]; A[1] = B[1]; B[1] = C[1]; C[1] = s; - if (low == 12) {s = A[2]; A[2] = B[2]; B[2] = C[2]; C[2] = s;}}} - } - else { - register char *t = a + size; - do {s = *a; *a++ = *b; *b++ = *c; *c++ = s;} while (a < t); - } -} -#define mmrot3(a,b,c) mmrot3_((a),(b),(c),mmarg) - -/* qs6.c */ -/*****************************************************/ -/* */ -/* qs6 (Quick sort function) */ -/* */ -/* by Tomoyuki Kawamura 1995.4.21 */ -/* kawamura@tokuyama.ac.jp */ -/*****************************************************/ - -typedef struct { char *LL, *RR; } stack_node; /* Stack structure for L,l,R,r */ -#define PUSH(ll,rr) do { top->LL = (ll); top->RR = (rr); ++top; } while (0) /* Push L,l,R,r */ -#define POP(ll,rr) do { --top; ll = top->LL; rr = top->RR; } while (0) /* Pop L,l,R,r */ - -#define med3(a,b,c) ((*cmp)(a,b,d)<0 ? \ - ((*cmp)(b,c,d)<0 ? b : ((*cmp)(a,c,d)<0 ? c : a)) : \ - ((*cmp)(b,c,d)>0 ? b : ((*cmp)(a,c,d)<0 ? a : c))) - -void ruby_qsort (base, nel, size, cmp, d) - void* base; - const int nel; - const int size; - int (*cmp)(); - void *d; -{ - register char *l, *r, *m; /* l,r:left,right group m:median point */ - register int t, eq_l, eq_r; /* eq_l: all items in left group are equal to S */ - char *L = base; /* left end of curren region */ - char *R = (char*)base + size*(nel-1); /* right end of current region */ - int chklim = 63; /* threshold of ordering element check */ - stack_node stack[32], *top = stack; /* 32 is enough for 32bit CPU */ - int mmkind, high, low; - - if (nel <= 1) return; /* need not to sort */ - mmprepare(base, size); - goto start; - - nxt: - if (stack == top) return; /* return if stack is empty */ - POP(L,R); - - for (;;) { - start: - if (L + size == R) { /* 2 elements */ - if ((*cmp)(L,R,d) > 0) mmswap(L,R); goto nxt; - } - - l = L; r = R; - t = (r - l + size) / size; /* number of elements */ - m = l + size * (t >> 1); /* calculate median value */ - - if (t >= 60) { - register char *m1; - register char *m3; - if (t >= 200) { - t = size*(t>>3); /* number of bytes in splitting 8 */ - { - register char *p1 = l + t; - register char *p2 = p1 + t; - register char *p3 = p2 + t; - m1 = med3(p1, p2, p3); - p1 = m + t; - p2 = p1 + t; - p3 = p2 + t; - m3 = med3(p1, p2, p3); - } - } - else { - t = size*(t>>2); /* number of bytes in splitting 4 */ - m1 = l + t; - m3 = m + t; - } - m = med3(m1, m, m3); - } - - if ((t = (*cmp)(l,m,d)) < 0) { /*3-5-?*/ - if ((t = (*cmp)(m,r,d)) < 0) { /*3-5-7*/ - if (chklim && nel >= chklim) { /* check if already ascending order */ - char *p; - chklim = 0; - for (p=l; p 0) goto fail; - goto nxt; - } - fail: goto loopA; /*3-5-7*/ - } - if (t > 0) { - if ((*cmp)(l,r,d) <= 0) {mmswap(m,r); goto loopA;} /*3-5-4*/ - mmrot3(r,m,l); goto loopA; /*3-5-2*/ - } - goto loopB; /*3-5-5*/ - } - - if (t > 0) { /*7-5-?*/ - if ((t = (*cmp)(m,r,d)) > 0) { /*7-5-3*/ - if (chklim && nel >= chklim) { /* check if already ascending order */ - char *p; - chklim = 0; - for (p=l; p 0) {mmswap(l,r); goto loopB;} /*5-5-3*/ - - /* determining splitting type in case 5-5-5 */ /*5-5-5*/ - for (;;) { - if ((l += size) == r) goto nxt; /*5-5-5*/ - if (l == m) continue; - if ((t = (*cmp)(l,m,d)) > 0) {mmswap(l,r); l = L; goto loopA;}/*575-5*/ - if (t < 0) {mmswap(L,l); l = L; goto loopB;} /*535-5*/ - } - - loopA: eq_l = 1; eq_r = 1; /* splitting type A */ /* left <= median < right */ - for (;;) { - for (;;) { - if ((l += size) == r) - {l -= size; if (l != m) mmswap(m,l); l -= size; goto fin;} - if (l == m) continue; - if ((t = (*cmp)(l,m,d)) > 0) {eq_r = 0; break;} - if (t < 0) eq_l = 0; - } - for (;;) { - if (l == (r -= size)) - {l -= size; if (l != m) mmswap(m,l); l -= size; goto fin;} - if (r == m) {m = l; break;} - if ((t = (*cmp)(r,m,d)) < 0) {eq_l = 0; break;} - if (t == 0) break; - } - mmswap(l,r); /* swap left and right */ - } - - loopB: eq_l = 1; eq_r = 1; /* splitting type B */ /* left < median <= right */ - for (;;) { - for (;;) { - if (l == (r -= size)) - {r += size; if (r != m) mmswap(r,m); r += size; goto fin;} - if (r == m) continue; - if ((t = (*cmp)(r,m,d)) < 0) {eq_l = 0; break;} - if (t > 0) eq_r = 0; - } - for (;;) { - if ((l += size) == r) - {r += size; if (r != m) mmswap(r,m); r += size; goto fin;} - if (l == m) {m = r; break;} - if ((t = (*cmp)(l,m,d)) > 0) {eq_r = 0; break;} - if (t == 0) break; - } - mmswap(l,r); /* swap left and right */ - } - - fin: - if (eq_l == 0) /* need to sort left side */ - if (eq_r == 0) /* need to sort right side */ - if (l-L < R-r) {PUSH(r,R); R = l;} /* sort left side first */ - else {PUSH(L,l); L = r;} /* sort right side first */ - else R = l; /* need to sort left side only */ - else if (eq_r == 0) L = r; /* need to sort right side only */ - else goto nxt; /* need not to sort both sides */ - } -} - -char * -ruby_strdup(str) - const char *str; -{ - char *tmp; - int len = strlen(str) + 1; - - tmp = xmalloc(len); - memcpy(tmp, str, len); - - return tmp; -} - -char * -ruby_getcwd() -{ -#ifdef HAVE_GETCWD - int size = 200; - char *buf = xmalloc(size); - - while (!getcwd(buf, size)) { - if (errno != ERANGE) { - free(buf); - rb_sys_fail("getcwd"); - } - size *= 2; - buf = xrealloc(buf, size); - } -#else -# ifndef PATH_MAX -# define PATH_MAX 8192 -# endif - char *buf = xmalloc(PATH_MAX+1); - - if (!getwd(buf)) { - free(buf); - rb_sys_fail("getwd"); - } -#endif - return buf; -} - - -/**************************************************************** - * - * The author of this software is David M. Gay. - * - * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software and in all copies of the supporting - * documentation for such software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY - * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - ***************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -/* On a machine with IEEE extended-precision registers, it is - * necessary to specify double-precision (53-bit) rounding precision - * before invoking strtod or dtoa. If the machine uses (the equivalent - * of) Intel 80x87 arithmetic, the call - * _control87(PC_53, MCW_PC); - * does this with many compilers. Whether this or another call is - * appropriate depends on the compiler; for this to work, it may be - * necessary to #include "float.h" or another system-dependent header - * file. - */ - -/* strtod for IEEE-, VAX-, and IBM-arithmetic machines. - * - * This strtod returns a nearest machine number to the input decimal - * string (or sets errno to ERANGE). With IEEE arithmetic, ties are - * broken by the IEEE round-even rule. Otherwise ties are broken by - * biased rounding (add half and chop). - * - * Inspired loosely by William D. Clinger's paper "How to Read Floating - * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101]. - * - * Modifications: - * - * 1. We only require IEEE, IBM, or VAX double-precision - * arithmetic (not IEEE double-extended). - * 2. We get by with floating-point arithmetic in a case that - * Clinger missed -- when we're computing d * 10^n - * for a small integer d and the integer n is not too - * much larger than 22 (the maximum integer k for which - * we can represent 10^k exactly), we may be able to - * compute (d*10^k) * 10^(e-k) with just one roundoff. - * 3. Rather than a bit-at-a-time adjustment of the binary - * result in the hard case, we use floating-point - * arithmetic to determine the adjustment to within - * one bit; only in really hard cases do we need to - * compute a second residual. - * 4. Because of 3., we don't need a large table of powers of 10 - * for ten-to-e (just some small tables, e.g. of 10^k - * for 0 <= k <= 22). - */ - -/* - * #define IEEE_LITTLE_ENDIAN for IEEE-arithmetic machines where the least - * significant byte has the lowest address. - * #define IEEE_BIG_ENDIAN for IEEE-arithmetic machines where the most - * significant byte has the lowest address. - * #define Long int on machines with 32-bit ints and 64-bit longs. - * #define IBM for IBM mainframe-style floating-point arithmetic. - * #define VAX for VAX-style floating-point arithmetic (D_floating). - * #define No_leftright to omit left-right logic in fast floating-point - * computation of dtoa. - * #define Honor_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3 - * and strtod and dtoa should round accordingly. - * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3 - * and Honor_FLT_ROUNDS is not #defined. - * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines - * that use extended-precision instructions to compute rounded - * products and quotients) with IBM. - * #define ROUND_BIASED for IEEE-format with biased rounding. - * #define Inaccurate_Divide for IEEE-format with correctly rounded - * products but inaccurate quotients, e.g., for Intel i860. - * #define NO_LONG_LONG on machines that do not have a "long long" - * integer type (of >= 64 bits). On such machines, you can - * #define Just_16 to store 16 bits per 32-bit Long when doing - * high-precision integer arithmetic. Whether this speeds things - * up or slows things down depends on the machine and the number - * being converted. If long long is available and the name is - * something other than "long long", #define Llong to be the name, - * and if "unsigned Llong" does not work as an unsigned version of - * Llong, #define #ULLong to be the corresponding unsigned type. - * #define KR_headers for old-style C function headers. - * #define Bad_float_h if your system lacks a float.h or if it does not - * define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP, - * FLT_RADIX, FLT_ROUNDS, and DBL_MAX. - * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n) - * if memory is available and otherwise does something you deem - * appropriate. If MALLOC is undefined, malloc will be invoked - * directly -- and assumed always to succeed. - * #define Omit_Private_Memory to omit logic (added Jan. 1998) for making - * memory allocations from a private pool of memory when possible. - * When used, the private pool is PRIVATE_MEM bytes long: 2304 bytes, - * unless #defined to be a different length. This default length - * suffices to get rid of MALLOC calls except for unusual cases, - * such as decimal-to-binary conversion of a very long string of - * digits. The longest string dtoa can return is about 751 bytes - * long. For conversions by strtod of strings of 800 digits and - * all dtoa conversions in single-threaded executions with 8-byte - * pointers, PRIVATE_MEM >= 7400 appears to suffice; with 4-byte - * pointers, PRIVATE_MEM >= 7112 appears adequate. - * #define INFNAN_CHECK on IEEE systems to cause strtod to check for - * Infinity and NaN (case insensitively). On some systems (e.g., - * some HP systems), it may be necessary to #define NAN_WORD0 - * appropriately -- to the most significant word of a quiet NaN. - * (On HP Series 700/800 machines, -DNAN_WORD0=0x7ff40000 works.) - * When INFNAN_CHECK is #defined and No_Hex_NaN is not #defined, - * strtod also accepts (case insensitively) strings of the form - * NaN(x), where x is a string of hexadecimal digits and spaces; - * if there is only one string of hexadecimal digits, it is taken - * for the 52 fraction bits of the resulting NaN; if there are two - * or more strings of hex digits, the first is for the high 20 bits, - * the second and subsequent for the low 32 bits, with intervening - * white space ignored; but if this results in none of the 52 - * fraction bits being on (an IEEE Infinity symbol), then NAN_WORD0 - * and NAN_WORD1 are used instead. - * #define MULTIPLE_THREADS if the system offers preemptively scheduled - * multiple threads. In this case, you must provide (or suitably - * #define) two locks, acquired by ACQUIRE_DTOA_LOCK(n) and freed - * by FREE_DTOA_LOCK(n) for n = 0 or 1. (The second lock, accessed - * in pow5mult, ensures lazy evaluation of only one copy of high - * powers of 5; omitting this lock would introduce a small - * probability of wasting memory, but would otherwise be harmless.) - * You must also invoke freedtoa(s) to free the value s returned by - * dtoa. You may do so whether or not MULTIPLE_THREADS is #defined. - * #define NO_IEEE_Scale to disable new (Feb. 1997) logic in strtod that - * avoids underflows on inputs whose result does not underflow. - * If you #define NO_IEEE_Scale on a machine that uses IEEE-format - * floating-point numbers and flushes underflows to zero rather - * than implementing gradual underflow, then you must also #define - * Sudden_Underflow. - * #define YES_ALIAS to permit aliasing certain double values with - * arrays of ULongs. This leads to slightly better code with - * some compilers and was always used prior to 19990916, but it - * is not strictly legal and can cause trouble with aggressively - * optimizing compilers (e.g., gcc 2.95.1 under -O2). - * #define USE_LOCALE to use the current locale's decimal_point value. - * #define SET_INEXACT if IEEE arithmetic is being used and extra - * computation should be done to set the inexact flag when the - * result is inexact and avoid setting inexact when the result - * is exact. In this case, dtoa.c must be compiled in - * an environment, perhaps provided by #include "dtoa.c" in a - * suitable wrapper, that defines two functions, - * int get_inexact(void); - * void clear_inexact(void); - * such that get_inexact() returns a nonzero value if the - * inexact bit is already set, and clear_inexact() sets the - * inexact bit to 0. When SET_INEXACT is #defined, strtod - * also does extra computations to set the underflow and overflow - * flags when appropriate (i.e., when the result is tiny and - * inexact or when it is a numeric value rounded to +-infinity). - * #define NO_ERRNO if strtod should not assign errno = ERANGE when - * the result overflows to +-Infinity or underflows to 0. - */ - -#ifdef WORDS_BIGENDIAN -#define IEEE_BIG_ENDIAN -#else -#define IEEE_LITTLE_ENDIAN -#endif - -#ifdef __vax__ -#define VAX -#undef IEEE_BIG_ENDIAN -#undef IEEE_LITTLE_ENDIAN -#endif - -#if defined(__arm__) && !defined(__VFP_FP__) -#define IEEE_BIG_ENDIAN -#undef IEEE_LITTLE_ENDIAN -#endif - -#undef Long -#undef ULong - -#if SIZEOF_INT == 4 -#define Long int -#define ULong unsigned int -#elif SIZEOF_LONG == 4 -#define Long long int -#define ULong unsigned long int -#endif - -#if HAVE_LONG_LONG -#define Llong LONG_LONG -#endif - -#ifdef DEBUG -#include "stdio.h" -#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);} -#endif - -#include "stdlib.h" -#include "string.h" - -#ifdef USE_LOCALE -#include "locale.h" -#endif - -#ifdef MALLOC -extern void *MALLOC(size_t); -#else -#define MALLOC malloc -#endif - -#ifndef Omit_Private_Memory -#ifndef PRIVATE_MEM -#define PRIVATE_MEM 2304 -#endif -#define PRIVATE_mem ((PRIVATE_MEM+sizeof(double)-1)/sizeof(double)) -static double private_mem[PRIVATE_mem], *pmem_next = private_mem; -#endif - -#undef IEEE_Arith -#undef Avoid_Underflow -#ifdef IEEE_BIG_ENDIAN -#define IEEE_Arith -#endif -#ifdef IEEE_LITTLE_ENDIAN -#define IEEE_Arith -#endif - -#include "errno.h" - -#ifdef Bad_float_h - -#ifdef IEEE_Arith -#define DBL_DIG 15 -#define DBL_MAX_10_EXP 308 -#define DBL_MAX_EXP 1024 -#define FLT_RADIX 2 -#endif /*IEEE_Arith*/ - -#ifdef IBM -#define DBL_DIG 16 -#define DBL_MAX_10_EXP 75 -#define DBL_MAX_EXP 63 -#define FLT_RADIX 16 -#define DBL_MAX 7.2370055773322621e+75 -#endif - -#ifdef VAX -#define DBL_DIG 16 -#define DBL_MAX_10_EXP 38 -#define DBL_MAX_EXP 127 -#define FLT_RADIX 2 -#define DBL_MAX 1.7014118346046923e+38 -#endif - -#ifndef LONG_MAX -#define LONG_MAX 2147483647 -#endif - -#else /* ifndef Bad_float_h */ -#include "float.h" -#endif /* Bad_float_h */ - -#ifndef __MATH_H__ -#include "math.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + defined(IBM) != 1 -Exactly one of IEEE_LITTLE_ENDIAN, IEEE_BIG_ENDIAN, VAX, or IBM should be defined. -#endif - -typedef union { double d; ULong L[2]; } U; - -#ifdef YES_ALIAS -#define dval(x) x -#ifdef IEEE_LITTLE_ENDIAN -#define word0(x) ((ULong *)&x)[1] -#define word1(x) ((ULong *)&x)[0] -#else -#define word0(x) ((ULong *)&x)[0] -#define word1(x) ((ULong *)&x)[1] -#endif -#else -#ifdef IEEE_LITTLE_ENDIAN -#define word0(x) ((U*)&x)->L[1] -#define word1(x) ((U*)&x)->L[0] -#else -#define word0(x) ((U*)&x)->L[0] -#define word1(x) ((U*)&x)->L[1] -#endif -#define dval(x) ((U*)&x)->d -#endif - -/* The following definition of Storeinc is appropriate for MIPS processors. - * An alternative that might be better on some machines is - * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) - */ -#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(__arm__) -#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \ -((unsigned short *)a)[0] = (unsigned short)c, a++) -#else -#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \ -((unsigned short *)a)[1] = (unsigned short)c, a++) -#endif - -/* #define P DBL_MANT_DIG */ -/* Ten_pmax = floor(P*log(2)/log(5)) */ -/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */ -/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ -/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */ - -#ifdef IEEE_Arith -#define Exp_shift 20 -#define Exp_shift1 20 -#define Exp_msk1 0x100000 -#define Exp_msk11 0x100000 -#define Exp_mask 0x7ff00000 -#define P 53 -#define Bias 1023 -#define Emin (-1022) -#define Exp_1 0x3ff00000 -#define Exp_11 0x3ff00000 -#define Ebits 11 -#define Frac_mask 0xfffff -#define Frac_mask1 0xfffff -#define Ten_pmax 22 -#define Bletch 0x10 -#define Bndry_mask 0xfffff -#define Bndry_mask1 0xfffff -#define LSB 1 -#define Sign_bit 0x80000000 -#define Log2P 1 -#define Tiny0 0 -#define Tiny1 1 -#define Quick_max 14 -#define Int_max 14 -#ifndef NO_IEEE_Scale -#define Avoid_Underflow -#ifdef Flush_Denorm /* debugging option */ -#undef Sudden_Underflow -#endif -#endif - -#ifndef Flt_Rounds -#ifdef FLT_ROUNDS -#define Flt_Rounds FLT_ROUNDS -#else -#define Flt_Rounds 1 -#endif -#endif /*Flt_Rounds*/ - -#ifdef Honor_FLT_ROUNDS -#define Rounding rounding -#undef Check_FLT_ROUNDS -#define Check_FLT_ROUNDS -#else -#define Rounding Flt_Rounds -#endif - -#else /* ifndef IEEE_Arith */ -#undef Check_FLT_ROUNDS -#undef Honor_FLT_ROUNDS -#undef SET_INEXACT -#undef Sudden_Underflow -#define Sudden_Underflow -#ifdef IBM -#undef Flt_Rounds -#define Flt_Rounds 0 -#define Exp_shift 24 -#define Exp_shift1 24 -#define Exp_msk1 0x1000000 -#define Exp_msk11 0x1000000 -#define Exp_mask 0x7f000000 -#define P 14 -#define Bias 65 -#define Exp_1 0x41000000 -#define Exp_11 0x41000000 -#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */ -#define Frac_mask 0xffffff -#define Frac_mask1 0xffffff -#define Bletch 4 -#define Ten_pmax 22 -#define Bndry_mask 0xefffff -#define Bndry_mask1 0xffffff -#define LSB 1 -#define Sign_bit 0x80000000 -#define Log2P 4 -#define Tiny0 0x100000 -#define Tiny1 0 -#define Quick_max 14 -#define Int_max 15 -#else /* VAX */ -#undef Flt_Rounds -#define Flt_Rounds 1 -#define Exp_shift 23 -#define Exp_shift1 7 -#define Exp_msk1 0x80 -#define Exp_msk11 0x800000 -#define Exp_mask 0x7f80 -#define P 56 -#define Bias 129 -#define Exp_1 0x40800000 -#define Exp_11 0x4080 -#define Ebits 8 -#define Frac_mask 0x7fffff -#define Frac_mask1 0xffff007f -#define Ten_pmax 24 -#define Bletch 2 -#define Bndry_mask 0xffff007f -#define Bndry_mask1 0xffff007f -#define LSB 0x10000 -#define Sign_bit 0x8000 -#define Log2P 1 -#define Tiny0 0x80 -#define Tiny1 0 -#define Quick_max 15 -#define Int_max 15 -#endif /* IBM, VAX */ -#endif /* IEEE_Arith */ - -#ifndef IEEE_Arith -#define ROUND_BIASED -#endif - -#ifdef RND_PRODQUOT -#define rounded_product(a,b) a = rnd_prod(a, b) -#define rounded_quotient(a,b) a = rnd_quot(a, b) -extern double rnd_prod(double, double), rnd_quot(double, double); -#else -#define rounded_product(a,b) a *= b -#define rounded_quotient(a,b) a /= b -#endif - -#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) -#define Big1 0xffffffff - -#ifndef Pack_32 -#define Pack_32 -#endif - -#define FFFFFFFF 0xffffffffUL - -#ifdef NO_LONG_LONG -#undef ULLong -#ifdef Just_16 -#undef Pack_32 -/* When Pack_32 is not defined, we store 16 bits per 32-bit Long. - * This makes some inner loops simpler and sometimes saves work - * during multiplications, but it often seems to make things slightly - * slower. Hence the default is now to store 32 bits per Long. - */ -#endif -#else /* long long available */ -#ifndef Llong -#define Llong long long -#endif -#ifndef ULLong -#define ULLong unsigned Llong -#endif -#endif /* NO_LONG_LONG */ - -#ifndef MULTIPLE_THREADS -#define ACQUIRE_DTOA_LOCK(n) /*nothing*/ -#define FREE_DTOA_LOCK(n) /*nothing*/ -#endif - -#define Kmax 15 - -struct Bigint { - struct Bigint *next; - int k, maxwds, sign, wds; - ULong x[1]; -}; - -typedef struct Bigint Bigint; - -static Bigint *freelist[Kmax+1]; - -static Bigint * -Balloc(int k) -{ - int x; - Bigint *rv; -#ifndef Omit_Private_Memory - unsigned int len; -#endif - - ACQUIRE_DTOA_LOCK(0); - if ((rv = freelist[k]) != 0) { - freelist[k] = rv->next; - } - else { - x = 1 << k; -#ifdef Omit_Private_Memory - rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(ULong)); -#else - len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1) - /sizeof(double); - if (pmem_next - private_mem + len <= PRIVATE_mem) { - rv = (Bigint*)pmem_next; - pmem_next += len; - } - else - rv = (Bigint*)MALLOC(len*sizeof(double)); -#endif - rv->k = k; - rv->maxwds = x; - } - FREE_DTOA_LOCK(0); - rv->sign = rv->wds = 0; - return rv; -} - -static void -Bfree(Bigint *v) -{ - if (v) { - ACQUIRE_DTOA_LOCK(0); - v->next = freelist[v->k]; - freelist[v->k] = v; - FREE_DTOA_LOCK(0); - } -} - -#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \ -y->wds*sizeof(Long) + 2*sizeof(int)) - -static Bigint * -multadd(Bigint *b, int m, int a) /* multiply by m and add a */ -{ - int i, wds; -#ifdef ULLong - ULong *x; - ULLong carry, y; -#else - ULong carry, *x, y; -#ifdef Pack_32 - ULong xi, z; -#endif -#endif - Bigint *b1; - - wds = b->wds; - x = b->x; - i = 0; - carry = a; - do { -#ifdef ULLong - y = *x * (ULLong)m + carry; - carry = y >> 32; - *x++ = y & FFFFFFFF; -#else -#ifdef Pack_32 - xi = *x; - y = (xi & 0xffff) * m + carry; - z = (xi >> 16) * m + (y >> 16); - carry = z >> 16; - *x++ = (z << 16) + (y & 0xffff); -#else - y = *x * m + carry; - carry = y >> 16; - *x++ = y & 0xffff; -#endif -#endif - } while (++i < wds); - if (carry) { - if (wds >= b->maxwds) { - b1 = Balloc(b->k+1); - Bcopy(b1, b); - Bfree(b); - b = b1; - } - b->x[wds++] = carry; - b->wds = wds; - } - return b; -} - -static Bigint * -s2b(const char *s, int nd0, int nd, ULong y9) -{ - Bigint *b; - int i, k; - Long x, y; - - x = (nd + 8) / 9; - for (k = 0, y = 1; x > y; y <<= 1, k++) ; -#ifdef Pack_32 - b = Balloc(k); - b->x[0] = y9; - b->wds = 1; -#else - b = Balloc(k+1); - b->x[0] = y9 & 0xffff; - b->wds = (b->x[1] = y9 >> 16) ? 2 : 1; -#endif - - i = 9; - if (9 < nd0) { - s += 9; - do { - b = multadd(b, 10, *s++ - '0'); - } while (++i < nd0); - s++; - } - else - s += 10; - for (; i < nd; i++) - b = multadd(b, 10, *s++ - '0'); - return b; -} - -static int -hi0bits(register ULong x) -{ - register int k = 0; - - if (!(x & 0xffff0000)) { - k = 16; - x <<= 16; - } - if (!(x & 0xff000000)) { - k += 8; - x <<= 8; - } - if (!(x & 0xf0000000)) { - k += 4; - x <<= 4; - } - if (!(x & 0xc0000000)) { - k += 2; - x <<= 2; - } - if (!(x & 0x80000000)) { - k++; - if (!(x & 0x40000000)) - return 32; - } - return k; -} - -static int -lo0bits(ULong *y) -{ - register int k; - register ULong x = *y; - - if (x & 7) { - if (x & 1) - return 0; - if (x & 2) { - *y = x >> 1; - return 1; - } - *y = x >> 2; - return 2; - } - k = 0; - if (!(x & 0xffff)) { - k = 16; - x >>= 16; - } - if (!(x & 0xff)) { - k += 8; - x >>= 8; - } - if (!(x & 0xf)) { - k += 4; - x >>= 4; - } - if (!(x & 0x3)) { - k += 2; - x >>= 2; - } - if (!(x & 1)) { - k++; - x >>= 1; - if (!x) - return 32; - } - *y = x; - return k; -} - -static Bigint * -i2b(int i) -{ - Bigint *b; - - b = Balloc(1); - b->x[0] = i; - b->wds = 1; - return b; -} - -static Bigint * -mult(Bigint *a, Bigint *b) -{ - Bigint *c; - int k, wa, wb, wc; - ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0; - ULong y; -#ifdef ULLong - ULLong carry, z; -#else - ULong carry, z; -#ifdef Pack_32 - ULong z2; -#endif -#endif - - if (a->wds < b->wds) { - c = a; - a = b; - b = c; - } - k = a->k; - wa = a->wds; - wb = b->wds; - wc = wa + wb; - if (wc > a->maxwds) - k++; - c = Balloc(k); - for (x = c->x, xa = x + wc; x < xa; x++) - *x = 0; - xa = a->x; - xae = xa + wa; - xb = b->x; - xbe = xb + wb; - xc0 = c->x; -#ifdef ULLong - for (; xb < xbe; xc0++) { - if ((y = *xb++) != 0) { - x = xa; - xc = xc0; - carry = 0; - do { - z = *x++ * (ULLong)y + *xc + carry; - carry = z >> 32; - *xc++ = z & FFFFFFFF; - } while (x < xae); - *xc = carry; - } - } -#else -#ifdef Pack_32 - for (; xb < xbe; xb++, xc0++) { - if (y = *xb & 0xffff) { - x = xa; - xc = xc0; - carry = 0; - do { - z = (*x & 0xffff) * y + (*xc & 0xffff) + carry; - carry = z >> 16; - z2 = (*x++ >> 16) * y + (*xc >> 16) + carry; - carry = z2 >> 16; - Storeinc(xc, z2, z); - } while (x < xae); - *xc = carry; - } - if (y = *xb >> 16) { - x = xa; - xc = xc0; - carry = 0; - z2 = *xc; - do { - z = (*x & 0xffff) * y + (*xc >> 16) + carry; - carry = z >> 16; - Storeinc(xc, z, z2); - z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry; - carry = z2 >> 16; - } while (x < xae); - *xc = z2; - } - } -#else - for (; xb < xbe; xc0++) { - if (y = *xb++) { - x = xa; - xc = xc0; - carry = 0; - do { - z = *x++ * y + *xc + carry; - carry = z >> 16; - *xc++ = z & 0xffff; - } while (x < xae); - *xc = carry; - } - } -#endif -#endif - for (xc0 = c->x, xc = xc0 + wc; wc > 0 && !*--xc; --wc) ; - c->wds = wc; - return c; -} - -static Bigint *p5s; - -static Bigint * -pow5mult(Bigint *b, int k) -{ - Bigint *b1, *p5, *p51; - int i; - static int p05[3] = { 5, 25, 125 }; - - if ((i = k & 3) != 0) - b = multadd(b, p05[i-1], 0); - - if (!(k >>= 2)) - return b; - if (!(p5 = p5s)) { - /* first time */ -#ifdef MULTIPLE_THREADS - ACQUIRE_DTOA_LOCK(1); - if (!(p5 = p5s)) { - p5 = p5s = i2b(625); - p5->next = 0; - } - FREE_DTOA_LOCK(1); -#else - p5 = p5s = i2b(625); - p5->next = 0; -#endif - } - for (;;) { - if (k & 1) { - b1 = mult(b, p5); - Bfree(b); - b = b1; - } - if (!(k >>= 1)) - break; - if (!(p51 = p5->next)) { -#ifdef MULTIPLE_THREADS - ACQUIRE_DTOA_LOCK(1); - if (!(p51 = p5->next)) { - p51 = p5->next = mult(p5,p5); - p51->next = 0; - } - FREE_DTOA_LOCK(1); -#else - p51 = p5->next = mult(p5,p5); - p51->next = 0; -#endif - } - p5 = p51; - } - return b; -} - -static Bigint * -lshift(Bigint *b, int k) -{ - int i, k1, n, n1; - Bigint *b1; - ULong *x, *x1, *xe, z; - -#ifdef Pack_32 - n = k >> 5; -#else - n = k >> 4; -#endif - k1 = b->k; - n1 = n + b->wds + 1; - for (i = b->maxwds; n1 > i; i <<= 1) - k1++; - b1 = Balloc(k1); - x1 = b1->x; - for (i = 0; i < n; i++) - *x1++ = 0; - x = b->x; - xe = x + b->wds; -#ifdef Pack_32 - if (k &= 0x1f) { - k1 = 32 - k; - z = 0; - do { - *x1++ = *x << k | z; - z = *x++ >> k1; - } while (x < xe); - if ((*x1 = z) != 0) - ++n1; - } -#else - if (k &= 0xf) { - k1 = 16 - k; - z = 0; - do { - *x1++ = *x << k & 0xffff | z; - z = *x++ >> k1; - } while (x < xe); - if (*x1 = z) - ++n1; - } -#endif - else - do { - *x1++ = *x++; - } while (x < xe); - b1->wds = n1 - 1; - Bfree(b); - return b1; -} - -static int -cmp(Bigint *a, Bigint *b) -{ - ULong *xa, *xa0, *xb, *xb0; - int i, j; - - i = a->wds; - j = b->wds; -#ifdef DEBUG - if (i > 1 && !a->x[i-1]) - Bug("cmp called with a->x[a->wds-1] == 0"); - if (j > 1 && !b->x[j-1]) - Bug("cmp called with b->x[b->wds-1] == 0"); -#endif - if (i -= j) - return i; - xa0 = a->x; - xa = xa0 + j; - xb0 = b->x; - xb = xb0 + j; - for (;;) { - if (*--xa != *--xb) - return *xa < *xb ? -1 : 1; - if (xa <= xa0) - break; - } - return 0; -} - -static Bigint * -diff(Bigint *a, Bigint *b) -{ - Bigint *c; - int i, wa, wb; - ULong *xa, *xae, *xb, *xbe, *xc; -#ifdef ULLong - ULLong borrow, y; -#else - ULong borrow, y; -#ifdef Pack_32 - ULong z; -#endif -#endif - - i = cmp(a,b); - if (!i) { - c = Balloc(0); - c->wds = 1; - c->x[0] = 0; - return c; - } - if (i < 0) { - c = a; - a = b; - b = c; - i = 1; - } - else - i = 0; - c = Balloc(a->k); - c->sign = i; - wa = a->wds; - xa = a->x; - xae = xa + wa; - wb = b->wds; - xb = b->x; - xbe = xb + wb; - xc = c->x; - borrow = 0; -#ifdef ULLong - do { - y = (ULLong)*xa++ - *xb++ - borrow; - borrow = y >> 32 & (ULong)1; - *xc++ = y & FFFFFFFF; - } while (xb < xbe); - while (xa < xae) { - y = *xa++ - borrow; - borrow = y >> 32 & (ULong)1; - *xc++ = y & FFFFFFFF; - } -#else -#ifdef Pack_32 - do { - y = (*xa & 0xffff) - (*xb & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - z = (*xa++ >> 16) - (*xb++ >> 16) - borrow; - borrow = (z & 0x10000) >> 16; - Storeinc(xc, z, y); - } while (xb < xbe); - while (xa < xae) { - y = (*xa & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - z = (*xa++ >> 16) - borrow; - borrow = (z & 0x10000) >> 16; - Storeinc(xc, z, y); - } -#else - do { - y = *xa++ - *xb++ - borrow; - borrow = (y & 0x10000) >> 16; - *xc++ = y & 0xffff; - } while (xb < xbe); - while (xa < xae) { - y = *xa++ - borrow; - borrow = (y & 0x10000) >> 16; - *xc++ = y & 0xffff; - } -#endif -#endif - while (!*--xc) - wa--; - c->wds = wa; - return c; -} - -static double -ulp(double x) -{ - register Long L; - double a; - - L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; -#ifndef Avoid_Underflow -#ifndef Sudden_Underflow - if (L > 0) { -#endif -#endif -#ifdef IBM - L |= Exp_msk1 >> 4; -#endif - word0(a) = L; - word1(a) = 0; -#ifndef Avoid_Underflow -#ifndef Sudden_Underflow - } - else { - L = -L >> Exp_shift; - if (L < Exp_shift) { - word0(a) = 0x80000 >> L; - word1(a) = 0; - } - else { - word0(a) = 0; - L -= Exp_shift; - word1(a) = L >= 31 ? 1 : 1 << 31 - L; - } - } -#endif -#endif - return dval(a); -} - -static double -b2d(Bigint *a, int *e) -{ - ULong *xa, *xa0, w, y, z; - int k; - double d; -#ifdef VAX - ULong d0, d1; -#else -#define d0 word0(d) -#define d1 word1(d) -#endif - - xa0 = a->x; - xa = xa0 + a->wds; - y = *--xa; -#ifdef DEBUG - if (!y) Bug("zero y in b2d"); -#endif - k = hi0bits(y); - *e = 32 - k; -#ifdef Pack_32 - if (k < Ebits) { - d0 = Exp_1 | y >> (Ebits - k); - w = xa > xa0 ? *--xa : 0; - d1 = y << ((32-Ebits) + k) | w >> (Ebits - k); - goto ret_d; - } - z = xa > xa0 ? *--xa : 0; - if (k -= Ebits) { - d0 = Exp_1 | y << k | z >> (32 - k); - y = xa > xa0 ? *--xa : 0; - d1 = z << k | y >> (32 - k); - } - else { - d0 = Exp_1 | y; - d1 = z; - } -#else - if (k < Ebits + 16) { - z = xa > xa0 ? *--xa : 0; - d0 = Exp_1 | y << k - Ebits | z >> Ebits + 16 - k; - w = xa > xa0 ? *--xa : 0; - y = xa > xa0 ? *--xa : 0; - d1 = z << k + 16 - Ebits | w << k - Ebits | y >> 16 + Ebits - k; - goto ret_d; - } - z = xa > xa0 ? *--xa : 0; - w = xa > xa0 ? *--xa : 0; - k -= Ebits + 16; - d0 = Exp_1 | y << k + 16 | z << k | w >> 16 - k; - y = xa > xa0 ? *--xa : 0; - d1 = w << k + 16 | y << k; -#endif -ret_d: -#ifdef VAX - word0(d) = d0 >> 16 | d0 << 16; - word1(d) = d1 >> 16 | d1 << 16; -#else -#undef d0 -#undef d1 -#endif - return dval(d); -} - -static Bigint * -d2b(double d, int *e, int *bits) -{ - Bigint *b; - int de, k; - ULong *x, y, z; -#ifndef Sudden_Underflow - int i; -#endif -#ifdef VAX - ULong d0, d1; - d0 = word0(d) >> 16 | word0(d) << 16; - d1 = word1(d) >> 16 | word1(d) << 16; -#else -#define d0 word0(d) -#define d1 word1(d) -#endif - -#ifdef Pack_32 - b = Balloc(1); -#else - b = Balloc(2); -#endif - x = b->x; - - z = d0 & Frac_mask; - d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ -#ifdef Sudden_Underflow - de = (int)(d0 >> Exp_shift); -#ifndef IBM - z |= Exp_msk11; -#endif -#else - if ((de = (int)(d0 >> Exp_shift)) != 0) - z |= Exp_msk1; -#endif -#ifdef Pack_32 - if ((y = d1) != 0) { - if ((k = lo0bits(&y)) != 0) { - x[0] = y | z << (32 - k); - z >>= k; - } - else - x[0] = y; -#ifndef Sudden_Underflow - i = -#endif - b->wds = (x[1] = z) ? 2 : 1; - } - else { -#ifdef DEBUG - if (!z) - Bug("Zero passed to d2b"); -#endif - k = lo0bits(&z); - x[0] = z; -#ifndef Sudden_Underflow - i = -#endif - b->wds = 1; - k += 32; - } -#else - if (y = d1) { - if (k = lo0bits(&y)) - if (k >= 16) { - x[0] = y | z << 32 - k & 0xffff; - x[1] = z >> k - 16 & 0xffff; - x[2] = z >> k; - i = 2; - } - else { - x[0] = y & 0xffff; - x[1] = y >> 16 | z << 16 - k & 0xffff; - x[2] = z >> k & 0xffff; - x[3] = z >> k+16; - i = 3; - } - else { - x[0] = y & 0xffff; - x[1] = y >> 16; - x[2] = z & 0xffff; - x[3] = z >> 16; - i = 3; - } - } - else { -#ifdef DEBUG - if (!z) - Bug("Zero passed to d2b"); -#endif - k = lo0bits(&z); - if (k >= 16) { - x[0] = z; - i = 0; - } - else { - x[0] = z & 0xffff; - x[1] = z >> 16; - i = 1; - } - k += 32; - } - while (!x[i]) - --i; - b->wds = i + 1; -#endif -#ifndef Sudden_Underflow - if (de) { -#endif -#ifdef IBM - *e = (de - Bias - (P-1) << 2) + k; - *bits = 4*P + 8 - k - hi0bits(word0(d) & Frac_mask); -#else - *e = de - Bias - (P-1) + k; - *bits = P - k; -#endif -#ifndef Sudden_Underflow - } - else { - *e = de - Bias - (P-1) + 1 + k; -#ifdef Pack_32 - *bits = 32*i - hi0bits(x[i-1]); -#else - *bits = (i+2)*16 - hi0bits(x[i]); -#endif - } -#endif - return b; -} -#undef d0 -#undef d1 - -static double -ratio(Bigint *a, Bigint *b) -{ - double da, db; - int k, ka, kb; - - dval(da) = b2d(a, &ka); - dval(db) = b2d(b, &kb); -#ifdef Pack_32 - k = ka - kb + 32*(a->wds - b->wds); -#else - k = ka - kb + 16*(a->wds - b->wds); -#endif -#ifdef IBM - if (k > 0) { - word0(da) += (k >> 2)*Exp_msk1; - if (k &= 3) - dval(da) *= 1 << k; - } - else { - k = -k; - word0(db) += (k >> 2)*Exp_msk1; - if (k &= 3) - dval(db) *= 1 << k; - } -#else - if (k > 0) - word0(da) += k*Exp_msk1; - else { - k = -k; - word0(db) += k*Exp_msk1; - } -#endif - return dval(da) / dval(db); -} - -static const double -tens[] = { - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, - 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, - 1e20, 1e21, 1e22 -#ifdef VAX - , 1e23, 1e24 -#endif -}; - -static const double -#ifdef IEEE_Arith -bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 }; -static const double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128, -#ifdef Avoid_Underflow - 9007199254740992.*9007199254740992.e-256 - /* = 2^106 * 1e-53 */ -#else - 1e-256 -#endif -}; -/* The factor of 2^53 in tinytens[4] helps us avoid setting the underflow */ -/* flag unnecessarily. It leads to a song and dance at the end of strtod. */ -#define Scale_Bit 0x10 -#define n_bigtens 5 -#else -#ifdef IBM -bigtens[] = { 1e16, 1e32, 1e64 }; -static const double tinytens[] = { 1e-16, 1e-32, 1e-64 }; -#define n_bigtens 3 -#else -bigtens[] = { 1e16, 1e32 }; -static const double tinytens[] = { 1e-16, 1e-32 }; -#define n_bigtens 2 -#endif -#endif - -#ifndef IEEE_Arith -#undef INFNAN_CHECK -#endif - -#ifdef INFNAN_CHECK - -#ifndef NAN_WORD0 -#define NAN_WORD0 0x7ff80000 -#endif - -#ifndef NAN_WORD1 -#define NAN_WORD1 0 -#endif - -static int -match(const char **sp, char *t) -{ - int c, d; - const char *s = *sp; - - while (d = *t++) { - if ((c = *++s) >= 'A' && c <= 'Z') - c += 'a' - 'A'; - if (c != d) - return 0; - } - *sp = s + 1; - return 1; -} - -#ifndef No_Hex_NaN -static void -hexnan(double *rvp, const char **sp) -{ - ULong c, x[2]; - const char *s; - int havedig, udx0, xshift; - - x[0] = x[1] = 0; - havedig = xshift = 0; - udx0 = 1; - s = *sp; - while (c = *(const unsigned char*)++s) { - if (c >= '0' && c <= '9') - c -= '0'; - else if (c >= 'a' && c <= 'f') - c += 10 - 'a'; - else if (c >= 'A' && c <= 'F') - c += 10 - 'A'; - else if (c <= ' ') { - if (udx0 && havedig) { - udx0 = 0; - xshift = 1; - } - continue; - } - else if (/*(*/ c == ')' && havedig) { - *sp = s + 1; - break; - } - else - return; /* invalid form: don't change *sp */ - havedig = 1; - if (xshift) { - xshift = 0; - x[0] = x[1]; - x[1] = 0; - } - if (udx0) - x[0] = (x[0] << 4) | (x[1] >> 28); - x[1] = (x[1] << 4) | c; - } - if ((x[0] &= 0xfffff) || x[1]) { - word0(*rvp) = Exp_mask | x[0]; - word1(*rvp) = x[1]; - } -} -#endif /*No_Hex_NaN*/ -#endif /* INFNAN_CHECK */ - -double -ruby_strtod(const char *s00, char **se) -{ -#ifdef Avoid_Underflow - int scale; -#endif - int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, - e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; - const char *s, *s0, *s1; - double aadj, aadj1, adj, rv, rv0; - Long L; - ULong y, z; - Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; -#ifdef SET_INEXACT - int inexact, oldinexact; -#endif -#ifdef Honor_FLT_ROUNDS - int rounding; -#endif -#ifdef USE_LOCALE - const char *s2; -#endif - - sign = nz0 = nz = 0; - dval(rv) = 0.; - for (s = s00;;s++) - switch (*s) { - case '-': - sign = 1; - /* no break */ - case '+': - if (*++s) - goto break2; - /* no break */ - case 0: - goto ret0; - case '\t': - case '\n': - case '\v': - case '\f': - case '\r': - case ' ': - continue; - default: - goto break2; - } -break2: - if (*s == '0') { - nz0 = 1; - while (*++s == '0') ; - if (!*s) - goto ret; - } - s0 = s; - y = z = 0; - for (nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) - if (nd < 9) - y = 10*y + c - '0'; - else if (nd < 16) - z = 10*z + c - '0'; - nd0 = nd; -#ifdef USE_LOCALE - s1 = localeconv()->decimal_point; - if (c == *s1) { - c = '.'; - if (*++s1) { - s2 = s; - for (;;) { - if (*++s2 != *s1) { - c = 0; - break; - } - if (!*++s1) { - s = s2; - break; - } - } - } - } -#endif - if (c == '.') { - if (!ISDIGIT(s[1])) - goto dig_done; - c = *++s; - if (!nd) { - for (; c == '0'; c = *++s) - nz++; - if (c > '0' && c <= '9') { - s0 = s; - nf += nz; - nz = 0; - goto have_dig; - } - goto dig_done; - } - for (; c >= '0' && c <= '9'; c = *++s) { -have_dig: - nz++; - if (c -= '0') { - nf += nz; - for (i = 1; i < nz; i++) - if (nd++ < 9) - y *= 10; - else if (nd <= DBL_DIG + 1) - z *= 10; - if (nd++ < 9) - y = 10*y + c; - else if (nd <= DBL_DIG + 1) - z = 10*z + c; - nz = 0; - } - } - } -dig_done: - e = 0; - if (c == 'e' || c == 'E') { - if (!nd && !nz && !nz0) { - goto ret0; - } - s00 = s; - esign = 0; - switch (c = *++s) { - case '-': - esign = 1; - case '+': - c = *++s; - } - if (c >= '0' && c <= '9') { - while (c == '0') - c = *++s; - if (c > '0' && c <= '9') { - L = c - '0'; - s1 = s; - while ((c = *++s) >= '0' && c <= '9') - L = 10*L + c - '0'; - if (s - s1 > 8 || L > 19999) - /* Avoid confusion from exponents - * so large that e might overflow. - */ - e = 19999; /* safe for 16 bit ints */ - else - e = (int)L; - if (esign) - e = -e; - } - else - e = 0; - } - else - s = s00; - } - if (!nd) { - if (!nz && !nz0) { -#ifdef INFNAN_CHECK - /* Check for Nan and Infinity */ - switch (c) { - case 'i': - case 'I': - if (match(&s,"nf")) { - --s; - if (!match(&s,"inity")) - ++s; - word0(rv) = 0x7ff00000; - word1(rv) = 0; - goto ret; - } - break; - case 'n': - case 'N': - if (match(&s, "an")) { - word0(rv) = NAN_WORD0; - word1(rv) = NAN_WORD1; -#ifndef No_Hex_NaN - if (*s == '(') /*)*/ - hexnan(&rv, &s); -#endif - goto ret; - } - } -#endif /* INFNAN_CHECK */ -ret0: - s = s00; - sign = 0; - } - goto ret; - } - e1 = e -= nf; - - /* Now we have nd0 digits, starting at s0, followed by a - * decimal point, followed by nd-nd0 digits. The number we're - * after is the integer represented by those digits times - * 10**e */ - - if (!nd0) - nd0 = nd; - k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; - dval(rv) = y; - if (k > 9) { -#ifdef SET_INEXACT - if (k > DBL_DIG) - oldinexact = get_inexact(); -#endif - dval(rv) = tens[k - 9] * dval(rv) + z; - } - bd0 = 0; - if (nd <= DBL_DIG -#ifndef RND_PRODQUOT -#ifndef Honor_FLT_ROUNDS - && Flt_Rounds == 1 -#endif -#endif - ) { - if (!e) - goto ret; - if (e > 0) { - if (e <= Ten_pmax) { -#ifdef VAX - goto vax_ovfl_check; -#else -#ifdef Honor_FLT_ROUNDS - /* round correctly FLT_ROUNDS = 2 or 3 */ - if (sign) { - rv = -rv; - sign = 0; - } -#endif - /* rv = */ rounded_product(dval(rv), tens[e]); - goto ret; -#endif - } - i = DBL_DIG - nd; - if (e <= Ten_pmax + i) { - /* A fancier test would sometimes let us do - * this for larger i values. - */ -#ifdef Honor_FLT_ROUNDS - /* round correctly FLT_ROUNDS = 2 or 3 */ - if (sign) { - rv = -rv; - sign = 0; - } -#endif - e -= i; - dval(rv) *= tens[i]; -#ifdef VAX - /* VAX exponent range is so narrow we must - * worry about overflow here... - */ -vax_ovfl_check: - word0(rv) -= P*Exp_msk1; - /* rv = */ rounded_product(dval(rv), tens[e]); - if ((word0(rv) & Exp_mask) - > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) - goto ovfl; - word0(rv) += P*Exp_msk1; -#else - /* rv = */ rounded_product(dval(rv), tens[e]); -#endif - goto ret; - } - } -#ifndef Inaccurate_Divide - else if (e >= -Ten_pmax) { -#ifdef Honor_FLT_ROUNDS - /* round correctly FLT_ROUNDS = 2 or 3 */ - if (sign) { - rv = -rv; - sign = 0; - } -#endif - /* rv = */ rounded_quotient(dval(rv), tens[-e]); - goto ret; - } -#endif - } - e1 += nd - k; - -#ifdef IEEE_Arith -#ifdef SET_INEXACT - inexact = 1; - if (k <= DBL_DIG) - oldinexact = get_inexact(); -#endif -#ifdef Avoid_Underflow - scale = 0; -#endif -#ifdef Honor_FLT_ROUNDS - if ((rounding = Flt_Rounds) >= 2) { - if (sign) - rounding = rounding == 2 ? 0 : 2; - else - if (rounding != 2) - rounding = 0; - } -#endif -#endif /*IEEE_Arith*/ - - /* Get starting approximation = rv * 10**e1 */ - - if (e1 > 0) { - if ((i = e1 & 15) != 0) - dval(rv) *= tens[i]; - if (e1 &= ~15) { - if (e1 > DBL_MAX_10_EXP) { -ovfl: -#ifndef NO_ERRNO - errno = ERANGE; -#endif - /* Can't trust HUGE_VAL */ -#ifdef IEEE_Arith -#ifdef Honor_FLT_ROUNDS - switch (rounding) { - case 0: /* toward 0 */ - case 3: /* toward -infinity */ - word0(rv) = Big0; - word1(rv) = Big1; - break; - default: - word0(rv) = Exp_mask; - word1(rv) = 0; - } -#else /*Honor_FLT_ROUNDS*/ - word0(rv) = Exp_mask; - word1(rv) = 0; -#endif /*Honor_FLT_ROUNDS*/ -#ifdef SET_INEXACT - /* set overflow bit */ - dval(rv0) = 1e300; - dval(rv0) *= dval(rv0); -#endif -#else /*IEEE_Arith*/ - word0(rv) = Big0; - word1(rv) = Big1; -#endif /*IEEE_Arith*/ - if (bd0) - goto retfree; - goto ret; - } - e1 >>= 4; - for (j = 0; e1 > 1; j++, e1 >>= 1) - if (e1 & 1) - dval(rv) *= bigtens[j]; - /* The last multiplication could overflow. */ - word0(rv) -= P*Exp_msk1; - dval(rv) *= bigtens[j]; - if ((z = word0(rv) & Exp_mask) - > Exp_msk1*(DBL_MAX_EXP+Bias-P)) - goto ovfl; - if (z > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) { - /* set to largest number */ - /* (Can't trust DBL_MAX) */ - word0(rv) = Big0; - word1(rv) = Big1; - } - else - word0(rv) += P*Exp_msk1; - } - } - else if (e1 < 0) { - e1 = -e1; - if ((i = e1 & 15) != 0) - dval(rv) /= tens[i]; - if (e1 >>= 4) { - if (e1 >= 1 << n_bigtens) - goto undfl; -#ifdef Avoid_Underflow - if (e1 & Scale_Bit) - scale = 2*P; - for (j = 0; e1 > 0; j++, e1 >>= 1) - if (e1 & 1) - dval(rv) *= tinytens[j]; - if (scale && (j = 2*P + 1 - ((word0(rv) & Exp_mask) - >> Exp_shift)) > 0) { - /* scaled rv is denormal; zap j low bits */ - if (j >= 32) { - word1(rv) = 0; - if (j >= 53) - word0(rv) = (P+2)*Exp_msk1; - else - word0(rv) &= 0xffffffff << (j-32); - } - else - word1(rv) &= 0xffffffff << j; - } -#else - for (j = 0; e1 > 1; j++, e1 >>= 1) - if (e1 & 1) - dval(rv) *= tinytens[j]; - /* The last multiplication could underflow. */ - dval(rv0) = dval(rv); - dval(rv) *= tinytens[j]; - if (!dval(rv)) { - dval(rv) = 2.*dval(rv0); - dval(rv) *= tinytens[j]; -#endif - if (!dval(rv)) { -undfl: - dval(rv) = 0.; -#ifndef NO_ERRNO - errno = ERANGE; -#endif - if (bd0) - goto retfree; - goto ret; - } -#ifndef Avoid_Underflow - word0(rv) = Tiny0; - word1(rv) = Tiny1; - /* The refinement below will clean - * this approximation up. - */ - } -#endif - } - } - - /* Now the hard part -- adjusting rv to the correct value.*/ - - /* Put digits into bd: true value = bd * 10^e */ - - bd0 = s2b(s0, nd0, nd, y); - - for (;;) { - bd = Balloc(bd0->k); - Bcopy(bd, bd0); - bb = d2b(dval(rv), &bbe, &bbbits); /* rv = bb * 2^bbe */ - bs = i2b(1); - - if (e >= 0) { - bb2 = bb5 = 0; - bd2 = bd5 = e; - } - else { - bb2 = bb5 = -e; - bd2 = bd5 = 0; - } - if (bbe >= 0) - bb2 += bbe; - else - bd2 -= bbe; - bs2 = bb2; -#ifdef Honor_FLT_ROUNDS - if (rounding != 1) - bs2++; -#endif -#ifdef Avoid_Underflow - j = bbe - scale; - i = j + bbbits - 1; /* logb(rv) */ - if (i < Emin) /* denormal */ - j += P - Emin; - else - j = P + 1 - bbbits; -#else /*Avoid_Underflow*/ -#ifdef Sudden_Underflow -#ifdef IBM - j = 1 + 4*P - 3 - bbbits + ((bbe + bbbits - 1) & 3); -#else - j = P + 1 - bbbits; -#endif -#else /*Sudden_Underflow*/ - j = bbe; - i = j + bbbits - 1; /* logb(rv) */ - if (i < Emin) /* denormal */ - j += P - Emin; - else - j = P + 1 - bbbits; -#endif /*Sudden_Underflow*/ -#endif /*Avoid_Underflow*/ - bb2 += j; - bd2 += j; -#ifdef Avoid_Underflow - bd2 += scale; -#endif - i = bb2 < bd2 ? bb2 : bd2; - if (i > bs2) - i = bs2; - if (i > 0) { - bb2 -= i; - bd2 -= i; - bs2 -= i; - } - if (bb5 > 0) { - bs = pow5mult(bs, bb5); - bb1 = mult(bs, bb); - Bfree(bb); - bb = bb1; - } - if (bb2 > 0) - bb = lshift(bb, bb2); - if (bd5 > 0) - bd = pow5mult(bd, bd5); - if (bd2 > 0) - bd = lshift(bd, bd2); - if (bs2 > 0) - bs = lshift(bs, bs2); - delta = diff(bb, bd); - dsign = delta->sign; - delta->sign = 0; - i = cmp(delta, bs); -#ifdef Honor_FLT_ROUNDS - if (rounding != 1) { - if (i < 0) { - /* Error is less than an ulp */ - if (!delta->x[0] && delta->wds <= 1) { - /* exact */ -#ifdef SET_INEXACT - inexact = 0; -#endif - break; - } - if (rounding) { - if (dsign) { - adj = 1.; - goto apply_adj; - } - } - else if (!dsign) { - adj = -1.; - if (!word1(rv) - && !(word0(rv) & Frac_mask)) { - y = word0(rv) & Exp_mask; -#ifdef Avoid_Underflow - if (!scale || y > 2*P*Exp_msk1) -#else - if (y) -#endif - { - delta = lshift(delta,Log2P); - if (cmp(delta, bs) <= 0) - adj = -0.5; - } - } -apply_adj: -#ifdef Avoid_Underflow - if (scale && (y = word0(rv) & Exp_mask) - <= 2*P*Exp_msk1) - word0(adj) += (2*P+1)*Exp_msk1 - y; -#else -#ifdef Sudden_Underflow - if ((word0(rv) & Exp_mask) <= - P*Exp_msk1) { - word0(rv) += P*Exp_msk1; - dval(rv) += adj*ulp(dval(rv)); - word0(rv) -= P*Exp_msk1; - } - else -#endif /*Sudden_Underflow*/ -#endif /*Avoid_Underflow*/ - dval(rv) += adj*ulp(dval(rv)); - } - break; - } - adj = ratio(delta, bs); - if (adj < 1.) - adj = 1.; - if (adj <= 0x7ffffffe) { - /* adj = rounding ? ceil(adj) : floor(adj); */ - y = adj; - if (y != adj) { - if (!((rounding>>1) ^ dsign)) - y++; - adj = y; - } - } -#ifdef Avoid_Underflow - if (scale && (y = word0(rv) & Exp_mask) <= 2*P*Exp_msk1) - word0(adj) += (2*P+1)*Exp_msk1 - y; -#else -#ifdef Sudden_Underflow - if ((word0(rv) & Exp_mask) <= P*Exp_msk1) { - word0(rv) += P*Exp_msk1; - adj *= ulp(dval(rv)); - if (dsign) - dval(rv) += adj; - else - dval(rv) -= adj; - word0(rv) -= P*Exp_msk1; - goto cont; - } -#endif /*Sudden_Underflow*/ -#endif /*Avoid_Underflow*/ - adj *= ulp(dval(rv)); - if (dsign) - dval(rv) += adj; - else - dval(rv) -= adj; - goto cont; - } -#endif /*Honor_FLT_ROUNDS*/ - - if (i < 0) { - /* Error is less than half an ulp -- check for - * special case of mantissa a power of two. - */ - if (dsign || word1(rv) || word0(rv) & Bndry_mask -#ifdef IEEE_Arith -#ifdef Avoid_Underflow - || (word0(rv) & Exp_mask) <= (2*P+1)*Exp_msk1 -#else - || (word0(rv) & Exp_mask) <= Exp_msk1 -#endif -#endif - ) { -#ifdef SET_INEXACT - if (!delta->x[0] && delta->wds <= 1) - inexact = 0; -#endif - break; - } - if (!delta->x[0] && delta->wds <= 1) { - /* exact result */ -#ifdef SET_INEXACT - inexact = 0; -#endif - break; - } - delta = lshift(delta,Log2P); - if (cmp(delta, bs) > 0) - goto drop_down; - break; - } - if (i == 0) { - /* exactly half-way between */ - if (dsign) { - if ((word0(rv) & Bndry_mask1) == Bndry_mask1 - && word1(rv) == ( -#ifdef Avoid_Underflow - (scale && (y = word0(rv) & Exp_mask) <= 2*P*Exp_msk1) - ? (0xffffffff & (0xffffffff << (2*P+1-(y>>Exp_shift)))) : -#endif - 0xffffffff)) { - /*boundary case -- increment exponent*/ - word0(rv) = (word0(rv) & Exp_mask) - + Exp_msk1 -#ifdef IBM - | Exp_msk1 >> 4 -#endif - ; - word1(rv) = 0; -#ifdef Avoid_Underflow - dsign = 0; -#endif - break; - } - } - else if (!(word0(rv) & Bndry_mask) && !word1(rv)) { -drop_down: - /* boundary case -- decrement exponent */ -#ifdef Sudden_Underflow /*{{*/ - L = word0(rv) & Exp_mask; -#ifdef IBM - if (L < Exp_msk1) -#else -#ifdef Avoid_Underflow - if (L <= (scale ? (2*P+1)*Exp_msk1 : Exp_msk1)) -#else - if (L <= Exp_msk1) -#endif /*Avoid_Underflow*/ -#endif /*IBM*/ - goto undfl; - L -= Exp_msk1; -#else /*Sudden_Underflow}{*/ -#ifdef Avoid_Underflow - if (scale) { - L = word0(rv) & Exp_mask; - if (L <= (2*P+1)*Exp_msk1) { - if (L > (P+2)*Exp_msk1) - /* round even ==> */ - /* accept rv */ - break; - /* rv = smallest denormal */ - goto undfl; - } - } -#endif /*Avoid_Underflow*/ - L = (word0(rv) & Exp_mask) - Exp_msk1; -#endif /*Sudden_Underflow}}*/ - word0(rv) = L | Bndry_mask1; - word1(rv) = 0xffffffff; -#ifdef IBM - goto cont; -#else - break; -#endif - } -#ifndef ROUND_BIASED - if (!(word1(rv) & LSB)) - break; -#endif - if (dsign) - dval(rv) += ulp(dval(rv)); -#ifndef ROUND_BIASED - else { - dval(rv) -= ulp(dval(rv)); -#ifndef Sudden_Underflow - if (!dval(rv)) - goto undfl; -#endif - } -#ifdef Avoid_Underflow - dsign = 1 - dsign; -#endif -#endif - break; - } - if ((aadj = ratio(delta, bs)) <= 2.) { - if (dsign) - aadj = aadj1 = 1.; - else if (word1(rv) || word0(rv) & Bndry_mask) { -#ifndef Sudden_Underflow - if (word1(rv) == Tiny1 && !word0(rv)) - goto undfl; -#endif - aadj = 1.; - aadj1 = -1.; - } - else { - /* special case -- power of FLT_RADIX to be */ - /* rounded down... */ - - if (aadj < 2./FLT_RADIX) - aadj = 1./FLT_RADIX; - else - aadj *= 0.5; - aadj1 = -aadj; - } - } - else { - aadj *= 0.5; - aadj1 = dsign ? aadj : -aadj; -#ifdef Check_FLT_ROUNDS - switch (Rounding) { - case 2: /* towards +infinity */ - aadj1 -= 0.5; - break; - case 0: /* towards 0 */ - case 3: /* towards -infinity */ - aadj1 += 0.5; - } -#else - if (Flt_Rounds == 0) - aadj1 += 0.5; -#endif /*Check_FLT_ROUNDS*/ - } - y = word0(rv) & Exp_mask; - - /* Check for overflow */ - - if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) { - dval(rv0) = dval(rv); - word0(rv) -= P*Exp_msk1; - adj = aadj1 * ulp(dval(rv)); - dval(rv) += adj; - if ((word0(rv) & Exp_mask) >= - Exp_msk1*(DBL_MAX_EXP+Bias-P)) { - if (word0(rv0) == Big0 && word1(rv0) == Big1) - goto ovfl; - word0(rv) = Big0; - word1(rv) = Big1; - goto cont; - } - else - word0(rv) += P*Exp_msk1; - } - else { -#ifdef Avoid_Underflow - if (scale && y <= 2*P*Exp_msk1) { - if (aadj <= 0x7fffffff) { - if ((z = aadj) <= 0) - z = 1; - aadj = z; - aadj1 = dsign ? aadj : -aadj; - } - word0(aadj1) += (2*P+1)*Exp_msk1 - y; - } - adj = aadj1 * ulp(dval(rv)); - dval(rv) += adj; -#else -#ifdef Sudden_Underflow - if ((word0(rv) & Exp_mask) <= P*Exp_msk1) { - dval(rv0) = dval(rv); - word0(rv) += P*Exp_msk1; - adj = aadj1 * ulp(dval(rv)); - dval(rv) += adj; -#ifdef IBM - if ((word0(rv) & Exp_mask) < P*Exp_msk1) -#else - if ((word0(rv) & Exp_mask) <= P*Exp_msk1) -#endif - { - if (word0(rv0) == Tiny0 && word1(rv0) == Tiny1) - goto undfl; - word0(rv) = Tiny0; - word1(rv) = Tiny1; - goto cont; - } - else - word0(rv) -= P*Exp_msk1; - } - else { - adj = aadj1 * ulp(dval(rv)); - dval(rv) += adj; - } -#else /*Sudden_Underflow*/ - /* Compute adj so that the IEEE rounding rules will - * correctly round rv + adj in some half-way cases. - * If rv * ulp(rv) is denormalized (i.e., - * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid - * trouble from bits lost to denormalization; - * example: 1.2e-307 . - */ - if (y <= (P-1)*Exp_msk1 && aadj > 1.) { - aadj1 = (double)(int)(aadj + 0.5); - if (!dsign) - aadj1 = -aadj1; - } - adj = aadj1 * ulp(dval(rv)); - dval(rv) += adj; -#endif /*Sudden_Underflow*/ -#endif /*Avoid_Underflow*/ - } - z = word0(rv) & Exp_mask; -#ifndef SET_INEXACT -#ifdef Avoid_Underflow - if (!scale) -#endif - if (y == z) { - /* Can we stop now? */ - L = (Long)aadj; - aadj -= L; - /* The tolerances below are conservative. */ - if (dsign || word1(rv) || word0(rv) & Bndry_mask) { - if (aadj < .4999999 || aadj > .5000001) - break; - } - else if (aadj < .4999999/FLT_RADIX) - break; - } -#endif -cont: - Bfree(bb); - Bfree(bd); - Bfree(bs); - Bfree(delta); - } -#ifdef SET_INEXACT - if (inexact) { - if (!oldinexact) { - word0(rv0) = Exp_1 + (70 << Exp_shift); - word1(rv0) = 0; - dval(rv0) += 1.; - } - } - else if (!oldinexact) - clear_inexact(); -#endif -#ifdef Avoid_Underflow - if (scale) { - word0(rv0) = Exp_1 - 2*P*Exp_msk1; - word1(rv0) = 0; - dval(rv) *= dval(rv0); -#ifndef NO_ERRNO - /* try to avoid the bug of testing an 8087 register value */ - if (word0(rv) == 0 && word1(rv) == 0) - errno = ERANGE; -#endif - } -#endif /* Avoid_Underflow */ -#ifdef SET_INEXACT - if (inexact && !(word0(rv) & Exp_mask)) { - /* set underflow bit */ - dval(rv0) = 1e-300; - dval(rv0) *= dval(rv0); - } -#endif -retfree: - Bfree(bb); - Bfree(bd); - Bfree(bs); - Bfree(bd0); - Bfree(delta); -ret: - if (se) - *se = (char *)s; - return sign ? -dval(rv) : dval(rv); -} - -static int -quorem(Bigint *b, Bigint *S) -{ - int n; - ULong *bx, *bxe, q, *sx, *sxe; -#ifdef ULLong - ULLong borrow, carry, y, ys; -#else - ULong borrow, carry, y, ys; -#ifdef Pack_32 - ULong si, z, zs; -#endif -#endif - - n = S->wds; -#ifdef DEBUG - /*debug*/ if (b->wds > n) - /*debug*/ Bug("oversize b in quorem"); -#endif - if (b->wds < n) - return 0; - sx = S->x; - sxe = sx + --n; - bx = b->x; - bxe = bx + n; - q = *bxe / (*sxe + 1); /* ensure q <= true quotient */ -#ifdef DEBUG - /*debug*/ if (q > 9) - /*debug*/ Bug("oversized quotient in quorem"); -#endif - if (q) { - borrow = 0; - carry = 0; - do { -#ifdef ULLong - ys = *sx++ * (ULLong)q + carry; - carry = ys >> 32; - y = *bx - (ys & FFFFFFFF) - borrow; - borrow = y >> 32 & (ULong)1; - *bx++ = y & FFFFFFFF; -#else -#ifdef Pack_32 - si = *sx++; - ys = (si & 0xffff) * q + carry; - zs = (si >> 16) * q + (ys >> 16); - carry = zs >> 16; - y = (*bx & 0xffff) - (ys & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - z = (*bx >> 16) - (zs & 0xffff) - borrow; - borrow = (z & 0x10000) >> 16; - Storeinc(bx, z, y); -#else - ys = *sx++ * q + carry; - carry = ys >> 16; - y = *bx - (ys & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - *bx++ = y & 0xffff; -#endif -#endif - } while (sx <= sxe); - if (!*bxe) { - bx = b->x; - while (--bxe > bx && !*bxe) - --n; - b->wds = n; - } - } - if (cmp(b, S) >= 0) { - q++; - borrow = 0; - carry = 0; - bx = b->x; - sx = S->x; - do { -#ifdef ULLong - ys = *sx++ + carry; - carry = ys >> 32; - y = *bx - (ys & FFFFFFFF) - borrow; - borrow = y >> 32 & (ULong)1; - *bx++ = y & FFFFFFFF; -#else -#ifdef Pack_32 - si = *sx++; - ys = (si & 0xffff) + carry; - zs = (si >> 16) + (ys >> 16); - carry = zs >> 16; - y = (*bx & 0xffff) - (ys & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - z = (*bx >> 16) - (zs & 0xffff) - borrow; - borrow = (z & 0x10000) >> 16; - Storeinc(bx, z, y); -#else - ys = *sx++ + carry; - carry = ys >> 16; - y = *bx - (ys & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - *bx++ = y & 0xffff; -#endif -#endif - } while (sx <= sxe); - bx = b->x; - bxe = bx + n; - if (!*bxe) { - while (--bxe > bx && !*bxe) - --n; - b->wds = n; - } - } - return q; -} - -#ifndef MULTIPLE_THREADS -static char *dtoa_result; -#endif - -static char * -rv_alloc(int i) -{ - int j, k, *r; - - j = sizeof(ULong); - for (k = 0; - sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= i; - j <<= 1) - k++; - r = (int*)Balloc(k); - *r = k; - return -#ifndef MULTIPLE_THREADS - dtoa_result = -#endif - (char *)(r+1); -} - -static char * -nrv_alloc(char *s, char **rve, int n) -{ - char *rv, *t; - - t = rv = rv_alloc(n); - while ((*t = *s++) != 0) t++; - if (rve) - *rve = t; - return rv; -} - -/* freedtoa(s) must be used to free values s returned by dtoa - * when MULTIPLE_THREADS is #defined. It should be used in all cases, - * but for consistency with earlier versions of dtoa, it is optional - * when MULTIPLE_THREADS is not defined. - */ - -void -freedtoa(char *s) -{ - Bigint *b = (Bigint *)((int *)s - 1); - b->maxwds = 1 << (b->k = *(int*)b); - Bfree(b); -#ifndef MULTIPLE_THREADS - if (s == dtoa_result) - dtoa_result = 0; -#endif -} - -/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string. - * - * Inspired by "How to Print Floating-Point Numbers Accurately" by - * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 112-126]. - * - * Modifications: - * 1. Rather than iterating, we use a simple numeric overestimate - * to determine k = floor(log10(d)). We scale relevant - * quantities using O(log2(k)) rather than O(k) multiplications. - * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't - * try to generate digits strictly left to right. Instead, we - * compute with fewer bits and propagate the carry if necessary - * when rounding the final digit up. This is often faster. - * 3. Under the assumption that input will be rounded nearest, - * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. - * That is, we allow equality in stopping tests when the - * round-nearest rule will give the same floating-point value - * as would satisfaction of the stopping test with strict - * inequality. - * 4. We remove common factors of powers of 2 from relevant - * quantities. - * 5. When converting floating-point integers less than 1e16, - * we use floating-point arithmetic rather than resorting - * to multiple-precision integers. - * 6. When asked to produce fewer than 15 digits, we first try - * to get by with floating-point arithmetic; we resort to - * multiple-precision integer arithmetic only if we cannot - * guarantee that the floating-point calculation has given - * the correctly rounded result. For k requested digits and - * "uniformly" distributed input, the probability is - * something like 10^(k-15) that we must resort to the Long - * calculation. - */ - -char * -dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) -{ - /* Arguments ndigits, decpt, sign are similar to those - of ecvt and fcvt; trailing zeros are suppressed from - the returned string. If not null, *rve is set to point - to the end of the return value. If d is +-Infinity or NaN, - then *decpt is set to 9999. - - mode: - 0 ==> shortest string that yields d when read in - and rounded to nearest. - 1 ==> like 0, but with Steele & White stopping rule; - e.g. with IEEE P754 arithmetic , mode 0 gives - 1e23 whereas mode 1 gives 9.999999999999999e22. - 2 ==> max(1,ndigits) significant digits. This gives a - return value similar to that of ecvt, except - that trailing zeros are suppressed. - 3 ==> through ndigits past the decimal point. This - gives a return value similar to that from fcvt, - except that trailing zeros are suppressed, and - ndigits can be negative. - 4,5 ==> similar to 2 and 3, respectively, but (in - round-nearest mode) with the tests of mode 0 to - possibly return a shorter string that rounds to d. - With IEEE arithmetic and compilation with - -DHonor_FLT_ROUNDS, modes 4 and 5 behave the same - as modes 2 and 3 when FLT_ROUNDS != 1. - 6-9 ==> Debugging modes similar to mode - 4: don't try - fast floating-point estimate (if applicable). - - Values of mode other than 0-9 are treated as mode 0. - - Sufficient space is allocated to the return value - to hold the suppressed trailing zeros. - */ - - int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1, - j, j1, k, k0, k_check, leftright, m2, m5, s2, s5, - spec_case, try_quick; - Long L; -#ifndef Sudden_Underflow - int denorm; - ULong x; -#endif - Bigint *b, *b1, *delta, *mlo, *mhi, *S; - double d2, ds, eps; - char *s, *s0; -#ifdef Honor_FLT_ROUNDS - int rounding; -#endif -#ifdef SET_INEXACT - int inexact, oldinexact; -#endif - -#ifndef MULTIPLE_THREADS - if (dtoa_result) { - freedtoa(dtoa_result); - dtoa_result = 0; - } -#endif - - if (word0(d) & Sign_bit) { - /* set sign for everything, including 0's and NaNs */ - *sign = 1; - word0(d) &= ~Sign_bit; /* clear sign bit */ - } - else - *sign = 0; - -#if defined(IEEE_Arith) + defined(VAX) -#ifdef IEEE_Arith - if ((word0(d) & Exp_mask) == Exp_mask) -#else - if (word0(d) == 0x8000) -#endif - { - /* Infinity or NaN */ - *decpt = 9999; -#ifdef IEEE_Arith - if (!word1(d) && !(word0(d) & 0xfffff)) - return nrv_alloc("Infinity", rve, 8); -#endif - return nrv_alloc("NaN", rve, 3); - } -#endif -#ifdef IBM - dval(d) += 0; /* normalize */ -#endif - if (!dval(d)) { - *decpt = 1; - return nrv_alloc("0", rve, 1); - } - -#ifdef SET_INEXACT - try_quick = oldinexact = get_inexact(); - inexact = 1; -#endif -#ifdef Honor_FLT_ROUNDS - if ((rounding = Flt_Rounds) >= 2) { - if (*sign) - rounding = rounding == 2 ? 0 : 2; - else - if (rounding != 2) - rounding = 0; - } -#endif - - b = d2b(dval(d), &be, &bbits); -#ifdef Sudden_Underflow - i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)); -#else - if ((i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1))) != 0) { -#endif - dval(d2) = dval(d); - word0(d2) &= Frac_mask1; - word0(d2) |= Exp_11; -#ifdef IBM - if (j = 11 - hi0bits(word0(d2) & Frac_mask)) - dval(d2) /= 1 << j; -#endif - - /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 - * log10(x) = log(x) / log(10) - * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) - * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2) - * - * This suggests computing an approximation k to log10(d) by - * - * k = (i - Bias)*0.301029995663981 - * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); - * - * We want k to be too large rather than too small. - * The error in the first-order Taylor series approximation - * is in our favor, so we just round up the constant enough - * to compensate for any error in the multiplication of - * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, - * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, - * adding 1e-13 to the constant term more than suffices. - * Hence we adjust the constant term to 0.1760912590558. - * (We could get a more accurate k by invoking log10, - * but this is probably not worthwhile.) - */ - - i -= Bias; -#ifdef IBM - i <<= 2; - i += j; -#endif -#ifndef Sudden_Underflow - denorm = 0; - } - else { - /* d is denormalized */ - - i = bbits + be + (Bias + (P-1) - 1); - x = i > 32 ? word0(d) << (64 - i) | word1(d) >> (i - 32) - : word1(d) << (32 - i); - dval(d2) = x; - word0(d2) -= 31*Exp_msk1; /* adjust exponent */ - i -= (Bias + (P-1) - 1) + 1; - denorm = 1; - } -#endif - ds = (dval(d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981; - k = (int)ds; - if (ds < 0. && ds != k) - k--; /* want k = floor(ds) */ - k_check = 1; - if (k >= 0 && k <= Ten_pmax) { - if (dval(d) < tens[k]) - k--; - k_check = 0; - } - j = bbits - i - 1; - if (j >= 0) { - b2 = 0; - s2 = j; - } - else { - b2 = -j; - s2 = 0; - } - if (k >= 0) { - b5 = 0; - s5 = k; - s2 += k; - } - else { - b2 -= k; - b5 = -k; - s5 = 0; - } - if (mode < 0 || mode > 9) - mode = 0; - -#ifndef SET_INEXACT -#ifdef Check_FLT_ROUNDS - try_quick = Rounding == 1; -#else - try_quick = 1; -#endif -#endif /*SET_INEXACT*/ - - if (mode > 5) { - mode -= 4; - try_quick = 0; - } - leftright = 1; - ilim = ilim1 = -1; - switch (mode) { - case 0: - case 1: - i = 18; - ndigits = 0; - break; - case 2: - leftright = 0; - /* no break */ - case 4: - if (ndigits <= 0) - ndigits = 1; - ilim = ilim1 = i = ndigits; - break; - case 3: - leftright = 0; - /* no break */ - case 5: - i = ndigits + k + 1; - ilim = i; - ilim1 = i - 1; - if (i <= 0) - i = 1; - } - s = s0 = rv_alloc(i+1); - -#ifdef Honor_FLT_ROUNDS - if (mode > 1 && rounding != 1) - leftright = 0; -#endif - - if (ilim >= 0 && ilim <= Quick_max && try_quick) { - - /* Try to get by with floating-point arithmetic. */ - - i = 0; - dval(d2) = dval(d); - k0 = k; - ilim0 = ilim; - ieps = 2; /* conservative */ - if (k > 0) { - ds = tens[k&0xf]; - j = k >> 4; - if (j & Bletch) { - /* prevent overflows */ - j &= Bletch - 1; - dval(d) /= bigtens[n_bigtens-1]; - ieps++; - } - for (; j; j >>= 1, i++) - if (j & 1) { - ieps++; - ds *= bigtens[i]; - } - dval(d) /= ds; - } - else if ((j1 = -k) != 0) { - dval(d) *= tens[j1 & 0xf]; - for (j = j1 >> 4; j; j >>= 1, i++) - if (j & 1) { - ieps++; - dval(d) *= bigtens[i]; - } - } - if (k_check && dval(d) < 1. && ilim > 0) { - if (ilim1 <= 0) - goto fast_failed; - ilim = ilim1; - k--; - dval(d) *= 10.; - ieps++; - } - dval(eps) = ieps*dval(d) + 7.; - word0(eps) -= (P-1)*Exp_msk1; - if (ilim == 0) { - S = mhi = 0; - dval(d) -= 5.; - if (dval(d) > dval(eps)) - goto one_digit; - if (dval(d) < -dval(eps)) - goto no_digits; - goto fast_failed; - } -#ifndef No_leftright - if (leftright) { - /* Use Steele & White method of only - * generating digits needed. - */ - dval(eps) = 0.5/tens[ilim-1] - dval(eps); - for (i = 0;;) { - L = dval(d); - dval(d) -= L; - *s++ = '0' + (int)L; - if (dval(d) < dval(eps)) - goto ret1; - if (1. - dval(d) < dval(eps)) - goto bump_up; - if (++i >= ilim) - break; - dval(eps) *= 10.; - dval(d) *= 10.; - } - } - else { -#endif - /* Generate ilim digits, then fix them up. */ - dval(eps) *= tens[ilim-1]; - for (i = 1;; i++, dval(d) *= 10.) { - L = (Long)(dval(d)); - if (!(dval(d) -= L)) - ilim = i; - *s++ = '0' + (int)L; - if (i == ilim) { - if (dval(d) > 0.5 + dval(eps)) - goto bump_up; - else if (dval(d) < 0.5 - dval(eps)) { - while (*--s == '0') ; - s++; - goto ret1; - } - break; - } - } -#ifndef No_leftright - } -#endif -fast_failed: - s = s0; - dval(d) = dval(d2); - k = k0; - ilim = ilim0; - } - - /* Do we have a "small" integer? */ - - if (be >= 0 && k <= Int_max) { - /* Yes. */ - ds = tens[k]; - if (ndigits < 0 && ilim <= 0) { - S = mhi = 0; - if (ilim < 0 || dval(d) <= 5*ds) - goto no_digits; - goto one_digit; - } - for (i = 1;; i++, dval(d) *= 10.) { - L = (Long)(dval(d) / ds); - dval(d) -= L*ds; -#ifdef Check_FLT_ROUNDS - /* If FLT_ROUNDS == 2, L will usually be high by 1 */ - if (dval(d) < 0) { - L--; - dval(d) += ds; - } -#endif - *s++ = '0' + (int)L; - if (!dval(d)) { -#ifdef SET_INEXACT - inexact = 0; -#endif - break; - } - if (i == ilim) { -#ifdef Honor_FLT_ROUNDS - if (mode > 1) - switch (rounding) { - case 0: goto ret1; - case 2: goto bump_up; - } -#endif - dval(d) += dval(d); - if (dval(d) > ds || (dval(d) == ds && (L & 1))) { -bump_up: - while (*--s == '9') - if (s == s0) { - k++; - *s = '0'; - break; - } - ++*s++; - } - break; - } - } - goto ret1; - } - - m2 = b2; - m5 = b5; - mhi = mlo = 0; - if (leftright) { - i = -#ifndef Sudden_Underflow - denorm ? be + (Bias + (P-1) - 1 + 1) : -#endif -#ifdef IBM - 1 + 4*P - 3 - bbits + ((bbits + be - 1) & 3); -#else - 1 + P - bbits; -#endif - b2 += i; - s2 += i; - mhi = i2b(1); - } - if (m2 > 0 && s2 > 0) { - i = m2 < s2 ? m2 : s2; - b2 -= i; - m2 -= i; - s2 -= i; - } - if (b5 > 0) { - if (leftright) { - if (m5 > 0) { - mhi = pow5mult(mhi, m5); - b1 = mult(mhi, b); - Bfree(b); - b = b1; - } - if ((j = b5 - m5) != 0) - b = pow5mult(b, j); - } - else - b = pow5mult(b, b5); - } - S = i2b(1); - if (s5 > 0) - S = pow5mult(S, s5); - - /* Check for special case that d is a normalized power of 2. */ - - spec_case = 0; - if ((mode < 2 || leftright) -#ifdef Honor_FLT_ROUNDS - && rounding == 1 -#endif - ) { - if (!word1(d) && !(word0(d) & Bndry_mask) -#ifndef Sudden_Underflow - && word0(d) & (Exp_mask & ~Exp_msk1) -#endif - ) { - /* The special case */ - b2 += Log2P; - s2 += Log2P; - spec_case = 1; - } - } - - /* Arrange for convenient computation of quotients: - * shift left if necessary so divisor has 4 leading 0 bits. - * - * Perhaps we should just compute leading 28 bits of S once - * and for all and pass them and a shift to quorem, so it - * can do shifts and ors to compute the numerator for q. - */ -#ifdef Pack_32 - if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f) != 0) - i = 32 - i; -#else - if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf) != 0) - i = 16 - i; -#endif - if (i > 4) { - i -= 4; - b2 += i; - m2 += i; - s2 += i; - } - else if (i < 4) { - i += 28; - b2 += i; - m2 += i; - s2 += i; - } - if (b2 > 0) - b = lshift(b, b2); - if (s2 > 0) - S = lshift(S, s2); - if (k_check) { - if (cmp(b,S) < 0) { - k--; - b = multadd(b, 10, 0); /* we botched the k estimate */ - if (leftright) - mhi = multadd(mhi, 10, 0); - ilim = ilim1; - } - } - if (ilim <= 0 && (mode == 3 || mode == 5)) { - if (ilim < 0 || cmp(b,S = multadd(S,5,0)) <= 0) { - /* no digits, fcvt style */ -no_digits: - k = -1 - ndigits; - goto ret; - } -one_digit: - *s++ = '1'; - k++; - goto ret; - } - if (leftright) { - if (m2 > 0) - mhi = lshift(mhi, m2); - - /* Compute mlo -- check for special case - * that d is a normalized power of 2. - */ - - mlo = mhi; - if (spec_case) { - mhi = Balloc(mhi->k); - Bcopy(mhi, mlo); - mhi = lshift(mhi, Log2P); - } - - for (i = 1;;i++) { - dig = quorem(b,S) + '0'; - /* Do we yet have the shortest decimal string - * that will round to d? - */ - j = cmp(b, mlo); - delta = diff(S, mhi); - j1 = delta->sign ? 1 : cmp(b, delta); - Bfree(delta); -#ifndef ROUND_BIASED - if (j1 == 0 && mode != 1 && !(word1(d) & 1) -#ifdef Honor_FLT_ROUNDS - && rounding >= 1 -#endif - ) { - if (dig == '9') - goto round_9_up; - if (j > 0) - dig++; -#ifdef SET_INEXACT - else if (!b->x[0] && b->wds <= 1) - inexact = 0; -#endif - *s++ = dig; - goto ret; - } -#endif - if (j < 0 || (j == 0 && mode != 1 -#ifndef ROUND_BIASED - && !(word1(d) & 1) -#endif - )) { - if (!b->x[0] && b->wds <= 1) { -#ifdef SET_INEXACT - inexact = 0; -#endif - goto accept_dig; - } -#ifdef Honor_FLT_ROUNDS - if (mode > 1) - switch (rounding) { - case 0: goto accept_dig; - case 2: goto keep_dig; - } -#endif /*Honor_FLT_ROUNDS*/ - if (j1 > 0) { - b = lshift(b, 1); - j1 = cmp(b, S); - if ((j1 > 0 || (j1 == 0 && (dig & 1))) && dig++ == '9') - goto round_9_up; - } -accept_dig: - *s++ = dig; - goto ret; - } - if (j1 > 0) { -#ifdef Honor_FLT_ROUNDS - if (!rounding) - goto accept_dig; -#endif - if (dig == '9') { /* possible if i == 1 */ -round_9_up: - *s++ = '9'; - goto roundoff; - } - *s++ = dig + 1; - goto ret; - } -#ifdef Honor_FLT_ROUNDS -keep_dig: -#endif - *s++ = dig; - if (i == ilim) - break; - b = multadd(b, 10, 0); - if (mlo == mhi) - mlo = mhi = multadd(mhi, 10, 0); - else { - mlo = multadd(mlo, 10, 0); - mhi = multadd(mhi, 10, 0); - } - } - } - else - for (i = 1;; i++) { - *s++ = dig = quorem(b,S) + '0'; - if (!b->x[0] && b->wds <= 1) { -#ifdef SET_INEXACT - inexact = 0; -#endif - goto ret; - } - if (i >= ilim) - break; - b = multadd(b, 10, 0); - } - - /* Round off last digit */ - -#ifdef Honor_FLT_ROUNDS - switch (rounding) { - case 0: goto trimzeros; - case 2: goto roundoff; - } -#endif - b = lshift(b, 1); - j = cmp(b, S); - if (j > 0 || (j == 0 && (dig & 1))) { - roundoff: - while (*--s == '9') - if (s == s0) { - k++; - *s++ = '1'; - goto ret; - } - ++*s++; - } - else { - while (*--s == '0') ; - s++; - } -ret: - Bfree(S); - if (mhi) { - if (mlo && mlo != mhi) - Bfree(mlo); - Bfree(mhi); - } -ret1: -#ifdef SET_INEXACT - if (inexact) { - if (!oldinexact) { - word0(d) = Exp_1 + (70 << Exp_shift); - word1(d) = 0; - dval(d) += 1.; - } - } - else if (!oldinexact) - clear_inexact(); -#endif - Bfree(b); - *s = 0; - *decpt = k + 1; - if (rve) - *rve = s; - return s0; -} - -void -ruby_each_words(const char *str, void (*func)(const char*, int, void*), void *arg) -{ - const char *end; - int len; - - if (!str) return; - for (; *str; str = end) { - while (ISSPACE(*str) || *str == ',') str++; - if (!*str) break; - end = str; - while (*end && !ISSPACE(*end) && *end != ',') end++; - len = end - str; - (*func)(str, len, arg); - } -} - -#ifdef __cplusplus -} -#endif -/********************************************************************** - - variable.c - - - $Author: shyouhei $ - $Date: 2009-02-02 03:34:12 +0100 (Mon, 02 Feb 2009) $ - created at: Tue Apr 19 23:55:15 JST 1994 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -#include "ruby.h" -#include "env.h" -#include "node.h" -#include "st.h" -#include "util.h" - -st_table *rb_global_tbl; -st_table *rb_class_tbl; -static ID autoload, classpath, tmp_classpath; - -void -Init_var_tables() -{ - rb_global_tbl = st_init_numtable(); - rb_class_tbl = st_init_numtable(); - autoload = rb_intern("__autoload__"); - classpath = rb_intern("__classpath__"); - tmp_classpath = rb_intern("__tmp_classpath__"); -} - -struct fc_result { - ID name; - VALUE klass; - VALUE path; - VALUE track; - struct fc_result *prev; -}; - -static VALUE -fc_path(fc, name) - struct fc_result *fc; - ID name; -{ - VALUE path, tmp; - - path = rb_str_new2(rb_id2name(name)); - while (fc) { - if (fc->track == rb_cObject) break; - if (ROBJECT(fc->track)->iv_tbl && - st_lookup(ROBJECT(fc->track)->iv_tbl, classpath, &tmp)) { - tmp = rb_str_dup(tmp); - rb_str_cat2(tmp, "::"); - rb_str_append(tmp, path); - - return tmp; - } - tmp = rb_str_new2(rb_id2name(fc->name)); - rb_str_cat2(tmp, "::"); - rb_str_append(tmp, path); - path = tmp; - fc = fc->prev; - } - return path; -} - -static int -fc_i(key, value, res) - ID key; - VALUE value; - struct fc_result *res; -{ - if (!rb_is_const_id(key)) return ST_CONTINUE; - - if (value == res->klass) { - res->path = fc_path(res, key); - return ST_STOP; - } - switch (TYPE(value)) { - case T_MODULE: - case T_CLASS: - if (!RCLASS(value)->iv_tbl) return ST_CONTINUE; - else { - struct fc_result arg; - struct fc_result *list; - - list = res; - while (list) { - if (list->track == value) return ST_CONTINUE; - list = list->prev; - } - - arg.name = key; - arg.path = 0; - arg.klass = res->klass; - arg.track = value; - arg.prev = res; - st_foreach_safe(RCLASS(value)->iv_tbl, fc_i, (st_data_t)&arg); - if (arg.path) { - res->path = arg.path; - return ST_STOP; - } - } - break; - - default: - break; - } - return ST_CONTINUE; -} - -static VALUE -find_class_path(klass) - VALUE klass; -{ - struct fc_result arg; - - arg.name = 0; - arg.path = 0; - arg.klass = klass; - arg.track = rb_cObject; - arg.prev = 0; - if (RCLASS(rb_cObject)->iv_tbl) { - st_foreach_safe(RCLASS(rb_cObject)->iv_tbl, fc_i, (st_data_t)&arg); - } - if (arg.path == 0) { - st_foreach(rb_class_tbl, fc_i, (st_data_t)&arg); - } - if (arg.path) { - if (!ROBJECT(klass)->iv_tbl) { - ROBJECT(klass)->iv_tbl = st_init_numtable(); - } - st_insert(ROBJECT(klass)->iv_tbl, classpath, arg.path); - st_delete(RCLASS(klass)->iv_tbl, &tmp_classpath, 0); - return arg.path; - } - return Qnil; -} - -static VALUE -classname(klass) - VALUE klass; -{ - VALUE path = Qnil; - - if (!klass) klass = rb_cObject; - if (ROBJECT(klass)->iv_tbl) { - if (!st_lookup(ROBJECT(klass)->iv_tbl, classpath, &path)) { - ID classid = rb_intern("__classid__"); - - if (!st_lookup(ROBJECT(klass)->iv_tbl, classid, &path)) { - return find_class_path(klass); - } - path = rb_str_new2(rb_id2name(SYM2ID(path))); - st_insert(ROBJECT(klass)->iv_tbl, classpath, path); - st_delete(RCLASS(klass)->iv_tbl, (st_data_t*)&classid, 0); - } - if (TYPE(path) != T_STRING) { - rb_bug("class path is not set properly"); - } - return path; - } - return find_class_path(klass); -} - -/* - * call-seq: - * mod.name => string - * - * Returns the name of the module mod. - */ - -VALUE -rb_mod_name(mod) - VALUE mod; -{ - VALUE path = classname(mod); - - if (!NIL_P(path)) return rb_str_dup(path); - return rb_str_new(0,0); -} - -VALUE -rb_class_path(klass) - VALUE klass; -{ - VALUE path = classname(klass); - - if (!NIL_P(path)) return path; - if (RCLASS(klass)->iv_tbl && st_lookup(RCLASS(klass)->iv_tbl, - tmp_classpath, &path)) { - return path; - } - else { - char *s = "Class"; - size_t len; - - if (TYPE(klass) == T_MODULE) { - if (rb_obj_class(klass) == rb_cModule) { - s = "Module"; - } - else { - s = rb_class2name(RBASIC(klass)->klass); - } - } - len = 2 + strlen(s) + 3 + 2 * SIZEOF_LONG + 1; - path = rb_str_new(0, len); - snprintf(RSTRING(path)->ptr, len+1, "#<%s:0x%lx>", s, klass); - RSTRING(path)->len = strlen(RSTRING(path)->ptr); - rb_ivar_set(klass, tmp_classpath, path); - - return path; - } -} - -void -rb_set_class_path(klass, under, name) - VALUE klass, under; - const char *name; -{ - VALUE str; - - if (under == rb_cObject) { - str = rb_str_new2(name); - } - else { - str = rb_str_dup(rb_class_path(under)); - rb_str_cat2(str, "::"); - rb_str_cat2(str, name); - } - rb_ivar_set(klass, classpath, str); -} - -VALUE -rb_path2class(path) - const char *path; -{ - const char *pbeg, *p; - ID id; - VALUE c = rb_cObject; - VALUE str = 0; - - if (path[0] == '#') { - rb_raise(rb_eArgError, "can't retrieve anonymous class %s", path); - } - pbeg = p = path; - while (*p) { - while (*p && *p != ':') p++; - if (str) { - RSTRING(str)->len = 0; - rb_str_cat(str, pbeg, p-pbeg); - } - else { - str = rb_str_new(pbeg, p-pbeg); - } - id = rb_intern(RSTRING(str)->ptr); - if (p[0] == ':') { - if (p[1] != ':') goto undefined_class; - p += 2; - pbeg = p; - } - if (!rb_const_defined(c, id)) { - undefined_class: - rb_raise(rb_eArgError, "undefined class/module %.*s", p-path, path); - } - c = rb_const_get_at(c, id); - switch (TYPE(c)) { - case T_MODULE: - case T_CLASS: - break; - default: - rb_raise(rb_eTypeError, "%s does not refer class/module", path); - } - } - - return c; -} - -void -rb_name_class(klass, id) - VALUE klass; - ID id; -{ - rb_iv_set(klass, "__classid__", ID2SYM(id)); -} - -VALUE -rb_class_name(klass) - VALUE klass; -{ - return rb_class_path(rb_class_real(klass)); -} - -char * -rb_class2name(klass) - VALUE klass; -{ - return RSTRING(rb_class_name(klass))->ptr; -} - -char * -rb_obj_classname(obj) - VALUE obj; -{ - return rb_class2name(CLASS_OF(obj)); -} - -struct trace_var { - int removed; - void (*func)(); - VALUE data; - struct trace_var *next; -}; - -struct global_variable { - int counter; - void *data; - VALUE (*getter)(); - void (*setter)(); - void (*marker)(); - int block_trace; - struct trace_var *trace; -}; - -struct global_entry { - struct global_variable *var; - ID id; -}; - -static VALUE undef_getter(); -static void undef_setter(); -static void undef_marker(); - -static VALUE val_getter(); -static void val_setter(); -static void val_marker(); - -static VALUE var_getter(); -static void var_setter(); -static void var_marker(); - -struct global_entry* -rb_global_entry(id) - ID id; -{ - struct global_entry *entry; - - if (!st_lookup(rb_global_tbl, id, (st_data_t *)&entry)) { - struct global_variable *var; - entry = ALLOC(struct global_entry); - var = ALLOC(struct global_variable); - entry->id = id; - entry->var = var; - var->counter = 1; - var->data = 0; - var->getter = undef_getter; - var->setter = undef_setter; - var->marker = undef_marker; - - var->block_trace = 0; - var->trace = 0; - st_add_direct(rb_global_tbl, id, (st_data_t)entry); - } - return entry; -} - -static VALUE -undef_getter(id) - ID id; -{ - rb_warning("global variable `%s' not initialized", rb_id2name(id)); - - return Qnil; -} - -static void -undef_setter(val, id, data, var) - VALUE val; - ID id; - void *data; - struct global_variable *var; -{ - var->getter = val_getter; - var->setter = val_setter; - var->marker = val_marker; - - var->data = (void*)val; -} - -static void -undef_marker() -{ -} - -static VALUE -val_getter(id, val) - ID id; - VALUE val; -{ - return val; -} - -static void -val_setter(val, id, data, var) - VALUE val; - ID id; - void *data; - struct global_variable *var; -{ - var->data = (void*)val; -} - -static void -val_marker(data) - VALUE data; -{ - if (data) rb_gc_mark_maybe(data); -} - -static VALUE -var_getter(id, var) - ID id; - VALUE *var; -{ - if (!var) return Qnil; - return *var; -} - -static void -var_setter(val, id, var) - VALUE val; - ID id; - VALUE *var; -{ - *var = val; -} - -static void -var_marker(var) - VALUE *var; -{ - if (var) rb_gc_mark_maybe(*var); -} - -static void -readonly_setter(val, id, var) - VALUE val; - ID id; - void *var; -{ - rb_name_error(id, "%s is a read-only variable", rb_id2name(id)); -} - -static int -mark_global_entry(key, entry) - ID key; - struct global_entry *entry; -{ - struct trace_var *trace; - struct global_variable *var = entry->var; - - (*var->marker)(var->data); - trace = var->trace; - while (trace) { - if (trace->data) rb_gc_mark_maybe(trace->data); - trace = trace->next; - } - return ST_CONTINUE; -} - -void -rb_gc_mark_global_tbl() -{ - if (rb_global_tbl) { - st_foreach(rb_global_tbl, mark_global_entry, 0); - } -} - -static ID -global_id(name) - const char *name; -{ - ID id; - - if (name[0] == '$') id = rb_intern(name); - else { - char *buf = ALLOCA_N(char, strlen(name)+2); - buf[0] = '$'; - strcpy(buf+1, name); - id = rb_intern(buf); - } - return id; -} - -void -rb_define_hooked_variable(name, var, getter, setter) - const char *name; - VALUE *var; - VALUE (*getter)(); - void (*setter)(); -{ - struct global_variable *gvar; - ID id = global_id(name); - - gvar = rb_global_entry(id)->var; - gvar->data = (void*)var; - gvar->getter = getter?getter:var_getter; - gvar->setter = setter?setter:var_setter; - gvar->marker = var_marker; -} - -void -rb_define_variable(name, var) - const char *name; - VALUE *var; -{ - rb_define_hooked_variable(name, var, 0, 0); -} - -void -rb_define_readonly_variable(name, var) - const char *name; - VALUE *var; -{ - rb_define_hooked_variable(name, var, 0, readonly_setter); -} - -void -rb_define_virtual_variable(name, getter, setter) - const char *name; - VALUE (*getter)(); - void (*setter)(); -{ - if (!getter) getter = val_getter; - if (!setter) setter = readonly_setter; - rb_define_hooked_variable(name, 0, getter, setter); -} - -static void -rb_trace_eval(cmd, val) - VALUE cmd, val; -{ - rb_eval_cmd(cmd, rb_ary_new3(1, val), 0); -} - -/* - * call-seq: - * trace_var(symbol, cmd ) => nil - * trace_var(symbol) {|val| block } => nil - * - * Controls tracing of assignments to global variables. The parameter - * +symbol_ identifies the variable (as either a string name or a - * symbol identifier). _cmd_ (which may be a string or a - * +Proc+ object) or block is executed whenever the variable - * is assigned. The block or +Proc+ object receives the - * variable's new value as a parameter. Also see - * Kernel::untrace_var. - * - * trace_var :$_, proc {|v| puts "$_ is now '#{v}'" } - * $_ = "hello" - * $_ = ' there' - * - * produces: - * - * $_ is now 'hello' - * $_ is now ' there' - */ - -VALUE -rb_f_trace_var(argc, argv) - int argc; - VALUE *argv; -{ - VALUE var, cmd; - struct global_entry *entry; - struct trace_var *trace; - - rb_secure(4); - if (rb_scan_args(argc, argv, "11", &var, &cmd) == 1) { - cmd = rb_block_proc(); - } - if (NIL_P(cmd)) { - return rb_f_untrace_var(argc, argv); - } - entry = rb_global_entry(rb_to_id(var)); - if (OBJ_TAINTED(cmd)) { - rb_raise(rb_eSecurityError, "Insecure: tainted variable trace"); - } - trace = ALLOC(struct trace_var); - trace->next = entry->var->trace; - trace->func = rb_trace_eval; - trace->data = cmd; - trace->removed = 0; - entry->var->trace = trace; - - return Qnil; -} - -static void -remove_trace(var) - struct global_variable *var; -{ - struct trace_var *trace = var->trace; - struct trace_var t; - struct trace_var *next; - - t.next = trace; - trace = &t; - while (trace->next) { - next = trace->next; - if (next->removed) { - trace->next = next->next; - free(next); - } - else { - trace = next; - } - } - var->trace = t.next; -} - -/* - * call-seq: - * untrace_var(symbol [, cmd] ) => array or nil - * - * Removes tracing for the specified command on the given global - * variable and returns +nil+. If no command is specified, - * removes all tracing for that variable and returns an array - * containing the commands actually removed. - */ - -VALUE -rb_f_untrace_var(argc, argv) - int argc; - VALUE *argv; -{ - VALUE var, cmd; - ID id; - struct global_entry *entry; - struct trace_var *trace; - - rb_secure(4); - rb_scan_args(argc, argv, "11", &var, &cmd); - id = rb_to_id(var); - if (!st_lookup(rb_global_tbl, id, (st_data_t *)&entry)) { - rb_name_error(id, "undefined global variable %s", rb_id2name(id)); - } - - trace = entry->var->trace; - if (NIL_P(cmd)) { - VALUE ary = rb_ary_new(); - - while (trace) { - struct trace_var *next = trace->next; - rb_ary_push(ary, (VALUE)trace->data); - trace->removed = 1; - trace = next; - } - - if (!entry->var->block_trace) remove_trace(entry->var); - return ary; - } - else { - while (trace) { - if (trace->data == cmd) { - trace->removed = 1; - if (!entry->var->block_trace) remove_trace(entry->var); - return rb_ary_new3(1, cmd); - } - trace = trace->next; - } - } - return Qnil; -} - -VALUE -rb_gvar_get(entry) - struct global_entry *entry; -{ - struct global_variable *var = entry->var; - return (*var->getter)(entry->id, var->data, var); -} - -struct trace_data { - struct trace_var *trace; - VALUE val; -}; - -static VALUE -trace_ev(data) - struct trace_data *data; -{ - struct trace_var *trace = data->trace; - - while (trace) { - (*trace->func)(trace->data, data->val); - trace = trace->next; - } - return Qnil; /* not reached */ -} - -static VALUE -trace_en(var) - struct global_variable *var; -{ - var->block_trace = 0; - remove_trace(var); - return Qnil; /* not reached */ -} - -VALUE -rb_gvar_set(entry, val) - struct global_entry *entry; - VALUE val; -{ - struct trace_data trace; - struct global_variable *var = entry->var; - - if (rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't change global variable value"); - (*var->setter)(val, entry->id, var->data, var); - - if (var->trace && !var->block_trace) { - var->block_trace = 1; - trace.trace = var->trace; - trace.val = val; - rb_ensure(trace_ev, (VALUE)&trace, trace_en, (VALUE)var); - } - return val; -} - -VALUE -rb_gv_set(name, val) - const char *name; - VALUE val; -{ - struct global_entry *entry; - - entry = rb_global_entry(global_id(name)); - return rb_gvar_set(entry, val); -} - -VALUE -rb_gv_get(name) - const char *name; -{ - struct global_entry *entry; - - entry = rb_global_entry(global_id(name)); - return rb_gvar_get(entry); -} - -VALUE -rb_gvar_defined(entry) - struct global_entry *entry; -{ - if (entry->var->getter == undef_getter) return Qfalse; - return Qtrue; -} - -static int -gvar_i(key, entry, ary) - ID key; - struct global_entry *entry; - VALUE ary; -{ - rb_ary_push(ary, rb_str_new2(rb_id2name(key))); - return ST_CONTINUE; -} - -/* - * call-seq: - * global_variables => array - * - * Returns an array of the names of global variables. - * - * global_variables.grep /std/ #=> ["$stderr", "$stdout", "$stdin"] - */ - -VALUE -rb_f_global_variables() -{ - VALUE ary = rb_ary_new(); - char buf[4]; - char *s = "&`'+123456789"; - - st_foreach(rb_global_tbl, gvar_i, ary); - if (!NIL_P(rb_backref_get())) { - while (*s) { - sprintf(buf, "$%c", *s++); - rb_ary_push(ary, rb_str_new2(buf)); - } - } - return ary; -} - -void -rb_alias_variable(name1, name2) - ID name1; - ID name2; -{ - struct global_entry *entry1, *entry2; - - if (rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't alias global variable"); - - entry2 = rb_global_entry(name2); - if (!st_lookup(rb_global_tbl, name1, (st_data_t *)&entry1)) { - entry1 = ALLOC(struct global_entry); - entry1->id = name1; - st_add_direct(rb_global_tbl, name1, (st_data_t)entry1); - } - else if (entry1->var != entry2->var) { - struct global_variable *var = entry1->var; - if (var->block_trace) { - rb_raise(rb_eRuntimeError, "can't alias in tracer"); - } - var->counter--; - if (var->counter == 0) { - struct trace_var *trace = var->trace; - while (trace) { - struct trace_var *next = trace->next; - free(trace); - trace = next; - } - free(var); - } - } - else { - return; - } - entry2->var->counter++; - entry1->var = entry2->var; -} - -static int special_generic_ivar = 0; -static st_table *generic_iv_tbl; - -st_table* -rb_generic_ivar_table(obj) - VALUE obj; -{ - st_table *tbl; - - if (!FL_TEST(obj, FL_EXIVAR)) return 0; - if (!generic_iv_tbl) return 0; - if (!st_lookup(generic_iv_tbl, obj, (st_data_t *)&tbl)) return 0; - return tbl; -} - -static VALUE -generic_ivar_get(obj, id, warn) - VALUE obj; - ID id; - int warn; -{ - st_table *tbl; - VALUE val; - - if (generic_iv_tbl) { - if (st_lookup(generic_iv_tbl, obj, (st_data_t *)&tbl)) { - if (st_lookup(tbl, id, &val)) { - return val; - } - } - } - if (warn) { - rb_warning("instance variable %s not initialized", rb_id2name(id)); - } - return Qnil; -} - -static void -generic_ivar_set(obj, id, val) - VALUE obj; - ID id; - VALUE val; -{ - st_table *tbl; - - if (rb_special_const_p(obj)) { - special_generic_ivar = 1; - } - if (!generic_iv_tbl) { - generic_iv_tbl = st_init_numtable(); - } - - if (!st_lookup(generic_iv_tbl, obj, (st_data_t *)&tbl)) { - FL_SET(obj, FL_EXIVAR); - tbl = st_init_numtable(); - st_add_direct(generic_iv_tbl, obj, (st_data_t)tbl); - st_add_direct(tbl, id, val); - return; - } - st_insert(tbl, id, val); -} - -static VALUE -generic_ivar_defined(obj, id) - VALUE obj; - ID id; -{ - st_table *tbl; - VALUE val; - - if (!generic_iv_tbl) return Qfalse; - if (!st_lookup(generic_iv_tbl, obj, (st_data_t *)&tbl)) return Qfalse; - if (st_lookup(tbl, id, &val)) { - return Qtrue; - } - return Qfalse; -} - -static int -generic_ivar_remove(obj, id, valp) - VALUE obj; - ID id; - VALUE *valp; -{ - st_table *tbl; - int status; - - if (!generic_iv_tbl) return 0; - if (!st_lookup(generic_iv_tbl, obj, (st_data_t *)&tbl)) return 0; - status = st_delete(tbl, &id, valp); - if (tbl->num_entries == 0) { - st_delete(generic_iv_tbl, &obj, (st_data_t *)&tbl); - st_free_table(tbl); - } - return status; -} - -void -rb_mark_generic_ivar(obj) - VALUE obj; -{ - st_table *tbl; - - if (!generic_iv_tbl) return; - if (st_lookup(generic_iv_tbl, obj, (st_data_t *)&tbl)) { - rb_mark_tbl(tbl); - } -} - -static int -givar_mark_i(key, value) - ID key; - VALUE value; -{ - rb_gc_mark(value); - return ST_CONTINUE; -} - -static int -givar_i(obj, tbl) - VALUE obj; - st_table *tbl; -{ - if (rb_special_const_p(obj)) { - st_foreach(tbl, givar_mark_i, 0); - } - return ST_CONTINUE; -} - -void -rb_mark_generic_ivar_tbl() -{ - if (!generic_iv_tbl) return; - if (special_generic_ivar == 0) return; - st_foreach_safe(generic_iv_tbl, givar_i, 0); -} - -void -rb_free_generic_ivar(obj) - VALUE obj; -{ - st_table *tbl; - - if (st_delete(generic_iv_tbl, &obj, (st_data_t *)&tbl)) - st_free_table(tbl); -} - -void -rb_copy_generic_ivar(clone, obj) - VALUE clone, obj; -{ - st_table *tbl; - - if (!generic_iv_tbl) return; - if (st_lookup(generic_iv_tbl, obj, (st_data_t *)&tbl)) { - st_table *old; - - if (st_lookup(generic_iv_tbl, clone, (st_data_t *)&old)) { - st_free_table(old); - st_insert(generic_iv_tbl, clone, (st_data_t)st_copy(tbl)); - } - else { - st_add_direct(generic_iv_tbl, clone, (st_data_t)st_copy(tbl)); - } - } -} - -static VALUE -ivar_get(obj, id, warn) - VALUE obj; - ID id; - int warn; -{ - VALUE val; - - switch (TYPE(obj)) { - case T_OBJECT: - case T_CLASS: - case T_MODULE: - if (ROBJECT(obj)->iv_tbl && st_lookup(ROBJECT(obj)->iv_tbl, id, &val)) - return val; - break; - default: - if (FL_TEST(obj, FL_EXIVAR) || rb_special_const_p(obj)) - return generic_ivar_get(obj, id, warn); - break; - } - if (warn) { - rb_warning("instance variable %s not initialized", rb_id2name(id)); - } - return Qnil; -} - -VALUE -rb_ivar_get(obj, id) - VALUE obj; - ID id; -{ - return ivar_get(obj, id, Qtrue); -} - -VALUE -rb_attr_get(obj, id) - VALUE obj; - ID id; -{ - return ivar_get(obj, id, Qfalse); -} - -VALUE -rb_ivar_set(obj, id, val) - VALUE obj; - ID id; - VALUE val; -{ - if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't modify instance variable"); - if (OBJ_FROZEN(obj)) rb_error_frozen("object"); - switch (TYPE(obj)) { - case T_OBJECT: - case T_CLASS: - case T_MODULE: - if (!ROBJECT(obj)->iv_tbl) ROBJECT(obj)->iv_tbl = st_init_numtable(); - st_insert(ROBJECT(obj)->iv_tbl, id, val); - break; - default: - generic_ivar_set(obj, id, val); - break; - } - return val; -} - -VALUE -rb_ivar_defined(obj, id) - VALUE obj; - ID id; -{ - switch (TYPE(obj)) { - case T_OBJECT: - case T_CLASS: - case T_MODULE: - if (ROBJECT(obj)->iv_tbl && st_lookup(ROBJECT(obj)->iv_tbl, id, 0)) - return Qtrue; - break; - default: - if (FL_TEST(obj, FL_EXIVAR) || rb_special_const_p(obj)) - return generic_ivar_defined(obj, id); - break; - } - return Qfalse; -} - -static int -ivar_i(key, entry, ary) - ID key; - struct global_entry *entry; - VALUE ary; -{ - if (rb_is_instance_id(key)) { - rb_ary_push(ary, rb_str_new2(rb_id2name(key))); - } - return ST_CONTINUE; -} - -/* - * call-seq: - * obj.instance_variables => array - * - * Returns an array of instance variable names for the receiver. Note - * that simply defining an accessor does not create the corresponding - * instance variable. - * - * class Fred - * attr_accessor :a1 - * def initialize - * @iv = 3 - * end - * end - * Fred.new.instance_variables #=> ["@iv"] - */ - -VALUE -rb_obj_instance_variables(obj) - VALUE obj; -{ - VALUE ary; - - ary = rb_ary_new(); - switch (TYPE(obj)) { - case T_OBJECT: - case T_CLASS: - case T_MODULE: - if (ROBJECT(obj)->iv_tbl) { - st_foreach_safe(ROBJECT(obj)->iv_tbl, ivar_i, ary); - } - break; - default: - if (!generic_iv_tbl) break; - if (FL_TEST(obj, FL_EXIVAR) || rb_special_const_p(obj)) { - st_table *tbl; - - if (st_lookup(generic_iv_tbl, obj, (st_data_t *)&tbl)) { - st_foreach_safe(tbl, ivar_i, ary); - } - } - break; - } - return ary; -} - -/* - * call-seq: - * obj.remove_instance_variable(symbol) => obj - * - * Removes the named instance variable from obj, returning that - * variable's value. - * - * class Dummy - * attr_reader :var - * def initialize - * @var = 99 - * end - * def remove - * remove_instance_variable(:@var) - * end - * end - * d = Dummy.new - * d.var #=> 99 - * d.remove #=> 99 - * d.var #=> nil - */ - -VALUE -rb_obj_remove_instance_variable(obj, name) - VALUE obj, name; -{ - VALUE val = Qnil; - ID id = rb_to_id(name); - - if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't modify instance variable"); - if (OBJ_FROZEN(obj)) rb_error_frozen("object"); - if (!rb_is_instance_id(id)) { - rb_name_error(id, "`%s' is not allowed as an instance variable name", rb_id2name(id)); - } - - switch (TYPE(obj)) { - case T_OBJECT: - case T_CLASS: - case T_MODULE: - if (ROBJECT(obj)->iv_tbl && st_delete(ROBJECT(obj)->iv_tbl, (st_data_t*)&id, &val)) { - return val; - } - break; - default: - if (FL_TEST(obj, FL_EXIVAR) || rb_special_const_p(obj)) { - if (generic_ivar_remove(obj, id, &val)) { - return val; - } - } - break; - } - rb_name_error(id, "instance variable %s not defined", rb_id2name(id)); - return Qnil; /* not reached */ -} - -NORETURN(static void uninitialized_constant _((VALUE, ID))); -static void -uninitialized_constant(klass, id) - VALUE klass; - ID id; -{ - if (klass && klass != rb_cObject) - rb_name_error(id, "uninitialized constant %s::%s", - rb_class2name(klass), - rb_id2name(id)); - else { - rb_name_error(id, "uninitialized constant %s", rb_id2name(id)); - } -} - -static VALUE -const_missing(klass, id) - VALUE klass; - ID id; -{ - return rb_funcall(klass, rb_intern("const_missing"), 1, ID2SYM(id)); -} - - -/* - * call-seq: - * mod.const_missing(sym) => obj - * - * Invoked when a reference is made to an undefined constant in - * mod. It is passed a symbol for the undefined constant, and - * returns a value to be used for that constant. The - * following code is a (very bad) example: if reference is made to - * an undefined constant, it attempts to load a file whose name is - * the lowercase version of the constant (thus class Fred is - * assumed to be in file fred.rb). If found, it returns the - * value of the loaded class. It therefore implements a perverse - * kind of autoload facility. - * - * def Object.const_missing(name) - * @looked_for ||= {} - * str_name = name.to_s - * raise "Class not found: #{name}" if @looked_for[str_name] - * @looked_for[str_name] = 1 - * file = str_name.downcase - * require file - * klass = const_get(name) - * return klass if klass - * raise "Class not found: #{name}" - * end - * - */ - -VALUE -rb_mod_const_missing(klass, name) - VALUE klass, name; -{ - ruby_frame = ruby_frame->prev; /* pop frame for "const_missing" */ - uninitialized_constant(klass, rb_to_id(name)); - return Qnil; /* not reached */ -} - -static struct st_table * -check_autoload_table(av) - VALUE av; -{ - Check_Type(av, T_DATA); - if (RDATA(av)->dmark != (RUBY_DATA_FUNC)rb_mark_tbl || - RDATA(av)->dfree != (RUBY_DATA_FUNC)st_free_table) { - rb_raise(rb_eTypeError, "wrong autoload table: %s", RSTRING(rb_inspect(av))->ptr); - } - return (struct st_table *)DATA_PTR(av); -} - -void -rb_autoload(mod, id, file) - VALUE mod; - ID id; - const char *file; -{ - VALUE av, fn; - struct st_table *tbl; - - if (!rb_is_const_id(id)) { - rb_raise(rb_eNameError, "autoload must be constant name", rb_id2name(id)); - } - if (!file || !*file) { - rb_raise(rb_eArgError, "empty file name"); - } - - if ((tbl = RCLASS(mod)->iv_tbl) && st_lookup(tbl, id, &av) && av != Qundef) - return; - - rb_const_set(mod, id, Qundef); - tbl = RCLASS(mod)->iv_tbl; - if (st_lookup(tbl, autoload, &av)) { - tbl = check_autoload_table(av); - } - else { - av = Data_Wrap_Struct(0 , rb_mark_tbl, st_free_table, 0); - st_add_direct(tbl, autoload, av); - DATA_PTR(av) = tbl = st_init_numtable(); - } - fn = rb_str_new2(file); - FL_UNSET(fn, FL_TAINT); - OBJ_FREEZE(fn); - st_insert(tbl, id, (st_data_t)rb_node_newnode(NODE_MEMO, fn, ruby_safe_level, 0)); -} - -static NODE* -autoload_delete(mod, id) - VALUE mod; - ID id; -{ - VALUE val; - st_data_t load = 0; - - st_delete(RCLASS(mod)->iv_tbl, (st_data_t*)&id, 0); - if (st_lookup(RCLASS(mod)->iv_tbl, autoload, &val)) { - struct st_table *tbl = check_autoload_table(val); - - st_delete(tbl, (st_data_t*)&id, &load); - - if (tbl->num_entries == 0) { - id = autoload; - st_delete(RCLASS(mod)->iv_tbl, (st_data_t*)&id, &val); - } - } - - return (NODE *)load; -} - -VALUE -rb_autoload_load(klass, id) - VALUE klass; - ID id; -{ - VALUE file; - NODE *load = autoload_delete(klass, id); - - if (!load || !(file = load->nd_lit) || rb_provided(RSTRING(file)->ptr)) { - return Qfalse; - } - return rb_require_safe(file, load->nd_nth); -} - -static VALUE -autoload_file(mod, id) - VALUE mod; - ID id; -{ - VALUE val, file; - struct st_table *tbl; - st_data_t load; - - if (!st_lookup(RCLASS(mod)->iv_tbl, autoload, &val) || - !(tbl = check_autoload_table(val)) || !st_lookup(tbl, id, &load)) { - return Qnil; - } - file = ((NODE *)load)->nd_lit; - Check_Type(file, T_STRING); - if (!RSTRING(file)->ptr || !*RSTRING(file)->ptr) { - rb_raise(rb_eArgError, "empty file name"); - } - if (!rb_provided(RSTRING(file)->ptr)) { - return file; - } - - /* already loaded but not defined */ - st_delete(tbl, (st_data_t*)&id, 0); - if (!tbl->num_entries) { - id = autoload; - st_delete(RCLASS(mod)->iv_tbl, (st_data_t*)&id, &val); - } - return Qnil; -} - -VALUE -rb_autoload_p(mod, id) - VALUE mod; - ID id; -{ - struct st_table *tbl = RCLASS(mod)->iv_tbl; - VALUE val; - - if (!tbl || !st_lookup(tbl, id, &val) || val != Qundef) { - return Qnil; - } - return autoload_file(mod, id); -} - -static VALUE -rb_const_get_0(klass, id, exclude, recurse) - VALUE klass; - ID id; - int exclude, recurse; -{ - VALUE value, tmp; - int mod_retry = 0; - - tmp = klass; - retry: - while (tmp) { - while (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,&value)) { - if (value == Qundef) { - if (!RTEST(rb_autoload_load(tmp, id))) break; - continue; - } - if (exclude && tmp == rb_cObject && klass != rb_cObject) { - rb_warn("toplevel constant %s referenced by %s::%s", - rb_id2name(id), rb_class2name(klass), rb_id2name(id)); - } - return value; - } - if (!recurse && klass != rb_cObject) break; - tmp = RCLASS(tmp)->super; - } - if (!exclude && !mod_retry && BUILTIN_TYPE(klass) == T_MODULE) { - mod_retry = 1; - tmp = rb_cObject; - goto retry; - } - - return const_missing(klass, id); -} - -VALUE -rb_const_get_from(klass, id) - VALUE klass; - ID id; -{ - return rb_const_get_0(klass, id, Qtrue, Qtrue); -} - -VALUE -rb_const_get(klass, id) - VALUE klass; - ID id; -{ - return rb_const_get_0(klass, id, Qfalse, Qtrue); -} - -VALUE -rb_const_get_at(klass, id) - VALUE klass; - ID id; -{ - return rb_const_get_0(klass, id, Qtrue, Qfalse); -} - -/* - * call-seq: - * remove_const(sym) => obj - * - * Removes the definition of the given constant, returning that - * constant's value. Predefined classes and singleton objects (such as - * true) cannot be removed. - */ - -VALUE -rb_mod_remove_const(mod, name) - VALUE mod, name; -{ - ID id = rb_to_id(name); - VALUE val; - - if (!rb_is_const_id(id)) { - rb_name_error(id, "`%s' is not allowed as a constant name", rb_id2name(id)); - } - if (!OBJ_TAINTED(mod) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't remove constant"); - if (OBJ_FROZEN(mod)) rb_error_frozen("class/module"); - - if (RCLASS(mod)->iv_tbl && st_delete(ROBJECT(mod)->iv_tbl, (st_data_t*)&id, &val)) { - if (val == Qundef) { - autoload_delete(mod, id); - val = Qnil; - } - return val; - } - if (rb_const_defined_at(mod, id)) { - rb_name_error(id, "cannot remove %s::%s", - rb_class2name(mod), rb_id2name(id)); - } - rb_name_error(id, "constant %s::%s not defined", - rb_class2name(mod), rb_id2name(id)); - return Qnil; /* not reached */ -} - -static int -sv_i(key, value, tbl) - ID key; - VALUE value; - st_table *tbl; -{ - if (rb_is_const_id(key)) { - if (!st_lookup(tbl, key, 0)) { - st_insert(tbl, key, key); - } - } - return ST_CONTINUE; -} - -void* -rb_mod_const_at(mod, data) - VALUE mod; - void *data; -{ - st_table *tbl = data; - if (!tbl) { - tbl = st_init_numtable(); - } - if (RCLASS(mod)->iv_tbl) { - st_foreach_safe(RCLASS(mod)->iv_tbl, sv_i, (st_data_t)tbl); - } - return tbl; -} - -void* -rb_mod_const_of(mod, data) - VALUE mod; - void *data; -{ - VALUE tmp = mod; - for (;;) { - data = rb_mod_const_at(tmp, data); - tmp = RCLASS(tmp)->super; - if (!tmp) break; - if (tmp == rb_cObject && mod != rb_cObject) break; - } - return data; -} - -static int -list_i(key, value, ary) - ID key, value; - VALUE ary; -{ - rb_ary_push(ary, rb_str_new2(rb_id2name(key))); - return ST_CONTINUE; -} - -VALUE -rb_const_list(data) - void *data; -{ - st_table *tbl = data; - VALUE ary; - - if (!tbl) return rb_ary_new2(0); - ary = rb_ary_new2(tbl->num_entries); - st_foreach(tbl, list_i, ary); - st_free_table(tbl); - - return ary; -} - -/* - * call-seq: - * mod.constants => array - * - * Returns an array of the names of the constants accessible in - * mod. This includes the names of constants in any included - * modules (example at start of section). - */ - -VALUE -rb_mod_constants(mod) - VALUE mod; -{ - return rb_const_list(rb_mod_const_of(mod, 0)); -} - -static int -rb_const_defined_0(klass, id, exclude, recurse) - VALUE klass; - ID id; - int exclude, recurse; -{ - VALUE value, tmp; - int mod_retry = 0; - - tmp = klass; - retry: - while (tmp) { - if (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl, id, &value)) { - if (value == Qundef && NIL_P(autoload_file(klass, id))) - return Qfalse; - return Qtrue; - } - if (!recurse && klass != rb_cObject) break; - tmp = RCLASS(tmp)->super; - } - if (!exclude && !mod_retry && BUILTIN_TYPE(klass) == T_MODULE) { - mod_retry = 1; - tmp = rb_cObject; - goto retry; - } - return Qfalse; -} - -int -rb_const_defined_from(klass, id) - VALUE klass; - ID id; -{ - return rb_const_defined_0(klass, id, Qtrue, Qtrue); -} - -int -rb_const_defined(klass, id) - VALUE klass; - ID id; -{ - return rb_const_defined_0(klass, id, Qfalse, Qtrue); -} - -int -rb_const_defined_at(klass, id) - VALUE klass; - ID id; -{ - return rb_const_defined_0(klass, id, Qtrue, Qfalse); -} - -static void -mod_av_set(klass, id, val, isconst) - VALUE klass; - ID id; - VALUE val; - int isconst; -{ - char *dest = isconst ? "constant" : "class variable"; - - if (!OBJ_TAINTED(klass) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't set %s", dest); - if (OBJ_FROZEN(klass)) { - if (BUILTIN_TYPE(klass) == T_MODULE) { - rb_error_frozen("module"); - } - else { - rb_error_frozen("class"); - } - } - if (!RCLASS(klass)->iv_tbl) { - RCLASS(klass)->iv_tbl = st_init_numtable(); - } - else if (isconst) { - VALUE value = Qfalse; - - if (st_lookup(RCLASS(klass)->iv_tbl, id, &value)) { - if (value == Qundef) - autoload_delete(klass, id); - else - rb_warn("already initialized %s %s", dest, rb_id2name(id)); - } - } - - st_insert(RCLASS(klass)->iv_tbl, id, val); -} - -void -rb_const_set(klass, id, val) - VALUE klass; - ID id; - VALUE val; -{ - if (NIL_P(klass)) { - rb_raise(rb_eTypeError, "no class/module to define constant %s", - rb_id2name(id)); - } - mod_av_set(klass, id, val, Qtrue); -} - -void -rb_define_const(klass, name, val) - VALUE klass; - const char *name; - VALUE val; -{ - ID id = rb_intern(name); - - if (!rb_is_const_id(id)) { - rb_warn("rb_define_const: invalid name `%s' for constant", name); - } - if (klass == rb_cObject) { - rb_secure(4); - } - rb_const_set(klass, id, val); -} - -void -rb_define_global_const(name, val) - const char *name; - VALUE val; -{ - rb_define_const(rb_cObject, name, val); -} - -static VALUE -original_module(c) - VALUE c; -{ - if (TYPE(c) == T_ICLASS) - return RBASIC(c)->klass; - return c; -} - -static void -cvar_override_check(id, a) - ID id; - VALUE a; -{ - VALUE base = original_module(a); - - a = RCLASS(a)->super; - while (a) { - if (RCLASS(a)->iv_tbl) { - if (st_lookup(RCLASS(a)->iv_tbl,id,0)) { - rb_warning("class variable %s of %s is overridden by %s", - rb_id2name(id), rb_class2name(original_module(a)), - rb_class2name(base)); - } - } - a = RCLASS(a)->super; - } -} - -void -rb_cvar_set(klass, id, val, warn) - VALUE klass; - ID id; - VALUE val; - int warn; -{ - VALUE tmp; - - tmp = klass; - while (tmp) { - if (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,0)) { - if (OBJ_FROZEN(tmp)) rb_error_frozen("class/module"); - if (!OBJ_TAINTED(tmp) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't modify class variable"); - if (warn && RTEST(ruby_verbose) && klass != tmp) { - rb_warning("already initialized class variable %s", rb_id2name(id)); - } - st_insert(RCLASS(tmp)->iv_tbl,id,val); - if (RTEST(ruby_verbose)) { - cvar_override_check(id, tmp); - } - return; - } - tmp = RCLASS(tmp)->super; - } - - mod_av_set(klass, id, val, Qfalse); -} - -VALUE -rb_cvar_get(klass, id) - VALUE klass; - ID id; -{ - VALUE value; - VALUE tmp; - - tmp = klass; - while (tmp) { - if (RCLASS(tmp)->iv_tbl) { - if (st_lookup(RCLASS(tmp)->iv_tbl,id,&value)) { - if (RTEST(ruby_verbose)) { - cvar_override_check(id, tmp); - } - return value; - } - } - tmp = RCLASS(tmp)->super; - } - - rb_name_error(id,"uninitialized class variable %s in %s", - rb_id2name(id), rb_class2name(klass)); - return Qnil; /* not reached */ -} - -VALUE -rb_cvar_defined(klass, id) - VALUE klass; - ID id; -{ - VALUE tmp; - - tmp = klass; - while (tmp) { - if (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,0)) { - return Qtrue; - } - tmp = RCLASS(tmp)->super; - } - - return Qfalse; -} - -void -rb_cv_set(klass, name, val) - VALUE klass; - const char *name; - VALUE val; -{ - ID id = rb_intern(name); - if (!rb_is_class_id(id)) { - rb_name_error(id, "wrong class variable name %s", name); - } - rb_cvar_set(klass, id, val, Qfalse); -} - -VALUE -rb_cv_get(klass, name) - VALUE klass; - const char *name; -{ - ID id = rb_intern(name); - if (!rb_is_class_id(id)) { - rb_name_error(id, "wrong class variable name %s", name); - } - return rb_cvar_get(klass, id); -} - -void -rb_define_class_variable(klass, name, val) - VALUE klass; - const char *name; - VALUE val; -{ - ID id = rb_intern(name); - - if (!rb_is_class_id(id)) { - rb_name_error(id, "wrong class variable name %s", name); - } - rb_cvar_set(klass, id, val, Qtrue); -} - -static int -cv_i(key, value, ary) - ID key; - VALUE value; - VALUE ary; -{ - if (rb_is_class_id(key)) { - VALUE kval = rb_str_new2(rb_id2name(key)); - if (!rb_ary_includes(ary, kval)) { - rb_ary_push(ary, kval); - } - } - return ST_CONTINUE; -} - -/* - * call-seq: - * mod.class_variables => array - * - * Returns an array of the names of class variables in mod and - * the ancestors of mod. - * - * class One - * @@var1 = 1 - * end - * class Two < One - * @@var2 = 2 - * end - * One.class_variables #=> ["@@var1"] - * Two.class_variables #=> ["@@var2", "@@var1"] - */ - -VALUE -rb_mod_class_variables(obj) - VALUE obj; -{ - VALUE ary = rb_ary_new(); - - for (;;) { - if (RCLASS(obj)->iv_tbl) { - st_foreach_safe(RCLASS(obj)->iv_tbl, cv_i, ary); - } - obj = RCLASS(obj)->super; - if (!obj) break; - } - return ary; -} - -/* - * call-seq: - * remove_class_variable(sym) => obj - * - * Removes the definition of the sym, returning that - * constant's value. - * - * class Dummy - * @@var = 99 - * puts @@var - * remove_class_variable(:@@var) - * puts(defined? @@var) - * end - * - * produces: - * - * 99 - * nil - */ - -VALUE -rb_mod_remove_cvar(mod, name) - VALUE mod, name; -{ - ID id = rb_to_id(name); - VALUE val; - - if (!rb_is_class_id(id)) { - rb_name_error(id, "wrong class variable name %s", rb_id2name(id)); - } - if (!OBJ_TAINTED(mod) && rb_safe_level() >= 4) - rb_raise(rb_eSecurityError, "Insecure: can't remove class variable"); - if (OBJ_FROZEN(mod)) rb_error_frozen("class/module"); - - if (RCLASS(mod)->iv_tbl && st_delete(ROBJECT(mod)->iv_tbl, (st_data_t*)&id, &val)) { - return val; - } - if (rb_cvar_defined(mod, id)) { - rb_name_error(id, "cannot remove %s for %s", - rb_id2name(id), rb_class2name(mod)); - } - rb_name_error(id, "class variable %s not defined for %s", - rb_id2name(id), rb_class2name(mod)); - return Qnil; /* not reached */ -} - -VALUE -rb_iv_get(obj, name) - VALUE obj; - const char *name; -{ - ID id = rb_intern(name); - - return rb_ivar_get(obj, id); -} - -VALUE -rb_iv_set(obj, name, val) - VALUE obj; - const char *name; - VALUE val; -{ - ID id = rb_intern(name); - - return rb_ivar_set(obj, id, val); -} -/********************************************************************** - - version.c - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007) $ - created at: Thu Sep 30 20:08:01 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" -#include "version.h" -#include - -const char ruby_version[] = RUBY_VERSION; -const char ruby_release_date[] = RUBY_RELEASE_DATE; -const char ruby_platform[] = RUBY_PLATFORM; -const int ruby_patchlevel = RUBY_PATCHLEVEL; - -void -Init_version() -{ - VALUE v = rb_obj_freeze(rb_str_new2(ruby_version)); - VALUE d = rb_obj_freeze(rb_str_new2(ruby_release_date)); - VALUE p = rb_obj_freeze(rb_str_new2(ruby_platform)); - - rb_define_global_const("RUBY_VERSION", v); - rb_define_global_const("RUBY_RELEASE_DATE", d); - rb_define_global_const("RUBY_PLATFORM", p); - rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL)); - - /* obsolete constants */ - rb_define_global_const("VERSION", v); - rb_define_global_const("RELEASE_DATE", d); - rb_define_global_const("PLATFORM", p); -} - -void -ruby_show_version() -{ - printf("ruby %s (%s patchlevel %d) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PATCHLEVEL, RUBY_PLATFORM); - fflush(stdout); -} - -void -ruby_show_copyright() -{ - printf("ruby - Copyright (C) 1993-%d Yukihiro Matsumoto\n", RUBY_RELEASE_YEAR); - exit(0); -} -#define PACKAGE_NAME "" -#define PACKAGE_TARNAME "" -#define PACKAGE_VERSION "" -#define PACKAGE_STRING "" -#define PACKAGE_BUGREPORT "" -#define USE_BUILTIN_FRAME_ADDRESS 1 -#define STDC_HEADERS 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRING_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_LONG_LONG 1 -#define HAVE_OFF_T 1 -#define SIZEOF_INT 4 -#define SIZEOF_SHORT 2 -#define SIZEOF_LONG 4 -#define SIZEOF_LONG_LONG 8 -#define SIZEOF___INT64 0 -#define SIZEOF_OFF_T 8 -#define SIZEOF_VOIDP 4 -#define SIZEOF_FLOAT 4 -#define SIZEOF_DOUBLE 8 -#define SIZEOF_TIME_T 4 -#define rb_pid_t pid_t -#define rb_gid_t gid_t -#define rb_uid_t uid_t -#define HAVE_PROTOTYPES 1 -#define TOKEN_PASTE(x,y) x##y -#define HAVE_STDARG_PROTOTYPES 1 -#define NORETURN(x) __attribute__ ((noreturn)) x -#define NOINLINE(x) __attribute__ ((noinline)) x -#define HAVE_DECL_SYS_NERR 1 -#define HAVE_LIBDL 1 -#define HAVE_DIRENT_H 1 -#define STDC_HEADERS 1 -#define HAVE_SYS_WAIT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRING_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_SYS_FILE_H 1 -#define HAVE_SYS_IOCTL_H 1 -#define HAVE_SYS_SYSCALL_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_SYS_FCNTL_H 1 -#define HAVE_SYS_SELECT_H 1 -#define HAVE_SYS_TIME_H 1 -#define HAVE_SYS_TIMES_H 1 -#define HAVE_SYS_PARAM_H 1 -#define HAVE_PWD_H 1 -#define HAVE_GRP_H 1 -#define HAVE_UTIME_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_SYS_RESOURCE_H 1 -#define HAVE_NETINET_IN_SYSTM_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_PTHREAD_H 1 -#define HAVE_UCONTEXT_H 1 -#define SIZEOF_RLIM_T 8 -#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 -#define HAVE_ST_BLKSIZE 1 -#define HAVE_STRUCT_STAT_ST_BLOCKS 1 -#define HAVE_ST_BLOCKS 1 -#define HAVE_STRUCT_STAT_ST_RDEV 1 -#define HAVE_ST_RDEV 1 -#define GETGROUPS_T gid_t -#define RETSIGTYPE void -#define HAVE_ALLOCA_H 1 -#define HAVE_ALLOCA 1 -#define HAVE_FSEEKO 1 -#define HAVE_FTELLO 1 -#define HAVE_DUP2 1 -#define HAVE_MEMMOVE 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_STRERROR 1 -#define HAVE_STRFTIME 1 -#define HAVE_STRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOUL 1 -#define HAVE_CRYPT 1 -#define HAVE_FLOCK 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_ISNAN 1 -#define HAVE_FINITE 1 -#define HAVE_ISINF 1 -#define HAVE_HYPOT 1 -#define HAVE_ACOSH 1 -#define HAVE_ERF 1 -#define HAVE_FMOD 1 -#define HAVE_KILLPG 1 -#define HAVE_WAIT4 1 -#define HAVE_WAITPID 1 -#define HAVE_SYSCALL 1 -#define HAVE_CHROOT 1 -#define HAVE_FSYNC 1 -#define HAVE_GETCWD 1 -#define HAVE_TRUNCATE 1 -#define HAVE_FTRUNCATE 1 -#define HAVE_TIMES 1 -#define HAVE_UTIMES 1 -#define HAVE_FCNTL 1 -#define HAVE_LOCKF 1 -#define HAVE_LSTAT 1 -#define HAVE_SYMLINK 1 -#define HAVE_LINK 1 -#define HAVE_READLINK 1 -#define HAVE_SETITIMER 1 -#define HAVE_SETRUID 1 -#define HAVE_SETEUID 1 -#define HAVE_SETREUID 1 -#define HAVE_SETRGID 1 -#define HAVE_SETEGID 1 -#define HAVE_SETREGID 1 -#define HAVE_ISSETUGID 1 -#define HAVE_PAUSE 1 -#define HAVE_LCHOWN 1 -#define HAVE_LCHMOD 1 -#define HAVE_GETPGRP 1 -#define HAVE_SETPGRP 1 -#define HAVE_GETPGID 1 -#define HAVE_SETPGID 1 -#define HAVE_INITGROUPS 1 -#define HAVE_GETGROUPS 1 -#define HAVE_SETGROUPS 1 -#define HAVE_GETPRIORITY 1 -#define HAVE_GETRLIMIT 1 -#define HAVE_SETRLIMIT 1 -#define HAVE_SYSCONF 1 -#define HAVE_DLOPEN 1 -#define HAVE_SIGPROCMASK 1 -#define HAVE_SIGACTION 1 -#define HAVE__SETJMP 1 -#define HAVE_SETSID 1 -#define HAVE_TELLDIR 1 -#define HAVE_SEEKDIR 1 -#define HAVE_FCHMOD 1 -#define HAVE_MKTIME 1 -#define HAVE_TIMEGM 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_COSH 1 -#define HAVE_SINH 1 -#define HAVE_TANH 1 -#define HAVE_ROUND 1 -#define HAVE_SETUID 1 -#define HAVE_SETGID 1 -#define HAVE_SETENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_STRUCT_TM_TM_ZONE 1 -#define HAVE_TM_ZONE 1 -#define HAVE_STRUCT_TM_TM_GMTOFF 1 -#define HAVE_DAYLIGHT 1 -#define HAVE_VAR_TIMEZONE 1 -#define TYPEOF_VAR_TIMEZONE long -#define NEGATIVE_TIME_T 1 -#define POSIX_SIGNAL 1 -#define GETPGRP_VOID 1 -#define SETPGRP_VOID 1 -#define RSHIFT(x,y) ((x)>>(int)y) -#define FILE_COUNT _r -#define FILE_READPTR _p -#define NEED_IO_SEEK_BETWEEN_RW 1 -#define HAVE__SC_CLK_TCK 1 -#define STACK_GROW_DIRECTION -1 -#define DEFAULT_KCODE KCODE_NONE -#define DLEXT_MAXLEN 7 -#define DLEXT ".bundle" -#define RUBY_LIB "/usr/local/lib/ruby/1.8" -#define RUBY_SITE_LIB "/usr/local/lib/ruby/site_ruby" -#define RUBY_SITE_LIB2 "/usr/local/lib/ruby/site_ruby/1.8" -#define RUBY_PLATFORM "i686-darwin9.8.0" -#define RUBY_ARCHLIB "/usr/local/lib/ruby/1.8/i686-darwin9.8.0" -#define RUBY_SITE_ARCHLIB "/usr/local/lib/ruby/site_ruby/1.8/i686-darwin9.8.0" -/************************************************ - - defines.h - - - $Author: shyouhei $ - $Date: 2008-06-15 16:06:16 +0200 (Sun, 15 Jun 2008) $ - created at: Wed May 18 00:21:44 JST 1994 - -************************************************/ -#ifndef DEFINES_H -#define DEFINES_H - -#define RUBY - -#ifdef __cplusplus -# ifndef HAVE_PROTOTYPES -# define HAVE_PROTOTYPES 1 -# endif -# ifndef HAVE_STDARG_PROTOTYPES -# define HAVE_STDARG_PROTOTYPES 1 -# endif -#endif - -#undef _ -#ifdef HAVE_PROTOTYPES -# define _(args) args -#else -# define _(args) () -#endif - -#undef __ -#ifdef HAVE_STDARG_PROTOTYPES -# define __(args) args -#else -# define __(args) () -#endif - -#ifdef __cplusplus -#define ANYARGS ... -#else -#define ANYARGS -#endif - -#define xmalloc ruby_xmalloc -#define xcalloc ruby_xcalloc -#define xrealloc ruby_xrealloc -#define xfree ruby_xfree - -void *xmalloc _((long)); -void *xcalloc _((long,long)); -void *xrealloc _((void*,long)); -void xfree _((void*)); - -#if SIZEOF_LONG_LONG > 0 -# define LONG_LONG long long -#elif SIZEOF___INT64 > 0 -# define HAVE_LONG_LONG 1 -# define LONG_LONG __int64 -# undef SIZEOF_LONG_LONG -# define SIZEOF_LONG_LONG SIZEOF___INT64 -#endif - -#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG -# define BDIGIT unsigned int -# define SIZEOF_BDIGITS SIZEOF_INT -# define BDIGIT_DBL unsigned LONG_LONG -# define BDIGIT_DBL_SIGNED LONG_LONG -#elif SIZEOF_INT*2 <= SIZEOF_LONG -# define BDIGIT unsigned int -# define SIZEOF_BDIGITS SIZEOF_INT -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -#elif SIZEOF_SHORT*2 <= SIZEOF_LONG -# define BDIGIT unsigned short -# define SIZEOF_BDIGITS SIZEOF_SHORT -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -#else -# define BDIGIT unsigned short -# define SIZEOF_BDIGITS (SIZEOF_LONG/2) -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -#endif - -#ifdef __CYGWIN__ -#undef _WIN32 -#endif - -#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__) -#define DOSISH 1 -#ifndef _WIN32_WCE -# define DOSISH_DRIVE_LETTER -#endif -#endif - -/* define RUBY_USE_EUC/SJIS for default kanji-code */ -#ifndef DEFAULT_KCODE -#if defined(DOSISH) || defined(__CYGWIN__) || defined(__MACOS__) || defined(OS2) -#define DEFAULT_KCODE KCODE_SJIS -#else -#define DEFAULT_KCODE KCODE_EUC -#endif -#endif - -#ifdef __NeXT__ -/* NextStep, OpenStep, Rhapsody */ -#ifndef S_IRUSR -#define S_IRUSR 0000400 /* read permission, owner */ -#endif -#ifndef S_IRGRP -#define S_IRGRP 0000040 /* read permission, group */ -#endif -#ifndef S_IROTH -#define S_IROTH 0000004 /* read permission, other */ -#endif -#ifndef S_IWUSR -#define S_IWUSR 0000200 /* write permission, owner */ -#endif -#ifndef S_IWGRP -#define S_IWGRP 0000020 /* write permission, group */ -#endif -#ifndef S_IWOTH -#define S_IWOTH 0000002 /* write permission, other */ -#endif -#ifndef S_IXUSR -#define S_IXUSR 0000100 /* execute/search permission, owner */ -#endif -#ifndef S_IXGRP -#define S_IXGRP 0000010 /* execute/search permission, group */ -#endif -#ifndef S_IXOTH -#define S_IXOTH 0000001 /* execute/search permission, other */ -#endif -#ifndef S_IRWXU -#define S_IRWXU 0000700 /* read, write, execute permissions, owner */ -#endif -#ifndef S_IRWXG -#define S_IRWXG 0000070 /* read, write, execute permissions, group */ -#endif -#ifndef S_IRWXO -#define S_IRWXO 0000007 /* read, write, execute permissions, other */ -#endif -#ifndef S_ISBLK -#define S_ISBLK(mode) (((mode) & (0170000)) == (0060000)) -#endif -#ifndef S_ISCHR -#define S_ISCHR(mode) (((mode) & (0170000)) == (0020000)) -#endif -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode) & (0170000)) == (0040000)) -#endif -#ifndef S_ISFIFO -#define S_ISFIFO(mode) (((mode) & (0170000)) == (0010000)) -#endif -#ifndef S_ISREG -#define S_ISREG(mode) (((mode) & (0170000)) == (0100000)) -#endif -/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may - result in a different endian. Instead trust __BIG_ENDIAN__ and - __LITTLE_ENDIAN__ which are set correctly by -arch. */ -#undef WORDS_BIGENDIAN -#ifdef __BIG_ENDIAN__ -#define WORDS_BIGENDIAN -#endif -#ifndef __APPLE__ -/* NextStep, OpenStep (but not Rhapsody) */ -#ifndef GETPGRP_VOID -#define GETPGRP_VOID 1 -#endif -#ifndef WNOHANG -#define WNOHANG 01 -#endif -#ifndef WUNTRACED -#define WUNTRACED 02 -#endif -#ifndef X_OK -#define X_OK 1 -#endif -#endif /* __APPLE__ */ -#endif /* NeXT */ - -#ifdef _WIN32 -#include "win32/win32.h" -#endif - -#if defined(__VMS) -#include "vms.h" -#endif - -#if defined(__BEOS__) -#include /* intern.h needs fd_set definition */ -#endif - -#ifdef RUBY_EXPORT -#undef RUBY_EXTERN -#endif - -#ifndef RUBY_EXTERN -#define RUBY_EXTERN extern -#endif - -#ifndef EXTERN -#define EXTERN RUBY_EXTERN /* deprecated */ -#endif - -#ifndef RUBY_MBCHAR_MAXSIZE -#define RUBY_MBCHAR_MAXSIZE INT_MAX - /* MB_CUR_MAX will not work well in C locale */ -#endif - -#if defined(sparc) || defined(__sparc__) -static inline void -flush_register_windows(void) -{ - asm -#ifdef __GNUC__ - volatile -#endif -# if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__) - ("flushw") -# else - ("ta 0x03") -# endif /* trap always to flush register windows if we are on a Sparc system */ - ; -} -# define FLUSH_REGISTER_WINDOWS flush_register_windows() -#elif defined(__ia64) -void *rb_ia64_bsp(void); -void rb_ia64_flushrs(void); -# define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs() -#else -# define FLUSH_REGISTER_WINDOWS ((void)0) -#endif - -#if defined(DOSISH) -#define PATH_SEP ";" -#elif defined(riscos) -#define PATH_SEP "," -#else -#define PATH_SEP ":" -#endif -#define PATH_SEP_CHAR PATH_SEP[0] - -#if defined(__human68k__) -#define PATH_ENV "path" -#else -#define PATH_ENV "PATH" -#endif - -#if defined(DOSISH) && !defined(__human68k__) && !defined(__EMX__) -#define ENV_IGNORECASE -#endif - -#ifndef CASEFOLD_FILESYSTEM -# if defined DOSISH || defined __VMS -# define CASEFOLD_FILESYSTEM 1 -# else -# define CASEFOLD_FILESYSTEM 0 -# endif -#endif - -#ifndef DLEXT_MAXLEN -#define DLEXT_MAXLEN 4 -#endif - -#ifndef RUBY_PLATFORM -#define RUBY_PLATFORM "unknown-unknown" -#endif - -#endif -/********************************************************************** - - dln.h - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007) $ - created at: Wed Jan 19 16:53:09 JST 1994 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#ifndef DLN_H -#define DLN_H - -#ifdef __cplusplus -# ifndef HAVE_PROTOTYPES -# define HAVE_PROTOTYPES 1 -# endif -# ifndef HAVE_STDARG_PROTOTYPES -# define HAVE_STDARG_PROTOTYPES 1 -# endif -#endif - -#undef _ -#ifdef HAVE_PROTOTYPES -# define _(args) args -#else -# define _(args) () -#endif - -char *dln_find_exe _((const char*,const char*)); -char *dln_find_file _((const char*,const char*)); - -#ifdef USE_DLN_A_OUT -extern char *dln_argv0; -#endif - -void *dln_load _((const char*)); -#endif -/********************************************************************** - - env.h - - - $Author: knu $ - $Date: 2007-03-03 08:30:46 +0100 (Sat, 03 Mar 2007) $ - created at: Mon Jul 11 11:53:03 JST 1994 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#ifndef ENV_H -#define ENV_H - -extern struct FRAME { - VALUE self; - int argc; - ID last_func; - ID orig_func; - VALUE last_class; - struct FRAME *prev; - struct FRAME *tmp; - struct RNode *node; - int iter; - int flags; - unsigned long uniq; -} *ruby_frame; - -void rb_gc_mark_frame _((struct FRAME *)); - -#define FRAME_DMETH 1 -#define FRAME_FUNC 2 - -extern struct SCOPE { - struct RBasic super; - ID *local_tbl; - VALUE *local_vars; - int flags; -} *ruby_scope; - -#define SCOPE_ALLOCA 0 -#define SCOPE_MALLOC 1 -#define SCOPE_NOSTACK 2 -#define SCOPE_DONT_RECYCLE 4 -#define SCOPE_CLONE 8 - -extern int ruby_in_eval; - -extern VALUE ruby_class; - -struct RVarmap { - struct RBasic super; - ID id; - VALUE val; - struct RVarmap *next; -}; -extern struct RVarmap *ruby_dyna_vars; - -#endif /* ENV_H */ -/********************************************************************** - - intern.h - - - $Author: shyouhei $ - $Date: 2009-01-22 07:18:48 +0100 (Thu, 22 Jan 2009) $ - created at: Thu Jun 10 14:22:17 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - Copyright (C) 2000 Network Applied Communication Laboratory, Inc. - Copyright (C) 2000 Information-technology Promotion Agency, Japan - -**********************************************************************/ - -/* - * Functions and variables that are used by more than one source file of - * the kernel. - */ - -#define ID_ALLOCATOR 1 - -/* array.c */ -void rb_mem_clear _((register VALUE*, register long)); -VALUE rb_assoc_new _((VALUE, VALUE)); -VALUE rb_check_array_type _((VALUE)); -VALUE rb_ary_new _((void)); -VALUE rb_ary_new2 _((long)); -VALUE rb_ary_new3 __((long,...)); -VALUE rb_ary_new4 _((long, const VALUE *)); -VALUE rb_ary_freeze _((VALUE)); -VALUE rb_ary_aref _((int, VALUE*, VALUE)); -void rb_ary_store _((VALUE, long, VALUE)); -VALUE rb_ary_dup _((VALUE)); -VALUE rb_ary_to_ary _((VALUE)); -VALUE rb_ary_to_s _((VALUE)); -VALUE rb_ary_push _((VALUE, VALUE)); -VALUE rb_ary_pop _((VALUE)); -VALUE rb_ary_shift _((VALUE)); -VALUE rb_ary_unshift _((VALUE, VALUE)); -VALUE rb_ary_entry _((VALUE, long)); -VALUE rb_ary_each _((VALUE)); -VALUE rb_ary_join _((VALUE, VALUE)); -VALUE rb_ary_print_on _((VALUE, VALUE)); -VALUE rb_ary_reverse _((VALUE)); -VALUE rb_ary_sort _((VALUE)); -VALUE rb_ary_sort_bang _((VALUE)); -VALUE rb_ary_delete _((VALUE, VALUE)); -VALUE rb_ary_delete_at _((VALUE, long)); -VALUE rb_ary_clear _((VALUE)); -VALUE rb_ary_plus _((VALUE, VALUE)); -VALUE rb_ary_concat _((VALUE, VALUE)); -VALUE rb_ary_assoc _((VALUE, VALUE)); -VALUE rb_ary_rassoc _((VALUE, VALUE)); -VALUE rb_ary_includes _((VALUE, VALUE)); -VALUE rb_ary_cmp _((VALUE, VALUE)); -VALUE rb_protect_inspect _((VALUE(*)(ANYARGS),VALUE,VALUE)); -VALUE rb_inspecting_p _((VALUE)); -VALUE rb_check_array_value _((VALUE)); -VALUE rb_values_at _((VALUE, long, int, VALUE*, VALUE(*) _((VALUE,long)))); -/* bignum.c */ -VALUE rb_big_clone _((VALUE)); -void rb_big_2comp _((VALUE)); -VALUE rb_big_norm _((VALUE)); -VALUE rb_uint2big _((unsigned long)); -VALUE rb_int2big _((long)); -VALUE rb_uint2inum _((unsigned long)); -VALUE rb_int2inum _((long)); -VALUE rb_cstr_to_inum _((const char*, int, int)); -VALUE rb_str_to_inum _((VALUE, int, int)); -VALUE rb_cstr2inum _((const char*, int)); -VALUE rb_str2inum _((VALUE, int)); -VALUE rb_big2str _((VALUE, int)); -VALUE rb_big2str0 _((VALUE, int, int)); -long rb_big2long _((VALUE)); -#define rb_big2int(x) rb_big2long(x) -unsigned long rb_big2ulong _((VALUE)); -#define rb_big2uint(x) rb_big2ulong(x) -#if HAVE_LONG_LONG -VALUE rb_ll2inum _((LONG_LONG)); -VALUE rb_ull2inum _((unsigned LONG_LONG)); -LONG_LONG rb_big2ll _((VALUE)); -unsigned LONG_LONG rb_big2ull _((VALUE)); -#endif /* HAVE_LONG_LONG */ -void rb_quad_pack _((char*,VALUE)); -VALUE rb_quad_unpack _((const char*,int)); -VALUE rb_dbl2big _((double)); -double rb_big2dbl _((VALUE)); -VALUE rb_big_plus _((VALUE, VALUE)); -VALUE rb_big_minus _((VALUE, VALUE)); -VALUE rb_big_mul _((VALUE, VALUE)); -VALUE rb_big_divmod _((VALUE, VALUE)); -VALUE rb_big_pow _((VALUE, VALUE)); -VALUE rb_big_and _((VALUE, VALUE)); -VALUE rb_big_or _((VALUE, VALUE)); -VALUE rb_big_xor _((VALUE, VALUE)); -VALUE rb_big_lshift _((VALUE, VALUE)); -VALUE rb_big_rand _((VALUE, double*)); -/* class.c */ -VALUE rb_class_boot _((VALUE)); -VALUE rb_class_new _((VALUE)); -VALUE rb_mod_init_copy _((VALUE, VALUE)); -VALUE rb_class_init_copy _((VALUE, VALUE)); -VALUE rb_singleton_class_clone _((VALUE)); -void rb_singleton_class_attached _((VALUE,VALUE)); -VALUE rb_make_metaclass _((VALUE, VALUE)); -void rb_check_inheritable _((VALUE)); -VALUE rb_class_inherited _((VALUE, VALUE)); -VALUE rb_define_class_id _((ID, VALUE)); -VALUE rb_module_new _((void)); -VALUE rb_define_module_id _((ID)); -VALUE rb_mod_included_modules _((VALUE)); -VALUE rb_mod_include_p _((VALUE, VALUE)); -VALUE rb_mod_ancestors _((VALUE)); -VALUE rb_class_instance_methods _((int, VALUE*, VALUE)); -VALUE rb_class_public_instance_methods _((int, VALUE*, VALUE)); -VALUE rb_class_protected_instance_methods _((int, VALUE*, VALUE)); -VALUE rb_big_rshift(VALUE, VALUE); -VALUE rb_class_private_instance_methods _((int, VALUE*, VALUE)); -VALUE rb_obj_singleton_methods _((int, VALUE*, VALUE)); -void rb_define_method_id _((VALUE, ID, VALUE (*)(ANYARGS), int)); -void rb_frozen_class_p _((VALUE)); -void rb_undef _((VALUE, ID)); -void rb_define_protected_method _((VALUE, const char*, VALUE (*)(ANYARGS), int)); -void rb_define_private_method _((VALUE, const char*, VALUE (*)(ANYARGS), int)); -void rb_define_singleton_method _((VALUE, const char*, VALUE(*)(ANYARGS), int)); -VALUE rb_singleton_class _((VALUE)); -/* compar.c */ -int rb_cmpint _((VALUE, VALUE, VALUE)); -NORETURN(void rb_cmperr _((VALUE, VALUE))); -/* enum.c */ -/* error.c */ -RUBY_EXTERN int ruby_nerrs; -VALUE rb_exc_new _((VALUE, const char*, long)); -VALUE rb_exc_new2 _((VALUE, const char*)); -VALUE rb_exc_new3 _((VALUE, VALUE)); -NORETURN(void rb_loaderror __((const char*, ...))); -NORETURN(void rb_name_error __((ID, const char*, ...))); -NORETURN(void rb_invalid_str _((const char*, const char*))); -void rb_compile_error __((const char*, ...)); -void rb_compile_error_append __((const char*, ...)); -NORETURN(void rb_load_fail _((const char*))); -NORETURN(void rb_error_frozen _((const char*))); -void rb_check_frozen _((VALUE)); -/* eval.c */ -RUBY_EXTERN struct RNode *ruby_current_node; -void ruby_set_current_source _((void)); -NORETURN(void rb_exc_raise _((VALUE))); -NORETURN(void rb_exc_fatal _((VALUE))); -VALUE rb_f_exit _((int,VALUE*)); -VALUE rb_f_abort _((int,VALUE*)); -void rb_remove_method _((VALUE, const char*)); -#define rb_disable_super(klass, name) ((void)0) -#define rb_enable_super(klass, name) ((void)0) -#define HAVE_RB_DEFINE_ALLOC_FUNC 1 -void rb_define_alloc_func _((VALUE, VALUE (*)(VALUE))); -void rb_undef_alloc_func _((VALUE)); -void rb_clear_cache _((void)); -void rb_clear_cache_by_class _((VALUE)); -void rb_alias _((VALUE, ID, ID)); -void rb_attr _((VALUE,ID,int,int,int)); -int rb_method_boundp _((VALUE, ID, int)); -VALUE rb_dvar_defined _((ID)); -VALUE rb_dvar_curr _((ID)); -VALUE rb_dvar_ref _((ID)); -void rb_dvar_asgn _((ID, VALUE)); -void rb_dvar_push _((ID, VALUE)); -VALUE *rb_svar _((int)); -VALUE rb_eval_cmd _((VALUE, VALUE, int)); -int rb_obj_respond_to _((VALUE, ID, int)); -int rb_respond_to _((VALUE, ID)); -void rb_interrupt _((void)); -VALUE rb_apply _((VALUE, ID, VALUE)); -void rb_backtrace _((void)); -ID rb_frame_last_func _((void)); -VALUE rb_obj_instance_eval _((int, VALUE*, VALUE)); -VALUE rb_mod_module_eval _((int, VALUE*, VALUE)); -void rb_load _((VALUE, int)); -void rb_load_protect _((VALUE, int, int*)); -NORETURN(void rb_jump_tag _((int))); -int rb_provided _((const char*)); -void rb_provide _((const char*)); -VALUE rb_f_require _((VALUE, VALUE)); -VALUE rb_require_safe _((VALUE, int)); -void rb_obj_call_init _((VALUE, int, VALUE*)); -VALUE rb_class_new_instance _((int, VALUE*, VALUE)); -VALUE rb_block_proc _((void)); -VALUE rb_f_lambda _((void)); -VALUE rb_proc_new _((VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE)); -VALUE rb_protect _((VALUE (*)(VALUE), VALUE, int*)); -void rb_set_end_proc _((void (*)(VALUE), VALUE)); -void rb_mark_end_proc _((void)); -void rb_exec_end_proc _((void)); -void ruby_finalize _((void)); -NORETURN(void ruby_stop _((int))); -int ruby_cleanup _((int)); -int ruby_exec _((void)); -void rb_gc_mark_threads _((void)); -void rb_thread_start_timer _((void)); -void rb_thread_stop_timer _((void)); -void rb_thread_schedule _((void)); -void rb_thread_wait_fd _((int)); -int rb_thread_fd_writable _((int)); -void rb_thread_fd_close _((int)); -int rb_thread_alone _((void)); -void rb_thread_polling _((void)); -void rb_thread_sleep _((int)); -void rb_thread_sleep_forever _((void)); -VALUE rb_thread_stop _((void)); -VALUE rb_thread_wakeup _((VALUE)); -VALUE rb_thread_wakeup_alive _((VALUE)); -VALUE rb_thread_run _((VALUE)); -VALUE rb_thread_kill _((VALUE)); -VALUE rb_thread_alive_p _((VALUE)); -VALUE rb_thread_create _((VALUE (*)(ANYARGS), void*)); -void rb_thread_interrupt _((void)); -void rb_thread_trap_eval _((VALUE, int, int)); -void rb_thread_signal_raise _((int)); -void rb_thread_signal_exit _((void)); -int rb_thread_select _((int, fd_set *, fd_set *, fd_set *, struct timeval *)); -void rb_thread_wait_for _((struct timeval)); -VALUE rb_thread_current _((void)); -VALUE rb_thread_main _((void)); -VALUE rb_thread_local_aref _((VALUE, ID)); -VALUE rb_thread_local_aset _((VALUE, ID, VALUE)); -void rb_thread_atfork _((void)); -VALUE rb_funcall_rescue __((VALUE, ID, int, ...)); -/* file.c */ -VALUE rb_file_s_expand_path _((int, VALUE *)); -VALUE rb_file_expand_path _((VALUE, VALUE)); -void rb_file_const _((const char*, VALUE)); -int rb_find_file_ext _((VALUE*, const char* const*)); -VALUE rb_find_file _((VALUE)); -char *rb_path_next _((const char *)); -char *rb_path_skip_prefix _((const char *)); -char *rb_path_last_separator _((const char *)); -char *rb_path_end _((const char *)); -VALUE rb_file_directory_p _((VALUE,VALUE)); -/* gc.c */ -NORETURN(void rb_memerror __((void))); -int ruby_stack_check _((void)); -size_t ruby_stack_length _((VALUE**)); -int rb_during_gc _((void)); -char *rb_source_filename _((const char*)); -void rb_gc_mark_locations _((VALUE*, VALUE*)); -void rb_mark_tbl _((struct st_table*)); -void rb_mark_set _((struct st_table*)); -void rb_mark_hash _((struct st_table*)); -void rb_gc_mark_maybe _((VALUE)); -void rb_gc_mark _((VALUE)); -void rb_gc_force_recycle _((VALUE)); -void rb_gc _((void)); -void rb_gc_copy_finalizer _((VALUE,VALUE)); -void rb_gc_finalize_deferred _((void)); -void rb_gc_call_finalizer_at_exit _((void)); -VALUE rb_gc_enable _((void)); -VALUE rb_gc_disable _((void)); -VALUE rb_gc_start _((void)); -/* hash.c */ -void st_foreach_safe _((struct st_table *, int (*)(ANYARGS), unsigned long)); -void rb_hash_foreach _((VALUE, int (*)(ANYARGS), VALUE)); -VALUE rb_hash _((VALUE)); -VALUE rb_hash_new _((void)); -VALUE rb_hash_freeze _((VALUE)); -VALUE rb_hash_aref _((VALUE, VALUE)); -VALUE rb_hash_aset _((VALUE, VALUE, VALUE)); -VALUE rb_hash_delete_if _((VALUE)); -VALUE rb_hash_delete _((VALUE,VALUE)); -int rb_path_check _((char*)); -int rb_env_path_tainted _((void)); -/* io.c */ -#define rb_defout rb_stdout -RUBY_EXTERN VALUE rb_fs; -RUBY_EXTERN VALUE rb_output_fs; -RUBY_EXTERN VALUE rb_rs; -RUBY_EXTERN VALUE rb_default_rs; -RUBY_EXTERN VALUE rb_output_rs; -VALUE rb_io_write _((VALUE, VALUE)); -VALUE rb_io_gets _((VALUE)); -VALUE rb_io_getc _((VALUE)); -VALUE rb_io_ungetc _((VALUE, VALUE)); -VALUE rb_io_close _((VALUE)); -VALUE rb_io_eof _((VALUE)); -VALUE rb_io_binmode _((VALUE)); -VALUE rb_io_addstr _((VALUE, VALUE)); -VALUE rb_io_printf _((int, VALUE*, VALUE)); -VALUE rb_io_print _((int, VALUE*, VALUE)); -VALUE rb_io_puts _((int, VALUE*, VALUE)); -VALUE rb_file_open _((const char*, const char*)); -VALUE rb_gets _((void)); -void rb_write_error _((const char*)); -void rb_write_error2 _((const char*, long)); -/* marshal.c */ -VALUE rb_marshal_dump _((VALUE, VALUE)); -VALUE rb_marshal_load _((VALUE)); -/* numeric.c */ -void rb_num_zerodiv _((void)); -VALUE rb_num_coerce_bin _((VALUE, VALUE)); -VALUE rb_num_coerce_cmp _((VALUE, VALUE)); -VALUE rb_num_coerce_relop _((VALUE, VALUE)); -VALUE rb_float_new _((double)); -VALUE rb_num2fix _((VALUE)); -VALUE rb_fix2str _((VALUE, int)); -VALUE rb_dbl_cmp _((double, double)); -/* object.c */ -int rb_eql _((VALUE, VALUE)); -VALUE rb_any_to_s _((VALUE)); -VALUE rb_inspect _((VALUE)); -VALUE rb_obj_is_instance_of _((VALUE, VALUE)); -VALUE rb_obj_is_kind_of _((VALUE, VALUE)); -VALUE rb_obj_alloc _((VALUE)); -VALUE rb_obj_clone _((VALUE)); -VALUE rb_obj_dup _((VALUE)); -VALUE rb_obj_init_copy _((VALUE,VALUE)); -VALUE rb_obj_taint _((VALUE)); -VALUE rb_obj_tainted _((VALUE)); -VALUE rb_obj_untaint _((VALUE)); -VALUE rb_obj_freeze _((VALUE)); -VALUE rb_obj_id _((VALUE)); -VALUE rb_obj_class _((VALUE)); -VALUE rb_class_real _((VALUE)); -VALUE rb_class_inherited_p _((VALUE, VALUE)); -VALUE rb_convert_type _((VALUE,int,const char*,const char*)); -VALUE rb_check_convert_type _((VALUE,int,const char*,const char*)); -VALUE rb_to_int _((VALUE)); -VALUE rb_Integer _((VALUE)); -VALUE rb_Float _((VALUE)); -VALUE rb_String _((VALUE)); -VALUE rb_Array _((VALUE)); -double rb_cstr_to_dbl _((const char*, int)); -double rb_str_to_dbl _((VALUE, int)); -/* parse.y */ -RUBY_EXTERN int ruby_sourceline; -RUBY_EXTERN char *ruby_sourcefile; -int ruby_yyparse _((void)); -ID rb_id_attrset _((ID)); -void rb_parser_append_print _((void)); -void rb_parser_while_loop _((int, int)); -int ruby_parser_stack_on_heap _((void)); -void rb_gc_mark_parser _((void)); -int rb_is_const_id _((ID)); -int rb_is_instance_id _((ID)); -int rb_is_class_id _((ID)); -int rb_is_local_id _((ID)); -int rb_is_junk_id _((ID)); -int rb_symname_p _((const char*)); -int rb_sym_interned_p _((VALUE)); -VALUE rb_backref_get _((void)); -void rb_backref_set _((VALUE)); -VALUE rb_lastline_get _((void)); -void rb_lastline_set _((VALUE)); -VALUE rb_sym_all_symbols _((void)); -/* process.c */ -int rb_proc_exec _((const char*)); -VALUE rb_f_exec _((int,VALUE*)); -int rb_waitpid _((int,int*,int)); -void rb_syswait _((int)); -VALUE rb_proc_times _((VALUE)); -VALUE rb_detach_process _((int)); -/* range.c */ -VALUE rb_range_new _((VALUE, VALUE, int)); -VALUE rb_range_beg_len _((VALUE, long*, long*, long, int)); -VALUE rb_length_by_each _((VALUE)); -/* re.c */ -int rb_memcmp _((const void*,const void*,long)); -int rb_memcicmp _((const void*,const void*,long)); -long rb_memsearch _((const void*,long,const void*,long)); -VALUE rb_reg_nth_defined _((int, VALUE)); -VALUE rb_reg_nth_match _((int, VALUE)); -VALUE rb_reg_last_match _((VALUE)); -VALUE rb_reg_match_pre _((VALUE)); -VALUE rb_reg_match_post _((VALUE)); -VALUE rb_reg_match_last _((VALUE)); -VALUE rb_reg_new _((const char*, long, int)); -VALUE rb_reg_match _((VALUE, VALUE)); -VALUE rb_reg_match2 _((VALUE)); -int rb_reg_options _((VALUE)); -void rb_set_kcode _((const char*)); -const char* rb_get_kcode _((void)); -void rb_kcode_set_option _((VALUE)); -void rb_kcode_reset_option _((void)); -/* ruby.c */ -RUBY_EXTERN VALUE rb_argv; -RUBY_EXTERN VALUE rb_argv0; -void rb_load_file _((const char*)); -void ruby_script _((const char*)); -void ruby_prog_init _((void)); -void ruby_set_argv _((int, char**)); -void ruby_process_options _((int, char**)); -void ruby_load_script _((void)); -void ruby_init_loadpath _((void)); -void ruby_incpush _((const char*)); -/* signal.c */ -VALUE rb_f_kill _((int, VALUE*)); -void rb_gc_mark_trap_list _((void)); -#ifdef POSIX_SIGNAL -#define posix_signal ruby_posix_signal -void posix_signal _((int, RETSIGTYPE (*)(int))); -#endif -void rb_trap_exit _((void)); -void rb_trap_exec _((void)); -const char *ruby_signal_name _((int)); -void ruby_default_signal _((int)); -/* sprintf.c */ -VALUE rb_f_sprintf _((int, VALUE*)); -VALUE rb_str_format _((int, VALUE*, VALUE)); -/* string.c */ -VALUE rb_str_new _((const char*, long)); -VALUE rb_str_new2 _((const char*)); -VALUE rb_str_new3 _((VALUE)); -VALUE rb_str_new4 _((VALUE)); -VALUE rb_str_new5 _((VALUE, const char*, long)); -VALUE rb_tainted_str_new _((const char*, long)); -VALUE rb_tainted_str_new2 _((const char*)); -VALUE rb_str_buf_new _((long)); -VALUE rb_str_buf_new2 _((const char*)); -VALUE rb_str_buf_append _((VALUE, VALUE)); -VALUE rb_str_buf_cat _((VALUE, const char*, long)); -VALUE rb_str_buf_cat2 _((VALUE, const char*)); -VALUE rb_obj_as_string _((VALUE)); -VALUE rb_check_string_type _((VALUE)); -VALUE rb_str_dup _((VALUE)); -VALUE rb_str_locktmp _((VALUE)); -VALUE rb_str_unlocktmp _((VALUE)); -VALUE rb_str_dup_frozen _((VALUE)); -VALUE rb_str_plus _((VALUE, VALUE)); -VALUE rb_str_times _((VALUE, VALUE)); -VALUE rb_str_substr _((VALUE, long, long)); -void rb_str_modify _((VALUE)); -VALUE rb_str_freeze _((VALUE)); -VALUE rb_str_resize _((VALUE, long)); -VALUE rb_str_cat _((VALUE, const char*, long)); -VALUE rb_str_cat2 _((VALUE, const char*)); -VALUE rb_str_append _((VALUE, VALUE)); -VALUE rb_str_concat _((VALUE, VALUE)); -int rb_str_hash _((VALUE)); -int rb_str_cmp _((VALUE, VALUE)); -VALUE rb_str_upto _((VALUE, VALUE, int)); -void rb_str_update _((VALUE, long, long, VALUE)); -VALUE rb_str_inspect _((VALUE)); -VALUE rb_str_dump _((VALUE)); -VALUE rb_str_split _((VALUE, const char*)); -void rb_str_associate _((VALUE, VALUE)); -VALUE rb_str_associated _((VALUE)); -void rb_str_setter _((VALUE, ID, VALUE*)); -VALUE rb_str_intern _((VALUE)); -/* struct.c */ -VALUE rb_struct_new __((VALUE, ...)); -VALUE rb_struct_define __((const char*, ...)); -VALUE rb_struct_alloc _((VALUE, VALUE)); -VALUE rb_struct_aref _((VALUE, VALUE)); -VALUE rb_struct_aset _((VALUE, VALUE, VALUE)); -VALUE rb_struct_getmember _((VALUE, ID)); -VALUE rb_struct_iv_get _((VALUE, char*)); -VALUE rb_struct_s_members _((VALUE)); -VALUE rb_struct_members _((VALUE)); -/* time.c */ -VALUE rb_time_new _((time_t, time_t)); -/* variable.c */ -VALUE rb_mod_name _((VALUE)); -VALUE rb_class_path _((VALUE)); -void rb_set_class_path _((VALUE, VALUE, const char*)); -VALUE rb_path2class _((const char*)); -void rb_name_class _((VALUE, ID)); -VALUE rb_class_name _((VALUE)); -void rb_autoload _((VALUE, ID, const char*)); -VALUE rb_autoload_load _((VALUE, ID)); -VALUE rb_autoload_p _((VALUE, ID)); -void rb_gc_mark_global_tbl _((void)); -VALUE rb_f_trace_var _((int, VALUE*)); -VALUE rb_f_untrace_var _((int, VALUE*)); -VALUE rb_f_global_variables _((void)); -void rb_alias_variable _((ID, ID)); -struct st_table* rb_generic_ivar_table _((VALUE)); -void rb_copy_generic_ivar _((VALUE,VALUE)); -void rb_mark_generic_ivar _((VALUE)); -void rb_mark_generic_ivar_tbl _((void)); -void rb_free_generic_ivar _((VALUE)); -VALUE rb_ivar_get _((VALUE, ID)); -VALUE rb_ivar_set _((VALUE, ID, VALUE)); -VALUE rb_ivar_defined _((VALUE, ID)); -VALUE rb_iv_set _((VALUE, const char*, VALUE)); -VALUE rb_iv_get _((VALUE, const char*)); -VALUE rb_attr_get _((VALUE, ID)); -VALUE rb_obj_instance_variables _((VALUE)); -VALUE rb_obj_remove_instance_variable _((VALUE, VALUE)); -void *rb_mod_const_at _((VALUE, void*)); -void *rb_mod_const_of _((VALUE, void*)); -VALUE rb_const_list _((void*)); -VALUE rb_mod_constants _((VALUE)); -VALUE rb_mod_remove_const _((VALUE, VALUE)); -int rb_const_defined _((VALUE, ID)); -int rb_const_defined_at _((VALUE, ID)); -int rb_const_defined_from _((VALUE, ID)); -VALUE rb_const_get _((VALUE, ID)); -VALUE rb_const_get_at _((VALUE, ID)); -VALUE rb_const_get_from _((VALUE, ID)); -void rb_const_set _((VALUE, ID, VALUE)); -VALUE rb_mod_constants _((VALUE)); -VALUE rb_mod_const_missing _((VALUE,VALUE)); -VALUE rb_cvar_defined _((VALUE, ID)); -#define RB_CVAR_SET_4ARGS 1 -void rb_cvar_set _((VALUE, ID, VALUE, int)); -VALUE rb_cvar_get _((VALUE, ID)); -void rb_cv_set _((VALUE, const char*, VALUE)); -VALUE rb_cv_get _((VALUE, const char*)); -void rb_define_class_variable _((VALUE, const char*, VALUE)); -VALUE rb_mod_class_variables _((VALUE)); -VALUE rb_mod_remove_cvar _((VALUE, VALUE)); -/* version.c */ -void ruby_show_version _((void)); -void ruby_show_copyright _((void)); -/************************************************ - - missing.h - prototype for *.c in ./missing, and - for missing timeval struct - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007) $ - created at: Sat May 11 23:46:03 JST 2002 - -************************************************/ - -#ifndef MISSING_H -#define MISSING_H - -#if defined(HAVE_SYS_TIME_H) -# include -#elif !defined(_WIN32) -# define time_t long -struct timeval { - time_t tv_sec; /* seconds */ - time_t tv_usec; /* microseconds */ -}; -#endif -#if defined(HAVE_SYS_TYPES_H) -# include -#endif - -#ifndef HAVE_ACOSH -extern double acosh _((double)); -extern double asinh _((double)); -extern double atanh _((double)); -#endif - -#ifndef HAVE_CRYPT -extern char *crypt _((char *, char *)); -#endif - -#ifndef HAVE_DUP2 -extern int dup2 _((int, int)); -#endif - -#ifndef HAVE_EACCESS -extern int eaccess _((const char*, int)); -#endif - -#ifndef HAVE_FINITE -extern int finite _((double)); -#endif - -#ifndef HAVE_FLOCK -extern int flock _((int, int)); -#endif - -/* -#ifndef HAVE_FREXP -extern double frexp _((double, int *)); -#endif -*/ - -#ifndef HAVE_HYPOT -extern double hypot _((double, double)); -#endif - -#ifndef HAVE_ERF -extern double erf _((double)); -extern double erfc _((double)); -#endif - -#ifndef HAVE_ISINF -# if defined(HAVE_FINITE) && defined(HAVE_ISNAN) -# define isinf(x) (!finite(x) && !isnan(x)) -# else -extern int isinf _((double)); -# endif -#endif - -#ifndef HAVE_ISNAN -extern int isnan _((double)); -#endif - -/* -#ifndef HAVE_MEMCMP -extern int memcmp _((char *, char *, int)); -#endif -*/ - -#ifndef HAVE_MEMMOVE -extern void *memmove _((void *, void *, int)); -#endif - -/* -#ifndef HAVE_MODF -extern double modf _((double, double *)); -#endif -*/ - -#ifndef HAVE_STRCASECMP -extern int strcasecmp _((char *, char *)); -#endif - -#ifndef HAVE_STRNCASECMP -extern int strncasecmp _((char *, char *, int)); -#endif - -#ifndef HAVE_STRCHR -extern char *strchr _((char *, int)); -extern char *strrchr _((char *, int)); -#endif - -#ifndef HAVE_STRERROR -extern char *strerror _((int)); -#endif - -#ifndef HAVE_STRFTIME -extern size_t strftime _((char *, size_t, const char *, const struct tm *)); -#endif - -#ifndef HAVE_STRSTR -extern char *strstr _((char *, char *)); -#endif - -/* -#ifndef HAVE_STRTOL -extern long strtol _((char *, char **, int)); -#endif -*/ - -#ifndef HAVE_STRTOUL -extern unsigned long strtoul _((char *, char **, int)); -#endif - -#ifndef HAVE_VSNPRINTF -# ifdef HAVE_STDARG_PROTOTYPES -# include -# else -# include -# endif -extern int snprintf __((char *, size_t n, char const *, ...)); -extern int vsnprintf _((char *, size_t n, char const *, va_list)); -#endif - -#endif /* MISSING_H */ -/********************************************************************** - - node.h - - - $Author: wyhaines $ - $Date: 2009-07-09 20:16:38 +0200 (Thu, 09 Jul 2009) $ - created at: Fri May 28 15:14:02 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#ifndef NODE_H -#define NODE_H - -#if defined(__cplusplus) -extern "C" { -#endif - -enum node_type { - NODE_METHOD, - NODE_FBODY, - NODE_CFUNC, - NODE_SCOPE, - NODE_BLOCK, - NODE_IF, - NODE_CASE, - NODE_WHEN, - NODE_OPT_N, - NODE_WHILE, - NODE_UNTIL, - NODE_ITER, - NODE_FOR, - NODE_BREAK, - NODE_NEXT, - NODE_REDO, - NODE_RETRY, - NODE_BEGIN, - NODE_RESCUE, - NODE_RESBODY, - NODE_ENSURE, - NODE_AND, - NODE_OR, - NODE_NOT, - NODE_MASGN, - NODE_LASGN, - NODE_DASGN, - NODE_DASGN_CURR, - NODE_GASGN, - NODE_IASGN, - NODE_CDECL, - NODE_CVASGN, - NODE_CVDECL, - NODE_OP_ASGN1, - NODE_OP_ASGN2, - NODE_OP_ASGN_AND, - NODE_OP_ASGN_OR, - NODE_CALL, - NODE_FCALL, - NODE_VCALL, - NODE_SUPER, - NODE_ZSUPER, - NODE_ARRAY, - NODE_ZARRAY, - NODE_HASH, - NODE_RETURN, - NODE_YIELD, - NODE_LVAR, - NODE_DVAR, - NODE_GVAR, - NODE_IVAR, - NODE_CONST, - NODE_CVAR, - NODE_NTH_REF, - NODE_BACK_REF, - NODE_MATCH, - NODE_MATCH2, - NODE_MATCH3, - NODE_LIT, - NODE_STR, - NODE_DSTR, - NODE_XSTR, - NODE_DXSTR, - NODE_EVSTR, - NODE_DREGX, - NODE_DREGX_ONCE, - NODE_ARGS, - NODE_ARGSCAT, - NODE_ARGSPUSH, - NODE_SPLAT, - NODE_TO_ARY, - NODE_SVALUE, - NODE_BLOCK_ARG, - NODE_BLOCK_PASS, - NODE_DEFN, - NODE_DEFS, - NODE_ALIAS, - NODE_VALIAS, - NODE_UNDEF, - NODE_CLASS, - NODE_MODULE, - NODE_SCLASS, - NODE_COLON2, - NODE_COLON3, - NODE_CREF, - NODE_DOT2, - NODE_DOT3, - NODE_FLIP2, - NODE_FLIP3, - NODE_ATTRSET, - NODE_SELF, - NODE_NIL, - NODE_TRUE, - NODE_FALSE, - NODE_DEFINED, - NODE_NEWLINE, - NODE_POSTEXE, - NODE_ALLOCA, - NODE_DMETHOD, - NODE_BMETHOD, - NODE_MEMO, - NODE_IFUNC, - NODE_DSYM, - NODE_ATTRASGN, - NODE_LAST -}; - -typedef struct RNode { - unsigned long flags; - char *nd_file; - union { - struct RNode *node; - ID id; - VALUE value; - VALUE (*cfunc)(ANYARGS); - ID *tbl; - } u1; - union { - struct RNode *node; - ID id; - long argc; - VALUE value; - } u2; - union { - struct RNode *node; - ID id; - long state; - struct global_entry *entry; - long cnt; - VALUE value; - } u3; -} NODE; - -extern NODE *ruby_cref; -extern NODE *ruby_top_cref; - -#define RNODE(obj) (R_CAST(RNode)(obj)) - -#define nd_type(n) ((int)(((RNODE(n))->flags>>FL_USHIFT)&0xff)) -#define nd_set_type(n,t) \ - RNODE(n)->flags=((RNODE(n)->flags&~FL_UMASK)|(((t)<flags>>NODE_LSHIFT)&NODE_LMASK)) -#define nd_set_line(n,l) \ - RNODE(n)->flags=((RNODE(n)->flags&~(-1< -#define USE_CONTEXT -#endif -#include -#include "st.h" - -#ifdef USE_CONTEXT -typedef struct { - ucontext_t context; - volatile int status; -} rb_jmpbuf_t[1]; -#else -typedef jmp_buf rb_jmpbuf_t; -#endif - -enum rb_thread_status { - THREAD_TO_KILL, - THREAD_RUNNABLE, - THREAD_STOPPED, - THREAD_KILLED -}; - -typedef struct rb_thread *rb_thread_t; - -struct rb_thread { - rb_thread_t next, prev; - rb_jmpbuf_t context; -#if (defined _WIN32 && !defined _WIN32_WCE) || defined __CYGWIN__ - unsigned long win32_exception_list; -#endif - - VALUE result; - - size_t stk_len; - size_t stk_max; - VALUE *stk_ptr; - VALUE *stk_pos; -#ifdef __ia64 - size_t bstr_len; - size_t bstr_max; - VALUE *bstr_ptr; - VALUE *bstr_pos; -#endif - - struct FRAME *frame; - struct SCOPE *scope; - struct RVarmap *dyna_vars; - struct BLOCK *block; - struct iter *iter; - struct tag *tag; - VALUE klass; - VALUE wrapper; - NODE *cref; - - int flags; /* misc. states (vmode/rb_trap_immediate/raised) */ - - NODE *node; - - int tracing; - VALUE errinfo; - VALUE last_status; - VALUE last_line; - VALUE last_match; - - int safe; - - enum rb_thread_status status; - int wait_for; - int fd; - fd_set readfds; - fd_set writefds; - fd_set exceptfds; - int select_value; - double delay; - rb_thread_t join; - - int abort; - int priority; - VALUE thgroup; - - struct st_table *locals; - - VALUE thread; - - VALUE sandbox; -}; - -extern VALUE (*ruby_sandbox_save)_((rb_thread_t)); -extern VALUE (*ruby_sandbox_restore)_((rb_thread_t)); -extern rb_thread_t rb_curr_thread; -extern rb_thread_t rb_main_thread; - -enum { - RAISED_EXCEPTION = 0x1000, - RAISED_STACKOVERFLOW = 0x2000, - RAISED_NOMEMORY = 0x4000, - RAISED_MASK = 0xf000 -}; -int rb_thread_set_raised(rb_thread_t th); -int rb_thread_reset_raised(rb_thread_t th); -#define rb_thread_raised_set(th, f) ((th)->flags |= (f)) -#define rb_thread_raised_reset(th, f) ((th)->flags &= ~(f)) -#define rb_thread_raised_p(th, f) (((th)->flags & (f)) != 0) -#define rb_thread_raised_clear(th) (rb_thread_raised_reset(th, RAISED_MASK)) - -#if defined(__cplusplus) -} /* extern "C" { */ -#endif - -#endif -/********************************************************************** - - re.h - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007) $ - created at: Thu Sep 30 14:18:32 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#ifndef RE_H -#define RE_H - -#include -#include - -#include "regex.h" - -typedef struct re_pattern_buffer Regexp; - -struct RMatch { - struct RBasic basic; - VALUE str; - struct re_registers *regs; -}; - -#define RMATCH(obj) (R_CAST(RMatch)(obj)) - -VALUE rb_reg_regcomp _((VALUE)); -long rb_reg_search _((VALUE, VALUE, long, long)); -VALUE rb_reg_regsub _((VALUE, VALUE, struct re_registers *)); -long rb_reg_adjust_startpos _((VALUE, VALUE, long, long)); -void rb_match_busy _((VALUE)); -VALUE rb_reg_quote _((VALUE)); - -RUBY_EXTERN int ruby_ignorecase; - -int rb_reg_mbclen2 _((unsigned int, VALUE)); -#define mbclen2(c,re) rb_reg_mbclen2((c),(re)) -#endif -/* Definitions for data structures and routines for the regular - expression library, version 0.12. - Copyright (C) 1985,89,90,91,92,93,95,96,97,98 Free Software Foundation, Inc. - - This file is part of the GNU C Library. Its master source is NOT part of - the C library, however. The master source lives in /gd/gnu/lib. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file LGPL. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ -/* Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto) - Last change: May 21, 1993 by t^2 */ -/* modified for Ruby by matz@netlab.co.jp */ - -#ifndef REGEX_H -#define REGEX_H - -/* symbol mangling for ruby */ -#ifdef RUBY -# define re_adjust_startpos ruby_re_adjust_startpos -# define re_compile_fastmap ruby_re_compile_fastmap -# define re_compile_pattern ruby_re_compile_pattern -# define re_copy_registers ruby_re_copy_registers -# define re_free_pattern ruby_re_free_pattern -# define re_free_registers ruby_re_free_registers -# define re_match ruby_re_match -# define re_mbcinit ruby_re_mbcinit -# define re_search ruby_re_search -# define re_set_casetable ruby_re_set_casetable -# define register_info_type ruby_register_info_type -#endif - -#include - -/* Define number of parens for which we record the beginnings and ends. - This affects how much space the `struct re_registers' type takes up. */ -#ifndef RE_NREGS -#define RE_NREGS 10 -#endif - -#define BYTEWIDTH 8 - -#define RE_REG_MAX ((1< -#endif - -#ifdef HAVE_STRING_H -# include -#else -# include -#endif - -#ifdef HAVE_INTRINSICS_H -# include -#endif - -#include -#include - -/* need to include to use these macros */ -#ifndef ISPRINT -#define ISASCII(c) isascii((int)(unsigned char)(c)) -#undef ISPRINT -#define ISPRINT(c) (ISASCII(c) && isprint((int)(unsigned char)(c))) -#define ISSPACE(c) (ISASCII(c) && isspace((int)(unsigned char)(c))) -#define ISUPPER(c) (ISASCII(c) && isupper((int)(unsigned char)(c))) -#define ISLOWER(c) (ISASCII(c) && islower((int)(unsigned char)(c))) -#define ISALNUM(c) (ISASCII(c) && isalnum((int)(unsigned char)(c))) -#define ISALPHA(c) (ISASCII(c) && isalpha((int)(unsigned char)(c))) -#define ISDIGIT(c) (ISASCII(c) && isdigit((int)(unsigned char)(c))) -#define ISXDIGIT(c) (ISASCII(c) && isxdigit((int)(unsigned char)(c))) -#endif - -#if defined(HAVE_ALLOCA_H) -#include -#else -# ifdef _AIX -#pragma alloca -# endif -#endif - -#if defined(__VMS) -# pragma builtins -# define alloca __alloca -#endif - -#if SIZEOF_LONG != SIZEOF_VOIDP -# error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<---- -#else -typedef unsigned long VALUE; -typedef unsigned long ID; -#endif - -#ifdef __STDC__ -# include -#else -# ifndef LONG_MAX -# ifdef HAVE_LIMITS_H -# include -# else - /* assuming 32bit(2's compliment) long */ -# define LONG_MAX 2147483647 -# endif -# endif -# ifndef LONG_MIN -# define LONG_MIN (-LONG_MAX-1) -# endif -# ifndef CHAR_BIT -# define CHAR_BIT 8 -# endif -#endif - -#ifdef HAVE_LONG_LONG -# ifndef LLONG_MAX -# ifdef LONG_LONG_MAX -# define LLONG_MAX LONG_LONG_MAX -# else -# ifdef _I64_MAX -# define LLONG_MAX _I64_MAX -# else - /* assuming 64bit(2's complement) long long */ -# define LLONG_MAX 9223372036854775807LL -# endif -# endif -# endif -# ifndef LLONG_MIN -# ifdef LONG_LONG_MIN -# define LLONG_MIN LONG_LONG_MIN -# else -# ifdef _I64_MIN -# define LLONG_MIN _I64_MIN -# else -# define LLONG_MIN (-LLONG_MAX-1) -# endif -# endif -# endif -#endif - -#define FIXNUM_MAX (LONG_MAX>>1) -#define FIXNUM_MIN RSHIFT((long)LONG_MIN,1) - -#define FIXNUM_FLAG 0x01 -#define INT2FIX(i) ((VALUE)(((long)(i))<<1 | FIXNUM_FLAG)) -#define LONG2FIX(i) INT2FIX(i) -#define rb_fix_new(v) INT2FIX(v) -VALUE rb_int2inum _((long)); -#define INT2NUM(v) rb_int2inum(v) -#define LONG2NUM(v) INT2NUM(v) -#define rb_int_new(v) rb_int2inum(v) -VALUE rb_uint2inum _((unsigned long)); -#define UINT2NUM(v) rb_uint2inum(v) -#define ULONG2NUM(v) UINT2NUM(v) -#define rb_uint_new(v) rb_uint2inum(v) - -#ifdef HAVE_LONG_LONG -VALUE rb_ll2inum _((LONG_LONG)); -#define LL2NUM(v) rb_ll2inum(v) -VALUE rb_ull2inum _((unsigned LONG_LONG)); -#define ULL2NUM(v) rb_ull2inum(v) -#endif - -#if SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_LONG_LONG) -# define OFFT2NUM(v) LL2NUM(v) -#elif SIZEOF_OFF_T == SIZEOF_LONG -# define OFFT2NUM(v) LONG2NUM(v) -#else -# define OFFT2NUM(v) INT2NUM(v) -#endif - -#define FIX2LONG(x) RSHIFT((long)x,1) -#define FIX2ULONG(x) (((unsigned long)(x))>>1) -#define FIXNUM_P(f) (((long)(f))&FIXNUM_FLAG) -#define POSFIXABLE(f) ((f) < FIXNUM_MAX+1) -#define NEGFIXABLE(f) ((f) >= FIXNUM_MIN) -#define FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f)) - -#define IMMEDIATE_MASK 0x03 -#define IMMEDIATE_P(x) ((VALUE)(x) & IMMEDIATE_MASK) - -#define SYMBOL_FLAG 0x0e -#define SYMBOL_P(x) (((VALUE)(x)&0xff)==SYMBOL_FLAG) -#define ID2SYM(x) ((VALUE)(((long)(x))<<8|SYMBOL_FLAG)) -#define SYM2ID(x) RSHIFT((unsigned long)x,8) - -/* special contants - i.e. non-zero and non-fixnum constants */ -#define Qfalse ((VALUE)0) -#define Qtrue ((VALUE)2) -#define Qnil ((VALUE)4) -#define Qundef ((VALUE)6) /* undefined value for placeholder */ - -#define RTEST(v) (((VALUE)(v) & ~Qnil) != 0) -#define NIL_P(v) ((VALUE)(v) == Qnil) - -#define CLASS_OF(v) rb_class_of((VALUE)(v)) - -#define T_NONE 0x00 - -#define T_NIL 0x01 -#define T_OBJECT 0x02 -#define T_CLASS 0x03 -#define T_ICLASS 0x04 -#define T_MODULE 0x05 -#define T_FLOAT 0x06 -#define T_STRING 0x07 -#define T_REGEXP 0x08 -#define T_ARRAY 0x09 -#define T_FIXNUM 0x0a -#define T_HASH 0x0b -#define T_STRUCT 0x0c -#define T_BIGNUM 0x0d -#define T_FILE 0x0e - -#define T_TRUE 0x20 -#define T_FALSE 0x21 -#define T_DATA 0x22 -#define T_MATCH 0x23 -#define T_SYMBOL 0x24 - -#define T_BLKTAG 0x3b -#define T_UNDEF 0x3c -#define T_VARMAP 0x3d -#define T_SCOPE 0x3e -#define T_NODE 0x3f - -#define T_MASK 0x3f - -#define BUILTIN_TYPE(x) (((struct RBasic*)(x))->flags & T_MASK) - -#define TYPE(x) rb_type((VALUE)(x)) - -void rb_check_type _((VALUE,int)); -#define Check_Type(v,t) rb_check_type((VALUE)(v),t) - -VALUE rb_str_to_str _((VALUE)); -VALUE rb_string_value _((volatile VALUE*)); -char *rb_string_value_ptr _((volatile VALUE*)); -char *rb_string_value_cstr _((volatile VALUE*)); - -#define StringValue(v) rb_string_value(&(v)) -#define StringValuePtr(v) rb_string_value_ptr(&(v)) -#define StringValueCStr(v) rb_string_value_cstr(&(v)) - -void rb_check_safe_obj _((VALUE)); -void rb_check_safe_str _((VALUE)); -#define SafeStringValue(v) do {\ - StringValue(v);\ - rb_check_safe_obj(v);\ -} while (0) -/* obsolete macro - use SafeStringValue(v) */ -#define Check_SafeStr(v) rb_check_safe_str((VALUE)(v)) - -void rb_secure _((int)); -RUBY_EXTERN int ruby_safe_level; -#define rb_safe_level() (ruby_safe_level) -void rb_set_safe_level _((int)); -void rb_secure_update _((VALUE)); - -long rb_num2long _((VALUE)); -unsigned long rb_num2ulong _((VALUE)); -#define NUM2LONG(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2long((VALUE)x)) -#define NUM2ULONG(x) rb_num2ulong((VALUE)x) -#if SIZEOF_INT < SIZEOF_LONG -long rb_num2int _((VALUE)); -#define NUM2INT(x) (FIXNUM_P(x)?FIX2INT(x):rb_num2int((VALUE)x)) -long rb_fix2int _((VALUE)); -#define FIX2INT(x) rb_fix2int((VALUE)x) -unsigned long rb_num2uint _((VALUE)); -#define NUM2UINT(x) rb_num2uint(x) -unsigned long rb_fix2uint _((VALUE)); -#define FIX2UINT(x) rb_fix2uint(x) -#else -#define NUM2INT(x) ((int)NUM2LONG(x)) -#define NUM2UINT(x) ((unsigned int)NUM2ULONG(x)) -#define FIX2INT(x) ((int)FIX2LONG(x)) -#define FIX2UINT(x) ((unsigned int)FIX2ULONG(x)) -#endif - -#ifdef HAVE_LONG_LONG -LONG_LONG rb_num2ll _((VALUE)); -unsigned LONG_LONG rb_num2ull _((VALUE)); -# define NUM2LL(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2ll((VALUE)x)) -# define NUM2ULL(x) rb_num2ull((VALUE)x) -#endif - -#if defined(HAVE_LONG_LONG) && SIZEOF_OFF_T > SIZEOF_LONG -# define NUM2OFFT(x) ((off_t)NUM2LL(x)) -#else -# define NUM2OFFT(x) NUM2LONG(x) -#endif - -double rb_num2dbl _((VALUE)); -#define NUM2DBL(x) rb_num2dbl((VALUE)(x)) - -/* obsolete API - use StringValue() */ -char *rb_str2cstr _((VALUE,long*)); -/* obsolete API - use StringValuePtr() */ -#define STR2CSTR(x) rb_str2cstr((VALUE)(x),0) - -#define NUM2CHR(x) (((TYPE(x) == T_STRING)&&(RSTRING(x)->len>=1))?\ - RSTRING(x)->ptr[0]:(char)(NUM2INT(x)&0xff)) -#define CHR2FIX(x) INT2FIX((long)((x)&0xff)) - -VALUE rb_newobj _((void)); -#define NEWOBJ(obj,type) type *obj = (type*)rb_newobj() -#define OBJSETUP(obj,c,t) do {\ - RBASIC(obj)->flags = (t);\ - RBASIC(obj)->klass = (c);\ - if (rb_safe_level() >= 3) FL_SET(obj, FL_TAINT);\ -} while (0) -#define CLONESETUP(clone,obj) do {\ - OBJSETUP(clone,rb_singleton_class_clone((VALUE)obj),RBASIC(obj)->flags);\ - rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);\ - if (FL_TEST(obj, FL_EXIVAR)) rb_copy_generic_ivar((VALUE)clone,(VALUE)obj);\ -} while (0) -#define DUPSETUP(dup,obj) do {\ - OBJSETUP(dup,rb_obj_class(obj),(RBASIC(obj)->flags)&(T_MASK|FL_EXIVAR|FL_TAINT));\ - if (FL_TEST(obj, FL_EXIVAR)) rb_copy_generic_ivar((VALUE)dup,(VALUE)obj);\ -} while (0) - -struct RBasic { - unsigned long flags; - VALUE klass; -}; - -struct RObject { - struct RBasic basic; - struct st_table *iv_tbl; -}; - -struct RClass { - struct RBasic basic; - struct st_table *iv_tbl; - struct st_table *m_tbl; - VALUE super; -}; - -struct RFloat { - struct RBasic basic; - double value; -}; - -#define ELTS_SHARED FL_USER2 - -struct RString { - struct RBasic basic; - long len; - char *ptr; - union { - long capa; - VALUE shared; - } aux; -}; -#define RSTRING_PTR(s) (RSTRING(s)->ptr) -#define RSTRING_LEN(s) (RSTRING(s)->len) - -struct RArray { - struct RBasic basic; - long len; - union { - long capa; - VALUE shared; - } aux; - VALUE *ptr; -}; -#define RARRAY_PTR(s) (RARRAY(s)->ptr) -#define RARRAY_LEN(s) (RARRAY(s)->len) - -struct RRegexp { - struct RBasic basic; - struct re_pattern_buffer *ptr; - long len; - char *str; -}; - -struct RHash { - struct RBasic basic; - struct st_table *tbl; - int iter_lev; - VALUE ifnone; -}; - -struct RFile { - struct RBasic basic; - struct OpenFile *fptr; -}; - -struct RData { - struct RBasic basic; - void (*dmark) _((void*)); - void (*dfree) _((void*)); - void *data; -}; - -#define DATA_PTR(dta) (RDATA(dta)->data) - -/* -#define RUBY_DATA_FUNC(func) ((void (*)_((void*)))func) -*/ -typedef void (*RUBY_DATA_FUNC) _((void*)); - -VALUE rb_data_object_alloc _((VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC)); - -#define Data_Wrap_Struct(klass,mark,free,sval)\ - rb_data_object_alloc(klass,sval,(RUBY_DATA_FUNC)mark,(RUBY_DATA_FUNC)free) - -#define Data_Make_Struct(klass,type,mark,free,sval) (\ - sval = ALLOC(type),\ - memset(sval, 0, sizeof(type)),\ - Data_Wrap_Struct(klass,mark,free,sval)\ -) - -#define Data_Get_Struct(obj,type,sval) do {\ - Check_Type(obj, T_DATA); \ - sval = (type*)DATA_PTR(obj);\ -} while (0) - -struct RStruct { - struct RBasic basic; - long len; - VALUE *ptr; -}; -#define RSTRUCT_LEN(st) (RSTRUCT(st)->len) -#define RSTRUCT_PTR(st) (RSTRUCT(st)->ptr) - -struct RBignum { - struct RBasic basic; - char sign; - long len; - void *digits; -}; - -#define R_CAST(st) (struct st*) -#define RBASIC(obj) (R_CAST(RBasic)(obj)) -#define ROBJECT(obj) (R_CAST(RObject)(obj)) -#define RCLASS(obj) (R_CAST(RClass)(obj)) -#define RMODULE(obj) RCLASS(obj) -#define RFLOAT(obj) (R_CAST(RFloat)(obj)) -#define RSTRING(obj) (R_CAST(RString)(obj)) -#define RREGEXP(obj) (R_CAST(RRegexp)(obj)) -#define RARRAY(obj) (R_CAST(RArray)(obj)) -#define RHASH(obj) (R_CAST(RHash)(obj)) -#define RDATA(obj) (R_CAST(RData)(obj)) -#define RSTRUCT(obj) (R_CAST(RStruct)(obj)) -#define RBIGNUM(obj) (R_CAST(RBignum)(obj)) -#define RFILE(obj) (R_CAST(RFile)(obj)) - -#define FL_SINGLETON FL_USER0 -#define FL_MARK (1<<6) -#define FL_FINALIZE (1<<7) -#define FL_TAINT (1<<8) -#define FL_EXIVAR (1<<9) -#define FL_FREEZE (1<<10) - -#define FL_USHIFT 11 - -#define FL_USER0 (1<<(FL_USHIFT+0)) -#define FL_USER1 (1<<(FL_USHIFT+1)) -#define FL_USER2 (1<<(FL_USHIFT+2)) -#define FL_USER3 (1<<(FL_USHIFT+3)) -#define FL_USER4 (1<<(FL_USHIFT+4)) -#define FL_USER5 (1<<(FL_USHIFT+5)) -#define FL_USER6 (1<<(FL_USHIFT+6)) -#define FL_USER7 (1<<(FL_USHIFT+7)) - -#define FL_UMASK (0xff<flags&(f)):0) -#define FL_SET(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags |= (f);} while (0) -#define FL_UNSET(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags &= ~(f);} while (0) -#define FL_REVERSE(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags ^= (f);} while (0) - -#define OBJ_TAINTED(x) FL_TEST((x), FL_TAINT) -#define OBJ_TAINT(x) FL_SET((x), FL_TAINT) -#define OBJ_INFECT(x,s) do {if (FL_ABLE(x) && FL_ABLE(s)) RBASIC(x)->flags |= RBASIC(s)->flags & FL_TAINT;} while (0) - -#define OBJ_FROZEN(x) FL_TEST((x), FL_FREEZE) -#define OBJ_FREEZE(x) FL_SET((x), FL_FREEZE) - -#define ALLOC_N(type,n) (type*)xmalloc(sizeof(type)*(n)) -#define ALLOC(type) (type*)xmalloc(sizeof(type)) -#define REALLOC_N(var,type,n) (var)=(type*)xrealloc((char*)(var),sizeof(type)*(n)) - -#define ALLOCA_N(type,n) (type*)alloca(sizeof(type)*(n)) - -#define MEMZERO(p,type,n) memset((p), 0, sizeof(type)*(n)) -#define MEMCPY(p1,p2,type,n) memcpy((p1), (p2), sizeof(type)*(n)) -#define MEMMOVE(p1,p2,type,n) memmove((p1), (p2), sizeof(type)*(n)) -#define MEMCMP(p1,p2,type,n) memcmp((p1), (p2), sizeof(type)*(n)) - -void rb_obj_infect _((VALUE,VALUE)); - -typedef int ruby_glob_func(const char*,VALUE); -void rb_glob _((const char*,void(*)(const char*,VALUE),VALUE)); -void rb_globi _((const char*,void(*)(const char*,VALUE),VALUE)); -int ruby_brace_expand _((const char*,int,ruby_glob_func*,VALUE)); -int ruby_brace_glob _((const char*,int,ruby_glob_func*,VALUE)); - -VALUE rb_define_class _((const char*,VALUE)); -VALUE rb_define_module _((const char*)); -VALUE rb_define_class_under _((VALUE, const char*, VALUE)); -VALUE rb_define_module_under _((VALUE, const char*)); - -void rb_include_module _((VALUE,VALUE)); -void rb_extend_object _((VALUE,VALUE)); - -void rb_define_variable _((const char*,VALUE*)); -void rb_define_virtual_variable _((const char*,VALUE(*)(ANYARGS),void(*)(ANYARGS))); -void rb_define_hooked_variable _((const char*,VALUE*,VALUE(*)(ANYARGS),void(*)(ANYARGS))); -int ruby_glob _((const char*,int,int(*)(const char*,VALUE),VALUE)); -int ruby_globi _((const char*,int,int(*)(const char*,VALUE),VALUE)); -void rb_define_readonly_variable _((const char*,VALUE*)); -void rb_define_const _((VALUE,const char*,VALUE)); -void rb_define_global_const _((const char*,VALUE)); - -#define RUBY_METHOD_FUNC(func) ((VALUE (*)(ANYARGS))func) -void rb_define_method _((VALUE,const char*,VALUE(*)(ANYARGS),int)); -void rb_define_module_function _((VALUE,const char*,VALUE(*)(ANYARGS),int)); -void rb_define_global_function _((const char*,VALUE(*)(ANYARGS),int)); - -void rb_undef_method _((VALUE,const char*)); -void rb_define_alias _((VALUE,const char*,const char*)); -void rb_define_attr _((VALUE,const char*,int,int)); - -void rb_global_variable _((VALUE*)); -void rb_gc_register_address _((VALUE*)); -void rb_gc_unregister_address _((VALUE*)); - -ID rb_intern _((const char*)); -char *rb_id2name _((ID)); -ID rb_to_id _((VALUE)); - -char *rb_class2name _((VALUE)); -char *rb_obj_classname _((VALUE)); - -void rb_p _((VALUE)); - -VALUE rb_eval_string _((const char*)); -VALUE rb_eval_string_protect _((const char*, int*)); -VALUE rb_eval_string_wrap _((const char*, int*)); -VALUE rb_funcall __((VALUE, ID, int, ...)); -VALUE rb_funcall2 _((VALUE, ID, int, const VALUE*)); -VALUE rb_funcall3 _((VALUE, ID, int, const VALUE*)); -int rb_scan_args __((int, const VALUE*, const char*, ...)); -VALUE rb_call_super _((int, const VALUE*)); - -VALUE rb_gv_set _((const char*, VALUE)); -VALUE rb_gv_get _((const char*)); -VALUE rb_iv_get _((VALUE, const char*)); -VALUE rb_iv_set _((VALUE, const char*, VALUE)); - -VALUE rb_equal _((VALUE,VALUE)); - -RUBY_EXTERN VALUE ruby_verbose, ruby_debug; - -NORETURN(void rb_raise __((VALUE, const char*, ...))); -NORETURN(void rb_fatal __((const char*, ...))); -NORETURN(void rb_bug __((const char*, ...))); -NORETURN(void rb_sys_fail _((const char*))); -NORETURN(void rb_iter_break _((void))); -NORETURN(void rb_exit _((int))); -NORETURN(void rb_notimplement _((void))); - -void rb_warning __((const char*, ...)); /* reports if `-w' specified */ -void rb_sys_warning __((const char*, ...)); /* reports if `-w' specified */ -void rb_warn __((const char*, ...)); /* reports always */ - -VALUE rb_each _((VALUE)); -VALUE rb_yield _((VALUE)); -VALUE rb_yield_values __((int n, ...)); -VALUE rb_yield_splat _((VALUE)); -int rb_block_given_p _((void)); -void rb_need_block _((void)); -VALUE rb_iterate _((VALUE(*)(VALUE),VALUE,VALUE(*)(ANYARGS),VALUE)); -VALUE rb_rescue _((VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE)); -VALUE rb_rescue2 __((VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE,...)); -VALUE rb_ensure _((VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE)); -VALUE rb_catch _((const char*,VALUE(*)(ANYARGS),VALUE)); -NORETURN(void rb_throw _((const char*,VALUE))); - -VALUE rb_require _((const char*)); - -#ifdef __ia64 -void ruby_init_stack(VALUE*, void*); -#define RUBY_INIT_STACK \ - VALUE variable_in_this_stack_frame; \ - ruby_init_stack(&variable_in_this_stack_frame, rb_ia64_bsp()); -#else -void ruby_init_stack(VALUE*); -#define RUBY_INIT_STACK \ - VALUE variable_in_this_stack_frame; \ - ruby_init_stack(&variable_in_this_stack_frame); -#endif -void ruby_init _((void)); -void ruby_options _((int, char**)); -NORETURN(void ruby_run _((void))); - -RUBY_EXTERN VALUE rb_mKernel; -RUBY_EXTERN VALUE rb_mComparable; -RUBY_EXTERN VALUE rb_mEnumerable; -RUBY_EXTERN VALUE rb_mPrecision; -RUBY_EXTERN VALUE rb_mErrno; -RUBY_EXTERN VALUE rb_mFileTest; -RUBY_EXTERN VALUE rb_mGC; -RUBY_EXTERN VALUE rb_mMath; -RUBY_EXTERN VALUE rb_mProcess; - -RUBY_EXTERN VALUE rb_cObject; -RUBY_EXTERN VALUE rb_cArray; -RUBY_EXTERN VALUE rb_cBignum; -RUBY_EXTERN VALUE rb_cBinding; -RUBY_EXTERN VALUE rb_cClass; -RUBY_EXTERN VALUE rb_cCont; -RUBY_EXTERN VALUE rb_cDir; -RUBY_EXTERN VALUE rb_cData; -RUBY_EXTERN VALUE rb_cFalseClass; -RUBY_EXTERN VALUE rb_cFile; -RUBY_EXTERN VALUE rb_cFixnum; -RUBY_EXTERN VALUE rb_cFloat; -RUBY_EXTERN VALUE rb_cHash; -RUBY_EXTERN VALUE rb_cInteger; -RUBY_EXTERN VALUE rb_cIO; -RUBY_EXTERN VALUE rb_cMatch; -RUBY_EXTERN VALUE rb_cMethod; -RUBY_EXTERN VALUE rb_cModule; -RUBY_EXTERN VALUE rb_cNameErrorMesg; -RUBY_EXTERN VALUE rb_cNilClass; -RUBY_EXTERN VALUE rb_cNumeric; -RUBY_EXTERN VALUE rb_cProc; -RUBY_EXTERN VALUE rb_cRange; -RUBY_EXTERN VALUE rb_cRegexp; -RUBY_EXTERN VALUE rb_cStat; -RUBY_EXTERN VALUE rb_cString; -RUBY_EXTERN VALUE rb_cStruct; -RUBY_EXTERN VALUE rb_cSymbol; -RUBY_EXTERN VALUE rb_cThread; -RUBY_EXTERN VALUE rb_cTime; -RUBY_EXTERN VALUE rb_cTrueClass; -RUBY_EXTERN VALUE rb_cUnboundMethod; - -RUBY_EXTERN VALUE rb_eException; -RUBY_EXTERN VALUE rb_eStandardError; -RUBY_EXTERN VALUE rb_eSystemExit; -RUBY_EXTERN VALUE rb_eInterrupt; -RUBY_EXTERN VALUE rb_eSignal; -RUBY_EXTERN VALUE rb_eFatal; -RUBY_EXTERN VALUE rb_eArgError; -RUBY_EXTERN VALUE rb_eEOFError; -RUBY_EXTERN VALUE rb_eIndexError; -RUBY_EXTERN VALUE rb_eRangeError; -RUBY_EXTERN VALUE rb_eIOError; -RUBY_EXTERN VALUE rb_eRuntimeError; -RUBY_EXTERN VALUE rb_eSecurityError; -RUBY_EXTERN VALUE rb_eSystemCallError; -RUBY_EXTERN VALUE rb_eThreadError; -RUBY_EXTERN VALUE rb_eTypeError; -RUBY_EXTERN VALUE rb_eZeroDivError; -RUBY_EXTERN VALUE rb_eNotImpError; -RUBY_EXTERN VALUE rb_eNoMemError; -RUBY_EXTERN VALUE rb_eNoMethodError; -RUBY_EXTERN VALUE rb_eFloatDomainError; -RUBY_EXTERN VALUE rb_eLocalJumpError; -RUBY_EXTERN VALUE rb_eSysStackError; -RUBY_EXTERN VALUE rb_eRegexpError; - -RUBY_EXTERN VALUE rb_eScriptError; -RUBY_EXTERN VALUE rb_eNameError; -RUBY_EXTERN VALUE rb_eSyntaxError; -RUBY_EXTERN VALUE rb_eLoadError; - -RUBY_EXTERN VALUE rb_stdin, rb_stdout, rb_stderr; -RUBY_EXTERN VALUE ruby_errinfo; - -static inline VALUE -#if defined(HAVE_PROTOTYPES) -rb_class_of(VALUE obj) -#else -rb_class_of(obj) - VALUE obj; -#endif -{ - if (FIXNUM_P(obj)) return rb_cFixnum; - if (obj == Qnil) return rb_cNilClass; - if (obj == Qfalse) return rb_cFalseClass; - if (obj == Qtrue) return rb_cTrueClass; - if (SYMBOL_P(obj)) return rb_cSymbol; - - return RBASIC(obj)->klass; -} - -static inline int -#if defined(HAVE_PROTOTYPES) -rb_type(VALUE obj) -#else -rb_type(obj) - VALUE obj; -#endif -{ - if (FIXNUM_P(obj)) return T_FIXNUM; - if (obj == Qnil) return T_NIL; - if (obj == Qfalse) return T_FALSE; - if (obj == Qtrue) return T_TRUE; - if (obj == Qundef) return T_UNDEF; - if (SYMBOL_P(obj)) return T_SYMBOL; - return BUILTIN_TYPE(obj); -} - -static inline int -#if defined(HAVE_PROTOTYPES) -rb_special_const_p(VALUE obj) -#else -rb_special_const_p(obj) - VALUE obj; -#endif -{ - if (SPECIAL_CONST_P(obj)) return Qtrue; - return Qfalse; -} - -#include "missing.h" -#include "intern.h" - -#if defined(EXTLIB) && defined(USE_DLN_A_OUT) -/* hook for external modules */ -static char *dln_libs_to_be_linked[] = { EXTLIB, 0 }; -#endif - -#if defined(HAVE_LIBPTHREAD) -#ifdef HAVE_PTHREAD_H -#include -#endif -typedef pthread_t rb_nativethread_t; -# define NATIVETHREAD_CURRENT() pthread_self() -# define NATIVETHREAD_EQUAL(t1,t2) pthread_equal((t1),(t2)) -# define HAVE_NATIVETHREAD - -# define NATIVETHREAD_KILL(th,sig) pthread_kill((th),(sig)) -# define HAVE_NATIVETHREAD_KILL -#elif defined(_WIN32) || defined(_WIN32_WCE) -typedef DWORD rb_nativethread_t; -# define NATIVETHREAD_CURRENT() GetCurrentThreadId() -# define NATIVETHREAD_EQUAL(t1,t2) ((t1) == (t2)) -# define HAVE_NATIVETHREAD -#endif -#ifdef HAVE_NATIVETHREAD -int is_ruby_native_thread _((void)); -#else -#define is_ruby_native_thread() (1) -#endif -#ifdef HAVE_NATIVETHREAD_KILL -void ruby_native_thread_kill _((int)); -#endif - -#if defined(__cplusplus) -#if 0 -{ /* satisfy cc-mode */ -#endif -} /* extern "C" { */ -#endif - -#endif /* ifndef RUBY_H */ -/********************************************************************** - - rubyio.h - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007) $ - created at: Fri Nov 12 16:47:09 JST 1993 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#ifndef RUBYIO_H -#define RUBYIO_H - -#include -#include - -#if defined(HAVE_STDIO_EXT_H) -#include -#endif - -typedef struct OpenFile { - FILE *f; /* stdio ptr for read/write */ - FILE *f2; /* additional ptr for rw pipes */ - int mode; /* mode flags */ - int pid; /* child's pid (for pipes) */ - int lineno; /* number of lines read */ - char *path; /* pathname for file */ - void (*finalize) _((struct OpenFile*,int)); /* finalize proc */ -} OpenFile; - -#define FMODE_READABLE 1 -#define FMODE_WRITABLE 2 -#define FMODE_READWRITE 3 -#define FMODE_APPEND 64 -#define FMODE_CREATE 128 -#define FMODE_BINMODE 4 -#define FMODE_SYNC 8 -#define FMODE_WBUF 16 -#define FMODE_RBUF 32 -#define FMODE_WSPLIT 0x200 -#define FMODE_WSPLIT_INITIALIZED 0x400 - -#define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr) - -#define MakeOpenFile(obj, fp) do {\ - if (RFILE(obj)->fptr) {\ - rb_io_close(obj);\ - free(RFILE(obj)->fptr);\ - RFILE(obj)->fptr = 0;\ - }\ - fp = 0;\ - fp = RFILE(obj)->fptr = ALLOC(OpenFile);\ - fp->f = fp->f2 = NULL;\ - fp->mode = 0;\ - fp->pid = 0;\ - fp->lineno = 0;\ - fp->path = NULL;\ - fp->finalize = 0;\ -} while (0) - -#define GetReadFile(fptr) ((fptr)->f) -#define GetWriteFile(fptr) (((fptr)->f2) ? (fptr)->f2 : (fptr)->f) - -FILE *rb_fopen _((const char*, const char*)); -FILE *rb_fdopen _((int, const char*)); -int rb_getc _((FILE*)); -long rb_io_fread _((char *, long, FILE *)); -long rb_io_fwrite _((const char *, long, FILE *)); -int rb_io_mode_flags _((const char*)); -int rb_io_modenum_flags _((int)); -void rb_io_check_writable _((OpenFile*)); -void rb_io_check_readable _((OpenFile*)); -void rb_io_fptr_finalize _((OpenFile*)); -void rb_io_synchronized _((OpenFile*)); -void rb_io_check_initialized _((OpenFile*)); -void rb_io_check_closed _((OpenFile*)); -int rb_io_wait_readable _((int)); -int rb_io_wait_writable _((int)); -void rb_io_set_nonblock(OpenFile *fptr); - -VALUE rb_io_taint_check _((VALUE)); -NORETURN(void rb_eof_error _((void))); - -void rb_read_check _((FILE*)); -int rb_read_pending _((FILE*)); -#endif -/********************************************************************** - - rubysig.h - - - $Author: shyouhei $ - $Date: 2009-01-05 03:13:40 +0100 (Mon, 05 Jan 2009) $ - created at: Wed Aug 16 01:15:38 JST 1995 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#ifndef SIG_H -#define SIG_H -#include - -#ifdef _WIN32 -typedef LONG rb_atomic_t; - -# define ATOMIC_TEST(var) InterlockedExchange(&(var), 0) -# define ATOMIC_SET(var, val) InterlockedExchange(&(var), (val)) -# define ATOMIC_INC(var) InterlockedIncrement(&(var)) -# define ATOMIC_DEC(var) InterlockedDecrement(&(var)) - -/* Windows doesn't allow interrupt while system calls */ -# define TRAP_BEG do {\ - int saved_errno = 0;\ - rb_atomic_t trap_immediate = ATOMIC_SET(rb_trap_immediate, 1) -# define TRAP_END\ - ATOMIC_SET(rb_trap_immediate, trap_immediate);\ - saved_errno = errno;\ - CHECK_INTS;\ - errno = saved_errno;\ -} while (0) -# define RUBY_CRITICAL(statements) do {\ - rb_w32_enter_critical();\ - statements;\ - rb_w32_leave_critical();\ -} while (0) -#else -typedef int rb_atomic_t; - -# define ATOMIC_TEST(var) ((var) ? ((var) = 0, 1) : 0) -# define ATOMIC_SET(var, val) ((var) = (val)) -# define ATOMIC_INC(var) (++(var)) -# define ATOMIC_DEC(var) (--(var)) - -# define TRAP_BEG do {\ - int saved_errno = 0;\ - int trap_immediate = rb_trap_immediate;\ - rb_trap_immediate = 1 -# define TRAP_END rb_trap_immediate = trap_immediate;\ - saved_errno = errno;\ - CHECK_INTS;\ - errno = saved_errno;\ -} while (0) - -# define RUBY_CRITICAL(statements) do {\ - int trap_immediate = rb_trap_immediate;\ - rb_trap_immediate = 0;\ - statements;\ - rb_trap_immediate = trap_immediate;\ -} while (0) -#endif -RUBY_EXTERN rb_atomic_t rb_trap_immediate; - -RUBY_EXTERN int rb_prohibit_interrupt; -#define DEFER_INTS (rb_prohibit_interrupt++) -#define ALLOW_INTS do {\ - rb_prohibit_interrupt--;\ - CHECK_INTS;\ -} while (0) -#define ENABLE_INTS (rb_prohibit_interrupt--) - -VALUE rb_with_disable_interrupt _((VALUE(*)(ANYARGS),VALUE)); - -RUBY_EXTERN rb_atomic_t rb_trap_pending; -void rb_trap_restore_mask _((void)); - -RUBY_EXTERN int rb_thread_critical; -RUBY_EXTERN int rb_thread_pending; -void rb_thread_schedule _((void)); -#if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE) -# define CHECK_INTS do {\ - if (!(rb_prohibit_interrupt || rb_thread_critical)) {\ - if (rb_thread_pending) rb_thread_schedule();\ - if (rb_trap_pending) rb_trap_exec();\ - }\ -} while (0) -#else -/* pseudo preemptive thread switching */ -RUBY_EXTERN int rb_thread_tick; -#define THREAD_TICK 500 -#define CHECK_INTS do {\ - if (!(rb_prohibit_interrupt || rb_thread_critical)) {\ - if (rb_thread_pending || rb_thread_tick-- <= 0) {\ - rb_thread_tick = THREAD_TICK;\ - rb_thread_schedule();\ - }\ - }\ - if (rb_trap_pending) rb_trap_exec();\ -} while (0) -#endif - -#endif -/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */ - -/* @(#) st.h 5.1 89/12/14 */ - -#ifndef ST_INCLUDED - -#define ST_INCLUDED - -#if SIZEOF_LONG == SIZEOF_VOIDP -typedef unsigned long st_data_t; -#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP -typedef unsigned LONG_LONG st_data_t; -#else -# error ---->> st.c requires sizeof(void*) == sizeof(long) to be compiled. <<--- -- -#endif -#define ST_DATA_T_DEFINED - -typedef struct st_table st_table; - -struct st_hash_type { - int (*compare)(); - int (*hash)(); -}; - -struct st_table { - struct st_hash_type *type; - int num_bins; - int num_entries; - struct st_table_entry **bins; -}; - -#define st_is_member(table,key) st_lookup(table,key,(st_data_t *)0) - -enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK}; - -#ifndef _ -# define _(args) args -#endif -#ifndef ANYARGS -# ifdef __cplusplus -# define ANYARGS ... -# else -# define ANYARGS -# endif -#endif - -st_table *st_init_table _((struct st_hash_type *)); -st_table *st_init_table_with_size _((struct st_hash_type *, int)); -st_table *st_init_numtable _((void)); -st_table *st_init_numtable_with_size _((int)); -st_table *st_init_strtable _((void)); -st_table *st_init_strtable_with_size _((int)); -int st_delete _((st_table *, st_data_t *, st_data_t *)); -int st_delete_safe _((st_table *, st_data_t *, st_data_t *, st_data_t)); -int st_insert _((st_table *, st_data_t, st_data_t)); -int st_lookup _((st_table *, st_data_t, st_data_t *)); -int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t)); -void st_add_direct _((st_table *, st_data_t, st_data_t)); -void st_free_table _((st_table *)); -void st_cleanup_safe _((st_table *, st_data_t)); -st_table *st_copy _((st_table *)); - -#define ST_NUMCMP ((int (*)()) 0) -#define ST_NUMHASH ((int (*)()) -2) - -#define st_numcmp ST_NUMCMP -#define st_numhash ST_NUMHASH - -int st_strhash(); - -#endif /* ST_INCLUDED */ -/********************************************************************** - - util.h - - - $Author: shyouhei $ - $Date: 2007-02-13 00:01:19 +0100 (Tue, 13 Feb 2007) $ - created at: Thu Mar 9 11:55:53 JST 1995 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#ifndef UTIL_H -#define UTIL_H - -#ifndef _ -#ifdef __cplusplus -# ifndef HAVE_PROTOTYPES -# define HAVE_PROTOTYPES 1 -# endif -# ifndef HAVE_STDARG_PROTOTYPES -# define HAVE_STDARG_PROTOTYPES 1 -# endif -#endif -#ifdef HAVE_PROTOTYPES -# define _(args) args -#else -# define _(args) () -#endif -#ifdef HAVE_STDARG_PROTOTYPES -# define __(args) args -#else -# define __(args) () -#endif -#endif - -#define scan_oct ruby_scan_oct -unsigned long scan_oct _((const char*, int, int*)); -#define scan_hex ruby_scan_hex -unsigned long scan_hex _((const char*, int, int*)); - -#if defined(MSDOS) || defined(__CYGWIN32__) || defined(_WIN32) -void ruby_add_suffix(); -#endif - -void ruby_qsort _((void*, const int, const int, int (*)(), void*)); -#define qsort(b,n,s,c,d) ruby_qsort(b,n,s,c,d) - -void ruby_setenv _((const char*, const char*)); -void ruby_unsetenv _((const char*)); -#undef setenv -#undef unsetenv -#define setenv(name,val) ruby_setenv(name,val) -#define unsetenv(name,val) ruby_unsetenv(name); - -char *ruby_strdup _((const char*)); -#undef strdup -#define strdup(s) ruby_strdup(s) - -char *ruby_getcwd _((void)); -#define my_getcwd() ruby_getcwd() - -double ruby_strtod _((const char*, char **)); -#undef strtod -#define strtod(s,e) ruby_strtod(s,e) - -#endif /* UTIL_H */ -#define RUBY_VERSION "1.8.6" -#define RUBY_RELEASE_DATE "2009-09-09" -#define RUBY_VERSION_CODE 186 -#define RUBY_RELEASE_CODE 20090909 -#define RUBY_PATCHLEVEL 388 - -#define RUBY_VERSION_MAJOR 1 -#define RUBY_VERSION_MINOR 8 -#define RUBY_VERSION_TEENY 6 -#define RUBY_RELEASE_YEAR 2009 -#define RUBY_RELEASE_MONTH 9 -#define RUBY_RELEASE_DAY 9 - -#ifdef RUBY_EXTERN -RUBY_EXTERN const char ruby_version[]; -RUBY_EXTERN const char ruby_release_date[]; -RUBY_EXTERN const char ruby_platform[]; -RUBY_EXTERN const int ruby_patchlevel; -#endif - diff --git a/test/scanners/c/strange.expected.raydebug b/test/scanners/c/strange.expected.raydebug deleted file mode 100644 index 27d0fa3..0000000 --- a/test/scanners/c/strange.expected.raydebug +++ /dev/null @@ -1,90 +0,0 @@ -preprocessor(#include) include("ruby.h") comment(/* - /sLaSh * - oBfUsCaTeD RuBy * - cOpYrIgHt 2005 * -bY SiMoN StRaNdGaArD * - #{X=320;Y=200;Z=20} */) - -preprocessor(#define) ident(GUN1) integer(42)operator(:) -preprocessor(#define) ident(GUN2) integer(43)operator(:) -preprocessor(#define) ident(bo) reserved(do) -preprocessor(#define) ident(when)operator(()ident(gun)operator(\)) comment(/**/) -preprocessor(#define) ident(DATA) string -preprocessor(#define) ident(DIRTY)operator(()ident(argc)operator(,)ident(argv)operator(\))\ -ident(argc)operator(,)ident(argv)operator(,)pre_type(char)operator(=)ident(eval)operator(()\ -string\ -operator(\);)ident(sun)operator(=)ident(O)operator(.)ident(new)\ -reserved(if)operator(()integer(0)operator(\)) - -pre_type(int) -ident(sun)operator([]={)integer(12)operator(,)integer(9)operator(,)integer(16)operator(,)integer(9)operator(,)integer(2)operator(,)integer(1)operator(,)integer(7)operator(,)integer(1)operator(,)integer(3)operator(,)integer(9)operator(,)integer(27)operator(,)integer(4)operator(,) integer(13)operator(,)integer(2)operator(,)integer(11)operator(,)integer(5)operator(,)integer(4)operator(,)integer(1)operator(,)integer(25)operator(,) -integer(5)operator(,)integer(0)operator(,)integer(1)operator(,)integer(14)operator(,)integer(9)operator(,)integer(15)operator(,)integer(4)operator(,)integer(26)operator(,)integer(9)operator(,)integer(23)operator(,)integer(2)operator(,)integer(17)operator(,)integer(6)operator(,)integer(31)operator(,) integer(6)operator(,)integer(10)operator(,)integer(8)operator(,)integer(22)operator(,)integer(9)operator(,)integer(21)operator(,)integer(1)operator(,) -integer(24)operator(,)integer(8)operator(,)integer(20)operator(,)integer(8)operator(,)integer(18)operator(,)integer(9)operator(,)integer(29)operator(,)integer(5)operator(,)integer(9)operator(,)integer(5)operator(,)integer(1)operator(,)integer(1)operator(,)integer(28)operator(,)integer(8)operator(,)integer(8)operator(,)integer(1)operator(,)integer(30)operator(,) integer(9)operator(,)integer(6)operator(,)integer(8)operator(,) integer(5)operator(,)integer(1)operator(,) -integer(19)operator(,)integer(9)operator(,)integer(36)operator(,)integer(19)operator(,)integer(43)operator(,) integer(9)operator(,)integer(34)operator(,)integer(11)operator(,)integer(50)operator(,)integer(19)operator(,)integer(48)operator(,)integer(18)operator(,)integer(49)operator(,)integer(9)operator(,) integer(35)operator(,)integer(8)operator(,)integer(42)operator(,)integer(18)operator(,) -integer(51)operator(,)integer(8)operator(,)integer(44)operator(,)integer(11)operator(,)integer(32)operator(,) integer(11)operator(,)integer(47)operator(,)integer(9)operator(,)integer(37)operator(,)integer(1)operator(,)integer(39)operator(,)integer(9)operator(,)integer(38)operator(,)integer(19)operator(,) integer(45)operator(,)integer(8)operator(,)integer(40)operator(,)integer(12)operator(,) -integer(41)operator(,)integer(9)operator(,)integer(46)operator(,)integer(12)operator(,)integer(33)operator(,)integer(1)operator(,)integer(57)operator(,)integer(1)operator(,)integer(85)operator(,)integer(5)operator(,)integer(88)operator(,)integer(28)operator(,)integer(83)operator(,)integer(4)operator(,)integer(87)operator(,) integer(6)operator(,)integer(62)operator(,)integer(28)operator(,)integer(89)operator(,) -integer(9)operator(,)integer(80)operator(,)integer(28)operator(,)integer(60)operator(,)integer(21)operator(,)integer(52)operator(,)integer(21)operator(,)integer(72)operator(,)integer(29)operator(,)integer(54)operator(,)integer(21)operator(,)integer(75)operator(,)integer(8)operator(,)integer(70)operator(,)integer(29)operator(,)integer(58)operator(,)integer(28)operator(,)integer(65)operator(,) -integer(9)operator(,)integer(91)operator(,)integer(8)operator(,)integer(74)operator(,)integer(29)operator(,)integer(79)operator(,)integer(2)operator(,)integer(77)operator(,)integer(1)operator(,)integer(53)operator(,)integer(1)operator(,)integer(81)operator(,)integer(5)operator(,) integer(69)operator(,)integer(2)operator(,)integer(64)operator(,)integer(21)operator(,) integer(86)operator(,)integer(29)operator(,) -integer(67)operator(,)integer(9)operator(,)integer(59)operator(,)integer(1)operator(,)integer(61)operator(,)integer(5)operator(,)integer(73)operator(,)integer(6)operator(,)integer(76)operator(,)integer(28)operator(,)integer(56)operator(,)integer(21)operator(,)integer(68)operator(,)integer(29)operator(,)integer(78)operator(,)integer(29)operator(,)integer(63)operator(,)integer(5)operator(,)integer(66)operator(,) -integer(28)operator(,)integer(90)operator(,)integer(29)operator(,) integer(71)operator(,)integer(4)operator(,)integer(55)operator(,)integer(9)operator(,)integer(84)operator(,)integer(28)operator(,)integer(82)operator(,)integer(29)operator(,)integer(101)operator(,)integer(5)operator(,) integer(103)operator(,)integer(9)operator(,) integer(98)operator(,)integer(35)operator(,) -integer(97)operator(,)integer(1)operator(,)integer(94)operator(,)integer(35)operator(,)integer(93)operator(,)integer(1)operator(,)integer(100)operator(,)integer(35)operator(,)integer(92)operator(,)integer(31)operator(,)integer(99)operator(,)integer(5)operator(,)integer(96)operator(,)integer(39)operator(,)integer(95)operator(,)integer(5)operator(,)integer(102)operator(,)integer(35)operator(};) - -directive(void) ident(run)operator(()pre_type(int) ident(gun)operator(=)integer(0)operator(\)) operator({) comment(// [gun]=[:GUN1,:GUN2]) - ident(printf)operator(()stringoperator(,) ident(gun)operator(\);) - reserved(switch)operator(()ident(gun)operator(\)) operator({) - reserved(case) ident(GUN1) ident(when)operator(()integer(2)operator(\)) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) comment(// end) - reserved(case) ident(GUN2) ident(when)operator(()integer(3)operator(\)) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) comment(// end) - operator(}) -operator(}) - -pre_type(int) ident(main)operator(()pre_type(int) ident(argc)operator(,) pre_type(char)operator(**) ident(argv)operator(\)) operator({) - ident(printf)operator(()stringoperator(,) ident(argc)operator(\);) - pre_type(int) ident(fun)operator(=)integer(5)operator(;) - ident(bo) operator({) - ident(fun) operator(-=) integer(1)operator(;) comment(//.id - gun = fun) - ident(run)operator(()ident(fun)operator(\);) - operator(}) reserved(while)operator(()ident(fun)operator(>)integer(0)operator(\);) - ident(ruby_init)operator((\);) - ident(rb_eval_string)operator(()ident(DATA)operator(\);) - reserved(return) integer(0)operator(;) -operator(}) - -comment(# if 0 // nobody reads un-defined code -def goto*s;$s=[];Y.times{s=[];X.times{s<<[0]*3};$s<< s}end;A=0.5 -include Math;def u g,h,i,j,k,l;f,*m=((j-h\).abs>(k-i\).abs\)?[proc{ -|n,o| g[o] [n ]=l },[h ,i ],[j,k]]:[proc{ -|p,q| g[ p][ q] =l} ,[ i,h ], [k,j]];b,a=m.sort -c,d=a [1 ]-b [1 ],a [0 ]-b [0 ];d.times{|e|f. -call( e+b[ 0] ,c* e/d+b [1]\)};end;V=0;def bo&u -$u||= V; ;$u += 1+V ;; return u.call if$u>1;q=128.0 -;x=(V .. 255 \). map {| y|f1,z =sin(y.to_f*PI/q\), -sin(( y. to_f + 200 \)*PI/( q\)\);[(f1*30.0+110.0\). -to_i,((f1+z\)*10.0+40.0\).to_i,(z*20.0+120.0\).to_i]};Y.times{|i|X. -times{|j|i1=((i*0.3+150\)*(j*1.1+50\)/50.0\).to_i;i2=((i*0.8+510\)*( -j*0.9+1060\)/51.0\).to_i;$s[i][j]=x[(i1*i2\)%255].clone}};$a=(0..25\). -inject([]\){|a,i|a<<(V..3\).inject([]\){|r,j|r<<$c[i*4+j]}};u.call;end -I=LocalJumpError;def run*a,&b;return if a.size==V;if a[V]==666;$b=b -elsif$b;$b.call;end;end;def main s,&u;$m=V;u.call rescue I;end -def rb_eval_string(*a\);end # you promised not to look here -def ruby_init;q=2.0;l=((X**q\)*A+(Y**q\)*A\)**A;V.upto(Y-4\){|s|V. -upto(X-4\){|q|d=((q-X/A\)**q+(s-Y/A\)**q\)**A;e=(cos(d*PI/(l/q\)\)/q -+A\)*3.0+1.0;v=2;f=v/e;a,p,b=$s[s],$s[s+1],$s[s+v];r=a[q][V]*e+ -p[q][V]+a[q+1][V]+b[q][V]+a[q+v][V]+b[q+v/v][V]+p[q+v][V]+b[q+ -v][V]*f;g=[a[q][V],b[q][V],a[q+v][V],b[q+v][V]];h=(g.max-g.min -\)*f;$s[s][q][V]=[[(r/(e+f+6.0\)+A+(h*0.4\)\).to_i,255].min,V].max -}};File.open("res.ppm","w+"\){|f|f.write(# secret.greetings :-\) -"P3\\n# res.ppm\\n#{X} #{Y}\\n255\\n"+$s.map{|a|a.map{|b|b.join' ' -}.join(' '\)+"\\n"}.join\)};end;def switch i,&b;b.call;return unless -defined?($m\);b=(X*0.01\).to_i;d=1.0/40.0;e=0.09;c=(Y*0.01\).to_i -a=$a.map{|(f,g,h,j\)|[f*d,g*e,h*d,j*e]};a.each{|(k,l,m,n\)|u($s,(k*X -\).to_i+b+i,(l*Y\).to_i+c+i,(m*X\).to_i+b+i,(n*Y\).to_i+c+i,[Z]*3\)} -a.each{|(o,q,r,s\)|u($s,(o*(X-Z\)\).to_i+i,(q*(Y-Z\)\).to_i+i,(r*(X- -Z\)\).to_i+i,(s*(Y-Z\)\).to_i+i,[(1<<8\)-1]*3\)};end;Q=Object;class -Regexp;def []=(v,is\);is.each{|s|Q.send(:remove_const,s\)if Q. -const_defined? s;Q.const_set(s,v\)};end;end;def int*ptr;666 -end;class O;def []=(a,b=nil\);$c=a;end;end;alias:void:goto -#endif // pretend as if you havn't seen anything) diff --git a/test/scanners/c/strange.in.c b/test/scanners/c/strange.in.c deleted file mode 100644 index 42f339d..0000000 --- a/test/scanners/c/strange.in.c +++ /dev/null @@ -1,90 +0,0 @@ -#include "ruby.h" /* - /sLaSh * - oBfUsCaTeD RuBy * - cOpYrIgHt 2005 * -bY SiMoN StRaNdGaArD * - #{X=320;Y=200;Z=20} */ - -#define GUN1 42: -#define GUN2 43: -#define bo do -#define when(gun) /**/ -#define DATA "p 'Hello embedded world'" -#define DIRTY(argc,argv)\ -argc,argv,char=eval(\ -"#{DATA.read}\n[3,2,1]"\ -);sun=O.new\ -if(0) - -int -sun[]={12,9,16,9,2,1,7,1,3,9,27,4, 13,2,11,5,4,1,25, -5,0,1,14,9,15,4,26,9,23,2,17,6,31, 6,10,8,22,9,21,1, -24,8,20,8,18,9,29,5,9,5,1,1,28,8,8,1,30, 9,6,8, 5,1, -19,9,36,19,43, 9,34,11,50,19,48,18,49,9, 35,8,42,18, -51,8,44,11,32, 11,47,9,37,1,39,9,38,19, 45,8,40,12, -41,9,46,12,33,1,57,1,85,5,88,28,83,4,87, 6,62,28,89, -9,80,28,60,21,52,21,72,29,54,21,75,8,70,29,58,28,65, -9,91,8,74,29,79,2,77,1,53,1,81,5, 69,2,64,21, 86,29, -67,9,59,1,61,5,73,6,76,28,56,21,68,29,78,29,63,5,66, -28,90,29, 71,4,55,9,84,28,82,29,101,5, 103,9, 98,35, -97,1,94,35,93,1,100,35,92,31,99,5,96,39,95,5,102,35}; - -void run(int gun=0) { // [gun]=[:GUN1,:GUN2] - printf("run() %i\n", gun); - switch(gun) { - case GUN1 when(2) - printf("when2\n"); - break; // end - case GUN2 when(3) - printf("when3\n"); - break; // end - } -} - -int main(int argc, char** argv) { - printf("hello world. number of arguments=%i\n", argc); - int fun=5; - bo { - fun -= 1; //.id - gun = fun - run(fun); - } while(fun>0); - ruby_init(); - rb_eval_string(DATA); - return 0; -} - -# if 0 // nobody reads un-defined code -def goto*s;$s=[];Y.times{s=[];X.times{s<<[0]*3};$s<< s}end;A=0.5 -include Math;def u g,h,i,j,k,l;f,*m=((j-h).abs>(k-i).abs)?[proc{ -|n,o| g[o] [n ]=l },[h ,i ],[j,k]]:[proc{ -|p,q| g[ p][ q] =l} ,[ i,h ], [k,j]];b,a=m.sort -c,d=a [1 ]-b [1 ],a [0 ]-b [0 ];d.times{|e|f. -call( e+b[ 0] ,c* e/d+b [1])};end;V=0;def bo&u -$u||= V; ;$u += 1+V ;; return u.call if$u>1;q=128.0 -;x=(V .. 255 ). map {| y|f1,z =sin(y.to_f*PI/q), -sin(( y. to_f + 200 )*PI/( q));[(f1*30.0+110.0). -to_i,((f1+z)*10.0+40.0).to_i,(z*20.0+120.0).to_i]};Y.times{|i|X. -times{|j|i1=((i*0.3+150)*(j*1.1+50)/50.0).to_i;i2=((i*0.8+510)*( -j*0.9+1060)/51.0).to_i;$s[i][j]=x[(i1*i2)%255].clone}};$a=(0..25). -inject([]){|a,i|a<<(V..3).inject([]){|r,j|r<<$c[i*4+j]}};u.call;end -I=LocalJumpError;def run*a,&b;return if a.size==V;if a[V]==666;$b=b -elsif$b;$b.call;end;end;def main s,&u;$m=V;u.call rescue I;end -def rb_eval_string(*a);end # you promised not to look here -def ruby_init;q=2.0;l=((X**q)*A+(Y**q)*A)**A;V.upto(Y-4){|s|V. -upto(X-4){|q|d=((q-X/A)**q+(s-Y/A)**q)**A;e=(cos(d*PI/(l/q))/q -+A)*3.0+1.0;v=2;f=v/e;a,p,b=$s[s],$s[s+1],$s[s+v];r=a[q][V]*e+ -p[q][V]+a[q+1][V]+b[q][V]+a[q+v][V]+b[q+v/v][V]+p[q+v][V]+b[q+ -v][V]*f;g=[a[q][V],b[q][V],a[q+v][V],b[q+v][V]];h=(g.max-g.min -)*f;$s[s][q][V]=[[(r/(e+f+6.0)+A+(h*0.4)).to_i,255].min,V].max -}};File.open("res.ppm","w+"){|f|f.write(# secret.greetings :-) -"P3\n# res.ppm\n#{X} #{Y}\n255\n"+$s.map{|a|a.map{|b|b.join' ' -}.join(' ')+"\n"}.join)};end;def switch i,&b;b.call;return unless -defined?($m);b=(X*0.01).to_i;d=1.0/40.0;e=0.09;c=(Y*0.01).to_i -a=$a.map{|(f,g,h,j)|[f*d,g*e,h*d,j*e]};a.each{|(k,l,m,n)|u($s,(k*X -).to_i+b+i,(l*Y).to_i+c+i,(m*X).to_i+b+i,(n*Y).to_i+c+i,[Z]*3)} -a.each{|(o,q,r,s)|u($s,(o*(X-Z)).to_i+i,(q*(Y-Z)).to_i+i,(r*(X- -Z)).to_i+i,(s*(Y-Z)).to_i+i,[(1<<8)-1]*3)};end;Q=Object;class -Regexp;def []=(v,is);is.each{|s|Q.send(:remove_const,s)if Q. -const_defined? s;Q.const_set(s,v)};end;end;def int*ptr;666 -end;class O;def []=(a,b=nil);$c=a;end;end;alias:void:goto -#endif // pretend as if you havn't seen anything diff --git a/test/scanners/c/suite.rb b/test/scanners/c/suite.rb deleted file mode 100644 index fc94ad3..0000000 --- a/test/scanners/c/suite.rb +++ /dev/null @@ -1,2 +0,0 @@ -class C < CodeRay::TestCase -end diff --git a/test/scanners/coderay_suite.rb b/test/scanners/coderay_suite.rb deleted file mode 100644 index 3fd7201..0000000 --- a/test/scanners/coderay_suite.rb +++ /dev/null @@ -1,510 +0,0 @@ -$VERBOSE = $CODERAY_DEBUG = true -require 'benchmark' -require 'yaml' -require 'fileutils' - -$mydir = File.dirname(__FILE__) -$:.unshift File.join($mydir, '..', '..', 'lib') -require 'coderay' - -$:.unshift File.join($mydir, '..', 'lib') - -require 'term/ansicolor' unless ENV['nocolor'] - -require 'test/unit' - -if defined? Term::ANSIColor - class String - include Term::ANSIColor - def green_or_red result - result ? green : red - end - end -else - class String - for meth in %w(green red blue cyan magenta yellow concealed white) - class_eval <<-END - def #{meth} - self - end - END - end - def green_or_red result - result ? upcase : downcase - end - end -end - -unless defined? Term::ANSIColor - puts 'You should gem install term-ansicolor.' -end - -# from Ruby Facets (http://facets.rubyforge.org/) -class Array - def shuffle! - s = size - each_index do |j| - i = ::Kernel.rand(s-j) - self[j], self[j+i] = at(j+i), at(j) unless i.zero? - end - self - end unless [].respond_to? :shuffle! -end - -# Wraps around an enumerable and prints the current element when iterated. -class ProgressPrinter - - attr_accessor :enum, :template - attr_reader :progress - - def initialize enum, template = '(%p)' - @enum = enum - @template = template - if ENV['showprogress'] - @progress = '' - else - @progress = nil - end - end - - def each - for elem in @enum - if @progress - print "\b" * @progress.size - @progress = @template % elem - print @progress - end - yield elem - end - ensure - print "\b" * progress.size if @progress - end - - include Enumerable - -end - -module Enumerable - def progress - ProgressPrinter.new self - end -end - -module CodeRay - - require 'test/unit' - - class TestCase < Test::Unit::TestCase - - if ENV['deluxe'] - MAX_CODE_SIZE_TO_HIGHLIGHT = 500_000_000 - MAX_CODE_SIZE_TO_TEST = 500_000_000 - DEFAULT_MAX = 4096 - elsif ENV['fast'] - MAX_CODE_SIZE_TO_HIGHLIGHT = 5_000_000 - MAX_CODE_SIZE_TO_TEST = 1_000_000 - DEFAULT_MAX = 16 - else - MAX_CODE_SIZE_TO_HIGHLIGHT = 10_000_000 - MAX_CODE_SIZE_TO_TEST = 10_000_000 - DEFAULT_MAX = 1024 - end - - class << self - def inherited child - CodeRay::TestSuite << child.suite - end - - # Calls its block with the working directory set to the examples - # for this test case. - def dir - examples = File.join $mydir, lang.to_s - Dir.chdir examples do - yield - end - end - - def lang - @lang ||= name[/\w+$/].downcase - end - - def extension extension = nil - if extension - @extension = extension.to_s - else - @extension ||= CodeRay::Scanners[lang].file_extension.to_s - end - end - end - - # Create only once, for speed - Tokenizer = CodeRay::Encoders[:debug].new - - def test_ALL - puts - scanner = CodeRay::Scanners[self.class.lang].new - raise "No Scanner for #{self.class.lang} found!" if scanner.is_a? CodeRay::Scanners[nil] - puts ' >> Testing '.magenta + scanner.class.title.cyan + - ' scanner <<'.magenta - puts - - time_for_lang = Benchmark.realtime do - max = ENV.fetch('max', DEFAULT_MAX).to_i - random_test scanner, max unless ENV['norandom'] || ENV['only'] - examples_test scanner, max unless ENV['noexamples'] - end - - puts 'Finished in '.green + '%0.2fs'.white % time_for_lang + '.'.green - end - - def examples_test scanner, max - self.class.dir do - extension = 'in.' + self.class.extension - path = "test/scanners/#{File.basename(Dir.pwd)}/*.#{extension}" - print 'Loading examples in '.green + path.cyan + '...'.green - examples = Dir["*.#{extension}"] - if examples.empty? - puts "No examples found!".red - else - puts '%d'.yellow % examples.size + " example#{'s' if examples.size > 1} found.".green - end - for example_filename in examples - @known_issue_description = @known_issue_ticket_url = nil - name = File.basename(example_filename, ".#{extension}") - next if ENV['lang'] && ENV['only'] && ENV['only'] != name - print '%20s'.cyan % name + ' ' - filesize = File.size(example_filename) - amount = filesize - human_filesize = - if amount < 1024 - '%6.0f B ' % [amount] - else - amount /= 1024.0 - if amount < 1024 - '%6.1f KiB ' % [amount] - else - amount /= 1024.0 - '%6.1f MiB ' % [amount] - end - end - print human_filesize.yellow - - tokens = example_test example_filename, name, scanner, max - - if defined?(@time_for_encoding) && time = @time_for_encoding - kilo_tokens_per_second = tokens.size / time / 1000 - print 'finished in '.green + '%5.2fs'.white % time - if filesize >= 1024 - print ' ('.green + '%4.0f Ktok/s'.white % kilo_tokens_per_second + ')'.green - end - @time_for_encoding = nil - end - puts '.'.green - if @known_issue_description - print ' KNOWN ISSUE: '.cyan - print @known_issue_description.yellow - puts - print ' ' * 30 - if @known_issue_ticket_url - puts 'See '.yellow + @known_issue_ticket_url.white + '.'.yellow - else - puts 'No ticket yet. Visit '.yellow + - 'http://redmine.rubychan.de/projects/coderay/issues/new'.white + '.'.yellow - end - end - end - end - end - - def example_test example_filename, name, scanner, max - if File.size(example_filename) > MAX_CODE_SIZE_TO_TEST and not ENV['only'] - print 'too big' - return - end - code = File.open(example_filename, 'rb') { |f| break f.read } - - incremental_test scanner, code, max unless ENV['noincremental'] - - unless ENV['noshuffled'] or code.size < [0].pack('Q').size - shuffled_test scanner, code, max - else - print '-skipped- '.concealed - end - - tokens, ok, changed_lines = complete_test scanner, code, name - - identity_test scanner, tokens - - unless ENV['nohighlighting'] or (code.size > MAX_CODE_SIZE_TO_HIGHLIGHT and not ENV['only']) - highlight_test tokens, name, ok, changed_lines - else - print '-- skipped -- '.concealed - end - tokens - end - - def random_test scanner, max - if defined?(JRUBY_VERSION) && JRUBY_VERSION == '1.4.0' && %w[ruby nitroxhtml rhtml].include?(scanner.lang) - puts 'Random test skipped due to a bug in JRuby. See http://redmine.rubychan.de/issues/136.'.red - @@warning_about_jruby_bug = true - return - end - print "Random test...".yellow - okay = true - for size in (0..max).progress - srand size + 17 - scanner.string = Array.new(size) { rand 256 }.pack 'c*' - begin - scanner.tokenize - rescue - assert_nothing_raised "Random test failed at #{size} #{RUBY_VERSION < '1.9' ? 'bytes' : 'chars'}" do - raise - end if ENV['assert'] - okay = false - break - end - end - print "\b" * 'Random test...'.size - print 'Random test'.green_or_red(okay) - puts ' - finished.'.green - end - - def incremental_test scanner, code, max - report 'incremental' do - okay = true - for size in (0..max).progress - break if size > code.size - scanner.string = code[0,size] - begin - scanner.tokenize - rescue - assert_nothing_raised "Incremental test failed at #{size} #{RUBY_VERSION < '1.9' ? 'bytes' : 'chars'}!" do - raise - end if ENV['assert'] - okay = false - break - end - end - okay - end - end - - def shuffled_test scanner, code, max - report 'shuffled' do - code_bits = code[0,max].unpack('Q*') # split into quadwords... - okay = true - for i in (0..max / 4).progress - srand i - code_bits.shuffle! # ...mix... - scanner.string = code_bits.pack('Q*') # ...and join again - begin - scanner.tokenize - rescue - assert_nothing_raised 'shuffle test failed!' do - raise - end if ENV['assert'] - okay = false - break - end - end - okay - end - end - - def complete_test scanner, code, name - print 'complete...'.yellow - expected_filename = name + '.expected.' + Tokenizer.file_extension - scanner.string = code - - tokens = result = nil - @time_for_encoding = Benchmark.realtime do - tokens = scanner.tokens - result = Tokenizer.encode_tokens tokens - end - - if File.exist?(expected_filename) && !(ENV['lang'] && ENV['new'] && name == ENV['new']) - expected = File.open(expected_filename, 'rb') { |f| break f.read } - if result.respond_to?(:bytesize) && result.bytesize != result.size - # for char, i in result.chars.with_index - # raise "result has non-ASCII-8BIT character in line #{result[0,i].count(?\n) + 1}" if char.bytesize != 1 - # end - # UTF-8 encoded result; comparison needs to be done on binary level - result.force_encoding('binary') - end - ok = expected == result - unless ok - actual_filename = expected_filename.sub('.expected.', '.actual.') - File.open(actual_filename, 'wb') { |f| f.write result } - diff = expected_filename.sub(/\.expected\..*/, '.debug.diff') - system "diff --unified=0 --text #{expected_filename} #{actual_filename} > #{diff}" - debug_diff = File.read diff - changed_lines = [] - debug_diff.scan(/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/) do |offset, size| - offset = offset.to_i - size = (size || 1).to_i - changed_lines.concat Array(offset...offset + size) - end - system "diff --unified=0 --text #{expected_filename} #{actual_filename} > #{diff}" - debug_diff = File.read diff - File.open diff + '.html', 'wb' do |f| - f.write Highlighter.encode_tokens(CodeRay.scan(debug_diff, :diff), - :title => "#{self.class.name[/\w+$/]}: #{name}, differences from expected output") - end - end - - assert(ok, "Scan error: unexpected output".red) if ENV['assert'] - - print "\b" * 'complete...'.size - known_issue = expected_filename.sub(/\.expected\..*/, '.known-issue.yaml') - if !ok && File.exist?(known_issue) - known_issue = YAML.load_file(known_issue) - ticket_url = known_issue['ticket_url'] - @known_issue_description = known_issue['description'] - if ticket_url && ticket_url[/(\d+)\/?$/] - @known_issue_ticket_url = ticket_url - ticket_info = 'see #' + $1 - else - ticket_info = 'ticket ?' - end - print ticket_info.rjust('complete'.size).red - print ', '.green - else - print 'complete, '.green_or_red(ok) - end - else - File.open(expected_filename, 'wb') { |f| f.write result } - print "\b" * 'complete...'.size, "new test".blue, ", ".green - ok = true - end - - return tokens, ok, changed_lines - end - - def identity_test scanner, tokens - report 'identity' do - if scanner.instance_of? CodeRay::Scanners[:debug] - okay = true - else - okay = scanner.code == tokens.text - unless okay - flunk 'identity test failed!' if ENV['assert'] - end - okay - end - end - end - - Highlighter = CodeRay::Encoders[:html].new( - :tab_width => 8, - :line_numbers => :table, - :wrap => :page, - :hint => :debug, - :css => :class, - :style => :alpha - ) - - def highlight_test tokens, name, okay, changed_lines - - actual_html = name + '.actual.html' - title = "Testing #{self.class.name[/\w+$/]}: #{name}" - report 'highlighting' do - begin - highlighted = Highlighter.encode_tokens tokens, - :highlight_lines => changed_lines, - :title => title + "[#{'NOT ' unless okay}OKAY]" - rescue - raise - return false - end - File.open(actual_html, 'w') { |f| f.write highlighted } - if okay - debug, $DEBUG = $DEBUG, false - FileUtils.copy(actual_html, name + '.expected.html') - $DEBUG = debug - end - true - end - - expected_html = name + '.expected.html' - if okay - FileUtils.copy actual_html, expected_html - else - expected_raydebug = name + '.expected.raydebug' - if File.exist? expected_raydebug - latest_change = File.ctime expected_raydebug - if !File.exist?(expected_html) || latest_change > File.ctime(expected_html) - tokens = CodeRay.scan_file expected_raydebug, :debug - highlighted = Highlighter.encode_tokens tokens, - :highlight_lines => changed_lines, - :title => title - File.open(expected_html, 'w') { |f| f.write highlighted } - end - end - end - - true - end - - def report task - print "#{task}...".yellow - okay = yield - print "\b" * "#{task}...".size - print "#{task}, ".green_or_red(okay) - okay - end - end - - class TestSuite - @suite = Test::Unit::TestSuite.new 'CodeRay::Scanners' - class << self - - def << sub_suite - @suite << sub_suite - end - - def load_suite name - begin - suite = File.join($mydir, name, 'suite.rb') - require suite - rescue LoadError - $stderr.puts <<-ERR - - !! Suite #{suite} not found - - ERR - false - end - end - - def check_env_lang - for key in %w(only new) - if ENV[key] && ENV[key][/^(\w+)\.([-\w]+)$/] - ENV['lang'] = $1 - ENV[key] = $2 - end - end - end - - def load - ENV['only'] = ENV['new'] if ENV['new'] - check_env_lang - subsuite = ARGV.find { |a| break $& if a[/^[^-].*/] } || ENV['lang'] - if subsuite - load_suite(subsuite) or exit - else - Dir[File.join($mydir, '*', '')].sort.each do |suite| - load_suite File.basename(suite) - end - end - end - - def run - load - $stdout.sync = true - require 'test/unit/ui/console/testrunner' - Test::Unit::UI::Console::TestRunner.run @suite - end - end - end - -end \ No newline at end of file diff --git a/test/scanners/cpp/elvis.expected.raydebug b/test/scanners/cpp/elvis.expected.raydebug deleted file mode 100644 index 81743d0..0000000 --- a/test/scanners/cpp/elvis.expected.raydebug +++ /dev/null @@ -1,26 +0,0 @@ -ident(This)operator(?)ident(is)operator(+)ident(no)operator(:)ident(label)operator(;) - -comment(// This is only one label:) -label(label:) reserved(switch) operator(()ident(TYPE)operator(()ident(v)operator(\)\)) operator({) - reserved(case) ident(T_CLASS)operator(:) reserved(case) ident(T_MODULE)operator(:) - ident(rb_str_append)operator(()ident(s)operator(,) ident(rb_inspect)operator(()ident(v)operator(\)\);) - reserved(break)operator(;) - reserved(default)operator(:) - ident(rb_str_append)operator(()ident(s)operator(,) ident(rb_any_to_s)operator(()ident(v)operator(\)\);) - reserved(break)operator(;) -operator(}) -comment(// These are two labels.) -ident(function)operator(()ident(call)operator(\);) -label(label2:) label(label3:) ident(a) operator(=) ident(b) operator(+) ident(c)operator(;) - -comment(// Another label.) -reserved(if) operator(()integer(1)operator(\)) operator({) - label(label4:) ident(a) operator(=) ident(b) operator(+) ident(c)operator(;) -operator(}) - -comment(// Not a label.) -ident(test)operator(() - ident(a)operator(?) - ident(b)operator(:) - ident(c) -operator(\)) \ No newline at end of file diff --git a/test/scanners/cpp/elvis.in.cpp b/test/scanners/cpp/elvis.in.cpp deleted file mode 100644 index 9cdd574..0000000 --- a/test/scanners/cpp/elvis.in.cpp +++ /dev/null @@ -1,26 +0,0 @@ -This?is+no:label; - -// This is only one label: -label: switch (TYPE(v)) { - case T_CLASS: case T_MODULE: - rb_str_append(s, rb_inspect(v)); - break; - default: - rb_str_append(s, rb_any_to_s(v)); - break; -} -// These are two labels. -function(call); -label2: label3: a = b + c; - -// Another label. -if (1) { - label4: a = b + c; -} - -// Not a label. -test( - a? - b: - c -) \ No newline at end of file diff --git a/test/scanners/cpp/eventmachine.expected.raydebug b/test/scanners/cpp/eventmachine.expected.raydebug deleted file mode 100644 index 8a3b79b..0000000 --- a/test/scanners/cpp/eventmachine.expected.raydebug +++ /dev/null @@ -1,7035 +0,0 @@ -comment(/***************************************************************************** - -$Id$ - -File: binder.cpp -Date: 07Apr06 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - -preprocessor(#include) include("project.h") - -preprocessor(#define) ident(DEV_URANDOM) string - - -ident(map)operator(<)pre_type(string)operator(,) ident(Bindable_t)operator(*>) ident(Bindable_t)operator(::)ident(BindingBag)operator(;) - - -comment(/******************************** -STATIC Bindable_t::CreateBinding -********************************/) - -pre_type(string) ident(Bindable_t)operator(::)ident(CreateBinding)operator((\)) -operator({) - directive(static) pre_type(int) ident(index) operator(=) integer(0)operator(;) - directive(static) pre_type(string) ident(seed)operator(;) - - reserved(if) operator((()ident(index) operator(>=) integer(1000000)operator(\)) operator(||) operator(()ident(seed)operator(.)ident(length)operator((\)) operator(==) integer(0)operator(\)\)) operator({) - preprocessor(#ifdef) ident(OS_UNIX) - pre_type(int) ident(fd) operator(=) ident(open) operator(()ident(DEV_URANDOM)operator(,) ident(O_RDONLY)operator(\);) - reserved(if) operator(()ident(fd) operator(<) integer(0)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - pre_type(unsigned) pre_type(char) ident(u)operator([)integer(16)operator(];) - ident(size_t) ident(r) operator(=) ident(read) operator(()ident(fd)operator(,) ident(u)operator(,) reserved(sizeof)operator(()ident(u)operator(\)\);) - reserved(if) operator(()ident(r) operator(<) reserved(sizeof)operator(()ident(u)operator(\)\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - pre_type(unsigned) pre_type(char) operator(*)ident(u1) operator(=) operator(()pre_type(unsigned) pre_type(char)operator(*\))ident(u)operator(;) - pre_type(char) ident(u2) operator([)reserved(sizeof)operator(()ident(u)operator(\)) operator(*) integer(2) operator(+) integer(1)operator(];) - - reserved(for) operator(()ident(size_t) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) reserved(sizeof)operator(()ident(u)operator(\);) ident(i)operator(++\)) - ident(sprintf) operator(()ident(u2) operator(+) operator(()ident(i) operator(*) integer(2)operator(\),) stringoperator(,) ident(u1)operator([)ident(i)operator(]\);) - - ident(seed) operator(=) pre_type(string) operator(()ident(u2)operator(\);) - preprocessor(#endif) - - - preprocessor(#ifdef) ident(OS_WIN32) - ident(UUID) ident(uuid)operator(;) - ident(UuidCreate) operator((&)ident(uuid)operator(\);) - pre_type(unsigned) pre_type(char) operator(*)ident(uuidstring) operator(=) pre_constant(NULL)operator(;) - ident(UuidToString) operator((&)ident(uuid)operator(,) operator(&)ident(uuidstring)operator(\);) - reserved(if) operator((!)ident(uuidstring)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(seed) operator(=) pre_type(string) operator((()directive(const) pre_type(char)operator(*\))ident(uuidstring)operator(\);) - - ident(RpcStringFree) operator((&)ident(uuidstring)operator(\);) - preprocessor(#endif) - - ident(index) operator(=) integer(0)operator(;) - - - operator(}) - - ident(stringstream) ident(ss)operator(;) - ident(ss) operator(<<) ident(seed) operator(<<) operator((++)ident(index)operator(\);) - reserved(return) ident(ss)operator(.)ident(str)operator((\);) -operator(}) - - -comment(/***************************** -STATIC: Bindable_t::GetObject -*****************************/) - -ident(Bindable_t) operator(*)ident(Bindable_t)operator(::)ident(GetObject) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(\)) -operator({) - pre_type(string) ident(s) operator(()ident(binding) operator(?) ident(binding) operator(:) stringoperator(\);) - reserved(return) ident(GetObject) operator(()ident(s)operator(\);) -operator(}) - -comment(/***************************** -STATIC: Bindable_t::GetObject -*****************************/) - -ident(Bindable_t) operator(*)ident(Bindable_t)operator(::)ident(GetObject) operator(()directive(const) pre_type(string) operator(&)ident(binding)operator(\)) -operator({) - ident(map)operator(<)pre_type(string)operator(,) ident(Bindable_t)operator(*>::)ident(const_iterator) ident(i) operator(=) ident(BindingBag)operator(.)ident(find) operator(()ident(binding)operator(\);) - reserved(if) operator(()ident(i) operator(!=) ident(BindingBag)operator(.)ident(end)operator((\)\)) - reserved(return) ident(i)operator(->)ident(second)operator(;) - reserved(else) - reserved(return) pre_constant(NULL)operator(;) -operator(}) - - -comment(/********************** -Bindable_t::Bindable_t -**********************/) - -ident(Bindable_t)operator(::)ident(Bindable_t)operator((\)) -operator({) - ident(Binding) operator(=) ident(Bindable_t)operator(::)ident(CreateBinding)operator((\);) - ident(BindingBag) operator([)ident(Binding)operator(]) operator(=) local_variable(this)operator(;) -operator(}) - - - -comment(/*********************** -Bindable_t::~Bindable_t -***********************/) - -ident(Bindable_t)operator(::~)ident(Bindable_t)operator((\)) -operator({) - ident(BindingBag)operator(.)ident(erase) operator(()ident(Binding)operator(\);) -operator(}) - - -comment(/***************************************************************************** - -$Id$ - -File: cmain.cpp -Date: 06Apr06 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - -preprocessor(#include) include("project.h") - - -directive(static) ident(EventMachine_t) operator(*)ident(EventMachine)operator(;) -directive(static) pre_type(int) ident(bUseEpoll) operator(=) integer(0)operator(;) -directive(static) pre_type(int) ident(bUseKqueue) operator(=) integer(0)operator(;) - -directive(extern) string directive(void) ident(ensure_eventmachine) operator(()directive(const) pre_type(char) operator(*)ident(caller) operator(=) stringoperator(\)) -operator({) - reserved(if) operator((!)ident(EventMachine)operator(\)) operator({) - directive(const) pre_type(int) ident(err_size) operator(=) integer(128)operator(;) - pre_type(char) ident(err_string)operator([)ident(err_size)operator(];) - ident(snprintf) operator(()ident(err_string)operator(,) ident(err_size)operator(,) stringoperator(,) ident(caller)operator(\);) - preprocessor(#ifdef) ident(BUILD_FOR_RUBY) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) ident(err_string)operator(\);) - preprocessor(#else) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()ident(err_string)operator(\);) - preprocessor(#endif) - operator(}) -operator(}) - -comment(/*********************** -evma_initialize_library -***********************/) - -directive(extern) string directive(void) ident(evma_initialize_library) operator(()directive(void)operator((*)ident(cb)operator(\)()directive(const) pre_type(char)operator(*,) pre_type(int)operator(,) directive(const) pre_type(char)operator(*,) pre_type(int)operator(\)\)) -operator({) - comment(// Probably a bad idea to mess with the signal mask of a process) - comment(// we're just being linked into.) - comment(//InstallSignalHandlers(\);) - reserved(if) operator(()ident(EventMachine)operator(\)) - preprocessor(#ifdef) ident(BUILD_FOR_RUBY) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - preprocessor(#else) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) - ident(EventMachine) operator(=) reserved(new) ident(EventMachine_t) operator(()ident(cb)operator(\);) - reserved(if) operator(()ident(bUseEpoll)operator(\)) - ident(EventMachine)operator(->)ident(_UseEpoll)operator((\);) - reserved(if) operator(()ident(bUseKqueue)operator(\)) - ident(EventMachine)operator(->)ident(_UseKqueue)operator((\);) -operator(}) - - -comment(/******************** -evma_release_library -********************/) - -directive(extern) string directive(void) ident(evma_release_library)operator((\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(delete) ident(EventMachine)operator(;) - ident(EventMachine) operator(=) pre_constant(NULL)operator(;) -operator(}) - - -comment(/**************** -evma_run_machine -****************/) - -directive(extern) string directive(void) ident(evma_run_machine)operator((\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventMachine)operator(->)ident(Run)operator((\);) -operator(}) - - -comment(/************************** -evma_install_oneshot_timer -**************************/) - -directive(extern) string directive(const) pre_type(char) operator(*)ident(evma_install_oneshot_timer) operator(()pre_type(int) ident(seconds)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(EventMachine)operator(->)ident(InstallOneshotTimer) operator(()ident(seconds)operator(\);) -operator(}) - - -comment(/********************** -evma_connect_to_server -**********************/) - -directive(extern) string directive(const) pre_type(char) operator(*)ident(evma_connect_to_server) operator(()directive(const) pre_type(char) operator(*)ident(server)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(EventMachine)operator(->)ident(ConnectToServer) operator(()ident(server)operator(,) ident(port)operator(\);) -operator(}) - -comment(/*************************** -evma_connect_to_unix_server -***************************/) - -directive(extern) string directive(const) pre_type(char) operator(*)ident(evma_connect_to_unix_server) operator(()directive(const) pre_type(char) operator(*)ident(server)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(EventMachine)operator(->)ident(ConnectToUnixServer) operator(()ident(server)operator(\);) -operator(}) - -comment(/************** -evma_attach_fd -**************/) - -directive(extern) string directive(const) pre_type(char) operator(*)ident(evma_attach_fd) operator(()pre_type(int) ident(file_descriptor)operator(,) pre_type(int) ident(notify_readable)operator(,) pre_type(int) ident(notify_writable)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(EventMachine)operator(->)ident(AttachFD) operator(()ident(file_descriptor)operator(,) operator(()ident(notify_readable) operator(?) pre_constant(true) operator(:) pre_constant(false)operator(\),) operator(()ident(notify_writable) operator(?) pre_constant(true) operator(:) pre_constant(false)operator(\)\);) -operator(}) - -comment(/************** -evma_detach_fd -**************/) - -directive(extern) string pre_type(int) ident(evma_detach_fd) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) reserved(dynamic_cast) operator(<)ident(EventableDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ed)operator(\)) - reserved(return) ident(EventMachine)operator(->)ident(DetachFD) operator(()ident(ed)operator(\);) - reserved(else) - preprocessor(#ifdef) ident(BUILD_FOR_RUBY) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - preprocessor(#else) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) -operator(}) - -comment(/********************** -evma_create_tcp_server -**********************/) - -directive(extern) string directive(const) pre_type(char) operator(*)ident(evma_create_tcp_server) operator(()directive(const) pre_type(char) operator(*)ident(address)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(EventMachine)operator(->)ident(CreateTcpServer) operator(()ident(address)operator(,) ident(port)operator(\);) -operator(}) - -comment(/****************************** -evma_create_unix_domain_server -******************************/) - -directive(extern) string directive(const) pre_type(char) operator(*)ident(evma_create_unix_domain_server) operator(()directive(const) pre_type(char) operator(*)ident(filename)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(EventMachine)operator(->)ident(CreateUnixDomainServer) operator(()ident(filename)operator(\);) -operator(}) - -comment(/************************* -evma_open_datagram_socket -*************************/) - -directive(extern) string directive(const) pre_type(char) operator(*)ident(evma_open_datagram_socket) operator(()directive(const) pre_type(char) operator(*)ident(address)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(EventMachine)operator(->)ident(OpenDatagramSocket) operator(()ident(address)operator(,) ident(port)operator(\);) -operator(}) - -comment(/****************** -evma_open_keyboard -******************/) - -directive(extern) string directive(const) pre_type(char) operator(*)ident(evma_open_keyboard)operator((\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(EventMachine)operator(->)ident(OpenKeyboard)operator((\);) -operator(}) - - - -comment(/**************************** -evma_send_data_to_connection -****************************/) - -directive(extern) string pre_type(int) ident(evma_send_data_to_connection) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) directive(const) pre_type(char) operator(*)ident(data)operator(,) pre_type(int) ident(data_length)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(ConnectionDescriptor)operator(::)ident(SendDataToConnection) operator(()ident(binding)operator(,) ident(data)operator(,) ident(data_length)operator(\);) -operator(}) - -comment(/****************** -evma_send_datagram -******************/) - -directive(extern) string pre_type(int) ident(evma_send_datagram) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) directive(const) pre_type(char) operator(*)ident(data)operator(,) pre_type(int) ident(data_length)operator(,) directive(const) pre_type(char) operator(*)ident(address)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(DatagramDescriptor)operator(::)ident(SendDatagram) operator(()ident(binding)operator(,) ident(data)operator(,) ident(data_length)operator(,) ident(address)operator(,) ident(port)operator(\);) -operator(}) - - -comment(/********************* -evma_close_connection -*********************/) - -directive(extern) string directive(void) ident(evma_close_connection) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) pre_type(int) ident(after_writing)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(ConnectionDescriptor)operator(::)ident(CloseConnection) operator(()ident(binding)operator(,) operator(()ident(after_writing) operator(?) pre_constant(true) operator(:) pre_constant(false)operator(\)\);) -operator(}) - -comment(/*********************************** -evma_report_connection_error_status -***********************************/) - -directive(extern) string pre_type(int) ident(evma_report_connection_error_status) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(ConnectionDescriptor)operator(::)ident(ReportErrorStatus) operator(()ident(binding)operator(\);) -operator(}) - -comment(/******************** -evma_stop_tcp_server -********************/) - -directive(extern) string directive(void) ident(evma_stop_tcp_server) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(AcceptorDescriptor)operator(::)ident(StopAcceptor) operator(()ident(binding)operator(\);) -operator(}) - - -comment(/***************** -evma_stop_machine -*****************/) - -directive(extern) string directive(void) ident(evma_stop_machine)operator((\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventMachine)operator(->)ident(ScheduleHalt)operator((\);) -operator(}) - - -comment(/************** -evma_start_tls -**************/) - -directive(extern) string directive(void) ident(evma_start_tls) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) reserved(dynamic_cast) operator(<)ident(EventableDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ed)operator(\)) - ident(ed)operator(->)ident(StartTls)operator((\);) -operator(}) - -comment(/****************** -evma_set_tls_parms -******************/) - -directive(extern) string directive(void) ident(evma_set_tls_parms) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) directive(const) pre_type(char) operator(*)ident(privatekey_filename)operator(,) directive(const) pre_type(char) operator(*)ident(certchain_filename)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) reserved(dynamic_cast) operator(<)ident(EventableDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ed)operator(\)) - ident(ed)operator(->)ident(SetTlsParms) operator(()ident(privatekey_filename)operator(,) ident(certchain_filename)operator(\);) -operator(}) - - -comment(/***************** -evma_get_peername -*****************/) - -directive(extern) string pre_type(int) ident(evma_get_peername) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) reserved(struct) ident(sockaddr) operator(*)ident(sa)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) reserved(dynamic_cast) operator(<)ident(EventableDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ed)operator(\)) operator({) - reserved(return) ident(ed)operator(->)ident(GetPeername) operator(()ident(sa)operator(\)) operator(?) integer(1) operator(:) integer(0)operator(;) - operator(}) - reserved(else) - reserved(return) integer(0)operator(;) -operator(}) - -comment(/***************** -evma_get_sockname -*****************/) - -directive(extern) string pre_type(int) ident(evma_get_sockname) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) reserved(struct) ident(sockaddr) operator(*)ident(sa)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) reserved(dynamic_cast) operator(<)ident(EventableDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ed)operator(\)) operator({) - reserved(return) ident(ed)operator(->)ident(GetSockname) operator(()ident(sa)operator(\)) operator(?) integer(1) operator(:) integer(0)operator(;) - operator(}) - reserved(else) - reserved(return) integer(0)operator(;) -operator(}) - -comment(/*********************** -evma_get_subprocess_pid -***********************/) - -directive(extern) string pre_type(int) ident(evma_get_subprocess_pid) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) ident(pid_t) operator(*)ident(pid)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) reserved(dynamic_cast) operator(<)ident(EventableDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ed)operator(\)) operator({) - reserved(return) ident(ed)operator(->)ident(GetSubprocessPid) operator(()ident(pid)operator(\)) operator(?) integer(1) operator(:) integer(0)operator(;) - operator(}) - reserved(else) - reserved(return) integer(0)operator(;) -operator(}) - -comment(/************************** -evma_get_subprocess_status -**************************/) - -directive(extern) string pre_type(int) ident(evma_get_subprocess_status) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) pre_type(int) operator(*)ident(status)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(if) operator(()ident(status)operator(\)) operator({) - operator(*)ident(status) operator(=) ident(EventMachine)operator(->)ident(SubprocessExitStatus)operator(;) - reserved(return) integer(1)operator(;) - operator(}) - reserved(else) - reserved(return) integer(0)operator(;) -operator(}) - - -comment(/********************* -evma_signal_loopbreak -*********************/) - -directive(extern) string directive(void) ident(evma_signal_loopbreak)operator((\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventMachine)operator(->)ident(SignalLoopBreaker)operator((\);) -operator(}) - - - -comment(/**************** -evma__write_file -****************/) - -directive(extern) string directive(const) pre_type(char) operator(*)ident(evma__write_file) operator(()directive(const) pre_type(char) operator(*)ident(filename)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(EventMachine)operator(->)ident(_OpenFileForWriting) operator(()ident(filename)operator(\);) -operator(}) - - -comment(/******************************** -evma_get_comm_inactivity_timeout -********************************/) - -directive(extern) string pre_type(int) ident(evma_get_comm_inactivity_timeout) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) pre_type(int) operator(*)ident(value)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) reserved(dynamic_cast) operator(<)ident(EventableDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ed)operator(\)) operator({) - reserved(return) ident(ed)operator(->)ident(GetCommInactivityTimeout) operator(()ident(value)operator(\);) - operator(}) - reserved(else) - reserved(return) integer(0)operator(;) comment(//Perhaps this should be an exception. Access to an unknown binding.) -operator(}) - -comment(/******************************** -evma_set_comm_inactivity_timeout -********************************/) - -directive(extern) string pre_type(int) ident(evma_set_comm_inactivity_timeout) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) pre_type(int) operator(*)ident(value)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) reserved(dynamic_cast) operator(<)ident(EventableDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ed)operator(\)) operator({) - reserved(return) ident(ed)operator(->)ident(SetCommInactivityTimeout) operator(()ident(value)operator(\);) - operator(}) - reserved(else) - reserved(return) integer(0)operator(;) comment(//Perhaps this should be an exception. Access to an unknown binding.) -operator(}) - - -comment(/********************** -evma_set_timer_quantum -**********************/) - -directive(extern) string directive(void) ident(evma_set_timer_quantum) operator(()pre_type(int) ident(interval)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventMachine)operator(->)ident(SetTimerQuantum) operator(()ident(interval)operator(\);) -operator(}) - -comment(/************************ -evma_set_max_timer_count -************************/) - -directive(extern) string directive(void) ident(evma_set_max_timer_count) operator(()pre_type(int) ident(ct)operator(\)) -operator({) - comment(// This may only be called if the reactor is not running.) - - reserved(if) operator(()ident(EventMachine)operator(\)) - preprocessor(#ifdef) ident(BUILD_FOR_RUBY) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - preprocessor(#else) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) - ident(EventMachine_t)operator(::)ident(SetMaxTimerCount) operator(()ident(ct)operator(\);) -operator(}) - -comment(/****************** -evma_setuid_string -******************/) - -directive(extern) string directive(void) ident(evma_setuid_string) operator(()directive(const) pre_type(char) operator(*)ident(username)operator(\)) -operator({) - comment(// We do NOT need to be running an EM instance because this method is static.) - ident(EventMachine_t)operator(::)ident(SetuidString) operator(()ident(username)operator(\);) -operator(}) - - -comment(/********** -evma_popen -**********/) - -directive(extern) string directive(const) pre_type(char) operator(*)ident(evma_popen) operator(()pre_type(char) operator(*) directive(const)operator(*)ident(cmd_strings)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - reserved(return) ident(EventMachine)operator(->)ident(Socketpair) operator(()ident(cmd_strings)operator(\);) -operator(}) - - -comment(/*************************** -evma_get_outbound_data_size -***************************/) - -directive(extern) string pre_type(int) ident(evma_get_outbound_data_size) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(\)) -operator({) - ident(ensure_eventmachine)operator(()stringoperator(\);) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) reserved(dynamic_cast) operator(<)ident(EventableDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(return) ident(ed) operator(?) ident(ed)operator(->)ident(GetOutboundDataSize)operator((\)) operator(:) integer(0)operator(;) -operator(}) - - -comment(/*********** -evma__epoll -***********/) - -directive(extern) string directive(void) ident(evma__epoll)operator((\)) -operator({) - ident(bUseEpoll) operator(=) integer(1)operator(;) -operator(}) - -comment(/************ -evma__kqueue -************/) - -directive(extern) string directive(void) ident(evma__kqueue)operator((\)) -operator({) - ident(bUseKqueue) operator(=) integer(1)operator(;) -operator(}) - - -comment(/********************** -evma_set_rlimit_nofile -**********************/) - -directive(extern) string pre_type(int) ident(evma_set_rlimit_nofile) operator(()pre_type(int) ident(nofiles)operator(\)) -operator({) - reserved(return) ident(EventMachine_t)operator(::)ident(SetRlimitNofile) operator(()ident(nofiles)operator(\);) -operator(}) - - -comment(/********************************* -evma_send_file_data_to_connection -*********************************/) - -directive(extern) string pre_type(int) ident(evma_send_file_data_to_connection) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) directive(const) pre_type(char) operator(*)ident(filename)operator(\)) -operator({) - comment(/* This is a sugaring over send_data_to_connection that reads a file into a - * locally-allocated buffer, and sends the file data to the remote peer. - * Return the number of bytes written to the caller. - * TODO, needs to impose a limit on the file size. This is intended only for - * small files. (I don't know, maybe 8K or less.\) For larger files, use interleaved - * I/O to avoid slowing the rest of the system down. - * TODO: we should return a code rather than barf, in case of file-not-found. - * TODO, does this compile on Windows? - * TODO, given that we want this to work only with small files, how about allocating - * the buffer on the stack rather than the heap? - * - * Modified 25Jul07. This now returns -1 on file-too-large; 0 for success, and a positive - * errno in case of other errors. - * - /* Contributed by Kirk Haines. - */) - - pre_type(char) ident(data)operator([)integer(32)operator(*)integer(1024)operator(];) - pre_type(int) ident(r)operator(;) - - ident(ensure_eventmachine)operator(()stringoperator(\);) - - pre_type(int) ident(Fd) operator(=) ident(open) operator(()ident(filename)operator(,) ident(O_RDONLY)operator(\);) - - reserved(if) operator(()ident(Fd) operator(<) integer(0)operator(\)) - reserved(return) ident(errno)operator(;) - comment(// From here on, all early returns MUST close Fd.) - - reserved(struct) ident(stat) ident(st)operator(;) - reserved(if) operator(()ident(fstat) operator(()ident(Fd)operator(,) operator(&)ident(st)operator(\)\)) operator({) - pre_type(int) ident(e) operator(=) ident(errno)operator(;) - ident(close) operator(()ident(Fd)operator(\);) - reserved(return) ident(e)operator(;) - operator(}) - - pre_type(int) ident(filesize) operator(=) ident(st)operator(.)ident(st_size)operator(;) - reserved(if) operator(()ident(filesize) operator(<=) integer(0)operator(\)) operator({) - ident(close) operator(()ident(Fd)operator(\);) - reserved(return) integer(0)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(filesize) operator(>) reserved(sizeof)operator(()ident(data)operator(\)\)) operator({) - ident(close) operator(()ident(Fd)operator(\);) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - - - ident(r) operator(=) ident(read) operator(()ident(Fd)operator(,) ident(data)operator(,) ident(filesize)operator(\);) - reserved(if) operator(()ident(r) operator(!=) ident(filesize)operator(\)) operator({) - pre_type(int) ident(e) operator(=) ident(errno)operator(;) - ident(close) operator(()ident(Fd)operator(\);) - reserved(return) ident(e)operator(;) - operator(}) - ident(evma_send_data_to_connection) operator(()ident(binding)operator(,) ident(data)operator(,) ident(r)operator(\);) - ident(close) operator(()ident(Fd)operator(\);) - - reserved(return) integer(0)operator(;) -operator(}) - -comment(/***************************************************************************** - -$Id$ - -File: cplusplus.cpp -Date: 27Jul07 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - - -preprocessor(#include) include("project.h") - - -reserved(namespace) ident(EM) operator({) - directive(static) ident(map)operator(<)pre_type(string)operator(,) ident(Eventable)operator(*>) ident(Eventables)operator(;) - directive(static) ident(map)operator(<)pre_type(string)operator(,) directive(void)operator((*\)(\)>) ident(Timers)operator(;) -operator(}) - - -comment(/******* -EM::Run -*******/) - -directive(void) ident(EM)operator(::)ident(Run) operator(()directive(void) operator((*)ident(start_func)operator(\)(\)\)) -operator({) - ident(evma__epoll)operator((\);) - ident(evma_initialize_library) operator(()ident(EM)operator(::)ident(Callback)operator(\);) - reserved(if) operator(()ident(start_func)operator(\)) - ident(AddTimer) operator(()integer(0)operator(,) ident(start_func)operator(\);) - ident(evma_run_machine)operator((\);) - ident(evma_release_library)operator((\);) -operator(}) - -comment(/************ -EM::AddTimer -************/) - -directive(void) ident(EM)operator(::)ident(AddTimer) operator(()pre_type(int) ident(milliseconds)operator(,) directive(void) operator((*)ident(func)operator(\)(\)\)) -operator({) - reserved(if) operator(()ident(func)operator(\)) operator({) - directive(const) pre_type(char) operator(*)ident(sig) operator(=) ident(evma_install_oneshot_timer) operator(()ident(milliseconds)operator(\);) - ident(Timers)operator(.)ident(insert) operator(()ident(make_pair) operator(()ident(sig)operator(,) ident(func)operator(\)\);) - operator(}) -operator(}) - - -comment(/*************** -EM::StopReactor -***************/) - -directive(void) ident(EM)operator(::)ident(StopReactor)operator((\)) -operator({) - ident(evma_stop_machine)operator((\);) -operator(}) - - -comment(/******************** -EM::Acceptor::Accept -********************/) - -directive(void) ident(EM)operator(::)ident(Acceptor)operator(::)ident(Accept) operator(()directive(const) pre_type(char) operator(*)ident(signature)operator(\)) -operator({) - ident(Connection) operator(*)ident(c) operator(=) ident(MakeConnection)operator((\);) - ident(c)operator(->)ident(Signature) operator(=) ident(signature)operator(;) - ident(Eventables)operator(.)ident(insert) operator(()ident(make_pair) operator(()ident(c)operator(->)ident(Signature)operator(,) ident(c)operator(\)\);) - ident(c)operator(->)ident(PostInit)operator((\);) -operator(}) - -comment(/************************ -EM::Connection::SendData -************************/) - -directive(void) ident(EM)operator(::)ident(Connection)operator(::)ident(SendData) operator(()directive(const) pre_type(char) operator(*)ident(data)operator(\)) -operator({) - reserved(if) operator(()ident(data)operator(\)) - ident(SendData) operator(()ident(data)operator(,) ident(strlen) operator(()ident(data)operator(\)\);) -operator(}) - - -comment(/************************ -EM::Connection::SendData -************************/) - -directive(void) ident(EM)operator(::)ident(Connection)operator(::)ident(SendData) operator(()directive(const) pre_type(char) operator(*)ident(data)operator(,) pre_type(int) ident(length)operator(\)) -operator({) - ident(evma_send_data_to_connection) operator(()ident(Signature)operator(.)ident(c_str)operator((\),) ident(data)operator(,) ident(length)operator(\);) -operator(}) - - -comment(/********************* -EM::Connection::Close -*********************/) - -directive(void) ident(EM)operator(::)ident(Connection)operator(::)ident(Close) operator(()pre_type(bool) ident(afterWriting)operator(\)) -operator({) - ident(evma_close_connection) operator(()ident(Signature)operator(.)ident(c_str)operator((\),) ident(afterWriting)operator(\);) -operator(}) - - -comment(/*********************** -EM::Connection::Connect -***********************/) - -directive(void) ident(EM)operator(::)ident(Connection)operator(::)ident(Connect) operator(()directive(const) pre_type(char) operator(*)ident(host)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - ident(Signature) operator(=) ident(evma_connect_to_server) operator(()ident(host)operator(,) ident(port)operator(\);) - ident(Eventables)operator(.)ident(insert)operator(() ident(make_pair) operator(()ident(Signature)operator(,) local_variable(this)operator(\)\);) -operator(}) - -comment(/******************* -EM::Acceptor::Start -*******************/) - -directive(void) ident(EM)operator(::)ident(Acceptor)operator(::)ident(Start) operator(()directive(const) pre_type(char) operator(*)ident(host)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - ident(Signature) operator(=) ident(evma_create_tcp_server) operator(()ident(host)operator(,) ident(port)operator(\);) - ident(Eventables)operator(.)ident(insert)operator(() ident(make_pair) operator(()ident(Signature)operator(,) local_variable(this)operator(\)\);) -operator(}) - - - -comment(/************ -EM::Callback -************/) - -directive(void) ident(EM)operator(::)ident(Callback) operator(()directive(const) pre_type(char) operator(*)ident(sig)operator(,) pre_type(int) ident(ev)operator(,) directive(const) pre_type(char) operator(*)ident(data)operator(,) pre_type(int) ident(length)operator(\)) -operator({) - ident(EM)operator(::)ident(Eventable) operator(*)ident(e)operator(;) - directive(void) operator((*)ident(f)operator(\)(\);) - - reserved(switch) operator(()ident(ev)operator(\)) operator({) - reserved(case) ident(EM_TIMER_FIRED)operator(:) - ident(f) operator(=) ident(Timers) operator([)ident(data)operator(];) - reserved(if) operator(()ident(f)operator(\)) - operator((*)ident(f)operator(\)(\);) - ident(Timers)operator(.)ident(erase) operator(()ident(sig)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(EM_CONNECTION_READ)operator(:) - ident(e) operator(=) ident(EM)operator(::)ident(Eventables) operator([)ident(sig)operator(];) - ident(e)operator(->)ident(ReceiveData) operator(()ident(data)operator(,) ident(length)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(EM_CONNECTION_COMPLETED)operator(:) - ident(e) operator(=) ident(EM)operator(::)ident(Eventables) operator([)ident(sig)operator(];) - ident(e)operator(->)ident(ConnectionCompleted)operator((\);) - reserved(break)operator(;) - - reserved(case) ident(EM_CONNECTION_ACCEPTED)operator(:) - ident(e) operator(=) ident(EM)operator(::)ident(Eventables) operator([)ident(sig)operator(];) - ident(e)operator(->)ident(Accept) operator(()ident(data)operator(\);) - reserved(break)operator(;) - - reserved(case) ident(EM_CONNECTION_UNBOUND)operator(:) - ident(e) operator(=) ident(EM)operator(::)ident(Eventables) operator([)ident(sig)operator(];) - ident(e)operator(->)ident(Unbind)operator((\);) - ident(EM)operator(::)ident(Eventables)operator(.)ident(erase) operator(()ident(sig)operator(\);) - reserved(delete) ident(e)operator(;) - reserved(break)operator(;) - operator(}) -operator(}) - -comment(/***************************************************************************** - -$Id$ - -File: ed.cpp -Date: 06Apr06 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - -preprocessor(#include) include("project.h") - - - -comment(/******************** -SetSocketNonblocking -********************/) - -pre_type(bool) ident(SetSocketNonblocking) operator(()ident(SOCKET) ident(sd)operator(\)) -operator({) - preprocessor(#ifdef) ident(OS_UNIX) - pre_type(int) ident(val) operator(=) ident(fcntl) operator(()ident(sd)operator(,) ident(F_GETFL)operator(,) integer(0)operator(\);) - reserved(return) operator(()ident(fcntl) operator(()ident(sd)operator(,) ident(F_SETFL)operator(,) ident(val) operator(|) ident(O_NONBLOCK)operator(\)) operator(!=) ident(SOCKET_ERROR)operator(\)) operator(?) pre_constant(true) operator(:) pre_constant(false)operator(;) - preprocessor(#endif) - - preprocessor(#ifdef) ident(OS_WIN32) - pre_type(unsigned) pre_type(long) ident(one) operator(=) integer(1)operator(;) - reserved(return) operator(()ident(ioctlsocket) operator(()ident(sd)operator(,) ident(FIONBIO)operator(,) operator(&)ident(one)operator(\)) operator(==) integer(0)operator(\)) operator(?) pre_constant(true) operator(:) pre_constant(false)operator(;) - preprocessor(#endif) -operator(}) - - -comment(/**************************************** -EventableDescriptor::EventableDescriptor -****************************************/) - -ident(EventableDescriptor)operator(::)ident(EventableDescriptor) operator(()pre_type(int) ident(sd)operator(,) ident(EventMachine_t) operator(*)ident(em)operator(\):) - ident(bCloseNow) operator(()pre_constant(false)operator(\),) - ident(bCloseAfterWriting) operator(()pre_constant(false)operator(\),) - ident(MySocket) operator(()ident(sd)operator(\),) - ident(EventCallback) operator(()pre_constant(NULL)operator(\),) - ident(LastRead) operator(()integer(0)operator(\),) - ident(LastWritten) operator(()integer(0)operator(\),) - ident(bCallbackUnbind) operator(()pre_constant(true)operator(\),) - ident(MyEventMachine) operator(()ident(em)operator(\)) -operator({) - comment(/* There are three ways to close a socket, all of which should - * automatically signal to the event machine that this object - * should be removed from the polling scheduler. - * First is a hard close, intended for bad errors or possible - * security violations. It immediately closes the connection - * and puts this object into an error state. - * Second is to set bCloseNow, which will cause the event machine - * to delete this object (and thus close the connection in our - * destructor\) the next chance it gets. bCloseNow also inhibits - * the writing of new data on the socket (but not necessarily - * the reading of new data\). - * The third way is to set bCloseAfterWriting, which inhibits - * the writing of new data and converts to bCloseNow as soon - * as everything in the outbound queue has been written. - * bCloseAfterWriting is really for use only by protocol handlers - * (for example, HTTP writes an HTML page and then closes the - * connection\). All of the error states we generate internally - * cause an immediate close to be scheduled, which may have the - * effect of discarding outbound data. - */) - - reserved(if) operator(()ident(sd) operator(==) ident(INVALID_SOCKET)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - reserved(if) operator(()ident(MyEventMachine) operator(==) pre_constant(NULL)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(CreatedAt) operator(=) ident(gCurrentLoopTime)operator(;) - - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(data)operator(.)ident(ptr) operator(=) local_variable(this)operator(;) - preprocessor(#endif) -operator(}) - - -comment(/***************************************** -EventableDescriptor::~EventableDescriptor -*****************************************/) - -ident(EventableDescriptor)operator(::~)ident(EventableDescriptor)operator((\)) -operator({) - reserved(if) operator(()ident(EventCallback) operator(&&) ident(bCallbackUnbind)operator(\)) - operator((*)ident(EventCallback)operator(\)()ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(EM_CONNECTION_UNBOUND)operator(,) pre_constant(NULL)operator(,) integer(0)operator(\);) - ident(Close)operator((\);) -operator(}) - - -comment(/************************************* -EventableDescriptor::SetEventCallback -*************************************/) - -directive(void) ident(EventableDescriptor)operator(::)ident(SetEventCallback) operator(()directive(void)operator((*)ident(cb)operator(\)()directive(const) pre_type(char)operator(*,) pre_type(int)operator(,) directive(const) pre_type(char)operator(*,) pre_type(int)operator(\)\)) -operator({) - ident(EventCallback) operator(=) ident(cb)operator(;) -operator(}) - - -comment(/************************** -EventableDescriptor::Close -**************************/) - -directive(void) ident(EventableDescriptor)operator(::)ident(Close)operator((\)) -operator({) - comment(// Close the socket right now. Intended for emergencies.) - reserved(if) operator(()ident(MySocket) operator(!=) ident(INVALID_SOCKET)operator(\)) operator({) - ident(shutdown) operator(()ident(MySocket)operator(,) integer(1)operator(\);) - ident(closesocket) operator(()ident(MySocket)operator(\);) - ident(MySocket) operator(=) ident(INVALID_SOCKET)operator(;) - operator(}) -operator(}) - - -comment(/********************************* -EventableDescriptor::ShouldDelete -*********************************/) - -pre_type(bool) ident(EventableDescriptor)operator(::)ident(ShouldDelete)operator((\)) -operator({) - comment(/* For use by a socket manager, which needs to know if this object - * should be removed from scheduling events and deleted. - * Has an immediate close been scheduled, or are we already closed? - * If either of these are the case, return true. In theory, the manager will - * then delete us, which in turn will make sure the socket is closed. - * Note, if bCloseAfterWriting is true, we check a virtual method to see - * if there is outbound data to write, and only request a close if there is none. - */) - - reserved(return) operator((()ident(MySocket) operator(==) ident(INVALID_SOCKET)operator(\)) operator(||) ident(bCloseNow) operator(||) operator(()ident(bCloseAfterWriting) operator(&&) operator(()ident(GetOutboundDataSize)operator((\)) operator(<=) integer(0)operator(\)\)\);) -operator(}) - - -comment(/********************************** -EventableDescriptor::ScheduleClose -**********************************/) - -directive(void) ident(EventableDescriptor)operator(::)ident(ScheduleClose) operator(()pre_type(bool) ident(after_writing)operator(\)) -operator({) - comment(// KEEP THIS SYNCHRONIZED WITH ::IsCloseScheduled.) - reserved(if) operator(()ident(after_writing)operator(\)) - ident(bCloseAfterWriting) operator(=) pre_constant(true)operator(;) - reserved(else) - ident(bCloseNow) operator(=) pre_constant(true)operator(;) -operator(}) - - -comment(/************************************* -EventableDescriptor::IsCloseScheduled -*************************************/) - -pre_type(bool) ident(EventableDescriptor)operator(::)ident(IsCloseScheduled)operator((\)) -operator({) - comment(// KEEP THIS SYNCHRONIZED WITH ::ScheduleClose.) - reserved(return) operator(()ident(bCloseNow) operator(||) ident(bCloseAfterWriting)operator(\);) -operator(}) - - -comment(/****************************************** -ConnectionDescriptor::ConnectionDescriptor -******************************************/) - -ident(ConnectionDescriptor)operator(::)ident(ConnectionDescriptor) operator(()pre_type(int) ident(sd)operator(,) ident(EventMachine_t) operator(*)ident(em)operator(\):) - ident(EventableDescriptor) operator(()ident(sd)operator(,) ident(em)operator(\),) - ident(bConnectPending) operator(()pre_constant(false)operator(\),) - ident(bNotifyReadable) operator(()pre_constant(false)operator(\),) - ident(bNotifyWritable) operator(()pre_constant(false)operator(\),) - ident(bReadAttemptedAfterClose) operator(()pre_constant(false)operator(\),) - ident(bWriteAttemptedAfterClose) operator(()pre_constant(false)operator(\),) - ident(OutboundDataSize) operator(()integer(0)operator(\),) - preprocessor(#ifdef) ident(WITH_SSL) - ident(SslBox) operator(()pre_constant(NULL)operator(\),) - preprocessor(#endif) - ident(bIsServer) operator(()pre_constant(false)operator(\),) - ident(LastIo) operator(()ident(gCurrentLoopTime)operator(\),) - ident(InactivityTimeout) operator(()integer(0)operator(\)) -operator({) - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) ident(EPOLLOUT)operator(;) - preprocessor(#endif) - comment(// 22Jan09: Moved ArmKqueueWriter into SetConnectPending(\) to fix assertion failure in _WriteOutboundData(\)) -operator(}) - - -comment(/******************************************* -ConnectionDescriptor::~ConnectionDescriptor -*******************************************/) - -ident(ConnectionDescriptor)operator(::~)ident(ConnectionDescriptor)operator((\)) -operator({) - comment(// Run down any stranded outbound data.) - reserved(for) operator(()ident(size_t) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(OutboundPages)operator(.)ident(size)operator((\);) ident(i)operator(++\)) - ident(OutboundPages)operator([)ident(i)operator(])operator(.)ident(Free)operator((\);) - - preprocessor(#ifdef) ident(WITH_SSL) - reserved(if) operator(()ident(SslBox)operator(\)) - reserved(delete) ident(SslBox)operator(;) - preprocessor(#endif) -operator(}) - - -comment(/************************************************** -STATIC: ConnectionDescriptor::SendDataToConnection -**************************************************/) - -pre_type(int) ident(ConnectionDescriptor)operator(::)ident(SendDataToConnection) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) directive(const) pre_type(char) operator(*)ident(data)operator(,) pre_type(int) ident(data_length)operator(\)) -operator({) - comment(// TODO: This is something of a hack, or at least it's a static method of the wrong class.) - comment(// TODO: Poor polymorphism here. We should be calling one virtual method) - comment(// instead of hacking out the runtime information of the target object.) - ident(ConnectionDescriptor) operator(*)ident(cd) operator(=) reserved(dynamic_cast) operator(<)ident(ConnectionDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(cd)operator(\)) - reserved(return) ident(cd)operator(->)ident(SendOutboundData) operator(()ident(data)operator(,) ident(data_length)operator(\);) - ident(DatagramDescriptor) operator(*)ident(ds) operator(=) reserved(dynamic_cast) operator(<)ident(DatagramDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ds)operator(\)) - reserved(return) ident(ds)operator(->)ident(SendOutboundData) operator(()ident(data)operator(,) ident(data_length)operator(\);) - preprocessor(#ifdef) ident(OS_UNIX) - ident(PipeDescriptor) operator(*)ident(ps) operator(=) reserved(dynamic_cast) operator(<)ident(PipeDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ps)operator(\)) - reserved(return) ident(ps)operator(->)ident(SendOutboundData) operator(()ident(data)operator(,) ident(data_length)operator(\);) - preprocessor(#endif) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - - -comment(/********************************************* -STATIC: ConnectionDescriptor::CloseConnection -*********************************************/) - -directive(void) ident(ConnectionDescriptor)operator(::)ident(CloseConnection) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) pre_type(bool) ident(after_writing)operator(\)) -operator({) - comment(// TODO: This is something of a hack, or at least it's a static method of the wrong class.) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) reserved(dynamic_cast) operator(<)ident(EventableDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ed)operator(\)) - ident(ed)operator(->)ident(ScheduleClose) operator(()ident(after_writing)operator(\);) -operator(}) - -comment(/*********************************************** -STATIC: ConnectionDescriptor::ReportErrorStatus -***********************************************/) - -pre_type(int) ident(ConnectionDescriptor)operator(::)ident(ReportErrorStatus) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(\)) -operator({) - comment(// TODO: This is something of a hack, or at least it's a static method of the wrong class.) - comment(// TODO: Poor polymorphism here. We should be calling one virtual method) - comment(// instead of hacking out the runtime information of the target object.) - ident(ConnectionDescriptor) operator(*)ident(cd) operator(=) reserved(dynamic_cast) operator(<)ident(ConnectionDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(cd)operator(\)) - reserved(return) ident(cd)operator(->)ident(_ReportErrorStatus)operator((\);) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - -comment(/*************************************** -ConnectionDescriptor::SetConnectPending -****************************************/) - -directive(void) ident(ConnectionDescriptor)operator(::)ident(SetConnectPending)operator(()pre_type(bool) ident(f)operator(\)) -operator({) - ident(bConnectPending) operator(=) ident(f)operator(;) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - ident(MyEventMachine)operator(->)ident(ArmKqueueWriter) operator(()local_variable(this)operator(\);) - preprocessor(#endif) -operator(}) - - -comment(/************************************** -ConnectionDescriptor::SendOutboundData -**************************************/) - -pre_type(int) ident(ConnectionDescriptor)operator(::)ident(SendOutboundData) operator(()directive(const) pre_type(char) operator(*)ident(data)operator(,) pre_type(int) ident(length)operator(\)) -operator({) - preprocessor(#ifdef) ident(WITH_SSL) - reserved(if) operator(()ident(SslBox)operator(\)) operator({) - reserved(if) operator(()ident(length) operator(>) integer(0)operator(\)) operator({) - pre_type(int) ident(w) operator(=) ident(SslBox)operator(->)ident(PutPlaintext) operator(()ident(data)operator(,) ident(length)operator(\);) - reserved(if) operator(()ident(w) operator(<) integer(0)operator(\)) - ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - reserved(else) - ident(_DispatchCiphertext)operator((\);) - operator(}) - comment(// TODO: What's the correct return value?) - reserved(return) integer(1)operator(;) comment(// That's a wild guess, almost certainly wrong.) - operator(}) - reserved(else) - preprocessor(#endif) - reserved(return) ident(_SendRawOutboundData) operator(()ident(data)operator(,) ident(length)operator(\);) -operator(}) - - - -comment(/****************************************** -ConnectionDescriptor::_SendRawOutboundData -******************************************/) - -pre_type(int) ident(ConnectionDescriptor)operator(::)ident(_SendRawOutboundData) operator(()directive(const) pre_type(char) operator(*)ident(data)operator(,) pre_type(int) ident(length)operator(\)) -operator({) - comment(/* This internal method is called to schedule bytes that - * will be sent out to the remote peer. - * It's not directly accessed by the caller, who hits ::SendOutboundData, - * which may or may not filter or encrypt the caller's data before - * sending it here. - */) - - comment(// Highly naive and incomplete implementation.) - comment(// There's no throttle for runaways (which should abort only this connection) - comment(// and not the whole process\), and no coalescing of small pages.) - comment(// (Well, not so bad, small pages are coalesced in ::Write\)) - - reserved(if) operator(()ident(IsCloseScheduled)operator((\)\)) - comment(//if (bCloseNow || bCloseAfterWriting\)) - reserved(return) integer(0)operator(;) - - reserved(if) operator((!)ident(data) operator(&&) operator(()ident(length) operator(>) integer(0)operator(\)\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - pre_type(char) operator(*)ident(buffer) operator(=) operator(()pre_type(char) operator(*\)) ident(malloc) operator(()ident(length) operator(+) integer(1)operator(\);) - reserved(if) operator((!)ident(buffer)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(memcpy) operator(()ident(buffer)operator(,) ident(data)operator(,) ident(length)operator(\);) - ident(buffer) operator([)ident(length)operator(]) operator(=) integer(0)operator(;) - ident(OutboundPages)operator(.)ident(push_back) operator(()ident(OutboundPage) operator(()ident(buffer)operator(,) ident(length)operator(\)\);) - ident(OutboundDataSize) operator(+=) ident(length)operator(;) - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) operator(()ident(EPOLLIN) operator(|) ident(EPOLLOUT)operator(\);) - ident(assert) operator(()ident(MyEventMachine)operator(\);) - ident(MyEventMachine)operator(->)ident(Modify) operator(()local_variable(this)operator(\);) - preprocessor(#endif) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - ident(MyEventMachine)operator(->)ident(ArmKqueueWriter) operator(()local_variable(this)operator(\);) - preprocessor(#endif) - reserved(return) ident(length)operator(;) -operator(}) - - - -comment(/*********************************** -ConnectionDescriptor::SelectForRead -***********************************/) - -pre_type(bool) ident(ConnectionDescriptor)operator(::)ident(SelectForRead)operator((\)) -operator({) - comment(/* A connection descriptor is always scheduled for read, - * UNLESS it's in a pending-connect state. - * On Linux, unlike Unix, a nonblocking socket on which - * connect has been called, does NOT necessarily select - * both readable and writable in case of error. - * The socket will select writable when the disposition - * of the connect is known. On the other hand, a socket - * which successfully connects and selects writable may - * indeed have some data available on it, so it will - * select readable in that case, violating expectations! - * So we will not poll for readability until the socket - * is known to be in a connected state. - */) - - reserved(return) ident(bConnectPending) operator(?) pre_constant(false) operator(:) pre_constant(true)operator(;) -operator(}) - - -comment(/************************************ -ConnectionDescriptor::SelectForWrite -************************************/) - -pre_type(bool) ident(ConnectionDescriptor)operator(::)ident(SelectForWrite)operator((\)) -operator({) - comment(/* Cf the notes under SelectForRead. - * In a pending-connect state, we ALWAYS select for writable. - * In a normal state, we only select for writable when we - * have outgoing data to send. - */) - - reserved(if) operator(()ident(bConnectPending) operator(||) ident(bNotifyWritable)operator(\)) - reserved(return) pre_constant(true)operator(;) - reserved(else) operator({) - reserved(return) operator(()ident(GetOutboundDataSize)operator((\)) operator(>) integer(0)operator(\);) - operator(}) -operator(}) - - -comment(/************************** -ConnectionDescriptor::Read -**************************/) - -directive(void) ident(ConnectionDescriptor)operator(::)ident(Read)operator((\)) -operator({) - comment(/* Read and dispatch data on a socket that has selected readable. - * It's theoretically possible to get and dispatch incoming data on - * a socket that has already been scheduled for closing or close-after-writing. - * In those cases, we'll leave it up the to protocol handler to "do the - * right thing" (which probably means to ignore the incoming data\). - * - * 22Aug06: Chris Ochs reports that on FreeBSD, it's possible to come - * here with the socket already closed, after the process receives - * a ctrl-C signal (not sure if that's TERM or INT on BSD\). The application - * was one in which network connections were doing a lot of interleaved reads - * and writes. - * Since we always write before reading (in order to keep the outbound queues - * as light as possible\), I think what happened is that an interrupt caused - * the socket to be closed in ConnectionDescriptor::Write. We'll then - * come here in the same pass through the main event loop, and won't get - * cleaned up until immediately after. - * We originally asserted that the socket was valid when we got here. - * To deal properly with the possibility that we are closed when we get here, - * I removed the assert. HOWEVER, the potential for an infinite loop scares me, - * so even though this is really clunky, I added a flag to assert that we never - * come here more than once after being closed. (FCianfrocca\) - */) - - pre_type(int) ident(sd) operator(=) ident(GetSocket)operator((\);) - comment(//assert (sd != INVALID_SOCKET\); (original, removed 22Aug06\)) - reserved(if) operator(()ident(sd) operator(==) ident(INVALID_SOCKET)operator(\)) operator({) - ident(assert) operator((!)ident(bReadAttemptedAfterClose)operator(\);) - ident(bReadAttemptedAfterClose) operator(=) pre_constant(true)operator(;) - reserved(return)operator(;) - operator(}) - - reserved(if) operator(()ident(bNotifyReadable)operator(\)) operator({) - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)()ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(EM_CONNECTION_NOTIFY_READABLE)operator(,) pre_constant(NULL)operator(,) integer(0)operator(\);) - reserved(return)operator(;) - operator(}) - - ident(LastIo) operator(=) ident(gCurrentLoopTime)operator(;) - - pre_type(int) ident(total_bytes_read) operator(=) integer(0)operator(;) - pre_type(char) ident(readbuffer) operator([)integer(16) operator(*) integer(1024) operator(+) integer(1)operator(];) - - reserved(for) operator(()pre_type(int) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) integer(10)operator(;) ident(i)operator(++\)) operator({) - comment(// Don't read just one buffer and then move on. This is faster) - comment(// if there is a lot of incoming.) - comment(// But don't read indefinitely. Give other sockets a chance to run.) - comment(// NOTICE, we're reading one less than the buffer size.) - comment(// That's so we can put a guard byte at the end of what we send) - comment(// to user code.) - - - pre_type(int) ident(r) operator(=) ident(recv) operator(()ident(sd)operator(,) ident(readbuffer)operator(,) reserved(sizeof)operator(()ident(readbuffer)operator(\)) operator(-) integer(1)operator(,) integer(0)operator(\);) - comment(//cerr << "";) - - reserved(if) operator(()ident(r) operator(>) integer(0)operator(\)) operator({) - ident(total_bytes_read) operator(+=) ident(r)operator(;) - ident(LastRead) operator(=) ident(gCurrentLoopTime)operator(;) - - comment(// Add a null-terminator at the the end of the buffer) - comment(// that we will send to the callback.) - comment(// DO NOT EVER CHANGE THIS. We want to explicitly allow users) - comment(// to be able to depend on this behavior, so they will have) - comment(// the option to do some things faster. Additionally it's) - comment(// a security guard against buffer overflows.) - ident(readbuffer) operator([)ident(r)operator(]) operator(=) integer(0)operator(;) - ident(_DispatchInboundData) operator(()ident(readbuffer)operator(,) ident(r)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(r) operator(==) integer(0)operator(\)) operator({) - reserved(break)operator(;) - operator(}) - reserved(else) operator({) - comment(// Basically a would-block, meaning we've read everything there is to read.) - reserved(break)operator(;) - operator(}) - - operator(}) - - - reserved(if) operator(()ident(total_bytes_read) operator(==) integer(0)operator(\)) operator({) - comment(// If we read no data on a socket that selected readable,) - comment(// it generally means the other end closed the connection gracefully.) - ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - comment(//bCloseNow = true;) - operator(}) - -operator(}) - - - -comment(/****************************************** -ConnectionDescriptor::_DispatchInboundData -******************************************/) - -directive(void) ident(ConnectionDescriptor)operator(::)ident(_DispatchInboundData) operator(()directive(const) pre_type(char) operator(*)ident(buffer)operator(,) pre_type(int) ident(size)operator(\)) -operator({) - preprocessor(#ifdef) ident(WITH_SSL) - reserved(if) operator(()ident(SslBox)operator(\)) operator({) - ident(SslBox)operator(->)ident(PutCiphertext) operator(()ident(buffer)operator(,) ident(size)operator(\);) - - pre_type(int) ident(s)operator(;) - pre_type(char) ident(B) operator([)integer(2048)operator(];) - reserved(while) operator((()ident(s) operator(=) ident(SslBox)operator(->)ident(GetPlaintext) operator(()ident(B)operator(,) reserved(sizeof)operator(()ident(B)operator(\)) operator(-) integer(1)operator(\)\)) operator(>) integer(0)operator(\)) operator({) - ident(B) operator([)ident(s)operator(]) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)()ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(EM_CONNECTION_READ)operator(,) ident(B)operator(,) ident(s)operator(\);) - operator(}) - comment(// INCOMPLETE, s may indicate an SSL error that would force the connection down.) - ident(_DispatchCiphertext)operator((\);) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)()ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(EM_CONNECTION_READ)operator(,) ident(buffer)operator(,) ident(size)operator(\);) - operator(}) - preprocessor(#endif) - - preprocessor(#ifdef) ident(WITHOUT_SSL) - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)()ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(EM_CONNECTION_READ)operator(,) ident(buffer)operator(,) ident(size)operator(\);) - preprocessor(#endif) -operator(}) - - - - - -comment(/*************************** -ConnectionDescriptor::Write -***************************/) - -directive(void) ident(ConnectionDescriptor)operator(::)ident(Write)operator((\)) -operator({) - comment(/* A socket which is in a pending-connect state will select - * writable when the disposition of the connect is known. - * At that point, check to be sure there are no errors, - * and if none, then promote the socket out of the pending - * state. - * TODO: I haven't figured out how Windows signals errors on - * unconnected sockets. Maybe it does the untraditional but - * logical thing and makes the socket selectable for error. - * If so, it's unsupported here for the time being, and connect - * errors will have to be caught by the timeout mechanism. - */) - - reserved(if) operator(()ident(bConnectPending)operator(\)) operator({) - pre_type(int) ident(error)operator(;) - ident(socklen_t) ident(len)operator(;) - ident(len) operator(=) reserved(sizeof)operator(()ident(error)operator(\);) - preprocessor(#ifdef) ident(OS_UNIX) - pre_type(int) ident(o) operator(=) ident(getsockopt) operator(()ident(GetSocket)operator((\),) ident(SOL_SOCKET)operator(,) ident(SO_ERROR)operator(,) operator(&)ident(error)operator(,) operator(&)ident(len)operator(\);) - preprocessor(#endif) - preprocessor(#ifdef) ident(OS_WIN32) - pre_type(int) ident(o) operator(=) ident(getsockopt) operator(()ident(GetSocket)operator((\),) ident(SOL_SOCKET)operator(,) ident(SO_ERROR)operator(,) operator(()pre_type(char)operator(*\)&)ident(error)operator(,) operator(&)ident(len)operator(\);) - preprocessor(#endif) - reserved(if) operator((()ident(o) operator(==) integer(0)operator(\)) operator(&&) operator(()ident(error) operator(==) integer(0)operator(\)\)) operator({) - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)()ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(EM_CONNECTION_COMPLETED)operator(,) stringoperator(,) integer(0)operator(\);) - ident(bConnectPending) operator(=) pre_constant(false)operator(;) - preprocessor(#ifdef) ident(HAVE_EPOLL) - comment(// The callback may have scheduled outbound data.) - ident(EpollEvent)operator(.)ident(events) operator(=) ident(EPOLLIN) operator(|) operator(()ident(SelectForWrite)operator((\)) operator(?) ident(EPOLLOUT) operator(:) integer(0)operator(\);) - preprocessor(#endif) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - ident(MyEventMachine)operator(->)ident(ArmKqueueReader) operator(()local_variable(this)operator(\);) - comment(// The callback may have scheduled outbound data.) - reserved(if) operator(()ident(SelectForWrite)operator((\)\)) - ident(MyEventMachine)operator(->)ident(ArmKqueueWriter) operator(()local_variable(this)operator(\);) - preprocessor(#endif) - operator(}) - reserved(else) - ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - comment(//bCloseNow = true;) - operator(}) - reserved(else) operator({) - - reserved(if) operator(()ident(bNotifyWritable)operator(\)) operator({) - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)()ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(EM_CONNECTION_NOTIFY_WRITABLE)operator(,) pre_constant(NULL)operator(,) integer(0)operator(\);) - reserved(return)operator(;) - operator(}) - - ident(_WriteOutboundData)operator((\);) - operator(}) -operator(}) - - -comment(/**************************************** -ConnectionDescriptor::_WriteOutboundData -****************************************/) - -directive(void) ident(ConnectionDescriptor)operator(::)ident(_WriteOutboundData)operator((\)) -operator({) - comment(/* This is a helper function called by ::Write. - * It's possible for a socket to select writable and then no longer - * be writable by the time we get around to writing. The kernel might - * have used up its available output buffers between the select call - * and when we get here. So this condition is not an error. - * - * 20Jul07, added the same kind of protection against an invalid socket - * that is at the top of ::Read. Not entirely how this could happen in - * real life (connection-reset from the remote peer, perhaps?\), but I'm - * doing it to address some reports of crashing under heavy loads. - */) - - pre_type(int) ident(sd) operator(=) ident(GetSocket)operator((\);) - comment(//assert (sd != INVALID_SOCKET\);) - reserved(if) operator(()ident(sd) operator(==) ident(INVALID_SOCKET)operator(\)) operator({) - ident(assert) operator((!)ident(bWriteAttemptedAfterClose)operator(\);) - ident(bWriteAttemptedAfterClose) operator(=) pre_constant(true)operator(;) - reserved(return)operator(;) - operator(}) - - ident(LastIo) operator(=) ident(gCurrentLoopTime)operator(;) - pre_type(char) ident(output_buffer) operator([)integer(16) operator(*) integer(1024)operator(];) - ident(size_t) ident(nbytes) operator(=) integer(0)operator(;) - - reserved(while) operator((()ident(OutboundPages)operator(.)ident(size)operator((\)) operator(>) integer(0)operator(\)) operator(&&) operator(()ident(nbytes) operator(<) reserved(sizeof)operator(()ident(output_buffer)operator(\)\)\)) operator({) - ident(OutboundPage) operator(*)ident(op) operator(=) operator(&()ident(OutboundPages)operator([)integer(0)operator(]\);) - reserved(if) operator((()ident(nbytes) operator(+) ident(op)operator(->)ident(Length) operator(-) ident(op)operator(->)ident(Offset)operator(\)) operator(<) reserved(sizeof) operator(()ident(output_buffer)operator(\)\)) operator({) - ident(memcpy) operator(()ident(output_buffer) operator(+) ident(nbytes)operator(,) ident(op)operator(->)ident(Buffer) operator(+) ident(op)operator(->)ident(Offset)operator(,) ident(op)operator(->)ident(Length) operator(-) ident(op)operator(->)ident(Offset)operator(\);) - ident(nbytes) operator(+=) operator(()ident(op)operator(->)ident(Length) operator(-) ident(op)operator(->)ident(Offset)operator(\);) - ident(op)operator(->)ident(Free)operator((\);) - ident(OutboundPages)operator(.)ident(pop_front)operator((\);) - operator(}) - reserved(else) operator({) - pre_type(int) ident(len) operator(=) reserved(sizeof)operator(()ident(output_buffer)operator(\)) operator(-) ident(nbytes)operator(;) - ident(memcpy) operator(()ident(output_buffer) operator(+) ident(nbytes)operator(,) ident(op)operator(->)ident(Buffer) operator(+) ident(op)operator(->)ident(Offset)operator(,) ident(len)operator(\);) - ident(op)operator(->)ident(Offset) operator(+=) ident(len)operator(;) - ident(nbytes) operator(+=) ident(len)operator(;) - operator(}) - operator(}) - - comment(// We should never have gotten here if there were no data to write,) - comment(// so assert that as a sanity check.) - comment(// Don't bother to make sure nbytes is less than output_buffer because) - comment(// if it were we probably would have crashed already.) - ident(assert) operator(()ident(nbytes) operator(>) integer(0)operator(\);) - - ident(assert) operator(()ident(GetSocket)operator((\)) operator(!=) ident(INVALID_SOCKET)operator(\);) - pre_type(int) ident(bytes_written) operator(=) ident(send) operator(()ident(GetSocket)operator((\),) ident(output_buffer)operator(,) ident(nbytes)operator(,) integer(0)operator(\);) - - pre_type(bool) ident(err) operator(=) pre_constant(false)operator(;) - reserved(if) operator(()ident(bytes_written) operator(<) integer(0)operator(\)) operator({) - ident(err) operator(=) pre_constant(true)operator(;) - ident(bytes_written) operator(=) integer(0)operator(;) - operator(}) - - ident(assert) operator(()ident(bytes_written) operator(>=) integer(0)operator(\);) - ident(OutboundDataSize) operator(-=) ident(bytes_written)operator(;) - reserved(if) operator((()ident(size_t)operator(\))ident(bytes_written) operator(<) ident(nbytes)operator(\)) operator({) - pre_type(int) ident(len) operator(=) ident(nbytes) operator(-) ident(bytes_written)operator(;) - pre_type(char) operator(*)ident(buffer) operator(=) operator(()pre_type(char)operator(*\)) ident(malloc) operator(()ident(len) operator(+) integer(1)operator(\);) - reserved(if) operator((!)ident(buffer)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(memcpy) operator(()ident(buffer)operator(,) ident(output_buffer) operator(+) ident(bytes_written)operator(,) ident(len)operator(\);) - ident(buffer) operator([)ident(len)operator(]) operator(=) integer(0)operator(;) - ident(OutboundPages)operator(.)ident(push_front) operator(()ident(OutboundPage) operator(()ident(buffer)operator(,) ident(len)operator(\)\);) - operator(}) - - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) operator(()ident(EPOLLIN) operator(|) operator(()ident(SelectForWrite)operator((\)) operator(?) ident(EPOLLOUT) operator(:) integer(0)operator(\)\);) - ident(assert) operator(()ident(MyEventMachine)operator(\);) - ident(MyEventMachine)operator(->)ident(Modify) operator(()local_variable(this)operator(\);) - preprocessor(#endif) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - reserved(if) operator(()ident(SelectForWrite)operator((\)\)) - ident(MyEventMachine)operator(->)ident(ArmKqueueWriter) operator(()local_variable(this)operator(\);) - preprocessor(#endif) - - - reserved(if) operator(()ident(err)operator(\)) operator({) - preprocessor(#ifdef) ident(OS_UNIX) - reserved(if) operator((()ident(errno) operator(!=) ident(EINPROGRESS)operator(\)) operator(&&) operator(()ident(errno) operator(!=) ident(EWOULDBLOCK)operator(\)) operator(&&) operator(()ident(errno) operator(!=) ident(EINTR)operator(\)\)) - preprocessor(#endif) - preprocessor(#ifdef) ident(OS_WIN32) - reserved(if) operator((()ident(errno) operator(!=) ident(WSAEINPROGRESS)operator(\)) operator(&&) operator(()ident(errno) operator(!=) ident(WSAEWOULDBLOCK)operator(\)\)) - preprocessor(#endif) - ident(Close)operator((\);) - operator(}) -operator(}) - - -comment(/**************************************** -ConnectionDescriptor::_ReportErrorStatus -****************************************/) - -pre_type(int) ident(ConnectionDescriptor)operator(::)ident(_ReportErrorStatus)operator((\)) -operator({) - pre_type(int) ident(error)operator(;) - ident(socklen_t) ident(len)operator(;) - ident(len) operator(=) reserved(sizeof)operator(()ident(error)operator(\);) - preprocessor(#ifdef) ident(OS_UNIX) - pre_type(int) ident(o) operator(=) ident(getsockopt) operator(()ident(GetSocket)operator((\),) ident(SOL_SOCKET)operator(,) ident(SO_ERROR)operator(,) operator(&)ident(error)operator(,) operator(&)ident(len)operator(\);) - preprocessor(#endif) - preprocessor(#ifdef) ident(OS_WIN32) - pre_type(int) ident(o) operator(=) ident(getsockopt) operator(()ident(GetSocket)operator((\),) ident(SOL_SOCKET)operator(,) ident(SO_ERROR)operator(,) operator(()pre_type(char)operator(*\)&)ident(error)operator(,) operator(&)ident(len)operator(\);) - preprocessor(#endif) - reserved(if) operator((()ident(o) operator(==) integer(0)operator(\)) operator(&&) operator(()ident(error) operator(==) integer(0)operator(\)\)) - reserved(return) integer(0)operator(;) - reserved(else) - reserved(return) integer(1)operator(;) -operator(}) - - -comment(/****************************** -ConnectionDescriptor::StartTls -******************************/) - -directive(void) ident(ConnectionDescriptor)operator(::)ident(StartTls)operator((\)) -operator({) - preprocessor(#ifdef) ident(WITH_SSL) - reserved(if) operator(()ident(SslBox)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - ident(SslBox) operator(=) reserved(new) ident(SslBox_t) operator(()ident(bIsServer)operator(,) ident(PrivateKeyFilename)operator(,) ident(CertChainFilename)operator(\);) - ident(_DispatchCiphertext)operator((\);) - preprocessor(#endif) - - preprocessor(#ifdef) ident(WITHOUT_SSL) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) -operator(}) - - -comment(/********************************* -ConnectionDescriptor::SetTlsParms -*********************************/) - -directive(void) ident(ConnectionDescriptor)operator(::)ident(SetTlsParms) operator(()directive(const) pre_type(char) operator(*)ident(privkey_filename)operator(,) directive(const) pre_type(char) operator(*)ident(certchain_filename)operator(\)) -operator({) - preprocessor(#ifdef) ident(WITH_SSL) - reserved(if) operator(()ident(SslBox)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - reserved(if) operator(()ident(privkey_filename) operator(&&) operator(*)ident(privkey_filename)operator(\)) - ident(PrivateKeyFilename) operator(=) ident(privkey_filename)operator(;) - reserved(if) operator(()ident(certchain_filename) operator(&&) operator(*)ident(certchain_filename)operator(\)) - ident(CertChainFilename) operator(=) ident(certchain_filename)operator(;) - preprocessor(#endif) - - preprocessor(#ifdef) ident(WITHOUT_SSL) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) -operator(}) - - - -comment(/***************************************** -ConnectionDescriptor::_DispatchCiphertext -*****************************************/) -preprocessor(#ifdef) ident(WITH_SSL) -directive(void) ident(ConnectionDescriptor)operator(::)ident(_DispatchCiphertext)operator((\)) -operator({) - ident(assert) operator(()ident(SslBox)operator(\);) - - - pre_type(char) ident(BigBuf) operator([)integer(2048)operator(];) - pre_type(bool) ident(did_work)operator(;) - - reserved(do) operator({) - ident(did_work) operator(=) pre_constant(false)operator(;) - - comment(// try to drain ciphertext) - reserved(while) operator(()ident(SslBox)operator(->)ident(CanGetCiphertext)operator((\)\)) operator({) - pre_type(int) ident(r) operator(=) ident(SslBox)operator(->)ident(GetCiphertext) operator(()ident(BigBuf)operator(,) reserved(sizeof)operator(()ident(BigBuf)operator(\)\);) - ident(assert) operator(()ident(r) operator(>) integer(0)operator(\);) - ident(_SendRawOutboundData) operator(()ident(BigBuf)operator(,) ident(r)operator(\);) - ident(did_work) operator(=) pre_constant(true)operator(;) - operator(}) - - comment(// Pump the SslBox, in case it has queued outgoing plaintext) - comment(// This will return >0 if data was written,) - comment(// 0 if no data was written, and <0 if there was a fatal error.) - pre_type(bool) ident(pump)operator(;) - reserved(do) operator({) - ident(pump) operator(=) pre_constant(false)operator(;) - pre_type(int) ident(w) operator(=) ident(SslBox)operator(->)ident(PutPlaintext) operator(()pre_constant(NULL)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(w) operator(>) integer(0)operator(\)) operator({) - ident(did_work) operator(=) pre_constant(true)operator(;) - ident(pump) operator(=) pre_constant(true)operator(;) - operator(}) - reserved(else) reserved(if) operator(()ident(w) operator(<) integer(0)operator(\)) - ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - operator(}) reserved(while) operator(()ident(pump)operator(\);) - - comment(// try to put plaintext. INCOMPLETE, doesn't belong here?) - comment(// In SendOutboundData, we're spooling plaintext directly) - comment(// into SslBox. That may be wrong, we may need to buffer it) - comment(// up here! ) - comment(/* - const char *ptr; - int ptr_length; - while (OutboundPlaintext.GetPage (&ptr, &ptr_length\)\) { - assert (ptr && (ptr_length > 0\)\); - int w = SslMachine.PutPlaintext (ptr, ptr_length\); - if (w > 0\) { - OutboundPlaintext.DiscardBytes (w\); - did_work = true; - } - else - break; - } - */) - - operator(}) reserved(while) operator(()ident(did_work)operator(\);) - -operator(}) -preprocessor(#endif) - - - -comment(/******************************* -ConnectionDescriptor::Heartbeat -*******************************/) - -directive(void) ident(ConnectionDescriptor)operator(::)ident(Heartbeat)operator((\)) -operator({) - comment(/* Only allow a certain amount of time to go by while waiting - * for a pending connect. If it expires, then kill the socket. - * For a connected socket, close it if its inactivity timer - * has expired. - */) - - reserved(if) operator(()ident(bConnectPending)operator(\)) operator({) - reserved(if) operator((()ident(gCurrentLoopTime) operator(-) ident(CreatedAt)operator(\)) operator(>=) ident(PendingConnectTimeout)operator(\)) - ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - comment(//bCloseNow = true;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(InactivityTimeout) operator(&&) operator((()ident(gCurrentLoopTime) operator(-) ident(LastIo)operator(\)) operator(>=) ident(InactivityTimeout)operator(\)\)) - ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - comment(//bCloseNow = true;) - operator(}) -operator(}) - - -comment(/**************************************** -LoopbreakDescriptor::LoopbreakDescriptor -****************************************/) - -ident(LoopbreakDescriptor)operator(::)ident(LoopbreakDescriptor) operator(()pre_type(int) ident(sd)operator(,) ident(EventMachine_t) operator(*)ident(parent_em)operator(\):) - ident(EventableDescriptor) operator(()ident(sd)operator(,) ident(parent_em)operator(\)) -operator({) - comment(/* This is really bad and ugly. Change someday if possible. - * We have to know about an event-machine (probably the one that owns us\), - * so we can pass newly-created connections to it. - */) - - ident(bCallbackUnbind) operator(=) pre_constant(false)operator(;) - - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) ident(EPOLLIN)operator(;) - preprocessor(#endif) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - ident(MyEventMachine)operator(->)ident(ArmKqueueReader) operator(()local_variable(this)operator(\);) - preprocessor(#endif) -operator(}) - - - - -comment(/************************* -LoopbreakDescriptor::Read -*************************/) - -directive(void) ident(LoopbreakDescriptor)operator(::)ident(Read)operator((\)) -operator({) - comment(// TODO, refactor, this code is probably in the wrong place.) - ident(assert) operator(()ident(MyEventMachine)operator(\);) - ident(MyEventMachine)operator(->)ident(_ReadLoopBreaker)operator((\);) -operator(}) - - -comment(/************************** -LoopbreakDescriptor::Write -**************************/) - -directive(void) ident(LoopbreakDescriptor)operator(::)ident(Write)operator((\)) -operator({) - comment(// Why are we here?) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) -operator(}) - -comment(/************************************** -AcceptorDescriptor::AcceptorDescriptor -**************************************/) - -ident(AcceptorDescriptor)operator(::)ident(AcceptorDescriptor) operator(()pre_type(int) ident(sd)operator(,) ident(EventMachine_t) operator(*)ident(parent_em)operator(\):) - ident(EventableDescriptor) operator(()ident(sd)operator(,) ident(parent_em)operator(\)) -operator({) - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) ident(EPOLLIN)operator(;) - preprocessor(#endif) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - ident(MyEventMachine)operator(->)ident(ArmKqueueReader) operator(()local_variable(this)operator(\);) - preprocessor(#endif) -operator(}) - - -comment(/*************************************** -AcceptorDescriptor::~AcceptorDescriptor -***************************************/) - -ident(AcceptorDescriptor)operator(::~)ident(AcceptorDescriptor)operator((\)) -operator({) -operator(}) - -comment(/**************************************** -STATIC: AcceptorDescriptor::StopAcceptor -****************************************/) - -directive(void) ident(AcceptorDescriptor)operator(::)ident(StopAcceptor) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(\)) -operator({) - comment(// TODO: This is something of a hack, or at least it's a static method of the wrong class.) - ident(AcceptorDescriptor) operator(*)ident(ad) operator(=) reserved(dynamic_cast) operator(<)ident(AcceptorDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(ad)operator(\)) - ident(ad)operator(->)ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - reserved(else) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) -operator(}) - - -comment(/************************ -AcceptorDescriptor::Read -************************/) - -directive(void) ident(AcceptorDescriptor)operator(::)ident(Read)operator((\)) -operator({) - comment(/* Accept up to a certain number of sockets on the listening connection. - * Don't try to accept all that are present, because this would allow a DoS attack - * in which no data were ever read or written. We should accept more than one, - * if available, to keep the partially accepted sockets from backing up in the kernel. - */) - - comment(/* Make sure we use non-blocking i/o on the acceptor socket, since we're selecting it - * for readability. According to Stevens UNP, it's possible for an acceptor to select readable - * and then block when we call accept. For example, the other end resets the connection after - * the socket selects readable and before we call accept. The kernel will remove the dead - * socket from the accept queue. If the accept queue is now empty, accept will block. - */) - - - reserved(struct) ident(sockaddr_in) ident(pin)operator(;) - ident(socklen_t) ident(addrlen) operator(=) reserved(sizeof) operator(()ident(pin)operator(\);) - - reserved(for) operator(()pre_type(int) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) integer(10)operator(;) ident(i)operator(++\)) operator({) - pre_type(int) ident(sd) operator(=) ident(accept) operator(()ident(GetSocket)operator((\),) operator(()reserved(struct) ident(sockaddr)operator(*\)&)ident(pin)operator(,) operator(&)ident(addrlen)operator(\);) - reserved(if) operator(()ident(sd) operator(==) ident(INVALID_SOCKET)operator(\)) operator({) - comment(// This breaks the loop when we've accepted everything on the kernel queue,) - comment(// up to 10 new connections. But what if the *first* accept fails?) - comment(// Does that mean anything serious is happening, beyond the situation) - comment(// described in the note above?) - reserved(break)operator(;) - operator(}) - - comment(// Set the newly-accepted socket non-blocking.) - comment(// On Windows, this may fail because, weirdly, Windows inherits the non-blocking) - comment(// attribute that we applied to the acceptor socket into the accepted one.) - reserved(if) operator((!)ident(SetSocketNonblocking) operator(()ident(sd)operator(\)\)) operator({) - comment(//int val = fcntl (sd, F_GETFL, 0\);) - comment(//if (fcntl (sd, F_SETFL, val | O_NONBLOCK\) == -1\) {) - ident(shutdown) operator(()ident(sd)operator(,) integer(1)operator(\);) - ident(closesocket) operator(()ident(sd)operator(\);) - reserved(continue)operator(;) - operator(}) - - - comment(// Disable slow-start (Nagle algorithm\). Eventually make this configurable.) - pre_type(int) ident(one) operator(=) integer(1)operator(;) - ident(setsockopt) operator(()ident(sd)operator(,) ident(IPPROTO_TCP)operator(,) ident(TCP_NODELAY)operator(,) operator(()pre_type(char)operator(*\)) operator(&)ident(one)operator(,) reserved(sizeof)operator(()ident(one)operator(\)\);) - - - ident(ConnectionDescriptor) operator(*)ident(cd) operator(=) reserved(new) ident(ConnectionDescriptor) operator(()ident(sd)operator(,) ident(MyEventMachine)operator(\);) - reserved(if) operator((!)ident(cd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(cd)operator(->)ident(SetServerMode)operator((\);) - reserved(if) operator(()ident(EventCallback)operator(\)) operator({) - operator((*)ident(EventCallback)operator(\)) operator(()ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(EM_CONNECTION_ACCEPTED)operator(,) ident(cd)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(cd)operator(->)ident(GetBinding)operator((\))operator(.)ident(size)operator((\)\);) - operator(}) - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(cd)operator(->)ident(GetEpollEvent)operator((\)->)ident(events) operator(=) ident(EPOLLIN) operator(|) operator(()ident(cd)operator(->)ident(SelectForWrite)operator((\)) operator(?) ident(EPOLLOUT) operator(:) integer(0)operator(\);) - preprocessor(#endif) - ident(assert) operator(()ident(MyEventMachine)operator(\);) - ident(MyEventMachine)operator(->)ident(Add) operator(()ident(cd)operator(\);) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - reserved(if) operator(()ident(cd)operator(->)ident(SelectForWrite)operator((\)\)) - ident(MyEventMachine)operator(->)ident(ArmKqueueWriter) operator(()ident(cd)operator(\);) - ident(MyEventMachine)operator(->)ident(ArmKqueueReader) operator(()ident(cd)operator(\);) - preprocessor(#endif) - operator(}) - -operator(}) - - -comment(/************************* -AcceptorDescriptor::Write -*************************/) - -directive(void) ident(AcceptorDescriptor)operator(::)ident(Write)operator((\)) -operator({) - comment(// Why are we here?) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) -operator(}) - - -comment(/***************************** -AcceptorDescriptor::Heartbeat -*****************************/) - -directive(void) ident(AcceptorDescriptor)operator(::)ident(Heartbeat)operator((\)) -operator({) - comment(// No-op) -operator(}) - - -comment(/******************************* -AcceptorDescriptor::GetSockname -*******************************/) - -pre_type(bool) ident(AcceptorDescriptor)operator(::)ident(GetSockname) operator(()reserved(struct) ident(sockaddr) operator(*)ident(s)operator(\)) -operator({) - pre_type(bool) ident(ok) operator(=) pre_constant(false)operator(;) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(socklen_t) ident(len) operator(=) reserved(sizeof)operator((*)ident(s)operator(\);) - pre_type(int) ident(gp) operator(=) ident(getsockname) operator(()ident(GetSocket)operator((\),) ident(s)operator(,) operator(&)ident(len)operator(\);) - reserved(if) operator(()ident(gp) operator(==) integer(0)operator(\)) - ident(ok) operator(=) pre_constant(true)operator(;) - operator(}) - reserved(return) ident(ok)operator(;) -operator(}) - - - -comment(/************************************** -DatagramDescriptor::DatagramDescriptor -**************************************/) - -ident(DatagramDescriptor)operator(::)ident(DatagramDescriptor) operator(()pre_type(int) ident(sd)operator(,) ident(EventMachine_t) operator(*)ident(parent_em)operator(\):) - ident(EventableDescriptor) operator(()ident(sd)operator(,) ident(parent_em)operator(\),) - ident(OutboundDataSize) operator(()integer(0)operator(\),) - ident(LastIo) operator(()ident(gCurrentLoopTime)operator(\),) - ident(InactivityTimeout) operator(()integer(0)operator(\)) -operator({) - ident(memset) operator((&)ident(ReturnAddress)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(ReturnAddress)operator(\)\);) - - comment(/* Provisionally added 19Oct07. All datagram sockets support broadcasting. - * Until now, sending to a broadcast address would give EACCES (permission denied\) - * on systems like Linux and BSD that require the SO_BROADCAST socket-option in order - * to accept a packet to a broadcast address. Solaris doesn't require it. I think - * Windows DOES require it but I'm not sure. - * - * Ruby does NOT do what we're doing here. In Ruby, you have to explicitly set SO_BROADCAST - * on a UDP socket in order to enable broadcasting. The reason for requiring the option - * in the first place is so that applications don't send broadcast datagrams by mistake. - * I imagine that could happen if a user of an application typed in an address that happened - * to be a broadcast address on that particular subnet. - * - * This is provisional because someone may eventually come up with a good reason not to - * do it for all UDP sockets. If that happens, then we'll need to add a usercode-level API - * to set the socket option, just like Ruby does. AND WE'LL ALSO BREAK CODE THAT DOESN'T - * EXPLICITLY SET THE OPTION. - */) - - pre_type(int) ident(oval) operator(=) integer(1)operator(;) - pre_type(int) ident(sob) operator(=) ident(setsockopt) operator(()ident(GetSocket)operator((\),) ident(SOL_SOCKET)operator(,) ident(SO_BROADCAST)operator(,) operator(()pre_type(char)operator(*\)&)ident(oval)operator(,) reserved(sizeof)operator(()ident(oval)operator(\)\);) - - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) ident(EPOLLIN)operator(;) - preprocessor(#endif) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - ident(MyEventMachine)operator(->)ident(ArmKqueueReader) operator(()local_variable(this)operator(\);) - preprocessor(#endif) -operator(}) - - -comment(/*************************************** -DatagramDescriptor::~DatagramDescriptor -***************************************/) - -ident(DatagramDescriptor)operator(::~)ident(DatagramDescriptor)operator((\)) -operator({) - comment(// Run down any stranded outbound data.) - reserved(for) operator(()ident(size_t) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(OutboundPages)operator(.)ident(size)operator((\);) ident(i)operator(++\)) - ident(OutboundPages)operator([)ident(i)operator(])operator(.)ident(Free)operator((\);) -operator(}) - - -comment(/***************************** -DatagramDescriptor::Heartbeat -*****************************/) - -directive(void) ident(DatagramDescriptor)operator(::)ident(Heartbeat)operator((\)) -operator({) - comment(// Close it if its inactivity timer has expired.) - - reserved(if) operator(()ident(InactivityTimeout) operator(&&) operator((()ident(gCurrentLoopTime) operator(-) ident(LastIo)operator(\)) operator(>=) ident(InactivityTimeout)operator(\)\)) - ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - comment(//bCloseNow = true;) -operator(}) - - -comment(/************************ -DatagramDescriptor::Read -************************/) - -directive(void) ident(DatagramDescriptor)operator(::)ident(Read)operator((\)) -operator({) - pre_type(int) ident(sd) operator(=) ident(GetSocket)operator((\);) - ident(assert) operator(()ident(sd) operator(!=) ident(INVALID_SOCKET)operator(\);) - ident(LastIo) operator(=) ident(gCurrentLoopTime)operator(;) - - comment(// This is an extremely large read buffer.) - comment(// In many cases you wouldn't expect to get any more than 4K.) - pre_type(char) ident(readbuffer) operator([)integer(16) operator(*) integer(1024)operator(];) - - reserved(for) operator(()pre_type(int) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) integer(10)operator(;) ident(i)operator(++\)) operator({) - comment(// Don't read just one buffer and then move on. This is faster) - comment(// if there is a lot of incoming.) - comment(// But don't read indefinitely. Give other sockets a chance to run.) - comment(// NOTICE, we're reading one less than the buffer size.) - comment(// That's so we can put a guard byte at the end of what we send) - comment(// to user code.) - - reserved(struct) ident(sockaddr_in) ident(sin)operator(;) - ident(socklen_t) ident(slen) operator(=) reserved(sizeof) operator(()ident(sin)operator(\);) - ident(memset) operator((&)ident(sin)operator(,) integer(0)operator(,) ident(slen)operator(\);) - - pre_type(int) ident(r) operator(=) ident(recvfrom) operator(()ident(sd)operator(,) ident(readbuffer)operator(,) reserved(sizeof)operator(()ident(readbuffer)operator(\)) operator(-) integer(1)operator(,) integer(0)operator(,) operator(()reserved(struct) ident(sockaddr)operator(*\)&)ident(sin)operator(,) operator(&)ident(slen)operator(\);) - comment(//cerr << "";) - - comment(// In UDP, a zero-length packet is perfectly legal.) - reserved(if) operator(()ident(r) operator(>=) integer(0)operator(\)) operator({) - ident(LastRead) operator(=) ident(gCurrentLoopTime)operator(;) - - comment(// Add a null-terminator at the the end of the buffer) - comment(// that we will send to the callback.) - comment(// DO NOT EVER CHANGE THIS. We want to explicitly allow users) - comment(// to be able to depend on this behavior, so they will have) - comment(// the option to do some things faster. Additionally it's) - comment(// a security guard against buffer overflows.) - ident(readbuffer) operator([)ident(r)operator(]) operator(=) integer(0)operator(;) - - - comment(// Set up a "temporary" return address so that callers can "reply" to us) - comment(// from within the callback we are about to invoke. That means that ordinary) - comment(// calls to "send_data_to_connection" (which is of course misnamed in this) - comment(// case\) will result in packets being sent back to the same place that sent) - comment(// us this one.) - comment(// There is a different call (evma_send_datagram\) for cases where the caller) - comment(// actually wants to send a packet somewhere else.) - - ident(memset) operator((&)ident(ReturnAddress)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(ReturnAddress)operator(\)\);) - ident(memcpy) operator((&)ident(ReturnAddress)operator(,) operator(&)ident(sin)operator(,) ident(slen)operator(\);) - - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)()ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(EM_CONNECTION_READ)operator(,) ident(readbuffer)operator(,) ident(r)operator(\);) - - operator(}) - reserved(else) operator({) - comment(// Basically a would-block, meaning we've read everything there is to read.) - reserved(break)operator(;) - operator(}) - - operator(}) - - -operator(}) - - -comment(/************************* -DatagramDescriptor::Write -*************************/) - -directive(void) ident(DatagramDescriptor)operator(::)ident(Write)operator((\)) -operator({) - comment(/* It's possible for a socket to select writable and then no longer - * be writable by the time we get around to writing. The kernel might - * have used up its available output buffers between the select call - * and when we get here. So this condition is not an error. - * This code is very reminiscent of ConnectionDescriptor::_WriteOutboundData, - * but differs in the that the outbound data pages (received from the - * user\) are _message-structured._ That is, we send each of them out - * one message at a time. - * TODO, we are currently suppressing the EMSGSIZE error!!! - */) - - pre_type(int) ident(sd) operator(=) ident(GetSocket)operator((\);) - ident(assert) operator(()ident(sd) operator(!=) ident(INVALID_SOCKET)operator(\);) - ident(LastIo) operator(=) ident(gCurrentLoopTime)operator(;) - - ident(assert) operator(()ident(OutboundPages)operator(.)ident(size)operator((\)) operator(>) integer(0)operator(\);) - - comment(// Send out up to 10 packets, then cycle the machine.) - reserved(for) operator(()pre_type(int) ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) integer(10)operator(;) ident(i)operator(++\)) operator({) - reserved(if) operator(()ident(OutboundPages)operator(.)ident(size)operator((\)) operator(<=) integer(0)operator(\)) - reserved(break)operator(;) - ident(OutboundPage) operator(*)ident(op) operator(=) operator(&()ident(OutboundPages)operator([)integer(0)operator(]\);) - - comment(// The nasty cast to (char*\) is needed because Windows is brain-dead.) - pre_type(int) ident(s) operator(=) ident(sendto) operator(()ident(sd)operator(,) operator(()pre_type(char)operator(*\))ident(op)operator(->)ident(Buffer)operator(,) ident(op)operator(->)ident(Length)operator(,) integer(0)operator(,) operator(()reserved(struct) ident(sockaddr)operator(*\)&()ident(op)operator(->)ident(From)operator(\),) reserved(sizeof)operator(()ident(op)operator(->)ident(From)operator(\)\);) - pre_type(int) ident(e) operator(=) ident(errno)operator(;) - - ident(OutboundDataSize) operator(-=) ident(op)operator(->)ident(Length)operator(;) - ident(op)operator(->)ident(Free)operator((\);) - ident(OutboundPages)operator(.)ident(pop_front)operator((\);) - - reserved(if) operator(()ident(s) operator(==) ident(SOCKET_ERROR)operator(\)) operator({) - preprocessor(#ifdef) ident(OS_UNIX) - reserved(if) operator((()ident(e) operator(!=) ident(EINPROGRESS)operator(\)) operator(&&) operator(()ident(e) operator(!=) ident(EWOULDBLOCK)operator(\)) operator(&&) operator(()ident(e) operator(!=) ident(EINTR)operator(\)\)) operator({) - preprocessor(#endif) - preprocessor(#ifdef) ident(OS_WIN32) - reserved(if) operator((()ident(e) operator(!=) ident(WSAEINPROGRESS)operator(\)) operator(&&) operator(()ident(e) operator(!=) ident(WSAEWOULDBLOCK)operator(\)\)) operator({) - preprocessor(#endif) - ident(Close)operator((\);) - reserved(break)operator(;) - operator(}) - operator(}) - operator(}) - - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) operator(()ident(EPOLLIN) operator(|) operator(()ident(SelectForWrite)operator((\)) operator(?) ident(EPOLLOUT) operator(:) integer(0)operator(\)\);) - ident(assert) operator(()ident(MyEventMachine)operator(\);) - ident(MyEventMachine)operator(->)ident(Modify) operator(()local_variable(this)operator(\);) - preprocessor(#endif) -operator(}) - - -comment(/********************************** -DatagramDescriptor::SelectForWrite -**********************************/) - -pre_type(bool) ident(DatagramDescriptor)operator(::)ident(SelectForWrite)operator((\)) -operator({) - comment(/* Changed 15Nov07, per bug report by Mark Zvillius. - * The outbound data size will be zero if there are zero-length outbound packets, - * so we now select writable in case the outbound page buffer is not empty. - * Note that the superclass ShouldDelete method still checks for outbound data size, - * which may be wrong. - */) - comment(//return (GetOutboundDataSize(\) > 0\); (Original\)) - reserved(return) operator(()ident(OutboundPages)operator(.)ident(size)operator((\)) operator(>) integer(0)operator(\);) -operator(}) - - -comment(/************************************ -DatagramDescriptor::SendOutboundData -************************************/) - -pre_type(int) ident(DatagramDescriptor)operator(::)ident(SendOutboundData) operator(()directive(const) pre_type(char) operator(*)ident(data)operator(,) pre_type(int) ident(length)operator(\)) -operator({) - comment(// This is an exact clone of ConnectionDescriptor::SendOutboundData.) - comment(// That means it needs to move to a common ancestor.) - - reserved(if) operator(()ident(IsCloseScheduled)operator((\)\)) - comment(//if (bCloseNow || bCloseAfterWriting\)) - reserved(return) integer(0)operator(;) - - reserved(if) operator((!)ident(data) operator(&&) operator(()ident(length) operator(>) integer(0)operator(\)\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - pre_type(char) operator(*)ident(buffer) operator(=) operator(()pre_type(char) operator(*\)) ident(malloc) operator(()ident(length) operator(+) integer(1)operator(\);) - reserved(if) operator((!)ident(buffer)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(memcpy) operator(()ident(buffer)operator(,) ident(data)operator(,) ident(length)operator(\);) - ident(buffer) operator([)ident(length)operator(]) operator(=) integer(0)operator(;) - ident(OutboundPages)operator(.)ident(push_back) operator(()ident(OutboundPage) operator(()ident(buffer)operator(,) ident(length)operator(,) ident(ReturnAddress)operator(\)\);) - ident(OutboundDataSize) operator(+=) ident(length)operator(;) - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) operator(()ident(EPOLLIN) operator(|) ident(EPOLLOUT)operator(\);) - ident(assert) operator(()ident(MyEventMachine)operator(\);) - ident(MyEventMachine)operator(->)ident(Modify) operator(()local_variable(this)operator(\);) - preprocessor(#endif) - reserved(return) ident(length)operator(;) -operator(}) - - -comment(/**************************************** -DatagramDescriptor::SendOutboundDatagram -****************************************/) - -pre_type(int) ident(DatagramDescriptor)operator(::)ident(SendOutboundDatagram) operator(()directive(const) pre_type(char) operator(*)ident(data)operator(,) pre_type(int) ident(length)operator(,) directive(const) pre_type(char) operator(*)ident(address)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - comment(// This is an exact clone of ConnectionDescriptor::SendOutboundData.) - comment(// That means it needs to move to a common ancestor.) - comment(// TODO: Refactor this so there's no overlap with SendOutboundData.) - - reserved(if) operator(()ident(IsCloseScheduled)operator((\)\)) - comment(//if (bCloseNow || bCloseAfterWriting\)) - reserved(return) integer(0)operator(;) - - reserved(if) operator((!)ident(address) operator(||) operator(!*)ident(address) operator(||) operator(!)ident(port)operator(\)) - reserved(return) integer(0)operator(;) - - ident(sockaddr_in) ident(pin)operator(;) - pre_type(unsigned) pre_type(long) ident(HostAddr)operator(;) - - ident(HostAddr) operator(=) ident(inet_addr) operator(()ident(address)operator(\);) - reserved(if) operator(()ident(HostAddr) operator(==) ident(INADDR_NONE)operator(\)) operator({) - comment(// The nasty cast to (char*\) is because Windows is brain-dead.) - ident(hostent) operator(*)ident(hp) operator(=) ident(gethostbyname) operator((()pre_type(char)operator(*\))ident(address)operator(\);) - reserved(if) operator((!)ident(hp)operator(\)) - reserved(return) integer(0)operator(;) - ident(HostAddr) operator(=) operator((()ident(in_addr)operator(*\)()ident(hp)operator(->)ident(h_addr)operator(\)\)->)ident(s_addr)operator(;) - operator(}) - - ident(memset) operator((&)ident(pin)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(pin)operator(\)\);) - ident(pin)operator(.)ident(sin_family) operator(=) ident(AF_INET)operator(;) - ident(pin)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(=) ident(HostAddr)operator(;) - ident(pin)operator(.)ident(sin_port) operator(=) ident(htons) operator(()ident(port)operator(\);) - - - - reserved(if) operator((!)ident(data) operator(&&) operator(()ident(length) operator(>) integer(0)operator(\)\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - pre_type(char) operator(*)ident(buffer) operator(=) operator(()pre_type(char) operator(*\)) ident(malloc) operator(()ident(length) operator(+) integer(1)operator(\);) - reserved(if) operator((!)ident(buffer)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(memcpy) operator(()ident(buffer)operator(,) ident(data)operator(,) ident(length)operator(\);) - ident(buffer) operator([)ident(length)operator(]) operator(=) integer(0)operator(;) - ident(OutboundPages)operator(.)ident(push_back) operator(()ident(OutboundPage) operator(()ident(buffer)operator(,) ident(length)operator(,) ident(pin)operator(\)\);) - ident(OutboundDataSize) operator(+=) ident(length)operator(;) - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) operator(()ident(EPOLLIN) operator(|) ident(EPOLLOUT)operator(\);) - ident(assert) operator(()ident(MyEventMachine)operator(\);) - ident(MyEventMachine)operator(->)ident(Modify) operator(()local_variable(this)operator(\);) - preprocessor(#endif) - reserved(return) ident(length)operator(;) -operator(}) - - -comment(/**************************************** -STATIC: DatagramDescriptor::SendDatagram -****************************************/) - -pre_type(int) ident(DatagramDescriptor)operator(::)ident(SendDatagram) operator(()directive(const) pre_type(char) operator(*)ident(binding)operator(,) directive(const) pre_type(char) operator(*)ident(data)operator(,) pre_type(int) ident(length)operator(,) directive(const) pre_type(char) operator(*)ident(address)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - ident(DatagramDescriptor) operator(*)ident(dd) operator(=) reserved(dynamic_cast) operator(<)ident(DatagramDescriptor)operator(*>) operator(()ident(Bindable_t)operator(::)ident(GetObject) operator(()ident(binding)operator(\)\);) - reserved(if) operator(()ident(dd)operator(\)) - reserved(return) ident(dd)operator(->)ident(SendOutboundDatagram) operator(()ident(data)operator(,) ident(length)operator(,) ident(address)operator(,) ident(port)operator(\);) - reserved(else) - reserved(return) operator(-)integer(1)operator(;) -operator(}) - - -comment(/********************************* -ConnectionDescriptor::GetPeername -*********************************/) - -pre_type(bool) ident(ConnectionDescriptor)operator(::)ident(GetPeername) operator(()reserved(struct) ident(sockaddr) operator(*)ident(s)operator(\)) -operator({) - pre_type(bool) ident(ok) operator(=) pre_constant(false)operator(;) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(socklen_t) ident(len) operator(=) reserved(sizeof)operator((*)ident(s)operator(\);) - pre_type(int) ident(gp) operator(=) ident(getpeername) operator(()ident(GetSocket)operator((\),) ident(s)operator(,) operator(&)ident(len)operator(\);) - reserved(if) operator(()ident(gp) operator(==) integer(0)operator(\)) - ident(ok) operator(=) pre_constant(true)operator(;) - operator(}) - reserved(return) ident(ok)operator(;) -operator(}) - -comment(/********************************* -ConnectionDescriptor::GetSockname -*********************************/) - -pre_type(bool) ident(ConnectionDescriptor)operator(::)ident(GetSockname) operator(()reserved(struct) ident(sockaddr) operator(*)ident(s)operator(\)) -operator({) - pre_type(bool) ident(ok) operator(=) pre_constant(false)operator(;) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(socklen_t) ident(len) operator(=) reserved(sizeof)operator((*)ident(s)operator(\);) - pre_type(int) ident(gp) operator(=) ident(getsockname) operator(()ident(GetSocket)operator((\),) ident(s)operator(,) operator(&)ident(len)operator(\);) - reserved(if) operator(()ident(gp) operator(==) integer(0)operator(\)) - ident(ok) operator(=) pre_constant(true)operator(;) - operator(}) - reserved(return) ident(ok)operator(;) -operator(}) - - -comment(/********************************************** -ConnectionDescriptor::GetCommInactivityTimeout -**********************************************/) - -pre_type(int) ident(ConnectionDescriptor)operator(::)ident(GetCommInactivityTimeout) operator(()pre_type(int) operator(*)ident(value)operator(\)) -operator({) - reserved(if) operator(()ident(value)operator(\)) operator({) - operator(*)ident(value) operator(=) ident(InactivityTimeout)operator(;) - reserved(return) integer(1)operator(;) - operator(}) - reserved(else) operator({) - comment(// TODO, extended logging, got bad parameter.) - reserved(return) integer(0)operator(;) - operator(}) -operator(}) - - -comment(/********************************************** -ConnectionDescriptor::SetCommInactivityTimeout -**********************************************/) - -pre_type(int) ident(ConnectionDescriptor)operator(::)ident(SetCommInactivityTimeout) operator(()pre_type(int) operator(*)ident(value)operator(\)) -operator({) - pre_type(int) ident(out) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(value)operator(\)) operator({) - reserved(if) operator(((*)ident(value)operator(==)integer(0)operator(\)) operator(||) operator((*)ident(value) operator(>=) integer(2)operator(\)\)) operator({) - comment(// Replace the value and send the old one back to the caller.) - pre_type(int) ident(v) operator(=) operator(*)ident(value)operator(;) - operator(*)ident(value) operator(=) ident(InactivityTimeout)operator(;) - ident(InactivityTimeout) operator(=) ident(v)operator(;) - ident(out) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) - comment(// TODO, extended logging, got bad value.) - operator(}) - operator(}) - reserved(else) operator({) - comment(// TODO, extended logging, got bad parameter.) - operator(}) - - reserved(return) ident(out)operator(;) -operator(}) - -comment(/******************************* -DatagramDescriptor::GetPeername -*******************************/) - -pre_type(bool) ident(DatagramDescriptor)operator(::)ident(GetPeername) operator(()reserved(struct) ident(sockaddr) operator(*)ident(s)operator(\)) -operator({) - pre_type(bool) ident(ok) operator(=) pre_constant(false)operator(;) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(memset) operator(()ident(s)operator(,) integer(0)operator(,) reserved(sizeof)operator(()reserved(struct) ident(sockaddr)operator(\)\);) - ident(memcpy) operator(()ident(s)operator(,) operator(&)ident(ReturnAddress)operator(,) reserved(sizeof)operator(()ident(ReturnAddress)operator(\)\);) - ident(ok) operator(=) pre_constant(true)operator(;) - operator(}) - reserved(return) ident(ok)operator(;) -operator(}) - -comment(/******************************* -DatagramDescriptor::GetSockname -*******************************/) - -pre_type(bool) ident(DatagramDescriptor)operator(::)ident(GetSockname) operator(()reserved(struct) ident(sockaddr) operator(*)ident(s)operator(\)) -operator({) - pre_type(bool) ident(ok) operator(=) pre_constant(false)operator(;) - reserved(if) operator(()ident(s)operator(\)) operator({) - ident(socklen_t) ident(len) operator(=) reserved(sizeof)operator((*)ident(s)operator(\);) - pre_type(int) ident(gp) operator(=) ident(getsockname) operator(()ident(GetSocket)operator((\),) ident(s)operator(,) operator(&)ident(len)operator(\);) - reserved(if) operator(()ident(gp) operator(==) integer(0)operator(\)) - ident(ok) operator(=) pre_constant(true)operator(;) - operator(}) - reserved(return) ident(ok)operator(;) -operator(}) - - - -comment(/******************************************** -DatagramDescriptor::GetCommInactivityTimeout -********************************************/) - -pre_type(int) ident(DatagramDescriptor)operator(::)ident(GetCommInactivityTimeout) operator(()pre_type(int) operator(*)ident(value)operator(\)) -operator({) - reserved(if) operator(()ident(value)operator(\)) operator({) - operator(*)ident(value) operator(=) ident(InactivityTimeout)operator(;) - reserved(return) integer(1)operator(;) - operator(}) - reserved(else) operator({) - comment(// TODO, extended logging, got bad parameter.) - reserved(return) integer(0)operator(;) - operator(}) -operator(}) - -comment(/******************************************** -DatagramDescriptor::SetCommInactivityTimeout -********************************************/) - -pre_type(int) ident(DatagramDescriptor)operator(::)ident(SetCommInactivityTimeout) operator(()pre_type(int) operator(*)ident(value)operator(\)) -operator({) - pre_type(int) ident(out) operator(=) integer(0)operator(;) - - reserved(if) operator(()ident(value)operator(\)) operator({) - reserved(if) operator(((*)ident(value)operator(==)integer(0)operator(\)) operator(||) operator((*)ident(value) operator(>=) integer(2)operator(\)\)) operator({) - comment(// Replace the value and send the old one back to the caller.) - pre_type(int) ident(v) operator(=) operator(*)ident(value)operator(;) - operator(*)ident(value) operator(=) ident(InactivityTimeout)operator(;) - ident(InactivityTimeout) operator(=) ident(v)operator(;) - ident(out) operator(=) integer(1)operator(;) - operator(}) - reserved(else) operator({) - comment(// TODO, extended logging, got bad value.) - operator(}) - operator(}) - reserved(else) operator({) - comment(// TODO, extended logging, got bad parameter.) - operator(}) - - reserved(return) ident(out)operator(;) -operator(}) - -comment(/***************************************************************************** - -$Id$ - -File: em.cpp -Date: 06Apr06 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - -comment(// THIS ENTIRE FILE WILL EVENTUALLY BE FOR UNIX BUILDS ONLY.) -comment(//#ifdef OS_UNIX) - - -preprocessor(#include) include("project.h") - -comment(// Keep a global variable floating around) -comment(// with the current loop time as set by the Event Machine.) -comment(// This avoids the need for frequent expensive calls to time(NULL\);) -ident(time_t) ident(gCurrentLoopTime)operator(;) - -preprocessor(#ifdef) ident(OS_WIN32) -pre_type(unsigned) ident(gTickCountTickover)operator(;) -pre_type(unsigned) ident(gLastTickCount)operator(;) -preprocessor(#endif) - - -comment(/* The numer of max outstanding timers was once a const enum defined in em.h. - * Now we define it here so that users can change its value if necessary. - */) -directive(static) pre_type(int) ident(MaxOutstandingTimers) operator(=) integer(1000)operator(;) - - -comment(/* Internal helper to convert strings to internet addresses. IPv6-aware. - * Not reentrant or threadsafe, optimized for speed. - */) -directive(static) reserved(struct) ident(sockaddr) operator(*)ident(name2address) operator(()directive(const) pre_type(char) operator(*)ident(server)operator(,) pre_type(int) ident(port)operator(,) pre_type(int) operator(*)ident(family)operator(,) pre_type(int) operator(*)ident(bind_size)operator(\);) - - -comment(/*************************************** -STATIC EventMachine_t::SetMaxTimerCount -***************************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(SetMaxTimerCount) operator(()pre_type(int) ident(count)operator(\)) -operator({) - comment(/* Allow a user to increase the maximum number of outstanding timers. - * If this gets "too high" (a metric that is of course platform dependent\), - * bad things will happen like performance problems and possible overuse - * of memory. - * The actual timer mechanism is very efficient so it's hard to know what - * the practical max, but 100,000 shouldn't be too problematical. - */) - reserved(if) operator(()ident(count) operator(<) integer(100)operator(\)) - ident(count) operator(=) integer(100)operator(;) - ident(MaxOutstandingTimers) operator(=) ident(count)operator(;) -operator(}) - - - -comment(/****************************** -EventMachine_t::EventMachine_t -******************************/) - -ident(EventMachine_t)operator(::)ident(EventMachine_t) operator(()directive(void) operator((*)ident(event_callback)operator(\)()directive(const) pre_type(char)operator(*,) pre_type(int)operator(,) directive(const) pre_type(char)operator(*,) pre_type(int)operator(\)\):) - ident(EventCallback) operator(()ident(event_callback)operator(\),) - ident(NextHeartbeatTime) operator(()integer(0)operator(\),) - ident(LoopBreakerReader) operator((-)integer(1)operator(\),) - ident(LoopBreakerWriter) operator((-)integer(1)operator(\),) - ident(bEpoll) operator(()pre_constant(false)operator(\),) - ident(bKqueue) operator(()pre_constant(false)operator(\),) - ident(epfd) operator((-)integer(1)operator(\)) -operator({) - comment(// Default time-slice is just smaller than one hundred mills.) - ident(Quantum)operator(.)ident(tv_sec) operator(=) integer(0)operator(;) - ident(Quantum)operator(.)ident(tv_usec) operator(=) integer(90000)operator(;) - - ident(gTerminateSignalReceived) operator(=) pre_constant(false)operator(;) - comment(// Make sure the current loop time is sane, in case we do any initializations of) - comment(// objects before we start running.) - ident(gCurrentLoopTime) operator(=) ident(time)operator(()pre_constant(NULL)operator(\);) - - comment(/* We initialize the network library here (only on Windows of course\) - * and initialize "loop breakers." Our destructor also does some network-level - * cleanup. There's thus an implicit assumption that any given instance of EventMachine_t - * will only call ::Run once. Is that a good assumption? Should we move some of these - * inits and de-inits into ::Run? - */) - preprocessor(#ifdef) ident(OS_WIN32) - ident(WSADATA) ident(w)operator(;) - ident(WSAStartup) operator(()ident(MAKEWORD) operator(()integer(1)operator(,) integer(1)operator(\),) operator(&)ident(w)operator(\);) - preprocessor(#endif) - - ident(_InitializeLoopBreaker)operator((\);) -operator(}) - - -comment(/******************************* -EventMachine_t::~EventMachine_t -*******************************/) - -ident(EventMachine_t)operator(::~)ident(EventMachine_t)operator((\)) -operator({) - comment(// Run down descriptors) - ident(size_t) ident(i)operator(;) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(NewDescriptors)operator(.)ident(size)operator((\);) ident(i)operator(++\)) - reserved(delete) ident(NewDescriptors)operator([)ident(i)operator(];) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(Descriptors)operator(.)ident(size)operator((\);) ident(i)operator(++\)) - reserved(delete) ident(Descriptors)operator([)ident(i)operator(];) - - ident(close) operator(()ident(LoopBreakerReader)operator(\);) - ident(close) operator(()ident(LoopBreakerWriter)operator(\);) - - reserved(if) operator(()ident(epfd) operator(!=) operator(-)integer(1)operator(\)) - ident(close) operator(()ident(epfd)operator(\);) - reserved(if) operator(()ident(kqfd) operator(!=) operator(-)integer(1)operator(\)) - ident(close) operator(()ident(kqfd)operator(\);) -operator(}) - - -comment(/************************* -EventMachine_t::_UseEpoll -*************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(_UseEpoll)operator((\)) -operator({) - comment(/* Temporary. - * Use an internal flag to switch in epoll-based functionality until we determine - * how it should be integrated properly and the extent of the required changes. - * A permanent solution needs to allow the integration of additional technologies, - * like kqueue and Solaris's events. - */) - - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(bEpoll) operator(=) pre_constant(true)operator(;) - preprocessor(#endif) -operator(}) - -comment(/************************** -EventMachine_t::_UseKqueue -**************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(_UseKqueue)operator((\)) -operator({) - comment(/* Temporary. - * See comments under _UseEpoll. - */) - - preprocessor(#ifdef) ident(HAVE_KQUEUE) - ident(bKqueue) operator(=) pre_constant(true)operator(;) - preprocessor(#endif) -operator(}) - - -comment(/**************************** -EventMachine_t::ScheduleHalt -****************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(ScheduleHalt)operator((\)) -operator({) - comment(/* This is how we stop the machine. - * This can be called by clients. Signal handlers will probably - * set the global flag. - * For now this means there can only be one EventMachine ever running at a time. - * - * IMPORTANT: keep this light, fast, and async-safe. Don't do anything frisky in here, - * because it may be called from signal handlers invoked from code that we don't - * control. At this writing (20Sep06\), EM does NOT install any signal handlers of - * its own. - * - * We need a FAQ. And one of the questions is: how do I stop EM when Ctrl-C happens? - * The answer is to call evma_stop_machine, which calls here, from a SIGINT handler. - */) - ident(gTerminateSignalReceived) operator(=) pre_constant(true)operator(;) -operator(}) - - - -comment(/******************************* -EventMachine_t::SetTimerQuantum -*******************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(SetTimerQuantum) operator(()pre_type(int) ident(interval)operator(\)) -operator({) - comment(/* We get a timer-quantum expressed in milliseconds. - * Don't set a quantum smaller than 5 or larger than 2500. - */) - - reserved(if) operator((()ident(interval) operator(<) integer(5)operator(\)) operator(||) operator(()ident(interval) operator(>) integer(2500)operator(\)\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - ident(Quantum)operator(.)ident(tv_sec) operator(=) ident(interval) operator(/) integer(1000)operator(;) - ident(Quantum)operator(.)ident(tv_usec) operator(=) operator(()ident(interval) operator(%) integer(1000)operator(\)) operator(*) integer(1000)operator(;) -operator(}) - - -comment(/************************************* -(STATIC\) EventMachine_t::SetuidString -*************************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(SetuidString) operator(()directive(const) pre_type(char) operator(*)ident(username)operator(\)) -operator({) - comment(/* This method takes a caller-supplied username and tries to setuid - * to that user. There is no meaningful implementation (and no error\) - * on Windows. On Unix, a failure to setuid the caller-supplied string - * causes a fatal abort, because presumably the program is calling here - * in order to fulfill a security requirement. If we fail silently, - * the user may continue to run with too much privilege. - * - * TODO, we need to decide on and document a way of generating C++ level errors - * that can be wrapped in documented Ruby exceptions, so users can catch - * and handle them. And distinguish it from errors that we WON'T let the Ruby - * user catch (like security-violations and resource-overallocation\). - * A setuid failure here would be in the latter category. - */) - - preprocessor(#ifdef) ident(OS_UNIX) - reserved(if) operator((!)ident(username) operator(||) operator(!*)ident(username)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - reserved(struct) ident(passwd) operator(*)ident(p) operator(=) ident(getpwnam) operator(()ident(username)operator(\);) - reserved(if) operator((!)ident(p)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - reserved(if) operator(()ident(setuid) operator(()ident(p)operator(->)ident(pw_uid)operator(\)) operator(!=) integer(0)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - comment(// Success.) - preprocessor(#endif) -operator(}) - - -comment(/**************************************** -(STATIC\) EventMachine_t::SetRlimitNofile -****************************************/) - -pre_type(int) ident(EventMachine_t)operator(::)ident(SetRlimitNofile) operator(()pre_type(int) ident(nofiles)operator(\)) -operator({) - preprocessor(#ifdef) ident(OS_UNIX) - reserved(struct) ident(rlimit) ident(rlim)operator(;) - ident(getrlimit) operator(()ident(RLIMIT_NOFILE)operator(,) operator(&)ident(rlim)operator(\);) - reserved(if) operator(()ident(nofiles) operator(>=) integer(0)operator(\)) operator({) - ident(rlim)operator(.)ident(rlim_cur) operator(=) ident(nofiles)operator(;) - reserved(if) operator(()ident(nofiles) operator(>) ident(rlim)operator(.)ident(rlim_max)operator(\)) - ident(rlim)operator(.)ident(rlim_max) operator(=) ident(nofiles)operator(;) - ident(setrlimit) operator(()ident(RLIMIT_NOFILE)operator(,) operator(&)ident(rlim)operator(\);) - comment(// ignore the error return, for now at least.) - comment(// TODO, emit an error message someday when we have proper debug levels.) - operator(}) - ident(getrlimit) operator(()ident(RLIMIT_NOFILE)operator(,) operator(&)ident(rlim)operator(\);) - reserved(return) ident(rlim)operator(.)ident(rlim_cur)operator(;) - preprocessor(#endif) - - preprocessor(#ifdef) ident(OS_WIN32) - comment(// No meaningful implementation on Windows.) - reserved(return) integer(0)operator(;) - preprocessor(#endif) -operator(}) - - -comment(/********************************* -EventMachine_t::SignalLoopBreaker -*********************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(SignalLoopBreaker)operator((\)) -operator({) - preprocessor(#ifdef) ident(OS_UNIX) - ident(write) operator(()ident(LoopBreakerWriter)operator(,) stringoperator(,) integer(1)operator(\);) - preprocessor(#endif) - preprocessor(#ifdef) ident(OS_WIN32) - ident(sendto) operator(()ident(LoopBreakerReader)operator(,) stringoperator(,) integer(0)operator(,) integer(0)operator(,) operator(()reserved(struct) ident(sockaddr)operator(*\)&()ident(LoopBreakerTarget)operator(\),) reserved(sizeof)operator(()ident(LoopBreakerTarget)operator(\)\);) - preprocessor(#endif) -operator(}) - - -comment(/************************************** -EventMachine_t::_InitializeLoopBreaker -**************************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(_InitializeLoopBreaker)operator((\)) -operator({) - comment(/* A "loop-breaker" is a socket-descriptor that we can write to in order - * to break the main select loop. Primarily useful for things running on - * threads other than the main EM thread, so they can trigger processing - * of events that arise exogenously to the EM. - * Keep the loop-breaker pipe out of the main descriptor set, otherwise - * its events will get passed on to user code. - */) - - preprocessor(#ifdef) ident(OS_UNIX) - pre_type(int) ident(fd)operator([)integer(2)operator(];) - reserved(if) operator(()ident(pipe) operator(()ident(fd)operator(\)\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - ident(LoopBreakerWriter) operator(=) ident(fd)operator([)integer(1)operator(];) - ident(LoopBreakerReader) operator(=) ident(fd)operator([)integer(0)operator(];) - preprocessor(#endif) - - preprocessor(#ifdef) ident(OS_WIN32) - pre_type(int) ident(sd) operator(=) ident(socket) operator(()ident(AF_INET)operator(,) ident(SOCK_DGRAM)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(sd) operator(==) ident(INVALID_SOCKET)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(SetSocketNonblocking) operator(()ident(sd)operator(\);) - - ident(memset) operator((&)ident(LoopBreakerTarget)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(LoopBreakerTarget)operator(\)\);) - ident(LoopBreakerTarget)operator(.)ident(sin_family) operator(=) ident(AF_INET)operator(;) - ident(LoopBreakerTarget)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(=) ident(inet_addr) operator(()stringoperator(\);) - - ident(srand) operator((()pre_type(int)operator(\))ident(time)operator(()pre_constant(NULL)operator(\)\);) - pre_type(int) ident(i)operator(;) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) integer(100)operator(;) ident(i)operator(++\)) operator({) - pre_type(int) ident(r) operator(=) operator(()ident(rand)operator((\)) operator(%) integer(10000)operator(\)) operator(+) integer(20000)operator(;) - ident(LoopBreakerTarget)operator(.)ident(sin_port) operator(=) ident(htons) operator(()ident(r)operator(\);) - reserved(if) operator(()ident(bind) operator(()ident(sd)operator(,) operator(()reserved(struct) ident(sockaddr)operator(*\)&)ident(LoopBreakerTarget)operator(,) reserved(sizeof)operator(()ident(LoopBreakerTarget)operator(\)\)) operator(==) integer(0)operator(\)) - reserved(break)operator(;) - operator(}) - - reserved(if) operator(()ident(i) operator(==) integer(100)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(LoopBreakerReader) operator(=) ident(sd)operator(;) - preprocessor(#endif) -operator(}) - - -comment(/******************* -EventMachine_t::Run -*******************/) - -directive(void) ident(EventMachine_t)operator(::)ident(Run)operator((\)) -operator({) - preprocessor(#ifdef) ident(OS_WIN32) - ident(HookControlC) operator(()pre_constant(true)operator(\);) - preprocessor(#endif) - - preprocessor(#ifdef) ident(HAVE_EPOLL) - reserved(if) operator(()ident(bEpoll)operator(\)) operator({) - ident(epfd) operator(=) ident(epoll_create) operator(()ident(MaxEpollDescriptors)operator(\);) - reserved(if) operator(()ident(epfd) operator(==) operator(-)integer(1)operator(\)) operator({) - pre_type(char) ident(buf)operator([)integer(200)operator(];) - ident(snprintf) operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\)-)integer(1)operator(,) stringoperator(,) ident(strerror)operator(()ident(errno)operator(\)\);) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()ident(buf)operator(\);) - operator(}) - pre_type(int) ident(cloexec) operator(=) ident(fcntl) operator(()ident(epfd)operator(,) ident(F_GETFD)operator(,) integer(0)operator(\);) - ident(assert) operator(()ident(cloexec) operator(>=) integer(0)operator(\);) - ident(cloexec) operator(|=) ident(FD_CLOEXEC)operator(;) - ident(fcntl) operator(()ident(epfd)operator(,) ident(F_SETFD)operator(,) ident(cloexec)operator(\);) - - ident(assert) operator(()ident(LoopBreakerReader) operator(>=) integer(0)operator(\);) - ident(LoopbreakDescriptor) operator(*)ident(ld) operator(=) reserved(new) ident(LoopbreakDescriptor) operator(()ident(LoopBreakerReader)operator(,) local_variable(this)operator(\);) - ident(assert) operator(()ident(ld)operator(\);) - ident(Add) operator(()ident(ld)operator(\);) - operator(}) - preprocessor(#endif) - - preprocessor(#ifdef) ident(HAVE_KQUEUE) - reserved(if) operator(()ident(bKqueue)operator(\)) operator({) - ident(kqfd) operator(=) ident(kqueue)operator((\);) - reserved(if) operator(()ident(kqfd) operator(==) operator(-)integer(1)operator(\)) operator({) - pre_type(char) ident(buf)operator([)integer(200)operator(];) - ident(snprintf) operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\)-)integer(1)operator(,) stringoperator(,) ident(strerror)operator(()ident(errno)operator(\)\);) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()ident(buf)operator(\);) - operator(}) - comment(// cloexec not needed. By definition, kqueues are not carried across forks.) - - ident(assert) operator(()ident(LoopBreakerReader) operator(>=) integer(0)operator(\);) - ident(LoopbreakDescriptor) operator(*)ident(ld) operator(=) reserved(new) ident(LoopbreakDescriptor) operator(()ident(LoopBreakerReader)operator(,) local_variable(this)operator(\);) - ident(assert) operator(()ident(ld)operator(\);) - ident(Add) operator(()ident(ld)operator(\);) - operator(}) - preprocessor(#endif) - - reserved(while) operator(()pre_constant(true)operator(\)) operator({) - ident(gCurrentLoopTime) operator(=) ident(time)operator(()pre_constant(NULL)operator(\);) - reserved(if) operator((!)ident(_RunTimers)operator((\)\)) - reserved(break)operator(;) - - comment(/* _Add must precede _Modify because the same descriptor might - * be on both lists during the same pass through the machine, - * and to modify a descriptor before adding it would fail. - */) - ident(_AddNewDescriptors)operator((\);) - ident(_ModifyDescriptors)operator((\);) - - reserved(if) operator((!)ident(_RunOnce)operator((\)\)) - reserved(break)operator(;) - reserved(if) operator(()ident(gTerminateSignalReceived)operator(\)) - reserved(break)operator(;) - operator(}) - - preprocessor(#ifdef) ident(OS_WIN32) - ident(HookControlC) operator(()pre_constant(false)operator(\);) - preprocessor(#endif) -operator(}) - - -comment(/************************ -EventMachine_t::_RunOnce -************************/) - -pre_type(bool) ident(EventMachine_t)operator(::)ident(_RunOnce)operator((\)) -operator({) - reserved(if) operator(()ident(bEpoll)operator(\)) - reserved(return) ident(_RunEpollOnce)operator((\);) - reserved(else) reserved(if) operator(()ident(bKqueue)operator(\)) - reserved(return) ident(_RunKqueueOnce)operator((\);) - reserved(else) - reserved(return) ident(_RunSelectOnce)operator((\);) -operator(}) - - - -comment(/***************************** -EventMachine_t::_RunEpollOnce -*****************************/) - -pre_type(bool) ident(EventMachine_t)operator(::)ident(_RunEpollOnce)operator((\)) -operator({) - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(assert) operator(()ident(epfd) operator(!=) operator(-)integer(1)operator(\);) - reserved(struct) ident(epoll_event) ident(ev) operator([)ident(MaxEpollDescriptors)operator(];) - pre_type(int) ident(s)operator(;) - - preprocessor(#ifdef) ident(BUILD_FOR_RUBY) - ident(TRAP_BEG)operator(;) - preprocessor(#endif) - ident(s) operator(=) ident(epoll_wait) operator(()ident(epfd)operator(,) ident(ev)operator(,) ident(MaxEpollDescriptors)operator(,) integer(50)operator(\);) - preprocessor(#ifdef) ident(BUILD_FOR_RUBY) - ident(TRAP_END)operator(;) - preprocessor(#endif) - - reserved(if) operator(()ident(s) operator(>) integer(0)operator(\)) operator({) - reserved(for) operator(()pre_type(int) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(s)operator(;) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) operator(()ident(EventableDescriptor)operator(*\)) ident(ev)operator([)ident(i)operator(])operator(.)ident(data)operator(.)ident(ptr)operator(;) - - reserved(if) operator(()ident(ev)operator([)ident(i)operator(])operator(.)ident(events) operator(&) operator(()ident(EPOLLERR) operator(|) ident(EPOLLHUP)operator(\)\)) - ident(ed)operator(->)ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - reserved(if) operator(()ident(ev)operator([)ident(i)operator(])operator(.)ident(events) operator(&) ident(EPOLLIN)operator(\)) - ident(ed)operator(->)ident(Read)operator((\);) - reserved(if) operator(()ident(ev)operator([)ident(i)operator(])operator(.)ident(events) operator(&) ident(EPOLLOUT)operator(\)) operator({) - ident(ed)operator(->)ident(Write)operator((\);) - ident(epoll_ctl) operator(()ident(epfd)operator(,) ident(EPOLL_CTL_MOD)operator(,) ident(ed)operator(->)ident(GetSocket)operator((\),) ident(ed)operator(->)ident(GetEpollEvent)operator((\)\);) - comment(// Ignoring return value) - operator(}) - operator(}) - operator(}) - reserved(else) reserved(if) operator(()ident(s) operator(<) integer(0)operator(\)) operator({) - comment(// epoll_wait can fail on error in a handful of ways.) - comment(// If this happens, then wait for a little while to avoid busy-looping.) - comment(// If the error was EINTR, we probably caught SIGCHLD or something,) - comment(// so keep the wait short.) - ident(timeval) ident(tv) operator(=) operator({)integer(0)operator(,) operator((()ident(errno) operator(==) ident(EINTR)operator(\)) operator(?) integer(5) operator(:) integer(50)operator(\)) operator(*) integer(1000)operator(};) - ident(EmSelect) operator(()integer(0)operator(,) pre_constant(NULL)operator(,) pre_constant(NULL)operator(,) pre_constant(NULL)operator(,) operator(&)ident(tv)operator(\);) - operator(}) - - operator({) comment(// cleanup dying sockets) - comment(// vector::pop_back works in constant time.) - comment(// TODO, rip this out and only delete the descriptors we know have died,) - comment(// rather than traversing the whole list.) - comment(// Modified 05Jan08 per suggestions by Chris Heath. It's possible that) - comment(// an EventableDescriptor will have a descriptor value of -1. That will) - comment(// happen if EventableDescriptor::Close was called on it. In that case,) - comment(// don't call epoll_ctl to remove the socket's filters from the epoll set.) - comment(// According to the epoll docs, this happens automatically when the) - comment(// descriptor is closed anyway. This is different from the case where) - comment(// the socket has already been closed but the descriptor in the ED object) - comment(// hasn't yet been set to INVALID_SOCKET.) - pre_type(int) ident(i)operator(,) ident(j)operator(;) - pre_type(int) ident(nSockets) operator(=) ident(Descriptors)operator(.)ident(size)operator((\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(,) ident(j)operator(=)integer(0)operator(;) ident(i) operator(<) ident(nSockets)operator(;) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) ident(Descriptors)operator([)ident(i)operator(];) - ident(assert) operator(()ident(ed)operator(\);) - reserved(if) operator(()ident(ed)operator(->)ident(ShouldDelete)operator((\)\)) operator({) - reserved(if) operator(()ident(ed)operator(->)ident(GetSocket)operator((\)) operator(!=) ident(INVALID_SOCKET)operator(\)) operator({) - ident(assert) operator(()ident(bEpoll)operator(\);) comment(// wouldn't be in this method otherwise.) - ident(assert) operator(()ident(epfd) operator(!=) operator(-)integer(1)operator(\);) - pre_type(int) ident(e) operator(=) ident(epoll_ctl) operator(()ident(epfd)operator(,) ident(EPOLL_CTL_DEL)operator(,) ident(ed)operator(->)ident(GetSocket)operator((\),) ident(ed)operator(->)ident(GetEpollEvent)operator((\)\);) - comment(// ENOENT or EBADF are not errors because the socket may be already closed when we get here.) - reserved(if) operator(()ident(e) operator(&&) operator(()ident(errno) operator(!=) ident(ENOENT)operator(\)) operator(&&) operator(()ident(errno) operator(!=) ident(EBADF)operator(\)\)) operator({) - pre_type(char) ident(buf) operator([)integer(200)operator(];) - ident(snprintf) operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\)-)integer(1)operator(,) stringoperator(,) ident(strerror)operator(()ident(errno)operator(\)\);) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()ident(buf)operator(\);) - operator(}) - operator(}) - - ident(ModifiedDescriptors)operator(.)ident(erase) operator(()ident(ed)operator(\);) - reserved(delete) ident(ed)operator(;) - operator(}) - reserved(else) - ident(Descriptors) operator([)ident(j)operator(++]) operator(=) ident(ed)operator(;) - operator(}) - reserved(while) operator((()ident(size_t)operator(\))ident(j) operator(<) ident(Descriptors)operator(.)ident(size)operator((\)\)) - ident(Descriptors)operator(.)ident(pop_back)operator((\);) - - operator(}) - - comment(// TODO, heartbeats.) - comment(// Added 14Sep07, its absence was noted by Brian Candler. But the comment was here, indicated) - comment(// that this got thought about and not done when EPOLL was originally written. Was there a reason) - comment(// not to do it, or was it an oversight? Certainly, running a heartbeat on 50,000 connections every) - comment(// two seconds can get to be a real bear, especially if all we're doing is timing out dead ones.) - comment(// Maybe there's a better way to do this. (Or maybe it's not that expensive after all.\)) - comment(//) - operator({) comment(// dispatch heartbeats) - reserved(if) operator(()ident(gCurrentLoopTime) operator(>=) ident(NextHeartbeatTime)operator(\)) operator({) - ident(NextHeartbeatTime) operator(=) ident(gCurrentLoopTime) operator(+) ident(HeartbeatInterval)operator(;) - - reserved(for) operator(()pre_type(int) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(Descriptors)operator(.)ident(size)operator((\);) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) ident(Descriptors)operator([)ident(i)operator(];) - ident(assert) operator(()ident(ed)operator(\);) - ident(ed)operator(->)ident(Heartbeat)operator((\);) - operator(}) - operator(}) - operator(}) - - preprocessor(#ifdef) ident(BUILD_FOR_RUBY) - reserved(if) operator((!)ident(rb_thread_alone)operator((\)\)) operator({) - ident(rb_thread_schedule)operator((\);) - operator(}) - preprocessor(#endif) - - reserved(return) pre_constant(true)operator(;) - preprocessor(#else) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) -operator(}) - - -comment(/****************************** -EventMachine_t::_RunKqueueOnce -******************************/) - -pre_type(bool) ident(EventMachine_t)operator(::)ident(_RunKqueueOnce)operator((\)) -operator({) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - ident(assert) operator(()ident(kqfd) operator(!=) operator(-)integer(1)operator(\);) - directive(const) pre_type(int) ident(maxKevents) operator(=) integer(2000)operator(;) - reserved(struct) ident(kevent) ident(Karray) operator([)ident(maxKevents)operator(];) - reserved(struct) ident(timespec) ident(ts) operator(=) operator({)integer(0)operator(,) integer(10000000)operator(};) comment(// Too frequent. Use blocking_region) - - pre_type(int) ident(k)operator(;) - preprocessor(#ifdef) ident(BUILD_FOR_RUBY) - ident(TRAP_BEG)operator(;) - preprocessor(#endif) - ident(k) operator(=) ident(kevent) operator(()ident(kqfd)operator(,) pre_constant(NULL)operator(,) integer(0)operator(,) ident(Karray)operator(,) ident(maxKevents)operator(,) operator(&)ident(ts)operator(\);) - preprocessor(#ifdef) ident(BUILD_FOR_RUBY) - ident(TRAP_END)operator(;) - preprocessor(#endif) - reserved(struct) ident(kevent) operator(*)ident(ke) operator(=) ident(Karray)operator(;) - reserved(while) operator(()ident(k) operator(>) integer(0)operator(\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) operator(()ident(EventableDescriptor)operator(*\)) operator(()ident(ke)operator(->)ident(udata)operator(\);) - ident(assert) operator(()ident(ed)operator(\);) - - reserved(if) operator(()ident(ke)operator(->)ident(filter) operator(==) ident(EVFILT_READ)operator(\)) - ident(ed)operator(->)ident(Read)operator((\);) - reserved(else) reserved(if) operator(()ident(ke)operator(->)ident(filter) operator(==) ident(EVFILT_WRITE)operator(\)) - ident(ed)operator(->)ident(Write)operator((\);) - reserved(else) - ident(cerr) operator(<<) string operator(<<) ident(ke)operator(->)ident(filter) operator(<<) ident(endl)operator(;) - - operator(--)ident(k)operator(;) - operator(++)ident(ke)operator(;) - operator(}) - - operator({) comment(// cleanup dying sockets) - comment(// vector::pop_back works in constant time.) - comment(// TODO, rip this out and only delete the descriptors we know have died,) - comment(// rather than traversing the whole list.) - comment(// In kqueue, closing a descriptor automatically removes its event filters.) - - pre_type(int) ident(i)operator(,) ident(j)operator(;) - pre_type(int) ident(nSockets) operator(=) ident(Descriptors)operator(.)ident(size)operator((\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(,) ident(j)operator(=)integer(0)operator(;) ident(i) operator(<) ident(nSockets)operator(;) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) ident(Descriptors)operator([)ident(i)operator(];) - ident(assert) operator(()ident(ed)operator(\);) - reserved(if) operator(()ident(ed)operator(->)ident(ShouldDelete)operator((\)\)) operator({) - ident(ModifiedDescriptors)operator(.)ident(erase) operator(()ident(ed)operator(\);) - reserved(delete) ident(ed)operator(;) - operator(}) - reserved(else) - ident(Descriptors) operator([)ident(j)operator(++]) operator(=) ident(ed)operator(;) - operator(}) - reserved(while) operator((()ident(size_t)operator(\))ident(j) operator(<) ident(Descriptors)operator(.)ident(size)operator((\)\)) - ident(Descriptors)operator(.)ident(pop_back)operator((\);) - - operator(}) - - operator({) comment(// dispatch heartbeats) - reserved(if) operator(()ident(gCurrentLoopTime) operator(>=) ident(NextHeartbeatTime)operator(\)) operator({) - ident(NextHeartbeatTime) operator(=) ident(gCurrentLoopTime) operator(+) ident(HeartbeatInterval)operator(;) - - reserved(for) operator(()pre_type(int) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(Descriptors)operator(.)ident(size)operator((\);) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) ident(Descriptors)operator([)ident(i)operator(];) - ident(assert) operator(()ident(ed)operator(\);) - ident(ed)operator(->)ident(Heartbeat)operator((\);) - operator(}) - operator(}) - operator(}) - - - comment(// TODO, replace this with rb_thread_blocking_region for 1.9 builds.) - preprocessor(#ifdef) ident(BUILD_FOR_RUBY) - reserved(if) operator((!)ident(rb_thread_alone)operator((\)\)) operator({) - ident(rb_thread_schedule)operator((\);) - operator(}) - preprocessor(#endif) - - reserved(return) pre_constant(true)operator(;) - preprocessor(#else) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) -operator(}) - - -comment(/********************************* -EventMachine_t::_ModifyEpollEvent -*********************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(_ModifyEpollEvent) operator(()ident(EventableDescriptor) operator(*)ident(ed)operator(\)) -operator({) - preprocessor(#ifdef) ident(HAVE_EPOLL) - reserved(if) operator(()ident(bEpoll)operator(\)) operator({) - ident(assert) operator(()ident(epfd) operator(!=) operator(-)integer(1)operator(\);) - ident(assert) operator(()ident(ed)operator(\);) - pre_type(int) ident(e) operator(=) ident(epoll_ctl) operator(()ident(epfd)operator(,) ident(EPOLL_CTL_MOD)operator(,) ident(ed)operator(->)ident(GetSocket)operator((\),) ident(ed)operator(->)ident(GetEpollEvent)operator((\)\);) - reserved(if) operator(()ident(e)operator(\)) operator({) - pre_type(char) ident(buf) operator([)integer(200)operator(];) - ident(snprintf) operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\)-)integer(1)operator(,) stringoperator(,) ident(strerror)operator(()ident(errno)operator(\)\);) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()ident(buf)operator(\);) - operator(}) - operator(}) - preprocessor(#endif) -operator(}) - - - -comment(/************************** -SelectData_t::SelectData_t -**************************/) - -ident(SelectData_t)operator(::)ident(SelectData_t)operator((\)) -operator({) - ident(maxsocket) operator(=) integer(0)operator(;) - ident(FD_ZERO) operator((&)ident(fdreads)operator(\);) - ident(FD_ZERO) operator((&)ident(fdwrites)operator(\);) -operator(}) - - -preprocessor(#ifdef) ident(BUILD_FOR_RUBY) -comment(/***************** -_SelectDataSelect -*****************/) - -preprocessor(#ifdef) ident(HAVE_TBR) -directive(static) ident(VALUE) ident(_SelectDataSelect) operator(()directive(void) operator(*)ident(v)operator(\)) -operator({) - ident(SelectData_t) operator(*)ident(sd) operator(=) operator(()ident(SelectData_t)operator(*\))ident(v)operator(;) - ident(sd)operator(->)ident(nSockets) operator(=) ident(select) operator(()ident(sd)operator(->)ident(maxsocket)operator(+)integer(1)operator(,) operator(&()ident(sd)operator(->)ident(fdreads)operator(\),) operator(&()ident(sd)operator(->)ident(fdwrites)operator(\),) pre_constant(NULL)operator(,) operator(&()ident(sd)operator(->)ident(tv)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) -preprocessor(#endif) - -comment(/********************* -SelectData_t::_Select -*********************/) - -pre_type(int) ident(SelectData_t)operator(::)ident(_Select)operator((\)) -operator({) - preprocessor(#ifdef) ident(HAVE_TBR) - ident(rb_thread_blocking_region) operator(()ident(_SelectDataSelect)operator(,) operator(()directive(void)operator(*\))local_variable(this)operator(,) ident(RUBY_UBF_IO)operator(,) integer(0)operator(\);) - reserved(return) ident(nSockets)operator(;) - preprocessor(#endif) - - preprocessor(#ifndef) ident(HAVE_TBR) - reserved(return) ident(EmSelect) operator(()ident(maxsocket)operator(+)integer(1)operator(,) operator(&)ident(fdreads)operator(,) operator(&)ident(fdwrites)operator(,) pre_constant(NULL)operator(,) operator(&)ident(tv)operator(\);) - preprocessor(#endif) -operator(}) -preprocessor(#endif) - - - -comment(/****************************** -EventMachine_t::_RunSelectOnce -******************************/) - -pre_type(bool) ident(EventMachine_t)operator(::)ident(_RunSelectOnce)operator((\)) -operator({) - comment(// Crank the event machine once.) - comment(// If there are no descriptors to process, then sleep) - comment(// for a few hundred mills to avoid busy-looping.) - comment(// Return T/F to indicate whether we should continue.) - comment(// This is based on a select loop. Alternately provide epoll) - comment(// if we know we're running on a 2.6 kernel.) - comment(// epoll will be effective if we provide it as an alternative,) - comment(// however it has the same problem interoperating with Ruby) - comment(// threads that select does.) - - comment(//cerr << "X";) - - comment(/* This protection is now obsolete, because we will ALWAYS - * have at least one descriptor (the loop-breaker\) to read. - */) - comment(/* - if (Descriptors.size(\) == 0\) { - #ifdef OS_UNIX - timeval tv = {0, 200 * 1000}; - EmSelect (0, NULL, NULL, NULL, &tv\); - return true; - #endif - #ifdef OS_WIN32 - Sleep (200\); - return true; - #endif - } - */) - - ident(SelectData_t) ident(SelectData)operator(;) - comment(/* - fd_set fdreads, fdwrites; - FD_ZERO (&fdreads\); - FD_ZERO (&fdwrites\); - - int maxsocket = 0; - */) - - comment(// Always read the loop-breaker reader.) - comment(// Changed 23Aug06, provisionally implemented for Windows with a UDP socket) - comment(// running on localhost with a randomly-chosen port. (*Puke*\)) - comment(// Windows has a version of the Unix pipe(\) library function, but it doesn't) - comment(// give you back descriptors that are selectable.) - ident(FD_SET) operator(()ident(LoopBreakerReader)operator(,) operator(&()ident(SelectData)operator(.)ident(fdreads)operator(\)\);) - reserved(if) operator(()ident(SelectData)operator(.)ident(maxsocket) operator(<) ident(LoopBreakerReader)operator(\)) - ident(SelectData)operator(.)ident(maxsocket) operator(=) ident(LoopBreakerReader)operator(;) - - comment(// prepare the sockets for reading and writing) - ident(size_t) ident(i)operator(;) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(Descriptors)operator(.)ident(size)operator((\);) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) ident(Descriptors)operator([)ident(i)operator(];) - ident(assert) operator(()ident(ed)operator(\);) - pre_type(int) ident(sd) operator(=) ident(ed)operator(->)ident(GetSocket)operator((\);) - ident(assert) operator(()ident(sd) operator(!=) ident(INVALID_SOCKET)operator(\);) - - reserved(if) operator(()ident(ed)operator(->)ident(SelectForRead)operator((\)\)) - ident(FD_SET) operator(()ident(sd)operator(,) operator(&()ident(SelectData)operator(.)ident(fdreads)operator(\)\);) - reserved(if) operator(()ident(ed)operator(->)ident(SelectForWrite)operator((\)\)) - ident(FD_SET) operator(()ident(sd)operator(,) operator(&()ident(SelectData)operator(.)ident(fdwrites)operator(\)\);) - - reserved(if) operator(()ident(SelectData)operator(.)ident(maxsocket) operator(<) ident(sd)operator(\)) - ident(SelectData)operator(.)ident(maxsocket) operator(=) ident(sd)operator(;) - operator(}) - - - operator({) comment(// read and write the sockets) - comment(//timeval tv = {1, 0}; // Solaris fails if the microseconds member is >= 1000000.) - comment(//timeval tv = Quantum;) - ident(SelectData)operator(.)ident(tv) operator(=) ident(Quantum)operator(;) - pre_type(int) ident(s) operator(=) ident(SelectData)operator(.)ident(_Select)operator((\);) - comment(//rb_thread_blocking_region(xxx,(void*\)&SelectData,RUBY_UBF_IO,0\);) - comment(//int s = EmSelect (SelectData.maxsocket+1, &(SelectData.fdreads\), &(SelectData.fdwrites\), NULL, &(SelectData.tv\)\);) - comment(//int s = SelectData.nSockets;) - reserved(if) operator(()ident(s) operator(>) integer(0)operator(\)) operator({) - comment(/* Changed 01Jun07. We used to handle the Loop-breaker right here. - * Now we do it AFTER all the regular descriptors. There's an - * incredibly important and subtle reason for this. Code on - * loop breakers is sometimes used to cause the reactor core to - * cycle (for example, to allow outbound network buffers to drain\). - * If a loop-breaker handler reschedules itself (say, after determining - * that the write buffers are still too full\), then it will execute - * IMMEDIATELY if _ReadLoopBreaker is done here instead of after - * the other descriptors are processed. That defeats the whole purpose. - */) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(Descriptors)operator(.)ident(size)operator((\);) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) ident(Descriptors)operator([)ident(i)operator(];) - ident(assert) operator(()ident(ed)operator(\);) - pre_type(int) ident(sd) operator(=) ident(ed)operator(->)ident(GetSocket)operator((\);) - ident(assert) operator(()ident(sd) operator(!=) ident(INVALID_SOCKET)operator(\);) - - reserved(if) operator(()ident(FD_ISSET) operator(()ident(sd)operator(,) operator(&()ident(SelectData)operator(.)ident(fdwrites)operator(\)\)\)) - ident(ed)operator(->)ident(Write)operator((\);) - reserved(if) operator(()ident(FD_ISSET) operator(()ident(sd)operator(,) operator(&()ident(SelectData)operator(.)ident(fdreads)operator(\)\)\)) - ident(ed)operator(->)ident(Read)operator((\);) - operator(}) - - reserved(if) operator(()ident(FD_ISSET) operator(()ident(LoopBreakerReader)operator(,) operator(&()ident(SelectData)operator(.)ident(fdreads)operator(\)\)\)) - ident(_ReadLoopBreaker)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(s) operator(<) integer(0)operator(\)) operator({) - comment(// select can fail on error in a handful of ways.) - comment(// If this happens, then wait for a little while to avoid busy-looping.) - comment(// If the error was EINTR, we probably caught SIGCHLD or something,) - comment(// so keep the wait short.) - ident(timeval) ident(tv) operator(=) operator({)integer(0)operator(,) operator((()ident(errno) operator(==) ident(EINTR)operator(\)) operator(?) integer(5) operator(:) integer(50)operator(\)) operator(*) integer(1000)operator(};) - ident(EmSelect) operator(()integer(0)operator(,) pre_constant(NULL)operator(,) pre_constant(NULL)operator(,) pre_constant(NULL)operator(,) operator(&)ident(tv)operator(\);) - operator(}) - operator(}) - - - operator({) comment(// dispatch heartbeats) - reserved(if) operator(()ident(gCurrentLoopTime) operator(>=) ident(NextHeartbeatTime)operator(\)) operator({) - ident(NextHeartbeatTime) operator(=) ident(gCurrentLoopTime) operator(+) ident(HeartbeatInterval)operator(;) - - reserved(for) operator(()ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(Descriptors)operator(.)ident(size)operator((\);) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) ident(Descriptors)operator([)ident(i)operator(];) - ident(assert) operator(()ident(ed)operator(\);) - ident(ed)operator(->)ident(Heartbeat)operator((\);) - operator(}) - operator(}) - operator(}) - - operator({) comment(// cleanup dying sockets) - comment(// vector::pop_back works in constant time.) - pre_type(int) ident(i)operator(,) ident(j)operator(;) - pre_type(int) ident(nSockets) operator(=) ident(Descriptors)operator(.)ident(size)operator((\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(,) ident(j)operator(=)integer(0)operator(;) ident(i) operator(<) ident(nSockets)operator(;) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) ident(Descriptors)operator([)ident(i)operator(];) - ident(assert) operator(()ident(ed)operator(\);) - reserved(if) operator(()ident(ed)operator(->)ident(ShouldDelete)operator((\)\)) - reserved(delete) ident(ed)operator(;) - reserved(else) - ident(Descriptors) operator([)ident(j)operator(++]) operator(=) ident(ed)operator(;) - operator(}) - reserved(while) operator((()ident(size_t)operator(\))ident(j) operator(<) ident(Descriptors)operator(.)ident(size)operator((\)\)) - ident(Descriptors)operator(.)ident(pop_back)operator((\);) - - operator(}) - - reserved(return) pre_constant(true)operator(;) -operator(}) - - -comment(/******************************** -EventMachine_t::_ReadLoopBreaker -********************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(_ReadLoopBreaker)operator((\)) -operator({) - comment(/* The loop breaker has selected readable. - * Read it ONCE (it may block if we try to read it twice\) - * and send a loop-break event back to user code. - */) - pre_type(char) ident(buffer) operator([)integer(1024)operator(];) - ident(read) operator(()ident(LoopBreakerReader)operator(,) ident(buffer)operator(,) reserved(sizeof)operator(()ident(buffer)operator(\)\);) - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)()stringoperator(,) ident(EM_LOOPBREAK_SIGNAL)operator(,) stringoperator(,) integer(0)operator(\);) -operator(}) - - -comment(/************************** -EventMachine_t::_RunTimers -**************************/) - -pre_type(bool) ident(EventMachine_t)operator(::)ident(_RunTimers)operator((\)) -operator({) - comment(// These are caller-defined timer handlers.) - comment(// Return T/F to indicate whether we should continue the main loop.) - comment(// We rely on the fact that multimaps sort by their keys to avoid) - comment(// inspecting the whole list every time we come here.) - comment(// Just keep inspecting and processing the list head until we hit) - comment(// one that hasn't expired yet.) - - preprocessor(#ifdef) ident(OS_UNIX) - reserved(struct) ident(timeval) ident(tv)operator(;) - ident(gettimeofday) operator((&)ident(tv)operator(,) pre_constant(NULL)operator(\);) - ident(Int64) ident(now) operator(=) operator(((()ident(Int64)operator(\)()ident(tv)operator(.)ident(tv_sec)operator(\)\)) operator(*) integer(1000000LL)operator(\)) operator(+) operator((()ident(Int64)operator(\)()ident(tv)operator(.)ident(tv_usec)operator(\)\);) - preprocessor(#endif) - - preprocessor(#ifdef) ident(OS_WIN32) - pre_type(unsigned) ident(tick) operator(=) ident(GetTickCount)operator((\);) - reserved(if) operator(()ident(tick) operator(<) ident(gLastTickCount)operator(\)) - ident(gTickCountTickover) operator(+=) integer(1)operator(;) - ident(gLastTickCount) operator(=) ident(tick)operator(;) - ident(Int64) ident(now) operator(=) operator((()ident(Int64)operator(\))ident(gTickCountTickover) operator(<<) integer(32)operator(\)) operator(+) operator(()ident(Int64)operator(\))ident(tick)operator(;) - preprocessor(#endif) - - reserved(while) operator(()pre_constant(true)operator(\)) operator({) - ident(multimap)operator(<)ident(Int64)operator(,)ident(Timer_t)operator(>::)ident(iterator) ident(i) operator(=) ident(Timers)operator(.)ident(begin)operator((\);) - reserved(if) operator(()ident(i) operator(==) ident(Timers)operator(.)ident(end)operator((\)\)) - reserved(break)operator(;) - reserved(if) operator(()ident(i)operator(->)ident(first) operator(>) ident(now)operator(\)) - reserved(break)operator(;) - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)) operator(()stringoperator(,) ident(EM_TIMER_FIRED)operator(,) ident(i)operator(->)ident(second)operator(.)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(i)operator(->)ident(second)operator(.)ident(GetBinding)operator((\))operator(.)ident(length)operator((\)\);) - ident(Timers)operator(.)ident(erase) operator(()ident(i)operator(\);) - operator(}) - reserved(return) pre_constant(true)operator(;) -operator(}) - - - -comment(/*********************************** -EventMachine_t::InstallOneshotTimer -***********************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(InstallOneshotTimer) operator(()pre_type(int) ident(milliseconds)operator(\)) -operator({) - reserved(if) operator(()ident(Timers)operator(.)ident(size)operator((\)) operator(>) ident(MaxOutstandingTimers)operator(\)) - reserved(return) pre_constant(false)operator(;) - comment(// Don't use the global loop-time variable here, because we might) - comment(// get called before the main event machine is running.) - - preprocessor(#ifdef) ident(OS_UNIX) - reserved(struct) ident(timeval) ident(tv)operator(;) - ident(gettimeofday) operator((&)ident(tv)operator(,) pre_constant(NULL)operator(\);) - ident(Int64) ident(fire_at) operator(=) operator(((()ident(Int64)operator(\)()ident(tv)operator(.)ident(tv_sec)operator(\)\)) operator(*) integer(1000000LL)operator(\)) operator(+) operator((()ident(Int64)operator(\)()ident(tv)operator(.)ident(tv_usec)operator(\)\);) - ident(fire_at) operator(+=) operator((()ident(Int64)operator(\))ident(milliseconds)operator(\)) operator(*) integer(1000LL)operator(;) - preprocessor(#endif) - - preprocessor(#ifdef) ident(OS_WIN32) - pre_type(unsigned) ident(tick) operator(=) ident(GetTickCount)operator((\);) - reserved(if) operator(()ident(tick) operator(<) ident(gLastTickCount)operator(\)) - ident(gTickCountTickover) operator(+=) integer(1)operator(;) - ident(gLastTickCount) operator(=) ident(tick)operator(;) - - ident(Int64) ident(fire_at) operator(=) operator((()ident(Int64)operator(\))ident(gTickCountTickover) operator(<<) integer(32)operator(\)) operator(+) operator(()ident(Int64)operator(\))ident(tick)operator(;) - ident(fire_at) operator(+=) operator(()ident(Int64)operator(\))ident(milliseconds)operator(;) - preprocessor(#endif) - - ident(Timer_t) ident(t)operator(;) - ident(multimap)operator(<)ident(Int64)operator(,)ident(Timer_t)operator(>::)ident(iterator) ident(i) operator(=) - ident(Timers)operator(.)ident(insert) operator(()ident(make_pair) operator(()ident(fire_at)operator(,) ident(t)operator(\)\);) - reserved(return) ident(i)operator(->)ident(second)operator(.)ident(GetBindingChars)operator((\);) -operator(}) - - -comment(/******************************* -EventMachine_t::ConnectToServer -*******************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(ConnectToServer) operator(()directive(const) pre_type(char) operator(*)ident(server)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - comment(/* We want to spend no more than a few seconds waiting for a connection - * to a remote host. So we use a nonblocking connect. - * Linux disobeys the usual rules for nonblocking connects. - * Per Stevens (UNP p.410\), you expect a nonblocking connect to select - * both readable and writable on error, and not to return EINPROGRESS - * if the connect can be fulfilled immediately. Linux violates both - * of these expectations. - * Any kind of nonblocking connect on Linux returns EINPROGRESS. - * The socket will then return writable when the disposition of the - * connect is known, but it will not also be readable in case of - * error! Weirdly, it will be readable in case there is data to read!!! - * (Which can happen with protocols like SSH and SMTP.\) - * I suppose if you were so inclined you could consider this logical, - * but it's not the way Unix has historically done it. - * So we ignore the readable flag and read getsockopt to see if there - * was an error connecting. A select timeout works as expected. - * In regard to getsockopt: Linux does the Berkeley-style thing, - * not the Solaris-style, and returns zero with the error code in - * the error parameter. - * Return the binding-text of the newly-created pending connection, - * or NULL if there was a problem. - */) - - reserved(if) operator((!)ident(server) operator(||) operator(!*)ident(server) operator(||) operator(!)ident(port)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - - pre_type(int) ident(family)operator(,) ident(bind_size)operator(;) - reserved(struct) ident(sockaddr) operator(*)ident(bind_as) operator(=) ident(name2address) operator(()ident(server)operator(,) ident(port)operator(,) operator(&)ident(family)operator(,) operator(&)ident(bind_size)operator(\);) - reserved(if) operator((!)ident(bind_as)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - - pre_type(int) ident(sd) operator(=) ident(socket) operator(()ident(family)operator(,) ident(SOCK_STREAM)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(sd) operator(==) ident(INVALID_SOCKET)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - - comment(/* - sockaddr_in pin; - unsigned long HostAddr; - - HostAddr = inet_addr (server\); - if (HostAddr == INADDR_NONE\) { - hostent *hp = gethostbyname ((char*\)server\); // Windows requires (char*\) - if (!hp\) { - // TODO: This gives the caller a fatal error. Not good. - // They can respond by catching RuntimeError (blecch\). - // Possibly we need to fire an unbind event and provide - // a status code so user code can detect the cause of the - // failure. - return NULL; - } - HostAddr = ((in_addr*\)(hp->h_addr\)\)->s_addr; - } - - memset (&pin, 0, sizeof(pin\)\); - pin.sin_family = AF_INET; - pin.sin_addr.s_addr = HostAddr; - pin.sin_port = htons (port\); - - int sd = socket (AF_INET, SOCK_STREAM, 0\); - if (sd == INVALID_SOCKET\) - return NULL; - */) - - comment(// From here on, ALL error returns must close the socket.) - comment(// Set the new socket nonblocking.) - reserved(if) operator((!)ident(SetSocketNonblocking) operator(()ident(sd)operator(\)\)) operator({) - ident(closesocket) operator(()ident(sd)operator(\);) - reserved(return) pre_constant(NULL)operator(;) - operator(}) - comment(// Disable slow-start (Nagle algorithm\).) - pre_type(int) ident(one) operator(=) integer(1)operator(;) - ident(setsockopt) operator(()ident(sd)operator(,) ident(IPPROTO_TCP)operator(,) ident(TCP_NODELAY)operator(,) operator(()pre_type(char)operator(*\)) operator(&)ident(one)operator(,) reserved(sizeof)operator(()ident(one)operator(\)\);) - - directive(const) pre_type(char) operator(*)ident(out) operator(=) pre_constant(NULL)operator(;) - - preprocessor(#ifdef) ident(OS_UNIX) - comment(//if (connect (sd, (sockaddr*\)&pin, sizeof pin\) == 0\) {) - reserved(if) operator(()ident(connect) operator(()ident(sd)operator(,) ident(bind_as)operator(,) ident(bind_size)operator(\)) operator(==) integer(0)operator(\)) operator({) - comment(// This is a connect success, which Linux appears) - comment(// never to give when the socket is nonblocking,) - comment(// even if the connection is intramachine or to) - comment(// localhost.) - - comment(/* Changed this branch 08Aug06. Evidently some kernels - * (FreeBSD for example\) will actually return success from - * a nonblocking connect. This is a pretty simple case, - * just set up the new connection and clear the pending flag. - * Thanks to Chris Ochs for helping track this down. - * This branch never gets taken on Linux or (oddly\) OSX. - * The original behavior was to throw an unimplemented, - * which the user saw as a fatal exception. Very unfriendly. - * - * Tweaked 10Aug06. Even though the connect disposition is - * known, we still set the connect-pending flag. That way - * some needed initialization will happen in the ConnectionDescriptor. - * (To wit, the ConnectionCompleted event gets sent to the client.\) - */) - ident(ConnectionDescriptor) operator(*)ident(cd) operator(=) reserved(new) ident(ConnectionDescriptor) operator(()ident(sd)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(cd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(cd)operator(->)ident(SetConnectPending) operator(()pre_constant(true)operator(\);) - ident(Add) operator(()ident(cd)operator(\);) - ident(out) operator(=) ident(cd)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(errno) operator(==) ident(EINPROGRESS)operator(\)) operator({) - comment(// Errno will generally always be EINPROGRESS, but on Linux) - comment(// we have to look at getsockopt to be sure what really happened.) - pre_type(int) ident(error)operator(;) - ident(socklen_t) ident(len)operator(;) - ident(len) operator(=) reserved(sizeof)operator(()ident(error)operator(\);) - pre_type(int) ident(o) operator(=) ident(getsockopt) operator(()ident(sd)operator(,) ident(SOL_SOCKET)operator(,) ident(SO_ERROR)operator(,) operator(&)ident(error)operator(,) operator(&)ident(len)operator(\);) - reserved(if) operator((()ident(o) operator(==) integer(0)operator(\)) operator(&&) operator(()ident(error) operator(==) integer(0)operator(\)\)) operator({) - comment(// Here, there's no disposition.) - comment(// Put the connection on the stack and wait for it to complete) - comment(// or time out.) - ident(ConnectionDescriptor) operator(*)ident(cd) operator(=) reserved(new) ident(ConnectionDescriptor) operator(()ident(sd)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(cd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(cd)operator(->)ident(SetConnectPending) operator(()pre_constant(true)operator(\);) - ident(Add) operator(()ident(cd)operator(\);) - ident(out) operator(=) ident(cd)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - operator(}) - reserved(else) operator({) - comment(/* This could be connection refused or some such thing. - * We will come here on Linux if a localhost connection fails. - * Changed 16Jul06: Originally this branch was a no-op, and - * we'd drop down to the end of the method, close the socket, - * and return NULL, which would cause the caller to GET A - * FATAL EXCEPTION. Now we keep the socket around but schedule an - * immediate close on it, so the caller will get a close-event - * scheduled on it. This was only an issue for localhost connections - * to non-listening ports. We may eventually need to revise this - * revised behavior, in case it causes problems like making it hard - * for people to know that a failure occurred. - */) - ident(ConnectionDescriptor) operator(*)ident(cd) operator(=) reserved(new) ident(ConnectionDescriptor) operator(()ident(sd)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(cd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(cd)operator(->)ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - ident(Add) operator(()ident(cd)operator(\);) - ident(out) operator(=) ident(cd)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - operator(}) - operator(}) - reserved(else) operator({) - comment(// The error from connect was something other then EINPROGRESS.) - operator(}) - preprocessor(#endif) - - preprocessor(#ifdef) ident(OS_WIN32) - comment(//if (connect (sd, (sockaddr*\)&pin, sizeof pin\) == 0\) {) - reserved(if) operator(()ident(connect) operator(()ident(sd)operator(,) ident(bind_as)operator(,) ident(bind_size)operator(\)) operator(==) integer(0)operator(\)) operator({) - comment(// This is a connect success, which Windows appears) - comment(// never to give when the socket is nonblocking,) - comment(// even if the connection is intramachine or to) - comment(// localhost.) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(WSAGetLastError)operator((\)) operator(==) ident(WSAEWOULDBLOCK)operator(\)) operator({) - comment(// Here, there's no disposition.) - comment(// Windows appears not to surface refused connections or) - comment(// such stuff at this point.) - comment(// Put the connection on the stack and wait for it to complete) - comment(// or time out.) - ident(ConnectionDescriptor) operator(*)ident(cd) operator(=) reserved(new) ident(ConnectionDescriptor) operator(()ident(sd)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(cd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(cd)operator(->)ident(SetConnectPending) operator(()pre_constant(true)operator(\);) - ident(Add) operator(()ident(cd)operator(\);) - ident(out) operator(=) ident(cd)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - operator(}) - reserved(else) operator({) - comment(// The error from connect was something other then WSAEWOULDBLOCK.) - operator(}) - - preprocessor(#endif) - - reserved(if) operator(()ident(out) operator(==) pre_constant(NULL)operator(\)) - ident(closesocket) operator(()ident(sd)operator(\);) - reserved(return) ident(out)operator(;) -operator(}) - -comment(/*********************************** -EventMachine_t::ConnectToUnixServer -***********************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(ConnectToUnixServer) operator(()directive(const) pre_type(char) operator(*)ident(server)operator(\)) -operator({) - comment(/* Connect to a Unix-domain server, which by definition is running - * on the same host. - * There is no meaningful implementation on Windows. - * There's no need to do a nonblocking connect, since the connection - * is always local and can always be fulfilled immediately. - */) - - preprocessor(#ifdef) ident(OS_WIN32) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - reserved(return) pre_constant(NULL)operator(;) - preprocessor(#endif) - - comment(// The whole rest of this function is only compiled on Unix systems.) - preprocessor(#ifdef) ident(OS_UNIX) - - directive(const) pre_type(char) operator(*)ident(out) operator(=) pre_constant(NULL)operator(;) - - reserved(if) operator((!)ident(server) operator(||) operator(!*)ident(server)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - - ident(sockaddr_un) ident(pun)operator(;) - ident(memset) operator((&)ident(pun)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(pun)operator(\)\);) - ident(pun)operator(.)ident(sun_family) operator(=) ident(AF_LOCAL)operator(;) - - comment(// You ordinarily expect the server name field to be at least 1024 bytes long,) - comment(// but on Linux it can be MUCH shorter.) - reserved(if) operator(()ident(strlen)operator(()ident(server)operator(\)) operator(>=) reserved(sizeof)operator(()ident(pun)operator(.)ident(sun_path)operator(\)\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - - ident(strcpy) operator(()ident(pun)operator(.)ident(sun_path)operator(,) ident(server)operator(\);) - - pre_type(int) ident(fd) operator(=) ident(socket) operator(()ident(AF_LOCAL)operator(,) ident(SOCK_STREAM)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(fd) operator(==) ident(INVALID_SOCKET)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - - comment(// From here on, ALL error returns must close the socket.) - comment(// NOTE: At this point, the socket is still a blocking socket.) - reserved(if) operator(()ident(connect) operator(()ident(fd)operator(,) operator(()reserved(struct) ident(sockaddr)operator(*\)&)ident(pun)operator(,) reserved(sizeof)operator(()ident(pun)operator(\)\)) operator(!=) integer(0)operator(\)) operator({) - ident(closesocket) operator(()ident(fd)operator(\);) - reserved(return) pre_constant(NULL)operator(;) - operator(}) - - comment(// Set the newly-connected socket nonblocking.) - reserved(if) operator((!)ident(SetSocketNonblocking) operator(()ident(fd)operator(\)\)) operator({) - ident(closesocket) operator(()ident(fd)operator(\);) - reserved(return) pre_constant(NULL)operator(;) - operator(}) - - comment(// Set up a connection descriptor and add it to the event-machine.) - comment(// Observe, even though we know the connection status is connect-success,) - comment(// we still set the "pending" flag, so some needed initializations take) - comment(// place.) - ident(ConnectionDescriptor) operator(*)ident(cd) operator(=) reserved(new) ident(ConnectionDescriptor) operator(()ident(fd)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(cd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(cd)operator(->)ident(SetConnectPending) operator(()pre_constant(true)operator(\);) - ident(Add) operator(()ident(cd)operator(\);) - ident(out) operator(=) ident(cd)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - - reserved(if) operator(()ident(out) operator(==) pre_constant(NULL)operator(\)) - ident(closesocket) operator(()ident(fd)operator(\);) - - reserved(return) ident(out)operator(;) - preprocessor(#endif) -operator(}) - -comment(/************************ -EventMachine_t::AttachFD -************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(AttachFD) operator(()pre_type(int) ident(fd)operator(,) pre_type(bool) ident(notify_readable)operator(,) pre_type(bool) ident(notify_writable)operator(\)) -operator({) - preprocessor(#ifdef) ident(OS_UNIX) - reserved(if) operator(()ident(fcntl)operator(()ident(fd)operator(,) ident(F_GETFL)operator(,) integer(0)operator(\)) operator(<) integer(0)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) - - preprocessor(#ifdef) ident(OS_WIN32) - comment(// TODO: add better check for invalid file descriptors (see ioctlsocket or getsockopt\)) - reserved(if) operator(()ident(fd) operator(==) ident(INVALID_SOCKET)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) - - operator({)comment(// Check for duplicate descriptors) - ident(size_t) ident(i)operator(;) - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(Descriptors)operator(.)ident(size)operator((\);) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) ident(Descriptors)operator([)ident(i)operator(];) - ident(assert) operator(()ident(ed)operator(\);) - reserved(if) operator(()ident(ed)operator(->)ident(GetSocket)operator((\)) operator(==) ident(fd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - operator(}) - - reserved(for) operator(()ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(NewDescriptors)operator(.)ident(size)operator((\);) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) ident(NewDescriptors)operator([)ident(i)operator(];) - ident(assert) operator(()ident(ed)operator(\);) - reserved(if) operator(()ident(ed)operator(->)ident(GetSocket)operator((\)) operator(==) ident(fd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - operator(}) - operator(}) - - ident(ConnectionDescriptor) operator(*)ident(cd) operator(=) reserved(new) ident(ConnectionDescriptor) operator(()ident(fd)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(cd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - ident(cd)operator(->)ident(SetConnectPending) operator(()pre_constant(true)operator(\);) - ident(cd)operator(->)ident(SetNotifyReadable) operator(()ident(notify_readable)operator(\);) - ident(cd)operator(->)ident(SetNotifyWritable) operator(()ident(notify_writable)operator(\);) - - ident(Add) operator(()ident(cd)operator(\);) - - directive(const) pre_type(char) operator(*)ident(out) operator(=) pre_constant(NULL)operator(;) - ident(out) operator(=) ident(cd)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - reserved(if) operator(()ident(out) operator(==) pre_constant(NULL)operator(\)) - ident(closesocket) operator(()ident(fd)operator(\);) - reserved(return) ident(out)operator(;) -operator(}) - -comment(/************************ -EventMachine_t::DetachFD -************************/) - -pre_type(int) ident(EventMachine_t)operator(::)ident(DetachFD) operator(()ident(EventableDescriptor) operator(*)ident(ed)operator(\)) -operator({) - reserved(if) operator((!)ident(ed)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - preprocessor(#ifdef) ident(HAVE_EPOLL) - reserved(if) operator(()ident(bEpoll)operator(\)) operator({) - reserved(if) operator(()ident(ed)operator(->)ident(GetSocket)operator((\)) operator(!=) ident(INVALID_SOCKET)operator(\)) operator({) - ident(assert) operator(()ident(bEpoll)operator(\);) comment(// wouldn't be in this method otherwise.) - ident(assert) operator(()ident(epfd) operator(!=) operator(-)integer(1)operator(\);) - pre_type(int) ident(e) operator(=) ident(epoll_ctl) operator(()ident(epfd)operator(,) ident(EPOLL_CTL_DEL)operator(,) ident(ed)operator(->)ident(GetSocket)operator((\),) ident(ed)operator(->)ident(GetEpollEvent)operator((\)\);) - comment(// ENOENT or EBADF are not errors because the socket may be already closed when we get here.) - reserved(if) operator(()ident(e) operator(&&) operator(()ident(errno) operator(!=) ident(ENOENT)operator(\)) operator(&&) operator(()ident(errno) operator(!=) ident(EBADF)operator(\)\)) operator({) - pre_type(char) ident(buf) operator([)integer(200)operator(];) - ident(snprintf) operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\)-)integer(1)operator(,) stringoperator(,) ident(strerror)operator(()ident(errno)operator(\)\);) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()ident(buf)operator(\);) - operator(}) - operator(}) - operator(}) - preprocessor(#endif) - - preprocessor(#ifdef) ident(HAVE_KQUEUE) - reserved(if) operator(()ident(bKqueue)operator(\)) operator({) - reserved(struct) ident(kevent) ident(k)operator(;) - ident(EV_SET) operator((&)ident(k)operator(,) ident(ed)operator(->)ident(GetSocket)operator((\),) ident(EVFILT_READ)operator(,) ident(EV_DELETE)operator(,) integer(0)operator(,) integer(0)operator(,) ident(ed)operator(\);) - pre_type(int) ident(t) operator(=) ident(kevent) operator(()ident(kqfd)operator(,) operator(&)ident(k)operator(,) integer(1)operator(,) pre_constant(NULL)operator(,) integer(0)operator(,) pre_constant(NULL)operator(\);) - ident(assert) operator(()ident(t) operator(==) integer(0)operator(\);) - operator(}) - preprocessor(#endif) - - operator({) comment(// remove descriptor from lists) - pre_type(int) ident(i)operator(,) ident(j)operator(;) - pre_type(int) ident(nSockets) operator(=) ident(Descriptors)operator(.)ident(size)operator((\);) - reserved(for) operator(()ident(i)operator(=)integer(0)operator(,) ident(j)operator(=)integer(0)operator(;) ident(i) operator(<) ident(nSockets)operator(;) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ted) operator(=) ident(Descriptors)operator([)ident(i)operator(];) - ident(assert) operator(()ident(ted)operator(\);) - reserved(if) operator(()ident(ted) operator(!=) ident(ed)operator(\)) - ident(Descriptors) operator([)ident(j)operator(++]) operator(=) ident(ted)operator(;) - operator(}) - reserved(while) operator((()ident(size_t)operator(\))ident(j) operator(<) ident(Descriptors)operator(.)ident(size)operator((\)\)) - ident(Descriptors)operator(.)ident(pop_back)operator((\);) - - ident(ModifiedDescriptors)operator(.)ident(erase) operator(()ident(ed)operator(\);) - operator(}) - - pre_type(int) ident(fd) operator(=) ident(ed)operator(->)ident(GetSocket)operator((\);) - - comment(// We depend on ~EventableDescriptor not calling close(\) if the socket is invalid) - ident(ed)operator(->)ident(SetSocketInvalid)operator((\);) - reserved(delete) ident(ed)operator(;) - - reserved(return) ident(fd)operator(;) -operator(}) - -comment(/************ -name2address -************/) - -reserved(struct) ident(sockaddr) operator(*)ident(name2address) operator(()directive(const) pre_type(char) operator(*)ident(server)operator(,) pre_type(int) ident(port)operator(,) pre_type(int) operator(*)ident(family)operator(,) pre_type(int) operator(*)ident(bind_size)operator(\)) -operator({) - comment(// THIS IS NOT RE-ENTRANT OR THREADSAFE. Optimize for speed.) - comment(// Check the more-common cases first.) - comment(// Return NULL if no resolution.) - - directive(static) reserved(struct) ident(sockaddr_in) ident(in4)operator(;) - preprocessor(#ifndef) ident(__CYGWIN__) - directive(static) reserved(struct) ident(sockaddr_in6) ident(in6)operator(;) - preprocessor(#endif) - reserved(struct) ident(hostent) operator(*)ident(hp)operator(;) - - reserved(if) operator((!)ident(server) operator(||) operator(!*)ident(server)operator(\)) - ident(server) operator(=) stringoperator(;) - - ident(memset) operator((&)ident(in4)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(in4)operator(\)\);) - reserved(if) operator(() operator(()ident(in4)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(=) ident(inet_addr) operator(()ident(server)operator(\)\)) operator(!=) ident(INADDR_NONE)operator(\)) operator({) - reserved(if) operator(()ident(family)operator(\)) - operator(*)ident(family) operator(=) ident(AF_INET)operator(;) - reserved(if) operator(()ident(bind_size)operator(\)) - operator(*)ident(bind_size) operator(=) reserved(sizeof)operator(()ident(in4)operator(\);) - ident(in4)operator(.)ident(sin_family) operator(=) ident(AF_INET)operator(;) - ident(in4)operator(.)ident(sin_port) operator(=) ident(htons) operator(()ident(port)operator(\);) - reserved(return) operator(()reserved(struct) ident(sockaddr)operator(*\)&)ident(in4)operator(;) - operator(}) - - preprocessor(#if) ident(defined)operator(()ident(OS_UNIX)operator(\)) operator(&&) operator(!)ident(defined)operator(()ident(__CYGWIN__)operator(\)) - ident(memset) operator((&)ident(in6)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(in6)operator(\)\);) - reserved(if) operator(()ident(inet_pton) operator(()ident(AF_INET6)operator(,) ident(server)operator(,) ident(in6)operator(.)ident(sin6_addr)operator(.)ident(s6_addr)operator(\)) operator(>) integer(0)operator(\)) operator({) - reserved(if) operator(()ident(family)operator(\)) - operator(*)ident(family) operator(=) ident(AF_INET6)operator(;) - reserved(if) operator(()ident(bind_size)operator(\)) - operator(*)ident(bind_size) operator(=) reserved(sizeof)operator(()ident(in6)operator(\);) - ident(in6)operator(.)ident(sin6_family) operator(=) ident(AF_INET6)operator(;) - ident(in6)operator(.)ident(sin6_port) operator(=) ident(htons) operator(()ident(port)operator(\);) - reserved(return) operator(()reserved(struct) ident(sockaddr)operator(*\)&)ident(in6)operator(;) - operator(}) - preprocessor(#endif) - - preprocessor(#ifdef) ident(OS_WIN32) - comment(// TODO, must complete this branch. Windows doesn't have inet_pton.) - comment(// A possible approach is to make a getaddrinfo call with the supplied) - comment(// server address, constraining the hints to ipv6 and seeing if we) - comment(// get any addresses.) - comment(// For the time being, Ipv6 addresses aren't supported on Windows.) - preprocessor(#endif) - - ident(hp) operator(=) ident(gethostbyname) operator((()pre_type(char)operator(*\))ident(server)operator(\);) comment(// Windows requires the cast.) - reserved(if) operator(()ident(hp)operator(\)) operator({) - ident(in4)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(=) operator((()ident(in_addr)operator(*\)()ident(hp)operator(->)ident(h_addr)operator(\)\)->)ident(s_addr)operator(;) - reserved(if) operator(()ident(family)operator(\)) - operator(*)ident(family) operator(=) ident(AF_INET)operator(;) - reserved(if) operator(()ident(bind_size)operator(\)) - operator(*)ident(bind_size) operator(=) reserved(sizeof)operator(()ident(in4)operator(\);) - ident(in4)operator(.)ident(sin_family) operator(=) ident(AF_INET)operator(;) - ident(in4)operator(.)ident(sin_port) operator(=) ident(htons) operator(()ident(port)operator(\);) - reserved(return) operator(()reserved(struct) ident(sockaddr)operator(*\)&)ident(in4)operator(;) - operator(}) - - reserved(return) pre_constant(NULL)operator(;) -operator(}) - - -comment(/******************************* -EventMachine_t::CreateTcpServer -*******************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(CreateTcpServer) operator(()directive(const) pre_type(char) operator(*)ident(server)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - comment(/* Create a TCP-acceptor (server\) socket and add it to the event machine. - * Return the binding of the new acceptor to the caller. - * This binding will be referenced when the new acceptor sends events - * to indicate accepted connections. - */) - - - pre_type(int) ident(family)operator(,) ident(bind_size)operator(;) - reserved(struct) ident(sockaddr) operator(*)ident(bind_here) operator(=) ident(name2address) operator(()ident(server)operator(,) ident(port)operator(,) operator(&)ident(family)operator(,) operator(&)ident(bind_size)operator(\);) - reserved(if) operator((!)ident(bind_here)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - - directive(const) pre_type(char) operator(*)ident(output_binding) operator(=) pre_constant(NULL)operator(;) - - comment(//struct sockaddr_in sin;) - - pre_type(int) ident(sd_accept) operator(=) ident(socket) operator(()ident(family)operator(,) ident(SOCK_STREAM)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(sd_accept) operator(==) ident(INVALID_SOCKET)operator(\)) operator({) - reserved(goto) ident(fail)operator(;) - operator(}) - - comment(/* - memset (&sin, 0, sizeof(sin\)\); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = INADDR_ANY; - sin.sin_port = htons (port\); - - if (server && *server\) { - sin.sin_addr.s_addr = inet_addr (server\); - if (sin.sin_addr.s_addr == INADDR_NONE\) { - hostent *hp = gethostbyname ((char*\)server\); // Windows requires the cast. - if (hp == NULL\) { - //__warning ("hostname not resolved: ", server\); - goto fail; - } - sin.sin_addr.s_addr = ((in_addr*\)(hp->h_addr\)\)->s_addr; - } - } - */) - - operator({) comment(// set reuseaddr to improve performance on restarts.) - pre_type(int) ident(oval) operator(=) integer(1)operator(;) - reserved(if) operator(()ident(setsockopt) operator(()ident(sd_accept)operator(,) ident(SOL_SOCKET)operator(,) ident(SO_REUSEADDR)operator(,) operator(()pre_type(char)operator(*\)&)ident(oval)operator(,) reserved(sizeof)operator(()ident(oval)operator(\)\)) operator(<) integer(0)operator(\)) operator({) - comment(//__warning ("setsockopt failed while creating listener",""\);) - reserved(goto) ident(fail)operator(;) - operator(}) - operator(}) - - operator({) comment(// set CLOEXEC. Only makes sense on Unix) - preprocessor(#ifdef) ident(OS_UNIX) - pre_type(int) ident(cloexec) operator(=) ident(fcntl) operator(()ident(sd_accept)operator(,) ident(F_GETFD)operator(,) integer(0)operator(\);) - ident(assert) operator(()ident(cloexec) operator(>=) integer(0)operator(\);) - ident(cloexec) operator(|=) ident(FD_CLOEXEC)operator(;) - ident(fcntl) operator(()ident(sd_accept)operator(,) ident(F_SETFD)operator(,) ident(cloexec)operator(\);) - preprocessor(#endif) - operator(}) - - - comment(//if (bind (sd_accept, (struct sockaddr*\)&sin, sizeof(sin\)\)\) {) - reserved(if) operator(()ident(bind) operator(()ident(sd_accept)operator(,) ident(bind_here)operator(,) ident(bind_size)operator(\)\)) operator({) - comment(//__warning ("binding failed"\);) - reserved(goto) ident(fail)operator(;) - operator(}) - - reserved(if) operator(()ident(listen) operator(()ident(sd_accept)operator(,) integer(100)operator(\)\)) operator({) - comment(//__warning ("listen failed"\);) - reserved(goto) ident(fail)operator(;) - operator(}) - - operator({) - comment(// Set the acceptor non-blocking.) - comment(// THIS IS CRUCIALLY IMPORTANT because we read it in a select loop.) - reserved(if) operator((!)ident(SetSocketNonblocking) operator(()ident(sd_accept)operator(\)\)) operator({) - comment(//int val = fcntl (sd_accept, F_GETFL, 0\);) - comment(//if (fcntl (sd_accept, F_SETFL, val | O_NONBLOCK\) == -1\) {) - reserved(goto) ident(fail)operator(;) - operator(}) - operator(}) - - operator({) comment(// Looking good.) - ident(AcceptorDescriptor) operator(*)ident(ad) operator(=) reserved(new) ident(AcceptorDescriptor) operator(()ident(sd_accept)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(ad)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(Add) operator(()ident(ad)operator(\);) - ident(output_binding) operator(=) ident(ad)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - operator(}) - - reserved(return) ident(output_binding)operator(;) - - label(fail:) - reserved(if) operator(()ident(sd_accept) operator(!=) ident(INVALID_SOCKET)operator(\)) - ident(closesocket) operator(()ident(sd_accept)operator(\);) - reserved(return) pre_constant(NULL)operator(;) -operator(}) - - -comment(/********************************** -EventMachine_t::OpenDatagramSocket -**********************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(OpenDatagramSocket) operator(()directive(const) pre_type(char) operator(*)ident(address)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - directive(const) pre_type(char) operator(*)ident(output_binding) operator(=) pre_constant(NULL)operator(;) - - pre_type(int) ident(sd) operator(=) ident(socket) operator(()ident(AF_INET)operator(,) ident(SOCK_DGRAM)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(sd) operator(==) ident(INVALID_SOCKET)operator(\)) - reserved(goto) ident(fail)operator(;) - comment(// from here on, early returns must close the socket!) - - - reserved(struct) ident(sockaddr_in) ident(sin)operator(;) - ident(memset) operator((&)ident(sin)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(sin)operator(\)\);) - ident(sin)operator(.)ident(sin_family) operator(=) ident(AF_INET)operator(;) - ident(sin)operator(.)ident(sin_port) operator(=) ident(htons) operator(()ident(port)operator(\);) - - - reserved(if) operator(()ident(address) operator(&&) operator(*)ident(address)operator(\)) operator({) - ident(sin)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(=) ident(inet_addr) operator(()ident(address)operator(\);) - reserved(if) operator(()ident(sin)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(==) ident(INADDR_NONE)operator(\)) operator({) - ident(hostent) operator(*)ident(hp) operator(=) ident(gethostbyname) operator((()pre_type(char)operator(*\))ident(address)operator(\);) comment(// Windows requires the cast.) - reserved(if) operator(()ident(hp) operator(==) pre_constant(NULL)operator(\)) - reserved(goto) ident(fail)operator(;) - ident(sin)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(=) operator((()ident(in_addr)operator(*\)()ident(hp)operator(->)ident(h_addr)operator(\)\)->)ident(s_addr)operator(;) - operator(}) - operator(}) - reserved(else) - ident(sin)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(=) ident(htonl) operator(()ident(INADDR_ANY)operator(\);) - - - comment(// Set the new socket nonblocking.) - operator({) - reserved(if) operator((!)ident(SetSocketNonblocking) operator(()ident(sd)operator(\)\)) - comment(//int val = fcntl (sd, F_GETFL, 0\);) - comment(//if (fcntl (sd, F_SETFL, val | O_NONBLOCK\) == -1\)) - reserved(goto) ident(fail)operator(;) - operator(}) - - reserved(if) operator(()ident(bind) operator(()ident(sd)operator(,) operator(()reserved(struct) ident(sockaddr)operator(*\)&)ident(sin)operator(,) reserved(sizeof)operator(()ident(sin)operator(\)\)) operator(!=) integer(0)operator(\)) - reserved(goto) ident(fail)operator(;) - - operator({) comment(// Looking good.) - ident(DatagramDescriptor) operator(*)ident(ds) operator(=) reserved(new) ident(DatagramDescriptor) operator(()ident(sd)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(ds)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(Add) operator(()ident(ds)operator(\);) - ident(output_binding) operator(=) ident(ds)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - operator(}) - - reserved(return) ident(output_binding)operator(;) - - label(fail:) - reserved(if) operator(()ident(sd) operator(!=) ident(INVALID_SOCKET)operator(\)) - ident(closesocket) operator(()ident(sd)operator(\);) - reserved(return) pre_constant(NULL)operator(;) -operator(}) - - - -comment(/******************* -EventMachine_t::Add -*******************/) - -directive(void) ident(EventMachine_t)operator(::)ident(Add) operator(()ident(EventableDescriptor) operator(*)ident(ed)operator(\)) -operator({) - reserved(if) operator((!)ident(ed)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(ed)operator(->)ident(SetEventCallback) operator(()ident(EventCallback)operator(\);) - ident(NewDescriptors)operator(.)ident(push_back) operator(()ident(ed)operator(\);) -operator(}) - - -comment(/******************************* -EventMachine_t::ArmKqueueWriter -*******************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(ArmKqueueWriter) operator(()ident(EventableDescriptor) operator(*)ident(ed)operator(\)) -operator({) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - reserved(if) operator(()ident(bKqueue)operator(\)) operator({) - reserved(if) operator((!)ident(ed)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - reserved(struct) ident(kevent) ident(k)operator(;) - ident(EV_SET) operator((&)ident(k)operator(,) ident(ed)operator(->)ident(GetSocket)operator((\),) ident(EVFILT_WRITE)operator(,) ident(EV_ADD) operator(|) ident(EV_ONESHOT)operator(,) integer(0)operator(,) integer(0)operator(,) ident(ed)operator(\);) - pre_type(int) ident(t) operator(=) ident(kevent) operator(()ident(kqfd)operator(,) operator(&)ident(k)operator(,) integer(1)operator(,) pre_constant(NULL)operator(,) integer(0)operator(,) pre_constant(NULL)operator(\);) - ident(assert) operator(()ident(t) operator(==) integer(0)operator(\);) - operator(}) - preprocessor(#endif) -operator(}) - -comment(/******************************* -EventMachine_t::ArmKqueueReader -*******************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(ArmKqueueReader) operator(()ident(EventableDescriptor) operator(*)ident(ed)operator(\)) -operator({) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - reserved(if) operator(()ident(bKqueue)operator(\)) operator({) - reserved(if) operator((!)ident(ed)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - reserved(struct) ident(kevent) ident(k)operator(;) - ident(EV_SET) operator((&)ident(k)operator(,) ident(ed)operator(->)ident(GetSocket)operator((\),) ident(EVFILT_READ)operator(,) ident(EV_ADD)operator(,) integer(0)operator(,) integer(0)operator(,) ident(ed)operator(\);) - pre_type(int) ident(t) operator(=) ident(kevent) operator(()ident(kqfd)operator(,) operator(&)ident(k)operator(,) integer(1)operator(,) pre_constant(NULL)operator(,) integer(0)operator(,) pre_constant(NULL)operator(\);) - ident(assert) operator(()ident(t) operator(==) integer(0)operator(\);) - operator(}) - preprocessor(#endif) -operator(}) - -comment(/********************************** -EventMachine_t::_AddNewDescriptors -**********************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(_AddNewDescriptors)operator((\)) -operator({) - comment(/* Avoid adding descriptors to the main descriptor list - * while we're actually traversing the list. - * Any descriptors that are added as a result of processing timers - * or acceptors should go on a temporary queue and then added - * while we're not traversing the main list. - * Also, it (rarely\) happens that a newly-created descriptor - * is immediately scheduled to close. It might be a good - * idea not to bother scheduling these for I/O but if - * we do that, we might bypass some important processing. - */) - - reserved(for) operator(()ident(size_t) ident(i) operator(=) integer(0)operator(;) ident(i) operator(<) ident(NewDescriptors)operator(.)ident(size)operator((\);) ident(i)operator(++\)) operator({) - ident(EventableDescriptor) operator(*)ident(ed) operator(=) ident(NewDescriptors)operator([)ident(i)operator(];) - reserved(if) operator(()ident(ed) operator(==) pre_constant(NULL)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - preprocessor(#if) ident(HAVE_EPOLL) - reserved(if) operator(()ident(bEpoll)operator(\)) operator({) - ident(assert) operator(()ident(epfd) operator(!=) operator(-)integer(1)operator(\);) - pre_type(int) ident(e) operator(=) ident(epoll_ctl) operator(()ident(epfd)operator(,) ident(EPOLL_CTL_ADD)operator(,) ident(ed)operator(->)ident(GetSocket)operator((\),) ident(ed)operator(->)ident(GetEpollEvent)operator((\)\);) - reserved(if) operator(()ident(e)operator(\)) operator({) - pre_type(char) ident(buf) operator([)integer(200)operator(];) - ident(snprintf) operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\)-)integer(1)operator(,) stringoperator(,) ident(strerror)operator(()ident(errno)operator(\)\);) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()ident(buf)operator(\);) - operator(}) - operator(}) - preprocessor(#endif) - - preprocessor(#if) ident(HAVE_KQUEUE) - comment(/* - if (bKqueue\) { - // INCOMPLETE. Some descriptors don't want to be readable. - assert (kqfd != -1\); - struct kevent k; - EV_SET (&k, ed->GetSocket(\), EVFILT_READ, EV_ADD, 0, 0, ed\); - int t = kevent (kqfd, &k, 1, NULL, 0, NULL\); - assert (t == 0\); - } - */) - preprocessor(#endif) - - ident(Descriptors)operator(.)ident(push_back) operator(()ident(ed)operator(\);) - operator(}) - ident(NewDescriptors)operator(.)ident(clear)operator((\);) -operator(}) - - -comment(/********************************** -EventMachine_t::_ModifyDescriptors -**********************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(_ModifyDescriptors)operator((\)) -operator({) - comment(/* For implementations which don't level check every descriptor on - * every pass through the machine, as select does. - * If we're not selecting, then descriptors need a way to signal to the - * machine that their readable or writable status has changed. - * That's what the ::Modify call is for. We do it this way to avoid - * modifying descriptors during the loop traversal, where it can easily - * happen that an object (like a UDP socket\) gets data written on it by - * the application during #post_init. That would take place BEFORE the - * descriptor even gets added to the epoll descriptor, so the modify - * operation will crash messily. - * Another really messy possibility is for a descriptor to put itself - * on the Modified list, and then get deleted before we get here. - * Remember, deletes happen after the I/O traversal and before the - * next pass through here. So we have to make sure when we delete a - * descriptor to remove it from the Modified list. - */) - - preprocessor(#ifdef) ident(HAVE_EPOLL) - reserved(if) operator(()ident(bEpoll)operator(\)) operator({) - ident(set)operator(<)ident(EventableDescriptor)operator(*>::)ident(iterator) ident(i) operator(=) ident(ModifiedDescriptors)operator(.)ident(begin)operator((\);) - reserved(while) operator(()ident(i) operator(!=) ident(ModifiedDescriptors)operator(.)ident(end)operator((\)\)) operator({) - ident(assert) operator((*)ident(i)operator(\);) - ident(_ModifyEpollEvent) operator((*)ident(i)operator(\);) - operator(++)ident(i)operator(;) - operator(}) - operator(}) - preprocessor(#endif) - - ident(ModifiedDescriptors)operator(.)ident(clear)operator((\);) -operator(}) - - -comment(/********************** -EventMachine_t::Modify -**********************/) - -directive(void) ident(EventMachine_t)operator(::)ident(Modify) operator(()ident(EventableDescriptor) operator(*)ident(ed)operator(\)) -operator({) - reserved(if) operator((!)ident(ed)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(ModifiedDescriptors)operator(.)ident(insert) operator(()ident(ed)operator(\);) -operator(}) - - -comment(/*********************************** -EventMachine_t::_OpenFileForWriting -***********************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(_OpenFileForWriting) operator(()directive(const) pre_type(char) operator(*)ident(filename)operator(\)) -operator({) - comment(/* - * Return the binding-text of the newly-opened file, - * or NULL if there was a problem. - */) - - reserved(if) operator((!)ident(filename) operator(||) operator(!*)ident(filename)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - - pre_type(int) ident(fd) operator(=) ident(open) operator(()ident(filename)operator(,) ident(O_CREAT)operator(|)ident(O_TRUNC)operator(|)ident(O_WRONLY)operator(|)ident(O_NONBLOCK)operator(,) oct(0644)operator(\);) - - ident(FileStreamDescriptor) operator(*)ident(fsd) operator(=) reserved(new) ident(FileStreamDescriptor) operator(()ident(fd)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(fsd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(Add) operator(()ident(fsd)operator(\);) - reserved(return) ident(fsd)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - -operator(}) - - -comment(/************************************** -EventMachine_t::CreateUnixDomainServer -**************************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(CreateUnixDomainServer) operator(()directive(const) pre_type(char) operator(*)ident(filename)operator(\)) -operator({) - comment(/* Create a UNIX-domain acceptor (server\) socket and add it to the event machine. - * Return the binding of the new acceptor to the caller. - * This binding will be referenced when the new acceptor sends events - * to indicate accepted connections. - * THERE IS NO MEANINGFUL IMPLEMENTATION ON WINDOWS. - */) - - preprocessor(#ifdef) ident(OS_WIN32) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) - - comment(// The whole rest of this function is only compiled on Unix systems.) - preprocessor(#ifdef) ident(OS_UNIX) - directive(const) pre_type(char) operator(*)ident(output_binding) operator(=) pre_constant(NULL)operator(;) - - reserved(struct) ident(sockaddr_un) ident(s_sun)operator(;) - - pre_type(int) ident(sd_accept) operator(=) ident(socket) operator(()ident(AF_LOCAL)operator(,) ident(SOCK_STREAM)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(sd_accept) operator(==) ident(INVALID_SOCKET)operator(\)) operator({) - reserved(goto) ident(fail)operator(;) - operator(}) - - reserved(if) operator((!)ident(filename) operator(||) operator(!*)ident(filename)operator(\)) - reserved(goto) ident(fail)operator(;) - ident(unlink) operator(()ident(filename)operator(\);) - - ident(bzero) operator((&)ident(s_sun)operator(,) reserved(sizeof)operator(()ident(s_sun)operator(\)\);) - ident(s_sun)operator(.)ident(sun_family) operator(=) ident(AF_LOCAL)operator(;) - ident(strncpy) operator(()ident(s_sun)operator(.)ident(sun_path)operator(,) ident(filename)operator(,) reserved(sizeof)operator(()ident(s_sun)operator(.)ident(sun_path)operator(\)-)integer(1)operator(\);) - - comment(// don't bother with reuseaddr for a local socket.) - - operator({) comment(// set CLOEXEC. Only makes sense on Unix) - preprocessor(#ifdef) ident(OS_UNIX) - pre_type(int) ident(cloexec) operator(=) ident(fcntl) operator(()ident(sd_accept)operator(,) ident(F_GETFD)operator(,) integer(0)operator(\);) - ident(assert) operator(()ident(cloexec) operator(>=) integer(0)operator(\);) - ident(cloexec) operator(|=) ident(FD_CLOEXEC)operator(;) - ident(fcntl) operator(()ident(sd_accept)operator(,) ident(F_SETFD)operator(,) ident(cloexec)operator(\);) - preprocessor(#endif) - operator(}) - - reserved(if) operator(()ident(bind) operator(()ident(sd_accept)operator(,) operator(()reserved(struct) ident(sockaddr)operator(*\)&)ident(s_sun)operator(,) reserved(sizeof)operator(()ident(s_sun)operator(\)\)\)) operator({) - comment(//__warning ("binding failed"\);) - reserved(goto) ident(fail)operator(;) - operator(}) - - reserved(if) operator(()ident(listen) operator(()ident(sd_accept)operator(,) integer(100)operator(\)\)) operator({) - comment(//__warning ("listen failed"\);) - reserved(goto) ident(fail)operator(;) - operator(}) - - operator({) - comment(// Set the acceptor non-blocking.) - comment(// THIS IS CRUCIALLY IMPORTANT because we read it in a select loop.) - reserved(if) operator((!)ident(SetSocketNonblocking) operator(()ident(sd_accept)operator(\)\)) operator({) - comment(//int val = fcntl (sd_accept, F_GETFL, 0\);) - comment(//if (fcntl (sd_accept, F_SETFL, val | O_NONBLOCK\) == -1\) {) - reserved(goto) ident(fail)operator(;) - operator(}) - operator(}) - - operator({) comment(// Looking good.) - ident(AcceptorDescriptor) operator(*)ident(ad) operator(=) reserved(new) ident(AcceptorDescriptor) operator(()ident(sd_accept)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(ad)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(Add) operator(()ident(ad)operator(\);) - ident(output_binding) operator(=) ident(ad)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - operator(}) - - reserved(return) ident(output_binding)operator(;) - - label(fail:) - reserved(if) operator(()ident(sd_accept) operator(!=) ident(INVALID_SOCKET)operator(\)) - ident(closesocket) operator(()ident(sd_accept)operator(\);) - reserved(return) pre_constant(NULL)operator(;) - preprocessor(#endif) comment(// OS_UNIX) -operator(}) - - -comment(/********************* -EventMachine_t::Popen -*********************/) -preprocessor(#if) ident(OBSOLETE) -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(Popen) operator(()directive(const) pre_type(char) operator(*)ident(cmd)operator(,) directive(const) pre_type(char) operator(*)ident(mode)operator(\)) -operator({) - preprocessor(#ifdef) ident(OS_WIN32) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) - - comment(// The whole rest of this function is only compiled on Unix systems.) - comment(// Eventually we need this functionality (or a full-duplex equivalent\) on Windows.) - preprocessor(#ifdef) ident(OS_UNIX) - directive(const) pre_type(char) operator(*)ident(output_binding) operator(=) pre_constant(NULL)operator(;) - - ident(FILE) operator(*)ident(fp) operator(=) ident(popen) operator(()ident(cmd)operator(,) ident(mode)operator(\);) - reserved(if) operator((!)ident(fp)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - - comment(// From here, all early returns must pclose the stream.) - - comment(// According to the pipe(2\) manpage, descriptors returned from pipe have both) - comment(// CLOEXEC and NONBLOCK clear. Do NOT set CLOEXEC. DO set nonblocking.) - reserved(if) operator((!)ident(SetSocketNonblocking) operator(()ident(fileno) operator(()ident(fp)operator(\)\)\)) operator({) - ident(pclose) operator(()ident(fp)operator(\);) - reserved(return) pre_constant(NULL)operator(;) - operator(}) - - operator({) comment(// Looking good.) - ident(PipeDescriptor) operator(*)ident(pd) operator(=) reserved(new) ident(PipeDescriptor) operator(()ident(fp)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(pd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(Add) operator(()ident(pd)operator(\);) - ident(output_binding) operator(=) ident(pd)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - operator(}) - - reserved(return) ident(output_binding)operator(;) - preprocessor(#endif) -operator(}) -preprocessor(#endif) comment(// OBSOLETE) - -comment(/************************** -EventMachine_t::Socketpair -**************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(Socketpair) operator(()pre_type(char) operator(*) directive(const)operator(*)ident(cmd_strings)operator(\)) -operator({) - preprocessor(#ifdef) ident(OS_WIN32) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - preprocessor(#endif) - - comment(// The whole rest of this function is only compiled on Unix systems.) - comment(// Eventually we need this functionality (or a full-duplex equivalent\) on Windows.) - preprocessor(#ifdef) ident(OS_UNIX) - comment(// Make sure the incoming array of command strings is sane.) - reserved(if) operator((!)ident(cmd_strings)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - pre_type(int) ident(j)operator(;) - reserved(for) operator(()ident(j)operator(=)integer(0)operator(;) ident(j) operator(<) integer(100) operator(&&) ident(cmd_strings)operator([)ident(j)operator(];) ident(j)operator(++\)) - operator(;) - reserved(if) operator((()ident(j)operator(==)integer(0)operator(\)) operator(||) operator(()ident(j)operator(==)integer(100)operator(\)\)) - reserved(return) pre_constant(NULL)operator(;) - - directive(const) pre_type(char) operator(*)ident(output_binding) operator(=) pre_constant(NULL)operator(;) - - pre_type(int) ident(sv)operator([)integer(2)operator(];) - reserved(if) operator(()ident(socketpair) operator(()ident(AF_LOCAL)operator(,) ident(SOCK_STREAM)operator(,) integer(0)operator(,) ident(sv)operator(\)) operator(<) integer(0)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - comment(// from here, all early returns must close the pair of sockets.) - - comment(// Set the parent side of the socketpair nonblocking.) - comment(// We don't care about the child side, and most child processes will expect their) - comment(// stdout to be blocking. Thanks to Duane Johnson and Bill Kelly for pointing this out.) - comment(// Obviously DON'T set CLOEXEC.) - reserved(if) operator((!)ident(SetSocketNonblocking) operator(()ident(sv)operator([)integer(0)operator(]\)\)) operator({) - ident(close) operator(()ident(sv)operator([)integer(0)operator(]\);) - ident(close) operator(()ident(sv)operator([)integer(1)operator(]\);) - reserved(return) pre_constant(NULL)operator(;) - operator(}) - - ident(pid_t) ident(f) operator(=) ident(fork)operator((\);) - reserved(if) operator(()ident(f) operator(>) integer(0)operator(\)) operator({) - ident(close) operator(()ident(sv)operator([)integer(1)operator(]\);) - ident(PipeDescriptor) operator(*)ident(pd) operator(=) reserved(new) ident(PipeDescriptor) operator(()ident(sv)operator([)integer(0)operator(],) ident(f)operator(,) local_variable(this)operator(\);) - reserved(if) operator((!)ident(pd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(Add) operator(()ident(pd)operator(\);) - ident(output_binding) operator(=) ident(pd)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - operator(}) - reserved(else) reserved(if) operator(()ident(f) operator(==) integer(0)operator(\)) operator({) - ident(close) operator(()ident(sv)operator([)integer(0)operator(]\);) - ident(dup2) operator(()ident(sv)operator([)integer(1)operator(],) ident(STDIN_FILENO)operator(\);) - ident(close) operator(()ident(sv)operator([)integer(1)operator(]\);) - ident(dup2) operator(()ident(STDIN_FILENO)operator(,) ident(STDOUT_FILENO)operator(\);) - ident(execvp) operator(()ident(cmd_strings)operator([)integer(0)operator(],) ident(cmd_strings)operator(+)integer(1)operator(\);) - ident(exit) operator((-)integer(1)operator(\);) comment(// end the child process if the exec doesn't work.) - operator(}) - reserved(else) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - reserved(return) ident(output_binding)operator(;) - preprocessor(#endif) -operator(}) - - -comment(/**************************** -EventMachine_t::OpenKeyboard -****************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(OpenKeyboard)operator((\)) -operator({) - ident(KeyboardDescriptor) operator(*)ident(kd) operator(=) reserved(new) ident(KeyboardDescriptor) operator(()local_variable(this)operator(\);) - reserved(if) operator((!)ident(kd)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(Add) operator(()ident(kd)operator(\);) - reserved(return) ident(kd)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) -operator(}) - - - - - -comment(//#endif // OS_UNIX) - -comment(/***************************************************************************** - -$Id$ - -File: emwin.cpp -Date: 05May06 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - - -comment(// THIS ENTIRE FILE IS FOR WINDOWS BUILDS ONLY) -comment(// INCOMPLETE AND DISABLED FOR NOW.) -preprocessor(#ifdef) ident(xOS_WIN32) - -preprocessor(#include) include("project.h") - - -comment(// Keep a global variable floating around) -comment(// with the current loop time as set by the Event Machine.) -comment(// This avoids the need for frequent expensive calls to time(NULL\);) -ident(time_t) ident(gCurrentLoopTime)operator(;) - - -comment(/****************************** -EventMachine_t::EventMachine_t -******************************/) - -ident(EventMachine_t)operator(::)ident(EventMachine_t) operator(()directive(void) operator((*)ident(event_callback)operator(\)()directive(const) pre_type(char)operator(*,) pre_type(int)operator(,) directive(const) pre_type(char)operator(*,) pre_type(int)operator(\)\):) - ident(EventCallback) operator(()ident(event_callback)operator(\),) - ident(NextHeartbeatTime) operator(()integer(0)operator(\)) -operator({) - ident(gTerminateSignalReceived) operator(=) pre_constant(false)operator(;) - ident(Iocp) operator(=) pre_constant(NULL)operator(;) -operator(}) - - -comment(/******************************* -EventMachine_t::~EventMachine_t -*******************************/) - -ident(EventMachine_t)operator(::~)ident(EventMachine_t)operator((\)) -operator({) - ident(cerr) operator(<<) stringoperator(;) - reserved(if) operator(()ident(Iocp)operator(\)) - ident(CloseHandle) operator(()ident(Iocp)operator(\);) -operator(}) - - -comment(/**************************** -EventMachine_t::ScheduleHalt -****************************/) - -directive(void) ident(EventMachine_t)operator(::)ident(ScheduleHalt)operator((\)) -operator({) - comment(/* This is how we stop the machine. - * This can be called by clients. Signal handlers will probably - * set the global flag. - * For now this means there can only be one EventMachine ever running at a time. - */) - ident(gTerminateSignalReceived) operator(=) pre_constant(true)operator(;) -operator(}) - - - -comment(/******************* -EventMachine_t::Run -*******************/) - -directive(void) ident(EventMachine_t)operator(::)ident(Run)operator((\)) -operator({) - ident(HookControlC) operator(()pre_constant(true)operator(\);) - - ident(Iocp) operator(=) ident(CreateIoCompletionPort) operator(()ident(INVALID_HANDLE_VALUE)operator(,) pre_constant(NULL)operator(,) integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(Iocp) operator(==) pre_constant(NULL)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - - ident(DWORD) ident(nBytes)operator(,) ident(nCompletionKey)operator(;) - ident(LPOVERLAPPED) ident(Overlapped)operator(;) - - reserved(do) operator({) - ident(gCurrentLoopTime) operator(=) ident(time)operator(()pre_constant(NULL)operator(\);) - comment(// Have some kind of strategy that will dequeue maybe up to 10 completions ) - comment(// without running the timers as long as they are available immediately.) - comment(// Otherwise in a busy server we're calling them every time through the loop.) - reserved(if) operator((!)ident(_RunTimers)operator((\)\)) - reserved(break)operator(;) - reserved(if) operator(()ident(GetQueuedCompletionStatus) operator(()ident(Iocp)operator(,) operator(&)ident(nBytes)operator(,) operator(&)ident(nCompletionKey)operator(,) operator(&)ident(Overlapped)operator(,) integer(1000)operator(\)\)) operator({) - operator(}) - ident(cerr) operator(<<) stringoperator(;) - operator(}) reserved(while) operator((!)ident(gTerminateSignalReceived)operator(\);) - - - comment(/* - while (true\) { - gCurrentLoopTime = time(NULL\); - if (!_RunTimers(\)\) - break; - _AddNewDescriptors(\); - if (!_RunOnce(\)\) - break; - if (gTerminateSignalReceived\) - break; - } - */) - - ident(HookControlC) operator(()pre_constant(false)operator(\);) -operator(}) - - -comment(/************************** -EventMachine_t::_RunTimers -**************************/) - -pre_type(bool) ident(EventMachine_t)operator(::)ident(_RunTimers)operator((\)) -operator({) - comment(// These are caller-defined timer handlers.) - comment(// Return T/F to indicate whether we should continue the main loop.) - comment(// We rely on the fact that multimaps sort by their keys to avoid) - comment(// inspecting the whole list every time we come here.) - comment(// Just keep inspecting and processing the list head until we hit) - comment(// one that hasn't expired yet.) - - reserved(while) operator(()pre_constant(true)operator(\)) operator({) - ident(multimap)operator(<)ident(time_t)operator(,)ident(Timer_t)operator(>::)ident(iterator) ident(i) operator(=) ident(Timers)operator(.)ident(begin)operator((\);) - reserved(if) operator(()ident(i) operator(==) ident(Timers)operator(.)ident(end)operator((\)\)) - reserved(break)operator(;) - reserved(if) operator(()ident(i)operator(->)ident(first) operator(>) ident(gCurrentLoopTime)operator(\)) - reserved(break)operator(;) - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)) operator(()stringoperator(,) ident(EM_TIMER_FIRED)operator(,) ident(i)operator(->)ident(second)operator(.)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(i)operator(->)ident(second)operator(.)ident(GetBinding)operator((\))operator(.)ident(length)operator((\)\);) - ident(Timers)operator(.)ident(erase) operator(()ident(i)operator(\);) - operator(}) - reserved(return) pre_constant(true)operator(;) -operator(}) - - -comment(/*********************************** -EventMachine_t::InstallOneshotTimer -***********************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(InstallOneshotTimer) operator(()pre_type(int) ident(seconds)operator(\)) -operator({) - reserved(if) operator(()ident(Timers)operator(.)ident(size)operator((\)) operator(>) ident(MaxOutstandingTimers)operator(\)) - reserved(return) pre_constant(false)operator(;) - comment(// Don't use the global loop-time variable here, because we might) - comment(// get called before the main event machine is running.) - - ident(Timer_t) ident(t)operator(;) - ident(Timers)operator(.)ident(insert) operator(()ident(make_pair) operator(()ident(time)operator(()pre_constant(NULL)operator(\)) operator(+) ident(seconds)operator(,) ident(t)operator(\)\);) - reserved(return) ident(t)operator(.)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) -operator(}) - - -comment(/********************************** -EventMachine_t::OpenDatagramSocket -**********************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(OpenDatagramSocket) operator(()directive(const) pre_type(char) operator(*)ident(address)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - ident(cerr) operator(<<) stringoperator(;) - reserved(return) stringoperator(;) -operator(}) - - -comment(/******************************* -EventMachine_t::CreateTcpServer -*******************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(CreateTcpServer) operator(()directive(const) pre_type(char) operator(*)ident(server)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - comment(/* Create a TCP-acceptor (server\) socket and add it to the event machine. - * Return the binding of the new acceptor to the caller. - * This binding will be referenced when the new acceptor sends events - * to indicate accepted connections. - */) - - directive(const) pre_type(char) operator(*)ident(output_binding) operator(=) pre_constant(NULL)operator(;) - - reserved(struct) ident(sockaddr_in) ident(sin)operator(;) - - ident(SOCKET) ident(sd_accept) operator(=) ident(socket) operator(()ident(AF_INET)operator(,) ident(SOCK_STREAM)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(sd_accept) operator(==) ident(INVALID_SOCKET)operator(\)) operator({) - reserved(goto) ident(fail)operator(;) - operator(}) - - ident(memset) operator((&)ident(sin)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(sin)operator(\)\);) - ident(sin)operator(.)ident(sin_family) operator(=) ident(AF_INET)operator(;) - ident(sin)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(=) ident(INADDR_ANY)operator(;) - ident(sin)operator(.)ident(sin_port) operator(=) ident(htons) operator(()ident(port)operator(\);) - - reserved(if) operator(()ident(server) operator(&&) operator(*)ident(server)operator(\)) operator({) - ident(sin)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(=) ident(inet_addr) operator(()ident(server)operator(\);) - reserved(if) operator(()ident(sin)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(==) ident(INADDR_NONE)operator(\)) operator({) - ident(hostent) operator(*)ident(hp) operator(=) ident(gethostbyname) operator(()ident(server)operator(\);) - reserved(if) operator(()ident(hp) operator(==) pre_constant(NULL)operator(\)) operator({) - comment(//__warning ("hostname not resolved: ", server\);) - reserved(goto) ident(fail)operator(;) - operator(}) - ident(sin)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(=) operator((()ident(in_addr)operator(*\)()ident(hp)operator(->)ident(h_addr)operator(\)\)->)ident(s_addr)operator(;) - operator(}) - operator(}) - - - comment(// No need to set reuseaddr on Windows.) - - - reserved(if) operator(()ident(bind) operator(()ident(sd_accept)operator(,) operator(()reserved(struct) ident(sockaddr)operator(*\)&)ident(sin)operator(,) reserved(sizeof)operator(()ident(sin)operator(\)\)\)) operator({) - comment(//__warning ("binding failed"\);) - reserved(goto) ident(fail)operator(;) - operator(}) - - reserved(if) operator(()ident(listen) operator(()ident(sd_accept)operator(,) integer(100)operator(\)\)) operator({) - comment(//__warning ("listen failed"\);) - reserved(goto) ident(fail)operator(;) - operator(}) - - operator({) comment(// Looking good.) - ident(AcceptorDescriptor) operator(*)ident(ad) operator(=) reserved(new) ident(AcceptorDescriptor) operator(()local_variable(this)operator(,) ident(sd_accept)operator(\);) - reserved(if) operator((!)ident(ad)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(Add) operator(()ident(ad)operator(\);) - ident(output_binding) operator(=) ident(ad)operator(->)ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\);) - - ident(CreateIoCompletionPort) operator((()ident(HANDLE)operator(\))ident(sd_accept)operator(,) ident(Iocp)operator(,) pre_constant(NULL)operator(,) integer(0)operator(\);) - ident(SOCKET) ident(sd) operator(=) ident(socket) operator(()ident(AF_INET)operator(,) ident(SOCK_STREAM)operator(,) integer(0)operator(\);) - ident(CreateIoCompletionPort) operator((()ident(HANDLE)operator(\))ident(sd)operator(,) ident(Iocp)operator(,) pre_constant(NULL)operator(,) integer(0)operator(\);) - ident(AcceptEx) operator(()ident(sd_accept)operator(,) ident(sd)operator(,) - operator(}) - - reserved(return) ident(output_binding)operator(;) - - label(fail:) - reserved(if) operator(()ident(sd_accept) operator(!=) ident(INVALID_SOCKET)operator(\)) - ident(closesocket) operator(()ident(sd_accept)operator(\);) - reserved(return) pre_constant(NULL)operator(;) -operator(}) - - -comment(/******************************* -EventMachine_t::ConnectToServer -*******************************/) - -directive(const) pre_type(char) operator(*)ident(EventMachine_t)operator(::)ident(ConnectToServer) operator(()directive(const) pre_type(char) operator(*)ident(server)operator(,) pre_type(int) ident(port)operator(\)) -operator({) - reserved(if) operator((!)ident(server) operator(||) operator(!*)ident(server) operator(||) operator(!)ident(port)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - - ident(sockaddr_in) ident(pin)operator(;) - pre_type(unsigned) pre_type(long) ident(HostAddr)operator(;) - - ident(HostAddr) operator(=) ident(inet_addr) operator(()ident(server)operator(\);) - reserved(if) operator(()ident(HostAddr) operator(==) ident(INADDR_NONE)operator(\)) operator({) - ident(hostent) operator(*)ident(hp) operator(=) ident(gethostbyname) operator(()ident(server)operator(\);) - reserved(if) operator((!)ident(hp)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - ident(HostAddr) operator(=) operator((()ident(in_addr)operator(*\)()ident(hp)operator(->)ident(h_addr)operator(\)\)->)ident(s_addr)operator(;) - operator(}) - - ident(memset) operator((&)ident(pin)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(pin)operator(\)\);) - ident(pin)operator(.)ident(sin_family) operator(=) ident(AF_INET)operator(;) - ident(pin)operator(.)ident(sin_addr)operator(.)ident(s_addr) operator(=) ident(HostAddr)operator(;) - ident(pin)operator(.)ident(sin_port) operator(=) ident(htons) operator(()ident(port)operator(\);) - - pre_type(int) ident(sd) operator(=) ident(socket) operator(()ident(AF_INET)operator(,) ident(SOCK_STREAM)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(sd) operator(==) ident(INVALID_SOCKET)operator(\)) - reserved(return) pre_constant(NULL)operator(;) - - - ident(LPOVERLAPPED) ident(olap) operator(=) operator(()ident(LPOVERLAPPED)operator(\)) ident(calloc) operator(()integer(1)operator(,) reserved(sizeof) operator(()ident(OVERLAPPED)operator(\)\);) - ident(cerr) operator(<<) stringoperator(;) - reserved(throw) ident(runtime_error) operator(()stringoperator(\);) - -operator(}) - - - -comment(/******************* -EventMachine_t::Add -*******************/) - -directive(void) ident(EventMachine_t)operator(::)ident(Add) operator(()ident(EventableDescriptor) operator(*)ident(ed)operator(\)) -operator({) - ident(cerr) operator(<<) stringoperator(;) -operator(}) - - - -preprocessor(#endif) comment(// OS_WIN32) - -comment(/***************************************************************************** - -$Id$ - -File: epoll.cpp -Date: 06Jun07 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - - -preprocessor(#ifdef) ident(HAVE_EPOLL) - -preprocessor(#include) include("project.h") - -preprocessor(#endif) comment(// HAVE_EPOLL) - -comment(/***************************************************************************** - -$Id: mapper.cpp 4527 2007-07-04 10:21:34Z francis $ - -File: mapper.cpp -Date: 02Jul07 - -Copyright (C\) 2007 by Francis Cianfrocca. All Rights Reserved. -Gmail: garbagecat10 - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - - -comment(//////////////////////////////////////////////////////////////////////) -comment(// UNIX implementation) -comment(//////////////////////////////////////////////////////////////////////) - - -preprocessor(#ifdef) ident(OS_UNIX) - -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#include) include() -preprocessor(#include) include("unistd.h") -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -directive(using) reserved(namespace) ident(std)operator(;) - -preprocessor(#include) include("mapper.h") - -comment(/****************** -Mapper_t::Mapper_t -******************/) - -ident(Mapper_t)operator(::)ident(Mapper_t) operator(()directive(const) pre_type(string) operator(&)ident(filename)operator(\)) -operator({) - comment(/* We ASSUME we can open the file. - * (More precisely, we assume someone else checked before we got here.\) - */) - - ident(Fd) operator(=) ident(open) operator(()ident(filename)operator(.)ident(c_str)operator((\),) ident(O_RDONLY)operator(\);) - reserved(if) operator(()ident(Fd) operator(<) integer(0)operator(\)) - reserved(throw) ident(runtime_error) operator(()ident(strerror) operator(()ident(errno)operator(\)\);) - - reserved(struct) ident(stat) ident(st)operator(;) - reserved(if) operator(()ident(fstat) operator(()ident(Fd)operator(,) operator(&)ident(st)operator(\)\)) - reserved(throw) ident(runtime_error) operator(()ident(strerror) operator(()ident(errno)operator(\)\);) - ident(FileSize) operator(=) ident(st)operator(.)ident(st_size)operator(;) - - ident(MapPoint) operator(=) operator(()directive(const) pre_type(char)operator(*\)) ident(mmap) operator(()integer(0)operator(,) ident(FileSize)operator(,) ident(PROT_READ)operator(,) ident(MAP_SHARED)operator(,) ident(Fd)operator(,) integer(0)operator(\);) - reserved(if) operator(()ident(MapPoint) operator(==) ident(MAP_FAILED)operator(\)) - reserved(throw) ident(runtime_error) operator(()ident(strerror) operator(()ident(errno)operator(\)\);) -operator(}) - - -comment(/******************* -Mapper_t::~Mapper_t -*******************/) - -ident(Mapper_t)operator(::~)ident(Mapper_t)operator((\)) -operator({) - ident(Close)operator((\);) -operator(}) - - -comment(/*************** -Mapper_t::Close -***************/) - -directive(void) ident(Mapper_t)operator(::)ident(Close)operator((\)) -operator({) - comment(// Can be called multiple times.) - comment(// Calls to GetChunk are invalid after a call to Close.) - reserved(if) operator(()ident(MapPoint)operator(\)) operator({) - ident(munmap) operator((()directive(void)operator(*\))ident(MapPoint)operator(,) ident(FileSize)operator(\);) - ident(MapPoint) operator(=) pre_constant(NULL)operator(;) - operator(}) - reserved(if) operator(()ident(Fd) operator(>=) integer(0)operator(\)) operator({) - ident(close) operator(()ident(Fd)operator(\);) - ident(Fd) operator(=) operator(-)integer(1)operator(;) - operator(}) -operator(}) - -comment(/****************** -Mapper_t::GetChunk -******************/) - -directive(const) pre_type(char) operator(*)ident(Mapper_t)operator(::)ident(GetChunk) operator(()pre_type(unsigned) ident(start)operator(\)) -operator({) - reserved(return) ident(MapPoint) operator(+) ident(start)operator(;) -operator(}) - - - -preprocessor(#endif) comment(// OS_UNIX) - - -comment(//////////////////////////////////////////////////////////////////////) -comment(// WINDOWS implementation) -comment(//////////////////////////////////////////////////////////////////////) - -preprocessor(#ifdef) ident(OS_WIN32) - -preprocessor(#include) include() - -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -directive(using) reserved(namespace) ident(std)operator(;) - -preprocessor(#include) include("mapper.h") - -comment(/****************** -Mapper_t::Mapper_t -******************/) - -ident(Mapper_t)operator(::)ident(Mapper_t) operator(()directive(const) pre_type(string) operator(&)ident(filename)operator(\)) -operator({) - comment(/* We ASSUME we can open the file. - * (More precisely, we assume someone else checked before we got here.\) - */) - - ident(hFile) operator(=) ident(INVALID_HANDLE_VALUE)operator(;) - ident(hMapping) operator(=) pre_constant(NULL)operator(;) - ident(MapPoint) operator(=) pre_constant(NULL)operator(;) - ident(FileSize) operator(=) integer(0)operator(;) - - ident(hFile) operator(=) ident(CreateFile) operator(()ident(filename)operator(.)ident(c_str)operator((\),) ident(GENERIC_READ)operator(|)ident(GENERIC_WRITE)operator(,) ident(FILE_SHARE_DELETE)operator(|)ident(FILE_SHARE_READ)operator(|)ident(FILE_SHARE_WRITE)operator(,) pre_constant(NULL)operator(,) ident(OPEN_EXISTING)operator(,) ident(FILE_ATTRIBUTE_NORMAL)operator(,) pre_constant(NULL)operator(\);) - - reserved(if) operator(()ident(hFile) operator(==) ident(INVALID_HANDLE_VALUE)operator(\)) - reserved(throw) ident(runtime_error) operator(()stringoperator(\);) - - ident(BY_HANDLE_FILE_INFORMATION) ident(i)operator(;) - reserved(if) operator(()ident(GetFileInformationByHandle) operator(()ident(hFile)operator(,) operator(&)ident(i)operator(\)\)) - ident(FileSize) operator(=) ident(i)operator(.)ident(nFileSizeLow)operator(;) - - ident(hMapping) operator(=) ident(CreateFileMapping) operator(()ident(hFile)operator(,) pre_constant(NULL)operator(,) ident(PAGE_READWRITE)operator(,) integer(0)operator(,) integer(0)operator(,) pre_constant(NULL)operator(\);) - reserved(if) operator((!)ident(hMapping)operator(\)) - reserved(throw) ident(runtime_error) operator(()stringoperator(\);) - - ident(MapPoint) operator(=) operator(()directive(const) pre_type(char)operator(*\)) ident(MapViewOfFile) operator(()ident(hMapping)operator(,) ident(FILE_MAP_WRITE)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(\);) - reserved(if) operator((!)ident(MapPoint)operator(\)) - reserved(throw) ident(runtime_error) operator(()stringoperator(\);) -operator(}) - - -comment(/******************* -Mapper_t::~Mapper_t -*******************/) - -ident(Mapper_t)operator(::~)ident(Mapper_t)operator((\)) -operator({) - ident(Close)operator((\);) -operator(}) - -comment(/*************** -Mapper_t::Close -***************/) - -directive(void) ident(Mapper_t)operator(::)ident(Close)operator((\)) -operator({) - comment(// Can be called multiple times.) - comment(// Calls to GetChunk are invalid after a call to Close.) - reserved(if) operator(()ident(MapPoint)operator(\)) operator({) - ident(UnmapViewOfFile) operator(()ident(MapPoint)operator(\);) - ident(MapPoint) operator(=) pre_constant(NULL)operator(;) - operator(}) - reserved(if) operator(()ident(hMapping) operator(!=) pre_constant(NULL)operator(\)) operator({) - ident(CloseHandle) operator(()ident(hMapping)operator(\);) - ident(hMapping) operator(=) pre_constant(NULL)operator(;) - operator(}) - reserved(if) operator(()ident(hFile) operator(!=) ident(INVALID_HANDLE_VALUE)operator(\)) operator({) - ident(CloseHandle) operator(()ident(hFile)operator(\);) - ident(hMapping) operator(=) ident(INVALID_HANDLE_VALUE)operator(;) - operator(}) -operator(}) - - -comment(/****************** -Mapper_t::GetChunk -******************/) - -directive(const) pre_type(char) operator(*)ident(Mapper_t)operator(::)ident(GetChunk) operator(()pre_type(unsigned) ident(start)operator(\)) -operator({) - reserved(return) ident(MapPoint) operator(+) ident(start)operator(;) -operator(}) - - - -preprocessor(#endif) comment(// OS_WINDOWS) -comment(/***************************************************************************** - -$Id: rubymain.cpp 4529 2007-07-04 11:32:22Z francis $ - -File: rubymain.cpp -Date: 02Jul07 - -Copyright (C\) 2007 by Francis Cianfrocca. All Rights Reserved. -Gmail: garbagecat10 - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - - - -preprocessor(#include) include() -preprocessor(#include) include() -directive(using) reserved(namespace) ident(std)operator(;) - -preprocessor(#include) include() -preprocessor(#include) include("mapper.h") - -directive(static) ident(VALUE) ident(EmModule)operator(;) -directive(static) ident(VALUE) ident(FastFileReader)operator(;) -directive(static) ident(VALUE) ident(Mapper)operator(;) - - - -comment(/********* -mapper_dt -*********/) - -directive(static) directive(void) ident(mapper_dt) operator(()directive(void) operator(*)ident(ptr)operator(\)) -operator({) - reserved(if) operator(()ident(ptr)operator(\)) - reserved(delete) operator(()ident(Mapper_t)operator(*\)) ident(ptr)operator(;) -operator(}) - -comment(/********** -mapper_new -**********/) - -directive(static) ident(VALUE) ident(mapper_new) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(filename)operator(\)) -operator({) - ident(Mapper_t) operator(*)ident(m) operator(=) reserved(new) ident(Mapper_t) operator(()ident(StringValuePtr) operator(()ident(filename)operator(\)\);) - reserved(if) operator((!)ident(m)operator(\)) - ident(rb_raise) operator(()ident(rb_eException)operator(,) stringoperator(\);) - ident(VALUE) ident(v) operator(=) ident(Data_Wrap_Struct) operator(()ident(Mapper)operator(,) integer(0)operator(,) ident(mapper_dt)operator(,) operator(()directive(void)operator(*\))ident(m)operator(\);) - reserved(return) ident(v)operator(;) -operator(}) - - -comment(/**************** -mapper_get_chunk -****************/) - -directive(static) ident(VALUE) ident(mapper_get_chunk) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(start)operator(,) ident(VALUE) ident(length)operator(\)) -operator({) - ident(Mapper_t) operator(*)ident(m) operator(=) pre_constant(NULL)operator(;) - ident(Data_Get_Struct) operator(()ident(self)operator(,) ident(Mapper_t)operator(,) ident(m)operator(\);) - reserved(if) operator((!)ident(m)operator(\)) - ident(rb_raise) operator(()ident(rb_eException)operator(,) stringoperator(\);) - - comment(// TODO, what if some moron sends us a negative start value?) - pre_type(unsigned) ident(_start) operator(=) ident(NUM2INT) operator(()ident(start)operator(\);) - pre_type(unsigned) ident(_length) operator(=) ident(NUM2INT) operator(()ident(length)operator(\);) - reserved(if) operator((()ident(_start) operator(+) ident(_length)operator(\)) operator(>) ident(m)operator(->)ident(GetFileSize)operator((\)\)) - ident(rb_raise) operator(()ident(rb_eException)operator(,) stringoperator(\);) - - directive(const) pre_type(char) operator(*)ident(chunk) operator(=) ident(m)operator(->)ident(GetChunk) operator(()ident(_start)operator(\);) - reserved(if) operator((!)ident(chunk)operator(\)) - ident(rb_raise) operator(()ident(rb_eException)operator(,) stringoperator(\);) - reserved(return) ident(rb_str_new) operator(()ident(chunk)operator(,) ident(_length)operator(\);) -operator(}) - -comment(/************ -mapper_close -************/) - -directive(static) ident(VALUE) ident(mapper_close) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - ident(Mapper_t) operator(*)ident(m) operator(=) pre_constant(NULL)operator(;) - ident(Data_Get_Struct) operator(()ident(self)operator(,) ident(Mapper_t)operator(,) ident(m)operator(\);) - reserved(if) operator((!)ident(m)operator(\)) - ident(rb_raise) operator(()ident(rb_eException)operator(,) stringoperator(\);) - ident(m)operator(->)ident(Close)operator((\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/*********** -mapper_size -***********/) - -directive(static) ident(VALUE) ident(mapper_size) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - ident(Mapper_t) operator(*)ident(m) operator(=) pre_constant(NULL)operator(;) - ident(Data_Get_Struct) operator(()ident(self)operator(,) ident(Mapper_t)operator(,) ident(m)operator(\);) - reserved(if) operator((!)ident(m)operator(\)) - ident(rb_raise) operator(()ident(rb_eException)operator(,) stringoperator(\);) - reserved(return) ident(INT2NUM) operator(()ident(m)operator(->)ident(GetFileSize)operator((\)\);) -operator(}) - - -comment(/********************** -Init_fastfilereaderext -**********************/) - -directive(extern) string directive(void) ident(Init_fastfilereaderext)operator((\)) -operator({) - ident(EmModule) operator(=) ident(rb_define_module) operator(()stringoperator(\);) - ident(FastFileReader) operator(=) ident(rb_define_class_under) operator(()ident(EmModule)operator(,) stringoperator(,) ident(rb_cObject)operator(\);) - ident(Mapper) operator(=) ident(rb_define_class_under) operator(()ident(FastFileReader)operator(,) stringoperator(,) ident(rb_cObject)operator(\);) - - ident(rb_define_module_function) operator(()ident(Mapper)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(mapper_new)operator(,) integer(1)operator(\);) - ident(rb_define_method) operator(()ident(Mapper)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(mapper_size)operator(,) integer(0)operator(\);) - ident(rb_define_method) operator(()ident(Mapper)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(mapper_close)operator(,) integer(0)operator(\);) - ident(rb_define_method) operator(()ident(Mapper)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(mapper_get_chunk)operator(,) integer(2)operator(\);) -operator(}) - - - -comment(/***************************************************************************** - -$Id$ - -File: files.cpp -Date: 26Aug06 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - -preprocessor(#include) include("project.h") - - -comment(/****************************************** -FileStreamDescriptor::FileStreamDescriptor -******************************************/) - -ident(FileStreamDescriptor)operator(::)ident(FileStreamDescriptor) operator(()pre_type(int) ident(fd)operator(,) ident(EventMachine_t) operator(*)ident(em)operator(\):) - ident(EventableDescriptor) operator(()ident(fd)operator(,) ident(em)operator(\),) - ident(OutboundDataSize) operator(()integer(0)operator(\)) -operator({) -ident(cerr) operator(<<) stringoperator(;) -operator(}) - - -comment(/******************************************* -FileStreamDescriptor::~FileStreamDescriptor -*******************************************/) - -ident(FileStreamDescriptor)operator(::~)ident(FileStreamDescriptor)operator((\)) -operator({) - comment(// Run down any stranded outbound data.) - reserved(for) operator(()ident(size_t) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(OutboundPages)operator(.)ident(size)operator((\);) ident(i)operator(++\)) - ident(OutboundPages)operator([)ident(i)operator(])operator(.)ident(Free)operator((\);) -operator(}) - - -comment(/************************** -FileStreamDescriptor::Read -**************************/) - -directive(void) ident(FileStreamDescriptor)operator(::)ident(Read)operator((\)) -operator({) -operator(}) - -comment(/*************************** -FileStreamDescriptor::Write -***************************/) - -directive(void) ident(FileStreamDescriptor)operator(::)ident(Write)operator((\)) -operator({) -operator(}) - - -comment(/******************************* -FileStreamDescriptor::Heartbeat -*******************************/) - -directive(void) ident(FileStreamDescriptor)operator(::)ident(Heartbeat)operator((\)) -operator({) -operator(}) - - -comment(/*********************************** -FileStreamDescriptor::SelectForRead -***********************************/) - -pre_type(bool) ident(FileStreamDescriptor)operator(::)ident(SelectForRead)operator((\)) -operator({) - ident(cerr) operator(<<) stringoperator(;) - reserved(return) pre_constant(false)operator(;) -operator(}) - - -comment(/************************************ -FileStreamDescriptor::SelectForWrite -************************************/) - -pre_type(bool) ident(FileStreamDescriptor)operator(::)ident(SelectForWrite)operator((\)) -operator({) - ident(cerr) operator(<<) stringoperator(;) - reserved(return) pre_constant(false)operator(;) -operator(}) - - -comment(/***************************************************************************** - -$Id$ - -File: kb.cpp -Date: 24Aug07 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - -preprocessor(#include) include("project.h") - - -comment(/************************************** -KeyboardDescriptor::KeyboardDescriptor -**************************************/) - -ident(KeyboardDescriptor)operator(::)ident(KeyboardDescriptor) operator(()ident(EventMachine_t) operator(*)ident(parent_em)operator(\):) - ident(EventableDescriptor) operator(()integer(0)operator(,) ident(parent_em)operator(\),) - ident(bReadAttemptedAfterClose) operator(()pre_constant(false)operator(\),) - ident(LastIo) operator(()ident(gCurrentLoopTime)operator(\),) - ident(InactivityTimeout) operator(()integer(0)operator(\)) -operator({) - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) ident(EPOLLIN)operator(;) - preprocessor(#endif) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - ident(MyEventMachine)operator(->)ident(ArmKqueueReader) operator(()local_variable(this)operator(\);) - preprocessor(#endif) -operator(}) - - -comment(/*************************************** -KeyboardDescriptor::~KeyboardDescriptor -***************************************/) - -ident(KeyboardDescriptor)operator(::~)ident(KeyboardDescriptor)operator((\)) -operator({) -operator(}) - - -comment(/************************* -KeyboardDescriptor::Write -*************************/) - -directive(void) ident(KeyboardDescriptor)operator(::)ident(Write)operator((\)) -operator({) - comment(// Why are we here?) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) -operator(}) - - -comment(/***************************** -KeyboardDescriptor::Heartbeat -*****************************/) - -directive(void) ident(KeyboardDescriptor)operator(::)ident(Heartbeat)operator((\)) -operator({) - comment(// no-op) -operator(}) - - -comment(/************************ -KeyboardDescriptor::Read -************************/) - -directive(void) ident(KeyboardDescriptor)operator(::)ident(Read)operator((\)) -operator({) - pre_type(char) ident(c)operator(;) - ident(read) operator(()ident(GetSocket)operator((\),) operator(&)ident(c)operator(,) integer(1)operator(\);) - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)()ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(EM_CONNECTION_READ)operator(,) operator(&)ident(c)operator(,) integer(1)operator(\);) -operator(}) - - - - -comment(#if 0 -/****************************** -PipeDescriptor::PipeDescriptor -******************************/ - -PipeDescriptor::PipeDescriptor (int fd, pid_t subpid, EventMachine_t *parent_em\): - EventableDescriptor (fd, parent_em\), - bReadAttemptedAfterClose (false\), - LastIo (gCurrentLoopTime\), - InactivityTimeout (0\), - OutboundDataSize (0\), - SubprocessPid (subpid\) -{ - #ifdef HAVE_EPOLL - EpollEvent.events = EPOLLIN; - #endif -} - - -/******************************* -PipeDescriptor::~PipeDescriptor -*******************************/ - -PipeDescriptor::~PipeDescriptor(\) -{ - // Run down any stranded outbound data. - for (size_t i=0; i < OutboundPages.size(\); i++\) - OutboundPages[i].Free(\); - - /* As a virtual destructor, we come here before the base-class - * destructor that closes our file-descriptor. - * We have to make sure the subprocess goes down (if it's not - * already down\) and we have to reap the zombie. - * - * This implementation is PROVISIONAL and will surely be improved. - * The intention here is that we never block, hence the highly - * undesirable sleeps. But if we can't reap the subprocess even - * after sending it SIGKILL, then something is wrong and we - * throw a fatal exception, which is also not something we should - * be doing. - * - * Eventually the right thing to do will be to have the reactor - * core respond to SIGCHLD by chaining a handler on top of the - * one Ruby may have installed, and dealing with a list of dead - * children that are pending cleanup. - * - * Since we want to have a signal processor integrated into the - * client-visible API, let's wait until that is done before cleaning - * this up. - */ - - struct timespec req = {0, 10000000}; - kill (SubprocessPid, SIGTERM\); - nanosleep (&req, NULL\); - if (waitpid (SubprocessPid, NULL, WNOHANG\) == 0\) { - kill (SubprocessPid, SIGKILL\); - nanosleep (&req, NULL\); - if (waitpid (SubprocessPid, NULL, WNOHANG\) == 0\) - throw std::runtime_error ("unable to reap subprocess"\); - } -} - - - -/******************** -PipeDescriptor::Read -********************/ - -void PipeDescriptor::Read(\) -{ - int sd = GetSocket(\); - if (sd == INVALID_SOCKET\) { - assert (!bReadAttemptedAfterClose\); - bReadAttemptedAfterClose = true; - return; - } - - LastIo = gCurrentLoopTime; - - int total_bytes_read = 0; - char readbuffer [16 * 1024]; - - for (int i=0; i < 10; i++\) { - // Don't read just one buffer and then move on. This is faster - // if there is a lot of incoming. - // But don't read indefinitely. Give other sockets a chance to run. - // NOTICE, we're reading one less than the buffer size. - // That's so we can put a guard byte at the end of what we send - // to user code. - // Use read instead of recv, which on Linux gives a "socket operation - // on nonsocket" error. - - - int r = read (sd, readbuffer, sizeof(readbuffer\) - 1\); - //cerr << ""; - - if (r > 0\) { - total_bytes_read += r; - LastRead = gCurrentLoopTime; - - // Add a null-terminator at the the end of the buffer - // that we will send to the callback. - // DO NOT EVER CHANGE THIS. We want to explicitly allow users - // to be able to depend on this behavior, so they will have - // the option to do some things faster. Additionally it's - // a security guard against buffer overflows. - readbuffer [r] = 0; - if (EventCallback\) - (*EventCallback\)(GetBinding(\).c_str(\), EM_CONNECTION_READ, readbuffer, r\); - } - else if (r == 0\) { - break; - } - else { - // Basically a would-block, meaning we've read everything there is to read. - break; - } - - } - - - if (total_bytes_read == 0\) { - // If we read no data on a socket that selected readable, - // it generally means the other end closed the connection gracefully. - ScheduleClose (false\); - //bCloseNow = true; - } - -} - -/********************* -PipeDescriptor::Write -*********************/ - -void PipeDescriptor::Write(\) -{ - int sd = GetSocket(\); - assert (sd != INVALID_SOCKET\); - - LastIo = gCurrentLoopTime; - char output_buffer [16 * 1024]; - size_t nbytes = 0; - - while ((OutboundPages.size(\) > 0\) && (nbytes < sizeof(output_buffer\)\)\) { - OutboundPage *op = &(OutboundPages[0]\); - if ((nbytes + op->Length - op->Offset\) < sizeof (output_buffer\)\) { - memcpy (output_buffer + nbytes, op->Buffer + op->Offset, op->Length - op->Offset\); - nbytes += (op->Length - op->Offset\); - op->Free(\); - OutboundPages.pop_front(\); - } - else { - int len = sizeof(output_buffer\) - nbytes; - memcpy (output_buffer + nbytes, op->Buffer + op->Offset, len\); - op->Offset += len; - nbytes += len; - } - } - - // We should never have gotten here if there were no data to write, - // so assert that as a sanity check. - // Don't bother to make sure nbytes is less than output_buffer because - // if it were we probably would have crashed already. - assert (nbytes > 0\); - - assert (GetSocket(\) != INVALID_SOCKET\); - int bytes_written = write (GetSocket(\), output_buffer, nbytes\); - - if (bytes_written > 0\) { - OutboundDataSize -= bytes_written; - if ((size_t\)bytes_written < nbytes\) { - int len = nbytes - bytes_written; - char *buffer = (char*\) malloc (len + 1\); - if (!buffer\) - throw std::runtime_error ("bad alloc throwing back data"\); - memcpy (buffer, output_buffer + bytes_written, len\); - buffer [len] = 0; - OutboundPages.push_front (OutboundPage (buffer, len\)\); - } - #ifdef HAVE_EPOLL - EpollEvent.events = (EPOLLIN | (SelectForWrite(\) ? EPOLLOUT : 0\)\); - assert (MyEventMachine\); - MyEventMachine->Modify (this\); - #endif - } - else { - #ifdef OS_UNIX - if ((errno != EINPROGRESS\) && (errno != EWOULDBLOCK\) && (errno != EINTR\)\) - #endif - #ifdef OS_WIN32 - if ((errno != WSAEINPROGRESS\) && (errno != WSAEWOULDBLOCK\)\) - #endif - Close(\); - } -} - - -/************************* -PipeDescriptor::Heartbeat -*************************/ - -void PipeDescriptor::Heartbeat(\) -{ - // If an inactivity timeout is defined, then check for it. - if (InactivityTimeout && ((gCurrentLoopTime - LastIo\) >= InactivityTimeout\)\) - ScheduleClose (false\); - //bCloseNow = true; -} - - -/***************************** -PipeDescriptor::SelectForRead -*****************************/ - -bool PipeDescriptor::SelectForRead(\) -{ - /* Pipe descriptors, being local by definition, don't have - * a pending state, so this is simpler than for the - * ConnectionDescriptor object. - */ - return true; -} - -/****************************** -PipeDescriptor::SelectForWrite -******************************/ - -bool PipeDescriptor::SelectForWrite(\) -{ - /* Pipe descriptors, being local by definition, don't have - * a pending state, so this is simpler than for the - * ConnectionDescriptor object. - */ - return (GetOutboundDataSize(\) > 0\); -} - - - - -/******************************** -PipeDescriptor::SendOutboundData -********************************/ - -int PipeDescriptor::SendOutboundData (const char *data, int length\) -{ - //if (bCloseNow || bCloseAfterWriting\) - if (IsCloseScheduled(\)\) - return 0; - - if (!data && (length > 0\)\) - throw std::runtime_error ("bad outbound data"\); - char *buffer = (char *\) malloc (length + 1\); - if (!buffer\) - throw std::runtime_error ("no allocation for outbound data"\); - memcpy (buffer, data, length\); - buffer [length] = 0; - OutboundPages.push_back (OutboundPage (buffer, length\)\); - OutboundDataSize += length; - #ifdef HAVE_EPOLL - EpollEvent.events = (EPOLLIN | EPOLLOUT\); - assert (MyEventMachine\); - MyEventMachine->Modify (this\); - #endif - return length; -} - -/******************************** -PipeDescriptor::GetSubprocessPid -********************************/ - -bool PipeDescriptor::GetSubprocessPid (pid_t *pid\) -{ - bool ok = false; - if (pid && (SubprocessPid > 0\)\) { - *pid = SubprocessPid; - ok = true; - } - return ok; -} - -#endif ) - -comment(/***************************************************************************** - -$Id$ - -File: page.cpp -Date: 30Apr06 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - - -preprocessor(#include) include("project.h") - - -comment(/****************** -PageList::PageList -******************/) - -ident(PageList)operator(::)ident(PageList)operator((\)) -operator({) -operator(}) - - -comment(/******************* -PageList::~PageList -*******************/) - -ident(PageList)operator(::~)ident(PageList)operator((\)) -operator({) - reserved(while) operator(()ident(HasPages)operator((\)\)) - ident(PopFront)operator((\);) -operator(}) - - -comment(/*************** -PageList::Front -***************/) - -directive(void) ident(PageList)operator(::)ident(Front) operator(()directive(const) pre_type(char) operator(**)ident(page)operator(,) pre_type(int) operator(*)ident(length)operator(\)) -operator({) - ident(assert) operator(()ident(page) operator(&&) ident(length)operator(\);) - - reserved(if) operator(()ident(HasPages)operator((\)\)) operator({) - ident(Page) ident(p) operator(=) ident(Pages)operator(.)ident(front)operator((\);) - operator(*)ident(page) operator(=) ident(p)operator(.)ident(Buffer)operator(;) - operator(*)ident(length) operator(=) ident(p)operator(.)ident(Size)operator(;) - operator(}) - reserved(else) operator({) - operator(*)ident(page) operator(=) pre_constant(NULL)operator(;) - operator(*)ident(length) operator(=) integer(0)operator(;) - operator(}) -operator(}) - - -comment(/****************** -PageList::PopFront -******************/) - -directive(void) ident(PageList)operator(::)ident(PopFront)operator((\)) -operator({) - reserved(if) operator(()ident(HasPages)operator((\)\)) operator({) - ident(Page) ident(p) operator(=) ident(Pages)operator(.)ident(front)operator((\);) - ident(Pages)operator(.)ident(pop_front)operator((\);) - reserved(if) operator(()ident(p)operator(.)ident(Buffer)operator(\)) - ident(free) operator((()directive(void)operator(*\))ident(p)operator(.)ident(Buffer)operator(\);) - operator(}) -operator(}) - - -comment(/****************** -PageList::HasPages -******************/) - -pre_type(bool) ident(PageList)operator(::)ident(HasPages)operator((\)) -operator({) - reserved(return) operator(()ident(Pages)operator(.)ident(size)operator((\)) operator(>) integer(0)operator(\)) operator(?) pre_constant(true) operator(:) pre_constant(false)operator(;) -operator(}) - - -comment(/************** -PageList::Push -**************/) - -directive(void) ident(PageList)operator(::)ident(Push) operator(()directive(const) pre_type(char) operator(*)ident(buf)operator(,) pre_type(int) ident(size)operator(\)) -operator({) - reserved(if) operator(()ident(buf) operator(&&) operator(()ident(size) operator(>) integer(0)operator(\)\)) operator({) - pre_type(char) operator(*)ident(copy) operator(=) operator(()pre_type(char)operator(*\)) ident(malloc) operator(()ident(size)operator(\);) - reserved(if) operator((!)ident(copy)operator(\)) - reserved(throw) ident(runtime_error) operator(()stringoperator(\);) - ident(memcpy) operator(()ident(copy)operator(,) ident(buf)operator(,) ident(size)operator(\);) - ident(Pages)operator(.)ident(push_back) operator(()ident(Page) operator(()ident(copy)operator(,) ident(size)operator(\)\);) - operator(}) -operator(}) - - - - - -comment(/***************************************************************************** - -$Id$ - -File: pipe.cpp -Date: 30May07 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - -preprocessor(#include) include("project.h") - - -preprocessor(#ifdef) ident(OS_UNIX) -comment(// THIS ENTIRE FILE IS ONLY COMPILED ON UNIX-LIKE SYSTEMS.) - -comment(/****************************** -PipeDescriptor::PipeDescriptor -******************************/) - -ident(PipeDescriptor)operator(::)ident(PipeDescriptor) operator(()pre_type(int) ident(fd)operator(,) ident(pid_t) ident(subpid)operator(,) ident(EventMachine_t) operator(*)ident(parent_em)operator(\):) - ident(EventableDescriptor) operator(()ident(fd)operator(,) ident(parent_em)operator(\),) - ident(bReadAttemptedAfterClose) operator(()pre_constant(false)operator(\),) - ident(LastIo) operator(()ident(gCurrentLoopTime)operator(\),) - ident(InactivityTimeout) operator(()integer(0)operator(\),) - ident(OutboundDataSize) operator(()integer(0)operator(\),) - ident(SubprocessPid) operator(()ident(subpid)operator(\)) -operator({) - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) ident(EPOLLIN)operator(;) - preprocessor(#endif) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - ident(MyEventMachine)operator(->)ident(ArmKqueueReader) operator(()local_variable(this)operator(\);) - preprocessor(#endif) -operator(}) - - -comment(/******************************* -PipeDescriptor::~PipeDescriptor -*******************************/) - -ident(PipeDescriptor)operator(::~)ident(PipeDescriptor)operator((\)) -operator({) - comment(// Run down any stranded outbound data.) - reserved(for) operator(()ident(size_t) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(OutboundPages)operator(.)ident(size)operator((\);) ident(i)operator(++\)) - ident(OutboundPages)operator([)ident(i)operator(])operator(.)ident(Free)operator((\);) - - comment(/* As a virtual destructor, we come here before the base-class - * destructor that closes our file-descriptor. - * We have to make sure the subprocess goes down (if it's not - * already down\) and we have to reap the zombie. - * - * This implementation is PROVISIONAL and will surely be improved. - * The intention here is that we never block, hence the highly - * undesirable sleeps. But if we can't reap the subprocess even - * after sending it SIGKILL, then something is wrong and we - * throw a fatal exception, which is also not something we should - * be doing. - * - * Eventually the right thing to do will be to have the reactor - * core respond to SIGCHLD by chaining a handler on top of the - * one Ruby may have installed, and dealing with a list of dead - * children that are pending cleanup. - * - * Since we want to have a signal processor integrated into the - * client-visible API, let's wait until that is done before cleaning - * this up. - * - * Added a very ugly hack to support passing the subprocess's exit - * status to the user. It only makes logical sense for user code to access - * the subprocess exit status in the unbind callback. But unbind is called - * back during the EventableDescriptor destructor. So by that time there's - * no way to call back this object through an object binding, because it's - * already been cleaned up. We might have added a parameter to the unbind - * callback, but that would probably break a huge amount of existing code. - * So the hack-solution is to define an instance variable in the EventMachine - * object and stick the exit status in there, where it can easily be accessed - * with an accessor visible to user code. - * User code should ONLY access the exit status from within the unbind callback. - * Otherwise there's no guarantee it'll be valid. - * This hack won't make it impossible to run multiple EventMachines in a single - * process, but it will make it impossible to reliably nest unbind calls - * within other unbind calls. (Not sure if that's even possible.\) - */) - - ident(assert) operator(()ident(MyEventMachine)operator(\);) - - comment(// check if the process is already dead) - reserved(if) operator(()ident(waitpid) operator(()ident(SubprocessPid)operator(,) operator(&()ident(MyEventMachine)operator(->)ident(SubprocessExitStatus)operator(\),) ident(WNOHANG)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(kill) operator(()ident(SubprocessPid)operator(,) ident(SIGTERM)operator(\);) - comment(// wait 0.25s for process to die) - reserved(struct) ident(timespec) ident(req) operator(=) operator({)integer(0)operator(,) integer(250000000)operator(};) - ident(nanosleep) operator((&)ident(req)operator(,) pre_constant(NULL)operator(\);) - reserved(if) operator(()ident(waitpid) operator(()ident(SubprocessPid)operator(,) operator(&()ident(MyEventMachine)operator(->)ident(SubprocessExitStatus)operator(\),) ident(WNOHANG)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(kill) operator(()ident(SubprocessPid)operator(,) ident(SIGKILL)operator(\);) - comment(// wait 0.5s for process to die) - reserved(struct) ident(timespec) ident(req) operator(=) operator({)integer(0)operator(,) integer(500000000)operator(};) - ident(nanosleep) operator((&)ident(req)operator(,) pre_constant(NULL)operator(\);) - reserved(if) operator(()ident(waitpid) operator(()ident(SubprocessPid)operator(,) operator(&()ident(MyEventMachine)operator(->)ident(SubprocessExitStatus)operator(\),) ident(WNOHANG)operator(\)) operator(==) integer(0)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - operator(}) - operator(}) -operator(}) - - - -comment(/******************** -PipeDescriptor::Read -********************/) - -directive(void) ident(PipeDescriptor)operator(::)ident(Read)operator((\)) -operator({) - pre_type(int) ident(sd) operator(=) ident(GetSocket)operator((\);) - reserved(if) operator(()ident(sd) operator(==) ident(INVALID_SOCKET)operator(\)) operator({) - ident(assert) operator((!)ident(bReadAttemptedAfterClose)operator(\);) - ident(bReadAttemptedAfterClose) operator(=) pre_constant(true)operator(;) - reserved(return)operator(;) - operator(}) - - ident(LastIo) operator(=) ident(gCurrentLoopTime)operator(;) - - pre_type(int) ident(total_bytes_read) operator(=) integer(0)operator(;) - pre_type(char) ident(readbuffer) operator([)integer(16) operator(*) integer(1024)operator(];) - - reserved(for) operator(()pre_type(int) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) integer(10)operator(;) ident(i)operator(++\)) operator({) - comment(// Don't read just one buffer and then move on. This is faster) - comment(// if there is a lot of incoming.) - comment(// But don't read indefinitely. Give other sockets a chance to run.) - comment(// NOTICE, we're reading one less than the buffer size.) - comment(// That's so we can put a guard byte at the end of what we send) - comment(// to user code.) - comment(// Use read instead of recv, which on Linux gives a "socket operation) - comment(// on nonsocket" error.) - - - pre_type(int) ident(r) operator(=) ident(read) operator(()ident(sd)operator(,) ident(readbuffer)operator(,) reserved(sizeof)operator(()ident(readbuffer)operator(\)) operator(-) integer(1)operator(\);) - comment(//cerr << "";) - - reserved(if) operator(()ident(r) operator(>) integer(0)operator(\)) operator({) - ident(total_bytes_read) operator(+=) ident(r)operator(;) - ident(LastRead) operator(=) ident(gCurrentLoopTime)operator(;) - - comment(// Add a null-terminator at the the end of the buffer) - comment(// that we will send to the callback.) - comment(// DO NOT EVER CHANGE THIS. We want to explicitly allow users) - comment(// to be able to depend on this behavior, so they will have) - comment(// the option to do some things faster. Additionally it's) - comment(// a security guard against buffer overflows.) - ident(readbuffer) operator([)ident(r)operator(]) operator(=) integer(0)operator(;) - reserved(if) operator(()ident(EventCallback)operator(\)) - operator((*)ident(EventCallback)operator(\)()ident(GetBinding)operator((\))operator(.)ident(c_str)operator((\),) ident(EM_CONNECTION_READ)operator(,) ident(readbuffer)operator(,) ident(r)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(r) operator(==) integer(0)operator(\)) operator({) - reserved(break)operator(;) - operator(}) - reserved(else) operator({) - comment(// Basically a would-block, meaning we've read everything there is to read.) - reserved(break)operator(;) - operator(}) - - operator(}) - - - reserved(if) operator(()ident(total_bytes_read) operator(==) integer(0)operator(\)) operator({) - comment(// If we read no data on a socket that selected readable,) - comment(// it generally means the other end closed the connection gracefully.) - ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - comment(//bCloseNow = true;) - operator(}) - -operator(}) - -comment(/********************* -PipeDescriptor::Write -*********************/) - -directive(void) ident(PipeDescriptor)operator(::)ident(Write)operator((\)) -operator({) - pre_type(int) ident(sd) operator(=) ident(GetSocket)operator((\);) - ident(assert) operator(()ident(sd) operator(!=) ident(INVALID_SOCKET)operator(\);) - - ident(LastIo) operator(=) ident(gCurrentLoopTime)operator(;) - pre_type(char) ident(output_buffer) operator([)integer(16) operator(*) integer(1024)operator(];) - ident(size_t) ident(nbytes) operator(=) integer(0)operator(;) - - reserved(while) operator((()ident(OutboundPages)operator(.)ident(size)operator((\)) operator(>) integer(0)operator(\)) operator(&&) operator(()ident(nbytes) operator(<) reserved(sizeof)operator(()ident(output_buffer)operator(\)\)\)) operator({) - ident(OutboundPage) operator(*)ident(op) operator(=) operator(&()ident(OutboundPages)operator([)integer(0)operator(]\);) - reserved(if) operator((()ident(nbytes) operator(+) ident(op)operator(->)ident(Length) operator(-) ident(op)operator(->)ident(Offset)operator(\)) operator(<) reserved(sizeof) operator(()ident(output_buffer)operator(\)\)) operator({) - ident(memcpy) operator(()ident(output_buffer) operator(+) ident(nbytes)operator(,) ident(op)operator(->)ident(Buffer) operator(+) ident(op)operator(->)ident(Offset)operator(,) ident(op)operator(->)ident(Length) operator(-) ident(op)operator(->)ident(Offset)operator(\);) - ident(nbytes) operator(+=) operator(()ident(op)operator(->)ident(Length) operator(-) ident(op)operator(->)ident(Offset)operator(\);) - ident(op)operator(->)ident(Free)operator((\);) - ident(OutboundPages)operator(.)ident(pop_front)operator((\);) - operator(}) - reserved(else) operator({) - pre_type(int) ident(len) operator(=) reserved(sizeof)operator(()ident(output_buffer)operator(\)) operator(-) ident(nbytes)operator(;) - ident(memcpy) operator(()ident(output_buffer) operator(+) ident(nbytes)operator(,) ident(op)operator(->)ident(Buffer) operator(+) ident(op)operator(->)ident(Offset)operator(,) ident(len)operator(\);) - ident(op)operator(->)ident(Offset) operator(+=) ident(len)operator(;) - ident(nbytes) operator(+=) ident(len)operator(;) - operator(}) - operator(}) - - comment(// We should never have gotten here if there were no data to write,) - comment(// so assert that as a sanity check.) - comment(// Don't bother to make sure nbytes is less than output_buffer because) - comment(// if it were we probably would have crashed already.) - ident(assert) operator(()ident(nbytes) operator(>) integer(0)operator(\);) - - ident(assert) operator(()ident(GetSocket)operator((\)) operator(!=) ident(INVALID_SOCKET)operator(\);) - pre_type(int) ident(bytes_written) operator(=) ident(write) operator(()ident(GetSocket)operator((\),) ident(output_buffer)operator(,) ident(nbytes)operator(\);) - - reserved(if) operator(()ident(bytes_written) operator(>) integer(0)operator(\)) operator({) - ident(OutboundDataSize) operator(-=) ident(bytes_written)operator(;) - reserved(if) operator((()ident(size_t)operator(\))ident(bytes_written) operator(<) ident(nbytes)operator(\)) operator({) - pre_type(int) ident(len) operator(=) ident(nbytes) operator(-) ident(bytes_written)operator(;) - pre_type(char) operator(*)ident(buffer) operator(=) operator(()pre_type(char)operator(*\)) ident(malloc) operator(()ident(len) operator(+) integer(1)operator(\);) - reserved(if) operator((!)ident(buffer)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(memcpy) operator(()ident(buffer)operator(,) ident(output_buffer) operator(+) ident(bytes_written)operator(,) ident(len)operator(\);) - ident(buffer) operator([)ident(len)operator(]) operator(=) integer(0)operator(;) - ident(OutboundPages)operator(.)ident(push_front) operator(()ident(OutboundPage) operator(()ident(buffer)operator(,) ident(len)operator(\)\);) - operator(}) - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) operator(()ident(EPOLLIN) operator(|) operator(()ident(SelectForWrite)operator((\)) operator(?) ident(EPOLLOUT) operator(:) integer(0)operator(\)\);) - ident(assert) operator(()ident(MyEventMachine)operator(\);) - ident(MyEventMachine)operator(->)ident(Modify) operator(()local_variable(this)operator(\);) - preprocessor(#endif) - operator(}) - reserved(else) operator({) - preprocessor(#ifdef) ident(OS_UNIX) - reserved(if) operator((()ident(errno) operator(!=) ident(EINPROGRESS)operator(\)) operator(&&) operator(()ident(errno) operator(!=) ident(EWOULDBLOCK)operator(\)) operator(&&) operator(()ident(errno) operator(!=) ident(EINTR)operator(\)\)) - preprocessor(#endif) - preprocessor(#ifdef) ident(OS_WIN32) - reserved(if) operator((()ident(errno) operator(!=) ident(WSAEINPROGRESS)operator(\)) operator(&&) operator(()ident(errno) operator(!=) ident(WSAEWOULDBLOCK)operator(\)\)) - preprocessor(#endif) - ident(Close)operator((\);) - operator(}) -operator(}) - - -comment(/************************* -PipeDescriptor::Heartbeat -*************************/) - -directive(void) ident(PipeDescriptor)operator(::)ident(Heartbeat)operator((\)) -operator({) - comment(// If an inactivity timeout is defined, then check for it.) - reserved(if) operator(()ident(InactivityTimeout) operator(&&) operator((()ident(gCurrentLoopTime) operator(-) ident(LastIo)operator(\)) operator(>=) ident(InactivityTimeout)operator(\)\)) - ident(ScheduleClose) operator(()pre_constant(false)operator(\);) - comment(//bCloseNow = true;) -operator(}) - - -comment(/***************************** -PipeDescriptor::SelectForRead -*****************************/) - -pre_type(bool) ident(PipeDescriptor)operator(::)ident(SelectForRead)operator((\)) -operator({) - comment(/* Pipe descriptors, being local by definition, don't have - * a pending state, so this is simpler than for the - * ConnectionDescriptor object. - */) - reserved(return) pre_constant(true)operator(;) -operator(}) - -comment(/****************************** -PipeDescriptor::SelectForWrite -******************************/) - -pre_type(bool) ident(PipeDescriptor)operator(::)ident(SelectForWrite)operator((\)) -operator({) - comment(/* Pipe descriptors, being local by definition, don't have - * a pending state, so this is simpler than for the - * ConnectionDescriptor object. - */) - reserved(return) operator(()ident(GetOutboundDataSize)operator((\)) operator(>) integer(0)operator(\);) -operator(}) - - - - -comment(/******************************** -PipeDescriptor::SendOutboundData -********************************/) - -pre_type(int) ident(PipeDescriptor)operator(::)ident(SendOutboundData) operator(()directive(const) pre_type(char) operator(*)ident(data)operator(,) pre_type(int) ident(length)operator(\)) -operator({) - comment(//if (bCloseNow || bCloseAfterWriting\)) - reserved(if) operator(()ident(IsCloseScheduled)operator((\)\)) - reserved(return) integer(0)operator(;) - - reserved(if) operator((!)ident(data) operator(&&) operator(()ident(length) operator(>) integer(0)operator(\)\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - pre_type(char) operator(*)ident(buffer) operator(=) operator(()pre_type(char) operator(*\)) ident(malloc) operator(()ident(length) operator(+) integer(1)operator(\);) - reserved(if) operator((!)ident(buffer)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - ident(memcpy) operator(()ident(buffer)operator(,) ident(data)operator(,) ident(length)operator(\);) - ident(buffer) operator([)ident(length)operator(]) operator(=) integer(0)operator(;) - ident(OutboundPages)operator(.)ident(push_back) operator(()ident(OutboundPage) operator(()ident(buffer)operator(,) ident(length)operator(\)\);) - ident(OutboundDataSize) operator(+=) ident(length)operator(;) - preprocessor(#ifdef) ident(HAVE_EPOLL) - ident(EpollEvent)operator(.)ident(events) operator(=) operator(()ident(EPOLLIN) operator(|) ident(EPOLLOUT)operator(\);) - ident(assert) operator(()ident(MyEventMachine)operator(\);) - ident(MyEventMachine)operator(->)ident(Modify) operator(()local_variable(this)operator(\);) - preprocessor(#endif) - reserved(return) ident(length)operator(;) -operator(}) - -comment(/******************************** -PipeDescriptor::GetSubprocessPid -********************************/) - -pre_type(bool) ident(PipeDescriptor)operator(::)ident(GetSubprocessPid) operator(()ident(pid_t) operator(*)ident(pid)operator(\)) -operator({) - pre_type(bool) ident(ok) operator(=) pre_constant(false)operator(;) - reserved(if) operator(()ident(pid) operator(&&) operator(()ident(SubprocessPid) operator(>) integer(0)operator(\)\)) operator({) - operator(*)ident(pid) operator(=) ident(SubprocessPid)operator(;) - ident(ok) operator(=) pre_constant(true)operator(;) - operator(}) - reserved(return) ident(ok)operator(;) -operator(}) - - -preprocessor(#endif) comment(// OS_UNIX) - -comment(/***************************************************************************** - -$Id$ - -File: rubymain.cpp -Date: 06Apr06 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - -preprocessor(#include) include("project.h") -preprocessor(#include) include("eventmachine.h") -preprocessor(#include) include() - - - -comment(/******* -Statics -*******/) - -directive(static) ident(VALUE) ident(EmModule)operator(;) -directive(static) ident(VALUE) ident(EmConnection)operator(;) - -directive(static) ident(VALUE) ident(Intern_at_signature)operator(;) -directive(static) ident(VALUE) ident(Intern_at_timers)operator(;) -directive(static) ident(VALUE) ident(Intern_at_conns)operator(;) -directive(static) ident(VALUE) ident(Intern_event_callback)operator(;) -directive(static) ident(VALUE) ident(Intern_run_deferred_callbacks)operator(;) -directive(static) ident(VALUE) ident(Intern_delete)operator(;) -directive(static) ident(VALUE) ident(Intern_call)operator(;) -directive(static) ident(VALUE) ident(Intern_receive_data)operator(;) - -directive(static) ident(VALUE) ident(Intern_notify_readable)operator(;) -directive(static) ident(VALUE) ident(Intern_notify_writable)operator(;) - -comment(/**************** -t_event_callback -****************/) - -directive(static) directive(void) ident(event_callback) operator(()directive(const) pre_type(char) operator(*)ident(a1)operator(,) pre_type(int) ident(a2)operator(,) directive(const) pre_type(char) operator(*)ident(a3)operator(,) pre_type(int) ident(a4)operator(\)) -operator({) - reserved(if) operator(()ident(a2) operator(==) ident(EM_CONNECTION_READ)operator(\)) operator({) - ident(VALUE) ident(t) operator(=) ident(rb_ivar_get) operator(()ident(EmModule)operator(,) ident(Intern_at_conns)operator(\);) - ident(VALUE) ident(q) operator(=) ident(rb_hash_aref) operator(()ident(t)operator(,) ident(rb_str_new2)operator(()ident(a1)operator(\)\);) - reserved(if) operator(()ident(q) operator(==) ident(Qnil)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - ident(rb_funcall) operator(()ident(q)operator(,) ident(Intern_receive_data)operator(,) integer(1)operator(,) ident(rb_str_new) operator(()ident(a3)operator(,) ident(a4)operator(\)\);) - operator(}) - reserved(else) reserved(if) operator(()ident(a2) operator(==) ident(EM_CONNECTION_NOTIFY_READABLE)operator(\)) operator({) - ident(VALUE) ident(t) operator(=) ident(rb_ivar_get) operator(()ident(EmModule)operator(,) ident(Intern_at_conns)operator(\);) - ident(VALUE) ident(q) operator(=) ident(rb_hash_aref) operator(()ident(t)operator(,) ident(rb_str_new2)operator(()ident(a1)operator(\)\);) - reserved(if) operator(()ident(q) operator(==) ident(Qnil)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - ident(rb_funcall) operator(()ident(q)operator(,) ident(Intern_notify_readable)operator(,) integer(0)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(a2) operator(==) ident(EM_CONNECTION_NOTIFY_WRITABLE)operator(\)) operator({) - ident(VALUE) ident(t) operator(=) ident(rb_ivar_get) operator(()ident(EmModule)operator(,) ident(Intern_at_conns)operator(\);) - ident(VALUE) ident(q) operator(=) ident(rb_hash_aref) operator(()ident(t)operator(,) ident(rb_str_new2)operator(()ident(a1)operator(\)\);) - reserved(if) operator(()ident(q) operator(==) ident(Qnil)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - ident(rb_funcall) operator(()ident(q)operator(,) ident(Intern_notify_writable)operator(,) integer(0)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(a2) operator(==) ident(EM_LOOPBREAK_SIGNAL)operator(\)) operator({) - ident(rb_funcall) operator(()ident(EmModule)operator(,) ident(Intern_run_deferred_callbacks)operator(,) integer(0)operator(\);) - operator(}) - reserved(else) reserved(if) operator(()ident(a2) operator(==) ident(EM_TIMER_FIRED)operator(\)) operator({) - ident(VALUE) ident(t) operator(=) ident(rb_ivar_get) operator(()ident(EmModule)operator(,) ident(Intern_at_timers)operator(\);) - ident(VALUE) ident(q) operator(=) ident(rb_funcall) operator(()ident(t)operator(,) ident(Intern_delete)operator(,) integer(1)operator(,) ident(rb_str_new)operator(()ident(a3)operator(,) ident(a4)operator(\)\);) - reserved(if) operator(()ident(q) operator(==) ident(Qnil)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - ident(rb_funcall) operator(()ident(q)operator(,) ident(Intern_call)operator(,) integer(0)operator(\);) - operator(}) - reserved(else) - ident(rb_funcall) operator(()ident(EmModule)operator(,) ident(Intern_event_callback)operator(,) integer(3)operator(,) ident(rb_str_new2)operator(()ident(a1)operator(\),) operator(()ident(a2) operator(<<) integer(1)operator(\)) operator(|) integer(1)operator(,) ident(rb_str_new)operator(()ident(a3)operator(,)ident(a4)operator(\)\);) -operator(}) - - - -comment(/************************** -t_initialize_event_machine -**************************/) - -directive(static) ident(VALUE) ident(t_initialize_event_machine) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - ident(evma_initialize_library) operator(()ident(event_callback)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - - - -comment(/***************************** -t_run_machine_without_threads -*****************************/) - -directive(static) ident(VALUE) ident(t_run_machine_without_threads) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - ident(evma_run_machine)operator((\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/******************* -t_add_oneshot_timer -*******************/) - -directive(static) ident(VALUE) ident(t_add_oneshot_timer) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(interval)operator(\)) -operator({) - directive(const) pre_type(char) operator(*)ident(f) operator(=) ident(evma_install_oneshot_timer) operator(()ident(FIX2INT) operator(()ident(interval)operator(\)\);) - reserved(if) operator((!)ident(f) operator(||) operator(!*)ident(f)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(return) ident(rb_str_new2) operator(()ident(f)operator(\);) -operator(}) - - -comment(/************** -t_start_server -**************/) - -directive(static) ident(VALUE) ident(t_start_server) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(server)operator(,) ident(VALUE) ident(port)operator(\)) -operator({) - directive(const) pre_type(char) operator(*)ident(f) operator(=) ident(evma_create_tcp_server) operator(()ident(StringValuePtr)operator(()ident(server)operator(\),) ident(FIX2INT)operator(()ident(port)operator(\)\);) - reserved(if) operator((!)ident(f) operator(||) operator(!*)ident(f)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(return) ident(rb_str_new2) operator(()ident(f)operator(\);) -operator(}) - -comment(/************* -t_stop_server -*************/) - -directive(static) ident(VALUE) ident(t_stop_server) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(\)) -operator({) - ident(evma_stop_tcp_server) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/******************* -t_start_unix_server -*******************/) - -directive(static) ident(VALUE) ident(t_start_unix_server) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(filename)operator(\)) -operator({) - directive(const) pre_type(char) operator(*)ident(f) operator(=) ident(evma_create_unix_domain_server) operator(()ident(StringValuePtr)operator(()ident(filename)operator(\)\);) - reserved(if) operator((!)ident(f) operator(||) operator(!*)ident(f)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(return) ident(rb_str_new2) operator(()ident(f)operator(\);) -operator(}) - - - -comment(/*********** -t_send_data -***********/) - -directive(static) ident(VALUE) ident(t_send_data) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(,) ident(VALUE) ident(data)operator(,) ident(VALUE) ident(data_length)operator(\)) -operator({) - pre_type(int) ident(b) operator(=) ident(evma_send_data_to_connection) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\),) ident(StringValuePtr) operator(()ident(data)operator(\),) ident(FIX2INT) operator(()ident(data_length)operator(\)\);) - reserved(return) ident(INT2NUM) operator(()ident(b)operator(\);) -operator(}) - - -comment(/*********** -t_start_tls -***********/) - -directive(static) ident(VALUE) ident(t_start_tls) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(\)) -operator({) - ident(evma_start_tls) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/*************** -t_set_tls_parms -***************/) - -directive(static) ident(VALUE) ident(t_set_tls_parms) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(,) ident(VALUE) ident(privkeyfile)operator(,) ident(VALUE) ident(certchainfile)operator(\)) -operator({) - comment(/* set_tls_parms takes a series of positional arguments for specifying such things - * as private keys and certificate chains. - * It's expected that the parameter list will grow as we add more supported features. - * ALL of these parameters are optional, and can be specified as empty or NULL strings. - */) - ident(evma_set_tls_parms) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\),) ident(StringValuePtr) operator(()ident(privkeyfile)operator(\),) ident(StringValuePtr) operator(()ident(certchainfile)operator(\)) operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/************** -t_get_peername -**************/) - -directive(static) ident(VALUE) ident(t_get_peername) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(\)) -operator({) - reserved(struct) ident(sockaddr) ident(s)operator(;) - reserved(if) operator(()ident(evma_get_peername) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\),) operator(&)ident(s)operator(\)\)) operator({) - reserved(return) ident(rb_str_new) operator((()directive(const) pre_type(char)operator(*\)&)ident(s)operator(,) reserved(sizeof)operator(()ident(s)operator(\)\);) - operator(}) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/************** -t_get_sockname -**************/) - -directive(static) ident(VALUE) ident(t_get_sockname) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(\)) -operator({) - reserved(struct) ident(sockaddr) ident(s)operator(;) - reserved(if) operator(()ident(evma_get_sockname) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\),) operator(&)ident(s)operator(\)\)) operator({) - reserved(return) ident(rb_str_new) operator((()directive(const) pre_type(char)operator(*\)&)ident(s)operator(,) reserved(sizeof)operator(()ident(s)operator(\)\);) - operator(}) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/******************** -t_get_subprocess_pid -********************/) - -directive(static) ident(VALUE) ident(t_get_subprocess_pid) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(\)) -operator({) - ident(pid_t) ident(pid)operator(;) - reserved(if) operator(()ident(evma_get_subprocess_pid) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\),) operator(&)ident(pid)operator(\)\)) operator({) - reserved(return) ident(INT2NUM) operator(()ident(pid)operator(\);) - operator(}) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/*********************** -t_get_subprocess_status -***********************/) - -directive(static) ident(VALUE) ident(t_get_subprocess_status) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(\)) -operator({) - pre_type(int) ident(status)operator(;) - reserved(if) operator(()ident(evma_get_subprocess_status) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\),) operator(&)ident(status)operator(\)\)) operator({) - reserved(return) ident(INT2NUM) operator(()ident(status)operator(\);) - operator(}) - - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/***************************** -t_get_comm_inactivity_timeout -*****************************/) - -directive(static) ident(VALUE) ident(t_get_comm_inactivity_timeout) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(\)) -operator({) - pre_type(int) ident(timeout)operator(;) - reserved(if) operator(()ident(evma_get_comm_inactivity_timeout) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\),) operator(&)ident(timeout)operator(\)\)) - reserved(return) ident(INT2FIX) operator(()ident(timeout)operator(\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/***************************** -t_set_comm_inactivity_timeout -*****************************/) - -directive(static) ident(VALUE) ident(t_set_comm_inactivity_timeout) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(,) ident(VALUE) ident(timeout)operator(\)) -operator({) - pre_type(int) ident(ti) operator(=) ident(FIX2INT) operator(()ident(timeout)operator(\);) - reserved(if) operator(()ident(evma_set_comm_inactivity_timeout) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\),) operator(&)ident(ti)operator(\)\);) - reserved(return) ident(Qtrue)operator(;) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/*************** -t_send_datagram -***************/) - -directive(static) ident(VALUE) ident(t_send_datagram) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(,) ident(VALUE) ident(data)operator(,) ident(VALUE) ident(data_length)operator(,) ident(VALUE) ident(address)operator(,) ident(VALUE) ident(port)operator(\)) -operator({) - pre_type(int) ident(b) operator(=) ident(evma_send_datagram) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\),) ident(StringValuePtr) operator(()ident(data)operator(\),) ident(FIX2INT) operator(()ident(data_length)operator(\),) ident(StringValuePtr)operator(()ident(address)operator(\),) ident(FIX2INT)operator(()ident(port)operator(\)\);) - reserved(return) ident(INT2NUM) operator(()ident(b)operator(\);) -operator(}) - - -comment(/****************** -t_close_connection -******************/) - -directive(static) ident(VALUE) ident(t_close_connection) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(,) ident(VALUE) ident(after_writing)operator(\)) -operator({) - ident(evma_close_connection) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\),) operator((()ident(after_writing) operator(==) ident(Qtrue)operator(\)) operator(?) integer(1) operator(:) integer(0)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/******************************** -t_report_connection_error_status -********************************/) - -directive(static) ident(VALUE) ident(t_report_connection_error_status) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(\)) -operator({) - pre_type(int) ident(b) operator(=) ident(evma_report_connection_error_status) operator(()ident(StringValuePtr) operator(()ident(signature)operator(\)\);) - reserved(return) ident(INT2NUM) operator(()ident(b)operator(\);) -operator(}) - - - -comment(/**************** -t_connect_server -****************/) - -directive(static) ident(VALUE) ident(t_connect_server) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(server)operator(,) ident(VALUE) ident(port)operator(\)) -operator({) - comment(// Avoid FIX2INT in this case, because it doesn't deal with type errors properly.) - comment(// Specifically, if the value of port comes in as a string rather than an integer,) - comment(// NUM2INT will throw a type error, but FIX2INT will generate garbage.) - - directive(const) pre_type(char) operator(*)ident(f) operator(=) ident(evma_connect_to_server) operator(()ident(StringValuePtr)operator(()ident(server)operator(\),) ident(NUM2INT)operator(()ident(port)operator(\)\);) - reserved(if) operator((!)ident(f) operator(||) operator(!*)ident(f)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(return) ident(rb_str_new2) operator(()ident(f)operator(\);) -operator(}) - -comment(/********************* -t_connect_unix_server -*********************/) - -directive(static) ident(VALUE) ident(t_connect_unix_server) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(serversocket)operator(\)) -operator({) - directive(const) pre_type(char) operator(*)ident(f) operator(=) ident(evma_connect_to_unix_server) operator(()ident(StringValuePtr)operator(()ident(serversocket)operator(\)\);) - reserved(if) operator((!)ident(f) operator(||) operator(!*)ident(f)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(return) ident(rb_str_new2) operator(()ident(f)operator(\);) -operator(}) - -comment(/*********** -t_attach_fd -***********/) - -directive(static) ident(VALUE) ident(t_attach_fd) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(file_descriptor)operator(,) ident(VALUE) ident(read_mode)operator(,) ident(VALUE) ident(write_mode)operator(\)) -operator({) - directive(const) pre_type(char) operator(*)ident(f) operator(=) ident(evma_attach_fd) operator(()ident(NUM2INT)operator(()ident(file_descriptor)operator(\),) operator(()ident(read_mode) operator(==) ident(Qtrue)operator(\)) operator(?) integer(1) operator(:) integer(0)operator(,) operator(()ident(write_mode) operator(==) ident(Qtrue)operator(\)) operator(?) integer(1) operator(:) integer(0)operator(\);) - reserved(if) operator((!)ident(f) operator(||) operator(!*)ident(f)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(return) ident(rb_str_new2) operator(()ident(f)operator(\);) -operator(}) - -comment(/*********** -t_detach_fd -***********/) - -directive(static) ident(VALUE) ident(t_detach_fd) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(\)) -operator({) - reserved(return) ident(INT2NUM)operator(()ident(evma_detach_fd) operator(()ident(StringValuePtr)operator(()ident(signature)operator(\)\)\);) -operator(}) - -comment(/***************** -t_open_udp_socket -*****************/) - -directive(static) ident(VALUE) ident(t_open_udp_socket) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(server)operator(,) ident(VALUE) ident(port)operator(\)) -operator({) - directive(const) pre_type(char) operator(*)ident(f) operator(=) ident(evma_open_datagram_socket) operator(()ident(StringValuePtr)operator(()ident(server)operator(\),) ident(FIX2INT)operator(()ident(port)operator(\)\);) - reserved(if) operator((!)ident(f) operator(||) operator(!*)ident(f)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(return) ident(rb_str_new2) operator(()ident(f)operator(\);) -operator(}) - - - -comment(/***************** -t_release_machine -*****************/) - -directive(static) ident(VALUE) ident(t_release_machine) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - ident(evma_release_library)operator((\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/****** -t_stop -******/) - -directive(static) ident(VALUE) ident(t_stop) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - ident(evma_stop_machine)operator((\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/****************** -t_signal_loopbreak -******************/) - -directive(static) ident(VALUE) ident(t_signal_loopbreak) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - ident(evma_signal_loopbreak)operator((\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/************** -t_library_type -**************/) - -directive(static) ident(VALUE) ident(t_library_type) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - reserved(return) ident(rb_eval_string) operator(()stringoperator(\);) -operator(}) - - - -comment(/******************* -t_set_timer_quantum -*******************/) - -directive(static) ident(VALUE) ident(t_set_timer_quantum) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(interval)operator(\)) -operator({) - ident(evma_set_timer_quantum) operator(()ident(FIX2INT) operator(()ident(interval)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/******************** -t_set_max_timer_count -********************/) - -directive(static) ident(VALUE) ident(t_set_max_timer_count) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(ct)operator(\)) -operator({) - ident(evma_set_max_timer_count) operator(()ident(FIX2INT) operator(()ident(ct)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/*************** -t_setuid_string -***************/) - -directive(static) ident(VALUE) ident(t_setuid_string) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(username)operator(\)) -operator({) - ident(evma_setuid_string) operator(()ident(StringValuePtr) operator(()ident(username)operator(\)\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - - - -comment(/************* -t__write_file -*************/) - -directive(static) ident(VALUE) ident(t__write_file) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(filename)operator(\)) -operator({) - directive(const) pre_type(char) operator(*)ident(f) operator(=) ident(evma__write_file) operator(()ident(StringValuePtr) operator(()ident(filename)operator(\)\);) - reserved(if) operator((!)ident(f) operator(||) operator(!*)ident(f)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(return) ident(rb_str_new2) operator(()ident(f)operator(\);) -operator(}) - -comment(/************** -t_invoke_popen -**************/) - -directive(static) ident(VALUE) ident(t_invoke_popen) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(cmd)operator(\)) -operator({) - comment(// 1.8.7+) - preprocessor(#ifdef) ident(RARRAY_LEN) - pre_type(int) ident(len) operator(=) ident(RARRAY_LEN)operator(()ident(cmd)operator(\);) - preprocessor(#else) - pre_type(int) ident(len) operator(=) ident(RARRAY) operator(()ident(cmd)operator(\)->)ident(len)operator(;) - preprocessor(#endif) - reserved(if) operator(()ident(len) operator(>) integer(98)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - pre_type(char) operator(*)ident(strings) operator([)integer(100)operator(];) - reserved(for) operator(()pre_type(int) ident(i)operator(=)integer(0)operator(;) ident(i) operator(<) ident(len)operator(;) ident(i)operator(++\)) operator({) - ident(VALUE) ident(ix) operator(=) ident(INT2FIX) operator(()ident(i)operator(\);) - ident(VALUE) ident(s) operator(=) ident(rb_ary_aref) operator(()integer(1)operator(,) operator(&)ident(ix)operator(,) ident(cmd)operator(\);) - ident(strings)operator([)ident(i)operator(]) operator(=) ident(StringValuePtr) operator(()ident(s)operator(\);) - operator(}) - ident(strings)operator([)ident(len)operator(]) operator(=) pre_constant(NULL)operator(;) - - directive(const) pre_type(char) operator(*)ident(f) operator(=) ident(evma_popen) operator(()ident(strings)operator(\);) - reserved(if) operator((!)ident(f) operator(||) operator(!*)ident(f)operator(\)) operator({) - pre_type(char) operator(*)ident(err) operator(=) ident(strerror) operator(()ident(errno)operator(\);) - pre_type(char) ident(buf)operator([)integer(100)operator(];) - ident(memset) operator(()ident(buf)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(buf)operator(\)\);) - ident(snprintf) operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\)-)integer(1)operator(,) stringoperator(,) operator(()ident(err)operator(?)ident(err)operator(:)stringoperator(\)\);) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) ident(buf)operator(\);) - operator(}) - reserved(return) ident(rb_str_new2) operator(()ident(f)operator(\);) -operator(}) - - -comment(/*************** -t_read_keyboard -***************/) - -directive(static) ident(VALUE) ident(t_read_keyboard) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - directive(const) pre_type(char) operator(*)ident(f) operator(=) ident(evma_open_keyboard)operator((\);) - reserved(if) operator((!)ident(f) operator(||) operator(!*)ident(f)operator(\)) - ident(rb_raise) operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(return) ident(rb_str_new2) operator(()ident(f)operator(\);) -operator(}) - - -comment(/******** -t__epoll -********/) - -directive(static) ident(VALUE) ident(t__epoll) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - comment(// Temporary.) - ident(evma__epoll)operator((\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/********** -t__epoll_p -**********/) - -directive(static) ident(VALUE) ident(t__epoll_p) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - preprocessor(#ifdef) ident(HAVE_EPOLL) - reserved(return) ident(Qtrue)operator(;) - preprocessor(#else) - reserved(return) ident(Qfalse)operator(;) - preprocessor(#endif) -operator(}) - - -comment(/********* -t__kqueue -*********/) - -directive(static) ident(VALUE) ident(t__kqueue) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - comment(// Temporary.) - ident(evma__kqueue)operator((\);) - reserved(return) ident(Qnil)operator(;) -operator(}) - -comment(/*********** -t__kqueue_p -***********/) - -directive(static) ident(VALUE) ident(t__kqueue_p) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - preprocessor(#ifdef) ident(HAVE_KQUEUE) - reserved(return) ident(Qtrue)operator(;) - preprocessor(#else) - reserved(return) ident(Qfalse)operator(;) - preprocessor(#endif) -operator(}) - - -comment(/**************** -t_send_file_data -****************/) - -directive(static) ident(VALUE) ident(t_send_file_data) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(signature)operator(,) ident(VALUE) ident(filename)operator(\)) -operator({) - - comment(/* The current implementation of evma_send_file_data_to_connection enforces a strict - * upper limit on the file size it will transmit (currently 32K\). The function returns - * zero on success, -1 if the requested file exceeds its size limit, and a positive - * number for other errors. - * TODO: Positive return values are actually errno's, which is probably the wrong way to - * do this. For one thing it's ugly. For another, we can't be sure zero is never a real errno. - */) - - pre_type(int) ident(b) operator(=) ident(evma_send_file_data_to_connection) operator(()ident(StringValuePtr)operator(()ident(signature)operator(\),) ident(StringValuePtr)operator(()ident(filename)operator(\)\);) - reserved(if) operator(()ident(b) operator(==) operator(-)integer(1)operator(\)) - ident(rb_raise)operator(()ident(rb_eRuntimeError)operator(,) stringoperator(\);) - reserved(if) operator(()ident(b) operator(>) integer(0)operator(\)) operator({) - pre_type(char) operator(*)ident(err) operator(=) ident(strerror) operator(()ident(b)operator(\);) - pre_type(char) ident(buf)operator([)integer(1024)operator(];) - ident(memset) operator(()ident(buf)operator(,) integer(0)operator(,) reserved(sizeof)operator(()ident(buf)operator(\)\);) - ident(snprintf) operator(()ident(buf)operator(,) reserved(sizeof)operator(()ident(buf)operator(\)-)integer(1)operator(,) stringoperator(,) ident(StringValuePtr)operator(()ident(filename)operator(\),()ident(err)operator(?)ident(err)operator(:)stringoperator(\)\);) - - ident(rb_raise) operator(()ident(rb_eIOError)operator(,) ident(buf)operator(\);) - operator(}) - - reserved(return) ident(INT2NUM) operator(()integer(0)operator(\);) -operator(}) - - -comment(/******************* -t_set_rlimit_nofile -*******************/) - -directive(static) ident(VALUE) ident(t_set_rlimit_nofile) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(arg)operator(\)) -operator({) - ident(arg) operator(=) operator(()ident(NIL_P)operator(()ident(arg)operator(\)\)) operator(?) operator(-)integer(1) operator(:) ident(NUM2INT) operator(()ident(arg)operator(\);) - reserved(return) ident(INT2NUM) operator(()ident(evma_set_rlimit_nofile) operator(()ident(arg)operator(\)\);) -operator(}) - -comment(/*************************** -conn_get_outbound_data_size -***************************/) - -directive(static) ident(VALUE) ident(conn_get_outbound_data_size) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - ident(VALUE) ident(sig) operator(=) ident(rb_ivar_get) operator(()ident(self)operator(,) ident(Intern_at_signature)operator(\);) - reserved(return) ident(INT2NUM) operator(()ident(evma_get_outbound_data_size) operator(()ident(StringValuePtr)operator(()ident(sig)operator(\)\)\);) -operator(}) - - -comment(/****************************** -conn_associate_callback_target -******************************/) - -directive(static) ident(VALUE) ident(conn_associate_callback_target) operator(()ident(VALUE) ident(self)operator(,) ident(VALUE) ident(sig)operator(\)) -operator({) - comment(// No-op for the time being.) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/*************** -t_get_loop_time -****************/) - -directive(static) ident(VALUE) ident(t_get_loop_time) operator(()ident(VALUE) ident(self)operator(\)) -operator({) - ident(VALUE) ident(cTime) operator(=) ident(rb_path2class)operator(()stringoperator(\);) - reserved(if) operator(()ident(gCurrentLoopTime) operator(!=) integer(0)operator(\)) operator({) - reserved(return) ident(rb_funcall)operator(()ident(cTime)operator(,) - ident(rb_intern)operator(()stringoperator(\),) - integer(1)operator(,) - ident(INT2NUM)operator(()ident(gCurrentLoopTime)operator(\)\);) - operator(}) - reserved(return) ident(Qnil)operator(;) -operator(}) - - -comment(/********************* -Init_rubyeventmachine -*********************/) - -directive(extern) string directive(void) ident(Init_rubyeventmachine)operator((\)) -operator({) - comment(// Tuck away some symbol values so we don't have to look 'em up every time we need 'em.) - ident(Intern_at_signature) operator(=) ident(rb_intern) operator(()stringoperator(\);) - ident(Intern_at_timers) operator(=) ident(rb_intern) operator(()stringoperator(\);) - ident(Intern_at_conns) operator(=) ident(rb_intern) operator(()stringoperator(\);) - - ident(Intern_event_callback) operator(=) ident(rb_intern) operator(()stringoperator(\);) - ident(Intern_run_deferred_callbacks) operator(=) ident(rb_intern) operator(()stringoperator(\);) - ident(Intern_delete) operator(=) ident(rb_intern) operator(()stringoperator(\);) - ident(Intern_call) operator(=) ident(rb_intern) operator(()stringoperator(\);) - ident(Intern_receive_data) operator(=) ident(rb_intern) operator(()stringoperator(\);) - - ident(Intern_notify_readable) operator(=) ident(rb_intern) operator(()stringoperator(\);) - ident(Intern_notify_writable) operator(=) ident(rb_intern) operator(()stringoperator(\);) - - comment(// INCOMPLETE, we need to define class Connections inside module EventMachine) - comment(// run_machine and run_machine_without_threads are now identical.) - comment(// Must deprecate the without_threads variant.) - ident(EmModule) operator(=) ident(rb_define_module) operator(()stringoperator(\);) - ident(EmConnection) operator(=) ident(rb_define_class_under) operator(()ident(EmModule)operator(,) stringoperator(,) ident(rb_cObject)operator(\);) - - ident(rb_define_class_under) operator(()ident(EmModule)operator(,) stringoperator(,) ident(rb_eException)operator(\);) - ident(rb_define_class_under) operator(()ident(EmModule)operator(,) stringoperator(,) ident(rb_eException)operator(\);) - ident(rb_define_class_under) operator(()ident(EmModule)operator(,) stringoperator(,) ident(rb_eException)operator(\);) - - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_initialize_event_machine)operator(,) integer(0)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_run_machine_without_threads)operator(,) integer(0)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_run_machine_without_threads)operator(,) integer(0)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_add_oneshot_timer)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_start_server)operator(,) integer(2)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_stop_server)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_start_unix_server)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_set_tls_parms)operator(,) integer(3)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_start_tls)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_send_data)operator(,) integer(3)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_send_datagram)operator(,) integer(5)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_close_connection)operator(,) integer(2)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_report_connection_error_status)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_connect_server)operator(,) integer(2)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_connect_unix_server)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE) operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_attach_fd)operator(,) integer(3)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE) operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_detach_fd)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_get_loop_time)operator(,) integer(0)operator(\);) - - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_open_udp_socket)operator(,) integer(2)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_read_keyboard)operator(,) integer(0)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_release_machine)operator(,) integer(0)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_stop)operator(,) integer(0)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_signal_loopbreak)operator(,) integer(0)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_library_type)operator(,) integer(0)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_set_timer_quantum)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_set_max_timer_count)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_setuid_string)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_invoke_popen)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_send_file_data)operator(,) integer(2)operator(\);) - - comment(// Provisional:) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t__write_file)operator(,) integer(1)operator(\);) - - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_get_peername)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_get_sockname)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_get_subprocess_pid)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_get_subprocess_status)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_get_comm_inactivity_timeout)operator(,) integer(1)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_set_comm_inactivity_timeout)operator(,) integer(2)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t_set_rlimit_nofile)operator(,) integer(1)operator(\);) - - comment(// Temporary:) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t__epoll)operator(,) integer(0)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t__kqueue)operator(,) integer(0)operator(\);) - - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t__epoll_p)operator(,) integer(0)operator(\);) - ident(rb_define_module_function) operator(()ident(EmModule)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(t__kqueue_p)operator(,) integer(0)operator(\);) - - ident(rb_define_method) operator(()ident(EmConnection)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(conn_get_outbound_data_size)operator(,) integer(0)operator(\);) - ident(rb_define_method) operator(()ident(EmConnection)operator(,) stringoperator(,) operator(()ident(VALUE)operator((*\)()operator(.)operator(.)operator(.)operator(\)\))ident(conn_associate_callback_target)operator(,) integer(1)operator(\);) - - ident(rb_define_const) operator(()ident(EmModule)operator(,) stringoperator(,) ident(INT2NUM)operator(()integer(100)operator(\)\);) - ident(rb_define_const) operator(()ident(EmModule)operator(,) stringoperator(,) ident(INT2NUM)operator(()integer(101)operator(\)\);) - ident(rb_define_const) operator(()ident(EmModule)operator(,) stringoperator(,) ident(INT2NUM)operator(()integer(102)operator(\)\);) - ident(rb_define_const) operator(()ident(EmModule)operator(,) stringoperator(,) ident(INT2NUM)operator(()integer(103)operator(\)\);) - ident(rb_define_const) operator(()ident(EmModule)operator(,) stringoperator(,) ident(INT2NUM)operator(()integer(104)operator(\)\);) - ident(rb_define_const) operator(()ident(EmModule)operator(,) stringoperator(,) ident(INT2NUM)operator(()integer(105)operator(\)\);) - - ident(rb_define_const) operator(()ident(EmModule)operator(,) stringoperator(,) ident(INT2NUM)operator(()integer(106)operator(\)\);) - ident(rb_define_const) operator(()ident(EmModule)operator(,) stringoperator(,) ident(INT2NUM)operator(()integer(107)operator(\)\);) - -operator(}) - -comment(/***************************************************************************** - -$Id$ - -File: sigs.cpp -Date: 06Apr06 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - -preprocessor(#include) include("project.h") - - -pre_type(bool) ident(gTerminateSignalReceived)operator(;) - - -comment(/************** -SigtermHandler -**************/) - -directive(void) ident(SigtermHandler) operator(()pre_type(int) ident(sig)operator(\)) -operator({) - comment(// This is a signal-handler, don't do anything frisky. Interrupts are disabled.) - comment(// Set the terminate flag WITHOUT trying to lock a mutex- otherwise we can easily) - comment(// self-deadlock, especially if the event machine is looping quickly.) - ident(gTerminateSignalReceived) operator(=) pre_constant(true)operator(;) -operator(}) - - -comment(/********************* -InstallSignalHandlers -*********************/) - -directive(void) ident(InstallSignalHandlers)operator((\)) -operator({) - preprocessor(#ifdef) ident(OS_UNIX) - directive(static) pre_type(bool) ident(bInstalled) operator(=) pre_constant(false)operator(;) - reserved(if) operator((!)ident(bInstalled)operator(\)) operator({) - ident(bInstalled) operator(=) pre_constant(true)operator(;) - ident(signal) operator(()ident(SIGINT)operator(,) ident(SigtermHandler)operator(\);) - ident(signal) operator(()ident(SIGTERM)operator(,) ident(SigtermHandler)operator(\);) - ident(signal) operator(()ident(SIGPIPE)operator(,) ident(SIG_IGN)operator(\);) - operator(}) - preprocessor(#endif) -operator(}) - - - -comment(/******************* -WintelSignalHandler -*******************/) - -preprocessor(#ifdef) ident(OS_WIN32) -ident(BOOL) ident(WINAPI) ident(WintelSignalHandler) operator(()ident(DWORD) ident(control)operator(\)) -operator({) - reserved(if) operator(()ident(control) operator(==) ident(CTRL_C_EVENT)operator(\)) - ident(gTerminateSignalReceived) operator(=) pre_constant(true)operator(;) - reserved(return) ident(TRUE)operator(;) -operator(}) -preprocessor(#endif) - -comment(/************ -HookControlC -************/) - -preprocessor(#ifdef) ident(OS_WIN32) -directive(void) ident(HookControlC) operator(()pre_type(bool) ident(hook)operator(\)) -operator({) - reserved(if) operator(()ident(hook)operator(\)) operator({) - comment(// INSTALL hook) - ident(SetConsoleCtrlHandler) operator(()ident(WintelSignalHandler)operator(,) ident(TRUE)operator(\);) - operator(}) - reserved(else) operator({) - comment(// UNINSTALL hook) - ident(SetConsoleCtrlHandler) operator(()ident(WintelSignalHandler)operator(,) ident(FALSE)operator(\);) - operator(}) -operator(}) -preprocessor(#endif) - - -comment(/***************************************************************************** - -$Id$ - -File: ssl.cpp -Date: 30Apr06 - -Copyright (C\) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1\) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option\) any later version; or 2\) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/) - - -preprocessor(#ifdef) ident(WITH_SSL) - -preprocessor(#include) include("project.h") - - -pre_type(bool) ident(SslContext_t)operator(::)ident(bLibraryInitialized) operator(=) pre_constant(false)operator(;) - - - -directive(static) directive(void) ident(InitializeDefaultCredentials)operator((\);) -directive(static) ident(EVP_PKEY) operator(*)ident(DefaultPrivateKey) operator(=) pre_constant(NULL)operator(;) -directive(static) ident(X509) operator(*)ident(DefaultCertificate) operator(=) pre_constant(NULL)operator(;) - -directive(static) pre_type(char) ident(PrivateMaterials)operator([]) operator(=) operator({) -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -string -stringoperator(};) - -comment(/* These private materials were made with: - * openssl req -new -x509 -keyout cakey.pem -out cacert.pem -nodes -days 6500 - * TODO: We need a full-blown capability to work with user-supplied - * keypairs and properly-signed certificates. - */) - - -comment(/***************** -builtin_passwd_cb -*****************/) - -directive(extern) string pre_type(int) ident(builtin_passwd_cb) operator(()pre_type(char) operator(*)ident(buf)operator(,) pre_type(int) ident(bufsize)operator(,) pre_type(int) ident(rwflag)operator(,) directive(void) operator(*)ident(userdata)operator(\)) -operator({) - ident(strcpy) operator(()ident(buf)operator(,) stringoperator(\);) - reserved(return) integer(8)operator(;) -operator(}) - -comment(/**************************** -InitializeDefaultCredentials -****************************/) - -directive(static) directive(void) ident(InitializeDefaultCredentials)operator((\)) -operator({) - ident(BIO) operator(*)ident(bio) operator(=) ident(BIO_new_mem_buf) operator(()ident(PrivateMaterials)operator(,) operator(-)integer(1)operator(\);) - ident(assert) operator(()ident(bio)operator(\);) - - reserved(if) operator(()ident(DefaultPrivateKey)operator(\)) operator({) - comment(// we may come here in a restart.) - ident(EVP_PKEY_free) operator(()ident(DefaultPrivateKey)operator(\);) - ident(DefaultPrivateKey) operator(=) pre_constant(NULL)operator(;) - operator(}) - ident(PEM_read_bio_PrivateKey) operator(()ident(bio)operator(,) operator(&)ident(DefaultPrivateKey)operator(,) ident(builtin_passwd_cb)operator(,) integer(0)operator(\);) - - reserved(if) operator(()ident(DefaultCertificate)operator(\)) operator({) - comment(// we may come here in a restart.) - ident(X509_free) operator(()ident(DefaultCertificate)operator(\);) - ident(DefaultCertificate) operator(=) pre_constant(NULL)operator(;) - operator(}) - ident(PEM_read_bio_X509) operator(()ident(bio)operator(,) operator(&)ident(DefaultCertificate)operator(,) pre_constant(NULL)operator(,) integer(0)operator(\);) - - ident(BIO_free) operator(()ident(bio)operator(\);) -operator(}) - - - -comment(/************************** -SslContext_t::SslContext_t -**************************/) - -ident(SslContext_t)operator(::)ident(SslContext_t) operator(()pre_type(bool) ident(is_server)operator(,) directive(const) pre_type(string) operator(&)ident(privkeyfile)operator(,) directive(const) pre_type(string) operator(&)ident(certchainfile)operator(\):) - ident(pCtx) operator(()pre_constant(NULL)operator(\),) - ident(PrivateKey) operator(()pre_constant(NULL)operator(\),) - ident(Certificate) operator(()pre_constant(NULL)operator(\)) -operator({) - comment(/* TODO: the usage of the specified private-key and cert-chain filenames only applies to - * client-side connections at this point. Server connections currently use the default materials. - * That needs to be fixed asap. - * Also, in this implementation, server-side connections use statically defined X-509 defaults. - * One thing I'm really not clear on is whether or not you have to explicitly free X509 and EVP_PKEY - * objects when we call our destructor, or whether just calling SSL_CTX_free is enough. - */) - - reserved(if) operator((!)ident(bLibraryInitialized)operator(\)) operator({) - ident(bLibraryInitialized) operator(=) pre_constant(true)operator(;) - ident(SSL_library_init)operator((\);) - ident(OpenSSL_add_ssl_algorithms)operator((\);) - ident(OpenSSL_add_all_algorithms)operator((\);) - ident(SSL_load_error_strings)operator((\);) - ident(ERR_load_crypto_strings)operator((\);) - - ident(InitializeDefaultCredentials)operator((\);) - operator(}) - - ident(bIsServer) operator(=) ident(is_server)operator(;) - ident(pCtx) operator(=) ident(SSL_CTX_new) operator(()ident(is_server) operator(?) ident(SSLv23_server_method)operator((\)) operator(:) ident(SSLv23_client_method)operator((\)\);) - reserved(if) operator((!)ident(pCtx)operator(\)) - reserved(throw) ident(std)operator(::)ident(runtime_error) operator(()stringoperator(\);) - - ident(SSL_CTX_set_options) operator(()ident(pCtx)operator(,) ident(SSL_OP_ALL)operator(\);) - comment(//SSL_CTX_set_options (pCtx, (SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3\)\);) - - reserved(if) operator(()ident(is_server)operator(\)) operator({) - comment(// The SSL_CTX calls here do NOT allocate memory.) - pre_type(int) ident(e)operator(;) - reserved(if) operator(()ident(privkeyfile)operator(.)ident(length)operator((\)) operator(>) integer(0)operator(\)) - ident(e) operator(=) ident(SSL_CTX_use_PrivateKey_file) operator(()ident(pCtx)operator(,) ident(privkeyfile)operator(.)ident(c_str)operator((\),) ident(SSL_FILETYPE_PEM)operator(\);) - reserved(else) - ident(e) operator(=) ident(SSL_CTX_use_PrivateKey) operator(()ident(pCtx)operator(,) ident(DefaultPrivateKey)operator(\);) - ident(assert) operator(()ident(e) operator(>) integer(0)operator(\);) - reserved(if) operator(()ident(certchainfile)operator(.)ident(length)operator((\)) operator(>) integer(0)operator(\)) - ident(e) operator(=) ident(SSL_CTX_use_certificate_chain_file) operator(()ident(pCtx)operator(,) ident(certchainfile)operator(.)ident(c_str)operator((\)\);) - reserved(else) - ident(e) operator(=) ident(SSL_CTX_use_certificate) operator(()ident(pCtx)operator(,) ident(DefaultCertificate)operator(\);) - ident(assert) operator(()ident(e) operator(>) integer(0)operator(\);) - operator(}) - - ident(SSL_CTX_set_cipher_list) operator(()ident(pCtx)operator(,) stringoperator(\);) - - reserved(if) operator(()ident(is_server)operator(\)) operator({) - ident(SSL_CTX_sess_set_cache_size) operator(()ident(pCtx)operator(,) integer(128)operator(\);) - ident(SSL_CTX_set_session_id_context) operator(()ident(pCtx)operator(,) operator(()pre_type(unsigned) pre_type(char)operator(*\))stringoperator(,) integer(12)operator(\);) - operator(}) - reserved(else) operator({) - pre_type(int) ident(e)operator(;) - reserved(if) operator(()ident(privkeyfile)operator(.)ident(length)operator((\)) operator(>) integer(0)operator(\)) operator({) - ident(e) operator(=) ident(SSL_CTX_use_PrivateKey_file) operator(()ident(pCtx)operator(,) ident(privkeyfile)operator(.)ident(c_str)operator((\),) ident(SSL_FILETYPE_PEM)operator(\);) - ident(assert) operator(()ident(e) operator(>) integer(0)operator(\);) - operator(}) - reserved(if) operator(()ident(certchainfile)operator(.)ident(length)operator((\)) operator(>) integer(0)operator(\)) operator({) - ident(e) operator(=) ident(SSL_CTX_use_certificate_chain_file) operator(()ident(pCtx)operator(,) ident(certchainfile)operator(.)ident(c_str)operator((\)\);) - ident(assert) operator(()ident(e) operator(>) integer(0)operator(\);) - operator(}) - operator(}) -operator(}) - - - -comment(/*************************** -SslContext_t::~SslContext_t -***************************/) - -ident(SslContext_t)operator(::~)ident(SslContext_t)operator((\)) -operator({) - reserved(if) operator(()ident(pCtx)operator(\)) - ident(SSL_CTX_free) operator(()ident(pCtx)operator(\);) - reserved(if) operator(()ident(PrivateKey)operator(\)) - ident(EVP_PKEY_free) operator(()ident(PrivateKey)operator(\);) - reserved(if) operator(()ident(Certificate)operator(\)) - ident(X509_free) operator(()ident(Certificate)operator(\);) -operator(}) - - - -comment(/****************** -SslBox_t::SslBox_t -******************/) - -ident(SslBox_t)operator(::)ident(SslBox_t) operator(()pre_type(bool) ident(is_server)operator(,) directive(const) pre_type(string) operator(&)ident(privkeyfile)operator(,) directive(const) pre_type(string) operator(&)ident(certchainfile)operator(\):) - ident(bIsServer) operator(()ident(is_server)operator(\),) - ident(pSSL) operator(()pre_constant(NULL)operator(\),) - ident(pbioRead) operator(()pre_constant(NULL)operator(\),) - ident(pbioWrite) operator(()pre_constant(NULL)operator(\)) -operator({) - comment(/* TODO someday: make it possible to re-use SSL contexts so we don't have to create - * a new one every time we come here. - */) - - ident(Context) operator(=) reserved(new) ident(SslContext_t) operator(()ident(bIsServer)operator(,) ident(privkeyfile)operator(,) ident(certchainfile)operator(\);) - ident(assert) operator(()ident(Context)operator(\);) - - ident(pbioRead) operator(=) ident(BIO_new) operator(()ident(BIO_s_mem)operator((\)\);) - ident(assert) operator(()ident(pbioRead)operator(\);) - - ident(pbioWrite) operator(=) ident(BIO_new) operator(()ident(BIO_s_mem)operator((\)\);) - ident(assert) operator(()ident(pbioWrite)operator(\);) - - ident(pSSL) operator(=) ident(SSL_new) operator(()ident(Context)operator(->)ident(pCtx)operator(\);) - ident(assert) operator(()ident(pSSL)operator(\);) - ident(SSL_set_bio) operator(()ident(pSSL)operator(,) ident(pbioRead)operator(,) ident(pbioWrite)operator(\);) - - reserved(if) operator((!)ident(bIsServer)operator(\)) - ident(SSL_connect) operator(()ident(pSSL)operator(\);) -operator(}) - - - -comment(/******************* -SslBox_t::~SslBox_t -*******************/) - -ident(SslBox_t)operator(::~)ident(SslBox_t)operator((\)) -operator({) - comment(// Freeing pSSL will also free the associated BIOs, so DON'T free them separately.) - reserved(if) operator(()ident(pSSL)operator(\)) operator({) - reserved(if) operator(()ident(SSL_get_shutdown) operator(()ident(pSSL)operator(\)) operator(&) ident(SSL_RECEIVED_SHUTDOWN)operator(\)) - ident(SSL_shutdown) operator(()ident(pSSL)operator(\);) - reserved(else) - ident(SSL_clear) operator(()ident(pSSL)operator(\);) - ident(SSL_free) operator(()ident(pSSL)operator(\);) - operator(}) - - reserved(delete) ident(Context)operator(;) -operator(}) - - - -comment(/*********************** -SslBox_t::PutCiphertext -***********************/) - -pre_type(bool) ident(SslBox_t)operator(::)ident(PutCiphertext) operator(()directive(const) pre_type(char) operator(*)ident(buf)operator(,) pre_type(int) ident(bufsize)operator(\)) -operator({) - ident(assert) operator(()ident(buf) operator(&&) operator(()ident(bufsize) operator(>) integer(0)operator(\)\);) - - ident(assert) operator(()ident(pbioRead)operator(\);) - pre_type(int) ident(n) operator(=) ident(BIO_write) operator(()ident(pbioRead)operator(,) ident(buf)operator(,) ident(bufsize)operator(\);) - - reserved(return) operator(()ident(n) operator(==) ident(bufsize)operator(\)) operator(?) pre_constant(true) operator(:) pre_constant(false)operator(;) -operator(}) - - -comment(/********************** -SslBox_t::GetPlaintext -**********************/) - -pre_type(int) ident(SslBox_t)operator(::)ident(GetPlaintext) operator(()pre_type(char) operator(*)ident(buf)operator(,) pre_type(int) ident(bufsize)operator(\)) -operator({) - reserved(if) operator((!)ident(SSL_is_init_finished) operator(()ident(pSSL)operator(\)\)) operator({) - pre_type(int) ident(e) operator(=) ident(bIsServer) operator(?) ident(SSL_accept) operator(()ident(pSSL)operator(\)) operator(:) ident(SSL_connect) operator(()ident(pSSL)operator(\);) - reserved(if) operator(()ident(e) operator(<) integer(0)operator(\)) operator({) - pre_type(int) ident(er) operator(=) ident(SSL_get_error) operator(()ident(pSSL)operator(,) ident(e)operator(\);) - reserved(if) operator(()ident(er) operator(!=) ident(SSL_ERROR_WANT_READ)operator(\)) operator({) - comment(// Return -1 for a nonfatal error, -2 for an error that should force the connection down.) - reserved(return) operator(()ident(er) operator(==) ident(SSL_ERROR_SSL)operator(\)) operator(?) operator((-)integer(2)operator(\)) operator(:) operator((-)integer(1)operator(\);) - operator(}) - reserved(else) - reserved(return) integer(0)operator(;) - operator(}) - comment(// If handshake finished, FALL THROUGH and return the available plaintext.) - operator(}) - - reserved(if) operator((!)ident(SSL_is_init_finished) operator(()ident(pSSL)operator(\)\)) operator({) - comment(// We can get here if a browser abandons a handshake.) - comment(// The user can see a warning dialog and abort the connection.) - ident(cerr) operator(<<) string)delimiter(")>operator(;) - reserved(return) integer(0)operator(;) - operator(}) - - comment(//cerr << "CIPH: " << SSL_get_cipher (pSSL\) << endl;) - - pre_type(int) ident(n) operator(=) ident(SSL_read) operator(()ident(pSSL)operator(,) ident(buf)operator(,) ident(bufsize)operator(\);) - reserved(if) operator(()ident(n) operator(>=) integer(0)operator(\)) operator({) - reserved(return) ident(n)operator(;) - operator(}) - reserved(else) operator({) - reserved(if) operator(()ident(SSL_get_error) operator(()ident(pSSL)operator(,) ident(n)operator(\)) operator(==) ident(SSL_ERROR_WANT_READ)operator(\)) operator({) - reserved(return) integer(0)operator(;) - operator(}) - reserved(else) operator({) - reserved(return) operator(-)integer(1)operator(;) - operator(}) - operator(}) - - reserved(return) integer(0)operator(;) -operator(}) - - - -comment(/************************** -SslBox_t::CanGetCiphertext -**************************/) - -pre_type(bool) ident(SslBox_t)operator(::)ident(CanGetCiphertext)operator((\)) -operator({) - ident(assert) operator(()ident(pbioWrite)operator(\);) - reserved(return) ident(BIO_pending) operator(()ident(pbioWrite)operator(\)) operator(?) pre_constant(true) operator(:) pre_constant(false)operator(;) -operator(}) - - - -comment(/*********************** -SslBox_t::GetCiphertext -***********************/) - -pre_type(int) ident(SslBox_t)operator(::)ident(GetCiphertext) operator(()pre_type(char) operator(*)ident(buf)operator(,) pre_type(int) ident(bufsize)operator(\)) -operator({) - ident(assert) operator(()ident(pbioWrite)operator(\);) - ident(assert) operator(()ident(buf) operator(&&) operator(()ident(bufsize) operator(>) integer(0)operator(\)\);) - - reserved(return) ident(BIO_read) operator(()ident(pbioWrite)operator(,) ident(buf)operator(,) ident(bufsize)operator(\);) -operator(}) - - - -comment(/********************** -SslBox_t::PutPlaintext -**********************/) - -pre_type(int) ident(SslBox_t)operator(::)ident(PutPlaintext) operator(()directive(const) pre_type(char) operator(*)ident(buf)operator(,) pre_type(int) ident(bufsize)operator(\)) -operator({) - comment(// The caller will interpret the return value as the number of bytes written.) - comment(// WARNING WARNING WARNING, are there any situations in which a 0 or -1 return) - comment(// from SSL_write means we should immediately retry? The socket-machine loop) - comment(// will probably wait for a time-out cycle (perhaps a second\) before re-trying.) - comment(// THIS WOULD CAUSE A PERCEPTIBLE DELAY!) - - comment(/* We internally queue any outbound plaintext that can't be dispatched - * because we're in the middle of a handshake or something. - * When we get called, try to send any queued data first, and then - * send the caller's data (or queue it\). We may get called with no outbound - * data, which means we try to send the outbound queue and that's all. - * - * Return >0 if we wrote any data, 0 if we didn't, and <0 for a fatal error. - * Note that if we return 0, the connection is still considered live - * and we are signalling that we have accepted the outbound data (if any\). - */) - - ident(OutboundQ)operator(.)ident(Push) operator(()ident(buf)operator(,) ident(bufsize)operator(\);) - - reserved(if) operator((!)ident(SSL_is_init_finished) operator(()ident(pSSL)operator(\)\)) - reserved(return) integer(0)operator(;) - - pre_type(bool) ident(fatal) operator(=) pre_constant(false)operator(;) - pre_type(bool) ident(did_work) operator(=) pre_constant(false)operator(;) - - reserved(while) operator(()ident(OutboundQ)operator(.)ident(HasPages)operator((\)\)) operator({) - directive(const) pre_type(char) operator(*)ident(page)operator(;) - pre_type(int) ident(length)operator(;) - ident(OutboundQ)operator(.)ident(Front) operator((&)ident(page)operator(,) operator(&)ident(length)operator(\);) - ident(assert) operator(()ident(page) operator(&&) operator(()ident(length) operator(>) integer(0)operator(\)\);) - pre_type(int) ident(n) operator(=) ident(SSL_write) operator(()ident(pSSL)operator(,) ident(page)operator(,) ident(length)operator(\);) - reserved(if) operator(()ident(n) operator(>) integer(0)operator(\)) operator({) - ident(did_work) operator(=) pre_constant(true)operator(;) - ident(OutboundQ)operator(.)ident(PopFront)operator((\);) - operator(}) - reserved(else) operator({) - pre_type(int) ident(er) operator(=) ident(SSL_get_error) operator(()ident(pSSL)operator(,) ident(n)operator(\);) - reserved(if) operator((()ident(er) operator(!=) ident(SSL_ERROR_WANT_READ)operator(\)) operator(&&) operator(()ident(er) operator(!=) ident(SSL_ERROR_WANT_WRITE)operator(\)\)) - ident(fatal) operator(=) pre_constant(true)operator(;) - reserved(break)operator(;) - operator(}) - operator(}) - - - reserved(if) operator(()ident(did_work)operator(\)) - reserved(return) integer(1)operator(;) - reserved(else) reserved(if) operator(()ident(fatal)operator(\)) - reserved(return) operator(-)integer(1)operator(;) - reserved(else) - reserved(return) integer(0)operator(;) -operator(}) - - -preprocessor(#endif) comment(// WITH_SSL) - diff --git a/test/scanners/cpp/eventmachine.in.cpp b/test/scanners/cpp/eventmachine.in.cpp deleted file mode 100644 index 050d601..0000000 --- a/test/scanners/cpp/eventmachine.in.cpp +++ /dev/null @@ -1,7035 +0,0 @@ -/***************************************************************************** - -$Id$ - -File: binder.cpp -Date: 07Apr06 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - -#include "project.h" - -#define DEV_URANDOM "/dev/urandom" - - -map Bindable_t::BindingBag; - - -/******************************** -STATIC Bindable_t::CreateBinding -********************************/ - -string Bindable_t::CreateBinding() -{ - static int index = 0; - static string seed; - - if ((index >= 1000000) || (seed.length() == 0)) { - #ifdef OS_UNIX - int fd = open (DEV_URANDOM, O_RDONLY); - if (fd < 0) - throw std::runtime_error ("No entropy device"); - - unsigned char u[16]; - size_t r = read (fd, u, sizeof(u)); - if (r < sizeof(u)) - throw std::runtime_error ("Unable to read entropy device"); - - unsigned char *u1 = (unsigned char*)u; - char u2 [sizeof(u) * 2 + 1]; - - for (size_t i=0; i < sizeof(u); i++) - sprintf (u2 + (i * 2), "%02x", u1[i]); - - seed = string (u2); - #endif - - - #ifdef OS_WIN32 - UUID uuid; - UuidCreate (&uuid); - unsigned char *uuidstring = NULL; - UuidToString (&uuid, &uuidstring); - if (!uuidstring) - throw std::runtime_error ("Unable to read uuid"); - seed = string ((const char*)uuidstring); - - RpcStringFree (&uuidstring); - #endif - - index = 0; - - - } - - stringstream ss; - ss << seed << (++index); - return ss.str(); -} - - -/***************************** -STATIC: Bindable_t::GetObject -*****************************/ - -Bindable_t *Bindable_t::GetObject (const char *binding) -{ - string s (binding ? binding : ""); - return GetObject (s); -} - -/***************************** -STATIC: Bindable_t::GetObject -*****************************/ - -Bindable_t *Bindable_t::GetObject (const string &binding) -{ - map::const_iterator i = BindingBag.find (binding); - if (i != BindingBag.end()) - return i->second; - else - return NULL; -} - - -/********************** -Bindable_t::Bindable_t -**********************/ - -Bindable_t::Bindable_t() -{ - Binding = Bindable_t::CreateBinding(); - BindingBag [Binding] = this; -} - - - -/*********************** -Bindable_t::~Bindable_t -***********************/ - -Bindable_t::~Bindable_t() -{ - BindingBag.erase (Binding); -} - - -/***************************************************************************** - -$Id$ - -File: cmain.cpp -Date: 06Apr06 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - -#include "project.h" - - -static EventMachine_t *EventMachine; -static int bUseEpoll = 0; -static int bUseKqueue = 0; - -extern "C" void ensure_eventmachine (const char *caller = "unknown caller") -{ - if (!EventMachine) { - const int err_size = 128; - char err_string[err_size]; - snprintf (err_string, err_size, "eventmachine not initialized: %s", caller); - #ifdef BUILD_FOR_RUBY - rb_raise(rb_eRuntimeError, err_string); - #else - throw std::runtime_error (err_string); - #endif - } -} - -/*********************** -evma_initialize_library -***********************/ - -extern "C" void evma_initialize_library (void(*cb)(const char*, int, const char*, int)) -{ - // Probably a bad idea to mess with the signal mask of a process - // we're just being linked into. - //InstallSignalHandlers(); - if (EventMachine) - #ifdef BUILD_FOR_RUBY - rb_raise(rb_eRuntimeError, "eventmachine already initialized: evma_initialize_library"); - #else - throw std::runtime_error ("eventmachine already initialized: evma_initialize_library"); - #endif - EventMachine = new EventMachine_t (cb); - if (bUseEpoll) - EventMachine->_UseEpoll(); - if (bUseKqueue) - EventMachine->_UseKqueue(); -} - - -/******************** -evma_release_library -********************/ - -extern "C" void evma_release_library() -{ - ensure_eventmachine("evma_release_library"); - delete EventMachine; - EventMachine = NULL; -} - - -/**************** -evma_run_machine -****************/ - -extern "C" void evma_run_machine() -{ - ensure_eventmachine("evma_run_machine"); - EventMachine->Run(); -} - - -/************************** -evma_install_oneshot_timer -**************************/ - -extern "C" const char *evma_install_oneshot_timer (int seconds) -{ - ensure_eventmachine("evma_install_oneshot_timer"); - return EventMachine->InstallOneshotTimer (seconds); -} - - -/********************** -evma_connect_to_server -**********************/ - -extern "C" const char *evma_connect_to_server (const char *server, int port) -{ - ensure_eventmachine("evma_connect_to_server"); - return EventMachine->ConnectToServer (server, port); -} - -/*************************** -evma_connect_to_unix_server -***************************/ - -extern "C" const char *evma_connect_to_unix_server (const char *server) -{ - ensure_eventmachine("evma_connect_to_unix_server"); - return EventMachine->ConnectToUnixServer (server); -} - -/************** -evma_attach_fd -**************/ - -extern "C" const char *evma_attach_fd (int file_descriptor, int notify_readable, int notify_writable) -{ - ensure_eventmachine("evma_attach_fd"); - return EventMachine->AttachFD (file_descriptor, (notify_readable ? true : false), (notify_writable ? true : false)); -} - -/************** -evma_detach_fd -**************/ - -extern "C" int evma_detach_fd (const char *binding) -{ - ensure_eventmachine("evma_dettach_fd"); - EventableDescriptor *ed = dynamic_cast (Bindable_t::GetObject (binding)); - if (ed) - return EventMachine->DetachFD (ed); - else - #ifdef BUILD_FOR_RUBY - rb_raise(rb_eRuntimeError, "invalid binding to detach"); - #else - throw std::runtime_error ("invalid binding to detach"); - #endif -} - -/********************** -evma_create_tcp_server -**********************/ - -extern "C" const char *evma_create_tcp_server (const char *address, int port) -{ - ensure_eventmachine("evma_create_tcp_server"); - return EventMachine->CreateTcpServer (address, port); -} - -/****************************** -evma_create_unix_domain_server -******************************/ - -extern "C" const char *evma_create_unix_domain_server (const char *filename) -{ - ensure_eventmachine("evma_create_unix_domain_server"); - return EventMachine->CreateUnixDomainServer (filename); -} - -/************************* -evma_open_datagram_socket -*************************/ - -extern "C" const char *evma_open_datagram_socket (const char *address, int port) -{ - ensure_eventmachine("evma_open_datagram_socket"); - return EventMachine->OpenDatagramSocket (address, port); -} - -/****************** -evma_open_keyboard -******************/ - -extern "C" const char *evma_open_keyboard() -{ - ensure_eventmachine("evma_open_keyboard"); - return EventMachine->OpenKeyboard(); -} - - - -/**************************** -evma_send_data_to_connection -****************************/ - -extern "C" int evma_send_data_to_connection (const char *binding, const char *data, int data_length) -{ - ensure_eventmachine("evma_send_data_to_connection"); - return ConnectionDescriptor::SendDataToConnection (binding, data, data_length); -} - -/****************** -evma_send_datagram -******************/ - -extern "C" int evma_send_datagram (const char *binding, const char *data, int data_length, const char *address, int port) -{ - ensure_eventmachine("evma_send_datagram"); - return DatagramDescriptor::SendDatagram (binding, data, data_length, address, port); -} - - -/********************* -evma_close_connection -*********************/ - -extern "C" void evma_close_connection (const char *binding, int after_writing) -{ - ensure_eventmachine("evma_close_connection"); - ConnectionDescriptor::CloseConnection (binding, (after_writing ? true : false)); -} - -/*********************************** -evma_report_connection_error_status -***********************************/ - -extern "C" int evma_report_connection_error_status (const char *binding) -{ - ensure_eventmachine("evma_report_connection_error_status"); - return ConnectionDescriptor::ReportErrorStatus (binding); -} - -/******************** -evma_stop_tcp_server -********************/ - -extern "C" void evma_stop_tcp_server (const char *binding) -{ - ensure_eventmachine("evma_stop_tcp_server"); - AcceptorDescriptor::StopAcceptor (binding); -} - - -/***************** -evma_stop_machine -*****************/ - -extern "C" void evma_stop_machine() -{ - ensure_eventmachine("evma_stop_machine"); - EventMachine->ScheduleHalt(); -} - - -/************** -evma_start_tls -**************/ - -extern "C" void evma_start_tls (const char *binding) -{ - ensure_eventmachine("evma_start_tls"); - EventableDescriptor *ed = dynamic_cast (Bindable_t::GetObject (binding)); - if (ed) - ed->StartTls(); -} - -/****************** -evma_set_tls_parms -******************/ - -extern "C" void evma_set_tls_parms (const char *binding, const char *privatekey_filename, const char *certchain_filename) -{ - ensure_eventmachine("evma_set_tls_parms"); - EventableDescriptor *ed = dynamic_cast (Bindable_t::GetObject (binding)); - if (ed) - ed->SetTlsParms (privatekey_filename, certchain_filename); -} - - -/***************** -evma_get_peername -*****************/ - -extern "C" int evma_get_peername (const char *binding, struct sockaddr *sa) -{ - ensure_eventmachine("evma_get_peername"); - EventableDescriptor *ed = dynamic_cast (Bindable_t::GetObject (binding)); - if (ed) { - return ed->GetPeername (sa) ? 1 : 0; - } - else - return 0; -} - -/***************** -evma_get_sockname -*****************/ - -extern "C" int evma_get_sockname (const char *binding, struct sockaddr *sa) -{ - ensure_eventmachine("evma_get_sockname"); - EventableDescriptor *ed = dynamic_cast (Bindable_t::GetObject (binding)); - if (ed) { - return ed->GetSockname (sa) ? 1 : 0; - } - else - return 0; -} - -/*********************** -evma_get_subprocess_pid -***********************/ - -extern "C" int evma_get_subprocess_pid (const char *binding, pid_t *pid) -{ - ensure_eventmachine("evma_get_subprocess_pid"); - EventableDescriptor *ed = dynamic_cast (Bindable_t::GetObject (binding)); - if (ed) { - return ed->GetSubprocessPid (pid) ? 1 : 0; - } - else - return 0; -} - -/************************** -evma_get_subprocess_status -**************************/ - -extern "C" int evma_get_subprocess_status (const char *binding, int *status) -{ - ensure_eventmachine("evma_get_subprocess_status"); - if (status) { - *status = EventMachine->SubprocessExitStatus; - return 1; - } - else - return 0; -} - - -/********************* -evma_signal_loopbreak -*********************/ - -extern "C" void evma_signal_loopbreak() -{ - ensure_eventmachine("evma_signal_loopbreak"); - EventMachine->SignalLoopBreaker(); -} - - - -/**************** -evma__write_file -****************/ - -extern "C" const char *evma__write_file (const char *filename) -{ - ensure_eventmachine("evma__write_file"); - return EventMachine->_OpenFileForWriting (filename); -} - - -/******************************** -evma_get_comm_inactivity_timeout -********************************/ - -extern "C" int evma_get_comm_inactivity_timeout (const char *binding, int *value) -{ - ensure_eventmachine("evma_get_comm_inactivity_timeout"); - EventableDescriptor *ed = dynamic_cast (Bindable_t::GetObject (binding)); - if (ed) { - return ed->GetCommInactivityTimeout (value); - } - else - return 0; //Perhaps this should be an exception. Access to an unknown binding. -} - -/******************************** -evma_set_comm_inactivity_timeout -********************************/ - -extern "C" int evma_set_comm_inactivity_timeout (const char *binding, int *value) -{ - ensure_eventmachine("evma_set_comm_inactivity_timeout"); - EventableDescriptor *ed = dynamic_cast (Bindable_t::GetObject (binding)); - if (ed) { - return ed->SetCommInactivityTimeout (value); - } - else - return 0; //Perhaps this should be an exception. Access to an unknown binding. -} - - -/********************** -evma_set_timer_quantum -**********************/ - -extern "C" void evma_set_timer_quantum (int interval) -{ - ensure_eventmachine("evma_set_timer_quantum"); - EventMachine->SetTimerQuantum (interval); -} - -/************************ -evma_set_max_timer_count -************************/ - -extern "C" void evma_set_max_timer_count (int ct) -{ - // This may only be called if the reactor is not running. - - if (EventMachine) - #ifdef BUILD_FOR_RUBY - rb_raise(rb_eRuntimeError, "eventmachine already initialized: evma_set_max_timer_count"); - #else - throw std::runtime_error ("eventmachine already initialized: evma_set_max_timer_count"); - #endif - EventMachine_t::SetMaxTimerCount (ct); -} - -/****************** -evma_setuid_string -******************/ - -extern "C" void evma_setuid_string (const char *username) -{ - // We do NOT need to be running an EM instance because this method is static. - EventMachine_t::SetuidString (username); -} - - -/********** -evma_popen -**********/ - -extern "C" const char *evma_popen (char * const*cmd_strings) -{ - ensure_eventmachine("evma_popen"); - return EventMachine->Socketpair (cmd_strings); -} - - -/*************************** -evma_get_outbound_data_size -***************************/ - -extern "C" int evma_get_outbound_data_size (const char *binding) -{ - ensure_eventmachine("evma_get_outbound_data_size"); - EventableDescriptor *ed = dynamic_cast (Bindable_t::GetObject (binding)); - return ed ? ed->GetOutboundDataSize() : 0; -} - - -/*********** -evma__epoll -***********/ - -extern "C" void evma__epoll() -{ - bUseEpoll = 1; -} - -/************ -evma__kqueue -************/ - -extern "C" void evma__kqueue() -{ - bUseKqueue = 1; -} - - -/********************** -evma_set_rlimit_nofile -**********************/ - -extern "C" int evma_set_rlimit_nofile (int nofiles) -{ - return EventMachine_t::SetRlimitNofile (nofiles); -} - - -/********************************* -evma_send_file_data_to_connection -*********************************/ - -extern "C" int evma_send_file_data_to_connection (const char *binding, const char *filename) -{ - /* This is a sugaring over send_data_to_connection that reads a file into a - * locally-allocated buffer, and sends the file data to the remote peer. - * Return the number of bytes written to the caller. - * TODO, needs to impose a limit on the file size. This is intended only for - * small files. (I don't know, maybe 8K or less.) For larger files, use interleaved - * I/O to avoid slowing the rest of the system down. - * TODO: we should return a code rather than barf, in case of file-not-found. - * TODO, does this compile on Windows? - * TODO, given that we want this to work only with small files, how about allocating - * the buffer on the stack rather than the heap? - * - * Modified 25Jul07. This now returns -1 on file-too-large; 0 for success, and a positive - * errno in case of other errors. - * - /* Contributed by Kirk Haines. - */ - - char data[32*1024]; - int r; - - ensure_eventmachine("evma_send_file_data_to_connection"); - - int Fd = open (filename, O_RDONLY); - - if (Fd < 0) - return errno; - // From here on, all early returns MUST close Fd. - - struct stat st; - if (fstat (Fd, &st)) { - int e = errno; - close (Fd); - return e; - } - - int filesize = st.st_size; - if (filesize <= 0) { - close (Fd); - return 0; - } - else if (filesize > sizeof(data)) { - close (Fd); - return -1; - } - - - r = read (Fd, data, filesize); - if (r != filesize) { - int e = errno; - close (Fd); - return e; - } - evma_send_data_to_connection (binding, data, r); - close (Fd); - - return 0; -} - -/***************************************************************************** - -$Id$ - -File: cplusplus.cpp -Date: 27Jul07 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - - -#include "project.h" - - -namespace EM { - static map Eventables; - static map Timers; -} - - -/******* -EM::Run -*******/ - -void EM::Run (void (*start_func)()) -{ - evma__epoll(); - evma_initialize_library (EM::Callback); - if (start_func) - AddTimer (0, start_func); - evma_run_machine(); - evma_release_library(); -} - -/************ -EM::AddTimer -************/ - -void EM::AddTimer (int milliseconds, void (*func)()) -{ - if (func) { - const char *sig = evma_install_oneshot_timer (milliseconds); - Timers.insert (make_pair (sig, func)); - } -} - - -/*************** -EM::StopReactor -***************/ - -void EM::StopReactor() -{ - evma_stop_machine(); -} - - -/******************** -EM::Acceptor::Accept -********************/ - -void EM::Acceptor::Accept (const char *signature) -{ - Connection *c = MakeConnection(); - c->Signature = signature; - Eventables.insert (make_pair (c->Signature, c)); - c->PostInit(); -} - -/************************ -EM::Connection::SendData -************************/ - -void EM::Connection::SendData (const char *data) -{ - if (data) - SendData (data, strlen (data)); -} - - -/************************ -EM::Connection::SendData -************************/ - -void EM::Connection::SendData (const char *data, int length) -{ - evma_send_data_to_connection (Signature.c_str(), data, length); -} - - -/********************* -EM::Connection::Close -*********************/ - -void EM::Connection::Close (bool afterWriting) -{ - evma_close_connection (Signature.c_str(), afterWriting); -} - - -/*********************** -EM::Connection::Connect -***********************/ - -void EM::Connection::Connect (const char *host, int port) -{ - Signature = evma_connect_to_server (host, port); - Eventables.insert( make_pair (Signature, this)); -} - -/******************* -EM::Acceptor::Start -*******************/ - -void EM::Acceptor::Start (const char *host, int port) -{ - Signature = evma_create_tcp_server (host, port); - Eventables.insert( make_pair (Signature, this)); -} - - - -/************ -EM::Callback -************/ - -void EM::Callback (const char *sig, int ev, const char *data, int length) -{ - EM::Eventable *e; - void (*f)(); - - switch (ev) { - case EM_TIMER_FIRED: - f = Timers [data]; - if (f) - (*f)(); - Timers.erase (sig); - break; - - case EM_CONNECTION_READ: - e = EM::Eventables [sig]; - e->ReceiveData (data, length); - break; - - case EM_CONNECTION_COMPLETED: - e = EM::Eventables [sig]; - e->ConnectionCompleted(); - break; - - case EM_CONNECTION_ACCEPTED: - e = EM::Eventables [sig]; - e->Accept (data); - break; - - case EM_CONNECTION_UNBOUND: - e = EM::Eventables [sig]; - e->Unbind(); - EM::Eventables.erase (sig); - delete e; - break; - } -} - -/***************************************************************************** - -$Id$ - -File: ed.cpp -Date: 06Apr06 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - -#include "project.h" - - - -/******************** -SetSocketNonblocking -********************/ - -bool SetSocketNonblocking (SOCKET sd) -{ - #ifdef OS_UNIX - int val = fcntl (sd, F_GETFL, 0); - return (fcntl (sd, F_SETFL, val | O_NONBLOCK) != SOCKET_ERROR) ? true : false; - #endif - - #ifdef OS_WIN32 - unsigned long one = 1; - return (ioctlsocket (sd, FIONBIO, &one) == 0) ? true : false; - #endif -} - - -/**************************************** -EventableDescriptor::EventableDescriptor -****************************************/ - -EventableDescriptor::EventableDescriptor (int sd, EventMachine_t *em): - bCloseNow (false), - bCloseAfterWriting (false), - MySocket (sd), - EventCallback (NULL), - LastRead (0), - LastWritten (0), - bCallbackUnbind (true), - MyEventMachine (em) -{ - /* There are three ways to close a socket, all of which should - * automatically signal to the event machine that this object - * should be removed from the polling scheduler. - * First is a hard close, intended for bad errors or possible - * security violations. It immediately closes the connection - * and puts this object into an error state. - * Second is to set bCloseNow, which will cause the event machine - * to delete this object (and thus close the connection in our - * destructor) the next chance it gets. bCloseNow also inhibits - * the writing of new data on the socket (but not necessarily - * the reading of new data). - * The third way is to set bCloseAfterWriting, which inhibits - * the writing of new data and converts to bCloseNow as soon - * as everything in the outbound queue has been written. - * bCloseAfterWriting is really for use only by protocol handlers - * (for example, HTTP writes an HTML page and then closes the - * connection). All of the error states we generate internally - * cause an immediate close to be scheduled, which may have the - * effect of discarding outbound data. - */ - - if (sd == INVALID_SOCKET) - throw std::runtime_error ("bad eventable descriptor"); - if (MyEventMachine == NULL) - throw std::runtime_error ("bad em in eventable descriptor"); - CreatedAt = gCurrentLoopTime; - - #ifdef HAVE_EPOLL - EpollEvent.data.ptr = this; - #endif -} - - -/***************************************** -EventableDescriptor::~EventableDescriptor -*****************************************/ - -EventableDescriptor::~EventableDescriptor() -{ - if (EventCallback && bCallbackUnbind) - (*EventCallback)(GetBinding().c_str(), EM_CONNECTION_UNBOUND, NULL, 0); - Close(); -} - - -/************************************* -EventableDescriptor::SetEventCallback -*************************************/ - -void EventableDescriptor::SetEventCallback (void(*cb)(const char*, int, const char*, int)) -{ - EventCallback = cb; -} - - -/************************** -EventableDescriptor::Close -**************************/ - -void EventableDescriptor::Close() -{ - // Close the socket right now. Intended for emergencies. - if (MySocket != INVALID_SOCKET) { - shutdown (MySocket, 1); - closesocket (MySocket); - MySocket = INVALID_SOCKET; - } -} - - -/********************************* -EventableDescriptor::ShouldDelete -*********************************/ - -bool EventableDescriptor::ShouldDelete() -{ - /* For use by a socket manager, which needs to know if this object - * should be removed from scheduling events and deleted. - * Has an immediate close been scheduled, or are we already closed? - * If either of these are the case, return true. In theory, the manager will - * then delete us, which in turn will make sure the socket is closed. - * Note, if bCloseAfterWriting is true, we check a virtual method to see - * if there is outbound data to write, and only request a close if there is none. - */ - - return ((MySocket == INVALID_SOCKET) || bCloseNow || (bCloseAfterWriting && (GetOutboundDataSize() <= 0))); -} - - -/********************************** -EventableDescriptor::ScheduleClose -**********************************/ - -void EventableDescriptor::ScheduleClose (bool after_writing) -{ - // KEEP THIS SYNCHRONIZED WITH ::IsCloseScheduled. - if (after_writing) - bCloseAfterWriting = true; - else - bCloseNow = true; -} - - -/************************************* -EventableDescriptor::IsCloseScheduled -*************************************/ - -bool EventableDescriptor::IsCloseScheduled() -{ - // KEEP THIS SYNCHRONIZED WITH ::ScheduleClose. - return (bCloseNow || bCloseAfterWriting); -} - - -/****************************************** -ConnectionDescriptor::ConnectionDescriptor -******************************************/ - -ConnectionDescriptor::ConnectionDescriptor (int sd, EventMachine_t *em): - EventableDescriptor (sd, em), - bConnectPending (false), - bNotifyReadable (false), - bNotifyWritable (false), - bReadAttemptedAfterClose (false), - bWriteAttemptedAfterClose (false), - OutboundDataSize (0), - #ifdef WITH_SSL - SslBox (NULL), - #endif - bIsServer (false), - LastIo (gCurrentLoopTime), - InactivityTimeout (0) -{ - #ifdef HAVE_EPOLL - EpollEvent.events = EPOLLOUT; - #endif - // 22Jan09: Moved ArmKqueueWriter into SetConnectPending() to fix assertion failure in _WriteOutboundData() -} - - -/******************************************* -ConnectionDescriptor::~ConnectionDescriptor -*******************************************/ - -ConnectionDescriptor::~ConnectionDescriptor() -{ - // Run down any stranded outbound data. - for (size_t i=0; i < OutboundPages.size(); i++) - OutboundPages[i].Free(); - - #ifdef WITH_SSL - if (SslBox) - delete SslBox; - #endif -} - - -/************************************************** -STATIC: ConnectionDescriptor::SendDataToConnection -**************************************************/ - -int ConnectionDescriptor::SendDataToConnection (const char *binding, const char *data, int data_length) -{ - // TODO: This is something of a hack, or at least it's a static method of the wrong class. - // TODO: Poor polymorphism here. We should be calling one virtual method - // instead of hacking out the runtime information of the target object. - ConnectionDescriptor *cd = dynamic_cast (Bindable_t::GetObject (binding)); - if (cd) - return cd->SendOutboundData (data, data_length); - DatagramDescriptor *ds = dynamic_cast (Bindable_t::GetObject (binding)); - if (ds) - return ds->SendOutboundData (data, data_length); - #ifdef OS_UNIX - PipeDescriptor *ps = dynamic_cast (Bindable_t::GetObject (binding)); - if (ps) - return ps->SendOutboundData (data, data_length); - #endif - return -1; -} - - -/********************************************* -STATIC: ConnectionDescriptor::CloseConnection -*********************************************/ - -void ConnectionDescriptor::CloseConnection (const char *binding, bool after_writing) -{ - // TODO: This is something of a hack, or at least it's a static method of the wrong class. - EventableDescriptor *ed = dynamic_cast (Bindable_t::GetObject (binding)); - if (ed) - ed->ScheduleClose (after_writing); -} - -/*********************************************** -STATIC: ConnectionDescriptor::ReportErrorStatus -***********************************************/ - -int ConnectionDescriptor::ReportErrorStatus (const char *binding) -{ - // TODO: This is something of a hack, or at least it's a static method of the wrong class. - // TODO: Poor polymorphism here. We should be calling one virtual method - // instead of hacking out the runtime information of the target object. - ConnectionDescriptor *cd = dynamic_cast (Bindable_t::GetObject (binding)); - if (cd) - return cd->_ReportErrorStatus(); - return -1; -} - -/*************************************** -ConnectionDescriptor::SetConnectPending -****************************************/ - -void ConnectionDescriptor::SetConnectPending(bool f) -{ - bConnectPending = f; - #ifdef HAVE_KQUEUE - MyEventMachine->ArmKqueueWriter (this); - #endif -} - - -/************************************** -ConnectionDescriptor::SendOutboundData -**************************************/ - -int ConnectionDescriptor::SendOutboundData (const char *data, int length) -{ - #ifdef WITH_SSL - if (SslBox) { - if (length > 0) { - int w = SslBox->PutPlaintext (data, length); - if (w < 0) - ScheduleClose (false); - else - _DispatchCiphertext(); - } - // TODO: What's the correct return value? - return 1; // That's a wild guess, almost certainly wrong. - } - else - #endif - return _SendRawOutboundData (data, length); -} - - - -/****************************************** -ConnectionDescriptor::_SendRawOutboundData -******************************************/ - -int ConnectionDescriptor::_SendRawOutboundData (const char *data, int length) -{ - /* This internal method is called to schedule bytes that - * will be sent out to the remote peer. - * It's not directly accessed by the caller, who hits ::SendOutboundData, - * which may or may not filter or encrypt the caller's data before - * sending it here. - */ - - // Highly naive and incomplete implementation. - // There's no throttle for runaways (which should abort only this connection - // and not the whole process), and no coalescing of small pages. - // (Well, not so bad, small pages are coalesced in ::Write) - - if (IsCloseScheduled()) - //if (bCloseNow || bCloseAfterWriting) - return 0; - - if (!data && (length > 0)) - throw std::runtime_error ("bad outbound data"); - char *buffer = (char *) malloc (length + 1); - if (!buffer) - throw std::runtime_error ("no allocation for outbound data"); - memcpy (buffer, data, length); - buffer [length] = 0; - OutboundPages.push_back (OutboundPage (buffer, length)); - OutboundDataSize += length; - #ifdef HAVE_EPOLL - EpollEvent.events = (EPOLLIN | EPOLLOUT); - assert (MyEventMachine); - MyEventMachine->Modify (this); - #endif - #ifdef HAVE_KQUEUE - MyEventMachine->ArmKqueueWriter (this); - #endif - return length; -} - - - -/*********************************** -ConnectionDescriptor::SelectForRead -***********************************/ - -bool ConnectionDescriptor::SelectForRead() -{ - /* A connection descriptor is always scheduled for read, - * UNLESS it's in a pending-connect state. - * On Linux, unlike Unix, a nonblocking socket on which - * connect has been called, does NOT necessarily select - * both readable and writable in case of error. - * The socket will select writable when the disposition - * of the connect is known. On the other hand, a socket - * which successfully connects and selects writable may - * indeed have some data available on it, so it will - * select readable in that case, violating expectations! - * So we will not poll for readability until the socket - * is known to be in a connected state. - */ - - return bConnectPending ? false : true; -} - - -/************************************ -ConnectionDescriptor::SelectForWrite -************************************/ - -bool ConnectionDescriptor::SelectForWrite() -{ - /* Cf the notes under SelectForRead. - * In a pending-connect state, we ALWAYS select for writable. - * In a normal state, we only select for writable when we - * have outgoing data to send. - */ - - if (bConnectPending || bNotifyWritable) - return true; - else { - return (GetOutboundDataSize() > 0); - } -} - - -/************************** -ConnectionDescriptor::Read -**************************/ - -void ConnectionDescriptor::Read() -{ - /* Read and dispatch data on a socket that has selected readable. - * It's theoretically possible to get and dispatch incoming data on - * a socket that has already been scheduled for closing or close-after-writing. - * In those cases, we'll leave it up the to protocol handler to "do the - * right thing" (which probably means to ignore the incoming data). - * - * 22Aug06: Chris Ochs reports that on FreeBSD, it's possible to come - * here with the socket already closed, after the process receives - * a ctrl-C signal (not sure if that's TERM or INT on BSD). The application - * was one in which network connections were doing a lot of interleaved reads - * and writes. - * Since we always write before reading (in order to keep the outbound queues - * as light as possible), I think what happened is that an interrupt caused - * the socket to be closed in ConnectionDescriptor::Write. We'll then - * come here in the same pass through the main event loop, and won't get - * cleaned up until immediately after. - * We originally asserted that the socket was valid when we got here. - * To deal properly with the possibility that we are closed when we get here, - * I removed the assert. HOWEVER, the potential for an infinite loop scares me, - * so even though this is really clunky, I added a flag to assert that we never - * come here more than once after being closed. (FCianfrocca) - */ - - int sd = GetSocket(); - //assert (sd != INVALID_SOCKET); (original, removed 22Aug06) - if (sd == INVALID_SOCKET) { - assert (!bReadAttemptedAfterClose); - bReadAttemptedAfterClose = true; - return; - } - - if (bNotifyReadable) { - if (EventCallback) - (*EventCallback)(GetBinding().c_str(), EM_CONNECTION_NOTIFY_READABLE, NULL, 0); - return; - } - - LastIo = gCurrentLoopTime; - - int total_bytes_read = 0; - char readbuffer [16 * 1024 + 1]; - - for (int i=0; i < 10; i++) { - // Don't read just one buffer and then move on. This is faster - // if there is a lot of incoming. - // But don't read indefinitely. Give other sockets a chance to run. - // NOTICE, we're reading one less than the buffer size. - // That's so we can put a guard byte at the end of what we send - // to user code. - - - int r = recv (sd, readbuffer, sizeof(readbuffer) - 1, 0); - //cerr << ""; - - if (r > 0) { - total_bytes_read += r; - LastRead = gCurrentLoopTime; - - // Add a null-terminator at the the end of the buffer - // that we will send to the callback. - // DO NOT EVER CHANGE THIS. We want to explicitly allow users - // to be able to depend on this behavior, so they will have - // the option to do some things faster. Additionally it's - // a security guard against buffer overflows. - readbuffer [r] = 0; - _DispatchInboundData (readbuffer, r); - } - else if (r == 0) { - break; - } - else { - // Basically a would-block, meaning we've read everything there is to read. - break; - } - - } - - - if (total_bytes_read == 0) { - // If we read no data on a socket that selected readable, - // it generally means the other end closed the connection gracefully. - ScheduleClose (false); - //bCloseNow = true; - } - -} - - - -/****************************************** -ConnectionDescriptor::_DispatchInboundData -******************************************/ - -void ConnectionDescriptor::_DispatchInboundData (const char *buffer, int size) -{ - #ifdef WITH_SSL - if (SslBox) { - SslBox->PutCiphertext (buffer, size); - - int s; - char B [2048]; - while ((s = SslBox->GetPlaintext (B, sizeof(B) - 1)) > 0) { - B [s] = 0; - if (EventCallback) - (*EventCallback)(GetBinding().c_str(), EM_CONNECTION_READ, B, s); - } - // INCOMPLETE, s may indicate an SSL error that would force the connection down. - _DispatchCiphertext(); - } - else { - if (EventCallback) - (*EventCallback)(GetBinding().c_str(), EM_CONNECTION_READ, buffer, size); - } - #endif - - #ifdef WITHOUT_SSL - if (EventCallback) - (*EventCallback)(GetBinding().c_str(), EM_CONNECTION_READ, buffer, size); - #endif -} - - - - - -/*************************** -ConnectionDescriptor::Write -***************************/ - -void ConnectionDescriptor::Write() -{ - /* A socket which is in a pending-connect state will select - * writable when the disposition of the connect is known. - * At that point, check to be sure there are no errors, - * and if none, then promote the socket out of the pending - * state. - * TODO: I haven't figured out how Windows signals errors on - * unconnected sockets. Maybe it does the untraditional but - * logical thing and makes the socket selectable for error. - * If so, it's unsupported here for the time being, and connect - * errors will have to be caught by the timeout mechanism. - */ - - if (bConnectPending) { - int error; - socklen_t len; - len = sizeof(error); - #ifdef OS_UNIX - int o = getsockopt (GetSocket(), SOL_SOCKET, SO_ERROR, &error, &len); - #endif - #ifdef OS_WIN32 - int o = getsockopt (GetSocket(), SOL_SOCKET, SO_ERROR, (char*)&error, &len); - #endif - if ((o == 0) && (error == 0)) { - if (EventCallback) - (*EventCallback)(GetBinding().c_str(), EM_CONNECTION_COMPLETED, "", 0); - bConnectPending = false; - #ifdef HAVE_EPOLL - // The callback may have scheduled outbound data. - EpollEvent.events = EPOLLIN | (SelectForWrite() ? EPOLLOUT : 0); - #endif - #ifdef HAVE_KQUEUE - MyEventMachine->ArmKqueueReader (this); - // The callback may have scheduled outbound data. - if (SelectForWrite()) - MyEventMachine->ArmKqueueWriter (this); - #endif - } - else - ScheduleClose (false); - //bCloseNow = true; - } - else { - - if (bNotifyWritable) { - if (EventCallback) - (*EventCallback)(GetBinding().c_str(), EM_CONNECTION_NOTIFY_WRITABLE, NULL, 0); - return; - } - - _WriteOutboundData(); - } -} - - -/**************************************** -ConnectionDescriptor::_WriteOutboundData -****************************************/ - -void ConnectionDescriptor::_WriteOutboundData() -{ - /* This is a helper function called by ::Write. - * It's possible for a socket to select writable and then no longer - * be writable by the time we get around to writing. The kernel might - * have used up its available output buffers between the select call - * and when we get here. So this condition is not an error. - * - * 20Jul07, added the same kind of protection against an invalid socket - * that is at the top of ::Read. Not entirely how this could happen in - * real life (connection-reset from the remote peer, perhaps?), but I'm - * doing it to address some reports of crashing under heavy loads. - */ - - int sd = GetSocket(); - //assert (sd != INVALID_SOCKET); - if (sd == INVALID_SOCKET) { - assert (!bWriteAttemptedAfterClose); - bWriteAttemptedAfterClose = true; - return; - } - - LastIo = gCurrentLoopTime; - char output_buffer [16 * 1024]; - size_t nbytes = 0; - - while ((OutboundPages.size() > 0) && (nbytes < sizeof(output_buffer))) { - OutboundPage *op = &(OutboundPages[0]); - if ((nbytes + op->Length - op->Offset) < sizeof (output_buffer)) { - memcpy (output_buffer + nbytes, op->Buffer + op->Offset, op->Length - op->Offset); - nbytes += (op->Length - op->Offset); - op->Free(); - OutboundPages.pop_front(); - } - else { - int len = sizeof(output_buffer) - nbytes; - memcpy (output_buffer + nbytes, op->Buffer + op->Offset, len); - op->Offset += len; - nbytes += len; - } - } - - // We should never have gotten here if there were no data to write, - // so assert that as a sanity check. - // Don't bother to make sure nbytes is less than output_buffer because - // if it were we probably would have crashed already. - assert (nbytes > 0); - - assert (GetSocket() != INVALID_SOCKET); - int bytes_written = send (GetSocket(), output_buffer, nbytes, 0); - - bool err = false; - if (bytes_written < 0) { - err = true; - bytes_written = 0; - } - - assert (bytes_written >= 0); - OutboundDataSize -= bytes_written; - if ((size_t)bytes_written < nbytes) { - int len = nbytes - bytes_written; - char *buffer = (char*) malloc (len + 1); - if (!buffer) - throw std::runtime_error ("bad alloc throwing back data"); - memcpy (buffer, output_buffer + bytes_written, len); - buffer [len] = 0; - OutboundPages.push_front (OutboundPage (buffer, len)); - } - - #ifdef HAVE_EPOLL - EpollEvent.events = (EPOLLIN | (SelectForWrite() ? EPOLLOUT : 0)); - assert (MyEventMachine); - MyEventMachine->Modify (this); - #endif - #ifdef HAVE_KQUEUE - if (SelectForWrite()) - MyEventMachine->ArmKqueueWriter (this); - #endif - - - if (err) { - #ifdef OS_UNIX - if ((errno != EINPROGRESS) && (errno != EWOULDBLOCK) && (errno != EINTR)) - #endif - #ifdef OS_WIN32 - if ((errno != WSAEINPROGRESS) && (errno != WSAEWOULDBLOCK)) - #endif - Close(); - } -} - - -/**************************************** -ConnectionDescriptor::_ReportErrorStatus -****************************************/ - -int ConnectionDescriptor::_ReportErrorStatus() -{ - int error; - socklen_t len; - len = sizeof(error); - #ifdef OS_UNIX - int o = getsockopt (GetSocket(), SOL_SOCKET, SO_ERROR, &error, &len); - #endif - #ifdef OS_WIN32 - int o = getsockopt (GetSocket(), SOL_SOCKET, SO_ERROR, (char*)&error, &len); - #endif - if ((o == 0) && (error == 0)) - return 0; - else - return 1; -} - - -/****************************** -ConnectionDescriptor::StartTls -******************************/ - -void ConnectionDescriptor::StartTls() -{ - #ifdef WITH_SSL - if (SslBox) - throw std::runtime_error ("SSL/TLS already running on connection"); - - SslBox = new SslBox_t (bIsServer, PrivateKeyFilename, CertChainFilename); - _DispatchCiphertext(); - #endif - - #ifdef WITHOUT_SSL - throw std::runtime_error ("Encryption not available on this event-machine"); - #endif -} - - -/********************************* -ConnectionDescriptor::SetTlsParms -*********************************/ - -void ConnectionDescriptor::SetTlsParms (const char *privkey_filename, const char *certchain_filename) -{ - #ifdef WITH_SSL - if (SslBox) - throw std::runtime_error ("call SetTlsParms before calling StartTls"); - if (privkey_filename && *privkey_filename) - PrivateKeyFilename = privkey_filename; - if (certchain_filename && *certchain_filename) - CertChainFilename = certchain_filename; - #endif - - #ifdef WITHOUT_SSL - throw std::runtime_error ("Encryption not available on this event-machine"); - #endif -} - - - -/***************************************** -ConnectionDescriptor::_DispatchCiphertext -*****************************************/ -#ifdef WITH_SSL -void ConnectionDescriptor::_DispatchCiphertext() -{ - assert (SslBox); - - - char BigBuf [2048]; - bool did_work; - - do { - did_work = false; - - // try to drain ciphertext - while (SslBox->CanGetCiphertext()) { - int r = SslBox->GetCiphertext (BigBuf, sizeof(BigBuf)); - assert (r > 0); - _SendRawOutboundData (BigBuf, r); - did_work = true; - } - - // Pump the SslBox, in case it has queued outgoing plaintext - // This will return >0 if data was written, - // 0 if no data was written, and <0 if there was a fatal error. - bool pump; - do { - pump = false; - int w = SslBox->PutPlaintext (NULL, 0); - if (w > 0) { - did_work = true; - pump = true; - } - else if (w < 0) - ScheduleClose (false); - } while (pump); - - // try to put plaintext. INCOMPLETE, doesn't belong here? - // In SendOutboundData, we're spooling plaintext directly - // into SslBox. That may be wrong, we may need to buffer it - // up here! - /* - const char *ptr; - int ptr_length; - while (OutboundPlaintext.GetPage (&ptr, &ptr_length)) { - assert (ptr && (ptr_length > 0)); - int w = SslMachine.PutPlaintext (ptr, ptr_length); - if (w > 0) { - OutboundPlaintext.DiscardBytes (w); - did_work = true; - } - else - break; - } - */ - - } while (did_work); - -} -#endif - - - -/******************************* -ConnectionDescriptor::Heartbeat -*******************************/ - -void ConnectionDescriptor::Heartbeat() -{ - /* Only allow a certain amount of time to go by while waiting - * for a pending connect. If it expires, then kill the socket. - * For a connected socket, close it if its inactivity timer - * has expired. - */ - - if (bConnectPending) { - if ((gCurrentLoopTime - CreatedAt) >= PendingConnectTimeout) - ScheduleClose (false); - //bCloseNow = true; - } - else { - if (InactivityTimeout && ((gCurrentLoopTime - LastIo) >= InactivityTimeout)) - ScheduleClose (false); - //bCloseNow = true; - } -} - - -/**************************************** -LoopbreakDescriptor::LoopbreakDescriptor -****************************************/ - -LoopbreakDescriptor::LoopbreakDescriptor (int sd, EventMachine_t *parent_em): - EventableDescriptor (sd, parent_em) -{ - /* This is really bad and ugly. Change someday if possible. - * We have to know about an event-machine (probably the one that owns us), - * so we can pass newly-created connections to it. - */ - - bCallbackUnbind = false; - - #ifdef HAVE_EPOLL - EpollEvent.events = EPOLLIN; - #endif - #ifdef HAVE_KQUEUE - MyEventMachine->ArmKqueueReader (this); - #endif -} - - - - -/************************* -LoopbreakDescriptor::Read -*************************/ - -void LoopbreakDescriptor::Read() -{ - // TODO, refactor, this code is probably in the wrong place. - assert (MyEventMachine); - MyEventMachine->_ReadLoopBreaker(); -} - - -/************************** -LoopbreakDescriptor::Write -**************************/ - -void LoopbreakDescriptor::Write() -{ - // Why are we here? - throw std::runtime_error ("bad code path in loopbreak"); -} - -/************************************** -AcceptorDescriptor::AcceptorDescriptor -**************************************/ - -AcceptorDescriptor::AcceptorDescriptor (int sd, EventMachine_t *parent_em): - EventableDescriptor (sd, parent_em) -{ - #ifdef HAVE_EPOLL - EpollEvent.events = EPOLLIN; - #endif - #ifdef HAVE_KQUEUE - MyEventMachine->ArmKqueueReader (this); - #endif -} - - -/*************************************** -AcceptorDescriptor::~AcceptorDescriptor -***************************************/ - -AcceptorDescriptor::~AcceptorDescriptor() -{ -} - -/**************************************** -STATIC: AcceptorDescriptor::StopAcceptor -****************************************/ - -void AcceptorDescriptor::StopAcceptor (const char *binding) -{ - // TODO: This is something of a hack, or at least it's a static method of the wrong class. - AcceptorDescriptor *ad = dynamic_cast (Bindable_t::GetObject (binding)); - if (ad) - ad->ScheduleClose (false); - else - throw std::runtime_error ("failed to close nonexistent acceptor"); -} - - -/************************ -AcceptorDescriptor::Read -************************/ - -void AcceptorDescriptor::Read() -{ - /* Accept up to a certain number of sockets on the listening connection. - * Don't try to accept all that are present, because this would allow a DoS attack - * in which no data were ever read or written. We should accept more than one, - * if available, to keep the partially accepted sockets from backing up in the kernel. - */ - - /* Make sure we use non-blocking i/o on the acceptor socket, since we're selecting it - * for readability. According to Stevens UNP, it's possible for an acceptor to select readable - * and then block when we call accept. For example, the other end resets the connection after - * the socket selects readable and before we call accept. The kernel will remove the dead - * socket from the accept queue. If the accept queue is now empty, accept will block. - */ - - - struct sockaddr_in pin; - socklen_t addrlen = sizeof (pin); - - for (int i=0; i < 10; i++) { - int sd = accept (GetSocket(), (struct sockaddr*)&pin, &addrlen); - if (sd == INVALID_SOCKET) { - // This breaks the loop when we've accepted everything on the kernel queue, - // up to 10 new connections. But what if the *first* accept fails? - // Does that mean anything serious is happening, beyond the situation - // described in the note above? - break; - } - - // Set the newly-accepted socket non-blocking. - // On Windows, this may fail because, weirdly, Windows inherits the non-blocking - // attribute that we applied to the acceptor socket into the accepted one. - if (!SetSocketNonblocking (sd)) { - //int val = fcntl (sd, F_GETFL, 0); - //if (fcntl (sd, F_SETFL, val | O_NONBLOCK) == -1) { - shutdown (sd, 1); - closesocket (sd); - continue; - } - - - // Disable slow-start (Nagle algorithm). Eventually make this configurable. - int one = 1; - setsockopt (sd, IPPROTO_TCP, TCP_NODELAY, (char*) &one, sizeof(one)); - - - ConnectionDescriptor *cd = new ConnectionDescriptor (sd, MyEventMachine); - if (!cd) - throw std::runtime_error ("no newly accepted connection"); - cd->SetServerMode(); - if (EventCallback) { - (*EventCallback) (GetBinding().c_str(), EM_CONNECTION_ACCEPTED, cd->GetBinding().c_str(), cd->GetBinding().size()); - } - #ifdef HAVE_EPOLL - cd->GetEpollEvent()->events = EPOLLIN | (cd->SelectForWrite() ? EPOLLOUT : 0); - #endif - assert (MyEventMachine); - MyEventMachine->Add (cd); - #ifdef HAVE_KQUEUE - if (cd->SelectForWrite()) - MyEventMachine->ArmKqueueWriter (cd); - MyEventMachine->ArmKqueueReader (cd); - #endif - } - -} - - -/************************* -AcceptorDescriptor::Write -*************************/ - -void AcceptorDescriptor::Write() -{ - // Why are we here? - throw std::runtime_error ("bad code path in acceptor"); -} - - -/***************************** -AcceptorDescriptor::Heartbeat -*****************************/ - -void AcceptorDescriptor::Heartbeat() -{ - // No-op -} - - -/******************************* -AcceptorDescriptor::GetSockname -*******************************/ - -bool AcceptorDescriptor::GetSockname (struct sockaddr *s) -{ - bool ok = false; - if (s) { - socklen_t len = sizeof(*s); - int gp = getsockname (GetSocket(), s, &len); - if (gp == 0) - ok = true; - } - return ok; -} - - - -/************************************** -DatagramDescriptor::DatagramDescriptor -**************************************/ - -DatagramDescriptor::DatagramDescriptor (int sd, EventMachine_t *parent_em): - EventableDescriptor (sd, parent_em), - OutboundDataSize (0), - LastIo (gCurrentLoopTime), - InactivityTimeout (0) -{ - memset (&ReturnAddress, 0, sizeof(ReturnAddress)); - - /* Provisionally added 19Oct07. All datagram sockets support broadcasting. - * Until now, sending to a broadcast address would give EACCES (permission denied) - * on systems like Linux and BSD that require the SO_BROADCAST socket-option in order - * to accept a packet to a broadcast address. Solaris doesn't require it. I think - * Windows DOES require it but I'm not sure. - * - * Ruby does NOT do what we're doing here. In Ruby, you have to explicitly set SO_BROADCAST - * on a UDP socket in order to enable broadcasting. The reason for requiring the option - * in the first place is so that applications don't send broadcast datagrams by mistake. - * I imagine that could happen if a user of an application typed in an address that happened - * to be a broadcast address on that particular subnet. - * - * This is provisional because someone may eventually come up with a good reason not to - * do it for all UDP sockets. If that happens, then we'll need to add a usercode-level API - * to set the socket option, just like Ruby does. AND WE'LL ALSO BREAK CODE THAT DOESN'T - * EXPLICITLY SET THE OPTION. - */ - - int oval = 1; - int sob = setsockopt (GetSocket(), SOL_SOCKET, SO_BROADCAST, (char*)&oval, sizeof(oval)); - - #ifdef HAVE_EPOLL - EpollEvent.events = EPOLLIN; - #endif - #ifdef HAVE_KQUEUE - MyEventMachine->ArmKqueueReader (this); - #endif -} - - -/*************************************** -DatagramDescriptor::~DatagramDescriptor -***************************************/ - -DatagramDescriptor::~DatagramDescriptor() -{ - // Run down any stranded outbound data. - for (size_t i=0; i < OutboundPages.size(); i++) - OutboundPages[i].Free(); -} - - -/***************************** -DatagramDescriptor::Heartbeat -*****************************/ - -void DatagramDescriptor::Heartbeat() -{ - // Close it if its inactivity timer has expired. - - if (InactivityTimeout && ((gCurrentLoopTime - LastIo) >= InactivityTimeout)) - ScheduleClose (false); - //bCloseNow = true; -} - - -/************************ -DatagramDescriptor::Read -************************/ - -void DatagramDescriptor::Read() -{ - int sd = GetSocket(); - assert (sd != INVALID_SOCKET); - LastIo = gCurrentLoopTime; - - // This is an extremely large read buffer. - // In many cases you wouldn't expect to get any more than 4K. - char readbuffer [16 * 1024]; - - for (int i=0; i < 10; i++) { - // Don't read just one buffer and then move on. This is faster - // if there is a lot of incoming. - // But don't read indefinitely. Give other sockets a chance to run. - // NOTICE, we're reading one less than the buffer size. - // That's so we can put a guard byte at the end of what we send - // to user code. - - struct sockaddr_in sin; - socklen_t slen = sizeof (sin); - memset (&sin, 0, slen); - - int r = recvfrom (sd, readbuffer, sizeof(readbuffer) - 1, 0, (struct sockaddr*)&sin, &slen); - //cerr << ""; - - // In UDP, a zero-length packet is perfectly legal. - if (r >= 0) { - LastRead = gCurrentLoopTime; - - // Add a null-terminator at the the end of the buffer - // that we will send to the callback. - // DO NOT EVER CHANGE THIS. We want to explicitly allow users - // to be able to depend on this behavior, so they will have - // the option to do some things faster. Additionally it's - // a security guard against buffer overflows. - readbuffer [r] = 0; - - - // Set up a "temporary" return address so that callers can "reply" to us - // from within the callback we are about to invoke. That means that ordinary - // calls to "send_data_to_connection" (which is of course misnamed in this - // case) will result in packets being sent back to the same place that sent - // us this one. - // There is a different call (evma_send_datagram) for cases where the caller - // actually wants to send a packet somewhere else. - - memset (&ReturnAddress, 0, sizeof(ReturnAddress)); - memcpy (&ReturnAddress, &sin, slen); - - if (EventCallback) - (*EventCallback)(GetBinding().c_str(), EM_CONNECTION_READ, readbuffer, r); - - } - else { - // Basically a would-block, meaning we've read everything there is to read. - break; - } - - } - - -} - - -/************************* -DatagramDescriptor::Write -*************************/ - -void DatagramDescriptor::Write() -{ - /* It's possible for a socket to select writable and then no longer - * be writable by the time we get around to writing. The kernel might - * have used up its available output buffers between the select call - * and when we get here. So this condition is not an error. - * This code is very reminiscent of ConnectionDescriptor::_WriteOutboundData, - * but differs in the that the outbound data pages (received from the - * user) are _message-structured._ That is, we send each of them out - * one message at a time. - * TODO, we are currently suppressing the EMSGSIZE error!!! - */ - - int sd = GetSocket(); - assert (sd != INVALID_SOCKET); - LastIo = gCurrentLoopTime; - - assert (OutboundPages.size() > 0); - - // Send out up to 10 packets, then cycle the machine. - for (int i = 0; i < 10; i++) { - if (OutboundPages.size() <= 0) - break; - OutboundPage *op = &(OutboundPages[0]); - - // The nasty cast to (char*) is needed because Windows is brain-dead. - int s = sendto (sd, (char*)op->Buffer, op->Length, 0, (struct sockaddr*)&(op->From), sizeof(op->From)); - int e = errno; - - OutboundDataSize -= op->Length; - op->Free(); - OutboundPages.pop_front(); - - if (s == SOCKET_ERROR) { - #ifdef OS_UNIX - if ((e != EINPROGRESS) && (e != EWOULDBLOCK) && (e != EINTR)) { - #endif - #ifdef OS_WIN32 - if ((e != WSAEINPROGRESS) && (e != WSAEWOULDBLOCK)) { - #endif - Close(); - break; - } - } - } - - #ifdef HAVE_EPOLL - EpollEvent.events = (EPOLLIN | (SelectForWrite() ? EPOLLOUT : 0)); - assert (MyEventMachine); - MyEventMachine->Modify (this); - #endif -} - - -/********************************** -DatagramDescriptor::SelectForWrite -**********************************/ - -bool DatagramDescriptor::SelectForWrite() -{ - /* Changed 15Nov07, per bug report by Mark Zvillius. - * The outbound data size will be zero if there are zero-length outbound packets, - * so we now select writable in case the outbound page buffer is not empty. - * Note that the superclass ShouldDelete method still checks for outbound data size, - * which may be wrong. - */ - //return (GetOutboundDataSize() > 0); (Original) - return (OutboundPages.size() > 0); -} - - -/************************************ -DatagramDescriptor::SendOutboundData -************************************/ - -int DatagramDescriptor::SendOutboundData (const char *data, int length) -{ - // This is an exact clone of ConnectionDescriptor::SendOutboundData. - // That means it needs to move to a common ancestor. - - if (IsCloseScheduled()) - //if (bCloseNow || bCloseAfterWriting) - return 0; - - if (!data && (length > 0)) - throw std::runtime_error ("bad outbound data"); - char *buffer = (char *) malloc (length + 1); - if (!buffer) - throw std::runtime_error ("no allocation for outbound data"); - memcpy (buffer, data, length); - buffer [length] = 0; - OutboundPages.push_back (OutboundPage (buffer, length, ReturnAddress)); - OutboundDataSize += length; - #ifdef HAVE_EPOLL - EpollEvent.events = (EPOLLIN | EPOLLOUT); - assert (MyEventMachine); - MyEventMachine->Modify (this); - #endif - return length; -} - - -/**************************************** -DatagramDescriptor::SendOutboundDatagram -****************************************/ - -int DatagramDescriptor::SendOutboundDatagram (const char *data, int length, const char *address, int port) -{ - // This is an exact clone of ConnectionDescriptor::SendOutboundData. - // That means it needs to move to a common ancestor. - // TODO: Refactor this so there's no overlap with SendOutboundData. - - if (IsCloseScheduled()) - //if (bCloseNow || bCloseAfterWriting) - return 0; - - if (!address || !*address || !port) - return 0; - - sockaddr_in pin; - unsigned long HostAddr; - - HostAddr = inet_addr (address); - if (HostAddr == INADDR_NONE) { - // The nasty cast to (char*) is because Windows is brain-dead. - hostent *hp = gethostbyname ((char*)address); - if (!hp) - return 0; - HostAddr = ((in_addr*)(hp->h_addr))->s_addr; - } - - memset (&pin, 0, sizeof(pin)); - pin.sin_family = AF_INET; - pin.sin_addr.s_addr = HostAddr; - pin.sin_port = htons (port); - - - - if (!data && (length > 0)) - throw std::runtime_error ("bad outbound data"); - char *buffer = (char *) malloc (length + 1); - if (!buffer) - throw std::runtime_error ("no allocation for outbound data"); - memcpy (buffer, data, length); - buffer [length] = 0; - OutboundPages.push_back (OutboundPage (buffer, length, pin)); - OutboundDataSize += length; - #ifdef HAVE_EPOLL - EpollEvent.events = (EPOLLIN | EPOLLOUT); - assert (MyEventMachine); - MyEventMachine->Modify (this); - #endif - return length; -} - - -/**************************************** -STATIC: DatagramDescriptor::SendDatagram -****************************************/ - -int DatagramDescriptor::SendDatagram (const char *binding, const char *data, int length, const char *address, int port) -{ - DatagramDescriptor *dd = dynamic_cast (Bindable_t::GetObject (binding)); - if (dd) - return dd->SendOutboundDatagram (data, length, address, port); - else - return -1; -} - - -/********************************* -ConnectionDescriptor::GetPeername -*********************************/ - -bool ConnectionDescriptor::GetPeername (struct sockaddr *s) -{ - bool ok = false; - if (s) { - socklen_t len = sizeof(*s); - int gp = getpeername (GetSocket(), s, &len); - if (gp == 0) - ok = true; - } - return ok; -} - -/********************************* -ConnectionDescriptor::GetSockname -*********************************/ - -bool ConnectionDescriptor::GetSockname (struct sockaddr *s) -{ - bool ok = false; - if (s) { - socklen_t len = sizeof(*s); - int gp = getsockname (GetSocket(), s, &len); - if (gp == 0) - ok = true; - } - return ok; -} - - -/********************************************** -ConnectionDescriptor::GetCommInactivityTimeout -**********************************************/ - -int ConnectionDescriptor::GetCommInactivityTimeout (int *value) -{ - if (value) { - *value = InactivityTimeout; - return 1; - } - else { - // TODO, extended logging, got bad parameter. - return 0; - } -} - - -/********************************************** -ConnectionDescriptor::SetCommInactivityTimeout -**********************************************/ - -int ConnectionDescriptor::SetCommInactivityTimeout (int *value) -{ - int out = 0; - - if (value) { - if ((*value==0) || (*value >= 2)) { - // Replace the value and send the old one back to the caller. - int v = *value; - *value = InactivityTimeout; - InactivityTimeout = v; - out = 1; - } - else { - // TODO, extended logging, got bad value. - } - } - else { - // TODO, extended logging, got bad parameter. - } - - return out; -} - -/******************************* -DatagramDescriptor::GetPeername -*******************************/ - -bool DatagramDescriptor::GetPeername (struct sockaddr *s) -{ - bool ok = false; - if (s) { - memset (s, 0, sizeof(struct sockaddr)); - memcpy (s, &ReturnAddress, sizeof(ReturnAddress)); - ok = true; - } - return ok; -} - -/******************************* -DatagramDescriptor::GetSockname -*******************************/ - -bool DatagramDescriptor::GetSockname (struct sockaddr *s) -{ - bool ok = false; - if (s) { - socklen_t len = sizeof(*s); - int gp = getsockname (GetSocket(), s, &len); - if (gp == 0) - ok = true; - } - return ok; -} - - - -/******************************************** -DatagramDescriptor::GetCommInactivityTimeout -********************************************/ - -int DatagramDescriptor::GetCommInactivityTimeout (int *value) -{ - if (value) { - *value = InactivityTimeout; - return 1; - } - else { - // TODO, extended logging, got bad parameter. - return 0; - } -} - -/******************************************** -DatagramDescriptor::SetCommInactivityTimeout -********************************************/ - -int DatagramDescriptor::SetCommInactivityTimeout (int *value) -{ - int out = 0; - - if (value) { - if ((*value==0) || (*value >= 2)) { - // Replace the value and send the old one back to the caller. - int v = *value; - *value = InactivityTimeout; - InactivityTimeout = v; - out = 1; - } - else { - // TODO, extended logging, got bad value. - } - } - else { - // TODO, extended logging, got bad parameter. - } - - return out; -} - -/***************************************************************************** - -$Id$ - -File: em.cpp -Date: 06Apr06 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - -// THIS ENTIRE FILE WILL EVENTUALLY BE FOR UNIX BUILDS ONLY. -//#ifdef OS_UNIX - - -#include "project.h" - -// Keep a global variable floating around -// with the current loop time as set by the Event Machine. -// This avoids the need for frequent expensive calls to time(NULL); -time_t gCurrentLoopTime; - -#ifdef OS_WIN32 -unsigned gTickCountTickover; -unsigned gLastTickCount; -#endif - - -/* The numer of max outstanding timers was once a const enum defined in em.h. - * Now we define it here so that users can change its value if necessary. - */ -static int MaxOutstandingTimers = 1000; - - -/* Internal helper to convert strings to internet addresses. IPv6-aware. - * Not reentrant or threadsafe, optimized for speed. - */ -static struct sockaddr *name2address (const char *server, int port, int *family, int *bind_size); - - -/*************************************** -STATIC EventMachine_t::SetMaxTimerCount -***************************************/ - -void EventMachine_t::SetMaxTimerCount (int count) -{ - /* Allow a user to increase the maximum number of outstanding timers. - * If this gets "too high" (a metric that is of course platform dependent), - * bad things will happen like performance problems and possible overuse - * of memory. - * The actual timer mechanism is very efficient so it's hard to know what - * the practical max, but 100,000 shouldn't be too problematical. - */ - if (count < 100) - count = 100; - MaxOutstandingTimers = count; -} - - - -/****************************** -EventMachine_t::EventMachine_t -******************************/ - -EventMachine_t::EventMachine_t (void (*event_callback)(const char*, int, const char*, int)): - EventCallback (event_callback), - NextHeartbeatTime (0), - LoopBreakerReader (-1), - LoopBreakerWriter (-1), - bEpoll (false), - bKqueue (false), - epfd (-1) -{ - // Default time-slice is just smaller than one hundred mills. - Quantum.tv_sec = 0; - Quantum.tv_usec = 90000; - - gTerminateSignalReceived = false; - // Make sure the current loop time is sane, in case we do any initializations of - // objects before we start running. - gCurrentLoopTime = time(NULL); - - /* We initialize the network library here (only on Windows of course) - * and initialize "loop breakers." Our destructor also does some network-level - * cleanup. There's thus an implicit assumption that any given instance of EventMachine_t - * will only call ::Run once. Is that a good assumption? Should we move some of these - * inits and de-inits into ::Run? - */ - #ifdef OS_WIN32 - WSADATA w; - WSAStartup (MAKEWORD (1, 1), &w); - #endif - - _InitializeLoopBreaker(); -} - - -/******************************* -EventMachine_t::~EventMachine_t -*******************************/ - -EventMachine_t::~EventMachine_t() -{ - // Run down descriptors - size_t i; - for (i = 0; i < NewDescriptors.size(); i++) - delete NewDescriptors[i]; - for (i = 0; i < Descriptors.size(); i++) - delete Descriptors[i]; - - close (LoopBreakerReader); - close (LoopBreakerWriter); - - if (epfd != -1) - close (epfd); - if (kqfd != -1) - close (kqfd); -} - - -/************************* -EventMachine_t::_UseEpoll -*************************/ - -void EventMachine_t::_UseEpoll() -{ - /* Temporary. - * Use an internal flag to switch in epoll-based functionality until we determine - * how it should be integrated properly and the extent of the required changes. - * A permanent solution needs to allow the integration of additional technologies, - * like kqueue and Solaris's events. - */ - - #ifdef HAVE_EPOLL - bEpoll = true; - #endif -} - -/************************** -EventMachine_t::_UseKqueue -**************************/ - -void EventMachine_t::_UseKqueue() -{ - /* Temporary. - * See comments under _UseEpoll. - */ - - #ifdef HAVE_KQUEUE - bKqueue = true; - #endif -} - - -/**************************** -EventMachine_t::ScheduleHalt -****************************/ - -void EventMachine_t::ScheduleHalt() -{ - /* This is how we stop the machine. - * This can be called by clients. Signal handlers will probably - * set the global flag. - * For now this means there can only be one EventMachine ever running at a time. - * - * IMPORTANT: keep this light, fast, and async-safe. Don't do anything frisky in here, - * because it may be called from signal handlers invoked from code that we don't - * control. At this writing (20Sep06), EM does NOT install any signal handlers of - * its own. - * - * We need a FAQ. And one of the questions is: how do I stop EM when Ctrl-C happens? - * The answer is to call evma_stop_machine, which calls here, from a SIGINT handler. - */ - gTerminateSignalReceived = true; -} - - - -/******************************* -EventMachine_t::SetTimerQuantum -*******************************/ - -void EventMachine_t::SetTimerQuantum (int interval) -{ - /* We get a timer-quantum expressed in milliseconds. - * Don't set a quantum smaller than 5 or larger than 2500. - */ - - if ((interval < 5) || (interval > 2500)) - throw std::runtime_error ("invalid timer-quantum"); - - Quantum.tv_sec = interval / 1000; - Quantum.tv_usec = (interval % 1000) * 1000; -} - - -/************************************* -(STATIC) EventMachine_t::SetuidString -*************************************/ - -void EventMachine_t::SetuidString (const char *username) -{ - /* This method takes a caller-supplied username and tries to setuid - * to that user. There is no meaningful implementation (and no error) - * on Windows. On Unix, a failure to setuid the caller-supplied string - * causes a fatal abort, because presumably the program is calling here - * in order to fulfill a security requirement. If we fail silently, - * the user may continue to run with too much privilege. - * - * TODO, we need to decide on and document a way of generating C++ level errors - * that can be wrapped in documented Ruby exceptions, so users can catch - * and handle them. And distinguish it from errors that we WON'T let the Ruby - * user catch (like security-violations and resource-overallocation). - * A setuid failure here would be in the latter category. - */ - - #ifdef OS_UNIX - if (!username || !*username) - throw std::runtime_error ("setuid_string failed: no username specified"); - - struct passwd *p = getpwnam (username); - if (!p) - throw std::runtime_error ("setuid_string failed: unknown username"); - - if (setuid (p->pw_uid) != 0) - throw std::runtime_error ("setuid_string failed: no setuid"); - - // Success. - #endif -} - - -/**************************************** -(STATIC) EventMachine_t::SetRlimitNofile -****************************************/ - -int EventMachine_t::SetRlimitNofile (int nofiles) -{ - #ifdef OS_UNIX - struct rlimit rlim; - getrlimit (RLIMIT_NOFILE, &rlim); - if (nofiles >= 0) { - rlim.rlim_cur = nofiles; - if (nofiles > rlim.rlim_max) - rlim.rlim_max = nofiles; - setrlimit (RLIMIT_NOFILE, &rlim); - // ignore the error return, for now at least. - // TODO, emit an error message someday when we have proper debug levels. - } - getrlimit (RLIMIT_NOFILE, &rlim); - return rlim.rlim_cur; - #endif - - #ifdef OS_WIN32 - // No meaningful implementation on Windows. - return 0; - #endif -} - - -/********************************* -EventMachine_t::SignalLoopBreaker -*********************************/ - -void EventMachine_t::SignalLoopBreaker() -{ - #ifdef OS_UNIX - write (LoopBreakerWriter, "", 1); - #endif - #ifdef OS_WIN32 - sendto (LoopBreakerReader, "", 0, 0, (struct sockaddr*)&(LoopBreakerTarget), sizeof(LoopBreakerTarget)); - #endif -} - - -/************************************** -EventMachine_t::_InitializeLoopBreaker -**************************************/ - -void EventMachine_t::_InitializeLoopBreaker() -{ - /* A "loop-breaker" is a socket-descriptor that we can write to in order - * to break the main select loop. Primarily useful for things running on - * threads other than the main EM thread, so they can trigger processing - * of events that arise exogenously to the EM. - * Keep the loop-breaker pipe out of the main descriptor set, otherwise - * its events will get passed on to user code. - */ - - #ifdef OS_UNIX - int fd[2]; - if (pipe (fd)) - throw std::runtime_error ("no loop breaker"); - - LoopBreakerWriter = fd[1]; - LoopBreakerReader = fd[0]; - #endif - - #ifdef OS_WIN32 - int sd = socket (AF_INET, SOCK_DGRAM, 0); - if (sd == INVALID_SOCKET) - throw std::runtime_error ("no loop breaker socket"); - SetSocketNonblocking (sd); - - memset (&LoopBreakerTarget, 0, sizeof(LoopBreakerTarget)); - LoopBreakerTarget.sin_family = AF_INET; - LoopBreakerTarget.sin_addr.s_addr = inet_addr ("127.0.0.1"); - - srand ((int)time(NULL)); - int i; - for (i=0; i < 100; i++) { - int r = (rand() % 10000) + 20000; - LoopBreakerTarget.sin_port = htons (r); - if (bind (sd, (struct sockaddr*)&LoopBreakerTarget, sizeof(LoopBreakerTarget)) == 0) - break; - } - - if (i == 100) - throw std::runtime_error ("no loop breaker"); - LoopBreakerReader = sd; - #endif -} - - -/******************* -EventMachine_t::Run -*******************/ - -void EventMachine_t::Run() -{ - #ifdef OS_WIN32 - HookControlC (true); - #endif - - #ifdef HAVE_EPOLL - if (bEpoll) { - epfd = epoll_create (MaxEpollDescriptors); - if (epfd == -1) { - char buf[200]; - snprintf (buf, sizeof(buf)-1, "unable to create epoll descriptor: %s", strerror(errno)); - throw std::runtime_error (buf); - } - int cloexec = fcntl (epfd, F_GETFD, 0); - assert (cloexec >= 0); - cloexec |= FD_CLOEXEC; - fcntl (epfd, F_SETFD, cloexec); - - assert (LoopBreakerReader >= 0); - LoopbreakDescriptor *ld = new LoopbreakDescriptor (LoopBreakerReader, this); - assert (ld); - Add (ld); - } - #endif - - #ifdef HAVE_KQUEUE - if (bKqueue) { - kqfd = kqueue(); - if (kqfd == -1) { - char buf[200]; - snprintf (buf, sizeof(buf)-1, "unable to create kqueue descriptor: %s", strerror(errno)); - throw std::runtime_error (buf); - } - // cloexec not needed. By definition, kqueues are not carried across forks. - - assert (LoopBreakerReader >= 0); - LoopbreakDescriptor *ld = new LoopbreakDescriptor (LoopBreakerReader, this); - assert (ld); - Add (ld); - } - #endif - - while (true) { - gCurrentLoopTime = time(NULL); - if (!_RunTimers()) - break; - - /* _Add must precede _Modify because the same descriptor might - * be on both lists during the same pass through the machine, - * and to modify a descriptor before adding it would fail. - */ - _AddNewDescriptors(); - _ModifyDescriptors(); - - if (!_RunOnce()) - break; - if (gTerminateSignalReceived) - break; - } - - #ifdef OS_WIN32 - HookControlC (false); - #endif -} - - -/************************ -EventMachine_t::_RunOnce -************************/ - -bool EventMachine_t::_RunOnce() -{ - if (bEpoll) - return _RunEpollOnce(); - else if (bKqueue) - return _RunKqueueOnce(); - else - return _RunSelectOnce(); -} - - - -/***************************** -EventMachine_t::_RunEpollOnce -*****************************/ - -bool EventMachine_t::_RunEpollOnce() -{ - #ifdef HAVE_EPOLL - assert (epfd != -1); - struct epoll_event ev [MaxEpollDescriptors]; - int s; - - #ifdef BUILD_FOR_RUBY - TRAP_BEG; - #endif - s = epoll_wait (epfd, ev, MaxEpollDescriptors, 50); - #ifdef BUILD_FOR_RUBY - TRAP_END; - #endif - - if (s > 0) { - for (int i=0; i < s; i++) { - EventableDescriptor *ed = (EventableDescriptor*) ev[i].data.ptr; - - if (ev[i].events & (EPOLLERR | EPOLLHUP)) - ed->ScheduleClose (false); - if (ev[i].events & EPOLLIN) - ed->Read(); - if (ev[i].events & EPOLLOUT) { - ed->Write(); - epoll_ctl (epfd, EPOLL_CTL_MOD, ed->GetSocket(), ed->GetEpollEvent()); - // Ignoring return value - } - } - } - else if (s < 0) { - // epoll_wait can fail on error in a handful of ways. - // If this happens, then wait for a little while to avoid busy-looping. - // If the error was EINTR, we probably caught SIGCHLD or something, - // so keep the wait short. - timeval tv = {0, ((errno == EINTR) ? 5 : 50) * 1000}; - EmSelect (0, NULL, NULL, NULL, &tv); - } - - { // cleanup dying sockets - // vector::pop_back works in constant time. - // TODO, rip this out and only delete the descriptors we know have died, - // rather than traversing the whole list. - // Modified 05Jan08 per suggestions by Chris Heath. It's possible that - // an EventableDescriptor will have a descriptor value of -1. That will - // happen if EventableDescriptor::Close was called on it. In that case, - // don't call epoll_ctl to remove the socket's filters from the epoll set. - // According to the epoll docs, this happens automatically when the - // descriptor is closed anyway. This is different from the case where - // the socket has already been closed but the descriptor in the ED object - // hasn't yet been set to INVALID_SOCKET. - int i, j; - int nSockets = Descriptors.size(); - for (i=0, j=0; i < nSockets; i++) { - EventableDescriptor *ed = Descriptors[i]; - assert (ed); - if (ed->ShouldDelete()) { - if (ed->GetSocket() != INVALID_SOCKET) { - assert (bEpoll); // wouldn't be in this method otherwise. - assert (epfd != -1); - int e = epoll_ctl (epfd, EPOLL_CTL_DEL, ed->GetSocket(), ed->GetEpollEvent()); - // ENOENT or EBADF are not errors because the socket may be already closed when we get here. - if (e && (errno != ENOENT) && (errno != EBADF)) { - char buf [200]; - snprintf (buf, sizeof(buf)-1, "unable to delete epoll event: %s", strerror(errno)); - throw std::runtime_error (buf); - } - } - - ModifiedDescriptors.erase (ed); - delete ed; - } - else - Descriptors [j++] = ed; - } - while ((size_t)j < Descriptors.size()) - Descriptors.pop_back(); - - } - - // TODO, heartbeats. - // Added 14Sep07, its absence was noted by Brian Candler. But the comment was here, indicated - // that this got thought about and not done when EPOLL was originally written. Was there a reason - // not to do it, or was it an oversight? Certainly, running a heartbeat on 50,000 connections every - // two seconds can get to be a real bear, especially if all we're doing is timing out dead ones. - // Maybe there's a better way to do this. (Or maybe it's not that expensive after all.) - // - { // dispatch heartbeats - if (gCurrentLoopTime >= NextHeartbeatTime) { - NextHeartbeatTime = gCurrentLoopTime + HeartbeatInterval; - - for (int i=0; i < Descriptors.size(); i++) { - EventableDescriptor *ed = Descriptors[i]; - assert (ed); - ed->Heartbeat(); - } - } - } - - #ifdef BUILD_FOR_RUBY - if (!rb_thread_alone()) { - rb_thread_schedule(); - } - #endif - - return true; - #else - throw std::runtime_error ("epoll is not implemented on this platform"); - #endif -} - - -/****************************** -EventMachine_t::_RunKqueueOnce -******************************/ - -bool EventMachine_t::_RunKqueueOnce() -{ - #ifdef HAVE_KQUEUE - assert (kqfd != -1); - const int maxKevents = 2000; - struct kevent Karray [maxKevents]; - struct timespec ts = {0, 10000000}; // Too frequent. Use blocking_region - - int k; - #ifdef BUILD_FOR_RUBY - TRAP_BEG; - #endif - k = kevent (kqfd, NULL, 0, Karray, maxKevents, &ts); - #ifdef BUILD_FOR_RUBY - TRAP_END; - #endif - struct kevent *ke = Karray; - while (k > 0) { - EventableDescriptor *ed = (EventableDescriptor*) (ke->udata); - assert (ed); - - if (ke->filter == EVFILT_READ) - ed->Read(); - else if (ke->filter == EVFILT_WRITE) - ed->Write(); - else - cerr << "Discarding unknown kqueue event " << ke->filter << endl; - - --k; - ++ke; - } - - { // cleanup dying sockets - // vector::pop_back works in constant time. - // TODO, rip this out and only delete the descriptors we know have died, - // rather than traversing the whole list. - // In kqueue, closing a descriptor automatically removes its event filters. - - int i, j; - int nSockets = Descriptors.size(); - for (i=0, j=0; i < nSockets; i++) { - EventableDescriptor *ed = Descriptors[i]; - assert (ed); - if (ed->ShouldDelete()) { - ModifiedDescriptors.erase (ed); - delete ed; - } - else - Descriptors [j++] = ed; - } - while ((size_t)j < Descriptors.size()) - Descriptors.pop_back(); - - } - - { // dispatch heartbeats - if (gCurrentLoopTime >= NextHeartbeatTime) { - NextHeartbeatTime = gCurrentLoopTime + HeartbeatInterval; - - for (int i=0; i < Descriptors.size(); i++) { - EventableDescriptor *ed = Descriptors[i]; - assert (ed); - ed->Heartbeat(); - } - } - } - - - // TODO, replace this with rb_thread_blocking_region for 1.9 builds. - #ifdef BUILD_FOR_RUBY - if (!rb_thread_alone()) { - rb_thread_schedule(); - } - #endif - - return true; - #else - throw std::runtime_error ("kqueue is not implemented on this platform"); - #endif -} - - -/********************************* -EventMachine_t::_ModifyEpollEvent -*********************************/ - -void EventMachine_t::_ModifyEpollEvent (EventableDescriptor *ed) -{ - #ifdef HAVE_EPOLL - if (bEpoll) { - assert (epfd != -1); - assert (ed); - int e = epoll_ctl (epfd, EPOLL_CTL_MOD, ed->GetSocket(), ed->GetEpollEvent()); - if (e) { - char buf [200]; - snprintf (buf, sizeof(buf)-1, "unable to modify epoll event: %s", strerror(errno)); - throw std::runtime_error (buf); - } - } - #endif -} - - - -/************************** -SelectData_t::SelectData_t -**************************/ - -SelectData_t::SelectData_t() -{ - maxsocket = 0; - FD_ZERO (&fdreads); - FD_ZERO (&fdwrites); -} - - -#ifdef BUILD_FOR_RUBY -/***************** -_SelectDataSelect -*****************/ - -#ifdef HAVE_TBR -static VALUE _SelectDataSelect (void *v) -{ - SelectData_t *sd = (SelectData_t*)v; - sd->nSockets = select (sd->maxsocket+1, &(sd->fdreads), &(sd->fdwrites), NULL, &(sd->tv)); - return Qnil; -} -#endif - -/********************* -SelectData_t::_Select -*********************/ - -int SelectData_t::_Select() -{ - #ifdef HAVE_TBR - rb_thread_blocking_region (_SelectDataSelect, (void*)this, RUBY_UBF_IO, 0); - return nSockets; - #endif - - #ifndef HAVE_TBR - return EmSelect (maxsocket+1, &fdreads, &fdwrites, NULL, &tv); - #endif -} -#endif - - - -/****************************** -EventMachine_t::_RunSelectOnce -******************************/ - -bool EventMachine_t::_RunSelectOnce() -{ - // Crank the event machine once. - // If there are no descriptors to process, then sleep - // for a few hundred mills to avoid busy-looping. - // Return T/F to indicate whether we should continue. - // This is based on a select loop. Alternately provide epoll - // if we know we're running on a 2.6 kernel. - // epoll will be effective if we provide it as an alternative, - // however it has the same problem interoperating with Ruby - // threads that select does. - - //cerr << "X"; - - /* This protection is now obsolete, because we will ALWAYS - * have at least one descriptor (the loop-breaker) to read. - */ - /* - if (Descriptors.size() == 0) { - #ifdef OS_UNIX - timeval tv = {0, 200 * 1000}; - EmSelect (0, NULL, NULL, NULL, &tv); - return true; - #endif - #ifdef OS_WIN32 - Sleep (200); - return true; - #endif - } - */ - - SelectData_t SelectData; - /* - fd_set fdreads, fdwrites; - FD_ZERO (&fdreads); - FD_ZERO (&fdwrites); - - int maxsocket = 0; - */ - - // Always read the loop-breaker reader. - // Changed 23Aug06, provisionally implemented for Windows with a UDP socket - // running on localhost with a randomly-chosen port. (*Puke*) - // Windows has a version of the Unix pipe() library function, but it doesn't - // give you back descriptors that are selectable. - FD_SET (LoopBreakerReader, &(SelectData.fdreads)); - if (SelectData.maxsocket < LoopBreakerReader) - SelectData.maxsocket = LoopBreakerReader; - - // prepare the sockets for reading and writing - size_t i; - for (i = 0; i < Descriptors.size(); i++) { - EventableDescriptor *ed = Descriptors[i]; - assert (ed); - int sd = ed->GetSocket(); - assert (sd != INVALID_SOCKET); - - if (ed->SelectForRead()) - FD_SET (sd, &(SelectData.fdreads)); - if (ed->SelectForWrite()) - FD_SET (sd, &(SelectData.fdwrites)); - - if (SelectData.maxsocket < sd) - SelectData.maxsocket = sd; - } - - - { // read and write the sockets - //timeval tv = {1, 0}; // Solaris fails if the microseconds member is >= 1000000. - //timeval tv = Quantum; - SelectData.tv = Quantum; - int s = SelectData._Select(); - //rb_thread_blocking_region(xxx,(void*)&SelectData,RUBY_UBF_IO,0); - //int s = EmSelect (SelectData.maxsocket+1, &(SelectData.fdreads), &(SelectData.fdwrites), NULL, &(SelectData.tv)); - //int s = SelectData.nSockets; - if (s > 0) { - /* Changed 01Jun07. We used to handle the Loop-breaker right here. - * Now we do it AFTER all the regular descriptors. There's an - * incredibly important and subtle reason for this. Code on - * loop breakers is sometimes used to cause the reactor core to - * cycle (for example, to allow outbound network buffers to drain). - * If a loop-breaker handler reschedules itself (say, after determining - * that the write buffers are still too full), then it will execute - * IMMEDIATELY if _ReadLoopBreaker is done here instead of after - * the other descriptors are processed. That defeats the whole purpose. - */ - for (i=0; i < Descriptors.size(); i++) { - EventableDescriptor *ed = Descriptors[i]; - assert (ed); - int sd = ed->GetSocket(); - assert (sd != INVALID_SOCKET); - - if (FD_ISSET (sd, &(SelectData.fdwrites))) - ed->Write(); - if (FD_ISSET (sd, &(SelectData.fdreads))) - ed->Read(); - } - - if (FD_ISSET (LoopBreakerReader, &(SelectData.fdreads))) - _ReadLoopBreaker(); - } - else if (s < 0) { - // select can fail on error in a handful of ways. - // If this happens, then wait for a little while to avoid busy-looping. - // If the error was EINTR, we probably caught SIGCHLD or something, - // so keep the wait short. - timeval tv = {0, ((errno == EINTR) ? 5 : 50) * 1000}; - EmSelect (0, NULL, NULL, NULL, &tv); - } - } - - - { // dispatch heartbeats - if (gCurrentLoopTime >= NextHeartbeatTime) { - NextHeartbeatTime = gCurrentLoopTime + HeartbeatInterval; - - for (i=0; i < Descriptors.size(); i++) { - EventableDescriptor *ed = Descriptors[i]; - assert (ed); - ed->Heartbeat(); - } - } - } - - { // cleanup dying sockets - // vector::pop_back works in constant time. - int i, j; - int nSockets = Descriptors.size(); - for (i=0, j=0; i < nSockets; i++) { - EventableDescriptor *ed = Descriptors[i]; - assert (ed); - if (ed->ShouldDelete()) - delete ed; - else - Descriptors [j++] = ed; - } - while ((size_t)j < Descriptors.size()) - Descriptors.pop_back(); - - } - - return true; -} - - -/******************************** -EventMachine_t::_ReadLoopBreaker -********************************/ - -void EventMachine_t::_ReadLoopBreaker() -{ - /* The loop breaker has selected readable. - * Read it ONCE (it may block if we try to read it twice) - * and send a loop-break event back to user code. - */ - char buffer [1024]; - read (LoopBreakerReader, buffer, sizeof(buffer)); - if (EventCallback) - (*EventCallback)("", EM_LOOPBREAK_SIGNAL, "", 0); -} - - -/************************** -EventMachine_t::_RunTimers -**************************/ - -bool EventMachine_t::_RunTimers() -{ - // These are caller-defined timer handlers. - // Return T/F to indicate whether we should continue the main loop. - // We rely on the fact that multimaps sort by their keys to avoid - // inspecting the whole list every time we come here. - // Just keep inspecting and processing the list head until we hit - // one that hasn't expired yet. - - #ifdef OS_UNIX - struct timeval tv; - gettimeofday (&tv, NULL); - Int64 now = (((Int64)(tv.tv_sec)) * 1000000LL) + ((Int64)(tv.tv_usec)); - #endif - - #ifdef OS_WIN32 - unsigned tick = GetTickCount(); - if (tick < gLastTickCount) - gTickCountTickover += 1; - gLastTickCount = tick; - Int64 now = ((Int64)gTickCountTickover << 32) + (Int64)tick; - #endif - - while (true) { - multimap::iterator i = Timers.begin(); - if (i == Timers.end()) - break; - if (i->first > now) - break; - if (EventCallback) - (*EventCallback) ("", EM_TIMER_FIRED, i->second.GetBinding().c_str(), i->second.GetBinding().length()); - Timers.erase (i); - } - return true; -} - - - -/*********************************** -EventMachine_t::InstallOneshotTimer -***********************************/ - -const char *EventMachine_t::InstallOneshotTimer (int milliseconds) -{ - if (Timers.size() > MaxOutstandingTimers) - return false; - // Don't use the global loop-time variable here, because we might - // get called before the main event machine is running. - - #ifdef OS_UNIX - struct timeval tv; - gettimeofday (&tv, NULL); - Int64 fire_at = (((Int64)(tv.tv_sec)) * 1000000LL) + ((Int64)(tv.tv_usec)); - fire_at += ((Int64)milliseconds) * 1000LL; - #endif - - #ifdef OS_WIN32 - unsigned tick = GetTickCount(); - if (tick < gLastTickCount) - gTickCountTickover += 1; - gLastTickCount = tick; - - Int64 fire_at = ((Int64)gTickCountTickover << 32) + (Int64)tick; - fire_at += (Int64)milliseconds; - #endif - - Timer_t t; - multimap::iterator i = - Timers.insert (make_pair (fire_at, t)); - return i->second.GetBindingChars(); -} - - -/******************************* -EventMachine_t::ConnectToServer -*******************************/ - -const char *EventMachine_t::ConnectToServer (const char *server, int port) -{ - /* We want to spend no more than a few seconds waiting for a connection - * to a remote host. So we use a nonblocking connect. - * Linux disobeys the usual rules for nonblocking connects. - * Per Stevens (UNP p.410), you expect a nonblocking connect to select - * both readable and writable on error, and not to return EINPROGRESS - * if the connect can be fulfilled immediately. Linux violates both - * of these expectations. - * Any kind of nonblocking connect on Linux returns EINPROGRESS. - * The socket will then return writable when the disposition of the - * connect is known, but it will not also be readable in case of - * error! Weirdly, it will be readable in case there is data to read!!! - * (Which can happen with protocols like SSH and SMTP.) - * I suppose if you were so inclined you could consider this logical, - * but it's not the way Unix has historically done it. - * So we ignore the readable flag and read getsockopt to see if there - * was an error connecting. A select timeout works as expected. - * In regard to getsockopt: Linux does the Berkeley-style thing, - * not the Solaris-style, and returns zero with the error code in - * the error parameter. - * Return the binding-text of the newly-created pending connection, - * or NULL if there was a problem. - */ - - if (!server || !*server || !port) - return NULL; - - int family, bind_size; - struct sockaddr *bind_as = name2address (server, port, &family, &bind_size); - if (!bind_as) - return NULL; - - int sd = socket (family, SOCK_STREAM, 0); - if (sd == INVALID_SOCKET) - return NULL; - - /* - sockaddr_in pin; - unsigned long HostAddr; - - HostAddr = inet_addr (server); - if (HostAddr == INADDR_NONE) { - hostent *hp = gethostbyname ((char*)server); // Windows requires (char*) - if (!hp) { - // TODO: This gives the caller a fatal error. Not good. - // They can respond by catching RuntimeError (blecch). - // Possibly we need to fire an unbind event and provide - // a status code so user code can detect the cause of the - // failure. - return NULL; - } - HostAddr = ((in_addr*)(hp->h_addr))->s_addr; - } - - memset (&pin, 0, sizeof(pin)); - pin.sin_family = AF_INET; - pin.sin_addr.s_addr = HostAddr; - pin.sin_port = htons (port); - - int sd = socket (AF_INET, SOCK_STREAM, 0); - if (sd == INVALID_SOCKET) - return NULL; - */ - - // From here on, ALL error returns must close the socket. - // Set the new socket nonblocking. - if (!SetSocketNonblocking (sd)) { - closesocket (sd); - return NULL; - } - // Disable slow-start (Nagle algorithm). - int one = 1; - setsockopt (sd, IPPROTO_TCP, TCP_NODELAY, (char*) &one, sizeof(one)); - - const char *out = NULL; - - #ifdef OS_UNIX - //if (connect (sd, (sockaddr*)&pin, sizeof pin) == 0) { - if (connect (sd, bind_as, bind_size) == 0) { - // This is a connect success, which Linux appears - // never to give when the socket is nonblocking, - // even if the connection is intramachine or to - // localhost. - - /* Changed this branch 08Aug06. Evidently some kernels - * (FreeBSD for example) will actually return success from - * a nonblocking connect. This is a pretty simple case, - * just set up the new connection and clear the pending flag. - * Thanks to Chris Ochs for helping track this down. - * This branch never gets taken on Linux or (oddly) OSX. - * The original behavior was to throw an unimplemented, - * which the user saw as a fatal exception. Very unfriendly. - * - * Tweaked 10Aug06. Even though the connect disposition is - * known, we still set the connect-pending flag. That way - * some needed initialization will happen in the ConnectionDescriptor. - * (To wit, the ConnectionCompleted event gets sent to the client.) - */ - ConnectionDescriptor *cd = new ConnectionDescriptor (sd, this); - if (!cd) - throw std::runtime_error ("no connection allocated"); - cd->SetConnectPending (true); - Add (cd); - out = cd->GetBinding().c_str(); - } - else if (errno == EINPROGRESS) { - // Errno will generally always be EINPROGRESS, but on Linux - // we have to look at getsockopt to be sure what really happened. - int error; - socklen_t len; - len = sizeof(error); - int o = getsockopt (sd, SOL_SOCKET, SO_ERROR, &error, &len); - if ((o == 0) && (error == 0)) { - // Here, there's no disposition. - // Put the connection on the stack and wait for it to complete - // or time out. - ConnectionDescriptor *cd = new ConnectionDescriptor (sd, this); - if (!cd) - throw std::runtime_error ("no connection allocated"); - cd->SetConnectPending (true); - Add (cd); - out = cd->GetBinding().c_str(); - } - else { - /* This could be connection refused or some such thing. - * We will come here on Linux if a localhost connection fails. - * Changed 16Jul06: Originally this branch was a no-op, and - * we'd drop down to the end of the method, close the socket, - * and return NULL, which would cause the caller to GET A - * FATAL EXCEPTION. Now we keep the socket around but schedule an - * immediate close on it, so the caller will get a close-event - * scheduled on it. This was only an issue for localhost connections - * to non-listening ports. We may eventually need to revise this - * revised behavior, in case it causes problems like making it hard - * for people to know that a failure occurred. - */ - ConnectionDescriptor *cd = new ConnectionDescriptor (sd, this); - if (!cd) - throw std::runtime_error ("no connection allocated"); - cd->ScheduleClose (false); - Add (cd); - out = cd->GetBinding().c_str(); - } - } - else { - // The error from connect was something other then EINPROGRESS. - } - #endif - - #ifdef OS_WIN32 - //if (connect (sd, (sockaddr*)&pin, sizeof pin) == 0) { - if (connect (sd, bind_as, bind_size) == 0) { - // This is a connect success, which Windows appears - // never to give when the socket is nonblocking, - // even if the connection is intramachine or to - // localhost. - throw std::runtime_error ("unimplemented"); - } - else if (WSAGetLastError() == WSAEWOULDBLOCK) { - // Here, there's no disposition. - // Windows appears not to surface refused connections or - // such stuff at this point. - // Put the connection on the stack and wait for it to complete - // or time out. - ConnectionDescriptor *cd = new ConnectionDescriptor (sd, this); - if (!cd) - throw std::runtime_error ("no connection allocated"); - cd->SetConnectPending (true); - Add (cd); - out = cd->GetBinding().c_str(); - } - else { - // The error from connect was something other then WSAEWOULDBLOCK. - } - - #endif - - if (out == NULL) - closesocket (sd); - return out; -} - -/*********************************** -EventMachine_t::ConnectToUnixServer -***********************************/ - -const char *EventMachine_t::ConnectToUnixServer (const char *server) -{ - /* Connect to a Unix-domain server, which by definition is running - * on the same host. - * There is no meaningful implementation on Windows. - * There's no need to do a nonblocking connect, since the connection - * is always local and can always be fulfilled immediately. - */ - - #ifdef OS_WIN32 - throw std::runtime_error ("unix-domain connection unavailable on this platform"); - return NULL; - #endif - - // The whole rest of this function is only compiled on Unix systems. - #ifdef OS_UNIX - - const char *out = NULL; - - if (!server || !*server) - return NULL; - - sockaddr_un pun; - memset (&pun, 0, sizeof(pun)); - pun.sun_family = AF_LOCAL; - - // You ordinarily expect the server name field to be at least 1024 bytes long, - // but on Linux it can be MUCH shorter. - if (strlen(server) >= sizeof(pun.sun_path)) - throw std::runtime_error ("unix-domain server name is too long"); - - - strcpy (pun.sun_path, server); - - int fd = socket (AF_LOCAL, SOCK_STREAM, 0); - if (fd == INVALID_SOCKET) - return NULL; - - // From here on, ALL error returns must close the socket. - // NOTE: At this point, the socket is still a blocking socket. - if (connect (fd, (struct sockaddr*)&pun, sizeof(pun)) != 0) { - closesocket (fd); - return NULL; - } - - // Set the newly-connected socket nonblocking. - if (!SetSocketNonblocking (fd)) { - closesocket (fd); - return NULL; - } - - // Set up a connection descriptor and add it to the event-machine. - // Observe, even though we know the connection status is connect-success, - // we still set the "pending" flag, so some needed initializations take - // place. - ConnectionDescriptor *cd = new ConnectionDescriptor (fd, this); - if (!cd) - throw std::runtime_error ("no connection allocated"); - cd->SetConnectPending (true); - Add (cd); - out = cd->GetBinding().c_str(); - - if (out == NULL) - closesocket (fd); - - return out; - #endif -} - -/************************ -EventMachine_t::AttachFD -************************/ - -const char *EventMachine_t::AttachFD (int fd, bool notify_readable, bool notify_writable) -{ - #ifdef OS_UNIX - if (fcntl(fd, F_GETFL, 0) < 0) - throw std::runtime_error ("invalid file descriptor"); - #endif - - #ifdef OS_WIN32 - // TODO: add better check for invalid file descriptors (see ioctlsocket or getsockopt) - if (fd == INVALID_SOCKET) - throw std::runtime_error ("invalid file descriptor"); - #endif - - {// Check for duplicate descriptors - size_t i; - for (i = 0; i < Descriptors.size(); i++) { - EventableDescriptor *ed = Descriptors[i]; - assert (ed); - if (ed->GetSocket() == fd) - throw std::runtime_error ("adding existing descriptor"); - } - - for (i = 0; i < NewDescriptors.size(); i++) { - EventableDescriptor *ed = NewDescriptors[i]; - assert (ed); - if (ed->GetSocket() == fd) - throw std::runtime_error ("adding existing new descriptor"); - } - } - - ConnectionDescriptor *cd = new ConnectionDescriptor (fd, this); - if (!cd) - throw std::runtime_error ("no connection allocated"); - - cd->SetConnectPending (true); - cd->SetNotifyReadable (notify_readable); - cd->SetNotifyWritable (notify_writable); - - Add (cd); - - const char *out = NULL; - out = cd->GetBinding().c_str(); - if (out == NULL) - closesocket (fd); - return out; -} - -/************************ -EventMachine_t::DetachFD -************************/ - -int EventMachine_t::DetachFD (EventableDescriptor *ed) -{ - if (!ed) - throw std::runtime_error ("detaching bad descriptor"); - - #ifdef HAVE_EPOLL - if (bEpoll) { - if (ed->GetSocket() != INVALID_SOCKET) { - assert (bEpoll); // wouldn't be in this method otherwise. - assert (epfd != -1); - int e = epoll_ctl (epfd, EPOLL_CTL_DEL, ed->GetSocket(), ed->GetEpollEvent()); - // ENOENT or EBADF are not errors because the socket may be already closed when we get here. - if (e && (errno != ENOENT) && (errno != EBADF)) { - char buf [200]; - snprintf (buf, sizeof(buf)-1, "unable to delete epoll event: %s", strerror(errno)); - throw std::runtime_error (buf); - } - } - } - #endif - - #ifdef HAVE_KQUEUE - if (bKqueue) { - struct kevent k; - EV_SET (&k, ed->GetSocket(), EVFILT_READ, EV_DELETE, 0, 0, ed); - int t = kevent (kqfd, &k, 1, NULL, 0, NULL); - assert (t == 0); - } - #endif - - { // remove descriptor from lists - int i, j; - int nSockets = Descriptors.size(); - for (i=0, j=0; i < nSockets; i++) { - EventableDescriptor *ted = Descriptors[i]; - assert (ted); - if (ted != ed) - Descriptors [j++] = ted; - } - while ((size_t)j < Descriptors.size()) - Descriptors.pop_back(); - - ModifiedDescriptors.erase (ed); - } - - int fd = ed->GetSocket(); - - // We depend on ~EventableDescriptor not calling close() if the socket is invalid - ed->SetSocketInvalid(); - delete ed; - - return fd; -} - -/************ -name2address -************/ - -struct sockaddr *name2address (const char *server, int port, int *family, int *bind_size) -{ - // THIS IS NOT RE-ENTRANT OR THREADSAFE. Optimize for speed. - // Check the more-common cases first. - // Return NULL if no resolution. - - static struct sockaddr_in in4; - #ifndef __CYGWIN__ - static struct sockaddr_in6 in6; - #endif - struct hostent *hp; - - if (!server || !*server) - server = "0.0.0.0"; - - memset (&in4, 0, sizeof(in4)); - if ( (in4.sin_addr.s_addr = inet_addr (server)) != INADDR_NONE) { - if (family) - *family = AF_INET; - if (bind_size) - *bind_size = sizeof(in4); - in4.sin_family = AF_INET; - in4.sin_port = htons (port); - return (struct sockaddr*)&in4; - } - - #if defined(OS_UNIX) && !defined(__CYGWIN__) - memset (&in6, 0, sizeof(in6)); - if (inet_pton (AF_INET6, server, in6.sin6_addr.s6_addr) > 0) { - if (family) - *family = AF_INET6; - if (bind_size) - *bind_size = sizeof(in6); - in6.sin6_family = AF_INET6; - in6.sin6_port = htons (port); - return (struct sockaddr*)&in6; - } - #endif - - #ifdef OS_WIN32 - // TODO, must complete this branch. Windows doesn't have inet_pton. - // A possible approach is to make a getaddrinfo call with the supplied - // server address, constraining the hints to ipv6 and seeing if we - // get any addresses. - // For the time being, Ipv6 addresses aren't supported on Windows. - #endif - - hp = gethostbyname ((char*)server); // Windows requires the cast. - if (hp) { - in4.sin_addr.s_addr = ((in_addr*)(hp->h_addr))->s_addr; - if (family) - *family = AF_INET; - if (bind_size) - *bind_size = sizeof(in4); - in4.sin_family = AF_INET; - in4.sin_port = htons (port); - return (struct sockaddr*)&in4; - } - - return NULL; -} - - -/******************************* -EventMachine_t::CreateTcpServer -*******************************/ - -const char *EventMachine_t::CreateTcpServer (const char *server, int port) -{ - /* Create a TCP-acceptor (server) socket and add it to the event machine. - * Return the binding of the new acceptor to the caller. - * This binding will be referenced when the new acceptor sends events - * to indicate accepted connections. - */ - - - int family, bind_size; - struct sockaddr *bind_here = name2address (server, port, &family, &bind_size); - if (!bind_here) - return NULL; - - const char *output_binding = NULL; - - //struct sockaddr_in sin; - - int sd_accept = socket (family, SOCK_STREAM, 0); - if (sd_accept == INVALID_SOCKET) { - goto fail; - } - - /* - memset (&sin, 0, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = INADDR_ANY; - sin.sin_port = htons (port); - - if (server && *server) { - sin.sin_addr.s_addr = inet_addr (server); - if (sin.sin_addr.s_addr == INADDR_NONE) { - hostent *hp = gethostbyname ((char*)server); // Windows requires the cast. - if (hp == NULL) { - //__warning ("hostname not resolved: ", server); - goto fail; - } - sin.sin_addr.s_addr = ((in_addr*)(hp->h_addr))->s_addr; - } - } - */ - - { // set reuseaddr to improve performance on restarts. - int oval = 1; - if (setsockopt (sd_accept, SOL_SOCKET, SO_REUSEADDR, (char*)&oval, sizeof(oval)) < 0) { - //__warning ("setsockopt failed while creating listener",""); - goto fail; - } - } - - { // set CLOEXEC. Only makes sense on Unix - #ifdef OS_UNIX - int cloexec = fcntl (sd_accept, F_GETFD, 0); - assert (cloexec >= 0); - cloexec |= FD_CLOEXEC; - fcntl (sd_accept, F_SETFD, cloexec); - #endif - } - - - //if (bind (sd_accept, (struct sockaddr*)&sin, sizeof(sin))) { - if (bind (sd_accept, bind_here, bind_size)) { - //__warning ("binding failed"); - goto fail; - } - - if (listen (sd_accept, 100)) { - //__warning ("listen failed"); - goto fail; - } - - { - // Set the acceptor non-blocking. - // THIS IS CRUCIALLY IMPORTANT because we read it in a select loop. - if (!SetSocketNonblocking (sd_accept)) { - //int val = fcntl (sd_accept, F_GETFL, 0); - //if (fcntl (sd_accept, F_SETFL, val | O_NONBLOCK) == -1) { - goto fail; - } - } - - { // Looking good. - AcceptorDescriptor *ad = new AcceptorDescriptor (sd_accept, this); - if (!ad) - throw std::runtime_error ("unable to allocate acceptor"); - Add (ad); - output_binding = ad->GetBinding().c_str(); - } - - return output_binding; - - fail: - if (sd_accept != INVALID_SOCKET) - closesocket (sd_accept); - return NULL; -} - - -/********************************** -EventMachine_t::OpenDatagramSocket -**********************************/ - -const char *EventMachine_t::OpenDatagramSocket (const char *address, int port) -{ - const char *output_binding = NULL; - - int sd = socket (AF_INET, SOCK_DGRAM, 0); - if (sd == INVALID_SOCKET) - goto fail; - // from here on, early returns must close the socket! - - - struct sockaddr_in sin; - memset (&sin, 0, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_port = htons (port); - - - if (address && *address) { - sin.sin_addr.s_addr = inet_addr (address); - if (sin.sin_addr.s_addr == INADDR_NONE) { - hostent *hp = gethostbyname ((char*)address); // Windows requires the cast. - if (hp == NULL) - goto fail; - sin.sin_addr.s_addr = ((in_addr*)(hp->h_addr))->s_addr; - } - } - else - sin.sin_addr.s_addr = htonl (INADDR_ANY); - - - // Set the new socket nonblocking. - { - if (!SetSocketNonblocking (sd)) - //int val = fcntl (sd, F_GETFL, 0); - //if (fcntl (sd, F_SETFL, val | O_NONBLOCK) == -1) - goto fail; - } - - if (bind (sd, (struct sockaddr*)&sin, sizeof(sin)) != 0) - goto fail; - - { // Looking good. - DatagramDescriptor *ds = new DatagramDescriptor (sd, this); - if (!ds) - throw std::runtime_error ("unable to allocate datagram-socket"); - Add (ds); - output_binding = ds->GetBinding().c_str(); - } - - return output_binding; - - fail: - if (sd != INVALID_SOCKET) - closesocket (sd); - return NULL; -} - - - -/******************* -EventMachine_t::Add -*******************/ - -void EventMachine_t::Add (EventableDescriptor *ed) -{ - if (!ed) - throw std::runtime_error ("added bad descriptor"); - ed->SetEventCallback (EventCallback); - NewDescriptors.push_back (ed); -} - - -/******************************* -EventMachine_t::ArmKqueueWriter -*******************************/ - -void EventMachine_t::ArmKqueueWriter (EventableDescriptor *ed) -{ - #ifdef HAVE_KQUEUE - if (bKqueue) { - if (!ed) - throw std::runtime_error ("added bad descriptor"); - struct kevent k; - EV_SET (&k, ed->GetSocket(), EVFILT_WRITE, EV_ADD | EV_ONESHOT, 0, 0, ed); - int t = kevent (kqfd, &k, 1, NULL, 0, NULL); - assert (t == 0); - } - #endif -} - -/******************************* -EventMachine_t::ArmKqueueReader -*******************************/ - -void EventMachine_t::ArmKqueueReader (EventableDescriptor *ed) -{ - #ifdef HAVE_KQUEUE - if (bKqueue) { - if (!ed) - throw std::runtime_error ("added bad descriptor"); - struct kevent k; - EV_SET (&k, ed->GetSocket(), EVFILT_READ, EV_ADD, 0, 0, ed); - int t = kevent (kqfd, &k, 1, NULL, 0, NULL); - assert (t == 0); - } - #endif -} - -/********************************** -EventMachine_t::_AddNewDescriptors -**********************************/ - -void EventMachine_t::_AddNewDescriptors() -{ - /* Avoid adding descriptors to the main descriptor list - * while we're actually traversing the list. - * Any descriptors that are added as a result of processing timers - * or acceptors should go on a temporary queue and then added - * while we're not traversing the main list. - * Also, it (rarely) happens that a newly-created descriptor - * is immediately scheduled to close. It might be a good - * idea not to bother scheduling these for I/O but if - * we do that, we might bypass some important processing. - */ - - for (size_t i = 0; i < NewDescriptors.size(); i++) { - EventableDescriptor *ed = NewDescriptors[i]; - if (ed == NULL) - throw std::runtime_error ("adding bad descriptor"); - - #if HAVE_EPOLL - if (bEpoll) { - assert (epfd != -1); - int e = epoll_ctl (epfd, EPOLL_CTL_ADD, ed->GetSocket(), ed->GetEpollEvent()); - if (e) { - char buf [200]; - snprintf (buf, sizeof(buf)-1, "unable to add new descriptor: %s", strerror(errno)); - throw std::runtime_error (buf); - } - } - #endif - - #if HAVE_KQUEUE - /* - if (bKqueue) { - // INCOMPLETE. Some descriptors don't want to be readable. - assert (kqfd != -1); - struct kevent k; - EV_SET (&k, ed->GetSocket(), EVFILT_READ, EV_ADD, 0, 0, ed); - int t = kevent (kqfd, &k, 1, NULL, 0, NULL); - assert (t == 0); - } - */ - #endif - - Descriptors.push_back (ed); - } - NewDescriptors.clear(); -} - - -/********************************** -EventMachine_t::_ModifyDescriptors -**********************************/ - -void EventMachine_t::_ModifyDescriptors() -{ - /* For implementations which don't level check every descriptor on - * every pass through the machine, as select does. - * If we're not selecting, then descriptors need a way to signal to the - * machine that their readable or writable status has changed. - * That's what the ::Modify call is for. We do it this way to avoid - * modifying descriptors during the loop traversal, where it can easily - * happen that an object (like a UDP socket) gets data written on it by - * the application during #post_init. That would take place BEFORE the - * descriptor even gets added to the epoll descriptor, so the modify - * operation will crash messily. - * Another really messy possibility is for a descriptor to put itself - * on the Modified list, and then get deleted before we get here. - * Remember, deletes happen after the I/O traversal and before the - * next pass through here. So we have to make sure when we delete a - * descriptor to remove it from the Modified list. - */ - - #ifdef HAVE_EPOLL - if (bEpoll) { - set::iterator i = ModifiedDescriptors.begin(); - while (i != ModifiedDescriptors.end()) { - assert (*i); - _ModifyEpollEvent (*i); - ++i; - } - } - #endif - - ModifiedDescriptors.clear(); -} - - -/********************** -EventMachine_t::Modify -**********************/ - -void EventMachine_t::Modify (EventableDescriptor *ed) -{ - if (!ed) - throw std::runtime_error ("modified bad descriptor"); - ModifiedDescriptors.insert (ed); -} - - -/*********************************** -EventMachine_t::_OpenFileForWriting -***********************************/ - -const char *EventMachine_t::_OpenFileForWriting (const char *filename) -{ - /* - * Return the binding-text of the newly-opened file, - * or NULL if there was a problem. - */ - - if (!filename || !*filename) - return NULL; - - int fd = open (filename, O_CREAT|O_TRUNC|O_WRONLY|O_NONBLOCK, 0644); - - FileStreamDescriptor *fsd = new FileStreamDescriptor (fd, this); - if (!fsd) - throw std::runtime_error ("no file-stream allocated"); - Add (fsd); - return fsd->GetBinding().c_str(); - -} - - -/************************************** -EventMachine_t::CreateUnixDomainServer -**************************************/ - -const char *EventMachine_t::CreateUnixDomainServer (const char *filename) -{ - /* Create a UNIX-domain acceptor (server) socket and add it to the event machine. - * Return the binding of the new acceptor to the caller. - * This binding will be referenced when the new acceptor sends events - * to indicate accepted connections. - * THERE IS NO MEANINGFUL IMPLEMENTATION ON WINDOWS. - */ - - #ifdef OS_WIN32 - throw std::runtime_error ("unix-domain server unavailable on this platform"); - #endif - - // The whole rest of this function is only compiled on Unix systems. - #ifdef OS_UNIX - const char *output_binding = NULL; - - struct sockaddr_un s_sun; - - int sd_accept = socket (AF_LOCAL, SOCK_STREAM, 0); - if (sd_accept == INVALID_SOCKET) { - goto fail; - } - - if (!filename || !*filename) - goto fail; - unlink (filename); - - bzero (&s_sun, sizeof(s_sun)); - s_sun.sun_family = AF_LOCAL; - strncpy (s_sun.sun_path, filename, sizeof(s_sun.sun_path)-1); - - // don't bother with reuseaddr for a local socket. - - { // set CLOEXEC. Only makes sense on Unix - #ifdef OS_UNIX - int cloexec = fcntl (sd_accept, F_GETFD, 0); - assert (cloexec >= 0); - cloexec |= FD_CLOEXEC; - fcntl (sd_accept, F_SETFD, cloexec); - #endif - } - - if (bind (sd_accept, (struct sockaddr*)&s_sun, sizeof(s_sun))) { - //__warning ("binding failed"); - goto fail; - } - - if (listen (sd_accept, 100)) { - //__warning ("listen failed"); - goto fail; - } - - { - // Set the acceptor non-blocking. - // THIS IS CRUCIALLY IMPORTANT because we read it in a select loop. - if (!SetSocketNonblocking (sd_accept)) { - //int val = fcntl (sd_accept, F_GETFL, 0); - //if (fcntl (sd_accept, F_SETFL, val | O_NONBLOCK) == -1) { - goto fail; - } - } - - { // Looking good. - AcceptorDescriptor *ad = new AcceptorDescriptor (sd_accept, this); - if (!ad) - throw std::runtime_error ("unable to allocate acceptor"); - Add (ad); - output_binding = ad->GetBinding().c_str(); - } - - return output_binding; - - fail: - if (sd_accept != INVALID_SOCKET) - closesocket (sd_accept); - return NULL; - #endif // OS_UNIX -} - - -/********************* -EventMachine_t::Popen -*********************/ -#if OBSOLETE -const char *EventMachine_t::Popen (const char *cmd, const char *mode) -{ - #ifdef OS_WIN32 - throw std::runtime_error ("popen is currently unavailable on this platform"); - #endif - - // The whole rest of this function is only compiled on Unix systems. - // Eventually we need this functionality (or a full-duplex equivalent) on Windows. - #ifdef OS_UNIX - const char *output_binding = NULL; - - FILE *fp = popen (cmd, mode); - if (!fp) - return NULL; - - // From here, all early returns must pclose the stream. - - // According to the pipe(2) manpage, descriptors returned from pipe have both - // CLOEXEC and NONBLOCK clear. Do NOT set CLOEXEC. DO set nonblocking. - if (!SetSocketNonblocking (fileno (fp))) { - pclose (fp); - return NULL; - } - - { // Looking good. - PipeDescriptor *pd = new PipeDescriptor (fp, this); - if (!pd) - throw std::runtime_error ("unable to allocate pipe"); - Add (pd); - output_binding = pd->GetBinding().c_str(); - } - - return output_binding; - #endif -} -#endif // OBSOLETE - -/************************** -EventMachine_t::Socketpair -**************************/ - -const char *EventMachine_t::Socketpair (char * const*cmd_strings) -{ - #ifdef OS_WIN32 - throw std::runtime_error ("socketpair is currently unavailable on this platform"); - #endif - - // The whole rest of this function is only compiled on Unix systems. - // Eventually we need this functionality (or a full-duplex equivalent) on Windows. - #ifdef OS_UNIX - // Make sure the incoming array of command strings is sane. - if (!cmd_strings) - return NULL; - int j; - for (j=0; j < 100 && cmd_strings[j]; j++) - ; - if ((j==0) || (j==100)) - return NULL; - - const char *output_binding = NULL; - - int sv[2]; - if (socketpair (AF_LOCAL, SOCK_STREAM, 0, sv) < 0) - return NULL; - // from here, all early returns must close the pair of sockets. - - // Set the parent side of the socketpair nonblocking. - // We don't care about the child side, and most child processes will expect their - // stdout to be blocking. Thanks to Duane Johnson and Bill Kelly for pointing this out. - // Obviously DON'T set CLOEXEC. - if (!SetSocketNonblocking (sv[0])) { - close (sv[0]); - close (sv[1]); - return NULL; - } - - pid_t f = fork(); - if (f > 0) { - close (sv[1]); - PipeDescriptor *pd = new PipeDescriptor (sv[0], f, this); - if (!pd) - throw std::runtime_error ("unable to allocate pipe"); - Add (pd); - output_binding = pd->GetBinding().c_str(); - } - else if (f == 0) { - close (sv[0]); - dup2 (sv[1], STDIN_FILENO); - close (sv[1]); - dup2 (STDIN_FILENO, STDOUT_FILENO); - execvp (cmd_strings[0], cmd_strings+1); - exit (-1); // end the child process if the exec doesn't work. - } - else - throw std::runtime_error ("no fork"); - - return output_binding; - #endif -} - - -/**************************** -EventMachine_t::OpenKeyboard -****************************/ - -const char *EventMachine_t::OpenKeyboard() -{ - KeyboardDescriptor *kd = new KeyboardDescriptor (this); - if (!kd) - throw std::runtime_error ("no keyboard-object allocated"); - Add (kd); - return kd->GetBinding().c_str(); -} - - - - - -//#endif // OS_UNIX - -/***************************************************************************** - -$Id$ - -File: emwin.cpp -Date: 05May06 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - - -// THIS ENTIRE FILE IS FOR WINDOWS BUILDS ONLY -// INCOMPLETE AND DISABLED FOR NOW. -#ifdef xOS_WIN32 - -#include "project.h" - - -// Keep a global variable floating around -// with the current loop time as set by the Event Machine. -// This avoids the need for frequent expensive calls to time(NULL); -time_t gCurrentLoopTime; - - -/****************************** -EventMachine_t::EventMachine_t -******************************/ - -EventMachine_t::EventMachine_t (void (*event_callback)(const char*, int, const char*, int)): - EventCallback (event_callback), - NextHeartbeatTime (0) -{ - gTerminateSignalReceived = false; - Iocp = NULL; -} - - -/******************************* -EventMachine_t::~EventMachine_t -*******************************/ - -EventMachine_t::~EventMachine_t() -{ - cerr << "EM __dt\n"; - if (Iocp) - CloseHandle (Iocp); -} - - -/**************************** -EventMachine_t::ScheduleHalt -****************************/ - -void EventMachine_t::ScheduleHalt() -{ - /* This is how we stop the machine. - * This can be called by clients. Signal handlers will probably - * set the global flag. - * For now this means there can only be one EventMachine ever running at a time. - */ - gTerminateSignalReceived = true; -} - - - -/******************* -EventMachine_t::Run -*******************/ - -void EventMachine_t::Run() -{ - HookControlC (true); - - Iocp = CreateIoCompletionPort (INVALID_HANDLE_VALUE, NULL, 0, 0); - if (Iocp == NULL) - throw std::runtime_error ("no completion port"); - - - DWORD nBytes, nCompletionKey; - LPOVERLAPPED Overlapped; - - do { - gCurrentLoopTime = time(NULL); - // Have some kind of strategy that will dequeue maybe up to 10 completions - // without running the timers as long as they are available immediately. - // Otherwise in a busy server we're calling them every time through the loop. - if (!_RunTimers()) - break; - if (GetQueuedCompletionStatus (Iocp, &nBytes, &nCompletionKey, &Overlapped, 1000)) { - } - cerr << "+"; - } while (!gTerminateSignalReceived); - - - /* - while (true) { - gCurrentLoopTime = time(NULL); - if (!_RunTimers()) - break; - _AddNewDescriptors(); - if (!_RunOnce()) - break; - if (gTerminateSignalReceived) - break; - } - */ - - HookControlC (false); -} - - -/************************** -EventMachine_t::_RunTimers -**************************/ - -bool EventMachine_t::_RunTimers() -{ - // These are caller-defined timer handlers. - // Return T/F to indicate whether we should continue the main loop. - // We rely on the fact that multimaps sort by their keys to avoid - // inspecting the whole list every time we come here. - // Just keep inspecting and processing the list head until we hit - // one that hasn't expired yet. - - while (true) { - multimap::iterator i = Timers.begin(); - if (i == Timers.end()) - break; - if (i->first > gCurrentLoopTime) - break; - if (EventCallback) - (*EventCallback) ("", EM_TIMER_FIRED, i->second.GetBinding().c_str(), i->second.GetBinding().length()); - Timers.erase (i); - } - return true; -} - - -/*********************************** -EventMachine_t::InstallOneshotTimer -***********************************/ - -const char *EventMachine_t::InstallOneshotTimer (int seconds) -{ - if (Timers.size() > MaxOutstandingTimers) - return false; - // Don't use the global loop-time variable here, because we might - // get called before the main event machine is running. - - Timer_t t; - Timers.insert (make_pair (time(NULL) + seconds, t)); - return t.GetBinding().c_str(); -} - - -/********************************** -EventMachine_t::OpenDatagramSocket -**********************************/ - -const char *EventMachine_t::OpenDatagramSocket (const char *address, int port) -{ - cerr << "OPEN DATAGRAM SOCKET\n"; - return "Unimplemented"; -} - - -/******************************* -EventMachine_t::CreateTcpServer -*******************************/ - -const char *EventMachine_t::CreateTcpServer (const char *server, int port) -{ - /* Create a TCP-acceptor (server) socket and add it to the event machine. - * Return the binding of the new acceptor to the caller. - * This binding will be referenced when the new acceptor sends events - * to indicate accepted connections. - */ - - const char *output_binding = NULL; - - struct sockaddr_in sin; - - SOCKET sd_accept = socket (AF_INET, SOCK_STREAM, 0); - if (sd_accept == INVALID_SOCKET) { - goto fail; - } - - memset (&sin, 0, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = INADDR_ANY; - sin.sin_port = htons (port); - - if (server && *server) { - sin.sin_addr.s_addr = inet_addr (server); - if (sin.sin_addr.s_addr == INADDR_NONE) { - hostent *hp = gethostbyname (server); - if (hp == NULL) { - //__warning ("hostname not resolved: ", server); - goto fail; - } - sin.sin_addr.s_addr = ((in_addr*)(hp->h_addr))->s_addr; - } - } - - - // No need to set reuseaddr on Windows. - - - if (bind (sd_accept, (struct sockaddr*)&sin, sizeof(sin))) { - //__warning ("binding failed"); - goto fail; - } - - if (listen (sd_accept, 100)) { - //__warning ("listen failed"); - goto fail; - } - - { // Looking good. - AcceptorDescriptor *ad = new AcceptorDescriptor (this, sd_accept); - if (!ad) - throw std::runtime_error ("unable to allocate acceptor"); - Add (ad); - output_binding = ad->GetBinding().c_str(); - - CreateIoCompletionPort ((HANDLE)sd_accept, Iocp, NULL, 0); - SOCKET sd = socket (AF_INET, SOCK_STREAM, 0); - CreateIoCompletionPort ((HANDLE)sd, Iocp, NULL, 0); - AcceptEx (sd_accept, sd, - } - - return output_binding; - - fail: - if (sd_accept != INVALID_SOCKET) - closesocket (sd_accept); - return NULL; -} - - -/******************************* -EventMachine_t::ConnectToServer -*******************************/ - -const char *EventMachine_t::ConnectToServer (const char *server, int port) -{ - if (!server || !*server || !port) - return NULL; - - sockaddr_in pin; - unsigned long HostAddr; - - HostAddr = inet_addr (server); - if (HostAddr == INADDR_NONE) { - hostent *hp = gethostbyname (server); - if (!hp) - return NULL; - HostAddr = ((in_addr*)(hp->h_addr))->s_addr; - } - - memset (&pin, 0, sizeof(pin)); - pin.sin_family = AF_INET; - pin.sin_addr.s_addr = HostAddr; - pin.sin_port = htons (port); - - int sd = socket (AF_INET, SOCK_STREAM, 0); - if (sd == INVALID_SOCKET) - return NULL; - - - LPOVERLAPPED olap = (LPOVERLAPPED) calloc (1, sizeof (OVERLAPPED)); - cerr << "I'm dying now\n"; - throw runtime_error ("UNIMPLEMENTED!!!\n"); - -} - - - -/******************* -EventMachine_t::Add -*******************/ - -void EventMachine_t::Add (EventableDescriptor *ed) -{ - cerr << "ADD\n"; -} - - - -#endif // OS_WIN32 - -/***************************************************************************** - -$Id$ - -File: epoll.cpp -Date: 06Jun07 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - - -#ifdef HAVE_EPOLL - -#include "project.h" - -#endif // HAVE_EPOLL - -/***************************************************************************** - -$Id: mapper.cpp 4527 2007-07-04 10:21:34Z francis $ - -File: mapper.cpp -Date: 02Jul07 - -Copyright (C) 2007 by Francis Cianfrocca. All Rights Reserved. -Gmail: garbagecat10 - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - - -////////////////////////////////////////////////////////////////////// -// UNIX implementation -////////////////////////////////////////////////////////////////////// - - -#ifdef OS_UNIX - -#include -#include -#include -#include -#include - -#include -#include "unistd.h" -#include -#include -#include -using namespace std; - -#include "mapper.h" - -/****************** -Mapper_t::Mapper_t -******************/ - -Mapper_t::Mapper_t (const string &filename) -{ - /* We ASSUME we can open the file. - * (More precisely, we assume someone else checked before we got here.) - */ - - Fd = open (filename.c_str(), O_RDONLY); - if (Fd < 0) - throw runtime_error (strerror (errno)); - - struct stat st; - if (fstat (Fd, &st)) - throw runtime_error (strerror (errno)); - FileSize = st.st_size; - - MapPoint = (const char*) mmap (0, FileSize, PROT_READ, MAP_SHARED, Fd, 0); - if (MapPoint == MAP_FAILED) - throw runtime_error (strerror (errno)); -} - - -/******************* -Mapper_t::~Mapper_t -*******************/ - -Mapper_t::~Mapper_t() -{ - Close(); -} - - -/*************** -Mapper_t::Close -***************/ - -void Mapper_t::Close() -{ - // Can be called multiple times. - // Calls to GetChunk are invalid after a call to Close. - if (MapPoint) { - munmap ((void*)MapPoint, FileSize); - MapPoint = NULL; - } - if (Fd >= 0) { - close (Fd); - Fd = -1; - } -} - -/****************** -Mapper_t::GetChunk -******************/ - -const char *Mapper_t::GetChunk (unsigned start) -{ - return MapPoint + start; -} - - - -#endif // OS_UNIX - - -////////////////////////////////////////////////////////////////////// -// WINDOWS implementation -////////////////////////////////////////////////////////////////////// - -#ifdef OS_WIN32 - -#include - -#include -#include -#include -using namespace std; - -#include "mapper.h" - -/****************** -Mapper_t::Mapper_t -******************/ - -Mapper_t::Mapper_t (const string &filename) -{ - /* We ASSUME we can open the file. - * (More precisely, we assume someone else checked before we got here.) - */ - - hFile = INVALID_HANDLE_VALUE; - hMapping = NULL; - MapPoint = NULL; - FileSize = 0; - - hFile = CreateFile (filename.c_str(), GENERIC_READ|GENERIC_WRITE, FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - - if (hFile == INVALID_HANDLE_VALUE) - throw runtime_error ("File not found"); - - BY_HANDLE_FILE_INFORMATION i; - if (GetFileInformationByHandle (hFile, &i)) - FileSize = i.nFileSizeLow; - - hMapping = CreateFileMapping (hFile, NULL, PAGE_READWRITE, 0, 0, NULL); - if (!hMapping) - throw runtime_error ("File not mapped"); - - MapPoint = (const char*) MapViewOfFile (hMapping, FILE_MAP_WRITE, 0, 0, 0); - if (!MapPoint) - throw runtime_error ("Mappoint not read"); -} - - -/******************* -Mapper_t::~Mapper_t -*******************/ - -Mapper_t::~Mapper_t() -{ - Close(); -} - -/*************** -Mapper_t::Close -***************/ - -void Mapper_t::Close() -{ - // Can be called multiple times. - // Calls to GetChunk are invalid after a call to Close. - if (MapPoint) { - UnmapViewOfFile (MapPoint); - MapPoint = NULL; - } - if (hMapping != NULL) { - CloseHandle (hMapping); - hMapping = NULL; - } - if (hFile != INVALID_HANDLE_VALUE) { - CloseHandle (hFile); - hMapping = INVALID_HANDLE_VALUE; - } -} - - -/****************** -Mapper_t::GetChunk -******************/ - -const char *Mapper_t::GetChunk (unsigned start) -{ - return MapPoint + start; -} - - - -#endif // OS_WINDOWS -/***************************************************************************** - -$Id: rubymain.cpp 4529 2007-07-04 11:32:22Z francis $ - -File: rubymain.cpp -Date: 02Jul07 - -Copyright (C) 2007 by Francis Cianfrocca. All Rights Reserved. -Gmail: garbagecat10 - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - - - -#include -#include -using namespace std; - -#include -#include "mapper.h" - -static VALUE EmModule; -static VALUE FastFileReader; -static VALUE Mapper; - - - -/********* -mapper_dt -*********/ - -static void mapper_dt (void *ptr) -{ - if (ptr) - delete (Mapper_t*) ptr; -} - -/********** -mapper_new -**********/ - -static VALUE mapper_new (VALUE self, VALUE filename) -{ - Mapper_t *m = new Mapper_t (StringValuePtr (filename)); - if (!m) - rb_raise (rb_eException, "No Mapper Object"); - VALUE v = Data_Wrap_Struct (Mapper, 0, mapper_dt, (void*)m); - return v; -} - - -/**************** -mapper_get_chunk -****************/ - -static VALUE mapper_get_chunk (VALUE self, VALUE start, VALUE length) -{ - Mapper_t *m = NULL; - Data_Get_Struct (self, Mapper_t, m); - if (!m) - rb_raise (rb_eException, "No Mapper Object"); - - // TODO, what if some moron sends us a negative start value? - unsigned _start = NUM2INT (start); - unsigned _length = NUM2INT (length); - if ((_start + _length) > m->GetFileSize()) - rb_raise (rb_eException, "Mapper Range Error"); - - const char *chunk = m->GetChunk (_start); - if (!chunk) - rb_raise (rb_eException, "No Mapper Chunk"); - return rb_str_new (chunk, _length); -} - -/************ -mapper_close -************/ - -static VALUE mapper_close (VALUE self) -{ - Mapper_t *m = NULL; - Data_Get_Struct (self, Mapper_t, m); - if (!m) - rb_raise (rb_eException, "No Mapper Object"); - m->Close(); - return Qnil; -} - -/*********** -mapper_size -***********/ - -static VALUE mapper_size (VALUE self) -{ - Mapper_t *m = NULL; - Data_Get_Struct (self, Mapper_t, m); - if (!m) - rb_raise (rb_eException, "No Mapper Object"); - return INT2NUM (m->GetFileSize()); -} - - -/********************** -Init_fastfilereaderext -**********************/ - -extern "C" void Init_fastfilereaderext() -{ - EmModule = rb_define_module ("EventMachine"); - FastFileReader = rb_define_class_under (EmModule, "FastFileReader", rb_cObject); - Mapper = rb_define_class_under (FastFileReader, "Mapper", rb_cObject); - - rb_define_module_function (Mapper, "new", (VALUE(*)(...))mapper_new, 1); - rb_define_method (Mapper, "size", (VALUE(*)(...))mapper_size, 0); - rb_define_method (Mapper, "close", (VALUE(*)(...))mapper_close, 0); - rb_define_method (Mapper, "get_chunk", (VALUE(*)(...))mapper_get_chunk, 2); -} - - - -/***************************************************************************** - -$Id$ - -File: files.cpp -Date: 26Aug06 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - -#include "project.h" - - -/****************************************** -FileStreamDescriptor::FileStreamDescriptor -******************************************/ - -FileStreamDescriptor::FileStreamDescriptor (int fd, EventMachine_t *em): - EventableDescriptor (fd, em), - OutboundDataSize (0) -{ -cerr << "#####"; -} - - -/******************************************* -FileStreamDescriptor::~FileStreamDescriptor -*******************************************/ - -FileStreamDescriptor::~FileStreamDescriptor() -{ - // Run down any stranded outbound data. - for (size_t i=0; i < OutboundPages.size(); i++) - OutboundPages[i].Free(); -} - - -/************************** -FileStreamDescriptor::Read -**************************/ - -void FileStreamDescriptor::Read() -{ -} - -/*************************** -FileStreamDescriptor::Write -***************************/ - -void FileStreamDescriptor::Write() -{ -} - - -/******************************* -FileStreamDescriptor::Heartbeat -*******************************/ - -void FileStreamDescriptor::Heartbeat() -{ -} - - -/*********************************** -FileStreamDescriptor::SelectForRead -***********************************/ - -bool FileStreamDescriptor::SelectForRead() -{ - cerr << "R?"; - return false; -} - - -/************************************ -FileStreamDescriptor::SelectForWrite -************************************/ - -bool FileStreamDescriptor::SelectForWrite() -{ - cerr << "W?"; - return false; -} - - -/***************************************************************************** - -$Id$ - -File: kb.cpp -Date: 24Aug07 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - -#include "project.h" - - -/************************************** -KeyboardDescriptor::KeyboardDescriptor -**************************************/ - -KeyboardDescriptor::KeyboardDescriptor (EventMachine_t *parent_em): - EventableDescriptor (0, parent_em), - bReadAttemptedAfterClose (false), - LastIo (gCurrentLoopTime), - InactivityTimeout (0) -{ - #ifdef HAVE_EPOLL - EpollEvent.events = EPOLLIN; - #endif - #ifdef HAVE_KQUEUE - MyEventMachine->ArmKqueueReader (this); - #endif -} - - -/*************************************** -KeyboardDescriptor::~KeyboardDescriptor -***************************************/ - -KeyboardDescriptor::~KeyboardDescriptor() -{ -} - - -/************************* -KeyboardDescriptor::Write -*************************/ - -void KeyboardDescriptor::Write() -{ - // Why are we here? - throw std::runtime_error ("bad code path in keyboard handler"); -} - - -/***************************** -KeyboardDescriptor::Heartbeat -*****************************/ - -void KeyboardDescriptor::Heartbeat() -{ - // no-op -} - - -/************************ -KeyboardDescriptor::Read -************************/ - -void KeyboardDescriptor::Read() -{ - char c; - read (GetSocket(), &c, 1); - if (EventCallback) - (*EventCallback)(GetBinding().c_str(), EM_CONNECTION_READ, &c, 1); -} - - - - -#if 0 -/****************************** -PipeDescriptor::PipeDescriptor -******************************/ - -PipeDescriptor::PipeDescriptor (int fd, pid_t subpid, EventMachine_t *parent_em): - EventableDescriptor (fd, parent_em), - bReadAttemptedAfterClose (false), - LastIo (gCurrentLoopTime), - InactivityTimeout (0), - OutboundDataSize (0), - SubprocessPid (subpid) -{ - #ifdef HAVE_EPOLL - EpollEvent.events = EPOLLIN; - #endif -} - - -/******************************* -PipeDescriptor::~PipeDescriptor -*******************************/ - -PipeDescriptor::~PipeDescriptor() -{ - // Run down any stranded outbound data. - for (size_t i=0; i < OutboundPages.size(); i++) - OutboundPages[i].Free(); - - /* As a virtual destructor, we come here before the base-class - * destructor that closes our file-descriptor. - * We have to make sure the subprocess goes down (if it's not - * already down) and we have to reap the zombie. - * - * This implementation is PROVISIONAL and will surely be improved. - * The intention here is that we never block, hence the highly - * undesirable sleeps. But if we can't reap the subprocess even - * after sending it SIGKILL, then something is wrong and we - * throw a fatal exception, which is also not something we should - * be doing. - * - * Eventually the right thing to do will be to have the reactor - * core respond to SIGCHLD by chaining a handler on top of the - * one Ruby may have installed, and dealing with a list of dead - * children that are pending cleanup. - * - * Since we want to have a signal processor integrated into the - * client-visible API, let's wait until that is done before cleaning - * this up. - */ - - struct timespec req = {0, 10000000}; - kill (SubprocessPid, SIGTERM); - nanosleep (&req, NULL); - if (waitpid (SubprocessPid, NULL, WNOHANG) == 0) { - kill (SubprocessPid, SIGKILL); - nanosleep (&req, NULL); - if (waitpid (SubprocessPid, NULL, WNOHANG) == 0) - throw std::runtime_error ("unable to reap subprocess"); - } -} - - - -/******************** -PipeDescriptor::Read -********************/ - -void PipeDescriptor::Read() -{ - int sd = GetSocket(); - if (sd == INVALID_SOCKET) { - assert (!bReadAttemptedAfterClose); - bReadAttemptedAfterClose = true; - return; - } - - LastIo = gCurrentLoopTime; - - int total_bytes_read = 0; - char readbuffer [16 * 1024]; - - for (int i=0; i < 10; i++) { - // Don't read just one buffer and then move on. This is faster - // if there is a lot of incoming. - // But don't read indefinitely. Give other sockets a chance to run. - // NOTICE, we're reading one less than the buffer size. - // That's so we can put a guard byte at the end of what we send - // to user code. - // Use read instead of recv, which on Linux gives a "socket operation - // on nonsocket" error. - - - int r = read (sd, readbuffer, sizeof(readbuffer) - 1); - //cerr << ""; - - if (r > 0) { - total_bytes_read += r; - LastRead = gCurrentLoopTime; - - // Add a null-terminator at the the end of the buffer - // that we will send to the callback. - // DO NOT EVER CHANGE THIS. We want to explicitly allow users - // to be able to depend on this behavior, so they will have - // the option to do some things faster. Additionally it's - // a security guard against buffer overflows. - readbuffer [r] = 0; - if (EventCallback) - (*EventCallback)(GetBinding().c_str(), EM_CONNECTION_READ, readbuffer, r); - } - else if (r == 0) { - break; - } - else { - // Basically a would-block, meaning we've read everything there is to read. - break; - } - - } - - - if (total_bytes_read == 0) { - // If we read no data on a socket that selected readable, - // it generally means the other end closed the connection gracefully. - ScheduleClose (false); - //bCloseNow = true; - } - -} - -/********************* -PipeDescriptor::Write -*********************/ - -void PipeDescriptor::Write() -{ - int sd = GetSocket(); - assert (sd != INVALID_SOCKET); - - LastIo = gCurrentLoopTime; - char output_buffer [16 * 1024]; - size_t nbytes = 0; - - while ((OutboundPages.size() > 0) && (nbytes < sizeof(output_buffer))) { - OutboundPage *op = &(OutboundPages[0]); - if ((nbytes + op->Length - op->Offset) < sizeof (output_buffer)) { - memcpy (output_buffer + nbytes, op->Buffer + op->Offset, op->Length - op->Offset); - nbytes += (op->Length - op->Offset); - op->Free(); - OutboundPages.pop_front(); - } - else { - int len = sizeof(output_buffer) - nbytes; - memcpy (output_buffer + nbytes, op->Buffer + op->Offset, len); - op->Offset += len; - nbytes += len; - } - } - - // We should never have gotten here if there were no data to write, - // so assert that as a sanity check. - // Don't bother to make sure nbytes is less than output_buffer because - // if it were we probably would have crashed already. - assert (nbytes > 0); - - assert (GetSocket() != INVALID_SOCKET); - int bytes_written = write (GetSocket(), output_buffer, nbytes); - - if (bytes_written > 0) { - OutboundDataSize -= bytes_written; - if ((size_t)bytes_written < nbytes) { - int len = nbytes - bytes_written; - char *buffer = (char*) malloc (len + 1); - if (!buffer) - throw std::runtime_error ("bad alloc throwing back data"); - memcpy (buffer, output_buffer + bytes_written, len); - buffer [len] = 0; - OutboundPages.push_front (OutboundPage (buffer, len)); - } - #ifdef HAVE_EPOLL - EpollEvent.events = (EPOLLIN | (SelectForWrite() ? EPOLLOUT : 0)); - assert (MyEventMachine); - MyEventMachine->Modify (this); - #endif - } - else { - #ifdef OS_UNIX - if ((errno != EINPROGRESS) && (errno != EWOULDBLOCK) && (errno != EINTR)) - #endif - #ifdef OS_WIN32 - if ((errno != WSAEINPROGRESS) && (errno != WSAEWOULDBLOCK)) - #endif - Close(); - } -} - - -/************************* -PipeDescriptor::Heartbeat -*************************/ - -void PipeDescriptor::Heartbeat() -{ - // If an inactivity timeout is defined, then check for it. - if (InactivityTimeout && ((gCurrentLoopTime - LastIo) >= InactivityTimeout)) - ScheduleClose (false); - //bCloseNow = true; -} - - -/***************************** -PipeDescriptor::SelectForRead -*****************************/ - -bool PipeDescriptor::SelectForRead() -{ - /* Pipe descriptors, being local by definition, don't have - * a pending state, so this is simpler than for the - * ConnectionDescriptor object. - */ - return true; -} - -/****************************** -PipeDescriptor::SelectForWrite -******************************/ - -bool PipeDescriptor::SelectForWrite() -{ - /* Pipe descriptors, being local by definition, don't have - * a pending state, so this is simpler than for the - * ConnectionDescriptor object. - */ - return (GetOutboundDataSize() > 0); -} - - - - -/******************************** -PipeDescriptor::SendOutboundData -********************************/ - -int PipeDescriptor::SendOutboundData (const char *data, int length) -{ - //if (bCloseNow || bCloseAfterWriting) - if (IsCloseScheduled()) - return 0; - - if (!data && (length > 0)) - throw std::runtime_error ("bad outbound data"); - char *buffer = (char *) malloc (length + 1); - if (!buffer) - throw std::runtime_error ("no allocation for outbound data"); - memcpy (buffer, data, length); - buffer [length] = 0; - OutboundPages.push_back (OutboundPage (buffer, length)); - OutboundDataSize += length; - #ifdef HAVE_EPOLL - EpollEvent.events = (EPOLLIN | EPOLLOUT); - assert (MyEventMachine); - MyEventMachine->Modify (this); - #endif - return length; -} - -/******************************** -PipeDescriptor::GetSubprocessPid -********************************/ - -bool PipeDescriptor::GetSubprocessPid (pid_t *pid) -{ - bool ok = false; - if (pid && (SubprocessPid > 0)) { - *pid = SubprocessPid; - ok = true; - } - return ok; -} - -#endif - -/***************************************************************************** - -$Id$ - -File: page.cpp -Date: 30Apr06 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - - -#include "project.h" - - -/****************** -PageList::PageList -******************/ - -PageList::PageList() -{ -} - - -/******************* -PageList::~PageList -*******************/ - -PageList::~PageList() -{ - while (HasPages()) - PopFront(); -} - - -/*************** -PageList::Front -***************/ - -void PageList::Front (const char **page, int *length) -{ - assert (page && length); - - if (HasPages()) { - Page p = Pages.front(); - *page = p.Buffer; - *length = p.Size; - } - else { - *page = NULL; - *length = 0; - } -} - - -/****************** -PageList::PopFront -******************/ - -void PageList::PopFront() -{ - if (HasPages()) { - Page p = Pages.front(); - Pages.pop_front(); - if (p.Buffer) - free ((void*)p.Buffer); - } -} - - -/****************** -PageList::HasPages -******************/ - -bool PageList::HasPages() -{ - return (Pages.size() > 0) ? true : false; -} - - -/************** -PageList::Push -**************/ - -void PageList::Push (const char *buf, int size) -{ - if (buf && (size > 0)) { - char *copy = (char*) malloc (size); - if (!copy) - throw runtime_error ("no memory in pagelist"); - memcpy (copy, buf, size); - Pages.push_back (Page (copy, size)); - } -} - - - - - -/***************************************************************************** - -$Id$ - -File: pipe.cpp -Date: 30May07 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - -#include "project.h" - - -#ifdef OS_UNIX -// THIS ENTIRE FILE IS ONLY COMPILED ON UNIX-LIKE SYSTEMS. - -/****************************** -PipeDescriptor::PipeDescriptor -******************************/ - -PipeDescriptor::PipeDescriptor (int fd, pid_t subpid, EventMachine_t *parent_em): - EventableDescriptor (fd, parent_em), - bReadAttemptedAfterClose (false), - LastIo (gCurrentLoopTime), - InactivityTimeout (0), - OutboundDataSize (0), - SubprocessPid (subpid) -{ - #ifdef HAVE_EPOLL - EpollEvent.events = EPOLLIN; - #endif - #ifdef HAVE_KQUEUE - MyEventMachine->ArmKqueueReader (this); - #endif -} - - -/******************************* -PipeDescriptor::~PipeDescriptor -*******************************/ - -PipeDescriptor::~PipeDescriptor() -{ - // Run down any stranded outbound data. - for (size_t i=0; i < OutboundPages.size(); i++) - OutboundPages[i].Free(); - - /* As a virtual destructor, we come here before the base-class - * destructor that closes our file-descriptor. - * We have to make sure the subprocess goes down (if it's not - * already down) and we have to reap the zombie. - * - * This implementation is PROVISIONAL and will surely be improved. - * The intention here is that we never block, hence the highly - * undesirable sleeps. But if we can't reap the subprocess even - * after sending it SIGKILL, then something is wrong and we - * throw a fatal exception, which is also not something we should - * be doing. - * - * Eventually the right thing to do will be to have the reactor - * core respond to SIGCHLD by chaining a handler on top of the - * one Ruby may have installed, and dealing with a list of dead - * children that are pending cleanup. - * - * Since we want to have a signal processor integrated into the - * client-visible API, let's wait until that is done before cleaning - * this up. - * - * Added a very ugly hack to support passing the subprocess's exit - * status to the user. It only makes logical sense for user code to access - * the subprocess exit status in the unbind callback. But unbind is called - * back during the EventableDescriptor destructor. So by that time there's - * no way to call back this object through an object binding, because it's - * already been cleaned up. We might have added a parameter to the unbind - * callback, but that would probably break a huge amount of existing code. - * So the hack-solution is to define an instance variable in the EventMachine - * object and stick the exit status in there, where it can easily be accessed - * with an accessor visible to user code. - * User code should ONLY access the exit status from within the unbind callback. - * Otherwise there's no guarantee it'll be valid. - * This hack won't make it impossible to run multiple EventMachines in a single - * process, but it will make it impossible to reliably nest unbind calls - * within other unbind calls. (Not sure if that's even possible.) - */ - - assert (MyEventMachine); - - // check if the process is already dead - if (waitpid (SubprocessPid, &(MyEventMachine->SubprocessExitStatus), WNOHANG) == 0) { - kill (SubprocessPid, SIGTERM); - // wait 0.25s for process to die - struct timespec req = {0, 250000000}; - nanosleep (&req, NULL); - if (waitpid (SubprocessPid, &(MyEventMachine->SubprocessExitStatus), WNOHANG) == 0) { - kill (SubprocessPid, SIGKILL); - // wait 0.5s for process to die - struct timespec req = {0, 500000000}; - nanosleep (&req, NULL); - if (waitpid (SubprocessPid, &(MyEventMachine->SubprocessExitStatus), WNOHANG) == 0) - throw std::runtime_error ("unable to reap subprocess"); - } - } -} - - - -/******************** -PipeDescriptor::Read -********************/ - -void PipeDescriptor::Read() -{ - int sd = GetSocket(); - if (sd == INVALID_SOCKET) { - assert (!bReadAttemptedAfterClose); - bReadAttemptedAfterClose = true; - return; - } - - LastIo = gCurrentLoopTime; - - int total_bytes_read = 0; - char readbuffer [16 * 1024]; - - for (int i=0; i < 10; i++) { - // Don't read just one buffer and then move on. This is faster - // if there is a lot of incoming. - // But don't read indefinitely. Give other sockets a chance to run. - // NOTICE, we're reading one less than the buffer size. - // That's so we can put a guard byte at the end of what we send - // to user code. - // Use read instead of recv, which on Linux gives a "socket operation - // on nonsocket" error. - - - int r = read (sd, readbuffer, sizeof(readbuffer) - 1); - //cerr << ""; - - if (r > 0) { - total_bytes_read += r; - LastRead = gCurrentLoopTime; - - // Add a null-terminator at the the end of the buffer - // that we will send to the callback. - // DO NOT EVER CHANGE THIS. We want to explicitly allow users - // to be able to depend on this behavior, so they will have - // the option to do some things faster. Additionally it's - // a security guard against buffer overflows. - readbuffer [r] = 0; - if (EventCallback) - (*EventCallback)(GetBinding().c_str(), EM_CONNECTION_READ, readbuffer, r); - } - else if (r == 0) { - break; - } - else { - // Basically a would-block, meaning we've read everything there is to read. - break; - } - - } - - - if (total_bytes_read == 0) { - // If we read no data on a socket that selected readable, - // it generally means the other end closed the connection gracefully. - ScheduleClose (false); - //bCloseNow = true; - } - -} - -/********************* -PipeDescriptor::Write -*********************/ - -void PipeDescriptor::Write() -{ - int sd = GetSocket(); - assert (sd != INVALID_SOCKET); - - LastIo = gCurrentLoopTime; - char output_buffer [16 * 1024]; - size_t nbytes = 0; - - while ((OutboundPages.size() > 0) && (nbytes < sizeof(output_buffer))) { - OutboundPage *op = &(OutboundPages[0]); - if ((nbytes + op->Length - op->Offset) < sizeof (output_buffer)) { - memcpy (output_buffer + nbytes, op->Buffer + op->Offset, op->Length - op->Offset); - nbytes += (op->Length - op->Offset); - op->Free(); - OutboundPages.pop_front(); - } - else { - int len = sizeof(output_buffer) - nbytes; - memcpy (output_buffer + nbytes, op->Buffer + op->Offset, len); - op->Offset += len; - nbytes += len; - } - } - - // We should never have gotten here if there were no data to write, - // so assert that as a sanity check. - // Don't bother to make sure nbytes is less than output_buffer because - // if it were we probably would have crashed already. - assert (nbytes > 0); - - assert (GetSocket() != INVALID_SOCKET); - int bytes_written = write (GetSocket(), output_buffer, nbytes); - - if (bytes_written > 0) { - OutboundDataSize -= bytes_written; - if ((size_t)bytes_written < nbytes) { - int len = nbytes - bytes_written; - char *buffer = (char*) malloc (len + 1); - if (!buffer) - throw std::runtime_error ("bad alloc throwing back data"); - memcpy (buffer, output_buffer + bytes_written, len); - buffer [len] = 0; - OutboundPages.push_front (OutboundPage (buffer, len)); - } - #ifdef HAVE_EPOLL - EpollEvent.events = (EPOLLIN | (SelectForWrite() ? EPOLLOUT : 0)); - assert (MyEventMachine); - MyEventMachine->Modify (this); - #endif - } - else { - #ifdef OS_UNIX - if ((errno != EINPROGRESS) && (errno != EWOULDBLOCK) && (errno != EINTR)) - #endif - #ifdef OS_WIN32 - if ((errno != WSAEINPROGRESS) && (errno != WSAEWOULDBLOCK)) - #endif - Close(); - } -} - - -/************************* -PipeDescriptor::Heartbeat -*************************/ - -void PipeDescriptor::Heartbeat() -{ - // If an inactivity timeout is defined, then check for it. - if (InactivityTimeout && ((gCurrentLoopTime - LastIo) >= InactivityTimeout)) - ScheduleClose (false); - //bCloseNow = true; -} - - -/***************************** -PipeDescriptor::SelectForRead -*****************************/ - -bool PipeDescriptor::SelectForRead() -{ - /* Pipe descriptors, being local by definition, don't have - * a pending state, so this is simpler than for the - * ConnectionDescriptor object. - */ - return true; -} - -/****************************** -PipeDescriptor::SelectForWrite -******************************/ - -bool PipeDescriptor::SelectForWrite() -{ - /* Pipe descriptors, being local by definition, don't have - * a pending state, so this is simpler than for the - * ConnectionDescriptor object. - */ - return (GetOutboundDataSize() > 0); -} - - - - -/******************************** -PipeDescriptor::SendOutboundData -********************************/ - -int PipeDescriptor::SendOutboundData (const char *data, int length) -{ - //if (bCloseNow || bCloseAfterWriting) - if (IsCloseScheduled()) - return 0; - - if (!data && (length > 0)) - throw std::runtime_error ("bad outbound data"); - char *buffer = (char *) malloc (length + 1); - if (!buffer) - throw std::runtime_error ("no allocation for outbound data"); - memcpy (buffer, data, length); - buffer [length] = 0; - OutboundPages.push_back (OutboundPage (buffer, length)); - OutboundDataSize += length; - #ifdef HAVE_EPOLL - EpollEvent.events = (EPOLLIN | EPOLLOUT); - assert (MyEventMachine); - MyEventMachine->Modify (this); - #endif - return length; -} - -/******************************** -PipeDescriptor::GetSubprocessPid -********************************/ - -bool PipeDescriptor::GetSubprocessPid (pid_t *pid) -{ - bool ok = false; - if (pid && (SubprocessPid > 0)) { - *pid = SubprocessPid; - ok = true; - } - return ok; -} - - -#endif // OS_UNIX - -/***************************************************************************** - -$Id$ - -File: rubymain.cpp -Date: 06Apr06 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - -#include "project.h" -#include "eventmachine.h" -#include - - - -/******* -Statics -*******/ - -static VALUE EmModule; -static VALUE EmConnection; - -static VALUE Intern_at_signature; -static VALUE Intern_at_timers; -static VALUE Intern_at_conns; -static VALUE Intern_event_callback; -static VALUE Intern_run_deferred_callbacks; -static VALUE Intern_delete; -static VALUE Intern_call; -static VALUE Intern_receive_data; - -static VALUE Intern_notify_readable; -static VALUE Intern_notify_writable; - -/**************** -t_event_callback -****************/ - -static void event_callback (const char *a1, int a2, const char *a3, int a4) -{ - if (a2 == EM_CONNECTION_READ) { - VALUE t = rb_ivar_get (EmModule, Intern_at_conns); - VALUE q = rb_hash_aref (t, rb_str_new2(a1)); - if (q == Qnil) - rb_raise (rb_eRuntimeError, "no connection"); - rb_funcall (q, Intern_receive_data, 1, rb_str_new (a3, a4)); - } - else if (a2 == EM_CONNECTION_NOTIFY_READABLE) { - VALUE t = rb_ivar_get (EmModule, Intern_at_conns); - VALUE q = rb_hash_aref (t, rb_str_new2(a1)); - if (q == Qnil) - rb_raise (rb_eRuntimeError, "no connection"); - rb_funcall (q, Intern_notify_readable, 0); - } - else if (a2 == EM_CONNECTION_NOTIFY_WRITABLE) { - VALUE t = rb_ivar_get (EmModule, Intern_at_conns); - VALUE q = rb_hash_aref (t, rb_str_new2(a1)); - if (q == Qnil) - rb_raise (rb_eRuntimeError, "no connection"); - rb_funcall (q, Intern_notify_writable, 0); - } - else if (a2 == EM_LOOPBREAK_SIGNAL) { - rb_funcall (EmModule, Intern_run_deferred_callbacks, 0); - } - else if (a2 == EM_TIMER_FIRED) { - VALUE t = rb_ivar_get (EmModule, Intern_at_timers); - VALUE q = rb_funcall (t, Intern_delete, 1, rb_str_new(a3, a4)); - if (q == Qnil) - rb_raise (rb_eRuntimeError, "no timer"); - rb_funcall (q, Intern_call, 0); - } - else - rb_funcall (EmModule, Intern_event_callback, 3, rb_str_new2(a1), (a2 << 1) | 1, rb_str_new(a3,a4)); -} - - - -/************************** -t_initialize_event_machine -**************************/ - -static VALUE t_initialize_event_machine (VALUE self) -{ - evma_initialize_library (event_callback); - return Qnil; -} - - - -/***************************** -t_run_machine_without_threads -*****************************/ - -static VALUE t_run_machine_without_threads (VALUE self) -{ - evma_run_machine(); - return Qnil; -} - - -/******************* -t_add_oneshot_timer -*******************/ - -static VALUE t_add_oneshot_timer (VALUE self, VALUE interval) -{ - const char *f = evma_install_oneshot_timer (FIX2INT (interval)); - if (!f || !*f) - rb_raise (rb_eRuntimeError, "no timer"); - return rb_str_new2 (f); -} - - -/************** -t_start_server -**************/ - -static VALUE t_start_server (VALUE self, VALUE server, VALUE port) -{ - const char *f = evma_create_tcp_server (StringValuePtr(server), FIX2INT(port)); - if (!f || !*f) - rb_raise (rb_eRuntimeError, "no acceptor"); - return rb_str_new2 (f); -} - -/************* -t_stop_server -*************/ - -static VALUE t_stop_server (VALUE self, VALUE signature) -{ - evma_stop_tcp_server (StringValuePtr (signature)); - return Qnil; -} - - -/******************* -t_start_unix_server -*******************/ - -static VALUE t_start_unix_server (VALUE self, VALUE filename) -{ - const char *f = evma_create_unix_domain_server (StringValuePtr(filename)); - if (!f || !*f) - rb_raise (rb_eRuntimeError, "no unix-domain acceptor"); - return rb_str_new2 (f); -} - - - -/*********** -t_send_data -***********/ - -static VALUE t_send_data (VALUE self, VALUE signature, VALUE data, VALUE data_length) -{ - int b = evma_send_data_to_connection (StringValuePtr (signature), StringValuePtr (data), FIX2INT (data_length)); - return INT2NUM (b); -} - - -/*********** -t_start_tls -***********/ - -static VALUE t_start_tls (VALUE self, VALUE signature) -{ - evma_start_tls (StringValuePtr (signature)); - return Qnil; -} - -/*************** -t_set_tls_parms -***************/ - -static VALUE t_set_tls_parms (VALUE self, VALUE signature, VALUE privkeyfile, VALUE certchainfile) -{ - /* set_tls_parms takes a series of positional arguments for specifying such things - * as private keys and certificate chains. - * It's expected that the parameter list will grow as we add more supported features. - * ALL of these parameters are optional, and can be specified as empty or NULL strings. - */ - evma_set_tls_parms (StringValuePtr (signature), StringValuePtr (privkeyfile), StringValuePtr (certchainfile) ); - return Qnil; -} - -/************** -t_get_peername -**************/ - -static VALUE t_get_peername (VALUE self, VALUE signature) -{ - struct sockaddr s; - if (evma_get_peername (StringValuePtr (signature), &s)) { - return rb_str_new ((const char*)&s, sizeof(s)); - } - - return Qnil; -} - -/************** -t_get_sockname -**************/ - -static VALUE t_get_sockname (VALUE self, VALUE signature) -{ - struct sockaddr s; - if (evma_get_sockname (StringValuePtr (signature), &s)) { - return rb_str_new ((const char*)&s, sizeof(s)); - } - - return Qnil; -} - -/******************** -t_get_subprocess_pid -********************/ - -static VALUE t_get_subprocess_pid (VALUE self, VALUE signature) -{ - pid_t pid; - if (evma_get_subprocess_pid (StringValuePtr (signature), &pid)) { - return INT2NUM (pid); - } - - return Qnil; -} - -/*********************** -t_get_subprocess_status -***********************/ - -static VALUE t_get_subprocess_status (VALUE self, VALUE signature) -{ - int status; - if (evma_get_subprocess_status (StringValuePtr (signature), &status)) { - return INT2NUM (status); - } - - return Qnil; -} - -/***************************** -t_get_comm_inactivity_timeout -*****************************/ - -static VALUE t_get_comm_inactivity_timeout (VALUE self, VALUE signature) -{ - int timeout; - if (evma_get_comm_inactivity_timeout (StringValuePtr (signature), &timeout)) - return INT2FIX (timeout); - return Qnil; -} - -/***************************** -t_set_comm_inactivity_timeout -*****************************/ - -static VALUE t_set_comm_inactivity_timeout (VALUE self, VALUE signature, VALUE timeout) -{ - int ti = FIX2INT (timeout); - if (evma_set_comm_inactivity_timeout (StringValuePtr (signature), &ti)); - return Qtrue; - return Qnil; -} - - -/*************** -t_send_datagram -***************/ - -static VALUE t_send_datagram (VALUE self, VALUE signature, VALUE data, VALUE data_length, VALUE address, VALUE port) -{ - int b = evma_send_datagram (StringValuePtr (signature), StringValuePtr (data), FIX2INT (data_length), StringValuePtr(address), FIX2INT(port)); - return INT2NUM (b); -} - - -/****************** -t_close_connection -******************/ - -static VALUE t_close_connection (VALUE self, VALUE signature, VALUE after_writing) -{ - evma_close_connection (StringValuePtr (signature), ((after_writing == Qtrue) ? 1 : 0)); - return Qnil; -} - -/******************************** -t_report_connection_error_status -********************************/ - -static VALUE t_report_connection_error_status (VALUE self, VALUE signature) -{ - int b = evma_report_connection_error_status (StringValuePtr (signature)); - return INT2NUM (b); -} - - - -/**************** -t_connect_server -****************/ - -static VALUE t_connect_server (VALUE self, VALUE server, VALUE port) -{ - // Avoid FIX2INT in this case, because it doesn't deal with type errors properly. - // Specifically, if the value of port comes in as a string rather than an integer, - // NUM2INT will throw a type error, but FIX2INT will generate garbage. - - const char *f = evma_connect_to_server (StringValuePtr(server), NUM2INT(port)); - if (!f || !*f) - rb_raise (rb_eRuntimeError, "no connection"); - return rb_str_new2 (f); -} - -/********************* -t_connect_unix_server -*********************/ - -static VALUE t_connect_unix_server (VALUE self, VALUE serversocket) -{ - const char *f = evma_connect_to_unix_server (StringValuePtr(serversocket)); - if (!f || !*f) - rb_raise (rb_eRuntimeError, "no connection"); - return rb_str_new2 (f); -} - -/*********** -t_attach_fd -***********/ - -static VALUE t_attach_fd (VALUE self, VALUE file_descriptor, VALUE read_mode, VALUE write_mode) -{ - const char *f = evma_attach_fd (NUM2INT(file_descriptor), (read_mode == Qtrue) ? 1 : 0, (write_mode == Qtrue) ? 1 : 0); - if (!f || !*f) - rb_raise (rb_eRuntimeError, "no connection"); - return rb_str_new2 (f); -} - -/*********** -t_detach_fd -***********/ - -static VALUE t_detach_fd (VALUE self, VALUE signature) -{ - return INT2NUM(evma_detach_fd (StringValuePtr(signature))); -} - -/***************** -t_open_udp_socket -*****************/ - -static VALUE t_open_udp_socket (VALUE self, VALUE server, VALUE port) -{ - const char *f = evma_open_datagram_socket (StringValuePtr(server), FIX2INT(port)); - if (!f || !*f) - rb_raise (rb_eRuntimeError, "no datagram socket"); - return rb_str_new2 (f); -} - - - -/***************** -t_release_machine -*****************/ - -static VALUE t_release_machine (VALUE self) -{ - evma_release_library(); - return Qnil; -} - - -/****** -t_stop -******/ - -static VALUE t_stop (VALUE self) -{ - evma_stop_machine(); - return Qnil; -} - -/****************** -t_signal_loopbreak -******************/ - -static VALUE t_signal_loopbreak (VALUE self) -{ - evma_signal_loopbreak(); - return Qnil; -} - -/************** -t_library_type -**************/ - -static VALUE t_library_type (VALUE self) -{ - return rb_eval_string (":extension"); -} - - - -/******************* -t_set_timer_quantum -*******************/ - -static VALUE t_set_timer_quantum (VALUE self, VALUE interval) -{ - evma_set_timer_quantum (FIX2INT (interval)); - return Qnil; -} - -/******************** -t_set_max_timer_count -********************/ - -static VALUE t_set_max_timer_count (VALUE self, VALUE ct) -{ - evma_set_max_timer_count (FIX2INT (ct)); - return Qnil; -} - -/*************** -t_setuid_string -***************/ - -static VALUE t_setuid_string (VALUE self, VALUE username) -{ - evma_setuid_string (StringValuePtr (username)); - return Qnil; -} - - - -/************* -t__write_file -*************/ - -static VALUE t__write_file (VALUE self, VALUE filename) -{ - const char *f = evma__write_file (StringValuePtr (filename)); - if (!f || !*f) - rb_raise (rb_eRuntimeError, "file not opened"); - return rb_str_new2 (f); -} - -/************** -t_invoke_popen -**************/ - -static VALUE t_invoke_popen (VALUE self, VALUE cmd) -{ - // 1.8.7+ - #ifdef RARRAY_LEN - int len = RARRAY_LEN(cmd); - #else - int len = RARRAY (cmd)->len; - #endif - if (len > 98) - rb_raise (rb_eRuntimeError, "too many arguments to popen"); - char *strings [100]; - for (int i=0; i < len; i++) { - VALUE ix = INT2FIX (i); - VALUE s = rb_ary_aref (1, &ix, cmd); - strings[i] = StringValuePtr (s); - } - strings[len] = NULL; - - const char *f = evma_popen (strings); - if (!f || !*f) { - char *err = strerror (errno); - char buf[100]; - memset (buf, 0, sizeof(buf)); - snprintf (buf, sizeof(buf)-1, "no popen: %s", (err?err:"???")); - rb_raise (rb_eRuntimeError, buf); - } - return rb_str_new2 (f); -} - - -/*************** -t_read_keyboard -***************/ - -static VALUE t_read_keyboard (VALUE self) -{ - const char *f = evma_open_keyboard(); - if (!f || !*f) - rb_raise (rb_eRuntimeError, "no keyboard reader"); - return rb_str_new2 (f); -} - - -/******** -t__epoll -********/ - -static VALUE t__epoll (VALUE self) -{ - // Temporary. - evma__epoll(); - return Qnil; -} - -/********** -t__epoll_p -**********/ - -static VALUE t__epoll_p (VALUE self) -{ - #ifdef HAVE_EPOLL - return Qtrue; - #else - return Qfalse; - #endif -} - - -/********* -t__kqueue -*********/ - -static VALUE t__kqueue (VALUE self) -{ - // Temporary. - evma__kqueue(); - return Qnil; -} - -/*********** -t__kqueue_p -***********/ - -static VALUE t__kqueue_p (VALUE self) -{ - #ifdef HAVE_KQUEUE - return Qtrue; - #else - return Qfalse; - #endif -} - - -/**************** -t_send_file_data -****************/ - -static VALUE t_send_file_data (VALUE self, VALUE signature, VALUE filename) -{ - - /* The current implementation of evma_send_file_data_to_connection enforces a strict - * upper limit on the file size it will transmit (currently 32K). The function returns - * zero on success, -1 if the requested file exceeds its size limit, and a positive - * number for other errors. - * TODO: Positive return values are actually errno's, which is probably the wrong way to - * do this. For one thing it's ugly. For another, we can't be sure zero is never a real errno. - */ - - int b = evma_send_file_data_to_connection (StringValuePtr(signature), StringValuePtr(filename)); - if (b == -1) - rb_raise(rb_eRuntimeError, "File too large. send_file_data() supports files under 32k."); - if (b > 0) { - char *err = strerror (b); - char buf[1024]; - memset (buf, 0, sizeof(buf)); - snprintf (buf, sizeof(buf)-1, ": %s %s", StringValuePtr(filename),(err?err:"???")); - - rb_raise (rb_eIOError, buf); - } - - return INT2NUM (0); -} - - -/******************* -t_set_rlimit_nofile -*******************/ - -static VALUE t_set_rlimit_nofile (VALUE self, VALUE arg) -{ - arg = (NIL_P(arg)) ? -1 : NUM2INT (arg); - return INT2NUM (evma_set_rlimit_nofile (arg)); -} - -/*************************** -conn_get_outbound_data_size -***************************/ - -static VALUE conn_get_outbound_data_size (VALUE self) -{ - VALUE sig = rb_ivar_get (self, Intern_at_signature); - return INT2NUM (evma_get_outbound_data_size (StringValuePtr(sig))); -} - - -/****************************** -conn_associate_callback_target -******************************/ - -static VALUE conn_associate_callback_target (VALUE self, VALUE sig) -{ - // No-op for the time being. - return Qnil; -} - - -/*************** -t_get_loop_time -****************/ - -static VALUE t_get_loop_time (VALUE self) -{ - VALUE cTime = rb_path2class("Time"); - if (gCurrentLoopTime != 0) { - return rb_funcall(cTime, - rb_intern("at"), - 1, - INT2NUM(gCurrentLoopTime)); - } - return Qnil; -} - - -/********************* -Init_rubyeventmachine -*********************/ - -extern "C" void Init_rubyeventmachine() -{ - // Tuck away some symbol values so we don't have to look 'em up every time we need 'em. - Intern_at_signature = rb_intern ("@signature"); - Intern_at_timers = rb_intern ("@timers"); - Intern_at_conns = rb_intern ("@conns"); - - Intern_event_callback = rb_intern ("event_callback"); - Intern_run_deferred_callbacks = rb_intern ("run_deferred_callbacks"); - Intern_delete = rb_intern ("delete"); - Intern_call = rb_intern ("call"); - Intern_receive_data = rb_intern ("receive_data"); - - Intern_notify_readable = rb_intern ("notify_readable"); - Intern_notify_writable = rb_intern ("notify_writable"); - - // INCOMPLETE, we need to define class Connections inside module EventMachine - // run_machine and run_machine_without_threads are now identical. - // Must deprecate the without_threads variant. - EmModule = rb_define_module ("EventMachine"); - EmConnection = rb_define_class_under (EmModule, "Connection", rb_cObject); - - rb_define_class_under (EmModule, "ConnectionNotBound", rb_eException); - rb_define_class_under (EmModule, "NoHandlerForAcceptedConnection", rb_eException); - rb_define_class_under (EmModule, "UnknownTimerFired", rb_eException); - - rb_define_module_function (EmModule, "initialize_event_machine", (VALUE(*)(...))t_initialize_event_machine, 0); - rb_define_module_function (EmModule, "run_machine", (VALUE(*)(...))t_run_machine_without_threads, 0); - rb_define_module_function (EmModule, "run_machine_without_threads", (VALUE(*)(...))t_run_machine_without_threads, 0); - rb_define_module_function (EmModule, "add_oneshot_timer", (VALUE(*)(...))t_add_oneshot_timer, 1); - rb_define_module_function (EmModule, "start_tcp_server", (VALUE(*)(...))t_start_server, 2); - rb_define_module_function (EmModule, "stop_tcp_server", (VALUE(*)(...))t_stop_server, 1); - rb_define_module_function (EmModule, "start_unix_server", (VALUE(*)(...))t_start_unix_server, 1); - rb_define_module_function (EmModule, "set_tls_parms", (VALUE(*)(...))t_set_tls_parms, 3); - rb_define_module_function (EmModule, "start_tls", (VALUE(*)(...))t_start_tls, 1); - rb_define_module_function (EmModule, "send_data", (VALUE(*)(...))t_send_data, 3); - rb_define_module_function (EmModule, "send_datagram", (VALUE(*)(...))t_send_datagram, 5); - rb_define_module_function (EmModule, "close_connection", (VALUE(*)(...))t_close_connection, 2); - rb_define_module_function (EmModule, "report_connection_error_status", (VALUE(*)(...))t_report_connection_error_status, 1); - rb_define_module_function (EmModule, "connect_server", (VALUE(*)(...))t_connect_server, 2); - rb_define_module_function (EmModule, "connect_unix_server", (VALUE(*)(...))t_connect_unix_server, 1); - - rb_define_module_function (EmModule, "attach_fd", (VALUE (*)(...))t_attach_fd, 3); - rb_define_module_function (EmModule, "detach_fd", (VALUE (*)(...))t_detach_fd, 1); - - rb_define_module_function (EmModule, "current_time", (VALUE(*)(...))t_get_loop_time, 0); - - rb_define_module_function (EmModule, "open_udp_socket", (VALUE(*)(...))t_open_udp_socket, 2); - rb_define_module_function (EmModule, "read_keyboard", (VALUE(*)(...))t_read_keyboard, 0); - rb_define_module_function (EmModule, "release_machine", (VALUE(*)(...))t_release_machine, 0); - rb_define_module_function (EmModule, "stop", (VALUE(*)(...))t_stop, 0); - rb_define_module_function (EmModule, "signal_loopbreak", (VALUE(*)(...))t_signal_loopbreak, 0); - rb_define_module_function (EmModule, "library_type", (VALUE(*)(...))t_library_type, 0); - rb_define_module_function (EmModule, "set_timer_quantum", (VALUE(*)(...))t_set_timer_quantum, 1); - rb_define_module_function (EmModule, "set_max_timer_count", (VALUE(*)(...))t_set_max_timer_count, 1); - rb_define_module_function (EmModule, "setuid_string", (VALUE(*)(...))t_setuid_string, 1); - rb_define_module_function (EmModule, "invoke_popen", (VALUE(*)(...))t_invoke_popen, 1); - rb_define_module_function (EmModule, "send_file_data", (VALUE(*)(...))t_send_file_data, 2); - - // Provisional: - rb_define_module_function (EmModule, "_write_file", (VALUE(*)(...))t__write_file, 1); - - rb_define_module_function (EmModule, "get_peername", (VALUE(*)(...))t_get_peername, 1); - rb_define_module_function (EmModule, "get_sockname", (VALUE(*)(...))t_get_sockname, 1); - rb_define_module_function (EmModule, "get_subprocess_pid", (VALUE(*)(...))t_get_subprocess_pid, 1); - rb_define_module_function (EmModule, "get_subprocess_status", (VALUE(*)(...))t_get_subprocess_status, 1); - rb_define_module_function (EmModule, "get_comm_inactivity_timeout", (VALUE(*)(...))t_get_comm_inactivity_timeout, 1); - rb_define_module_function (EmModule, "set_comm_inactivity_timeout", (VALUE(*)(...))t_set_comm_inactivity_timeout, 2); - rb_define_module_function (EmModule, "set_rlimit_nofile", (VALUE(*)(...))t_set_rlimit_nofile, 1); - - // Temporary: - rb_define_module_function (EmModule, "epoll", (VALUE(*)(...))t__epoll, 0); - rb_define_module_function (EmModule, "kqueue", (VALUE(*)(...))t__kqueue, 0); - - rb_define_module_function (EmModule, "epoll?", (VALUE(*)(...))t__epoll_p, 0); - rb_define_module_function (EmModule, "kqueue?", (VALUE(*)(...))t__kqueue_p, 0); - - rb_define_method (EmConnection, "get_outbound_data_size", (VALUE(*)(...))conn_get_outbound_data_size, 0); - rb_define_method (EmConnection, "associate_callback_target", (VALUE(*)(...))conn_associate_callback_target, 1); - - rb_define_const (EmModule, "TimerFired", INT2NUM(100)); - rb_define_const (EmModule, "ConnectionData", INT2NUM(101)); - rb_define_const (EmModule, "ConnectionUnbound", INT2NUM(102)); - rb_define_const (EmModule, "ConnectionAccepted", INT2NUM(103)); - rb_define_const (EmModule, "ConnectionCompleted", INT2NUM(104)); - rb_define_const (EmModule, "LoopbreakSignalled", INT2NUM(105)); - - rb_define_const (EmModule, "ConnectionNotifyReadable", INT2NUM(106)); - rb_define_const (EmModule, "ConnectionNotifyWritable", INT2NUM(107)); - -} - -/***************************************************************************** - -$Id$ - -File: sigs.cpp -Date: 06Apr06 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - -#include "project.h" - - -bool gTerminateSignalReceived; - - -/************** -SigtermHandler -**************/ - -void SigtermHandler (int sig) -{ - // This is a signal-handler, don't do anything frisky. Interrupts are disabled. - // Set the terminate flag WITHOUT trying to lock a mutex- otherwise we can easily - // self-deadlock, especially if the event machine is looping quickly. - gTerminateSignalReceived = true; -} - - -/********************* -InstallSignalHandlers -*********************/ - -void InstallSignalHandlers() -{ - #ifdef OS_UNIX - static bool bInstalled = false; - if (!bInstalled) { - bInstalled = true; - signal (SIGINT, SigtermHandler); - signal (SIGTERM, SigtermHandler); - signal (SIGPIPE, SIG_IGN); - } - #endif -} - - - -/******************* -WintelSignalHandler -*******************/ - -#ifdef OS_WIN32 -BOOL WINAPI WintelSignalHandler (DWORD control) -{ - if (control == CTRL_C_EVENT) - gTerminateSignalReceived = true; - return TRUE; -} -#endif - -/************ -HookControlC -************/ - -#ifdef OS_WIN32 -void HookControlC (bool hook) -{ - if (hook) { - // INSTALL hook - SetConsoleCtrlHandler (WintelSignalHandler, TRUE); - } - else { - // UNINSTALL hook - SetConsoleCtrlHandler (WintelSignalHandler, FALSE); - } -} -#endif - - -/***************************************************************************** - -$Id$ - -File: ssl.cpp -Date: 30Apr06 - -Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. -Gmail: blackhedd - -This program is free software; you can redistribute it and/or modify -it under the terms of either: 1) the GNU General Public License -as published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version; or 2) Ruby's License. - -See the file COPYING for complete licensing information. - -*****************************************************************************/ - - -#ifdef WITH_SSL - -#include "project.h" - - -bool SslContext_t::bLibraryInitialized = false; - - - -static void InitializeDefaultCredentials(); -static EVP_PKEY *DefaultPrivateKey = NULL; -static X509 *DefaultCertificate = NULL; - -static char PrivateMaterials[] = { -"-----BEGIN RSA PRIVATE KEY-----\n" -"MIICXAIBAAKBgQDCYYhcw6cGRbhBVShKmbWm7UVsEoBnUf0cCh8AX+MKhMxwVDWV\n" -"Igdskntn3cSJjRtmgVJHIK0lpb/FYHQB93Ohpd9/Z18pDmovfFF9nDbFF0t39hJ/\n" -"AqSzFB3GiVPoFFZJEE1vJqh+3jzsSF5K56bZ6azz38VlZgXeSozNW5bXkQIDAQAB\n" -"AoGALA89gIFcr6BIBo8N5fL3aNHpZXjAICtGav+kTUpuxSiaym9cAeTHuAVv8Xgk\n" -"H2Wbq11uz+6JMLpkQJH/WZ7EV59DPOicXrp0Imr73F3EXBfR7t2EQDYHPMthOA1D\n" -"I9EtCzvV608Ze90hiJ7E3guGrGppZfJ+eUWCPgy8CZH1vRECQQDv67rwV/oU1aDo\n" -"6/+d5nqjeW6mWkGqTnUU96jXap8EIw6B+0cUKskwx6mHJv+tEMM2748ZY7b0yBlg\n" -"w4KDghbFAkEAz2h8PjSJG55LwqmXih1RONSgdN9hjB12LwXL1CaDh7/lkEhq0PlK\n" -"PCAUwQSdM17Sl0Xxm2CZiekTSlwmHrtqXQJAF3+8QJwtV2sRJp8u2zVe37IeH1cJ\n" -"xXeHyjTzqZ2803fnjN2iuZvzNr7noOA1/Kp+pFvUZUU5/0G2Ep8zolPUjQJAFA7k\n" -"xRdLkzIx3XeNQjwnmLlncyYPRv+qaE3FMpUu7zftuZBnVCJnvXzUxP3vPgKTlzGa\n" -"dg5XivDRfsV+okY5uQJBAMV4FesUuLQVEKb6lMs7rzZwpeGQhFDRfywJzfom2TLn\n" -"2RdJQQ3dcgnhdVDgt5o1qkmsqQh8uJrJ9SdyLIaZQIc=\n" -"-----END RSA PRIVATE KEY-----\n" -"-----BEGIN CERTIFICATE-----\n" -"MIID6TCCA1KgAwIBAgIJANm4W/Tzs+s+MA0GCSqGSIb3DQEBBQUAMIGqMQswCQYD\n" -"VQQGEwJVUzERMA8GA1UECBMITmV3IFlvcmsxETAPBgNVBAcTCE5ldyBZb3JrMRYw\n" -"FAYDVQQKEw1TdGVhbWhlYXQubmV0MRQwEgYDVQQLEwtFbmdpbmVlcmluZzEdMBsG\n" -"A1UEAxMUb3BlbmNhLnN0ZWFtaGVhdC5uZXQxKDAmBgkqhkiG9w0BCQEWGWVuZ2lu\n" -"ZWVyaW5nQHN0ZWFtaGVhdC5uZXQwHhcNMDYwNTA1MTcwNjAzWhcNMjQwMjIwMTcw\n" -"NjAzWjCBqjELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQH\n" -"EwhOZXcgWW9yazEWMBQGA1UEChMNU3RlYW1oZWF0Lm5ldDEUMBIGA1UECxMLRW5n\n" -"aW5lZXJpbmcxHTAbBgNVBAMTFG9wZW5jYS5zdGVhbWhlYXQubmV0MSgwJgYJKoZI\n" -"hvcNAQkBFhllbmdpbmVlcmluZ0BzdGVhbWhlYXQubmV0MIGfMA0GCSqGSIb3DQEB\n" -"AQUAA4GNADCBiQKBgQDCYYhcw6cGRbhBVShKmbWm7UVsEoBnUf0cCh8AX+MKhMxw\n" -"VDWVIgdskntn3cSJjRtmgVJHIK0lpb/FYHQB93Ohpd9/Z18pDmovfFF9nDbFF0t3\n" -"9hJ/AqSzFB3GiVPoFFZJEE1vJqh+3jzsSF5K56bZ6azz38VlZgXeSozNW5bXkQID\n" -"AQABo4IBEzCCAQ8wHQYDVR0OBBYEFPJvPd1Fcmd8o/Tm88r+NjYPICCkMIHfBgNV\n" -"HSMEgdcwgdSAFPJvPd1Fcmd8o/Tm88r+NjYPICCkoYGwpIGtMIGqMQswCQYDVQQG\n" -"EwJVUzERMA8GA1UECBMITmV3IFlvcmsxETAPBgNVBAcTCE5ldyBZb3JrMRYwFAYD\n" -"VQQKEw1TdGVhbWhlYXQubmV0MRQwEgYDVQQLEwtFbmdpbmVlcmluZzEdMBsGA1UE\n" -"AxMUb3BlbmNhLnN0ZWFtaGVhdC5uZXQxKDAmBgkqhkiG9w0BCQEWGWVuZ2luZWVy\n" -"aW5nQHN0ZWFtaGVhdC5uZXSCCQDZuFv087PrPjAMBgNVHRMEBTADAQH/MA0GCSqG\n" -"SIb3DQEBBQUAA4GBAC1CXey/4UoLgJiwcEMDxOvW74plks23090iziFIlGgcIhk0\n" -"Df6hTAs7H3MWww62ddvR8l07AWfSzSP5L6mDsbvq7EmQsmPODwb6C+i2aF3EDL8j\n" -"uw73m4YIGI0Zw2XdBpiOGkx2H56Kya6mJJe/5XORZedh1wpI7zki01tHYbcy\n" -"-----END CERTIFICATE-----\n"}; - -/* These private materials were made with: - * openssl req -new -x509 -keyout cakey.pem -out cacert.pem -nodes -days 6500 - * TODO: We need a full-blown capability to work with user-supplied - * keypairs and properly-signed certificates. - */ - - -/***************** -builtin_passwd_cb -*****************/ - -extern "C" int builtin_passwd_cb (char *buf, int bufsize, int rwflag, void *userdata) -{ - strcpy (buf, "kittycat"); - return 8; -} - -/**************************** -InitializeDefaultCredentials -****************************/ - -static void InitializeDefaultCredentials() -{ - BIO *bio = BIO_new_mem_buf (PrivateMaterials, -1); - assert (bio); - - if (DefaultPrivateKey) { - // we may come here in a restart. - EVP_PKEY_free (DefaultPrivateKey); - DefaultPrivateKey = NULL; - } - PEM_read_bio_PrivateKey (bio, &DefaultPrivateKey, builtin_passwd_cb, 0); - - if (DefaultCertificate) { - // we may come here in a restart. - X509_free (DefaultCertificate); - DefaultCertificate = NULL; - } - PEM_read_bio_X509 (bio, &DefaultCertificate, NULL, 0); - - BIO_free (bio); -} - - - -/************************** -SslContext_t::SslContext_t -**************************/ - -SslContext_t::SslContext_t (bool is_server, const string &privkeyfile, const string &certchainfile): - pCtx (NULL), - PrivateKey (NULL), - Certificate (NULL) -{ - /* TODO: the usage of the specified private-key and cert-chain filenames only applies to - * client-side connections at this point. Server connections currently use the default materials. - * That needs to be fixed asap. - * Also, in this implementation, server-side connections use statically defined X-509 defaults. - * One thing I'm really not clear on is whether or not you have to explicitly free X509 and EVP_PKEY - * objects when we call our destructor, or whether just calling SSL_CTX_free is enough. - */ - - if (!bLibraryInitialized) { - bLibraryInitialized = true; - SSL_library_init(); - OpenSSL_add_ssl_algorithms(); - OpenSSL_add_all_algorithms(); - SSL_load_error_strings(); - ERR_load_crypto_strings(); - - InitializeDefaultCredentials(); - } - - bIsServer = is_server; - pCtx = SSL_CTX_new (is_server ? SSLv23_server_method() : SSLv23_client_method()); - if (!pCtx) - throw std::runtime_error ("no SSL context"); - - SSL_CTX_set_options (pCtx, SSL_OP_ALL); - //SSL_CTX_set_options (pCtx, (SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3)); - - if (is_server) { - // The SSL_CTX calls here do NOT allocate memory. - int e; - if (privkeyfile.length() > 0) - e = SSL_CTX_use_PrivateKey_file (pCtx, privkeyfile.c_str(), SSL_FILETYPE_PEM); - else - e = SSL_CTX_use_PrivateKey (pCtx, DefaultPrivateKey); - assert (e > 0); - if (certchainfile.length() > 0) - e = SSL_CTX_use_certificate_chain_file (pCtx, certchainfile.c_str()); - else - e = SSL_CTX_use_certificate (pCtx, DefaultCertificate); - assert (e > 0); - } - - SSL_CTX_set_cipher_list (pCtx, "ALL:!ADH:!LOW:!EXP:!DES-CBC3-SHA:@STRENGTH"); - - if (is_server) { - SSL_CTX_sess_set_cache_size (pCtx, 128); - SSL_CTX_set_session_id_context (pCtx, (unsigned char*)"eventmachine", 12); - } - else { - int e; - if (privkeyfile.length() > 0) { - e = SSL_CTX_use_PrivateKey_file (pCtx, privkeyfile.c_str(), SSL_FILETYPE_PEM); - assert (e > 0); - } - if (certchainfile.length() > 0) { - e = SSL_CTX_use_certificate_chain_file (pCtx, certchainfile.c_str()); - assert (e > 0); - } - } -} - - - -/*************************** -SslContext_t::~SslContext_t -***************************/ - -SslContext_t::~SslContext_t() -{ - if (pCtx) - SSL_CTX_free (pCtx); - if (PrivateKey) - EVP_PKEY_free (PrivateKey); - if (Certificate) - X509_free (Certificate); -} - - - -/****************** -SslBox_t::SslBox_t -******************/ - -SslBox_t::SslBox_t (bool is_server, const string &privkeyfile, const string &certchainfile): - bIsServer (is_server), - pSSL (NULL), - pbioRead (NULL), - pbioWrite (NULL) -{ - /* TODO someday: make it possible to re-use SSL contexts so we don't have to create - * a new one every time we come here. - */ - - Context = new SslContext_t (bIsServer, privkeyfile, certchainfile); - assert (Context); - - pbioRead = BIO_new (BIO_s_mem()); - assert (pbioRead); - - pbioWrite = BIO_new (BIO_s_mem()); - assert (pbioWrite); - - pSSL = SSL_new (Context->pCtx); - assert (pSSL); - SSL_set_bio (pSSL, pbioRead, pbioWrite); - - if (!bIsServer) - SSL_connect (pSSL); -} - - - -/******************* -SslBox_t::~SslBox_t -*******************/ - -SslBox_t::~SslBox_t() -{ - // Freeing pSSL will also free the associated BIOs, so DON'T free them separately. - if (pSSL) { - if (SSL_get_shutdown (pSSL) & SSL_RECEIVED_SHUTDOWN) - SSL_shutdown (pSSL); - else - SSL_clear (pSSL); - SSL_free (pSSL); - } - - delete Context; -} - - - -/*********************** -SslBox_t::PutCiphertext -***********************/ - -bool SslBox_t::PutCiphertext (const char *buf, int bufsize) -{ - assert (buf && (bufsize > 0)); - - assert (pbioRead); - int n = BIO_write (pbioRead, buf, bufsize); - - return (n == bufsize) ? true : false; -} - - -/********************** -SslBox_t::GetPlaintext -**********************/ - -int SslBox_t::GetPlaintext (char *buf, int bufsize) -{ - if (!SSL_is_init_finished (pSSL)) { - int e = bIsServer ? SSL_accept (pSSL) : SSL_connect (pSSL); - if (e < 0) { - int er = SSL_get_error (pSSL, e); - if (er != SSL_ERROR_WANT_READ) { - // Return -1 for a nonfatal error, -2 for an error that should force the connection down. - return (er == SSL_ERROR_SSL) ? (-2) : (-1); - } - else - return 0; - } - // If handshake finished, FALL THROUGH and return the available plaintext. - } - - if (!SSL_is_init_finished (pSSL)) { - // We can get here if a browser abandons a handshake. - // The user can see a warning dialog and abort the connection. - cerr << ""; - return 0; - } - - //cerr << "CIPH: " << SSL_get_cipher (pSSL) << endl; - - int n = SSL_read (pSSL, buf, bufsize); - if (n >= 0) { - return n; - } - else { - if (SSL_get_error (pSSL, n) == SSL_ERROR_WANT_READ) { - return 0; - } - else { - return -1; - } - } - - return 0; -} - - - -/************************** -SslBox_t::CanGetCiphertext -**************************/ - -bool SslBox_t::CanGetCiphertext() -{ - assert (pbioWrite); - return BIO_pending (pbioWrite) ? true : false; -} - - - -/*********************** -SslBox_t::GetCiphertext -***********************/ - -int SslBox_t::GetCiphertext (char *buf, int bufsize) -{ - assert (pbioWrite); - assert (buf && (bufsize > 0)); - - return BIO_read (pbioWrite, buf, bufsize); -} - - - -/********************** -SslBox_t::PutPlaintext -**********************/ - -int SslBox_t::PutPlaintext (const char *buf, int bufsize) -{ - // The caller will interpret the return value as the number of bytes written. - // WARNING WARNING WARNING, are there any situations in which a 0 or -1 return - // from SSL_write means we should immediately retry? The socket-machine loop - // will probably wait for a time-out cycle (perhaps a second) before re-trying. - // THIS WOULD CAUSE A PERCEPTIBLE DELAY! - - /* We internally queue any outbound plaintext that can't be dispatched - * because we're in the middle of a handshake or something. - * When we get called, try to send any queued data first, and then - * send the caller's data (or queue it). We may get called with no outbound - * data, which means we try to send the outbound queue and that's all. - * - * Return >0 if we wrote any data, 0 if we didn't, and <0 for a fatal error. - * Note that if we return 0, the connection is still considered live - * and we are signalling that we have accepted the outbound data (if any). - */ - - OutboundQ.Push (buf, bufsize); - - if (!SSL_is_init_finished (pSSL)) - return 0; - - bool fatal = false; - bool did_work = false; - - while (OutboundQ.HasPages()) { - const char *page; - int length; - OutboundQ.Front (&page, &length); - assert (page && (length > 0)); - int n = SSL_write (pSSL, page, length); - if (n > 0) { - did_work = true; - OutboundQ.PopFront(); - } - else { - int er = SSL_get_error (pSSL, n); - if ((er != SSL_ERROR_WANT_READ) && (er != SSL_ERROR_WANT_WRITE)) - fatal = true; - break; - } - } - - - if (did_work) - return 1; - else if (fatal) - return -1; - else - return 0; -} - - -#endif // WITH_SSL - diff --git a/test/scanners/cpp/pleac.expected.raydebug b/test/scanners/cpp/pleac.expected.raydebug deleted file mode 100644 index 62426ec..0000000 --- a/test/scanners/cpp/pleac.expected.raydebug +++ /dev/null @@ -1,2041 +0,0 @@ -comment(// -*- c++ -*-) - -comment(// @@PLEAC@@_NAME) -comment(// @@SKIP@@ C++/STL/Boost) - - -comment(// @@PLEAC@@_WEB) -comment(// @@SKIP@@ http://www.research.att.com/~bs/C++.html) -comment(// @@SKIP@@ http://www.boost.org/) - - -comment(// @@PLEAC@@_1.0) -comment(// NOTE: Whilst it is perfectly valid to use Standard C Library, or GNU) -comment(// C Library, routines in C++ programs, the code examples here will, as) -comment(// far as possible, avoid doing so, instead using C++-specific functionality) -comment(// and idioms. In general:) -comment(// * I/O will be iostream-based [i.e. no 'scanf', 'printf', 'fgets' etc]) -comment(// * Container / iterator idioms based on the Standard Template Library [STL]) -comment(// will replace the built-in array / raw pointer idioms typically used in C) -comment(// * Boost Library functionality utilised wherever possible [the reason for) -comment(// this is that much of this functionality is likely to appear in the next) -comment(// C++ standard]) -comment(// * Error detection/handling will generally be exception-based [this is done) -comment(// to keep examples simple. Exception use is optional in C++, and is not as) -comment(// pervasive as it is in other languages like Java or C#]) -comment(// C-based solution(s\) to problem(s\) will be found in the corresponding section) -comment(// of PLEAC-C/Posix/GNU.) - -comment(// In C++, one can use the builtin 'char *' type or the 'string' type) -comment(// to represent strings. In this section, we will work with the C++) -comment(// library 'string' class.) - -comment(// Characteristics of 'string' types:) -comment(// - may be of any length) -comment(// - are defined within the std namespace) -comment(// - can be converted to a 'const char *' using std::string::c_str(\)) -comment(// - can be subscripted to access individual characters (e.g., str[3]) -comment(// returns the 4th character of the string) -comment(// - memory associated with strings is reclaimed automatically as strings) -comment(// go out of scope) -comment(// - strings cannot be used as true/false values (i.e., the following is not) -comment(// allowed: string s; if (s\) {}\)) - -comment(//-----------------------------) -comment(// Before using strings, you must include the header file) -preprocessor(#include) include() - -comment(//-----------------------------) -comment(// To create a literal strings, you must use double quotes ("\). You cannot) -comment(// use single quotes. ) - -comment(//-----------------------------) -comment(// String variables must be declared -- if no value is given it's) -comment(// value is the empty string (""\). ) -ident(std)operator(::)pre_type(string) ident(s)operator(;) - -comment(//-----------------------------) -comment(// To insert special characters, quote the character with \\ -std::string s1 = "\\\\n"; // Two characters, \\ and n) -ident(std)operator(::)pre_type(string) ident(s2) operator(=) stringoperator(;) comment(// Literal double quotes) - -comment(//-----------------------------) -comment(// Strings can be declared in one of two ways) -ident(std)operator(::)pre_type(string) ident(s1) operator(=) stringoperator(;) -ident(std)operator(::)pre_type(string) ident(s2)operator(()stringoperator(\);) - -comment(//-----------------------------) -comment(// Multi-line strings.) -comment(// There is no equivalent to perl's "here" documents in c++) -ident(std)operator(::)pre_type(string) ident(s1) operator(=) stringoperator(;) - -ident(std)operator(::)pre_type(string) ident(s2) operator(=) stringoperator(;) -comment(//-----------------------------) - - -comment(// @@PLEAC@@_1.1) -ident(std)operator(::)pre_type(string) ident(s) operator(=) stringoperator(;) - -comment(//-----------------------------) -ident(std)operator(::)pre_type(string) ident(value1) operator(=) ident(s)operator(.)ident(substr)operator(()ident(offset)operator(,) ident(length)operator(\);) -ident(std)operator(::)pre_type(string) ident(value2) operator(=) ident(s)operator(.)ident(substr)operator(()ident(offset)operator(\);) - -comment(// Unlike perl, the substr function returns a copy of the substring) -comment(// rather than a reference to the existing substring, thus using substr) -comment(// on the left hand side of an assignment statement will not modify ) -comment(// the original string. To get this functionality, you can use the) -comment(// std::string::replace function.) - -comment(// Using offsets and lengths) -ident(s)operator(.)ident(replace)operator(()ident(offset)operator(,) ident(length)operator(,) ident(newstring)operator(\);) -ident(s)operator(.)ident(replace)operator(()ident(offset)operator(,) ident(s)operator(.)ident(size)operator((\)-)ident(offset)operator(,) ident(newtail)operator(\);) - -comment(//-----------------------------) -comment(// The C++ string class doesn't have anything equivalent to perl's unpack.) -comment(// Instead, one can use C structures to import/export binary data) - -comment(//-----------------------------) -preprocessor(#include) include() -pre_type(string) ident(s) operator(=) stringoperator(;) - -ident(std)operator(::)pre_type(string) ident(first) operator(=) ident(s)operator(.)ident(substr)operator(()integer(0)operator(,) integer(1)operator(\);) comment(// "T") -ident(std)operator(::)pre_type(string) ident(second) operator(=) ident(s)operator(.)ident(substr)operator(()integer(5)operator(,) integer(2)operator(\);) comment(// "is") -ident(std)operator(::)pre_type(string) ident(rest) operator(=) ident(s)operator(.)ident(substr)operator(()integer(13)operator(\);) comment(// "you have") - -comment(// C++ strings do not support backwards indexing as perl does but ) -comment(// you can fake it out by subtracting the negative index from the) -comment(// string length) -ident(std)operator(::)pre_type(string) ident(last) operator(=) ident(s)operator(.)ident(substr)operator(()ident(s)operator(.)ident(size)operator((\)-)integer(1)operator(\);) comment(// "e") -ident(std)operator(::)pre_type(string) ident(end) operator(=) ident(s)operator(.)ident(substr)operator(()ident(s)operator(.)ident(size)operator((\)-)integer(4)operator(\);) comment(// "have") -ident(std)operator(::)pre_type(string) ident(piece) operator(=) ident(s)operator(.)ident(substr)operator(()ident(s)operator(.)ident(size)operator((\)-)integer(8)operator(,) integer(3)operator(\);) comment(// "you") - -comment(//-----------------------------) -preprocessor(#include) include() -preprocessor(#include) include() - -pre_type(string) ident(s)operator(()stringoperator(\);) -ident(std)operator(::)ident(cout) operator(<<) ident(s) operator(<<) ident(std)operator(::)ident(endl)operator(;) -comment(// This is what you have) - -ident(s)operator(.)ident(replace)operator(()integer(5)operator(,)integer(2)operator(,)stringoperator(\);) comment(// change "is to "wasn't") -comment(// This wasn't what you have) - -ident(s)operator(.)ident(replace)operator(()ident(s)operator(.)ident(size)operator((\)-)integer(12)operator(,) integer(12)operator(,) stringoperator(\);) comment(// "This wasn't wondrous") -comment(// This wasn't wonderous) - -ident(s)operator(.)ident(replace)operator(()integer(0)operator(,) integer(1)operator(,) stringoperator(\);) comment(// delete first character) -comment(// his wasn't wondrous) - -ident(s)operator(.)ident(replace)operator(()ident(s)operator(.)ident(size)operator((\)-)integer(10)operator(,) integer(10)operator(,) stringoperator(\);) comment(// delete last 10 characters) -comment(// his wasn') - -comment(//-----------------------------) -comment(// C++ does not have built-in support for the perl s///, m//, and tr/// ) -comment(// operators; however, similar results can be achieved in at least ) -comment(// two ways:) -comment(// - string operations such as string::find, string::rfind, etc.) -comment(// - the boost regular expression library (regex++\) supports perl) -comment(// regular expression syntax.) -comment(// TODO: Add examples of each.) - -comment(// MISSING: if (substr($string, -10\) =~ /pattern/\) {) -comment(// print "Pattern matches in last 10 characters\\n";) -comment(// }) - -comment(// MISSING: substr($string, 0, 5\) =~ s/is/at/g;) - -comment(//-----------------------------) -comment(// exchange the first and last letters in a string using substr and replace) -pre_type(string) ident(a) operator(=) stringoperator(;) - -ident(std)operator(::)pre_type(string) ident(first) operator(=) ident(a)operator(.)ident(substr)operator(()integer(0)operator(,)integer(1)operator(\);) -ident(std)operator(::)pre_type(string) ident(last) operator(=) ident(a)operator(.)ident(substr)operator(()ident(a)operator(.)ident(size)operator((\)-)integer(1)operator(\);) - -ident(a)operator(.)ident(replace)operator(()integer(0)operator(,)integer(1)operator(,) ident(last)operator(\);) -ident(a)operator(.)ident(replace)operator(()ident(a)operator(.)ident(size)operator((\)-)integer(1)operator(,) integer(1)operator(,) ident(first)operator(\);) - -comment(// exchange the first and last letters in a string using indexing and swap) -preprocessor(#include) include() -ident(std)operator(::)ident(swap)operator(()ident(a)operator([)integer(0)operator(],) ident(a)operator([)ident(a)operator(.)ident(size)operator((\)-)integer(1)operator(]\);) -comment(//-----------------------------) - - -comment(// @@PLEAC@@_1.2) -comment(//-----------------------------) -comment(// C++ doesn't have functionality equivalent to the || and ||=. ) -comment(// If statements and trigraphs can be used instead.) -comment(//-----------------------------) -comment(// C++ doesn't have anything equivalent "defined". C++ variables) -comment(// cannot be used at all if they have not previously been defined.) - -comment(//-----------------------------) -comment(// Use b if b is not empty, else c) -ident(a) operator(=) ident(b)operator(.)ident(size)operator((\)) operator(?) ident(b) operator(:) ident(c)operator(;) - -comment(// Set x to y unless x is not empty) -reserved(if) operator(()ident(x)operator(.)ident(is_empty)operator((\)\)) ident(x) operator(=) ident(y)operator(;) - -comment(//-----------------------------) -ident(foo) operator(=) operator((!)ident(bar)operator(.)ident(is_empty)operator((\)\)) operator(?) ident(bar) operator(:) stringoperator(;) - -comment(//-----------------------------) -comment(// NOTE: argv is declared as char *argv[] in C/C++. We assume) -comment(// the following code surrounds the following examples that deal) -comment(// with argv. Also, arguments to a program start at argv[1] -- argv[0]) -comment(// is the name of the executable that's running.) -preprocessor(#include) include() -pre_type(int) ident(main)operator(()pre_type(int) ident(argc)operator(,) pre_type(char) operator(*)ident(argv)operator([]\)) operator({) - pre_type(char) operator(**)ident(args) operator(=) ident(argv)operator(+)integer(1)operator(;) comment(// +1 skips argv[0], the name of the executable) - comment(// examples) -operator(}) - -comment(//-----------------------------) -ident(std)operator(::)pre_type(string) ident(dir) operator(=) operator((*)ident(args)operator(\)) operator(?) operator(*)ident(argv)operator(++) operator(:) stringoperator(;) - -comment(//-----------------------------) -ident(std)operator(::)pre_type(string) ident(dir) operator(=) ident(argv)operator([)integer(1)operator(]) operator(?) ident(argv)operator([)integer(1)operator(]) operator(:) stringoperator(;) - -comment(//-----------------------------) -ident(std)operator(::)pre_type(string) ident(dir) operator(=) operator(()ident(argc)operator(-)integer(1)operator(\)) operator(?) ident(argv)operator([)integer(1)operator(]) operator(:) stringoperator(;) - -comment(//-----------------------------) -preprocessor(#include) include() -ident(std)operator(::)ident(map)operator(<)ident(std)operator(::)pre_type(string)operator(,)pre_type(int)operator(>) ident(count)operator(;) - -ident(count)operator([)ident(shell)operator(.)ident(size)operator((\)) operator(?) ident(shell) operator(:) stringoperator(]++;) - -comment(//-----------------------------) -comment(// find the user name on Unix systems) -comment(// TODO: Simplify. This is too ugly and complex) -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include("boost/lexical_cast.hpp") - -ident(std)operator(::)pre_type(string) ident(user)operator(;) -pre_type(char) operator(*)ident(msg) operator(=) integer(0)operator(;) -ident(passwd) operator(*)ident(pwd) operator(=) integer(0)operator(;) - -reserved(if) operator(() operator(()ident(msg) operator(=) ident(getenv)operator(()stringoperator(\)\)) operator(||) - operator(()ident(msg) operator(=) ident(getenv)operator(()stringoperator(\)\)) operator(||) - operator(()ident(msg) operator(=) ident(getlogin)operator((\)\)) operator(\)) - ident(user) operator(=) ident(msg)operator(;) -reserved(else) reserved(if) operator(()ident(pwd) operator(=) ident(getpwuid)operator(()ident(getuid)operator((\)\)\)) - ident(user) operator(=) ident(pwd)operator(->)ident(pw_name)operator(;) -reserved(else) - ident(user) operator(=) string operator(+) ident(boost)operator(::)ident(lexical_cast)operator(<)ident(std)operator(::)pre_type(string)operator(>()ident(getuid)operator((\)\);) - -comment(//-----------------------------) -reserved(if) operator(()ident(starting_point)operator(.)ident(is_empty)operator((\)\)) ident(starting_point) operator(=) stringoperator(;) - -comment(//-----------------------------) -comment(// Example using list. Other C++ STL containers work similarly.) -preprocessor(#include) include() -ident(list)operator(<)pre_type(int)operator(>) ident(a)operator(,) ident(b)operator(;) -reserved(if) operator(()ident(a)operator(.)ident(is_empty)operator((\)\)) ident(a) operator(=) ident(b)operator(;) comment(// copy only if a is empty) -ident(a) operator(=) operator((!)ident(b)operator(.)ident(is_empty)operator((\)\)) operator(?) ident(b) operator(:) ident(c)operator(;) comment(// asign b if b nonempty, else c) -comment(//-----------------------------) - - -comment(// @@PLEAC@@_1.3) -comment(//-----------------------------) -preprocessor(#include) include() -ident(std)operator(::)ident(swap)operator(()ident(a)operator(,) ident(b)operator(\);) - -comment(//-----------------------------) -ident(temp) operator(=) ident(a)operator(;) -ident(a) operator(=) ident(b)operator(;) -ident(b) operator(=) ident(temp)operator(;) - -comment(//-----------------------------) -ident(std)operator(::)pre_type(string) ident(a)operator(()stringoperator(\);) -ident(std)operator(::)pre_type(string) ident(b)operator(()stringoperator(\);) -ident(std)operator(::)ident(swap)operator(()ident(a)operator(,)ident(b)operator(\);) - -comment(//-----------------------------) -comment(// The ability to exchange more than two variables at once is not ) -comment(// built into the C++ language or C++ standard libraries. However, you) -comment(// can use the boost tuple library to accomplish this.) -preprocessor(#include) include() - -ident(boost)operator(::)ident(tie)operator(()ident(alpha)operator(,)ident(beta)operator(,)ident(production)operator(\)) - operator(=) ident(boost)operator(::)ident(make_tuple)operator(()stringoperator(,) stringoperator(,) stringoperator(\);) -comment(// move beta to alpha,) -comment(// move production to beta,) -comment(// move alpha to production) -ident(boost)operator(::)ident(tie)operator(()ident(alpha)operator(,) ident(beta)operator(,) ident(production)operator(\)) - operator(=) ident(boost)operator(::)ident(make_tuple)operator(()ident(beta)operator(,) ident(production)operator(,) ident(alpha)operator(\);) -comment(//-----------------------------) - - -comment(// @@PLEAC@@_1.4) -comment(//-----------------------------) -comment(// There are several ways to convert between characters) -comment(// and integers. The examples assume the following declarations:) -pre_type(char) ident(ch)operator(;) -pre_type(int) ident(num)operator(;) - -comment(//-----------------------------) -comment(// Using implicit conversion) -ident(num) operator(=) ident(ch)operator(;) -ident(ch) operator(=) ident(num)operator(;) - -comment(//-----------------------------) -comment(// New-style C++ casts) -ident(ch) operator(=) reserved(static_cast)operator(<)pre_type(char)operator(>()ident(num)operator(\);) -ident(num) operator(=) reserved(static_cast)operator(<)pre_type(int)operator(>()ident(ch)operator(\);) - -comment(//-----------------------------) -comment(// Old-style C casts) -ident(ch) operator(=) operator(()pre_type(char)operator(\))ident(num)operator(;) -ident(num) operator(=) operator(()pre_type(int)operator(\))ident(ch)operator(;) - -comment(//-----------------------------) -comment(// Using the C++ stringstream class) -preprocessor(#include) include() comment(// On some older compilers, use ) -ident(std)operator(::)ident(stringstream) ident(a)operator(;) comment(// On some older compilers, use std::strstream) - -ident(a) operator(<<) ident(ch)operator(;) comment(// Append character to a string) -ident(a) operator(>>) ident(num)operator(;) comment(// Output character as a number) - -ident(a) operator(<<) ident(num)operator(;) comment(// Append number to a string) -ident(a) operator(>>) ident(ch)operator(;) comment(// Output number as a character) - -comment(//-----------------------------) -comment(// Using sprintf, printf) -pre_type(char) ident(str)operator([)integer(2)operator(];) comment(// Has to be length 2 to have room for NULL character) -ident(sprintf)operator(()ident(str)operator(,) stringoperator(,) ident(num)operator(\);) -ident(printf)operator(()stringoperator(,) ident(num)operator(,) ident(num)operator(\);) - -comment(//-----------------------------) -pre_type(int) ident(ascii_value) operator(=) char('e')operator(;) comment(// now 101) -pre_type(char) ident(character) operator(=) integer(101)operator(;) comment(// now 'e') - -comment(//-----------------------------) -ident(printf)operator(()stringoperator(,) integer(101)operator(,) integer(101)operator(\);) - -comment(//-----------------------------) -comment(// Convert from HAL to IBM, character by character) -preprocessor(#include) include() -preprocessor(#include) include() - -ident(std)operator(::)pre_type(string) ident(ibm)operator(,) ident(hal) operator(=) stringoperator(;) -reserved(for) operator(()pre_type(unsigned) pre_type(int) ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(hal)operator(.)ident(size)operator((\);) operator(++)ident(i)operator(\)) - ident(ibm) operator(+=) ident(hal)operator([)ident(i)operator(]+)integer(1)operator(;) comment(// Add one to each ascii value) -ident(std)operator(::)ident(cout) operator(<<) ident(ibm) operator(<<) ident(std)operator(::)ident(endl)operator(;) comment(// prints "IBM") - -comment(//-----------------------------) -comment(// Convert hal from HAL to IBM) -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() comment(// For bind1st and plus<>) -preprocessor(#include) include() comment(// For transform ) - -ident(std)operator(::)pre_type(string) ident(hal) operator(=) stringoperator(;) -ident(transform)operator(()ident(hal)operator(.)ident(begin)operator((\),) ident(hal)operator(.)ident(end)operator((\),) ident(hal)operator(.)ident(begin)operator((\),) - ident(bind1st)operator(()ident(plus)operator(<)pre_type(char)operator(>(\),)integer(1)operator(\)\);) -ident(std)operator(::)ident(cout) operator(<<) ident(hal) operator(<<) ident(std)operator(::)ident(endl)operator(;) comment(// prints "IBM") -comment(//-----------------------------) - - -comment(// @@PLEAC@@_1.5) -comment(//-----------------------------) -comment(// Since C++ strings can be accessed one character at a time,) -comment(// there's no need to do any processing on the string to convert) -comment(// it into an array of characters. ) -preprocessor(#include) include() -ident(std)operator(::)pre_type(string) ident(s)operator(;) - -comment(// Accessing characters using for loop and integer offsets) -reserved(for) operator(()pre_type(unsigned) pre_type(int) ident(i)operator(=)integer(0)operator(;) ident(i)operator(<)ident(s)operator(.)ident(size)operator((\);) operator(++)ident(i)operator(\)) operator({) - comment(// do something with s[i]) -operator(}) - -comment(// Accessing characters using iterators) -reserved(for) operator(()ident(std)operator(::)pre_type(string)operator(::)ident(iterator) ident(i)operator(=)ident(s)operator(.)ident(begin)operator((\);) ident(i)operator(!=)ident(s)operator(.)ident(end)operator((\);) operator(++)ident(i)operator(\)) operator({) - comment(// do something with *i) -operator(}) - -comment(//-----------------------------) -ident(std)operator(::)pre_type(string) ident(str) operator(=) stringoperator(;) -ident(std)operator(::)ident(map)operator(<)pre_type(char)operator(,)pre_type(int)operator(>) ident(seen)operator(;) - -reserved(for) operator(()ident(std)operator(::)pre_type(string)operator(::)ident(iterator) ident(i)operator(=)ident(str)operator(.)ident(begin)operator((\);) ident(i)operator(!=)ident(str)operator(.)ident(end)operator((\);) operator(++)ident(i)operator(\)) - ident(seen)operator([*)ident(i)operator(]++;) - -ident(std)operator(::)ident(cout) operator(<<) stringoperator(;) -reserved(for) operator(()ident(std)operator(::)ident(map)operator(<)pre_type(char)operator(,)pre_type(int)operator(>::)ident(iterator) ident(i)operator(=)ident(seen)operator(.)ident(begin)operator((\);) ident(i)operator(!=)ident(seen)operator(.)ident(end)operator((\);) operator(++)ident(i)operator(\)) - ident(std)operator(::)ident(cout) operator(<<) ident(i)operator(->)ident(first)operator(;) -ident(std)operator(::)ident(cout) operator(<<) ident(std)operator(::)ident(endl)operator(;) -comment(// unique chars are: adelnpy) - -comment(//-----------------------------) -pre_type(int) ident(sum) operator(=) integer(0)operator(;) -reserved(for) operator(()ident(std)operator(::)pre_type(string)operator(::)ident(iterator) ident(i)operator(=)ident(str)operator(.)ident(begin)operator((\);) ident(i)operator(!=)ident(str)operator(.)ident(end)operator((\);) operator(++)ident(i)operator(\)) - ident(sum) operator(+=) operator(*)ident(i)operator(;) -ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(sum) operator(<<) ident(std)operator(::)ident(endl)operator(;) -comment(// prints "sum is 1248" if str was "an appla a day") - - -comment(//-----------------------------) -comment(// MISSING: sysv-like checksum program) - -comment(//-----------------------------) -comment(// slowcat, emulate a slow line printer) -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -pre_type(int) ident(main)operator(()pre_type(int) ident(argc)operator(,) pre_type(char) operator(*)ident(argv)operator([]\)) operator({) - ident(timeval) ident(delay) operator(=) operator({) integer(0)operator(,) integer(50000) operator(};) comment(// Delay in { seconds, nanoseconds }) - pre_type(char) operator(**)ident(arg) operator(=) ident(argv)operator(+)integer(1)operator(;) - reserved(while) operator((*)ident(arg)operator(\)) operator({) comment(// For each file) - ident(std)operator(::)ident(ifstream) ident(file)operator((*)ident(arg)operator(++\);) - pre_type(char) ident(c)operator(;) - reserved(while) operator(()ident(file)operator(.)ident(get)operator(()ident(c)operator(\)\)) operator({) - ident(std)operator(::)ident(cout)operator(.)ident(put)operator(()ident(c)operator(\);) - ident(std)operator(::)ident(cout)operator(.)ident(flush)operator((\);) - ident(select)operator(()integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) operator(&)ident(delay)operator(\);) - operator(}) - operator(}) -operator(}) -comment(//-----------------------------) - - -comment(// @@PLEAC@@_1.6) -comment(//-----------------------------) -preprocessor(#include) include() -preprocessor(#include) include() comment(// For reverse) -ident(std)operator(::)pre_type(string) ident(s)operator(;) - -ident(reverse)operator(()ident(s)operator(.)ident(begin)operator((\),) ident(s)operator(.)ident(end)operator((\)\);) - -comment(//-----------------------------) -preprocessor(#include) include() comment(// For std::vector) -preprocessor(#include) include() comment(// On older compilers, use ) -preprocessor(#include) include("boost/regex.hpp") comment(// For boost::regex_split) - -ident(std)operator(::)pre_type(string) ident(str)operator(;) -ident(std)operator(::)ident(vector)operator(<)ident(std)operator(::)pre_type(string)operator(>) ident(words)operator(;) -ident(boost)operator(::)ident(regex_split)operator(()ident(std)operator(::)ident(back_inserter)operator(()ident(words)operator(\),) ident(str)operator(\);) -ident(reverse)operator(()ident(words)operator(.)ident(begin)operator((\),) ident(words)operator(.)ident(end)operator((\)\);) comment(// Reverse the order of the words) - -ident(std)operator(::)ident(stringstream) ident(revwords)operator(;) comment(// On older compilers, use strstream) -ident(copy)operator(()ident(words)operator(.)ident(begin)operator((\),) ident(words)operator(.)ident(end)operator((\),) ident(ostream_inserter)operator(<)pre_type(string)operator(>()ident(revwords)operator(,)stringoperator(\);) -ident(std)operator(::)ident(cout) operator(<<) ident(revwards)operator(.)ident(str)operator((\)) operator(<<) ident(std)operator(::)ident(endl)operator(;) - -comment(//-----------------------------) -ident(std)operator(::)pre_type(string) ident(rts) operator(=) ident(str)operator(;) -ident(reverse)operator(()ident(rts)operator(.)ident(begin)operator((\),) ident(rts)operator(.)ident(end)operator((\)\);) comment(// Reverses letters in rts) - -comment(//-----------------------------) -ident(std)operator(::)ident(vector)operator(<)pre_type(string)operator(>) ident(words)operator(;) -ident(reverse)operator(()ident(words)operator(.)ident(begin)operator((\),) ident(words)operator(.)ident(end)operator((\)\);) comment(// Reverses words in container) - -comment(//-----------------------------) -comment(// Reverse word order) -ident(std)operator(::)pre_type(string) ident(s) operator(=) stringoperator(;) - -ident(std)operator(::)ident(vector)operator(<)ident(std)operator(::)pre_type(string)operator(>) ident(allwords)operator(;) -ident(boost)operator(::)ident(regex_split)operator(()ident(std)operator(::)ident(back_inserter)operator(()ident(allwords)operator(\),) ident(s)operator(\);) - -ident(reverse)operator(()ident(allwords)operator(.)ident(begin)operator((\),) ident(allwords)operator(.)ident(end)operator((\)\);) - -ident(std)operator(::)ident(stringstream) ident(revwords)operator(;) comment(// On older compilers, use strstream) -ident(copy)operator(()ident(allwords)operator(.)ident(begin)operator((\),) ident(allwords)operator(.)ident(end)operator((\),) ident(ostream_inserter)operator(<)pre_type(string)operator(>()ident(revwords)operator(,)stringoperator(\)\);) -ident(std)operator(::)ident(cout) operator(<<) ident(revwards)operator(.)ident(str)operator((\)) operator(<<) ident(std)operator(::)ident(endl)operator(;) -comment(// this?' see you 'can said, Yoda) - -comment(//-----------------------------) -ident(std)operator(::)pre_type(string) ident(word) operator(=) stringoperator(;) -pre_type(bool) ident(is_palindrome) operator(=) ident(equal)operator(()ident(word)operator(.)ident(begin)operator((\),) ident(word)operator(.)ident(end)operator((\),) ident(word)operator(.)ident(rbegin)operator((\)\);) - -comment(//-----------------------------) -preprocessor(#include) include() - -ident(std)operator(::)ident(ifstream) ident(dict)operator(()stringoperator(\);) -ident(std)operator(::)pre_type(string) ident(word)operator(;) -reserved(while)operator(()ident(getline)operator(()ident(dict)operator(,)ident(word)operator(\)\)) operator({) - reserved(if) operator(()ident(equal)operator(()ident(word)operator(.)ident(begin)operator((\),) ident(word)operator(.)ident(end)operator((\),) ident(word)operator(.)ident(rbegin)operator((\)\)) operator(&&) - ident(word)operator(.)ident(size)operator((\)) operator(>) integer(5)operator(\)) - ident(std)operator(::)ident(cout) operator(<<) ident(word) operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) -comment(//-----------------------------) - - -comment(// @@PLEAC@@_1.7) -comment(//-----------------------------) -preprocessor(#include) include() - -ident(std)operator(::)pre_type(string)operator(::)ident(size_type) ident(pos)operator(;) -reserved(while) operator((()ident(pos) operator(=) ident(str)operator(.)ident(find)operator(()stringoperator(\)\)) operator(!=) ident(std)operator(::)pre_type(string)operator(::)ident(npos)operator(\)) - ident(str)operator(.)ident(replace)operator(()ident(pos)operator(,) integer(1)operator(,) pre_type(string)operator(()char(' ')operator(,)integer(8)operator(-)ident(pos)operator(%)integer(8)operator(\)\);) -comment(//-----------------------------) - - -comment(// @@PLEAC@@_1.8) -comment(//-----------------------------) -comment(// Not applicable to C++) -comment(//-----------------------------) - - -comment(// @@PLEAC@@_1.9) -comment(//-----------------------------) -comment(// TODO: Fix to be more like cookbook) -comment(// TODO: Modify/add code to do this with locales) -preprocessor(#include) include() -preprocessor(#include) include() - -ident(std)operator(::)pre_type(string) ident(phrase) operator(=) stringoperator(;) -ident(transform)operator(()ident(phrase)operator(.)ident(begin)operator((\),) ident(phrase)operator(.)ident(end)operator((\),) ident(phrase)operator(.)ident(begin)operator((\),) ident(toupper)operator(\);) -comment(// "BO PEEP") -ident(transform)operator(()ident(phrase)operator(.)ident(begin)operator((\),) ident(phrase)operator(.)ident(end)operator((\),) ident(phrase)operator(.)ident(begin)operator((\),) ident(tolower)operator(\);) -comment(// "bo peep") -comment(//-----------------------------) - - -comment(// @@PLEAC@@_1.10) -comment(//-----------------------------) -comment(// C++ does not provide support for perl-like in-string interpolation,) -comment(// concatenation must be used instead.) - -preprocessor(#include) include() - -ident(std)operator(::)pre_type(string) ident(var1)operator(,) ident(var2)operator(;) -ident(std)operator(::)pre_type(string) ident(answer) operator(=) ident(var1) operator(+) ident(func)operator((\)) operator(+) ident(var2)operator(;) comment(// func returns string or char *) - -comment(//-----------------------------) -preprocessor(#include) include("boost/lexical_cast.hpp") - -pre_type(int) ident(n) operator(=) integer(4)operator(;) -ident(std)operator(::)pre_type(string) ident(phrase) operator(=) string operator(+) ident(boost)operator(::)ident(lexical_cast)operator(<)pre_type(string)operator(>()ident(n)operator(+)integer(1)operator(\)) operator(+) stringoperator(;) - -comment(//-----------------------------) -ident(std)operator(::)ident(cout) operator(<<) string operator(+) ident(boost)operator(::)ident(lexical_cast)operator(<)pre_type(string)operator(>()ident(n)operator(+)integer(1)operator(\)) operator(+) string operator(<<) ident(std)operator(::)ident(endl)operator(;) - - -comment(// @@PLEAC@@_1.11) -comment(//-----------------------------) -comment(// C++ does not have "here documents".) -comment(// TODO: Lots more.) -preprocessor(#include) include() -preprocessor(#include) include("boost/regex.hpp") - -ident(std)operator(::)pre_type(string) ident(var) operator(=) stringoperator(;) - -ident(boost)operator(::)ident(regex) ident(ex)operator(()stringoperator(\);) -ident(var) operator(=) ident(boost)operator(::)ident(regex_merge)operator(()ident(var)operator(,) ident(ex)operator(,) stringoperator(\);) - -comment(// @@PLEAC@@_10.0) -comment(// NOTE: Whilst it is perfectly valid to use Standard C Library, or GNU C Library, routines in) -comment(// C++ programs, the code examples here will, as far as possible, avoid doing so, instead using) -comment(// C++-specific functionality and idioms. In general:) -comment(// * I/O will be iostream-based [i.e. no 'scanf', 'printf', 'fgets' etc]) -comment(// * Container / iterator idioms based on the Standard Template Library [STL]) -comment(// will replace the built-in array / raw pointer idioms typically used in C) -comment(// * Boost Library functionality utilised wherever possible [the reason for) -comment(// this is that much of this functionality is likely to appear in the next) -comment(// C++ standard]) -comment(// * Error detection/handling will generally be exception-based [this is done) -comment(// to keep examples simple. Exception use is optional in C++, and is not as) -comment(// pervasive as it is in other languages like Java or C#]) -comment(// C-based solution(s\) to problem(s\) will be found in the corresponding section of PLEAC-C/Posix/GNU.) - -preprocessor(#include) include() - -comment(// 'greeted' defined outside of any namespace, class or function, so is part of the) -comment(// global namespace, and will be visible throughout the entire executable. Should it) -comment(// be necessary to restrict the visibility of this global identifier to the current) -comment(// 'compilation unit' [i.e. current source file] then the following may be used:) -comment(//) -comment(// namespace { int greeted = 0; }) -comment(//) -comment(// The effect is similar to using the 'static' keyword, in this same context, in the C) -comment(// language.) - -pre_type(int) ident(greeted) operator(=) integer(0)operator(;) - -pre_type(int) ident(howManyGreetings)operator((\);) -directive(void) ident(hello)operator((\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - ident(hello)operator((\);) - - pre_type(int) ident(greetings) operator(=) ident(howManyGreetings)operator((\);) - - ident(std)operator(::)ident(cout) operator(<<) string - operator(<<) ident(greetings) - operator(<<) string - operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// ----) - -pre_type(int) ident(howManyGreetings)operator((\)) -operator({) - comment(// Access 'greeted' identifier in the global namespace using the scope resolution) - comment(// operator. Use of this operator is only necessary if a similarly-named identifier) - comment(// exists in a ) - reserved(return) operator(::)ident(greeted)operator(;) -operator(}) - -directive(void) ident(hello)operator((\)) -operator({) - comment(// Here 'greeted' is accessed without additional qualification. Since a 'greeted' identifier) - comment(// exists only in the global namespace, it is that identifier that is used) - ident(std)operator(::)ident(cout) operator(<<) string - operator(<<) operator(++)ident(greeted) - operator(<<) string - operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// @@PLEAC@@_10.1) -comment(// Standard C++ requires that a function be prototyped, hence the name and type of parameters) -comment(// must be specified, and the argumemt list in any calls to that function must match the) -comment(// parameter list, as shown here ) - -preprocessor(#include) include() - -pre_type(double) ident(hypotenuse)operator(()pre_type(double) ident(side1)operator(,) pre_type(double) ident(side2)operator(\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - pre_type(double) ident(diag) operator(=) ident(hypotenuse)operator(()float(3)float(.0)operator(,) float(4)float(.0)operator(\);) -operator(}) - -comment(// ----) - -pre_type(double) ident(hypotenuse)operator(()pre_type(double) ident(side1)operator(,) pre_type(double) ident(side2)operator(\)) -operator({) - reserved(return) ident(std)operator(::)ident(sqrt)operator(()ident(std)operator(::)ident(pow)operator(()ident(side1)operator(,) float(2)float(.0)operator(\)) operator(+) ident(std)operator(::)ident(pow)operator(()ident(side2)operator(,) float(2)float(.0)operator(\)\);) -operator(}) - -comment(// ----------------------------) - -comment(// Variable length argument list functions, via the C Language derived 'va_...' macros,) -comment(// are also supported. However use of this facility is particularly discouraged in C++) -comment(// because:) -comment(// * It is an inherently type-unsafe facility; type safety is a core C++ concern) -comment(// * Other facilities, such as overloaded functions, and default arguments [neither of which) -comment(// are available in C] can sometimes obviate the need for variable length argument lists) -comment(// * OOP techniques can also lessen the need for variable length argument lists. The most) -comment(// obvious example here is the Iostream library where repeated calls of I/O operators replace) -comment(// the format string / variable arguments of 'printf') - -preprocessor(#include) include() -preprocessor(#include) include() - -pre_type(double) ident(hypotenuse)operator(()pre_type(double) ident(side1)operator(,) operator(.)operator(.)operator(.)operator(\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - pre_type(double) ident(diag) operator(=) ident(hypotenuse)operator(()float(3)float(.0)operator(,) float(4)float(.0)operator(\);) -operator(}) - -comment(// ----) - -pre_type(double) ident(hypotenuse)operator(()pre_type(double) ident(side1)operator(,) operator(.)operator(.)operator(.)operator(\)) -operator({) - comment(// More details available in the corresponding section of PLEAC-C/Posix/GNU) - ident(va_list) ident(ap)operator(;) - ident(va_start)operator(()ident(ap)operator(,) ident(side1)operator(\);) - pre_type(double) ident(side2) operator(=) ident(va_arg)operator(()ident(ap)operator(,) pre_type(double)operator(\);) - ident(va_end)operator(()ident(ap)operator(\);) - - reserved(return) ident(std)operator(::)ident(sqrt)operator(()ident(std)operator(::)ident(pow)operator(()ident(side1)operator(,) float(2)float(.0)operator(\)) operator(+) ident(std)operator(::)ident(pow)operator(()ident(side2)operator(,) float(2)float(.0)operator(\)\);) -operator(}) - -comment(// ----------------------------) - -comment(// An example using default arguments appears below) - -preprocessor(#include) include() - -comment(// Specify default argument values in declaration) -comment(// Note: This may be done in either of the declaration or the definition [not both], but it) -comment(// makes more sense to do so in the declaration since these are usually placed in header files) -comment(// which may be included in several source files. The default argument values would need to be) -comment(// known in all those locations) -pre_type(double) ident(hypotenuse)operator(()pre_type(double) ident(side1) operator(=) float(3)float(.0)operator(,) pre_type(double) ident(side2) operator(=) float(4)float(.0)operator(\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// All arguments specified) - pre_type(double) ident(diag) operator(=) ident(hypotenuse)operator(()float(3)float(.0)operator(,) float(4)float(.0)operator(\);) - - comment(// Both calls utilise default argument value(s\)) - ident(diag) operator(=) ident(hypotenuse)operator(()float(3)float(.0)operator(\);) - - ident(diag) operator(=) ident(hypotenuse)operator((\);) -operator(}) - -comment(// ----) - -pre_type(double) ident(hypotenuse)operator(()pre_type(double) ident(side1)operator(,) pre_type(double) ident(side2)operator(\)) -operator({) - reserved(return) ident(std)operator(::)ident(sqrt)operator(()ident(std)operator(::)ident(pow)operator(()ident(side1)operator(,) float(2)float(.0)operator(\)) operator(+) ident(std)operator(::)ident(pow)operator(()ident(side2)operator(,) float(2)float(.0)operator(\)\);) -operator(}) - -comment(// ----------------------------) - -comment(// A [very contrived, not very practical] example using function overloading appears below) - -preprocessor(#include) include() - -pre_type(double) ident(hypotenuse)operator(()pre_type(double) ident(side1)operator(,) pre_type(double) ident(side2)operator(\);) -pre_type(double) ident(hypotenuse)operator(()pre_type(double) ident(side1)operator(\);) -pre_type(double) ident(hypotenuse)operator((\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// Call version (1\)) - pre_type(double) ident(diag) operator(=) ident(hypotenuse)operator(()float(3)float(.0)operator(,) float(4)float(.0)operator(\);) - - comment(// Call version (2\)) - ident(diag) operator(=) ident(hypotenuse)operator(()float(3)float(.0)operator(\);) - - comment(// Call version (3\)) - ident(diag) operator(=) ident(hypotenuse)operator((\);) -operator(}) - -comment(// ----) - -comment(// (1\)) -pre_type(double) ident(hypotenuse)operator(()pre_type(double) ident(side1)operator(,) pre_type(double) ident(side2)operator(\)) -operator({) - reserved(return) ident(std)operator(::)ident(sqrt)operator(()ident(std)operator(::)ident(pow)operator(()ident(side1)operator(,) float(2)float(.0)operator(\)) operator(+) ident(std)operator(::)ident(pow)operator(()ident(side2)operator(,) float(2)float(.0)operator(\)\);) -operator(}) - -comment(// (2\)) -pre_type(double) ident(hypotenuse)operator(()pre_type(double) ident(side1)operator(\)) -operator({) - reserved(return) ident(std)operator(::)ident(sqrt)operator(()ident(std)operator(::)ident(pow)operator(()ident(side1)operator(,) float(2)float(.0)operator(\)) operator(+) ident(std)operator(::)ident(pow)operator(()float(4)float(.0)operator(,) float(2)float(.0)operator(\)\);) -operator(}) - -comment(// (3\)) -pre_type(double) ident(hypotenuse)operator((\)) -operator({) - reserved(return) ident(std)operator(::)ident(sqrt)operator(()ident(std)operator(::)ident(pow)operator(()float(3)float(.0)operator(,) float(2)float(.0)operator(\)) operator(+) ident(std)operator(::)ident(pow)operator(()float(4)float(.0)operator(,) float(2)float(.0)operator(\)\);) -operator(}) - -comment(// ----------------------------) - -preprocessor(#include) include() -preprocessor(#include) include() - -ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(int_all)operator(()directive(const) pre_type(double) ident(arr)operator([],) ident(size_t) ident(arrsize)operator(\);) -ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(int_all)operator(()directive(const) ident(std)operator(::)ident(vector)operator(<)pre_type(double)operator(>&) ident(arr)operator(\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// Load vectors from built-in arrays, or use Boost 'assign' library) - directive(const) pre_type(double) ident(nums)operator([]) operator(=) operator({)float(1)float(.4)operator(,) float(3)float(.5)operator(,) float(6)float(.7)operator(};) - directive(const) ident(size_t) ident(arrsize) operator(=) reserved(sizeof)operator(()ident(nums)operator(\)) operator(/) reserved(sizeof)operator(()ident(nums)operator([)integer(0)operator(]\);) - - comment(// Conversion effected at vector creation time) - ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(ints) operator(=) ident(int_all)operator(()ident(nums)operator(,) ident(arrsize)operator(\);) - - comment(// Vector -> vector copy / conversion ) - ident(ints) operator(=) ident(int_all)operator(()ident(std)operator(::)ident(vector)operator(<)pre_type(double)operator(>()ident(nums)operator(,) ident(nums) operator(+) ident(arrsize)operator(\)\);) -operator(}) - -comment(// ----) - -ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(int_all)operator(()directive(const) pre_type(double) ident(arr)operator([],) ident(size_t) ident(arrsize)operator(\)) -operator({) - reserved(return) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>()ident(arr)operator(,) ident(arr) operator(+) ident(arrsize)operator(\);) -operator(}) - -ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(int_all)operator(()directive(const) ident(std)operator(::)ident(vector)operator(<)pre_type(double)operator(>&) ident(arr)operator(\)) -operator({) - ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(r)operator(;) - ident(r)operator(.)ident(assign)operator(()ident(arr)operator(.)ident(begin)operator((\),) ident(arr)operator(.)ident(end)operator((\)\);) comment(// Type safe element copying ) - reserved(return) ident(r)operator(;) -operator(}) - -comment(// ----------------------------) - -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#include) include() -preprocessor(#include) include() - -directive(void) ident(trunc_em)operator(()ident(std)operator(::)ident(vector)operator(<)pre_type(double)operator(>&) ident(arr)operator(\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// Load vectors from built-in arrays, or use Boost 'assign' library) - directive(const) pre_type(double) ident(nums)operator([]) operator(=) operator({)float(1)float(.4)operator(,) float(3)float(.5)operator(,) float(6)float(.7)operator(};) - directive(const) ident(size_t) ident(arrsize) operator(=) reserved(sizeof)operator(()ident(nums)operator(\)) operator(/) reserved(sizeof)operator(()ident(nums)operator([)integer(0)operator(]\);) - - ident(std)operator(::)ident(vector)operator(<)pre_type(double)operator(>) ident(numsv)operator(()ident(nums)operator(,) ident(nums) operator(+) ident(arrsize)operator(\);) - - ident(trunc_em)operator(()ident(numsv)operator(\);) -operator(}) - -comment(// ----) - -directive(void) ident(trunc_em)operator(()ident(std)operator(::)ident(vector)operator(<)pre_type(double)operator(>&) ident(arr)operator(\)) -operator({) - comment(// Replace each element with the value returned by applying 'floor' to that element) - ident(std)operator(::)ident(transform)operator(()ident(arr)operator(.)ident(begin)operator((\),) ident(arr)operator(.)ident(end)operator((\),) ident(arr)operator(.)ident(begin)operator((\),) ident(floor)operator(\);) -operator(}) - -comment(// @@PLEAC@@_10.2) -comment(// Variables declared within a function body are local to that function, and those declared) -comment(// outside a function body [and not as part of a class / struct definition, or enclosed within) -comment(// a namespace] are global, that is, are visible throughout the executable unless their) -comment(// visibility has been restricted to the source file in which they are defined via enclosing) -comment(// them within an anonymous namespace [which has the same effect as using the 'static' keyword,) -comment(// in this same context, in the C language]) - -preprocessor(#include) include() - -directive(void) ident(somefunc)operator((\)) -operator({) - comment(// All these variables are local to this function) - pre_type(int) ident(variable)operator(,) ident(another)operator(;) - - ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(vec)operator(()integer(5)operator(\);) - - operator(;) comment(// ...) -operator(}) - -comment(// ----------------------------) - -comment(// A couple of generic, type-safe type conversion helpers. The Boost Library sports a conversion) -comment(// library at: http://www.boost.org/libs/conversion/index.html) - -preprocessor(#include) include() -preprocessor(#include) include() - -reserved(class) class(bad_conversion) operator({};) - -reserved(template)operator(<)reserved(typename) ident(T)operator(>) ident(T) ident(fromString)operator(()directive(const) ident(std)operator(::)pre_type(string)operator(&) ident(s)operator(\)) -operator({) - ident(std)operator(::)ident(istringstream) ident(iss)operator(()ident(s)operator(\);) - ident(T) ident(t)operator(;) ident(iss) operator(>>) ident(t)operator(;) - reserved(if) operator((!)ident(iss)operator(\)) reserved(throw) ident(bad_conversion)operator((\);) - reserved(return) ident(t)operator(;) -operator(}) - -reserved(template)operator(<)reserved(typename) ident(T)operator(>) ident(std)operator(::)pre_type(string) ident(toString)operator(()directive(const) ident(T)operator(&) ident(t)operator(\)) -operator({) - ident(std)operator(::)ident(ostringstream) ident(oss)operator(;) - ident(oss) operator(<<) ident(t) operator(<<) ident(std)operator(::)ident(ends)operator(;) - reserved(if) operator((!)ident(oss)operator(\)) reserved(throw) ident(bad_conversion)operator((\);) - reserved(return) ident(std)operator(::)pre_type(string)operator(()ident(oss)operator(.)ident(str)operator((\)\);) -operator(}) - -comment(// ------------) - -preprocessor(#include) include() - -comment(// File scope variables) -reserved(namespace) -operator({) - ident(std)operator(::)pre_type(string) ident(name)operator(;) - pre_type(int) ident(age)operator(,) ident(c)operator(,) ident(condition)operator(;) -operator(}) - -directive(void) ident(run_check)operator((\);) -directive(void) ident(check_x)operator(()pre_type(int) ident(x)operator(\);) - -comment(// ----) - -comment(// An alternative, C++-specific approach, to command-line handling and type conversion) -comment(// may be seen at: http://www.boost.org/libs/conversion/lexical_cast.htm) - -pre_type(int) ident(main)operator(()pre_type(int) ident(argc)operator(,) pre_type(char)operator(*) ident(argv)operator([]\)) -operator({) - ident(name)operator(.)ident(assign)operator(()ident(argv)operator([)integer(1)operator(]\);) - - reserved(try) - operator({) - ident(age) operator(=) ident(fromString)operator(<)pre_type(int)operator(>()ident(argv)operator([)integer(2)operator(]\);) - operator(}) - - reserved(catch) operator(()directive(const) ident(bad_conversion)operator(&) ident(e)operator(\)) - operator({) - operator(;) comment(// ... handle conversion error ...) - operator(}) - - ident(check_x)operator(()ident(age)operator(\);) -operator(}) - -comment(// ------------) - -directive(void) ident(run_check)operator((\)) -operator({) - comment(// Full access to file scope variables) - ident(condition) operator(=) integer(1)operator(;) - comment(// ...) -operator(}) - -directive(void) ident(check_x)operator(()pre_type(int) ident(x)operator(\)) -operator({) - comment(// Full access to file scope variables) - ident(std)operator(::)pre_type(string) ident(y)operator(()stringoperator(\);) - - ident(run_check)operator((\);) - - comment(// 'condition' updated by 'run_check') - reserved(if) operator(()ident(condition)operator(\)) - operator({) - operator(;) comment(// ...) - operator(}) -operator(}) - -comment(// @@PLEAC@@_10.3) -comment(// Standard C++, owing to its C heritage, allows the creation of 'persistent private variables',) -comment(// via use of the 'static' keyword. For more details about this, and illustrative code examples,) -comment(// refer to this same section in PLEAC-C/Posix/GNU. Standard C++-specific methods of perfoming) -comment(// this task involve use of the 'namespace' facility, or creating a class containing 'static') -comment(// members and using access specifiers to restrict access) - -comment(// This example replaces the 'static' keyword with use of an anonymous namespace to force) -comment(// 'variable' to have file scope, and be visible only within the 'mysubs.cpp file. It is) -comment(// therefore both persistant [because it is a global variable] and private [because it is) -comment(// visible only to functions defined within the same source file]) - -comment(// File: 'mysubs.h') -directive(void) ident(mysub)operator(()directive(void)operator(\);) -directive(void) ident(reset)operator(()directive(void)operator(\);) - -comment(// ----) - -comment(// File: 'mysubs.cpp') -reserved(namespace) -operator({) - pre_type(int) ident(variable) operator(=) integer(1)operator(;) -operator(}) - -directive(void) ident(mysub)operator(()directive(void)operator(\)) -operator({) - operator(;) comment(// ... do something with 'variable' ...) -operator(}) - -directive(void) ident(reset)operator(()directive(void)operator(\)) operator({) ident(variable) operator(=) integer(1)operator(;) operator(}) - -comment(// ----) - -comment(// File: 'test.cpp') -preprocessor(#include) include("mysubs.h") - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// 'variable' is not accessable here) - - comment(// Call 'mysub', which can access 'variable') - ident(mysub)operator((\);) - - comment(// Call 'reset' which sets 'variable' to 1 ) - ident(reset)operator((\);) -operator(}) - -comment(// ------------) - -comment(// This example is similar to the previous one in using an anonymous namespace to restrict) -comment(// variable visibility. It goes further, hoewever, grouping logically related items within) -comment(// a named namespace, thus ensuring access to those items is controlled [i.e. requires) -comment(// qualification, or a 'using' declaration or directive]) - -comment(// File: 'counter.h') -reserved(namespace) ident(cnt) -operator({) - pre_type(int) ident(increment)operator((\);) - pre_type(int) ident(decrement)operator((\);) -operator(}) - -comment(// ----) - -comment(// File: 'counter.cpp') -reserved(namespace) ident(cnt) -operator({) - comment(// Ensures 'counter' is visible only within the current source file) - reserved(namespace) operator({) pre_type(int) ident(counter) operator(=) integer(0)operator(;) operator(}) - - directive(void) ident(reset)operator(()pre_type(int) ident(v) operator(=) integer(0)operator(\)) operator({) ident(counter) operator(=) ident(v)operator(;) operator(}) - - pre_type(int) ident(increment)operator((\)) operator({) reserved(return) operator(++)ident(counter)operator(;) operator(}) - pre_type(int) ident(decrement)operator((\)) operator({) reserved(return) operator(--)ident(counter)operator(;) operator(}) -operator(}) - -comment(// ----) - -comment(// File: 'test.cpp') -preprocessor(#include) include() -preprocessor(#include) include("counter.h") - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// Following line is illegal because 'cnt::counter' is private to the 'counter.cpp' file) - comment(// int c = cnt::counter;) - - pre_type(int) ident(a) operator(=) ident(cnt)operator(::)ident(increment)operator((\);) - ident(std)operator(::)ident(cout) operator(<<) ident(a) operator(<<) ident(std)operator(::)ident(endl)operator(;) - - ident(a) operator(=) ident(cnt)operator(::)ident(decrement)operator((\);) - ident(std)operator(::)ident(cout) operator(<<) ident(a) operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// ------------) - -comment(// This example sees a class containing 'static' members and using access specifiers to) -comment(// restrict access to those members. Since all the members are static, this class is not) -comment(// meant to be instantiated [i.e. objects created from it - it can be done, but they would) -comment(// all be the exact same object :\)], but merely uses the 'class' facility to encapsulate) -comment(// [i.e. group together] and allow selective access [i.e. hide some parts, allow access to) -comment(// others]. For Design Pattern afficiandos, this is a crude example of the Singleton Pattern) - -comment(// File: 'counter.h') -reserved(class) class(Counter) -operator({) -directive(public)operator(:) - directive(static) pre_type(int) ident(increment)operator((\);) - directive(static) pre_type(int) ident(decrement)operator((\);) -directive(private)operator(:) - directive(static) pre_type(int) ident(counter)operator(;) -operator(};) - -comment(// ----) - -comment(// File: 'counter.cpp') -preprocessor(#include) include("counter.h") - -pre_type(int) ident(Counter)operator(::)ident(increment)operator((\)) operator({) reserved(return) operator(++)ident(counter)operator(;) operator(}) -pre_type(int) ident(Counter)operator(::)ident(decrement)operator((\)) operator({) reserved(return) operator(--)ident(counter)operator(;) operator(}) - -pre_type(int) ident(Counter)operator(::)ident(counter) operator(=) integer(0)operator(;) - -comment(// ----) - -comment(// File: 'test.cpp') -preprocessor(#include) include() -preprocessor(#include) include("counter.h") - -pre_type(int) ident(main)operator((\)) -operator({) - pre_type(int) ident(a) operator(=) ident(Counter)operator(::)ident(increment)operator((\);) - ident(std)operator(::)ident(cout) operator(<<) ident(a) operator(<<) ident(std)operator(::)ident(endl)operator(;) - - ident(a) operator(=) ident(Counter)operator(::)ident(decrement)operator((\);) - ident(std)operator(::)ident(cout) operator(<<) ident(a) operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// @@PLEAC@@_10.4) -comment(// Standard C++ offers no facility for performing adhoc, runtime stack inspection; therefore,) -comment(// information such as the currently-executing function name, cannot be obtained. Now, this) -comment(// isn't to say that such facilities don't exist [since, after all, a symbolic debugger works) -comment(// by doing just this - stack inspection, among other things], but that such features are, for) -comment(// native code compiled languages like C++, 'extra-language' and development tool-specific) - -comment(// @@PLEAC@@_10.5) -comment(// Standard C++ supports both) -comment(// * 'pass-by-value': a copy of an argument is passed when calling a function; in this way) -comment(// the original is safe from modification, but a copying overhead is incurred which may) -comment(// adversely affect performance) -comment(// * 'pass-by-reference': the address of an argument is passed when calling a function;) -comment(// allows the original to be modified, and incurrs no performance penalty from copying) -comment(//) -comment(// The 'pass-by-value' mechanism works in the same way as in the Standard C language [see) -comment(// corresponding section in PLEAC-C/Posix/GNU]. The 'pass-by-reference' mechanism provides) -comment(// the same functionality as passing a pointer-to-a-pointer-to-an-argument, but without the) -comment(// complications arising from having to correctly dereference. Using a reference to a non-const) -comment(// item allows:) -comment(// * The item's state to be modified i.e. if an object was passed, it can be mutated [effect) -comment(// can be mimiced by passing a pointer to the item]) -comment(// * The item, itself, can be replaced with a new item i.e. the memory location to which the) -comment(// reference refers is updated [effect can be mimiced by passing a pointer-to-a-pointer to) -comment(// the item]) - -preprocessor(#include) include() -preprocessor(#include) include() - -comment(// 'pass-by-value': a copy of each vector is passed as an argument) -comment(// void array_diff(const std::vector arr1, const std::vector arr2\);) - -comment(// 'pass-by-reference': the address of each vector is passed as an argument. Some variants:) -comment(// * Disallow both vector replacement and alteration of its contents) -comment(// void array_diff(const std::vector& arr1, const std::vector& arr2\);) -comment(// * Disallow vector replacement only) -comment(// void array_diff(const std::vector& arr1, const std::vector& arr2\);) -comment(// * Disallow alteration of vector contents only) -comment(// void array_diff(std::vector& arr1, std::vector& arr2\);) -comment(// * Allow replacement / alteration) -comment(// void array_diff(std::vector& arr1, std::vector& arr2\);) - -directive(void) ident(array_diff)operator(()directive(const) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>&) ident(arr1)operator(,) directive(const) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>&) ident(arr2)operator(\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// Load vectors from built-in arrays, or use Boost 'assign' library) - directive(const) pre_type(int) ident(arr1)operator([]) operator(=) operator({)integer(1)operator(,) integer(2)operator(,) integer(3)operator(},) ident(arr2)operator([]) operator(=) operator({)integer(4)operator(,) integer(5)operator(,) integer(6)operator(};) - directive(const) ident(size_t) ident(arrsize) operator(=) integer(3)operator(;) - - comment(// Function call is the same whether 'array_diff' is declared to be 'pass-by-value') - comment(// or 'pass-by-reference') - ident(array_diff)operator(()ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>()ident(arr1)operator(,) ident(arr1) operator(+) ident(arrsize)operator(\),) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>()ident(arr2)operator(,) ident(arr2) operator(+) ident(arrsize)operator(\)\);) -operator(}) - -comment(// ----) - -comment(// void array_diff(const std::vector arr1, const std::vector arr2\)) -comment(// {) -comment(// ; // 'arr1' and 'arr2' are copies of the originals) -comment(// }) - -directive(void) ident(array_diff)operator(()directive(const) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>&) ident(arr1)operator(,) directive(const) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>&) ident(arr2)operator(\)) -operator({) - operator(;) comment(// 'arr1' and 'arr2' are references to the originals) -operator(}) - -comment(// ----------------------------) - -preprocessor(#include) include() - -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(add_vecpair)operator(()directive(const) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>&) ident(arr1)operator(,) directive(const) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>&) ident(arr2)operator(\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// Load vectors from built-in arrays, or use Boost 'assign' library) - directive(const) pre_type(int) ident(aa)operator([]) operator(=) operator({)integer(1)operator(,) integer(2)operator(},) ident(ba)operator([]) operator(=) operator({)integer(5)operator(,) integer(8)operator(};) - ident(size_t) ident(arrsize) operator(=) integer(2)operator(;) - - directive(const) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(a)operator(()ident(aa)operator(,) ident(aa) operator(+) ident(arrsize)operator(\),) ident(b)operator(()ident(ba)operator(,) ident(ba) operator(+) ident(arrsize)operator(\);) - - ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(c) operator(=) ident(add_vecpair)operator(()ident(a)operator(,) ident(b)operator(\);) -operator(}) - -comment(// ----) - -ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(add_vecpair)operator(()directive(const) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>&) ident(arr1)operator(,) directive(const) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>&) ident(arr2)operator(\)) -operator({) - ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(retvec)operator(;) ident(retvec)operator(.)ident(reserve)operator(()ident(arr1)operator(.)ident(size)operator((\)\);) - ident(std)operator(::)ident(transform)operator(()ident(arr1)operator(.)ident(begin)operator((\),) ident(arr1)operator(.)ident(end)operator((\),) ident(arr2)operator(.)ident(begin)operator((\),) ident(back_inserter)operator(()ident(retvec)operator(\),) ident(std)operator(::)ident(plus)operator(<)pre_type(int)operator(>(\)\);) - reserved(return) ident(retvec)operator(;) -operator(}) - -comment(// @@PLEAC@@_10.6) -comment(// Please refer to the corresponding section in PLEAC-C/Posix/GNU since the points raised there) -comment(// apply to C++ also. Examples here don't so much illustrate C++'s handling of 'return context') -comment(// as much as how disparate types might be handled in a reasonably uniform manner) - -comment(// Here, 'mysub' is implemented as a function template, and its return type varies with the) -comment(// argument type. In most cases the compiler is able to infer the return type from the ) -comment(// argument, however, it is possible to pass the type as a template parameter. Note this) -comment(// code operates at compile-time, as does any template-only code) - -preprocessor(#include) include() - -preprocessor(#include) include() -preprocessor(#include) include() - -reserved(template) operator(<)reserved(typename) ident(T)operator(>) ident(T) ident(mysub)operator(()directive(const) ident(T)operator(&) ident(t)operator(\)) operator({) reserved(return) ident(t)operator(;) operator(}) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// 1. Type information inferred by compiler) - pre_type(int) ident(i) operator(=) ident(mysub)operator(()integer(5)operator(\);) - - pre_type(double) ident(d) operator(=) ident(mysub)operator(()float(7)float(.6)operator(\);) - - directive(const) pre_type(int) ident(arr)operator([]) operator(=) operator({)integer(1)operator(,) integer(2)operator(,) integer(3)operator(};) - directive(const) ident(size_t) ident(arrsize) operator(=) reserved(sizeof)operator(()ident(arr)operator(\)) operator(/) reserved(sizeof)operator(()ident(arr)operator([)integer(0)operator(]\);) - - ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(v) operator(=) ident(mysub)operator(()ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>()ident(arr)operator(,) ident(arr) operator(+) ident(arrsize)operator(\)\);) - - comment(// 2. Type information provided by user) - comment(// Pass a 'const char*' argument and specify type information in the call) - ident(std)operator(::)pre_type(string) ident(s) operator(=) ident(mysub)operator(<)ident(std)operator(::)pre_type(string)operator(>()stringoperator(\);) - - comment(// Could avoid specifying type information by passing a 'std::string' argument ) - comment(// std::string s = mysub(std::string("xyz"\)\);) -operator(}) - -comment(// ----------------------------) - -comment(// This is a variant on the previous example that uses the Boost Library's 'any' type as a) -comment(// generic 'stub' type) - -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#include) include() - -reserved(template) operator(<)reserved(typename) ident(T)operator(>) ident(boost)operator(::)ident(any) ident(mysub)operator(()directive(const) ident(T)operator(&) ident(t)operator(\)) operator({) reserved(return) ident(boost)operator(::)ident(any)operator(()ident(t)operator(\);) operator(}) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - ident(std)operator(::)ident(vector)operator(<)ident(boost)operator(::)ident(any)operator(>) ident(any)operator(;) - - comment(// Add various types [encapsulated in 'any' objects] to the container) - ident(any)operator(.)ident(push_back)operator(()ident(mysub)operator(()integer(5)operator(\)\);) - ident(any)operator(.)ident(push_back)operator(()ident(mysub)operator(()float(7)float(.6)operator(\)\);) - ident(any)operator(.)ident(push_back)operator(()ident(mysub)operator(()ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>()integer(5)operator(,) integer(5)operator(\)\)\);) - ident(any)operator(.)ident(push_back)operator(()ident(mysub)operator(()ident(std)operator(::)pre_type(string)operator(()stringoperator(\)\)\);) - - comment(// Extract the various types from the container by appropriately casting the relevant) - comment(// 'any' object) - pre_type(int) ident(i) operator(=) ident(boost)operator(::)ident(any_cast)operator(<)pre_type(int)operator(>()ident(any)operator([)integer(0)operator(]\);) - pre_type(double) ident(d) operator(=) ident(boost)operator(::)ident(any_cast)operator(<)pre_type(double)operator(>()ident(any)operator([)integer(1)operator(]\);) - ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(v) operator(=) ident(boost)operator(::)ident(any_cast)operator(<) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) operator(>()ident(any)operator([)integer(2)operator(]\);) - ident(std)operator(::)pre_type(string) ident(s) operator(=) ident(boost)operator(::)ident(any_cast)operator(<)ident(std)operator(::)pre_type(string)operator(>()ident(any)operator([)integer(3)operator(]\);) -operator(}) - -comment(// @@PLEAC@@_10.7) -comment(// Just like the C language, C++ offers no support for named / keyword parameters. It is of) -comment(// course possible to mimic such functionality the same way it is done in C [see corresponding) -comment(// section in PLEAC-C/Posix/GNU], the most obvious means being by passing a set of key/value) -comment(// pairs in a std::map. This will not be shown here. Instead, two quite C++-specific examples) -comment(// will be provided, based on:) -comment(//) -comment(// * Named Parameter Idiom [see: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18]) -comment(// * Boost 'parameter' Library [see: http://www.boost.org/libs/parameter/doc/html/index.html]) - -preprocessor(#include) include() -preprocessor(#include) include() - -reserved(class) class(TimeEntry) -operator({) -directive(public)operator(:) - directive(explicit) ident(TimeEntry)operator(()pre_type(int) ident(value) operator(=) integer(0)operator(,) pre_type(char) ident(dim) operator(=) char('s')operator(\);) - - pre_type(bool) directive(operator)operator(<()directive(const) ident(TimeEntry)operator(&) ident(right)operator(\)) directive(const)operator(;) - - directive(friend) ident(std)operator(::)ident(ostream)operator(&) directive(operator)operator(<<()ident(std)operator(::)ident(ostream)operator(&) ident(out)operator(,) directive(const) ident(TimeEntry)operator(&) ident(t)operator(\);) - -directive(private)operator(:) - pre_type(int) ident(value_)operator(;) - pre_type(char) ident(dim_)operator(;) -operator(};) - -reserved(typedef) ident(std)operator(::)ident(pair)operator(<)directive(const) pre_type(int)operator(,) ident(TimeEntry)operator(>) ident(TENTRY)operator(;) -reserved(typedef) ident(std)operator(::)ident(map)operator(<)directive(const) pre_type(int)operator(,) ident(TimeEntry)operator(>) ident(TIMETBL)operator(;) - -reserved(class) class(RaceTime) -operator({) -directive(public)operator(:) - directive(const) directive(static) pre_type(int) ident(START_TIME)operator(,) ident(FINISH_TIME)operator(,) ident(INCR_TIME)operator(;) - -directive(public)operator(:) - directive(explicit) ident(RaceTime)operator((\);) - - ident(RaceTime)operator(&) ident(start_time)operator(()directive(const) ident(TimeEntry)operator(&) ident(time)operator(\);) - ident(RaceTime)operator(&) ident(finish_time)operator(()directive(const) ident(TimeEntry)operator(&) ident(time)operator(\);) - ident(RaceTime)operator(&) ident(incr_time)operator(()directive(const) ident(TimeEntry)operator(&) ident(time)operator(\);) - - directive(friend) ident(std)operator(::)ident(ostream)operator(&) directive(operator)operator(<<()ident(std)operator(::)ident(ostream)operator(&) ident(out)operator(,) directive(const) ident(RaceTime)operator(&) ident(r)operator(\);) - -directive(private)operator(:) - ident(TIMETBL) ident(timetbl_)operator(;) -operator(};) - -directive(const) pre_type(int) ident(RaceTime)operator(::)ident(START_TIME) operator(=) integer(0)operator(,) ident(RaceTime)operator(::)ident(FINISH_TIME) operator(=) integer(1)operator(,) ident(RaceTime)operator(::)ident(INCR_TIME) operator(=) integer(2)operator(;) - -directive(void) ident(the_func)operator(()directive(const) ident(RaceTime)operator(&) ident(r)operator(\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - ident(the_func)operator(()ident(RaceTime)operator((\))operator(.)ident(start_time)operator(()ident(TimeEntry)operator(()integer(20)operator(,) char('s')operator(\)\))operator(.)ident(finish_time)operator(()ident(TimeEntry)operator(()integer(5)operator(,) char('m')operator(\)\))operator(.)ident(incr_time)operator(()ident(TimeEntry)operator(()integer(5)operator(,) char('s')operator(\)\)\);) - - ident(the_func)operator(()ident(RaceTime)operator((\))operator(.)ident(start_time)operator(()ident(TimeEntry)operator(()integer(5)operator(,) char('m')operator(\)\))operator(.)ident(finish_time)operator(()ident(TimeEntry)operator(()integer(30)operator(,) char('m')operator(\)\)\);) - - ident(the_func)operator(()ident(RaceTime)operator((\))operator(.)ident(start_time)operator(()ident(TimeEntry)operator(()integer(30)operator(,) char('m')operator(\)\)\);) -operator(}) - -comment(// ----) - -ident(std)operator(::)ident(ostream)operator(&) directive(operator)operator(<<()ident(std)operator(::)ident(ostream)operator(&) ident(out)operator(,) directive(const) ident(TimeEntry)operator(&) ident(t)operator(\)) -operator({) - ident(out) operator(<<) ident(t)operator(.)ident(value_) operator(<<) ident(t)operator(.)ident(dim_)operator(;) reserved(return) ident(out)operator(;) -operator(}) - -ident(std)operator(::)ident(ostream)operator(&) directive(operator)operator(<<()ident(std)operator(::)ident(ostream)operator(&) ident(out)operator(,) directive(const) ident(RaceTime)operator(&) ident(r)operator(\)) -operator({) - ident(RaceTime)operator(&) ident(r_) operator(=) reserved(const_cast)operator(<)ident(RaceTime)operator(&>()ident(r)operator(\);) - - ident(out) operator(<<) string operator(<<) ident(r_)operator(.)ident(timetbl_)operator([)ident(RaceTime)operator(::)ident(START_TIME)operator(]) - operator(<<) string operator(<<) ident(r_)operator(.)ident(timetbl_)operator([)ident(RaceTime)operator(::)ident(FINISH_TIME)operator(]) - operator(<<) string operator(<<) ident(r_)operator(.)ident(timetbl_)operator([)ident(RaceTime)operator(::)ident(INCR_TIME)operator(];) - - reserved(return) ident(out)operator(;) -operator(}) - -ident(TimeEntry)operator(::)ident(TimeEntry)operator(()pre_type(int) ident(value)operator(,) pre_type(char) ident(dim)operator(\)) operator(:) ident(value_)operator(()ident(value)operator(\),) ident(dim_)operator(()ident(dim)operator(\)) operator({}) - -pre_type(bool) ident(TimeEntry)operator(::)directive(operator)operator(<()directive(const) ident(TimeEntry)operator(&) ident(right)operator(\)) directive(const) -operator({) - reserved(return) operator(()ident(dim_) operator(==) ident(right)operator(.)ident(dim_)operator(\)) operator(?) operator(()ident(value_) operator(<) ident(right)operator(.)ident(value_)operator(\)) operator(:) operator(!()ident(dim_) operator(<) ident(right)operator(.)ident(dim_)operator(\);) -operator(}) - -ident(RaceTime)operator(::)ident(RaceTime)operator((\)) -operator({) - ident(timetbl_)operator(.)ident(insert)operator(()ident(TENTRY)operator(()ident(START_TIME)operator(,) ident(TimeEntry)operator(()integer(0)operator(,) char('s')operator(\)\)\);) - ident(timetbl_)operator(.)ident(insert)operator(()ident(TENTRY)operator(()ident(FINISH_TIME)operator(,) ident(TimeEntry)operator(()integer(0)operator(,) char('s')operator(\)\)\);) - ident(timetbl_)operator(.)ident(insert)operator(()ident(TENTRY)operator(()ident(INCR_TIME)operator(,) ident(TimeEntry)operator(()integer(0)operator(,) char('s')operator(\)\)\);) -operator(}) - -ident(RaceTime)operator(&) ident(RaceTime)operator(::)ident(start_time)operator(()directive(const) ident(TimeEntry)operator(&) ident(time)operator(\)) -operator({) - ident(timetbl_)operator([)ident(START_TIME)operator(]) operator(=) ident(time)operator(;) reserved(return) operator(*)local_variable(this)operator(;) -operator(}) - -ident(RaceTime)operator(&) ident(RaceTime)operator(::)ident(finish_time)operator(()directive(const) ident(TimeEntry)operator(&) ident(time)operator(\)) -operator({) - ident(timetbl_)operator([)ident(FINISH_TIME)operator(]) operator(=) ident(time)operator(;) reserved(return) operator(*)local_variable(this)operator(;) -operator(}) - -ident(RaceTime)operator(&) ident(RaceTime)operator(::)ident(incr_time)operator(()directive(const) ident(TimeEntry)operator(&) ident(time)operator(\)) -operator({) - ident(timetbl_)operator([)ident(INCR_TIME)operator(]) operator(=) ident(time)operator(;) reserved(return) operator(*)local_variable(this)operator(;) -operator(}) - -directive(void) ident(the_func)operator(()directive(const) ident(RaceTime)operator(&) ident(r)operator(\)) -operator({) - ident(std)operator(::)ident(cout) operator(<<) ident(r) operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// ----------------------------) - -comment(// The Boost 'parameter' library requires a significant amount of setup code to be written,) -comment(// much more than this section warrants. My recommendation is to read carefully through the) -comment(// tutorial to determine whether a problem for which it is being considered justifies all) -comment(// the setup.) - -comment(// @@PLEAC@@_10.8) -comment(// The Boost 'tuple' Library also allows multiple assignment to variables, including the) -comment(// selective skipping of return values) - -preprocessor(#include) include() - -preprocessor(#include) include() - -reserved(typedef) ident(boost)operator(::)ident(tuple)operator(<)pre_type(int)operator(,) pre_type(int)operator(,) pre_type(int)operator(>) ident(T3)operator(;) - -ident(T3) ident(func)operator((\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - pre_type(int) ident(a) operator(=) integer(6)operator(,) ident(b) operator(=) integer(7)operator(,) ident(c) operator(=) integer(8)operator(;) - ident(std)operator(::)ident(cout) operator(<<) ident(a) operator(<<) char(',') operator(<<) ident(b) operator(<<) char(',') operator(<<) ident(c) operator(<<) ident(std)operator(::)ident(endl)operator(;) - - comment(// A tuple of references to the referred variables is created; the values) - comment(// captured from the returned tuple are thus multiply-assigned to them) - ident(boost)operator(::)ident(tie)operator(()ident(a)operator(,) ident(b)operator(,) ident(c)operator(\)) operator(=) ident(func)operator((\);) - ident(std)operator(::)ident(cout) operator(<<) ident(a) operator(<<) char(',') operator(<<) ident(b) operator(<<) char(',') operator(<<) ident(c) operator(<<) ident(std)operator(::)ident(endl)operator(;) - - comment(// Variables can still be individually referenced) - ident(a) operator(=) integer(11)operator(;) ident(b) operator(=) integer(23)operator(;) ident(c) operator(=) integer(56)operator(;) - ident(std)operator(::)ident(cout) operator(<<) ident(a) operator(<<) char(',') operator(<<) ident(b) operator(<<) char(',') operator(<<) ident(c) operator(<<) ident(std)operator(::)ident(endl)operator(;) - - comment(// Return values may be ignored; affected variables retain existing values) - ident(boost)operator(::)ident(tie)operator(()ident(a)operator(,) ident(boost)operator(::)ident(tuples)operator(::)ident(ignore)operator(,) ident(c)operator(\)) operator(=) ident(func)operator((\);) - ident(std)operator(::)ident(cout) operator(<<) ident(a) operator(<<) char(',') operator(<<) ident(b) operator(<<) char(',') operator(<<) ident(c) operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// ----) - -ident(T3) ident(func)operator((\)) operator({) reserved(return) ident(T3)operator(()integer(3)operator(,) integer(6)operator(,) integer(9)operator(\);) operator(}) - -comment(// @@PLEAC@@_10.9) -comment(// Like Standard C, C++ allows only the return of a single value. The return of multiple values) -comment(// *can*, however, be simulated by packaging them within an aggregate type [as in C], or a) -comment(// custom class, or one of the STL containers like std::vector. Probably the most robust, and) -comment(// [pseudo]-standardised, approach is to use the Boost 'tuple' Library, as will be done in this) -comment(// section. Notes:) -comment(// * Use made of Boost 'assign' Library to simplify container loading; this is a *very* handy) -comment(// library) -comment(// * Use made of Boost 'any' Library to make containers heterogenous; 'variant' Library is) -comment(// similar, and is more appropriate where type-safe container traversal is envisaged e.g.) -comment(// for printing ) - -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#include) include() -preprocessor(#include) include() - -reserved(typedef) ident(std)operator(::)ident(vector)operator(<)ident(boost)operator(::)ident(any)operator(>) ident(ARRAY)operator(;) -reserved(typedef) ident(std)operator(::)ident(map)operator(<)ident(std)operator(::)pre_type(string)operator(,) ident(boost)operator(::)ident(any)operator(>) ident(HASH)operator(;) -reserved(typedef) ident(boost)operator(::)ident(tuple)operator(<)ident(ARRAY)operator(,) ident(HASH)operator(>) ident(ARRAY_HASH)operator(;) - -ident(ARRAY_HASH) ident(some_func)operator(()directive(const) ident(ARRAY)operator(&) ident(array)operator(,) directive(const) ident(HASH)operator(&) ident(hash)operator(\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// Load containers using Boost 'assign' Library ) - directive(using) reserved(namespace) ident(boost)operator(::)ident(assign)operator(;) - ident(ARRAY) ident(array)operator(;) ident(array) operator(+=) integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(;) - ident(HASH) ident(hash)operator(;) ident(insert)operator(()ident(hash)operator(\)) operator(()stringoperator(,) integer(1)operator(\)) operator(()stringoperator(,) integer(2)operator(\)) operator(()stringoperator(,) integer(3)operator(\);) - - comment(// Pass arguments to 'somefunc' and retrieve them as members of a tuple) - ident(ARRAY_HASH) ident(refs) operator(=) ident(some_func)operator(()ident(array)operator(,) ident(hash)operator(\);) - - comment(// Retrieve copy of 'array' from tuple) - ident(ARRAY) ident(ret_array) operator(=) ident(boost)operator(::)ident(get)operator(<)integer(0)operator(>()ident(refs)operator(\);) - - comment(// Retrieve copy of 'hash' from tuple) - ident(HASH) ident(ret_hash) operator(=) ident(boost)operator(::)ident(get)operator(<)integer(1)operator(>()ident(refs)operator(\);) -operator(}) - -comment(// ----) - -ident(ARRAY_HASH) ident(some_func)operator(()directive(const) ident(ARRAY)operator(&) ident(array)operator(,) directive(const) ident(HASH)operator(&) ident(hash)operator(\)) -operator({) - operator(;) comment(// ... do something with 'array' and 'hash') - - reserved(return) ident(ARRAY_HASH)operator(()ident(array)operator(,) ident(hash)operator(\);) -operator(}) - -comment(// @@PLEAC@@_10.10) -comment(// Like function calls in Standard C, function calls in C++ need to conform to signature) -comment(// requirements; a function call must match its declaration with the same number, and type,) -comment(// of arguments passed [includes implicitly-passed default arguments], and the same return) -comment(// value type. Thus, unlike Perl, a function declared to return a value *must* do so, thus) -comment(// cannot 'return nothing' to indicate failure. ) -comment(// Whilst in Standard C certain conventions like returning NULL pointers, or returning -1, to) -comment(// indicate the 'failure' of a task [i.e. function return codes are checked, and control) -comment(// proceeds conditionally] are used, Standard C++ sports facilities which lessen the need for) -comment(// dong the same. Specifically, C++ offers:) -comment(// * Built-in exception handling which can be used to detect [and perhaps recover from],) -comment(// all manner of unusual, or erroneous / problematic situations. One recommended use is) -comment(// to avoid writing code that performs a lot of return code checking) -comment(// * Native OOP support allows use of the Null Object Design Pattern. Put simply, rather than) -comment(// than checking return codes then deciding on an action, an object with some predefined) -comment(// default behaviour is returned / used where an unusual / erroneous / problematic situation) -comment(// is encountered. This approach could be as simple as having some sort of default base) -comment(// class member function behaviour, or as complex as having a diagnostic-laden object created) -comment(// * Functions can still return 'error-indicating entities', but rather than primitive types) -comment(// like 'int's or NULL pointers, complex objects can be returned. For example, the Boost) -comment(// Library sports a number of such types:) -comment(// - 'tuple') -comment(// - 'any', 'variant' and 'optional') -comment(// - 'tribool' [true, false, indeterminate]) - -comment(// Exception Handling Example) - -reserved(class) class(XYZ_exception) operator({};) - -pre_type(int) ident(func)operator((\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - pre_type(int) ident(valid_value) operator(=) integer(0)operator(;) - - reserved(try) - operator({) - operator(;) comment(// ...) - - ident(valid_value) operator(=) ident(func)operator((\);) - - operator(;) comment(// ...) - operator(}) - - reserved(catch)operator(()directive(const) ident(XYZ_exception)operator(&) ident(e)operator(\)) - operator({) - operator(;) comment(// ...) - operator(}) -operator(}) - -comment(// ----) - -pre_type(int) ident(func)operator((\)) -operator({) - pre_type(bool) ident(error_detected) operator(=) pre_constant(false)operator(;) - pre_type(int) ident(valid_value)operator(;) - - operator(;) comment(// ...) - - reserved(if) operator(()ident(error_detected)operator(\)) reserved(throw) ident(XYZ_exception)operator((\);) - - operator(;) comment(// ...) - - reserved(return) ident(valid_value)operator(;) -operator(}) - -comment(// ------------) - -comment(// Null Object Design Pattern Example) - -preprocessor(#include) include() - -reserved(class) class(Value) -operator({) -directive(public)operator(:) - directive(virtual) directive(void) ident(do_something)operator((\)) operator(=) integer(0)operator(;) -operator(};) - -reserved(class) class(NullValue) operator(:) directive(public) ident(Value) -operator({) -directive(public)operator(:) - directive(virtual) directive(void) ident(do_something)operator((\);) -operator(};) - -reserved(class) class(ValidValue) operator(:) directive(public) ident(Value) -operator({) -directive(public)operator(:) - directive(virtual) directive(void) ident(do_something)operator((\);) -operator(};) - -ident(Value)operator(*) ident(func)operator((\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// Error checking is performed within 'func'. However, regardless of the outcome, an) - comment(// object of 'Value' type is returned which possesses similar behaviour, though appropriate) - comment(// to whether processing was successful or not. In this way no error checking is needed) - comment(// outside of 'func') - ident(Value)operator(*) ident(v) operator(=) ident(func)operator((\);) - - ident(v)operator(->)ident(do_something)operator((\);) - - reserved(delete) ident(v)operator(;) -operator(}) - -comment(// ----) - -directive(void) ident(NullValue)operator(::)ident(do_something)operator((\)) -operator({) - ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -directive(void) ident(ValidValue)operator(::)ident(do_something)operator((\)) -operator({) - ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -ident(Value)operator(*) ident(func)operator((\)) -operator({) - pre_type(bool) ident(error_detected) operator(=) pre_constant(true)operator(;) - - operator(;) comment(// ...) - - reserved(if) operator(()ident(error_detected)operator(\)) reserved(return) reserved(new) ident(NullValue)operator(;) - - operator(;) comment(// ...) - - reserved(return) reserved(new) ident(ValidValue)operator(;) -operator(}) - -comment(// ----------------------------) - -comment(// The Boost 'optional' library has many uses, but in the current context, one is of particular) -comment(// use: returning a specified type [thus satisfying language requirements], but whose value) -comment(// may be 'set' [if the function succeeded] or 'unset' [if it failed], and this condition very) -comment(// easily checked) - -preprocessor(#include) include() - -preprocessor(#include) include() - -preprocessor(#include) include() -preprocessor(#include) include() -preprocessor(#include) include() - -preprocessor(#include) include() - -reserved(class) class(func_fail) -operator({) -directive(public)operator(:) - directive(explicit) ident(func_fail)operator(()directive(const) ident(std)operator(::)pre_type(string)operator(&) ident(msg)operator(\)) operator(:) ident(msg_)operator(()ident(msg)operator(\)) operator({}) - directive(const) ident(std)operator(::)pre_type(string)operator(&) ident(msg)operator((\)) directive(const) operator({) reserved(return) ident(msg_)operator(;) operator(}) -directive(private)operator(:) - directive(const) ident(std)operator(::)pre_type(string) ident(msg_)operator(;) -operator(};) - -comment(// ----) - -directive(void) ident(die)operator(()directive(const) ident(std)operator(::)pre_type(string)operator(&) ident(msg)operator(\);) - -ident(boost)operator(::)ident(optional)operator(<)pre_type(int)operator(>) ident(sfunc)operator((\);) -ident(boost)operator(::)ident(optional)operator(<) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) operator(>) ident(afunc)operator((\);) -ident(boost)operator(::)ident(optional)operator(<) ident(std)operator(::)ident(map)operator(<)ident(std)operator(::)pre_type(string)operator(,) pre_type(int)operator(>) operator(>) ident(hfunc)operator((\);) - -comment(// ------------) - -pre_type(int) ident(main)operator((\)) -operator({) - reserved(try) - operator({) - ident(boost)operator(::)ident(optional)operator(<)pre_type(int)operator(>) ident(s)operator(;) - ident(boost)operator(::)ident(optional)operator(<) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) operator(>) ident(a)operator(;) - ident(boost)operator(::)ident(optional)operator(<) ident(std)operator(::)ident(map)operator(<)ident(std)operator(::)pre_type(string)operator(,) pre_type(int)operator(>) operator(>) ident(h)operator(;) - - reserved(if) operator((!()ident(s) operator(=) ident(sfunc)operator((\)\)\)) reserved(throw) ident(func_fail)operator(()stringoperator(\);) - reserved(if) operator((!()ident(a) operator(=) ident(afunc)operator((\)\)\)) reserved(throw) ident(func_fail)operator(()stringoperator(\);) - reserved(if) operator((!()ident(h) operator(=) ident(hfunc)operator((\)\)\)) reserved(throw) ident(func_fail)operator(()stringoperator(\);) - - operator(;) comment(// ... do stuff with 's', 'a', and 'h' ...) - pre_type(int) ident(scalar) operator(=) operator(*)ident(s)operator(;) - - operator(;) comment(// ...) - operator(}) - - reserved(catch) operator(()directive(const) ident(func_fail)operator(&) ident(e)operator(\)) - operator({) - ident(die)operator(()ident(e)operator(.)ident(msg)operator((\)\);) - operator(}) - - operator(;) comment(// ... other code executed if no error above ...) -operator(}) - -comment(// ------------) - -directive(void) ident(die)operator(()directive(const) ident(std)operator(::)pre_type(string)operator(&) ident(msg)operator(\)) -operator({) - ident(std)operator(::)ident(cerr) operator(<<) ident(msg) operator(<<) ident(std)operator(::)ident(endl)operator(;) - - comment(// Should only be used if all objects in the originating local scope have been destroyed) - ident(std)operator(::)ident(exit)operator(()ident(EXIT_FAILURE)operator(\);) -operator(}) - -comment(// ----) - -ident(boost)operator(::)ident(optional)operator(<)pre_type(int)operator(>) ident(sfunc)operator((\)) -operator({) - pre_type(bool) ident(error_detected) operator(=) pre_constant(true)operator(;) - - pre_type(int) ident(valid_int_value)operator(;) - - operator(;) comment(// ...) - - reserved(if) operator(()ident(error_detected)operator(\)) reserved(return) ident(boost)operator(::)ident(optional)operator(<)pre_type(int)operator(>(\);) - - operator(;) comment(// ...) - - reserved(return) ident(boost)operator(::)ident(optional)operator(<)pre_type(int)operator(>()ident(valid_int_value)operator(\);) -operator(}) - -ident(boost)operator(::)ident(optional)operator(<) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) operator(>) ident(afunc)operator((\)) -operator({) - comment(// ... code not shown ...) - - reserved(return) ident(boost)operator(::)ident(optional)operator(<) ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) operator(>(\);) - - comment(// ... code not shown) -operator(}) - -ident(boost)operator(::)ident(optional)operator(<) ident(std)operator(::)ident(map)operator(<)ident(std)operator(::)pre_type(string)operator(,) pre_type(int)operator(>) operator(>) ident(hfunc)operator((\)) -operator({) - comment(// ... code not shown ...) - - reserved(return) ident(boost)operator(::)ident(optional)operator(<) ident(std)operator(::)ident(map)operator(<)ident(std)operator(::)pre_type(string)operator(,) pre_type(int)operator(>) operator(>(\);) - - comment(// ... code not shown ...) -operator(}) - -comment(// @@PLEAC@@_10.11) -comment(// Whilst in Perl function prototyping is optional, this is not the case in C++, where it is) -comment(// necessary to:) -comment(// * Declare a function before use; this could either be a function declaration separate from) -comment(// the function definition, or the function definition itself which serves as its own) -comment(// declaration) -comment(// * Specify both parameter positional and type information; parameter names are optional in) -comment(// declarations, mandatory in definitions) -comment(// * Specify return type) - -preprocessor(#include) include() -preprocessor(#include) include() - -comment(// Function Declaration) -ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(myfunc)operator(()pre_type(int) ident(arg1)operator(,) pre_type(int) ident(arg2)operator(\);) comment(// Also possible: std::vector myfunc(int, int\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// Call function with all required arguments; this is the only calling method) - comment(// [except for calling via function pointer which still needs all arguments supplied]) - ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(results) operator(=) ident(myfunc)operator(()integer(3)operator(,) integer(5)operator(\);) - - comment(// Let's look at our return array's contents) - ident(std)operator(::)ident(cout) operator(<<) ident(results)operator([)integer(0)operator(]) operator(<<) char(':') operator(<<) ident(results)operator([)integer(1)operator(]) operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// ----) - -comment(// Function Definition) -ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(myfunc)operator(()pre_type(int) ident(arg1)operator(,) pre_type(int) ident(arg2)operator(\)) -operator({) - ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(r)operator(;) - - ident(std)operator(::)ident(back_inserter)operator(()ident(r)operator(\)) operator(=) ident(arg1)operator(;) - ident(std)operator(::)ident(back_inserter)operator(()ident(r)operator(\)) operator(=) ident(arg2)operator(;) - - reserved(return) ident(r)operator(;) -operator(}) - -comment(// ------------) - -comment(// A version on the above code that is generic, that is, making use of the C++ template) -comment(// mechanism to work with any type) - -preprocessor(#include) include() -preprocessor(#include) include() - -comment(// Function Declaration) -reserved(template) operator(<)reserved(class) class(T)operator(>) ident(std)operator(::)ident(vector)operator(<)ident(T)operator(>) ident(myfunc)operator(()directive(const) ident(T)operator(&) ident(arg1)operator(,) directive(const) ident(T)operator(&) ident(arg2)operator(\);) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - ident(std)operator(::)ident(vector)operator(<)pre_type(int)operator(>) ident(results) operator(=) ident(myfunc)operator(()integer(3)operator(,) integer(5)operator(\);) - - ident(std)operator(::)ident(cout) operator(<<) ident(results)operator([)integer(0)operator(]) operator(<<) char(':') operator(<<) ident(results)operator([)integer(1)operator(]) operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// ----) - -comment(// Function Definition) -reserved(template) operator(<)reserved(class) class(T)operator(>) ident(std)operator(::)ident(vector)operator(<)ident(T)operator(>) ident(myfunc)operator(()directive(const) ident(T)operator(&) ident(arg1)operator(,) directive(const) ident(T)operator(&) ident(arg2)operator(\)) -operator({) - ident(std)operator(::)ident(vector)operator(<)ident(T)operator(>) ident(r)operator(;) - - ident(std)operator(::)ident(back_inserter)operator(()ident(r)operator(\)) operator(=) ident(arg1)operator(;) - ident(std)operator(::)ident(back_inserter)operator(()ident(r)operator(\)) operator(=) ident(arg2)operator(;) - - reserved(return) ident(r)operator(;) -operator(}) - -comment(// ------------) - -comment(// Other Perl examples are omitted since there is no variation in C++ function calling or) -comment(// parameter handling) - -comment(// @@PLEAC@@_10.12) -comment(// One of the key, non-object oriented features of Standard C++ is its built-in support for) -comment(// exceptions / exception handling. The feature is well-integrated into the language, including) -comment(// a set of predefined exception classes included in, and used by, the Standard Library, is) -comment(// quite easy to use, and helps the programmer write robust code provided certain conventions) -comment(// are followed. On the downside, the C++ exception handling system is criticised for imposing) -comment(// significant runtime overhead, as well as increasing executable code size [though this) -comment(// varies considerably between CPU's, OS's, and compilers]. Please refer to the corresponding) -comment(// section in PLEAC-C/Posix/GNU for pertinent reading references.) -comment(//) -comment(// The example code below matches the PLEAC-C/Posix/GNU example rather than the Perl code. Note:) -comment(// * A very minimal, custom exception class is implemented; a more complex class, one richer in) -comment(// diagnostic information, could have been implemented, or perhaps one based on a standard) -comment(// exception class like 'std::exception') -comment(// * Ordinarily error / exception messages are directed to 'std::cerr' or 'std::clog') -comment(// * General recommendation is to throw 'temporaries' [via invoking a constructor],) -comment(// and to 'catch' as const reference(s\)) -comment(// * Proper 'cleanup' is very important; consult a suitable book for guidance on writing) -comment(// 'exception safe' code) - -preprocessor(#include) include() -preprocessor(#include) include() - -reserved(class) class(FullmoonException) -operator({) -directive(public)operator(:) - directive(explicit) ident(FullmoonException)operator(()directive(const) ident(std)operator(::)pre_type(string)operator(&) ident(msg)operator(\)) operator(:) ident(msg_)operator(()ident(msg)operator(\)) operator({}) - - directive(friend) ident(std)operator(::)ident(ostream)operator(&) directive(operator)operator(<<()ident(std)operator(::)ident(ostream)operator(&) ident(out)operator(,) directive(const) ident(FullmoonException)operator(&) ident(e)operator(\)) - operator({) - ident(out) operator(<<) ident(e)operator(.)ident(msg_)operator(;) reserved(return) ident(out)operator(;) - operator(}) -directive(private)operator(:) - directive(const) ident(std)operator(::)pre_type(string) ident(msg_)operator(;) -operator(};) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(std)operator(::)ident(endl)operator(;) - - reserved(try) - operator({) - ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(std)operator(::)ident(endl)operator(;) - ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(std)operator(::)ident(endl)operator(;) - - comment(// if (... error condition detected ...\)) - reserved(throw) ident(FullmoonException)operator(()stringoperator(\);) - - comment(// Control never gets here ...) - ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(std)operator(::)ident(endl)operator(;) - operator(}) - - reserved(catch)operator(()directive(const) ident(FullmoonException)operator(&) ident(e)operator(\)) - operator({) - ident(std)operator(::)ident(cout) operator(<<) string - operator(<<) string operator(<<) ident(e) operator(<<) string - operator(<<) ident(std)operator(::)ident(endl)operator(;) - operator(}) - - reserved(catch)operator(()operator(.)operator(.)operator(.)operator(\)) - operator({) - ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(std)operator(::)ident(endl)operator(;) - operator(}) - - comment(// Control gets here regardless of whether an exception is thrown or not) - ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// @@PLEAC@@_10.13) -comment(// Standard C++ sports a namespace facility which allows an application to be divided into) -comment(// logical sub-systems, each of which operates within its own scope. Put very simply, the same) -comment(// identifiers [i.e. name of types, objects, and functions] may be each used in a namespace) -comment(// without fear of a nameclash occurring when logical sub-systems are variously combined as) -comment(// an application. The name-clash problem is inherent in single-namespace languages like C; it) -comment(// often occurs when several third-party libraries are used [a common occurrence in C], or) -comment(// when an application scales up. The remedy is to rename identifiers, or, in the case of ) -comment(// functions that cannot be renamed, to wrap them up in other functions in a separate source) -comment(// file. Of course the problem may be minimised via strict adherence to naming conventions. ) -comment(//) -comment(// The C++ namespace facility is important, too, because it avoids the need to utilise certain) -comment(// C language practices, in particular:) -comment(// * Use of, possibly, 'clumsy' naming conventions [as described above]) -comment(// * Partition an application by separating logically-related items into separate source) -comment(// files. Namespaces cross file boundaries, so items may reside in several source files) -comment(// and still comprise a single, logical sub-system) -comment(// * Anonymous namespaces avoid use of the 'static' keyword in creating file scope globals) - -comment(// Global variable) -pre_type(int) ident(age) operator(=) integer(18)operator(;) - -comment(// ----) - -directive(void) ident(print_age)operator((\)) -operator({) - comment(// Global value, 'age', is accessed) - ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(age) operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// ------------) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// A local variable named, 'age' will act to 'shadow' the globally) - comment(// defined version, thus any changes to, 'age', will not affect) - comment(// the global version) - pre_type(int) ident(age) operator(=) integer(5)operator(;) - - comment(// Prints 18, the current value of the global version) - ident(print_age)operator((\);) - - comment(// Local version is altered, *not* global version) - ident(age) operator(=) integer(23)operator(;) - - comment(// Prints 18, the current value of the global version) - ident(print_age)operator((\);) -operator(}) - -comment(// ----------------------------) - -comment(// Global variable) -pre_type(int) ident(age) operator(=) integer(18)operator(;) - -comment(// ----) - -directive(void) ident(print_age)operator((\)) -operator({) - comment(// Global value, 'age', is accessed) - ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(age) operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// ------------) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// Here no local version declared: any changes affect global version) - ident(age) operator(=) integer(5)operator(;) - - comment(// Prints 5, the new value of the global version) - ident(print_age)operator((\);) - - comment(// Global version again altered) - ident(age) operator(=) integer(23)operator(;) - - comment(// Prints 23, the new value of the global version) - ident(print_age)operator((\);) -operator(}) - -comment(// ----------------------------) - -comment(// Global variable) -pre_type(int) ident(age) operator(=) integer(18)operator(;) - -comment(// ----) - -directive(void) ident(print_age)operator((\)) -operator({) - comment(// Global value, 'age', is accessed) - ident(std)operator(::)ident(cout) operator(<<) string operator(<<) ident(age) operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// ------------) - -pre_type(int) ident(main)operator((\)) -operator({) - comment(// Global version value saved into local version) - pre_type(int) ident(age) operator(=) operator(::)ident(age)operator(;) - - comment(// Prints 18, the new value of the global version) - ident(print_age)operator((\);) - - comment(// Global version this time altered) - operator(::)ident(age) operator(=) integer(23)operator(;) - - comment(// Prints 23, the new value of the global version) - ident(print_age)operator((\);) - - comment(// Global version value restored from saved local version) - operator(::)ident(age) operator(=) ident(age)operator(;) - - comment(// Prints 18, the restored value of the global version) - ident(print_age)operator((\);) -operator(}) - -comment(// @@PLEAC@@_10.14) -comment(// Please refer to the corresponding section in PLEAC-C/Posix/GNU since the points raised there) -comment(// about functions and function pointers apply equally to Standard C++ [briefly: functions) -comment(// cannot be redefined; several same-signature functions may be called via the same function) -comment(// pointer variable; code cannot be generated 'on-the-fly' (well, not without the use of) -comment(// several external tools, making it an extra-language, not integral, feature\)].) -comment(// @@INCOMPLETE@@) - -comment(// @@PLEAC@@_10.15) -comment(// Please refer to the corresponding section in PLEAC-C/Posix/GNU since all the points raised) -comment(// there apply equally to Standard C++ [briefly: undefined function calls are compiler-detected) -comment(// errors; function-pointer-based calls can't be checked for integrity].) -comment(// @@INCOMPLETE@@) - -comment(// @@PLEAC@@_10.16) -comment(// Standard C++ does not support either simple nested functions or closures, therefore the) -comment(// example cannot be implemented exactly as per the Perl code) - -comment(/* === -int outer(int arg\) -{ - int x = arg + 35; - - // *** wrong - illegal C++ *** - int inner(\) { return x * 19; } - - return x + inner(\); -} -=== */) - -comment(// The problem may, of course, be solved by defining two functions using parameter passing) -comment(// where appropriate, but this is contrary to the intent of the original Perl code) -pre_type(int) ident(inner)operator(()pre_type(int) ident(x)operator(\)) -operator({) - reserved(return) ident(x) operator(*) integer(19)operator(;) -operator(}) - -pre_type(int) ident(outer)operator(()pre_type(int) ident(arg)operator(\)) -operator({) - pre_type(int) ident(x) operator(=) ident(arg) operator(+) integer(35)operator(;) - reserved(return) ident(x) operator(+) ident(inner)operator(()ident(x)operator(\);) -operator(}) - -comment(// An arguably better [but far more complicated] approach is to encapsulate all items within) -comment(// a namespace, but again, is an approach that is counter the intent of the original Perl code) -preprocessor(#include) include() - -reserved(namespace) ident(nst) -operator({) - pre_type(int) ident(x)operator(;) - pre_type(int) ident(inner)operator((\);) - pre_type(int) ident(outer)operator(()pre_type(int) ident(arg)operator(\);) -operator(}) - -comment(// ----) - -pre_type(int) ident(main)operator((\)) -operator({) - ident(std)operator(::)ident(cout) operator(<<) ident(nst)operator(::)ident(outer)operator(()integer(3)operator(\)) operator(<<) ident(std)operator(::)ident(endl)operator(;) -operator(}) - -comment(// ----) - -pre_type(int) ident(nst)operator(::)ident(inner)operator((\)) -operator({) - reserved(return) ident(nst)operator(::)ident(x) operator(*) integer(19)operator(;) -operator(}) - -pre_type(int) ident(nst)operator(::)ident(outer)operator(()pre_type(int) ident(arg)operator(\)) -operator({) - ident(nst)operator(::)ident(x) operator(=) ident(arg) operator(+) integer(35)operator(;) - reserved(return) ident(nst)operator(::)ident(x) operator(+) ident(nst)operator(::)ident(inner)operator((\);) -operator(}) - -comment(// Another way to solve this problem and avoiding the use of an external function, is to) -comment(// create a local type and instantiate an object passing any required environment context) -comment(// to the constructor. Then, what appears as a parameterless nested function call, can be) -comment(// effected using 'operator(\)'. This approach most closely matches the original Perl code) - -pre_type(int) ident(outer)operator(()pre_type(int) ident(arg)operator(\)) -operator({) - pre_type(int) ident(x) operator(=) ident(arg) operator(+) integer(35)operator(;) - - comment(// 'Inner' is what is known as a Functor or Function Object [or Command Design Pattern]; it) - comment(// allows objects that capture state / context to be instantiated, and that state / context) - comment(// used / retained / altered at multiple future times. Both the STL and Boost Libraries) - comment(// provide extensive support these constructs) - reserved(struct) ident(Inner) - operator({) - pre_type(int) ident(n_)operator(;) - directive(explicit) ident(Inner)operator(()pre_type(int) ident(n)operator(\)) operator(:) ident(n_)operator(()ident(n)operator(\)) operator({}) - pre_type(int) directive(operator)operator((\)(\)) directive(const) operator({) reserved(return) ident(n_) operator(*) integer(19)operator(;) operator(}) - operator(}) ident(inner)operator(()ident(x)operator(\);) - - reserved(return) ident(x) operator(+) ident(inner)operator((\);) -operator(}) - -comment(// @@PLEAC@@_10.17) -comment(// @@INCOMPLETE@@) -comment(// @@INCOMPLETE@@) - diff --git a/test/scanners/cpp/pleac.in.cpp b/test/scanners/cpp/pleac.in.cpp deleted file mode 100644 index 5a09e8c..0000000 --- a/test/scanners/cpp/pleac.in.cpp +++ /dev/null @@ -1,2041 +0,0 @@ -// -*- c++ -*- - -// @@PLEAC@@_NAME -// @@SKIP@@ C++/STL/Boost - - -// @@PLEAC@@_WEB -// @@SKIP@@ http://www.research.att.com/~bs/C++.html -// @@SKIP@@ http://www.boost.org/ - - -// @@PLEAC@@_1.0 -// NOTE: Whilst it is perfectly valid to use Standard C Library, or GNU -// C Library, routines in C++ programs, the code examples here will, as -// far as possible, avoid doing so, instead using C++-specific functionality -// and idioms. In general: -// * I/O will be iostream-based [i.e. no 'scanf', 'printf', 'fgets' etc] -// * Container / iterator idioms based on the Standard Template Library [STL] -// will replace the built-in array / raw pointer idioms typically used in C -// * Boost Library functionality utilised wherever possible [the reason for -// this is that much of this functionality is likely to appear in the next -// C++ standard] -// * Error detection/handling will generally be exception-based [this is done -// to keep examples simple. Exception use is optional in C++, and is not as -// pervasive as it is in other languages like Java or C#] -// C-based solution(s) to problem(s) will be found in the corresponding section -// of PLEAC-C/Posix/GNU. - -// In C++, one can use the builtin 'char *' type or the 'string' type -// to represent strings. In this section, we will work with the C++ -// library 'string' class. - -// Characteristics of 'string' types: -// - may be of any length -// - are defined within the std namespace -// - can be converted to a 'const char *' using std::string::c_str() -// - can be subscripted to access individual characters (e.g., str[3] -// returns the 4th character of the string -// - memory associated with strings is reclaimed automatically as strings -// go out of scope -// - strings cannot be used as true/false values (i.e., the following is not -// allowed: string s; if (s) {}) - -//----------------------------- -// Before using strings, you must include the header file -#include - -//----------------------------- -// To create a literal strings, you must use double quotes ("). You cannot -// use single quotes. - -//----------------------------- -// String variables must be declared -- if no value is given it's -// value is the empty string (""). -std::string s; - -//----------------------------- -// To insert special characters, quote the character with \ -std::string s1 = "\\n"; // Two characters, \ and n -std::string s2 = "Jon \"Maddog\" Orwant"; // Literal double quotes - -//----------------------------- -// Strings can be declared in one of two ways -std::string s1 = "assignment syntax"; -std::string s2("constructor syntax"); - -//----------------------------- -// Multi-line strings. -// There is no equivalent to perl's "here" documents in c++ -std::string s1 = " -This is a multiline string started and finished with double -quotes that spans 4 lines (it contains 3 newline characters). -"; - -std::string s2 = "This is a multiline string started and finished with double -quotes that spans 2 lines (it contains 1 newline character)."; -//----------------------------- - - -// @@PLEAC@@_1.1 -std::string s = "some string"; - -//----------------------------- -std::string value1 = s.substr(offset, length); -std::string value2 = s.substr(offset); - -// Unlike perl, the substr function returns a copy of the substring -// rather than a reference to the existing substring, thus using substr -// on the left hand side of an assignment statement will not modify -// the original string. To get this functionality, you can use the -// std::string::replace function. - -// Using offsets and lengths -s.replace(offset, length, newstring); -s.replace(offset, s.size()-offset, newtail); - -//----------------------------- -// The C++ string class doesn't have anything equivalent to perl's unpack. -// Instead, one can use C structures to import/export binary data - -//----------------------------- -#include -string s = "This is what you have"; - -std::string first = s.substr(0, 1); // "T" -std::string second = s.substr(5, 2); // "is" -std::string rest = s.substr(13); // "you have" - -// C++ strings do not support backwards indexing as perl does but -// you can fake it out by subtracting the negative index from the -// string length -std::string last = s.substr(s.size()-1); // "e" -std::string end = s.substr(s.size()-4); // "have" -std::string piece = s.substr(s.size()-8, 3); // "you" - -//----------------------------- -#include -#include - -string s("This is what you have"); -std::cout << s << std::endl; -// This is what you have - -s.replace(5,2,"wasn't"); // change "is to "wasn't" -// This wasn't what you have - -s.replace(s.size()-12, 12, "ondrous"); // "This wasn't wondrous" -// This wasn't wonderous - -s.replace(0, 1, ""); // delete first character -// his wasn't wondrous - -s.replace(s.size()-10, 10, ""); // delete last 10 characters -// his wasn' - -//----------------------------- -// C++ does not have built-in support for the perl s///, m//, and tr/// -// operators; however, similar results can be achieved in at least -// two ways: -// - string operations such as string::find, string::rfind, etc. -// - the boost regular expression library (regex++) supports perl -// regular expression syntax. -// TODO: Add examples of each. - -// MISSING: if (substr($string, -10) =~ /pattern/) { -// print "Pattern matches in last 10 characters\n"; -// } - -// MISSING: substr($string, 0, 5) =~ s/is/at/g; - -//----------------------------- -// exchange the first and last letters in a string using substr and replace -string a = "make a hat"; - -std::string first = a.substr(0,1); -std::string last = a.substr(a.size()-1); - -a.replace(0,1, last); -a.replace(a.size()-1, 1, first); - -// exchange the first and last letters in a string using indexing and swap -#include -std::swap(a[0], a[a.size()-1]); -//----------------------------- - - -// @@PLEAC@@_1.2 -//----------------------------- -// C++ doesn't have functionality equivalent to the || and ||=. -// If statements and trigraphs can be used instead. -//----------------------------- -// C++ doesn't have anything equivalent "defined". C++ variables -// cannot be used at all if they have not previously been defined. - -//----------------------------- -// Use b if b is not empty, else c -a = b.size() ? b : c; - -// Set x to y unless x is not empty -if (x.is_empty()) x = y; - -//----------------------------- -foo = (!bar.is_empty()) ? bar : "DEFAULT VALUE"; - -//----------------------------- -// NOTE: argv is declared as char *argv[] in C/C++. We assume -// the following code surrounds the following examples that deal -// with argv. Also, arguments to a program start at argv[1] -- argv[0] -// is the name of the executable that's running. -#include -int main(int argc, char *argv[]) { - char **args = argv+1; // +1 skips argv[0], the name of the executable - // examples -} - -//----------------------------- -std::string dir = (*args) ? *argv++ : "/tmp"; - -//----------------------------- -std::string dir = argv[1] ? argv[1] : "/tmp"; - -//----------------------------- -std::string dir = (argc-1) ? argv[1] : "/tmp"; - -//----------------------------- -#include -std::map count; - -count[shell.size() ? shell : "/bin/sh"]++; - -//----------------------------- -// find the user name on Unix systems -// TODO: Simplify. This is too ugly and complex -#include -#include -#include -#include "boost/lexical_cast.hpp" - -std::string user; -char *msg = 0; -passwd *pwd = 0; - -if ( (msg = getenv("USER")) || - (msg = getenv("LOGNAME")) || - (msg = getlogin()) ) - user = msg; -else if (pwd = getpwuid(getuid())) - user = pwd->pw_name; -else - user = "Unknown uid number " + boost::lexical_cast(getuid()); - -//----------------------------- -if (starting_point.is_empty()) starting_point = "Greenwich"; - -//----------------------------- -// Example using list. Other C++ STL containers work similarly. -#include -list a, b; -if (a.is_empty()) a = b; // copy only if a is empty -a = (!b.is_empty()) ? b : c; // asign b if b nonempty, else c -//----------------------------- - - -// @@PLEAC@@_1.3 -//----------------------------- -#include -std::swap(a, b); - -//----------------------------- -temp = a; -a = b; -b = temp; - -//----------------------------- -std::string a("alpha"); -std::string b("omega"); -std::swap(a,b); - -//----------------------------- -// The ability to exchange more than two variables at once is not -// built into the C++ language or C++ standard libraries. However, you -// can use the boost tuple library to accomplish this. -#include - -boost::tie(alpha,beta,production) - = boost::make_tuple("January", "March", "August"); -// move beta to alpha, -// move production to beta, -// move alpha to production -boost::tie(alpha, beta, production) - = boost::make_tuple(beta, production, alpha); -//----------------------------- - - -// @@PLEAC@@_1.4 -//----------------------------- -// There are several ways to convert between characters -// and integers. The examples assume the following declarations: -char ch; -int num; - -//----------------------------- -// Using implicit conversion -num = ch; -ch = num; - -//----------------------------- -// New-style C++ casts -ch = static_cast(num); -num = static_cast(ch); - -//----------------------------- -// Old-style C casts -ch = (char)num; -num = (int)ch; - -//----------------------------- -// Using the C++ stringstream class -#include // On some older compilers, use -std::stringstream a; // On some older compilers, use std::strstream - -a << ch; // Append character to a string -a >> num; // Output character as a number - -a << num; // Append number to a string -a >> ch; // Output number as a character - -//----------------------------- -// Using sprintf, printf -char str[2]; // Has to be length 2 to have room for NULL character -sprintf(str, "%c", num); -printf("Number %d is character %c\n", num, num); - -//----------------------------- -int ascii_value = 'e'; // now 101 -char character = 101; // now 'e' - -//----------------------------- -printf("Number %d is character %c\n", 101, 101); - -//----------------------------- -// Convert from HAL to IBM, character by character -#include -#include - -std::string ibm, hal = "HAL"; -for (unsigned int i=0; i -#include -#include // For bind1st and plus<> -#include // For transform - -std::string hal = "HAL"; -transform(hal.begin(), hal.end(), hal.begin(), - bind1st(plus(),1)); -std::cout << hal << std::endl; // prints "IBM" -//----------------------------- - - -// @@PLEAC@@_1.5 -//----------------------------- -// Since C++ strings can be accessed one character at a time, -// there's no need to do any processing on the string to convert -// it into an array of characters. -#include -std::string s; - -// Accessing characters using for loop and integer offsets -for (unsigned int i=0; i seen; - -for (std::string::iterator i=str.begin(); i!=str.end(); ++i) - seen[*i]++; - -std::cout << "unique chars are: "; -for (std::map::iterator i=seen.begin(); i!=seen.end(); ++i) - std::cout << i->first; -std::cout << std::endl; -// unique chars are: adelnpy - -//----------------------------- -int sum = 0; -for (std::string::iterator i=str.begin(); i!=str.end(); ++i) - sum += *i; -std::cout << "sum is " << sum << std::endl; -// prints "sum is 1248" if str was "an appla a day" - - -//----------------------------- -// MISSING: sysv-like checksum program - -//----------------------------- -// slowcat, emulate a slow line printer -#include -#include -#include - -int main(int argc, char *argv[]) { - timeval delay = { 0, 50000 }; // Delay in { seconds, nanoseconds } - char **arg = argv+1; - while (*arg) { // For each file - std::ifstream file(*arg++); - char c; - while (file.get(c)) { - std::cout.put(c); - std::cout.flush(); - select(0, 0, 0, 0, &delay); - } - } -} -//----------------------------- - - -// @@PLEAC@@_1.6 -//----------------------------- -#include -#include // For reverse -std::string s; - -reverse(s.begin(), s.end()); - -//----------------------------- -#include // For std::vector -#include // On older compilers, use -#include "boost/regex.hpp" // For boost::regex_split - -std::string str; -std::vector words; -boost::regex_split(std::back_inserter(words), str); -reverse(words.begin(), words.end()); // Reverse the order of the words - -std::stringstream revwords; // On older compilers, use strstream -copy(words.begin(), words.end(), ostream_inserter(revwords," "); -std::cout << revwards.str() << std::endl; - -//----------------------------- -std::string rts = str; -reverse(rts.begin(), rts.end()); // Reverses letters in rts - -//----------------------------- -std::vector words; -reverse(words.begin(), words.end()); // Reverses words in container - -//----------------------------- -// Reverse word order -std::string s = "Yoda said, 'can you see this?'"; - -std::vector allwords; -boost::regex_split(std::back_inserter(allwords), s); - -reverse(allwords.begin(), allwords.end()); - -std::stringstream revwords; // On older compilers, use strstream -copy(allwords.begin(), allwords.end(), ostream_inserter(revwords," ")); -std::cout << revwards.str() << std::endl; -// this?' see you 'can said, Yoda - -//----------------------------- -std::string word = "reviver"; -bool is_palindrome = equal(word.begin(), word.end(), word.rbegin()); - -//----------------------------- -#include - -std::ifstream dict("/usr/dict/words"); -std::string word; -while(getline(dict,word)) { - if (equal(word.begin(), word.end(), word.rbegin()) && - word.size() > 5) - std::cout << word << std::endl; -} -//----------------------------- - - -// @@PLEAC@@_1.7 -//----------------------------- -#include - -std::string::size_type pos; -while ((pos = str.find("\t")) != std::string::npos) - str.replace(pos, 1, string(' ',8-pos%8)); -//----------------------------- - - -// @@PLEAC@@_1.8 -//----------------------------- -// Not applicable to C++ -//----------------------------- - - -// @@PLEAC@@_1.9 -//----------------------------- -// TODO: Fix to be more like cookbook -// TODO: Modify/add code to do this with locales -#include -#include - -std::string phrase = "bo peep"; -transform(phrase.begin(), phrase.end(), phrase.begin(), toupper); -// "BO PEEP" -transform(phrase.begin(), phrase.end(), phrase.begin(), tolower); -// "bo peep" -//----------------------------- - - -// @@PLEAC@@_1.10 -//----------------------------- -// C++ does not provide support for perl-like in-string interpolation, -// concatenation must be used instead. - -#include - -std::string var1, var2; -std::string answer = var1 + func() + var2; // func returns string or char * - -//----------------------------- -#include "boost/lexical_cast.hpp" - -int n = 4; -std::string phrase = "I have " + boost::lexical_cast(n+1) + " guanacos."; - -//----------------------------- -std::cout << "I have " + boost::lexical_cast(n+1) + " guanacos." << std::endl; - - -// @@PLEAC@@_1.11 -//----------------------------- -// C++ does not have "here documents". -// TODO: Lots more. -#include -#include "boost/regex.hpp" - -std::string var = " - your text - goes here. -"; - -boost::regex ex("^\\s+"); -var = boost::regex_merge(var, ex, ""); - -// @@PLEAC@@_10.0 -// NOTE: Whilst it is perfectly valid to use Standard C Library, or GNU C Library, routines in -// C++ programs, the code examples here will, as far as possible, avoid doing so, instead using -// C++-specific functionality and idioms. In general: -// * I/O will be iostream-based [i.e. no 'scanf', 'printf', 'fgets' etc] -// * Container / iterator idioms based on the Standard Template Library [STL] -// will replace the built-in array / raw pointer idioms typically used in C -// * Boost Library functionality utilised wherever possible [the reason for -// this is that much of this functionality is likely to appear in the next -// C++ standard] -// * Error detection/handling will generally be exception-based [this is done -// to keep examples simple. Exception use is optional in C++, and is not as -// pervasive as it is in other languages like Java or C#] -// C-based solution(s) to problem(s) will be found in the corresponding section of PLEAC-C/Posix/GNU. - -#include - -// 'greeted' defined outside of any namespace, class or function, so is part of the -// global namespace, and will be visible throughout the entire executable. Should it -// be necessary to restrict the visibility of this global identifier to the current -// 'compilation unit' [i.e. current source file] then the following may be used: -// -// namespace { int greeted = 0; } -// -// The effect is similar to using the 'static' keyword, in this same context, in the C -// language. - -int greeted = 0; - -int howManyGreetings(); -void hello(); - -// ---- - -int main() -{ - hello(); - - int greetings = howManyGreetings(); - - std::cout << "bye there!, there have been " - << greetings - << " greetings so far" - << std::endl; -} - -// ---- - -int howManyGreetings() -{ - // Access 'greeted' identifier in the global namespace using the scope resolution - // operator. Use of this operator is only necessary if a similarly-named identifier - // exists in a - return ::greeted; -} - -void hello() -{ - // Here 'greeted' is accessed without additional qualification. Since a 'greeted' identifier - // exists only in the global namespace, it is that identifier that is used - std::cout << "high there!, this function has been called " - << ++greeted - << " times" - << std::endl; -} - -// @@PLEAC@@_10.1 -// Standard C++ requires that a function be prototyped, hence the name and type of parameters -// must be specified, and the argumemt list in any calls to that function must match the -// parameter list, as shown here - -#include - -double hypotenuse(double side1, double side2); - -// ---- - -int main() -{ - double diag = hypotenuse(3.0, 4.0); -} - -// ---- - -double hypotenuse(double side1, double side2) -{ - return std::sqrt(std::pow(side1, 2.0) + std::pow(side2, 2.0)); -} - -// ---------------------------- - -// Variable length argument list functions, via the C Language derived 'va_...' macros, -// are also supported. However use of this facility is particularly discouraged in C++ -// because: -// * It is an inherently type-unsafe facility; type safety is a core C++ concern -// * Other facilities, such as overloaded functions, and default arguments [neither of which -// are available in C] can sometimes obviate the need for variable length argument lists -// * OOP techniques can also lessen the need for variable length argument lists. The most -// obvious example here is the Iostream library where repeated calls of I/O operators replace -// the format string / variable arguments of 'printf' - -#include -#include - -double hypotenuse(double side1, ...); - -// ---- - -int main() -{ - double diag = hypotenuse(3.0, 4.0); -} - -// ---- - -double hypotenuse(double side1, ...) -{ - // More details available in the corresponding section of PLEAC-C/Posix/GNU - va_list ap; - va_start(ap, side1); - double side2 = va_arg(ap, double); - va_end(ap); - - return std::sqrt(std::pow(side1, 2.0) + std::pow(side2, 2.0)); -} - -// ---------------------------- - -// An example using default arguments appears below - -#include - -// Specify default argument values in declaration -// Note: This may be done in either of the declaration or the definition [not both], but it -// makes more sense to do so in the declaration since these are usually placed in header files -// which may be included in several source files. The default argument values would need to be -// known in all those locations -double hypotenuse(double side1 = 3.0, double side2 = 4.0); - -// ---- - -int main() -{ - // All arguments specified - double diag = hypotenuse(3.0, 4.0); - - // Both calls utilise default argument value(s) - diag = hypotenuse(3.0); - - diag = hypotenuse(); -} - -// ---- - -double hypotenuse(double side1, double side2) -{ - return std::sqrt(std::pow(side1, 2.0) + std::pow(side2, 2.0)); -} - -// ---------------------------- - -// A [very contrived, not very practical] example using function overloading appears below - -#include - -double hypotenuse(double side1, double side2); -double hypotenuse(double side1); -double hypotenuse(); - -// ---- - -int main() -{ - // Call version (1) - double diag = hypotenuse(3.0, 4.0); - - // Call version (2) - diag = hypotenuse(3.0); - - // Call version (3) - diag = hypotenuse(); -} - -// ---- - -// (1) -double hypotenuse(double side1, double side2) -{ - return std::sqrt(std::pow(side1, 2.0) + std::pow(side2, 2.0)); -} - -// (2) -double hypotenuse(double side1) -{ - return std::sqrt(std::pow(side1, 2.0) + std::pow(4.0, 2.0)); -} - -// (3) -double hypotenuse() -{ - return std::sqrt(std::pow(3.0, 2.0) + std::pow(4.0, 2.0)); -} - -// ---------------------------- - -#include -#include - -std::vector int_all(const double arr[], size_t arrsize); -std::vector int_all(const std::vector& arr); - -// ---- - -int main() -{ - // Load vectors from built-in arrays, or use Boost 'assign' library - const double nums[] = {1.4, 3.5, 6.7}; - const size_t arrsize = sizeof(nums) / sizeof(nums[0]); - - // Conversion effected at vector creation time - std::vector ints = int_all(nums, arrsize); - - // Vector -> vector copy / conversion - ints = int_all(std::vector(nums, nums + arrsize)); -} - -// ---- - -std::vector int_all(const double arr[], size_t arrsize) -{ - return std::vector(arr, arr + arrsize); -} - -std::vector int_all(const std::vector& arr) -{ - std::vector r; - r.assign(arr.begin(), arr.end()); // Type safe element copying - return r; -} - -// ---------------------------- - -#include -#include - -#include -#include - -void trunc_em(std::vector& arr); - -// ---- - -int main() -{ - // Load vectors from built-in arrays, or use Boost 'assign' library - const double nums[] = {1.4, 3.5, 6.7}; - const size_t arrsize = sizeof(nums) / sizeof(nums[0]); - - std::vector numsv(nums, nums + arrsize); - - trunc_em(numsv); -} - -// ---- - -void trunc_em(std::vector& arr) -{ - // Replace each element with the value returned by applying 'floor' to that element - std::transform(arr.begin(), arr.end(), arr.begin(), floor); -} - -// @@PLEAC@@_10.2 -// Variables declared within a function body are local to that function, and those declared -// outside a function body [and not as part of a class / struct definition, or enclosed within -// a namespace] are global, that is, are visible throughout the executable unless their -// visibility has been restricted to the source file in which they are defined via enclosing -// them within an anonymous namespace [which has the same effect as using the 'static' keyword, -// in this same context, in the C language] - -#include - -void somefunc() -{ - // All these variables are local to this function - int variable, another; - - std::vector vec(5); - - ; // ... -} - -// ---------------------------- - -// A couple of generic, type-safe type conversion helpers. The Boost Library sports a conversion -// library at: http://www.boost.org/libs/conversion/index.html - -#include -#include - -class bad_conversion {}; - -template T fromString(const std::string& s) -{ - std::istringstream iss(s); - T t; iss >> t; - if (!iss) throw bad_conversion(); - return t; -} - -template std::string toString(const T& t) -{ - std::ostringstream oss; - oss << t << std::ends; - if (!oss) throw bad_conversion(); - return std::string(oss.str()); -} - -// ------------ - -#include - -// File scope variables -namespace -{ - std::string name; - int age, c, condition; -} - -void run_check(); -void check_x(int x); - -// ---- - -// An alternative, C++-specific approach, to command-line handling and type conversion -// may be seen at: http://www.boost.org/libs/conversion/lexical_cast.htm - -int main(int argc, char* argv[]) -{ - name.assign(argv[1]); - - try - { - age = fromString(argv[2]); - } - - catch (const bad_conversion& e) - { - ; // ... handle conversion error ... - } - - check_x(age); -} - -// ------------ - -void run_check() -{ - // Full access to file scope variables - condition = 1; - // ... -} - -void check_x(int x) -{ - // Full access to file scope variables - std::string y("whatever"); - - run_check(); - - // 'condition' updated by 'run_check' - if (condition) - { - ; // ... - } -} - -// @@PLEAC@@_10.3 -// Standard C++, owing to its C heritage, allows the creation of 'persistent private variables', -// via use of the 'static' keyword. For more details about this, and illustrative code examples, -// refer to this same section in PLEAC-C/Posix/GNU. Standard C++-specific methods of perfoming -// this task involve use of the 'namespace' facility, or creating a class containing 'static' -// members and using access specifiers to restrict access - -// This example replaces the 'static' keyword with use of an anonymous namespace to force -// 'variable' to have file scope, and be visible only within the 'mysubs.cpp file. It is -// therefore both persistant [because it is a global variable] and private [because it is -// visible only to functions defined within the same source file] - -// File: 'mysubs.h' -void mysub(void); -void reset(void); - -// ---- - -// File: 'mysubs.cpp' -namespace -{ - int variable = 1; -} - -void mysub(void) -{ - ; // ... do something with 'variable' ... -} - -void reset(void) { variable = 1; } - -// ---- - -// File: 'test.cpp' -#include "mysubs.h" - -int main() -{ - // 'variable' is not accessable here - - // Call 'mysub', which can access 'variable' - mysub(); - - // Call 'reset' which sets 'variable' to 1 - reset(); -} - -// ------------ - -// This example is similar to the previous one in using an anonymous namespace to restrict -// variable visibility. It goes further, hoewever, grouping logically related items within -// a named namespace, thus ensuring access to those items is controlled [i.e. requires -// qualification, or a 'using' declaration or directive] - -// File: 'counter.h' -namespace cnt -{ - int increment(); - int decrement(); -} - -// ---- - -// File: 'counter.cpp' -namespace cnt -{ - // Ensures 'counter' is visible only within the current source file - namespace { int counter = 0; } - - void reset(int v = 0) { counter = v; } - - int increment() { return ++counter; } - int decrement() { return --counter; } -} - -// ---- - -// File: 'test.cpp' -#include -#include "counter.h" - -int main() -{ - // Following line is illegal because 'cnt::counter' is private to the 'counter.cpp' file - // int c = cnt::counter; - - int a = cnt::increment(); - std::cout << a << std::endl; - - a = cnt::decrement(); - std::cout << a << std::endl; -} - -// ------------ - -// This example sees a class containing 'static' members and using access specifiers to -// restrict access to those members. Since all the members are static, this class is not -// meant to be instantiated [i.e. objects created from it - it can be done, but they would -// all be the exact same object :)], but merely uses the 'class' facility to encapsulate -// [i.e. group together] and allow selective access [i.e. hide some parts, allow access to -// others]. For Design Pattern afficiandos, this is a crude example of the Singleton Pattern - -// File: 'counter.h' -class Counter -{ -public: - static int increment(); - static int decrement(); -private: - static int counter; -}; - -// ---- - -// File: 'counter.cpp' -#include "counter.h" - -int Counter::increment() { return ++counter; } -int Counter::decrement() { return --counter; } - -int Counter::counter = 0; - -// ---- - -// File: 'test.cpp' -#include -#include "counter.h" - -int main() -{ - int a = Counter::increment(); - std::cout << a << std::endl; - - a = Counter::decrement(); - std::cout << a << std::endl; -} - -// @@PLEAC@@_10.4 -// Standard C++ offers no facility for performing adhoc, runtime stack inspection; therefore, -// information such as the currently-executing function name, cannot be obtained. Now, this -// isn't to say that such facilities don't exist [since, after all, a symbolic debugger works -// by doing just this - stack inspection, among other things], but that such features are, for -// native code compiled languages like C++, 'extra-language' and development tool-specific - -// @@PLEAC@@_10.5 -// Standard C++ supports both -// * 'pass-by-value': a copy of an argument is passed when calling a function; in this way -// the original is safe from modification, but a copying overhead is incurred which may -// adversely affect performance -// * 'pass-by-reference': the address of an argument is passed when calling a function; -// allows the original to be modified, and incurrs no performance penalty from copying -// -// The 'pass-by-value' mechanism works in the same way as in the Standard C language [see -// corresponding section in PLEAC-C/Posix/GNU]. The 'pass-by-reference' mechanism provides -// the same functionality as passing a pointer-to-a-pointer-to-an-argument, but without the -// complications arising from having to correctly dereference. Using a reference to a non-const -// item allows: -// * The item's state to be modified i.e. if an object was passed, it can be mutated [effect -// can be mimiced by passing a pointer to the item] -// * The item, itself, can be replaced with a new item i.e. the memory location to which the -// reference refers is updated [effect can be mimiced by passing a pointer-to-a-pointer to -// the item] - -#include -#include - -// 'pass-by-value': a copy of each vector is passed as an argument -// void array_diff(const std::vector arr1, const std::vector arr2); - -// 'pass-by-reference': the address of each vector is passed as an argument. Some variants: -// * Disallow both vector replacement and alteration of its contents -// void array_diff(const std::vector& arr1, const std::vector& arr2); -// * Disallow vector replacement only -// void array_diff(const std::vector& arr1, const std::vector& arr2); -// * Disallow alteration of vector contents only -// void array_diff(std::vector& arr1, std::vector& arr2); -// * Allow replacement / alteration -// void array_diff(std::vector& arr1, std::vector& arr2); - -void array_diff(const std::vector& arr1, const std::vector& arr2); - -// ---- - -int main() -{ - // Load vectors from built-in arrays, or use Boost 'assign' library - const int arr1[] = {1, 2, 3}, arr2[] = {4, 5, 6}; - const size_t arrsize = 3; - - // Function call is the same whether 'array_diff' is declared to be 'pass-by-value' - // or 'pass-by-reference' - array_diff(std::vector(arr1, arr1 + arrsize), std::vector(arr2, arr2 + arrsize)); -} - -// ---- - -// void array_diff(const std::vector arr1, const std::vector arr2) -// { -// ; // 'arr1' and 'arr2' are copies of the originals -// } - -void array_diff(const std::vector& arr1, const std::vector& arr2) -{ - ; // 'arr1' and 'arr2' are references to the originals -} - -// ---------------------------- - -#include - -#include -#include -#include - -std::vector add_vecpair(const std::vector& arr1, const std::vector& arr2); - -// ---- - -int main() -{ - // Load vectors from built-in arrays, or use Boost 'assign' library - const int aa[] = {1, 2}, ba[] = {5, 8}; - size_t arrsize = 2; - - const std::vector a(aa, aa + arrsize), b(ba, ba + arrsize); - - std::vector c = add_vecpair(a, b); -} - -// ---- - -std::vector add_vecpair(const std::vector& arr1, const std::vector& arr2) -{ - std::vector retvec; retvec.reserve(arr1.size()); - std::transform(arr1.begin(), arr1.end(), arr2.begin(), back_inserter(retvec), std::plus()); - return retvec; -} - -// @@PLEAC@@_10.6 -// Please refer to the corresponding section in PLEAC-C/Posix/GNU since the points raised there -// apply to C++ also. Examples here don't so much illustrate C++'s handling of 'return context' -// as much as how disparate types might be handled in a reasonably uniform manner - -// Here, 'mysub' is implemented as a function template, and its return type varies with the -// argument type. In most cases the compiler is able to infer the return type from the -// argument, however, it is possible to pass the type as a template parameter. Note this -// code operates at compile-time, as does any template-only code - -#include - -#include -#include - -template T mysub(const T& t) { return t; } - -// ---- - -int main() -{ - // 1. Type information inferred by compiler - int i = mysub(5); - - double d = mysub(7.6); - - const int arr[] = {1, 2, 3}; - const size_t arrsize = sizeof(arr) / sizeof(arr[0]); - - std::vector v = mysub(std::vector(arr, arr + arrsize)); - - // 2. Type information provided by user - // Pass a 'const char*' argument and specify type information in the call - std::string s = mysub("xyz"); - - // Could avoid specifying type information by passing a 'std::string' argument - // std::string s = mysub(std::string("xyz")); -} - -// ---------------------------- - -// This is a variant on the previous example that uses the Boost Library's 'any' type as a -// generic 'stub' type - -#include -#include - -#include - -template boost::any mysub(const T& t) { return boost::any(t); } - -// ---- - -int main() -{ - std::vector any; - - // Add various types [encapsulated in 'any' objects] to the container - any.push_back(mysub(5)); - any.push_back(mysub(7.6)); - any.push_back(mysub(std::vector(5, 5))); - any.push_back(mysub(std::string("xyz"))); - - // Extract the various types from the container by appropriately casting the relevant - // 'any' object - int i = boost::any_cast(any[0]); - double d = boost::any_cast(any[1]); - std::vector v = boost::any_cast< std::vector >(any[2]); - std::string s = boost::any_cast(any[3]); -} - -// @@PLEAC@@_10.7 -// Just like the C language, C++ offers no support for named / keyword parameters. It is of -// course possible to mimic such functionality the same way it is done in C [see corresponding -// section in PLEAC-C/Posix/GNU], the most obvious means being by passing a set of key/value -// pairs in a std::map. This will not be shown here. Instead, two quite C++-specific examples -// will be provided, based on: -// -// * Named Parameter Idiom [see: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18] -// * Boost 'parameter' Library [see: http://www.boost.org/libs/parameter/doc/html/index.html] - -#include -#include - -class TimeEntry -{ -public: - explicit TimeEntry(int value = 0, char dim = 's'); - - bool operator<(const TimeEntry& right) const; - - friend std::ostream& operator<<(std::ostream& out, const TimeEntry& t); - -private: - int value_; - char dim_; -}; - -typedef std::pair TENTRY; -typedef std::map TIMETBL; - -class RaceTime -{ -public: - const static int START_TIME, FINISH_TIME, INCR_TIME; - -public: - explicit RaceTime(); - - RaceTime& start_time(const TimeEntry& time); - RaceTime& finish_time(const TimeEntry& time); - RaceTime& incr_time(const TimeEntry& time); - - friend std::ostream& operator<<(std::ostream& out, const RaceTime& r); - -private: - TIMETBL timetbl_; -}; - -const int RaceTime::START_TIME = 0, RaceTime::FINISH_TIME = 1, RaceTime::INCR_TIME = 2; - -void the_func(const RaceTime& r); - -// ---- - -int main() -{ - the_func(RaceTime().start_time(TimeEntry(20, 's')).finish_time(TimeEntry(5, 'm')).incr_time(TimeEntry(5, 's'))); - - the_func(RaceTime().start_time(TimeEntry(5, 'm')).finish_time(TimeEntry(30, 'm'))); - - the_func(RaceTime().start_time(TimeEntry(30, 'm'))); -} - -// ---- - -std::ostream& operator<<(std::ostream& out, const TimeEntry& t) -{ - out << t.value_ << t.dim_; return out; -} - -std::ostream& operator<<(std::ostream& out, const RaceTime& r) -{ - RaceTime& r_ = const_cast(r); - - out << "start_time: " << r_.timetbl_[RaceTime::START_TIME] - << "\nfinish_time: " << r_.timetbl_[RaceTime::FINISH_TIME] - << "\nincr_time: " << r_.timetbl_[RaceTime::INCR_TIME]; - - return out; -} - -TimeEntry::TimeEntry(int value, char dim) : value_(value), dim_(dim) {} - -bool TimeEntry::operator<(const TimeEntry& right) const -{ - return (dim_ == right.dim_) ? (value_ < right.value_) : !(dim_ < right.dim_); -} - -RaceTime::RaceTime() -{ - timetbl_.insert(TENTRY(START_TIME, TimeEntry(0, 's'))); - timetbl_.insert(TENTRY(FINISH_TIME, TimeEntry(0, 's'))); - timetbl_.insert(TENTRY(INCR_TIME, TimeEntry(0, 's'))); -} - -RaceTime& RaceTime::start_time(const TimeEntry& time) -{ - timetbl_[START_TIME] = time; return *this; -} - -RaceTime& RaceTime::finish_time(const TimeEntry& time) -{ - timetbl_[FINISH_TIME] = time; return *this; -} - -RaceTime& RaceTime::incr_time(const TimeEntry& time) -{ - timetbl_[INCR_TIME] = time; return *this; -} - -void the_func(const RaceTime& r) -{ - std::cout << r << std::endl; -} - -// ---------------------------- - -// The Boost 'parameter' library requires a significant amount of setup code to be written, -// much more than this section warrants. My recommendation is to read carefully through the -// tutorial to determine whether a problem for which it is being considered justifies all -// the setup. - -// @@PLEAC@@_10.8 -// The Boost 'tuple' Library also allows multiple assignment to variables, including the -// selective skipping of return values - -#include - -#include - -typedef boost::tuple T3; - -T3 func(); - -// ---- - -int main() -{ - int a = 6, b = 7, c = 8; - std::cout << a << ',' << b << ',' << c << std::endl; - - // A tuple of references to the referred variables is created; the values - // captured from the returned tuple are thus multiply-assigned to them - boost::tie(a, b, c) = func(); - std::cout << a << ',' << b << ',' << c << std::endl; - - // Variables can still be individually referenced - a = 11; b = 23; c = 56; - std::cout << a << ',' << b << ',' << c << std::endl; - - // Return values may be ignored; affected variables retain existing values - boost::tie(a, boost::tuples::ignore, c) = func(); - std::cout << a << ',' << b << ',' << c << std::endl; -} - -// ---- - -T3 func() { return T3(3, 6, 9); } - -// @@PLEAC@@_10.9 -// Like Standard C, C++ allows only the return of a single value. The return of multiple values -// *can*, however, be simulated by packaging them within an aggregate type [as in C], or a -// custom class, or one of the STL containers like std::vector. Probably the most robust, and -// [pseudo]-standardised, approach is to use the Boost 'tuple' Library, as will be done in this -// section. Notes: -// * Use made of Boost 'assign' Library to simplify container loading; this is a *very* handy -// library -// * Use made of Boost 'any' Library to make containers heterogenous; 'variant' Library is -// similar, and is more appropriate where type-safe container traversal is envisaged e.g. -// for printing - -#include -#include -#include - -#include -#include - -#include -#include - -typedef std::vector ARRAY; -typedef std::map HASH; -typedef boost::tuple ARRAY_HASH; - -ARRAY_HASH some_func(const ARRAY& array, const HASH& hash); - -// ---- - -int main() -{ - // Load containers using Boost 'assign' Library - using namespace boost::assign; - ARRAY array; array += 1, 2, 3, 4, 5; - HASH hash; insert(hash) ("k1", 1) ("k2", 2) ("k3", 3); - - // Pass arguments to 'somefunc' and retrieve them as members of a tuple - ARRAY_HASH refs = some_func(array, hash); - - // Retrieve copy of 'array' from tuple - ARRAY ret_array = boost::get<0>(refs); - - // Retrieve copy of 'hash' from tuple - HASH ret_hash = boost::get<1>(refs); -} - -// ---- - -ARRAY_HASH some_func(const ARRAY& array, const HASH& hash) -{ - ; // ... do something with 'array' and 'hash' - - return ARRAY_HASH(array, hash); -} - -// @@PLEAC@@_10.10 -// Like function calls in Standard C, function calls in C++ need to conform to signature -// requirements; a function call must match its declaration with the same number, and type, -// of arguments passed [includes implicitly-passed default arguments], and the same return -// value type. Thus, unlike Perl, a function declared to return a value *must* do so, thus -// cannot 'return nothing' to indicate failure. -// Whilst in Standard C certain conventions like returning NULL pointers, or returning -1, to -// indicate the 'failure' of a task [i.e. function return codes are checked, and control -// proceeds conditionally] are used, Standard C++ sports facilities which lessen the need for -// dong the same. Specifically, C++ offers: -// * Built-in exception handling which can be used to detect [and perhaps recover from], -// all manner of unusual, or erroneous / problematic situations. One recommended use is -// to avoid writing code that performs a lot of return code checking -// * Native OOP support allows use of the Null Object Design Pattern. Put simply, rather than -// than checking return codes then deciding on an action, an object with some predefined -// default behaviour is returned / used where an unusual / erroneous / problematic situation -// is encountered. This approach could be as simple as having some sort of default base -// class member function behaviour, or as complex as having a diagnostic-laden object created -// * Functions can still return 'error-indicating entities', but rather than primitive types -// like 'int's or NULL pointers, complex objects can be returned. For example, the Boost -// Library sports a number of such types: -// - 'tuple' -// - 'any', 'variant' and 'optional' -// - 'tribool' [true, false, indeterminate] - -// Exception Handling Example - -class XYZ_exception {}; - -int func(); - -// ---- - -int main() -{ - int valid_value = 0; - - try - { - ; // ... - - valid_value = func(); - - ; // ... - } - - catch(const XYZ_exception& e) - { - ; // ... - } -} - -// ---- - -int func() -{ - bool error_detected = false; - int valid_value; - - ; // ... - - if (error_detected) throw XYZ_exception(); - - ; // ... - - return valid_value; -} - -// ------------ - -// Null Object Design Pattern Example - -#include - -class Value -{ -public: - virtual void do_something() = 0; -}; - -class NullValue : public Value -{ -public: - virtual void do_something(); -}; - -class ValidValue : public Value -{ -public: - virtual void do_something(); -}; - -Value* func(); - -// ---- - -int main() -{ - // Error checking is performed within 'func'. However, regardless of the outcome, an - // object of 'Value' type is returned which possesses similar behaviour, though appropriate - // to whether processing was successful or not. In this way no error checking is needed - // outside of 'func' - Value* v = func(); - - v->do_something(); - - delete v; -} - -// ---- - -void NullValue::do_something() -{ - std::cout << "*null*" << std::endl; -} - -void ValidValue::do_something() -{ - std::cout << "valid" << std::endl; -} - -Value* func() -{ - bool error_detected = true; - - ; // ... - - if (error_detected) return new NullValue; - - ; // ... - - return new ValidValue; -} - -// ---------------------------- - -// The Boost 'optional' library has many uses, but in the current context, one is of particular -// use: returning a specified type [thus satisfying language requirements], but whose value -// may be 'set' [if the function succeeded] or 'unset' [if it failed], and this condition very -// easily checked - -#include - -#include - -#include -#include -#include - -#include - -class func_fail -{ -public: - explicit func_fail(const std::string& msg) : msg_(msg) {} - const std::string& msg() const { return msg_; } -private: - const std::string msg_; -}; - -// ---- - -void die(const std::string& msg); - -boost::optional sfunc(); -boost::optional< std::vector > afunc(); -boost::optional< std::map > hfunc(); - -// ------------ - -int main() -{ - try - { - boost::optional s; - boost::optional< std::vector > a; - boost::optional< std::map > h; - - if (!(s = sfunc())) throw func_fail("'sfunc' failed"); - if (!(a = afunc())) throw func_fail("'afunc' failed"); - if (!(h = hfunc())) throw func_fail("'hfunc' failed"); - - ; // ... do stuff with 's', 'a', and 'h' ... - int scalar = *s; - - ; // ... - } - - catch (const func_fail& e) - { - die(e.msg()); - } - - ; // ... other code executed if no error above ... -} - -// ------------ - -void die(const std::string& msg) -{ - std::cerr << msg << std::endl; - - // Should only be used if all objects in the originating local scope have been destroyed - std::exit(EXIT_FAILURE); -} - -// ---- - -boost::optional sfunc() -{ - bool error_detected = true; - - int valid_int_value; - - ; // ... - - if (error_detected) return boost::optional(); - - ; // ... - - return boost::optional(valid_int_value); -} - -boost::optional< std::vector > afunc() -{ - // ... code not shown ... - - return boost::optional< std::vector >(); - - // ... code not shown -} - -boost::optional< std::map > hfunc() -{ - // ... code not shown ... - - return boost::optional< std::map >(); - - // ... code not shown ... -} - -// @@PLEAC@@_10.11 -// Whilst in Perl function prototyping is optional, this is not the case in C++, where it is -// necessary to: -// * Declare a function before use; this could either be a function declaration separate from -// the function definition, or the function definition itself which serves as its own -// declaration -// * Specify both parameter positional and type information; parameter names are optional in -// declarations, mandatory in definitions -// * Specify return type - -#include -#include - -// Function Declaration -std::vector myfunc(int arg1, int arg2); // Also possible: std::vector myfunc(int, int); - -// ---- - -int main() -{ - // Call function with all required arguments; this is the only calling method - // [except for calling via function pointer which still needs all arguments supplied] - std::vector results = myfunc(3, 5); - - // Let's look at our return array's contents - std::cout << results[0] << ':' << results[1] << std::endl; -} - -// ---- - -// Function Definition -std::vector myfunc(int arg1, int arg2) -{ - std::vector r; - - std::back_inserter(r) = arg1; - std::back_inserter(r) = arg2; - - return r; -} - -// ------------ - -// A version on the above code that is generic, that is, making use of the C++ template -// mechanism to work with any type - -#include -#include - -// Function Declaration -template std::vector myfunc(const T& arg1, const T& arg2); - -// ---- - -int main() -{ - std::vector results = myfunc(3, 5); - - std::cout << results[0] << ':' << results[1] << std::endl; -} - -// ---- - -// Function Definition -template std::vector myfunc(const T& arg1, const T& arg2) -{ - std::vector r; - - std::back_inserter(r) = arg1; - std::back_inserter(r) = arg2; - - return r; -} - -// ------------ - -// Other Perl examples are omitted since there is no variation in C++ function calling or -// parameter handling - -// @@PLEAC@@_10.12 -// One of the key, non-object oriented features of Standard C++ is its built-in support for -// exceptions / exception handling. The feature is well-integrated into the language, including -// a set of predefined exception classes included in, and used by, the Standard Library, is -// quite easy to use, and helps the programmer write robust code provided certain conventions -// are followed. On the downside, the C++ exception handling system is criticised for imposing -// significant runtime overhead, as well as increasing executable code size [though this -// varies considerably between CPU's, OS's, and compilers]. Please refer to the corresponding -// section in PLEAC-C/Posix/GNU for pertinent reading references. -// -// The example code below matches the PLEAC-C/Posix/GNU example rather than the Perl code. Note: -// * A very minimal, custom exception class is implemented; a more complex class, one richer in -// diagnostic information, could have been implemented, or perhaps one based on a standard -// exception class like 'std::exception' -// * Ordinarily error / exception messages are directed to 'std::cerr' or 'std::clog' -// * General recommendation is to throw 'temporaries' [via invoking a constructor], -// and to 'catch' as const reference(s) -// * Proper 'cleanup' is very important; consult a suitable book for guidance on writing -// 'exception safe' code - -#include -#include - -class FullmoonException -{ -public: - explicit FullmoonException(const std::string& msg) : msg_(msg) {} - - friend std::ostream& operator<<(std::ostream& out, const FullmoonException& e) - { - out << e.msg_; return out; - } -private: - const std::string msg_; -}; - -// ---- - -int main() -{ - std::cout << "main - entry" << std::endl; - - try - { - std::cout << "try block - entry" << std::endl; - std::cout << "... doing stuff ..." << std::endl; - - // if (... error condition detected ...) - throw FullmoonException("... the problem description ..."); - - // Control never gets here ... - std::cout << "try block - end" << std::endl; - } - - catch(const FullmoonException& e) - { - std::cout << "Caught a'Fullmoon' exception. Message: " - << "[" << e << "]" - << std::endl; - } - - catch(...) - { - std::cout << "Caught an unknown exceptione" << std::endl; - } - - // Control gets here regardless of whether an exception is thrown or not - std::cout << "main - end" << std::endl; -} - -// @@PLEAC@@_10.13 -// Standard C++ sports a namespace facility which allows an application to be divided into -// logical sub-systems, each of which operates within its own scope. Put very simply, the same -// identifiers [i.e. name of types, objects, and functions] may be each used in a namespace -// without fear of a nameclash occurring when logical sub-systems are variously combined as -// an application. The name-clash problem is inherent in single-namespace languages like C; it -// often occurs when several third-party libraries are used [a common occurrence in C], or -// when an application scales up. The remedy is to rename identifiers, or, in the case of -// functions that cannot be renamed, to wrap them up in other functions in a separate source -// file. Of course the problem may be minimised via strict adherence to naming conventions. -// -// The C++ namespace facility is important, too, because it avoids the need to utilise certain -// C language practices, in particular: -// * Use of, possibly, 'clumsy' naming conventions [as described above] -// * Partition an application by separating logically-related items into separate source -// files. Namespaces cross file boundaries, so items may reside in several source files -// and still comprise a single, logical sub-system -// * Anonymous namespaces avoid use of the 'static' keyword in creating file scope globals - -// Global variable -int age = 18; - -// ---- - -void print_age() -{ - // Global value, 'age', is accessed - std::cout << "Age is " << age << std::endl; -} - -// ------------ - -int main() -{ - // A local variable named, 'age' will act to 'shadow' the globally - // defined version, thus any changes to, 'age', will not affect - // the global version - int age = 5; - - // Prints 18, the current value of the global version - print_age(); - - // Local version is altered, *not* global version - age = 23; - - // Prints 18, the current value of the global version - print_age(); -} - -// ---------------------------- - -// Global variable -int age = 18; - -// ---- - -void print_age() -{ - // Global value, 'age', is accessed - std::cout << "Age is " << age << std::endl; -} - -// ------------ - -int main() -{ - // Here no local version declared: any changes affect global version - age = 5; - - // Prints 5, the new value of the global version - print_age(); - - // Global version again altered - age = 23; - - // Prints 23, the new value of the global version - print_age(); -} - -// ---------------------------- - -// Global variable -int age = 18; - -// ---- - -void print_age() -{ - // Global value, 'age', is accessed - std::cout << "Age is " << age << std::endl; -} - -// ------------ - -int main() -{ - // Global version value saved into local version - int age = ::age; - - // Prints 18, the new value of the global version - print_age(); - - // Global version this time altered - ::age = 23; - - // Prints 23, the new value of the global version - print_age(); - - // Global version value restored from saved local version - ::age = age; - - // Prints 18, the restored value of the global version - print_age(); -} - -// @@PLEAC@@_10.14 -// Please refer to the corresponding section in PLEAC-C/Posix/GNU since the points raised there -// about functions and function pointers apply equally to Standard C++ [briefly: functions -// cannot be redefined; several same-signature functions may be called via the same function -// pointer variable; code cannot be generated 'on-the-fly' (well, not without the use of -// several external tools, making it an extra-language, not integral, feature)]. -// @@INCOMPLETE@@ - -// @@PLEAC@@_10.15 -// Please refer to the corresponding section in PLEAC-C/Posix/GNU since all the points raised -// there apply equally to Standard C++ [briefly: undefined function calls are compiler-detected -// errors; function-pointer-based calls can't be checked for integrity]. -// @@INCOMPLETE@@ - -// @@PLEAC@@_10.16 -// Standard C++ does not support either simple nested functions or closures, therefore the -// example cannot be implemented exactly as per the Perl code - -/* === -int outer(int arg) -{ - int x = arg + 35; - - // *** wrong - illegal C++ *** - int inner() { return x * 19; } - - return x + inner(); -} -=== */ - -// The problem may, of course, be solved by defining two functions using parameter passing -// where appropriate, but this is contrary to the intent of the original Perl code -int inner(int x) -{ - return x * 19; -} - -int outer(int arg) -{ - int x = arg + 35; - return x + inner(x); -} - -// An arguably better [but far more complicated] approach is to encapsulate all items within -// a namespace, but again, is an approach that is counter the intent of the original Perl code -#include - -namespace nst -{ - int x; - int inner(); - int outer(int arg); -} - -// ---- - -int main() -{ - std::cout << nst::outer(3) << std::endl; -} - -// ---- - -int nst::inner() -{ - return nst::x * 19; -} - -int nst::outer(int arg) -{ - nst::x = arg + 35; - return nst::x + nst::inner(); -} - -// Another way to solve this problem and avoiding the use of an external function, is to -// create a local type and instantiate an object passing any required environment context -// to the constructor. Then, what appears as a parameterless nested function call, can be -// effected using 'operator()'. This approach most closely matches the original Perl code - -int outer(int arg) -{ - int x = arg + 35; - - // 'Inner' is what is known as a Functor or Function Object [or Command Design Pattern]; it - // allows objects that capture state / context to be instantiated, and that state / context - // used / retained / altered at multiple future times. Both the STL and Boost Libraries - // provide extensive support these constructs - struct Inner - { - int n_; - explicit Inner(int n) : n_(n) {} - int operator()() const { return n_ * 19; } - } inner(x); - - return x + inner(); -} - -// @@PLEAC@@_10.17 -// @@INCOMPLETE@@ -// @@INCOMPLETE@@ - diff --git a/test/scanners/cpp/suite.rb b/test/scanners/cpp/suite.rb deleted file mode 100644 index 7389d40..0000000 --- a/test/scanners/cpp/suite.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Cpp < CodeRay::TestCase -end diff --git a/test/scanners/cpp/wedekind.expected.raydebug b/test/scanners/cpp/wedekind.expected.raydebug deleted file mode 100644 index e85226f..0000000 --- a/test/scanners/cpp/wedekind.expected.raydebug +++ /dev/null @@ -1,12 +0,0 @@ -reserved(template)operator(<) reserved(typename) ident(T) operator(>) -ident(T) ident(plus)operator(() directive(const) operator(&)ident(T) ident(x) operator(\)) -operator({) - reserved(return) operator(-)ident(x)operator(;) -operator(}) - -reserved(template)operator(<) reserved(typename) ident(T) operator(>) -reserved(class) class(image) -operator({) -directive(public)operator(:) - ident(image)operator(() directive(const) ident(image)operator(<) ident(T) operator(>) operator(&)ident(_image) operator(\)) operator({}) -operator(};) diff --git a/test/scanners/cpp/wedekind.in.cpp b/test/scanners/cpp/wedekind.in.cpp deleted file mode 100644 index 68b0dba..0000000 --- a/test/scanners/cpp/wedekind.in.cpp +++ /dev/null @@ -1,12 +0,0 @@ -template< typename T > -T plus( const &T x ) -{ - return -x; -} - -template< typename T > -class image -{ -public: - image( const image< T > &_image ) {} -}; diff --git a/test/scanners/css/S5.expected.raydebug b/test/scanners/css/S5.expected.raydebug deleted file mode 100644 index 31f98ad..0000000 --- a/test/scanners/css/S5.expected.raydebug +++ /dev/null @@ -1,241 +0,0 @@ -comment(/*) comment(The) comment(following) comment(styles) comment(size) comment(and) comment(place) comment(the) comment(slide) comment(components.) - comment(Edit) comment(them) comment(if) comment(you) comment(want) comment(to) comment(change) comment(the) comment(overall) comment(slide) comment(layout.) - comment(The) comment(commented) comment(lines) comment(can) comment(be) comment(uncommented) comment((and) comment(modified,) comment(if) comment(necessary\)) - comment(to) comment(help) comment(you) comment(with) comment(the) comment(rearrangement) comment(process.) comment(*/) - -type(div)constant(#header)operator(,) type(div)constant(#footer)operator(,) type(div)class(.slide) operator({)key(width)operator(:) float(100%)operator(;) key(top)operator(:) float(0)operator(;) key(left)operator(:) float(0)operator(;)operator(}) -type(div)constant(#header) operator({)key(top)operator(:) float(0)operator(;) key(left)operator(:) float(0)operator(;) key(z-index)operator(:) float(1)operator(;)operator(}) -type(div)constant(#footer) operator({)key(top)operator(:) value(auto)operator(;) key(bottom)operator(:) float(0)operator(;) key(width)operator(:) float(100%)operator(;) key(z-index)operator(:) float(5)operator(;)operator(}) -type(div)class(.slide) operator({)key(top)operator(:) float(0)operator(;) key(width)operator(:) float(88%)operator(;) key(padding)operator(:) float(1em) float(7%) float(2em) float(5%)operator(;) key(z-index)operator(:) float(2)operator(;)operator(}) - -constant(#footer) type(div)constant(#controls) operator({)key(bottom)operator(:) float(1.5em)operator(;) key(left)operator(:) float(0)operator(;) key(width)operator(:) float(100%)operator(;) key(text-align)operator(:) value(center)operator(;) key(z-index)operator(:) float(1)operator(;)operator(}) -type(div)constant(#controls) type(form) operator({)key(margin)operator(:) float(0)operator(;) key(padding)operator(:) float(0)operator(;)operator(}) - -constant(#currentSlide) operator({)key(position)operator(:) value(absolute)operator(;) key(left)operator(:) float(0)operator(;) key(bottom)operator(:) float(0.5em)operator(;) key(z-index)operator(:) float(10)operator(;) - key(width)operator(:) float(100%)operator(;) key(text-align)operator(:) value(center)operator(;)operator(}) -type(html)operator(>)type(body) constant(#currentSlide) operator({)key(position)operator(:) value(fixed)operator(;)operator(}) - -comment(/*) -comment(div#header) comment({background:) comment(#FCC;}) -comment(div#footer) comment({background:) comment(#CCF;}) -comment(div#controls) comment({background:) comment(#BBD;}) -comment(div#currentSlide) comment({background:) comment(#FFC;}) -comment(*/) -comment(/*) comment(Following) comment(are) comment(the) comment(note) comment(styles) comment(--) comment(edit) comment(away!) comment(*/) - -type(body) operator({) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(1.0em)operator(;) - key(background)operator(:) color(#333)operator(;) - key(color)operator(:) color(#FFF)operator(;) - key(font)operator(:) float(2em)operator(/)float(1.4em) stringoperator(,) value(Verdana)operator(,) value(sans-serif)operator(;) -operator(}) - -type(div)class(.timers) operator({) - key(background)operator(:) color(#FFF)operator(;) - key(color)operator(:) color(#333)operator(;) - key(border)operator(:) float(0.08em) value(solid) color(#222)operator(;) - key(border-top-width)operator(:) float(1px)operator(;) - key(border-left-width)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(padding)operator(:) float(0.2em)operator(;) - key(margin)operator(:) float(0) float(0) float(0.5em)operator(;) - key(position)operator(:) value(relative)operator(;) -operator(}) - -type(div)class(.timers) type(h1) operator({) - key(text-align)operator(:) value(left)operator(;) - key(font-size)operator(:) float(0.6em)operator(;) - key(line-height)operator(:) float(1.4em)operator(;) - key(background-color)operator(:) color(#FF9)operator(;) - key(padding)operator(:) float(0) float(0.75em)operator(;) - key(margin)operator(:) float(0.25em) float(0) float(0)operator(;) - key(border)operator(:) float(1px) value(solid) color(#EE8)operator(;) -operator(}) - -type(div)class(.timers) type(div)class(.controls) operator({) - key(position)operator(:) value(absolute)operator(;) - key(right)operator(:) float(0.25em)operator(;) - key(top)operator(:) float(0.1em)operator(;) - key(line-height)operator(:) float(1em)operator(;) -operator(}) - -type(div)class(.timers) type(h1) type(a) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(color)operator(:) color(#000)operator(;) -operator(}) - -type(div)class(.timers) type(div)class(.controls) type(a) operator({) - key(font-size)operator(:) float(0.5em)operator(;) - key(padding)operator(:) float(0)operator(;) - key(color)operator(:) color(#330)operator(;) -operator(}) - -type(div)class(.timers) type(a)class(.control) operator({) - key(position)operator(:) value(absolute)operator(;) - key(text-decoration)operator(:) value(none)operator(;) - key(padding)operator(:) float(0) float(0.25em)operator(;) - key(color)operator(:) color(#AAA)operator(;) - key(outline)operator(:) float(0)operator(;) -operator(}) - -constant(#minus) operator({) - key(left)operator(:) float(0.25em)operator(;) -operator(}) - -constant(#plus) operator({) - key(right)operator(:) float(0.25em)operator(;) -operator(}) - -class(.overtime) operator({) - key(background)operator(:) value(yellow)operator(;) - key(color)operator(:) value(red)operator(;) - key(border)operator(:) float(3px) value(solid)operator(;) - key(padding)operator(:) float(0.1em) float(0.25em)operator(;) - key(font-weight)operator(:) value(bold)operator(;) -operator(}) - -type(div)class(.timers) type(h2) operator({) - key(font-size)operator(:) float(0.6em)operator(;) - key(line-height)operator(:) float(1.0em)operator(;) - key(font-weight)operator(:) value(normal)operator(;) - key(margin)operator(:) float(0) float(0) float(-0.25em)operator(;) - key(padding-top)operator(:) float(0.5em)operator(;) - key(color)operator(:) color(#666)operator(;) -operator(}) - -type(div)class(.timers) type(p) operator({)key(margin)operator(:) float(0)operator(;) key(padding)operator(:) float(0) float(0.5em)operator(;)operator(}) -type(div)class(.timers) type(form) operator({)key(margin)operator(:) float(0)operator(;)operator(}) - -type(div)class(.timers) type(span)class(.clock) operator({) - key(font-family)operator(:) value(monospace)operator(;) -operator(}) - -type(div)class(.timers) type(ul) operator({)key(margin)operator(:) float(0)operator(;) key(padding)operator(:) float(0)operator(;) key(list-style)operator(:) value(none)operator(;)operator(}) -type(div)class(.timers) type(li) operator({)key(float)operator(:) value(left)operator(;) key(width)operator(:) float(5em)operator(;) key(margin)operator(:) float(0)operator(;) key(padding)operator(:) float(0) float(0.5em)operator(;) - key(text-align)operator(:) value(center)operator(;)operator(}) - -type(div)constant(#elapsed) operator({)key(width)operator(:) float(12.1em)operator(;)operator(}) -type(div)constant(#remaining) operator({)key(clear)operator(:) value(left)operator(;) key(width)operator(:) float(12.1em)operator(;)operator(}) -type(div)constant(#remaining) type(p) operator({)key(text-align)operator(:) value(center)operator(;)operator(}) - -constant(#slide)operator(,) -constant(#next)operator(,) -constant(#notes)operator(,) -constant(#nextnotes) operator({) - key(font-size)operator(:) float(0.75em)operator(;) - key(line-height)operator(:) float(1.4em)operator(;) - key(clear)operator(:) value(left)operator(;) -comment(/*) comment(max-width:) comment(30.0em;) comment(*/) - key(text-shadow)operator(:) float(0.1em) float(0.1em) float(0.1em) color(#111)operator(;) -operator(}) - -constant(#next) operator({)key(margin-top)operator(:) float(2.5em)operator(;)operator(}) -constant(#next)operator(,) constant(#nextnotes) operator({) - key(color)operator(:) color(#999)operator(;) - key(font-size)operator(:) float(0.66em)operator(;) -operator(}) - -type(em)class(.disclaimer) operator({) - key(color)operator(:) color(#666)operator(;) -operator(}) - -type(div)class(.collapsed) type(h1) operator({)key(display)operator(:) value(block)operator(;) key(font-size)operator(:) float(0.33em)operator(;)operator(}) -type(div)class(.collapsed) type(h1) type(a) operator({)key(display)operator(:) value(inline)operator(;)operator(}) -type(div)class(.collapsed) type(*) operator({)key(display)operator(:) value(none)operator(;)operator(}) -comment(/*) comment(DO) comment(NOT) comment(CHANGE) comment(THESE) comment(unless) comment(you) comment(really) comment(want) comment(to) comment(break) comment(Opera) comment(Show) comment(*/) -class(.slide) operator({) - key(visibility)operator(:) value(visible) important(!important)operator(;) - key(position)operator(:) value(static) important(!important)operator(;) - key(page-break-before)operator(:) value(always)operator(;) -operator(}) -constant(#slide0) operator({)key(page-break-before)operator(:) value(avoid)operator(;)operator(}) -comment(/*) comment(don't) comment(change) comment(this) comment(unless) comment(you) comment(want) comment(the) comment(layout) comment(stuff) comment(to) comment(show) comment(up) comment(in) comment(the) comment(outline) comment(view!) comment(*/) - -class(.layout) type(div)operator(,) constant(#footer) type(*)operator(,) constant(#controlForm) type(*) operator({)key(display)operator(:) value(none)operator(;)operator(}) -constant(#footer)operator(,) constant(#controls)operator(,) constant(#controlForm)operator(,) constant(#navLinks)operator(,) constant(#toggle) operator({) - key(display)operator(:) value(block)operator(;) key(visibility)operator(:) value(visible)operator(;) key(margin)operator(:) float(0)operator(;) key(padding)operator(:) float(0)operator(;)operator(}) -constant(#toggle) operator({)key(float)operator(:) value(right)operator(;) key(padding)operator(:) float(0.5em)operator(;)operator(}) -type(html)operator(>)type(body) constant(#toggle) operator({)key(position)operator(:) value(fixed)operator(;) key(top)operator(:) float(0)operator(;) key(right)operator(:) float(0)operator(;)operator(}) - -comment(/*) comment(making) comment(the) comment(outline) comment(look) comment(pretty-ish) comment(*/) - -constant(#slide0) type(h1)operator(,) constant(#slide0) type(h2)operator(,) constant(#slide0) type(h3)operator(,) constant(#slide0) type(h4) operator({)key(border)operator(:) value(none)operator(;) key(margin)operator(:) float(0)operator(;)operator(}) -constant(#slide0) type(h1) operator({)key(padding-top)operator(:) float(1.5em)operator(;)operator(}) -class(.slide) type(h1) operator({)key(margin)operator(:) float(1.5em) float(0) float(0)operator(;) key(padding-top)operator(:) float(0.25em)operator(;) - key(border-top)operator(:) float(1px) value(solid) color(#888)operator(;) key(border-bottom)operator(:) float(1px) value(solid) color(#AAA)operator(;)operator(}) -constant(#toggle) operator({)key(border)operator(:) float(1px) value(solid)operator(;) key(border-width)operator(:) float(0) float(0) float(1px) float(1px)operator(;) key(background)operator(:) color(#FFF)operator(;)operator(}) -comment(/*) comment(Following) comment(are) comment(the) comment(presentation) comment(styles) comment(--) comment(edit) comment(away!) - comment(Note) comment(that) comment(the) comment('body') comment(font) comment(size) comment(may) comment(have) comment(to) comment(be) comment(changed) comment(if) comment(the) comment(resolution) comment(is) - comment(different) comment(than) comment(expected.) comment(*/) - -type(body) operator({)key(background)operator(:) color(#95A7D4) string float(100%) float(100%) value(no-repeat)operator(;) key(color)operator(:) color(#210)operator(;) key(font)operator(:) float(29px) value(Arial)operator(,) value(sans-serif)operator(;)operator(}) -type(a) operator({)key(text-decoration)operator(:) value(none)operator(;) key(color)operator(:) color(#336)operator(;) key(border-bottom)operator(:) float(1px) value(dotted)operator(;)operator(}) -type(h1)operator(,) type(h2)operator(,) type(h3)operator(,) type(h4)operator(,) type(h5)operator(,) type(h6) operator({)key(font-size)operator(:) float(1em)operator(;) key(margin)operator(:) float(0)operator(;)operator(}) -type(sup) operator({)key(font-size)operator(:) float(0.75em)operator(;) key(font-weight)operator(:) value(normal)operator(;) - key(vertical-align)operator(:) float(0.5em)operator(;) key(line-height)operator(:) float(1px)operator(;)operator(}) -type(ul) operator({)key(margin-left)operator(:) float(1em)operator(;) key(padding-left)operator(:) float(0)operator(;)operator(}) -type(li) operator({)key(margin-bottom)operator(:) float(0.66em)operator(;)operator(}) -type(li) type(li) operator({)key(margin)operator(:) float(0.33em) float(0)operator(;) key(font-size)operator(:) value(smaller)operator(;)operator(}) - -constant(#header) operator({)key(background)operator(:) stringoperator(;) key(border-bottom)operator(:) float(1px) value(solid) color(#333)operator(;) - key(padding-bottom)operator(:) float(2em)operator(;)operator(}) -constant(#footer) operator({)key(background)operator(:) stringoperator(;) key(color)operator(:) color(#BBB)operator(;) key(border-top)operator(:) float(1px) value(solid) color(#333)operator(;)operator(}) -constant(#header)operator(,) constant(#footer) operator({)key(font-size)operator(:) float(0.5em)operator(;)operator(}) -constant(#footer) type(h1)operator(,) constant(#footer) type(h2) operator({) key(padding)operator(:) float(0.5em) float(0.75em)operator(;) - key(font-weight)operator(:) value(normal)operator(;) key(font-style)operator(:) value(italic)operator(;)operator(}) -constant(#footer) type(h1) operator({)key(left)operator(:) float(0)operator(;) key(font-size)operator(:) float(1em)operator(;) key(letter-spacing)operator(:) float(1px)operator(;)operator(}) -constant(#footer) type(h2) operator({)key(position)operator(:) value(absolute)operator(;) key(bottom)operator(:) float(0)operator(;) key(right)operator(:) float(0)operator(;)operator(}) - -constant(#controls) type(a) operator({)key(display)operator(:) value(none)operator(;)operator(}) -constant(#controls) type(select) operator({)key(visibility)operator(:) value(hidden)operator(;)operator(}) -constant(#controls) type(div)pseudo_class(:hover) type(select) operator({)key(visibility)operator(:) value(visible)operator(;)operator(}) - -constant(#currentSlide) operator({)key(font-size)operator(:) float(0.5em)operator(;)operator(}) -constant(#currentSlide) type(span) operator({)key(font-size)operator(:) float(13px)operator(;) key(color)operator(:) color(rgb(49%,47%,66%\))operator(;)operator(}) -constant(#currentSlide) constant(#csSep) operator({)key(display)operator(:) value(none)operator(;)operator(}) -constant(#currentSlide) constant(#csHere) operator({)key(font-weight)operator(:) value(bold)operator(;)operator(}) -constant(#currentSlide) constant(#csHere)pseudo_class(:before) operator({)key(content)operator(:) stringoperator(;) key(font-weight)operator(:) value(normal)operator(;)operator(}) -constant(#currentSlide) constant(#csTotal)pseudo_class(:before) operator({)key(content)operator(:) stringoperator(;)operator(}) - -class(.slide) type(h1) operator({)key(font-size)operator(:) float(1.66em)operator(;) key(line-height)operator(:) float(1)operator(;) key(letter-spacing)operator(:) float(-1px)operator(;) - key(margin)operator(:) float(0) float(-15%) float(1em) float(0)operator(;) key(padding)operator(:) float(0.25em) float(15%) float(0.06125em) float(0)operator(;) key(border-bottom)operator(:) float(0.06125em) value(solid) color(rgb(90,94,120\))operator(;)operator(}) -constant(#slide0) type(h1) operator({)key(border)operator(:) value(none)operator(;) key(font-size)operator(:) float(2.25em)operator(;) key(letter-spacing)operator(:) float(0)operator(;) key(margin)operator(:) float(3em) float(0) float(1.5em)operator(;)operator(}) -constant(#slide0) type(h3) operator({)key(margin-bottom)operator(:) float(0)operator(;)operator(}) -constant(#slide0) type(h4) operator({)key(margin-top)operator(:) float(0)operator(;) key(font-size)operator(:) value(smaller)operator(;)operator(}) -comment(/*) comment(The) comment(following) comment(rule) comment(is) comment(necessary) comment(to) comment(have) comment(all) comment(slides) comment(appear) comment(in) comment(print!) comment(DO) comment(NOT) comment(REMOVE) comment(IT!) comment(*/) -class(.slide)operator(,) type(ul) operator({)key(page-break-inside)operator(:) value(avoid)operator(;) key(visibility)operator(:) value(visible) important(!important)operator(;)operator(}) -type(h1) operator({)key(page-break-after)operator(:) value(avoid)operator(;)operator(}) - -type(body) operator({)key(font-size)operator(:) float(12pt)operator(;) key(background)operator(:) value(white)operator(;)operator(}) -type(*) operator({)key(color)operator(:) value(black)operator(;)operator(}) - -constant(#slide0) type(h1) operator({)key(font-size)operator(:) float(200%)operator(;) key(border)operator(:) value(none)operator(;) key(margin)operator(:) float(0.5em) float(0) float(0.25em)operator(;)operator(}) -constant(#slide0) type(h3) operator({)key(margin)operator(:) float(0)operator(;) key(padding)operator(:) float(0)operator(;)operator(}) -constant(#slide0) type(h4) operator({)key(margin)operator(:) float(0) float(0) float(0.5em)operator(;) key(padding)operator(:) float(0)operator(;)operator(}) -constant(#slide0) operator({)key(margin-bottom)operator(:) float(3em)operator(;)operator(}) - -type(h1) operator({)key(border-top)operator(:) float(2pt) value(solid) value(gray)operator(;) key(border-bottom)operator(:) float(1px) value(dotted) value(silver)operator(;)operator(}) -class(.extra) operator({)key(background)operator(:) value(transparent) important(!important)operator(;)operator(}) -type(div)class(.extra)operator(,) type(pre)class(.extra)operator(,) class(.example) operator({)key(font-size)operator(:) float(10pt)operator(;) key(color)operator(:) color(#333)operator(;)operator(}) -type(ul)class(.extra) type(a) operator({)key(font-weight)operator(:) value(bold)operator(;)operator(}) -type(p)class(.example) operator({)key(display)operator(:) value(none)operator(;)operator(}) - -constant(#header) operator({)key(display)operator(:) value(none)operator(;)operator(}) -constant(#footer) type(h1) operator({)key(margin)operator(:) float(0)operator(;) key(border-bottom)operator(:) float(1px) value(solid)operator(;) key(color)operator(:) value(gray)operator(;) key(font-style)operator(:) value(italic)operator(;)operator(}) -constant(#footer) type(h2)operator(,) constant(#controls) operator({)key(display)operator(:) value(none)operator(;)operator(}) - -comment(/*) comment(The) comment(following) comment(rule) comment(keeps) comment(the) comment(layout) comment(stuff) comment(out) comment(of) comment(print.) comment(Remove) comment(at) comment(your) comment(own) comment(risk!) comment(*/) -class(.layout)operator(,) class(.layout) type(*) operator({)key(display)operator(:) value(none) important(!important)operator(;)operator(}) -comment(/*) comment(Do) comment(not) comment(edit) comment(or) comment(override) comment(these) comment(styles!) comment(The) comment(system) comment(will) comment(likely) comment(break) comment(if) comment(you) comment(do.) comment(*/) - -type(div)constant(#header)operator(,) type(div)constant(#footer)operator(,) type(div)class(.slide) operator({)key(position)operator(:) value(absolute)operator(;)operator(}) -type(html)operator(>)type(body) type(div)constant(#header)operator(,) type(html)operator(>)type(body) type(div)constant(#footer)operator(,) type(html)operator(>)type(body) type(div)class(.slide) operator({)key(position)operator(:) value(fixed)operator(;)operator(}) -type(div)class(.slide) operator({)key(visibility)operator(:) value(hidden)operator(;)operator(}) -constant(#slide0) operator({)key(visibility)operator(:) value(visible)operator(;)operator(}) -type(div)constant(#controls) operator({)key(position)operator(:) value(absolute)operator(;)operator(}) -constant(#footer)operator(>)type(div)constant(#controls) operator({)key(position)operator(:) value(fixed)operator(;)operator(}) -class(.handout) operator({)key(display)operator(:) value(none)operator(;)operator(}) -directive(@import) stringoperator(;) comment(/*) comment(required) comment(to) comment(make) comment(the) comment(slide) comment(show) comment(run) comment(at) comment(all) comment(*/) -directive(@import) stringoperator(;) comment(/*) comment(sets) comment(basic) comment(placement) comment(and) comment(size) comment(of) comment(slide) comment(components) comment(*/) -directive(@import) stringoperator(;) comment(/*) comment(stuff) comment(that) comment(makes) comment(the) comment(slides) comment(look) comment(better) comment(than) comment(blah) comment(*/) \ No newline at end of file diff --git a/test/scanners/css/S5.in.css b/test/scanners/css/S5.in.css deleted file mode 100644 index 02fcd8b..0000000 --- a/test/scanners/css/S5.in.css +++ /dev/null @@ -1,217 +0,0 @@ -/* The following styles size and place the slide components. - Edit them if you want to change the overall slide layout. - The commented lines can be uncommented (and modified, if necessary) - to help you with the rearrangement process. */ - -div#header, div#footer, div.slide {width: 100%; top: 0; left: 0;} -div#header {top: 0; left: 0; z-index: 1;} -div#footer {top: auto; bottom: 0; width: 100%; z-index: 5;} -div.slide {top: 0; width: 88%; padding: 1em 7% 2em 5%; z-index: 2;} - -#footer div#controls {bottom: 1.5em; left: 0; width: 100%; text-align: center; z-index: 1;} -div#controls form {margin: 0; padding: 0;} - -#currentSlide {position: absolute; left: 0; bottom: 0.5em; z-index: 10; - width: 100%; text-align: center;} -html>body #currentSlide {position: fixed;} - -/* -div#header {background: #FCC;} -div#footer {background: #CCF;} -div#controls {background: #BBD;} -div#currentSlide {background: #FFC;} -*/ -/* Following are the note styles -- edit away! */ - -body { - margin: 0; - padding: 1.0em; - background: #333; - color: #FFF; - font: 2em/1.4em 'Lucida Grande', Verdana, sans-serif; -} - -div.timers { - background: #FFF; - color: #333; - border: 0.08em solid #222; - border-top-width: 1px; - border-left-width: 1px; - float: left; - padding: 0.2em; - margin: 0 0 0.5em; - position: relative; -} - -div.timers h1 { - text-align: left; - font-size: 0.6em; - line-height: 1.4em; - background-color: #FF9; - padding: 0 0.75em; - margin: 0.25em 0 0; - border: 1px solid #EE8; -} - -div.timers div.controls { - position: absolute; - right: 0.25em; - top: 0.1em; - line-height: 1em; -} - -div.timers h1 a { - text-decoration: none; - color: #000; -} - -div.timers div.controls a { - font-size: 0.5em; - padding: 0; - color: #330; -} - -div.timers a.control { - position: absolute; - text-decoration: none; - padding: 0 0.25em; - color: #AAA; - outline: 0; -} - -#minus { - left: 0.25em; -} - -#plus { - right: 0.25em; -} - -.overtime { - background: yellow; - color: red; - border: 3px solid; - padding: 0.1em 0.25em; - font-weight: bold; -} - -div.timers h2 { - font-size: 0.6em; - line-height: 1.0em; - font-weight: normal; - margin: 0 0 -0.25em; - padding-top: 0.5em; - color: #666; -} - -div.timers p {margin: 0; padding: 0 0.5em;} -div.timers form {margin: 0;} - -div.timers span.clock { - font-family: monospace; -} - -div.timers ul {margin: 0; padding: 0; list-style: none;} -div.timers li {float: left; width: 5em; margin: 0; padding: 0 0.5em; - text-align: center;} - -div#elapsed {width: 12.1em;} -div#remaining {clear: left; width: 12.1em;} -div#remaining p {text-align: center;} - -#slide, -#next, -#notes, -#nextnotes { - font-size: 0.75em; - line-height: 1.4em; - clear: left; -/* max-width: 30.0em; */ - text-shadow: 0.1em 0.1em 0.1em #111; -} - -#next {margin-top: 2.5em;} -#next, #nextnotes { - color: #999; - font-size: 0.66em; -} - -em.disclaimer { - color: #666; -} - -div.collapsed h1 {display: block; font-size: 0.33em;} -div.collapsed h1 a {display: inline;} -div.collapsed * {display: none;} -/* DO NOT CHANGE THESE unless you really want to break Opera Show */ -.slide { - visibility: visible !important; - position: static !important; - page-break-before: always; -} -#slide0 {page-break-before: avoid;} -/* don't change this unless you want the layout stuff to show up in the outline view! */ - -.layout div, #footer *, #controlForm * {display: none;} -#footer, #controls, #controlForm, #navLinks, #toggle { - display: block; visibility: visible; margin: 0; padding: 0;} -#toggle {float: right; padding: 0.5em;} -html>body #toggle {position: fixed; top: 0; right: 0;} - -/* making the outline look pretty-ish */ - -#slide0 h1, #slide0 h2, #slide0 h3, #slide0 h4 {border: none; margin: 0;} -#slide0 h1 {padding-top: 1.5em;} -.slide h1 {margin: 1.5em 0 0; padding-top: 0.25em; - border-top: 1px solid #888; border-bottom: 1px solid #AAA;} -#toggle {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;} -/* Following are the presentation styles -- edit away! - Note that the 'body' font size may have to be changed if the resolution is - different than expected. */ - -body {background: #95A7D4 url(bg-slide.jpg) 100% 100% no-repeat; color: #210; font: 29px Arial, sans-serif;} -a {text-decoration: none; color: #336; border-bottom: 1px dotted;} -h1, h2, h3, h4, h5, h6 {font-size: 1em; margin: 0;} -sup {font-size: 0.75em; font-weight: normal; - vertical-align: 0.5em; line-height: 1px;} -ul {margin-left: 1em; padding-left: 0;} -li {margin-bottom: 0.66em;} -li li {margin: 0.33em 0; font-size: smaller;} - -#header {background: url(bg-shade.png); border-bottom: 1px solid #333; - padding-bottom: 2em;} -#footer {background: url(bg-shade.png); color: #BBB; border-top: 1px solid #333;} -#header, #footer {font-size: 0.5em;} -#footer h1, #footer h2 { padding: 0.5em 0.75em; - font-weight: normal; font-style: italic;} -#footer h1 {left: 0; font-size: 1em; letter-spacing: 1px;} -#footer h2 {position: absolute; bottom: 0; right: 0;} - -#controls a {display: none;} -#controls select {visibility: hidden;} -#controls div:hover select {visibility: visible;} - -#currentSlide {font-size: 0.5em;} -#currentSlide span {font-size: 13px; color: rgb(49%,47%,66%);} -#currentSlide #csSep {display: none;} -#currentSlide #csHere {font-weight: bold;} -#currentSlide #csHere:before {content: "#"; font-weight: normal;} -#currentSlide #csTotal:before {content: " of ";} - -.slide h1 {font-size: 1.66em; line-height: 1; letter-spacing: -1px; - margin: 0 -15% 1em 0; padding: 0.25em 15% 0.06125em 0; border-bottom: 0.06125em solid rgb(90,94,120);} -#slide0 h1 {border: none; font-size: 2.25em; letter-spacing: 0; margin: 3em 0 1.5em;} -#slide0 h3 {margin-bottom: 0;} -#slide0 h4 {margin-top: 0; font-size: smaller;} -/* The following rule is necessary to have all slides appear in print! DO NOT REMOVE IT! */ .slide, ul {page-break-inside: avoid; visibility: visible !important;} h1 {page-break-after: avoid;} body {font-size: 12pt; background: white;} * {color: black;} #slide0 h1 {font-size: 200%; border: none; margin: 0.5em 0 0.25em;} #slide0 h3 {margin: 0; padding: 0;} #slide0 h4 {margin: 0 0 0.5em; padding: 0;} #slide0 {margin-bottom: 3em;} h1 {border-top: 2pt solid gray; border-bottom: 1px dotted silver;} .extra {background: transparent !important;} div.extra, pre.extra, .example {font-size: 10pt; color: #333;} ul.extra a {font-weight: bold;} p.example {display: none;} #header {display: none;} #footer h1 {margin: 0; border-bottom: 1px solid; color: gray; font-style: italic;} #footer h2, #controls {display: none;} /* The following rule keeps the layout stuff out of print. Remove at your own risk! */ .layout, .layout * {display: none !important;} /* Do not edit or override these styles! The system will likely break if you do. */ - -div#header, div#footer, div.slide {position: absolute;} -html>body div#header, html>body div#footer, html>body div.slide {position: fixed;} -div.slide {visibility: hidden;} -#slide0 {visibility: visible;} -div#controls {position: absolute;} -#footer>div#controls {position: fixed;} -.handout {display: none;} -@import url(s5-core.css); /* required to make the slide show run at all */ -@import url(framing.css); /* sets basic placement and size of slide components */ -@import url(pretty.css); /* stuff that makes the slides look better than blah */ \ No newline at end of file diff --git a/test/scanners/css/coderay.expected.raydebug b/test/scanners/css/coderay.expected.raydebug deleted file mode 100644 index 0841f19..0000000 --- a/test/scanners/css/coderay.expected.raydebug +++ /dev/null @@ -1,124 +0,0 @@ -class(.CodeRay) class(.line_numbers) type(a)operator(,) class(.CodeRay) class(.no) type(a) operator({) - key(text-decoration)operator(:) value(inherit)operator(;) - key(color)operator(:) value(inherit)operator(;) -operator(}) -class(.CodeRay) operator({) - key(background-color)operator(:) color(#f8f8f8)operator(;) - key(border)operator(:) float(1px) value(solid) value(silver)operator(;) - key(font-family)operator(:) stringoperator(,) stringoperator(,) value(monospace)operator(;) - key(color)operator(:) color(#000)operator(;) -operator(}) -class(.CodeRay) type(pre) operator({) key(margin)operator(:) float(0px)operator(;) operator(}) - -type(span)class(.CodeRay) operator({) key(white-space)operator(:) value(pre)operator(;) key(border)operator(:) float(0px)operator(;) key(padding)operator(:) float(2px)operator(;) operator(}) - -type(table)class(.CodeRay) operator({) key(border-collapse)operator(:) value(collapse)operator(;) key(width)operator(:) float(100%)operator(;) key(padding)operator(:) float(2px)operator(;) operator(}) -type(table)class(.CodeRay) type(td) operator({) key(padding)operator(:) float(2px) float(4px)operator(;) key(vertical-align)operator(:) value(top)operator(;) operator(}) - -class(.CodeRay) class(.line_numbers)operator(,) class(.CodeRay) class(.no) operator({) - key(background-color)operator(:) color(#def)operator(;) - key(color)operator(:) value(gray)operator(;) - key(text-align)operator(:) value(right)operator(;) -operator(}) -class(.CodeRay) class(.line_numbers) type(a)pseudo_class(:target)operator(,) class(.CodeRay) class(.no) type(a)pseudo_class(:target) operator({) key(color)operator(:) value(blue)operator(;) operator(}) -class(.CodeRay) class(.line_numbers) class(.highlighted)operator(,) class(.CodeRay) class(.no) class(.highlighted) operator({) key(color)operator(:) value(red)operator(;) operator(}) -class(.CodeRay) class(.no) operator({) key(padding)operator(:) float(0px) float(4px)operator(;) operator(}) -class(.CodeRay) class(.code) operator({) key(width)operator(:) float(100%)operator(;) operator(}) -class(.CodeRay) class(.code) type(pre) operator({) key(overflow)operator(:) value(auto)operator(;) operator(}) - -class(.CodeRay) class(.debug) operator({) key(color)operator(:)value(white) important(! important)operator(;) key(background)operator(:)value(blue) important(! important)operator(;) operator(}) - -class(.CodeRay) class(.an) operator({) key(color)operator(:)color(#007) operator(}) -class(.CodeRay) class(.at) operator({) key(color)operator(:)color(#f08) operator(}) -class(.CodeRay) class(.av) operator({) key(color)operator(:)color(#700) operator(}) -class(.CodeRay) class(.bi) operator({) key(color)operator(:)color(#509)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.c) operator({) key(color)operator(:)color(#888)operator(;) operator(}) -class(.CodeRay) class(.c) class(.dl) operator({) key(color)operator(:)color(#444)operator(;) operator(}) -class(.CodeRay) class(.c) class(.ch) operator({) key(color)operator(:)color(#444)operator(;) operator(}) - -class(.CodeRay) class(.ch) operator({) key(color)operator(:)color(#04D) operator(}) -class(.CodeRay) class(.ch) class(.k) operator({) key(color)operator(:)color(#04D) operator(}) -class(.CodeRay) class(.ch) class(.dl) operator({) key(color)operator(:)color(#039) operator(}) - -class(.CodeRay) class(.cl) operator({) key(color)operator(:)color(#B06)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.cm) operator({) key(color)operator(:)color(#A08)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.co) operator({) key(color)operator(:)color(#036)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.cr) operator({) key(color)operator(:)color(#0A0) operator(}) -class(.CodeRay) class(.cv) operator({) key(color)operator(:)color(#369) operator(}) -class(.CodeRay) class(.de) operator({) key(color)operator(:)color(#B0B)operator(;) operator(}) -class(.CodeRay) class(.df) operator({) key(color)operator(:)color(#099)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.di) operator({) key(color)operator(:)color(#088)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.dl) operator({) key(color)operator(:)value(black) operator(}) -class(.CodeRay) class(.do) operator({) key(color)operator(:)color(#970) operator(}) -class(.CodeRay) class(.dt) operator({) key(color)operator(:)color(#34b) operator(}) -class(.CodeRay) class(.ds) operator({) key(color)operator(:)color(#D42)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.e) operator({) key(color)operator(:)color(#666)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.en) operator({) key(color)operator(:)color(#800)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.er) operator({) key(color)operator(:)color(#F00)operator(;) key(background-color)operator(:)color(#FAA) operator(}) -class(.CodeRay) class(.ex) operator({) key(color)operator(:)color(#C00)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.fl) operator({) key(color)operator(:)color(#60E)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.fu) operator({) key(color)operator(:)color(#06B)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.gv) operator({) key(color)operator(:)color(#d70)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.hx) operator({) key(color)operator(:)color(#058)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.i) operator({) key(color)operator(:)color(#00D)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.ic) operator({) key(color)operator(:)color(#B44)operator(;) key(font-weight)operator(:)value(bold) operator(}) - -class(.CodeRay) class(.il) operator({) key(background-color)operator(:) color(hsla(0,0%,0%,0.1\))operator(;) key(color)operator(:) value(black) operator(}) -class(.CodeRay) class(.il) class(.idl) operator({) key(font-weight)operator(:) value(bold)operator(;) key(color)operator(:) color(#666) operator(}) -class(.CodeRay) class(.idl) operator({) key(font-weight)operator(:) value(bold)operator(;) key(color)operator(:) color(#666)operator(;) operator(}) - -class(.CodeRay) class(.im) operator({) key(color)operator(:)color(#f00)operator(;) operator(}) -class(.CodeRay) class(.in) operator({) key(color)operator(:)color(#B2B)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.iv) operator({) key(color)operator(:)color(#33B) operator(}) -class(.CodeRay) class(.la) operator({) key(color)operator(:)color(#970)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.lv) operator({) key(color)operator(:)color(#963) operator(}) -class(.CodeRay) class(.ns) operator({) key(color)operator(:)color(#707)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.oc) operator({) key(color)operator(:)color(#40E)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.op) operator({) operator(}) -class(.CodeRay) class(.pc) operator({) key(color)operator(:)color(#058)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.pd) operator({) key(color)operator(:)color(#369)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.pp) operator({) key(color)operator(:)color(#579)operator(;) operator(}) -class(.CodeRay) class(.ps) operator({) key(color)operator(:)color(#00C)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.pt) operator({) key(color)operator(:)color(#074)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.r)operator(,) class(.kw) operator({) key(color)operator(:)color(#080)operator(;) key(font-weight)operator(:)value(bold) operator(}) - -class(.CodeRay) class(.ke) operator({) key(color)operator(:) color(#808)operator(;) operator(}) -class(.CodeRay) class(.ke) class(.dl) operator({) key(color)operator(:) color(#606)operator(;) operator(}) -class(.CodeRay) class(.ke) class(.ch) operator({) key(color)operator(:) color(#80f)operator(;) operator(}) -class(.CodeRay) class(.vl) operator({) key(color)operator(:) color(#088)operator(;) operator(}) - -class(.CodeRay) class(.rx) operator({) key(background-color)operator(:)color(hsla(300,100%,50%,0.1\))operator(;) key(color)operator(:)color(#808) operator(}) -class(.CodeRay) class(.rx) class(.k) operator({) operator(}) -class(.CodeRay) class(.rx) class(.dl) operator({) key(color)operator(:)color(#404) operator(}) -class(.CodeRay) class(.rx) class(.mod) operator({) key(color)operator(:)color(#C2C) operator(}) -class(.CodeRay) class(.rx) class(.fu) operator({) key(color)operator(:)color(#404)operator(;) key(font-weight)operator(:) value(bold) operator(}) - -class(.CodeRay) class(.s) operator({) key(background-color)operator(:)color(hsla(0,100%,50%,0.1\))operator(;) key(color)operator(:) color(#D20)operator(;) operator(}) -class(.CodeRay) class(.s) class(.k) operator({) operator(}) -class(.CodeRay) class(.s) class(.ch) operator({) key(color)operator(:) color(#b0b)operator(;) operator(}) -class(.CodeRay) class(.s) class(.dl) operator({) key(color)operator(:) color(#710)operator(;) operator(}) - -class(.CodeRay) class(.sh) operator({) key(background-color)operator(:)color(hsla(120,100%,50%,0.1\))operator(;) key(color)operator(:)color(#2B2) operator(}) -class(.CodeRay) class(.sh) class(.k) operator({) operator(}) -class(.CodeRay) class(.sh) class(.dl) operator({) key(color)operator(:)color(#161) operator(}) - -class(.CodeRay) class(.sy) operator({) key(color)operator(:)color(#A60) operator(}) -class(.CodeRay) class(.sy) class(.k) operator({) key(color)operator(:)color(#A60) operator(}) -class(.CodeRay) class(.sy) class(.dl) operator({) key(color)operator(:)color(#630) operator(}) - -class(.CodeRay) class(.ta) operator({) key(color)operator(:)color(#070) operator(}) -class(.CodeRay) class(.ts) operator({) key(color)operator(:)color(#D70)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.ty) operator({) key(color)operator(:)color(#339)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.v) operator({) key(color)operator(:)color(#036) operator(}) -class(.CodeRay) class(.xt) operator({) key(color)operator(:)color(#444) operator(}) - -class(.CodeRay) class(.ins) operator({) key(background)operator(:) color(#afa)operator(;) operator(}) -class(.CodeRay) class(.del) operator({) key(background)operator(:) color(#faa)operator(;) operator(}) -class(.CodeRay) class(.chg) operator({) key(color)operator(:) color(#aaf)operator(;) key(background)operator(:) color(#007)operator(;) operator(}) -class(.CodeRay) class(.head) operator({) key(color)operator(:) color(#f8f)operator(;) key(background)operator(:) color(#505) operator(}) -class(.CodeRay) class(.head) class(.filename) operator({) key(color)operator(:) value(white)operator(;) operator(}) - -class(.CodeRay) class(.ins) class(.ins) operator({) key(color)operator(:) color(#080)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.del) class(.del) operator({) key(color)operator(:) color(#800)operator(;) key(font-weight)operator(:)value(bold) operator(}) -class(.CodeRay) class(.chg) class(.chg) operator({) key(color)operator(:) color(#66f)operator(;) operator(}) -class(.CodeRay) class(.head) class(.head) operator({) key(color)operator(:) color(#f4f)operator(;) operator(}) diff --git a/test/scanners/css/coderay.in.css b/test/scanners/css/coderay.in.css deleted file mode 100644 index ccb5d4a..0000000 --- a/test/scanners/css/coderay.in.css +++ /dev/null @@ -1,124 +0,0 @@ -.CodeRay .line_numbers a, .CodeRay .no a { - text-decoration: inherit; - color: inherit; -} -.CodeRay { - background-color: #f8f8f8; - border: 1px solid silver; - font-family: 'Courier New', 'Terminal', monospace; - color: #000; -} -.CodeRay pre { margin: 0px; } - -span.CodeRay { white-space: pre; border: 0px; padding: 2px; } - -table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px; } -table.CodeRay td { padding: 2px 4px; vertical-align: top; } - -.CodeRay .line_numbers, .CodeRay .no { - background-color: #def; - color: gray; - text-align: right; -} -.CodeRay .line_numbers a:target, .CodeRay .no a:target { color: blue; } -.CodeRay .line_numbers .highlighted, .CodeRay .no .highlighted { color: red; } -.CodeRay .no { padding: 0px 4px; } -.CodeRay .code { width: 100%; } -.CodeRay .code pre { overflow: auto; } - -.CodeRay .debug { color:white ! important; background:blue ! important; } - -.CodeRay .an { color:#007 } -.CodeRay .at { color:#f08 } -.CodeRay .av { color:#700 } -.CodeRay .bi { color:#509; font-weight:bold } -.CodeRay .c { color:#888; } -.CodeRay .c .dl { color:#444; } -.CodeRay .c .ch { color:#444; } - -.CodeRay .ch { color:#04D } -.CodeRay .ch .k { color:#04D } -.CodeRay .ch .dl { color:#039 } - -.CodeRay .cl { color:#B06; font-weight:bold } -.CodeRay .cm { color:#A08; font-weight:bold } -.CodeRay .co { color:#036; font-weight:bold } -.CodeRay .cr { color:#0A0 } -.CodeRay .cv { color:#369 } -.CodeRay .de { color:#B0B; } -.CodeRay .df { color:#099; font-weight:bold } -.CodeRay .di { color:#088; font-weight:bold } -.CodeRay .dl { color:black } -.CodeRay .do { color:#970 } -.CodeRay .dt { color:#34b } -.CodeRay .ds { color:#D42; font-weight:bold } -.CodeRay .e { color:#666; font-weight:bold } -.CodeRay .en { color:#800; font-weight:bold } -.CodeRay .er { color:#F00; background-color:#FAA } -.CodeRay .ex { color:#C00; font-weight:bold } -.CodeRay .fl { color:#60E; font-weight:bold } -.CodeRay .fu { color:#06B; font-weight:bold } -.CodeRay .gv { color:#d70; font-weight:bold } -.CodeRay .hx { color:#058; font-weight:bold } -.CodeRay .i { color:#00D; font-weight:bold } -.CodeRay .ic { color:#B44; font-weight:bold } - -.CodeRay .il { background-color: hsla(0,0%,0%,0.1); color: black } -.CodeRay .il .idl { font-weight: bold; color: #666 } -.CodeRay .idl { font-weight: bold; color: #666; } - -.CodeRay .im { color:#f00; } -.CodeRay .in { color:#B2B; font-weight:bold } -.CodeRay .iv { color:#33B } -.CodeRay .la { color:#970; font-weight:bold } -.CodeRay .lv { color:#963 } -.CodeRay .ns { color:#707; font-weight:bold } -.CodeRay .oc { color:#40E; font-weight:bold } -.CodeRay .op { } -.CodeRay .pc { color:#058; font-weight:bold } -.CodeRay .pd { color:#369; font-weight:bold } -.CodeRay .pp { color:#579; } -.CodeRay .ps { color:#00C; font-weight:bold } -.CodeRay .pt { color:#074; font-weight:bold } -.CodeRay .r, .kw { color:#080; font-weight:bold } - -.CodeRay .ke { color: #808; } -.CodeRay .ke .dl { color: #606; } -.CodeRay .ke .ch { color: #80f; } -.CodeRay .vl { color: #088; } - -.CodeRay .rx { background-color:hsla(300,100%,50%,0.1); color:#808 } -.CodeRay .rx .k { } -.CodeRay .rx .dl { color:#404 } -.CodeRay .rx .mod { color:#C2C } -.CodeRay .rx .fu { color:#404; font-weight: bold } - -.CodeRay .s { background-color:hsla(0,100%,50%,0.1); color: #D20; } -.CodeRay .s .k { } -.CodeRay .s .ch { color: #b0b; } -.CodeRay .s .dl { color: #710; } - -.CodeRay .sh { background-color:hsla(120,100%,50%,0.1); color:#2B2 } -.CodeRay .sh .k { } -.CodeRay .sh .dl { color:#161 } - -.CodeRay .sy { color:#A60 } -.CodeRay .sy .k { color:#A60 } -.CodeRay .sy .dl { color:#630 } - -.CodeRay .ta { color:#070 } -.CodeRay .ts { color:#D70; font-weight:bold } -.CodeRay .ty { color:#339; font-weight:bold } -.CodeRay .v { color:#036 } -.CodeRay .xt { color:#444 } - -.CodeRay .ins { background: #afa; } -.CodeRay .del { background: #faa; } -.CodeRay .chg { color: #aaf; background: #007; } -.CodeRay .head { color: #f8f; background: #505 } -.CodeRay .head .filename { color: white; } - -.CodeRay .ins .ins { color: #080; font-weight:bold } -.CodeRay .del .del { color: #800; font-weight:bold } -.CodeRay .chg .chg { color: #66f; } -.CodeRay .head .head { color: #f4f; } diff --git a/test/scanners/css/demo.expected.raydebug b/test/scanners/css/demo.expected.raydebug deleted file mode 100644 index 4786176..0000000 --- a/test/scanners/css/demo.expected.raydebug +++ /dev/null @@ -1,55 +0,0 @@ -comment(/*) comment(See) comment(http://reference.sitepoint.com/css/content.) comment(*/) -directive(@media) type(print) operator({) - type(a)operator([)attribute_name(href)operator(])pseudo_class(:after) operator({) - key(content)operator(:) string string string)delimiter(")>operator(;) - operator(}) -operator(}) - -type(a)pseudo_class(:link)pseudo_class(:after)operator(,) type(a)pseudo_class(:visited)pseudo_class(:after) operator({)key(content)operator(:)string string stringoperator(;)key(font-size)operator(:)float(90%)operator(;)operator(}) -type(ol) operator({) - key(counter-reset)operator(:) value(item)operator(;) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(0)operator(;) -operator(}) -type(ol)operator(>)type(li) operator({) - key(counter-increment)operator(:) value(item)operator(;) - key(list-style)operator(:) value(none) value(inside)operator(;) -operator(}) -type(ol)operator(>)type(li)pseudo_class(:before) operator({) - key(content)operator(:) string stringoperator(;) -operator(}) - -type(body) operator({) - key(counter-reset)operator(:) value(chapter)operator(;) -operator(}) -type(h1) operator({) - key(counter-increment)operator(:) value(chapter)operator(;) - key(counter-reset)operator(:) value(section)operator(;) -operator(}) -type(h2) operator({) - key(counter-increment)operator(:) value(section)operator(;) -operator(}) -type(h1)pseudo_class(:before) operator({) - key(content)operator(:) string string stringoperator(;) -operator(}) -type(h2)pseudo_class(:before) operator({) - key(content)operator(:) string string string stringoperator(;) -operator(}) - -type(blockquote) type(p) operator({) - key(margin)operator(:) float(0)operator(;) - key(text-indent)operator(:) float(1em)operator(;) - key(quotes)operator(:) string stringoperator(;) -operator(}) -type(blockquote) type(p)pseudo_class(:first-of-type) operator({) - key(text-indent)operator(:) float(0)operator(;) -operator(}) -type(blockquote) type(p)operator(:)pseudo_class(:before) operator({) - key(content)operator(:) value(open-quote)operator(;) -operator(}) -type(blockquote) type(p)operator(:)pseudo_class(:after) operator({) - key(content)operator(:) value(no-close-quote)operator(;) -operator(}) -type(blockquote) type(p)pseudo_class(:last-of-type)operator(:)pseudo_class(:after) operator({) - key(content)operator(:) value(close-quote)operator(;) -operator(}) \ No newline at end of file diff --git a/test/scanners/css/demo.in.css b/test/scanners/css/demo.in.css deleted file mode 100644 index 3b3b133..0000000 --- a/test/scanners/css/demo.in.css +++ /dev/null @@ -1,55 +0,0 @@ -/* See http://reference.sitepoint.com/css/content. */ -@media print { - a[href]:after { - content: "<" attr(href) ">"; - } -} - -a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;} -ol { - counter-reset: item; - margin: 0; - padding: 0; -} -ol>li { - counter-increment: item; - list-style: none inside; -} -ol>li:before { - content: counters(item, ".") " - "; -} - -body { - counter-reset: chapter; -} -h1 { - counter-increment: chapter; - counter-reset: section; -} -h2 { - counter-increment: section; -} -h1:before { - content: "Chapter " counter(chapter) ": "; -} -h2:before { - content: counter(chapter) "." counter(section) " "; -} - -blockquote p { - margin: 0; - text-indent: 1em; - quotes: "\201c" "\201d"; -} -blockquote p:first-of-type { - text-indent: 0; -} -blockquote p::before { - content: open-quote; -} -blockquote p::after { - content: no-close-quote; -} -blockquote p:last-of-type::after { - content: close-quote; -} \ No newline at end of file diff --git a/test/scanners/css/ignos-draconis.expected.raydebug b/test/scanners/css/ignos-draconis.expected.raydebug deleted file mode 100644 index 6cd3c84..0000000 --- a/test/scanners/css/ignos-draconis.expected.raydebug +++ /dev/null @@ -1,1236 +0,0 @@ -comment(/*) comment(CSS) comment(Document) comment(*/) -type(td) operator({) - key(font-family)operator(:) value(Verdana)operator(,) value(Arial)operator(,) value(Helvetica)operator(,) value(sans-serif)operator(;) - key(font-size)operator(:) float(12px)operator(;) -operator(}) -type(a)operator({) - key(color)operator(:) color(#0099FF)operator(;) - key(text-decoration)operator(:) value(none)operator(;) -operator(}) -type(a)class(.nav) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.nav) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border-top)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -type(a)class(.navhilite) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(150px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(right)operator(;) - key(clear)operator(:) value(none)operator(;) - key(color)operator(:)color(#FFFF00)operator(;) - key(background-color)operator(:) color(#000000)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.navhilite) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border-top)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -class(.navhelp) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#7B0000)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) - key(cursor)operator(:) value(default)operator(;) -operator(}) -class(.navhead) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(180px)operator(;) - key(border)operator(:) value(thin) color(#000000)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(line-height)operator(:) float(18px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(xbackground-color)operator(:) color(#000000)operator(;) - key(font-weight)operator(:) value(bold)operator(;) - key(color)operator(:) color(#ffffff)operator(;) - key(cursor)operator(:) value(default)operator(;) - key(text-align)operator(:) value(center)operator(;) -operator(}) -type(table) operator({) -operator(}) -type(td)class(.charinfo) operator({) - key(border-top-width)operator(:) float(1px)operator(;) - key(border-top-style)operator(:) value(solid)operator(;) - key(border-top-color)operator(:) color(#000000)operator(;) - key(border-right-style)operator(:) value(none)operator(;) - key(border-bottom-style)operator(:) value(none)operator(;) - key(border-left-style)operator(:) value(none)operator(;) - key(cursor)operator(:) value(default)operator(;) -operator(}) -type(td)class(.charhead) operator({) - key(background-color)operator(:) color(#17007B)operator(;) - key(border)operator(:) value(none)operator(;) - key(cursor)operator(:) value(default)operator(;) - key(color)operator(:) color(#D8D8D8)operator(;) -operator(}) -type(table)class(.charinfo) operator({) - key(border)operator(:) value(none)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(td)class(.pageheader) operator({) - key(background-color)operator(:) color(#484860)operator(;) - key(background-image)operator(:) stringoperator(;) - key(height)operator(:) float(69px) -operator(}) -type(td)class(.popupheader) operator({) - key(background-color)operator(:) color(#484860)operator(;) - key(background-image)operator(:) stringoperator(;) - key(height)operator(:) float(20px) -operator(}) -type(td)class(.noborder) operator({) - key(border)operator(:) value(none)operator(;) -operator(}) -type(table)class(.noborder) operator({) - key(border)operator(:) value(none)operator(;) -operator(}) -type(td)class(.village) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(right) value(bottom) -operator(}) -type(td)class(.forest) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(center) value(bottom) -operator(}) -type(td)class(.dragon) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(center)operator(;) - key(background-attachment)operator(:) value(fixed) -operator(}) -type(input) operator({) - key(background-color)operator(:) color(#292843)operator(;) - key(border)operator(:) float(1px) value(solid) color(#6A6A82)operator(;) - key(color)operator(:) color(#FFFFFF)operator(;) -operator(}) -class(.button) operator({) -key(font-family)operator(:) value(verdana)operator(,)value(arial)operator(,)value(helvetica)operator(,)value(sans-serif)operator(;) - key(font-size)operator(:) float(12px)operator(;) - key(color)operator(:) color(#FFFFFF)operator(;) - key(background-color)operator(:) color(#6A6A6E)operator(;) - key(border-top)operator(:) float(1px) value(solid) color(#566294)operator(;) - key(border-left)operator(:) float(1px) value(solid) color(#566294)operator(;) - key(border-right)operator(:) float(1px) value(solid) color(#252540)operator(;) - key(border-bottom)operator(:) float(1px) value(solid) color(#252540)operator(;) -operator(}) -class(.image) operator({) - key(border)operator(:)float(1px) value(solid) color(#4F4D80)operator(;) -operator(}) -class(.imagesel) operator({) - key(border)operator(:)float(1px) value(solid) color(#FF0000)operator(;) -operator(}) -class(.input) operator({) - key(background-color)operator(:) color(#5A595C)operator(;) - key(border)operator(:) float(1px) value(solid) color(#737374)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -type(select) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -type(table)class(.vitalinfo) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(table)class(.nav) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(a)class(.motd) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(text-align)operator(:) value(center)operator(;) - key(color)operator(:)color(#BDD6E6)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) float(16px)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.motd) operator({) - key(height)operator(:) float(14px)operator(;) - key(width)operator(:) float(179px)operator(;) - key(background-color)operator(:) color(#566068)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#BDD6E6)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#BDD6E6)operator(;) - key(border-right)operator(:) value(thin) value(solid) color(#BDD6E6)operator(;) - key(border-left)operator(:) value(thin) value(solid) color(#BDD6E6)operator(;) -operator(}) -type(a)class(.hotmotd) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(text-align)operator(:) value(center)operator(;) - key(color)operator(:)color(#BDD6E6)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - - key(background-color)operator(:) color(#4F4D80)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#2400FF)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#2400FF)operator(;) - key(border-right)operator(:) value(thin) value(solid) color(#2400FF)operator(;) - key(border-left)operator(:) value(thin) value(solid) color(#2400FF)operator(;) -operator(}) -class(.pagetitle) operator({) - key(font-family)operator(:) stringoperator(,) stringoperator(;) - key(font-size)operator(:) float(20px)operator(;) - key(color)operator(:) color(#FFFFFF)operator(;) -operator(}) -type(td)class(.footer) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(repeat-x)operator(;) - key(background-position-y)operator(:)float(50%) -operator(}) -class(.navhi) operator({) - key(color)operator(:) color(#00FF00)operator(;) - key(text-decoration)operator(:) value(underline)operator(;) -operator(}) -type(td)class(.backgroundimage) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-color)operator(:) color(#0F1B25)operator(;) - key(background-position)operator(:) value(center) value(center)operator(;) -operator(}) -class(.colDkBlue) operator({) key(color)operator(:) color(#0000B0)operator(;) operator(}) -class(.colDkGreen) operator({) key(color)operator(:) color(#00B000)operator(;) operator(}) -class(.colDkCyan) operator({) key(color)operator(:) color(#00B0B0)operator(;) operator(}) -class(.colDkRed) operator({) key(color)operator(:) color(#B00000)operator(;) operator(}) -class(.colDkMagenta) operator({) key(color)operator(:) color(#B000CC)operator(;) operator(}) -class(.colDkYellow) operator({) key(color)operator(:) color(#B0B000)operator(;) operator(}) -class(.colDkWhite) operator({) key(color)operator(:) color(#B0B0B0)operator(;) operator(}) -class(.colLtBlue) operator({) key(color)operator(:) color(#0000FF)operator(;) operator(}) -class(.colLtGreen) operator({) key(color)operator(:) color(#00FF00)operator(;) operator(}) -class(.colLtCyan) operator({) key(color)operator(:) color(#00FFFF)operator(;) operator(}) -class(.colLtRed) operator({) key(color)operator(:) color(#FF0000)operator(;) operator(}) -class(.colLtMagenta) operator({) key(color)operator(:) color(#FF00FF)operator(;) operator(}) -class(.colLtYellow) operator({) key(color)operator(:) color(#FFFF00)operator(;) operator(}) -class(.colLtWhite) operator({) key(color)operator(:) color(#FFFFFF)operator(;) operator(}) -class(.colLtBlack) operator({) key(color)operator(:) color(#999999)operator(;) operator(}) -class(.colOrange) operator({) key(color)operator(:) color(#FF9900)operator(;) operator(}) -class(.colDkOrange) operator({) key(color)operator(:) color(#FF6500)operator(;)operator(}) -class(.colBlue) operator({) key(color)operator(:) color(#0070FF)operator(;) operator(}) -class(.colLime) operator({) key(color)operator(:) color(#DDFFBB)operator(;) operator(}) -class(.colRose) operator({) key(color)operator(:) color(#EEBBEE)operator(;) operator(}) -class(.colblueviolet) operator({) key(color)operator(:) color(#9A5BEE)operator(;) operator(}) -class(.coliceviolet)operator({) key(color)operator(:) color(#AABBEE)operator(;) operator(}) -class(.colLtBrown) operator({) key(color)operator(:) color(#F8DB83)operator(;) operator(}) -class(.colDkBrown) operator({) key(color)operator(:) color(#6b563f)operator(;) operator(}) -class(.colXDkGreen) operator({)key(color)operator(:) color(#003300)operator(;) operator(}) -class(.colXLtGreen)operator({)key(color)operator(:) color(#aaff99)operator(;) operator(}) -class(.colBlack) operator({) key(color)operator(:) color(#000000)operator(;) operator(}) -class(.colAttention) operator({) key(background-color)operator(:) color(#00FF00)operator(;) key(color)operator(:) color(#FF0000)operator(;)operator(}) -class(.colWhiteBlack) operator({) key(background-color)operator(:) color(#FFFFFF)operator(;) key(color)operator(:) color(#000000)operator(;) operator(}) -class(.colBack) operator({) key(background-color)operator(:)color(#00FFFF)operator(;) key(color)operator(:)color(#000000)operator(;) operator(}) -class(.trhead) operator({) key(background-color)operator(:)color(#990000)operator(;) key(color)operator(:)color(#FFFFFF)operator(;) operator(}) -class(.trlight) operator({) key(background-color)operator(:)color(#330000)operator(;) operator(}) -class(.trdark) operator({) key(background-color)operator(:)color(#000000)operator(;) operator(})comment(/*) comment(CSS) comment(Document) comment(*/) -type(td) operator({) - key(font-family)operator(:) value(Verdana)operator(,) value(Arial)operator(,) value(Helvetica)operator(,) value(sans-serif)operator(;) - key(font-size)operator(:) float(12px)operator(;) -operator(}) -type(a)operator({) - key(color)operator(:) color(#0099FF)operator(;) - key(text-decoration)operator(:) value(none)operator(;) -operator(}) -type(a)class(.nav) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.nav) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border-top)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -type(a)class(.navhilite) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(150px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(right)operator(;) - key(clear)operator(:) value(none)operator(;) - key(color)operator(:)color(#FFFF00)operator(;) - key(background-color)operator(:) color(#000000)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.navhilite) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border-top)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -class(.navhelp) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#7B0000)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) - key(cursor)operator(:) value(default)operator(;) -operator(}) -class(.navhead) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(180px)operator(;) - key(border)operator(:) value(thin) color(#000000)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(line-height)operator(:) float(18px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(xbackground-color)operator(:) color(#000000)operator(;) - key(font-weight)operator(:) value(bold)operator(;) - key(color)operator(:) color(#ffffff)operator(;) - key(cursor)operator(:) value(default)operator(;) - key(text-align)operator(:) value(center)operator(;) -operator(}) -type(table) operator({) -operator(}) -type(td)class(.charinfo) operator({) - key(border-top-width)operator(:) float(1px)operator(;) - key(border-top-style)operator(:) value(solid)operator(;) - key(border-top-color)operator(:) color(#000000)operator(;) - key(border-right-style)operator(:) value(none)operator(;) - key(border-bottom-style)operator(:) value(none)operator(;) - key(border-left-style)operator(:) value(none)operator(;) - key(cursor)operator(:) value(default)operator(;) -operator(}) -type(td)class(.charhead) operator({) - key(background-color)operator(:) color(#7B0000)operator(;) - key(border)operator(:) value(none)operator(;) - key(cursor)operator(:) value(default)operator(;) - key(color)operator(:) color(#FFFF00)operator(;) -operator(}) -type(table)class(.charinfo) operator({) - key(border)operator(:) value(none)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(td)class(.pageheader) operator({) - key(background-color)operator(:) color(#333399)operator(;) - key(background-image)operator(:) stringoperator(;) - key(height)operator(:) float(69px) -operator(}) -type(td)class(.popupheader) operator({) - key(background-color)operator(:) color(#333399)operator(;) - key(background-image)operator(:) stringoperator(;) - key(height)operator(:) float(20px) -operator(}) -type(td)class(.noborder) operator({) - key(border)operator(:) value(none)operator(;) -operator(}) -type(table)class(.noborder) operator({) - key(border)operator(:) value(none)operator(;) -operator(}) -type(td)class(.village) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(right) value(bottom) -operator(}) -type(td)class(.forest) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(center) value(bottom) -operator(}) -type(td)class(.dragon) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(center)operator(;) - key(background-attachment)operator(:) value(fixed) -operator(}) -type(input) operator({) - key(background-color)operator(:) color(#433828)operator(;) - key(border)operator(:) float(1px) value(solid) color(#806B4D)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -class(.button) operator({) -key(font-family)operator(:) value(verdana)operator(,)value(arial)operator(,)value(helvetica)operator(,)value(sans-serif)operator(;) - key(font-size)operator(:) float(12px)operator(;) - key(color)operator(:) color(#F8DB83)operator(;) - key(background-color)operator(:) color(#6b563f)operator(;) - key(border-top)operator(:) float(1px) value(solid) color(#947356)operator(;) - key(border-left)operator(:) float(1px) value(solid) color(#947356)operator(;) - key(border-right)operator(:) float(1px) value(solid) color(#403225)operator(;) - key(border-bottom)operator(:) float(1px) value(solid) color(#403225)operator(;) -operator(}) -class(.image) operator({) - key(border)operator(:)float(1px) value(solid) color(#806B4D)operator(;) -operator(}) -class(.imagesel) operator({) - key(border)operator(:)float(1px) value(solid) color(#FF0000)operator(;) -operator(}) -class(.input) operator({) - key(background-color)operator(:) color(#433828)operator(;) - key(border)operator(:) float(1px) value(solid) color(#806B4D)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -type(select) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -type(table)class(.vitalinfo) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(table)class(.nav) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(a)class(.motd) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(text-align)operator(:) value(center)operator(;) - key(color)operator(:)color(#FF9900)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) float(16px)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.motd) operator({) - key(height)operator(:) float(14px)operator(;) - key(width)operator(:) float(179px)operator(;) - key(background-color)operator(:) color(#806B4D)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-right)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-left)operator(:) value(thin) value(solid) color(#FF9900)operator(;) -operator(}) -type(a)class(.hotmotd) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(text-align)operator(:) value(center)operator(;) - key(color)operator(:)color(#FF9900)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - - key(background-color)operator(:) color(#806B4D)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-right)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-left)operator(:) value(thin) value(solid) color(#FF9900)operator(;) -operator(}) -class(.pagetitle) operator({) - key(font-family)operator(:) stringoperator(,) stringoperator(;) - key(font-size)operator(:) float(20px)operator(;) - key(color)operator(:) color(#FFFFFF)operator(;) -operator(}) -type(td)class(.footer) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(repeat-x)operator(;) - key(background-position-y)operator(:)float(50%) -operator(}) -class(.navhi) operator({) - key(color)operator(:) color(#00FF00)operator(;) - key(text-decoration)operator(:) value(underline)operator(;) -operator(}) -type(td)class(.backgroundimage) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-color)operator(:) color(#0F1B25)operator(;) - key(background-position)operator(:) value(center) value(center)operator(;) -operator(}) -class(.colDkBlue) operator({) key(color)operator(:) color(#0000B0)operator(;) operator(}) -class(.colDkGreen) operator({) key(color)operator(:) color(#00B000)operator(;) operator(}) -class(.colDkCyan) operator({) key(color)operator(:) color(#00B0B0)operator(;) operator(}) -class(.colDkRed) operator({) key(color)operator(:) color(#B00000)operator(;) operator(}) -class(.colDkMagenta) operator({) key(color)operator(:) color(#B000CC)operator(;) operator(}) -class(.colDkYellow) operator({) key(color)operator(:) color(#B0B000)operator(;) operator(}) -class(.colDkWhite) operator({) key(color)operator(:) color(#B0B0B0)operator(;) operator(}) -class(.colLtBlue) operator({) key(color)operator(:) color(#0000FF)operator(;) operator(}) -class(.colLtGreen) operator({) key(color)operator(:) color(#00FF00)operator(;) operator(}) -class(.colLtCyan) operator({) key(color)operator(:) color(#00FFFF)operator(;) operator(}) -class(.colLtRed) operator({) key(color)operator(:) color(#FF0000)operator(;) operator(}) -class(.colLtMagenta) operator({) key(color)operator(:) color(#FF00FF)operator(;) operator(}) -class(.colLtYellow) operator({) key(color)operator(:) color(#FFFF00)operator(;) operator(}) -class(.colLtWhite) operator({) key(color)operator(:) color(#FFFFFF)operator(;) operator(}) -class(.colLtBlack) operator({) key(color)operator(:) color(#999999)operator(;) operator(}) -class(.colOrange) operator({) key(color)operator(:) color(#FF9900)operator(;) operator(}) -class(.colDkOrange) operator({) key(color)operator(:) color(#FF6500)operator(;)operator(}) -class(.colBlue) operator({) key(color)operator(:) color(#0070FF)operator(;) operator(}) -class(.colLime) operator({) key(color)operator(:) color(#DDFFBB)operator(;) operator(}) -class(.colRose) operator({) key(color)operator(:) color(#EEBBEE)operator(;) operator(}) -class(.colblueviolet) operator({) key(color)operator(:) color(#9A5BEE)operator(;) operator(}) -class(.coliceviolet)operator({) key(color)operator(:) color(#AABBEE)operator(;) operator(}) -class(.colLtBrown) operator({) key(color)operator(:) color(#F8DB83)operator(;) operator(}) -class(.colDkBrown) operator({) key(color)operator(:) color(#6b563f)operator(;) operator(}) -class(.colXDkGreen) operator({)key(color)operator(:) color(#003300)operator(;) operator(}) -class(.colXLtGreen)operator({)key(color)operator(:) color(#aaff99)operator(;) operator(}) -class(.colBlack) operator({) key(color)operator(:) color(#000000)operator(;) operator(}) -class(.colAttention) operator({) key(background-color)operator(:) color(#00FF00)operator(;) key(color)operator(:) color(#FF0000)operator(;)operator(}) -class(.colWhiteBlack) operator({) key(background-color)operator(:) color(#FFFFFF)operator(;) key(color)operator(:) color(#000000)operator(;) operator(}) -class(.colBack) operator({) key(background-color)operator(:)color(#00FFFF)operator(;) key(color)operator(:)color(#000000)operator(;) operator(}) -class(.trhead) operator({) key(background-color)operator(:)color(#990000)operator(;) key(color)operator(:)color(#FFFFFF)operator(;) operator(}) -class(.trlight) operator({) key(background-color)operator(:)color(#330000)operator(;) operator(}) -class(.trdark) operator({) key(background-color)operator(:)color(#000000)operator(;) operator(})comment(/*) comment(CSS) comment(Document) comment(*/) -type(td) operator({) - key(font-family)operator(:) value(Verdana)operator(,) value(Arial)operator(,) value(Helvetica)operator(,) value(sans-serif)operator(;) - key(font-size)operator(:) float(10px)operator(;) -operator(}) -type(a)operator({) - key(color)operator(:) color(#0099FF)operator(;) - key(text-decoration)operator(:) value(none)operator(;) -operator(}) -type(a)class(.nav) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#003366)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#003366)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#003366)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#003366)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.nav) operator({) - key(background-color)operator(:) color(#003366)operator(;) - key(border-top)operator(:) value(thin) value(outset) color(#003366)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#003366)operator(;) - key(border-bottom)operator(:) value(thin) value(outset) color(#003366)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#003366)operator(;) -operator(}) -type(a)class(.navhilite) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(150px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(right)operator(;) - key(clear)operator(:) value(none)operator(;) - key(color)operator(:)color(#FFFF00)operator(;) - key(background-color)operator(:) color(#330000)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#330000)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#330000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#330000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#330000)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.navhilite) operator({) - key(background-color)operator(:) color(#990000)operator(;) - key(border-top)operator(:) value(thin) value(outset) color(#CC0000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#CC0000)operator(;) - key(border-bottom)operator(:) value(thin) value(outset) color(#CC0000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#CC0000)operator(;) -operator(}) -class(.navhelp) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#003366)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#003366)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#003366)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#003366)operator(;) - key(cursor)operator(:) value(default)operator(;) -operator(}) -class(.navhead) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(180px)operator(;) - key(border)operator(:) value(thin) color(#003366)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(line-height)operator(:) float(18px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(xbackground-color)operator(:) color(#000066)operator(;) - key(font-weight)operator(:) value(bold)operator(;) - key(color)operator(:) color(#00CCFF)operator(;) - key(cursor)operator(:) value(default)operator(;) - key(text-align)operator(:) value(center)operator(;) -operator(}) -type(table) operator({) -operator(}) -type(td)class(.charinfo) operator({) - key(border-top-width)operator(:) float(1px)operator(;) - key(border-top-style)operator(:) value(solid)operator(;) - key(border-top-color)operator(:) color(#009900)operator(;) - key(border-right-style)operator(:) value(none)operator(;) - key(border-bottom-style)operator(:) value(none)operator(;) - key(border-left-style)operator(:) value(none)operator(;) - key(cursor)operator(:) value(default)operator(;) -operator(}) -type(td)class(.charhead) operator({) - key(background-color)operator(:) color(#009900)operator(;) - key(border)operator(:) value(none)operator(;) - key(cursor)operator(:) value(default)operator(;) - key(color)operator(:) color(#FFFF00)operator(;) -operator(}) -type(table)class(.charinfo) operator({) - key(border)operator(:) value(none)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(td)class(.pageheader) operator({) - key(background-color)operator(:) color(#333399)operator(;) - key(background-image)operator(:) stringoperator(;) - key(height)operator(:) float(69px)operator(;) -operator(}) -type(td)class(.popupheader) operator({) - key(background-color)operator(:) color(#333399)operator(;) - key(background-image)operator(:) stringoperator(;) - key(height)operator(:) float(20px)operator(;) -operator(}) -type(td)class(.noborder) operator({) - key(border)operator(:) value(none)operator(;) -operator(}) -type(table)class(.noborder) operator({) - key(border)operator(:) value(none)operator(;) -operator(}) -type(td)class(.village) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(right) value(bottom)operator(;) -operator(}) -type(td)class(.forest) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(center) value(bottom)operator(;) -operator(}) -type(td)class(.dragon) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(center) value(center)operator(;) - key(background-attachment)operator(:) value(fixed)operator(;) -operator(}) -type(input) operator({) - key(background-color)operator(:) color(#433828)operator(;) - key(border)operator(:) float(1px) value(solid) color(#806B4D)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -class(.button) operator({) -key(font-family)operator(:) value(verdana)operator(,)value(arial)operator(,)value(helvetica)operator(,)value(sans-serif)operator(;) - key(font-size)operator(:) float(10px)operator(;) - key(color)operator(:) color(#F8DB83)operator(;) - key(background-color)operator(:) color(#6b563f)operator(;) - key(border-top)operator(:) float(1px) value(solid) color(#947356)operator(;) - key(border-left)operator(:) float(1px) value(solid) color(#947356)operator(;) - key(border-right)operator(:) float(1px) value(solid) color(#403225)operator(;) - key(border-bottom)operator(:) float(1px) value(solid) color(#403225)operator(;) -operator(}) -class(.image) operator({) - key(border)operator(:)float(1px) value(solid) color(#806B4D)operator(;) -operator(}) -class(.imagesel) operator({) - key(border)operator(:)float(1px) value(solid) color(#FF0000)operator(;) -operator(}) -class(.input) operator({) - key(background-color)operator(:) color(#433828)operator(;) - key(border)operator(:) float(1px) value(solid) color(#806B4D)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -type(select) operator({) - key(background-color)operator(:) color(#433828)operator(;) - key(border)operator(:) float(1px) value(solid) color(#806B4D)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -type(table)class(.vitalinfo) operator({) - key(background-color)operator(:) color(#003300)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(table)class(.nav) operator({) - key(background-color)operator(:) color(#003366)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(a)class(.motd) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(text-align)operator(:) value(center)operator(;) - key(color)operator(:)color(#FF9900)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) float(16px)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.motd) operator({) - key(height)operator(:) float(14px)operator(;) - key(width)operator(:) float(179px)operator(;) - key(background-color)operator(:) color(#806B4D)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-right)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-left)operator(:) value(thin) value(solid) color(#FF9900)operator(;) -operator(}) -type(a)class(.hotmotd) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(text-align)operator(:) value(center)operator(;) - key(color)operator(:)color(#FF9900)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - - key(background-color)operator(:) color(#806B4D)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-right)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-left)operator(:) value(thin) value(solid) color(#FF9900)operator(;) -operator(}) -class(.pagetitle) operator({) - key(font-family)operator(:) stringoperator(,) stringoperator(;) - key(font-size)operator(:) float(20px)operator(;) - key(color)operator(:) color(#FFFFFF)operator(;) -operator(}) -type(td)class(.footer) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(repeat-x)operator(;) - key(background-position)operator(:) value(top)operator(;) -operator(}) -class(.navhi) operator({) - key(color)operator(:) color(#00FF00)operator(;) - key(text-decoration)operator(:) value(underline)operator(;) -operator(}) -class(.colDkBlue) operator({) key(color)operator(:) color(#0000B0)operator(;) operator(}) -class(.colDkGreen) operator({) key(color)operator(:) color(#00B000)operator(;) operator(}) -class(.colDkCyan) operator({) key(color)operator(:) color(#00B0B0)operator(;) operator(}) -class(.colDkRed) operator({) key(color)operator(:) color(#B00000)operator(;) operator(}) -class(.colDkMagenta) operator({) key(color)operator(:) color(#B000CC)operator(;) operator(}) -class(.colDkYellow) operator({) key(color)operator(:) color(#B0B000)operator(;) operator(}) -class(.colDkWhite) operator({) key(color)operator(:) color(#B0B0B0)operator(;) operator(}) -class(.colLtBlue) operator({) key(color)operator(:) color(#0000FF)operator(;) operator(}) -class(.colLtGreen) operator({) key(color)operator(:) color(#00FF00)operator(;) operator(}) -class(.colLtCyan) operator({) key(color)operator(:) color(#00FFFF)operator(;) operator(}) -class(.colLtRed) operator({) key(color)operator(:) color(#FF0000)operator(;) operator(}) -class(.colLtMagenta) operator({) key(color)operator(:) color(#FF00FF)operator(;) operator(}) -class(.colLtYellow) operator({) key(color)operator(:) color(#FFFF00)operator(;) operator(}) -class(.colLtWhite) operator({) key(color)operator(:) color(#FFFFFF)operator(;) operator(}) -class(.colLtBlack) operator({) key(color)operator(:) color(#999999)operator(;) operator(}) -class(.colOrange) operator({) key(color)operator(:) color(#FF9900)operator(;) operator(}) -class(.colDkOrange) operator({) key(color)operator(:) color(#FF6500)operator(;)operator(}) -class(.colBlue) operator({) key(color)operator(:) color(#0070FF)operator(;) operator(}) -class(.colLime) operator({) key(color)operator(:) color(#DDFFBB)operator(;) operator(}) -class(.colRose) operator({) key(color)operator(:) color(#EEBBEE)operator(;) operator(}) -class(.colblueviolet) operator({) key(color)operator(:) color(#9A5BEE)operator(;) operator(}) -class(.coliceviolet)operator({) key(color)operator(:) color(#AABBEE)operator(;) operator(}) -class(.colLtBrown) operator({) key(color)operator(:) color(#F8DB83)operator(;) operator(}) -class(.colDkBrown) operator({) key(color)operator(:) color(#6b563f)operator(;) operator(}) -class(.colXDkGreen) operator({)key(color)operator(:) color(#003300)operator(;) operator(}) -class(.colXLtGreen)operator({)key(color)operator(:) color(#aaff99)operator(;) operator(}) -class(.colBlack) operator({) key(color)operator(:) color(#000000)operator(;) operator(}) -class(.colAttention) operator({) key(background-color)operator(:) color(#00FF00)operator(;) key(color)operator(:) color(#FF0000)operator(;)operator(}) -class(.colWhiteBlack) operator({) key(background-color)operator(:) color(#FFFFFF)operator(;) key(color)operator(:) color(#000000)operator(;) operator(}) -class(.colBack) operator({) key(background-color)operator(:)color(#00FFFF)operator(;) key(color)operator(:)color(#000000)operator(;) operator(}) -class(.trhead) operator({) key(background-color)operator(:)color(#990000)operator(;) key(color)operator(:)color(#FFFFFF)operator(;) operator(}) -class(.trlight) operator({) key(background-color)operator(:)color(#330000)operator(;) operator(}) -class(.trdark) operator({) key(background-color)operator(:)color(#000000)operator(;) operator(}) -comment(/*) comment(CSS) comment(Document) comment(*/) -type(td) operator({) - key(font-family)operator(:) value(Verdana)operator(,) value(Arial)operator(,) value(Helvetica)operator(,) value(sans-serif)operator(;) - key(font-size)operator(:) float(12px)operator(;) -operator(}) -type(a)operator({) - key(color)operator(:) color(#0099FF)operator(;) - key(text-decoration)operator(:) value(none)operator(;) -operator(}) -type(a)class(.nav) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.nav) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border-top)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -type(a)class(.navhilite) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(150px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(right)operator(;) - key(clear)operator(:) value(none)operator(;) - key(color)operator(:)color(#FFFF00)operator(;) - key(background-color)operator(:) color(#000000)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.navhilite) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border-top)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(outset) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) -operator(}) -class(.navhelp) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#000000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#000000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#000000)operator(;) - key(cursor)operator(:) value(default)operator(;) -operator(}) -class(.navhead) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(180px)operator(;) - key(border)operator(:) value(thin) color(#000000)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(line-height)operator(:) float(18px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(xbackground-color)operator(:) color(#000000)operator(;) - key(font-weight)operator(:) value(bold)operator(;) - key(color)operator(:) color(#ffffff)operator(;) - key(cursor)operator(:) value(default)operator(;) - key(text-align)operator(:) value(center)operator(;) -operator(}) -type(table) operator({) -operator(}) -type(td)class(.charinfo) operator({) - key(border-top-width)operator(:) float(1px)operator(;) - key(border-top-style)operator(:) value(solid)operator(;) - key(border-top-color)operator(:) color(#000000)operator(;) - key(border-right-style)operator(:) value(none)operator(;) - key(border-bottom-style)operator(:) value(none)operator(;) - key(border-left-style)operator(:) value(none)operator(;) - key(cursor)operator(:) value(default)operator(;) -operator(}) -type(td)class(.charhead) operator({) - key(background-color)operator(:) color(#7B0000)operator(;) - key(border)operator(:) value(none)operator(;) - key(cursor)operator(:) value(default)operator(;) - key(color)operator(:) color(#FFFF00)operator(;) -operator(}) -type(table)class(.charinfo) operator({) - key(border)operator(:) value(none)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(td)class(.pageheader) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(background-image)operator(:) stringoperator(;) - key(height)operator(:) float(69px) -operator(}) -type(td)class(.popupheader) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(background-image)operator(:) stringoperator(;) - key(height)operator(:) float(20px) -operator(}) -type(td)class(.noborder) operator({) - key(border)operator(:) value(none)operator(;) -operator(}) -type(table)class(.noborder) operator({) - key(border)operator(:) value(none)operator(;) -operator(}) -type(td)class(.village) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(right) value(bottom) -operator(}) -type(td)class(.forest) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(center) value(bottom) -operator(}) -type(td)class(.dragon) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(center)operator(;) - key(background-attachment)operator(:) value(fixed) -operator(}) -type(input) operator({) - key(background-color)operator(:) color(#433828)operator(;) - key(border)operator(:) float(1px) value(solid) color(#806B4D)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -class(.button) operator({) -key(font-family)operator(:) value(verdana)operator(,)value(arial)operator(,)value(helvetica)operator(,)value(sans-serif)operator(;) - key(font-size)operator(:) float(10px)operator(;) - key(color)operator(:) color(#F8DB83)operator(;) - key(background-color)operator(:) color(#6b563f)operator(;) - key(border-top)operator(:) float(1px) value(solid) color(#947356)operator(;) - key(border-left)operator(:) float(1px) value(solid) color(#947356)operator(;) - key(border-right)operator(:) float(1px) value(solid) color(#403225)operator(;) - key(border-bottom)operator(:) float(1px) value(solid) color(#403225)operator(;) -operator(}) -class(.image) operator({) - key(border)operator(:)float(1px) value(solid) color(#000000)operator(;) -operator(}) -class(.imagesel) operator({) - key(border)operator(:)float(1px) value(solid) color(#000000)operator(;) -operator(}) -class(.input) operator({) - key(background-color)operator(:) color(#433828)operator(;) - key(border)operator(:) float(1px) value(solid) color(#806B4D)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -type(select) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -type(table)class(.vitalinfo) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(table)class(.nav) operator({) - key(background-color)operator(:) color(#000000)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(a)class(.motd) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(text-align)operator(:) value(center)operator(;) - key(color)operator(:)color(#FF9900)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) float(16px)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.motd) operator({) - key(height)operator(:) float(14px)operator(;) - key(width)operator(:) float(179px)operator(;) - key(background-color)operator(:) color(#806B4D)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-right)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-left)operator(:) value(thin) value(solid) color(#FF9900)operator(;) -operator(}) -type(a)class(.hotmotd) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(text-align)operator(:) value(center)operator(;) - key(color)operator(:)color(#FF9900)operator(;) - key(width)operator(:) float(181px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - - key(background-color)operator(:) color(#806B4D)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-right)operator(:) value(thin) value(solid) color(#FF9900)operator(;) - key(border-left)operator(:) value(thin) value(solid) color(#FF9900)operator(;) -operator(}) -class(.pagetitle) operator({) - key(font-family)operator(:) stringoperator(,) stringoperator(;) - key(font-size)operator(:) float(20px)operator(;) - key(color)operator(:) color(#FFFFFF)operator(;) -operator(}) -type(td)class(.footer) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(repeat-x)operator(;) - key(background-position-y)operator(:)float(50%) -operator(}) -class(.navhi) operator({) - key(color)operator(:) color(#00FF00)operator(;) - key(text-decoration)operator(:) value(underline)operator(;) -operator(}) -class(.colDkBlue) operator({) key(color)operator(:) color(#0000B0)operator(;) operator(}) -class(.colDkGreen) operator({) key(color)operator(:) color(#00B000)operator(;) operator(}) -class(.colDkCyan) operator({) key(color)operator(:) color(#00B0B0)operator(;) operator(}) -class(.colDkRed) operator({) key(color)operator(:) color(#B00000)operator(;) operator(}) -class(.colDkMagenta) operator({) key(color)operator(:) color(#B000CC)operator(;) operator(}) -class(.colDkYellow) operator({) key(color)operator(:) color(#B0B000)operator(;) operator(}) -class(.colDkWhite) operator({) key(color)operator(:) color(#B0B0B0)operator(;) operator(}) -class(.colLtBlue) operator({) key(color)operator(:) color(#0000FF)operator(;) operator(}) -class(.colLtGreen) operator({) key(color)operator(:) color(#00FF00)operator(;) operator(}) -class(.colLtCyan) operator({) key(color)operator(:) color(#00FFFF)operator(;) operator(}) -class(.colLtRed) operator({) key(color)operator(:) color(#FF0000)operator(;) operator(}) -class(.colLtMagenta) operator({) key(color)operator(:) color(#FF00FF)operator(;) operator(}) -class(.colLtYellow) operator({) key(color)operator(:) color(#FFFF00)operator(;) operator(}) -class(.colLtWhite) operator({) key(color)operator(:) color(#FFFFFF)operator(;) operator(}) -class(.colLtBlack) operator({) key(color)operator(:) color(#999999)operator(;) operator(}) -class(.colOrange) operator({) key(color)operator(:) color(#FF9900)operator(;) operator(}) -class(.colDkOrange) operator({) key(color)operator(:) color(#FF6500)operator(;)operator(}) -class(.colBlue) operator({) key(color)operator(:) color(#0070FF)operator(;) operator(}) -class(.colLime) operator({) key(color)operator(:) color(#DDFFBB)operator(;) operator(}) -class(.colRose) operator({) key(color)operator(:) color(#EEBBEE)operator(;) operator(}) -class(.colblueviolet) operator({) key(color)operator(:) color(#9A5BEE)operator(;) operator(}) -class(.coliceviolet)operator({) key(color)operator(:) color(#AABBEE)operator(;) operator(}) -class(.colLtBrown) operator({) key(color)operator(:) color(#F8DB83)operator(;) operator(}) -class(.colDkBrown) operator({) key(color)operator(:) color(#6b563f)operator(;) operator(}) -class(.colXDkGreen) operator({)key(color)operator(:) color(#003300)operator(;) operator(}) -class(.colXLtGreen)operator({)key(color)operator(:) color(#aaff99)operator(;) operator(}) -class(.colBlack) operator({) key(color)operator(:) color(#000000)operator(;) operator(}) -class(.colAttention) operator({) key(background-color)operator(:) color(#00FF00)operator(;) key(color)operator(:) color(#FF0000)operator(;)operator(}) -class(.colWhiteBlack) operator({) key(background-color)operator(:) color(#FFFFFF)operator(;) key(color)operator(:) color(#000000)operator(;) operator(}) -class(.colBack) operator({) key(background-color)operator(:)color(#00FFFF)operator(;) key(color)operator(:)color(#000000)operator(;) operator(}) -class(.trhead) operator({) key(background-color)operator(:)color(#990000)operator(;) key(color)operator(:)color(#FFFFFF)operator(;) operator(}) -class(.trlight) operator({) key(background-color)operator(:)color(#330000)operator(;) operator(}) -class(.trdark) operator({) key(background-color)operator(:)color(#000000)operator(;) operator(})comment(/*) comment(CSS) comment(Document) comment(*/) -type(td) operator({) - key(font-family)operator(:) value(Verdana)operator(,) value(Arial)operator(,) value(Helvetica)operator(,) value(sans-serif)operator(;) - key(font-size)operator(:) float(10px)operator(;) -operator(}) - -type(table)class(.nav) operator({) - key(background-color)operator(:) color(#000033)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(height)operator(:) value(auto)operator(;) - key(width)operator(:) float(135px)operator(;) -operator(}) - -class(.navhead) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(137px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(line-height)operator(:) float(18px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(background-color)operator(:) color(#000099)operator(;) - key(font-weight)operator(:) value(bold)operator(;) - key(color)operator(:) color(#FFFF00)operator(;) - key(cursor)operator(:) value(default)operator(;) - key(text-align)operator(:) value(center)operator(;) -operator(}) - -type(a) operator({) - key(color)operator(:) color(#0099FF)operator(;) - key(text-decoration)operator(:) value(none)operator(;) -operator(}) - -type(a)class(.nav) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(135px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(background-color)operator(:) color(#000033)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000033)operator(;) -operator(}) - -class(.navhelp) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(135px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(none)operator(;) - key(background-color)operator(:) color(#000033)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000033)operator(;) -operator(}) - -type(a)pseudo_class(:hover)class(.nav) operator({) - key(background-color)operator(:) color(#003366)operator(;) - key(border-top)operator(:) float(1px) value(solid) color(#0364A3)operator(;) - key(border-left)operator(:) float(1px) value(solid) color(#0364A3)operator(;) - key(border-bottom)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(border-right)operator(:) float(1px) value(solid) color(#000000)operator(;) -operator(}) -type(a)class(.navhilite) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(width)operator(:) float(135px)operator(;) - key(height)operator(:) value(auto)operator(;) - key(padding)operator(:) float(1px)operator(;) - key(float)operator(:) value(right)operator(;) - key(clear)operator(:) value(none)operator(;) - key(color)operator(:)color(#FFFF00)operator(;) - key(background-color)operator(:) color(#330000)operator(;) - key(border-top)operator(:) value(thin) value(solid) color(#330000)operator(;) - key(border-bottom)operator(:) value(thin) value(solid) color(#330000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#330000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#330000)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.navhilite) operator({) - key(background-color)operator(:) color(#990000)operator(;) - key(border-top)operator(:) value(thin) value(outset) color(#CC0000)operator(;) - key(border-right)operator(:) value(thin) value(none) color(#CC0000)operator(;) - key(border-bottom)operator(:) value(thin) value(outset) color(#CC0000)operator(;) - key(border-left)operator(:) value(thin) value(none) color(#CC0000)operator(;) -operator(}) - - -type(table) operator({) -operator(}) -type(td)class(.charinfo) operator({) - key(border-top-width)operator(:) float(1px)operator(;) - key(border-top-style)operator(:) value(solid)operator(;) - key(border-top-color)operator(:) color(#009900)operator(;) - key(border-right-style)operator(:) value(none)operator(;) - key(border-bottom-style)operator(:) value(none)operator(;) - key(border-left-style)operator(:) value(none)operator(;) - key(cursor)operator(:) value(default)operator(;) -operator(}) -type(td)class(.charhead) operator({) - key(background-color)operator(:) color(#009900)operator(;) - key(border)operator(:) value(none)operator(;) - key(cursor)operator(:) value(default)operator(;) - key(color)operator(:) color(#FFFF00)operator(;) -operator(}) -type(table)class(.charinfo) operator({) - key(border)operator(:) value(none)operator(;) - key(width)operator(:) float(140px)operator(;) -operator(}) -type(td)class(.pageheader) operator({) - key(background-color)operator(:) color(#333399)operator(;) - key(background-image)operator(:) stringoperator(;) - key(height)operator(:) float(60px)operator(;) -operator(}) -type(td)class(.popupheader) operator({) - key(background-color)operator(:) color(#333399)operator(;) - key(background-image)operator(:) stringoperator(;) - key(height)operator(:) float(20px)operator(;) -operator(}) -type(td)class(.noborder) operator({) - key(border)operator(:) value(none)operator(;) -operator(}) -type(table)class(.noborder) operator({) - key(border)operator(:) value(none)operator(;) -operator(}) -type(td)class(.village) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(right) value(bottom)operator(;) -operator(}) -type(td)class(.forest) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(center) value(bottom)operator(;) -operator(}) -type(td)class(.dragon) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(background-position)operator(:) value(center) value(center)operator(;) - key(background-attachment)operator(:) value(fixed)operator(;) -operator(}) -type(input) operator({) - key(background-color)operator(:) color(#433828)operator(;) - key(border)operator(:) float(1px) value(solid) color(#806B4D)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -class(.button) operator({) -key(font-family)operator(:) value(verdana)operator(,)value(arial)operator(,)value(helvetica)operator(,)value(sans-serif)operator(;) - key(font-size)operator(:) float(12px)operator(;) - key(color)operator(:) color(#F8DB83)operator(;) - key(background-color)operator(:) color(#6b563f)operator(;) - key(border-top)operator(:) float(1px) value(solid) color(#947356)operator(;) - key(border-left)operator(:) float(1px) value(solid) color(#947356)operator(;) - key(border-right)operator(:) float(1px) value(solid) color(#403225)operator(;) - key(border-bottom)operator(:) float(1px) value(solid) color(#403225)operator(;) -operator(}) -class(.image) operator({) - key(border)operator(:)float(1px) value(solid) color(#806B4D)operator(;) -operator(}) -class(.imagesel) operator({) - key(border)operator(:)float(1px) value(solid) color(#FF0000)operator(;) -operator(}) -class(.input) operator({) - key(background-color)operator(:) color(#433828)operator(;) - key(border)operator(:) float(1px) value(solid) color(#806B4D)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -type(select) operator({) - key(background-color)operator(:) color(#433828)operator(;) - key(border)operator(:) float(1px) value(solid) color(#806B4D)operator(;) - key(color)operator(:) color(#CCCCCC)operator(;) -operator(}) -type(table)class(.vitalinfo) operator({) - key(background-color)operator(:) color(#003300)operator(;) - key(border)operator(:) float(1px) value(solid) color(#000000)operator(;) - key(width)operator(:) float(182px)operator(;) -operator(}) -type(a)class(.motd) operator({) - key(text-decoration)operator(:) value(none)operator(;) - key(color)operator(:)color(#FF9900)operator(;) -operator(}) -type(a)pseudo_class(:hover)class(.motd) operator({) - key(font-weight)operator(:) value(bold)operator(;) -operator(}) - -type(a)class(.hotmotd) operator({) - key(font-weight)operator(:) value(bold)operator(;) -operator(}) -class(.pagetitle) operator({) - key(font-family)operator(:) stringoperator(,) stringoperator(;) - key(font-size)operator(:) float(20px)operator(;) - key(color)operator(:) color(#FFFFFF)operator(;) -operator(}) -type(td)class(.footer) operator({) - key(background-image)operator(:) stringoperator(;) - key(background-repeat)operator(:) value(repeat-x)operator(;) - key(background-position)operator(:) value(top)operator(;) -operator(}) -class(.navhi) operator({) - key(color)operator(:) color(#00FF00)operator(;) - key(text-decoration)operator(:) value(underline)operator(;) -operator(}) -class(.colDkBlue) operator({) key(color)operator(:) color(#0000B0)operator(;) operator(}) -class(.colDkGreen) operator({) key(color)operator(:) color(#00B000)operator(;) operator(}) -class(.colDkCyan) operator({) key(color)operator(:) color(#00B0B0)operator(;) operator(}) -class(.colDkRed) operator({) key(color)operator(:) color(#B00000)operator(;) operator(}) -class(.colDkMagenta) operator({) key(color)operator(:) color(#B000CC)operator(;) operator(}) -class(.colDkYellow) operator({) key(color)operator(:) color(#B0B000)operator(;) operator(}) -class(.colDkWhite) operator({) key(color)operator(:) color(#B0B0B0)operator(;) operator(}) -class(.colLtBlue) operator({) key(color)operator(:) color(#0000FF)operator(;) operator(}) -class(.colLtGreen) operator({) key(color)operator(:) color(#00FF00)operator(;) operator(}) -class(.colLtCyan) operator({) key(color)operator(:) color(#00FFFF)operator(;) operator(}) -class(.colLtRed) operator({) key(color)operator(:) color(#FF0000)operator(;) operator(}) -class(.colLtMagenta) operator({) key(color)operator(:) color(#FF00FF)operator(;) operator(}) -class(.colLtYellow) operator({) key(color)operator(:) color(#FFFF00)operator(;) operator(}) -class(.colLtWhite) operator({) key(color)operator(:) color(#FFFFFF)operator(;) operator(}) -class(.colLtBlack) operator({) key(color)operator(:) color(#999999)operator(;) operator(}) -class(.trhead) operator({) key(background-color)operator(:)color(#990000)operator(;) key(color)operator(:)color(#FFFFFF)operator(;) operator(}) -class(.trlight) operator({) key(background-color)operator(:)color(#330000)operator(;) operator(}) -class(.trdark) operator({) key(background-color)operator(:)color(#000000)operator(;) operator(}) diff --git a/test/scanners/css/ignos-draconis.in.css b/test/scanners/css/ignos-draconis.in.css deleted file mode 100644 index 0df44cc..0000000 --- a/test/scanners/css/ignos-draconis.in.css +++ /dev/null @@ -1,1236 +0,0 @@ -/* CSS Document */ -td { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; -} -a{ - color: #0099FF; - text-decoration: none; -} -a.nav { - text-decoration: none; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - border-top: thin solid #000000; - border-bottom: thin solid #000000; - border-right: thin none #000000; - border-left: thin none #000000; -} -a:hover.nav { - background-color: #000000; - border-top: thin outset #000000; - border-right: thin none #000000; - border-bottom: thin outset #000000; - border-left: thin none #000000; -} -a.navhilite { - text-decoration: none; - width: 150px; - height: auto; - padding: 1px; - float: right; - clear: none; - color:#FFFF00; - background-color: #000000; - border-top: thin solid #000000; - border-bottom: thin solid #000000; - border-right: thin none #000000; - border-left: thin none #000000; -} -a:hover.navhilite { - background-color: #000000; - border-top: thin outset #000000; - border-right: thin none #000000; - border-bottom: thin outset #000000; - border-left: thin none #000000; -} -.navhelp { - text-decoration: none; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - border-top: thin solid #7B0000; - border-bottom: thin solid #000000; - border-right: thin none #000000; - border-left: thin none #000000; - cursor: default; -} -.navhead { - text-decoration: none; - width: 180px; - border: thin #000000; - height: auto; - padding: 1px; - line-height: 18px; - float: left; - clear: none; - xbackground-color: #000000; - font-weight: bold; - color: #ffffff; - cursor: default; - text-align: center; -} -table { -} -td.charinfo { - border-top-width: 1px; - border-top-style: solid; - border-top-color: #000000; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - cursor: default; -} -td.charhead { - background-color: #17007B; - border: none; - cursor: default; - color: #D8D8D8; -} -table.charinfo { - border: none; - width: 182px; -} -td.pageheader { - background-color: #484860; - background-image: url('../images/headbkg.gif'); - height: 69px -} -td.popupheader { - background-color: #484860; - background-image: url('../images/headbkg.gif'); - height: 20px -} -td.noborder { - border: none; -} -table.noborder { - border: none; -} -td.village { - background-image: url('../images/village.jpg'); - background-repeat: no-repeat; - background-position: right bottom -} -td.forest { - background-image: url('../images/forest.jpg'); - background-repeat: no-repeat; - background-position: center bottom -} -td.dragon { - background-image: url('../images/dragon.jpg'); - background-repeat: no-repeat; - background-position: center; - background-attachment: fixed -} -input { - background-color: #292843; - border: 1px solid #6A6A82; - color: #FFFFFF; -} -.button { -font-family: verdana,arial,helvetica,sans-serif; - font-size: 12px; - color: #FFFFFF; - background-color: #6A6A6E; - border-top: 1px solid #566294; - border-left: 1px solid #566294; - border-right: 1px solid #252540; - border-bottom: 1px solid #252540; -} -.image { - border:1px solid #4F4D80; -} -.imagesel { - border:1px solid #FF0000; -} -.input { - background-color: #5A595C; - border: 1px solid #737374; - color: #CCCCCC; -} -select { - background-color: #000000; - border: 1px solid #000000; - color: #CCCCCC; -} -table.vitalinfo { - background-color: #000000; - border: 1px solid #000000; - width: 182px; -} -table.nav { - background-color: #000000; - border: 1px solid #000000; - width: 182px; -} -a.motd { - text-decoration: none; - text-align: center; - color:#BDD6E6; - width: 181px; - height: 16px; - padding: 1px; - float: left; - clear: none; -} -a:hover.motd { - height: 14px; - width: 179px; - background-color: #566068; - border-top: thin solid #BDD6E6; - border-bottom: thin solid #BDD6E6; - border-right: thin solid #BDD6E6; - border-left: thin solid #BDD6E6; -} -a.hotmotd { - text-decoration: none; - text-align: center; - color:#BDD6E6; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - - background-color: #4F4D80; - border-top: thin solid #2400FF; - border-bottom: thin solid #2400FF; - border-right: thin solid #2400FF; - border-left: thin solid #2400FF; -} -.pagetitle { - font-family: "Old English Text MT", "Times New Roman"; - font-size: 20px; - color: #FFFFFF; -} -td.footer { - background-image: url('../images/rule.gif'); - background-repeat: repeat-x; - background-position-y:50% -} -.navhi { - color: #00FF00; - text-decoration: underline; -} -td.backgroundimage { - background-image: url('../images/drache-05.jpg'); - background-color: #0F1B25; - background-position: center center; -} -.colDkBlue { color: #0000B0; } -.colDkGreen { color: #00B000; } -.colDkCyan { color: #00B0B0; } -.colDkRed { color: #B00000; } -.colDkMagenta { color: #B000CC; } -.colDkYellow { color: #B0B000; } -.colDkWhite { color: #B0B0B0; } -.colLtBlue { color: #0000FF; } -.colLtGreen { color: #00FF00; } -.colLtCyan { color: #00FFFF; } -.colLtRed { color: #FF0000; } -.colLtMagenta { color: #FF00FF; } -.colLtYellow { color: #FFFF00; } -.colLtWhite { color: #FFFFFF; } -.colLtBlack { color: #999999; } -.colOrange { color: #FF9900; } -.colDkOrange { color: #FF6500;} -.colBlue { color: #0070FF; } -.colLime { color: #DDFFBB; } -.colRose { color: #EEBBEE; } -.colblueviolet { color: #9A5BEE; } -.coliceviolet{ color: #AABBEE; } -.colLtBrown { color: #F8DB83; } -.colDkBrown { color: #6b563f; } -.colXDkGreen {color: #003300; } -.colXLtGreen{color: #aaff99; } -.colBlack { color: #000000; } -.colAttention { background-color: #00FF00; color: #FF0000;} -.colWhiteBlack { background-color: #FFFFFF; color: #000000; } -.colBack { background-color:#00FFFF; color:#000000; } -.trhead { background-color:#990000; color:#FFFFFF; } -.trlight { background-color:#330000; } -.trdark { background-color:#000000; }/* CSS Document */ -td { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; -} -a{ - color: #0099FF; - text-decoration: none; -} -a.nav { - text-decoration: none; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - border-top: thin solid #000000; - border-bottom: thin solid #000000; - border-right: thin none #000000; - border-left: thin none #000000; -} -a:hover.nav { - background-color: #000000; - border-top: thin outset #000000; - border-right: thin none #000000; - border-bottom: thin outset #000000; - border-left: thin none #000000; -} -a.navhilite { - text-decoration: none; - width: 150px; - height: auto; - padding: 1px; - float: right; - clear: none; - color:#FFFF00; - background-color: #000000; - border-top: thin solid #000000; - border-bottom: thin solid #000000; - border-right: thin none #000000; - border-left: thin none #000000; -} -a:hover.navhilite { - background-color: #000000; - border-top: thin outset #000000; - border-right: thin none #000000; - border-bottom: thin outset #000000; - border-left: thin none #000000; -} -.navhelp { - text-decoration: none; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - border-top: thin solid #7B0000; - border-bottom: thin solid #000000; - border-right: thin none #000000; - border-left: thin none #000000; - cursor: default; -} -.navhead { - text-decoration: none; - width: 180px; - border: thin #000000; - height: auto; - padding: 1px; - line-height: 18px; - float: left; - clear: none; - xbackground-color: #000000; - font-weight: bold; - color: #ffffff; - cursor: default; - text-align: center; -} -table { -} -td.charinfo { - border-top-width: 1px; - border-top-style: solid; - border-top-color: #000000; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - cursor: default; -} -td.charhead { - background-color: #7B0000; - border: none; - cursor: default; - color: #FFFF00; -} -table.charinfo { - border: none; - width: 182px; -} -td.pageheader { - background-color: #333399; - background-image: url('../images/headbkg.gif'); - height: 69px -} -td.popupheader { - background-color: #333399; - background-image: url('../images/headbkg.gif'); - height: 20px -} -td.noborder { - border: none; -} -table.noborder { - border: none; -} -td.village { - background-image: url('../images/village.jpg'); - background-repeat: no-repeat; - background-position: right bottom -} -td.forest { - background-image: url('../images/forest.jpg'); - background-repeat: no-repeat; - background-position: center bottom -} -td.dragon { - background-image: url('../images/dragon.jpg'); - background-repeat: no-repeat; - background-position: center; - background-attachment: fixed -} -input { - background-color: #433828; - border: 1px solid #806B4D; - color: #CCCCCC; -} -.button { -font-family: verdana,arial,helvetica,sans-serif; - font-size: 12px; - color: #F8DB83; - background-color: #6b563f; - border-top: 1px solid #947356; - border-left: 1px solid #947356; - border-right: 1px solid #403225; - border-bottom: 1px solid #403225; -} -.image { - border:1px solid #806B4D; -} -.imagesel { - border:1px solid #FF0000; -} -.input { - background-color: #433828; - border: 1px solid #806B4D; - color: #CCCCCC; -} -select { - background-color: #000000; - border: 1px solid #000000; - color: #CCCCCC; -} -table.vitalinfo { - background-color: #000000; - border: 1px solid #000000; - width: 182px; -} -table.nav { - background-color: #000000; - border: 1px solid #000000; - width: 182px; -} -a.motd { - text-decoration: none; - text-align: center; - color:#FF9900; - width: 181px; - height: 16px; - padding: 1px; - float: left; - clear: none; -} -a:hover.motd { - height: 14px; - width: 179px; - background-color: #806B4D; - border-top: thin solid #FF9900; - border-bottom: thin solid #FF9900; - border-right: thin solid #FF9900; - border-left: thin solid #FF9900; -} -a.hotmotd { - text-decoration: none; - text-align: center; - color:#FF9900; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - - background-color: #806B4D; - border-top: thin solid #FF9900; - border-bottom: thin solid #FF9900; - border-right: thin solid #FF9900; - border-left: thin solid #FF9900; -} -.pagetitle { - font-family: "Old English Text MT", "Times New Roman"; - font-size: 20px; - color: #FFFFFF; -} -td.footer { - background-image: url('../images/rule.gif'); - background-repeat: repeat-x; - background-position-y:50% -} -.navhi { - color: #00FF00; - text-decoration: underline; -} -td.backgroundimage { - background-image: url('../images/drache-05.jpg'); - background-color: #0F1B25; - background-position: center center; -} -.colDkBlue { color: #0000B0; } -.colDkGreen { color: #00B000; } -.colDkCyan { color: #00B0B0; } -.colDkRed { color: #B00000; } -.colDkMagenta { color: #B000CC; } -.colDkYellow { color: #B0B000; } -.colDkWhite { color: #B0B0B0; } -.colLtBlue { color: #0000FF; } -.colLtGreen { color: #00FF00; } -.colLtCyan { color: #00FFFF; } -.colLtRed { color: #FF0000; } -.colLtMagenta { color: #FF00FF; } -.colLtYellow { color: #FFFF00; } -.colLtWhite { color: #FFFFFF; } -.colLtBlack { color: #999999; } -.colOrange { color: #FF9900; } -.colDkOrange { color: #FF6500;} -.colBlue { color: #0070FF; } -.colLime { color: #DDFFBB; } -.colRose { color: #EEBBEE; } -.colblueviolet { color: #9A5BEE; } -.coliceviolet{ color: #AABBEE; } -.colLtBrown { color: #F8DB83; } -.colDkBrown { color: #6b563f; } -.colXDkGreen {color: #003300; } -.colXLtGreen{color: #aaff99; } -.colBlack { color: #000000; } -.colAttention { background-color: #00FF00; color: #FF0000;} -.colWhiteBlack { background-color: #FFFFFF; color: #000000; } -.colBack { background-color:#00FFFF; color:#000000; } -.trhead { background-color:#990000; color:#FFFFFF; } -.trlight { background-color:#330000; } -.trdark { background-color:#000000; }/* CSS Document */ -td { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; -} -a{ - color: #0099FF; - text-decoration: none; -} -a.nav { - text-decoration: none; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - border-top: thin solid #003366; - border-bottom: thin solid #003366; - border-right: thin none #003366; - border-left: thin none #003366; -} -a:hover.nav { - background-color: #003366; - border-top: thin outset #003366; - border-right: thin none #003366; - border-bottom: thin outset #003366; - border-left: thin none #003366; -} -a.navhilite { - text-decoration: none; - width: 150px; - height: auto; - padding: 1px; - float: right; - clear: none; - color:#FFFF00; - background-color: #330000; - border-top: thin solid #330000; - border-bottom: thin solid #330000; - border-right: thin none #330000; - border-left: thin none #330000; -} -a:hover.navhilite { - background-color: #990000; - border-top: thin outset #CC0000; - border-right: thin none #CC0000; - border-bottom: thin outset #CC0000; - border-left: thin none #CC0000; -} -.navhelp { - text-decoration: none; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - border-top: thin solid #003366; - border-bottom: thin solid #003366; - border-right: thin none #003366; - border-left: thin none #003366; - cursor: default; -} -.navhead { - text-decoration: none; - width: 180px; - border: thin #003366; - height: auto; - padding: 1px; - line-height: 18px; - float: left; - clear: none; - xbackground-color: #000066; - font-weight: bold; - color: #00CCFF; - cursor: default; - text-align: center; -} -table { -} -td.charinfo { - border-top-width: 1px; - border-top-style: solid; - border-top-color: #009900; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - cursor: default; -} -td.charhead { - background-color: #009900; - border: none; - cursor: default; - color: #FFFF00; -} -table.charinfo { - border: none; - width: 182px; -} -td.pageheader { - background-color: #333399; - background-image: url(../images/headbkg.gif); - height: 69px; -} -td.popupheader { - background-color: #333399; - background-image: url(../images/headbkg.gif); - height: 20px; -} -td.noborder { - border: none; -} -table.noborder { - border: none; -} -td.village { - background-image: url(../images/village.jpg); - background-repeat: no-repeat; - background-position: right bottom; -} -td.forest { - background-image: url(../images/forest.jpg); - background-repeat: no-repeat; - background-position: center bottom; -} -td.dragon { - background-image: url(../images/dragon.jpg); - background-repeat: no-repeat; - background-position: center center; - background-attachment: fixed; -} -input { - background-color: #433828; - border: 1px solid #806B4D; - color: #CCCCCC; -} -.button { -font-family: verdana,arial,helvetica,sans-serif; - font-size: 10px; - color: #F8DB83; - background-color: #6b563f; - border-top: 1px solid #947356; - border-left: 1px solid #947356; - border-right: 1px solid #403225; - border-bottom: 1px solid #403225; -} -.image { - border:1px solid #806B4D; -} -.imagesel { - border:1px solid #FF0000; -} -.input { - background-color: #433828; - border: 1px solid #806B4D; - color: #CCCCCC; -} -select { - background-color: #433828; - border: 1px solid #806B4D; - color: #CCCCCC; -} -table.vitalinfo { - background-color: #003300; - border: 1px solid #000000; - width: 182px; -} -table.nav { - background-color: #003366; - border: 1px solid #000000; - width: 182px; -} -a.motd { - text-decoration: none; - text-align: center; - color:#FF9900; - width: 181px; - height: 16px; - padding: 1px; - float: left; - clear: none; -} -a:hover.motd { - height: 14px; - width: 179px; - background-color: #806B4D; - border-top: thin solid #FF9900; - border-bottom: thin solid #FF9900; - border-right: thin solid #FF9900; - border-left: thin solid #FF9900; -} -a.hotmotd { - text-decoration: none; - text-align: center; - color:#FF9900; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - - background-color: #806B4D; - border-top: thin solid #FF9900; - border-bottom: thin solid #FF9900; - border-right: thin solid #FF9900; - border-left: thin solid #FF9900; -} -.pagetitle { - font-family: "Old English Text MT", "Times New Roman"; - font-size: 20px; - color: #FFFFFF; -} -td.footer { - background-image: url(../images/rule.gif); - background-repeat: repeat-x; - background-position: top; -} -.navhi { - color: #00FF00; - text-decoration: underline; -} -.colDkBlue { color: #0000B0; } -.colDkGreen { color: #00B000; } -.colDkCyan { color: #00B0B0; } -.colDkRed { color: #B00000; } -.colDkMagenta { color: #B000CC; } -.colDkYellow { color: #B0B000; } -.colDkWhite { color: #B0B0B0; } -.colLtBlue { color: #0000FF; } -.colLtGreen { color: #00FF00; } -.colLtCyan { color: #00FFFF; } -.colLtRed { color: #FF0000; } -.colLtMagenta { color: #FF00FF; } -.colLtYellow { color: #FFFF00; } -.colLtWhite { color: #FFFFFF; } -.colLtBlack { color: #999999; } -.colOrange { color: #FF9900; } -.colDkOrange { color: #FF6500;} -.colBlue { color: #0070FF; } -.colLime { color: #DDFFBB; } -.colRose { color: #EEBBEE; } -.colblueviolet { color: #9A5BEE; } -.coliceviolet{ color: #AABBEE; } -.colLtBrown { color: #F8DB83; } -.colDkBrown { color: #6b563f; } -.colXDkGreen {color: #003300; } -.colXLtGreen{color: #aaff99; } -.colBlack { color: #000000; } -.colAttention { background-color: #00FF00; color: #FF0000;} -.colWhiteBlack { background-color: #FFFFFF; color: #000000; } -.colBack { background-color:#00FFFF; color:#000000; } -.trhead { background-color:#990000; color:#FFFFFF; } -.trlight { background-color:#330000; } -.trdark { background-color:#000000; } -/* CSS Document */ -td { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; -} -a{ - color: #0099FF; - text-decoration: none; -} -a.nav { - text-decoration: none; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - border-top: thin solid #000000; - border-bottom: thin solid #000000; - border-right: thin none #000000; - border-left: thin none #000000; -} -a:hover.nav { - background-color: #000000; - border-top: thin outset #000000; - border-right: thin none #000000; - border-bottom: thin outset #000000; - border-left: thin none #000000; -} -a.navhilite { - text-decoration: none; - width: 150px; - height: auto; - padding: 1px; - float: right; - clear: none; - color:#FFFF00; - background-color: #000000; - border-top: thin solid #000000; - border-bottom: thin solid #000000; - border-right: thin none #000000; - border-left: thin none #000000; -} -a:hover.navhilite { - background-color: #000000; - border-top: thin outset #000000; - border-right: thin none #000000; - border-bottom: thin outset #000000; - border-left: thin none #000000; -} -.navhelp { - text-decoration: none; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - border-top: thin solid #000000; - border-bottom: thin solid #000000; - border-right: thin none #000000; - border-left: thin none #000000; - cursor: default; -} -.navhead { - text-decoration: none; - width: 180px; - border: thin #000000; - height: auto; - padding: 1px; - line-height: 18px; - float: left; - clear: none; - xbackground-color: #000000; - font-weight: bold; - color: #ffffff; - cursor: default; - text-align: center; -} -table { -} -td.charinfo { - border-top-width: 1px; - border-top-style: solid; - border-top-color: #000000; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - cursor: default; -} -td.charhead { - background-color: #7B0000; - border: none; - cursor: default; - color: #FFFF00; -} -table.charinfo { - border: none; - width: 182px; -} -td.pageheader { - background-color: #000000; - background-image: url('../images/headbkg4.gif'); - height: 69px -} -td.popupheader { - background-color: #000000; - background-image: url('../images/headbkg4.gif'); - height: 20px -} -td.noborder { - border: none; -} -table.noborder { - border: none; -} -td.village { - background-image: url('../images/village.jpg'); - background-repeat: no-repeat; - background-position: right bottom -} -td.forest { - background-image: url('../images/forest.jpg'); - background-repeat: no-repeat; - background-position: center bottom -} -td.dragon { - background-image: url('../images/dragon.jpg'); - background-repeat: no-repeat; - background-position: center; - background-attachment: fixed -} -input { - background-color: #433828; - border: 1px solid #806B4D; - color: #CCCCCC; -} -.button { -font-family: verdana,arial,helvetica,sans-serif; - font-size: 10px; - color: #F8DB83; - background-color: #6b563f; - border-top: 1px solid #947356; - border-left: 1px solid #947356; - border-right: 1px solid #403225; - border-bottom: 1px solid #403225; -} -.image { - border:1px solid #000000; -} -.imagesel { - border:1px solid #000000; -} -.input { - background-color: #433828; - border: 1px solid #806B4D; - color: #CCCCCC; -} -select { - background-color: #000000; - border: 1px solid #000000; - color: #CCCCCC; -} -table.vitalinfo { - background-color: #000000; - border: 1px solid #000000; - width: 182px; -} -table.nav { - background-color: #000000; - border: 1px solid #000000; - width: 182px; -} -a.motd { - text-decoration: none; - text-align: center; - color:#FF9900; - width: 181px; - height: 16px; - padding: 1px; - float: left; - clear: none; -} -a:hover.motd { - height: 14px; - width: 179px; - background-color: #806B4D; - border-top: thin solid #FF9900; - border-bottom: thin solid #FF9900; - border-right: thin solid #FF9900; - border-left: thin solid #FF9900; -} -a.hotmotd { - text-decoration: none; - text-align: center; - color:#FF9900; - width: 181px; - height: auto; - padding: 1px; - float: left; - clear: none; - - background-color: #806B4D; - border-top: thin solid #FF9900; - border-bottom: thin solid #FF9900; - border-right: thin solid #FF9900; - border-left: thin solid #FF9900; -} -.pagetitle { - font-family: "Old English Text MT", "Times New Roman"; - font-size: 20px; - color: #FFFFFF; -} -td.footer { - background-image: url('../images/rule.gif'); - background-repeat: repeat-x; - background-position-y:50% -} -.navhi { - color: #00FF00; - text-decoration: underline; -} -.colDkBlue { color: #0000B0; } -.colDkGreen { color: #00B000; } -.colDkCyan { color: #00B0B0; } -.colDkRed { color: #B00000; } -.colDkMagenta { color: #B000CC; } -.colDkYellow { color: #B0B000; } -.colDkWhite { color: #B0B0B0; } -.colLtBlue { color: #0000FF; } -.colLtGreen { color: #00FF00; } -.colLtCyan { color: #00FFFF; } -.colLtRed { color: #FF0000; } -.colLtMagenta { color: #FF00FF; } -.colLtYellow { color: #FFFF00; } -.colLtWhite { color: #FFFFFF; } -.colLtBlack { color: #999999; } -.colOrange { color: #FF9900; } -.colDkOrange { color: #FF6500;} -.colBlue { color: #0070FF; } -.colLime { color: #DDFFBB; } -.colRose { color: #EEBBEE; } -.colblueviolet { color: #9A5BEE; } -.coliceviolet{ color: #AABBEE; } -.colLtBrown { color: #F8DB83; } -.colDkBrown { color: #6b563f; } -.colXDkGreen {color: #003300; } -.colXLtGreen{color: #aaff99; } -.colBlack { color: #000000; } -.colAttention { background-color: #00FF00; color: #FF0000;} -.colWhiteBlack { background-color: #FFFFFF; color: #000000; } -.colBack { background-color:#00FFFF; color:#000000; } -.trhead { background-color:#990000; color:#FFFFFF; } -.trlight { background-color:#330000; } -.trdark { background-color:#000000; }/* CSS Document */ -td { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; -} - -table.nav { - background-color: #000033; - border: 1px solid #000000; - height: auto; - width: 135px; -} - -.navhead { - text-decoration: none; - width: 137px; - height: auto; - padding: 1px; - line-height: 18px; - float: left; - clear: none; - background-color: #000099; - font-weight: bold; - color: #FFFF00; - cursor: default; - text-align: center; -} - -a { - color: #0099FF; - text-decoration: none; -} - -a.nav { - text-decoration: none; - width: 135px; - height: auto; - padding: 1px; - float: left; - clear: none; - background-color: #000033; - border: 1px solid #000033; -} - -.navhelp { - text-decoration: none; - width: 135px; - height: auto; - padding: 1px; - float: left; - clear: none; - background-color: #000033; - border: 1px solid #000033; -} - -a:hover.nav { - background-color: #003366; - border-top: 1px solid #0364A3; - border-left: 1px solid #0364A3; - border-bottom: 1px solid #000000; - border-right: 1px solid #000000; -} -a.navhilite { - text-decoration: none; - width: 135px; - height: auto; - padding: 1px; - float: right; - clear: none; - color:#FFFF00; - background-color: #330000; - border-top: thin solid #330000; - border-bottom: thin solid #330000; - border-right: thin none #330000; - border-left: thin none #330000; -} -a:hover.navhilite { - background-color: #990000; - border-top: thin outset #CC0000; - border-right: thin none #CC0000; - border-bottom: thin outset #CC0000; - border-left: thin none #CC0000; -} - - -table { -} -td.charinfo { - border-top-width: 1px; - border-top-style: solid; - border-top-color: #009900; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - cursor: default; -} -td.charhead { - background-color: #009900; - border: none; - cursor: default; - color: #FFFF00; -} -table.charinfo { - border: none; - width: 140px; -} -td.pageheader { - background-color: #333399; - background-image: url(../images/headbkg.gif); - height: 60px; -} -td.popupheader { - background-color: #333399; - background-image: url(../images/headbkg.gif); - height: 20px; -} -td.noborder { - border: none; -} -table.noborder { - border: none; -} -td.village { - background-image: url(../images/village.jpg); - background-repeat: no-repeat; - background-position: right bottom; -} -td.forest { - background-image: url(../images/forest.jpg); - background-repeat: no-repeat; - background-position: center bottom; -} -td.dragon { - background-image: url(../images/dragon.jpg); - background-repeat: no-repeat; - background-position: center center; - background-attachment: fixed; -} -input { - background-color: #433828; - border: 1px solid #806B4D; - color: #CCCCCC; -} -.button { -font-family: verdana,arial,helvetica,sans-serif; - font-size: 12px; - color: #F8DB83; - background-color: #6b563f; - border-top: 1px solid #947356; - border-left: 1px solid #947356; - border-right: 1px solid #403225; - border-bottom: 1px solid #403225; -} -.image { - border:1px solid #806B4D; -} -.imagesel { - border:1px solid #FF0000; -} -.input { - background-color: #433828; - border: 1px solid #806B4D; - color: #CCCCCC; -} -select { - background-color: #433828; - border: 1px solid #806B4D; - color: #CCCCCC; -} -table.vitalinfo { - background-color: #003300; - border: 1px solid #000000; - width: 182px; -} -a.motd { - text-decoration: none; - color:#FF9900; -} -a:hover.motd { - font-weight: bold; -} - -a.hotmotd { - font-weight: bold; -} -.pagetitle { - font-family: "Old English Text MT", "Times New Roman"; - font-size: 20px; - color: #FFFFFF; -} -td.footer { - background-image: url(../images/rule.gif); - background-repeat: repeat-x; - background-position: top; -} -.navhi { - color: #00FF00; - text-decoration: underline; -} -.colDkBlue { color: #0000B0; } -.colDkGreen { color: #00B000; } -.colDkCyan { color: #00B0B0; } -.colDkRed { color: #B00000; } -.colDkMagenta { color: #B000CC; } -.colDkYellow { color: #B0B000; } -.colDkWhite { color: #B0B0B0; } -.colLtBlue { color: #0000FF; } -.colLtGreen { color: #00FF00; } -.colLtCyan { color: #00FFFF; } -.colLtRed { color: #FF0000; } -.colLtMagenta { color: #FF00FF; } -.colLtYellow { color: #FFFF00; } -.colLtWhite { color: #FFFFFF; } -.colLtBlack { color: #999999; } -.trhead { background-color:#990000; color:#FFFFFF; } -.trlight { background-color:#330000; } -.trdark { background-color:#000000; } diff --git a/test/scanners/css/redmine.expected.raydebug b/test/scanners/css/redmine.expected.raydebug deleted file mode 100644 index c5a9415..0000000 --- a/test/scanners/css/redmine.expected.raydebug +++ /dev/null @@ -1,685 +0,0 @@ -type(body) operator({) key(font-family)operator(:) value(Verdana)operator(,) value(sans-serif)operator(;) key(font-size)operator(:) float(12px)operator(;) key(color)operator(:)color(#484848)operator(;) key(margin)operator(:) float(0)operator(;) key(padding)operator(:) float(0)operator(;) key(min-width)operator(:) float(900px)operator(;) operator(}) - -type(h1)operator(,) type(h2)operator(,) type(h3)operator(,) type(h4) operator({) key(font-family)operator(:) stringoperator(,) value(Verdana)operator(,) value(sans-serif)operator(;)operator(}) -type(h1) operator({)key(margin)operator(:)float(0)operator(;) key(padding)operator(:)float(0)operator(;) key(font-size)operator(:) float(24px)operator(;)operator(}) -type(h2)operator(,) class(.wiki) type(h1) operator({)key(font-size)operator(:) float(20px)operator(;)key(padding)operator(:) float(2px) float(10px) float(1px) float(0px)operator(;)key(margin)operator(:) float(0) float(0) float(10px) float(0)operator(;) key(border-bottom)operator(:) float(1px) value(solid) color(#bbbbbb)operator(;) key(color)operator(:) color(#444)operator(;)operator(}) -type(h3)operator(,) class(.wiki) type(h2) operator({)key(font-size)operator(:) float(16px)operator(;)key(padding)operator(:) float(2px) float(10px) float(1px) float(0px)operator(;)key(margin)operator(:) float(0) float(0) float(10px) float(0)operator(;) key(border-bottom)operator(:) float(1px) value(solid) color(#bbbbbb)operator(;) key(color)operator(:) color(#444)operator(;)operator(}) -type(h4)operator(,) class(.wiki) type(h3) operator({)key(font-size)operator(:) float(13px)operator(;)key(padding)operator(:) float(2px) float(10px) float(1px) float(0px)operator(;)key(margin-bottom)operator(:) float(5px)operator(;) key(border-bottom)operator(:) float(1px) value(dotted) color(#bbbbbb)operator(;) key(color)operator(:) color(#444)operator(;)operator(}) - -comment(/*)comment(****) comment(Layout) comment(****)comment(*/) -constant(#wrapper) operator({)key(background)operator(:) value(white)operator(;)operator(}) - -constant(#top-menu) operator({)key(background)operator(:) color(#2C4056)operator(;) key(color)operator(:) color(#fff)operator(;) key(height)operator(:)float(1.8em)operator(;) key(font-size)operator(:) float(0.8em)operator(;) key(padding)operator(:) float(2px) float(2px) float(0px) float(6px)operator(;)operator(}) -constant(#top-menu) type(ul) operator({)key(margin)operator(:) float(0)operator(;) key(padding)operator(:) float(0)operator(;)operator(}) -constant(#top-menu) type(li) operator({) - key(float)operator(:)value(left)operator(;) - key(list-style-type)operator(:)value(none)operator(;) - key(margin)operator(:) float(0px) float(0px) float(0px) float(0px)operator(;) - key(padding)operator(:) float(0px) float(0px) float(0px) float(0px)operator(;) - key(white-space)operator(:)value(nowrap)operator(;) -operator(}) -constant(#top-menu) type(a) operator({)key(color)operator(:) color(#fff)operator(;) key(margin-right)operator(:) float(8px)operator(;) key(font-weight)operator(:) value(bold)operator(;)operator(}) -constant(#top-menu) constant(#loggedas) operator({) key(float)operator(:) value(right)operator(;) key(margin-right)operator(:) float(0.5em)operator(;) key(color)operator(:) color(#fff)operator(;) operator(}) - -constant(#account) operator({)key(float)operator(:)value(right)operator(;)operator(}) - -constant(#header) operator({)key(height)operator(:)float(5.3em)operator(;)key(margin)operator(:)float(0)operator(;)key(background-color)operator(:)color(#507AAA)operator(;)key(color)operator(:)color(#f8f8f8)operator(;) key(padding)operator(:) float(4px) float(8px) float(0px) float(6px)operator(;) key(position)operator(:)value(relative)operator(;)operator(}) -constant(#header) type(a) operator({)key(color)operator(:)color(#f8f8f8)operator(;)operator(}) -constant(#quick-search) operator({)key(float)operator(:)value(right)operator(;)operator(}) - -constant(#main-menu) operator({)key(position)operator(:) value(absolute)operator(;) key(bottom)operator(:) float(0px)operator(;) key(left)operator(:)float(6px)operator(;) key(margin-right)operator(:) float(-500px)operator(;)operator(}) -constant(#main-menu) type(ul) operator({)key(margin)operator(:) float(0)operator(;) key(padding)operator(:) float(0)operator(;)operator(}) -constant(#main-menu) type(li) operator({) - key(float)operator(:)value(left)operator(;) - key(list-style-type)operator(:)value(none)operator(;) - key(margin)operator(:) float(0px) float(2px) float(0px) float(0px)operator(;) - key(padding)operator(:) float(0px) float(0px) float(0px) float(0px)operator(;) - key(white-space)operator(:)value(nowrap)operator(;) -operator(}) -constant(#main-menu) type(li) type(a) operator({) - key(display)operator(:) value(block)operator(;) - key(color)operator(:) color(#fff)operator(;) - key(text-decoration)operator(:) value(none)operator(;) - key(font-weight)operator(:) value(bold)operator(;) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(4px) float(10px) float(4px) float(10px)operator(;) -operator(}) -constant(#main-menu) type(li) type(a)pseudo_class(:hover) operator({)key(background)operator(:)color(#759FCF)operator(;) key(color)operator(:)color(#fff)operator(;)operator(}) -constant(#main-menu) type(li) type(a)class(.selected)operator(,) constant(#main-menu) type(li) type(a)class(.selected)pseudo_class(:hover) operator({)key(background)operator(:)color(#fff)operator(;) key(color)operator(:)color(#555)operator(;)operator(}) - -constant(#main) operator({)key(background-color)operator(:)color(#EEEEEE)operator(;)operator(}) - -constant(#sidebar)operator({) key(float)operator(:) value(right)operator(;) key(width)operator(:) float(17%)operator(;) key(position)operator(:) value(relative)operator(;) key(z-index)operator(:) float(9)operator(;) key(min-height)operator(:) float(600px)operator(;) key(padding)operator(:) float(0)operator(;) key(margin)operator(:) float(0)operator(;)operator(}) -type(*) type(html) constant(#sidebar)operator({) key(width)operator(:) float(17%)operator(;) operator(}) -constant(#sidebar) type(h3)operator({) key(font-size)operator(:) float(14px)operator(;) key(margin-top)operator(:)float(14px)operator(;) key(color)operator(:) color(#666)operator(;) operator(}) -constant(#sidebar) type(hr)operator({) key(width)operator(:) float(100%)operator(;) key(margin)operator(:) float(0) value(auto)operator(;) key(height)operator(:) float(1px)operator(;) key(background)operator(:) color(#ccc)operator(;) key(border)operator(:) float(0)operator(;) operator(}) -type(*) type(html) constant(#sidebar) type(hr)operator({) key(width)operator(:) float(95%)operator(;) key(position)operator(:) value(relative)operator(;) key(left)operator(:) float(-6px)operator(;) key(color)operator(:) color(#ccc)operator(;) operator(}) - -constant(#content) operator({) key(width)operator(:) float(80%)operator(;) key(background-color)operator(:) color(#fff)operator(;) key(margin)operator(:) float(0px)operator(;) key(border-right)operator(:) float(1px) value(solid) color(#ddd)operator(;) key(padding)operator(:) float(6px) float(10px) float(10px) float(10px)operator(;) key(z-index)operator(:) float(10)operator(;) operator(}) -type(*) type(html) constant(#content)operator({) key(width)operator(:) float(80%)operator(;) key(padding-left)operator(:) float(0)operator(;) key(margin-top)operator(:) float(0px)operator(;) key(padding)operator(:) float(6px) float(10px) float(10px) float(10px)operator(;)operator(}) -type(html)operator(>)type(body) constant(#content) operator({) key(min-height)operator(:) float(600px)operator(;) operator(}) -type(*) type(html) type(body) constant(#content) operator({) key(height)operator(:) float(600px)operator(;) operator(}) comment(/*) comment(IE) comment(*/) - -constant(#main)class(.nosidebar) constant(#sidebar)operator({) key(display)operator(:) value(none)operator(;) operator(}) -constant(#main)class(.nosidebar) constant(#content)operator({) key(width)operator(:) value(auto)operator(;) key(border-right)operator(:) float(0)operator(;) operator(}) - -constant(#footer) operator({)key(clear)operator(:) value(both)operator(;) key(border-top)operator(:) float(1px) value(solid) color(#bbb)operator(;) key(font-size)operator(:) float(0.9em)operator(;) key(color)operator(:) color(#aaa)operator(;) key(padding)operator(:) float(5px)operator(;) key(text-align)operator(:)value(center)operator(;) key(background)operator(:)color(#fff)operator(;)operator(}) - -constant(#login-form) type(table) operator({)key(margin-top)operator(:)float(5em)operator(;) key(padding)operator(:)float(1em)operator(;) key(margin-left)operator(:) value(auto)operator(;) key(margin-right)operator(:) value(auto)operator(;) key(border)operator(:) float(2px) value(solid) color(#FDBF3B)operator(;) key(background-color)operator(:)color(#FFEBC1)operator(;) operator(}) -constant(#login-form) type(table) type(td) operator({)key(padding)operator(:) float(6px)operator(;)operator(}) -constant(#login-form) type(label) operator({)key(font-weight)operator(:) value(bold)operator(;)operator(}) - -class(.clear)pseudo_class(:after)operator({) key(content)operator(:) stringoperator(;) key(display)operator(:) value(block)operator(;) key(height)operator(:) float(0)operator(;) key(clear)operator(:) value(both)operator(;) key(visibility)operator(:) value(hidden)operator(;) operator(}) - -comment(/*)comment(****) comment(Links) comment(****)comment(*/) -type(a)operator(,) type(a)pseudo_class(:link)operator(,) type(a)pseudo_class(:visited)operator({) key(color)operator(:) color(#2A5685)operator(;) key(text-decoration)operator(:) value(none)operator(;) operator(}) -type(a)pseudo_class(:hover)operator(,) type(a)pseudo_class(:active)operator({) key(color)operator(:) color(#c61a1a)operator(;) key(text-decoration)operator(:) value(underline)operator(;)operator(}) -type(a) type(img)operator({) key(border)operator(:) float(0)operator(;) operator(}) - -type(a)class(.issue)class(.closed) operator({) key(text-decoration)operator(:) value(line-through)operator(;) operator(}) - -comment(/*)comment(****) comment(Tables) comment(****)comment(*/) -type(table)class(.list) operator({) key(border)operator(:) float(1px) value(solid) color(#e4e4e4)operator(;) key(border-collapse)operator(:) value(collapse)operator(;) key(width)operator(:) float(100%)operator(;) key(margin-bottom)operator(:) float(4px)operator(;) operator(}) -type(table)class(.list) type(th) operator({) key(background-color)operator(:)color(#EEEEEE)operator(;) key(padding)operator(:) float(4px)operator(;) key(white-space)operator(:)value(nowrap)operator(;) operator(}) -type(table)class(.list) type(td) operator({) key(vertical-align)operator(:) value(top)operator(;) operator(}) -type(table)class(.list) type(td)class(.id) operator({) key(width)operator(:) float(2%)operator(;) key(text-align)operator(:) value(center)operator(;)operator(}) -type(table)class(.list) type(td)class(.checkbox) operator({) key(width)operator(:) float(15px)operator(;) key(padding)operator(:) float(0px)operator(;)operator(}) - -type(tr)class(.issue) operator({) key(text-align)operator(:) value(center)operator(;) key(white-space)operator(:) value(nowrap)operator(;) operator(}) -type(tr)class(.issue) type(td)class(.subject)operator(,) type(tr)class(.issue) type(td)class(.category)operator(,) type(td)class(.assigned_to) operator({) key(white-space)operator(:) value(normal)operator(;) operator(}) -type(tr)class(.issue) type(td)class(.subject) operator({) key(text-align)operator(:) value(left)operator(;) operator(}) -type(tr)class(.issue) type(td)class(.done_ratio) type(table)class(.progress) operator({) key(margin-left)operator(:)value(auto)operator(;) key(margin-right)operator(:) value(auto)operator(;)operator(}) - -type(tr)class(.entry) operator({) key(border)operator(:) float(1px) value(solid) color(#f8f8f8)operator(;) operator(}) -type(tr)class(.entry) type(td) operator({) key(white-space)operator(:) value(nowrap)operator(;) operator(}) -type(tr)class(.entry) type(td)class(.filename) operator({) key(width)operator(:) float(30%)operator(;) operator(}) -type(tr)class(.entry) type(td)class(.size) operator({) key(text-align)operator(:) value(right)operator(;) key(font-size)operator(:) float(90%)operator(;) operator(}) -type(tr)class(.entry) type(td)class(.revision)operator(,) type(tr)class(.entry) type(td)class(.author) operator({) key(text-align)operator(:) value(center)operator(;) operator(}) -type(tr)class(.entry) type(td)class(.age) operator({) key(text-align)operator(:) value(right)operator(;) operator(}) - -type(tr)class(.entry) type(span)class(.expander) operator({)key(background-image)operator(:) stringoperator(;) key(padding-left)operator(:) float(8px)operator(;) key(margin-left)operator(:) float(0)operator(;) key(cursor)operator(:) value(pointer)operator(;)operator(}) -type(tr)class(.entry)class(.open) type(span)class(.expander) operator({)key(background-image)operator(:) stringoperator(;)operator(}) -type(tr)class(.entry)class(.file) type(td)class(.filename) type(a) operator({) key(margin-left)operator(:) float(16px)operator(;) operator(}) - -type(tr)class(.changeset) type(td)class(.author) operator({) key(text-align)operator(:) value(center)operator(;) key(width)operator(:) float(15%)operator(;) operator(}) -type(tr)class(.changeset) type(td)class(.committed_on) operator({) key(text-align)operator(:) value(center)operator(;) key(width)operator(:) float(15%)operator(;) operator(}) - -type(tr)class(.message) operator({) key(height)operator(:) float(2.6em)operator(;) operator(}) -type(tr)class(.message) type(td)class(.last_message) operator({) key(font-size)operator(:) float(80%)operator(;) operator(}) -type(tr)class(.message)class(.locked) type(td)class(.subject) type(a) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(tr)class(.message)class(.sticky) type(td)class(.subject) type(a) operator({) key(background-image)operator(:) stringoperator(;) key(font-weight)operator(:) value(bold)operator(;) operator(}) - -type(tr)class(.user) type(td) operator({) key(width)operator(:)float(13%)operator(;) operator(}) -type(tr)class(.user) type(td)class(.email) operator({) key(width)operator(:)float(18%)operator(;) operator(}) -type(tr)class(.user) type(td) operator({) key(white-space)operator(:) value(nowrap)operator(;) operator(}) -type(tr)class(.user)class(.locked)operator(,) type(tr)class(.user)class(.registered) operator({) key(color)operator(:) color(#aaa)operator(;) operator(}) -type(tr)class(.user)class(.locked) type(a)operator(,) type(tr)class(.user)class(.registered) type(a) operator({) key(color)operator(:) color(#aaa)operator(;) operator(}) - -type(tr)class(.time-entry) operator({) key(text-align)operator(:) value(center)operator(;) key(white-space)operator(:) value(nowrap)operator(;) operator(}) -type(tr)class(.time-entry) type(td)class(.subject)operator(,) type(tr)class(.time-entry) type(td)class(.comments) operator({) key(text-align)operator(:) value(left)operator(;) key(white-space)operator(:) value(normal)operator(;) operator(}) -type(td)class(.hours) operator({) key(text-align)operator(:) value(right)operator(;) key(font-weight)operator(:) value(bold)operator(;) key(padding-right)operator(:) float(0.5em)operator(;) operator(}) -type(td)class(.hours) class(.hours-dec) operator({) key(font-size)operator(:) float(0.9em)operator(;) operator(}) - -type(table)class(.plugins) type(td) operator({) key(vertical-align)operator(:) value(middle)operator(;) operator(}) -type(table)class(.plugins) type(td)class(.configure) operator({) key(text-align)operator(:) value(right)operator(;) key(padding-right)operator(:) float(1em)operator(;) operator(}) -type(table)class(.plugins) type(span)class(.name) operator({) key(font-weight)operator(:) value(bold)operator(;) key(display)operator(:) value(block)operator(;) key(margin-bottom)operator(:) float(6px)operator(;) operator(}) -type(table)class(.plugins) type(span)class(.description) operator({) key(display)operator(:) value(block)operator(;) key(font-size)operator(:) float(0.9em)operator(;) operator(}) -type(table)class(.plugins) type(span)class(.url) operator({) key(display)operator(:) value(block)operator(;) key(font-size)operator(:) float(0.9em)operator(;) operator(}) - -type(table)class(.list) type(tbody) type(tr)pseudo_class(:hover) operator({) key(background-color)operator(:)color(#ffffdd)operator(;) operator(}) -type(table) type(td) operator({)key(padding)operator(:)float(2px)operator(;)operator(}) -type(table) type(p) operator({)key(margin)operator(:)float(0)operator(;)operator(}) -class(.odd) operator({)key(background-color)operator(:)color(#f6f7f8)operator(;)operator(}) -class(.even) operator({)key(background-color)operator(:) color(#fff)operator(;)operator(}) - -class(.highlight) operator({) key(background-color)operator(:) color(#FCFD8D)operator(;)operator(}) -class(.highlight)class(.token-1) operator({) key(background-color)operator(:) color(#faa)operator(;)operator(}) -class(.highlight)class(.token-2) operator({) key(background-color)operator(:) color(#afa)operator(;)operator(}) -class(.highlight)class(.token-3) operator({) key(background-color)operator(:) color(#aaf)operator(;)operator(}) - -class(.box)operator({) -key(padding)operator(:)float(6px)operator(;) -key(margin-bottom)operator(:) float(10px)operator(;) -key(background-color)operator(:)color(#f6f6f6)operator(;) -key(color)operator(:)color(#505050)operator(;) -key(line-height)operator(:)float(1.5em)operator(;) -key(border)operator(:) float(1px) value(solid) color(#e4e4e4)operator(;) -operator(}) - -type(div)class(.square) operator({) - key(border)operator(:) float(1px) value(solid) color(#999)operator(;) - key(float)operator(:) value(left)operator(;) - key(margin)operator(:) float(.3em) float(.4em) float(0) float(.4em)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(width)operator(:) float(.6em)operator(;) key(height)operator(:) float(.6em)operator(;) -operator(}) -class(.contextual) operator({)key(float)operator(:)value(right)operator(;) key(white-space)operator(:) value(nowrap)operator(;) key(line-height)operator(:)float(1.4em)operator(;)key(margin-top)operator(:)float(5px)operator(;) key(padding-left)operator(:) float(10px)operator(;) key(font-size)operator(:)float(0.9em)operator(;)operator(}) -class(.contextual) type(input) operator({)key(font-size)operator(:)float(0.9em)operator(;)operator(}) - -class(.splitcontentleft)operator({)key(float)operator(:)value(left)operator(;) key(width)operator(:)float(49%)operator(;)operator(}) -class(.splitcontentright)operator({)key(float)operator(:)value(right)operator(;) key(width)operator(:)float(49%)operator(;)operator(}) -type(form) operator({)key(display)operator(:) value(inline)operator(;)operator(}) -type(input)operator(,) type(select) operator({)key(vertical-align)operator(:) value(middle)operator(;) key(margin-top)operator(:) float(1px)operator(;) key(margin-bottom)operator(:) float(1px)operator(;)operator(}) -type(fieldset) operator({)key(border)operator(:) float(1px) value(solid) color(#e4e4e4)operator(;) key(margin)operator(:)float(0)operator(;)operator(}) -type(legend) operator({)key(color)operator(:) color(#484848)operator(;)operator(}) -type(hr) operator({) key(width)operator(:) float(100%)operator(;) key(height)operator(:) float(1px)operator(;) key(background)operator(:) color(#ccc)operator(;) key(border)operator(:) float(0)operator(;)operator(}) -type(blockquote) operator({) key(font-style)operator(:) value(italic)operator(;) key(border-left)operator(:) float(3px) value(solid) color(#e0e0e0)operator(;) key(padding-left)operator(:) float(0.6em)operator(;) key(margin-left)operator(:) float(2.4em)operator(;)operator(}) -type(blockquote) type(blockquote) operator({) key(margin-left)operator(:) float(0)operator(;)operator(}) -type(textarea)class(.wiki-edit) operator({) key(width)operator(:) float(99%)operator(;) operator(}) -type(li) type(p) operator({)key(margin-top)operator(:) float(0)operator(;)operator(}) -type(div)class(.issue) operator({)key(background)operator(:)color(#ffffdd)operator(;) key(padding)operator(:)float(6px)operator(;) key(margin-bottom)operator(:)float(6px)operator(;)key(border)operator(:) float(1px) value(solid) color(#d7d7d7)operator(;)operator(}) -type(p)class(.breadcrumb) operator({) key(font-size)operator(:) float(0.9em)operator(;) key(margin)operator(:) float(4px) float(0) float(4px) float(0)operator(;)operator(}) -type(p)class(.subtitle) operator({) key(font-size)operator(:) float(0.9em)operator(;) key(margin)operator(:) float(-6px) float(0) float(12px) float(0)operator(;) key(font-style)operator(:) value(italic)operator(;) operator(}) -type(p)class(.footnote) operator({) key(font-size)operator(:) float(0.9em)operator(;) key(margin-top)operator(:) float(0px)operator(;) key(margin-bottom)operator(:) float(0px)operator(;) operator(}) - -type(fieldset)constant(#filters)operator(,) type(fieldset)constant(#date-range) operator({) key(padding)operator(:) float(0.7em)operator(;) key(margin-bottom)operator(:) float(8px)operator(;) operator(}) -type(fieldset)constant(#filters) type(p) operator({) key(margin)operator(:) float(1.2em) float(0) float(0.8em) float(2px)operator(;) operator(}) -type(fieldset)constant(#filters) type(table) operator({) key(border-collapse)operator(:) value(collapse)operator(;) operator(}) -type(fieldset)constant(#filters) type(table) type(td) operator({) key(padding)operator(:) float(0)operator(;) key(vertical-align)operator(:) value(middle)operator(;) operator(}) -type(fieldset)constant(#filters) type(tr)class(.filter) operator({) key(height)operator(:) float(2em)operator(;) operator(}) -type(fieldset)constant(#filters) type(td)class(.add-filter) operator({) key(text-align)operator(:) value(right)operator(;) key(vertical-align)operator(:) value(top)operator(;) operator(}) -class(.buttons) operator({) key(font-size)operator(:) float(0.9em)operator(;) operator(}) - -type(div)constant(#issue-changesets) operator({)key(float)operator(:)value(right)operator(;) key(width)operator(:)float(45%)operator(;) key(margin-left)operator(:) float(1em)operator(;) key(margin-bottom)operator(:) float(1em)operator(;) key(background)operator(:) color(#fff)operator(;) key(padding-left)operator(:) float(1em)operator(;) key(font-size)operator(:) float(90%)operator(;)operator(}) -type(div)constant(#issue-changesets) class(.changeset) operator({) key(padding)operator(:) float(4px)operator(;)operator(}) -type(div)constant(#issue-changesets) class(.changeset) operator({) key(border-bottom)operator(:) float(1px) value(solid) color(#ddd)operator(;) operator(}) -type(div)constant(#issue-changesets) type(p) operator({) key(margin-top)operator(:) float(0)operator(;) key(margin-bottom)operator(:) float(1em)operator(;)operator(}) - -type(div)constant(#activity) type(dl)operator(,) constant(#search-results) operator({) key(margin-left)operator(:) float(2em)operator(;) operator(}) -type(div)constant(#activity) type(dd)operator(,) constant(#search-results) type(dd) operator({) key(margin-bottom)operator(:) float(1em)operator(;) key(padding-left)operator(:) float(18px)operator(;) key(font-size)operator(:) float(0.9em)operator(;) operator(}) -type(div)constant(#activity) type(dt)operator(,) constant(#search-results) type(dt) operator({) key(margin-bottom)operator(:) float(0px)operator(;) key(padding-left)operator(:) float(20px)operator(;) key(line-height)operator(:) float(18px)operator(;) key(background-position)operator(:) float(0) float(50%)operator(;) key(background-repeat)operator(:) value(no-repeat)operator(;) operator(}) -type(div)constant(#activity) type(dt)class(.me) class(.time) operator({) key(border-bottom)operator(:) float(1px) value(solid) color(#999)operator(;) operator(}) -type(div)constant(#activity) type(dt) class(.time) operator({) key(color)operator(:) color(#777)operator(;) key(font-size)operator(:) float(80%)operator(;) operator(}) -type(div)constant(#activity) type(dd) class(.description)operator(,) constant(#search-results) type(dd) class(.description) operator({) key(font-style)operator(:) value(italic)operator(;) operator(}) -type(div)constant(#activity) type(span)class(.project)pseudo_class(:after)operator(,) constant(#search-results) type(span)class(.project)pseudo_class(:after) operator({) key(content)operator(:) stringoperator(;) operator(}) -type(div)constant(#activity) type(dd) type(span)class(.description)operator(,) constant(#search-results) type(dd) type(span)class(.description) operator({) key(display)operator(:)value(block)operator(;) operator(}) - -constant(#search-results) type(dd) operator({) key(margin-bottom)operator(:) float(1em)operator(;) key(padding-left)operator(:) float(20px)operator(;) key(margin-left)operator(:)float(0px)operator(;) operator(}) - -type(div)constant(#search-results-counts) operator({)key(float)operator(:)value(right)operator(;)operator(}) -type(div)constant(#search-results-counts) type(ul) operator({) key(margin-top)operator(:) float(0.5em)operator(;) operator(}) -type(div)constant(#search-results-counts) type(li) operator({) key(list-style-type)operator(:)value(none)operator(;) key(float)operator(:) value(left)operator(;) key(margin-left)operator(:) float(1em)operator(;) operator(}) - -type(dt)class(.issue) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(dt)class(.issue-edit) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(dt)class(.issue-closed) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(dt)class(.issue-note) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(dt)class(.changeset) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(dt)class(.news) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(dt)class(.message) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(dt)class(.reply) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(dt)class(.wiki-page) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(dt)class(.attachment) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(dt)class(.document) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -type(dt)class(.project) operator({) key(background-image)operator(:) stringoperator(;) operator(}) - -constant(#search-results) type(dt)class(.issue)class(.closed) operator({) key(background-image)operator(:) stringoperator(;) operator(}) - -type(div)constant(#roadmap) type(fieldset)class(.related-issues) operator({) key(margin-bottom)operator(:) float(1em)operator(;) operator(}) -type(div)constant(#roadmap) type(fieldset)class(.related-issues) type(ul) operator({) key(margin-top)operator(:) float(0.3em)operator(;) key(margin-bottom)operator(:) float(0.3em)operator(;) operator(}) -type(div)constant(#roadmap) class(.wiki) type(h1)pseudo_class(:first-child) operator({) key(display)operator(:) value(none)operator(;) operator(}) -type(div)constant(#roadmap) class(.wiki) type(h1) operator({) key(font-size)operator(:) float(120%)operator(;) operator(}) -type(div)constant(#roadmap) class(.wiki) type(h2) operator({) key(font-size)operator(:) float(110%)operator(;) operator(}) - -type(div)constant(#version-summary) operator({) key(float)operator(:)value(right)operator(;) key(width)operator(:)float(380px)operator(;) key(margin-left)operator(:) float(16px)operator(;) key(margin-bottom)operator(:) float(16px)operator(;) key(background-color)operator(:) color(#fff)operator(;) operator(}) -type(div)constant(#version-summary) type(fieldset) operator({) key(margin-bottom)operator(:) float(1em)operator(;) operator(}) -type(div)constant(#version-summary) class(.total-hours) operator({) key(text-align)operator(:) value(right)operator(;) operator(}) - -type(table)constant(#time-report) type(td)class(.hours)operator(,) type(table)constant(#time-report) type(th)class(.period)operator(,) type(table)constant(#time-report) type(th)class(.total) operator({) key(text-align)operator(:) value(right)operator(;) key(padding-right)operator(:) float(0.5em)operator(;) operator(}) -type(table)constant(#time-report) type(tbody) type(tr) operator({) key(font-style)operator(:) value(italic)operator(;) key(color)operator(:) color(#777)operator(;) operator(}) -type(table)constant(#time-report) type(tbody) type(tr)class(.last-level) operator({) key(font-style)operator(:) value(normal)operator(;) key(color)operator(:) color(#555)operator(;) operator(}) -type(table)constant(#time-report) type(tbody) type(tr)class(.total) operator({) key(font-style)operator(:) value(normal)operator(;) key(font-weight)operator(:) value(bold)operator(;) key(color)operator(:) color(#555)operator(;) key(background-color)operator(:)color(#EEEEEE)operator(;) operator(}) -type(table)constant(#time-report) class(.hours-dec) operator({) key(font-size)operator(:) float(0.9em)operator(;) operator(}) - -type(ul)class(.properties) operator({)key(padding)operator(:)float(0)operator(;) key(font-size)operator(:) float(0.9em)operator(;) key(color)operator(:) color(#777)operator(;)operator(}) -type(ul)class(.properties) type(li) operator({)key(list-style-type)operator(:)value(none)operator(;)operator(}) -type(ul)class(.properties) type(li) type(span) operator({)key(font-style)operator(:)value(italic)operator(;)operator(}) - -class(.total-hours) operator({) key(font-size)operator(:) float(110%)operator(;) key(font-weight)operator(:) value(bold)operator(;) operator(}) -class(.total-hours) type(span)class(.hours-int) operator({) key(font-size)operator(:) float(120%)operator(;) operator(}) - -class(.autoscroll) operator({)key(overflow-x)operator(:) value(auto)operator(;) key(padding)operator(:)float(1px)operator(;) key(margin-bottom)operator(:) float(1.2em)operator(;)operator(}) -constant(#user_firstname)operator(,) constant(#user_lastname)operator(,) constant(#user_mail)operator(,) constant(#my_account_form) type(select) operator({) key(width)operator(:) float(90%)operator(;) operator(}) - -class(.pagination) operator({)key(font-size)operator(:) float(90%)operator(}) -type(p)class(.pagination) operator({)key(margin-top)operator(:)float(8px)operator(;)operator(}) - -comment(/*)comment(****) comment(Tabular) comment(forms) comment(*****)comment(*/) -class(.tabular) type(p)operator({) -key(margin)operator(:) float(0)operator(;) -key(padding)operator(:) float(5px) float(0) float(8px) float(0)operator(;) -key(padding-left)operator(:) float(180px)operator(;) comment(/*)comment(width) comment(of) comment(left) comment(column) comment(containing) comment(the) comment(label) comment(elements)comment(*/) -key(height)operator(:) float(1%)operator(;) -key(clear)operator(:)value(left)operator(;) -operator(}) - -type(html)operator(>)type(body) class(.tabular) type(p) operator({)key(overflow)operator(:)value(hidden)operator(;)operator(}) - -class(.tabular) type(label)operator({) -key(font-weight)operator(:) value(bold)operator(;) -key(float)operator(:) value(left)operator(;) -key(text-align)operator(:) value(right)operator(;) -key(margin-left)operator(:) float(-180px)operator(;) comment(/*)comment(width) comment(of) comment(left) comment(column)comment(*/) -key(width)operator(:) float(175px)operator(;) comment(/*)comment(width) comment(of) comment(labels.) comment(Should) comment(be) comment(smaller) comment(than) comment(left) comment(column) comment(to) comment(create) comment(some) comment(right) -comment(margin)comment(*/) -operator(}) - -class(.tabular) type(label)class(.floating)operator({) -key(font-weight)operator(:) value(normal)operator(;) -key(margin-left)operator(:) float(0px)operator(;) -key(text-align)operator(:) value(left)operator(;) -key(width)operator(:) float(270px)operator(;) -operator(}) - -type(input)constant(#time_entry_comments) operator({) key(width)operator(:) float(90%)operator(;)operator(}) - -constant(#preview) type(fieldset) operator({)key(margin-top)operator(:) float(1em)operator(;) key(background)operator(:) stringoperator(}) - -class(.tabular)class(.settings) type(p)operator({) key(padding-left)operator(:) float(300px)operator(;) operator(}) -class(.tabular)class(.settings) type(label)operator({) key(margin-left)operator(:) float(-300px)operator(;) key(width)operator(:) float(295px)operator(;) operator(}) - -class(.required) operator({)key(color)operator(:) color(#bb0000)operator(;)operator(}) -class(.summary) operator({)key(font-style)operator(:) value(italic)operator(;)operator(}) - -constant(#attachments_fields) type(input)operator([)attribute_name(type=text)operator(]) operator({)key(margin-left)operator(:) float(8px)operator(;) operator(}) - -type(div)class(.attachments) operator({) key(margin-top)operator(:) float(12px)operator(;) operator(}) -type(div)class(.attachments) type(p) operator({) key(margin)operator(:)float(4px) float(0) float(2px) float(0)operator(;) operator(}) -type(div)class(.attachments) type(img) operator({) key(vertical-align)operator(:) value(middle)operator(;) operator(}) -type(div)class(.attachments) type(span)class(.author) operator({) key(font-size)operator(:) float(0.9em)operator(;) key(color)operator(:) color(#888)operator(;) operator(}) - -type(p)class(.other-formats) operator({) key(text-align)operator(:) value(right)operator(;) key(font-size)operator(:)float(0.9em)operator(;) key(color)operator(:) color(#666)operator(;) operator(}) -class(.other-formats) type(span) operator(+) type(span)pseudo_class(:before) operator({) key(content)operator(:) stringoperator(;) operator(}) - -type(a)class(.feed) operator({) key(background)operator(:) string value(no-repeat) float(1px) float(50%)operator(;) key(padding)operator(:) float(2px) float(0px) float(3px) float(16px)operator(;) operator(}) - -comment(/*)comment(****) comment(Flash) comment(&) comment(error) comment(messages) comment(***)comment(*/) -constant(#errorExplanation)operator(,) type(div)class(.flash)operator(,) class(.nodata)operator(,) class(.warning) operator({) - key(padding)operator(:) float(4px) float(4px) float(4px) float(30px)operator(;) - key(margin-bottom)operator(:) float(12px)operator(;) - key(font-size)operator(:) float(1.1em)operator(;) - key(border)operator(:) float(2px) value(solid)operator(;) -operator(}) - -type(div)class(.flash) operator({)key(margin-top)operator(:) float(8px)operator(;)operator(}) - -type(div)class(.flash)class(.error)operator(,) constant(#errorExplanation) operator({) - key(background)operator(:) string float(8px) float(5px) value(no-repeat)operator(;) - key(background-color)operator(:) color(#ffe3e3)operator(;) - key(border-color)operator(:) color(#dd0000)operator(;) - key(color)operator(:) color(#550000)operator(;) -operator(}) - -type(div)class(.flash)class(.notice) operator({) - key(background)operator(:) string float(8px) float(5px) value(no-repeat)operator(;) - key(background-color)operator(:) color(#dfffdf)operator(;) - key(border-color)operator(:) color(#9fcf9f)operator(;) - key(color)operator(:) color(#005f00)operator(;) -operator(}) - -type(div)class(.flash)class(.warning) operator({) - key(background)operator(:) string float(8px) float(5px) value(no-repeat)operator(;) - key(background-color)operator(:) color(#FFEBC1)operator(;) - key(border-color)operator(:) color(#FDBF3B)operator(;) - key(color)operator(:) color(#A6750C)operator(;) - key(text-align)operator(:) value(left)operator(;) -operator(}) - -class(.nodata)operator(,) class(.warning) operator({) - key(text-align)operator(:) value(center)operator(;) - key(background-color)operator(:) color(#FFEBC1)operator(;) - key(border-color)operator(:) color(#FDBF3B)operator(;) - key(color)operator(:) color(#A6750C)operator(;) -operator(}) - -constant(#errorExplanation) type(ul) operator({) key(font-size)operator(:) float(0.9em)operator(;)operator(}) - -comment(/*)comment(****) comment(Ajax) comment(indicator) comment(*****)comment(*/) -constant(#ajax-indicator) operator({) -key(position)operator(:) value(absolute)operator(;) comment(/*) comment(fixed) comment(not) comment(supported) comment(by) comment(IE) comment(*/) -key(background-color)operator(:)color(#eee)operator(;) -key(border)operator(:) float(1px) value(solid) color(#bbb)operator(;) -key(top)operator(:)float(35%)operator(;) -key(left)operator(:)float(40%)operator(;) -key(width)operator(:)float(20%)operator(;) -key(font-weight)operator(:)value(bold)operator(;) -key(text-align)operator(:)value(center)operator(;) -key(padding)operator(:)float(0.6em)operator(;) -key(z-index)operator(:)float(100)operator(;) -key(filter)operator(:)stringoperator(;) -key(opacity)operator(:) float(0)float(.5)operator(;) -operator(}) - -type(html)operator(>)type(body) constant(#ajax-indicator) operator({) key(position)operator(:) value(fixed)operator(;) operator(}) - -constant(#ajax-indicator) type(span) operator({) -key(background-position)operator(:) float(0%) float(40%)operator(;) -key(background-repeat)operator(:) value(no-repeat)operator(;) -key(background-image)operator(:) stringoperator(;) -key(padding-left)operator(:) float(26px)operator(;) -key(vertical-align)operator(:) value(bottom)operator(;) -operator(}) - -comment(/*)comment(****) comment(Calendar) comment(****)comment(*/) -type(table)class(.cal) operator({)key(border-collapse)operator(:) value(collapse)operator(;) key(width)operator(:) float(100%)operator(;) key(margin)operator(:) float(0px) float(0) float(6px) float(0)operator(;)key(border)operator(:) float(1px) value(solid) color(#d7d7d7)operator(;)operator(}) -type(table)class(.cal) type(thead) type(th) operator({)key(width)operator(:) float(14%)operator(;)operator(}) -type(table)class(.cal) type(tbody) type(tr) operator({)key(height)operator(:) float(100px)operator(;)operator(}) -type(table)class(.cal) type(th) operator({) key(background-color)operator(:)color(#EEEEEE)operator(;) key(padding)operator(:) float(4px)operator(;) operator(}) -type(table)class(.cal) type(td) operator({)key(border)operator(:) float(1px) value(solid) color(#d7d7d7)operator(;) key(vertical-align)operator(:) value(top)operator(;) key(font-size)operator(:) float(0.9em)operator(;)operator(}) -type(table)class(.cal) type(td) type(p)class(.day-num) operator({)key(font-size)operator(:) float(1.1em)operator(;) key(text-align)operator(:)value(right)operator(;)operator(}) -type(table)class(.cal) type(td)class(.odd) type(p)class(.day-num) operator({)key(color)operator(:) color(#bbb)operator(;)operator(}) -type(table)class(.cal) type(td)class(.today) operator({)key(background)operator(:)color(#ffffdd)operator(;)operator(}) -type(table)class(.cal) type(td)class(.today) type(p)class(.day-num) operator({)key(font-weight)operator(:) value(bold)operator(;)operator(}) - -comment(/*)comment(****) comment(Tooltips) comment(*****)comment(*/) -class(.tooltip)operator({)key(position)operator(:)value(relative)operator(;)key(z-index)operator(:)float(24)operator(;)operator(}) -class(.tooltip)pseudo_class(:hover)operator({)key(z-index)operator(:)float(25)operator(;)key(color)operator(:)color(#000)operator(;)operator(}) -class(.tooltip) type(span)class(.tip)operator({)key(display)operator(:) value(none)operator(;) key(text-align)operator(:)value(left)operator(;)operator(}) - -type(div)class(.tooltip)pseudo_class(:hover) type(span)class(.tip)operator({) -key(display)operator(:)value(block)operator(;) -key(position)operator(:)value(absolute)operator(;) -key(top)operator(:)float(12px)operator(;) key(left)operator(:)float(24px)operator(;) key(width)operator(:)float(270px)operator(;) -key(border)operator(:)float(1px) value(solid) color(#555)operator(;) -key(background-color)operator(:)color(#fff)operator(;) -key(padding)operator(:) float(4px)operator(;) -key(font-size)operator(:) float(0.8em)operator(;) -key(color)operator(:)color(#505050)operator(;) -operator(}) - -comment(/*)comment(****) comment(Progress) comment(bar) comment(****)comment(*/) -type(table)class(.progress) operator({) - key(border)operator(:) float(1px) value(solid) color(#D7D7D7)operator(;) - key(border-collapse)operator(:) value(collapse)operator(;) - key(border-spacing)operator(:) float(0pt)operator(;) - key(empty-cells)operator(:) value(show)operator(;) - key(text-align)operator(:) value(center)operator(;) - key(float)operator(:)value(left)operator(;) - key(margin)operator(:) float(1px) float(6px) float(1px) float(0px)operator(;) -operator(}) - -type(table)class(.progress) type(td) operator({) key(height)operator(:) float(0.9em)operator(;) operator(}) -type(table)class(.progress) type(td)class(.closed) operator({) key(background)operator(:) color(#BAE0BA) value(none) value(repeat) value(scroll) float(0%)operator(;) operator(}) -type(table)class(.progress) type(td)class(.done) operator({) key(background)operator(:) color(#DEF0DE) value(none) value(repeat) value(scroll) float(0%)operator(;) operator(}) -type(table)class(.progress) type(td)class(.open) operator({) key(background)operator(:) color(#FFF) value(none) value(repeat) value(scroll) float(0%)operator(;) operator(}) -type(p)class(.pourcent) operator({)key(font-size)operator(:) float(80%)operator(;)operator(}) -type(p)class(.progress-info) operator({)key(clear)operator(:) value(left)operator(;) key(font-style)operator(:) value(italic)operator(;) key(font-size)operator(:) float(80%)operator(;)operator(}) - -comment(/*)comment(****) comment(Tabs) comment(****)comment(*/) -constant(#content) class(.tabs) operator({)key(height)operator(:) float(2.6em)operator(;) key(border-bottom)operator(:) float(1px) value(solid) color(#bbbbbb)operator(;) key(margin-bottom)operator(:)float(1.2em)operator(;) key(position)operator(:)value(relative)operator(;)operator(}) -constant(#content) class(.tabs) type(ul) operator({)key(margin)operator(:)float(0)operator(;) key(position)operator(:)value(absolute)operator(;) key(bottom)operator(:)float(-2px)operator(;) key(padding-left)operator(:)float(1em)operator(;)operator(}) -constant(#content) class(.tabs)operator(>)type(ul) operator({) key(bottom)operator(:)float(-1px)operator(;) operator(}) comment(/*) comment(others) comment(*/) -constant(#content) class(.tabs) type(ul) type(li) operator({) -key(float)operator(:)value(left)operator(;) -key(list-style-type)operator(:)value(none)operator(;) -key(white-space)operator(:)value(nowrap)operator(;) -key(margin-right)operator(:)float(8px)operator(;) -key(background)operator(:)color(#fff)operator(;) -operator(}) -constant(#content) class(.tabs) type(ul) type(li) type(a)operator({) -key(display)operator(:)value(block)operator(;) -key(font-size)operator(:) float(0.9em)operator(;) -key(text-decoration)operator(:)value(none)operator(;) -key(line-height)operator(:)float(1.3em)operator(;) -key(padding)operator(:)float(4px) float(6px) float(4px) float(6px)operator(;) -key(border)operator(:) float(1px) value(solid) color(#ccc)operator(;) -key(border-bottom)operator(:) float(1px) value(solid) color(#bbbbbb)operator(;) -key(background-color)operator(:) color(#eeeeee)operator(;) -key(color)operator(:)color(#777)operator(;) -key(font-weight)operator(:)value(bold)operator(;) -operator(}) - -constant(#content) class(.tabs) type(ul) type(li) type(a)pseudo_class(:hover) operator({) -key(background-color)operator(:) color(#ffffdd)operator(;) -key(text-decoration)operator(:)value(none)operator(;) -operator(}) - -constant(#content) class(.tabs) type(ul) type(li) type(a)class(.selected) operator({) -key(background-color)operator(:) color(#fff)operator(;) -key(border)operator(:) float(1px) value(solid) color(#bbbbbb)operator(;) -key(border-bottom)operator(:) float(1px) value(solid) color(#fff)operator(;) -operator(}) - -constant(#content) class(.tabs) type(ul) type(li) type(a)class(.selected)pseudo_class(:hover) operator({) -key(background-color)operator(:) color(#fff)operator(;) -operator(}) - -comment(/*)comment(****) comment(Diff) comment(****)comment(*/) -class(.diff_out) operator({) key(background)operator(:) color(#fcc)operator(;) operator(}) -class(.diff_in) operator({) key(background)operator(:) color(#cfc)operator(;) operator(}) - -comment(/*)comment(****) comment(Wiki) comment(****)comment(*/) -type(div)class(.wiki) type(table) operator({) - key(border)operator(:) float(1px) value(solid) color(#505050)operator(;) - key(border-collapse)operator(:) value(collapse)operator(;) - key(margin-bottom)operator(:) float(1em)operator(;) -operator(}) - -type(div)class(.wiki) type(table)operator(,) type(div)class(.wiki) type(td)operator(,) type(div)class(.wiki) type(th) operator({) - key(border)operator(:) float(1px) value(solid) color(#bbb)operator(;) - key(padding)operator(:) float(4px)operator(;) -operator(}) - -type(div)class(.wiki) class(.external) operator({) - key(background-position)operator(:) float(0%) float(60%)operator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - key(padding-left)operator(:) float(12px)operator(;) - key(background-image)operator(:) stringoperator(;) -operator(}) - -type(div)class(.wiki) type(a)class(.new) operator({) - key(color)operator(:) color(#b73535)operator(;) -operator(}) - -type(div)class(.wiki) type(pre) operator({) - key(margin)operator(:) float(1em) float(1em) float(1em) float(1.6em)operator(;) - key(padding)operator(:) float(2px)operator(;) - key(background-color)operator(:) color(#fafafa)operator(;) - key(border)operator(:) float(1px) value(solid) color(#dadada)operator(;) - key(width)operator(:)float(95%)operator(;) - key(overflow-x)operator(:) value(auto)operator(;) -operator(}) - -type(div)class(.wiki) type(ul)class(.toc) operator({) - key(background-color)operator(:) color(#ffffdd)operator(;) - key(border)operator(:) float(1px) value(solid) color(#e4e4e4)operator(;) - key(padding)operator(:) float(4px)operator(;) - key(line-height)operator(:) float(1.2em)operator(;) - key(margin-bottom)operator(:) float(12px)operator(;) - key(margin-right)operator(:) float(12px)operator(;) - key(margin-left)operator(:) float(0)operator(;) - key(display)operator(:) value(table) -operator(}) -type(*) type(html) type(div)class(.wiki) type(ul)class(.toc) operator({) key(width)operator(:) float(50%)operator(;) operator(}) comment(/*) comment(IE6) comment(doesn't) comment(autosize) comment(div) comment(*/) - -type(div)class(.wiki) type(ul)class(.toc)class(.right) operator({) key(float)operator(:) value(right)operator(;) key(margin-left)operator(:) float(12px)operator(;) key(margin-right)operator(:) float(0)operator(;) key(width)operator(:) value(auto)operator(;) operator(}) -type(div)class(.wiki) type(ul)class(.toc)class(.left) operator({) key(float)operator(:) value(left)operator(;) key(margin-right)operator(:) float(12px)operator(;) key(margin-left)operator(:) float(0)operator(;) key(width)operator(:) value(auto)operator(;) operator(}) -type(div)class(.wiki) type(ul)class(.toc) type(li) operator({) key(list-style-type)operator(:)value(none)operator(;)operator(}) -type(div)class(.wiki) type(ul)class(.toc) type(li)class(.heading2) operator({) key(margin-left)operator(:) float(6px)operator(;) operator(}) -type(div)class(.wiki) type(ul)class(.toc) type(li)class(.heading3) operator({) key(margin-left)operator(:) float(12px)operator(;) key(font-size)operator(:) float(0.8em)operator(;) operator(}) - -type(div)class(.wiki) type(ul)class(.toc) type(a) operator({) - key(font-size)operator(:) float(0.9em)operator(;) - key(font-weight)operator(:) value(normal)operator(;) - key(text-decoration)operator(:) value(none)operator(;) - key(color)operator(:) color(#606060)operator(;) -operator(}) -type(div)class(.wiki) type(ul)class(.toc) type(a)pseudo_class(:hover) operator({) key(color)operator(:) color(#c61a1a)operator(;) key(text-decoration)operator(:) value(underline)operator(;)operator(}) - -type(a)class(.wiki-anchor) operator({) key(display)operator(:) value(none)operator(;) key(margin-left)operator(:) float(6px)operator(;) key(text-decoration)operator(:) value(none)operator(;) operator(}) -type(a)class(.wiki-anchor)pseudo_class(:hover) operator({) key(color)operator(:) color(#aaa) important(!important)operator(;) key(text-decoration)operator(:) value(none)operator(;) operator(}) -type(h1)pseudo_class(:hover) type(a)class(.wiki-anchor)operator(,) type(h2)pseudo_class(:hover) type(a)class(.wiki-anchor)operator(,) type(h3)pseudo_class(:hover) type(a)class(.wiki-anchor) operator({) key(display)operator(:) value(inline)operator(;) key(color)operator(:) color(#ddd)operator(;) operator(}) - -comment(/*)comment(****) comment(My) comment(page) comment(layout) comment(****)comment(*/) -class(.block-receiver) operator({) -key(border)operator(:)float(1px) value(dashed) color(#c0c0c0)operator(;) -key(margin-bottom)operator(:) float(20px)operator(;) -key(padding)operator(:) float(15px) float(0) float(15px) float(0)operator(;) -operator(}) - -class(.mypage-box) operator({) -key(margin)operator(:)float(0) float(0) float(20px) float(0)operator(;) -key(color)operator(:)color(#505050)operator(;) -key(line-height)operator(:)float(1.5em)operator(;) -operator(}) - -class(.handle) operator({) -key(cursor)operator(:) value(move)operator(;) -operator(}) - -type(a)class(.close-icon) operator({) -key(display)operator(:)value(block)operator(;) -key(margin-top)operator(:)float(3px)operator(;) -key(overflow)operator(:)value(hidden)operator(;) -key(width)operator(:)float(12px)operator(;) -key(height)operator(:)float(12px)operator(;) -key(background-repeat)operator(:) value(no-repeat)operator(;) -key(cursor)operator(:)value(pointer)operator(;) -key(background-image)operator(:)stringoperator(;) -operator(}) - -type(a)class(.close-icon)pseudo_class(:hover) operator({) -key(background-image)operator(:)stringoperator(;) -operator(}) - -comment(/*)comment(****) comment(Gantt) comment(chart) comment(****)comment(*/) -class(.gantt_hdr) operator({) - key(position)operator(:)value(absolute)operator(;) - key(top)operator(:)float(0)operator(;) - key(height)operator(:)float(16px)operator(;) - key(border-top)operator(:) float(1px) value(solid) color(#c0c0c0)operator(;) - key(border-bottom)operator(:) float(1px) value(solid) color(#c0c0c0)operator(;) - key(border-right)operator(:) float(1px) value(solid) color(#c0c0c0)operator(;) - key(text-align)operator(:) value(center)operator(;) - key(overflow)operator(:) value(hidden)operator(;) -operator(}) - -class(.task) operator({) - key(position)operator(:) value(absolute)operator(;) - key(height)operator(:)float(8px)operator(;) - key(font-size)operator(:)float(0.8em)operator(;) - key(color)operator(:)color(#888)operator(;) - key(padding)operator(:)float(0)operator(;) - key(margin)operator(:)float(0)operator(;) - key(line-height)operator(:)float(0.8em)operator(;) -operator(}) - -class(.task_late) operator({) key(background)operator(:)color(#f66) stringoperator(;) key(border)operator(:) float(1px) value(solid) color(#f66)operator(;) operator(}) -class(.task_done) operator({) key(background)operator(:)color(#66f) stringoperator(;) key(border)operator(:) float(1px) value(solid) color(#66f)operator(;) operator(}) -class(.task_todo) operator({) key(background)operator(:)color(#aaa) stringoperator(;) key(border)operator(:) float(1px) value(solid) color(#aaa)operator(;) operator(}) -class(.milestone) operator({) key(background-image)operator(:)stringoperator(;) key(background-repeat)operator(:) value(no-repeat)operator(;) key(border)operator(:) float(0)operator(;) operator(}) - -comment(/*)comment(****) comment(Icons) comment(****)comment(*/) -class(.icon) operator({) -key(background-position)operator(:) float(0%) float(40%)operator(;) -key(background-repeat)operator(:) value(no-repeat)operator(;) -key(padding-left)operator(:) float(20px)operator(;) -key(padding-top)operator(:) float(2px)operator(;) -key(padding-bottom)operator(:) float(3px)operator(;) -operator(}) - -class(.icon22) operator({) -key(background-position)operator(:) float(0%) float(40%)operator(;) -key(background-repeat)operator(:) value(no-repeat)operator(;) -key(padding-left)operator(:) float(26px)operator(;) -key(line-height)operator(:) float(22px)operator(;) -key(vertical-align)operator(:) value(middle)operator(;) -operator(}) - -class(.icon-add) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-edit) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-copy) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-del) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-move) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-save) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-cancel) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-file) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-folder) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.open) class(.icon-folder) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-package) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-home) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-user) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-mypage) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-admin) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-projects) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-help) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-attachment) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-index) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-history) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-time) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-stats) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-warning) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-fav) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-fav-off) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-reload) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-lock) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-unlock) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-checked) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-details) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-report) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon-comment) operator({) key(background-image)operator(:) stringoperator(;) operator(}) - -class(.icon22-projects) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-users) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-tracker) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-role) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-workflow) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-options) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-notifications) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-authent) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-info) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-comment) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-package) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-settings) operator({) key(background-image)operator(:) stringoperator(;) operator(}) -class(.icon22-plugin) operator({) key(background-image)operator(:) stringoperator(;) operator(}) - -type(img)class(.gravatar) operator({) - key(padding)operator(:) float(2px)operator(;) - key(border)operator(:) value(solid) float(1px) color(#d5d5d5)operator(;) - key(background)operator(:) color(#fff)operator(;) -operator(}) - -type(div)class(.issue) type(img)class(.gravatar) operator({) - key(float)operator(:) value(right)operator(;) - key(margin)operator(:) float(0) float(0) float(0) float(1em)operator(;) - key(padding)operator(:) float(5px)operator(;) -operator(}) - -type(div)class(.issue) type(table) type(img)class(.gravatar) operator({) - key(height)operator(:) float(14px)operator(;) - key(width)operator(:) float(14px)operator(;) - key(padding)operator(:) float(2px)operator(;) - key(float)operator(:) value(left)operator(;) - key(margin)operator(:) float(0) float(0.5em) float(0) float(0)operator(;) -operator(}) - -constant(#history) type(img)class(.gravatar) operator({) - key(padding)operator(:) float(3px)operator(;) - key(margin)operator(:) float(0) float(1.5em) float(1em) float(0)operator(;) - key(float)operator(:) value(left)operator(;) -operator(}) - -type(td)class(.username) type(img)class(.gravatar) operator({) - key(float)operator(:) value(left)operator(;) - key(margin)operator(:) float(0) float(1em) float(0) float(0)operator(;) -operator(}) - -constant(#activity) type(dt) type(img)class(.gravatar) operator({) - key(float)operator(:) value(left)operator(;) - key(margin)operator(:) float(0) float(1em) float(1em) float(0)operator(;) -operator(}) - -constant(#activity) type(dt)operator(,) -class(.journal) operator({) - key(clear)operator(:) value(left)operator(;) -operator(}) - -type(h2) type(img) operator({) key(vertical-align)operator(:)value(middle)operator(;) operator(}) - - -comment(/*)comment(****) comment(Media) comment(print) comment(specific) comment(styles) comment(****)comment(*/) -directive(@media) type(print) operator({) - constant(#top-menu)operator(,) constant(#header)operator(,) constant(#main-menu)operator(,) constant(#sidebar)operator(,) constant(#footer)operator(,) class(.contextual)operator(,) class(.other-formats) operator({) key(display)operator(:)value(none)operator(;) operator(}) - constant(#main) operator({) key(background)operator(:) color(#fff)operator(;) operator(}) - constant(#content) operator({) key(width)operator(:) float(99%)operator(;) key(margin)operator(:) float(0)operator(;) key(padding)operator(:) float(0)operator(;) key(border)operator(:) float(0)operator(;) key(background)operator(:) color(#fff)operator(;) key(overflow)operator(:) value(visible) important(!important)operator(;)operator(}) -operator(}) diff --git a/test/scanners/css/redmine.in.css b/test/scanners/css/redmine.in.css deleted file mode 100644 index f0ba792..0000000 --- a/test/scanners/css/redmine.in.css +++ /dev/null @@ -1,685 +0,0 @@ -body { font-family: Verdana, sans-serif; font-size: 12px; color:#484848; margin: 0; padding: 0; min-width: 900px; } - -h1, h2, h3, h4 { font-family: "Trebuchet MS", Verdana, sans-serif;} -h1 {margin:0; padding:0; font-size: 24px;} -h2, .wiki h1 {font-size: 20px;padding: 2px 10px 1px 0px;margin: 0 0 10px 0; border-bottom: 1px solid #bbbbbb; color: #444;} -h3, .wiki h2 {font-size: 16px;padding: 2px 10px 1px 0px;margin: 0 0 10px 0; border-bottom: 1px solid #bbbbbb; color: #444;} -h4, .wiki h3 {font-size: 13px;padding: 2px 10px 1px 0px;margin-bottom: 5px; border-bottom: 1px dotted #bbbbbb; color: #444;} - -/***** Layout *****/ -#wrapper {background: white;} - -#top-menu {background: #2C4056; color: #fff; height:1.8em; font-size: 0.8em; padding: 2px 2px 0px 6px;} -#top-menu ul {margin: 0; padding: 0;} -#top-menu li { - float:left; - list-style-type:none; - margin: 0px 0px 0px 0px; - padding: 0px 0px 0px 0px; - white-space:nowrap; -} -#top-menu a {color: #fff; margin-right: 8px; font-weight: bold;} -#top-menu #loggedas { float: right; margin-right: 0.5em; color: #fff; } - -#account {float:right;} - -#header {height:5.3em;margin:0;background-color:#507AAA;color:#f8f8f8; padding: 4px 8px 0px 6px; position:relative;} -#header a {color:#f8f8f8;} -#quick-search {float:right;} - -#main-menu {position: absolute; bottom: 0px; left:6px; margin-right: -500px;} -#main-menu ul {margin: 0; padding: 0;} -#main-menu li { - float:left; - list-style-type:none; - margin: 0px 2px 0px 0px; - padding: 0px 0px 0px 0px; - white-space:nowrap; -} -#main-menu li a { - display: block; - color: #fff; - text-decoration: none; - font-weight: bold; - margin: 0; - padding: 4px 10px 4px 10px; -} -#main-menu li a:hover {background:#759FCF; color:#fff;} -#main-menu li a.selected, #main-menu li a.selected:hover {background:#fff; color:#555;} - -#main {background-color:#EEEEEE;} - -#sidebar{ float: right; width: 17%; position: relative; z-index: 9; min-height: 600px; padding: 0; margin: 0;} -* html #sidebar{ width: 17%; } -#sidebar h3{ font-size: 14px; margin-top:14px; color: #666; } -#sidebar hr{ width: 100%; margin: 0 auto; height: 1px; background: #ccc; border: 0; } -* html #sidebar hr{ width: 95%; position: relative; left: -6px; color: #ccc; } - -#content { width: 80%; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; } -* html #content{ width: 80%; padding-left: 0; margin-top: 0px; padding: 6px 10px 10px 10px;} -html>body #content { min-height: 600px; } -* html body #content { height: 600px; } /* IE */ - -#main.nosidebar #sidebar{ display: none; } -#main.nosidebar #content{ width: auto; border-right: 0; } - -#footer {clear: both; border-top: 1px solid #bbb; font-size: 0.9em; color: #aaa; padding: 5px; text-align:center; background:#fff;} - -#login-form table {margin-top:5em; padding:1em; margin-left: auto; margin-right: auto; border: 2px solid #FDBF3B; background-color:#FFEBC1; } -#login-form table td {padding: 6px;} -#login-form label {font-weight: bold;} - -.clear:after{ content: "."; display: block; height: 0; clear: both; visibility: hidden; } - -/***** Links *****/ -a, a:link, a:visited{ color: #2A5685; text-decoration: none; } -a:hover, a:active{ color: #c61a1a; text-decoration: underline;} -a img{ border: 0; } - -a.issue.closed { text-decoration: line-through; } - -/***** Tables *****/ -table.list { border: 1px solid #e4e4e4; border-collapse: collapse; width: 100%; margin-bottom: 4px; } -table.list th { background-color:#EEEEEE; padding: 4px; white-space:nowrap; } -table.list td { vertical-align: top; } -table.list td.id { width: 2%; text-align: center;} -table.list td.checkbox { width: 15px; padding: 0px;} - -tr.issue { text-align: center; white-space: nowrap; } -tr.issue td.subject, tr.issue td.category, td.assigned_to { white-space: normal; } -tr.issue td.subject { text-align: left; } -tr.issue td.done_ratio table.progress { margin-left:auto; margin-right: auto;} - -tr.entry { border: 1px solid #f8f8f8; } -tr.entry td { white-space: nowrap; } -tr.entry td.filename { width: 30%; } -tr.entry td.size { text-align: right; font-size: 90%; } -tr.entry td.revision, tr.entry td.author { text-align: center; } -tr.entry td.age { text-align: right; } - -tr.entry span.expander {background-image: url(../images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;} -tr.entry.open span.expander {background-image: url(../images/bullet_toggle_minus.png);} -tr.entry.file td.filename a { margin-left: 16px; } - -tr.changeset td.author { text-align: center; width: 15%; } -tr.changeset td.committed_on { text-align: center; width: 15%; } - -tr.message { height: 2.6em; } -tr.message td.last_message { font-size: 80%; } -tr.message.locked td.subject a { background-image: url(../images/locked.png); } -tr.message.sticky td.subject a { background-image: url(../images/sticky.png); font-weight: bold; } - -tr.user td { width:13%; } -tr.user td.email { width:18%; } -tr.user td { white-space: nowrap; } -tr.user.locked, tr.user.registered { color: #aaa; } -tr.user.locked a, tr.user.registered a { color: #aaa; } - -tr.time-entry { text-align: center; white-space: nowrap; } -tr.time-entry td.subject, tr.time-entry td.comments { text-align: left; white-space: normal; } -td.hours { text-align: right; font-weight: bold; padding-right: 0.5em; } -td.hours .hours-dec { font-size: 0.9em; } - -table.plugins td { vertical-align: middle; } -table.plugins td.configure { text-align: right; padding-right: 1em; } -table.plugins span.name { font-weight: bold; display: block; margin-bottom: 6px; } -table.plugins span.description { display: block; font-size: 0.9em; } -table.plugins span.url { display: block; font-size: 0.9em; } - -table.list tbody tr:hover { background-color:#ffffdd; } -table td {padding:2px;} -table p {margin:0;} -.odd {background-color:#f6f7f8;} -.even {background-color: #fff;} - -.highlight { background-color: #FCFD8D;} -.highlight.token-1 { background-color: #faa;} -.highlight.token-2 { background-color: #afa;} -.highlight.token-3 { background-color: #aaf;} - -.box{ -padding:6px; -margin-bottom: 10px; -background-color:#f6f6f6; -color:#505050; -line-height:1.5em; -border: 1px solid #e4e4e4; -} - -div.square { - border: 1px solid #999; - float: left; - margin: .3em .4em 0 .4em; - overflow: hidden; - width: .6em; height: .6em; -} -.contextual {float:right; white-space: nowrap; line-height:1.4em;margin-top:5px; padding-left: 10px; font-size:0.9em;} -.contextual input {font-size:0.9em;} - -.splitcontentleft{float:left; width:49%;} -.splitcontentright{float:right; width:49%;} -form {display: inline;} -input, select {vertical-align: middle; margin-top: 1px; margin-bottom: 1px;} -fieldset {border: 1px solid #e4e4e4; margin:0;} -legend {color: #484848;} -hr { width: 100%; height: 1px; background: #ccc; border: 0;} -blockquote { font-style: italic; border-left: 3px solid #e0e0e0; padding-left: 0.6em; margin-left: 2.4em;} -blockquote blockquote { margin-left: 0;} -textarea.wiki-edit { width: 99%; } -li p {margin-top: 0;} -div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;} -p.breadcrumb { font-size: 0.9em; margin: 4px 0 4px 0;} -p.subtitle { font-size: 0.9em; margin: -6px 0 12px 0; font-style: italic; } -p.footnote { font-size: 0.9em; margin-top: 0px; margin-bottom: 0px; } - -fieldset#filters, fieldset#date-range { padding: 0.7em; margin-bottom: 8px; } -fieldset#filters p { margin: 1.2em 0 0.8em 2px; } -fieldset#filters table { border-collapse: collapse; } -fieldset#filters table td { padding: 0; vertical-align: middle; } -fieldset#filters tr.filter { height: 2em; } -fieldset#filters td.add-filter { text-align: right; vertical-align: top; } -.buttons { font-size: 0.9em; } - -div#issue-changesets {float:right; width:45%; margin-left: 1em; margin-bottom: 1em; background: #fff; padding-left: 1em; font-size: 90%;} -div#issue-changesets .changeset { padding: 4px;} -div#issue-changesets .changeset { border-bottom: 1px solid #ddd; } -div#issue-changesets p { margin-top: 0; margin-bottom: 1em;} - -div#activity dl, #search-results { margin-left: 2em; } -div#activity dd, #search-results dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; } -div#activity dt, #search-results dt { margin-bottom: 0px; padding-left: 20px; line-height: 18px; background-position: 0 50%; background-repeat: no-repeat; } -div#activity dt.me .time { border-bottom: 1px solid #999; } -div#activity dt .time { color: #777; font-size: 80%; } -div#activity dd .description, #search-results dd .description { font-style: italic; } -div#activity span.project:after, #search-results span.project:after { content: " -"; } -div#activity dd span.description, #search-results dd span.description { display:block; } - -#search-results dd { margin-bottom: 1em; padding-left: 20px; margin-left:0px; } - -div#search-results-counts {float:right;} -div#search-results-counts ul { margin-top: 0.5em; } -div#search-results-counts li { list-style-type:none; float: left; margin-left: 1em; } - -dt.issue { background-image: url(../images/ticket.png); } -dt.issue-edit { background-image: url(../images/ticket_edit.png); } -dt.issue-closed { background-image: url(../images/ticket_checked.png); } -dt.issue-note { background-image: url(../images/ticket_note.png); } -dt.changeset { background-image: url(../images/changeset.png); } -dt.news { background-image: url(../images/news.png); } -dt.message { background-image: url(../images/message.png); } -dt.reply { background-image: url(../images/comments.png); } -dt.wiki-page { background-image: url(../images/wiki_edit.png); } -dt.attachment { background-image: url(../images/attachment.png); } -dt.document { background-image: url(../images/document.png); } -dt.project { background-image: url(../images/projects.png); } - -#search-results dt.issue.closed { background-image: url(../images/ticket_checked.png); } - -div#roadmap fieldset.related-issues { margin-bottom: 1em; } -div#roadmap fieldset.related-issues ul { margin-top: 0.3em; margin-bottom: 0.3em; } -div#roadmap .wiki h1:first-child { display: none; } -div#roadmap .wiki h1 { font-size: 120%; } -div#roadmap .wiki h2 { font-size: 110%; } - -div#version-summary { float:right; width:380px; margin-left: 16px; margin-bottom: 16px; background-color: #fff; } -div#version-summary fieldset { margin-bottom: 1em; } -div#version-summary .total-hours { text-align: right; } - -table#time-report td.hours, table#time-report th.period, table#time-report th.total { text-align: right; padding-right: 0.5em; } -table#time-report tbody tr { font-style: italic; color: #777; } -table#time-report tbody tr.last-level { font-style: normal; color: #555; } -table#time-report tbody tr.total { font-style: normal; font-weight: bold; color: #555; background-color:#EEEEEE; } -table#time-report .hours-dec { font-size: 0.9em; } - -ul.properties {padding:0; font-size: 0.9em; color: #777;} -ul.properties li {list-style-type:none;} -ul.properties li span {font-style:italic;} - -.total-hours { font-size: 110%; font-weight: bold; } -.total-hours span.hours-int { font-size: 120%; } - -.autoscroll {overflow-x: auto; padding:1px; margin-bottom: 1.2em;} -#user_firstname, #user_lastname, #user_mail, #my_account_form select { width: 90%; } - -.pagination {font-size: 90%} -p.pagination {margin-top:8px;} - -/***** Tabular forms ******/ -.tabular p{ -margin: 0; -padding: 5px 0 8px 0; -padding-left: 180px; /*width of left column containing the label elements*/ -height: 1%; -clear:left; -} - -html>body .tabular p {overflow:hidden;} - -.tabular label{ -font-weight: bold; -float: left; -text-align: right; -margin-left: -180px; /*width of left column*/ -width: 175px; /*width of labels. Should be smaller than left column to create some right -margin*/ -} - -.tabular label.floating{ -font-weight: normal; -margin-left: 0px; -text-align: left; -width: 270px; -} - -input#time_entry_comments { width: 90%;} - -#preview fieldset {margin-top: 1em; background: url(../images/draft.png)} - -.tabular.settings p{ padding-left: 300px; } -.tabular.settings label{ margin-left: -300px; width: 295px; } - -.required {color: #bb0000;} -.summary {font-style: italic;} - -#attachments_fields input[type=text] {margin-left: 8px; } - -div.attachments { margin-top: 12px; } -div.attachments p { margin:4px 0 2px 0; } -div.attachments img { vertical-align: middle; } -div.attachments span.author { font-size: 0.9em; color: #888; } - -p.other-formats { text-align: right; font-size:0.9em; color: #666; } -.other-formats span + span:before { content: "| "; } - -a.feed { background: url(../images/feed.png) no-repeat 1px 50%; padding: 2px 0px 3px 16px; } - -/***** Flash & error messages ****/ -#errorExplanation, div.flash, .nodata, .warning { - padding: 4px 4px 4px 30px; - margin-bottom: 12px; - font-size: 1.1em; - border: 2px solid; -} - -div.flash {margin-top: 8px;} - -div.flash.error, #errorExplanation { - background: url(../images/false.png) 8px 5px no-repeat; - background-color: #ffe3e3; - border-color: #dd0000; - color: #550000; -} - -div.flash.notice { - background: url(../images/true.png) 8px 5px no-repeat; - background-color: #dfffdf; - border-color: #9fcf9f; - color: #005f00; -} - -div.flash.warning { - background: url(../images/warning.png) 8px 5px no-repeat; - background-color: #FFEBC1; - border-color: #FDBF3B; - color: #A6750C; - text-align: left; -} - -.nodata, .warning { - text-align: center; - background-color: #FFEBC1; - border-color: #FDBF3B; - color: #A6750C; -} - -#errorExplanation ul { font-size: 0.9em;} - -/***** Ajax indicator ******/ -#ajax-indicator { -position: absolute; /* fixed not supported by IE */ -background-color:#eee; -border: 1px solid #bbb; -top:35%; -left:40%; -width:20%; -font-weight:bold; -text-align:center; -padding:0.6em; -z-index:100; -filter:alpha(opacity=50); -opacity: 0.5; -} - -html>body #ajax-indicator { position: fixed; } - -#ajax-indicator span { -background-position: 0% 40%; -background-repeat: no-repeat; -background-image: url(../images/loading.gif); -padding-left: 26px; -vertical-align: bottom; -} - -/***** Calendar *****/ -table.cal {border-collapse: collapse; width: 100%; margin: 0px 0 6px 0;border: 1px solid #d7d7d7;} -table.cal thead th {width: 14%;} -table.cal tbody tr {height: 100px;} -table.cal th { background-color:#EEEEEE; padding: 4px; } -table.cal td {border: 1px solid #d7d7d7; vertical-align: top; font-size: 0.9em;} -table.cal td p.day-num {font-size: 1.1em; text-align:right;} -table.cal td.odd p.day-num {color: #bbb;} -table.cal td.today {background:#ffffdd;} -table.cal td.today p.day-num {font-weight: bold;} - -/***** Tooltips ******/ -.tooltip{position:relative;z-index:24;} -.tooltip:hover{z-index:25;color:#000;} -.tooltip span.tip{display: none; text-align:left;} - -div.tooltip:hover span.tip{ -display:block; -position:absolute; -top:12px; left:24px; width:270px; -border:1px solid #555; -background-color:#fff; -padding: 4px; -font-size: 0.8em; -color:#505050; -} - -/***** Progress bar *****/ -table.progress { - border: 1px solid #D7D7D7; - border-collapse: collapse; - border-spacing: 0pt; - empty-cells: show; - text-align: center; - float:left; - margin: 1px 6px 1px 0px; -} - -table.progress td { height: 0.9em; } -table.progress td.closed { background: #BAE0BA none repeat scroll 0%; } -table.progress td.done { background: #DEF0DE none repeat scroll 0%; } -table.progress td.open { background: #FFF none repeat scroll 0%; } -p.pourcent {font-size: 80%;} -p.progress-info {clear: left; font-style: italic; font-size: 80%;} - -/***** Tabs *****/ -#content .tabs {height: 2.6em; border-bottom: 1px solid #bbbbbb; margin-bottom:1.2em; position:relative;} -#content .tabs ul {margin:0; position:absolute; bottom:-2px; padding-left:1em;} -#content .tabs>ul { bottom:-1px; } /* others */ -#content .tabs ul li { -float:left; -list-style-type:none; -white-space:nowrap; -margin-right:8px; -background:#fff; -} -#content .tabs ul li a{ -display:block; -font-size: 0.9em; -text-decoration:none; -line-height:1.3em; -padding:4px 6px 4px 6px; -border: 1px solid #ccc; -border-bottom: 1px solid #bbbbbb; -background-color: #eeeeee; -color:#777; -font-weight:bold; -} - -#content .tabs ul li a:hover { -background-color: #ffffdd; -text-decoration:none; -} - -#content .tabs ul li a.selected { -background-color: #fff; -border: 1px solid #bbbbbb; -border-bottom: 1px solid #fff; -} - -#content .tabs ul li a.selected:hover { -background-color: #fff; -} - -/***** Diff *****/ -.diff_out { background: #fcc; } -.diff_in { background: #cfc; } - -/***** Wiki *****/ -div.wiki table { - border: 1px solid #505050; - border-collapse: collapse; - margin-bottom: 1em; -} - -div.wiki table, div.wiki td, div.wiki th { - border: 1px solid #bbb; - padding: 4px; -} - -div.wiki .external { - background-position: 0% 60%; - background-repeat: no-repeat; - padding-left: 12px; - background-image: url(../images/external.png); -} - -div.wiki a.new { - color: #b73535; -} - -div.wiki pre { - margin: 1em 1em 1em 1.6em; - padding: 2px; - background-color: #fafafa; - border: 1px solid #dadada; - width:95%; - overflow-x: auto; -} - -div.wiki ul.toc { - background-color: #ffffdd; - border: 1px solid #e4e4e4; - padding: 4px; - line-height: 1.2em; - margin-bottom: 12px; - margin-right: 12px; - margin-left: 0; - display: table -} -* html div.wiki ul.toc { width: 50%; } /* IE6 doesn't autosize div */ - -div.wiki ul.toc.right { float: right; margin-left: 12px; margin-right: 0; width: auto; } -div.wiki ul.toc.left { float: left; margin-right: 12px; margin-left: 0; width: auto; } -div.wiki ul.toc li { list-style-type:none;} -div.wiki ul.toc li.heading2 { margin-left: 6px; } -div.wiki ul.toc li.heading3 { margin-left: 12px; font-size: 0.8em; } - -div.wiki ul.toc a { - font-size: 0.9em; - font-weight: normal; - text-decoration: none; - color: #606060; -} -div.wiki ul.toc a:hover { color: #c61a1a; text-decoration: underline;} - -a.wiki-anchor { display: none; margin-left: 6px; text-decoration: none; } -a.wiki-anchor:hover { color: #aaa !important; text-decoration: none; } -h1:hover a.wiki-anchor, h2:hover a.wiki-anchor, h3:hover a.wiki-anchor { display: inline; color: #ddd; } - -/***** My page layout *****/ -.block-receiver { -border:1px dashed #c0c0c0; -margin-bottom: 20px; -padding: 15px 0 15px 0; -} - -.mypage-box { -margin:0 0 20px 0; -color:#505050; -line-height:1.5em; -} - -.handle { -cursor: move; -} - -a.close-icon { -display:block; -margin-top:3px; -overflow:hidden; -width:12px; -height:12px; -background-repeat: no-repeat; -cursor:pointer; -background-image:url('../images/close.png'); -} - -a.close-icon:hover { -background-image:url('../images/close_hl.png'); -} - -/***** Gantt chart *****/ -.gantt_hdr { - position:absolute; - top:0; - height:16px; - border-top: 1px solid #c0c0c0; - border-bottom: 1px solid #c0c0c0; - border-right: 1px solid #c0c0c0; - text-align: center; - overflow: hidden; -} - -.task { - position: absolute; - height:8px; - font-size:0.8em; - color:#888; - padding:0; - margin:0; - line-height:0.8em; -} - -.task_late { background:#f66 url(../images/task_late.png); border: 1px solid #f66; } -.task_done { background:#66f url(../images/task_done.png); border: 1px solid #66f; } -.task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; } -.milestone { background-image:url(../images/milestone.png); background-repeat: no-repeat; border: 0; } - -/***** Icons *****/ -.icon { -background-position: 0% 40%; -background-repeat: no-repeat; -padding-left: 20px; -padding-top: 2px; -padding-bottom: 3px; -} - -.icon22 { -background-position: 0% 40%; -background-repeat: no-repeat; -padding-left: 26px; -line-height: 22px; -vertical-align: middle; -} - -.icon-add { background-image: url(../images/add.png); } -.icon-edit { background-image: url(../images/edit.png); } -.icon-copy { background-image: url(../images/copy.png); } -.icon-del { background-image: url(../images/delete.png); } -.icon-move { background-image: url(../images/move.png); } -.icon-save { background-image: url(../images/save.png); } -.icon-cancel { background-image: url(../images/cancel.png); } -.icon-file { background-image: url(../images/file.png); } -.icon-folder { background-image: url(../images/folder.png); } -.open .icon-folder { background-image: url(../images/folder_open.png); } -.icon-package { background-image: url(../images/package.png); } -.icon-home { background-image: url(../images/home.png); } -.icon-user { background-image: url(../images/user.png); } -.icon-mypage { background-image: url(../images/user_page.png); } -.icon-admin { background-image: url(../images/admin.png); } -.icon-projects { background-image: url(../images/projects.png); } -.icon-help { background-image: url(../images/help.png); } -.icon-attachment { background-image: url(../images/attachment.png); } -.icon-index { background-image: url(../images/index.png); } -.icon-history { background-image: url(../images/history.png); } -.icon-time { background-image: url(../images/time.png); } -.icon-stats { background-image: url(../images/stats.png); } -.icon-warning { background-image: url(../images/warning.png); } -.icon-fav { background-image: url(../images/fav.png); } -.icon-fav-off { background-image: url(../images/fav_off.png); } -.icon-reload { background-image: url(../images/reload.png); } -.icon-lock { background-image: url(../images/locked.png); } -.icon-unlock { background-image: url(../images/unlock.png); } -.icon-checked { background-image: url(../images/true.png); } -.icon-details { background-image: url(../images/zoom_in.png); } -.icon-report { background-image: url(../images/report.png); } -.icon-comment { background-image: url(../images/comment.png); } - -.icon22-projects { background-image: url(../images/22x22/projects.png); } -.icon22-users { background-image: url(../images/22x22/users.png); } -.icon22-tracker { background-image: url(../images/22x22/tracker.png); } -.icon22-role { background-image: url(../images/22x22/role.png); } -.icon22-workflow { background-image: url(../images/22x22/workflow.png); } -.icon22-options { background-image: url(../images/22x22/options.png); } -.icon22-notifications { background-image: url(../images/22x22/notifications.png); } -.icon22-authent { background-image: url(../images/22x22/authent.png); } -.icon22-info { background-image: url(../images/22x22/info.png); } -.icon22-comment { background-image: url(../images/22x22/comment.png); } -.icon22-package { background-image: url(../images/22x22/package.png); } -.icon22-settings { background-image: url(../images/22x22/settings.png); } -.icon22-plugin { background-image: url(../images/22x22/plugin.png); } - -img.gravatar { - padding: 2px; - border: solid 1px #d5d5d5; - background: #fff; -} - -div.issue img.gravatar { - float: right; - margin: 0 0 0 1em; - padding: 5px; -} - -div.issue table img.gravatar { - height: 14px; - width: 14px; - padding: 2px; - float: left; - margin: 0 0.5em 0 0; -} - -#history img.gravatar { - padding: 3px; - margin: 0 1.5em 1em 0; - float: left; -} - -td.username img.gravatar { - float: left; - margin: 0 1em 0 0; -} - -#activity dt img.gravatar { - float: left; - margin: 0 1em 1em 0; -} - -#activity dt, -.journal { - clear: left; -} - -h2 img { vertical-align:middle; } - - -/***** Media print specific styles *****/ -@media print { - #top-menu, #header, #main-menu, #sidebar, #footer, .contextual, .other-formats { display:none; } - #main { background: #fff; } - #content { width: 99%; margin: 0; padding: 0; border: 0; background: #fff; overflow: visible !important;} -} diff --git a/test/scanners/css/standard.expected.raydebug b/test/scanners/css/standard.expected.raydebug deleted file mode 100644 index 3214021..0000000 --- a/test/scanners/css/standard.expected.raydebug +++ /dev/null @@ -1,8 +0,0 @@ -directive(@import) stringoperator(;) comment(/*) comment(colour) comment(file) comment(*/) -directive(@import) stringoperator(;) comment(/*) comment(colour) comment(file) comment(*/) type(body) operator({) - key(margin)operator(:)float(0)operator(;) - key(padding)operator(:)float(0)operator(;) - key(font-family)operator(:) value(verdana)operator(,) value(arial)operator(,) value(sans-serif)operator(;) - key(font-size)operator(:) float(11px)operator(;) - key(line-height)operator(:)float(137%)operator(;) -operator(}) diff --git a/test/scanners/css/standard.in.css b/test/scanners/css/standard.in.css deleted file mode 100644 index 0100e95..0000000 --- a/test/scanners/css/standard.in.css +++ /dev/null @@ -1,8 +0,0 @@ -@import url(redsauce.css); /* colour file */ -@import url(theme.css); /* colour file */ body { - margin:0; - padding:0; - font-family: verdana, arial, sans-serif; - font-size: 11px; - line-height:137%; -} diff --git a/test/scanners/css/suite.rb b/test/scanners/css/suite.rb deleted file mode 100644 index 2423369..0000000 --- a/test/scanners/css/suite.rb +++ /dev/null @@ -1,2 +0,0 @@ -class CSS < CodeRay::TestCase -end diff --git a/test/scanners/css/yui.expected.raydebug b/test/scanners/css/yui.expected.raydebug deleted file mode 100644 index a086743..0000000 --- a/test/scanners/css/yui.expected.raydebug +++ /dev/null @@ -1,7620 +0,0 @@ -comment(/*) comment(Give) comment(syntax-highlighting) comment(textareas) comment(some) comment(height) comment(for) comment(unsupported) comment(browsers) comment(*/) - -type(textarea)class(.JScript)operator(,) type(textarea)class(.HTML)operator(,) type(textarea)class(.XML) operator({)key(height)operator(:)float(10em)operator(;)operator(}) - -comment(/*) comment(Main) comment(style) comment(for) comment(the) comment(table) comment(*/) - -class(.dp-highlighter) operator({) - key(width)operator(:) float(100%)operator(;) - key(overflow)operator(:) value(auto)operator(;) - key(line-height)operator(:) float(100%) important(!important)operator(;) - key(margin)operator(:)float(0) float(0) float(1em) float(0)operator(;) -operator(}) - -class(.dp-highlighter) type(table) operator({) - key(width)operator(:)float(99%) important(!important)operator(;) - key(margin)operator(:) float(2px) float(0px) float(2px) float(0px) important(!important)operator(;) - key(border-collapse)operator(:) value(collapse)operator(;) - key(border-bottom)operator(:) float(2px) value(solid) color(#eee)operator(;) - key(background-color)operator(:) color(#fff)operator(;) -operator(}) - -class(.dp-highlighter) type(tbody)class(.hide) operator({) key(display)operator(:) value(none)operator(;) operator(}) -class(.dp-highlighter) type(tbody)class(.show) operator({) key(display)operator(:) value(table-row-group)operator(;) key(_display)operator(:) value(block)operator(;) operator(}) - -class(.dp-highlighter) type(td) -operator({) - key(font-family)operator(:) value(Courier) value(New)operator(;) - key(font-size)operator(:) float(11px)operator(;) -operator(}) - -comment(/*) comment(Styles) comment(for) comment(the) comment(tools) comment(*/) - -class(.dp-highlighter) class(.tools-corner) operator({) - key(background-color)operator(:) color(#eee)operator(;) - key(font-size)operator(:) float(9px)operator(;) -operator(}) - -class(.dp-highlighter) class(.tools) operator({) - key(background-color)operator(:) color(#eee)operator(;) - key(padding)operator(:) float(3px) float(8px) float(3px) float(10px)operator(;) - key(border-bottom)operator(:) float(1px) value(solid) value(gray)operator(;) - key(font)operator(:) float(9px) value(Verdana)operator(,) value(Geneva)operator(,) value(Arial)operator(,) value(Helvetica)operator(,) value(sans-serif)operator(;) - key(color)operator(:) value(silver)operator(;) -operator(}) - -class(.dp-highlighter) class(.tools-corner) operator({) - key(background-color)operator(:) color(#eee)operator(;) -operator(}) - -class(.dp-highlighter) class(.tools) type(a) operator({) - key(font-size)operator(:) float(9px)operator(;) - key(color)operator(:) value(gray)operator(;) - key(text-decoration)operator(:) value(none)operator(;) -operator(}) - -class(.dp-highlighter) class(.tools) type(a)pseudo_class(:hover) operator({) - key(color)operator(:) value(red)operator(;) - key(text-decoration)operator(:) value(underline)operator(;) -operator(}) - -comment(/*) comment(Gutter) comment(with) comment(line) comment(number) comment(*/) - -class(.dp-highlighter) class(.gutter) operator({) - key(padding-right)operator(:) float(5px)operator(;) - key(padding-left)operator(:) float(10px)operator(;) - key(width)operator(:) float(5px)operator(;) - key(background-color)operator(:) color(#eee)operator(;) - key(border-right)operator(:) float(1px) value(solid) value(gray)operator(;) - key(color)operator(:) value(gray)operator(;) - key(text-align)operator(:) value(right)operator(;) - key(vertical-align)operator(:) value(top)operator(;) -operator(}) - -comment(/*) comment(Single) comment(line) comment(style) comment(*/) - -class(.dp-highlighter) class(.line1)operator(,) class(.line2) operator({) - key(padding-left)operator(:) float(10px)operator(;) - comment(/*)comment(border-bottom:) comment(1px) comment(solid) comment(#F7F7F7;)comment(*/) - key(white-space)operator(:)value(nowrap)operator(;) -operator(}) - -class(.dp-highlighter) class(.line2) operator({) - comment(/*)comment(background-color:) comment(#F7F7F7;)comment(*/) -operator(}) - -comment(/*) comment(About) comment(dialog) comment(styles) comment(*/) - -class(.dp-about) operator({) - key(background-color)operator(:) color(#fff)operator(;) - key(margin)operator(:) float(0px)operator(;) -operator(}) - -class(.dp-about) type(table) operator({) - key(width)operator(:) float(100%)operator(;) - key(height)operator(:) float(100%)operator(;) - key(font-size)operator(:) float(11px)operator(;) - key(font-family)operator(:) value(Tahoma)operator(,) value(Verdana)operator(,) value(Arial)operator(,) value(sans-serif) important(!important)operator(;) -operator(}) - -class(.dp-about) type(td) operator({) - key(padding)operator(:) float(10px)operator(;) - key(vertical-align)operator(:) value(top)operator(;) -operator(}) - -class(.dp-about) class(.copy) operator({) - key(border-bottom)operator(:) float(1px) value(solid) color(#ACA899)operator(;) - key(height)operator(:) float(95%)operator(;) -operator(}) - -class(.dp-about) class(.title) operator({) - key(color)operator(:) value(red)operator(;) - key(font-weight)operator(:) value(bold)operator(;) -operator(}) - -class(.dp-about) class(.para) operator({) - key(margin-bottom)operator(:) float(4px)operator(;) -operator(}) - -class(.dp-about) class(.footer) operator({) - key(background-color)operator(:) color(#ECEADB)operator(;) - key(border-top)operator(:) float(1px) value(solid) color(#fff)operator(;) - key(text-align)operator(:) value(right)operator(;) -operator(}) - -class(.dp-about) class(.close) operator({) - key(font-size)operator(:) float(11px)operator(;) - key(font-family)operator(:) value(Tahoma)operator(,) value(Verdana)operator(,) value(Arial)operator(,) value(sans-serif) important(!important)operator(;) - key(background-color)operator(:) color(#ECEADB)operator(;) - key(width)operator(:) float(60px)operator(;) - key(height)operator(:) float(22px)operator(;) -operator(}) - -comment(/*) comment(Language) comment(specific) comment(styles) comment(*/) - -class(.dp-c) operator({)operator(}) -class(.dp-c) class(.comment) operator({) key(color)operator(:) value(green)operator(;) operator(}) -class(.dp-c) class(.string) operator({) key(color)operator(:) value(blue)operator(;) operator(}) -class(.dp-c) class(.preprocessor) operator({) key(color)operator(:) value(gray)operator(;) operator(}) -class(.dp-c) class(.keyword) operator({) key(color)operator(:) value(blue)operator(;) operator(}) -class(.dp-c) class(.vars) operator({) key(color)operator(:) color(#d00)operator(;) operator(}) -comment(/*) -comment(.dp-vb) comment({}) -comment(.dp-vb) comment(.comment) comment({) comment(color:) comment(green;) comment(}) -comment(.dp-vb) comment(.string) comment({) comment(color:) comment(blue;) comment(}) -comment(.dp-vb) comment(.preprocessor) comment({) comment(color:) comment(gray;) comment(}) -comment(.dp-vb) comment(.keyword) comment({) comment(color:) comment(blue;) comment(}) - -comment(.dp-sql) comment({}) -comment(.dp-sql) comment(.comment) comment({) comment(color:) comment(green;) comment(}) -comment(.dp-sql) comment(.string) comment({) comment(color:) comment(red;) comment(}) -comment(.dp-sql) comment(.keyword) comment({) comment(color:) comment(blue;) comment(}) -comment(.dp-sql) comment(.func) comment({) comment(color:) comment(#ff1493;) comment(}) -comment(.dp-sql) comment(.op) comment({) comment(color:) comment(#808080;) comment(}) -comment(*/) -class(.dp-xml) operator({)operator(}) -class(.dp-xml) class(.cdata) operator({) key(color)operator(:) color(#ff1493)operator(;) operator(}) -class(.dp-xml) class(.comments) operator({) key(color)operator(:) value(green)operator(;) operator(}) -class(.dp-xml) class(.tag) operator({) key(color)operator(:) value(blue)operator(;) operator(}) -class(.dp-xml) class(.tag-name) operator({) key(color)operator(:) value(black)operator(;) key(font-weight)operator(:) value(bold)operator(;) operator(}) -class(.dp-xml) class(.attribute) operator({) key(color)operator(:) value(red)operator(;) operator(}) -class(.dp-xml) class(.attribute-value) operator({) key(color)operator(:) value(blue)operator(;) operator(}) -comment(/*) -comment(.dp-delphi) comment({}) -comment(.dp-delphi) comment(.comment) comment({) comment(color:) comment(#008200;) comment(font-style:) comment(italic;) comment(}) -comment(.dp-delphi) comment(.string) comment({) comment(color:) comment(blue;) comment(}) -comment(.dp-delphi) comment(.number) comment({) comment(color:) comment(blue;) comment(}) -comment(.dp-delphi) comment(.directive) comment({) comment(color:) comment(#008284;) comment(}) -comment(.dp-delphi) comment(.keyword) comment({) comment(font-weight:) comment(bold;) comment(color:) comment(navy;) comment(}) -comment(.dp-delphi) comment(.vars) comment({) comment(color:) comment(#000;) comment(}) - -comment(.dp-py) comment({}) -comment(.dp-py) comment(.comment) comment({) comment(color:) comment(green;) comment(}) -comment(.dp-py) comment(.string) comment({) comment(color:) comment(red;) comment(}) -comment(.dp-py) comment(.docstring) comment({) comment(color:) comment(brown;) comment(}) -comment(.dp-py) comment(.keyword) comment({) comment(color:) comment(blue;) comment(font-weight:) comment(bold;}) -comment(.dp-py) comment(.builtins) comment({) comment(color:) comment(#ff1493;) comment(}) -comment(.dp-py) comment(.magicmethods) comment({) comment(color:) comment(#808080;) comment(}) -comment(.dp-py) comment(.exceptions) comment({) comment(color:) comment(brown;) comment(}) -comment(.dp-py) comment(.types) comment({) comment(color:) comment(brown;) comment(font-style:) comment(italic;) comment(}) -comment(.dp-py) comment(.commonlibs) comment({) comment(color:) comment(#8A2BE2;) comment(font-style:) comment(italic;) comment(})comment(*/) - - -class(.dp-css) class(.keyword) operator({) key(color)operator(:) value(red)operator(;) operator(}) -class(.dp-css) class(.value) operator({) key(color)operator(:) color(#ff1493)operator(;) operator(}) -class(.dp-css) class(.comment) operator({) key(color)operator(:) value(green)operator(;) operator(}) -class(.dp-css) class(.string) operator({) key(color)operator(:) value(blue)operator(;) operator(}) -class(.dp-css) class(.preprocessor) operator({) key(color)operator(:) value(gray)operator(;) operator(}) -class(.dp-css) class(.keyword) operator({) key(color)operator(:) value(blue)operator(;) operator(}) -class(.dp-css) class(.vars) operator({) key(color)operator(:) color(#d00)operator(;) operator(}) -class(.dp-css) class(.colors) operator({) key(font-weight)operator(:) value(bold)operator(;) operator(}) -comment(/*)comment(Copyright) comment((c\)) comment(2006,Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) comment(http://developer.yahoo.net/yui/license.txt) comment(*/) -comment(/*)comment(reset.css)comment(*/)type(body)operator(,)type(div)operator(,)type(dl)operator(,)type(dt)operator(,)type(dd)operator(,)type(ul)operator(,)type(ol)operator(,)type(li)operator(,)type(h1)operator(,)type(h2)operator(,)type(h3)operator(,)type(h4)operator(,)type(h5)operator(,)type(h6)operator(,)type(pre)operator(,)type(form)operator(,)type(fieldset)operator(,)type(input)operator(,)type(textarea)operator(,)type(p)operator(,)type(blockquote)operator(,)type(th)operator(,)type(td)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})type(table)operator({)key(border-collapse)operator(:)value(collapse)operator(;)key(border-spacing)operator(:)float(0)operator(;)operator(})type(fieldset)operator(,)type(img)operator({)key(border)operator(:)float(0)operator(;)operator(})type(address)operator(,)type(caption)operator(,)type(cite)operator(,)type(code)operator(,)type(dfn)operator(,)type(em)operator(,)type(strong)operator(,)type(th)operator(,)type(var)operator({)key(font-style)operator(:)value(normal)operator(;)key(font-weight)operator(:)value(normal)operator(;)operator(})type(ol)operator(,)type(ul) operator({)key(list-style)operator(:)value(none)operator(;)operator(})type(caption)operator(,)type(th) operator({)key(text-align)operator(:)value(left)operator(;)operator(})type(h1)operator(,)type(h2)operator(,)type(h3)operator(,)type(h4)operator(,)type(h5)operator(,)type(h6)operator({)key(font-size)operator(:)float(100%)operator(;)key(font-weight)operator(:)value(normal)operator(;)operator(})type(q)pseudo_class(:before)operator(,)type(q)pseudo_class(:after)operator({)key(content)operator(:)stringoperator(;)operator(})type(abbr)operator(,)type(acronym) operator({)key(border)operator(:)float(0)operator(;)operator(}) -comment(/*)comment(fonts.css)comment(*/)type(body)operator({)key(font)operator(:)float(13px) value(arial)operator(,)value(helvetica)operator(,)value(clean)operator(,)value(sans-serif)operator(;)error(*)key(font-size)operator(:)value(small)operator(;)error(*)key(font)operator(:)value(x-small)operator(;)operator(})type(table) operator({)key(font-size)operator(:)value(inherit)operator(;)key(font)operator(:)float(100%)operator(;)operator(})type(select)operator(,) type(input)operator(,) type(textarea) operator({)key(font)operator(:)float(99%) value(arial)operator(,)value(helvetica)operator(,)value(clean)operator(,)value(sans-serif)operator(;)operator(})type(pre)operator(,) type(code) operator({)key(font)operator(:)float(115%) value(monospace)operator(;)error(*)key(font-size)operator(:)float(100%)operator(;)operator(})comment(/*) -comment(/*removing) -comment(body) comment(*) comment({line-height:1.22em;}) -comment(*/) -comment(/*)comment(grids.css)comment(*/)type(body)operator({)key(text-align)operator(:)value(center)operator(;)operator(})constant(#ft)operator({)key(clear)operator(:)value(both)operator(;)operator(})constant(#doc)operator(,)constant(#doc2)operator(,)constant(#doc3)operator(,)class(.yui-t1)operator(,)class(.yui-t2)operator(,)class(.yui-t3)operator(,)class(.yui-t4)operator(,)class(.yui-t5)operator(,)class(.yui-t6)operator(,)class(.yui-t7)operator({)key(margin)operator(:)value(auto)operator(;)key(text-align)operator(:)value(left)operator(;)key(width)operator(:)float(57.69em)operator(;)error(*)key(width)operator(:)float(56.3em)operator(;)key(min-width)operator(:)float(750px)operator(;)operator(})constant(#doc2)operator({)key(width)operator(:)float(73.074em)operator(;)error(*)key(width)operator(:)float(71.313em)operator(;)key(min-width)operator(:)float(950px)operator(;)operator(})constant(#doc3)operator({)key(margin)operator(:)value(auto) float(10px)operator(;)key(width)operator(:)value(auto)operator(;)operator(})class(.yui-b)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-b)operator({)key(_position)operator(:)value(static)operator(;)operator(})constant(#yui-main) class(.yui-b)operator({)key(position)operator(:)value(static)operator(;)operator(})constant(#yui-main)operator({)key(width)operator(:)float(100%)operator(;)operator(})class(.yui-t1) constant(#yui-main)operator(,)class(.yui-t2) constant(#yui-main)operator(,)class(.yui-t3) constant(#yui-main)operator({)key(float)operator(:)value(right)operator(;)key(margin-left)operator(:)float(-25em)operator(;)operator(})class(.yui-t4) constant(#yui-main)operator(,)class(.yui-t5) constant(#yui-main)operator(,)class(.yui-t6) constant(#yui-main)operator({)key(float)operator(:)value(left)operator(;)key(margin-right)operator(:)float(-25em)operator(;)operator(})class(.yui-t1) class(.yui-b)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(12.3207em)operator(;)error(*)key(width)operator(:)float(12.0106em)operator(;)operator(})class(.yui-t1) constant(#yui-main) class(.yui-b)operator({)key(margin-left)operator(:)float(13.3207em)operator(;)error(*)key(margin-left)operator(:)float(13.0106em)operator(;)operator(})class(.yui-t2) class(.yui-b)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(13.8456em)operator(;)error(*)key(width)operator(:)float(13.512em)operator(;)operator(})class(.yui-t2) constant(#yui-main) class(.yui-b)operator({)key(margin-left)operator(:)float(14.8456em)operator(;)error(*)key(margin-left)operator(:)float(14.512em)operator(;)operator(})class(.yui-t3) class(.yui-b)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(23.0759em)operator(;)error(*)key(width)operator(:)float(22.52em)operator(;)operator(})class(.yui-t3) constant(#yui-main) class(.yui-b)operator({)key(margin-left)operator(:)float(24.0759em)operator(;)error(*)key(margin-left)operator(:)float(23.52em)operator(;)operator(})class(.yui-t4) class(.yui-b)operator({)key(float)operator(:)value(right)operator(;)key(width)operator(:)float(13.8456em)operator(;)error(*)key(width)operator(:)float(13.512em)operator(;)operator(})class(.yui-t4) constant(#yui-main) class(.yui-b)operator({)key(margin-right)operator(:)float(14.8456em)operator(;)error(*)key(margin-right)operator(:)float(14.512em)operator(;)operator(})class(.yui-t5) class(.yui-b)operator({)key(float)operator(:)value(right)operator(;)key(width)operator(:)float(18.4608em)operator(;)error(*)key(width)operator(:)float(18.016em)operator(;)operator(})class(.yui-t5) constant(#yui-main) class(.yui-b)operator({)key(margin-right)operator(:)float(19.4608em)operator(;)error(*)key(margin-right)operator(:)float(19.016em)operator(;)operator(})class(.yui-t6) class(.yui-b)operator({)key(float)operator(:)value(right)operator(;)key(width)operator(:)float(23.0759em)operator(;)error(*)key(width)operator(:)float(22.52em)operator(;)operator(})class(.yui-t6) constant(#yui-main) class(.yui-b)operator({)key(margin-right)operator(:)float(24.0759em)operator(;)error(*)key(margin-right)operator(:)float(23.52em)operator(;)operator(})class(.yui-t7) constant(#yui-main) class(.yui-b)operator({)key(display)operator(:)value(block)operator(;)key(margin)operator(:)float(0) float(0) float(1em) float(0)operator(;)operator(})constant(#yui-main) class(.yui-b)operator({)key(float)operator(:)value(none)operator(;)key(width)operator(:)value(auto)operator(;)operator(})class(.yui-g) class(.yui-u)operator(,)class(.yui-g) class(.yui-g)operator(,)class(.yui-gc) class(.yui-u)operator(,)class(.yui-gc) class(.yui-g) class(.yui-u)operator(,)class(.yui-ge) class(.yui-u)operator(,)class(.yui-gf) class(.yui-u)operator({)key(float)operator(:)value(right)operator(;)key(display)operator(:)value(inline)operator(;)operator(})class(.yui-g) type(div)class(.first)operator(,)class(.yui-gc) type(div)class(.first)operator(,)class(.yui-gc) type(div)class(.first) type(div)class(.first)operator(,)class(.yui-gd) type(div)class(.first)operator(,)class(.yui-ge) type(div)class(.first)operator(,)class(.yui-gf) type(div)class(.first)operator({)key(float)operator(:)value(left)operator(;)operator(})class(.yui-g) class(.yui-u)operator(,)class(.yui-g) class(.yui-g)operator({)key(width)operator(:)float(49.1%)operator(;)operator(})class(.yui-g) class(.yui-g) class(.yui-u)operator(,)class(.yui-gc) class(.yui-g) class(.yui-u)operator({)key(width)operator(:)float(48.1%)operator(;)operator(})class(.yui-gb) class(.yui-u)operator(,)class(.yui-gc) class(.yui-u)operator(,)class(.yui-gd) class(.yui-u)operator({)key(float)operator(:)value(left)operator(;)key(margin-left)operator(:)float(2%)operator(;)error(*)key(margin-left)operator(:)float(1.895%)operator(;)key(width)operator(:)float(32%)operator(;)operator(})class(.yui-gb) type(div)class(.first)operator(,)class(.yui-gc) type(div)class(.first)operator(,)class(.yui-gd) type(div)class(.first)operator({)key(margin-left)operator(:)float(0)operator(;)operator(})class(.yui-gc) type(div)class(.first)operator(,)class(.yui-gd) class(.yui-u)operator({)key(width)operator(:)float(66%)operator(;)operator(})class(.yui-gd) type(div)class(.first)operator({)key(width)operator(:)float(32%)operator(;)operator(})class(.yui-ge) class(.yui-u)operator({)key(width)operator(:)float(24%)operator(;)operator(})class(.yui-ge) type(div)class(.first)operator(,)class(.yui-gf) class(.yui-u)operator({)key(width)operator(:)float(74.2%)operator(;)operator(})class(.yui-gf) type(div)class(.first)operator({)key(width)operator(:)float(24%)operator(;)operator(})class(.yui-ge) type(div)class(.first)operator({)key(width)operator(:)float(74.2%)operator(;)operator(})constant(#bd)pseudo_class(:after)operator(,)class(.yui-g)pseudo_class(:after)operator(,)class(.yui-gb)pseudo_class(:after)operator(,)class(.yui-gc)pseudo_class(:after)operator(,)class(.yui-gd)pseudo_class(:after)operator(,)class(.yui-ge)pseudo_class(:after)operator(,)class(.yui-gf)pseudo_class(:after)operator({)key(content)operator(:)stringoperator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(0)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)operator(})constant(#bd)operator(,)class(.yui-g)operator(,)class(.yui-gb)operator(,)class(.yui-gc)operator(,)class(.yui-gd)operator(,)class(.yui-ge)operator(,)class(.yui-gf)operator({)key(zoom)operator(:)float(1)operator(;)operator(}) - -comment(/*)comment(begin) comment(YDN/YUI) comment(styles)comment(*/) -constant(#bd) operator({)key(padding-top)operator(:)float(1em)operator(;)operator(}) -class(.yui-gb)pseudo_class(:after)operator({)key(clear)operator(:)value(none)operator(;)operator(}) -constant(#doc3) operator({)key(min-width)operator(:)float(950px)operator(;)operator(}) -type(h1)operator(,) type(h2)operator(,) type(h3)operator(,) type(h4)operator(,) type(h5)operator(,) type(h6) operator({)key(font-weight)operator(:)value(bold)operator(;) key(color)operator(:)color(#E76300)operator(;)operator(}) -type(h1)operator(,) type(h2)operator(,) type(h3)operator(,) type(h4)operator(,) type(h5)operator(,) type(h6)operator(,) type(p) operator({)key(line-height)operator(:)float(1.2em)operator(;) key(font-size)operator(:)float(100%)operator(;) key(margin)operator(:)float(1em) float(0) float(0) float(0)operator(;)operator(}) -type(h1)class(.first-content)operator(,) type(h2)class(.first-content)operator(,) type(h3)class(.first-content) operator({)key(margin-top)operator(:)float(0)operator(;) key(padding-top)operator(:)float(0)operator(;) key(border)operator(:)value(none)operator(;)operator(}) comment(/*)comment(if) comment(an) comment(h) comment(is) comment(the) comment(first) comment(thing) comment(on) comment(the) comment(page) comment(or) comment(in) comment(a) comment(section,) comment(it) comment(should) comment(be) comment(flush) comment(with) comment(the) comment(top) comment(border) comment(of) comment(its) comment(content) comment(area;) comment(otherwise,) comment(its) comment(content) comment(area) comment(should) comment(be) comment(padded) comment(to) comment(create) comment(space.)comment(*/) -type(p) operator({) key(margin-bottom)operator(:)float(1em) operator(}) -type(h1) operator({) key(font-size)operator(:) float(136%)operator(;) key(padding)operator(:)float(0)operator(;) key(padding-top)operator(:)float(18px)operator(}) -class(.wiki) type(h1) operator({) key(font-size)operator(:) float(120%)operator(;) key(padding)operator(:)float(0)operator(;) key(margin-bottom)operator(:)float(1em)operator(}) -type(h2) operator({) key(font-size)operator(:) float(110%)operator(;) key(margin-top)operator(:)float(1.5em)operator(;) key(margin-bottom)operator(:)float(.2em)operator(;) key(padding)operator(:)float(1em) float(0) float(0) float(0)operator(;) key(border-top)operator(:)float(1px) value(dashed) color(#C3D2DC)operator(;)operator(}) -type(h2)class(.first) operator({) key(border-top)operator(:)value(none)operator(;) key(margin-top)operator(:)float(0)operator(;) key(margin-bottom)operator(:)float(.2em)operator(;)operator(}) -constant(#doc3) type(h2)class(.first) operator({) key(float)operator(:)value(none)operator(;) comment(/*)comment(float) comment(specified) comment(to) comment(resolve) comment(conflict) comment(on) comment(generic) comment(float) comment(declaration) comment(for) comment(.first) comment(in) comment(grids)comment(*/)operator(}) -type(h4) operator({)key(margin-top)operator(:)float(1em)operator(;) key(color)operator(:) color(#000)operator(;)operator(}) -type(ul)operator(,) type(ol)operator(,) type(dl)operator(,) type(dd) operator({)key(margin-left)operator(:)float(30px)operator(;)operator(}) -type(dt) operator({) key(font-weight)operator(:)value(bold)operator(;) operator(}) -type(ul)operator(,) type(ol) operator({)key(margin-bottom)operator(:)float(.7em)operator(;)operator(}) -type(ul) operator({)key(list-style)operator(:)value(disc)operator(;)operator(}) -type(ol) operator({)key(list-style)operator(:)value(decimal)operator(;)operator(}) -type(strong) operator({)key(font-weight)operator(:)value(bold)operator(;)operator(}) -type(em) operator({)key(font-style)operator(:)value(italic)operator(;)operator(}) - -type(a)operator(,) type(a) type(code) operator({)key(color)operator(:)color(#0000de)operator(;)operator(}) -type(a)pseudo_class(:visited)operator(,) type(a)pseudo_class(:visited) type(code) operator({)key(color)operator(:)color(#639)operator(;)operator(}) -type(a)pseudo_class(:active)operator(,) type(a)pseudo_class(:active) type(code) operator({)key(color)operator(:) color(#f00)operator(;)operator(}) - -type(h1) type(a) operator({) key(color)operator(:)color(#E76300)operator(;) operator(}) -type(h1) type(a)pseudo_class(:visited) operator({)key(color)operator(:)color(#E76300)operator(}) - -constant(#logo_pane) operator({) key(display)operator(:) value(none)operator(;) operator(}) - -constant(#ygma) operator({) key(margin)operator(:)float(.5em) value(auto) float(1em) value(auto)operator(;) operator(}) - -constant(#bd) type(ol) operator({)operator(}) -constant(#bd) type(ol) type(li) type(p) operator({) key(margin-left)operator(:)float(0)operator(}) -constant(#bd) type(ol) type(li) type(ol) operator({)key(list-style)operator(:)value(lower-alpha)operator(}) -constant(#bd) type(ol) type(li) type(ol) type(li) operator({)key(margin-bottom)operator(:)float(1em)operator(}) -constant(#bd) type(ol) type(li) type(ol) type(li) type(ol)operator({)key(list-style)operator(:)value(lower-roman)operator(}) -constant(#bd) type(ol) type(li) type(ol) type(li) type(ol) type(li) operator({)key(margin-bottom)operator(:)float(1em)operator(}) - -constant(#bd) type(p)class(.errormessage) operator({)key(background)operator(:)string float(0) float(0) value(no-repeat)operator(;) key(padding-left)operator(:)float(30px)operator(;) key(margin)operator(:)float(2em) float(2em) float(2em) float(1em)operator(;) key(font-weight)operator(:)value(bold)operator(}) - -comment(/*)comment(formerly) comment(#bd) comment(targeting)comment(*/) -type(ul) operator({)key(margin-top)operator(:)float(2px)operator(;) operator(}) -type(ul)class(.topspace) operator({) key(margin-top)operator(:)float(1em) operator(}) -type(ul) type(li) operator({) key(margin)operator(:)float(0) float(17px) float(0) float(7px)operator(;) operator(}) -type(ul) type(li) type(ul) operator({) key(margin-top)operator(:)float(0em) operator(}) -type(ul)class(.plain) operator({)key(margin-top)operator(:) float(0)operator(;) key(list-style)operator(:) value(none)operator(;)operator(}) -type(ul)class(.plain) type(ul) operator({)key(margin-top)operator(:) float(0)operator(;) key(list-style)operator(:) value(none)operator(;)operator(}) -type(ul)class(.jump) operator({)key(list-style)operator(:) value(none)operator(;) key(margin-top)operator(:) float(1em)operator(;)operator(}) -type(ul)class(.jump) type(li) operator({)key(margin-top)operator(:) float(.5em)operator(;)operator(}) - -comment(/*)comment(#bd) comment(table) comment({) comment(margin:10px) comment(17px;) comment(width:720px;) comment(})comment(*/) -comment(/*)comment(#bd) comment(th) comment({) comment(background:#B6CDE1;) comment(padding:2px;) comment(color:#fff;) comment(vertical-align:top}) -comment(#bd) comment(td) comment({) comment(padding:2px;) comment(vertical-align:top}) -comment(#bd) comment(td.even) comment({) comment(background:red;) comment(})comment(*/) - -type(h2)class(.classname) operator({) key(border-top)operator(:)value(none)operator(;) key(margin-top)operator(:)float(0)operator(;) key(margin-bottom)operator(:)float(.2em)operator(;) key(font-size)operator(:) float(130%)operator(;) key(color)operator(:)color(#000000)operator(}) -type(h3)class(.breadcrumb) operator({) key(border-top)operator(:)value(none)operator(;) key(margin-top)operator(:)float(0)operator(;) key(margin-bottom)operator(:)float(.2em)operator(;) key(font-size)operator(:) float(80%)operator(;) key(color)operator(:)color(#000000)operator(}) -type(h3)class(.methods) operator({) key(border-top)operator(:)value(none)operator(;) key(margin-top)operator(:)float(0)operator(;) key(margin-bottom)operator(:)float(.2em)operator(;) key(font-size)operator(:) float(100%)operator(;) key(color)operator(:)color(#000000)operator(}) - -class(.screenshot) operator({)key(border)operator(:)value(thin) value(solid) color(#999999)operator(;) key(margin)operator(:)float(8px)operator(;)operator(}) - -constant(#toc) operator({)key(background-color)operator(:)color(#ecf5fa)operator(;) key(padding)operator(:)float(0)operator(;) key(border)operator(:)float(1px) value(solid) color(#89d) operator(}) -constant(#toc) type(ul) operator({)key(list-style)operator(:)value(none)operator(;) key(margin)operator(:)float(0)operator(;) key(padding)operator(:)float(0)operator(;)operator(}) -constant(#toc) type(ul) type(li) operator({) key(padding)operator(:)float(0)operator(;) key(margin)operator(:)float(0)operator(;) key(font-size)operator(:)float(85%)operator(;) operator(}) -constant(#toc) type(ul) type(li)class(.selected) operator({) key(font-weight)operator(:)value(bold)operator(;) key(color)operator(:)color(#fff)operator(;) key(background)operator(:)color(#f82)operator(;) key(padding)operator(:)float(0)operator(;) operator(}) -constant(#toc) type(ul) type(li)class(.selected) type(a) operator({) key(color)operator(:)color(#fff)operator(;) operator(}) -constant(#toc) type(ul) type(li) type(a) operator({) key(display)operator(:)value(block)operator(;) key(padding)operator(:)float(2px) float(2px) float(2px) float(10px)operator(;) key(text-decoration)operator(:)value(none)operator(;) operator(}) -constant(#toc) type(ul) type(li) type(a)pseudo_class(:hover) operator({) key(color)operator(:)color(#fff)operator(;) key(background)operator(:)color(#e60)operator(;) operator(}) -constant(#toc) type(ul) type(li) type(em) operator({) key(display)operator(:)value(none)operator(;) operator(}) -constant(#toc) type(ul) type(li)class(.sect) operator({) key(font-weight)operator(:)value(bold)operator(;) key(color)operator(:)color(#fff)operator(;) key(background)operator(:)color(#89d)operator(;) key(padding)operator(:)float(2px) float(0)operator(;) key(text-indent)operator(:)float(2px)operator(;) key(margin-top)operator(:)float(2px)operator(;)operator(}) -constant(#toc) type(ul) type(li)class(.first) operator({)key(margin-top)operator(:)float(0)operator(;)operator(}) - -constant(#ft) operator({) key(margin-top)operator(:)float(4em) operator(}) -constant(#ft) type(p) operator({) key(padding-bottom)operator(:)float(2em)operator(;) key(margin)operator(:)float(0)operator(;) key(text-align)operator(:)value(center)operator(;) key(font-size)operator(:)float(80%)operator(;) key(line-height)operator(:)float(1.4em)operator(}) -constant(#ft) type(p)class(.first) operator({) key(padding)operator(:)float(1em) float(0) float(0) float(0)operator(;) key(margin)operator(:)float(0)operator(;) operator(}) - -constant(#pagetitle) operator({)key(background)operator(:) string float(0) float(0) value(repeat-x) color(#B6CDE1)operator(;) key(border)operator(:) float(1px) value(solid) color(#93B2CC)operator(;) key(position)operator(:)value(relative)operator(;)operator(}) -constant(#pagetitle) type(h1) operator({)key(text-indent)operator(:)float(15px)operator(;) key(padding)operator(:)float(4px) float(0) float(2px) float(0)operator(;) key(background)operator(:) string float(0) float(0) value(no-repeat)operator(;) key(margin)operator(:)float(0)operator(;) key(color)operator(:)color(#000)operator(;) key(font-size)operator(:)float(120%)operator(;) key(font-weight)operator(:)value(bold)operator(;) key(position)operator(:)value(relative)operator(;) key(left)operator(:)float(-1px)operator(;) key(top)operator(:)float(-1px)operator(;) key(margin-right)operator(:)float(-2px)operator(;)operator(}) -constant(#pagetitle) type(h1) type(em) operator({)key(color)operator(:)color(#FF9933)operator(;) key(font-size)operator(:)float(60%)operator(;) key(font-weight)operator(:)value(bold)operator(;) key(font-style)operator(:)value(normal)operator(;) key(position)operator(:)value(relative)operator(;) key(top)operator(:)float(-6px)operator(}) - -constant(#ygunav) operator({)key(background)operator(:)color(#eee)operator(;) key(border-bottom)operator(:)float(2px) value(solid) color(#ccc)operator(;) key(padding)operator(:)float(0) float(10px)operator(;)key(font-size)operator(:)float(78%)operator(;)key(text-align)operator(:)value(right)operator(;)key(margin-bottom)operator(:)float(6px)operator(;)key(height)operator(:)float(2.5em)operator(;)key(line-height)operator(:)float(2.5em)operator(;)operator(}) -type(html)operator(>)type(body) constant(#ygunav) operator({)key(overflow)operator(:)value(hidden)operator(;)operator(}) -constant(#ygunav) type(strong) operator({)key(font-family)operator(:)value(verdana)operator(;)operator(}) -constant(#ygunav) type(p) operator({)key(display)operator(:)value(inline)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(}) -constant(#ygunav) type(p) type(em) operator({)key(float)operator(:)value(left)operator(;)key(text-align)operator(:)value(left)operator(;)key(font-style)operator(:)value(normal)operator(;) key(padding-top)operator(:)float(.7em)operator(}) -type(*) type(html) constant(#ygunav) type(p) type(em) operator({)key(margin-top)operator(:)float(1px)operator(;)operator(}) -constant(#ygunav) type(p) type(em) type(i) operator({)key(visibility)operator(:)value(hidden)operator(;)operator(}) -constant(#ygunav) type(a) operator({)key(color)operator(:)color(#000)operator(;)operator(}) -constant(#ygunav) type(form) operator({)key(display)operator(:)value(inline)operator(;)key(margin)operator(:)float(0) float(0) float(0) float(1em)operator(;)operator(}) -constant(#ygsp) operator({)key(width)operator(:)float(8em)operator(;)key(font-size)operator(:)float(110%)operator(;)key(padding)operator(:)float(0)operator(;)key(vertical-align)operator(:)value(middle)operator(;)operator(}) -constant(#ygunav) class(.ygbt) operator({)key(background)operator(:)color(#dcdcdc)operator(;)key(font)operator(:)float(110%) value(verdana)operator(;)key(position)operator(:)value(relative)operator(;)key(top)operator(:)float(1px)operator(;)operator(}) -type(*) type(html) constant(#ygunav) class(.ygbt) operator({)key(top)operator(:)float(4px)operator(;)operator(}) -type(*) type(html)operator(>)type(body) constant(#ygunav) class(.ygbt) operator({)key(line-height)operator(:)float(0)operator(;)key(top)operator(:)float(-4px)operator(;)operator(}) -constant(#ygunav) type(label) operator({)key(color)operator(:)color(#666)operator(;)key(font-family)operator(:)value(tahoma)operator(;)key(position)operator(:)value(relative)operator(;)key(top)operator(:)float(1px)operator(;)operator(}) - -constant(#bd) type(ol)class(.getstarted) operator({) key(margin)operator(:)float(0)operator(;) key(padding)operator(:)float(0)operator(;) operator(}) -constant(#bd) type(ol)class(.getstarted) type(li) operator({) key(font-weight)operator(:)value(bold)operator(;) key(color)operator(:)color(#668AA8)operator(;) key(margin-bottom)operator(:)float(1em)operator(;) key(padding-left)operator(:)float(20px)operator(;) key(list-style-type)operator(:)value(none)operator(;)operator(}) -constant(#bd) type(ol)class(.getstarted) type(li) type(p) operator({) key(color)operator(:)color(#000)operator(;) key(font-weight)operator(:)value(normal)operator(;) key(margin)operator(:)float(0) float(0) float(0) float(20px)operator(;) key(padding)operator(:)float(0) operator(}) - -comment(/*) comment(removing) -comment(#bd) comment(p) comment({margin-bottom:8px;}) -comment(*/) - -constant(#promo) operator({)key(zoom)operator(:)float(1)operator(;)key(border)operator(:) float(1px) value(solid) color(#B6CDE1)operator(;) key(padding)operator(:)float(1em)operator(;) key(position)operator(:)value(relative)operator(;) key(background-color)operator(:)color(#FFF5DF)operator(;)operator(}) -comment(/*)comment(#promo) comment(ul) comment({margin-bottom:0;})comment(*/) -constant(#promo) type(h1) operator({)key(margin-top)operator(:)float(0)operator(;) key(padding-top)operator(:)float(0)operator(}) -constant(#promo) type(h2) operator({)key(line-height)operator(:)float(1.2em)operator(;) key(color)operator(:)color(#668AA8)operator(;) key(margin-top)operator(:)float(0)operator(;) key(padding-top)operator(:)float(0)operator(;) key(border)operator(:)value(none)operator(;) key(font-size)operator(:)float(100%)operator(}) -constant(#promo) type(p) operator({)key(line-height)operator(:)float(1.2em)operator(;) key(font-weight)operator(:)float(400)operator(;)operator(}) -constant(#promo) type(h1) type(em) operator({)key(float)operator(:)value(right)operator(;) key(top)operator(:)float(0)operator(;) key(right)operator(:)float(0)operator(;) key(font-style)operator(:)value(normal)operator(;) key(font-size)operator(:)float(80%)operator(}) -constant(#promo) type(h4) operator({) key(color)operator(:)color(#E76300)operator(;) operator(}) -constant(#promo)class(.component) type(div) operator({)key(width)operator(:)float(48%)operator(;) key(float)operator(:)value(left)operator(;)operator(}) -constant(#promo)pseudo_class(:after) operator({)key(content)operator(:)stringoperator(;)key(visibility)operator(:)value(hidden)operator(;)key(clear)operator(:)value(left)operator(;)key(height)operator(:)float(0)operator(;)key(display)operator(:)value(block)operator(;)operator(}) -constant(#promo) type(p)constant(#api) operator({)key(margin-top)operator(:)float(.2em)operator(;)operator(}) -constant(#promo) constant(#download) type(img) operator({)key(float)operator(:)value(left)operator(;) key(padding)operator(:)float(0) float(0.5em) float(0.5em) float(0)operator(;)operator(}) -constant(#promo) constant(#blog) operator({)key(clear)operator(:)value(left)operator(;)operator(}) - - -type(code) operator({)key(font-family)operator(:)stringoperator(;) key(font-size)operator(:) float(100%)operator(;) key(font-weight)operator(:)value(bolder)operator(;)operator(}) - -type(div)class(.apisummary) operator({)key(height)operator(:)value(auto)operator(;) key(margin)operator(:)float(10px) float(0)operator(;) key(width)operator(:)value(auto)operator(;) key(zoom)operator(:)float(1)operator(;)operator(}) -type(div)class(.apisummary) type(table) operator({)key(font-size)operator(:)value(inherit)operator(;)key(font)operator(:)float(100%)operator(;) key(border-collapse)operator(:)value(separate)operator(;) key(border)operator(:)float(1px) value(solid) color(#666666)operator(;) key(border-left)operator(:)value(none)operator(;)operator(}) -constant(#doc3) type(div)class(.apisummary) type(table) type(td)operator(,) constant(#doc3) type(div)class(.apisummary) type(table) type(th) operator({)key(padding)operator(:)float(.35em)operator(;) key(vertical-align)operator(:)value(top)operator(;)operator(}) -type(div)class(.apisummary) type(table) type(th) operator({) key(background)operator(:)color(#B6CDE1)operator(;) key(color)operator(:)color(#fff)operator(;) key(vertical-align)operator(:)value(top)operator(;) key(font-weight)operator(:)value(bold)operator(;)operator(}) -type(div)class(.apisummary) type(table) type(td) operator({) key(border-top)operator(:)float(1px) value(solid) color(#666666)operator(;)operator(}) -type(div)class(.apisummary) type(table) type(td)operator(,) type(div)class(.apisummary) type(table) type(th) operator({) key(border-left)operator(:)float(1px) value(solid) color(#666666)operator(;)operator(}) -type(div)class(.apisummary) type(table) type(tr) operator({) key(background-color)operator(:)color(#ddd)operator(;)operator(}) -type(div)class(.apisummary) type(table) type(tr)class(.odd) operator({) key(background-color)operator(:)color(#fff)operator(;) operator(}) -type(div)class(.apisummary) type(table) type(tfoot) type(tr) operator({) key(background-color)operator(:)color(#fff)operator(;) operator(}) - -type(dl)constant(#menuwidgets) type(dt) operator({)key(font-weight)operator(:)value(bold)operator(;)operator(}) -type(dl)constant(#menuwidgets) operator({)key(margin)operator(:)float(0) float(0) float(0) float(1.5em)operator(;)operator(}) -type(img)class(.example) operator({)key(clear)operator(:)value(right)operator(;)key(margin-bottom)operator(:)float(10px)operator(;)key(margin-left)operator(:)float(10px)operator(;)key(border)operator(:)float(0)operator(;)key(float)operator(:)value(right)operator(;)key(border)operator(:)float(1px) value(solid) color(#999)operator(;)operator(}) - -comment(/*)comment(YUI) comment(theater) comment(box) comment(on) comment(main) comment(page) comment(top) comment(right) comment(corner)comment(*/) -constant(#yui-theater) operator({)key(width)operator(:)float(316px)operator(;) key(overflow)operator(:)value(hidden)operator(;)operator(}) -constant(#yui-theater) type(h3) operator({)key(margin)operator(:)float(0)operator(;) key(padding)operator(:)float(0)operator(;) key(color)operator(:)color(#E76300)operator(;) key(font-size)operator(:)float(100%)operator(;) key(font-weight)operator(:)value(bold)operator(;) key(font-stretch)operator(:)value(expanded)operator(;)operator(}) -constant(#yui-theater) type(h2) operator({)key(margin)operator(:)float(0) float(0) float(10px) float(0)operator(;) key(padding)operator(:)float(0)operator(;) key(border)operator(:)value(none)operator(;) key(color)operator(:)color(#000)operator(;) key(font-size)operator(:)float(122%)operator(;) key(font-weight)operator(:)value(bold)operator(;)operator(}) -constant(#yui-theater) type(p) operator({)key(margin)operator(:)float(7px) float(0) float(0) float(0)operator(;)operator(}) -constant(#yui-theater) type(div) operator({)key(float)operator(:)value(right)operator(;) key(font-size)operator(:)float(85%)operator(;)operator(}) - -comment(/*)comment(rss) comment(reader) comment(styles)comment(*/) -type(p)class(.loading-content) operator({)key(background-image)operator(:)stringoperator(;) key(background-position)operator(:)value(top) value(left)operator(;) key(background-repeat)operator(:)value(no-repeat)operator(;) key(height)operator(:)float(20px)operator(;)key(padding)operator(:)float(4px) float(0) float(0) float(25px)operator(;) key(margin)operator(:)float(0)operator(;)operator(}) -constant(#doc3) type(ul)class(.yuirssreader) operator({)key(margin)operator(:)float(0)operator(;) key(padding)operator(:)float(0)operator(;)operator(}) -constant(#doc3) type(ul)class(.yuirssreader) type(li) operator({)key(list-style-type)operator(:)value(none)operator(;)key(padding)operator(:)float(5px) float(0) float(0) float(12px)operator(;) key(margin)operator(:)float(0)operator(;)operator(}) -constant(#doc3) type(ul)class(.yuirssreader) type(li) type(p) operator({)key(margin)operator(:)float(0)operator(;) key(padding)operator(:)float(0)operator(;)operator(}) -type(ul)class(.yuirssreader) type(cite) operator({)key(color)operator(:)color(#666666)operator(;) key(margin)operator(:)float(0)operator(;)operator(}) -type(span)class(.yuirssreader-date) operator({)key(font-size)operator(:)float(77%)operator(;) key(color)operator(:)color(#E76300)operator(;)operator(}) -type(img)class(.rssbadge) operator({)key(display)operator(:)value(inline)operator(;)key(border)operator(:)value(none) important(!important)operator(;)operator(}) - -constant(#index-secondary) operator({)key(width)operator(:)float(316px)operator(;)key(float)operator(:)value(right)operator(;)key(margin-left)operator(:)float(10px)operator(;)operator(}) -constant(#index-main) operator({)key(margin-right)operator(:)float(331px)operator(;)operator(}) -constant(#index-main) constant(#promo) type(li) operator({)key(list-style-type)operator(:)value(none)operator(;)key(font-size)operator(:)float(92%)operator(;)key(margin-top)operator(:)float(2px)operator(;)operator(}) -constant(#index-main) constant(#promo) type(ul) operator({)key(margin)operator(:)float(0)operator(;)operator(}) - -comment(/*)comment(styles) comment(for) comment(right) comment(gutter) comment(on) comment(component) comment(pages)comment(*/) -constant(#cheatsheet) type(h3) operator({)key(margin-top)operator(:)float(0)operator(;)operator(}) -constant(#cheatsheet) type(img)operator(,) constant(#componentvideo) type(img) operator({)key(margin)operator(:)float(.5em) float(0) float(.2em) float(0)operator(;) key(border)operator(:)float(1px) value(solid) color(#999)operator(;)operator(}) -constant(#cheatsheet) type(p) operator({)key(margin)operator(:)float(0)operator(;) key(font-size)operator(:)float(77%)operator(;)operator(}) -constant(#cheatsheet) type(h4)operator(,) class(.example-container) type(h4)operator(,) constant(#examples) type(h4) operator({)key(margin)operator(:)float(0.2em) float(0) float(.1em) float(0)operator(;) key(color)operator(:)color(#668AA8)operator(;) key(font-size)operator(:)float(92%)operator(;)operator(}) -constant(#examples) type(ul)operator(,) constant(#morereading) type(ul)operator(,) constant(#module) type(ul) operator({)key(font-size)operator(:)float(85%)operator(;) key(list-style)operator(:)value(circle)operator(;) key(margin)operator(:)float(0) float(0) float(1em) float(10px)operator(;)operator(}) -constant(#examples) type(p)operator(,) constant(#componentvideo) type(p) operator({)key(font-size)operator(:)float(85%)operator(;) key(margin)operator(:)float(0) float(0) float(.2em) float(0)operator(;)operator(}) -constant(#examples) type(li)class(.selected) operator({)key(font-weight)operator(:)value(bold)operator(;)operator(}) - -comment(/*)comment(styles) comment(for) comment(example) comment(pages)comment(*/) -class(.example) class(.promo) operator({)key(background-color)operator(:)color(#89d)operator(;)key(border-color)operator(:)color(#666666)operator(;) key(padding)operator(:)float(1em)operator(;)operator(}) -class(.example) class(.promo) type(h1)operator(,) class(.example) class(.promo) type(h2)operator(,) class(.example) class(.promo) type(h3) operator({)key(color)operator(:)color(#FFCC66)operator(;)operator(}) -class(.example) class(.promo) type(h1) operator({)key(font-size)operator(:)float(159%)operator(;) key(padding-top)operator(:)float(0)operator(;) key(margin-top)operator(:)float(0)operator(;)operator(}) -class(.exampleIntro)operator(,) class(.exampleIntro) type(p)operator(,) class(.exampleIntro) type(a)operator(,) class(.exampleIntro) type(a) type(code) operator({)key(color)operator(:)color(#fff)operator(;)operator(}) -class(.example) class(.promo) type(p) operator({)key(margin-top)operator(:)float(.7em)operator(;)operator(}) -class(.firstContent) operator({)key(margin-top)operator(:)float(0)operator(;) key(padding-top)operator(:)float(0)operator(;)operator(}) -constant(#logger) operator({)key(margin-top)operator(:)float(1em)operator(;)operator(}) -class(.example-container) operator({)key(background-color)operator(:)color(#F1F6F7)operator(;)operator(}) - -class(.example-container) class(.bd) operator({)key(padding)operator(:)float(1em)operator(;) key(position)operator(:)value(relative)operator(;) key(z-index)operator(:)float(1)operator(;) key(zoom)operator(:)float(1)operator(;)operator(}) -class(.example-container) class(.bd) class(.bd) operator({)key(padding)operator(:)float(0)operator(;) key(position)operator(:)value(static)operator(;) key(_zoom)operator(:)value(normal)operator(;)operator(}) comment(/*) comment(Reset) comment(to) comment(defaults) comment(to) comment(ensure) comment(styles) comment(are) comment(only) comment(applied) comment(to) comment(the) comment(top-level) comment(.bd) comment(of) comment(.example-container) comment(*/) -class(.example-container)operator(>)class(.bd)pseudo_class(:after) operator({)key(content)operator(:)stringoperator(;)key(visibility)operator(:)value(hidden)operator(;)key(clear)operator(:)value(left)operator(;)key(height)operator(:)float(0)operator(;)key(display)operator(:)value(block)operator(;)operator(}) -class(.example-container) class(.exampleHd) operator({)key(background)operator(:) string float(0) float(0) value(repeat-x) color(#4E4D4C)operator(;) operator(}) -class(.example-container) type(h3) operator({)key(margin)operator(:)float(.2em) float(0) float(.4em) float(0)operator(;)operator(}) -class(.example) class(.example-container) type(h1)operator(,) class(.example) class(.example-container) type(h2)operator(,) class(.example) class(.example-container) type(h3)operator(,) class(.example) class(.example-container) type(h4)operator(,) class(.example) class(.example-container) type(h5)operator(,) class(.example) class(.example-container) type(h6) operator({)key(color)operator(:)color(#E76300)operator(;) key(font-weight)operator(:)value(bold)operator(;)operator(}) -class(.example-container) type(a) operator({)key(color)operator(:)color(#000)operator(;)operator(}) -class(.example-container) type(a)pseudo_class(:visited)operator(,) class(.example-container) type(a)pseudo_class(:visited) type(code) operator({)key(color)operator(:)color(#000)operator(;)operator(}) -class(.example-container) type(a)pseudo_class(:active)operator(,) class(.example-container) type(a)pseudo_class(:active) type(code) operator({)key(color)operator(:) color(#000)operator(;)operator(}) - -constant(#loggerGloss) operator({)key(margin-top)operator(:)float(.5em)operator(;) key(font-size)operator(:)float(85%)operator(;)operator(}) -constant(#loggerDiv) operator({)key(font-size)operator(:)float(77%)operator(;)key(text-align)operator(:)value(left)operator(;)key(margin-top)operator(:)float(.5em)operator(;) key(visibility)operator(:)value(hidden)operator(;) key(height)operator(:)float(280px)operator(;) operator(}) comment(/*)comment(gets) comment(turned) comment(on) comment(by) comment(script) comment(when) comment(loaded) comment(*/) -constant(#loggerDiv)class(.yui-log) operator({)key(padding)operator(:)float(.4em)operator(;)key(width)operator(:)float(96%)operator(;)key(background-color)operator(:)color(#FBE7D9)operator(;)key(border)operator(:)float(1px) value(solid) color(#666)operator(;)key(font-family)operator(:)value(monospace)operator(;)key(z-index)operator(:)float(9000)operator(;)operator(}) -constant(#loggerDiv)class(.yui-log) type(p) operator({)key(margin)operator(:)float(1px)operator(;)key(padding)operator(:)float(.1em)operator(;)operator(}) -constant(#loggerDiv)class(.yui-log) class(.yui-log-hd) operator({)key(margin)operator(:)float(0)operator(;) key(padding)operator(:)float(0)operator(;) key(background-color)operator(:)color(#CECCCC)operator(;)operator(}) -constant(#loggerDiv)class(.yui-log) class(.yui-log-hd) type(h4) operator({)key(display)operator(:)value(none)operator(;)operator(}) -constant(#loggerDiv)class(.yui-log) class(.yui-log-bd) operator({)key(width)operator(:)float(100%)operator(;)key(height)operator(:)float(20em)operator(;)key(background-color)operator(:)color(#FFF)operator(;)key(border)operator(:)float(1px) value(solid) color(#ECECEC)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(}) -constant(#loggerDiv)class(.yui-log) class(.yui-log-bd) type(pre) operator({)key(border-top)operator(:)float(1px) value(solid) color(#ECECEC)operator(;)operator(}) -constant(#loggerDiv)class(.yui-log) class(.yui-log-bd) type(code) type(p) operator({)key(margin)operator(:)float(1px) float(0)operator(;)operator(}) -constant(#loggerDiv)class(.yui-log) class(.yui-log-ft) class(.yui-log-categoryfilters) operator({)key(margin-top)operator(:)float(.5em)operator(;)key(clear)operator(:)value(right)operator(;)operator(}) -constant(#loggerDiv)class(.yui-log) class(.yui-log-ft) class(.yui-log-sourcefilters) operator({)key(margin-top)operator(:)float(.5em)operator(;)key(border)operator(:)value(none)operator(;) key(clear)operator(:)value(both)operator(;)operator(}) -constant(#loggerDiv)class(.yui-log) class(.yui-log-btns) operator({)key(margin-top)operator(:)float(.2em)operator(;)key(padding)operator(:)float(.2em)operator(;)key(background)operator(:) string float(0) float(0) value(repeat-x) color(#CECCCC)operator(;) key(text-align)operator(:)value(right)operator(;) key(float)operator(:)value(none)operator(;)operator(}) -constant(#loggerDiv)class(.yui-log) class(.yui-log-filtergrp) operator({)key(margin-right)operator(:)float(.3em)operator(;) key(float)operator(:)value(left)operator(;) key(display)operator(:)value(block)operator(}) -constant(#loggerDiv)class(.yui-log) class(.yui-log-ft) operator({)key(margin-top)operator(:)float(.3em)operator(;)key(margin-bottom)operator(:)float(.3em)operator(;) key(font-family)operator(:)value(verdana)operator(;) key(zoom)operator(:)float(1)operator(;)operator(}) -comment(/*)comment(bug) comment(in) comment(Safari) comment(when) comment(this) comment(is) comment(applied) comment(to) comment(.yui-log-ft:)comment(*/) -constant(#loggerDiv)class(.yui-log)pseudo_class(:after) operator({)key(content)operator(:)stringoperator(;)key(visibility)operator(:)value(hidden)operator(;)key(clear)operator(:)value(both)operator(;)key(height)operator(:)float(0)operator(;)key(display)operator(:)value(block)operator(;)operator(}) -class(.example-container)class(.newWindow) operator({)key(text-align)operator(:)value(center)operator(;)operator(}) -type(p)class(.newWindowButton) operator({)key(text-align)operator(:)value(right)operator(;) key(margin-top)operator(:)float(0)operator(;) key(padding)operator(:)float(.5em)operator(;)operator(}) -class(.bd) type(p)class(.newWindowButton) operator({)key(text-align)operator(:)value(center)operator(;)operator(}) comment(/*)comment(when) comment(new) comment(window) comment(is) comment(required) comment(and) comment(button) comment(appears) comment(in) comment(middle) comment(of) comment(example) comment(body)comment(*/) -type(p)class(.loggerButton) operator({)key(text-align)operator(:)value(center)operator(;)operator(}) -constant(#loggerLink) type(a)operator(,) constant(#newWindowLink) type(a) operator({)key(font-size)operator(:)float(115%)operator(;) key(font-weight)operator(:)value(bold)operator(;) key(color)operator(:)color(#000099)operator(;)operator(}) -constant(#newWindowLink) type(a) operator({)key(font-size)operator(:)float(107%)operator(;)operator(}) -constant(#loggerModule) operator({)key(padding-bottom)operator(:)float(.2em)operator(;)operator(}) - -comment(/*)comment(right) comment(column) comment(navigation) comment(on) comment(example) comment(rosters)comment(*/) -constant(#exampleToc) operator({)key(background-color)operator(:)color(#ecf5fa)operator(;) key(padding)operator(:)float(0)operator(;) key(border)operator(:)float(1px) value(solid) color(#89d)operator(;) key(margin-top)operator(:)float(.5em)operator(;)operator(}) -constant(#exampleToc) type(ul) operator({)key(list-style)operator(:)value(none)operator(;) key(margin)operator(:)float(0)operator(;) key(padding)operator(:)float(0)operator(;) key(font-size)operator(:)float(85%)operator(;) operator(}) -constant(#exampleToc) type(ul) type(li) operator({) key(padding)operator(:)float(0)operator(;) key(margin)operator(:)float(0)operator(;) operator(}) -constant(#exampleToc) type(ul) type(li)class(.selected) operator({) key(font-weight)operator(:)value(bold)operator(;) key(color)operator(:)color(#fff)operator(;) key(background)operator(:)color(#000099)operator(;) key(padding)operator(:)float(0)operator(;) operator(}) -constant(#exampleToc) type(ul) type(li)class(.selected) type(a) operator({) key(color)operator(:)color(#fff)operator(;) operator(}) -constant(#exampleToc) type(ul) type(li) type(a) operator({) key(display)operator(:)value(block)operator(;) key(padding)operator(:)float(2px) float(2px) float(2px) float(10px)operator(;) key(text-decoration)operator(:)value(none)operator(;) operator(}) -constant(#exampleToc) type(ul) type(li) type(a)pseudo_class(:hover) operator({) key(color)operator(:)color(#fff)operator(;) key(background)operator(:)color(#e60)operator(;) operator(}) - -comment(/*)comment(theater) comment(page) comment(styles)comment(*/) -class(.theater) type(h1) operator({)key(border-bottom)operator(:)float(1px) value(dashed) color(#CCC)operator(;) key(margin-bottom)operator(:)float(1em)operator(;)key(padding-bottom)operator(:)float(.2em)operator(;)operator(}) -class(.theater) type(img) operator({)key(border)operator(:)float(1px) value(solid) color(#666)operator(;)operator(}) -class(.theater) type(img)class(.last) operator({)key(border)operator(:)float(1px) value(solid) color(#666)operator(;)operator(}) -class(.theater) type(p)class(.details) operator({)key(font-size)operator(:)float(77%)operator(;) key(color)operator(:)color(#666)operator(;) key(margin)operator(:)float(.2em) float(0) float(0) float(0)operator(;) key(padding)operator(:)float(0)operator(;)operator(}) -class(.theater) type(p)class(.description)operator(,) constant(#doc3) class(.theater) type(ul) type(li) operator({)key(font-size)operator(:)float(85%)operator(;) key(margin)operator(:)float(0)operator(;) key(padding)operator(:)float(0)operator(;) key(color)operator(:)color(#333)operator(;)operator(}) - -constant(#readmePanel) class(.hd) operator({) key(font-weight)operator(:)value(bold)operator(;) key(font-size)operator(:)float(129%)operator(;) key(color)operator(:)color(#fff)operator(;) key(background)operator(:)color(#89d)operator(;) operator(}) -constant(#readmePanel) class(.bd) operator({)key(text-align)operator(:)value(left)operator(;) key(overflow)operator(:)value(auto)operator(;)operator(}) -constant(#readmePanel) class(.ft) operator({)key(text-align)operator(:)value(right)operator(;) key(background-color)operator(:)color(#E7E7E7)operator(;) key(font-size)operator(:)float(85%)operator(;)operator(}) -comment(/*) comment(Browser) comment(specific) comment((not) comment(valid\)) comment(styles) comment(to) comment(make) comment(preformatted) comment(text) comment(wrap) comment(*/) -constant(#readmePanel) class(.bd) type(pre) operator({) - key(white-space)operator(:) value(pre-wrap)operator(;) comment(/*) comment(css-3) comment(*/) - key(white-space)operator(:) value(-moz-pre-wrap)operator(;) comment(/*) comment(Mozilla,) comment(since) comment(1999) comment(*/) - key(white-space)operator(:) value(-pre-wrap)operator(;) comment(/*) comment(Opera) comment(4-6) comment(*/) - key(white-space)operator(:) value(-o-pre-wrap)operator(;) comment(/*) comment(Opera) comment(7) comment(*/) - key(word-wrap)operator(:) value(break-word)operator(;) comment(/*) comment(Internet) comment(Explorer) comment(5.5+) comment(*/) - key(font-size)operator(:) float(100%)operator(;) - key(color)operator(:)color(#000033)operator(;)operator(}) - -comment(/*)comment(ed) comment(eliot's) comment(server-side) comment(delicious) comment(badge) comment(css)comment(*/) - constant(#delicious-badge) operator({)key(margin-top)operator(:)float(.6em)operator(;) key(font)operator(:) float(85%) value(Arial)operator(,) value(sans-serif)operator(;) key(border)operator(:) float(1px) value(solid) color(#b1b1b1)operator(;) operator(}) -constant(#delicious-badge) class(.bookmark) operator({) key(background)operator(:) string value(no-repeat) value(left) value(center)operator(;) key(padding-left)operator(:) float(15px)operator(;) key(font-weight)operator(:) value(bold)operator(;) operator(}) -constant(#delicious-badge) type(p)operator(,) constant(#delicious-badge) type(div) operator({) key(padding)operator(:) float(7px)operator(;) key(margin)operator(:) float(0)operator(;) key(text-align)operator(:) value(center)operator(;) operator(}) -constant(#delicious-badge) type(a) operator({) key(color)operator(:) color(#00f)operator(;) key(text-decoration)operator(:) value(none)operator(;) operator(}) -constant(#delicious-badge) type(div) operator({) key(background)operator(:) color(#eee)operator(;) operator(}) -constant(#delicious-badge) type(div) type(span) operator({) key(font-weight)operator(:) value(bold)operator(;) key(color)operator(:) color(#000)operator(;) operator(}) -constant(#delicious-badge) type(ul)operator(,) constant(#delicious-badge) type(li) operator({) key(display)operator(:) value(inline)operator(;) key(list-style)operator(:) value(none)operator(;) key(padding)operator(:) float(0)operator(;) key(margin)operator(:) float(0)operator(;) operator(}) -constant(#delicious-badge) type(li) operator({) key(margin-left)operator(:) float(5px)operator(;) operator(}) -constant(#delicious-badge) type(li) type(span) operator({) key(position)operator(:) value(absolute)operator(;) key(left)operator(:) float(-999px)operator(;) key(width)operator(:) float(999px)operator(;) operator(}) -constant(#delicious-badge) class(.saved-by) operator({) key(color)operator(:) color(#999)operator(;) operator(}) -constant(#delicious-badge) class(.saved-by) type(span) operator({) key(background)operator(:) color(#00f)operator(;) key(padding)operator(:) float(3px)operator(;) key(color)operator(:) color(#fff)operator(;) operator(}) -constant(#delicious-badge) class(.be-first) operator({) key(font-size)operator(:) float(85%)operator(;) key(color)operator(:) color(#999)operator(;) operator(}) -constant(#delicious-badge) class(.tag-size-1) operator({) key(font-size)operator(:) float(100%)operator(;) operator(}) -constant(#delicious-badge) class(.tag-size-2) operator({) key(font-size)operator(:) float(107%)operator(;) operator(}) -constant(#delicious-badge) class(.tag-size-3) operator({) key(font-size)operator(:) float(114%)operator(;) operator(}) -constant(#delicious-badge) class(.tag-size-4) operator({) key(font-size)operator(:) float(122%)operator(;) operator(}) -constant(#delicious-badge) class(.tag-size-5) operator({) key(font-size)operator(:) float(129%)operator(;) operator(}) - -comment(/*)comment(faq) comment(page:)comment(*/) -class(.yui-ge) class(.yui-g) operator({)key(width)operator(:)float(98%)operator(;)operator(}) -class(.yui-ge) class(.yui-g) class(.yui-u) operator({)key(width)operator(:)float(48.1%)operator(;)operator(}) -constant(#questions) operator({)key(margin)operator(:)float(1em) float(0) float(2em) float(0)operator(;) key(padding)operator(:)float(0.5em)operator(;) key(border)operator(:)float(1px) value(solid) color(#838383)operator(;) key(background-color)operator(:)color(#E6E6E6)operator(;)operator(}) -constant(#questions) type(ul) operator({)key(margin)operator(:)float(0)operator(;) key(list-style)operator(:)value(none)operator(;)operator(}) -constant(#yui-main) constant(#questions) type(li) operator({)key(padding-bottom)operator(:)float(.2em)operator(;) key(font-size)operator(:)float(85%)operator(;) key(margin)operator(:)float(0)operator(;)operator(}) -constant(#questions) type(li) type(a) operator({)key(display)operator(:)value(block)operator(;) key(padding)operator(:)float(.6em)operator(;) key(text-decoration)operator(:)value(none)operator(;)operator(}) -constant(#questions) type(li) type(a)pseudo_class(:hover) operator({)key(background-color)operator(:)color(#F6F6F6)operator(;)operator(}) - -comment(/*)comment(for) comment(notes) comment(on) comment(file) comment(includes)comment(*/) -class(.include-notice) operator({)key(border)operator(:)float(1px) value(solid) color(#6F7EA1)operator(;) key(background)operator(:)color(#eee)operator(;) key(font)operator(:)float(77%) value(verdana)operator(;) key(padding)operator(:)float(.7em)operator(;)operator(}) -class(.include-notice) type(strong) operator({)key(color)operator(:)color(#990000)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-skin-sam) class(.yui-ac)operator({)key(position)operator(:)value(relative)operator(;)key(font-family)operator(:)value(arial)operator(;)key(font-size)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-input)operator({)key(position)operator(:)value(absolute)operator(;)key(width)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-container)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(1.6em)operator(;)key(width)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content)operator({)key(position)operator(:)value(absolute)operator(;)key(width)operator(:)float(100%)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(background)operator(:)color(#fff)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(z-index)operator(:)float(9050)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-shadow)operator({)key(position)operator(:)value(absolute)operator(;)key(margin)operator(:)float(.3em)operator(;)key(width)operator(:)float(100%)operator(;)key(background)operator(:)color(#000)operator(;)key(-moz-opacity)operator(:)float(0)float(.10)operator(;)key(opacity)operator(:)float(.10)operator(;)key(filter)operator(:)stringoperator(;)key(z-index)operator(:)float(9049)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(ul)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(width)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(2px) float(5px)operator(;)key(cursor)operator(:)value(default)operator(;)key(white-space)operator(:)value(nowrap)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(li)class(.yui-ac-prehighlight)operator({)key(background)operator(:)color(#B3D4FF)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(li)class(.yui-ac-highlight)operator({)key(background)operator(:)color(#426FD9)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-skin-sam) class(.yui-button)operator({)key(display)operator(:)value(-moz-inline-box)operator(;)key(display)operator(:)value(inline-block)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) class(.first-child)operator({)key(display)operator(:)value(block)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(button)operator(,)class(.yui-skin-sam) class(.yui-button) type(a)operator({)key(display)operator(:)value(block)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(button)operator({)key(background-color)operator(:)value(transparent)operator(;)error(*)key(overflow)operator(:)value(visible)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(a)operator({)key(text-decoration)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-button)operator({)key(border-width)operator(:)float(1px) float(0)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(margin)operator(:)value(auto) float(.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) class(.first-child)operator({)key(border-width)operator(:)float(0) float(1px)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(margin)operator(:)float(0) float(-1px)operator(;)error(*)key(position)operator(:)value(relative)operator(;)error(*)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(button)operator(,)class(.yui-skin-sam) class(.yui-button) type(a)operator({)key(padding)operator(:)float(0) float(10px)operator(;)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(2)operator(;)error(*)key(line-height)operator(:)float(1)float(.7)operator(;)key(min-height)operator(:)float(2em)operator(;)error(*)key(min-height)operator(:)value(auto)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button) type(button)operator(,)class(.yui-skin-sam) class(.yui-menu-button) type(button)operator({)key(padding-right)operator(:)float(20px)operator(;)key(background-position)operator(:)value(right) value(center)operator(;)key(background-repeat)operator(:)value(no-repeat)operator(;)operator(})class(.yui-skin-sam) class(.yui-menu-button) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-split-button) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-button-focus)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)key(background-position)operator(:)float(0) float(-1300px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-focus) class(.first-child)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-focus) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-focus) type(a)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-focus) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-button-hover)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)key(background-position)operator(:)float(0) float(-1300px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-hover) class(.first-child)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-hover) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-hover) type(a)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-hover) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-button-active)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)key(background-position)operator(:)float(0) float(-1700px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-active) class(.first-child)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-active) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-active) type(a)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-activeoption)operator({)key(border-color)operator(:)color(#808080)operator(;)key(background-position)operator(:)float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-activeoption) class(.first-child)operator({)key(border-color)operator(:)color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-activeoption) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-radio-button-checked)operator(,)class(.yui-skin-sam) class(.yui-checkbox-button-checked)operator({)key(border-color)operator(:)color(#304369)operator(;)key(background-position)operator(:)float(0) float(-1400px)operator(;)operator(})class(.yui-skin-sam) class(.yui-radio-button-checked) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-checkbox-button-checked) class(.first-child)operator({)key(border-color)operator(:)color(#304369)operator(;)operator(})class(.yui-skin-sam) class(.yui-radio-button-checked) type(button)operator(,)class(.yui-skin-sam) class(.yui-checkbox-button-checked) type(button)operator({)key(color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-disabled)operator({)key(border-color)operator(:)color(#ccc)operator(;)key(background-position)operator(:)float(0) float(-1500px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-disabled) class(.first-child)operator({)key(border-color)operator(:)color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-disabled) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-disabled) type(a)operator({)key(color)operator(:)color(#A6A6A6)operator(;)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-skin-sam) class(.yui-menu-button-disabled) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-disabled) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-calcontainer)operator({)key(position)operator(:)value(relative)operator(;)key(float)operator(:)value(left)operator(;)key(_overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-calcontainer) type(iframe)operator({)key(position)operator(:)value(absolute)operator(;)key(border)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(z-index)operator(:)float(0)operator(;)key(width)operator(:)float(100%)operator(;)key(height)operator(:)float(100%)operator(;)key(left)operator(:)float(0px)operator(;)key(top)operator(:)float(0px)operator(;)operator(})class(.yui-calcontainer) type(iframe)class(.fixedsize)operator({)key(width)operator(:)float(50em)operator(;)key(height)operator(:)float(50em)operator(;)key(top)operator(:)float(-1px)operator(;)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-calcontainer)class(.multi) class(.groupcal)operator({)key(z-index)operator(:)float(1)operator(;)key(float)operator(:)value(left)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-calcontainer) class(.title)operator({)key(position)operator(:)value(relative)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calcontainer) class(.close-icon)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calendar)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-calendar) class(.calnavleft)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calendar) class(.calnavright)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calendar) class(.calheader)operator({)key(position)operator(:)value(relative)operator(;)key(width)operator(:)float(100%)operator(;)key(text-align)operator(:)value(center)operator(;)operator(})class(.yui-calendar) class(.calbody) type(a)pseudo_class(:hover)operator({)key(background)operator(:)value(inherit)operator(;)operator(})type(p)constant(#clear)operator({)key(clear)operator(:)value(left)operator(;)key(padding-top)operator(:)float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)operator({)key(background-color)operator(:)color(#f2f2f2)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(padding)operator(:)float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.multi)operator({)key(padding)operator(:)float(0) float(5px) float(0) float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.multi) class(.groupcal)operator({)key(background-color)operator(:)value(transparent)operator(;)key(border)operator(:)value(none)operator(;)key(padding)operator(:)float(10px) float(5px) float(10px) float(5px)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer) class(.title)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(border-bottom)operator(:)float(1px) value(solid) color(#cccccc)operator(;)key(font)operator(:)float(100%) value(sans-serif)operator(;)key(color)operator(:)color(#000)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(height)operator(:)value(auto)operator(;)key(padding)operator(:)float(.4em)operator(;)key(margin)operator(:)float(0) float(-10px) float(10px) float(-10px)operator(;)key(top)operator(:)float(0)operator(;)key(left)operator(:)float(0)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.multi) class(.title)operator({)key(margin)operator(:)float(0) float(-5px) float(0) float(-5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.withtitle)operator({)key(padding-top)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer) class(.calclose)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-300px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(top)operator(:)float(.4em)operator(;)key(right)operator(:)float(.4em)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar)operator({)key(border-spacing)operator(:)float(0)operator(;)key(border-collapse)operator(:)value(collapse)operator(;)key(font)operator(:)float(100%) value(sans-serif)operator(;)key(text-align)operator(:)value(center)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calhead)operator({)key(background)operator(:)value(transparent)operator(;)key(border)operator(:)value(none)operator(;)key(vertical-align)operator(:)value(middle)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calheader)operator({)key(background)operator(:)value(transparent)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(padding)operator(:)float(0) float(0) float(.6em) float(0)operator(;)key(text-align)operator(:)value(center)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calheader) type(img)operator({)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calnavleft)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-450px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(top)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(left)operator(:)float(-10px)operator(;)key(margin-left)operator(:)float(.4em)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calnavright)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-500px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(top)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(right)operator(:)float(-10px)operator(;)key(margin-right)operator(:)float(.4em)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calweekdayrow)operator({)key(height)operator(:)float(2em)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calweekdaycell)operator({)key(color)operator(:)color(#000)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(text-align)operator(:)value(center)operator(;)key(width)operator(:)float(2em)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calfoot)operator({)key(background-color)operator(:)color(#f2f2f2)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calrowhead)operator(,)class(.yui-skin-sam) class(.yui-calendar) class(.calrowfoot)operator({)key(color)operator(:)color(#a6a6a6)operator(;)key(font-size)operator(:)float(85%)operator(;)key(font-style)operator(:)value(normal)operator(;)key(font-weight)operator(:)value(normal)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calrowhead)operator({)key(text-align)operator(:)value(right)operator(;)key(padding-right)operator(:)float(2px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calrowfoot)operator({)key(text-align)operator(:)value(left)operator(;)key(padding-left)operator(:)float(2px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)operator({)key(border)operator(:)float(1px) value(solid) color(#cccccc)operator(;)key(background)operator(:)color(#fff)operator(;)key(padding)operator(:)float(1px)operator(;)key(height)operator(:)float(1.6em)operator(;)key(line-height)operator(:)float(1.6em)operator(;)key(text-align)operator(:)value(center)operator(;)key(white-space)operator(:)value(nowrap)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell) type(a)operator({)key(color)operator(:)color(#0066cc)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(100%)operator(;)key(text-decoration)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.today)operator({)key(background-color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.today) type(a)operator({)key(background-color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.oom)operator({)key(background-color)operator(:)color(#cccccc)operator(;)key(color)operator(:)color(#a6a6a6)operator(;)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.selected)operator({)key(background-color)operator(:)color(#fff)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.selected) type(a)operator({)key(background-color)operator(:)color(#b3d4ff)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.calcellhover)operator({)key(background-color)operator(:)color(#426fd9)operator(;)key(color)operator(:)color(#fff)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.calcellhover) type(a)operator({)key(background-color)operator(:)color(#426fd9)operator(;)key(color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.previous)operator({)key(color)operator(:)color(#e0e0e0)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.restricted)operator({)key(text-decoration)operator(:)value(line-through)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight1)operator({)key(background-color)operator(:)color(#ccff99)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight2)operator({)key(background-color)operator(:)color(#99ccff)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight3)operator({)key(background-color)operator(:)color(#ffcccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight4)operator({)key(background-color)operator(:)color(#ccff99)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-picker-panel)operator({)key(background)operator(:)color(#e3e3e3)operator(;)key(border-color)operator(:)color(#888)operator(;)operator(})class(.yui-picker-panel) class(.hd)operator({)key(background-color)operator(:)color(#ccc)operator(;)key(font-size)operator(:)float(100%)operator(;)key(line-height)operator(:)float(100%)operator(;)key(border)operator(:)float(1px) value(solid) color(#e3e3e3)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(padding)operator(:)float(6px)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-picker-panel) class(.bd)operator({)key(background)operator(:)color(#e8e8e8)operator(;)key(margin)operator(:)float(1px)operator(;)key(height)operator(:)float(200px)operator(;)operator(})class(.yui-picker-panel) class(.ft)operator({)key(background)operator(:)color(#e8e8e8)operator(;)key(margin)operator(:)float(1px)operator(;)key(padding)operator(:)float(1px)operator(;)operator(})class(.yui-picker)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-picker-hue-thumb)operator({)key(cursor)operator(:)value(default)operator(;)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(18px)operator(;)key(top)operator(:)float(-8px)operator(;)key(left)operator(:)float(-2px)operator(;)key(z-index)operator(:)float(9)operator(;)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-picker-hue-bg)operator({)key(-moz-outline)operator(:)value(none)operator(;)key(outline)operator(:)float(0px) value(none)operator(;)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(200px)operator(;)key(height)operator(:)float(183px)operator(;)key(width)operator(:)float(14px)operator(;)key(background)operator(:)string value(no-repeat)operator(;)key(top)operator(:)float(4px)operator(;)operator(})class(.yui-picker-bg)operator({)key(-moz-outline)operator(:)value(none)operator(;)key(outline)operator(:)float(0px) value(none)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(4px)operator(;)key(left)operator(:)float(4px)operator(;)key(height)operator(:)float(182px)operator(;)key(width)operator(:)float(182px)operator(;)key(background-color)operator(:)color(#F00)operator(;)key(background-image)operator(:)stringoperator(;)operator(})type(*)type(html) class(.yui-picker-bg)operator({)key(background-image)operator(:)value(none)operator(;)key(filter)operator(:)value(progid)operator(:)value(DXImageTransform)operator(.)value(Microsoft)operator(.)error(A)error(l)error(p)error(h)error(a)error(I)error(m)error(a)error(g)error(e)error(L)error(o)error(a)error(d)error(e)error(r)operator(()value(src)operator(=)stringoperator(,)value(sizingMethod)operator(=)stringoperator(\))operator(;)operator(})class(.yui-picker-mask)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)key(top)operator(:)float(0px)operator(;)key(left)operator(:)float(0px)operator(;)operator(})class(.yui-picker-thumb)operator({)key(cursor)operator(:)value(default)operator(;)key(width)operator(:)float(11px)operator(;)key(height)operator(:)float(11px)operator(;)key(z-index)operator(:)float(9)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(-4px)operator(;)key(left)operator(:)float(-4px)operator(;)operator(})class(.yui-picker-swatch)operator({)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(240px)operator(;)key(top)operator(:)float(4px)operator(;)key(height)operator(:)float(60px)operator(;)key(width)operator(:)float(55px)operator(;)key(border)operator(:)float(1px) value(solid) color(#888)operator(;)operator(})class(.yui-picker-websafe-swatch)operator({)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(304px)operator(;)key(top)operator(:)float(4px)operator(;)key(height)operator(:)float(24px)operator(;)key(width)operator(:)float(24px)operator(;)key(border)operator(:)float(1px) value(solid) color(#888)operator(;)operator(})class(.yui-picker-controls)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(72px)operator(;)key(left)operator(:)float(226px)operator(;)key(font)operator(:)float(1em) value(monospace)operator(;)operator(})class(.yui-picker-controls) class(.hd)operator({)key(background)operator(:)value(transparent)operator(;)key(border-width)operator(:)float(0px) important(!important)operator(;)operator(})class(.yui-picker-controls) class(.bd)operator({)key(height)operator(:)float(100px)operator(;)key(border-width)operator(:)float(0px) important(!important)operator(;)operator(})class(.yui-picker-controls) type(ul)operator({)key(float)operator(:)value(left)operator(;)key(list-style)operator(:)value(none)operator(;)key(padding)operator(:)float(0) float(2px) float(0) float(0)operator(;)key(margin)operator(:)float(0)operator(})class(.yui-picker-controls) type(li)operator({)key(padding)operator(:)float(2px)operator(;)key(margin)operator(:)float(0)operator(})class(.yui-picker-controls) type(input)operator({)key(font-size)operator(:)float(0.85em)operator(;)key(width)operator(:)float(2.4em)operator(;)operator(})class(.yui-picker-hex-controls)operator({)key(clear)operator(:)value(both)operator(;)key(padding)operator(:)float(2px)operator(;)operator(})class(.yui-picker-hex-controls) type(input)operator({)key(width)operator(:)float(4.6em)operator(;)operator(})class(.yui-picker-controls) type(a)operator({)key(font)operator(:)float(1em) value(arial)operator(,)value(helvetica)operator(,)value(clean)operator(,)value(sans-serif)operator(;)key(display)operator(:)value(block)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)key(padding)operator(:)float(0)operator(;)key(color)operator(:)color(#000)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-overlay)operator(,)class(.yui-panel-container)operator({)key(visibility)operator(:)value(hidden)operator(;)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(2)operator(;)operator(})class(.yui-panel-container) type(form)operator({)key(margin)operator(:)float(0)operator(;)operator(})class(.mask)operator({)key(z-index)operator(:)float(1)operator(;)key(display)operator(:)value(none)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(0)operator(;)key(left)operator(:)float(0)operator(;)key(right)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-panel-container) type(select)operator({)key(_visibility)operator(:)value(inherit)operator(;)operator(})class(.masked) type(select)operator(,)class(.drag) type(select)operator(,)class(.hide-select) type(select)operator({)key(_visibility)operator(:)value(hidden)operator(;)operator(})class(.hide-scrollbars)operator(,)class(.hide-scrollbars) type(*)operator({)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.hide-scrollbars) type(select)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.show-scrollbars)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-panel-container)class(.show-scrollbars)operator(,)class(.yui-tt)class(.show-scrollbars)operator({)key(overflow)operator(:)value(visible)operator(;)operator(})class(.yui-panel-container)class(.show-scrollbars) class(.underlay)operator(,)class(.yui-tt)class(.show-scrollbars) class(.yui-tt-shadow)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-tt-shadow)operator({)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-skin-sam) class(.mask)operator({)key(background-color)operator(:)color(#000)operator(;)key(opacity)operator(:)float(.25)operator(;)error(*)key(filter)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)operator({)key(padding)operator(:)float(0) float(1px)operator(;)error(*)key(padding)operator(:)float(2px) float(3px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel)operator({)key(position)operator(:)value(relative)operator(;)error(*)key(zoom)operator(:)float(1)operator(;)key(left)operator(:)float(0)operator(;)key(top)operator(:)float(0)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(1px) float(0)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.hd)operator(,)class(.yui-skin-sam) class(.yui-panel) class(.bd)operator(,)class(.yui-skin-sam) class(.yui-panel) class(.ft)operator({)error(*)key(zoom)operator(:)float(1)operator(;)error(*)key(position)operator(:)value(relative)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(0) float(1px)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(margin)operator(:)float(0) float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.hd)operator({)key(border-bottom)operator(:)value(solid) float(1px) color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.bd)operator(,)class(.yui-skin-sam) class(.yui-panel) class(.ft)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.hd)operator({)key(padding)operator(:)float(0) float(10px)operator(;)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(2)operator(;)error(*)key(line-height)operator(:)float(1)float(.9)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(color)operator(:)color(#000)operator(;)key(background)operator(:)string value(repeat-x) float(0) float(-200px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.bd)operator({)key(padding)operator(:)float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.ft)operator({)key(border-top)operator(:)value(solid) float(1px) color(#808080)operator(;)key(padding)operator(:)float(5px) float(10px)operator(;)key(font-size)operator(:)float(77%)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.focused) class(.yui-panel) class(.hd)operator({)operator(})class(.yui-skin-sam) class(.container-close)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(5px)operator(;)key(right)operator(:)float(6px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(background)operator(:)string value(no-repeat) float(0) float(-300px)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container) class(.underlay)operator({)key(right)operator(:)float(-1px)operator(;)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.matte)operator({)key(padding)operator(:)float(9px) float(10px)operator(;)key(background-color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.shadow)operator({)key(_padding)operator(:)float(2px) float(5px) float(0) float(3px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.shadow) class(.underlay)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(2px)operator(;)key(right)operator(:)float(-3px)operator(;)key(bottom)operator(:)float(-3px)operator(;)key(left)operator(:)float(-3px)operator(;)error(*)key(top)operator(:)float(3px)operator(;)error(*)key(left)operator(:)float(-1px)operator(;)error(*)key(right)operator(:)float(-1px)operator(;)error(*)key(bottom)operator(:)float(-1px)operator(;)key(_top)operator(:)float(0)operator(;)key(_right)operator(:)float(0)operator(;)key(_bottom)operator(:)float(0)operator(;)key(_left)operator(:)float(0)operator(;)key(_margin-top)operator(:)float(3px)operator(;)key(_margin-left)operator(:)float(-1px)operator(;)key(background-color)operator(:)color(#000)operator(;)key(opacity)operator(:)float(.12)operator(;)error(*)key(filter)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft)operator({)key(border-top)operator(:)value(none)operator(;)key(padding)operator(:)float(0) float(10px) float(10px) float(10px)operator(;)key(font-size)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.button-group)operator({)key(display)operator(:)value(block)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default)operator({)key(border-color)operator(:)color(#304369)operator(;)key(background-position)operator(:)float(0) float(-1400px)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default) class(.first-child)operator({)key(border-color)operator(:)color(#304369)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default) type(button)operator({)key(color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) class(.yui-icon)operator({)key(background)operator(:)string value(no-repeat) float(0) float(0)operator(;)key(width)operator(:)float(16px)operator(;)key(height)operator(:)float(16px)operator(;)key(margin-right)operator(:)float(10px)operator(;)key(float)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.blckicon)operator({)key(background-position)operator(:)float(0) float(-1100px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.alrticon)operator({)key(background-position)operator(:)float(0) float(-1050px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.hlpicon)operator({)key(background-position)operator(:)float(0) float(-1150px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.infoicon)operator({)key(background-position)operator(:)float(0) float(-1200px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.warnicon)operator({)key(background-position)operator(:)float(0) float(-1900px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.tipicon)operator({)key(background-position)operator(:)float(0) float(-1250px)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt) class(.bd)operator({)key(position)operator(:)value(relative)operator(;)key(top)operator(:)float(0)operator(;)key(left)operator(:)float(0)operator(;)key(z-index)operator(:)float(1)operator(;)key(color)operator(:)color(#000)operator(;)key(padding)operator(:)float(2px) float(5px)operator(;)key(border-color)operator(:)color(#D4C237) color(#A6982B) color(#A6982B) color(#A6982B)operator(;)key(border-width)operator(:)float(1px)operator(;)key(border-style)operator(:)value(solid)operator(;)key(background-color)operator(:)color(#FFEE69)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt)class(.show-scrollbars) class(.bd)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt-shadow)operator({)key(top)operator(:)float(2px)operator(;)key(right)operator(:)float(-3px)operator(;)key(left)operator(:)float(-3px)operator(;)key(bottom)operator(:)float(-3px)operator(;)key(background-color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt-shadow-visible)operator({)key(opacity)operator(:)float(.12)operator(;)error(*)key(filter)operator(:)stringoperator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -type(table)class(.yui-dt-table)operator({)key(table-layout)operator(:)value(fixed)operator(;)operator(})type(th) class(.yui-dt-header)operator({)key(position)operator(:)value(relative)operator(;)operator(})type(th) class(.yui-dt-label)operator({)key(position)operator(:)value(relative)operator(;)operator(})type(th) class(.yui-dt-resizer)operator({)key(position)operator(:)value(absolute)operator(;)key(margin-right)operator(:)float(-6px)operator(;)key(right)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(width)operator(:)float(6px)operator(;)key(height)operator(:)float(100%)operator(;)key(cursor)operator(:)value(w-resize)operator(;)key(cursor)operator(:)value(col-resize)operator(;)operator(})class(.yui-dt-scrollable)operator({)error(*)key(overflow-y)operator(:)value(auto)operator(;)operator(})class(.yui-dt-scrollable) type(thead)operator({)key(display)operator(:)value(block)operator(;)operator(})class(.yui-dt-scrollable) type(thead) type(tr)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-dt-scrollbody)operator({)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-dt-editor)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(9000)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-family)operator(:)value(arial)operator(;)key(font-size)operator(:)value(inherit)operator(;)key(border-collapse)operator(:)value(collapse)operator(;)key(border)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(caption)operator({)key(padding-bottom)operator(:)float(1em)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)operator(,)class(.yui-skin-sam) class(.yui-dt-table) type(th) type(a)operator({)key(font-weight)operator(:)value(normal)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(color)operator(:)color(#000)operator(;)key(vertical-align)operator(:)value(bottom)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)operator(,)class(.yui-skin-sam) class(.yui-dt-table) type(td)operator({)key(padding)operator(:)float(4px) float(10px) float(4px) float(10px)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#CBCBCB)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(td)operator({)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)class(.yui-dt-last)operator(,)class(.yui-skin-sam) class(.yui-dt-table) type(td)class(.yui-dt-last)operator({)key(border-right)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(td)operator({)key(border-right)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(thead)operator({)key(border)operator(:)float(1px) value(solid) color(#989898)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(tbody)operator({)key(border-left)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)key(border-bottom)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-loading)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-loading)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-sortable)operator({)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-sortable)operator({)key(padding-right)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-sortable) class(.yui-dt-label)operator({)key(margin-right)operator(:)float(15px)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(th)class(.yui-dt-desc)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-100px)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-asc) class(.yui-dt-header)operator({)key(background)operator(:)string value(no-repeat) value(right)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-desc) class(.yui-dt-header)operator({)key(background)operator(:)string value(no-repeat) value(right)operator(;)operator(})class(.yui-dt-editable)operator({)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-dt-editor)operator({)key(text-align)operator(:)value(left)operator(;)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(padding)operator(:)float(6px)operator(;)operator(})class(.yui-dt-editor) type(label)operator({)key(padding-left)operator(:)float(4px)operator(;)key(padding-right)operator(:)float(6px)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button)operator({)key(padding-top)operator(:)float(6px)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(border)operator(:)float(1px) value(solid) color(#999)operator(;)key(width)operator(:)float(4em)operator(;)key(height)operator(:)float(1.8em)operator(;)key(margin-left)operator(:)float(6px)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)class(.yui-dt-default)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1400px)operator(;)key(background-color)operator(:)color(#5584E0)operator(;)key(border)operator(:)float(1px) value(solid) color(#304369)operator(;)key(color)operator(:)color(#FFF)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)pseudo_class(:hover)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1300px)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)pseudo_class(:active)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1700px)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-even)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-odd)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#DBEAFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-desc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-highlighted)operator({)key(cursor)operator(:)value(pointer)operator(;)key(background-color)operator(:)color(#B2D2FF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-desc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-highlighted)operator({)key(cursor)operator(:)value(pointer)operator(;)key(background-color)operator(:)color(#B2D2FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#426FD9)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-selected)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-selected)operator({)key(background-color)operator(:)color(#446CD7)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#426FD9)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-selected)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-selected)operator({)key(background-color)operator(:)color(#446CD7)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator)operator({)key(display)operator(:)value(block)operator(;)key(margin)operator(:)float(6px) float(0)operator(;)key(white-space)operator(:)value(nowrap)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-first)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-last)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-selected)operator({)key(padding)operator(:)float(2px) float(6px)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator) type(a)class(.yui-dt-first)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) type(a)class(.yui-dt-last)operator({)key(text-decoration)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-previous)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-next)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) type(a)class(.yui-dt-page)operator({)key(border)operator(:)float(1px) value(solid) color(#CBCBCB)operator(;)key(padding)operator(:)float(2px) float(6px)operator(;)key(text-decoration)operator(:)value(none)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-busy)operator({)key(cursor)operator(:)value(wait) important(!important)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-subcont)operator({)key(padding)operator(:)float(.25em) float(0)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-container-collapsed) class(.yui-toolbar-subcont)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-subcont)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) type(span)class(.yui-toolbar-draghandle)operator({)key(cursor)operator(:)value(move)operator(;)key(border-left)operator(:)float(1px) value(solid) color(#999)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#999)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(text-indent)operator(:)float(77777px)operator(;)key(width)operator(:)float(2px)operator(;)key(height)operator(:)float(20px)operator(;)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(none)operator(;)key(float)operator(:)value(left)operator(;)key(margin)operator(:)float(0) float(0) float(0) float(.2em)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-titlebar)class(.draggable)operator({)key(cursor)operator(:)value(move)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-titlebar)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(h2)operator({)key(font-weight)operator(:)value(bold)operator(;)key(letter-spacing)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(color)operator(:)color(#000)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(.2em)operator(;)operator(})class(.yui-toolbar-container)class(.yui-toolbar-grouped) type(span)class(.yui-toolbar-draghandle)operator({)key(height)operator(:)float(40px)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-group)operator({)key(float)operator(:)value(left)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-group)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-group) type(h3)operator({)key(font-size)operator(:)float(75%)operator(;)key(padding)operator(:)float(0) float(0) float(0) float(.25em)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator)operator({)key(width)operator(:)float(2px)operator(;)key(height)operator(:)float(18px)operator(;)key(margin)operator(:)float(.2em) float(0) float(.2em) float(.1em)operator(;)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(none)operator(;)key(float)operator(:)value(left)operator(;)operator(})class(.yui-toolbar-container)class(.yui-toolbar-grouped) type(span)class(.yui-toolbar-separator)operator({)key(height)operator(:)float(35px)operator(;)operator(})class(.yui-toolbar-container)class(.yui-toolbar-grouped) class(.yui-toolbar-group) type(span)class(.yui-toolbar-separator)operator({)key(height)operator(:)float(18px)operator(;)operator(})class(.yui-toolbar-container) type(ul) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(list-style-type)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) type(h3)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container) class(.yui-push-button)operator(,)class(.yui-toolbar-container) class(.yui-color-button)operator(,)class(.yui-toolbar-container) class(.yui-menu-button)operator({)key(position)operator(:)value(relative)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-toolbar-container) class(.yui-button) class(.first-child)operator(,)class(.yui-toolbar-container) class(.yui-button) class(.first-child) type(a)operator({)key(height)operator(:)float(100%)operator(;)key(width)operator(:)float(100%)operator(;)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-toolbar-container) class(.yui-button-disabled)operator({)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-toolbar-container) class(.yui-button-disabled) class(.yui-toolbar-icon)operator({)key(opacity)operator(:)float(.5)operator(;)key(filter)operator(:)stringoperator(;)operator(})class(.yui-toolbar-container) class(.yui-button-disabled) class(.up)operator(,)class(.yui-toolbar-container) class(.yui-button-disabled) class(.down)operator({)key(opacity)operator(:)float(.5)operator(;)key(filter)operator(:)stringoperator(;)operator(})class(.yui-toolbar-container) class(.yui-button) type(a)operator({)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-select) class(.first-child) type(a)operator({)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-toolbar-fontname-arial)operator({)key(font-family)operator(:)value(Arial)operator(;)operator(})class(.yui-toolbar-fontname-arial-black)operator({)key(font-family)operator(:)value(Arial) value(Black)operator(;)operator(})class(.yui-toolbar-fontname-comic-sans-ms)operator({)key(font-family)operator(:)value(Comic) value(Sans) value(MS)operator(;)operator(})class(.yui-toolbar-fontname-courier-new)operator({)key(font-family)operator(:)value(Courier) value(New)operator(;)operator(})class(.yui-toolbar-fontname-times-new-roman)operator({)key(font-family)operator(:)value(Times) value(New) value(Roman)operator(;)operator(})class(.yui-toolbar-fontname-verdana)operator({)key(font-family)operator(:)value(Verdana)operator(;)operator(})class(.yui-toolbar-fontname-impact)operator({)key(font-family)operator(:)value(Impact)operator(;)operator(})class(.yui-toolbar-fontname-lucida-console)operator({)key(font-family)operator(:)value(Lucida) value(Console)operator(;)operator(})class(.yui-toolbar-fontname-tahoma)operator({)key(font-family)operator(:)value(Tahoma)operator(;)operator(})class(.yui-toolbar-fontname-trebuchet-ms)operator({)key(font-family)operator(:)value(Trebuchet) value(MS)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-spinbutton)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child) type(a)operator({)key(z-index)operator(:)float(0)operator(;)key(opacity)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up)operator(,)class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down)operator({)key(position)operator(:)value(absolute)operator(;)key(display)operator(:)value(block) value(right)operator(:)float(0)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(z-index)operator(:)float(1)operator(;)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) class(.yui-overlay)operator({)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-toolbar-container) class(.yui-overlay) type(ul) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(list-style-type)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container)operator({)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-editor-container) class(.yui-editor-editable-container)operator({)key(position)operator(:)value(relative)operator(;)key(z-index)operator(:)float(0)operator(;)operator(})class(.yui-editor-container) class(.yui-editor-masked)operator({)key(background-color)operator(:)color(#CCC)operator(;)operator(})class(.yui-editor-container) type(iframe)operator({)key(border)operator(:)float(0px)operator(;)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-editor-container) class(.yui-editor-editable)operator({)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-editor-container) class(.dompath)operator({)key(font-size)operator(:)float(85%)operator(;)operator(})class(.yui-editor-panel) class(.hd)operator({)key(text-align)operator(:)value(left)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-editor-panel) class(.hd) type(h3)operator({)key(font-weight)operator(:)value(bold)operator(;)key(padding)operator(:)float(0.25em) float(0pt) float(0.25em) float(0.25em)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-editor-panel) class(.bd)operator({)key(width)operator(:)float(100%)operator(;)key(zoom)operator(:)float(1)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-editor-panel) class(.bd) type(div)class(.yui-editor-body-cont)operator({)key(padding)operator(:)float(.25em) float(.1em)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-editor-panel) class(.bd) type(div)class(.yui-editor-body-cont)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-editor-panel) class(.ft)operator({)key(text-align)operator(:)value(right)operator(;)key(width)operator(:)float(99%)operator(;)key(float)operator(:)value(left)operator(;)key(clear)operator(:)value(both)operator(;)operator(})class(.yui-editor-panel) class(.ft) type(span)class(.tip)operator({)key(display)operator(:)value(block)operator(;)key(position)operator(:)value(relative)operator(;)key(padding)operator(:)float(.5em) float(.5em) float(.5em) float(23px)operator(;)key(text-align)operator(:)value(left)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-editor-panel) type(label)operator({)key(clear)operator(:)value(both)operator(;)key(float)operator(:)value(left)operator(;)key(padding)operator(:)float(0)operator(;)key(width)operator(:)float(100%)operator(;)key(text-align)operator(:)value(left)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-editor-panel) class(.gecko) type(label)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-editor-panel) type(label) type(strong)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(6em)operator(;)operator(})class(.yui-editor-panel) class(.removeLink)operator({)key(width)operator(:)float(80%)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-editor-panel) type(label) type(input)operator({)key(margin-left)operator(:)float(.25em)operator(;)key(float)operator(:)value(left)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-group-padding)operator({)operator(})class(.yui-editor-panel) class(.yui-toolbar-group-border)operator({)operator(})class(.yui-editor-panel) class(.yui-toolbar-group-textflow)operator({)operator(})class(.yui-editor-panel) class(.height-width)operator({)key(float)operator(:)value(left)operator(;)operator(})class(.yui-editor-panel) class(.height-width) type(h3)operator({)operator(})class(.yui-editor-panel) class(.height-width) type(span)operator({)key(font-style)operator(:)value(italic)operator(;)key(display)operator(:)value(block)operator(;)key(float)operator(:)value(left)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-editor-panel) class(.height-width) type(span)class(.info)operator({)key(font-size)operator(:)float(70%)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize)operator(,)class(.yui-editor-panel) class(.yui-toolbar-bordertype)operator({)key(font-size)operator(:)float(75%)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator)operator({)key(border)operator(:)value(none)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)operator(,)class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)operator({)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(8px)operator(;)key(left)operator(:)float(4px)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(3px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(width)operator(:)float(24px)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-solid)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-dotted)operator({)key(border-bottom)operator(:)float(1px) value(dotted) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-dashed)operator({)key(border-bottom)operator(:)float(1px) value(dashed) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-0)operator({)error(*)key(top)operator(:)float(0px)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-1)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-2)operator({)key(border-bottom)operator(:)float(2px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-3)operator({)key(top)operator(:)float(2px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(border-bottom)operator(:)float(3px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-4)operator({)key(top)operator(:)float(1px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(border-bottom)operator(:)float(4px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-5)operator({)key(top)operator(:)float(1px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(border-bottom)operator(:)float(5px) value(solid) value(black)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-bordersize-menu)operator(,)class(.yui-toolbar-container) class(.yui-toolbar-bordertype-menu)operator({)key(width)operator(:)float(95px) important(!important)operator(;)operator(})class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel)operator(,)class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel)operator(,)class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel)operator(,)class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel)pseudo_class(:hover)operator({)key(margin)operator(:)float(0px) float(3px) float(7px) float(17px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel) class(.checkedindicator)operator(,)class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel) class(.checkedindicator)operator({)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(-12px)operator(;)error(*)key(top)operator(:)float(14px)operator(;)error(*)key(left)operator(:)float(0px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-1) type(a)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-2) type(a)operator({)key(border-bottom)operator(:)float(2px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-3) type(a)operator({)key(border-bottom)operator(:)float(3px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-4) type(a)operator({)key(border-bottom)operator(:)float(4px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-5) type(a)operator({)key(border-bottom)operator(:)float(5px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-solid) type(a)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-dashed) type(a)operator({)key(border-bottom)operator(:)float(1px) value(dashed) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-dotted) type(a)operator({)key(border-bottom)operator(:)float(1px) value(dotted) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})type(h2)class(.yui-editor-skipheader)operator(,)type(h3)class(.yui-editor-skipheader)operator({)key(height)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(width)operator(:)float(0)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-toolbar-colors)operator({)key(width)operator(:)float(133px)operator(;)key(zoom)operator(:)float(1)operator(;)key(display)operator(:)value(none)operator(;)key(z-index)operator(:)float(100)operator(;)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-toolbar-colors)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-colors) type(a)operator({)key(height)operator(:)float(9px)operator(;)key(width)operator(:)float(9px)operator(;)key(float)operator(:)value(left)operator(;)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(text-indent)operator(:)float(999px)operator(;)key(margin)operator(:)float(0)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(border)operator(:)float(1px) value(solid) color(#F6F7EE)operator(;)operator(})class(.yui-toolbar-colors) type(a)pseudo_class(:hover)operator({)key(border)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-color-button-menu)operator({)key(overflow)operator(:)value(visible)operator(;)key(background-color)operator(:)value(transparent)operator(;)operator(})class(.yui-toolbar-colors) type(span)operator({)key(position)operator(:)value(relative)operator(;)key(display)operator(:)value(block)operator(;)key(padding)operator(:)float(3px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(100%)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-colors) type(span)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-colors) type(span) type(em)operator({)key(height)operator(:)float(35px)operator(;)key(width)operator(:)float(30px)operator(;)key(float)operator(:)value(left)operator(;)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(text-indent)operator(:)float(999px)operator(;)key(margin)operator(:)float(0.75px)operator(;)key(border)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-toolbar-colors) type(span) type(strong)operator({)key(font-weight)operator(:)value(normal)operator(;)key(padding-left)operator(:)float(3px)operator(;)key(display)operator(:)value(block)operator(;)key(font-size)operator(:)float(85%)operator(;)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(65%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container)operator({)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-200px)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(h2)operator({)key(color)operator(:)color(#000000)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0.3em) float(1em)operator(;)key(font-size)operator(:)float(100%)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-group) type(h3)operator({)key(color)operator(:)color(#808080)operator(;)key(font-size)operator(:)float(75%)operator(;)key(margin)operator(:)float(1em) float(0) float(0)operator(;)key(padding-bottom)operator(:)float(0)operator(;)key(padding-left)operator(:)float(0.25em)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator)operator({)key(border)operator(:)value(none)operator(;)key(text-indent)operator(:)float(33px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(margin)operator(:)float(.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-subcont)operator({)key(padding)operator(:)float(0) float(1em) float(0.35em)operator(;)key(border-bottom)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container-collapsed) class(.yui-toolbar-titlebar)operator({)key(border-bottom)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) class(.visible) class(.yui-menu-shadow)operator(,)class(.yui-skin-sam) class(.yui-editor-panel) class(.visible) class(.yui-menu-shadow)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) type(ul)operator({)key(list-style-type)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) type(ul) type(li)operator({)key(list-style-type)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-group) type(ul) type(li)class(.yui-toolbar-groupitem)operator({)key(float)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) class(.dompath)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border-top)operator(:)float(1px) value(solid) color(#808080)operator(;)key(color)operator(:)color(#999)operator(;)key(text-align)operator(:)value(left)operator(;)key(padding)operator(:)float(0.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.collapse)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-400px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(span)class(.collapse)operator({)key(cursor)operator(:)value(pointer)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(4px)operator(;)key(right)operator(:)float(2px)operator(;)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(height)operator(:)float(15px)operator(;)key(width)operator(:)float(15px)operator(;)key(text-indent)operator(:)float(9999px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(position)operator(:)value(relative)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(22px)operator(;)key(width)operator(:)float(30px)operator(;)key(margin)operator(:)float(0)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(1px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) type(a)operator({)key(padding-left)operator(:)float(35px)operator(;)key(height)operator(:)float(20px)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(2)operator(;)key(display)operator(:)value(block)operator(;)key(color)operator(:)color(#000000)operator(;)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) class(.first-child)operator({)key(border-color)operator(:)color(#808080)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(0) float(1px)operator(;)key(margin)operator(:)float(0) float(-1px)operator(;)key(display)operator(:)value(block)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled) class(.first-child)operator({)key(border-color)operator(:)color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled) type(a)operator({)key(color)operator(:)color(#A6A6A6)operator(;)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled)operator({)key(border-color)operator(:)color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button) class(.first-child)operator({)error(*)key(left)operator(:)float(0px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-fontname)operator({)key(width)operator(:)float(135px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-heading)operator({)key(width)operator(:)float(92px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-hover)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1300px)operator(;)key(border-color)operator(:)color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-selected)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1700px)operator(;)key(border-color)operator(:)color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) type(h3)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) class(.yui-toolbar-group)operator({)key(margin-top)operator(:)float(.75em)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) type(span)class(.yui-toolbar-icon)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) type(span)class(.yui-toolbar-icon)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) type(span)class(.yui-toolbar-icon)operator({)key(display)operator(:)value(block)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(2px)operator(;)key(height)operator(:)float(18px)operator(;)key(width)operator(:)float(18px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(background)operator(:)string value(no-repeat) float(30px) float(30px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-selected) type(span)class(.yui-toolbar-icon)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-hover) type(span)class(.yui-toolbar-icon)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.visible) class(.yuimenuitemlabel)operator({)key(cursor)operator(:)value(pointer)operator(;)key(color)operator(:)color(#000)operator(;)error(*)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-menu)operator({)key(background-color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) type(div)class(.yuimenu) type(li)class(.selected)operator({)key(background-color)operator(:)color(#B3D4FF)operator(;)operator(})class(.yui-skin-sam) type(div)class(.yuimenu) type(li)class(.selected) type(a)class(.selected)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-bold) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(0)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-italic) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-36px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-underline) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-72px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-subscript) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-180px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-superscript) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-144px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-forecolor) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-216px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-backcolor) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-288px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyleft) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-324px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifycenter) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-360px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyright) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-396px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyfull) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-432px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-indent) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-720px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-outdent) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-684px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-createlink) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-792px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertimage) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(1px) float(-756px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-left) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-972px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-right) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-936px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-inline) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-900px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-block) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-864px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-bordercolor) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-252px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-removeformat) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-1080px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-hiddenelements) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-1044px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertunorderedlist) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-468px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertorderedlist) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-504px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child)operator({)key(width)operator(:)float(35px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child) type(a)operator({)key(padding-left)operator(:)float(2px)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(span)class(.yui-toolbar-icon)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down)operator({)key(right)operator(:)float(2px)operator(;)key(background)operator(:)string value(no-repeat) float(0) float(-1222px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(height)operator(:)float(6px)operator(;)key(width)operator(:)float(7px)operator(;)key(min-height)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up)operator({)key(top)operator(:)float(2px)operator(;)key(background-position)operator(:)float(0) float(-1222px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down)operator({)key(bottom)operator(:)float(2px)operator(;)key(background-position)operator(:)float(0) float(-1187px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-select) class(.first-child) type(a)operator({)key(padding-left)operator(:)float(5px)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-select) type(span)class(.yui-toolbar-icon)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-1144px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(right)operator(:)float(-2px)operator(;)key(top)operator(:)float(0px)operator(;)key(height)operator(:)float(20px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-color-button-menu) class(.bd)operator({)key(background-color)operator(:)value(transparent)operator(;)key(border)operator(:)value(none)operator(;)key(width)operator(:)float(135px)operator(;)operator(})class(.yui-skin-sam) class(.yui-color-button-menu) class(.yui-toolbar-colors)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel)operator({)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(background-color)operator(:)value(transparent)operator(;)key(overflow)operator(:)value(visible)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd)operator({)key(margin)operator(:)float(10px) float(0) float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(h3)operator({)key(color)operator(:)color(#000)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(background)operator(:)string value(repeat-x) float(0) float(-200px)operator(;)key(width)operator(:)float(99%)operator(;)key(position)operator(:)value(relative)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(3px) float(0) float(0) float(0)operator(;)key(font-size)operator(:)float(93%)operator(;)key(text-indent)operator(:)float(5px)operator(;)key(height)operator(:)float(20px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.bd)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border-left)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#808080)operator(;)key(width)operator(:)float(99%)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(overflow)operator(:)value(visible)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(ul)operator({)key(list-style-type)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(ul) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yuimenu)operator({)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container) class(.yui-toolbar-subcont)operator({)key(padding)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(margin-top)operator(:)float(0.35em)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-bordersize)operator(,)class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-bordertype)operator({)key(width)operator(:)float(50px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label)operator({)key(display)operator(:)value(block)operator(;)key(float)operator(:)value(none)operator(;)key(padding)operator(:)float(4px) float(0)operator(;)key(margin-bottom)operator(:)float(7px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(strong)operator({)key(font-weight)operator(:)value(normal)operator(;)key(font-size)operator(:)float(93%)operator(;)key(text-align)operator(:)value(right)operator(;)key(padding-top)operator(:)float(2px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(input)operator({)key(width)operator(:)float(75%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) constant(#createlink_target)operator(,)class(.yui-skin-sam) class(.yui-editor-panel) constant(#insertimage_target)operator({)key(width)operator(:)value(auto)operator(;)key(margin-right)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.removeLink)operator({)key(width)operator(:)float(98%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(input)class(.warning)operator({)key(background-color)operator(:)color(#FFEE69)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group) type(h3)operator({)key(color)operator(:)color(#000)operator(;)key(float)operator(:)value(left)operator(;)key(font-weight)operator(:)value(normal)operator(;)key(font-size)operator(:)float(93%)operator(;)key(margin)operator(:)float(5px) float(0) float(0) float(0)operator(;)key(padding)operator(:)float(0) float(3px) float(0) float(0)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.height-width) type(h3)operator({)key(margin)operator(:)float(3px) float(0) float(0) float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.height-width)operator({)key(margin)operator(:)float(3px) float(0) float(0) float(35px)operator(;)error(*)key(margin-left)operator(:)float(14px)operator(;)key(width)operator(:)float(42%)operator(;)error(*)key(width)operator(:)float(44%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-border)operator({)key(width)operator(:)float(190px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-padding)operator({)key(width)operator(:)float(203px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-padding) type(h3)operator({)key(margin-left)operator(:)float(25px)operator(;)error(*)key(margin-left)operator(:)float(12px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-textflow)operator({)key(width)operator(:)float(182px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd)operator({)key(background)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-top)operator(:)value(none)operator(;)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0) float(0) float(2px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(span)class(.close)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-300px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(16px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(position)operator(:)value(absolute)operator(;)key(right)operator(:)float(5px)operator(;)key(text-indent)operator(:)float(500px)operator(;)key(top)operator(:)float(2px)operator(;)key(width)operator(:)float(26px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)key(border-top)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(strong)operator({)key(display)operator(:)value(block)operator(;)key(float)operator(:)value(left)operator(;)key(margin)operator(:)float(0) float(2px) float(8px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-1260px)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(20px)operator(;)key(left)operator(:)float(2px)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(8px)operator(;)key(width)operator(:)float(20px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon-info)operator({)key(background-position)operator(:)float(2px) float(-1260px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon-warn)operator({)key(background-position)operator(:)float(2px) float(-1296px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(span)class(.knob)operator({)key(position)operator(:)value(absolute)operator(;)key(height)operator(:)float(10px)operator(;)key(width)operator(:)float(28px)operator(;)key(top)operator(:)float(-10px)operator(;)key(left)operator(:)float(25px)operator(;)key(text-indent)operator(:)float(9999px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(background)operator(:)string value(no-repeat) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(100%)operator(;)key(background-image)operator(:)value(none)operator(;)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container) class(.bd)operator({)key(background-color)operator(:)color(#ffffff)operator(;)operator(})class(.yui-editor-blankimage)operator({)key(background-image)operator(:)stringoperator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-skin-sam) class(.yui-log)operator({)key(padding)operator(:)float(1em)operator(;)key(width)operator(:)float(31em)operator(;)key(background-color)operator(:)color(#AAA)operator(;)key(color)operator(:)color(#000)operator(;)key(border)operator(:)float(1px) value(solid) value(black)operator(;)key(font-family)operator(:)value(monospace)operator(;)key(font-size)operator(:)float(77%)operator(;)key(text-align)operator(:)value(left)operator(;)key(z-index)operator(:)float(9000)operator(;)operator(})class(.yui-skin-sam) class(.yui-log-container)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(1em)operator(;)key(right)operator(:)float(1em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(input)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-family)operator(:)value(arial)operator(;)key(font-size)operator(:)float(100%)operator(;)key(font-weight)operator(:)value(normal)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-btns)operator({)key(position)operator(:)value(relative)operator(;)key(float)operator(:)value(right)operator(;)key(bottom)operator(:)float(.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-hd)operator({)key(margin-top)operator(:)float(1em)operator(;)key(padding)operator(:)float(.5em)operator(;)key(background-color)operator(:)color(#575757)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-hd) type(h4)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-size)operator(:)float(108%)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-bd)operator({)key(width)operator(:)float(100%)operator(;)key(height)operator(:)float(20em)operator(;)key(background-color)operator(:)color(#FFF)operator(;)key(border)operator(:)float(1px) value(solid) value(gray)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(p)operator({)key(margin)operator(:)float(1px)operator(;)key(padding)operator(:)float(.1em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(pre)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(pre)class(.yui-log-verbose)operator({)key(white-space)operator(:)value(pre-wrap)operator(;)key(white-space)operator(:)value(-moz-pre-wrap) important(!important)operator(;)key(white-space)operator(:)value(-pre-wrap)operator(;)key(white-space)operator(:)value(-o-pre-wrap)operator(;)key(word-wrap)operator(:)value(break-word)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft)operator({)key(margin-top)operator(:)float(.5em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft) class(.yui-log-categoryfilters)operator({)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft) class(.yui-log-sourcefilters)operator({)key(width)operator(:)float(100%)operator(;)key(border-top)operator(:)float(1px) value(solid) color(#575757)operator(;)key(margin-top)operator(:)float(.75em)operator(;)key(padding-top)operator(:)float(.75em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-filtergrp)operator({)key(margin-right)operator(:)float(.5em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.info)operator({)key(background-color)operator(:)color(#A7CC25)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.warn)operator({)key(background-color)operator(:)color(#F58516)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.error)operator({)key(background-color)operator(:)color(#E32F0B)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.time)operator({)key(background-color)operator(:)color(#A6C9D7)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.window)operator({)key(background-color)operator(:)color(#F2E886)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yuimenu) class(.yuimenu)operator(,)class(.yuimenubar) class(.yuimenu)operator({)key(position)operator(:)value(absolute)operator(;)key(visibility)operator(:)value(hidden)operator(;)operator(})class(.yuimenubar) type(li)operator(,)class(.yuimenu) type(li)operator({)key(list-style-type)operator(:)value(none)operator(;)operator(})class(.yuimenubar) type(ul)operator(,)class(.yuimenu) type(ul)operator(,)class(.yuimenubar) type(li)operator(,)class(.yuimenu) type(li)operator(,)class(.yuimenu) type(h6)operator(,)class(.yuimenubar) type(h6)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yuimenuitemlabel)operator(,)class(.yuimenubaritemlabel)operator({)key(white-space)operator(:)value(nowrap)operator(;)operator(})class(.yui-menu-shadow)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(-1)operator(;)operator(})class(.hide-scrollbars) type(*)operator({)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.hide-scrollbars) type(select)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yuimenu)class(.show-scrollbars)operator({)key(overflow)operator(:)value(visible)operator(;)operator(})class(.yuimenu)class(.hide-scrollbars) class(.yui-menu-shadow)operator({)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yuimenu)class(.show-scrollbars) class(.yui-menu-shadow)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubar)operator({)key(border)operator(:)value(solid) float(1px) color(#808080)operator(;)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubar) class(.bd)operator(,)class(.yui-skin-sam) class(.yuimenubar) type(ul)operator({)error(*)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubar)operator(>)class(.bd)operator(>)type(ul)pseudo_class(:after)operator({)key(content)operator(:)stringoperator(;)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(height)operator(:)float(0)operator(;)key(line-height)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubaritem)operator({)key(float)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenubaritem)operator({)key(border-right)operator(:)value(solid) float(1px) color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubaritemlabel)operator({)key(display)operator(:)value(block)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(2)operator(;)error(*)key(line-height)operator(:)float(1)float(.9)operator(;)key(padding)operator(:)float(0) float(10px)operator(;)key(color)operator(:)color(#000)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(outline)operator(:)value(none)operator(;)key(cursor)operator(:)value(default)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(border-width)operator(:)float(1px) float(0)operator(;)key(position)operator(:)value(relative)operator(;)key(margin)operator(:)float(-1px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenubaritemlabel)operator({)key(padding-right)operator(:)float(20px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubaritemlabel) class(.submenuindicator)operator({)key(width)operator(:)float(1px)operator(;)key(height)operator(:)float(1px)operator(;)key(top)operator(:)float(0)operator(;)key(left)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenubaritemlabel) class(.submenuindicator)operator({)key(top)operator(:)float(50%)operator(;)key(right)operator(:)float(8px)operator(;)key(left)operator(:)value(auto)operator(;)key(margin-top)operator(:)float(-3px)operator(;)key(height)operator(:)float(4px)operator(;)key(width)operator(:)float(7px)operator(;)key(text-indent)operator(:)float(8px)operator(;)key(background-position)operator(:)float(-16px) float(-856px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubaritem) type(a)class(.selected)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1700px)operator(;)key(border-color)operator(:)color(#7D98B8)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenubaritem) type(a)class(.selected)operator({)key(border-left-width)operator(:)float(1px)operator(;)key(margin-left)operator(:)float(-1px)operator(;)error(*)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubar) type(a)class(.selected) class(.submenuindicator)operator({)key(background)operator(:)value(transparent)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) type(a)class(.selected) class(.submenuindicator)operator({)key(background)operator(:)string value(repeat-x) float(-16px) float(-856px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubaritem) type(a)class(.disabled)operator({)key(cursor)operator(:)value(default)operator(;)key(color)operator(:)color(#A6A6A6)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenubaritem) type(a)class(.disabled) class(.submenuindicator)operator({)key(background-position)operator(:)float(-16px) float(-881px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.bd)operator({)key(border)operator(:)value(solid) float(1px) color(#808080)operator(;)key(background-color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) type(ul)operator({)key(padding)operator(:)float(3px) float(0)operator(;)key(border-width)operator(:)float(1px) float(0) float(0) float(0)operator(;)key(border-color)operator(:)color(#ccc)operator(;)key(border-style)operator(:)value(solid)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) type(ul)class(.first-of-type)operator({)key(border-width)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) type(h6)operator({)key(font-size)operator(:)float(93%)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(line-height)operator(:)float(1)float(.5)operator(;)error(*)key(line-height)operator(:)float(1)float(.45)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-color)operator(:)color(#ccc)operator(;)key(border-width)operator(:)float(1px) float(0) float(0) float(0)operator(;)key(color)operator(:)color(#a4a4a4)operator(;)key(padding)operator(:)float(3px) float(10px) float(0) float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) type(ul)class(.hastitle)operator(,)class(.yui-skin-sam) class(.yuimenu) type(h6)class(.first-of-type)operator({)key(border-width)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.yui-menu-body-scrolled)operator({)key(border-color)operator(:)color(#ccc) color(#808080)operator(;)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.topscrollbar)operator(,)class(.yui-skin-sam) class(.yuimenu) class(.bottomscrollbar)operator({)key(height)operator(:)float(16px)operator(;)key(border)operator(:)value(solid) float(1px) color(#808080)operator(;)key(background)operator(:)color(#fff) string value(no-repeat) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.topscrollbar)operator({)key(border-bottom-width)operator(:)float(0)operator(;)key(background-position)operator(:)value(center) float(-950px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.topscrollbar_disabled)operator({)key(background-position)operator(:)value(center) float(-975px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.bottomscrollbar)operator({)key(border-top-width)operator(:)float(0)operator(;)key(background-position)operator(:)value(center) float(-850px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.bottomscrollbar_disabled)operator({)key(background-position)operator(:)value(center) float(-875px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel)operator({)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(1)float(.5)operator(;)error(*)key(line-height)operator(:)float(1)float(.45)operator(;)key(padding)operator(:)float(0) float(20px)operator(;)key(display)operator(:)value(block)operator(;)key(color)operator(:)color(#000)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(outline)operator(:)value(none)operator(;)key(position)operator(:)value(relative)operator(;)error(*)key(position)operator(:)value(static)operator(;)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel) class(.helptext)operator({)key(font-style)operator(:)value(normal)operator(;)key(display)operator(:)value(block)operator(;)key(margin)operator(:)float(-1.5em) float(0) float(0) float(10em)operator(;)error(*)key(margin-top)operator(:)float(-1.45em)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel) class(.submenuindicator)operator(,)class(.yui-skin-sam) class(.yuimenuitemlabel) class(.checkedindicator)operator(,)class(.yui-skin-sam) class(.yuimenubaritemlabel) class(.submenuindicator)operator({)key(position)operator(:)value(absolute)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(background)operator(:)string value(no-repeat)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel) class(.submenuindicator)operator(,)class(.yui-skin-sam) class(.yuimenuitemlabel) class(.checkedindicator)operator({)error(*)key(position)operator(:)value(static)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel) class(.submenuindicator)operator({)key(top)operator(:)float(50%)operator(;)key(right)operator(:)float(8px)operator(;)key(margin-top)operator(:)float(-3px)operator(;)key(height)operator(:)float(7px)operator(;)key(width)operator(:)float(4px)operator(;)key(text-indent)operator(:)float(5px)operator(;)key(background-position)operator(:)float(0) float(-906px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel) class(.checkedindicator)operator({)key(top)operator(:)float(50%)operator(;)key(left)operator(:)float(8px)operator(;)key(margin-top)operator(:)float(-3px)operator(;)key(height)operator(:)float(7px)operator(;)key(width)operator(:)float(7px)operator(;)key(text-indent)operator(:)float(8px)operator(;)key(background-position)operator(:)float(0) float(-1006px)operator(;)operator(})class(.yui-skin-sam) class(.visible) class(.yuimenuitemlabel) class(.submenuindicator)operator({)error(*)key(float)operator(:)value(right)operator(;)error(*)key(margin)operator(:)float(-1em) float(8px) float(0) float(8px)operator(;)operator(})class(.yui-skin-sam) class(.visible) class(.yuimenuitem) class(.hassubmenu)operator({)error(*)key(padding-right)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.visible) class(.yuimenuitemlabel) class(.checkedindicator)operator({)error(*)key(float)operator(:)value(left)operator(;)error(*)key(margin)operator(:)float(-1em) float(0) float(0) float(-12px)operator(;)operator(})class(.yui-skin-sam) class(.yui-menu-shadow-visible)operator({)key(top)operator(:)float(2px)operator(;)key(right)operator(:)float(-3px)operator(;)key(left)operator(:)float(-3px)operator(;)key(bottom)operator(:)float(-3px)operator(;)key(background-color)operator(:)color(#000)operator(;)key(opacity)operator(:)float(.12)operator(;)error(*)key(filter)operator(:)stringoperator(;)key(visibility)operator(:)value(visible)operator(;)operator(})class(.yui-skin-sam) class(.visible) class(.bd)operator(,)class(.yui-skin-sam) class(.visible) class(.yuimenuitem)operator({)key(_zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.visible) class(.yuimenuitemlabel)operator({)error(*)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitem) type(a)class(.selected)operator({)key(background)operator(:)color(#B3D4FF)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubar) class(.yuimenuitem) type(a)class(.selected) class(.submenuindicator)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-906px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenuitem) type(a)class(.selected)operator({)key(border-width)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)error(*)key(left)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitem) type(a)class(.disabled)operator({)key(cursor)operator(:)value(default)operator(;)key(color)operator(:)color(#A6A6A6)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitem) type(a)class(.disabled) class(.submenuindicator)operator({)key(background-position)operator(:)float(0) float(-931px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitem) type(a)class(.disabled) class(.checkedindicator)operator({)key(background-position)operator(:)float(0) float(-1031px)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-skin-sam) class(.yui-ac)operator({)key(position)operator(:)value(relative)operator(;)key(font-family)operator(:)value(arial)operator(;)key(font-size)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-input)operator({)key(position)operator(:)value(absolute)operator(;)key(width)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-container)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(1.6em)operator(;)key(width)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content)operator({)key(position)operator(:)value(absolute)operator(;)key(width)operator(:)float(100%)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(background)operator(:)color(#fff)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(z-index)operator(:)float(9050)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-shadow)operator({)key(position)operator(:)value(absolute)operator(;)key(margin)operator(:)float(.3em)operator(;)key(width)operator(:)float(100%)operator(;)key(background)operator(:)color(#000)operator(;)key(-moz-opacity)operator(:)float(0)float(.10)operator(;)key(opacity)operator(:)float(.10)operator(;)key(filter)operator(:)stringoperator(;)key(z-index)operator(:)float(9049)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(ul)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(width)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(2px) float(5px)operator(;)key(cursor)operator(:)value(default)operator(;)key(white-space)operator(:)value(nowrap)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(li)class(.yui-ac-prehighlight)operator({)key(background)operator(:)color(#B3D4FF)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(li)class(.yui-ac-highlight)operator({)key(background)operator(:)color(#426FD9)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(}) -class(.yui-skin-sam) class(.yui-button)operator({)key(display)operator(:)value(-moz-inline-box)operator(;)key(display)operator(:)value(inline-block)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) class(.first-child)operator({)key(display)operator(:)value(block)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(button)operator(,)class(.yui-skin-sam) class(.yui-button) type(a)operator({)key(display)operator(:)value(block)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(button)operator({)key(background-color)operator(:)value(transparent)operator(;)error(*)key(overflow)operator(:)value(visible)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(a)operator({)key(text-decoration)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-button)operator({)key(border-width)operator(:)float(1px) float(0)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(margin)operator(:)value(auto) float(.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) class(.first-child)operator({)key(border-width)operator(:)float(0) float(1px)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(margin)operator(:)float(0) float(-1px)operator(;)error(*)key(position)operator(:)value(relative)operator(;)error(*)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(button)operator(,)class(.yui-skin-sam) class(.yui-button) type(a)operator({)key(padding)operator(:)float(0) float(10px)operator(;)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(2)operator(;)error(*)key(line-height)operator(:)float(1)float(.7)operator(;)key(min-height)operator(:)float(2em)operator(;)error(*)key(min-height)operator(:)value(auto)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button) type(button)operator(,)class(.yui-skin-sam) class(.yui-menu-button) type(button)operator({)key(padding-right)operator(:)float(20px)operator(;)key(background-position)operator(:)value(right) value(center)operator(;)key(background-repeat)operator(:)value(no-repeat)operator(;)operator(})class(.yui-skin-sam) class(.yui-menu-button) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-split-button) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-button-focus)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)key(background-position)operator(:)float(0) float(-1300px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-focus) class(.first-child)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-focus) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-focus) type(a)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-focus) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-button-hover)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)key(background-position)operator(:)float(0) float(-1300px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-hover) class(.first-child)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-hover) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-hover) type(a)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-hover) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-button-active)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)key(background-position)operator(:)float(0) float(-1700px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-active) class(.first-child)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-active) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-active) type(a)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-activeoption)operator({)key(border-color)operator(:)color(#808080)operator(;)key(background-position)operator(:)float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-activeoption) class(.first-child)operator({)key(border-color)operator(:)color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-activeoption) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-radio-button-checked)operator(,)class(.yui-skin-sam) class(.yui-checkbox-button-checked)operator({)key(border-color)operator(:)color(#304369)operator(;)key(background-position)operator(:)float(0) float(-1400px)operator(;)operator(})class(.yui-skin-sam) class(.yui-radio-button-checked) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-checkbox-button-checked) class(.first-child)operator({)key(border-color)operator(:)color(#304369)operator(;)operator(})class(.yui-skin-sam) class(.yui-radio-button-checked) type(button)operator(,)class(.yui-skin-sam) class(.yui-checkbox-button-checked) type(button)operator({)key(color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-disabled)operator({)key(border-color)operator(:)color(#ccc)operator(;)key(background-position)operator(:)float(0) float(-1500px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-disabled) class(.first-child)operator({)key(border-color)operator(:)color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-disabled) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-disabled) type(a)operator({)key(color)operator(:)color(#A6A6A6)operator(;)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-skin-sam) class(.yui-menu-button-disabled) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-disabled) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(}) -class(.yui-calcontainer)operator({)key(position)operator(:)value(relative)operator(;)key(float)operator(:)value(left)operator(;)key(_overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-calcontainer) type(iframe)operator({)key(position)operator(:)value(absolute)operator(;)key(border)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(z-index)operator(:)float(0)operator(;)key(width)operator(:)float(100%)operator(;)key(height)operator(:)float(100%)operator(;)key(left)operator(:)float(0px)operator(;)key(top)operator(:)float(0px)operator(;)operator(})class(.yui-calcontainer) type(iframe)class(.fixedsize)operator({)key(width)operator(:)float(50em)operator(;)key(height)operator(:)float(50em)operator(;)key(top)operator(:)float(-1px)operator(;)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-calcontainer)class(.multi) class(.groupcal)operator({)key(z-index)operator(:)float(1)operator(;)key(float)operator(:)value(left)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-calcontainer) class(.title)operator({)key(position)operator(:)value(relative)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calcontainer) class(.close-icon)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calendar)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-calendar) class(.calnavleft)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calendar) class(.calnavright)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calendar) class(.calheader)operator({)key(position)operator(:)value(relative)operator(;)key(width)operator(:)float(100%)operator(;)key(text-align)operator(:)value(center)operator(;)operator(})class(.yui-calendar) class(.calbody) type(a)pseudo_class(:hover)operator({)key(background)operator(:)value(inherit)operator(;)operator(})type(p)constant(#clear)operator({)key(clear)operator(:)value(left)operator(;)key(padding-top)operator(:)float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)operator({)key(background-color)operator(:)color(#f2f2f2)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(padding)operator(:)float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.multi)operator({)key(padding)operator(:)float(0) float(5px) float(0) float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.multi) class(.groupcal)operator({)key(background-color)operator(:)value(transparent)operator(;)key(border)operator(:)value(none)operator(;)key(padding)operator(:)float(10px) float(5px) float(10px) float(5px)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer) class(.title)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(border-bottom)operator(:)float(1px) value(solid) color(#cccccc)operator(;)key(font)operator(:)float(100%) value(sans-serif)operator(;)key(color)operator(:)color(#000)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(height)operator(:)value(auto)operator(;)key(padding)operator(:)float(.4em)operator(;)key(margin)operator(:)float(0) float(-10px) float(10px) float(-10px)operator(;)key(top)operator(:)float(0)operator(;)key(left)operator(:)float(0)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.multi) class(.title)operator({)key(margin)operator(:)float(0) float(-5px) float(0) float(-5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.withtitle)operator({)key(padding-top)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer) class(.calclose)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-300px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(top)operator(:)float(.4em)operator(;)key(right)operator(:)float(.4em)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar)operator({)key(border-spacing)operator(:)float(0)operator(;)key(border-collapse)operator(:)value(collapse)operator(;)key(font)operator(:)float(100%) value(sans-serif)operator(;)key(text-align)operator(:)value(center)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calhead)operator({)key(background)operator(:)value(transparent)operator(;)key(border)operator(:)value(none)operator(;)key(vertical-align)operator(:)value(middle)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calheader)operator({)key(background)operator(:)value(transparent)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(padding)operator(:)float(0) float(0) float(.6em) float(0)operator(;)key(text-align)operator(:)value(center)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calheader) type(img)operator({)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calnavleft)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-450px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(top)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(left)operator(:)float(-10px)operator(;)key(margin-left)operator(:)float(.4em)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calnavright)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-500px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(top)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(right)operator(:)float(-10px)operator(;)key(margin-right)operator(:)float(.4em)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calweekdayrow)operator({)key(height)operator(:)float(2em)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calweekdaycell)operator({)key(color)operator(:)color(#000)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(text-align)operator(:)value(center)operator(;)key(width)operator(:)float(2em)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calfoot)operator({)key(background-color)operator(:)color(#f2f2f2)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calrowhead)operator(,)class(.yui-skin-sam) class(.yui-calendar) class(.calrowfoot)operator({)key(color)operator(:)color(#a6a6a6)operator(;)key(font-size)operator(:)float(85%)operator(;)key(font-style)operator(:)value(normal)operator(;)key(font-weight)operator(:)value(normal)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calrowhead)operator({)key(text-align)operator(:)value(right)operator(;)key(padding-right)operator(:)float(2px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calrowfoot)operator({)key(text-align)operator(:)value(left)operator(;)key(padding-left)operator(:)float(2px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)operator({)key(border)operator(:)float(1px) value(solid) color(#cccccc)operator(;)key(background)operator(:)color(#fff)operator(;)key(padding)operator(:)float(1px)operator(;)key(height)operator(:)float(1.6em)operator(;)key(line-height)operator(:)float(1.6em)operator(;)key(text-align)operator(:)value(center)operator(;)key(white-space)operator(:)value(nowrap)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell) type(a)operator({)key(color)operator(:)color(#0066cc)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(100%)operator(;)key(text-decoration)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.today)operator({)key(background-color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.today) type(a)operator({)key(background-color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.oom)operator({)key(background-color)operator(:)color(#cccccc)operator(;)key(color)operator(:)color(#a6a6a6)operator(;)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.selected)operator({)key(background-color)operator(:)color(#fff)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.selected) type(a)operator({)key(background-color)operator(:)color(#b3d4ff)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.calcellhover)operator({)key(background-color)operator(:)color(#426fd9)operator(;)key(color)operator(:)color(#fff)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.calcellhover) type(a)operator({)key(background-color)operator(:)color(#426fd9)operator(;)key(color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.previous)operator({)key(color)operator(:)color(#e0e0e0)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.restricted)operator({)key(text-decoration)operator(:)value(line-through)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight1)operator({)key(background-color)operator(:)color(#ccff99)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight2)operator({)key(background-color)operator(:)color(#99ccff)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight3)operator({)key(background-color)operator(:)color(#ffcccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight4)operator({)key(background-color)operator(:)color(#ccff99)operator(;)operator(}) -class(.yui-picker-panel)operator({)key(background)operator(:)color(#e3e3e3)operator(;)key(border-color)operator(:)color(#888)operator(;)operator(})class(.yui-picker-panel) class(.hd)operator({)key(background-color)operator(:)color(#ccc)operator(;)key(font-size)operator(:)float(100%)operator(;)key(line-height)operator(:)float(100%)operator(;)key(border)operator(:)float(1px) value(solid) color(#e3e3e3)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(padding)operator(:)float(6px)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-picker-panel) class(.bd)operator({)key(background)operator(:)color(#e8e8e8)operator(;)key(margin)operator(:)float(1px)operator(;)key(height)operator(:)float(200px)operator(;)operator(})class(.yui-picker-panel) class(.ft)operator({)key(background)operator(:)color(#e8e8e8)operator(;)key(margin)operator(:)float(1px)operator(;)key(padding)operator(:)float(1px)operator(;)operator(})class(.yui-picker)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-picker-hue-thumb)operator({)key(cursor)operator(:)value(default)operator(;)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(18px)operator(;)key(top)operator(:)float(-8px)operator(;)key(left)operator(:)float(-2px)operator(;)key(z-index)operator(:)float(9)operator(;)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-picker-hue-bg)operator({)key(-moz-outline)operator(:)value(none)operator(;)key(outline)operator(:)float(0px) value(none)operator(;)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(200px)operator(;)key(height)operator(:)float(183px)operator(;)key(width)operator(:)float(14px)operator(;)key(background)operator(:)string value(no-repeat)operator(;)key(top)operator(:)float(4px)operator(;)operator(})class(.yui-picker-bg)operator({)key(-moz-outline)operator(:)value(none)operator(;)key(outline)operator(:)float(0px) value(none)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(4px)operator(;)key(left)operator(:)float(4px)operator(;)key(height)operator(:)float(182px)operator(;)key(width)operator(:)float(182px)operator(;)key(background-color)operator(:)color(#F00)operator(;)key(background-image)operator(:)stringoperator(;)operator(})type(*)type(html) class(.yui-picker-bg)operator({)key(background-image)operator(:)value(none)operator(;)key(filter)operator(:)value(progid)operator(:)value(DXImageTransform)operator(.)value(Microsoft)operator(.)error(A)error(l)error(p)error(h)error(a)error(I)error(m)error(a)error(g)error(e)error(L)error(o)error(a)error(d)error(e)error(r)operator(()value(src)operator(=)stringoperator(,)value(sizingMethod)operator(=)stringoperator(\))operator(;)operator(})class(.yui-picker-mask)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)key(top)operator(:)float(0px)operator(;)key(left)operator(:)float(0px)operator(;)operator(})class(.yui-picker-thumb)operator({)key(cursor)operator(:)value(default)operator(;)key(width)operator(:)float(11px)operator(;)key(height)operator(:)float(11px)operator(;)key(z-index)operator(:)float(9)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(-4px)operator(;)key(left)operator(:)float(-4px)operator(;)operator(})class(.yui-picker-swatch)operator({)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(240px)operator(;)key(top)operator(:)float(4px)operator(;)key(height)operator(:)float(60px)operator(;)key(width)operator(:)float(55px)operator(;)key(border)operator(:)float(1px) value(solid) color(#888)operator(;)operator(})class(.yui-picker-websafe-swatch)operator({)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(304px)operator(;)key(top)operator(:)float(4px)operator(;)key(height)operator(:)float(24px)operator(;)key(width)operator(:)float(24px)operator(;)key(border)operator(:)float(1px) value(solid) color(#888)operator(;)operator(})class(.yui-picker-controls)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(72px)operator(;)key(left)operator(:)float(226px)operator(;)key(font)operator(:)float(1em) value(monospace)operator(;)operator(})class(.yui-picker-controls) class(.hd)operator({)key(background)operator(:)value(transparent)operator(;)key(border-width)operator(:)float(0px) important(!important)operator(;)operator(})class(.yui-picker-controls) class(.bd)operator({)key(height)operator(:)float(100px)operator(;)key(border-width)operator(:)float(0px) important(!important)operator(;)operator(})class(.yui-picker-controls) type(ul)operator({)key(float)operator(:)value(left)operator(;)key(list-style)operator(:)value(none)operator(;)key(padding)operator(:)float(0) float(2px) float(0) float(0)operator(;)key(margin)operator(:)float(0)operator(})class(.yui-picker-controls) type(li)operator({)key(padding)operator(:)float(2px)operator(;)key(margin)operator(:)float(0)operator(})class(.yui-picker-controls) type(input)operator({)key(font-size)operator(:)float(0.85em)operator(;)key(width)operator(:)float(2.4em)operator(;)operator(})class(.yui-picker-hex-controls)operator({)key(clear)operator(:)value(both)operator(;)key(padding)operator(:)float(2px)operator(;)operator(})class(.yui-picker-hex-controls) type(input)operator({)key(width)operator(:)float(4.6em)operator(;)operator(})class(.yui-picker-controls) type(a)operator({)key(font)operator(:)float(1em) value(arial)operator(,)value(helvetica)operator(,)value(clean)operator(,)value(sans-serif)operator(;)key(display)operator(:)value(block)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)key(padding)operator(:)float(0)operator(;)key(color)operator(:)color(#000)operator(;)operator(}) -class(.yui-overlay)operator(,)class(.yui-panel-container)operator({)key(visibility)operator(:)value(hidden)operator(;)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(2)operator(;)operator(})class(.yui-panel-container) type(form)operator({)key(margin)operator(:)float(0)operator(;)operator(})class(.mask)operator({)key(z-index)operator(:)float(1)operator(;)key(display)operator(:)value(none)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(0)operator(;)key(left)operator(:)float(0)operator(;)key(right)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-panel-container) type(select)operator({)key(_visibility)operator(:)value(inherit)operator(;)operator(})class(.masked) type(select)operator(,)class(.drag) type(select)operator(,)class(.hide-select) type(select)operator({)key(_visibility)operator(:)value(hidden)operator(;)operator(})class(.hide-scrollbars)operator(,)class(.hide-scrollbars) type(*)operator({)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.hide-scrollbars) type(select)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.show-scrollbars)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-panel-container)class(.show-scrollbars)operator(,)class(.yui-tt)class(.show-scrollbars)operator({)key(overflow)operator(:)value(visible)operator(;)operator(})class(.yui-panel-container)class(.show-scrollbars) class(.underlay)operator(,)class(.yui-tt)class(.show-scrollbars) class(.yui-tt-shadow)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-tt-shadow)operator({)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-skin-sam) class(.mask)operator({)key(background-color)operator(:)color(#000)operator(;)key(opacity)operator(:)float(.25)operator(;)error(*)key(filter)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)operator({)key(padding)operator(:)float(0) float(1px)operator(;)error(*)key(padding)operator(:)float(2px) float(3px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel)operator({)key(position)operator(:)value(relative)operator(;)error(*)key(zoom)operator(:)float(1)operator(;)key(left)operator(:)float(0)operator(;)key(top)operator(:)float(0)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(1px) float(0)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.hd)operator(,)class(.yui-skin-sam) class(.yui-panel) class(.bd)operator(,)class(.yui-skin-sam) class(.yui-panel) class(.ft)operator({)error(*)key(zoom)operator(:)float(1)operator(;)error(*)key(position)operator(:)value(relative)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(0) float(1px)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(margin)operator(:)float(0) float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.hd)operator({)key(border-bottom)operator(:)value(solid) float(1px) color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.bd)operator(,)class(.yui-skin-sam) class(.yui-panel) class(.ft)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.hd)operator({)key(padding)operator(:)float(0) float(10px)operator(;)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(2)operator(;)error(*)key(line-height)operator(:)float(1)float(.9)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(color)operator(:)color(#000)operator(;)key(background)operator(:)string value(repeat-x) float(0) float(-200px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.bd)operator({)key(padding)operator(:)float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.ft)operator({)key(border-top)operator(:)value(solid) float(1px) color(#808080)operator(;)key(padding)operator(:)float(5px) float(10px)operator(;)key(font-size)operator(:)float(77%)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.focused) class(.yui-panel) class(.hd)operator({)operator(})class(.yui-skin-sam) class(.container-close)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(5px)operator(;)key(right)operator(:)float(6px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(background)operator(:)string value(no-repeat) float(0) float(-300px)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container) class(.underlay)operator({)key(right)operator(:)float(-1px)operator(;)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.matte)operator({)key(padding)operator(:)float(9px) float(10px)operator(;)key(background-color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.shadow)operator({)key(_padding)operator(:)float(2px) float(5px) float(0) float(3px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.shadow) class(.underlay)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(2px)operator(;)key(right)operator(:)float(-3px)operator(;)key(bottom)operator(:)float(-3px)operator(;)key(left)operator(:)float(-3px)operator(;)error(*)key(top)operator(:)float(3px)operator(;)error(*)key(left)operator(:)float(-1px)operator(;)error(*)key(right)operator(:)float(-1px)operator(;)error(*)key(bottom)operator(:)float(-1px)operator(;)key(_top)operator(:)float(0)operator(;)key(_right)operator(:)float(0)operator(;)key(_bottom)operator(:)float(0)operator(;)key(_left)operator(:)float(0)operator(;)key(_margin-top)operator(:)float(3px)operator(;)key(_margin-left)operator(:)float(-1px)operator(;)key(background-color)operator(:)color(#000)operator(;)key(opacity)operator(:)float(.12)operator(;)error(*)key(filter)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft)operator({)key(border-top)operator(:)value(none)operator(;)key(padding)operator(:)float(0) float(10px) float(10px) float(10px)operator(;)key(font-size)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.button-group)operator({)key(display)operator(:)value(block)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default)operator({)key(border-color)operator(:)color(#304369)operator(;)key(background-position)operator(:)float(0) float(-1400px)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default) class(.first-child)operator({)key(border-color)operator(:)color(#304369)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default) type(button)operator({)key(color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) class(.yui-icon)operator({)key(background)operator(:)string value(no-repeat) float(0) float(0)operator(;)key(width)operator(:)float(16px)operator(;)key(height)operator(:)float(16px)operator(;)key(margin-right)operator(:)float(10px)operator(;)key(float)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.blckicon)operator({)key(background-position)operator(:)float(0) float(-1100px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.alrticon)operator({)key(background-position)operator(:)float(0) float(-1050px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.hlpicon)operator({)key(background-position)operator(:)float(0) float(-1150px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.infoicon)operator({)key(background-position)operator(:)float(0) float(-1200px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.warnicon)operator({)key(background-position)operator(:)float(0) float(-1900px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.tipicon)operator({)key(background-position)operator(:)float(0) float(-1250px)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt) class(.bd)operator({)key(position)operator(:)value(relative)operator(;)key(top)operator(:)float(0)operator(;)key(left)operator(:)float(0)operator(;)key(z-index)operator(:)float(1)operator(;)key(color)operator(:)color(#000)operator(;)key(padding)operator(:)float(2px) float(5px)operator(;)key(border-color)operator(:)color(#D4C237) color(#A6982B) color(#A6982B) color(#A6982B)operator(;)key(border-width)operator(:)float(1px)operator(;)key(border-style)operator(:)value(solid)operator(;)key(background-color)operator(:)color(#FFEE69)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt)class(.show-scrollbars) class(.bd)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt-shadow)operator({)key(top)operator(:)float(2px)operator(;)key(right)operator(:)float(-3px)operator(;)key(left)operator(:)float(-3px)operator(;)key(bottom)operator(:)float(-3px)operator(;)key(background-color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt-shadow-visible)operator({)key(opacity)operator(:)float(.12)operator(;)error(*)key(filter)operator(:)stringoperator(;)operator(}) -type(table)class(.yui-dt-table)operator({)key(table-layout)operator(:)value(fixed)operator(;)operator(})type(th) class(.yui-dt-header)operator({)key(position)operator(:)value(relative)operator(;)operator(})type(th) class(.yui-dt-label)operator({)key(position)operator(:)value(relative)operator(;)operator(})type(th) class(.yui-dt-resizer)operator({)key(position)operator(:)value(absolute)operator(;)key(margin-right)operator(:)float(-6px)operator(;)key(right)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(width)operator(:)float(6px)operator(;)key(height)operator(:)float(100%)operator(;)key(cursor)operator(:)value(w-resize)operator(;)key(cursor)operator(:)value(col-resize)operator(;)operator(})class(.yui-dt-scrollable)operator({)error(*)key(overflow-y)operator(:)value(auto)operator(;)operator(})class(.yui-dt-scrollable) type(thead)operator({)key(display)operator(:)value(block)operator(;)operator(})class(.yui-dt-scrollable) type(thead) type(tr)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-dt-scrollbody)operator({)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-dt-editor)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(9000)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-family)operator(:)value(arial)operator(;)key(font-size)operator(:)value(inherit)operator(;)key(border-collapse)operator(:)value(collapse)operator(;)key(border)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(caption)operator({)key(padding-bottom)operator(:)float(1em)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)operator(,)class(.yui-skin-sam) class(.yui-dt-table) type(th) type(a)operator({)key(font-weight)operator(:)value(normal)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(color)operator(:)color(#000)operator(;)key(vertical-align)operator(:)value(bottom)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)operator(,)class(.yui-skin-sam) class(.yui-dt-table) type(td)operator({)key(padding)operator(:)float(4px) float(10px) float(4px) float(10px)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#CBCBCB)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(td)operator({)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)class(.yui-dt-last)operator(,)class(.yui-skin-sam) class(.yui-dt-table) type(td)class(.yui-dt-last)operator({)key(border-right)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(td)operator({)key(border-right)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(thead)operator({)key(border)operator(:)float(1px) value(solid) color(#989898)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(tbody)operator({)key(border-left)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)key(border-bottom)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-loading)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-loading)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-sortable)operator({)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-sortable)operator({)key(padding-right)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-sortable) class(.yui-dt-label)operator({)key(margin-right)operator(:)float(15px)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(th)class(.yui-dt-desc)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-100px)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-asc) class(.yui-dt-header)operator({)key(background)operator(:)string value(no-repeat) value(right)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-desc) class(.yui-dt-header)operator({)key(background)operator(:)string value(no-repeat) value(right)operator(;)operator(})class(.yui-dt-editable)operator({)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-dt-editor)operator({)key(text-align)operator(:)value(left)operator(;)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(padding)operator(:)float(6px)operator(;)operator(})class(.yui-dt-editor) type(label)operator({)key(padding-left)operator(:)float(4px)operator(;)key(padding-right)operator(:)float(6px)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button)operator({)key(padding-top)operator(:)float(6px)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(border)operator(:)float(1px) value(solid) color(#999)operator(;)key(width)operator(:)float(4em)operator(;)key(height)operator(:)float(1.8em)operator(;)key(margin-left)operator(:)float(6px)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)class(.yui-dt-default)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1400px)operator(;)key(background-color)operator(:)color(#5584E0)operator(;)key(border)operator(:)float(1px) value(solid) color(#304369)operator(;)key(color)operator(:)color(#FFF)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)pseudo_class(:hover)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1300px)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)pseudo_class(:active)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1700px)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-even)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-odd)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#DBEAFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-desc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-highlighted)operator({)key(cursor)operator(:)value(pointer)operator(;)key(background-color)operator(:)color(#B2D2FF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-desc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-highlighted)operator({)key(cursor)operator(:)value(pointer)operator(;)key(background-color)operator(:)color(#B2D2FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#426FD9)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-selected)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-selected)operator({)key(background-color)operator(:)color(#446CD7)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#426FD9)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-selected)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-selected)operator({)key(background-color)operator(:)color(#446CD7)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator)operator({)key(display)operator(:)value(block)operator(;)key(margin)operator(:)float(6px) float(0)operator(;)key(white-space)operator(:)value(nowrap)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-first)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-last)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-selected)operator({)key(padding)operator(:)float(2px) float(6px)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator) type(a)class(.yui-dt-first)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) type(a)class(.yui-dt-last)operator({)key(text-decoration)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-previous)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-next)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) type(a)class(.yui-dt-page)operator({)key(border)operator(:)float(1px) value(solid) color(#CBCBCB)operator(;)key(padding)operator(:)float(2px) float(6px)operator(;)key(text-decoration)operator(:)value(none)operator(;)operator(}) -class(.yui-busy)operator({)key(cursor)operator(:)value(wait) important(!important)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-subcont)operator({)key(padding)operator(:)float(.25em) float(0)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-container-collapsed) class(.yui-toolbar-subcont)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-subcont)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) type(span)class(.yui-toolbar-draghandle)operator({)key(cursor)operator(:)value(move)operator(;)key(border-left)operator(:)float(1px) value(solid) color(#999)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#999)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(text-indent)operator(:)float(77777px)operator(;)key(width)operator(:)float(2px)operator(;)key(height)operator(:)float(20px)operator(;)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(none)operator(;)key(float)operator(:)value(left)operator(;)key(margin)operator(:)float(0) float(0) float(0) float(.2em)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-titlebar)class(.draggable)operator({)key(cursor)operator(:)value(move)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-titlebar)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(h2)operator({)key(font-weight)operator(:)value(bold)operator(;)key(letter-spacing)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(color)operator(:)color(#000)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(.2em)operator(;)operator(})class(.yui-toolbar-container)class(.yui-toolbar-grouped) type(span)class(.yui-toolbar-draghandle)operator({)key(height)operator(:)float(40px)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-group)operator({)key(float)operator(:)value(left)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-group)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-group) type(h3)operator({)key(font-size)operator(:)float(75%)operator(;)key(padding)operator(:)float(0) float(0) float(0) float(.25em)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator)operator({)key(width)operator(:)float(2px)operator(;)key(height)operator(:)float(18px)operator(;)key(margin)operator(:)float(.2em) float(0) float(.2em) float(.1em)operator(;)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(none)operator(;)key(float)operator(:)value(left)operator(;)operator(})class(.yui-toolbar-container)class(.yui-toolbar-grouped) type(span)class(.yui-toolbar-separator)operator({)key(height)operator(:)float(35px)operator(;)operator(})class(.yui-toolbar-container)class(.yui-toolbar-grouped) class(.yui-toolbar-group) type(span)class(.yui-toolbar-separator)operator({)key(height)operator(:)float(18px)operator(;)operator(})class(.yui-toolbar-container) type(ul) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(list-style-type)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) type(h3)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container) class(.yui-push-button)operator(,)class(.yui-toolbar-container) class(.yui-color-button)operator(,)class(.yui-toolbar-container) class(.yui-menu-button)operator({)key(position)operator(:)value(relative)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-toolbar-container) class(.yui-button) class(.first-child)operator(,)class(.yui-toolbar-container) class(.yui-button) class(.first-child) type(a)operator({)key(height)operator(:)float(100%)operator(;)key(width)operator(:)float(100%)operator(;)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-toolbar-container) class(.yui-button-disabled)operator({)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-toolbar-container) class(.yui-button-disabled) class(.yui-toolbar-icon)operator({)key(opacity)operator(:)float(.5)operator(;)key(filter)operator(:)stringoperator(;)operator(})class(.yui-toolbar-container) class(.yui-button-disabled) class(.up)operator(,)class(.yui-toolbar-container) class(.yui-button-disabled) class(.down)operator({)key(opacity)operator(:)float(.5)operator(;)key(filter)operator(:)stringoperator(;)operator(})class(.yui-toolbar-container) class(.yui-button) type(a)operator({)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-select) class(.first-child) type(a)operator({)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-toolbar-fontname-arial)operator({)key(font-family)operator(:)value(Arial)operator(;)operator(})class(.yui-toolbar-fontname-arial-black)operator({)key(font-family)operator(:)value(Arial) value(Black)operator(;)operator(})class(.yui-toolbar-fontname-comic-sans-ms)operator({)key(font-family)operator(:)value(Comic) value(Sans) value(MS)operator(;)operator(})class(.yui-toolbar-fontname-courier-new)operator({)key(font-family)operator(:)value(Courier) value(New)operator(;)operator(})class(.yui-toolbar-fontname-times-new-roman)operator({)key(font-family)operator(:)value(Times) value(New) value(Roman)operator(;)operator(})class(.yui-toolbar-fontname-verdana)operator({)key(font-family)operator(:)value(Verdana)operator(;)operator(})class(.yui-toolbar-fontname-impact)operator({)key(font-family)operator(:)value(Impact)operator(;)operator(})class(.yui-toolbar-fontname-lucida-console)operator({)key(font-family)operator(:)value(Lucida) value(Console)operator(;)operator(})class(.yui-toolbar-fontname-tahoma)operator({)key(font-family)operator(:)value(Tahoma)operator(;)operator(})class(.yui-toolbar-fontname-trebuchet-ms)operator({)key(font-family)operator(:)value(Trebuchet) value(MS)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-spinbutton)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child) type(a)operator({)key(z-index)operator(:)float(0)operator(;)key(opacity)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up)operator(,)class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down)operator({)key(position)operator(:)value(absolute)operator(;)key(display)operator(:)value(block) value(right)operator(:)float(0)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(z-index)operator(:)float(1)operator(;)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) class(.yui-overlay)operator({)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-toolbar-container) class(.yui-overlay) type(ul) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(list-style-type)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container)operator({)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-editor-container) class(.yui-editor-editable-container)operator({)key(position)operator(:)value(relative)operator(;)key(z-index)operator(:)float(0)operator(;)operator(})class(.yui-editor-container) class(.yui-editor-masked)operator({)key(background-color)operator(:)color(#CCC)operator(;)operator(})class(.yui-editor-container) type(iframe)operator({)key(border)operator(:)float(0px)operator(;)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-editor-container) class(.yui-editor-editable)operator({)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-editor-container) class(.dompath)operator({)key(font-size)operator(:)float(85%)operator(;)operator(})class(.yui-editor-panel) class(.hd)operator({)key(text-align)operator(:)value(left)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-editor-panel) class(.hd) type(h3)operator({)key(font-weight)operator(:)value(bold)operator(;)key(padding)operator(:)float(0.25em) float(0pt) float(0.25em) float(0.25em)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-editor-panel) class(.bd)operator({)key(width)operator(:)float(100%)operator(;)key(zoom)operator(:)float(1)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-editor-panel) class(.bd) type(div)class(.yui-editor-body-cont)operator({)key(padding)operator(:)float(.25em) float(.1em)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-editor-panel) class(.bd) type(div)class(.yui-editor-body-cont)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-editor-panel) class(.ft)operator({)key(text-align)operator(:)value(right)operator(;)key(width)operator(:)float(99%)operator(;)key(float)operator(:)value(left)operator(;)key(clear)operator(:)value(both)operator(;)operator(})class(.yui-editor-panel) class(.ft) type(span)class(.tip)operator({)key(display)operator(:)value(block)operator(;)key(position)operator(:)value(relative)operator(;)key(padding)operator(:)float(.5em) float(.5em) float(.5em) float(23px)operator(;)key(text-align)operator(:)value(left)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-editor-panel) type(label)operator({)key(clear)operator(:)value(both)operator(;)key(float)operator(:)value(left)operator(;)key(padding)operator(:)float(0)operator(;)key(width)operator(:)float(100%)operator(;)key(text-align)operator(:)value(left)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-editor-panel) class(.gecko) type(label)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-editor-panel) type(label) type(strong)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(6em)operator(;)operator(})class(.yui-editor-panel) class(.removeLink)operator({)key(width)operator(:)float(80%)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-editor-panel) type(label) type(input)operator({)key(margin-left)operator(:)float(.25em)operator(;)key(float)operator(:)value(left)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-group-padding)operator({)operator(})class(.yui-editor-panel) class(.yui-toolbar-group-border)operator({)operator(})class(.yui-editor-panel) class(.yui-toolbar-group-textflow)operator({)operator(})class(.yui-editor-panel) class(.height-width)operator({)key(float)operator(:)value(left)operator(;)operator(})class(.yui-editor-panel) class(.height-width) type(h3)operator({)operator(})class(.yui-editor-panel) class(.height-width) type(span)operator({)key(font-style)operator(:)value(italic)operator(;)key(display)operator(:)value(block)operator(;)key(float)operator(:)value(left)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-editor-panel) class(.height-width) type(span)class(.info)operator({)key(font-size)operator(:)float(70%)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize)operator(,)class(.yui-editor-panel) class(.yui-toolbar-bordertype)operator({)key(font-size)operator(:)float(75%)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator)operator({)key(border)operator(:)value(none)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)operator(,)class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)operator({)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(8px)operator(;)key(left)operator(:)float(4px)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(3px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(width)operator(:)float(24px)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-solid)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-dotted)operator({)key(border-bottom)operator(:)float(1px) value(dotted) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-dashed)operator({)key(border-bottom)operator(:)float(1px) value(dashed) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-0)operator({)error(*)key(top)operator(:)float(0px)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-1)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-2)operator({)key(border-bottom)operator(:)float(2px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-3)operator({)key(top)operator(:)float(2px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(border-bottom)operator(:)float(3px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-4)operator({)key(top)operator(:)float(1px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(border-bottom)operator(:)float(4px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-5)operator({)key(top)operator(:)float(1px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(border-bottom)operator(:)float(5px) value(solid) value(black)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-bordersize-menu)operator(,)class(.yui-toolbar-container) class(.yui-toolbar-bordertype-menu)operator({)key(width)operator(:)float(95px) important(!important)operator(;)operator(})class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel)operator(,)class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel)operator(,)class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel)operator(,)class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel)pseudo_class(:hover)operator({)key(margin)operator(:)float(0px) float(3px) float(7px) float(17px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel) class(.checkedindicator)operator(,)class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel) class(.checkedindicator)operator({)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(-12px)operator(;)error(*)key(top)operator(:)float(14px)operator(;)error(*)key(left)operator(:)float(0px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-1) type(a)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-2) type(a)operator({)key(border-bottom)operator(:)float(2px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-3) type(a)operator({)key(border-bottom)operator(:)float(3px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-4) type(a)operator({)key(border-bottom)operator(:)float(4px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-5) type(a)operator({)key(border-bottom)operator(:)float(5px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-solid) type(a)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-dashed) type(a)operator({)key(border-bottom)operator(:)float(1px) value(dashed) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-dotted) type(a)operator({)key(border-bottom)operator(:)float(1px) value(dotted) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})type(h2)class(.yui-editor-skipheader)operator(,)type(h3)class(.yui-editor-skipheader)operator({)key(height)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(width)operator(:)float(0)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-toolbar-colors)operator({)key(width)operator(:)float(133px)operator(;)key(zoom)operator(:)float(1)operator(;)key(display)operator(:)value(none)operator(;)key(z-index)operator(:)float(100)operator(;)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-toolbar-colors)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-colors) type(a)operator({)key(height)operator(:)float(9px)operator(;)key(width)operator(:)float(9px)operator(;)key(float)operator(:)value(left)operator(;)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(text-indent)operator(:)float(999px)operator(;)key(margin)operator(:)float(0)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(border)operator(:)float(1px) value(solid) color(#F6F7EE)operator(;)operator(})class(.yui-toolbar-colors) type(a)pseudo_class(:hover)operator({)key(border)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-color-button-menu)operator({)key(overflow)operator(:)value(visible)operator(;)key(background-color)operator(:)value(transparent)operator(;)operator(})class(.yui-toolbar-colors) type(span)operator({)key(position)operator(:)value(relative)operator(;)key(display)operator(:)value(block)operator(;)key(padding)operator(:)float(3px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(100%)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-colors) type(span)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-colors) type(span) type(em)operator({)key(height)operator(:)float(35px)operator(;)key(width)operator(:)float(30px)operator(;)key(float)operator(:)value(left)operator(;)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(text-indent)operator(:)float(999px)operator(;)key(margin)operator(:)float(0.75px)operator(;)key(border)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-toolbar-colors) type(span) type(strong)operator({)key(font-weight)operator(:)value(normal)operator(;)key(padding-left)operator(:)float(3px)operator(;)key(display)operator(:)value(block)operator(;)key(font-size)operator(:)float(85%)operator(;)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(65%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container)operator({)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-200px)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(h2)operator({)key(color)operator(:)color(#000000)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0.3em) float(1em)operator(;)key(font-size)operator(:)float(100%)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-group) type(h3)operator({)key(color)operator(:)color(#808080)operator(;)key(font-size)operator(:)float(75%)operator(;)key(margin)operator(:)float(1em) float(0) float(0)operator(;)key(padding-bottom)operator(:)float(0)operator(;)key(padding-left)operator(:)float(0.25em)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator)operator({)key(border)operator(:)value(none)operator(;)key(text-indent)operator(:)float(33px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(margin)operator(:)float(.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-subcont)operator({)key(padding)operator(:)float(0) float(1em) float(0.35em)operator(;)key(border-bottom)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container-collapsed) class(.yui-toolbar-titlebar)operator({)key(border-bottom)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) class(.visible) class(.yui-menu-shadow)operator(,)class(.yui-skin-sam) class(.yui-editor-panel) class(.visible) class(.yui-menu-shadow)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) type(ul)operator({)key(list-style-type)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) type(ul) type(li)operator({)key(list-style-type)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-group) type(ul) type(li)class(.yui-toolbar-groupitem)operator({)key(float)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) class(.dompath)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border-top)operator(:)float(1px) value(solid) color(#808080)operator(;)key(color)operator(:)color(#999)operator(;)key(text-align)operator(:)value(left)operator(;)key(padding)operator(:)float(0.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.collapse)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-400px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(span)class(.collapse)operator({)key(cursor)operator(:)value(pointer)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(4px)operator(;)key(right)operator(:)float(2px)operator(;)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(height)operator(:)float(15px)operator(;)key(width)operator(:)float(15px)operator(;)key(text-indent)operator(:)float(9999px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(position)operator(:)value(relative)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(22px)operator(;)key(width)operator(:)float(30px)operator(;)key(margin)operator(:)float(0)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(1px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) type(a)operator({)key(padding-left)operator(:)float(35px)operator(;)key(height)operator(:)float(20px)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(2)operator(;)key(display)operator(:)value(block)operator(;)key(color)operator(:)color(#000000)operator(;)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) class(.first-child)operator({)key(border-color)operator(:)color(#808080)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(0) float(1px)operator(;)key(margin)operator(:)float(0) float(-1px)operator(;)key(display)operator(:)value(block)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled) class(.first-child)operator({)key(border-color)operator(:)color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled) type(a)operator({)key(color)operator(:)color(#A6A6A6)operator(;)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled)operator({)key(border-color)operator(:)color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button) class(.first-child)operator({)error(*)key(left)operator(:)float(0px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-fontname)operator({)key(width)operator(:)float(135px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-heading)operator({)key(width)operator(:)float(92px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-hover)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1300px)operator(;)key(border-color)operator(:)color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-selected)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1700px)operator(;)key(border-color)operator(:)color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) type(h3)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) class(.yui-toolbar-group)operator({)key(margin-top)operator(:)float(.75em)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) type(span)class(.yui-toolbar-icon)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) type(span)class(.yui-toolbar-icon)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) type(span)class(.yui-toolbar-icon)operator({)key(display)operator(:)value(block)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(2px)operator(;)key(height)operator(:)float(18px)operator(;)key(width)operator(:)float(18px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(background)operator(:)string value(no-repeat) float(30px) float(30px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-selected) type(span)class(.yui-toolbar-icon)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-hover) type(span)class(.yui-toolbar-icon)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.visible) class(.yuimenuitemlabel)operator({)key(cursor)operator(:)value(pointer)operator(;)key(color)operator(:)color(#000)operator(;)error(*)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-menu)operator({)key(background-color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) type(div)class(.yuimenu) type(li)class(.selected)operator({)key(background-color)operator(:)color(#B3D4FF)operator(;)operator(})class(.yui-skin-sam) type(div)class(.yuimenu) type(li)class(.selected) type(a)class(.selected)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-bold) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(0)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-italic) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-36px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-underline) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-72px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-subscript) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-180px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-superscript) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-144px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-forecolor) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-216px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-backcolor) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-288px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyleft) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-324px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifycenter) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-360px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyright) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-396px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyfull) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-432px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-indent) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-720px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-outdent) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-684px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-createlink) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-792px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertimage) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(1px) float(-756px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-left) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-972px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-right) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-936px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-inline) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-900px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-block) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-864px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-bordercolor) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-252px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-removeformat) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-1080px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-hiddenelements) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-1044px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertunorderedlist) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-468px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertorderedlist) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-504px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child)operator({)key(width)operator(:)float(35px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child) type(a)operator({)key(padding-left)operator(:)float(2px)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(span)class(.yui-toolbar-icon)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down)operator({)key(right)operator(:)float(2px)operator(;)key(background)operator(:)string value(no-repeat) float(0) float(-1222px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(height)operator(:)float(6px)operator(;)key(width)operator(:)float(7px)operator(;)key(min-height)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up)operator({)key(top)operator(:)float(2px)operator(;)key(background-position)operator(:)float(0) float(-1222px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down)operator({)key(bottom)operator(:)float(2px)operator(;)key(background-position)operator(:)float(0) float(-1187px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-select) class(.first-child) type(a)operator({)key(padding-left)operator(:)float(5px)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-select) type(span)class(.yui-toolbar-icon)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-1144px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(right)operator(:)float(-2px)operator(;)key(top)operator(:)float(0px)operator(;)key(height)operator(:)float(20px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-color-button-menu) class(.bd)operator({)key(background-color)operator(:)value(transparent)operator(;)key(border)operator(:)value(none)operator(;)key(width)operator(:)float(135px)operator(;)operator(})class(.yui-skin-sam) class(.yui-color-button-menu) class(.yui-toolbar-colors)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel)operator({)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(background-color)operator(:)value(transparent)operator(;)key(overflow)operator(:)value(visible)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd)operator({)key(margin)operator(:)float(10px) float(0) float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(h3)operator({)key(color)operator(:)color(#000)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(background)operator(:)string value(repeat-x) float(0) float(-200px)operator(;)key(width)operator(:)float(99%)operator(;)key(position)operator(:)value(relative)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(3px) float(0) float(0) float(0)operator(;)key(font-size)operator(:)float(93%)operator(;)key(text-indent)operator(:)float(5px)operator(;)key(height)operator(:)float(20px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.bd)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border-left)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#808080)operator(;)key(width)operator(:)float(99%)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(overflow)operator(:)value(visible)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(ul)operator({)key(list-style-type)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(ul) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yuimenu)operator({)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container) class(.yui-toolbar-subcont)operator({)key(padding)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(margin-top)operator(:)float(0.35em)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-bordersize)operator(,)class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-bordertype)operator({)key(width)operator(:)float(50px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label)operator({)key(display)operator(:)value(block)operator(;)key(float)operator(:)value(none)operator(;)key(padding)operator(:)float(4px) float(0)operator(;)key(margin-bottom)operator(:)float(7px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(strong)operator({)key(font-weight)operator(:)value(normal)operator(;)key(font-size)operator(:)float(93%)operator(;)key(text-align)operator(:)value(right)operator(;)key(padding-top)operator(:)float(2px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(input)operator({)key(width)operator(:)float(75%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) constant(#createlink_target)operator(,)class(.yui-skin-sam) class(.yui-editor-panel) constant(#insertimage_target)operator({)key(width)operator(:)value(auto)operator(;)key(margin-right)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.removeLink)operator({)key(width)operator(:)float(98%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(input)class(.warning)operator({)key(background-color)operator(:)color(#FFEE69)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group) type(h3)operator({)key(color)operator(:)color(#000)operator(;)key(float)operator(:)value(left)operator(;)key(font-weight)operator(:)value(normal)operator(;)key(font-size)operator(:)float(93%)operator(;)key(margin)operator(:)float(5px) float(0) float(0) float(0)operator(;)key(padding)operator(:)float(0) float(3px) float(0) float(0)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.height-width) type(h3)operator({)key(margin)operator(:)float(3px) float(0) float(0) float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.height-width)operator({)key(margin)operator(:)float(3px) float(0) float(0) float(35px)operator(;)error(*)key(margin-left)operator(:)float(14px)operator(;)key(width)operator(:)float(42%)operator(;)error(*)key(width)operator(:)float(44%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-border)operator({)key(width)operator(:)float(190px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-padding)operator({)key(width)operator(:)float(203px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-padding) type(h3)operator({)key(margin-left)operator(:)float(25px)operator(;)error(*)key(margin-left)operator(:)float(12px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-textflow)operator({)key(width)operator(:)float(182px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd)operator({)key(background)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-top)operator(:)value(none)operator(;)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0) float(0) float(2px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(span)class(.close)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-300px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(16px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(position)operator(:)value(absolute)operator(;)key(right)operator(:)float(5px)operator(;)key(text-indent)operator(:)float(500px)operator(;)key(top)operator(:)float(2px)operator(;)key(width)operator(:)float(26px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)key(border-top)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(strong)operator({)key(display)operator(:)value(block)operator(;)key(float)operator(:)value(left)operator(;)key(margin)operator(:)float(0) float(2px) float(8px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-1260px)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(20px)operator(;)key(left)operator(:)float(2px)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(8px)operator(;)key(width)operator(:)float(20px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon-info)operator({)key(background-position)operator(:)float(2px) float(-1260px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon-warn)operator({)key(background-position)operator(:)float(2px) float(-1296px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(span)class(.knob)operator({)key(position)operator(:)value(absolute)operator(;)key(height)operator(:)float(10px)operator(;)key(width)operator(:)float(28px)operator(;)key(top)operator(:)float(-10px)operator(;)key(left)operator(:)float(25px)operator(;)key(text-indent)operator(:)float(9999px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(background)operator(:)string value(no-repeat) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(100%)operator(;)key(background-image)operator(:)value(none)operator(;)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container) class(.bd)operator({)key(background-color)operator(:)color(#ffffff)operator(;)operator(})class(.yui-editor-blankimage)operator({)key(background-image)operator(:)stringoperator(;)operator(}) -class(.yui-skin-sam) class(.yui-log)operator({)key(padding)operator(:)float(1em)operator(;)key(width)operator(:)float(31em)operator(;)key(background-color)operator(:)color(#AAA)operator(;)key(color)operator(:)color(#000)operator(;)key(border)operator(:)float(1px) value(solid) value(black)operator(;)key(font-family)operator(:)value(monospace)operator(;)key(font-size)operator(:)float(77%)operator(;)key(text-align)operator(:)value(left)operator(;)key(z-index)operator(:)float(9000)operator(;)operator(})class(.yui-skin-sam) class(.yui-log-container)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(1em)operator(;)key(right)operator(:)float(1em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(input)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-family)operator(:)value(arial)operator(;)key(font-size)operator(:)float(100%)operator(;)key(font-weight)operator(:)value(normal)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-btns)operator({)key(position)operator(:)value(relative)operator(;)key(float)operator(:)value(right)operator(;)key(bottom)operator(:)float(.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-hd)operator({)key(margin-top)operator(:)float(1em)operator(;)key(padding)operator(:)float(.5em)operator(;)key(background-color)operator(:)color(#575757)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-hd) type(h4)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-size)operator(:)float(108%)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-bd)operator({)key(width)operator(:)float(100%)operator(;)key(height)operator(:)float(20em)operator(;)key(background-color)operator(:)color(#FFF)operator(;)key(border)operator(:)float(1px) value(solid) value(gray)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(p)operator({)key(margin)operator(:)float(1px)operator(;)key(padding)operator(:)float(.1em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(pre)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(pre)class(.yui-log-verbose)operator({)key(white-space)operator(:)value(pre-wrap)operator(;)key(white-space)operator(:)value(-moz-pre-wrap) important(!important)operator(;)key(white-space)operator(:)value(-pre-wrap)operator(;)key(white-space)operator(:)value(-o-pre-wrap)operator(;)key(word-wrap)operator(:)value(break-word)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft)operator({)key(margin-top)operator(:)float(.5em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft) class(.yui-log-categoryfilters)operator({)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft) class(.yui-log-sourcefilters)operator({)key(width)operator(:)float(100%)operator(;)key(border-top)operator(:)float(1px) value(solid) color(#575757)operator(;)key(margin-top)operator(:)float(.75em)operator(;)key(padding-top)operator(:)float(.75em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-filtergrp)operator({)key(margin-right)operator(:)float(.5em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.info)operator({)key(background-color)operator(:)color(#A7CC25)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.warn)operator({)key(background-color)operator(:)color(#F58516)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.error)operator({)key(background-color)operator(:)color(#E32F0B)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.time)operator({)key(background-color)operator(:)color(#A6C9D7)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.window)operator({)key(background-color)operator(:)color(#F2E886)operator(;)operator(}) -class(.yuimenu) class(.yuimenu)operator(,)class(.yuimenubar) class(.yuimenu)operator({)key(position)operator(:)value(absolute)operator(;)key(visibility)operator(:)value(hidden)operator(;)operator(})class(.yuimenubar) type(li)operator(,)class(.yuimenu) type(li)operator({)key(list-style-type)operator(:)value(none)operator(;)operator(})class(.yuimenubar) type(ul)operator(,)class(.yuimenu) type(ul)operator(,)class(.yuimenubar) type(li)operator(,)class(.yuimenu) type(li)operator(,)class(.yuimenu) type(h6)operator(,)class(.yuimenubar) type(h6)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yuimenuitemlabel)operator(,)class(.yuimenubaritemlabel)operator({)key(white-space)operator(:)value(nowrap)operator(;)operator(})class(.yui-menu-shadow)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(-1)operator(;)operator(})class(.hide-scrollbars) type(*)operator({)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.hide-scrollbars) type(select)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yuimenu)class(.show-scrollbars)operator({)key(overflow)operator(:)value(visible)operator(;)operator(})class(.yuimenu)class(.hide-scrollbars) class(.yui-menu-shadow)operator({)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yuimenu)class(.show-scrollbars) class(.yui-menu-shadow)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubar)operator({)key(border)operator(:)value(solid) float(1px) color(#808080)operator(;)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubar) class(.bd)operator(,)class(.yui-skin-sam) class(.yuimenubar) type(ul)operator({)error(*)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubar)operator(>)class(.bd)operator(>)type(ul)pseudo_class(:after)operator({)key(content)operator(:)stringoperator(;)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(height)operator(:)float(0)operator(;)key(line-height)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubaritem)operator({)key(float)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenubaritem)operator({)key(border-right)operator(:)value(solid) float(1px) color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubaritemlabel)operator({)key(display)operator(:)value(block)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(2)operator(;)error(*)key(line-height)operator(:)float(1)float(.9)operator(;)key(padding)operator(:)float(0) float(10px)operator(;)key(color)operator(:)color(#000)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(outline)operator(:)value(none)operator(;)key(cursor)operator(:)value(default)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(border-width)operator(:)float(1px) float(0)operator(;)key(position)operator(:)value(relative)operator(;)key(margin)operator(:)float(-1px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenubaritemlabel)operator({)key(padding-right)operator(:)float(20px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubaritemlabel) class(.submenuindicator)operator({)key(width)operator(:)float(1px)operator(;)key(height)operator(:)float(1px)operator(;)key(top)operator(:)float(0)operator(;)key(left)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenubaritemlabel) class(.submenuindicator)operator({)key(top)operator(:)float(50%)operator(;)key(right)operator(:)float(8px)operator(;)key(left)operator(:)value(auto)operator(;)key(margin-top)operator(:)float(-3px)operator(;)key(height)operator(:)float(4px)operator(;)key(width)operator(:)float(7px)operator(;)key(text-indent)operator(:)float(8px)operator(;)key(background-position)operator(:)float(-16px) float(-856px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubaritem) type(a)class(.selected)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1700px)operator(;)key(border-color)operator(:)color(#7D98B8)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenubaritem) type(a)class(.selected)operator({)key(border-left-width)operator(:)float(1px)operator(;)key(margin-left)operator(:)float(-1px)operator(;)error(*)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubar) type(a)class(.selected) class(.submenuindicator)operator({)key(background)operator(:)value(transparent)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) type(a)class(.selected) class(.submenuindicator)operator({)key(background)operator(:)string value(repeat-x) float(-16px) float(-856px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubaritem) type(a)class(.disabled)operator({)key(cursor)operator(:)value(default)operator(;)key(color)operator(:)color(#A6A6A6)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenubaritem) type(a)class(.disabled) class(.submenuindicator)operator({)key(background-position)operator(:)float(-16px) float(-881px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.bd)operator({)key(border)operator(:)value(solid) float(1px) color(#808080)operator(;)key(background-color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) type(ul)operator({)key(padding)operator(:)float(3px) float(0)operator(;)key(border-width)operator(:)float(1px) float(0) float(0) float(0)operator(;)key(border-color)operator(:)color(#ccc)operator(;)key(border-style)operator(:)value(solid)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) type(ul)class(.first-of-type)operator({)key(border-width)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) type(h6)operator({)key(font-size)operator(:)float(93%)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(line-height)operator(:)float(1)float(.5)operator(;)error(*)key(line-height)operator(:)float(1)float(.45)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-color)operator(:)color(#ccc)operator(;)key(border-width)operator(:)float(1px) float(0) float(0) float(0)operator(;)key(color)operator(:)color(#a4a4a4)operator(;)key(padding)operator(:)float(3px) float(10px) float(0) float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) type(ul)class(.hastitle)operator(,)class(.yui-skin-sam) class(.yuimenu) type(h6)class(.first-of-type)operator({)key(border-width)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.yui-menu-body-scrolled)operator({)key(border-color)operator(:)color(#ccc) color(#808080)operator(;)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.topscrollbar)operator(,)class(.yui-skin-sam) class(.yuimenu) class(.bottomscrollbar)operator({)key(height)operator(:)float(16px)operator(;)key(border)operator(:)value(solid) float(1px) color(#808080)operator(;)key(background)operator(:)color(#fff) string value(no-repeat) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.topscrollbar)operator({)key(border-bottom-width)operator(:)float(0)operator(;)key(background-position)operator(:)value(center) float(-950px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.topscrollbar_disabled)operator({)key(background-position)operator(:)value(center) float(-975px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.bottomscrollbar)operator({)key(border-top-width)operator(:)float(0)operator(;)key(background-position)operator(:)value(center) float(-850px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenu) class(.bottomscrollbar_disabled)operator({)key(background-position)operator(:)value(center) float(-875px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel)operator({)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(1)float(.5)operator(;)error(*)key(line-height)operator(:)float(1)float(.45)operator(;)key(padding)operator(:)float(0) float(20px)operator(;)key(display)operator(:)value(block)operator(;)key(color)operator(:)color(#000)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(outline)operator(:)value(none)operator(;)key(position)operator(:)value(relative)operator(;)error(*)key(position)operator(:)value(static)operator(;)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel) class(.helptext)operator({)key(font-style)operator(:)value(normal)operator(;)key(display)operator(:)value(block)operator(;)key(margin)operator(:)float(-1.5em) float(0) float(0) float(10em)operator(;)error(*)key(margin-top)operator(:)float(-1.45em)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel) class(.submenuindicator)operator(,)class(.yui-skin-sam) class(.yuimenuitemlabel) class(.checkedindicator)operator(,)class(.yui-skin-sam) class(.yuimenubaritemlabel) class(.submenuindicator)operator({)key(position)operator(:)value(absolute)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(background)operator(:)string value(no-repeat)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel) class(.submenuindicator)operator(,)class(.yui-skin-sam) class(.yuimenuitemlabel) class(.checkedindicator)operator({)error(*)key(position)operator(:)value(static)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel) class(.submenuindicator)operator({)key(top)operator(:)float(50%)operator(;)key(right)operator(:)float(8px)operator(;)key(margin-top)operator(:)float(-3px)operator(;)key(height)operator(:)float(7px)operator(;)key(width)operator(:)float(4px)operator(;)key(text-indent)operator(:)float(5px)operator(;)key(background-position)operator(:)float(0) float(-906px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitemlabel) class(.checkedindicator)operator({)key(top)operator(:)float(50%)operator(;)key(left)operator(:)float(8px)operator(;)key(margin-top)operator(:)float(-3px)operator(;)key(height)operator(:)float(7px)operator(;)key(width)operator(:)float(7px)operator(;)key(text-indent)operator(:)float(8px)operator(;)key(background-position)operator(:)float(0) float(-1006px)operator(;)operator(})class(.yui-skin-sam) class(.visible) class(.yuimenuitemlabel) class(.submenuindicator)operator({)error(*)key(float)operator(:)value(right)operator(;)error(*)key(margin)operator(:)float(-1em) float(8px) float(0) float(8px)operator(;)operator(})class(.yui-skin-sam) class(.visible) class(.yuimenuitem) class(.hassubmenu)operator({)error(*)key(padding-right)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.visible) class(.yuimenuitemlabel) class(.checkedindicator)operator({)error(*)key(float)operator(:)value(left)operator(;)error(*)key(margin)operator(:)float(-1em) float(0) float(0) float(-12px)operator(;)operator(})class(.yui-skin-sam) class(.yui-menu-shadow-visible)operator({)key(top)operator(:)float(2px)operator(;)key(right)operator(:)float(-3px)operator(;)key(left)operator(:)float(-3px)operator(;)key(bottom)operator(:)float(-3px)operator(;)key(background-color)operator(:)color(#000)operator(;)key(opacity)operator(:)float(.12)operator(;)error(*)key(filter)operator(:)stringoperator(;)key(visibility)operator(:)value(visible)operator(;)operator(})class(.yui-skin-sam) class(.visible) class(.bd)operator(,)class(.yui-skin-sam) class(.visible) class(.yuimenuitem)operator({)key(_zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.visible) class(.yuimenuitemlabel)operator({)error(*)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitem) type(a)class(.selected)operator({)key(background)operator(:)color(#B3D4FF)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubar) class(.yuimenuitem) type(a)class(.selected) class(.submenuindicator)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-906px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenubarnav) class(.yuimenuitem) type(a)class(.selected)operator({)key(border-width)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)error(*)key(left)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitem) type(a)class(.disabled)operator({)key(cursor)operator(:)value(default)operator(;)key(color)operator(:)color(#A6A6A6)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitem) type(a)class(.disabled) class(.submenuindicator)operator({)key(background-position)operator(:)float(0) float(-931px)operator(;)operator(})class(.yui-skin-sam) class(.yuimenuitem) type(a)class(.disabled) class(.checkedindicator)operator({)key(background-position)operator(:)float(0) float(-1031px)operator(;)operator(}) -class(.yui-navset) class(.yui-nav) type(li)operator(,)class(.yui-navset) class(.yui-navset-top) class(.yui-nav) type(li)operator(,)class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) type(li)operator({)key(margin)operator(:)float(0) float(0.5em) float(0) float(0)operator(;)operator(})class(.yui-navset-left) class(.yui-nav) type(li)operator(,)class(.yui-navset-right) class(.yui-nav) type(li)operator({)key(margin)operator(:)float(0) float(0) float(0.5em)operator(;)operator(})class(.yui-navset) class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-navset) class(.yui-navset-right) class(.yui-nav)operator(,)class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-navset-right) class(.yui-nav)operator({)key(width)operator(:)float(6em)operator(;)operator(})class(.yui-navset-top) class(.yui-nav)operator(,)class(.yui-navset-bottom) class(.yui-nav)operator({)key(width)operator(:)value(auto)operator(;)operator(})class(.yui-navset) class(.yui-navset-left)operator(,)class(.yui-navset-left)operator({)key(padding)operator(:)float(0) float(0) float(0) float(6em)operator(;)operator(})class(.yui-navset-right)operator({)key(padding)operator(:)float(0) float(6em) float(0) float(0)operator(;)operator(})class(.yui-navset-top)operator(,)class(.yui-navset-bottom)operator({)key(padding)operator(:)value(auto)operator(;)operator(})class(.yui-nav)operator(,)class(.yui-nav) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(list-style)operator(:)value(none)operator(;)operator(})class(.yui-navset) type(li) type(em)operator({)key(font-style)operator(:)value(normal)operator(;)operator(})class(.yui-navset)operator({)key(position)operator(:)value(relative)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-navset) class(.yui-content)operator({)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-navset) class(.yui-nav) type(li)operator(,)class(.yui-navset) class(.yui-navset-top) class(.yui-nav) type(li)operator(,)class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) type(li)operator({)key(display)operator(:)value(inline-block)operator(;)key(display)operator(:)value(-moz-inline-stack)operator(;)error(*)key(display)operator(:)value(inline)operator(;)key(vertical-align)operator(:)value(bottom)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-navset-left) class(.yui-nav) type(li)operator(,)class(.yui-navset-right) class(.yui-nav) type(li)operator({)key(display)operator(:)value(block)operator(;)operator(})class(.yui-navset) class(.yui-nav) type(a)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-navset) class(.yui-nav) type(li) type(a)operator(,)class(.yui-navset-top) class(.yui-nav) type(li) type(a)operator(,)class(.yui-navset-bottom) class(.yui-nav) type(li) type(a)operator({)key(display)operator(:)value(block)operator(;)key(display)operator(:)value(inline-block)operator(;)key(vertical-align)operator(:)value(bottom)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-navset-left) class(.yui-nav) type(li) type(a)operator(,)class(.yui-navset-right) class(.yui-nav) type(li) type(a)operator({)key(display)operator(:)value(block)operator(;)operator(})class(.yui-navset-bottom) class(.yui-nav) type(li) type(a)operator({)key(vertical-align)operator(:)value(text-top)operator(;)operator(})class(.yui-navset) class(.yui-nav) type(li) type(a) type(em)operator(,)class(.yui-navset-top) class(.yui-nav) type(li) type(a) type(em)operator(,)class(.yui-navset-bottom) class(.yui-nav) type(li) type(a) type(em)operator({)key(display)operator(:)value(block)operator(;)operator(})class(.yui-navset) class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-navset) class(.yui-navset-right) class(.yui-nav)operator(,)class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-navset-right) class(.yui-nav)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-navset-top) class(.yui-nav)operator(,)class(.yui-navset-bottom) class(.yui-nav)operator({)key(position)operator(:)value(static)operator(;)operator(})class(.yui-navset) class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-navset-left) class(.yui-nav)operator({)key(left)operator(:)float(0)operator(;)key(right)operator(:)value(auto)operator(;)operator(})class(.yui-navset) class(.yui-navset-right) class(.yui-nav)operator(,)class(.yui-navset-right) class(.yui-nav)operator({)key(right)operator(:)float(0)operator(;)key(left)operator(:)value(auto)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-nav)operator({)key(border)operator(:)value(solid) color(#2647a0)operator(;)key(border-width)operator(:)float(0) float(0) float(5px)operator(;)key(Xposition)operator(:)value(relative)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) type(li)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-nav) type(li)operator({)key(margin)operator(:)float(0) float(0.16em) float(0) float(0)operator(;)key(padding)operator(:)float(1px) float(0) float(0)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-nav) class(.selected)operator({)key(margin)operator(:)float(0) float(0.16em) float(-1px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-nav) type(a)operator({)key(background)operator(:)color(#d8d8d8) string value(repeat-x)operator(;)key(border)operator(:)value(solid) color(#a3a3a3)operator(;)key(border-width)operator(:)float(0) float(1px)operator(;)key(color)operator(:)color(#000)operator(;)key(position)operator(:)value(relative)operator(;)key(text-decoration)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) type(a) type(em)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-nav) type(a) type(em)operator({)key(border)operator(:)value(solid) color(#a3a3a3)operator(;)key(border-width)operator(:)float(1px) float(0) float(0)operator(;)key(cursor)operator(:)value(hand)operator(;)key(padding)operator(:)float(0.25em) float(.75em)operator(;)key(left)operator(:)float(0)operator(;)key(right)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(top)operator(:)float(-1px)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a)pseudo_class(:focus)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a)pseudo_class(:hover)operator({)key(background)operator(:)color(#2647a0) string value(repeat-x) value(left) float(-1400px)operator(;)key(color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) type(a)pseudo_class(:hover)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) type(a)pseudo_class(:focus)operator({)key(background)operator(:)color(#bfdaff) string value(repeat-x) value(left) float(-1300px)operator(;)key(outline)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a) type(em)operator({)key(padding)operator(:)float(0.35em) float(0.75em)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a) type(em)operator({)key(border-color)operator(:)color(#243356)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-content)operator({)key(background)operator(:)color(#edf5ff)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-content)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-content)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-top-color)operator(:)color(#243356)operator(;)key(padding)operator(:)float(0.25em) float(0.5em)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-right) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav)operator({)key(border-width)operator(:)float(0) float(5px) float(0) float(0)operator(;)key(Xposition)operator(:)value(absolute)operator(;)key(top)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-right) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav)operator({)key(border-width)operator(:)float(0) float(0) float(0) float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) type(li)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-left) class(.yui-nav) type(li)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(li)operator({)key(margin)operator(:)float(0) float(0) float(0.16em)operator(;)key(padding)operator(:)float(0) float(0) float(0) float(1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(li)operator({)key(padding)operator(:)float(0) float(1px) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) class(.selected)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-left) class(.yui-nav) class(.selected)operator({)key(margin)operator(:)float(0) float(-1px) float(0.16em) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) class(.selected)operator({)key(margin)operator(:)float(0) float(0) float(0.16em) float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(a)operator({)key(border-width)operator(:)float(1px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) type(a) type(em)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-left) class(.yui-nav) type(a) type(em)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(a) type(em)operator({)key(border-width)operator(:)float(0) float(0) float(0) float(1px)operator(;)key(padding)operator(:)float(0.2em) float(.75em)operator(;)key(top)operator(:)value(auto)operator(;)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(a) type(em)operator({)key(border-width)operator(:)float(0) float(1px) float(0) float(0)operator(;)key(left)operator(:)value(auto)operator(;)key(right)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) class(.selected) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) type(a)pseudo_class(:hover)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) class(.selected) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(a)pseudo_class(:hover)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) class(.selected) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) type(a)pseudo_class(:hover)operator({)key(background-image)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-content)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-left-color)operator(:)color(#243356)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav)operator({)key(border-width)operator(:)float(5px) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) class(.selected)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) class(.selected)operator({)key(margin)operator(:)float(-1px) float(0.16em) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) type(li)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) type(li)operator({)key(padding)operator(:)float(0) float(0) float(1px) float(0)operator(;)key(vertical-align)operator(:)value(top)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) type(li) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) type(li) type(a)operator({)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) type(a) type(em)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) type(a) type(em)operator({)key(border-width)operator(:)float(0) float(0) float(1px)operator(;)key(top)operator(:)value(auto)operator(;)key(bottom)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-content)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-content)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-bottom-color)operator(:)color(#243356)operator(;)operator(}) -class(.ygtvtn)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(background)operator(:)string float(0) float(-5600px) value(no-repeat)operator(;)operator(})class(.ygtvtm)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-4000px) value(no-repeat)operator(;)operator(})class(.ygtvtmh)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-4800px) value(no-repeat)operator(;)operator(})class(.ygtvtp)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-6400px) value(no-repeat)operator(;)operator(})class(.ygtvtph)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-7200px) value(no-repeat)operator(;)operator(})class(.ygtvln)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(background)operator(:)string float(0) float(-1600px) value(no-repeat)operator(;)operator(})class(.ygtvlm)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(0px) value(no-repeat)operator(;)operator(})class(.ygtvlmh)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-800px) value(no-repeat)operator(;)operator(})class(.ygtvlp)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-2400px) value(no-repeat)operator(;)operator(})class(.ygtvlph)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-3200px) value(no-repeat)operator(;)operator(})class(.ygtvloading)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(background)operator(:)string float(0) float(0) value(no-repeat)operator(;)operator(})class(.ygtvdepthcell)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(background)operator(:)string float(0) float(-8000px) value(no-repeat)operator(;)operator(})class(.ygtvblankdepthcell)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)operator(})class(.ygtvitem)operator({)operator(})class(.ygtvchildren)operator({)error(*)key(zoom)operator(:)float(1)operator(;)operator(})class(.ygtvlabel)operator(,)class(.ygtvlabel)pseudo_class(:link)operator(,)class(.ygtvlabel)pseudo_class(:visited)operator(,)class(.ygtvlabel)pseudo_class(:hover)operator({)key(margin-left)operator(:)float(2px)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(background-color)operator(:)value(white)operator(;)operator(})class(.ygtvspacer)operator({)key(height)operator(:)float(22px)operator(;)key(width)operator(:)float(18px)operator(;)operator(}) - -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-navset) class(.yui-nav) type(li)operator(,)class(.yui-navset) class(.yui-navset-top) class(.yui-nav) type(li)operator(,)class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) type(li)operator({)key(margin)operator(:)float(0) float(0.5em) float(0) float(0)operator(;)operator(})class(.yui-navset-left) class(.yui-nav) type(li)operator(,)class(.yui-navset-right) class(.yui-nav) type(li)operator({)key(margin)operator(:)float(0) float(0) float(0.5em)operator(;)operator(})class(.yui-navset) class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-navset) class(.yui-navset-right) class(.yui-nav)operator(,)class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-navset-right) class(.yui-nav)operator({)key(width)operator(:)float(6em)operator(;)operator(})class(.yui-navset-top) class(.yui-nav)operator(,)class(.yui-navset-bottom) class(.yui-nav)operator({)key(width)operator(:)value(auto)operator(;)operator(})class(.yui-navset) class(.yui-navset-left)operator(,)class(.yui-navset-left)operator({)key(padding)operator(:)float(0) float(0) float(0) float(6em)operator(;)operator(})class(.yui-navset-right)operator({)key(padding)operator(:)float(0) float(6em) float(0) float(0)operator(;)operator(})class(.yui-navset-top)operator(,)class(.yui-navset-bottom)operator({)key(padding)operator(:)value(auto)operator(;)operator(})class(.yui-nav)operator(,)class(.yui-nav) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(list-style)operator(:)value(none)operator(;)operator(})class(.yui-navset) type(li) type(em)operator({)key(font-style)operator(:)value(normal)operator(;)operator(})class(.yui-navset)operator({)key(position)operator(:)value(relative)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-navset) class(.yui-content)operator({)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-navset) class(.yui-nav) type(li)operator(,)class(.yui-navset) class(.yui-navset-top) class(.yui-nav) type(li)operator(,)class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) type(li)operator({)key(display)operator(:)value(inline-block)operator(;)key(display)operator(:)value(-moz-inline-stack)operator(;)error(*)key(display)operator(:)value(inline)operator(;)key(vertical-align)operator(:)value(bottom)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-navset-left) class(.yui-nav) type(li)operator(,)class(.yui-navset-right) class(.yui-nav) type(li)operator({)key(display)operator(:)value(block)operator(;)operator(})class(.yui-navset) class(.yui-nav) type(a)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-navset) class(.yui-nav) type(li) type(a)operator(,)class(.yui-navset-top) class(.yui-nav) type(li) type(a)operator(,)class(.yui-navset-bottom) class(.yui-nav) type(li) type(a)operator({)key(display)operator(:)value(block)operator(;)key(display)operator(:)value(inline-block)operator(;)key(vertical-align)operator(:)value(bottom)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-navset-left) class(.yui-nav) type(li) type(a)operator(,)class(.yui-navset-right) class(.yui-nav) type(li) type(a)operator({)key(display)operator(:)value(block)operator(;)operator(})class(.yui-navset-bottom) class(.yui-nav) type(li) type(a)operator({)key(vertical-align)operator(:)value(text-top)operator(;)operator(})class(.yui-navset) class(.yui-nav) type(li) type(a) type(em)operator(,)class(.yui-navset-top) class(.yui-nav) type(li) type(a) type(em)operator(,)class(.yui-navset-bottom) class(.yui-nav) type(li) type(a) type(em)operator({)key(display)operator(:)value(block)operator(;)operator(})class(.yui-navset) class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-navset) class(.yui-navset-right) class(.yui-nav)operator(,)class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-navset-right) class(.yui-nav)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-navset-top) class(.yui-nav)operator(,)class(.yui-navset-bottom) class(.yui-nav)operator({)key(position)operator(:)value(static)operator(;)operator(})class(.yui-navset) class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-navset-left) class(.yui-nav)operator({)key(left)operator(:)float(0)operator(;)key(right)operator(:)value(auto)operator(;)operator(})class(.yui-navset) class(.yui-navset-right) class(.yui-nav)operator(,)class(.yui-navset-right) class(.yui-nav)operator({)key(right)operator(:)float(0)operator(;)key(left)operator(:)value(auto)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-nav)operator({)key(border)operator(:)value(solid) color(#2647a0)operator(;)key(border-width)operator(:)float(0) float(0) float(5px)operator(;)key(Xposition)operator(:)value(relative)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) type(li)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-nav) type(li)operator({)key(margin)operator(:)float(0) float(0.16em) float(0) float(0)operator(;)key(padding)operator(:)float(1px) float(0) float(0)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-nav) class(.selected)operator({)key(margin)operator(:)float(0) float(0.16em) float(-1px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-nav) type(a)operator({)key(background)operator(:)color(#d8d8d8) string value(repeat-x)operator(;)key(border)operator(:)value(solid) color(#a3a3a3)operator(;)key(border-width)operator(:)float(0) float(1px)operator(;)key(color)operator(:)color(#000)operator(;)key(position)operator(:)value(relative)operator(;)key(text-decoration)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) type(a) type(em)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-nav) type(a) type(em)operator({)key(border)operator(:)value(solid) color(#a3a3a3)operator(;)key(border-width)operator(:)float(1px) float(0) float(0)operator(;)key(cursor)operator(:)value(hand)operator(;)key(padding)operator(:)float(0.25em) float(.75em)operator(;)key(left)operator(:)float(0)operator(;)key(right)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(top)operator(:)float(-1px)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a)pseudo_class(:focus)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a)pseudo_class(:hover)operator({)key(background)operator(:)color(#2647a0) string value(repeat-x) value(left) float(-1400px)operator(;)key(color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) type(a)pseudo_class(:hover)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) type(a)pseudo_class(:focus)operator({)key(background)operator(:)color(#bfdaff) string value(repeat-x) value(left) float(-1300px)operator(;)key(outline)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a) type(em)operator({)key(padding)operator(:)float(0.35em) float(0.75em)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-nav) class(.selected) type(a) type(em)operator({)key(border-color)operator(:)color(#243356)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-content)operator({)key(background)operator(:)color(#edf5ff)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-content)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-top) class(.yui-content)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-top-color)operator(:)color(#243356)operator(;)key(padding)operator(:)float(0.25em) float(0.5em)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-left) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-right) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav)operator({)key(border-width)operator(:)float(0) float(5px) float(0) float(0)operator(;)key(Xposition)operator(:)value(absolute)operator(;)key(top)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-right) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav)operator({)key(border-width)operator(:)float(0) float(0) float(0) float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) type(li)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-left) class(.yui-nav) type(li)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(li)operator({)key(margin)operator(:)float(0) float(0) float(0.16em)operator(;)key(padding)operator(:)float(0) float(0) float(0) float(1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(li)operator({)key(padding)operator(:)float(0) float(1px) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) class(.selected)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-left) class(.yui-nav) class(.selected)operator({)key(margin)operator(:)float(0) float(-1px) float(0.16em) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) class(.selected)operator({)key(margin)operator(:)float(0) float(0) float(0.16em) float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(a)operator({)key(border-width)operator(:)float(1px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) type(a) type(em)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-left) class(.yui-nav) type(a) type(em)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(a) type(em)operator({)key(border-width)operator(:)float(0) float(0) float(0) float(1px)operator(;)key(padding)operator(:)float(0.2em) float(.75em)operator(;)key(top)operator(:)value(auto)operator(;)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(a) type(em)operator({)key(border-width)operator(:)float(0) float(1px) float(0) float(0)operator(;)key(left)operator(:)value(auto)operator(;)key(right)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) class(.selected) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-left) class(.yui-nav) type(a)pseudo_class(:hover)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) class(.selected) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-right) class(.yui-nav) type(a)pseudo_class(:hover)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) class(.selected) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) type(a)pseudo_class(:hover)operator({)key(background-image)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-left) class(.yui-content)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-left-color)operator(:)color(#243356)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav)operator({)key(border-width)operator(:)float(5px) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) class(.selected)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) class(.selected)operator({)key(margin)operator(:)float(-1px) float(0.16em) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) type(li)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) type(li)operator({)key(padding)operator(:)float(0) float(0) float(1px) float(0)operator(;)key(vertical-align)operator(:)value(top)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) type(li) type(a)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) type(li) type(a)operator({)operator(})class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-nav) type(a) type(em)operator(,)class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-nav) type(a) type(em)operator({)key(border-width)operator(:)float(0) float(0) float(1px)operator(;)key(top)operator(:)value(auto)operator(;)key(bottom)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-navset-bottom) class(.yui-content)operator(,)class(.yui-skin-sam) class(.yui-navset) class(.yui-navset-bottom) class(.yui-content)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-bottom-color)operator(:)color(#243356)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.ygtvtn)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(background)operator(:)string float(0) float(-5600px) value(no-repeat)operator(;)operator(})class(.ygtvtm)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-4000px) value(no-repeat)operator(;)operator(})class(.ygtvtmh)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-4800px) value(no-repeat)operator(;)operator(})class(.ygtvtp)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-6400px) value(no-repeat)operator(;)operator(})class(.ygtvtph)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-7200px) value(no-repeat)operator(;)operator(})class(.ygtvln)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(background)operator(:)string float(0) float(-1600px) value(no-repeat)operator(;)operator(})class(.ygtvlm)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(0px) value(no-repeat)operator(;)operator(})class(.ygtvlmh)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-800px) value(no-repeat)operator(;)operator(})class(.ygtvlp)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-2400px) value(no-repeat)operator(;)operator(})class(.ygtvlph)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(background)operator(:)string float(0) float(-3200px) value(no-repeat)operator(;)operator(})class(.ygtvloading)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(background)operator(:)string float(0) float(0) value(no-repeat)operator(;)operator(})class(.ygtvdepthcell)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)key(background)operator(:)string float(0) float(-8000px) value(no-repeat)operator(;)operator(})class(.ygtvblankdepthcell)operator({)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(22px)operator(;)operator(})class(.ygtvitem)operator({)operator(})class(.ygtvchildren)operator({)error(*)key(zoom)operator(:)float(1)operator(;)operator(})class(.ygtvlabel)operator(,)class(.ygtvlabel)pseudo_class(:link)operator(,)class(.ygtvlabel)pseudo_class(:visited)operator(,)class(.ygtvlabel)pseudo_class(:hover)operator({)key(margin-left)operator(:)float(2px)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(background-color)operator(:)value(white)operator(;)operator(})class(.ygtvspacer)operator({)key(height)operator(:)float(22px)operator(;)key(width)operator(:)float(18px)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) - -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(This) comment(file) comment(intentionally) comment(left) comment(blank) comment(*/) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(styles) comment(for) comment(entire) comment(widget) comment(*/) -class(.yui-skin-sam) class(.yui-ac) operator({) - key(position)operator(:)value(relative)operator(;)key(font-family)operator(:)value(arial)operator(;)key(font-size)operator(:)float(100%)operator(;) -operator(}) - -comment(/*) comment(styles) comment(for) comment(input) comment(field) comment(*/) -class(.yui-skin-sam) class(.yui-ac-input) operator({) - key(position)operator(:)value(absolute)operator(;)key(width)operator(:)float(100%)operator(;) -operator(}) - -comment(/*) comment(styles) comment(for) comment(results) comment(container) comment(*/) -class(.yui-skin-sam) class(.yui-ac-container) operator({) - key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(1.6em)operator(;)key(width)operator(:)float(100%)operator(;) -operator(}) - -comment(/*) comment(styles) comment(for) comment(header/body/footer) comment(wrapper) comment(within) comment(container) comment(*/) -class(.yui-skin-sam) class(.yui-ac-content) operator({) - key(position)operator(:)value(absolute)operator(;)key(width)operator(:)float(100%)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(background)operator(:)color(#fff)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(z-index)operator(:)float(9050)operator(;) -operator(}) - -comment(/*) comment(styles) comment(for) comment(container) comment(shadow) comment(*/) -class(.yui-skin-sam) class(.yui-ac-shadow) operator({) - key(position)operator(:)value(absolute)operator(;)key(margin)operator(:)float(.3em)operator(;)key(width)operator(:)float(100%)operator(;)key(background)operator(:)color(#000)operator(;)key(-moz-opacity)operator(:) float(0)float(.10)operator(;)key(opacity)operator(:)float(.10)operator(;)key(filter)operator(:)stringoperator(;)key(z-index)operator(:)float(9049)operator(;) -operator(}) - -comment(/*) comment(styles) comment(for) comment(results) comment(list) comment(*/) -class(.yui-skin-sam) class(.yui-ac-content) type(ul)operator({) - key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(width)operator(:)float(100%)operator(;) -operator(}) - -comment(/*) comment(styles) comment(for) comment(result) comment(item) comment(*/) -class(.yui-skin-sam) class(.yui-ac-content) type(li) operator({) - key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(2px) float(5px)operator(;)key(cursor)operator(:)value(default)operator(;)key(white-space)operator(:)value(nowrap)operator(;) -operator(}) - -comment(/*) comment(styles) comment(for) comment(prehighlighted) comment(result) comment(item) comment(*/) -class(.yui-skin-sam) class(.yui-ac-content) type(li)class(.yui-ac-prehighlight) operator({) - key(background)operator(:)color(#B3D4FF)operator(;) -operator(}) - -comment(/*) comment(styles) comment(for) comment(highlighted) comment(result) comment(item) comment(*/) -class(.yui-skin-sam) class(.yui-ac-content) type(li)class(.yui-ac-highlight) operator({) - key(background)operator(:)color(#426FD9)operator(;)key(color)operator(:)color(#FFF)operator(;) -operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-skin-sam) class(.yui-ac)operator({)key(position)operator(:)value(relative)operator(;)key(font-family)operator(:)value(arial)operator(;)key(font-size)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-input)operator({)key(position)operator(:)value(absolute)operator(;)key(width)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-container)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(1.6em)operator(;)key(width)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content)operator({)key(position)operator(:)value(absolute)operator(;)key(width)operator(:)float(100%)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(background)operator(:)color(#fff)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(z-index)operator(:)float(9050)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-shadow)operator({)key(position)operator(:)value(absolute)operator(;)key(margin)operator(:)float(.3em)operator(;)key(width)operator(:)float(100%)operator(;)key(background)operator(:)color(#000)operator(;)key(-moz-opacity)operator(:)float(0)float(.10)operator(;)key(opacity)operator(:)float(.10)operator(;)key(filter)operator(:)stringoperator(;)key(z-index)operator(:)float(9049)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(ul)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(width)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(2px) float(5px)operator(;)key(cursor)operator(:)value(default)operator(;)key(white-space)operator(:)value(nowrap)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(li)class(.yui-ac-prehighlight)operator({)key(background)operator(:)color(#B3D4FF)operator(;)operator(})class(.yui-skin-sam) class(.yui-ac-content) type(li)class(.yui-ac-highlight)operator({)key(background)operator(:)color(#426FD9)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -type(h1)operator({)key(font-size)operator(:)float(138.5%)operator(;)operator(})type(h2)operator({)key(font-size)operator(:)float(123.1%)operator(;)operator(})type(h3)operator({)key(font-size)operator(:)float(108%)operator(;)operator(})type(h1)operator(,)type(h2)operator(,)type(h3)operator({)key(margin)operator(:)float(1em) float(0)operator(;)operator(})type(h1)operator(,)type(h2)operator(,)type(h3)operator(,)type(h4)operator(,)type(h5)operator(,)type(h6)operator(,)type(strong)operator({)key(font-weight)operator(:)value(bold)operator(;)operator(})type(abbr)operator(,)type(acronym)operator({)key(border-bottom)operator(:)float(1px) value(dotted) color(#000)operator(;)key(cursor)operator(:)value(help)operator(;)operator(})type(em)operator({)key(font-style)operator(:)value(italic)operator(;)operator(})type(blockquote)operator(,)type(ul)operator(,)type(ol)operator(,)type(dl)operator({)key(margin)operator(:)float(1em)operator(;)operator(})type(ol)operator(,)type(ul)operator(,)type(dl)operator({)key(margin-left)operator(:)float(2em)operator(;)operator(})type(ol) type(li)operator({)key(list-style)operator(:) value(decimal) value(outside)operator(;)operator(})type(ul) type(li)operator({)key(list-style)operator(:) value(disc) value(outside)operator(;)operator(})type(dl) type(dd)operator({)key(margin-left)operator(:)float(1em)operator(;)operator(})type(th)operator(,)type(td) operator({)key(border)operator(:)float(1px) value(solid) color(#000)operator(;)key(padding)operator(:)float(.5em)operator(;)operator(})type(th) operator({)key(font-weight)operator(:)value(bold)operator(;)key(text-align)operator(:)value(center)operator(;)operator(})type(caption) operator({)key(margin-bottom)operator(:)float(.5em)operator(;)key(text-align)operator(:)value(center)operator(;)operator(})type(p)operator(,)type(fieldset)operator(,)type(table) operator({)key(margin-bottom)operator(:)float(1em)operator(;)operator(})comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(base.css,) comment(part) comment(of) comment(YUI's) comment(CSS) comment(Foundation) comment(*/) -type(h1) operator({) - comment(/*)comment(18px) comment(via) comment(YUI) comment(Fonts) comment(CSS) comment(foundation)comment(*/) - key(font-size)operator(:)float(138.5%)operator(;) -operator(}) -type(h2) operator({) - comment(/*)comment(16px) comment(via) comment(YUI) comment(Fonts) comment(CSS) comment(foundation)comment(*/) - key(font-size)operator(:)float(123.1%)operator(;) -operator(}) -type(h3) operator({) - comment(/*)comment(14px) comment(via) comment(YUI) comment(Fonts) comment(CSS) comment(foundation)comment(*/) - key(font-size)operator(:)float(108%)operator(;) -operator(}) -type(h1)operator(,)type(h2)operator(,)type(h3) operator({) - comment(/*) comment(top) comment(&) comment(bottom) comment(margin) comment(based) comment(on) comment(font) comment(size) comment(*/) - key(margin)operator(:)float(1em) float(0)operator(;) -operator(}) -type(h1)operator(,)type(h2)operator(,)type(h3)operator(,)type(h4)operator(,)type(h5)operator(,)type(h6)operator(,)type(strong) operator({) - comment(/*)comment(bringing) comment(boldness) comment(back) comment(to) comment(headers) comment(and) comment(the) comment(strong) comment(element)comment(*/) - key(font-weight)operator(:)value(bold)operator(;) -operator(}) -type(abbr)operator(,)type(acronym) operator({) - comment(/*)comment(indicating) comment(to) comment(users) comment(that) comment(more) comment(info) comment(is) comment(available) comment(*/) - key(border-bottom)operator(:)float(1px) value(dotted) color(#000)operator(;) - key(cursor)operator(:)value(help)operator(;) -operator(}) -type(em) operator({) - comment(/*)comment(bringing) comment(italics) comment(back) comment(to) comment(the) comment(em) comment(element)comment(*/) - key(font-style)operator(:)value(italic)operator(;) -operator(}) -type(blockquote)operator(,)type(ul)operator(,)type(ol)operator(,)type(dl) operator({) - comment(/*)comment(giving) comment(blockquotes) comment(and) comment(lists) comment(room) comment(to) comment(breath)comment(*/) - key(margin)operator(:)float(1em)operator(;) -operator(}) -type(ol)operator(,)type(ul)operator(,)type(dl) operator({) - comment(/*)comment(bringing) comment(lists) comment(on) comment(to) comment(the) comment(page) comment(with) comment(breathing) comment(room) comment(*/) - key(margin-left)operator(:)float(2em)operator(;) -operator(}) -type(ol) type(li) operator({) - comment(/*)comment(giving) comment(OL's) comment(LIs) comment(generated) comment(numbers)comment(*/) - key(list-style)operator(:) value(decimal) value(outside)operator(;) -operator(}) -type(ul) type(li) operator({) - comment(/*)comment(giving) comment(UL's) comment(LIs) comment(generated) comment(disc) comment(markers)comment(*/) - key(list-style)operator(:) value(disc) value(outside)operator(;) -operator(}) -type(dl) type(dd) operator({) - comment(/*)comment(giving) comment(UL's) comment(LIs) comment(generated) comment(numbers)comment(*/) - key(margin-left)operator(:)float(1em)operator(;) -operator(}) -type(th)operator(,)type(td) operator({) - comment(/*)comment(borders) comment(and) comment(padding) comment(to) comment(make) comment(the) comment(table) comment(readable)comment(*/) - key(border)operator(:)float(1px) value(solid) color(#000)operator(;) - key(padding)operator(:)float(.5em)operator(;) -operator(}) -type(th) operator({) - comment(/*)comment(distinguishing) comment(table) comment(headers) comment(from) comment(data) comment(cells)comment(*/) - key(font-weight)operator(:)value(bold)operator(;) - key(text-align)operator(:)value(center)operator(;) -operator(}) -type(caption) operator({) - comment(/*)comment(coordinated) comment(marking) comment(to) comment(match) comment(cell's) comment(padding)comment(*/) - key(margin-bottom)operator(:)float(.5em)operator(;) - comment(/*)comment(centered) comment(so) comment(it) comment(doesn't) comment(blend) comment(in) comment(to) comment(other) comment(content)comment(*/) - key(text-align)operator(:)value(center)operator(;) -operator(}) -type(p)operator(,)type(fieldset)operator(,)type(table) operator({) - comment(/*)comment(so) comment(things) comment(don't) comment(run) comment(into) comment(each) comment(other)comment(*/) - key(margin-bottom)operator(:)float(1em)operator(;) -operator(})comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-skin-sam) class(.yui-button) operator({) - - key(display)operator(:) value(-moz-inline-box)operator(;) comment(/*) comment(Gecko) comment(*/) - key(display)operator(:) value(inline-block)operator(;) comment(/*) comment(IE,) comment(Opera) comment(and) comment(Safari) comment(*/) - -operator(}) - -class(.yui-skin-sam) class(.yui-button) class(.first-child) operator({) - - key(display)operator(:) value(block)operator(;) - error(*)key(display)operator(:) value(inline-block)operator(;) comment(/*) comment(IE) comment(*/) - -operator(}) - -class(.yui-skin-sam) class(.yui-button) type(button)operator(,) -class(.yui-skin-sam) class(.yui-button) type(a) operator({) - - key(display)operator(:) value(block)operator(;) - error(*)key(display)operator(:) value(inline-block)operator(;) comment(/*) comment(IE) comment(*/) - key(border)operator(:) value(none)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button) type(button) operator({) - - key(background-color)operator(:) value(transparent)operator(;) - error(*)key(overflow)operator(:) value(visible)operator(;) comment(/*) comment(Remove) comment(superfluous) comment(padding) comment(for) comment(IE) comment(*/) - key(cursor)operator(:) value(pointer)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button) type(a) operator({) - - key(text-decoration)operator(:) value(none)operator(;) - -operator(})comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-skin-sam) class(.yui-button) operator({) - - key(border-width)operator(:) float(1px) float(0)operator(;) - key(border-style)operator(:) value(solid)operator(;) - key(border-color)operator(:) color(#808080)operator(;) - key(background)operator(:) string value(repeat-x) float(0) float(0)operator(;) - key(margin)operator(:) value(auto) float(.25em)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button) class(.first-child) operator({) - - key(border-width)operator(:) float(0) float(1px)operator(;) - key(border-style)operator(:) value(solid)operator(;) - key(border-color)operator(:) color(#808080)operator(;) - key(margin)operator(:) float(0) float(-1px)operator(;) - error(*)key(position)operator(:) value(relative)operator(;) - error(*)key(left)operator(:) float(-1px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button) type(button)operator(,) -class(.yui-skin-sam) class(.yui-button) type(a) operator({) - - key(padding)operator(:) float(0) float(10px)operator(;) - key(font-size)operator(:) float(93%)operator(;) comment(/*) comment(12px) comment(*/) - key(line-height)operator(:) float(2)operator(;) comment(/*) comment(~24px) comment(*/) - error(*)key(line-height)operator(:) float(1)float(.7)operator(;) comment(/*) comment(For) comment(IE) comment(*/) - key(min-height)operator(:) float(2em)operator(;) comment(/*) comment(For) comment(Gecko) comment(*/) - error(*)key(min-height)operator(:) value(auto)operator(;) comment(/*) comment(For) comment(IE) comment(*/) - key(color)operator(:) color(#000)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-split-button) type(button)operator(,) -class(.yui-skin-sam) class(.yui-menu-button) type(button) operator({) - - key(padding-right)operator(:) float(20px)operator(;) - key(background-position)operator(:) value(right) value(center)operator(;) - key(background-repeat)operator(:) value(no-repeat)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-menu-button) type(button) operator({) - - key(background-image)operator(:) stringoperator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-split-button) type(button) operator({) - - key(background-image)operator(:) stringoperator(;) - -operator(}) - - -comment(/*) comment(Focus) comment(state) comment(*/) - - -class(.yui-skin-sam) class(.yui-button-focus) operator({) - - key(border-color)operator(:) color(#7D98B8)operator(;) - key(background-position)operator(:) float(0) float(-1300px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button-focus) class(.first-child) operator({) - - key(border-color)operator(:) color(#7D98B8)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button-focus) type(button)operator(,) -class(.yui-skin-sam) class(.yui-button-focus) type(a) operator({) - - key(color)operator(:) color(#000)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-split-button-focus) type(button) operator({) - - key(background-image)operator(:) stringoperator(;) - -operator(}) - - -comment(/*) comment(Hover) comment(state) comment(*/) - -class(.yui-skin-sam) class(.yui-button-hover) operator({) - - key(border-color)operator(:) color(#7D98B8)operator(;) - key(background-position)operator(:) float(0) float(-1300px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button-hover) class(.first-child) operator({) - - key(border-color)operator(:) color(#7D98B8)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button-hover) type(button)operator(,) -class(.yui-skin-sam) class(.yui-button-hover) type(a) operator({) - - key(color)operator(:) color(#000)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-split-button-hover) type(button) operator({) - - key(background-image)operator(:) stringoperator(;) - -operator(}) - - -comment(/*) comment(Active) comment(state) comment(*/) - -class(.yui-skin-sam) class(.yui-button-active) operator({) - - key(border-color)operator(:) color(#7D98B8)operator(;) - key(background-position)operator(:) float(0) float(-1700px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button-active) class(.first-child) operator({) - - key(border-color)operator(:) color(#7D98B8)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button-active) type(button)operator(,) -class(.yui-skin-sam) class(.yui-button-active) type(a) operator({) - - key(color)operator(:) color(#000)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-split-button-activeoption) operator({) - - key(border-color)operator(:) color(#808080)operator(;) - key(background-position)operator(:) float(0) float(0)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-split-button-activeoption) class(.first-child) operator({) - - key(border-color)operator(:) color(#808080)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-split-button-activeoption) type(button) operator({) - - key(background-image)operator(:) stringoperator(;) - -operator(}) - - -comment(/*) comment(Checked) comment(state) comment(*/) - -class(.yui-skin-sam) class(.yui-radio-button-checked)operator(,) -class(.yui-skin-sam) class(.yui-checkbox-button-checked) operator({) - - key(border-color)operator(:) color(#304369)operator(;) - key(background-position)operator(:) float(0) float(-1400px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-radio-button-checked) class(.first-child)operator(,) -class(.yui-skin-sam) class(.yui-checkbox-button-checked) class(.first-child) operator({) - - key(border-color)operator(:) color(#304369)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-radio-button-checked) type(button)operator(,) -class(.yui-skin-sam) class(.yui-checkbox-button-checked) type(button) operator({) - - key(color)operator(:) color(#fff)operator(;) - -operator(}) - - -comment(/*) comment(Disabled) comment(state) comment(*/) - -class(.yui-skin-sam) class(.yui-button-disabled) operator({) - - key(border-color)operator(:) color(#ccc)operator(;) - key(background-position)operator(:) float(0) float(-1500px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button-disabled) class(.first-child) operator({) - - key(border-color)operator(:) color(#ccc)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-button-disabled) type(button)operator(,) -class(.yui-skin-sam) class(.yui-button-disabled) type(a) operator({) - - key(color)operator(:) color(#A6A6A6)operator(;) - key(cursor)operator(:) value(default)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-menu-button-disabled) type(button) operator({) - - key(background-image)operator(:) stringoperator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-split-button-disabled) type(button) operator({) - - key(background-image)operator(:) stringoperator(;) - -operator(})comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-skin-sam) class(.yui-button)operator({)key(display)operator(:)value(-moz-inline-box)operator(;)key(display)operator(:)value(inline-block)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) class(.first-child)operator({)key(display)operator(:)value(block)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(button)operator(,)class(.yui-skin-sam) class(.yui-button) type(a)operator({)key(display)operator(:)value(block)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(button)operator({)key(background-color)operator(:)value(transparent)operator(;)error(*)key(overflow)operator(:)value(visible)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(a)operator({)key(text-decoration)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-button)operator({)key(border-width)operator(:)float(1px) float(0)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(margin)operator(:)value(auto) float(.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) class(.first-child)operator({)key(border-width)operator(:)float(0) float(1px)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(margin)operator(:)float(0) float(-1px)operator(;)error(*)key(position)operator(:)value(relative)operator(;)error(*)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button) type(button)operator(,)class(.yui-skin-sam) class(.yui-button) type(a)operator({)key(padding)operator(:)float(0) float(10px)operator(;)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(2)operator(;)error(*)key(line-height)operator(:)float(1)float(.7)operator(;)key(min-height)operator(:)float(2em)operator(;)error(*)key(min-height)operator(:)value(auto)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button) type(button)operator(,)class(.yui-skin-sam) class(.yui-menu-button) type(button)operator({)key(padding-right)operator(:)float(20px)operator(;)key(background-position)operator(:)value(right) value(center)operator(;)key(background-repeat)operator(:)value(no-repeat)operator(;)operator(})class(.yui-skin-sam) class(.yui-menu-button) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-split-button) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-button-focus)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)key(background-position)operator(:)float(0) float(-1300px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-focus) class(.first-child)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-focus) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-focus) type(a)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-focus) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-button-hover)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)key(background-position)operator(:)float(0) float(-1300px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-hover) class(.first-child)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-hover) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-hover) type(a)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-hover) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-button-active)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)key(background-position)operator(:)float(0) float(-1700px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-active) class(.first-child)operator({)key(border-color)operator(:)color(#7D98B8)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-active) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-active) type(a)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-activeoption)operator({)key(border-color)operator(:)color(#808080)operator(;)key(background-position)operator(:)float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-activeoption) class(.first-child)operator({)key(border-color)operator(:)color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-activeoption) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-radio-button-checked)operator(,)class(.yui-skin-sam) class(.yui-checkbox-button-checked)operator({)key(border-color)operator(:)color(#304369)operator(;)key(background-position)operator(:)float(0) float(-1400px)operator(;)operator(})class(.yui-skin-sam) class(.yui-radio-button-checked) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-checkbox-button-checked) class(.first-child)operator({)key(border-color)operator(:)color(#304369)operator(;)operator(})class(.yui-skin-sam) class(.yui-radio-button-checked) type(button)operator(,)class(.yui-skin-sam) class(.yui-checkbox-button-checked) type(button)operator({)key(color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-disabled)operator({)key(border-color)operator(:)color(#ccc)operator(;)key(background-position)operator(:)float(0) float(-1500px)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-disabled) class(.first-child)operator({)key(border-color)operator(:)color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-button-disabled) type(button)operator(,)class(.yui-skin-sam) class(.yui-button-disabled) type(a)operator({)key(color)operator(:)color(#A6A6A6)operator(;)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-skin-sam) class(.yui-menu-button-disabled) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-split-button-disabled) type(button)operator({)key(background-image)operator(:)stringoperator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*)comment(*) - comment(*) comment(CORE) - comment(*) - comment(*) comment(This) comment(is) comment(the) comment(set) comment(of) comment(CSS) comment(rules) comment(required) comment(by) comment(Calendar) comment(to) comment(drive) comment(core) comment(functionality) comment(and) comment(structure.) - comment(*) comment(Changes) comment(to) comment(these) comment(rules) comment(may) comment(result) comment(in) comment(the) comment(Calendar) comment(not) comment(functioning) comment(or) comment(rendering) comment(correctly.) - comment(*) - comment(*) comment(They) comment(should) comment(not) comment(be) comment(modified) comment(for) comment(skinning.) - comment(*)comment(*/) - -comment(/*) comment(CALENDAR) comment(BOUNDING) comment(BOX) comment(*/) -class(.yui-calcontainer) operator({) - key(position)operator(:)value(relative)operator(;) - key(float)operator(:)value(left)operator(;) - key(_overflow)operator(:)value(hidden)operator(;) comment(/*) comment(IE6) comment(only,) comment(to) comment(clip) comment(iframe) comment(shim) comment(*/) -operator(}) - -comment(/*) comment(IFRAME) comment(SHIM) comment(*/) -class(.yui-calcontainer) type(iframe) operator({) - key(position)operator(:)value(absolute)operator(;) - key(border)operator(:)value(none)operator(;) - key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;) - key(z-index)operator(:)float(0)operator(;) - key(width)operator(:)float(100%)operator(;) - key(height)operator(:)float(100%)operator(;) - key(left)operator(:)float(0px)operator(;) - key(top)operator(:)float(0px)operator(;) -operator(}) - -comment(/*) comment(IFRAME) comment(SHIM) comment(IE6) comment(only) comment(*/) -class(.yui-calcontainer) type(iframe)class(.fixedsize) operator({) - key(width)operator(:)float(50em)operator(;) - key(height)operator(:)float(50em)operator(;) - key(top)operator(:)float(-1px)operator(;) - key(left)operator(:)float(-1px)operator(;) -operator(}) - -comment(/*) comment(BOUNDING) comment(BOX) comment(FOR) comment(EACH) comment(CALENDAR) comment(GROUP) comment(PAGE) comment(*/) -class(.yui-calcontainer)class(.multi) class(.groupcal) operator({) - key(z-index)operator(:)float(1)operator(;) - key(float)operator(:)value(left)operator(;) - key(position)operator(:)value(relative)operator(;) -operator(}) - -comment(/*) comment(TITLE) comment(BAR) comment(*/) -class(.yui-calcontainer) class(.title) operator({) - key(position)operator(:)value(relative)operator(;) - key(z-index)operator(:)float(1)operator(;) -operator(}) - -comment(/*) comment(CLOSE) comment(ICON) comment(CONTAINER) comment(*/) -class(.yui-calcontainer) class(.close-icon) operator({) - key(position)operator(:)value(absolute)operator(;) - key(z-index)operator(:)float(1)operator(;) -operator(}) - -comment(/*) comment(CALENDAR) comment(TABLE) comment(*/) -class(.yui-calendar) operator({) - key(position)operator(:)value(relative)operator(;) -operator(}) - -comment(/*) comment(NAVBAR) comment(LEFT) comment(ARROW) comment(CONTAINER) comment(*/) -class(.yui-calendar) class(.calnavleft) operator({) - key(position)operator(:)value(absolute)operator(;) - key(z-index)operator(:)float(1)operator(;) -operator(}) - -comment(/*) comment(NAVBAR) comment(RIGHT) comment(ARROW) comment(CONTAINER) comment(*/) -class(.yui-calendar) class(.calnavright) operator({) - key(position)operator(:)value(absolute)operator(;) - key(z-index)operator(:)float(1)operator(;) -operator(}) - -comment(/*) comment(NAVBAR) comment(TEXT) comment(CONTAINER) comment(*/) -class(.yui-calendar) class(.calheader) operator({) - key(position)operator(:)value(relative)operator(;) - key(width)operator(:)float(100%)operator(;) - key(text-align)operator(:)value(center)operator(;) -operator(}) - -comment(/*) comment(Specific) comment(changes) comment(for) comment(calendar) comment(running) comment(under) comment(fonts/reset) comment(*/) -class(.yui-calendar) class(.calbody) type(a)pseudo_class(:hover) operator({)key(background)operator(:)value(inherit)operator(;)operator(}) -type(p)constant(#clear) operator({)key(clear)operator(:)value(left)operator(;) key(padding-top)operator(:)float(10px)operator(;)operator(})comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-calcontainer) operator({) - key(position)operator(:)value(relative)operator(;) - key(padding)operator(:)float(5px)operator(;) - key(background-color)operator(:)color(#F7F9FB)operator(;) - key(border)operator(:)float(1px) value(solid) color(#7B9EBD)operator(;) - key(float)operator(:)value(left)operator(;) - key(_overflow)operator(:)value(hidden)operator(;) comment(/*) comment(IE6) comment(only,) comment(to) comment(clip) comment(iframe) comment(shim) comment(*/) -operator(}) - -class(.yui-calcontainer) type(iframe) operator({) - key(position)operator(:)value(absolute)operator(;) - key(border)operator(:)value(none)operator(;) - key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;) - key(z-index)operator(:)float(0)operator(;) - key(width)operator(:)float(100%)operator(;) - key(height)operator(:)float(100%)operator(;) - key(left)operator(:)float(0px)operator(;) - key(top)operator(:)float(0px)operator(;) -operator(}) - -comment(/*) comment(IE6) comment(only) comment(*/) -class(.yui-calcontainer) type(iframe)class(.fixedsize) operator({) - key(width)operator(:)float(50em)operator(;) - key(height)operator(:)float(50em)operator(;) - key(top)operator(:)float(-1px)operator(;) - key(left)operator(:)float(-1px)operator(;) -operator(}) - -class(.yui-calcontainer)class(.multi) operator({) - key(padding)operator(:)float(0)operator(;) -operator(}) - -class(.yui-calcontainer)class(.multi) class(.groupcal) operator({) - key(padding)operator(:)float(5px)operator(;) - key(background-color)operator(:)value(transparent)operator(;) - key(z-index)operator(:)float(1)operator(;) - key(float)operator(:)value(left)operator(;) - key(position)operator(:)value(relative)operator(;) - key(border)operator(:)value(none)operator(;) -operator(}) - -class(.yui-calcontainer) class(.title) operator({) - key(font)operator(:)float(100%) value(sans-serif)operator(;) - key(color)operator(:)color(#000)operator(;) - key(font-weight)operator(:)value(bold)operator(;) - key(margin-bottom)operator(:)float(5px)operator(;) - key(height)operator(:)float(25px)operator(;) - key(position)operator(:)value(absolute)operator(;) - key(top)operator(:)float(3px)operator(;)key(left)operator(:)float(5px)operator(;) - key(z-index)operator(:)float(1)operator(;) -operator(}) - -class(.yui-calcontainer) class(.close-icon) operator({) - key(position)operator(:)value(absolute)operator(;) - key(right)operator(:)float(3px)operator(;) - key(top)operator(:)float(3px)operator(;) - key(border)operator(:)value(none)operator(;) - key(z-index)operator(:)float(1)operator(;) -operator(}) - -class(.yui-calcontainer) class(.calclose) operator({) - key(background)operator(:) string value(no-repeat)operator(;) - key(width)operator(:)float(17px)operator(;) - key(height)operator(:)float(13px)operator(;) - key(cursor)operator(:)value(pointer)operator(;) -operator(}) - -comment(/*) comment(Calendar) comment(element) comment(styles) comment(*/) - -class(.yui-calendar) operator({) - key(font)operator(:)float(100%) value(sans-serif)operator(;) - key(text-align)operator(:)value(center)operator(;) - key(border-spacing)operator(:)float(0)operator(;) - key(border-collapse)operator(:)value(separate)operator(;) - key(position)operator(:)value(relative)operator(;) -operator(}) - -class(.yui-calcontainer)class(.withtitle) operator({) - key(padding-top)operator(:)float(1.5em)operator(;) -operator(}) - -class(.yui-calendar) class(.calnavleft) operator({) - key(position)operator(:)value(absolute)operator(;) - key(cursor)operator(:)value(pointer)operator(;) - key(top)operator(:)float(2px)operator(;) - key(bottom)operator(:)float(0)operator(;) - key(width)operator(:)float(9px)operator(;) - key(height)operator(:)float(12px)operator(;) - key(left)operator(:)float(2px)operator(;) - key(z-index)operator(:)float(1)operator(;) - key(background)operator(:) string value(no-repeat)operator(;) -operator(}) - -class(.yui-calendar) class(.calnavright) operator({) - key(position)operator(:)value(absolute)operator(;) - key(cursor)operator(:)value(pointer)operator(;) - key(top)operator(:)float(2px)operator(;) - key(bottom)operator(:)float(0)operator(;) - key(width)operator(:)float(9px)operator(;) - key(height)operator(:)float(12px)operator(;) - key(right)operator(:)float(2px)operator(;) - key(z-index)operator(:)float(1)operator(;) - key(background)operator(:) string value(no-repeat)operator(;) -operator(}) - -class(.yui-calendar) type(td)class(.calcell) operator({) - key(padding)operator(:)float(.1em) float(.2em)operator(;) - key(border)operator(:)float(1px) value(solid) color(#E0E0E0)operator(;) - key(text-align)operator(:)value(center)operator(;) -operator(}) - -class(.yui-calendar) type(td)class(.calcell) type(a) operator({) - key(color)operator(:)color(#003DB8)operator(;) - key(text-decoration)operator(:)value(none)operator(;) -operator(}) - -class(.yui-calendar) type(td)class(.calcell)class(.today) operator({) - key(border)operator(:)float(1px) value(solid) color(#000)operator(;) -operator(}) - -class(.yui-calendar) type(td)class(.calcell)class(.oom) operator({) - key(cursor)operator(:)value(default)operator(;) - key(color)operator(:)color(#999)operator(;) - key(background-color)operator(:)color(#EEE)operator(;) - key(border)operator(:)float(1px) value(solid) color(#E0E0E0)operator(;) -operator(}) - -class(.yui-calendar) type(td)class(.calcell)class(.selected) operator({) - key(color)operator(:)color(#003DB8)operator(;) - key(background-color)operator(:)color(#FFF19F)operator(;) - key(border)operator(:)float(1px) value(solid) color(#FF9900)operator(;) -operator(}) - -class(.yui-calendar) type(td)class(.calcell)class(.calcellhover) operator({) - key(cursor)operator(:)value(pointer)operator(;) - key(color)operator(:)color(#FFF)operator(;) - key(background-color)operator(:)color(#FF9900)operator(;) - key(border)operator(:)float(1px) value(solid) color(#FF9900)operator(;) -operator(}) - -class(.yui-calendar) type(td)class(.calcell)class(.calcellhover) type(a) operator({) - key(color)operator(:)color(#FFF)operator(;) -operator(}) - -class(.yui-calendar) type(td)class(.calcell)class(.restricted) operator({) - key(text-decoration)operator(:)value(line-through)operator(;) -operator(}) - -class(.yui-calendar) type(td)class(.calcell)class(.previous) operator({) - key(color)operator(:)color(#CCC)operator(;) -operator(}) - -class(.yui-calendar) type(td)class(.calcell)class(.highlight1) operator({) key(background-color)operator(:)color(#CCFF99)operator(;) operator(}) -class(.yui-calendar) type(td)class(.calcell)class(.highlight2) operator({) key(background-color)operator(:)color(#99CCFF)operator(;) operator(}) -class(.yui-calendar) type(td)class(.calcell)class(.highlight3) operator({) key(background-color)operator(:)color(#FFCCCC)operator(;) operator(}) -class(.yui-calendar) type(td)class(.calcell)class(.highlight4) operator({) key(background-color)operator(:)color(#CCFF99)operator(;) operator(}) - -class(.yui-calendar) class(.calhead) operator({) - key(border)operator(:)float(1px) value(solid) color(#E0E0E0)operator(;) - key(vertical-align)operator(:)value(middle)operator(;) - key(background-color)operator(:)color(#FFF)operator(;) -operator(}) - -class(.yui-calendar) class(.calheader) operator({) - key(position)operator(:)value(relative)operator(;) - key(width)operator(:)float(100%)operator(;) - key(text-align)operator(:)value(center)operator(;) -operator(}) - -class(.yui-calendar) class(.calheader) type(img) operator({) - key(border)operator(:)value(none)operator(;) -operator(}) - -class(.yui-calendar) class(.calweekdaycell) operator({) - key(color)operator(:)color(#666)operator(;) - key(font-weight)operator(:)value(normal)operator(;) - key(text-align)operator(:)value(center)operator(;) - key(width)operator(:)float(1.5em)operator(;) -operator(}) - -class(.yui-calendar) class(.calfoot) operator({) - key(background-color)operator(:)color(#EEE)operator(;) -operator(}) - -class(.yui-calendar) class(.calrowhead)operator(,) class(.yui-calendar) class(.calrowfoot) operator({) - key(color)operator(:)color(#666)operator(;) - key(font-size)operator(:)float(9px)operator(;) - key(font-style)operator(:)value(italic)operator(;) - key(font-weight)operator(:)value(normal)operator(;) - key(width)operator(:)float(15px)operator(;) -operator(}) - -class(.yui-calendar) class(.calrowhead) operator({) - key(border-right-width)operator(:)float(2px)operator(;) -operator(}) - -comment(/*) comment(Specific) comment(changes) comment(for) comment(calendar) comment(running) comment(under) comment(fonts/reset) comment(*/) -class(.yui-calendar) class(.calbody) type(a)pseudo_class(:hover) operator({)key(background)operator(:)value(inherit)operator(;)operator(}) -type(p)constant(#clear) operator({)key(clear)operator(:)value(left)operator(;) key(padding-top)operator(:)float(10px)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*)comment(*) - comment(*) comment(SAM) - comment(*) - comment(*) comment(Skin) comment(colors) comment(used:) - comment(*) - comment(*) comment(-) comment(Control) comment(Border) comment(:) comment(808080) - comment(*) comment(-) comment(Control) comment(Chrome) comment(:) comment(f2f2f2) - comment(*) comment(-) comment(Cell) comment(Borders) comment(:) comment(cccccc) - comment(*) comment(-) comment(Normal) comment(Cell) comment(BG) comment(:) comment(ffffff) - comment(*) comment(-) comment(Date) comment(Links) comment(:) comment(0066cc) - comment(*) comment(-) comment(Selected) comment(Cells) comment(BG) comment(:) comment(b3d4ff) - comment(*) comment(-) comment(Cell) comment(Hover) comment(BG) comment(:) comment(426fd9) - comment(*) comment(-) comment(Disabled) comment(BG) comment(:) comment(cccccc) - comment(*) comment(-) comment(Disabled) comment(Text) comment(Color) comment(:) comment(a6a6a6) - comment(*)comment(*/) - -comment(/*) comment(CALENDAR) comment(BOUNDING) comment(BOX) comment(*/) -class(.yui-skin-sam) class(.yui-calcontainer) operator({) - key(background-color)operator(:)color(#f2f2f2)operator(;) - key(border)operator(:)float(1px) value(solid) color(#808080)operator(;) - key(padding)operator(:)float(10px)operator(;) -operator(}) - -comment(/*) comment(CALENDARGROUP) comment(BOUNDING) comment(BOX) comment(*/) -class(.yui-skin-sam) class(.yui-calcontainer)class(.multi) operator({) - key(padding)operator(:)float(0) float(5px) float(0) float(5px)operator(;) -operator(}) - -comment(/*) comment(BOUNDING) comment(BOX) comment(FOR) comment(EACH) comment(CALENDAR) comment(GROUP) comment(PAGE) comment(*/) -class(.yui-skin-sam) class(.yui-calcontainer)class(.multi) class(.groupcal) operator({) - key(background-color)operator(:)value(transparent)operator(;) - key(border)operator(:)value(none)operator(;) - key(padding)operator(:)float(10px) float(5px) float(10px) float(5px)operator(;) - key(margin)operator(:)float(0)operator(;) -operator(}) - -comment(/*) comment(TITLE) comment(BAR) comment(*/) -class(.yui-skin-sam) class(.yui-calcontainer) class(.title) operator({) - key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;) - key(border-bottom)operator(:)float(1px) value(solid) color(#cccccc)operator(;) - key(font)operator(:)float(100%) value(sans-serif)operator(;) - key(color)operator(:)color(#000)operator(;) - key(font-weight)operator(:)value(bold)operator(;) - key(height)operator(:)value(auto)operator(;) - key(padding)operator(:)float(.4em)operator(;) - key(margin)operator(:)float(0) float(-10px) float(10px) float(-10px)operator(;) - key(top)operator(:)float(0)operator(;) - key(left)operator(:)float(0)operator(;) - key(text-align)operator(:)value(left)operator(;) -operator(}) - -class(.yui-skin-sam) class(.yui-calcontainer)class(.multi) class(.title) operator({) - key(margin)operator(:)float(0) float(-5px) float(0) float(-5px)operator(;) -operator(}) - -class(.yui-skin-sam) class(.yui-calcontainer)class(.withtitle) operator({) - key(padding-top)operator(:)float(0)operator(;) -operator(}) - -comment(/*) comment(CLOSE) comment(BUTTON) comment(*/) -class(.yui-skin-sam) class(.yui-calcontainer) class(.calclose) operator({) - key(background)operator(:)string value(no-repeat) float(0) float(-300px)operator(;) - key(width)operator(:)float(25px)operator(;) - key(height)operator(:)float(15px)operator(;) - key(top)operator(:)float(.4em)operator(;) - key(right)operator(:)float(.4em)operator(;) - key(cursor)operator(:)value(pointer)operator(;) -operator(}) - -comment(/*) comment(CALENDAR) comment(TABLE) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) operator({) - key(border-spacing)operator(:)float(0)operator(;) - key(border-collapse)operator(:)value(collapse)operator(;) - key(font)operator(:)float(100%) value(sans-serif)operator(;) - key(text-align)operator(:)value(center)operator(;) -operator(}) - -comment(/*) comment(NAVBAR) comment(BOUNDING) comment(BOX) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) class(.calhead) operator({) - key(background)operator(:)value(transparent)operator(;) - key(border)operator(:)value(none)operator(;) - key(vertical-align)operator(:)value(middle)operator(;) -operator(}) - -comment(/*) comment(NAVBAR) comment(TEXT) comment(CONTAINER) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) class(.calheader) operator({) - key(background)operator(:)value(transparent)operator(;) - key(font-weight)operator(:)value(bold)operator(;) - key(padding)operator(:)float(0) float(0) float(.6em) float(0)operator(;) - key(text-align)operator(:)value(center)operator(;) -operator(}) - -class(.yui-skin-sam) class(.yui-calendar) class(.calheader) type(img) operator({) - key(border)operator(:)value(none)operator(;) -operator(}) - -comment(/*) comment(NAVBAR) comment(LEFT) comment(ARROW) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) class(.calnavleft) operator({) - key(background)operator(:)string value(no-repeat) float(0) float(-450px)operator(;) - key(width)operator(:)float(25px)operator(;) - key(height)operator(:)float(15px)operator(;) - key(top)operator(:)float(0)operator(;) - key(bottom)operator(:)float(0)operator(;) - key(left)operator(:)float(-10px)operator(;) - key(margin-left)operator(:)float(.4em)operator(;) - key(cursor)operator(:)value(pointer)operator(;) -operator(}) - -comment(/*) comment(NAVBAR) comment(RIGHT) comment(ARROW) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) class(.calnavright) operator({) - key(background)operator(:)string value(no-repeat) float(0) float(-500px)operator(;) - key(width)operator(:)float(25px)operator(;) - key(height)operator(:)float(15px)operator(;) - key(top)operator(:)float(0)operator(;) - key(bottom)operator(:)float(0)operator(;) - key(right)operator(:)float(-10px)operator(;) - key(margin-right)operator(:)float(.4em)operator(;) - key(cursor)operator(:)value(pointer)operator(;) -operator(}) - -comment(/*) comment(WEEKDAY) comment(HEADER) comment(ROW) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) class(.calweekdayrow) operator({) - key(height)operator(:)float(2em)operator(;) -operator(}) - -comment(/*) comment(WEEKDAY) comment((Su,) comment(Mo,) comment(Tu...\)) comment(HEADER) comment(CELLS) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) class(.calweekdaycell) operator({) - key(color)operator(:)color(#000)operator(;) - key(font-weight)operator(:)value(bold)operator(;) - key(text-align)operator(:)value(center)operator(;) - key(width)operator(:)float(2em)operator(;) -operator(}) - -comment(/*) comment(CALENDAR) comment(FOOTER.) comment(NOT) comment(IMPLEMENTED) comment(BY) comment(DEFAULT) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) class(.calfoot) operator({) - key(background-color)operator(:)color(#f2f2f2)operator(;) -operator(}) - -comment(/*) comment(WEEK) comment(NUMBERS) comment((ROW) comment(HEADERS/FOOTERS\)) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) class(.calrowhead)operator(,) class(.yui-skin-sam) class(.yui-calendar) class(.calrowfoot) operator({) - key(color)operator(:)color(#a6a6a6)operator(;) - key(font-size)operator(:)float(85%)operator(;) - key(font-style)operator(:)value(normal)operator(;) - key(font-weight)operator(:)value(normal)operator(;) -operator(}) - -class(.yui-skin-sam) class(.yui-calendar) class(.calrowhead) operator({) - key(text-align)operator(:)value(right)operator(;) - key(padding-right)operator(:)float(2px)operator(;) -operator(}) - -class(.yui-skin-sam) class(.yui-calendar) class(.calrowfoot) operator({) - key(text-align)operator(:)value(left)operator(;) - key(padding-left)operator(:)float(2px)operator(;) -operator(}) - -comment(/*) comment(NORMAL) comment(CELLS) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell) operator({) - key(border)operator(:)float(1px) value(solid) color(#cccccc)operator(;) - key(background)operator(:)color(#fff)operator(;) - key(padding)operator(:)float(1px)operator(;) - key(height)operator(:)float(1.6em)operator(;) - key(line-height)operator(:)float(1.6em)operator(;) comment(/*) comment(set) comment(line) comment(height) comment(equal) comment(to) comment(cell) comment(height) comment(to) comment(center) comment(vertically) comment(*/) - key(text-align)operator(:)value(center)operator(;) - key(white-space)operator(:)value(nowrap)operator(;) -operator(}) - -comment(/*) comment(LINK) comment(INSIDE) comment(NORMAL) comment(CELLS) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell) type(a) operator({) - key(color)operator(:)color(#0066cc)operator(;) - key(display)operator(:)value(block)operator(;) - key(height)operator(:)float(100%)operator(;) - key(text-decoration)operator(:)value(none)operator(;) -operator(}) - -comment(/*) comment(TODAY'S) comment(DATE) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.today) operator({) - key(background-color)operator(:)color(#000)operator(;) -operator(}) - -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.today) type(a) operator({) - key(background-color)operator(:)color(#fff)operator(;) -operator(}) - -comment(/*) comment(OOM) comment(DATES) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.oom) operator({) - key(background-color)operator(:)color(#cccccc)operator(;) - key(color)operator(:)color(#a6a6a6)operator(;) - key(cursor)operator(:)value(default)operator(;) -operator(}) - -comment(/*) comment(SELECTED) comment(DATE) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.selected) operator({) - key(background-color)operator(:)color(#fff)operator(;) - key(color)operator(:)color(#000)operator(;) -operator(}) - -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.selected) type(a) operator({) - key(background-color)operator(:)color(#b3d4ff)operator(;) - key(color)operator(:)color(#000)operator(;) -operator(}) - -comment(/*) comment(HOVER) comment(DATE) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.calcellhover) operator({) - key(background-color)operator(:)color(#426fd9)operator(;) - key(color)operator(:)color(#fff)operator(;) - key(cursor)operator(:)value(pointer)operator(;) -operator(}) - -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.calcellhover) type(a) operator({) - key(background-color)operator(:)color(#426fd9)operator(;) - key(color)operator(:)color(#fff)operator(;) -operator(}) - -comment(/*) comment(DEFAULT) comment(OOB) comment(DATES) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.previous) operator({) - key(color)operator(:)color(#e0e0e0)operator(;) -operator(}) - -comment(/*) comment(CUSTOM) comment(RENDERERS) comment(*/) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.restricted) operator({) key(text-decoration)operator(:)value(line-through)operator(;) operator(}) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight1) operator({) key(background-color)operator(:)color(#ccff99)operator(;) operator(}) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight2) operator({) key(background-color)operator(:)color(#99ccff)operator(;) operator(}) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight3) operator({) key(background-color)operator(:)color(#ffcccc)operator(;) operator(}) -class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight4) operator({) key(background-color)operator(:)color(#ccff99)operator(;) operator(})comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-calcontainer)operator({)key(position)operator(:)value(relative)operator(;)key(float)operator(:)value(left)operator(;)key(_overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-calcontainer) type(iframe)operator({)key(position)operator(:)value(absolute)operator(;)key(border)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(z-index)operator(:)float(0)operator(;)key(width)operator(:)float(100%)operator(;)key(height)operator(:)float(100%)operator(;)key(left)operator(:)float(0px)operator(;)key(top)operator(:)float(0px)operator(;)operator(})class(.yui-calcontainer) type(iframe)class(.fixedsize)operator({)key(width)operator(:)float(50em)operator(;)key(height)operator(:)float(50em)operator(;)key(top)operator(:)float(-1px)operator(;)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-calcontainer)class(.multi) class(.groupcal)operator({)key(z-index)operator(:)float(1)operator(;)key(float)operator(:)value(left)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-calcontainer) class(.title)operator({)key(position)operator(:)value(relative)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calcontainer) class(.close-icon)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calendar)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-calendar) class(.calnavleft)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calendar) class(.calnavright)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-calendar) class(.calheader)operator({)key(position)operator(:)value(relative)operator(;)key(width)operator(:)float(100%)operator(;)key(text-align)operator(:)value(center)operator(;)operator(})class(.yui-calendar) class(.calbody) type(a)pseudo_class(:hover)operator({)key(background)operator(:)value(inherit)operator(;)operator(})type(p)constant(#clear)operator({)key(clear)operator(:)value(left)operator(;)key(padding-top)operator(:)float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)operator({)key(background-color)operator(:)color(#f2f2f2)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(padding)operator(:)float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.multi)operator({)key(padding)operator(:)float(0) float(5px) float(0) float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.multi) class(.groupcal)operator({)key(background-color)operator(:)value(transparent)operator(;)key(border)operator(:)value(none)operator(;)key(padding)operator(:)float(10px) float(5px) float(10px) float(5px)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer) class(.title)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(border-bottom)operator(:)float(1px) value(solid) color(#cccccc)operator(;)key(font)operator(:)float(100%) value(sans-serif)operator(;)key(color)operator(:)color(#000)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(height)operator(:)value(auto)operator(;)key(padding)operator(:)float(.4em)operator(;)key(margin)operator(:)float(0) float(-10px) float(10px) float(-10px)operator(;)key(top)operator(:)float(0)operator(;)key(left)operator(:)float(0)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.multi) class(.title)operator({)key(margin)operator(:)float(0) float(-5px) float(0) float(-5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer)class(.withtitle)operator({)key(padding-top)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-calcontainer) class(.calclose)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-300px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(top)operator(:)float(.4em)operator(;)key(right)operator(:)float(.4em)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar)operator({)key(border-spacing)operator(:)float(0)operator(;)key(border-collapse)operator(:)value(collapse)operator(;)key(font)operator(:)float(100%) value(sans-serif)operator(;)key(text-align)operator(:)value(center)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calhead)operator({)key(background)operator(:)value(transparent)operator(;)key(border)operator(:)value(none)operator(;)key(vertical-align)operator(:)value(middle)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calheader)operator({)key(background)operator(:)value(transparent)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(padding)operator(:)float(0) float(0) float(.6em) float(0)operator(;)key(text-align)operator(:)value(center)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calheader) type(img)operator({)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calnavleft)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-450px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(top)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(left)operator(:)float(-10px)operator(;)key(margin-left)operator(:)float(.4em)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calnavright)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-500px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(top)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(right)operator(:)float(-10px)operator(;)key(margin-right)operator(:)float(.4em)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calweekdayrow)operator({)key(height)operator(:)float(2em)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calweekdaycell)operator({)key(color)operator(:)color(#000)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(text-align)operator(:)value(center)operator(;)key(width)operator(:)float(2em)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calfoot)operator({)key(background-color)operator(:)color(#f2f2f2)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calrowhead)operator(,)class(.yui-skin-sam) class(.yui-calendar) class(.calrowfoot)operator({)key(color)operator(:)color(#a6a6a6)operator(;)key(font-size)operator(:)float(85%)operator(;)key(font-style)operator(:)value(normal)operator(;)key(font-weight)operator(:)value(normal)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calrowhead)operator({)key(text-align)operator(:)value(right)operator(;)key(padding-right)operator(:)float(2px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) class(.calrowfoot)operator({)key(text-align)operator(:)value(left)operator(;)key(padding-left)operator(:)float(2px)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)operator({)key(border)operator(:)float(1px) value(solid) color(#cccccc)operator(;)key(background)operator(:)color(#fff)operator(;)key(padding)operator(:)float(1px)operator(;)key(height)operator(:)float(1.6em)operator(;)key(line-height)operator(:)float(1.6em)operator(;)key(text-align)operator(:)value(center)operator(;)key(white-space)operator(:)value(nowrap)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell) type(a)operator({)key(color)operator(:)color(#0066cc)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(100%)operator(;)key(text-decoration)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.today)operator({)key(background-color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.today) type(a)operator({)key(background-color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.oom)operator({)key(background-color)operator(:)color(#cccccc)operator(;)key(color)operator(:)color(#a6a6a6)operator(;)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.selected)operator({)key(background-color)operator(:)color(#fff)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.selected) type(a)operator({)key(background-color)operator(:)color(#b3d4ff)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.calcellhover)operator({)key(background-color)operator(:)color(#426fd9)operator(;)key(color)operator(:)color(#fff)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.calcellhover) type(a)operator({)key(background-color)operator(:)color(#426fd9)operator(;)key(color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.previous)operator({)key(color)operator(:)color(#e0e0e0)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.restricted)operator({)key(text-decoration)operator(:)value(line-through)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight1)operator({)key(background-color)operator(:)color(#ccff99)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight2)operator({)key(background-color)operator(:)color(#99ccff)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight3)operator({)key(background-color)operator(:)color(#ffcccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-calendar) type(td)class(.calcell)class(.highlight4)operator({)key(background-color)operator(:)color(#ccff99)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) - -class(.yui-picker-panel) operator({) - key(background)operator(:) color(#e3e3e3)operator(;) - key(border-color)operator(:) color(#888)operator(;) -operator(}) - -class(.yui-picker-panel) class(.hd) operator({) - key(background-color)operator(:)color(#ccc)operator(;) - key(font-size)operator(:)float(100%)operator(;) - key(line-height)operator(:)float(100%)operator(;) - key(border)operator(:)float(1px) value(solid) color(#e3e3e3)operator(;) - key(font-weight)operator(:)value(bold)operator(;) - key(overflow)operator(:)value(hidden)operator(;) - key(padding)operator(:) float(6px)operator(;) - key(color)operator(:) color(#000)operator(;) -operator(}) - -class(.yui-picker-panel) class(.bd) operator({) - key(background)operator(:) color(#e8e8e8)operator(;) - key(margin)operator(:) float(1px)operator(;) - key(height)operator(:) float(200px)operator(;) -operator(}) - -class(.yui-picker-panel) class(.ft) operator({) - key(background)operator(:) color(#e8e8e8)operator(;) - key(margin)operator(:) float(1px)operator(;) - key(padding)operator(:) float(1px)operator(;) - comment(/*) - comment(text-align:) comment(center;) - comment(*/) -operator(}) - -class(.yui-picker) operator({) - key(position)operator(:) value(relative)operator(;) -operator(}) - -class(.yui-picker-hue-thumb) operator({) key(cursor)operator(:)value(default)operator(;) key(width)operator(:)float(18px)operator(;) key(height)operator(:)float(18px)operator(;) -key(top)operator(:) float(-8px)operator(;) -key(left)operator(:) float(-2px)operator(;) - key(z-index)operator(:) float(9)operator(;) key(position)operator(:)value(absolute)operator(;) operator(}) -class(.yui-picker-hue-bg) operator({)key(-moz-outline)operator(:) value(none)operator(;) key(outline)operator(:)float(0px) value(none)operator(;) - key(position)operator(:)value(absolute)operator(;) key(left)operator(:)float(200px)operator(;) key(height)operator(:)float(183px)operator(;) key(width)operator(:)float(14px)operator(;) - key(background)operator(:)string value(no-repeat)operator(;) - key(top)operator(:)float(4px)operator(;) -operator(}) - -class(.yui-picker-bg) operator({) - key(-moz-outline)operator(:) value(none)operator(;) - key(outline)operator(:)float(0px) value(none)operator(;) - key(position)operator(:)value(absolute)operator(;) - key(top)operator(:)float(4px)operator(;) - key(left)operator(:)float(4px)operator(;) - key(height)operator(:)float(182px)operator(;) - key(width)operator(:)float(182px)operator(;) - key(background-color)operator(:)color(#F00)operator(;) - key(background-image)operator(:) stringoperator(;) -operator(}) - -type(*)type(html) class(.yui-picker-bg) operator({) - key(background-image)operator(:) value(none)operator(;) - key(filter)operator(:)value(progid)operator(:)value(DXImageTransform)operator(.)value(Microsoft)operator(.)error(A)error(l)error(p)error(h)error(a)error(I)error(m)error(a)error(g)error(e)error(L)error(o)error(a)error(d)error(e)error(r)operator(()value(src)operator(=)stringoperator(,) value(sizingMethod)operator(=)stringoperator(\))operator(;) -operator(}) - - -class(.yui-picker-mask) operator({) key(position)operator(:)value(absolute)operator(;) key(z-index)operator(:) float(1)operator(;) key(top)operator(:)float(0px)operator(;) key(left)operator(:)float(0px)operator(;) operator(}) - -class(.yui-picker-thumb) operator({) key(cursor)operator(:)value(default)operator(;) key(width)operator(:)float(11px)operator(;) key(height)operator(:)float(11px)operator(;) key(z-index)operator(:) float(9)operator(;) key(position)operator(:)value(absolute)operator(;) - key(top)operator(:)float(-4px)operator(;) key(left)operator(:)float(-4px)operator(;) operator(}) - -class(.yui-picker-swatch) operator({) key(position)operator(:)value(absolute)operator(;) key(left)operator(:)float(240px)operator(;) key(top)operator(:)float(4px)operator(;) key(height)operator(:)float(60px)operator(;) - key(width)operator(:)float(55px)operator(;) key(border)operator(:)float(1px) value(solid) color(#888)operator(;) operator(}) -class(.yui-picker-websafe-swatch) operator({) key(position)operator(:)value(absolute)operator(;) key(left)operator(:)float(304px)operator(;) key(top)operator(:)float(4px)operator(;) - key(height)operator(:)float(24px)operator(;) key(width)operator(:)float(24px)operator(;) key(border)operator(:)float(1px) value(solid) color(#888)operator(;) operator(}) - -class(.yui-picker-controls) operator({) key(position)operator(:)value(absolute)operator(;) key(top)operator(:) float(72px)operator(;) key(left)operator(:)float(226px)operator(;) key(font)operator(:)float(1em) value(monospace)operator(;)operator(}) -class(.yui-picker-controls) class(.hd) operator({) key(background)operator(:) value(transparent)operator(;) key(border-width)operator(:) float(0px) important(!important)operator(;)operator(}) -class(.yui-picker-controls) class(.bd) operator({) key(height)operator(:) float(100px)operator(;) key(border-width)operator(:) float(0px) important(!important)operator(;)operator(}) -class(.yui-picker-controls) type(ul) operator({)key(float)operator(:)value(left)operator(;)key(list-style)operator(:)value(none)operator(;)key(padding)operator(:)float(0) float(2px) float(0) float(0)operator(;)key(margin)operator(:)float(0)operator(}) -class(.yui-picker-controls) type(li) operator({)key(padding)operator(:)float(2px)operator(;)key(margin)operator(:)float(0)operator(}) -class(.yui-picker-controls) type(input) operator({) - key(font-size)operator(:) float(0.85em)operator(;) - key(width)operator(:) float(2.4em)operator(;) -operator(}) -class(.yui-picker-hex-controls) operator({) - key(clear)operator(:) value(both)operator(;) - key(padding)operator(:) float(2px)operator(;) -operator(}) -class(.yui-picker-hex-controls) type(input) operator({) - key(width)operator(:) float(4.6em)operator(;) -operator(}) - -class(.yui-picker-controls) type(a) operator({) - key(font)operator(:) float(1em) value(arial)operator(,)value(helvetica)operator(,)value(clean)operator(,)value(sans-serif)operator(;) - key(display)operator(:)value(block)operator(;) - error(*)key(display)operator(:)value(inline-block)operator(;) comment(/*) comment(IE) comment(*/) - key(padding)operator(:) float(0)operator(;) - key(color)operator(:) color(#000)operator(;) - -operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-picker-panel)operator({)key(background)operator(:)color(#e3e3e3)operator(;)key(border-color)operator(:)color(#888)operator(;)operator(})class(.yui-picker-panel) class(.hd)operator({)key(background-color)operator(:)color(#ccc)operator(;)key(font-size)operator(:)float(100%)operator(;)key(line-height)operator(:)float(100%)operator(;)key(border)operator(:)float(1px) value(solid) color(#e3e3e3)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(padding)operator(:)float(6px)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-picker-panel) class(.bd)operator({)key(background)operator(:)color(#e8e8e8)operator(;)key(margin)operator(:)float(1px)operator(;)key(height)operator(:)float(200px)operator(;)operator(})class(.yui-picker-panel) class(.ft)operator({)key(background)operator(:)color(#e8e8e8)operator(;)key(margin)operator(:)float(1px)operator(;)key(padding)operator(:)float(1px)operator(;)operator(})class(.yui-picker)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-picker-hue-thumb)operator({)key(cursor)operator(:)value(default)operator(;)key(width)operator(:)float(18px)operator(;)key(height)operator(:)float(18px)operator(;)key(top)operator(:)float(-8px)operator(;)key(left)operator(:)float(-2px)operator(;)key(z-index)operator(:)float(9)operator(;)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-picker-hue-bg)operator({)key(-moz-outline)operator(:)value(none)operator(;)key(outline)operator(:)float(0px) value(none)operator(;)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(200px)operator(;)key(height)operator(:)float(183px)operator(;)key(width)operator(:)float(14px)operator(;)key(background)operator(:)string value(no-repeat)operator(;)key(top)operator(:)float(4px)operator(;)operator(})class(.yui-picker-bg)operator({)key(-moz-outline)operator(:)value(none)operator(;)key(outline)operator(:)float(0px) value(none)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(4px)operator(;)key(left)operator(:)float(4px)operator(;)key(height)operator(:)float(182px)operator(;)key(width)operator(:)float(182px)operator(;)key(background-color)operator(:)color(#F00)operator(;)key(background-image)operator(:)stringoperator(;)operator(})type(*)type(html) class(.yui-picker-bg)operator({)key(background-image)operator(:)value(none)operator(;)key(filter)operator(:)value(progid)operator(:)value(DXImageTransform)operator(.)value(Microsoft)operator(.)error(A)error(l)error(p)error(h)error(a)error(I)error(m)error(a)error(g)error(e)error(L)error(o)error(a)error(d)error(e)error(r)operator(()value(src)operator(=)stringoperator(,)value(sizingMethod)operator(=)stringoperator(\))operator(;)operator(})class(.yui-picker-mask)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(1)operator(;)key(top)operator(:)float(0px)operator(;)key(left)operator(:)float(0px)operator(;)operator(})class(.yui-picker-thumb)operator({)key(cursor)operator(:)value(default)operator(;)key(width)operator(:)float(11px)operator(;)key(height)operator(:)float(11px)operator(;)key(z-index)operator(:)float(9)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(-4px)operator(;)key(left)operator(:)float(-4px)operator(;)operator(})class(.yui-picker-swatch)operator({)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(240px)operator(;)key(top)operator(:)float(4px)operator(;)key(height)operator(:)float(60px)operator(;)key(width)operator(:)float(55px)operator(;)key(border)operator(:)float(1px) value(solid) color(#888)operator(;)operator(})class(.yui-picker-websafe-swatch)operator({)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(304px)operator(;)key(top)operator(:)float(4px)operator(;)key(height)operator(:)float(24px)operator(;)key(width)operator(:)float(24px)operator(;)key(border)operator(:)float(1px) value(solid) color(#888)operator(;)operator(})class(.yui-picker-controls)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(72px)operator(;)key(left)operator(:)float(226px)operator(;)key(font)operator(:)float(1em) value(monospace)operator(;)operator(})class(.yui-picker-controls) class(.hd)operator({)key(background)operator(:)value(transparent)operator(;)key(border-width)operator(:)float(0px) important(!important)operator(;)operator(})class(.yui-picker-controls) class(.bd)operator({)key(height)operator(:)float(100px)operator(;)key(border-width)operator(:)float(0px) important(!important)operator(;)operator(})class(.yui-picker-controls) type(ul)operator({)key(float)operator(:)value(left)operator(;)key(list-style)operator(:)value(none)operator(;)key(padding)operator(:)float(0) float(2px) float(0) float(0)operator(;)key(margin)operator(:)float(0)operator(})class(.yui-picker-controls) type(li)operator({)key(padding)operator(:)float(2px)operator(;)key(margin)operator(:)float(0)operator(})class(.yui-picker-controls) type(input)operator({)key(font-size)operator(:)float(0.85em)operator(;)key(width)operator(:)float(2.4em)operator(;)operator(})class(.yui-picker-hex-controls)operator({)key(clear)operator(:)value(both)operator(;)key(padding)operator(:)float(2px)operator(;)operator(})class(.yui-picker-hex-controls) type(input)operator({)key(width)operator(:)float(4.6em)operator(;)operator(})class(.yui-picker-controls) type(a)operator({)key(font)operator(:)float(1em) value(arial)operator(,)value(helvetica)operator(,)value(clean)operator(,)value(sans-serif)operator(;)key(display)operator(:)value(block)operator(;)error(*)key(display)operator(:)value(inline-block)operator(;)key(padding)operator(:)float(0)operator(;)key(color)operator(:)color(#000)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-overlay)operator(,) -class(.yui-panel-container) operator({) - key(visibility)operator(:) value(hidden)operator(;) - key(position)operator(:) value(absolute)operator(;) - key(z-index)operator(:) float(2)operator(;) -operator(}) - -class(.yui-panel-container) type(form) operator({) - key(margin)operator(:) float(0)operator(;) -operator(}) - -class(.mask) operator({) - key(z-index)operator(:) float(1)operator(;) - key(display)operator(:) value(none)operator(;) - key(position)operator(:) value(absolute)operator(;) - key(top)operator(:) float(0)operator(;) - key(left)operator(:) float(0)operator(;) - key(right)operator(:) float(0)operator(;) - key(bottom)operator(:) float(0)operator(;) - comment(/*) - comment(Application) comment(of) comment("overflow:auto") comment(prevents) comment(Mac) comment(scrollbars) comment(from) comment(bleeding) - comment(through) comment(the) comment(modality) comment(mask) comment(in) comment(Gecko.) - comment(*/) - key(overflow)operator(:) value(auto)operator(;) -operator(}) - -class(.yui-panel-container) type(select) operator({) - key(_visibility)operator(:) value(inherit)operator(;) -operator(}) - -comment(/*) - comment(PLEASE) comment(NOTE:) - - comment(1\)) comment(".masked) comment(select") comment(is) comment(used) comment(to) comment(prevent) comment() comment(elements) comment(when) comment(dragging) comment(a) - comment(Panel) comment(in) comment(IE) comment(6.) comment(This) comment(is) comment(necessary) comment(to) comment(prevent) comment(some) comment(redraw) comment(problems) comment(with) - comment(the) comment() comment(elements) comment(don't) comment(inherit) comment(their) comment(parent) - comment(element's) comment(opacity) comment(in) comment(IE) comment(6.) - -comment(*/) - -class(.masked) type(select)operator(,) -class(.drag) type(select)operator(,) -class(.hide-select) type(select) operator({) - - key(_visibility)operator(:) value(hidden)operator(;) - -operator(}) - - -comment(/*) - -comment(There) comment(are) comment(two) comment(known) comment(issues) comment(with) comment(YAHOO.widget.Overlay) comment((and) comment(its) comment(subclasses\)) comment(that) -comment(manifest) comment(in) comment(Gecko-based) comment(browsers) comment(on) comment(Mac) comment(OS) comment(X:) - - comment(1\)) comment(Elements) comment(with) comment(scrollbars) comment(will) comment(poke) comment(through) comment(Overlay) comment(instances) comment(floating) - comment(above) comment(them.) - - comment(2\)) comment(An) comment(Overlay's) comment(scrollbars) comment(and) comment(the) comment(scrollbars) comment(of) comment(its) comment(child) comment(nodes) comment(remain) - comment(visible) comment(when) comment(the) comment(Overlay) comment(is) comment(hidden.) - -comment(To) comment(fix) comment(these) comment(bugs:) - - comment(1\)) comment(The) comment("overflow") comment(property) comment(of) comment(an) comment(Overlay) comment(instance's) comment(root) comment(element) comment(and) comment(child) - comment(nodes) comment(is) comment(toggled) comment(between) comment("hidden") comment(and) comment("auto") comment((through) comment(the) comment(application) - comment(and) comment(removal) comment(of) comment(the) comment("hide-scrollbars") comment(and) comment("show-scrollbars") comment(CSS) comment(classes\)) - comment(as) comment(its) comment("visibility") comment(configuration) comment(property) comment(is) comment(toggled) comment(between) - comment("false") comment(and) comment("true.") - - comment(2\)) comment(The) comment("display") comment(property) comment(of) comment() comment(elements) comment(that) comment(are) comment(child) comment(nodes) comment(of) comment(the) - comment(Overlay) comment(instance's) comment(root) comment(element) comment(is) comment(set) comment(to) comment("none") comment(when) comment(it) comment(is) comment(hidden.) - -comment(PLEASE) comment(NOTE:) - - comment(1\)) comment(The) comment("hide-scrollbars") comment(and) comment("show-scrollbars") comment(CSS) comment(classes) comment(classes) comment(are) - comment(applied) comment(only) comment(for) comment(Gecko) comment(on) comment(Mac) comment(OS) comment(X) comment(and) comment(are) comment(added/removed) comment(to/from) comment(the) - comment(Overlay's) comment(root) comment(HTML) comment(element) comment((DIV\)) comment(via) comment(the) comment("hideMacGeckoScrollbars") comment(and) - comment("showMacGeckoScrollbars") comment(methods) comment(of) comment(YAHOO.widget.Overlay.) - - comment(2\)) comment(There) comment(may) comment(be) comment(instances) comment(where) comment(the) comment(CSS) comment(for) comment(a) comment(web) comment(page) comment(or) comment(application) - comment(contains) comment(style) comment(rules) comment(whose) comment(specificity) comment(override) comment(the) comment(rules) comment(implemented) comment(by) - comment(the) comment(Container) comment(CSS) comment(files) comment(to) comment(fix) comment(this) comment(bug.) comment(In) comment(such) comment(cases,) comment(is) comment(necessary) comment(to) - comment(leverage) comment(the) comment(provided) comment("hide-scrollbars") comment(and) comment("show-scrollbars") comment(classes) comment(to) - comment(write) comment(custom) comment(style) comment(rules) comment(to) comment(guard) comment(against) comment(this) comment(bug.) - -comment(**) comment(For) comment(more) comment(information) comment(on) comment(this) comment(issue,) comment(see:) - - comment(+) comment(https://bugzilla.mozilla.org/show_bug.cgi?id=187435) - comment(+) comment(SourceForge) comment(bug) comment(#1723530) - -comment(*/) - -class(.hide-scrollbars)operator(,) -class(.hide-scrollbars) type(*) operator({) - - key(overflow)operator(:) value(hidden)operator(;) - -operator(}) - -class(.hide-scrollbars) type(select) operator({) - - key(display)operator(:) value(none)operator(;) - -operator(}) - -class(.show-scrollbars) operator({) - - key(overflow)operator(:) value(auto)operator(;) - -operator(}) - -class(.yui-panel-container)class(.show-scrollbars) operator({) - - key(overflow)operator(:) value(visible)operator(;) - -operator(}) - -class(.yui-panel-container)class(.show-scrollbars) class(.underlay) operator({) - - key(overflow)operator(:) value(auto)operator(;) - -operator(}) - -class(.yui-panel-container)class(.focused) operator({) - -operator(}) - - -comment(/*) comment(Panel) comment(underlay) comment(styles) comment(*/) - -class(.yui-panel-container) class(.underlay) operator({) - - key(position)operator(:) value(absolute)operator(;) - key(top)operator(:) float(0)operator(;) - key(right)operator(:) float(0)operator(;) - key(bottom)operator(:) float(0)operator(;) - key(left)operator(:) float(0)operator(;) - -operator(}) - -class(.yui-panel-container)class(.matte) operator({) - - key(padding)operator(:) float(3px)operator(;) - key(background-color)operator(:) color(#fff)operator(;) - -operator(}) - -class(.yui-panel-container)class(.shadow) class(.underlay) operator({) - - key(top)operator(:) float(3px)operator(;) - key(bottom)operator(:) float(-3px)operator(;) - key(right)operator(:) float(-3px)operator(;) - key(left)operator(:) float(3px)operator(;) - key(background-color)operator(:) color(#000)operator(;) - key(opacity)operator(:) float(.12)operator(;) - key(filter)operator(:) stringoperator(;) comment(/*) comment(For) comment(IE) comment(*/) - -operator(}) - -class(.yui-panel) operator({) - key(visibility)operator(:)value(hidden)operator(;) - key(border-collapse)operator(:)value(separate)operator(;) - key(position)operator(:)value(relative)operator(;) - key(left)operator(:)float(0)operator(;) - key(top)operator(:)float(0)operator(;) - key(font)operator(:)float(1em) value(Arial)operator(;) - key(background-color)operator(:)color(#FFF)operator(;) - key(border)operator(:)float(1px) value(solid) color(#000)operator(;) - key(z-index)operator(:)float(1)operator(;) - key(overflow)operator(:)value(hidden)operator(;) -operator(}) - -class(.yui-panel) class(.hd) operator({) - key(background-color)operator(:)color(#3d77cb)operator(;) - key(color)operator(:)color(#FFF)operator(;) - key(font-size)operator(:)float(100%)operator(;) - key(line-height)operator(:)float(100%)operator(;) - key(border)operator(:)float(1px) value(solid) color(#FFF)operator(;) - key(border-bottom)operator(:)float(1px) value(solid) color(#000)operator(;) - key(font-weight)operator(:)value(bold)operator(;) - key(padding)operator(:)float(4px)operator(;) - key(white-space)operator(:)value(nowrap)operator(;) -operator(}) - -class(.yui-panel) class(.bd) operator({) - key(overflow)operator(:)value(hidden)operator(;) - key(padding)operator(:)float(4px)operator(;) -operator(}) - -class(.yui-panel) class(.bd) type(p) operator({) - key(margin)operator(:)float(0) float(0) float(1em)operator(;) -operator(}) - -class(.yui-panel) class(.container-close) operator({) - key(position)operator(:)value(absolute)operator(;) - key(top)operator(:)float(5px)operator(;) - key(right)operator(:)float(4px)operator(;) - key(z-index)operator(:)float(6)operator(;) - key(height)operator(:)float(12px)operator(;) - key(width)operator(:)float(12px)operator(;) - key(margin)operator(:)float(0px)operator(;) - key(padding)operator(:)float(0px)operator(;) - key(background)operator(:)string value(no-repeat)operator(;) - key(cursor)operator(:)value(pointer)operator(;) - key(visibility)operator(:)value(inherit)operator(;) -operator(}) - -class(.yui-panel) class(.ft) operator({) - key(padding)operator(:)float(4px)operator(;) - key(overflow)operator(:)value(hidden)operator(;) -operator(}) - -class(.yui-simple-dialog) class(.bd) class(.yui-icon) operator({) - key(background-repeat)operator(:)value(no-repeat)operator(;) - key(width)operator(:)float(16px)operator(;) - key(height)operator(:)float(16px)operator(;) - key(margin-right)operator(:)float(10px)operator(;) - key(float)operator(:)value(left)operator(;) -operator(}) - -class(.yui-simple-dialog) class(.bd) type(span)class(.blckicon) operator({) - key(background)operator(:) string value(no-repeat)operator(;) -operator(}) - -class(.yui-simple-dialog) class(.bd) type(span)class(.alrticon) operator({) - key(background)operator(:) string value(no-repeat)operator(;) -operator(}) - -class(.yui-simple-dialog) class(.bd) type(span)class(.hlpicon) operator({) - key(background)operator(:) string value(no-repeat)operator(;) -operator(}) - -class(.yui-simple-dialog) class(.bd) type(span)class(.infoicon) operator({) - key(background)operator(:) string value(no-repeat)operator(;) -operator(}) - -class(.yui-simple-dialog) class(.bd) type(span)class(.warnicon) operator({) - key(background)operator(:) string value(no-repeat)operator(;) -operator(}) - -class(.yui-simple-dialog) class(.bd) type(span)class(.tipicon) operator({) - key(background)operator(:) string value(no-repeat)operator(;) -operator(}) - -class(.yui-dialog) class(.ft)operator(,) -class(.yui-simple-dialog) class(.ft) operator({) - key(padding-bottom)operator(:)float(5px)operator(;) - key(padding-right)operator(:)float(5px)operator(;) - key(text-align)operator(:)value(right)operator(;) -operator(}) - -class(.yui-dialog) type(form)operator(,) -class(.yui-simple-dialog) type(form) operator({) - key(margin)operator(:)float(0)operator(;) -operator(}) - -class(.button-group) type(button) operator({) - key(font)operator(:)float(100) float(76%) value(verdana)operator(;) - key(text-decoration)operator(:)value(none)operator(;) - key(background-color)operator(:) color(#E4E4E4)operator(;) - key(color)operator(:) color(#333)operator(;) - key(cursor)operator(:) value(hand)operator(;) - key(vertical-align)operator(:) value(middle)operator(;) - key(border)operator(:) float(2px) value(solid) color(#797979)operator(;) - key(border-top-color)operator(:)color(#FFF)operator(;) - key(border-left-color)operator(:)color(#FFF)operator(;) - key(margin)operator(:)float(2px)operator(;) - key(padding)operator(:)float(2px)operator(;) -operator(}) - -class(.button-group) type(button)class(.default) operator({) - key(font-weight)operator(:)value(bold)operator(;) -operator(}) - -class(.button-group) type(button)pseudo_class(:hover)operator(,) -class(.button-group) type(button)class(.hover) operator({) - key(border)operator(:)float(2px) value(solid) color(#90A029)operator(;) - key(background-color)operator(:)color(#EBF09E)operator(;) - key(border-top-color)operator(:)color(#FFF)operator(;) - key(border-left-color)operator(:)color(#FFF)operator(;) -operator(}) - -class(.button-group) type(button)pseudo_class(:active) operator({) - key(border)operator(:)float(2px) value(solid) color(#E4E4E4)operator(;) - key(background-color)operator(:)color(#BBB)operator(;) - key(border-top-color)operator(:)color(#333)operator(;) - key(border-left-color)operator(:)color(#333)operator(;) -operator(})comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(Panel) comment(modality) comment(mask) comment(styles) comment(*/) - -class(.yui-skin-sam) class(.mask) operator({) - - key(background-color)operator(:) color(#000)operator(;) - key(opacity)operator(:) float(.25)operator(;) - error(*)key(filter)operator(:) stringoperator(;) comment(/*) comment(Set) comment(opacity) comment(in) comment(IE) comment(*/) - -operator(}) - - -comment(/*) comment(Panel) comment(styles) comment(*/) - -class(.yui-skin-sam) class(.yui-panel-container) operator({) - - key(padding)operator(:) float(0) float(1px)operator(;) - error(*)key(padding)operator(:) float(2px) float(3px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-panel) operator({) - - key(position)operator(:) value(relative)operator(;) - error(*)key(zoom)operator(:) float(1)operator(;) - key(left)operator(:) float(0)operator(;) - key(top)operator(:) float(0)operator(;) - key(border-style)operator(:) value(solid)operator(;) - key(border-width)operator(:) float(1px) float(0)operator(;) - key(border-color)operator(:) color(#808080)operator(;) - key(z-index)operator(:) float(1)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-panel) class(.hd)operator(,) -class(.yui-skin-sam) class(.yui-panel) class(.bd)operator(,) -class(.yui-skin-sam) class(.yui-panel) class(.ft) operator({) - - comment(/*) - comment(Use) comment(of) comment("zoom:) comment(1") comment(is) comment(to) comment(trigger) comment("haslayout") comment(for) comment(IE) comment(to) comment(get) - comment(negative) comment(margins) comment(working.) - comment(*/) - - error(*)key(zoom)operator(:) float(1)operator(;) - - comment(/*) - comment(Use) comment(of) comment("position:) comment(relative") comment(is) comment(necessary) comment(to) comment(get) comment(negative) comment(margins) - comment(working) comment(in) comment(IE.) - comment(*/) - - error(*)key(position)operator(:) value(relative)operator(;) - - key(border-style)operator(:) value(solid)operator(;) - key(border-width)operator(:) float(0) float(1px)operator(;) - key(border-color)operator(:) color(#808080)operator(;) - key(margin)operator(:) float(0) float(-1px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-panel) class(.hd) operator({) - - key(border-bottom)operator(:) value(solid) float(1px) color(#ccc)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-panel) class(.bd)operator(,) -class(.yui-skin-sam) class(.yui-panel) class(.ft) operator({) - - key(background-color)operator(:) color(#F2F2F2)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-panel) class(.hd) operator({) - - key(padding)operator(:) float(0) float(10px)operator(;) - key(font-size)operator(:) float(93%)operator(;) comment(/*) comment(12px) comment(*/) - key(line-height)operator(:) float(2)operator(;) comment(/*) comment(~24px) comment(*/) - error(*)key(line-height)operator(:) float(1)float(.9)operator(;) comment(/*) comment(For) comment(IE) comment(*/) - key(font-weight)operator(:) value(bold)operator(;) - key(color)operator(:) color(#000)operator(;) - key(background)operator(:) string value(repeat-x) float(0) float(-200px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-panel) class(.bd) operator({) - - key(padding)operator(:) float(10px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-panel) class(.ft) operator({) - - key(border-top)operator(:) value(solid) float(1px) color(#808080)operator(;) - key(padding)operator(:) float(5px) float(10px)operator(;) - key(font-size)operator(:) float(77%)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-panel-container)class(.focused) class(.yui-panel) class(.hd) operator({) - -operator(}) - -class(.yui-skin-sam) class(.container-close) operator({) - - key(position)operator(:) value(absolute)operator(;) - key(top)operator(:) float(5px)operator(;) - key(right)operator(:) float(6px)operator(;) - key(width)operator(:) float(25px)operator(;) - key(height)operator(:) float(15px)operator(;) - key(background)operator(:) string value(no-repeat) float(0) float(-300px)operator(;) - key(cursor)operator(:)value(pointer)operator(;) - -operator(}) - - -comment(/*) comment(Panel) comment(underlay) comment(styles) comment(*/) - -class(.yui-skin-sam) class(.yui-panel-container) class(.underlay) operator({) - - key(right)operator(:) float(-1px)operator(;) - key(left)operator(:) float(-1px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-panel-container)class(.matte) operator({) - - key(padding)operator(:) float(9px) float(10px)operator(;) - key(background-color)operator(:) color(#fff)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-panel-container)class(.shadow) operator({) - - comment(/*) comment(IE) comment(7) comment(Quirks) comment(Mode) comment(and) comment(IE) comment(6) comment(Standards) comment(Mode) comment(and) comment(Quirks) comment(mode) comment(*/) - key(_padding)operator(:) float(2px) float(5px) float(0) float(3px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-panel-container)class(.shadow) class(.underlay) operator({) - - key(position)operator(:) value(absolute)operator(;) - - key(top)operator(:) float(2px)operator(;) - key(right)operator(:) float(-3px)operator(;) - key(bottom)operator(:) float(-3px)operator(;) - key(left)operator(:) float(-3px)operator(;) - - comment(/*) comment(IE) comment(7) comment(Standards) comment(Mode) comment(*/) - - error(*)key(top)operator(:) float(3px)operator(;) - error(*)key(left)operator(:) float(-1px)operator(;) - error(*)key(right)operator(:) float(-1px)operator(;) - error(*)key(bottom)operator(:) float(-1px)operator(;) - - comment(/*) comment(IE) comment(7) comment(Quirks) comment(Mode) comment(and) comment(IE) comment(6) comment(Standards) comment(Mode) comment(and) comment(Quirks) comment(mode) comment(*/) - - key(_top)operator(:) float(0)operator(;) - key(_right)operator(:) float(0)operator(;) - key(_bottom)operator(:) float(0)operator(;) - key(_left)operator(:) float(0)operator(;) - key(_margin-top)operator(:) float(3px)operator(;) - key(_margin-left)operator(:) float(-1px)operator(;) - - key(background-color)operator(:) color(#000)operator(;) - key(opacity)operator(:) float(.12)operator(;) - error(*)key(filter)operator(:) stringoperator(;) comment(/*) comment(Set) comment(opacity) comment(in) comment(IE) comment(*/) - -operator(}) - - -comment(/*) comment(Dialog) comment(styles) comment(*/) - -class(.yui-skin-sam) class(.yui-dialog) class(.ft) operator({) - - key(border-top)operator(:) value(none)operator(;) - key(padding)operator(:) float(0) float(10px) float(10px) float(10px)operator(;) - key(font-size)operator(:) float(100%)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.button-group) operator({) - - key(display)operator(:) value(block)operator(;) - key(text-align)operator(:) value(right)operator(;) - -operator(}) - - -comment(/*) comment(Dialog) comment(default) comment(button) comment(styles) comment(*/) - -class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default) operator({) - - key(border-color)operator(:) color(#304369)operator(;) - key(background-position)operator(:) float(0) float(-1400px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default) class(.first-child) operator({) - - key(border-color)operator(:) color(#304369)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default) type(button) operator({) - - key(color)operator(:) color(#fff)operator(;) - -operator(}) - - -comment(/*) comment(SimpleDialog) comment(icon) comment(styles) comment(*/) - -class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) class(.yui-icon) operator({) - - key(background)operator(:) string value(no-repeat) float(0) float(0)operator(;) - key(width)operator(:) float(16px)operator(;) - key(height)operator(:) float(16px)operator(;) - key(margin-right)operator(:) float(10px)operator(;) - key(float)operator(:) value(left)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.blckicon) operator({) - - key(background-position)operator(:) float(0) float(-1100px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.alrticon) operator({) - - key(background-position)operator(:) float(0) float(-1050px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.hlpicon) operator({) - - key(background-position)operator(:) float(0) float(-1150px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.infoicon) operator({) - - key(background-position)operator(:) float(0) float(-1200px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.warnicon) operator({) - - key(background-position)operator(:) float(0) float(-1900px)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.tipicon) operator({) - - key(background-position)operator(:) float(0) float(-1250px)operator(;) - -operator(}) - - -comment(/*) comment(Tooltip) comment(styles) comment(*/) - -class(.yui-skin-sam) class(.yui-tt) class(.bd) operator({) - - key(position)operator(:) value(relative)operator(;) - key(top)operator(:) float(0)operator(;) - key(left)operator(:) float(0)operator(;) - key(z-index)operator(:) float(1)operator(;) - key(color)operator(:) color(#000)operator(;) - key(padding)operator(:) float(2px) float(5px)operator(;) - key(border-color)operator(:) color(#D4C237) color(#A6982B) color(#A6982B) color(#A6982B)operator(;) - key(border-width)operator(:) float(1px)operator(;) - key(border-style)operator(:) value(solid)operator(;) - key(background-color)operator(:) color(#FFEE69)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-tt)class(.show-scrollbars) class(.bd) operator({) - - key(overflow)operator(:) value(auto)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-tt-shadow) operator({) - - key(top)operator(:) float(2px)operator(;) - key(right)operator(:) float(-3px)operator(;) - key(left)operator(:) float(-3px)operator(;) - key(bottom)operator(:) float(-3px)operator(;) - key(background-color)operator(:) color(#000)operator(;) - -operator(}) - -class(.yui-skin-sam) class(.yui-tt-shadow-visible) operator({) - - key(opacity)operator(:) float(.12)operator(;) - error(*)key(filter)operator(:) stringoperator(;) comment(/*) comment(For) comment(IE) comment(*/) - -operator(})comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-overlay)operator(,)class(.yui-panel-container)operator({)key(visibility)operator(:)value(hidden)operator(;)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(2)operator(;)operator(})class(.yui-panel-container) type(form)operator({)key(margin)operator(:)float(0)operator(;)operator(})class(.mask)operator({)key(z-index)operator(:)float(1)operator(;)key(display)operator(:)value(none)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(0)operator(;)key(left)operator(:)float(0)operator(;)key(right)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-panel-container) type(select)operator({)key(_visibility)operator(:)value(inherit)operator(;)operator(})class(.masked) type(select)operator(,)class(.drag) type(select)operator(,)class(.hide-select) type(select)operator({)key(_visibility)operator(:)value(hidden)operator(;)operator(})class(.hide-scrollbars)operator(,)class(.hide-scrollbars) type(*)operator({)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.hide-scrollbars) type(select)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.show-scrollbars)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-panel-container)class(.show-scrollbars)operator(,)class(.yui-tt)class(.show-scrollbars)operator({)key(overflow)operator(:)value(visible)operator(;)operator(})class(.yui-panel-container)class(.show-scrollbars) class(.underlay)operator(,)class(.yui-tt)class(.show-scrollbars) class(.yui-tt-shadow)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-tt-shadow)operator({)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-skin-sam) class(.mask)operator({)key(background-color)operator(:)color(#000)operator(;)key(opacity)operator(:)float(.25)operator(;)error(*)key(filter)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)operator({)key(padding)operator(:)float(0) float(1px)operator(;)error(*)key(padding)operator(:)float(2px) float(3px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel)operator({)key(position)operator(:)value(relative)operator(;)error(*)key(zoom)operator(:)float(1)operator(;)key(left)operator(:)float(0)operator(;)key(top)operator(:)float(0)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(1px) float(0)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.hd)operator(,)class(.yui-skin-sam) class(.yui-panel) class(.bd)operator(,)class(.yui-skin-sam) class(.yui-panel) class(.ft)operator({)error(*)key(zoom)operator(:)float(1)operator(;)error(*)key(position)operator(:)value(relative)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(0) float(1px)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(margin)operator(:)float(0) float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.hd)operator({)key(border-bottom)operator(:)value(solid) float(1px) color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.bd)operator(,)class(.yui-skin-sam) class(.yui-panel) class(.ft)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.hd)operator({)key(padding)operator(:)float(0) float(10px)operator(;)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(2)operator(;)error(*)key(line-height)operator(:)float(1)float(.9)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(color)operator(:)color(#000)operator(;)key(background)operator(:)string value(repeat-x) float(0) float(-200px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.bd)operator({)key(padding)operator(:)float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel) class(.ft)operator({)key(border-top)operator(:)value(solid) float(1px) color(#808080)operator(;)key(padding)operator(:)float(5px) float(10px)operator(;)key(font-size)operator(:)float(77%)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.focused) class(.yui-panel) class(.hd)operator({)operator(})class(.yui-skin-sam) class(.container-close)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(5px)operator(;)key(right)operator(:)float(6px)operator(;)key(width)operator(:)float(25px)operator(;)key(height)operator(:)float(15px)operator(;)key(background)operator(:)string value(no-repeat) float(0) float(-300px)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container) class(.underlay)operator({)key(right)operator(:)float(-1px)operator(;)key(left)operator(:)float(-1px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.matte)operator({)key(padding)operator(:)float(9px) float(10px)operator(;)key(background-color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.shadow)operator({)key(_padding)operator(:)float(2px) float(5px) float(0) float(3px)operator(;)operator(})class(.yui-skin-sam) class(.yui-panel-container)class(.shadow) class(.underlay)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(2px)operator(;)key(right)operator(:)float(-3px)operator(;)key(bottom)operator(:)float(-3px)operator(;)key(left)operator(:)float(-3px)operator(;)error(*)key(top)operator(:)float(3px)operator(;)error(*)key(left)operator(:)float(-1px)operator(;)error(*)key(right)operator(:)float(-1px)operator(;)error(*)key(bottom)operator(:)float(-1px)operator(;)key(_top)operator(:)float(0)operator(;)key(_right)operator(:)float(0)operator(;)key(_bottom)operator(:)float(0)operator(;)key(_left)operator(:)float(0)operator(;)key(_margin-top)operator(:)float(3px)operator(;)key(_margin-left)operator(:)float(-1px)operator(;)key(background-color)operator(:)color(#000)operator(;)key(opacity)operator(:)float(.12)operator(;)error(*)key(filter)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft)operator({)key(border-top)operator(:)value(none)operator(;)key(padding)operator(:)float(0) float(10px) float(10px) float(10px)operator(;)key(font-size)operator(:)float(100%)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.button-group)operator({)key(display)operator(:)value(block)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default)operator({)key(border-color)operator(:)color(#304369)operator(;)key(background-position)operator(:)float(0) float(-1400px)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default) class(.first-child)operator({)key(border-color)operator(:)color(#304369)operator(;)operator(})class(.yui-skin-sam) class(.yui-dialog) class(.ft) class(.default) type(button)operator({)key(color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) class(.yui-icon)operator({)key(background)operator(:)string value(no-repeat) float(0) float(0)operator(;)key(width)operator(:)float(16px)operator(;)key(height)operator(:)float(16px)operator(;)key(margin-right)operator(:)float(10px)operator(;)key(float)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.blckicon)operator({)key(background-position)operator(:)float(0) float(-1100px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.alrticon)operator({)key(background-position)operator(:)float(0) float(-1050px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.hlpicon)operator({)key(background-position)operator(:)float(0) float(-1150px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.infoicon)operator({)key(background-position)operator(:)float(0) float(-1200px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.warnicon)operator({)key(background-position)operator(:)float(0) float(-1900px)operator(;)operator(})class(.yui-skin-sam) class(.yui-simple-dialog) class(.bd) type(span)class(.tipicon)operator({)key(background-position)operator(:)float(0) float(-1250px)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt) class(.bd)operator({)key(position)operator(:)value(relative)operator(;)key(top)operator(:)float(0)operator(;)key(left)operator(:)float(0)operator(;)key(z-index)operator(:)float(1)operator(;)key(color)operator(:)color(#000)operator(;)key(padding)operator(:)float(2px) float(5px)operator(;)key(border-color)operator(:)color(#D4C237) color(#A6982B) color(#A6982B) color(#A6982B)operator(;)key(border-width)operator(:)float(1px)operator(;)key(border-style)operator(:)value(solid)operator(;)key(background-color)operator(:)color(#FFEE69)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt)class(.show-scrollbars) class(.bd)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt-shadow)operator({)key(top)operator(:)float(2px)operator(;)key(right)operator(:)float(-3px)operator(;)key(left)operator(:)float(-3px)operator(;)key(bottom)operator(:)float(-3px)operator(;)key(background-color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-tt-shadow-visible)operator({)key(opacity)operator(:)float(.12)operator(;)error(*)key(filter)operator(:)stringoperator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*)comment(foundational) comment(css)comment(*/) -type(table)class(.yui-dt-table) operator({) - key(table-layout)operator(:)value(fixed)operator(;) -operator(}) - -type(th) class(.yui-dt-header) operator({) - key(position)operator(:)value(relative)operator(;) -operator(}) - -type(th) class(.yui-dt-label) operator({) - key(position)operator(:)value(relative)operator(;) -operator(}) - -type(th) class(.yui-dt-resizer) operator({) - key(position)operator(:)value(absolute)operator(;) - key(margin-right)operator(:)float(-6px)operator(;) - key(right)operator(:)float(0)operator(;) - key(bottom)operator(:)float(0)operator(;) - key(width)operator(:)float(6px)operator(;) - key(height)operator(:)float(100%)operator(;) - key(cursor)operator(:)value(w-resize)operator(;) - key(cursor)operator(:)value(col-resize)operator(;) -operator(}) - -comment(/*) comment(foundational) comment(scrolling) comment(css) comment(*/) -class(.yui-dt-scrollable) operator({) - error(*)key(overflow-y)operator(:)value(auto)operator(;) comment(/*) comment(for) comment(ie) comment(*/) -operator(}) -class(.yui-dt-scrollable) type(thead) operator({) - key(display)operator(:)value(block)operator(;) comment(/*) comment(for) comment(safari) comment(and) comment(opera) comment(*/) -operator(}) -class(.yui-dt-scrollable) type(thead) type(tr) operator({) - key(position)operator(:)value(relative)operator(;) comment(/*) comment(for) comment(ie) comment(*/) -operator(}) -class(.yui-dt-scrollbody) operator({) - key(display)operator(:)value(block)operator(;) comment(/*) comment(for) comment(safari) comment(and) comment(opera) comment(*/) - key(overflow)operator(:)value(auto)operator(;) comment(/*) comment(for) comment(gecko) comment(*/) -operator(}) - -class(.yui-dt-editor) operator({) - key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(9000)operator(;) -operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*)comment(foundational) comment(css)comment(*/) -class(.yui-dt-table) type(th)operator(,) class(.yui-dt-table) type(td) operator({) - key(overflow)operator(:)value(hidden)operator(;) -operator(}) - -type(th) class(.yui-dt-header) operator({) - key(position)operator(:)value(relative)operator(;) -operator(}) - -type(th) class(.yui-dt-label) operator({) - key(position)operator(:)value(relative)operator(;) - key(border-right)operator(:)float(10px)operator(;) -operator(}) - -type(th) class(.yui-dt-resizer) operator({) - key(position)operator(:)value(absolute)operator(;) - key(margin-right)operator(:)float(-6px)operator(;) - key(right)operator(:)float(0)operator(;) - key(bottom)operator(:)float(0)operator(;) - key(width)operator(:)float(6px)operator(;) - key(height)operator(:)float(100%)operator(;) - key(cursor)operator(:)value(w-resize)operator(;) - key(cursor)operator(:)value(col-resize)operator(;) -operator(}) - -comment(/*) comment(foundational) comment(scrolling) comment(css) comment(*/) -class(.yui-dt-scrollable) operator({) - error(*)key(overflow-y)operator(:)value(auto)operator(;) comment(/*) comment(for) comment(ie) comment(*/) -operator(}) -class(.yui-dt-scrollable) type(thead) operator({) - key(display)operator(:)value(block)operator(;) comment(/*) comment(for) comment(safari) comment(and) comment(opera) comment(*/) -operator(}) -class(.yui-dt-scrollable) type(thead) type(tr) operator({) - key(position)operator(:)value(relative)operator(;) comment(/*) comment(for) comment(ie) comment(*/) -operator(}) -class(.yui-dt-scrollbody) operator({) - key(display)operator(:)value(block)operator(;) comment(/*) comment(for) comment(safari) comment(and) comment(opera) comment(*/) - key(overflow)operator(:)value(auto)operator(;) comment(/*) comment(for) comment(gecko) comment(*/) -operator(}) - -class(.yui-dt-editor) operator({) - key(position)operator(:)value(absolute)operator(;) -operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(basic) comment(skin) comment(styles) comment(*/) -class(.yui-skin-sam) class(.yui-dt-table) operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-family)operator(:)value(arial)operator(;)key(font-size)operator(:)value(inherit)operator(;)key(border-collapse)operator(:)value(collapse)operator(;)key(border)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)operator(}) -class(.yui-skin-sam) class(.yui-dt-table) type(caption) operator({)key(padding-bottom)operator(:)float(1em)operator(;)key(text-align)operator(:)value(left)operator(;)operator(}) -class(.yui-skin-sam) class(.yui-dt-table) type(th) operator({) - key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;) comment(/*) comment(header) comment(gradient) comment(*/) -operator(}) -class(.yui-skin-sam) class(.yui-dt-table) type(th)operator(,) -class(.yui-skin-sam) class(.yui-dt-table) type(th) type(a) operator({) - key(font-weight)operator(:)value(normal)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(color)operator(:)color(#000)operator(;) comment(/*) comment(header) comment(text) comment(*/) - key(vertical-align)operator(:)value(bottom)operator(;) -operator(}) -class(.yui-skin-sam) class(.yui-dt-table) type(th)operator(,) -class(.yui-skin-sam) class(.yui-dt-table) type(td) operator({) - key(padding)operator(:)float(4px) float(10px) float(4px) float(10px)operator(;) comment(/*) comment(cell) comment(padding) comment(*/) - key(border-right)operator(:)float(1px) value(solid) color(#CBCBCB)operator(;) comment(/*) comment(inner) comment(column) comment(border) comment(*/) -operator(}) -class(.yui-skin-sam) class(.yui-dt-table) type(td) operator({) - key(text-align)operator(:)value(left)operator(;) -operator(}) -class(.yui-skin-sam) class(.yui-dt-table) type(th)class(.yui-dt-last)operator(,) -class(.yui-skin-sam) class(.yui-dt-table) type(td)class(.yui-dt-last) operator({) - key(border-right)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;) comment(/*) comment(outer) comment(border) comment(*/) -operator(}) -class(.yui-skin-sam) class(.yui-dt-list) type(td) operator({) - key(border-right)operator(:)value(none)operator(;) comment(/*) comment(disable) comment(inner) comment(column) comment(border) comment(in) comment(list) comment(mode) comment(*/) -operator(}) -class(.yui-skin-sam) class(.yui-dt-table) type(thead) operator({) - key(border)operator(:)float(1px) value(solid) color(#989898)operator(;) comment(/*) comment(outer) comment(border) comment(*/) -operator(}) -class(.yui-skin-sam) class(.yui-dt-table) type(tbody) operator({) - key(border-left)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)key(border-bottom)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;) comment(/*) comment(outer) comment(border) comment(*/) -operator(}) - -comment(/*) comment(messaging) comment(*/) -class(.yui-skin-sam) class(.yui-dt-loading) operator({) - key(background-color)operator(:)color(#FFF)operator(;) -operator(}) - -class(.yui-skin-sam) class(.yui-dt-loading) operator({) - key(background-color)operator(:)color(#FFF)operator(;) -operator(}) - -comment(/*) comment(sortable) comment(columns) comment(*/) -class(.yui-skin-sam) class(.yui-dt-sortable) operator({) - key(cursor)operator(:)value(pointer)operator(;) -operator(}) -class(.yui-skin-sam) type(th)class(.yui-dt-sortable) operator({) - key(padding-right)operator(:)float(5px)operator(;) comment(/*) comment(room) comment(for) comment(arrow) comment(*/) -operator(}) -class(.yui-skin-sam) type(th)class(.yui-dt-sortable) class(.yui-dt-label) operator({) - key(margin-right)operator(:)float(15px)operator(;) comment(/*) comment(room) comment(for) comment(arrow) comment(*/) -operator(}) -class(.yui-skin-sam) type(th)class(.yui-dt-asc)operator(,) -class(.yui-skin-sam) type(th)class(.yui-dt-desc) operator({) - key(background)operator(:)string value(repeat-x) float(0) float(-100px)operator(;) comment(/*) comment(sorted) comment(header) comment(gradient) comment(*/) -operator(}) -class(.yui-skin-sam) type(th)class(.yui-dt-asc) class(.yui-dt-header) operator({) - key(background)operator(:)string value(no-repeat) value(right)operator(;) comment(/*) comment(sorted) comment(header) comment(gradient) comment(*/) - comment(/*)comment(background-image:) comment(url('../img/arrow_up.gif'\);) comment(background-repeat:no-repeat;) comment(background-position:right;) comment(sorted) comment(header) comment(icon) comment(*/) -operator(}) -class(.yui-skin-sam) type(th)class(.yui-dt-desc) class(.yui-dt-header) operator({) - key(background)operator(:)string value(no-repeat) value(right)operator(;) comment(/*) comment(sorted) comment(header) comment(gradient) comment(*/) - comment(/*)comment(background-image:) comment(url('../img/arrow_dn.gif'\);) comment(background-repeat:no-repeat;) comment(background-position:right;) comment(/*sorted) comment(header) comment(icon) comment(*/) -operator(}) - -comment(/*) comment(editing) comment(*/) -class(.yui-dt-editable) operator({) - key(cursor)operator(:)value(pointer)operator(;) -operator(}) -class(.yui-dt-editor) operator({) - key(text-align)operator(:)value(left)operator(;) - key(background-color)operator(:)color(#F2F2F2)operator(;) - key(border)operator(:)float(1px) value(solid) color(#808080)operator(;) - key(padding)operator(:)float(6px)operator(;) -operator(}) -class(.yui-dt-editor) type(label) operator({) - key(padding-left)operator(:)float(4px)operator(;)key(padding-right)operator(:)float(6px)operator(;) -operator(}) -class(.yui-dt-editor) class(.yui-dt-button) operator({) - key(padding-top)operator(:)float(6px)operator(;)key(text-align)operator(:)value(right)operator(;) -operator(}) -class(.yui-dt-editor) class(.yui-dt-button) type(button) operator({) - key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;) - key(border)operator(:)float(1px) value(solid) color(#999)operator(;) - key(width)operator(:)float(4em)operator(;)key(height)operator(:)float(1.8em)operator(;) - key(margin-left)operator(:)float(6px)operator(;) -operator(}) -class(.yui-dt-editor) class(.yui-dt-button) type(button)class(.yui-dt-default) operator({) - key(background)operator(:)string value(repeat-x) float(0) float(-1400px)operator(;) - key(background-color)operator(:) color(#5584E0)operator(;) - key(border)operator(:)float(1px) value(solid) color(#304369)operator(;) - key(color)operator(:)color(#FFF) -operator(}) -class(.yui-dt-editor) class(.yui-dt-button) type(button)pseudo_class(:hover) operator({) - key(background)operator(:)string value(repeat-x) float(0) float(-1300px)operator(;) - key(color)operator(:)color(#000)operator(;) -operator(}) -class(.yui-dt-editor) class(.yui-dt-button) type(button)pseudo_class(:active) operator({) - key(background)operator(:)string value(repeat-x) float(0) float(-1700px)operator(;) - key(color)operator(:)color(#000)operator(;) -operator(}) - -comment(/*) comment(striping) comment(*/) -class(.yui-skin-sam) type(tr)class(.yui-dt-even) operator({) key(background-color)operator(:)color(#FFF)operator(;) operator(}) comment(/*) comment(white) comment(*/) -class(.yui-skin-sam) type(tr)class(.yui-dt-odd) operator({) key(background-color)operator(:)color(#EDF5FF)operator(;) operator(}) comment(/*) comment(light) comment(blue) comment(*/) -class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-asc)operator(,) -class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-desc) operator({) key(background-color)operator(:)color(#EDF5FF)operator(;) operator(}) comment(/*) comment(light) comment(blue) comment(sorted) comment(*/) -class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-asc)operator(,) -class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-desc) operator({) key(background-color)operator(:)color(#DBEAFF)operator(;) operator(}) comment(/*) comment(dark) comment(blue) comment(sorted) comment(*/) - -comment(/*) comment(disable) comment(striping) comment(in) comment(list) comment(mode) comment(*/) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) operator({) key(background-color)operator(:)color(#FFF)operator(;) operator(}) comment(/*) comment(white) comment(*/) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) operator({) key(background-color)operator(:)color(#FFF)operator(;) operator(}) comment(/*) comment(white) comment(*/) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-asc)operator(,) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-desc) operator({) key(background-color)operator(:)color(#EDF5FF)operator(;) operator(}) comment(/*) comment(light) comment(blue) comment(sorted) comment(*/) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-asc)operator(,) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-desc) operator({) key(background-color)operator(:)color(#EDF5FF)operator(;) operator(}) comment(/*) comment(light) comment(blue) comment(sorted) comment(*/) - -comment(/*) comment(highlighting) comment(*/) -class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted)operator(,) -class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-asc)operator(,) -class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-desc)operator(,) -class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-highlighted)operator(,) -class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-highlighted) operator({) - key(cursor)operator(:)value(pointer)operator(;) - key(background-color)operator(:)color(#B2D2FF)operator(;) comment(/*) comment(med) comment(blue) comment(hover) comment(*/) -operator(}) - -comment(/*) comment(enable) comment(highlighting) comment(in) comment(list) comment(mode) comment(*/) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted)operator(,) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-asc)operator(,) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-desc)operator(,) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-highlighted)operator(,) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-highlighted) operator({) - key(cursor)operator(:)value(pointer)operator(;) - key(background-color)operator(:)color(#B2D2FF)operator(;) comment(/*) comment(med) comment(blue) comment(hover) comment(*/) -operator(}) - -comment(/*) comment(selection) comment(*/) -class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)operator(,) -class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-asc)operator(,) -class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-desc) operator({) - key(background-color)operator(:)color(#426FD9)operator(;) comment(/*) comment(bright) comment(blue) comment(selected) comment(row) comment(*/) - key(color)operator(:)color(#FFF)operator(;) -operator(}) -class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-selected)operator(,) -class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-selected) operator({) - key(background-color)operator(:)color(#446CD7)operator(;) comment(/*) comment(bright) comment(blue) comment(selected) comment(cell) comment(*/) - key(color)operator(:)color(#FFF)operator(;) -operator(}) - -comment(/*) comment(enable) comment(selection) comment(in) comment(list) comment(mode) comment(*/) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)operator(,) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-asc)operator(,) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-desc) operator({) - key(background-color)operator(:)color(#426FD9)operator(;) comment(/*) comment(bright) comment(blue) comment(selected) comment(row) comment(*/) - key(color)operator(:)color(#FFF)operator(;) -operator(}) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-selected)operator(,) -class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-selected) operator({) - key(background-color)operator(:)color(#446CD7)operator(;) comment(/*) comment(bright) comment(blue) comment(selected) comment(cell) comment(*/) - key(color)operator(:)color(#FFF)operator(;) -operator(}) - -comment(/*) comment(pagination) comment(*/) -class(.yui-skin-sam) class(.yui-dt-paginator) operator({) - key(display)operator(:)value(block)operator(;)key(margin)operator(:)float(6px) float(0)operator(;)key(white-space)operator(:)value(nowrap)operator(;) -operator(}) -class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-first)operator(,) -class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-last)operator(,) -class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-selected) operator({) - key(padding)operator(:)float(2px) float(6px)operator(;) -operator(}) -class(.yui-skin-sam) class(.yui-dt-paginator) type(a)class(.yui-dt-first)operator(,) -class(.yui-skin-sam) class(.yui-dt-paginator) type(a)class(.yui-dt-last) operator({) - key(text-decoration)operator(:)value(none)operator(;) -operator(}) -class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-previous)operator(,) -class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-next) operator({) - key(display)operator(:)value(none)operator(;) -operator(}) -class(.yui-skin-sam) type(a)class(.yui-dt-page) operator({) - key(border)operator(:)float(1px) value(solid) color(#CBCBCB)operator(;) - key(padding)operator(:)float(2px) float(6px)operator(;) - key(text-decoration)operator(:)value(none)operator(;) -operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -type(table)class(.yui-dt-table)operator({)key(table-layout)operator(:)value(fixed)operator(;)operator(})type(th) class(.yui-dt-header)operator({)key(position)operator(:)value(relative)operator(;)operator(})type(th) class(.yui-dt-label)operator({)key(position)operator(:)value(relative)operator(;)operator(})type(th) class(.yui-dt-resizer)operator({)key(position)operator(:)value(absolute)operator(;)key(margin-right)operator(:)float(-6px)operator(;)key(right)operator(:)float(0)operator(;)key(bottom)operator(:)float(0)operator(;)key(width)operator(:)float(6px)operator(;)key(height)operator(:)float(100%)operator(;)key(cursor)operator(:)value(w-resize)operator(;)key(cursor)operator(:)value(col-resize)operator(;)operator(})class(.yui-dt-scrollable)operator({)error(*)key(overflow-y)operator(:)value(auto)operator(;)operator(})class(.yui-dt-scrollable) type(thead)operator({)key(display)operator(:)value(block)operator(;)operator(})class(.yui-dt-scrollable) type(thead) type(tr)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-dt-scrollbody)operator({)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-dt-editor)operator({)key(position)operator(:)value(absolute)operator(;)key(z-index)operator(:)float(9000)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-family)operator(:)value(arial)operator(;)key(font-size)operator(:)value(inherit)operator(;)key(border-collapse)operator(:)value(collapse)operator(;)key(border)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(caption)operator({)key(padding-bottom)operator(:)float(1em)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)operator(,)class(.yui-skin-sam) class(.yui-dt-table) type(th) type(a)operator({)key(font-weight)operator(:)value(normal)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(color)operator(:)color(#000)operator(;)key(vertical-align)operator(:)value(bottom)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)operator(,)class(.yui-skin-sam) class(.yui-dt-table) type(td)operator({)key(padding)operator(:)float(4px) float(10px) float(4px) float(10px)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#CBCBCB)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(td)operator({)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(th)class(.yui-dt-last)operator(,)class(.yui-skin-sam) class(.yui-dt-table) type(td)class(.yui-dt-last)operator({)key(border-right)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(td)operator({)key(border-right)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(thead)operator({)key(border)operator(:)float(1px) value(solid) color(#989898)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-table) type(tbody)operator({)key(border-left)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)key(border-bottom)operator(:)float(1px) value(solid) color(#7F7F7F)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-loading)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-loading)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-sortable)operator({)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-sortable)operator({)key(padding-right)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-sortable) class(.yui-dt-label)operator({)key(margin-right)operator(:)float(15px)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(th)class(.yui-dt-desc)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-100px)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-asc) class(.yui-dt-header)operator({)key(background)operator(:)string value(no-repeat) value(right)operator(;)operator(})class(.yui-skin-sam) type(th)class(.yui-dt-desc) class(.yui-dt-header)operator({)key(background)operator(:)string value(no-repeat) value(right)operator(;)operator(})class(.yui-dt-editable)operator({)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-dt-editor)operator({)key(text-align)operator(:)value(left)operator(;)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(padding)operator(:)float(6px)operator(;)operator(})class(.yui-dt-editor) type(label)operator({)key(padding-left)operator(:)float(4px)operator(;)key(padding-right)operator(:)float(6px)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button)operator({)key(padding-top)operator(:)float(6px)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(border)operator(:)float(1px) value(solid) color(#999)operator(;)key(width)operator(:)float(4em)operator(;)key(height)operator(:)float(1.8em)operator(;)key(margin-left)operator(:)float(6px)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)class(.yui-dt-default)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1400px)operator(;)key(background-color)operator(:)color(#5584E0)operator(;)key(border)operator(:)float(1px) value(solid) color(#304369)operator(;)key(color)operator(:)color(#FFF)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)pseudo_class(:hover)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1300px)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-dt-editor) class(.yui-dt-button) type(button)pseudo_class(:active)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1700px)operator(;)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-even)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-odd)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#DBEAFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd)operator({)key(background-color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-desc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-highlighted)operator({)key(cursor)operator(:)value(pointer)operator(;)key(background-color)operator(:)color(#B2D2FF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-highlighted) type(td)class(.yui-dt-desc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-highlighted)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-highlighted)operator({)key(cursor)operator(:)value(pointer)operator(;)key(background-color)operator(:)color(#B2D2FF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#426FD9)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-selected)operator(,)class(.yui-skin-sam) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-selected)operator({)key(background-color)operator(:)color(#446CD7)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-asc)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-selected) type(td)class(.yui-dt-desc)operator({)key(background-color)operator(:)color(#426FD9)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-even) type(td)class(.yui-dt-selected)operator(,)class(.yui-skin-sam) class(.yui-dt-list) type(tr)class(.yui-dt-odd) type(td)class(.yui-dt-selected)operator({)key(background-color)operator(:)color(#446CD7)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator)operator({)key(display)operator(:)value(block)operator(;)key(margin)operator(:)float(6px) float(0)operator(;)key(white-space)operator(:)value(nowrap)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-first)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-last)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-selected)operator({)key(padding)operator(:)float(2px) float(6px)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator) type(a)class(.yui-dt-first)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) type(a)class(.yui-dt-last)operator({)key(text-decoration)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-previous)operator(,)class(.yui-skin-sam) class(.yui-dt-paginator) class(.yui-dt-next)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) type(a)class(.yui-dt-page)operator({)key(border)operator(:)float(1px) value(solid) color(#CBCBCB)operator(;)key(padding)operator(:)float(2px) float(6px)operator(;)key(text-decoration)operator(:)value(none)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(Set) comment(the) comment(cusrsor) comment(to) comment(busy) comment(when) comment(we) comment(are) comment(doing) comment(something) comment(*/) -class(.yui-busy) operator({) - key(cursor)operator(:) value(wait) important(!important)operator(;) -operator(}) - -comment(/*) comment(Setup) comment(the) comment(container) comment(with) comment(some) comment(padding) comment(and) comment(zoom) comment(it) comment(for) comment(IE's) comment(hasLayout) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-subcont) operator({) - key(padding)operator(:) float(.25em) float(0)operator(;) - key(zoom)operator(:) float(1)operator(;) -operator(}) -comment(/*) comment(When) comment(collapsed) comment(set) comment(the) comment(toolbars) comment(container) comment(to) comment(display) comment(none) comment(*/) -class(.yui-toolbar-container-collapsed) class(.yui-toolbar-subcont) operator({) - key(display)operator(:) value(none)operator(;) -operator(}) -comment(/*) comment(Setup) comment(the) comment(:after) comment(so) comment(that) comment(compliant) comment(browsers) comment(don't) comment(loose) comment(the) comment(bounding) comment(box) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-subcont)pseudo_class(:after) operator({) key(display)operator(:) value(block)operator(;) key(clear)operator(:) value(both)operator(;) key(visibility)operator(:) value(hidden)operator(;) key(content)operator(:) stringoperator(;) key(height)operator(:) float(0)operator(;)operator(}) - -comment(/*) comment(Drag) comment(handle) comment(for) comment(the) comment(toolbar's) comment(draggable) comment(property) comment(*/) -class(.yui-toolbar-container) type(span)class(.yui-toolbar-draghandle) operator({) - key(cursor)operator(:) value(move)operator(;) - key(border-left)operator(:) float(1px) value(solid) color(#999)operator(;) - key(border-right)operator(:) float(1px) value(solid) color(#999)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(text-indent)operator(:) float(77777px)operator(;) - key(width)operator(:) float(2px)operator(;) - key(height)operator(:) float(20px)operator(;) - key(display)operator(:) value(block)operator(;) - key(clear)operator(:) value(none)operator(;) - key(float)operator(:) value(left)operator(;) - key(margin)operator(:) float(0) float(0) float(0) float(.2em)operator(;) -operator(}) -comment(/*) comment(If) comment(the) comment(titlebar) comment(is) comment(draggable,) comment(the) comment(set) comment(the) comment(cursor) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-titlebar)class(.draggable) operator({) - key(cursor)operator(:) value(move)operator(;) -operator(}) -comment(/*) comment(Set) comment(the) comment(titlebar) comment(to) comment(relative) comment(so) comment(we) comment(can) comment(position) comment(the) comment(collapse) comment(button) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-titlebar) operator({) - key(position)operator(:) value(relative)operator(;) -operator(}) -comment(/*) comment(Toolbar's) comment(titlebar) comment(styles) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(h2) operator({) - key(font-weight)operator(:) value(bold)operator(;) - key(letter-spacing)operator(:) float(0)operator(;) - key(border)operator(:) value(none)operator(;) - key(color)operator(:) color(#000)operator(;) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(.2em)operator(;) -operator(}) -comment(/*) comment(If) comment(the) comment(toolbar) comment(is) comment(grouped) comment(the) comment(draghandle) comment(needs) comment(to) comment(be) comment(bigger) comment(*/) -class(.yui-toolbar-container)class(.yui-toolbar-grouped) type(span)class(.yui-toolbar-draghandle) operator({) - key(height)operator(:) float(40px)operator(;) -operator(}) - -comment(/*) comment(Float) comment(the) comment(groups) comment(so) comment(they) comment(position) comment(nicely) comment(and) comment(zoom) comment(them) comment(for) comment(IE) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-group) operator({) - key(float)operator(:) value(left)operator(;) - key(zoom)operator(:) float(1)operator(;) -operator(}) -comment(/*) comment(Setup) comment(the) comment(:after) comment(so) comment(that) comment(compliant) comment(browsers) comment(don't) comment(loose) comment(the) comment(bounding) comment(box) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-group)pseudo_class(:after) operator({) key(display)operator(:) value(block)operator(;) key(clear)operator(:) value(both)operator(;) key(visibility)operator(:) value(hidden)operator(;) key(content)operator(:) stringoperator(;) key(height)operator(:) float(0)operator(;)operator(}) -comment(/*) comment(Grouped) comment(title) comment(styles) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-group) type(h3) operator({) - key(font-size)operator(:) float(75%)operator(;) - key(padding)operator(:) float(0) float(0) float(0) float(.25em)operator(;) - key(margin)operator(:) float(0)operator(;) -operator(}) -comment(/*) comment(Style) comment(the) comment(separators) comment(with) comment(a) comment(left) comment(border) comment(*/) -class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator) operator({) - key(width)operator(:) float(2px)operator(;) - key(height)operator(:) float(18px)operator(;) - key(margin)operator(:) float(.2em) float(0) float(.2em) float(.1em)operator(;) - key(display)operator(:) value(block)operator(;) - key(clear)operator(:) value(none)operator(;) - key(float)operator(:) value(left)operator(;) -operator(}) -comment(/*) comment(Set) comment(the) comment(height) comment(of) comment(a) comment(grouped) comment(separator) comment(to) comment(a) comment(little) comment(bit) comment(bigger) comment(*/) -class(.yui-toolbar-container)class(.yui-toolbar-grouped) type(span)class(.yui-toolbar-separator) operator({) - key(height)operator(:) float(35px)operator(;) -operator(}) - -comment(/*) comment(Reset) comment(the) comment(height) comment(of) comment(a) comment(separator) comment(inside) comment(of) comment(a) comment(group) comment(*/) -class(.yui-toolbar-container)class(.yui-toolbar-grouped) class(.yui-toolbar-group) type(span)class(.yui-toolbar-separator) operator({) - key(height)operator(:) float(18px)operator(;) -operator(}) - -comment(/*) comment(Kill) comment(the) comment(default) comment(styles) comment(of) comment(the) comment(list) comment(*/) -class(.yui-toolbar-container) type(ul) type(li) operator({) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(0)operator(;) - key(list-style-type)operator(:) value(none)operator(;) -operator(}) -comment(/*) comment(Hide) comment(the) comment(group) comment(labels) comment(when) comment(the) comment(.yui-toolbar-nogrouplabels) comment(class) comment(is) comment(applied) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) type(h3) operator({) - key(display)operator(:) value(none)operator(;) -operator(}) - -comment(/*) comment(Setup) comment(the) comment(default) comment(style) comment(of) comment(a) comment(button) comment(in) comment(the) comment(toolbar) comment(*/) -class(.yui-toolbar-container) class(.yui-push-button)operator(,) -class(.yui-toolbar-container) class(.yui-color-button)operator(,) -class(.yui-toolbar-container) class(.yui-menu-button) operator({) -comment(/*)comment(.yui-toolbar-container) comment(.yui-button) comment({)comment(*/) - key(position)operator(:) value(relative)operator(;) - key(cursor)operator(:) value(pointer)operator(;) -operator(}) - -comment(/*) comment(setup) comment(the) comment(default) comment(style) comment(of) comment(the) comment(A) comment(inside) comment(of) comment(the) comment(toolbar) comment(button) comment(*/) -class(.yui-toolbar-container) class(.yui-button) class(.first-child)operator(,) class(.yui-toolbar-container) class(.yui-button) class(.first-child) type(a) operator({) - key(height)operator(:) float(100%)operator(;) - key(width)operator(:) float(100%)operator(;) - key(overflow)operator(:) value(hidden)operator(;) -operator(}) - -comment(/*) comment(Setup) comment(the) comment(disabled) comment(state) comment(of) comment(a) comment(button) comment(*/) -class(.yui-toolbar-container) class(.yui-button-disabled) operator({) - key(cursor)operator(:) value(default)operator(;) -operator(}) -comment(/*) comment(Disable) comment(the) comment(icon) comment(too) comment(*/) -class(.yui-toolbar-container) class(.yui-button-disabled) class(.yui-toolbar-icon) operator({) - key(opacity)operator(:) float(.5)operator(;) - key(filter)operator(:) stringoperator(;) -operator(}) -comment(/*)comment(Disabled) comment(Spin) comment(button) comment(arrows)comment(*/) -class(.yui-toolbar-container) class(.yui-button-disabled) class(.up)operator(,) -class(.yui-toolbar-container) class(.yui-button-disabled) class(.down) operator({) - key(opacity)operator(:) float(.5)operator(;) - key(filter)operator(:) stringoperator(;) -operator(}) -comment(/*) comment(remove) comment(any) comment(padding) comment(from) comment(the) comment(A) comment(*/) -class(.yui-toolbar-container) class(.yui-button) type(a) operator({) - key(overflow)operator(:) value(hidden)operator(;) -operator(}) - -comment(/*) comment(Override) comment(the) comment(default) comment(Button) comment(style) comment(for) comment(select) comment(menu)comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-select) class(.first-child) type(a) operator({) - key(cursor)operator(:) value(pointer)operator(;) -operator(}) - -comment(/*) comment(Font) comment(Family) comment(Menu) comment(Style) comment(-) comment(This) comment(styles) comment(the) comment(menu) comment(items) comment(and) comment(the) comment(selected) comment(menu) comment(item) comment(*/) -class(.yui-toolbar-fontname-arial) operator({) key(font-family)operator(:) value(Arial)operator(;) operator(}) -class(.yui-toolbar-fontname-arial-black) operator({) key(font-family)operator(:) value(Arial) value(Black)operator(;) operator(}) -class(.yui-toolbar-fontname-comic-sans-ms) operator({) key(font-family)operator(:) value(Comic) value(Sans) value(MS)operator(;) operator(}) -class(.yui-toolbar-fontname-courier-new) operator({) key(font-family)operator(:) value(Courier) value(New)operator(;) operator(}) -class(.yui-toolbar-fontname-times-new-roman) operator({) key(font-family)operator(:) value(Times) value(New) value(Roman)operator(;) operator(}) -class(.yui-toolbar-fontname-verdana) operator({) key(font-family)operator(:) value(Verdana)operator(;) operator(}) -class(.yui-toolbar-fontname-impact) operator({) key(font-family)operator(:) value(Impact)operator(;) operator(}) -class(.yui-toolbar-fontname-lucida-console) operator({) key(font-family)operator(:) value(Lucida) value(Console)operator(;) operator(}) -class(.yui-toolbar-fontname-tahoma) operator({) key(font-family)operator(:) value(Tahoma)operator(;) operator(}) -class(.yui-toolbar-fontname-trebuchet-ms) operator({) key(font-family)operator(:) value(Trebuchet) value(MS)operator(;) operator(}) - -comment(/*) comment(Spin) comment(Button) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) operator({) - key(position)operator(:) value(relative)operator(;) -operator(}) - -comment(/*) comment(Setup) comment(the) comment(default) comment(style) comment(for) comment(the) comment(A) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child) type(a) operator({) - key(z-index)operator(:) float(0)operator(;) - key(opacity)operator(:) float(1)operator(;) -operator(}) - -comment(/*) comment(Setup) comment(the) comment(position) comment(and) comment(style) comment(for) comment(the) comment(up) comment(and) comment(down) comment(arrows) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up)operator(,) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down) operator({) - key(position)operator(:) value(absolute)operator(;) - key(display)operator(:) value(block) - value(right)operator(:) float(0)operator(;) - key(cursor)operator(:) value(pointer)operator(;) - key(z-index)operator(:) float(1)operator(;) - key(padding)operator(:) float(0)operator(;) - key(margin)operator(:) float(0)operator(;) -operator(}) -comment(/*) comment(Position) comment(all) comment(panels/overlays) comment(as) comment(absolute) comment(by) comment(default) comment(*/) -class(.yui-toolbar-container) class(.yui-overlay) operator({) - key(position)operator(:) value(absolute)operator(;) -operator(}) -comment(/*) comment(Smash) comment(the) comment(default) comment(style) comment(for) comment(lists) comment(*/) -class(.yui-toolbar-container) class(.yui-overlay) type(ul) type(li) operator({) - key(margin)operator(:) float(0)operator(;) - key(list-style-type)operator(:) value(none)operator(;) -operator(}) - -comment(/*) comment(Reset) comment(the) comment(z-index) comment(of) comment(the) comment(toolbar) comment(container) comment(so) comment(that) comment(menu's) comment(appear) comment(over) comment(the) comment(iframe) comment(in) comment(IE) comment(and) comment(Safari) comment(*/) -class(.yui-toolbar-container) operator({) - key(z-index)operator(:) float(1)operator(;) -operator(}) - -comment(/*) comment(The) comment(div) comment(around) comment(the) comment(iFrame) comment(*/) -class(.yui-editor-container) class(.yui-editor-editable-container) operator({) - key(position)operator(:) value(relative)operator(;) - key(z-index)operator(:) float(0)operator(;) -operator(}) -comment(/*) comment(The) comment(disbled) comment(state) comment(of) comment(the) comment(Editor) comment(*/) -class(.yui-editor-container) class(.yui-editor-masked) operator({) - key(background-color)operator(:) color(#CCC)operator(;) -operator(}) -comment(/*) comment(Style) comment(the) comment(eidtable) comment(iframe) comment(to) comment(hide) comment(it) comment(*/) -class(.yui-editor-container) type(iframe) operator({) - key(border)operator(:) float(0px)operator(;) - key(padding)operator(:) float(0)operator(;) - key(margin)operator(:) float(0)operator(;) -operator(}) -comment(/*) comment(Reset) comment(some) comment(padding) comment(on) comment(the) comment(editable) comment(iframes) comment(container) comment(*/) -class(.yui-editor-container) class(.yui-editor-editable) operator({) - key(padding)operator(:) float(0)operator(;) - key(margin)operator(:) float(0)operator(;) -operator(}) -comment(/*) comment(Style) comment(the) comment(dom) comment(path) comment(box) comment(at) comment(the) comment(bottom) comment(of) comment(the) comment(editor) comment(*/) -class(.yui-editor-container) class(.dompath) operator({) - key(font-size)operator(:) float(85%)operator(;) -operator(}) -comment(/*) comment(Header) comment(styles) comment(for) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-editor-panel) class(.hd) operator({) - key(text-align)operator(:) value(left)operator(;) - key(position)operator(:) value(relative)operator(;) -operator(}) -comment(/*) comment(Setup) comment(some) comment(padding) comment(around) comment(the) comment(h3) comment(*/) -class(.yui-editor-panel) class(.hd) type(h3) operator({) - key(font-weight)operator(:) value(bold)operator(;) - key(padding)operator(:) float(0.25em) float(0pt) float(0.25em) float(0.25em)operator(;) - key(margin)operator(:) float(0)operator(;) -operator(}) - -comment(/*) comment(set) comment(it) comment(to) comment(relative) comment(so) comment(we) comment(can) comment(position) comment(the) comment(close) comment(button) comment(-) comment(Zoom) comment(it) comment(for) comment(IE) comment(*/) -class(.yui-editor-panel) class(.bd) operator({) - key(width)operator(:) float(100%)operator(;) - key(zoom)operator(:) float(1)operator(;) - key(position)operator(:) value(relative)operator(;) -operator(}) -comment(/*) comment(Setup) comment(some) comment(padding) comment(for) comment(the) comment(body) comment(container) comment(-) comment(Zoom) comment(it) comment(for) comment(IE) comment(*/) -class(.yui-editor-panel) class(.bd) type(div)class(.yui-editor-body-cont) operator({) - key(padding)operator(:) float(.25em) float(.1em)operator(;) - key(zoom)operator(:) float(1)operator(;) -operator(}) - -comment(/*) comment(Setup) comment(the) comment(:after) comment(so) comment(that) comment(compliant) comment(browsers) comment(don't) comment(loose) comment(the) comment(bounding) comment(box) comment(*/) -class(.yui-editor-panel) class(.bd) type(div)class(.yui-editor-body-cont)pseudo_class(:after) operator({) key(display)operator(:) value(block)operator(;) key(clear)operator(:) value(both)operator(;) key(visibility)operator(:) value(hidden)operator(;) key(content)operator(:) stringoperator(;) key(height)operator(:) float(0)operator(;)operator(}) - -comment(/*) comment(style) comment(the) comment(footer) comment(of) comment(the) comment(property) comment(editor) comment(*/) -class(.yui-editor-panel) class(.ft) operator({) - key(text-align)operator(:) value(right)operator(;) - key(width)operator(:) float(99%)operator(;) - key(float)operator(:) value(left)operator(;) - key(clear)operator(:) value(both)operator(;) -operator(}) - -comment(/*) comment(Style) comment(the) comment("tip") comment(icon) comment(*/) -class(.yui-editor-panel) class(.ft) type(span)class(.tip) operator({) - key(display)operator(:) value(block)operator(;) - key(position)operator(:) value(relative)operator(;) - key(padding)operator(:) float(.5em) float(.5em) float(.5em) float(23px)operator(;) - key(text-align)operator(:)value(left)operator(;) - key(zoom)operator(:) float(1)operator(;) -operator(}) - - -comment(/*) comment(setup) comment(some) comment(form) comment(fields) comment(*/) -class(.yui-editor-panel) type(label) operator({) - key(clear)operator(:) value(both)operator(;) - key(float)operator(:) value(left)operator(;) - key(padding)operator(:) float(0)operator(;) - key(width)operator(:) float(100%)operator(;) - key(text-align)operator(:) value(left)operator(;) - key(zoom)operator(:) float(1)operator(;) -operator(}) -comment(/*) comment(This) comment(fixes) comment(the) comment(caret) comment(issue) comment(in) comment(Firefox) comment(*/) -class(.yui-editor-panel) class(.gecko) type(label) operator({) - key(overflow)operator(:) value(auto)operator(;) -operator(}) -comment(/*) comment(more) comment(form) comment(fields) comment(*/) -class(.yui-editor-panel) type(label) type(strong) operator({) - key(float)operator(:) value(left)operator(;) - key(width)operator(:) float(6em)operator(;) -operator(}) - -comment(/*) comment(The) comment(remove) comment(link) comment(in) comment(the) comment(Link) comment(Property) comment(Editor) comment(*/) -class(.yui-editor-panel) class(.removeLink) operator({) - key(width)operator(:) float(80%)operator(;) - key(text-align)operator(:) value(right)operator(;) -operator(}) - -comment(/*) comment(More) comment(form) comment(styling) comment(*/) -class(.yui-editor-panel) type(label) type(input) operator({) - key(margin-left)operator(:) float(.25em)operator(;) - key(float)operator(:) value(left)operator(;) -operator(}) - -comment(/*) comment(Image) comment(Padding) comment(in) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-group-padding) operator({) -operator(}) - -comment(/*) comment(Image) comment(Border) comment(in) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-group-border) operator({) -operator(}) - -comment(/*) comment(Image) comment(Text) comment(Flow) comment(in) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-group-textflow) operator({) -operator(}) - -comment(/*) comment(Image) comment(Height/Width) comment(in) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-editor-panel) class(.height-width) operator({) - key(float)operator(:) value(left)operator(;) -operator(}) -comment(/*) comment(Image) comment(Height/Width) comment(title) comment(*/) -class(.yui-editor-panel) class(.height-width) type(h3) operator({) -operator(}) -comment(/*) comment(Image) comment(Height/Width) comment(container) comment(*/) -class(.yui-editor-panel) class(.height-width) type(span) operator({) - key(font-style)operator(:) value(italic)operator(;) - key(display)operator(:) value(block)operator(;) - key(float)operator(:) value(left)operator(;) - key(overflow)operator(:)value(auto)operator(;) -operator(}) -comment(/*) comment(Image) comment(Height/Width) comment(original) comment(info) comment(container) comment(*/) -class(.yui-editor-panel) class(.height-width) type(span)class(.info) operator({) - key(font-size)operator(:) float(70%)operator(;) -operator(}) - -comment(/*) comment(Border) comment(Size/Type) comment(button) comment(widths) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-bordersize)operator(,) class(.yui-editor-panel) class(.yui-toolbar-bordertype) operator({) - key(font-size)operator(:) float(75%)operator(;) -operator(}) - -comment(/*) comment(Kill) comment(the) comment(separators) comment(in) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator) operator({) - key(border)operator(:) value(none)operator(;) -operator(}) - -comment(/*) comment(Border) comment(Type) comment(solid) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)operator(,) -class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span) operator({) - key(display)operator(:) value(block)operator(;) - key(height)operator(:) float(8px)operator(;) - key(left)operator(:) float(4px)operator(;) - key(position)operator(:) value(absolute)operator(;) - key(top)operator(:) float(3px)operator(;) - error(*)key(top)operator(:) float(-5px)operator(;) - key(width)operator(:) float(24px)operator(;) -operator(}) -comment(/*) comment(Border) comment(Type) comment(solid) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-solid) operator({) - key(border-bottom)operator(:) float(1px) value(solid) value(black)operator(;) -operator(}) -comment(/*) comment(Border) comment(Type) comment(dotted) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-dotted) operator({) - key(border-bottom)operator(:) float(1px) value(dotted) value(black)operator(;) -operator(}) -comment(/*) comment(Border) comment(Type) comment(dashed) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-dashed) operator({) - key(border-bottom)operator(:) float(1px) value(dashed) value(black)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(0) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-0) operator({) - error(*)key(top)operator(:) float(0px)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(1) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-1) operator({) - key(border-bottom)operator(:) float(1px) value(solid) value(black)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(2) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-2) operator({) - key(border-bottom)operator(:) float(2px) value(solid) value(black)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(3) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-3) operator({) - key(top)operator(:) float(2px)operator(;) - error(*)key(top)operator(:) float(-5px)operator(;) - key(border-bottom)operator(:) float(3px) value(solid) value(black)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(4) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-4) operator({) - key(top)operator(:) float(1px)operator(;) - error(*)key(top)operator(:) float(-5px)operator(;) - key(border-bottom)operator(:) float(4px) value(solid) value(black)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(5) comment(*/) -class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-5) operator({) - key(top)operator(:) float(1px)operator(;) - error(*)key(top)operator(:) float(-5px)operator(;) - key(border-bottom)operator(:) float(5px) value(solid) value(black)operator(;) -operator(}) - -comment(/*) comment(Border) comment(Size) comment(menu) comment(size) comment(*/) -class(.yui-toolbar-container) class(.yui-toolbar-bordersize-menu)operator(,) -class(.yui-toolbar-container) class(.yui-toolbar-bordertype-menu) operator({) - key(width)operator(:) float(95px) important(!important)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(menu) comment(styles) comment(*/) -class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel)operator(,) class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel)operator(,) -class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel)operator(,) class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel)pseudo_class(:hover) operator({) - key(margin)operator(:)float(0px) float(3px) float(7px) float(17px)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(menu) comment(styles) comment(-) comment(Checked) comment(*/) -class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel) class(.checkedindicator)operator(,) class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel) class(.checkedindicator) operator({) - key(position)operator(:) value(absolute)operator(;) - key(left)operator(:) float(-12px)operator(;) - error(*)key(top)operator(:) float(14px)operator(;) - error(*)key(left)operator(:) float(0px)operator(;) -operator(}) - -comment(/*) comment(Border) comment(Size) comment(1) comment(-) comment(Menu) comment(Item) comment(*/) -class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-1) type(a) operator({) - key(border-bottom)operator(:) float(1px) value(solid) value(black)operator(;) - key(height)operator(:) float(14px)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(2) comment(-) comment(Menu) comment(Item) comment(*/) -class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-2) type(a) operator({) - key(border-bottom)operator(:) float(2px) value(solid) value(black)operator(;) - key(height)operator(:) float(14px)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(3) comment(-) comment(Menu) comment(Item) comment(*/) -class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-3) type(a) operator({) - key(border-bottom)operator(:) float(3px) value(solid) value(black)operator(;) - key(height)operator(:) float(14px)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(4) comment(-) comment(Menu) comment(Item) comment(*/) -class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-4) type(a) operator({) - key(border-bottom)operator(:) float(4px) value(solid) value(black)operator(;) - key(height)operator(:) float(14px)operator(;) -operator(}) -comment(/*) comment(Border) comment(Size) comment(5) comment(-) comment(Menu) comment(Item) comment(*/) -class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-5) type(a) operator({) - key(border-bottom)operator(:) float(5px) value(solid) value(black)operator(;) - key(height)operator(:) float(14px)operator(;) -operator(}) - - -comment(/*) comment(Border) comment(Type) comment(Solid) comment(-) comment(Menu) comment(Item) comment(*/) -class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-solid) type(a) operator({) - key(border-bottom)operator(:) float(1px) value(solid) value(black)operator(;) - key(height)operator(:) float(14px)operator(;) -operator(}) -comment(/*) comment(Border) comment(Type) comment(Dashed) comment(-) comment(Menu) comment(Item) comment(*/) -class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-dashed) type(a) operator({) - key(border-bottom)operator(:) float(1px) value(dashed) value(black)operator(;) - key(height)operator(:) float(14px)operator(;) -operator(}) -comment(/*) comment(Border) comment(Type) comment(Dotted) comment(-) comment(Menu) comment(Item) comment(*/) -class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-dotted) type(a) operator({) - key(border-bottom)operator(:) float(1px) value(dotted) value(black)operator(;) - key(height)operator(:) float(14px)operator(;) -operator(}) - -comment(/*) comment(Hidden) comment(Headers) comment(for) comment(Accessibility) comment(*/) -type(h2)class(.yui-editor-skipheader)operator(,) type(h3)class(.yui-editor-skipheader) operator({) - key(height)operator(:) float(0)operator(;) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(0)operator(;) - key(border)operator(:) value(none)operator(;) - key(width)operator(:) float(0)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(position)operator(:) value(absolute)operator(;) -operator(}) - -comment(/*) comment(Setup) comment(the) comment(default) comment(look) comment(of) comment(a) comment(color) comment(menu) comment(and) comment(Zoom) comment(it) comment(for) comment(IE) comment(*/) -class(.yui-toolbar-colors) operator({) - key(width)operator(:) float(133px)operator(;) - key(zoom)operator(:) float(1)operator(;) - key(display)operator(:) value(none)operator(;) - key(z-index)operator(:) float(100)operator(;) - key(overflow)operator(:) value(hidden)operator(;) -operator(}) - -comment(/*) comment(Setup) comment(the) comment(:after) comment(so) comment(that) comment(compliant) comment(browsers) comment(don't) comment(loose) comment(the) comment(bounding) comment(box) comment(*/) -class(.yui-toolbar-colors)pseudo_class(:after) operator({) key(display)operator(:) value(block)operator(;) key(clear)operator(:) value(both)operator(;) key(visibility)operator(:) value(hidden)operator(;) key(content)operator(:) stringoperator(;) key(height)operator(:) float(0)operator(;)operator(}) -comment(/*) comment(Style) comment(all) comment(of) comment(the) comment(A's) comment(so) comment(the) comment(float) comment(properly) comment(*/) -class(.yui-toolbar-colors) type(a) operator({) - key(height)operator(:) float(9px)operator(;) - key(width)operator(:) float(9px)operator(;) - key(float)operator(:) value(left)operator(;) - key(display)operator(:) value(block)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(text-indent)operator(:) float(999px)operator(;) - key(margin)operator(:) float(0)operator(;) - key(cursor)operator(:) value(pointer)operator(;) - key(border)operator(:) float(1px) value(solid) color(#F6F7EE)operator(;) -operator(}) -comment(/*) comment(Put) comment(a) comment(little) comment(border) comment(around) comment(one) comment(that) comment(is) comment(hovered) comment(over) comment(*/) -class(.yui-toolbar-colors) type(a)pseudo_class(:hover) operator({) - key(border)operator(:) float(1px) value(solid) value(black)operator(;) -operator(}) - -comment(/*) comment(Smash) comment(the) comment(inhertited) comment(Menu) comment(style) comment(*/) -class(.yui-color-button-menu) operator({) - key(overflow)operator(:) value(visible)operator(;) - key(background-color)operator(:) value(transparent)operator(;) -operator(}) - -comment(/*) comment(This) comment(is) comment(the) comment(preview) comment(box) comment(at) comment(the) comment(bottom) comment(of) comment(the) comment(menu) comment(-) comment(Zoom) comment(it) comment(for) comment(IE) comment(*/) -class(.yui-toolbar-colors) type(span) operator({) - key(position)operator(:) value(relative)operator(;) - key(display)operator(:) value(block)operator(;) - key(padding)operator(:) float(3px)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(float)operator(:) value(left)operator(;) - key(width)operator(:) float(100%)operator(;) - key(zoom)operator(:) float(1)operator(;) -operator(}) -comment(/*) comment(Setup) comment(the) comment(:after) comment(so) comment(that) comment(compliant) comment(browsers) comment(don't) comment(loose) comment(the) comment(bounding) comment(box) comment(*/) -class(.yui-toolbar-colors) type(span)pseudo_class(:after) operator({) key(display)operator(:) value(block)operator(;) key(clear)operator(:) value(both)operator(;) key(visibility)operator(:) value(hidden)operator(;) key(content)operator(:) stringoperator(;) key(height)operator(:) float(0)operator(;)operator(}) - -comment(/*) comment(This) comment(is) comment(the) comment(box) comment(with) comment(the) comment(color) comment(preview) comment(in) comment(it) comment(*/) -class(.yui-toolbar-colors) type(span) type(em) operator({) - key(height)operator(:) float(35px)operator(;) - key(width)operator(:) float(30px)operator(;) - key(float)operator(:) value(left)operator(;) - key(display)operator(:) value(block)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(text-indent)operator(:) float(999px)operator(;) - key(margin)operator(:) float(0.75px)operator(;) - key(border)operator(:) float(1px) value(solid) value(black)operator(;) -operator(}) - -comment(/*) comment(The) comment(container) comment(for) comment(the) comment(name) comment(and) comment(hex) comment(code) comment(*/) -class(.yui-toolbar-colors) type(span) type(strong) operator({) - key(font-weight)operator(:) value(normal)operator(;) - key(padding-left)operator(:) float(3px)operator(;) - key(display)operator(:) value(block)operator(;) - key(font-size)operator(:) float(85%)operator(;) - key(float)operator(:) value(left)operator(;) - key(width)operator(:) float(65%)operator(;) -operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(Place) comment(the) comment(border) comment(around) comment(the) comment(editor) comment(*/) -class(.yui-skin-sam) class(.yui-editor-container) operator({) - key(border)operator(:) float(1px) value(solid) color(#808080)operator(;) -operator(}) -comment(/*) comment(Color) comment(the) comment(border) comment(of) comment(the) comment(container) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) operator({) - key(zoom)operator(:) float(1)operator(;) -operator(}) -comment(/*) comment(Load) comment(the) comment(background) comment(image) comment(on) comment(the) comment(Toolbars) comment(titlebar) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar) operator({) - key(background)operator(:) string value(repeat-x) float(0) float(-200px)operator(;) - key(position)operator(:) value(relative)operator(;) -operator(}) - -comment(/*) comment(Give) comment(the) comment(titlebar) comment(some) comment(color) comment(and) comment(padding) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(h2) operator({) - key(color)operator(:) color(#000000)operator(;) - key(font-weight)operator(:) value(bold)operator(;) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(0.3em) float(1em)operator(;) - key(font-size)operator(:) float(100%)operator(;) - key(text-align)operator(:) value(left)operator(;) -operator(}) - -comment(/*) comment(Give) comment(the) comment(toolbars) comment(groups) comment(titles) comment(some) comment(color) comment(and) comment(padding) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-group) type(h3) operator({) - key(color)operator(:) color(#808080)operator(;) - key(font-size)operator(:) float(75%)operator(;) - key(margin)operator(:) float(1em) float(0) float(0)operator(;) - key(padding-bottom)operator(:) float(0)operator(;) - key(padding-left)operator(:) float(0.25em)operator(;) - key(text-align)operator(:) value(left)operator(;) -operator(}) - -comment(/*) comment(Hide) comment(all) comment(of) comment(the) comment(sepatators) comment(borders) comment(*/) -class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator) operator({) - key(border)operator(:) value(none)operator(;) - key(text-indent)operator(:) float(33px)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(margin)operator(:) float(.25em)operator(;) -operator(}) - -comment(/*) comment(Background) comment(color) comment(of) comment(the) comment(toolbar) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) operator({) - key(background-color)operator(:) color(#F2F2F2)operator(;) -operator(}) - -comment(/*) comment(Add) comment(some) comment(padding) comment(to) comment(the) comment(toolbars) comment(sub) comment(container) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-subcont) operator({) - key(padding)operator(:) float(0) float(1em) float(0.35em)operator(;) - key(border-bottom)operator(:)float(1px) value(solid) color(#808080)operator(;) -operator(}) -comment(/*) comment(When) comment(the) comment(collapsed) comment(class) comment(is) comment(added,) comment(add) comment(a) comment(border) comment(to) comment(the) comment(bottom) comment(of) comment(the) comment(titlebar) comment((since) comment(the) comment(toolbar) comment(itself) comment(is) comment(display) comment(none\)) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container-collapsed) class(.yui-toolbar-titlebar) operator({) - key(border-bottom)operator(:)float(1px) value(solid) color(#808080)operator(;) -operator(}) - -comment(/*) comment(Remove) comment(the) comment(shadows) comment(from) comment(the) comment(menus) comment(in) comment(the) comment(toolbar) comment(-) comment(Menu.css) comment(override) comment(*/) -class(.yui-skin-sam) class(.yui-editor-container) class(.visible) class(.yui-menu-shadow)operator(,) class(.yui-skin-sam) class(.yui-editor-panel) class(.visible) class(.yui-menu-shadow) operator({) - key(display)operator(:) value(none)operator(;) -operator(}) - -comment(/*) comment(Remove) comment(padding/margin) comment(from) comment(lists) comment(*/) -class(.yui-skin-sam) class(.yui-editor-container) type(ul) operator({) - key(list-style-type)operator(:) value(none)operator(;) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(0)operator(;) -operator(}) -comment(/*) comment(Remove) comment(padding/margin) comment(from) comment(list) comment(items) comment(*/) -class(.yui-skin-sam) class(.yui-editor-container) type(ul) type(li) operator({) - key(list-style-type)operator(:) value(none)operator(;) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(0)operator(;) -operator(}) -comment(/*) comment(Float) comment(the) comment(LI's) comment(that) comment(wrap) comment(the) comment(buttons) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-group) type(ul) type(li)class(.yui-toolbar-groupitem) operator({) - key(float)operator(:) value(left)operator(;) -operator(}) - -comment(/*) comment(Set) comment(the) comment(color) comment(and) comment(the) comment(border) comment(of) comment(the) comment(dompath) comment(container) comment(at) comment(the) comment(bottom) comment(of) comment(the) comment(editor) comment(*/) -class(.yui-skin-sam) class(.yui-editor-container) class(.dompath) operator({) - key(background-color)operator(:) color(#F2F2F2)operator(;) - key(border-top)operator(:)float(1px) value(solid) color(#808080)operator(;) - key(color)operator(:) color(#999)operator(;) - key(text-align)operator(:) value(left)operator(;) - key(padding)operator(:) float(0.25em)operator(;) -operator(}) - -comment(/*) comment(Set) comment(the) comment(image) comment(for) comment(the) comment(collapse) comment(button) comment(on) comment(the) comment(toolbar) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.collapse) operator({) - key(background)operator(:) string value(no-repeat) float(0) float(-400px)operator(;) -operator(}) -comment(/*) comment(Position) comment(the) comment(image) comment(and) comment(the) comment(container) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(span)class(.collapse) operator({) - key(cursor)operator(:) value(pointer)operator(;) - key(position)operator(:) value(absolute)operator(;) - key(top)operator(:) float(4px)operator(;) - key(right)operator(:) float(2px)operator(;) - key(display)operator(:) value(block)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(height)operator(:) float(15px)operator(;) - key(width)operator(:) float(15px)operator(;) - key(text-indent)operator(:) float(9999px)operator(;) -operator(}) - -comment(/*) comment(Set) comment(the) comment(default) comment(styles) comment(for) comment(the) comment(buttons) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) operator({) - key(background)operator(:) string value(repeat-x) float(0) float(0)operator(;) - key(position)operator(:) value(relative)operator(;) - key(display)operator(:) value(block)operator(;) - key(height)operator(:) float(22px)operator(;) - key(width)operator(:) float(30px)operator(;) - key(margin)operator(:) float(0)operator(;) - key(border-color)operator(:) color(#808080)operator(;) - key(border-style)operator(:) value(solid)operator(;) - key(border-width)operator(:) float(1px) float(0)operator(;) -operator(}) -comment(/*) comment(Set) comment(the) comment(height) comment(of) comment(the) comment(buttons) comment(and) comment(pad) comment(them) comment(on) comment(the) comment(left) comment(for) comment(the) comment(icon) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) type(a)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) type(a)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) type(a) operator({) - key(padding-left)operator(:) float(35px)operator(;) - key(height)operator(:) float(20px)operator(;) - key(text-decoration)operator(:) value(none)operator(;) - key(font-size)operator(:) float(93%)operator(;) - key(line-height)operator(:) float(2)operator(;) - key(display)operator(:) value(block)operator(;) - key(color)operator(:) color(#000000)operator(;) - key(overflow)operator(:) value(hidden)operator(;) -operator(}) -comment(/*) comment(Set) comment(the) comment(height) comment(of) comment(the) comment(buttons) comment(and) comment(pad) comment(them) comment(on) comment(the) comment(left) comment(for) comment(the) comment(icon) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) class(.first-child)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) class(.first-child)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) class(.first-child) operator({) - key(border-color)operator(:) color(#808080)operator(;) - key(border-style)operator(:) value(solid)operator(;) - key(border-width)operator(:) float(0) float(1px)operator(;) - key(margin)operator(:) float(0) float(-1px)operator(;) - key(display)operator(:) value(block)operator(;) -operator(}) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled) class(.first-child)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled) class(.first-child)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled) class(.first-child) operator({) - key(border-color)operator(:) color(#ccc)operator(;) -operator(}) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled) type(a)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled) type(a)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled) type(a) operator({) - key(color)operator(:) color(#A6A6A6)operator(;) - key(cursor)operator(:) value(default)operator(;) -operator(}) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled) operator({) - key(border-color)operator(:) color(#ccc)operator(;) -operator(}) -comment(/*) comment(IE) comment(needs) comment(a) comment(little) comment(help) comment(positioning) comment(the) comment(first) comment(child) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button) class(.first-child) operator({) - error(*)key(left)operator(:) float(0px)operator(;) -operator(}) - -comment(/*) comment(Font) comment(Family) comment(Drop) comment(Down) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-fontname) operator({) - key(width)operator(:) float(135px)operator(;) -operator(}) - -comment(/*) comment(Header) comment(Drop) comment(Down) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-heading) operator({) - key(width)operator(:) float(92px)operator(;) -operator(}) - -comment(/*) comment(Handle) comment(the) comment(hover) comment(state) comment(of) comment(the) comment(buttons) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-hover) operator({) - key(background)operator(:)string value(repeat-x) float(0) float(-1300px)operator(;) - key(border-color)operator(:) color(#808080)operator(;) -operator(}) - -comment(/*) comment(Handle) comment(the) comment(selected) comment(state) comment(of) comment(the) comment(buttons) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-selected) operator({) - key(background)operator(:) string value(repeat-x) float(0) float(-1700px)operator(;) - key(border-color)operator(:) color(#808080)operator(;) -operator(}) -comment(/*) comment(When) comment(the) comment(nogrouplabels) comment(class) comment(is) comment(applied,) comment(set) comment(the) comment(h3's) comment(to) comment(display) comment(none) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) type(h3) operator({) - key(display)operator(:) value(none)operator(;) -operator(}) -comment(/*) comment(When) comment(not) comment(showing) comment(the) comment(h3) comment(group) comment(labels,) comment(add) comment(some) comment(margin) comment(to) comment(make) comment(up) comment(for) comment(them)comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) class(.yui-toolbar-group) operator({) - key(margin-top)operator(:) float(.75em)operator(;) -operator(}) - - -comment(/*) comment(Handle) comment(the) comment(icon) comment(placeholder) comment(for) comment(the) comment(buttons) - comment(This) comment(is) comment(very) comment(important) comment(-) comment(position) comment(of) comment(this) comment(must) comment(be) comment(absolute.) - comment(If) comment(it) comment(is) comment(not) comment(positioned) comment(absolute,) comment(IE) comment(will) comment(place) comment(it) comment(over) comment(the) comment(a) comment(in) comment(the) comment(Toolbar) - comment(Doing) comment(this) comment(will) comment(cause) comment(the) comment(editor) comment(to) comment(loose) comment(focus) comment(and) comment(loose) comment(the) comment(selection.) -comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) type(span)class(.yui-toolbar-icon)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) type(span)class(.yui-toolbar-icon)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) type(span)class(.yui-toolbar-icon) operator({) - key(display)operator(:) value(block)operator(;) - key(position)operator(:) value(absolute)operator(;) - key(top)operator(:) float(2px)operator(;) - key(height)operator(:) float(18px)operator(;) - key(width)operator(:) float(18px)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(background)operator(:) string value(no-repeat) float(30px) float(30px)operator(;) -operator(}) - -comment(/*) comment(Swap) comment(out) comment(the) comment(image) comment(to) comment(an) comment(active) comment(image) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-selected) type(span)class(.yui-toolbar-icon)operator(,) class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-hover) type(span)class(.yui-toolbar-icon) operator({) - key(background-image)operator(:) stringoperator(;) -operator(}) -comment(/*) comment(Change) comment(the) comment(defaults) comment(to) comment(make) comment(them) comment(look) comment(more) comment(like) comment(the) comment(editor) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.visible) class(.yuimenuitemlabel) operator({) - key(cursor)operator(:) value(pointer)operator(;) - key(color)operator(:) color(#000)operator(;) - error(*)key(position)operator(:) value(relative)operator(;) -operator(}) - -comment(/*) comment(Set) comment(the) comment(background) comment(color) comment(of) comment(all) comment(menu) comment(containers) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-menu) operator({) - key(background-color)operator(:) color(#fff)operator(;) -operator(}) -comment(/*) comment(Set) comment(the) comment(background) comment(of) comment(all) comment(menu) comment(items) comment(that) comment(are) comment(selected) comment(*/) -class(.yui-skin-sam) type(div)class(.yuimenu) type(li)class(.selected) operator({) - key(background-color)operator(:) color(#B3D4FF)operator(;) -operator(}) -comment(/*) comment(Set) comment(the) comment(color) comment(of) comment(the) comment(hrefs) comment(in) comment(a) comment(selected) comment(menu) comment(item) comment(*/) -class(.yui-skin-sam) type(div)class(.yuimenu) type(li)class(.selected) type(a)class(.selected) operator({) - key(color)operator(:) color(#000)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-bold) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(0)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-italic) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-36px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-underline) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-72px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-subscript) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-180px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-superscript) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-144px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-forecolor) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-216px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-backcolor) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-288px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyleft) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-324px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifycenter) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-360px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyright) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-396px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyfull) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-432px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-indent) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-720px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-outdent) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-684px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-createlink) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-792px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertimage) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(1px) float(-756px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-left) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-972px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-right) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-936px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-inline) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-900px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-block) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-864px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-bordercolor) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-252px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-removeformat) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-1080px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-hiddenelements) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-1044px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertunorderedlist) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-468px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Setting) comment(the) comment(background) comment(position) comment(of) comment(the) comment(sprite) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertorderedlist) type(span)class(.yui-toolbar-icon) operator({) - key(background-position)operator(:) float(0) float(-504px)operator(;) - key(left)operator(:) float(5px)operator(;) -operator(}) -comment(/*) comment(Set) comment(the) comment(width) comment(of) comment(the) comment(spin) comment(buttons) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child) operator({) - key(width)operator(:) float(35px)operator(;) -operator(}) -comment(/*) comment(Pad) comment(the) comment(first) comment(child) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child) type(a) operator({) - key(padding-left)operator(:) float(2px)operator(;) - key(text-align)operator(:) value(left)operator(;) -operator(}) - -comment(/*) comment(Spin) comment(Buttons) comment(-) comment(Remove) comment(the) comment(icon) comment(holder,) comment(they) comment(don't) comment(need) comment(it) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(span)class(.yui-toolbar-icon) operator({) - key(display)operator(:) value(none)operator(;) -operator(}) - -comment(/*) comment(Spin) comment(Buttons) comment(-) comment(Prep) comment(the) comment(arrows) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up)operator(,) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down) operator({) - key(right)operator(:) float(2px)operator(;) - key(background)operator(:) string value(no-repeat) float(0) float(-1222px)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(height)operator(:) float(6px)operator(;) - key(width)operator(:) float(7px)operator(;) - key(min-height)operator(:) float(0)operator(;) - key(padding)operator(:) float(0)operator(;) -operator(}) -comment(/*) comment(Spin) comment(Buttons) comment(-) comment(The) comment(up) comment(arrow) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up) operator({) - key(top)operator(:) float(2px)operator(;) - key(background-position)operator(:) float(0) float(-1222px)operator(;) -operator(}) -comment(/*) comment(Spin) comment(Buttons) comment(-) comment(The) comment(down) comment(arrow) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down) operator({) - key(bottom)operator(:) float(2px)operator(;) - key(background-position)operator(:) float(0) float(-1187px)operator(;) -operator(}) -comment(/*) comment(Pad) comment(and) comment(align) comment(the) comment(Select) comment(Menus) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-select) class(.first-child) type(a) operator({) - key(padding-left)operator(:) float(5px)operator(;) - key(text-align)operator(:) value(left)operator(;) -operator(}) -comment(/*) comment(Set) comment(the) comment(icon) comment(of) comment(the) comment(select) comment(menu) comment(for) comment(the) comment(drop) comment(down) comment(arrow) comment(*/) -class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-select) type(span)class(.yui-toolbar-icon) operator({) - key(background)operator(:) string value(no-repeat) float(0) float(-1144px)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(right)operator(:) float(-2px)operator(;) - key(top)operator(:) float(0px)operator(;) - key(height)operator(:) float(20px)operator(;) -operator(}) -comment(/*) comment(Fix) comment(the) comment(color) comment(menu) comment(background) comment(if) comment(it's) comment(inside) comment(a) comment(Property) comment(Editor) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-color-button-menu) class(.bd) operator({) - key(background-color)operator(:) value(transparent)operator(;) - key(border)operator(:) value(none)operator(;) - key(width)operator(:) float(135px)operator(;) -operator(}) - -comment(/*) comment(Place) comment(a) comment(border) comment(around) comment(the) comment(color) comment(menu) comment(*/) -class(.yui-skin-sam) class(.yui-color-button-menu) class(.yui-toolbar-colors) operator({) - key(border)operator(:) float(1px) value(solid) color(#808080)operator(;) -operator(}) - - -comment(/*) comment(Property) comment(Editor) comment(Panel) comment(styles) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) operator({) - key(padding)operator(:) float(0)operator(;) - key(margin)operator(:) float(0)operator(;) - key(border)operator(:) value(none)operator(;) - key(background-color)operator(:) value(transparent)operator(;) - key(overflow)operator(:) value(visible)operator(;) -operator(}) - -comment(/*) comment(Margins) comment(on) comment(the) comment(header) comment(of) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) operator({) - key(margin)operator(:) float(10px) float(0) float(0)operator(;) - key(padding)operator(:) float(0)operator(;) - key(border)operator(:) value(none)operator(;) -operator(}) -comment(/*) comment(Setup) comment(the) comment(background) comment(image) comment(on) comment(the) comment(title) comment(bar) - comment(We) comment(are) comment(styling) comment(the) comment(h3) comment(instead) comment(if) comment(the) comment(div) comment(so) comment(we) comment(can) comment(make) comment(room) - comment(for) comment(the) comment("knob") comment(that) comment(floats) comment(on) comment(the) comment(top) comment(of) comment(the) comment(window.) -comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(h3) operator({) - key(color)operator(:) color(#000)operator(;) - key(border)operator(:) float(1px) value(solid) color(#808080)operator(;) - key(background)operator(:) string value(repeat-x) float(0) float(-200px)operator(;) - key(width)operator(:) float(99%)operator(;) - key(position)operator(:) value(relative)operator(;) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(3px) float(0) float(0) float(0)operator(;) - key(font-size)operator(:) float(93%)operator(;) - key(text-indent)operator(:) float(5px)operator(;) - key(height)operator(:) float(20px)operator(;) -operator(}) -comment(/*) comment(Style) comment(the) comment(body) comment(of) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.bd) operator({) - key(background-color)operator(:) color(#F2F2F2)operator(;) - key(border-left)operator(:) float(1px) value(solid) color(#808080)operator(;) - key(border-right)operator(:) float(1px) value(solid) color(#808080)operator(;) - key(width)operator(:) float(99%)operator(;) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(0)operator(;) - key(overflow)operator(:) value(visible)operator(;) -operator(}) -comment(/*) comment(Remove) comment(the) comment(padding/margin) comment(on) comment(lists) comment(in) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) type(ul) operator({) - key(list-style-type)operator(:) value(none)operator(;) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(0)operator(;) -operator(}) - -comment(/*) comment(Remove) comment(the) comment(padding/margin) comment(on) comment(list) comment(items) comment(in) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) type(ul) type(li) operator({) - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(0)operator(;) -operator(}) -comment(/*) comment(IE) comment(is) comment(havig) comment(trouble) comment(with) comment(our) comment(menu) comment(sizes) comment(here) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.yuimenu) operator({) - comment(/*)comment(*width:) comment(90px) comment(!important;)comment(*/) -operator(}) -comment(/*) comment(Remove) comment(the) comment(border) comment(from) comment(the) comment(toolbar's) comment(container) comment(and) comment(add) comment(some) comment(margin) comment(to) comment(it) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container) class(.yui-toolbar-subcont) operator({) - key(padding)operator(:) float(0)operator(;) - key(border)operator(:) value(none)operator(;) - key(margin-top)operator(:) float(0.35em)operator(;) -operator(}) -comment(/*) comment(Set) comment(the) comment(width) comment(of) comment(the) comment(bordersize) comment(and) comment(bordertype) comment(menu) comment(buttons) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-bordersize)operator(,) class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-bordertype) operator({) - key(width)operator(:) float(50px)operator(;) -operator(}) - -comment(/*) comment(Form) comment(styling) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) type(label) operator({) - key(display)operator(:) value(block)operator(;) - key(float)operator(:) value(none)operator(;) - key(padding)operator(:) float(4px) float(0)operator(;) - key(margin-bottom)operator(:) float(7px)operator(;) -operator(}) -comment(/*) comment(Form) comment(styling) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(strong) operator({) - key(font-weight)operator(:) value(normal)operator(;) - key(font-size)operator(:) float(93%)operator(;) - key(text-align)operator(:) value(right)operator(;) - key(padding-top)operator(:) float(2px)operator(;) -operator(}) - -comment(/*) comment(Form) comment(styling) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(input) operator({) - key(width)operator(:) float(75%)operator(;) -operator(}) -comment(/*) comment(Form) comment(styling) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) constant(#createlink_target)operator(,) -class(.yui-skin-sam) class(.yui-editor-panel) constant(#insertimage_target) operator({) - key(width)operator(:) value(auto)operator(;) - key(margin-right)operator(:) float(5px)operator(;) -operator(}) - -comment(/*) comment(Form) comment(styling) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.removeLink) operator({) - key(width)operator(:) float(98%)operator(;) -operator(}) -comment(/*) comment(Color) comment(the) comment(input) comment(yellow) comment(if) comment(it) comment(has) comment(the) comment(warning) comment(class) comment(applied) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(input)class(.warning) operator({) - key(background-color)operator(:) color(#FFEE69)operator(;) -operator(}) - -comment(/*) comment(Style) comment(the) comment(titles) comment(of) comment(the) comment(toolbar) comment(groups) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group) type(h3) operator({) - key(color)operator(:) color(#000)operator(;) - key(float)operator(:) value(left)operator(;) - key(font-weight)operator(:) value(normal)operator(;) - key(font-size)operator(:) float(93%)operator(;) - key(margin)operator(:) float(5px) float(0) float(0) float(0)operator(;) - key(padding)operator(:) float(0) float(3px) float(0) float(0)operator(;) - key(text-align)operator(:) value(right)operator(;) -operator(}) -comment(/*) comment(Style) comment(the) comment(header) comment(for) comment(the) comment(Height) comment(and) comment(Width) comment(boxes) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.height-width) type(h3) operator({) - key(margin)operator(:) float(3px) float(0) float(0) float(10px)operator(;) -operator(}) -comment(/*) comment(Style) comment(the) comment(height) comment(and) comment(width) comment(container) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.height-width) operator({) - key(margin)operator(:) float(3px) float(0) float(0) float(35px)operator(;) - error(*)key(margin-left)operator(:) float(14px)operator(;) - key(width)operator(:) float(42%)operator(;) - error(*)key(width)operator(:) float(44%)operator(;) -operator(}) -comment(/*) comment(Give) comment(the) comment(border) comment(group) comment(a) comment(width) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-border) operator({) - key(width)operator(:) float(190px)operator(;) -operator(}) -comment(/*) comment(Give) comment(the) comment(padding) comment(group) comment(a) comment(width) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-padding) operator({) - key(width)operator(:) float(203px)operator(;) -operator(}) -comment(/*) comment(Fix) comment(some) comment(margins) comment(for) comment(the) comment(H3's) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-padding) type(h3) operator({) - key(margin-left)operator(:) float(25px)operator(;) - error(*)key(margin-left)operator(:) float(12px)operator(;) -operator(}) -comment(/*) comment(Image) comment(Properties) comment(-) comment(Text) comment(flow) comment(container) comment(size) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-textflow) operator({) - key(width)operator(:) float(182px)operator(;) -operator(}) - -comment(/*) comment(Remove) comment(the) comment(background) comment(image) comment(set) comment(in) comment(Panel.css) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) operator({) - key(background)operator(:) value(none)operator(;) -operator(}) - -comment(/*) comment(Give) comment(the) comment(footer) comment(som) comment(color) comment(and) comment(a) comment(border) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) operator({) - key(background-color)operator(:) color(#F2F2F2)operator(;) - key(border)operator(:) float(1px) value(solid) color(#808080)operator(;) - key(border-top)operator(:) value(none)operator(;) - key(padding)operator(:) float(0)operator(;) - key(margin)operator(:) float(0) float(0) float(2px) float(0)operator(;) -operator(}) - -comment(/*) comment(Style) comment(the) comment(close) comment(button) comment(in) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(span)class(.close) operator({) - key(background)operator(:)string value(no-repeat) float(0) float(-300px)operator(;) - key(cursor)operator(:)value(pointer)operator(;) - key(display)operator(:)value(block)operator(;) - key(height)operator(:)float(16px)operator(;) - key(overflow)operator(:)value(hidden)operator(;) - key(position)operator(:)value(absolute)operator(;) - key(right)operator(:)float(5px)operator(;) - key(text-indent)operator(:)float(500px)operator(;) - key(top)operator(:)float(2px)operator(;) - key(width)operator(:)float(26px)operator(;) -operator(}) -comment(/*) comment(Style) comment(the) comment(tip) comment(in) comment(the) comment(footer) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) operator({) - key(background-color)operator(:) color(#EDF5FF)operator(;) - key(border-top)operator(:) float(1px) value(solid) color(#808080)operator(;) -operator(}) -comment(/*) comment(Style) comment(the) comment(tip) comment(in) comment(the) comment(footer) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(strong) operator({) - key(display)operator(:) value(block)operator(;) - key(float)operator(:) value(left)operator(;) - key(margin)operator(:) float(0) float(2px) float(8px) float(0)operator(;) -operator(}) - - -comment(/*) comment(Setup) comment(the) comment(icon) comment(for) comment(a) comment(tip) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon) operator({) - key(background)operator(:) string value(no-repeat) float(0) float(-1260px)operator(;) - key(display)operator(:) value(block)operator(;) - key(height)operator(:) float(20px)operator(;) - key(left)operator(:) float(2px)operator(;) - key(position)operator(:) value(absolute)operator(;) - key(top)operator(:) float(8px)operator(;) - key(width)operator(:) float(20px)operator(;) -operator(}) -comment(/*) comment(Setup) comment(the) comment(background) comment(image) comment(for) comment(an) comment(info) comment(icon) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon-info) operator({) - key(background-position)operator(:) float(2px) float(-1260px)operator(;) -operator(}) -comment(/*) comment(Setup) comment(the) comment(background) comment(image) comment(for) comment(a) comment(warning) comment(icon) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon-warn) operator({) - key(background-position)operator(:) float(2px) float(-1296px)operator(;) -operator(}) - -comment(/*) comment(Handle) comment(the) comment(knob) comment(that) comment(floats) comment(on) comment(top) comment(of) comment(the) comment(panel) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(span)class(.knob) operator({) - key(position)operator(:) value(absolute)operator(;) - key(height)operator(:) float(10px)operator(;) - key(width)operator(:) float(28px)operator(;) - key(top)operator(:) float(-10px)operator(;) - key(left)operator(:) float(25px)operator(;) - key(text-indent)operator(:) float(9999px)operator(;) - key(overflow)operator(:) value(hidden)operator(;) - key(background)operator(:) string value(no-repeat) float(0) float(0)operator(;) -operator(}) -comment(/*) comment(Reset) comment(some) comment(styles) comment(from) comment(the) comment(editor) comment(toolbar,) comment(when) comment(a) comment(toolbar) comment(is) comment(inside) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container) operator({) - key(float)operator(:) value(left)operator(;) - key(width)operator(:) float(100%)operator(;) - key(background-image)operator(:) value(none)operator(;) - key(border)operator(:) value(none)operator(;) -operator(}) -comment(/*) comment(Reset) comment(styles) comment(for) comment(menu) comment(buttons) comment(inside) comment(the) comment(Property) comment(Editor) comment(*/) -class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container) class(.bd) operator({) - key(background-color)operator(:) color(#ffffff)operator(;) -operator(}) - -comment(/*) comment(This) comment(image) comment(is) comment(the) comment(one) comment(used) comment(to) comment(place) comment(the) comment(blankimage) comment(placeholder) comment(into) comment(the) comment(editor) comment(when) comment(you) comment(click) comment(on) comment(Insert) comment(an) comment(Image) comment(*/) -class(.yui-editor-blankimage) operator({) - key(background-image)operator(:) stringoperator(;) -operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-busy)operator({)key(cursor)operator(:)value(wait) important(!important)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-subcont)operator({)key(padding)operator(:)float(.25em) float(0)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-container-collapsed) class(.yui-toolbar-subcont)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-subcont)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) type(span)class(.yui-toolbar-draghandle)operator({)key(cursor)operator(:)value(move)operator(;)key(border-left)operator(:)float(1px) value(solid) color(#999)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#999)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(text-indent)operator(:)float(77777px)operator(;)key(width)operator(:)float(2px)operator(;)key(height)operator(:)float(20px)operator(;)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(none)operator(;)key(float)operator(:)value(left)operator(;)key(margin)operator(:)float(0) float(0) float(0) float(.2em)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-titlebar)class(.draggable)operator({)key(cursor)operator(:)value(move)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-titlebar)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(h2)operator({)key(font-weight)operator(:)value(bold)operator(;)key(letter-spacing)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(color)operator(:)color(#000)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(.2em)operator(;)operator(})class(.yui-toolbar-container)class(.yui-toolbar-grouped) type(span)class(.yui-toolbar-draghandle)operator({)key(height)operator(:)float(40px)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-group)operator({)key(float)operator(:)value(left)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-group)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-group) type(h3)operator({)key(font-size)operator(:)float(75%)operator(;)key(padding)operator(:)float(0) float(0) float(0) float(.25em)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator)operator({)key(width)operator(:)float(2px)operator(;)key(height)operator(:)float(18px)operator(;)key(margin)operator(:)float(.2em) float(0) float(.2em) float(.1em)operator(;)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(none)operator(;)key(float)operator(:)value(left)operator(;)operator(})class(.yui-toolbar-container)class(.yui-toolbar-grouped) type(span)class(.yui-toolbar-separator)operator({)key(height)operator(:)float(35px)operator(;)operator(})class(.yui-toolbar-container)class(.yui-toolbar-grouped) class(.yui-toolbar-group) type(span)class(.yui-toolbar-separator)operator({)key(height)operator(:)float(18px)operator(;)operator(})class(.yui-toolbar-container) type(ul) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(list-style-type)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) type(h3)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container) class(.yui-push-button)operator(,)class(.yui-toolbar-container) class(.yui-color-button)operator(,)class(.yui-toolbar-container) class(.yui-menu-button)operator({)key(position)operator(:)value(relative)operator(;)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-toolbar-container) class(.yui-button) class(.first-child)operator(,)class(.yui-toolbar-container) class(.yui-button) class(.first-child) type(a)operator({)key(height)operator(:)float(100%)operator(;)key(width)operator(:)float(100%)operator(;)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-toolbar-container) class(.yui-button-disabled)operator({)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-toolbar-container) class(.yui-button-disabled) class(.yui-toolbar-icon)operator({)key(opacity)operator(:)float(.5)operator(;)key(filter)operator(:)stringoperator(;)operator(})class(.yui-toolbar-container) class(.yui-button-disabled) class(.up)operator(,)class(.yui-toolbar-container) class(.yui-button-disabled) class(.down)operator({)key(opacity)operator(:)float(.5)operator(;)key(filter)operator(:)stringoperator(;)operator(})class(.yui-toolbar-container) class(.yui-button) type(a)operator({)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-select) class(.first-child) type(a)operator({)key(cursor)operator(:)value(pointer)operator(;)operator(})class(.yui-toolbar-fontname-arial)operator({)key(font-family)operator(:)value(Arial)operator(;)operator(})class(.yui-toolbar-fontname-arial-black)operator({)key(font-family)operator(:)value(Arial) value(Black)operator(;)operator(})class(.yui-toolbar-fontname-comic-sans-ms)operator({)key(font-family)operator(:)value(Comic) value(Sans) value(MS)operator(;)operator(})class(.yui-toolbar-fontname-courier-new)operator({)key(font-family)operator(:)value(Courier) value(New)operator(;)operator(})class(.yui-toolbar-fontname-times-new-roman)operator({)key(font-family)operator(:)value(Times) value(New) value(Roman)operator(;)operator(})class(.yui-toolbar-fontname-verdana)operator({)key(font-family)operator(:)value(Verdana)operator(;)operator(})class(.yui-toolbar-fontname-impact)operator({)key(font-family)operator(:)value(Impact)operator(;)operator(})class(.yui-toolbar-fontname-lucida-console)operator({)key(font-family)operator(:)value(Lucida) value(Console)operator(;)operator(})class(.yui-toolbar-fontname-tahoma)operator({)key(font-family)operator(:)value(Tahoma)operator(;)operator(})class(.yui-toolbar-fontname-trebuchet-ms)operator({)key(font-family)operator(:)value(Trebuchet) value(MS)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-spinbutton)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child) type(a)operator({)key(z-index)operator(:)float(0)operator(;)key(opacity)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up)operator(,)class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down)operator({)key(position)operator(:)value(absolute)operator(;)key(display)operator(:)value(block) value(right)operator(:)float(0)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(z-index)operator(:)float(1)operator(;)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-container) class(.yui-overlay)operator({)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-toolbar-container) class(.yui-overlay) type(ul) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(list-style-type)operator(:)value(none)operator(;)operator(})class(.yui-toolbar-container)operator({)key(z-index)operator(:)float(1)operator(;)operator(})class(.yui-editor-container) class(.yui-editor-editable-container)operator({)key(position)operator(:)value(relative)operator(;)key(z-index)operator(:)float(0)operator(;)operator(})class(.yui-editor-container) class(.yui-editor-masked)operator({)key(background-color)operator(:)color(#CCC)operator(;)operator(})class(.yui-editor-container) type(iframe)operator({)key(border)operator(:)float(0px)operator(;)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-editor-container) class(.yui-editor-editable)operator({)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-editor-container) class(.dompath)operator({)key(font-size)operator(:)float(85%)operator(;)operator(})class(.yui-editor-panel) class(.hd)operator({)key(text-align)operator(:)value(left)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-editor-panel) class(.hd) type(h3)operator({)key(font-weight)operator(:)value(bold)operator(;)key(padding)operator(:)float(0.25em) float(0pt) float(0.25em) float(0.25em)operator(;)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-editor-panel) class(.bd)operator({)key(width)operator(:)float(100%)operator(;)key(zoom)operator(:)float(1)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-editor-panel) class(.bd) type(div)class(.yui-editor-body-cont)operator({)key(padding)operator(:)float(.25em) float(.1em)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-editor-panel) class(.bd) type(div)class(.yui-editor-body-cont)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-editor-panel) class(.ft)operator({)key(text-align)operator(:)value(right)operator(;)key(width)operator(:)float(99%)operator(;)key(float)operator(:)value(left)operator(;)key(clear)operator(:)value(both)operator(;)operator(})class(.yui-editor-panel) class(.ft) type(span)class(.tip)operator({)key(display)operator(:)value(block)operator(;)key(position)operator(:)value(relative)operator(;)key(padding)operator(:)float(.5em) float(.5em) float(.5em) float(23px)operator(;)key(text-align)operator(:)value(left)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-editor-panel) type(label)operator({)key(clear)operator(:)value(both)operator(;)key(float)operator(:)value(left)operator(;)key(padding)operator(:)float(0)operator(;)key(width)operator(:)float(100%)operator(;)key(text-align)operator(:)value(left)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-editor-panel) class(.gecko) type(label)operator({)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-editor-panel) type(label) type(strong)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(6em)operator(;)operator(})class(.yui-editor-panel) class(.removeLink)operator({)key(width)operator(:)float(80%)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-editor-panel) type(label) type(input)operator({)key(margin-left)operator(:)float(.25em)operator(;)key(float)operator(:)value(left)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-group-padding)operator({)operator(})class(.yui-editor-panel) class(.yui-toolbar-group-border)operator({)operator(})class(.yui-editor-panel) class(.yui-toolbar-group-textflow)operator({)operator(})class(.yui-editor-panel) class(.height-width)operator({)key(float)operator(:)value(left)operator(;)operator(})class(.yui-editor-panel) class(.height-width) type(h3)operator({)operator(})class(.yui-editor-panel) class(.height-width) type(span)operator({)key(font-style)operator(:)value(italic)operator(;)key(display)operator(:)value(block)operator(;)key(float)operator(:)value(left)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-editor-panel) class(.height-width) type(span)class(.info)operator({)key(font-size)operator(:)float(70%)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize)operator(,)class(.yui-editor-panel) class(.yui-toolbar-bordertype)operator({)key(font-size)operator(:)float(75%)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator)operator({)key(border)operator(:)value(none)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)operator(,)class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)operator({)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(8px)operator(;)key(left)operator(:)float(4px)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(3px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(width)operator(:)float(24px)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-solid)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-dotted)operator({)key(border-bottom)operator(:)float(1px) value(dotted) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordertype) type(span) type(a) type(span)class(.yui-toolbar-bordertype-dashed)operator({)key(border-bottom)operator(:)float(1px) value(dashed) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-0)operator({)error(*)key(top)operator(:)float(0px)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-1)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-2)operator({)key(border-bottom)operator(:)float(2px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-3)operator({)key(top)operator(:)float(2px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(border-bottom)operator(:)float(3px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-4)operator({)key(top)operator(:)float(1px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(border-bottom)operator(:)float(4px) value(solid) value(black)operator(;)operator(})class(.yui-editor-panel) class(.yui-toolbar-bordersize) type(span) type(a) type(span)class(.yui-toolbar-bordersize-5)operator({)key(top)operator(:)float(1px)operator(;)error(*)key(top)operator(:)float(-5px)operator(;)key(border-bottom)operator(:)float(5px) value(solid) value(black)operator(;)operator(})class(.yui-toolbar-container) class(.yui-toolbar-bordersize-menu)operator(,)class(.yui-toolbar-container) class(.yui-toolbar-bordertype-menu)operator({)key(width)operator(:)float(95px) important(!important)operator(;)operator(})class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel)operator(,)class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel)operator(,)class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel)operator(,)class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel)pseudo_class(:hover)operator({)key(margin)operator(:)float(0px) float(3px) float(7px) float(17px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) class(.yuimenuitemlabel) class(.checkedindicator)operator(,)class(.yui-toolbar-bordertype-menu) class(.yuimenuitemlabel) class(.checkedindicator)operator({)key(position)operator(:)value(absolute)operator(;)key(left)operator(:)float(-12px)operator(;)error(*)key(top)operator(:)float(14px)operator(;)error(*)key(left)operator(:)float(0px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-1) type(a)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-2) type(a)operator({)key(border-bottom)operator(:)float(2px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-3) type(a)operator({)key(border-bottom)operator(:)float(3px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-4) type(a)operator({)key(border-bottom)operator(:)float(4px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordersize-menu) type(li)class(.yui-toolbar-bordersize-5) type(a)operator({)key(border-bottom)operator(:)float(5px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-solid) type(a)operator({)key(border-bottom)operator(:)float(1px) value(solid) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-dashed) type(a)operator({)key(border-bottom)operator(:)float(1px) value(dashed) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})class(.yui-toolbar-bordertype-menu) type(li)class(.yui-toolbar-bordertype-dotted) type(a)operator({)key(border-bottom)operator(:)float(1px) value(dotted) value(black)operator(;)key(height)operator(:)float(14px)operator(;)operator(})type(h2)class(.yui-editor-skipheader)operator(,)type(h3)class(.yui-editor-skipheader)operator({)key(height)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(width)operator(:)float(0)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(position)operator(:)value(absolute)operator(;)operator(})class(.yui-toolbar-colors)operator({)key(width)operator(:)float(133px)operator(;)key(zoom)operator(:)float(1)operator(;)key(display)operator(:)value(none)operator(;)key(z-index)operator(:)float(100)operator(;)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-toolbar-colors)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-colors) type(a)operator({)key(height)operator(:)float(9px)operator(;)key(width)operator(:)float(9px)operator(;)key(float)operator(:)value(left)operator(;)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(text-indent)operator(:)float(999px)operator(;)key(margin)operator(:)float(0)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(border)operator(:)float(1px) value(solid) color(#F6F7EE)operator(;)operator(})class(.yui-toolbar-colors) type(a)pseudo_class(:hover)operator({)key(border)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-color-button-menu)operator({)key(overflow)operator(:)value(visible)operator(;)key(background-color)operator(:)value(transparent)operator(;)operator(})class(.yui-toolbar-colors) type(span)operator({)key(position)operator(:)value(relative)operator(;)key(display)operator(:)value(block)operator(;)key(padding)operator(:)float(3px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(100%)operator(;)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-toolbar-colors) type(span)pseudo_class(:after)operator({)key(display)operator(:)value(block)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)key(content)operator(:)stringoperator(;)key(height)operator(:)float(0)operator(;)operator(})class(.yui-toolbar-colors) type(span) type(em)operator({)key(height)operator(:)float(35px)operator(;)key(width)operator(:)float(30px)operator(;)key(float)operator(:)value(left)operator(;)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(text-indent)operator(:)float(999px)operator(;)key(margin)operator(:)float(0.75px)operator(;)key(border)operator(:)float(1px) value(solid) value(black)operator(;)operator(})class(.yui-toolbar-colors) type(span) type(strong)operator({)key(font-weight)operator(:)value(normal)operator(;)key(padding-left)operator(:)float(3px)operator(;)key(display)operator(:)value(block)operator(;)key(font-size)operator(:)float(85%)operator(;)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(65%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container)operator({)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-200px)operator(;)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(h2)operator({)key(color)operator(:)color(#000000)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0.3em) float(1em)operator(;)key(font-size)operator(:)float(100%)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-group) type(h3)operator({)key(color)operator(:)color(#808080)operator(;)key(font-size)operator(:)float(75%)operator(;)key(margin)operator(:)float(1em) float(0) float(0)operator(;)key(padding-bottom)operator(:)float(0)operator(;)key(padding-left)operator(:)float(0.25em)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-toolbar-container) type(span)class(.yui-toolbar-separator)operator({)key(border)operator(:)value(none)operator(;)key(text-indent)operator(:)float(33px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(margin)operator(:)float(.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-subcont)operator({)key(padding)operator(:)float(0) float(1em) float(0.35em)operator(;)key(border-bottom)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container-collapsed) class(.yui-toolbar-titlebar)operator({)key(border-bottom)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) class(.visible) class(.yui-menu-shadow)operator(,)class(.yui-skin-sam) class(.yui-editor-panel) class(.visible) class(.yui-menu-shadow)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) type(ul)operator({)key(list-style-type)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) type(ul) type(li)operator({)key(list-style-type)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-group) type(ul) type(li)class(.yui-toolbar-groupitem)operator({)key(float)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-container) class(.dompath)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border-top)operator(:)float(1px) value(solid) color(#808080)operator(;)key(color)operator(:)color(#999)operator(;)key(text-align)operator(:)value(left)operator(;)key(padding)operator(:)float(0.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.collapse)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-400px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-titlebar) type(span)class(.collapse)operator({)key(cursor)operator(:)value(pointer)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(4px)operator(;)key(right)operator(:)float(2px)operator(;)key(display)operator(:)value(block)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(height)operator(:)float(15px)operator(;)key(width)operator(:)float(15px)operator(;)key(text-indent)operator(:)float(9999px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button)operator({)key(background)operator(:)string value(repeat-x) float(0) float(0)operator(;)key(position)operator(:)value(relative)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(22px)operator(;)key(width)operator(:)float(30px)operator(;)key(margin)operator(:)float(0)operator(;)key(border-color)operator(:)color(#808080)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(1px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) type(a)operator({)key(padding-left)operator(:)float(35px)operator(;)key(height)operator(:)float(20px)operator(;)key(text-decoration)operator(:)value(none)operator(;)key(font-size)operator(:)float(93%)operator(;)key(line-height)operator(:)float(2)operator(;)key(display)operator(:)value(block)operator(;)key(color)operator(:)color(#000000)operator(;)key(overflow)operator(:)value(hidden)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) class(.first-child)operator({)key(border-color)operator(:)color(#808080)operator(;)key(border-style)operator(:)value(solid)operator(;)key(border-width)operator(:)float(0) float(1px)operator(;)key(margin)operator(:)float(0) float(-1px)operator(;)key(display)operator(:)value(block)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled) class(.first-child)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled) class(.first-child)operator({)key(border-color)operator(:)color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled) type(a)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled) type(a)operator({)key(color)operator(:)color(#A6A6A6)operator(;)key(cursor)operator(:)value(default)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button-disabled)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button-disabled)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button-disabled)operator({)key(border-color)operator(:)color(#ccc)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button) class(.first-child)operator({)error(*)key(left)operator(:)float(0px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-fontname)operator({)key(width)operator(:)float(135px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-heading)operator({)key(width)operator(:)float(92px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-hover)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1300px)operator(;)key(border-color)operator(:)color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-selected)operator({)key(background)operator(:)string value(repeat-x) float(0) float(-1700px)operator(;)key(border-color)operator(:)color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) type(h3)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-nogrouplabels) class(.yui-toolbar-group)operator({)key(margin-top)operator(:)float(.75em)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-push-button) type(span)class(.yui-toolbar-icon)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-color-button) type(span)class(.yui-toolbar-icon)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-menu-button) type(span)class(.yui-toolbar-icon)operator({)key(display)operator(:)value(block)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(2px)operator(;)key(height)operator(:)float(18px)operator(;)key(width)operator(:)float(18px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(background)operator(:)string value(no-repeat) float(30px) float(30px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-selected) type(span)class(.yui-toolbar-icon)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-hover) type(span)class(.yui-toolbar-icon)operator({)key(background-image)operator(:)stringoperator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.visible) class(.yuimenuitemlabel)operator({)key(cursor)operator(:)value(pointer)operator(;)key(color)operator(:)color(#000)operator(;)error(*)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-button-menu)operator({)key(background-color)operator(:)color(#fff)operator(;)operator(})class(.yui-skin-sam) type(div)class(.yuimenu) type(li)class(.selected)operator({)key(background-color)operator(:)color(#B3D4FF)operator(;)operator(})class(.yui-skin-sam) type(div)class(.yuimenu) type(li)class(.selected) type(a)class(.selected)operator({)key(color)operator(:)color(#000)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-bold) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(0)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-italic) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-36px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-underline) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-72px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-subscript) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-180px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-superscript) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-144px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-forecolor) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-216px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-backcolor) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-288px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyleft) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-324px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifycenter) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-360px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyright) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-396px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-justifyfull) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-432px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-indent) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-720px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-outdent) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-684px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-createlink) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-792px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertimage) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(1px) float(-756px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-left) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-972px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-right) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-936px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-inline) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-900px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-block) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-864px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-bordercolor) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-252px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-removeformat) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-1080px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-hiddenelements) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-1044px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertunorderedlist) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-468px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-insertorderedlist) type(span)class(.yui-toolbar-icon)operator({)key(background-position)operator(:)float(0) float(-504px)operator(;)key(left)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child)operator({)key(width)operator(:)float(35px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) class(.first-child) type(a)operator({)key(padding-left)operator(:)float(2px)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(span)class(.yui-toolbar-icon)operator({)key(display)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up)operator(,)class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down)operator({)key(right)operator(:)float(2px)operator(;)key(background)operator(:)string value(no-repeat) float(0) float(-1222px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(height)operator(:)float(6px)operator(;)key(width)operator(:)float(7px)operator(;)key(min-height)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.up)operator({)key(top)operator(:)float(2px)operator(;)key(background-position)operator(:)float(0) float(-1222px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-spinbutton) type(a)class(.down)operator({)key(bottom)operator(:)float(2px)operator(;)key(background-position)operator(:)float(0) float(-1187px)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-select) class(.first-child) type(a)operator({)key(padding-left)operator(:)float(5px)operator(;)key(text-align)operator(:)value(left)operator(;)operator(})class(.yui-skin-sam) class(.yui-toolbar-container) class(.yui-toolbar-select) type(span)class(.yui-toolbar-icon)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-1144px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(right)operator(:)float(-2px)operator(;)key(top)operator(:)float(0px)operator(;)key(height)operator(:)float(20px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-color-button-menu) class(.bd)operator({)key(background-color)operator(:)value(transparent)operator(;)key(border)operator(:)value(none)operator(;)key(width)operator(:)float(135px)operator(;)operator(})class(.yui-skin-sam) class(.yui-color-button-menu) class(.yui-toolbar-colors)operator({)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel)operator({)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(background-color)operator(:)value(transparent)operator(;)key(overflow)operator(:)value(visible)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd)operator({)key(margin)operator(:)float(10px) float(0) float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(h3)operator({)key(color)operator(:)color(#000)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(background)operator(:)string value(repeat-x) float(0) float(-200px)operator(;)key(width)operator(:)float(99%)operator(;)key(position)operator(:)value(relative)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(3px) float(0) float(0) float(0)operator(;)key(font-size)operator(:)float(93%)operator(;)key(text-indent)operator(:)float(5px)operator(;)key(height)operator(:)float(20px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.bd)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border-left)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-right)operator(:)float(1px) value(solid) color(#808080)operator(;)key(width)operator(:)float(99%)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(overflow)operator(:)value(visible)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(ul)operator({)key(list-style-type)operator(:)value(none)operator(;)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(ul) type(li)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yuimenu)operator({)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container) class(.yui-toolbar-subcont)operator({)key(padding)operator(:)float(0)operator(;)key(border)operator(:)value(none)operator(;)key(margin-top)operator(:)float(0.35em)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-bordersize)operator(,)class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-bordertype)operator({)key(width)operator(:)float(50px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label)operator({)key(display)operator(:)value(block)operator(;)key(float)operator(:)value(none)operator(;)key(padding)operator(:)float(4px) float(0)operator(;)key(margin-bottom)operator(:)float(7px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(strong)operator({)key(font-weight)operator(:)value(normal)operator(;)key(font-size)operator(:)float(93%)operator(;)key(text-align)operator(:)value(right)operator(;)key(padding-top)operator(:)float(2px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(input)operator({)key(width)operator(:)float(75%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) constant(#createlink_target)operator(,)class(.yui-skin-sam) class(.yui-editor-panel) constant(#insertimage_target)operator({)key(width)operator(:)value(auto)operator(;)key(margin-right)operator(:)float(5px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.removeLink)operator({)key(width)operator(:)float(98%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) type(label) type(input)class(.warning)operator({)key(background-color)operator(:)color(#FFEE69)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group) type(h3)operator({)key(color)operator(:)color(#000)operator(;)key(float)operator(:)value(left)operator(;)key(font-weight)operator(:)value(normal)operator(;)key(font-size)operator(:)float(93%)operator(;)key(margin)operator(:)float(5px) float(0) float(0) float(0)operator(;)key(padding)operator(:)float(0) float(3px) float(0) float(0)operator(;)key(text-align)operator(:)value(right)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.height-width) type(h3)operator({)key(margin)operator(:)float(3px) float(0) float(0) float(10px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.height-width)operator({)key(margin)operator(:)float(3px) float(0) float(0) float(35px)operator(;)error(*)key(margin-left)operator(:)float(14px)operator(;)key(width)operator(:)float(42%)operator(;)error(*)key(width)operator(:)float(44%)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-border)operator({)key(width)operator(:)float(190px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-padding)operator({)key(width)operator(:)float(203px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-padding) type(h3)operator({)key(margin-left)operator(:)float(25px)operator(;)error(*)key(margin-left)operator(:)float(12px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-group-textflow)operator({)key(width)operator(:)float(182px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd)operator({)key(background)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft)operator({)key(background-color)operator(:)color(#F2F2F2)operator(;)key(border)operator(:)float(1px) value(solid) color(#808080)operator(;)key(border-top)operator(:)value(none)operator(;)key(padding)operator(:)float(0)operator(;)key(margin)operator(:)float(0) float(0) float(2px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(span)class(.close)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-300px)operator(;)key(cursor)operator(:)value(pointer)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(16px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(position)operator(:)value(absolute)operator(;)key(right)operator(:)float(5px)operator(;)key(text-indent)operator(:)float(500px)operator(;)key(top)operator(:)float(2px)operator(;)key(width)operator(:)float(26px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip)operator({)key(background-color)operator(:)color(#EDF5FF)operator(;)key(border-top)operator(:)float(1px) value(solid) color(#808080)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(strong)operator({)key(display)operator(:)value(block)operator(;)key(float)operator(:)value(left)operator(;)key(margin)operator(:)float(0) float(2px) float(8px) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon)operator({)key(background)operator(:)string value(no-repeat) float(0) float(-1260px)operator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(20px)operator(;)key(left)operator(:)float(2px)operator(;)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(8px)operator(;)key(width)operator(:)float(20px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon-info)operator({)key(background-position)operator(:)float(2px) float(-1260px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.ft) type(span)class(.tip) type(span)class(.icon-warn)operator({)key(background-position)operator(:)float(2px) float(-1296px)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.hd) type(span)class(.knob)operator({)key(position)operator(:)value(absolute)operator(;)key(height)operator(:)float(10px)operator(;)key(width)operator(:)float(28px)operator(;)key(top)operator(:)float(-10px)operator(;)key(left)operator(:)float(25px)operator(;)key(text-indent)operator(:)float(9999px)operator(;)key(overflow)operator(:)value(hidden)operator(;)key(background)operator(:)string value(no-repeat) float(0) float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(100%)operator(;)key(background-image)operator(:)value(none)operator(;)key(border)operator(:)value(none)operator(;)operator(})class(.yui-skin-sam) class(.yui-editor-panel) class(.yui-toolbar-container) class(.bd)operator({)key(background-color)operator(:)color(#ffffff)operator(;)operator(})class(.yui-editor-blankimage)operator({)key(background-image)operator(:)stringoperator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -type(body) operator({)key(font)operator(:)float(13px)operator(/)float(1)float(.22) value(arial)operator(,)value(helvetica)operator(,)value(clean)operator(,)value(sans-serif)operator(;)error(*)key(font-size)operator(:)value(small)operator(;)error(*)key(font)operator(:)value(x-small)operator(;)operator(})type(table) operator({)key(font-size)operator(:)value(inherit)operator(;)key(font)operator(:)float(100%)operator(;)operator(})type(pre)operator(,)type(code)operator(,)type(kbd)operator(,)type(samp)operator(,)type(tt)operator({)key(font-family)operator(:)value(monospace)operator(;)error(*)key(font-size)operator(:)float(108%)operator(;)key(line-height)operator(:)float(99%)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*)comment(*) - comment(*) comment(Percents) comment(could) comment(work) comment(for) comment(IE,) comment(but) comment(for) comment(backCompat) comment(purposes,) comment(we) comment(are) comment(using) comment(keywords.) - comment(*) comment(x-small) comment(is) comment(for) comment(IE6/7) comment(quirks) comment(mode.) - comment(*/) -type(body) operator({)key(font)operator(:)float(13px)operator(/)float(1)float(.22) value(arial)operator(,)value(helvetica)operator(,)value(clean)operator(,)value(sans-serif)operator(;)error(*)key(font-size)operator(:)value(small)operator(;)error(*)key(font)operator(:)value(x-small)operator(;)operator(}) -type(table) operator({)key(font-size)operator(:)value(inherit)operator(;)key(font)operator(:)float(100%)operator(;)operator(}) -comment(/*)comment(*) - comment(*) comment(Bump) comment(up) comment(IE) comment(to) comment(get) comment(to) comment(13px) comment(equivalent) - comment(*/) -type(pre)operator(,)type(code)operator(,)type(kbd)operator(,)type(samp)operator(,)type(tt) operator({)key(font-family)operator(:)value(monospace)operator(;)error(*)key(font-size)operator(:)float(108%)operator(;)key(line-height)operator(:)float(99%)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -type(body)operator({)key(text-align)operator(:)value(center)operator(;)operator(})constant(#ft)operator({)key(clear)operator(:)value(both)operator(;)operator(})constant(#doc)operator(,)constant(#doc2)operator(,)constant(#doc3)operator(,)constant(#doc4)operator(,)class(.yui-t1)operator(,)class(.yui-t2)operator(,)class(.yui-t3)operator(,)class(.yui-t4)operator(,)class(.yui-t5)operator(,)class(.yui-t6)operator(,)class(.yui-t7)operator({)key(margin)operator(:)value(auto)operator(;)key(text-align)operator(:)value(left)operator(;)key(width)operator(:)float(57.69em)operator(;)error(*)key(width)operator(:)float(56.301em)operator(;)key(min-width)operator(:)float(750px)operator(;)operator(})constant(#doc2)operator({)key(width)operator(:)float(73.074em)operator(;)error(*)key(width)operator(:)float(71.313em)operator(;)operator(})constant(#doc3)operator({)key(margin)operator(:)value(auto) float(10px)operator(;)key(width)operator(:)value(auto)operator(;)operator(})constant(#doc4)operator({)key(width)operator(:)float(74.923em)operator(;)error(*)key(width)operator(:)float(73.117em)operator(;)operator(})class(.yui-b)operator({)key(position)operator(:)value(relative)operator(;)operator(})class(.yui-b)operator({)key(_position)operator(:)value(static)operator(;)operator(})constant(#yui-main) class(.yui-b)operator({)key(position)operator(:)value(static)operator(;)operator(})constant(#yui-main)operator({)key(width)operator(:)float(100%)operator(;)operator(})class(.yui-t1) constant(#yui-main)operator(,)class(.yui-t2) constant(#yui-main)operator(,)class(.yui-t3) constant(#yui-main)operator({)key(float)operator(:)value(right)operator(;)key(margin-left)operator(:)float(-25em)operator(;)operator(})class(.yui-t4) constant(#yui-main)operator(,)class(.yui-t5) constant(#yui-main)operator(,)class(.yui-t6) constant(#yui-main)operator({)key(float)operator(:)value(left)operator(;)key(margin-right)operator(:)float(-25em)operator(;)operator(})class(.yui-t1) class(.yui-b)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(12.3207em)operator(;)error(*)key(width)operator(:)float(12.0106em)operator(;)operator(})class(.yui-t1) constant(#yui-main) class(.yui-b)operator({)key(margin-left)operator(:)float(13.3207em)operator(;)error(*)key(margin-left)operator(:)float(13.0106em)operator(;)operator(})class(.yui-t2) class(.yui-b)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(13.8456em)operator(;)error(*)key(width)operator(:)float(13.512em)operator(;)operator(})class(.yui-t2) constant(#yui-main) class(.yui-b)operator({)key(margin-left)operator(:)float(14.8456em)operator(;)error(*)key(margin-left)operator(:)float(14.512em)operator(;)operator(})class(.yui-t3) class(.yui-b)operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(23.0759em)operator(;)error(*)key(width)operator(:)float(22.52em)operator(;)operator(})class(.yui-t3) constant(#yui-main) class(.yui-b)operator({)key(margin-left)operator(:)float(24.0759em)operator(;)error(*)key(margin-left)operator(:)float(23.52em)operator(;)operator(})class(.yui-t4) class(.yui-b)operator({)key(float)operator(:)value(right)operator(;)key(width)operator(:)float(13.8456em)operator(;)error(*)key(width)operator(:)float(13.512em)operator(;)operator(})class(.yui-t4) constant(#yui-main) class(.yui-b)operator({)key(margin-right)operator(:)float(14.8456em)operator(;)error(*)key(margin-right)operator(:)float(14.512em)operator(;)operator(})class(.yui-t5) class(.yui-b)operator({)key(float)operator(:)value(right)operator(;)key(width)operator(:)float(18.4608em)operator(;)error(*)key(width)operator(:)float(18.016em)operator(;)operator(})class(.yui-t5) constant(#yui-main) class(.yui-b)operator({)key(margin-right)operator(:)float(19.4608em)operator(;)error(*)key(margin-right)operator(:)float(19.016em)operator(;)operator(})class(.yui-t6) class(.yui-b)operator({)key(float)operator(:)value(right)operator(;)key(width)operator(:)float(23.0759em)operator(;)error(*)key(width)operator(:)float(22.52em)operator(;)operator(})class(.yui-t6) constant(#yui-main) class(.yui-b)operator({)key(margin-right)operator(:)float(24.0759em)operator(;)error(*)key(margin-right)operator(:)float(23.52em)operator(;)operator(})class(.yui-t7) constant(#yui-main) class(.yui-b)operator({)key(display)operator(:)value(block)operator(;)key(margin)operator(:)float(0) float(0) float(1em) float(0)operator(;)operator(})constant(#yui-main) class(.yui-b)operator({)key(float)operator(:)value(none)operator(;)key(width)operator(:)value(auto)operator(;)operator(})class(.yui-g) class(.yui-gb) class(.yui-u)operator(,)class(.yui-gb) class(.yui-g)operator(,)class(.yui-gb) class(.yui-gb)operator(,)class(.yui-gb) class(.yui-gc)operator(,)class(.yui-gb) class(.yui-gd)operator(,)class(.yui-gb) class(.yui-ge)operator(,)class(.yui-gb) class(.yui-gf)operator(,)class(.yui-gb) class(.yui-u)operator(,)class(.yui-gc) class(.yui-u)operator(,)class(.yui-gc) class(.yui-g)operator(,)class(.yui-gd) class(.yui-u)operator({)key(float)operator(:)value(left)operator(;)key(margin-left)operator(:)float(2%)operator(;)key(width)operator(:)float(32%)operator(;)operator(})class(.yui-gb) class(.yui-gb) class(.yui-u)operator(,)class(.yui-gb) class(.yui-gc) class(.yui-u)operator({)error(*)key(margin-left)operator(:)float(1.8%)operator(;)key(_margin-left)operator(:)float(4%)operator(;)operator(})class(.yui-g) class(.yui-gb) class(.yui-u)operator({)key(_margin-left)operator(:)float(.8%)operator(;)operator(})class(.yui-gb) class(.yui-u)operator({)key(float)operator(:)value(right)operator(;)operator(})class(.yui-gb) type(div)class(.first)operator({)key(margin-left)operator(:)float(0)operator(;)key(float)operator(:)value(left)operator(;)operator(})class(.yui-g) class(.yui-gb) type(div)class(.first)operator(,)class(.yui-gb) class(.yui-gb) type(div)class(.first)operator({)error(*)key(margin-right)operator(:)float(0)operator(;)error(*)key(width)operator(:)float(32%)operator(;)key(_width)operator(:)float(31.7%)operator(;)operator(})class(.yui-gb) class(.yui-gc) type(div)class(.first)operator(,)class(.yui-gb) class(.yui-gd) type(div)class(.first)operator({)error(*)key(margin-right)operator(:)float(0)operator(;)operator(})class(.yui-gb) class(.yui-gd) class(.yui-u)operator({)error(*)key(width)operator(:)float(66%)operator(;)key(_width)operator(:)float(61.2%)operator(;)operator(})class(.yui-gb) class(.yui-gd) type(div)class(.first)operator({)error(*)key(width)operator(:)float(31%)operator(;)key(_width)operator(:)float(29.5%)operator(;)operator(})class(.yui-g) class(.yui-gc) class(.yui-u)operator(,)class(.yui-gb) class(.yui-gc) class(.yui-u)operator({)key(width)operator(:)float(32%)operator(;)key(_float)operator(:)value(right)operator(;)key(margin-right)operator(:)float(0)operator(;)key(_margin-left)operator(:)float(0)operator(;)operator(})class(.yui-gb) class(.yui-gc) type(div)class(.first)operator({)key(width)operator(:)float(66%)operator(;)error(*)key(float)operator(:)value(left)operator(;)error(*)key(margin-left)operator(:)float(0)operator(;)operator(})class(.yui-gb) class(.yui-ge) class(.yui-u)operator(,)class(.yui-gb) class(.yui-gf) class(.yui-u)operator({)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-g) class(.yui-u)operator(,)class(.yui-g) class(.yui-g)operator(,)class(.yui-g) class(.yui-gb)operator(,)class(.yui-g) class(.yui-gc)operator(,)class(.yui-g) class(.yui-gd)operator(,)class(.yui-g) class(.yui-ge)operator(,)class(.yui-g) class(.yui-gf)operator(,)class(.yui-gc) class(.yui-u)operator(,)class(.yui-gd) class(.yui-g)operator(,)class(.yui-g) class(.yui-gc) class(.yui-u)operator(,)class(.yui-ge) class(.yui-u)operator(,)class(.yui-ge) class(.yui-g)operator(,)class(.yui-gf) class(.yui-g)operator(,)class(.yui-gf) class(.yui-u)operator({)key(float)operator(:)value(right)operator(;)operator(})class(.yui-g) class(.yui-gc) type(div)class(.first)operator(,)class(.yui-g) class(.yui-ge) type(div)class(.first)operator(,)class(.yui-g) type(div)class(.first)operator(,)class(.yui-gc) type(div)class(.first)operator(,)class(.yui-gc) type(div)class(.first) type(div)class(.first)operator(,)class(.yui-gd) type(div)class(.first)operator(,)class(.yui-ge) type(div)class(.first)operator(,)class(.yui-gf) type(div)class(.first)operator({)key(float)operator(:)value(left)operator(;)operator(})class(.yui-g) class(.yui-g) class(.yui-u)operator(,)class(.yui-gb) class(.yui-g) class(.yui-u)operator(,)class(.yui-gc) class(.yui-g) class(.yui-u)operator(,)class(.yui-gd) class(.yui-g) class(.yui-u)operator(,)class(.yui-ge) class(.yui-g) class(.yui-u)operator(,)class(.yui-gf) class(.yui-g) class(.yui-u)operator({)key(width)operator(:)float(49%)operator(;)error(*)key(width)operator(:)float(48.1%)operator(;)error(*)key(margin-left)operator(:)float(0)operator(;)operator(})class(.yui-g) class(.yui-g) type(div)class(.first)operator({)error(*)key(margin)operator(:)float(0)operator(;)operator(})class(.yui-gb) class(.yui-g) type(div)class(.first)operator({)error(*)key(margin-right)operator(:)float(4%)operator(;)key(_margin-right)operator(:)float(1.3%)operator(;)operator(})class(.yui-gb) class(.yui-gb) class(.yui-u)operator({)key(_margin-left)operator(:)float(.7%)operator(;)operator(})class(.yui-gb) class(.yui-g) type(div)class(.first)operator(,)class(.yui-gb) class(.yui-gb) type(div)class(.first)operator({)error(*)key(margin-left)operator(:)float(0)operator(;)operator(})class(.yui-gc) class(.yui-g) class(.yui-u)operator(,)class(.yui-gd) class(.yui-g) class(.yui-u)operator({)error(*)key(width)operator(:)float(48.1%)operator(;)error(*)key(margin-left)operator(:)float(0)operator(;)operator(})class(.yui-g) class(.yui-u)operator(,)class(.yui-g) class(.yui-g)operator(,)class(.yui-g) class(.yui-gb)operator(,)class(.yui-g) class(.yui-gc)operator(,)class(.yui-g) class(.yui-gd)operator(,)class(.yui-g) class(.yui-ge)operator(,)class(.yui-g) class(.yui-gf)operator({)key(width)operator(:)float(49.1%)operator(;)operator(})class(.yui-g) class(.yui-gb) type(div)class(.first)operator(,)class(.yui-gb) type(div)class(.first)operator(,)class(.yui-gc) type(div)class(.first)operator(,)class(.yui-gd) type(div)class(.first)operator({)key(margin-left)operator(:)float(0)operator(;)operator(})class(.yui-g) class(.yui-gc) type(div)class(.first)operator(,)class(.yui-gc) type(div)class(.first)operator(,)class(.yui-gd) class(.yui-g)operator(,)class(.yui-gd) class(.yui-u)operator({)key(width)operator(:)float(66%)operator(;)operator(})class(.yui-gd) type(div)class(.first)operator(,)class(.yui-gb) class(.yui-gd) type(div)class(.first)operator({)key(width)operator(:)float(32%)operator(;)operator(})class(.yui-g) class(.yui-gd) type(div)class(.first)operator({)key(_width)operator(:)float(29.9%)operator(;)operator(})class(.yui-ge) class(.yui-u)operator(,)class(.yui-ge) class(.yui-g)operator(,)class(.yui-gf) type(div)class(.first)operator({)key(width)operator(:)float(24%)operator(;)operator(})class(.yui-gb) class(.yui-ge) type(div)class(.yui-u)operator(,)class(.yui-gb) class(.yui-gf) type(div)class(.yui-u)operator({)key(float)operator(:)value(right)operator(;)operator(})class(.yui-gb) class(.yui-ge) type(div)class(.first)operator(,)class(.yui-gb) class(.yui-gf) type(div)class(.first) operator({)key(float)operator(:)value(left)operator(;)operator(})class(.yui-ge) type(div)class(.first)operator(,)class(.yui-gf) class(.yui-g)operator(,)class(.yui-gf) class(.yui-u)operator({)key(width)operator(:)float(74.2%)operator(;)operator(})class(.yui-gb) class(.yui-ge) class(.yui-u)operator(,)class(.yui-gb) class(.yui-gf) type(div)class(.first)operator({)error(*)key(width)operator(:)float(24%)operator(;)key(_width)operator(:)float(20%)operator(;)operator(})class(.yui-gb) class(.yui-ge) type(div)class(.first)operator(,)class(.yui-gb) class(.yui-gf) class(.yui-u)operator({)error(*)key(width)operator(:)float(73.5%)operator(;)key(_width)operator(:)float(65.5%)operator(;)operator(})constant(#bd)pseudo_class(:after)operator(,)class(.yui-g)pseudo_class(:after)operator(,)class(.yui-gb)pseudo_class(:after)operator(,)class(.yui-gc)pseudo_class(:after)operator(,)class(.yui-gd)pseudo_class(:after)operator(,)class(.yui-ge)pseudo_class(:after)operator(,)class(.yui-gf)pseudo_class(:after)operator({)key(content)operator(:)stringoperator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(0)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)operator(})constant(#bd)operator(,)class(.yui-g)operator(,)class(.yui-gb)operator(,)class(.yui-gc)operator(,)class(.yui-gd)operator(,)class(.yui-ge)operator(,)class(.yui-gf)operator({)key(zoom)operator(:)float(1)operator(;)operator(})class(.yui-gb) class(.yui-u)operator({)key(float)operator(:)value(left)operator(;)operator(})comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(for) comment(all) comment(templates) comment(and) comment(grids) comment(*/) -type(body)operator({)key(text-align)operator(:)value(center)operator(;)operator(}) -constant(#ft)operator({)key(clear)operator(:)value(both)operator(;)operator(}) -comment(/*) comment(750) comment(centered,) comment(and) comment(backward) comment(compatibility) comment(*/) -constant(#doc)operator(,)constant(#doc2)operator(,)constant(#doc3)operator(,)constant(#doc4)operator(,)class(.yui-t1)operator(,)class(.yui-t2)operator(,)class(.yui-t3)operator(,)class(.yui-t4)operator(,)class(.yui-t5)operator(,)class(.yui-t6)operator(,)class(.yui-t7) operator({) - key(margin)operator(:)value(auto)operator(;)key(text-align)operator(:)value(left)operator(;) - key(width)operator(:)float(57.69em)operator(;)error(*)key(width)operator(:)float(56.301em)operator(;)key(min-width)operator(:)float(750px)operator(;)operator(}) -comment(/*) comment(950) comment(centered) comment(*/) -constant(#doc2) operator({) - key(width)operator(:)float(73.074em)operator(;)error(*)key(width)operator(:)float(71.313em)operator(;)operator(}) -comment(/*) comment(100%) comment(with) comment(10px) comment(viewport) comment(side) comment(matting) comment(*/) -constant(#doc3) operator({) - key(margin)operator(:)value(auto) float(10px)operator(;) comment(/*) comment(not) comment(for) comment(structure,) comment(but) comment(so) comment(content) comment(doesn't) comment(bleed) comment(to) comment(edge) comment(*/) - key(width)operator(:)value(auto)operator(;)operator(}) -comment(/*) comment(974) comment(centered) comment(*/) -constant(#doc4) operator({) - key(width)operator(:)float(74.923em)operator(;)error(*)key(width)operator(:)float(73.117em)operator(;)operator(}) -comment(/*) comment(below) comment(required) comment(for) comment(all) comment(fluid) comment(grids;) comment(adjust) comment(widths) comment(and) comment(margins) comment(above) comment(accordingly) comment(*/) - comment(/*) comment(to) comment(preserve) comment(source-order) comment(independence) comment(for) comment(Gecko) comment(*/) - class(.yui-b)operator({)key(position)operator(:)value(relative)operator(;)operator(}) - class(.yui-b)operator({)key(_position)operator(:)value(static)operator(;)operator(}) comment(/*) comment(for) comment(IE) comment(<) comment(7) comment(*/) - constant(#yui-main) class(.yui-b)operator({)key(position)operator(:)value(static)operator(;)operator(}) -constant(#yui-main) operator({)key(width)operator(:)float(100%)operator(;)operator(}) -class(.yui-t1) constant(#yui-main)operator(,)class(.yui-t2) constant(#yui-main)operator(,)class(.yui-t3) constant(#yui-main)operator({)key(float)operator(:)value(right)operator(;)key(margin-left)operator(:)float(-25em)operator(;)comment(/*) comment(IE:) comment(preserve) comment(layout) comment(at) comment(narrow) comment(widths) comment(*/)operator(}) -class(.yui-t4) constant(#yui-main)operator(,)class(.yui-t5) constant(#yui-main)operator(,)class(.yui-t6) constant(#yui-main)operator({)key(float)operator(:)value(left)operator(;)key(margin-right)operator(:)float(-25em)operator(;)comment(/*) comment(IE:) comment(preserve) comment(layout) comment(at) comment(narrow) comment(widths) comment(*/)operator(}) -class(.yui-t1) class(.yui-b) operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(12.3207em)operator(;)error(*)key(width)operator(:)float(12.0106em)operator(;)operator(}) -class(.yui-t1) constant(#yui-main) class(.yui-b)operator({)key(margin-left)operator(:)float(13.3207em)operator(;)error(*)key(margin-left)operator(:)float(13.0106em)operator(;)operator(}) -class(.yui-t2) class(.yui-b) operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(13.8456em)operator(;)error(*)key(width)operator(:)float(13.512em)operator(;)operator(}) -class(.yui-t2) constant(#yui-main) class(.yui-b) operator({)key(margin-left)operator(:)float(14.8456em)operator(;)error(*)key(margin-left)operator(:)float(14.512em)operator(;)operator(}) -class(.yui-t3) class(.yui-b) operator({)key(float)operator(:)value(left)operator(;)key(width)operator(:)float(23.0759em)operator(;)error(*)key(width)operator(:)float(22.52em)operator(;)operator(}) -class(.yui-t3) constant(#yui-main) class(.yui-b) operator({)key(margin-left)operator(:)float(24.0759em)operator(;)error(*)key(margin-left)operator(:)float(23.52em)operator(;)operator(}) -class(.yui-t4) class(.yui-b) operator({)key(float)operator(:)value(right)operator(;)key(width)operator(:)float(13.8456em)operator(;)error(*)key(width)operator(:)float(13.512em)operator(;)operator(}) -class(.yui-t4) constant(#yui-main) class(.yui-b) operator({)key(margin-right)operator(:)float(14.8456em)operator(;)error(*)key(margin-right)operator(:)float(14.512em)operator(;)operator(}) -class(.yui-t5) class(.yui-b) operator({)key(float)operator(:)value(right)operator(;)key(width)operator(:)float(18.4608em)operator(;)error(*)key(width)operator(:)float(18.016em)operator(;)operator(}) -class(.yui-t5) constant(#yui-main) class(.yui-b) operator({)key(margin-right)operator(:)float(19.4608em)operator(;)error(*)key(margin-right)operator(:)float(19.016em)operator(;)operator(}) -class(.yui-t6) class(.yui-b) operator({)key(float)operator(:)value(right)operator(;)key(width)operator(:)float(23.0759em)operator(;)error(*)key(width)operator(:)float(22.52em)operator(;)operator(}) -class(.yui-t6) constant(#yui-main) class(.yui-b) operator({)key(margin-right)operator(:)float(24.0759em)operator(;)error(*)key(margin-right)operator(:)float(23.52em)operator(;)operator(}) -class(.yui-t7) constant(#yui-main) class(.yui-b) operator({)key(display)operator(:)value(block)operator(;)key(margin)operator(:)float(0) float(0) float(1em) float(0)operator(;)operator(}) -constant(#yui-main) class(.yui-b) operator({)key(float)operator(:)value(none)operator(;)key(width)operator(:)value(auto)operator(;)operator(}) -class(.yui-g) class(.yui-gb) class(.yui-u)operator(,) -class(.yui-gb) class(.yui-g)operator(,) -class(.yui-gb) class(.yui-gb)operator(,) -class(.yui-gb) class(.yui-gc)operator(,) -class(.yui-gb) class(.yui-gd)operator(,) -class(.yui-gb) class(.yui-ge)operator(,) -class(.yui-gb) class(.yui-gf)operator(,) -class(.yui-gb) class(.yui-u)operator(,) -class(.yui-gc) class(.yui-u)operator(,) -class(.yui-gc) class(.yui-g)operator(,) -class(.yui-gd) class(.yui-u)operator({)key(float)operator(:)value(left)operator(;)key(margin-left)operator(:)float(2%)operator(;)key(width)operator(:)float(32%)operator(;)operator(}) -class(.yui-gb) class(.yui-gb) class(.yui-u)operator(,) -class(.yui-gb) class(.yui-gc) class(.yui-u) operator({)error(*)key(margin-left)operator(:)float(1.8%)operator(;)key(_margin-left)operator(:)float(4%)operator(;)operator(}) -class(.yui-g) class(.yui-gb) class(.yui-u) operator({)key(_margin-left)operator(:)float(.8%)operator(;)operator(}) -class(.yui-gb) class(.yui-u) operator({)key(float)operator(:)value(right)operator(;)operator(}) -class(.yui-gb) type(div)class(.first) operator({)key(margin-left)operator(:)float(0)operator(;)key(float)operator(:)value(left)operator(;)operator(}) -class(.yui-g) class(.yui-gb) type(div)class(.first)operator(,) -class(.yui-gb) class(.yui-gb) type(div)class(.first) operator({)error(*)key(margin-right)operator(:)float(0)operator(;)error(*)key(width)operator(:)float(32%)operator(;)key(_width)operator(:)float(31.7%)operator(;)operator(}) -class(.yui-gb) class(.yui-gc) type(div)class(.first)operator(,) -class(.yui-gb) class(.yui-gd) type(div)class(.first) - operator({)error(*)key(margin-right)operator(:)float(0)operator(;)operator(}) -class(.yui-gb) class(.yui-gd) class(.yui-u) operator({)error(*)key(width)operator(:)float(66%)operator(;)key(_width)operator(:)float(61.2%)operator(;)operator(}) -class(.yui-gb) class(.yui-gd) type(div)class(.first) operator({)error(*)key(width)operator(:)float(31%)operator(;)key(_width)operator(:)float(29.5%)operator(;)operator(}) -class(.yui-g) class(.yui-gc) class(.yui-u)operator(,) -class(.yui-gb) class(.yui-gc) class(.yui-u) operator({)key(width)operator(:)float(32%)operator(;)key(_float)operator(:)value(right)operator(;)key(margin-right)operator(:)float(0)operator(;)key(_margin-left)operator(:)float(0)operator(;)operator(}) -class(.yui-gb) class(.yui-gc) type(div)class(.first) operator({)key(width)operator(:)float(66%)operator(;)error(*)key(float)operator(:)value(left)operator(;)error(*)key(margin-left)operator(:)float(0)operator(;)operator(}) -class(.yui-gb) class(.yui-ge) class(.yui-u)operator(,) -class(.yui-gb) class(.yui-gf) class(.yui-u) operator({)key(margin)operator(:)float(0)operator(;)operator(}) - comment(/*)comment(Float) comment(units) comment((and) comment(sub) comment(grids\)) comment(to) comment(the) comment(right) comment(*/) - class(.yui-g) class(.yui-u)operator(,) - class(.yui-g) class(.yui-g)operator(,) - class(.yui-g) class(.yui-gb)operator(,) - class(.yui-g) class(.yui-gc)operator(,) - class(.yui-g) class(.yui-gd)operator(,) - class(.yui-g) class(.yui-ge)operator(,) - class(.yui-g) class(.yui-gf)operator(,) - class(.yui-gc) class(.yui-u)operator(,) - class(.yui-gd) class(.yui-g)operator(,) - class(.yui-g) class(.yui-gc) class(.yui-u)operator(,) - class(.yui-ge) class(.yui-u)operator(,) - class(.yui-ge) class(.yui-g)operator(,) - class(.yui-gf) class(.yui-g)operator(,) - class(.yui-gf) class(.yui-u)operator({)key(float)operator(:)value(right)operator(;)operator(}) - comment(/*)comment(Float) comment(units) comment((and) comment(sub) comment(grids\)) comment(to) comment(the) comment(left) comment(*/) - class(.yui-g) class(.yui-gc) type(div)class(.first)operator(,) - class(.yui-g) class(.yui-ge) type(div)class(.first)operator(,) - class(.yui-g) type(div)class(.first)operator(,) - class(.yui-gc) type(div)class(.first)operator(,) - class(.yui-gc) type(div)class(.first) type(div)class(.first)operator(,) - class(.yui-gd) type(div)class(.first)operator(,) - class(.yui-ge) type(div)class(.first)operator(,) - class(.yui-gf) type(div)class(.first)operator({)key(float)operator(:)value(left)operator(;)operator(}) -class(.yui-g) class(.yui-g) class(.yui-u)operator(,) -class(.yui-gb) class(.yui-g) class(.yui-u)operator(,) -class(.yui-gc) class(.yui-g) class(.yui-u)operator(,) -class(.yui-gd) class(.yui-g) class(.yui-u)operator(,) -class(.yui-ge) class(.yui-g) class(.yui-u)operator(,) -class(.yui-gf) class(.yui-g) class(.yui-u) operator({)key(width)operator(:)float(49%)operator(;)error(*)key(width)operator(:)float(48.1%)operator(;)error(*)key(margin-left)operator(:)float(0)operator(;)operator(}) -class(.yui-g) class(.yui-g) type(div)class(.first) operator({)error(*)key(margin)operator(:)float(0)operator(;)operator(}) -class(.yui-gb) class(.yui-g) type(div)class(.first) operator({)error(*)key(margin-right)operator(:)float(4%)operator(;)key(_margin-right)operator(:)float(1.3%)operator(;)operator(}) -class(.yui-gb) class(.yui-gb) class(.yui-u) operator({)key(_margin-left)operator(:)float(.7%)operator(;)operator(}) -class(.yui-gb) class(.yui-g) type(div)class(.first)operator(,) -class(.yui-gb) class(.yui-gb) type(div)class(.first) operator({)error(*)key(margin-left)operator(:)float(0)operator(;)operator(}) -class(.yui-gc) class(.yui-g) class(.yui-u)operator(,) -class(.yui-gd) class(.yui-g) class(.yui-u) operator({)error(*)key(width)operator(:)float(48.1%)operator(;)error(*)key(margin-left)operator(:)float(0)operator(;)operator(}) -class(.yui-g) class(.yui-u)operator(,) -class(.yui-g) class(.yui-g)operator(,) -class(.yui-g) class(.yui-gb)operator(,) -class(.yui-g) class(.yui-gc)operator(,) -class(.yui-g) class(.yui-gd)operator(,) -class(.yui-g) class(.yui-ge)operator(,) -class(.yui-g) class(.yui-gf) operator({)key(width)operator(:)float(49.1%)operator(;)operator(}) -class(.yui-g) class(.yui-gb) type(div)class(.first)operator(,) - class(.yui-gb) type(div)class(.first)operator(,) - class(.yui-gc) type(div)class(.first)operator(,) - class(.yui-gd) type(div)class(.first) operator({)key(margin-left)operator(:)float(0)operator(;)operator(}) -class(.yui-g) class(.yui-gc) type(div)class(.first)operator(,) -class(.yui-gc) type(div)class(.first)operator(,) -class(.yui-gd) class(.yui-g)operator(,) comment(/*) comment(for) comment(056,) comment(057) comment(*/) -class(.yui-gd) class(.yui-u) operator({)key(width)operator(:)float(66%)operator(;)operator(}) -class(.yui-gd) type(div)class(.first)operator(,) -class(.yui-gb) class(.yui-gd) type(div)class(.first) operator({)key(width)operator(:)float(32%)operator(;)operator(}) -class(.yui-g) class(.yui-gd) type(div)class(.first) operator({)key(_width)operator(:)float(29.9%)operator(;)operator(}) -class(.yui-ge) class(.yui-u)operator(,) -class(.yui-ge) class(.yui-g)operator(,) -class(.yui-gf) type(div)class(.first) operator({)key(width)operator(:)float(24%)operator(;)operator(}) -class(.yui-gb) class(.yui-ge) type(div)class(.yui-u)operator(,) -class(.yui-gb) class(.yui-gf) type(div)class(.yui-u) operator({)key(float)operator(:)value(right)operator(;)operator(}) -class(.yui-gb) class(.yui-ge) type(div)class(.first)operator(,) -class(.yui-gb) class(.yui-gf) type(div)class(.first) operator({)key(float)operator(:)value(left)operator(;)operator(}) -class(.yui-ge) type(div)class(.first)operator(,) -class(.yui-gf) class(.yui-g)operator(,) -class(.yui-gf) class(.yui-u)operator({)key(width)operator(:)float(74.2%)operator(;)operator(}) -comment(/*) comment(narrower) comment(width) comment(in) comment(nexted) comment(contexts) comment(*/) -class(.yui-gb) class(.yui-ge) class(.yui-u)operator(,) -class(.yui-gb) class(.yui-gf) type(div)class(.first) operator({)error(*)key(width)operator(:)float(24%)operator(;)key(_width)operator(:)float(20%)operator(;)operator(}) -comment(/*) comment(narrower) comment(width) comment(in) comment(nexted) comment(contexts) comment(*/) -class(.yui-gb) class(.yui-ge) type(div)class(.first)operator(,) -class(.yui-gb) class(.yui-gf) class(.yui-u)operator({)error(*)key(width)operator(:)float(73.5%)operator(;)key(_width)operator(:)float(65.5%)operator(;)operator(}) -comment(/*) comment(clearing) comment(*/) -constant(#bd)pseudo_class(:after)operator(,) -class(.yui-g)pseudo_class(:after)operator(,) -class(.yui-gb)pseudo_class(:after)operator(,) -class(.yui-gc)pseudo_class(:after)operator(,) -class(.yui-gd)pseudo_class(:after)operator(,) -class(.yui-ge)pseudo_class(:after)operator(,) -class(.yui-gf)pseudo_class(:after)operator({)key(content)operator(:)stringoperator(;)key(display)operator(:)value(block)operator(;)key(height)operator(:)float(0)operator(;)key(clear)operator(:)value(both)operator(;)key(visibility)operator(:)value(hidden)operator(;)operator(}) -constant(#bd)operator(,) -class(.yui-g)operator(,) -class(.yui-gb)operator(,) -class(.yui-gc)operator(,) -class(.yui-gd)operator(,) -class(.yui-ge)operator(,) -class(.yui-gf)operator({)key(zoom)operator(:)float(1)operator(;)operator(}) -class(.yui-gb) class(.yui-u) operator({)key(float)operator(:)value(left)operator(;)operator(})comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(This) comment(file) comment(intentionally) comment(left) comment(blank) comment(*/) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(logger) comment(default) comment(styles) comment(*/) -comment(/*) comment(default) comment(width:) comment(31em) comment(*/) -comment(/*) comment(default) comment(font-size) comment(77%) comment(*/) -class(.yui-log) operator({)key(padding)operator(:)float(1em)operator(;)key(width)operator(:)float(31em)operator(;)key(background-color)operator(:)color(#AAA)operator(;)key(color)operator(:)color(#000)operator(;)key(border)operator(:)float(1px) value(solid) value(black)operator(;)key(font-family)operator(:)value(monospace)operator(;)key(font-size)operator(:)float(77%)operator(;)key(text-align)operator(:)value(left)operator(;)key(z-index)operator(:)float(9000)operator(;)operator(}) - -comment(/*) comment(for) comment(containers) comment(built) comment(from) comment(scratch) comment(*/) -class(.yui-log-container) operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(1em)operator(;)key(right)operator(:)float(1em)operator(;)operator(}) - -comment(/*) comment(buttons) comment(*/) -class(.yui-log) type(input) operator({) - key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;) - key(font-family)operator(:)value(arial)operator(;) - key(font-size)operator(:)float(100%)operator(;) - key(font-weight)operator(:)value(normal)operator(;) -operator(}) -class(.yui-log) class(.yui-log-btns) operator({)key(position)operator(:)value(relative)operator(;)key(float)operator(:)value(right)operator(;)key(bottom)operator(:)float(.25em)operator(;)operator(}) - -comment(/*) comment(header) comment(*/) -class(.yui-log) class(.yui-log-hd) operator({)key(margin-top)operator(:)float(1em)operator(;)key(padding)operator(:)float(.5em)operator(;)key(background-color)operator(:)color(#575757)operator(;)operator(}) -class(.yui-log) class(.yui-log-hd) type(h4) operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-size)operator(:)float(107%)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(}) - -comment(/*) comment(body) comment(*/) - -class(.yui-log) class(.yui-log-bd) operator({)key(width)operator(:)float(100%)operator(;)key(height)operator(:)float(20em)operator(;)key(background-color)operator(:)color(#FFF)operator(;)key(border)operator(:)float(1px) value(solid) value(gray)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(}) comment(/*) comment(height) comment(is) comment(controlled) comment(here:) comment(default) comment(20em)comment(*/) -class(.yui-log) type(p) operator({)key(margin)operator(:)float(1px)operator(;)key(padding)operator(:)float(.1em)operator(;)operator(}) -class(.yui-log) type(pre) operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(}) - -comment(/*) comment(for) comment(pre) comment(to) comment(respect) comment(newlines) comment(yet) comment(wrap) comment(long) comment(lines) comment(*/) -comment(/*) comment(http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/) comment(*/) -class(.yui-log) type(pre)class(.yui-log-verbose) operator({) - key(white-space)operator(:) value(pre-wrap)operator(;) comment(/*) comment(css-3) comment(*/) - key(white-space)operator(:) value(-moz-pre-wrap) important(!important)operator(;) comment(/*) comment(Mozilla,) comment(since) comment(1999) comment(*/) - key(white-space)operator(:) value(-pre-wrap)operator(;) comment(/*) comment(Opera) comment(4-6) comment(*/) - key(white-space)operator(:) value(-o-pre-wrap)operator(;) comment(/*) comment(Opera) comment(7) comment(*/) - key(word-wrap)operator(:) value(break-word)operator(;) comment(/*) comment(Internet) comment(Explorer) comment(5.5+) comment(*/) -operator(}) - -comment(/*) comment(footer) comment(*/) -class(.yui-log) class(.yui-log-ft) operator({)key(margin-top)operator(:)float(.5em)operator(;)operator(}) -class(.yui-log) class(.yui-log-ft) class(.yui-log-categoryfilters) operator({)operator(}) -class(.yui-log) class(.yui-log-ft) class(.yui-log-sourcefilters) operator({)key(width)operator(:)float(100%)operator(;)key(border-top)operator(:)float(1px) value(solid) color(#575757)operator(;)key(margin-top)operator(:)float(.75em)operator(;)key(padding-top)operator(:)float(.75em)operator(;)operator(}) -class(.yui-log) class(.yui-log-filtergrp) operator({)key(margin-right)operator(:)float(.5em)operator(;)operator(}) -comment(/*)comment(.yui-log) comment(.yui-log-ft) comment(ul) comment({margin:0;padding:0;line-height:1.8}) -comment(.yui-log) comment(.yui-log-ft) comment(li) comment({list-style:none;display:inline;white-space:nowrap;})comment(*/) - -comment(/*) comment(logs) comment(*/) -class(.yui-log) class(.info) operator({)key(background-color)operator(:)color(#A7CC25)operator(;)operator(}) comment(/*) comment(A7CC25) comment(green) comment(*/) -class(.yui-log) class(.warn) operator({)key(background-color)operator(:)color(#F58516)operator(;)operator(}) comment(/*) comment(F58516) comment(orange) comment(*/) -class(.yui-log) class(.error) operator({)key(background-color)operator(:)color(#E32F0B)operator(;)operator(}) comment(/*) comment(E32F0B) comment(red) comment(*/) -class(.yui-log) class(.time) operator({)key(background-color)operator(:)color(#A6C9D7)operator(;)operator(}) comment(/*) comment(A6C9D7) comment(blue) comment(*/) -class(.yui-log) class(.window) operator({)key(background-color)operator(:)color(#F2E886)operator(;)operator(}) comment(/*) comment(F2E886) comment(tan) comment(*/) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(logger) comment(default) comment(styles) comment(*/) -comment(/*) comment(default) comment(width:) comment(31em) comment(*/) -comment(/*) comment(default) comment(font-size) comment(77%) comment(*/) -class(.yui-skin-sam) class(.yui-log) operator({) key(padding)operator(:)float(1em)operator(;)key(width)operator(:)float(31em)operator(;)key(background-color)operator(:)color(#AAA)operator(;)key(color)operator(:)color(#000)operator(;)key(border)operator(:)float(1px) value(solid) value(black)operator(;)key(font-family)operator(:)value(monospace)operator(;)key(font-size)operator(:)float(77%)operator(;)key(text-align)operator(:)value(left)operator(;)key(z-index)operator(:)float(9000)operator(;) operator(}) - -comment(/*) comment(for) comment(containers) comment(built) comment(from) comment(scratch) comment(*/) -class(.yui-skin-sam) class(.yui-log-container) operator({) key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(1em)operator(;)key(right)operator(:)float(1em)operator(;) operator(}) - -comment(/*) comment(buttons) comment(*/) -class(.yui-skin-sam) class(.yui-log) type(input) operator({) - key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;) - key(font-family)operator(:)value(arial)operator(;) - key(font-size)operator(:)float(100%)operator(;) - key(font-weight)operator(:)value(normal)operator(;) -operator(}) -class(.yui-skin-sam) class(.yui-log) class(.yui-log-btns) operator({) key(position)operator(:)value(relative)operator(;)key(float)operator(:)value(right)operator(;)key(bottom)operator(:)float(.25em)operator(;) operator(}) - -comment(/*) comment(header) comment(*/) -class(.yui-skin-sam) class(.yui-log) class(.yui-log-hd) operator({) key(margin-top)operator(:)float(1em)operator(;)key(padding)operator(:)float(.5em)operator(;)key(background-color)operator(:)color(#575757)operator(;) operator(}) -class(.yui-skin-sam) class(.yui-log) class(.yui-log-hd) type(h4) operator({) key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-size)operator(:)float(108%)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(color)operator(:)color(#FFF)operator(;) operator(}) - -comment(/*) comment(body) comment(*/) - -class(.yui-skin-sam) class(.yui-log) class(.yui-log-bd) operator({) key(width)operator(:)float(100%)operator(;)key(height)operator(:)float(20em)operator(;)key(background-color)operator(:)color(#FFF)operator(;)key(border)operator(:)float(1px) value(solid) value(gray)operator(;)key(overflow)operator(:)value(auto)operator(;) operator(}) comment(/*) comment(height) comment(is) comment(controlled) comment(here:) comment(default) comment(20em)comment(*/) -class(.yui-skin-sam) class(.yui-log) type(p) operator({) key(margin)operator(:)float(1px)operator(;)key(padding)operator(:)float(.1em)operator(;) operator(}) -class(.yui-skin-sam) class(.yui-log) type(pre) operator({) key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;) operator(}) - -comment(/*) comment(for) comment(pre) comment(to) comment(respect) comment(newlines) comment(yet) comment(wrap) comment(long) comment(lines) comment(*/) -comment(/*) comment(http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/) comment(*/) -class(.yui-skin-sam) class(.yui-log) type(pre)class(.yui-log-verbose) operator({) - key(white-space)operator(:) value(pre-wrap)operator(;) comment(/*) comment(css-3) comment(*/) - key(white-space)operator(:) value(-moz-pre-wrap) important(!important)operator(;) comment(/*) comment(Mozilla,) comment(since) comment(1999) comment(*/) - key(white-space)operator(:) value(-pre-wrap)operator(;) comment(/*) comment(Opera) comment(4-6) comment(*/) - key(white-space)operator(:) value(-o-pre-wrap)operator(;) comment(/*) comment(Opera) comment(7) comment(*/) - key(word-wrap)operator(:) value(break-word)operator(;) comment(/*) comment(Internet) comment(Explorer) comment(5.5+) comment(*/) -operator(}) - -comment(/*) comment(footer) comment(*/) -class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft) operator({) key(margin-top)operator(:)float(.5em)operator(;) operator(}) -class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft) class(.yui-log-categoryfilters) operator({) operator(}) -class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft) class(.yui-log-sourcefilters) operator({) key(width)operator(:)float(100%)operator(;)key(border-top)operator(:)float(1px) value(solid) color(#575757)operator(;)key(margin-top)operator(:)float(.75em)operator(;)key(padding-top)operator(:)float(.75em)operator(;) operator(}) -class(.yui-skin-sam) class(.yui-log) class(.yui-log-filtergrp) operator({) key(margin-right)operator(:)float(.5em)operator(;) operator(}) - -comment(/*) comment(logs) comment(*/) -class(.yui-skin-sam) class(.yui-log) class(.info) operator({) key(background-color)operator(:)color(#A7CC25)operator(;) operator(}) comment(/*) comment(A7CC25) comment(green) comment(*/) -class(.yui-skin-sam) class(.yui-log) class(.warn) operator({) key(background-color)operator(:)color(#F58516)operator(;) operator(}) comment(/*) comment(F58516) comment(orange) comment(*/) -class(.yui-skin-sam) class(.yui-log) class(.error) operator({) key(background-color)operator(:)color(#E32F0B)operator(;) operator(}) comment(/*) comment(E32F0B) comment(red) comment(*/) -class(.yui-skin-sam) class(.yui-log) class(.time) operator({) key(background-color)operator(:)color(#A6C9D7)operator(;) operator(}) comment(/*) comment(A6C9D7) comment(blue) comment(*/) -class(.yui-skin-sam) class(.yui-log) class(.window) operator({) key(background-color)operator(:)color(#F2E886)operator(;) operator(}) comment(/*) comment(F2E886) comment(tan) comment(*/) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -class(.yui-skin-sam) class(.yui-log)operator({)key(padding)operator(:)float(1em)operator(;)key(width)operator(:)float(31em)operator(;)key(background-color)operator(:)color(#AAA)operator(;)key(color)operator(:)color(#000)operator(;)key(border)operator(:)float(1px) value(solid) value(black)operator(;)key(font-family)operator(:)value(monospace)operator(;)key(font-size)operator(:)float(77%)operator(;)key(text-align)operator(:)value(left)operator(;)key(z-index)operator(:)float(9000)operator(;)operator(})class(.yui-skin-sam) class(.yui-log-container)operator({)key(position)operator(:)value(absolute)operator(;)key(top)operator(:)float(1em)operator(;)key(right)operator(:)float(1em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(input)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-family)operator(:)value(arial)operator(;)key(font-size)operator(:)float(100%)operator(;)key(font-weight)operator(:)value(normal)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-btns)operator({)key(position)operator(:)value(relative)operator(;)key(float)operator(:)value(right)operator(;)key(bottom)operator(:)float(.25em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-hd)operator({)key(margin-top)operator(:)float(1em)operator(;)key(padding)operator(:)float(.5em)operator(;)key(background-color)operator(:)color(#575757)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-hd) type(h4)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)key(font-size)operator(:)float(108%)operator(;)key(font-weight)operator(:)value(bold)operator(;)key(color)operator(:)color(#FFF)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-bd)operator({)key(width)operator(:)float(100%)operator(;)key(height)operator(:)float(20em)operator(;)key(background-color)operator(:)color(#FFF)operator(;)key(border)operator(:)float(1px) value(solid) value(gray)operator(;)key(overflow)operator(:)value(auto)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(p)operator({)key(margin)operator(:)float(1px)operator(;)key(padding)operator(:)float(.1em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(pre)operator({)key(margin)operator(:)float(0)operator(;)key(padding)operator(:)float(0)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) type(pre)class(.yui-log-verbose)operator({)key(white-space)operator(:)value(pre-wrap)operator(;)key(white-space)operator(:)value(-moz-pre-wrap) important(!important)operator(;)key(white-space)operator(:)value(-pre-wrap)operator(;)key(white-space)operator(:)value(-o-pre-wrap)operator(;)key(word-wrap)operator(:)value(break-word)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft)operator({)key(margin-top)operator(:)float(.5em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft) class(.yui-log-categoryfilters)operator({)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-ft) class(.yui-log-sourcefilters)operator({)key(width)operator(:)float(100%)operator(;)key(border-top)operator(:)float(1px) value(solid) color(#575757)operator(;)key(margin-top)operator(:)float(.75em)operator(;)key(padding-top)operator(:)float(.75em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.yui-log-filtergrp)operator({)key(margin-right)operator(:)float(.5em)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.info)operator({)key(background-color)operator(:)color(#A7CC25)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.warn)operator({)key(background-color)operator(:)color(#F58516)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.error)operator({)key(background-color)operator(:)color(#E32F0B)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.time)operator({)key(background-color)operator(:)color(#A6C9D7)operator(;)operator(})class(.yui-skin-sam) class(.yui-log) class(.window)operator({)key(background-color)operator(:)color(#F2E886)operator(;)operator(}) -comment(/*) -comment(Copyright) comment((c\)) comment(2007,) comment(Yahoo!) comment(Inc.) comment(All) comment(rights) comment(reserved.) -comment(Code) comment(licensed) comment(under) comment(the) comment(BSD) comment(License:) -comment(http://developer.yahoo.net/yui/license.txt) -comment(version:) comment(2.3.1) -comment(*/) -comment(/*) comment(Menu) comment(&) comment(MenuBar) comment(styles) comment(*/) - -class(.yuimenu) class(.yuimenu)operator(,) -class(.yuimenubar) class(.yuimenu) operator({) - - key(position)operator(:) value(absolute)operator(;) - key(visibility)operator(:) value(hidden)operator(;) - -operator(}) - -class(.yuimenubar) type(li)operator(,) -class(.yuimenu) type(li) operator({) - - key(list-style-type)operator(:) value(none)operator(;) - -operator(}) - -class(.yuimenubar) type(ul)operator(,) -class(.yuimenu) type(ul)operator(,) -class(.yuimenubar) type(li)operator(,) -class(.yuimenu) type(li)operator(,) -class(.yuimenu) type(h6)operator(,) -class(.yuimenubar) type(h6) operator({) - - key(margin)operator(:) float(0)operator(;) - key(padding)operator(:) float(0)operator(;) - -operator(}) - -class(.yuimenuitemlabel)operator(,) -class(.yuimenubaritemlabel) operator({) - - key(white-space)operator(:) value(nowrap)operator(;) - -operator(}) - - -comment(/*) - comment(PLEASE) comment(NOTE:) comment(The) comment(
) comment(element) comment(used) comment(for) comment(a) comment(menu's) comment(shadow) comment(is) comment(appended) - comment(to) comment(its) comment(root) comment(element) comment(via) comment(JavaScript) comment(once) comment(it) comment(has) comment(been) comment(rendered.) comment(The) - comment(code) comment(that) comment(creates) comment(the) comment(shadow) comment(lives) comment(in) comment(the) comment(menu's) comment(public) comment("onRender") - comment(event) comment(handler) comment(that) comment(is) comment(a) comment(prototype) comment(method) comment(of) comment(YAHOO.widget.Menu.) - comment(Implementers) comment(wishing) comment(to) comment(remove) comment(a) comment(menu's) comment(shadow) comment(or) comment(add) comment(any) comment(other) comment(markup) - comment(required) comment(for) comment(a) comment(given) comment(skin) comment(for) comment(menu) comment(should) comment(override) comment(the) comment("onRender") comment(method.) -comment(*/) - -class(.yui-menu-shadow) operator({) - - key(position)operator(:) value(absolute)operator(;) - key(z-index)operator(:) float(-1)operator(;) - -operator(}) - - - -comment(/*) - -comment(There) comment(are) comment(two) comment(known) comment(issues) comment(with) comment(YAHOO.widget.Overlay) comment((the) comment(superclass) comment(class) comment(of) -comment(Menu\)) comment(that) comment(manifest) comment(in) comment(Gecko-based) comment(browsers) comment(on) comment(Mac) comment(OS) comment(X:) - - comment(1\)) comment(Elements) comment(with) comment(scrollbars) comment(will) comment(poke) comment(through) comment(Overlay) comment(instances) comment(floating) - comment(above) comment(them.) - - comment(2\)) comment(An) comment(Overlay's) comment(scrollbars) comment(and) comment(the) comment(scrollbars) comment(of) comment(its) comment(child) comment(nodes) comment(remain) - comment(visible) comment(when) comment(the) comment(Overlay) comment(is) comment(hidden.) - -comment(To) comment(fix) comment(these) comment(bugs) comment(in) comment(Menu) comment((a) comment(subclass) comment(of) comment(YAHOO.widget.Overlay\):) - - comment(1\)) comment(The) comment("overflow") comment(property) comment(of) comment(a) comment(Menu) comment(instance's) comment(shadow) comment(element) comment(and) comment(child) - comment(nodes) comment(is) comment(toggled) comment(between) comment("hidden") comment(and) comment("auto") comment((through) comment(the) comment(application) - comment(and) comment(removal) comment(of) comment(the) comment("hide-scrollbars") comment(and) comment("show-scrollbars") comment(CSS) comment(classes\)) - comment(as) comment(its) comment("visibility") comment(configuration) comment(property) comment(is) comment(toggled) comment(between) - comment("false") comment(and) comment("true.") - - comment(2\)) comment(The) comment("display") comment(property) comment(of) comment( elements bleeding through - the modality mask in IE 6. - - 2) ".drag select" is used to hide elements when a Panel instance is dragged. - - 3) ".hide-select select" is appended to an Overlay instance's root HTML - element when it is being annimated by YAHOO.widget.ContainerEffect. - This is necessary because elements that are child nodes of the - Overlay instance's root element is set to "none" when it is hidden. - -PLEASE NOTE: - - 1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are - applied only for Gecko on Mac OS X and are added/removed to/from the - Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and - "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay. - - 2) There may be instances where the CSS for a web page or application - contains style rules whose specificity override the rules implemented by - the Container CSS files to fix this bug. In such cases, is necessary to - leverage the provided "hide-scrollbars" and "show-scrollbars" classes to - write custom style rules to guard against this bug. - -** For more information on this issue, see: - - + https://bugzilla.mozilla.org/show_bug.cgi?id=187435 - + SourceForge bug #1723530 - -*/ - -.hide-scrollbars, -.hide-scrollbars * { - - overflow: hidden; - -} - -.hide-scrollbars select { - - display: none; - -} - -.show-scrollbars { - - overflow: auto; - -} - -.yui-panel-container.show-scrollbars, -.yui-tt.show-scrollbars { - - overflow: visible; - -} - -.yui-panel-container.show-scrollbars .underlay, -.yui-tt.show-scrollbars .yui-tt-shadow { - - overflow: auto; - -} - - -/* - PLEASE NOTE: The
element used for a Tooltip's shadow is appended - to its root element via JavaScript once it has been rendered. The - code that creates the shadow lives in the Tooltip's public "onRender" - event handler that is a prototype method of YAHOO.widget.Tooltip. - Implementers wishing to remove a Tooltip's shadow or add any other markup - required for a given skin for Tooltip should override the "onRender" method. -*/ - -.yui-tt-shadow { - - position: absolute; - -}/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -.yui-overlay, -.yui-panel-container { - visibility:hidden; - position:absolute; - z-index: 2; -} - -.yui-tt { - visibility:hidden; - position:absolute; - color:#333; - background-color:#FDFFB4; - font-family:arial,helvetica,verdana,sans-serif; - padding:2px; - border:1px solid #FCC90D; - font:100% sans-serif; - width:auto; -} - -/* - PLEASE NOTE: The
element used for a Tooltip's shadow is appended - to its root element via JavaScript once it has been rendered. The - code that creates the shadow lives in the Tooltip's public "onRender" - event handler that is a prototype method of YAHOO.widget.Tooltip. - Implementers wishing to remove a Tooltip's shadow or add any other markup - required for a given skin for Tooltip should override the "onRender" method. -*/ - -.yui-tt-shadow { - display: none; -} - -* html body.masked select { - visibility:hidden; -} - -* html div.yui-panel-container select { - visibility:inherit; -} - -* html div.drag select { - visibility:hidden; -} - -* html div.hide-select select { - visibility:hidden; -} - -.mask { - z-index: 1; - display:none; - position:absolute; - top:0; - left:0; - -moz-opacity: 0.5; - opacity:.50; - filter: alpha(opacity=50); - background-color:#CCC; -} - -/* - -There are two known issues with YAHOO.widget.Overlay (and its subclasses) that -manifest in Gecko-based browsers on Mac OS X: - - 1) Elements with scrollbars will poke through Overlay instances floating - above them. - - 2) An Overlay's scrollbars and the scrollbars of its child nodes remain - visible when the Overlay is hidden. - -To fix these bugs: - - 1) The "overflow" property of an Overlay instance's root element and child - nodes is toggled between "hidden" and "auto" (through the application - and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes) - as its "visibility" configuration property is toggled between - "false" and "true." - - 2) The "display" property of elements that are child nodes of the - Menu instance's root element is set to "none" when it is hidden. - -PLEASE NOTE: - - 1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are - applied only for Gecko on Mac OS X and are added/removed to/from the - Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and - "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay. - - 2) There may be instances where the CSS for a web page or application - contains style rules whose specificity override the rules implemented by - the Menu CSS files to fix this bug. In such cases, is necessary to - leverage the provided "hide-scrollbars" and "show-scrollbars" classes to - write custom style rules to guard against this bug. - -** For more information on this issue, see: - - + https://bugzilla.mozilla.org/show_bug.cgi?id=187435 - + SourceForge bug #1723530 - -*/ - -.hide-scrollbars * { - - overflow: hidden; - -} - -.hide-scrollbars select { - - display: none; - -} - - -/* - -The following style rule (".yuimenu.show-scrollbars") overrides the -".show-scrollbars" rule defined in container-core.css which sets the -"overflow" property of a YAHOO.widget.Overlay instance's root HTML element to -"auto" when it is visible. Without this override, a Menu would have scrollbars -when one of its submenus is visible. - -*/ - -.yuimenu.show-scrollbars { - - overflow: visible; - -} - -.yuimenu.hide-scrollbars .yui-menu-shadow { - - overflow: hidden; - -} - -.yuimenu.show-scrollbars .yui-menu-shadow { - - overflow: auto; - -}/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -/* Menu & MenuBar styles */ - -.yuimenu { - - background-color:#f6f7ee; - border:solid 1px #c4c4be; - padding:1px; - -} - -/* - -The following style rule (".yuimenu.show-scrollbars") overrides the -".show-scrollbars" rule defined in container.css which sets the -"overflow" property of a YAHOO.widget.Overlay instance's root HTML element to -"auto" when it is visible. Without this override, a Menu would have scrollbars -when one of its submenus is visible. - -*/ - -.yuimenu.show-scrollbars { - - overflow: visible; - -} - -.yui-menu-shadow { - - display: none; - -} - -.yuimenu .yuimenu, -.yuimenubar .yuimenu { - - position:absolute; - visibility:hidden; - -} - -.yuimenubar { - - background-color:#f6f7ee; - -} - -.yuimenubar ul { - - *zoom:1; - -} - -.yuimenubar ul:after { - - content:"."; - display:block; - clear:both; - visibility:hidden; - height:0; - line-height:0; - -} - -.yuimenu h6, -.yuimenubar h6 { - - font-size:100%; - font-weight:normal; - margin:0; - border:solid 1px #c4c4be; - color:#b9b9b9; - -} - -.yuimenubar h6 { - - float:left; - padding:4px 12px; - border-width:0 1px 0 0; - -} - -.yuimenubar .yuimenu h6 { - - float:none; - -} - -.yuimenu h6 { - - border-width:1px 0 0 0; - padding:5px 10px 0 10px; - -} - -.yuimenubar ul { - - margin:0; - padding:0; - -} - -.yuimenu ul { - - border:solid 1px #c4c4be; - border-width:1px 0 0 0; - margin:0; - padding:10px 0; - -} - -.yuimenu ul.first-of-type, -.yuimenu ul.hastitle, -.yuimenu h6.first-of-type { - - border-width:0; - -} - -.yuimenubar li, -.yuimenu li { - - list-style-type: none; - -} - -.yuimenu .yui-menu-body-scrolled { - - overflow: hidden; - -} - -.yuimenu .topscrollbar, -.yuimenu .bottomscrollbar { - - height:16px; - background-image:url(map.gif); - background-repeat:no-repeat; - -} - -.yuimenu .topscrollbar { - - background-image:url(map.gif); - background-position:center -72px; - -} - -.yuimenu .topscrollbar_disabled { - - background-image:url(map.gif); - background-position:center -88px; - -} - -.yuimenu .bottomscrollbar { - - background-image:url(map.gif); - background-position:center -104px; - -} - -.yuimenu .bottomscrollbar_disabled { - - background-image:url(map.gif); - background-position:center -120px; - -} - - -/* MenuItem and MenuBarItem styles */ - -.yuimenubaritem { - - float:left; - -} - -.yuimenuitemlabel, -.yuimenubaritemlabel { - - white-space: nowrap; - font-size:85%; - display:block; - color:#000; - text-decoration:none; - -} - -.yuimenuitemlabel { - - padding:2px 24px; - outline:none; - -} - -.yuimenubaritemlabel { - - border-width:0 0 0 1px; - border-style:solid; - border-color:#c4c4be; - padding:4px 24px; - -} - -li.first-of-type .yuimenubaritemlabel { - - border-width:0; - -} - -.yuimenuitemlabel .helptext { - - font-style:normal; - margin:0 0 0 40px; - -} - -.yuimenuitemlabel .submenuindicator, -.yuimenuitemlabel .checkedindicator, -.yuimenubaritemlabel .submenuindicator { - - display:block; - height:8px; - width:8px; - overflow:hidden; - vertical-align:middle; - text-indent:9px; - background-image:url(map.gif); - background-repeat:no-repeat; - -} - -.yuimenubaritemlabel .submenuindicator { - - display:-moz-inline-stack; /* Gecko */ - display:inline-block; /* IE, Opera and Safari */ - font:0/0 arial; /* Gecko */ - -} - -.yuimenuitemlabel .submenuindicator { - - background-position:0 0; - -} - -.yuimenubaritemlabel .submenuindicator { - - background-position:0 -24px; - margin:0 0 0 10px; - -} - -.yuimenuitemlabel .checkedindicator { - - background-position:0 -48px; - -} - -.visible .yuimenuitem, -.visible .yuimenuitemlabel { - - *zoom:1; - -} - -.visible .yuimenuitemlabel .helptext { - - float:right; - width:100%; - text-align:right; - margin:-1.2em 0 0 0; - *cursor:hand; /* Required to restore the style of the cursor in IE */ - -} - -.visible .yuimenuitemlabel .submenuindicator { - - margin:-.9em -16px 4px auto; - *margin:-.9em -16px 0 105%; - -} - -.visible .yuimenuitemlabel .checkedindicator { - - margin:-.9em auto 4px -16px; - *margin-bottom:0; - -} - - - -/* Matches selected menu items */ - -.yuimenuitem a.selected, -.yuimenubaritem a.selected { - - background-color:#8c8ad0; - text-decoration:underline; - color:#fff; - -} - -.yuimenubaritem a.selected .submenuindicator { - - background-position:0 -32px; - -} - -.yuimenuitem a.selected .submenuindicator { - - background-position:0 -8px; - -} - -.yuimenuitem a.selected .checkedindicator { - - background-position:0 -56px; - -} - - -/* Matches disabled menu items */ - -.yuimenubaritem a.disabled .submenuindicator { - - background-position:0 -40px; - -} - -.yuimenuitem a.disabled { - - cursor:default; - color:#b9b9b9; - -} - -.yuimenuitem a.disabled .submenuindicator { - - background-position:0 -16px; - -} - -.yuimenuitem a.disabled .checkedindicator { - - background-position:0 -64px; - -}/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -/* MenuBar style rules */ - -.yui-skin-sam .yuimenubar { - - border: solid 1px #808080; - background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; - -} - -/* - The following two style rules cause a MenuBar's UL to clear its - floating LIs. -*/ - -.yui-skin-sam .yuimenubar .bd, -.yui-skin-sam .yuimenubar ul { - - *zoom: 1; /* For IE */ - -} - -.yui-skin-sam .yuimenubar>.bd>ul:after { - - content: "."; - display: block; - clear: both; - visibility: hidden; - height: 0; - line-height: 0; - -} - - -/* MenuBarItem style rules */ - -.yui-skin-sam .yuimenubaritem { - - float: left; - -} - -.yui-skin-sam .yuimenubarnav .yuimenubaritem { - - border-right: solid 1px #ccc; - -} - -.yui-skin-sam .yuimenubaritemlabel { - - display: block; - *display: inline-block; /* For IE */ - font-size: 93%; /* 12px */ - line-height: 2; /* ~24px */ - *line-height: 1.9; /* For IE */ - padding: 0 10px; - color: #000; - text-decoration: none; - outline: none; - cursor: default; - border-style: solid; - border-color: #808080; - border-width: 1px 0; - position: relative; - margin: -1px 0; - -} - -.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel { - - padding-right: 20px; - -} - -.yui-skin-sam .yuimenubaritemlabel .submenuindicator { - - /* - Set height and width to 1px so screen readers announce the content of - the element. - */ - - width: 1px; - height: 1px; - top: 0; - left: 0; - -} - -.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel .submenuindicator { - - top: 50%; - right: 8px; - left: auto; /* Override "left" property set by previous style rule */ - margin-top: -3px; - height: 4px; - width: 7px; - text-indent: 8px; - background-position: -16px -856px; - -} - - -/* MenuBarItem states */ - -/* Selected MenuBarItem */ - -.yui-skin-sam .yuimenubaritem a.selected { - - background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px; - border-color: #7D98B8; - -} - -.yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected { - - border-left-width: 1px; - margin-left: -1px; - *left: -1px; /* For IE */ - -} - -.yui-skin-sam .yuimenubar a.selected .submenuindicator { - - background: transparent; - -} - -.yui-skin-sam .yuimenubarnav a.selected .submenuindicator { - - /* - Reset the value of the "background" property since it is set to - "transparent" by the previous rule. - */ - - background: url(../../../../assets/skins/sam/sprite.png) repeat-x -16px -856px; - -} - - -/* Disabled MenuBarItem */ - -.yui-skin-sam .yuimenubaritem a.disabled { - - cursor: default; - color: #A6A6A6; - -} - -.yui-skin-sam .yuimenubarnav .yuimenubaritem a.disabled .submenuindicator { - - background-position: -16px -881px; - -} - - -/* Menu style rules */ - -.yui-skin-sam .yuimenu .bd { - - border: solid 1px #808080; - background-color: #fff; - -} - -.yui-skin-sam .yuimenu ul { - - padding: 3px 0; - border-width: 1px 0 0 0; - border-color: #ccc; - border-style: solid; - -} - -.yui-skin-sam .yuimenu ul.first-of-type { - - border-width: 0; - -} - - -/* Group titles */ - -.yui-skin-sam .yuimenu h6 { - - font-size: 93%; /* 12px */ - font-weight: bold; - line-height: 1.5; /* 18px */ - *line-height: 1.45; /* For IE */ - border-style: solid; - border-color: #ccc; - border-width: 1px 0 0 0; - color: #a4a4a4; - padding: 3px 10px 0 10px; - -} - -.yui-skin-sam .yuimenu ul.hastitle, -.yui-skin-sam .yuimenu h6.first-of-type { - - border-width: 0; - -} - - -/* Top and bottom scroll controls */ - -.yui-skin-sam .yuimenu .yui-menu-body-scrolled { - - border-color: #ccc #808080; - overflow: hidden; - -} - -.yui-skin-sam .yuimenu .topscrollbar, -.yui-skin-sam .yuimenu .bottomscrollbar { - - height: 16px; - border: solid 1px #808080; - background: #fff url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0; - -} - -.yui-skin-sam .yuimenu .topscrollbar { - - border-bottom-width: 0; - background-position: center -950px; - -} - -.yui-skin-sam .yuimenu .topscrollbar_disabled { - - background-position: center -975px; - -} - -.yui-skin-sam .yuimenu .bottomscrollbar { - - border-top-width: 0; - background-position: center -850px; - -} - -.yui-skin-sam .yuimenu .bottomscrollbar_disabled { - - background-position: center -875px; - -} - - -/* MenuItem style rules */ - -.yui-skin-sam .yuimenuitemlabel { - - font-size: 93%; /* 12px */ - line-height: 1.5; /* 18px */ - *line-height: 1.45; /* For IE */ - padding: 0 20px; - display: block; - color: #000; - text-decoration: none; - outline: none; - position: relative; - - /* - Need to set the "position" property to "static" for IE otherwise the - MenuItem instances will not respect the value of the "overflow" - property that is applied to its body element (see the above - ".yui-skin-sam .yuimenu .yui-menu-body-scrolled" rule) when it - is scrolled. - */ - - *position: static; - cursor: default; - -} - -.yui-skin-sam .yuimenuitemlabel .helptext { - - font-style: normal; - display: block; - margin: -1.5em 0 0 10em; - *margin-top: -1.45em; /* For IE*/ - -} - -.yui-skin-sam .yuimenuitemlabel .submenuindicator, -.yui-skin-sam .yuimenuitemlabel .checkedindicator, -.yui-skin-sam .yuimenubaritemlabel .submenuindicator { - - position: absolute; - overflow: hidden; - background: url(../../../../assets/skins/sam/sprite.png) no-repeat; - -} - -/* - Set special values for the "position" and "display" properties for IE since - it is necessary to position the submenu and checked indicator nodes - differently since their parent element isn't relatively positioned. -*/ - -.yui-skin-sam .yuimenuitemlabel .submenuindicator, -.yui-skin-sam .yuimenuitemlabel .checkedindicator { - - *position: static; - *display: inline-block; - -} - -.yui-skin-sam .yuimenuitemlabel .submenuindicator { - - top: 50%; - right: 8px; - margin-top: -3px; - height: 7px; - width: 4px; - text-indent: 5px; - background-position: 0 -906px; - -} - -.yui-skin-sam .yuimenuitemlabel .checkedindicator { - - top: 50%; - left: 8px; - margin-top: -3px; - height: 7px; - width: 7px; - text-indent: 8px; - background-position: 0 -1006px; - -} - - -/* Menu states */ - -/* Visible Menu */ - -/* - The following three rules are used to position the submenu and checked - indicator nodes for IE since their parent element isn't - relatively positioned. -*/ - -.yui-skin-sam .visible .yuimenuitemlabel .submenuindicator { - - *float: right; - *margin: -1em 8px 0 8px; - -} - -.yui-skin-sam .visible .yuimenuitem .hassubmenu { - - *padding-right: 0; - -} - -.yui-skin-sam .visible .yuimenuitemlabel .checkedindicator { - - *float: left; - *margin: -1em 0 0 -12px; - -} - -.yui-skin-sam .yui-menu-shadow-visible { - - top: 2px; - right: -3px; - left: -3px; - bottom: -3px; - background-color: #000; - opacity: .12; - *filter: alpha(opacity=12); /* For IE */ - visibility: visible; - -} - -.yui-skin-sam .visible .bd, -.yui-skin-sam .visible .yuimenuitem { - - _zoom: 1; /* For IE 7 Quirks Mode and IE 6 Standards and Quirks Mode */ - -} - -.yui-skin-sam .visible .yuimenuitemlabel { - - *zoom: 1; /* For IE */ - -} - - -/* MenuItem states */ - -/* Selected MenuItem */ - -.yui-skin-sam .yuimenuitem a.selected { - - /* - Use "background" over "background-color" to clear background image - set by the ".yuimenubaritem a.selected" rule. - */ - - background: #B3D4FF; - -} - -/* - Redefine the background for MenuItem instances that are children of - a Menubar since the - ".yui-skin-sam .yuimenubar a.selected .submenuindicator" rule sets the - "background" property to "transparent" -*/ - -.yui-skin-sam .yuimenubar .yuimenuitem a.selected .submenuindicator { - - background: url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -906px; - -} - -/* - Remove borders and margin added by the style rule - ".yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected" -*/ - -.yui-skin-sam .yuimenubarnav .yuimenuitem a.selected { - - border-width: 0; - margin: 0; - *left: 0; /* For IE */ - -} - - -/* Disabled MenuItem */ - -.yui-skin-sam .yuimenuitem a.disabled { - - cursor: default; - color: #A6A6A6; - -} - -.yui-skin-sam .yuimenuitem a.disabled .submenuindicator { - - background-position: 0 -931px; - -} - -.yui-skin-sam .yuimenuitem a.disabled .checkedindicator { - - background-position: 0 -1031px; - -}/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -.yuimenu .yuimenu,.yuimenubar .yuimenu{position:absolute;visibility:hidden;}.yuimenubar li,.yuimenu li{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{white-space:nowrap;}.yui-menu-shadow{position:absolute;z-index:-1;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{border:solid 1px #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubar .bd,.yui-skin-sam .yuimenubar ul{*zoom:1;}.yui-skin-sam .yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yui-skin-sam .yuimenubaritem{float:left;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{display:block;*display:inline-block;font-size:93%;line-height:2;*line-height:1.9;padding:0 10px;color:#000;text-decoration:none;outline:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;}.yui-skin-sam .yuimenubaritemlabel .submenuindicator{width:1px;height:1px;top:0;left:0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel .submenuindicator{top:50%;right:8px;left:auto;margin-top:-3px;height:4px;width:7px;text-indent:8px;background-position:-16px -856px;}.yui-skin-sam .yuimenubaritem a.selected{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubar a.selected .submenuindicator{background:transparent;}.yui-skin-sam .yuimenubarnav a.selected .submenuindicator{background:url(../../../../assets/skins/sam/sprite.png) repeat-x -16px -856px;}.yui-skin-sam .yuimenubaritem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.disabled .submenuindicator{background-position:-16px -881px;}.yui-skin-sam .yuimenu .bd{border:solid 1px #808080;background-color:#fff;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-size:93%;font-weight:bold;line-height:1.5;*line-height:1.45;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .yui-menu-body-scrolled{border-color:#ccc #808080;overflow:hidden;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{height:16px;border:solid 1px #808080;background:#fff url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{border-bottom-width:0;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{border-top-width:0;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitemlabel{font-size:93%;line-height:1.5;*line-height:1.45;padding:0 20px;display:block;color:#000;text-decoration:none;outline:none;position:relative;*position:static;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{font-style:normal;display:block;margin:-1.5em 0 0 10em;*margin-top:-1.45em;}.yui-skin-sam .yuimenuitemlabel .submenuindicator,.yui-skin-sam .yuimenuitemlabel .checkedindicator,.yui-skin-sam .yuimenubaritemlabel .submenuindicator{position:absolute;overflow:hidden;background:url(../../../../assets/skins/sam/sprite.png) no-repeat;}.yui-skin-sam .yuimenuitemlabel .submenuindicator,.yui-skin-sam .yuimenuitemlabel .checkedindicator{*position:static;*display:inline-block;}.yui-skin-sam .yuimenuitemlabel .submenuindicator{top:50%;right:8px;margin-top:-3px;height:7px;width:4px;text-indent:5px;background-position:0 -906px;}.yui-skin-sam .yuimenuitemlabel .checkedindicator{top:50%;left:8px;margin-top:-3px;height:7px;width:7px;text-indent:8px;background-position:0 -1006px;}.yui-skin-sam .visible .yuimenuitemlabel .submenuindicator{*float:right;*margin:-1em 8px 0 8px;}.yui-skin-sam .visible .yuimenuitem .hassubmenu{*padding-right:0;}.yui-skin-sam .visible .yuimenuitemlabel .checkedindicator{*float:left;*margin:-1em 0 0 -12px;}.yui-skin-sam .yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);visibility:visible;}.yui-skin-sam .visible .bd,.yui-skin-sam .visible .yuimenuitem{_zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel{*zoom:1;}.yui-skin-sam .yuimenuitem a.selected{background:#B3D4FF;}.yui-skin-sam .yuimenubar .yuimenuitem a.selected .submenuindicator{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -906px;}.yui-skin-sam .yuimenubarnav .yuimenuitem a.selected{border-width:0;margin:0;*left:0;}.yui-skin-sam .yuimenuitem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem a.disabled .submenuindicator{background-position:0 -931px;}.yui-skin-sam .yuimenuitem a.disabled .checkedindicator{background-position:0 -1031px;} -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -body{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup,sub{line-height:-1px;vertical-align:text-top;}sub{vertical-align:text-bottom;}input, textarea, select{font-family:inherit;font-size:inherit;font-weight:inherit;}/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -body {color:#000;background:#FFF;} -body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;} -table{border-collapse:collapse;border-spacing:0;} -fieldset,img{border:0;} -address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;} -li {list-style:none;} -caption,th {text-align:left;} -h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;} -q:before,q:after{content:'';} -abbr,acronym {border:0;font-variant:normal;} -sup,sub {line-height:-1px;vertical-align: text-top;} -sub {vertical-align:text-bottom;} -input, textarea, select{font-family:inherit;font-size:inherit;font-weight:inherit;}/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -/*reset.css*/body{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup,sub{line-height:-1px;vertical-align:text-top;}sub{vertical-align:text-bottom;}input, textarea, select{font-family:inherit;font-size:inherit;font-weight:inherit;} -/*fonts.css*/body {font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:99%;} -/*grids.css*/body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.301em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.117em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gb .yui-u,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;margin-left:2%;width:32%;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:.8%;}.yui-gb .yui-u{float:right;}.yui-gb div.first{margin-left:0;float:left;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u{width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first{width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-g div.first{*margin:0;}.yui-gb .yui-g div.first{*margin-right:4%;_margin-right:1.3%;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-gc div.first,.yui-gc div.first,.yui-gd .yui-g,.yui-gd .yui-u{width:66%;}.yui-gd div.first,.yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf div.first{width:24%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u{float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first {float:left;}.yui-ge div.first,.yui-gf .yui-g,.yui-gf .yui-u{width:74.2%;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}.yui-gb .yui-u{float:left;}/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -.yui-navset .yui-nav li a, .yui-navset .yui-content { - border:1px solid #000; /* label and content borders */ -} - -.yui-navset .yui-nav .selected a, .yui-navset .yui-nav a:hover, .yui-navset .yui-content { - background-color:#f6f7ee; /* active tab, tab hover, and content bgcolor */ -} - -.yui-navset .yui-nav li em { padding:.5em; } /* tab padding */ - -/* defaults to orientation "top" */ -.yui-navset .yui-nav .selected a { - border-bottom-width:0; /* no bottom border for active tab */ - padding-bottom:1px; /* to match height of other tabs */ -} - -.yui-navset .yui-content { - margin-top:-1px; /* for active tab overlap */ -} - -/* overrides for other orientations */ - -.yui-navset-bottom .yui-nav .selected a { - border-width:0 1px 1px; /* no top border for active tab */ - padding:1px 0 0; /* to match height of other tabs */ -} - -.yui-navset-bottom .yui-content { - margin:0 0 -1px; /* for active tab overlap */ -} - -.yui-navset-left .yui-nav li.selected a { - border-width:1px 0 1px 1px; /* no right border for active tab */ - padding:0 1px 0 0; /* to match width of other tabs */ -} - -.yui-navset-left .yui-content { - margin:0 0 0 -1px; /* for active tab overlap */ -} - -.yui-navset-right .yui-nav li.selected a { - border-width:1px 1px 1px 0; /* no left border for active tab */ - padding:0 0 0 1px; /* to match width of other tabs */ -} - -.yui-navset-right .yui-content { - margin:0 -1px 0 0; /* for active tab overlap */ -}/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -.yui-navset .yui-nav li { - margin-right:0.16em; /* space between tabs */ - padding-top:1px; /* gecko: make room for overflow */ - zoom:1; -} - -.yui-navset .yui-nav .selected { - margin-bottom:-1px; /* for overlap */ -} - -.yui-navset .yui-nav a { - background:#dadbdb url(../../assets/skins/sam/sprite.png) repeat-x; /* sprite position for normal gradient */ - border:solid #a3a3a3; - border-width:0 1px; - color:#000; - text-decoration:none; -} - -.yui-navset .yui-nav li a em { - border-top:solid 1px #a3a3a3; - border-bottom:0; - cursor:hand; - padding:0.2em 0.5em; - top:-1px; /* for 1px rounded corners */ - position:relative; -} - -.yui-navset .yui-nav .selected a, -.yui-navset .yui-nav a:focus, -.yui-navset .yui-nav a:hover { - background:#214197 url(../../assets/skins/sam/sprite.png) repeat-x left -1400px; - color:#fff; -} - -.yui-navset .yui-nav .selected a em { - padding:0.3em 0.5em; /* raise selected tab */ -} - -.yui-navset .yui-nav .selected a, -.yui-navset .yui-nav a:hover, -.yui-navset .yui-nav a:focus { - border-color:#243356; -} - -.yui-navset .yui-nav a:hover em, -.yui-navset .yui-nav a:focus em, -.yui-navset .yui-nav .selected a em { - border-color:#233356 #406ed9; -} - -.yui-navset .yui-nav { - border-bottom:1px solid #243356; - position:relative; - zoom:1; -} - -.yui-navset .yui-content { - background:#abceff; - border-top:5px solid #214095; -} - -.yui-navset .yui-content div { - border:1px solid #808080; - border-top-color:#243356; - padding:0.25em 0.5em; -} - -.yui-navset .yui-content div div { /* kill inheritance */ - border:0; - padding:0; -} -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -/* .yui-navset defaults to .yui-navset-top */ -.yui-skin-sam .yui-navset .yui-nav, -.yui-skin-sam .yui-navset .yui-navset-top .yui-nav { /* protect nested tabviews from other orientations */ - border:solid #2647a0; /* color between tab list and content */ - border-width:0 0 5px; - Xposition:relative; - zoom:1; -} - -.yui-skin-sam .yui-navset .yui-nav li, -.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li { - margin:0 0.16em 0 0; /* space between tabs */ - padding:1px 0 0; /* gecko: make room for overflow */ - zoom:1; -} - -.yui-skin-sam .yui-navset .yui-nav .selected, -.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected { - margin:0 0.16em -1px 0; /* for overlap */ -} - -.yui-skin-sam .yui-navset .yui-nav a, -.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a { - background:#d8d8d8 url(../../../../assets/skins/sam/sprite.png) repeat-x; /* tab background */ - border:solid #a3a3a3; - border-width:0 1px; - color:#000; - position:relative; - text-decoration:none; -} - -.yui-skin-sam .yui-navset .yui-nav a em, -.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em { - border:solid #a3a3a3; - border-width:1px 0 0; - cursor:hand; - padding:0.25em .75em; - left:0; right: 0; bottom: 0; /* protect from other orientations */ - top:-1px; /* for 1px rounded corners */ - position:relative; -} - -.yui-skin-sam .yui-navset .yui-nav .selected a, -.yui-skin-sam .yui-navset .yui-nav .selected a:focus, /* no focus effect for selected */ -.yui-skin-sam .yui-navset .yui-nav .selected a:hover { /* no hover effect for selected */ - background:#2647a0 url(../../../../assets/skins/sam/sprite.png) repeat-x left -1400px; /* selected tab background */ - color:#fff; -} - -.yui-skin-sam .yui-navset .yui-nav a:hover, -.yui-skin-sam .yui-navset .yui-nav a:focus { - background:#bfdaff url(../../../../assets/skins/sam/sprite.png) repeat-x left -1300px; /* selected tab background */ - outline:0; -} - -.yui-skin-sam .yui-navset .yui-nav .selected a em { - padding:0.35em 0.75em; /* raise selected tab */ -} - -.yui-skin-sam .yui-navset .yui-nav .selected a, -.yui-skin-sam .yui-navset .yui-nav .selected a em { - border-color:#243356; /* selected tab border color */ -} - -.yui-skin-sam .yui-navset .yui-content { - background:#edf5ff; /* content background color */ -} - -.yui-skin-sam .yui-navset .yui-content, -.yui-skin-sam .yui-navset .yui-navset-top .yui-content { - border:1px solid #808080; /* content border */ - border-top-color:#243356; /* different border color */ - padding:0.25em 0.5em; /* content padding */ -} - -/* left and right orientations */ -.yui-skin-sam .yui-navset-left .yui-nav, -.yui-skin-sam .yui-navset .yui-navset-left .yui-nav, -.yui-skin-sam .yui-navset .yui-navset-right .yui-nav, -.yui-skin-sam .yui-navset-right .yui-nav { - border-width:0 5px 0 0; - Xposition:absolute; /* from tabview-core; have to reiterate for skin-sam due to pos:rel on skin-sam yui-nav */ - top:0; bottom:0; /* stretch to fill content height */ -} - -.yui-skin-sam .yui-navset .yui-navset-right .yui-nav, -.yui-skin-sam .yui-navset-right .yui-nav { - border-width:0 0 0 5px; -} - -.yui-skin-sam .yui-navset-left .yui-nav li, -.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li, -.yui-skin-sam .yui-navset-right .yui-nav li { - margin:0 0 0.16em; /* space between tabs */ - padding:0 0 0 1px; /* gecko: make room for overflow */ -} - -.yui-skin-sam .yui-navset-right .yui-nav li { - padding:0 1px 0 0; /* gecko: make room for overflow */ -} - -.yui-skin-sam .yui-navset-left .yui-nav .selected, -.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected { - margin:0 -1px 0.16em 0; -} - -.yui-skin-sam .yui-navset-right .yui-nav .selected { - margin:0 0 0.16em -1px; -} - -.yui-skin-sam .yui-navset-left .yui-nav a, -.yui-skin-sam .yui-navset-right .yui-nav a { - border-width:1px 0; -} - -.yui-skin-sam .yui-navset-left .yui-nav a em, -.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em, -.yui-skin-sam .yui-navset-right .yui-nav a em { - border-width:0 0 0 1px; - padding:0.2em .75em; - top:auto; - left:-1px; /* for 1px rounded corners */ -} - -.yui-skin-sam .yui-navset-right .yui-nav a em { - border-width:0 1px 0 0; - left:auto; - right:-1px; /* for 1px rounded corners */ -} - -.yui-skin-sam .yui-navset-left .yui-nav a, -.yui-skin-sam .yui-navset-left .yui-nav .selected a, -.yui-skin-sam .yui-navset-left .yui-nav a:hover, -.yui-skin-sam .yui-navset-right .yui-nav a, -.yui-skin-sam .yui-navset-right .yui-nav .selected a, -.yui-skin-sam .yui-navset-right .yui-nav a:hover, -.yui-skin-sam .yui-navset-bottom .yui-nav a, -.yui-skin-sam .yui-navset-bottom .yui-nav .selected a, -.yui-skin-sam .yui-navset-bottom .yui-nav a:hover { - background-image:none; /* no left-right or bottom-top gradient */ -} - -.yui-skin-sam .yui-navset-left .yui-content { - border:1px solid #808080; /* content border */ - border-left-color:#243356; /* different border color */ -} - -/* bottom orientation */ -.yui-skin-sam .yui-navset-bottom .yui-nav, -.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav { - border-width:5px 0 0; /* color between tab list and content */ -} - -.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected, -.yui-skin-sam .yui-navset-bottom .yui-nav .selected { - margin:-1px 0.16em 0 0; /* for overlap */ -} - -.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li, -.yui-skin-sam .yui-navset-bottom .yui-nav li { - padding:0 0 1px 0; /* gecko: make room for overflow */ - vertical-align:top; -} - -.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a, -.yui-skin-sam .yui-navset-bottom .yui-nav li a { -} - -.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em, -.yui-skin-sam .yui-navset-bottom .yui-nav a em { - border-width:0 0 1px; - top:auto; - bottom:-1px; /* for 1px rounded corners */ -} - -.yui-skin-sam .yui-navset-bottom .yui-content, -.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content { - border:1px solid #808080; /* content border */ - border-bottom-color:#243356; /* different border color */ -} - -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{position:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(../../../../assets/skins/sam/sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(../../../../assets/skins/sam/sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(../../../../assets/skins/sam/sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;} -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -/* default space between tabs */ -.yui-navset .yui-nav li, -.yui-navset .yui-navset-top .yui-nav li, -.yui-navset .yui-navset-bottom .yui-nav li { - margin:0 0.5em 0 0; /* horizontal tabs */ -} -.yui-navset-left .yui-nav li, -.yui-navset-right .yui-nav li { - margin:0 0 0.5em; /* vertical tabs */ -} - -/* default width for side tabs */ -.yui-navset .yui-navset-left .yui-nav, -.yui-navset .yui-navset-right .yui-nav, -.yui-navset-left .yui-nav, -.yui-navset-right .yui-nav { width:6em; } - -.yui-navset-top .yui-nav, -.yui-navset-bottom .yui-nav { - width:auto; -} -.yui-navset .yui-navset-left, -.yui-navset-left { padding:0 0 0 6em; } /* map to nav width */ -.yui-navset-right { padding:0 6em 0 0; } /* ditto */ - -.yui-navset-top, -.yui-navset-bottom { - padding:auto; -} -/* core */ - -.yui-nav, -.yui-nav li { - margin:0; - padding:0; - list-style:none; -} -.yui-navset li em { font-style:normal; } - -.yui-navset { - position:relative; /* contain absolute positioned tabs (left/right) */ - zoom:1; -} - -.yui-navset .yui-content { zoom:1; } - -.yui-navset .yui-nav li, -.yui-navset .yui-navset-top .yui-nav li, /* in case nested */ -.yui-navset .yui-navset-bottom .yui-nav li { - display:inline-block; - display:-moz-inline-stack; - *display:inline; /* IE */ - vertical-align:bottom; /* safari: for overlap */ - cursor:pointer; /* gecko: due to -moz-inline-stack on anchor */ - zoom:1; /* IE: kill space between horizontal tabs */ -} - -.yui-navset-left .yui-nav li, -.yui-navset-right .yui-nav li { - display:block; -} - -.yui-navset .yui-nav a { position:relative; } /* IE: to allow overlap */ - -.yui-navset .yui-nav li a, -.yui-navset-top .yui-nav li a, -.yui-navset-bottom .yui-nav li a { - display:block; - display:inline-block; - vertical-align:bottom; /* safari: for overlap */ - zoom:1; -} - -.yui-navset-left .yui-nav li a, -.yui-navset-right .yui-nav li a { - display:block; -} - -.yui-navset-bottom .yui-nav li a { - vertical-align:text-top; /* for inline overlap (reverse for Opera border bug) */ -} - -.yui-navset .yui-nav li a em, -.yui-navset-top .yui-nav li a em, -.yui-navset-bottom .yui-nav li a em { display:block; } - -/* position left and right oriented tabs */ -.yui-navset .yui-navset-left .yui-nav, -.yui-navset .yui-navset-right .yui-nav, -.yui-navset-left .yui-nav, -.yui-navset-right .yui-nav { - position:absolute; - z-index:1; -} - -.yui-navset-top .yui-nav, -.yui-navset-bottom .yui-nav { - position:static; -} -.yui-navset .yui-navset-left .yui-nav, -.yui-navset-left .yui-nav { left:0; right:auto; } - -.yui-navset .yui-navset-right .yui-nav, -.yui-navset-right .yui-nav { right:0; left:auto; } -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -/* default space between tabs */ -.yui-navset .yui-nav li { - margin-right:0.5em; /* horizontal tabs */ -} -.yui-navset-left .yui-nav li, .yui-navset-right .yui-nav li { - margin:0 0 0.5em; /* vertical tabs */ -} - -/* default width for side tabs */ -.yui-navset-left .yui-nav, .yui-navset-right .yui-nav { width:6em; } -.yui-navset-left { padding-left:6em; } /* map to nav width */ -.yui-navset-right { padding-right:6em; } /* ditto */ - -/* core */ - -.yui-nav, .yui-nav li { - margin:0; - padding:0; - list-style:none; -} -.yui-navset li em { font-style:normal; } - -.yui-navset { - position:relative; /* contain absolute positioned tabs (left/right) */ - zoom:1; -} - -.yui-navset .yui-content { zoom:1; } - -.yui-navset .yui-nav li { - display:inline-block; - display:-moz-inline-stack; - *display:inline; /* IE */ - vertical-align:bottom; /* safari: for overlap */ - cursor:pointer; /* gecko: due to -moz-inline-stack on anchor */ - zoom:1; /* IE: kill space between horizontal tabs */ -} - -.yui-navset-left .yui-nav li, .yui-navset-right .yui-nav li { - display:block; -} - -.yui-navset .yui-nav a { - outline:0; /* gecko: keep from shifting */ -} - -.yui-navset .yui-nav a { position:relative; } /* IE: to allow overlap */ - -.yui-navset .yui-nav li a { - display:block; - display:inline-block; - vertical-align:bottom; /* safari: for overlap */ - zoom:1; -} - -.yui-navset-left .yui-nav li a, .yui-navset-right .yui-nav li a { - display:block; -} - -.yui-navset-bottom .yui-nav li a { - vertical-align:text-top; /* for inline overlap (reverse for Op border bug) */ -} - -.yui-navset .yui-nav li a em { display:block; } - -/* position left and right oriented tabs */ -.yui-navset-left .yui-nav, .yui-navset-right .yui-nav { position:absolute; z-index:1; } -.yui-navset-left .yui-nav { left:0; } -.yui-navset-right .yui-nav { right:0; } -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -/* first or middle sibling, no children */ -.ygtvtn { - width:18px; height:22px; - background: url(treeview-sprite.gif) 0 -5600px no-repeat; -} - -/* first or middle sibling, collapsable */ -.ygtvtm { - width:18px; height:22px; - cursor:pointer ; - background: url(treeview-sprite.gif) 0 -4000px no-repeat; -} - -/* first or middle sibling, collapsable, hover */ -.ygtvtmh { - width:18px; height:22px; - cursor:pointer ; - background: url(treeview-sprite.gif) 0 -4800px no-repeat; -} - -/* first or middle sibling, expandable */ -.ygtvtp { - width:18px; height:22px; - cursor:pointer ; - background: url(treeview-sprite.gif) 0 -6400px no-repeat; -} - -/* first or middle sibling, expandable, hover */ -.ygtvtph { - width:18px; height:22px; - cursor:pointer ; - background: url(treeview-sprite.gif) 0 -7200px no-repeat; -} - -/* last sibling, no children */ -.ygtvln { - width:18px; height:22px; - background: url(treeview-sprite.gif) 0 -1600px no-repeat; -} - -/* Last sibling, collapsable */ -.ygtvlm { - width:18px; height:22px; - cursor:pointer ; - background: url(treeview-sprite.gif) 0 0px no-repeat; -} - -/* Last sibling, collapsable, hover */ -.ygtvlmh { - width:18px; height:22px; - cursor:pointer ; - background: url(treeview-sprite.gif) 0 -800px no-repeat; -} - -/* Last sibling, expandable */ -.ygtvlp { - width:18px; height:22px; - cursor:pointer ; - background: url(treeview-sprite.gif) 0 -2400px no-repeat; -} - -/* Last sibling, expandable, hover */ -.ygtvlph { - width:18px; height:22px; cursor:pointer ; - background: url(treeview-sprite.gif) 0 -3200px no-repeat; -} - -/* Loading icon */ -.ygtvloading { - width:18px; height:22px; - background: url(treeview-loading.gif) 0 0 no-repeat; -} - -/* the style for the empty cells that are used for rendering the depth - * of the node */ -.ygtvdepthcell { - width:18px; height:22px; - background: url(treeview-sprite.gif) 0 -8000px no-repeat; -} - -.ygtvblankdepthcell { width:18px; height:22px; } - -/* the style of the div around each node */ -.ygtvitem { } - -/* the style of the div around each node's collection of children */ -.ygtvchildren { - *zoom: 1; -} - -/* the style of the text label in ygTextNode */ -.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { - margin-left:2px; - text-decoration: none; - background-color: white; -} - -.ygtvspacer { height: 22px; width: 18px; } -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvitem{}.ygtvchildren{*zoom:1;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;}.ygtvspacer{height:22px;width:18px;} -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -/* first or middle sibling, no children */ -.ygtvtn { - width:1em; height:20px; background:none -} - -/* first or middle sibling, collapsable */ -.ygtvtm { - width:1em; height:20px; - cursor:pointer ; - background: url(sprite-menu.gif) -8px 2px no-repeat; -} - -/* first or middle sibling, collapsable, hover */ -.ygtvtmh { - width:1em; height:20px; - cursor:pointer ; - background: url(sprite-menu.gif) -8px -77px no-repeat; -} - -/* first or middle sibling, expandable */ -.ygtvtp { - width:1em; height:20px; - cursor:pointer ; - background: url(sprite-menu.gif) -8px -315px no-repeat; -} - -/* first or middle sibling, expandable, hover */ -.ygtvtph { - width:1em; height:20px; - cursor:pointer ; - background: url(sprite-menu.gif) -8px -395px no-repeat; -} - -/* last sibling, no children */ -.ygtvln { - width:1em; height:20px; background:none -} - -/* Last sibling, collapsable */ -.ygtvlm { - width:1em; height:20px; - cursor:pointer ; - background: url(sprite-menu.gif) -8px 2px no-repeat; -} - -/* Last sibling, collapsable, hover */ -.ygtvlmh { - width:1em; height:20px; - cursor:pointer ; - background: url(sprite-menu.gif) -8px -77px no-repeat; -} - -/* Last sibling, expandable */ -.ygtvlp { - width:1em; height:20px; - cursor:pointer ; - background: url(sprite-menu.gif) -8px -315px no-repeat; -} - -/* Last sibling, expandable, hover */ -.ygtvlph { - width:1em; height:20px; cursor:pointer ; - background: url(sprite-menu.gif) -8px -395px no-repeat; -} - -/* Loading icon */ -.ygtvloading { - width:1em; height:20px; - background: url(treeview-loading.gif) 0 0 no-repeat; -} - -/* the style for the empty cells that are used for rendering the depth - * of the node */ -.ygtvdepthcell { width:1em; height:20px; background:none} - -.ygtvblankdepthcell { width:1em; height:20px; } - -/* the style of the div around each node */ -.ygtvitem { border: 0px solid grey; } - -/* the style of the div around each node's collection of children */ -.ygtvchildren { } -* html .ygtvchildren { height:2%; } - -/* the style of the text label in ygTextNode */ -.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { - margin-left:2px; - text-decoration: none; - background-color: white; /* workaround for IE font smoothing bug */ -} - -.ygtvspacer { height: 20px; width: 1em; } -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -/* first or middle sibling, no children */ -.ygtvtn { - width:18px; height:22px; - background: url(sprite-orig.gif) 0 -5600px no-repeat; -} - -/* first or middle sibling, collapsable */ -.ygtvtm { - width:18px; height:22px; - cursor:pointer ; - background: url(sprite-orig.gif) 0 -4000px no-repeat; -} - -/* first or middle sibling, collapsable, hover */ -.ygtvtmh { - width:18px; height:22px; - cursor:pointer ; - background: url(sprite-orig.gif) 0 -4800px no-repeat; -} - -/* first or middle sibling, expandable */ -.ygtvtp { - width:18px; height:22px; - cursor:pointer ; - background: url(sprite-orig.gif) 0 -6400px no-repeat; -} - -/* first or middle sibling, expandable, hover */ -.ygtvtph { - width:18px; height:22px; - cursor:pointer ; - background: url(sprite-orig.gif) 0 -7200px no-repeat; -} - -/* last sibling, no children */ -.ygtvln { - width:18px; height:22px; - background: url(sprite-orig.gif) 0 -1600px no-repeat; -} - -/* Last sibling, collapsable */ -.ygtvlm { - width:18px; height:22px; - cursor:pointer ; - background: url(sprite-orig.gif) 0 0px no-repeat; -} - -/* Last sibling, collapsable, hover */ -.ygtvlmh { - width:18px; height:22px; - cursor:pointer ; - background: url(sprite-orig.gif) 0 -800px no-repeat; -} - -/* Last sibling, expandable */ -.ygtvlp { - width:18px; height:22px; - cursor:pointer ; - background: url(sprite-orig.gif) 0 -2400px no-repeat; -} - -/* Last sibling, expandable, hover */ -.ygtvlph { - width:18px; height:22px; cursor:pointer ; - background: url(sprite-orig.gif) 0 -3200px no-repeat; -} - -/* Loading icon */ -.ygtvloading { - width:18px; height:22px; - background: url(treeview-loading.gif) 0 0 no-repeat; -} - -/* the style for the empty cells that are used for rendering the depth - * of the node */ -.ygtvdepthcell { - width:18px; height:22px; - background: url(sprite-orig.gif) 0 -8000px no-repeat; -} - -.ygtvblankdepthcell { width:18px; height:22px; } - -/* the style of the div around each node */ -.ygtvitem { } - -/* the style of the div around each node's collection of children */ -.ygtvchildren { } -* html .ygtvchildren { height:2%; } - -/* the style of the text label in ygTextNode */ -.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { - margin-left:2px; - text-decoration: none; - background-color: white; /* workaround for IE font smoothing bug */ -} - -.ygtvspacer { height: 22px; width: 18px; } -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ - -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ - -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ -.yui-log {padding-top:3em;} -/* -.yui-log-container {position:relative;width:60em} -.yui-log .yui-log-bd {height:auto; overflow:visible;} -*/ -.yui-log-container {width:40em} -.yui-log .yui-log-bd {height:60em} -.yui-log .yui-log-btns {display:none;} -.yui-log .yui-log-ft .yui-log-sourcefilters {visibility:hidden;} -.yui-log .yui-log-hd {display:none;} -.yui-log .yui-log-ft {position:absolute;top:0em;} - -.pass { - background-color: green; - font-weight: bold; - color: white; -} -.fail { - background-color: red; - font-weight: bold; - color: white; -} -.ignore { - background-color: #666; - font-weight: bold; - color: white; -} -/* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.3.1 -*/ - -/*2.2.0*/ -/*reset.css*/body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;} -/*fonts.css*/body{font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;} -/*grids.css*/body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.3em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;min-width:950px;}#doc3{margin:auto 10px;width:auto;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-g .yui-u,.yui-g .yui-g,.yui-gc .yui-u,.yui-gc .yui-g .yui-u,.yui-ge .yui-u,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u,.yui-gc .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u,.yui-gc .yui-u,.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-gf div.first{width:24%;}.yui-ge div.first{width:74.2%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;} - -/* main page */ -a:link { color: #00F; } -a:visited { color: #003399;} - -#doc3 #hd {margin-bottom:1em} -#doc3 #hd a { text-decoration: none; } -#doc3 #hd h1 { color: #545454; font:170%/50px arial Bold; padding: 8px 0 8px 70px; background: url(logo.gif) left center no-repeat; } -#doc3 #hd h3 { background: #947DB2; color: #FFF; font: 110%/1.22em arial; padding: 5px 10px; margin: 0 0 7px 0; } -#doc3 #hd h3 A { color: #FFF; text-decoration: none; } -#doc3 #hd .breadcrumbs { font-size: 85%; margin-bottom:10px;} -#doc3 #hd .subtitle {position: absolute; right:1em; padding: 0px;margin:0px} - -#doc3 dl { margin: 2px 0; } -#doc3 dd { margin-left: 20px; } -#doc3 .requires dt { font-style: italic; } -#doc3 .default { margin-top:6px; } -#doc3 .deprecated { margin-top:4px; padding:4px; background-color: #EFECCA } -#doc3 .deprecated strong { color:#441054; } -#doc3 code, pre {font-size:85%} - -/* -#doc3 .private { - display:none; -} - -#doc3 .protected { - display:none; -} -*/ - -#doc3 #classopts { float:right; margin:2px; padding: 2px; background-color:#cdc6d5;border: 1px solid #947db2;} - -/* undo reset.css styles for description block formatting */ -#doc3 .description ul { padding: 10px 0 10px 28px; font-size: 90%; list-style: disc} -#doc3 .description p { padding-bottom: 10px} -#doc3 .description strong { font-weight: bold;} -#doc3 .description em {padding: 2px; background-color: #EFECCA} -#doc3 pre { padding: 10px;} - -#doc3 .summary { margin: 0px 0 10px 0; padding:10px; border: 1px solid #cccccc; background-color: #eeeeee; } -#doc3 .extends {font-weight: normal; font-size: 90%} - -#doc3 .nav {min-height: 400px;} -#doc3 .nav .module {width:100%; background:#EEEEEE; margin: 0 0 15px 0; padding: 0; overflow:hidden} -#doc3 .nav .module h4 { padding: 3px 5px; border-bottom: #947DB2 1px solid; } -#doc3 .nav .module h4 A { color: #000; text-decoration: none; } -#doc3 .nav .module .content { padding: 2px; } -#doc3 .nav .module UL.content LI { font-size: 90%; } -#doc3 .nav .module UL.content A { text-decoration: none; } -#doc3 .nav .module LI { padding: 2px 4px 2px 4px; } -#doc3 .nav .module LI.selected { background: #CDC6D5; } - -#doc3 .section { margin: 0 0 16px 0; } -#doc3 .section strong { font-weight: bold;} -#doc3 .section hr { border: none 0; border-top: 1px solid #ccc; } -#doc3 .section h4 { font-size:110%;} -#doc3 .section h3 { background: #947DB2; width: 100%; color: #FFF; padding: 3px; margin: 0 0 7px 0; } -#doc3 .section h3 .top { font-size: 60%; font-weight: normal; width: 100%; font-family: verdana; padding-left: 20px; } -#doc3 .section h3 .top A { color: #FFF; text-decoration: none; } - -#doc3 .section.details .content { padding: 0 0 0 10px; } -#doc3 .section.details .description { padding: 10px 0 0 20px; } -#doc3 .section.details .description dt { font-weight: bold; } -#doc3 .section.details .description td { border:1px solid #ccc; margin:2px;padding:2px;} - -#doc3 .inheritance { padding:10px; background-color:#eeeeee } -#doc3 .inheritance h4 { font-size: 100%;} - -/* index page autocomplete */ -#propertysearch {;position:absolute;margin:1em;width:35em;}/* set width of widget here*/ -#searchinput {position:absolute;width:100%;height:1.4em;} -#searchresults {position:absolute;top:1.7em;width:100%;} -#searchresults .yui-ac-content {position:absolute;top:4px; left:0px; width:100%;height:20em;border:1px solid #aaa;background:#fff;overflow:auto;overflow-x:hidden;z-index:9050;} -#searchresults .yui-ac-shadow {position:absolute;margin:.3em;width:100%;background:#a0a0a0;z-index:9049;}: -#searchresults ul {padding:5px 0;width:100%;} -#searchresults li {padding:0 5px;cursor:default;white-space:nowrap;} -#searchresults li.yui-ac-highlight {background:#D1C6DA;} -#searchresults li em { position:absolute; width:44%; overflow:hidden; color:#654D6C;} -#searchresults li span { position:relative; left:46% } - -/* source code view */ -#srcout {min-width: 580px; } -*html #srcout { width: 100%; padding-bottom:1em; overflow-x:auto } - -.highlight .c { color: #60a0b0; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #007020; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #007020 } /* Comment.Preproc */ -.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #808080 } /* Generic.Output */ -.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0040D0 } /* Generic.Traceback */ -.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ -.highlight .kp { color: #007020 } /* Keyword.Pseudo */ -.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #007020; font-weight: bold } /* Keyword.Type */ -.highlight .m { color: #40a070 } /* Literal.Number */ -.highlight .s { color: #4070a0 } /* Literal.String */ -.highlight .na { color: #4070a0 } /* Name.Attribute */ -.highlight .nb { color: #007020 } /* Name.Builtin */ -.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ -.highlight .no { color: #60add5 } /* Name.Constant */ -.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ -.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #007020 } /* Name.Exception */ -.highlight .nf { color: #06287e } /* Name.Function */ -.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ -.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #bb60d5 } /* Name.Variable */ -.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ -.highlight .mf { color: #40a070 } /* Literal.Number.Float */ -.highlight .mh { color: #40a070 } /* Literal.Number.Hex */ -.highlight .mi { color: #40a070 } /* Literal.Number.Integer */ -.highlight .mo { color: #40a070 } /* Literal.Number.Oct */ -.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ -.highlight .sc { color: #4070a0 } /* Literal.String.Char */ -.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ -.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ -.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ -.highlight .sx { color: #c65d09 } /* Literal.String.Other */ -.highlight .sr { color: #235388 } /* Literal.String.Regex */ -.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ -.highlight .ss { color: #517918 } /* Literal.String.Symbol */ -.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ -.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ -.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ -.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */ - -/*Copyright (c) 2006,Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt */ -/*reset.css*/body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;} -/*fonts.css*/body{font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;} -/*grids.css*/body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.3em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;min-width:950px;}#doc3{margin:auto 10px;width:auto;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-g .yui-u,.yui-g .yui-g,.yui-gc .yui-u,.yui-gc .yui-g .yui-u,.yui-ge .yui-u,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u,.yui-gc .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u,.yui-gc .yui-u,.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-gf div.first{width:24%;}.yui-ge div.first{width:74.2%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;} - -.yui-picker-panel { - background: #222; -} - -.yui-picker-panel .hd { - background-color:#333366; - color:#FFF; - font-size:100%; - line-height:100%; - border:1px solid #222; - border-bottom:1px solid #000; - font-weight:bold; - overflow:hidden; - padding:4px; -} - -.yui-picker-panel .bd { - color: #fff; - background: #000; - margin: 1px; - height: 200px; -} - -.yui-picker-panel .ft { - color: #fff; - background: #000; - margin: 1px; - padding: 1px; - text-align: center; -} - -.yui-picker { - position: relative; -} - -.yui-picker-hue-thumb { cursor:default; width:18px; height:18px; -top: -8px; -left: -2px; - z-index: 9; position:absolute; } -.yui-picker-hue-bg {-moz-outline: none; outline:0px none; - position:absolute; left:200px; height:183px; width:14px; - background:url(hue_bg.png) no-repeat; - top:4px; - /* - border: 2px solid #666; - */ -} - -.yui-picker-bg { - -moz-outline: none; - outline:0px none; - position:absolute; - top:4px; - left:4px; - height:182px; - width:182px; - background-color:#F00; - background-image: url(picker_mask.png); - /* - border: 2px solid #666; - */ -} - -*html .yui-picker-bg { - background-image: none; - filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='picker_mask.png', sizingMethod='scale'); -} - - -.yui-picker-mask { position:absolute; z-index: 1; top:0px; left:0px; } - -.yui-picker-thumb { cursor:default; width:11px; height:11px; z-index: 9; position:absolute; - top:-4px; left:-4px; } - -.yui-picker-swatch { position:absolute; left:240px; top:4px; height:60px; - width:55px; border:1px solid #666; } -.yui-picker-websafe-swatch { position:absolute; left:304px; top:4px; - height:24px; width:24px; border:1px solid #666; } - -/* -#yui-picker-controls { text-align:right; position:absolute; top: 94px; left:236px; font:0.75em arial,helvetica,clean,sans-serif } -*/ -.yui-picker-controls { position:absolute; top: 72px; left:226px; font:1em monospace; } -.yui-picker-controls .bd { height: 100px; } -.yui-picker-controls ul {float:left;list-style:none;padding:0 2px 0 0;margin:0} -.yui-picker-controls li {padding:2px;margin:0} -.yui-picker-controls input { - font-size: 0.85em; - width: 2.4em; -} -.yui-picker-hex-controls { - clear: both; - padding: 2px; -} -.yui-picker-hex-controls input { - width: 4.6em; -} - - -/* -.yui-picker-controls dl ul {border: 1px solid yellow; float:left; list-style:none; padding:0 2px 0 0; margin:0} -.yui-picker-controls dt {height: 1.4em; padding: 2px; margin: 0;clear: both; float: left} -.yui-picker-controls dd {height: 1.4em; padding: 2px; margin:0; float: left} -*/ - - - -/*#yui-picker-controls li {padding:0;margin:0} */ -/* #yui-picker-controls input { font-size: .85em } */ - -.yui-picker a { - font: 1em arial,helvetica,clean,sans-serif; - text-align: center; - - display:block; - *display:inline-block; /* IE */ -padding: 0; - color: #fff; - -} - -.yui-picker-panel { - background: #e3e3e3; - border-color: #888; -} - -.yui-picker-panel .hd { - background-color:#ccc; - font-size:100%; - line-height:100%; - border:1px solid #e3e3e3; - font-weight:bold; - overflow:hidden; - padding: 6px; - color: #000; -} - -.yui-picker-panel .bd { - background: #e8e8e8; - margin: 1px; - height: 200px; -} - -.yui-picker-panel .ft { - background: #e8e8e8; - margin: 1px; - padding: 1px; - /* - text-align: center; - */ -} - -.yui-picker { - position: relative; -} - -.yui-picker-hue-thumb { cursor:default; width:18px; height:18px; -top: -8px; -left: -2px; - z-index: 9; position:absolute; } -.yui-picker-hue-bg {-moz-outline: none; outline:0px none; - position:absolute; left:200px; height:183px; width:14px; - background:url(hue_bg.png) no-repeat; - top:4px; -} - -.yui-picker-bg { - -moz-outline: none; - outline:0px none; - position:absolute; - top:4px; - left:4px; - height:182px; - width:182px; - background-color:#F00; - background-image: url(picker_mask.png); -} - -*html .yui-picker-bg { - background-image: none; - filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='picker_mask.png', sizingMethod='scale'); -} - - -.yui-picker-mask { position:absolute; z-index: 1; top:0px; left:0px; } - -.yui-picker-thumb { cursor:default; width:11px; height:11px; z-index: 9; position:absolute; - top:-4px; left:-4px; } - -.yui-picker-swatch { position:absolute; left:240px; top:4px; height:60px; - width:55px; border:1px solid #888; } -.yui-picker-websafe-swatch { position:absolute; left:304px; top:4px; - height:24px; width:24px; border:1px solid #888; } - -.yui-picker-controls { position:absolute; top: 72px; left:226px; font:1em monospace; } -.yui-picker-controls .hd { background: transparent; } -.yui-picker-controls .bd { height: 100px; } -.yui-picker-controls ul {float:left;list-style:none;padding:0 2px 0 0;margin:0} -.yui-picker-controls li {padding:2px;margin:0} -.yui-picker-controls input { - font-size: 0.85em; - width: 2.4em; -} -.yui-picker-hex-controls { - clear: both; - padding: 2px; -} -.yui-picker-hex-controls input { - width: 4.6em; -} - -.yui-picker-controls a { - font: 1em arial,helvetica,clean,sans-serif; - display:block; - *display:inline-block; /* IE */ - padding: 0; - color: #000; - -} -body { padding:0 } -a {color:#0000de;} -a:visited {color:#639} -a:active {color: #f00;} -p {color:#000; margin-bottom:1em } - -strong { font-weight:bold } -em { font-style:italic } - -#hd a#logo { display:block;margin:10px;width:378px; } -#hd a#logo div { background:url(../assets/yui.gif) no-repeat;height:34px; } -#hd h1 { font-weight:bold;text-indent:15px; background: url(http://us.i1.yimg.com/us.yimg.com/i/ydn/bg_hd.gif) 0 0 repeat-x #B6CDE1; border:1px solid #93B2CC; position:relative;font-size:110%;padding:5px 0;margin:0 auto;} -#hd { margin-bottom:10px; } - -#toc { background-color:#ecf5fa; padding:0; border:1px solid #89d;overflow:hidden;zoom:1} -#toc ul {list-style:none; margin:0; padding:0; font-size:90%;} -#toc ul li { height:100%;padding:0;margin:0;*margin:0 0 -3px;*zoom:1; } - -#toc ul li a { margin:0;display:block;padding:5px 2px 5px 5px; text-decoration:none; } -#toc ul li a:hover { color:#fff; background-color:#3c3cb7; } - -#toc ul li.selected { font-weight:bold; color:#fff; background:#666; padding:0; } -#toc ul li.selected a { color:#fff; } -#toc ul li.selected a:hover { font-weight:bold; color:#fff; background:#3c3cb7; } - -#toc ul li.child { background-color:#ddd } -#toc ul li.child a { margin:0;display:block; padding:5px 2px 5px 20px; text-decoration:none; } - -#toc ul li.active { font-weight:bold; color:#000; } -#toc ul li.active a { color:#000; } - -#toc ul li a.printer { padding:0;margin-right:2px;margin-top:-1.5em;display:none;float:right;height:12px;width:12px; } -#toc ul li.selected a.printer { display:block;background:url(http://us.i1.yimg.com/us.yimg.com/i/us/aut/pltfrm/ic/print_12.gif) no-repeat;cursor:pointer; } -#toc ul li.selected a.printer:hover { background:url(http://us.i1.yimg.com/us.yimg.com/i/us/aut/pltfrm/ic/print_12.gif) no-repeat;cursor:pointer; } - -#toc ul li em { display:none; } -#toc ul li.sect { font-weight:bold; color:#fff; background:#ccc; } -#toc ul li.sect a { color:#333 } -#toc ul li.sect a:hover { color:#fff } - -#bd { margin-left:15px; } -#bd .dp-highlighter { margin:10px 0 15px } -#bd h1 { line-height:1.2em; color:#E76300; font-size:120%; margin:0 0 12px;} -#bd h2 { line-height:1.2em; color:#E76300; font-size:110%; margin:0 0 10px;} - -#bd ul.properties { width:85%;margin:20px auto; } -#bd ul.properties li { margin:1em 0; } - -#stepnav { font-size:100%; margin:25px 0 0 15px } -#stepnav .back { margin-right:15px } - -#solution { margin-left:15px; } -#solution a { display:block;margin-top:7px;margin-bottom:20px } -#solution { zoom:1 } - -#ft { height:2px;line-height:2px;text-indent:15px; background:#B6CDE1;margin:10px auto;clear:both} - -#landing { margin-left:1em } -#landing h3 { font-size:105%;margin-bottom:.5em } -#landing p { margin-left:1em } - -.dp-highlighter { width:96% }#hd { - margin-bottom:2em; - border-bottom:1px solid #aaa; -} - -#bd { - margin-bottom:2em; -} - -#ft { - border-top:1px solid #aaa; - padding:1em; - text-align:center; - color:#888; -} - -#logo { - width:378px; height:28px; - margin:1em 0; -} - -#demo { - width:30em; - margin-bottom:2em; -} - -#demo .yui-content { - padding:1em; -} -#hd { - margin-bottom:2em; -} - -#bd { - margin-bottom:2em; -} - -#ft { - border-top:1px solid #aaa; - padding:1em; - text-align:center; - color:#888; -} - -#logo { - width:378px; height:28px; - margin:1em 0; -} - -#nav { - font-weight:bold; - text-indent:15px; - background:#B6CDE1; - border:1px solid #93B2CC; - padding:5px 0; - margin:0 auto; -} - -#nav h3 { - position:absolute; - left:-100000em; -} - -#nav li { - display:inline; - font-size:1em; - border-right:1px solid black; - margin-right:1em; - padding-right:1em; -} - -#nav li.last { - border-right:none; -} - -#nav li a { - text-decoration:none; - color:black; -} - -#nav li a:hover { - text-decoration:underline; -} - -h1 { - font-size:1.8em; - margin-bottom:1em; -} - -p { - margin-top:1em; margin-bottom:1em; - text-align:justify; - font-family:arial,helvetica,sans-serif; -}.yui-navset .yui-nav li a, -.yui-navset .yui-content { - border:1px solid #000; /* label and content borders */ -} - -.yui-navset .yui-nav .selected a, -.yui-navset .yui-nav a:hover, -.yui-navset .yui-content { - background-color:#f6f7ee; /* active tab, tab hover, and content bgcolor */ -} - -.yui-navset .yui-nav li em { padding:.5em; } /* tab padding */ - -/* defaults to orientation "top" */ -.yui-navset .yui-nav .selected a, -.yui-navset .yui-navset-top .yui-nav .selected a { - border-width:1px 1px 0; /* no bottom border for active tab */ - padding:0 0 1px; /* to match height of other tabs */ -} -.yui-navset .yui-content, -.yui-navset .yui-navset-top .yui-content { - margin:-1px 0 0; /* for active tab overlap */ -} - -/* overrides for other orientations */ -.yui-navset .yui-navset-bottom .yui-nav .selected a, -.yui-navset-bottom .yui-nav .selected a { - border-width:0 1px 1px; /* no top border for active tab */ - padding:1px 0 0; /* to match height of other tabs */ -} -.yui-navset .yui-navset-bottom .yui-content, -.yui-navset-bottom .yui-content { - margin:0 0 -1px; /* for active tab overlap */ -} -.yui-navset .yui-navset-left .yui-nav li.selected a, -.yui-navset-left .yui-nav li.selected a { - border-width:1px 0 1px 1px; /* no right border for active tab */ - padding:0 1px 0 0; /* to match width of other tabs */ -} -.yui-navset .yui-navset-left .yui-content, -.yui-navset-left .yui-content { - margin:0 0 0 -1px; /* for active tab overlap */ -} -.yui-navset .yui-navset-right .yui-nav li.selected a, -.yui-navset-right .yui-nav li.selected a { - border-width:1px 1px 1px 0; /* no left border for active tab */ - padding:0 0 0 1px; /* to match width of other tabs */ -} - -.yui-navset-right .yui-content { - margin:0 -1px 0 0; /* for active tab overlap */ -} -.yui-sam-skin .yui-navset .yui-nav li { - margin-right:0.16em; /* space between tabs */ - padding-top:1px; /* gecko: make room for overflow */ - zoom:1; -} - -.yui-sam-skin .yui-navset .yui-nav .selected { - margin-bottom:-1px; /* for overlap */ -} - -.yui-sam-skin .yui-navset .yui-nav a { - background:#dadbdb url(../../assets/skins/sam/sprite.png) repeat-x; /* tab background */ - border:solid #a3a3a3; - border-width:0 1px; - color:#000; - text-decoration:none; -} - -.yui-sam-skin .yui-navset .yui-nav a em { - border-top:solid 1px #a3a3a3; - border-bottom:0; - cursor:hand; - padding:0.2em .75em; - top:-1px; /* for 1px rounded corners */ - position:relative; -} - -.yui-sam-skin .yui-navset .yui-nav .selected a, -.yui-sam-skin .yui-navset .yui-nav a:focus, -.yui-sam-skin .yui-navset .yui-nav a:hover { - background:#214197 url(../../assets/skins/sam/sprite.png) repeat-x left -1400px; /* selected tab background */ - color:#fff; -} - -.yui-sam-skin .yui-navset .yui-nav .selected a em { - padding:0.3em 0.75em; /* raise selected tab */ -} - -.yui-sam-skin .yui-navset .yui-nav .selected a, -.yui-sam-skin .yui-navset .yui-nav a:hover, -.yui-sam-skin .yui-navset .yui-nav a:focus, -.yui-sam-skin .yui-navset .yui-nav a:hover em, -.yui-sam-skin .yui-navset .yui-nav a:focus em, -.yui-sam-skin .yui-navset .yui-nav .selected a em { - border-color:#243356; /* selected tab border color */ -} - -.yui-sam-skin .yui-navset .yui-nav { - border-bottom:1px solid #243356; /* tab list bottom border */ - position:relative; - zoom:1; -} - -.yui-sam-skin .yui-navset .yui-content { - background:#edf5ff; /* content background color */ - border-top:5px solid #214095; /* color between tab list and content */ -} - -.yui-sam-skin .yui-navset .yui-content div { - border:1px solid #808080; /* content border */ - border-top-color:#243356; /* different top border color */ - padding:0.25em 0.5em; /* content padding */ -} - -.yui-sam-skin .yui-navset .yui-content div div { /* kill inheritance */ - border:0; - padding:0; -} -/* resets */ - -.yui-navset .yui-nav ul, -.yui-navset .yui-nav ul li { - margin:0; - padding:0; -} - -/* default space between tabs */ -.yui-navset .yui-nav li, -.yui-navset .yui-navset-top .yui-nav li, -.yui-navset .yui-navset-bottom .yui-nav li { - margin:0 0.5em 0 0; /* horizontal tabs */ -} -.yui-navset-left .yui-nav li, -.yui-navset-right .yui-nav li { - margin:0 0 0.5em; /* vertical tabs */ -} - -/* default width for side tabs */ -.yui-navset .yui-navset-left .yui-nav, -.yui-navset .yui-navset-right .yui-nav, -.yui-navset-left .yui-nav, -.yui-navset-right .yui-nav { width:6em; } -.yui-navset-top .yui-nav, -.yui-navset-bottom .yui-nav { - width:auto; -} -.yui-navset .yui-navset-left, -.yui-navset-left { padding:0 0 0 6em; } /* map to nav width */ -.yui-navset-right { padding:0 6em 0 0; } /* ditto */ - -.yui-navset-top, -.yui-navset-bottom { - padding:auto; -} -/* core */ - -.yui-nav, -.yui-nav li { - margin:0; - padding:0; - list-style:none; -} -.yui-navset li em { font-style:normal; } - -.yui-navset { - position:relative; /* contain absolute positioned tabs (left/right) */ - zoom:1; -} - -.yui-navset .yui-content { zoom:1; } - -.yui-navset .yui-nav li, -.yui-navset .yui-navset-top .yui-nav li, /* in case nested */ -.yui-navset .yui-navset-bottom .yui-nav li { - display:inline-block; - display:-moz-inline-stack; - *display:inline; /* IE */ - vertical-align:bottom; /* safari: for overlap */ - cursor:pointer; /* gecko: due to -moz-inline-stack on anchor */ - zoom:1; /* IE: kill space between horizontal tabs */ -} - -.yui-navset-left .yui-nav li, -.yui-navset-right .yui-nav li { - display:block; -} - -.yui-navset .yui-nav a { - outline:0; /* gecko: keep from shifting */ -} - -.yui-navset .yui-nav a { position:relative; } /* IE: to allow overlap */ - -.yui-navset .yui-nav li a, -.yui-navset-top .yui-nav li a, -.yui-navset-bottom .yui-nav li a { - display:block; - display:inline-block; - vertical-align:bottom; /* safari: for overlap */ - zoom:1; -} - -.yui-navset-left .yui-nav li a, -.yui-navset-right .yui-nav li a { - display:block; -} - -.yui-navset-bottom .yui-nav li a { - vertical-align:text-top; /* for inline overlap (reverse for Opera border bug) */ -} - -.yui-navset .yui-nav li a em, -.yui-navset-top .yui-nav li a em, -.yui-navset-bottom .yui-nav li a em { display:block; } - -/* position left and right oriented tabs */ -.yui-navset .yui-navset-left .yui-nav, -.yui-navset .yui-navset-right .yui-nav, -.yui-navset-left .yui-nav, -.yui-navset-right .yui-nav { - position:absolute; - z-index:1; -} - -.yui-navset-top .yui-nav, -.yui-navset-bottom .yui-nav { - position:static; -} -.yui-navset .yui-navset-left .yui-nav, -.yui-navset-left .yui-nav { left:0; right:auto; } - -.yui-navset .yui-navset-right .yui-nav, -.yui-navset-right .yui-nav { right:0; left:auto; } -/* default space between tabs */ -.yui-navset .yui-nav li, -.yui-navset .yui-navset-top .yui-nav li, -.yui-navset .yui-navset-bottom .yui-nav li { - margin:0 0.5em 0 0; /* horizontal tabs */ -} -.yui-navset-left .yui-nav li, -.yui-navset-right .yui-nav li { - margin:0 0 0.5em; /* vertical tabs */ -} - -/* default width for side tabs */ -.yui-navset .yui-navset-left .yui-nav, -.yui-navset .yui-navset-right .yui-nav, -.yui-navset-left .yui-nav, -.yui-navset-right .yui-nav { width:6em; } -.yui-navset-top .yui-nav, -.yui-navset-bottom .yui-nav { - width:auto; -} -.yui-navset .yui-navset-left, -.yui-navset-left { padding:0 0 0 6em; } /* map to nav width */ -.yui-navset-right { padding:0 6em 0 0; } /* ditto */ - -.yui-navset-top, -.yui-navset-bottom { - padding:auto; -} -/* core */ - -.yui-nav, -.yui-nav li { - margin:0; - padding:0; - list-style:none; -} -.yui-navset li em { font-style:normal; } - -.yui-navset { - position:relative; /* contain absolute positioned tabs (left/right) */ - zoom:1; -} - -.yui-navset .yui-content { zoom:1; } - -.yui-navset .yui-nav li, -.yui-navset .yui-navset-top .yui-nav li, /* in case nested */ -.yui-navset .yui-navset-bottom .yui-nav li { - display:inline-block; - display:-moz-inline-stack; - *display:inline; /* IE */ - vertical-align:bottom; /* safari: for overlap */ - cursor:pointer; /* gecko: due to -moz-inline-stack on anchor */ - zoom:1; /* IE: kill space between horizontal tabs */ -} - -.yui-navset-left .yui-nav li, -.yui-navset-right .yui-nav li { - display:block; -} - -.yui-navset .yui-nav a { - outline:0; /* gecko: keep from shifting */ -} - -.yui-navset .yui-nav a { position:relative; } /* IE: to allow overlap */ - -.yui-navset .yui-nav li a, -.yui-navset-top .yui-nav li a, -.yui-navset-bottom .yui-nav li a { - display:block; - display:inline-block; - vertical-align:bottom; /* safari: for overlap */ - zoom:1; -} - -.yui-navset-left .yui-nav li a, -.yui-navset-right .yui-nav li a { - display:block; -} - -.yui-navset-bottom .yui-nav li a { - vertical-align:text-top; /* for inline overlap (reverse for Opera border bug) */ -} - -.yui-navset .yui-nav li a em, -.yui-navset-top .yui-nav li a em, -.yui-navset-bottom .yui-nav li a em { display:block; } - -/* position left and right oriented tabs */ -.yui-navset .yui-navset-left .yui-nav, -.yui-navset .yui-navset-right .yui-nav, -.yui-navset-left .yui-nav, -.yui-navset-right .yui-nav { - position:absolute; - z-index:1; -} - -.yui-navset-top .yui-nav, -.yui-navset-bottom .yui-nav { - position:static; -} -.yui-navset .yui-navset-left .yui-nav, -.yui-navset-left .yui-nav { left:0; right:auto; } - -.yui-navset .yui-navset-right .yui-nav, -.yui-navset-right .yui-nav { right:0; left:auto; } -.ygtvspacer { height: 10px; width: 18px; } .ygtvcheck0 { background: url(../../img/check/check0.gif) 0 0 no-repeat; width:16px; height:22px; cursor:pointer } .ygtvcheck1 { background: url(../../img/check/check1.gif) 0 0 no-repeat; width:16px; height:22px; cursor:pointer } .ygtvcheck2 { background: url(../../img/check/check2.gif) 0 0 no-repeat; width:16px; height:22px; cursor:pointer } /************* CSS for dp.SyntaxHighlighter ***************************/ /* Main style for the table */ .dp-highlighter { width: 95%; overflow: auto; line-height: 100% !important; margin: 0px 0px 10px 0px; } .dp-highlighter table { width: 100%; margin: 0px 0px 2px 0px; border-collapse: collapse; border-bottom: 2px solid #eee; background-color:#fff; } .dp-highlighter tbody.hide { display: none; } .dp-highlighter tbody.show { display: table-row-group; _display: block; } .dp-highlighter td { font-family: Courier New; font-size: 12px; } /* Styles for the tools */ .dp-highlighter .tools-corner { background-color: #eee; font-size: 9px; } .dp-highlighter .tools { background-color: #eee; padding: 3px 8px 3px 10px; border-bottom: 1px solid gray; font: 11px Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; } .dp-highlighter .tools-corner { background-color: #eee; } .dp-highlighter .tools a { font-size: 9px; color: #aaaaaa; text-decoration: none; } .dp-highlighter .tools a:hover { color: red; text-decoration: underline; } /* Gutter with line number */ .dp-highlighter .gutter { padding-right: 5px; padding-left: 10px; width: 5px; background-color: #eee; border-right: 1px solid #cccccc; color: gray; text-align: right; vertical-align: top; } /* Single line style */ .dp-highlighter .line1, .line2 { padding-left: 10px; /* border-bottom: 1px solid #F7F7F7; */ white-space:nowrap; } .dp-highlighter .line2 { /* background-color: #F7F7F7; */ } .dp-xml {} .dp-xml .cdata { color: #ff1493; } .dp-xml .comments { color: green; } .dp-xml .tag { color: blue; } .dp-xml .tag-name { color: black; font-weight: bold; } .dp-xml .attribute { color: red; } .dp-xml .attribute-value { color: blue; } .dp-c {} .dp-c .comment { color: green; } .dp-c .string { color: blue; } .dp-c .preprocessor { color: gray; } .dp-c .keyword { color: blue; } .dp-c .vars { color: #d00; } /* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */ - -/* first or middle sibling, no children */ -.ygtvtn { - width:16px; height:22px; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/tn.gif) 0 0 no-repeat; -} - -/* first or middle sibling, collapsable */ -.ygtvtm { - width:16px; height:22px; - cursor:pointer ; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/tm.gif) 0 0 no-repeat; -} - -/* first or middle sibling, collapsable, hover */ -.ygtvtmh { - width:16px; height:22px; - cursor:pointer ; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/tmh.gif) 0 0 no-repeat; -} - -/* first or middle sibling, expandable */ -.ygtvtp { - width:16px; height:22px; - cursor:pointer ; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/tp.gif) 0 0 no-repeat; -} - -/* first or middle sibling, expandable, hover */ -.ygtvtph { - width:16px; height:22px; - cursor:pointer ; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/tph.gif) 0 0 no-repeat; -} - -/* last sibling, no children */ -.ygtvln { - width:16px; height:22px; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/ln.gif) 0 0 no-repeat; -} - -/* Last sibling, collapsable */ -.ygtvlm { - width:16px; height:22px; - cursor:pointer ; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/lm.gif) 0 0 no-repeat; -} - -/* Last sibling, collapsable, hover */ -.ygtvlmh { - width:16px; height:22px; - cursor:pointer ; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/lmh.gif) 0 0 no-repeat; -} - -/* Last sibling, expandable */ -.ygtvlp { - width:16px; height:22px; - cursor:pointer ; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/lp.gif) 0 0 no-repeat; -} - -/* Last sibling, expandable, hover */ -.ygtvlph { - width:16px; height:22px; cursor:pointer ; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/lph.gif) 0 0 no-repeat; -} - -/* Loading icon */ -.ygtvloading { - width:16px; height:22px; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/loading.gif) 0 0 no-repeat; -} - -/* the style for the empty cells that are used for rendering the depth - * of the node */ -.ygtvdepthcell { - width:16px; height:22px; - background: url(../../../../../../../i/us/nt/widg/tree/dflt/vline.gif) 0 0 no-repeat; -} - -.ygtvblankdepthcell { width:16px; height:22px; } - -/* the style of the div around each node */ -.ygtvitem { } - -/* the style of the div around each node's collection of children */ -.ygtvchildren { } -* html .ygtvchildren { height:2%; } - -/* the style of the text label in ygTextNode */ -.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { - margin-left:2px; - text-decoration: none; -} - -.ygtvspacer { height: 10px; width: 10px; margin: 2px; } -/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */ - -/* first or middle sibling, no children */ -.ygtvtn { - width:16px; height:22px; - background: url(../../img/default/tn.gif) 0 0 no-repeat; -} - -/* first or middle sibling, collapsable */ -.ygtvtm { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/tm.gif) 0 0 no-repeat; -} - -/* first or middle sibling, collapsable, hover */ -.ygtvtmh { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/tmh.gif) 0 0 no-repeat; -} - -/* first or middle sibling, expandable */ -.ygtvtp { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/tp.gif) 0 0 no-repeat; -} - -/* first or middle sibling, expandable, hover */ -.ygtvtph { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/tph.gif) 0 0 no-repeat; -} - -/* last sibling, no children */ -.ygtvln { - width:16px; height:22px; - background: url(../../img/default/ln.gif) 0 0 no-repeat; -} - -/* Last sibling, collapsable */ -.ygtvlm { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/lm.gif) 0 0 no-repeat; -} - -/* Last sibling, collapsable, hover */ -.ygtvlmh { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/lmh.gif) 0 0 no-repeat; -} - -/* Last sibling, expandable */ -.ygtvlp { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/lp.gif) 0 0 no-repeat; -} - -/* Last sibling, expandable, hover */ -.ygtvlph { - width:16px; height:22px; cursor:pointer ; - background: url(../../img/default/lph.gif) 0 0 no-repeat; -} - -/* Loading icon */ -.ygtvloading { - width:16px; height:22px; - background: url(../../img/default/loading.gif) 0 0 no-repeat; -} - -/* the style for the empty cells that are used for rendering the depth - * of the node */ -.ygtvdepthcell { - width:16px; height:22px; - background: url(../../img/default/vline.gif) 0 0 no-repeat; -} - -.ygtvblankdepthcell { width:16px; height:22px; } - -/* the style of the div around each node */ -.ygtvitem { } - -/* the style of the div around each node's collection of children */ -.ygtvchildren { } -* html .ygtvchildren { height:2%; } - -/* the style of the text label in ygTextNode */ -.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { - margin-left:2px; - text-decoration: none; -} - -.ygtvspacer { height: 10px; width: 10px; margin: 2px; } -/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */ - -/* first or middle sibling, no children */ -.ygtvtn { background: url(../../img/folders/tn.gif) 0 0 no-repeat; width:17px; height:22px; } - -/* first or middle sibling, collapsable */ -.ygtvtm { background: url(../../img/folders/tm.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } - -/* first or middle sibling, collapsable, hover */ -.ygtvtmh { background: url(../../img/folders/tmh.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } - -/* first or middle sibling, expandable */ -.ygtvtp { background: url(../../img/folders/tp.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } - -/* first or middle sibling, expandable, hover */ -.ygtvtph { background: url(../../img/folders/tph.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } - -/* last sibling, no children */ -.ygtvln { background: url(../../img/folders/ln.gif) 0 0 no-repeat; width:17px; height:22px; } - -/* Last sibling, collapsable */ -.ygtvlm { background: url(../../img/folders/lm.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } - -/* Last sibling, collapsable, hover */ -.ygtvlmh { background: url(../../img/folders/lmh.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } - -/* Last sibling, expandable */ -.ygtvlp { background: url(../../img/folders/lp.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } - -/* Last sibling, expandable, hover */ -.ygtvlph { background: url(../../img/folders/lph.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } - -/* Loading icon */ -.ygtvloading { background: url(../../img/folders/loading.gif) 0 0 no-repeat; width:16px; height:22px; } - -/* the style for the empty cells that are used for rendering the depth - * of the node */ -.ygtvdepthcell { background: url(../../img/folders/vline.gif) 0 0 no-repeat; width:17px; height:22px; } - -.ygtvblankdepthcell { width:17px; height:22px; } - -/* the style of the div around each node */ -.ygtvitem { } - -/* the style of the div around each node's collection of children */ -.ygtvchildren { } -* html .ygtvchildren { height:1%; } - -/* the style of the text label in ygTextNode */ -.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { - margin-left:2px; - text-decoration: none; -} - - -/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */ - -/* first or middle sibling, no children */ -.ygtvtn { - width:16px; height:22px; - background: url(../../img/default/tn.gif) 0 0 no-repeat; -} - -/* first or middle sibling, collapsable */ -.ygtvtm { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/tm.gif) 0 0 no-repeat; -} - -/* first or middle sibling, collapsable, hover */ -.ygtvtmh { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/tmh.gif) 0 0 no-repeat; -} - -/* first or middle sibling, expandable */ -.ygtvtp { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/tp.gif) 0 0 no-repeat; -} - -/* first or middle sibling, expandable, hover */ -.ygtvtph { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/tph.gif) 0 0 no-repeat; -} - -/* last sibling, no children */ -.ygtvln { - width:16px; height:22px; - background: url(../../img/default/ln.gif) 0 0 no-repeat; -} - -/* Last sibling, collapsable */ -.ygtvlm { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/lm.gif) 0 0 no-repeat; -} - -/* Last sibling, collapsable, hover */ -.ygtvlmh { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/lmh.gif) 0 0 no-repeat; -} - -/* Last sibling, expandable */ -.ygtvlp { - width:16px; height:22px; - cursor:pointer ; - background: url(../../img/default/lp.gif) 0 0 no-repeat; -} - -/* Last sibling, expandable, hover */ -.ygtvlph { - width:16px; height:22px; cursor:pointer ; - background: url(../../img/default/lph.gif) 0 0 no-repeat; -} - -/* Loading icon */ -.ygtvloading { - width:16px; height:22px; - background: url(../../img/default/loading.gif) 0 0 no-repeat; -} - -/* the style for the empty cells that are used for rendering the depth - * of the node */ -.ygtvdepthcell { - width:16px; height:22px; - background: url(../../img/default/vline.gif) 0 0 no-repeat; -} - -.ygtvblankdepthcell { width:16px; height:22px; } - -/* the style of the div around each node */ -.ygtvitem { } - -/* the style of the div around each node's collection of children */ -.ygtvchildren { } -* html .ygtvchildren { height:2%; } - -/* the style of the text label in ygTextNode */ -.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { - margin-left:2px; - text-decoration: none; - background-color: white; -} - -.ygtvspacer { height: 22px; width: 16px; } -/* first or middle sibling, no children */ -.ygtvtn { background: transparent; width:1em; height:20px; } - -/* first or middle sibling, collapsable */ -.ygtvtm { background: url(../../img/menu/collapse.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } - -/* first or middle sibling, collapsable, hover */ -.ygtvtmh { background: url(../../img/menu/collapseh.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } - -/* first or middle sibling, expandable */ -.ygtvtp { background: url(../../img/menu/expand.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } - -/* first or middle sibling, expandable, hover */ -.ygtvtph { background: url(../../img/menu/expandh.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } - -/* last sibling, no children */ -.ygtvln { background: transparent; width:1em; height:20px; } - -/* Last sibling, collapsable */ -.ygtvlm { background: url(../../img/menu/collapse.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } - -/* Last sibling, collapsable, hover */ -.ygtvlmh { background: url(../../img/menu/collapseh.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } - -/* Last sibling, expandable */ -.ygtvlp { background: url(../../img/menu/expand.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } - -/* Last sibling, expandable, hover */ -.ygtvlph { background: url(../../img/menu/expandh.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } - -/* Loading icon */ -.ygtvloading { background: url(../../img/menu/loading.gif) 0 6px no-repeat; width:1em; height:22px; } - -/* the style for the empty cells that are used for rendering the depth - * of the node */ -.ygtvdepthcell { background: transparent; width:1em; height:20px; } - -.ygtvblankdepthcell { background: transparent; width:1em; height:20px; } - -/* the style of the div around each node */ -.ygtvitem { border: 0px solid grey; } - -/* the style of the div around each node's collection of children */ -.ygtvchildren { } -* html .ygtvchildren { height:1%; } - -/* the style of the text label in ygTextNode */ -.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { - /* - margin-left:2px; - text-decoration: none; - */ - font-size: 12px; -} - - -/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */ - -/* Defaults */ -.ygtvtn { width:16px; height:22px; background: url(../../img/default/tn.gif) 0 0 no-repeat; } -.ygtvtm { width:16px; height:22px; cursor:pointer ; background: url(../../img/default/tm.gif) 0 0 no-repeat; } -.ygtvtmh { width:16px; height:22px; cursor:pointer ; background: url(../../img/default/tmh.gif) 0 0 no-repeat; } -.ygtvtp { width:16px; height:22px; cursor:pointer ; background: url(../../img/default/tp.gif) 0 0 no-repeat; } -.ygtvtph { width:16px; height:22px; cursor:pointer ; background: url(../../img/default/tph.gif) 0 0 no-repeat; } -.ygtvln { width:16px; height:22px; background: url(../../img/default/ln.gif) 0 0 no-repeat; } -.ygtvlm { width:16px; height:22px; cursor:pointer ; background: url(../../img/default/lm.gif) 0 0 no-repeat; } -.ygtvlmh { width:16px; height:22px; cursor:pointer ; background: url(../../img/default/lmh.gif) 0 0 no-repeat; } -.ygtvlp { width:16px; height:22px; cursor:pointer ; background: url(../../img/default/lp.gif) 0 0 no-repeat; } -.ygtvlph { width:16px; height:22px; cursor:pointer ; background: url(../../img/default/lph.gif) 0 0 no-repeat; } -.ygtvloading { width:16px; height:22px; background: url(../../img/default/loading.gif) 0 0 no-repeat; } -.ygtvdepthcell { width:16px; height:22px; background: url(../../img/default/vline.gif) 0 0 no-repeat; } -.ygtvblankdepthcell { width:16px; height:22px; } -.ygtvitem { } -.ygtvchildren { } -* html .ygtvchildren { height:2%; } -.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { - margin-left:2px; - text-decoration: none; - background-color: white; -} -.ygtvspacer { height: 10px; width: 10px; margin: 2px; } - -/* via ID selector */ -#tree2 .ygtvtn { background: url(../../img/folders/tn.gif) 0 0 no-repeat; width:17px; height:22px; } -#tree2 .ygtvtm { background: url(../../img/folders/tm.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } -#tree2 .ygtvtmh { background: url(../../img/folders/tmh.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } -#tree2 .ygtvtp { background: url(../../img/folders/tp.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } -#tree2 .ygtvtph { background: url(../../img/folders/tph.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } -#tree2 .ygtvln { background: url(../../img/folders/ln.gif) 0 0 no-repeat; width:17px; height:22px; } -#tree2 .ygtvlm { background: url(../../img/folders/lm.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } -#tree2 .ygtvlmh { background: url(../../img/folders/lmh.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } -#tree2 .ygtvlp { background: url(../../img/folders/lp.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } -#tree2 .ygtvlph { background: url(../../img/folders/lph.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer } -#tree2 .ygtvloading { background: url(../../img/folders/loading.gif) 0 0 no-repeat; width:16px; height:22px; } -#tree2 .ygtvdepthcell { background: url(../../img/folders/vline.gif) 0 0 no-repeat; width:17px; height:22px; } -#tree2 .ygtvblankdepthcell { width:17px; height:22px; } -#tree2 .ygtvitem { } -#tree2 .ygtvchildren { } -* html .ygtvchildren { height:1%; } -#tree2 .ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { - margin-left:2px; - text-decoration: none; -} - -/* via css class selector */ -.treemenu .ygtvtn {background: transparent; width:1em; height:20px; } -.treemenu .ygtvtm { background: url(../../img/menu/collapse.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } -.treemenu .ygtvtmh { background: url(../../img/menu/collapseh.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } -.treemenu .ygtvtp { background: url(../../img/menu/expand.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } -.treemenu .ygtvtph { background: url(../../img/menu/expandh.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } -.treemenu .ygtvln { background: transparent; width:1em; height:20px; } -.treemenu .ygtvlm { background: url(../../img/menu/collapse.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } -.treemenu .ygtvlmh { background: url(../../img/menu/collapseh.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } -.treemenu .ygtvlp { background: url(../../img/menu/expand.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } -.treemenu .ygtvlph { background: url(../../img/menu/expandh.gif) 0 6px no-repeat; width:1em; height:22px; cursor:pointer } -.treemenu .ygtvloading { background: url(../../img/menu/loading.gif) 0 6px no-repeat; width:1em; height:22px; } -.treemenu .ygtvdepthcell { background: transparent; width:1em; height:20px; } -.treemenu .ygtvblankdepthcell {background: transparent; width:1em; height:20px; } -.treemenu .ygtvitem { border: 0px solid grey; } -.treemenu .ygtvchildren { } -.treemenu .ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { - font-size: 12px; -} - -html, body { padding: 0px 0px 10px 0px; border: 0; margin: 0; } body { font: normal 11px verdana, sans-serif; color: #333; line-height: 19px; margin: 0; } #container { clear: both; text-align: left; padding: 0 0; margin: 0 0; } #containerTop { height:48px; } #pad { padding: 0px 20px 0px 20px; } a { text-decoration: underline; color: #46546C; } a:hover { text-decoration: underline; color: #4d77c3; } h1, h2, h3, h4, h5, h6 { font-family: palatino, georgia, "Times New Roman", serif; } h2 { font-size:16px; font-weight: bold; margin: 0 0 11px 0; } .border_2px { border: 1px solid #D8D8D8; padding: 2px; background: #fff; } .border_5px { border: 1px solid #D8D8D8; padding: 5px; background: #fff; margin: 0 0 4px 0; } img { padding: 0; margin: 0; border: 0; } form { padding: 0; margin: 0; } .input { width: 85px; font-size: 9px; } .submit { font-size: 9px; } #pageTitle { position:absolute;top:10px;left:90px; } #pageTitle H3 { font-size:14pt; color:#666666 } #header h1 { float:left; margin-top: 19px; margin-left: 50px; } #header h1 a { display: block; height: 19px; text-decoration: none; } #header { height: 60px; border: 0px solid #CFFB00; margin-bottom:0px; } #header h4 { position: relative; float: right; font-size:11px; letter-spacing: 1px; top: 10px; right: 30px; line-height: 15px; padding: 0 0 0 13px; margin: 0px; } #content { float: left;width: 620px; min-width: 500px; min-height:400px; padding:10px 0px; border: 0px solid #C13B00; margin-left: 50px; top:0px; } #content h1 { font-size:18px; margin:0px; } .newsItem { padding-bottom:25px; margin-bottom:25px; overflow: hidden; } .newsItem h3 { font-size:18px; margin:0px; } .newsItem h3 a { text-decoration:none; color:#6A7981; } .newsItem h3 a:hover { text-decoration:underline; color:#000; } .newsItemFooter, .newsItemFooter a { font-size:9px; color:#999; font-weight:normal; } .newsItemFooter a:hover { color:#222; } #footer { padding: 0px 0px 20px 0px; clear: both; color: #999; border-top:0px #CCC solid; margin:0px 26px 0px 30px } #footer a { color: #999; } #footer a:hover { color: #222; } #footerContainer { clear: both; } #rightbar { float: right; padding: 5px 5px 5px 5px; width: 284px; /* for IE5-Win */ width: 280px; border: 1px solid #333333; position:relative; right:48px; top:0px; background-color:#eeeeee; } #rightbar h2, #rightbar h3 { font-size:12px; text-align:center; color:#FFF; border-bottom:#848B8F solid 1px; border-right:#949B9F solid 1px; border-top:#eee solid 1px; padding:1px; margin:0px 0px 0px 0px; background-color:#383e45; width:100%; } #rightbar h2 a, #rightbar h3 a { font-size:12px; color:#FFF; text-decoration:none; display:block; } #rightBarPad { margin:0px; } #sidenav { margin: 0px 0; border-bottom: 1px solid #ddd; } #sidenav ul { margin: 0; padding: 0; border: 0; } #sidenav ul li { list-style: none; list-style-image: none !important; margin: 0; padding:0; } #sidenav ul li a { text-decoration: none; padding: 5px 0px 5px 0px; color: #4C5250; display: block; width: 187px; font-size: 11px !important; font-weight: bold; border-top: 1px solid #ddd; border-bottom: 1px solid #aaa; border-left: 1px solid #C7CBD0; text-shadow: -2px -2px 0px #FFF; } #sidenav ul li a:hover { /* background: url(../img/navHover2.png) top no-repeat; */ border-top: 1px solid #A1AAAF; border-bottom: 1px solid #CCC; border-right: 0px solid #C3C7CA; border-left: 1px solid #C3C7CA; text-shadow: 4px 4px 0px #C3C7CA; } .ylogo { position:absolute;top:5px;left:5px } \ No newline at end of file diff --git a/test/scanners/debug/class.expected.raydebug b/test/scanners/debug/class.expected.raydebug deleted file mode 100644 index a53cdd6..0000000 --- a/test/scanners/debug/class.expected.raydebug +++ /dev/null @@ -1,15 +0,0 @@ -37,38c37,38 -< reserved(for) ident(input) reserved(in) constant(Dir)operator([)stringdelimiter(")>operator(]) -< ident(name) operator(=) constant(File)operator(.)ident(basename)operator(()ident(input)operator(,) stringdelimiter(")>operator(\)) ---- -> reserved(for) ident(input) reserved(in) constant(Dir)operator([)stringdelimiter(")>operator(]) -> ident(name) operator(=) constant(File)operator(.)ident(basename)operator(()ident(input)operator(,) stringdelimiter(")>operator(\)) -49c49 -< ident(puts) stringdelimiter(")> ---- -> ident(puts) stringdelimiter(")> -69c69 -< !! Folder )inline operator(+) ident(name)delimiter(})>content( not found ---- -> !! Folder )inline operator(+) ident(name)inline_delimiter(})>content( not found -) \ No newline at end of file diff --git a/test/scanners/debug/class.in.raydebug b/test/scanners/debug/class.in.raydebug deleted file mode 100644 index 501c99f..0000000 --- a/test/scanners/debug/class.in.raydebug +++ /dev/null @@ -1,14 +0,0 @@ -37,38c37,38 -< reserved(for) ident(input) reserved(in) constant(Dir)operator([)stringdelimiter(")>operator(]) -< ident(name) operator(=) constant(File)operator(.)ident(basename)operator(()ident(input)operator(,) stringdelimiter(")>operator(\)) ---- -> reserved(for) ident(input) reserved(in) constant(Dir)operator([)stringdelimiter(")>operator(]) -> ident(name) operator(=) constant(File)operator(.)ident(basename)operator(()ident(input)operator(,) stringdelimiter(")>operator(\)) -49c49 -< ident(puts) stringdelimiter(")> ---- -> ident(puts) stringdelimiter(")> -69c69 -< !! Folder )inline operator(+) ident(name)delimiter(})>content( not found ---- -> !! Folder )inline operator(+) ident(name)inline_delimiter(})>content( not found diff --git a/test/scanners/debug/kate.expected.raydebug b/test/scanners/debug/kate.expected.raydebug deleted file mode 100644 index 01eec5a..0000000 --- a/test/scanners/debug/kate.expected.raydebug +++ /dev/null @@ -1,76 +0,0 @@ -preprocessor() -preprocessor() -tag( attribute_name(version)operator(=)string attribute_name(kateversion)operator(=)string attribute_name(section)operator(=)string attribute_name(extensions)operator(=)string attribute_name(mimetype)operator(=)stringtag(>) - tag() - tag(tag(>) - tag() plain(indexing )tag() - tag() plain(class )tag() - tag() plain(inherit )tag() - tag() plain(creation )tag() - tag() plain(feature )tag() - tag() plain(rename )tag() - tag() plain(redefine )tag() - tag() plain(undefine )tag() - tag() plain(select )tag() - tag() plain(export )tag() - tag() plain(local )tag() - tag() plain(deferred )tag() - tag() plain(do )tag() - tag() plain(is )tag() - tag() plain(once )tag() - tag() plain(alias )tag() - tag() plain(external )tag() - tag() plain(rescue )tag() - tag() plain(debug )tag() - tag() plain(if )tag() - tag() plain(inspect )tag() - tag() plain(from )tag() - tag() plain(else )tag() - tag() plain(elseif )tag() - tag() plain(when )tag() - tag() plain(until )tag() - tag() plain(loop )tag() - tag() plain(then )tag() - tag() plain(obsolete )tag() - tag() plain(end )tag() - tag() - tag(tag(>) - tag() plain(check )tag() - tag() plain(ensure )tag() - tag() plain(require )tag() - tag() plain(variant )tag() - tag() plain(invariant )tag() - tag() - tag() - tag( attribute_name(lineEndContext)operator(=)string attribute_name(name)operator(=)stringtag(>) - tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)string attribute_name(char1)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) - tag() - tag( attribute_name(lineEndContext)operator(=)string attribute_name(name)operator(=)stringtag(>) - tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)stringtag(/>) - tag() - tag( attribute_name(name)operator(=)string attribute_name(lineEndContext)operator(=)stringtag(/>) - tag() - tag() - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag() - tag() - tag() - tag() - tag( attribute_name(start)operator(=)string tag(/>) - tag() - tag( tag(/>) - tag() -tag() diff --git a/test/scanners/debug/kate.in.raydebug b/test/scanners/debug/kate.in.raydebug deleted file mode 100644 index 01eec5a..0000000 --- a/test/scanners/debug/kate.in.raydebug +++ /dev/null @@ -1,76 +0,0 @@ -preprocessor() -preprocessor() -tag( attribute_name(version)operator(=)string attribute_name(kateversion)operator(=)string attribute_name(section)operator(=)string attribute_name(extensions)operator(=)string attribute_name(mimetype)operator(=)stringtag(>) - tag() - tag(tag(>) - tag() plain(indexing )tag() - tag() plain(class )tag() - tag() plain(inherit )tag() - tag() plain(creation )tag() - tag() plain(feature )tag() - tag() plain(rename )tag() - tag() plain(redefine )tag() - tag() plain(undefine )tag() - tag() plain(select )tag() - tag() plain(export )tag() - tag() plain(local )tag() - tag() plain(deferred )tag() - tag() plain(do )tag() - tag() plain(is )tag() - tag() plain(once )tag() - tag() plain(alias )tag() - tag() plain(external )tag() - tag() plain(rescue )tag() - tag() plain(debug )tag() - tag() plain(if )tag() - tag() plain(inspect )tag() - tag() plain(from )tag() - tag() plain(else )tag() - tag() plain(elseif )tag() - tag() plain(when )tag() - tag() plain(until )tag() - tag() plain(loop )tag() - tag() plain(then )tag() - tag() plain(obsolete )tag() - tag() plain(end )tag() - tag() - tag(tag(>) - tag() plain(check )tag() - tag() plain(ensure )tag() - tag() plain(require )tag() - tag() plain(variant )tag() - tag() plain(invariant )tag() - tag() - tag() - tag( attribute_name(lineEndContext)operator(=)string attribute_name(name)operator(=)stringtag(>) - tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)string attribute_name(char1)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) - tag() - tag( attribute_name(lineEndContext)operator(=)string attribute_name(name)operator(=)stringtag(>) - tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)stringtag(/>) - tag() - tag( attribute_name(name)operator(=)string attribute_name(lineEndContext)operator(=)stringtag(/>) - tag() - tag() - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag() - tag() - tag() - tag() - tag( attribute_name(start)operator(=)string tag(/>) - tag() - tag( tag(/>) - tag() -tag() diff --git a/test/scanners/debug/lines.expected.raydebug b/test/scanners/debug/lines.expected.raydebug deleted file mode 100644 index 3e836fa..0000000 --- a/test/scanners/debug/lines.expected.raydebug +++ /dev/null @@ -1,27 +0,0 @@ -head[head(===================================================================)] -head[head(--- )plain(/Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (revision 1431\))] -head[head(+++ )plain(/Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (revision 1437\))] -change[change(@@)plain( -1,6 +1,10 )change(@@)] -insert[insert(+)plain(require 'login_system')] -comment( require 'coderay') -comment( ) -comment( class PastesController < ApplicationController) -insert[insert(+)plain( include LoginSystem)] -insert[insert(+)] -insert[insert(+)plain( before_filter :attempt_cookie_login)] -comment( ) -comment( # caches_action :recent) -comment( ) -change[change(@@)plain( -10,11 +14,7 )change(@@)] -comment( ) -comment( def show) -comment( @paste = Paste.find(params[:id]\)) -delete[delete(-)plain( if params[:key] and params[:key]==User.new(@paste.nick\).magic_mojo)] -delete[delete(-)plain( session[:login]=@paste.nick)] -delete[delete(-)plain( return redirect_to(:action => 'show', :id => @paste.id\))] -delete[delete(-)plain( end)] -delete[delete(-)plain( )] -insert[insert(+)plain( attempt_key_login if not logged_in?)] -comment( unless @paste.asset or not @paste.body.blank?) -comment( render :action => "edit") -comment( end) \ No newline at end of file diff --git a/test/scanners/debug/lines.in.raydebug b/test/scanners/debug/lines.in.raydebug deleted file mode 100644 index 3e836fa..0000000 --- a/test/scanners/debug/lines.in.raydebug +++ /dev/null @@ -1,27 +0,0 @@ -head[head(===================================================================)] -head[head(--- )plain(/Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (revision 1431\))] -head[head(+++ )plain(/Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (revision 1437\))] -change[change(@@)plain( -1,6 +1,10 )change(@@)] -insert[insert(+)plain(require 'login_system')] -comment( require 'coderay') -comment( ) -comment( class PastesController < ApplicationController) -insert[insert(+)plain( include LoginSystem)] -insert[insert(+)] -insert[insert(+)plain( before_filter :attempt_cookie_login)] -comment( ) -comment( # caches_action :recent) -comment( ) -change[change(@@)plain( -10,11 +14,7 )change(@@)] -comment( ) -comment( def show) -comment( @paste = Paste.find(params[:id]\)) -delete[delete(-)plain( if params[:key] and params[:key]==User.new(@paste.nick\).magic_mojo)] -delete[delete(-)plain( session[:login]=@paste.nick)] -delete[delete(-)plain( return redirect_to(:action => 'show', :id => @paste.id\))] -delete[delete(-)plain( end)] -delete[delete(-)plain( )] -insert[insert(+)plain( attempt_key_login if not logged_in?)] -comment( unless @paste.asset or not @paste.body.blank?) -comment( render :action => "edit") -comment( end) \ No newline at end of file diff --git a/test/scanners/debug/suite.rb b/test/scanners/debug/suite.rb deleted file mode 100644 index 10ce930..0000000 --- a/test/scanners/debug/suite.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Debug < CodeRay::TestCase -end diff --git a/test/scanners/delphi/pluto.expected.raydebug b/test/scanners/delphi/pluto.expected.raydebug deleted file mode 100644 index cf71c0e..0000000 --- a/test/scanners/delphi/pluto.expected.raydebug +++ /dev/null @@ -1,10829 +0,0 @@ -reserved(unit) ident(FindTH)operator(;) - -reserved(interface) - -reserved(uses) - ident(Classes)operator(,) ident(windows)operator(,) ident(Dialogs)operator(,) ident(ComCtrls)operator(,) ident(CompEx)operator(,) ident(SysUtils)operator(,) ident(YTools)operator(,) ident(YTypes)operator(,) - ident(clock)operator(,) ident(plutoconst)operator(,) ident(StdCtrls)operator(,) ident(Masks)operator(,) ident(Forms)operator(,) ident(XReg)operator(;) - -reserved(const) - ident(RegMoleVersion) operator(=) stringoperator(;) - -reserved(type) - ident(TFindThreadProgress) operator(=) operator(()ident(fpNone)operator(,) ident(fpEvery512th)operator(,) ident(fpEach)operator(\))operator(;) - - ident(TRegFindThread) operator(=) reserved(class)operator(()ident(TThread)operator(\)) - directive(private) - ident(SearchText)operator(:) reserved(string)operator(;) - ident(SearchFor)operator(:) ident(TSearchOptions)operator(;) - ident(Progress)operator(:) ident(TFindThreadProgress)operator(;) - ident(FindNodeText)operator(:) reserved(string)operator(;) - ident(TimeElapsed)operator(:) ident(Double)operator(;) - ident(syncIcon)operator(:) ident(Integer)operator(;) - ident(syncStatusText)operator(:) reserved(string)operator(;) - ident(CurrentPath)operator(:) reserved(string)operator(;) - ident(KeysScanned)operator(:) ident(Integer)operator(;) - ident(Mask)operator(:) ident(TMask)operator(;) - ident(dwordVal)operator(:) ident(DWORD)operator(;) - ident(SearchForValues)operator(:) ident(Boolean)operator(;) - - reserved(procedure) ident(Find)operator(;) - - comment(//Synchronizers) - reserved(procedure) ident(Start)operator(;) - reserved(procedure) ident(Add)operator(;) - reserved(procedure) ident(UpdateStatus)operator(;) - reserved(procedure) ident(Finish)operator(;) - directive(protected) - reserved(procedure) ident(Execute)operator(;) directive(override)operator(;) - directive(public) - ident(SpecialPath)operator(:) reserved(string)operator(;) - ident(FindNode)operator(:) ident(TTreeNode)operator(;) - ident(ListTV)operator(:) ident(TTreeView)operator(;) - ident(ObjectsFound)operator(,) ident(KeysFound)operator(,) ident(ValuesFound)operator(,) ident(DataFound)operator(:) ident(Integer)operator(;) - ident(Ranges)operator(:) ident(TRanges)operator(;) - reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) - reserved(constructor) ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(;) ident(s)operator(:) reserved(string)operator(;) - ident(SearchFor)operator(:) ident(TSearchOptions)operator(;) ident(Progress)operator(:) ident(TFindThreadProgress)operator(\))operator(;) - reserved(end)operator(;) - -reserved(implementation) - -reserved(uses) - ident(ValuesU)operator(,) ident(StrUtils)operator(;) - -comment({ TRegFindThread }) - -reserved(procedure) ident(TRegFindThread)operator(.)ident(Add)operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) -reserved(begin) - reserved(with) ident(ListTV) reserved(do) reserved(begin) - comment(//Items.BeginUpdate;) - ident(Node) operator(:=) ident(TTreeNode)operator(.)ident(Create)operator(()ident(Items)operator(\))operator(;) - ident(SetTNImage)operator(()ident(Node)operator(,) ident(syncIcon)operator(\))operator(;) - ident(Items)operator(.)ident(AddNode)operator(()ident(Node)operator(,) ident(FindNode)operator(,) ident(Copy)operator(()ident(CurrentPath)operator(,) integer(1)operator(,) integer(255)operator(\))operator(,) reserved(nil)operator(,) - ident(naAddChildFirst)operator(\))operator(;) - reserved(if) reserved(not) ident(FindNode)operator(.)ident(Expanded) reserved(and) operator(()ident(FindNode)operator(.)ident(Count) operator(=) integer(1)operator(\)) reserved(then) comment(//First Node) - ident(FindNode)operator(.)ident(Expand)operator(()ident(False)operator(\))operator(;) - comment(//Items.EndUpdate;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(constructor) ident(TRegFindThread)operator(.)ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(;) ident(s)operator(:) reserved(string)operator(;) - ident(SearchFor)operator(:) ident(TSearchOptions)operator(;) ident(Progress)operator(:) ident(TFindThreadProgress)operator(\))operator(;) -reserved(begin) - reserved(inherited) ident(Create)operator(()ident(True)operator(\))operator(;) comment(// Create thread suspended) - ident(Priority) operator(:=) ident(PriorityLevel)operator(;) comment(// Set Priority Level) - ident(FreeOnTerminate) operator(:=) ident(True)operator(;) comment(// Thread Free Itself when terminated) - - ident(SearchText) operator(:=) ident(s)operator(;) - ident(Ranges) operator(:=) reserved(nil)operator(;) - ident(Self)operator(.)ident(SearchFor) operator(:=) ident(SearchFor)operator(;) - ident(Self)operator(.)ident(Progress) operator(:=) ident(Progress)operator(;) -reserved(end)operator(;) - -reserved(destructor) ident(TRegFindThread)operator(.)ident(Destroy)operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(FindNode)operator(\)) reserved(then) - ident(FindNode)operator(.)ident(Data) operator(:=) reserved(nil)operator(;) - reserved(inherited)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegFindThread)operator(.)ident(Execute)operator(;) -reserved(begin) - ident(Synchronize)operator(()ident(Start)operator(\))operator(;) - ident(Find)operator(;) - ident(Synchronize)operator(()ident(Finish)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegFindThread)operator(.)ident(Find)operator(;) -reserved(var) - ident(SpecialKey)operator(:) ident(HKEY)operator(;) - - reserved(procedure) ident(Add)operator(()reserved(const) ident(Path)operator(:) reserved(string)operator(;) reserved(const) ident(Icon)operator(:) ident(Integer)operator(\))operator(;) - reserved(var) - ident(zCurrentPath)operator(:) reserved(string)operator(;) - reserved(begin) - ident(zCurrentPath) operator(:=) ident(CurrentPath)operator(;) - - ident(CurrentPath) operator(:=) ident(Path)operator(;) - ident(syncIcon) operator(:=) ident(Icon)operator(;) - ident(Synchronize)operator(()ident(Self)operator(.)ident(Add)operator(\))operator(;) - - ident(CurrentPath) operator(:=) ident(zCurrentPath)operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(AddValueName)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) ident(Typ)operator(:) ident(TRegDataType)operator(\))operator(;) - reserved(begin) - ident(Add)operator(()ident(CurrentPath) operator(+) string operator(+) ident(ValueName)operator(,) ident(IconOfDataType)operator(()ident(Typ)operator(\))operator(\))operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(AddValueData)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) ident(Context)operator(:) ident(TRegContext)operator(\))operator(;) - reserved(begin) - ident(Add)operator(()ident(CurrentPath) operator(+) string operator(+) ident(ValueName) operator(+) string operator(+) ident(DataPreviewOfContext)operator(()ident(Context)operator(\))operator(,) - ident(IconOfDataType)operator(()ident(Context)operator(.)ident(Typ)operator(\))operator(\))operator(;) - reserved(end)operator(;) - - reserved(function) ident(FoundInStr)operator(()reserved(const) ident(Data)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) - reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - reserved(if) ident(SearchText) operator(=) string reserved(then) - ident(Exit)operator(;) - - reserved(if) operator(()ident(Data) operator(=) stringoperator(\)) reserved(and) reserved(not) operator(()ident(sfWildCards) reserved(in) ident(SearchFor)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(sfWildCards) reserved(in) ident(SearchFor) reserved(then) reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Mask)operator(\)) reserved(then) - ident(Result) operator(:=) ident(Mask)operator(.)ident(Matches)operator(()ident(Data)operator(\))operator(;) - reserved(end) reserved(else) reserved(begin) - comment({if not (sfFileNames in SearchFor\) then begin - if TextBegin(SearchText, UntilChar(Data, '~'\)\) and FileExists(Data\) then - Result := SameFileName(SearchText, GetFileNew(Data\)\); - Exit; - end; }) - - reserved(if) operator([)ident(sfParts)operator(,) ident(sfIgnoreCase)operator(]) operator(<=) ident(SearchFor) reserved(then) - reserved(if) ident(SfUseLocales) reserved(in) ident(SearchFor) reserved(then) - ident(Result) operator(:=) integer(0)operator(<)ident(PosEx)operator(()ident(SearchText)operator(,) ident(AnsiLowerCase)operator(()ident(Data)operator(\))operator(\)) - reserved(else) - ident(Result) operator(:=) integer(0)operator(<)ident(PosExText)operator(()ident(SearchText)operator(,) ident(Data)operator(\)) - reserved(else) reserved(if) ident(sfParts) reserved(in) ident(SearchFor) reserved(then) - ident(Result) operator(:=) integer(0)operator(<)ident(PosEx)operator(()ident(SearchText)operator(,) ident(Data)operator(\)) - reserved(else) reserved(if) ident(sfIgnoreCase) reserved(in) ident(SearchFor) reserved(then) - reserved(if) ident(SfUseLocales) reserved(in) ident(SearchFor) reserved(then) - ident(Result) operator(:=) operator(()ident(AnsiLowerCase)operator(()ident(Data)operator(\)) operator(=) ident(SearchText)operator(\)) - reserved(else) - ident(Result) operator(:=) ident(SameText)operator(()ident(Data)operator(,) ident(SearchText)operator(\)) - reserved(else) - ident(Result) operator(:=) operator(()ident(SearchText) operator(=) ident(Data)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(function) ident(FoundInByteA)operator(()reserved(const) ident(Data)operator(:) ident(TByteA)operator(\))operator(:) ident(Boolean)operator(;) - reserved(begin) - ident(Result) operator(:=) ident(FoundInStr)operator(()ident(StrOfByteA)operator(()ident(Data)operator(\))operator(\))operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(ScanValues)operator(()ident(Key)operator(:) ident(HKEY)operator(;) ident(Info)operator(:) ident(TRegKeyInfo)operator(\))operator(;) - reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(MaxLen)operator(,) ident(NameLen)operator(,) ident(Len)operator(,) ident(Typ)operator(:) ident(Cardinal)operator(;) - ident(Buffer)operator(:) ident(PByte)operator(;) - ident(ValueName)operator(:) ident(PChar)operator(;) - - reserved(procedure) ident(ScanValue)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) reserved(const) ident(Typ)operator(:) ident(TRegDataType)operator(;) - reserved(const) ident(Data)operator(:) reserved(string)operator(\))operator(;) - reserved(begin) - reserved(if) operator(()ident(sfSpecialTypes) reserved(in) ident(SearchFor)operator(\)) reserved(and) reserved(not) ident(InRanges)operator(()ident(Ranges)operator(,) ident(Typ)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(case) ident(Typ) reserved(of) - ident(rdString)operator(,) ident(rdExpandString)operator(:) reserved(if) ident(sfString) reserved(in) ident(SearchFor) reserved(then) reserved(begin) - reserved(if) ident(FoundInStr)operator(()ident(Data)operator(\)) reserved(then) reserved(begin) - ident(Inc)operator(()ident(DataFound)operator(\))operator(;) - ident(AddValueData)operator(()ident(ValueName)operator(,) - ident(RegContext)operator(()ident(Typ)operator(,) ident(TByteA)operator(()ident(Copy)operator(()ident(Data)operator(,) integer(1)operator(,) ident(Length)operator(()ident(Data)operator(\))operator(-)integer(1)operator(\))operator(\))operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - ident(rdCardinal)operator(,) ident(rdCardBigEndian)operator(:) reserved(if) ident(sfDWord) reserved(in) ident(SearchFor) reserved(then) reserved(begin) - reserved(if) operator(()ident(Length)operator(()ident(Data)operator(\)) operator(>=) ident(SizeOf)operator(()ident(Cardinal)operator(\))operator(\)) reserved(and) - operator(()ident(dwordVal) operator(=) ident(PCardinal)operator(()ident(Copy)operator(()ident(Data)operator(,) integer(1)operator(,) ident(SizeOf)operator(()ident(Cardinal)operator(\))operator(\))operator(\))operator(^)operator(\)) reserved(then) reserved(begin) - ident(Inc)operator(()ident(DataFound)operator(\))operator(;) - ident(AddValueData)operator(()ident(ValueName)operator(,) - ident(RegContext)operator(()ident(Typ)operator(,) ident(ByteAOfStr)operator(()ident(Data)operator(\))operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(else) - reserved(if) ident(sfOtherTypes) reserved(in) ident(SearchFor) reserved(then) reserved(begin) - reserved(if) ident(FoundInStr)operator(()ident(Data)operator(\)) reserved(then) reserved(begin) - ident(Inc)operator(()ident(DataFound)operator(\))operator(;) - ident(AddValueData)operator(()ident(ValueName)operator(,) - ident(RegContext)operator(()ident(Typ)operator(,) ident(ByteAOfStr)operator(()ident(Data)operator(\))operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(begin) - ident(MaxLen) operator(:=) ident(Info)operator(.)ident(MaxValueLen) operator(+) integer(1)operator(;) comment(//Include Nullbyte) - - ident(Buffer) operator(:=) reserved(nil)operator(;) - reserved(if) ident(sfValueData) reserved(in) ident(SearchFor) reserved(then) - ident(GetMem)operator(()ident(Buffer)operator(,) ident(Info)operator(.)ident(MaxDataLen)operator(\))operator(;) - - ident(GetMem)operator(()ident(ValueName)operator(,) ident(MaxLen)operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Info)operator(.)ident(NumValues)operator(-)integer(1) reserved(do) reserved(begin) - ident(NameLen) operator(:=) ident(MaxLen)operator(;) - ident(Len) operator(:=) ident(Info)operator(.)ident(MaxDataLen)operator(;) - reserved(if) reserved(not) ident(Success)operator(()ident(RegEnumValue)operator(()ident(Key)operator(,) ident(i)operator(,) ident(ValueName)operator(,) ident(NameLen)operator(,) reserved(nil)operator(,) operator(@)ident(Typ)operator(,) - ident(Buffer)operator(,) operator(@)ident(Len)operator(\))operator(\)) reserved(then) - ident(Continue)operator(;) - - reserved(if) ident(sfValueNames) reserved(in) ident(SearchFor) reserved(then) - reserved(if) ident(FoundInStr)operator(()ident(ValueName)operator(\)) reserved(then) reserved(begin) - ident(Inc)operator(()ident(ValuesFound)operator(\))operator(;) - ident(AddValueName)operator(()ident(ValueName)operator(,) ident(Typ)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(sfValueData) reserved(in) ident(SearchFor) reserved(then) - ident(ScanValue)operator(()ident(ValueName)operator(,) ident(Typ)operator(,) reserved(string)operator(()ident(Copy)operator(()ident(TByteA)operator(()ident(Buffer)operator(\))operator(,) integer(0)operator(,) ident(Len)operator(\))operator(\))operator(\))operator(;) - reserved(end)operator(;) - - ident(FreeMem)operator(()ident(ValueName)operator(,) ident(MaxLen)operator(\))operator(;) - reserved(if) ident(sfValueData) reserved(in) ident(SearchFor) reserved(then) - ident(FreeMem)operator(()ident(Buffer)operator(,) ident(Info)operator(.)ident(MaxDataLen)operator(\))operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(ScanKey)operator(()ident(Key)operator(:) ident(HKEY)operator(;) reserved(const) ident(KeyName)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) - reserved(var) - ident(p)operator(:) ident(PChar)operator(;) - ident(i)operator(,) ident(z)operator(:) ident(Integer)operator(;) - ident(l)operator(,) ident(Len)operator(:) ident(DWORD)operator(;) - ident(NewKey)operator(:) ident(HKEY)operator(;) - ident(Info)operator(:) ident(TRegKeyInfo)operator(;) - reserved(begin) - reserved(if) ident(Terminated) reserved(then) ident(Exit)operator(;) - - ident(Inc)operator(()ident(KeysScanned)operator(\))operator(;) - reserved(if) ident(Progress) operator(<>) ident(fpNone) reserved(then) - reserved(if) operator(()ident(Progress) operator(=) ident(fpEach)operator(\)) reserved(or) - operator(()operator(()ident(Progress) operator(=) ident(fpEvery512th)operator(\)) reserved(and) operator(()operator(()ident(KeysScanned) reserved(and) hex($1FF)operator(\)) operator(=) integer(0)operator(\))operator(\)) reserved(then) reserved(begin) - ident(syncStatusText) operator(:=) char operator(+) ident(IntToStr)operator(()ident(KeysScanned)operator(\)) operator(+) string operator(+) ident(CurrentPath)operator(;) - ident(Synchronize)operator(()ident(UpdateStatus)operator(\))operator(;) - reserved(end)operator(;) - - reserved(with) ident(Info) reserved(do) - reserved(if) reserved(not) ident(Success)operator(()ident(RegQueryInfoKey)operator(()ident(Key)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) operator(@)ident(NumSubKeys)operator(,) - operator(@)ident(MaxSubKeyLen)operator(,) reserved(nil)operator(,) operator(@)ident(NumValues)operator(,) operator(@)ident(MaxValueLen)operator(,) operator(@)ident(MaxDataLen)operator(,) - reserved(nil)operator(,) reserved(nil)operator(\))operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) operator(()ident(Info)operator(.)ident(NumValues) operator(>) integer(0)operator(\)) reserved(and) ident(SearchForValues) reserved(then) - ident(ScanValues)operator(()ident(Key)operator(,) ident(Info)operator(\))operator(;) - - reserved(if) ident(Info)operator(.)ident(NumSubKeys) operator(<=) integer(0) reserved(then) - ident(Exit)operator(;) - - ident(Len) operator(:=) ident(Info)operator(.)ident(MaxSubKeyLen) operator(+) integer(1)operator(;) - ident(GetMem)operator(()ident(p)operator(,) ident(Len)operator(\))operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Info)operator(.)ident(NumSubKeys)operator(-)integer(1) reserved(do) reserved(begin) - ident(l) operator(:=) ident(Len)operator(;) - ident(RegEnumKeyEx)operator(()ident(Key)operator(,) ident(i)operator(,) ident(p)operator(,) ident(l)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(\))operator(;) - reserved(if) ident(sfKeys) reserved(in) ident(SearchFor) reserved(then) - reserved(if) ident(FoundInStr)operator(()ident(p)operator(\)) reserved(then) reserved(begin) - ident(Inc)operator(()ident(KeysFound)operator(\))operator(;) - ident(Add)operator(()ident(CurrentPath) operator(+) char operator(+) ident(p)operator(,) ident(iconKeyMiddle)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(Success)operator(()ident(RegOpenKey)operator(()ident(Key)operator(,) ident(p)operator(,) ident(NewKey)operator(\))operator(\)) reserved(then) reserved(begin) - ident(z) operator(:=) ident(Length)operator(()ident(CurrentPath)operator(\))operator(;) - ident(CurrentPath) operator(:=) ident(CurrentPath) operator(+) char operator(+) ident(p)operator(;) - - reserved(try) - ident(ScanKey)operator(()ident(NewKey)operator(,) ident(p)operator(\))operator(;) - reserved(finally) - ident(RegCloseKey)operator(()ident(NewKey)operator(\))operator(;) - reserved(end)operator(;) - - ident(SetLength)operator(()ident(CurrentPath)operator(,) ident(z)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(Terminated) reserved(then) ident(Break)operator(;) - reserved(end)operator(;) - - ident(FreeMem)operator(()ident(p)operator(,) ident(Len)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(with) ident(TClock)operator(.)ident(Create) reserved(do) reserved(begin) - ident(FindNode)operator(.)ident(Text) operator(:=) ident(FindNodeText) operator(+) stringoperator(;) - - reserved(try) - reserved(if) ident(sfHKU) reserved(in) ident(SearchFor) reserved(then) reserved(begin) - ident(CurrentPath) operator(:=) stringoperator(;) - ident(ScanKey)operator(()ident(HKEY_USERS)operator(\))operator(;) - reserved(end)operator(;) - reserved(if) ident(sfHKLM) reserved(in) ident(SearchFor) reserved(then) reserved(begin) - ident(CurrentPath) operator(:=) stringoperator(;) - ident(ScanKey)operator(()ident(HKEY_LOCAL_MACHINE)operator(\))operator(;) - reserved(end)operator(;) - reserved(if) ident(sfHKDD) reserved(in) ident(SearchFor) reserved(then) reserved(begin) - ident(CurrentPath) operator(:=) stringoperator(;) - ident(ScanKey)operator(()ident(HKEY_DYN_DATA)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(SpecialPath) operator(<>) string reserved(then) reserved(begin) - reserved(if) ident(Success)operator(()ident(RegOpenKey)operator(()ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(SpecialPath)operator(\))operator(\))operator(,) - ident(PChar)operator(()ident(ExRegKey)operator(()ident(SpecialPath)operator(\))operator(\))operator(,) ident(SpecialKey)operator(\))operator(\)) reserved(then) reserved(begin) - ident(CurrentPath) operator(:=) ident(LWPSolve)operator(()ident(SpecialPath)operator(\))operator(;) - ident(ScanKey)operator(()ident(SpecialKey)operator(\))operator(;) - ident(RegCloseKey)operator(()ident(SpecialKey)operator(\))operator(;) - reserved(end) reserved(else) - ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) - ident(Quote)operator(()ident(SpecialPath)operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(except) - ident(syncStatusText) operator(:=) char operator(+) ident(IntToStr)operator(()ident(KeysScanned)operator(\)) operator(+) string operator(+) ident(CurrentPath) operator(+) - string Terminated.)delimiter(')>operator(;) - ident(Synchronize)operator(()ident(UpdateStatus)operator(\))operator(;) - ident(Sleep)operator(()integer(1000)operator(\))operator(;) - reserved(end)operator(;) - - ident(TimeElapsed) operator(:=) ident(SecondsPassed)operator(;) - ident(Free)operator(;) reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrOfSearchOptions)operator(()reserved(const) ident(Options)operator(:) ident(TSearchOptions)operator(\))operator(:) reserved(string)operator(;) - - reserved(procedure) ident(Add)operator(()reserved(const) ident(s)operator(:) reserved(string)operator(\))operator(;) - reserved(begin) - ident(Result) operator(:=) ident(Result) operator(+) ident(s)operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(AddOption)operator(()reserved(const) ident(Option)operator(:) reserved(string)operator(;) reserved(const) ident(Flag)operator(:) ident(TSearchVar)operator(;) - reserved(const) ident(Optional)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(;) - reserved(begin) - reserved(if) ident(Flag) reserved(in) ident(Options) reserved(then) - ident(Add)operator(()ident(Option)operator(\)) - reserved(else) - reserved(if) reserved(not) ident(Optional) reserved(then) - ident(Add)operator(()char operator(+) ident(Option)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - - ident(Add)operator(()charoperator(\))operator(;) - ident(AddOption)operator(()charoperator(,) ident(sfAsHex)operator(,) ident(True)operator(\))operator(;) - ident(AddOption)operator(()stringoperator(,) ident(sfWildcards)operator(,) ident(True)operator(\))operator(;) - - ident(AddOption)operator(()charoperator(,) ident(sfIgnoreCase)operator(\))operator(;) - ident(AddOption)operator(()charoperator(,) ident(sfUseLocales)operator(\))operator(;) - ident(AddOption)operator(()stringoperator(,) ident(sfParts)operator(\))operator(;) - - ident(AddOption)operator(()charoperator(,) ident(sfKeys)operator(\))operator(;) - ident(AddOption)operator(()charoperator(,) ident(sfValueNames)operator(\))operator(;) - ident(AddOption)operator(()stringoperator(,) ident(sfValueData)operator(\))operator(;) - - ident(AddOption)operator(()charoperator(,) ident(sfString)operator(\))operator(;) - ident(AddOption)operator(()charoperator(,) ident(sfDWORD)operator(\))operator(;) - ident(AddOption)operator(()charoperator(,) ident(sfOtherTypes)operator(\))operator(;) - ident(AddOption)operator(()charoperator(,) ident(sfSpecialTypes)operator(\))operator(;) - - ident(Add)operator(()stringoperator(\))operator(;) - - reserved(if) operator([)ident(sfHKU)operator(,) ident(sfHKLM)operator(,) ident(sfHKDD)operator(]) operator(<=) ident(Options) reserved(then) - ident(Add)operator(()stringoperator(\)) - reserved(else) reserved(begin) - ident(AddOption)operator(()stringoperator(,) ident(sfHKU)operator(,) ident(True)operator(\))operator(;) - ident(AddOption)operator(()stringoperator(,) ident(sfHKLM)operator(,) ident(True)operator(\))operator(;) - ident(AddOption)operator(()stringoperator(,) ident(sfHKDD)operator(,) ident(True)operator(\))operator(;) - ident(Result) operator(:=) ident(TrimRight)operator(()ident(Result)operator(\))operator(;) - reserved(end)operator(;) - - ident(Add)operator(()charoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegFindThread)operator(.)ident(Start)operator(;) -reserved(begin) - ident(Mask) operator(:=) reserved(nil)operator(;) - ident(KeysFound) operator(:=) integer(0)operator(;) - ident(ValuesFound) operator(:=) integer(0)operator(;) - ident(DataFound) operator(:=) integer(0)operator(;) - ident(KeysScanned) operator(:=) integer(0)operator(;) - - comment(//Prepare for options) - reserved(if) ident(sfAsHex) reserved(in) ident(SearchFor) reserved(then) reserved(begin) - ident(SearchText) operator(:=) reserved(string)operator(()ident(ByteAOfHex)operator(()ident(SearchText)operator(\))operator(\))operator(;) - ident(SearchFor) operator(:=) ident(SearchFor) operator(-) operator([)ident(sfDWord)operator(,) ident(sfIgnoreCase)operator(])operator(;) - reserved(end) reserved(else) reserved(begin) - reserved(if) ident(SfUseLocales) reserved(in) ident(SearchFor) reserved(then) - ident(SearchText) operator(:=) ident(AnsiLowerCase)operator(()ident(SearchText)operator(\))operator(;) - - ident(dwordVal) operator(:=) integer(0)operator(;) - reserved(if) ident(sfDWord) reserved(in) ident(SearchFor) reserved(then) - reserved(if) ident(IsValidInteger)operator(()ident(SearchText)operator(\)) reserved(then) - ident(dwordVal) operator(:=) ident(StrToInt)operator(()ident(SearchText)operator(\)) - reserved(else) - ident(Exclude)operator(()ident(SearchFor)operator(,) ident(sfDWord)operator(\))operator(;) - - reserved(if) ident(sfWildCards) reserved(in) ident(SearchFor) reserved(then) - reserved(try) - ident(Mask) operator(:=) ident(TMask)operator(.)ident(Create)operator(()ident(SearchText)operator(\))operator(;) - reserved(except) - ident(Mask)operator(.)ident(Free)operator(;) - ident(Mask) operator(:=) reserved(nil)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - ident(SearchForValues) operator(:=) operator(()ident(sfValueNames) reserved(in) ident(SearchFor)operator(\)) - reserved(or) operator(()ident(sfValueData) reserved(in) ident(SearchFor)operator(\))operator(;) - - ident(FindNodeText) operator(:=) string operator(+) ident(Quote)operator(()ident(FriendlyStr)operator(()ident(SearchText)operator(\))operator(\)) operator(+) char operator(+) - ident(StrOfSearchOptions)operator(()ident(SearchFor)operator(\))operator(;) - - reserved(with) ident(ListTV)operator(.)ident(Items) reserved(do) reserved(begin) - ident(BeginUpdate)operator(;) - ident(FindNode) operator(:=) ident(AddChildObject)operator(()reserved(nil)operator(,) ident(FindNodeText) operator(+) stringoperator(,) reserved(nil)operator(\))operator(;) - ident(FindNode)operator(.)ident(Data) operator(:=) ident(Self)operator(;) - ident(SetTNImage)operator(()ident(FindNode)operator(,) ident(iconHostReg)operator(\))operator(;) - ident(EndUpdate)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegFindThread)operator(.)ident(UpdateStatus)operator(;) -reserved(begin) - ident(FindNode)operator(.)ident(Text) operator(:=) ident(FindNodeText) operator(+) char operator(+) ident(syncStatusText)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegFindThread)operator(.)ident(Finish)operator(;) -reserved(var) - ident(Found)operator(:) reserved(string)operator(;) -reserved(begin) - ident(ObjectsFound) operator(:=) ident(KeysFound) operator(+) ident(ValuesFound) operator(+) ident(DataFound)operator(;) - - ident(Found) operator(:=) ident(StrNumerus)operator(()ident(ObjectsFound)operator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(;) - reserved(if) ident(ObjectsFound) operator(<) integer(2) reserved(then) - ident(Found) operator(:=) ident(Found) operator(+) string - reserved(else) reserved(begin) - ident(Found) operator(:=) ident(Found) operator(+) stringoperator(;) - reserved(if) ident(KeysFound) operator(>) integer(0) reserved(then) - ident(Found) operator(:=) ident(Found) operator(+) ident(StrNumerus)operator(()ident(KeysFound)operator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(;) - reserved(if) ident(ValuesFound) operator(>) integer(0) reserved(then) - ident(Found) operator(:=) ident(Found) operator(+) ident(StrNumerus)operator(()ident(ValuesFound)operator(,) stringoperator(,) stringoperator(,) - stringoperator(\))operator(;) - reserved(if) ident(DataFound) operator(>) integer(0) reserved(then) - ident(Found) operator(:=) ident(Found) operator(+) ident(StrNumerus)operator(()ident(DataFound)operator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(;) - - reserved(if) ident(RightStr)operator(()ident(Found)operator(,) integer(2)operator(\)) operator(=) string reserved(then) - ident(Delete)operator(()ident(Found)operator(,) ident(Length)operator(()ident(Found)operator(\)) operator(-) integer(1)operator(,) integer(2)operator(\))operator(;) - reserved(end)operator(;) - - ident(FindNode)operator(.)ident(Text) operator(:=) ident(FindNodeText) operator(+) ident(Format)operator(()stringoperator(,) - operator([)ident(TimeElapsed)operator(,) ident(Found)operator(])operator(\))operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(FindWinU)operator(;) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) ident(Dialogs)operator(,) - ident(ComCtrls)operator(,) ident(StdCtrls)operator(,) ident(ExtCtrls)operator(,) ident(Clipbrd)operator(,) ident(NewPanels)operator(,) ident(plutoconst)operator(,) ident(FindTH)operator(,) ident(YTools)operator(,) - ident(PrefTools)operator(,) ident(Menus)operator(,) ident(XReg)operator(,) ident(RangeEdit)operator(;) - -reserved(type) - ident(TFindWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) - ident(ListTV)operator(:) ident(TTreeView)operator(;) - ident(FindP)operator(:) ident(TPanel)operator(;) - ident(FindE)operator(:) ident(TEdit)operator(;) - ident(ColorPanel1)operator(:) ident(TColorPanel)operator(;) - ident(ResultsPopup)operator(:) ident(TPopupMenu)operator(;) - ident(Copy1)operator(:) ident(TMenuItem)operator(;) - ident(ColorPanel2)operator(:) ident(TColorPanel)operator(;) - ident(FindPrefP)operator(:) ident(TPanel)operator(;) - ident(CommonGB)operator(:) ident(TGroupBox)operator(;) - ident(Label4)operator(:) ident(TLabel)operator(;) - ident(SfWildCardsCB)operator(:) ident(TCheckBox)operator(;) - ident(SfPartsCB)operator(:) ident(TCheckBox)operator(;) - ident(SfIgnoreCaseCB)operator(:) ident(TCheckBox)operator(;) - ident(SfAsHexCB)operator(:) ident(TCheckBox)operator(;) - ident(SfAsDWord)operator(:) ident(TCheckBox)operator(;) - ident(SfUseLocalesCB)operator(:) ident(TCheckBox)operator(;) - ident(FindGB)operator(:) ident(TGroupBox)operator(;) - ident(SfHKUCB)operator(:) ident(TCheckBox)operator(;) - ident(SfHKLMCB)operator(:) ident(TCheckBox)operator(;) - ident(SfHKDDCB)operator(:) ident(TCheckBox)operator(;) - ident(SfRootKeyRB)operator(:) ident(TRadioButton)operator(;) - ident(SfCurKeyRB)operator(:) ident(TRadioButton)operator(;) - ident(SfCLSIDCB)operator(:) ident(TCheckBox)operator(;) - ident(SfInterfaceCB)operator(:) ident(TCheckBox)operator(;) - ident(SfKeysCb)operator(:) ident(TCheckBox)operator(;) - ident(SfValuesCB)operator(:) ident(TCheckBox)operator(;) - ident(SfDataCB)operator(:) ident(TCheckBox)operator(;) - ident(SfStringCB)operator(:) ident(TCheckBox)operator(;) - ident(SfOtherCB)operator(:) ident(TCheckBox)operator(;) - ident(SfDWordCB)operator(:) ident(TCheckBox)operator(;) - ident(Panel2)operator(:) ident(TPanel)operator(;) - ident(GroupBox1)operator(:) ident(TGroupBox)operator(;) - ident(Label1)operator(:) ident(TLabel)operator(;) - ident(ThreadPriorityComB)operator(:) ident(TComboBox)operator(;) - ident(ProgressRG)operator(:) ident(TRadioGroup)operator(;) - ident(Panel5)operator(:) ident(TPanel)operator(;) - ident(BorderPanel1)operator(:) ident(TBorderPanel)operator(;) - ident(MoleLogoI)operator(:) ident(TImage)operator(;) - ident(TypeRangeE)operator(:) ident(TRangeEdit)operator(;) - ident(SfTypesCB)operator(:) ident(TCheckBox)operator(;) - ident(Panel1)operator(:) ident(TPanel)operator(;) - ident(TransparentCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(StayOnTopCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(FindB)operator(:) ident(TButton)operator(;) - ident(FindPrefB)operator(:) ident(TButton)operator(;) - reserved(procedure) ident(FindBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ListTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(FindEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(SfWildCardsCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(StayOnTopCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SfRootKeysUpdate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FindPrefBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(procedure) ident(CloseFindPrefP)operator(;) - reserved(procedure) ident(OpenFindPrefP)operator(;) - reserved(procedure) ident(FindEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SfDataCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ListTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SfAsHexCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(Copy1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SfIgnoreCaseCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SfTypesCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(end)operator(;) - -reserved(const) - ident(fpbOpen) operator(=) integer(0)operator(;) - ident(fpbCloseCaption) operator(=) stringoperator(;) - - ident(fpbClosed) operator(=) integer(1)operator(;) - ident(fpbOpenCaption) operator(=) string>)delimiter(')>operator(;) - -reserved(var) - ident(FindWin)operator(:) ident(TFindWin)operator(;) - -reserved(implementation) - -reserved(uses) ident(plutomain)operator(,) ident(PrefU)operator(,) ident(ValuesU)operator(;) - -preprocessor({$R *.DFM}) - -reserved(procedure) ident(TFindWin)operator(.)ident(FindBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(SearchFor)operator(:) ident(TSearchOptions)operator(;) - ident(FindThread)operator(:) ident(TRegFindThread)operator(;) - - reserved(procedure) ident(AddOption)operator(()ident(CheckBox)operator(:) ident(TCustomCheckBox)operator(;) ident(Flag)operator(:) ident(TSearchVar)operator(\))operator(;) - reserved(begin) - reserved(with) ident(CheckBox) reserved(as) ident(TCheckBox) reserved(do) - reserved(if) ident(Enabled) reserved(and) ident(Checked) reserved(then) - ident(Include)operator(()ident(SearchFor)operator(,) ident(Flag)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(SearchFor) operator(:=) operator([)operator(])operator(;) - - ident(AddOption)operator(()ident(SfKeysCB)operator(,) ident(sfKeys)operator(\))operator(;) - - ident(AddOption)operator(()ident(SfValuesCB)operator(,) ident(sfValueNames)operator(\))operator(;) - ident(AddOption)operator(()ident(SfDataCB)operator(,) ident(sfValueData)operator(\))operator(;) - - ident(AddOption)operator(()ident(SfStringCB)operator(,) ident(sfString)operator(\))operator(;) - ident(AddOption)operator(()ident(SfDWordCB)operator(,) ident(sfDWord)operator(\))operator(;) - ident(AddOption)operator(()ident(SfOtherCB)operator(,) ident(sfOtherTypes)operator(\))operator(;) - - reserved(if) ident(SfRootKeyRB)operator(.)ident(Checked) reserved(then) reserved(begin) - ident(AddOption)operator(()ident(SfHKUCB)operator(,) ident(sfHKU)operator(\))operator(;) - ident(AddOption)operator(()ident(SfHKLMCB)operator(,) ident(sfHKLM)operator(\))operator(;) - ident(AddOption)operator(()ident(SfHKDDCB)operator(,) ident(sfHKDD)operator(\))operator(;) - reserved(end)operator(;) - - ident(AddOption)operator(()ident(SfAsHexCB)operator(,) ident(sfAsHex)operator(\))operator(;) - ident(AddOption)operator(()ident(SfWildCardsCB)operator(,) ident(sfWildCards)operator(\))operator(;) - ident(AddOption)operator(()ident(SfPartsCB)operator(,) ident(sfParts)operator(\))operator(;) - ident(AddOption)operator(()ident(SfIgnoreCaseCB)operator(,) ident(sfIgnoreCase)operator(\))operator(;) - ident(AddOption)operator(()ident(SfUseLocalesCB)operator(,) ident(sfUseLocales)operator(\))operator(;) - - comment({AddOption(SfCLSIDCB, sfCLSID\); - AddOption(SfInterfaceCB, sfInterface\);}) - - reserved(if) ident(SfTypesCB)operator(.)ident(Checked) reserved(and) reserved(not) ident(TypeRangeE)operator(.)ident(RangeMaximal) reserved(then) - ident(Include)operator(()ident(SearchFor)operator(,) ident(sfSpecialTypes)operator(\))operator(;) - - ident(FindThread) operator(:=) ident(TRegFindThread)operator(.)ident(CreateIt)operator(() - ident(TThreadPriority)operator(()ident(ThreadPriorityComB)operator(.)ident(ItemIndex)operator(\))operator(,) ident(FindE)operator(.)ident(Text)operator(,) ident(SearchFor)operator(,) - ident(TFindThreadProgress)operator(()ident(ProgressRG)operator(.)ident(ItemIndex)operator(\))operator(\))operator(;) - - ident(FindThread)operator(.)ident(ListTV) operator(:=) ident(ListTV)operator(;) - - reserved(if) ident(sfSpecialTypes) reserved(in) ident(SearchFor) reserved(then) - ident(FindThread)operator(.)ident(Ranges) operator(:=) ident(TypeRangeE)operator(.)ident(Value)operator(;) - - reserved(if) ident(SfCurKeyRB)operator(.)ident(Checked) reserved(then) - ident(FindThread)operator(.)ident(SpecialPath) operator(:=) - ident(LWPSolve)operator(()ident(StrOfRegPath)operator(()ident(CurKey)operator(()ident(uhNonSystemShortcuts)operator(\))operator(\))operator(\))operator(;) - - ident(FindThread)operator(.)ident(Resume)operator(;) - ident(CloseFindPrefP)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(ListTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) - - reserved(procedure) ident(TerminateFindThread)operator(;) - reserved(var) - ident(FindThread)operator(:) ident(TRegFindThread)operator(;) - reserved(begin) - reserved(if) operator(()ident(Node)operator(.)ident(Level) operator(=) integer(0)operator(\)) reserved(then) reserved(begin) - ident(FindThread) operator(:=) ident(TRegFindThread)operator(()ident(Node)operator(.)ident(Data)operator(\))operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(FindThread)operator(\)) reserved(then) - ident(Node)operator(.)ident(Delete) - reserved(else) - reserved(try) - ident(FindThread)operator(.)ident(Terminate)operator(;) - reserved(except) - ident(Node)operator(.)ident(Text) operator(:=) stringoperator(;) - reserved(end)operator(;) - reserved(end) reserved(else) - ident(Node)operator(.)ident(Delete)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(Node) operator(:=) ident(ListTV)operator(.)ident(Selected)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(case) ident(Key) reserved(of) - ident(VK_F12)operator(:) reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) - ident(Node)operator(.)ident(Parent)operator(.)ident(AlphaSort)operator(;) - - ident(VK_RETURN)operator(:) ident(ListTVDblClick)operator(()ident(Sender)operator(\))operator(;) - - ident(VK_DELETE)operator(:) ident(TerminateFindThread)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(FindEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Key) operator(=) ident(VK_RETURN) reserved(then) - ident(FindBClick)operator(()ident(Sender)operator(\))operator(;) - - reserved(if) ident(Key) operator(=) ident(VK_UP) reserved(then) reserved(begin) - ident(CloseFindPrefP)operator(;) - ident(Key) operator(:=) integer(0)operator(;) - reserved(end) reserved(else) reserved(if) ident(Key) operator(=) ident(VK_Down) reserved(then) reserved(begin) - ident(OpenFindPrefP)operator(;) - ident(Key) operator(:=) integer(0)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ActivateThis)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(DeActivateThis)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) - ident(DeActivateThis)operator(()ident(ActiveControl)operator(\))operator(;) - - ident(AlphaBlend) operator(:=) ident(TransparentCB)operator(.)ident(Checked)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) - ident(ActivateThis)operator(()ident(ActiveControl)operator(\))operator(;) - - ident(AlphaBlend) operator(:=) ident(False)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Key) operator(=) ident(VK_ESCAPE) reserved(then) - ident(Close)operator(;) - ident(MainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(,) ident(Key)operator(,) ident(Shift)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(SfWildCardsCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(SfPartsCB)operator(.)ident(Enabled) operator(:=) reserved(not) ident(SfWildcardsCB)operator(.)ident(Checked)operator(;) - ident(SfIgnoreCaseCB)operator(.)ident(Enabled) operator(:=) reserved(not) ident(SfWildcardsCB)operator(.)ident(Checked)operator(;) - ident(SfUseLocalesCB)operator(.)ident(Enabled) operator(:=) ident(SfIgnoreCaseCB)operator(.)ident(Checked) reserved(and) reserved(not) ident(SfWildcardsCB)operator(.)ident(Checked)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(StayOnTopCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(StayOnTopCB)operator(.)ident(Checked) reserved(then) - ident(FormStyle) operator(:=) ident(fsStayOnTop) - reserved(else) - ident(FormStyle) operator(:=) ident(fsNormal)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(SfRootKeysUpdate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(SfRootKeyRB) reserved(do) reserved(begin) - ident(SfHKLMCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) - ident(SfHKUCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) - ident(SfHKDDCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(FindPrefBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(case) ident(FindPrefB)operator(.)ident(Tag) reserved(of) - ident(fpbOpen)operator(:) - ident(CloseFindPrefP)operator(;) - ident(fpbClosed)operator(:) - ident(OpenFindPrefP)operator(;) - reserved(else) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(CloseFindPrefP)operator(;) -reserved(begin) - reserved(with) ident(FindPrefB) reserved(do) reserved(begin) - ident(Tag) operator(:=) ident(fpbClosed)operator(;) - ident(Caption) operator(:=) ident(fpbOpenCaption)operator(;) - reserved(end)operator(;) - ident(FindPrefP)operator(.)ident(Visible) operator(:=) ident(False)operator(;) - ident(ListTV)operator(.)ident(Repaint)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(OpenFindPrefP)operator(;) -reserved(begin) - reserved(with) ident(FindPrefB) reserved(do) reserved(begin) - ident(Tag) operator(:=) ident(fpbOpen)operator(;) - ident(Caption) operator(:=) ident(fpbCloseCaption)operator(;) - reserved(end)operator(;) - ident(FindPrefP)operator(.)ident(Visible) operator(:=) ident(True)operator(;) - ident(ListTV)operator(.)ident(Repaint)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(FindEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(IsValidInteger)operator(()ident(FindE)operator(.)ident(Text)operator(\)) reserved(then) - ident(SfDWORDCB)operator(.)ident(Caption) operator(:=) string - reserved(else) - ident(SfDWORDCB)operator(.)ident(Caption) operator(:=) stringoperator(;) - - ident(SfAsHexCB)operator(.)ident(Enabled) operator(:=) operator(()ident(FindE)operator(.)ident(Text) operator(<>) stringoperator(\)) - reserved(and) reserved(not) ident(CharIn)operator(()ident(FindE)operator(.)ident(Text)operator(,) ident(AllChars) operator(-) ident(HexadecimalChars) operator(-) operator([)charoperator(])operator(\))operator(;) - ident(SfAsDWord)operator(.)ident(Enabled) operator(:=) ident(SfAsHexCB)operator(.)ident(Enabled) reserved(and) operator(()ident(Length)operator(()ident(TrimAll)operator(()ident(FindE)operator(.)ident(Text)operator(\))operator(\)) operator(<) integer(8)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(SfDataCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(SfDataCB) reserved(do) reserved(begin) - ident(SfStringCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) - ident(SfDWordCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) - ident(SfOtherCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(ListTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) -reserved(begin) - ident(Node) operator(:=) ident(ListTV)operator(.)ident(Selected)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(or) operator(()ident(Node)operator(.)ident(Level) operator(=) integer(0)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(MainWin)operator(.)ident(GotoKey)operator(()ident(UntilLastChar)operator(()ident(Node)operator(.)ident(Text)operator(,) charoperator(\))operator(\)) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(SfAsHexCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(SfAsHexCB) reserved(do) reserved(begin) - ident(SfIgnoreCaseCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) - ident(SfWildCardsCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(Copy1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) -reserved(begin) - ident(Node) operator(:=) ident(ListTV)operator(.)ident(Selected)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(Node)operator(.)ident(Text)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(SfIgnoreCaseCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(SfUseLocalesCB)operator(.)ident(Enabled) operator(:=) ident(SfIgnoreCaseCB)operator(.)ident(Checked)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(ImageFile)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Caption) operator(:=) string operator(+) ident(RegMoleVersion) operator(+) - stringoperator(;) - - ident(ImageFile) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) - reserved(if) ident(FileExists)operator(()ident(ImageFile)operator(\)) reserved(then) - ident(MoleLogoI)operator(.)ident(Picture)operator(.)ident(LoadFromFile)operator(()ident(ImageFile)operator(\))operator(;) - - ident(Width) operator(:=) ident(Screen)operator(.)ident(WorkAreaWidth) operator(-) integer(100)operator(;) - - ident(CloseFindPrefP)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(Top) operator(:=) ident(Screen)operator(.)ident(WorkAreaHeight) operator(-) integer(450)operator(;) - ident(Height) operator(:=) ident(Screen)operator(.)ident(WorkAreaHeight) operator(-) ident(Top)operator(;) - ident(Left) operator(:=) operator(()ident(Screen)operator(.)ident(WorkAreaWidth) operator(-) ident(Width)operator(\)) reserved(div) integer(2)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFindWin)operator(.)ident(SfTypesCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(TypeRangeE)operator(.)ident(Enabled) operator(:=) ident(SfTypesCB)operator(.)ident(Checked)operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(Plutoconst)operator(;) - -reserved(interface) - -reserved(uses) ident(ComCtrls)operator(,) ident(Classes)operator(,) ident(XReg)operator(,) ident(UniKey)operator(,) ident(YTools)operator(;) - -reserved(var) - ident(Started)operator(:) ident(Boolean) operator(=) ident(False)operator(;) - ident(MurphyMode)operator(:) ident(Boolean) operator(=) ident(False)operator(;) - ident(PlutoKey)operator(:) ident(TUniKey)operator(;) - -reserved(const) - ident(Version) operator(=) stringoperator(;) - ident(Overnight) operator(=) ident(True)operator(;) - ident(Codename) operator(=) stringoperator(;) - comment(//Generation.Version-Release-Beta) - comment(// GG.VVRRBB) - ident(VersionNum)operator(:) ident(Double) operator(=) float(1.600000)operator(;) - comment(//Must be Double!) - -reserved(const) - ident(iconKey) operator(=) integer(0)operator(;) - - ident(iconFirstHKEY) operator(=) integer(2)operator(;) - ident(iconHKLM) operator(=) ident(iconFirstHKEY)operator(;) - ident(iconHKU) operator(=) ident(iconFirstHKEY) operator(+) integer(2)operator(;) - - ident(iconFirstShortcut) operator(=) ident(iconFirstHKEY) operator(+) integer(4)operator(;) - ident(iconHKCC) operator(=) ident(iconFirstShortcut)operator(;) - ident(iconHKCU) operator(=) ident(iconFirstShortcut) operator(+) integer(2)operator(;) - ident(iconHKCR) operator(=) ident(iconFirstShortcut) operator(+) integer(4)operator(;) - ident(iconHKDD) operator(=) ident(iconFirstShortcut) operator(+) integer(6)operator(;) - ident(iconHKPD) operator(=) ident(iconFirstShortcut) operator(+) integer(8)operator(;) - ident(iconHKWM) operator(=) ident(iconFirstShortcut) operator(+) integer(10)operator(;) - ident(iconHKWU) operator(=) ident(iconFirstShortcut) operator(+) integer(12)operator(;) - ident(iconShortcut) operator(=) ident(iconFirstShortcut) operator(+) integer(14)operator(;) - ident(nHKeyIcons) operator(=) integer(16)operator(;) - - ident(iconFirstType) operator(=) ident(iconFirstShortcut) operator(+) ident(nHKeyIcons)operator(;) - ident(iconNone) operator(=) ident(iconFirstType) operator(+) integer(0)operator(;) - ident(iconString) operator(=) ident(iconFirstType) operator(+) integer(1)operator(;) - ident(iconExpandString) operator(=)ident(iconFirstType) operator(+) integer(2)operator(;) - ident(iconBinary) operator(=) ident(iconFirstType) operator(+) integer(3)operator(;) - ident(iconCardinal) operator(=) ident(iconFirstType) operator(+) integer(4)operator(;) - ident(iconCardBigEndian)operator(=)ident(iconFirstType) operator(+) integer(5)operator(;) - ident(iconLink) operator(=) ident(iconFirstType) operator(+) integer(6)operator(;) - ident(iconMultiString) operator(=) ident(iconFirstType) operator(+) integer(7)operator(;) - ident(iconResList) operator(=) ident(iconFirstType) operator(+) integer(8)operator(;) - ident(iconFullResDesc) operator(=) ident(iconFirstType) operator(+) integer(9)operator(;) - ident(iconResReqList) operator(=) ident(iconFirstType) operator(+) integer(10)operator(;) - ident(iconUnknownType) operator(=) ident(iconFirstType) operator(+) integer(11)operator(;) - ident(nTypeIcons) operator(=) integer(12)operator(;) - - ident(iconFirstValue) operator(=) ident(iconFirstType) operator(+) ident(nTypeIcons)operator(;) - ident(iconValueElse) operator(=) ident(iconFirstValue)operator(;) - ident(iconValueEdit) operator(=) ident(iconFirstValue) operator(+) integer(1)operator(;) - ident(iconValueEditBinary) operator(=) ident(iconFirstValue) operator(+) integer(2)operator(;) - ident(iconValueZeromize) operator(=) ident(iconFirstValue) operator(+) integer(3)operator(;) - ident(iconValueDublicate) operator(=) ident(iconFirstValue) operator(+) integer(4)operator(;) - ident(iconMainValue) operator(=) ident(iconFirstValue) operator(+) integer(5)operator(;) - ident(iconTakeAsMainValue) operator(=) ident(iconFirstValue) operator(+) integer(6)operator(;) - ident(nValueIcons) operator(=) integer(7)operator(;) - - ident(iconFirstKey) operator(=) ident(iconFirstValue) operator(+) ident(nValueIcons)operator(;) - ident(iconKeyInfos) operator(=) ident(iconFirstKey)operator(;) - ident(iconSubKey) operator(=) ident(iconFirstKey) operator(+) integer(1)operator(;) - ident(iconKeyDublicate) operator(=) ident(iconFirstKey) operator(+) integer(2)operator(;) - ident(iconKeyFind) operator(=) ident(iconFirstKey) operator(+) integer(3)operator(;) - ident(iconKeyTrace) operator(=) ident(iconFirstKey) operator(+) integer(4)operator(;) - ident(nKeyIcons) operator(=) integer(5)operator(;) - - ident(iconFirstContextMenues) operator(=) ident(iconFirstKey) operator(+) ident(nKeyIcons)operator(;) - ident(iconRename) operator(=) ident(iconFirstContextMenues)operator(;) - ident(iconDelete) operator(=) ident(iconFirstContextMenues) operator(+) integer(1)operator(;) - ident(nContextMenuesIcon) operator(=) integer(2)operator(;) - - ident(iconFirstIni) operator(=) ident(iconFirstContextMenues) operator(+) ident(nContextMenuesIcon)operator(;) - ident(iconIniSection) operator(=) ident(iconFirstIni)operator(;) - ident(nIniIcons) operator(=) integer(1)operator(;) - - ident(iconFirstHost) operator(=) ident(iconFirstIni) operator(+) ident(nIniIcons)operator(;) - ident(iconHostReg) operator(=) ident(iconFirstHost)operator(;) - ident(iconHostIni) operator(=) ident(iconFirstHost) operator(+) integer(1)operator(;) - ident(iconHostUni) operator(=) ident(iconFirstHost) operator(+) integer(2)operator(;) - ident(iconHostUni2) operator(=) ident(iconFirstHost) operator(+) integer(3)operator(;) - ident(nHostIcons) operator(=) integer(4)operator(;) - - ident(iconFirstOther) operator(=) ident(iconFirstHost) operator(+) ident(nHostIcons)operator(;) - - ident(iconSortArrowAsc) operator(=) ident(iconFirstOther) operator(+) integer(0)operator(;) - ident(iconSortArrowDesc) operator(=) ident(iconFirstOther) operator(+) integer(1)operator(;) - ident(iconKeyMiddle) operator(=) ident(iconFirstOther) operator(+) integer(2)operator(;) - ident(iconLock) operator(=) ident(iconFirstOther) operator(+) integer(3)operator(;) - - comment(//iconDefect = iconFirstOther;) - - comment({ WorkWin.ChangeImages }) - ident(iconFirstChange) operator(=) integer(0)operator(;) - ident(iconCKeyPlus) operator(=) ident(iconFirstChange)operator(;) - ident(iconCKeyMinus) operator(=) ident(iconFirstChange) operator(+) integer(1)operator(;) - ident(iconCValuePlus) operator(=) ident(iconFirstChange) operator(+) integer(2)operator(;) - ident(iconCValueMinus) operator(=) ident(iconFirstChange) operator(+) integer(3)operator(;) - ident(iconCContext) operator(=) ident(iconFirstChange) operator(+) integer(4)operator(;) - ident(iconOldContext) operator(=) ident(iconFirstChange) operator(+) integer(5)operator(;) - ident(iconNewContext) operator(=) ident(iconFirstChange) operator(+) integer(6)operator(;) - ident(iconGroup) operator(=) ident(iconFirstChange) operator(+) integer(7)operator(;) - ident(iconGroupBlinking) operator(=) ident(iconFirstChange) operator(+) integer(8)operator(;) - ident(nChangeIcons) operator(=) integer(7)operator(;) - - ident(DefaultValueFlag) operator(=) ident(Pointer)operator(()integer(1)operator(\))operator(;) - ident(MultiEditFlag) operator(=) ident(Pointer)operator(()integer(2)operator(\))operator(;) - - ident(NoValueCaption) operator(=) stringoperator(;) - - ident(EditControlFlag) operator(=) integer(100)operator(;) - - ident(MaxPreviewLen) operator(=) integer(255)operator(;) - ident(RegMaxDataSize) operator(=) hex($FFFF)operator(;) comment(//64 KB) - -reserved(const) - ident(BoolStrFileName) operator(=) stringoperator(;) - ident(ShortcutsFileName) operator(=) stringoperator(;) - ident(StandardShortcutsFileName) operator(=) stringoperator(;) - ident(SisyFilterFileName) operator(=) stringoperator(;) - - ident(clDarkGray) operator(=) hex($00404040)operator(;) - ident(clBrightRed) operator(=) hex($00BBBBFF)operator(;) - ident(clVeryBrightRed) operator(=) hex($00DDDDFF)operator(;) - ident(clBrightBlue) operator(=) hex($00FFBBBB)operator(;) - ident(clBrightGreen) operator(=) hex($00BBFFBB)operator(;) - ident(clCyan) operator(=) hex($00FFFF44)operator(;) - ident(clBrightCyan) operator(=) hex($00FFFFBB)operator(;) - ident(clVeryBrightCyan) operator(=) hex($00FFFFDD)operator(;) - ident(clBrightYellow) operator(=) hex($00BBFFFF)operator(;) - ident(clVeryBrightYellow) operator(=) hex($00DDFFFF)operator(;) - ident(clBrightPurple) operator(=) hex($00FFBBFF)operator(;) - ident(clBrightSilver) operator(=) hex($00DDDDDD)operator(;) - ident(clGold) operator(=) hex($0055CCEE)operator(;) - - ident(clVeryBrightBlue) operator(=) hex($00FFDDDD)operator(;) - -reserved(type) - ident(TValueListColumn) operator(=) operator(()ident(vlcName)operator(,) ident(vlcSize)operator(,) ident(vlcType)operator(,) ident(vlcData)operator(\))operator(;) - -reserved(const) - ident(ValueListColumnRange) operator(=) operator([)ident(Low)operator(()ident(TValueListColumn)operator(\))operator(..)ident(High)operator(()ident(TValueListColumn)operator(\))operator(])operator(;) - -reserved(type) - ident(TSearchVar) operator(=) operator(()ident(sfKeys)operator(,) ident(sfValueNames)operator(,) ident(sfValueData)operator(,) - ident(sfAsHex)operator(,) ident(sfAsDWord)operator(,) - ident(sfWildCards)operator(,) ident(sfParts)operator(,) ident(sfIgnoreCase)operator(,) ident(SfUseLocales)operator(,) - ident(sfHKU)operator(,) ident(sfHKLM)operator(,) ident(sfHKDD)operator(,)comment(// sfCLSID, sfInterface,) - ident(sfString)operator(,) ident(sfDWord)operator(,) ident(sfOtherTypes)operator(,) ident(sfSpecialTypes)operator(\))operator(;) - - ident(TSearchOptions) operator(=) reserved(set) reserved(of) ident(TSearchVar)operator(;) - - comment(//be carefull: used in with!) - ident(TKeyShortcut) operator(=) reserved(record) - ident(Alias)operator(:) reserved(string)operator(;) - ident(RealPath)operator(:) reserved(string)operator(;) - ident(Node)operator(:) ident(TTreeNode)operator(;) - reserved(end)operator(;) - ident(PKeyShortcut) operator(=) operator(^)ident(TKeyShortcut)operator(;) - ident(TShortcutA) operator(=) reserved(array) reserved(of) ident(TKeyShortcut)operator(;) - - ident(TOpenNode) operator(=) reserved(function) operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(Boolean)operator(;) - ident(TCheckNode) operator(=) reserved(procedure) operator(()ident(Node)operator(:) ident(TTreeNode)operator(;) ident(OnlyOnce)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(;) - - comment(//NodeInfo System) - ident(TNodeFlag) operator(=) operator(()ident(nfDefect)operator(,) ident(nfReadOnly)operator(,) ident(nfChecked)operator(,) - ident(nfCopy)operator(,) ident(nfCut)operator(,) ident(nfPaste)operator(\))operator(;) - ident(TNodeFlags) operator(=) reserved(set) reserved(of) ident(TNodeFlag)operator(;) - - ident(TUniHostType) operator(=) operator(()ident(uhNone)operator(,) - ident(uhReg)operator(,) ident(uhIni)operator(,) ident(uhRegFile)operator(,) - ident(uhUserShortcut)operator(,) ident(uhStandardShortcut)operator(,) ident(uhSystemShortcut)operator(\))operator(;) - ident(TUniHostTypes) operator(=) reserved(set) reserved(of) ident(TUniHostType)operator(;) - -reserved(const) - ident(uhShortcuts) operator(=) operator([)ident(uhUserShortcut)operator(,) ident(uhStandardShortcut)operator(,) ident(uhSystemShortcut)operator(])operator(;) - ident(uhNonSystemShortcuts) operator(=) operator([)ident(uhUserShortcut)operator(,) ident(uhStandardShortcut)operator(])operator(;) - - ident(NodeFlagStrings)operator(:) reserved(array)operator([)ident(TNodeFlag)operator(]) reserved(of) reserved(string) operator(=) operator(() - stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(\))operator(;) - - ident(HostTypeStrings)operator(:) reserved(array)operator([)ident(TUniHostType)operator(]) reserved(of) reserved(string) operator(=) operator(()stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(\))operator(;) - -reserved(type) - ident(TNodeInfo) operator(=) reserved(packed) reserved(class) - directive(public) - ident(HostType)operator(:) ident(TUniHostType)operator(;) - ident(Flags)operator(:) ident(TNodeFlags)operator(;) - reserved(constructor) ident(Create)operator(()ident(HostType)operator(:) ident(TUniHostType) operator(=) ident(uhNone)operator(;) ident(Flags)operator(:) ident(TNodeFlags) operator(=) operator([)operator(])operator(\))operator(;) - - reserved(procedure) ident(IncludeFlag)operator(()ident(Flag)operator(:) ident(TNodeFlag)operator(\))operator(;) - reserved(procedure) ident(ExcludeFlag)operator(()ident(Flag)operator(:) ident(TNodeFlag)operator(\))operator(;) - - reserved(function) ident(IsHost)operator(:) ident(Boolean)operator(;) - reserved(function) ident(IsShortcut)operator(:) ident(Boolean)operator(;) - - reserved(function) ident(ReadOnly)operator(:) ident(Boolean)operator(;) - reserved(function) ident(Checked)operator(:) ident(Boolean)operator(;) - reserved(function) ident(Defect)operator(:) ident(Boolean)operator(;) - reserved(end)operator(;) - -reserved(function) ident(NodeInfo)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(TNodeInfo)operator(;) -reserved(procedure) ident(ReportStatus)operator(()reserved(const) ident(s)operator(:) reserved(string)operator(\))operator(;) - -reserved(const) - ident(PlatformStrings)operator(:) reserved(array)operator([)integer(0)operator(..)integer(2)operator(]) reserved(of) reserved(string) operator(=) - operator(()stringoperator(,) stringoperator(,) stringoperator(\))operator(;) - -reserved(var) - ident(PlutoDir)operator(:) reserved(string) operator(=) stringoperator(;) - -reserved(implementation) - -reserved(uses) ident(SysUtils)operator(;) - -reserved(function) ident(NodeInfo)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(TNodeInfo)operator(;) -reserved(begin) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) reserved(begin) - ident(Result) operator(:=) reserved(nil)operator(;) - ident(Exit) reserved(end)operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(.)ident(Data)operator(\)) reserved(then) - ident(Node)operator(.)ident(Data) operator(:=) ident(TNodeInfo)operator(.)ident(Create)operator(;) - ident(Result) operator(:=) ident(TNodeInfo)operator(()ident(Node)operator(.)ident(Data)operator(\))operator(;) -reserved(end)operator(;) - -comment({ TNodeInfo }) - -reserved(constructor) ident(TNodeInfo)operator(.)ident(Create)operator(()ident(HostType)operator(:) ident(TUniHostType)operator(;) ident(Flags)operator(:) ident(TNodeFlags)operator(\))operator(;) -reserved(begin) - reserved(inherited) ident(Create)operator(;) - ident(Self)operator(.)ident(HostType) operator(:=) ident(HostType)operator(;) - ident(Self)operator(.)ident(Flags) operator(:=) ident(Flags)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TNodeInfo)operator(.)ident(Checked)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(nfChecked) reserved(in) ident(Flags)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TNodeInfo)operator(.)ident(ReadOnly)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(nfReadOnly) reserved(in) ident(Flags)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TNodeInfo)operator(.)ident(Defect)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(nfDefect) reserved(in) ident(Flags)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TNodeInfo)operator(.)ident(IncludeFlag)operator(()ident(Flag)operator(:) ident(TNodeFlag)operator(\))operator(;) -reserved(begin) - ident(Include)operator(()ident(Flags)operator(,) ident(Flag)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TNodeInfo)operator(.)ident(ExcludeFlag)operator(()ident(Flag)operator(:) ident(TNodeFlag)operator(\))operator(;) -reserved(begin) - ident(Exclude)operator(()ident(Flags)operator(,) ident(Flag)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(TNodeInfo)operator(.)ident(IsHost)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(HostType) operator(<>) ident(uhNone)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TNodeInfo)operator(.)ident(IsShortcut)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(HostType) reserved(in) ident(uhShortcuts)operator(;) -reserved(end)operator(;) - -reserved(function) ident(GetPlutoDir)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(LWPSlash)operator(()ident(GetParam)operator(()stringoperator(,) ident(MyDir)operator(\))operator(\))operator(;) - reserved(if) reserved(not) ident(DirectoryExists)operator(()ident(Result)operator(\)) reserved(then) reserved(begin) - ident(ReportStatus)operator(()string operator(+) ident(Result) operator(+) string setting to default (MyDir\).)delimiter(')>operator(\))operator(;) - ident(Result) operator(:=) ident(MyDir)operator(;) - reserved(end)operator(;) - ident(ReportStatus)operator(()string operator(+) ident(Result)operator(\))operator(;) -reserved(end)operator(;) - -reserved(var) - ident(ReportSL)operator(:) ident(TStringList)operator(;) - ident(ReportFileName)operator(:) reserved(string)operator(;) - -reserved(procedure) ident(ReportStatus)operator(()reserved(const) ident(s)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - ident(ReportSL)operator(.)ident(Add)operator(()ident(s)operator(\))operator(;) - reserved(try) - ident(ReportSL)operator(.)ident(SaveToFile)operator(()ident(ReportFileName)operator(\))operator(;) - reserved(except) reserved(end)operator(;) -reserved(end)operator(;) - -reserved(initialization) - ident(ReportFileName) operator(:=) ident(MyDir) operator(+) stringoperator(;) - ident(ReportSL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - ident(PlutoDir) operator(:=) ident(GetPlutoDir)operator(;) - -reserved(end)operator(.) -comment(//winampviscolor :) -reserved(unit) ident(plutomain)operator(;) -preprocessor({$DEFINE UNIKEY}) -preprocessor({$DEFINE CYCFS}) - -comment({=============================================================================== - - cYcnus.Pluto 1.57 Beta 14 - by Murphy - - ©2000-2003 by cYcnus - visit www.cYcnus.de - - murphy@cYcnus.de (Kornelius Kalnbach\) - - this programm is published under the terms of the GPL - -===============================================================================}) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) ident(Dialogs)operator(,) - ident(StdCtrls)operator(,) ident(ImgList)operator(,) ident(ComCtrls)operator(,) ident(ExtCtrls)operator(,) ident(Menus)operator(,) ident(Clipbrd)operator(,) ident(IniFiles)operator(,) - ident(ShellAPI)operator(,) ident(Grids)operator(,) - comment(//Components) - ident(NewPanels)operator(,) - comment(//Units) - ident(YTools)operator(,) ident(YTypes)operator(,) ident(UniKey)operator(,) ident(XReg)operator(,) - comment(//Pluto) - ident(Plutoconst)operator(,) - ident(SpyTH)operator(,) ident(SisyphusTH)operator(;) - -reserved(const) - ident(NoPreBlinkHint) operator(=) char(#1)operator(;) - -reserved(type) - ident(TMainWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) - ident(StatusBar)operator(:) ident(TStatusBar)operator(;) - ident(StatusBarPU)operator(:) ident(TPopupMenu)operator(;) - ident(CopyPath)operator(:) ident(TMenuItem)operator(;) - ident(InsertPath)operator(:) ident(TMenuItem)operator(;) - ident(ShowRealPathMI)operator(:) ident(TMenuItem)operator(;) - ident(PathP)operator(:) ident(TPanel)operator(;) - ident(N1)operator(:) ident(TMenuItem)operator(;) - ident(MainMenu1)operator(:) ident(TMainMenu)operator(;) - ident(Desktop1)operator(:) ident(TMenuItem)operator(;) - ident(Pluto1)operator(:) ident(TMenuItem)operator(;) - ident(RegEdit1)operator(:) ident(TMenuItem)operator(;) - ident(Free1)operator(:) ident(TMenuItem)operator(;) - ident(BigVal1)operator(:) ident(TMenuItem)operator(;) - ident(Hilfe1)operator(:) ident(TMenuItem)operator(;) - ident(History1)operator(:) ident(TMenuItem)operator(;) - ident(SplashScreen1)operator(:) ident(TMenuItem)operator(;) - ident(wwwcYcnusde1)operator(:) ident(TMenuItem)operator(;) - ident(Credits1)operator(:) ident(TMenuItem)operator(;) - ident(Optionen1)operator(:) ident(TMenuItem)operator(;) - ident(PrefMI)operator(:) ident(TMenuItem)operator(;) - ident(EditBoolStrMI)operator(:) ident(TMenuItem)operator(;) - ident(N4)operator(:) ident(TMenuItem)operator(;) - ident(ImageList1)operator(:) ident(TImageList)operator(;) - ident(Plutoini1)operator(:) ident(TMenuItem)operator(;) - ident(About1)operator(:) ident(TMenuItem)operator(;) - ident(kornycYcnusde1)operator(:) ident(TMenuItem)operator(;) - ident(ools1)operator(:) ident(TMenuItem)operator(;) - ident(NotePad1)operator(:) ident(TMenuItem)operator(;) - ident(RegEdit2)operator(:) ident(TMenuItem)operator(;) - ident(SysEdit1)operator(:) ident(TMenuItem)operator(;) - ident(WordPad1)operator(:) ident(TMenuItem)operator(;) - ident(N3)operator(:) ident(TMenuItem)operator(;) - ident(N5)operator(:) ident(TMenuItem)operator(;) - ident(Suchen1)operator(:) ident(TMenuItem)operator(;) - ident(Find1)operator(:) ident(TMenuItem)operator(;) - ident(File1)operator(:) ident(TMenuItem)operator(;) - ident(ExitPluto1)operator(:) ident(TMenuItem)operator(;) - ident(OpenProgramFolder1)operator(:) ident(TMenuItem)operator(;) - ident(N6)operator(:) ident(TMenuItem)operator(;) - ident(OpenWinDir1)operator(:) ident(TMenuItem)operator(;) - ident(HintBlinkT)operator(:) ident(TTimer)operator(;) - ident(FindCLSID1)operator(:) ident(TMenuItem)operator(;) - ident(Clipboard1)operator(:) ident(TMenuItem)operator(;) - ident(GotoCLSID1)operator(:) ident(TMenuItem)operator(;) - ident(CommandLineParameters1)operator(:) ident(TMenuItem)operator(;) - ident(plutocYcnusde1)operator(:) ident(TMenuItem)operator(;) - ident(N7)operator(:) ident(TMenuItem)operator(;) - ident(heinzcYcnusde1)operator(:) ident(TMenuItem)operator(;) - ident(kornycYcnusde2)operator(:) ident(TMenuItem)operator(;) - ident(N8)operator(:) ident(TMenuItem)operator(;) - ident(ExternalHexEditMI)operator(:) ident(TMenuItem)operator(;) - ident(Cleanup1)operator(:) ident(TMenuItem)operator(;) - ident(DeleteTempFolder1)operator(:) ident(TMenuItem)operator(;) - ident(Debug1)operator(:) ident(TMenuItem)operator(;) - ident(CurrentDir1)operator(:) ident(TMenuItem)operator(;) - ident(RepairPluto155bBug1)operator(:) ident(TMenuItem)operator(;) - ident(BackupRegistryscanreg1)operator(:) ident(TMenuItem)operator(;) - ident(Username1)operator(:) ident(TMenuItem)operator(;) - ident(SupportMI)operator(:) ident(TMenuItem)operator(;) - ident(MurphyMI)operator(:) ident(TMenuItem)operator(;) - ident(ToDoMI)operator(:) ident(TMenuItem)operator(;) - ident(Beta1)operator(:) ident(TMenuItem)operator(;) - ident(UniKeycYcnusde1)operator(:) ident(TMenuItem)operator(;) - ident(YToolscYcnusde1)operator(:) ident(TMenuItem)operator(;) - ident(YPanelscYcnusde1)operator(:) ident(TMenuItem)operator(;) - ident(Usedenginescomponents1)operator(:) ident(TMenuItem)operator(;) - ident(PrefToolscYcnusde1)operator(:) ident(TMenuItem)operator(;) - ident(BugReportsRequests1)operator(:) ident(TMenuItem)operator(;) - ident(murphycYcnusde1)operator(:) ident(TMenuItem)operator(;) - ident(Credits2)operator(:) ident(TMenuItem)operator(;) - ident(News1)operator(:) ident(TMenuItem)operator(;) - ident(cYcnus1)operator(:) ident(TMenuItem)operator(;) - ident(Contact1)operator(:) ident(TMenuItem)operator(;) - ident(N2)operator(:) ident(TMenuItem)operator(;) - ident(IjustwantCONTACT1)operator(:) ident(TMenuItem)operator(;) - ident(N9)operator(:) ident(TMenuItem)operator(;) - ident(AnotherPluto1)operator(:) ident(TMenuItem)operator(;) - ident(UniKeyDemoMI)operator(:) ident(TMenuItem)operator(;) - ident(Path1)operator(:) ident(TMenuItem)operator(;) - ident(RegisterPlugIns1)operator(:) ident(TMenuItem)operator(;) - ident(UniPluginOD)operator(:) ident(TOpenDialog)operator(;) - ident(SwapLM_CUB)operator(:) ident(TButton)operator(;) - ident(PathE)operator(:) ident(TEdit)operator(;) - ident(ShowLoadreport1)operator(:) ident(TMenuItem)operator(;) - ident(KillPluto1)operator(:) ident(TMenuItem)operator(;) - ident(ShowPlatform1)operator(:) ident(TMenuItem)operator(;) - ident(MSConfig1)operator(:) ident(TMenuItem)operator(;) - ident(TimetoRelaxMI)operator(:) ident(TMenuItem)operator(;) - ident(N10)operator(:) ident(TMenuItem)operator(;) - - reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\))operator(;) - reserved(procedure) ident(InsertPathClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(procedure) ident(StatusBarResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(StatusBarDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(StatusBarUpdate)operator(;) - reserved(procedure) ident(CopyPathClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(procedure) ident(SetStatus)operator(;) - reserved(procedure) ident(GotoKey)operator(()ident(Key)operator(:) reserved(string)operator(\))operator(;) - reserved(procedure) ident(FindCLSID)operator(;) - reserved(procedure) ident(GotoCLSID)operator(;) - reserved(procedure) ident(UserGotoKey)operator(;) - reserved(procedure) ident(ShowRealPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(PathEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(PathEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(PathEExit)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(procedure) ident(AppActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(PathEKeyUp)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(Pluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RegEdit1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(Free1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(BigVal1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SplashScreen1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(HistoryClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(Credits1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(function) ident(Greeting)operator(()ident(Name)operator(:) reserved(string) operator(=) ident(NoPreBlinkHint)operator(\))operator(:) reserved(string)operator(;) - reserved(procedure) ident(PrefMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(EditBoolStrMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormCloseQuery)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(CanClose)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(SisyTerminate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(OnSisyChange)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\))operator(;) - reserved(procedure) ident(OnSisyValuePlus)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\))operator(;) - reserved(procedure) ident(OnSisyValueMinus)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\))operator(;) - reserved(procedure) ident(OnSisyContextChange)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\))operator(;) - - reserved(procedure) ident(Plutoini1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RegEdit2Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SysEdit1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(NotePad1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(WordPad1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(OpenWinDir1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(OpenProgramFolder1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ExitPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(Find1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormPaint)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(procedure) ident(Load)operator(;) - reserved(procedure) ident(StatusBarDrawPanel)operator(()ident(StatusBar)operator(:) ident(TStatusBar)operator(;) - ident(Panel)operator(:) ident(TStatusPanel)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(\))operator(;) - reserved(procedure) ident(PathEKeyPress)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Char)operator(\))operator(;) - reserved(procedure) ident(HintBlinkTTimer)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FindCLSID1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(GotoCLSID1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CommandLineParameters1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(WebLinkMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(DeleteTempFolder1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CurrentDir1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RepairPluto155bBug1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(BackupRegistryscanreg1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SisyStarted)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(StopHintBlinking)operator(;) - reserved(procedure) ident(Username1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SupportMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ToDoMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(MailLinkMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(IjustwantCONTACT1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ExternalHexEditMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(AnotherPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(Path1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RegisterPlugIns1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SwapLM_CUBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ShowLoadreport1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(KillPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ShowPlatform1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(MSConfig1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(TimetoRelaxMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - directive(private) - ident(DoAutoComplete)operator(:) ident(Boolean)operator(;) - ident(MainWinLoaded)operator(:) ident(Boolean)operator(;) - ident(DontSavePrefs)operator(:) ident(Boolean)operator(;) - ident(PreBlinkHint)operator(:) reserved(string)operator(;) - reserved(end)operator(;) - -reserved(var) - ident(MainWin)operator(:) ident(TMainWin)operator(;) - - ident(StatusBar)operator(:) ident(TStatusBar)operator(;) - ident(MainReg)operator(:) ident(TXRegistry)operator(;) - - ident(SpyThread)operator(:) ident(TRegSpyThread)operator(;) - ident(Sisys)operator(:) ident(TList)operator(;) - -reserved(function) ident(TempDir)operator(:) reserved(string)operator(;) -reserved(function) ident(PlutoUniPath)operator(:) reserved(string)operator(;) -reserved(function) ident(PlutoIniFileName)operator(:) reserved(string)operator(;) - -reserved(function) ident(PathOfNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(CurKey)operator(()ident(AllowedShortcutTypes)operator(:) ident(TUniHostTypes) operator(=) operator([)operator(])operator(\))operator(:) ident(TRegPath)operator(;) - -reserved(procedure) ident(ArrangePlutoStyle)operator(;) -reserved(procedure) ident(ArrangeRegEdStyle)operator(;) -reserved(procedure) ident(ArrangeFreeStyle)operator(;) -reserved(procedure) ident(ArrangeBigValStyle)operator(;) - -reserved(procedure) ident(ActivateThis)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(procedure) ident(DeActivateThis)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - -reserved(procedure) ident(SwapFonts)operator(()ident(Sender)operator(:) ident(TWinControl)operator(\))operator(;) - -reserved(procedure) ident(AddHint)operator(()reserved(const) ident(Hint)operator(:) reserved(string)operator(;) ident(Blinking)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(;) -reserved(procedure) ident(AddToLastHint)operator(()ident(Appendix)operator(:) reserved(string)operator(\))operator(;) -reserved(procedure) ident(ChangeLastHint)operator(()ident(NewHint)operator(:) reserved(string)operator(\))operator(;) - -reserved(implementation) - -reserved(uses) - comment(//Forms) - ident(FindWinU)operator(,) ident(valuesU)operator(,) ident(TreeU)operator(,) ident(WorkU)operator(,) ident(splash)operator(,) ident(PrefU)operator(,) - comment(//Units) - ident(Clock)operator(,) ident(Start)operator(,) ident(keybrd)operator(,) ident(CompEx)operator(,) ident(Colors)operator(,) ident(FindAllThread)operator(,) - ident(PrefTools)operator(;) - -preprocessor({$R *.DFM}) - -reserved(var) - ident(SavedPlutoIniFileName)operator(:) reserved(string) operator(=) stringoperator(;) - -reserved(procedure) ident(AddHint)operator(()reserved(const) ident(Hint)operator(:) reserved(string)operator(;) ident(Blinking)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(WorkWin)operator(\)) reserved(then) - ident(WorkWin)operator(.)ident(AddAHint)operator(()ident(Hint)operator(\))operator(;) - - reserved(with) ident(MainWin) reserved(do) reserved(begin) - ident(StopHintBlinking)operator(;) - - reserved(if) ident(Blinking) reserved(then) reserved(begin) - ident(HintBlinkT)operator(.)ident(Enabled) operator(:=) ident(True)operator(;) - reserved(if) ident(PreBlinkHint) operator(=) ident(NoPreBlinkHint) reserved(then) - ident(PreBlinkHint) operator(:=) ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(])operator(.)ident(Text)operator(;) - ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(])operator(.)ident(Text) operator(:=) ident(WorkWin)operator(.)ident(LastHint)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(AddToLastHint)operator(()ident(Appendix)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - reserved(with) ident(WorkWin)operator(.)ident(HintLB)operator(.)ident(Items) reserved(do) reserved(begin) - reserved(if) ident(Count) operator(=) integer(0) reserved(then) - ident(Exit)operator(;) - - ident(Strings)operator([)ident(Count)operator(-)integer(1)operator(]) operator(:=) ident(Strings)operator([)ident(Count)operator(-)integer(1)operator(]) operator(+) ident(Appendix)operator(;) - reserved(end)operator(;) - ident(Application)operator(.)ident(ProcessMessages)operator(;) -comment(// Sleep(1000\);) -reserved(end)operator(;) - -reserved(procedure) ident(ChangeLastHint)operator(()ident(NewHint)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - reserved(with) ident(WorkWin)operator(.)ident(HintLB)operator(.)ident(Items) reserved(do) reserved(begin) - reserved(if) ident(Count) operator(=) integer(0) reserved(then) - ident(Exit)operator(;) - - ident(Strings)operator([)ident(Count)operator(-)integer(1)operator(]) operator(:=) ident(NewHint)operator(;) - reserved(end)operator(;) - ident(Application)operator(.)ident(ProcessMessages)operator(;) -comment(// Sleep(1000\);) -reserved(end)operator(;) - -reserved(function) ident(CurKey)operator(()ident(AllowedShortcutTypes)operator(:) ident(TUniHostTypes) operator(=) operator([)operator(])operator(\))operator(:) ident(TRegPath)operator(;) -reserved(var) - ident(s)operator(:) reserved(string)operator(;) - ident(Item)operator(:) ident(TListItem)operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(RegTV)operator(.)ident(Selected)operator(\)) reserved(then) reserved(begin) - ident(s) operator(:=) ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\))operator(;) - reserved(if) ident(AllowedShortcutTypes) operator(<>) operator([)operator(]) reserved(then) - ident(s) operator(:=) ident(TraceKey)operator(()ident(s)operator(,) ident(AllowedShortcutTypes)operator(\))operator(;) - ident(Result)operator(.)ident(Root) operator(:=) ident(ExRegRoot)operator(()ident(s)operator(\))operator(;) - ident(Result)operator(.)ident(Key) operator(:=) ident(ExRegKey)operator(()ident(s)operator(\))operator(;) - - ident(Item) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) - reserved(if) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) - ident(Result)operator(.)ident(Value) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\))operator(;) - ident(Result)operator(.)ident(ValueSet) operator(:=) ident(Assigned)operator(()ident(Item)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(PathOfNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) - ident(Result) operator(:=) ident(LWPSlash)operator(()ident(PathOfNode)operator(()ident(Node)operator(.)ident(Parent)operator(\))operator(\)) operator(+) ident(Node)operator(.)ident(Text) - reserved(else) - ident(Result) operator(:=) ident(Node)operator(.)ident(Text)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(AppActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(ActForm)operator(:) ident(TCustomForm)operator(;) - - reserved(procedure) ident(TryShow)operator(()ident(Win)operator(:) ident(TCustomForm)operator(\))operator(;) - reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Win)operator(\)) reserved(and) ident(Win)operator(.)ident(Visible) reserved(then) - ident(Win)operator(.)ident(Show)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(ActForm) operator(:=) ident(Screen)operator(.)ident(ActiveCustomForm)operator(;) comment(//LastActiveForm;) - ident(TryShow)operator(()ident(ValuesWin)operator(\))operator(;) - ident(TryShow)operator(()ident(WorkWin)operator(\))operator(;) - ident(TryShow)operator(()ident(TreeWin)operator(\))operator(;) - ident(TryShow)operator(()ident(FindWin)operator(\))operator(;) - ident(TryShow)operator(()ident(SplashWin)operator(\))operator(;) - ident(TryShow)operator(()ident(MainWin)operator(\))operator(;) - ident(TryShow)operator(()ident(ActForm)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(procedure) ident(InitHKEYString)operator(()reserved(var) ident(H)operator(:) ident(THKEYString)operator(;) reserved(const) ident(Long)operator(,) ident(Short)operator(:) reserved(string)operator(;) - ident(Handle)operator(:) ident(Integer) operator(=) integer(0)operator(;) ident(IsDefault)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(;) - reserved(begin) - ident(H)operator(.)ident(Long) operator(:=) ident(Long)operator(;) - ident(H)operator(.)ident(Short) operator(:=) ident(Short)operator(;) - ident(H)operator(.)ident(Handle) operator(:=) ident(Handle)operator(;) - ident(H)operator(.)ident(IsDefault) operator(:=) ident(IsDefault)operator(;) - reserved(end)operator(;) - -reserved(begin) -preprocessor({$IFDEF UNIKEY}) -preprocessor({$IFDEF CYCFS}) - ident(RegisterUniClass)operator(()stringoperator(\))operator(;) -preprocessor({$ENDIF}) -preprocessor({$ENDIF}) - - ident(Application)operator(.)ident(OnActivate) operator(:=) ident(AppActivate)operator(;) - ident(PlutoMain)operator(.)ident(StatusBar) operator(:=) ident(StatusBar)operator(;) - - comment(//Creating) - ident(MainReg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - - comment(//Initialize) - ident(Caption) operator(:=) string operator(+) ident(Version)operator(;) - ident(PreBlinkHint) operator(:=) ident(NoPreBlinkHint)operator(;) - - ident(SetLength)operator(()ident(HKEYStrings)operator(,) ident(Length)operator(()ident(HKEYStrings)operator(\)) operator(+) integer(2)operator(\))operator(;) - ident(InitHKEYString)operator(()ident(HKEYStrings)operator([)ident(LastDefaultHKEYString) operator(+) integer(1)operator(])operator(,) - stringoperator(,) stringoperator(\))operator(;) - - ident(InitHKEYString)operator(()ident(HKEYStrings)operator([)ident(LastDefaultHKEYString) operator(+) integer(2)operator(])operator(,) - stringoperator(,) stringoperator(\))operator(;) - - ident(Application)operator(.)ident(HintHidePause) operator(:=) operator(-)integer(1)operator(;) comment(//that's approximately 136 years :D) - - ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(])operator(.)ident(Width) operator(:=) ident(Screen)operator(.)ident(Width) reserved(div) integer(6)operator(;) - - ident(MurphyMI)operator(.)ident(Visible) operator(:=) ident(MurphyMode)operator(;) - -preprocessor({$IFDEF UNIKEY}) - ident(UniPluginOD)operator(.)ident(InitialDir) operator(:=) ident(MyDir)operator(;) -preprocessor({$ELSE}) - ident(UniKeyDemoMI)operator(.)ident(Visible) operator(:=) ident(False)operator(;) -preprocessor({$ENDIF}) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(GotoKey)operator(()ident(Key)operator(:) reserved(string)operator(\))operator(;) -reserved(var) - ident(Full)operator(:) ident(TregPath)operator(;) - ident(Node)operator(:) ident(TTreeNode)operator(;) - ident(keySA)operator(:) ident(TStrA)operator(;) - ident(i)operator(:) ident(integer)operator(;) - - reserved(function) ident(NodeOfRoot)operator(()ident(Root)operator(:) reserved(string)operator(\))operator(:) ident(TTreeNode)operator(;) - reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - reserved(begin) - ident(Result) operator(:=) reserved(nil)operator(;) - ident(Root) operator(:=) ident(LongHKEY)operator(()ident(Root)operator(\))operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(RootNodes)operator(.)ident(Count)operator(-)integer(1) reserved(do) - reserved(if) ident(SameText)operator(()ident(TTreeNode)operator(()ident(RootNodes)operator([)ident(i)operator(])operator(\))operator(.)ident(Text)operator(,) ident(Root)operator(\)) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(TTreeNode)operator(()ident(RootNodes)operator([)ident(i)operator(])operator(\))operator(;) - ident(Break)operator(;) reserved(end)operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Shortcuts)operator(\)) reserved(do) - reserved(if) ident(SameText)operator(()ident(Shortcuts)operator([)ident(i)operator(])operator(.)ident(Alias)operator(,) ident(Full)operator(.)ident(Root)operator(\)) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(Shortcuts)operator([)ident(i)operator(])operator(.)ident(Node)operator(;) - ident(Break)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(keySA) operator(:=) reserved(nil)operator(;) - - comment(//Get FullPath of the Key) - ident(Key) operator(:=) ident(TrimLeft)operator(()ident(Key)operator(\))operator(;) - reserved(if) ident(TextAtPos)operator(()ident(Key)operator(,) integer(1)operator(,) stringoperator(\)) reserved(then) - ident(Key) operator(:=) ident(TrimLeft)operator(()ident(FromChar)operator(()ident(Key)operator(,) charoperator(\))operator(\))operator(;) - ident(Key) operator(:=) ident(UnQuote)operator(()ident(Key)operator(\))operator(;) - - ident(Full) operator(:=) ident(RegPathOfStr)operator(()ident(Key)operator(\))operator(;) - reserved(if) ident(Trim)operator(()ident(Full)operator(.)ident(Root)operator(\)) operator(=) string reserved(then) reserved(begin) - ident(AddHint)operator(()stringoperator(,) ident(True)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - comment(//Get Root Node) - ident(Node) operator(:=) ident(NodeOfRoot)operator(()ident(Full)operator(.)ident(Root)operator(\))operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) reserved(begin) - reserved(if) reserved(not) ident(PathE)operator(.)ident(Focused) reserved(then) - ident(AddHint)operator(()string operator(+) ident(EOL) operator(+) ident(Key)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - comment(//Create an array of all SubKeys) - ident(keySA) operator(:=) ident(Split)operator(()ident(Full)operator(.)ident(Key)operator(,) charoperator(\))operator(;) - - comment(//Avoid SmartExpand) - ident(TreeWin)operator(.)ident(DoSmartExpand) operator(:=) ident(False)operator(;) reserved(begin) - - comment(//Open all SubKeys) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(keySA)operator(\)) reserved(do) reserved(begin) - comment(//Open the Node if neccessary) - reserved(if) reserved(not) ident(Node)operator(.)ident(Expanded) reserved(then) reserved(begin) - reserved(if) reserved(not) ident(Node)operator(.)ident(Selected) reserved(then) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(;) - ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\))operator(;) - comment(//TreeWin.RegTVChange(Self, Node\);) - ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\))operator(;) - reserved(end)operator(;) - - comment(//Get Node of the SubKey) - ident(Node) operator(:=) ident(FindNodeText)operator(()ident(Node)operator(,) ident(keySA)operator([)ident(i)operator(])operator(\))operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) reserved(begin) - reserved(if) reserved(not) ident(PathE)operator(.)ident(Focused) reserved(then) - ident(AddHint)operator(()string operator(+) ident(KeySA)operator([)ident(i)operator(])operator(,) ident(True)operator(\))operator(;) - ident(Exit)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(end)operator(;) ident(TreeWin)operator(.)ident(DoSmartExpand) operator(:=) ident(True)operator(;) - - reserved(if) ident(Node) operator(<>) ident(RegTV)operator(.)ident(Selected) reserved(then) reserved(begin) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(;) - ident(TreeWin)operator(.)ident(RegTVChange)operator(()ident(Self)operator(,) ident(Node)operator(\))operator(;) - reserved(end)operator(;) - - ident(Application)operator(.)ident(ProcessMessages)operator(;) - - reserved(if) ident(Full)operator(.)ident(ValueSet) reserved(then) - ident(ValuesWin)operator(.)ident(FocusItem)operator(()ident(Full)operator(.)ident(Value)operator(,) reserved(not) operator(()ident(Active) reserved(and) ident(PathE)operator(.)ident(Focused)operator(\))operator(\)) - reserved(else) reserved(begin) - reserved(if) reserved(not) operator(()ident(Active) reserved(and) ident(PathE)operator(.)ident(Focused)operator(\)) reserved(then) comment(//if not user is currently editing the path) - ident(TreeWin)operator(.)ident(FocusControl)operator(()ident(RegTV)operator(\))operator(;) - - reserved(if) ident(LastChar)operator(()ident(Full)operator(.)ident(Key)operator(\)) operator(=) char reserved(then) - ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(SwapFonts)operator(()ident(Sender)operator(:) ident(TWinControl)operator(\))operator(;) - - reserved(function) ident(OtherFont)operator(()ident(N)operator(:) ident(TFontName)operator(\))operator(:) ident(TFontName)operator(;) - reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(if) ident(N) operator(=) ident(Result) reserved(then) - ident(Result) operator(:=) stringoperator(;) - reserved(end)operator(;) - -reserved(begin) - ident(TEdit)operator(()ident(Sender)operator(\))operator(.)ident(Font)operator(.)ident(Name) operator(:=) ident(OtherFont)operator(()ident(TTreeView)operator(()ident(Sender)operator(\))operator(.)ident(Font)operator(.)ident(Name)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(ActivateThis)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Sender)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(with) ident(TEdit)operator(()ident(Sender)operator(\)) reserved(do) reserved(begin) - reserved(if) ident(Tag) operator(<>) ident(EditControlFlag) reserved(then) - ident(Exit)operator(;) - ident(Color) operator(:=) ident(RealColor)operator(()ident(clVeryBrightBlue)operator(\))operator(;) - ident(Font)operator(.)ident(Color) operator(:=) ident(clBlack)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(DeActivateThis)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Sender)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(with) ident(TEdit)operator(()ident(Sender)operator(\)) reserved(do) reserved(begin) - reserved(if) ident(Tag) operator(<>) ident(EditControlFlag) reserved(then) - ident(Exit)operator(;) - ident(Color) operator(:=) ident(RealColor)operator(()ident(clDarkGray)operator(\))operator(;) - ident(Font)operator(.)ident(Color) operator(:=) ident(clWhite)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(CreateSisyThreads)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(CreateSisyThread)operator(()reserved(const) ident(Name)operator(:) reserved(string)operator(;) reserved(const) ident(KeyName)operator(:) reserved(string)operator(;) - ident(Key)operator(:) ident(HKEY)operator(;) ident(StatusLabel)operator(:) ident(TLabel)operator(\))operator(;) - reserved(var) - ident(Sisy)operator(:) ident(TSisyThread)operator(;) - reserved(begin) - ident(ChangeLastHint)operator(()string operator(+) ident(Name) operator(+) stringoperator(\))operator(;) - ident(Sisy) operator(:=) ident(TSisyThread)operator(.)ident(CreateIt)operator(()ident(Name)operator(,) ident(KeyName)operator(,) ident(Key)operator(,) ident(StatusLabel)operator(,) ident(PlutoKey)operator(\))operator(;) - ident(Sisy)operator(.)ident(OnChange) operator(:=) ident(MainWin)operator(.)ident(OnSisyChange)operator(;) -comment(// Sisy.OnSpecialChange[cValuePlus] := MainWin.OnSisyValuePlus;) -comment(// Sisy.OnSpecialChange[cValueMinus] := MainWin.OnSisyValueMinus;) -comment(// Sisy.OnSpecialChange[cContextChange] := MainWin.OnSisyContextChange;) - ident(Sisys)operator(.)ident(Add)operator(()ident(Sisy)operator(\))operator(;) - ident(AddToLastHint)operator(()stringoperator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(AddHint)operator(()string operator(+) ident(SisyVersion) operator(+) stringoperator(\))operator(;) - - ident(Sisys) operator(:=) ident(TSisyList)operator(.)ident(Create)operator(;) - ident(WorkWin)operator(.)ident(LoadSisyFilter)operator(;) - - ident(CreateSisyThread)operator(()stringoperator(,) stringoperator(,) ident(HKU)operator(,) ident(WorkWin)operator(.)ident(SisyHKUL)operator(\))operator(;) - ident(CreateSisyThread)operator(()stringoperator(,) stringoperator(,) ident(HKLM)operator(,) ident(WorkWin)operator(.)ident(SisyHKLML)operator(\))operator(;) - - ident(ChangeLastHint)operator(()stringoperator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Sisys)operator(.)ident(Count)operator(-)integer(1) reserved(do) - reserved(with) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(i)operator(])operator(\)) reserved(do) reserved(begin) - reserved(if) ident(Name) operator(=) string reserved(then) - reserved(with) ident(WorkWin)operator(.)ident(SisyHKUCB) reserved(do) reserved(begin) - ident(Settings)operator(.)ident(KeyName) operator(:=) ident(StrOfUni)operator(()ident(Uni)operator(.)ident(Path)operator(\))operator(;) - ident(Settings)operator(.)ident(Load)operator(;) - ident(Settings)operator(.)ident(AutoSave) operator(:=) ident(True)operator(;) - reserved(if) ident(Checked) reserved(then) - ident(Resume)operator(;) - reserved(end) - reserved(else) reserved(if) ident(Name) operator(=) string reserved(then) - reserved(with) ident(WorkWin)operator(.)ident(SisyHKLMCB) reserved(do) reserved(begin) - ident(Settings)operator(.)ident(KeyName) operator(:=) ident(StrOfUni)operator(()ident(Uni)operator(.)ident(Path)operator(\))operator(;) - ident(Settings)operator(.)ident(Load)operator(;) - ident(Settings)operator(.)ident(AutoSave) operator(:=) ident(True)operator(;) - reserved(if) ident(Checked) reserved(then) - ident(Resume)operator(;) - reserved(end)operator(;) - ident(OnStarted) operator(:=) ident(MainWin)operator(.)ident(SisyStarted)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(CreateSpyThread)operator(;) -reserved(begin) - ident(AddHint)operator(()stringoperator(\))operator(;) - ident(SpyThread) operator(:=) ident(TRegSpyThread)operator(.)ident(CreateIt)operator(()ident(tpLowest)operator(\))operator(;) - ident(WorkWin)operator(.)ident(SpyDelayIEChange)operator(()ident(MainWin)operator(\))operator(;) - ident(WorkWin)operator(.)ident(SpyTestLClick)operator(()ident(MainWin)operator(\))operator(;) - ident(AddToLastHint)operator(()stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(ShowParams)operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) -reserved(begin) - reserved(if) ident(Switch)operator(()stringoperator(\)) reserved(then) reserved(begin) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - ident(GetParams)operator(()ident(SL)operator(\))operator(;) - ident(ShowMessage)operator(()ident(SL)operator(.)ident(Text)operator(\))operator(;) - ident(SL)operator(.)ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(GotoParamKey)operator(;) -reserved(var) - ident(s)operator(:) reserved(string)operator(;) -reserved(begin) - ident(s) operator(:=) ident(ParamStr)operator(()integer(1)operator(\))operator(;) - reserved(if) operator(()ident(s) operator(<>) stringoperator(\)) - reserved(and) operator(()ident(s)operator([)integer(1)operator(]) operator(<>) charoperator(\)) reserved(then) reserved(begin) comment(//Params have '-' as prefix) - ident(AddHint)operator(()string operator(+) ident(Quote)operator(()ident(s)operator(\)) operator(+) stringoperator(\))operator(;) - ident(MainWin)operator(.)ident(GotoKey)operator(()ident(s)operator(\))operator(;) - reserved(end) reserved(else) reserved(begin) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(RegTV)operator(.)ident(TopItem)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(Load)operator(;) -reserved(begin) - ident(TreeWin)operator(.)ident(Load)operator(;) - ident(WorkWin)operator(.)ident(LoadBoolStr)operator(;) - - ident(CreateSpyThread)operator(;) - ident(CreateSisyThreads)operator(;) - - ident(AddHint)operator(()ident(Greeting)operator(,) ident(True)operator(\))operator(;) - - ident(ShowParams)operator(;) - ident(GotoParamKey)operator(;) - - reserved(if) ident(Assigned)operator(()ident(SplashWin)operator(\)) reserved(and) ident(SplashWin)operator(.)ident(Visible) reserved(then) - ident(SplashWin)operator(.)ident(SetFocus)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(CopyPathClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(StatusBar)operator(.)ident(Panels)operator([)integer(1)operator(])operator(.)ident(Text)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) operator(()ident(ssAlt) reserved(in) ident(shift)operator(\)) reserved(and) operator(()ident(Key) operator(=) ident(VK_F4)operator(\)) reserved(then) reserved(begin) - ident(Key) operator(:=) integer(0)operator(;) - ident(Close)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(if) ident(ssCtrl) reserved(in) ident(Shift) reserved(then) - reserved(case) ident(Key) reserved(of) - ident(Byte)operator(()charoperator(\))operator(:) reserved(begin) - ident(MainPC)operator(.)ident(ActivePage) operator(:=) ident(WorkWin)operator(.)ident(WorkPage)operator(;) - reserved(if) ident(Assigned)operator(()ident(MainPC)operator(.)ident(ActivePage)operator(\)) reserved(then) - ident(WorkWin)operator(.)ident(FocusControl)operator(()ident(TWinControl)operator(()ident(ShowPC)operator(.)ident(ActivePage)operator(.)ident(Tag)operator(\))operator(\)) - reserved(end)operator(;) - - ident(Byte)operator(()charoperator(\))operator(:) ident(MainPC)operator(.)ident(ActivePage) operator(:=) ident(WorkWin)operator(.)ident(HintPage)operator(;) - - ident(Byte)operator(()charoperator(\))operator(:) ident(MainWin)operator(.)ident(FindCLSID)operator(;) - reserved(end)operator(;) - - reserved(if) ident(Shift) operator(=) operator([)operator(]) reserved(then) - reserved(case) ident(Key) reserved(of) - ident(VK_F6)operator(:) ident(TreeWin)operator(.)ident(FocusControl)operator(()ident(RegTV)operator(\))operator(;) - - ident(VK_F7)operator(:) reserved(with) ident(ValueList) reserved(do) reserved(begin) - ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\))operator(;) - reserved(if) operator(()ident(Selected) operator(=) reserved(nil)operator(\)) reserved(and) operator(()ident(Items)operator(.)ident(Count) operator(>) integer(0)operator(\)) reserved(then) reserved(begin) - ident(Selected) operator(:=) ident(Items)operator([)integer(0)operator(])operator(;) - ident(ItemFocused) operator(:=) ident(Selected)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - ident(VK_F8)operator(:) ident(WorkWin)operator(.)ident(FocusControl)operator(()ident(MainPC)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(Key) operator(=) ident(VK_SCROLL) reserved(then) reserved(begin) - ident(TreeWin)operator(.)ident(CheckRegTVHotTrack)operator(;) - ident(ValuesWin)operator(.)ident(CheckValueListHotTrack)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(StatusBarResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(StatusBar) reserved(do) - ident(Panels)operator([)integer(1)operator(])operator(.)ident(Width) operator(:=) - ident(Width) operator(-) operator(()ident(Panels)operator([)integer(0)operator(])operator(.)ident(Width) operator(+) ident(Panels)operator([)integer(2)operator(])operator(.)ident(Width) operator(+) ident(Panels)operator([)integer(3)operator(])operator(.)ident(Width)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(StatusBarDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ShowRealPathMIClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(InsertPathClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(GotoKey)operator(()ident(Clipboard)operator(.)ident(AsText)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(SetStatus)operator(;) -reserved(begin) - ident(StatusBarUpdate)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(StatusBarUpdate)operator(;) -reserved(var) - ident(Inf)operator(:) ident(TRegKeyInfo)operator(;) -reserved(begin) - ident(OpenCurKey)operator(;) - ident(MainReg)operator(.)ident(GetKeyInfo)operator(()ident(Inf)operator(\))operator(;) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - - ident(StatusBar)operator(.)ident(Panels)operator([)integer(2)operator(])operator(.)ident(Text) operator(:=) ident(StrNumerus)operator(()ident(Inf)operator(.)ident(NumSubKeys)operator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(;) - ident(StatusBar)operator(.)ident(Panels)operator([)integer(3)operator(])operator(.)ident(Text) operator(:=) ident(StrNumerus)operator(()ident(Inf)operator(.)ident(NumValues)operator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(;) - - reserved(if) ident(ShowRealPathMI)operator(.)ident(Checked) reserved(then) - ident(StatusBar)operator(.)ident(Panels)operator([)integer(1)operator(])operator(.)ident(Text) operator(:=) ident(StrOfRegPath)operator(()ident(CurKey)operator(()ident(uhShortcuts)operator(\))operator(\)) - reserved(else) - ident(StatusBar)operator(.)ident(Panels)operator([)integer(1)operator(])operator(.)ident(Text) operator(:=) ident(StrOfRegPath)operator(()ident(CurKey)operator(()ident(uhNonSystemShortcuts)operator(\))operator(\))operator(;) - - reserved(if) reserved(not) ident(PathE)operator(.)ident(Focused) reserved(then) - ident(PathE)operator(.)ident(Text) operator(:=) ident(StrOfRegPath)operator(()ident(CurKey)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(ShowRealPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ShowRealPathMI)operator(.)ident(Checked) operator(:=) reserved(not) ident(ShowRealPathMI)operator(.)ident(Checked)operator(;) - ident(StatusBarUpdate)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(PathEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(var) - ident(Pos)operator(:) ident(Integer)operator(;) - ident(s)operator(:) reserved(string)operator(;) -reserved(begin) - ident(DoAutoComplete) operator(:=) reserved(not) operator(()ident(Key) reserved(in) operator([)ident(VK_DELETE)operator(,) ident(VK_BACK)operator(,) ident(VK_ESCAPE)operator(])operator(\))operator(;) - - reserved(case) ident(Key) reserved(of) - ident(VK_BACK)operator(:) - reserved(begin) - ident(s) operator(:=) ident(PathE)operator(.)ident(Text)operator(;) - ident(Pos) operator(:=) ident(PathE)operator(.)ident(SelStart)operator(;) - - reserved(if) ident(ssCtrl) reserved(in) ident(Shift) reserved(then) - reserved(repeat) - ident(Dec)operator(()ident(Pos)operator(\))operator(;) - reserved(until) operator(()ident(Pos) operator(<) integer(1)operator(\)) reserved(or) operator(()ident(s)operator([)ident(Pos)operator(]) operator(=) charoperator(\)) - reserved(else) reserved(if) ident(PathE)operator(.)ident(SelLength) operator(=) integer(0) reserved(then) - ident(Exit)operator(;) - - ident(PathE)operator(.)ident(Text) operator(:=) ident(Copy)operator(()ident(s)operator(,) integer(1)operator(,) ident(Pos)operator(\))operator(;) - ident(PathE)operator(.)ident(SelStart) operator(:=) ident(Length)operator(()ident(s)operator(\))operator(;) - ident(Key) operator(:=) integer(0)operator(;) - ident(UserGotoKey)operator(;) - reserved(end)operator(;) - - ident(VK_ESCAPE)operator(:) - reserved(with) ident(PathE) reserved(do) reserved(begin) - reserved(if) ident(SelLength) operator(=) integer(0) reserved(then) - ident(Exit)operator(;) - ident(Text) operator(:=) ident(StrOfRegPath)operator(()ident(CurKey)operator(\))operator(;) - ident(SelStart) operator(:=) ident(Length)operator(()ident(Text)operator(\))operator(;) - reserved(end)operator(;) - - ident(VK_RETURN)operator(:) reserved(begin) - reserved(if) ident(CurKey)operator(.)ident(ValueSet) reserved(then) - ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Self)operator(\))operator(;) - ident(Key) operator(:=) integer(0)operator(;) - reserved(end)operator(;) - - ident(VK_RIGHT)operator(:) reserved(begin) - reserved(if) reserved(not) operator(()ident(ssCtrl) reserved(in) ident(Shift)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Key) operator(:=) integer(0)operator(;) - - ident(s) operator(:=) ident(PathE)operator(.)ident(Text)operator(;) - ident(Pos) operator(:=) ident(PathE)operator(.)ident(SelStart) operator(+) integer(1)operator(;) - reserved(repeat) - ident(Inc)operator(()ident(Pos)operator(\))operator(;) - reserved(until) operator(()ident(Pos) operator(>) ident(Length)operator(()ident(s)operator(\))operator(\)) reserved(or) operator(()ident(s)operator([)ident(Pos)operator(]) operator(=) charoperator(\))operator(;) - - ident(PathE)operator(.)ident(SelStart) operator(:=) ident(Pos) operator(-) integer(1)operator(;) - reserved(end)operator(;) - - ident(VK_LEFT)operator(:) reserved(begin) - reserved(if) reserved(not) operator(()ident(ssCtrl) reserved(in) ident(Shift)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(with) ident(PathE) reserved(do) reserved(begin) - ident(Key) operator(:=) integer(0)operator(;) - - ident(s) operator(:=) ident(Text)operator(;) - ident(Pos) operator(:=) ident(SelStart)operator(;) - reserved(repeat) - ident(Dec)operator(()ident(Pos)operator(\))operator(;) - reserved(until) operator(()ident(Pos) operator(<) integer(1)operator(\)) reserved(or) operator(()ident(s)operator([)ident(Pos)operator(]) operator(=) charoperator(\))operator(;) - - reserved(if) ident(Pos) operator(<) integer(1) reserved(then) - ident(Pos) operator(:=) integer(1)operator(;) - - ident(SelStart) operator(:=) ident(Pos) operator(-) integer(1)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(UserGotoKey)operator(;) -reserved(begin) - ident(GotoKey)operator(()ident(PathE)operator(.)ident(Text)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(PathEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Prefix)operator(,) ident(Suffix)operator(,) ident(Key)operator(,) ident(Path)operator(,) ident(Root)operator(:) reserved(string)operator(;) - ident(i)operator(,) ident(p)operator(,) ident(Len)operator(:) ident(Integer)operator(;) - ident(SL)operator(:) ident(TStringList)operator(;) - ident(CompleteKind)operator(:) operator(()ident(ckRoots)operator(,) ident(ckKeys)operator(,) ident(ckValues)operator(\))operator(;) - - reserved(procedure) ident(GetRootNames)operator(()ident(Strings)operator(:) ident(TStrings)operator(\))operator(;) - reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) - reserved(begin) - ident(SL)operator(.)ident(Clear)operator(;) - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(GetFirstNode)operator(;) - reserved(while) ident(Assigned)operator(()ident(Node)operator(\)) reserved(do) reserved(begin) - ident(SL)operator(.)ident(Add)operator(()ident(Node)operator(.)ident(Text)operator(\))operator(;) - ident(Node) operator(:=) ident(Node)operator(.)ident(GetNextSibling)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) reserved(not) ident(DoAutoComplete) reserved(then) - ident(Exit)operator(;) - - ident(Key) operator(:=) ident(PathE)operator(.)ident(Text)operator(;) - ident(Root) operator(:=) ident(TraceKey)operator(()ident(ExRegRoot)operator(()ident(Key)operator(\))operator(\))operator(;) - - reserved(if) reserved(not) ident(CharIn)operator(()ident(Key)operator(,) charoperator(\)) reserved(then) - ident(CompleteKind) operator(:=) ident(ckRoots) - reserved(else) reserved(if) ident(ExRegValueSet)operator(()ident(Key)operator(\)) reserved(then) - ident(CompleteKind) operator(:=) ident(ckValues) - reserved(else) - ident(CompleteKind) operator(:=) ident(ckKeys)operator(;) - - reserved(case) ident(CompleteKind) reserved(of) - ident(ckRoots)operator(:) reserved(begin) - ident(Prefix) operator(:=) stringoperator(;) - ident(Suffix) operator(:=) ident(Key)operator(;) - reserved(end)operator(;) - - ident(ckKeys)operator(:) reserved(begin) - ident(Path) operator(:=) ident(ExRegFullKey)operator(()ident(Key)operator(\))operator(;) - ident(Prefix) operator(:=) ident(UntilLastChar)operator(()ident(Path)operator(,) charoperator(\))operator(;) - ident(Suffix) operator(:=) ident(FromLastChar)operator(()ident(Path)operator(,) charoperator(\))operator(;) - reserved(end)operator(;) - - ident(ckValues)operator(:) reserved(begin) - ident(p) operator(:=) ident(Pos)operator(()stringoperator(,) ident(Key)operator(\))operator(;) - ident(Prefix) operator(:=) ident(Copy)operator(()ident(Key)operator(,) integer(1)operator(,) ident(p) operator(-) integer(1)operator(\))operator(;) - ident(Suffix) operator(:=) ident(Copy)operator(()ident(Key)operator(,) ident(p) operator(+) integer(2)operator(,) ident(Length)operator(()ident(Key)operator(\)) operator(-) ident(p) operator(-) integer(1)operator(\))operator(;) - reserved(end)operator(;) - - reserved(else) - reserved(end)operator(;) - - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - - reserved(if) ident(CompleteKind) reserved(in) operator([)ident(ckKeys)operator(,) ident(ckValues)operator(]) reserved(then) - reserved(with) ident(MainReg) reserved(do) reserved(begin) - ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Root)operator(\))operator(\))operator(;) - ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Root)operator(\))operator(\))operator(;) - ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Prefix)operator(\))operator(\))operator(;) - - reserved(if) ident(CompleteKind) operator(=) ident(ckValues) reserved(then) reserved(begin) - reserved(if) reserved(not) ident(HasValues) reserved(then) - ident(Exit)operator(;) - ident(GetValueNames)operator(()ident(SL)operator(\))operator(;) - reserved(end) reserved(else) reserved(if) ident(CompleteKind) operator(=) ident(ckKeys) reserved(then) reserved(begin) - reserved(if) reserved(not) ident(HasSubKeys) reserved(then) - ident(Exit)operator(;) - ident(GetKeyNames)operator(()ident(SL)operator(\))operator(;) - reserved(end)operator(;) - - ident(CloseKey)operator(;) - reserved(end) - reserved(else) reserved(begin) - ident(GetRootNames)operator(()ident(SL)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(Suffix) operator(=) string reserved(then) reserved(begin) - reserved(if) operator(()ident(SL)operator(.)ident(Count) operator(>) integer(0)operator(\)) reserved(and) reserved(not) ident(StrIn)operator(()ident(SL)operator(,) stringoperator(\)) reserved(then) - ident(Suffix) operator(:=) ident(SL)operator([)integer(0)operator(])operator(;) - reserved(end) reserved(else) reserved(begin) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) - reserved(if) ident(TextAtBegin)operator(()ident(SL)operator([)ident(i)operator(])operator(,) ident(Suffix)operator(\)) reserved(then) reserved(begin) - ident(Suffix) operator(:=) ident(SL)operator([)ident(i)operator(])operator(;) - ident(Break)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - - ident(Len) operator(:=) ident(Length)operator(()ident(PathE)operator(.)ident(Text)operator(\))operator(;) - - reserved(if) ident(CompleteKind) operator(=) ident(ckValues) reserved(then) - ident(Prefix) operator(:=) ident(Prefix) operator(+) string - reserved(else) reserved(if) ident(CompleteKind) operator(=) ident(ckKeys) reserved(then) - ident(Prefix) operator(:=) ident(Prefix) operator(+) charoperator(;) - - reserved(with) ident(PathE) reserved(do) reserved(begin) - ident(DoAutoComplete) operator(:=) ident(False)operator(;) comment(//Avoid Recursion) - ident(Text) operator(:=) ident(Prefix) operator(+) ident(Suffix)operator(;) - ident(DoAutoComplete) operator(:=) ident(True)operator(;) - - ident(SelStart) operator(:=) ident(Len)operator(;) - ident(SelLength) operator(:=) ident(Length)operator(()ident(Text)operator(\)) operator(-) ident(Len)operator(;) - reserved(end)operator(;) - - ident(SL)operator(.)ident(Free)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(PathEExit)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(DeActivateThis)operator(()ident(PathE)operator(\))operator(;) - ident(DoAutoComplete) operator(:=) ident(False)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(ArrangePlutoStyle)operator(;) -reserved(begin) - reserved(with) ident(ValuesWin) reserved(do) reserved(begin) - ident(Height) operator(:=) ident(MainWin)operator(.)ident(ClientHeight) reserved(div) integer(3)operator(;) - ident(Top) operator(:=) ident(MainWin)operator(.)ident(ClientHeight) operator(-) ident(Height) operator(-) integer(43)operator(;) - ident(Left) operator(:=) integer(0)operator(;) - ident(Width) operator(:=) ident(MainWin)operator(.)ident(ClientWidth) operator(-) integer(4)operator(;) - comment(//Align := alBottom;) - reserved(end)operator(;) - - reserved(with) ident(WorkWin) reserved(do) reserved(begin) - ident(Top) operator(:=) integer(0)operator(;) - ident(Width) operator(:=) ident(Max)operator(()ident(MainWin)operator(.)ident(ClientWidth) reserved(div) integer(3)operator(,) ident(WorkWin)operator(.)ident(Constraints)operator(.)ident(MinWidth)operator(\))operator(;) - ident(Left) operator(:=) ident(ValuesWin)operator(.)ident(Width) operator(-) ident(Width)operator(;) - ident(Height) operator(:=) ident(MainWin)operator(.)ident(ClientHeight) operator(-) integer(43) operator(-) ident(ValuesWin)operator(.)ident(Height)operator(;) - comment(//Align := alRight;) - reserved(end)operator(;) - - reserved(with) ident(TreeWin) reserved(do) reserved(begin) - ident(Top) operator(:=) integer(0)operator(;) - ident(Height) operator(:=) ident(WorkWin)operator(.)ident(Height)operator(;) - ident(Left) operator(:=) integer(0)operator(;) - ident(Width) operator(:=) ident(ValuesWin)operator(.)ident(Width) operator(-) ident(WorkWin)operator(.)ident(Width)operator(;) - reserved(end)operator(;) - - comment({TreeWin.Align := alNone; - WorkWin.Align := alNone; - ValuesWin.Align := alNone;}) -reserved(end)operator(;) - -reserved(procedure) ident(ArrangeFreeStyle)operator(;) -reserved(const) - ident(Space) operator(=) integer(10)operator(;) -reserved(begin) - reserved(with) ident(ValuesWin) reserved(do) reserved(begin) - ident(Height) operator(:=) ident(Screen)operator(.)ident(Height) reserved(div) integer(3)operator(;) - ident(Align) operator(:=) ident(alBottom)operator(;) - reserved(end)operator(;) - - reserved(with) ident(WorkWin) reserved(do) reserved(begin) - ident(Width) operator(:=) ident(Max)operator(()ident(Screen)operator(.)ident(WorkAreaWidth) reserved(div) integer(3)operator(,) ident(Constraints)operator(.)ident(MinWidth) operator(+) integer(2) operator(*) ident(Space)operator(\))operator(;) - ident(Align) operator(:=) ident(alRight)operator(;) - reserved(end)operator(;) - - reserved(with) ident(TreeWin) reserved(do) reserved(begin) - ident(Align) operator(:=) ident(alClient)operator(;) - reserved(end)operator(;) - - ident(TreeWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) - ident(WorkWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) - ident(ValuesWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) - - reserved(with) ident(ValuesWin) reserved(do) reserved(begin) - ident(Height) operator(:=) ident(Height) operator(-) integer(2) operator(*) ident(Space)operator(;) - ident(Width) operator(:=) ident(Width) operator(-) integer(2) operator(*) ident(Space)operator(;) - ident(Top) operator(:=) ident(Top) operator(+) ident(Space)operator(;) - ident(Left) operator(:=) ident(Left) operator(+) ident(Space)operator(;) - reserved(end)operator(;) - - reserved(with) ident(TreeWin) reserved(do) reserved(begin) - ident(Height) operator(:=) ident(Height) operator(-) integer(1) operator(*) ident(Space)operator(;) - ident(Width) operator(:=) ident(Width) operator(-) integer(1) operator(*) ident(Space)operator(;) - ident(Top) operator(:=) ident(Top) operator(+) ident(Space)operator(;) - ident(Left) operator(:=) ident(Left) operator(+) ident(Space)operator(;) - reserved(end)operator(;) - - reserved(with) ident(WorkWin) reserved(do) reserved(begin) - ident(Height) operator(:=) ident(Height) operator(-) integer(1) operator(*) ident(Space)operator(;) - ident(Width) operator(:=) ident(Width) operator(-) integer(2) operator(*) ident(Space)operator(;) - ident(Top) operator(:=) ident(Top) operator(+) ident(Space)operator(;) - ident(Left) operator(:=) ident(Left) operator(+) ident(Space)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(ArrangeBigValStyle)operator(;) -reserved(var) - ident(MinHeight)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(MinHeight) operator(:=) ident(WorkWin)operator(.)ident(Constraints)operator(.)ident(MinHeight) operator(+) - ident(MainWin)operator(.)ident(Constraints)operator(.)ident(MinHeight)operator(;) - - reserved(with) ident(ValuesWin) reserved(do) reserved(begin) - ident(Height) operator(:=) ident(Screen)operator(.)ident(WorkAreaHeight) operator(-) ident(Max)operator(()ident(Screen)operator(.)ident(Height) reserved(div) integer(3)operator(,) ident(MinHeight)operator(\))operator(;) - ident(Align) operator(:=) ident(alBottom)operator(;) - reserved(end)operator(;) - - reserved(with) ident(WorkWin) reserved(do) reserved(begin) - ident(Width) operator(:=) ident(Screen)operator(.)ident(WorkAreaWidth) reserved(div) integer(3)operator(;) - ident(Align) operator(:=) ident(alRight)operator(;) - reserved(end)operator(;) - - reserved(with) ident(TreeWin) reserved(do) reserved(begin) - ident(Align) operator(:=) ident(alClient)operator(;) - reserved(end)operator(;) - - ident(TreeWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) - ident(WorkWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) - ident(ValuesWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(ArrangeRegEdStyle)operator(;) -reserved(begin) - reserved(with) ident(TreeWin) reserved(do) reserved(begin) - ident(Width) operator(:=) ident(Screen)operator(.)ident(WorkAreaWidth) reserved(div) integer(4)operator(;) - ident(Align) operator(:=) ident(alLeft)operator(;) - reserved(end)operator(;) - - reserved(with) ident(ValuesWin) reserved(do) reserved(begin) - ident(Align) operator(:=) ident(alClient)operator(;) - ident(Align) operator(:=) ident(alNone)operator(;) - ident(Height) operator(:=) ident(Height) operator(-) ident(WorkWin)operator(.)ident(Constraints)operator(.)ident(MinHeight)operator(;) - reserved(end)operator(;) - - reserved(with) ident(WorkWin) reserved(do) reserved(begin) - ident(Top) operator(:=) ident(ValuesWin)operator(.)ident(Top) operator(+) ident(ValuesWin)operator(.)ident(Height)operator(;) - ident(Left) operator(:=) ident(ValuesWin)operator(.)ident(Left)operator(;) - ident(Height) operator(:=) ident(Constraints)operator(.)ident(MinHeight)operator(;) - ident(Width) operator(:=) ident(ValuesWin)operator(.)ident(Width)operator(;) - reserved(end)operator(;) - - ident(TreeWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(PathEKeyUp)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) operator(()ident(Key) reserved(in) operator([)ident(VK_DELETE)operator(,) ident(VK_BACK)operator(,) ident(VK_ESCAPE)operator(])operator(\)) reserved(then) - ident(UserGotoKey)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ActivateThis)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) - ident(ActivateThis)operator(()ident(ActiveControl)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) - ident(DeActivateThis)operator(()ident(ActiveControl)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(Pluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ArrangePlutoStyle)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(RegEdit1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ArrangeRegEdStyle)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(Free1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ArrangeFreeStyle)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(BigVal1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ArrangeBigValStyle)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(SplashScreen1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(SplashWin)operator(.)ident(Show)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(HistoryClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(NotePad)operator(()ident(PlutoDir) operator(+) stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(WebLinkMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(Browse)operator(()string operator(+) ident(TMenuItem)operator(()ident(Sender)operator(\))operator(.)ident(Caption)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(SupportMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(Browse)operator(()stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(Credits1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(FileName)operator(:) reserved(string)operator(;) -reserved(begin) - ident(FileName) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) - reserved(if) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(then) - ident(ExecFile)operator(()ident(FileName)operator(\)) - reserved(else) reserved(begin) - ident(FileName) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) - reserved(if) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(then) - ident(ExecFile)operator(()ident(FileName)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(GetCLSIDFromClipboard)operator(:) reserved(string)operator(;) -reserved(var) - ident(CLSID)operator(:) reserved(string)operator(;) -reserved(begin) - ident(CLSID) operator(:=) ident(BetweenChars)operator(()ident(Clipboard)operator(.)ident(AsText)operator(,) charoperator(,) charoperator(,) ident(True)operator(\))operator(;) - reserved(if) ident(CLSID) operator(=) string reserved(then) reserved(begin) - ident(Result) operator(:=) ident(Clipboard)operator(.)ident(AsText)operator(;) - ident(InputQuery)operator(()stringoperator(,) - string operator(+) ident(EOL) operator(+) - stringoperator(,) ident(Result)operator(\))operator(;) - ident(Exit)operator(;) reserved(end) reserved(else) - ident(Result) operator(:=) ident(CLSID)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(FindCLSID)operator(;) -reserved(var) - ident(CLSID)operator(,) ident(Desc)operator(:) reserved(string)operator(;) -reserved(begin) - ident(CLSID) operator(:=) ident(GetCLSIDFromClipboard)operator(;) - ident(Desc) operator(:=) ident(RegNameOfCLSID)operator(()ident(CLSID)operator(\))operator(;) - reserved(if) ident(Desc) operator(<>) string reserved(then) - ident(InputQuery)operator(()stringoperator(,) ident(CLSID)operator(,) ident(Desc)operator(\)) - reserved(else) - ident(ShowMessage)operator(()string operator(+) ident(CLSID) operator(+) charoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(GotoCLSID)operator(;) -reserved(var) - ident(CLSID)operator(,) ident(Desc)operator(:) reserved(string)operator(;) -reserved(begin) - ident(CLSID) operator(:=) ident(GetCLSIDFromClipboard)operator(;) - ident(Desc) operator(:=) ident(RegNameOfCLSID)operator(()ident(CLSID)operator(\))operator(;) - reserved(if) ident(Desc) operator(<>) string reserved(then) reserved(begin) - ident(GotoKey)operator(()string operator(+) ident(CLSID)operator(\))operator(;) - ident(TreeWin)operator(.)ident(FocusControl)operator(()ident(RegTV)operator(\))operator(;) - reserved(end) reserved(else) - ident(ShowMessage)operator(()string operator(+) ident(CLSID) operator(+) charoperator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(TMainWin)operator(.)ident(Greeting)operator(()ident(Name)operator(:) reserved(string) operator(=) ident(NoPreBlinkHint)operator(\))operator(:) reserved(string)operator(;) -reserved(const) - ident(Alias)operator(:) reserved(array)operator([)integer(0)operator(..)integer(4)operator(]) reserved(of) reserved(string) operator(=) - operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(;) - ident(RealNames)operator(:) reserved(array)operator([)integer(0)operator(..)integer(4)operator(]) reserved(of) reserved(string) operator(=) - operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(s)operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) ident(Name) operator(=) ident(NoPreBlinkHint) reserved(then) - ident(Name) operator(:=) ident(PrefWin)operator(.)ident(UserNameE)operator(.)ident(Text)operator(;) - - reserved(if) ident(Trim)operator(()ident(Name)operator(\)) operator(=) string reserved(then) - ident(s) operator(:=) string - reserved(else) reserved(if) ident(SameText)operator(()ident(Trim)operator(()ident(Name)operator(\))operator(,) stringoperator(\)) reserved(then) - ident(s) operator(:=) string - reserved(else) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) integer(4) reserved(do) - reserved(if) ident(SameText)operator(()ident(Name)operator(,) ident(Alias)operator([)ident(i)operator(])operator(\)) reserved(then) reserved(begin) - ident(s) operator(:=) string operator(+) ident(RealNames)operator([)ident(i)operator(]) operator(+) stringoperator(;) - ident(Break)operator(;) reserved(end) - reserved(else) reserved(if) ident(Length)operator(()ident(Name)operator(\)) operator(>) integer(20) reserved(then) - ident(s) operator(:=) string operator(+) ident(Name) operator(+) - string - reserved(else) - ident(s) operator(:=) string operator(+) ident(Name) operator(+) charoperator(;) - - ident(Result) operator(:=) ident(s)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(PrefMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(PrefWin)operator(.)ident(Show)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TempDir)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) - reserved(if) reserved(not) operator(()ident(DirectoryExists)operator(()ident(Result)operator(\)) reserved(or) ident(CreateDir)operator(()ident(Result)operator(\))operator(\)) reserved(then) - ident(Result) operator(:=) ident(PlutoDir)operator(;) -reserved(end)operator(;) - -reserved(function) ident(PlutoIniFileName)operator(:) reserved(string)operator(;) - - reserved(function) ident(Default)operator(:) reserved(string)operator(;) - reserved(begin) - ident(Result) operator(:=) ident(MyDir) operator(+) stringoperator(;) - reserved(end)operator(;) - -reserved(begin) - ident(Result) operator(:=) ident(SavedPlutoIniFileName)operator(;) - reserved(if) ident(Result) operator(<>) string reserved(then) - ident(Exit)operator(;) - -comment(// Result := Params.ReadString('ini', ''\);) - - reserved(if) ident(IsValidFileName)operator(()ident(Result)operator(\)) reserved(then) - ident(Result) operator(:=) ident(PlutoDir) operator(+) ident(Result) - reserved(else) - ident(Result) operator(:=) ident(Default)operator(;) - - ident(SavedPlutoIniFileName) operator(:=) ident(Result)operator(;) comment(//Faster in future calls) -reserved(end)operator(;) - -reserved(function) ident(PlutoUniPath)operator(:) reserved(string)operator(;) -reserved(begin) - comment(//Result := 'Reg: HKCU\\Software\\Pluto\\';) - ident(Result) operator(:=) string operator(+) ident(PlutoIniFileName) operator(+) string:)delimiter(')>operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(EditBoolStrMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(NotePad)operator(()ident(PlutoDir) operator(+) ident(BoolStrFileName)operator(\))operator(;) - ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) - stringoperator(\))operator(;) - ident(WorkWin)operator(.)ident(LoadBoolStr)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(SisyStarted)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -comment({var - NextSisyIndex: Integer; - NextSisy: TSisyThread; }) -reserved(begin) - comment({NextSisy := nil; - - with TSisyThread(Sender\) do begin - //AddHint(Format('%s started after %0.1f seconds', [Name, SecsPerRound]\), True\); - - with Sisys do begin - NextSisyIndex := IndexOf(Sender\) + 1; - if NextSisyIndex < Count then - NextSisy := Items[NextSisyIndex]; - end; - - if Assigned(NextSisy\) then - with NextSisy do - if not Started and Suspended then - Resume; - end; }) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(SisyTerminate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Sisys)operator(\)) reserved(then) - ident(Sisys)operator(.)ident(Delete)operator(()ident(Sisys)operator(.)ident(IndexOf)operator(()ident(Sender)operator(\))operator(\))operator(;) - ident(AddHint)operator(()string operator(+) ident(Quote)operator(()ident(TSisyThread)operator(()ident(Sender)operator(\))operator(.)ident(Name)operator(\)) operator(+) stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(FormCloseQuery)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(CanClose)operator(:) ident(Boolean)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(TerminateThread)operator(()ident(Thread)operator(:) ident(TThread)operator(;) ident(Name)operator(:) reserved(string)operator(\))operator(;) - reserved(const) - ident(ThreadTimeOut) operator(=) integer(3000)operator(;) - reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Thread)operator(\)) reserved(then) - reserved(with) ident(Thread) reserved(do) reserved(begin) - ident(Priority) operator(:=) ident(tpNormal)operator(;) - ident(Terminate)operator(;) - reserved(while) ident(Suspended) reserved(do) ident(Resume)operator(;) comment(// ensure running) - reserved(if) integer(0) operator(<>) ident(WaitForSingleObject)operator(()ident(Handle)operator(,) ident(ThreadTimeOut)operator(\)) reserved(then) reserved(begin) - ident(ShowMessage)operator(()string operator(+) ident(Name) operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - stringoperator(\))operator(;) - ident(Windows)operator(.)ident(TerminateThread)operator(()ident(Handle)operator(,) integer(0)operator(\))operator(;) - reserved(end) reserved(else) - ident(Thread)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(CanClose) operator(:=) ident(False)operator(;) - - reserved(try) - ident(AddHint)operator(()stringoperator(\))operator(;) - reserved(if) ident(Assigned)operator(()ident(Sisys)operator(\)) reserved(then) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Sisys)operator(.)ident(Count)operator(-)integer(1) reserved(do) - ident(TSisyThread)operator(()ident(Sisys)operator([)ident(i)operator(])operator(\))operator(.)ident(Suspend)operator(;) - ident(AddToLastHint)operator(()stringoperator(\))operator(;) - - ident(AddHint)operator(()stringoperator(\))operator(;) - ident(TerminateThread)operator(()ident(SpyThread)operator(,) stringoperator(\))operator(;) - ident(AddToLastHint)operator(()stringoperator(\))operator(;) - - ident(AddHint)operator(()stringoperator(\))operator(;) - reserved(if) ident(Assigned)operator(()ident(Sisys)operator(\)) reserved(then) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Sisys)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - ident(ChangeLastHint)operator(()string operator(+) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(i)operator(])operator(\))operator(.)ident(Name)operator(\))operator(;) - ident(TerminateThread)operator(()ident(TSisyThread)operator(()ident(Sisys)operator([)ident(i)operator(])operator(\))operator(,) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(i)operator(])operator(\))operator(.)ident(Name)operator(\))operator(;) - reserved(end)operator(;) - ident(ChangeLastHint)operator(()stringoperator(\))operator(;) - reserved(except) - reserved(with) ident(WorkWin)operator(.)ident(HintLB)operator(.)ident(Items) reserved(do) - ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(Strings)operator([)ident(Count) operator(-) integer(1)operator(])operator(\))operator(;) - ident(CanClose) operator(:=) ident(True)operator(;) - reserved(end)operator(;) - - ident(AddHint)operator(()stringoperator(\))operator(;) - ident(CanClose) operator(:=) ident(True)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\))operator(;) - - reserved(procedure) ident(TryClose)operator(()ident(Win)operator(:) ident(TCustomForm)operator(\))operator(;) - reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Win)operator(\)) reserved(and) ident(Win)operator(.)ident(Visible) reserved(then) - ident(Win)operator(.)ident(Close)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(MainReg)operator(.)ident(Free)operator(;) - - ident(Action) operator(:=) ident(caFree)operator(;) - - reserved(if) ident(DontSavePrefs) reserved(then) - ident(Exit)operator(;) - - ident(AddHint)operator(()stringoperator(\))operator(;) - - reserved(try) - ident(TryClose)operator(()ident(WorkWin)operator(\))operator(;) - ident(TryClose)operator(()ident(ValuesWin)operator(\))operator(;) - ident(TryClose)operator(()ident(TreeWin)operator(\))operator(;) - ident(TryClose)operator(()ident(FindWin)operator(\))operator(;) - ident(TryClose)operator(()ident(SplashWin)operator(\))operator(;) - ident(TryClose)operator(()ident(PrefWin)operator(\))operator(;) - reserved(except) - ident(DontSavePrefs) operator(:=) ident(True)operator(;) comment(//try again without pref saving) - reserved(end)operator(;) - - reserved(with) ident(PlutoKey)operator(.)ident(GetKey)operator(()stringoperator(\)) reserved(do) - reserved(try) - ident(WriteBool)operator(()stringoperator(,) ident(WindowState) operator(=) ident(wsMaximized)operator(\))operator(;) - reserved(if) ident(WindowState) operator(=) ident(wsNormal) reserved(then) reserved(begin) - ident(WriteInteger)operator(()stringoperator(,) ident(Left)operator(\))operator(;) - ident(WriteInteger)operator(()stringoperator(,) ident(Top)operator(\))operator(;) - ident(WriteInteger)operator(()stringoperator(,) ident(Width)operator(\))operator(;) - ident(WriteInteger)operator(()stringoperator(,) ident(Height)operator(\))operator(;) - reserved(end)operator(;) - reserved(finally) - ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(Plutoini1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(NotePad)operator(()ident(PlutoIniFileName)operator(\))operator(;) - ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) - string operator(+) ident(PlutoIniFileName) operator(+) charoperator(\))operator(;) - ident(PrefWin)operator(.)ident(PrefHost)operator(.)ident(Load)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(RegEdit2Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(RegEdit)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(SysEdit1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(SysEdit)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(NotePad1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(NotePad)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(WordPad1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(WordPad)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(OpenWinDir1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ExploreFolder)operator(()ident(WinDir)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(OpenProgramFolder1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ExploreFolder)operator(()ident(MyDir)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(ExitPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(Close)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(Find1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(FindWin)operator(.)ident(SfRootKeyRB)operator(.)ident(Checked) operator(:=) ident(True)operator(;) - ident(FindWin)operator(.)ident(Show)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(FormPaint)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Started) reserved(and) reserved(not) ident(MainWinLoaded) reserved(then) reserved(begin) - ident(MainWinLoaded) operator(:=) ident(True)operator(;) - ident(Load)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(StatusBarDrawPanel)operator(()ident(StatusBar)operator(:) ident(TStatusBar)operator(;) - ident(Panel)operator(:) ident(TStatusPanel)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(\))operator(;) -reserved(begin) - reserved(with) ident(StatusBar)operator(.)ident(Canvas) reserved(do) reserved(begin) - ident(Brush)operator(.)ident(Color) operator(:=) ident(clBlack)operator(;) - ident(FillRect)operator(()ident(Rect)operator(\))operator(;) - reserved(with) ident(Font) reserved(do) reserved(begin) - ident(Name) operator(:=) stringoperator(;) - ident(Style) operator(:=) operator([)operator(])operator(;) - reserved(case) ident(Panel)operator(.)ident(Index) reserved(of) - integer(0)operator(:) reserved(if) ident(HintBlinkT)operator(.)ident(Enabled) reserved(then) - ident(Color) operator(:=) ident(clBrightRed) - reserved(else) - ident(Color) operator(:=) ident(clBrightSilver)operator(;) - integer(1)operator(:) ident(Color) operator(:=) ident(clWhite)operator(;) - integer(2)operator(:) ident(Color) operator(:=) ident(clCyan)operator(;) - integer(3)operator(:) ident(Color) operator(:=) ident(clBrightPurple)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) ident(Panel)operator(.)ident(Alignment) operator(=) ident(taRightJustify) reserved(then) - ident(TextOut)operator(()ident(Rect)operator(.)ident(Right) operator(-) ident(TextWidth)operator(()ident(Panel)operator(.)ident(Text)operator(\))operator(,) ident(Rect)operator(.)ident(Top)operator(,) ident(Panel)operator(.)ident(Text)operator(\)) - reserved(else) - ident(TextOut)operator(()ident(Rect)operator(.)ident(Left)operator(,) ident(Rect)operator(.)ident(Top)operator(,) ident(Panel)operator(.)ident(Text)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(PathEKeyPress)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Char)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Key) operator(=) char(#127) reserved(then) comment(//Silly key management) - ident(Key) operator(:=) char(#0)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(HintBlinkTTimer)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(])operator(.)ident(Text) operator(:=) stringoperator(;) - ident(StopHintBlinking)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(StopHintBlinking)operator(;) -reserved(begin) - ident(HintBlinkT)operator(.)ident(Enabled) operator(:=) ident(False)operator(;) - ident(PreBlinkHint) operator(:=) ident(NoPreBlinkHint)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(FindCLSID1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(FindCLSID)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(GotoCLSID1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(GotoCLSID)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(CommandLineParameters1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(NotePad)operator(()ident(PlutoDir) operator(+) stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(DeleteTempFolder1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(mrYes) operator(=) ident(MessageDlg)operator(()string operator(+) ident(Quote)operator(()ident(TempDir) operator(+) string operator(+) ident(EOL)operator(,) charoperator(\)) operator(+) - stringoperator(,) ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) reserved(then) - ident(DeleteFiles)operator(()ident(TempDir) operator(+) stringoperator(,) ident(False)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(CurrentDir1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ShowMessage)operator(()string operator(+) ident(MyDir) operator(+) ident(EOL) operator(+) - string operator(+) ident(PlutoDir) operator(+) ident(EOL) operator(+) - string operator(+) ident(GetCurrentDir) operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(GetParams)operator(()ident(EOL)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(RepairPluto155bBug1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Msg)operator(:) reserved(string)operator(;) - ident(Reg)operator(:) ident(TXRegistry)operator(;) -reserved(begin) - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - - reserved(try) - ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKCU)operator(;) - ident(Reg)operator(.)ident(OpenKey)operator(()stringoperator(\))operator(;) - ident(Msg) operator(:=) stringoperator(;) - reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) reserved(then) - ident(Msg) operator(:=) ident(Msg) operator(+) string operator(+) ident(EOL)operator(;) - reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) reserved(then) - ident(Msg) operator(:=) ident(Msg) operator(+) string operator(+) ident(EOL)operator(;) - reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) reserved(then) - ident(Msg) operator(:=) ident(Msg) operator(+) string operator(+) ident(EOL)operator(;) - reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) reserved(then) - ident(Msg) operator(:=) ident(Msg) operator(+) string operator(+) ident(EOL)operator(;) - reserved(if) ident(Msg) operator(=) string reserved(then) reserved(begin) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - reserved(end) reserved(else) reserved(begin) - ident(Msg) operator(:=) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(EOL) operator(+) - ident(Msg) operator(+) - ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - stringoperator(;) - - reserved(case) ident(MessageDlg)operator(()ident(Msg)operator(,) ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(,) ident(mbYesToAll)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) reserved(of) - ident(mrYes)operator(:) reserved(begin) - reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) - reserved(and) operator(()ident(mrYes)operator(=)ident(MessageDlg)operator(()stringoperator(,) - ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(])operator(,) integer(0)operator(\))operator(\)) reserved(then) - ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\))operator(;) - - reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) - reserved(and) operator(()ident(mrYes)operator(=)ident(MessageDlg)operator(()stringoperator(,) - ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(])operator(,) integer(0)operator(\))operator(\)) reserved(then) - ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\))operator(;) - - reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) - reserved(and) operator(()ident(mrYes)operator(=)ident(MessageDlg)operator(()stringoperator(,) - ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(])operator(,) integer(0)operator(\))operator(\)) reserved(then) - ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\))operator(;) - - reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) - reserved(and) operator(()ident(mrYes)operator(=)ident(MessageDlg)operator(()stringoperator(,) - ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(])operator(,) integer(0)operator(\))operator(\)) reserved(then) - ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\))operator(;) - reserved(end)operator(;) - - ident(mrYesToAll)operator(:) reserved(begin) - ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\))operator(;) - ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\))operator(;) - ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\))operator(;) - ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\))operator(;) - reserved(end)operator(;) - - ident(mrNo)operator(:) reserved(begin) - ident(TreeWin)operator(.)ident(SetFocus)operator(;) - ident(GotoKey)operator(()stringoperator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(BackupRegistryscanreg1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ExecFile)operator(()stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(Username1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ShowMessage)operator(()ident(UserName)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(ToDoMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(NotePad)operator(()ident(PlutoDir) operator(+) stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(MailLinkMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(MailTo)operator(()ident(TMenuItem)operator(()ident(Sender)operator(\))operator(.)ident(Caption)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(IjustwantCONTACT1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(MailTo)operator(()stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(ExternalHexEditMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ExecFile)operator(()ident(PrefWin)operator(.)ident(ExternalHexEditE)operator(.)ident(Text)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(AnotherPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ExecFile)operator(()ident(Application)operator(.)ident(ExeName)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(Path1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) -preprocessor({$IFDEF UNIKEY}) - ident(UserUniPath) operator(:=) ident(InputBox)operator(()stringoperator(,) string operator(+) ident(EOL) operator(+) - ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string:)delimiter(')> operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(MyDir) operator(+) string:)delimiter(')> operator(+) ident(EOL) operator(+) - string operator(+) ident(MyDir) operator(+) string:[View])delimiter(')> operator(+) ident(EOL)operator(,) - ident(UserUniPath)operator(\))operator(;) -preprocessor({$ENDIF}) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(RegisterPlugIns1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) -preprocessor({$IFDEF UNIKEY}) - reserved(if) ident(UniPluginOD)operator(.)ident(Execute) reserved(then) - ident(RegisterUniClass)operator(()ident(UniPluginOD)operator(.)ident(FileName)operator(\))operator(;) -preprocessor({$ENDIF}) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(FormResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ArrangeIcons)operator(;) - ident(ArrangePlutoStyle)operator(;) - ident(WorkWin)operator(.)ident(WindowState) operator(:=) ident(wsNormal)operator(;) - ident(ValuesWin)operator(.)ident(WindowState) operator(:=) ident(wsNormal)operator(;) - ident(TreeWin)operator(.)ident(WindowState) operator(:=) ident(wsNormal)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(SwapLM_CUBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Path)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Path) operator(:=) ident(TraceKey)operator(()ident(PathE)operator(.)ident(Text)operator(,) ident(uhShortcuts)operator(\))operator(;) - reserved(if) ident(SwapHKU_HKLM)operator(()ident(Path)operator(\)) reserved(then) reserved(begin) - ident(PathE)operator(.)ident(Text) operator(:=) ident(Path)operator(;) - ident(UserGotoKey)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(ShowLoadreport1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(NotePad)operator(()ident(MyDir) operator(+) stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(KillPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(Application)operator(.)ident(Terminate)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(ShowPlatform1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ShowMessage)operator(()ident(Format)operator(()string operator(+) ident(EOL) operator(+) - stringoperator(,) - operator([)ident(PlatformStrings)operator([)ident(Win32Platform)operator(])operator(,) - ident(Win32MajorVersion)operator(,) ident(Win32MinorVersion)operator(,) ident(Win32BuildNumber)operator(])operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(MSConfig1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ExecFile)operator(()stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(TimetoRelaxMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(RelaxFile)operator(:) reserved(string)operator(;) -reserved(begin) - reserved(with) ident(PlutoKey)operator(.)ident(GetKey)operator(()stringoperator(\)) reserved(do) - reserved(try) - ident(RelaxFile) operator(:=) ident(ReadString)operator(()stringoperator(\))operator(;) - reserved(finally) - ident(Free)operator(;) - reserved(end)operator(;) - - reserved(if) ident(RelaxFile) operator(=) string reserved(then) - ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - stringoperator(\)) - reserved(else) - ident(ExecFile)operator(()ident(RelaxFile)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(OnSisyChange)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\))operator(;) - - reserved(procedure) ident(UpdateValue)operator(;) - reserved(var) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - ident(Index)operator(:) ident(Integer)operator(;) - reserved(begin) - reserved(if) reserved(not) ident(SameRegPath)operator(()ident(ExRegFullKey)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(,) ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\))operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\))operator(;) - reserved(if) ident(Reg)operator(.)ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\)) reserved(then) - reserved(with) ident(ValuesWin) reserved(do) reserved(begin) - ident(Index) operator(:=) ident(FindItemByRealName)operator(()ident(ExRegValue)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\))operator(;) - reserved(if) ident(Index) operator(>) operator(-)integer(1) reserved(then) reserved(begin) - reserved(if) ident(Change)operator(.)ident(Typ) operator(=) ident(cValueMinus) reserved(then) - ident(ValueList)operator(.)ident(Items)operator(.)ident(Delete)operator(()ident(Index)operator(\)) - reserved(else) reserved(if) ident(Change)operator(.)ident(Typ) operator(=) ident(cContextChange) reserved(then) - ident(UpdateValue)operator(()ident(Reg)operator(,) ident(ValueList)operator(.)ident(Items)operator([)ident(Index)operator(])operator(\))operator(;) - reserved(end) reserved(else) reserved(if) ident(Change)operator(.)ident(Typ) operator(=) ident(cValuePlus) reserved(then) - ident(AddValue)operator(()ident(Reg)operator(,) ident(ExRegValue)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(AddHint)operator(()ident(Sender)operator(.)ident(Name) operator(+) string operator(+) ident(Change)operator(.)ident(Path)operator(\))operator(;) - reserved(if) ident(Change)operator(.)ident(Typ) reserved(in) operator([)ident(cValueMinus)operator(,) ident(cValuePlus)operator(,) ident(cContextChange)operator(]) reserved(then) - ident(UpdateValue)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(OnSisyValuePlus)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\))operator(;) -reserved(var) - ident(Reg)operator(:) ident(TXRegistry)operator(;) -reserved(begin) - reserved(if) reserved(not) ident(SameRegPath)operator(()ident(ExRegFullKey)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(,) ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\))operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\))operator(;) - reserved(if) ident(Reg)operator(.)ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\)) reserved(then) - ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(Reg)operator(,) ident(ExRegValue)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\))operator(;) - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(OnSisyValueMinus)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\))operator(;) -reserved(var) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - ident(Index)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) reserved(not) ident(SameRegPath)operator(()ident(ExRegFullKey)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(,) ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\))operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\))operator(;) - reserved(if) ident(Reg)operator(.)ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\)) reserved(then) - reserved(with) ident(ValuesWin) reserved(do) reserved(begin) - ident(Index) operator(:=) ident(FindItemByRealName)operator(()ident(ExRegValue)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\))operator(;) - reserved(if) ident(Index) operator(>) operator(-)integer(1) reserved(then) - ident(ValueList)operator(.)ident(Items)operator(.)ident(Delete)operator(()ident(Index)operator(\))operator(;) - reserved(end)operator(;) - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TMainWin)operator(.)ident(OnSisyContextChange)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\))operator(;) -reserved(var) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - ident(Index)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) reserved(not) ident(SameRegPath)operator(()ident(ExRegFullKey)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(,) ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\))operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\))operator(;) - reserved(if) ident(Reg)operator(.)ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\)) reserved(then) - reserved(with) ident(ValuesWin) reserved(do) reserved(begin) - ident(Index) operator(:=) ident(FindItemByRealName)operator(()ident(ExRegValue)operator(()ident(Change)operator(.)ident(Path)operator(\))operator(\))operator(;) - reserved(if) ident(Index) operator(>) operator(-)integer(1) reserved(then) - ident(UpdateValue)operator(()ident(Reg)operator(,) ident(ValueList)operator(.)ident(Items)operator([)ident(Index)operator(])operator(\))operator(;) - reserved(end)operator(;) - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(PrefU)operator(;) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Variants)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) - ident(Dialogs)operator(,) ident(ComCtrls)operator(,) ident(ExtCtrls)operator(,) ident(StdCtrls)operator(,) ident(PlutoConst)operator(,) ident(NewPanels)operator(,) ident(PrefTools)operator(,) - ident(YTools)operator(,) ident(YTypes)operator(,) ident(start)operator(,) ident(XReg)operator(,) ident(LinkLabel)operator(;) - -reserved(type) - ident(TPrefWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) - ident(PrefPC)operator(:) ident(TPageControl)operator(;) - ident(CommonPage)operator(:) ident(TTabSheet)operator(;) - ident(KeyPage)operator(:) ident(TTabSheet)operator(;) - ident(DataPage)operator(:) ident(TTabSheet)operator(;) - ident(KeysBP)operator(:) ident(TBorderPanel)operator(;) - ident(GroupBox3)operator(:) ident(TGroupBox)operator(;) - ident(MainPrevBP)operator(:) ident(TBorderPanel)operator(;) - ident(GroupBox4)operator(:) ident(TGroupBox)operator(;) - ident(BorderPanel6)operator(:) ident(TBorderPanel)operator(;) - ident(GroupBox6)operator(:) ident(TGroupBox)operator(;) - ident(SortKeysCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(PrefHost)operator(:) ident(TPrefHost)operator(;) - ident(MainPreviewCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(SplashScreenCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(PrefValuesPC)operator(:) ident(TPageControl)operator(;) - ident(StringPage)operator(:) ident(TTabSheet)operator(;) - ident(MultiStringPage)operator(:) ident(TTabSheet)operator(;) - ident(IntPage)operator(:) ident(TTabSheet)operator(;) - ident(BinaryPage)operator(:) ident(TTabSheet)operator(;) - ident(BorderPanel8)operator(:) ident(TBorderPanel)operator(;) - ident(GroupBox8)operator(:) ident(TGroupBox)operator(;) - ident(ShowDwordAsHex)operator(:) ident(TPrefCheckBox)operator(;) - ident(BorderPanel7)operator(:) ident(TBorderPanel)operator(;) - ident(GroupBox7)operator(:) ident(TGroupBox)operator(;) - ident(CountZeroByteCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(BorderPanel1)operator(:) ident(TBorderPanel)operator(;) - ident(GroupBox2)operator(:) ident(TGroupBox)operator(;) - ident(UseExtendedModelCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(BorderPanel2)operator(:) ident(TBorderPanel)operator(;) - ident(GroupBox1)operator(:) ident(TGroupBox)operator(;) - ident(ShowAsBinaryCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(ShowBinaryAsRG)operator(:) ident(TPrefRadioGroup)operator(;) - ident(Smart4BBCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(DWordPreviewL)operator(:) ident(TLabel)operator(;) - ident(Label4)operator(:) ident(TLabel)operator(;) - ident(Label5)operator(:) ident(TLabel)operator(;) - ident(Label6)operator(:) ident(TLabel)operator(;) - ident(Label7)operator(:) ident(TLabel)operator(;) - ident(UserNameE)operator(:) ident(TPrefEdit)operator(;) - ident(Label8)operator(:) ident(TLabel)operator(;) - ident(MainPreviewE)operator(:) ident(TPrefEdit)operator(;) - ident(Label12)operator(:) ident(TLabel)operator(;) - ident(DefaultIconPreviewCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(KeyInfoPreviewCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(SelectExternalHexEditOD)operator(:) ident(TOpenDialog)operator(;) - ident(BorderPanel3)operator(:) ident(TBorderPanel)operator(;) - ident(GroupBox9)operator(:) ident(TGroupBox)operator(;) - ident(IntegrationPage)operator(:) ident(TTabSheet)operator(;) - ident(BorderPanel4)operator(:) ident(TBorderPanel)operator(;) - ident(GroupBox5)operator(:) ident(TGroupBox)operator(;) - ident(Label11)operator(:) ident(TLabel)operator(;) - ident(SelectExternalHexEditB)operator(:) ident(TButton)operator(;) - ident(RunExternalHexEditB)operator(:) ident(TButton)operator(;) - ident(ExternalHexEditE)operator(:) ident(TPrefEdit)operator(;) - ident(Label13)operator(:) ident(TLabel)operator(;) - ident(BorderPanel5)operator(:) ident(TBorderPanel)operator(;) - ident(GroupBox10)operator(:) ident(TGroupBox)operator(;) - ident(Label15)operator(:) ident(TLabel)operator(;) - ident(RegisterAppCB)operator(:) ident(TCheckBox)operator(;) - ident(Label3)operator(:) ident(TLabel)operator(;) - ident(Memo1)operator(:) ident(TMemo)operator(;) - ident(ExpandStringsRG)operator(:) ident(TPrefRadioGroup)operator(;) - ident(QuotersE)operator(:) ident(TPrefEdit)operator(;) - ident(Label1)operator(:) ident(TLabel)operator(;) - ident(StringPreviewL)operator(:) ident(TLabel)operator(;) - ident(ShowLineCountCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(ShowTreeViewLinesCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(ValuePage)operator(:) ident(TTabSheet)operator(;) - ident(BorderPanel10)operator(:) ident(TBorderPanel)operator(;) - ident(GroupBox12)operator(:) ident(TGroupBox)operator(;) - ident(ShowListViewGridCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(Label9)operator(:) ident(TLabel)operator(;) - ident(DefaultValueNameE)operator(:) ident(TPrefEdit)operator(;) - ident(Label10)operator(:) ident(TLabel)operator(;) - ident(GotoPlutoKeyB)operator(:) ident(TButton)operator(;) - ident(ColorPanel2)operator(:) ident(TColorPanel)operator(;) - ident(LinkLabel1)operator(:) ident(TLinkLabel)operator(;) - ident(SmartExpandCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(KeysSingleClickCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(ValuesSingleClickCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(ShowProgressCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(ColorPanel1)operator(:) ident(TColorPanel)operator(;) - ident(Label2)operator(:) ident(TLabel)operator(;) - ident(ReloadB)operator(:) ident(TButton)operator(;) - ident(DefaultB)operator(:) ident(TButton)operator(;) - ident(SaveB)operator(:) ident(TButton)operator(;) - reserved(procedure) ident(PrefPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) - ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(PrefHostLoaded)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(StandardPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(DataPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(UserNameEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(PrefValuesPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) - ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(ShowDwordAsHexClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(MainPreviewEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ReloadBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RunExternalHexEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SelectExternalHexEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ExternalHexEditEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(DefaultBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RegisterAppCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SaveBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(StringPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ShowTreeViewLinesCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ShowListViewGridCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(DefaultValueNameEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(LoadPrefs)operator(;) - reserved(procedure) ident(UseExtendedModelCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(IntegrationPageShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(GotoPlutoKeyBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(KeysSingleClickCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ValuesSingleClickCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(QuotersEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SplashScreenCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SaveBMouseMove)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) - ident(Y)operator(:) ident(Integer)operator(\))operator(;) - directive(public) - ident(StringQuoterBegin)operator(,) ident(StringQuoterEnd)operator(:) reserved(string)operator(;) - reserved(end)operator(;) - -reserved(var) - ident(PrefWin)operator(:) ident(TPrefWin)operator(;) - -reserved(implementation) - -reserved(uses) - ident(TreeU)operator(,) ident(ValuesU)operator(,) ident(Splash)operator(,) ident(plutomain)operator(,) ident(WorkU)operator(;) - -preprocessor({$R *.dfm}) - -reserved(procedure) ident(TPrefWin)operator(.)ident(PrefPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) - ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\))operator(;) -reserved(var) - ident(PC)operator(:) ident(TPageControl)operator(;) - ident(Page)operator(:) ident(TTabSheet)operator(;) -reserved(begin) - ident(PC) operator(:=) ident(TPageControl)operator(()ident(Control)operator(\))operator(;) - ident(Page) operator(:=) ident(PC)operator(.)ident(Pages)operator([)ident(TabIndex)operator(])operator(;) - reserved(with) ident(PC)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) - reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) - ident(Color) operator(:=) ident(clWhite) - reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) - ident(Color) operator(:=) ident(clBrightCyan) - reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) - ident(Color) operator(:=) ident(clBrightPurple) - reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) - ident(Color) operator(:=) ident(clBrightBlue) - reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) - ident(Color) operator(:=) ident(clBrightYellow) - reserved(else) - ident(Color) operator(:=) ident(clWhite)operator(;) - reserved(end)operator(;) - - reserved(with) ident(PC)operator(.)ident(Canvas) reserved(do) - reserved(if) ident(Active) reserved(then) reserved(begin) - ident(Font)operator(.)ident(Style) operator(:=) operator([)ident(fsBold)operator(])operator(;) - ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) - ident(FillRect)operator(()ident(Rect)operator(\))operator(;) - ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(5)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(3)operator(,) ident(Page)operator(.)ident(Caption)operator(\))operator(;) - reserved(end) reserved(else) reserved(begin) - ident(Font)operator(.)ident(Style) operator(:=) operator([)operator(])operator(;) - ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) - ident(FillRect)operator(()ident(Rect)operator(\))operator(;) - ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(3)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(2)operator(,) ident(Page)operator(.)ident(Caption)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(PrefHostLoaded)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(PrefHost)operator(.)ident(KeyName) operator(:=) ident(PlutoUniPath)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(StandardPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Started) reserved(then) - ident(RegTV)operator(.)ident(Repaint)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(DataPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(Started) reserved(then) - ident(Exit)operator(;) - - ident(ValuesWin)operator(.)ident(UpdateValues)operator(;) - ident(RegTV)operator(.)ident(Repaint)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(UserNameEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(])operator(.)ident(Text) operator(:=) ident(MainWin)operator(.)ident(Greeting)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Key) operator(=) ident(VK_ESCAPE) reserved(then) - ident(Close)operator(;) - - reserved(if) ident(Key) operator(=) ident(VK_SCROLL) reserved(then) - ident(MainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(,) ident(Key)operator(,) ident(Shift)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag) reserved(then) - ident(DeActivateThis)operator(()ident(ActiveControl)operator(\))operator(;) - - ident(AlphaBlendValue) operator(:=) integer(127)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Started) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) - ident(ActivateThis)operator(()ident(ActiveControl)operator(\))operator(;) - - ident(AlphaBlendValue) operator(:=) integer(255)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(PrefValuesPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) - ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\))operator(;) -reserved(var) - ident(PC)operator(:) ident(TPageControl)operator(;) - ident(Page)operator(:) ident(TTabSheet)operator(;) -reserved(begin) - ident(PC) operator(:=) ident(TPageControl)operator(()ident(Control)operator(\))operator(;) - ident(Page) operator(:=) ident(PC)operator(.)ident(Pages)operator([)ident(TabIndex)operator(])operator(;) - reserved(with) ident(PC)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) - reserved(if) ident(Page) operator(=) ident(StringPage) reserved(then) - ident(Color) operator(:=) ident(clBrightRed) - reserved(else) reserved(if) ident(Page) operator(=) ident(MultiStringPage) reserved(then) - ident(Color) operator(:=) ident(clBrightPurple) - reserved(else) reserved(if) ident(Page) operator(=) ident(IntPage) reserved(then) - ident(Color) operator(:=) ident(clBrightBlue) - reserved(else) reserved(if) ident(Page) operator(=) ident(BinaryPage) reserved(then) - ident(Color) operator(:=) ident(clBrightGreen)operator(;) - reserved(end)operator(;) - - reserved(with) ident(PC)operator(.)ident(Canvas) reserved(do) - reserved(if) ident(Active) reserved(then) reserved(begin) - ident(Font)operator(.)ident(Style) operator(:=) operator([)ident(fsBold)operator(])operator(;) - ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) - ident(FillRect)operator(()ident(Rect)operator(\))operator(;) - ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(18) operator(+) integer(5)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(3)operator(,) ident(Page)operator(.)ident(Caption)operator(\))operator(;) - ident(PC)operator(.)ident(Images)operator(.)ident(Draw)operator(()ident(PC)operator(.)ident(Canvas)operator(,) ident(Rect)operator(.)ident(Left) operator(+) integer(4)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(2)operator(,) ident(Page)operator(.)ident(ImageIndex)operator(\))operator(;) - reserved(end) reserved(else) reserved(begin) - ident(Font)operator(.)ident(Style) operator(:=) operator([)operator(])operator(;) - ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) - ident(FillRect)operator(()ident(Rect)operator(\))operator(;) - ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(18) operator(+) integer(3)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(2)operator(,) ident(Page)operator(.)ident(Caption)operator(\))operator(;) - ident(PC)operator(.)ident(Images)operator(.)ident(Draw)operator(()ident(PC)operator(.)ident(Canvas)operator(,) ident(Rect)operator(.)ident(Left) operator(+) integer(1)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(1)operator(,) ident(Page)operator(.)ident(ImageIndex)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(ShowDwordAsHexClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(DWordPreviewL)operator(.)ident(Caption) operator(:=) string operator(+) ident(ValuesU)operator(.)ident(DataPreviewOfContext)operator(() - ident(RegContext)operator(()ident(rdCardinal)operator(,) ident(Reverse)operator(()ident(ByteAOfHex)operator(()ident(HexOfCard)operator(()integer(1234567890)operator(,) integer(8)operator(\))operator(\))operator(\))operator(\))operator(\))operator(;) - ident(DataPreviewChange)operator(()ident(Self)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(MainPreviewEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(MainPreviewE)operator(.)ident(Text) operator(=) string reserved(then) - ident(MainPreviewCB)operator(.)ident(Caption) operator(:=) string - reserved(else) - ident(MainPreviewCB)operator(.)ident(Caption) operator(:=) string operator(+) - ident(Quote)operator(()ident(MainPreviewE)operator(.)ident(Text)operator(\))operator(;) - - ident(StandardPreviewChange)operator(()ident(Self)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(UserNameE)operator(.)ident(DefaultValue) operator(:=) ident(UserName)operator(;) - ident(MainPreviewEChange)operator(()ident(Self)operator(\))operator(;) - ident(PrefPC)operator(.)ident(ActivePageIndex) operator(:=) integer(0)operator(;) - ident(PrefValuesPC)operator(.)ident(ActivePageIndex) operator(:=) integer(0)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ActivateThis)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(DeActivateThis)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(ReloadBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(LoadPrefs)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(RunExternalHexEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(FileName)operator(,) ident(TestValue)operator(:) reserved(string)operator(;) -reserved(begin) - ident(FileName) operator(:=) ident(TempDir) operator(+) stringoperator(;) - ident(TestValue) operator(:=) string operator(+) ident(EOL) operator(+) - stringoperator(;) - reserved(if) ident(SaveByteA)operator(()ident(ByteAOfStr)operator(()ident(TestValue)operator(\))operator(,) ident(FileName)operator(\)) reserved(then) - ident(ExecFileWith)operator(()ident(ExternalHexEditE)operator(.)ident(Text)operator(,) ident(FileName)operator(\)) - reserved(else) - ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) - ident(FileName)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(SelectExternalHexEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(SelectExternalHexEditOD) reserved(do) reserved(begin) - ident(InitialDir) operator(:=) ident(ExtractPath)operator(()ident(ExternalHexEditE)operator(.)ident(Text)operator(\))operator(;) - ident(FileName) operator(:=) ident(ExtractFileName)operator(()ident(ExternalHexEditE)operator(.)ident(Text)operator(\))operator(;) - reserved(if) ident(Execute) reserved(and) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(then) - ident(ExternalHexEditE)operator(.)ident(Text) operator(:=) ident(FileName)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(ExternalHexEditEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(RunExternalHexEditB)operator(.)ident(Enabled) operator(:=) ident(FileExists)operator(()ident(ExternalHexEditE)operator(.)ident(Text)operator(\))operator(;) - reserved(if) ident(Assigned)operator(()ident(WorkWin)operator(\)) reserved(then) - ident(WorkWin)operator(.)ident(ExternalEditB)operator(.)ident(Enabled) operator(:=) ident(RunExternalHexEditB)operator(.)ident(Enabled)operator(;) - reserved(if) ident(Assigned)operator(()ident(MainWin)operator(\)) reserved(then) - ident(MainWin)operator(.)ident(ExternalHexEditMI)operator(.)ident(Enabled) operator(:=) ident(RunExternalHexEditB)operator(.)ident(Enabled)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(DefaultBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(mrYes)operator(=)ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - stringoperator(,) ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) reserved(then) reserved(begin) - ident(CopyFile)operator(()ident(PChar)operator(()ident(PlutoIniFileName)operator(\))operator(,) ident(PChar)operator(()ident(PlutoIniFileName) operator(+) stringoperator(\))operator(,) ident(False)operator(\))operator(;) - comment(//PrefHost.KeyName := 'Ini <' + PlutoIniFileName + '.backup>:';) - comment(//PrefHost.Save;) - comment(//PrefHost.KeyName := PlutoUniPath;) - ident(PrefHost)operator(.)ident(BackUp)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(RegisterAppCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(TXRegistry)operator(.)ident(Create) reserved(do) - reserved(try) - ident(RootKey) operator(:=) ident(HKLM)operator(;) - ident(OpenKey)operator(()stringoperator(\))operator(;) - reserved(if) ident(RegisterAppCB)operator(.)ident(Checked) reserved(then) reserved(begin) - ident(OpenKey)operator(()stringoperator(,) ident(True)operator(\))operator(;) - ident(WriteString)operator(()stringoperator(,) ident(GetFileNew)operator(()ident(Application)operator(.)ident(ExeName)operator(\))operator(\))operator(;) - reserved(end) reserved(else) - ident(DeleteKey)operator(()stringoperator(\))operator(;) - reserved(finally) - ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(SaveBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(PrefHost)operator(.)ident(Save)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(StringPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(StringPreviewL)operator(.)ident(Caption) operator(:=) string operator(+) ident(ValuesU)operator(.)ident(DataPreviewOfContext)operator(() - ident(RegContext)operator(()ident(rdString)operator(,) ident(ByteAOfStr)operator(()stringoperator(\))operator(\))operator(\))operator(;) - ident(DataPreviewChange)operator(()ident(Self)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(ShowTreeViewLinesCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(RegTV) reserved(do) reserved(begin) - ident(ShowLines) operator(:=) ident(ShowTreeViewLinesCB)operator(.)ident(Checked)operator(;) - ident(ShowButtons) operator(:=) ident(ShowLines)operator(;) - reserved(end)operator(;) - ident(StandardPreviewChange)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(ShowListViewGridCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ValueList)operator(.)ident(GridLines) operator(:=) ident(ShowListViewGridCB)operator(.)ident(Checked)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(DefaultValueNameEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(DefaultValueCaption) operator(:=) ident(DefaultValueNameE)operator(.)ident(Text)operator(;) - reserved(if) ident(Started) reserved(then) - ident(TreeWin)operator(.)ident(RegTVChange)operator(()ident(Self)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(LoadPrefs)operator(;) -reserved(begin) - ident(PrefHost)operator(.)ident(Load)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(UseExtendedModelCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(WorkWin)operator(.)ident(MultiStringTypeRG)operator(.)ident(ItemIndex) operator(:=) ident(Integer)operator(()ident(UseExtendedModelCB)operator(.)ident(Checked)operator(\))operator(;) - ident(DataPreviewChange)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(IntegrationPageShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(TXRegistry)operator(.)ident(Create) reserved(do) - reserved(try) - ident(RootKey) operator(:=) ident(HKLM)operator(;) - ident(OpenKey)operator(()stringoperator(\))operator(;) - ident(RegisterAppCB)operator(.)ident(Checked) operator(:=) ident(SameFileName)operator(()ident(GetFileNew)operator(()ident(ReadString)operator(()stringoperator(\))operator(\))operator(,) - ident(GetFileNew)operator(()ident(Application)operator(.)ident(ExeName)operator(\))operator(\))operator(;) - reserved(finally) - ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(GotoPlutoKeyBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(MainWin)operator(.)ident(GotoKey)operator(()stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(PrefHost)operator(.)ident(Load)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(KeysSingleClickCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(TreeWin)operator(.)ident(CheckRegTVHotTrack)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(ValuesSingleClickCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ValuesWin)operator(.)ident(CheckValueListHotTrack)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(QuotersEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(QBegin)operator(,) ident(QEnd)operator(:) reserved(string)operator(;) -reserved(begin) - reserved(with) ident(QuotersE) reserved(do) reserved(begin) - reserved(if) ident(Text) operator(=) string reserved(then) - ident(QBegin) operator(:=) string - reserved(else) - ident(QBegin) operator(:=) ident(Text)operator([)integer(1)operator(])operator(;) - reserved(if) ident(Length)operator(()ident(Text)operator(\)) operator(<) integer(2) reserved(then) - ident(QEnd) operator(:=) ident(QBegin) - reserved(else) - ident(QEnd) operator(:=) ident(Text)operator([)integer(2)operator(])operator(;) - reserved(end)operator(;) - - reserved(if) operator(()ident(QBegin) operator(<>) ident(StringQuoterBegin)operator(\)) reserved(or) operator(()ident(QEnd) operator(<>) ident(StringQuoterEnd)operator(\)) reserved(then) reserved(begin) - ident(StringQuoterBegin) operator(:=) ident(QBegin)operator(;) - ident(StringQuoterEnd) operator(:=) ident(QEnd)operator(;) - ident(StringPreviewChange)operator(()ident(Self)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(SplashScreenCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Started) reserved(and) ident(Assigned)operator(()ident(SplashWin)operator(\)) reserved(then) - ident(SplashWin)operator(.)ident(SplashScreenCB)operator(.)ident(Checked) operator(:=) ident(SplashScreenCB)operator(.)ident(Checked)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TPrefWin)operator(.)ident(SaveBMouseMove)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) - ident(Y)operator(:) ident(Integer)operator(\))operator(;) -reserved(begin) - ident(Label2)operator(.)ident(Font)operator(.)ident(Color) operator(:=) ident(clBrightRed)operator(;) - ident(Application)operator(.)ident(ProcessMessages)operator(;) - ident(Sleep)operator(()integer(200)operator(\))operator(;) - ident(Label2)operator(.)ident(Font)operator(.)ident(Color) operator(:=) ident(clWhite)operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(RegScanner)operator(;) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(SysUtils)operator(,) ident(Dialogs)operator(,) ident(Classes)operator(,) - ident(YTools)operator(,) ident(YTypes)operator(,) ident(XReg)operator(,) ident(Clock)operator(;) - -reserved(type) - ident(TRegScanThread) operator(=) reserved(class)operator(;) - - ident(TRegScanKeyEvent) operator(=) reserved(procedure) operator(()ident(Sender)operator(:) ident(TRegScanThread)operator(;) reserved(const) ident(KeyName)operator(:) reserved(string)operator(;) ident(Key)operator(:) ident(HKEY)operator(;) ident(Info)operator(:) ident(TRegKeyInfo)operator(\)) reserved(of) reserved(object)operator(;) - ident(TRegScanValueEvent) operator(=) reserved(procedure) operator(()ident(Sender)operator(:) ident(TRegScanThread)operator(;) reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) ident(Context)operator(:) ident(TRegContext)operator(\)) reserved(of) reserved(object)operator(;) - - ident(TRegScanTask) operator(=) reserved(record) - ident(Root)operator(:) reserved(string)operator(;) - ident(Key)operator(:) ident(HKEY)operator(;) - reserved(end)operator(;) - ident(TRegScanTasks) operator(=) reserved(array) reserved(of) ident(TRegScanTask)operator(;) - - ident(TRegScanThread) operator(=) reserved(class)operator(()ident(TThread)operator(\)) - directive(private) - ident(Keys)operator(,) ident(KeysOK)operator(,) ident(Values)operator(,) ident(ValuesOK)operator(:) ident(Integer)operator(;) - ident(DoScanValues)operator(:) ident(Boolean)operator(;) - ident(FOnKey)operator(:) ident(TRegScanKeyEvent)operator(;) - ident(FOnValue)operator(:) ident(TRegScanValueEvent)operator(;) - ident(FOnFaileKey)operator(:) ident(TRegScanKeyEvent)operator(;) - directive(protected) - reserved(procedure) ident(ScanKey)operator(()ident(Key)operator(:) ident(HKEY)operator(;) reserved(const) ident(KeyName)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) directive(virtual)operator(;) - reserved(procedure) ident(ScanValues)operator(()ident(Key)operator(:) ident(HKEY)operator(;) ident(Info)operator(:) ident(TRegKeyInfo)operator(\))operator(;) directive(virtual)operator(;) - - directive(public) - ident(Path)operator(:) reserved(string)operator(;) - ident(CurrentTask)operator(:) ident(TRegScanTask)operator(;) - ident(Tasks)operator(:) ident(TRegScanTasks)operator(;) - reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) - reserved(procedure) ident(Execute)operator(;) directive(override)operator(;) - reserved(procedure) ident(ScanAll)operator(;) - reserved(function) ident(CurrentPath)operator(:) reserved(string)operator(;) - directive(published) - reserved(constructor) ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(;) - ident(DoScanValues)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(Tasks)operator(:) ident(TRegScanTasks) operator(=) reserved(nil)operator(\))operator(;) - - reserved(property) ident(OnKey)operator(:) ident(TRegScanKeyEvent) directive(read) ident(FOnKey) directive(write) ident(FOnKey)operator(;) - reserved(property) ident(OnValue)operator(:) ident(TRegScanValueEvent) directive(read) ident(FOnValue) directive(write) ident(FOnValue)operator(;) - reserved(property) ident(OnFaileKey)operator(:) ident(TRegScanKeyEvent) directive(read) ident(FOnFaileKey) directive(write) ident(FOnFaileKey)operator(;) - reserved(end)operator(;) - -reserved(implementation) - -comment({ TRegScanThread }) - -reserved(constructor) ident(TRegScanThread)operator(.)ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(;) - ident(DoScanValues)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(Tasks)operator(:) ident(TRegScanTasks) operator(=) reserved(nil)operator(\))operator(;) -reserved(begin) - reserved(inherited) ident(Create)operator(()ident(True)operator(\))operator(;) - ident(Priority) operator(:=) ident(PriorityLevel)operator(;) - ident(FreeOnTerminate) operator(:=) ident(False)operator(;) - ident(Self)operator(.)ident(DoScanValues) operator(:=) ident(DoScanValues)operator(;) - ident(Self)operator(.)ident(Tasks) operator(:=) ident(Tasks)operator(;) -reserved(end)operator(;) - -reserved(destructor) ident(TRegScanThread)operator(.)ident(Destroy)operator(;) -reserved(begin) - reserved(inherited)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegScanThread)operator(.)ident(ScanAll)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Keys) operator(:=) integer(0)operator(;) - ident(KeysOK) operator(:=) integer(0)operator(;) - ident(Values) operator(:=) integer(0)operator(;) - ident(ValuesOK) operator(:=) integer(0)operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Tasks)operator(\)) reserved(do) reserved(begin) - ident(CurrentTask) operator(:=) ident(Tasks)operator([)ident(i)operator(])operator(;) - reserved(with) ident(CurrentTask) reserved(do) reserved(begin) - ident(Inc)operator(()ident(Keys)operator(\))operator(;) - ident(ScanKey)operator(()ident(Key)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(Terminated) reserved(then) ident(Break)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegScanThread)operator(.)ident(ScanValues)operator(()ident(Key)operator(:) ident(HKEY)operator(;) ident(Info)operator(:) ident(TRegKeyInfo)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(MaxLen)operator(,) ident(NameLen)operator(,) ident(Len)operator(,) ident(Typ)operator(:) ident(Cardinal)operator(;) - ident(p)operator(:) ident(PChar)operator(;) - ident(Buffer)operator(:) ident(TByteA)operator(;) - - reserved(procedure) ident(ScanValue)operator(()ident(ValueName)operator(:) reserved(string)operator(;) ident(Typ)operator(:) ident(TRegDataType)operator(;) ident(Data)operator(:) ident(TByteA)operator(\))operator(;) - reserved(begin) - reserved(if) ident(Assigned)operator(()ident(OnValue)operator(\)) reserved(then) - ident(OnValue)operator(()ident(Self)operator(,) ident(ValueName)operator(,) ident(RegContext)operator(()ident(Typ)operator(,) ident(Data)operator(\))operator(\))operator(;) - ident(Inc)operator(()ident(ValuesOK)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(MaxLen) operator(:=) ident(Info)operator(.)ident(MaxValueLen) operator(+) integer(1)operator(;) comment(//Include Nullbyte) - ident(SetLength)operator(()ident(Buffer)operator(,) ident(Info)operator(.)ident(MaxDataLen)operator(\))operator(;) - ident(GetMem)operator(()ident(p)operator(,) ident(MaxLen)operator(\))operator(;) - - ident(Inc)operator(()ident(Values)operator(,) ident(Info)operator(.)ident(NumValues)operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Info)operator(.)ident(NumValues)operator(-)integer(1) reserved(do) reserved(begin) - ident(NameLen) operator(:=) ident(MaxLen)operator(;) - ident(Len) operator(:=) ident(Info)operator(.)ident(MaxDataLen)operator(;) - reserved(if) ident(Success)operator(()ident(RegEnumValue)operator(()ident(Key)operator(,) ident(i)operator(,) ident(p)operator(,) ident(NameLen)operator(,) reserved(nil)operator(,) operator(@)ident(Typ)operator(,) ident(Pointer)operator(()ident(Buffer)operator(\))operator(,) - operator(@)ident(Len)operator(\))operator(\)) reserved(then) - ident(ScanValue)operator(()ident(Copy)operator(()ident(p)operator(,) integer(0)operator(,) ident(NameLen)operator(\))operator(,) ident(Typ)operator(,) ident(Copy)operator(()ident(Buffer)operator(,) integer(0)operator(,) ident(Len)operator(\))operator(\)) - reserved(else) - ident(Yield)operator(;) - reserved(end)operator(;) - ident(FreeMem)operator(()ident(p)operator(,) ident(MaxLen)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegScanThread)operator(.)ident(ScanKey)operator(()ident(Key)operator(:) ident(HKEY)operator(;) reserved(const) ident(KeyName)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(NewHKEY)operator(:) ident(HKEY)operator(;) - ident(Info)operator(:) ident(TRegKeyInfo)operator(;) - ident(l)operator(,) ident(Len)operator(:) ident(DWORD)operator(;) - ident(p)operator(:) ident(PChar)operator(;) - ident(z)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(Terminated) reserved(then) ident(Exit)operator(;) - - reserved(with) ident(Info) reserved(do) reserved(begin) - reserved(if) reserved(not) ident(Success)operator(()ident(RegQueryInfoKey)operator(()ident(Key)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) operator(@)ident(NumSubKeys)operator(,) - operator(@)ident(MaxSubKeyLen)operator(,) reserved(nil)operator(,) operator(@)ident(NumValues)operator(,) operator(@)ident(MaxValueLen)operator(,) operator(@)ident(MaxDataLen)operator(,) - reserved(nil)operator(,) reserved(nil)operator(\))operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(Assigned)operator(()ident(OnKey)operator(\)) reserved(then) - ident(OnKey)operator(()ident(Self)operator(,) ident(KeyName)operator(,) ident(Key)operator(,) ident(Info)operator(\))operator(;) - reserved(if) ident(DoScanValues) reserved(and) operator(()ident(NumValues) operator(>) integer(0)operator(\)) reserved(then) - ident(ScanValues)operator(()ident(Key)operator(,) ident(Info)operator(\))operator(;) - - reserved(if) ident(Info)operator(.)ident(NumSubKeys) operator(>) integer(0) reserved(then) reserved(begin) - ident(Inc)operator(()ident(Keys)operator(,) ident(NumSubKeys)operator(\))operator(;) - - ident(Len) operator(:=) ident(MaxSubKeyLen) operator(+) integer(1)operator(;) - ident(GetMem)operator(()ident(p)operator(,) ident(Len)operator(\))operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(NumSubKeys)operator(-)integer(1) reserved(do) reserved(begin) - ident(l) operator(:=) ident(Len)operator(;) - ident(RegEnumKeyEx)operator(()ident(Key)operator(,) ident(i)operator(,) ident(p)operator(,) ident(l)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(\))operator(;) - reserved(if) ident(Success)operator(()ident(RegOpenKey)operator(()ident(Key)operator(,) ident(p)operator(,) ident(NewHKEY)operator(\))operator(\)) reserved(then) reserved(begin) - ident(z) operator(:=) ident(Length)operator(()ident(Path)operator(\))operator(;) - ident(Path) operator(:=) ident(Path) operator(+) char operator(+) ident(p)operator(;) - ident(ScanKey)operator(()ident(NewHKEY)operator(,) ident(p)operator(\))operator(;) - ident(RegCloseKey)operator(()ident(NewHKEY)operator(\))operator(;) - ident(SetLength)operator(()ident(Path)operator(,) ident(z)operator(\))operator(;) - reserved(end) reserved(else) - reserved(if) ident(Assigned)operator(()ident(OnFaileKey)operator(\)) reserved(then) - ident(OnFaileKey)operator(()ident(Self)operator(,) ident(p)operator(,) ident(Key)operator(,) ident(Info)operator(\))operator(;) - - reserved(if) ident(Terminated) reserved(then) - ident(Break)operator(;) - reserved(end)operator(;) - ident(FreeMem)operator(()ident(p)operator(,) ident(Len)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - ident(Inc)operator(()ident(KeysOK)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegScanThread)operator(.)ident(Execute)operator(;) -reserved(var) - ident(Secs)operator(:) ident(Double)operator(;) -reserved(begin) - reserved(with) ident(TClock)operator(.)ident(Create) reserved(do) reserved(begin) - ident(ScanAll)operator(;) - ident(Secs) operator(:=) ident(SecondsPassed)operator(;) - ident(Free)operator(;) - reserved(end)operator(;) - - ident(WriteLn)operator(()stringoperator(\))operator(;) - ident(WriteLn)operator(() ident(Format)operator(()stringoperator(,) operator([)ident(Keys)operator(,) ident(Keys) operator(-) ident(KeysOK)operator(])operator(\))operator(\))operator(;) - reserved(if) ident(DoScanValues) reserved(then) - ident(WriteLn)operator(()ident(Format)operator(()stringoperator(,) operator([)ident(Values)operator(,) ident(Values) operator(-) ident(ValuesOK)operator(])operator(\))operator(\))operator(;) - ident(WriteLn)operator(()string operator(+) ident(Format)operator(()stringoperator(,) operator([)ident(Secs)operator(])operator(\)) operator(+) stringoperator(\))operator(;) - reserved(if) ident(Secs) operator(>) integer(0) reserved(then) - ident(WriteLn)operator(()string operator(+) ident(Format)operator(()stringoperator(,) operator([)ident(Keys) operator(/) ident(Secs)operator(])operator(\)) operator(+) stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(TRegScanThread)operator(.)ident(CurrentPath)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(CurrentTask)operator(.)ident(Root) operator(+) ident(Path)operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(RegTV)operator(;) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) ident(Dialogs)operator(,) - ident(ComCtrls)operator(;) - -reserved(type) - ident(TRegTV) operator(=) reserved(class)operator(()ident(TTreeView)operator(\)) - directive(private) - comment({ Private-Deklarationen }) - directive(protected) - comment({ Protected-Deklarationen }) - directive(public) - comment({ Public-Deklarationen }) - directive(published) - comment({ Published-Deklarationen }) - reserved(end)operator(;) - -reserved(procedure) ident(Register)operator(;) - -reserved(implementation) - -reserved(procedure) ident(Register)operator(;) -reserved(begin) - ident(RegisterComponents)operator(()stringoperator(,) operator([)ident(TRegTV)operator(])operator(\))operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(Sisyphus)operator(;) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(Classes)operator(,) ident(SysUtils)operator(,) ident(XReg)operator(,) ident(YTools)operator(,) ident(YTypes)operator(,) ident(Clock)operator(;) - -reserved(type) - ident(TSpyValue) operator(=) reserved(class) - ident(Name)operator(:) reserved(string)operator(;) - ident(Next)operator(:) ident(TSpyValue)operator(;) - comment(//DIC: TByteA;) - ident(Typ)operator(:) ident(TXRegDataType)operator(;) - ident(Data)operator(:) ident(TByteA)operator(;) - reserved(constructor) ident(Create)operator(()ident(AName)operator(:) reserved(string)operator(\))operator(;) - reserved(end)operator(;) - - ident(TSpyKey) operator(=) reserved(class) - directive(public) - ident(Parent)operator(:) ident(TSpyKey)operator(;) - ident(Name)operator(:) reserved(string)operator(;) - ident(Next)operator(:) ident(TSpyKey)operator(;) - ident(Keys)operator(:) ident(TSpyKey)operator(;) - ident(Values)operator(:) ident(TSpyValue)operator(;) - reserved(procedure) ident(Spy)operator(()ident(AHKEY)operator(:) ident(HKEY)operator(\))operator(;) - reserved(function) ident(Path)operator(:) reserved(string)operator(;) - reserved(constructor) ident(Create)operator(()ident(AParent)operator(:) ident(TSpyKey)operator(;) ident(AName)operator(:) reserved(string)operator(\))operator(;) - reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) - reserved(end)operator(;) - -reserved(var) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - ident(HKLMSpyKey)operator(,) ident(HKUSpyKey)operator(:) ident(TSpyKey)operator(;) - ident(Started)operator(:) ident(Boolean) operator(=) ident(False)operator(;) - -reserved(implementation) - -reserved(uses) - ident(Plutomain)operator(;) - -reserved(procedure) ident(AddChange)operator(()ident(M)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - ident(Yield)operator(;) - comment(//AddHint(M\);) -reserved(end)operator(;) - -comment({ TSpyValue }) - -reserved(constructor) ident(TSpyValue)operator(.)ident(Create)operator(()ident(AName)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - ident(Name) operator(:=) ident(AName)operator(;) - ident(Next) operator(:=) reserved(nil)operator(;) -reserved(end)operator(;) - -comment({ TSpyKey }) - -reserved(constructor) ident(TSpyKey)operator(.)ident(Create)operator(()ident(AParent)operator(:) ident(TSpyKey)operator(;) ident(AName)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - ident(Name) operator(:=) ident(AName)operator(;) - ident(Parent) operator(:=) ident(AParent)operator(;) - - ident(Next) operator(:=) reserved(nil)operator(;) - ident(Keys) operator(:=) reserved(nil)operator(;) - ident(Values) operator(:=) reserved(nil)operator(;) -reserved(end)operator(;) - -reserved(destructor) ident(TSpyKey)operator(.)ident(Destroy)operator(;) -reserved(var) - ident(Value)operator(,) ident(NextValue)operator(:) ident(TSpyValue)operator(;) - ident(Key)operator(,) ident(NextKey)operator(:) ident(TSpyKey)operator(;) -reserved(begin) - ident(Value) operator(:=) ident(Values)operator(;) - reserved(while) ident(Value) operator(<>) reserved(nil) reserved(do) reserved(begin) - ident(NextValue) operator(:=) ident(Value)operator(.)ident(Next)operator(;) - ident(Value)operator(.)ident(Free)operator(;) - ident(Value) operator(:=) ident(NextValue)operator(;) - reserved(end)operator(;) - - ident(Key) operator(:=) ident(Keys)operator(;) - reserved(while) ident(Key) operator(<>) reserved(nil) reserved(do) reserved(begin) - ident(NextKey) operator(:=) ident(Key)operator(.)ident(Next)operator(;) - ident(Key)operator(.)ident(Free)operator(;) - ident(Key) operator(:=) ident(NextKey)operator(;) - reserved(end)operator(;) - - reserved(inherited)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TSpyKey)operator(.)ident(Path)operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Parent)operator(\)) reserved(then) - ident(Result) operator(:=) ident(Parent)operator(.)ident(Path) operator(+) char - reserved(else) - ident(Result) operator(:=) stringoperator(;) - - ident(Result) operator(:=) ident(Result) operator(+) ident(Name)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSpyKey)operator(.)ident(Spy)operator(()ident(AHKEY)operator(:) ident(HKEY)operator(\))operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) - - reserved(procedure) ident(CompareValues)operator(;) - reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(Value)operator(,) ident(LastValue)operator(,) ident(NewValue)operator(,) ident(SearchValue)operator(:) ident(TSpyValue)operator(;) - reserved(begin) - comment(//OK, this part is a little bit complicate. So I will comment very much.) - comment(//First, two terms are important:) - comment(// means the list of values that will be read from the registry now:) - ident(Reg)operator(.)ident(GetValueNames)operator(()ident(SL)operator(\))operator(;) - comment(//So is TStringList.) - - comment(// means the image that was saved before.) - comment(//Here, it is a linear list of TSpyValue objects. That means that you can) - comment(//only get X.Next and not X.Prev! However, I use "X.Prev" to simplify) - comment(//some comments.) - - comment(//!!! Comparing means: Make fit !!!) - - comment(//If wasn't saved before, it is just empty.) - - comment(//!!! There is no difference in comparing and saving in this method !!!) - - comment(//Building means: Comparing with an empty image.) - - comment(//We go through and make fit it) - - comment(//The following rules are important:) - comment(//Value = "The currently interesting value.) - comment(//LastValue = "The value with X.Next = Value" = "Value.Pref") - - ident(LastValue) operator(:=) reserved(nil)operator(;) comment(// := "Values.Prev") - ident(Value) operator(:=) ident(Values)operator(;) comment(// := "LastValue.Next") - - comment(//Now compare step by step) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Value)operator(\)) reserved(and) operator(()ident(SL)operator([)ident(i)operator(]) operator(=) ident(Value)operator(.)ident(Name)operator(\)) reserved(then) reserved(begin) - comment(//cV= Normally (0.9999\) everything's the same) - ident(LastValue) operator(:=) ident(Value)operator(;) - ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) - reserved(end) reserved(else) reserved(begin) comment(//Something's different? Yes, the IMPORTANT rest (0.0001\)\)) - comment(//Because the list finally must exactly fit SL, the "SL[i] value" hast) - comment(//to be inserted right here. But first let's look...) - - comment(//Maybe it was just moved? So search for it...) - ident(NewValue) operator(:=) reserved(nil)operator(;) - reserved(if) ident(Assigned)operator(()ident(Value)operator(\)) reserved(then) reserved(begin) - ident(SearchValue) operator(:=) ident(Value)operator(;) - reserved(while) ident(Assigned)operator(()ident(SearchValue)operator(.)ident(Next)operator(\)) reserved(do) - reserved(if) operator(()ident(SearchValue)operator(.)ident(Next)operator(.)ident(Name) operator(=) ident(SL)operator([)ident(i)operator(])operator(\)) reserved(then) reserved(begin) - comment(//cV\\) - ident(NewValue) operator(:=) ident(SearchValue)operator(.)ident(Next)operator(;) - ident(AddChange)operator(()string operator(+) ident(Path)operator(\))operator(;) - ident(SearchValue)operator(.)ident(Next) operator(:=) ident(SearchValue)operator(.)ident(Next)operator(.)ident(Next)operator(;) - ident(Break)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(NewValue)operator(\)) reserved(then) reserved(begin) - comment(//cV+ No, not found! So it is new...) - ident(NewValue) operator(:=) ident(TSpyValue)operator(.)ident(Create)operator(()ident(SL)operator([)ident(i)operator(])operator(\))operator(;) - ident(AddChange)operator(()string operator(+) ident(Path) operator(+) string operator(+) ident(NewValue)operator(.)ident(Name)operator(\))operator(;) - reserved(with) ident(NewValue) reserved(do) reserved(begin) - ident(Typ) operator(:=) ident(Reg)operator(.)ident(GetDataType)operator(()ident(SL)operator([)ident(i)operator(])operator(\))operator(;) - ident(Data) operator(:=) ident(Reg)operator(.)ident(ReadBin)operator(()ident(SL)operator([)ident(i)operator(])operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - comment(//The new object now must be placed after the last value) - reserved(if) ident(Assigned)operator(()ident(LastValue)operator(\)) reserved(then) reserved(begin) - ident(LastValue)operator(.)ident(Next) operator(:=) ident(NewValue)operator(;) - reserved(end) reserved(else) reserved(begin) - comment(//If it's the first value, we don't have LastValue defined) - comment(//So we have to set the "Root" to it) - ident(Values) operator(:=) ident(NewValue)operator(;) - reserved(end)operator(;) - comment(//Now the rest of has to be placed after the new value) - ident(NewValue)operator(.)ident(Next) operator(:=) ident(Value)operator(;) - comment(//And LastValue also has to refreshed: It is "Value.Pref" = NewValue!) - ident(LastValue) operator(:=) ident(NewValue)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - comment(//Because the whole before Value is exactly , the rest) - comment(//(if there is one\) must have been deleted!) - - comment(//So first let's ensure that ends here:) - reserved(if) ident(Assigned)operator(()ident(LastValue)operator(\)) reserved(then) reserved(begin) - ident(LastValue)operator(.)ident(Next) operator(:=) reserved(nil)operator(;) - reserved(end) reserved(else) reserved(begin) - comment(//Another time: is empty now, so set Values instead) - ident(Values) operator(:=) reserved(nil)operator(;) - reserved(end)operator(;) - - comment(//Now, the first value that maybe was "cut" off is Value:) - reserved(while) ident(Assigned)operator(()ident(Value)operator(\)) reserved(do) reserved(begin) - comment(//cV- So, here really something HAS been deleted) - ident(LastValue) operator(:=) ident(Value)operator(;) - ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) - ident(AddChange)operator(()string operator(+) ident(Path) operator(+) string operator(+) ident(LastValue)operator(.)ident(Name)operator(\))operator(;) - ident(LastValue)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(CompareData)operator(;) - reserved(var) - ident(Value)operator(:) ident(TSpyValue)operator(;) - ident(Typ)operator(:) ident(TXRegDataType)operator(;) - ident(Data)operator(:) ident(TByteA)operator(;) - reserved(begin) - comment(//So, finally = . That means we now can compare the data:) - ident(Value) operator(:=) ident(Values)operator(;) - reserved(while) ident(Assigned)operator(()ident(Value)operator(\)) reserved(do) reserved(begin) - ident(Typ) operator(:=) ident(Reg)operator(.)ident(GetDataType)operator(()ident(Value)operator(.)ident(Name)operator(\))operator(;) - ident(Data) operator(:=) ident(Reg)operator(.)ident(ReadBin)operator(()ident(Value)operator(.)ident(Name)operator(\))operator(;) - reserved(if) ident(Typ) operator(<>) ident(Value)operator(.)ident(Typ) reserved(then) reserved(begin) - comment(//cT#) - ident(AddChange)operator(()string operator(+) ident(Path) operator(+) string operator(+) ident(Value)operator(.)ident(Name)operator(\))operator(;) - ident(Value)operator(.)ident(Typ) operator(:=) ident(Typ)operator(;) - reserved(end)operator(;) - reserved(if) reserved(not) ident(SameByteA)operator(()ident(Data)operator(,) ident(Value)operator(.)ident(Data)operator(\)) reserved(then) reserved(begin) - comment(//cD#) - ident(AddChange)operator(()string operator(+) ident(Path) operator(+) string operator(+) ident(Value)operator(.)ident(Name)operator(\))operator(;) - ident(Value)operator(.)ident(Data) operator(:=) ident(Data)operator(;) - reserved(end)operator(;) - - ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(CompareKeys)operator(;) - reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(Key)operator(,) ident(LastKey)operator(,) ident(NewKey)operator(,) ident(SearchKey)operator(:) ident(TSpyKey)operator(;) - ident(NewHKEY)operator(:) ident(HKEY)operator(;) - reserved(begin) - comment(//OK, this part is a little bit complicate. So I will comment very much.) - comment(//First, two terms are important:) - comment(// means the list of keys that will be read from the registry now:) - ident(Reg)operator(.)ident(GetKeyNames)operator(()ident(SL)operator(\))operator(;) - comment(//So is TStringList.) - - comment(// means the image that was saved before.) - comment(//Here, it is a linear list of TSpyKey objects. That means that you can) - comment(//only get X.Next and not X.Prev! However, I use "X.Prev" to simplify) - comment(//some comments.) - - comment(//!!! Comparing means: Make fit !!!) - - comment(//If wasn't saved before, it is just empty.) - - comment(//!!! There is no difference in comparing and saving in this method !!!) - - comment(//Building means: Comparing with an empty image.) - - comment(//We go through and make fit it) - - comment(//The following rules are important:) - comment(//Key = "The currently interesting key.) - comment(//LastKey = "The key with X.Next = Key" = "Key.Pref") - - ident(LastKey) operator(:=) reserved(nil)operator(;) comment(// := "Keys.Prev") - ident(Key) operator(:=) ident(Keys)operator(;) comment(// := "LastKey.Next") - - comment(//Now compare step by step) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Key)operator(\)) reserved(and) operator(()ident(SL)operator([)ident(i)operator(]) operator(=) ident(Key)operator(.)ident(Name)operator(\)) reserved(then) reserved(begin) - comment(//cK= Normally (0.9999\) everything's the same) - ident(RegOpenKey)operator(()ident(AHKEY)operator(,) ident(PChar)operator(()ident(SL)operator([)ident(i)operator(])operator(\))operator(,) ident(NewHKEY)operator(\))operator(;) - ident(Key)operator(.)ident(Spy)operator(()ident(NewHKEY)operator(\))operator(;) - ident(LastKey) operator(:=) ident(Key)operator(;) - ident(Key) operator(:=) ident(Key)operator(.)ident(Next)operator(;) - reserved(end) reserved(else) reserved(begin) comment(//Something's different? Yes, the IMPORTANT rest (0.0001\)\)) - comment(//Because the list finally must exactly fit SL, the "SL[i] key" hast) - comment(//to be inserted right here. But first let's look...) - - comment(//Maybe it was just moved? So search for it...) - ident(NewKey) operator(:=) reserved(nil)operator(;) - reserved(if) ident(Assigned)operator(()ident(Key)operator(\)) reserved(then) reserved(begin) - ident(SearchKey) operator(:=) ident(Key)operator(;) - reserved(while) ident(Assigned)operator(()ident(SearchKey)operator(.)ident(Next)operator(\)) reserved(do) - reserved(if) operator(()ident(SearchKey)operator(.)ident(Next)operator(.)ident(Name) operator(=) ident(SL)operator([)ident(i)operator(])operator(\)) reserved(then) reserved(begin) - comment(//cK\\) - ident(NewKey) operator(:=) ident(SearchKey)operator(.)ident(Next)operator(;) - ident(AddChange)operator(()string operator(+) ident(Path)operator(\))operator(;) - ident(SearchKey)operator(.)ident(Next) operator(:=) ident(SearchKey)operator(.)ident(Next)operator(.)ident(Next)operator(;) - ident(Break)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(NewKey)operator(\)) reserved(then) reserved(begin) - comment(//cK+ No, not found! So it is new...) - ident(NewKey) operator(:=) ident(TSpyKey)operator(.)ident(Create)operator(()ident(Self)operator(,) ident(SL)operator([)ident(i)operator(])operator(\))operator(;) - ident(AddChange)operator(()string operator(+) ident(Path) operator(+) char operator(+) ident(NewKey)operator(.)ident(Name)operator(\))operator(;) - - ident(RegOpenKey)operator(()ident(AHKEY)operator(,) ident(PChar)operator(()ident(SL)operator([)ident(i)operator(])operator(\))operator(,) ident(NewHKEY)operator(\))operator(;) - ident(NewKey)operator(.)ident(Spy)operator(()ident(NewHKEY)operator(\))operator(;) - reserved(end)operator(;) - - comment(//The new object now must be placed after the last key) - reserved(if) ident(Assigned)operator(()ident(LastKey)operator(\)) reserved(then) reserved(begin) - ident(LastKey)operator(.)ident(Next) operator(:=) ident(NewKey)operator(;) - reserved(end) reserved(else) reserved(begin) - comment(//If it's the first key, we don't have LastKey defined) - comment(//So we have to set the "Root" to it) - ident(Keys) operator(:=) ident(NewKey)operator(;) - reserved(end)operator(;) - comment(//Now the rest of has to be placed after the new key) - ident(NewKey)operator(.)ident(Next) operator(:=) ident(Key)operator(;) - comment(//And LastKey also has to refreshed: It is "Key.Pref" = NewKey!) - ident(LastKey) operator(:=) ident(NewKey)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - comment(//Because the whole before Key is exactly , the rest) - comment(//(if there is one\) must have been deleted!) - - comment(//So first let's ensure that ends here:) - reserved(if) ident(Assigned)operator(()ident(LastKey)operator(\)) reserved(then) reserved(begin) - ident(LastKey)operator(.)ident(Next) operator(:=) reserved(nil)operator(;) - reserved(end) reserved(else) reserved(begin) - comment(//Another time: is empty now, so set Keys instead) - ident(Keys) operator(:=) reserved(nil)operator(;) - reserved(end)operator(;) - - comment(//Now, the first key that maybe was "cut" off is Key:) - reserved(while) ident(Assigned)operator(()ident(Key)operator(\)) reserved(do) reserved(begin) - comment(//cV- So, here really something HAS been deleted) - ident(LastKey) operator(:=) ident(Key)operator(;) - ident(Key) operator(:=) ident(Key)operator(.)ident(Next)operator(;) - ident(AddChange)operator(()string operator(+) ident(Path) operator(+) char operator(+) ident(LastKey)operator(.)ident(Name)operator(\))operator(;) - ident(LastKey)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - -reserved(begin) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - - reserved(try) - ident(Reg)operator(.)ident(CurrentKey) operator(:=) ident(AHKEY)operator(;) - - ident(CompareValues)operator(;) - - ident(CompareData)operator(;) - - ident(CompareKeys)operator(;) - - reserved(finally) - ident(RegCloseKey)operator(()ident(AHKEY)operator(\))operator(;) - reserved(end)operator(;) - - ident(SL)operator(.)ident(Free)operator(;) -reserved(end)operator(;) - -reserved(initialization) - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - ident(HKLMSpyKey) operator(:=) ident(TSpyKey)operator(.)ident(Create)operator(()reserved(nil)operator(,) stringoperator(\))operator(;) - ident(HKUSpyKey) operator(:=) ident(TSpyKey)operator(.)ident(Create)operator(()reserved(nil)operator(,) stringoperator(\))operator(;) - -reserved(finalization) - ident(Reg)operator(.)ident(Free)operator(;) - ident(HKLMSpyKey)operator(.)ident(Free)operator(;) - ident(HKUSpyKey)operator(.)ident(Free)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(SisyphusTH)operator(;) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(Classes)operator(,) ident(StdCtrls)operator(,) ident(Dialogs)operator(,) ident(SysUtils)operator(,) ident(XReg)operator(,) ident(YTools)operator(,) ident(YTypes)operator(,) ident(Clock)operator(,) - ident(ComCtrls)operator(,) ident(PlutoConst)operator(,) ident(UniKey)operator(,) ident(CompEx)operator(;) - -reserved(const) - ident(SisyVersion) operator(=) stringoperator(;) - ident(StatusPoints) operator(=) integer(25)operator(;) - -reserved(type) - ident(TSisyChangeType) operator(=) operator(()ident(cNone)operator(,) ident(cError)operator(,) - ident(cKeyPlus)operator(,) ident(cKeyMinus)operator(,) - ident(cValuePlus)operator(,) ident(cValueMinus)operator(,) - ident(cContextChange)operator(\))operator(;) - -reserved(const) - ident(SisyChangeStrings)operator(:) reserved(array)operator([)ident(TSisyChangeType)operator(]) reserved(of) reserved(string) operator(=) - operator(()charoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) - stringoperator(\))operator(;) - -reserved(type) - ident(TSpyValue) operator(=) reserved(class) - ident(Name)operator(:) reserved(string)operator(;) - ident(Next)operator(:) ident(TSpyValue)operator(;) - ident(Context)operator(:) ident(TRegContext)operator(;) - reserved(constructor) ident(Create)operator(()reserved(const) ident(Name)operator(:) reserved(string)operator(;) ident(Context)operator(:) ident(TRegContext)operator(\))operator(;) - reserved(end)operator(;) - - ident(TSisyThread) operator(=) reserved(class)operator(;) - - ident(TSpyKey) operator(=) reserved(class) - directive(public) - ident(Parent)operator(:) ident(TSpyKey)operator(;) - ident(Name)operator(:) reserved(string)operator(;) - ident(Next)operator(:) ident(TSpyKey)operator(;) - ident(Keys)operator(:) ident(TSpyKey)operator(;) - ident(Values)operator(:) ident(TSpyValue)operator(;) - reserved(procedure) ident(Spy)operator(()ident(AHKEY)operator(:) ident(HKEY)operator(;) ident(Sisy)operator(:) ident(TSisyThread)operator(\))operator(;) - reserved(function) ident(Path)operator(:) reserved(string)operator(;) - reserved(constructor) ident(Create)operator(()ident(AParent)operator(:) ident(TSpyKey)operator(;) ident(AName)operator(:) reserved(string)operator(\))operator(;) - reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) - reserved(end)operator(;) - - ident(TSisyChange) operator(=) reserved(class) - directive(public) - ident(Typ)operator(:) ident(TSisyChangeType)operator(;) - ident(Path)operator(:) reserved(string)operator(;) - ident(Old)operator(,) ident(New)operator(:) ident(TRegContext)operator(;) - reserved(constructor) ident(Create)operator(()ident(ATyp)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(APath)operator(:) reserved(string)operator(;) - ident(AOldContext)operator(:) ident(TRegContext)operator(;) ident(ANewContext)operator(:) ident(TRegContext)operator(\))operator(;) - reserved(procedure) ident(ReportToPluto)operator(;) - reserved(end)operator(;) - - ident(TSisyChangeEvent) operator(=) reserved(procedure) operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\)) reserved(of) reserved(object)operator(;) - ident(TSisyThread) operator(=) reserved(class)operator(()ident(TThread)operator(\)) - directive(private) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - ident(Key)operator(:) ident(TSpyKey)operator(;) - ident(KeyHKEY)operator(:) ident(HKEY)operator(;) - ident(CurrentChange)operator(:) ident(TSisyChange)operator(;) - ident(FOnChange)operator(:) ident(TSisyChangeEvent)operator(;) - ident(FOnSpecialChanges)operator(:) reserved(array)operator([)ident(TSisyChangeType)operator(]) reserved(of) ident(TSisyChangeEvent)operator(;) - reserved(procedure) ident(FreeKey)operator(;) - reserved(procedure) ident(IncKeyCount)operator(;) - reserved(procedure) ident(IncKeyIndex)operator(;) - reserved(function) ident(GetSpecialChange)operator(()ident(ChangeType)operator(:) ident(TSisyChangeType)operator(\))operator(:) ident(TSisyChangeEvent)operator(;) - reserved(procedure) ident(SetSpecialChange)operator(()ident(ChangeType)operator(:) ident(TSisyChangeType)operator(;) - reserved(const) ident(Value)operator(:) ident(TSisyChangeEvent)operator(\))operator(;) - directive(protected) - reserved(procedure) ident(AddValueChange)operator(()ident(Typ)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(Path)operator(:) reserved(string)operator(;) - ident(Old)operator(,) ident(New)operator(:) ident(TRegContext)operator(\))operator(;) - reserved(procedure) ident(AddKeyChange)operator(()ident(Typ)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(Path)operator(:) reserved(string)operator(\))operator(;) - reserved(procedure) ident(Execute)operator(;) directive(override)operator(;) - reserved(procedure) ident(ShowInfo)operator(;) - reserved(procedure) ident(NotifyChange)operator(;) - reserved(procedure) ident(ReportCurrentChange)operator(;) - directive(public) - ident(CurrentSpyKey)operator(:) ident(TSpyKey)operator(;) - ident(StatusLabel)operator(:) ident(TLabel)operator(;) - ident(Name)operator(:) reserved(string)operator(;) - ident(Started)operator(:) ident(Boolean)operator(;) - ident(DoReport)operator(:) ident(Boolean)operator(;) - ident(SecsPerRound)operator(:) ident(Double)operator(;) - ident(InfoForShow)operator(:) reserved(string)operator(;) - ident(OnStarted)operator(:) ident(TNotifyEvent)operator(;) - ident(KeyCount)operator(:) ident(Integer)operator(;) - ident(PrevKeyCount)operator(:) ident(Integer)operator(;) - ident(KeyIndex)operator(:) ident(Integer)operator(;) - ident(TheClock)operator(:) ident(TClock)operator(;) - ident(Uni)operator(:) ident(TUniKey)operator(;) - ident(MaxValueCountToScan)operator(,) ident(MaxKeyCountToScan)operator(,) ident(MaxDataLenToScan)operator(:) ident(Cardinal)operator(;) - reserved(constructor) ident(CreateIt)operator(()reserved(const) ident(AName)operator(,) ident(AKeyName)operator(:) reserved(string)operator(;) ident(AHKEY)operator(:) ident(HKEY)operator(;) - ident(ALabel)operator(:) ident(TLabel)operator(;) ident(AUniKey)operator(:) ident(TUniKey)operator(\))operator(;) - reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) - - reserved(property) ident(OnChange)operator(:) ident(TSisyChangeEvent) directive(read) ident(FOnChange) directive(write) ident(FOnChange)operator(;) - reserved(property) ident(OnSpecialChange)operator([)ident(ChangeType)operator(:) ident(TSisyChangeType)operator(])operator(:) ident(TSisyChangeEvent) - directive(read) ident(GetSpecialChange) directive(write) ident(SetSpecialChange)operator(;) - reserved(end)operator(;) - - ident(TSisyList) operator(=) reserved(class)operator(()ident(TList)operator(\)) - directive(protected) - reserved(function) ident(GetSisy)operator(()ident(Index)operator(:) ident(Integer)operator(\))operator(:) ident(TSisyThread)operator(;) - reserved(procedure) ident(PutSisy)operator(()ident(Index)operator(:) ident(Integer)operator(;) ident(Sisy)operator(:) ident(TSisyThread)operator(\))operator(;) - directive(public) - reserved(procedure) ident(Suspend)operator(;) - reserved(procedure) ident(Resume)operator(;) - reserved(property) ident(Items)operator([)ident(Index)operator(:) ident(Integer)operator(])operator(:) ident(TSisyThread) directive(read) ident(GetSisy) directive(write) ident(PutSisy)operator(;) ident(default)operator(;) - reserved(end)operator(;) - -reserved(procedure) ident(SetSisyChangeState)operator(()ident(Node)operator(:) ident(TTreeNode)operator(;) ident(Active)operator(:) ident(Boolean)operator(\))operator(;) -reserved(function) ident(SisyChangeActivated)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(Boolean)operator(;) - -reserved(var) - ident(SisyFilter)operator(:) ident(TStringList)operator(;) - -reserved(implementation) - -reserved(uses) ident(plutomain)operator(,) ident(workU)operator(,) ident(ValuesU)operator(;) - -reserved(procedure) ident(SetSisyChangeState)operator(()ident(Node)operator(:) ident(TTreeNode)operator(;) ident(Active)operator(:) ident(Boolean)operator(\))operator(;) -reserved(begin) - ident(Node)operator(.)ident(Data) operator(:=) ident(Pointer)operator(()reserved(not) ident(Active)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(SisyChangeActivated)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Node)operator(.)ident(Data) operator(=) ident(Pointer)operator(()ident(False)operator(\))operator(;) -reserved(end)operator(;) - -comment({ TSisyThread }) - -reserved(constructor) ident(TSisyThread)operator(.)ident(CreateIt)operator(()reserved(const) ident(AName)operator(,) ident(AKeyName)operator(:) reserved(string)operator(;) - ident(AHKEY)operator(:) ident(HKEY)operator(;) ident(ALabel)operator(:) ident(TLabel)operator(;) ident(AUniKey)operator(:) ident(TUniKey)operator(\))operator(;) -reserved(begin) - reserved(inherited) ident(Create)operator(()ident(True)operator(\))operator(;) comment(// Create thread suspended) - - ident(Started) operator(:=) ident(False)operator(;) - ident(DoReport) operator(:=) ident(True)operator(;) - ident(KeyCount) operator(:=) integer(0)operator(;) - ident(FreeOnTerminate) operator(:=) ident(False)operator(;) comment(// Thread frees itself not when terminated) - - ident(KeyHKEY) operator(:=) ident(AHKEY)operator(;) - ident(Name) operator(:=) ident(AName)operator(;) - ident(StatusLabel) operator(:=) ident(ALabel)operator(;) - ident(StatusLabel)operator(.)ident(Caption) operator(:=) stringoperator(;) - - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - ident(TheClock) operator(:=) ident(TClock)operator(.)ident(Create)operator(;) - - ident(Uni) operator(:=) ident(AUniKey)operator(.)ident(GetKey)operator(()ident(Name)operator(\))operator(;) - ident(Priority) operator(:=) ident(TThreadPriority)operator(()ident(Uni)operator(.)ident(ReadInteger)operator(()stringoperator(,) ident(Integer)operator(()ident(tpLowest)operator(\))operator(\))operator(\))operator(;) - ident(PrevKeyCount) operator(:=) ident(Uni)operator(.)ident(ReadInteger)operator(()stringoperator(,) integer(0)operator(\))operator(;) - - ident(MaxKeyCountToScan) operator(:=) ident(Cardinal)operator(()ident(Uni)operator(.)ident(ReadInteger)operator(()stringoperator(,) operator(-)integer(1)operator(\))operator(\))operator(;) - ident(MaxValueCountToScan) operator(:=) ident(Cardinal)operator(()ident(Uni)operator(.)ident(ReadInteger)operator(()stringoperator(,) operator(-)integer(1)operator(\))operator(\))operator(;) - ident(MaxDataLenToScan) operator(:=) ident(Cardinal)operator(()ident(Uni)operator(.)ident(ReadInteger)operator(()stringoperator(,) operator(-)integer(1)operator(\))operator(\))operator(;) - - ident(Key) operator(:=) ident(TSpyKey)operator(.)ident(Create)operator(()reserved(nil)operator(,) ident(AKeyName)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyThread)operator(.)ident(FreeKey)operator(;) -reserved(begin) - ident(Reg)operator(.)ident(Free)operator(;) - ident(TheClock)operator(.)ident(Free)operator(;) - ident(Key)operator(.)ident(Free)operator(;) -reserved(end)operator(;) - -reserved(destructor) ident(TSisyThread)operator(.)ident(Destroy)operator(;) -reserved(begin) - ident(Synchronize)operator(()ident(FreeKey)operator(\))operator(;) - reserved(inherited)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyThread)operator(.)ident(Execute)operator(;) -reserved(begin) - ident(InfoForShow) operator(:=) ident(Name) operator(+) stringoperator(;) - ident(Synchronize)operator(()ident(ShowInfo)operator(\))operator(;) - - ident(TheClock)operator(.)ident(Restart)operator(;) - ident(Started) operator(:=) ident(False)operator(;) - reserved(while) reserved(not) ident(Terminated) reserved(do) - reserved(try) - ident(KeyIndex) operator(:=) integer(0)operator(;) - - comment({ ===================== }) - ident(Key)operator(.)ident(Spy)operator(()ident(KeyHKEY)operator(,) ident(Self)operator(\))operator(;) - comment({ ===================== }) - - reserved(if) ident(Terminated) reserved(then) - ident(Continue)operator(;) comment(//= Exit) - - ident(SecsPerRound) operator(:=) ident(TheClock)operator(.)ident(SecondsPassed)operator(;) - ident(TheClock)operator(.)ident(Restart)operator(;) - reserved(if) reserved(not) ident(Started) reserved(then) reserved(begin) - ident(Started) operator(:=) ident(True)operator(;) - ident(Uni)operator(.)ident(WriteInteger)operator(()stringoperator(,) ident(KeyCount)operator(\))operator(;) - reserved(if) ident(Assigned)operator(()ident(OnStarted)operator(\)) reserved(then) - ident(OnStarted)operator(()ident(Self)operator(\))operator(;) - reserved(end)operator(;) - reserved(except) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyThread)operator(.)ident(AddValueChange)operator(()ident(Typ)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(Path)operator(:) reserved(string)operator(;) - ident(Old)operator(,) ident(New)operator(:) ident(TRegContext)operator(\))operator(;) - - reserved(procedure) ident(TryNotify)operator(()ident(Event)operator(:) ident(TSisyCHangeEvent)operator(\))operator(;) - reserved(begin) - - reserved(end)operator(;) - -reserved(begin) - reserved(if) reserved(not) operator(()ident(Started) reserved(and) ident(DoReport)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(CurrentChange) operator(:=) ident(TSisyChange)operator(.)ident(Create)operator(()ident(Typ)operator(,) ident(Path)operator(,) ident(Old)operator(,) ident(New)operator(\))operator(;) - ident(Synchronize)operator(()ident(ReportCurrentChange)operator(\))operator(;) - ident(Synchronize)operator(()ident(NotifyChange)operator(\))operator(;) - -comment(// CurrentChange.Free; //this makes Pluto itself) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyThread)operator(.)ident(AddKeyChange)operator(()ident(Typ)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(Path)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - ident(AddValueChange)operator(()ident(Typ)operator(,) ident(Path)operator(,) ident(ZeroRegContext)operator(,) ident(ZeroRegContext)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyThread)operator(.)ident(ShowInfo)operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(StatusLabel)operator(\)) reserved(then) - ident(StatusLabel)operator(.)ident(Caption) operator(:=) ident(InfoForShow)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyThread)operator(.)ident(ReportCurrentChange)operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(CurrentChange)operator(\)) reserved(then) - ident(CurrentChange)operator(.)ident(ReportToPluto)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyThread)operator(.)ident(IncKeyCount)operator(;) -reserved(var) - ident(c)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(Started) reserved(then) - ident(Exit)operator(;) - - ident(Inc)operator(()ident(KeyCount)operator(\))operator(;) - - reserved(if) operator(()ident(KeyCount) reserved(and) hex($1FF)operator(\)) operator(=) integer(0) reserved(then) reserved(begin) - reserved(if) ident(KeyCount) operator(>) ident(PrevKeyCount) reserved(then) - ident(PrevKeyCount) operator(:=) ident(KeyCount)operator(;) - - ident(c) operator(:=) integer(0)operator(;) - reserved(if) ident(PrevkeyCount) operator(>) integer(0) reserved(then) - ident(c) operator(:=) ident(Round)operator(()operator(()ident(KeyCount) operator(*) ident(StatusPoints)operator(\)) operator(/) ident(PrevKeyCount)operator(\))operator(;) - ident(InfoForShow) operator(:=) char operator(+) ident(MulStr)operator(()charoperator(,) ident(c)operator(\)) operator(+) ident(MulStr)operator(()charoperator(,) ident(StatusPoints) operator(-) ident(c)operator(\)) operator(+) char operator(+) - ident(Format)operator(()stringoperator(,) - operator([)ident(TheClock)operator(.)ident(SecondsPassed)operator(,) ident(KeyCount)operator(,) ident(PrevKeyCount)operator(])operator(\))operator(;) - - ident(Synchronize)operator(()ident(ShowInfo)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyThread)operator(.)ident(IncKeyIndex)operator(;) -reserved(var) - ident(c)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) reserved(not) ident(Started) reserved(then) - ident(Exit)operator(;) - - ident(Inc)operator(()ident(KeyIndex)operator(\))operator(;) - - reserved(if) operator(()operator(()ident(KeyIndex) reserved(and) hex($1FF)operator(\)) operator(=) integer(0)operator(\)) reserved(and) operator(()ident(KeyCount) operator(>) integer(0)operator(\)) reserved(then) reserved(begin) - reserved(if) ident(KeyIndex) operator(>) ident(KeyCount) reserved(then) - ident(KeyCount) operator(:=) ident(KeyIndex)operator(;) - - ident(c) operator(:=) integer(0)operator(;) - reserved(if) ident(KeyCount) operator(>) integer(0) reserved(then) - ident(c) operator(:=) ident(Round)operator(()operator(()ident(KeyIndex) operator(*) ident(StatusPoints)operator(\)) operator(/) ident(KeyCount)operator(\))operator(;) - - ident(InfoForShow) operator(:=) char operator(+) ident(MulStr)operator(()charoperator(,) ident(c)operator(\)) operator(+) ident(MulStr)operator(()charoperator(,) ident(StatusPoints) operator(-) ident(c)operator(\)) operator(+) char operator(+) - ident(Format)operator(()stringoperator(,) operator([)ident(SecsPerRound)operator(,) ident(KeyIndex)operator(,) ident(KeyCount)operator(])operator(\))operator(;) - - ident(Synchronize)operator(()ident(ShowInfo)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TSisyThread)operator(.)ident(GetSpecialChange)operator(()ident(ChangeType)operator(:) ident(TSisyChangeType)operator(\))operator(:) - ident(TSisyChangeEvent)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(FOnSpecialChanges)operator([)ident(ChangeType)operator(])operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyThread)operator(.)ident(SetSpecialChange)operator(()ident(ChangeType)operator(:) ident(TSisyChangeType)operator(;) - reserved(const) ident(Value)operator(:) ident(TSisyChangeEvent)operator(\))operator(;) -reserved(begin) - ident(FOnSpecialChanges)operator([)ident(ChangeType)operator(]) operator(:=) ident(Value)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyThread)operator(.)ident(NotifyChange)operator(;) -reserved(var) - ident(Event)operator(:) ident(TSisyChangeEvent)operator(;) -reserved(begin) - ident(Event) operator(:=) ident(FOnSpecialChanges)operator([)ident(CurrentChange)operator(.)ident(Typ)operator(])operator(;) - reserved(if) ident(Assigned)operator(()ident(Event)operator(\)) reserved(then) - ident(Event)operator(()ident(Self)operator(,) ident(CurrentChange)operator(\))operator(;) - - reserved(if) ident(Assigned)operator(()ident(FOnChange)operator(\)) reserved(then) - ident(FOnChange)operator(()ident(Self)operator(,) ident(CurrentChange)operator(\))operator(;) -reserved(end)operator(;) - -comment({ TSpyValue }) - -reserved(constructor) ident(TSpyValue)operator(.)ident(Create)operator(()reserved(const) ident(Name)operator(:) reserved(string)operator(;) ident(Context)operator(:) ident(TRegContext)operator(\))operator(;) -reserved(begin) - ident(Self)operator(.)ident(Name) operator(:=) ident(Name)operator(;) - ident(Next) operator(:=) reserved(nil)operator(;) - ident(Self)operator(.)ident(Context) operator(:=) ident(Context)operator(;) -reserved(end)operator(;) - -comment({ TSpyKey }) - -reserved(constructor) ident(TSpyKey)operator(.)ident(Create)operator(()ident(AParent)operator(:) ident(TSpyKey)operator(;) ident(AName)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - ident(Name) operator(:=) ident(AName)operator(;) - ident(Parent) operator(:=) ident(AParent)operator(;) - - ident(Next) operator(:=) reserved(nil)operator(;) - ident(Keys) operator(:=) reserved(nil)operator(;) - ident(Values) operator(:=) reserved(nil)operator(;) -reserved(end)operator(;) - -reserved(destructor) ident(TSpyKey)operator(.)ident(Destroy)operator(;) -reserved(var) - ident(Value)operator(,) ident(NextValue)operator(:) ident(TSpyValue)operator(;) - ident(Key)operator(,) ident(NextKey)operator(:) ident(TSpyKey)operator(;) -reserved(begin) - ident(Value) operator(:=) ident(Values)operator(;) - reserved(while) ident(Assigned)operator(()ident(Value)operator(\)) reserved(do) reserved(begin) - ident(NextValue) operator(:=) ident(Value)operator(.)ident(Next)operator(;) - ident(Value)operator(.)ident(Free)operator(;) - ident(Value) operator(:=) ident(NextValue)operator(;) - reserved(end)operator(;) - - ident(Key) operator(:=) ident(Keys)operator(;) - reserved(while) ident(Assigned)operator(()ident(Key)operator(\)) reserved(do) reserved(begin) - ident(NextKey) operator(:=) ident(Key)operator(.)ident(Next)operator(;) - ident(Key)operator(.)ident(Free)operator(;) - ident(Key) operator(:=) ident(NextKey)operator(;) - reserved(end)operator(;) - - reserved(inherited)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TSpyKey)operator(.)ident(Path)operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Parent)operator(\)) reserved(then) - ident(Result) operator(:=) ident(Parent)operator(.)ident(Path) operator(+) char - reserved(else) - ident(Result) operator(:=) stringoperator(;) - - ident(Result) operator(:=) ident(Result) operator(+) ident(Name)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSpyKey)operator(.)ident(Spy)operator(()ident(AHKEY)operator(:) ident(HKEY)operator(;) ident(Sisy)operator(:) ident(TSisyThread)operator(\))operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) - ident(LastKey)operator(:) ident(TSpyKey)operator(;) - - reserved(procedure) ident(CompareValues)operator(;) - reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(Value)operator(,) ident(LastValue)operator(,) ident(NewValue)operator(,) ident(SearchValue)operator(,) ident(SearchValue_Prev)operator(:) ident(TSpyValue)operator(;) - reserved(begin) - comment(//OK, this part is a little bit complicate. So I will comment very much.) - comment(//First, two terms are important:) - comment(// means the list of values that will be read from the registry now:) - ident(Sisy)operator(.)ident(Reg)operator(.)ident(GetValueNames)operator(()ident(SL)operator(\))operator(;) - reserved(if) ident(Cardinal)operator(()ident(SL)operator(.)ident(Count)operator(\)) operator(>) ident(Sisy)operator(.)ident(MaxValueCountToScan) reserved(then) - ident(Exit)operator(;) - comment(//So is TStringList.) - - comment(// means the image that was saved before.) - comment(//Here, it is a linear list of TSpyValue objects. That means that you can) - comment(//only get X.Next and not X.Prev! However, I use "X.Prev" to simplify) - comment(//some comments.) - - comment(//!!! Comparing means: Make fit !!!) - - comment(//If wasn't saved before, it is just empty.) - - comment(//!!! There is no difference in comparing and saving in this method !!!) - - comment(//Building means: Comparing with an empty image.) - - comment(//We go through and make fit it) - - comment(//The following rules are important:) - comment(//Value = "The currently interesting value.) - comment(//LastValue = "The value with X.Next = Value" = "Value.Pref") - - ident(LastValue) operator(:=) reserved(nil)operator(;) comment(// := "Values.Prev") - ident(Value) operator(:=) ident(Values)operator(;) comment(// := "LastValue.Next") - - comment(//Now compare step by step) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Value)operator(\)) reserved(and) operator(()ident(SL)operator([)ident(i)operator(]) operator(=) ident(Value)operator(.)ident(Name)operator(\)) reserved(then) reserved(begin) - comment(//cV= Normally (0.9999\) everything's the same) - ident(LastValue) operator(:=) ident(Value)operator(;) - ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) - reserved(end) reserved(else) reserved(begin) comment(//Something's different? Yes, the IMPORTANT rest (0.0001\)\)) - comment(//Because the list finally must exactly fit SL, the "SL[i] value" hast) - comment(//to be inserted right here. But first let's look...) - - comment(//Maybe it was just moved? So search for it...) - ident(NewValue) operator(:=) reserved(nil)operator(;) - reserved(if) ident(Assigned)operator(()ident(Value)operator(\)) reserved(then) reserved(begin) - ident(SearchValue_Prev) operator(:=) ident(Value)operator(;) - ident(SearchValue) operator(:=) ident(Value)operator(.)ident(Next)operator(;) - reserved(while) ident(Assigned)operator(()ident(SearchValue)operator(\)) reserved(do) reserved(begin) - reserved(if) ident(SearchValue)operator(.)ident(Name) operator(=) ident(SL)operator([)ident(i)operator(]) reserved(then) reserved(begin) comment(//we found our moved value) - ident(SearchValue_Prev)operator(.)ident(Next) operator(:=) ident(SearchValue)operator(.)ident(Next)operator(;) comment(//delete it from ) - ident(NewValue) operator(:=) ident(SearchValue)operator(;) comment(//save that we found it) - ident(Break) reserved(end)operator(;) - ident(SearchValue_Prev) operator(:=) ident(SearchValue)operator(;) - ident(SearchValue) operator(:=) ident(SearchValue)operator(.)ident(Next)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(NewValue)operator(\)) reserved(then) reserved(begin) - comment(//cV+ No, not found! So it is new...) - ident(NewValue) operator(:=) ident(TSpyValue)operator(.)ident(Create)operator(()ident(SL)operator([)ident(i)operator(])operator(,) ident(Sisy)operator(.)ident(Reg)operator(.)ident(ReadContext)operator(()ident(SL)operator([)ident(i)operator(])operator(\))operator(\))operator(;) - comment({ ================ cV+ ================ }) - reserved(if) ident(Sisy)operator(.)ident(Started) reserved(and) ident(Sisy)operator(.)ident(Reg)operator(.)ident(ValueReallyExists)operator(()ident(SL)operator([)ident(i)operator(])operator(\)) reserved(then) - ident(Sisy)operator(.)ident(AddValueChange)operator(()ident(cValuePlus)operator(,) ident(Path) operator(+) string operator(+) ident(NewValue)operator(.)ident(Name)operator(,) - ident(ZeroRegContext)operator(,) ident(NewValue)operator(.)ident(Context)operator(\))operator(;) - reserved(end)operator(;) - - comment(//The new object now must be placed after the last value) - reserved(if) ident(Assigned)operator(()ident(LastValue)operator(\)) reserved(then) - ident(LastValue)operator(.)ident(Next) operator(:=) ident(NewValue) - reserved(else) - comment(//If it's the first value, we don't have LastValue defined) - comment(//So we have to set the "Root" to it) - ident(Values) operator(:=) ident(NewValue)operator(;) - - comment(//Now the rest of has to be placed after the new value) - ident(NewValue)operator(.)ident(Next) operator(:=) ident(Value)operator(;) - comment(//And LastValue also has to refreshed: It is "Value.Pref" = NewValue!) - ident(LastValue) operator(:=) ident(NewValue)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - comment(//Because the whole before Value is exactly , the rest) - comment(//(if there is one\) must have been deleted!) - - comment(//So first let's ensure that ends here:) - reserved(if) ident(Assigned)operator(()ident(LastValue)operator(\)) reserved(then) - ident(LastValue)operator(.)ident(Next) operator(:=) reserved(nil) - reserved(else) - comment(//Another time: is empty now, so set Values instead) - ident(Values) operator(:=) reserved(nil)operator(;) - - comment(//Now, the first value that maybe was "cut" off is Value:) - reserved(while) ident(Assigned)operator(()ident(Value)operator(\)) reserved(do) reserved(begin) - comment(//cV- So, here really something HAS been deleted) - ident(LastValue) operator(:=) ident(Value)operator(;) - ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) - comment({ ================ cV- ================ }) - reserved(if) ident(Sisy)operator(.)ident(Started) reserved(and) reserved(not) ident(Sisy)operator(.)ident(Reg)operator(.)ident(ValueReallyExists)operator(()ident(LastValue)operator(.)ident(Name)operator(\)) reserved(then) - ident(Sisy)operator(.)ident(AddValueChange)operator(()ident(cValueMinus)operator(,) ident(Path) operator(+) string operator(+) ident(LastValue)operator(.)ident(Name)operator(,) - ident(LastValue)operator(.)ident(Context)operator(,) ident(ZeroRegContext)operator(\))operator(;) - ident(LastValue)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(CompareData)operator(;) - reserved(var) - ident(Value)operator(:) ident(TSpyValue)operator(;) - ident(Context)operator(:) ident(TRegContext)operator(;) - ident(Size)operator(:) ident(Cardinal)operator(;) - reserved(begin) - ident(Context) operator(:=) ident(ZeroRegContext)operator(;) comment(//Initialize) - comment(//So, finally = . That means we now can compare the data:) - ident(Value) operator(:=) ident(Values)operator(;) - reserved(while) ident(Assigned)operator(()ident(Value)operator(\)) reserved(and) reserved(not) ident(Sisy)operator(.)ident(Terminated) reserved(do) reserved(begin) - ident(Size) operator(:=) ident(Sisy)operator(.)ident(Reg)operator(.)ident(GetDataSize)operator(()ident(Value)operator(.)ident(Name)operator(\))operator(;) - reserved(if) operator(()ident(Size) operator(=) ident(Cardinal)operator(()operator(-)integer(1)operator(\))operator(\)) reserved(or) - operator(()ident(Size) operator(<=) ident(Sisy)operator(.)ident(MaxDataLenToScan)operator(\)) reserved(then) reserved(begin) - ident(Context) operator(:=) ident(Sisy)operator(.)ident(Reg)operator(.)ident(ReadContext)operator(()ident(Value)operator(.)ident(Name)operator(\))operator(;) - reserved(if) reserved(not) ident(SameContext)operator(()ident(Context)operator(,) ident(Value)operator(.)ident(Context)operator(\)) reserved(then) reserved(begin) - comment({ ================ cC ================ }) - ident(Sisy)operator(.)ident(AddValueChange)operator(()ident(cContextChange)operator(,) ident(Path) operator(+) string operator(+) ident(Value)operator(.)ident(Name)operator(,) - ident(Value)operator(.)ident(Context)operator(,) ident(Context)operator(\))operator(;) - ident(Value)operator(.)ident(Context) operator(:=) ident(Context)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(CompareKeys)operator(;) - reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(Key)operator(,) ident(LastKey)operator(,) ident(NewKey)operator(,) ident(SearchKey)operator(,) ident(SearchKey_Prev)operator(:) ident(TSpyKey)operator(;) - ident(SavedDoReport)operator(:) ident(Boolean)operator(;) - ident(NewHKEY)operator(:) ident(HKEY)operator(;) - reserved(begin) - comment(//OK, this part is a little bit complicate. So I will comment very much.) - comment(//First, two terms are important:) - comment(// means the list of keys that will be read from the registry now:) - - ident(Sisy)operator(.)ident(Reg)operator(.)ident(GetKeyNames)operator(()ident(SL)operator(\))operator(;) - reserved(if) ident(Cardinal)operator(()ident(SL)operator(.)ident(Count)operator(\)) operator(>) ident(Sisy)operator(.)ident(MaxKeyCountToScan) reserved(then) - ident(Exit)operator(;) - comment(//So is TStringList.) - - comment(// means the image that was saved before.) - comment(//Here, it is a linear list of TSpyKey objects. That means that you can) - comment(//only get X.Next and not X.Prev! However, I use "X.Prev" to simplify) - comment(//some comments.) - - comment(//!!! Comparing means: Make fit !!!) - - comment(//If wasn't saved before, it is just empty.) - - comment(//!!! There is no difference in comparing and saving in this method !!!) - - comment(//Building means: Comparing with an empty image.) - - comment(//We go through and make fit it) - - comment(//The following rules are important:) - comment(//Key = "The currently interesting key.) - comment(//LastKey = "The key with X.Next = Key" = "Key.Pref") - - ident(LastKey) operator(:=) reserved(nil)operator(;) comment(// := "Keys.Prev") - ident(Key) operator(:=) ident(Keys)operator(;) comment(// := "LastKey.Next") - - comment(//Now compare step by step) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Key)operator(\)) reserved(and) operator(()ident(SL)operator([)ident(i)operator(]) operator(=) ident(Key)operator(.)ident(Name)operator(\)) reserved(then) reserved(begin) - comment(//cK= Normally (0.9999\) everything's the same) - reserved(if) ident(Success)operator(()ident(RegOpenKey)operator(()ident(AHKEY)operator(,) ident(PChar)operator(()ident(SL)operator([)ident(i)operator(])operator(\))operator(,) ident(NewHKEY)operator(\))operator(\)) reserved(then) - reserved(try) - ident(Key)operator(.)ident(Spy)operator(()ident(NewHKEY)operator(,) ident(Sisy)operator(\))operator(;) - reserved(finally) - ident(RegCloseKey)operator(()ident(NewHKEY)operator(\))operator(;) - reserved(end)operator(;) - reserved(if) ident(Sisy)operator(.)ident(Terminated) reserved(then) - ident(Exit)operator(;) - - ident(LastKey) operator(:=) ident(Key)operator(;) - ident(Key) operator(:=) ident(Key)operator(.)ident(Next)operator(;) - reserved(end) reserved(else) reserved(begin) comment(//Something's different? Yes, the IMPORTANT rest (0.0001\)\)) - comment(//Because the list finally must exactly fit SL, the "SL[i] key" has) - comment(//to be inserted right here. But first let's look...) - - comment(//Maybe it was just moved? So search for it...) - ident(NewKey) operator(:=) reserved(nil)operator(;) - reserved(if) ident(Assigned)operator(()ident(Key)operator(\)) reserved(then) reserved(begin) - ident(SearchKey_Prev) operator(:=) ident(Key)operator(;) - ident(SearchKey) operator(:=) ident(Key)operator(.)ident(Next)operator(;) - reserved(while) ident(Assigned)operator(()ident(SearchKey)operator(\)) reserved(do) reserved(begin) - reserved(if) ident(SearchKey)operator(.)ident(Name) operator(=) ident(SL)operator([)ident(i)operator(]) reserved(then) reserved(begin) comment(//we found our moved key) - ident(SearchKey_Prev)operator(.)ident(Next) operator(:=) ident(SearchKey)operator(.)ident(Next)operator(;) comment(//delete it from ) - ident(NewKey) operator(:=) ident(SearchKey)operator(;) comment(//save that we found it) - ident(Break) reserved(end)operator(;) - ident(SearchKey_Prev) operator(:=) ident(SearchKey)operator(;) - ident(SearchKey) operator(:=) ident(SearchKey)operator(.)ident(Next)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(NewKey)operator(\)) reserved(then) reserved(begin) comment(//if we didn't find it) - comment(//cK+ No, not found! So it is new...) - ident(NewKey) operator(:=) ident(TSpyKey)operator(.)ident(Create)operator(()ident(Self)operator(,) ident(SL)operator([)ident(i)operator(])operator(\))operator(;) - ident(Sisy)operator(.)ident(IncKeyCount)operator(;) - ident(Sisy)operator(.)ident(Reg)operator(.)ident(CurrentKey) operator(:=) ident(AHKEY)operator(;) - comment({ ================ cK+ ================ }) - reserved(if) ident(Sisy)operator(.)ident(Started) reserved(and) ident(Sisy)operator(.)ident(Reg)operator(.)ident(KeyExists)operator(()ident(SL)operator([)ident(i)operator(])operator(\)) reserved(then) - ident(Sisy)operator(.)ident(AddKeyChange)operator(()ident(cKeyPlus)operator(,) ident(Path) operator(+) char operator(+) ident(NewKey)operator(.)ident(Name)operator(\))operator(;) - - ident(SavedDoReport) operator(:=) ident(Sisy)operator(.)ident(DoReport)operator(;) - reserved(if) ident(Success)operator(()ident(RegOpenKey)operator(()ident(AHKEY)operator(,) ident(PChar)operator(()ident(SL)operator([)ident(i)operator(])operator(\))operator(,) ident(NewHKEY)operator(\))operator(\)) reserved(then) - reserved(try) - ident(Sisy)operator(.)ident(DoReport) operator(:=) ident(False)operator(;) - ident(NewKey)operator(.)ident(Spy)operator(()ident(NewHKEY)operator(,) ident(Sisy)operator(\))operator(;) comment(//<-- recursion itself) - reserved(finally) - ident(RegCloseKey)operator(()ident(NewHKEY)operator(\))operator(;) - ident(Sisy)operator(.)ident(DoReport) operator(:=) ident(SavedDoReport)operator(;) - reserved(end)operator(;) - - reserved(if) ident(Sisy)operator(.)ident(Terminated) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) - - comment(//The new key now must be placed after the last key) - reserved(if) ident(Assigned)operator(()ident(LastKey)operator(\)) reserved(then) - ident(LastKey)operator(.)ident(Next) operator(:=) ident(NewKey) - reserved(else) - comment(//If it's the first key, we don't have LastKey defined) - comment(//So we have to set the "Root" to it) - ident(Keys) operator(:=) ident(NewKey)operator(;) - - comment(//Now the rest of has to be placed after the new key) - ident(NewKey)operator(.)ident(Next) operator(:=) ident(Key)operator(;) - comment(//And LastKey also has to refreshed: It is "Key.Pref" = NewKey!) - ident(LastKey) operator(:=) ident(NewKey)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - comment(//Because the whole before Key is exactly , the rest) - comment(//(if there is one\) must have been deleted!) - - comment(//So first let's ensure that ends here:) - reserved(if) ident(Assigned)operator(()ident(LastKey)operator(\)) reserved(then) - ident(LastKey)operator(.)ident(Next) operator(:=) reserved(nil) - reserved(else) - comment(//Another time: is empty now, so set Keys instead) - ident(Keys) operator(:=) reserved(nil)operator(;) - - comment(//Now, the first key that maybe was "cut" off is Key:) - reserved(while) ident(Assigned)operator(()ident(Key)operator(\)) reserved(do) reserved(begin) - comment(//cV- So, here really something HAS been deleted) - ident(LastKey) operator(:=) ident(Key)operator(;) - ident(Key) operator(:=) ident(Key)operator(.)ident(Next)operator(;) - ident(Sisy)operator(.)ident(Reg)operator(.)ident(CurrentKey) operator(:=) ident(AHKEY)operator(;) - comment({ ================ cK- ================ }) - reserved(if) ident(Sisy)operator(.)ident(Started) reserved(and) reserved(not) ident(Sisy)operator(.)ident(Reg)operator(.)ident(KeyExists)operator(()ident(LastKey)operator(.)ident(Name)operator(\)) reserved(then) - ident(Sisy)operator(.)ident(AddKeyChange)operator(()ident(cKeyMinus)operator(,) ident(Path) operator(+) char operator(+) ident(LastKey)operator(.)ident(Name)operator(\))operator(;) - ident(LastKey)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - -reserved(begin) - reserved(if) ident(Sisy)operator(.)ident(Terminated) reserved(or) operator(()ident(AHKEY) operator(=) integer(0)operator(\)) reserved(then) - ident(Exit)operator(;) - ident(LastKey) operator(:=) ident(Sisy)operator(.)ident(CurrentSpyKey)operator(;) - ident(Sisy)operator(.)ident(CurrentSpyKey) operator(:=) ident(Self)operator(;) - - ident(Sisy)operator(.)ident(IncKeyIndex)operator(;) - - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - reserved(try) - ident(Sisy)operator(.)ident(Reg)operator(.)ident(CurrentKey) operator(:=) ident(AHKEY)operator(;) - ident(CompareValues)operator(;) - reserved(if) ident(Sisy)operator(.)ident(Started) reserved(then) ident(CompareData)operator(;) - ident(CompareKeys)operator(;) - reserved(finally) - ident(Sisy)operator(.)ident(Reg)operator(.)ident(CurrentKey) operator(:=) integer(0)operator(;) - ident(SL)operator(.)ident(Free)operator(;) - ident(Sisy)operator(.)ident(CurrentSpyKey) operator(:=) ident(LastKey)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -comment({ TSisyChange }) - -reserved(constructor) ident(TSisyChange)operator(.)ident(Create)operator(()ident(ATyp)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(APath)operator(:) reserved(string)operator(;) - ident(AOldContext)operator(:) ident(TRegContext)operator(;) ident(ANewContext)operator(:) ident(TRegContext)operator(\))operator(;) -reserved(begin) - reserved(inherited) ident(Create)operator(;) - ident(Typ) operator(:=) ident(ATyp)operator(;) - ident(Path) operator(:=) ident(APath)operator(;) - ident(Old) operator(:=) ident(AOldContext)operator(;) - ident(New) operator(:=) ident(ANewContext)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyChange)operator(.)ident(ReportToPluto)operator(;) -reserved(var) - ident(Node)operator(,) ident(RootNode)operator(:) ident(TTreeNode)operator(;) - ident(Root)operator(,) ident(SubPath)operator(:) reserved(string)operator(;) - ident(NewNode)operator(:) ident(Boolean)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - - reserved(function) ident(IconOfSisyChangeType)operator(()ident(Typ)operator(:) ident(TSisyChangeType)operator(\))operator(:) ident(Integer)operator(;) - reserved(begin) - ident(Result) operator(:=) operator(-)integer(1)operator(;) - reserved(case) ident(Typ) reserved(of) - comment(//cNone, cError: Result := -1;) - ident(cKeyPlus)operator(..)ident(cContextChange)operator(:) ident(Result) operator(:=) ident(Integer)operator(()ident(Typ)operator(\)) operator(-) integer(2)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(function) ident(FindNode)operator(()ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(TTreeNode)operator(;) - reserved(begin) - ident(Result) operator(:=) ident(WorkWin)operator(.)ident(SisyTV)operator(.)ident(Items)operator(.)ident(GetFirstNode)operator(;) - reserved(while) ident(Assigned)operator(()ident(Result)operator(\)) reserved(do) reserved(begin) - reserved(if) ident(SameText)operator(()ident(Result)operator(.)ident(Text)operator(,) ident(Text)operator(\)) reserved(then) - ident(Exit)operator(;) - ident(Result) operator(:=) ident(Result)operator(.)ident(GetNextSibling)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) reserved(not) ident(WorkWin)operator(.)ident(SisyListCB)operator(.)ident(Checked) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(Typ) reserved(in) operator([)ident(cContextChange)operator(,) ident(cValueMinus)operator(,) ident(cValuePlus)operator(]) reserved(then) reserved(begin) - ident(Root) operator(:=) ident(ExRegFullKey)operator(()ident(Path)operator(\))operator(;) - ident(SubPath) operator(:=) ident(ExRegValue)operator(()ident(Path)operator(\))operator(;) - reserved(end) reserved(else) reserved(begin) - ident(Root) operator(:=) ident(UntilLastChar)operator(()ident(ExRegFullKey)operator(()ident(Path)operator(\))operator(,) charoperator(\))operator(;) - ident(SubPath) operator(:=) ident(FromLastChar)operator(()ident(ExRegFullKey)operator(()ident(Path)operator(\))operator(,) charoperator(\))operator(;) - reserved(end)operator(;) - - reserved(with) ident(WorkWin) reserved(do) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SisyFilter)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - reserved(if) ident(TextAtPos)operator(()ident(Root)operator(,) integer(1)operator(,) ident(SisyFilter)operator([)ident(i)operator(])operator(\)) reserved(then) reserved(begin) - comment(//show that it's working) - reserved(with) ident(FilterChangesB) reserved(do) reserved(begin) - ident(Caption) operator(:=) stringoperator(;) - ident(Repaint)operator(;) - ident(Caption) operator(:=) stringoperator(;) - ident(Repaint)operator(;) - reserved(end)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - - reserved(with) ident(WorkWin)operator(.)ident(SisyTV)operator(.)ident(Items) reserved(do) reserved(begin) - ident(BeginUpdate)operator(;) - reserved(try) - ident(RootNode) operator(:=) ident(FindNode)operator(()ident(Root)operator(\))operator(;) - ident(NewNode) operator(:=) reserved(not) ident(Assigned)operator(()ident(RootNode)operator(\))operator(;) - reserved(if) ident(NewNode) reserved(then) reserved(begin) - ident(RootNode) operator(:=) ident(AddChild)operator(()reserved(nil)operator(,) ident(Root)operator(\))operator(;) - ident(RootNode)operator(.)ident(ImageIndex) operator(:=) ident(iconGroup)operator(;) - reserved(end) reserved(else) reserved(if) reserved(not) ident(SisyChangeActivated)operator(()ident(RootNode)operator(\)) reserved(then) reserved(begin) - ident(EndUpdate)operator(;) - ident(Exit) reserved(end)operator(;) - - ident(Node) operator(:=) ident(AddChildObject)operator(()ident(RootNode)operator(,) ident(SubPath)operator(,) ident(Self)operator(\))operator(;) - ident(Node)operator(.)ident(ImageIndex) operator(:=) ident(IconOfSisyChangeType)operator(()ident(Typ)operator(\))operator(;) - reserved(if) ident(Typ) operator(=) ident(cContextChange) reserved(then) reserved(begin) - ident(AddChild)operator(()ident(Node)operator(,) ident(DataPreviewOfContext)operator(()ident(Old)operator(\))operator(\))operator(.)ident(ImageIndex) operator(:=) ident(iconOldContext)operator(;) - ident(AddChild)operator(()ident(Node)operator(,) ident(DataPreviewOfContext)operator(()ident(New)operator(\))operator(\))operator(.)ident(ImageIndex) operator(:=) ident(iconNewContext)operator(;) - reserved(end)operator(;) - reserved(finally) - ident(EndUpdate)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) ident(NewNode) reserved(and) ident(WorkWin)operator(.)ident(SisyExpandGroupsCB)operator(.)ident(Checked) reserved(then) - ident(RootNode)operator(.)ident(Expand)operator(()ident(False)operator(\))operator(;) - - reserved(if) reserved(not) ident(RootNode)operator(.)ident(Expanded) reserved(then) - ident(RootNode)operator(.)ident(ImageIndex) operator(:=) ident(iconGroupBlinking)operator(;) -reserved(end)operator(;) - -comment({ TSisyList }) - -reserved(function) ident(TSisyList)operator(.)ident(GetSisy)operator(()ident(Index)operator(:) ident(Integer)operator(\))operator(:) ident(TSisyThread)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Get)operator(()ident(Index)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyList)operator(.)ident(PutSisy)operator(()ident(Index)operator(:) ident(Integer)operator(;) ident(Sisy)operator(:) ident(TSisyThread)operator(\))operator(;) -reserved(begin) - ident(Put)operator(()ident(Index)operator(,) ident(Sisy)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyList)operator(.)ident(Resume)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) - ident(Items)operator([)ident(i)operator(])operator(.)ident(Resume)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSisyList)operator(.)ident(Suspend)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) - ident(Items)operator([)ident(i)operator(])operator(.)ident(Resume)operator(;) -reserved(end)operator(;) - -reserved(initialization) - ident(SisyFilter) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - ident(SisyFilter)operator(.)ident(Sorted) operator(:=) ident(True)operator(;) - ident(SisyFilter)operator(.)ident(Duplicates) operator(:=) ident(dupIgnore)operator(;) - -reserved(finalization) - ident(SisyFilter)operator(.)ident(Free)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(splash)operator(;) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) ident(Dialogs)operator(,) - ident(ExtCtrls)operator(,) ident(StdCtrls)operator(,) ident(ImgList)operator(,) ident(YTools)operator(,) ident(IniFiles)operator(,) ident(LinkLabel)operator(,) ident(PrefTools)operator(,) - ident(PlutoConst)operator(;) - -reserved(type) - ident(TSplashWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) - ident(Image1)operator(:) ident(TImage)operator(;) - ident(StartB)operator(:) ident(TButton)operator(;) - ident(SplashScreenCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(LinkLabel1)operator(:) ident(TLinkLabel)operator(;) - ident(LinkLabel2)operator(:) ident(TLinkLabel)operator(;) - ident(LogoL)operator(:) ident(TLabel)operator(;) - reserved(procedure) ident(StartBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormHide)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(SplashScreenCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(end)operator(;) - -reserved(var) - ident(SplashWin)operator(:) ident(TSplashWin)operator(;) - -reserved(implementation) - -reserved(uses) ident(plutomain)operator(,) ident(TreeU)operator(,) ident(WorkU)operator(,) ident(PrefU)operator(;) - -preprocessor({$R *.DFM}) - -reserved(procedure) ident(TSplashWin)operator(.)ident(StartBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(Close)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSplashWin)operator(.)ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(const) - ident(Messages)operator(:) reserved(array)operator([)integer(0)operator(..)integer(12)operator(]) reserved(of) reserved(string) operator(=) operator(()stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - string - operator(\))operator(;) -reserved(var) - ident(ImageFile)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Left) operator(:=) operator(()ident(Screen)operator(.)ident(Width) operator(-) ident(Width)operator(\)) reserved(div) integer(2)operator(;) - ident(Top) operator(:=) operator(()ident(Screen)operator(.)ident(Height) operator(-) ident(Height)operator(\)) reserved(div) integer(2)operator(;) - - ident(StartB)operator(.)ident(Caption) operator(:=) ident(Messages)operator([)ident(Random)operator(()ident(Length)operator(()ident(Messages)operator(\))operator(\))operator(])operator(;) - ident(SplashWin)operator(.)ident(SplashScreenCB)operator(.)ident(Load)operator(;) - - ident(Caption) operator(:=) string operator(+) ident(Version) operator(+) string operator(+) ident(MainWin)operator(.)ident(Greeting)operator(;) - - reserved(try) - ident(ImageFile) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) - reserved(if) ident(FileEx)operator(()ident(ImageFile)operator(\)) reserved(then) reserved(begin) - reserved(with) ident(Image1)operator(.)ident(Picture) reserved(do) - reserved(if) ident(Graphic) operator(=) reserved(nil) reserved(then) - ident(LoadFromFile)operator(()ident(ImageFile)operator(\))operator(;) - reserved(if) reserved(not) ident(Switch)operator(()stringoperator(\)) reserved(then) - ident(LogoL)operator(.)ident(Visible) operator(:=) ident(False)operator(;) - ident(Exit)operator(;) - reserved(end)operator(;) - - ident(ImageFile) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) - reserved(if) ident(FileEx)operator(()ident(ImageFile)operator(\)) reserved(then) reserved(begin) - reserved(with) ident(Image1)operator(.)ident(Picture) reserved(do) - reserved(if) ident(Graphic) operator(=) reserved(nil) reserved(then) - ident(LoadFromFile)operator(()ident(ImageFile)operator(\))operator(;) - reserved(end)operator(;) - reserved(except) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSplashWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(Hide)operator(;) - ident(Randomize)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSplashWin)operator(.)ident(FormHide)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - comment(//Image1.Picture.Bitmap.FreeImage;) -reserved(end)operator(;) - -reserved(procedure) ident(TSplashWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Key) operator(=) ident(VK_ESCAPE) reserved(then) - ident(Close)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TSplashWin)operator(.)ident(SplashScreenCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Started) reserved(then) - ident(PrefWin)operator(.)ident(SplashScreenCB)operator(.)ident(Checked) operator(:=) ident(SplashScreenCB)operator(.)ident(Checked)operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(SpyTH)operator(;) - -reserved(interface) - -reserved(uses) - ident(Classes)operator(,) ident(Windows)operator(,) ident(Dialogs)operator(,) ident(ComCtrls)operator(,) ident(CompEx)operator(,) ident(SysUtils)operator(,) ident(YTools)operator(,) ident(clock)operator(,) - ident(plutoconst)operator(,) ident(StdCtrls)operator(,) ident(forms)operator(,) ident(XReg)operator(,) ident(stringcomp)operator(;) - -reserved(type) - ident(TChildren) operator(=) reserved(array) reserved(of) ident(TTreeNode)operator(;) - - ident(TRegSpyThread) operator(=) reserved(class)operator(()ident(TThread)operator(\)) - directive(private) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - ident(CurNode)operator(:) ident(TTreeNode)operator(;) - ident(Dead)operator(:) ident(Boolean)operator(;) - ident(Dif)operator(:) ident(TSLComp)operator(;) - ident(CurChildren)operator(:) ident(TChildren)operator(;) - directive(protected) - reserved(procedure) ident(Execute)operator(;) directive(override)operator(;) - - reserved(procedure) ident(SaveCheckNode)operator(;) - reserved(procedure) ident(SaveGetDif)operator(;) - reserved(procedure) ident(SaveDeleteDead)operator(;) - reserved(procedure) ident(SaveGetChildren)operator(;) - reserved(procedure) ident(SaveAddNew)operator(;) - directive(public) - ident(Restart)operator(:) ident(Boolean)operator(;) - ident(Mess)operator(:) reserved(string)operator(;) - ident(Delay)operator(:) ident(Integer)operator(;) - reserved(function) ident(Alive)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(Boolean)operator(;) - reserved(procedure) ident(Spy)operator(;) - reserved(procedure) ident(Reload)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(procedure) ident(ReloadValues)operator(;) - reserved(procedure) ident(AddTrace)operator(()ident(Trace)operator(:) reserved(string)operator(\))operator(;) - reserved(constructor) ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(\))operator(;) - reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) - reserved(end)operator(;) - -reserved(implementation) - -reserved(uses) ident(plutomain)operator(,) ident(TreeU)operator(,) ident(WorkU)operator(,) ident(ValuesU)operator(;) - -comment({ TRegSpyThread }) - -reserved(constructor) ident(TRegSpyThread)operator(.)ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(\))operator(;) -reserved(begin) - reserved(inherited) ident(Create)operator(()ident(True)operator(\))operator(;) comment(// Create thread suspended) - ident(Priority) operator(:=) ident(PriorityLevel)operator(;) comment(// Set Priority Level) - ident(FreeOnTerminate) operator(:=) ident(False)operator(;) comment(// Thread frees itself when terminated) - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - ident(Delay) operator(:=) integer(100)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegSpyThread)operator(.)ident(Execute)operator(;) -reserved(begin) - reserved(while) reserved(not) ident(Terminated) reserved(do) reserved(begin) - ident(Restart) operator(:=) ident(False)operator(;) - reserved(try) - reserved(if) reserved(not) ident(Terminated) reserved(then) - ident(Sleep)operator(()ident(Delay)operator(\))operator(;) - reserved(if) reserved(not) ident(Terminated) reserved(then) - ident(Spy)operator(;) - reserved(except) reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TRegSpyThread)operator(.)ident(Alive)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - - reserved(if) ident(Restart) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(Terminated) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - reserved(try) - reserved(if) operator(()ident(Node)operator(.)ident(Text) operator(=) stringoperator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Result) operator(:=) ident(True)operator(;) - reserved(except) - ident(Exit)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegSpyThread)operator(.)ident(SaveCheckNode)operator(;) -reserved(begin) - ident(Dead) operator(:=) reserved(not) ident(Alive)operator(()ident(CurNode)operator(\))operator(;) - reserved(if) ident(Dead) reserved(then) - ident(Exit)operator(;) - - ident(CheckNode)operator(()ident(CurNode)operator(,) ident(False)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegSpyThread)operator(.)ident(SaveGetDif)operator(;) -reserved(var) - ident(Real)operator(,) ident(Cur)operator(:) ident(TStringList)operator(;) -reserved(begin) - ident(Dead) operator(:=) reserved(not) ident(Alive)operator(()ident(CurNode)operator(\))operator(;) - reserved(if) ident(Dead) reserved(then) - ident(Exit)operator(;) - - ident(dif) operator(:=) reserved(nil)operator(;) - - reserved(if) reserved(not) ident(CurNode)operator(.)ident(Expanded) reserved(then) reserved(begin) - ident(Dead) operator(:=) ident(True)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(if) reserved(not) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(CurNode)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Real) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - - ident(Reg)operator(.)ident(GetKeyNames)operator(()ident(Real)operator(\))operator(;) - ident(Reg)operator(.)ident(CloseKey)operator(;) - - ident(Cur) operator(:=) ident(GetChildNames)operator(()ident(CurNode)operator(\))operator(;) - - reserved(if) operator(()ident(Cur)operator(.)ident(Count) operator(=) integer(0)operator(\)) reserved(and) operator(()ident(Real)operator(.)ident(Count) operator(=) integer(0)operator(\)) reserved(then) - ident(Dead) operator(:=) ident(True)operator(;) - - ident(dif) operator(:=) ident(TSLComp)operator(.)ident(Create)operator(()ident(Cur)operator(,) ident(Real)operator(,) ident(False)operator(\))operator(;) - - ident(Cur)operator(.)ident(Free)operator(;) - ident(Real)operator(.)ident(Free)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegSpyThread)operator(.)ident(SaveDeleteDead)operator(;) -reserved(var) - ident(TN)operator(:) ident(TTreeNode)operator(;) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Dead) operator(:=) reserved(not) ident(Alive)operator(()ident(CurNode)operator(\))operator(;) - reserved(if) ident(Dead) reserved(then) - ident(Exit)operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(dif)operator(\)) reserved(or) reserved(not) ident(Assigned)operator(()ident(dif)operator(.)ident(OnlyA)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(CurNode)operator(.)ident(Expanded) reserved(then) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(dif)operator(.)ident(OnlyA)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - ident(TN) operator(:=) ident(FindNode)operator(()ident(CurNode)operator(,) ident(dif)operator(.)ident(OnlyA)operator([)ident(i)operator(])operator(\))operator(;) - reserved(if) ident(Assigned)operator(()ident(TN)operator(\)) reserved(then) reserved(begin) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(GetNextBest)operator(()ident(TN)operator(\))operator(;) - ident(TN)operator(.)ident(Delete)operator(;) - ident(AddTrace)operator(()string operator(+) ident(dif)operator(.)ident(OnlyA)operator([)ident(i)operator(])operator(\))operator(;) - reserved(end)operator(;) - reserved(end) - reserved(else) - ident(Exit)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegSpyThread)operator(.)ident(SaveGetChildren)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(TN)operator(:) ident(TTreeNode)operator(;) -reserved(begin) - ident(Dead) operator(:=) reserved(not) ident(Alive)operator(()ident(CurNode)operator(\))operator(;) - reserved(if) ident(Dead) reserved(then) - ident(Exit)operator(;) - - ident(CurChildren) operator(:=) reserved(nil)operator(;) - ident(SetLength)operator(()ident(CurChildren)operator(,) ident(CurNode)operator(.)ident(Count)operator(\))operator(;) - - ident(i) operator(:=) integer(0)operator(;) - ident(TN) operator(:=) ident(CurNode)operator(.)ident(GetFirstChild)operator(;) - reserved(while) ident(Assigned)operator(()ident(TN)operator(\)) reserved(do) reserved(begin) - reserved(if) ident(i) operator(<=) ident(High)operator(()ident(CurChildren)operator(\)) reserved(then) - ident(CurChildren)operator([)ident(i)operator(]) operator(:=) ident(TN) - reserved(else) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(Inc)operator(()ident(i)operator(\))operator(;) - ident(TN) operator(:=) ident(CurNode)operator(.)ident(GetNextChild)operator(()ident(TN)operator(\)) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegSpyThread)operator(.)ident(SaveAddNew)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Dead) operator(:=) reserved(not) ident(Alive)operator(()ident(CurNode)operator(\))operator(;) - reserved(if) ident(Dead) reserved(then) - ident(Exit)operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(Dif)operator(\)) reserved(or) reserved(not) ident(Assigned)operator(()ident(Dif)operator(.)ident(OnlyB)operator(\)) reserved(or) operator(()ident(Dif)operator(.)ident(OnlyB)operator(.)ident(Count) operator(=) integer(0)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Dif)operator(.)ident(OnlyB)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) comment(//Erstellt/hinbenannt) - ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(CurNode)operator(,) ident(Dif)operator(.)ident(OnlyB)operator([)ident(i)operator(])operator(\))operator(;) - ident(AddTrace)operator(()string operator(+) ident(dif)operator(.)ident(OnlyB)operator([)ident(i)operator(])operator(\))operator(;) - ident(MainWin)operator(.)ident(StatusBarUpdate)operator(;) - comment(//AddHint('Neuer Schlüssel: ' + CurNode.Text + '\\' + Dif.OnlyB[i]\);) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegSpyThread)operator(.)ident(Reload)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(TN)operator(:) ident(TTreeNode)operator(;) - ident(zCurNode)operator(:) ident(TTreeNode)operator(;) - ident(MyChildren)operator(:) ident(TChildren)operator(;) -reserved(begin) - reserved(if) ident(Terminated) reserved(or) ident(Restart) reserved(then) - ident(Exit)operator(;) - - ident(CurNode) operator(:=) ident(Node)operator(;) - - ident(zCurNode) operator(:=) ident(CurNode)operator(;) - reserved(try) - comment(//Mess := 'SaveCheckNode';) - ident(Synchronize)operator(()ident(SaveCheckNode)operator(\))operator(;) - reserved(if) ident(Dead) reserved(or) ident(Terminated) reserved(then) - ident(Exit)operator(;) - - comment(//Mess := 'SaveGetDif';) - ident(Synchronize)operator(()ident(SaveGetDif)operator(\))operator(;) - reserved(if) ident(Dead) reserved(or) ident(Terminated) reserved(then) - ident(Exit)operator(;) - - comment(//Mess := 'SaveDeleteDead';) - ident(Synchronize)operator(()ident(SaveDeleteDead)operator(\))operator(;) - reserved(if) ident(Dead) reserved(or) ident(Terminated) reserved(then) - ident(Exit)operator(;) - - comment(//Mess := 'SaveGetChildren';) - ident(Synchronize)operator(()ident(SaveGetChildren)operator(\))operator(;) - reserved(if) ident(Dead) reserved(or) ident(Terminated) reserved(then) - ident(Exit)operator(;) - - comment(//Mess := 'SaveGetChildren';) - ident(Synchronize)operator(()ident(SaveAddNew)operator(\))operator(;) - reserved(if) ident(Dead) reserved(or) ident(Terminated) reserved(then) - ident(Exit)operator(;) - - ident(Dif)operator(.)ident(Free)operator(;) - - comment(//Mess := 'MyChildren';) - ident(SetLength)operator(()ident(MyChildren)operator(,) ident(Length)operator(()ident(CurChildren)operator(\))operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(MyChildren)operator(\)) reserved(do) - ident(MyChildren)operator([)ident(i)operator(]) operator(:=) ident(CurChildren)operator([)ident(i)operator(])operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(MyChildren)operator(\)) reserved(do) reserved(begin) - ident(TN) operator(:=) ident(MyChildren)operator([)ident(i)operator(])operator(;) - reserved(if) ident(Alive)operator(()ident(TN)operator(\)) reserved(then) - comment(//if TN.Expanded then) - comment(//if NodeVisible(TN\) then) - ident(Reload)operator(()ident(TN)operator(\))operator(;) - comment(//else) - comment(//Break;) - reserved(if) ident(Restart) reserved(or) ident(Terminated) reserved(then) - ident(Break)operator(;) - reserved(end)operator(;) - ident(MyChildren) operator(:=) reserved(nil)operator(;) - - reserved(except) - reserved(if) ident(Terminated) reserved(then) - ident(Exit)operator(;) - ident(AddHint)operator(()string operator(+) ident(Mess)operator(\))operator(;) - ident(WorkWin)operator(.)ident(Label7)operator(.)ident(Caption) operator(:=) stringoperator(;) - reserved(end)operator(;) - ident(CurNode) operator(:=) ident(zCurNode)operator(;) -reserved(end)operator(;) - -reserved(function) ident(FindItemByRealName)operator(()ident(LV)operator(:) ident(TListView)operator(;) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(TListItem)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) reserved(nil)operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(LV)operator(.)ident(Items)operator(.)ident(Count)operator(-)integer(1) reserved(do) - reserved(if) ident(LV)operator(.)ident(Items)operator([)ident(i)operator(])operator(.)ident(Caption) operator(=) ident(Text) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(LV)operator(.)ident(Items)operator([)ident(i)operator(])operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(LV)operator(.)ident(Items)operator(.)ident(Count)operator(-)integer(1) reserved(do) - reserved(if) ident(SameText)operator(()ident(RealValueName)operator(()ident(LV)operator(.)ident(Items)operator([)ident(i)operator(])operator(\))operator(,) ident(Text)operator(\)) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(LV)operator(.)ident(Items)operator([)ident(i)operator(])operator(;) - ident(Break)operator(;) reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegSpyThread)operator(.)ident(ReloadValues)operator(;) -reserved(var) - ident(Item)operator(:) ident(TListItem)operator(;) - ident(Real)operator(,) ident(Cur)operator(:) ident(TStringList)operator(;) - ident(Dif)operator(:) ident(TSLComp)operator(;) - ident(i)operator(:) ident(integer)operator(;) -reserved(begin) - reserved(if) ident(Terminated) reserved(or) ident(Restart) reserved(then) - ident(Exit)operator(;) - - reserved(if) reserved(not) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Real) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - ident(Reg)operator(.)ident(GetValueNames)operator(()ident(Real)operator(\))operator(;) - - ident(Cur) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) - ident(Cur)operator(.)ident(Add)operator(()ident(RealValueName)operator(()ident(Item)operator([)ident(i)operator(])operator(\))operator(\))operator(;) - - ident(Dif) operator(:=) ident(TSLComp)operator(.)ident(Create)operator(()ident(Cur)operator(,) ident(Real)operator(,) ident(False)operator(\))operator(;) - ident(Real)operator(.)ident(Free)operator(;) - ident(Cur)operator(.)ident(Free)operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Dif)operator(.)ident(OnlyA)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) comment(//Gelöscht/wegbenannt) - ident(Item) operator(:=) ident(FindItemByRealName)operator(()ident(ValueList)operator(,) ident(Dif)operator(.)ident(OnlyA)operator([)ident(i)operator(])operator(\))operator(;) - reserved(if) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) reserved(begin) - ident(Item)operator(.)ident(Delete)operator(;) - ident(AddTrace)operator(()string operator(+) ident(Dif)operator(.)ident(OnlyA)operator([)ident(i)operator(])operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(ValueList)operator(.)ident(Items)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) comment(//Daten) - ident(Item) operator(:=) ident(ValueList)operator(.)ident(Items)operator([)ident(i)operator(])operator(;) - comment({if Item.SubItems.Count < 2 then begin - ShowMessage('Fehler in Sync.'\); - Exit end; }) - reserved(if) ident(ValuesWin)operator(.)ident(UpdateValue)operator(()ident(Reg)operator(,) ident(Item)operator(\)) reserved(then) - ident(AddTrace)operator(()string operator(+) ident(Item)operator(.)ident(Caption) operator(+) string operator(+) - ident(ValueDataPreview)operator(()ident(Reg)operator(.)ident(ReadContext)operator(()ident(RealValueName)operator(()ident(Item)operator(\))operator(\))operator(\))operator(\))operator(;) - reserved(end)operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(dif)operator(.)ident(OnlyB)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) comment(//Erstellt/hinbenannt) - ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(Reg)operator(,) ident(dif)operator(.)ident(OnlyB)operator([)ident(i)operator(])operator(\))operator(;) - ident(AddTrace)operator(()string operator(+) ident(Dif)operator(.)ident(OnlyB)operator([)ident(i)operator(])operator(\))operator(;) - reserved(end)operator(;) - - ident(Reg)operator(.)ident(CloseKey)operator(;) - ident(Dif)operator(.)ident(Free)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegSpyThread)operator(.)ident(Spy)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(a)operator(:) ident(Real)operator(;) -reserved(begin) - reserved(with) ident(TClock)operator(.)ident(Create) reserved(do) reserved(begin) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(RootNodes)operator(.)ident(Count)operator(-)integer(1) reserved(do) - ident(Reload)operator(()ident(TTreeNode)operator(()ident(RootNodes)operator([)ident(i)operator(])operator(\))operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Shortcuts)operator(\)) reserved(do) - ident(Reload)operator(()ident(Shortcuts)operator([)ident(i)operator(])operator(.)ident(Node)operator(\))operator(;) - ident(Synchronize)operator(()ident(ReloadValues)operator(\))operator(;) - ident(a) operator(:=) ident(SecondsPassed) operator(*) integer(1000)operator(;) - ident(Free)operator(;) reserved(end)operator(;) - - reserved(if) ident(a) operator(>) integer(0) reserved(then) - ident(WorkWin)operator(.)ident(Label7)operator(.)ident(Caption) operator(:=) string operator(+) ident(Format)operator(()stringoperator(,) operator([)ident(a)operator(])operator(\)) operator(+) stringoperator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TRegSpyThread)operator(.)ident(AddTrace)operator(()ident(Trace)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - reserved(with) ident(WorkWin) reserved(do) - reserved(if) ident(ListTracesCB)operator(.)ident(Checked) reserved(then) - ident(SpyLB)operator(.)ident(Items)operator(.)ident(Add)operator(()ident(Trace)operator(\))operator(;) -reserved(end)operator(;) - -reserved(destructor) ident(TRegSpyThread)operator(.)ident(Destroy)operator(;) -reserved(begin) - ident(Dif)operator(.)ident(Free)operator(;) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(inherited)operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(TreeU)operator(;) -preprocessor({$DEFINE UNIKEY}) -preprocessor({$DEFINE CYCFS}) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Variants)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) - ident(ComCtrls)operator(,) ident(Menus)operator(,) ident(Clipbrd)operator(,) ident(keybrd)operator(,) ident(Dialogs)operator(,) ident(YTools)operator(,) ident(PlutoConst)operator(,) ident(CompEx)operator(,) - ident(IniFiles)operator(,) ident(XReg)operator(,) ident(Colors)operator(,) ident(Clock)operator(,) - ident(ToolWin)operator(,) ident(RegFiles) preprocessor({$IFDEF UNIKEY})operator(,) ident(UniKey)operator(,) ident(ImgList) preprocessor({$ENDIF})operator(;) - -reserved(type) - ident(TTreeWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) - ident(RegTVPU)operator(:) ident(TPopupMenu)operator(;) - ident(NewSubKeyMI)operator(:) ident(TMenuItem)operator(;) - ident(NewKeyMI)operator(:) ident(TMenuItem)operator(;) - ident(CreateShortcutMI)operator(:) ident(TMenuItem)operator(;) - ident(TraceMI)operator(:) ident(TMenuItem)operator(;) - ident(N3)operator(:) ident(TMenuItem)operator(;) - ident(DeleteMI)operator(:) ident(TMenuItem)operator(;) - ident(DublicateMI)operator(:) ident(TMenuItem)operator(;) - ident(N4)operator(:) ident(TMenuItem)operator(;) - ident(FindMI)operator(:) ident(TMenuItem)operator(;) - ident(RegTV)operator(:) ident(TTreeView)operator(;) - ident(PastePathMI)operator(:) ident(TMenuItem)operator(;) - ident(N1)operator(:) ident(TMenuItem)operator(;) - ident(InsertPathMI)operator(:) ident(TMenuItem)operator(;) - ident(RenameMI)operator(:) ident(TMenuItem)operator(;) - ident(CopyPathMI)operator(:) ident(TMenuItem)operator(;) - ident(CutPathMI)operator(:) ident(TMenuItem)operator(;) - ident(EditShortcutMI)operator(:) ident(TMenuItem)operator(;) - ident(N2)operator(:) ident(TMenuItem)operator(;) - ident(Export1)operator(:) ident(TMenuItem)operator(;) - ident(SubKeylist1)operator(:) ident(TMenuItem)operator(;) - ident(ValueNameslist1)operator(:) ident(TMenuItem)operator(;) - ident(KeyInfosMI)operator(:) ident(TMenuItem)operator(;) - ident(N5)operator(:) ident(TMenuItem)operator(;) - ident(ExportAsReg)operator(:) ident(TMenuItem)operator(;) - ident(ExportD)operator(:) ident(TSaveDialog)operator(;) - reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RegTVClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RegTVChange)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(procedure) ident(RegTVChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(RegTVCollapsing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(AllowCollapse)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(RegTVCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(RegTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RegTVDeletion)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(procedure) ident(RegTVDragDrop)operator(()ident(Sender)operator(,) ident(Source)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) - reserved(procedure) ident(RegTVDragOver)operator(()ident(Sender)operator(,) ident(Source)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(;) ident(State)operator(:) ident(TDragState)operator(;) reserved(var) ident(Accept)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(RegTVEdited)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(S)operator(:) reserved(String)operator(\))operator(;) - reserved(procedure) ident(RegTVEditing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(AllowEdit)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(RegTVEndDrag)operator(()ident(Sender)operator(,) ident(Target)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) - reserved(procedure) ident(RegTVEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RegTVExpanded)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(procedure) ident(RegTVExpanding)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(AllowExpansion)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(RegTVGetSelectedIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(procedure) ident(RegTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(RegTVMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) - reserved(procedure) ident(RegTVStartDrag)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(DragObject)operator(:) ident(TDragObject)operator(\))operator(;) - - reserved(function) ident(CreateKey)operator(()ident(Subkey)operator(:) ident(Boolean)operator(\))operator(:) ident(Boolean)operator(;) - reserved(procedure) ident(CloneKey)operator(;) - reserved(procedure) ident(DeleteKey)operator(;) - reserved(procedure) ident(NewShortcut)operator(;) - reserved(procedure) ident(MoveKey)operator(()reserved(const) ident(Src)operator(,) ident(Trg)operator(:) ident(TRegPath)operator(;) ident(CopyWanted)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(MoveValues)operator(()ident(SrcNode)operator(,) ident(TrgNode)operator(:) ident(TTreeNode)operator(;) ident(CopyWanted)operator(:) ident(Boolean)operator(\))operator(;) - - reserved(procedure) ident(NewSubKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(NewKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CreateShortcutMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(TraceMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(DeleteMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(DublicateMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FindMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RegTVPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(RegTVKeyPress)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Char)operator(\))operator(;) - reserved(procedure) ident(RegTVAdvancedCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) - ident(Node)operator(:) ident(TTreeNode)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) ident(Stage)operator(:) ident(TCustomDrawStage)operator(;) - reserved(var) ident(PaintImages)operator(,) ident(DefaultDraw)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(RenameMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(InsertPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RegTVGetImageIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(procedure) ident(CheckRegTVHotTrack)operator(;) - reserved(procedure) ident(PasteKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CutPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(procedure) ident(OpenNextLevel)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(procedure) ident(EditShortcutMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SubKeylist1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ValueNameslist1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(KeyInfosMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(function) ident(GetKeyInfos)operator(:) reserved(string)operator(;) - reserved(procedure) ident(ExportAsRegClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\))operator(;) - - reserved(procedure) ident(Load)operator(;) - reserved(procedure) ident(Reg4WriterTerminate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - directive(private) - ident(DragNode)operator(:) ident(TTreeNode)operator(;) - ident(NoAsterisk)operator(:) ident(Boolean)operator(;) comment(//To prevent NumPadMULTIPLY and asterisk errors) - ident(UserCopyKeyFlag)operator(:) ident(Boolean)operator(;) - ident(SpaceCount)operator(:) ident(Integer)operator(;) comment(//EasterEgg) - directive(public) - ident(CantWrite)operator(:) ident(Boolean)operator(;) - ident(DoSmartExpand)operator(:) ident(Boolean)operator(;) - reserved(end)operator(;) - -reserved(procedure) ident(CheckNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(;) ident(OnlyOnce)operator(:) ident(Boolean) operator(=) ident(True)operator(;) - ident(TakeNodeSelected)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(;) - -reserved(function) ident(AddShortcut)operator(()ident(Alias)operator(,) ident(RealPath)operator(:) reserved(string)operator(;) ident(Icon)operator(:) ident(Integer)operator(;) - ident(AHostType)operator(:) ident(TUniHostType) operator(=) ident(uhUserShortcut)operator(;) ident(WriteIni)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) ident(TTreeNode)operator(;) -reserved(function) ident(ShortcutIndex)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(Integer)operator(;) - -reserved(function) ident(TraceKey)operator(()reserved(const) ident(Path)operator(:) reserved(string)operator(;) ident(AllowedShortcutTypes)operator(:) ident(TUniHostTypes) operator(=) - ident(uhNonSystemShortcuts)operator(\))operator(:) reserved(string)operator(;) - -reserved(type) - ident(TOpenNodeMode) operator(=) operator(()ident(onNodeNil)operator(,) ident(onError)operator(,) ident(onReadOnly)operator(,) ident(onFull)operator(\))operator(;) - -reserved(const) - ident(onOK) operator(=) operator([)ident(onFull)operator(,) ident(onReadOnly)operator(])operator(;) - -reserved(function) ident(OpenNode)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(TOpenNodeMode)operator(;) -reserved(function) ident(OpenNodeOK)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(OpenCurKey)operator(:) ident(Boolean)operator(;) -reserved(function) ident(OpenCurParent)operator(:) ident(Boolean)operator(;) - -reserved(var) - ident(TreeWin)operator(:) ident(TTreeWin)operator(;) - - ident(RegTV)operator(:) ident(TTreeView)operator(;) comment(//Shortcut for other units, equals TreeWin.RegTV) - -preprocessor({$IFDEF UNIKEY}) - ident(UserUniPath)operator(:) reserved(string) preprocessor({$IFDEF CYCFS}) operator(=) string)delimiter(')>preprocessor({$ENDIF})operator(;) -preprocessor({$ENDIF}) - ident(Shortcuts)operator(:) ident(TShortcutA)operator(;) - ident(RootNodes)operator(:) ident(TList)operator(;) comment(//list of TTreeNode;) - -reserved(implementation) - -reserved(uses) - ident(PlutoMain)operator(,) ident(ValuesU)operator(,) ident(FindWinU)operator(,) ident(WorkU)operator(,) ident(PrefU)operator(,) ident(ShellEx)operator(,) ident(Types)operator(;) - -preprocessor({$R *.dfm}) - -preprocessor({$IFDEF UNIKEY}) -reserved(function) ident(UniOfNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(TUniKey)operator(;) -reserved(var) - ident(UniPath)operator(:) ident(TUniPath)operator(;) -reserved(begin) - ident(UniPath) operator(:=) ident(UniOfStr)operator(()ident(UserUniPath)operator(\))operator(;) - ident(UniPath)operator(.)ident(Path) operator(:=) ident(Join)operator(()ident(Copy)operator(()ident(NodePath)operator(()ident(Node)operator(\))operator(,) integer(1)operator(,) ident(MaxInt)operator(\))operator(,) charoperator(\))operator(;) - ident(Result) operator(:=) ident(TUniKey)operator(.)ident(CreateU)operator(()ident(UniPath)operator(,) ident(reTryToSolve)operator(\))operator(;) -reserved(end)operator(;) -preprocessor({$ENDIF}) - -reserved(procedure) ident(TTreeWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(TreeU)operator(.)ident(RegTV) operator(:=) ident(RegTV)operator(;) - - ident(DragNode) operator(:=) reserved(nil)operator(;) - ident(NoAsterisk) operator(:=) ident(False)operator(;) - ident(DoSmartExpand) operator(:=) ident(True)operator(;) - ident(UserCopyKeyFlag) operator(:=) ident(True)operator(;) - ident(SpaceCount) operator(:=) integer(0)operator(;) comment(//EasterEgg) - - ident(RegTV)operator(.)ident(Items)operator(.)ident(Clear)operator(;) - ident(CheckRegTVHotTrack)operator(;) - - ident(KeyInfosMI)operator(.)ident(ImageIndex) operator(:=) ident(iconKeyInfos)operator(;) - - ident(NewSubKeyMI)operator(.)ident(ImageIndex) operator(:=) ident(iconSubKey)operator(;) - ident(NewKeyMI)operator(.)ident(ImageIndex) operator(:=) ident(iconKey)operator(;) - ident(CreateShortcutMI)operator(.)ident(ImageIndex) operator(:=) ident(iconShortcut)operator(;) - - ident(RenameMI)operator(.)ident(ImageIndex) operator(:=) ident(iconRename)operator(;) - ident(DeleteMI)operator(.)ident(ImageIndex) operator(:=) ident(iconDelete)operator(;) - ident(DublicateMI)operator(.)ident(ImageIndex) operator(:=) ident(iconKeyDublicate)operator(;) - - ident(FindMI)operator(.)ident(ImageIndex) operator(:=) ident(iconKeyFind)operator(;) - ident(TraceMI)operator(.)ident(ImageIndex) operator(:=) ident(iconKeyTrace)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(KeyIsDown)operator(()ident(VK_CONTROL)operator(\)) reserved(then) reserved(begin) - ident(TraceMIClick)operator(()ident(Sender)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVChange)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) -reserved(var) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - ident(OpenRe)operator(:) ident(TOpenNodeMode)operator(;) - -preprocessor({$IFDEF UNIKEY}) - ident(Uni)operator(:) ident(TUniKey)operator(;) - ident(ValueNames)operator(:) ident(TStringList)operator(;) - ident(Item)operator(:) ident(TListItem)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(AppendSubItemData)operator(()ident(SubItems)operator(:) ident(TStrings)operator(;) ident(Uni)operator(:) ident(TUniKey)operator(;) - reserved(const) ident(ValueName)operator(:) reserved(string)operator(\))operator(;) - reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) - - reserved(procedure) ident(Add)operator(()reserved(const) ident(s)operator(:) reserved(string)operator(\))operator(;) - reserved(begin) - ident(SubItems)operator(.)ident(Append)operator(()ident(s)operator(\))operator(;) - reserved(end)operator(;) - - reserved(begin) - ident(SL) operator(:=) reserved(nil)operator(;) - reserved(try) - ident(Add)operator(()stringoperator(\))operator(;) - - reserved(case) ident(Uni)operator(.)ident(GetDataType)operator(()ident(ValueName)operator(\)) reserved(of) - - ident(udString)operator(,) ident(udExpandString)operator(:) reserved(begin) - ident(Add)operator(()stringoperator(\))operator(;) - ident(Add)operator(()ident(Uni)operator(.)ident(ReadString)operator(()ident(ValueName)operator(\))operator(\))operator(;) - reserved(end)operator(;) - - ident(udCardinal)operator(,) ident(udCardBigEndian)operator(,) ident(udInteger)operator(:) reserved(begin) - ident(Add)operator(()stringoperator(\))operator(;) - ident(Add)operator(()ident(IntToStr)operator(()ident(Uni)operator(.)ident(ReadInteger)operator(()ident(ValueName)operator(\))operator(\))operator(\))operator(;) - reserved(end)operator(;) - - ident(udBinary)operator(,) ident(udNone)operator(:) reserved(begin) - ident(Add)operator(()stringoperator(\))operator(;) - ident(Add)operator(()ident(FriendlyStr)operator(()ident(Uni)operator(.)ident(ReadBinary)operator(()ident(ValueName)operator(\))operator(\))operator(\))operator(;) - reserved(end)operator(;) - - ident(udBoolean)operator(:) reserved(begin) - ident(Add)operator(()stringoperator(\))operator(;) - ident(Add)operator(()ident(StrOfBool)operator(()ident(Uni)operator(.)ident(ReadBool)operator(()ident(ValueName)operator(\))operator(\))operator(\))operator(;) - reserved(end)operator(;) - - ident(udStringList)operator(:) reserved(begin) - ident(Add)operator(()stringoperator(\))operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(SL)operator(\)) reserved(then) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create) - reserved(else) - ident(SL)operator(.)ident(Clear)operator(;) - ident(Uni)operator(.)ident(ReadStringList)operator(()ident(ValueName)operator(,) ident(SL)operator(\))operator(;) - ident(Add)operator(()ident(Join)operator(()ident(SL)operator(,) ident(MultiStringSeparator)operator(\))operator(\))operator(;) - reserved(end)operator(;) - - ident(udColor)operator(:) reserved(begin) - ident(Add)operator(()stringoperator(\))operator(;) - ident(Add)operator(()ident(ColorToString)operator(()ident(Uni)operator(.)ident(ReadColor)operator(()ident(ValueName)operator(\))operator(\))operator(\))operator(;) - reserved(end)operator(;) - - reserved(else) - ident(Add)operator(()string operator(+) - ident(IntToStr)operator(()ident(Cardinal)operator(()ident(Uni)operator(.)ident(GetDataType)operator(()ident(ValueName)operator(\))operator(\))operator(\))operator(\))operator(;) - reserved(end)operator(;) comment(//case) - - reserved(finally) - ident(SL)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - -preprocessor({$ENDIF}) - -reserved(begin) - ident(SpaceCount) operator(:=) integer(0)operator(;) comment(//Easteregg) - - ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\))operator(;) - ident(CantWrite) operator(:=) ident(False)operator(;) - - reserved(try) - ident(SpyThread)operator(.)ident(Suspend)operator(;) - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - -preprocessor({$IFDEF UNIKEY}) - reserved(if) ident(RootOfNode)operator(()ident(Node)operator(\))operator(.)ident(ImageIndex) operator(=) ident(iconHostUni) reserved(then) reserved(begin) - ident(ValueNames) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - ident(ValueList)operator(.)ident(Clear)operator(;) - - ident(Uni) operator(:=) ident(UniOfNode)operator(()ident(Node)operator(\))operator(;) - comment({Uni := CreateUniSubKey(UserUniPath, Copy(NodePath(Node\), 1, MaxInt\), - reFaile\); }) - reserved(if) ident(Assigned)operator(()ident(Uni)operator(\)) reserved(then) - reserved(try) - ident(Uni)operator(.)ident(GetValueNames)operator(()ident(ValueNames)operator(\))operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(ValueNames)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - ident(Item) operator(:=) ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(Reg)operator(,) ident(ValueNames)operator([)ident(i)operator(])operator(,) ident(False)operator(\))operator(;) - ident(Item)operator(.)ident(ImageIndex) operator(:=) ident(iconHostUni2)operator(;) - ident(AppendSubItemData)operator(()ident(Item)operator(.)ident(SubItems)operator(,) ident(Uni)operator(,) ident(ValueNames)operator([)ident(i)operator(])operator(\))operator(;) - reserved(end)operator(;) - - reserved(finally) - ident(Uni)operator(.)ident(Free)operator(;) - ident(ValueNames)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - - reserved(end) reserved(else) reserved(begin) -preprocessor({$ENDIF}) - - ident(OpenRe) operator(:=) ident(OpenNode)operator(()ident(Reg)operator(,) ident(Node)operator(\))operator(;) - reserved(if) ident(OpenRe) reserved(in) ident(onOK) reserved(then) reserved(begin) - ident(ValuesWin)operator(.)ident(LoadValues)operator(()ident(Reg)operator(\))operator(;) - reserved(if) ident(OpenRe) operator(=) ident(onReadOnly) reserved(then) reserved(begin) - ident(AddHint)operator(()stringoperator(,) ident(True)operator(\))operator(;) - ident(CantWrite) operator(:=) ident(True)operator(;) - reserved(end)operator(;) - reserved(end) reserved(else) reserved(if) ident(OpenRe) operator(=) ident(onError) reserved(then) reserved(begin) - ident(ValueList)operator(.)ident(Clear)operator(;) - ident(CantWrite) operator(:=) ident(True)operator(;) - reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(0) reserved(then) reserved(begin) - ident(AddHint)operator(()stringoperator(,) ident(True)operator(\))operator(;) - reserved(end) reserved(else) - ident(AddHint)operator(()string operator(+) ident(Node)operator(.)ident(Text)operator(,) ident(True)operator(\))operator(;) - reserved(end)operator(;) - -preprocessor({$IFDEF UNIKEY}) - reserved(end)operator(;) -preprocessor({$ENDIF}) - - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - - ident(CantWrite) operator(:=) ident(CantWrite) reserved(or) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) - reserved(or) ident(NodeInfo)operator(() ident(Node) operator(\))operator(.)ident(ReadOnly) comment(//Node itself) - reserved(or) ident(NodeInfo)operator(()ident(RootOfNode)operator(()ident(Node)operator(\))operator(\))operator(.)ident(ReadOnly) comment(//or host) - reserved(or) operator(()ident(SameText)operator(()ident(CurKey)operator(()ident(uhNonSystemShortcuts)operator(\))operator(.)ident(Root)operator(,) stringoperator(\))operator(\))operator(;) - - ident(MainWin)operator(.)ident(SetStatus)operator(;) - ident(WorkWin)operator(.)ident(InfoMemo)operator(.)ident(Text) operator(:=) ident(GetKeyInfos)operator(;) - reserved(finally) - ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) - ident(SpyThread)operator(.)ident(Resume)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) - reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\))operator(;) -reserved(begin) - ident(CantWrite) operator(:=) ident(False)operator(;) - ident(AllowChange) operator(:=) ident(Assigned)operator(()ident(Node)operator(\))operator(;) - comment(// CheckNode(Node, True\);) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVCollapsing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) - reserved(var) ident(AllowCollapse)operator(:) ident(Boolean)operator(\))operator(;) -reserved(begin) - ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) - ident(Node)operator(.)ident(DeleteChildren)operator(;) - ident(RegTVChange)operator(()ident(Sender)operator(,) ident(Node)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) - ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\))operator(;) -reserved(var) - ident(Info)operator(:) ident(TNodeInfo)operator(;) -reserved(begin) - comment({if Node.Text = '' then begin - ShowMessage('Error: Key has empty name.'\); - Node.Delete; - Exit; end;}) - - ident(Info) operator(:=) ident(NodeInfo)operator(()ident(Node)operator(\))operator(;) - reserved(with) ident(TTreeView)operator(()ident(Sender)operator(\))operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) - reserved(if) ident(Info)operator(.)ident(Defect) reserved(then) reserved(begin) - ident(Style) operator(:=) operator([)operator(])operator(;) - ident(Color) operator(:=) hex($AAAAAA) - reserved(end) reserved(else) reserved(begin) - reserved(case) ident(Info)operator(.)ident(HostType) reserved(of) - - ident(uhReg)operator(:) reserved(begin) - ident(Style) operator(:=) operator([)ident(fsBold)operator(])operator(;) - ident(Color) operator(:=) ident(clCyan)operator(;) - reserved(end)operator(;) - - comment({uhIni: begin - Style := [fsBold]; - Color := clBrightYellow; - end; - - uhRegFile: begin - Style := [fsBold]; - Color := clBrightGreen; - end; }) - - ident(uhSystemShortcut)operator(:) reserved(begin) - ident(Style) operator(:=) operator([)operator(])operator(;) - ident(Color) operator(:=) ident(clBrightCyan)operator(;) - reserved(end)operator(;) - - ident(uhStandardShortcut)operator(:) reserved(begin) - ident(Style) operator(:=) operator([)ident(fsBold)operator(])operator(;) - ident(Color) operator(:=) hex($EEEEEE)operator(;) - reserved(end)operator(;) - - ident(uhUserShortcut)operator(:) reserved(begin) - ident(Style) operator(:=) operator([)operator(])operator(;) - ident(Color) operator(:=) hex($EEEEEE)operator(;) - reserved(end)operator(;) - - reserved(else) - ident(Style) operator(:=) operator([)operator(])operator(;) - reserved(if) ident(Info)operator(.)ident(ReadOnly) reserved(then) - ident(Color) operator(:=) ident(clBrightRed) - reserved(else) - ident(Color) operator(:=) ident(clWhite)operator(;) - reserved(end)operator(;) - - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) - ident(MouseX)operator(:) ident(Integer)operator(;) - ident(NodeRect)operator(:) ident(TRect)operator(;) -reserved(begin) - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(MouseX) operator(:=) ident(RegTV)operator(.)ident(ScreenToClient)operator(()ident(Mouse)operator(.)ident(CursorPos)operator(\))operator(.)ident(X)operator(;) - ident(NodeRect) operator(:=) ident(Node)operator(.)ident(DisplayRect)operator(()ident(True)operator(\))operator(;) - reserved(if) ident(MouseX) operator(>) ident(NodeRect)operator(.)ident(Right) reserved(then) reserved(begin) - reserved(with) ident(ValuesWin) reserved(do) reserved(begin) - ident(FocusItem)operator(()ident(PrefWin)operator(.)ident(MainPreviewE)operator(.)ident(Text)operator(\))operator(;) - ident(ValueListDblClick)operator(()ident(Self)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVDeletion)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(SpyThread)operator(\)) reserved(then) - ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) - reserved(if) ident(Node)operator(.)ident(Selected) reserved(then) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(GetNextBest)operator(()ident(Node)operator(\))operator(;) - ident(NodeInfo)operator(()ident(Node)operator(\))operator(.)ident(Free)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVDragDrop)operator(()ident(Sender)operator(,) ident(Source)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) - - reserved(procedure) ident(DragKey)operator(;) - reserved(var) - ident(Src)operator(,) ident(Trg)operator(:) ident(TRegPath)operator(;) - ident(Node)operator(:) ident(TTreeNode)operator(;) - reserved(begin) - ident(Src) operator(:=) ident(RegPathOfStr)operator(()ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(DragNode)operator(\))operator(\))operator(\))operator(;) - ident(Trg) operator(:=) ident(RegPathOfStr)operator(()ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(DropTarget)operator(\))operator(\))operator(\))operator(;) - ident(Trg)operator(.)ident(Key) operator(:=) ident(Trg)operator(.)ident(Key) operator(+) char operator(+) ident(DragNode)operator(.)ident(Text)operator(;) - - ident(MoveKey)operator(()ident(Src)operator(,) ident(Trg)operator(,) ident(KeyIsDown)operator(()ident(VK_CONTROL)operator(\))operator(\))operator(;) - - ident(Node) operator(:=) ident(RegTV)operator(.)ident(DropTarget)operator(;) - reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) - ident(Node)operator(.)ident(Collapse)operator(()ident(False)operator(\))operator(;) - ident(Node)operator(.)ident(Expanded) operator(:=) ident(False)operator(;) - ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(,) ident(True)operator(\))operator(;) - ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\))operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(DragValues)operator(;) - reserved(begin) - ident(MoveValues)operator(()ident(RegTV)operator(.)ident(Selected)operator(,) ident(RegTV)operator(.)ident(DropTarget)operator(,) ident(KeyIsDown)operator(()ident(VK_CONTROL)operator(\))operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) ident(Source) reserved(is) ident(TTreeView) reserved(then) - ident(DragKey) - reserved(else) reserved(if) ident(Source) reserved(is) ident(TListView) reserved(then) - ident(DragValues)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVDragOver)operator(()ident(Sender)operator(,) ident(Source)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(;) - ident(State)operator(:) ident(TDragState)operator(;) reserved(var) ident(Accept)operator(:) ident(Boolean)operator(\))operator(;) -reserved(begin) - ident(Accept) operator(:=) ident(False)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(RegTV)operator(.)ident(DropTarget)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(Source) reserved(is) ident(TTreeView) reserved(then) reserved(begin) - reserved(if) reserved(not) ident(Assigned)operator(()ident(DragNode)operator(\)) reserved(then) - ident(Exit)operator(;) - reserved(if) reserved(not) ident(KeyIsDown)operator(()ident(VK_CONTROL)operator(\)) reserved(then) reserved(begin) - reserved(if) operator(()ident(DragNode) operator(=) ident(RegTV)operator(.)ident(DropTarget)operator(\)) - reserved(or) ident(RegTV)operator(.)ident(DropTarget)operator(.)ident(HasAsParent)operator(()ident(DragNode)operator(\)) reserved(then) - ident(Exit)operator(;) comment(//avoid recursive moving) - reserved(end)operator(;) - reserved(end) reserved(else) reserved(if) ident(Source) reserved(is) ident(TListView) reserved(then) reserved(begin) - comment(//accept) - reserved(end)operator(;) - ident(Accept) operator(:=) ident(True)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVEdited)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(S)operator(:) reserved(string)operator(\))operator(;) -reserved(var) - ident(old)operator(,) ident(tmp)operator(:) reserved(string)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - ident(Shortcut)operator(:) ident(PKeyShortcut)operator(;) -reserved(begin) - reserved(if) ident(s) operator(=) ident(Node)operator(.)ident(Text) reserved(then) - ident(Exit)operator(;) - - ident(Old) operator(:=) ident(Node)operator(.)ident(Text)operator(;) - - reserved(if) ident(NodeInfo)operator(()ident(Node)operator(\))operator(.)ident(HostType) operator(=) ident(uhUserShortcut) reserved(then) reserved(begin) - ident(i) operator(:=) ident(ShortcutIndex)operator(()ident(Node)operator(\))operator(;) - reserved(if) ident(i) operator(=) operator(-)integer(1) reserved(then) reserved(begin) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(s) operator(:=) ident(old)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(Shortcut) operator(:=) operator(@)ident(Shortcuts)operator([)ident(i)operator(])operator(;) - ident(Shortcut)operator(.)ident(Alias) operator(:=) ident(s)operator(;) - - reserved(with) ident(TIniFile)operator(.)ident(Create)operator(()ident(PlutoDir) operator(+) stringoperator(\)) reserved(do) - reserved(try) - ident(DeleteKey)operator(()stringoperator(,) ident(Old)operator(\))operator(;) - ident(WriteString)operator(()stringoperator(,) ident(Shortcut)operator(.)ident(Alias)operator(,) ident(Shortcut)operator(.)ident(RealPath)operator(\))operator(;) - reserved(finally) - ident(Free)operator(;) - reserved(end)operator(;) - ident(Node)operator(.)ident(Text) operator(:=) ident(s)operator(;) - ident(RegTVChange)operator(()ident(Self)operator(,) ident(Node)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(if) ident(s) operator(=) string reserved(then) reserved(begin) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(s) operator(:=) ident(old)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(SpyThread)operator(.)ident(Suspend)operator(;) - ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) - ident(Node)operator(.)ident(Text) operator(:=) ident(s)operator(;) - - reserved(if) ident(Length)operator(()ident(s)operator(\)) operator(>) ident(RegMaxKeyLen) reserved(then) reserved(begin) - ident(s) operator(:=) ident(Copy)operator(()ident(s)operator(,) integer(1)operator(,) ident(RegMaxKeyLen)operator(\))operator(;) - reserved(if) ident(MessageDlg)operator(() - string operator(+) ident(IntToStr)operator(()ident(RegMaxKeyLen)operator(\)) operator(+) string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(Quote)operator(()ident(StringWrap)operator(()ident(s)operator(,) integer(80)operator(\))operator(\))operator(,) - ident(mtConfirmation)operator(,) operator([)ident(mbOK)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) operator(<>) ident(mrOK) reserved(then) reserved(begin) - ident(s) operator(:=) ident(Old)operator(;) - ident(SpyThread)operator(.)ident(Resume)operator(;) - ident(Exit)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) ident(CharIn)operator(()ident(s)operator(,) operator([)char(#0)operator(..)char(#31)operator(,) charoperator(])operator(\)) reserved(then) reserved(begin) - ident(s) operator(:=) ident(ReplaceChars)operator(()ident(s)operator(,) operator([)char(#0)operator(..)char(#31)operator(])operator(,) charoperator(\))operator(;) - ident(s) operator(:=) ident(ReplaceChars)operator(()ident(s)operator(,) charoperator(,) charoperator(\))operator(;) - - reserved(if) ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(Quote)operator(()charoperator(\)) operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(s) operator(+) ident(EOL) operator(+) - stringoperator(,) - ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(])operator(,) integer(0)operator(\)) operator(<>) ident(mrYes) reserved(then) reserved(begin) - ident(s) operator(:=) ident(Old)operator(;) - ident(SpyThread)operator(.)ident(Resume)operator(;) - ident(Exit)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(try) - ident(OpenCurParent)operator(;) - reserved(if) reserved(not) ident(SameText)operator(()ident(s)operator(,) ident(Old)operator(\)) reserved(then) reserved(begin) - reserved(if) reserved(not) ident(MainReg)operator(.)ident(KeyExists)operator(()ident(s)operator(\)) reserved(or) - operator(()ident(mrIgnore) operator(=) ident(MessageDlg)operator(() - string operator(+) ident(EOL) operator(+) - stringoperator(,) - ident(mtConfirmation)operator(,) operator([)ident(mbCancel)operator(,) ident(mbIgnore)operator(])operator(,) integer(0)operator(\)) - operator(\)) reserved(then) reserved(begin) - ident(MainReg)operator(.)ident(DeleteKey)operator(()ident(s)operator(\))operator(;) - ident(MainReg)operator(.)ident(MoveKey)operator(()ident(Old)operator(,) ident(s)operator(,) ident(True)operator(\))operator(;) - ident(Node)operator(.)ident(Text) operator(:=) ident(Old)operator(;) - reserved(end) reserved(else) reserved(begin) - ident(s) operator(:=) ident(Old)operator(;) - reserved(end)operator(;) - reserved(end) reserved(else) reserved(begin) comment(//change CharCase) - ident(tmp) operator(:=) ident(MainReg)operator(.)ident(GetFreeKeyName)operator(;) - ident(AddHint)operator(()string operator(+) ident(Quote)operator(()ident(tmp)operator(\))operator(\))operator(;) - ident(MainReg)operator(.)ident(MoveKey)operator(()ident(Old)operator(,) ident(tmp)operator(,) ident(True)operator(\))operator(;) - ident(MainReg)operator(.)ident(MoveKey)operator(()ident(tmp)operator(,) ident(s)operator(,) ident(True)operator(\))operator(;) - reserved(end)operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - reserved(end)operator(;) - - ident(Node)operator(.)ident(Text) operator(:=) ident(s)operator(;) - ident(SpyThread)operator(.)ident(Resume)operator(;) - ident(RegTVChange)operator(()ident(Sender)operator(,) ident(Node)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVEditing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) - reserved(var) ident(AllowEdit)operator(:) ident(Boolean)operator(\))operator(;) -reserved(begin) - ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\))operator(;) - reserved(if) ident(RegTV)operator(.)ident(Selected) operator(<>) ident(Node) reserved(then) - ident(Exit)operator(;) - ident(AllowEdit) operator(:=) operator(()ident(NodeInfo)operator(()ident(Node)operator(\))operator(.)ident(HostType) reserved(in) operator([)ident(uhNone)operator(,) ident(uhUserShortcut)operator(])operator(\)) - reserved(and) operator(()reserved(not) ident(CantWrite)operator(\)) - reserved(and) ident(OpenCurKey)operator(;) - ident(MainReg)operator(.)ident(CloseKey)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVEndDrag)operator(()ident(Sender)operator(,) ident(Target)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) -reserved(begin) - ident(DragNode) operator(:=) reserved(nil)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(Started) reserved(then) - ident(Exit)operator(;) - ident(ValueList)operator(.)ident(ItemFocused) operator(:=) reserved(nil)operator(;) - ident(MainWin)operator(.)ident(SetStatus)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVExpanded)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(DoSmartExpand) reserved(or) reserved(not) ident(PrefWin)operator(.)ident(SmartExpandCB)operator(.)ident(Checked) reserved(then) - ident(Exit)operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(RegTVChange)operator(()ident(Sender)operator(,) ident(Node)operator(\))operator(;) - - comment(//SmartExpand) - reserved(if) operator(()ident(Node)operator(.)ident(Count) operator(>) integer(0)operator(\)) reserved(and) operator(()ident(ValueList)operator(.)ident(Items)operator(.)ident(Count) operator(=) integer(0)operator(\)) reserved(then) reserved(begin) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(.)ident(GetFirstChild)operator(;) - ident(RegTVChange)operator(()ident(Sender)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(Node)operator(.)ident(Count) operator(=) integer(1) reserved(then) - ident(Node)operator(.)ident(GetFirstChild)operator(.)ident(Expand)operator(()ident(False)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVExpanding)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) - reserved(var) ident(AllowExpansion)operator(:) ident(Boolean)operator(\))operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - ident(Clock)operator(:) ident(TClock)operator(;) -preprocessor({$IFDEF UNIKEY}) - ident(Uni)operator(:) ident(TUniKey)operator(;) -preprocessor({$ENDIF}) - - reserved(procedure) ident(AddKeys)operator(()ident(TreeView)operator(:) ident(TTreeView)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) ident(SL)operator(:) ident(TStrings)operator(\))operator(;) - reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - reserved(begin) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) - ident(TreeView)operator(.)ident(Items)operator(.)ident(AddNode)operator(()ident(TTreeNode)operator(.)ident(Create)operator(()ident(TreeView)operator(.)ident(Items)operator(\))operator(,) ident(Node)operator(,) ident(SL)operator([)ident(i)operator(])operator(,) - reserved(nil)operator(,) ident(naAddChild)operator(\))operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(AddKeysProgressive)operator(()ident(TreeView)operator(:) ident(TTreeView)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) - ident(SL)operator(:) ident(TStrings)operator(\))operator(;) - reserved(var) - ident(i)operator(,) ident(delta)operator(:) ident(Integer)operator(;) - ident(GaugeRect)operator(,) ident(FullRect)operator(:) ident(TRect)operator(;) - ident(GaugeWidth)operator(:) ident(Integer)operator(;) - reserved(begin) - ident(delta) operator(:=) ident(SL)operator(.)ident(Count) reserved(div) integer(100)operator(;) - ident(GaugeWidth) operator(:=) integer(100)operator(;) - reserved(with) ident(TreeView)operator(.)ident(Canvas) reserved(do) reserved(begin) - ident(FullRect) operator(:=) ident(Node)operator(.)ident(DisplayRect)operator(()ident(True)operator(\))operator(;) - reserved(with) ident(FullRect) reserved(do) reserved(begin) - ident(Left) operator(:=) ident(Right) operator(+) integer(40)operator(;) - ident(Right) operator(:=) ident(Left) operator(+) ident(GaugeWidth) operator(+) integer(2)operator(;) - ident(Inc)operator(()ident(Top)operator(,) integer(5)operator(\))operator(;) - ident(Dec)operator(()ident(Bottom)operator(,) integer(5)operator(\))operator(;) - reserved(end)operator(;) - reserved(with) ident(Pen) reserved(do) reserved(begin) - ident(Width) operator(:=) integer(1)operator(;) - ident(Style) operator(:=) ident(psSolid)operator(;) - reserved(end)operator(;) - ident(Pen)operator(.)ident(Color) operator(:=) ident(clBrightBlue)operator(;) - ident(Brush)operator(.)ident(Style) operator(:=) ident(bsClear)operator(;) - ident(Rectangle)operator(()ident(FullRect)operator(\))operator(;) - ident(Pen)operator(.)ident(Style) operator(:=) ident(psClear)operator(;) - reserved(end)operator(;) - - ident(GaugeRect) operator(:=) ident(FullRect)operator(;) - reserved(with) ident(GaugeRect) reserved(do) reserved(begin) - ident(Inc)operator(()ident(Left)operator(\))operator(;) - ident(Inc)operator(()ident(Top)operator(\))operator(;) - ident(Dec)operator(()ident(Bottom)operator(\))operator(;) - reserved(end)operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - ident(TreeView)operator(.)ident(Items)operator(.)ident(AddNode)operator(()ident(TTreeNode)operator(.)ident(Create)operator(()ident(TreeView)operator(.)ident(Items)operator(\))operator(,) ident(Node)operator(,) ident(SL)operator([)ident(i)operator(])operator(,) - reserved(nil)operator(,) ident(naAddChild)operator(\))operator(;) - - reserved(if) operator(()operator(()ident(i) operator(+) integer(1)operator(\)) reserved(mod) ident(delta)operator(\)) operator(=) integer(0) reserved(then) reserved(begin) - reserved(with) ident(TreeView)operator(.)ident(Canvas) reserved(do) reserved(begin) - ident(GaugeRect)operator(.)ident(Right) operator(:=) ident(GaugeRect)operator(.)ident(Left) operator(+) operator(()ident(GaugeWidth) operator(*) ident(i)operator(\)) reserved(div) ident(SL)operator(.)ident(Count)operator(;) - ident(Brush)operator(.)ident(Color) operator(:=) ident(GadientAqua)operator(()integer(90) operator(+) ident(Round)operator(()integer(100) operator(*) operator(()operator(()ident(i)operator(+)integer(1)operator(\)) operator(/) ident(SL)operator(.)ident(Count)operator(\))operator(\))operator(\))operator(;) - ident(FillRect)operator(()ident(GaugeRect)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(with) ident(TreeView)operator(.)ident(Canvas) reserved(do) reserved(begin) - ident(Pen)operator(.)ident(Color) operator(:=) ident(clVeryBrightBlue)operator(;) - ident(Pen)operator(.)ident(Style) operator(:=) ident(psSolid)operator(;) - ident(Brush)operator(.)ident(Color) operator(:=) ident(GadientAqua)operator(()integer(200)operator(\))operator(;) - ident(Rectangle)operator(()ident(FullRect)operator(\))operator(;) - ident(Brush)operator(.)ident(Style) operator(:=) ident(bsClear)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) - ident(Exit)operator(;) - - ident(SpyThread)operator(.)ident(Suspend)operator(;) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - ident(Clock) operator(:=) ident(TClock)operator(.)ident(Create)operator(;) - - reserved(try) - -preprocessor({$IFDEF UNIKEY}) - reserved(if) ident(RootOfNode)operator(()ident(Node)operator(\))operator(.)ident(ImageIndex) operator(=) ident(iconHostUni) reserved(then) reserved(begin) - ident(Uni) operator(:=) ident(UniOfNode)operator(()ident(Node)operator(\))operator(;) - reserved(if) ident(Assigned)operator(()ident(Uni)operator(\)) reserved(then) - reserved(try) - ident(Uni)operator(.)ident(GetKeyNames)operator(()ident(SL)operator(\))operator(;) - reserved(finally) - ident(Uni)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - - reserved(end) reserved(else) reserved(begin) -preprocessor({$ENDIF}) - - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - reserved(if) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(Node)operator(\)) reserved(then) - ident(Reg)operator(.)ident(GetKeyNames)operator(()ident(SL)operator(\))operator(;) - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - -preprocessor({$IFDEF UNIKEY}) - reserved(end)operator(;) -preprocessor({$ENDIF}) - - ident(Node)operator(.)ident(DeleteChildren)operator(;) - reserved(if) ident(PrefWin)operator(.)ident(ShowProgressCB)operator(.)ident(Checked) reserved(and) operator(()ident(SL)operator(.)ident(Count) operator(>) integer(100)operator(\)) reserved(then) - ident(AddKeysProgressive)operator(()ident(RegTV)operator(,) ident(Node)operator(,) ident(SL)operator(\)) - reserved(else) - ident(AddKeys)operator(()ident(RegTV)operator(,) ident(Node)operator(,) ident(SL)operator(\))operator(;) - - reserved(if) ident(PrefWin)operator(.)ident(SortKeysCB)operator(.)ident(Checked) reserved(then) - ident(Node)operator(.)ident(AlphaSort)operator(;) - - reserved(if) ident(MurphyMode) reserved(then) reserved(begin) - ident(Clock)operator(.)ident(Stop)operator(;) - ident(AddHint)operator(()ident(Format)operator(()stringoperator(,) operator([)ident(Clock)operator(.)ident(SecondsPassed)operator(])operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(finally) - ident(Clock)operator(.)ident(Free)operator(;) - ident(SL)operator(.)ident(Free)operator(;) - ident(SpyThread)operator(.)ident(Resume)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVGetSelectedIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) -reserved(begin) - ident(Node)operator(.)ident(SelectedIndex) operator(:=) ident(Node)operator(.)ident(ImageIndex)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) -reserved(begin) - reserved(if) ident(Key) operator(=) ident(VK_SCROLL) reserved(then) - ident(CheckRegTVHotTrack)operator(;) - - reserved(if) ident(RegTV)operator(.)ident(IsEditing) reserved(then) - ident(Exit)operator(;) - - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(ssShift) reserved(in) ident(Shift) reserved(then) - reserved(case) ident(Key) reserved(of) - ident(VK_DOWN)operator(:) reserved(begin) - ident(Node) operator(:=) ident(Node)operator(.)ident(GetNextSibling)operator(;) - reserved(if) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(;) - ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) - - ident(VK_UP)operator(:) reserved(begin) - ident(Node) operator(:=) ident(Node)operator(.)ident(GetPrevSibling)operator(;) - reserved(if) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(;) - ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) - - ident(VK_RIGHT)operator(:) ident(Key) operator(:=) ident(VK_MULTIPLY)operator(;) - ident(VK_LEFT)operator(:) ident(Key) operator(:=) ident(VK_DIVIDE)operator(;) - reserved(end)operator(;) - - reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) reserved(begin) - reserved(case) ident(Key) reserved(of) - ident(VK_END)operator(:) - reserved(begin) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(.)ident(Parent)operator(.)ident(GetLastChild)operator(;) - ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) - - ident(VK_HOME)operator(:) - reserved(begin) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(.)ident(Parent)operator(.)ident(GetFirstChild)operator(;) - ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(case) ident(Key) reserved(of) - integer(0)operator(:) ident(Exit)operator(;) - ident(VK_RETURN)operator(:) ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\))operator(;) - ident(VK_DELETE)operator(:) ident(DeleteMIClick)operator(()ident(Sender)operator(\))operator(;) - ident(VK_SPACE)operator(:) reserved(begin) - ident(JumpToSel)operator(()ident(RegTV)operator(\))operator(;) - ident(Inc)operator(()ident(SpaceCount)operator(\))operator(;) - reserved(if) ident(SpaceCount) operator(>) integer(10) reserved(then) reserved(begin) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(SpaceCount) operator(:=) integer(0)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - ident(VK_F9)operator(:) ident(SwapFonts)operator(()ident(RegTV)operator(\))operator(;) - - ident(VK_F12)operator(:) - reserved(if) ident(ssShift) reserved(in) ident(Shift) reserved(then) reserved(begin) - reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) ident(Node)operator(.)ident(Parent)operator(.)ident(AlphaSort)operator(;) - reserved(end) reserved(else) - reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) ident(Node)operator(.)ident(AlphaSort)operator(;) - - ident(VK_LEFT)operator(,) ident(VK_SUBTRACT)operator(:) - reserved(begin) - reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) - ident(Node)operator(.)ident(Collapse)operator(()ident(False)operator(\)) - reserved(else) reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(.)ident(Parent)operator(;) - ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) - - ident(VK_RIGHT)operator(,) ident(VK_ADD)operator(:) - reserved(begin) - reserved(if) reserved(not) ident(Node)operator(.)ident(HasChildren) reserved(then) - ident(TreeWin)operator(.)ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(Node)operator(,) stringoperator(\))operator(;) - reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(.)ident(GetFirstChild) - reserved(else) - ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\))operator(;) - ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) - - ident(VK_MULTIPLY)operator(:) - reserved(begin) - ident(NoAsterisk) operator(:=) ident(True)operator(;) - ident(OpenNextLevel)operator(()ident(Node)operator(\))operator(;) - ident(JumpToSel)operator(()ident(RegTV)operator(\))operator(;) - ident(AddHint)operator(()stringoperator(\))operator(;) - ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) - - ident(VK_DIVIDE)operator(:) - reserved(begin) - ident(DoSmartExpand) operator(:=) ident(False)operator(;) - ident(Node)operator(.)ident(Collapse)operator(()ident(true)operator(\))operator(;) - ident(DoSmartExpand) operator(:=) ident(True)operator(;) - ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) ident(ssctrl) reserved(in) ident(Shift) reserved(then) - reserved(case) ident(Key) reserved(of) - ident(Ord)operator(()charoperator(\))operator(:) ident(CopyPathMIClick)operator(()ident(Sender)operator(\))operator(;) - ident(Ord)operator(()charoperator(\))operator(:) ident(CutPathMIClick)operator(()ident(Sender)operator(\))operator(;) - ident(Ord)operator(()charoperator(\))operator(:) ident(PasteKeyMIClick)operator(()ident(Sender)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) - ident(RelX)operator(,) ident(RelY)operator(:) ident(Integer)operator(;) - ident(NodeRect)operator(:) ident(TRect)operator(;) -reserved(begin) - ident(CheckRegTVHotTrack)operator(;) - - reserved(if) reserved(not) ident(Active) reserved(then) - ident(Exit)operator(;) - - ident(RelX) operator(:=) ident(RegTV)operator(.)ident(ScreenToClient)operator(()ident(Mouse)operator(.)ident(CursorPos)operator(\))operator(.)ident(X)operator(;) - ident(RelY) operator(:=) ident(RegTV)operator(.)ident(ScreenToClient)operator(()ident(Mouse)operator(.)ident(CursorPos)operator(\))operator(.)ident(Y)operator(;) - ident(Node) operator(:=) ident(RegTV)operator(.)ident(GetNodeAt)operator(()ident(RelX)operator(,) ident(RelY)operator(\))operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) reserved(not) ident(Node)operator(.)ident(Selected) reserved(then) - ident(Node)operator(.)ident(Selected) operator(:=) ident(True)operator(;) - - reserved(if) ident(Button) operator(=) ident(mbLeft) reserved(then) reserved(begin) - ident(NodeRect) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(.)ident(DisplayRect)operator(()ident(True)operator(\))operator(;) - reserved(if) ident(RegTV)operator(.)ident(HotTrack) - reserved(or) operator(()ident(RelX) operator(<) ident(NodeRect)operator(.)ident(Left)operator(\)) reserved(and) operator(()ident(RelX) operator(>) ident(NodeRect)operator(.)ident(Left) operator(-) integer(20)operator(\)) reserved(then) reserved(begin) - comment(//4px more to the left (friendlier for the user\)) - reserved(if) reserved(not) ident(Node)operator(.)ident(HasChildren) reserved(then) - ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(Node)operator(,) stringoperator(\))operator(;) - ident(DoSmartExpand) operator(:=) ident(False)operator(;) - reserved(with) ident(Node) reserved(do) - reserved(if) reserved(not) ident(Expanded) reserved(then) - ident(Expand)operator(()ident(False)operator(\)) - reserved(else) - ident(Collapse)operator(()ident(False)operator(\))operator(;) - ident(DoSmartExpand) operator(:=) ident(True)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVStartDrag)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(DragObject)operator(:) ident(TDragObject)operator(\))operator(;) -reserved(begin) - ident(DragNode) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - reserved(if) ident(NodeInfo)operator(()ident(DragNode)operator(\))operator(.)ident(IsHost) reserved(then) - ident(DragNode) operator(:=) reserved(nil)operator(;) -reserved(end)operator(;) - -reserved(function) ident(OpenNodeError)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) - reserved(out) ident(Mode)operator(:) ident(TOpenNodeMode)operator(\))operator(:) ident(Integer)operator(;) -reserved(var) - ident(Key)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(ERROR_SUCCESS)operator(;) - ident(Mode) operator(:=) ident(onNodeNil)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Reg)operator(.)ident(CloseKey)operator(;) - ident(Key) operator(:=) ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\))operator(\))operator(;) - ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Key)operator(\))operator(\))operator(;) - ident(Result) operator(:=) ident(Reg)operator(.)ident(OpenKeyError)operator(()ident(ExRegKey)operator(()ident(Key)operator(\))operator(,) ident(False)operator(,) ident(True)operator(\))operator(;) - reserved(if) ident(Success)operator(()ident(Result)operator(\)) reserved(then) - reserved(if) ident(Reg)operator(.)ident(RootKey) operator(=) ident(HKDD) reserved(then) - ident(Mode) operator(:=) ident(onReadOnly) - reserved(else) - ident(Mode) operator(:=) ident(onFull) - reserved(else) reserved(if) ident(Reg)operator(.)ident(OpenKeyReadOnly)operator(()ident(ExRegKey)operator(()ident(Key)operator(\))operator(\)) reserved(then) - ident(Mode) operator(:=) ident(onReadOnly) - reserved(else) - ident(Mode) operator(:=) ident(onError)operator(;) -reserved(end)operator(;) - -reserved(function) ident(OpenNode)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(TOpenNodeMode)operator(;) -reserved(begin) - ident(OpenNodeError)operator(()ident(Reg)operator(,) ident(Node)operator(,) ident(Result)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(OpenNodeOK)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(OpenNode)operator(()ident(Reg)operator(,) ident(Node)operator(\)) reserved(in) ident(onOK)operator(;) -reserved(end)operator(;) - -reserved(function) ident(OpenCurKey)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(OpenNodeOK)operator(()ident(MainReg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(OpenCurParent)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Assigned)operator(()ident(RegTV)operator(.)ident(Selected)operator(\)) - reserved(and) ident(OpenNodeOK)operator(()ident(MainReg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(.)ident(Parent)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(TTreeWin)operator(.)ident(CreateKey)operator(()ident(Subkey)operator(:) ident(Boolean)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(Node)operator(,) ident(NewNode)operator(:) ident(TTreeNode)operator(;) - ident(KeyName)operator(:) reserved(string)operator(;) - ident(i)operator(:) ident(integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - - reserved(if) ident(CantWrite) reserved(then) - ident(Exit)operator(;) - - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) reserved(not) ident(Subkey) reserved(then) reserved(begin) - comment(//key shall be created on same level...) - reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(0) reserved(then) reserved(begin) - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - reserved(if) ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\))operator(\)) operator(<>) ident(PathOfNode)operator(()ident(Node)operator(\)) reserved(then) - comment(//check for shortcut: shortcuts are unequal to their trace) - reserved(if) ident(mrOK) operator(=) ident(MessageDlg)operator(() - string operator(+) ident(EOL) operator(+) - stringoperator(,) - ident(mtConfirmation)operator(,) operator([)ident(mbOK)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) reserved(then) reserved(begin) - ident(MainWin)operator(.)ident(GotoKey)operator(()ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\))operator(\))operator(\))operator(;) - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(.)ident(Parent)operator(;) - reserved(end) reserved(else) ident(Exit) - reserved(else) reserved(begin) - ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) - stringoperator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - reserved(end) reserved(else) - ident(Node) operator(:=) ident(Node)operator(.)ident(Parent)operator(;) comment(//set reference key to parent) - reserved(end)operator(;) - - reserved(try) - - reserved(case) ident(OpenNode)operator(()ident(MainReg)operator(,) ident(Node)operator(\)) reserved(of) - - ident(onFull)operator(:) reserved(begin) - ident(KeyName) operator(:=) stringoperator(;) comment(//find best free name) - ident(i) operator(:=) integer(0)operator(;) - reserved(while) ident(MainReg)operator(.)ident(KeyExists)operator(()ident(KeyName)operator(\)) reserved(do) reserved(begin) - ident(Inc)operator(()ident(i)operator(\))operator(;) - ident(KeyName) operator(:=) string operator(+) ident(IntToStr)operator(()ident(i)operator(\))operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) ident(MainReg)operator(.)ident(CreateKey)operator(()ident(KeyName)operator(\)) reserved(and) ident(MainReg)operator(.)ident(KeyExists)operator(()ident(KeyName)operator(\))operator(;) - comment(// ^-- CREATE KEY) - - reserved(if) reserved(not) ident(Result) reserved(then) comment(// <-- FAILED) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - reserved(end)operator(;) - - ident(onReadOnly)operator(:) ident(ShowMessage)operator(()stringoperator(\))operator(;) - - reserved(else) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - - reserved(end)operator(;) comment(//case) - - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(Result) reserved(then) - ident(Exit)operator(;) - - reserved(if) reserved(not) ident(Node)operator(.)ident(Expanded) reserved(then) reserved(begin) comment(//find the node, if Parent not Expanded) - ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\))operator(;) - ident(DoSmartExpand) operator(:=) ident(False)operator(;) - ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\))operator(;) - ident(DoSmartExpand) operator(:=) ident(True)operator(;) - ident(NewNode) operator(:=) ident(FindNode)operator(()ident(Node)operator(,) ident(KeyName)operator(\))operator(;) - reserved(end) reserved(else) - ident(NewNode) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(Node)operator(,) ident(KeyName)operator(\))operator(;) comment(//else create a new node) - - ident(Result) operator(:=) ident(Assigned)operator(()ident(NewNode)operator(\))operator(;) - reserved(if) reserved(not) ident(Result) reserved(then) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - - reserved(if) ident(Result) reserved(then) reserved(begin) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(NewNode)operator(;) - ident(RegTV)operator(.)ident(Selected)operator(.)ident(EditText)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(CloneKey)operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) - ident(Full)operator(:) ident(TRegPath)operator(;) - ident(MainKey)operator(,) ident(SubKey)operator(,) ident(NewKey)operator(,) ident(zKey)operator(:) reserved(string)operator(;) - ident(i)operator(:) ident(integer)operator(;) -reserved(begin) - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - - reserved(if) ident(CantWrite) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(NodeInfo)operator(()ident(Node)operator(\))operator(.)ident(IsHost) reserved(then) - ident(Exit)operator(;) - - ident(Full) operator(:=) ident(CurKey)operator(()ident(uhNonSystemShortcuts)operator(\))operator(;) - ident(MainKey) operator(:=) ident(LWPSolve)operator(()ident(Full)operator(.)ident(Key)operator(\))operator(;) - ident(SubKey) operator(:=) ident(FromLastChar)operator(()ident(MainKey)operator(,) charoperator(\))operator(;) - ident(MainKey) operator(:=) ident(UntilLastChar)operator(()ident(MainKey)operator(,) charoperator(\))operator(;) - reserved(if) ident(SubKey) operator(=) string reserved(then) reserved(begin) comment(//Directly beyound HKEY) - ident(SubKey) operator(:=) ident(MainKey)operator(;) - ident(MainKey) operator(:=) stringoperator(;) - reserved(end)operator(;) - - reserved(try) - ident(MainReg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(Full)operator(.)ident(Root)operator(\))operator(;) - reserved(if) reserved(not) ident(MainReg)operator(.)ident(OpenKey)operator(()ident(MainKey)operator(,) ident(False)operator(\)) reserved(then) reserved(begin) - ident(ShowMessage)operator(()string operator(+) ident(MainKey)operator(\))operator(;) - ident(Exit) reserved(end)operator(;) - reserved(if) ident(Copy)operator(()ident(SubKey)operator(,) integer(1)operator(,) integer(3)operator(\)) operator(<>) string reserved(then) - ident(NewKey) operator(:=) string operator(+) ident(SubKey) - reserved(else) - ident(NewKey) operator(:=) ident(SubKey)operator(;) - - ident(zKey) operator(:=) ident(Trim)operator(()ident(FromLastChar)operator(()ident(NewKey)operator(,) charoperator(\))operator(\))operator(;) - - ident(i) operator(:=) ident(StrToIntDef)operator(()ident(zKey)operator(,) integer(0)operator(\))operator(;) - reserved(if) ident(IsValidInteger)operator(()ident(zKey)operator(\)) reserved(then) - ident(zKey) operator(:=) ident(Trim)operator(()ident(UntilLastChar)operator(()ident(NewKey)operator(,) charoperator(\))operator(\)) - reserved(else) - ident(zKey) operator(:=) ident(NewKey)operator(;) - - reserved(while) ident(MainReg)operator(.)ident(KeyExists)operator(()ident(NewKey)operator(\)) reserved(do) reserved(begin) - ident(Inc)operator(()ident(i)operator(\))operator(;) - ident(NewKey) operator(:=) ident(zKey) operator(+) char operator(+) ident(IntToStr)operator(()ident(i)operator(\))operator(;) - reserved(end)operator(;) - - ident(MainReg)operator(.)ident(MoveKey)operator(()ident(SubKey)operator(,) ident(NewKey)operator(,) ident(False)operator(\))operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - reserved(end)operator(;) - - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(Add)operator(()ident(Node)operator(,) ident(NewKey)operator(\))operator(;) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(;) - ident(Node)operator(.)ident(EditText)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(NewShortcut)operator(;) -reserved(var) - ident(Node)operator(,) ident(ShortCutNode)operator(:) ident(TTreeNode)operator(;) - ident(ScName)operator(,) ident(ScRealPath)operator(:) reserved(string)operator(;) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(0) reserved(then) - ident(ScName) operator(:=) string operator(+) ident(Node)operator(.)ident(Text) - reserved(else) - ident(ScName) operator(:=) string operator(+) ident(Node)operator(.)ident(Text)operator(;) - - ident(ScRealPath) operator(:=) ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\))operator(\))operator(;) - reserved(if) reserved(not) ident(InputQuery)operator(()stringoperator(,) ident(ScRealPath)operator(,) ident(ScName)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(ShortCuts)operator(\)) reserved(do) - reserved(if) ident(SameText)operator(()ident(ScName)operator(,) ident(ShortCuts)operator([)ident(i)operator(])operator(.)ident(Alias)operator(\)) reserved(then) reserved(begin) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(NewShortcut)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(ShortCutNode) operator(:=) ident(AddShortcut)operator(()ident(ScName)operator(,) ident(ScRealPath)operator(,) ident(iconShortcut)operator(,) ident(uhUserShortcut)operator(,) - ident(True)operator(\))operator(;) - ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\))operator(;) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(ShortCutNode)operator(;) -reserved(end)operator(;) - -reserved(function) ident(AddShortcut)operator(()ident(Alias)operator(,) ident(RealPath)operator(:) reserved(string)operator(;) ident(Icon)operator(:) ident(Integer)operator(;) - ident(AHostType)operator(:) ident(TUniHostType) operator(=) ident(uhUserShortcut)operator(;) - ident(WriteIni)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) ident(TTreeNode)operator(;) -reserved(var) - ident(Last)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(RealPath) operator(:=) ident(TraceKey)operator(()ident(RealPath)operator(\))operator(;) comment(//Important: do this BEFORE adding a new,) - comment(//empty shortcut to ShortCuts) - - ident(SetLength)operator(()ident(ShortCuts)operator(,) ident(Length)operator(()ident(ShortCuts)operator(\)) operator(+) integer(1)operator(\))operator(;) - ident(Last) operator(:=) ident(High)operator(()ident(Shortcuts)operator(\))operator(;) - ident(ShortCuts)operator([)ident(Last)operator(])operator(.)ident(Alias) operator(:=) ident(Alias)operator(;) - ident(ShortCuts)operator([)ident(Last)operator(])operator(.)ident(RealPath) operator(:=) ident(RealPath)operator(;) - - ident(Result) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(Add)operator(()reserved(nil)operator(,) ident(Alias)operator(\))operator(;) - ident(ShortCuts)operator([)ident(Last)operator(])operator(.)ident(Node) operator(:=) ident(Result)operator(;) - - reserved(if) ident(Alias) operator(=) string reserved(then) - ident(Icon) operator(:=) ident(iconHKWM) - reserved(else) reserved(if) ident(Alias) operator(=) string reserved(then) - ident(Icon) operator(:=) ident(iconHKWU)operator(;) - ident(SetTNImage)operator(()ident(Result)operator(,) ident(Icon)operator(\))operator(;) - - ident(NodeInfo)operator(()ident(Result)operator(\))operator(.)ident(HostType) operator(:=) ident(AHostType)operator(;) - - reserved(if) ident(WriteIni) reserved(then) - reserved(with) ident(TIniFile)operator(.)ident(Create)operator(()ident(PlutoDir) operator(+) stringoperator(\)) reserved(do) - reserved(try) - ident(WriteString)operator(()stringoperator(,) ident(Alias)operator(,) ident(RealPath)operator(\))operator(;) - reserved(finally) - ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(DeleteKey)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(Node)operator(,) ident(Node2)operator(:) ident(TTreeNode)operator(;) -reserved(begin) - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - - - ident(i) operator(:=) ident(ShortcutIndex)operator(()ident(Node)operator(\))operator(;) - reserved(if) operator(()ident(i) operator(>) operator(-)integer(1)operator(\)) reserved(then) reserved(begin) - reserved(if) operator(()ident(mrYes) operator(=) ident(MessageDlg)operator(()stringchar(#13)char(#10) operator(+) - stringoperator(,) - ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\))operator(\)) reserved(then) reserved(begin) - ident(SpyThread)operator(.)ident(Suspend)operator(;) - ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) - reserved(with) ident(TIniFile)operator(.)ident(Create)operator(()ident(PlutoDir) operator(+) stringoperator(\)) reserved(do) - reserved(try) - ident(DeleteKey)operator(()stringoperator(,) ident(Shortcuts)operator([)ident(i)operator(])operator(.)ident(Alias)operator(\))operator(;) - reserved(finally) - ident(Free)operator(;) - reserved(end)operator(;) - ident(Shortcuts)operator([)ident(i)operator(]) operator(:=) ident(Shortcuts)operator([)ident(High)operator(()ident(Shortcuts)operator(\))operator(])operator(;) - ident(SetLength)operator(()ident(Shortcuts)operator(,) ident(Length)operator(()ident(Shortcuts)operator(\))operator(-)integer(1)operator(\))operator(;) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(GetNextBest)operator(()ident(Node)operator(\))operator(;) - ident(Node)operator(.)ident(Delete)operator(;) - ident(RegTVChange)operator(()ident(Self)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\))operator(;) - ident(SpyThread)operator(.)ident(Resume)operator(;) - reserved(end)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(if) ident(CantWrite) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(NodeInfo)operator(()ident(Node)operator(\))operator(.)ident(IsHost) reserved(then) - ident(Exit)operator(;) - - ident(SpyThread)operator(.)ident(Suspend)operator(;) - ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) - - ident(Node2) operator(:=) ident(GetNextBest)operator(()ident(Node)operator(\))operator(;) - - reserved(if) ident(MessageDlg)operator(()stringoperator(,) ident(mtConfirmation)operator(,) - operator([)ident(mbYes)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) operator(=) ident(mrYes) reserved(then) - reserved(try) - reserved(if) ident(OpenCurParent) reserved(then) reserved(begin) - reserved(if) reserved(not) ident(MainReg)operator(.)ident(DeleteKey)operator(()ident(Node)operator(.)ident(Text)operator(\)) reserved(then) comment(//<-- DELETE KEY) - ident(ShowMessage)operator(()stringoperator(\)) - reserved(else) reserved(begin) - ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node2)operator(;) - reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(and) operator(()ident(Node2) operator(=) ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) - ident(Node)operator(.)ident(Parent)operator(.)ident(Collapse)operator(()ident(False)operator(\))operator(;) - ident(Node)operator(.)ident(Delete)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - reserved(end)operator(;) - - ident(RegTVChange)operator(()ident(Self)operator(,) ident(Node2)operator(\))operator(;) - - ident(SpyThread)operator(.)ident(Resume)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(MoveKey)operator(()reserved(const) ident(Src)operator(,) ident(Trg)operator(:) ident(TRegPath)operator(;) ident(CopyWanted)operator(:) ident(Boolean)operator(\))operator(;) -reserved(var) - ident(TrgReg)operator(:) ident(TXRegistry)operator(;) -reserved(begin) - reserved(with) ident(MainReg) reserved(do) reserved(begin) - ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(Src)operator(.)ident(Root)operator(\))operator(;) - ident(OpenKey)operator(()stringoperator(\))operator(;) - - reserved(if) reserved(not) ident(KeyExists)operator(()ident(Src)operator(.)ident(Key)operator(\)) reserved(then) reserved(begin) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - - ident(TrgReg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(with) ident(TrgReg) reserved(do) reserved(begin) - ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(Trg)operator(.)ident(Root)operator(\))operator(;) - ident(OpenKey)operator(()stringoperator(\))operator(;) - reserved(if) ident(KeyExists)operator(()ident(Trg)operator(.)ident(Key)operator(\)) reserved(then) reserved(begin) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(TrgReg)operator(.)ident(Free)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(CopyWanted) reserved(then) - reserved(if) ident(mrYes) operator(<>) ident(MessageDlg)operator(()string operator(+) ident(StrOfRegPath)operator(()ident(Src)operator(\)) operator(+) ident(EOL) operator(+) - string operator(+) ident(StrOfRegPath)operator(()ident(Trg)operator(\)) operator(+) ident(EOL) operator(+) - stringoperator(,) - ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) - reserved(then) - ident(Exit)operator(;) - - reserved(try) - ident(MainReg)operator(.)ident(MoveKey)operator(()ident(Src)operator(.)ident(Key)operator(,) ident(TrgReg)operator(,) ident(Trg)operator(.)ident(Key)operator(,) reserved(not) ident(CopyWanted)operator(\))operator(;) comment(//<-- MOVE KEY) - reserved(except) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(TrgReg)operator(.)ident(OpenKey)operator(()ident(Trg)operator(.)ident(Key)operator(,) ident(False)operator(\)) reserved(then) - ident(ShowMessage)operator(()stringoperator(\)) - reserved(else) - reserved(if) reserved(not) ident(CopyWanted) reserved(then) - ident(DragNode)operator(.)ident(Delete)operator(;) - - - ident(TrgReg)operator(.)ident(Free)operator(;) - - ident(MainReg)operator(.)ident(CloseKey)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(MoveValues)operator(()ident(SrcNode)operator(,) ident(TrgNode)operator(:) ident(TTreeNode)operator(;) - ident(CopyWanted)operator(:) ident(Boolean)operator(\))operator(;) -reserved(var) - ident(SrcReg)operator(,) ident(TrgReg)operator(:) ident(TXRegistry)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - ident(ValueName)operator(:) reserved(string)operator(;) - ident(AnswerToAll)operator(:) ident(Integer)operator(;) - - reserved(function) ident(AskForReplacing)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) - reserved(begin) - reserved(if) ident(AnswerToAll) operator(=) operator(-)integer(1) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(MessageDlg)operator(() - string operator(+) ident(Quote)operator(()ident(ValueName)operator(\)) operator(+) string operator(+) ident(EOL) operator(+) - stringoperator(,) - ident(mtWarning)operator(,) operator([)ident(mbNo)operator(,) ident(mbYes)operator(,) ident(mbNoToAll)operator(,) ident(mbYesToAll)operator(,) ident(mbAbort)operator(])operator(,) integer(0)operator(\))operator(;) - reserved(if) ident(Result) reserved(in) operator([)ident(mrNoToAll)operator(,) ident(mrYesToAll)operator(]) reserved(then) reserved(begin) - reserved(if) ident(Result) operator(=) ident(mrYesToAll) reserved(then) - ident(Result) operator(:=) ident(mrYes) - reserved(else) reserved(if) ident(Result) operator(=) ident(mrNoToAll) reserved(then) - ident(Result) operator(:=) ident(mrNo)operator(;) - ident(AnswerToAll) operator(:=) ident(Result)operator(;) - reserved(end)operator(;) - reserved(end) reserved(else) ident(Result) operator(:=) ident(AnswerToAll)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(AnswerToAll) operator(:=) operator(-)integer(1)operator(;) - - reserved(if) reserved(not) ident(CopyWanted) reserved(then) - reserved(if) ident(mrYes)operator(<>)ident(MessageDlg)operator(() - ident(Format)operator(() - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - stringoperator(,) - operator([)ident(StrNumerus)operator(()ident(ValueList)operator(.)ident(SelCount)operator(,) stringoperator(,) stringoperator(\))operator(,) - ident(PathOfNode)operator(()ident(SrcNode)operator(\))operator(,) ident(PathOfNode)operator(()ident(TrgNode)operator(\))operator(]) - operator(\))operator(,) ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbAbort)operator(])operator(,) integer(0)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(SrcReg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - reserved(if) reserved(not) operator(()ident(OpenNode)operator(()ident(SrcReg)operator(,) ident(SrcNode)operator(\)) reserved(in) ident(onOK)operator(\)) reserved(then) - ident(MessageDlg)operator(()string operator(+) ident(PathOfNode)operator(()ident(SrcNode)operator(\))operator(,) - ident(mtError)operator(,) operator([)ident(mbOK)operator(])operator(,) integer(0)operator(\))operator(;) - - ident(TrgReg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - reserved(if) reserved(not) operator(()ident(OpenNode)operator(()ident(TrgReg)operator(,) ident(TrgNode)operator(\)) reserved(in) ident(onOK)operator(\)) reserved(then) - ident(MessageDlg)operator(()string operator(+) ident(PathOfNode)operator(()ident(TrgNode)operator(\))operator(,) - ident(mtError)operator(,) operator([)ident(mbOK)operator(])operator(,) integer(0)operator(\))operator(;) - - reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) reserved(begin) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - reserved(if) reserved(not) ident(Item)operator([)ident(i)operator(])operator(.)ident(Selected) reserved(then) - ident(Continue)operator(;) - ident(ValueName) operator(:=) ident(RealValueName)operator(()ident(Item)operator([)ident(i)operator(])operator(\))operator(;) - - reserved(if) ident(TrgReg)operator(.)ident(ValueExists)operator(()ident(ValueName)operator(\)) reserved(then) reserved(begin) - reserved(case) ident(AskForReplacing)operator(()ident(ValueName)operator(\)) reserved(of) - ident(mrYes)operator(:) operator(;) - ident(mrNo)operator(:) ident(Continue)operator(;) - ident(mrAbort)operator(:) ident(Break)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - ident(TrgReg)operator(.)ident(WriteContext)operator(()ident(ValueName)operator(,) ident(SrcReg)operator(.)ident(ReadContext)operator(()ident(ValueName)operator(\))operator(\))operator(;) - reserved(if) reserved(not) ident(CopyWanted) reserved(then) - ident(SrcReg)operator(.)ident(DeleteValue)operator(()ident(ValueName)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(finally) - ident(TrgReg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - - reserved(finally) - ident(SrcReg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(CopyWanted) reserved(then) - ident(ValuesWin)operator(.)ident(Reload)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(NewSubKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CreateKey)operator(()ident(True)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(NewKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CreateKey)operator(()ident(False)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(CreateShortcutMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(NewShortcut)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(TraceMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(NodeInfo)operator(()ident(RegTV)operator(.)ident(Selected)operator(\))operator(.)ident(IsShortcut) reserved(then) - ident(MainWin)operator(.)ident(GotoKey)operator(()ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\))operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(DeleteMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(RegTV)operator(.)ident(IsEditing) reserved(then) - ident(DeleteKey)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(DublicateMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CloneKey)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(FindMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(FindWin)operator(.)ident(SfCurKeyRB)operator(.)ident(Checked) operator(:=) ident(True)operator(;) - ident(FindWin)operator(.)ident(Show)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(RegTVChange)operator(()ident(Sender)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\))operator(;) - reserved(with) ident(NodeInfo)operator(()ident(RegTV)operator(.)ident(Selected)operator(\)) reserved(do) reserved(begin) - ident(NewSubKeyMI)operator(.)ident(Enabled) operator(:=) reserved(not) ident(CantWrite)operator(;) - ident(NewKeyMI)operator(.)ident(Enabled) operator(:=) reserved(not) ident(CantWrite) reserved(and) operator(()reserved(not) ident(IsHost) reserved(or) ident(IsShortcut)operator(\))operator(;) - ident(DublicateMI)operator(.)ident(Enabled) operator(:=) reserved(not) ident(CantWrite) reserved(and) reserved(not) ident(IsHost)operator(;) - - reserved(with) ident(DeleteMI) reserved(do) - reserved(if) ident(HostType) operator(=) ident(uhUserShortcut) reserved(then) reserved(begin) - ident(Caption) operator(:=) stringoperator(;) - ident(Enabled) operator(:=) ident(True)operator(;) - reserved(end) reserved(else) reserved(begin) - ident(Caption) operator(:=) stringoperator(;) - ident(Enabled) operator(:=) reserved(not) ident(CantWrite) reserved(and) reserved(not) ident(IsHost)operator(;) - reserved(end)operator(;) - - ident(RenameMI)operator(.)ident(Enabled) operator(:=) reserved(not) ident(CantWrite) reserved(and) operator(()ident(HostType) reserved(in) operator([)ident(uhNone)operator(,) ident(uhUserShortcut)operator(])operator(\))operator(;) - ident(TraceMI)operator(.)ident(Visible) operator(:=) ident(IsShortcut)operator(;) - ident(EditShortcutMI)operator(.)ident(Visible) operator(:=) ident(HostType) operator(=) ident(uhUserShortcut)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(CheckNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(;) ident(OnlyOnce)operator(:) ident(Boolean) operator(=) ident(True)operator(;) - ident(TakeNodeSelected)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(;) -reserved(var) - ident(CurIcon)operator(,) ident(NewIcon)operator(:) ident(Integer)operator(;) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - ident(OpenMode)operator(:) ident(TOpenNodeMode)operator(;) - ident(Info)operator(:) ident(TNodeInfo)operator(;) -preprocessor({$IFDEF UNIKEY}) - ident(Uni)operator(:) ident(TUniKey)operator(;) -preprocessor({$ENDIF}) - ident(KeyHasChildren)operator(:) ident(Boolean)operator(;) - - reserved(procedure) ident(SetShortcutIcon)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(var) - ident(Full)operator(:) reserved(string)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - reserved(begin) - ident(Full) operator(:=) ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\))operator(\))operator(;) - reserved(for) ident(i) operator(:=) ident(Low)operator(()ident(Shortcuts)operator(\)) reserved(to) ident(High)operator(()ident(Shortcuts)operator(\)) reserved(do) - reserved(if) ident(Full) operator(=) ident(Shortcuts)operator([)ident(i)operator(])operator(.)ident(RealPath) reserved(then) reserved(begin) - ident(CurIcon) operator(:=) ident(Shortcuts)operator([)ident(i)operator(])operator(.)ident(Node)operator(.)ident(ImageIndex)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - reserved(if) ident(Node)operator(.)ident(ImageIndex) reserved(in) operator([)ident(iconShortcut)operator(,) ident(iconShortcut) operator(+) integer(1)operator(]) reserved(then) - ident(CurIcon) operator(:=) ident(iconKey) operator(+) operator(()ident(CurIcon) operator(-) ident(iconShortcut)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Info) operator(:=) ident(NodeInfo)operator(()ident(Node)operator(\))operator(;) - reserved(if) ident(OnlyOnce) reserved(and) ident(Info)operator(.)ident(Checked) reserved(then) - ident(Exit)operator(;) - - ident(CurIcon) operator(:=) ident(Node)operator(.)ident(ImageIndex)operator(;) - reserved(if) operator(()ident(CurIcon) operator(>) ident(iconFirstType)operator(\)) reserved(then) reserved(begin) -preprocessor({$IFDEF UNIKEY}) - reserved(if) ident(RootOfNode)operator(()ident(Node)operator(\))operator(.)ident(ImageIndex) operator(<>) ident(iconHostUni) reserved(then) reserved(begin) - ident(SetShortcutIcon)operator(()ident(Node)operator(\))operator(;) - ident(CurIcon) operator(:=) operator(()ident(CurIcon) reserved(div) integer(2)operator(\)) operator(*) integer(2)operator(;) - reserved(end)operator(;) -preprocessor({$ELSE}) - ident(Exit)operator(;) -preprocessor({$ENDIF}) - reserved(end) reserved(else) reserved(begin) - ident(SetShortcutIcon)operator(()ident(Node)operator(\))operator(;) - ident(CurIcon) operator(:=) operator(()ident(CurIcon) reserved(div) integer(2)operator(\)) operator(*) integer(2)operator(;) - reserved(end)operator(;) - ident(NewIcon) operator(:=) ident(CurIcon)operator(;) - - ident(Info)operator(.)ident(ExcludeFlag)operator(()ident(nfDefect)operator(\))operator(;) - ident(Info)operator(.)ident(ExcludeFlag)operator(()ident(nfReadOnly)operator(\))operator(;) - -preprocessor({$IFDEF UNIKEY}) - ident(KeyHasChildren) operator(:=) ident(False)operator(;) - - reserved(if) ident(RootOfNode)operator(()ident(Node)operator(\))operator(.)ident(ImageIndex) operator(=) ident(iconHostUni) reserved(then) reserved(begin) - ident(Uni) operator(:=) ident(UniOfNode)operator(()ident(Node)operator(\))operator(;) - reserved(if) ident(Assigned)operator(()ident(Uni)operator(\)) reserved(then) - reserved(try) - ident(KeyHasChildren) operator(:=) ident(Uni)operator(.)ident(HasKeys)operator(;) - reserved(if) ident(usReadOnly) operator(>=) ident(Uni)operator(.)ident(Skills) reserved(then) - ident(OpenMode) operator(:=) ident(onReadOnly) - reserved(else) - ident(OpenMode) operator(:=) ident(onFull)operator(;) - reserved(finally) - ident(Uni)operator(.)ident(Free)operator(;) - reserved(end) - reserved(else) - ident(OpenMode) operator(:=) ident(onError)operator(;) - reserved(end) reserved(else) reserved(begin) -preprocessor({$ENDIF}) - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - ident(OpenMode) operator(:=) ident(OpenNode)operator(()ident(Reg)operator(,) ident(Node)operator(\))operator(;) - ident(KeyHasChildren) operator(:=) ident(Reg)operator(.)ident(HasSubKeys)operator(;) - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) -preprocessor({$IFDEF UNIKEY}) - reserved(end)operator(;) -preprocessor({$ENDIF}) - - reserved(if) ident(OpenMode) operator(=) ident(onReadOnly) reserved(then) - ident(Info)operator(.)ident(IncludeFlag)operator(()ident(nfReadOnly)operator(\))operator(;) - - reserved(if) ident(OpenMode) reserved(in) ident(onOK) reserved(then) reserved(begin) - comment(//OK, could open) - reserved(if) reserved(not) ident(Node)operator(.)ident(Expanded) reserved(then) reserved(begin) comment(//Collapsed) - reserved(if) ident(KeyHasChildren) reserved(then) reserved(begin) comment(//HasSubKeys) - reserved(if) reserved(not) ident(Node)operator(.)ident(HasChildren) reserved(then) reserved(begin) - comment(//Update: Ensure HasChildren) - reserved(if) ident(TakeNodeSelected) reserved(or) ident(Node)operator(.)ident(Selected) reserved(then) - ident(TreeWin)operator(.)ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(Node)operator(,) stringoperator(\))operator(;) - reserved(end)operator(;) - comment(//Ensure Plus-Icon) - ident(NewIcon) operator(:=) ident(CurIcon) operator(+) integer(1)operator(;) - reserved(end) reserved(else) reserved(begin) - comment(//Has still Children?) - reserved(if) ident(Node)operator(.)ident(HasChildren) reserved(then) - ident(Node)operator(.)ident(DeleteChildren)operator(;) - reserved(end)operator(;) - - reserved(end) reserved(else) reserved(begin) comment(//Expanded) - comment(//HasSubKeys?) - reserved(if) ident(KeyHasChildren) reserved(then) reserved(begin) - comment(//OK) - ident(NewIcon) operator(:=) ident(CurIcon) operator(+) integer(1)operator(;) - reserved(end) reserved(else) reserved(begin) - comment(//not OK --> update) - ident(Node)operator(.)ident(Collapse)operator(()ident(True)operator(\))operator(;) - ident(Node)operator(.)ident(DeleteChildren)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - comment(//not OK, couldn't open) - reserved(end) reserved(else) reserved(begin) comment(//defect) - reserved(if) ident(Node)operator(.)ident(HasChildren) reserved(then) - ident(Node)operator(.)ident(DeleteChildren)operator(;) - ident(Info)operator(.)ident(IncludeFlag)operator(()ident(nfDefect)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(Node)operator(.)ident(ImageIndex) operator(<>) ident(iconHostUni) reserved(then) comment(//don't change icon of UniHosts) - ident(Node)operator(.)ident(ImageIndex) operator(:=) ident(NewIcon)operator(;) - - ident(Info)operator(.)ident(IncludeFlag)operator(()ident(nfChecked)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - ident(MainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(,) ident(Key)operator(,) ident(Shift)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(ShortcutIndex)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(Integer)operator(;) -comment(//If Node is a Shortcut,) -comment(//S. returns its index in the Shortcuts array) -comment(//else -1) -reserved(begin) - reserved(if) ident(Node)operator(.)ident(Level) operator(>) integer(0) reserved(then) reserved(begin) - ident(Result) operator(:=) operator(-)integer(1)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(for) ident(Result) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Shortcuts)operator(\)) reserved(do) - reserved(if) ident(Shortcuts)operator([)ident(Result)operator(])operator(.)ident(Node) operator(=) ident(Node) reserved(then) reserved(begin) - ident(Exit)operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) operator(-)integer(1)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TraceKey)operator(()reserved(const) ident(Path)operator(:) reserved(string)operator(;) ident(AllowedShortcutTypes)operator(:) ident(TUniHostTypes) operator(=) - ident(uhNonSystemShortcuts)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(isAim)operator(:) ident(Boolean)operator(;) - - reserved(function) ident(NodeOkForTracing)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(:) ident(Boolean)operator(;) - reserved(begin) - ident(Result) operator(:=) ident(Assigned)operator(()ident(Node)operator(\)) reserved(and) - operator(()ident(NodeInfo)operator(()ident(Node)operator(\))operator(.)ident(HostType) reserved(in) ident(AllowedShortcutTypes)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(Result) operator(:=) ident(MakeLongHKEY)operator(()ident(Path)operator(\))operator(;) - reserved(repeat) - ident(isAim) operator(:=) ident(True)operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(ShortCuts)operator(\)) reserved(do) reserved(begin) - reserved(with) ident(Shortcuts)operator([)ident(i)operator(]) reserved(do) - reserved(if) ident(NodeOkForTracing)operator(()ident(Node)operator(\)) reserved(and) - ident(SameText)operator(()ident(UntilChar)operator(()ident(Result)operator(,) charoperator(\))operator(,) ident(Alias)operator(\)) reserved(then) reserved(begin) - reserved(if) ident(Alias) operator(=) ident(RealPath) reserved(then) - ident(Break)operator(;) - ident(Delete)operator(()ident(Result)operator(,) integer(1)operator(,) ident(Length)operator(()ident(Alias)operator(\))operator(\))operator(;) - ident(Result) operator(:=) ident(RealPath) operator(+) ident(Result)operator(;) - ident(isAim) operator(:=) ident(False)operator(;) - ident(Break)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - reserved(until) ident(isAim)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVKeyPress)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Char)operator(\))operator(;) -reserved(begin) - reserved(if) operator(()ident(Key) operator(=) charoperator(\)) reserved(and) ident(NoAsterisk) reserved(then) reserved(begin) - ident(Key) operator(:=) char(#0)operator(;) - ident(NoAsterisk) operator(:=) ident(False)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVAdvancedCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) - ident(Node)operator(:) ident(TTreeNode)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) ident(Stage)operator(:) ident(TCustomDrawStage)operator(;) - reserved(var) ident(PaintImages)operator(,) ident(DefaultDraw)operator(:) ident(Boolean)operator(\))operator(;) -reserved(var) - ident(Rect)operator(:) ident(TRect)operator(;) - ident(MainValueName)operator(:) reserved(string)operator(;) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - ident(Info)operator(:) ident(TRegKeyInfo)operator(;) - ident(PreviewPosX)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(DefaultIconPreview)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(\))operator(;) - reserved(var) - ident(Icon)operator(:) ident(HICON)operator(;) - ident(IconFile)operator(:) reserved(string)operator(;) - reserved(begin) - reserved(if) operator(()ident(Node)operator(.)ident(Level) operator(=) integer(0)operator(\)) reserved(and) reserved(not) ident(RegTV)operator(.)ident(ShowLines) reserved(then) - ident(Exit)operator(;) - - ident(IconFile) operator(:=) ident(Reg)operator(.)ident(ReadDefaultIcon)operator(;) - reserved(if) ident(IconFile) operator(=) string reserved(then) - ident(Exit)operator(;) - - ident(Icon) operator(:=) ident(GetIconFromFile)operator(()ident(ExpandString)operator(()ident(IconFile)operator(\))operator(\))operator(;) - reserved(if) ident(Icon) operator(=) integer(0) reserved(then) - ident(Exit)operator(;) - - reserved(with) ident(Rect) reserved(do) reserved(begin) - ident(Dec)operator(()ident(Left)operator(,) ident(TTreeView)operator(()ident(Sender)operator(\))operator(.)ident(Indent) operator(+) integer(16)operator(\))operator(;) - ident(DrawIconEx)operator(()ident(Sender)operator(.)ident(Canvas)operator(.)ident(Handle)operator(,) ident(Left)operator(,) ident(Top)operator(,) - ident(Icon)operator(,) integer(16)operator(,) integer(16)operator(,) - integer(0)operator(,) integer(0)operator(,) ident(DI_NORMAL)operator(\))operator(;) - ident(DestroyIcon)operator(()ident(Icon)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(AddPreview)operator(()reserved(const) ident(PreviewText)operator(:) reserved(string)operator(;) ident(Color)operator(:) ident(TColor)operator(\))operator(;) - reserved(begin) - reserved(with) ident(Sender)operator(.)ident(Canvas) reserved(do) reserved(begin) - ident(SetTextColor)operator(()ident(Handle)operator(,) ident(Color)operator(\))operator(;) - ident(ExtTextOut)operator(()ident(Handle)operator(,) ident(PreviewPosX)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(1)operator(,) ident(TextFlags)operator(,) reserved(nil)operator(,) - ident(PChar)operator(()ident(PreviewText)operator(\))operator(,) ident(Length)operator(()ident(PreviewText)operator(\))operator(,) reserved(nil)operator(\))operator(;) - ident(Inc)operator(()ident(PreviewPosX)operator(,) ident(TextWidth)operator(()ident(PreviewText)operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) ident(Stage) operator(<>) ident(cdPostPaint) reserved(then) - ident(Exit)operator(;) - - ident(MainValueName) operator(:=) ident(PrefWin)operator(.)ident(MainPreviewE)operator(.)ident(Text)operator(;) - - ident(Rect) operator(:=) ident(Node)operator(.)ident(DisplayRect)operator(()ident(True)operator(\))operator(;) - ident(PreviewPosX) operator(:=) ident(Rect)operator(.)ident(Right) operator(+) integer(5)operator(;) - - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(()ident(KEY_READ)operator(\))operator(;) - reserved(try) - reserved(if) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(Node)operator(\)) reserved(then) reserved(begin) -comment(// Sender.Canvas.Font.Style := [];) - reserved(if) ident(PrefWin)operator(.)ident(KeyInfoPreviewCB)operator(.)ident(Checked) reserved(and) ident(Reg)operator(.)ident(GetKeyInfo)operator(()ident(Info)operator(\)) reserved(then) - reserved(with) ident(Info) reserved(do) reserved(begin) - reserved(if) ident(NumSubKeys) operator(>) integer(0) reserved(then) - ident(AddPreview)operator(()ident(IntToStr)operator(()ident(NumSubKeys)operator(\)) operator(+) stringoperator(,) ident(clCyan)operator(\))operator(;) - reserved(if) ident(NumValues) operator(>) integer(0) reserved(then) - ident(AddPreview)operator(()ident(IntToStr)operator(()ident(NumValues)operator(\)) operator(+) stringoperator(,) ident(clBrightPurple)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(PrefWin)operator(.)ident(MainPreviewCB)operator(.)ident(Checked) reserved(then) - reserved(if) ident(Reg)operator(.)ident(ValueReallyExists)operator(()ident(MainValueName)operator(\)) reserved(then) - ident(AddPreview)operator(()ident(DataPreviewOfContext)operator(()ident(Reg)operator(.)ident(ReadContext)operator(()ident(MainValueName)operator(\))operator(\))operator(,) hex($00AAFFFF)operator(\))operator(;) - comment({clBrightYellow}) - reserved(if) ident(PrefWin)operator(.)ident(DefaultIconPreviewCB)operator(.)ident(Checked) reserved(then) - ident(DefaultIconPreview)operator(()ident(Reg)operator(\))operator(;) - reserved(end)operator(;) - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - - comment({if nfCopy in NodeInfo(Node\).Flags then begin - //Node.StateIndex := 2; - Brush.Style := bsClear; - with Font do begin - Style := [fsItalic, fsBold]; - Color := clRed; - end; - //TextOut(Rect.Left - 10, Rect.Top + 3, 'c'\); - end;}) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RenameMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(RegTV)operator(.)ident(Selected)operator(.)ident(EditText)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(CopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(UserCopyKeyFlag) operator(:=) ident(True)operator(;) - ident(MainWin)operator(.)ident(CopyPathClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(InsertPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(MainWin)operator(.)ident(InsertPathClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVGetImageIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(NodeInfo)operator(()ident(Node)operator(\))operator(.)ident(Checked) reserved(then) - ident(CheckNode)operator(()ident(Node)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(CheckRegTVHotTrack)operator(;) -reserved(const) - ident(FindCursorOfSwitch)operator(:) reserved(array)operator([)ident(Boolean)operator(]) reserved(of) ident(TCursor) operator(=) operator(()ident(crArrow)operator(,) ident(crHandPoint)operator(\))operator(;) -reserved(var) - ident(NewHotTrack)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(NewHotTrack) operator(:=) ident(ScrollON) reserved(xor) ident(PrefWin)operator(.)ident(KeysSingleClickCB)operator(.)ident(Checked)operator(;) - reserved(if) ident(NewHotTrack) operator(=) ident(RegTV)operator(.)ident(HotTrack) reserved(then) ident(Exit)operator(;) - - reserved(with) ident(RegTV) reserved(do) reserved(begin) - ident(HotTrack) operator(:=) ident(NewHotTrack)operator(;) - ident(Cursor) operator(:=) ident(FindCursorOfSwitch)operator([)ident(HotTrack)operator(])operator(;) - ident(Mouse)operator(.)ident(CursorPos) operator(:=) ident(Mouse)operator(.)ident(CursorPos)operator(;) comment(//update cursor) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(PasteKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Src)operator(,) ident(Trg)operator(:) ident(TRegPath)operator(;) - ident(Node)operator(:) ident(TTreeNode)operator(;) -reserved(begin) - ident(Src) operator(:=) ident(RegPathOfStr)operator(()ident(Clipboard)operator(.)ident(AsText)operator(\))operator(;) - ident(Trg) operator(:=) ident(CurKey)operator(()ident(uhNonSystemShortcuts)operator(\))operator(;) - ident(Trg)operator(.)ident(Key) operator(:=) ident(Trg)operator(.)ident(Key) operator(+) char operator(+) ident(FromLastChar)operator(()ident(Src)operator(.)ident(Key)operator(,) charoperator(,) ident(True)operator(\))operator(;) - - ident(MoveKey)operator(()ident(Src)operator(,) ident(Trg)operator(,) ident(UserCopyKeyFlag)operator(\))operator(;) - - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) - ident(Node)operator(.)ident(Collapse)operator(()ident(False)operator(\))operator(;) - ident(Node)operator(.)ident(Expanded) operator(:=) ident(False)operator(;) - ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\))operator(;) - ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\))operator(;) - - reserved(if) reserved(not) ident(UserCopyKeyFlag) reserved(then) - ident(RegTV)operator(.)ident(Repaint)operator(;) comment(// CheckNode(Node, False\);) - - ident(UserCopyKeyFlag) operator(:=) ident(True)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(CutPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(UserCopyKeyFlag) operator(:=) ident(False)operator(;) - ident(MainWin)operator(.)ident(CopyPathClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(OpenNextLevel)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - - reserved(procedure) ident(ExpandKeys)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(begin) - ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(,) ident(True)operator(\))operator(;) - reserved(if) reserved(not) ident(Node)operator(.)ident(HasChildren) reserved(then) - ident(Exit)operator(;) - reserved(if) reserved(not) ident(Node)operator(.)ident(Expanded) reserved(then) - ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\)) - reserved(else) reserved(begin) - ident(Node) operator(:=) ident(Node)operator(.)ident(GetFirstChild)operator(;) - reserved(while) ident(Assigned)operator(()ident(Node)operator(\)) reserved(do) reserved(begin) - ident(ExpandKeys)operator(()ident(Node)operator(\))operator(;) - ident(Node) operator(:=) ident(Node)operator(.)ident(GetNextSibling)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(DoSmartExpand) operator(:=) ident(False)operator(;) - ident(ExpandKeys)operator(()ident(Node)operator(\))operator(;) - ident(DoSmartExpand) operator(:=) ident(True)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(EditShortcutMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(NewPath)operator(:) reserved(string)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - ident(Node)operator(:) ident(TTreeNode)operator(;) - ident(Shortcut)operator(:) ident(PKeyShortcut)operator(;) -reserved(begin) - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - reserved(if) ident(NodeInfo)operator(()ident(Node)operator(\))operator(.)ident(HostType) operator(<>) ident(uhUserShortcut) reserved(then) - ident(Exit)operator(;) - - ident(i) operator(:=) ident(ShortcutIndex)operator(()ident(Node)operator(\))operator(;) - reserved(if) ident(i) operator(=) operator(-)integer(1) reserved(then) - ident(Exit)operator(;) - - reserved(with) ident(TIniFile)operator(.)ident(Create)operator(()ident(PlutoDir) operator(+) stringoperator(\)) reserved(do) - reserved(try) - ident(NewPath) operator(:=) ident(ReadString)operator(()stringoperator(,) ident(Shortcuts)operator([)ident(i)operator(])operator(.)ident(Alias)operator(,) stringoperator(\))operator(;) - reserved(finally) - ident(Free)operator(;) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(InputQuery)operator(()stringoperator(,) stringoperator(,) ident(NewPath)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Node)operator(.)ident(Collapse)operator(()ident(False)operator(\))operator(;) - ident(Shortcut) operator(:=) operator(@)ident(Shortcuts)operator([)ident(i)operator(])operator(;) - ident(Shortcut)operator(.)ident(RealPath) operator(:=) ident(TraceKey)operator(()ident(NewPath)operator(\))operator(;) - reserved(with) ident(TIniFile)operator(.)ident(Create)operator(()ident(PlutoDir) operator(+) stringoperator(\)) reserved(do) - reserved(try) - ident(WriteString)operator(()stringoperator(,) ident(Shortcut)operator(.)ident(Alias)operator(,) ident(Shortcut)operator(.)ident(RealPath)operator(\))operator(;) - reserved(finally) - ident(Free)operator(;) - reserved(end)operator(;) - - ident(RegTVChange)operator(()ident(Self)operator(,) ident(Node)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(SubKeylist1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) -reserved(begin) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - reserved(if) ident(OpenCurKey) reserved(then) - reserved(try) - ident(MainReg)operator(.)ident(GetKeyNames)operator(()ident(SL)operator(\))operator(;) - reserved(if) ident(PrefWin)operator(.)ident(SortKeysCB)operator(.)ident(Checked) reserved(then) - ident(SL)operator(.)ident(Sort)operator(;) - ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(SL)operator(.)ident(Text)operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - ident(SL)operator(.)ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(ValueNameslist1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) -reserved(begin) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - reserved(if) ident(OpenCurKey) reserved(then) - reserved(try) - ident(MainReg)operator(.)ident(GetValueNames)operator(()ident(SL)operator(\))operator(;) - reserved(if) ident(PrefWin)operator(.)ident(SortKeysCB)operator(.)ident(Checked) reserved(then) - ident(SL)operator(.)ident(Sort)operator(;) - ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(SL)operator(.)ident(Text)operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - ident(SL)operator(.)ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(KeyInfosMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(MessageDlg)operator(()ident(GetKeyInfos)operator(,) ident(mtInformation)operator(,) operator([)ident(mbOK)operator(])operator(,) integer(0)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(TTreeWin)operator(.)ident(GetKeyInfos)operator(:) reserved(string)operator(;) -reserved(const) - ident(sErrorMsg) operator(=) stringoperator(;) - -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - ident(Mode)operator(:) ident(TOpenNodeMode)operator(;) - ident(Error)operator(:) ident(Integer)operator(;) - ident(Info)operator(:) ident(TNodeInfo)operator(;) - ident(Flag)operator(:) ident(TNodeFlag)operator(;) - - reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(;) - reserved(begin) - ident(Result) operator(:=) ident(Result) operator(+) ident(S)operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(AddLn)operator(()reserved(const) ident(S)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) - reserved(begin) - ident(Add)operator(()ident(S) operator(+) ident(EOL)operator(\))operator(;) - reserved(end)operator(;) - - reserved(procedure) ident(AddNodeInfo)operator(()ident(Key)operator(:) ident(HKEY)operator(\))operator(;) - reserved(var) - ident(KeyInfo)operator(:) ident(TRegKeyInfo)operator(;) - ident(Res)operator(:) ident(Integer)operator(;) - ident(KeyAge)operator(:) ident(TDateTime)operator(;) - reserved(begin) - ident(FillChar)operator(()ident(KeyInfo)operator(,) ident(SizeOf)operator(()ident(TRegKeyInfo)operator(\))operator(,) integer(0)operator(\))operator(;) - reserved(with) ident(KeyInfo) reserved(do) reserved(begin) - ident(Res) operator(:=) ident(RegQueryInfoKey)operator(()ident(Reg)operator(.)ident(CurrentKey)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) operator(@)ident(NumSubKeys)operator(,) - operator(@)ident(MaxSubKeyLen)operator(,) reserved(nil)operator(,) operator(@)ident(NumValues)operator(,) operator(@)ident(MaxValueLen)operator(,) - operator(@)ident(MaxDataLen)operator(,) reserved(nil)operator(,) operator(@)ident(LastWriteTime)operator(\))operator(;) - - reserved(if) ident(Res) operator(=) ident(ERROR_SUCCESS) reserved(then) reserved(begin) - ident(Add)operator(()ident(Format)operator(() - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - stringoperator(,) - operator([)ident(NumSubKeys)operator(,) ident(MaxSubKeyLen)operator(,) ident(NumValues)operator(,) ident(MaxValueLen)operator(,) ident(MaxDataLen)operator(])operator(\))operator(\))operator(;) - ident(KeyAge) operator(:=) ident(DateTimeOfFileTime)operator(()ident(LastWriteTime)operator(\))operator(;) - reserved(if) ident(KeyAge) operator(>) integer(0) reserved(then) - ident(AddLn)operator(()string operator(+) ident(DateTimeToStr)operator(()ident(KeyAge)operator(\))operator(\))operator(;) - reserved(end) reserved(else) - ident(AddLn)operator(()string operator(+) ident(EOL) operator(+) - string operator(+) ident(IntToStr)operator(()ident(Res)operator(\)) operator(+) ident(EOL) operator(+) - string operator(+) ident(SysErrorMessage)operator(()ident(Res)operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(()ident(KEY_READ)operator(\))operator(;) - reserved(try) - reserved(try) - ident(Error) operator(:=) ident(OpenNodeError)operator(()ident(Reg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(,) ident(Mode)operator(\))operator(;) - - reserved(case) ident(Mode) reserved(of) - ident(onFull)operator(:) ident(AddLn)operator(()stringoperator(\))operator(;) - ident(onReadOnly)operator(:) ident(AddLn)operator(()stringoperator(\))operator(;) - ident(onError)operator(:) - ident(AddLn)operator(()ident(Format)operator(()ident(sErrorMsg)operator(,) operator([)ident(Error)operator(,) ident(SysErrorMessage)operator(()ident(Error)operator(\))operator(])operator(\))operator(\))operator(;) - ident(onNodeNil)operator(:) ident(AddLn)operator(()stringoperator(\))operator(;) - - reserved(else) - ident(AddLn)operator(()string operator(+) ident(IntToStr)operator(()ident(Integer)operator(()ident(Mode)operator(\))operator(\))operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(Mode) reserved(in) ident(onOK) reserved(then) - ident(AddNodeInfo)operator(()ident(Reg)operator(.)ident(CurrentKey)operator(\))operator(;) - - reserved(except) - directive(on) ident(E)operator(:) ident(Exception) reserved(do) reserved(begin) - ident(Error) operator(:=) ident(GetLastError)operator(;) - reserved(if) ident(Error) operator(<>) ident(ERROR_SUCCESS) reserved(then) - ident(AddLn)operator(()ident(Format)operator(()stringoperator(,) operator([)ident(Error)operator(,) ident(SysErrorMessage)operator(()ident(Error)operator(\))operator(])operator(\))operator(\)) - reserved(else) - ident(AddLn)operator(()ident(E)operator(.)ident(Message)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - - reserved(if) ident(MurphyMode) reserved(then) reserved(begin) - ident(AddLn)operator(()string operator(+) ident(IntToStr)operator(()ident(Node)operator(.)ident(ImageIndex)operator(\))operator(\))operator(;) - ident(Info) operator(:=) ident(NodeInfo)operator(()ident(Node)operator(\))operator(;) - - reserved(if) ident(Info)operator(.)ident(HostType) reserved(in) operator([)ident(uhNone)operator(..)ident(High)operator(()ident(HostTypeStrings)operator(\))operator(]) reserved(then) - ident(AddLn)operator(()string operator(+) ident(HostTypeStrings)operator([)ident(Info)operator(.)ident(HostType)operator(])operator(\)) - reserved(else) - ident(AddLn)operator(()string operator(+) ident(IntToStr)operator(()ident(Integer)operator(()ident(Info)operator(.)ident(HostType)operator(\))operator(\))operator(\))operator(;) - ident(Add)operator(()stringoperator(\))operator(;) - reserved(for) ident(Flag) operator(:=) ident(Low)operator(()ident(TNodeFlag)operator(\)) reserved(to) ident(High)operator(()ident(TNodeFlag)operator(\)) reserved(do) - reserved(if) ident(Flag) reserved(in) ident(Info)operator(.)ident(Flags) reserved(then) - ident(Add)operator(()ident(NodeFlagStrings)operator([)ident(Flag)operator(]) operator(+) charoperator(\))operator(;) - ident(AddLn)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(ExportAsRegClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - - reserved(procedure) ident(ExportAsReg4)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(;) - reserved(var) - ident(Reg4Writer)operator(:) ident(TReg4Writer)operator(;) - reserved(begin) - ident(Reg4Writer) operator(:=) ident(TReg4Writer)operator(.)ident(Create)operator(()ident(tpNormal)operator(,) ident(FileName)operator(,) - ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\))operator(\))operator(,) ident(Reg)operator(.)ident(DeliverKey)operator(\))operator(;) - reserved(with) ident(Reg4Writer) reserved(do) reserved(begin) - ident(OnTerminate) operator(:=) ident(Reg4WriterTerminate)operator(;) - reserved(try) - ident(AddHint)operator(()ident(Format)operator(()stringoperator(,) - operator([)ident(Root) operator(+) char operator(+) ident(Path)operator(])operator(\))operator(\))operator(;) - ident(Resume)operator(;) - reserved(except) - ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - ident(AddToLastHint)operator(()stringoperator(\))operator(;) - reserved(end)operator(;) - - - reserved(procedure) ident(ExportAsHive)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(;) - reserved(begin) - reserved(if) ident(Reg)operator(.)ident(SaveKey)operator(()stringoperator(,) ident(FileName)operator(\)) reserved(then) - ident(AddHint)operator(()stringoperator(\)) - reserved(else) - ident(AddHint)operator(()ident(Format)operator(()stringoperator(,) - operator([)ident(SysErrorMessage)operator(()ident(LastSuccessRes)operator(\))operator(])operator(\))operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) - reserved(with) ident(ExportD) reserved(do) reserved(begin) - ident(FileName) operator(:=) ident(MakeValidFileName)operator(()ident(Node)operator(.)ident(Text)operator(,) stringoperator(\))operator(;) - - reserved(if) ident(Execute) reserved(then) reserved(begin) - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - reserved(if) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(Node)operator(\)) reserved(then) reserved(begin) - reserved(if) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(and) operator(()ident(mrYes)operator(=)ident(MessageDlg)operator(() - string operator(+) ident(EOL) operator(+) - stringoperator(,) - ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(])operator(,) integer(0)operator(\))operator(\)) reserved(then) reserved(begin) - ident(FileSetAttr)operator(()ident(FileName)operator(,) integer(0)operator(\))operator(;) - ident(DeleteFile)operator(()ident(FileName)operator(\))operator(;) - reserved(end)operator(;) - reserved(case) ident(FilterIndex) reserved(of) - integer(1)operator(:) ident(ExportAsReg4)operator(()ident(Reg)operator(,) ident(FileName)operator(\))operator(;) - integer(2)operator(:) ident(ExportAsHive)operator(()ident(Reg)operator(,) ident(FileName)operator(\))operator(;) - reserved(else) - ident(ShowMessage)operator(()ident(Format)operator(()stringoperator(,) operator([)ident(FilterIndex)operator(])operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\))operator(;) -reserved(begin) -comment(// Action := caNone;) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(Load)operator(;) -reserved(var) - ident(NodeHKLM)operator(,) ident(NodeHKU)operator(,) ident(NodeHKDD)operator(,) ident(NodeHKPD)operator(:) ident(TTreeNode)operator(;) - ident(NodeHostReg)operator(:) ident(TTreeNode)operator(;) - - reserved(procedure) ident(LoadShortcuts)operator(()ident(FileName)operator(:) reserved(string)operator(;) ident(HostType)operator(:) ident(TUniHostType)operator(\))operator(;) - reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(SL)operator(:) ident(TStringList)operator(;) - ident(ShortcutIni)operator(:) ident(TIniFile)operator(;) - reserved(begin) - reserved(if) reserved(not) ident(FileEx)operator(()ident(FileName)operator(\)) reserved(then) reserved(begin) - ident(AddToLastHint)operator(()stringoperator(\))operator(;) - ident(AddHint)operator(()ident(FileName)operator(\))operator(;) - ident(Exit) reserved(end)operator(;) - - ident(ShortcutIni) operator(:=) ident(TIniFile)operator(.)ident(Create)operator(()ident(FileName)operator(\))operator(;) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - - reserved(try) - ident(ShortcutIni)operator(.)ident(ReadSectionValues)operator(()stringoperator(,) ident(SL)operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) - ident(AddShortcut)operator(()ident(SL)operator(.)ident(Names)operator([)ident(i)operator(])operator(,) ident(SL)operator(.)ident(Values)operator([)ident(SL)operator(.)ident(Names)operator([)ident(i)operator(])operator(])operator(,) ident(iconShortcut)operator(,) - ident(HostType)operator(\))operator(;) - ident(AddToLastHint)operator(()stringoperator(\))operator(;) - reserved(finally) - ident(SL)operator(.)ident(Free)operator(;) - ident(ShortcutIni)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(NodeHostReg) operator(:=) reserved(nil)operator(;) - - ident(AddHint)operator(()stringoperator(\))operator(;) - ident(RootNodes) operator(:=) ident(TList)operator(.)ident(Create)operator(;) - ident(ChangeLastHint)operator(()stringoperator(\))operator(;) - ident(NodeHKLM) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(NodeHostReg)operator(,) stringoperator(\))operator(;) - ident(SetTNImage)operator(()ident(NodeHKLM)operator(,) ident(iconHKLM)operator(\))operator(;) - ident(NodeInfo)operator(()ident(NodeHKLM)operator(\))operator(.)ident(HostType) operator(:=) ident(uhReg)operator(;) - ident(RootNodes)operator(.)ident(Add)operator(()ident(NodeHKLM)operator(\))operator(;) - - ident(ChangeLastHint)operator(()stringoperator(\))operator(;) - ident(NodeHKU) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(NodeHostReg)operator(,) stringoperator(\))operator(;) - ident(SetTNImage)operator(()ident(NodeHKU)operator(,) ident(iconHKU)operator(\))operator(;) - ident(NodeInfo)operator(()ident(NodeHKU)operator(\))operator(.)ident(HostType) operator(:=) ident(uhReg)operator(;) - ident(RootNodes)operator(.)ident(Add)operator(()ident(NodeHKU)operator(\))operator(;) - - ident(ChangeLastHint)operator(()stringoperator(\))operator(;) - reserved(if) ident(RegRealPath)operator(()stringoperator(\)) operator(=) string reserved(then) - comment(//could not dereference hkcu) - ident(AddShortcut)operator(()stringoperator(,) stringoperator(,) - ident(iconHKCU)operator(,) ident(uhReg)operator(\)) - reserved(else) - ident(AddShortcut)operator(()stringoperator(,) ident(RegRealPath)operator(()stringoperator(\))operator(,) - ident(iconHKCU)operator(,) ident(uhSystemShortcut)operator(\))operator(;) - - ident(ChangeLastHint)operator(()stringoperator(\))operator(;) - ident(AddShortcut)operator(()stringoperator(,) ident(RegRealPath)operator(()stringoperator(\))operator(,) - ident(iconHKCC)operator(,) ident(uhSystemShortcut)operator(\))operator(;) - - ident(ChangeLastHint)operator(()stringoperator(\))operator(;) - ident(AddShortcut)operator(()stringoperator(,) ident(RegRealPath)operator(()stringoperator(\))operator(,) - ident(iconHKCR)operator(,) ident(uhSystemShortcut)operator(\))operator(;) - - ident(MainReg)operator(.)ident(RootKey) operator(:=) ident(HKEY_DYN_DATA)operator(;) - reserved(if) ident(MainReg)operator(.)ident(OpenKeyReadOnly)operator(()stringoperator(\)) reserved(then) reserved(begin) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - ident(ChangeLastHint)operator(()stringoperator(\))operator(;) - ident(NodeHKDD) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()reserved(nil)operator(,) stringoperator(\))operator(;) - ident(NodeInfo)operator(()ident(NodeHKDD)operator(\))operator(.)ident(HostType) operator(:=) ident(uhReg)operator(;) - ident(NodeInfo)operator(()ident(NodeHKDD)operator(\))operator(.)ident(IncludeFlag)operator(()ident(nfReadOnly)operator(\))operator(;) - ident(SetTNImage)operator(()ident(NodeHKDD)operator(,) ident(iconHKDD)operator(\))operator(;) - ident(RootNodes)operator(.)ident(Add)operator(()ident(NodeHKDD)operator(\))operator(;) - reserved(end)operator(;) - - ident(MainReg)operator(.)ident(RootKey) operator(:=) ident(HKEY_PERFORMANCE_DATA)operator(;) - reserved(if) ident(MainReg)operator(.)ident(OpenKeyReadOnly)operator(()stringoperator(\)) reserved(then) reserved(begin) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - ident(ChangeLastHint)operator(()stringoperator(\))operator(;) - ident(NodeHKPD) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()reserved(nil)operator(,) stringoperator(\))operator(;) - ident(NodeInfo)operator(()ident(NodeHKPD)operator(\))operator(.)ident(HostType) operator(:=) ident(uhReg)operator(;) - ident(SetTNImage)operator(()ident(NodeHKPD)operator(,) ident(iconHKPD)operator(\))operator(;) - ident(RootNodes)operator(.)ident(Add)operator(()ident(NodeHKPD)operator(\))operator(;) - reserved(end)operator(;) - - ident(ChangeLastHint)operator(()stringoperator(\))operator(;) - - ident(AddHint)operator(()stringoperator(\))operator(;) - ident(LoadShortcuts)operator(()ident(PlutoDir) operator(+) ident(StandardShortcutsFileName)operator(,) ident(uhStandardShortcut)operator(\))operator(;) - - ident(AddHint)operator(()stringoperator(\))operator(;) - ident(LoadShortcuts)operator(()ident(PlutoDir) operator(+) ident(ShortcutsFileName)operator(,) ident(uhUserShortcut)operator(\))operator(;) - -preprocessor({$IFDEF UNIKEY}) - ident(AddShortcut)operator(()stringoperator(,) stringoperator(,) ident(iconHostUni)operator(\))operator(;) -preprocessor({$ENDIF}) -reserved(end)operator(;) - -reserved(procedure) ident(TTreeWin)operator(.)ident(Reg4WriterTerminate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(Sender) reserved(as) ident(TRegFileWriter) reserved(do) - ident(AddHint)operator(()ident(Format)operator(()stringoperator(,) - operator([)ident(Clk)operator(.)ident(SecsPassed)operator(,) ident(Root) operator(+) char operator(+) ident(Path)operator(])operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(valuesU)operator(;) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Variants)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) - ident(ComCtrls)operator(,) ident(Menus)operator(,) ident(Clipbrd)operator(,) ident(XReg)operator(,) ident(CompEx)operator(,) ident(Math)operator(,) ident(YTools)operator(,) ident(Dialogs)operator(,) ident(YTypes)operator(,) - ident(PlutoConst)operator(,) ident(keybrd)operator(,) ident(ImgList)operator(,) ident(clock)operator(;) - -reserved(type) - ident(TValuesWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) - ident(ValueListPU)operator(:) ident(TPopupMenu)operator(;) - ident(NewStringMI)operator(:) ident(TMenuItem)operator(;) - ident(NewDWORDMI)operator(:) ident(TMenuItem)operator(;) - ident(NewBinaryMI)operator(:) ident(TMenuItem)operator(;) - ident(ConvertToMI)operator(:) ident(TMenuItem)operator(;) - ident(ConvStringMI)operator(:) ident(TMenuItem)operator(;) - ident(ConvDWORDMI)operator(:) ident(TMenuItem)operator(;) - ident(ConvBinaryMI)operator(:) ident(TMenuItem)operator(;) - ident(ValueList)operator(:) ident(TListView)operator(;) - ident(DeleteMI)operator(:) ident(TMenuItem)operator(;) - ident(N1)operator(:) ident(TMenuItem)operator(;) - ident(RenameMI)operator(:) ident(TMenuItem)operator(;) - ident(NewElseMI)operator(:) ident(TMenuItem)operator(;) - ident(NewMultiStringMI)operator(:) ident(TMenuItem)operator(;) - ident(REGNONE1)operator(:) ident(TMenuItem)operator(;) - ident(LINK1)operator(:) ident(TMenuItem)operator(;) - ident(NewExpandStringMI)operator(:) ident(TMenuItem)operator(;) - ident(N3BINARY1)operator(:) ident(TMenuItem)operator(;) - ident(N4DWORD1)operator(:) ident(TMenuItem)operator(;) - ident(N4DWORDLITTLEEDIAN1)operator(:) ident(TMenuItem)operator(;) - ident(NewBigEndianMI)operator(:) ident(TMenuItem)operator(;) - ident(N6LINK1)operator(:) ident(TMenuItem)operator(;) - ident(N7MULTISZ1)operator(:) ident(TMenuItem)operator(;) - ident(RESOURCELIST1)operator(:) ident(TMenuItem)operator(;) - ident(N9FULLRESOURCEDESCRIPTOR1)operator(:) ident(TMenuItem)operator(;) - ident(ARESOURCEREQUIREMENTSLIST1)operator(:) ident(TMenuItem)operator(;) - ident(NewDefaultValueMI)operator(:) ident(TMenuItem)operator(;) - ident(EditMI)operator(:) ident(TMenuItem)operator(;) - ident(EditBinaryMI)operator(:) ident(TMenuItem)operator(;) - ident(N3)operator(:) ident(TMenuItem)operator(;) - ident(CopyDataPreviewMI)operator(:) ident(TMenuItem)operator(;) - ident(DublicateMI)operator(:) ident(TMenuItem)operator(;) - ident(MultiString1)operator(:) ident(TMenuItem)operator(;) - ident(ZeromizeMI)operator(:) ident(TMenuItem)operator(;) - ident(N4)operator(:) ident(TMenuItem)operator(;) - ident(CopyPathMI)operator(:) ident(TMenuItem)operator(;) - ident(TakeAsMainValueMI)operator(:) ident(TMenuItem)operator(;) - ident(SelectAllMI)operator(:) ident(TMenuItem)operator(;) - ident(InvertSelectionMI)operator(:) ident(TMenuItem)operator(;) - reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(InitListColumnTags)operator(;) - - reserved(procedure) ident(NewStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(NewDWORDMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(NewBinaryMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ConvertValue)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(procedure) ident(CreateValue)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\))operator(;) - reserved(procedure) ident(ZeromizeValue)operator(;) - reserved(procedure) ident(DeleteValue)operator(;) - reserved(procedure) ident(CloneValue)operator(;) - reserved(function) ident(TryRenameValue)operator(()ident(OldName)operator(:) reserved(string)operator(;) reserved(var) ident(NewName)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) - - reserved(procedure) ident(ValueListChange)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) ident(Change)operator(:) ident(TItemChange)operator(\))operator(;) - reserved(procedure) ident(ValueListCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomListView)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(ValueListDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ValueListEditing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) reserved(var) ident(AllowEdit)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(ValueListEdited)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) reserved(var) ident(S)operator(:) reserved(String)operator(\))operator(;) - reserved(procedure) ident(ValueListKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(ValueListResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(function) ident(UpdateValue)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Item)operator(:) ident(TListItem)operator(\))operator(:) ident(Boolean)operator(;) - reserved(procedure) ident(UpdateValues)operator(()ident(SelectedOnly)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(;) - reserved(procedure) ident(Reload)operator(()ident(JumpToNewValue)operator(:) ident(Boolean) operator(=) ident(False)operator(;) ident(ValueName)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) - reserved(procedure) ident(LoadValues)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(\))operator(;) - - reserved(function) ident(AddValue)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) ident(AppendInfos)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(:) ident(TListItem)operator(;) - reserved(procedure) ident(ValueListPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(ValueListDeletion)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(\))operator(;) - reserved(procedure) ident(DeleteMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(RenameMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(NewBigEndianMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(NewExpandStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(NewMultiStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(NewStrangeTypeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(NewDefaultValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ValueListChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) ident(Change)operator(:) ident(TItemChange)operator(;) reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(ValueListMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) - reserved(procedure) ident(EditBinaryMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(EditMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ValueListCustomDrawSubItem)operator(()ident(Sender)operator(:) ident(TCustomListView)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) ident(SubItem)operator(:) ident(Integer)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(ValueListCompare)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item1)operator(,) ident(Item2)operator(:) ident(TListItem)operator(;) ident(Data)operator(:) ident(Integer)operator(;) reserved(var) ident(Compare)operator(:) ident(Integer)operator(\))operator(;) - reserved(procedure) ident(ValueListColumnClick)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Column)operator(:) ident(TListColumn)operator(\))operator(;) - reserved(procedure) ident(DublicateMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CopyDataPreviewMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CopyDataPreview)operator(;) - reserved(procedure) ident(ZeromizeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(function) ident(FindItemByRealName)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) - - reserved(function) ident(FocusItem)operator(()ident(ARealValueName)operator(:) reserved(string)operator(;) - ident(FocusValueList)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) ident(Boolean)operator(;) - reserved(procedure) ident(TakeAsMainValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\))operator(;) - reserved(procedure) ident(ValueListClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CheckValueListHotTrack)operator(;) - reserved(procedure) ident(SelectAllMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(InvertSelectionMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormDestroy)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - directive(private) - ident(ValueLabelClicked)operator(:) ident(Boolean)operator(;) - ident(SortBy)operator(:) ident(TValueListColumn)operator(;) - ident(SortByColumn)operator(:) ident(TListColumn)operator(;) - ident(SubItemIndex)operator(:) reserved(array)operator([)ident(TValueListColumn)operator(]) reserved(of) ident(Integer)operator(;) - directive(public) - ident(ValueNames)operator(:) ident(TStringList)operator(;) - ident(ValuesCommon)operator(:) ident(Boolean)operator(;) - ident(ValueCommonType)operator(:) ident(TRegDataType)operator(;) - reserved(end)operator(;) - -reserved(var) - ident(ValuesWin)operator(:) ident(TValuesWin)operator(;) - ident(ValueList)operator(:) ident(TListView)operator(;) - - ident(DefaultValueCaption)operator(:) reserved(string) operator(=) stringoperator(;) - -reserved(function) ident(ItemIsDefaultValue)operator(()ident(Item)operator(:) ident(TListItem)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(RealValueName)operator(()ident(Item)operator(:) ident(TListItem)operator(\))operator(:) reserved(string)operator(;) -reserved(procedure) ident(SetRealValueName)operator(()ident(Item)operator(:) ident(TListItem)operator(;) ident(Caption)operator(:) reserved(string)operator(\))operator(;) -reserved(function) ident(IconOfDataType)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\))operator(:) ident(Integer)operator(;) -reserved(function) ident(IsMainValue)operator(()ident(Item)operator(:) ident(TListItem)operator(\))operator(:) ident(Boolean)operator(;) - -reserved(function) ident(ColorOfDataType)operator(()ident(DataType)operator(:) ident(TRegDataType)operator(;) - ident(DefaultColor)operator(:) ident(TColor) operator(=) ident(clWhite)operator(\))operator(:) ident(TColor)operator(;) -reserved(function) ident(DataPreviewOfContext)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(ValueDataSize)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(ValueDataType)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(ValueDataPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(ValueTypeIcon)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) ident(Integer)operator(;) - -reserved(function) ident(StrOfRegDataType)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\))operator(:) reserved(string)operator(;) - -reserved(implementation) - -reserved(uses) ident(PlutoMain)operator(,) ident(TreeU)operator(,) ident(WorkU)operator(,) ident(PrefU)operator(;) - -preprocessor({$R *.dfm}) - -reserved(function) ident(ItemIsDefaultValue)operator(()ident(Item)operator(:) ident(TListItem)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Item)operator(.)ident(Data) operator(=) ident(Pointer)operator(()ident(DefaultValueFlag)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(RealValueName)operator(()ident(Item)operator(:) ident(TListItem)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) ident(ItemIsDefaultValue)operator(()ident(Item)operator(\)) reserved(then) - ident(Result) operator(:=) string - reserved(else) - ident(Result) operator(:=) ident(Item)operator(.)ident(Caption)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(SetRealValueName)operator(()ident(Item)operator(:) ident(TListItem)operator(;) ident(Caption)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Caption) operator(=) string reserved(then) reserved(begin) - ident(Item)operator(.)ident(Caption) operator(:=) ident(DefaultValueCaption)operator(;) - ident(Item)operator(.)ident(Data) operator(:=) ident(Pointer)operator(()ident(DefaultValueFlag)operator(\))operator(;) - reserved(end) reserved(else) reserved(begin) - ident(Item)operator(.)ident(Caption) operator(:=) ident(Caption)operator(;) - ident(Item)operator(.)ident(Data) operator(:=) reserved(nil)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(IsMainValue)operator(()ident(Item)operator(:) ident(TListItem)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - reserved(if) ident(csDestroying) reserved(in) ident(PrefWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - ident(Result) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\)) operator(=) ident(PrefWin)operator(.)ident(MainPreviewE)operator(.)ident(Text)operator(;) -reserved(end)operator(;) - -reserved(function) ident(ColorOfDataType)operator(()ident(DataType)operator(:) ident(TRegDataType)operator(;) - ident(DefaultColor)operator(:) ident(TColor) operator(=) ident(clWhite)operator(\))operator(:) ident(TColor)operator(;) -reserved(begin) - reserved(if) ident(DataType) reserved(in) ident(rdStringTypes) reserved(then) ident(Result) operator(:=) ident(clBrightRed) - reserved(else) reserved(if) ident(DataType) operator(=) ident(rdMultiString) reserved(then) ident(Result) operator(:=) ident(clBrightPurple) - reserved(else) reserved(if) ident(DataType) reserved(in) ident(rdCardTypes) reserved(then) ident(Result) operator(:=) ident(clBrightBlue) - reserved(else) reserved(if) ident(DataType) operator(=) ident(rdBinary) reserved(then) ident(Result) operator(:=) ident(clBrightGreen) - reserved(else) ident(Result) operator(:=) ident(DefaultColor)operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrOfRegDataType)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\))operator(:) reserved(string)operator(;) -reserved(const) - ident(RegDataTypeStrings)operator(:) reserved(array)operator([)ident(rdNone)operator(..)ident(rdLastType)operator(]) reserved(of) reserved(string) operator(=) operator(() - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - string - operator(\))operator(;) -reserved(begin) - reserved(if) ident(Typ) reserved(in) operator([)ident(rdNone)operator(..)ident(rdLastType)operator(]) reserved(then) - ident(Result) operator(:=) ident(RegDataTypeStrings)operator([)ident(Typ)operator(]) - reserved(else) - ident(Result) operator(:=) ident(IntToStr)operator(()ident(Typ)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(NewStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CreateValue)operator(()ident(rdString)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(NewDWORDMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CreateValue)operator(()ident(rdCardinal)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(NewBinaryMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CreateValue)operator(()ident(rdBinary)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(CreateValue)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\))operator(;) -reserved(var) - ident(Item)operator(:) ident(TListItem)operator(;) - ident(ValueName)operator(:) reserved(string)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - ident(SL)operator(:) ident(TStringList)operator(;) -reserved(begin) - reserved(if) ident(csDestroying) reserved(in) operator(()ident(TreeWin)operator(.)ident(ComponentState) operator(+) ident(MainWin)operator(.)ident(ComponentState)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(TreeWin)operator(.)ident(CantWrite) reserved(then) - ident(Exit)operator(;) - - reserved(with) ident(MainReg) reserved(do) reserved(begin) - reserved(try) - ident(OpenCurKey)operator(;) - - ident(ValueName) operator(:=) stringoperator(;) comment(// find free name) - ident(i) operator(:=) integer(0)operator(;) - reserved(while) ident(ValueExists)operator(()ident(ValueName)operator(\)) reserved(do) reserved(begin) - ident(Inc)operator(()ident(i)operator(\))operator(;) - ident(ValueName) operator(:=) string operator(+) ident(IntToStr)operator(()ident(i)operator(\))operator(;) - reserved(end)operator(;) - - reserved(case) ident(Typ) reserved(of) - ident(rdString)operator(:) reserved(begin) - ident(WriteString)operator(()ident(ValueName)operator(,) stringoperator(\))operator(;) - reserved(end)operator(;) - ident(rdExpandString)operator(:) reserved(begin) - ident(WriteExpandString)operator(()ident(ValueName)operator(,) stringoperator(\))operator(;) - reserved(end)operator(;) - ident(rdCardinal)operator(:) reserved(begin) - ident(WriteCardinal)operator(()ident(ValueName)operator(,) integer(0)operator(\))operator(;) - reserved(end)operator(;) - ident(rdCardBigEndian)operator(:) reserved(begin) - ident(WriteCardinal)operator(()ident(ValueName)operator(,) integer(0)operator(,) ident(True)operator(\))operator(;) - reserved(end)operator(;) - ident(rdMultiString)operator(:) reserved(begin) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - ident(WriteMultiString)operator(()ident(ValueName)operator(,) ident(SL)operator(\))operator(;) - ident(SL)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - ident(rdBinary)operator(:) reserved(begin) - ident(WriteBin)operator(()ident(ValueName)operator(,) reserved(nil)operator(\))operator(;) - reserved(end)operator(;) - reserved(else) - ident(WriteBinType)operator(()ident(ValueName)operator(,) reserved(nil)operator(,) ident(Typ)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(ValueExists)operator(()ident(ValueName)operator(\)) reserved(then) reserved(begin) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(CloseKey)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(MainReg)operator(,) ident(ValueName)operator(\))operator(;) - reserved(finally) - ident(CloseKey)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - ident(Item) operator(:=) ident(FindItem)operator(()ident(ValueList)operator(,) ident(ValueName)operator(\))operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) reserved(begin) - ident(ShowMessage)operator(()string operator(+) ident(ValueName)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(SelectItemOnly)operator(()ident(ValueList)operator(,) ident(Item)operator(\))operator(;) - ident(MainWin)operator(.)ident(StatusBarUpdate)operator(;) - ident(ValueLabelClicked) operator(:=) ident(True)operator(;) - ident(Item)operator(.)ident(EditCaption)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ValuesU)operator(.)ident(ValueList) operator(:=) ident(ValueList)operator(;) - - ident(DefaultValueCaption) operator(:=) ident(PrefWin)operator(.)ident(DefaultValueNameE)operator(.)ident(Text)operator(;) - ident(ValueLabelClicked) operator(:=) ident(False)operator(;) - ident(SortBy) operator(:=) ident(vlcName)operator(;) - ident(SortByColumn) operator(:=) reserved(nil)operator(;) - - ident(ValueListResize)operator(()ident(Sender)operator(\))operator(;) - ident(ValueList)operator(.)ident(Items)operator(.)ident(Clear)operator(;) - ident(CheckValueListHotTrack)operator(;) - - ident(ValueNames) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - ident(ValuesCommon) operator(:=) ident(False)operator(;) - ident(ValueCommonType) operator(:=) integer(0)operator(;) - - ident(NewDefaultValueMI)operator(.)ident(ImageIndex) operator(:=) ident(iconMainValue)operator(;) - ident(NewStringMI)operator(.)ident(ImageIndex) operator(:=) ident(iconString)operator(;) - ident(NewDWORDMI)operator(.)ident(ImageIndex) operator(:=) ident(iconCardinal)operator(;) - ident(NewBinaryMI)operator(.)ident(ImageIndex) operator(:=) ident(iconBinary)operator(;) - ident(NewMultiStringMI)operator(.)ident(ImageIndex) operator(:=) ident(iconMultiString)operator(;) - ident(NewElseMI)operator(.)ident(ImageIndex) operator(:=) ident(iconValueElse)operator(;) - - ident(DublicateMI)operator(.)ident(ImageIndex) operator(:=) ident(iconValueDublicate)operator(;) - ident(DeleteMI)operator(.)ident(ImageIndex) operator(:=) ident(iconDelete)operator(;) - ident(ZeromizeMI)operator(.)ident(ImageIndex) operator(:=) ident(iconValueZeromize)operator(;) - - ident(EditMI)operator(.)ident(ImageIndex) operator(:=) ident(iconValueEdit)operator(;) - ident(EditBinaryMI)operator(.)ident(ImageIndex) operator(:=) ident(iconValueEditBinary)operator(;) - ident(RenameMI)operator(.)ident(ImageIndex) operator(:=) ident(iconRename)operator(;) - - ident(TakeAsMainValueMI)operator(.)ident(ImageIndex) operator(:=) ident(iconTakeAsMainValue)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ConvertValue)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -comment({var - Allow: Boolean; - OldActive: Integer; }) -reserved(begin) -comment({ TargetPage := ShowPC.Pages[TMenuItem(Sender\).Tag]; - - OldActive := ShowPC.ActivePageIndex; - ShowPC.ActivePageIndex := TMenuItem(Sender\).Tag; - WorkWin.ShowPCChanging(Sender, Allow\); - if not Allow then - ShowPC.ActivePageIndex := OldActive; }) -reserved(end)operator(;) - -reserved(function) ident(ValueDataSize)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(Typ)operator(:) ident(TRegDataType)operator(;) - ident(Size)operator(:) ident(Integer)operator(;) -comment(// ValueName: string;) -comment(// SL: TStringList;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - - reserved(if) ident(csDestroying) reserved(in) ident(PrefWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - -comment(// ValueName := RealValueName(Item\);) - ident(Typ) operator(:=) ident(Context)operator(.)ident(Typ)operator(;) - ident(Size) operator(:=) ident(Length)operator(()ident(Context)operator(.)ident(Data)operator(\))operator(;) - - reserved(if) ident(Typ) reserved(in) ident(rdStringTypes) reserved(then) - reserved(if) reserved(not) ident(PrefWin)operator(.)ident(CountZeroByteCB)operator(.)ident(Checked) reserved(then) - ident(Dec)operator(()ident(Size)operator(\))operator(;) - - reserved(if) ident(Typ) operator(=) ident(rdMultiString) reserved(then) - reserved(if) ident(PrefWin)operator(.)ident(ShowLineCountCB)operator(.)ident(Checked) reserved(then) reserved(begin) - ident(Size) operator(:=) ident(CharCount)operator(()ident(StrOfByteA)operator(()ident(Context)operator(.)ident(Data)operator(\))operator(,) char(#0)operator(\)) operator(-) integer(2)operator(;) -comment({ SL := TStringList.Create; - try - Reg.ReadMultiString(ValueName, SL, PrefWin.UseExtendedModelCB.Checked\); - Size := SL.Count; - finally - SL.Free; - end; }) - ident(Result) operator(:=) charoperator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) ident(Result) operator(+) ident(IntToStr)operator(()ident(Size)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(ValueDataType)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(StrOfRegDataType)operator(()ident(Context)operator(.)ident(Typ)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(DataPreviewOfContext)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) - - reserved(function) ident(DWORDPreview)operator(()ident(Value)operator(:) ident(Integer)operator(\))operator(:) reserved(string)operator(;) - reserved(begin) - reserved(if) ident(PrefWin)operator(.)ident(ShowDwordAsHex)operator(.)ident(Checked) reserved(then) - ident(Result) operator(:=) ident(IntToStr)operator(()ident(Value)operator(\)) operator(+) string operator(+) ident(IntToHex)operator(()ident(Value)operator(,) integer(8)operator(\)) - reserved(else) - ident(Result) operator(:=) ident(IntToStr)operator(()ident(Value)operator(\)) - reserved(end)operator(;) - - reserved(function) ident(BinaryPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) - reserved(var) - ident(z)operator(:) reserved(string)operator(;) - - reserved(function) ident(DWORDStringOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(AddBinary)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) reserved(string)operator(;) - reserved(var) - ident(piece)operator(:) ident(TByteA)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - reserved(begin) - ident(Result) operator(:=) stringoperator(;) - - ident(i) operator(:=) integer(0)operator(;) - reserved(while) operator(()ident(i) operator(<=) ident(High)operator(()ident(a)operator(\))operator(\)) reserved(and) operator(()ident(Length)operator(()ident(Result)operator(\)) operator(<) ident(MaxPreviewLen)operator(\)) reserved(do) reserved(begin) - ident(piece) operator(:=) ident(Copy)operator(()ident(a)operator(,) ident(i)operator(,) integer(4)operator(\))operator(;) - reserved(if) ident(AddBinary) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(FriendlyStr)operator(()ident(piece)operator(\)) operator(+) charoperator(;) - ident(SetLength)operator(()ident(piece)operator(,) integer(4)operator(\))operator(;) - ident(Result) operator(:=) ident(Result) operator(+) ident(IntToStr)operator(()ident(PInteger)operator(()ident(piece)operator(\))operator(^)operator(\)) operator(+) stringoperator(;) - ident(Inc)operator(()ident(i)operator(,) ident(SizeOf)operator(()ident(Integer)operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(begin) - reserved(with) ident(Context) reserved(do) reserved(begin) - ident(Data) operator(:=) ident(Copy)operator(()ident(Data)operator(,) integer(0)operator(,) ident(MaxPreviewLen)operator(\))operator(;) - reserved(case) ident(PrefWin)operator(.)ident(ShowBinaryAsRG)operator(.)ident(ItemIndex) reserved(of) - integer(0)operator(:) ident(z) operator(:=) ident(FriendlyStr)operator(()ident(Data)operator(\))operator(;) - integer(1)operator(:) ident(z) operator(:=) ident(DWORDStringOfByteA)operator(()ident(Data)operator(\))operator(;) - integer(2)operator(:) ident(z) operator(:=) ident(DWORDStringOfByteA)operator(()ident(Data)operator(,) ident(True)operator(\))operator(;) - integer(3)operator(:) ident(z) operator(:=) ident(BinOfByteA)operator(()ident(Data)operator(,) integer(8)operator(,) stringoperator(\))operator(;) - integer(4)operator(:) ident(z) operator(:=) ident(HexOfByteA)operator(()ident(Data)operator(,) integer(0)operator(\))operator(;) - integer(5)operator(:) ident(z) operator(:=) ident(HexOfByteA)operator(()ident(Data)operator(,) integer(1)operator(\))operator(;) - integer(6)operator(:) ident(z) operator(:=) ident(HexOfByteA)operator(()ident(Data)operator(,) integer(2)operator(\))operator(;) - integer(7)operator(:) ident(z) operator(:=) ident(HexOfByteA)operator(()ident(Data)operator(,) integer(4)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) ident(Copy)operator(()ident(z)operator(,) integer(1)operator(,) ident(MaxPreviewLen)operator(\))operator(;) - reserved(end)operator(;) - - reserved(function) ident(StringPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) - reserved(var) - ident(s)operator(:) reserved(string)operator(;) - ident(Expanded)operator(:) reserved(string)operator(;) - ident(DoExpand)operator(:) ident(Boolean)operator(;) - reserved(begin) - ident(s) operator(:=) ident(PChar)operator(()ident(Context)operator(.)ident(Data)operator(\))operator(;) - reserved(with) ident(PrefWin) reserved(do) - ident(Result) operator(:=) ident(StringQuoterBegin) operator(+) ident(FriendlyStr)operator(()ident(s)operator(\)) operator(+) ident(StringQuoterEnd)operator(;) - reserved(if) ident(s) operator(=) string reserved(then) - ident(Exit)operator(;) - - reserved(case) ident(PrefWin)operator(.)ident(ExpandStringsRG)operator(.)ident(ItemIndex) reserved(of) - integer(0)operator(:) ident(DoExpand) operator(:=) ident(False)operator(;) - integer(1)operator(:) ident(DoExpand) operator(:=) operator(()ident(Context)operator(.)ident(Typ) operator(=) ident(rdExpandString)operator(\)) reserved(and) operator(()ident(CharCount)operator(()ident(s)operator(,) charoperator(\)) operator(>=) integer(2)operator(\))operator(;) - integer(2)operator(:) ident(DoExpand) operator(:=) ident(True)operator(;) - reserved(else) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(PrefWin)operator(.)ident(ExpandStringsRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) - ident(Exit)operator(;) - reserved(end)operator(;) - - reserved(if) ident(DoExpand) reserved(then) reserved(begin) - ident(Expanded) operator(:=) ident(ExpandString)operator(()ident(s)operator(\))operator(;) - reserved(if) ident(s) operator(<>) ident(Expanded) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) string operator(+) ident(Expanded) operator(+) char)delimiter(')>operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(function) ident(IntegerPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) - reserved(begin) - reserved(if) ident(Length)operator(()ident(Context)operator(.)ident(Data)operator(\)) operator(>=) ident(SizeOf)operator(()ident(Cardinal)operator(\)) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(DWORDPreview)operator(()ident(PInteger)operator(()ident(Context)operator(.)ident(Data)operator(\))operator(^)operator(\))operator(;) - reserved(end) reserved(else) - ident(Result) operator(:=) ident(BinaryPreview)operator(()ident(Context)operator(\))operator(;) - reserved(end)operator(;) - - reserved(function) ident(MultiStringPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) - reserved(var) - ident(z)operator(:) reserved(string)operator(;) - ident(SL)operator(:) ident(TStringList)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - reserved(begin) - ident(z) operator(:=) stringoperator(;) - - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - reserved(try) - ident(RegMultiStringOfByteA)operator(()ident(Context)operator(.)ident(Data)operator(,) ident(SL)operator(,) ident(PrefWin)operator(.)ident(UseExtendedModelCB)operator(.)ident(Checked)operator(\))operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) - ident(z) operator(:=) ident(z) operator(+) ident(SL)operator([)ident(i)operator(]) operator(+) stringoperator(;) - reserved(finally) - ident(SL)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) ident(Copy)operator(()ident(FriendlyStr)operator(()ident(z)operator(\))operator(,) integer(1)operator(,) ident(MaxPreviewLen)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - - reserved(if) ident(csDestroying) reserved(in) ident(PrefWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - reserved(if) operator(()ident(Context)operator(.)ident(Data) operator(=) reserved(nil)operator(\)) reserved(or) operator(()ident(Length)operator(()ident(Context)operator(.)ident(Data)operator(\)) operator(>) ident(RegMaxDataSize)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(Length)operator(()ident(Context)operator(.)ident(Data)operator(\)) operator(>) ident(MaxPreviewLen) reserved(then) - ident(SetLength)operator(()ident(Context)operator(.)ident(Data)operator(,) ident(MaxPreviewLen)operator(\))operator(;) - - reserved(if) ident(PrefWin)operator(.)ident(ShowAsBinaryCB)operator(.)ident(Checked) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(BinaryPreview)operator(()ident(Context)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(case) ident(Context)operator(.)ident(Typ) reserved(of) - ident(rdExpandString)operator(,) ident(rdString)operator(:) ident(Result) operator(:=) ident(StringPreview)operator(()ident(Context)operator(\))operator(;) - ident(rdCardinal)operator(,) ident(rdCardBigEndian)operator(:) ident(Result) operator(:=) ident(IntegerPreview)operator(()ident(Context)operator(\))operator(;) - ident(rdMultiString)operator(:) ident(Result) operator(:=) ident(MultiStringPreview)operator(()ident(Context)operator(\))operator(;) - reserved(else) - reserved(if) ident(PrefWin)operator(.)ident(Smart4BBCB)operator(.)ident(Checked) reserved(and) operator(()ident(Length)operator(()ident(Context)operator(.)ident(Data)operator(\)) operator(=) integer(4)operator(\)) reserved(then) - ident(Result) operator(:=) ident(IntegerPreview)operator(()ident(Context)operator(\)) - reserved(else) - ident(Result) operator(:=) ident(BinaryPreview)operator(()ident(Context)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(ValueDataPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(DataPreviewOfContext)operator(()ident(Context)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(IconOfDataType)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(Typ) reserved(in) operator([)ident(rdNone)operator(..)ident(rdLastType)operator(]) reserved(then) - ident(Result) operator(:=) ident(iconFirstType) operator(+) ident(Ord)operator(()ident(Typ)operator(\)) - reserved(else) - ident(Result) operator(:=) ident(iconUnknownType)operator(;) -reserved(end)operator(;) - -reserved(function) ident(ValueTypeIcon)operator(()ident(Context)operator(:) ident(TRegContext)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(IconOfDataType)operator(()ident(Context)operator(.)ident(Typ)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(TValuesWin)operator(.)ident(UpdateValue)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Item)operator(:) ident(TListItem)operator(\))operator(:) ident(Boolean)operator(;) -comment(//Return Value: True if something has changed) -reserved(var) - ident(Size)operator(,) ident(Typ)operator(,) ident(Data)operator(:) reserved(string)operator(;) - ident(Icon)operator(:) ident(Integer)operator(;) - ident(Context)operator(:) ident(TRegContext)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Context) operator(:=) ident(Reg)operator(.)ident(ReadContext)operator(()ident(RealValueName)operator(()ident(Item)operator(\))operator(\))operator(;) - ident(Data) operator(:=) ident(ValueDataPreview)operator(()ident(Context)operator(\))operator(;) - ident(Size) operator(:=) ident(ValueDataSize)operator(()ident(Context)operator(\))operator(;) - ident(Typ) operator(:=) ident(ValueDataType)operator(()ident(Context)operator(\))operator(;) - ident(Icon) operator(:=) ident(ValueTypeIcon)operator(()ident(Context)operator(\))operator(;) - - reserved(if) ident(Icon) operator(<>) ident(Item)operator(.)ident(ImageIndex) reserved(then) reserved(begin) - ident(Item)operator(.)ident(ImageIndex) operator(:=) ident(Icon)operator(;) - ident(Result) operator(:=) ident(True)operator(;) - reserved(end)operator(;) - - reserved(while) ident(Item)operator(.)ident(SubItems)operator(.)ident(Count) operator(<) ident(Integer)operator(()ident(High)operator(()ident(TValueListColumn)operator(\))operator(\)) reserved(do) - ident(Item)operator(.)ident(SubItems)operator(.)ident(Add)operator(()stringoperator(\))operator(;) - - reserved(if) ident(Size) operator(<>) ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcSize)operator(])operator(]) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(True)operator(;) - ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcSize)operator(])operator(]) operator(:=) ident(Size)operator(;) - reserved(end)operator(;) - - reserved(if) ident(Typ) operator(<>) ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcType)operator(])operator(]) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(True)operator(;) - ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcType)operator(])operator(]) operator(:=) ident(Typ)operator(;) - reserved(end)operator(;) - - reserved(if) operator(()ident(Data) operator(<>) ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcData)operator(])operator(])operator(\)) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(True)operator(;) - ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcData)operator(])operator(]) operator(:=) ident(Data)operator(;) - reserved(if) ident(IsMainValue)operator(()ident(Item)operator(\)) reserved(then) - ident(RegTV)operator(.)ident(Repaint)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(AppendNewValueInfos)operator(()ident(Item)operator(:) ident(TListItem)operator(;) ident(Context)operator(:) ident(TRegContext)operator(\))operator(;) -reserved(begin) - ident(Item)operator(.)ident(ImageIndex) operator(:=) ident(ValueTypeIcon)operator(()ident(Context)operator(\))operator(;) - reserved(with) ident(Item)operator(.)ident(SubItems) reserved(do) reserved(begin) - ident(Append)operator(()ident(ValueDataSize)operator(()ident(Context)operator(\))operator(\))operator(;) - ident(Append)operator(()ident(ValueDataType)operator(()ident(Context)operator(\))operator(\))operator(;) - ident(Append)operator(()ident(ValueDataPreview)operator(()ident(Context)operator(\))operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TValuesWin)operator(.)ident(AddValue)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) - ident(AppendInfos)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(:) ident(TListItem)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(ValueList)operator(.)ident(Items)operator(.)ident(AddItem)operator(()reserved(nil)operator(,) operator(-)integer(1)operator(\))operator(;) - ident(Result)operator(.)ident(Indent) operator(:=) operator(-)integer(1)operator(;) - ident(SetRealValueName)operator(()ident(Result)operator(,) ident(ValueName)operator(\))operator(;) - reserved(if) ident(AppendInfos) reserved(then) - ident(AppendNewValueInfos)operator(()ident(Result)operator(,) ident(Reg)operator(.)ident(ReadContext)operator(()ident(ValueName)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListChange)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) - ident(Change)operator(:) ident(TItemChange)operator(\))operator(;) -reserved(var) - ident(ValueName)operator(:) reserved(string)operator(;) - ident(Reg)operator(:) ident(TXRegistry)operator(;) - - reserved(function) ident(ComputeValuesCommon)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(var) ident(DataType)operator(:) ident(TRegDataType)operator(\))operator(:) ident(Boolean)operator(;) - reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(ItemType)operator(:) ident(TRegDataType)operator(;) - reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - - ident(i) operator(:=) integer(0)operator(;) - ident(DataType) operator(:=) integer(0)operator(;) - reserved(while) ident(i) operator(<) ident(ValueList)operator(.)ident(Items)operator(.)ident(Count) reserved(do) reserved(begin) - ident(Item) operator(:=) ident(ValueList)operator(.)ident(Items)operator([)ident(i)operator(])operator(;) - reserved(if) reserved(not) ident(Item)operator(.)ident(Selected) reserved(then) reserved(begin) - ident(Inc)operator(()ident(i)operator(\))operator(;) - ident(Continue)operator(;) reserved(end)operator(;) - - ident(ValueName) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\))operator(;) - reserved(if) ident(Reg)operator(.)ident(ValueReallyExists)operator(()ident(ValueName)operator(\)) reserved(then) reserved(begin) - - ident(ItemType) operator(:=) ident(Reg)operator(.)ident(GetDataType)operator(()ident(ValueName)operator(\))operator(;) - reserved(if) reserved(not) ident(Result) reserved(then) reserved(begin) - ident(DataType) operator(:=) ident(ItemType)operator(;) - ident(Result) operator(:=) ident(True)operator(;) - reserved(end) reserved(else) reserved(if) ident(ItemType) operator(<>) ident(DataType) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - ident(DataType) operator(:=) integer(0)operator(;) - ident(Break)operator(;) reserved(end)operator(;) - - reserved(with) ident(ValueNames) reserved(do) - reserved(if) ident(Item)operator(.)ident(Focused) reserved(then) - ident(Insert)operator(()integer(0)operator(,) ident(ValueName)operator(\)) - reserved(else) - ident(Add)operator(()ident(ValueName)operator(\))operator(;) - - reserved(end) reserved(else) reserved(begin) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(DataType) operator(:=) integer(0)operator(;) - ident(Result) operator(:=) ident(False)operator(;) - ident(Reload)operator(;) - ident(Break)operator(;) reserved(end)operator(;) - - ident(Inc)operator(()ident(i)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Item)operator(\)) reserved(or) ident(ValueList)operator(.)ident(IsEditing) reserved(or) reserved(not) ident(ValueList)operator(.)ident(Enabled) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(Change) operator(<>) ident(ctState) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(csDestroying) reserved(in) ident(WorkWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - reserved(if) operator(()ident(ValueList)operator(.)ident(SelCount) operator(=) integer(0)operator(\)) reserved(then) reserved(begin) - ident(ValueNames)operator(.)ident(Clear)operator(;) - ident(WorkWin)operator(.)ident(ReInitShowPC)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(if) reserved(not) ident(Item)operator(.)ident(Focused) reserved(then) - ident(Exit)operator(;) - - ident(WorkWin)operator(.)ident(ReInitShowPC)operator(;) - - ident(ValueNames)operator(.)ident(Clear)operator(;) - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - reserved(if) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\)) reserved(then) reserved(begin) - ident(ValuesCommon) operator(:=) ident(ComputeValuesCommon)operator(()ident(Reg)operator(,) ident(ValueCommonType)operator(\))operator(;) - reserved(if) ident(ValuesCommon) reserved(then) - ident(WorkWin)operator(.)ident(ShowValues)operator(()ident(Reg)operator(\))operator(;) - reserved(end)operator(;) - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - - reserved(if) ident(csDestroying) reserved(in) ident(MainWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(ActiveControl) operator(=) ident(ValueList) reserved(then) - ident(MainWin)operator(.)ident(SetStatus)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomListView)operator(;) - ident(Item)operator(:) ident(TListItem)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\))operator(;) -reserved(begin) - reserved(with) ident(ValueList)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) - reserved(if) ident(Item)operator(.)ident(Focused) reserved(then) - ident(Style) operator(:=) ident(Style) operator(+) operator([)ident(fsBold)operator(])operator(;) - reserved(if) ident(ItemIsDefaultValue)operator(()ident(Item)operator(\)) reserved(then) - ident(Color) operator(:=) ident(clBrightYellow) - reserved(else) - ident(Color) operator(:=) ident(ColorOfDataType)operator(()ident(TRegDataType)operator(()ident(Item)operator(.)ident(ImageIndex) operator(-) ident(iconFirstType)operator(\))operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ValueListChange)operator(()ident(Sender)operator(,) ident(ValueList)operator(.)ident(ItemFocused)operator(,) ident(ctState)operator(\))operator(;) - ident(MainPC)operator(.)ident(ActivePage) operator(:=) ident(WorkWin)operator(.)ident(WorkPage)operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(csDestroying) reserved(in) ident(WorkWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - ident(WorkWin)operator(.)ident(EditData)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListEditing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) - reserved(var) ident(AllowEdit)operator(:) ident(Boolean)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(ValueLabelClicked) reserved(then) reserved(begin) - ident(AllowEdit) operator(:=) ident(False)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(if) ident(ItemIsDefaultValue)operator(()ident(Item)operator(\)) reserved(then) comment(//unschön, aber beste Lösung bisher) - ident(Keyboard)operator(.)ident(SimKey)operator(()ident(VK_DELETE)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListEdited)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) - reserved(var) ident(S)operator(:) reserved(string)operator(\))operator(;) -reserved(var) - ident(Old)operator(:) reserved(string)operator(;) - ident(OldCaption)operator(:) reserved(string)operator(;) -reserved(begin) - ident(OldCaption) operator(:=) ident(Item)operator(.)ident(Caption)operator(;) - ident(Old) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\))operator(;) - - reserved(if) ident(s) operator(=) ident(Old) reserved(then) reserved(begin) - reserved(if) ident(ItemIsDefaultValue)operator(()ident(Item)operator(\)) reserved(then) - ident(s) operator(:=) ident(DefaultValueCaption)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(SpyThread)operator(.)ident(Suspend)operator(;) - reserved(try) - ident(Item)operator(.)ident(Caption) operator(:=) ident(s)operator(;) - - reserved(if) ident(TryRenameValue)operator(()ident(Old)operator(,) ident(s)operator(\)) reserved(then) reserved(begin) - ident(SetRealValueName)operator(()ident(Item)operator(,) ident(s)operator(\))operator(;) comment(//Sichere Zuweisung des Standard-Flags) - ident(s) operator(:=) ident(Item)operator(.)ident(Caption)operator(;) comment(//Anschließend externer Aufruf "Item.Caption := s"!) - reserved(end) reserved(else) reserved(begin) - ident(s) operator(:=) ident(OldCaption)operator(;) - reserved(end)operator(;) - - reserved(finally) - ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) - ident(SpyThread)operator(.)ident(Resume)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(var) - ident(T)operator(:) reserved(string)operator(;) - ident(Item)operator(:) ident(TListItem)operator(;) -reserved(begin) - reserved(if) ident(ValueList)operator(.)ident(IsEditing) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(csDestroying) reserved(in) ident(TreeWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - ident(Item) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) - - reserved(case) ident(Key) reserved(of) - ident(VK_SPACE)operator(:) ident(JumpToSel)operator(()ident(ValueList)operator(\))operator(;) - - ident(VK_F9)operator(:) ident(SwapFonts)operator(()ident(ValueList)operator(\))operator(;) - - ident(VK_F5)operator(:) ident(Reload)operator(;) - - ident(VK_F12)operator(:) reserved(begin) comment(//Sort) - reserved(if) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) - ident(T) operator(:=) ident(Item)operator(.)ident(Caption)operator(;) - ident(ValueList)operator(.)ident(SortType) operator(:=) ident(TSortType)operator(()integer(2) operator(-) operator(()ident(Integer)operator(()ident(ValueList)operator(.)ident(SortType)operator(\))operator(\))operator(\))operator(;) - reserved(if) ident(ValueList)operator(.)ident(SortType) operator(=) ident(stNone) reserved(then) - ident(TreeWin)operator(.)ident(RegTVChange)operator(()ident(Sender)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\))operator(;) - ident(ValueList)operator(.)ident(ItemFocused) operator(:=) ident(FindItem)operator(()ident(ValueList)operator(,) ident(T)operator(\))operator(;) - reserved(if) ident(Assigned)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\)) reserved(then) - ident(ValueList)operator(.)ident(ItemFocused)operator(.)ident(MakeVisible)operator(()ident(True)operator(\))operator(;) - reserved(end)operator(;) - - ident(VK_DELETE)operator(:) ident(DeleteMIClick)operator(()ident(Sender)operator(\))operator(;) - - ident(VK_RETURN)operator(:) ident(ValueListDblCLick)operator(()ident(Sender)operator(\))operator(;) - - ident(Ord)operator(()charoperator(\))operator(:) - reserved(if) reserved(not) ident(ValueList)operator(.)ident(IsEditing) reserved(then) - ident(CopyPathMIClick)operator(()ident(Sender)operator(\))operator(;) - - ident(VK_SCROLL)operator(:) ident(CheckValueListHotTrack)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(ValueList) reserved(do) - ident(Columns)operator([)integer(3)operator(])operator(.)ident(Width) operator(:=) ident(ClientWidth) operator(-) operator(()integer(0) operator(+) - ident(Columns)operator([)integer(0)operator(])operator(.)ident(Width) operator(+) ident(Columns)operator([)integer(1)operator(])operator(.)ident(Width) operator(+) ident(Columns)operator([)integer(2)operator(])operator(.)ident(Width)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(DeleteValue)operator(;) -reserved(var) - ident(Item)operator(,) ident(NewSel)operator(:) ident(TListItem)operator(;) - ident(YesToAll)operator(:) ident(Boolean)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(DeleteIt)operator(()ident(Item)operator(:) ident(TListItem)operator(\))operator(;) - reserved(begin) - ident(OpenCurKey)operator(;) - reserved(if) ident(MainReg)operator(.)ident(DeleteValue)operator(()ident(RealValueName)operator(()ident(Item)operator(\))operator(\)) - reserved(and) reserved(not) ident(MainReg)operator(.)ident(ValueReallyExists)operator(()ident(RealValueName)operator(()ident(Item)operator(\))operator(\)) reserved(then) reserved(begin) - ident(Item)operator(.)ident(Delete)operator(;) - reserved(end) reserved(else) reserved(begin) - ident(ShowMessage)operator(()string operator(+) ident(Quote)operator(()ident(RealValueName)operator(()ident(Item)operator(\))operator(\))operator(\))operator(;) - ident(Inc)operator(()ident(i)operator(\))operator(;) - reserved(end)operator(;) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - - reserved(if) ident(IsMainValue)operator(()ident(Item)operator(\)) reserved(then) - ident(RegTV)operator(.)ident(Repaint)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(SpyThread)operator(.)ident(Suspend)operator(;) - - ident(NewSel) operator(:=) ident(GetNextBestNotSelected)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\))operator(;) - - ident(YesToAll) operator(:=) ident(False)operator(;) - ident(i) operator(:=) integer(0)operator(;) - reserved(while) ident(i) operator(<) ident(ValueList)operator(.)ident(Items)operator(.)ident(Count) reserved(do) reserved(begin) - ident(Item) operator(:=) ident(ValueList)operator(.)ident(Items)operator([)ident(i)operator(])operator(;) - reserved(if) reserved(not) ident(Item)operator(.)ident(Selected) reserved(then) reserved(begin) - ident(Inc)operator(()ident(i)operator(\))operator(;) - ident(Continue)operator(;) reserved(end)operator(;) - - reserved(if) ident(YesToAll) reserved(then) - ident(DeleteIt)operator(()ident(Item)operator(\)) - reserved(else) reserved(begin) - reserved(case) ident(MessageDlg)operator(()string operator(+) - ident(Quote)operator(()ident(RealValueName)operator(()ident(Item)operator(\))operator(\)) operator(+) charoperator(,) - ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbYesToAll)operator(,) ident(mbNo)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) reserved(of) - ident(mrYes)operator(:) ident(DeleteIt)operator(()ident(Item)operator(\))operator(;) - ident(mrYesToAll)operator(:) ident(YesToAll) operator(:=) ident(True)operator(;) - ident(mrCancel)operator(:) ident(Exit)operator(;) - ident(mrNo)operator(:) reserved(begin) - ident(Item)operator(.)ident(Selected) operator(:=) ident(False)operator(;) - ident(NewSel) operator(:=) ident(Item)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) ident(Assigned)operator(()ident(NewSel)operator(\)) reserved(then) reserved(begin) - ident(ValueList)operator(.)ident(ItemFocused) operator(:=) ident(NewSel)operator(;) - ident(NewSel)operator(.)ident(Selected) operator(:=) ident(True)operator(;) - reserved(end) reserved(else) - ident(WorkWin)operator(.)ident(ReInitShowPC)operator(;) - - ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) - ident(SpyThread)operator(.)ident(Resume)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ZeromizeValue)operator(;) -reserved(var) - ident(Item)operator(:) ident(TListItem)operator(;) - ident(YesToAll)operator(:) ident(Boolean)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(ZeromizeIt)operator(()ident(Item)operator(:) ident(TListItem)operator(\))operator(;) - reserved(begin) - reserved(with) ident(MainReg) reserved(do) reserved(begin) - ident(OpenCurKey)operator(;) - ident(ZeromizeValue)operator(()ident(RealValueName)operator(()ident(Item)operator(\))operator(\))operator(;) - ident(UpdateValue)operator(()ident(MainReg)operator(,) ident(Item)operator(\))operator(;) - ident(CloseKey)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(SpyThread)operator(.)ident(Suspend)operator(;) - - ident(YesToAll) operator(:=) ident(False)operator(;) - ident(i) operator(:=) integer(0)operator(;) - reserved(while) ident(i) operator(<) ident(ValueList)operator(.)ident(Items)operator(.)ident(Count) reserved(do) reserved(begin) - ident(Item) operator(:=) ident(ValueList)operator(.)ident(Items)operator([)ident(i)operator(])operator(;) - reserved(if) reserved(not) ident(Item)operator(.)ident(Selected) reserved(then) reserved(begin) - ident(Inc)operator(()ident(i)operator(\))operator(;) - ident(Continue)operator(;) reserved(end)operator(;) - - reserved(if) ident(YesToAll) reserved(then) - ident(ZeromizeIt)operator(()ident(Item)operator(\)) - reserved(else) - reserved(case) ident(MessageDlg)operator(()string operator(+) - ident(Quote)operator(()ident(RealValueName)operator(()ident(Item)operator(\))operator(\)) operator(+) stringoperator(,) - ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbYesToAll)operator(,) ident(mbNo)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) reserved(of) - - ident(mrYes)operator(:) reserved(begin) - ident(ZeromizeIt)operator(()ident(Item)operator(\))operator(;) - ident(Inc)operator(()ident(i)operator(\))operator(;) - reserved(end)operator(;) - - ident(mrYesToAll)operator(:) reserved(begin) - ident(YesToAll) operator(:=) ident(True)operator(;) - ident(ZeromizeIt)operator(()ident(Item)operator(\))operator(;) - reserved(end)operator(;) - ident(mrCancel)operator(:) ident(Exit)operator(;) - reserved(end)operator(;) - - reserved(if) ident(IsMainValue)operator(()ident(Item)operator(\)) reserved(then) - ident(RegTV)operator(.)ident(Repaint)operator(;) - reserved(end)operator(;) - - - ident(SpyThread)operator(.)ident(Resume)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Writable)operator(,) ident(ValueOK)operator(,) ident(OnlyOneValue)operator(,) ident(OneValueOK)operator(:) ident(Boolean)operator(;) - ident(Item)operator(:) ident(TListItem)operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\)) reserved(then) - ident(ValueList)operator(.)ident(ItemFocused)operator(.)ident(Selected) operator(:=) ident(True)operator(;) - - reserved(if) ident(csDestroying) reserved(in) operator(()ident(TreeWin)operator(.)ident(ComponentState) operator(+) ident(PrefWin)operator(.)ident(ComponentState)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Writable) operator(:=) reserved(not) ident(TreeWin)operator(.)ident(CantWrite)operator(;) - ident(NewDefaultValueMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) - ident(NewStringMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) - ident(NewDWORDMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) - ident(NewBinaryMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) - ident(NewMultiStringMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) - ident(NewElseMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) - - ident(ValueOK) operator(:=) ident(Writable) reserved(and) operator(()ident(ValueList)operator(.)ident(ItemFocused) operator(<>) reserved(nil)operator(\))operator(;) - ident(OnlyOneValue) operator(:=) ident(ValueList)operator(.)ident(SelCount) operator(=) integer(1)operator(;) - ident(OneValueOK) operator(:=) ident(OnlyOneValue) reserved(and) ident(ValueOK)operator(;) - - ident(EditMI)operator(.)ident(Visible) operator(:=) ident(ValueOK)operator(;) - ident(EditBinaryMI)operator(.)ident(Visible) operator(:=) ident(ValueOK)operator(;) - ident(DublicateMI)operator(.)ident(Visible) operator(:=) ident(OneValueOK)operator(;) - ident(CopyPathMI)operator(.)ident(Visible) operator(:=) ident(OnlyOneValue)operator(;) - ident(CopyDataPreviewMI)operator(.)ident(Visible) operator(:=) ident(OnlyOneValue)operator(;) - ident(TakeAsMainValueMI)operator(.)ident(Visible) operator(:=) ident(OnlyOneValue)operator(;) - ident(RenameMI)operator(.)ident(Visible) operator(:=) ident(OneValueOK)operator(;) - ident(DeleteMI)operator(.)ident(Visible) operator(:=) ident(ValueOK)operator(;) - ident(ZeromizeMI)operator(.)ident(Visible) operator(:=) ident(ValueOK)operator(;) - - ident(Item) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(TakeAsMainValueMI)operator(.)ident(Checked) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\)) operator(=) ident(PrefWin)operator(.)ident(MainPreviewE)operator(.)ident(Text)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) ident(ValueList)operator(.)ident(IsEditing) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(csDestroying) reserved(in) ident(MainWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - ident(MainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(,) ident(Key)operator(,) ident(Shift)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListDeletion)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(SpyThread)operator(\)) reserved(then) - ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) - - reserved(if) ident(csDestroying) reserved(in) ident(WorkWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(Assigned)operator(()ident(ShowPC)operator(.)ident(ActivePage)operator(\)) - reserved(and) ident(Item)operator(.)ident(Selected) reserved(and) ident(Item)operator(.)ident(Focused) reserved(then) reserved(begin) - ident(ValueList)operator(.)ident(ItemFocused) operator(:=) ident(GetNextBest)operator(()ident(Item)operator(\))operator(;) - ident(WorkWin)operator(.)ident(ReInitShowPC)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(DeleteMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(ValueList)operator(.)ident(IsEditing) reserved(then) - ident(Exit)operator(;) - - ident(DeleteValue)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(RenameMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\)) reserved(then) reserved(begin) - ident(ValueLabelClicked) operator(:=) ident(True)operator(;) - ident(ValueList)operator(.)ident(ItemFocused)operator(.)ident(EditCaption)operator(;) - ident(ValueLabelClicked) operator(:=) ident(False)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(NewBigEndianMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CreateValue)operator(()ident(rdCardBigEndian)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(NewExpandStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CreateValue)operator(()ident(rdExpandString)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(NewMultiStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CreateValue)operator(()ident(rdMultiString)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(NewStrangeTypeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CreateValue)operator(()ident(TRegDataType)operator(()ident(TMenuItem)operator(()ident(Sender)operator(\))operator(.)ident(Tag)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(NewDefaultValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(DefaultItem)operator(:) ident(TListItem)operator(;) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(csDestroying) reserved(in) operator(()ident(TreeWin)operator(.)ident(ComponentState) operator(+) ident(MainWin)operator(.)ident(ComponentState)operator(\)) reserved(then) - ident(Exit)operator(;) - reserved(if) ident(TreeWin)operator(.)ident(CantWrite) reserved(then) - ident(Exit)operator(;) - - reserved(with) ident(MainReg) reserved(do) reserved(begin) - reserved(try) - ident(OpenCurKey)operator(;) - - reserved(if) ident(StandardValueExists) reserved(then) reserved(begin) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(CloseKey)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(WriteString)operator(()stringoperator(,) stringoperator(\))operator(;) - - reserved(if) reserved(not) ident(StandardValueExists) reserved(then) reserved(begin) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(CloseKey)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(MainReg)operator(,) stringoperator(\))operator(;) - reserved(finally) - ident(CloseKey)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) reserved(begin) - ident(DefaultItem) operator(:=) reserved(nil)operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) - reserved(if) ident(ItemIsDefaultValue)operator(()ident(Item)operator([)ident(i)operator(])operator(\)) reserved(then) - ident(Break)operator(;) - - reserved(if) ident(i) operator(<) ident(Count) reserved(then) - ident(DefaultItem) operator(:=) ident(Item)operator([)ident(i)operator(])operator(;) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(DefaultItem)operator(\)) reserved(then) - ident(ShowMessage)operator(()stringoperator(\)) - reserved(else) reserved(begin) - ident(SelectItemOnly)operator(()ident(ValueList)operator(,) ident(DefaultItem)operator(\))operator(;) - ident(MainWin)operator(.)ident(StatusBarUpdate)operator(;) - ident(ValueListDblClick)operator(()ident(Sender)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) - ident(Change)operator(:) ident(TItemChange)operator(;) reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Item) operator(=) reserved(nil) reserved(then) - ident(AllowChange) operator(:=) ident(False)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) -reserved(begin) - ident(ValueLabelClicked) operator(:=) ident(False)operator(;) - reserved(with) ident(ValueList) reserved(do) - reserved(if) operator(()operator([)ident(htOnIcon)operator(,) ident(htOnLabel)operator(]) operator(*) ident(GetHitTestInfoAt)operator(()ident(X)operator(,) ident(Y)operator(\))operator(\)) operator(<>) operator([)operator(]) reserved(then) - ident(ValueLabelClicked) operator(:=) ident(True)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(EditBinaryMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(csDestroying) reserved(in) ident(WorkWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - ident(WorkWin)operator(.)ident(ShowAsBinary) operator(:=) ident(True)operator(;) - ident(ValueListChange)operator(()ident(Sender)operator(,) ident(ValueList)operator(.)ident(ItemFocused)operator(,) ident(ctState)operator(\))operator(;) - ident(ValueListDblClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(EditMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ValueListDblClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListCustomDrawSubItem)operator(()ident(Sender)operator(:) ident(TCustomListView)operator(;) - ident(Item)operator(:) ident(TListItem)operator(;) ident(SubItem)operator(:) ident(Integer)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) - reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\))operator(;) -reserved(begin) - reserved(with) ident(ValueList)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) - ident(Style) operator(:=) operator([)operator(])operator(;) - reserved(if) ident(SubItem) operator(=) integer(1) reserved(then) - ident(Color) operator(:=) ident(clSilver) - reserved(else) - ident(Color) operator(:=) ident(ColorOfDataType)operator(()ident(TRegDataType)operator(()ident(Item)operator(.)ident(ImageIndex) operator(-) ident(iconFirstType)operator(\))operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListCompare)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item1)operator(,) ident(Item2)operator(:) ident(TListItem)operator(;) - ident(Data)operator(:) ident(Integer)operator(;) reserved(var) ident(Compare)operator(:) ident(Integer)operator(\))operator(;) -reserved(begin) - reserved(case) ident(SortBy) reserved(of) - ident(vlcName)operator(:) ident(Compare) operator(:=) ident(AnsiCompareText)operator(()ident(RealValueName)operator(()ident(Item1)operator(\))operator(,) ident(RealValueName)operator(()ident(Item2)operator(\))operator(\))operator(;) - ident(vlcSize)operator(:) ident(Compare) operator(:=) ident(Integer)operator(() - ident(StrToIntDef)operator(()ident(Item1)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcSize)operator(])operator(])operator(,) operator(-)integer(1)operator(\)) operator(>) - ident(StrToIntDef)operator(()ident(Item2)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcSize)operator(])operator(])operator(,) operator(-)integer(1)operator(\))operator(\))operator(;) - ident(vlcData)operator(:) ident(Compare) operator(:=) ident(Integer)operator(()ident(Item1)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcData)operator(])operator(]) operator(>) - ident(Item2)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcData)operator(])operator(])operator(\))operator(;) - ident(vlcType)operator(:) ident(Compare) operator(:=) ident(Integer)operator(()ident(Item1)operator(.)ident(ImageIndex) operator(>) ident(Item2)operator(.)ident(ImageIndex)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(Assigned)operator(()ident(SortByColumn)operator(\)) - reserved(and) operator(()ident(SortByColumn)operator(.)ident(ImageIndex) operator(=) ident(iconSortArrowDesc)operator(\)) reserved(then) - ident(Compare) operator(:=) integer(1) operator(-) ident(Compare)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListColumnClick)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Column)operator(:) ident(TListColumn)operator(\))operator(;) -reserved(begin) - reserved(case) ident(Column)operator(.)ident(ImageIndex) reserved(of) - ident(iconSortArrowAsc)operator(:) ident(Column)operator(.)ident(ImageIndex) operator(:=) ident(iconSortArrowDesc)operator(;) - ident(iconSortArrowDesc)operator(:) ident(Column)operator(.)ident(ImageIndex) operator(:=) operator(-)integer(1)operator(;) - reserved(else) - reserved(if) ident(Assigned)operator(()ident(SortByColumn)operator(\)) reserved(then) - ident(SortByColumn)operator(.)ident(ImageIndex) operator(:=) operator(-)integer(1)operator(;) - reserved(if) ident(TValueListColumn)operator(()ident(Column)operator(.)ident(Tag)operator(\)) reserved(in) ident(ValueListColumnRange) reserved(then) - ident(SortBy) operator(:=) ident(TValueListColumn)operator(()ident(Column)operator(.)ident(Tag)operator(\)) - reserved(else) - ident(ShowMessage)operator(()stringoperator(\))operator(;) - ident(Column)operator(.)ident(ImageIndex) operator(:=) ident(iconSortArrowAsc)operator(;) - reserved(end)operator(;) - - reserved(if) ident(Column)operator(.)ident(ImageIndex) operator(=) operator(-)integer(1) reserved(then) - ident(ValueList)operator(.)ident(SortType) operator(:=) ident(stNone) - reserved(else) reserved(begin) - ident(ValueList)operator(.)ident(SortType) operator(:=) ident(stData)operator(;) - ident(SortByColumn) operator(:=) ident(Column)operator(;) - reserved(end)operator(;) - - ident(Update)operator(;) - ident(ValueList)operator(.)ident(AlphaSort)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(CloneValue)operator(;) -reserved(var) - ident(OldName)operator(,) ident(NewName)operator(:) reserved(string)operator(;) - - reserved(function) ident(GetNewName)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(const) ident(OldName)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) - reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(Prefix)operator(:) reserved(string)operator(;) - reserved(begin) - reserved(if) ident(OldName) operator(=) string reserved(then) - ident(Result) operator(:=) string - reserved(else) reserved(if) ident(Copy)operator(()ident(OldName)operator(,) integer(1)operator(,) integer(4)operator(\)) operator(<>) string reserved(then) - ident(Result) operator(:=) string operator(+) ident(OldName) - reserved(else) - ident(Result) operator(:=) ident(OldName)operator(;) - - ident(Prefix) operator(:=) ident(Result)operator(;) - ident(i) operator(:=) integer(1)operator(;) - reserved(while) ident(Reg)operator(.)ident(ValueExists)operator(()ident(Result)operator(\)) reserved(do) reserved(begin) - ident(Result) operator(:=) ident(Prefix) operator(+) char operator(+) ident(IntToStr)operator(()ident(i)operator(\))operator(;) - ident(Inc)operator(()ident(i)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) ident(csDestroying) reserved(in) ident(TreeWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(TreeWin)operator(.)ident(CantWrite) reserved(then) - ident(Exit)operator(;) - - ident(OldName) operator(:=) ident(RealValueName)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\))operator(;) - - reserved(try) - ident(OpenCurKey)operator(;) - - ident(NewName) operator(:=) ident(GetNewName)operator(()ident(MainReg)operator(,) ident(OldName)operator(\))operator(;) - ident(MainReg)operator(.)ident(CopyValue)operator(()ident(OldName)operator(,) ident(NewName)operator(\))operator(;) - ident(AddValue)operator(()ident(MainReg)operator(,) ident(NewName)operator(\))operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(DublicateMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CloneValue)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(CopyDataPreviewMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(ValueList)operator(.)ident(IsEditing) reserved(then) - ident(Exit)operator(;) - - ident(CopyDataPreview)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(CopyDataPreview)operator(;) -reserved(begin) - ident(OpenCurKey)operator(;) - ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(DataPreviewOfContext)operator(()ident(MainReg)operator(.)ident(ReadContext)operator(() - ident(RealValueName)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\))operator(\))operator(\))operator(;) - ident(MainReg)operator(.)ident(CloseKey)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(UpdateValues)operator(()ident(SelectedOnly)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(Reg)operator(:) ident(TXRegistry)operator(;) -reserved(begin) - reserved(if) reserved(not) ident(Started) reserved(then) - ident(Exit)operator(;) - - ident(SpyThread)operator(.)ident(Suspend)operator(;) - - ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) - reserved(try) - reserved(if) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\)) reserved(then) - reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) reserved(begin) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - reserved(if) ident(SelectedOnly) reserved(and) reserved(not) ident(Item)operator([)ident(i)operator(])operator(.)ident(Selected) reserved(then) - ident(Continue)operator(;) - ident(UpdateValue)operator(()ident(Reg)operator(,) ident(Item)operator([)ident(i)operator(])operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(finally) - ident(Reg)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - - ident(SpyThread)operator(.)ident(Resume)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TValuesWin)operator(.)ident(TryRenameValue)operator(()ident(OldName)operator(:) reserved(string)operator(;) - reserved(var) ident(NewName)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(x)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - reserved(if) ident(OldName) operator(=) ident(NewName) reserved(then) - ident(Exit)operator(;) - - reserved(if) operator(()ident(Length)operator(()ident(NewName)operator(\)) operator(>) ident(RegMaxValueNameLen)operator(\)) reserved(then) reserved(begin) - ident(NewName) operator(:=) ident(Copy)operator(()ident(NewName)operator(,) integer(1)operator(,) ident(RegMaxValueNameLen)operator(\))operator(;) - reserved(if) ident(MessageDlg)operator(() - string operator(+) ident(IntToStr)operator(()ident(RegMaxValueNameLen)operator(\)) operator(+) string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(Quote)operator(()ident(StringWrap)operator(()ident(NewName)operator(,) integer(80)operator(\))operator(\))operator(,) - ident(mtConfirmation)operator(,) operator([)ident(mbOK)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) operator(<>) ident(mrOK) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) - - reserved(if) ident(CharIn)operator(()ident(NewName)operator(,) operator([)char(#0)operator(..)char(#31)operator(])operator(\)) reserved(then) reserved(begin) - ident(NewName) operator(:=) ident(ReplaceChars)operator(()ident(NewName)operator(,) operator([)char(#0)operator(..)char(#31)operator(])operator(,) charoperator(\))operator(;) - reserved(if) ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(NewName) operator(+) ident(EOL) operator(+) - stringoperator(,) - ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(])operator(,) integer(0)operator(\)) operator(<>) ident(mrYes) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) - - reserved(if) reserved(not) ident(OpenCurKey) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(SameText)operator(()ident(OldName)operator(,) ident(NewName)operator(\)) reserved(then) reserved(begin) comment(//CharCase ändern) - ident(x) operator(:=) ident(MainReg)operator(.)ident(GetFreeValueName)operator(;) - ident(MainReg)operator(.)ident(RenameValue)operator(()ident(OldName)operator(,) ident(x)operator(\))operator(;) - ident(MainReg)operator(.)ident(RenameValue)operator(()ident(x)operator(,) ident(NewName)operator(\))operator(;) - reserved(end) reserved(else) reserved(begin) - reserved(if) reserved(not) ident(MainReg)operator(.)ident(ValueReallyExists)operator(()ident(NewName)operator(\)) reserved(then) reserved(begin) - ident(MainReg)operator(.)ident(RenameValue)operator(()ident(OldName)operator(,) ident(NewName)operator(\))operator(;) - reserved(end) reserved(else) reserved(begin) - reserved(if) ident(NewName) operator(=) string reserved(then) - ident(ShowMessage)operator(()stringoperator(\)) - reserved(else) - ident(ShowMessage)operator(()string operator(+) ident(Quote)operator(()ident(NewName)operator(\)) operator(+) stringoperator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - reserved(end)operator(;) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - - reserved(if) ident(TextIn)operator(()ident(NewName)operator(,) stringoperator(\)) reserved(then) - ident(AddHint)operator(()stringoperator(\))operator(;) - - ident(Result) operator(:=) ident(True)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ZeromizeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ZeromizeValue)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(CopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(ValueList)operator(.)ident(IsEditing) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(csDestroying) reserved(in) ident(MainWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - ident(MainWin)operator(.)ident(CopyPathClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(TValuesWin)operator(.)ident(FindItemByRealName)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) reserved(begin) - reserved(for) ident(Result) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) - reserved(if) ident(SameText)operator(()ident(RealValueName)operator(()ident(Item)operator([)ident(Result)operator(])operator(\))operator(,) ident(ValueName)operator(\)) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) - ident(Result) operator(:=) operator(-)integer(1)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TValuesWin)operator(.)ident(FocusItem)operator(()ident(ARealValueName)operator(:) reserved(string)operator(;) - ident(FocusValueList)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(with) ident(ValueList) reserved(do) reserved(begin) - ident(i) operator(:=) ident(FindItemByRealName)operator(()ident(ARealValueName)operator(\))operator(;) - - reserved(if) operator(()ident(i) operator(>) operator(-)integer(1)operator(\)) reserved(and) operator(()ident(i) operator(<) ident(Items)operator(.)ident(Count)operator(\)) reserved(then) - ident(Selected) operator(:=) ident(Items)operator([)ident(i)operator(]) - reserved(else) - ident(Selected) operator(:=) reserved(nil)operator(;) - - ident(ItemFocused) operator(:=) ident(Selected)operator(;) - - ident(Result) operator(:=) ident(Assigned)operator(()ident(Selected)operator(\))operator(;) - reserved(if) ident(Result) reserved(then) - ident(JumpToSel)operator(()ident(ValueList)operator(\))operator(;) - - reserved(if) ident(FocusValueList) reserved(then) - ident(FocusControl)operator(()ident(ValueList)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(TakeAsMainValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Item)operator(:) ident(TListItem)operator(;) - ident(ValueName)operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) ident(csDestroying) reserved(in) ident(PrefWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - ident(Item) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(ValueName) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\))operator(;) - reserved(with) ident(PrefWin)operator(.)ident(MainPreviewE) reserved(do) - reserved(if) ident(ValueName) operator(=) ident(Text) reserved(then) - ident(Text) operator(:=) string - reserved(else) - ident(Text) operator(:=) ident(ValueName)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(InitListColumnTags)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(ValueList)operator(.)ident(Columns)operator(.)ident(Count)operator(-)integer(1) reserved(do) - reserved(with) ident(ValueList)operator(.)ident(Columns)operator(.)ident(Items)operator([)ident(i)operator(]) reserved(do) reserved(begin) - ident(Tag) operator(:=) operator(-)integer(1)operator(;) - reserved(if) ident(Caption) operator(=) string reserved(then) - ident(Tag) operator(:=) ident(Integer)operator(()ident(vlcName)operator(\)) - reserved(else) reserved(if) ident(Caption) operator(=) string reserved(then) - ident(Tag) operator(:=) ident(Integer)operator(()ident(vlcSize)operator(\)) - reserved(else) reserved(if) ident(Caption) operator(=) string reserved(then) - ident(Tag) operator(:=) ident(Integer)operator(()ident(vlcType)operator(\)) - reserved(else) reserved(if) ident(Caption) operator(=) string reserved(then) - ident(Tag) operator(:=) ident(Integer)operator(()ident(vlcData)operator(\)) - reserved(else) - ident(ShowMessage)operator(()ident(Format)operator(()stringoperator(,) - operator([)ident(Index)operator(,) ident(Caption)operator(])operator(\))operator(\))operator(;) - reserved(if) ident(Tag) operator(>) operator(-)integer(1) reserved(then) - ident(SubItemIndex)operator([)ident(TValueListColumn)operator(()ident(Tag)operator(\))operator(]) operator(:=) ident(Index) operator(-) integer(1)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(InitListColumnTags)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(Reload)operator(()ident(JumpToNewValue)operator(:) ident(Boolean) operator(=) ident(False)operator(;) - ident(ValueName)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) -reserved(var) - ident(Sel)operator(:) ident(TListItem)operator(;) - ident(SelIndex)operator(:) ident(Integer)operator(;) - ident(SelRealValueName)operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) ident(csDestroying) reserved(in) ident(TreeWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - ident(SelIndex) operator(:=) operator(-)integer(1)operator(;) - reserved(if) ident(JumpToNewValue) reserved(then) - ident(SelRealValueName) operator(:=) ident(ValueName) - reserved(else) reserved(begin) - ident(Sel) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) - reserved(if) ident(Assigned)operator(()ident(Sel)operator(\)) reserved(then) - ident(SelIndex) operator(:=) ident(Sel)operator(.)ident(Index)operator(;) - - reserved(if) ident(SelIndex) operator(>) operator(-)integer(1) reserved(then) - ident(SelRealValueName) operator(:=) ident(RealValueName)operator(()ident(ValueList)operator(.)ident(Items)operator([)ident(SelIndex)operator(])operator(\))operator(;) - reserved(end)operator(;) - - ident(TreeWin)operator(.)ident(RegTVChange)operator(()ident(Self)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\))operator(;) - - reserved(if) ident(SelIndex) operator(>) operator(-)integer(1) reserved(then) - reserved(if) reserved(not) ident(FocusItem)operator(()ident(SelRealValueName)operator(,) ident(True)operator(\)) reserved(then) reserved(begin) - ident(SelIndex) operator(:=) ident(GetBestIndex)operator(()ident(ValueList)operator(,) ident(SelIndex)operator(\))operator(;) - reserved(if) ident(SelIndex) operator(>) operator(-)integer(1) reserved(then) - reserved(with) ident(ValueList) reserved(do) reserved(begin) - ident(Selected) operator(:=) ident(Items)operator([)ident(SelIndex)operator(])operator(;) - ident(ItemFocused) operator(:=) ident(Selected)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(LoadValues)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(\))operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - ident(Clock)operator(:) ident(TClock)operator(;) -reserved(begin) - reserved(if) ident(csDestroying) reserved(in) ident(WorkWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) reserved(begin) - ident(Clock) operator(:=) ident(TClock)operator(.)ident(Create)operator(()integer(1)operator(,) ident(tfSecs)operator(\))operator(;) - ident(ValueList)operator(.)ident(Enabled) operator(:=) ident(False)operator(;) - ident(BeginUpdate)operator(;) - reserved(try) - ident(Clear)operator(;) - ident(WorkWin)operator(.)ident(ReInitShowPC)operator(;) - - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - reserved(try) - ident(Reg)operator(.)ident(GetValueNames)operator(()ident(SL)operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) - ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(Reg)operator(,) ident(SL)operator([)ident(i)operator(])operator(\))operator(;) - reserved(finally) - ident(SL)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - - reserved(finally) - ident(EndUpdate)operator(;) - ident(ValueList)operator(.)ident(Enabled) operator(:=) ident(True)operator(;) - ident(Clock)operator(.)ident(Stop)operator(;) - reserved(if) ident(MurphyMode) reserved(then) - ident(AddHint)operator(()ident(Format)operator(()stringoperator(,) operator([)ident(Clock)operator(.)ident(SecsPassed)operator(])operator(\))operator(\))operator(;) - ident(Clock)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\))operator(;) -reserved(begin) -comment(// Action := caNone;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CheckValueListHotTrack)operator(;) - reserved(if) ident(ValueList)operator(.)ident(HotTrack) reserved(then) - ident(ValueListDblClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(CheckValueListHotTrack)operator(;) -reserved(const) - ident(StyleOfSwitch)operator(:) reserved(array)operator([)ident(Boolean)operator(]) reserved(of) ident(TListHotTrackStyles) operator(=) operator(() - operator([)operator(])operator(,) operator([)ident(htHandPoint)operator(,) ident(htUnderlineHot)operator(]) operator(\))operator(;) -reserved(var) - ident(NewHotTrack)operator(:) ident(Boolean)operator(;) -reserved(begin) - reserved(if) ident(csDestroying) reserved(in) ident(PrefWin)operator(.)ident(ComponentState) reserved(then) - ident(Exit)operator(;) - - ident(NewHotTrack) operator(:=) ident(ScrollON) reserved(xor) ident(PrefWin)operator(.)ident(ValuesSingleClickCB)operator(.)ident(Checked)operator(;) - reserved(if) ident(NewHotTrack) operator(=) ident(ValueList)operator(.)ident(HotTrack) reserved(then) ident(Exit)operator(;) - - reserved(with) ident(ValueList) reserved(do) reserved(begin) - ident(HotTrack) operator(:=) ident(NewHotTrack)operator(;) - ident(HotTrackStyles) operator(:=) ident(StyleOfSwitch)operator([)ident(HotTrack)operator(])operator(;) - ident(Mouse)operator(.)ident(CursorPos) operator(:=) ident(Mouse)operator(.)ident(CursorPos)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(SelectAllMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) - ident(Item)operator([)ident(i)operator(])operator(.)ident(Selected) operator(:=) ident(True)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(InvertSelectionMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) - ident(Item)operator([)ident(i)operator(])operator(.)ident(Selected) operator(:=) reserved(not) ident(Item)operator([)ident(i)operator(])operator(.)ident(Selected)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TValuesWin)operator(.)ident(FormDestroy)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ValueNames)operator(.)ident(Free)operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) -reserved(unit) ident(WorkU)operator(;) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Variants)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) - ident(Dialogs)operator(,) ident(StdCtrls)operator(,) ident(ComCtrls)operator(,) ident(NewPanels)operator(,) ident(Grids)operator(,) ident(Clipbrd)operator(,) - ident(IntEdit)operator(,) ident(ExtCtrls)operator(,) ident(Menus)operator(,) ident(YTools)operator(,) ident(CompEx)operator(,) ident(PlutoConst)operator(,) - ident(XReg)operator(,) ident(Clock)operator(,) ident(Colors)operator(,) ident(ShellAPI)operator(,) ident(IniFiles)operator(,) ident(Math)operator(,) - ident(keybrd)operator(,) ident(Buttons)operator(,) ident(YTypes)operator(,) ident(LinkLabel)operator(,) ident(start)operator(,) - ident(PrefTools)operator(,) ident(ImgList)operator(,) ident(PHexMemo)operator(,) ident(PipelineTh)operator(,) ident(DropSource)operator(,) ident(DropTarget)operator(,) - ident(CrackTools)operator(;) - -reserved(type) - ident(TColorStringFmt) operator(=) operator(()ident(csfThreeSpacedDecimals)operator(\))operator(;) - - ident(TWorkWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) - ident(StringPU)operator(:) ident(TPopupMenu)operator(;) - ident(SpaceMI)operator(:) ident(TMenuItem)operator(;) - ident(FileMI)operator(:) ident(TMenuItem)operator(;) - ident(FileOpenD)operator(:) ident(TOpenDialog)operator(;) - ident(MainPC)operator(:) ident(TPageControl)operator(;) - ident(HintPage)operator(:) ident(TTabSheet)operator(;) - ident(Splitter1)operator(:) ident(TSplitter)operator(;) - ident(HintLB)operator(:) ident(TListBox)operator(;) - ident(InfoMemo)operator(:) ident(TMemo)operator(;) - ident(WorkPage)operator(:) ident(TTabSheet)operator(;) - ident(WorkP)operator(:) ident(TPanel)operator(;) - ident(ShowPC)operator(:) ident(TPageControl)operator(;) - ident(StringPage)operator(:) ident(TTabSheet)operator(;) - ident(BorderPanel1)operator(:) ident(TBorderPanel)operator(;) - ident(StringE)operator(:) ident(TEdit)operator(;) - ident(OKStringB)operator(:) ident(TButton)operator(;) - ident(BoolStrCB)operator(:) ident(TCheckBox)operator(;) - ident(CancelStringB)operator(:) ident(TButton)operator(;) - ident(StringAsColorP)operator(:) ident(TPanel)operator(;) - ident(StringAsFileP)operator(:) ident(TBorderPanel)operator(;) - ident(IconImage)operator(:) ident(TImage)operator(;) - ident(IntPage)operator(:) ident(TTabSheet)operator(;) - ident(BorderPanel5)operator(:) ident(TBorderPanel)operator(;) - ident(OKIntB)operator(:) ident(TButton)operator(;) - ident(CardBoolCB)operator(:) ident(TCheckBox)operator(;) - ident(CancelIntB)operator(:) ident(TButton)operator(;) - ident(BinaryPage)operator(:) ident(TTabSheet)operator(;) - ident(BorderPanel6)operator(:) ident(TBorderPanel)operator(;) - ident(Panel2)operator(:) ident(TPanel)operator(;) - ident(Label5)operator(:) ident(TLabel)operator(;) - ident(OffsetHE)operator(:) ident(THexEdit)operator(;) - ident(OKBinaryB)operator(:) ident(TButton)operator(;) - ident(CancelBinaryB)operator(:) ident(TButton)operator(;) - ident(StringTypeRG)operator(:) ident(TRadioGroup)operator(;) - ident(SpyPage)operator(:) ident(TTabSheet)operator(;) - ident(BorderPanel2)operator(:) ident(TBorderPanel)operator(;) - ident(SpyResumeB)operator(:) ident(TButton)operator(;) - ident(SpySuspendB)operator(:) ident(TButton)operator(;) - ident(SpyLB)operator(:) ident(TListBox)operator(;) - ident(Label4)operator(:) ident(TLabel)operator(;) - ident(Label7)operator(:) ident(TLabel)operator(;) - ident(CardTypeRG)operator(:) ident(TRadioGroup)operator(;) - ident(MultiStringPage)operator(:) ident(TTabSheet)operator(;) - ident(BorderPanel7)operator(:) ident(TBorderPanel)operator(;) - ident(OKMultiStringB)operator(:) ident(TButton)operator(;) - ident(CancelMultiStringB)operator(:) ident(TButton)operator(;) - ident(MultiStringM)operator(:) ident(TMemo)operator(;) - ident(DataTypeComB)operator(:) ident(TComboBox)operator(;) - ident(CardinalE)operator(:) ident(TCardEdit)operator(;) - ident(ColorDlg)operator(:) ident(TColorDialog)operator(;) - ident(MultiStringOpenD)operator(:) ident(TOpenDialog)operator(;) - ident(MultiStringSaveD)operator(:) ident(TSaveDialog)operator(;) - ident(MultiStringPU)operator(:) ident(TPopupMenu)operator(;) - ident(LadenMI)operator(:) ident(TMenuItem)operator(;) - ident(SpeichernMI)operator(:) ident(TMenuItem)operator(;) - ident(Hinzufgen1)operator(:) ident(TMenuItem)operator(;) - ident(N1)operator(:) ident(TMenuItem)operator(;) - ident(SisyPage)operator(:) ident(TTabSheet)operator(;) - ident(SpyClearTracesB)operator(:) ident(TButton)operator(;) - ident(Label11)operator(:) ident(TLabel)operator(;) - ident(HexEdit1)operator(:) ident(THexEdit)operator(;) - ident(Label12)operator(:) ident(TLabel)operator(;) - ident(Label13)operator(:) ident(TLabel)operator(;) - ident(SortMultiStringMI)operator(:) ident(TMenuItem)operator(;) - ident(SpyTestL)operator(:) ident(TLabel)operator(;) - ident(Panel3)operator(:) ident(TPanel)operator(;) - ident(CurValueE)operator(:) ident(TEdit)operator(;) - ident(BorderPanel8)operator(:) ident(TBorderPanel)operator(;) - ident(BorderPanel9)operator(:) ident(TBorderPanel)operator(;) - ident(SisyTV)operator(:) ident(TTreeView)operator(;) - ident(TabImages)operator(:) ident(TImageList)operator(;) - ident(ChangeImages)operator(:) ident(TImageList)operator(;) - ident(Panel7)operator(:) ident(TPanel)operator(;) - ident(ColorPanel1)operator(:) ident(TColorPanel)operator(;) - ident(Splitter2)operator(:) ident(TSplitter)operator(;) - ident(SpyDelayIE)operator(:) ident(TPrefIntEdit)operator(;) - ident(ListTracesCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(Panel5)operator(:) ident(TPanel)operator(;) - ident(Panel8)operator(:) ident(TPanel)operator(;) - ident(SisyExpandGroupsCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(ClearChangesB)operator(:) ident(TButton)operator(;) - ident(FilterChangesB)operator(:) ident(TButton)operator(;) - ident(SisyTVPU)operator(:) ident(TPopupMenu)operator(;) - ident(SisyGotoKeyMI)operator(:) ident(TMenuItem)operator(;) - ident(SisyDeleteChangeMI)operator(:) ident(TMenuItem)operator(;) - ident(SisyActivateChangeMI)operator(:) ident(TMenuItem)operator(;) - ident(N3)operator(:) ident(TMenuItem)operator(;) - ident(SisyCopyPathMI)operator(:) ident(TMenuItem)operator(;) - ident(N4)operator(:) ident(TMenuItem)operator(;) - ident(Panel9)operator(:) ident(TPanel)operator(;) - ident(ExternalEditB)operator(:) ident(TButton)operator(;) - ident(LoadExternalB)operator(:) ident(TButton)operator(;) - ident(ReloadStringB)operator(:) ident(TButton)operator(;) - ident(BinaryHM)operator(:) ident(TPHexMemo)operator(;) - ident(PipelineCB)operator(:) ident(TCheckBox)operator(;) - ident(ReloadDWordB)operator(:) ident(TButton)operator(;) - ident(ReloadBinaryB)operator(:) ident(TButton)operator(;) - ident(ReloadMultiStringB)operator(:) ident(TButton)operator(;) - ident(DescL)operator(:) ident(TLabel)operator(;) - ident(SisyHKUCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(SisyHKLMCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(SisyHKUL)operator(:) ident(TLabel)operator(;) - ident(SisyHKLML)operator(:) ident(TLabel)operator(;) - ident(SisyListCB)operator(:) ident(TPrefCheckBox)operator(;) - ident(CardSpecial0B)operator(:) ident(TButton)operator(;) - ident(CardSpecial1B)operator(:) ident(TButton)operator(;) - ident(CardSpecial_1B)operator(:) ident(TButton)operator(;) - ident(CardSpecial7FB)operator(:) ident(TButton)operator(;) - ident(SisyPU)operator(:) ident(TPopupMenu)operator(;) - ident(Idle1)operator(:) ident(TMenuItem)operator(;) - ident(Lowest1)operator(:) ident(TMenuItem)operator(;) - ident(Lower1)operator(:) ident(TMenuItem)operator(;) - ident(Normal1)operator(:) ident(TMenuItem)operator(;) - ident(Higher1)operator(:) ident(TMenuItem)operator(;) - ident(Highes1)operator(:) ident(TMenuItem)operator(;) - ident(SisyShowCurrentPathMI)operator(:) ident(TMenuItem)operator(;) - ident(N5)operator(:) ident(TMenuItem)operator(;) - ident(MultiStringTypeRG)operator(:) ident(TRadioGroup)operator(;) - ident(SeparatorE)operator(:) ident(TEdit)operator(;) - ident(Label1)operator(:) ident(TLabel)operator(;) - ident(MultiStringCountL)operator(:) ident(TLabel)operator(;) - ident(DropFileTarget)operator(:) ident(TDropFileTarget)operator(;) - ident(CryptoPage)operator(:) ident(TTabSheet)operator(;) - ident(BorderPanel3)operator(:) ident(TBorderPanel)operator(;) - ident(CryptoE)operator(:) ident(TEdit)operator(;) - ident(OKCryptoB)operator(:) ident(TButton)operator(;) - ident(CancelCryptoB)operator(:) ident(TButton)operator(;) - ident(ReloadCryptoB)operator(:) ident(TButton)operator(;) - ident(CryptoTypeRG)operator(:) ident(TRadioGroup)operator(;) - ident(Label2)operator(:) ident(TLabel)operator(;) - ident(LinkLabel2)operator(:) ident(TLinkLabel)operator(;) - reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(SpyResumeBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SpySuspendBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ArrPlutoBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ArrRegEdBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ArrFreeBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ArrBigValBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(procedure) ident(SpaceMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FileMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(HintLBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(MainPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(ValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(StringEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(StringEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(OKStringBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(BoolStrCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CardinalEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CardBoolCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CardinalEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(OKIntBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ShowPCChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ShowPCChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(ShowPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(ShowPCMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) - reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(OKBinaryBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(HexGrid1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(HexGrid1KeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(BoolStrPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(StringPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(IntPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(BinaryPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ReInitShowPC)operator(;) - reserved(procedure) ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(MultiStringMChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(OKMultiStringBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(StringAsColorPDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(MultiStringMEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(LadenMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SpeichernMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(Hinzufgen1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CancelBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(HexGrid1Enter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SpyClearTracesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SpyLBKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - comment(//procedure BinLMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer\);) - reserved(procedure) ident(BinLClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(HexGrid1KeyUp)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(ValueViewChanged)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(HexEdit1Change)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SortMultiStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SpyTestLClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FocusForEditing)operator(;) - reserved(procedure) ident(CurValueEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(CurValueEEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - - reserved(procedure) ident(AddAHint)operator(()reserved(const) ident(Hint)operator(:) reserved(string)operator(\))operator(;) - reserved(procedure) ident(SisyTVGetSelectedIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(procedure) ident(SisyTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SisyTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(SisyCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(BinaryHMLineChange)operator(()ident(NewLine)operator(:) ident(Cardinal)operator(\))operator(;) - reserved(procedure) ident(OffsetHEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SpyDelayIEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SisyTVExpanded)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(procedure) ident(ClearChangesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(FilterChangesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SisyTVPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SisyActivateChangeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SisyDeleteChangeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SisyCopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ExternalEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(LoadExternalBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(ReloadBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(PipelineCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(BinaryHMEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(xUseExtendedModelCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SeparatorEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(HintLBKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - reserved(procedure) ident(DWORDSpecialBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(Button1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SisyPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SisyPriorityMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SisyShowCurrentPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(DropFileTargetDrop)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(ShiftState)operator(:) ident(TShiftState)operator(;) - ident(Point)operator(:) ident(TPoint)operator(;) reserved(var) ident(Effect)operator(:) ident(Integer)operator(\))operator(;) - reserved(procedure) ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\))operator(;) - reserved(procedure) ident(FormResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(IconImageDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(SisyTVCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) - ident(Node)operator(:) ident(TTreeNode)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\))operator(;) - reserved(procedure) ident(SisyTVMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) - reserved(procedure) ident(OKCryptoBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) - reserved(procedure) ident(CryptoEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - directive(private) - ident(PipelineThread)operator(:) ident(TPipelineThread)operator(;) - ident(BoolStr)operator(:) reserved(array) reserved(of) reserved(array)operator([)ident(Boolean)operator(]) reserved(of) reserved(string)operator(;) - ident(HexEditAutoChange)operator(:) ident(Boolean)operator(;) - ident(TargetPage)operator(:) ident(TTabSheet)operator(;) - reserved(procedure) ident(DeleteChange)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(procedure) ident(DeactivateChange)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(procedure) ident(CopySelectedChangeName)operator(;) - reserved(procedure) ident(ClearChanges)operator(;) - directive(public) - ident(ShowAsBinary)operator(:) ident(Boolean)operator(;) - reserved(function) ident(LastHint)operator(:) reserved(string)operator(;) - reserved(function) ident(LoadBoolStr)operator(:) ident(Boolean)operator(;) - reserved(function) ident(LoadSisyFilter)operator(:) ident(Boolean)operator(;) - reserved(procedure) ident(ShowValues)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(\))operator(;) - reserved(procedure) ident(UpdateWriteButtons)operator(;) - reserved(procedure) ident(EditData)operator(;) - reserved(end)operator(;) - -reserved(var) - ident(WorkWin)operator(:) ident(TWorkWin)operator(;) - ident(ShowPC)operator(:) ident(TPageControl)operator(;) - ident(MainPC)operator(:) ident(TPageControl)operator(;) - -reserved(implementation) - -reserved(uses) ident(TreeU)operator(,) ident(ValuesU)operator(,) ident(plutomain)operator(,) ident(splash)operator(,) ident(SisyphusTH)operator(,) ident(PrefU)operator(,) ident(ShellEx)operator(;) - -preprocessor({$R *.dfm}) - -reserved(function) ident(ColorOfString)operator(()ident(s)operator(:) reserved(string)operator(;) ident(Format)operator(:) ident(TColorStringFmt)operator(;) - ident(Default)operator(:) ident(TColor) operator(=) ident(clBlack)operator(\))operator(:) ident(TColor)operator(;) -reserved(var) - ident(SA)operator(:) ident(TStrA)operator(;) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Default)operator(;) - ident(SA) operator(:=) reserved(nil)operator(;) - - reserved(case) ident(Format) reserved(of) - ident(csfThreeSpacedDecimals)operator(:) reserved(begin) - ident(SA) operator(:=) ident(Split)operator(()ident(s)operator(,) charoperator(\))operator(;) - reserved(if) ident(Length)operator(()ident(SA)operator(\)) operator(<>) integer(3) reserved(then) - ident(Exit)operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) integer(2) reserved(do) - reserved(if) reserved(not) operator(()ident(IsValidInteger)operator(()ident(SA)operator([)ident(i)operator(])operator(\)) reserved(and) operator(()ident(StrToIntDef)operator(()ident(SA)operator([)ident(i)operator(])operator(,) operator(-)integer(1)operator(\)) reserved(in) operator([)integer(0)operator(..)integer(255)operator(])operator(\))operator(\)) reserved(then) - ident(Exit)operator(;) - ident(Result) operator(:=) ident(ColorOfRGB)operator(()ident(StrToIntDef)operator(()ident(SA)operator([)integer(0)operator(])operator(,) integer(0)operator(\))operator(,) - ident(StrToIntDef)operator(()ident(SA)operator([)integer(1)operator(])operator(,) integer(0)operator(\))operator(,) - ident(StrToIntDef)operator(()ident(SA)operator([)integer(2)operator(])operator(,) integer(0)operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(StringOfColor)operator(()ident(Color)operator(:) ident(TColor)operator(;) ident(Format)operator(:) ident(TColorStringFmt)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(RGB)operator(:) ident(TRGB)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - - ident(RGB) operator(:=) ident(RGBOfColor)operator(()ident(Color)operator(\))operator(;) - reserved(case) ident(Format) reserved(of) - ident(csfThreeSpacedDecimals)operator(:) reserved(begin) - reserved(with) ident(RGB) reserved(do) - ident(Result) operator(:=) ident(IntToStr)operator(()ident(R)operator(\)) operator(+) char operator(+) ident(IntToStr)operator(()ident(G)operator(\)) operator(+) char operator(+) ident(IntToStr)operator(()ident(B)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TWorkWin)operator(.)ident(LastHint)operator(:) reserved(string)operator(;) -reserved(begin) - reserved(with) ident(HintLB)operator(.)ident(Items) reserved(do) - reserved(if) ident(Count) operator(>) integer(0) reserved(then) - ident(Result) operator(:=) ident(Strings)operator([)ident(Count)operator(-)integer(1)operator(]) - reserved(else) - ident(Result) operator(:=) stringoperator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(AddAHint)operator(()reserved(const) ident(Hint)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(Assigned)operator(()ident(HintLB)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(with) ident(HintLB)operator(.)ident(Items) reserved(do) reserved(begin) - reserved(if) ident(Count) operator(>) integer(0) reserved(then) reserved(begin) - reserved(if) ident(StrAtBegin)operator(()ident(LastHint)operator(,) ident(Hint)operator(\)) reserved(then) reserved(begin) comment(//same hint again) - reserved(with) ident(HintLB) reserved(do) - ident(Tag) operator(:=) ident(Tag) operator(+) integer(1)operator(;) - ident(Strings)operator([)ident(Count)operator(-)integer(1)operator(]) operator(:=) ident(Format)operator(()stringoperator(,) operator([)ident(Hint)operator(,) ident(HintLB)operator(.)ident(Tag)operator(])operator(\))operator(;) - ident(Exit) reserved(end) reserved(else) - ident(HintLB)operator(.)ident(Tag) operator(:=) integer(1)operator(;) - reserved(end)operator(;) - ident(Add)operator(()ident(Hint)operator(\))operator(;) - reserved(end)operator(;) - ident(Application)operator(.)ident(ProcessMessages)operator(;) comment(//draw) -comment(// Sleep(1000\); //wait to read hints) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ReInitShowPC)operator(;) -reserved(begin) - reserved(with) ident(CurValueE) reserved(do) reserved(begin) - ident(Text) operator(:=) ident(NoValueCaption)operator(;) - ident(Font)operator(.)ident(Color) operator(:=) ident(clSilver)operator(;) - ident(Enabled) operator(:=) ident(False)operator(;) - reserved(end)operator(;) - - ident(ShowPC)operator(.)ident(ActivePage) operator(:=) reserved(nil)operator(;) - - ident(StringE)operator(.)ident(Text) operator(:=) stringoperator(;) - ident(StringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) - - ident(MultiStringTypeRG)operator(.)ident(Buttons)operator([)integer(1)operator(])operator(.)ident(Enabled) operator(:=) ident(False)operator(;) - - ident(CardinalE)operator(.)ident(Value) operator(:=) integer(0)operator(;) - ident(CardTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) - - ident(BinaryHM)operator(.)ident(Data) operator(:=) reserved(nil)operator(;) - ident(PipelineCB)operator(.)ident(Checked) operator(:=) ident(False)operator(;) - - ident(DataTypeComB)operator(.)ident(ItemIndex) operator(:=) ident(Integer)operator(()ident(rdBinary)operator(\))operator(;) - - ident(MultiStringM)operator(.)ident(Clear)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - ident(MainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(,) ident(Key)operator(,) ident(Shift)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SpyResumeBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(SpyThread)operator(.)ident(Resume)operator(;) - ident(SpyTestLClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SpySuspendBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(SpyThread)operator(.)ident(Suspend)operator(;) - ident(SpyTestLClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ArrPlutoBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ArrangePlutoStyle)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ArrRegEdBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ArrangeRegEdStyle)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ArrFreeBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ArrangeFreeStyle)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ArrBigValBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ArrangeBigValStyle)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SpaceMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(StringE)operator(.)ident(Text) operator(:=) stringoperator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(HintLBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(])operator(.)ident(Text) operator(:=) ident(GetSel)operator(()ident(HintLB)operator(\))operator(;) - ident(WorkWin)operator(.)ident(InfoMemo)operator(.)ident(Text) operator(:=) ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(])operator(.)ident(Text)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(MainPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) ident(TabIndex)operator(:) ident(Integer)operator(;) - reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\))operator(;) -reserved(var) - ident(PC)operator(:) ident(TPageControl)operator(;) - ident(Page)operator(:) ident(TTabSheet)operator(;) -reserved(begin) - ident(PC) operator(:=) ident(TPageControl)operator(()ident(Control)operator(\))operator(;) - ident(Page) operator(:=) ident(PC)operator(.)ident(Pages)operator([)ident(TabIndex)operator(])operator(;) - reserved(with) ident(PC)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) - reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) - ident(Color) operator(:=) ident(clBrightRed) - reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) - ident(Color) operator(:=) ident(clBrightGreen) - reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) - ident(Color) operator(:=) ident(clBrightBlue) - reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) - ident(Color) operator(:=) ident(clBrightCyan) - reserved(else) - ident(Color) operator(:=) ident(clWhite)operator(;) - reserved(end)operator(;) - - reserved(with) ident(PC)operator(.)ident(Canvas) reserved(do) - reserved(if) ident(Active) reserved(then) reserved(begin) - ident(Font)operator(.)ident(Style) operator(:=) operator([)ident(fsBold)operator(])operator(;) - ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) - ident(FillRect)operator(()ident(Rect)operator(\))operator(;) - ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(18) operator(+) integer(5)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(3)operator(,) ident(Page)operator(.)ident(Caption)operator(\))operator(;) - ident(PC)operator(.)ident(Images)operator(.)ident(Draw)operator(()ident(PC)operator(.)ident(Canvas)operator(,) ident(Rect)operator(.)ident(Left) operator(+) integer(4)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(2)operator(,) ident(Page)operator(.)ident(ImageIndex)operator(\))operator(;) - reserved(end) reserved(else) reserved(begin) - ident(Font)operator(.)ident(Style) operator(:=) operator([)operator(])operator(;) - ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) - ident(FillRect)operator(()ident(Rect)operator(\))operator(;) - ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(18) operator(+) integer(3)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(2)operator(,) ident(Page)operator(.)ident(Caption)operator(\))operator(;) - ident(PC)operator(.)ident(Images)operator(.)ident(Draw)operator(()ident(PC)operator(.)ident(Canvas)operator(,) ident(Rect)operator(.)ident(Left) operator(+) integer(1)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(1)operator(,) ident(Page)operator(.)ident(ImageIndex)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(StringE)operator(.)ident(Text) operator(:=) ident(UntilStr)operator(()ident(TMenuItem)operator(()ident(Sender)operator(\))operator(.)ident(Caption)operator(,)stringoperator(\))operator(;) - ident(OKStringBClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(StringEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) ident(key) operator(=) ident(VK_RETURN) reserved(then) reserved(begin) - ident(OKStringBClick)operator(()ident(Sender)operator(\))operator(;) - ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\))operator(;) - reserved(end)operator(;) - reserved(if) ident(key) operator(=) ident(VK_ESCAPE) reserved(then) - ident(CancelBClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(StringEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(State)operator(:) ident(TCheckBoxState)operator(;) - ident(Desc)operator(:) reserved(string)operator(;) -reserved(begin) - ident(IconImage)operator(.)ident(Picture) operator(:=) reserved(nil)operator(;) - - reserved(with) ident(StringAsColorP) reserved(do) reserved(begin) - ident(Color) operator(:=) ident(ColorOfString)operator(()ident(StringE)operator(.)ident(Text)operator(,) ident(csfThreeSpacedDecimals)operator(,) operator(-)integer(1)operator(\))operator(;) - ident(Visible) operator(:=) ident(Color) operator(<>) operator(-)integer(1)operator(;) - reserved(end)operator(;) - - reserved(try) - reserved(with) ident(IconImage)operator(.)ident(Picture)operator(.)ident(Icon) reserved(do) reserved(begin) - ident(ReleaseHandle)operator(;) - ident(Handle) operator(:=) ident(GetIconFromFile)operator(()ident(StringE)operator(.)ident(Text)operator(\))operator(;) - ident(StringAsFileP)operator(.)ident(Visible) operator(:=) ident(Handle) operator(<>) integer(0)operator(;) - reserved(end)operator(;) - reserved(except) - reserved(end)operator(;) - - ident(State) operator(:=) ident(cbGrayed)operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(BoolStr)operator(\)) reserved(do) reserved(begin) - reserved(if) ident(StringE)operator(.)ident(Text) operator(=) ident(BoolStr)operator([)ident(i)operator(])operator([)ident(False)operator(]) reserved(then) - ident(State) operator(:=) ident(cbUnchecked) - reserved(else) reserved(if) ident(StringE)operator(.)ident(Text) operator(=) ident(BoolStr)operator([)ident(i)operator(])operator([)ident(True)operator(]) reserved(then) - ident(State) operator(:=) ident(cbChecked) - reserved(else) - ident(Continue)operator(;) - ident(Break)operator(;) - reserved(end)operator(;) - - ident(BoolStrCB)operator(.)ident(Visible) operator(:=) ident(State) reserved(in) operator([)ident(cbChecked)operator(,) ident(cbUnchecked)operator(])operator(;) - ident(BoolStrCB)operator(.)ident(State) operator(:=) ident(State)operator(;) - - ident(Desc) operator(:=) ident(StringE)operator(.)ident(Text)operator(;) - ident(Desc) operator(:=) ident(RegNameOfCLSID)operator(()ident(Desc)operator(\))operator(;) - reserved(with) ident(DescL) reserved(do) reserved(begin) - ident(Visible) operator(:=) operator(()ident(Desc) operator(<>) stringoperator(\))operator(;) - reserved(if) ident(Visible) reserved(then) - ident(Caption) operator(:=) string operator(+) ident(Desc)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(OKStringBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(try) - ident(OpenCurKey)operator(;) - reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - reserved(case) ident(StringTypeRG)operator(.)ident(ItemIndex) reserved(of) - integer(0)operator(:) ident(MainReg)operator(.)ident(WriteString)operator(()ident(Strings)operator([)ident(i)operator(])operator(,) ident(StringE)operator(.)ident(Text)operator(\))operator(;) - integer(1)operator(:) ident(MainReg)operator(.)ident(WriteExpandString)operator(()ident(Strings)operator([)ident(i)operator(])operator(,) ident(StringE)operator(.)ident(Text)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\))operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - reserved(end)operator(;) - ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(BoolStrCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(BoolStr)operator(\)) reserved(do) reserved(begin) - reserved(if) operator(()ident(BoolStr)operator([)ident(i)operator(,) ident(False)operator(]) operator(=) ident(StringE)operator(.)ident(Text)operator(\)) - reserved(or) operator(()ident(BoolStr)operator([)ident(i)operator(,) ident(True)operator(]) operator(=) ident(StringE)operator(.)ident(Text)operator(\)) reserved(then) - ident(Break)operator(;) - reserved(end)operator(;) - - reserved(if) ident(i) operator(>) ident(High)operator(()ident(BoolStr)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(StringE)operator(.)ident(Text) operator(:=) ident(BoolStr)operator([)ident(i)operator(])operator([)ident(BoolStrCB)operator(.)ident(Checked)operator(])operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(CardinalEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(HexEditAutoChange) operator(:=) ident(True)operator(;) - reserved(with) ident(CardBoolCB) reserved(do) reserved(begin) - ident(Enabled) operator(:=) ident(True)operator(;) - reserved(case) ident(CardinalE)operator(.)ident(Value) reserved(of) - integer(1)operator(:) ident(Checked) operator(:=) ident(True)operator(;) - integer(0)operator(:) ident(Checked) operator(:=) ident(False)operator(;) - reserved(else) - ident(Enabled) operator(:=) ident(False)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - ident(HexEdit1)operator(.)ident(Value) operator(:=) ident(CardinalE)operator(.)ident(Value)operator(;) - ident(HexEditAutoChange) operator(:=) ident(False)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(CardBoolCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(HexEditAutoChange) reserved(then) - ident(Exit)operator(;) - ident(CardinalE)operator(.)ident(Value) operator(:=) ident(Ord)operator(()ident(CardBoolCB)operator(.)ident(Checked)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(CardinalEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) ident(key) operator(=) ident(VK_RETURN) reserved(then) reserved(begin) - ident(OKIntBClick)operator(()ident(Sender)operator(\))operator(;) - ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(key) operator(=) ident(VK_ESCAPE) reserved(then) - ident(CancelBClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(OKIntBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(Write4BB)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) ident(Value)operator(:) ident(Cardinal)operator(\))operator(;) - reserved(var) - ident(Typ)operator(:) ident(TRegDataType)operator(;) - reserved(begin) - reserved(if) ident(MainReg)operator(.)ident(ValueReallyExists)operator(()ident(ValueName)operator(\)) reserved(then) - ident(Typ) operator(:=) ident(MainReg)operator(.)ident(GetDataType)operator(()ident(ValueName)operator(\)) - reserved(else) - ident(Typ) operator(:=) ident(rdBinary)operator(;) - - reserved(if) ident(Typ) reserved(in) ident(rdCardTypes) reserved(then) - ident(Typ) operator(:=) ident(rdBinary)operator(;) - - ident(MainReg)operator(.)ident(WriteBinType)operator(()ident(ValueName)operator(,) ident(ByteAOfInt)operator(()ident(CardinalE)operator(.)ident(Value)operator(\))operator(,) ident(Typ)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(try) - ident(OpenCurKey)operator(;) - reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - reserved(case) ident(CardTypeRG)operator(.)ident(ItemIndex) reserved(of) - integer(0)operator(:) ident(MainReg)operator(.)ident(WriteCardinal)operator(()ident(Strings)operator([)ident(i)operator(])operator(,) ident(CardinalE)operator(.)ident(Value)operator(\))operator(;) - integer(1)operator(:) ident(MainReg)operator(.)ident(WriteCardinal)operator(()ident(Strings)operator([)ident(i)operator(])operator(,) ident(CardinalE)operator(.)ident(Value)operator(,) ident(True)operator(\))operator(;) - integer(2)operator(:) ident(Write4BB)operator(()ident(Strings)operator([)ident(i)operator(])operator(,) ident(CardinalE)operator(.)ident(Value)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\))operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ShowPCChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(FocusControl)operator(()ident(TObject)operator(()ident(ShowPC)operator(.)ident(ActivePage)operator(.)ident(Tag)operator(\)) reserved(as) ident(TWinControl)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ShowPCChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\))operator(;) - - reserved(function) ident(ByteAOfDWORD)operator(()ident(a)operator(:) ident(DWORD)operator(\))operator(:) ident(TByteA)operator(;) - reserved(begin) - ident(SetLength)operator(()ident(Result)operator(,) ident(SizeOf)operator(()ident(DWORD)operator(\))operator(\))operator(;) - ident(Move)operator(()ident(a)operator(,) ident(Pointer)operator(()ident(Result)operator(\))operator(^)operator(,) ident(SizeOf)operator(()ident(DWORD)operator(\))operator(\))operator(;) - reserved(end)operator(;) - -reserved(var) - ident(SourcePage)operator(:) ident(TTabSheet)operator(;) - ident(ValueName)operator(:) reserved(string)operator(;) -reserved(begin) - ident(SourcePage) operator(:=) ident(ShowPC)operator(.)ident(ActivePage)operator(;) - reserved(if) ident(SourcePage) operator(=) ident(IntPage) reserved(then) reserved(begin) - - reserved(if) ident(TargetPage) operator(=) ident(StringPage) reserved(then) reserved(begin) - ident(AddHint)operator(()string String)delimiter(')>operator(\))operator(;) - ident(StringE)operator(.)ident(Text) operator(:=) ident(CardinalE)operator(.)ident(Text)operator(;) - reserved(end) reserved(else) reserved(if) ident(TargetPage) operator(=) ident(BinaryPage) reserved(then) reserved(begin) - ident(AddHint)operator(()string Binary)delimiter(')>operator(\))operator(;) - ident(BinaryHM)operator(.)ident(Data) operator(:=) ident(ByteAOfDWORD)operator(()ident(CardinalE)operator(.)ident(Value)operator(\))operator(;) - reserved(end) reserved(else) - ident(AllowChange) operator(:=) ident(False)operator(;) - - reserved(end) reserved(else) reserved(if) ident(SourcePage) operator(=) ident(StringPage) reserved(then) reserved(begin) - reserved(if) ident(TargetPage) operator(=) ident(IntPage) reserved(then) reserved(begin) - reserved(if) ident(IsValidCardinal)operator(()ident(StringE)operator(.)ident(Text)operator(\)) reserved(then) reserved(begin) - ident(AddHint)operator(()string DWORD)delimiter(')>operator(\))operator(;) - ident(CardinalE)operator(.)ident(Text) operator(:=) ident(StringE)operator(.)ident(Text)operator(;) - reserved(end) reserved(else) reserved(begin) - ident(AddHint)operator(()stringoperator(,) ident(True)operator(\))operator(;) - ident(AllowChange) operator(:=) ident(False)operator(;) - reserved(end)operator(;) - reserved(end) reserved(else) reserved(if) ident(TargetPage) operator(=) ident(BinaryPage) reserved(then) reserved(begin) - ident(AddHint)operator(()string Binary)delimiter(')>operator(\))operator(;) - ident(BinaryHM)operator(.)ident(Data) operator(:=) ident(TByteA)operator(()ident(StringE)operator(.)ident(Text)operator(\))operator(;) - reserved(end) reserved(else) reserved(if) ident(TargetPage) operator(=) ident(MultiStringPage) reserved(then) reserved(begin) - ident(AddHint)operator(()string MultiString)delimiter(')>operator(\))operator(;) - reserved(if) ident(SeparatorE)operator(.)ident(Text) operator(=) string reserved(then) - ident(MultiStringM)operator(.)ident(Text) operator(:=) ident(StringE)operator(.)ident(Text)operator(;) - ident(SeparatorEChange)operator(()ident(Sender)operator(\))operator(;) - reserved(end) reserved(else) - ident(AllowChange) operator(:=) ident(False)operator(;) - - reserved(end) reserved(else) reserved(if) ident(SourcePage) operator(=) ident(BinaryPage) reserved(then) reserved(begin) - reserved(if) ident(TargetPage) operator(=) ident(StringPage) reserved(then) reserved(begin) - ident(AddHint)operator(()string String)delimiter(')>operator(\))operator(;) - ident(StringE)operator(.)ident(Text) operator(:=) ident(FriendlyStr)operator(()reserved(string)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\))operator(\))operator(;) - reserved(end) reserved(else) reserved(if) ident(TargetPage) operator(=) ident(IntPage) reserved(then) reserved(begin) - reserved(if) ident(Length)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\)) operator(>=) ident(SizeOf)operator(()ident(DWORD)operator(\)) reserved(then) reserved(begin) - ident(AddHint)operator(()string DWORD)delimiter(')>operator(\))operator(;) - ident(CardinalE)operator(.)ident(Value) operator(:=) ident(PDWORD)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\))operator(^)operator(;) - reserved(end) reserved(else) reserved(begin) - ident(AddHint)operator(()stringoperator(,) ident(True)operator(\))operator(;) - ident(AllowChange) operator(:=) ident(False)operator(;) - reserved(end)operator(;) - reserved(end) reserved(else) reserved(if) ident(TargetPage) operator(=) ident(CryptoPage) reserved(then) reserved(begin) - reserved(if) ident(ValuesWin)operator(.)ident(ValueNames)operator(.)ident(Count) operator(=) integer(1) reserved(then) reserved(begin) - ident(ValueName) operator(:=) ident(ValuesWin)operator(.)ident(ValueNames)operator([)integer(0)operator(])operator(;) - reserved(with) ident(CryptoTypeRG) reserved(do) reserved(begin) - ident(ItemIndex) operator(:=) operator(-)integer(1)operator(;) - reserved(if) ident(SameText)operator(()ident(ValueName)operator(,) stringoperator(\)) reserved(then) reserved(begin) - ident(ItemIndex) operator(:=) integer(0)operator(;) - ident(CryptoE)operator(.)ident(Text) operator(:=) ident(DecodeScreenSaver)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\))operator(;) - reserved(end) reserved(else) reserved(if) ident(SameText)operator(()ident(ValueName)operator(,) stringoperator(\)) - reserved(or) ident(SameText)operator(()ident(ValueName)operator(,) stringoperator(\)) reserved(then) reserved(begin) - ident(ItemIndex) operator(:=) integer(1)operator(;) - ident(CryptoE)operator(.)ident(Text) operator(:=) ident(DecodeSharedFolder)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(if) ident(CryptoTypeRG)operator(.)ident(ItemIndex) operator(=) operator(-)integer(1) reserved(then) - ident(AllowChange) operator(:=) ident(False)operator(;) - reserved(end)operator(;) - reserved(end) reserved(else) - ident(AllowChange) operator(:=) ident(False)operator(;) - - reserved(end) reserved(else) reserved(if) ident(SourcePage) operator(=) ident(MultiStringPage) reserved(then) reserved(begin) - reserved(if) ident(TargetPage) operator(=) ident(StringPage) reserved(then) reserved(begin) - ident(AddHint)operator(()string String )delimiter(')>operator(\))operator(;) - reserved(if) ident(SeparatorE)operator(.)ident(Text) operator(=) string reserved(then) - ident(StringE)operator(.)ident(Text) operator(:=) ident(MultiStringM)operator(.)ident(Text) - reserved(else) - ident(StringE)operator(.)ident(Text) operator(:=) ident(Join)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(,) ident(SeparatorE)operator(.)ident(Text)operator(\))operator(;) - comment(//end else if TargetPage = BinaryPage then begin) - reserved(end) reserved(else) - ident(AllowChange) operator(:=) ident(False)operator(;) - - reserved(end) reserved(else) - ident(AllowChange) operator(:=) ident(False)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ShowPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) ident(TabIndex)operator(:) ident(Integer)operator(;) - reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\))operator(;) -reserved(var) - ident(PC)operator(:) ident(TPageControl)operator(;) - ident(Page)operator(:) ident(TTabSheet)operator(;) -reserved(begin) - ident(PC) operator(:=) ident(TPageControl)operator(()ident(Control)operator(\))operator(;) - ident(Page) operator(:=) ident(PC)operator(.)ident(Pages)operator([)ident(TabIndex)operator(])operator(;) - reserved(with) ident(PC)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) - reserved(if) ident(Page) operator(=) ident(StringPage) reserved(then) - ident(Color) operator(:=) ident(clBrightRed) - reserved(else) reserved(if) ident(Page) operator(=) ident(MultiStringPage) reserved(then) - ident(Color) operator(:=) ident(clBrightPurple) - reserved(else) reserved(if) ident(Page) operator(=) ident(IntPage) reserved(then) - ident(Color) operator(:=) ident(clBrightBlue) - reserved(else) reserved(if) ident(Page) operator(=) ident(BinaryPage) reserved(then) - ident(Color) operator(:=) ident(clBrightGreen) - reserved(else) reserved(if) ident(Page) operator(=) ident(CryptoPage) reserved(then) - ident(Color) operator(:=) ident(clBrightCyan)operator(;) - reserved(end)operator(;) - - reserved(with) ident(PC)operator(.)ident(Canvas) reserved(do) reserved(begin) - reserved(if) ident(Active) reserved(then) - ident(Brush)operator(.)ident(Color) operator(:=) ident(clGray) - reserved(else) - ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) - ident(FillRect)operator(()ident(Rect)operator(\))operator(;) - ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(18) operator(+) integer(3)operator(,) ident(Rect)operator(.)ident(Top)operator(,) ident(Page)operator(.)ident(Caption)operator(\))operator(;) - ident(MainWin)operator(.)ident(ImageList1)operator(.)ident(Draw)operator(()ident(Control)operator(.)ident(Canvas)operator(,) ident(Rect)operator(.)ident(Left) operator(-) integer(1)operator(,) ident(Rect)operator(.)ident(Top) operator(-) integer(1)operator(,) ident(Page)operator(.)ident(ImageIndex)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ShowPCMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) -reserved(begin) - reserved(with) ident(ShowPC) reserved(do) - reserved(if) ident(htOnItem) reserved(in) ident(GetHitTestInfoAt)operator(()ident(X)operator(,) ident(Y)operator(\)) reserved(then) - ident(TargetPage) operator(:=) ident(Pages)operator([)ident(IndexOfTabAt)operator(()ident(X)operator(,) ident(Y)operator(\))operator(])operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(WorkU)operator(.)ident(ShowPC) operator(:=) ident(ShowPC)operator(;) - ident(WorkU)operator(.)ident(MainPC) operator(:=) ident(MainPC)operator(;) - - comment(//Zeromize) - ident(ShowPC)operator(.)ident(ActivePage) operator(:=) reserved(nil)operator(;) - ident(InfoMemo)operator(.)ident(Text) operator(:=) stringoperator(;) - ident(MultiStringM)operator(.)ident(Clear)operator(;) - ident(SisyTV)operator(.)ident(Items)operator(.)ident(Clear)operator(;) - ident(CurValueE)operator(.)ident(Text) operator(:=) ident(NoValueCaption)operator(;) - ident(HexEditAutoChange) operator(:=) ident(False)operator(;) - ident(TargetPage) operator(:=) reserved(nil)operator(;) - - comment(//Tagging) - ident(StringPage)operator(.)ident(Tag) operator(:=) ident(Integer)operator(()ident(StringE)operator(\))operator(;) - ident(IntPage)operator(.)ident(Tag) operator(:=) ident(Integer)operator(()ident(CardinalE)operator(\))operator(;) - ident(BinaryPage)operator(.)ident(Tag) operator(:=) ident(Integer)operator(()ident(BinaryHM)operator(\))operator(;) - ident(MultiStringPage)operator(.)ident(Tag) operator(:=) ident(Integer)operator(()ident(MultiStringM)operator(\))operator(;) - ident(ShowAsBinary) operator(:=) ident(False)operator(;) - - reserved(if) reserved(not) ident(Win9x) reserved(then) - ident(CryptoPage)operator(.)ident(TabVisible) operator(:=) ident(False)operator(;) - - ident(MainPC)operator(.)ident(ActivePage) operator(:=) ident(HintPage)operator(;) - ident(ShowPC)operator(.)ident(ActivePage) operator(:=) reserved(nil)operator(;) - - ident(DropFileTarget)operator(.)ident(register)operator(()ident(StringE)operator(\))operator(;) - - reserved(with) ident(StringTypeRG) reserved(do) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(ControlCount)operator(-)integer(1) reserved(do) - operator(()ident(Controls)operator([)ident(i)operator(]) reserved(as) ident(TRadioButton)operator(\))operator(.)ident(OnKeyDown) operator(:=) ident(StringEKeyDown)operator(;) - - ident(ExternalEditB)operator(.)ident(Enabled) operator(:=) ident(FileEx)operator(()ident(PrefWin)operator(.)ident(ExternalHexEditE)operator(.)ident(Text)operator(\))operator(;) - - ident(PipelineThread) operator(:=) ident(TPipelineThread)operator(.)ident(CreateIt)operator(()ident(tpIdle)operator(,) stringoperator(,) ident(BinaryHM)operator(\))operator(;) - ident(PipelineThread)operator(.)ident(OnChange) operator(:=) ident(LoadExternalBClick)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(OKBinaryBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Typ)operator(:) ident(Cardinal)operator(;) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(try) - ident(Typ) operator(:=) ident(StrToIntDef)operator(()ident(UntilChar)operator(()ident(DataTypeComB)operator(.)ident(Text)operator(,) charoperator(\))operator(,) ident(Integer)operator(()ident(rdBinary)operator(\))operator(\))operator(;) - ident(OpenCurKey)operator(;) - reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) - ident(MainReg)operator(.)ident(WriteBinType)operator(()ident(Strings)operator([)ident(i)operator(])operator(,) ident(BinaryHM)operator(.)ident(Data)operator(,) ident(Typ)operator(\))operator(;) - ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\))operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(HexGrid1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - comment({with BinaryHM do begin - with BinL, Font do - if ActiveByte < ByteCount then - Color := clBrightGreen - else begin - Color := clSilver; - Caption := '00000000'; - end; - BinL.Caption := IntToBinFill(CurrentByte, 8\); - end; }) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(HexGrid1KeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) ident(key) operator(=) ident(VK_RETURN) reserved(then) reserved(begin) - ident(OKBinaryBClick)operator(()ident(Sender)operator(\))operator(;) - ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\))operator(;) - reserved(end)operator(;) - reserved(if) ident(key) operator(=) ident(VK_ESCAPE) reserved(then) - ident(CancelBClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(BoolStrPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(StringE)operator(.)ident(Text) operator(:=) ident(TMenuItem)operator(()ident(Sender)operator(\))operator(.)ident(Caption)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(StringPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(FocusControl)operator(()ident(StringE)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(IntPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(FocusControl)operator(()ident(CardinalE)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(BinaryPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(FocusControl)operator(()ident(BinaryHM)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ActivateThis)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(DeActivateThis)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) - ident(TEdit)operator(()ident(ActiveControl)operator(\))operator(.)ident(OnExit)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) - ident(TEdit)operator(()ident(ActiveControl)operator(\))operator(.)ident(OnEnter)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(MultiStringMChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(MultiStringCountL)operator(.)ident(Caption) operator(:=) ident(StrNumerus)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(.)ident(Count)operator(,) - stringoperator(,) stringoperator(,) stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(OKMultiStringBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(UseExtendedModel)operator(:) ident(Boolean)operator(;) - ident(i)operator(:) ident(Integer)operator(;) - ident(JoinedText)operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) operator(()ident(MultiStringTypeRG)operator(.)ident(ItemIndex) operator(=) integer(1)operator(\)) reserved(then) reserved(begin) - reserved(if) ident(ValuesWin)operator(.)ident(ValueCommonType) operator(=) ident(rdMultiString) reserved(then) - reserved(if) ident(mrYes)operator(<>)ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) - string String)delimiter(')>operator(,) ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(try) - ident(OpenCurKey)operator(;) - ident(JoinedText) operator(:=) ident(Join)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(,) ident(SeparatorE)operator(.)ident(Text)operator(\))operator(;) - reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) - ident(MainReg)operator(.)ident(WriteString)operator(()ident(Strings)operator([)ident(i)operator(])operator(,) ident(JoinedText)operator(\))operator(;) - ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\))operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - reserved(end)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(UseExtendedModel) operator(:=) ident(True)operator(;) - reserved(if) ident(ContainsEmptyLines)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(\)) reserved(then) - reserved(case) ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - stringoperator(,) - ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) reserved(of) - - ident(mrNo)operator(:) ident(UseExtendedModel) operator(:=) ident(True)operator(;) - - ident(mrYes)operator(:) reserved(begin) - reserved(with) ident(MultiStringM) reserved(do) reserved(begin) - ident(Lines)operator(.)ident(BeginUpdate)operator(;) - ident(DeleteEmptyLines)operator(()ident(Lines)operator(\))operator(;) - ident(Lines)operator(.)ident(EndUpdate)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(else) ident(Exit)operator(;) - - reserved(end)operator(;) - - reserved(try) - ident(OpenCurKey)operator(;) - reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - reserved(if) ident(MainReg)operator(.)ident(GetDataType)operator(()ident(Strings)operator([)ident(i)operator(])operator(\)) operator(<>) ident(rdMultiString) reserved(then) - reserved(if) ident(mrYes) operator(<>) ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) - string MultiString)delimiter(')>operator(,) ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) reserved(then) - ident(Exit)operator(;) - reserved(if) ident(UseExtendedModel) reserved(then) - ident(MainReg)operator(.)ident(WriteStringList)operator(()ident(Strings)operator([)ident(i)operator(])operator(,) ident(MultiStringM)operator(.)ident(Lines)operator(\)) - reserved(else) - ident(MainReg)operator(.)ident(WriteMultiString)operator(()ident(Strings)operator([)ident(i)operator(])operator(,) ident(MultiStringM)operator(.)ident(Lines)operator(\))operator(;) - reserved(end)operator(;) - ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\))operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - reserved(end)operator(;) - - ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(StringAsColorPDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(ColorDlg)operator(.)ident(Execute) reserved(then) - ident(StringE)operator(.)ident(Text) operator(:=) ident(StringOfColor)operator(()ident(ColorDlg)operator(.)ident(Color)operator(,) ident(csfThreeSpacedDecimals)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(MultiStringMEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(MultiStringM)operator(.)ident(SelectAll)operator(;) - ident(ActivateIt)operator(()ident(MultiStringM)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(LadenMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(MultiStringOpenD) reserved(do) reserved(begin) - ident(InitialDir) operator(:=) ident(ExtractFileDrive)operator(()ident(MyDir)operator(\))operator(;) - reserved(if) ident(Execute) reserved(then) - ident(MultiStringM)operator(.)ident(Lines)operator(.)ident(LoadFromFile)operator(()ident(FileName)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SpeichernMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(MultiStringSaveD) reserved(do) reserved(begin) - ident(InitialDir) operator(:=) ident(ExtractFileDrive)operator(()ident(MyDir)operator(\))operator(;) - reserved(if) ident(Execute) reserved(then) - ident(MultiStringM)operator(.)ident(Lines)operator(.)ident(SaveToFile)operator(()ident(FileName)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(Hinzufgen1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) -reserved(begin) - reserved(with) ident(MultiStringOpenD) reserved(do) reserved(begin) - ident(InitialDir) operator(:=) ident(ExtractFileDrive)operator(()ident(MyDir)operator(\))operator(;) - reserved(if) ident(Execute) reserved(then) reserved(begin) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - ident(SL)operator(.)ident(LoadFromFile)operator(()ident(FileName)operator(\))operator(;) - ident(MultiStringM)operator(.)ident(Lines)operator(.)ident(AddStrings)operator(()ident(SL)operator(\))operator(;) - ident(SL)operator(.)ident(Free)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(CancelBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\))operator(;) - ident(ValuesWin)operator(.)ident(ValueListChange)operator(()ident(Sender)operator(,) ident(ValueList)operator(.)ident(Selected)operator(,) ident(ctState)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(HexGrid1Enter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(HexGrid1Click)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SpyClearTracesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(SpyLB)operator(.)ident(Clear)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SpyLBKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) operator(()ident(ssShift) reserved(in) ident(Shift)operator(\)) reserved(and) operator(()ident(key) operator(=) ident(VK_DELETE)operator(\)) reserved(then) reserved(begin) - ident(key) operator(:=) integer(0)operator(;) - ident(SpyLB)operator(.)ident(Clear)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(if) ident(key) operator(=) ident(VK_F9) reserved(then) reserved(begin) - ident(key) operator(:=) integer(0)operator(;) - ident(SwapFonts)operator(()ident(SpyLB)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(BinLClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - comment(// with HexGrid1 do) - comment(// Byt[ActiveByte] := IntOfBin(BinL.Caption\);) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(HexGrid1KeyUp)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - comment(//HexGrid1Click(Sender\);) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ValueViewChanged)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) reserved(not) ident(Started) reserved(then) - ident(Exit)operator(;) - - ident(SpyThread)operator(.)ident(Suspend)operator(;) - ident(OpenCurKey)operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(ValueList)operator(.)ident(Items)operator(.)ident(Count)operator(-)integer(1) reserved(do) - ident(ValuesWin)operator(.)ident(UpdateValue)operator(()ident(MainReg)operator(,) ident(ValueList)operator(.)ident(Items)operator([)ident(i)operator(])operator(\))operator(;) - - ident(MainReg)operator(.)ident(CloseKey)operator(;) - ident(SpyThread)operator(.)ident(Resume)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(HexEdit1Change)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(HexEditAutoChange) reserved(then) - ident(CardinalE)operator(.)ident(Value) operator(:=) ident(HexEdit1)operator(.)ident(Value)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SortMultiStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) -reserved(begin) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - reserved(with) ident(SL) reserved(do) reserved(begin) - ident(Assign)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(\))operator(;) - ident(Sort)operator(;) - reserved(end)operator(;) - ident(MultiStringM)operator(.)ident(Lines)operator(.)ident(Assign)operator(()ident(SL)operator(\))operator(;) - ident(SL)operator(.)ident(Free)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SpyTestLClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(SpyTestL)operator(.)ident(Caption) operator(:=) ident(StrOfBool)operator(()ident(SpyThread)operator(.)ident(Suspended)operator(,) stringoperator(,) stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(FocusForEditing)operator(;) -reserved(begin) - ident(FocusControl)operator(()ident(MainPC)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(TWorkWin)operator(.)ident(LoadBoolStr)operator(:) ident(Boolean)operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) - ident(FileName)operator(:) reserved(string)operator(;) - ident(i)operator(,) ident(p)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(True)operator(;) - - ident(AddHint)operator(()stringoperator(\))operator(;) - - ident(FileName) operator(:=) ident(PlutoDir) operator(+) ident(BoolStrFileName)operator(;) - reserved(if) reserved(not) ident(FileEx)operator(()ident(FileName)operator(\)) reserved(then) reserved(begin) - ident(AddToLastHint)operator(()stringoperator(\))operator(;) - ident(AddHint)operator(()ident(FileName)operator(\))operator(;) - ident(Result) operator(:=) ident(False)operator(;) - reserved(end) reserved(else) reserved(begin) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - reserved(try) - ident(SL)operator(.)ident(LoadFromFile)operator(()ident(FileName)operator(\))operator(;) - ident(DeleteCommentLines)operator(()ident(SL)operator(\))operator(;) - ident(BoolStr) operator(:=) reserved(nil)operator(;) - ident(SetLength)operator(()ident(BoolStr)operator(,) ident(SL)operator(.)ident(Count)operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - comment(//Split the string by the '|'-sign) - ident(p) operator(:=) ident(Pos)operator(()charoperator(,) ident(SL)operator([)ident(i)operator(])operator(\))operator(;) - ident(BoolStr)operator([)ident(i)operator(])operator([)ident(False)operator(]) operator(:=) ident(Copy)operator(()ident(SL)operator([)ident(i)operator(])operator(,) integer(1)operator(,) ident(p)operator(-)integer(1)operator(\))operator(;) - ident(BoolStr)operator([)ident(i)operator(])operator([)ident(True)operator(]) operator(:=) ident(Copy)operator(()ident(SL)operator([)ident(i)operator(])operator(,) ident(p)operator(+)integer(1)operator(,) ident(Length)operator(()ident(SL)operator([)ident(i)operator(])operator(\)) operator(-) ident(p)operator(\))operator(;) - reserved(end)operator(;) - reserved(finally) - ident(SL)operator(.)ident(Free)operator(;) - ident(AddToLastHint)operator(()stringoperator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TWorkWin)operator(.)ident(LoadSisyFilter)operator(:) ident(Boolean)operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) - ident(FileName)operator(:) reserved(string)operator(;) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(True)operator(;) - - ident(FileName) operator(:=) ident(PlutoDir) operator(+) ident(SisyFilterFileName)operator(;) - reserved(if) reserved(not) ident(FileEx)operator(()ident(FileName)operator(\)) reserved(then) - ident(Result) operator(:=) ident(False) - reserved(else) reserved(begin) - ident(AddHint)operator(()stringoperator(\))operator(;) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - reserved(try) - ident(SL)operator(.)ident(LoadFromFile)operator(()ident(FileName)operator(\))operator(;) - ident(DeleteCommentLines)operator(()ident(SL)operator(,) charoperator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) - ident(SL)operator([)ident(i)operator(]) operator(:=) ident(TrimLeft)operator(()ident(SL)operator([)ident(i)operator(])operator(\))operator(;) - - ident(SisyFilter)operator(.)ident(Clear)operator(;) - ident(SisyFilter)operator(.)ident(AddStrings)operator(()ident(SL)operator(\))operator(;) - reserved(finally) - ident(SL)operator(.)ident(Free)operator(;) - ident(AddToLastHint)operator(()stringoperator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVGetSelectedIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) -reserved(begin) - ident(Node)operator(.)ident(SelectedIndex) operator(:=) ident(Node)operator(.)ident(ImageIndex)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) - ident(Path)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Node) operator(:=) ident(SisyTV)operator(.)ident(Selected)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Path) operator(:=) ident(RootOfNode)operator(()ident(Node)operator(\))operator(.)ident(Text)operator(;) - - reserved(if) ident(Node)operator(.)ident(Level) operator(>) integer(0) reserved(then) reserved(begin) - reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(2) reserved(then) - ident(Node) operator(:=) ident(Node)operator(.)ident(Parent)operator(;) - reserved(if) ident(Node)operator(.)ident(HasChildren) reserved(then) - ident(Path) operator(:=) ident(Path) operator(+) string operator(+) ident(Node)operator(.)ident(Text) comment(//Value) - reserved(else) - ident(Path) operator(:=) ident(Path) operator(+) char operator(+) ident(Node)operator(.)ident(Text) comment(//SubKey) - reserved(end)operator(;) - - ident(MainWin)operator(.)ident(GotoKey)operator(()ident(Path)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(DeleteChange)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) -reserved(var) - ident(SubNode)operator(:) ident(TTreeNode)operator(;) - - reserved(procedure) ident(FreeSisyChangeNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) - reserved(begin) - reserved(try) - reserved(with) operator(()ident(TObject)operator(()ident(Node)operator(.)ident(Data)operator(\)) reserved(as) ident(TSisyChange)operator(\)) reserved(do) - ident(Free)operator(;) - reserved(except) - ident(ReportFmt)operator(()stringoperator(,) stringoperator(,) operator([)ident(Node)operator(.)ident(Text)operator(])operator(\))operator(;) - reserved(end)operator(;) - - ident(Node)operator(.)ident(Delete)operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(2) reserved(then) - ident(Node) operator(:=) ident(Node)operator(.)ident(Parent)operator(;) - - reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(0) reserved(then) reserved(begin) - ident(SisyTV)operator(.)ident(Selected) operator(:=) ident(GetNextBest)operator(()ident(RootOfNode)operator(()ident(Node)operator(\))operator(\))operator(;) - ident(SubNode) operator(:=) ident(Node)operator(.)ident(GetFirstChild)operator(;) - reserved(while) ident(Assigned)operator(()ident(SubNode)operator(\)) reserved(do) reserved(begin) - ident(FreeSisyChangeNode)operator(()ident(SubNode)operator(\))operator(;) - ident(SubNode) operator(:=) ident(Node)operator(.)ident(GetFirstChild)operator(;) reserved(end)operator(;) - ident(Node)operator(.)ident(Delete)operator(;) - reserved(end) reserved(else) reserved(begin) - ident(SisyTV)operator(.)ident(Selected) operator(:=) ident(GetNextBest)operator(()ident(Node)operator(\))operator(;) - ident(FreeSisyChangeNode)operator(()ident(Node)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(DeactivateChange)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) -reserved(begin) - ident(Node) operator(:=) ident(RootOfNode)operator(()ident(Node)operator(\))operator(;) - - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(SisyChangeActivated)operator(()ident(Node)operator(\)) reserved(then) reserved(begin) - ident(SetSisyChangeState)operator(()ident(Node)operator(,) ident(False)operator(\))operator(;) - ident(Node)operator(.)ident(Cut) operator(:=) ident(True)operator(;) - reserved(end) reserved(else) reserved(begin) - ident(SetSisyChangeState)operator(()ident(Node)operator(,) ident(True)operator(\))operator(;) - ident(Node)operator(.)ident(Cut) operator(:=) ident(False)operator(;) - reserved(end)operator(;) - ident(SisyTV)operator(.)ident(Repaint)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(CopySelectedChangeName)operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) -reserved(begin) - ident(Node) operator(:=) ident(SisyTV)operator(.)ident(Selected)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(Node)operator(.)ident(Text)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) -reserved(begin) - ident(Node) operator(:=) ident(RootOfNode)operator(()ident(SisyTV)operator(.)ident(Selected)operator(\))operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - comment({if Key = VK_RETURN then - SisyTVDblCLick(Sender\); - - if Key = VK_DELETE then - if (ssCtrl in Shift\) and (Key = VK_DELETE\) then - DeactivateChange(Node\) - else - DeleteChange(Node\); - - if (ssCtrl in Shift\) and (Char(Key\) = 'C'\) then - CopySelectedChangeName;}) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(Started) reserved(then) - ident(Exit)operator(;) - - reserved(with) ident(TCheckBox)operator(()ident(Sender)operator(\))operator(,) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(Tag)operator(])operator(\)) reserved(do) reserved(begin) - reserved(if) ident(Checked) reserved(then) - ident(Resume) - reserved(else) - ident(Suspend)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(CurValueEEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CurValueE)operator(.)ident(Text) operator(:=) ident(RealValueName)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\))operator(;) - ident(CurValueE)operator(.)ident(SelectAll)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(CurValueEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) - - reserved(procedure) ident(RenameValue)operator(()ident(NewName)operator(:) reserved(string)operator(\))operator(;) - reserved(var) - ident(Item)operator(:) ident(TListItem)operator(;) - reserved(begin) - ident(Item) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) - reserved(if) ident(ValuesWin)operator(.)ident(TryRenameValue)operator(()ident(CurKey)operator(.)ident(Value)operator(,) ident(NewName)operator(\)) reserved(then) - ident(SetRealValueName)operator(()ident(Item)operator(,) ident(NewName)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) ident(Key) operator(=) ident(VK_RETURN) reserved(then) reserved(begin) - ident(SpyThread)operator(.)ident(Suspend)operator(;) - reserved(try) - ident(RenameValue)operator(()ident(CurValueE)operator(.)ident(Text)operator(\))operator(;) - ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Self)operator(\))operator(;) - ident(FocusControl)operator(()ident(CurValueE)operator(\))operator(;) - reserved(finally) - ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) - ident(SpyThread)operator(.)ident(Resume)operator(;) - reserved(end)operator(;) - ident(Key) operator(:=) integer(0)operator(;) - comment(//CurValueE.SelectAll;) - reserved(end) reserved(else) reserved(if) ident(Key) operator(=) ident(VK_ESCAPE) reserved(then) reserved(begin) - ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Self)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(BinaryHMLineChange)operator(()ident(NewLine)operator(:) ident(Cardinal)operator(\))operator(;) -reserved(begin) - ident(OffsetHE)operator(.)ident(Value) operator(:=) ident(BinaryHM)operator(.)ident(Pos)operator(;) - comment(// BinaryAsIntL.Value := Integer(BinaryHM.CurentCard\);) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(OffsetHEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(BinaryHM)operator(.)ident(Pos) operator(:=) ident(OffsetHE)operator(.)ident(Value)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SpyDelayIEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Assigned)operator(()ident(SpyThread)operator(\)) reserved(then) - ident(SpyThread)operator(.)ident(Delay) operator(:=) ident(SpyDelayIE)operator(.)ident(Value)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVExpanded)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Node)operator(.)ident(ImageIndex) operator(=) integer(8) reserved(then) - ident(Node)operator(.)ident(ImageIndex) operator(:=) integer(7)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ClearChanges)operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) -reserved(begin) - reserved(with) ident(SisyTV)operator(.)ident(Items) reserved(do) reserved(begin) - ident(Node) operator(:=) ident(GetFirstNode)operator(;) - reserved(while) ident(Assigned)operator(()ident(Node)operator(\)) reserved(do) reserved(begin) - ident(DeleteChange)operator(()ident(Node)operator(\))operator(;) - ident(Node) operator(:=) ident(GetFirstNode)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ClearChangesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) ident(mrOK) operator(<>) ident(MessageDlg)operator(()stringoperator(,) - ident(mtWarning)operator(,) operator([)ident(mbOK)operator(,) ident(mbCancel)operator(])operator(,) integer(0)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(ClearChanges)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(FilterChangesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(NotePad)operator(()ident(PlutoDir) operator(+) ident(SisyFilterFileName)operator(\))operator(;) - ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) - stringoperator(\))operator(;) - ident(LoadSisyFilter)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(KeySelected)operator(:) ident(Boolean)operator(;) - ident(Node)operator(:) ident(TTreeNode)operator(;) -reserved(begin) - ident(Node) operator(:=) ident(SisyTV)operator(.)ident(Selected)operator(;) - ident(KeySelected) operator(:=) ident(Assigned)operator(()ident(Node)operator(\))operator(;) - - ident(SisyGoToKeyMI)operator(.)ident(Enabled) operator(:=) ident(KeySelected)operator(;) - ident(SisyDeleteChangeMI)operator(.)ident(Enabled) operator(:=) ident(KeySelected)operator(;) - ident(SisyActivateChangeMI)operator(.)ident(Enabled) operator(:=) ident(KeySelected)operator(;) - ident(SisyCopyPathMI)operator(.)ident(Enabled) operator(:=) ident(KeySelected)operator(;) - reserved(if) reserved(not) ident(KeySelected) reserved(then) - ident(Exit)operator(;) - - ident(SisyActivateChangeMI)operator(.)ident(Checked) operator(:=) ident(SisyChangeActivated)operator(()ident(RootOfNode)operator(()ident(Node)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyActivateChangeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(DeactivateChange)operator(()ident(SisyTV)operator(.)ident(Selected)operator(\)) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyDeleteChangeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(DeleteChange)operator(()ident(SisyTV)operator(.)ident(Selected)operator(\)) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyCopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CopySelectedChangeName)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(FileMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(s)operator(:) reserved(string)operator(;) -reserved(begin) - reserved(with) ident(FileOpenD) reserved(do) reserved(begin) - ident(s) operator(:=) ident(ExtractPath)operator(()ident(StringE)operator(.)ident(Text)operator(\))operator(;) - reserved(if) ident(s) operator(<>) string reserved(then) - ident(InitialDir) operator(:=) ident(s) - reserved(else) - ident(InitialDir) operator(:=) ident(MyDir)operator(;) - - ident(s) operator(:=) ident(ExtractFileName)operator(()ident(StringE)operator(.)ident(Text)operator(\))operator(;) - ident(s) operator(:=) ident(DeleteChars)operator(()ident(s)operator(,) charoperator(\))operator(;) - reserved(if) ident(s) operator(<>) string reserved(then) - ident(FileName) operator(:=) ident(s)operator(;) - - reserved(if) ident(Execute) reserved(then) - ident(StringE)operator(.)ident(Text) operator(:=) ident(FileName)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ExternalEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(FileName)operator(:) reserved(string)operator(;) -reserved(begin) - ident(FileName) operator(:=) ident(TempDir) operator(+) char operator(+) ident(DeleteChars)operator(()ident(CurValueE)operator(.)ident(Text)operator(,) ident(FileNameEnemies)operator(\)) operator(+) - stringoperator(;) - reserved(if) ident(SaveByteA)operator(()ident(BinaryHM)operator(.)ident(Data)operator(,) ident(FileName)operator(\)) reserved(then) - ident(ExecFileWith)operator(()ident(PrefWin)operator(.)ident(ExternalHexEditE)operator(.)ident(Text)operator(,) ident(FileName)operator(\)) - reserved(else) - ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) ident(FileName)operator(\))operator(;) - - ident(PipelineThread)operator(.)ident(FileName) operator(:=) ident(FileName)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(LoadExternalBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(FileName)operator(:) reserved(string)operator(;) - ident(Data)operator(:) ident(TByteA)operator(;) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Data) operator(:=) reserved(nil)operator(;) - - ident(FileName) operator(:=) ident(TempDir) operator(+) char operator(+) ident(CurValueE)operator(.)ident(Text) operator(+) stringoperator(;) - reserved(if) reserved(not) ident(FileEx)operator(()ident(FileName)operator(\)) reserved(then) reserved(begin) - comment({ShowMessage('File not found:' + EOL + - FileName\);}) - ident(Exit)operator(;) - reserved(end)operator(;) - - ident(Data) operator(:=) ident(LoadByteA)operator(()ident(FileName)operator(\))operator(;) - reserved(if) ident(Length)operator(()ident(Data)operator(\)) operator(=) ident(Length)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\)) reserved(then) reserved(begin) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Data)operator(\)) reserved(do) - reserved(if) ident(Data)operator([)ident(i)operator(]) operator(<>) ident(BinaryHM)operator(.)ident(Data)operator([)ident(i)operator(]) reserved(then) reserved(begin) - ident(BinaryHM)operator(.)ident(Data) operator(:=) ident(Data)operator(;) - ident(Exit)operator(;) - reserved(end)operator(;) - reserved(end) reserved(else) - ident(BinaryHM)operator(.)ident(Data) operator(:=) ident(Data)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(PipelineCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(PipelineThread)operator(,) ident(PipelineCB) reserved(do) - reserved(if) ident(Checked) reserved(then) reserved(begin) - reserved(if) ident(Suspended) reserved(then) - ident(Resume)operator(;) - reserved(end) reserved(else) - reserved(if) reserved(not) ident(Suspended) reserved(then) - ident(Suspend)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ReloadBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Self)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(BinaryHMEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(PipelineCB)operator(.)ident(Checked) operator(:=) ident(False)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(xUseExtendedModelCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(PrefWin)operator(.)ident(UseExtendedModelCB)operator(.)ident(Load)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SeparatorEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(if) reserved(not) ident(SeparatorE)operator(.)ident(Enabled) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(SeparatorE)operator(.)ident(Text) operator(=) string reserved(then) reserved(begin) - reserved(if) ident(StringE)operator(.)ident(Text) operator(=) string reserved(then) - ident(Exit) - reserved(else) - ident(MultiStringM)operator(.)ident(Text) operator(:=) ident(StringE)operator(.)ident(Text)operator(;) - ident(MultiStringTypeRG)operator(.)ident(Buttons)operator([)integer(1)operator(])operator(.)ident(Enabled) operator(:=) ident(False)operator(;) - ident(MultiStringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) - reserved(end) reserved(else) reserved(begin) - reserved(if) ident(StringE)operator(.)ident(Text) operator(=) string reserved(then) - ident(StringE)operator(.)ident(Text) operator(:=) ident(Join)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(,) ident(SeparatorE)operator(.)ident(Text)operator(\))operator(;) - ident(MultiStringTypeRG)operator(.)ident(Buttons)operator([)integer(1)operator(])operator(.)ident(Enabled) operator(:=) ident(True)operator(;) - ident(MultiStringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(1)operator(;) - ident(Split)operator(()ident(StringE)operator(.)ident(Text)operator(,) ident(SeparatorE)operator(.)ident(Text)operator(,) ident(MultiStringM)operator(.)ident(Lines)operator(,) ident(False)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(HintLBKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) operator(()ident(Key) operator(=) ident(Byte)operator(()charoperator(\))operator(\)) reserved(and) operator(()ident(ssCtrl) reserved(in) ident(Shift)operator(\)) reserved(then) - reserved(with) ident(HintLb) reserved(do) - reserved(if) ident(ItemIndex) operator(>=) integer(0) reserved(then) - ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(Items)operator([)ident(ItemIndex)operator(])operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(DWORDSpecialBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(CardinalE)operator(.)ident(Value) operator(:=) ident(StrToIntDef)operator(()operator(()ident(Sender) reserved(as) ident(TButton)operator(\))operator(.)ident(Caption)operator(,) integer(0)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(Button1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(ShowPC)operator(.)ident(SelectNextPage)operator(()ident(True)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(SisyPU)operator(,) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(PopupComponent)operator(.)ident(Tag)operator(])operator(\)) reserved(do) - ident(Items)operator([)ident(Integer)operator(()ident(Priority)operator(\))operator(])operator(.)ident(Checked) operator(:=) ident(True)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyPriorityMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(SisyPU)operator(.)ident(PopupComponent)operator(.)ident(Tag)operator(])operator(\)) reserved(do) reserved(begin) - ident(Priority) operator(:=) ident(TThreadPriority)operator(()ident(TMenuItem)operator(()ident(Sender)operator(\))operator(.)ident(MenuIndex)operator(\))operator(;) - reserved(if) ident(Priority) operator(<=) ident(tpNormal) reserved(then) - ident(Uni)operator(.)ident(WriteInteger)operator(()stringoperator(,) ident(Integer)operator(()ident(Priority)operator(\))operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyShowCurrentPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - reserved(with) ident(SisyPU)operator(,) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(PopupComponent)operator(.)ident(Tag)operator(])operator(\)) reserved(do) reserved(begin) - ident(Suspend)operator(;) - ident(ShowMessage)operator(()ident(CurrentSpyKey)operator(.)ident(Path)operator(\))operator(;) - ident(Resume)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(DropFileTargetDrop)operator(()ident(Sender)operator(:) ident(TObject)operator(;) - ident(ShiftState)operator(:) ident(TShiftState)operator(;) ident(Point)operator(:) ident(TPoint)operator(;) reserved(var) ident(Effect)operator(:) ident(Integer)operator(\))operator(;) -reserved(begin) - ident(StringE)operator(.)ident(Text) operator(:=) ident(DropFileTarget)operator(.)ident(Files)operator([)integer(0)operator(])operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\))operator(;) -reserved(begin) -comment(// Action := caNone;) - ident(DropFileTarget)operator(.)ident(Unregister)operator(;) - ident(ClearChanges)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(FormResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(begin) - ident(Realign)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(IconImageDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(Filename)operator(:) reserved(string)operator(;) -reserved(begin) - ident(FileName) operator(:=) ident(GetFileNew)operator(()ident(StringE)operator(.)ident(Text)operator(\))operator(;) - reserved(if) ident(FileName) operator(<>) string reserved(then) - ident(ExecFile)operator(()ident(FileName)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(ShowValues)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(\))operator(;) -reserved(var) - ident(MainValueName)operator(:) reserved(string)operator(;) - ident(ValueCommonType)operator(:) ident(TRegDataType)operator(;) - - reserved(procedure) ident(ShowValueAsBinary)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) - ident(Smart4BB)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(;) - reserved(begin) - reserved(if) ident(Smart4BB) - reserved(and) ident(PrefWin)operator(.)ident(Smart4BBCB)operator(.)ident(Checked) - reserved(and) operator(()ident(Reg)operator(.)ident(GetDataSize)operator(()ident(ValueName)operator(\)) operator(=) integer(4)operator(\)) reserved(then) reserved(begin) - ident(CardinalE)operator(.)ident(Value) operator(:=) ident(Reg)operator(.)ident(ReadCardinal)operator(()ident(ValueName)operator(\))operator(;) - ident(CardTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(2)operator(;) - ident(ShowPC)operator(.)ident(ActivePage) operator(:=) ident(IntPage)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - ident(BinaryHM)operator(.)ident(Data) operator(:=) ident(Reg)operator(.)ident(ReadBin)operator(()ident(ValueName)operator(\))operator(;) - ident(DataTypeComB)operator(.)ident(ItemIndex) operator(:=) ident(ValueCommonType)operator(;) - reserved(if) ident(IsValidDataType)operator(()ident(ValueCommonType)operator(\)) reserved(then) - ident(DataTypeComB)operator(.)ident(ItemIndex) operator(:=) ident(ValueCommonType) - reserved(else) reserved(begin) - ident(DataTypeComB)operator(.)ident(Text) operator(:=) ident(IntToStr)operator(()ident(ValueCommonType)operator(\))operator(;) - ident(AddHint)operator(()string operator(+) ident(DataTypeComB)operator(.)ident(Text) operator(+) string operator(+) - ident(Quote)operator(()ident(ValueName)operator(\))operator(\))operator(;) - reserved(end)operator(;) - ident(ShowPC)operator(.)ident(ActivePage) operator(:=) ident(BinaryPage)operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(with) ident(ValuesWin) reserved(do) reserved(begin) - reserved(if) reserved(not) ident(Assigned)operator(()ident(ValueNames)operator(\)) reserved(or) operator(()ident(ValueNames)operator(.)ident(Count) operator(=) integer(0)operator(\)) reserved(then) - reserved(raise) ident(EReadError)operator(.)ident(Create)operator(()stringoperator(\))operator(;) - ident(MainValueName) operator(:=) ident(ValueNames)operator([)integer(0)operator(])operator(;) - reserved(end)operator(;) - ident(ValueCommonType) operator(:=) ident(ValuesWin)operator(.)ident(ValueCommonType)operator(;) - - reserved(with) ident(CurValueE) reserved(do) reserved(begin) - ident(Enabled) operator(:=) ident(True)operator(;) - reserved(if) ident(ValuesWin)operator(.)ident(ValueNames)operator(.)ident(Count) operator(=) integer(1) reserved(then) - ident(Text) operator(:=) ident(MainValueName) - reserved(else) - ident(Text) operator(:=) ident(Copy)operator(()ident(ValuesWin)operator(.)ident(ValueNames)operator(.)ident(CommaText)operator(,) integer(1)operator(,) integer(255)operator(\))operator(;) - - ident(Font)operator(.)ident(Color) operator(:=) ident(ColorOfDataType)operator(()ident(ValueCommonType)operator(\))operator(;) - reserved(end)operator(;) - - reserved(if) ident(KeyIsDown)operator(()ident(VK_MENU)operator(\)) reserved(or) ident(ShowAsBinary) reserved(then) reserved(begin) - ident(ShowValueAsBinary)operator(()ident(MainValueName)operator(,) ident(False)operator(\))operator(;) - reserved(end) reserved(else) reserved(if) ident(ValueCommonType) reserved(in) ident(rdStringTypes) reserved(then) reserved(begin) - ident(StringE)operator(.)ident(Text) operator(:=) ident(Reg)operator(.)ident(ReadString)operator(()ident(MainValueName)operator(\))operator(;) - reserved(case) ident(ValueCommonType) reserved(of) - ident(rdString)operator(:) ident(StringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) - ident(rdExpandString)operator(:) ident(StringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(1)operator(;) - reserved(end)operator(;) - ident(ShowPC)operator(.)ident(ActivePage) operator(:=) ident(StringPage)operator(;) - reserved(end) reserved(else) reserved(if) ident(ValueCommonType) reserved(in) ident(rdCardTypes) reserved(then) reserved(begin) - ident(CardinalE)operator(.)ident(Value) operator(:=) ident(Reg)operator(.)ident(ReadCardinal)operator(()ident(MainValueName)operator(\))operator(;) - reserved(case) ident(ValueCommonType) reserved(of) - ident(rdCardinal)operator(:) ident(StringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) - ident(rdCardBigEndian)operator(:) ident(StringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(1)operator(;) - reserved(end)operator(;) - ident(ShowPC)operator(.)ident(ActivePage) operator(:=) ident(IntPage)operator(;) - reserved(end) reserved(else) reserved(if) ident(ValueCommonType) operator(=) ident(rdMultiString) reserved(then) reserved(begin) - ident(MultiStringM)operator(.)ident(Clear)operator(;) - ident(Reg)operator(.)ident(ReadMultiString)operator(()ident(MainValueName)operator(,) ident(MultiStringM)operator(.)ident(Lines)operator(,) ident(PrefWin)operator(.)ident(UseExtendedModelCB)operator(.)ident(Checked)operator(\))operator(;) - ident(SeparatorEChange)operator(()ident(Self)operator(\))operator(;) - ident(MultiStringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) - ident(ShowPC)operator(.)ident(ActivePage) operator(:=) ident(MultiStringPage)operator(;) - reserved(end) reserved(else) reserved(begin) - ident(ShowValueAsBinary)operator(()ident(MainValueName)operator(\))operator(;) - reserved(end)operator(;) - - ident(ShowAsBinary) operator(:=) ident(False)operator(;) - - ident(UpdateWriteButtons)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(UpdateWriteButtons)operator(;) -reserved(const) - ident(BtnTextOfMultiEdit)operator(:) reserved(array)operator([)ident(Boolean)operator(]) reserved(of) reserved(string) operator(=) operator(()stringoperator(,) stringoperator(\))operator(;) -reserved(var) - ident(BtnText)operator(:) reserved(string)operator(;) -reserved(begin) - ident(BtnText) operator(:=) ident(BtnTextOfMultiEdit)operator([)ident(ValuesWin)operator(.)ident(ValueNames)operator(.)ident(Count) operator(>) integer(1)operator(])operator(;) - ident(OKStringB)operator(.)ident(Caption) operator(:=) ident(BtnText)operator(;) - ident(OKIntB)operator(.)ident(Caption) operator(:=) ident(BtnText)operator(;) - ident(OKMultiStringB)operator(.)ident(Caption) operator(:=) ident(BtnText)operator(;) - ident(OKBinaryB)operator(.)ident(Caption) operator(:=) ident(BtnText)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(EditData)operator(;) -reserved(begin) - ident(AddHint)operator(()stringoperator(\))operator(;) - ident(MainPC)operator(.)ident(ActivePage) operator(:=) ident(WorkPage)operator(;) - - reserved(with) ident(ShowPC) reserved(do) - reserved(if) ident(ActivePage) operator(=) reserved(nil) reserved(then) - ident(Exit) - reserved(else) reserved(if) ident(ActivePage) operator(=) ident(WorkWin)operator(.)ident(StringPage) reserved(then) reserved(begin) - ident(FocusControl)operator(()ident(StringE)operator(\))operator(;) - ident(StringE)operator(.)ident(SelectAll)operator(;) - reserved(end) - reserved(else) reserved(if) ident(ActivePage) operator(=) ident(WorkWin)operator(.)ident(IntPage) reserved(then) - ident(FocusControl)operator(()ident(CardinalE)operator(\)) - reserved(else) reserved(if) ident(ActivePage) operator(=) ident(WorkWin)operator(.)ident(MultiStringPage) reserved(then) - ident(FocusControl)operator(()ident(MultiStringM)operator(\)) - reserved(else) reserved(if) ident(ActivePage) operator(=) ident(WorkWin)operator(.)ident(BinaryPage) reserved(then) - ident(FocusControl)operator(()ident(BinaryHM)operator(\)) - reserved(else) - ident(ShowMessage)operator(()stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) - ident(Node)operator(:) ident(TTreeNode)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\))operator(;) -reserved(begin) - reserved(with) ident(TTreeView)operator(()ident(Sender)operator(\))operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) - reserved(if) ident(Node)operator(.)ident(Cut) reserved(then) - ident(Color) operator(:=) hex($AAAAAA) - reserved(else) - ident(Color) operator(:=) ident(clWhite)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\))operator(;) -reserved(var) - ident(Node)operator(:) ident(TTreeNode)operator(;) - ident(RelX)operator(,) ident(RelY)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(with) ident(SisyTV) reserved(do) reserved(begin) - ident(RelX) operator(:=) ident(ScreenToClient)operator(()ident(Mouse)operator(.)ident(CursorPos)operator(\))operator(.)ident(X)operator(;) - ident(RelY) operator(:=) ident(ScreenToClient)operator(()ident(Mouse)operator(.)ident(CursorPos)operator(\))operator(.)ident(Y)operator(;) - ident(Node) operator(:=) ident(GetNodeAt)operator(()ident(RelX)operator(,) ident(RelY)operator(\))operator(;) - reserved(end)operator(;) - reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) reserved(not) ident(Node)operator(.)ident(Selected) reserved(then) - ident(Node)operator(.)ident(Selected) operator(:=) ident(True)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(OKCryptoBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(try) - ident(OpenCurKey)operator(;) - reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - reserved(case) ident(CryptoTypeRG)operator(.)ident(ItemIndex) reserved(of) - integer(0)operator(:) ident(MainReg)operator(.)ident(WriteBin)operator(()ident(Strings)operator([)ident(i)operator(])operator(,) ident(EncodeScreenSaver)operator(()ident(CryptoE)operator(.)ident(Text)operator(\))operator(\))operator(;) - integer(1)operator(:) ident(MainReg)operator(.)ident(WriteBin)operator(()ident(Strings)operator([)ident(i)operator(])operator(,) ident(EncodeSharedFolder)operator(()ident(CryptoE)operator(.)ident(Text)operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\))operator(;) - reserved(finally) - ident(MainReg)operator(.)ident(CloseKey)operator(;) - reserved(end)operator(;) - ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TWorkWin)operator(.)ident(CryptoEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) - ident(Shift)operator(:) ident(TShiftState)operator(\))operator(;) -reserved(begin) - reserved(if) ident(Key) operator(=) ident(VK_RETURN) reserved(then) reserved(begin) - ident(OKCryptoBClick)operator(()ident(Sender)operator(\))operator(;) - ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\))operator(;) - reserved(end)operator(;) - reserved(if) ident(Key) operator(=) ident(VK_ESCAPE) reserved(then) - ident(CancelBClick)operator(()ident(Sender)operator(\))operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) diff --git a/test/scanners/delphi/pluto.in.pas b/test/scanners/delphi/pluto.in.pas deleted file mode 100644 index b7aaad7..0000000 --- a/test/scanners/delphi/pluto.in.pas +++ /dev/null @@ -1,10829 +0,0 @@ -unit FindTH; - -interface - -uses - Classes, windows, Dialogs, ComCtrls, CompEx, SysUtils, YTools, YTypes, - clock, plutoconst, StdCtrls, Masks, Forms, XReg; - -const - RegMoleVersion = '1.1'; - -type - TFindThreadProgress = (fpNone, fpEvery512th, fpEach); - - TRegFindThread = class(TThread) - private - SearchText: string; - SearchFor: TSearchOptions; - Progress: TFindThreadProgress; - FindNodeText: string; - TimeElapsed: Double; - syncIcon: Integer; - syncStatusText: string; - CurrentPath: string; - KeysScanned: Integer; - Mask: TMask; - dwordVal: DWORD; - SearchForValues: Boolean; - - procedure Find; - - //Synchronizers - procedure Start; - procedure Add; - procedure UpdateStatus; - procedure Finish; - protected - procedure Execute; override; - public - SpecialPath: string; - FindNode: TTreeNode; - ListTV: TTreeView; - ObjectsFound, KeysFound, ValuesFound, DataFound: Integer; - Ranges: TRanges; - destructor Destroy; override; - constructor CreateIt(PriorityLevel: TThreadPriority; s: string; - SearchFor: TSearchOptions; Progress: TFindThreadProgress); - end; - -implementation - -uses - ValuesU, StrUtils; - -{ TRegFindThread } - -procedure TRegFindThread.Add; -var - Node: TTreeNode; -begin - with ListTV do begin - //Items.BeginUpdate; - Node := TTreeNode.Create(Items); - SetTNImage(Node, syncIcon); - Items.AddNode(Node, FindNode, Copy(CurrentPath, 1, 255), nil, - naAddChildFirst); - if not FindNode.Expanded and (FindNode.Count = 1) then //First Node - FindNode.Expand(False); - //Items.EndUpdate; - end; -end; - -constructor TRegFindThread.CreateIt(PriorityLevel: TThreadPriority; s: string; - SearchFor: TSearchOptions; Progress: TFindThreadProgress); -begin - inherited Create(True); // Create thread suspended - Priority := PriorityLevel; // Set Priority Level - FreeOnTerminate := True; // Thread Free Itself when terminated - - SearchText := s; - Ranges := nil; - Self.SearchFor := SearchFor; - Self.Progress := Progress; -end; - -destructor TRegFindThread.Destroy; -begin - if Assigned(FindNode) then - FindNode.Data := nil; - inherited; -end; - -procedure TRegFindThread.Execute; -begin - Synchronize(Start); - Find; - Synchronize(Finish); -end; - -procedure TRegFindThread.Find; -var - SpecialKey: HKEY; - - procedure Add(const Path: string; const Icon: Integer); - var - zCurrentPath: string; - begin - zCurrentPath := CurrentPath; - - CurrentPath := Path; - syncIcon := Icon; - Synchronize(Self.Add); - - CurrentPath := zCurrentPath; - end; - - procedure AddValueName(const ValueName: string; Typ: TRegDataType); - begin - Add(CurrentPath + '\\' + ValueName, IconOfDataType(Typ)); - end; - - procedure AddValueData(const ValueName: string; Context: TRegContext); - begin - Add(CurrentPath + '\\' + ValueName + ' = ' + DataPreviewOfContext(Context), - IconOfDataType(Context.Typ)); - end; - - function FoundInStr(const Data: string): Boolean; - begin - Result := False; - if SearchText = '' then - Exit; - - if (Data = '') and not (sfWildCards in SearchFor) then - Exit; - - if sfWildCards in SearchFor then begin - if Assigned(Mask) then - Result := Mask.Matches(Data); - end else begin - {if not (sfFileNames in SearchFor) then begin - if TextBegin(SearchText, UntilChar(Data, '~')) and FileExists(Data) then - Result := SameFileName(SearchText, GetFileNew(Data)); - Exit; - end; } - - if [sfParts, sfIgnoreCase] <= SearchFor then - if SfUseLocales in SearchFor then - Result := 0= SizeOf(Cardinal)) and - (dwordVal = PCardinal(Copy(Data, 1, SizeOf(Cardinal)))^) then begin - Inc(DataFound); - AddValueData(ValueName, - RegContext(Typ, ByteAOfStr(Data))); - end; - end; - - else - if sfOtherTypes in SearchFor then begin - if FoundInStr(Data) then begin - Inc(DataFound); - AddValueData(ValueName, - RegContext(Typ, ByteAOfStr(Data))); - end; - end; - end; - end; - - begin - MaxLen := Info.MaxValueLen + 1; //Include Nullbyte - - Buffer := nil; - if sfValueData in SearchFor then - GetMem(Buffer, Info.MaxDataLen); - - GetMem(ValueName, MaxLen); - for i := 0 to Info.NumValues-1 do begin - NameLen := MaxLen; - Len := Info.MaxDataLen; - if not Success(RegEnumValue(Key, i, ValueName, NameLen, nil, @Typ, - Buffer, @Len)) then - Continue; - - if sfValueNames in SearchFor then - if FoundInStr(ValueName) then begin - Inc(ValuesFound); - AddValueName(ValueName, Typ); - end; - - if sfValueData in SearchFor then - ScanValue(ValueName, Typ, string(Copy(TByteA(Buffer), 0, Len))); - end; - - FreeMem(ValueName, MaxLen); - if sfValueData in SearchFor then - FreeMem(Buffer, Info.MaxDataLen); - end; - - procedure ScanKey(Key: HKEY; const KeyName: string = ''); - var - p: PChar; - i, z: Integer; - l, Len: DWORD; - NewKey: HKEY; - Info: TRegKeyInfo; - begin - if Terminated then Exit; - - Inc(KeysScanned); - if Progress <> fpNone then - if (Progress = fpEach) or - ((Progress = fpEvery512th) and ((KeysScanned and $1FF) = 0)) then begin - syncStatusText := '(' + IntToStr(KeysScanned) + ' k) ' + CurrentPath; - Synchronize(UpdateStatus); - end; - - with Info do - if not Success(RegQueryInfoKey(Key, nil, nil, nil, @NumSubKeys, - @MaxSubKeyLen, nil, @NumValues, @MaxValueLen, @MaxDataLen, - nil, nil)) then - Exit; - - if (Info.NumValues > 0) and SearchForValues then - ScanValues(Key, Info); - - if Info.NumSubKeys <= 0 then - Exit; - - Len := Info.MaxSubKeyLen + 1; - GetMem(p, Len); - - for i := 0 to Info.NumSubKeys-1 do begin - l := Len; - RegEnumKeyEx(Key, i, p, l, nil, nil, nil, nil); - if sfKeys in SearchFor then - if FoundInStr(p) then begin - Inc(KeysFound); - Add(CurrentPath + '\' + p, iconKeyMiddle); - end; - - if Success(RegOpenKey(Key, p, NewKey)) then begin - z := Length(CurrentPath); - CurrentPath := CurrentPath + '\' + p; - - try - ScanKey(NewKey, p); - finally - RegCloseKey(NewKey); - end; - - SetLength(CurrentPath, z); - end; - - if Terminated then Break; - end; - - FreeMem(p, Len); - end; - -begin - with TClock.Create do begin - FindNode.Text := FindNodeText + ': '; - - try - if sfHKU in SearchFor then begin - CurrentPath := 'HKU'; - ScanKey(HKEY_USERS); - end; - if sfHKLM in SearchFor then begin - CurrentPath := 'HKLM'; - ScanKey(HKEY_LOCAL_MACHINE); - end; - if sfHKDD in SearchFor then begin - CurrentPath := 'HKDD'; - ScanKey(HKEY_DYN_DATA); - end; - - if SpecialPath <> '' then begin - if Success(RegOpenKey(HKEYOfStr(ExRegRoot(SpecialPath)), - PChar(ExRegKey(SpecialPath)), SpecialKey)) then begin - CurrentPath := LWPSolve(SpecialPath); - ScanKey(SpecialKey); - RegCloseKey(SpecialKey); - end else - ShowMessage('Could not open' + EOL + - Quote(SpecialPath)); - end; - except - syncStatusText := '(' + IntToStr(KeysScanned) + ' k) ' + CurrentPath + - 'Error --> Terminated.'; - Synchronize(UpdateStatus); - Sleep(1000); - end; - - TimeElapsed := SecondsPassed; - Free; end; -end; - -function StrOfSearchOptions(const Options: TSearchOptions): string; - - procedure Add(const s: string); - begin - Result := Result + s; - end; - - procedure AddOption(const Option: string; const Flag: TSearchVar; - const Optional: Boolean = False); - begin - if Flag in Options then - Add(Option) - else - if not Optional then - Add('^' + Option); - end; - -begin - Result := ''; - - Add('['); - AddOption('H', sfAsHex, True); - AddOption('W ', sfWildcards, True); - - AddOption('C', sfIgnoreCase); - AddOption('L', sfUseLocales); - AddOption('P ', sfParts); - - AddOption('K', sfKeys); - AddOption('N', sfValueNames); - AddOption('D ', sfValueData); - - AddOption('S', sfString); - AddOption('D', sfDWORD); - AddOption('O', sfOtherTypes); - AddOption('?', sfSpecialTypes); - - Add('] ['); - - if [sfHKU, sfHKLM, sfHKDD] <= Options then - Add('ALL') - else begin - AddOption('HKU ', sfHKU, True); - AddOption('HKLM ', sfHKLM, True); - AddOption('HKDD ', sfHKDD, True); - Result := TrimRight(Result); - end; - - Add(']'); -end; - -procedure TRegFindThread.Start; -begin - Mask := nil; - KeysFound := 0; - ValuesFound := 0; - DataFound := 0; - KeysScanned := 0; - - //Prepare for options - if sfAsHex in SearchFor then begin - SearchText := string(ByteAOfHex(SearchText)); - SearchFor := SearchFor - [sfDWord, sfIgnoreCase]; - end else begin - if SfUseLocales in SearchFor then - SearchText := AnsiLowerCase(SearchText); - - dwordVal := 0; - if sfDWord in SearchFor then - if IsValidInteger(SearchText) then - dwordVal := StrToInt(SearchText) - else - Exclude(SearchFor, sfDWord); - - if sfWildCards in SearchFor then - try - Mask := TMask.Create(SearchText); - except - Mask.Free; - Mask := nil; - end; - end; - - SearchForValues := (sfValueNames in SearchFor) - or (sfValueData in SearchFor); - - FindNodeText := 'Find ' + Quote(FriendlyStr(SearchText)) + ' ' + - StrOfSearchOptions(SearchFor); - - with ListTV.Items do begin - BeginUpdate; - FindNode := AddChildObject(nil, FindNodeText + '...', nil); - FindNode.Data := Self; - SetTNImage(FindNode, iconHostReg); - EndUpdate; - end; -end; - -procedure TRegFindThread.UpdateStatus; -begin - FindNode.Text := FindNodeText + ' ' + syncStatusText; -end; - -procedure TRegFindThread.Finish; -var - Found: string; -begin - ObjectsFound := KeysFound + ValuesFound + DataFound; - - Found := StrNumerus(ObjectsFound, 'object', 'objects', 'No'); - if ObjectsFound < 2 then - Found := Found + ' found.' - else begin - Found := Found + ' found: '; - if KeysFound > 0 then - Found := Found + StrNumerus(KeysFound, 'KeyName, ', 'KeyNames, ', 'No'); - if ValuesFound > 0 then - Found := Found + StrNumerus(ValuesFound, 'ValueName, ', 'ValueNames, ', - 'No'); - if DataFound > 0 then - Found := Found + StrNumerus(DataFound, 'Data', 'Datas', 'No'); - - if RightStr(Found, 2) = ', ' then - Delete(Found, Length(Found) - 1, 2); - end; - - FindNode.Text := FindNodeText + Format(' OK (%0.1f s) %s', - [TimeElapsed, Found]); -end; - -end. -unit FindWinU; - -interface - -uses - Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, - ComCtrls, StdCtrls, ExtCtrls, Clipbrd, NewPanels, plutoconst, FindTH, YTools, - PrefTools, Menus, XReg, RangeEdit; - -type - TFindWin = class(TForm) - ListTV: TTreeView; - FindP: TPanel; - FindE: TEdit; - ColorPanel1: TColorPanel; - ResultsPopup: TPopupMenu; - Copy1: TMenuItem; - ColorPanel2: TColorPanel; - FindPrefP: TPanel; - CommonGB: TGroupBox; - Label4: TLabel; - SfWildCardsCB: TCheckBox; - SfPartsCB: TCheckBox; - SfIgnoreCaseCB: TCheckBox; - SfAsHexCB: TCheckBox; - SfAsDWord: TCheckBox; - SfUseLocalesCB: TCheckBox; - FindGB: TGroupBox; - SfHKUCB: TCheckBox; - SfHKLMCB: TCheckBox; - SfHKDDCB: TCheckBox; - SfRootKeyRB: TRadioButton; - SfCurKeyRB: TRadioButton; - SfCLSIDCB: TCheckBox; - SfInterfaceCB: TCheckBox; - SfKeysCb: TCheckBox; - SfValuesCB: TCheckBox; - SfDataCB: TCheckBox; - SfStringCB: TCheckBox; - SfOtherCB: TCheckBox; - SfDWordCB: TCheckBox; - Panel2: TPanel; - GroupBox1: TGroupBox; - Label1: TLabel; - ThreadPriorityComB: TComboBox; - ProgressRG: TRadioGroup; - Panel5: TPanel; - BorderPanel1: TBorderPanel; - MoleLogoI: TImage; - TypeRangeE: TRangeEdit; - SfTypesCB: TCheckBox; - Panel1: TPanel; - TransparentCB: TPrefCheckBox; - StayOnTopCB: TPrefCheckBox; - FindB: TButton; - FindPrefB: TButton; - procedure FindBClick(Sender: TObject); - procedure ListTVKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure FindEKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure ActivateIt(Sender: TObject); - procedure DeActivateIt(Sender: TObject); - procedure FormDeactivate(Sender: TObject); - procedure FormActivate(Sender: TObject); - procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure SfWildCardsCBClick(Sender: TObject); - procedure StayOnTopCBClick(Sender: TObject); - procedure SfRootKeysUpdate(Sender: TObject); - procedure FindPrefBClick(Sender: TObject); - - procedure CloseFindPrefP; - procedure OpenFindPrefP; - procedure FindEChange(Sender: TObject); - procedure SfDataCBClick(Sender: TObject); - procedure ListTVDblClick(Sender: TObject); - procedure SfAsHexCBClick(Sender: TObject); - procedure Copy1Click(Sender: TObject); - procedure SfIgnoreCaseCBClick(Sender: TObject); - procedure FormCreate(Sender: TObject); - procedure FormShow(Sender: TObject); - procedure SfTypesCBClick(Sender: TObject); - end; - -const - fpbOpen = 0; - fpbCloseCaption = 'Params &<<'; - - fpbClosed = 1; - fpbOpenCaption = 'Params &>>'; - -var - FindWin: TFindWin; - -implementation - -uses plutomain, PrefU, ValuesU; - -{$R *.DFM} - -procedure TFindWin.FindBClick(Sender: TObject); -var - SearchFor: TSearchOptions; - FindThread: TRegFindThread; - - procedure AddOption(CheckBox: TCustomCheckBox; Flag: TSearchVar); - begin - with CheckBox as TCheckBox do - if Enabled and Checked then - Include(SearchFor, Flag); - end; - -begin - SearchFor := []; - - AddOption(SfKeysCB, sfKeys); - - AddOption(SfValuesCB, sfValueNames); - AddOption(SfDataCB, sfValueData); - - AddOption(SfStringCB, sfString); - AddOption(SfDWordCB, sfDWord); - AddOption(SfOtherCB, sfOtherTypes); - - if SfRootKeyRB.Checked then begin - AddOption(SfHKUCB, sfHKU); - AddOption(SfHKLMCB, sfHKLM); - AddOption(SfHKDDCB, sfHKDD); - end; - - AddOption(SfAsHexCB, sfAsHex); - AddOption(SfWildCardsCB, sfWildCards); - AddOption(SfPartsCB, sfParts); - AddOption(SfIgnoreCaseCB, sfIgnoreCase); - AddOption(SfUseLocalesCB, sfUseLocales); - - {AddOption(SfCLSIDCB, sfCLSID); - AddOption(SfInterfaceCB, sfInterface);} - - if SfTypesCB.Checked and not TypeRangeE.RangeMaximal then - Include(SearchFor, sfSpecialTypes); - - FindThread := TRegFindThread.CreateIt( - TThreadPriority(ThreadPriorityComB.ItemIndex), FindE.Text, SearchFor, - TFindThreadProgress(ProgressRG.ItemIndex)); - - FindThread.ListTV := ListTV; - - if sfSpecialTypes in SearchFor then - FindThread.Ranges := TypeRangeE.Value; - - if SfCurKeyRB.Checked then - FindThread.SpecialPath := - LWPSolve(StrOfRegPath(CurKey(uhNonSystemShortcuts))); - - FindThread.Resume; - CloseFindPrefP; -end; - -procedure TFindWin.ListTVKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -var - Node: TTreeNode; - - procedure TerminateFindThread; - var - FindThread: TRegFindThread; - begin - if (Node.Level = 0) then begin - FindThread := TRegFindThread(Node.Data); - if not Assigned(FindThread) then - Node.Delete - else - try - FindThread.Terminate; - except - Node.Text := 'Error: couldn''t terminate thread!'; - end; - end else - Node.Delete; - end; - -begin - Node := ListTV.Selected; - if not Assigned(Node) then - Exit; - - case Key of - VK_F12: if Assigned(Node.Parent) then - Node.Parent.AlphaSort; - - VK_RETURN: ListTVDblClick(Sender); - - VK_DELETE: TerminateFindThread; - end; -end; - -procedure TFindWin.FindEKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if Key = VK_RETURN then - FindBClick(Sender); - - if Key = VK_UP then begin - CloseFindPrefP; - Key := 0; - end else if Key = VK_Down then begin - OpenFindPrefP; - Key := 0; - end; -end; - -procedure TFindWin.ActivateIt(Sender: TObject); -begin - ActivateThis(Sender); -end; - -procedure TFindWin.DeActivateIt(Sender: TObject); -begin - DeActivateThis(Sender); -end; - -procedure TFindWin.FormDeactivate(Sender: TObject); -begin - if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then - DeActivateThis(ActiveControl); - - AlphaBlend := TransparentCB.Checked; -end; - -procedure TFindWin.FormActivate(Sender: TObject); -begin - if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then - ActivateThis(ActiveControl); - - AlphaBlend := False; -end; - -procedure TFindWin.FormKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if Key = VK_ESCAPE then - Close; - MainWin.FormKeyDown(Sender, Key, Shift); -end; - -procedure TFindWin.SfWildCardsCBClick(Sender: TObject); -begin - SfPartsCB.Enabled := not SfWildcardsCB.Checked; - SfIgnoreCaseCB.Enabled := not SfWildcardsCB.Checked; - SfUseLocalesCB.Enabled := SfIgnoreCaseCB.Checked and not SfWildcardsCB.Checked; -end; - -procedure TFindWin.StayOnTopCBClick(Sender: TObject); -begin - if StayOnTopCB.Checked then - FormStyle := fsStayOnTop - else - FormStyle := fsNormal; -end; - -procedure TFindWin.SfRootKeysUpdate(Sender: TObject); -begin - with SfRootKeyRB do begin - SfHKLMCB.Enabled := Checked; - SfHKUCB.Enabled := Checked; - SfHKDDCB.Enabled := Checked; - end; -end; - -procedure TFindWin.FindPrefBClick(Sender: TObject); -begin - case FindPrefB.Tag of - fpbOpen: - CloseFindPrefP; - fpbClosed: - OpenFindPrefP; - else - ShowMessage('Fehler: FindPrefB hat unbekanntes Tag'); - end; -end; - -procedure TFindWin.CloseFindPrefP; -begin - with FindPrefB do begin - Tag := fpbClosed; - Caption := fpbOpenCaption; - end; - FindPrefP.Visible := False; - ListTV.Repaint; -end; - -procedure TFindWin.OpenFindPrefP; -begin - with FindPrefB do begin - Tag := fpbOpen; - Caption := fpbCloseCaption; - end; - FindPrefP.Visible := True; - ListTV.Repaint; -end; - -procedure TFindWin.FindEChange(Sender: TObject); -begin - if IsValidInteger(FindE.Text) then - SfDWORDCB.Caption := 'D&WORD OK' - else - SfDWORDCB.Caption := 'D&WORD ??'; - - SfAsHexCB.Enabled := (FindE.Text <> '') - and not CharIn(FindE.Text, AllChars - HexadecimalChars - [' ']); - SfAsDWord.Enabled := SfAsHexCB.Enabled and (Length(TrimAll(FindE.Text)) < 8); -end; - -procedure TFindWin.SfDataCBClick(Sender: TObject); -begin - with SfDataCB do begin - SfStringCB.Enabled := Checked; - SfDWordCB.Enabled := Checked; - SfOtherCB.Enabled := Checked; - end; -end; - -procedure TFindWin.ListTVDblClick(Sender: TObject); -var - Node: TTreeNode; -begin - Node := ListTV.Selected; - if not Assigned(Node) or (Node.Level = 0) then - Exit; - - MainWin.GotoKey(UntilLastChar(Node.Text, '=')) -end; - -procedure TFindWin.SfAsHexCBClick(Sender: TObject); -begin - with SfAsHexCB do begin - SfIgnoreCaseCB.Enabled := Checked; - SfWildCardsCB.Enabled := Checked; - end; -end; - -procedure TFindWin.Copy1Click(Sender: TObject); -var - Node: TTreeNode; -begin - Node := ListTV.Selected; - if not Assigned(Node) then - Exit; - - Clipboard.AsText := Node.Text; -end; - -procedure TFindWin.SfIgnoreCaseCBClick(Sender: TObject); -begin - SfUseLocalesCB.Enabled := SfIgnoreCaseCB.Checked; -end; - -procedure TFindWin.FormCreate(Sender: TObject); -var - ImageFile: string; -begin - Caption := 'Pluto.RegMole ' + RegMoleVersion + - ' - The fastest registry search engine for Win9x'; - - ImageFile := PlutoDir + 'mole.bmp'; - if FileExists(ImageFile) then - MoleLogoI.Picture.LoadFromFile(ImageFile); - - Width := Screen.WorkAreaWidth - 100; - - CloseFindPrefP; -end; - -procedure TFindWin.FormShow(Sender: TObject); -begin - Top := Screen.WorkAreaHeight - 450; - Height := Screen.WorkAreaHeight - Top; - Left := (Screen.WorkAreaWidth - Width) div 2; -end; - -procedure TFindWin.SfTypesCBClick(Sender: TObject); -begin - TypeRangeE.Enabled := SfTypesCB.Checked; -end; - -end. -unit Plutoconst; - -interface - -uses ComCtrls, Classes, XReg, UniKey, YTools; - -var - Started: Boolean = False; - MurphyMode: Boolean = False; - PlutoKey: TUniKey; - -const - Version = '1.6 -nium Alpha'; - Overnight = True; - Codename = 'Phoenix'; - //Generation.Version-Release-Beta - // GG.VVRRBB - VersionNum: Double = 1.600000; - //Must be Double! - -const - iconKey = 0; - - iconFirstHKEY = 2; - iconHKLM = iconFirstHKEY; - iconHKU = iconFirstHKEY + 2; - - iconFirstShortcut = iconFirstHKEY + 4; - iconHKCC = iconFirstShortcut; - iconHKCU = iconFirstShortcut + 2; - iconHKCR = iconFirstShortcut + 4; - iconHKDD = iconFirstShortcut + 6; - iconHKPD = iconFirstShortcut + 8; - iconHKWM = iconFirstShortcut + 10; - iconHKWU = iconFirstShortcut + 12; - iconShortcut = iconFirstShortcut + 14; - nHKeyIcons = 16; - - iconFirstType = iconFirstShortcut + nHKeyIcons; - iconNone = iconFirstType + 0; - iconString = iconFirstType + 1; - iconExpandString =iconFirstType + 2; - iconBinary = iconFirstType + 3; - iconCardinal = iconFirstType + 4; - iconCardBigEndian=iconFirstType + 5; - iconLink = iconFirstType + 6; - iconMultiString = iconFirstType + 7; - iconResList = iconFirstType + 8; - iconFullResDesc = iconFirstType + 9; - iconResReqList = iconFirstType + 10; - iconUnknownType = iconFirstType + 11; - nTypeIcons = 12; - - iconFirstValue = iconFirstType + nTypeIcons; - iconValueElse = iconFirstValue; - iconValueEdit = iconFirstValue + 1; - iconValueEditBinary = iconFirstValue + 2; - iconValueZeromize = iconFirstValue + 3; - iconValueDublicate = iconFirstValue + 4; - iconMainValue = iconFirstValue + 5; - iconTakeAsMainValue = iconFirstValue + 6; - nValueIcons = 7; - - iconFirstKey = iconFirstValue + nValueIcons; - iconKeyInfos = iconFirstKey; - iconSubKey = iconFirstKey + 1; - iconKeyDublicate = iconFirstKey + 2; - iconKeyFind = iconFirstKey + 3; - iconKeyTrace = iconFirstKey + 4; - nKeyIcons = 5; - - iconFirstContextMenues = iconFirstKey + nKeyIcons; - iconRename = iconFirstContextMenues; - iconDelete = iconFirstContextMenues + 1; - nContextMenuesIcon = 2; - - iconFirstIni = iconFirstContextMenues + nContextMenuesIcon; - iconIniSection = iconFirstIni; - nIniIcons = 1; - - iconFirstHost = iconFirstIni + nIniIcons; - iconHostReg = iconFirstHost; - iconHostIni = iconFirstHost + 1; - iconHostUni = iconFirstHost + 2; - iconHostUni2 = iconFirstHost + 3; - nHostIcons = 4; - - iconFirstOther = iconFirstHost + nHostIcons; - - iconSortArrowAsc = iconFirstOther + 0; - iconSortArrowDesc = iconFirstOther + 1; - iconKeyMiddle = iconFirstOther + 2; - iconLock = iconFirstOther + 3; - - //iconDefect = iconFirstOther; - - { WorkWin.ChangeImages } - iconFirstChange = 0; - iconCKeyPlus = iconFirstChange; - iconCKeyMinus = iconFirstChange + 1; - iconCValuePlus = iconFirstChange + 2; - iconCValueMinus = iconFirstChange + 3; - iconCContext = iconFirstChange + 4; - iconOldContext = iconFirstChange + 5; - iconNewContext = iconFirstChange + 6; - iconGroup = iconFirstChange + 7; - iconGroupBlinking = iconFirstChange + 8; - nChangeIcons = 7; - - DefaultValueFlag = Pointer(1); - MultiEditFlag = Pointer(2); - - NoValueCaption = '[No Value]'; - - EditControlFlag = 100; - - MaxPreviewLen = 255; - RegMaxDataSize = $FFFF; //64 KB - -const - BoolStrFileName = 'Boolean Strings.txt'; - ShortcutsFileName = 'Shortcuts.ini'; - StandardShortcutsFileName = 'StandardShortcuts.ini'; - SisyFilterFileName = 'sisy filter.txt'; - - clDarkGray = $00404040; - clBrightRed = $00BBBBFF; - clVeryBrightRed = $00DDDDFF; - clBrightBlue = $00FFBBBB; - clBrightGreen = $00BBFFBB; - clCyan = $00FFFF44; - clBrightCyan = $00FFFFBB; - clVeryBrightCyan = $00FFFFDD; - clBrightYellow = $00BBFFFF; - clVeryBrightYellow = $00DDFFFF; - clBrightPurple = $00FFBBFF; - clBrightSilver = $00DDDDDD; - clGold = $0055CCEE; - - clVeryBrightBlue = $00FFDDDD; - -type - TValueListColumn = (vlcName, vlcSize, vlcType, vlcData); - -const - ValueListColumnRange = [Low(TValueListColumn)..High(TValueListColumn)]; - -type - TSearchVar = (sfKeys, sfValueNames, sfValueData, - sfAsHex, sfAsDWord, - sfWildCards, sfParts, sfIgnoreCase, SfUseLocales, - sfHKU, sfHKLM, sfHKDD,// sfCLSID, sfInterface, - sfString, sfDWord, sfOtherTypes, sfSpecialTypes); - - TSearchOptions = set of TSearchVar; - - //be carefull: used in with! - TKeyShortcut = record - Alias: string; - RealPath: string; - Node: TTreeNode; - end; - PKeyShortcut = ^TKeyShortcut; - TShortcutA = array of TKeyShortcut; - - TOpenNode = function (Reg: TXRegistry; Node: TTreeNode): Boolean; - TCheckNode = procedure (Node: TTreeNode; OnlyOnce: Boolean = True); - - //NodeInfo System - TNodeFlag = (nfDefect, nfReadOnly, nfChecked, - nfCopy, nfCut, nfPaste); - TNodeFlags = set of TNodeFlag; - - TUniHostType = (uhNone, - uhReg, uhIni, uhRegFile, - uhUserShortcut, uhStandardShortcut, uhSystemShortcut); - TUniHostTypes = set of TUniHostType; - -const - uhShortcuts = [uhUserShortcut, uhStandardShortcut, uhSystemShortcut]; - uhNonSystemShortcuts = [uhUserShortcut, uhStandardShortcut]; - - NodeFlagStrings: array[TNodeFlag] of string = ( - 'nfDefect', 'nfReadOnly', 'nfChecked', - 'nfCopy', 'nfCut', 'nfPaste'); - - HostTypeStrings: array[TUniHostType] of string = ('uhNone', - 'uhReg', 'uhIni', 'uhRegFile', - 'uhUserShortcut', 'uhStandardShortcut', 'uhSystemShortcut'); - -type - TNodeInfo = packed class - public - HostType: TUniHostType; - Flags: TNodeFlags; - constructor Create(HostType: TUniHostType = uhNone; Flags: TNodeFlags = []); - - procedure IncludeFlag(Flag: TNodeFlag); - procedure ExcludeFlag(Flag: TNodeFlag); - - function IsHost: Boolean; - function IsShortcut: Boolean; - - function ReadOnly: Boolean; - function Checked: Boolean; - function Defect: Boolean; - end; - -function NodeInfo(Node: TTreeNode): TNodeInfo; -procedure ReportStatus(const s: string); - -const - PlatformStrings: array[0..2] of string = - ('VER_PLATFORM_WIN32s', 'VER_PLATFORM_WIN32_WINDOWS', 'VER_PLATFORM_WIN32_NT'); - -var - PlutoDir: string = ''; - -implementation - -uses SysUtils; - -function NodeInfo(Node: TTreeNode): TNodeInfo; -begin - if not Assigned(Node) then begin - Result := nil; - Exit end; - - if not Assigned(Node.Data) then - Node.Data := TNodeInfo.Create; - Result := TNodeInfo(Node.Data); -end; - -{ TNodeInfo } - -constructor TNodeInfo.Create(HostType: TUniHostType; Flags: TNodeFlags); -begin - inherited Create; - Self.HostType := HostType; - Self.Flags := Flags; -end; - -function TNodeInfo.Checked: Boolean; -begin - Result := nfChecked in Flags; -end; - -function TNodeInfo.ReadOnly: Boolean; -begin - Result := nfReadOnly in Flags; -end; - -function TNodeInfo.Defect: Boolean; -begin - Result := nfDefect in Flags; -end; - -procedure TNodeInfo.IncludeFlag(Flag: TNodeFlag); -begin - Include(Flags, Flag); -end; - -procedure TNodeInfo.ExcludeFlag(Flag: TNodeFlag); -begin - Exclude(Flags, Flag); -end; - -function TNodeInfo.IsHost: Boolean; -begin - Result := HostType <> uhNone; -end; - -function TNodeInfo.IsShortcut: Boolean; -begin - Result := HostType in uhShortcuts; -end; - -function GetPlutoDir: string; -begin - Result := LWPSlash(GetParam('-imports=', MyDir)); - if not DirectoryExists(Result) then begin - ReportStatus('PlutoDir "' + Result + '" not found -> setting to default (MyDir).'); - Result := MyDir; - end; - ReportStatus('PlutoDir=' + Result); -end; - -var - ReportSL: TStringList; - ReportFileName: string; - -procedure ReportStatus(const s: string); -begin - ReportSL.Add(s); - try - ReportSL.SaveToFile(ReportFileName); - except end; -end; - -initialization - ReportFileName := MyDir + 'loadreport.txt'; - ReportSL := TStringList.Create; - PlutoDir := GetPlutoDir; - -end. -//winampviscolor : -unit plutomain; -{$DEFINE UNIKEY} -{$DEFINE CYCFS} - -{=============================================================================== - - cYcnus.Pluto 1.57 Beta 14 - by Murphy - - ©2000-2003 by cYcnus - visit www.cYcnus.de - - murphy@cYcnus.de (Kornelius Kalnbach) - - this programm is published under the terms of the GPL - -===============================================================================} - -interface - -uses - Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, - StdCtrls, ImgList, ComCtrls, ExtCtrls, Menus, Clipbrd, IniFiles, - ShellAPI, Grids, - //Components - NewPanels, - //Units - YTools, YTypes, UniKey, XReg, - //Pluto - Plutoconst, - SpyTH, SisyphusTH; - -const - NoPreBlinkHint = #1; - -type - TMainWin = class(TForm) - StatusBar: TStatusBar; - StatusBarPU: TPopupMenu; - CopyPath: TMenuItem; - InsertPath: TMenuItem; - ShowRealPathMI: TMenuItem; - PathP: TPanel; - N1: TMenuItem; - MainMenu1: TMainMenu; - Desktop1: TMenuItem; - Pluto1: TMenuItem; - RegEdit1: TMenuItem; - Free1: TMenuItem; - BigVal1: TMenuItem; - Hilfe1: TMenuItem; - History1: TMenuItem; - SplashScreen1: TMenuItem; - wwwcYcnusde1: TMenuItem; - Credits1: TMenuItem; - Optionen1: TMenuItem; - PrefMI: TMenuItem; - EditBoolStrMI: TMenuItem; - N4: TMenuItem; - ImageList1: TImageList; - Plutoini1: TMenuItem; - About1: TMenuItem; - kornycYcnusde1: TMenuItem; - ools1: TMenuItem; - NotePad1: TMenuItem; - RegEdit2: TMenuItem; - SysEdit1: TMenuItem; - WordPad1: TMenuItem; - N3: TMenuItem; - N5: TMenuItem; - Suchen1: TMenuItem; - Find1: TMenuItem; - File1: TMenuItem; - ExitPluto1: TMenuItem; - OpenProgramFolder1: TMenuItem; - N6: TMenuItem; - OpenWinDir1: TMenuItem; - HintBlinkT: TTimer; - FindCLSID1: TMenuItem; - Clipboard1: TMenuItem; - GotoCLSID1: TMenuItem; - CommandLineParameters1: TMenuItem; - plutocYcnusde1: TMenuItem; - N7: TMenuItem; - heinzcYcnusde1: TMenuItem; - kornycYcnusde2: TMenuItem; - N8: TMenuItem; - ExternalHexEditMI: TMenuItem; - Cleanup1: TMenuItem; - DeleteTempFolder1: TMenuItem; - Debug1: TMenuItem; - CurrentDir1: TMenuItem; - RepairPluto155bBug1: TMenuItem; - BackupRegistryscanreg1: TMenuItem; - Username1: TMenuItem; - SupportMI: TMenuItem; - MurphyMI: TMenuItem; - ToDoMI: TMenuItem; - Beta1: TMenuItem; - UniKeycYcnusde1: TMenuItem; - YToolscYcnusde1: TMenuItem; - YPanelscYcnusde1: TMenuItem; - Usedenginescomponents1: TMenuItem; - PrefToolscYcnusde1: TMenuItem; - BugReportsRequests1: TMenuItem; - murphycYcnusde1: TMenuItem; - Credits2: TMenuItem; - News1: TMenuItem; - cYcnus1: TMenuItem; - Contact1: TMenuItem; - N2: TMenuItem; - IjustwantCONTACT1: TMenuItem; - N9: TMenuItem; - AnotherPluto1: TMenuItem; - UniKeyDemoMI: TMenuItem; - Path1: TMenuItem; - RegisterPlugIns1: TMenuItem; - UniPluginOD: TOpenDialog; - SwapLM_CUB: TButton; - PathE: TEdit; - ShowLoadreport1: TMenuItem; - KillPluto1: TMenuItem; - ShowPlatform1: TMenuItem; - MSConfig1: TMenuItem; - TimetoRelaxMI: TMenuItem; - N10: TMenuItem; - - procedure FormCreate(Sender: TObject); - procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure FormClose(Sender: TObject; var Action: TCloseAction); - procedure InsertPathClick(Sender: TObject); - - procedure StatusBarResize(Sender: TObject); - procedure StatusBarDblClick(Sender: TObject); - procedure StatusBarUpdate; - procedure CopyPathClick(Sender: TObject); - - procedure SetStatus; - procedure GotoKey(Key: string); - procedure FindCLSID; - procedure GotoCLSID; - procedure UserGotoKey; - procedure ShowRealPathMIClick(Sender: TObject); - procedure PathEKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure PathEChange(Sender: TObject); - procedure PathEExit(Sender: TObject); - - procedure AppActivate(Sender: TObject); - procedure PathEKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure ActivateIt(Sender: TObject); - procedure FormActivate(Sender: TObject); - procedure FormDeactivate(Sender: TObject); - procedure Pluto1Click(Sender: TObject); - procedure RegEdit1Click(Sender: TObject); - procedure Free1Click(Sender: TObject); - procedure BigVal1Click(Sender: TObject); - procedure SplashScreen1Click(Sender: TObject); - procedure HistoryClick(Sender: TObject); - procedure Credits1Click(Sender: TObject); - - function Greeting(Name: string = NoPreBlinkHint): string; - procedure PrefMIClick(Sender: TObject); - procedure EditBoolStrMIClick(Sender: TObject); - procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); - procedure SisyTerminate(Sender: TObject); - procedure OnSisyChange(Sender: TSisyThread; Change: TSisyChange); - procedure OnSisyValuePlus(Sender: TSisyThread; Change: TSisyChange); - procedure OnSisyValueMinus(Sender: TSisyThread; Change: TSisyChange); - procedure OnSisyContextChange(Sender: TSisyThread; Change: TSisyChange); - - procedure Plutoini1Click(Sender: TObject); - procedure RegEdit2Click(Sender: TObject); - procedure SysEdit1Click(Sender: TObject); - procedure NotePad1Click(Sender: TObject); - procedure WordPad1Click(Sender: TObject); - procedure OpenWinDir1Click(Sender: TObject); - procedure OpenProgramFolder1Click(Sender: TObject); - procedure ExitPluto1Click(Sender: TObject); - procedure Find1Click(Sender: TObject); - procedure FormPaint(Sender: TObject); - - procedure Load; - procedure StatusBarDrawPanel(StatusBar: TStatusBar; - Panel: TStatusPanel; const Rect: TRect); - procedure PathEKeyPress(Sender: TObject; var Key: Char); - procedure HintBlinkTTimer(Sender: TObject); - procedure FindCLSID1Click(Sender: TObject); - procedure GotoCLSID1Click(Sender: TObject); - procedure CommandLineParameters1Click(Sender: TObject); - procedure WebLinkMIClick(Sender: TObject); - procedure DeleteTempFolder1Click(Sender: TObject); - procedure CurrentDir1Click(Sender: TObject); - procedure RepairPluto155bBug1Click(Sender: TObject); - procedure BackupRegistryscanreg1Click(Sender: TObject); - procedure SisyStarted(Sender: TObject); - procedure StopHintBlinking; - procedure Username1Click(Sender: TObject); - procedure SupportMIClick(Sender: TObject); - procedure ToDoMIClick(Sender: TObject); - procedure MailLinkMIClick(Sender: TObject); - procedure IjustwantCONTACT1Click(Sender: TObject); - procedure ExternalHexEditMIClick(Sender: TObject); - procedure AnotherPluto1Click(Sender: TObject); - procedure Path1Click(Sender: TObject); - procedure RegisterPlugIns1Click(Sender: TObject); - procedure FormResize(Sender: TObject); - procedure SwapLM_CUBClick(Sender: TObject); - procedure ShowLoadreport1Click(Sender: TObject); - procedure KillPluto1Click(Sender: TObject); - procedure ShowPlatform1Click(Sender: TObject); - procedure MSConfig1Click(Sender: TObject); - procedure TimetoRelaxMIClick(Sender: TObject); - private - DoAutoComplete: Boolean; - MainWinLoaded: Boolean; - DontSavePrefs: Boolean; - PreBlinkHint: string; - end; - -var - MainWin: TMainWin; - - StatusBar: TStatusBar; - MainReg: TXRegistry; - - SpyThread: TRegSpyThread; - Sisys: TList; - -function TempDir: string; -function PlutoUniPath: string; -function PlutoIniFileName: string; - -function PathOfNode(Node: TTreeNode): string; -function CurKey(AllowedShortcutTypes: TUniHostTypes = []): TRegPath; - -procedure ArrangePlutoStyle; -procedure ArrangeRegEdStyle; -procedure ArrangeFreeStyle; -procedure ArrangeBigValStyle; - -procedure ActivateThis(Sender: TObject); -procedure DeActivateThis(Sender: TObject); - -procedure SwapFonts(Sender: TWinControl); - -procedure AddHint(const Hint: string; Blinking: Boolean = False); -procedure AddToLastHint(Appendix: string); -procedure ChangeLastHint(NewHint: string); - -implementation - -uses - //Forms - FindWinU, valuesU, TreeU, WorkU, splash, PrefU, - //Units - Clock, Start, keybrd, CompEx, Colors, FindAllThread, - PrefTools; - -{$R *.DFM} - -var - SavedPlutoIniFileName: string = ''; - -procedure AddHint(const Hint: string; Blinking: Boolean = False); -begin - if Assigned(WorkWin) then - WorkWin.AddAHint(Hint); - - with MainWin do begin - StopHintBlinking; - - if Blinking then begin - HintBlinkT.Enabled := True; - if PreBlinkHint = NoPreBlinkHint then - PreBlinkHint := StatusBar.Panels[0].Text; - StatusBar.Panels[0].Text := WorkWin.LastHint; - end; - end; -end; - -procedure AddToLastHint(Appendix: string); -begin - with WorkWin.HintLB.Items do begin - if Count = 0 then - Exit; - - Strings[Count-1] := Strings[Count-1] + Appendix; - end; - Application.ProcessMessages; -// Sleep(1000); -end; - -procedure ChangeLastHint(NewHint: string); -begin - with WorkWin.HintLB.Items do begin - if Count = 0 then - Exit; - - Strings[Count-1] := NewHint; - end; - Application.ProcessMessages; -// Sleep(1000); -end; - -function CurKey(AllowedShortcutTypes: TUniHostTypes = []): TRegPath; -var - s: string; - Item: TListItem; -begin - if Assigned(RegTV.Selected) then begin - s := PathOfNode(RegTV.Selected); - if AllowedShortcutTypes <> [] then - s := TraceKey(s, AllowedShortcutTypes); - Result.Root := ExRegRoot(s); - Result.Key := ExRegKey(s); - - Item := ValueList.ItemFocused; - if Assigned(Item) then - Result.Value := RealValueName(Item); - Result.ValueSet := Assigned(Item); - end; -end; - -function PathOfNode(Node: TTreeNode): string; -begin - Result := ''; - - if not Assigned(Node) then - Exit; - - if Assigned(Node.Parent) then - Result := LWPSlash(PathOfNode(Node.Parent)) + Node.Text - else - Result := Node.Text; -end; - -procedure TMainWin.AppActivate(Sender: TObject); -var - ActForm: TCustomForm; - - procedure TryShow(Win: TCustomForm); - begin - if Assigned(Win) and Win.Visible then - Win.Show; - end; - -begin - ActForm := Screen.ActiveCustomForm; //LastActiveForm; - TryShow(ValuesWin); - TryShow(WorkWin); - TryShow(TreeWin); - TryShow(FindWin); - TryShow(SplashWin); - TryShow(MainWin); - TryShow(ActForm); -end; - -procedure TMainWin.FormCreate(Sender: TObject); - - procedure InitHKEYString(var H: THKEYString; const Long, Short: string; - Handle: Integer = 0; IsDefault: Boolean = False); - begin - H.Long := Long; - H.Short := Short; - H.Handle := Handle; - H.IsDefault := IsDefault; - end; - -begin -{$IFDEF UNIKEY} -{$IFDEF CYCFS} - RegisterUniClass('Y:\programme\unikey\cyc_fs.uni'); -{$ENDIF} -{$ENDIF} - - Application.OnActivate := AppActivate; - PlutoMain.StatusBar := StatusBar; - - //Creating - MainReg := TXRegistry.Create; - - //Initialize - Caption := 'cYcnus.Pluto ' + Version; - PreBlinkHint := NoPreBlinkHint; - - SetLength(HKEYStrings, Length(HKEYStrings) + 2); - InitHKEYString(HKEYStrings[LastDefaultHKEYString + 1], - 'HKEY_WindowsMachine', 'HKWM'); - - InitHKEYString(HKEYStrings[LastDefaultHKEYString + 2], - 'HKEY_WindowsUser', 'HKWU'); - - Application.HintHidePause := -1; //that's approximately 136 years :D - - StatusBar.Panels[0].Width := Screen.Width div 6; - - MurphyMI.Visible := MurphyMode; - -{$IFDEF UNIKEY} - UniPluginOD.InitialDir := MyDir; -{$ELSE} - UniKeyDemoMI.Visible := False; -{$ENDIF} -end; - -procedure TMainWin.GotoKey(Key: string); -var - Full: TregPath; - Node: TTreeNode; - keySA: TStrA; - i: integer; - - function NodeOfRoot(Root: string): TTreeNode; - var - i: Integer; - begin - Result := nil; - Root := LongHKEY(Root); - - for i := 0 to RootNodes.Count-1 do - if SameText(TTreeNode(RootNodes[i]).Text, Root) then begin - Result := TTreeNode(RootNodes[i]); - Break; end; - - for i := 0 to High(Shortcuts) do - if SameText(Shortcuts[i].Alias, Full.Root) then begin - Result := Shortcuts[i].Node; - Break; end; - end; - -begin - keySA := nil; - - //Get FullPath of the Key - Key := TrimLeft(Key); - if TextAtPos(Key, 1, 'Reg:') then - Key := TrimLeft(FromChar(Key, ':')); - Key := UnQuote(Key); - - Full := RegPathOfStr(Key); - if Trim(Full.Root) = '' then begin - AddHint('Empty Path.', True); - Exit; end; - - //Get Root Node - Node := NodeOfRoot(Full.Root); - if not Assigned(Node) then begin - if not PathE.Focused then - AddHint('Key not found:' + EOL + Key); - Exit; end; - - //Create an array of all SubKeys - keySA := Split(Full.Key, '\'); - - //Avoid SmartExpand - TreeWin.DoSmartExpand := False; begin - - //Open all SubKeys - for i := 0 to High(keySA) do begin - //Open the Node if neccessary - if not Node.Expanded then begin - if not Node.Selected then - RegTV.Selected := Node; - CheckNode(Node, False); - //TreeWin.RegTVChange(Self, Node); - Node.Expand(False); - end; - - //Get Node of the SubKey - Node := FindNodeText(Node, keySA[i]); - if not Assigned(Node) then begin - if not PathE.Focused then - AddHint('Goto Key not found: ' + KeySA[i], True); - Exit; - end; - end; - - end; TreeWin.DoSmartExpand := True; - - if Node <> RegTV.Selected then begin - RegTV.Selected := Node; - TreeWin.RegTVChange(Self, Node); - end; - - Application.ProcessMessages; - - if Full.ValueSet then - ValuesWin.FocusItem(Full.Value, not (Active and PathE.Focused)) - else begin - if not (Active and PathE.Focused) then //if not user is currently editing the path - TreeWin.FocusControl(RegTV); - - if LastChar(Full.Key) = '\' then - Node.Expand(False); - end; -end; - -procedure SwapFonts(Sender: TWinControl); - - function OtherFont(N: TFontName): TFontName; - begin - Result := 'Courier New'; - if N = Result then - Result := 'Arial'; - end; - -begin - TEdit(Sender).Font.Name := OtherFont(TTreeView(Sender).Font.Name); -end; - -procedure ActivateThis(Sender: TObject); -begin - if not Assigned(Sender) then - Exit; - - with TEdit(Sender) do begin - if Tag <> EditControlFlag then - Exit; - Color := RealColor(clVeryBrightBlue); - Font.Color := clBlack; - end; -end; - -procedure DeActivateThis(Sender: TObject); -begin - if not Assigned(Sender) then - Exit; - - with TEdit(Sender) do begin - if Tag <> EditControlFlag then - Exit; - Color := RealColor(clDarkGray); - Font.Color := clWhite; - end; -end; - -procedure CreateSisyThreads; -var - i: Integer; - - procedure CreateSisyThread(const Name: string; const KeyName: string; - Key: HKEY; StatusLabel: TLabel); - var - Sisy: TSisyThread; - begin - ChangeLastHint('Creating ' + Name + '...'); - Sisy := TSisyThread.CreateIt(Name, KeyName, Key, StatusLabel, PlutoKey); - Sisy.OnChange := MainWin.OnSisyChange; -// Sisy.OnSpecialChange[cValuePlus] := MainWin.OnSisyValuePlus; -// Sisy.OnSpecialChange[cValueMinus] := MainWin.OnSisyValueMinus; -// Sisy.OnSpecialChange[cContextChange] := MainWin.OnSisyContextChange; - Sisys.Add(Sisy); - AddToLastHint('OK'); - end; - -begin - AddHint('Starting Sisyphus ' + SisyVersion + '...'); - - Sisys := TSisyList.Create; - WorkWin.LoadSisyFilter; - - CreateSisyThread('Sisy HKU', 'HKU', HKU, WorkWin.SisyHKUL); - CreateSisyThread('Sisy HKLM', 'HKLM', HKLM, WorkWin.SisyHKLML); - - ChangeLastHint('Initializing Sisyphus...'); - for i := 0 to Sisys.Count-1 do - with TSisyThread(Sisys[i]) do begin - if Name = 'Sisy HKU' then - with WorkWin.SisyHKUCB do begin - Settings.KeyName := StrOfUni(Uni.Path); - Settings.Load; - Settings.AutoSave := True; - if Checked then - Resume; - end - else if Name = 'Sisy HKLM' then - with WorkWin.SisyHKLMCB do begin - Settings.KeyName := StrOfUni(Uni.Path); - Settings.Load; - Settings.AutoSave := True; - if Checked then - Resume; - end; - OnStarted := MainWin.SisyStarted; - end; -end; - -procedure CreateSpyThread; -begin - AddHint('Creating SpyThread...'); - SpyThread := TRegSpyThread.CreateIt(tpLowest); - WorkWin.SpyDelayIEChange(MainWin); - WorkWin.SpyTestLClick(MainWin); - AddToLastHint('OK'); -end; - -procedure ShowParams; -var - SL: TStringList; -begin - if Switch('params?') then begin - SL := TStringList.Create; - GetParams(SL); - ShowMessage(SL.Text); - SL.Free; - end; -end; - -procedure GotoParamKey; -var - s: string; -begin - s := ParamStr(1); - if (s <> '') - and (s[1] <> '-') then begin //Params have '-' as prefix - AddHint('Goto Key ' + Quote(s) + '...'); - MainWin.GotoKey(s); - end else begin - RegTV.Selected := RegTV.TopItem; - end; -end; - -procedure TMainWin.Load; -begin - TreeWin.Load; - WorkWin.LoadBoolStr; - - CreateSpyThread; - CreateSisyThreads; - - AddHint(Greeting, True); - - ShowParams; - GotoParamKey; - - if Assigned(SplashWin) and SplashWin.Visible then - SplashWin.SetFocus; -end; - -procedure TMainWin.CopyPathClick(Sender: TObject); -begin - Clipboard.AsText := StatusBar.Panels[1].Text; -end; - -procedure TMainWin.FormKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if (ssAlt in shift) and (Key = VK_F4) then begin - Key := 0; - Close; - Exit; end; - - if ssCtrl in Shift then - case Key of - Byte('W'): begin - MainPC.ActivePage := WorkWin.WorkPage; - if Assigned(MainPC.ActivePage) then - WorkWin.FocusControl(TWinControl(ShowPC.ActivePage.Tag)) - end; - - Byte('H'): MainPC.ActivePage := WorkWin.HintPage; - - Byte('L'): MainWin.FindCLSID; - end; - - if Shift = [] then - case Key of - VK_F6: TreeWin.FocusControl(RegTV); - - VK_F7: with ValueList do begin - ValuesWin.FocusControl(ValueList); - if (Selected = nil) and (Items.Count > 0) then begin - Selected := Items[0]; - ItemFocused := Selected; - end; - end; - - VK_F8: WorkWin.FocusControl(MainPC); - end; - - if Key = VK_SCROLL then begin - TreeWin.CheckRegTVHotTrack; - ValuesWin.CheckValueListHotTrack; - end; -end; - -procedure TMainWin.StatusBarResize(Sender: TObject); -begin - with StatusBar do - Panels[1].Width := - Width - (Panels[0].Width + Panels[2].Width + Panels[3].Width); -end; - -procedure TMainWin.StatusBarDblClick(Sender: TObject); -begin - ShowRealPathMIClick(Sender); -end; - -procedure TMainWin.InsertPathClick(Sender: TObject); -begin - GotoKey(Clipboard.AsText); -end; - -procedure TMainWin.SetStatus; -begin - StatusBarUpdate; -end; - -procedure TMainWin.StatusBarUpdate; -var - Inf: TRegKeyInfo; -begin - OpenCurKey; - MainReg.GetKeyInfo(Inf); - MainReg.CloseKey; - - StatusBar.Panels[2].Text := StrNumerus(Inf.NumSubKeys, 'key', 'keys', 'no'); - StatusBar.Panels[3].Text := StrNumerus(Inf.NumValues, 'value', 'values', 'no'); - - if ShowRealPathMI.Checked then - StatusBar.Panels[1].Text := StrOfRegPath(CurKey(uhShortcuts)) - else - StatusBar.Panels[1].Text := StrOfRegPath(CurKey(uhNonSystemShortcuts)); - - if not PathE.Focused then - PathE.Text := StrOfRegPath(CurKey); -end; - -procedure TMainWin.ShowRealPathMIClick(Sender: TObject); -begin - ShowRealPathMI.Checked := not ShowRealPathMI.Checked; - StatusBarUpdate; -end; - -procedure TMainWin.PathEKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -var - Pos: Integer; - s: string; -begin - DoAutoComplete := not (Key in [VK_DELETE, VK_BACK, VK_ESCAPE]); - - case Key of - VK_BACK: - begin - s := PathE.Text; - Pos := PathE.SelStart; - - if ssCtrl in Shift then - repeat - Dec(Pos); - until (Pos < 1) or (s[Pos] = '\') - else if PathE.SelLength = 0 then - Exit; - - PathE.Text := Copy(s, 1, Pos); - PathE.SelStart := Length(s); - Key := 0; - UserGotoKey; - end; - - VK_ESCAPE: - with PathE do begin - if SelLength = 0 then - Exit; - Text := StrOfRegPath(CurKey); - SelStart := Length(Text); - end; - - VK_RETURN: begin - if CurKey.ValueSet then - ValuesWin.ValueListDblClick(Self); - Key := 0; - end; - - VK_RIGHT: begin - if not (ssCtrl in Shift) then - Exit; - - Key := 0; - - s := PathE.Text; - Pos := PathE.SelStart + 1; - repeat - Inc(Pos); - until (Pos > Length(s)) or (s[Pos] = '\'); - - PathE.SelStart := Pos - 1; - end; - - VK_LEFT: begin - if not (ssCtrl in Shift) then - Exit; - - with PathE do begin - Key := 0; - - s := Text; - Pos := SelStart; - repeat - Dec(Pos); - until (Pos < 1) or (s[Pos] = '\'); - - if Pos < 1 then - Pos := 1; - - SelStart := Pos - 1; - end; - end; - end; -end; - -procedure TMainWin.UserGotoKey; -begin - GotoKey(PathE.Text); -end; - -procedure TMainWin.PathEChange(Sender: TObject); -var - Prefix, Suffix, Key, Path, Root: string; - i, p, Len: Integer; - SL: TStringList; - CompleteKind: (ckRoots, ckKeys, ckValues); - - procedure GetRootNames(Strings: TStrings); - var - Node: TTreeNode; - begin - SL.Clear; - Node := RegTV.Items.GetFirstNode; - while Assigned(Node) do begin - SL.Add(Node.Text); - Node := Node.GetNextSibling; - end; - end; - -begin - if not DoAutoComplete then - Exit; - - Key := PathE.Text; - Root := TraceKey(ExRegRoot(Key)); - - if not CharIn(Key, '\') then - CompleteKind := ckRoots - else if ExRegValueSet(Key) then - CompleteKind := ckValues - else - CompleteKind := ckKeys; - - case CompleteKind of - ckRoots: begin - Prefix := ''; - Suffix := Key; - end; - - ckKeys: begin - Path := ExRegFullKey(Key); - Prefix := UntilLastChar(Path, '\'); - Suffix := FromLastChar(Path, '\'); - end; - - ckValues: begin - p := Pos('\\', Key); - Prefix := Copy(Key, 1, p - 1); - Suffix := Copy(Key, p + 2, Length(Key) - p - 1); - end; - - else - end; - - SL := TStringList.Create; - - if CompleteKind in [ckKeys, ckValues] then - with MainReg do begin - RootKey := HKEYOfStr(ExRegRoot(Root)); - OpenKey(ExRegKey(Root)); - OpenKey(ExRegKey(Prefix)); - - if CompleteKind = ckValues then begin - if not HasValues then - Exit; - GetValueNames(SL); - end else if CompleteKind = ckKeys then begin - if not HasSubKeys then - Exit; - GetKeyNames(SL); - end; - - CloseKey; - end - else begin - GetRootNames(SL); - end; - - if Suffix = '' then begin - if (SL.Count > 0) and not StrIn(SL, '') then - Suffix := SL[0]; - end else begin - for i := 0 to SL.Count-1 do - if TextAtBegin(SL[i], Suffix) then begin - Suffix := SL[i]; - Break; end; - end; - - Len := Length(PathE.Text); - - if CompleteKind = ckValues then - Prefix := Prefix + '\\' - else if CompleteKind = ckKeys then - Prefix := Prefix + '\'; - - with PathE do begin - DoAutoComplete := False; //Avoid Recursion - Text := Prefix + Suffix; - DoAutoComplete := True; - - SelStart := Len; - SelLength := Length(Text) - Len; - end; - - SL.Free; -end; - -procedure TMainWin.PathEExit(Sender: TObject); -begin - DeActivateThis(PathE); - DoAutoComplete := False; -end; - -procedure ArrangePlutoStyle; -begin - with ValuesWin do begin - Height := MainWin.ClientHeight div 3; - Top := MainWin.ClientHeight - Height - 43; - Left := 0; - Width := MainWin.ClientWidth - 4; - //Align := alBottom; - end; - - with WorkWin do begin - Top := 0; - Width := Max(MainWin.ClientWidth div 3, WorkWin.Constraints.MinWidth); - Left := ValuesWin.Width - Width; - Height := MainWin.ClientHeight - 43 - ValuesWin.Height; - //Align := alRight; - end; - - with TreeWin do begin - Top := 0; - Height := WorkWin.Height; - Left := 0; - Width := ValuesWin.Width - WorkWin.Width; - end; - - {TreeWin.Align := alNone; - WorkWin.Align := alNone; - ValuesWin.Align := alNone;} -end; - -procedure ArrangeFreeStyle; -const - Space = 10; -begin - with ValuesWin do begin - Height := Screen.Height div 3; - Align := alBottom; - end; - - with WorkWin do begin - Width := Max(Screen.WorkAreaWidth div 3, Constraints.MinWidth + 2 * Space); - Align := alRight; - end; - - with TreeWin do begin - Align := alClient; - end; - - TreeWin.Align := alNone; - WorkWin.Align := alNone; - ValuesWin.Align := alNone; - - with ValuesWin do begin - Height := Height - 2 * Space; - Width := Width - 2 * Space; - Top := Top + Space; - Left := Left + Space; - end; - - with TreeWin do begin - Height := Height - 1 * Space; - Width := Width - 1 * Space; - Top := Top + Space; - Left := Left + Space; - end; - - with WorkWin do begin - Height := Height - 1 * Space; - Width := Width - 2 * Space; - Top := Top + Space; - Left := Left + Space; - end; -end; - -procedure ArrangeBigValStyle; -var - MinHeight: Integer; -begin - MinHeight := WorkWin.Constraints.MinHeight + - MainWin.Constraints.MinHeight; - - with ValuesWin do begin - Height := Screen.WorkAreaHeight - Max(Screen.Height div 3, MinHeight); - Align := alBottom; - end; - - with WorkWin do begin - Width := Screen.WorkAreaWidth div 3; - Align := alRight; - end; - - with TreeWin do begin - Align := alClient; - end; - - TreeWin.Align := alNone; - WorkWin.Align := alNone; - ValuesWin.Align := alNone; -end; - -procedure ArrangeRegEdStyle; -begin - with TreeWin do begin - Width := Screen.WorkAreaWidth div 4; - Align := alLeft; - end; - - with ValuesWin do begin - Align := alClient; - Align := alNone; - Height := Height - WorkWin.Constraints.MinHeight; - end; - - with WorkWin do begin - Top := ValuesWin.Top + ValuesWin.Height; - Left := ValuesWin.Left; - Height := Constraints.MinHeight; - Width := ValuesWin.Width; - end; - - TreeWin.Align := alNone; -end; - -procedure TMainWin.PathEKeyUp(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if not (Key in [VK_DELETE, VK_BACK, VK_ESCAPE]) then - UserGotoKey; -end; - -procedure TMainWin.ActivateIt(Sender: TObject); -begin - ActivateThis(Sender); -end; - -procedure TMainWin.FormActivate(Sender: TObject); -begin - if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then - ActivateThis(ActiveControl); -end; - -procedure TMainWin.FormDeactivate(Sender: TObject); -begin - if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then - DeActivateThis(ActiveControl); -end; - -procedure TMainWin.Pluto1Click(Sender: TObject); -begin - ArrangePlutoStyle; -end; - -procedure TMainWin.RegEdit1Click(Sender: TObject); -begin - ArrangeRegEdStyle; -end; - -procedure TMainWin.Free1Click(Sender: TObject); -begin - ArrangeFreeStyle; -end; - -procedure TMainWin.BigVal1Click(Sender: TObject); -begin - ArrangeBigValStyle; -end; - -procedure TMainWin.SplashScreen1Click(Sender: TObject); -begin - SplashWin.Show; -end; - -procedure TMainWin.HistoryClick(Sender: TObject); -begin - NotePad(PlutoDir + 'version.txt'); -end; - -procedure TMainWin.WebLinkMIClick(Sender: TObject); -begin - Browse('http://' + TMenuItem(Sender).Caption); -end; - -procedure TMainWin.SupportMIClick(Sender: TObject); -begin - Browse('http://cYcnus.de/php/phpbb/viewforum.php?f=1'); -end; - -procedure TMainWin.Credits1Click(Sender: TObject); -var - FileName: string; -begin - FileName := PlutoDir + 'credits deluxe.htm'; - if FileExists(FileName) then - ExecFile(FileName) - else begin - FileName := PlutoDir + 'credits.htm'; - if FileExists(FileName) then - ExecFile(FileName); - end; -end; - -function GetCLSIDFromClipboard: string; -var - CLSID: string; -begin - CLSID := BetweenChars(Clipboard.AsText, '{', '}', True); - if CLSID = '' then begin - Result := Clipboard.AsText; - InputQuery('No CLSID in Clipboard.', - 'Use following format:' + EOL + - '{00000000-0000-0000-0000-000000000000}', Result); - Exit; end else - Result := CLSID; -end; - -procedure TMainWin.FindCLSID; -var - CLSID, Desc: string; -begin - CLSID := GetCLSIDFromClipboard; - Desc := RegNameOfCLSID(CLSID); - if Desc <> '' then - InputQuery('Your CLSID is...', CLSID, Desc) - else - ShowMessage('CLSID not found: ' + CLSID + '.'); -end; - -procedure TMainWin.GotoCLSID; -var - CLSID, Desc: string; -begin - CLSID := GetCLSIDFromClipboard; - Desc := RegNameOfCLSID(CLSID); - if Desc <> '' then begin - GotoKey('HKCR\CLSID\' + CLSID); - TreeWin.FocusControl(RegTV); - end else - ShowMessage('CLSID not found: ' + CLSID + '.'); -end; - -function TMainWin.Greeting(Name: string = NoPreBlinkHint): string; -const - Alias: array[0..4] of string = - ('Licenser', 'Murphy', 'Sleeper', 'Leon', 'Great Admin'); - RealNames: array[0..4] of string = - ('Heinz', 'Korny', 'Sven', 'Simon', 'Korny ;-)'); -var - i: Integer; - s: string; -begin - if Name = NoPreBlinkHint then - Name := PrefWin.UserNameE.Text; - - if Trim(Name) = '' then - s := 'No name?' - else if SameText(Trim(Name), 'Pluto-User') then - s := 'Hi!' - else - for i := 0 to 4 do - if SameText(Name, Alias[i]) then begin - s := 'Hi ' + RealNames[i] + '! This is a cYcnus.EasterEgg'; - Break; end - else if Length(Name) > 20 then - s := 'Hi ' + Name + - '. What a name.' - else - s := 'Hi ' + Name + '!'; - - Result := s; -end; - -procedure TMainWin.PrefMIClick(Sender: TObject); -begin - PrefWin.Show; -end; - -function TempDir: string; -begin - Result := PlutoDir + 'temp\'; - if not (DirectoryExists(Result) or CreateDir(Result)) then - Result := PlutoDir; -end; - -function PlutoIniFileName: string; - - function Default: string; - begin - Result := MyDir + 'pluto.ini'; - end; - -begin - Result := SavedPlutoIniFileName; - if Result <> '' then - Exit; - -// Result := Params.ReadString('ini', ''); - - if IsValidFileName(Result) then - Result := PlutoDir + Result - else - Result := Default; - - SavedPlutoIniFileName := Result; //Faster in future calls -end; - -function PlutoUniPath: string; -begin - //Result := 'Reg: HKCU\Software\Pluto\'; - Result := 'Ini <' + PlutoIniFileName + '>:'; -end; - -procedure TMainWin.EditBoolStrMIClick(Sender: TObject); -begin - NotePad(PlutoDir + BoolStrFileName); - ShowMessage('Click OK when you finished editing.' + EOL + - '(Pluto will reload the Boolean Strings.)'); - WorkWin.LoadBoolStr; -end; - -procedure TMainWin.SisyStarted(Sender: TObject); -{var - NextSisyIndex: Integer; - NextSisy: TSisyThread; } -begin - {NextSisy := nil; - - with TSisyThread(Sender) do begin - //AddHint(Format('%s started after %0.1f seconds', [Name, SecsPerRound]), True); - - with Sisys do begin - NextSisyIndex := IndexOf(Sender) + 1; - if NextSisyIndex < Count then - NextSisy := Items[NextSisyIndex]; - end; - - if Assigned(NextSisy) then - with NextSisy do - if not Started and Suspended then - Resume; - end; } -end; - -procedure TMainWin.SisyTerminate(Sender: TObject); -begin - if Assigned(Sisys) then - Sisys.Delete(Sisys.IndexOf(Sender)); - AddHint('Sisyphus ' + Quote(TSisyThread(Sender).Name) + ' destroyed.'); -end; - -procedure TMainWin.FormCloseQuery(Sender: TObject; var CanClose: Boolean); -var - i: Integer; - - procedure TerminateThread(Thread: TThread; Name: string); - const - ThreadTimeOut = 3000; - begin - if Assigned(Thread) then - with Thread do begin - Priority := tpNormal; - Terminate; - while Suspended do Resume; // ensure running - if 0 <> WaitForSingleObject(Handle, ThreadTimeOut) then begin - ShowMessage('Timeout: Killing Thread: ' + Name + EOL + - 'This is a critical error and may cause memory leaks and crashes.' + EOL + - 'We recommend to reboot your system before you continue.'); - Windows.TerminateThread(Handle, 0); - end else - Thread.Free; - end; - end; - -begin - CanClose := False; - - try - AddHint('Stopping SisyphusThreads...'); - if Assigned(Sisys) then - for i := 0 to Sisys.Count-1 do - TSisyThread(Sisys[i]).Suspend; - AddToLastHint('OK'); - - AddHint('Wait for SpyThread...'); - TerminateThread(SpyThread, 'SpyThread'); - AddToLastHint('OK'); - - AddHint('Wait for SisyphusThreads...'); - if Assigned(Sisys) then - for i := 0 to Sisys.Count-1 do begin - ChangeLastHint('Wait for SisyphusThreads...' + TSisyThread(Sisys[i]).Name); - TerminateThread(TSisyThread(Sisys[i]), TSisyThread(Sisys[i]).Name); - end; - ChangeLastHint('Wait for SisyphusThreads...OK'); - except - with WorkWin.HintLB.Items do - ShowMessage('Error while trying to terminate threads.' + EOL + - 'Last Message:' + EOL + - Strings[Count - 1]); - CanClose := True; - end; - - AddHint('Terminating successfull.'); - CanClose := True; -end; - -procedure TMainWin.FormClose(Sender: TObject; var Action: TCloseAction); - - procedure TryClose(Win: TCustomForm); - begin - if Assigned(Win) and Win.Visible then - Win.Close; - end; - -begin - MainReg.Free; - - Action := caFree; - - if DontSavePrefs then - Exit; - - AddHint('Saving settings...'); - - try - TryClose(WorkWin); - TryClose(ValuesWin); - TryClose(TreeWin); - TryClose(FindWin); - TryClose(SplashWin); - TryClose(PrefWin); - except - DontSavePrefs := True; //try again without pref saving - end; - - with PlutoKey.GetKey('Window') do - try - WriteBool('Maximized', WindowState = wsMaximized); - if WindowState = wsNormal then begin - WriteInteger('Left', Left); - WriteInteger('Top', Top); - WriteInteger('Width', Width); - WriteInteger('Height', Height); - end; - finally - Free; - end; -end; - -procedure TMainWin.Plutoini1Click(Sender: TObject); -begin - NotePad(PlutoIniFileName); - ShowMessage('Click OK when you finished editing.' + EOL + - '(Pluto will reload ' + PlutoIniFileName + ')'); - PrefWin.PrefHost.Load; -end; - -procedure TMainWin.RegEdit2Click(Sender: TObject); -begin - RegEdit; -end; - -procedure TMainWin.SysEdit1Click(Sender: TObject); -begin - SysEdit; -end; - -procedure TMainWin.NotePad1Click(Sender: TObject); -begin - NotePad; -end; - -procedure TMainWin.WordPad1Click(Sender: TObject); -begin - WordPad; -end; - -procedure TMainWin.OpenWinDir1Click(Sender: TObject); -begin - ExploreFolder(WinDir); -end; - -procedure TMainWin.OpenProgramFolder1Click(Sender: TObject); -begin - ExploreFolder(MyDir); -end; - -procedure TMainWin.ExitPluto1Click(Sender: TObject); -begin - Close; -end; - -procedure TMainWin.Find1Click(Sender: TObject); -begin - FindWin.SfRootKeyRB.Checked := True; - FindWin.Show; -end; - -procedure TMainWin.FormPaint(Sender: TObject); -begin - if Started and not MainWinLoaded then begin - MainWinLoaded := True; - Load; - end; -end; - -procedure TMainWin.StatusBarDrawPanel(StatusBar: TStatusBar; - Panel: TStatusPanel; const Rect: TRect); -begin - with StatusBar.Canvas do begin - Brush.Color := clBlack; - FillRect(Rect); - with Font do begin - Name := 'MS Sans Serif'; - Style := []; - case Panel.Index of - 0: if HintBlinkT.Enabled then - Color := clBrightRed - else - Color := clBrightSilver; - 1: Color := clWhite; - 2: Color := clCyan; - 3: Color := clBrightPurple; - end; - end; - - if Panel.Alignment = taRightJustify then - TextOut(Rect.Right - TextWidth(Panel.Text), Rect.Top, Panel.Text) - else - TextOut(Rect.Left, Rect.Top, Panel.Text); - end; -end; - -procedure TMainWin.PathEKeyPress(Sender: TObject; var Key: Char); -begin - if Key = #127 then //Silly key management - Key := #0; -end; - -procedure TMainWin.HintBlinkTTimer(Sender: TObject); -begin - StatusBar.Panels[0].Text := 'Ready'; - StopHintBlinking; -end; - -procedure TMainWin.StopHintBlinking; -begin - HintBlinkT.Enabled := False; - PreBlinkHint := NoPreBlinkHint; -end; - -procedure TMainWin.FindCLSID1Click(Sender: TObject); -begin - FindCLSID; -end; - -procedure TMainWin.GotoCLSID1Click(Sender: TObject); -begin - GotoCLSID; -end; - -procedure TMainWin.CommandLineParameters1Click(Sender: TObject); -begin - NotePad(PlutoDir + 'Params.txt'); -end; - -procedure TMainWin.DeleteTempFolder1Click(Sender: TObject); -begin - if mrYes = MessageDlg('Deleting ' + Quote(TempDir + '*.*' + EOL, '"') + - 'Are you sure?', mtConfirmation, [mbYes, mbCancel], 0) then - DeleteFiles(TempDir + '*.*', False); -end; - -procedure TMainWin.CurrentDir1Click(Sender: TObject); -begin - ShowMessage('MyDir: ' + MyDir + EOL + - 'PlutoDir: ' + PlutoDir + EOL + - 'CurrentDir: ' + GetCurrentDir + EOL + - 'Params: ' + EOL + - GetParams(EOL)); -end; - -procedure TMainWin.RepairPluto155bBug1Click(Sender: TObject); -var - Msg: string; - Reg: TXRegistry; -begin - Reg := TXRegistry.Create; - - try - Reg.RootKey := HKCU; - Reg.OpenKey('Software'); - Msg := ''; - if Reg.KeyExists('Sisyphus') then - Msg := Msg + 'HKCU\Software\Sisyphus' + EOL; - if Reg.KeyExists('Main') then - Msg := Msg + 'HKCU\Software\Main' + EOL; - if Reg.KeyExists('Spy') then - Msg := Msg + 'HKCU\Software\Spy' + EOL; - if Reg.KeyExists('View') then - Msg := Msg + 'HKCU\Software\View' + EOL; - if Msg = '' then begin - ShowMessage('No bug detected :-)'); - end else begin - Msg := - 'Hi folks!' + EOL + - 'We are very sorry: A bug in Pluto made some components in the Edit' + EOL + - 'window save their values to the regsitry instead of the ini file.' + EOL + - 'If you want to repair that, you have to delete the following keys:' + EOL + - EOL + - Msg + - EOL + - 'This is not dangerous at all, but if you are interested in having' + EOL + - 'a clean registry, you should delete this useless keys.' + EOL + - EOL + - 'You surely noticed that this key names are rubish because they are' + EOL + - 'in the level that is normally used by programs.' + EOL + - 'If you have programs installed that use this keys for their' + EOL + - 'preferences, you may get problems when deleting the keys!' + EOL + - EOL + - 'So, now you have to decide what to do:' + EOL + - EOL + - 'Yes: Delete the keys. You have to confirm the deleting of each key.' + EOL + - 'No: Jump to the Software key and delete manually.' + EOL + - 'Cancel: Do nothing.' + EOL + - 'Yes to All: Delete all keys.'; - - case MessageDlg(Msg, mtWarning, [mbYes, mbNo, mbYesToAll, mbCancel], 0) of - mrYes: begin - if Reg.KeyExists('Main') - and (mrYes=MessageDlg('Delete HKU\Software\Main ?', - mtWarning, [mbYes, mbNo], 0)) then - Reg.DeleteKey('Main'); - - if Reg.KeyExists('Sisyphus') - and (mrYes=MessageDlg('Delete HKU\Software\Sisyphus ?', - mtWarning, [mbYes, mbNo], 0)) then - Reg.DeleteKey('Sisyphus'); - - if Reg.KeyExists('Spy') - and (mrYes=MessageDlg('Delete HKU\Software\Spy ?', - mtWarning, [mbYes, mbNo], 0)) then - Reg.DeleteKey('Spy'); - - if Reg.KeyExists('View') - and (mrYes=MessageDlg('Delete HKU\Software\View ?', - mtWarning, [mbYes, mbNo], 0)) then - Reg.DeleteKey('View'); - end; - - mrYesToAll: begin - Reg.DeleteKey('Main'); - Reg.DeleteKey('Sisyphus'); - Reg.DeleteKey('Spy'); - Reg.DeleteKey('View'); - end; - - mrNo: begin - TreeWin.SetFocus; - GotoKey('HKCU\Software\'); - end; - end; - end; - - finally - Reg.Free; - end; -end; - -procedure TMainWin.BackupRegistryscanreg1Click(Sender: TObject); -begin - ExecFile('scanreg'); -end; - -procedure TMainWin.Username1Click(Sender: TObject); -begin - ShowMessage(UserName); -end; - -procedure TMainWin.ToDoMIClick(Sender: TObject); -begin - NotePad(PlutoDir + 'ToDo.txt'); -end; - -procedure TMainWin.MailLinkMIClick(Sender: TObject); -begin - MailTo(TMenuItem(Sender).Caption); -end; - -procedure TMainWin.IjustwantCONTACT1Click(Sender: TObject); -begin - MailTo('pluto@cYcnus.de'); -end; - -procedure TMainWin.ExternalHexEditMIClick(Sender: TObject); -begin - ExecFile(PrefWin.ExternalHexEditE.Text); -end; - -procedure TMainWin.AnotherPluto1Click(Sender: TObject); -begin - ExecFile(Application.ExeName); -end; - -procedure TMainWin.Path1Click(Sender: TObject); -begin -{$IFDEF UNIKEY} - UserUniPath := InputBox('UniKey', 'Input an UniPath.' + EOL + - EOL + - 'No idea? Try one of these: ' + EOL + - 'WinAmpVisColor :' + EOL + - 'Params:' + EOL + - 'Reg: HKCU' + EOL + - 'Ini <' + MyDir + 'pluto.ini>:' + EOL + - 'Ini <' + MyDir + 'pluto.ini>:[View]' + EOL, - UserUniPath); -{$ENDIF} -end; - -procedure TMainWin.RegisterPlugIns1Click(Sender: TObject); -begin -{$IFDEF UNIKEY} - if UniPluginOD.Execute then - RegisterUniClass(UniPluginOD.FileName); -{$ENDIF} -end; - -procedure TMainWin.FormResize(Sender: TObject); -begin - ArrangeIcons; - ArrangePlutoStyle; - WorkWin.WindowState := wsNormal; - ValuesWin.WindowState := wsNormal; - TreeWin.WindowState := wsNormal; -end; - -procedure TMainWin.SwapLM_CUBClick(Sender: TObject); -var - Path: string; -begin - Path := TraceKey(PathE.Text, uhShortcuts); - if SwapHKU_HKLM(Path) then begin - PathE.Text := Path; - UserGotoKey; - end; -end; - -procedure TMainWin.ShowLoadreport1Click(Sender: TObject); -begin - NotePad(MyDir + 'loadreport.txt'); -end; - -procedure TMainWin.KillPluto1Click(Sender: TObject); -begin - Application.Terminate; -end; - -procedure TMainWin.ShowPlatform1Click(Sender: TObject); -begin - ShowMessage(Format('Platform: %s' + EOL + - 'Versin: %d.%d Build %d', - [PlatformStrings[Win32Platform], - Win32MajorVersion, Win32MinorVersion, Win32BuildNumber])); -end; - -procedure TMainWin.MSConfig1Click(Sender: TObject); -begin - ExecFile('msconfig'); -end; - -procedure TMainWin.TimetoRelaxMIClick(Sender: TObject); -var - RelaxFile: string; -begin - with PlutoKey.GetKey('Main') do - try - RelaxFile := ReadString('Relax'); - finally - Free; - end; - - if RelaxFile = '' then - ShowMessage('This menu item can be used for something that lets you relax,' + EOL + - 'for example Diablo2, you favorite song or the latest news about the' + EOL + - 'decreasing AOL member numbers.' + EOL + - EOL + - 'Feel free to use everything you want.' + EOL + - 'Open the pluto.ini (CTRL+I) and add a new value "Relax" in the "Main"' + EOL + - 'section.' + EOL + - EOL + - 'And don''t forget:' + EOL + - 'R E L A X ! ! !') - else - ExecFile(RelaxFile); -end; - -procedure TMainWin.OnSisyChange(Sender: TSisyThread; Change: TSisyChange); - - procedure UpdateValue; - var - Reg: TXRegistry; - Index: Integer; - begin - if not SameRegPath(ExRegFullKey(Change.Path), PathOfNode(RegTV.Selected)) then - Exit; - - Reg := TXRegistry.Create; - try - Reg.RootKey := HKEYOfStr(ExRegRoot(Change.Path)); - if Reg.OpenKey(ExRegKey(Change.Path)) then - with ValuesWin do begin - Index := FindItemByRealName(ExRegValue(Change.Path)); - if Index > -1 then begin - if Change.Typ = cValueMinus then - ValueList.Items.Delete(Index) - else if Change.Typ = cContextChange then - UpdateValue(Reg, ValueList.Items[Index]); - end else if Change.Typ = cValuePlus then - AddValue(Reg, ExRegValue(Change.Path)); - end; - finally - Reg.Free; - end; - end; - -begin - AddHint(Sender.Name + ' notified ' + Change.Path); - if Change.Typ in [cValueMinus, cValuePlus, cContextChange] then - UpdateValue; -end; - -procedure TMainWin.OnSisyValuePlus(Sender: TSisyThread; Change: TSisyChange); -var - Reg: TXRegistry; -begin - if not SameRegPath(ExRegFullKey(Change.Path), PathOfNode(RegTV.Selected)) then - Exit; - - Reg := TXRegistry.Create; - try - Reg.RootKey := HKEYOfStr(ExRegRoot(Change.Path)); - if Reg.OpenKey(ExRegKey(Change.Path)) then - ValuesWin.AddValue(Reg, ExRegValue(Change.Path)); - finally - Reg.Free; - end; -end; - -procedure TMainWin.OnSisyValueMinus(Sender: TSisyThread; Change: TSisyChange); -var - Reg: TXRegistry; - Index: Integer; -begin - if not SameRegPath(ExRegFullKey(Change.Path), PathOfNode(RegTV.Selected)) then - Exit; - - Reg := TXRegistry.Create; - try - Reg.RootKey := HKEYOfStr(ExRegRoot(Change.Path)); - if Reg.OpenKey(ExRegKey(Change.Path)) then - with ValuesWin do begin - Index := FindItemByRealName(ExRegValue(Change.Path)); - if Index > -1 then - ValueList.Items.Delete(Index); - end; - finally - Reg.Free; - end; -end; - -procedure TMainWin.OnSisyContextChange(Sender: TSisyThread; Change: TSisyChange); -var - Reg: TXRegistry; - Index: Integer; -begin - if not SameRegPath(ExRegFullKey(Change.Path), PathOfNode(RegTV.Selected)) then - Exit; - - Reg := TXRegistry.Create; - try - Reg.RootKey := HKEYOfStr(ExRegRoot(Change.Path)); - if Reg.OpenKey(ExRegKey(Change.Path)) then - with ValuesWin do begin - Index := FindItemByRealName(ExRegValue(Change.Path)); - if Index > -1 then - UpdateValue(Reg, ValueList.Items[Index]); - end; - finally - Reg.Free; - end; -end; - -end. -unit PrefU; - -interface - -uses - Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, ComCtrls, ExtCtrls, StdCtrls, PlutoConst, NewPanels, PrefTools, - YTools, YTypes, start, XReg, LinkLabel; - -type - TPrefWin = class(TForm) - PrefPC: TPageControl; - CommonPage: TTabSheet; - KeyPage: TTabSheet; - DataPage: TTabSheet; - KeysBP: TBorderPanel; - GroupBox3: TGroupBox; - MainPrevBP: TBorderPanel; - GroupBox4: TGroupBox; - BorderPanel6: TBorderPanel; - GroupBox6: TGroupBox; - SortKeysCB: TPrefCheckBox; - PrefHost: TPrefHost; - MainPreviewCB: TPrefCheckBox; - SplashScreenCB: TPrefCheckBox; - PrefValuesPC: TPageControl; - StringPage: TTabSheet; - MultiStringPage: TTabSheet; - IntPage: TTabSheet; - BinaryPage: TTabSheet; - BorderPanel8: TBorderPanel; - GroupBox8: TGroupBox; - ShowDwordAsHex: TPrefCheckBox; - BorderPanel7: TBorderPanel; - GroupBox7: TGroupBox; - CountZeroByteCB: TPrefCheckBox; - BorderPanel1: TBorderPanel; - GroupBox2: TGroupBox; - UseExtendedModelCB: TPrefCheckBox; - BorderPanel2: TBorderPanel; - GroupBox1: TGroupBox; - ShowAsBinaryCB: TPrefCheckBox; - ShowBinaryAsRG: TPrefRadioGroup; - Smart4BBCB: TPrefCheckBox; - DWordPreviewL: TLabel; - Label4: TLabel; - Label5: TLabel; - Label6: TLabel; - Label7: TLabel; - UserNameE: TPrefEdit; - Label8: TLabel; - MainPreviewE: TPrefEdit; - Label12: TLabel; - DefaultIconPreviewCB: TPrefCheckBox; - KeyInfoPreviewCB: TPrefCheckBox; - SelectExternalHexEditOD: TOpenDialog; - BorderPanel3: TBorderPanel; - GroupBox9: TGroupBox; - IntegrationPage: TTabSheet; - BorderPanel4: TBorderPanel; - GroupBox5: TGroupBox; - Label11: TLabel; - SelectExternalHexEditB: TButton; - RunExternalHexEditB: TButton; - ExternalHexEditE: TPrefEdit; - Label13: TLabel; - BorderPanel5: TBorderPanel; - GroupBox10: TGroupBox; - Label15: TLabel; - RegisterAppCB: TCheckBox; - Label3: TLabel; - Memo1: TMemo; - ExpandStringsRG: TPrefRadioGroup; - QuotersE: TPrefEdit; - Label1: TLabel; - StringPreviewL: TLabel; - ShowLineCountCB: TPrefCheckBox; - ShowTreeViewLinesCB: TPrefCheckBox; - ValuePage: TTabSheet; - BorderPanel10: TBorderPanel; - GroupBox12: TGroupBox; - ShowListViewGridCB: TPrefCheckBox; - Label9: TLabel; - DefaultValueNameE: TPrefEdit; - Label10: TLabel; - GotoPlutoKeyB: TButton; - ColorPanel2: TColorPanel; - LinkLabel1: TLinkLabel; - SmartExpandCB: TPrefCheckBox; - KeysSingleClickCB: TPrefCheckBox; - ValuesSingleClickCB: TPrefCheckBox; - ShowProgressCB: TPrefCheckBox; - ColorPanel1: TColorPanel; - Label2: TLabel; - ReloadB: TButton; - DefaultB: TButton; - SaveB: TButton; - procedure PrefPCDrawTab(Control: TCustomTabControl; - TabIndex: Integer; const Rect: TRect; Active: Boolean); - procedure PrefHostLoaded(Sender: TObject); - procedure StandardPreviewChange(Sender: TObject); - procedure DataPreviewChange(Sender: TObject); - procedure UserNameEChange(Sender: TObject); - procedure FormKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); - procedure FormDeactivate(Sender: TObject); - procedure FormActivate(Sender: TObject); - procedure PrefValuesPCDrawTab(Control: TCustomTabControl; - TabIndex: Integer; const Rect: TRect; Active: Boolean); - procedure ShowDwordAsHexClick(Sender: TObject); - procedure MainPreviewEChange(Sender: TObject); - procedure FormCreate(Sender: TObject); - procedure ActivateIt(Sender: TObject); - procedure DeActivateIt(Sender: TObject); - procedure ReloadBClick(Sender: TObject); - procedure RunExternalHexEditBClick(Sender: TObject); - procedure SelectExternalHexEditBClick(Sender: TObject); - procedure ExternalHexEditEChange(Sender: TObject); - procedure DefaultBClick(Sender: TObject); - procedure RegisterAppCBClick(Sender: TObject); - procedure SaveBClick(Sender: TObject); - procedure StringPreviewChange(Sender: TObject); - procedure ShowTreeViewLinesCBClick(Sender: TObject); - procedure ShowListViewGridCBClick(Sender: TObject); - procedure DefaultValueNameEChange(Sender: TObject); - procedure LoadPrefs; - procedure UseExtendedModelCBClick(Sender: TObject); - procedure IntegrationPageShow(Sender: TObject); - procedure GotoPlutoKeyBClick(Sender: TObject); - procedure FormShow(Sender: TObject); - procedure KeysSingleClickCBClick(Sender: TObject); - procedure ValuesSingleClickCBClick(Sender: TObject); - procedure QuotersEChange(Sender: TObject); - procedure SplashScreenCBClick(Sender: TObject); - procedure SaveBMouseMove(Sender: TObject; Shift: TShiftState; X, - Y: Integer); - public - StringQuoterBegin, StringQuoterEnd: string; - end; - -var - PrefWin: TPrefWin; - -implementation - -uses - TreeU, ValuesU, Splash, plutomain, WorkU; - -{$R *.dfm} - -procedure TPrefWin.PrefPCDrawTab(Control: TCustomTabControl; - TabIndex: Integer; const Rect: TRect; Active: Boolean); -var - PC: TPageControl; - Page: TTabSheet; -begin - PC := TPageControl(Control); - Page := PC.Pages[TabIndex]; - with PC.Canvas.Font do begin - if Page.Caption = 'Common' then - Color := clWhite - else if Page.Caption = 'Keys' then - Color := clBrightCyan - else if Page.Caption = 'Values' then - Color := clBrightPurple - else if Page.Caption = 'Data' then - Color := clBrightBlue - else if Page.Caption = 'System' then - Color := clBrightYellow - else - Color := clWhite; - end; - - with PC.Canvas do - if Active then begin - Font.Style := [fsBold]; - Brush.Color := clDarkGray; - FillRect(Rect); - TextOut(Rect.Left + 5, Rect.Top + 3, Page.Caption); - end else begin - Font.Style := []; - Brush.Color := clDarkGray; - FillRect(Rect); - TextOut(Rect.Left + 3, Rect.Top + 2, Page.Caption); - end; -end; - -procedure TPrefWin.PrefHostLoaded(Sender: TObject); -begin - PrefHost.KeyName := PlutoUniPath; -end; - -procedure TPrefWin.StandardPreviewChange(Sender: TObject); -begin - if Started then - RegTV.Repaint; -end; - -procedure TPrefWin.DataPreviewChange(Sender: TObject); -begin - if not Started then - Exit; - - ValuesWin.UpdateValues; - RegTV.Repaint; -end; - -procedure TPrefWin.UserNameEChange(Sender: TObject); -begin - StatusBar.Panels[0].Text := MainWin.Greeting; -end; - -procedure TPrefWin.FormKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if Key = VK_ESCAPE then - Close; - - if Key = VK_SCROLL then - MainWin.FormKeyDown(Sender, Key, Shift); -end; - -procedure TPrefWin.FormDeactivate(Sender: TObject); -begin - if ActiveControl.Tag = EditControlFlag then - DeActivateThis(ActiveControl); - - AlphaBlendValue := 127; -end; - -procedure TPrefWin.FormActivate(Sender: TObject); -begin - if Started and (ActiveControl.Tag = EditControlFlag) then - ActivateThis(ActiveControl); - - AlphaBlendValue := 255; -end; - -procedure TPrefWin.PrefValuesPCDrawTab(Control: TCustomTabControl; - TabIndex: Integer; const Rect: TRect; Active: Boolean); -var - PC: TPageControl; - Page: TTabSheet; -begin - PC := TPageControl(Control); - Page := PC.Pages[TabIndex]; - with PC.Canvas.Font do begin - if Page = StringPage then - Color := clBrightRed - else if Page = MultiStringPage then - Color := clBrightPurple - else if Page = IntPage then - Color := clBrightBlue - else if Page = BinaryPage then - Color := clBrightGreen; - end; - - with PC.Canvas do - if Active then begin - Font.Style := [fsBold]; - Brush.Color := clDarkGray; - FillRect(Rect); - TextOut(Rect.Left + 18 + 5, Rect.Top + 3, Page.Caption); - PC.Images.Draw(PC.Canvas, Rect.Left + 4, Rect.Top + 2, Page.ImageIndex); - end else begin - Font.Style := []; - Brush.Color := clDarkGray; - FillRect(Rect); - TextOut(Rect.Left + 18 + 3, Rect.Top + 2, Page.Caption); - PC.Images.Draw(PC.Canvas, Rect.Left + 1, Rect.Top + 1, Page.ImageIndex); - end; -end; - -procedure TPrefWin.ShowDwordAsHexClick(Sender: TObject); -begin - DWordPreviewL.Caption := 'Preview: ' + ValuesU.DataPreviewOfContext( - RegContext(rdCardinal, Reverse(ByteAOfHex(HexOfCard(1234567890, 8))))); - DataPreviewChange(Self); -end; - -procedure TPrefWin.MainPreviewEChange(Sender: TObject); -begin - if MainPreviewE.Text = '' then - MainPreviewCB.Caption := '&Show Preview for Default Value' - else - MainPreviewCB.Caption := '&Show Preview for ' + - Quote(MainPreviewE.Text); - - StandardPreviewChange(Self); -end; - -procedure TPrefWin.FormCreate(Sender: TObject); -begin - UserNameE.DefaultValue := UserName; - MainPreviewEChange(Self); - PrefPC.ActivePageIndex := 0; - PrefValuesPC.ActivePageIndex := 0; -end; - -procedure TPrefWin.ActivateIt(Sender: TObject); -begin - ActivateThis(Sender); -end; - -procedure TPrefWin.DeActivateIt(Sender: TObject); -begin - DeActivateThis(Sender); -end; - -procedure TPrefWin.ReloadBClick(Sender: TObject); -begin - LoadPrefs; -end; - -procedure TPrefWin.RunExternalHexEditBClick(Sender: TObject); -var - FileName, TestValue: string; -begin - FileName := TempDir + '~test.bin'; - TestValue := 'This is only a test.' + EOL + - 'Everything seems to be OK.'; - if SaveByteA(ByteAOfStr(TestValue), FileName) then - ExecFileWith(ExternalHexEditE.Text, FileName) - else - ShowMessage('Could not write into file:' + EOL + - FileName); -end; - -procedure TPrefWin.SelectExternalHexEditBClick(Sender: TObject); -begin - with SelectExternalHexEditOD do begin - InitialDir := ExtractPath(ExternalHexEditE.Text); - FileName := ExtractFileName(ExternalHexEditE.Text); - if Execute and FileExists(FileName) then - ExternalHexEditE.Text := FileName; - end; -end; - -procedure TPrefWin.ExternalHexEditEChange(Sender: TObject); -begin - RunExternalHexEditB.Enabled := FileExists(ExternalHexEditE.Text); - if Assigned(WorkWin) then - WorkWin.ExternalEditB.Enabled := RunExternalHexEditB.Enabled; - if Assigned(MainWin) then - MainWin.ExternalHexEditMI.Enabled := RunExternalHexEditB.Enabled; -end; - -procedure TPrefWin.DefaultBClick(Sender: TObject); -begin - if mrYes=MessageDlg('Do you really want to reset the preferences' + EOL + - 'to their defaults?' + EOL + - '(This can not be undone.)', mtWarning, [mbYes, mbCancel], 0) then begin - CopyFile(PChar(PlutoIniFileName), PChar(PlutoIniFileName + '.backup'), False); - //PrefHost.KeyName := 'Ini <' + PlutoIniFileName + '.backup>:'; - //PrefHost.Save; - //PrefHost.KeyName := PlutoUniPath; - PrefHost.BackUp; - end; -end; - -procedure TPrefWin.RegisterAppCBClick(Sender: TObject); -begin - with TXRegistry.Create do - try - RootKey := HKLM; - OpenKey('Software\Microsoft\Windows\CurrentVersion\App Paths'); - if RegisterAppCB.Checked then begin - OpenKey('pluto.exe', True); - WriteString('', GetFileNew(Application.ExeName)); - end else - DeleteKey('pluto.exe'); - finally - Free; - end; -end; - -procedure TPrefWin.SaveBClick(Sender: TObject); -begin - PrefHost.Save; -end; - -procedure TPrefWin.StringPreviewChange(Sender: TObject); -begin - StringPreviewL.Caption := 'Preview: ' + ValuesU.DataPreviewOfContext( - RegContext(rdString, ByteAOfStr('%windir%'))); - DataPreviewChange(Self); -end; - -procedure TPrefWin.ShowTreeViewLinesCBClick(Sender: TObject); -begin - with RegTV do begin - ShowLines := ShowTreeViewLinesCB.Checked; - ShowButtons := ShowLines; - end; - StandardPreviewChange(Sender); -end; - -procedure TPrefWin.ShowListViewGridCBClick(Sender: TObject); -begin - ValueList.GridLines := ShowListViewGridCB.Checked; -end; - -procedure TPrefWin.DefaultValueNameEChange(Sender: TObject); -begin - DefaultValueCaption := DefaultValueNameE.Text; - if Started then - TreeWin.RegTVChange(Self, RegTV.Selected); -end; - -procedure TPrefWin.LoadPrefs; -begin - PrefHost.Load; -end; - -procedure TPrefWin.UseExtendedModelCBClick(Sender: TObject); -begin - WorkWin.MultiStringTypeRG.ItemIndex := Integer(UseExtendedModelCB.Checked); - DataPreviewChange(Sender); -end; - -procedure TPrefWin.IntegrationPageShow(Sender: TObject); -begin - with TXRegistry.Create do - try - RootKey := HKLM; - OpenKey('Software\Microsoft\Windows\CurrentVersion\App Paths\pluto.exe'); - RegisterAppCB.Checked := SameFileName(GetFileNew(ReadString('')), - GetFileNew(Application.ExeName)); - finally - Free; - end; -end; - -procedure TPrefWin.GotoPlutoKeyBClick(Sender: TObject); -begin - MainWin.GotoKey('HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\pluto.exe'); -end; - -procedure TPrefWin.FormShow(Sender: TObject); -begin - PrefHost.Load; -end; - -procedure TPrefWin.KeysSingleClickCBClick(Sender: TObject); -begin - TreeWin.CheckRegTVHotTrack; -end; - -procedure TPrefWin.ValuesSingleClickCBClick(Sender: TObject); -begin - ValuesWin.CheckValueListHotTrack; -end; - -procedure TPrefWin.QuotersEChange(Sender: TObject); -var - QBegin, QEnd: string; -begin - with QuotersE do begin - if Text = '' then - QBegin := '' - else - QBegin := Text[1]; - if Length(Text) < 2 then - QEnd := QBegin - else - QEnd := Text[2]; - end; - - if (QBegin <> StringQuoterBegin) or (QEnd <> StringQuoterEnd) then begin - StringQuoterBegin := QBegin; - StringQuoterEnd := QEnd; - StringPreviewChange(Self); - end; -end; - -procedure TPrefWin.SplashScreenCBClick(Sender: TObject); -begin - if Started and Assigned(SplashWin) then - SplashWin.SplashScreenCB.Checked := SplashScreenCB.Checked; -end; - -procedure TPrefWin.SaveBMouseMove(Sender: TObject; Shift: TShiftState; X, - Y: Integer); -begin - Label2.Font.Color := clBrightRed; - Application.ProcessMessages; - Sleep(200); - Label2.Font.Color := clWhite; -end; - -end. -unit RegScanner; - -interface - -uses - Windows, SysUtils, Dialogs, Classes, - YTools, YTypes, XReg, Clock; - -type - TRegScanThread = class; - - TRegScanKeyEvent = procedure (Sender: TRegScanThread; const KeyName: string; Key: HKEY; Info: TRegKeyInfo) of object; - TRegScanValueEvent = procedure (Sender: TRegScanThread; const ValueName: string; Context: TRegContext) of object; - - TRegScanTask = record - Root: string; - Key: HKEY; - end; - TRegScanTasks = array of TRegScanTask; - - TRegScanThread = class(TThread) - private - Keys, KeysOK, Values, ValuesOK: Integer; - DoScanValues: Boolean; - FOnKey: TRegScanKeyEvent; - FOnValue: TRegScanValueEvent; - FOnFaileKey: TRegScanKeyEvent; - protected - procedure ScanKey(Key: HKEY; const KeyName: string = ''); virtual; - procedure ScanValues(Key: HKEY; Info: TRegKeyInfo); virtual; - - public - Path: string; - CurrentTask: TRegScanTask; - Tasks: TRegScanTasks; - destructor Destroy; override; - procedure Execute; override; - procedure ScanAll; - function CurrentPath: string; - published - constructor CreateIt(PriorityLevel: TThreadPriority; - DoScanValues: Boolean = True; Tasks: TRegScanTasks = nil); - - property OnKey: TRegScanKeyEvent read FOnKey write FOnKey; - property OnValue: TRegScanValueEvent read FOnValue write FOnValue; - property OnFaileKey: TRegScanKeyEvent read FOnFaileKey write FOnFaileKey; - end; - -implementation - -{ TRegScanThread } - -constructor TRegScanThread.CreateIt(PriorityLevel: TThreadPriority; - DoScanValues: Boolean = True; Tasks: TRegScanTasks = nil); -begin - inherited Create(True); - Priority := PriorityLevel; - FreeOnTerminate := False; - Self.DoScanValues := DoScanValues; - Self.Tasks := Tasks; -end; - -destructor TRegScanThread.Destroy; -begin - inherited; -end; - -procedure TRegScanThread.ScanAll; -var - i: Integer; -begin - Keys := 0; - KeysOK := 0; - Values := 0; - ValuesOK := 0; - - for i := 0 to High(Tasks) do begin - CurrentTask := Tasks[i]; - with CurrentTask do begin - Inc(Keys); - ScanKey(Key); - end; - - if Terminated then Break; - end; -end; - -procedure TRegScanThread.ScanValues(Key: HKEY; Info: TRegKeyInfo); -var - i: Integer; - MaxLen, NameLen, Len, Typ: Cardinal; - p: PChar; - Buffer: TByteA; - - procedure ScanValue(ValueName: string; Typ: TRegDataType; Data: TByteA); - begin - if Assigned(OnValue) then - OnValue(Self, ValueName, RegContext(Typ, Data)); - Inc(ValuesOK); - end; - -begin - MaxLen := Info.MaxValueLen + 1; //Include Nullbyte - SetLength(Buffer, Info.MaxDataLen); - GetMem(p, MaxLen); - - Inc(Values, Info.NumValues); - for i := 0 to Info.NumValues-1 do begin - NameLen := MaxLen; - Len := Info.MaxDataLen; - if Success(RegEnumValue(Key, i, p, NameLen, nil, @Typ, Pointer(Buffer), - @Len)) then - ScanValue(Copy(p, 0, NameLen), Typ, Copy(Buffer, 0, Len)) - else - Yield; - end; - FreeMem(p, MaxLen); -end; - -procedure TRegScanThread.ScanKey(Key: HKEY; const KeyName: string = ''); -var - i: Integer; - NewHKEY: HKEY; - Info: TRegKeyInfo; - l, Len: DWORD; - p: PChar; - z: Integer; -begin - if Terminated then Exit; - - with Info do begin - if not Success(RegQueryInfoKey(Key, nil, nil, nil, @NumSubKeys, - @MaxSubKeyLen, nil, @NumValues, @MaxValueLen, @MaxDataLen, - nil, nil)) then - Exit; - - if Assigned(OnKey) then - OnKey(Self, KeyName, Key, Info); - if DoScanValues and (NumValues > 0) then - ScanValues(Key, Info); - - if Info.NumSubKeys > 0 then begin - Inc(Keys, NumSubKeys); - - Len := MaxSubKeyLen + 1; - GetMem(p, Len); - - for i := 0 to NumSubKeys-1 do begin - l := Len; - RegEnumKeyEx(Key, i, p, l, nil, nil, nil, nil); - if Success(RegOpenKey(Key, p, NewHKEY)) then begin - z := Length(Path); - Path := Path + '\' + p; - ScanKey(NewHKEY, p); - RegCloseKey(NewHKEY); - SetLength(Path, z); - end else - if Assigned(OnFaileKey) then - OnFaileKey(Self, p, Key, Info); - - if Terminated then - Break; - end; - FreeMem(p, Len); - end; - end; - - Inc(KeysOK); -end; - -procedure TRegScanThread.Execute; -var - Secs: Double; -begin - with TClock.Create do begin - ScanAll; - Secs := SecondsPassed; - Free; - end; - - WriteLn('finished.'); - WriteLn( Format('Keys: %6d counted (%3d failed)', [Keys, Keys - KeysOK])); - if DoScanValues then - WriteLn(Format('Values: %6d counted (%3d failed)', [Values, Values - ValuesOK])); - WriteLn('t ' + Format('%.2f', [Secs]) + ' seconds'); - if Secs > 0 then - WriteLn('r ' + Format('%.0f', [Keys / Secs]) + ' k/s'); -end; - -function TRegScanThread.CurrentPath: string; -begin - Result := CurrentTask.Root + Path; -end; - -end. -unit RegTV; - -interface - -uses - Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, - ComCtrls; - -type - TRegTV = class(TTreeView) - private - { Private-Deklarationen } - protected - { Protected-Deklarationen } - public - { Public-Deklarationen } - published - { Published-Deklarationen } - end; - -procedure Register; - -implementation - -procedure Register; -begin - RegisterComponents('pluto', [TRegTV]); -end; - -end. -unit Sisyphus; - -interface - -uses - Windows, Classes, SysUtils, XReg, YTools, YTypes, Clock; - -type - TSpyValue = class - Name: string; - Next: TSpyValue; - //DIC: TByteA; - Typ: TXRegDataType; - Data: TByteA; - constructor Create(AName: string); - end; - - TSpyKey = class - public - Parent: TSpyKey; - Name: string; - Next: TSpyKey; - Keys: TSpyKey; - Values: TSpyValue; - procedure Spy(AHKEY: HKEY); - function Path: string; - constructor Create(AParent: TSpyKey; AName: string); - destructor Destroy; override; - end; - -var - Reg: TXRegistry; - HKLMSpyKey, HKUSpyKey: TSpyKey; - Started: Boolean = False; - -implementation - -uses - Plutomain; - -procedure AddChange(M: string); -begin - Yield; - //AddHint(M); -end; - -{ TSpyValue } - -constructor TSpyValue.Create(AName: string); -begin - Name := AName; - Next := nil; -end; - -{ TSpyKey } - -constructor TSpyKey.Create(AParent: TSpyKey; AName: string); -begin - Name := AName; - Parent := AParent; - - Next := nil; - Keys := nil; - Values := nil; -end; - -destructor TSpyKey.Destroy; -var - Value, NextValue: TSpyValue; - Key, NextKey: TSpyKey; -begin - Value := Values; - while Value <> nil do begin - NextValue := Value.Next; - Value.Free; - Value := NextValue; - end; - - Key := Keys; - while Key <> nil do begin - NextKey := Key.Next; - Key.Free; - Key := NextKey; - end; - - inherited; -end; - -function TSpyKey.Path: string; -begin - if Assigned(Parent) then - Result := Parent.Path + '\' - else - Result := 'Reg: '; - - Result := Result + Name; -end; - -procedure TSpyKey.Spy(AHKEY: HKEY); -var - SL: TStringList; - - procedure CompareValues; - var - i: Integer; - Value, LastValue, NewValue, SearchValue: TSpyValue; - begin - //OK, this part is a little bit complicate. So I will comment very much. - //First, two terms are important: - // means the list of values that will be read from the registry now: - Reg.GetValueNames(SL); - //So is TStringList. - - // means the image that was saved before. - //Here, it is a linear list of TSpyValue objects. That means that you can - //only get X.Next and not X.Prev! However, I use "X.Prev" to simplify - //some comments. - - //!!! Comparing means: Make fit !!! - - //If wasn't saved before, it is just empty. - - //!!! There is no difference in comparing and saving in this method !!! - - //Building means: Comparing with an empty image. - - //We go through and make fit it - - //The following rules are important: - //Value = "The currently interesting value. - //LastValue = "The value with X.Next = Value" = "Value.Pref" - - LastValue := nil; // := "Values.Prev" - Value := Values; // := "LastValue.Next" - - //Now compare step by step - for i := 0 to SL.Count-1 do begin - if Assigned(Value) and (SL[i] = Value.Name) then begin - //cV= Normally (0.9999) everything's the same - LastValue := Value; - Value := Value.Next; - end else begin //Something's different? Yes, the IMPORTANT rest (0.0001)) - //Because the list finally must exactly fit SL, the "SL[i] value" hast - //to be inserted right here. But first let's look... - - //Maybe it was just moved? So search for it... - NewValue := nil; - if Assigned(Value) then begin - SearchValue := Value; - while Assigned(SearchValue.Next) do - if (SearchValue.Next.Name = SL[i]) then begin - //cV\ - NewValue := SearchValue.Next; - AddChange('cV\ ' + Path); - SearchValue.Next := SearchValue.Next.Next; - Break; end; - end; - - if not Assigned(NewValue) then begin - //cV+ No, not found! So it is new... - NewValue := TSpyValue.Create(SL[i]); - AddChange('cV+ ' + Path + '\\' + NewValue.Name); - with NewValue do begin - Typ := Reg.GetDataType(SL[i]); - Data := Reg.ReadBin(SL[i]); - end; - end; - - //The new object now must be placed after the last value - if Assigned(LastValue) then begin - LastValue.Next := NewValue; - end else begin - //If it's the first value, we don't have LastValue defined - //So we have to set the "Root" to it - Values := NewValue; - end; - //Now the rest of has to be placed after the new value - NewValue.Next := Value; - //And LastValue also has to refreshed: It is "Value.Pref" = NewValue! - LastValue := NewValue; - end; - end; - - //Because the whole before Value is exactly , the rest - //(if there is one) must have been deleted! - - //So first let's ensure that ends here: - if Assigned(LastValue) then begin - LastValue.Next := nil; - end else begin - //Another time: is empty now, so set Values instead - Values := nil; - end; - - //Now, the first value that maybe was "cut" off is Value: - while Assigned(Value) do begin - //cV- So, here really something HAS been deleted - LastValue := Value; - Value := Value.Next; - AddChange('cV- ' + Path + '\\' + LastValue.Name); - LastValue.Free; - end; - end; - - procedure CompareData; - var - Value: TSpyValue; - Typ: TXRegDataType; - Data: TByteA; - begin - //So, finally = . That means we now can compare the data: - Value := Values; - while Assigned(Value) do begin - Typ := Reg.GetDataType(Value.Name); - Data := Reg.ReadBin(Value.Name); - if Typ <> Value.Typ then begin - //cT# - AddChange('cT# ' + Path + '\\' + Value.Name); - Value.Typ := Typ; - end; - if not SameByteA(Data, Value.Data) then begin - //cD# - AddChange('cD# ' + Path + '\\' + Value.Name); - Value.Data := Data; - end; - - Value := Value.Next; - end; - end; - - procedure CompareKeys; - var - i: Integer; - Key, LastKey, NewKey, SearchKey: TSpyKey; - NewHKEY: HKEY; - begin - //OK, this part is a little bit complicate. So I will comment very much. - //First, two terms are important: - // means the list of keys that will be read from the registry now: - Reg.GetKeyNames(SL); - //So is TStringList. - - // means the image that was saved before. - //Here, it is a linear list of TSpyKey objects. That means that you can - //only get X.Next and not X.Prev! However, I use "X.Prev" to simplify - //some comments. - - //!!! Comparing means: Make fit !!! - - //If wasn't saved before, it is just empty. - - //!!! There is no difference in comparing and saving in this method !!! - - //Building means: Comparing with an empty image. - - //We go through and make fit it - - //The following rules are important: - //Key = "The currently interesting key. - //LastKey = "The key with X.Next = Key" = "Key.Pref" - - LastKey := nil; // := "Keys.Prev" - Key := Keys; // := "LastKey.Next" - - //Now compare step by step - for i := 0 to SL.Count-1 do begin - if Assigned(Key) and (SL[i] = Key.Name) then begin - //cK= Normally (0.9999) everything's the same - RegOpenKey(AHKEY, PChar(SL[i]), NewHKEY); - Key.Spy(NewHKEY); - LastKey := Key; - Key := Key.Next; - end else begin //Something's different? Yes, the IMPORTANT rest (0.0001)) - //Because the list finally must exactly fit SL, the "SL[i] key" hast - //to be inserted right here. But first let's look... - - //Maybe it was just moved? So search for it... - NewKey := nil; - if Assigned(Key) then begin - SearchKey := Key; - while Assigned(SearchKey.Next) do - if (SearchKey.Next.Name = SL[i]) then begin - //cK\ - NewKey := SearchKey.Next; - AddChange('cK\ ' + Path); - SearchKey.Next := SearchKey.Next.Next; - Break; end; - end; - - if not Assigned(NewKey) then begin - //cK+ No, not found! So it is new... - NewKey := TSpyKey.Create(Self, SL[i]); - AddChange('cK+ ' + Path + '\' + NewKey.Name); - - RegOpenKey(AHKEY, PChar(SL[i]), NewHKEY); - NewKey.Spy(NewHKEY); - end; - - //The new object now must be placed after the last key - if Assigned(LastKey) then begin - LastKey.Next := NewKey; - end else begin - //If it's the first key, we don't have LastKey defined - //So we have to set the "Root" to it - Keys := NewKey; - end; - //Now the rest of has to be placed after the new key - NewKey.Next := Key; - //And LastKey also has to refreshed: It is "Key.Pref" = NewKey! - LastKey := NewKey; - end; - end; - - //Because the whole before Key is exactly , the rest - //(if there is one) must have been deleted! - - //So first let's ensure that ends here: - if Assigned(LastKey) then begin - LastKey.Next := nil; - end else begin - //Another time: is empty now, so set Keys instead - Keys := nil; - end; - - //Now, the first key that maybe was "cut" off is Key: - while Assigned(Key) do begin - //cV- So, here really something HAS been deleted - LastKey := Key; - Key := Key.Next; - AddChange('cK- ' + Path + '\' + LastKey.Name); - LastKey.Free; - end; - end; - - -begin - SL := TStringList.Create; - - try - Reg.CurrentKey := AHKEY; - - CompareValues; - - CompareData; - - CompareKeys; - - finally - RegCloseKey(AHKEY); - end; - - SL.Free; -end; - -initialization - Reg := TXRegistry.Create; - HKLMSpyKey := TSpyKey.Create(nil, 'HKEY_LOCAL_MACHINE'); - HKUSpyKey := TSpyKey.Create(nil, 'HKEY_USERS'); - -finalization - Reg.Free; - HKLMSpyKey.Free; - HKUSpyKey.Free; - -end. -unit SisyphusTH; - -interface - -uses - Windows, Classes, StdCtrls, Dialogs, SysUtils, XReg, YTools, YTypes, Clock, - ComCtrls, PlutoConst, UniKey, CompEx; - -const - SisyVersion = '1.2 b3'; - StatusPoints = 25; - -type - TSisyChangeType = (cNone, cError, - cKeyPlus, cKeyMinus, - cValuePlus, cValueMinus, - cContextChange); - -const - SisyChangeStrings: array[TSisyChangeType] of string = - ('?', 'Error', - 'cK+', 'cK-', - 'cV+', 'cV-', - 'cC'); - -type - TSpyValue = class - Name: string; - Next: TSpyValue; - Context: TRegContext; - constructor Create(const Name: string; Context: TRegContext); - end; - - TSisyThread = class; - - TSpyKey = class - public - Parent: TSpyKey; - Name: string; - Next: TSpyKey; - Keys: TSpyKey; - Values: TSpyValue; - procedure Spy(AHKEY: HKEY; Sisy: TSisyThread); - function Path: string; - constructor Create(AParent: TSpyKey; AName: string); - destructor Destroy; override; - end; - - TSisyChange = class - public - Typ: TSisyChangeType; - Path: string; - Old, New: TRegContext; - constructor Create(ATyp: TSisyChangeType; const APath: string; - AOldContext: TRegContext; ANewContext: TRegContext); - procedure ReportToPluto; - end; - - TSisyChangeEvent = procedure (Sender: TSisyThread; Change: TSisyChange) of object; - TSisyThread = class(TThread) - private - Reg: TXRegistry; - Key: TSpyKey; - KeyHKEY: HKEY; - CurrentChange: TSisyChange; - FOnChange: TSisyChangeEvent; - FOnSpecialChanges: array[TSisyChangeType] of TSisyChangeEvent; - procedure FreeKey; - procedure IncKeyCount; - procedure IncKeyIndex; - function GetSpecialChange(ChangeType: TSisyChangeType): TSisyChangeEvent; - procedure SetSpecialChange(ChangeType: TSisyChangeType; - const Value: TSisyChangeEvent); - protected - procedure AddValueChange(Typ: TSisyChangeType; const Path: string; - Old, New: TRegContext); - procedure AddKeyChange(Typ: TSisyChangeType; const Path: string); - procedure Execute; override; - procedure ShowInfo; - procedure NotifyChange; - procedure ReportCurrentChange; - public - CurrentSpyKey: TSpyKey; - StatusLabel: TLabel; - Name: string; - Started: Boolean; - DoReport: Boolean; - SecsPerRound: Double; - InfoForShow: string; - OnStarted: TNotifyEvent; - KeyCount: Integer; - PrevKeyCount: Integer; - KeyIndex: Integer; - TheClock: TClock; - Uni: TUniKey; - MaxValueCountToScan, MaxKeyCountToScan, MaxDataLenToScan: Cardinal; - constructor CreateIt(const AName, AKeyName: string; AHKEY: HKEY; - ALabel: TLabel; AUniKey: TUniKey); - destructor Destroy; override; - - property OnChange: TSisyChangeEvent read FOnChange write FOnChange; - property OnSpecialChange[ChangeType: TSisyChangeType]: TSisyChangeEvent - read GetSpecialChange write SetSpecialChange; - end; - - TSisyList = class(TList) - protected - function GetSisy(Index: Integer): TSisyThread; - procedure PutSisy(Index: Integer; Sisy: TSisyThread); - public - procedure Suspend; - procedure Resume; - property Items[Index: Integer]: TSisyThread read GetSisy write PutSisy; default; - end; - -procedure SetSisyChangeState(Node: TTreeNode; Active: Boolean); -function SisyChangeActivated(Node: TTreeNode): Boolean; - -var - SisyFilter: TStringList; - -implementation - -uses plutomain, workU, ValuesU; - -procedure SetSisyChangeState(Node: TTreeNode; Active: Boolean); -begin - Node.Data := Pointer(not Active); -end; - -function SisyChangeActivated(Node: TTreeNode): Boolean; -begin - Result := Node.Data = Pointer(False); -end; - -{ TSisyThread } - -constructor TSisyThread.CreateIt(const AName, AKeyName: string; - AHKEY: HKEY; ALabel: TLabel; AUniKey: TUniKey); -begin - inherited Create(True); // Create thread suspended - - Started := False; - DoReport := True; - KeyCount := 0; - FreeOnTerminate := False; // Thread frees itself not when terminated - - KeyHKEY := AHKEY; - Name := AName; - StatusLabel := ALabel; - StatusLabel.Caption := 'Zzzzzzz...'; - - Reg := TXRegistry.Create; - TheClock := TClock.Create; - - Uni := AUniKey.GetKey(Name); - Priority := TThreadPriority(Uni.ReadInteger('Priority', Integer(tpLowest))); - PrevKeyCount := Uni.ReadInteger('KeyCount', 0); - - MaxKeyCountToScan := Cardinal(Uni.ReadInteger('ScanTuner: MaxKeys', -1)); - MaxValueCountToScan := Cardinal(Uni.ReadInteger('ScanTuner: MaxValues', -1)); - MaxDataLenToScan := Cardinal(Uni.ReadInteger('ScanTuner: MaxDataLen', -1)); - - Key := TSpyKey.Create(nil, AKeyName); -end; - -procedure TSisyThread.FreeKey; -begin - Reg.Free; - TheClock.Free; - Key.Free; -end; - -destructor TSisyThread.Destroy; -begin - Synchronize(FreeKey); - inherited; -end; - -procedure TSisyThread.Execute; -begin - InfoForShow := Name + ' initializing...'; - Synchronize(ShowInfo); - - TheClock.Restart; - Started := False; - while not Terminated do - try - KeyIndex := 0; - - { ===================== } - Key.Spy(KeyHKEY, Self); - { ===================== } - - if Terminated then - Continue; //= Exit - - SecsPerRound := TheClock.SecondsPassed; - TheClock.Restart; - if not Started then begin - Started := True; - Uni.WriteInteger('KeyCount', KeyCount); - if Assigned(OnStarted) then - OnStarted(Self); - end; - except - ShowMessage('Error in Sisyphus'); - end; -end; - -procedure TSisyThread.AddValueChange(Typ: TSisyChangeType; const Path: string; - Old, New: TRegContext); - - procedure TryNotify(Event: TSisyCHangeEvent); - begin - - end; - -begin - if not (Started and DoReport) then - Exit; - - CurrentChange := TSisyChange.Create(Typ, Path, Old, New); - Synchronize(ReportCurrentChange); - Synchronize(NotifyChange); - -// CurrentChange.Free; //this makes Pluto itself -end; - -procedure TSisyThread.AddKeyChange(Typ: TSisyChangeType; const Path: string); -begin - AddValueChange(Typ, Path, ZeroRegContext, ZeroRegContext); -end; - -procedure TSisyThread.ShowInfo; -begin - if Assigned(StatusLabel) then - StatusLabel.Caption := InfoForShow; -end; - -procedure TSisyThread.ReportCurrentChange; -begin - if Assigned(CurrentChange) then - CurrentChange.ReportToPluto; -end; - -procedure TSisyThread.IncKeyCount; -var - c: Integer; -begin - if Started then - Exit; - - Inc(KeyCount); - - if (KeyCount and $1FF) = 0 then begin - if KeyCount > PrevKeyCount then - PrevKeyCount := KeyCount; - - c := 0; - if PrevkeyCount > 0 then - c := Round((KeyCount * StatusPoints) / PrevKeyCount); - InfoForShow := '|' + MulStr('.', c) + MulStr(' ', StatusPoints - c) + '|' + - Format(' (%0.1f s) %d/%d k ', - [TheClock.SecondsPassed, KeyCount, PrevKeyCount]); - - Synchronize(ShowInfo); - end; -end; - -procedure TSisyThread.IncKeyIndex; -var - c: Integer; -begin - if not Started then - Exit; - - Inc(KeyIndex); - - if ((KeyIndex and $1FF) = 0) and (KeyCount > 0) then begin - if KeyIndex > KeyCount then - KeyCount := KeyIndex; - - c := 0; - if KeyCount > 0 then - c := Round((KeyIndex * StatusPoints) / KeyCount); - - InfoForShow := '|' + MulStr(':', c) + MulStr('.', StatusPoints - c) + '|' + - Format(' (%0.1f s) %d/%d k ', [SecsPerRound, KeyIndex, KeyCount]); - - Synchronize(ShowInfo); - end; -end; - -function TSisyThread.GetSpecialChange(ChangeType: TSisyChangeType): - TSisyChangeEvent; -begin - Result := FOnSpecialChanges[ChangeType]; -end; - -procedure TSisyThread.SetSpecialChange(ChangeType: TSisyChangeType; - const Value: TSisyChangeEvent); -begin - FOnSpecialChanges[ChangeType] := Value; -end; - -procedure TSisyThread.NotifyChange; -var - Event: TSisyChangeEvent; -begin - Event := FOnSpecialChanges[CurrentChange.Typ]; - if Assigned(Event) then - Event(Self, CurrentChange); - - if Assigned(FOnChange) then - FOnChange(Self, CurrentChange); -end; - -{ TSpyValue } - -constructor TSpyValue.Create(const Name: string; Context: TRegContext); -begin - Self.Name := Name; - Next := nil; - Self.Context := Context; -end; - -{ TSpyKey } - -constructor TSpyKey.Create(AParent: TSpyKey; AName: string); -begin - Name := AName; - Parent := AParent; - - Next := nil; - Keys := nil; - Values := nil; -end; - -destructor TSpyKey.Destroy; -var - Value, NextValue: TSpyValue; - Key, NextKey: TSpyKey; -begin - Value := Values; - while Assigned(Value) do begin - NextValue := Value.Next; - Value.Free; - Value := NextValue; - end; - - Key := Keys; - while Assigned(Key) do begin - NextKey := Key.Next; - Key.Free; - Key := NextKey; - end; - - inherited; -end; - -function TSpyKey.Path: string; -begin - if Assigned(Parent) then - Result := Parent.Path + '\' - else - Result := ''; - - Result := Result + Name; -end; - -procedure TSpyKey.Spy(AHKEY: HKEY; Sisy: TSisyThread); -var - SL: TStringList; - LastKey: TSpyKey; - - procedure CompareValues; - var - i: Integer; - Value, LastValue, NewValue, SearchValue, SearchValue_Prev: TSpyValue; - begin - //OK, this part is a little bit complicate. So I will comment very much. - //First, two terms are important: - // means the list of values that will be read from the registry now: - Sisy.Reg.GetValueNames(SL); - if Cardinal(SL.Count) > Sisy.MaxValueCountToScan then - Exit; - //So is TStringList. - - // means the image that was saved before. - //Here, it is a linear list of TSpyValue objects. That means that you can - //only get X.Next and not X.Prev! However, I use "X.Prev" to simplify - //some comments. - - //!!! Comparing means: Make fit !!! - - //If wasn't saved before, it is just empty. - - //!!! There is no difference in comparing and saving in this method !!! - - //Building means: Comparing with an empty image. - - //We go through and make fit it - - //The following rules are important: - //Value = "The currently interesting value. - //LastValue = "The value with X.Next = Value" = "Value.Pref" - - LastValue := nil; // := "Values.Prev" - Value := Values; // := "LastValue.Next" - - //Now compare step by step - for i := 0 to SL.Count-1 do begin - if Assigned(Value) and (SL[i] = Value.Name) then begin - //cV= Normally (0.9999) everything's the same - LastValue := Value; - Value := Value.Next; - end else begin //Something's different? Yes, the IMPORTANT rest (0.0001)) - //Because the list finally must exactly fit SL, the "SL[i] value" hast - //to be inserted right here. But first let's look... - - //Maybe it was just moved? So search for it... - NewValue := nil; - if Assigned(Value) then begin - SearchValue_Prev := Value; - SearchValue := Value.Next; - while Assigned(SearchValue) do begin - if SearchValue.Name = SL[i] then begin //we found our moved value - SearchValue_Prev.Next := SearchValue.Next; //delete it from - NewValue := SearchValue; //save that we found it - Break end; - SearchValue_Prev := SearchValue; - SearchValue := SearchValue.Next; - end; - end; - - if not Assigned(NewValue) then begin - //cV+ No, not found! So it is new... - NewValue := TSpyValue.Create(SL[i], Sisy.Reg.ReadContext(SL[i])); - { ================ cV+ ================ } - if Sisy.Started and Sisy.Reg.ValueReallyExists(SL[i]) then - Sisy.AddValueChange(cValuePlus, Path + '\\' + NewValue.Name, - ZeroRegContext, NewValue.Context); - end; - - //The new object now must be placed after the last value - if Assigned(LastValue) then - LastValue.Next := NewValue - else - //If it's the first value, we don't have LastValue defined - //So we have to set the "Root" to it - Values := NewValue; - - //Now the rest of has to be placed after the new value - NewValue.Next := Value; - //And LastValue also has to refreshed: It is "Value.Pref" = NewValue! - LastValue := NewValue; - end; - end; - - //Because the whole before Value is exactly , the rest - //(if there is one) must have been deleted! - - //So first let's ensure that ends here: - if Assigned(LastValue) then - LastValue.Next := nil - else - //Another time: is empty now, so set Values instead - Values := nil; - - //Now, the first value that maybe was "cut" off is Value: - while Assigned(Value) do begin - //cV- So, here really something HAS been deleted - LastValue := Value; - Value := Value.Next; - { ================ cV- ================ } - if Sisy.Started and not Sisy.Reg.ValueReallyExists(LastValue.Name) then - Sisy.AddValueChange(cValueMinus, Path + '\\' + LastValue.Name, - LastValue.Context, ZeroRegContext); - LastValue.Free; - end; - end; - - procedure CompareData; - var - Value: TSpyValue; - Context: TRegContext; - Size: Cardinal; - begin - Context := ZeroRegContext; //Initialize - //So, finally = . That means we now can compare the data: - Value := Values; - while Assigned(Value) and not Sisy.Terminated do begin - Size := Sisy.Reg.GetDataSize(Value.Name); - if (Size = Cardinal(-1)) or - (Size <= Sisy.MaxDataLenToScan) then begin - Context := Sisy.Reg.ReadContext(Value.Name); - if not SameContext(Context, Value.Context) then begin - { ================ cC ================ } - Sisy.AddValueChange(cContextChange, Path + '\\' + Value.Name, - Value.Context, Context); - Value.Context := Context; - end; - end; - - Value := Value.Next; - end; - end; - - procedure CompareKeys; - var - i: Integer; - Key, LastKey, NewKey, SearchKey, SearchKey_Prev: TSpyKey; - SavedDoReport: Boolean; - NewHKEY: HKEY; - begin - //OK, this part is a little bit complicate. So I will comment very much. - //First, two terms are important: - // means the list of keys that will be read from the registry now: - - Sisy.Reg.GetKeyNames(SL); - if Cardinal(SL.Count) > Sisy.MaxKeyCountToScan then - Exit; - //So is TStringList. - - // means the image that was saved before. - //Here, it is a linear list of TSpyKey objects. That means that you can - //only get X.Next and not X.Prev! However, I use "X.Prev" to simplify - //some comments. - - //!!! Comparing means: Make fit !!! - - //If wasn't saved before, it is just empty. - - //!!! There is no difference in comparing and saving in this method !!! - - //Building means: Comparing with an empty image. - - //We go through and make fit it - - //The following rules are important: - //Key = "The currently interesting key. - //LastKey = "The key with X.Next = Key" = "Key.Pref" - - LastKey := nil; // := "Keys.Prev" - Key := Keys; // := "LastKey.Next" - - //Now compare step by step - for i := 0 to SL.Count-1 do begin - if Assigned(Key) and (SL[i] = Key.Name) then begin - //cK= Normally (0.9999) everything's the same - if Success(RegOpenKey(AHKEY, PChar(SL[i]), NewHKEY)) then - try - Key.Spy(NewHKEY, Sisy); - finally - RegCloseKey(NewHKEY); - end; - if Sisy.Terminated then - Exit; - - LastKey := Key; - Key := Key.Next; - end else begin //Something's different? Yes, the IMPORTANT rest (0.0001)) - //Because the list finally must exactly fit SL, the "SL[i] key" has - //to be inserted right here. But first let's look... - - //Maybe it was just moved? So search for it... - NewKey := nil; - if Assigned(Key) then begin - SearchKey_Prev := Key; - SearchKey := Key.Next; - while Assigned(SearchKey) do begin - if SearchKey.Name = SL[i] then begin //we found our moved key - SearchKey_Prev.Next := SearchKey.Next; //delete it from - NewKey := SearchKey; //save that we found it - Break end; - SearchKey_Prev := SearchKey; - SearchKey := SearchKey.Next; - end; - end; - - if not Assigned(NewKey) then begin //if we didn't find it - //cK+ No, not found! So it is new... - NewKey := TSpyKey.Create(Self, SL[i]); - Sisy.IncKeyCount; - Sisy.Reg.CurrentKey := AHKEY; - { ================ cK+ ================ } - if Sisy.Started and Sisy.Reg.KeyExists(SL[i]) then - Sisy.AddKeyChange(cKeyPlus, Path + '\' + NewKey.Name); - - SavedDoReport := Sisy.DoReport; - if Success(RegOpenKey(AHKEY, PChar(SL[i]), NewHKEY)) then - try - Sisy.DoReport := False; - NewKey.Spy(NewHKEY, Sisy); //<-- recursion itself - finally - RegCloseKey(NewHKEY); - Sisy.DoReport := SavedDoReport; - end; - - if Sisy.Terminated then - Exit; - end; - - //The new key now must be placed after the last key - if Assigned(LastKey) then - LastKey.Next := NewKey - else - //If it's the first key, we don't have LastKey defined - //So we have to set the "Root" to it - Keys := NewKey; - - //Now the rest of has to be placed after the new key - NewKey.Next := Key; - //And LastKey also has to refreshed: It is "Key.Pref" = NewKey! - LastKey := NewKey; - end; - end; - - //Because the whole before Key is exactly , the rest - //(if there is one) must have been deleted! - - //So first let's ensure that ends here: - if Assigned(LastKey) then - LastKey.Next := nil - else - //Another time: is empty now, so set Keys instead - Keys := nil; - - //Now, the first key that maybe was "cut" off is Key: - while Assigned(Key) do begin - //cV- So, here really something HAS been deleted - LastKey := Key; - Key := Key.Next; - Sisy.Reg.CurrentKey := AHKEY; - { ================ cK- ================ } - if Sisy.Started and not Sisy.Reg.KeyExists(LastKey.Name) then - Sisy.AddKeyChange(cKeyMinus, Path + '\' + LastKey.Name); - LastKey.Free; - end; - end; - - -begin - if Sisy.Terminated or (AHKEY = 0) then - Exit; - LastKey := Sisy.CurrentSpyKey; - Sisy.CurrentSpyKey := Self; - - Sisy.IncKeyIndex; - - SL := TStringList.Create; - try - Sisy.Reg.CurrentKey := AHKEY; - CompareValues; - if Sisy.Started then CompareData; - CompareKeys; - finally - Sisy.Reg.CurrentKey := 0; - SL.Free; - Sisy.CurrentSpyKey := LastKey; - end; -end; - -{ TSisyChange } - -constructor TSisyChange.Create(ATyp: TSisyChangeType; const APath: string; - AOldContext: TRegContext; ANewContext: TRegContext); -begin - inherited Create; - Typ := ATyp; - Path := APath; - Old := AOldContext; - New := ANewContext; -end; - -procedure TSisyChange.ReportToPluto; -var - Node, RootNode: TTreeNode; - Root, SubPath: string; - NewNode: Boolean; - i: Integer; - - function IconOfSisyChangeType(Typ: TSisyChangeType): Integer; - begin - Result := -1; - case Typ of - //cNone, cError: Result := -1; - cKeyPlus..cContextChange: Result := Integer(Typ) - 2; - end; - end; - - function FindNode(Text: string): TTreeNode; - begin - Result := WorkWin.SisyTV.Items.GetFirstNode; - while Assigned(Result) do begin - if SameText(Result.Text, Text) then - Exit; - Result := Result.GetNextSibling; - end; - end; - -begin - if not WorkWin.SisyListCB.Checked then - Exit; - - if Typ in [cContextChange, cValueMinus, cValuePlus] then begin - Root := ExRegFullKey(Path); - SubPath := ExRegValue(Path); - end else begin - Root := UntilLastChar(ExRegFullKey(Path), '\'); - SubPath := FromLastChar(ExRegFullKey(Path), '\'); - end; - - with WorkWin do - for i := 0 to SisyFilter.Count-1 do begin - if TextAtPos(Root, 1, SisyFilter[i]) then begin - //show that it's working - with FilterChangesB do begin - Caption := 'Filter..!'; - Repaint; - Caption := 'Filter...'; - Repaint; - end; - Exit; end; - end; - - with WorkWin.SisyTV.Items do begin - BeginUpdate; - try - RootNode := FindNode(Root); - NewNode := not Assigned(RootNode); - if NewNode then begin - RootNode := AddChild(nil, Root); - RootNode.ImageIndex := iconGroup; - end else if not SisyChangeActivated(RootNode) then begin - EndUpdate; - Exit end; - - Node := AddChildObject(RootNode, SubPath, Self); - Node.ImageIndex := IconOfSisyChangeType(Typ); - if Typ = cContextChange then begin - AddChild(Node, DataPreviewOfContext(Old)).ImageIndex := iconOldContext; - AddChild(Node, DataPreviewOfContext(New)).ImageIndex := iconNewContext; - end; - finally - EndUpdate; - end; - end; - - if NewNode and WorkWin.SisyExpandGroupsCB.Checked then - RootNode.Expand(False); - - if not RootNode.Expanded then - RootNode.ImageIndex := iconGroupBlinking; -end; - -{ TSisyList } - -function TSisyList.GetSisy(Index: Integer): TSisyThread; -begin - Result := Get(Index); -end; - -procedure TSisyList.PutSisy(Index: Integer; Sisy: TSisyThread); -begin - Put(Index, Sisy); -end; - -procedure TSisyList.Resume; -var - i: Integer; -begin - for i := 0 to Count-1 do - Items[i].Resume; -end; - -procedure TSisyList.Suspend; -var - i: Integer; -begin - for i := 0 to Count-1 do - Items[i].Resume; -end; - -initialization - SisyFilter := TStringList.Create; - SisyFilter.Sorted := True; - SisyFilter.Duplicates := dupIgnore; - -finalization - SisyFilter.Free; - -end. -unit splash; - -interface - -uses - Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, - ExtCtrls, StdCtrls, ImgList, YTools, IniFiles, LinkLabel, PrefTools, - PlutoConst; - -type - TSplashWin = class(TForm) - Image1: TImage; - StartB: TButton; - SplashScreenCB: TPrefCheckBox; - LinkLabel1: TLinkLabel; - LinkLabel2: TLinkLabel; - LogoL: TLabel; - procedure StartBClick(Sender: TObject); - procedure FormShow(Sender: TObject); - procedure FormCreate(Sender: TObject); - procedure FormHide(Sender: TObject); - procedure FormKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); - procedure SplashScreenCBClick(Sender: TObject); - end; - -var - SplashWin: TSplashWin; - -implementation - -uses plutomain, TreeU, WorkU, PrefU; - -{$R *.DFM} - -procedure TSplashWin.StartBClick(Sender: TObject); -begin - Close; -end; - -procedure TSplashWin.FormShow(Sender: TObject); -const - Messages: array[0..12] of string = ('Let''s see...', - 'Ready', - 'Hello World!', - 'Start', - 'OK', - 'Pluto!', - 'Go Go Go', - 'Everything''s OK', - 'Yes!', - 'God save the Queen', - 'Oh yeah', - 'Yabadabadoo!', - 'Don''t worry, be happy!' - ); -var - ImageFile: string; -begin - Left := (Screen.Width - Width) div 2; - Top := (Screen.Height - Height) div 2; - - StartB.Caption := Messages[Random(Length(Messages))]; - SplashWin.SplashScreenCB.Load; - - Caption := 'cYcnus.Pluto ' + Version + ' says ' + MainWin.Greeting; - - try - ImageFile := PlutoDir + 'logo deluxe.bmp'; - if FileEx(ImageFile) then begin - with Image1.Picture do - if Graphic = nil then - LoadFromFile(ImageFile); - if not Switch('MurphyMode') then - LogoL.Visible := False; - Exit; - end; - - ImageFile := PlutoDir + 'logo.bmp'; - if FileEx(ImageFile) then begin - with Image1.Picture do - if Graphic = nil then - LoadFromFile(ImageFile); - end; - except - ShowMessage('Could not load Splash Screen image!'); - end; -end; - -procedure TSplashWin.FormCreate(Sender: TObject); -begin - Hide; - Randomize; -end; - -procedure TSplashWin.FormHide(Sender: TObject); -begin - //Image1.Picture.Bitmap.FreeImage; -end; - -procedure TSplashWin.FormKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if Key = VK_ESCAPE then - Close; -end; - -procedure TSplashWin.SplashScreenCBClick(Sender: TObject); -begin - if Started then - PrefWin.SplashScreenCB.Checked := SplashScreenCB.Checked; -end; - -end. -unit SpyTH; - -interface - -uses - Classes, Windows, Dialogs, ComCtrls, CompEx, SysUtils, YTools, clock, - plutoconst, StdCtrls, forms, XReg, stringcomp; - -type - TChildren = array of TTreeNode; - - TRegSpyThread = class(TThread) - private - Reg: TXRegistry; - CurNode: TTreeNode; - Dead: Boolean; - Dif: TSLComp; - CurChildren: TChildren; - protected - procedure Execute; override; - - procedure SaveCheckNode; - procedure SaveGetDif; - procedure SaveDeleteDead; - procedure SaveGetChildren; - procedure SaveAddNew; - public - Restart: Boolean; - Mess: string; - Delay: Integer; - function Alive(Node: TTreeNode): Boolean; - procedure Spy; - procedure Reload(Node: TTreeNode); - procedure ReloadValues; - procedure AddTrace(Trace: string); - constructor CreateIt(PriorityLevel: TThreadPriority); - destructor Destroy; override; - end; - -implementation - -uses plutomain, TreeU, WorkU, ValuesU; - -{ TRegSpyThread } - -constructor TRegSpyThread.CreateIt(PriorityLevel: TThreadPriority); -begin - inherited Create(True); // Create thread suspended - Priority := PriorityLevel; // Set Priority Level - FreeOnTerminate := False; // Thread frees itself when terminated - Reg := TXRegistry.Create; - Delay := 100; -end; - -procedure TRegSpyThread.Execute; -begin - while not Terminated do begin - Restart := False; - try - if not Terminated then - Sleep(Delay); - if not Terminated then - Spy; - except end; - end; -end; - -function TRegSpyThread.Alive(Node: TTreeNode): Boolean; -begin - Result := False; - - if Restart then - Exit; - - if Terminated then - Exit; - - if Assigned(Node) then - try - if (Node.Text = '') then - Exit; - - if not Assigned(Node) then - Exit; - - Result := True; - except - Exit; - end; -end; - -procedure TRegSpyThread.SaveCheckNode; -begin - Dead := not Alive(CurNode); - if Dead then - Exit; - - CheckNode(CurNode, False); -end; - -procedure TRegSpyThread.SaveGetDif; -var - Real, Cur: TStringList; -begin - Dead := not Alive(CurNode); - if Dead then - Exit; - - dif := nil; - - if not CurNode.Expanded then begin - Dead := True; - Exit; end; - - if not OpenNodeOK(Reg, CurNode) then - Exit; - - Real := TStringList.Create; - - Reg.GetKeyNames(Real); - Reg.CloseKey; - - Cur := GetChildNames(CurNode); - - if (Cur.Count = 0) and (Real.Count = 0) then - Dead := True; - - dif := TSLComp.Create(Cur, Real, False); - - Cur.Free; - Real.Free; -end; - -procedure TRegSpyThread.SaveDeleteDead; -var - TN: TTreeNode; - i: Integer; -begin - Dead := not Alive(CurNode); - if Dead then - Exit; - - if not Assigned(dif) or not Assigned(dif.OnlyA) then - Exit; - - if CurNode.Expanded then - for i := 0 to dif.OnlyA.Count-1 do begin - TN := FindNode(CurNode, dif.OnlyA[i]); - if Assigned(TN) then begin - RegTV.Selected := GetNextBest(TN); - TN.Delete; - AddTrace('Key deleted: ' + dif.OnlyA[i]); - end; - end - else - Exit; -end; - -procedure TRegSpyThread.SaveGetChildren; -var - i: Integer; - TN: TTreeNode; -begin - Dead := not Alive(CurNode); - if Dead then - Exit; - - CurChildren := nil; - SetLength(CurChildren, CurNode.Count); - - i := 0; - TN := CurNode.GetFirstChild; - while Assigned(TN) do begin - if i <= High(CurChildren) then - CurChildren[i] := TN - else - ShowMessage('Error: Too much children'); - Inc(i); - TN := CurNode.GetNextChild(TN) - end; -end; - -procedure TRegSpyThread.SaveAddNew; -var - i: Integer; -begin - Dead := not Alive(CurNode); - if Dead then - Exit; - - if not Assigned(Dif) or not Assigned(Dif.OnlyB) or (Dif.OnlyB.Count = 0) then - Exit; - - for i := 0 to Dif.OnlyB.Count-1 do begin //Erstellt/hinbenannt - RegTV.Items.AddChild(CurNode, Dif.OnlyB[i]); - AddTrace('New Key: ' + dif.OnlyB[i]); - MainWin.StatusBarUpdate; - //AddHint('Neuer Schlüssel: ' + CurNode.Text + '\' + Dif.OnlyB[i]); - end; -end; - -procedure TRegSpyThread.Reload(Node: TTreeNode); -var - i: Integer; - TN: TTreeNode; - zCurNode: TTreeNode; - MyChildren: TChildren; -begin - if Terminated or Restart then - Exit; - - CurNode := Node; - - zCurNode := CurNode; - try - //Mess := 'SaveCheckNode'; - Synchronize(SaveCheckNode); - if Dead or Terminated then - Exit; - - //Mess := 'SaveGetDif'; - Synchronize(SaveGetDif); - if Dead or Terminated then - Exit; - - //Mess := 'SaveDeleteDead'; - Synchronize(SaveDeleteDead); - if Dead or Terminated then - Exit; - - //Mess := 'SaveGetChildren'; - Synchronize(SaveGetChildren); - if Dead or Terminated then - Exit; - - //Mess := 'SaveGetChildren'; - Synchronize(SaveAddNew); - if Dead or Terminated then - Exit; - - Dif.Free; - - //Mess := 'MyChildren'; - SetLength(MyChildren, Length(CurChildren)); - for i := 0 to High(MyChildren) do - MyChildren[i] := CurChildren[i]; - - for i := 0 to High(MyChildren) do begin - TN := MyChildren[i]; - if Alive(TN) then - //if TN.Expanded then - //if NodeVisible(TN) then - Reload(TN); - //else - //Break; - if Restart or Terminated then - Break; - end; - MyChildren := nil; - - except - if Terminated then - Exit; - AddHint('Error in Spy: ' + Mess); - WorkWin.Label7.Caption := 'ERROR'; - end; - CurNode := zCurNode; -end; - -function FindItemByRealName(LV: TListView; Text: string): TListItem; -var - i: Integer; -begin - Result := nil; - for i := 0 to LV.Items.Count-1 do - if LV.Items[i].Caption = Text then begin - Result := LV.Items[i]; - Exit; end; - for i := 0 to LV.Items.Count-1 do - if SameText(RealValueName(LV.Items[i]), Text) then begin - Result := LV.Items[i]; - Break; end; -end; - -procedure TRegSpyThread.ReloadValues; -var - Item: TListItem; - Real, Cur: TStringList; - Dif: TSLComp; - i: integer; -begin - if Terminated or Restart then - Exit; - - if not OpenNodeOK(Reg, RegTV.Selected) then - Exit; - - Real := TStringList.Create; - Reg.GetValueNames(Real); - - Cur := TStringList.Create; - with ValueList.Items do - for i := 0 to Count-1 do - Cur.Add(RealValueName(Item[i])); - - Dif := TSLComp.Create(Cur, Real, False); - Real.Free; - Cur.Free; - - for i := 0 to Dif.OnlyA.Count-1 do begin //Gelöscht/wegbenannt - Item := FindItemByRealName(ValueList, Dif.OnlyA[i]); - if Assigned(Item) then begin - Item.Delete; - AddTrace('Value deleted: ' + Dif.OnlyA[i]); - end; - end; - - for i := 0 to ValueList.Items.Count-1 do begin //Daten - Item := ValueList.Items[i]; - {if Item.SubItems.Count < 2 then begin - ShowMessage('Fehler in Sync.'); - Exit end; } - if ValuesWin.UpdateValue(Reg, Item) then - AddTrace('Value Changed: ' + Item.Caption + ' = ' + - ValueDataPreview(Reg.ReadContext(RealValueName(Item)))); - end; - - for i := 0 to dif.OnlyB.Count-1 do begin //Erstellt/hinbenannt - ValuesWin.AddValue(Reg, dif.OnlyB[i]); - AddTrace('New Value: ' + Dif.OnlyB[i]); - end; - - Reg.CloseKey; - Dif.Free; -end; - -procedure TRegSpyThread.Spy; -var - i: Integer; - a: Real; -begin - with TClock.Create do begin - for i := 0 to RootNodes.Count-1 do - Reload(TTreeNode(RootNodes[i])); - for i := 0 to High(Shortcuts) do - Reload(Shortcuts[i].Node); - Synchronize(ReloadValues); - a := SecondsPassed * 1000; - Free; end; - - if a > 0 then - WorkWin.Label7.Caption := 'Spy: ' + Format('%0.2f', [a]) + ' s'; -end; - -procedure TRegSpyThread.AddTrace(Trace: string); -begin - with WorkWin do - if ListTracesCB.Checked then - SpyLB.Items.Add(Trace); -end; - -destructor TRegSpyThread.Destroy; -begin - Dif.Free; - Reg.Free; - inherited; -end; - -end. -unit TreeU; -{$DEFINE UNIKEY} -{$DEFINE CYCFS} - -interface - -uses - Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - ComCtrls, Menus, Clipbrd, keybrd, Dialogs, YTools, PlutoConst, CompEx, - IniFiles, XReg, Colors, Clock, - ToolWin, RegFiles {$IFDEF UNIKEY}, UniKey, ImgList {$ENDIF}; - -type - TTreeWin = class(TForm) - RegTVPU: TPopupMenu; - NewSubKeyMI: TMenuItem; - NewKeyMI: TMenuItem; - CreateShortcutMI: TMenuItem; - TraceMI: TMenuItem; - N3: TMenuItem; - DeleteMI: TMenuItem; - DublicateMI: TMenuItem; - N4: TMenuItem; - FindMI: TMenuItem; - RegTV: TTreeView; - PastePathMI: TMenuItem; - N1: TMenuItem; - InsertPathMI: TMenuItem; - RenameMI: TMenuItem; - CopyPathMI: TMenuItem; - CutPathMI: TMenuItem; - EditShortcutMI: TMenuItem; - N2: TMenuItem; - Export1: TMenuItem; - SubKeylist1: TMenuItem; - ValueNameslist1: TMenuItem; - KeyInfosMI: TMenuItem; - N5: TMenuItem; - ExportAsReg: TMenuItem; - ExportD: TSaveDialog; - procedure FormCreate(Sender: TObject); - procedure RegTVClick(Sender: TObject); - procedure RegTVChange(Sender: TObject; Node: TTreeNode); - procedure RegTVChanging(Sender: TObject; Node: TTreeNode; var AllowChange: Boolean); - procedure RegTVCollapsing(Sender: TObject; Node: TTreeNode; var AllowCollapse: Boolean); - procedure RegTVCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean); - procedure RegTVDblClick(Sender: TObject); - procedure RegTVDeletion(Sender: TObject; Node: TTreeNode); - procedure RegTVDragDrop(Sender, Source: TObject; X, Y: Integer); - procedure RegTVDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); - procedure RegTVEdited(Sender: TObject; Node: TTreeNode; var S: String); - procedure RegTVEditing(Sender: TObject; Node: TTreeNode; var AllowEdit: Boolean); - procedure RegTVEndDrag(Sender, Target: TObject; X, Y: Integer); - procedure RegTVEnter(Sender: TObject); - procedure RegTVExpanded(Sender: TObject; Node: TTreeNode); - procedure RegTVExpanding(Sender: TObject; Node: TTreeNode; var AllowExpansion: Boolean); - procedure RegTVGetSelectedIndex(Sender: TObject; Node: TTreeNode); - procedure RegTVKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure RegTVMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); - procedure RegTVStartDrag(Sender: TObject; var DragObject: TDragObject); - - function CreateKey(Subkey: Boolean): Boolean; - procedure CloneKey; - procedure DeleteKey; - procedure NewShortcut; - procedure MoveKey(const Src, Trg: TRegPath; CopyWanted: Boolean); - procedure MoveValues(SrcNode, TrgNode: TTreeNode; CopyWanted: Boolean); - - procedure NewSubKeyMIClick(Sender: TObject); - procedure NewKeyMIClick(Sender: TObject); - procedure CreateShortcutMIClick(Sender: TObject); - procedure TraceMIClick(Sender: TObject); - procedure DeleteMIClick(Sender: TObject); - procedure DublicateMIClick(Sender: TObject); - procedure FindMIClick(Sender: TObject); - procedure RegTVPUPopup(Sender: TObject); - procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure RegTVKeyPress(Sender: TObject; var Key: Char); - procedure RegTVAdvancedCustomDrawItem(Sender: TCustomTreeView; - Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage; - var PaintImages, DefaultDraw: Boolean); - procedure RenameMIClick(Sender: TObject); - procedure CopyPathMIClick(Sender: TObject); - procedure InsertPathMIClick(Sender: TObject); - procedure RegTVGetImageIndex(Sender: TObject; Node: TTreeNode); - procedure CheckRegTVHotTrack; - procedure PasteKeyMIClick(Sender: TObject); - procedure CutPathMIClick(Sender: TObject); - - procedure OpenNextLevel(Node: TTreeNode); - procedure EditShortcutMIClick(Sender: TObject); - procedure SubKeylist1Click(Sender: TObject); - procedure ValueNameslist1Click(Sender: TObject); - procedure KeyInfosMIClick(Sender: TObject); - function GetKeyInfos: string; - procedure ExportAsRegClick(Sender: TObject); - procedure FormClose(Sender: TObject; var Action: TCloseAction); - - procedure Load; - procedure Reg4WriterTerminate(Sender: TObject); - private - DragNode: TTreeNode; - NoAsterisk: Boolean; //To prevent NumPadMULTIPLY and asterisk errors - UserCopyKeyFlag: Boolean; - SpaceCount: Integer; //EasterEgg - public - CantWrite: Boolean; - DoSmartExpand: Boolean; - end; - -procedure CheckNode(Node: TTreeNode; OnlyOnce: Boolean = True; - TakeNodeSelected: Boolean = False); - -function AddShortcut(Alias, RealPath: string; Icon: Integer; - AHostType: TUniHostType = uhUserShortcut; WriteIni: Boolean = False): TTreeNode; -function ShortcutIndex(Node: TTreeNode): Integer; - -function TraceKey(const Path: string; AllowedShortcutTypes: TUniHostTypes = - uhNonSystemShortcuts): string; - -type - TOpenNodeMode = (onNodeNil, onError, onReadOnly, onFull); - -const - onOK = [onFull, onReadOnly]; - -function OpenNode(Reg: TXRegistry; Node: TTreeNode): TOpenNodeMode; -function OpenNodeOK(Reg: TXRegistry; Node: TTreeNode): Boolean; -function OpenCurKey: Boolean; -function OpenCurParent: Boolean; - -var - TreeWin: TTreeWin; - - RegTV: TTreeView; //Shortcut for other units, equals TreeWin.RegTV - -{$IFDEF UNIKEY} - UserUniPath: string {$IFDEF CYCFS} = 'cYcFS '{$ENDIF}; -{$ENDIF} - Shortcuts: TShortcutA; - RootNodes: TList; //list of TTreeNode; - -implementation - -uses - PlutoMain, ValuesU, FindWinU, WorkU, PrefU, ShellEx, Types; - -{$R *.dfm} - -{$IFDEF UNIKEY} -function UniOfNode(Node: TTreeNode): TUniKey; -var - UniPath: TUniPath; -begin - UniPath := UniOfStr(UserUniPath); - UniPath.Path := Join(Copy(NodePath(Node), 1, MaxInt), '/'); - Result := TUniKey.CreateU(UniPath, reTryToSolve); -end; -{$ENDIF} - -procedure TTreeWin.FormCreate(Sender: TObject); -begin - TreeU.RegTV := RegTV; - - DragNode := nil; - NoAsterisk := False; - DoSmartExpand := True; - UserCopyKeyFlag := True; - SpaceCount := 0; //EasterEgg - - RegTV.Items.Clear; - CheckRegTVHotTrack; - - KeyInfosMI.ImageIndex := iconKeyInfos; - - NewSubKeyMI.ImageIndex := iconSubKey; - NewKeyMI.ImageIndex := iconKey; - CreateShortcutMI.ImageIndex := iconShortcut; - - RenameMI.ImageIndex := iconRename; - DeleteMI.ImageIndex := iconDelete; - DublicateMI.ImageIndex := iconKeyDublicate; - - FindMI.ImageIndex := iconKeyFind; - TraceMI.ImageIndex := iconKeyTrace; -end; - -procedure TTreeWin.RegTVClick(Sender: TObject); -begin - if KeyIsDown(VK_CONTROL) then begin - TraceMIClick(Sender); - Exit; end; -end; - -procedure TTreeWin.RegTVChange(Sender: TObject; Node: TTreeNode); -var - Reg: TXRegistry; - OpenRe: TOpenNodeMode; - -{$IFDEF UNIKEY} - Uni: TUniKey; - ValueNames: TStringList; - Item: TListItem; - i: Integer; - - procedure AppendSubItemData(SubItems: TStrings; Uni: TUniKey; - const ValueName: string); - var - SL: TStringList; - - procedure Add(const s: string); - begin - SubItems.Append(s); - end; - - begin - SL := nil; - try - Add('beta'); - - case Uni.GetDataType(ValueName) of - - udString, udExpandString: begin - Add('String'); - Add(Uni.ReadString(ValueName)); - end; - - udCardinal, udCardBigEndian, udInteger: begin - Add('Numeric'); - Add(IntToStr(Uni.ReadInteger(ValueName))); - end; - - udBinary, udNone: begin - Add('Binary'); - Add(FriendlyStr(Uni.ReadBinary(ValueName))); - end; - - udBoolean: begin - Add('Boolean'); - Add(StrOfBool(Uni.ReadBool(ValueName))); - end; - - udStringList: begin - Add('List'); - if not Assigned(SL) then - SL := TStringList.Create - else - SL.Clear; - Uni.ReadStringList(ValueName, SL); - Add(Join(SL, MultiStringSeparator)); - end; - - udColor: begin - Add('Color'); - Add(ColorToString(Uni.ReadColor(ValueName))); - end; - - else - Add('Unsupported Data Type: ' + - IntToStr(Cardinal(Uni.GetDataType(ValueName)))); - end; //case - - finally - SL.Free; - end; - end; - - -{$ENDIF} - -begin - SpaceCount := 0; //Easteregg - - CheckNode(Node, False); - CantWrite := False; - - try - SpyThread.Suspend; - Reg := TXRegistry.Create; - try - -{$IFDEF UNIKEY} - if RootOfNode(Node).ImageIndex = iconHostUni then begin - ValueNames := TStringList.Create; - ValueList.Clear; - - Uni := UniOfNode(Node); - {Uni := CreateUniSubKey(UserUniPath, Copy(NodePath(Node), 1, MaxInt), - reFaile); } - if Assigned(Uni) then - try - Uni.GetValueNames(ValueNames); - - for i := 0 to ValueNames.Count-1 do begin - Item := ValuesWin.AddValue(Reg, ValueNames[i], False); - Item.ImageIndex := iconHostUni2; - AppendSubItemData(Item.SubItems, Uni, ValueNames[i]); - end; - - finally - Uni.Free; - ValueNames.Free; - end; - - end else begin -{$ENDIF} - - OpenRe := OpenNode(Reg, Node); - if OpenRe in onOK then begin - ValuesWin.LoadValues(Reg); - if OpenRe = onReadOnly then begin - AddHint('Read only', True); - CantWrite := True; - end; - end else if OpenRe = onError then begin - ValueList.Clear; - CantWrite := True; - if Node.Level = 0 then begin - AddHint('Shortcut target not found', True); - end else - AddHint('Key not found: ' + Node.Text, True); - end; - -{$IFDEF UNIKEY} - end; -{$ENDIF} - - finally - Reg.Free; - end; - - CantWrite := CantWrite or not Assigned(Node) - or NodeInfo( Node ).ReadOnly //Node itself - or NodeInfo(RootOfNode(Node)).ReadOnly //or host - or (SameText(CurKey(uhNonSystemShortcuts).Root, 'HKEY_DYN_DATA')); - - MainWin.SetStatus; - WorkWin.InfoMemo.Text := GetKeyInfos; - finally - SpyThread.Restart := True; - SpyThread.Resume; - end; -end; - -procedure TTreeWin.RegTVChanging(Sender: TObject; Node: TTreeNode; - var AllowChange: Boolean); -begin - CantWrite := False; - AllowChange := Assigned(Node); - // CheckNode(Node, True); -end; - -procedure TTreeWin.RegTVCollapsing(Sender: TObject; Node: TTreeNode; - var AllowCollapse: Boolean); -begin - SpyThread.Restart := True; - Node.DeleteChildren; - RegTVChange(Sender, Node); -end; - -procedure TTreeWin.RegTVCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; - State: TCustomDrawState; var DefaultDraw: Boolean); -var - Info: TNodeInfo; -begin - {if Node.Text = '' then begin - ShowMessage('Error: Key has empty name.'); - Node.Delete; - Exit; end;} - - Info := NodeInfo(Node); - with TTreeView(Sender).Canvas.Font do begin - if Info.Defect then begin - Style := []; - Color := $AAAAAA - end else begin - case Info.HostType of - - uhReg: begin - Style := [fsBold]; - Color := clCyan; - end; - - {uhIni: begin - Style := [fsBold]; - Color := clBrightYellow; - end; - - uhRegFile: begin - Style := [fsBold]; - Color := clBrightGreen; - end; } - - uhSystemShortcut: begin - Style := []; - Color := clBrightCyan; - end; - - uhStandardShortcut: begin - Style := [fsBold]; - Color := $EEEEEE; - end; - - uhUserShortcut: begin - Style := []; - Color := $EEEEEE; - end; - - else - Style := []; - if Info.ReadOnly then - Color := clBrightRed - else - Color := clWhite; - end; - - end; - end; -end; - -procedure TTreeWin.RegTVDblClick(Sender: TObject); -var - Node: TTreeNode; - MouseX: Integer; - NodeRect: TRect; -begin - Node := RegTV.Selected; - if not Assigned(Node) then - Exit; - - MouseX := RegTV.ScreenToClient(Mouse.CursorPos).X; - NodeRect := Node.DisplayRect(True); - if MouseX > NodeRect.Right then begin - with ValuesWin do begin - FocusItem(PrefWin.MainPreviewE.Text); - ValueListDblClick(Self); - end; - end; -end; - -procedure TTreeWin.RegTVDeletion(Sender: TObject; Node: TTreeNode); -begin - if Assigned(SpyThread) then - SpyThread.Restart := True; - if Node.Selected then - RegTV.Selected := GetNextBest(Node); - NodeInfo(Node).Free; -end; - -procedure TTreeWin.RegTVDragDrop(Sender, Source: TObject; X, Y: Integer); - - procedure DragKey; - var - Src, Trg: TRegPath; - Node: TTreeNode; - begin - Src := RegPathOfStr(TraceKey(PathOfNode(DragNode))); - Trg := RegPathOfStr(TraceKey(PathOfNode(RegTV.DropTarget))); - Trg.Key := Trg.Key + '\' + DragNode.Text; - - MoveKey(Src, Trg, KeyIsDown(VK_CONTROL)); - - Node := RegTV.DropTarget; - if Node.Expanded then - Node.Collapse(False); - Node.Expanded := False; - CheckNode(Node, False, True); - Node.Expand(False); - end; - - procedure DragValues; - begin - MoveValues(RegTV.Selected, RegTV.DropTarget, KeyIsDown(VK_CONTROL)); - end; - -begin - if Source is TTreeView then - DragKey - else if Source is TListView then - DragValues; -end; - -procedure TTreeWin.RegTVDragOver(Sender, Source: TObject; X, Y: Integer; - State: TDragState; var Accept: Boolean); -begin - Accept := False; - if not Assigned(RegTV.DropTarget) then - Exit; - - if Source is TTreeView then begin - if not Assigned(DragNode) then - Exit; - if not KeyIsDown(VK_CONTROL) then begin - if (DragNode = RegTV.DropTarget) - or RegTV.DropTarget.HasAsParent(DragNode) then - Exit; //avoid recursive moving - end; - end else if Source is TListView then begin - //accept - end; - Accept := True; -end; - -procedure TTreeWin.RegTVEdited(Sender: TObject; Node: TTreeNode; var S: string); -var - old, tmp: string; - i: Integer; - Shortcut: PKeyShortcut; -begin - if s = Node.Text then - Exit; - - Old := Node.Text; - - if NodeInfo(Node).HostType = uhUserShortcut then begin - i := ShortcutIndex(Node); - if i = -1 then begin - ShowMessage('Shortcut not found!'); - s := old; - Exit; end; - - Shortcut := @Shortcuts[i]; - Shortcut.Alias := s; - - with TIniFile.Create(PlutoDir + 'Shortcuts.ini') do - try - DeleteKey('Shortcuts', Old); - WriteString('Shortcuts', Shortcut.Alias, Shortcut.RealPath); - finally - Free; - end; - Node.Text := s; - RegTVChange(Self, Node); - Exit; end; - - if s = '' then begin - ShowMessage('KeyNames cannot be empty.'); - s := old; - Exit; end; - - SpyThread.Suspend; - SpyThread.Restart := True; - Node.Text := s; - - if Length(s) > RegMaxKeyLen then begin - s := Copy(s, 1, RegMaxKeyLen); - if MessageDlg( - 'The maximum size of a key name is ' + IntToStr(RegMaxKeyLen) + ' characters.' + EOL + - 'Shorten the key name to:' + EOL + - Quote(StringWrap(s, 80)), - mtConfirmation, [mbOK, mbCancel], 0) <> mrOK then begin - s := Old; - SpyThread.Resume; - Exit; - end; - end; - - if CharIn(s, [#0..#31, '\']) then begin - s := ReplaceChars(s, [#0..#31], '#'); - s := ReplaceChars(s, '\', '-'); - - if MessageDlg('The following characters are not allowed in KeyNames:' + EOL + - '- Control chars (0-31)' + EOL + - '- ' + Quote('\') + EOL + - 'The following name is allowed:' + EOL + - s + EOL + - 'Use this name instead?', - mtConfirmation, [mbYes, mbNo], 0) <> mrYes then begin - s := Old; - SpyThread.Resume; - Exit; - end; - end; - - try - OpenCurParent; - if not SameText(s, Old) then begin - if not MainReg.KeyExists(s) or - (mrIgnore = MessageDlg( - 'Key already exists.' + EOL + - 'Click Ignore to overwrite the key.', - mtConfirmation, [mbCancel, mbIgnore], 0) - ) then begin - MainReg.DeleteKey(s); - MainReg.MoveKey(Old, s, True); - Node.Text := Old; - end else begin - s := Old; - end; - end else begin //change CharCase - tmp := MainReg.GetFreeKeyName; - AddHint('Forced change of case using temporary key ' + Quote(tmp)); - MainReg.MoveKey(Old, tmp, True); - MainReg.MoveKey(tmp, s, True); - end; - finally - MainReg.CloseKey; - end; - - Node.Text := s; - SpyThread.Resume; - RegTVChange(Sender, Node); -end; - -procedure TTreeWin.RegTVEditing(Sender: TObject; Node: TTreeNode; - var AllowEdit: Boolean); -begin - CheckNode(Node, False); - if RegTV.Selected <> Node then - Exit; - AllowEdit := (NodeInfo(Node).HostType in [uhNone, uhUserShortcut]) - and (not CantWrite) - and OpenCurKey; - MainReg.CloseKey; -end; - -procedure TTreeWin.RegTVEndDrag(Sender, Target: TObject; X, Y: Integer); -begin - DragNode := nil; -end; - -procedure TTreeWin.RegTVEnter(Sender: TObject); -begin - if not Started then - Exit; - ValueList.ItemFocused := nil; - MainWin.SetStatus; -end; - -procedure TTreeWin.RegTVExpanded(Sender: TObject; Node: TTreeNode); -begin - if not DoSmartExpand or not PrefWin.SmartExpandCB.Checked then - Exit; - - if not Assigned(Node) then - Exit; - - RegTVChange(Sender, Node); - - //SmartExpand - if (Node.Count > 0) and (ValueList.Items.Count = 0) then begin - RegTV.Selected := Node.GetFirstChild; - RegTVChange(Sender, RegTV.Selected); - end; - - if Node.Count = 1 then - Node.GetFirstChild.Expand(False); -end; - -procedure TTreeWin.RegTVExpanding(Sender: TObject; Node: TTreeNode; - var AllowExpansion: Boolean); -var - SL: TStringList; - Reg: TXRegistry; - Clock: TClock; -{$IFDEF UNIKEY} - Uni: TUniKey; -{$ENDIF} - - procedure AddKeys(TreeView: TTreeView; Node: TTreeNode; SL: TStrings); - var - i: Integer; - begin - for i := 0 to SL.Count-1 do - TreeView.Items.AddNode(TTreeNode.Create(TreeView.Items), Node, SL[i], - nil, naAddChild); - end; - - procedure AddKeysProgressive(TreeView: TTreeView; Node: TTreeNode; - SL: TStrings); - var - i, delta: Integer; - GaugeRect, FullRect: TRect; - GaugeWidth: Integer; - begin - delta := SL.Count div 100; - GaugeWidth := 100; - with TreeView.Canvas do begin - FullRect := Node.DisplayRect(True); - with FullRect do begin - Left := Right + 40; - Right := Left + GaugeWidth + 2; - Inc(Top, 5); - Dec(Bottom, 5); - end; - with Pen do begin - Width := 1; - Style := psSolid; - end; - Pen.Color := clBrightBlue; - Brush.Style := bsClear; - Rectangle(FullRect); - Pen.Style := psClear; - end; - - GaugeRect := FullRect; - with GaugeRect do begin - Inc(Left); - Inc(Top); - Dec(Bottom); - end; - - for i := 0 to SL.Count-1 do begin - TreeView.Items.AddNode(TTreeNode.Create(TreeView.Items), Node, SL[i], - nil, naAddChild); - - if ((i + 1) mod delta) = 0 then begin - with TreeView.Canvas do begin - GaugeRect.Right := GaugeRect.Left + (GaugeWidth * i) div SL.Count; - Brush.Color := GadientAqua(90 + Round(100 * ((i+1) / SL.Count))); - FillRect(GaugeRect); - end; - end; - end; - - with TreeView.Canvas do begin - Pen.Color := clVeryBrightBlue; - Pen.Style := psSolid; - Brush.Color := GadientAqua(200); - Rectangle(FullRect); - Brush.Style := bsClear; - end; - end; - -begin - if Node.Expanded then - Exit; - - SpyThread.Suspend; - SL := TStringList.Create; - Clock := TClock.Create; - - try - -{$IFDEF UNIKEY} - if RootOfNode(Node).ImageIndex = iconHostUni then begin - Uni := UniOfNode(Node); - if Assigned(Uni) then - try - Uni.GetKeyNames(SL); - finally - Uni.Free; - end; - - end else begin -{$ENDIF} - - Reg := TXRegistry.Create; - try - if OpenNodeOK(Reg, Node) then - Reg.GetKeyNames(SL); - finally - Reg.Free; - end; - -{$IFDEF UNIKEY} - end; -{$ENDIF} - - Node.DeleteChildren; - if PrefWin.ShowProgressCB.Checked and (SL.Count > 100) then - AddKeysProgressive(RegTV, Node, SL) - else - AddKeys(RegTV, Node, SL); - - if PrefWin.SortKeysCB.Checked then - Node.AlphaSort; - - if MurphyMode then begin - Clock.Stop; - AddHint(Format('[MM] Key opened after %0.2f s.', [Clock.SecondsPassed])); - end; - finally - Clock.Free; - SL.Free; - SpyThread.Resume; - end; -end; - -procedure TTreeWin.RegTVGetSelectedIndex(Sender: TObject; Node: TTreeNode); -begin - Node.SelectedIndex := Node.ImageIndex; -end; - -procedure TTreeWin.RegTVKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -var - Node: TTreeNode; -begin - if Key = VK_SCROLL then - CheckRegTVHotTrack; - - if RegTV.IsEditing then - Exit; - - Node := RegTV.Selected; - if not Assigned(Node) then - Exit; - - if ssShift in Shift then - case Key of - VK_DOWN: begin - Node := Node.GetNextSibling; - if Assigned(Node) then - RegTV.Selected := Node; - Key := 0; end; - - VK_UP: begin - Node := Node.GetPrevSibling; - if Assigned(Node) then - RegTV.Selected := Node; - Key := 0; end; - - VK_RIGHT: Key := VK_MULTIPLY; - VK_LEFT: Key := VK_DIVIDE; - end; - - if Assigned(Node.Parent) then begin - case Key of - VK_END: - begin - RegTV.Selected := Node.Parent.GetLastChild; - Key := 0; end; - - VK_HOME: - begin - RegTV.Selected := Node.Parent.GetFirstChild; - Key := 0; end; - end; - end; - - case Key of - 0: Exit; - VK_RETURN: ValuesWin.FocusControl(ValueList); - VK_DELETE: DeleteMIClick(Sender); - VK_SPACE: begin - JumpToSel(RegTV); - Inc(SpaceCount); - if SpaceCount > 10 then begin - ShowMessage('YES!'); - SpaceCount := 0; - end; - end; - VK_F9: SwapFonts(RegTV); - - VK_F12: - if ssShift in Shift then begin - if Assigned(Node.Parent) then Node.Parent.AlphaSort; - end else - if Node.Expanded then Node.AlphaSort; - - VK_LEFT, VK_SUBTRACT: - begin - if Node.Expanded then - Node.Collapse(False) - else if Assigned(Node.Parent) then - RegTV.Selected := Node.Parent; - Key := 0; end; - - VK_RIGHT, VK_ADD: - begin - if not Node.HasChildren then - TreeWin.RegTV.Items.AddChild(Node, ''); - if Node.Expanded then - RegTV.Selected := Node.GetFirstChild - else - Node.Expand(False); - Key := 0; end; - - VK_MULTIPLY: - begin - NoAsterisk := True; - OpenNextLevel(Node); - JumpToSel(RegTV); - AddHint('Press the Multiply Key again to open the next level.'); - Key := 0; end; - - VK_DIVIDE: - begin - DoSmartExpand := False; - Node.Collapse(true); - DoSmartExpand := True; - Key := 0; end; - end; - - if ssctrl in Shift then - case Key of - Ord('C'): CopyPathMIClick(Sender); - Ord('X'): CutPathMIClick(Sender); - Ord('V'): PasteKeyMIClick(Sender); - end; -end; - -procedure TTreeWin.RegTVMouseDown(Sender: TObject; Button: TMouseButton; - Shift: TShiftState; X, Y: Integer); -var - Node: TTreeNode; - RelX, RelY: Integer; - NodeRect: TRect; -begin - CheckRegTVHotTrack; - - if not Active then - Exit; - - RelX := RegTV.ScreenToClient(Mouse.CursorPos).X; - RelY := RegTV.ScreenToClient(Mouse.CursorPos).Y; - Node := RegTV.GetNodeAt(RelX, RelY); - if not Assigned(Node) then - Exit; - - if not Node.Selected then - Node.Selected := True; - - if Button = mbLeft then begin - NodeRect := RegTV.Selected.DisplayRect(True); - if RegTV.HotTrack - or (RelX < NodeRect.Left) and (RelX > NodeRect.Left - 20) then begin - //4px more to the left (friendlier for the user) - if not Node.HasChildren then - RegTV.Items.AddChild(Node, ''); - DoSmartExpand := False; - with Node do - if not Expanded then - Expand(False) - else - Collapse(False); - DoSmartExpand := True; - end; - end; -end; - -procedure TTreeWin.RegTVStartDrag(Sender: TObject; var DragObject: TDragObject); -begin - DragNode := RegTV.Selected; - if NodeInfo(DragNode).IsHost then - DragNode := nil; -end; - -function OpenNodeError(Reg: TXRegistry; Node: TTreeNode; - out Mode: TOpenNodeMode): Integer; -var - Key: string; -begin - Result := ERROR_SUCCESS; - Mode := onNodeNil; - if not Assigned(Node) then - Exit; - - Reg.CloseKey; - Key := TraceKey(PathOfNode(Node)); - Reg.RootKey := HKEYOfStr(ExRegRoot(Key)); - Result := Reg.OpenKeyError(ExRegKey(Key), False, True); - if Success(Result) then - if Reg.RootKey = HKDD then - Mode := onReadOnly - else - Mode := onFull - else if Reg.OpenKeyReadOnly(ExRegKey(Key)) then - Mode := onReadOnly - else - Mode := onError; -end; - -function OpenNode(Reg: TXRegistry; Node: TTreeNode): TOpenNodeMode; -begin - OpenNodeError(Reg, Node, Result); -end; - -function OpenNodeOK(Reg: TXRegistry; Node: TTreeNode): Boolean; -begin - Result := OpenNode(Reg, Node) in onOK; -end; - -function OpenCurKey: Boolean; -begin - Result := OpenNodeOK(MainReg, RegTV.Selected); -end; - -function OpenCurParent: Boolean; -begin - Result := Assigned(RegTV.Selected) - and OpenNodeOK(MainReg, RegTV.Selected.Parent); -end; - -function TTreeWin.CreateKey(Subkey: Boolean): Boolean; -var - Node, NewNode: TTreeNode; - KeyName: string; - i: integer; -begin - Result := False; - - if CantWrite then - Exit; - - Node := RegTV.Selected; - if not Assigned(Node) then - Exit; - - if not Subkey then begin - //key shall be created on same level... - if Node.Level = 0 then begin - Node := RegTV.Selected; - if TraceKey(PathOfNode(Node)) <> PathOfNode(Node) then - //check for shortcut: shortcuts are unequal to their trace - if mrOK = MessageDlg( - 'You are trying to create a Key in the shortcut''s level.' + EOL + - 'Pluto needs to jump to the target of the shortcut to do this.', - mtConfirmation, [mbOK, mbCancel], 0) then begin - MainWin.GotoKey(TraceKey(PathOfNode(Node))); - Node := RegTV.Selected.Parent; - end else Exit - else begin - ShowMessage('Key is a HKEY.' + EOL + - 'It is not possible to create Keys on HKEY level.'); - Exit; end; - end else - Node := Node.Parent; //set reference key to parent - end; - - try - - case OpenNode(MainReg, Node) of - - onFull: begin - KeyName := 'New'; //find best free name - i := 0; - while MainReg.KeyExists(KeyName) do begin - Inc(i); - KeyName := 'New ' + IntToStr(i); - end; - - Result := MainReg.CreateKey(KeyName) and MainReg.KeyExists(KeyName); - // ^-- CREATE KEY - - if not Result then // <-- FAILED - ShowMessage('Could not create key!'); - end; - - onReadOnly: ShowMessage('Key is read-only.'); - - else - ShowMessage('Error: Couldn''t open key.'); - - end; //case - - finally - MainReg.CloseKey; - end; - - if not Result then - Exit; - - if not Node.Expanded then begin //find the node, if Parent not Expanded - CheckNode(Node, False); - DoSmartExpand := False; - Node.Expand(False); - DoSmartExpand := True; - NewNode := FindNode(Node, KeyName); - end else - NewNode := RegTV.Items.AddChild(Node, KeyName); //else create a new node - - Result := Assigned(NewNode); - if not Result then - ShowMessage('Error: Could not find created key.'); - - if Result then begin - RegTV.Selected := NewNode; - RegTV.Selected.EditText; - end; -end; - -procedure TTreeWin.CloneKey; -var - Node: TTreeNode; - Full: TRegPath; - MainKey, SubKey, NewKey, zKey: string; - i: integer; -begin - Node := RegTV.Selected; - - if CantWrite then - Exit; - - if NodeInfo(Node).IsHost then - Exit; - - Full := CurKey(uhNonSystemShortcuts); - MainKey := LWPSolve(Full.Key); - SubKey := FromLastChar(MainKey, '\'); - MainKey := UntilLastChar(MainKey, '\'); - if SubKey = '' then begin //Directly beyound HKEY - SubKey := MainKey; - MainKey := ''; - end; - - try - MainReg.RootKey := HKEYOfStr(Full.Root); - if not MainReg.OpenKey(MainKey, False) then begin - ShowMessage('Error: Couldn''t not open Key: ' + MainKey); - Exit end; - if Copy(SubKey, 1, 3) <> 'New' then - NewKey := 'New ' + SubKey - else - NewKey := SubKey; - - zKey := Trim(FromLastChar(NewKey, ' ')); - - i := StrToIntDef(zKey, 0); - if IsValidInteger(zKey) then - zKey := Trim(UntilLastChar(NewKey, ' ')) - else - zKey := NewKey; - - while MainReg.KeyExists(NewKey) do begin - Inc(i); - NewKey := zKey + ' ' + IntToStr(i); - end; - - MainReg.MoveKey(SubKey, NewKey, False); - finally - MainReg.CloseKey; - end; - - Node := RegTV.Items.Add(Node, NewKey); - RegTV.Selected := Node; - Node.EditText; -end; - -procedure TTreeWin.NewShortcut; -var - Node, ShortCutNode: TTreeNode; - ScName, ScRealPath: string; - i: Integer; -begin - Node := RegTV.Selected; - if not Assigned(Node) then - Exit; - - if Node.Level = 0 then - ScName := 'new ' + Node.Text - else - ScName := '' + Node.Text; - - ScRealPath := TraceKey(PathOfNode(Node)); - if not InputQuery('New shortcut to ', ScRealPath, ScName) then - Exit; - - for i := 0 to High(ShortCuts) do - if SameText(ScName, ShortCuts[i].Alias) then begin - ShowMessage('Name already in use.'); - NewShortcut; - Exit; end; - - ShortCutNode := AddShortcut(ScName, ScRealPath, iconShortcut, uhUserShortcut, - True); - CheckNode(Node, False); - RegTV.Selected := ShortCutNode; -end; - -function AddShortcut(Alias, RealPath: string; Icon: Integer; - AHostType: TUniHostType = uhUserShortcut; - WriteIni: Boolean = False): TTreeNode; -var - Last: Integer; -begin - RealPath := TraceKey(RealPath); //Important: do this BEFORE adding a new, - //empty shortcut to ShortCuts - - SetLength(ShortCuts, Length(ShortCuts) + 1); - Last := High(Shortcuts); - ShortCuts[Last].Alias := Alias; - ShortCuts[Last].RealPath := RealPath; - - Result := RegTV.Items.Add(nil, Alias); - ShortCuts[Last].Node := Result; - - if Alias = 'HKEY_WindowsMachine' then - Icon := iconHKWM - else if Alias = 'HKEY_WindowsUser' then - Icon := iconHKWU; - SetTNImage(Result, Icon); - - NodeInfo(Result).HostType := AHostType; - - if WriteIni then - with TIniFile.Create(PlutoDir + 'Shortcuts.ini') do - try - WriteString('Shortcuts', Alias, RealPath); - finally - Free; - end; -end; - -procedure TTreeWin.DeleteKey; -var - i: Integer; - Node, Node2: TTreeNode; -begin - Node := RegTV.Selected; - - - i := ShortcutIndex(Node); - if (i > -1) then begin - if (mrYes = MessageDlg('This is a Pluto shortcut to a real key.'#13#10 + - 'Do you really want to delete the shortcut?', - mtConfirmation, [mbYes, mbCancel], 0)) then begin - SpyThread.Suspend; - SpyThread.Restart := True; - with TIniFile.Create(PlutoDir + 'Shortcuts.ini') do - try - DeleteKey('Shortcuts', Shortcuts[i].Alias); - finally - Free; - end; - Shortcuts[i] := Shortcuts[High(Shortcuts)]; - SetLength(Shortcuts, Length(Shortcuts)-1); - RegTV.Selected := GetNextBest(Node); - Node.Delete; - RegTVChange(Self, RegTV.Selected); - SpyThread.Resume; - end; - Exit; end; - - if CantWrite then - Exit; - - if NodeInfo(Node).IsHost then - Exit; - - SpyThread.Suspend; - SpyThread.Restart := True; - - Node2 := GetNextBest(Node); - - if MessageDlg('Do you really want to delete this key?', mtConfirmation, - [mbYes, mbCancel], 0) = mrYes then - try - if OpenCurParent then begin - if not MainReg.DeleteKey(Node.Text) then //<-- DELETE KEY - ShowMessage('Key could not be deleted.') - else begin - RegTV.Selected := Node2; - if Assigned(Node.Parent) and (Node2 = Node.Parent) then - Node.Parent.Collapse(False); - Node.Delete; - end; - end; - finally - MainReg.CloseKey; - end; - - RegTVChange(Self, Node2); - - SpyThread.Resume; -end; - -procedure TTreeWin.MoveKey(const Src, Trg: TRegPath; CopyWanted: Boolean); -var - TrgReg: TXRegistry; -begin - with MainReg do begin - RootKey := HKEYOfStr(Src.Root); - OpenKey(''); - - if not KeyExists(Src.Key) then begin - ShowMessage('Source not found.'); - Exit; end; - end; - - TrgReg := TXRegistry.Create; - with TrgReg do begin - RootKey := HKEYOfStr(Trg.Root); - OpenKey(''); - if KeyExists(Trg.Key) then begin - ShowMessage('Target already existing.'); - TrgReg.Free; - Exit; end; - end; - - if not CopyWanted then - if mrYes <> MessageDlg('From source: ' + StrOfRegPath(Src) + EOL + - 'To target: ' + StrOfRegPath(Trg) + EOL + - 'Do you really want to move this key?', - mtConfirmation, [mbYes, mbCancel], 0) - then - Exit; - - try - MainReg.MoveKey(Src.Key, TrgReg, Trg.Key, not CopyWanted); //<-- MOVE KEY - except - end; - - if not TrgReg.OpenKey(Trg.Key, False) then - ShowMessage('Could not move key!') - else - if not CopyWanted then - DragNode.Delete; - - - TrgReg.Free; - - MainReg.CloseKey; -end; - -procedure TTreeWin.MoveValues(SrcNode, TrgNode: TTreeNode; - CopyWanted: Boolean); -var - SrcReg, TrgReg: TXRegistry; - i: Integer; - ValueName: string; - AnswerToAll: Integer; - - function AskForReplacing(const ValueName: string): Integer; - begin - if AnswerToAll = -1 then begin - Result := MessageDlg( - 'Value ' + Quote(ValueName) + 'already exists in target key.' + EOL + - 'Do you want to replace it?', - mtWarning, [mbNo, mbYes, mbNoToAll, mbYesToAll, mbAbort], 0); - if Result in [mrNoToAll, mrYesToAll] then begin - if Result = mrYesToAll then - Result := mrYes - else if Result = mrNoToAll then - Result := mrNo; - AnswerToAll := Result; - end; - end else Result := AnswerToAll; - end; - -begin - AnswerToAll := -1; - - if not CopyWanted then - if mrYes<>MessageDlg( - Format( - 'Do you really want to move %s' + EOL + - 'from: %s' + EOL + - 'to: %s', - [StrNumerus(ValueList.SelCount, 'value', 'values'), - PathOfNode(SrcNode), PathOfNode(TrgNode)] - ), mtConfirmation, [mbYes, mbAbort], 0) then - Exit; - - SrcReg := TXRegistry.Create; - try - if not (OpenNode(SrcReg, SrcNode) in onOK) then - MessageDlg('Couldn''t open source key: ' + PathOfNode(SrcNode), - mtError, [mbOK], 0); - - TrgReg := TXRegistry.Create; - try - if not (OpenNode(TrgReg, TrgNode) in onOK) then - MessageDlg('Couldn''t open target key: ' + PathOfNode(TrgNode), - mtError, [mbOK], 0); - - with ValueList.Items do begin - for i := 0 to Count-1 do begin - if not Item[i].Selected then - Continue; - ValueName := RealValueName(Item[i]); - - if TrgReg.ValueExists(ValueName) then begin - case AskForReplacing(ValueName) of - mrYes: ; - mrNo: Continue; - mrAbort: Break; - end; - end; - - TrgReg.WriteContext(ValueName, SrcReg.ReadContext(ValueName)); - if not CopyWanted then - SrcReg.DeleteValue(ValueName); - end; - end; - - finally - TrgReg.Free; - end; - - finally - SrcReg.Free; - end; - - if not CopyWanted then - ValuesWin.Reload; -end; - -procedure TTreeWin.NewSubKeyMIClick(Sender: TObject); -begin - CreateKey(True); -end; - -procedure TTreeWin.NewKeyMIClick(Sender: TObject); -begin - CreateKey(False); -end; - -procedure TTreeWin.CreateShortcutMIClick(Sender: TObject); -begin - NewShortcut; -end; - -procedure TTreeWin.TraceMIClick(Sender: TObject); -begin - if NodeInfo(RegTV.Selected).IsShortcut then - MainWin.GotoKey(TraceKey(PathOfNode(RegTV.Selected))); -end; - -procedure TTreeWin.DeleteMIClick(Sender: TObject); -begin - if not RegTV.IsEditing then - DeleteKey; -end; - -procedure TTreeWin.DublicateMIClick(Sender: TObject); -begin - CloneKey; -end; - -procedure TTreeWin.FindMIClick(Sender: TObject); -begin - FindWin.SfCurKeyRB.Checked := True; - FindWin.Show; -end; - -procedure TTreeWin.RegTVPUPopup(Sender: TObject); -begin - RegTVChange(Sender, RegTV.Selected); - with NodeInfo(RegTV.Selected) do begin - NewSubKeyMI.Enabled := not CantWrite; - NewKeyMI.Enabled := not CantWrite and (not IsHost or IsShortcut); - DublicateMI.Enabled := not CantWrite and not IsHost; - - with DeleteMI do - if HostType = uhUserShortcut then begin - Caption := '&Delete Shortcut'; - Enabled := True; - end else begin - Caption := '&Delete'; - Enabled := not CantWrite and not IsHost; - end; - - RenameMI.Enabled := not CantWrite and (HostType in [uhNone, uhUserShortcut]); - TraceMI.Visible := IsShortcut; - EditShortcutMI.Visible := HostType = uhUserShortcut; - end; -end; - -procedure CheckNode(Node: TTreeNode; OnlyOnce: Boolean = True; - TakeNodeSelected: Boolean = False); -var - CurIcon, NewIcon: Integer; - Reg: TXRegistry; - OpenMode: TOpenNodeMode; - Info: TNodeInfo; -{$IFDEF UNIKEY} - Uni: TUniKey; -{$ENDIF} - KeyHasChildren: Boolean; - - procedure SetShortcutIcon(Node: TTreeNode); - var - Full: string; - i: Integer; - begin - Full := TraceKey(PathOfNode(Node)); - for i := Low(Shortcuts) to High(Shortcuts) do - if Full = Shortcuts[i].RealPath then begin - CurIcon := Shortcuts[i].Node.ImageIndex; - Exit; end; - if Node.ImageIndex in [iconShortcut, iconShortcut + 1] then - CurIcon := iconKey + (CurIcon - iconShortcut); - end; - -begin - if not Assigned(Node) then - Exit; - - Info := NodeInfo(Node); - if OnlyOnce and Info.Checked then - Exit; - - CurIcon := Node.ImageIndex; - if (CurIcon > iconFirstType) then begin -{$IFDEF UNIKEY} - if RootOfNode(Node).ImageIndex <> iconHostUni then begin - SetShortcutIcon(Node); - CurIcon := (CurIcon div 2) * 2; - end; -{$ELSE} - Exit; -{$ENDIF} - end else begin - SetShortcutIcon(Node); - CurIcon := (CurIcon div 2) * 2; - end; - NewIcon := CurIcon; - - Info.ExcludeFlag(nfDefect); - Info.ExcludeFlag(nfReadOnly); - -{$IFDEF UNIKEY} - KeyHasChildren := False; - - if RootOfNode(Node).ImageIndex = iconHostUni then begin - Uni := UniOfNode(Node); - if Assigned(Uni) then - try - KeyHasChildren := Uni.HasKeys; - if usReadOnly >= Uni.Skills then - OpenMode := onReadOnly - else - OpenMode := onFull; - finally - Uni.Free; - end - else - OpenMode := onError; - end else begin -{$ENDIF} - Reg := TXRegistry.Create; - try - OpenMode := OpenNode(Reg, Node); - KeyHasChildren := Reg.HasSubKeys; - finally - Reg.Free; - end; -{$IFDEF UNIKEY} - end; -{$ENDIF} - - if OpenMode = onReadOnly then - Info.IncludeFlag(nfReadOnly); - - if OpenMode in onOK then begin - //OK, could open - if not Node.Expanded then begin //Collapsed - if KeyHasChildren then begin //HasSubKeys - if not Node.HasChildren then begin - //Update: Ensure HasChildren - if TakeNodeSelected or Node.Selected then - TreeWin.RegTV.Items.AddChild(Node, ''); - end; - //Ensure Plus-Icon - NewIcon := CurIcon + 1; - end else begin - //Has still Children? - if Node.HasChildren then - Node.DeleteChildren; - end; - - end else begin //Expanded - //HasSubKeys? - if KeyHasChildren then begin - //OK - NewIcon := CurIcon + 1; - end else begin - //not OK --> update - Node.Collapse(True); - Node.DeleteChildren; - end; - end; - - //not OK, couldn't open - end else begin //defect - if Node.HasChildren then - Node.DeleteChildren; - Info.IncludeFlag(nfDefect); - end; - - if Node.ImageIndex <> iconHostUni then //don't change icon of UniHosts - Node.ImageIndex := NewIcon; - - Info.IncludeFlag(nfChecked); -end; - -procedure TTreeWin.FormKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - MainWin.FormKeyDown(Sender, Key, Shift); -end; - -function ShortcutIndex(Node: TTreeNode): Integer; -//If Node is a Shortcut, -//S. returns its index in the Shortcuts array -//else -1 -begin - if Node.Level > 0 then begin - Result := -1; - Exit; end; - - for Result := 0 to High(Shortcuts) do - if Shortcuts[Result].Node = Node then begin - Exit; - end; - - Result := -1; -end; - -function TraceKey(const Path: string; AllowedShortcutTypes: TUniHostTypes = - uhNonSystemShortcuts): string; -var - i: Integer; - isAim: Boolean; - - function NodeOkForTracing(Node: TTreeNode): Boolean; - begin - Result := Assigned(Node) and - (NodeInfo(Node).HostType in AllowedShortcutTypes); - end; - -begin - Result := MakeLongHKEY(Path); - repeat - isAim := True; - for i := 0 to High(ShortCuts) do begin - with Shortcuts[i] do - if NodeOkForTracing(Node) and - SameText(UntilChar(Result, '\'), Alias) then begin - if Alias = RealPath then - Break; - Delete(Result, 1, Length(Alias)); - Result := RealPath + Result; - isAim := False; - Break; end; - end; - until isAim; -end; - -procedure TTreeWin.RegTVKeyPress(Sender: TObject; var Key: Char); -begin - if (Key = '*') and NoAsterisk then begin - Key := #0; - NoAsterisk := False; - end; -end; - -procedure TTreeWin.RegTVAdvancedCustomDrawItem(Sender: TCustomTreeView; - Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage; - var PaintImages, DefaultDraw: Boolean); -var - Rect: TRect; - MainValueName: string; - Reg: TXRegistry; - Info: TRegKeyInfo; - PreviewPosX: Integer; - - procedure DefaultIconPreview(Reg: TXRegistry); - var - Icon: HICON; - IconFile: string; - begin - if (Node.Level = 0) and not RegTV.ShowLines then - Exit; - - IconFile := Reg.ReadDefaultIcon; - if IconFile = '' then - Exit; - - Icon := GetIconFromFile(ExpandString(IconFile)); - if Icon = 0 then - Exit; - - with Rect do begin - Dec(Left, TTreeView(Sender).Indent + 16); - DrawIconEx(Sender.Canvas.Handle, Left, Top, - Icon, 16, 16, - 0, 0, DI_NORMAL); - DestroyIcon(Icon); - end; - end; - - procedure AddPreview(const PreviewText: string; Color: TColor); - begin - with Sender.Canvas do begin - SetTextColor(Handle, Color); - ExtTextOut(Handle, PreviewPosX, Rect.Top + 1, TextFlags, nil, - PChar(PreviewText), Length(PreviewText), nil); - Inc(PreviewPosX, TextWidth(PreviewText)); - end; - end; - -begin - if Stage <> cdPostPaint then - Exit; - - MainValueName := PrefWin.MainPreviewE.Text; - - Rect := Node.DisplayRect(True); - PreviewPosX := Rect.Right + 5; - - Reg := TXRegistry.Create(KEY_READ); - try - if OpenNodeOK(Reg, Node) then begin -// Sender.Canvas.Font.Style := []; - if PrefWin.KeyInfoPreviewCB.Checked and Reg.GetKeyInfo(Info) then - with Info do begin - if NumSubKeys > 0 then - AddPreview(IntToStr(NumSubKeys) + 'k ', clCyan); - if NumValues > 0 then - AddPreview(IntToStr(NumValues) + 'v ', clBrightPurple); - end; - - if PrefWin.MainPreviewCB.Checked then - if Reg.ValueReallyExists(MainValueName) then - AddPreview(DataPreviewOfContext(Reg.ReadContext(MainValueName)), $00AAFFFF); - {clBrightYellow} - if PrefWin.DefaultIconPreviewCB.Checked then - DefaultIconPreview(Reg); - end; - finally - Reg.Free; - end; - - {if nfCopy in NodeInfo(Node).Flags then begin - //Node.StateIndex := 2; - Brush.Style := bsClear; - with Font do begin - Style := [fsItalic, fsBold]; - Color := clRed; - end; - //TextOut(Rect.Left - 10, Rect.Top + 3, 'c'); - end;} -end; - -procedure TTreeWin.RenameMIClick(Sender: TObject); -begin - RegTV.Selected.EditText; -end; - -procedure TTreeWin.CopyPathMIClick(Sender: TObject); -begin - UserCopyKeyFlag := True; - MainWin.CopyPathClick(Sender); -end; - -procedure TTreeWin.InsertPathMIClick(Sender: TObject); -begin - MainWin.InsertPathClick(Sender); -end; - -procedure TTreeWin.RegTVGetImageIndex(Sender: TObject; Node: TTreeNode); -begin - if not NodeInfo(Node).Checked then - CheckNode(Node); -end; - -procedure TTreeWin.CheckRegTVHotTrack; -const - FindCursorOfSwitch: array[Boolean] of TCursor = (crArrow, crHandPoint); -var - NewHotTrack: Boolean; -begin - NewHotTrack := ScrollON xor PrefWin.KeysSingleClickCB.Checked; - if NewHotTrack = RegTV.HotTrack then Exit; - - with RegTV do begin - HotTrack := NewHotTrack; - Cursor := FindCursorOfSwitch[HotTrack]; - Mouse.CursorPos := Mouse.CursorPos; //update cursor - end; -end; - -procedure TTreeWin.PasteKeyMIClick(Sender: TObject); -var - Src, Trg: TRegPath; - Node: TTreeNode; -begin - Src := RegPathOfStr(Clipboard.AsText); - Trg := CurKey(uhNonSystemShortcuts); - Trg.Key := Trg.Key + '\' + FromLastChar(Src.Key, '\', True); - - MoveKey(Src, Trg, UserCopyKeyFlag); - - Node := RegTV.Selected; - if Node.Expanded then - Node.Collapse(False); - Node.Expanded := False; - CheckNode(Node, False); - Node.Expand(False); - - if not UserCopyKeyFlag then - RegTV.Repaint; // CheckNode(Node, False); - - UserCopyKeyFlag := True; -end; - -procedure TTreeWin.CutPathMIClick(Sender: TObject); -begin - UserCopyKeyFlag := False; - MainWin.CopyPathClick(Sender); -end; - -procedure TTreeWin.OpenNextLevel(Node: TTreeNode); - - procedure ExpandKeys(Node: TTreeNode); - begin - CheckNode(Node, False, True); - if not Node.HasChildren then - Exit; - if not Node.Expanded then - Node.Expand(False) - else begin - Node := Node.GetFirstChild; - while Assigned(Node) do begin - ExpandKeys(Node); - Node := Node.GetNextSibling; end; - end; - end; - -begin - DoSmartExpand := False; - ExpandKeys(Node); - DoSmartExpand := True; -end; - -procedure TTreeWin.EditShortcutMIClick(Sender: TObject); -var - NewPath: string; - i: Integer; - Node: TTreeNode; - Shortcut: PKeyShortcut; -begin - Node := RegTV.Selected; - if NodeInfo(Node).HostType <> uhUserShortcut then - Exit; - - i := ShortcutIndex(Node); - if i = -1 then - Exit; - - with TIniFile.Create(PlutoDir + 'Shortcuts.ini') do - try - NewPath := ReadString('Shortcuts', Shortcuts[i].Alias, ''); - finally - Free; - end; - - if not InputQuery('Edit Shortcut', 'Shortcut to...', NewPath) then - Exit; - - Node.Collapse(False); - Shortcut := @Shortcuts[i]; - Shortcut.RealPath := TraceKey(NewPath); - with TIniFile.Create(PlutoDir + 'Shortcuts.ini') do - try - WriteString('Shortcuts', Shortcut.Alias, Shortcut.RealPath); - finally - Free; - end; - - RegTVChange(Self, Node); -end; - -procedure TTreeWin.SubKeylist1Click(Sender: TObject); -var - SL: TStringList; -begin - SL := TStringList.Create; - if OpenCurKey then - try - MainReg.GetKeyNames(SL); - if PrefWin.SortKeysCB.Checked then - SL.Sort; - Clipboard.AsText := SL.Text; - finally - MainReg.CloseKey; - SL.Free; - end; -end; - -procedure TTreeWin.ValueNameslist1Click(Sender: TObject); -var - SL: TStringList; -begin - SL := TStringList.Create; - if OpenCurKey then - try - MainReg.GetValueNames(SL); - if PrefWin.SortKeysCB.Checked then - SL.Sort; - Clipboard.AsText := SL.Text; - finally - MainReg.CloseKey; - SL.Free; - end; -end; - -procedure TTreeWin.KeyInfosMIClick(Sender: TObject); -begin - MessageDlg(GetKeyInfos, mtInformation, [mbOK], 0); -end; - -function TTreeWin.GetKeyInfos: string; -const - sErrorMsg = 'Error! No: %d Msg: %s'; - -var - Node: TTreeNode; - Reg: TXRegistry; - Mode: TOpenNodeMode; - Error: Integer; - Info: TNodeInfo; - Flag: TNodeFlag; - - procedure Add(const S: string); - begin - Result := Result + S; - end; - - procedure AddLn(const S: string = ''); - begin - Add(S + EOL); - end; - - procedure AddNodeInfo(Key: HKEY); - var - KeyInfo: TRegKeyInfo; - Res: Integer; - KeyAge: TDateTime; - begin - FillChar(KeyInfo, SizeOf(TRegKeyInfo), 0); - with KeyInfo do begin - Res := RegQueryInfoKey(Reg.CurrentKey, nil, nil, nil, @NumSubKeys, - @MaxSubKeyLen, nil, @NumValues, @MaxValueLen, - @MaxDataLen, nil, @LastWriteTime); - - if Res = ERROR_SUCCESS then begin - Add(Format( - 'Subkeys: %0:d' + EOL + - 'Values: %2:d' + EOL + - 'Max subkeys length: %1:d' + EOL + - 'Max value name length: %3:d' + EOL + - 'Max data length: %4:d' + EOL + - '', - [NumSubKeys, MaxSubKeyLen, NumValues, MaxValueLen, MaxDataLen])); - KeyAge := DateTimeOfFileTime(LastWriteTime); - if KeyAge > 0 then - AddLn('Last write time: ' + DateTimeToStr(KeyAge)); - end else - AddLn('Couldn''t get key info.' + EOL + - 'Error Code: ' + IntToStr(Res) + EOL + - 'Message: ' + SysErrorMessage(Res)); - end; - end; - -begin - Result := ''; - Node := RegTV.Selected; - - Reg := TXRegistry.Create(KEY_READ); - try - try - Error := OpenNodeError(Reg, RegTV.Selected, Mode); - - case Mode of - onFull: AddLn('Full Access'); - onReadOnly: AddLn('Read only'); - onError: - AddLn(Format(sErrorMsg, [Error, SysErrorMessage(Error)])); - onNodeNil: AddLn('Node is nil!'); - - else - AddLn('Unknown Mode: ' + IntToStr(Integer(Mode))); - end; - - if Mode in onOK then - AddNodeInfo(Reg.CurrentKey); - - except - on E: Exception do begin - Error := GetLastError; - if Error <> ERROR_SUCCESS then - AddLn(Format('Error! No: %d Msg: %s', [Error, SysErrorMessage(Error)])) - else - AddLn(E.Message); - end; - end; - finally - Reg.Free; - end; - - if MurphyMode then begin - AddLn('[MM] ImageIndex: ' + IntToStr(Node.ImageIndex)); - Info := NodeInfo(Node); - - if Info.HostType in [uhNone..High(HostTypeStrings)] then - AddLn('[MM] HostType: ' + HostTypeStrings[Info.HostType]) - else - AddLn('[MM] Unknown HostType: ' + IntToStr(Integer(Info.HostType))); - Add('[MM] Flags: '); - for Flag := Low(TNodeFlag) to High(TNodeFlag) do - if Flag in Info.Flags then - Add(NodeFlagStrings[Flag] + ' '); - AddLn; - end; -end; - -procedure TTreeWin.ExportAsRegClick(Sender: TObject); -var - Node: TTreeNode; - Reg: TXRegistry; - - procedure ExportAsReg4(Reg: TXRegistry; const FileName: string); - var - Reg4Writer: TReg4Writer; - begin - Reg4Writer := TReg4Writer.Create(tpNormal, FileName, - TraceKey(PathOfNode(Node)), Reg.DeliverKey); - with Reg4Writer do begin - OnTerminate := Reg4WriterTerminate; - try - AddHint(Format('starting .reg-export: %s...', - [Root + '\' + Path])); - Resume; - except - Free; - end; - end; - AddToLastHint('started.'); - end; - - - procedure ExportAsHive(Reg: TXRegistry; const FileName: string); - begin - if Reg.SaveKey('', FileName) then - AddHint('hive export successfull.') - else - AddHint(Format('hive export failed: %s', - [SysErrorMessage(LastSuccessRes)])); - end; - -begin - Node := RegTV.Selected; - with ExportD do begin - FileName := MakeValidFileName(Node.Text, 'key'); - - if Execute then begin - Reg := TXRegistry.Create; - try - if OpenNodeOK(Reg, Node) then begin - if FileExists(FileName) and (mrYes=MessageDlg( - 'File already exists.' + EOL + - 'Delete existing file?', - mtWarning, [mbYes, mbNo], 0)) then begin - FileSetAttr(FileName, 0); - DeleteFile(FileName); - end; - case FilterIndex of - 1: ExportAsReg4(Reg, FileName); - 2: ExportAsHive(Reg, FileName); - else - ShowMessage(Format('Wrong Filter: %d', [FilterIndex])); - end; - end; - finally - Reg.Free; - end; - end; - end; -end; - -procedure TTreeWin.FormClose(Sender: TObject; var Action: TCloseAction); -begin -// Action := caNone; -end; - -procedure TTreeWin.Load; -var - NodeHKLM, NodeHKU, NodeHKDD, NodeHKPD: TTreeNode; - NodeHostReg: TTreeNode; - - procedure LoadShortcuts(FileName: string; HostType: TUniHostType); - var - i: Integer; - SL: TStringList; - ShortcutIni: TIniFile; - begin - if not FileEx(FileName) then begin - AddToLastHint('not found:'); - AddHint(FileName); - Exit end; - - ShortcutIni := TIniFile.Create(FileName); - SL := TStringList.Create; - - try - ShortcutIni.ReadSectionValues('Shortcuts', SL); - for i := 0 to SL.Count-1 do - AddShortcut(SL.Names[i], SL.Values[SL.Names[i]], iconShortcut, - HostType); - AddToLastHint('OK'); - finally - SL.Free; - ShortcutIni.Free; - end; - end; - -begin - NodeHostReg := nil; - - AddHint('Creating Hosts...'); - RootNodes := TList.Create; - ChangeLastHint('Creating Hosts...HKEY_LOCAL_MACHINE'); - NodeHKLM := RegTV.Items.AddChild(NodeHostReg, 'HKEY_LOCAL_MACHINE'); - SetTNImage(NodeHKLM, iconHKLM); - NodeInfo(NodeHKLM).HostType := uhReg; - RootNodes.Add(NodeHKLM); - - ChangeLastHint('Creating Hosts...HKEY_USERS'); - NodeHKU := RegTV.Items.AddChild(NodeHostReg, 'HKEY_USERS'); - SetTNImage(NodeHKU, iconHKU); - NodeInfo(NodeHKU).HostType := uhReg; - RootNodes.Add(NodeHKU); - - ChangeLastHint('Creating Hosts...HKEY_CURRENT_USER'); - if RegRealPath('HKEY_CURRENT_USER') = 'HKEY_CURRENT_USER' then - //could not dereference hkcu - AddShortcut('HKEY_CURRENT_USER', 'HKEY_CURRENT_USER', - iconHKCU, uhReg) - else - AddShortcut('HKEY_CURRENT_USER', RegRealPath('HKEY_CURRENT_USER'), - iconHKCU, uhSystemShortcut); - - ChangeLastHint('Creating Hosts...HKEY_CURRENT_CONFIG'); - AddShortcut('HKEY_CURRENT_CONFIG', RegRealPath('HKEY_CURRENT_CONFIG'), - iconHKCC, uhSystemShortcut); - - ChangeLastHint('Creating Hosts...HKEY_CLASSES_ROOT'); - AddShortcut('HKEY_CLASSES_ROOT', RegRealPath('HKEY_CLASSES_ROOT'), - iconHKCR, uhSystemShortcut); - - MainReg.RootKey := HKEY_DYN_DATA; - if MainReg.OpenKeyReadOnly('') then begin - MainReg.CloseKey; - ChangeLastHint('Creating Hosts...HKEY_DYN_DATA'); - NodeHKDD := RegTV.Items.AddChild(nil, 'HKEY_DYN_DATA'); - NodeInfo(NodeHKDD).HostType := uhReg; - NodeInfo(NodeHKDD).IncludeFlag(nfReadOnly); - SetTNImage(NodeHKDD, iconHKDD); - RootNodes.Add(NodeHKDD); - end; - - MainReg.RootKey := HKEY_PERFORMANCE_DATA; - if MainReg.OpenKeyReadOnly('') then begin - MainReg.CloseKey; - ChangeLastHint('Creating Hosts...HKEY_PERFORMANCE_DATA'); - NodeHKPD := RegTV.Items.AddChild(nil, 'HKEY_PERFORMANCE_DATA'); - NodeInfo(NodeHKPD).HostType := uhReg; - SetTNImage(NodeHKPD, iconHKPD); - RootNodes.Add(NodeHKPD); - end; - - ChangeLastHint('Creating Host...OK'); - - AddHint('Loading Standard Shortcuts...'); - LoadShortcuts(PlutoDir + StandardShortcutsFileName, uhStandardShortcut); - - AddHint('Loading User Shortcuts...'); - LoadShortcuts(PlutoDir + ShortcutsFileName, uhUserShortcut); - -{$IFDEF UNIKEY} - AddShortcut('Uni', '', iconHostUni); -{$ENDIF} -end; - -procedure TTreeWin.Reg4WriterTerminate(Sender: TObject); -begin - with Sender as TRegFileWriter do - AddHint(Format('.reg-export finished (%0.2f s): %s', - [Clk.SecsPassed, Root + '\' + Path])); -end; - -end. -unit valuesU; - -interface - -uses - Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - ComCtrls, Menus, Clipbrd, XReg, CompEx, Math, YTools, Dialogs, YTypes, - PlutoConst, keybrd, ImgList, clock; - -type - TValuesWin = class(TForm) - ValueListPU: TPopupMenu; - NewStringMI: TMenuItem; - NewDWORDMI: TMenuItem; - NewBinaryMI: TMenuItem; - ConvertToMI: TMenuItem; - ConvStringMI: TMenuItem; - ConvDWORDMI: TMenuItem; - ConvBinaryMI: TMenuItem; - ValueList: TListView; - DeleteMI: TMenuItem; - N1: TMenuItem; - RenameMI: TMenuItem; - NewElseMI: TMenuItem; - NewMultiStringMI: TMenuItem; - REGNONE1: TMenuItem; - LINK1: TMenuItem; - NewExpandStringMI: TMenuItem; - N3BINARY1: TMenuItem; - N4DWORD1: TMenuItem; - N4DWORDLITTLEEDIAN1: TMenuItem; - NewBigEndianMI: TMenuItem; - N6LINK1: TMenuItem; - N7MULTISZ1: TMenuItem; - RESOURCELIST1: TMenuItem; - N9FULLRESOURCEDESCRIPTOR1: TMenuItem; - ARESOURCEREQUIREMENTSLIST1: TMenuItem; - NewDefaultValueMI: TMenuItem; - EditMI: TMenuItem; - EditBinaryMI: TMenuItem; - N3: TMenuItem; - CopyDataPreviewMI: TMenuItem; - DublicateMI: TMenuItem; - MultiString1: TMenuItem; - ZeromizeMI: TMenuItem; - N4: TMenuItem; - CopyPathMI: TMenuItem; - TakeAsMainValueMI: TMenuItem; - SelectAllMI: TMenuItem; - InvertSelectionMI: TMenuItem; - procedure FormCreate(Sender: TObject); - procedure InitListColumnTags; - - procedure NewStringMIClick(Sender: TObject); - procedure NewDWORDMIClick(Sender: TObject); - procedure NewBinaryMIClick(Sender: TObject); - procedure ConvertValue(Sender: TObject); - - procedure CreateValue(Typ: TRegDataType); - procedure ZeromizeValue; - procedure DeleteValue; - procedure CloneValue; - function TryRenameValue(OldName: string; var NewName: string): Boolean; - - procedure ValueListChange(Sender: TObject; Item: TListItem; Change: TItemChange); - procedure ValueListCustomDrawItem(Sender: TCustomListView; Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); - procedure ValueListDblClick(Sender: TObject); - procedure ValueListEditing(Sender: TObject; Item: TListItem; var AllowEdit: Boolean); - procedure ValueListEdited(Sender: TObject; Item: TListItem; var S: String); - procedure ValueListKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure ValueListResize(Sender: TObject); - - function UpdateValue(Reg: TXRegistry; Item: TListItem): Boolean; - procedure UpdateValues(SelectedOnly: Boolean = False); - procedure Reload(JumpToNewValue: Boolean = False; ValueName: string = ''); - procedure LoadValues(Reg: TXRegistry); - - function AddValue(Reg: TXRegistry; const ValueName: string; AppendInfos: Boolean = True): TListItem; - procedure ValueListPUPopup(Sender: TObject); - procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure ValueListDeletion(Sender: TObject; Item: TListItem); - procedure DeleteMIClick(Sender: TObject); - procedure RenameMIClick(Sender: TObject); - procedure NewBigEndianMIClick(Sender: TObject); - procedure NewExpandStringMIClick(Sender: TObject); - procedure NewMultiStringMIClick(Sender: TObject); - procedure NewStrangeTypeMIClick(Sender: TObject); - procedure NewDefaultValueMIClick(Sender: TObject); - procedure ValueListChanging(Sender: TObject; Item: TListItem; Change: TItemChange; var AllowChange: Boolean); - procedure ValueListMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); - procedure EditBinaryMIClick(Sender: TObject); - procedure EditMIClick(Sender: TObject); - procedure ValueListCustomDrawSubItem(Sender: TCustomListView; Item: TListItem; SubItem: Integer; State: TCustomDrawState; var DefaultDraw: Boolean); - procedure ValueListCompare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer); - procedure ValueListColumnClick(Sender: TObject; Column: TListColumn); - procedure DublicateMIClick(Sender: TObject); - procedure CopyDataPreviewMIClick(Sender: TObject); - procedure CopyDataPreview; - procedure ZeromizeMIClick(Sender: TObject); - procedure CopyPathMIClick(Sender: TObject); - - function FindItemByRealName(const ValueName: string): Integer; - - function FocusItem(ARealValueName: string; - FocusValueList: Boolean = False): Boolean; - procedure TakeAsMainValueMIClick(Sender: TObject); - procedure FormShow(Sender: TObject); - procedure FormClose(Sender: TObject; var Action: TCloseAction); - procedure ValueListClick(Sender: TObject); - procedure CheckValueListHotTrack; - procedure SelectAllMIClick(Sender: TObject); - procedure InvertSelectionMIClick(Sender: TObject); - procedure FormDestroy(Sender: TObject); - private - ValueLabelClicked: Boolean; - SortBy: TValueListColumn; - SortByColumn: TListColumn; - SubItemIndex: array[TValueListColumn] of Integer; - public - ValueNames: TStringList; - ValuesCommon: Boolean; - ValueCommonType: TRegDataType; - end; - -var - ValuesWin: TValuesWin; - ValueList: TListView; - - DefaultValueCaption: string = ''; - -function ItemIsDefaultValue(Item: TListItem): Boolean; -function RealValueName(Item: TListItem): string; -procedure SetRealValueName(Item: TListItem; Caption: string); -function IconOfDataType(Typ: TRegDataType): Integer; -function IsMainValue(Item: TListItem): Boolean; - -function ColorOfDataType(DataType: TRegDataType; - DefaultColor: TColor = clWhite): TColor; -function DataPreviewOfContext(Context: TRegContext): string; - -function ValueDataSize(Context: TRegContext): string; -function ValueDataType(Context: TRegContext): string; -function ValueDataPreview(Context: TRegContext): string; -function ValueTypeIcon(Context: TRegContext): Integer; - -function StrOfRegDataType(Typ: TRegDataType): string; - -implementation - -uses PlutoMain, TreeU, WorkU, PrefU; - -{$R *.dfm} - -function ItemIsDefaultValue(Item: TListItem): Boolean; -begin - Result := Item.Data = Pointer(DefaultValueFlag); -end; - -function RealValueName(Item: TListItem): string; -begin - if ItemIsDefaultValue(Item) then - Result := '' - else - Result := Item.Caption; -end; - -procedure SetRealValueName(Item: TListItem; Caption: string); -begin - if Caption = '' then begin - Item.Caption := DefaultValueCaption; - Item.Data := Pointer(DefaultValueFlag); - end else begin - Item.Caption := Caption; - Item.Data := nil; - end; -end; - -function IsMainValue(Item: TListItem): Boolean; -begin - Result := False; - if csDestroying in PrefWin.ComponentState then - Exit; - - Result := RealValueName(Item) = PrefWin.MainPreviewE.Text; -end; - -function ColorOfDataType(DataType: TRegDataType; - DefaultColor: TColor = clWhite): TColor; -begin - if DataType in rdStringTypes then Result := clBrightRed - else if DataType = rdMultiString then Result := clBrightPurple - else if DataType in rdCardTypes then Result := clBrightBlue - else if DataType = rdBinary then Result := clBrightGreen - else Result := DefaultColor; -end; - -function StrOfRegDataType(Typ: TRegDataType): string; -const - RegDataTypeStrings: array[rdNone..rdLastType] of string = ( - 'NONE', - 'SZ', - 'EXPAND_SZ', - 'BINARY', - 'DWORD', - 'DWORD_BIG_ENDIAN', - 'LINK', - 'MULTI_SZ', - 'RESOURCE_LIST', - 'FULL_RESOURCE_DESCRIPTOR', - 'RESOURCE_REQUIREMENTS_LIST', - 'QUAD_WORD' - ); -begin - if Typ in [rdNone..rdLastType] then - Result := RegDataTypeStrings[Typ] - else - Result := IntToStr(Typ); -end; - -procedure TValuesWin.NewStringMIClick(Sender: TObject); -begin - CreateValue(rdString); -end; - -procedure TValuesWin.NewDWORDMIClick(Sender: TObject); -begin - CreateValue(rdCardinal); -end; - -procedure TValuesWin.NewBinaryMIClick(Sender: TObject); -begin - CreateValue(rdBinary); -end; - -procedure TValuesWin.CreateValue(Typ: TRegDataType); -var - Item: TListItem; - ValueName: string; - i: Integer; - SL: TStringList; -begin - if csDestroying in (TreeWin.ComponentState + MainWin.ComponentState) then - Exit; - - if TreeWin.CantWrite then - Exit; - - with MainReg do begin - try - OpenCurKey; - - ValueName := 'New'; // find free name - i := 0; - while ValueExists(ValueName) do begin - Inc(i); - ValueName := 'New ' + IntToStr(i); - end; - - case Typ of - rdString: begin - WriteString(ValueName, ''); - end; - rdExpandString: begin - WriteExpandString(ValueName, ''); - end; - rdCardinal: begin - WriteCardinal(ValueName, 0); - end; - rdCardBigEndian: begin - WriteCardinal(ValueName, 0, True); - end; - rdMultiString: begin - SL := TStringList.Create; - WriteMultiString(ValueName, SL); - SL.Free; - end; - rdBinary: begin - WriteBin(ValueName, nil); - end; - else - WriteBinType(ValueName, nil, Typ); - end; - - if not ValueExists(ValueName) then begin - ShowMessage('Could not create Value.'); - CloseKey; - Exit; end; - - ValuesWin.AddValue(MainReg, ValueName); - finally - CloseKey; - end; - end; - - Item := FindItem(ValueList, ValueName); - - if not Assigned(Item) then begin - ShowMessage('Error, Value not found: ' + ValueName); - Exit; end; - - SelectItemOnly(ValueList, Item); - MainWin.StatusBarUpdate; - ValueLabelClicked := True; - Item.EditCaption; -end; - -procedure TValuesWin.FormCreate(Sender: TObject); -begin - ValuesU.ValueList := ValueList; - - DefaultValueCaption := PrefWin.DefaultValueNameE.Text; - ValueLabelClicked := False; - SortBy := vlcName; - SortByColumn := nil; - - ValueListResize(Sender); - ValueList.Items.Clear; - CheckValueListHotTrack; - - ValueNames := TStringList.Create; - ValuesCommon := False; - ValueCommonType := 0; - - NewDefaultValueMI.ImageIndex := iconMainValue; - NewStringMI.ImageIndex := iconString; - NewDWORDMI.ImageIndex := iconCardinal; - NewBinaryMI.ImageIndex := iconBinary; - NewMultiStringMI.ImageIndex := iconMultiString; - NewElseMI.ImageIndex := iconValueElse; - - DublicateMI.ImageIndex := iconValueDublicate; - DeleteMI.ImageIndex := iconDelete; - ZeromizeMI.ImageIndex := iconValueZeromize; - - EditMI.ImageIndex := iconValueEdit; - EditBinaryMI.ImageIndex := iconValueEditBinary; - RenameMI.ImageIndex := iconRename; - - TakeAsMainValueMI.ImageIndex := iconTakeAsMainValue; -end; - -procedure TValuesWin.ConvertValue(Sender: TObject); -{var - Allow: Boolean; - OldActive: Integer; } -begin -{ TargetPage := ShowPC.Pages[TMenuItem(Sender).Tag]; - - OldActive := ShowPC.ActivePageIndex; - ShowPC.ActivePageIndex := TMenuItem(Sender).Tag; - WorkWin.ShowPCChanging(Sender, Allow); - if not Allow then - ShowPC.ActivePageIndex := OldActive; } -end; - -function ValueDataSize(Context: TRegContext): string; -var - Typ: TRegDataType; - Size: Integer; -// ValueName: string; -// SL: TStringList; -begin - Result := ''; - - if csDestroying in PrefWin.ComponentState then - Exit; - -// ValueName := RealValueName(Item); - Typ := Context.Typ; - Size := Length(Context.Data); - - if Typ in rdStringTypes then - if not PrefWin.CountZeroByteCB.Checked then - Dec(Size); - - if Typ = rdMultiString then - if PrefWin.ShowLineCountCB.Checked then begin - Size := CharCount(StrOfByteA(Context.Data), #0) - 2; -{ SL := TStringList.Create; - try - Reg.ReadMultiString(ValueName, SL, PrefWin.UseExtendedModelCB.Checked); - Size := SL.Count; - finally - SL.Free; - end; } - Result := '#'; - end; - - Result := Result + IntToStr(Size); -end; - -function ValueDataType(Context: TRegContext): string; -begin - Result := StrOfRegDataType(Context.Typ); -end; - -function DataPreviewOfContext(Context: TRegContext): string; - - function DWORDPreview(Value: Integer): string; - begin - if PrefWin.ShowDwordAsHex.Checked then - Result := IntToStr(Value) + ' = $' + IntToHex(Value, 8) - else - Result := IntToStr(Value) - end; - - function BinaryPreview(Context: TRegContext): string; - var - z: string; - - function DWORDStringOfByteA(a: TByteA; AddBinary: Boolean = False): string; - var - piece: TByteA; - i: Integer; - begin - Result := ''; - - i := 0; - while (i <= High(a)) and (Length(Result) < MaxPreviewLen) do begin - piece := Copy(a, i, 4); - if AddBinary then - Result := Result + FriendlyStr(piece) + '='; - SetLength(piece, 4); - Result := Result + IntToStr(PInteger(piece)^) + ' '; - Inc(i, SizeOf(Integer)); - end; - end; - - begin - with Context do begin - Data := Copy(Data, 0, MaxPreviewLen); - case PrefWin.ShowBinaryAsRG.ItemIndex of - 0: z := FriendlyStr(Data); - 1: z := DWORDStringOfByteA(Data); - 2: z := DWORDStringOfByteA(Data, True); - 3: z := BinOfByteA(Data, 8, ' '); - 4: z := HexOfByteA(Data, 0); - 5: z := HexOfByteA(Data, 1); - 6: z := HexOfByteA(Data, 2); - 7: z := HexOfByteA(Data, 4); - end; - end; - - Result := Copy(z, 1, MaxPreviewLen); - end; - - function StringPreview(Context: TRegContext): string; - var - s: string; - Expanded: string; - DoExpand: Boolean; - begin - s := PChar(Context.Data); - with PrefWin do - Result := StringQuoterBegin + FriendlyStr(s) + StringQuoterEnd; - if s = '' then - Exit; - - case PrefWin.ExpandStringsRG.ItemIndex of - 0: DoExpand := False; - 1: DoExpand := (Context.Typ = rdExpandString) and (CharCount(s, '%') >= 2); - 2: DoExpand := True; - else - ShowMessage('Error: Unknown PrefWin.ExpandStringsRG.ItemIndex!'); - PrefWin.ExpandStringsRG.ItemIndex := 0; - Exit; - end; - - if DoExpand then begin - Expanded := ExpandString(s); - if s <> Expanded then - Result := Result + ' <' + Expanded + '>'; - end; - end; - - function IntegerPreview(Context: TRegContext): string; - begin - if Length(Context.Data) >= SizeOf(Cardinal) then begin - Result := DWORDPreview(PInteger(Context.Data)^); - end else - Result := BinaryPreview(Context); - end; - - function MultiStringPreview(Context: TRegContext): string; - var - z: string; - SL: TStringList; - i: Integer; - begin - z := ''; - - SL := TStringList.Create; - try - RegMultiStringOfByteA(Context.Data, SL, PrefWin.UseExtendedModelCB.Checked); - - for i := 0 to SL.Count-1 do - z := z + SL[i] + ' '; - finally - SL.Free; - end; - - Result := Copy(FriendlyStr(z), 1, MaxPreviewLen); - end; - -begin - Result := ''; - - if csDestroying in PrefWin.ComponentState then - Exit; - - if (Context.Data = nil) or (Length(Context.Data) > RegMaxDataSize) then - Exit; - - if Length(Context.Data) > MaxPreviewLen then - SetLength(Context.Data, MaxPreviewLen); - - if PrefWin.ShowAsBinaryCB.Checked then begin - Result := BinaryPreview(Context); - Exit; end; - - case Context.Typ of - rdExpandString, rdString: Result := StringPreview(Context); - rdCardinal, rdCardBigEndian: Result := IntegerPreview(Context); - rdMultiString: Result := MultiStringPreview(Context); - else - if PrefWin.Smart4BBCB.Checked and (Length(Context.Data) = 4) then - Result := IntegerPreview(Context) - else - Result := BinaryPreview(Context); - end; -end; - -function ValueDataPreview(Context: TRegContext): string; -begin - Result := DataPreviewOfContext(Context); -end; - -function IconOfDataType(Typ: TRegDataType): Integer; -begin - if Typ in [rdNone..rdLastType] then - Result := iconFirstType + Ord(Typ) - else - Result := iconUnknownType; -end; - -function ValueTypeIcon(Context: TRegContext): Integer; -begin - Result := IconOfDataType(Context.Typ); -end; - -function TValuesWin.UpdateValue(Reg: TXRegistry; Item: TListItem): Boolean; -//Return Value: True if something has changed -var - Size, Typ, Data: string; - Icon: Integer; - Context: TRegContext; -begin - Result := False; - if not Assigned(Item) then - Exit; - - Context := Reg.ReadContext(RealValueName(Item)); - Data := ValueDataPreview(Context); - Size := ValueDataSize(Context); - Typ := ValueDataType(Context); - Icon := ValueTypeIcon(Context); - - if Icon <> Item.ImageIndex then begin - Item.ImageIndex := Icon; - Result := True; - end; - - while Item.SubItems.Count < Integer(High(TValueListColumn)) do - Item.SubItems.Add(''); - - if Size <> Item.SubItems[SubItemIndex[vlcSize]] then begin - Result := True; - Item.SubItems[SubItemIndex[vlcSize]] := Size; - end; - - if Typ <> Item.SubItems[SubItemIndex[vlcType]] then begin - Result := True; - Item.SubItems[SubItemIndex[vlcType]] := Typ; - end; - - if (Data <> Item.SubItems[SubItemIndex[vlcData]]) then begin - Result := True; - Item.SubItems[SubItemIndex[vlcData]] := Data; - if IsMainValue(Item) then - RegTV.Repaint; - end; -end; - -procedure AppendNewValueInfos(Item: TListItem; Context: TRegContext); -begin - Item.ImageIndex := ValueTypeIcon(Context); - with Item.SubItems do begin - Append(ValueDataSize(Context)); - Append(ValueDataType(Context)); - Append(ValueDataPreview(Context)); - end; -end; - -function TValuesWin.AddValue(Reg: TXRegistry; const ValueName: string; - AppendInfos: Boolean = True): TListItem; -begin - Result := ValueList.Items.AddItem(nil, -1); - Result.Indent := -1; - SetRealValueName(Result, ValueName); - if AppendInfos then - AppendNewValueInfos(Result, Reg.ReadContext(ValueName)); -end; - -procedure TValuesWin.ValueListChange(Sender: TObject; Item: TListItem; - Change: TItemChange); -var - ValueName: string; - Reg: TXRegistry; - - function ComputeValuesCommon(Reg: TXRegistry; var DataType: TRegDataType): Boolean; - var - i: Integer; - ItemType: TRegDataType; - begin - Result := False; - - i := 0; - DataType := 0; - while i < ValueList.Items.Count do begin - Item := ValueList.Items[i]; - if not Item.Selected then begin - Inc(i); - Continue; end; - - ValueName := RealValueName(Item); - if Reg.ValueReallyExists(ValueName) then begin - - ItemType := Reg.GetDataType(ValueName); - if not Result then begin - DataType := ItemType; - Result := True; - end else if ItemType <> DataType then begin - Result := False; - DataType := 0; - Break; end; - - with ValueNames do - if Item.Focused then - Insert(0, ValueName) - else - Add(ValueName); - - end else begin - ShowMessage('Value has been deleted!'); - DataType := 0; - Result := False; - Reload; - Break; end; - - Inc(i); - end; - end; - -begin - if not Assigned(Item) or ValueList.IsEditing or not ValueList.Enabled then - Exit; - - if Change <> ctState then - Exit; - - if csDestroying in WorkWin.ComponentState then - Exit; - - if (ValueList.SelCount = 0) then begin - ValueNames.Clear; - WorkWin.ReInitShowPC; - Exit; end; - - if not Item.Focused then - Exit; - - WorkWin.ReInitShowPC; - - ValueNames.Clear; - Reg := TXRegistry.Create; - try - if OpenNodeOK(Reg, RegTV.Selected) then begin - ValuesCommon := ComputeValuesCommon(Reg, ValueCommonType); - if ValuesCommon then - WorkWin.ShowValues(Reg); - end; - finally - Reg.Free; - end; - - if csDestroying in MainWin.ComponentState then - Exit; - - if ActiveControl = ValueList then - MainWin.SetStatus; -end; - -procedure TValuesWin.ValueListCustomDrawItem(Sender: TCustomListView; - Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); -begin - with ValueList.Canvas.Font do begin - if Item.Focused then - Style := Style + [fsBold]; - if ItemIsDefaultValue(Item) then - Color := clBrightYellow - else - Color := ColorOfDataType(TRegDataType(Item.ImageIndex - iconFirstType)); - end; -end; - -procedure TValuesWin.ValueListDblClick(Sender: TObject); -begin - ValueListChange(Sender, ValueList.ItemFocused, ctState); - MainPC.ActivePage := WorkWin.WorkPage; - - if not Assigned(ValueList.ItemFocused) then - Exit; - - if csDestroying in WorkWin.ComponentState then - Exit; - - WorkWin.EditData; -end; - -procedure TValuesWin.ValueListEditing(Sender: TObject; Item: TListItem; - var AllowEdit: Boolean); -begin - if not ValueLabelClicked then begin - AllowEdit := False; - Exit; end; - - if ItemIsDefaultValue(Item) then //unschön, aber beste Lösung bisher - Keyboard.SimKey(VK_DELETE); -end; - -procedure TValuesWin.ValueListEdited(Sender: TObject; Item: TListItem; - var S: string); -var - Old: string; - OldCaption: string; -begin - OldCaption := Item.Caption; - Old := RealValueName(Item); - - if s = Old then begin - if ItemIsDefaultValue(Item) then - s := DefaultValueCaption; - Exit; end; - - SpyThread.Suspend; - try - Item.Caption := s; - - if TryRenameValue(Old, s) then begin - SetRealValueName(Item, s); //Sichere Zuweisung des Standard-Flags - s := Item.Caption; //Anschließend externer Aufruf "Item.Caption := s"! - end else begin - s := OldCaption; - end; - - finally - SpyThread.Restart := True; - SpyThread.Resume; - end; -end; - -procedure TValuesWin.ValueListKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -var - T: string; - Item: TListItem; -begin - if ValueList.IsEditing then - Exit; - - if csDestroying in TreeWin.ComponentState then - Exit; - - Item := ValueList.ItemFocused; - - case Key of - VK_SPACE: JumpToSel(ValueList); - - VK_F9: SwapFonts(ValueList); - - VK_F5: Reload; - - VK_F12: begin //Sort - if Assigned(Item) then - T := Item.Caption; - ValueList.SortType := TSortType(2 - (Integer(ValueList.SortType))); - if ValueList.SortType = stNone then - TreeWin.RegTVChange(Sender, RegTV.Selected); - ValueList.ItemFocused := FindItem(ValueList, T); - if Assigned(ValueList.ItemFocused) then - ValueList.ItemFocused.MakeVisible(True); - end; - - VK_DELETE: DeleteMIClick(Sender); - - VK_RETURN: ValueListDblCLick(Sender); - - Ord('C'): - if not ValueList.IsEditing then - CopyPathMIClick(Sender); - - VK_SCROLL: CheckValueListHotTrack; - end; -end; - -procedure TValuesWin.ValueListResize(Sender: TObject); -begin - with ValueList do - Columns[3].Width := ClientWidth - (0 + - Columns[0].Width + Columns[1].Width + Columns[2].Width); -end; - -procedure TValuesWin.DeleteValue; -var - Item, NewSel: TListItem; - YesToAll: Boolean; - i: Integer; - - procedure DeleteIt(Item: TListItem); - begin - OpenCurKey; - if MainReg.DeleteValue(RealValueName(Item)) - and not MainReg.ValueReallyExists(RealValueName(Item)) then begin - Item.Delete; - end else begin - ShowMessage('Could not delete Value ' + Quote(RealValueName(Item))); - Inc(i); - end; - MainReg.CloseKey; - - if IsMainValue(Item) then - RegTV.Repaint; - end; - -begin - SpyThread.Suspend; - - NewSel := GetNextBestNotSelected(ValueList.ItemFocused); - - YesToAll := False; - i := 0; - while i < ValueList.Items.Count do begin - Item := ValueList.Items[i]; - if not Item.Selected then begin - Inc(i); - Continue; end; - - if YesToAll then - DeleteIt(Item) - else begin - case MessageDlg('Do you really want to delete the Value ' + - Quote(RealValueName(Item)) + '?', - mtConfirmation, [mbYes, mbYesToAll, mbNo, mbCancel], 0) of - mrYes: DeleteIt(Item); - mrYesToAll: YesToAll := True; - mrCancel: Exit; - mrNo: begin - Item.Selected := False; - NewSel := Item; - end; - end; - end; - end; - - if Assigned(NewSel) then begin - ValueList.ItemFocused := NewSel; - NewSel.Selected := True; - end else - WorkWin.ReInitShowPC; - - SpyThread.Restart := True; - SpyThread.Resume; -end; - -procedure TValuesWin.ZeromizeValue; -var - Item: TListItem; - YesToAll: Boolean; - i: Integer; - - procedure ZeromizeIt(Item: TListItem); - begin - with MainReg do begin - OpenCurKey; - ZeromizeValue(RealValueName(Item)); - UpdateValue(MainReg, Item); - CloseKey; - end; - end; - -begin - SpyThread.Suspend; - - YesToAll := False; - i := 0; - while i < ValueList.Items.Count do begin - Item := ValueList.Items[i]; - if not Item.Selected then begin - Inc(i); - Continue; end; - - if YesToAll then - ZeromizeIt(Item) - else - case MessageDlg('Do you really want to zeromize ValueData of ' + - Quote(RealValueName(Item)) + ' ?', - mtConfirmation, [mbYes, mbYesToAll, mbNo, mbCancel], 0) of - - mrYes: begin - ZeromizeIt(Item); - Inc(i); - end; - - mrYesToAll: begin - YesToAll := True; - ZeromizeIt(Item); - end; - mrCancel: Exit; - end; - - if IsMainValue(Item) then - RegTV.Repaint; - end; - - - SpyThread.Resume; -end; - -procedure TValuesWin.ValueListPUPopup(Sender: TObject); -var - Writable, ValueOK, OnlyOneValue, OneValueOK: Boolean; - Item: TListItem; -begin - if Assigned(ValueList.ItemFocused) then - ValueList.ItemFocused.Selected := True; - - if csDestroying in (TreeWin.ComponentState + PrefWin.ComponentState) then - Exit; - - Writable := not TreeWin.CantWrite; - NewDefaultValueMI.Visible := Writable; - NewStringMI.Visible := Writable; - NewDWORDMI.Visible := Writable; - NewBinaryMI.Visible := Writable; - NewMultiStringMI.Visible := Writable; - NewElseMI.Visible := Writable; - - ValueOK := Writable and (ValueList.ItemFocused <> nil); - OnlyOneValue := ValueList.SelCount = 1; - OneValueOK := OnlyOneValue and ValueOK; - - EditMI.Visible := ValueOK; - EditBinaryMI.Visible := ValueOK; - DublicateMI.Visible := OneValueOK; - CopyPathMI.Visible := OnlyOneValue; - CopyDataPreviewMI.Visible := OnlyOneValue; - TakeAsMainValueMI.Visible := OnlyOneValue; - RenameMI.Visible := OneValueOK; - DeleteMI.Visible := ValueOK; - ZeromizeMI.Visible := ValueOK; - - Item := ValueList.ItemFocused; - if not Assigned(Item) then - Exit; - - TakeAsMainValueMI.Checked := RealValueName(Item) = PrefWin.MainPreviewE.Text; -end; - -procedure TValuesWin.FormKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if ValueList.IsEditing then - Exit; - - if csDestroying in MainWin.ComponentState then - Exit; - MainWin.FormKeyDown(Sender, Key, Shift); -end; - -procedure TValuesWin.ValueListDeletion(Sender: TObject; Item: TListItem); -begin - if Assigned(SpyThread) then - SpyThread.Restart := True; - - if csDestroying in WorkWin.ComponentState then - Exit; - - if Assigned(ShowPC.ActivePage) - and Item.Selected and Item.Focused then begin - ValueList.ItemFocused := GetNextBest(Item); - WorkWin.ReInitShowPC; - end; -end; - -procedure TValuesWin.DeleteMIClick(Sender: TObject); -begin - if ValueList.IsEditing then - Exit; - - DeleteValue; -end; - -procedure TValuesWin.RenameMIClick(Sender: TObject); -begin - if Assigned(ValueList.ItemFocused) then begin - ValueLabelClicked := True; - ValueList.ItemFocused.EditCaption; - ValueLabelClicked := False; - end; -end; - -procedure TValuesWin.NewBigEndianMIClick(Sender: TObject); -begin - CreateValue(rdCardBigEndian); -end; - -procedure TValuesWin.NewExpandStringMIClick(Sender: TObject); -begin - CreateValue(rdExpandString); -end; - -procedure TValuesWin.NewMultiStringMIClick(Sender: TObject); -begin - CreateValue(rdMultiString); -end; - -procedure TValuesWin.NewStrangeTypeMIClick(Sender: TObject); -begin - CreateValue(TRegDataType(TMenuItem(Sender).Tag)); -end; - -procedure TValuesWin.NewDefaultValueMIClick(Sender: TObject); -var - DefaultItem: TListItem; - i: Integer; -begin - if csDestroying in (TreeWin.ComponentState + MainWin.ComponentState) then - Exit; - if TreeWin.CantWrite then - Exit; - - with MainReg do begin - try - OpenCurKey; - - if StandardValueExists then begin - ShowMessage('Default Value already exists.'); - CloseKey; - Exit; end; - - WriteString('', ''); - - if not StandardValueExists then begin - ShowMessage('Could not create Default Value.'); - CloseKey; - Exit; end; - - ValuesWin.AddValue(MainReg, ''); - finally - CloseKey; - end; - end; - - with ValueList.Items do begin - DefaultItem := nil; - for i := 0 to Count-1 do - if ItemIsDefaultValue(Item[i]) then - Break; - - if i < Count then - DefaultItem := Item[i]; - end; - - if not Assigned(DefaultItem) then - ShowMessage('Error: Lost Default Value!') - else begin - SelectItemOnly(ValueList, DefaultItem); - MainWin.StatusBarUpdate; - ValueListDblClick(Sender); - end; -end; - -procedure TValuesWin.ValueListChanging(Sender: TObject; Item: TListItem; - Change: TItemChange; var AllowChange: Boolean); -begin - if Item = nil then - AllowChange := False; -end; - -procedure TValuesWin.ValueListMouseDown(Sender: TObject; Button: TMouseButton; - Shift: TShiftState; X, Y: Integer); -begin - ValueLabelClicked := False; - with ValueList do - if ([htOnIcon, htOnLabel] * GetHitTestInfoAt(X, Y)) <> [] then - ValueLabelClicked := True; -end; - -procedure TValuesWin.EditBinaryMIClick(Sender: TObject); -begin - if csDestroying in WorkWin.ComponentState then - Exit; - - WorkWin.ShowAsBinary := True; - ValueListChange(Sender, ValueList.ItemFocused, ctState); - ValueListDblClick(Sender); -end; - -procedure TValuesWin.EditMIClick(Sender: TObject); -begin - ValueListDblClick(Sender); -end; - -procedure TValuesWin.ValueListCustomDrawSubItem(Sender: TCustomListView; - Item: TListItem; SubItem: Integer; State: TCustomDrawState; - var DefaultDraw: Boolean); -begin - with ValueList.Canvas.Font do begin - Style := []; - if SubItem = 1 then - Color := clSilver - else - Color := ColorOfDataType(TRegDataType(Item.ImageIndex - iconFirstType)); - end; -end; - -procedure TValuesWin.ValueListCompare(Sender: TObject; Item1, Item2: TListItem; - Data: Integer; var Compare: Integer); -begin - case SortBy of - vlcName: Compare := AnsiCompareText(RealValueName(Item1), RealValueName(Item2)); - vlcSize: Compare := Integer( - StrToIntDef(Item1.SubItems[SubItemIndex[vlcSize]], -1) > - StrToIntDef(Item2.SubItems[SubItemIndex[vlcSize]], -1)); - vlcData: Compare := Integer(Item1.SubItems[SubItemIndex[vlcData]] > - Item2.SubItems[SubItemIndex[vlcData]]); - vlcType: Compare := Integer(Item1.ImageIndex > Item2.ImageIndex); - end; - - if Assigned(SortByColumn) - and (SortByColumn.ImageIndex = iconSortArrowDesc) then - Compare := 1 - Compare; -end; - -procedure TValuesWin.ValueListColumnClick(Sender: TObject; Column: TListColumn); -begin - case Column.ImageIndex of - iconSortArrowAsc: Column.ImageIndex := iconSortArrowDesc; - iconSortArrowDesc: Column.ImageIndex := -1; - else - if Assigned(SortByColumn) then - SortByColumn.ImageIndex := -1; - if TValueListColumn(Column.Tag) in ValueListColumnRange then - SortBy := TValueListColumn(Column.Tag) - else - ShowMessage('Unknown Column Tag'); - Column.ImageIndex := iconSortArrowAsc; - end; - - if Column.ImageIndex = -1 then - ValueList.SortType := stNone - else begin - ValueList.SortType := stData; - SortByColumn := Column; - end; - - Update; - ValueList.AlphaSort; -end; - -procedure TValuesWin.CloneValue; -var - OldName, NewName: string; - - function GetNewName(Reg: TXRegistry; const OldName: string): string; - var - i: Integer; - Prefix: string; - begin - if OldName = '' then - Result := 'New Default Value' - else if Copy(OldName, 1, 4) <> 'New ' then - Result := 'New ' + OldName - else - Result := OldName; - - Prefix := Result; - i := 1; - while Reg.ValueExists(Result) do begin - Result := Prefix + ' ' + IntToStr(i); - Inc(i); - end; - end; - -begin - if csDestroying in TreeWin.ComponentState then - Exit; - - if TreeWin.CantWrite then - Exit; - - OldName := RealValueName(ValueList.ItemFocused); - - try - OpenCurKey; - - NewName := GetNewName(MainReg, OldName); - MainReg.CopyValue(OldName, NewName); - AddValue(MainReg, NewName); - finally - MainReg.CloseKey; - end; -end; - -procedure TValuesWin.DublicateMIClick(Sender: TObject); -begin - CloneValue; -end; - -procedure TValuesWin.CopyDataPreviewMIClick(Sender: TObject); -begin - if ValueList.IsEditing then - Exit; - - CopyDataPreview; -end; - -procedure TValuesWin.CopyDataPreview; -begin - OpenCurKey; - Clipboard.AsText := DataPreviewOfContext(MainReg.ReadContext( - RealValueName(ValueList.ItemFocused))); - MainReg.CloseKey; -end; - -procedure TValuesWin.UpdateValues(SelectedOnly: Boolean = False); -var - i: Integer; - Reg: TXRegistry; -begin - if not Started then - Exit; - - SpyThread.Suspend; - - Reg := TXRegistry.Create; - try - if OpenNodeOK(Reg, RegTV.Selected) then - with ValueList.Items do begin - for i := 0 to Count-1 do begin - if SelectedOnly and not Item[i].Selected then - Continue; - UpdateValue(Reg, Item[i]); - end; - end; - finally - Reg.Free; - end; - - SpyThread.Resume; -end; - -function TValuesWin.TryRenameValue(OldName: string; - var NewName: string): Boolean; -var - x: string; -begin - Result := False; - if OldName = NewName then - Exit; - - if (Length(NewName) > RegMaxValueNameLen) then begin - NewName := Copy(NewName, 1, RegMaxValueNameLen); - if MessageDlg( - 'The maximum size of a value name is ' + IntToStr(RegMaxValueNameLen) + ' characters.' + EOL + - 'Shorten the value name to:' + EOL + - Quote(StringWrap(NewName, 80)), - mtConfirmation, [mbOK, mbCancel], 0) <> mrOK then - Exit; - end; - - if CharIn(NewName, [#0..#31]) then begin - NewName := ReplaceChars(NewName, [#0..#31], '#'); - if MessageDlg('The following chars are not allowed in ValueNames:' + EOL + - '- Control chars (#0..#31)' + EOL + - 'The following name is allowed:' + EOL + - NewName + EOL + - 'Use this name instead?', - mtConfirmation, [mbYes, mbNo], 0) <> mrYes then - Exit; - end; - - if not OpenCurKey then - Exit; - - if SameText(OldName, NewName) then begin //CharCase ändern - x := MainReg.GetFreeValueName; - MainReg.RenameValue(OldName, x); - MainReg.RenameValue(x, NewName); - end else begin - if not MainReg.ValueReallyExists(NewName) then begin - MainReg.RenameValue(OldName, NewName); - end else begin - if NewName = '' then - ShowMessage('Default value already exists.') - else - ShowMessage('Value ' + Quote(NewName) + ' already exists.'); - Exit; end; - end; - MainReg.CloseKey; - - if TextIn(NewName, 'default') then - AddHint('You can create default values by empty string ValueNames.'); - - Result := True; -end; - -procedure TValuesWin.ZeromizeMIClick(Sender: TObject); -begin - ZeromizeValue; -end; - -procedure TValuesWin.CopyPathMIClick(Sender: TObject); -begin - if ValueList.IsEditing then - Exit; - - if csDestroying in MainWin.ComponentState then - Exit; - - MainWin.CopyPathClick(Sender); -end; - -function TValuesWin.FindItemByRealName(const ValueName: string): Integer; -begin - with ValueList.Items do begin - for Result := 0 to Count-1 do - if SameText(RealValueName(Item[Result]), ValueName) then - Exit; - end; - Result := -1; -end; - -function TValuesWin.FocusItem(ARealValueName: string; - FocusValueList: Boolean = False): Boolean; -var - i: Integer; -begin - with ValueList do begin - i := FindItemByRealName(ARealValueName); - - if (i > -1) and (i < Items.Count) then - Selected := Items[i] - else - Selected := nil; - - ItemFocused := Selected; - - Result := Assigned(Selected); - if Result then - JumpToSel(ValueList); - - if FocusValueList then - FocusControl(ValueList); - end; -end; - -procedure TValuesWin.TakeAsMainValueMIClick(Sender: TObject); -var - Item: TListItem; - ValueName: string; -begin - if csDestroying in PrefWin.ComponentState then - Exit; - - Item := ValueList.ItemFocused; - if not Assigned(Item) then - Exit; - - ValueName := RealValueName(Item); - with PrefWin.MainPreviewE do - if ValueName = Text then - Text := '' - else - Text := ValueName; -end; - -procedure TValuesWin.InitListColumnTags; -var - i: Integer; -begin - for i := 0 to ValueList.Columns.Count-1 do - with ValueList.Columns.Items[i] do begin - Tag := -1; - if Caption = 'Name' then - Tag := Integer(vlcName) - else if Caption = 'Size' then - Tag := Integer(vlcSize) - else if Caption = 'Type' then - Tag := Integer(vlcType) - else if Caption = 'Data' then - Tag := Integer(vlcData) - else - ShowMessage(Format('Error: Unknown ValueList.Columns[%d].Caption = "%s"', - [Index, Caption])); - if Tag > -1 then - SubItemIndex[TValueListColumn(Tag)] := Index - 1; - end; -end; - -procedure TValuesWin.FormShow(Sender: TObject); -begin - InitListColumnTags; -end; - -procedure TValuesWin.Reload(JumpToNewValue: Boolean = False; - ValueName: string = ''); -var - Sel: TListItem; - SelIndex: Integer; - SelRealValueName: string; -begin - if csDestroying in TreeWin.ComponentState then - Exit; - - SelIndex := -1; - if JumpToNewValue then - SelRealValueName := ValueName - else begin - Sel := ValueList.ItemFocused; - if Assigned(Sel) then - SelIndex := Sel.Index; - - if SelIndex > -1 then - SelRealValueName := RealValueName(ValueList.Items[SelIndex]); - end; - - TreeWin.RegTVChange(Self, RegTV.Selected); - - if SelIndex > -1 then - if not FocusItem(SelRealValueName, True) then begin - SelIndex := GetBestIndex(ValueList, SelIndex); - if SelIndex > -1 then - with ValueList do begin - Selected := Items[SelIndex]; - ItemFocused := Selected; - end; - end; -end; - -procedure TValuesWin.LoadValues(Reg: TXRegistry); -var - SL: TStringList; - i: Integer; - Clock: TClock; -begin - if csDestroying in WorkWin.ComponentState then - Exit; - - with ValueList.Items do begin - Clock := TClock.Create(1, tfSecs); - ValueList.Enabled := False; - BeginUpdate; - try - Clear; - WorkWin.ReInitShowPC; - - SL := TStringList.Create; - try - Reg.GetValueNames(SL); - for i := 0 to SL.Count-1 do - ValuesWin.AddValue(Reg, SL[i]); - finally - SL.Free; - end; - - finally - EndUpdate; - ValueList.Enabled := True; - Clock.Stop; - if MurphyMode then - AddHint(Format('Values loaded after %0.2f secs.', [Clock.SecsPassed])); - Clock.Free; - end; - end; -end; - -procedure TValuesWin.FormClose(Sender: TObject; var Action: TCloseAction); -begin -// Action := caNone; -end; - -procedure TValuesWin.ValueListClick(Sender: TObject); -begin - CheckValueListHotTrack; - if ValueList.HotTrack then - ValueListDblClick(Sender); -end; - -procedure TValuesWin.CheckValueListHotTrack; -const - StyleOfSwitch: array[Boolean] of TListHotTrackStyles = ( - [], [htHandPoint, htUnderlineHot] ); -var - NewHotTrack: Boolean; -begin - if csDestroying in PrefWin.ComponentState then - Exit; - - NewHotTrack := ScrollON xor PrefWin.ValuesSingleClickCB.Checked; - if NewHotTrack = ValueList.HotTrack then Exit; - - with ValueList do begin - HotTrack := NewHotTrack; - HotTrackStyles := StyleOfSwitch[HotTrack]; - Mouse.CursorPos := Mouse.CursorPos; - end; -end; - -procedure TValuesWin.SelectAllMIClick(Sender: TObject); -var - i: Integer; -begin - with ValueList.Items do - for i := 0 to Count-1 do - Item[i].Selected := True; -end; - -procedure TValuesWin.InvertSelectionMIClick(Sender: TObject); -var - i: Integer; -begin - with ValueList.Items do - for i := 0 to Count-1 do - Item[i].Selected := not Item[i].Selected; -end; - -procedure TValuesWin.FormDestroy(Sender: TObject); -begin - ValueNames.Free; -end; - -end. -unit WorkU; - -interface - -uses - Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, StdCtrls, ComCtrls, NewPanels, Grids, Clipbrd, - IntEdit, ExtCtrls, Menus, YTools, CompEx, PlutoConst, - XReg, Clock, Colors, ShellAPI, IniFiles, Math, - keybrd, Buttons, YTypes, LinkLabel, start, - PrefTools, ImgList, PHexMemo, PipelineTh, DropSource, DropTarget, - CrackTools; - -type - TColorStringFmt = (csfThreeSpacedDecimals); - - TWorkWin = class(TForm) - StringPU: TPopupMenu; - SpaceMI: TMenuItem; - FileMI: TMenuItem; - FileOpenD: TOpenDialog; - MainPC: TPageControl; - HintPage: TTabSheet; - Splitter1: TSplitter; - HintLB: TListBox; - InfoMemo: TMemo; - WorkPage: TTabSheet; - WorkP: TPanel; - ShowPC: TPageControl; - StringPage: TTabSheet; - BorderPanel1: TBorderPanel; - StringE: TEdit; - OKStringB: TButton; - BoolStrCB: TCheckBox; - CancelStringB: TButton; - StringAsColorP: TPanel; - StringAsFileP: TBorderPanel; - IconImage: TImage; - IntPage: TTabSheet; - BorderPanel5: TBorderPanel; - OKIntB: TButton; - CardBoolCB: TCheckBox; - CancelIntB: TButton; - BinaryPage: TTabSheet; - BorderPanel6: TBorderPanel; - Panel2: TPanel; - Label5: TLabel; - OffsetHE: THexEdit; - OKBinaryB: TButton; - CancelBinaryB: TButton; - StringTypeRG: TRadioGroup; - SpyPage: TTabSheet; - BorderPanel2: TBorderPanel; - SpyResumeB: TButton; - SpySuspendB: TButton; - SpyLB: TListBox; - Label4: TLabel; - Label7: TLabel; - CardTypeRG: TRadioGroup; - MultiStringPage: TTabSheet; - BorderPanel7: TBorderPanel; - OKMultiStringB: TButton; - CancelMultiStringB: TButton; - MultiStringM: TMemo; - DataTypeComB: TComboBox; - CardinalE: TCardEdit; - ColorDlg: TColorDialog; - MultiStringOpenD: TOpenDialog; - MultiStringSaveD: TSaveDialog; - MultiStringPU: TPopupMenu; - LadenMI: TMenuItem; - SpeichernMI: TMenuItem; - Hinzufgen1: TMenuItem; - N1: TMenuItem; - SisyPage: TTabSheet; - SpyClearTracesB: TButton; - Label11: TLabel; - HexEdit1: THexEdit; - Label12: TLabel; - Label13: TLabel; - SortMultiStringMI: TMenuItem; - SpyTestL: TLabel; - Panel3: TPanel; - CurValueE: TEdit; - BorderPanel8: TBorderPanel; - BorderPanel9: TBorderPanel; - SisyTV: TTreeView; - TabImages: TImageList; - ChangeImages: TImageList; - Panel7: TPanel; - ColorPanel1: TColorPanel; - Splitter2: TSplitter; - SpyDelayIE: TPrefIntEdit; - ListTracesCB: TPrefCheckBox; - Panel5: TPanel; - Panel8: TPanel; - SisyExpandGroupsCB: TPrefCheckBox; - ClearChangesB: TButton; - FilterChangesB: TButton; - SisyTVPU: TPopupMenu; - SisyGotoKeyMI: TMenuItem; - SisyDeleteChangeMI: TMenuItem; - SisyActivateChangeMI: TMenuItem; - N3: TMenuItem; - SisyCopyPathMI: TMenuItem; - N4: TMenuItem; - Panel9: TPanel; - ExternalEditB: TButton; - LoadExternalB: TButton; - ReloadStringB: TButton; - BinaryHM: TPHexMemo; - PipelineCB: TCheckBox; - ReloadDWordB: TButton; - ReloadBinaryB: TButton; - ReloadMultiStringB: TButton; - DescL: TLabel; - SisyHKUCB: TPrefCheckBox; - SisyHKLMCB: TPrefCheckBox; - SisyHKUL: TLabel; - SisyHKLML: TLabel; - SisyListCB: TPrefCheckBox; - CardSpecial0B: TButton; - CardSpecial1B: TButton; - CardSpecial_1B: TButton; - CardSpecial7FB: TButton; - SisyPU: TPopupMenu; - Idle1: TMenuItem; - Lowest1: TMenuItem; - Lower1: TMenuItem; - Normal1: TMenuItem; - Higher1: TMenuItem; - Highes1: TMenuItem; - SisyShowCurrentPathMI: TMenuItem; - N5: TMenuItem; - MultiStringTypeRG: TRadioGroup; - SeparatorE: TEdit; - Label1: TLabel; - MultiStringCountL: TLabel; - DropFileTarget: TDropFileTarget; - CryptoPage: TTabSheet; - BorderPanel3: TBorderPanel; - CryptoE: TEdit; - OKCryptoB: TButton; - CancelCryptoB: TButton; - ReloadCryptoB: TButton; - CryptoTypeRG: TRadioGroup; - Label2: TLabel; - LinkLabel2: TLinkLabel; - procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure SpyResumeBClick(Sender: TObject); - procedure SpySuspendBClick(Sender: TObject); - procedure ArrPlutoBClick(Sender: TObject); - procedure ArrRegEdBClick(Sender: TObject); - procedure ArrFreeBClick(Sender: TObject); - procedure ArrBigValBClick(Sender: TObject); - - procedure SpaceMIClick(Sender: TObject); - procedure FileMIClick(Sender: TObject); - procedure HintLBClick(Sender: TObject); - procedure MainPCDrawTab(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean); - procedure ValueMIClick(Sender: TObject); - procedure StringEKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure StringEChange(Sender: TObject); - procedure OKStringBClick(Sender: TObject); - procedure BoolStrCBClick(Sender: TObject); - procedure CardinalEChange(Sender: TObject); - procedure CardBoolCBClick(Sender: TObject); - procedure CardinalEKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure OKIntBClick(Sender: TObject); - procedure ShowPCChange(Sender: TObject); - procedure ShowPCChanging(Sender: TObject; var AllowChange: Boolean); - procedure ShowPCDrawTab(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean); - procedure ShowPCMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); - procedure FormCreate(Sender: TObject); - procedure OKBinaryBClick(Sender: TObject); - procedure HexGrid1Click(Sender: TObject); - procedure HexGrid1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure BoolStrPopup(Sender: TObject); - procedure StringPageEnter(Sender: TObject); - procedure IntPageEnter(Sender: TObject); - procedure BinaryPageEnter(Sender: TObject); - procedure ReInitShowPC; - procedure ActivateIt(Sender: TObject); - procedure DeActivateIt(Sender: TObject); - procedure FormDeactivate(Sender: TObject); - procedure FormActivate(Sender: TObject); - procedure MultiStringMChange(Sender: TObject); - procedure OKMultiStringBClick(Sender: TObject); - procedure StringAsColorPDblClick(Sender: TObject); - procedure MultiStringMEnter(Sender: TObject); - procedure LadenMIClick(Sender: TObject); - procedure SpeichernMIClick(Sender: TObject); - procedure Hinzufgen1Click(Sender: TObject); - procedure CancelBClick(Sender: TObject); - procedure HexGrid1Enter(Sender: TObject); - procedure SpyClearTracesBClick(Sender: TObject); - procedure SpyLBKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - //procedure BinLMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); - procedure BinLClick(Sender: TObject); - procedure HexGrid1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure ValueViewChanged(Sender: TObject); - procedure HexEdit1Change(Sender: TObject); - procedure SortMultiStringMIClick(Sender: TObject); - procedure SpyTestLClick(Sender: TObject); - procedure FocusForEditing; - procedure CurValueEKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure CurValueEEnter(Sender: TObject); - - procedure AddAHint(const Hint: string); - procedure SisyTVGetSelectedIndex(Sender: TObject; Node: TTreeNode); - procedure SisyTVDblClick(Sender: TObject); - procedure SisyTVKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure SisyCBClick(Sender: TObject); - procedure BinaryHMLineChange(NewLine: Cardinal); - procedure OffsetHEChange(Sender: TObject); - procedure SpyDelayIEChange(Sender: TObject); - procedure SisyTVExpanded(Sender: TObject; Node: TTreeNode); - procedure ClearChangesBClick(Sender: TObject); - procedure FilterChangesBClick(Sender: TObject); - procedure SisyTVPUPopup(Sender: TObject); - procedure SisyActivateChangeMIClick(Sender: TObject); - procedure SisyDeleteChangeMIClick(Sender: TObject); - procedure SisyCopyPathMIClick(Sender: TObject); - procedure ExternalEditBClick(Sender: TObject); - procedure LoadExternalBClick(Sender: TObject); - procedure ReloadBClick(Sender: TObject); - procedure PipelineCBClick(Sender: TObject); - procedure BinaryHMEnter(Sender: TObject); - procedure xUseExtendedModelCBClick(Sender: TObject); - procedure SeparatorEChange(Sender: TObject); - procedure HintLBKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure DWORDSpecialBClick(Sender: TObject); - procedure Button1Click(Sender: TObject); - procedure SisyPUPopup(Sender: TObject); - procedure SisyPriorityMIClick(Sender: TObject); - procedure SisyShowCurrentPathMIClick(Sender: TObject); - procedure DropFileTargetDrop(Sender: TObject; ShiftState: TShiftState; - Point: TPoint; var Effect: Integer); - procedure FormClose(Sender: TObject; var Action: TCloseAction); - procedure FormResize(Sender: TObject); - procedure IconImageDblClick(Sender: TObject); - procedure SisyTVCustomDrawItem(Sender: TCustomTreeView; - Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean); - procedure SisyTVMouseDown(Sender: TObject; Button: TMouseButton; - Shift: TShiftState; X, Y: Integer); - procedure OKCryptoBClick(Sender: TObject); - procedure CryptoEKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); - private - PipelineThread: TPipelineThread; - BoolStr: array of array[Boolean] of string; - HexEditAutoChange: Boolean; - TargetPage: TTabSheet; - procedure DeleteChange(Node: TTreeNode); - procedure DeactivateChange(Node: TTreeNode); - procedure CopySelectedChangeName; - procedure ClearChanges; - public - ShowAsBinary: Boolean; - function LastHint: string; - function LoadBoolStr: Boolean; - function LoadSisyFilter: Boolean; - procedure ShowValues(Reg: TXRegistry); - procedure UpdateWriteButtons; - procedure EditData; - end; - -var - WorkWin: TWorkWin; - ShowPC: TPageControl; - MainPC: TPageControl; - -implementation - -uses TreeU, ValuesU, plutomain, splash, SisyphusTH, PrefU, ShellEx; - -{$R *.dfm} - -function ColorOfString(s: string; Format: TColorStringFmt; - Default: TColor = clBlack): TColor; -var - SA: TStrA; - i: Integer; -begin - Result := Default; - SA := nil; - - case Format of - csfThreeSpacedDecimals: begin - SA := Split(s, ' '); - if Length(SA) <> 3 then - Exit; - for i := 0 to 2 do - if not (IsValidInteger(SA[i]) and (StrToIntDef(SA[i], -1) in [0..255])) then - Exit; - Result := ColorOfRGB(StrToIntDef(SA[0], 0), - StrToIntDef(SA[1], 0), - StrToIntDef(SA[2], 0)); - end; - end; -end; - -function StringOfColor(Color: TColor; Format: TColorStringFmt): string; -var - RGB: TRGB; -begin - Result := ''; - - RGB := RGBOfColor(Color); - case Format of - csfThreeSpacedDecimals: begin - with RGB do - Result := IntToStr(R) + ' ' + IntToStr(G) + ' ' + IntToStr(B); - end; - end; -end; - -function TWorkWin.LastHint: string; -begin - with HintLB.Items do - if Count > 0 then - Result := Strings[Count-1] - else - Result := ''; -end; - -procedure TWorkWin.AddAHint(const Hint: string); -begin - if not Assigned(HintLB) then - Exit; - - with HintLB.Items do begin - if Count > 0 then begin - if StrAtBegin(LastHint, Hint) then begin //same hint again - with HintLB do - Tag := Tag + 1; - Strings[Count-1] := Format('%s (%d)', [Hint, HintLB.Tag]); - Exit end else - HintLB.Tag := 1; - end; - Add(Hint); - end; - Application.ProcessMessages; //draw -// Sleep(1000); //wait to read hints -end; - -procedure TWorkWin.ReInitShowPC; -begin - with CurValueE do begin - Text := NoValueCaption; - Font.Color := clSilver; - Enabled := False; - end; - - ShowPC.ActivePage := nil; - - StringE.Text := ''; - StringTypeRG.ItemIndex := 0; - - MultiStringTypeRG.Buttons[1].Enabled := False; - - CardinalE.Value := 0; - CardTypeRG.ItemIndex := 0; - - BinaryHM.Data := nil; - PipelineCB.Checked := False; - - DataTypeComB.ItemIndex := Integer(rdBinary); - - MultiStringM.Clear; -end; - -procedure TWorkWin.FormKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - MainWin.FormKeyDown(Sender, Key, Shift); -end; - -procedure TWorkWin.SpyResumeBClick(Sender: TObject); -begin - SpyThread.Resume; - SpyTestLClick(Sender); -end; - -procedure TWorkWin.SpySuspendBClick(Sender: TObject); -begin - SpyThread.Suspend; - SpyTestLClick(Sender); -end; - -procedure TWorkWin.ArrPlutoBClick(Sender: TObject); -begin - ArrangePlutoStyle; -end; - -procedure TWorkWin.ArrRegEdBClick(Sender: TObject); -begin - ArrangeRegEdStyle; -end; - -procedure TWorkWin.ArrFreeBClick(Sender: TObject); -begin - ArrangeFreeStyle; -end; - -procedure TWorkWin.ArrBigValBClick(Sender: TObject); -begin - ArrangeBigValStyle; -end; - -procedure TWorkWin.SpaceMIClick(Sender: TObject); -begin - StringE.Text := ''; -end; - -procedure TWorkWin.HintLBClick(Sender: TObject); -begin - StatusBar.Panels[0].Text := GetSel(HintLB); - WorkWin.InfoMemo.Text := StatusBar.Panels[0].Text; -end; - -procedure TWorkWin.MainPCDrawTab(Control: TCustomTabControl; TabIndex: Integer; - const Rect: TRect; Active: Boolean); -var - PC: TPageControl; - Page: TTabSheet; -begin - PC := TPageControl(Control); - Page := PC.Pages[TabIndex]; - with PC.Canvas.Font do begin - if Page.Caption = 'Hint' then - Color := clBrightRed - else if Page.Caption = 'Edit' then - Color := clBrightGreen - else if Page.Caption = 'Spy' then - Color := clBrightBlue - else if Page.Caption = 'Sisyphus' then - Color := clBrightCyan - else - Color := clWhite; - end; - - with PC.Canvas do - if Active then begin - Font.Style := [fsBold]; - Brush.Color := clDarkGray; - FillRect(Rect); - TextOut(Rect.Left + 18 + 5, Rect.Top + 3, Page.Caption); - PC.Images.Draw(PC.Canvas, Rect.Left + 4, Rect.Top + 2, Page.ImageIndex); - end else begin - Font.Style := []; - Brush.Color := clDarkGray; - FillRect(Rect); - TextOut(Rect.Left + 18 + 3, Rect.Top + 2, Page.Caption); - PC.Images.Draw(PC.Canvas, Rect.Left + 1, Rect.Top + 1, Page.ImageIndex); - end; -end; - -procedure TWorkWin.ValueMIClick(Sender: TObject); -begin - StringE.Text := UntilStr(TMenuItem(Sender).Caption,' = '); - OKStringBClick(Sender); -end; - -procedure TWorkWin.StringEKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if key = VK_RETURN then begin - OKStringBClick(Sender); - ValuesWin.FocusControl(ValueList); - end; - if key = VK_ESCAPE then - CancelBClick(Sender); -end; - -procedure TWorkWin.StringEChange(Sender: TObject); -var - i: Integer; - State: TCheckBoxState; - Desc: string; -begin - IconImage.Picture := nil; - - with StringAsColorP do begin - Color := ColorOfString(StringE.Text, csfThreeSpacedDecimals, -1); - Visible := Color <> -1; - end; - - try - with IconImage.Picture.Icon do begin - ReleaseHandle; - Handle := GetIconFromFile(StringE.Text); - StringAsFileP.Visible := Handle <> 0; - end; - except - end; - - State := cbGrayed; - for i := 0 to High(BoolStr) do begin - if StringE.Text = BoolStr[i][False] then - State := cbUnchecked - else if StringE.Text = BoolStr[i][True] then - State := cbChecked - else - Continue; - Break; - end; - - BoolStrCB.Visible := State in [cbChecked, cbUnchecked]; - BoolStrCB.State := State; - - Desc := StringE.Text; - Desc := RegNameOfCLSID(Desc); - with DescL do begin - Visible := (Desc <> ''); - if Visible then - Caption := 'CLSID is: ' + Desc; - end; -end; - -procedure TWorkWin.OKStringBClick(Sender: TObject); -var - i: Integer; -begin - try - OpenCurKey; - with ValuesWin.ValueNames do - for i := 0 to Count-1 do begin - case StringTypeRG.ItemIndex of - 0: MainReg.WriteString(Strings[i], StringE.Text); - 1: MainReg.WriteExpandString(Strings[i], StringE.Text); - end; - end; - ValuesWin.UpdateValues(True); - finally - MainReg.CloseKey; - end; - ValuesWin.ValueListDblClick(Sender); -end; - -procedure TWorkWin.BoolStrCBClick(Sender: TObject); -var - i: Integer; -begin - for i := 0 to High(BoolStr) do begin - if (BoolStr[i, False] = StringE.Text) - or (BoolStr[i, True] = StringE.Text) then - Break; - end; - - if i > High(BoolStr) then - Exit; - - StringE.Text := BoolStr[i][BoolStrCB.Checked]; -end; - -procedure TWorkWin.CardinalEChange(Sender: TObject); -begin - HexEditAutoChange := True; - with CardBoolCB do begin - Enabled := True; - case CardinalE.Value of - 1: Checked := True; - 0: Checked := False; - else - Enabled := False; - end; - end; - HexEdit1.Value := CardinalE.Value; - HexEditAutoChange := False; -end; - -procedure TWorkWin.CardBoolCBClick(Sender: TObject); -begin - if HexEditAutoChange then - Exit; - CardinalE.Value := Ord(CardBoolCB.Checked); -end; - -procedure TWorkWin.CardinalEKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if key = VK_RETURN then begin - OKIntBClick(Sender); - ValuesWin.FocusControl(ValueList); - end; - - if key = VK_ESCAPE then - CancelBClick(Sender); -end; - -procedure TWorkWin.OKIntBClick(Sender: TObject); -var - i: Integer; - - procedure Write4BB(const ValueName: string; Value: Cardinal); - var - Typ: TRegDataType; - begin - if MainReg.ValueReallyExists(ValueName) then - Typ := MainReg.GetDataType(ValueName) - else - Typ := rdBinary; - - if Typ in rdCardTypes then - Typ := rdBinary; - - MainReg.WriteBinType(ValueName, ByteAOfInt(CardinalE.Value), Typ); - end; - -begin - try - OpenCurKey; - with ValuesWin.ValueNames do - for i := 0 to Count-1 do begin - case CardTypeRG.ItemIndex of - 0: MainReg.WriteCardinal(Strings[i], CardinalE.Value); - 1: MainReg.WriteCardinal(Strings[i], CardinalE.Value, True); - 2: Write4BB(Strings[i], CardinalE.Value); - end; - end; - ValuesWin.UpdateValues(True); - finally - MainReg.CloseKey; - end; -end; - -procedure TWorkWin.ShowPCChange(Sender: TObject); -begin - FocusControl(TObject(ShowPC.ActivePage.Tag) as TWinControl); -end; - -procedure TWorkWin.ShowPCChanging(Sender: TObject; var AllowChange: Boolean); - - function ByteAOfDWORD(a: DWORD): TByteA; - begin - SetLength(Result, SizeOf(DWORD)); - Move(a, Pointer(Result)^, SizeOf(DWORD)); - end; - -var - SourcePage: TTabSheet; - ValueName: string; -begin - SourcePage := ShowPC.ActivePage; - if SourcePage = IntPage then begin - - if TargetPage = StringPage then begin - AddHint('Converting: DWORD --> String'); - StringE.Text := CardinalE.Text; - end else if TargetPage = BinaryPage then begin - AddHint('Converting: DWORD --> Binary'); - BinaryHM.Data := ByteAOfDWORD(CardinalE.Value); - end else - AllowChange := False; - - end else if SourcePage = StringPage then begin - if TargetPage = IntPage then begin - if IsValidCardinal(StringE.Text) then begin - AddHint('Converting: String --> DWORD'); - CardinalE.Text := StringE.Text; - end else begin - AddHint('This no valid DWORD; Converting aborted.', True); - AllowChange := False; - end; - end else if TargetPage = BinaryPage then begin - AddHint('Converting: String --> Binary'); - BinaryHM.Data := TByteA(StringE.Text); - end else if TargetPage = MultiStringPage then begin - AddHint('Converting: String --> MultiString'); - if SeparatorE.Text = '' then - MultiStringM.Text := StringE.Text; - SeparatorEChange(Sender); - end else - AllowChange := False; - - end else if SourcePage = BinaryPage then begin - if TargetPage = StringPage then begin - AddHint('Converting: Binary --> String'); - StringE.Text := FriendlyStr(string(BinaryHM.Data)); - end else if TargetPage = IntPage then begin - if Length(BinaryHM.Data) >= SizeOf(DWORD) then begin - AddHint('Converting: Binary --> DWORD'); - CardinalE.Value := PDWORD(BinaryHM.Data)^; - end else begin - AddHint('Binary value not long enough (4 Byte); Converting aborted.', True); - AllowChange := False; - end; - end else if TargetPage = CryptoPage then begin - if ValuesWin.ValueNames.Count = 1 then begin - ValueName := ValuesWin.ValueNames[0]; - with CryptoTypeRG do begin - ItemIndex := -1; - if SameText(ValueName, 'ScreenSave_Data') then begin - ItemIndex := 0; - CryptoE.Text := DecodeScreenSaver(BinaryHM.Data); - end else if SameText(ValueName, 'parm1enc') - or SameText(ValueName, 'parm2enc') then begin - ItemIndex := 1; - CryptoE.Text := DecodeSharedFolder(BinaryHM.Data); - end; - end; - if CryptoTypeRG.ItemIndex = -1 then - AllowChange := False; - end; - end else - AllowChange := False; - - end else if SourcePage = MultiStringPage then begin - if TargetPage = StringPage then begin - AddHint('Converting: MultiString --> String '); - if SeparatorE.Text = '' then - StringE.Text := MultiStringM.Text - else - StringE.Text := Join(MultiStringM.Lines, SeparatorE.Text); - //end else if TargetPage = BinaryPage then begin - end else - AllowChange := False; - - end else - AllowChange := False; -end; - -procedure TWorkWin.ShowPCDrawTab(Control: TCustomTabControl; TabIndex: Integer; - const Rect: TRect; Active: Boolean); -var - PC: TPageControl; - Page: TTabSheet; -begin - PC := TPageControl(Control); - Page := PC.Pages[TabIndex]; - with PC.Canvas.Font do begin - if Page = StringPage then - Color := clBrightRed - else if Page = MultiStringPage then - Color := clBrightPurple - else if Page = IntPage then - Color := clBrightBlue - else if Page = BinaryPage then - Color := clBrightGreen - else if Page = CryptoPage then - Color := clBrightCyan; - end; - - with PC.Canvas do begin - if Active then - Brush.Color := clGray - else - Brush.Color := clDarkGray; - FillRect(Rect); - TextOut(Rect.Left + 18 + 3, Rect.Top, Page.Caption); - MainWin.ImageList1.Draw(Control.Canvas, Rect.Left - 1, Rect.Top - 1, Page.ImageIndex); - end; -end; - -procedure TWorkWin.ShowPCMouseDown(Sender: TObject; Button: TMouseButton; - Shift: TShiftState; X, Y: Integer); -begin - with ShowPC do - if htOnItem in GetHitTestInfoAt(X, Y) then - TargetPage := Pages[IndexOfTabAt(X, Y)]; -end; - -procedure TWorkWin.FormCreate(Sender: TObject); -var - i: Integer; -begin - WorkU.ShowPC := ShowPC; - WorkU.MainPC := MainPC; - - //Zeromize - ShowPC.ActivePage := nil; - InfoMemo.Text := ''; - MultiStringM.Clear; - SisyTV.Items.Clear; - CurValueE.Text := NoValueCaption; - HexEditAutoChange := False; - TargetPage := nil; - - //Tagging - StringPage.Tag := Integer(StringE); - IntPage.Tag := Integer(CardinalE); - BinaryPage.Tag := Integer(BinaryHM); - MultiStringPage.Tag := Integer(MultiStringM); - ShowAsBinary := False; - - if not Win9x then - CryptoPage.TabVisible := False; - - MainPC.ActivePage := HintPage; - ShowPC.ActivePage := nil; - - DropFileTarget.register(StringE); - - with StringTypeRG do - for i := 0 to ControlCount-1 do - (Controls[i] as TRadioButton).OnKeyDown := StringEKeyDown; - - ExternalEditB.Enabled := FileEx(PrefWin.ExternalHexEditE.Text); - - PipelineThread := TPipelineThread.CreateIt(tpIdle, '', BinaryHM); - PipelineThread.OnChange := LoadExternalBClick; -end; - -procedure TWorkWin.OKBinaryBClick(Sender: TObject); -var - Typ: Cardinal; - i: Integer; -begin - try - Typ := StrToIntDef(UntilChar(DataTypeComB.Text, ' '), Integer(rdBinary)); - OpenCurKey; - with ValuesWin.ValueNames do - for i := 0 to Count-1 do - MainReg.WriteBinType(Strings[i], BinaryHM.Data, Typ); - ValuesWin.UpdateValues(True); - finally - MainReg.CloseKey; - end; -end; - -procedure TWorkWin.HexGrid1Click(Sender: TObject); -begin - {with BinaryHM do begin - with BinL, Font do - if ActiveByte < ByteCount then - Color := clBrightGreen - else begin - Color := clSilver; - Caption := '00000000'; - end; - BinL.Caption := IntToBinFill(CurrentByte, 8); - end; } -end; - -procedure TWorkWin.HexGrid1KeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if key = VK_RETURN then begin - OKBinaryBClick(Sender); - ValuesWin.FocusControl(ValueList); - end; - if key = VK_ESCAPE then - CancelBClick(Sender); -end; - -procedure TWorkWin.BoolStrPopup(Sender: TObject); -begin - StringE.Text := TMenuItem(Sender).Caption; -end; - -procedure TWorkWin.StringPageEnter(Sender: TObject); -begin - FocusControl(StringE); -end; - -procedure TWorkWin.IntPageEnter(Sender: TObject); -begin - FocusControl(CardinalE); -end; - -procedure TWorkWin.BinaryPageEnter(Sender: TObject); -begin - FocusControl(BinaryHM); -end; - -procedure TWorkWin.ActivateIt(Sender: TObject); -begin - ActivateThis(Sender); -end; - -procedure TWorkWin.DeActivateIt(Sender: TObject); -begin - DeActivateThis(Sender); -end; - -procedure TWorkWin.FormDeactivate(Sender: TObject); -begin - if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then - TEdit(ActiveControl).OnExit(Sender); -end; - -procedure TWorkWin.FormActivate(Sender: TObject); -begin - if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then - TEdit(ActiveControl).OnEnter(Sender); -end; - -procedure TWorkWin.MultiStringMChange(Sender: TObject); -begin - MultiStringCountL.Caption := StrNumerus(MultiStringM.Lines.Count, - 'Line', 'Lines', 'No'); -end; - -procedure TWorkWin.OKMultiStringBClick(Sender: TObject); -var - UseExtendedModel: Boolean; - i: Integer; - JoinedText: string; -begin - if (MultiStringTypeRG.ItemIndex = 1) then begin - if ValuesWin.ValueCommonType = rdMultiString then - if mrYes<>MessageDlg('Do you want to change the type of this value?' + EOL + - 'MultiString --> String', mtWarning, [mbYes, mbCancel], 0) then - Exit; - - try - OpenCurKey; - JoinedText := Join(MultiStringM.Lines, SeparatorE.Text); - with ValuesWin.ValueNames do - for i := 0 to Count-1 do - MainReg.WriteString(Strings[i], JoinedText); - ValuesWin.UpdateValues(True); - finally - MainReg.CloseKey; - end; - Exit; end; - - UseExtendedModel := True; - if ContainsEmptyLines(MultiStringM.Lines) then - case MessageDlg('This text contains empty lines.' + EOL + - 'These are not allowed in the standard MultiString model.' + EOL + - 'Do you want to delete them?' + EOL + - EOL + - 'Yes: Delete empty lines' + EOL + - 'No: Use the Extended Model', - mtWarning, [mbYes, mbNo, mbCancel], 0) of - - mrNo: UseExtendedModel := True; - - mrYes: begin - with MultiStringM do begin - Lines.BeginUpdate; - DeleteEmptyLines(Lines); - Lines.EndUpdate; - end; - end; - - else Exit; - - end; - - try - OpenCurKey; - with ValuesWin.ValueNames do - for i := 0 to Count-1 do begin - if MainReg.GetDataType(Strings[i]) <> rdMultiString then - if mrYes <> MessageDlg('Do you want to change the type of this value?' + EOL + - '--> MultiString', mtWarning, [mbYes, mbCancel], 0) then - Exit; - if UseExtendedModel then - MainReg.WriteStringList(Strings[i], MultiStringM.Lines) - else - MainReg.WriteMultiString(Strings[i], MultiStringM.Lines); - end; - ValuesWin.UpdateValues(True); - finally - MainReg.CloseKey; - end; - - ValuesWin.ValueListDblClick(Sender); -end; - -procedure TWorkWin.StringAsColorPDblClick(Sender: TObject); -begin - if ColorDlg.Execute then - StringE.Text := StringOfColor(ColorDlg.Color, csfThreeSpacedDecimals); -end; - -procedure TWorkWin.MultiStringMEnter(Sender: TObject); -begin - MultiStringM.SelectAll; - ActivateIt(MultiStringM); -end; - -procedure TWorkWin.LadenMIClick(Sender: TObject); -begin - with MultiStringOpenD do begin - InitialDir := ExtractFileDrive(MyDir); - if Execute then - MultiStringM.Lines.LoadFromFile(FileName); - end; -end; - -procedure TWorkWin.SpeichernMIClick(Sender: TObject); -begin - with MultiStringSaveD do begin - InitialDir := ExtractFileDrive(MyDir); - if Execute then - MultiStringM.Lines.SaveToFile(FileName); - end; -end; - -procedure TWorkWin.Hinzufgen1Click(Sender: TObject); -var - SL: TStringList; -begin - with MultiStringOpenD do begin - InitialDir := ExtractFileDrive(MyDir); - if Execute then begin - SL := TStringList.Create; - SL.LoadFromFile(FileName); - MultiStringM.Lines.AddStrings(SL); - SL.Free; - end; - end; -end; - -procedure TWorkWin.CancelBClick(Sender: TObject); -begin - ValuesWin.FocusControl(ValueList); - ValuesWin.ValueListChange(Sender, ValueList.Selected, ctState); -end; - -procedure TWorkWin.HexGrid1Enter(Sender: TObject); -begin - HexGrid1Click(Sender); -end; - -procedure TWorkWin.SpyClearTracesBClick(Sender: TObject); -begin - SpyLB.Clear; -end; - -procedure TWorkWin.SpyLBKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if (ssShift in Shift) and (key = VK_DELETE) then begin - key := 0; - SpyLB.Clear; - Exit; end; - - if key = VK_F9 then begin - key := 0; - SwapFonts(SpyLB); - Exit; end; -end; - -procedure TWorkWin.BinLClick(Sender: TObject); -begin - // with HexGrid1 do - // Byt[ActiveByte] := IntOfBin(BinL.Caption); -end; - -procedure TWorkWin.HexGrid1KeyUp(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - //HexGrid1Click(Sender); -end; - -procedure TWorkWin.ValueViewChanged(Sender: TObject); -var - i: Integer; -begin - if not Started then - Exit; - - SpyThread.Suspend; - OpenCurKey; - for i := 0 to ValueList.Items.Count-1 do - ValuesWin.UpdateValue(MainReg, ValueList.Items[i]); - - MainReg.CloseKey; - SpyThread.Resume; -end; - -procedure TWorkWin.HexEdit1Change(Sender: TObject); -begin - if not HexEditAutoChange then - CardinalE.Value := HexEdit1.Value; -end; - -procedure TWorkWin.SortMultiStringMIClick(Sender: TObject); -var - SL: TStringList; -begin - SL := TStringList.Create; - with SL do begin - Assign(MultiStringM.Lines); - Sort; - end; - MultiStringM.Lines.Assign(SL); - SL.Free; -end; - -procedure TWorkWin.SpyTestLClick(Sender: TObject); -begin - SpyTestL.Caption := StrOfBool(SpyThread.Suspended, 'No Spy.', 'Spy active.'); -end; - -procedure TWorkWin.FocusForEditing; -begin - FocusControl(MainPC); -end; - -function TWorkWin.LoadBoolStr: Boolean; -var - SL: TStringList; - FileName: string; - i, p: Integer; -begin - Result := True; - - AddHint('Loading Boolean Strings...'); - - FileName := PlutoDir + BoolStrFileName; - if not FileEx(FileName) then begin - AddToLastHint('not found:'); - AddHint(FileName); - Result := False; - end else begin - SL := TStringList.Create; - try - SL.LoadFromFile(FileName); - DeleteCommentLines(SL); - BoolStr := nil; - SetLength(BoolStr, SL.Count); - for i := 0 to SL.Count-1 do begin - //Split the string by the '|'-sign - p := Pos('|', SL[i]); - BoolStr[i][False] := Copy(SL[i], 1, p-1); - BoolStr[i][True] := Copy(SL[i], p+1, Length(SL[i]) - p); - end; - finally - SL.Free; - AddToLastHint('OK'); - end; - end; -end; - -function TWorkWin.LoadSisyFilter: Boolean; -var - SL: TStringList; - FileName: string; - i: Integer; -begin - Result := True; - - FileName := PlutoDir + SisyFilterFileName; - if not FileEx(FileName) then - Result := False - else begin - AddHint('Loading Sisyphus Filter Settings...'); - SL := TStringList.Create; - try - SL.LoadFromFile(FileName); - DeleteCommentLines(SL, '#'); - for i := 0 to SL.Count-1 do - SL[i] := TrimLeft(SL[i]); - - SisyFilter.Clear; - SisyFilter.AddStrings(SL); - finally - SL.Free; - AddToLastHint('OK'); - end; - end; -end; - -procedure TWorkWin.SisyTVGetSelectedIndex(Sender: TObject; Node: TTreeNode); -begin - Node.SelectedIndex := Node.ImageIndex; -end; - -procedure TWorkWin.SisyTVDblClick(Sender: TObject); -var - Node: TTreeNode; - Path: string; -begin - Node := SisyTV.Selected; - if not Assigned(Node) then - Exit; - - Path := RootOfNode(Node).Text; - - if Node.Level > 0 then begin - if Node.Level = 2 then - Node := Node.Parent; - if Node.HasChildren then - Path := Path + '\\' + Node.Text //Value - else - Path := Path + '\' + Node.Text //SubKey - end; - - MainWin.GotoKey(Path); -end; - -procedure TWorkWin.DeleteChange(Node: TTreeNode); -var - SubNode: TTreeNode; - - procedure FreeSisyChangeNode(Node: TTreeNode); - begin - try - with (TObject(Node.Data) as TSisyChange) do - Free; - except - ReportFmt('errors', 'Context could not be freed: "%s"', [Node.Text]); - end; - - Node.Delete; - end; - -begin - if not Assigned(Node) then - Exit; - - if Node.Level = 2 then - Node := Node.Parent; - - if Node.Level = 0 then begin - SisyTV.Selected := GetNextBest(RootOfNode(Node)); - SubNode := Node.GetFirstChild; - while Assigned(SubNode) do begin - FreeSisyChangeNode(SubNode); - SubNode := Node.GetFirstChild; end; - Node.Delete; - end else begin - SisyTV.Selected := GetNextBest(Node); - FreeSisyChangeNode(Node); - end; -end; - -procedure TWorkWin.DeactivateChange(Node: TTreeNode); -begin - Node := RootOfNode(Node); - - if not Assigned(Node) then - Exit; - - if SisyChangeActivated(Node) then begin - SetSisyChangeState(Node, False); - Node.Cut := True; - end else begin - SetSisyChangeState(Node, True); - Node.Cut := False; - end; - SisyTV.Repaint; -end; - -procedure TWorkWin.CopySelectedChangeName; -var - Node: TTreeNode; -begin - Node := SisyTV.Selected; - if not Assigned(Node) then - Exit; - - Clipboard.AsText := Node.Text; -end; - -procedure TWorkWin.SisyTVKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -var - Node: TTreeNode; -begin - Node := RootOfNode(SisyTV.Selected); - if not Assigned(Node) then - Exit; - - {if Key = VK_RETURN then - SisyTVDblCLick(Sender); - - if Key = VK_DELETE then - if (ssCtrl in Shift) and (Key = VK_DELETE) then - DeactivateChange(Node) - else - DeleteChange(Node); - - if (ssCtrl in Shift) and (Char(Key) = 'C') then - CopySelectedChangeName;} -end; - -procedure TWorkWin.SisyCBClick(Sender: TObject); -begin - if not Started then - Exit; - - with TCheckBox(Sender), TSisyThread(Sisys[Tag]) do begin - if Checked then - Resume - else - Suspend; - end; -end; - -procedure TWorkWin.CurValueEEnter(Sender: TObject); -begin - CurValueE.Text := RealValueName(ValueList.ItemFocused); - CurValueE.SelectAll; -end; - -procedure TWorkWin.CurValueEKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); - - procedure RenameValue(NewName: string); - var - Item: TListItem; - begin - Item := ValueList.ItemFocused; - if ValuesWin.TryRenameValue(CurKey.Value, NewName) then - SetRealValueName(Item, NewName); - end; - -begin - if Key = VK_RETURN then begin - SpyThread.Suspend; - try - RenameValue(CurValueE.Text); - ValuesWin.ValueListDblClick(Self); - FocusControl(CurValueE); - finally - SpyThread.Restart := True; - SpyThread.Resume; - end; - Key := 0; - //CurValueE.SelectAll; - end else if Key = VK_ESCAPE then begin - ValuesWin.ValueListDblClick(Self); - end; -end; - -procedure TWorkWin.BinaryHMLineChange(NewLine: Cardinal); -begin - OffsetHE.Value := BinaryHM.Pos; - // BinaryAsIntL.Value := Integer(BinaryHM.CurentCard); -end; - -procedure TWorkWin.OffsetHEChange(Sender: TObject); -begin - BinaryHM.Pos := OffsetHE.Value; -end; - -procedure TWorkWin.SpyDelayIEChange(Sender: TObject); -begin - if Assigned(SpyThread) then - SpyThread.Delay := SpyDelayIE.Value; -end; - -procedure TWorkWin.SisyTVExpanded(Sender: TObject; Node: TTreeNode); -begin - if Node.ImageIndex = 8 then - Node.ImageIndex := 7; -end; - -procedure TWorkWin.ClearChanges; -var - Node: TTreeNode; -begin - with SisyTV.Items do begin - Node := GetFirstNode; - while Assigned(Node) do begin - DeleteChange(Node); - Node := GetFirstNode; - end; - end; -end; - -procedure TWorkWin.ClearChangesBClick(Sender: TObject); -begin - if mrOK <> MessageDlg('Do you really want to clear all changes?', - mtWarning, [mbOK, mbCancel], 0) then - Exit; - - ClearChanges; -end; - -procedure TWorkWin.FilterChangesBClick(Sender: TObject); -begin - NotePad(PlutoDir + SisyFilterFileName); - ShowMessage('Click OK when you finished editing.' + EOL + - '(Pluto will reload the filter settings then.)'); - LoadSisyFilter; -end; - -procedure TWorkWin.SisyTVPUPopup(Sender: TObject); -var - KeySelected: Boolean; - Node: TTreeNode; -begin - Node := SisyTV.Selected; - KeySelected := Assigned(Node); - - SisyGoToKeyMI.Enabled := KeySelected; - SisyDeleteChangeMI.Enabled := KeySelected; - SisyActivateChangeMI.Enabled := KeySelected; - SisyCopyPathMI.Enabled := KeySelected; - if not KeySelected then - Exit; - - SisyActivateChangeMI.Checked := SisyChangeActivated(RootOfNode(Node)); -end; - -procedure TWorkWin.SisyActivateChangeMIClick(Sender: TObject); -begin - DeactivateChange(SisyTV.Selected) -end; - -procedure TWorkWin.SisyDeleteChangeMIClick(Sender: TObject); -begin - DeleteChange(SisyTV.Selected) -end; - -procedure TWorkWin.SisyCopyPathMIClick(Sender: TObject); -begin - CopySelectedChangeName; -end; - -procedure TWorkWin.FileMIClick(Sender: TObject); -var - s: string; -begin - with FileOpenD do begin - s := ExtractPath(StringE.Text); - if s <> '' then - InitialDir := s - else - InitialDir := MyDir; - - s := ExtractFileName(StringE.Text); - s := DeleteChars(s, '/'); - if s <> '' then - FileName := s; - - if Execute then - StringE.Text := FileName; - end; -end; - -procedure TWorkWin.ExternalEditBClick(Sender: TObject); -var - FileName: string; -begin - FileName := TempDir + '~' + DeleteChars(CurValueE.Text, FileNameEnemies) + - '.bin'; - if SaveByteA(BinaryHM.Data, FileName) then - ExecFileWith(PrefWin.ExternalHexEditE.Text, FileName) - else - ShowMessage('Could not write into file:' + EOL + FileName); - - PipelineThread.FileName := FileName; -end; - -procedure TWorkWin.LoadExternalBClick(Sender: TObject); -var - FileName: string; - Data: TByteA; - i: Integer; -begin - Data := nil; - - FileName := TempDir + '~' + CurValueE.Text + '.bin'; - if not FileEx(FileName) then begin - {ShowMessage('File not found:' + EOL + - FileName);} - Exit; - end; - - Data := LoadByteA(FileName); - if Length(Data) = Length(BinaryHM.Data) then begin - for i := 0 to High(Data) do - if Data[i] <> BinaryHM.Data[i] then begin - BinaryHM.Data := Data; - Exit; - end; - end else - BinaryHM.Data := Data; -end; - -procedure TWorkWin.PipelineCBClick(Sender: TObject); -begin - with PipelineThread, PipelineCB do - if Checked then begin - if Suspended then - Resume; - end else - if not Suspended then - Suspend; -end; - -procedure TWorkWin.ReloadBClick(Sender: TObject); -begin - ValuesWin.ValueListDblClick(Self); -end; - -procedure TWorkWin.BinaryHMEnter(Sender: TObject); -begin - PipelineCB.Checked := False; -end; - -procedure TWorkWin.xUseExtendedModelCBClick(Sender: TObject); -begin - PrefWin.UseExtendedModelCB.Load; -end; - -procedure TWorkWin.SeparatorEChange(Sender: TObject); -begin - if not SeparatorE.Enabled then - Exit; - - if SeparatorE.Text = '' then begin - if StringE.Text = '' then - Exit - else - MultiStringM.Text := StringE.Text; - MultiStringTypeRG.Buttons[1].Enabled := False; - MultiStringTypeRG.ItemIndex := 0; - end else begin - if StringE.Text = '' then - StringE.Text := Join(MultiStringM.Lines, SeparatorE.Text); - MultiStringTypeRG.Buttons[1].Enabled := True; - MultiStringTypeRG.ItemIndex := 1; - Split(StringE.Text, SeparatorE.Text, MultiStringM.Lines, False); - end; -end; - -procedure TWorkWin.HintLBKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if (Key = Byte('C')) and (ssCtrl in Shift) then - with HintLb do - if ItemIndex >= 0 then - Clipboard.AsText := Items[ItemIndex]; -end; - -procedure TWorkWin.DWORDSpecialBClick(Sender: TObject); -begin - CardinalE.Value := StrToIntDef((Sender as TButton).Caption, 0); -end; - -procedure TWorkWin.Button1Click(Sender: TObject); -begin - ShowPC.SelectNextPage(True); -end; - -procedure TWorkWin.SisyPUPopup(Sender: TObject); -begin - with SisyPU, TSisyThread(Sisys[PopupComponent.Tag]) do - Items[Integer(Priority)].Checked := True; -end; - -procedure TWorkWin.SisyPriorityMIClick(Sender: TObject); -begin - with TSisyThread(Sisys[SisyPU.PopupComponent.Tag]) do begin - Priority := TThreadPriority(TMenuItem(Sender).MenuIndex); - if Priority <= tpNormal then - Uni.WriteInteger('Priority', Integer(Priority)); - end; -end; - -procedure TWorkWin.SisyShowCurrentPathMIClick(Sender: TObject); -begin - with SisyPU, TSisyThread(Sisys[PopupComponent.Tag]) do begin - Suspend; - ShowMessage(CurrentSpyKey.Path); - Resume; - end; -end; - -procedure TWorkWin.DropFileTargetDrop(Sender: TObject; - ShiftState: TShiftState; Point: TPoint; var Effect: Integer); -begin - StringE.Text := DropFileTarget.Files[0]; -end; - -procedure TWorkWin.FormClose(Sender: TObject; var Action: TCloseAction); -begin -// Action := caNone; - DropFileTarget.Unregister; - ClearChanges; -end; - -procedure TWorkWin.FormResize(Sender: TObject); -begin - Realign; -end; - -procedure TWorkWin.IconImageDblClick(Sender: TObject); -var - Filename: string; -begin - FileName := GetFileNew(StringE.Text); - if FileName <> '' then - ExecFile(FileName); -end; - -procedure TWorkWin.ShowValues(Reg: TXRegistry); -var - MainValueName: string; - ValueCommonType: TRegDataType; - - procedure ShowValueAsBinary(const ValueName: string; - Smart4BB: Boolean = True); - begin - if Smart4BB - and PrefWin.Smart4BBCB.Checked - and (Reg.GetDataSize(ValueName) = 4) then begin - CardinalE.Value := Reg.ReadCardinal(ValueName); - CardTypeRG.ItemIndex := 2; - ShowPC.ActivePage := IntPage; - Exit; end; - BinaryHM.Data := Reg.ReadBin(ValueName); - DataTypeComB.ItemIndex := ValueCommonType; - if IsValidDataType(ValueCommonType) then - DataTypeComB.ItemIndex := ValueCommonType - else begin - DataTypeComB.Text := IntToStr(ValueCommonType); - AddHint('Value has unknown data type (' + DataTypeComB.Text + '): ' + - Quote(ValueName)); - end; - ShowPC.ActivePage := BinaryPage; - end; - -begin - with ValuesWin do begin - if not Assigned(ValueNames) or (ValueNames.Count = 0) then - raise EReadError.Create('ValueNameList error'); - MainValueName := ValueNames[0]; - end; - ValueCommonType := ValuesWin.ValueCommonType; - - with CurValueE do begin - Enabled := True; - if ValuesWin.ValueNames.Count = 1 then - Text := MainValueName - else - Text := Copy(ValuesWin.ValueNames.CommaText, 1, 255); - - Font.Color := ColorOfDataType(ValueCommonType); - end; - - if KeyIsDown(VK_MENU) or ShowAsBinary then begin - ShowValueAsBinary(MainValueName, False); - end else if ValueCommonType in rdStringTypes then begin - StringE.Text := Reg.ReadString(MainValueName); - case ValueCommonType of - rdString: StringTypeRG.ItemIndex := 0; - rdExpandString: StringTypeRG.ItemIndex := 1; - end; - ShowPC.ActivePage := StringPage; - end else if ValueCommonType in rdCardTypes then begin - CardinalE.Value := Reg.ReadCardinal(MainValueName); - case ValueCommonType of - rdCardinal: StringTypeRG.ItemIndex := 0; - rdCardBigEndian: StringTypeRG.ItemIndex := 1; - end; - ShowPC.ActivePage := IntPage; - end else if ValueCommonType = rdMultiString then begin - MultiStringM.Clear; - Reg.ReadMultiString(MainValueName, MultiStringM.Lines, PrefWin.UseExtendedModelCB.Checked); - SeparatorEChange(Self); - MultiStringTypeRG.ItemIndex := 0; - ShowPC.ActivePage := MultiStringPage; - end else begin - ShowValueAsBinary(MainValueName); - end; - - ShowAsBinary := False; - - UpdateWriteButtons; -end; - -procedure TWorkWin.UpdateWriteButtons; -const - BtnTextOfMultiEdit: array[Boolean] of string = ('Write', 'Write all'); -var - BtnText: string; -begin - BtnText := BtnTextOfMultiEdit[ValuesWin.ValueNames.Count > 1]; - OKStringB.Caption := BtnText; - OKIntB.Caption := BtnText; - OKMultiStringB.Caption := BtnText; - OKBinaryB.Caption := BtnText; -end; - -procedure TWorkWin.EditData; -begin - AddHint('Edit'); - MainPC.ActivePage := WorkPage; - - with ShowPC do - if ActivePage = nil then - Exit - else if ActivePage = WorkWin.StringPage then begin - FocusControl(StringE); - StringE.SelectAll; - end - else if ActivePage = WorkWin.IntPage then - FocusControl(CardinalE) - else if ActivePage = WorkWin.MultiStringPage then - FocusControl(MultiStringM) - else if ActivePage = WorkWin.BinaryPage then - FocusControl(BinaryHM) - else - ShowMessage('Error: ShowPC.ActivePage!'); -end; - -procedure TWorkWin.SisyTVCustomDrawItem(Sender: TCustomTreeView; - Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean); -begin - with TTreeView(Sender).Canvas.Font do begin - if Node.Cut then - Color := $AAAAAA - else - Color := clWhite; - end; -end; - -procedure TWorkWin.SisyTVMouseDown(Sender: TObject; Button: TMouseButton; - Shift: TShiftState; X, Y: Integer); -var - Node: TTreeNode; - RelX, RelY: Integer; -begin - with SisyTV do begin - RelX := ScreenToClient(Mouse.CursorPos).X; - RelY := ScreenToClient(Mouse.CursorPos).Y; - Node := GetNodeAt(RelX, RelY); - end; - if not Assigned(Node) then - Exit; - - if not Node.Selected then - Node.Selected := True; -end; - -procedure TWorkWin.OKCryptoBClick(Sender: TObject); -var - i: Integer; -begin - try - OpenCurKey; - with ValuesWin.ValueNames do - for i := 0 to Count-1 do begin - case CryptoTypeRG.ItemIndex of - 0: MainReg.WriteBin(Strings[i], EncodeScreenSaver(CryptoE.Text)); - 1: MainReg.WriteBin(Strings[i], EncodeSharedFolder(CryptoE.Text)); - end; - end; - ValuesWin.UpdateValues(True); - finally - MainReg.CloseKey; - end; - ValuesWin.ValueListDblClick(Sender); -end; - -procedure TWorkWin.CryptoEKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - if Key = VK_RETURN then begin - OKCryptoBClick(Sender); - ValuesWin.FocusControl(ValueList); - end; - if Key = VK_ESCAPE then - CancelBClick(Sender); -end; - -end. diff --git a/test/scanners/delphi/suite.rb b/test/scanners/delphi/suite.rb deleted file mode 100644 index ace3fd2..0000000 --- a/test/scanners/delphi/suite.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Delphi < CodeRay::TestCase - extension :pas -end diff --git a/test/scanners/delphi/ytools.expected.raydebug b/test/scanners/delphi/ytools.expected.raydebug deleted file mode 100644 index 8653ea7..0000000 --- a/test/scanners/delphi/ytools.expected.raydebug +++ /dev/null @@ -1,2708 +0,0 @@ -comment(// vim:ft=pascal) - -reserved(unit) ident(YTools)operator(;) - -comment({=============================================================================== - - cYcnus.YTools 1.0.3 Beta for Delphi 4+ - by licenser and Murphy - - ©2000-2003 by cYcnus - visit www.cYcnus.de - - licenser@cYcnus.de (Heinz N. Gies\) - murphy@cYcnus.de (Kornelius Kalnbach\) - - this unit is published under the terms of the GPL - -===============================================================================}) - -reserved(interface) - -reserved(uses) - ident(Windows)operator(,) ident(SysUtils)operator(,) ident(Classes)operator(,) ident(YTypes)operator(;) - -reserved(const) - ident(BackSpace) operator(=) char(#8)operator(;) - ident(Tab) operator(=) char(#9)operator(;) - ident(LF) operator(=) char(#10)operator(;) comment(//Line Feed) - ident(CR) operator(=) char(#13)operator(;) comment(//Carriage Return) - ident(Space) operator(=) char(#32)operator(;) - ident(EOLChars) operator(=) operator([)ident(CR)operator(,) ident(LF)operator(])operator(;) -preprocessor({$IFNDEF VER140}) - ident(sLineBreak) operator(=) char(#13)char(#10)operator(;) - ident(SwitchChars) operator(=) operator([)charoperator(,) charoperator(])operator(;) -preprocessor({$ENDIF}) - ident(EOL) operator(=) ident(sLineBreak)operator(;) - ident(MaxCard) operator(=) ident(High)operator(()ident(Cardinal)operator(\))operator(;) - ident(AllChars) operator(=) operator([)char(#0)operator(..)char(#255)operator(])operator(;) - ident(Alphabetical) operator(=) operator([)charoperator(..)charoperator(,) charoperator(..)charoperator(])operator(;) - ident(DecimalChars) operator(=) operator([)charoperator(..)charoperator(])operator(;) - ident(AlphaNumerical) operator(=) ident(Alphabetical) operator(+) ident(DecimalChars)operator(;) - ident(StrangeChars) operator(=) operator([)char(#0)operator(..)char(#31)operator(,) char(#127)operator(,) char(#129)operator(,) char(#141)operator(..)char(#144)operator(,) char(#157)operator(,) char(#158)operator(])operator(;) - - ident(HexadecimalChars) operator(=) ident(DecimalChars) operator(+) operator([)charoperator(..)charoperator(,) charoperator(..)charoperator(])operator(;) - ident(OctalChars) operator(=) operator([)charoperator(..)charoperator(])operator(;) - ident(BinaryChars) operator(=) operator([)charoperator(,) charoperator(])operator(;) - - ident(QuoteChars) operator(=) operator([)charoperator(,) charoperator(])operator(;) - ident(WildCards) operator(=) operator([)charoperator(,) charoperator(])operator(;) - ident(FileNameEnemies) operator(=) ident(WildCards) operator(+) operator([)charoperator(,) charoperator(,) charoperator(,) charoperator(,) char)delimiter(')>operator(,) charoperator(])operator(;) - - ident(HexChar)operator(:) reserved(array)operator([)ident(THex)operator(]) reserved(of) ident(Char) operator(=) operator(() - charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(\))operator(;) - ident(LowerHexChar)operator(:) reserved(array)operator([)ident(THex)operator(]) reserved(of) ident(Char) operator(=) operator(() - charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(\))operator(;) - ident(BaseNChar)operator(:) reserved(array)operator([)ident(TBaseN)operator(]) reserved(of) ident(Char) operator(=) operator(() - charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,) - charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(\))operator(;) - - ident(cYcnusOverlayColor) operator(=) hex($050001)operator(;) - - ident(faFindEveryFile) operator(=) ident(faReadOnly) operator(+) ident(faHidden) operator(+) ident(faSysFile) operator(+) ident(faArchive)operator(;) - - ident(platWin9x) operator(=) operator([)ident(VER_PLATFORM_WIN32s)operator(,) ident(VER_PLATFORM_WIN32_WINDOWS)operator(])operator(;) - - -comment({ Debugging }) -reserved(procedure) ident(ClearReport)operator(()reserved(const) ident(ReportName)operator(:) reserved(string)operator(\))operator(;) -reserved(procedure) ident(Report)operator(()reserved(const) ident(ReportName)operator(,) ident(Text)operator(:) reserved(string)operator(\))operator(;) -reserved(procedure) ident(ReportFmt)operator(()reserved(const) ident(ReportName)operator(,) ident(Fmt)operator(:) reserved(string)operator(;) reserved(const) ident(Args)operator(:) reserved(array) reserved(of) reserved(const)operator(\))operator(;) - -comment({ Params }) -reserved(procedure) ident(GetParams)operator(()ident(Strings)operator(:) ident(TStrings)operator(\))operator(;) directive(overload)operator(;) -reserved(function) ident(GetParams)operator(()reserved(const) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) - -reserved(function) ident(ParamNum)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(function) ident(ParamPrefixNum)operator(()reserved(const) ident(Prefix)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(function) ident(Param)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(ParamPrefix)operator(()reserved(const) ident(Prefix)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) - -reserved(function) ident(Switch)operator(()reserved(const) ident(Switch)operator(:) reserved(string)operator(;) reserved(const) ident(PrefixChars)operator(:) ident(TCharSet) operator(=) ident(SwitchChars)operator(;) - ident(IgnoreCase)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(GetParam)operator(()reserved(const) ident(Prefix)operator(:) reserved(string) operator(=) stringoperator(;) reserved(const) ident(Default)operator(:) reserved(string) operator(=) stringoperator(\))operator(:) reserved(string)operator(;) - -comment({ Dirs & UserName}) -reserved(function) ident(GetMyDir)operator(()ident(FullPath)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(WinDir)operator(:) reserved(string)operator(;) -reserved(function) ident(SysDir)operator(:) reserved(string)operator(;) -reserved(function) ident(UserName)operator(:) reserved(string)operator(;) - -comment({ Strings & Chars}) -reserved(function) ident(FirstChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Char)operator(;) -reserved(function) ident(LastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Char)operator(;) - -reserved(function) ident(CharPos)operator(()ident(C)operator(:) ident(Char)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\))operator(:) ident(Integer)operator(;) directive(overload)operator(;) -reserved(function) ident(CharPos)operator(()ident(C)operator(:) ident(TCharSet)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\))operator(:) ident(Integer)operator(;) directive(overload)operator(;) -reserved(function) ident(CharPosR)operator(()ident(C)operator(:) ident(Char)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) operator(-)integer(1)operator(\))operator(:) ident(Integer)operator(;) -reserved(function) ident(PosEx)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\))operator(:) ident(Integer)operator(;) -reserved(function) ident(PosExText)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\))operator(:) ident(Integer)operator(;) -reserved(function) ident(PosExAnsiText)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\))operator(:) ident(Integer)operator(;) - -reserved(function) ident(UntilChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) -reserved(function) ident(UntilChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(TCharSet)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) -reserved(function) ident(UntilLastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(;) - ident(IgnoreNoBrake)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(FromChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) -reserved(function) ident(FromChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(TCharSet)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) -reserved(function) ident(FromLastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(;) - ident(IgnoreNoBrake)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(BetweenChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Start)operator(,) ident(Finish)operator(:) ident(Char)operator(;) - ident(Inclusive)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(UntilStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(FromStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(StringWrap)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Width)operator(:) ident(Integer)operator(;) reserved(const) ident(LineEnd)operator(:) reserved(string) operator(=) ident(EOL)operator(\))operator(:) reserved(string)operator(;) - -comment({ Splitting & Combining }) -reserved(function) ident(Split)operator(()reserved(const) ident(S)operator(,) ident(Separator)operator(:) reserved(string)operator(;) ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(;) - ident(MinCount)operator(:) ident(Integer) operator(=) integer(0)operator(\))operator(:) ident(TStrA)operator(;) directive(overload)operator(;) -reserved(procedure) ident(Split)operator(()reserved(const) ident(S)operator(,) ident(Separator)operator(:) reserved(string)operator(;) ident(Strings)operator(:) ident(TStrings)operator(;) - ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(;) directive(overload)operator(;) -reserved(function) ident(Split)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Separators)operator(:) ident(TCharSet)operator(;) - ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(MinCount)operator(:) ident(Integer) operator(=) integer(0)operator(\))operator(:) ident(TStrA)operator(;) directive(overload)operator(;) - -reserved(procedure) ident(TileStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(BrakeStart)operator(:) ident(Integer)operator(;) ident(BrakeEnd)operator(:) ident(Integer)operator(;) - reserved(out) ident(Left)operator(,) ident(Right)operator(:) reserved(string)operator(\))operator(;) - -reserved(function) ident(Join)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) -reserved(function) ident(Join)operator(()ident(StrA)operator(:) ident(TStrA)operator(;) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) - -reserved(function) ident(MulStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Count)operator(:) ident(Integer)operator(\))operator(:) reserved(string)operator(;) - -comment({ Strings ausrichten }) -reserved(function) ident(AlignR)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Width)operator(:) ident(Integer)operator(;) ident(Filler)operator(:) ident(Char) operator(=) charoperator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(MaxStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(MaxLen)operator(:) ident(Integer)operator(\))operator(:) reserved(string)operator(;) - -comment({ Stringing }) -reserved(function) ident(TrimAll)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(ControlChar)operator(()ident(C)operator(:) ident(Char)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(FriendlyChar)operator(()ident(C)operator(:) ident(Char)operator(\))operator(:) ident(Char)operator(;) - -reserved(function) ident(FriendlyStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) -reserved(function) ident(FriendlyStr)operator(()ident(a)operator(:) ident(TByteA)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) - -reserved(function) ident(Quote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Quoter)operator(:) ident(Char) operator(=) charoperator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(UnQuote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(DeQuote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(StrNumerus)operator(()reserved(const) ident(Value)operator(:) ident(Integer)operator(;) reserved(const) ident(Singular)operator(,) ident(Plural)operator(:) reserved(string)operator(;) - reserved(const) ident(Zero)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(MakeStr)operator(()reserved(const) ident(Items)operator(:) reserved(array) reserved(of) reserved(const)operator(;) ident(Separator)operator(:) reserved(string) operator(=) stringoperator(\))operator(:) reserved(string)operator(;) -reserved(procedure) ident(ShowText)operator(()reserved(const) ident(Items)operator(:) reserved(array) reserved(of) reserved(const)operator(;) ident(Separator)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) - -comment({ Delete }) -reserved(function) ident(DeleteChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) -reserved(function) ident(DeleteChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) -reserved(function) ident(ExtractChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\))operator(:) reserved(string)operator(;) - -comment({ Find }) -reserved(function) ident(CharCount)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\))operator(:) ident(Integer)operator(;) - -reserved(function) ident(CharIn)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\))operator(:) ident(Boolean)operator(;) directive(overload)operator(;) -reserved(function) ident(CharIn)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\))operator(:) ident(Boolean)operator(;) directive(overload)operator(;) - -reserved(function) ident(StrAtPos)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Pos)operator(:) ident(Integer)operator(;) reserved(const) ident(Str)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(StrAtBegin)operator(()reserved(const) ident(S)operator(,) ident(Str)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(StrIn)operator(()reserved(const) ident(S)operator(,) ident(SubStr)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) directive(overload)operator(;) -reserved(function) ident(StrIn)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) directive(overload)operator(;) -reserved(function) ident(StrIn)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) directive(overload)operator(;) -reserved(function) ident(StrIndex)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) directive(overload)operator(;) -reserved(function) ident(StrIndex)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) directive(overload)operator(;) - -reserved(function) ident(TextAtPos)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Pos)operator(:) ident(Integer)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(TextAtBegin)operator(()reserved(const) ident(S)operator(,) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(TextIn)operator(()reserved(const) ident(S)operator(,) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) directive(overload)operator(;) -reserved(function) ident(TextIn)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) directive(overload)operator(;) -reserved(function) ident(TextIn)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) directive(overload)operator(;) -reserved(function) ident(TextIndex)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) directive(overload)operator(;) -reserved(function) ident(TextIndex)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) directive(overload)operator(;) - -comment({ Replace }) -reserved(function) ident(ReplaceChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Old)operator(,) ident(New)operator(:) ident(Char)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) -reserved(function) ident(ReplaceChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Old)operator(:) ident(TCharSet)operator(;) ident(New)operator(:) ident(Char)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) - -reserved(function) ident(Replace)operator(()reserved(const) ident(S)operator(,) ident(Old)operator(,) ident(New)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) - -comment({ TStrings }) -reserved(function) ident(SLOfFile)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) ident(TStringList)operator(;) -reserved(function) ident(ContainsEmptyLines)operator(()ident(SL)operator(:) ident(TStrings)operator(\))operator(:) ident(Boolean)operator(;) -reserved(procedure) ident(DeleteEmptyLines)operator(()ident(SL)operator(:) ident(TStrings)operator(\))operator(;) -reserved(procedure) ident(DeleteCommentLines)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(CommentSign)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) -reserved(procedure) ident(WriteSL)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) reserved(const) ident(Prefix)operator(:) reserved(string) operator(=) stringoperator(;) - reserved(const) ident(Suffix)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) - -reserved(function) ident(FindLine)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) - -reserved(procedure) ident(QuickSortSL)operator(()ident(SL)operator(:) ident(TStringList)operator(\))operator(;) - -comment({ TStrA }) -reserved(function) ident(IncStrA)operator(()ident(StrA)operator(:) ident(TStrA)operator(\))operator(:) ident(Integer)operator(;) - -comment({ TByteA }) -reserved(function) ident(StrOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(ByteAOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(TByteA)operator(;) -reserved(function) ident(ByteAOfInt)operator(()ident(i)operator(:) ident(Integer)operator(\))operator(:) ident(TByteA)operator(;) -reserved(function) ident(IntOfByteA)operator(()ident(A)operator(:) ident(TByteA)operator(\))operator(:) ident(Integer)operator(;) -reserved(function) ident(ByteAOfHex)operator(()reserved(const) ident(Hex)operator(:) reserved(string)operator(\))operator(:) ident(TByteA)operator(;) - -reserved(function) ident(SameByteA)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(TByteA)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(Reverse)operator(()ident(a)operator(:) ident(TByteA)operator(\))operator(:) ident(TByteA)operator(;) -reserved(function) ident(SaveByteA)operator(()ident(Data)operator(:) ident(TByteA)operator(;) reserved(const) ident(FileName)operator(:) reserved(string)operator(;) ident(Overwrite)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(LoadByteA)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) ident(TByteA)operator(;) - -reserved(function) ident(Endian)operator(()ident(i)operator(:) ident(Integer)operator(\))operator(:) ident(Integer)operator(;) - -comment({ Files }) -reserved(function) ident(SizeOfFile)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(function) ident(FileEx)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(;) ident(AllowFolders)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(LWPSolve)operator(()reserved(const) ident(Dir)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(LWPSlash)operator(()reserved(const) ident(Dir)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(ExtractDrive)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(ExtractPath)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(ExtractPrefix)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(ExtractSuffix)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(IsValidFileName)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(MakeValidFileName)operator(()ident(FileName)operator(:) reserved(string)operator(;) reserved(const) ident(Default)operator(:) reserved(string) operator(=) stringoperator(\))operator(:) reserved(string)operator(;) - -comment({ Converting }) -reserved(function) ident(IsValidInteger)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(IsValidCardinal)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) - -reserved(function) ident(StrOfBool)operator(()ident(flag)operator(:) ident(Boolean)operator(;) reserved(const) ident(TrueStr)operator(:) reserved(string) operator(=) stringoperator(;) - reserved(const) ident(FalseStr)operator(:) reserved(string) operator(=) stringoperator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(StrOfInt)operator(()ident(i)operator(:) ident(Integer)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(CardOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Cardinal)operator(;) - -reserved(function) ident(HexOrd)operator(()ident(Hex)operator(:) ident(Char)operator(\))operator(:) ident(THex)operator(;) -reserved(function) ident(ByteOfHex)operator(()ident(Hex)operator(:) ident(THexByteStr)operator(\))operator(:) ident(Byte)operator(;) - -reserved(function) ident(DecOfHex)operator(()reserved(const) ident(Hex)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(HexOfByte)operator(()ident(b)operator(:) ident(Byte)operator(\))operator(:) ident(THexByteStr)operator(;) -reserved(function) ident(HexOfCard)operator(()ident(i)operator(:) ident(Cardinal)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) -reserved(function) ident(HexOfCard)operator(()ident(i)operator(:) ident(Cardinal)operator(;) ident(Digits)operator(:) ident(Integer)operator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) - -reserved(function) ident(PascalHexArray)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Name)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(HexOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Blocks)operator(:) ident(Integer) operator(=) integer(1)operator(;) - reserved(const) ident(Splitter)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(BinOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Blocks)operator(:) ident(Integer) operator(=) integer(4)operator(;) - reserved(const) ident(Splitter)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(CardOfHex)operator(()ident(Hex)operator(:) reserved(string)operator(\))operator(:) ident(Cardinal)operator(;) -reserved(function) ident(IntOfBin)operator(()ident(Bin)operator(:) reserved(string)operator(\))operator(:) ident(Cardinal)operator(;) - -reserved(function) ident(BinOfIntFill)operator(()ident(n)operator(:) ident(cardinal)operator(;) ident(MinCount)operator(:) ident(Integer) operator(=) integer(8)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(BinOfInt)operator(()ident(n)operator(:) ident(cardinal)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(BaseNOfInt)operator(()ident(I)operator(:) ident(Cardinal)operator(;) ident(B)operator(:) ident(TBaseN)operator(\))operator(:) reserved(string)operator(;) -reserved(function) ident(IntOfBaseN)operator(()ident(V)operator(:) reserved(string)operator(;) ident(B)operator(:) ident(TBaseN)operator(\))operator(:) ident(Cardinal)operator(;) - -comment({ Ranges }) -reserved(function) ident(KeepIn)operator(()ident(i)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\))operator(:) ident(Variant)operator(;) -reserved(function) ident(InRange)operator(()ident(Value)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(InStrictRange)operator(()ident(Value)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(Min)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(Integer)operator(\))operator(:) ident(Integer)operator(;) directive(overload)operator(;) -reserved(function) ident(Min)operator(()reserved(const) ident(A)operator(:) ident(TIntA)operator(\))operator(:) ident(Integer)operator(;) directive(overload)operator(;) -reserved(function) ident(Max)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(Integer)operator(\))operator(:) ident(Integer)operator(;) directive(overload)operator(;) -reserved(function) ident(Max)operator(()reserved(const) ident(A)operator(:) ident(TIntA)operator(\))operator(:) ident(Integer)operator(;) directive(overload)operator(;) - -reserved(const) - ident(RangesSeparator) operator(=) charoperator(;) - ident(RangeInnerSeparator) operator(=) charoperator(;) - ident(RangeInfinite) operator(=) charoperator(;) - ident(RangeSpecialChars) operator(=) operator([)ident(RangesSeparator)operator(,) ident(RangeInnerSeparator)operator(,) ident(RangeInfinite)operator(])operator(;) - -reserved(function) ident(RangesOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(TRanges)operator(;) -reserved(function) ident(InRanges)operator(()ident(Ranges)operator(:) ident(TRanges)operator(;) ident(TestValue)operator(:) ident(Cardinal)operator(\))operator(:) ident(Boolean)operator(;) - -reserved(function) ident(Success)operator(()ident(Res)operator(:) ident(Integer)operator(;) ident(ResultOnSuccess)operator(:) ident(Integer) operator(=) ident(ERROR_SUCCESS)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(Failure)operator(()ident(Res)operator(:) ident(Integer)operator(;) ident(ResultOnSuccess)operator(:) ident(Integer) operator(=) ident(ERROR_SUCCESS)operator(\))operator(:) ident(Boolean)operator(;) - -reserved(function) ident(ExpandString)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) - -comment({ Files }) -reserved(procedure) ident(DeleteFiles)operator(()reserved(const) ident(Mask)operator(:) reserved(string)operator(;) ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) - ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(\))operator(;) -reserved(procedure) ident(FileNew)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(;) -reserved(function) ident(DateTimeOfFileTime)operator(()reserved(const) ident(FileTime)operator(:) ident(TFileTime)operator(\))operator(:) ident(TDateTime)operator(;) - -comment({ FileNames }) -reserved(function) ident(GetFileNew)operator(()ident(FileName)operator(:) reserved(string)operator(;) ident(NoFloppyDrives)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(:) reserved(string)operator(;) - -comment({ Finding Files }) -reserved(function) ident(FindAll)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) reserved(const) ident(Mask)operator(:) reserved(string)operator(;) - ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(;) - ident(FileReturn)operator(:) ident(TFileNameFunc) operator(=) reserved(nil)operator(\))operator(:) ident(Boolean)operator(;) -reserved(function) ident(FindAllFirst)operator(()reserved(const) ident(Mask)operator(:) reserved(string)operator(;) ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) - ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(\))operator(:) reserved(string)operator(;) - -reserved(function) ident(FullOSInfo)operator(:) reserved(string)operator(;) -reserved(function) ident(Win32PlatformStr)operator(:) reserved(string)operator(;) -reserved(function) ident(Win9x)operator(:) ident(Boolean)operator(;) -reserved(function) ident(WinNT)operator(:) ident(Boolean)operator(;) -reserved(function) ident(Win2000)operator(:) ident(Boolean)operator(;) -reserved(function) ident(WinXP)operator(:) ident(Boolean)operator(;) - -reserved(var) - ident(MyDir)operator(:) reserved(string) operator(=) stringoperator(;) - ident(LastSuccessRes)operator(:) ident(Integer) operator(=) integer(0)operator(;) - -comment({ Backward compatibility }) -preprocessor({$IFNDEF VER130}) -reserved(function) ident(SameText)operator(()reserved(const) ident(S1)operator(,) ident(S2)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -preprocessor({$ENDIF}) - -reserved(implementation) -preprocessor({$IFNDEF VER140}) -reserved(uses) ident(FileCtrl)operator(;) -preprocessor({$ENDIF}) - -preprocessor({$IFNDEF VER130}) -reserved(function) ident(SameText)operator(()reserved(const) ident(S1)operator(,) ident(S2)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(CompareText)operator(()ident(S1)operator(,) ident(S2)operator(\)) operator(=) integer(0)operator(;) -reserved(end)operator(;) -preprocessor({$ENDIF}) - -reserved(procedure) ident(Report)operator(()reserved(const) ident(ReportName)operator(,) ident(Text)operator(:) reserved(string)operator(\))operator(;) -reserved(var) - ident(F)operator(:) ident(TextFile)operator(;) - ident(FileName)operator(:) reserved(string)operator(;) -reserved(begin) - ident(FileName) operator(:=) ident(MyDir) operator(+) ident(ReportName) operator(+) stringoperator(;) - ident(Assign)operator(()ident(F)operator(,) ident(FileName)operator(\))operator(;) - reserved(try) - reserved(if) reserved(not) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(then) - ident(Rewrite)operator(()ident(F)operator(\)) - reserved(else) - ident(Append)operator(()ident(F)operator(\))operator(;) - ident(WriteLn)operator(()ident(F)operator(,) ident(Text)operator(\))operator(;) - reserved(finally) - ident(Close)operator(()ident(F)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(ClearReport)operator(()reserved(const) ident(ReportName)operator(:) reserved(string)operator(\))operator(;) -reserved(var) - ident(FileName)operator(:) reserved(string)operator(;) -reserved(begin) - ident(FileName) operator(:=) ident(MyDir) operator(+) ident(ReportName) operator(+) stringoperator(;) - ident(DeleteFile)operator(()ident(FileName)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(ReportFmt)operator(()reserved(const) ident(ReportName)operator(,) ident(Fmt)operator(:) reserved(string)operator(;) reserved(const) ident(Args)operator(:) reserved(array) reserved(of) reserved(const)operator(\))operator(;) -reserved(begin) - ident(Report)operator(()ident(ReportName)operator(,) ident(Format)operator(()ident(Fmt)operator(,) ident(Args)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(GetParams)operator(()ident(Strings)operator(:) ident(TStrings)operator(\))operator(;) -reserved(var) - ident(P)operator(:) ident(PChar)operator(;) - ident(Param)operator(:) reserved(string)operator(;) - - reserved(function) ident(GetParamStr)operator(()reserved(var) ident(P)operator(:) ident(PChar)operator(;) reserved(var) ident(Param)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) - reserved(var) - ident(Quoted)operator(:) ident(Boolean)operator(;) - reserved(begin) - ident(Param) operator(:=) stringoperator(;) - - reserved(repeat) - reserved(while) operator(()ident(P)operator([)integer(0)operator(]) operator(<>) char(#0)operator(\)) reserved(and) operator(()ident(P)operator([)integer(0)operator(]) operator(<=) charoperator(\)) reserved(do) - ident(Inc)operator(()ident(P)operator(\))operator(;) - - ident(Quoted) operator(:=) ident(False)operator(;) - reserved(while) ident(P)operator([)integer(0)operator(]) operator(<>) char(#0) reserved(do) reserved(begin) - reserved(if) ident(P)operator([)integer(0)operator(]) operator(=) char reserved(then) reserved(begin) - ident(Quoted) operator(:=) reserved(not) ident(Quoted)operator(;) - ident(Inc)operator(()ident(P)operator(\))operator(;) - ident(Continue)operator(;) reserved(end)operator(;) - reserved(if) operator(()ident(P)operator([)integer(0)operator(]) operator(<=) charoperator(\)) reserved(and) reserved(not) ident(Quoted) reserved(then) - ident(Break)operator(;) - ident(Param) operator(:=) ident(Param) operator(+) ident(P)operator([)integer(0)operator(])operator(;) - ident(Inc)operator(()ident(P)operator(\))operator(;) - reserved(end)operator(;) - reserved(until) operator(()ident(Param) operator(<>) stringoperator(\)) reserved(or) operator(()ident(P)operator([)integer(0)operator(]) operator(=) char(#0)operator(\))operator(;) - - ident(Result) operator(:=) ident(Param) operator(<>) stringoperator(;) - reserved(end)operator(;) - -reserved(begin) - ident(Strings)operator(.)ident(Clear)operator(;) - ident(P) operator(:=) ident(GetCommandLine)operator(;) - ident(GetParamStr)operator(()ident(P)operator(,) ident(Param)operator(\))operator(;) - reserved(while) ident(GetParamStr)operator(()ident(P)operator(,) ident(Param)operator(\)) reserved(do) - ident(Strings)operator(.)ident(Add)operator(()ident(Param)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(GetParams)operator(()reserved(const) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) -reserved(begin) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - ident(GetParams)operator(()ident(SL)operator(\))operator(;) - ident(Result) operator(:=) ident(Join)operator(()ident(SL)operator(,) ident(Separator)operator(\))operator(;) - ident(SL)operator(.)ident(Free)operator(;) -reserved(end)operator(;) - -reserved(function) ident(Switch)operator(()reserved(const) ident(Switch)operator(:) reserved(string)operator(;) reserved(const) ident(PrefixChars)operator(:) ident(TCharSet) operator(=) ident(SwitchChars)operator(;) - ident(IgnoreCase)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(:) ident(Boolean)operator(;) -comment(//= SysUtils.FindCmdLineSwitch) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(s)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(True)operator(;) - - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(ParamCount) reserved(do) reserved(begin) - ident(s) operator(:=) ident(ParamStr)operator(()ident(i)operator(\))operator(;) - - reserved(if) operator(()ident(s) operator(<>) stringoperator(\)) reserved(and) operator(()ident(s)operator([)integer(1)operator(]) reserved(in) ident(PrefixChars)operator(\)) reserved(then) reserved(begin) - comment(//i know that always s <> '', but this is saver) - ident(s) operator(:=) ident(Copy)operator(()ident(s)operator(,) integer(2)operator(,) ident(MaxInt)operator(\))operator(;) - reserved(if) operator(()ident(s) operator(=) ident(Switch)operator(\)) reserved(or) operator(()ident(IgnoreCase) reserved(and) operator(()integer(0)operator(=)ident(AnsiCompareText)operator(()ident(s)operator(,) ident(Switch)operator(\))operator(\))operator(\)) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) ident(False)operator(;) -reserved(end)operator(;) - -reserved(function) ident(ParamNum)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(Result) operator(:=) integer(1) reserved(to) ident(ParamCount) reserved(do) - reserved(if) integer(0)operator(=)ident(AnsiCompareText)operator(()ident(ParamStr)operator(()ident(Result)operator(\))operator(,) ident(S)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Result) operator(:=) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(ParamPrefixNum)operator(()reserved(const) ident(Prefix)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(var) - ident(Len)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Len) operator(:=) ident(Length)operator(()ident(Prefix)operator(\))operator(;) - reserved(for) ident(Result) operator(:=) integer(1) reserved(to) ident(ParamCount) reserved(do) - reserved(if) integer(0)operator(=)ident(AnsiCompareText)operator(()ident(Copy)operator(()ident(ParamStr)operator(()ident(Result)operator(\))operator(,) integer(1)operator(,) ident(Len)operator(\))operator(,) ident(Prefix)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Result) operator(:=) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(Param)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(ParamNum)operator(()ident(S)operator(\)) operator(>) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(ParamPrefix)operator(()reserved(const) ident(Prefix)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(ParamPrefixNum)operator(()ident(Prefix)operator(\)) operator(>) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(GetParam)operator(()reserved(const) ident(Prefix)operator(:) reserved(string) operator(=) stringoperator(;) reserved(const) ident(Default)operator(:) reserved(string) operator(=) stringoperator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Default)operator(;) - - reserved(if) ident(Prefix) operator(=) string reserved(then) reserved(begin) - ident(Result) operator(:=) ident(ParamStr)operator(()integer(1)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(i) operator(:=) ident(ParamPrefixNum)operator(()ident(Prefix)operator(\))operator(;) - reserved(if) ident(i) operator(>) integer(0) reserved(then) - ident(Result) operator(:=) ident(Copy)operator(()ident(ParamStr)operator(()ident(i)operator(\))operator(,) ident(Length)operator(()ident(Prefix)operator(\)) operator(+) integer(1)operator(,) ident(MaxInt)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(GetMyDir)operator(()ident(FullPath)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(Buffer)operator(:) reserved(array)operator([)integer(0)operator(..)integer(260)operator(]) reserved(of) ident(Char)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(SetString)operator(()ident(Result)operator(,) ident(Buffer)operator(,) ident(GetModuleFileName)operator(()integer(0)operator(,) ident(Buffer)operator(,) ident(SizeOf)operator(()ident(Buffer)operator(\))operator(\))operator(\))operator(;) - reserved(if) ident(FullPath) reserved(then) - ident(Result) operator(:=) ident(GetFileNew)operator(()ident(Result)operator(\))operator(;) - ident(Result) operator(:=) ident(ExtractPath)operator(()ident(Result)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(WinDir)operator(:) reserved(string)operator(;) -reserved(var) - ident(Res)operator(:) ident(PChar)operator(;) -reserved(begin) - ident(Result) operator(:=) charoperator(;) - ident(GetMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\))operator(;) - ident(GetWindowsDirectory)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\))operator(;) - ident(Result) operator(:=) ident(Res) operator(+) charoperator(;) - ident(FreeMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(SysDir)operator(:) reserved(string)operator(;) -reserved(var) - ident(Res)operator(:) ident(PChar)operator(;) -reserved(begin) - ident(Result) operator(:=) charoperator(;) - ident(GetMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\))operator(;) - ident(GetSystemDirectory)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\))operator(;) - ident(Result) operator(:=) ident(Res) operator(+) charoperator(;) - ident(FreeMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(UserName)operator(:) reserved(string)operator(;) -reserved(var) - ident(Len)operator(:) ident(Cardinal)operator(;) - ident(Res)operator(:) ident(PChar)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(GetMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\))operator(;) - ident(Len) operator(:=) ident(MAX_PATH)operator(;) - ident(GetUserName)operator(()ident(Res)operator(,) ident(Len)operator(\))operator(;) - ident(Result) operator(:=) ident(Res)operator(;) - ident(FreeMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(FirstChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Char)operator(;) -reserved(begin) - reserved(if) ident(s) operator(=) string reserved(then) - ident(Result) operator(:=) char(#0) - reserved(else) - ident(Result) operator(:=) ident(s)operator([)integer(1)operator(])operator(;) -reserved(end)operator(;) - -reserved(function) ident(LastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Char)operator(;) -reserved(begin) - reserved(if) ident(s) operator(=) string reserved(then) - ident(Result) operator(:=) char(#0) - reserved(else) - ident(Result) operator(:=) ident(s)operator([)ident(Length)operator(()ident(s)operator(\))operator(])operator(;) -reserved(end)operator(;) - -reserved(function) ident(CharPos)operator(()ident(C)operator(:) ident(Char)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\))operator(:) ident(Integer)operator(;) -reserved(var) - ident(MaxPosToSearch)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Offset)operator(;) - ident(MaxPosToSearch) operator(:=) ident(Length)operator(()ident(S)operator(\))operator(;) - - reserved(while) ident(Result) operator(<=) ident(MaxPosToSearch) reserved(do) reserved(begin) - reserved(if) ident(S)operator([)ident(Result)operator(]) operator(=) ident(C) reserved(then) - ident(Exit)operator(;) - ident(Inc)operator(()ident(Result)operator(\))operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(CharPos)operator(()ident(C)operator(:) ident(TCharSet)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\))operator(:) ident(Integer)operator(;) -reserved(var) - ident(MaxPosToSearch)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Offset)operator(;) - ident(MaxPosToSearch) operator(:=) ident(Length)operator(()ident(S)operator(\))operator(;) - - reserved(while) ident(Result) operator(<=) ident(MaxPosToSearch) reserved(do) reserved(begin) - reserved(if) ident(S)operator([)ident(Result)operator(]) reserved(in) ident(C) reserved(then) - ident(Exit)operator(;) - ident(Inc)operator(()ident(Result)operator(\))operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(CharPosR)operator(()ident(C)operator(:) ident(Char)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) operator(-)integer(1)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(Offset) operator(<) integer(0) reserved(then) - ident(Result) operator(:=) ident(Length)operator(()ident(S)operator(\)) operator(+) integer(1) operator(-) ident(Offset) - reserved(else) - ident(Result) operator(:=) ident(Offset)operator(;) - reserved(if) ident(Result) operator(>) ident(Length)operator(()ident(S)operator(\)) reserved(then) - ident(Result) operator(:=) ident(Length)operator(()ident(S)operator(\))operator(;) - - reserved(while) ident(Result) operator(>) integer(0) reserved(do) reserved(begin) - reserved(if) ident(S)operator([)ident(Result)operator(]) operator(=) ident(C) reserved(then) - ident(Exit)operator(;) - ident(Dec)operator(()ident(Result)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(PosEx)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\))operator(:) ident(Integer)operator(;) -reserved(var) - ident(MaxPosToSearch)operator(,) ident(LenSubStr)operator(,) ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(SubStr) operator(=) string reserved(then) reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(if) ident(Offset) operator(<) integer(1) reserved(then) - ident(Result) operator(:=) integer(1) - reserved(else) - ident(Result) operator(:=) ident(Offset)operator(;) - - ident(LenSubStr) operator(:=) ident(Length)operator(()ident(SubStr)operator(\))operator(;) - ident(MaxPosToSearch) operator(:=) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(LenSubStr) operator(+) integer(1)operator(;) - - reserved(while) ident(Result) operator(<=) ident(MaxPosToSearch) reserved(do) reserved(begin) - reserved(if) ident(S)operator([)ident(Result)operator(]) operator(=) ident(SubStr)operator([)integer(1)operator(]) reserved(then) reserved(begin) - ident(i) operator(:=) integer(1)operator(;) - - reserved(while) operator(()ident(i) operator(<) ident(LenSubStr)operator(\)) - reserved(and) operator(()ident(S)operator([)ident(Result) operator(+) ident(i)operator(]) operator(=) ident(SubStr)operator([)ident(i) operator(+) integer(1)operator(])operator(\)) reserved(do) - ident(Inc)operator(()ident(i)operator(\))operator(;) - - reserved(if) ident(i) operator(=) ident(LenSubStr) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) - ident(Inc)operator(()ident(Result)operator(\))operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(PosExText)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\))operator(:) ident(Integer)operator(;) -reserved(var) - ident(MaxPosToSearch)operator(,) ident(LenSubStr)operator(,) ident(i)operator(:) ident(Integer)operator(;) - - reserved(function) ident(SameChar)operator(()ident(a)operator(,) ident(b)operator(:) ident(Char)operator(\))operator(:) ident(Boolean)operator(;) - reserved(begin) - ident(Result) operator(:=) ident(UpCase)operator(()ident(a)operator(\)) operator(=) ident(UpCase)operator(()ident(b)operator(\)) - reserved(end)operator(;) - -reserved(begin) - reserved(if) ident(SubStr) operator(=) string reserved(then) reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(if) ident(Offset) operator(<) integer(1) reserved(then) - ident(Result) operator(:=) integer(1) - reserved(else) - ident(Result) operator(:=) ident(Offset)operator(;) - - ident(LenSubStr) operator(:=) ident(Length)operator(()ident(SubStr)operator(\))operator(;) - ident(MaxPosToSearch) operator(:=) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(LenSubStr) operator(+) integer(1)operator(;) - - reserved(while) ident(Result) operator(<=) ident(MaxPosToSearch) reserved(do) reserved(begin) - reserved(if) ident(SameChar)operator(()ident(S)operator([)ident(Result)operator(])operator(,) ident(SubStr)operator([)integer(1)operator(])operator(\)) reserved(then) reserved(begin) - ident(i) operator(:=) integer(1)operator(;) - - reserved(while) operator(()ident(i) operator(<) ident(LenSubStr)operator(\)) - reserved(and) operator(()ident(SameChar)operator(()ident(S)operator([)ident(Result) operator(+) ident(i)operator(])operator(,) ident(SubStr)operator([)ident(i) operator(+) integer(1)operator(])operator(\))operator(\)) reserved(do) - ident(Inc)operator(()ident(i)operator(\))operator(;) - - reserved(if) ident(i) operator(=) ident(LenSubStr) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) - ident(Inc)operator(()ident(Result)operator(\))operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(PosExAnsiText)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\))operator(:) ident(Integer)operator(;) -reserved(var) - ident(MaxPosToSearch)operator(,) ident(LenSubStr)operator(,) ident(i)operator(:) ident(Integer)operator(;) - - reserved(function) ident(SameChar)operator(()ident(a)operator(,) ident(b)operator(:) ident(Char)operator(\))operator(:) ident(Boolean)operator(;) - reserved(begin) - ident(Result) operator(:=) ident(CharLower)operator(()ident(PChar)operator(()ident(a)operator(\))operator(\)) operator(=) ident(CharLower)operator(()ident(PChar)operator(()ident(b)operator(\))operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) ident(SubStr) operator(=) string reserved(then) reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - reserved(if) ident(Offset) operator(<) integer(1) reserved(then) - ident(Result) operator(:=) integer(1) - reserved(else) - ident(Result) operator(:=) ident(Offset)operator(;) - - ident(LenSubStr) operator(:=) ident(Length)operator(()ident(SubStr)operator(\))operator(;) - ident(MaxPosToSearch) operator(:=) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(LenSubStr) operator(+) integer(1)operator(;) - - reserved(while) ident(Result) operator(<=) ident(MaxPosToSearch) reserved(do) reserved(begin) - reserved(if) ident(SameChar)operator(()ident(S)operator([)ident(Result)operator(])operator(,) ident(SubStr)operator([)integer(1)operator(])operator(\)) reserved(then) reserved(begin) - ident(i) operator(:=) integer(1)operator(;) - - reserved(while) operator(()ident(i) operator(<) ident(LenSubStr)operator(\)) - reserved(and) operator(()ident(SameChar)operator(()ident(S)operator([)ident(Result) operator(+) ident(i)operator(])operator(,) ident(SubStr)operator([)ident(i) operator(+) integer(1)operator(])operator(\))operator(\)) reserved(do) - ident(Inc)operator(()ident(i)operator(\))operator(;) - - reserved(if) ident(i) operator(=) ident(LenSubStr) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) - ident(Inc)operator(()ident(Result)operator(\))operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(UntilChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(p)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(p) operator(:=) ident(CharPos)operator(()ident(Brake)operator(,) ident(S)operator(\))operator(;) - - reserved(if) ident(p) operator(>) integer(0) reserved(then) - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(p) operator(-) integer(1)operator(\)) - reserved(else) - ident(Result) operator(:=) ident(S)operator(;) -reserved(end)operator(;) - -reserved(function) ident(UntilChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(TCharSet)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(p)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(p) operator(:=) ident(CharPos)operator(()ident(Brake)operator(,) ident(S)operator(\))operator(;) - - reserved(if) ident(p) operator(>) integer(0) reserved(then) - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(p) operator(-) integer(1)operator(\)) - reserved(else) - ident(Result) operator(:=) ident(S)operator(;) -reserved(end)operator(;) - -reserved(function) ident(UntilLastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(;) - ident(IgnoreNoBrake)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(p)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(p) operator(:=) ident(CharPosR)operator(()ident(Brake)operator(,) ident(S)operator(\))operator(;) - - reserved(if) ident(p) operator(>) integer(0) reserved(then) - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(p) operator(-) integer(1)operator(\)) - reserved(else) reserved(if) ident(IgnoreNoBrake) reserved(then) - ident(Result) operator(:=) ident(S)operator(;) -reserved(end)operator(;) - -reserved(function) ident(FromChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(p)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(p) operator(:=) ident(CharPos)operator(()ident(Brake)operator(,) ident(S)operator(\))operator(;) - - reserved(if) ident(p) operator(>) integer(0) reserved(then) - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(p) operator(+) integer(1)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(FromChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(TCharSet)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(p)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(p) operator(:=) ident(CharPos)operator(()ident(Brake)operator(,) ident(S)operator(\))operator(;) - - reserved(if) ident(p) operator(>) integer(0) reserved(then) - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(p) operator(+) integer(1)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(FromLastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(;) - ident(IgnoreNoBrake)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(p)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(p) operator(:=) ident(CharPosR)operator(()ident(Brake)operator(,) ident(S)operator(\))operator(;) - - reserved(if) ident(p) operator(>) integer(0) reserved(then) - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(p) operator(+) integer(1)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p)operator(\)) - reserved(else) reserved(if) ident(IgnoreNoBrake) reserved(then) - ident(Result) operator(:=) ident(S)operator(;) -reserved(end)operator(;) - -reserved(function) ident(BetweenChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Start)operator(,) ident(Finish)operator(:) ident(Char)operator(;) - ident(Inclusive)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(p)operator(,) ident(fin)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - - ident(p) operator(:=) ident(CharPos)operator(()ident(Start)operator(,) ident(S)operator(\))operator(;) - reserved(if) ident(p) operator(=) integer(0) reserved(then) - ident(Exit)operator(;) - - ident(fin) operator(:=) ident(CharPos)operator(()ident(Finish)operator(,) ident(S)operator(,) ident(p) operator(+) integer(1)operator(\))operator(;) - reserved(if) ident(fin) operator(=) integer(0) reserved(then) - ident(Exit)operator(;) - - reserved(if) reserved(not) ident(Inclusive) reserved(then) reserved(begin) - ident(Inc)operator(()ident(p)operator(\))operator(;) - ident(Dec)operator(()ident(fin)operator(\))operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(fin) operator(-) ident(p) operator(+) integer(1)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(UntilStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(p)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(Length)operator(()ident(Brake)operator(\)) operator(=) integer(1) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(UntilChar)operator(()ident(S)operator(,) ident(Brake)operator([)integer(1)operator(])operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(p) operator(:=) ident(PosEx)operator(()ident(Brake)operator(,) ident(S)operator(\))operator(;) - - reserved(if) ident(p) operator(>) integer(0) reserved(then) - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(p) operator(-) integer(1)operator(\)) - reserved(else) - ident(Result) operator(:=) ident(S)operator(;) -reserved(end)operator(;) - -reserved(function) ident(FromStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(p)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(Length)operator(()ident(Brake)operator(\)) operator(=) integer(1) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(FromChar)operator(()ident(S)operator(,) ident(Brake)operator([)integer(1)operator(])operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(Result) operator(:=) stringoperator(;) - ident(p) operator(:=) ident(PosEx)operator(()ident(Brake)operator(,) ident(s)operator(\))operator(;) - - reserved(if) ident(p) operator(>) integer(0) reserved(then) reserved(begin) - ident(Inc)operator(()ident(p)operator(,) ident(Length)operator(()ident(Brake)operator(\))operator(\))operator(;) - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p) operator(+) integer(1)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(StringWrap)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Width)operator(:) ident(Integer)operator(;) reserved(const) ident(LineEnd)operator(:) reserved(string) operator(=) ident(EOL)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(if) operator(()ident(S) operator(=) stringoperator(\)) reserved(or) operator(()ident(Width) operator(<) integer(1)operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(i) operator(:=) integer(1)operator(;) - reserved(while) ident(True) reserved(do) reserved(begin) - ident(Result) operator(:=) ident(Result) operator(+) ident(Copy)operator(()ident(S)operator(,) ident(i)operator(,) ident(Width)operator(\))operator(;) - ident(Inc)operator(()ident(i)operator(,) ident(Width)operator(\))operator(;) - reserved(if) ident(i) operator(<=) ident(Length)operator(()ident(S)operator(\)) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(LineEnd) - reserved(else) - ident(Exit)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(Split)operator(()reserved(const) ident(S)operator(,) ident(Separator)operator(:) reserved(string)operator(;) ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(;) - ident(MinCount)operator(:) ident(Integer) operator(=) integer(0)operator(\))operator(:) ident(TStrA)operator(;) -reserved(var) - ident(p)operator(,) ident(fin)operator(,) ident(SepLen)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(;) - reserved(begin) - reserved(if) ident(IgnoreMultiSep) reserved(and) operator(()ident(S) operator(=) stringoperator(\)) reserved(then) - ident(Exit)operator(;) - ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(Result)operator(\)) operator(+) integer(1)operator(\))operator(;) - ident(Result)operator([)ident(High)operator(()ident(Result)operator(\))operator(]) operator(:=) ident(S)operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) ident(S) operator(=) string reserved(then) reserved(begin) - reserved(if) ident(Length)operator(()ident(Result)operator(\)) operator(<) ident(MinCount) reserved(then) - ident(SetLength)operator(()ident(Result)operator(,) ident(MinCount)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(Result) operator(:=) reserved(nil)operator(;) - ident(SepLen) operator(:=) ident(Length)operator(()ident(Separator)operator(\))operator(;) - - ident(p) operator(:=) integer(1)operator(;) - ident(fin) operator(:=) ident(PosEx)operator(()ident(Separator)operator(,) ident(S)operator(\))operator(;) - reserved(while) ident(fin) operator(>) integer(0) reserved(do) reserved(begin) - ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(fin) operator(-) ident(p)operator(\))operator(\))operator(;) - ident(p) operator(:=) ident(fin) operator(+) ident(SepLen)operator(;) - ident(fin) operator(:=) ident(PosEx)operator(()ident(Separator)operator(,) ident(S)operator(,) ident(p)operator(\))operator(;) - reserved(end)operator(;) - ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p) operator(+) integer(1)operator(\))operator(\))operator(;) - - reserved(if) ident(Length)operator(()ident(Result)operator(\)) operator(<) ident(MinCount) reserved(then) - ident(SetLength)operator(()ident(Result)operator(,) ident(MinCount)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(Split)operator(()reserved(const) ident(S)operator(,) ident(Separator)operator(:) reserved(string)operator(;) ident(Strings)operator(:) ident(TStrings)operator(;) - ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(;) -reserved(var) - ident(p)operator(,) ident(fin)operator(,) ident(SepLen)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(;) - reserved(begin) - reserved(if) ident(IgnoreMultiSep) reserved(and) operator(()ident(S) operator(=) stringoperator(\)) reserved(then) - ident(Exit)operator(;) - ident(Strings)operator(.)ident(Add)operator(()ident(S)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) ident(S) operator(=) string reserved(then) - ident(Exit)operator(;) - - ident(Strings)operator(.)ident(BeginUpdate)operator(;) - ident(SepLen) operator(:=) ident(Length)operator(()ident(Separator)operator(\))operator(;) - ident(p) operator(:=) integer(1)operator(;) - ident(fin) operator(:=) ident(PosEx)operator(()ident(Separator)operator(,) ident(S)operator(\))operator(;) - reserved(while) ident(fin) operator(>) integer(0) reserved(do) reserved(begin) - ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(fin) operator(-) ident(p)operator(\))operator(\))operator(;) - ident(p) operator(:=) ident(fin) operator(+) ident(SepLen)operator(;) - ident(fin) operator(:=) ident(PosEx)operator(()ident(Separator)operator(,) ident(S)operator(,) ident(p)operator(\))operator(;) - reserved(end)operator(;) - ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p) operator(+) integer(1)operator(\))operator(\))operator(;) - ident(Strings)operator(.)ident(EndUpdate)operator(;) -reserved(end)operator(;) - -reserved(function) ident(Split)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Separators)operator(:) ident(TCharSet)operator(;) - ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(MinCount)operator(:) ident(Integer) operator(=) integer(0)operator(\))operator(:) ident(TStrA)operator(;) -reserved(var) - ident(p)operator(,) ident(fin)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(;) - reserved(begin) - reserved(if) ident(IgnoreMultiSep) reserved(and) operator(()ident(S) operator(=) stringoperator(\)) reserved(then) - ident(Exit)operator(;) - ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(Result)operator(\)) operator(+) integer(1)operator(\))operator(;) - ident(Result)operator([)ident(High)operator(()ident(Result)operator(\))operator(]) operator(:=) ident(S)operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) ident(S) operator(=) string reserved(then) reserved(begin) - reserved(if) ident(Length)operator(()ident(Result)operator(\)) operator(<) ident(MinCount) reserved(then) - ident(SetLength)operator(()ident(Result)operator(,) ident(MinCount)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(Result) operator(:=) reserved(nil)operator(;) - - ident(p) operator(:=) integer(1)operator(;) - ident(fin) operator(:=) ident(CharPos)operator(()ident(Separators)operator(,) ident(S)operator(\))operator(;) - reserved(while) ident(fin) operator(>) integer(0) reserved(do) reserved(begin) - ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(fin) operator(-) ident(p)operator(\))operator(\))operator(;) - ident(p) operator(:=) ident(fin) operator(+) integer(1)operator(;) - ident(fin) operator(:=) ident(CharPos)operator(()ident(Separators)operator(,) ident(S)operator(,) ident(p)operator(\))operator(;) - reserved(end)operator(;) - ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p) operator(+) integer(1)operator(\))operator(\))operator(;) - - reserved(if) ident(Length)operator(()ident(Result)operator(\)) operator(<) ident(MinCount) reserved(then) - ident(SetLength)operator(()ident(Result)operator(,) ident(MinCount)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TileStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(BrakeStart)operator(:) ident(Integer)operator(;) ident(BrakeEnd)operator(:) ident(Integer)operator(;) - reserved(out) ident(Left)operator(,) ident(Right)operator(:) reserved(string)operator(\))operator(;) -reserved(begin) - ident(Left) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(BrakeStart)operator(-)integer(1)operator(\))operator(;) - ident(Right) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(BrakeEnd) operator(+) integer(1)operator(,) ident(MaxInt)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(Join)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(,) ident(imax)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(imax) operator(:=) ident(Strings)operator(.)ident(Count)operator(-)integer(1)operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(imax) reserved(do) reserved(begin) - ident(Result) operator(:=) ident(Result) operator(+) ident(Strings)operator([)ident(i)operator(])operator(;) - reserved(if) ident(i) operator(<) ident(imax) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(Separator)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(Join)operator(()ident(StrA)operator(:) ident(TStrA)operator(;) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) directive(overload)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(StrA)operator(\)) reserved(do) reserved(begin) - ident(Result) operator(:=) ident(Result) operator(+) ident(StrA)operator([)ident(i)operator(])operator(;) - reserved(if) ident(i) operator(<) ident(High)operator(()ident(StrA)operator(\)) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(Separator)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(MulStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Count)operator(:) ident(Integer)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(P)operator(:) ident(PChar)operator(;) - ident(Len)operator(,) ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(if) ident(Count) operator(=) integer(0) reserved(then) - ident(Exit)operator(;) - - ident(Len) operator(:=) ident(Length)operator(()ident(S)operator(\))operator(;) - ident(SetLength)operator(()ident(Result)operator(,) ident(Len) operator(*) ident(Count)operator(\))operator(;) - - ident(P) operator(:=) ident(Pointer)operator(()ident(Result)operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Count) reserved(do) reserved(begin) - ident(Move)operator(()ident(Pointer)operator(()ident(S)operator(\))operator(^)operator(,) ident(P)operator(^)operator(,) ident(Len)operator(\))operator(;) - ident(Inc)operator(()ident(P)operator(,) ident(Len)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(AlignR)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Width)operator(:) ident(Integer)operator(;) ident(Filler)operator(:) ident(Char) operator(=) charoperator(\))operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(MulStr)operator(()ident(Filler)operator(,) ident(Width) operator(-) ident(Length)operator(()ident(S)operator(\))operator(\)) operator(+) ident(S)operator(;) -reserved(end)operator(;) - -reserved(function) ident(MaxStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(MaxLen)operator(:) ident(Integer)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(Len)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Len) operator(:=) ident(Length)operator(()ident(S)operator(\))operator(;) - reserved(if) ident(Len) operator(<=) ident(MaxLen) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(S)operator(;) - ident(Exit) reserved(end)operator(;) - - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(MaxLen) operator(-) integer(3)operator(\)) operator(+) stringoperator(;) -reserved(end)operator(;) - -reserved(function) ident(TrimAll)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) - reserved(if) ident(S)operator([)ident(i)operator(]) operator(>) char(#32) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(S)operator([)ident(i)operator(])operator(;) -reserved(end)operator(;) - -reserved(function) ident(ControlChar)operator(()ident(C)operator(:) ident(Char)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(C) reserved(in) ident(StrangeChars)operator(;) -reserved(end)operator(;) - -reserved(function) ident(FriendlyChar)operator(()ident(C)operator(:) ident(Char)operator(\))operator(:) ident(Char)operator(;) -reserved(begin) - reserved(case) ident(C) reserved(of) - char(#0)operator(:) ident(Result) operator(:=) charoperator(;) - char(#1)operator(..)char(#31)operator(:) ident(Result) operator(:=) charoperator(;) - char(#255)operator(:) ident(Result) operator(:=) charoperator(;) - reserved(else) - ident(Result) operator(:=) ident(C)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(FriendlyStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(S)operator(\))operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) - ident(Result)operator([)ident(i)operator(]) operator(:=) ident(FriendlyChar)operator(()ident(S)operator([)ident(i)operator(])operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(FriendlyStr)operator(()ident(a)operator(:) ident(TByteA)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(a)operator(\))operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(a)operator(\)) reserved(do) - ident(Result)operator([)ident(i) operator(+) integer(1)operator(]) operator(:=) ident(FriendlyChar)operator(()ident(Char)operator(()ident(a)operator([)ident(i)operator(])operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(Quote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Quoter)operator(:) ident(Char) operator(=) charoperator(\))operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(S)operator(;) - - reserved(if) ident(FirstChar)operator(()ident(S)operator(\)) operator(<>) ident(Quoter) reserved(then) - ident(Result) operator(:=) ident(Quoter) operator(+) ident(Result)operator(;) - - reserved(if) ident(LastChar)operator(()ident(S)operator(\)) operator(<>) ident(Quoter) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(Quoter)operator(;) -reserved(end)operator(;) - -reserved(function) ident(DeQuote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(if) ident(Length)operator(()ident(S)operator(\)) operator(>) integer(2) reserved(then) - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(2)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) integer(2)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(UnQuote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(Start)operator(,) ident(Len)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Start) operator(:=) integer(1)operator(;) - ident(Len) operator(:=) ident(Length)operator(()ident(S)operator(\))operator(;) - - reserved(if) operator(()ident(S) operator(<>) stringoperator(\)) reserved(and) operator(()ident(S)operator([)integer(1)operator(]) reserved(in) operator(()operator([)char(#0)operator(..)char(#32)operator(]) operator(+) ident(QuoteChars)operator(\))operator(\)) reserved(then) reserved(begin) - reserved(if) operator(()ident(LastChar)operator(()ident(S)operator(\)) operator(=) ident(S)operator([)integer(1)operator(])operator(\)) reserved(then) - ident(Dec)operator(()ident(Len)operator(\))operator(;) - ident(Inc)operator(()ident(Start)operator(\))operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(Start)operator(,) ident(Len) operator(-) ident(Start) operator(+) integer(1)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrNumerus)operator(()reserved(const) ident(Value)operator(:) ident(Integer)operator(;) reserved(const) ident(Singular)operator(,) ident(Plural)operator(:) reserved(string)operator(;) - reserved(const) ident(Zero)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) ident(Abs)operator(()ident(Value)operator(\)) operator(=) integer(1) reserved(then) - ident(Result) operator(:=) ident(IntToStr)operator(()ident(Value)operator(\)) operator(+) char operator(+) ident(Singular) - reserved(else) reserved(if) ident(Value) operator(=) integer(0) reserved(then) - ident(Result) operator(:=) ident(Zero) operator(+) char operator(+) ident(Plural) - reserved(else) - ident(Result) operator(:=) ident(IntToStr)operator(()ident(Value)operator(\)) operator(+) char operator(+) ident(Plural)operator(;) -reserved(end)operator(;) - -reserved(function) ident(MakeStr)operator(()reserved(const) ident(Items)operator(:) reserved(array) reserved(of) reserved(const)operator(;) ident(Separator)operator(:) reserved(string) operator(=) stringoperator(\))operator(:) reserved(string)operator(;) -reserved(const) - ident(BoolStrings)operator(:) reserved(array)operator([)ident(Boolean)operator(]) reserved(of) reserved(string) operator(=) operator(()stringoperator(,) stringoperator(\))operator(;) - -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - - reserved(function) ident(StrOfP)operator(()ident(P)operator(:) ident(Pointer)operator(\))operator(:) reserved(string)operator(;) - reserved(begin) - reserved(if) ident(P) operator(=) reserved(nil) reserved(then) - ident(Result) operator(:=) string - reserved(else) - ident(Result) operator(:=) char operator(+) ident(IntToStr)operator(()ident(Cardinal)operator(()ident(P)operator(\))operator(\)) operator(+) charoperator(;) - reserved(end)operator(;) - - reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(;) - reserved(begin) - ident(Result) operator(:=) ident(Result) operator(+) ident(s) operator(+) ident(Separator)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Items)operator(\)) reserved(do) - reserved(with) ident(Items)operator([)ident(i)operator(]) reserved(do) - reserved(case) ident(VType) reserved(of) - ident(vtString)operator(:) ident(Add)operator(()ident(VString)operator(^)operator(\))operator(;) - ident(vtInteger)operator(:) ident(Add)operator(()ident(IntToStr)operator(()ident(VInteger)operator(\))operator(\))operator(;) - ident(vtBoolean)operator(:) ident(Add)operator(()ident(BoolStrings)operator([)ident(VBoolean)operator(])operator(\))operator(;) - ident(vtChar)operator(:) ident(Add)operator(()ident(VChar)operator(\))operator(;) - ident(vtPChar)operator(:) ident(Add)operator(()ident(VPChar)operator(\))operator(;) - ident(vtExtended)operator(:) ident(Add)operator(()ident(FloatToStr)operator(()ident(VExtended)operator(^)operator(\))operator(\))operator(;) - ident(vtObject)operator(:) reserved(if) ident(VObject) reserved(is) ident(TComponent) reserved(then) - ident(Add)operator(()ident(TComponent)operator(()ident(VObject)operator(\))operator(.)ident(Name)operator(\)) - reserved(else) - ident(Add)operator(()ident(VObject)operator(.)ident(ClassName)operator(\))operator(;) - ident(vtClass)operator(:) ident(Add)operator(()ident(VClass)operator(.)ident(ClassName)operator(\))operator(;) - ident(vtAnsiString)operator(:) ident(Add)operator(()reserved(string)operator(()ident(VAnsiString)operator(\))operator(\))operator(;) - ident(vtCurrency)operator(:) ident(Add)operator(()ident(CurrToStr)operator(()ident(VCurrency)operator(^)operator(\))operator(\))operator(;) - ident(vtInt64)operator(:) ident(Add)operator(()ident(IntToStr)operator(()ident(VInt64)operator(^)operator(\))operator(\))operator(;) - ident(vtVariant)operator(:) ident(Add)operator(()reserved(string)operator(()ident(VVariant)operator(^)operator(\))operator(\))operator(;) - - ident(vtWideChar)operator(:) ident(Add)operator(()ident(VWideChar)operator(\))operator(;) - ident(vtPWideChar)operator(:) ident(Add)operator(()ident(VPWideChar)operator(\))operator(;) - ident(vtInterface)operator(:) ident(Add)operator(()ident(StrOfP)operator(()ident(VInterface)operator(\))operator(\))operator(;) - ident(vtPointer)operator(:) ident(Add)operator(()ident(StrOfP)operator(()ident(VPointer)operator(\))operator(\))operator(;) - ident(vtWideString)operator(:) ident(Add)operator(()ident(WideString)operator(()ident(VWideString)operator(\))operator(\))operator(;) - reserved(end)operator(;) - reserved(if) ident(Result) operator(<>) string reserved(then) - ident(SetLength)operator(()ident(result)operator(,) ident(Length)operator(()ident(Result)operator(\)) operator(-) ident(Length)operator(()ident(Separator)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(ShowText)operator(()reserved(const) ident(Items)operator(:) reserved(array) reserved(of) reserved(const)operator(;) ident(Separator)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) -reserved(var) - ident(Text)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Text) operator(:=) ident(MakeStr)operator(()ident(Items)operator(,) ident(Separator)operator(\))operator(;) - - ident(MessageBox)operator(()integer(0)operator(,) ident(PChar)operator(()ident(Text)operator(\))operator(,) stringoperator(,) ident(MB_OK) reserved(and) ident(MB_APPLMODAL)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(DeleteChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) - reserved(if) ident(S)operator([)ident(i)operator(]) operator(<>) ident(C) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(S)operator([)ident(i)operator(])operator(;) -reserved(end)operator(;) - -reserved(function) ident(DeleteChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) - reserved(if) reserved(not) operator(()ident(S)operator([)ident(i)operator(]) reserved(in) ident(C)operator(\)) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(S)operator([)ident(i)operator(])operator(;) -reserved(end)operator(;) - -reserved(function) ident(ExtractChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) - reserved(if) ident(S)operator([)ident(i)operator(]) reserved(in) ident(C) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(S)operator([)ident(i)operator(])operator(;) -reserved(end)operator(;) - -reserved(function) ident(CharCount)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\))operator(:) ident(Integer)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) - reserved(if) ident(S)operator([)ident(i)operator(]) operator(=) ident(C) reserved(then) - ident(Inc)operator(()ident(Result)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrAtPos)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Pos)operator(:) ident(Integer)operator(;) reserved(const) ident(Str)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) operator(()ident(Str) operator(<>) stringoperator(\)) reserved(and) operator(()ident(Str) operator(=) ident(Copy)operator(()ident(S)operator(,) ident(Pos)operator(,) ident(Length)operator(()ident(Str)operator(\))operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(TextAtPos)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Pos)operator(:) ident(Integer)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) operator(()ident(Text) operator(<>) stringoperator(\)) reserved(and) ident(SameText)operator(()ident(Text)operator(,) ident(Copy)operator(()ident(S)operator(,) ident(Pos)operator(,) ident(Length)operator(()ident(Text)operator(\))operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrAtBegin)operator(()reserved(const) ident(S)operator(,) ident(Str)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(StrAtPos)operator(()ident(S)operator(,) integer(1)operator(,) ident(Str)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(TextAtBegin)operator(()reserved(const) ident(S)operator(,) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(TextAtPos)operator(()ident(S)operator(,) integer(1)operator(,) ident(Text)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(CharIn)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(True)operator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) - reserved(if) ident(S)operator([)ident(i)operator(]) operator(=) ident(C) reserved(then) ident(Exit)operator(;) - ident(Result) operator(:=) ident(False)operator(;) -reserved(end)operator(;) - -reserved(function) ident(CharIn)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) reserved(begin) - ident(Result) operator(:=) ident(S)operator([)ident(i)operator(]) reserved(in) ident(C)operator(;) - reserved(if) ident(Result) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrIn)operator(()reserved(const) ident(S)operator(,) ident(SubStr)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(PosEx)operator(()ident(SubStr)operator(,) ident(S)operator(\)) operator(>) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrIn)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - ident(Result) operator(:=) operator(()ident(S) operator(=) ident(SL)operator([)ident(i)operator(])operator(\))operator(;) - reserved(if) ident(Result) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrIn)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - reserved(for) ident(i) operator(:=) ident(Low)operator(()ident(A)operator(\)) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) reserved(begin) - ident(Result) operator(:=) operator(()ident(S) operator(=) ident(A)operator([)ident(i)operator(])operator(\))operator(;) - reserved(if) ident(Result) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TextIn)operator(()reserved(const) ident(S)operator(,) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(PosExText)operator(()ident(Text)operator(,) ident(S)operator(\)) operator(>) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TextIn)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - ident(Result) operator(:=) ident(SameText)operator(()ident(Text)operator(,) ident(SL)operator([)ident(i)operator(])operator(\))operator(;) - reserved(if) ident(Result) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TextIn)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - reserved(for) ident(i) operator(:=) ident(Low)operator(()ident(A)operator(\)) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) reserved(begin) - ident(Result) operator(:=) ident(SameText)operator(()ident(Text)operator(,) ident(A)operator([)ident(i)operator(])operator(\))operator(;) - reserved(if) ident(Result) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrIndex)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(Result) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) - reserved(if) ident(S) operator(=) ident(SL)operator([)ident(Result)operator(]) reserved(then) - ident(Exit)operator(;) - ident(Result) operator(:=) operator(-)integer(1)operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrIndex)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(Result) operator(:=) ident(Low)operator(()ident(A)operator(\)) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) - reserved(if) ident(S) operator(=) ident(A)operator([)ident(Result)operator(]) reserved(then) - ident(Exit)operator(;) - ident(Result) operator(:=) operator(-)integer(1)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TextIndex)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(Result) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) - reserved(if) ident(SameText)operator(()ident(Text)operator(,) ident(SL)operator([)ident(Result)operator(])operator(\)) reserved(then) - ident(Exit)operator(;) - ident(Result) operator(:=) operator(-)integer(1)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TextIndex)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(Result) operator(:=) ident(Low)operator(()ident(A)operator(\)) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) - reserved(if) ident(SameText)operator(()ident(Text)operator(,) ident(A)operator([)ident(Result)operator(])operator(\)) reserved(then) - ident(Exit)operator(;) - ident(Result) operator(:=) operator(-)integer(1)operator(;) -reserved(end)operator(;) - -reserved(function) ident(ReplaceChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Old)operator(,) ident(New)operator(:) ident(Char)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(S)operator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(Result)operator(\)) reserved(do) - reserved(if) ident(Result)operator([)ident(i)operator(]) operator(=) ident(Old) reserved(then) - ident(Result)operator([)ident(i)operator(]) operator(:=) ident(New)operator(;) -reserved(end)operator(;) - -reserved(function) ident(ReplaceChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Old)operator(:) ident(TCharSet)operator(;) ident(New)operator(:) ident(Char)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(S)operator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(Result)operator(\)) reserved(do) - reserved(if) ident(Result)operator([)ident(i)operator(]) reserved(in) ident(Old) reserved(then) - ident(Result)operator([)ident(i)operator(]) operator(:=) ident(New)operator(;) -reserved(end)operator(;) - -reserved(function) ident(Replace)operator(()reserved(const) ident(S)operator(,) ident(Old)operator(,) ident(New)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(oldp)operator(,) ident(ps)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(ps) operator(:=) integer(1)operator(;) - ident(Result) operator(:=) stringoperator(;) - reserved(while) ident(True) reserved(do) reserved(begin) - ident(oldp) operator(:=) ident(ps)operator(;) - ident(ps) operator(:=) ident(PosEx)operator(()ident(Old)operator(,) ident(S)operator(,) ident(oldp)operator(\))operator(;) - reserved(if) ident(ps) operator(=) integer(0) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(Result) operator(+) ident(Copy)operator(()ident(S)operator(,) ident(oldp)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(oldp) operator(+) integer(1)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - ident(Result) operator(:=) ident(Result) operator(+) ident(Copy)operator(()ident(S)operator(,) ident(oldp)operator(,) ident(ps) operator(-) ident(oldp)operator(\)) operator(+) ident(New)operator(;) - ident(Inc)operator(()ident(ps)operator(,) ident(Length)operator(()ident(Old)operator(\))operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(SLOfFile)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) ident(TStringList)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - reserved(if) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(then) - ident(Result)operator(.)ident(LoadFromFile)operator(()ident(FileName)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(ContainsEmptyLines)operator(()ident(SL)operator(:) ident(TStrings)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(StrIn)operator(()ident(SL)operator(,) stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(DeleteEmptyLines)operator(()ident(SL)operator(:) ident(TStrings)operator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(i) operator(:=) integer(0)operator(;) - reserved(while) ident(i) operator(<) ident(SL)operator(.)ident(Count) reserved(do) reserved(begin) - reserved(if) ident(SL)operator([)ident(i)operator(]) operator(=) string reserved(then) - ident(SL)operator(.)ident(Delete)operator(()ident(i)operator(\)) - reserved(else) - ident(Inc)operator(()ident(i)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(DeleteCommentLines)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(CommentSign)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(i) operator(:=) integer(0)operator(;) - reserved(while) ident(i) operator(<) ident(SL)operator(.)ident(Count) reserved(do) reserved(begin) - reserved(if) operator(()ident(SL)operator([)ident(i)operator(]) operator(=) stringoperator(\)) reserved(or) operator(()ident(StrAtBegin)operator(()ident(TrimLeft)operator(()ident(SL)operator([)ident(i)operator(])operator(\))operator(,) ident(CommentSign)operator(\))operator(\)) reserved(then) - ident(SL)operator(.)ident(Delete)operator(()ident(i)operator(\)) - reserved(else) - ident(Inc)operator(()ident(i)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(FindLine)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(Result) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) - reserved(if) ident(TextAtBegin)operator(()ident(SL)operator([)ident(Result)operator(])operator(,) ident(S)operator(\)) reserved(then) - ident(Exit)operator(;) - ident(Result) operator(:=) operator(-)integer(1)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(QuickSortSL)operator(()ident(SL)operator(:) ident(TStringList)operator(\))operator(;) - - reserved(procedure) ident(Sort)operator(()ident(l)operator(,) ident(r)operator(:) ident(Integer)operator(\))operator(;) - reserved(var) - ident(i)operator(,)ident(j)operator(:) ident(Integer)operator(;) - ident(z)operator(,)ident(x)operator(:) reserved(string)operator(;) - reserved(begin) - ident(i) operator(:=) ident(l)operator(;) - ident(j) operator(:=) ident(r)operator(;) - ident(x) operator(:=) ident(SL)operator([)operator(()ident(j) operator(+) ident(i)operator(\)) reserved(div) integer(2)operator(])operator(;) - reserved(repeat) - reserved(while) ident(SL)operator([)ident(i)operator(]) operator(<) ident(x) reserved(do) ident(Inc)operator(()ident(i)operator(\))operator(;) - reserved(while) ident(SL)operator([)ident(j)operator(]) operator(>) ident(x) reserved(do) ident(Dec)operator(()ident(j)operator(\))operator(;) - reserved(if) ident(i) operator(<=) ident(j) reserved(then) reserved(begin) - ident(z) operator(:=) ident(SL)operator([)ident(i)operator(])operator(;) - ident(SL)operator([)ident(i)operator(]) operator(:=) ident(SL)operator([)ident(j)operator(])operator(;) - ident(SL)operator([)ident(j)operator(]) operator(:=) ident(z)operator(;) - ident(Inc)operator(()ident(i)operator(\))operator(;) ident(Dec)operator(()ident(j)operator(\))operator(;) - reserved(end)operator(;) - reserved(until) ident(i) operator(>) ident(j)operator(;) - reserved(if) ident(j) operator(>) ident(l) reserved(then) ident(Sort)operator(()ident(l)operator(,) ident(j)operator(\))operator(;) - reserved(if) ident(i) operator(<) ident(r) reserved(then) ident(Sort)operator(()ident(i)operator(,) ident(r)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - reserved(if) ident(SL)operator(.)ident(Count) operator(>) integer(0) reserved(then) - ident(Sort)operator(()integer(0)operator(,) ident(SL)operator(.)ident(Count)operator(-)integer(1)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(IncStrA)operator(()ident(StrA)operator(:) ident(TStrA)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - ident(SetLength)operator(()ident(StrA)operator(,) ident(Length)operator(()ident(StrA)operator(\)) operator(+) integer(1)operator(\))operator(;) - ident(Result) operator(:=) ident(High)operator(()ident(StrA)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) reserved(string)operator(()ident(Copy)operator(()ident(a)operator(,) integer(0)operator(,) ident(Length)operator(()ident(a)operator(\))operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(ByteAOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(TByteA)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(TByteA)operator(()ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(Length)operator(()ident(s)operator(\))operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(ByteAOfInt)operator(()ident(i)operator(:) ident(Integer)operator(\))operator(:) ident(TByteA)operator(;) -reserved(begin) - ident(SetLength)operator(()ident(Result)operator(,) ident(SizeOf)operator(()ident(Integer)operator(\))operator(\))operator(;) - ident(Move)operator(()ident(i)operator(,) ident(Pointer)operator(()ident(Result)operator(\))operator(^)operator(,) ident(SizeOf)operator(()ident(Integer)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(IntOfByteA)operator(()ident(A)operator(:) ident(TByteA)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - ident(Move)operator(()ident(Pointer)operator(()ident(A)operator(\))operator(^)operator(,) ident(Result)operator(,) ident(Min)operator(()ident(Length)operator(()ident(A)operator(\))operator(,) ident(SizeOf)operator(()ident(Integer)operator(\))operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(ByteAOfHex)operator(()reserved(const) ident(Hex)operator(:) reserved(string)operator(\))operator(:) ident(TByteA)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(h)operator(:) reserved(string)operator(;) -reserved(begin) - ident(h) operator(:=) ident(ExtractChars)operator(()ident(Hex)operator(,) ident(HexadecimalChars)operator(\))operator(;) - ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(h)operator(\)) reserved(div) integer(2)operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Result)operator(\)) reserved(do) - ident(Result)operator([)ident(i)operator(]) operator(:=) ident(ByteOfHex)operator(()ident(Copy)operator(()ident(h)operator(,) operator(()ident(i) reserved(shl) integer(1)operator(\)) operator(+) integer(1)operator(,) integer(2)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(SizeOfFile)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) ident(Integer)operator(;) -reserved(var) - ident(F)operator(:) reserved(file)operator(;) -reserved(begin) - ident(AssignFile)operator(()ident(F)operator(,) ident(FileName)operator(\))operator(;) - preprocessor({$I-})ident(Reset)operator(()ident(F)operator(,) integer(1)operator(\))operator(;)preprocessor({$I+}) - reserved(if) ident(IOResult) operator(=) integer(0) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(FileSize)operator(()ident(F)operator(\))operator(;) - ident(CloseFile)operator(()ident(F)operator(\))operator(;) - reserved(end) reserved(else) - ident(Result) operator(:=) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(FileEx)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(;) ident(AllowFolders)operator(:) ident(Boolean) operator(=) ident(False)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(FindData)operator(:) ident(TWin32FindData)operator(;) -reserved(begin) - reserved(if) ident(FileName) operator(=) string reserved(then) reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(Result) operator(:=) operator(()ident(AllowFolders) reserved(and) ident(DirectoryExists)operator(()ident(FileName)operator(\))operator(\)) reserved(or) - operator(()ident(FindFirstFile)operator(()ident(PChar)operator(()ident(FileName)operator(\))operator(,) ident(FindData)operator(\)) operator(<>) ident(INVALID_HANDLE_VALUE)operator(\))operator(;) - ident(Result) operator(:=) ident(Result) reserved(and) reserved(not) ident(CharIn)operator(()ident(FileName)operator(,) ident(WildCards)operator(\))operator(;) - ident(Result) operator(:=) ident(Result) reserved(and) operator(()ident(AllowFolders) - reserved(or) operator(()operator(()ident(FindData)operator(.)ident(dwFileAttributes) reserved(and) ident(FILE_ATTRIBUTE_DIRECTORY)operator(\)) operator(=) integer(0)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(LWPSolve)operator(()reserved(const) ident(Dir)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) operator(()ident(Dir) operator(<>) stringoperator(\)) reserved(and) operator(()ident(Dir)operator([)ident(Length)operator(()ident(Dir)operator(\))operator(]) operator(=) charoperator(\)) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(Copy)operator(()ident(Dir)operator(,) integer(1)operator(,) ident(Length)operator(()ident(Dir)operator(\)) operator(-) integer(1)operator(\))operator(;) - reserved(end) reserved(else) - ident(Result) operator(:=) ident(Dir)operator(;) -reserved(end)operator(;) - -reserved(function) ident(LWPSlash)operator(()reserved(const) ident(Dir)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) operator(()ident(Dir) operator(<>) stringoperator(\)) reserved(and) operator(()ident(Dir)operator([)ident(Length)operator(()ident(Dir)operator(\))operator(]) operator(=) charoperator(\)) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(Copy)operator(()ident(Dir)operator(,) integer(1)operator(,) ident(Length)operator(()ident(Dir)operator(\))operator(\))operator(;) - reserved(end) reserved(else) - ident(Result) operator(:=) ident(Dir) operator(+) charoperator(;) -reserved(end)operator(;) - -reserved(function) ident(ExtractDrive)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(if) operator(()ident(Length)operator(()ident(FileName)operator(\)) operator(>=) integer(2)operator(\)) reserved(and) operator(()ident(FileName)operator([)integer(2)operator(]) operator(=) charoperator(\)) reserved(then) - ident(Result) operator(:=) ident(UpperCase)operator(()ident(FileName)operator([)integer(1)operator(]) operator(+) stringoperator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(ExtractPath)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(p)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(p) operator(:=) ident(CharPosR)operator(()charoperator(,) ident(FileName)operator(\))operator(;) - reserved(if) ident(P) operator(>) integer(0) reserved(then) - ident(Result) operator(:=) ident(Copy)operator(()ident(FileName)operator(,) integer(1)operator(,) ident(p)operator(\)) - reserved(else) - ident(Result) operator(:=) ident(FileName)operator(;) -reserved(end)operator(;) - -reserved(function) ident(ExtractPrefix)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(UntilLastChar)operator(()ident(ExtractFileName)operator(()ident(FileName)operator(\))operator(,) charoperator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(ExtractSuffix)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(FromLastChar)operator(()ident(ExtractFileName)operator(()ident(FileName)operator(\))operator(,) charoperator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(SameByteA)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(TByteA)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) operator(()ident(A) operator(=) ident(B)operator(\)) reserved(or) operator(()operator(()ident(Length)operator(()ident(A)operator(\)) operator(=) ident(Length)operator(()ident(B)operator(\))operator(\)) reserved(and) ident(CompareMem)operator(()ident(A)operator(,) ident(B)operator(,) ident(Length)operator(()ident(A)operator(\))operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(Reverse)operator(()ident(A)operator(:) ident(TByteA)operator(\))operator(:) ident(TByteA)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(A)operator(\))operator(\))operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) - ident(Result)operator([)ident(High)operator(()ident(Result)operator(\)) operator(-) ident(i)operator(]) operator(:=) ident(A)operator([)ident(i)operator(])operator(;) -reserved(end)operator(;) - -reserved(function) ident(Endian)operator(()ident(i)operator(:) ident(Integer)operator(\))operator(:) ident(Integer)operator(;) -reserved(type) - ident(EndianArray) operator(=) reserved(packed) reserved(array)operator([)integer(0)operator(..)integer(3)operator(]) reserved(of) ident(Byte)operator(;) -reserved(var) - ident(a)operator(,) ident(b)operator(:) ident(EndianArray)operator(;) -reserved(begin) - ident(a) operator(:=) ident(EndianArray)operator(()ident(i)operator(\))operator(;) - ident(b)operator([)integer(0)operator(]) operator(:=) ident(a)operator([)integer(3)operator(])operator(;) - ident(b)operator([)integer(1)operator(]) operator(:=) ident(a)operator([)integer(2)operator(])operator(;) - ident(b)operator([)integer(2)operator(]) operator(:=) ident(a)operator([)integer(1)operator(])operator(;) - ident(b)operator([)integer(3)operator(]) operator(:=) ident(a)operator([)integer(0)operator(])operator(;) - ident(Result) operator(:=) ident(Integer)operator(()ident(b)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(SaveByteA)operator(()ident(Data)operator(:) ident(TByteA)operator(;) reserved(const) ident(FileName)operator(:) reserved(string)operator(;) - ident(Overwrite)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(F)operator(:) reserved(file)operator(;) -reserved(begin) - reserved(if) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(and) reserved(not) ident(Overwrite) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - ident(Exit) reserved(end)operator(;) - - ident(AssignFile)operator(()ident(F)operator(,) ident(FileName)operator(\))operator(;) - preprocessor({$I-})ident(Rewrite)operator(()ident(F)operator(,) integer(1)operator(\))operator(;)preprocessor({$I+}) - reserved(if) ident(IOResult) operator(=) integer(0) reserved(then) reserved(begin) - reserved(if) ident(Length)operator(()ident(Data)operator(\)) operator(>) integer(0) reserved(then) - ident(BlockWrite)operator(()ident(F)operator(,) ident(Data)operator([)integer(0)operator(])operator(,) ident(Length)operator(()ident(Data)operator(\))operator(\))operator(;) - ident(CloseFile)operator(()ident(F)operator(\))operator(;) - ident(Result) operator(:=) ident(True)operator(;) - reserved(end) reserved(else) - ident(Result) operator(:=) ident(False)operator(;) -reserved(end)operator(;) - -reserved(function) ident(LoadByteA)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) ident(TByteA)operator(;) -reserved(var) - ident(F)operator(:) reserved(file)operator(;) -reserved(begin) - ident(AssignFile)operator(()ident(F)operator(,) ident(FileName)operator(\))operator(;) - preprocessor({$I-})ident(Reset)operator(()ident(F)operator(,) integer(1)operator(\))operator(;)preprocessor({$I+}) - reserved(if) ident(IOResult) operator(=) integer(0) reserved(then) reserved(begin) - ident(SetLength)operator(()ident(Result)operator(,) ident(FileSize)operator(()ident(F)operator(\))operator(\))operator(;) - reserved(if) ident(Length)operator(()ident(Result)operator(\)) operator(>) integer(0) reserved(then) - ident(BlockRead)operator(()ident(F)operator(,) ident(Result)operator([)integer(0)operator(])operator(,) ident(FileSize)operator(()ident(F)operator(\))operator(\))operator(;) - ident(CloseFile)operator(()ident(F)operator(\))operator(;) - reserved(end) reserved(else) - ident(SetLength)operator(()ident(Result)operator(,) integer(0)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(IsValidFileName)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) operator(()ident(FileName) operator(<>) stringoperator(\)) reserved(and) reserved(not) ident(CharIn)operator(()ident(FileName)operator(,) ident(FileNameEnemies)operator(\)) - reserved(and) ident(CharIn)operator(()ident(Trim)operator(()ident(FileName)operator(\))operator(,) ident(AllChars) operator(-) operator([)charoperator(])operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(MakeValidFileName)operator(()ident(FileName)operator(:) reserved(string)operator(;) reserved(const) ident(Default)operator(:) reserved(string) operator(=) stringoperator(\))operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) ident(FileName) operator(=) string reserved(then) - ident(FileName) operator(:=) ident(Default)operator(;) - - reserved(if) ident(CharIn)operator(()ident(FileName)operator(,) ident(FileNameEnemies)operator(\)) reserved(then) - ident(Result) operator(:=) ident(ReplaceChars)operator(()ident(FileName)operator(,) ident(FileNameEnemies)operator(,) charoperator(\)) - reserved(else) reserved(if) reserved(not) ident(CharIn)operator(()ident(Trim)operator(()ident(FileName)operator(\))operator(,) ident(AllChars) operator(-) operator([)charoperator(])operator(\)) reserved(then) - ident(Result) operator(:=) ident(Default) - reserved(else) - ident(Result) operator(:=) ident(FileName)operator(;) -reserved(end)operator(;) - -reserved(function) ident(IsValidInteger)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -comment({const - LowInt = '2147483648'; - HighInt = '2147483647'; -var - len, RealLen, i, o: Integer; - c: Char; -begin - Result := False; - if S = '' then - Exit; - - len := Length(S\); - o := 1; - - if S[1] = '-' then begin - if len = 1 then - Exit; - Inc(o\); - while (o <= len\) and (S[o] = '0'\) do - Inc(o\); - if o > len then - Exit; - if o < len then begin - RealLen := len - o + 1; - if RealLen > Length(LowInt\) then - Exit - else if RealLen = Length(LowInt\) then begin - for i := 1 to Length(LowInt\) do begin - c := S[i + o - 1]; - if (c < '0'\) or (c > LowInt[i]\) then - Exit; - if c in ['0'..Char((Byte(LowInt[i]\)-1\)\)] then - Break; - end; - Inc(o, i\); - end; - end; - end else begin - while (o <= len\) and (S[o] = '0'\) do - Inc(o\); - if o <= len then begin - RealLen := len - o + 1; - if RealLen > Length(HighInt\) then - Exit - else if RealLen = Length(HighInt\) then begin - for i := 1 to Length(HighInt\) do begin - c := S[i + o - 1]; - if (c < '0'\) or (c > HighInt[i]\) then - Exit; - if c in ['0'..Char((Byte(HighInt[i]\)-1\)\)] then - Break; - end; - Inc(o, i\); - end; - end; - end; - - for i := o to len do - if not (S[i] in ['0'..'9']\) then - Exit; - - Result := True; }) -reserved(var) - ident(i)operator(:) ident(Int64)operator(;) -reserved(begin) - ident(i) operator(:=) ident(StrToInt64Def)operator(()ident(S)operator(,) ident(High)operator(()ident(Int64)operator(\))operator(\))operator(;) - ident(Result) operator(:=) operator(()ident(i) operator(>=) ident(Low)operator(()ident(Integer)operator(\))operator(\)) reserved(and) operator(()ident(i) operator(<=) ident(High)operator(()ident(Integer)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(IsValidCardinal)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) -comment({const - HighCard = '4294967295'; -var - len, RealLen, i, o: Integer; -begin - Result := False; - if S = '' then - Exit; - - len := Length(S\); - o := 1; - - while (o <= len\) and (S[o] = '0'\) do - Inc(o\); - if o <= len then begin - RealLen := len - o + 1; - if RealLen > Length(HighCard\) then - Exit - else if RealLen = Length(HighCard\) then begin - for i := 1 to Length(HighCard\) do begin - if S[i + o - 1] > HighCard[i] then - Exit; - if S[i + o - 1] in ['0'..Char((Byte(HighCard[i]\)-1\)\)] then - Break; - end; - Inc(o, i\); - end; - end; - - for i := o to len do - if not (S[i] in ['0'..'9']\) then - Exit; - - Result := True; }) -reserved(var) - ident(i)operator(:) ident(Int64)operator(;) -reserved(begin) - ident(i) operator(:=) ident(StrToInt64Def)operator(()ident(S)operator(,) operator(-)integer(1)operator(\))operator(;) - ident(Result) operator(:=) operator(()ident(i) operator(>=) integer(0)operator(\)) reserved(and) operator(()ident(i) operator(<=) ident(High)operator(()ident(Cardinal)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrOfBool)operator(()ident(flag)operator(:) ident(Boolean)operator(;) reserved(const) ident(TrueStr)operator(:) reserved(string) operator(=) stringoperator(;) - reserved(const) ident(FalseStr)operator(:) reserved(string) operator(=) stringoperator(\))operator(:) reserved(string)operator(;) -reserved(begin) - reserved(if) ident(Flag) reserved(then) - ident(Result) operator(:=) ident(TrueStr) - reserved(else) - ident(Result) operator(:=) ident(FalseStr)operator(;) -reserved(end)operator(;) - -reserved(function) ident(StrOfInt)operator(()ident(i)operator(:) ident(Integer)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) -comment({ if i = 0 then begin - Result := '0'; - Exit end; - - while i > 0 do begin - Result := Char(Byte('0'\) + (i mod 10\)\) + Result; - i := i div 10; - end;}) - ident(Result) operator(:=) ident(IntToStr)operator(()ident(i)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(CardOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(Cardinal)operator(;) -reserved(var) - ident(Res)operator(:) ident(Int64)operator(;) -reserved(begin) - ident(Res) operator(:=) ident(StrToInt64Def)operator(()ident(S)operator(,) operator(-)integer(1)operator(\))operator(;) - reserved(if) ident(Res) operator(>) ident(High)operator(()ident(Cardinal)operator(\)) reserved(then) - ident(Res) operator(:=) ident(High)operator(()ident(Cardinal)operator(\)) - reserved(else) reserved(if) ident(Res) operator(<) integer(0) reserved(then) - ident(Res) operator(:=) integer(0)operator(;) - ident(Result) operator(:=) ident(Cardinal)operator(()ident(Res)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(HexOrd)operator(()ident(Hex)operator(:) ident(Char)operator(\))operator(:) ident(THex)operator(;) -reserved(begin) - reserved(case) ident(Hex) reserved(of) - charoperator(..)charoperator(:) - ident(Result) operator(:=) ident(Byte)operator(()ident(Hex)operator(\)) operator(-) integer(48)operator(;) - charoperator(..)charoperator(:) - ident(Result) operator(:=) ident(Byte)operator(()ident(Hex)operator(\)) operator(-) integer(55)operator(;) - charoperator(..)charoperator(:) - ident(Result) operator(:=) ident(Byte)operator(()ident(Hex)operator(\)) operator(-) integer(87)operator(;) - reserved(else) - ident(Result) operator(:=) integer(0)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(ByteOfHex)operator(()ident(Hex)operator(:) ident(THexByteStr)operator(\))operator(:) ident(Byte)operator(;) -reserved(begin) - ident(Result) operator(:=) operator(()ident(HexOrd)operator(()ident(Hex)operator([)integer(1)operator(])operator(\)) reserved(shl) integer(4)operator(\)) operator(+) ident(HexOrd)operator(()ident(Hex)operator([)integer(2)operator(])operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(DecOfHex)operator(()reserved(const) ident(Hex)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(IntToStr)operator(()ident(CardOfHex)operator(()ident(Hex)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(HexOfByte)operator(()ident(b)operator(:) ident(Byte)operator(\))operator(:) ident(THexByteStr)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(HexChar)operator([)operator(()ident(b) reserved(and) hex($F0)operator(\)) reserved(shr) integer(4)operator(]) - operator(+) ident(HexChar)operator([) ident(b) reserved(and) hex($0F) operator(])operator(;) -reserved(end)operator(;) - -comment({function HexOfCard2(c: Cardinal\): string; -var - Data: array[0..(1 shl 4\) - 1] of Char; - i: Integer; -begin - for i := 0 to (1 shl 4\) - 1 do - if i < 10 then - Data[i] := Char(Ord('0'\) + i\) - else - Data[i] := Char(Ord('A'\) + i - 10\); - - Result := Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (7 shl 2\)\)\) shr (7 shl 2\)] - + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (6 shl 2\)\)\) shr (6 shl 2\)] - + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (5 shl 2\)\)\) shr (5 shl 2\)] - + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (4 shl 2\)\)\) shr (4 shl 2\)] - + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (3 shl 2\)\)\) shr (3 shl 2\)] - + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (2 shl 2\)\)\) shr (2 shl 2\)] - + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (1 shl 2\)\)\) shr (1 shl 2\)] - + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (0 shl 2\)\)\) shr (0 shl 2\)]; -end; }) - -reserved(function) ident(HexOfCard)operator(()ident(i)operator(:) ident(Cardinal)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(a)operator(:) ident(Cardinal)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(while) ident(i) operator(>) integer(0) reserved(do) reserved(begin) - ident(a) operator(:=) ident(i) reserved(and) hex($F)operator(;) - ident(Result) operator(:=) ident(HexChar)operator([)ident(a)operator(]) operator(+) ident(Result)operator(;) - ident(i) operator(:=) ident(i) reserved(shr) integer(4)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(HexOfCard)operator(()ident(i)operator(:) ident(Cardinal)operator(;) ident(Digits)operator(:) ident(Integer)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(a)operator(:) ident(Cardinal)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - reserved(while) ident(i) operator(>) integer(0) reserved(do) reserved(begin) - ident(a) operator(:=) ident(i) reserved(and) hex($F)operator(;) - ident(Result) operator(:=) ident(HexChar)operator([)ident(a)operator(]) operator(+) ident(Result)operator(;) - ident(i) operator(:=) ident(i) reserved(shr) integer(4)operator(;) - reserved(end)operator(;) - ident(Result) operator(:=) ident(MulStr)operator(()charoperator(,) ident(Digits) operator(-) ident(Length)operator(()ident(Result)operator(\))operator(\)) operator(+) ident(Result)operator(;) -reserved(end)operator(;) - -reserved(function) ident(PascalHexArray)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Name)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(,) ident(len)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) string operator(+) ident(EOL) operator(+) - string operator(+) ident(Name) operator(+) string operator(+) ident(IntToStr)operator(()ident(High)operator(()ident(a)operator(\))operator(\)) operator(+) stringoperator(;) - - ident(len) operator(:=) ident(Length)operator(()ident(a)operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(len)operator(-)integer(1) reserved(do) reserved(begin) - reserved(if) operator(()ident(i) reserved(mod) integer(19)operator(\)) operator(=) integer(0) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(EOL) operator(+) string operator(+) stringoperator(;) - ident(Result) operator(:=) ident(Result) operator(+) char operator(+) ident(HexOfByte)operator(()ident(a)operator([)ident(i)operator(])operator(\))operator(;) - reserved(if) ident(i) operator(<) ident(len)operator(-)integer(1) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) charoperator(;) - reserved(end)operator(;) - ident(Result) operator(:=) ident(Result) operator(+) ident(EOL) operator(+) stringoperator(;) -reserved(end)operator(;) - -reserved(function) ident(HexOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Blocks)operator(:) ident(Integer) operator(=) integer(1)operator(;) - reserved(const) ident(Splitter)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - - reserved(if) ident(Blocks) operator(>) integer(0) reserved(then) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(a)operator(\)) reserved(do) reserved(begin) - ident(Result) operator(:=) ident(Result) operator(+) ident(HexOfByte)operator(()ident(a)operator([)ident(i)operator(])operator(\))operator(;) - reserved(if) ident(i) operator(<) ident(High)operator(()ident(a)operator(\)) reserved(then) - reserved(if) operator(()operator(()ident(i)operator(+)integer(1)operator(\)) reserved(mod) ident(Blocks)operator(\)) operator(=) integer(0) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(Splitter)operator(;) - reserved(end) - reserved(else) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(a)operator(\)) reserved(do) - ident(Result) operator(:=) ident(Result) operator(+) ident(HexOfByte)operator(()ident(a)operator([)ident(i)operator(])operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(BinOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Blocks)operator(:) ident(Integer) operator(=) integer(4)operator(;) - reserved(const) ident(Splitter)operator(:) reserved(string) operator(=) charoperator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(i)operator(,) ident(max)operator(:) ident(Integer)operator(;) - ident(Bit)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - - reserved(if) ident(Blocks) operator(>) integer(0) reserved(then) reserved(begin) - ident(max) operator(:=) integer(8) operator(*) operator(()ident(High)operator(()ident(a)operator(\))operator(\)) operator(+) integer(7)operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(max) reserved(do) reserved(begin) - ident(Bit) operator(:=) integer(7)operator(-)operator(()ident(i) reserved(mod) integer(8)operator(\)) reserved(in) ident(TBitSet)operator(()ident(a)operator([)ident(i) reserved(div) integer(8)operator(])operator(\))operator(;) - ident(Result) operator(:=) ident(Result) operator(+) ident(Char)operator(()ident(Byte)operator(()charoperator(\)) operator(+) ident(Byte)operator(()ident(Bit)operator(\))operator(\))operator(;) - reserved(if) ident(i) operator(<) ident(max) reserved(then) - reserved(if) operator(()operator(()ident(i)operator(+)integer(1)operator(\)) reserved(mod) ident(Blocks)operator(\)) operator(=) integer(0) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(Splitter)operator(;) - reserved(end)operator(;) - reserved(end) reserved(else) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(a)operator(\)) reserved(do) - ident(Result) operator(:=) ident(Result) operator(+) ident(Char)operator(()ident(Byte)operator(()charoperator(\)) operator(+) ident(a)operator([)ident(i)operator(]) reserved(shr) operator(()ident(i) reserved(and) integer(8)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(CardOfHex)operator(()ident(Hex)operator(:) reserved(string)operator(\))operator(:) ident(Cardinal)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - ident(Hex) operator(:=) ident(Copy)operator(()ident(ExtractChars)operator(()ident(Hex)operator(,) ident(HexadecimalChars)operator(\))operator(,) integer(1)operator(,) integer(8)operator(\))operator(;) - - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(Hex)operator(\)) reserved(do) - reserved(if) ident(Hex)operator([)ident(i)operator(]) operator(<>) char reserved(then) - ident(Inc)operator(()ident(Result)operator(,) ident(HexOrd)operator(()ident(Hex)operator([)ident(i)operator(])operator(\)) reserved(shl) operator(()operator(()ident(Length)operator(()ident(Hex)operator(\)) operator(-) ident(i)operator(\)) reserved(shl) integer(2)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(IntOfBin)operator(()ident(Bin)operator(:) reserved(string)operator(\))operator(:) ident(Cardinal)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - ident(Bin) operator(:=) ident(Copy)operator(()ident(ExtractChars)operator(()ident(Bin)operator(,) ident(BinaryChars)operator(\))operator(,) integer(1)operator(,) integer(32)operator(\))operator(;) - - reserved(for) ident(i) operator(:=) ident(Length)operator(()ident(Bin)operator(\)) reserved(downto) integer(1) reserved(do) - reserved(if) ident(Bin)operator([)ident(i)operator(]) operator(=) char reserved(then) - ident(Inc)operator(()ident(Result)operator(,) integer(1) reserved(shl) operator(()ident(Length)operator(()ident(Bin)operator(\)) operator(-) ident(i)operator(\))operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(BinOfInt)operator(()ident(n)operator(:) ident(Cardinal)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(a)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(n) operator(=) integer(0) reserved(then) reserved(begin) - ident(Result) operator(:=) charoperator(;) - ident(exit)operator(;) reserved(end)operator(;) - - ident(Result) operator(:=) stringoperator(;) - reserved(while) ident(n) operator(>) integer(0) reserved(do) reserved(begin) - ident(a) operator(:=) ident(n) reserved(and) integer(1)operator(;) - ident(Result) operator(:=) ident(Char)operator(()ident(a) operator(+) ident(Byte)operator(()charoperator(\))operator(\)) operator(+) ident(Result)operator(;) - ident(n) operator(:=) ident(n) reserved(shr) integer(1)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(BinOfIntFill)operator(()ident(n)operator(:) ident(Cardinal)operator(;) ident(MinCount)operator(:) ident(Integer) operator(=) integer(8)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(a)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(n) operator(=) integer(0) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(MulStr)operator(()charoperator(,) ident(MinCount)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(Result) operator(:=) stringoperator(;) - reserved(while) ident(n) operator(>) integer(0) reserved(do) reserved(begin) - ident(a) operator(:=) ident(n) reserved(and) integer(1)operator(;) - ident(Result) operator(:=) ident(Char)operator(()ident(a) operator(+) ident(Byte)operator(()charoperator(\))operator(\)) operator(+) ident(Result)operator(;) - ident(n) operator(:=) ident(n) reserved(shr) integer(1)operator(;) - reserved(end)operator(;) - ident(Result) operator(:=) ident(MulStr)operator(()charoperator(,) ident(MinCount) operator(-) ident(Length)operator(()ident(Result)operator(\))operator(\)) operator(+) ident(Result)operator(;) -reserved(end)operator(;) - -reserved(function) ident(BaseNOfInt)operator(()ident(I)operator(:) ident(Cardinal)operator(;) ident(B)operator(:) ident(TBaseN)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(a)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) operator(()ident(B) operator(<) integer(2)operator(\)) reserved(or) operator(()ident(i) operator(=) integer(0)operator(\)) reserved(then) reserved(begin) - ident(Result) operator(:=) charoperator(;) - ident(Exit)operator(;) reserved(end)operator(;) - - ident(Result) operator(:=) stringoperator(;) - reserved(while) ident(i) operator(>) integer(0) reserved(do) reserved(begin) - ident(a) operator(:=) ident(i) reserved(mod) ident(B)operator(;) - ident(Result) operator(:=) ident(BaseNChar)operator([)ident(a)operator(]) operator(+) ident(Result)operator(;) - ident(i) operator(:=) ident(i) reserved(div) ident(B)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(IntOfBaseN)operator(()ident(V)operator(:) reserved(string)operator(;) ident(B)operator(:) ident(TBaseN)operator(\))operator(:) ident(Cardinal)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) - ident(F)operator(:) ident(Cardinal)operator(;) - ident(c)operator(:) ident(Byte)operator(;) -reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - ident(V) operator(:=) ident(TrimAll)operator(()ident(V)operator(\))operator(;) - ident(F) operator(:=) integer(1)operator(;) - reserved(for) ident(i) operator(:=) ident(Length)operator(()ident(V)operator(\)) reserved(downto) integer(1) reserved(do) reserved(begin) - ident(c) operator(:=) ident(Byte)operator(()ident(UpCase)operator(()ident(V)operator([)ident(i)operator(])operator(\))operator(\))operator(;) - reserved(case) ident(Char)operator(()ident(c)operator(\)) reserved(of) - charoperator(..)charoperator(:) ident(c) operator(:=) ident(c) operator(-) integer(48)operator(;) - charoperator(..)charoperator(:) ident(c) operator(:=) ident(c) operator(-) integer(55)operator(;) - reserved(end)operator(;) - reserved(if) ident(c) operator(<) ident(B) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(Byte)operator(()ident(c)operator(\)) operator(*) ident(F)operator(;) - ident(F) operator(:=) ident(F) operator(*) ident(B)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(KeepIn)operator(()ident(i)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\))operator(:) ident(Variant)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(i)operator(;) - reserved(if) ident(Result) operator(>) ident(Top) reserved(then) - ident(Result) operator(:=) ident(Top) - reserved(else) reserved(if) ident(Result) operator(<) ident(Bottom) reserved(then) - ident(Result) operator(:=) ident(Bottom)operator(;) -reserved(end)operator(;) - -reserved(function) ident(InRange)operator(()ident(Value)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) operator(()ident(Value) operator(>=) ident(Bottom)operator(\)) reserved(and) operator(()ident(Value) operator(<=) ident(Top)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(InStrictRange)operator(()ident(Value)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) operator(()ident(Value) operator(>) ident(Bottom)operator(\)) reserved(and) operator(()ident(Value) operator(<) ident(Top)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(Min)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(Integer)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(A) operator(<) ident(B) reserved(then) - ident(Result) operator(:=) ident(A) - reserved(else) - ident(Result) operator(:=) ident(B)operator(;) -reserved(end)operator(;) - -reserved(function) ident(Min)operator(()reserved(const) ident(A)operator(:) ident(TIntA)operator(\))operator(:) ident(Integer)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - reserved(if) ident(Length)operator(()ident(A)operator(\)) operator(=) integer(0) reserved(then) - ident(Exit)operator(;) - - ident(Result) operator(:=) ident(A)operator([)integer(0)operator(])operator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) - reserved(if) ident(A)operator([)ident(i)operator(]) operator(<) ident(Result) reserved(then) - ident(Result) operator(:=) ident(A)operator([)ident(i)operator(])operator(;) -reserved(end)operator(;) - -reserved(function) ident(Max)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(Integer)operator(\))operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(A) operator(>) ident(B) reserved(then) - ident(Result) operator(:=) ident(A) - reserved(else) - ident(Result) operator(:=) ident(B)operator(;) -reserved(end)operator(;) - -reserved(function) ident(Max)operator(()reserved(const) ident(A)operator(:) ident(TIntA)operator(\))operator(:) ident(Integer)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - reserved(if) ident(Length)operator(()ident(A)operator(\)) operator(=) integer(0) reserved(then) - ident(Exit)operator(;) - - ident(Result) operator(:=) ident(A)operator([)integer(0)operator(])operator(;) - reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) - reserved(if) ident(A)operator([)ident(i)operator(]) operator(>) ident(Result) reserved(then) - ident(Result) operator(:=) ident(A)operator([)ident(i)operator(])operator(;) -reserved(end)operator(;) - -reserved(function) ident(RangesOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) ident(TRanges)operator(;) -reserved(var) - ident(SL)operator(:) ident(TStringList)operator(;) - ident(r)operator(,) ident(b)operator(,) ident(t)operator(:) reserved(string)operator(;) - ident(i)operator(,) ident(p)operator(:) ident(Integer)operator(;) - - reserved(function) ident(TryStrToCard)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) reserved(out) ident(Value)operator(:) ident(Cardinal)operator(\))operator(:) ident(Boolean)operator(;) - reserved(var) - ident(E)operator(:) ident(Integer)operator(;) - reserved(begin) - ident(Val)operator(()ident(S)operator(,) ident(Value)operator(,) ident(E)operator(\))operator(;) - ident(Result) operator(:=) ident(E) operator(=) integer(0)operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(Result) operator(:=) reserved(nil)operator(;) - ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) - reserved(try) - ident(Split)operator(()ident(S)operator(,) ident(RangesSeparator)operator(,) ident(SL)operator(\))operator(;) - ident(SetLength)operator(()ident(Result)operator(,) ident(SL)operator(.)ident(Count)operator(\))operator(;) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) - ident(r) operator(:=) ident(SL)operator([)ident(i)operator(])operator(;) - reserved(with) ident(Result)operator([)ident(i)operator(]) reserved(do) reserved(begin) - ident(p) operator(:=) ident(CharPos)operator(()ident(RangeInnerSeparator)operator(,) ident(r)operator(\))operator(;) - ident(Simple) operator(:=) ident(p) operator(=) integer(0)operator(;) comment(// no '-' found) - reserved(if) ident(Simple) reserved(then) reserved(begin) - reserved(if) ident(r) operator(=) ident(RangeInfinite) reserved(then) reserved(begin) comment(// * --> *-*) - ident(Simple) operator(:=) ident(False)operator(;) - ident(Bottom) operator(:=) ident(Low)operator(()ident(Bottom)operator(\))operator(;) - ident(Top) operator(:=) ident(High)operator(()ident(Top)operator(\))operator(;) - reserved(end) reserved(else) reserved(if) reserved(not) ident(TryStrToCard)operator(()ident(r)operator(,) ident(Value)operator(\)) reserved(then) - ident(Break)operator(;) - - reserved(end) reserved(else) reserved(begin) - ident(TileStr)operator(()ident(r)operator(,) ident(p)operator(,) ident(p)operator(,) ident(b)operator(,) ident(t)operator(\))operator(;) - - reserved(if) ident(b) operator(=) ident(RangeInfinite) reserved(then) - ident(Bottom) operator(:=) ident(Low)operator(()ident(Bottom)operator(\)) - reserved(else) reserved(if) reserved(not) ident(TryStrToCard)operator(()ident(b)operator(,) ident(Bottom)operator(\)) reserved(then) - ident(Break)operator(;) - - reserved(if) ident(t) operator(=) ident(RangeInfinite) reserved(then) - ident(Top) operator(:=) ident(High)operator(()ident(Top)operator(\)) - reserved(else) reserved(if) reserved(not) ident(TryStrToCard)operator(()ident(t)operator(,) ident(Top)operator(\)) reserved(then) - ident(Break)operator(;) - reserved(if) ident(Bottom) operator(>) ident(Top) reserved(then) reserved(begin) - ident(p) operator(:=) ident(Bottom)operator(;) ident(Bottom) operator(:=) ident(Top)operator(;) ident(Top) operator(:=) ident(p)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) ident(i) operator(<>) ident(SL)operator(.)ident(Count) reserved(then) - ident(Result) operator(:=) reserved(nil)operator(;) - - reserved(finally) - ident(SL)operator(.)ident(Free)operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(function) ident(InRanges)operator(()ident(Ranges)operator(:) ident(TRanges)operator(;) ident(TestValue)operator(:) ident(Cardinal)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(True)operator(;) - - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Ranges)operator(\)) reserved(do) - reserved(with) ident(Ranges)operator([)ident(i)operator(]) reserved(do) - reserved(if) ident(Simple) reserved(then) reserved(begin) - reserved(if) ident(TestValue) operator(=) ident(Value) reserved(then) - ident(Exit)operator(;) - reserved(end) reserved(else) reserved(begin) - reserved(if) ident(InRange)operator(()ident(TestValue)operator(,) ident(Bottom)operator(,) ident(Top)operator(\)) reserved(then) - ident(Exit)operator(;) - reserved(end)operator(;) - - ident(Result) operator(:=) ident(False)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(WriteSL)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) reserved(const) ident(Prefix)operator(:) reserved(string) operator(=) stringoperator(;) - reserved(const) ident(Suffix)operator(:) reserved(string) operator(=) stringoperator(\))operator(;) -reserved(var) - ident(i)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Strings)operator(.)ident(Count)operator(-)integer(1) reserved(do) - ident(WriteLn)operator(()ident(Prefix) operator(+) ident(Strings)operator([)ident(i)operator(]) operator(+) ident(Suffix)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(Success)operator(()ident(Res)operator(:) ident(Integer)operator(;) ident(ResultOnSuccess)operator(:) ident(Integer) operator(=) ident(ERROR_SUCCESS)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) operator(()ident(Res) operator(=) ident(ResultOnSuccess)operator(\))operator(;) - ident(LastSuccessRes) operator(:=) ident(Res)operator(;) -reserved(end)operator(;) - -reserved(function) ident(Failure)operator(()ident(Res)operator(:) ident(Integer)operator(;) ident(ResultOnSuccess)operator(:) ident(Integer) operator(=) ident(ERROR_SUCCESS)operator(\))operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) reserved(not) ident(Success)operator(()ident(Res)operator(,) ident(ResultOnSuccess)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(ExpandString)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(Len)operator(:) ident(Integer)operator(;) - ident(P)operator(,) ident(Res)operator(:) ident(PChar)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(P) operator(:=) ident(PChar)operator(()ident(S)operator(\))operator(;) - ident(Len) operator(:=) ident(ExpandEnvironmentStrings)operator(()ident(P)operator(,) reserved(nil)operator(,) integer(0)operator(\))operator(;) - reserved(if) ident(Len) operator(=) integer(0) reserved(then) - ident(Exit)operator(;) - - ident(GetMem)operator(()ident(Res)operator(,) ident(Len)operator(\))operator(;) - ident(ExpandEnvironmentStrings)operator(()ident(P)operator(,) ident(Res)operator(,) ident(Len)operator(\))operator(;) - - ident(Result) operator(:=) ident(Res)operator(;) - ident(FreeMem)operator(()ident(Res)operator(,) ident(Len)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(FindAll)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) reserved(const) ident(Mask)operator(:) reserved(string)operator(;) - ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(;) - ident(FileReturn)operator(:) ident(TFileNameFunc) operator(=) reserved(nil)operator(\))operator(:) ident(Boolean)operator(;) -reserved(var) - ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(;) - - reserved(procedure) ident(ScanDir)operator(()reserved(const) ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(\))operator(;) - reserved(var) - ident(PSR)operator(:) ident(TSearchRec)operator(;) - ident(Res)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\))operator(;) - reserved(begin) - reserved(if) ident(S) operator(<>) string reserved(then) - ident(Strings)operator(.)ident(Add)operator(()ident(S)operator(\))operator(;) - reserved(end)operator(;) - - reserved(begin) - ident(Res) operator(:=) ident(FindFirst)operator(()ident(Path) operator(+) ident(FileName)operator(,) ident(Attributes)operator(,) ident(PSR)operator(\))operator(;) - reserved(while) ident(Success)operator(()ident(Res)operator(,) integer(0)operator(\)) reserved(do) reserved(begin) - reserved(if) ident(Assigned)operator(()ident(FileReturn)operator(\)) reserved(then) - ident(Add)operator(()ident(FileReturn)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(\))operator(\)) - reserved(else) - ident(Add)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(\))operator(;) - ident(Res) operator(:=) ident(FindNext)operator(()ident(PSR)operator(\))operator(;) - reserved(end)operator(;) - ident(FindClose)operator(()ident(PSR)operator(\))operator(;) - reserved(if) reserved(not) ident(ScanSubDirs) reserved(then) - ident(Exit)operator(;) - - ident(Res) operator(:=) ident(FindFirst)operator(()ident(Path) operator(+) charoperator(,) ident(faDirectory)operator(,) ident(PSR)operator(\))operator(;) - reserved(while) ident(Success)operator(()ident(Res)operator(,) integer(0)operator(\)) reserved(do) reserved(begin) - reserved(if) operator(()ident(PSR)operator(.)ident(Attr) reserved(and) ident(faDirectory) operator(>) integer(0)operator(\)) - reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) charoperator(\)) reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) stringoperator(\)) reserved(then) - ident(ScanDir)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name) operator(+) charoperator(,) ident(FileName)operator(\))operator(;) - ident(Res) operator(:=) ident(FindNext)operator(()ident(PSR)operator(\))operator(;) - reserved(end)operator(;) - ident(FindClose)operator(()ident(PSR)operator(\))operator(;) - reserved(end)operator(;) - -reserved(begin) - ident(Strings)operator(.)ident(Clear)operator(;) - ident(Path) operator(:=) ident(ExtractPath)operator(()ident(Mask)operator(\))operator(;) - ident(FileName) operator(:=) ident(ExtractFileName)operator(()ident(Mask)operator(\))operator(;) - ident(ScanDir)operator(()ident(Path)operator(,) ident(FileName)operator(\))operator(;) - ident(Result) operator(:=) ident(Strings)operator(.)ident(Count) operator(>) integer(0)operator(;) -reserved(end)operator(;) - -reserved(function) ident(FindAllFirst)operator(()reserved(const) ident(Mask)operator(:) reserved(string)operator(;) ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) - ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(;) - - reserved(function) ident(ScanDir)operator(()reserved(const) ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(\))operator(:) ident(Boolean)operator(;) - reserved(var) - ident(PSR)operator(:) ident(TSearchRec)operator(;) - ident(Res)operator(:) ident(Integer)operator(;) - reserved(begin) - ident(Result) operator(:=) ident(False)operator(;) - reserved(if) ident(Success)operator(()ident(FindFirst)operator(()ident(Path) operator(+) ident(FileName)operator(,) ident(Attributes)operator(,) ident(PSR)operator(\))operator(,) integer(0)operator(\)) reserved(then) reserved(begin) - ident(FindAllFirst) operator(:=) ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(;) - ident(Result) operator(:=) ident(True)operator(;) - ident(FindClose)operator(()ident(PSR)operator(\))operator(;) - ident(Exit)operator(;) reserved(end)operator(;) - reserved(if) reserved(not) ident(ScanSubDirs) reserved(then) - ident(Exit)operator(;) - - ident(Res) operator(:=) ident(FindFirst)operator(()ident(Path) operator(+) charoperator(,) ident(faDirectory)operator(,) ident(PSR)operator(\))operator(;) - reserved(while) reserved(not) ident(Result) reserved(and) ident(Success)operator(()ident(Res)operator(,) integer(0)operator(\)) reserved(do) reserved(begin) - reserved(if) operator(()ident(PSR)operator(.)ident(Attr) reserved(and) ident(faDirectory) operator(>) integer(0)operator(\)) - reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) charoperator(\)) reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) stringoperator(\)) reserved(then) - ident(Result) operator(:=) ident(ScanDir)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name) operator(+) charoperator(,) ident(FileName)operator(\))operator(;) - ident(Res) operator(:=) ident(FindNext)operator(()ident(PSR)operator(\))operator(;) - reserved(end)operator(;) - ident(FindClose)operator(()ident(PSR)operator(\))operator(;) - reserved(end)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(Path) operator(:=) ident(ExtractPath)operator(()ident(Mask)operator(\))operator(;) - ident(FileName) operator(:=) ident(ExtractFileName)operator(()ident(Mask)operator(\))operator(;) - ident(ScanDir)operator(()ident(Path)operator(,) ident(FileName)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(DeleteFiles)operator(()reserved(const) ident(Mask)operator(:) reserved(string)operator(;) ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) - ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(\))operator(;) -reserved(var) - ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(;) - - reserved(procedure) ident(ScanDir)operator(()reserved(const) ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(\))operator(;) - reserved(var) - ident(PSR)operator(:) ident(TSearchRec)operator(;) - ident(Res)operator(:) ident(Integer)operator(;) - - reserved(procedure) ident(TryDeleteFile)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(;) - reserved(begin) - reserved(try) - ident(DeleteFile)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(\))operator(;) - reserved(except) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(begin) - ident(Res) operator(:=) ident(FindFirst)operator(()ident(Path) operator(+) ident(FileName)operator(,) ident(Attributes)operator(,) ident(PSR)operator(\))operator(;) - reserved(while) ident(Success)operator(()ident(Res)operator(,) integer(0)operator(\)) reserved(do) reserved(begin) - ident(TryDeleteFile)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(\))operator(;) - ident(Res) operator(:=) ident(FindNext)operator(()ident(PSR)operator(\))operator(;) - reserved(end)operator(;) - ident(FindClose)operator(()ident(PSR)operator(\))operator(;) - reserved(if) reserved(not) ident(ScanSubDirs) reserved(then) - ident(Exit)operator(;) - - ident(Res) operator(:=) ident(FindFirst)operator(()ident(Path) operator(+) charoperator(,) ident(faDirectory)operator(,) ident(PSR)operator(\))operator(;) - reserved(while) ident(Success)operator(()ident(Res)operator(,) integer(0)operator(\)) reserved(do) reserved(begin) - reserved(if) operator(()ident(PSR)operator(.)ident(Attr) reserved(and) ident(faDirectory) operator(>) integer(0)operator(\)) - reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) charoperator(\)) reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) stringoperator(\)) reserved(then) reserved(begin) - ident(ScanDir)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name) operator(+) charoperator(,) ident(FileName)operator(\))operator(;) - ident(TryDeleteFile)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(\))operator(;) - reserved(end)operator(;) - ident(Res) operator(:=) ident(FindNext)operator(()ident(PSR)operator(\))operator(;) - reserved(end)operator(;) - ident(FindClose)operator(()ident(PSR)operator(\))operator(;) - reserved(end)operator(;) -reserved(begin) - ident(Path) operator(:=) ident(ExtractPath)operator(()ident(Mask)operator(\))operator(;) - ident(FileName) operator(:=) ident(ExtractFileName)operator(()ident(Mask)operator(\))operator(;) - ident(ScanDir)operator(()ident(Path)operator(,) ident(FileName)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(GetFileNew)operator(()ident(FileName)operator(:) reserved(string)operator(;) ident(NoFloppyDrives)operator(:) ident(Boolean) operator(=) ident(True)operator(\))operator(:) reserved(string)operator(;) -reserved(var) - ident(Drive)operator(:) reserved(string)operator(;) - ident(pf)operator(,) ident(pd)operator(,) ident(Len)operator(:) ident(Integer)operator(;) - ident(PSR)operator(:) ident(TSearchRec)operator(;) -reserved(begin) - ident(Result) operator(:=) stringoperator(;) - ident(FileName) operator(:=) ident(Trim)operator(()ident(FileName)operator(\))operator(;) - reserved(if) ident(Length)operator(()ident(FileName)operator(\)) operator(<) integer(2) reserved(then) - ident(Exit)operator(;) - - ident(Drive) operator(:=) ident(ExtractDrive)operator(()ident(FileName)operator(\))operator(;) - reserved(if) reserved(not) ident(DirectoryExists)operator(()ident(Drive)operator(\)) reserved(then) - ident(Exit)operator(;) - - reserved(if) ident(NoFloppyDrives) reserved(and) operator(()ident(Drive)operator([)integer(1)operator(]) reserved(in) operator([)charoperator(,) charoperator(])operator(\)) reserved(then) - ident(Exit)operator(;) - - ident(Len) operator(:=) ident(Length)operator(()ident(FileName)operator(\))operator(;) - ident(Result) operator(:=) ident(Drive)operator(;) - ident(pf) operator(:=) ident(Length)operator(()ident(Drive)operator(\)) operator(+) integer(1)operator(;) - reserved(while) ident(pf) operator(<=) ident(Len) reserved(do) reserved(begin) - reserved(if) ident(FileName)operator([)ident(pf)operator(]) operator(=) char reserved(then) reserved(begin) - ident(Result) operator(:=) ident(Result) operator(+) charoperator(;) - ident(Inc)operator(()ident(pf)operator(\))operator(;) - ident(Continue)operator(;) reserved(end)operator(;) - - ident(pd) operator(:=) ident(CharPos)operator(()charoperator(,) ident(FileName)operator(,) ident(pf)operator(\))operator(;) - reserved(if) ident(pd) operator(=) integer(0) reserved(then) reserved(begin) - reserved(if) integer(0)operator(=)ident(FindFirst)operator(()ident(Result) operator(+) ident(Copy)operator(()ident(FileName)operator(,) ident(pf)operator(,) ident(MaxInt)operator(\))operator(,) ident(faFindEveryFile)operator(,) ident(PSR)operator(\)) reserved(then) reserved(begin) - ident(Result) operator(:=) ident(Result) operator(+) ident(PSR)operator(.)ident(Name)operator(;) - ident(Break)operator(;) reserved(end) reserved(else) reserved(begin) - ident(FindClose)operator(()ident(PSR)operator(\))operator(;) - reserved(if) integer(0)operator(=)ident(FindFirst)operator(()ident(Result) operator(+) ident(Copy)operator(()ident(FileName)operator(,) ident(pf)operator(,) ident(MaxInt)operator(\))operator(,) ident(faDirectory)operator(,) ident(PSR)operator(\)) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(PSR)operator(.)ident(Name) operator(+) char - reserved(else) - ident(Result) operator(:=) stringoperator(;) - ident(FindClose)operator(()ident(PSR)operator(\))operator(;) - reserved(if) ident(Result) operator(=) string reserved(then) - ident(Break)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - - reserved(if) integer(0)operator(=)ident(FindFirst)operator(()ident(Result) operator(+) ident(Copy)operator(()ident(FileName)operator(,) ident(pf)operator(,) ident(pd) operator(-) ident(pf)operator(\))operator(,) ident(faDirectory)operator(,) ident(PSR)operator(\)) reserved(then) - ident(Result) operator(:=) ident(Result) operator(+) ident(PSR)operator(.)ident(Name) operator(+) char - reserved(else) - ident(Result) operator(:=) stringoperator(;) - ident(FindClose)operator(()ident(PSR)operator(\))operator(;) - reserved(if) ident(Result) operator(=) string reserved(then) - ident(Break)operator(;) - - ident(pf) operator(:=) ident(pd) operator(+) integer(1)operator(;) - reserved(end)operator(;) - - reserved(if) operator(()ident(Result) operator(<>) stringoperator(\)) reserved(and) reserved(not) ident(FileEx)operator(()ident(Result)operator(,) ident(True)operator(\)) reserved(then) - ident(Result) operator(:=) stringoperator(;) -reserved(end)operator(;) - -reserved(function) ident(DateTimeOfFileTime)operator(()reserved(const) ident(FileTime)operator(:) ident(TFileTime)operator(\))operator(:) ident(TDateTime)operator(;) -reserved(var) - ident(LocalFileTime)operator(:) ident(TFileTime)operator(;) - ident(Res)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - - ident(FileTimeToLocalFileTime)operator(()ident(FileTime)operator(,) ident(LocalFileTime)operator(\))operator(;) - reserved(if) reserved(not) ident(FileTimeToDosDateTime)operator(()ident(LocalFileTime)operator(,) ident(LongRec)operator(()ident(Res)operator(\))operator(.)ident(Hi)operator(,) - ident(LongRec)operator(()ident(Res)operator(\))operator(.)ident(Lo)operator(\)) reserved(then) - ident(Res) operator(:=) operator(-)integer(1)operator(;) - - reserved(if) operator(()ident(Res) operator(=) operator(-)integer(1)operator(\)) reserved(or) operator(()ident(Res) operator(=) integer(0)operator(\)) reserved(then) - ident(Exit)operator(;) - reserved(try) - ident(Result) operator(:=) ident(FileDateToDateTime)operator(()ident(Res)operator(\))operator(;) - reserved(except) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(FileNew)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\))operator(;) -reserved(var) - ident(Handle)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(Handle) operator(:=) ident(FileCreate)operator(()ident(FileName)operator(\))operator(;) - ident(FileClose)operator(()ident(Handle)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(Win32PlatformStr)operator(:) reserved(string)operator(;) -reserved(const) - ident(PlatformStrings)operator(:) reserved(array)operator([)ident(VER_PLATFORM_WIN32s)operator(..)ident(VER_PLATFORM_WIN32_NT)operator(]) reserved(of) reserved(string) operator(=) - operator(()stringoperator(,) stringoperator(,) stringoperator(\))operator(;) -reserved(begin) - ident(Result) operator(:=) ident(PlatformStrings)operator([)ident(Win32Platform)operator(])operator(;) -reserved(end)operator(;) - -reserved(function) ident(FullOSInfo)operator(:) reserved(string)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Format)operator(() - string operator(+) ident(EOL) operator(+) - string operator(+) ident(EOL) operator(+) - stringoperator(,) - operator([) - ident(Win32PlatformStr)operator(,) - ident(Win32MajorVersion)operator(,) ident(Win32MinorVersion)operator(,) ident(Win32BuildNumber)operator(,) - ident(Win32CSDVersion) - operator(]) - operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(Win9x)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Win32Platform) operator(=) ident(VER_PLATFORM_WIN32_WINDOWS)operator(;) -reserved(end)operator(;) - -reserved(function) ident(WinNT)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Win32Platform) operator(=) ident(VER_PLATFORM_WIN32_NT)operator(;) -reserved(end)operator(;) - -reserved(function) ident(Win2000)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) operator(()ident(Win32Platform) operator(=) ident(VER_PLATFORM_WIN32_NT)operator(\)) - reserved(and) operator(()ident(Win32MajorVersion) operator(=) integer(4)operator(\))operator(;) -reserved(end)operator(;) - -reserved(function) ident(WinXP)operator(:) ident(Boolean)operator(;) -reserved(begin) - ident(Result) operator(:=) ident(Win32MajorVersion) operator(>=) integer(5)operator(;) -reserved(end)operator(;) - -reserved(initialization) - ident(MyDir) operator(:=) ident(GetMyDir)operator(;) - -reserved(end)operator(.) - -reserved(unit) ident(FifoStream)operator(;) - -reserved(interface) - -reserved(uses) ident(Classes)operator(,) ident(windows)operator(,) ident(Dialogs)operator(;) - -reserved(const) - ident(DefaultChunksize) operator(=) integer(32768)operator(;) comment(// 32kb per chunk as default.) - -reserved(type) - ident(PMemChunk) operator(=) operator(^)ident(TMemChunk)operator(;) - ident(TMemChunk) operator(=) reserved(record) - ident(Filled)operator(:) ident(Longword)operator(;) - directive(Read)operator(:) ident(Longword)operator(;) - ident(Data)operator(:) ident(pointer)operator(;) - reserved(end)operator(;) - - ident(TFifo) operator(=) reserved(class) - directive(private) - ident(FBuffers)operator(:) ident(TList)operator(;) - ident(FChunksize)operator(:) ident(Longword)operator(;) - ident(FCritSect)operator(:) ident(TRTLCriticalSection)operator(;) - ident(FIsWinNT)operator(:) ident(boolean)operator(;) - ident(FBytesInFifo)operator(:) ident(LongWord)operator(;) - directive(protected) - reserved(function) ident(GetBytesInFifo)operator(:) ident(LongWord)operator(;) - directive(public) - reserved(constructor) ident(Create)operator(;) - reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) - reserved(procedure) ident(Write)operator(()ident(Data)operator(:) ident(pointer)operator(;) ident(Size)operator(:) ident(LongWord)operator(\))operator(;) - reserved(procedure) ident(Read)operator(()ident(Buff)operator(:) ident(pointer)operator(;) reserved(var) ident(ReqSize)operator(:) ident(LongWord)operator(\))operator(;) - reserved(procedure) ident(PeekData)operator(()ident(Buff)operator(:) ident(pointer)operator(;) reserved(var) ident(ReqSize)operator(:) ident(LongWord)operator(\))operator(;) - directive(published) - reserved(property) ident(BytesInFifo)operator(:) ident(LongWord) directive(read) ident(FBytesInFifo)operator(;) - reserved(end)operator(;) - -reserved(implementation) - -reserved(constructor) ident(TFifo)operator(.)ident(Create)operator(;) -reserved(begin) - reserved(inherited)operator(;) - ident(FBuffers) operator(:=) ident(TList)operator(.)ident(Create)operator(;) - comment(// set default chunksize...) - ident(FChunksize) operator(:=) ident(DefaultChunksize)operator(;) - ident(InitializeCriticalSection)operator(()ident(FCritSect)operator(\))operator(;) -reserved(end)operator(;) - -reserved(destructor) ident(TFifo)operator(.)ident(Destroy)operator(;) -reserved(var) - ident(I)operator(:) ident(Integer)operator(;) -reserved(begin) - ident(EnterCriticalSection)operator(()ident(FCritSect)operator(\))operator(;) - reserved(for) ident(I) operator(:=) integer(0) reserved(to) ident(FBuffers)operator(.)ident(count) operator(-) integer(1) reserved(do) - reserved(begin) - ident(FreeMem)operator(()ident(PMemChunk)operator(()ident(Fbuffers)operator([)ident(I)operator(])operator(\))operator(.)ident(Data)operator(\))operator(;) - ident(Dispose)operator(()ident(PMemChunk)operator(()ident(Fbuffers)operator([)ident(I)operator(])operator(\))operator(\))operator(;) - reserved(end)operator(;) - ident(FBuffers)operator(.)ident(Clear)operator(;) - ident(FBuffers)operator(.)ident(Free)operator(;) - ident(LeaveCriticalSection)operator(()ident(FCritSect)operator(\))operator(;) - - ident(DeleteCriticalSection)operator(()ident(FCritSect)operator(\))operator(;) - reserved(inherited)operator(;) -reserved(end)operator(;) - -reserved(function) ident(TFifo)operator(.)ident(GetBytesInFifo)operator(:) ident(LongWord)operator(;) -reserved(begin) - ident(Result) operator(:=) integer(0)operator(;) - reserved(if) ident(FBuffers)operator(.)ident(Count) operator(=) integer(0) reserved(then) - reserved(begin) - ident(exit)operator(;) - reserved(end) - reserved(else) - reserved(begin) - reserved(if) ident(FBuffers)operator(.)ident(Count) operator(>) integer(1) reserved(then) - ident(Inc)operator(()ident(Result)operator(,) operator(()ident(FBuffers)operator(.)ident(Count) operator(-) integer(1)operator(\)) operator(*) ident(FChunkSize)operator(\))operator(;) - ident(Inc)operator(()ident(Result)operator(,) ident(PMemChunk)operator(()ident(FBuffers)operator([)ident(Fbuffers)operator(.)ident(Count) operator(-) integer(1)operator(])operator(\))operator(.)ident(Filled)operator(\))operator(;) - ident(Dec)operator(()ident(Result)operator(,) ident(PMemChunk)operator(()ident(FBuffers)operator([)integer(0)operator(])operator(\))operator(.)ident(Read)operator(\))operator(;) - reserved(end)operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFifo)operator(.)ident(Write)operator(()ident(Data)operator(:) ident(pointer)operator(;) ident(Size)operator(:) ident(LongWord)operator(\))operator(;) -reserved(var) - ident(Privpointer)operator(:) ident(pointer)operator(;) - ident(PrivSize)operator(:) ident(LongWord)operator(;) - ident(Chunk)operator(:) ident(PMemChunk)operator(;) - ident(PosInChunk)operator(:) ident(pointer)operator(;) -reserved(begin) - reserved(if) ident(LongWord)operator(()ident(Data)operator(\)) operator(=) integer(0) reserved(then) - reserved(begin) - comment(// null pointer? somebody is trying to fool us, get out...) - ident(Exit)operator(;) - reserved(end)operator(;) - ident(EnterCriticalSection)operator(()ident(FCritSect)operator(\))operator(;) - ident(PrivPointer) operator(:=) ident(Data)operator(;) - ident(PrivSize) operator(:=) integer(0)operator(;) - comment(// are already buffers there?) - reserved(if) ident(FBuffers)operator(.)ident(count) operator(>) integer(0) reserved(then) - reserved(begin) - comment(// is the last one of them not completely filled?) - reserved(if) ident(PMemChunk)operator(()ident(FBuffers)operator([)ident(FBuffers)operator(.)ident(count) operator(-) integer(1)operator(])operator(\))operator(.)ident(filled) operator(<) ident(FChunksize) reserved(then) - comment(// not completely filled, so fill up the buffer.) - reserved(begin) - ident(Chunk) operator(:=) ident(PMemChunk)operator(()ident(FBuffers)operator([)ident(FBuffers)operator(.)ident(count) operator(-) integer(1)operator(])operator(\))operator(;) - comment(// fetch chunkdata.) - ident(PosInChunk) operator(:=) ident(Chunk)operator(.)ident(Data)operator(;) - comment(// move to current fill pos...) - ident(Inc)operator(()ident(LongWord)operator(()ident(PosInChunk)operator(\))operator(,) ident(Chunk)operator(.)ident(Filled)operator(\))operator(;) - comment(// can we fill the chunk completely?) - reserved(if) ident(Size) operator(>) ident(FChunksize) operator(-) ident(Chunk)operator(.)ident(Filled) reserved(then) - reserved(begin) - comment(// yes we can.) - ident(Move)operator(()ident(PrivPointer)operator(^)operator(,) ident(PosInChunk)operator(^)operator(,) ident(FChunksize) operator(-) ident(Chunk)operator(.)ident(Filled)operator(\))operator(;) - ident(Inc)operator(()ident(PrivSize)operator(,) ident(FChunksize) operator(-) ident(Chunk)operator(.)ident(Filled)operator(\))operator(;) - ident(Inc)operator(()ident(LongWord)operator(()ident(PrivPointer)operator(\))operator(,) ident(FChunksize) operator(-) ident(Chunk)operator(.)ident(Filled)operator(\))operator(;) - ident(Chunk)operator(.)ident(Filled) operator(:=) ident(FChunkSize)operator(;) - reserved(end) - reserved(else) - comment(// we have to less data for filling the chunk completely,) - comment(// just put everything in.) - reserved(begin) - ident(Move)operator(()ident(PrivPointer)operator(^)operator(,) ident(PosInChunk)operator(^)operator(,) ident(Size)operator(\))operator(;) - ident(Inc)operator(()ident(PrivSize)operator(,) ident(Size)operator(\))operator(;) - ident(Inc)operator(()ident(Chunk)operator(.)ident(Filled)operator(,) ident(Size)operator(\))operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - comment(// as long as we have remaining stuff put it into new chunks.) - reserved(while) operator(()ident(PrivSize) operator(<) ident(Size)operator(\)) reserved(do) - reserved(begin) - ident(new)operator(()ident(Chunk)operator(\))operator(;) - ident(GetMem)operator(()ident(Chunk)operator(.)ident(Data)operator(,) ident(FChunksize)operator(\))operator(;) - ident(Chunk)operator(.)ident(Read) operator(:=) integer(0)operator(;) - comment(// can we fill an entire chunk with the remaining data?) - reserved(if) ident(Privsize) operator(+) ident(FChunksize) operator(<) ident(Size) reserved(then) - reserved(begin) - comment(// yes we can, so put the stuff in.) - ident(Move)operator(()ident(Privpointer)operator(^)operator(,) ident(Chunk)operator(.)ident(Data)operator(^)operator(,) ident(FChunksize)operator(\))operator(;) - ident(Inc)operator(()ident(LongWord)operator(()ident(PrivPointer)operator(\))operator(,) ident(FChunksize)operator(\))operator(;) - ident(Inc)operator(()ident(PrivSize)operator(,) ident(FChunksize)operator(\))operator(;) - ident(Chunk)operator(.)ident(Filled) operator(:=) ident(FChunksize)operator(;) - reserved(end) - reserved(else) comment(// we have to less data to fill the entire chunk, just put the remaining stuff in.) - reserved(begin) - ident(Move)operator(()ident(Privpointer)operator(^)operator(,) ident(Chunk)operator(.)ident(Data)operator(^)operator(,) ident(Size) operator(-) ident(Privsize)operator(\))operator(;) - ident(Chunk)operator(.)ident(Filled) operator(:=) ident(Size) operator(-) ident(Privsize)operator(;) - ident(Inc)operator(()ident(PrivSize)operator(,) ident(Size) operator(-) ident(Privsize)operator(\))operator(;) - reserved(end)operator(;) - ident(Fbuffers)operator(.)ident(Add)operator(()ident(Chunk)operator(\))operator(;) - reserved(end)operator(;) - reserved(if) ident(Size) operator(<>) ident(Privsize) reserved(then) - ident(Showmessage)operator(()stringoperator(\))operator(;) - ident(FBytesInFifo) operator(:=) ident(GetBytesInFifo)operator(;) - ident(LeaveCriticalSection)operator(()ident(FCritSect)operator(\))operator(;) -reserved(end)operator(;) - -reserved(procedure) ident(TFifo)operator(.)ident(Read)operator(()ident(Buff)operator(:) ident(pointer)operator(;) reserved(var) ident(ReqSize)operator(:) ident(LongWord)operator(\))operator(;) -reserved(var) - ident(PrivSize)operator(:) ident(Integer)operator(;) - ident(Privpos)operator(:) ident(pointer)operator(;) - ident(Chunk)operator(:) ident(PMemChunk)operator(;) - ident(ChunkPos)operator(:) ident(pointer)operator(;) -reserved(begin) - reserved(if) ident(LongWord)operator(()ident(Buff)operator(\)) operator(=) integer(0) reserved(then) - reserved(begin) - comment(// null pointer? somebody is trying to fool us, get out...) - ident(Exit)operator(;) - reserved(end)operator(;) - ident(EnterCriticalSection)operator(()ident(FCritSect)operator(\))operator(;) - ident(PrivSize) operator(:=) integer(0)operator(;) - ident(Privpos) operator(:=) ident(Buff)operator(;) - reserved(while) ident(FBuffers)operator(.)ident(Count) operator(>) integer(0) reserved(do) - reserved(begin) - ident(Chunk) operator(:=) ident(PMemChunk)operator(()ident(FBuffers)operator([)integer(0)operator(])operator(\))operator(;) - ident(ChunkPos) operator(:=) ident(Chunk)operator(.)ident(data)operator(;) - ident(Inc)operator(()ident(LongWord)operator(()ident(ChunkPos)operator(\))operator(,) ident(Chunk)operator(.)ident(Read)operator(\))operator(;) - comment(// does the remaining part of the chunk fit into the buffer?) - reserved(if) ident(PrivSize) operator(+) operator(()ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)ident(read)operator(\)) operator(<) ident(ReqSize) reserved(then) - reserved(begin) comment(// yep, it fits) - ident(Move)operator(()ident(ChunkPos)operator(^)operator(,) ident(Privpos)operator(^)operator(,) ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)ident(read)operator(\))operator(;) - ident(Inc)operator(()ident(PrivSize)operator(,) ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)ident(read)operator(\))operator(;) - ident(FreeMem)operator(()ident(Chunk)operator(.)ident(Data)operator(\))operator(;) - ident(Dispose)operator(()ident(Chunk)operator(\))operator(;) - ident(FBuffers)operator(.)ident(Delete)operator(()integer(0)operator(\))operator(;) - reserved(end) - reserved(else) comment(// remaining part didn't fit, get as much as we can and increment the) - comment(// read attribute.) - reserved(begin) - ident(Move)operator(()ident(ChunkPos)operator(^)operator(,) ident(Privpos)operator(^)operator(,) ident(ReqSize) operator(-) ident(PrivSize)operator(\))operator(;) - ident(Inc)operator(()ident(Chunk)operator(.)ident(read)operator(,) ident(ReqSize) operator(-) ident(PrivSize)operator(\))operator(;) - ident(Inc)operator(()ident(PrivSize)operator(,) ident(ReqSize) operator(-) ident(PrivSize)operator(\))operator(;) - comment(// as we filled the buffer, we'll have to break here.) - ident(break)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - ident(FBytesInFifo) operator(:=) ident(GetBytesInFifo)operator(;) - ident(LeaveCriticalSection)operator(()ident(FCritSect)operator(\))operator(;) - ident(ReqSize) operator(:=) ident(PrivSize)operator(;) -reserved(end)operator(;) - -comment(// read Data from Stream without removing it from the Stream...) - -reserved(procedure) ident(TFifo)operator(.)ident(PeekData)operator(()ident(Buff)operator(:) ident(pointer)operator(;) reserved(var) ident(ReqSize)operator(:) ident(LongWord)operator(\))operator(;) -reserved(var) - ident(PrivSize)operator(:) ident(Integer)operator(;) - ident(Privpos)operator(:) ident(pointer)operator(;) - ident(Chunk)operator(:) ident(PMemChunk)operator(;) - ident(ChunkPos)operator(:) ident(pointer)operator(;) - ident(ChunkNr)operator(:) ident(Integer)operator(;) -reserved(begin) - reserved(if) ident(LongWord)operator(()ident(Buff)operator(\)) operator(=) integer(0) reserved(then) - reserved(begin) - comment(// null pointer? somebody is trying to fool us, get out...) - ident(Exit)operator(;) - reserved(end)operator(;) - ident(EnterCriticalSection)operator(()ident(FCritSect)operator(\))operator(;) - ident(PrivSize) operator(:=) integer(0)operator(;) - ident(Privpos) operator(:=) ident(Buff)operator(;) - ident(ChunkNr) operator(:=) integer(0)operator(;) - reserved(while) ident(FBuffers)operator(.)ident(Count) operator(>) ident(ChunkNr) reserved(do) - reserved(begin) - ident(Chunk) operator(:=) ident(PMemChunk)operator(()ident(FBuffers)operator([)ident(ChunkNr)operator(])operator(\))operator(;) - ident(ChunkPos) operator(:=) ident(Chunk)operator(.)ident(data)operator(;) - ident(Inc)operator(()ident(LongWord)operator(()ident(ChunkPos)operator(\))operator(,) ident(Chunk)operator(.)ident(Read)operator(\))operator(;) - comment(// does the remaining part of the chunk fit into the buffer?) - reserved(if) ident(PrivSize) operator(+) operator(()ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)ident(read)operator(\)) operator(<) ident(ReqSize) reserved(then) - reserved(begin) comment(// yep, it fits) - ident(Move)operator(()ident(ChunkPos)operator(^)operator(,) ident(Privpos)operator(^)operator(,) ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)ident(read)operator(\))operator(;) - ident(Inc)operator(()ident(PrivSize)operator(,) ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)ident(read)operator(\))operator(;) - ident(Inc)operator(()ident(ChunkNr)operator(\))operator(;) - reserved(end) - reserved(else) comment(// remaining part didn't fit, get as much as we can and increment the) - comment(// read attribute.) - reserved(begin) - ident(Move)operator(()ident(ChunkPos)operator(^)operator(,) ident(Privpos)operator(^)operator(,) ident(ReqSize) operator(-) ident(PrivSize)operator(\))operator(;) - ident(Inc)operator(()ident(PrivSize)operator(,) ident(ReqSize) operator(-) ident(PrivSize)operator(\))operator(;) - comment(// as we filled the buffer, we'll have to break here.) - ident(break)operator(;) - reserved(end)operator(;) - reserved(end)operator(;) - ident(LeaveCriticalSection)operator(()ident(FCritSect)operator(\))operator(;) - ident(ReqSize) operator(:=) ident(PrivSize)operator(;) -reserved(end)operator(;) - -reserved(end)operator(.) diff --git a/test/scanners/delphi/ytools.in.pas b/test/scanners/delphi/ytools.in.pas deleted file mode 100644 index 8670459..0000000 --- a/test/scanners/delphi/ytools.in.pas +++ /dev/null @@ -1,2708 +0,0 @@ -// vim:ft=pascal - -unit YTools; - -{=============================================================================== - - cYcnus.YTools 1.0.3 Beta for Delphi 4+ - by licenser and Murphy - - ©2000-2003 by cYcnus - visit www.cYcnus.de - - licenser@cYcnus.de (Heinz N. Gies) - murphy@cYcnus.de (Kornelius Kalnbach) - - this unit is published under the terms of the GPL - -===============================================================================} - -interface - -uses - Windows, SysUtils, Classes, YTypes; - -const - BackSpace = #8; - Tab = #9; - LF = #10; //Line Feed - CR = #13; //Carriage Return - Space = #32; - EOLChars = [CR, LF]; -{$IFNDEF VER140} - sLineBreak = #13#10; - SwitchChars = ['/', '-']; -{$ENDIF} - EOL = sLineBreak; - MaxCard = High(Cardinal); - AllChars = [#0..#255]; - Alphabetical = ['A'..'Z', 'a'..'z']; - DecimalChars = ['0'..'9']; - AlphaNumerical = Alphabetical + DecimalChars; - StrangeChars = [#0..#31, #127, #129, #141..#144, #157, #158]; - - HexadecimalChars = DecimalChars + ['A'..'F', 'a'..'f']; - OctalChars = ['0'..'7']; - BinaryChars = ['0', '1']; - - QuoteChars = ['''', '"']; - WildCards = ['*', '?']; - FileNameEnemies = WildCards + ['\', '/', ':', '<', '>', '|']; - - HexChar: array[THex] of Char = ( - '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); - LowerHexChar: array[THex] of Char = ( - '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'); - BaseNChar: array[TBaseN] of Char = ( - '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H', - 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'); - - cYcnusOverlayColor = $050001; - - faFindEveryFile = faReadOnly + faHidden + faSysFile + faArchive; - - platWin9x = [VER_PLATFORM_WIN32s, VER_PLATFORM_WIN32_WINDOWS]; - - -{ Debugging } -procedure ClearReport(const ReportName: string); -procedure Report(const ReportName, Text: string); -procedure ReportFmt(const ReportName, Fmt: string; const Args: array of const); - -{ Params } -procedure GetParams(Strings: TStrings); overload; -function GetParams(const Separator: string = ' '): string; overload; - -function ParamNum(const S: string): Integer; -function ParamPrefixNum(const Prefix: string): Integer; -function Param(const S: string): Boolean; -function ParamPrefix(const Prefix: string): Boolean; - -function Switch(const Switch: string; const PrefixChars: TCharSet = SwitchChars; - IgnoreCase: Boolean = True): Boolean; -function GetParam(const Prefix: string = ''; const Default: string = ''): string; - -{ Dirs & UserName} -function GetMyDir(FullPath: Boolean = False): string; -function WinDir: string; -function SysDir: string; -function UserName: string; - -{ Strings & Chars} -function FirstChar(const S: string): Char; -function LastChar(const S: string): Char; - -function CharPos(C: Char; const S: string; Offset: Integer = 1): Integer; overload; -function CharPos(C: TCharSet; const S: string; Offset: Integer = 1): Integer; overload; -function CharPosR(C: Char; const S: string; Offset: Integer = -1): Integer; -function PosEx(const SubStr, S: string; Offset: Integer = 1): Integer; -function PosExText(const SubStr, S: string; Offset: Integer = 1): Integer; -function PosExAnsiText(const SubStr, S: string; Offset: Integer = 1): Integer; - -function UntilChar(const S: string; Brake: Char): string; overload; -function UntilChar(const S: string; Brake: TCharSet): string; overload; -function UntilLastChar(const S: string; Brake: Char; - IgnoreNoBrake: Boolean = True): string; - -function FromChar(const S: string; Brake: Char): string; overload; -function FromChar(const S: string; Brake: TCharSet): string; overload; -function FromLastChar(const S: string; Brake: Char; - IgnoreNoBrake: Boolean = False): string; - -function BetweenChars(const S: string; Start, Finish: Char; - Inclusive: Boolean = False): string; - -function UntilStr(const S: string; Brake: string): string; -function FromStr(const S: string; Brake: string): string; - -function StringWrap(const S: string; Width: Integer; const LineEnd: string = EOL): string; - -{ Splitting & Combining } -function Split(const S, Separator: string; IgnoreMultiSep: Boolean = True; - MinCount: Integer = 0): TStrA; overload; -procedure Split(const S, Separator: string; Strings: TStrings; - IgnoreMultiSep: Boolean = True); overload; -function Split(const S: string; Separators: TCharSet; - IgnoreMultiSep: Boolean = True; MinCount: Integer = 0): TStrA; overload; - -procedure TileStr(const S: string; BrakeStart: Integer; BrakeEnd: Integer; - out Left, Right: string); - -function Join(Strings: TStrings; Separator: string = ' '): string; overload; -function Join(StrA: TStrA; Separator: string = ' '): string; overload; - -function MulStr(const S: string; Count: Integer): string; - -{ Strings ausrichten } -function AlignR(const S: string; Width: Integer; Filler: Char = ' '): string; -function MaxStr(const S: string; MaxLen: Integer): string; - -{ Stringing } -function TrimAll(const S: string): string; - -function ControlChar(C: Char): Boolean; -function FriendlyChar(C: Char): Char; - -function FriendlyStr(const S: string): string; overload; -function FriendlyStr(a: TByteA): string; overload; - -function Quote(const S: string; Quoter: Char = '"'): string; -function UnQuote(const S: string): string; -function DeQuote(const S: string): string; - -function StrNumerus(const Value: Integer; const Singular, Plural: string; - const Zero: string = '0'): string; - -function MakeStr(const Items: array of const; Separator: string = ''): string; -procedure ShowText(const Items: array of const; Separator: string = ''); - -{ Delete } -function DeleteChars(const S: string; C: Char): string; overload; -function DeleteChars(const S: string; C: TCharSet): string; overload; -function ExtractChars(const S: string; C: TCharSet): string; - -{ Find } -function CharCount(const S: string; C: Char): Integer; - -function CharIn(const S: string; C: Char): Boolean; overload; -function CharIn(const S: string; C: TCharSet): Boolean; overload; - -function StrAtPos(const S: string; Pos: Integer; const Str: string): Boolean; -function StrAtBegin(const S, Str: string): Boolean; -function StrIn(const S, SubStr: string): Boolean; overload; -function StrIn(A: TStrA; const S: string): Boolean; overload; -function StrIn(SL: TStrings; const S: string): Boolean; overload; -function StrIndex(A: TStrA; const S: string): Integer; overload; -function StrIndex(SL: TStrings; const S: string): Integer; overload; - -function TextAtPos(const S: string; Pos: Integer; const Text: string): Boolean; -function TextAtBegin(const S, Text: string): Boolean; -function TextIn(const S, Text: string): Boolean; overload; -function TextIn(A: TStrA; const Text: string): Boolean; overload; -function TextIn(SL: TStrings; const Text: string): Boolean; overload; -function TextIndex(A: TStrA; const Text: string): Integer; overload; -function TextIndex(SL: TStrings; const Text: string): Integer; overload; - -{ Replace } -function ReplaceChars(const S: string; Old, New: Char): string; overload; -function ReplaceChars(const S: string; Old: TCharSet; New: Char): string; overload; - -function Replace(const S, Old, New: string): string; - -{ TStrings } -function SLOfFile(const FileName: string): TStringList; -function ContainsEmptyLines(SL: TStrings): Boolean; -procedure DeleteEmptyLines(SL: TStrings); -procedure DeleteCommentLines(SL: TStrings; const CommentSign: string = '//'); -procedure WriteSL(Strings: TStrings; const Prefix: string = ''; - const Suffix: string = ''); - -function FindLine(SL: TStrings; const S: string): Integer; - -procedure QuickSortSL(SL: TStringList); - -{ TStrA } -function IncStrA(StrA: TStrA): Integer; - -{ TByteA } -function StrOfByteA(a: TByteA): string; -function ByteAOfStr(const S: string): TByteA; -function ByteAOfInt(i: Integer): TByteA; -function IntOfByteA(A: TByteA): Integer; -function ByteAOfHex(const Hex: string): TByteA; - -function SameByteA(const A, B: TByteA): Boolean; -function Reverse(a: TByteA): TByteA; -function SaveByteA(Data: TByteA; const FileName: string; Overwrite: Boolean = True): Boolean; -function LoadByteA(const FileName: string): TByteA; - -function Endian(i: Integer): Integer; - -{ Files } -function SizeOfFile(const FileName: string): Integer; -function FileEx(const FileName: string; AllowFolders: Boolean = False): Boolean; -function LWPSolve(const Dir: string): string; -function LWPSlash(const Dir: string): string; - -function ExtractDrive(const FileName: string): string; -function ExtractPath(const FileName: string): string; -function ExtractPrefix(const FileName: string): string; -function ExtractSuffix(const FileName: string): string; - -function IsValidFileName(const FileName: string): Boolean; -function MakeValidFileName(FileName: string; const Default: string = 'File'): string; - -{ Converting } -function IsValidInteger(const S: string): Boolean; -function IsValidCardinal(const S: string): Boolean; - -function StrOfBool(flag: Boolean; const TrueStr: string = 'True'; - const FalseStr: string = 'False'): string; -function StrOfInt(i: Integer): string; -function CardOfStr(const S: string): Cardinal; - -function HexOrd(Hex: Char): THex; -function ByteOfHex(Hex: THexByteStr): Byte; - -function DecOfHex(const Hex: string): string; -function HexOfByte(b: Byte): THexByteStr; -function HexOfCard(i: Cardinal): string; overload; -function HexOfCard(i: Cardinal; Digits: Integer): string; overload; - -function PascalHexArray(a: TByteA; Name: string): string; - -function HexOfByteA(a: TByteA; Blocks: Integer = 1; - const Splitter: string = ' '): string; -function BinOfByteA(a: TByteA; Blocks: Integer = 4; - const Splitter: string = ' '): string; - -function CardOfHex(Hex: string): Cardinal; -function IntOfBin(Bin: string): Cardinal; - -function BinOfIntFill(n: cardinal; MinCount: Integer = 8): string; -function BinOfInt(n: cardinal): string; - -function BaseNOfInt(I: Cardinal; B: TBaseN): string; -function IntOfBaseN(V: string; B: TBaseN): Cardinal; - -{ Ranges } -function KeepIn(i, Bottom, Top: Variant): Variant; -function InRange(Value, Bottom, Top: Variant): Boolean; -function InStrictRange(Value, Bottom, Top: Variant): Boolean; -function Min(const A, B: Integer): Integer; overload; -function Min(const A: TIntA): Integer; overload; -function Max(const A, B: Integer): Integer; overload; -function Max(const A: TIntA): Integer; overload; - -const - RangesSeparator = ','; - RangeInnerSeparator = '-'; - RangeInfinite = '*'; - RangeSpecialChars = [RangesSeparator, RangeInnerSeparator, RangeInfinite]; - -function RangesOfStr(const S: string): TRanges; -function InRanges(Ranges: TRanges; TestValue: Cardinal): Boolean; - -function Success(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; -function Failure(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; - -function ExpandString(const S: string): string; - -{ Files } -procedure DeleteFiles(const Mask: string; ScanSubDirs: Boolean = True; - Attributes: Integer = faFindEveryFile); -procedure FileNew(const FileName: string); -function DateTimeOfFileTime(const FileTime: TFileTime): TDateTime; - -{ FileNames } -function GetFileNew(FileName: string; NoFloppyDrives: Boolean = True): string; - -{ Finding Files } -function FindAll(Strings: TStrings; const Mask: string; - ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile; - FileReturn: TFileNameFunc = nil): Boolean; -function FindAllFirst(const Mask: string; ScanSubDirs: Boolean = True; - Attributes: Integer = faFindEveryFile): string; - -function FullOSInfo: string; -function Win32PlatformStr: string; -function Win9x: Boolean; -function WinNT: Boolean; -function Win2000: Boolean; -function WinXP: Boolean; - -var - MyDir: string = ''; - LastSuccessRes: Integer = 0; - -{ Backward compatibility } -{$IFNDEF VER130} -function SameText(const S1, S2: string): Boolean; -{$ENDIF} - -implementation -{$IFNDEF VER140} -uses FileCtrl; -{$ENDIF} - -{$IFNDEF VER130} -function SameText(const S1, S2: string): Boolean; -begin - Result := CompareText(S1, S2) = 0; -end; -{$ENDIF} - -procedure Report(const ReportName, Text: string); -var - F: TextFile; - FileName: string; -begin - FileName := MyDir + ReportName + '.rep'; - Assign(F, FileName); - try - if not FileExists(FileName) then - Rewrite(F) - else - Append(F); - WriteLn(F, Text); - finally - Close(F); - end; -end; - -procedure ClearReport(const ReportName: string); -var - FileName: string; -begin - FileName := MyDir + ReportName + '.rep'; - DeleteFile(FileName); -end; - -procedure ReportFmt(const ReportName, Fmt: string; const Args: array of const); -begin - Report(ReportName, Format(Fmt, Args)); -end; - -procedure GetParams(Strings: TStrings); -var - P: PChar; - Param: string; - - function GetParamStr(var P: PChar; var Param: string): Boolean; - var - Quoted: Boolean; - begin - Param := ''; - - repeat - while (P[0] <> #0) and (P[0] <= ' ') do - Inc(P); - - Quoted := False; - while P[0] <> #0 do begin - if P[0] = '"' then begin - Quoted := not Quoted; - Inc(P); - Continue; end; - if (P[0] <= ' ') and not Quoted then - Break; - Param := Param + P[0]; - Inc(P); - end; - until (Param <> '') or (P[0] = #0); - - Result := Param <> ''; - end; - -begin - Strings.Clear; - P := GetCommandLine; - GetParamStr(P, Param); - while GetParamStr(P, Param) do - Strings.Add(Param); -end; - -function GetParams(const Separator: string = ' '): string; -var - SL: TStringList; -begin - SL := TStringList.Create; - GetParams(SL); - Result := Join(SL, Separator); - SL.Free; -end; - -function Switch(const Switch: string; const PrefixChars: TCharSet = SwitchChars; - IgnoreCase: Boolean = True): Boolean; -//= SysUtils.FindCmdLineSwitch -var - i: Integer; - s: string; -begin - Result := True; - - for i := 1 to ParamCount do begin - s := ParamStr(i); - - if (s <> '') and (s[1] in PrefixChars) then begin - //i know that always s <> '', but this is saver - s := Copy(s, 2, MaxInt); - if (s = Switch) or (IgnoreCase and (0=AnsiCompareText(s, Switch))) then - Exit; - end; - end; - - Result := False; -end; - -function ParamNum(const S: string): Integer; -begin - for Result := 1 to ParamCount do - if 0=AnsiCompareText(ParamStr(Result), S) then - Exit; - - Result := 0; -end; - -function ParamPrefixNum(const Prefix: string): Integer; -var - Len: Integer; -begin - Len := Length(Prefix); - for Result := 1 to ParamCount do - if 0=AnsiCompareText(Copy(ParamStr(Result), 1, Len), Prefix) then - Exit; - - Result := 0; -end; - -function Param(const S: string): Boolean; -begin - Result := ParamNum(S) > 0; -end; - -function ParamPrefix(const Prefix: string): Boolean; -begin - Result := ParamPrefixNum(Prefix) > 0; -end; - -function GetParam(const Prefix: string = ''; const Default: string = ''): string; -var - i: Integer; -begin - Result := Default; - - if Prefix = '' then begin - Result := ParamStr(1); - Exit; end; - - i := ParamPrefixNum(Prefix); - if i > 0 then - Result := Copy(ParamStr(i), Length(Prefix) + 1, MaxInt); -end; - -function GetMyDir(FullPath: Boolean = False): string; -var - Buffer: array[0..260] of Char; -begin - Result := ''; - SetString(Result, Buffer, GetModuleFileName(0, Buffer, SizeOf(Buffer))); - if FullPath then - Result := GetFileNew(Result); - Result := ExtractPath(Result); -end; - -function WinDir: string; -var - Res: PChar; -begin - Result := '\'; - GetMem(Res, MAX_PATH); - GetWindowsDirectory(Res, MAX_PATH); - Result := Res + '\'; - FreeMem(Res, MAX_PATH); -end; - -function SysDir: string; -var - Res: PChar; -begin - Result := '\'; - GetMem(Res, MAX_PATH); - GetSystemDirectory(Res, MAX_PATH); - Result := Res + '\'; - FreeMem(Res, MAX_PATH); -end; - -function UserName: string; -var - Len: Cardinal; - Res: PChar; -begin - Result := ''; - GetMem(Res, MAX_PATH); - Len := MAX_PATH; - GetUserName(Res, Len); - Result := Res; - FreeMem(Res, MAX_PATH); -end; - -function FirstChar(const S: string): Char; -begin - if s = '' then - Result := #0 - else - Result := s[1]; -end; - -function LastChar(const S: string): Char; -begin - if s = '' then - Result := #0 - else - Result := s[Length(s)]; -end; - -function CharPos(C: Char; const S: string; Offset: Integer = 1): Integer; -var - MaxPosToSearch: Integer; -begin - Result := Offset; - MaxPosToSearch := Length(S); - - while Result <= MaxPosToSearch do begin - if S[Result] = C then - Exit; - Inc(Result); - end; - - Result := 0; -end; - -function CharPos(C: TCharSet; const S: string; Offset: Integer = 1): Integer; -var - MaxPosToSearch: Integer; -begin - Result := Offset; - MaxPosToSearch := Length(S); - - while Result <= MaxPosToSearch do begin - if S[Result] in C then - Exit; - Inc(Result); - end; - - Result := 0; -end; - -function CharPosR(C: Char; const S: string; Offset: Integer = -1): Integer; -begin - if Offset < 0 then - Result := Length(S) + 1 - Offset - else - Result := Offset; - if Result > Length(S) then - Result := Length(S); - - while Result > 0 do begin - if S[Result] = C then - Exit; - Dec(Result); - end; -end; - -function PosEx(const SubStr, S: string; Offset: Integer = 1): Integer; -var - MaxPosToSearch, LenSubStr, i: Integer; -begin - if SubStr = '' then begin - Result := 0; - Exit; end; - - if Offset < 1 then - Result := 1 - else - Result := Offset; - - LenSubStr := Length(SubStr); - MaxPosToSearch := Length(S) - LenSubStr + 1; - - while Result <= MaxPosToSearch do begin - if S[Result] = SubStr[1] then begin - i := 1; - - while (i < LenSubStr) - and (S[Result + i] = SubStr[i + 1]) do - Inc(i); - - if i = LenSubStr then - Exit; - end; - Inc(Result); - end; - - Result := 0; -end; - -function PosExText(const SubStr, S: string; Offset: Integer = 1): Integer; -var - MaxPosToSearch, LenSubStr, i: Integer; - - function SameChar(a, b: Char): Boolean; - begin - Result := UpCase(a) = UpCase(b) - end; - -begin - if SubStr = '' then begin - Result := 0; - Exit; end; - - if Offset < 1 then - Result := 1 - else - Result := Offset; - - LenSubStr := Length(SubStr); - MaxPosToSearch := Length(S) - LenSubStr + 1; - - while Result <= MaxPosToSearch do begin - if SameChar(S[Result], SubStr[1]) then begin - i := 1; - - while (i < LenSubStr) - and (SameChar(S[Result + i], SubStr[i + 1])) do - Inc(i); - - if i = LenSubStr then - Exit; - end; - Inc(Result); - end; - - Result := 0; -end; - -function PosExAnsiText(const SubStr, S: string; Offset: Integer = 1): Integer; -var - MaxPosToSearch, LenSubStr, i: Integer; - - function SameChar(a, b: Char): Boolean; - begin - Result := CharLower(PChar(a)) = CharLower(PChar(b)); - end; - -begin - if SubStr = '' then begin - Result := 0; - Exit; end; - - if Offset < 1 then - Result := 1 - else - Result := Offset; - - LenSubStr := Length(SubStr); - MaxPosToSearch := Length(S) - LenSubStr + 1; - - while Result <= MaxPosToSearch do begin - if SameChar(S[Result], SubStr[1]) then begin - i := 1; - - while (i < LenSubStr) - and (SameChar(S[Result + i], SubStr[i + 1])) do - Inc(i); - - if i = LenSubStr then - Exit; - end; - Inc(Result); - end; - - Result := 0; -end; - -function UntilChar(const S: string; Brake: Char): string; -var - p: Integer; -begin - p := CharPos(Brake, S); - - if p > 0 then - Result := Copy(S, 1, p - 1) - else - Result := S; -end; - -function UntilChar(const S: string; Brake: TCharSet): string; -var - p: Integer; -begin - Result := ''; - p := CharPos(Brake, S); - - if p > 0 then - Result := Copy(S, 1, p - 1) - else - Result := S; -end; - -function UntilLastChar(const S: string; Brake: Char; - IgnoreNoBrake: Boolean = True): string; -var - p: Integer; -begin - Result := ''; - p := CharPosR(Brake, S); - - if p > 0 then - Result := Copy(S, 1, p - 1) - else if IgnoreNoBrake then - Result := S; -end; - -function FromChar(const S: string; Brake: Char): string; -var - p: Integer; -begin - Result := ''; - p := CharPos(Brake, S); - - if p > 0 then - Result := Copy(S, p + 1, Length(S) - p); -end; - -function FromChar(const S: string; Brake: TCharSet): string; -var - p: Integer; -begin - Result := ''; - p := CharPos(Brake, S); - - if p > 0 then - Result := Copy(S, p + 1, Length(S) - p); -end; - -function FromLastChar(const S: string; Brake: Char; - IgnoreNoBrake: Boolean = False): string; -var - p: Integer; -begin - Result := ''; - p := CharPosR(Brake, S); - - if p > 0 then - Result := Copy(S, p + 1, Length(S) - p) - else if IgnoreNoBrake then - Result := S; -end; - -function BetweenChars(const S: string; Start, Finish: Char; - Inclusive: Boolean = False): string; -var - p, fin: Integer; -begin - Result := ''; - - p := CharPos(Start, S); - if p = 0 then - Exit; - - fin := CharPos(Finish, S, p + 1); - if fin = 0 then - Exit; - - if not Inclusive then begin - Inc(p); - Dec(fin); - end; - - Result := Copy(S, p, fin - p + 1); -end; - -function UntilStr(const S: string; Brake: string): string; -var - p: Integer; -begin - if Length(Brake) = 1 then begin - Result := UntilChar(S, Brake[1]); - Exit; end; - - p := PosEx(Brake, S); - - if p > 0 then - Result := Copy(S, 1, p - 1) - else - Result := S; -end; - -function FromStr(const S: string; Brake: string): string; -var - p: Integer; -begin - if Length(Brake) = 1 then begin - Result := FromChar(S, Brake[1]); - Exit; end; - - Result := ''; - p := PosEx(Brake, s); - - if p > 0 then begin - Inc(p, Length(Brake)); - Result := Copy(S, p, Length(S) - p + 1); - end; -end; - -function StringWrap(const S: string; Width: Integer; const LineEnd: string = EOL): string; -var - i: Integer; -begin - Result := ''; - if (S = '') or (Width < 1) then - Exit; - - i := 1; - while True do begin - Result := Result + Copy(S, i, Width); - Inc(i, Width); - if i <= Length(S) then - Result := Result + LineEnd - else - Exit; - end; -end; - -function Split(const S, Separator: string; IgnoreMultiSep: Boolean = True; - MinCount: Integer = 0): TStrA; -var - p, fin, SepLen: Integer; - - procedure Add(const S: string); - begin - if IgnoreMultiSep and (S = '') then - Exit; - SetLength(Result, Length(Result) + 1); - Result[High(Result)] := S; - end; - -begin - if S = '' then begin - if Length(Result) < MinCount then - SetLength(Result, MinCount); - Exit; end; - - Result := nil; - SepLen := Length(Separator); - - p := 1; - fin := PosEx(Separator, S); - while fin > 0 do begin - Add(Copy(S, p, fin - p)); - p := fin + SepLen; - fin := PosEx(Separator, S, p); - end; - Add(Copy(S, p, Length(S) - p + 1)); - - if Length(Result) < MinCount then - SetLength(Result, MinCount); -end; - -procedure Split(const S, Separator: string; Strings: TStrings; - IgnoreMultiSep: Boolean = True); -var - p, fin, SepLen: Integer; - - procedure Add(const S: string); - begin - if IgnoreMultiSep and (S = '') then - Exit; - Strings.Add(S); - end; - -begin - if S = '' then - Exit; - - Strings.BeginUpdate; - SepLen := Length(Separator); - p := 1; - fin := PosEx(Separator, S); - while fin > 0 do begin - Add(Copy(S, p, fin - p)); - p := fin + SepLen; - fin := PosEx(Separator, S, p); - end; - Add(Copy(S, p, Length(S) - p + 1)); - Strings.EndUpdate; -end; - -function Split(const S: string; Separators: TCharSet; - IgnoreMultiSep: Boolean = True; MinCount: Integer = 0): TStrA; -var - p, fin: Integer; - - procedure Add(const S: string); - begin - if IgnoreMultiSep and (S = '') then - Exit; - SetLength(Result, Length(Result) + 1); - Result[High(Result)] := S; - end; - -begin - if S = '' then begin - if Length(Result) < MinCount then - SetLength(Result, MinCount); - Exit; end; - - Result := nil; - - p := 1; - fin := CharPos(Separators, S); - while fin > 0 do begin - Add(Copy(S, p, fin - p)); - p := fin + 1; - fin := CharPos(Separators, S, p); - end; - Add(Copy(S, p, Length(S) - p + 1)); - - if Length(Result) < MinCount then - SetLength(Result, MinCount); -end; - -procedure TileStr(const S: string; BrakeStart: Integer; BrakeEnd: Integer; - out Left, Right: string); -begin - Left := Copy(S, 1, BrakeStart-1); - Right := Copy(S, BrakeEnd + 1, MaxInt); -end; - -function Join(Strings: TStrings; Separator: string = ' '): string; -var - i, imax: Integer; -begin - Result := ''; - imax := Strings.Count-1; - for i := 0 to imax do begin - Result := Result + Strings[i]; - if i < imax then - Result := Result + Separator; - end; -end; - -function Join(StrA: TStrA; Separator: string = ' '): string; overload; -var - i: Integer; -begin - Result := ''; - for i := 0 to High(StrA) do begin - Result := Result + StrA[i]; - if i < High(StrA) then - Result := Result + Separator; - end; -end; - -function MulStr(const S: string; Count: Integer): string; -var - P: PChar; - Len, i: Integer; -begin - Result := ''; - if Count = 0 then - Exit; - - Len := Length(S); - SetLength(Result, Len * Count); - - P := Pointer(Result); - for i := 1 to Count do begin - Move(Pointer(S)^, P^, Len); - Inc(P, Len); - end; -end; - -function AlignR(const S: string; Width: Integer; Filler: Char = ' '): string; -begin - Result := MulStr(Filler, Width - Length(S)) + S; -end; - -function MaxStr(const S: string; MaxLen: Integer): string; -var - Len: Integer; -begin - Len := Length(S); - if Len <= MaxLen then begin - Result := S; - Exit end; - - Result := Copy(S, 1, MaxLen - 3) + '...'; -end; - -function TrimAll(const S: string): string; -var - i: Integer; -begin - for i := 1 to Length(S) do - if S[i] > #32 then - Result := Result + S[i]; -end; - -function ControlChar(C: Char): Boolean; -begin - Result := C in StrangeChars; -end; - -function FriendlyChar(C: Char): Char; -begin - case C of - #0: Result := '.'; - #1..#31: Result := '?'; - #255: Result := '#'; - else - Result := C; - end; -end; - -function FriendlyStr(const S: string): string; -var - i: Integer; -begin - SetLength(Result, Length(S)); - for i := 1 to Length(S) do - Result[i] := FriendlyChar(S[i]); -end; - -function FriendlyStr(a: TByteA): string; -var - i: Integer; -begin - SetLength(Result, Length(a)); - for i := 0 to High(a) do - Result[i + 1] := FriendlyChar(Char(a[i])); -end; - -function Quote(const S: string; Quoter: Char = '"'): string; -begin - Result := S; - - if FirstChar(S) <> Quoter then - Result := Quoter + Result; - - if LastChar(S) <> Quoter then - Result := Result + Quoter; -end; - -function DeQuote(const S: string): string; -begin - Result := ''; - if Length(S) > 2 then - Result := Copy(S, 2, Length(S) - 2); -end; - -function UnQuote(const S: string): string; -var - Start, Len: Integer; -begin - Start := 1; - Len := Length(S); - - if (S <> '') and (S[1] in ([#0..#32] + QuoteChars)) then begin - if (LastChar(S) = S[1]) then - Dec(Len); - Inc(Start); - end; - - Result := Copy(S, Start, Len - Start + 1); -end; - -function StrNumerus(const Value: Integer; const Singular, Plural: string; - const Zero: string = '0'): string; -begin - if Abs(Value) = 1 then - Result := IntToStr(Value) + ' ' + Singular - else if Value = 0 then - Result := Zero + ' ' + Plural - else - Result := IntToStr(Value) + ' ' + Plural; -end; - -function MakeStr(const Items: array of const; Separator: string = ''): string; -const - BoolStrings: array[Boolean] of string = ('False', 'True'); - -var - i: Integer; - - function StrOfP(P: Pointer): string; - begin - if P = nil then - Result := '[nil]' - else - Result := '[' + IntToStr(Cardinal(P)) + ']'; - end; - - procedure Add(const S: string); - begin - Result := Result + s + Separator; - end; - -begin - Result := ''; - for i := 0 to High(Items) do - with Items[i] do - case VType of - vtString: Add(VString^); - vtInteger: Add(IntToStr(VInteger)); - vtBoolean: Add(BoolStrings[VBoolean]); - vtChar: Add(VChar); - vtPChar: Add(VPChar); - vtExtended: Add(FloatToStr(VExtended^)); - vtObject: if VObject is TComponent then - Add(TComponent(VObject).Name) - else - Add(VObject.ClassName); - vtClass: Add(VClass.ClassName); - vtAnsiString: Add(string(VAnsiString)); - vtCurrency: Add(CurrToStr(VCurrency^)); - vtInt64: Add(IntToStr(VInt64^)); - vtVariant: Add(string(VVariant^)); - - vtWideChar: Add(VWideChar); - vtPWideChar: Add(VPWideChar); - vtInterface: Add(StrOfP(VInterface)); - vtPointer: Add(StrOfP(VPointer)); - vtWideString: Add(WideString(VWideString)); - end; - if Result <> '' then - SetLength(result, Length(Result) - Length(Separator)); -end; - -procedure ShowText(const Items: array of const; Separator: string = ''); -var - Text: string; -begin - Text := MakeStr(Items, Separator); - - MessageBox(0, PChar(Text), 'Info', MB_OK and MB_APPLMODAL); -end; - -function DeleteChars(const S: string; C: Char): string; -var - i: Integer; -begin - Result := ''; - for i := 1 to Length(S) do - if S[i] <> C then - Result := Result + S[i]; -end; - -function DeleteChars(const S: string; C: TCharSet): string; -var - i: Integer; -begin - Result := ''; - for i := 1 to Length(S) do - if not (S[i] in C) then - Result := Result + S[i]; -end; - -function ExtractChars(const S: string; C: TCharSet): string; -var - i: Integer; -begin - Result := ''; - for i := 1 to Length(S) do - if S[i] in C then - Result := Result + S[i]; -end; - -function CharCount(const S: string; C: Char): Integer; -var - i: Integer; -begin - Result := 0; - for i := 1 to Length(S) do - if S[i] = C then - Inc(Result); -end; - -function StrAtPos(const S: string; Pos: Integer; const Str: string): Boolean; -begin - Result := (Str <> '') and (Str = Copy(S, Pos, Length(Str))); -end; - -function TextAtPos(const S: string; Pos: Integer; const Text: string): Boolean; -begin - Result := (Text <> '') and SameText(Text, Copy(S, Pos, Length(Text))); -end; - -function StrAtBegin(const S, Str: string): Boolean; -begin - Result := StrAtPos(S, 1, Str); -end; - -function TextAtBegin(const S, Text: string): Boolean; -begin - Result := TextAtPos(S, 1, Text); -end; - -function CharIn(const S: string; C: Char): Boolean; -var - i: Integer; -begin - Result := True; - for i := 1 to Length(S) do - if S[i] = C then Exit; - Result := False; -end; - -function CharIn(const S: string; C: TCharSet): Boolean; -var - i: Integer; -begin - Result := False; - for i := 1 to Length(S) do begin - Result := S[i] in C; - if Result then - Exit; - end; -end; - -function StrIn(const S, SubStr: string): Boolean; -begin - Result := PosEx(SubStr, S) > 0; -end; - -function StrIn(SL: TStrings; const S: string): Boolean; -var - i: Integer; -begin - Result := False; - for i := 0 to SL.Count-1 do begin - Result := (S = SL[i]); - if Result then - Exit; - end; -end; - -function StrIn(A: TStrA; const S: string): Boolean; -var - i: Integer; -begin - Result := False; - for i := Low(A) to High(A) do begin - Result := (S = A[i]); - if Result then - Exit; - end; -end; - -function TextIn(const S, Text: string): Boolean; -begin - Result := PosExText(Text, S) > 0; -end; - -function TextIn(SL: TStrings; const Text: string): Boolean; -var - i: Integer; -begin - Result := False; - for i := 0 to SL.Count-1 do begin - Result := SameText(Text, SL[i]); - if Result then - Exit; - end; -end; - -function TextIn(A: TStrA; const Text: string): Boolean; -var - i: Integer; -begin - Result := False; - for i := Low(A) to High(A) do begin - Result := SameText(Text, A[i]); - if Result then - Exit; - end; -end; - -function StrIndex(SL: TStrings; const S: string): Integer; -begin - for Result := 0 to SL.Count-1 do - if S = SL[Result] then - Exit; - Result := -1; -end; - -function StrIndex(A: TStrA; const S: string): Integer; -begin - for Result := Low(A) to High(A) do - if S = A[Result] then - Exit; - Result := -1; -end; - -function TextIndex(SL: TStrings; const Text: string): Integer; -begin - for Result := 0 to SL.Count-1 do - if SameText(Text, SL[Result]) then - Exit; - Result := -1; -end; - -function TextIndex(A: TStrA; const Text: string): Integer; -begin - for Result := Low(A) to High(A) do - if SameText(Text, A[Result]) then - Exit; - Result := -1; -end; - -function ReplaceChars(const S: string; Old, New: Char): string; -var - i: Integer; -begin - Result := S; - for i := 1 to Length(Result) do - if Result[i] = Old then - Result[i] := New; -end; - -function ReplaceChars(const S: string; Old: TCharSet; New: Char): string; -var - i: Integer; -begin - Result := S; - for i := 1 to Length(Result) do - if Result[i] in Old then - Result[i] := New; -end; - -function Replace(const S, Old, New: string): string; -var - oldp, ps: Integer; -begin - ps := 1; - Result := ''; - while True do begin - oldp := ps; - ps := PosEx(Old, S, oldp); - if ps = 0 then begin - Result := Result + Copy(S, oldp, Length(S) - oldp + 1); - Exit; end; - Result := Result + Copy(S, oldp, ps - oldp) + New; - Inc(ps, Length(Old)); - end; -end; - -function SLOfFile(const FileName: string): TStringList; -begin - Result := TStringList.Create; - if FileExists(FileName) then - Result.LoadFromFile(FileName); -end; - -function ContainsEmptyLines(SL: TStrings): Boolean; -begin - Result := StrIn(SL, ''); -end; - -procedure DeleteEmptyLines(SL: TStrings); -var - i: Integer; -begin - i := 0; - while i < SL.Count do begin - if SL[i] = '' then - SL.Delete(i) - else - Inc(i); - end; -end; - -procedure DeleteCommentLines(SL: TStrings; const CommentSign: string = '//'); -var - i: Integer; -begin - i := 0; - while i < SL.Count do begin - if (SL[i] = '') or (StrAtBegin(TrimLeft(SL[i]), CommentSign)) then - SL.Delete(i) - else - Inc(i); - end; -end; - -function FindLine(SL: TStrings; const S: string): Integer; -begin - for Result := 0 to SL.Count-1 do - if TextAtBegin(SL[Result], S) then - Exit; - Result := -1; -end; - -procedure QuickSortSL(SL: TStringList); - - procedure Sort(l, r: Integer); - var - i,j: Integer; - z,x: string; - begin - i := l; - j := r; - x := SL[(j + i) div 2]; - repeat - while SL[i] < x do Inc(i); - while SL[j] > x do Dec(j); - if i <= j then begin - z := SL[i]; - SL[i] := SL[j]; - SL[j] := z; - Inc(i); Dec(j); - end; - until i > j; - if j > l then Sort(l, j); - if i < r then Sort(i, r); - end; - -begin - if SL.Count > 0 then - Sort(0, SL.Count-1); -end; - -function IncStrA(StrA: TStrA): Integer; -begin - SetLength(StrA, Length(StrA) + 1); - Result := High(StrA); -end; - -function StrOfByteA(a: TByteA): string; -begin - Result := string(Copy(a, 0, Length(a))); -end; - -function ByteAOfStr(const S: string): TByteA; -begin - Result := TByteA(Copy(S, 1, Length(s))); -end; - -function ByteAOfInt(i: Integer): TByteA; -begin - SetLength(Result, SizeOf(Integer)); - Move(i, Pointer(Result)^, SizeOf(Integer)); -end; - -function IntOfByteA(A: TByteA): Integer; -begin - Result := 0; - Move(Pointer(A)^, Result, Min(Length(A), SizeOf(Integer))); -end; - -function ByteAOfHex(const Hex: string): TByteA; -var - i: Integer; - h: string; -begin - h := ExtractChars(Hex, HexadecimalChars); - SetLength(Result, Length(h) div 2); - for i := 0 to High(Result) do - Result[i] := ByteOfHex(Copy(h, (i shl 1) + 1, 2)); -end; - -function SizeOfFile(const FileName: string): Integer; -var - F: file; -begin - AssignFile(F, FileName); - {$I-}Reset(F, 1);{$I+} - if IOResult = 0 then begin - Result := FileSize(F); - CloseFile(F); - end else - Result := 0; -end; - -function FileEx(const FileName: string; AllowFolders: Boolean = False): Boolean; -var - FindData: TWin32FindData; -begin - if FileName = '' then begin - Result := False; - Exit; end; - - Result := (AllowFolders and DirectoryExists(FileName)) or - (FindFirstFile(PChar(FileName), FindData) <> INVALID_HANDLE_VALUE); - Result := Result and not CharIn(FileName, WildCards); - Result := Result and (AllowFolders - or ((FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0)); -end; - -function LWPSolve(const Dir: string): string; -begin - if (Dir <> '') and (Dir[Length(Dir)] = '\') then begin - Result := Copy(Dir, 1, Length(Dir) - 1); - end else - Result := Dir; -end; - -function LWPSlash(const Dir: string): string; -begin - if (Dir <> '') and (Dir[Length(Dir)] = '\') then begin - Result := Copy(Dir, 1, Length(Dir)); - end else - Result := Dir + '\'; -end; - -function ExtractDrive(const FileName: string): string; -begin - Result := ''; - if (Length(FileName) >= 2) and (FileName[2] = ':') then - Result := UpperCase(FileName[1] + ':\'); -end; - -function ExtractPath(const FileName: string): string; -var - p: Integer; -begin - p := CharPosR('\', FileName); - if P > 0 then - Result := Copy(FileName, 1, p) - else - Result := FileName; -end; - -function ExtractPrefix(const FileName: string): string; -begin - Result := UntilLastChar(ExtractFileName(FileName), '.'); -end; - -function ExtractSuffix(const FileName: string): string; -begin - Result := FromLastChar(ExtractFileName(FileName), '.'); -end; - -function SameByteA(const A, B: TByteA): Boolean; -begin - Result := (A = B) or ((Length(A) = Length(B)) and CompareMem(A, B, Length(A))); -end; - -function Reverse(A: TByteA): TByteA; -var - i: Integer; -begin - SetLength(Result, Length(A)); - - for i := 0 to High(A) do - Result[High(Result) - i] := A[i]; -end; - -function Endian(i: Integer): Integer; -type - EndianArray = packed array[0..3] of Byte; -var - a, b: EndianArray; -begin - a := EndianArray(i); - b[0] := a[3]; - b[1] := a[2]; - b[2] := a[1]; - b[3] := a[0]; - Result := Integer(b); -end; - -function SaveByteA(Data: TByteA; const FileName: string; - Overwrite: Boolean = True): Boolean; -var - F: file; -begin - if FileExists(FileName) and not Overwrite then begin - Result := False; - Exit end; - - AssignFile(F, FileName); - {$I-}Rewrite(F, 1);{$I+} - if IOResult = 0 then begin - if Length(Data) > 0 then - BlockWrite(F, Data[0], Length(Data)); - CloseFile(F); - Result := True; - end else - Result := False; -end; - -function LoadByteA(const FileName: string): TByteA; -var - F: file; -begin - AssignFile(F, FileName); - {$I-}Reset(F, 1);{$I+} - if IOResult = 0 then begin - SetLength(Result, FileSize(F)); - if Length(Result) > 0 then - BlockRead(F, Result[0], FileSize(F)); - CloseFile(F); - end else - SetLength(Result, 0); -end; - -function IsValidFileName(const FileName: string): Boolean; -begin - Result := (FileName <> '') and not CharIn(FileName, FileNameEnemies) - and CharIn(Trim(FileName), AllChars - ['.']); -end; - -function MakeValidFileName(FileName: string; const Default: string = 'File'): string; -begin - if FileName = '' then - FileName := Default; - - if CharIn(FileName, FileNameEnemies) then - Result := ReplaceChars(FileName, FileNameEnemies, '_') - else if not CharIn(Trim(FileName), AllChars - ['.']) then - Result := Default - else - Result := FileName; -end; - -function IsValidInteger(const S: string): Boolean; -{const - LowInt = '2147483648'; - HighInt = '2147483647'; -var - len, RealLen, i, o: Integer; - c: Char; -begin - Result := False; - if S = '' then - Exit; - - len := Length(S); - o := 1; - - if S[1] = '-' then begin - if len = 1 then - Exit; - Inc(o); - while (o <= len) and (S[o] = '0') do - Inc(o); - if o > len then - Exit; - if o < len then begin - RealLen := len - o + 1; - if RealLen > Length(LowInt) then - Exit - else if RealLen = Length(LowInt) then begin - for i := 1 to Length(LowInt) do begin - c := S[i + o - 1]; - if (c < '0') or (c > LowInt[i]) then - Exit; - if c in ['0'..Char((Byte(LowInt[i])-1))] then - Break; - end; - Inc(o, i); - end; - end; - end else begin - while (o <= len) and (S[o] = '0') do - Inc(o); - if o <= len then begin - RealLen := len - o + 1; - if RealLen > Length(HighInt) then - Exit - else if RealLen = Length(HighInt) then begin - for i := 1 to Length(HighInt) do begin - c := S[i + o - 1]; - if (c < '0') or (c > HighInt[i]) then - Exit; - if c in ['0'..Char((Byte(HighInt[i])-1))] then - Break; - end; - Inc(o, i); - end; - end; - end; - - for i := o to len do - if not (S[i] in ['0'..'9']) then - Exit; - - Result := True; } -var - i: Int64; -begin - i := StrToInt64Def(S, High(Int64)); - Result := (i >= Low(Integer)) and (i <= High(Integer)); -end; - -function IsValidCardinal(const S: string): Boolean; -{const - HighCard = '4294967295'; -var - len, RealLen, i, o: Integer; -begin - Result := False; - if S = '' then - Exit; - - len := Length(S); - o := 1; - - while (o <= len) and (S[o] = '0') do - Inc(o); - if o <= len then begin - RealLen := len - o + 1; - if RealLen > Length(HighCard) then - Exit - else if RealLen = Length(HighCard) then begin - for i := 1 to Length(HighCard) do begin - if S[i + o - 1] > HighCard[i] then - Exit; - if S[i + o - 1] in ['0'..Char((Byte(HighCard[i])-1))] then - Break; - end; - Inc(o, i); - end; - end; - - for i := o to len do - if not (S[i] in ['0'..'9']) then - Exit; - - Result := True; } -var - i: Int64; -begin - i := StrToInt64Def(S, -1); - Result := (i >= 0) and (i <= High(Cardinal)); -end; - -function StrOfBool(flag: Boolean; const TrueStr: string = 'True'; - const FalseStr: string = 'False'): string; -begin - if Flag then - Result := TrueStr - else - Result := FalseStr; -end; - -function StrOfInt(i: Integer): string; -begin -{ if i = 0 then begin - Result := '0'; - Exit end; - - while i > 0 do begin - Result := Char(Byte('0') + (i mod 10)) + Result; - i := i div 10; - end;} - Result := IntToStr(i); -end; - -function CardOfStr(const S: string): Cardinal; -var - Res: Int64; -begin - Res := StrToInt64Def(S, -1); - if Res > High(Cardinal) then - Res := High(Cardinal) - else if Res < 0 then - Res := 0; - Result := Cardinal(Res); -end; - -function HexOrd(Hex: Char): THex; -begin - case Hex of - '0'..'9': - Result := Byte(Hex) - 48; - 'A'..'F': - Result := Byte(Hex) - 55; - 'a'..'f': - Result := Byte(Hex) - 87; - else - Result := 0; - end; -end; - -function ByteOfHex(Hex: THexByteStr): Byte; -begin - Result := (HexOrd(Hex[1]) shl 4) + HexOrd(Hex[2]); -end; - -function DecOfHex(const Hex: string): string; -begin - Result := IntToStr(CardOfHex(Hex)); -end; - -function HexOfByte(b: Byte): THexByteStr; -begin - Result := HexChar[(b and $F0) shr 4] - + HexChar[ b and $0F ]; -end; - -{function HexOfCard2(c: Cardinal): string; -var - Data: array[0..(1 shl 4) - 1] of Char; - i: Integer; -begin - for i := 0 to (1 shl 4) - 1 do - if i < 10 then - Data[i] := Char(Ord('0') + i) - else - Data[i] := Char(Ord('A') + i - 10); - - Result := Data[(c and (((1 shl (1 shl 2)) - 1) shl (7 shl 2))) shr (7 shl 2)] - + Data[(c and (((1 shl (1 shl 2)) - 1) shl (6 shl 2))) shr (6 shl 2)] - + Data[(c and (((1 shl (1 shl 2)) - 1) shl (5 shl 2))) shr (5 shl 2)] - + Data[(c and (((1 shl (1 shl 2)) - 1) shl (4 shl 2))) shr (4 shl 2)] - + Data[(c and (((1 shl (1 shl 2)) - 1) shl (3 shl 2))) shr (3 shl 2)] - + Data[(c and (((1 shl (1 shl 2)) - 1) shl (2 shl 2))) shr (2 shl 2)] - + Data[(c and (((1 shl (1 shl 2)) - 1) shl (1 shl 2))) shr (1 shl 2)] - + Data[(c and (((1 shl (1 shl 2)) - 1) shl (0 shl 2))) shr (0 shl 2)]; -end; } - -function HexOfCard(i: Cardinal): string; -var - a: Cardinal; -begin - Result := ''; - while i > 0 do begin - a := i and $F; - Result := HexChar[a] + Result; - i := i shr 4; - end; -end; - -function HexOfCard(i: Cardinal; Digits: Integer): string; -var - a: Cardinal; -begin - Result := ''; - while i > 0 do begin - a := i and $F; - Result := HexChar[a] + Result; - i := i shr 4; - end; - Result := MulStr('0', Digits - Length(Result)) + Result; -end; - -function PascalHexArray(a: TByteA; Name: string): string; -var - i, len: Integer; -begin - Result := 'const' + EOL + - ' ' + Name + ': array[0..' + IntToStr(High(a)) + '] of Byte = ('; - - len := Length(a); - for i := 0 to len-1 do begin - if (i mod 19) = 0 then - Result := Result + EOL + ' ' + ' '; - Result := Result + '$' + HexOfByte(a[i]); - if i < len-1 then - Result := Result + ','; - end; - Result := Result + EOL + ' );'; -end; - -function HexOfByteA(a: TByteA; Blocks: Integer = 1; - const Splitter: string = ' '): string; -var - i: Integer; -begin - Result := ''; - - if Blocks > 0 then - for i := 0 to High(a) do begin - Result := Result + HexOfByte(a[i]); - if i < High(a) then - if ((i+1) mod Blocks) = 0 then - Result := Result + Splitter; - end - else - for i := 0 to High(a) do - Result := Result + HexOfByte(a[i]); -end; - -function BinOfByteA(a: TByteA; Blocks: Integer = 4; - const Splitter: string = ' '): string; -var - i, max: Integer; - Bit: Boolean; -begin - Result := ''; - - if Blocks > 0 then begin - max := 8 * (High(a)) + 7; - for i := 0 to max do begin - Bit := 7-(i mod 8) in TBitSet(a[i div 8]); - Result := Result + Char(Byte('0') + Byte(Bit)); - if i < max then - if ((i+1) mod Blocks) = 0 then - Result := Result + Splitter; - end; - end else - for i := 0 to High(a) do - Result := Result + Char(Byte('0') + a[i] shr (i and 8)); -end; - -function CardOfHex(Hex: string): Cardinal; -var - i: Integer; -begin - Result := 0; - Hex := Copy(ExtractChars(Hex, HexadecimalChars), 1, 8); - - for i := 1 to Length(Hex) do - if Hex[i] <> '0' then - Inc(Result, HexOrd(Hex[i]) shl ((Length(Hex) - i) shl 2)); -end; - -function IntOfBin(Bin: string): Cardinal; -var - i: Integer; -begin - Result := 0; - Bin := Copy(ExtractChars(Bin, BinaryChars), 1, 32); - - for i := Length(Bin) downto 1 do - if Bin[i] = '1' then - Inc(Result, 1 shl (Length(Bin) - i)); -end; - -function BinOfInt(n: Cardinal): string; -var - a: Integer; -begin - if n = 0 then begin - Result := '0'; - exit; end; - - Result := ''; - while n > 0 do begin - a := n and 1; - Result := Char(a + Byte('0')) + Result; - n := n shr 1; - end; -end; - -function BinOfIntFill(n: Cardinal; MinCount: Integer = 8): string; -var - a: Integer; -begin - if n = 0 then begin - Result := MulStr('0', MinCount); - Exit; end; - - Result := ''; - while n > 0 do begin - a := n and 1; - Result := Char(a + Byte('0')) + Result; - n := n shr 1; - end; - Result := MulStr('0', MinCount - Length(Result)) + Result; -end; - -function BaseNOfInt(I: Cardinal; B: TBaseN): string; -var - a: Integer; -begin - if (B < 2) or (i = 0) then begin - Result := '0'; - Exit; end; - - Result := ''; - while i > 0 do begin - a := i mod B; - Result := BaseNChar[a] + Result; - i := i div B; - end; -end; - -function IntOfBaseN(V: string; B: TBaseN): Cardinal; -var - i: Integer; - F: Cardinal; - c: Byte; -begin - Result := 0; - V := TrimAll(V); - F := 1; - for i := Length(V) downto 1 do begin - c := Byte(UpCase(V[i])); - case Char(c) of - '0'..'9': c := c - 48; - 'A'..'Z': c := c - 55; - end; - if c < B then - Result := Result + Byte(c) * F; - F := F * B; - end; -end; - -function KeepIn(i, Bottom, Top: Variant): Variant; -begin - Result := i; - if Result > Top then - Result := Top - else if Result < Bottom then - Result := Bottom; -end; - -function InRange(Value, Bottom, Top: Variant): Boolean; -begin - Result := (Value >= Bottom) and (Value <= Top); -end; - -function InStrictRange(Value, Bottom, Top: Variant): Boolean; -begin - Result := (Value > Bottom) and (Value < Top); -end; - -function Min(const A, B: Integer): Integer; -begin - if A < B then - Result := A - else - Result := B; -end; - -function Min(const A: TIntA): Integer; -var - i: Integer; -begin - Result := 0; - if Length(A) = 0 then - Exit; - - Result := A[0]; - for i := 1 to High(A) do - if A[i] < Result then - Result := A[i]; -end; - -function Max(const A, B: Integer): Integer; -begin - if A > B then - Result := A - else - Result := B; -end; - -function Max(const A: TIntA): Integer; -var - i: Integer; -begin - Result := 0; - if Length(A) = 0 then - Exit; - - Result := A[0]; - for i := 1 to High(A) do - if A[i] > Result then - Result := A[i]; -end; - -function RangesOfStr(const S: string): TRanges; -var - SL: TStringList; - r, b, t: string; - i, p: Integer; - - function TryStrToCard(const S: string; out Value: Cardinal): Boolean; - var - E: Integer; - begin - Val(S, Value, E); - Result := E = 0; - end; - -begin - Result := nil; - SL := TStringList.Create; - try - Split(S, RangesSeparator, SL); - SetLength(Result, SL.Count); - for i := 0 to SL.Count-1 do begin - r := SL[i]; - with Result[i] do begin - p := CharPos(RangeInnerSeparator, r); - Simple := p = 0; // no '-' found - if Simple then begin - if r = RangeInfinite then begin // * --> *-* - Simple := False; - Bottom := Low(Bottom); - Top := High(Top); - end else if not TryStrToCard(r, Value) then - Break; - - end else begin - TileStr(r, p, p, b, t); - - if b = RangeInfinite then - Bottom := Low(Bottom) - else if not TryStrToCard(b, Bottom) then - Break; - - if t = RangeInfinite then - Top := High(Top) - else if not TryStrToCard(t, Top) then - Break; - if Bottom > Top then begin - p := Bottom; Bottom := Top; Top := p; - end; - end; - end; - end; - - if i <> SL.Count then - Result := nil; - - finally - SL.Free; - end; -end; - -function InRanges(Ranges: TRanges; TestValue: Cardinal): Boolean; -var - i: Integer; -begin - Result := True; - - for i := 0 to High(Ranges) do - with Ranges[i] do - if Simple then begin - if TestValue = Value then - Exit; - end else begin - if InRange(TestValue, Bottom, Top) then - Exit; - end; - - Result := False; -end; - -procedure WriteSL(Strings: TStrings; const Prefix: string = ''; - const Suffix: string = ''); -var - i: Integer; -begin - for i := 0 to Strings.Count-1 do - WriteLn(Prefix + Strings[i] + Suffix); -end; - -function Success(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; -begin - Result := (Res = ResultOnSuccess); - LastSuccessRes := Res; -end; - -function Failure(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; -begin - Result := not Success(Res, ResultOnSuccess); -end; - -function ExpandString(const S: string): string; -var - Len: Integer; - P, Res: PChar; -begin - Result := ''; - P := PChar(S); - Len := ExpandEnvironmentStrings(P, nil, 0); - if Len = 0 then - Exit; - - GetMem(Res, Len); - ExpandEnvironmentStrings(P, Res, Len); - - Result := Res; - FreeMem(Res, Len); -end; - -function FindAll(Strings: TStrings; const Mask: string; - ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile; - FileReturn: TFileNameFunc = nil): Boolean; -var - Path, FileName: string; - - procedure ScanDir(const Path, FileName: string); - var - PSR: TSearchRec; - Res: Integer; - - procedure Add(const S: string); - begin - if S <> '' then - Strings.Add(S); - end; - - begin - Res := FindFirst(Path + FileName, Attributes, PSR); - while Success(Res, 0) do begin - if Assigned(FileReturn) then - Add(FileReturn(Path + PSR.Name)) - else - Add(Path + PSR.Name); - Res := FindNext(PSR); - end; - FindClose(PSR); - if not ScanSubDirs then - Exit; - - Res := FindFirst(Path + '*', faDirectory, PSR); - while Success(Res, 0) do begin - if (PSR.Attr and faDirectory > 0) - and (PSR.Name <> '.') and (PSR.Name <> '..') then - ScanDir(Path + PSR.Name + '\', FileName); - Res := FindNext(PSR); - end; - FindClose(PSR); - end; - -begin - Strings.Clear; - Path := ExtractPath(Mask); - FileName := ExtractFileName(Mask); - ScanDir(Path, FileName); - Result := Strings.Count > 0; -end; - -function FindAllFirst(const Mask: string; ScanSubDirs: Boolean = True; - Attributes: Integer = faFindEveryFile): string; -var - Path, FileName: string; - - function ScanDir(const Path, FileName: string): Boolean; - var - PSR: TSearchRec; - Res: Integer; - begin - Result := False; - if Success(FindFirst(Path + FileName, Attributes, PSR), 0) then begin - FindAllFirst := Path + PSR.Name; - Result := True; - FindClose(PSR); - Exit; end; - if not ScanSubDirs then - Exit; - - Res := FindFirst(Path + '*', faDirectory, PSR); - while not Result and Success(Res, 0) do begin - if (PSR.Attr and faDirectory > 0) - and (PSR.Name <> '.') and (PSR.Name <> '..') then - Result := ScanDir(Path + PSR.Name + '\', FileName); - Res := FindNext(PSR); - end; - FindClose(PSR); - end; -begin - Result := ''; - Path := ExtractPath(Mask); - FileName := ExtractFileName(Mask); - ScanDir(Path, FileName); -end; - -procedure DeleteFiles(const Mask: string; ScanSubDirs: Boolean = True; - Attributes: Integer = faFindEveryFile); -var - Path, FileName: string; - - procedure ScanDir(const Path, FileName: string); - var - PSR: TSearchRec; - Res: Integer; - - procedure TryDeleteFile(const FileName: string); - begin - try - DeleteFile(Path + PSR.Name); - except - end; - end; - - begin - Res := FindFirst(Path + FileName, Attributes, PSR); - while Success(Res, 0) do begin - TryDeleteFile(Path + PSR.Name); - Res := FindNext(PSR); - end; - FindClose(PSR); - if not ScanSubDirs then - Exit; - - Res := FindFirst(Path + '*', faDirectory, PSR); - while Success(Res, 0) do begin - if (PSR.Attr and faDirectory > 0) - and (PSR.Name <> '.') and (PSR.Name <> '..') then begin - ScanDir(Path + PSR.Name + '\', FileName); - TryDeleteFile(Path + PSR.Name); - end; - Res := FindNext(PSR); - end; - FindClose(PSR); - end; -begin - Path := ExtractPath(Mask); - FileName := ExtractFileName(Mask); - ScanDir(Path, FileName); -end; - -function GetFileNew(FileName: string; NoFloppyDrives: Boolean = True): string; -var - Drive: string; - pf, pd, Len: Integer; - PSR: TSearchRec; -begin - Result := ''; - FileName := Trim(FileName); - if Length(FileName) < 2 then - Exit; - - Drive := ExtractDrive(FileName); - if not DirectoryExists(Drive) then - Exit; - - if NoFloppyDrives and (Drive[1] in ['A', 'B']) then - Exit; - - Len := Length(FileName); - Result := Drive; - pf := Length(Drive) + 1; - while pf <= Len do begin - if FileName[pf] = '\' then begin - Result := Result + '\'; - Inc(pf); - Continue; end; - - pd := CharPos('\', FileName, pf); - if pd = 0 then begin - if 0=FindFirst(Result + Copy(FileName, pf, MaxInt), faFindEveryFile, PSR) then begin - Result := Result + PSR.Name; - Break; end else begin - FindClose(PSR); - if 0=FindFirst(Result + Copy(FileName, pf, MaxInt), faDirectory, PSR) then - Result := Result + PSR.Name + '\' - else - Result := ''; - FindClose(PSR); - if Result = '' then - Break; - end; - end; - - if 0=FindFirst(Result + Copy(FileName, pf, pd - pf), faDirectory, PSR) then - Result := Result + PSR.Name + '\' - else - Result := ''; - FindClose(PSR); - if Result = '' then - Break; - - pf := pd + 1; - end; - - if (Result <> '') and not FileEx(Result, True) then - Result := ''; -end; - -function DateTimeOfFileTime(const FileTime: TFileTime): TDateTime; -var - LocalFileTime: TFileTime; - Res: Integer; -begin - Result := 0; - - FileTimeToLocalFileTime(FileTime, LocalFileTime); - if not FileTimeToDosDateTime(LocalFileTime, LongRec(Res).Hi, - LongRec(Res).Lo) then - Res := -1; - - if (Res = -1) or (Res = 0) then - Exit; - try - Result := FileDateToDateTime(Res); - except - end; -end; - -procedure FileNew(const FileName: string); -var - Handle: Integer; -begin - Handle := FileCreate(FileName); - FileClose(Handle); -end; - -function Win32PlatformStr: string; -const - PlatformStrings: array[VER_PLATFORM_WIN32s..VER_PLATFORM_WIN32_NT] of string = - ('VER_PLATFORM_WIN32s', 'VER_PLATFORM_WIN32_WINDOWS', 'VER_PLATFORM_WIN32_NT'); -begin - Result := PlatformStrings[Win32Platform]; -end; - -function FullOSInfo: string; -begin - Result := Format( - 'Platform: %s' + EOL + - 'Version: %d.%d Build %d' + EOL + - 'CSD: %s', - [ - Win32PlatformStr, - Win32MajorVersion, Win32MinorVersion, Win32BuildNumber, - Win32CSDVersion - ] - ); -end; - -function Win9x: Boolean; -begin - Result := Win32Platform = VER_PLATFORM_WIN32_WINDOWS; -end; - -function WinNT: Boolean; -begin - Result := Win32Platform = VER_PLATFORM_WIN32_NT; -end; - -function Win2000: Boolean; -begin - Result := (Win32Platform = VER_PLATFORM_WIN32_NT) - and (Win32MajorVersion = 4); -end; - -function WinXP: Boolean; -begin - Result := Win32MajorVersion >= 5; -end; - -initialization - MyDir := GetMyDir; - -end. - -unit FifoStream; - -interface - -uses Classes, windows, Dialogs; - -const - DefaultChunksize = 32768; // 32kb per chunk as default. - -type - PMemChunk = ^TMemChunk; - TMemChunk = record - Filled: Longword; - Read: Longword; - Data: pointer; - end; - - TFifo = class - private - FBuffers: TList; - FChunksize: Longword; - FCritSect: TRTLCriticalSection; - FIsWinNT: boolean; - FBytesInFifo: LongWord; - protected - function GetBytesInFifo: LongWord; - public - constructor Create; - destructor Destroy; override; - procedure Write(Data: pointer; Size: LongWord); - procedure Read(Buff: pointer; var ReqSize: LongWord); - procedure PeekData(Buff: pointer; var ReqSize: LongWord); - published - property BytesInFifo: LongWord read FBytesInFifo; - end; - -implementation - -constructor TFifo.Create; -begin - inherited; - FBuffers := TList.Create; - // set default chunksize... - FChunksize := DefaultChunksize; - InitializeCriticalSection(FCritSect); -end; - -destructor TFifo.Destroy; -var - I: Integer; -begin - EnterCriticalSection(FCritSect); - for I := 0 to FBuffers.count - 1 do - begin - FreeMem(PMemChunk(Fbuffers[I]).Data); - Dispose(PMemChunk(Fbuffers[I])); - end; - FBuffers.Clear; - FBuffers.Free; - LeaveCriticalSection(FCritSect); - - DeleteCriticalSection(FCritSect); - inherited; -end; - -function TFifo.GetBytesInFifo: LongWord; -begin - Result := 0; - if FBuffers.Count = 0 then - begin - exit; - end - else - begin - if FBuffers.Count > 1 then - Inc(Result, (FBuffers.Count - 1) * FChunkSize); - Inc(Result, PMemChunk(FBuffers[Fbuffers.Count - 1]).Filled); - Dec(Result, PMemChunk(FBuffers[0]).Read); - end; -end; - -procedure TFifo.Write(Data: pointer; Size: LongWord); -var - Privpointer: pointer; - PrivSize: LongWord; - Chunk: PMemChunk; - PosInChunk: pointer; -begin - if LongWord(Data) = 0 then - begin - // null pointer? somebody is trying to fool us, get out... - Exit; - end; - EnterCriticalSection(FCritSect); - PrivPointer := Data; - PrivSize := 0; - // are already buffers there? - if FBuffers.count > 0 then - begin - // is the last one of them not completely filled? - if PMemChunk(FBuffers[FBuffers.count - 1]).filled < FChunksize then - // not completely filled, so fill up the buffer. - begin - Chunk := PMemChunk(FBuffers[FBuffers.count - 1]); - // fetch chunkdata. - PosInChunk := Chunk.Data; - // move to current fill pos... - Inc(LongWord(PosInChunk), Chunk.Filled); - // can we fill the chunk completely? - if Size > FChunksize - Chunk.Filled then - begin - // yes we can. - Move(PrivPointer^, PosInChunk^, FChunksize - Chunk.Filled); - Inc(PrivSize, FChunksize - Chunk.Filled); - Inc(LongWord(PrivPointer), FChunksize - Chunk.Filled); - Chunk.Filled := FChunkSize; - end - else - // we have to less data for filling the chunk completely, - // just put everything in. - begin - Move(PrivPointer^, PosInChunk^, Size); - Inc(PrivSize, Size); - Inc(Chunk.Filled, Size); - end; - end; - end; - // as long as we have remaining stuff put it into new chunks. - while (PrivSize < Size) do - begin - new(Chunk); - GetMem(Chunk.Data, FChunksize); - Chunk.Read := 0; - // can we fill an entire chunk with the remaining data? - if Privsize + FChunksize < Size then - begin - // yes we can, so put the stuff in. - Move(Privpointer^, Chunk.Data^, FChunksize); - Inc(LongWord(PrivPointer), FChunksize); - Inc(PrivSize, FChunksize); - Chunk.Filled := FChunksize; - end - else // we have to less data to fill the entire chunk, just put the remaining stuff in. - begin - Move(Privpointer^, Chunk.Data^, Size - Privsize); - Chunk.Filled := Size - Privsize; - Inc(PrivSize, Size - Privsize); - end; - Fbuffers.Add(Chunk); - end; - if Size <> Privsize then - Showmessage('miscalculation in TFifo.write'); - FBytesInFifo := GetBytesInFifo; - LeaveCriticalSection(FCritSect); -end; - -procedure TFifo.Read(Buff: pointer; var ReqSize: LongWord); -var - PrivSize: Integer; - Privpos: pointer; - Chunk: PMemChunk; - ChunkPos: pointer; -begin - if LongWord(Buff) = 0 then - begin - // null pointer? somebody is trying to fool us, get out... - Exit; - end; - EnterCriticalSection(FCritSect); - PrivSize := 0; - Privpos := Buff; - while FBuffers.Count > 0 do - begin - Chunk := PMemChunk(FBuffers[0]); - ChunkPos := Chunk.data; - Inc(LongWord(ChunkPos), Chunk.Read); - // does the remaining part of the chunk fit into the buffer? - if PrivSize + (Chunk.Filled - Chunk.read) < ReqSize then - begin // yep, it fits - Move(ChunkPos^, Privpos^, Chunk.Filled - Chunk.read); - Inc(PrivSize, Chunk.Filled - Chunk.read); - FreeMem(Chunk.Data); - Dispose(Chunk); - FBuffers.Delete(0); - end - else // remaining part didn't fit, get as much as we can and increment the - // read attribute. - begin - Move(ChunkPos^, Privpos^, ReqSize - PrivSize); - Inc(Chunk.read, ReqSize - PrivSize); - Inc(PrivSize, ReqSize - PrivSize); - // as we filled the buffer, we'll have to break here. - break; - end; - end; - FBytesInFifo := GetBytesInFifo; - LeaveCriticalSection(FCritSect); - ReqSize := PrivSize; -end; - -// read Data from Stream without removing it from the Stream... - -procedure TFifo.PeekData(Buff: pointer; var ReqSize: LongWord); -var - PrivSize: Integer; - Privpos: pointer; - Chunk: PMemChunk; - ChunkPos: pointer; - ChunkNr: Integer; -begin - if LongWord(Buff) = 0 then - begin - // null pointer? somebody is trying to fool us, get out... - Exit; - end; - EnterCriticalSection(FCritSect); - PrivSize := 0; - Privpos := Buff; - ChunkNr := 0; - while FBuffers.Count > ChunkNr do - begin - Chunk := PMemChunk(FBuffers[ChunkNr]); - ChunkPos := Chunk.data; - Inc(LongWord(ChunkPos), Chunk.Read); - // does the remaining part of the chunk fit into the buffer? - if PrivSize + (Chunk.Filled - Chunk.read) < ReqSize then - begin // yep, it fits - Move(ChunkPos^, Privpos^, Chunk.Filled - Chunk.read); - Inc(PrivSize, Chunk.Filled - Chunk.read); - Inc(ChunkNr); - end - else // remaining part didn't fit, get as much as we can and increment the - // read attribute. - begin - Move(ChunkPos^, Privpos^, ReqSize - PrivSize); - Inc(PrivSize, ReqSize - PrivSize); - // as we filled the buffer, we'll have to break here. - break; - end; - end; - LeaveCriticalSection(FCritSect); - ReqSize := PrivSize; -end; - -end. diff --git a/test/scanners/diff/coderay200vs250.expected.raydebug b/test/scanners/diff/coderay200vs250.expected.raydebug deleted file mode 100644 index 79ae9a5..0000000 --- a/test/scanners/diff/coderay200vs250.expected.raydebug +++ /dev/null @@ -1,2241 +0,0 @@ -head[head(Index: )plain(lib/coderay/token_classes.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/token_classes.rb)plain( (revision 0\))] -head[head(+++ )filename(lib/coderay/token_classes.rb)plain( (revision 250\))] -change[change(@@)plain( -0,0 +1,71 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+) reserved(class) class(Tokens)] -insert[insert(+) constant(ClassOfKind) operator(=) constant(Hash)operator(.)ident(new) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|)] -insert[insert(+) ident(h)operator([)ident(k)operator(]) operator(=) ident(k)operator(.)ident(to_s)] -insert[insert(+) reserved(end)] -insert[insert(+) constant(ClassOfKind)operator(.)ident(update) ident(with) operator(=) operator({)] -insert[insert(+) symbol(:attribute_name) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:attribute_name_fat) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:attribute_value) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:attribute_value_fat) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:bin) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:char) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:class) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:class_variable) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:color) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:comment) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:constant) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:content) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:definition) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:delimiter) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:directive) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:doc) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:doc_string) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:entity) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:error) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:escape) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:exception) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:float) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:function) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:global_variable) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:hex) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:include) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:inline) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:inline_delimiter) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:instance_variable) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:integer) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:interpreted) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:label) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:local_variable) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:modifier) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:oct) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:operator_fat) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:pre_constant) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:pre_type) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:predefined) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:preprocessor) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:regexp) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:reserved) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:shell) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:string) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:symbol) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:tag) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:tag_fat) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:tag_special) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:type) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:variable) operator(=)operator(>) stringoperator(,)] -insert[insert(+) symbol(:xml_text) operator(=)operator(>) stringoperator(,)] -insert[insert(+)] -insert[insert(+) symbol(:ident) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'id')] -insert[insert(+) comment(#:operator => 'op',)] -insert[insert(+) symbol(:operator) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'op')] -insert[insert(+) symbol(:space) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'sp')] -insert[insert(+) symbol(:plain) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,)] -insert[insert(+) operator(})] -insert[insert(+) constant(ClassOfKind)operator([)symbol(:procedure)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:method)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:function)operator(])] -insert[insert(+) constant(ClassOfKind)operator([)symbol(:open)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:close)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -insert[insert(+) constant(ClassOfKind)operator([)symbol(:nesting_delimiter)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -insert[insert(+) constant(ClassOfKind)operator([)symbol(:escape)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -insert[insert(+) comment(#ClassOfKind.default = ClassOfKind[:error] or raise 'no class found for :error!')] -insert[insert(+) reserved(end)] -insert[insert(+)reserved(end)] -change[change(\\ )plain(No newline at end of file)] - -head[head(Property changes on: )plain(lib/coderay/token_classes.rb)] -head[head(___________________________________________________________________)filename()] -head[head(Added: )plain(svn:executable)] -insert[insert( +)plain( *)] - -head[head(Index: )plain(lib/coderay/encoder.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoder.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoder.rb)plain( (revision 250\))] -change[change(@@)plain( -1,3 +1,5 )change(@@)] -insert[insert(+)ident(require) string] -insert[insert(+)] - reserved(module) class(CodeRay) - - comment(# This module holds the Encoder class and its subclasses.) -change[change(@@)plain( -40,7 +42,7 )change(@@)] - comment(# downcase class name instead.) - reserved(def) method(const_missing) ident(sym) - reserved(if) ident(sym) operator(==) symbol(:FILE_EXTENSION) -delete[delete(-) ident(sym)operator(.)ident(to_s)operator(.)ident(downcase)] -insert[insert(+) ident(plugin_id)] - reserved(else) - reserved(super) - reserved(end) -change[change(@@)plain( -130,13 +132,15 )change(@@)] - comment(# By default, it calls text_token or block_token, depending on) - comment(# whether +text+ is a String.) - reserved(def) method(token) ident(text)operator(,) ident(kind) -delete[delete(-) reserved(if) ident(text)operator(.)ident(instance_of?) operator(::)constant(String) comment(# Ruby 1.9: :open.is_a? String)] -delete[delete(-) ident(text_token) ident(text)operator(,) ident(kind)] -delete[delete(-) reserved(elsif) ident(text)operator(.)ident(is_a?) operator(::)constant(Symbol)] -delete[delete(-) ident(block_token) ident(text)operator(,) ident(kind)] -delete[delete(-) reserved(else)] -delete[delete(-) ident(raise) string operator(%) ident(text)] -delete[delete(-) reserved(end)] -insert[insert(+) ident(out) operator(=)] -insert[insert(+) reserved(if) ident(text)operator(.)ident(is_a?) operator(::)constant(String) comment(# Ruby 1.9: :open.is_a? String)] -insert[insert(+) ident(text_token) ident(text)operator(,) ident(kind)] -insert[insert(+) reserved(elsif) ident(text)operator(.)ident(is_a?) operator(::)constant(Symbol)] -insert[insert(+) ident(block_token) ident(text)operator(,) ident(kind)] -insert[insert(+) reserved(else)] -insert[insert(+) ident(raise) string operator(%) ident(text)] -insert[insert(+) reserved(end)] -insert[insert(+) instance_variable(@out) operator(<<) ident(out) reserved(if) reserved(defined?)operator(()instance_variable(@out)operator(\)) operator(&&) instance_variable(@out)] - reserved(end) - - reserved(def) method(text_token) ident(text)operator(,) ident(kind) -change[change(@@)plain( -164,7 +168,8 )change(@@)] - comment(# The already created +tokens+ object must be used; it can be a) - comment(# TokenStream or a Tokens object.) - reserved(def) method(compile) ident(tokens)operator(,) ident(options) -delete[delete(-) ident(tokens)operator(.)ident(each)operator(()operator(&)pre_constant(self)operator(\))] -insert[insert(+) ident(tokens)operator(.)ident(each) operator({) operator(|)ident(text)operator(,) ident(kind)operator(|) ident(token) ident(text)operator(,) ident(kind) operator(}) comment(# FIXME for Ruby 1.9?)] -insert[insert(+) comment(#tokens.each(&self\))] - reserved(end) - - reserved(end) -head[head(Index: )plain(lib/coderay/encoders/xml.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/xml.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/xml.rb)plain( (revision 250\))] -change[change(@@)plain( -22,7 +22,6 )change(@@)] - ident(protected) - - reserved(def) method(setup) ident(options) -delete[delete(-) instance_variable(@out) operator(=) string] - instance_variable(@doc) operator(=) constant(REXML)operator(::)constant(Document)operator(.)ident(new) - instance_variable(@doc) operator(<<) constant(REXML)operator(::)constant(XMLDecl)operator(.)ident(new) - instance_variable(@tab_width) operator(=) ident(options)operator([)symbol(:tab_width)operator(]) -change[change(@@)plain( -33,7 +32,7 )change(@@)] - instance_variable(@doc)operator(.)ident(write) instance_variable(@out)operator(,) ident(options)operator([)symbol(:pretty)operator(])operator(,) ident(options)operator([)symbol(:transitive)operator(])operator(,) pre_constant(true) - instance_variable(@out) - reserved(end) -delete[delete(-)] -insert[insert(+) ] - reserved(def) method(text_token) ident(text)operator(,) ident(kind) - reserved(if) ident(kind) operator(==) symbol(:space) - ident(token) operator(=) instance_variable(@node) -head[head(Index: )plain(lib/coderay/encoders/html/classes.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/html/classes.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/html/classes.rb)plain( (revision 250\))] -change[change(@@)plain( -1,77 +0,0 )change(@@)] -delete[delete(-)reserved(module) class(CodeRay)] -delete[delete(-)reserved(module) class(Encoders)] -delete[delete(-)] -delete[delete(-) reserved(class) class(HTML)] -delete[delete(-)] -delete[delete(-) constant(ClassOfKind) operator(=) constant(Hash)operator(.)ident(new) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|)] -delete[delete(-) ident(h)operator([)ident(k)operator(]) operator(=) ident(k)operator(.)ident(to_s)] -delete[delete(-) reserved(end)] -delete[delete(-) constant(ClassOfKind)operator(.)ident(update) ident(with) operator(=) operator({)] -delete[delete(-) symbol(:attribute_name) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:attribute_name_fat) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:attribute_value) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:attribute_value_fat) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:bin) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:char) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:class) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:class_variable) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:color) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:comment) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:constant) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:content) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:definition) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:delimiter) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:directive) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:doc) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:doc_string) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:entity) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:error) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:escape) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:exception) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:float) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:function) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:global_variable) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:hex) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:include) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:inline) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:inline_delimiter) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:instance_variable) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:integer) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:interpreted) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:label) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:local_variable) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:modifier) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:oct) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:operator_name) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:pre_constant) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:pre_type) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:predefined) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:preprocessor) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:regexp) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:reserved) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:shell) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:string) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:symbol) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:tag) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:tag_fat) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:tag_special) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:type) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:variable) operator(=)operator(>) stringoperator(,)] -delete[delete(-) symbol(:xml_text) operator(=)operator(>) stringoperator(,)] -delete[delete(-)] -delete[delete(-) symbol(:ident) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'id')] -delete[delete(-) comment(#:operator => 'op',)] -delete[delete(-) symbol(:operator) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'op')] -delete[delete(-) symbol(:space) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'sp')] -delete[delete(-) symbol(:plain) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,)] -delete[delete(-) operator(})] -delete[delete(-) constant(ClassOfKind)operator([)symbol(:procedure)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:method)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:function)operator(])] -delete[delete(-) constant(ClassOfKind)operator([)symbol(:open)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:close)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -delete[delete(-) constant(ClassOfKind)operator([)symbol(:nesting_delimiter)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -delete[delete(-) constant(ClassOfKind)operator([)symbol(:escape)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -delete[delete(-) comment(#ClassOfKind.default = ClassOfKind[:error] or raise 'no class found for :error!')] -delete[delete(-)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-)reserved(end)] -delete[delete(-)reserved(end)] -head[head(Index: )plain(lib/coderay/encoders/html/numerization.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/html/numerization.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/html/numerization.rb)plain( (revision 250\))] -change[change(@@)plain( -51,12 +51,12 )change(@@)] - reserved(case) ident(mode) - reserved(when) symbol(:inline) - ident(max_width) operator(=) operator(()ident(start) operator(+) ident(line_count)operator(\))operator(.)ident(to_s)operator(.)ident(size) -delete[delete(-) ident(line) operator(=) ident(start)] -insert[insert(+) ident(line_number) operator(=) ident(start)] - ident(gsub!)operator(()regexpoperator(\)) reserved(do) -delete[delete(-) ident(line_number) operator(=) ident(bolding)operator(.)ident(call) ident(line)] -delete[delete(-) ident(indent) operator(=) string operator(*) operator(()ident(max_width) operator(-) ident(line)operator(.)ident(to_s)operator(.)ident(size)operator(\))] -delete[delete(-) ident(res) operator(=) string)inlineinlinecontent( )delimiter(")>] -delete[delete(-) ident(line) operator(+=) integer(1)] -insert[insert(+) ident(line_number_text) operator(=) ident(bolding)operator(.)ident(call) ident(line_number)] -insert[insert(+) ident(indent) operator(=) string operator(*) operator(()ident(max_width) operator(-) ident(line_number)operator(.)ident(to_s)operator(.)ident(size)operator(\)) comment(# TODO: Optimize (10^x\))] -insert[insert(+) ident(res) operator(=) string)inlineinlinecontent( )delimiter(")>] -insert[insert(+) ident(line_number) operator(+=) integer(1)] - ident(res) - reserved(end) - -head[head(Index: )plain(lib/coderay/encoders/tokens.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/tokens.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/tokens.rb)plain( (revision 250\))] -change[change(@@)plain( -33,9 +33,9 )change(@@)] - - constant(FILE_EXTENSION) operator(=) string - -delete[delete(-) ident(protected)] -delete[delete(-) reserved(def) method(token) operator(*)ident(args)] -delete[delete(-) instance_variable(@out) operator(<<) constant(CodeRay)operator(::)constant(Tokens)operator(.)ident(write_token)operator(()operator(*)ident(args)operator(\))] -insert[insert(+) ident(protected)] -insert[insert(+) reserved(def) method(token) ident(text)operator(,) ident(kind)] -insert[insert(+) instance_variable(@out) operator(<<) constant(CodeRay)operator(::)constant(Tokens)operator(.)ident(write_token)operator(()ident(text)operator(,) ident(kind)operator(\))] - reserved(end) - - reserved(end) -head[head(Index: )plain(lib/coderay/encoders/html.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/html.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/html.rb)plain( (revision 250\))] -change[change(@@)plain( -1,3 +1,5 )change(@@)] -insert[insert(+)ident(require) string] -insert[insert(+)] - reserved(module) class(CodeRay) - reserved(module) class(Encoders) - -change[change(@@)plain( -10,7 +12,8 )change(@@)] - comment(#) - comment(# require 'coderay') - comment(# puts CodeRay.scan('Some /code/', :ruby\).html #-> a HTML page) -delete[delete(-) comment(# puts CodeRay.scan('Some /code/', :ruby\).html(:wrap => :span\) #-> Some /code/)] -insert[insert(+) comment(# puts CodeRay.scan('Some /code/', :ruby\).html(:wrap => :span\))] -insert[insert(+) comment(# #-> Some /code/)] - comment(# puts CodeRay.scan('Some /code/', :ruby\).span #-> the same) - comment(# ) - comment(# puts CodeRay.scan('Some code', :ruby\).html() -change[change(@@)plain( -55,7 +58,8 )change(@@)] - comment(#) - comment(# === :hint) - comment(# Include some information into the output using the title attribute.) -delete[delete(-) comment(# Can be :info (show token type on mouse-over\), :info_long (with full path\) or :debug (via inspect\).)] -insert[insert(+) comment(# Can be :info (show token type on mouse-over\), :info_long (with full path\))] -insert[insert(+) comment(# or :debug (via inspect\).)] - comment(#) - comment(# Default: false) - reserved(class) class(HTML) operator(<) constant(Encoder) -change[change(@@)plain( -82,7 +86,7 )change(@@)] - symbol(:hint) operator(=)operator(>) pre_constant(false)operator(,) - operator(}) - -delete[delete(-) ident(helper) symbol(:classes)operator(,) symbol(:output)operator(,) symbol(:css)] -insert[insert(+) ident(helper) symbol(:output)operator(,) symbol(:css)] - - ident(attr_reader) symbol(:css) - -change[change(@@)plain( -115,11 +119,14 )change(@@)] - reserved(end) - operator(}) - -insert[insert(+) constant(TRANSPARENT_TOKEN_KINDS) operator(=) operator([)] -insert[insert(+) symbol(:delimiter)operator(,) symbol(:modifier)operator(,) symbol(:content)operator(,) symbol(:escape)operator(,) symbol(:inline_delimiter)operator(,)] -insert[insert(+) operator(])operator(.)ident(to_set)] -insert[insert(+)] - comment(# Generate a hint about the given +classes+ in a +hint+ style.) - comment(#) - comment(# +hint+ may be :info, :info_long or :debug.) - reserved(def) pre_constant(self)operator(.)method(token_path_to_hint) ident(hint)operator(,) ident(classes) -delete[delete(-) reserved(return) string reserved(unless) ident(hint)] - ident(title) operator(=) - reserved(case) ident(hint) - reserved(when) symbol(:info) -change[change(@@)plain( -129,7 +136,7 )change(@@)] - reserved(when) symbol(:debug) - ident(classes)operator(.)ident(inspect) - reserved(end) -delete[delete(-) stringchar(\\")delimiter(")>] -insert[insert(+) ident(title) operator(?) stringchar(\\")delimiter(")> operator(:) string] - reserved(end) - - reserved(def) method(setup) ident(options) -change[change(@@)plain( -143,42 +150,45 )change(@@)] - - ident(hint) operator(=) ident(options)operator([)symbol(:hint)operator(]) - reserved(if) ident(hint) reserved(and) reserved(not) operator([)symbol(:debug)operator(,) symbol(:info)operator(,) symbol(:info_long)operator(])operator(.)ident(include?) ident(hint) -delete[delete(-) ident(raise) constant(ArgumentError)operator(,) string operator(%) ident(hint)] -insert[insert(+) ident(raise) constant(ArgumentError)operator(,) string] -insert[insert(+) ident(expected) symbol(:info)operator(,) symbol(:debug)operator(,) pre_constant(false)operator(,) reserved(or) pre_constant(nil)operator(.)string] - reserved(end) - - reserved(case) ident(options)operator([)symbol(:css)operator(]) - - reserved(when) symbol(:class) - instance_variable(@css_style) operator(=) constant(Hash)operator(.)ident(new) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|) -delete[delete(-) reserved(if) ident(k)operator(.)ident(is_a?) constant(Array)] -delete[delete(-) ident(type) operator(=) ident(k)operator(.)ident(first)] -delete[delete(-) reserved(else)] -delete[delete(-) ident(type) operator(=) ident(k)] -delete[delete(-) reserved(end)] -delete[delete(-) ident(c) operator(=) constant(ClassOfKind)operator([)ident(type)operator(])] -insert[insert(+) ident(c) operator(=) constant(CodeRay)operator(::)constant(Tokens)operator(::)constant(ClassOfKind)operator([)ident(k)operator(.)ident(first)operator(])] - reserved(if) ident(c) operator(==) symbol(:NO_HIGHLIGHT) reserved(and) reserved(not) ident(hint) -delete[delete(-) ident(h)operator([)ident(k)operator(]) operator(=) pre_constant(false)] -insert[insert(+) ident(h)operator([)ident(k)operator(.)ident(dup)operator(]) operator(=) pre_constant(false)] - reserved(else) -delete[delete(-) ident(title) operator(=) constant(HTML)operator(.)ident(token_path_to_hint) ident(hint)operator(,) operator(()ident(k)operator([)integer(1)operator(..)integer(-1)operator(]) operator(<<) ident(k)operator(.)ident(first)operator(\))] -delete[delete(-) ident(h)operator([)ident(k)operator(]) operator(=) string)delimiter(')> operator(%) operator([)ident(title)operator(,) ident(c)operator(])] -insert[insert(+) ident(title) operator(=) reserved(if) ident(hint)] -insert[insert(+) constant(HTML)operator(.)ident(token_path_to_hint)operator(()ident(hint)operator(,) ident(k)operator([)integer(1)operator(..)integer(-1)operator(]) operator(<<) ident(k)operator(.)ident(first)operator(\))] -insert[insert(+) reserved(else)] -insert[insert(+) string] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(if) ident(c) operator(==) symbol(:NO_HIGHLIGHT)] -insert[insert(+) ident(h)operator([)ident(k)operator(.)ident(dup)operator(]) operator(=) string)delimiter(')> operator(%) operator([)ident(title)operator(])] -insert[insert(+) reserved(else)] -insert[insert(+) ident(h)operator([)ident(k)operator(.)ident(dup)operator(]) operator(=) string)delimiter(')> operator(%) operator([)ident(title)operator(,) ident(c)operator(])] -insert[insert(+) reserved(end)] - reserved(end) - reserved(end) - - reserved(when) symbol(:style) - instance_variable(@css_style) operator(=) constant(Hash)operator(.)ident(new) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|) -delete[delete(-) reserved(if) ident(k)operator(.)ident(is_a?) constant(Array)] -insert[insert(+) reserved(if) ident(k)operator(.)ident(is_a?) operator(::)constant(Array)] - ident(styles) operator(=) ident(k)operator(.)ident(dup) - reserved(else) - ident(styles) operator(=) operator([)ident(k)operator(]) - reserved(end) - ident(type) operator(=) ident(styles)operator(.)ident(first) -delete[delete(-) ident(classes) operator(=) ident(styles)operator(.)ident(map) operator({) operator(|)ident(c)operator(|) constant(ClassOfKind)operator([)ident(c)operator(]) operator(})] -insert[insert(+) ident(classes) operator(=) ident(styles)operator(.)ident(map) operator({) operator(|)ident(c)operator(|) constant(Tokens)operator(::)constant(ClassOfKind)operator([)ident(c)operator(]) operator(})] - reserved(if) ident(classes)operator(.)ident(first) operator(==) symbol(:NO_HIGHLIGHT) reserved(and) reserved(not) ident(hint) - ident(h)operator([)ident(k)operator(]) operator(=) pre_constant(false) - reserved(else) -delete[delete(-) ident(styles)operator(.)ident(shift) reserved(if) operator([)symbol(:delimiter)operator(,) symbol(:modifier)operator(,) symbol(:content)operator(,) symbol(:escape)operator(])operator(.)ident(include?) ident(styles)operator(.)ident(first)] -insert[insert(+) ident(styles)operator(.)ident(shift) reserved(if) constant(TRANSPARENT_TOKEN_KINDS)operator(.)ident(include?) ident(styles)operator(.)ident(first)] - ident(title) operator(=) constant(HTML)operator(.)ident(token_path_to_hint) ident(hint)operator(,) ident(styles) -delete[delete(-) ident(classes)operator(.)ident(delete) string] - ident(style) operator(=) instance_variable(@css)operator([)operator(*)ident(classes)operator(]) - ident(h)operator([)ident(k)operator(]) operator(=) - reserved(if) ident(style) -change[change(@@)plain( -198,7 +208,9 )change(@@)] - reserved(def) method(finish) ident(options) - ident(not_needed) operator(=) instance_variable(@opened)operator(.)ident(shift) - instance_variable(@out) operator(<<) string)delimiter(')> operator(*) instance_variable(@opened)operator(.)ident(size) -delete[delete(-) ident(warn) string operator(%) operator([)instance_variable(@opened)operator(.)ident(size)operator(,) instance_variable(@opened)operator(]) reserved(unless) instance_variable(@opened)operator(.)ident(empty?)] -insert[insert(+) reserved(unless) instance_variable(@opened)operator(.)ident(empty?)] -insert[insert(+) ident(warn) string operator(%) operator([)instance_variable(@opened)operator(.)ident(size)operator(,) instance_variable(@opened)operator(])] -insert[insert(+) reserved(end)] - - instance_variable(@out)operator(.)ident(extend) constant(Output) - instance_variable(@out)operator(.)ident(css) operator(=) instance_variable(@css) -change[change(@@)plain( -229,8 +241,9 )change(@@)] - reserved(if) instance_variable(@opened)operator(.)ident(empty?) - comment(# nothing to close) - reserved(else) -delete[delete(-) reserved(if) instance_variable(@opened)operator(.)ident(size) operator(==) integer(1) reserved(or) instance_variable(@opened)operator(.)ident(last) operator(!=) ident(type)] -delete[delete(-) ident(raise) string operator(%) operator([)ident(type)operator(,) instance_variable(@opened)operator([)integer(1)operator(..)integer(-1)operator(])operator(]) reserved(if) global_variable($DEBUG)] -insert[insert(+) reserved(if) global_variable($DEBUG) reserved(and) operator(()instance_variable(@opened)operator(.)ident(size) operator(==) integer(1) reserved(or) instance_variable(@opened)operator(.)ident(last) operator(!=) ident(type)operator(\))] -insert[insert(+) ident(raise) string] -insert[insert(+) ident(that) ident(is) reserved(not) ident(open)operator(.) ident(Open) ident(are)operator(:) operator(%)ident(p)operator(.)string] - reserved(end) - instance_variable(@out) operator(<<) string)delimiter(')> - instance_variable(@opened)operator(.)ident(pop) -head[head(Index: )plain(lib/coderay/encoders/text.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/text.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/text.rb)plain( (revision 250\))] -change[change(@@)plain( -14,13 +14,12 )change(@@)] - - ident(protected) - reserved(def) method(setup) ident(options) -delete[delete(-) reserved(super)] -insert[insert(+) instance_variable(@out) operator(=) string] - instance_variable(@sep) operator(=) ident(options)operator([)symbol(:separator)operator(]) - reserved(end) - - reserved(def) method(token) ident(text)operator(,) ident(kind) -delete[delete(-) reserved(return) reserved(unless) ident(text)operator(.)ident(respond_to?) symbol(:to_str)] -delete[delete(-) instance_variable(@out) operator(<<) ident(text) operator(+) instance_variable(@sep)] -insert[insert(+) instance_variable(@out) operator(<<) ident(text) operator(+) instance_variable(@sep) reserved(if) ident(text)operator(.)ident(is_a?) operator(::)constant(String)] - reserved(end) - - reserved(def) method(finish) ident(options) -head[head(Index: )plain(lib/coderay/encoders/debug.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/debug.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/debug.rb)plain( (revision 250\))] -change[change(@@)plain( -19,19 +19,14 )change(@@)] - - ident(protected) - reserved(def) method(text_token) ident(text)operator(,) ident(kind) -delete[delete(-) instance_variable(@out) operator(<<)] -delete[delete(-) reserved(if) ident(kind) operator(==) symbol(:space)] -delete[delete(-) ident(text)] -delete[delete(-) reserved(else)] -delete[delete(-) ident(text) operator(=) ident(text)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))] -delete[delete(-) stringcontent(()inlinecontent(\))delimiter(")>] -delete[delete(-) reserved(end)] -insert[insert(+) reserved(if) ident(kind) operator(==) symbol(:space)] -insert[insert(+) ident(text)] -insert[insert(+) reserved(else)] -insert[insert(+) ident(text) operator(=) ident(text)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) comment(# escape \) and \\)] -insert[insert(+) stringcontent(()inlinecontent(\))delimiter(")>] -insert[insert(+) reserved(end)] - reserved(end) - -delete[delete(-) reserved(def) method(block_token) ident(action)operator(,) ident(kind)] -delete[delete(-) instance_variable(@out) operator(<<) reserved(super)] -delete[delete(-) reserved(end)] -delete[delete(-)] - reserved(def) method(open_token) ident(kind) - stringcontent(<)delimiter(")> - reserved(end) -head[head(Index: )plain(lib/coderay/encoders/statistic.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/statistic.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/statistic.rb)plain( (revision 250\))] -change[change(@@)plain( -28,19 +28,15 )change(@@)] - instance_variable(@type_stats)operator([)ident(kind)operator(])operator(.)ident(count) operator(+=) integer(1) - instance_variable(@type_stats)operator([)ident(kind)operator(])operator(.)ident(size) operator(+=) ident(text)operator(.)ident(size) - instance_variable(@type_stats)operator([)stringoperator(])operator(.)ident(size) operator(+=) ident(text)operator(.)ident(size) -insert[insert(+) instance_variable(@type_stats)operator([)stringoperator(])operator(.)ident(count) operator(+=) integer(1)] - reserved(end) - - comment(# TODO Hierarchy handling) - reserved(def) method(block_token) ident(action)operator(,) ident(kind) -delete[delete(-) comment(#@content_type = kind)] -insert[insert(+) instance_variable(@type_stats)operator([)stringoperator(])operator(.)ident(count) operator(+=) integer(1)] - instance_variable(@type_stats)operator([)stringoperator(])operator(.)ident(count) operator(+=) integer(1) - reserved(end) - -delete[delete(-) reserved(def) method(token) ident(text)operator(,) ident(kind)] -delete[delete(-) reserved(super)] -delete[delete(-) instance_variable(@type_stats)operator([)stringoperator(])operator(.)ident(count) operator(+=) integer(1)] -delete[delete(-) reserved(end)] -delete[delete(-)] - constant(STATS) operator(=) string - - constant(Code) constant(Statistics) -head[head(Index: )plain(lib/coderay/encoders/_map.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/_map.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/_map.rb)plain( (revision 250\))] -change[change(@@)plain( -2,7 +2,8 )change(@@)] - reserved(module) class(Encoders) - - ident(map) symbol(:stats) operator(=)operator(>) symbol(:statistic)operator(,) -delete[delete(-) symbol(:plain) operator(=)operator(>) symbol(:text)] -insert[insert(+) symbol(:plain) operator(=)operator(>) symbol(:text)operator(,)] -insert[insert(+) symbol(:tex) operator(=)operator(>) symbol(:latex)] - - reserved(end) - reserved(end) -head[head(Index: )plain(lib/coderay/helpers/filetype.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/helpers/filetype.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/helpers/filetype.rb)plain( (revision 250\))] -change[change(@@)plain( -1,180 +0,0 )change(@@)] -delete[delete(-)comment(# =FileType)] -delete[delete(-)comment(#)] -delete[delete(-)comment(# A simple filetype recognizer)] -delete[delete(-)comment(#)] -delete[delete(-)comment(# Author: murphy (mail to murphy cYcnus de\))] -delete[delete(-)comment(#)] -delete[delete(-)comment(# Version: 0.1 (2005.september.1\))] -delete[delete(-)comment(#)] -delete[delete(-)comment(# == Documentation)] -delete[delete(-)comment(#)] -delete[delete(-)comment(# # determine the type of the given)] -delete[delete(-)comment(# lang = FileType[ARGV.first])] -delete[delete(-)comment(# )] -delete[delete(-)comment(# # return :plaintext if the file type is unknown)] -delete[delete(-)comment(# lang = FileType.fetch ARGV.first, :plaintext)] -delete[delete(-)comment(# )] -delete[delete(-)comment(# # try the shebang line, too)] -delete[delete(-)comment(# lang = FileType.fetch ARGV.first, :plaintext, true)] -delete[delete(-)reserved(module) class(FileType)] -delete[delete(-)] -delete[delete(-) constant(UnknownFileType) operator(=) constant(Class)operator(.)ident(new) constant(Exception)] -delete[delete(-)] -delete[delete(-) reserved(class) operator(<<) class(self)] -delete[delete(-)] -delete[delete(-) comment(# Try to determine the file type of the file.)] -delete[delete(-) comment(#)] -delete[delete(-) comment(# +filename+ is a relative or absolute path to a file.)] -delete[delete(-) comment(#)] -delete[delete(-) comment(# The file itself is only accessed when +read_shebang+ is set to true.)] -delete[delete(-) comment(# That means you can get filetypes from files that don't exist.)] -delete[delete(-) reserved(def) method([]) ident(filename)operator(,) ident(read_shebang) operator(=) pre_constant(false)] -delete[delete(-) ident(name) operator(=) constant(File)operator(.)ident(basename) ident(filename)] -delete[delete(-) ident(ext) operator(=) constant(File)operator(.)ident(extname) ident(name)] -delete[delete(-) ident(ext)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) comment(# delete the leading dot)] -delete[delete(-)] -delete[delete(-) ident(type) operator(=)] -delete[delete(-) constant(TypeFromExt)operator([)ident(ext)operator(]) operator(||)] -delete[delete(-) constant(TypeFromExt)operator([)ident(ext)operator(.)ident(downcase)operator(]) operator(||)] -delete[delete(-) constant(TypeFromName)operator([)ident(name)operator(]) operator(||)] -delete[delete(-) constant(TypeFromName)operator([)ident(name)operator(.)ident(downcase)operator(])] -delete[delete(-) ident(type) operator(||=) ident(shebang)operator(()ident(filename)operator(\)) reserved(if) ident(read_shebang)] -delete[delete(-)] -delete[delete(-) ident(type)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(shebang) ident(filename)] -delete[delete(-) reserved(begin)] -delete[delete(-) constant(File)operator(.)ident(open) ident(filename)operator(,) string reserved(do) operator(|)ident(f)operator(|)] -delete[delete(-) ident(first_line) operator(=) ident(f)operator(.)ident(gets)] -delete[delete(-) ident(first_line)operator([)constant(TypeFromShebang)operator(])] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(rescue) constant(IOError)] -delete[delete(-) pre_constant(nil)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) comment(# This works like Hash#fetch.)] -delete[delete(-) comment(#)] -delete[delete(-) comment(# If the filetype cannot be found, the +default+ value)] -delete[delete(-) comment(# is returned.)] -delete[delete(-) reserved(def) method(fetch) ident(filename)operator(,) ident(default) operator(=) pre_constant(nil)operator(,) ident(read_shebang) operator(=) pre_constant(false)] -delete[delete(-) reserved(if) ident(default) reserved(and) ident(block_given?)] -delete[delete(-) ident(warn) string] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(unless) ident(type) operator(=) pre_constant(self)operator([)ident(filename)operator(,) ident(read_shebang)operator(])] -delete[delete(-) reserved(return) reserved(yield) reserved(if) ident(block_given?)] -delete[delete(-) reserved(return) ident(default) reserved(if) ident(default)] -delete[delete(-) ident(raise) constant(UnknownFileType)operator(,) string operator(%) ident(filename)] -delete[delete(-) reserved(end)] -delete[delete(-) ident(type)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) constant(TypeFromExt) operator(=) operator({)] -delete[delete(-) string operator(=)operator(>) symbol(:ruby)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:ruby)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:ruby)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:c)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:c)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:c)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:xml)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:html)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:html)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:xhtml)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:rhtml)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:yaml)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:yaml)operator(,)] -delete[delete(-) operator(})] -delete[delete(-)] -delete[delete(-) constant(TypeFromShebang) operator(=) regexp] -delete[delete(-)] -delete[delete(-) constant(TypeFromName) operator(=) operator({)] -delete[delete(-) string operator(=)operator(>) symbol(:ruby)operator(,)] -delete[delete(-) string operator(=)operator(>) symbol(:ruby)operator(,)] -delete[delete(-) operator(})] -delete[delete(-)] -delete[delete(-)reserved(end)] -delete[delete(-)] -delete[delete(-)reserved(if) global_variable($0) operator(==) pre_constant(__FILE__)] -delete[delete(-) global_variable($VERBOSE) operator(=) pre_constant(true)] -delete[delete(-) ident(eval) pre_constant(DATA)operator(.)ident(read)operator(,) pre_constant(nil)operator(,) global_variable($0)operator(,) pre_constant(__LINE__)operator(+)integer(4)] -delete[delete(-)reserved(end)] -delete[delete(-)] -delete[delete(-)comment(__END__)] -delete[delete(-)] -delete[delete(-)ident(require) string] -delete[delete(-)] -delete[delete(-)reserved(class) class(TC_FileType) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_fetch)] -delete[delete(-) ident(assert_raise) constant(FileType)operator(::)constant(UnknownFileType) reserved(do)] -delete[delete(-) constant(FileType)operator(.)ident(fetch) string] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) ident(assert_throws) symbol(:not_found) reserved(do)] -delete[delete(-) constant(FileType)operator(.)ident(fetch) string reserved(do)] -delete[delete(-) ident(throw) symbol(:not_found)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) ident(assert_equal) symbol(:default)operator(,) constant(FileType)operator(.)ident(fetch)operator(()stringoperator(,) symbol(:default)operator(\))] -delete[delete(-)] -delete[delete(-) ident(stderr)operator(,) ident(fake_stderr) operator(=) global_variable($stderr)operator(,) constant(Object)operator(.)ident(new)] -delete[delete(-) global_variable($err) operator(=) string] -delete[delete(-) reserved(def) ident(fake_stderr)operator(.)method(write) ident(x)] -delete[delete(-) global_variable($err) operator(<<) ident(x)] -delete[delete(-) reserved(end)] -delete[delete(-) global_variable($stderr) operator(=) ident(fake_stderr)] -delete[delete(-) constant(FileType)operator(.)ident(fetch)operator(()stringoperator(,) symbol(:default)operator(\)) operator({) operator(})] -delete[delete(-) ident(assert_equal) stringoperator(,) global_variable($err)] -delete[delete(-) global_variable($stderr) operator(=) ident(stderr)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_ruby)] -delete[delete(-) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_c)] -delete[delete(-) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_html)] -delete[delete(-) ident(assert_equal) symbol(:html)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_equal) symbol(:xhtml)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_equal) symbol(:xhtml)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_equal) symbol(:rhtml)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_yaml)] -delete[delete(-) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) ident(assert_not_equal) symbol(:yaml)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_shebang)] -delete[delete(-) ident(dir) operator(=) string] -delete[delete(-) reserved(if) constant(File)operator(.)ident(directory?) ident(dir)] -delete[delete(-) constant(Dir)operator(.)ident(chdir) ident(dir) reserved(do)] -delete[delete(-) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-)reserved(end)] -head[head(Index: )plain(lib/coderay/helpers/plugin.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/helpers/plugin.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/helpers/plugin.rb)plain( (revision 250\))] -change[change(@@)plain( -1,3 +1,5 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+) ] - comment(# = PluginHost) - comment(#) - comment(# $Id$) -change[change(@@)plain( -20,7 +22,7 )change(@@)] - comment(#) - comment(# Generators[:fancy] #-> FancyGenerator) - comment(# # or) -delete[delete(-)comment(# require_plugin 'Generators/fancy')] -insert[insert(+)comment(# CodeRay.require_plugin 'Generators/fancy')] - reserved(module) class(PluginHost) - - comment(# Raised if Encoders::[] fails because:) -change[change(@@)plain( -310,17 +312,18 )change(@@)] - - reserved(end) - -delete[delete(-)] - comment(# Convenience method for plugin loading.) - comment(# The syntax used is:) - comment(#) -delete[delete(-)comment(# require_plugin '/')] -insert[insert(+)comment(# CodeRay.require_plugin '/')] - comment(#) - comment(# Returns the loaded plugin.) -delete[delete(-)reserved(def) method(require_plugin) ident(path)] -insert[insert(+)reserved(def) pre_constant(self)operator(.)method(require_plugin) ident(path)] - ident(host_id)operator(,) ident(plugin_id) operator(=) ident(path)operator(.)ident(split) stringoperator(,) integer(2) - ident(host) operator(=) constant(PluginHost)operator(.)ident(host_by_id)operator(()ident(host_id)operator(\)) - ident(raise) constant(PluginHost)operator(::)constant(HostNotFound)operator(,) - stringcontent( found.)delimiter(")> reserved(unless) ident(host) - ident(host)operator(.)ident(load) ident(plugin_id) - reserved(end) -insert[insert(+)] -insert[insert(+)reserved(end)] -change[change(\\ )plain(No newline at end of file)] -head[head(Index: )plain(lib/coderay/helpers/file_type.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/helpers/file_type.rb)plain( (revision 0\))] -head[head(+++ )filename(lib/coderay/helpers/file_type.rb)plain( (revision 250\))] -change[change(@@)plain( -0,0 +1,210 )change(@@)] -insert[insert(+)doctype(#!/usr/bin/env ruby)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+)] -insert[insert(+)comment(# = FileType)] -insert[insert(+)comment(#)] -insert[insert(+)comment(# A simple filetype recognizer.)] -insert[insert(+)comment(#)] -insert[insert(+)comment(# Copyright (c\) 2006 by murphy (Kornelius Kalnbach\) )] -insert[insert(+)comment(#)] -insert[insert(+)comment(# License:: LGPL / ask the author)] -insert[insert(+)comment(# Version:: 0.1 (2005-09-01\))] -insert[insert(+)comment(#)] -insert[insert(+)comment(# == Documentation)] -insert[insert(+)comment(#)] -insert[insert(+)comment(# # determine the type of the given)] -insert[insert(+)comment(# lang = FileType[ARGV.first])] -insert[insert(+)comment(# )] -insert[insert(+)comment(# # return :plaintext if the file type is unknown)] -insert[insert(+)comment(# lang = FileType.fetch ARGV.first, :plaintext)] -insert[insert(+)comment(# )] -insert[insert(+)comment(# # try the shebang line, too)] -insert[insert(+)comment(# lang = FileType.fetch ARGV.first, :plaintext, true)] -insert[insert(+)reserved(module) class(FileType)] -insert[insert(+)] -insert[insert(+) constant(UnknownFileType) operator(=) constant(Class)operator(.)ident(new) constant(Exception)] -insert[insert(+)] -insert[insert(+) reserved(class) operator(<<) class(self)] -insert[insert(+)] -insert[insert(+) comment(# Try to determine the file type of the file.)] -insert[insert(+) comment(#)] -insert[insert(+) comment(# +filename+ is a relative or absolute path to a file.)] -insert[insert(+) comment(#)] -insert[insert(+) comment(# The file itself is only accessed when +read_shebang+ is set to true.)] -insert[insert(+) comment(# That means you can get filetypes from files that don't exist.)] -insert[insert(+) reserved(def) method([]) ident(filename)operator(,) ident(read_shebang) operator(=) pre_constant(false)] -insert[insert(+) ident(name) operator(=) constant(File)operator(.)ident(basename) ident(filename)] -insert[insert(+) ident(ext) operator(=) constant(File)operator(.)ident(extname)operator(()ident(name)operator(\))operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) comment(# from last dot, delete the leading dot)] -insert[insert(+) ident(ext2) operator(=) ident(filename)operator([)regexpoperator(,) integer(1)operator(]) comment(# from first dot)] -insert[insert(+)] -insert[insert(+) ident(type) operator(=)] -insert[insert(+) constant(TypeFromExt)operator([)ident(ext)operator(.)ident(downcase)operator(]) operator(||)] -insert[insert(+) operator(()constant(TypeFromExt)operator([)ident(ext2)operator(.)ident(downcase)operator(]) reserved(if) ident(ext2)operator(\)) operator(||)] -insert[insert(+) constant(TypeFromName)operator([)ident(name)operator(]) operator(||)] -insert[insert(+) constant(TypeFromName)operator([)ident(name)operator(.)ident(downcase)operator(])] -insert[insert(+) ident(type) operator(||=) ident(shebang)operator(()ident(filename)operator(\)) reserved(if) ident(read_shebang)] -insert[insert(+)] -insert[insert(+) ident(type)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(shebang) ident(filename)] -insert[insert(+) reserved(begin)] -insert[insert(+) constant(File)operator(.)ident(open) ident(filename)operator(,) string reserved(do) operator(|)ident(f)operator(|)] -insert[insert(+) reserved(if) ident(first_line) operator(=) ident(f)operator(.)ident(gets)] -insert[insert(+) reserved(if) ident(type) operator(=) ident(first_line)operator([)constant(TypeFromShebang)operator(])] -insert[insert(+) ident(type)operator(.)ident(to_sym)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(rescue) constant(IOError)] -insert[insert(+) pre_constant(nil)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) comment(# This works like Hash#fetch.)] -insert[insert(+) comment(#)] -insert[insert(+) comment(# If the filetype cannot be found, the +default+ value)] -insert[insert(+) comment(# is returned.)] -insert[insert(+) reserved(def) method(fetch) ident(filename)operator(,) ident(default) operator(=) pre_constant(nil)operator(,) ident(read_shebang) operator(=) pre_constant(false)] -insert[insert(+) reserved(if) ident(default) reserved(and) ident(block_given?)] -insert[insert(+) ident(warn) string] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(unless) ident(type) operator(=) pre_constant(self)operator([)ident(filename)operator(,) ident(read_shebang)operator(])] -insert[insert(+) reserved(return) reserved(yield) reserved(if) ident(block_given?)] -insert[insert(+) reserved(return) ident(default) reserved(if) ident(default)] -insert[insert(+) ident(raise) constant(UnknownFileType)operator(,) string operator(%) ident(filename)] -insert[insert(+) reserved(end)] -insert[insert(+) ident(type)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) constant(TypeFromExt) operator(=) operator({)] -insert[insert(+) string operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:c)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:c)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:c)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:xml)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:html)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:html)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:xhtml)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:debug)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:rhtml)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:rhtml)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:scheme)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:scheme)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:yaml)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:yaml)operator(,)] -insert[insert(+) operator(})] -insert[insert(+)] -insert[insert(+) constant(TypeFromShebang) operator(=) regexp] -insert[insert(+)] -insert[insert(+) constant(TypeFromName) operator(=) operator({)] -insert[insert(+) string operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) string operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) operator(})] -insert[insert(+)] -insert[insert(+)reserved(end)] -insert[insert(+)] -insert[insert(+)reserved(end)] -insert[insert(+)] -insert[insert(+)reserved(if) global_variable($0) operator(==) pre_constant(__FILE__)] -insert[insert(+) global_variable($VERBOSE) operator(=) pre_constant(true)] -insert[insert(+) ident(eval) pre_constant(DATA)operator(.)ident(read)operator(,) pre_constant(nil)operator(,) global_variable($0)operator(,) pre_constant(__LINE__)operator(+)integer(4)] -insert[insert(+)reserved(end)] -insert[insert(+)] -insert[insert(+)comment(__END__)] -insert[insert(+)ident(require) string] -insert[insert(+)] -insert[insert(+)reserved(class) class(TC_FileType) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase)] -insert[insert(+) ] -insert[insert(+) ident(include) constant(CodeRay)] -insert[insert(+) ] -insert[insert(+) reserved(def) method(test_fetch)] -insert[insert(+) ident(assert_raise) constant(FileType)operator(::)constant(UnknownFileType) reserved(do)] -insert[insert(+) constant(FileType)operator(.)ident(fetch) string] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) ident(assert_throws) symbol(:not_found) reserved(do)] -insert[insert(+) constant(FileType)operator(.)ident(fetch) string reserved(do)] -insert[insert(+) ident(throw) symbol(:not_found)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) ident(assert_equal) symbol(:default)operator(,) constant(FileType)operator(.)ident(fetch)operator(()stringoperator(,) symbol(:default)operator(\))] -insert[insert(+)] -insert[insert(+) ident(stderr)operator(,) ident(fake_stderr) operator(=) global_variable($stderr)operator(,) constant(Object)operator(.)ident(new)] -insert[insert(+) global_variable($err) operator(=) string] -insert[insert(+) reserved(def) ident(fake_stderr)operator(.)method(write) ident(x)] -insert[insert(+) global_variable($err) operator(<<) ident(x)] -insert[insert(+) reserved(end)] -insert[insert(+) global_variable($stderr) operator(=) ident(fake_stderr)] -insert[insert(+) constant(FileType)operator(.)ident(fetch)operator(()stringoperator(,) symbol(:default)operator(\)) operator({) operator(})] -insert[insert(+) ident(assert_equal) stringoperator(,) global_variable($err)] -insert[insert(+) global_variable($stderr) operator(=) ident(stderr)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(test_ruby)] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(test_c)] -insert[insert(+) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(test_html)] -insert[insert(+) ident(assert_equal) symbol(:html)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_equal) symbol(:xhtml)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_equal) symbol(:xhtml)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_equal) symbol(:rhtml)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_equal) symbol(:rhtml)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(test_yaml)] -insert[insert(+) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) ident(assert_not_equal) symbol(:yaml)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(test_no_shebang)] -insert[insert(+) ident(dir) operator(=) string] -insert[insert(+) reserved(if) constant(File)operator(.)ident(directory?) ident(dir)] -insert[insert(+) constant(Dir)operator(.)ident(chdir) ident(dir) reserved(do)] -insert[insert(+) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)stringoperator(])] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) reserved(def) method(test_shebang_empty_file)] -insert[insert(+) ident(require) string] -insert[insert(+) ident(tmpfile) operator(=) constant(File)operator(.)ident(join)operator(()constant(Dir)operator(.)ident(tmpdir)operator(,) stringoperator(\))] -insert[insert(+) constant(File)operator(.)ident(open)operator(()ident(tmpfile)operator(,) stringoperator(\)) operator({) operator(}) comment(# touch)] -insert[insert(+) ident(assert_equal) pre_constant(nil)operator(,) constant(FileType)operator([)ident(tmpfile)operator(])] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) reserved(def) method(test_shebang)] -insert[insert(+) ident(require) string] -insert[insert(+) ident(tmpfile) operator(=) constant(File)operator(.)ident(join)operator(()constant(Dir)operator(.)ident(tmpdir)operator(,) stringoperator(\))] -insert[insert(+) constant(File)operator(.)ident(open)operator(()ident(tmpfile)operator(,) stringoperator(\)) operator({) operator(|)ident(f)operator(|) ident(f)operator(.)ident(puts) string operator(})] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)ident(tmpfile)operator(,) pre_constant(true)operator(])] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+)reserved(end)] - -head[head(Property changes on: )plain(lib/coderay/helpers/file_type.rb)] -head[head(___________________________________________________________________)filename()] -head[head(Added: )plain(svn:keywords)] -insert[insert( +)plain( Id Rev)] - -head[head(Index: )plain(lib/coderay/helpers/gzip_simple.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/helpers/gzip_simple.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/helpers/gzip_simple.rb)plain( (revision 250\))] -change[change(@@)plain( -46,6 +46,7 )change(@@)] - reserved(end) - reserved(end) - -insert[insert(+)] - comment(# String extensions to use the GZip module.) - comment(#) - comment(# The methods gzip and gunzip provide an even more simple) -head[head(Index: )plain(lib/coderay/helpers/word_list.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/helpers/word_list.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/helpers/word_list.rb)plain( (revision 250\))] -change[change(@@)plain( -1,15 +1,19 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+)] - comment(# = WordList) -insert[insert(+)comment(# )] -insert[insert(+)comment(# A Hash subclass designed for mapping word lists to token types.)] -insert[insert(+)comment(# )] -insert[insert(+)comment(# Copyright (c\) 2006 by murphy (Kornelius Kalnbach\) )] - comment(#) -delete[delete(-)comment(# Copyright (c\) 2006 by murphy (Kornelius Kalnbach\) )] -delete[delete(-)comment(#)] - comment(# License:: LGPL / ask the author) -delete[delete(-)comment(# Version:: 1.0 (2006-Feb-3\))] -insert[insert(+)comment(# Version:: 1.1 (2006-Oct-19\))] - comment(#) - comment(# A WordList is a Hash with some additional features.) - comment(# It is intended to be used for keyword recognition.) - comment(#) - comment(# WordList is highly optimized to be used in Scanners,) -delete[delete(-)comment(# typically to decide whether a given ident is a keyword.)] -insert[insert(+)comment(# typically to decide whether a given ident is a special token.)] - comment(#) - comment(# For case insensitive words use CaseIgnoringWordList.) - comment(#) -change[change(@@)plain( -47,25 +51,30 )change(@@)] - comment(# ...) - reserved(class) class(WordList) operator(<) constant(Hash) - -delete[delete(-) comment(# Create a WordList for the given +words+.)] -delete[delete(-) comment(#)] -delete[delete(-) comment(# This WordList responds to [] with +true+, if the word is)] -delete[delete(-) comment(# in +words+, and with +false+ otherwise.)] -delete[delete(-) reserved(def) pre_constant(self)operator(.)method(for) ident(words)] -delete[delete(-) ident(new)operator(.)ident(add) ident(words)] -delete[delete(-) reserved(end)] -delete[delete(-)] - comment(# Creates a new WordList with +default+ as default value.) -delete[delete(-) reserved(def) method(initialize) ident(default) operator(=) pre_constant(false)operator(,) operator(&)ident(block)] -delete[delete(-) reserved(super) ident(default)operator(,) operator(&)ident(block)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# You can activate +caching+ to store the results for every [] request.)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# With caching, methods like +include?+ or +delete+ may no longer behave)] -insert[insert(+) comment(# as you expect. Therefore, it is recommended to use the [] method only.)] -insert[insert(+) reserved(def) method(initialize) ident(default) operator(=) pre_constant(false)operator(,) ident(caching) operator(=) pre_constant(false)operator(,) operator(&)ident(block)] -insert[insert(+) reserved(if) ident(block)] -insert[insert(+) ident(raise) constant(ArgumentError)operator(,) string reserved(if) ident(caching)] -insert[insert(+) reserved(super)operator(()operator(&)ident(block)operator(\))] -insert[insert(+) reserved(else)] -insert[insert(+) reserved(if) ident(caching)] -insert[insert(+) reserved(super)operator(()operator(\)) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|)] -insert[insert(+) ident(h)operator([)ident(k)operator(]) operator(=) ident(h)operator(.)ident(fetch) ident(k)operator(,) ident(default)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(else)] -insert[insert(+) reserved(super) ident(default)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] - reserved(end) - -delete[delete(-) comment(# Checks if a word is included.)] -delete[delete(-) reserved(def) method(include?) ident(word)] -delete[delete(-) ident(has_key?) ident(word)] -delete[delete(-) reserved(end)] -delete[delete(-)] - comment(# Add words to the list and associate them with +kind+.) -insert[insert(+) comment(# )] -insert[insert(+) comment(# Returns +self+, so you can concat add calls.)] - reserved(def) method(add) ident(words)operator(,) ident(kind) operator(=) pre_constant(true) - ident(words)operator(.)ident(each) reserved(do) operator(|)ident(word)operator(|) - pre_constant(self)operator([)ident(word)operator(]) operator(=) ident(kind) -change[change(@@)plain( -78,24 +87,30 )change(@@)] - - comment(# A CaseIgnoringWordList is like a WordList, only that) - comment(# keys are compared case-insensitively.) -insert[insert(+)comment(# )] -insert[insert(+)comment(# Ignoring the text case is realized by sending the +downcase+ message to)] -insert[insert(+)comment(# all keys.)] -insert[insert(+)comment(# )] -insert[insert(+)comment(# Caching usually makes a CaseIgnoringWordList faster, but it has to be)] -insert[insert(+)comment(# activated explicitely.)] - reserved(class) class(CaseIgnoringWordList) operator(<) constant(WordList) - -delete[delete(-) comment(# Creates a new WordList with +default+ as default value.)] -delete[delete(-) comment(#)] -delete[delete(-) comment(# Text case is ignored.)] -delete[delete(-) reserved(def) method(initialize) ident(default) operator(=) pre_constant(false)operator(,) operator(&)ident(block)] -delete[delete(-) ident(block) operator(||=) ident(proc) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|)] -delete[delete(-) ident(h)operator([)ident(k)operator(]) operator(=) ident(h)operator(.)ident(fetch) ident(k)operator(.)ident(downcase)operator(,) ident(default)] -insert[insert(+) comment(# Creates a new case-insensitive WordList with +default+ as default value.)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# You can activate caching to store the results for every [] request.)] -insert[insert(+) reserved(def) method(initialize) ident(default) operator(=) pre_constant(false)operator(,) ident(caching) operator(=) pre_constant(false)] -insert[insert(+) reserved(if) ident(caching)] -insert[insert(+) reserved(super)operator(()ident(default)operator(,) pre_constant(false)operator(\)) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|)] -insert[insert(+) ident(h)operator([)ident(k)operator(]) operator(=) ident(h)operator(.)ident(fetch) ident(k)operator(.)ident(downcase)operator(,) ident(default)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(else)] -insert[insert(+) reserved(def) pre_constant(self)operator(.)method([]) ident(key) comment(# :nodoc:)] -insert[insert(+) reserved(super)operator(()ident(key)operator(.)ident(downcase)operator(\))] -insert[insert(+) reserved(end)] - reserved(end) -delete[delete(-) reserved(super) ident(default)] - reserved(end) - -delete[delete(-) comment(# Checks if a word is included.)] -delete[delete(-) reserved(def) method(include?) ident(word)] -delete[delete(-) ident(has_key?) ident(word)operator(.)ident(downcase)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) comment(# Add words to the list and associate them with +kind+.)] -insert[insert(+) comment(# Add +words+ to the list and associate them with +kind+.)] - reserved(def) method(add) ident(words)operator(,) ident(kind) operator(=) pre_constant(true) - ident(words)operator(.)ident(each) reserved(do) operator(|)ident(word)operator(|) - pre_constant(self)operator([)ident(word)operator(.)ident(downcase)operator(]) operator(=) ident(kind) -change[change(@@)plain( -104,3 +119,5 )change(@@)] - reserved(end) - - reserved(end) -insert[insert(+)] -insert[insert(+)reserved(end)] -change[change(\\ )plain(No newline at end of file)] -head[head(Index: )plain(lib/coderay/styles/cycnus.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/styles/cycnus.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/styles/cycnus.rb)plain( (revision 250\))] -change[change(@@)plain( -42,12 +42,14 )change(@@)] - constant(MAIN) - - constant(TOKEN_COLORS) operator(=) string -insert[insert(+)operator(.)ident(debug) operator({) ident(color)symbol(:white) operator(!) ident(important)operator(;) ident(background)symbol(:blue) operator(!) ident(important)operator(;) operator(})] -insert[insert(+)] - operator(.)ident(af) operator({) ident(color)operator(:)comment(#00C }) - operator(.)ident(an) operator({) ident(color)operator(:)comment(#007 }) - operator(.)ident(av) operator({) ident(color)operator(:)comment(#700 }) - operator(.)ident(aw) operator({) ident(color)operator(:)comment(#C00 }) - operator(.)ident(bi) operator({) ident(color)operator(:)comment(#509; font-weight:bold }) -delete[delete(-)operator(.)ident(c) operator({) ident(color)operator(:)comment(#888 })] -insert[insert(+)operator(.)ident(c) operator({) ident(color)operator(:)comment(#666; })] - - operator(.)ident(ch) operator({) ident(color)operator(:)comment(#04D }) - operator(.)ident(ch) operator(.)ident(k) operator({) ident(color)operator(:)comment(#04D }) -change[change(@@)plain( -83,7 +85,7 )change(@@)] - operator(.)ident(la) operator({) ident(color)operator(:)comment(#970; font-weight:bold }) - operator(.)ident(lv) operator({) ident(color)operator(:)comment(#963 }) - operator(.)ident(oc) operator({) ident(color)operator(:)comment(#40E; font-weight:bold }) -delete[delete(-)operator(.)ident(on) operator({) ident(color)operator(:)comment(#000; font-weight:bold })] -insert[insert(+)operator(.)ident(of) operator({) ident(color)operator(:)comment(#000; font-weight:bold })] - operator(.)ident(op) operator({) operator(}) - operator(.)ident(pc) operator({) ident(color)operator(:)comment(#038; font-weight:bold }) - operator(.)ident(pd) operator({) ident(color)operator(:)comment(#369; font-weight:bold }) -head[head(Index: )plain(lib/coderay/styles/murphy.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/styles/murphy.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/styles/murphy.rb)plain( (revision 250\))] -change[change(@@)plain( -47,7 +47,7 )change(@@)] - operator(.)ident(av) operator({) ident(color)operator(:)comment(#700; }) - operator(.)ident(aw) operator({) ident(color)operator(:)comment(#C00; }) - operator(.)ident(bi) operator({) ident(color)operator(:)comment(#509; font-weight:bold; }) -delete[delete(-)operator(.)ident(c) operator({) ident(color)operator(:)comment(#666; })] -insert[insert(+)operator(.)ident(c) operator({) ident(color)operator(:)comment(#555; background-color: black; })] - - operator(.)ident(ch) operator({) ident(color)operator(:)comment(#88F; }) - operator(.)ident(ch) operator(.)ident(k) operator({) ident(color)operator(:)comment(#04D; }) -change[change(@@)plain( -77,7 +77,7 )change(@@)] - operator(.)ident(la) operator({) ident(color)operator(:)comment(#970; font-weight:bold; }) - operator(.)ident(lv) operator({) ident(color)operator(:)comment(#963; }) - operator(.)ident(oc) operator({) ident(color)operator(:)comment(#40E; font-weight:bold; }) -delete[delete(-)operator(.)ident(on) operator({) ident(color)operator(:)comment(#000; font-weight:bold; })] -insert[insert(+)operator(.)ident(of) operator({) ident(color)operator(:)comment(#000; font-weight:bold; })] - operator(.)ident(op) operator({) operator(}) - operator(.)ident(pc) operator({) ident(color)operator(:)comment(#08f; font-weight:bold; }) - operator(.)ident(pd) operator({) ident(color)operator(:)comment(#369; font-weight:bold; }) -head[head(Index: )plain(lib/coderay/tokens.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/tokens.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/tokens.rb)plain( (revision 250\))] -change[change(@@)plain( -115,7 +115,7 )change(@@)] - comment(# tokens.each_text_token { |text, kind| text.replace html_escape(text\) }) - reserved(def) method(each_text_token) - ident(each) reserved(do) operator(|)ident(text)operator(,) ident(kind)operator(|) -delete[delete(-) reserved(next) reserved(unless) ident(text)operator(.)ident(respond_to?) symbol(:to_str)] -insert[insert(+) reserved(next) reserved(unless) ident(text)operator(.)ident(is_a?) operator(::)constant(String)] - reserved(yield) ident(text)operator(,) ident(kind) - reserved(end) - reserved(end) -change[change(@@)plain( -252,7 +252,7 )change(@@)] - comment(#) - comment(# You can configure the level of compression,) - comment(# but the default value 7 should be what you want) -delete[delete(-) comment(# in most cases as it is a good comprimise between)] -insert[insert(+) comment(# in most cases as it is a good compromise between)] - comment(# speed and compression rate.) - comment(#) - comment(# See GZip module.) -change[change(@@)plain( -267,9 +267,20 )change(@@)] - comment(# Should be equal to the input size before) - comment(# scanning.) - reserved(def) method(text_size) -delete[delete(-) ident(map) operator({) operator(|)ident(t)operator(,) ident(k)operator(|) ident(t) operator(})operator(.)ident(join)operator(.)ident(size)] -insert[insert(+) ident(size) operator(=) integer(0)] -insert[insert(+) ident(each_text_token) reserved(do) operator(|)ident(t)operator(,) ident(k)operator(|)] -insert[insert(+) ident(size) operator(+) ident(t)operator(.)ident(size)] -insert[insert(+) reserved(end)] -insert[insert(+) ident(size)] - reserved(end) - -insert[insert(+) comment(# The total size of the tokens.)] -insert[insert(+) comment(# Should be equal to the input size before)] -insert[insert(+) comment(# scanning.)] -insert[insert(+) reserved(def) method(text)] -insert[insert(+) ident(map) operator({) operator(|)ident(t)operator(,) ident(k)operator(|) ident(t) reserved(if) ident(t)operator(.)ident(is_a?) operator(::)constant(String) operator(})operator(.)ident(join)] -insert[insert(+) reserved(end)] -insert[insert(+)] - comment(# Include this module to give an object an #undump) - comment(# method.) - comment(#) -change[change(@@)plain( -342,7 +353,7 )change(@@)] - comment(#) - comment(# Returns self.) - reserved(def) method(<<) ident(token) -delete[delete(-) instance_variable(@callback)operator(.)ident(call) ident(token)] -insert[insert(+) instance_variable(@callback)operator(.)ident(call)operator(()operator(*)ident(token)operator(\))] - instance_variable(@size) operator(+=) integer(1) - pre_constant(self) - reserved(end) -change[change(@@)plain( -365,4 +376,8 )change(@@)] - - reserved(end) - -insert[insert(+) ] -insert[insert(+) comment(# Token name abbreviations)] -insert[insert(+) ident(require) string] -insert[insert(+)] - reserved(end) -head[head(Index: )plain(lib/coderay/duo.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/duo.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/duo.rb)plain( (revision 250\))] -change[change(@@)plain( -4,26 +4,84 )change(@@)] - comment(#) - comment(# $Id: scanner.rb 123 2006-03-21 14:46:34Z murphy $) - comment(#) -delete[delete(-) comment(# TODO: Doc.)] -insert[insert(+) comment(# A Duo is a convenient way to use CodeRay. You just create a Duo,)] -insert[insert(+) comment(# giving it a lang (language of the input code\) and a format (desired)] -insert[insert(+) comment(# output format\), and call Duo#highlight with the code.)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# Duo makes it easy to re-use both scanner and encoder for a repetitive)] -insert[insert(+) comment(# task. It also provides a very easy interface syntax:)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# require 'coderay')] -insert[insert(+) comment(# CodeRay::Duo[:python, :div].highlight 'import this')] -insert[insert(+) comment(# )] -insert[insert(+) comment(# Until you want to do uncommon things with CodeRay, I recommend to use)] -insert[insert(+) comment(# this method, since it takes care of everything.)] - reserved(class) class(Duo) - -delete[delete(-) ident(attr_accessor) symbol(:scanner)operator(,) symbol(:encoder)] -delete[delete(-)] -delete[delete(-) reserved(def) method(initialize) ident(lang)operator(,) ident(format)operator(,) ident(options) operator(=) operator({)operator(})] -delete[delete(-) instance_variable(@scanner) operator(=) constant(CodeRay)operator(.)ident(scanner) ident(lang)operator(,) constant(CodeRay)operator(.)ident(get_scanner_options)operator(()ident(options)operator(\))] -delete[delete(-) instance_variable(@encoder) operator(=) constant(CodeRay)operator(.)ident(encoder) ident(format)operator(,) ident(options)] -insert[insert(+) ident(attr_accessor) symbol(:lang)operator(,) symbol(:format)operator(,) symbol(:options)] -insert[insert(+) ] -insert[insert(+) comment(# Create a new Duo, holding a lang and a format to highlight code.)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# simple:)] -insert[insert(+) comment(# CodeRay::Duo[:ruby, :page].highlight 'bla 42')] -insert[insert(+) comment(# )] -insert[insert(+) comment(# streaming:)] -insert[insert(+) comment(# CodeRay::Duo[:ruby, :page].highlight 'bar 23', :stream => true)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# with options:)] -insert[insert(+) comment(# CodeRay::Duo[:ruby, :html, :hint => :debug].highlight '????::??')] -insert[insert(+) comment(# )] -insert[insert(+) comment(# alternative syntax without options:)] -insert[insert(+) comment(# CodeRay::Duo[:ruby => :statistic].encode 'class << self; end')] -insert[insert(+) comment(# )] -insert[insert(+) comment(# alternative syntax with options:)] -insert[insert(+) comment(# CodeRay::Duo[{ :ruby => :statistic }, :do => :something].encode 'abc')] -insert[insert(+) comment(# )] -insert[insert(+) comment(# The options are forwarded to scanner and encoder)] -insert[insert(+) comment(# (see CodeRay.get_scanner_options\).)] -insert[insert(+) reserved(def) method(initialize) ident(lang) operator(=) pre_constant(nil)operator(,) ident(format) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})] -insert[insert(+) reserved(if) ident(format) operator(==) pre_constant(nil) reserved(and) ident(lang)operator(.)ident(is_a?) constant(Hash) reserved(and) ident(lang)operator(.)ident(size) operator(==) integer(1)] -insert[insert(+) instance_variable(@lang) operator(=) ident(lang)operator(.)ident(keys)operator(.)ident(first)] -insert[insert(+) instance_variable(@format) operator(=) ident(lang)operator([)instance_variable(@lang)operator(])] -insert[insert(+) reserved(else)] -insert[insert(+) instance_variable(@lang) operator(=) ident(lang)] -insert[insert(+) instance_variable(@format) operator(=) ident(format)] -insert[insert(+) reserved(end)] -insert[insert(+) instance_variable(@options) operator(=) ident(options)] - reserved(end) - - reserved(class) operator(<<) class(self) -insert[insert(+) comment(# To allow calls like Duo[:ruby, :html].highlight.)] - reserved(alias) method([]) method(new) - reserved(end) - -delete[delete(-) reserved(def) method(encode) ident(code)] -delete[delete(-) instance_variable(@scanner)operator(.)ident(string) operator(=) ident(code)] -delete[delete(-) instance_variable(@encoder)operator(.)ident(encode_tokens)operator(()ident(scanner)operator(.)ident(tokenize)operator(\))] -insert[insert(+) comment(# The scanner of the duo. Only created once.)] -insert[insert(+) reserved(def) method(scanner)] -insert[insert(+) instance_variable(@scanner) operator(||=) constant(CodeRay)operator(.)ident(scanner) instance_variable(@lang)operator(,) constant(CodeRay)operator(.)ident(get_scanner_options)operator(()instance_variable(@options)operator(\))] - reserved(end) -insert[insert(+) ] -insert[insert(+) comment(# The encoder of the duo. Only created once.)] -insert[insert(+) reserved(def) method(encoder)] -insert[insert(+) instance_variable(@encoder) operator(||=) constant(CodeRay)operator(.)ident(encoder) instance_variable(@format)operator(,) instance_variable(@options)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) comment(# Tokenize and highlight the code using +scanner+ and +encoder+.)] -insert[insert(+) comment(#)] -insert[insert(+) comment(# If the :stream option is set, the Duo will go into streaming mode,)] -insert[insert(+) comment(# saving memory for the cost of time.)] -insert[insert(+) reserved(def) method(encode) ident(code)operator(,) ident(options) operator(=) operator({) symbol(:stream) operator(=)operator(>) pre_constant(false) operator(})] -insert[insert(+) ident(stream) operator(=) ident(options)operator(.)ident(delete) symbol(:stream)] -insert[insert(+) ident(options) operator(=) instance_variable(@options)operator(.)ident(merge) ident(options)] -insert[insert(+) reserved(if) ident(stream)] -insert[insert(+) ident(encoder)operator(.)ident(encode_stream)operator(()ident(code)operator(,) instance_variable(@lang)operator(,) ident(options)operator(\))] -insert[insert(+) reserved(else)] -insert[insert(+) ident(scanner)operator(.)ident(code) operator(=) ident(code)] -insert[insert(+) ident(encoder)operator(.)ident(encode_tokens)operator(()ident(scanner)operator(.)ident(tokenize)operator(,) ident(options)operator(\))] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] - reserved(alias) method(highlight) method(encode) - - reserved(end) - - reserved(end) -insert[insert(+)] -head[head(Index: )plain(lib/coderay/scanner.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanner.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanner.rb)plain( (revision 250\))] -change[change(@@)plain( -66,8 +66,18 )change(@@)] - reserved(end) - - reserved(def) method(normify) ident(code) -delete[delete(-) ident(code) operator(=) ident(code)operator(.)ident(to_s)operator(.)ident(to_unix)] -insert[insert(+) ident(code) operator(=) ident(code)operator(.)ident(to_s)] -insert[insert(+) ident(code)operator(.)ident(force_encoding) string reserved(if) ident(code)operator(.)ident(respond_to?) symbol(:force_encoding)] -insert[insert(+) ident(code)operator(.)ident(to_unix)] - reserved(end) -insert[insert(+) ] -insert[insert(+) reserved(def) method(file_extension) ident(extension) operator(=) pre_constant(nil)] -insert[insert(+) reserved(if) ident(extension)] -insert[insert(+) instance_variable(@file_extension) operator(=) ident(extension)operator(.)ident(to_s)] -insert[insert(+) reserved(else)] -insert[insert(+) instance_variable(@file_extension) operator(||=) ident(plugin_id)operator(.)ident(to_s)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end) ] - - reserved(end) - -change[change(@@)plain( -117,9 +127,6 )change(@@)] - ident(setup) - reserved(end) - -delete[delete(-) comment(# More mnemonic accessor name for the input string.)] -delete[delete(-) reserved(alias) method(code) method(string)] -delete[delete(-)] - reserved(def) method(reset) - reserved(super) - ident(reset_instance) -change[change(@@)plain( -131,6 +138,10 )change(@@)] - ident(reset_instance) - reserved(end) - -insert[insert(+) comment(# More mnemonic accessor name for the input string.)] -insert[insert(+) reserved(alias) method(code) method(string)] -insert[insert(+) reserved(alias) method(code=) method(string=)] -insert[insert(+)] - comment(# Scans the code and returns all tokens in a Tokens object.) - reserved(def) method(tokenize) ident(new_string)operator(=)pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(}) - ident(options) operator(=) instance_variable(@options)operator(.)ident(merge)operator(()ident(options)operator(\)) -change[change(@@)plain( -148,6 +159,11 )change(@@)] - reserved(def) method(tokens) - instance_variable(@cached_tokens) operator(||=) ident(tokenize) - reserved(end) -insert[insert(+) ] -insert[insert(+) comment(# Whether the scanner is in streaming mode.)] -insert[insert(+) reserved(def) method(streaming?)] -insert[insert(+) operator(!)operator(!)instance_variable(@options)operator([)symbol(:stream)operator(])] -insert[insert(+) reserved(end)] - - comment(# Traverses the tokens.) - reserved(def) method(each) operator(&)ident(block) -change[change(@@)plain( -195,7 +211,7 )change(@@)] - ident(raise) constant(ScanError)operator(,) string operator(%) operator([) - - -delete[delete(-)operator(**)operator(*)constant(ERROR) reserved(in) symbol] -insert[insert(+)operator(**)operator(*)constant(ERROR) reserved(in) symbol] - - ident(tokens)operator(:) - operator(%)ident(s) -change[change(@@)plain( -211,13 +227,14 )change(@@)] - operator(**)operator(*)constant(ERROR)operator(**)operator(*) - - constant(EOE) -delete[delete(-) constant(File)operator(.)ident(basename)operator(()ident(caller)operator([)integer(0)operator(])operator(\))operator(,)] -delete[delete(-) ident(msg)operator(,)] -delete[delete(-) ident(tokens)operator(.)ident(last)operator(()integer(10)operator(\))operator(.)ident(map) operator({) operator(|)ident(t)operator(|) ident(t)operator(.)ident(inspect) operator(})operator(.)ident(join)operator(()stringoperator(\))operator(,)] -delete[delete(-) ident(line)operator(,) ident(pos)operator(,)] -delete[delete(-) ident(matched)operator(,) ident(state)operator(,) ident(bol?)operator(,) ident(eos?)operator(,)] -delete[delete(-) ident(string)operator([)ident(pos)operator(-)ident(ambit)operator(,)ident(ambit)operator(])operator(,)] -delete[delete(-) ident(string)operator([)ident(pos)operator(,)ident(ambit)operator(])operator(,)] -insert[insert(+) constant(File)operator(.)ident(basename)operator(()ident(caller)operator([)integer(0)operator(])operator(\))operator(,)] -insert[insert(+) ident(msg)operator(,)] -insert[insert(+) ident(tokens)operator(.)ident(size)operator(,)] -insert[insert(+) ident(tokens)operator(.)ident(last)operator(()integer(10)operator(\))operator(.)ident(map) operator({) operator(|)ident(t)operator(|) ident(t)operator(.)ident(inspect) operator(})operator(.)ident(join)operator(()stringoperator(\))operator(,)] -insert[insert(+) ident(line)operator(,) ident(pos)operator(,)] -insert[insert(+) ident(matched)operator(,) ident(state)operator(,) ident(bol?)operator(,) ident(eos?)operator(,)] -insert[insert(+) ident(string)operator([)ident(pos)operator(-)ident(ambit)operator(,)ident(ambit)operator(])operator(,)] -insert[insert(+) ident(string)operator([)ident(pos)operator(,)ident(ambit)operator(])operator(,)] - operator(]) - reserved(end) - -head[head(Index: )plain(lib/coderay/for_redcloth.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/for_redcloth.rb)plain( (revision 0\))] -head[head(+++ )filename(lib/coderay/for_redcloth.rb)plain( (revision 250\))] -change[change(@@)plain( -0,0 +1,72 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay) comment(# :nodoc:)] -insert[insert(+) ] -insert[insert(+) comment(# A little hack to enable CodeRay highlighting in RedCloth.)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# Usage:)] -insert[insert(+) comment(# require 'coderay')] -insert[insert(+) comment(# require 'coderay/for_redcloth')] -insert[insert(+) comment(# RedCloth.new('@[ruby]puts "Hello, World!"@'\).to_html)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# Make sure you have RedCloth 4.0.3 activated, for example by calling)] -insert[insert(+) comment(# require 'rubygems')] -insert[insert(+) comment(# before RedCloth is loaded and before calling CodeRay.for_redcloth.)] -insert[insert(+) reserved(module) class(ForRedCloth)] -insert[insert(+) ] -insert[insert(+) reserved(def) pre_constant(self)operator(.)method(install)] -insert[insert(+) ident(gem) stringoperator(,) string= 4.0.3)delimiter(')> reserved(rescue) pre_constant(nil)] -insert[insert(+) ident(require) string] -insert[insert(+) ident(raise) string reserved(unless) constant(RedCloth)operator(::)constant(VERSION)operator(.)ident(to_s) operator(>)operator(=) string] -insert[insert(+) constant(RedCloth)operator(::)constant(TextileDoc)operator(.)ident(send) symbol(:include)operator(,) constant(ForRedCloth)operator(::)constant(TextileDoc)] -insert[insert(+) constant(RedCloth)operator(::)constant(Formatters)operator(::)constant(HTML)operator(.)ident(module_eval) reserved(do)] -insert[insert(+) reserved(def) method(unescape)operator(()ident(html)operator(\))] -insert[insert(+) ident(replacements) operator(=) operator({)] -insert[insert(+) string operator(=)operator(>) stringoperator(,)] -insert[insert(+) string operator(=)operator(>) stringoperator(,)] -insert[insert(+) string operator(=)operator(>) string)delimiter(')>operator(,)] -insert[insert(+) string operator(=)operator(>) stringoperator(,)] -insert[insert(+) operator(})] -insert[insert(+) ident(html)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(entity)operator(|) ident(replacements)operator([)ident(entity)operator(]) operator(})] -insert[insert(+) reserved(end)] -insert[insert(+) ident(undef_method) symbol(:code)operator(,) symbol(:bc_open)operator(,) symbol(:bc_close)operator(,) symbol(:escape_pre)] -insert[insert(+) reserved(def) method(code)operator(()ident(opts)operator(\)) comment(# :nodoc:)] -insert[insert(+) ident(opts)operator([)symbol(:block)operator(]) operator(=) pre_constant(true)] -insert[insert(+) reserved(if) ident(opts)operator([)symbol(:lang)operator(]) operator(&&) operator(!)ident(filter_coderay)] -insert[insert(+) ident(require) string] -insert[insert(+) instance_variable(@in_bc) operator(||=) pre_constant(nil)] -insert[insert(+) ident(format) operator(=) instance_variable(@in_bc) operator(?) symbol(:div) operator(:) symbol(:span)] -insert[insert(+) ident(highlighted_code) operator(=) constant(CodeRay)operator(.)ident(encode) ident(opts)operator([)symbol(:text)operator(])operator(,) ident(opts)operator([)symbol(:lang)operator(])operator(,) ident(format)operator(,) symbol(:stream) operator(=)operator(>) pre_constant(true)] -insert[insert(+) ident(highlighted_code)operator(.)ident(sub!)operator(()regexpoperator(\)) operator({) operator(|)ident(m)operator(|) ident(m) operator(+) ident(pba)operator(()instance_variable(@in_bc) operator(||) ident(opts)operator(\)) operator(})] -insert[insert(+) ident(highlighted_code) operator(=) ident(unescape)operator(()ident(highlighted_code)operator(\)) reserved(unless) instance_variable(@in_bc)] -insert[insert(+) ident(highlighted_code)] -insert[insert(+) reserved(else)] -insert[insert(+) stringcontent(>)inlinecontent()delimiter(")>] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(def) method(bc_open)operator(()ident(opts)operator(\)) comment(# :nodoc:)] -insert[insert(+) ident(opts)operator([)symbol(:block)operator(]) operator(=) pre_constant(true)] -insert[insert(+) instance_variable(@in_bc) operator(=) ident(opts)] -insert[insert(+) ident(opts)operator([)symbol(:lang)operator(]) operator(?) string operator(:) stringcontent(>)delimiter(")>] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(def) method(bc_close)operator(()ident(opts)operator(\)) comment(# :nodoc:)] -insert[insert(+) instance_variable(@in_bc) operator(=) pre_constant(nil)] -insert[insert(+) ident(opts)operator([)symbol(:lang)operator(]) operator(?) string operator(:) string)char(\\n)delimiter(")>] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(def) method(escape_pre)operator(()ident(text)operator(\))] -insert[insert(+) reserved(if) instance_variable(@in_bc) operator(||=) pre_constant(nil)] -insert[insert(+) ident(text)] -insert[insert(+) reserved(else)] -insert[insert(+) ident(html_esc)operator(()ident(text)operator(,) symbol(:html_escape_preformatted)operator(\))] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(module) class(TextileDoc) comment(# :nodoc:)] -insert[insert(+) ident(attr_accessor) symbol(:filter_coderay)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+)reserved(end)] -insert[insert(+)] -insert[insert(+)constant(CodeRay)operator(::)constant(ForRedCloth)operator(.)ident(install)] -change[change(\\ )plain(No newline at end of file)] -head[head(Index: )plain(lib/coderay/scanners/ruby/patterns.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/ruby/patterns.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/ruby/patterns.rb)plain( (revision 250\))] -change[change(@@)plain( -14,19 +14,14 )change(@@)] - - constant(DEF_KEYWORDS) operator(=) string - constant(UNDEF_KEYWORDS) operator(=) string -insert[insert(+) constant(ALIAS_KEYWORDS) operator(=) string] - constant(MODULE_KEYWORDS) operator(=) string - constant(DEF_NEW_STATE) operator(=) constant(WordList)operator(.)ident(new)operator(()symbol(:initial)operator(\))operator(.) - ident(add)operator(()constant(DEF_KEYWORDS)operator(,) symbol(:def_expected)operator(\))operator(.) - ident(add)operator(()constant(UNDEF_KEYWORDS)operator(,) symbol(:undef_expected)operator(\))operator(.) -insert[insert(+) ident(add)operator(()constant(ALIAS_KEYWORDS)operator(,) symbol(:alias_expected)operator(\))operator(.)] - ident(add)operator(()constant(MODULE_KEYWORDS)operator(,) symbol(:module_expected)operator(\)) - -delete[delete(-) constant(IDENTS_ALLOWING_REGEXP) operator(=) string] -delete[delete(-) reserved(and) reserved(or) reserved(not) reserved(while) reserved(until) reserved(unless) reserved(if) reserved(then) reserved(elsif) reserved(when) ident(sub) ident(sub!) ident(gsub) ident(gsub!)] -delete[delete(-) ident(scan) ident(slice) ident(slice!) ident(split)] -delete[delete(-) operator(])] -delete[delete(-) constant(REGEXP_ALLOWED) operator(=) constant(WordList)operator(.)ident(new)operator(()pre_constant(false)operator(\))operator(.)] -delete[delete(-) ident(add)operator(()constant(IDENTS_ALLOWING_REGEXP)operator(,) symbol(:set)operator(\))] -delete[delete(-)] - constant(PREDEFINED_CONSTANTS) operator(=) string - pre_constant(nil) pre_constant(true) pre_constant(false) pre_constant(self) - pre_constant(DATA) pre_constant(ARGV) pre_constant(ARGF) pre_constant(__FILE__) pre_constant(__LINE__) -change[change(@@)plain( -41,19 +36,20 )change(@@)] - constant(METHOD_NAME) operator(=) regexpcontent( [?!]? )delimiter(/)modifier(ox)> - constant(METHOD_NAME_OPERATOR) operator(=) regexp - error(\\)operator(*)error(\\)operator(*)operator(?) comment(# multiplication and power) -delete[delete(-) operator(|) operator([)operator(-)operator(+)operator(])error(@)operator(?) comment(# plus, minus)] -delete[delete(-) operator(|) operator([)error(\\)regexp] -insert[insert(+) operator(|) operator([)operator(-)operator(+)operator(~)operator(])error(@)operator(?) comment(# plus, minus, tilde with and without @)] -insert[insert(+) operator(|) operator([)error(\\)regexp] - operator(|) error(\\)operator([)error(\\)operator(])operator(=)operator(?) comment(# array getter and setter) - operator(|) operator(<<) operator(|) operator(>>) comment(# append or shift left, shift right) - operator(|) operator(<=)integer(?>)operator(?) operator(|) operator(>)operator(=)operator(?) comment(# comparison, rocket operator) -delete[delete(-) operator(|) operator(===)operator(?) comment(# simple equality and case equality)] -insert[insert(+) operator(|) operator(===)operator(?) operator(|) operator(=)operator(~) comment(# simple equality, case equality, match)] -insert[insert(+) operator(|) operator(!)operator([)operator(~=)error(@)operator(])operator(?) comment(# negation with and without @, not-equal and not-match)] - regexp - constant(METHOD_NAME_EX) operator(=) regexpcontent( (?:[?!]|=(?!>\)\)? | )inlinecontent( )delimiter(/)modifier(ox)> - constant(INSTANCE_VARIABLE) operator(=) regexpcontent( )delimiter(/)modifier(ox)> - constant(CLASS_VARIABLE) operator(=) regexpcontent( )delimiter(/)modifier(ox)> - constant(OBJECT_VARIABLE) operator(=) regexpcontent( )delimiter(/)modifier(ox)> - constant(GLOBAL_VARIABLE) operator(=) regexpcontent( | [1-9])char(\\d)content(* | 0)char(\\w)content(* | [~&+`'=)char(\\/)content(,;_.<>!@$?*":)char(\\\\)content(] | -[a-zA-Z_0-9] \) )delimiter(/)modifier(ox)> -delete[delete(-) constant(PREFIX_VARIABLE) operator(=) regexpcontent( |)inlinecontent( )delimiter(/)modifier(ox)>] -insert[insert(+) constant(PREFIX_VARIABLE) operator(=) regexpcontent( | )inlinecontent( )delimiter(/)modifier(ox)>] - constant(VARIABLE) operator(=) regexpcontent( | )inlinecontent( )delimiter(/)modifier(ox)> - - constant(QUOTE_TO_TYPE) operator(=) operator({) -change[change(@@)plain( -73,7 +69,7 )change(@@)] - constant(EXPONENT) operator(=) regexpcontent( )delimiter(/)modifier(ox)> - constant(FLOAT_SUFFIX) operator(=) regexpcontent( | )char(\\.)content( )inlinecontent( )inlinecontent(? )delimiter(/)modifier(ox)> - constant(FLOAT_OR_INT) operator(=) regexpcontent( (?: )inlinecontent( (\) \)? )delimiter(/)modifier(ox)> -delete[delete(-) constant(NUMERIC) operator(=) regexpcontent( | )inlinecontent( | )inlinecontent( \) | )inlinecontent( \) )delimiter(/)modifier(ox)>] -insert[insert(+) constant(NUMERIC) operator(=) regexpcontent( | )inlinecontent( | )inlinecontent( \) | )inlinecontent( \) )delimiter(/)modifier(ox)>] - - constant(SYMBOL) operator(=) regexp - operator(:) -change[change(@@)plain( -83,6 +79,7 )change(@@)] - operator(|) operator([)string - operator(\)) - regexp -insert[insert(+) constant(METHOD_NAME_OR_SYMBOL) operator(=) regexpcontent( | )inlinecontent( )delimiter(/)modifier(ox)>] - - comment(# TODO investigste \\M, \\c and \\C escape sequences) - comment(# (?: M-\\\\C-|C-\\\\M-|M-\\\\c|c\\\\M-|c|C-|M-\)? (?: \\\\ (?: [0-7]{3} | x[0-9A-Fa-f]{2} | . \) \)) -change[change(@@)plain( -111,7 +108,7 )change(@@)] - operator(()integer(?:) - operator(() operator([)constant(A)operator(-)constant(Za)operator(-)ident(z_0)operator(-)integer(9)operator(])operator(+) operator(\)) comment(# $2 = delim) - operator(|) -delete[delete(-) operator(() operator([)string] -insert[insert(+) operator(() operator([)string] - operator(() operator([)operator(^)error(\\)ident(n)operator(])operator(*)operator(?) operator(\)) error(\\)integer(3) comment(# $4 = delim) - operator(\)) - regexp -change[change(@@)plain( -129,15 +126,14 )change(@@)] - regexp - - comment(# Checks for a valid value to follow. This enables) -delete[delete(-) comment(# fancy_allowed in method calls.)] -insert[insert(+) comment(# value_expected in method calls without parentheses.)] - constant(VALUE_FOLLOWS) operator(=) regexp -delete[delete(-) error(\\)ident(s)operator(+)] -insert[insert(+) operator(()integer(?>)operator([) error(\\)ident(t)error(\\)ident(f)error(\\)ident(v)operator(])operator(+)operator(\))] - operator(()integer(?:) - operator([)stringident(s)operator(=)operator(]) -delete[delete(-) operator(|)] -delete[delete(-) operator(<<)operator(-)integer(?\\S)] -delete[delete(-) operator(|)] -delete[delete(-) comment(#{CHARACTER})] -insert[insert(+) operator(|) operator(<<)operator(-)integer(?\\S)] -insert[insert(+) operator(|) operator([)operator(-)operator(+)operator(]) error(\\)ident(d)] -insert[insert(+) operator(|) comment(#{CHARACTER})] - operator(\)) - regexp - -head[head(Index: )plain(lib/coderay/scanners/ruby.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/ruby.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/ruby.rb)plain( (revision 250\))] -change[change(@@)plain( -18,6 +18,7 )change(@@)] - ident(include) constant(Streamable) - - ident(register_for) symbol(:ruby) -insert[insert(+) ident(file_extension) string] - - ident(helper) symbol(:patterns) - -change[change(@@)plain( -90,15 +91,15 )change(@@)] - reserved(end) - - reserved(when) string -delete[delete(-) reserved(case) ident(peek)operator(()integer(1)operator(\))operator([)integer(0)operator(])] -delete[delete(-) reserved(when) integer(?{)] -insert[insert(+) reserved(case) ident(peek)operator(()integer(1)operator(\))] -insert[insert(+) reserved(when) string] - ident(inline_block_stack) operator(<<) operator([)ident(state)operator(,) ident(depth)operator(,) ident(heredocs)operator(]) - ident(value_expected) operator(=) pre_constant(true) - ident(state) operator(=) symbol(:initial) - ident(depth) operator(=) integer(1) - ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:inline)operator(]) - ident(tokens) operator(<<) operator([)ident(match) operator(+) ident(getch)operator(,) symbol(:inline_delimiter)operator(]) -delete[delete(-) reserved(when) integer(?$)operator(,) integer(?@)] -insert[insert(+) reserved(when) stringoperator(,) string] - ident(tokens) operator(<<) operator([)ident(match)operator(,) symbol(:escape)operator(]) - ident(last_state) operator(=) ident(state) comment(# scan one token as normal code, then return here) - ident(state) operator(=) symbol(:initial) -change[change(@@)plain( -121,36 +122,37 )change(@@)] - comment(# }}}) - reserved(else) - comment(# {{{) -delete[delete(-) reserved(if) ident(match) operator(=) ident(scan)operator(()regexpoperator(\)) reserved(or)] -delete[delete(-) operator(() ident(bol?) reserved(and) ident(match) operator(=) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\)) operator(\))] -delete[delete(-) reserved(case) ident(m) operator(=) ident(match)operator([)integer(0)operator(])] -delete[delete(-) reserved(when) integer(?\\s)operator(,) integer(?\\t)operator(,) integer(?\\f)] -delete[delete(-) ident(match) operator(<<) ident(scan)operator(()regexpoperator(\)) reserved(unless) ident(eos?) reserved(or) ident(heredocs)] -delete[delete(-) ident(kind) operator(=) symbol(:space)] -delete[delete(-) reserved(when) integer(?\\n)operator(,) integer(?\\\\)] -delete[delete(-) ident(kind) operator(=) symbol(:space)] -delete[delete(-) reserved(if) ident(m) operator(==) integer(?\\n)] -delete[delete(-) ident(value_expected) operator(=) pre_constant(true) comment(# FIXME not quite true)] -delete[delete(-) ident(state) operator(=) symbol(:initial) reserved(if) ident(state) operator(==) symbol(:undef_comma_expected)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(if) ident(heredocs)] -delete[delete(-) ident(unscan) comment(# heredoc scanning needs \\n at start)] -delete[delete(-) ident(state) operator(=) ident(heredocs)operator(.)ident(shift)] -delete[delete(-) ident(tokens) operator(<<) operator([)symbol(:open)operator(,) ident(state)operator(.)ident(type)operator(])] -delete[delete(-) ident(heredocs) operator(=) pre_constant(nil) reserved(if) ident(heredocs)operator(.)ident(empty?)] -delete[delete(-) reserved(next)] -delete[delete(-) reserved(else)] -delete[delete(-) ident(match) operator(<<) ident(scan)operator(()regexpoperator(\)) reserved(unless) ident(eos?)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(when) integer(?#)operator(,) integer(?=)operator(,) integer(?_)] -delete[delete(-) ident(kind) operator(=) symbol(:comment)] -delete[delete(-) ident(value_expected) operator(=) pre_constant(true)] -insert[insert(+) reserved(if) ident(match) operator(=) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:space)] -insert[insert(+) ident(match) operator(<<) ident(scan)operator(()regexpoperator(\)) reserved(unless) ident(eos?) operator(||) ident(heredocs)] -insert[insert(+) ident(value_expected) operator(=) pre_constant(true) reserved(if) ident(match)operator(.)ident(index)operator(()integer(?\\n)operator(\)) comment(# FIXME not quite true)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(])] -insert[insert(+) reserved(next)] -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:space)] -insert[insert(+) reserved(if) ident(match) operator(==) string] -insert[insert(+) ident(value_expected) operator(=) pre_constant(true) comment(# FIXME not quite true)] -insert[insert(+) ident(state) operator(=) symbol(:initial) reserved(if) ident(state) operator(==) symbol(:undef_comma_expected)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(if) ident(heredocs)] -insert[insert(+) ident(unscan) comment(# heredoc scanning needs \\n at start)] -insert[insert(+) ident(state) operator(=) ident(heredocs)operator(.)ident(shift)] -insert[insert(+) ident(tokens) operator(<<) operator([)symbol(:open)operator(,) ident(state)operator(.)ident(type)operator(])] -insert[insert(+) ident(heredocs) operator(=) pre_constant(nil) reserved(if) ident(heredocs)operator(.)ident(empty?)] -insert[insert(+) reserved(next)] - reserved(else) -delete[delete(-) ident(raise_inspect) string] -delete[delete(-) reserved(not) ident(handled)string] -insert[insert(+) ident(match) operator(<<) ident(scan)operator(()regexpoperator(\)) reserved(unless) ident(eos?)] - reserved(end) - ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(]) - reserved(next) -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexpoperator(\)) reserved(or)] -insert[insert(+) operator(() ident(bol?) reserved(and) ident(match) operator(=) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\)) operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:comment)] -insert[insert(+) ident(value_expected) operator(=) pre_constant(true)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(])] -insert[insert(+) reserved(next)] - - reserved(elsif) ident(state) operator(==) symbol(:initial) - -change[change(@@)plain( -167,19 +169,19 )change(@@)] - reserved(end) - reserved(end) - comment(## experimental!) -delete[delete(-) ident(value_expected) operator(=) symbol(:set) reserved(if)] -delete[delete(-) ident(patterns)operator(::)constant(REGEXP_ALLOWED)operator([)ident(match)operator(]) reserved(or) ident(check)operator(()regexpdelimiter(/)modifier(o)>operator(\))] -insert[insert(+) ident(value_expected) operator(=) symbol(:set) reserved(if) ident(check)operator(()regexpdelimiter(/)modifier(o)>operator(\))] - - reserved(elsif) ident(last_token_dot) reserved(and) ident(match) operator(=) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\)) - ident(kind) operator(=) symbol(:ident) - ident(value_expected) operator(=) symbol(:set) reserved(if) ident(check)operator(()regexpdelimiter(/)modifier(o)>operator(\)) - - comment(# OPERATORS #) -delete[delete(-) reserved(elsif) reserved(not) ident(last_token_dot) reserved(and) ident(match) operator(=) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) comment(# TODO: match (\), [], {} as one single operator)] -insert[insert(+) reserved(elsif) reserved(not) ident(last_token_dot) reserved(and) ident(match) operator(=) ident(scan)operator(()regexpoperator(\))] - reserved(if) ident(match) operator(!)operator(~) regexp reserved(or) ident(match) operator(=)operator(~) regexp - ident(value_expected) operator(=) symbol(:set) - reserved(end) -delete[delete(-) ident(last_token_dot) operator(=) symbol(:set) reserved(if) ident(match) operator(==) string reserved(or) ident(match) operator(==) string] -insert[insert(+) ident(last_token_dot) operator(=) symbol(:set) reserved(if) pre_constant(self)operator([)integer(1)operator(])] - ident(kind) operator(=) symbol(:operator) - reserved(unless) ident(inline_block_stack)operator(.)ident(empty?) - reserved(case) ident(match) -change[change(@@)plain( -210,8 +212,9 )change(@@)] - ident(interpreted) operator(=) pre_constant(true) - ident(state) operator(=) ident(patterns)operator(::)constant(StringState)operator(.)ident(new) symbol(:regexp)operator(,) ident(interpreted)operator(,) ident(match) - -delete[delete(-) reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\))] -delete[delete(-) ident(kind) operator(=) reserved(if) pre_constant(self)operator([)integer(1)operator(]) reserved(then) symbol(:float) reserved(else) symbol(:integer) reserved(end)] -insert[insert(+) comment(# elsif match = scan(/[-+]?#{patterns::NUMERIC}/o\))] -insert[insert(+) reserved(elsif) ident(match) operator(=) ident(value_expected) operator(?) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\)) operator(:) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\))] -insert[insert(+) ident(kind) operator(=) pre_constant(self)operator([)integer(1)operator(]) operator(?) symbol(:float) operator(:) symbol(:integer)] - - reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\)) - reserved(case) ident(delim) operator(=) ident(match)operator([)integer(1)operator(]) -change[change(@@)plain( -285,6 +288,18 )change(@@)] - reserved(next) - reserved(end) - -insert[insert(+) reserved(elsif) ident(state) operator(==) symbol(:module_expected)] -insert[insert(+) reserved(if) ident(match) operator(=) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:operator)] -insert[insert(+) reserved(else)] -insert[insert(+) ident(state) operator(=) symbol(:initial)] -insert[insert(+) reserved(if) ident(match) operator(=) ident(scan)operator(()regexpcontent(::\)* )inlinecontent( )delimiter(/)modifier(ox)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:class)] -insert[insert(+) reserved(else)] -insert[insert(+) reserved(next)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+)] - reserved(elsif) ident(state) operator(==) symbol(:undef_expected) - ident(state) operator(=) symbol(:undef_comma_expected) - reserved(if) ident(match) operator(=) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\)) -change[change(@@)plain( -306,6 +321,15 )change(@@)] - reserved(next) - reserved(end) - -insert[insert(+) reserved(elsif) ident(state) operator(==) symbol(:alias_expected)] -insert[insert(+) reserved(if) ident(match) operator(=) ident(scan)operator(()regexpcontent(\)([ )char(\\t)content(]+\)()inlinecontent(\))delimiter(/)modifier(o)>operator(\))] -insert[insert(+) ident(tokens) operator(<<) operator([)pre_constant(self)operator([)integer(1)operator(])operator(,) operator(()pre_constant(self)operator([)integer(1)operator(])operator([)integer(0)operator(]) operator(==) integer(?:) operator(?) symbol(:symbol) operator(:) symbol(:method)operator(\))operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)pre_constant(self)operator([)integer(2)operator(])operator(,) symbol(:space)operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)pre_constant(self)operator([)integer(3)operator(])operator(,) operator(()pre_constant(self)operator([)integer(3)operator(])operator([)integer(0)operator(]) operator(==) integer(?:) operator(?) symbol(:symbol) operator(:) symbol(:method)operator(\))operator(])] -insert[insert(+) reserved(end)] -insert[insert(+) ident(state) operator(=) symbol(:initial)] -insert[insert(+) reserved(next)] -insert[insert(+)] - reserved(elsif) ident(state) operator(==) symbol(:undef_comma_expected) - reserved(if) ident(match) operator(=) ident(scan)operator(()regexpoperator(\)) - ident(kind) operator(=) symbol(:operator) -change[change(@@)plain( -315,24 +339,14 )change(@@)] - reserved(next) - reserved(end) - -delete[delete(-) reserved(elsif) ident(state) operator(==) symbol(:module_expected)] -delete[delete(-) reserved(if) ident(match) operator(=) ident(scan)operator(()regexpoperator(\))] -delete[delete(-) ident(kind) operator(=) symbol(:operator)] -delete[delete(-) reserved(else)] -delete[delete(-) ident(state) operator(=) symbol(:initial)] -delete[delete(-) reserved(if) ident(match) operator(=) ident(scan)operator(()regexpcontent(::\)* )inlinecontent( )delimiter(/)modifier(ox)>operator(\))] -delete[delete(-) ident(kind) operator(=) symbol(:class)] -delete[delete(-) reserved(else)] -delete[delete(-) reserved(next)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(end)] -delete[delete(-)] - reserved(end) - comment(# }}}) -insert[insert(+) ] -insert[insert(+) reserved(unless) ident(kind) operator(==) symbol(:error)] -insert[insert(+) ident(value_expected) operator(=) ident(value_expected) operator(==) symbol(:set)] -insert[insert(+) ident(last_token_dot) operator(=) ident(last_token_dot) operator(==) symbol(:set)] -insert[insert(+) reserved(end)] - -delete[delete(-) ident(value_expected) operator(=) ident(value_expected) operator(==) symbol(:set)] -delete[delete(-) ident(last_token_dot) operator(=) ident(last_token_dot) operator(==) symbol(:set)] -delete[delete(-)] - reserved(if) global_variable($DEBUG) reserved(and) reserved(not) ident(kind) - ident(raise_inspect) string operator(%) - operator([)operator([)ident(match)operator(,) ident(kind)operator(])operator(,) ident(line)operator(])operator(,) ident(tokens)operator(,) ident(state) -head[head(Index: )plain(lib/coderay/scanners/c.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/c.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/c.rb)plain( (revision 250\))] -change[change(@@)plain( -4,6 +4,8 )change(@@)] - reserved(class) class(C) operator(<) constant(Scanner) - - ident(register_for) symbol(:c) -insert[insert(+) ] -insert[insert(+) ident(include) constant(Streamable)] - - constant(RESERVED_WORDS) operator(=) operator([) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) -change[change(@@)plain( -42,7 +44,7 )change(@@)] - - ident(kind) operator(=) pre_constant(nil) - ident(match) operator(=) pre_constant(nil) -delete[delete(-)] -insert[insert(+) ] - reserved(case) ident(state) - - reserved(when) symbol(:initial) -head[head(Index: )plain(lib/coderay/scanners/scheme.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/scheme.rb)plain( (revision 0\))] -head[head(+++ )filename(lib/coderay/scanners/scheme.rb)plain( (revision 250\))] -change[change(@@)plain( -0,0 +1,142 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+) reserved(module) class(Scanners)] -insert[insert(+)] -insert[insert(+) comment(# Scheme scanner for CodeRay (by closure\).)] -insert[insert(+) comment(# Thanks to murphy for putting CodeRay into public.)] -insert[insert(+) reserved(class) class(Scheme) operator(<) constant(Scanner)] -insert[insert(+) ] -insert[insert(+) ident(register_for) symbol(:scheme)] -insert[insert(+) ident(file_extension) symbol(:scm)] -insert[insert(+)] -insert[insert(+) constant(CORE_FORMS) operator(=) string] -insert[insert(+) ident(lambda) ident(let) ident(let)operator(*) ident(letrec) ident(syntax)operator(-)reserved(case) ident(define)operator(-)ident(syntax) ident(let)operator(-)ident(syntax)] -insert[insert(+) ident(letrec)operator(-)ident(syntax) reserved(begin) ident(define) ident(quote) reserved(if) reserved(or) reserved(and) ident(cond) reserved(case) reserved(do) ident(delay)] -insert[insert(+) ident(quasiquote) ident(set!) ident(cons) ident(force) ident(call)operator(-)ident(with)operator(-)ident(current)operator(-)ident(continuation) ident(call)operator(/)ident(cc)] -insert[insert(+) operator(])] -insert[insert(+)] -insert[insert(+) constant(IDENT_KIND) operator(=) constant(CaseIgnoringWordList)operator(.)ident(new)operator(()symbol(:ident)operator(\))operator(.)] -insert[insert(+) ident(add)operator(()constant(CORE_FORMS)operator(,) symbol(:reserved)operator(\))] -insert[insert(+) ] -insert[insert(+) comment(#IDENTIFIER_INITIAL = /[a-z!@\\$%&\\*\\/\\:<=>\\?~_\\^]/i)] -insert[insert(+) comment(#IDENTIFIER_SUBSEQUENT = /#{IDENTIFIER_INITIAL}|\\d|\\.|\\+|-/)] -insert[insert(+) comment(#IDENTIFIER = /#{IDENTIFIER_INITIAL}#{IDENTIFIER_SUBSEQUENT}*|\\+|-|\\.{3}/)] -insert[insert(+) constant(IDENTIFIER) operator(=) regexp?~_^][)char(\\w)content(!@$%&*)char(\\/)content(:<=>?~^.+)char(\\-)content(]*|[+-]|)char(\\.)char(\\.)char(\\.)delimiter(/)>] -insert[insert(+) constant(DIGIT) operator(=) regexp] -insert[insert(+) constant(DIGIT10) operator(=) constant(DIGIT)] -insert[insert(+) constant(DIGIT16) operator(=) regexp] -insert[insert(+) constant(DIGIT8) operator(=) regexp] -insert[insert(+) constant(DIGIT2) operator(=) regexp] -insert[insert(+) constant(RADIX16) operator(=) regexp] -insert[insert(+) constant(RADIX8) operator(=) regexp] -insert[insert(+) constant(RADIX2) operator(=) regexp] -insert[insert(+) constant(RADIX10) operator(=) regexp] -insert[insert(+) constant(EXACTNESS) operator(=) regexp] -insert[insert(+) constant(SIGN) operator(=) regexp] -insert[insert(+) constant(EXP_MARK) operator(=) regexp] -insert[insert(+) constant(EXP) operator(=) regexpinlineinlinecontent(+)delimiter(/)>] -insert[insert(+) constant(SUFFIX) operator(=) regexpcontent(?)delimiter(/)>] -insert[insert(+) constant(PREFIX10) operator(=) regexpcontent(?)inlinecontent(?|)inlinecontent(?)inlinecontent(?)delimiter(/)>] -insert[insert(+) constant(PREFIX16) operator(=) regexpinlinecontent(?|)inlinecontent(?)inlinedelimiter(/)>] -insert[insert(+) constant(PREFIX8) operator(=) regexpinlinecontent(?|)inlinecontent(?)inlinedelimiter(/)>] -insert[insert(+) constant(PREFIX2) operator(=) regexpinlinecontent(?|)inlinecontent(?)inlinedelimiter(/)>] -insert[insert(+) constant(UINT10) operator(=) regexpcontent(+#*)delimiter(/)>] -insert[insert(+) constant(UINT16) operator(=) regexpcontent(+#*)delimiter(/)>] -insert[insert(+) constant(UINT8) operator(=) regexpcontent(+#*)delimiter(/)>] -insert[insert(+) constant(UINT2) operator(=) regexpcontent(+#*)delimiter(/)>] -insert[insert(+) constant(DECIMAL) operator(=) regexpcontent(+#+)char(\\.)content(#*)inlinecontent(|)inlinecontent(+)char(\\.)inlinecontent(*#*)inlinecontent(|)char(\\.)inlinecontent(+#*)inlinecontent(|)inlineinlinedelimiter(/)>] -insert[insert(+) constant(UREAL10) operator(=) regexpchar(\\/)inlinecontent(|)inlinecontent(|)inlinedelimiter(/)>] -insert[insert(+) constant(UREAL16) operator(=) regexpchar(\\/)inlinecontent(|)inlinedelimiter(/)>] -insert[insert(+) constant(UREAL8) operator(=) regexpchar(\\/)inlinecontent(|)inlinedelimiter(/)>] -insert[insert(+) constant(UREAL2) operator(=) regexpchar(\\/)inlinecontent(|)inlinedelimiter(/)>] -insert[insert(+) constant(REAL10) operator(=) regexpinlinedelimiter(/)>] -insert[insert(+) constant(REAL16) operator(=) regexpinlinedelimiter(/)>] -insert[insert(+) constant(REAL8) operator(=) regexpinlinedelimiter(/)>] -insert[insert(+) constant(REAL2) operator(=) regexpinlinedelimiter(/)>] -insert[insert(+) constant(IMAG10) operator(=) regexpcontent(i)delimiter(/)>] -insert[insert(+) constant(IMAG16) operator(=) regexpcontent(i)delimiter(/)>] -insert[insert(+) constant(IMAG8) operator(=) regexpcontent(i)delimiter(/)>] -insert[insert(+) constant(IMAG2) operator(=) regexpcontent(i)delimiter(/)>] -insert[insert(+) constant(COMPLEX10) operator(=) regexpcontent(@)inlinecontent(|)inlinechar(\\+)inlinecontent(|)inlinecontent(-)inlinecontent(|)char(\\+)inlinecontent(|-)inlinecontent(|)inlinedelimiter(/)>] -insert[insert(+) constant(COMPLEX16) operator(=) regexpcontent(@)inlinecontent(|)inlinechar(\\+)inlinecontent(|)inlinecontent(-)inlinecontent(|)char(\\+)inlinecontent(|-)inlinecontent(|)inlinedelimiter(/)>] -insert[insert(+) constant(COMPLEX8) operator(=) regexpcontent(@)inlinecontent(|)inlinechar(\\+)inlinecontent(|)inlinecontent(-)inlinecontent(|)char(\\+)inlinecontent(|-)inlinecontent(|)inlinedelimiter(/)>] -insert[insert(+) constant(COMPLEX2) operator(=) regexpcontent(@)inlinecontent(|)inlinechar(\\+)inlinecontent(|)inlinecontent(-)inlinecontent(|)char(\\+)inlinecontent(|-)inlinecontent(|)inlinedelimiter(/)>] -insert[insert(+) constant(NUM10) operator(=) regexpcontent(?)inlinedelimiter(/)>] -insert[insert(+) constant(NUM16) operator(=) regexpinlinedelimiter(/)>] -insert[insert(+) constant(NUM8) operator(=) regexpinlinedelimiter(/)>] -insert[insert(+) constant(NUM2) operator(=) regexpinlinedelimiter(/)>] -insert[insert(+) constant(NUM) operator(=) regexpcontent(|)inlinecontent(|)inlinecontent(|)inlinedelimiter(/)>] -insert[insert(+) ] -insert[insert(+) ident(private)] -insert[insert(+) reserved(def) method(scan_tokens) ident(tokens)operator(,)ident(options)] -insert[insert(+) ] -insert[insert(+) ident(state) operator(=) symbol(:initial)] -insert[insert(+) ident(ident_kind) operator(=) constant(IDENT_KIND)] -insert[insert(+) ] -insert[insert(+) reserved(until) ident(eos?)] -insert[insert(+) ident(kind) operator(=) ident(match) operator(=) pre_constant(nil)] -insert[insert(+) ] -insert[insert(+) reserved(case) ident(state)] -insert[insert(+) reserved(when) symbol(:initial)] -insert[insert(+) reserved(if) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:space)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:operator_fat)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:comment)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:char)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:pre_constant)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\))] -insert[insert(+) ident(kind) operator(=) ident(ident_kind)operator([)ident(matched)operator(])] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:operator)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:string)operator(])] -insert[insert(+) ident(state) operator(=) symbol(:string)] -insert[insert(+) ident(tokens) operator(<<) operator([)stringoperator(,) symbol(:delimiter)operator(])] -insert[insert(+) reserved(next)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\)) reserved(and) reserved(not) ident(matched)operator(.)ident(empty?)] -insert[insert(+) ident(kind) operator(=) symbol(:integer)] -insert[insert(+) reserved(elsif) ident(getch)] -insert[insert(+) ident(kind) operator(=) symbol(:error)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) reserved(when) symbol(:string)] -insert[insert(+) reserved(if) ident(scan)operator(()regexpoperator(\)) reserved(or) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:content)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(tokens) operator(<<) operator([)stringoperator(,) symbol(:delimiter)operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:string)operator(])] -insert[insert(+) ident(state) operator(=) symbol(:initial)] -insert[insert(+) reserved(next)] -insert[insert(+) reserved(else)] -insert[insert(+) ident(raise_inspect) string operator(%) ident(peek)operator(()integer(1)operator(\))operator(,)] -insert[insert(+) ident(tokens)operator(,) ident(state)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) reserved(else)] -insert[insert(+) ident(raise) string] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) ident(match) operator(||=) ident(matched)] -insert[insert(+) reserved(if) global_variable($DEBUG) reserved(and) reserved(not) ident(kind)] -insert[insert(+) ident(raise_inspect) string operator(%)] -insert[insert(+) operator([)operator([)ident(match)operator(,) ident(kind)operator(])operator(,) ident(line)operator(])operator(,) ident(tokens)] -insert[insert(+) reserved(end)] -insert[insert(+) ident(raise_inspect) stringoperator(,) ident(tokens)operator(,) ident(state) reserved(unless) ident(match)] -insert[insert(+) ] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(])] -insert[insert(+) ] -insert[insert(+) reserved(end) comment(# until eos)] -insert[insert(+) ] -insert[insert(+) reserved(if) ident(state) operator(==) symbol(:string)] -insert[insert(+) ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:string)operator(])] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) ident(tokens)] -insert[insert(+) ] -insert[insert(+) reserved(end) comment(#scan_tokens)] -insert[insert(+) reserved(end) comment(#class)] -insert[insert(+) reserved(end) comment(#module scanners)] -insert[insert(+)reserved(end) comment(#module coderay)] -change[change(\\ )plain(No newline at end of file)] -head[head(Index: )plain(lib/coderay/scanners/delphi.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/delphi.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/delphi.rb)plain( (revision 250\))] -change[change(@@)plain( -29,13 +29,18 )change(@@)] - stringoperator(,) stringoperator(,) string - operator(]) - -delete[delete(-) constant(IDENT_KIND) operator(=) constant(CaseIgnoringWordList)operator(.)ident(new)operator(()symbol(:ident)operator(\))operator(.)] -insert[insert(+) constant(IDENT_KIND) operator(=) constant(CaseIgnoringWordList)operator(.)ident(new)operator(()symbol(:ident)operator(,) ident(caching)operator(=)pre_constant(true)operator(\))operator(.)] - ident(add)operator(()constant(RESERVED_WORDS)operator(,) symbol(:reserved)operator(\))operator(.) - ident(add)operator(()constant(DIRECTIVES)operator(,) symbol(:directive)operator(\)) -insert[insert(+) ] -insert[insert(+) constant(NAME_FOLLOWS) operator(=) constant(CaseIgnoringWordList)operator(.)ident(new)operator(()pre_constant(false)operator(,) ident(caching)operator(=)pre_constant(true)operator(\))operator(.)] -insert[insert(+) ident(add)operator(()stringoperator(\))] - -insert[insert(+) ident(private)] - reserved(def) method(scan_tokens) ident(tokens)operator(,) ident(options) - - ident(state) operator(=) symbol(:initial) -insert[insert(+) ident(last_token) operator(=) string] - - reserved(until) ident(eos?) - -change[change(@@)plain( -45,19 +50,29 )change(@@)] - reserved(if) ident(state) operator(==) symbol(:initial) - - reserved(if) ident(scan)operator(()regexpoperator(\)) -delete[delete(-) ident(kind) operator(=) symbol(:space)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(matched)operator(,) symbol(:space)operator(])] -insert[insert(+) reserved(next)] - - reserved(elsif) ident(scan)operator(()regexpoperator(\)) -delete[delete(-) ident(kind) operator(=) symbol(:preprocessor)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(matched)operator(,) symbol(:preprocessor)operator(])] -insert[insert(+) reserved(next)] - - reserved(elsif) ident(scan)operator(()regexpoperator(\)) -delete[delete(-) ident(kind) operator(=) symbol(:comment)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(matched)operator(,) symbol(:comment)operator(])] -insert[insert(+) reserved(next)] - -delete[delete(-) reserved(elsif) ident(scan)operator(()regexp:;,.@)char(\\^)content(|)char(\\()char(\\\))char(\\[)char(\\])content(]+ )delimiter(/)modifier(x)>operator(\))] -insert[insert(+) reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexp=]? | >=? | :=? | [-+=*)char(\\/)content(;,@)char(\\^)content(|)char(\\()char(\\\))char(\\[)char(\\])content(] | )char(\\.)char(\\.)content( )delimiter(/)modifier(x)>operator(\))] - ident(kind) operator(=) symbol(:operator) -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:operator)] -insert[insert(+) reserved(if) ident(last_token) operator(==) string] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(])] -insert[insert(+) reserved(next)] -insert[insert(+) reserved(end)] - - reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexpoperator(\)) -delete[delete(-) ident(kind) operator(=) constant(IDENT_KIND)operator([)ident(match)operator(])] -insert[insert(+) ident(kind) operator(=) constant(NAME_FOLLOWS)operator([)ident(last_token)operator(]) operator(?) symbol(:ident) operator(:) constant(IDENT_KIND)operator([)ident(match)operator(])] - - reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexpoperator(\)) - ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:char)operator(]) -change[change(@@)plain( -101,6 +116,7 )change(@@)] - ident(state) operator(=) symbol(:initial) - reserved(next) - reserved(elsif) ident(scan)operator(()regexpoperator(\)) -insert[insert(+) ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:string)operator(])] - ident(kind) operator(=) symbol(:error) - ident(state) operator(=) symbol(:initial) - reserved(else) -change[change(@@)plain( -119,6 +135,7 )change(@@)] - reserved(end) - ident(raise_inspect) stringoperator(,) ident(tokens) reserved(unless) ident(match) - -insert[insert(+) ident(last_token) operator(=) ident(match)] - ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(]) - - reserved(end) -head[head(Index: )plain(lib/coderay/scanners/debug.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/debug.rb)plain( (revision 0\))] -head[head(+++ )filename(lib/coderay/scanners/debug.rb)plain( (revision 250\))] -change[change(@@)plain( -0,0 +1,60 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+)reserved(module) class(Scanners)] -insert[insert(+)] -insert[insert(+) comment(# = Debug Scanner)] -insert[insert(+) reserved(class) class(Debug) operator(<) constant(Scanner)] -insert[insert(+)] -insert[insert(+) ident(include) constant(Streamable)] -insert[insert(+) ident(register_for) symbol(:debug)] -insert[insert(+)] -insert[insert(+) ident(protected)] -insert[insert(+) reserved(def) method(scan_tokens) ident(tokens)operator(,) ident(options)] -insert[insert(+)] -insert[insert(+) ident(opened_tokens) operator(=) operator([)operator(])] -insert[insert(+)] -insert[insert(+) reserved(until) ident(eos?)] -insert[insert(+)] -insert[insert(+) ident(kind) operator(=) pre_constant(nil)] -insert[insert(+) ident(match) operator(=) pre_constant(nil)] -insert[insert(+)] -insert[insert(+) reserved(if) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(matched)operator(,) symbol(:space)operator(])] -insert[insert(+) reserved(next)] -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) pre_constant(self)operator([)integer(1)operator(])operator(.)ident(to_sym)] -insert[insert(+) ident(match) operator(=) pre_constant(self)operator([)integer(2)operator(])operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))] -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexpoperator(\))] -insert[insert(+) ident(kind) operator(=) pre_constant(self)operator([)integer(1)operator(])operator(.)ident(to_sym)] -insert[insert(+) ident(opened_tokens) operator(<<) ident(kind)] -insert[insert(+) ident(match) operator(=) symbol(:open)] -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp )delimiter(/)modifier(x)>operator(\))] -insert[insert(+) ident(kind) operator(=) ident(opened_tokens)operator(.)ident(pop)] -insert[insert(+) ident(match) operator(=) symbol(:close)] -insert[insert(+) ] -insert[insert(+) reserved(else)] -insert[insert(+) ident(kind) operator(=) symbol(:error)] -insert[insert(+) ident(getch)] -insert[insert(+)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) ident(match) operator(||=) ident(matched)] -insert[insert(+) reserved(if) global_variable($DEBUG) reserved(and) reserved(not) ident(kind)] -insert[insert(+) ident(raise_inspect) string operator(%)] -insert[insert(+) operator([)operator([)ident(match)operator(,) ident(kind)operator(])operator(,) ident(line)operator(])operator(,) ident(tokens)] -insert[insert(+) reserved(end)] -insert[insert(+) ident(raise_inspect) stringoperator(,) ident(tokens) reserved(unless) ident(match)] -insert[insert(+)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(])] -insert[insert(+) ] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) ident(tokens)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+)reserved(end)] -insert[insert(+)reserved(end)] -head[head(Index: )plain(lib/coderay/scanners/rhtml.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/rhtml.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/rhtml.rb)plain( (revision 250\))] -change[change(@@)plain( -51,10 +51,10 )change(@@)] - ident(start_tag) operator(=) ident(match)operator([)regexpoperator(]) - ident(end_tag) operator(=) ident(match)operator([)regexp?)char(\\z)delimiter(/)>operator(]) - ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:inline)operator(]) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:delimiter)operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:inline_delimiter)operator(])] - ident(code) operator(=) ident(match)operator([)ident(start_tag)operator(.)ident(size) operator(..) integer(-1) operator(-) ident(end_tag)operator(.)ident(size)operator(]) - instance_variable(@ruby_scanner)operator(.)ident(tokenize) ident(code) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:inline_delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] - ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:inline)operator(]) - - reserved(else) -head[head(Index: )plain(lib/coderay/scanners/nitro_xhtml.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/nitro_xhtml.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/nitro_xhtml.rb)plain( (revision 250\))] -change[change(@@)plain( -95,20 +95,20 )change(@@)] - ident(delimiter) operator(=) constant(CLOSING_PAREN)operator([)ident(start_tag)operator([)integer(1)operator(,)integer(1)operator(])operator(]) - ident(end_tag) operator(=) ident(match)operator([)integer(-1)operator(,)integer(1)operator(]) operator(==) ident(delimiter) operator(?) ident(delimiter) operator(:) string - ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:inline)operator(]) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:delimiter)operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:inline_delimiter)operator(])] - ident(code) operator(=) ident(match)operator([)ident(start_tag)operator(.)ident(size) operator(..) integer(-1) operator(-) ident(end_tag)operator(.)ident(size)operator(]) - instance_variable(@ruby_scanner)operator(.)ident(tokenize) ident(code) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:inline_delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] - ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:inline)operator(]) - - reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\)) - ident(start_tag) operator(=) string - ident(end_tag) operator(=) ident(match)operator([)integer(-2)operator(,)integer(2)operator(]) operator(==) string)delimiter(')> operator(?) string)delimiter(')> operator(:) string - ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:inline)operator(]) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:delimiter)operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:inline_delimiter)operator(])] - ident(code) operator(=) ident(match)operator([)ident(start_tag)operator(.)ident(size) operator(..) operator(-)operator(()ident(end_tag)operator(.)ident(size)operator(\))operator(-)integer(1)operator(]) - instance_variable(@ruby_scanner)operator(.)ident(tokenize) ident(code) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:inline_delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] - ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:inline)operator(]) - - reserved(elsif) ident(entity) operator(=) ident(scan)operator(()regexpdelimiter(/)modifier(o)>operator(\)) -head[head(Index: )plain(lib/coderay/scanners/plaintext.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/plaintext.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/plaintext.rb)plain( (revision 250\))] -change[change(@@)plain( -4,6 +4,8 )change(@@)] - reserved(class) class(Plaintext) operator(<) constant(Scanner) - - ident(register_for) symbol(:plaintext)operator(,) symbol(:plain) -insert[insert(+) ] -insert[insert(+) ident(include) constant(Streamable)] - - reserved(def) method(scan_tokens) ident(tokens)operator(,) ident(options) - ident(text) operator(=) operator(()ident(scan_until)operator(()regexpoperator(\)) operator(||) stringoperator(\)) -head[head(Index: )plain(lib/coderay.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay.rb)plain( (revision 250\))] -change[change(@@)plain( -24,8 +24,8 )change(@@)] - comment(#) - comment(# == Usage) - comment(#) -delete[delete(-)comment(# Remember you need RubyGems to use CodeRay. Run Ruby with -rubygems option)] -delete[delete(-)comment(# if required.)] -insert[insert(+)comment(# Remember you need RubyGems to use CodeRay, unless you have it in your load path. Run Ruby with)] -insert[insert(+)comment(# -rubygems option if required.)] - comment(#) - comment(# === Highlight Ruby code in a string as html) - comment(# ) -change[change(@@)plain( -44,19 +44,15 )change(@@)] - comment(# ) - comment(# You can include this div in your page. The used CSS styles can be printed with) - comment(# ) -delete[delete(-)comment(# % ruby -rcoderay -e "print CodeRay::Encoders[:html]::CSS")] -insert[insert(+)comment(# % coderay_stylesheet)] - comment(# ) - comment(# === Highlight without typing too much) -delete[delete(-)comment(#)] -insert[insert(+)comment(# )] - comment(# If you are one of the hasty (or lazy, or extremely curious\) people, just run this file:) -delete[delete(-)comment(#)] -delete[delete(-)comment(# % ruby -rubygems coderay.rb)] - comment(# ) -delete[delete(-)comment(# If the output was to fast for you, try)] -insert[insert(+)comment(# % ruby -rubygems /path/to/coderay/coderay.rb > example.html)] - comment(# ) -delete[delete(-)comment(# % ruby -rubygems coderay.rb > example.html)] -delete[delete(-)comment(#)] -delete[delete(-)comment(# and look at the file it created.)] -insert[insert(+)comment(# and look at the file it created in your browser.)] - comment(# ) - comment(# = CodeRay Module) - comment(#) -change[change(@@)plain( -111,7 +107,7 )change(@@)] - comment(#) - comment(# CodeRay.scan_stream:: Scan in stream mode.) - comment(#) -delete[delete(-)comment(# == All-in-One Encoding)] -insert[insert(+)comment(# == All-in-One Encoding)] - comment(#) - comment(# CodeRay.encode:: Highlight a string with a given input and output format.) - comment(#) -change[change(@@)plain( -121,11 +117,16 )change(@@)] - comment(# for this Encoder must only be done once.) - comment(#) - comment(# CodeRay.encoder:: Create an Encoder instance with format and options.) -insert[insert(+)comment(# CodeRay.scanner:: Create an Scanner instance for lang, with '' as default code.)] - comment(#) -delete[delete(-)comment(# There is no CodeRay.scanner method because Scanners are bound to an input string)] -delete[delete(-)comment(# on creation; you can't re-use them with another string.)] -insert[insert(+)comment(# To make use of CodeRay.scanner, use CodeRay::Scanner::code=.)] - comment(#) -delete[delete(-)comment(# The scanning methods provide more flexibility; we recommend to use these.)] -insert[insert(+)comment(# The scanning methods provide more flexibility; we recommend to use these.)] -insert[insert(+)comment(# )] -insert[insert(+)comment(# == Reusing Scanners and Encoders)] -insert[insert(+)comment(# )] -insert[insert(+)comment(# If you want to re-use scanners and encoders (because that is faster\), see)] -insert[insert(+)comment(# CodeRay::Duo for the most convenient (and recommended\) interface.)] - reserved(module) class(CodeRay) - - comment(# Version: Major.Minor.Teeny[.Revision]) -change[change(@@)plain( -133,7 +134,7 )change(@@)] - comment(# Minor: odd for beta, even for stable) - comment(# Teeny: development state) - comment(# Revision: Subversion Revision number (generated on rake\)) -delete[delete(-) constant(VERSION) operator(=) string] -insert[insert(+) constant(VERSION) operator(=) string] - - ident(require) string - ident(require) string -change[change(@@)plain( -170,7 +171,7 )change(@@)] - reserved(def) method(scan_file) ident(filename)operator(,) ident(lang) operator(=) symbol(:auto)operator(,) ident(options) operator(=) operator({)operator(})operator(,) operator(&)ident(block) - ident(file) operator(=) constant(IO)operator(.)ident(read) ident(filename) - reserved(if) ident(lang) operator(==) symbol(:auto) -delete[delete(-) ident(require) string] -insert[insert(+) ident(require) string] - ident(lang) operator(=) constant(FileType)operator(.)ident(fetch) ident(filename)operator(,) symbol(:plaintext)operator(,) pre_constant(true) - reserved(end) - ident(scan) ident(file)operator(,) ident(lang)operator(,) ident(options) operator(=) operator({)operator(})operator(,) operator(&)ident(block) -change[change(@@)plain( -314,6 +315,7 )change(@@)] - comment(# Run a test script.) - reserved(if) global_variable($0) operator(==) pre_constant(__FILE__) - global_variable($stderr)operator(.)ident(print) stringoperator(;) ident(gets) -delete[delete(-) ident(code) operator(=) constant(File)operator(.)ident(read)operator(()global_variable($0)operator(\))operator([)regexpoperator(])] -insert[insert(+) comment(# Just use this file as an example of Ruby code.)] -insert[insert(+) ident(code) operator(=) constant(File)operator(.)ident(read)operator(()pre_constant(__FILE__)operator(\))operator([)regexpoperator(])] - ident(print) constant(CodeRay)operator(.)ident(scan)operator(()ident(code)operator(,) symbol(:ruby)operator(\))operator(.)ident(html) - reserved(end) - -head[head(Property changes on: )plain(lib)] -head[head(___________________________________________________________________)filename()] -head[head(Added: )plain(svn:externals)] -insert[insert( +)plain( term http://term-ansicolor.rubyforge.org/svn/trunk/lib/term/)] - - diff --git a/test/scanners/diff/coderay200vs250.in.diff b/test/scanners/diff/coderay200vs250.in.diff deleted file mode 100644 index f7b99ca..0000000 --- a/test/scanners/diff/coderay200vs250.in.diff +++ /dev/null @@ -1,2241 +0,0 @@ -Index: lib/coderay/token_classes.rb -=================================================================== ---- lib/coderay/token_classes.rb (revision 0) -+++ lib/coderay/token_classes.rb (revision 250) -@@ -0,0 +1,71 @@ -+module CodeRay -+ class Tokens -+ ClassOfKind = Hash.new do |h, k| -+ h[k] = k.to_s -+ end -+ ClassOfKind.update with = { -+ :attribute_name => 'an', -+ :attribute_name_fat => 'af', -+ :attribute_value => 'av', -+ :attribute_value_fat => 'aw', -+ :bin => 'bi', -+ :char => 'ch', -+ :class => 'cl', -+ :class_variable => 'cv', -+ :color => 'cr', -+ :comment => 'c', -+ :constant => 'co', -+ :content => 'k', -+ :definition => 'df', -+ :delimiter => 'dl', -+ :directive => 'di', -+ :doc => 'do', -+ :doc_string => 'ds', -+ :entity => 'en', -+ :error => 'er', -+ :escape => 'e', -+ :exception => 'ex', -+ :float => 'fl', -+ :function => 'fu', -+ :global_variable => 'gv', -+ :hex => 'hx', -+ :include => 'ic', -+ :inline => 'il', -+ :inline_delimiter => 'idl', -+ :instance_variable => 'iv', -+ :integer => 'i', -+ :interpreted => 'in', -+ :label => 'la', -+ :local_variable => 'lv', -+ :modifier => 'mod', -+ :oct => 'oc', -+ :operator_fat => 'of', -+ :pre_constant => 'pc', -+ :pre_type => 'pt', -+ :predefined => 'pd', -+ :preprocessor => 'pp', -+ :regexp => 'rx', -+ :reserved => 'r', -+ :shell => 'sh', -+ :string => 's', -+ :symbol => 'sy', -+ :tag => 'ta', -+ :tag_fat => 'tf', -+ :tag_special => 'ts', -+ :type => 'ty', -+ :variable => 'v', -+ :xml_text => 'xt', -+ -+ :ident => :NO_HIGHLIGHT, # 'id' -+ #:operator => 'op', -+ :operator => :NO_HIGHLIGHT, # 'op' -+ :space => :NO_HIGHLIGHT, # 'sp' -+ :plain => :NO_HIGHLIGHT, -+ } -+ ClassOfKind[:procedure] = ClassOfKind[:method] = ClassOfKind[:function] -+ ClassOfKind[:open] = ClassOfKind[:close] = ClassOfKind[:delimiter] -+ ClassOfKind[:nesting_delimiter] = ClassOfKind[:delimiter] -+ ClassOfKind[:escape] = ClassOfKind[:delimiter] -+ #ClassOfKind.default = ClassOfKind[:error] or raise 'no class found for :error!' -+ end -+end -\ No newline at end of file - -Property changes on: lib/coderay/token_classes.rb -___________________________________________________________________ -Added: svn:executable - + * - -Index: lib/coderay/encoder.rb -=================================================================== ---- lib/coderay/encoder.rb (revision 200) -+++ lib/coderay/encoder.rb (revision 250) -@@ -1,3 +1,5 @@ -+require "stringio" -+ - module CodeRay - - # This module holds the Encoder class and its subclasses. -@@ -40,7 +42,7 @@ - # downcase class name instead. - def const_missing sym - if sym == :FILE_EXTENSION -- sym.to_s.downcase -+ plugin_id - else - super - end -@@ -130,13 +132,15 @@ - # By default, it calls text_token or block_token, depending on - # whether +text+ is a String. - def token text, kind -- if text.instance_of? ::String # Ruby 1.9: :open.is_a? String -- text_token text, kind -- elsif text.is_a? ::Symbol -- block_token text, kind -- else -- raise 'Unknown token text type: %p' % text -- end -+ out = -+ if text.is_a? ::String # Ruby 1.9: :open.is_a? String -+ text_token text, kind -+ elsif text.is_a? ::Symbol -+ block_token text, kind -+ else -+ raise 'Unknown token text type: %p' % text -+ end -+ @out << out if defined?(@out) && @out - end - - def text_token text, kind -@@ -164,7 +168,8 @@ - # The already created +tokens+ object must be used; it can be a - # TokenStream or a Tokens object. - def compile tokens, options -- tokens.each(&self) -+ tokens.each { |text, kind| token text, kind } # FIXME for Ruby 1.9? -+ #tokens.each(&self) - end - - end -Index: lib/coderay/encoders/xml.rb -=================================================================== ---- lib/coderay/encoders/xml.rb (revision 200) -+++ lib/coderay/encoders/xml.rb (revision 250) -@@ -22,7 +22,6 @@ - protected - - def setup options -- @out = '' - @doc = REXML::Document.new - @doc << REXML::XMLDecl.new - @tab_width = options[:tab_width] -@@ -33,7 +32,7 @@ - @doc.write @out, options[:pretty], options[:transitive], true - @out - end -- -+ - def text_token text, kind - if kind == :space - token = @node -Index: lib/coderay/encoders/html/classes.rb -=================================================================== ---- lib/coderay/encoders/html/classes.rb (revision 200) -+++ lib/coderay/encoders/html/classes.rb (revision 250) -@@ -1,77 +0,0 @@ --module CodeRay --module Encoders -- -- class HTML -- -- ClassOfKind = Hash.new do |h, k| -- h[k] = k.to_s -- end -- ClassOfKind.update with = { -- :attribute_name => 'an', -- :attribute_name_fat => 'af', -- :attribute_value => 'av', -- :attribute_value_fat => 'aw', -- :bin => 'bi', -- :char => 'ch', -- :class => 'cl', -- :class_variable => 'cv', -- :color => 'cr', -- :comment => 'c', -- :constant => 'co', -- :content => 'k', -- :definition => 'df', -- :delimiter => 'dl', -- :directive => 'di', -- :doc => 'do', -- :doc_string => 'ds', -- :entity => 'en', -- :error => 'er', -- :escape => 'e', -- :exception => 'ex', -- :float => 'fl', -- :function => 'fu', -- :global_variable => 'gv', -- :hex => 'hx', -- :include => 'ic', -- :inline => 'il', -- :inline_delimiter => 'idl', -- :instance_variable => 'iv', -- :integer => 'i', -- :interpreted => 'in', -- :label => 'la', -- :local_variable => 'lv', -- :modifier => 'mod', -- :oct => 'oc', -- :operator_name => 'on', -- :pre_constant => 'pc', -- :pre_type => 'pt', -- :predefined => 'pd', -- :preprocessor => 'pp', -- :regexp => 'rx', -- :reserved => 'r', -- :shell => 'sh', -- :string => 's', -- :symbol => 'sy', -- :tag => 'ta', -- :tag_fat => 'tf', -- :tag_special => 'ts', -- :type => 'ty', -- :variable => 'v', -- :xml_text => 'xt', -- -- :ident => :NO_HIGHLIGHT, # 'id' -- #:operator => 'op', -- :operator => :NO_HIGHLIGHT, # 'op' -- :space => :NO_HIGHLIGHT, # 'sp' -- :plain => :NO_HIGHLIGHT, -- } -- ClassOfKind[:procedure] = ClassOfKind[:method] = ClassOfKind[:function] -- ClassOfKind[:open] = ClassOfKind[:close] = ClassOfKind[:delimiter] -- ClassOfKind[:nesting_delimiter] = ClassOfKind[:delimiter] -- ClassOfKind[:escape] = ClassOfKind[:delimiter] -- #ClassOfKind.default = ClassOfKind[:error] or raise 'no class found for :error!' -- -- end -- --end --end -Index: lib/coderay/encoders/html/numerization.rb -=================================================================== ---- lib/coderay/encoders/html/numerization.rb (revision 200) -+++ lib/coderay/encoders/html/numerization.rb (revision 250) -@@ -51,12 +51,12 @@ - case mode - when :inline - max_width = (start + line_count).to_s.size -- line = start -+ line_number = start - gsub!(/^/) do -- line_number = bolding.call line -- indent = ' ' * (max_width - line.to_s.size) -- res = "#{indent}#{line_number} " -- line += 1 -+ line_number_text = bolding.call line_number -+ indent = ' ' * (max_width - line_number.to_s.size) # TODO: Optimize (10^x) -+ res = "#{indent}#{line_number_text} " -+ line_number += 1 - res - end - -Index: lib/coderay/encoders/tokens.rb -=================================================================== ---- lib/coderay/encoders/tokens.rb (revision 200) -+++ lib/coderay/encoders/tokens.rb (revision 250) -@@ -33,9 +33,9 @@ - - FILE_EXTENSION = 'tok' - -- protected -- def token *args -- @out << CodeRay::Tokens.write_token(*args) -+ protected -+ def token text, kind -+ @out << CodeRay::Tokens.write_token(text, kind) - end - - end -Index: lib/coderay/encoders/html.rb -=================================================================== ---- lib/coderay/encoders/html.rb (revision 200) -+++ lib/coderay/encoders/html.rb (revision 250) -@@ -1,3 +1,5 @@ -+require "set" -+ - module CodeRay - module Encoders - -@@ -10,7 +12,8 @@ - # - # require 'coderay' - # puts CodeRay.scan('Some /code/', :ruby).html #-> a HTML page -- # puts CodeRay.scan('Some /code/', :ruby).html(:wrap => :span) #-> Some /code/ -+ # puts CodeRay.scan('Some /code/', :ruby).html(:wrap => :span) -+ # #-> Some /code/ - # puts CodeRay.scan('Some /code/', :ruby).span #-> the same - # - # puts CodeRay.scan('Some code', :ruby).html( -@@ -55,7 +58,8 @@ - # - # === :hint - # Include some information into the output using the title attribute. -- # Can be :info (show token type on mouse-over), :info_long (with full path) or :debug (via inspect). -+ # Can be :info (show token type on mouse-over), :info_long (with full path) -+ # or :debug (via inspect). - # - # Default: false - class HTML < Encoder -@@ -82,7 +86,7 @@ - :hint => false, - } - -- helper :classes, :output, :css -+ helper :output, :css - - attr_reader :css - -@@ -115,11 +119,14 @@ - end - } - -+ TRANSPARENT_TOKEN_KINDS = [ -+ :delimiter, :modifier, :content, :escape, :inline_delimiter, -+ ].to_set -+ - # Generate a hint about the given +classes+ in a +hint+ style. - # - # +hint+ may be :info, :info_long or :debug. - def self.token_path_to_hint hint, classes -- return '' unless hint - title = - case hint - when :info -@@ -129,7 +136,7 @@ - when :debug - classes.inspect - end -- " title=\"#{title}\"" -+ title ? " title=\"#{title}\"" : '' - end - - def setup options -@@ -143,42 +150,45 @@ - - hint = options[:hint] - if hint and not [:debug, :info, :info_long].include? hint -- raise ArgumentError, "Unknown value %p for :hint; expected :info, :debug, false or nil." % hint -+ raise ArgumentError, "Unknown value %p for :hint; \ -+ expected :info, :debug, false, or nil." % hint - end - - case options[:css] - - when :class - @css_style = Hash.new do |h, k| -- if k.is_a? Array -- type = k.first -- else -- type = k -- end -- c = ClassOfKind[type] -+ c = CodeRay::Tokens::ClassOfKind[k.first] - if c == :NO_HIGHLIGHT and not hint -- h[k] = false -+ h[k.dup] = false - else -- title = HTML.token_path_to_hint hint, (k[1..-1] << k.first) -- h[k] = '' % [title, c] -+ title = if hint -+ HTML.token_path_to_hint(hint, k[1..-1] << k.first) -+ else -+ '' -+ end -+ if c == :NO_HIGHLIGHT -+ h[k.dup] = '' % [title] -+ else -+ h[k.dup] = '' % [title, c] -+ end - end - end - - when :style - @css_style = Hash.new do |h, k| -- if k.is_a? Array -+ if k.is_a? ::Array - styles = k.dup - else - styles = [k] - end - type = styles.first -- classes = styles.map { |c| ClassOfKind[c] } -+ classes = styles.map { |c| Tokens::ClassOfKind[c] } - if classes.first == :NO_HIGHLIGHT and not hint - h[k] = false - else -- styles.shift if [:delimiter, :modifier, :content, :escape].include? styles.first -+ styles.shift if TRANSPARENT_TOKEN_KINDS.include? styles.first - title = HTML.token_path_to_hint hint, styles -- classes.delete 'il' - style = @css[*classes] - h[k] = - if style -@@ -198,7 +208,9 @@ - def finish options - not_needed = @opened.shift - @out << '' * @opened.size -- warn '%d tokens still open: %p' % [@opened.size, @opened] unless @opened.empty? -+ unless @opened.empty? -+ warn '%d tokens still open: %p' % [@opened.size, @opened] -+ end - - @out.extend Output - @out.css = @css -@@ -229,8 +241,9 @@ - if @opened.empty? - # nothing to close - else -- if @opened.size == 1 or @opened.last != type -- raise 'Malformed token stream: Trying to close a token (%p) that is not open. Open are: %p.' % [type, @opened[1..-1]] if $DEBUG -+ if $DEBUG and (@opened.size == 1 or @opened.last != type) -+ raise 'Malformed token stream: Trying to close a token (%p) \ -+ that is not open. Open are: %p.' % [type, @opened[1..-1]] - end - @out << '' - @opened.pop -Index: lib/coderay/encoders/text.rb -=================================================================== ---- lib/coderay/encoders/text.rb (revision 200) -+++ lib/coderay/encoders/text.rb (revision 250) -@@ -14,13 +14,12 @@ - - protected - def setup options -- super -+ @out = '' - @sep = options[:separator] - end - - def token text, kind -- return unless text.respond_to? :to_str -- @out << text + @sep -+ @out << text + @sep if text.is_a? ::String - end - - def finish options -Index: lib/coderay/encoders/debug.rb -=================================================================== ---- lib/coderay/encoders/debug.rb (revision 200) -+++ lib/coderay/encoders/debug.rb (revision 250) -@@ -19,19 +19,14 @@ - - protected - def text_token text, kind -- @out << -- if kind == :space -- text -- else -- text = text.gsub(/[)\\]/, '\\\\\0') -- "#{kind}(#{text})" -- end -+ if kind == :space -+ text -+ else -+ text = text.gsub(/[)\\]/, '\\\\\0') # escape ) and \ -+ "#{kind}(#{text})" -+ end - end - -- def block_token action, kind -- @out << super -- end -- - def open_token kind - "#{kind}<" - end -Index: lib/coderay/encoders/statistic.rb -=================================================================== ---- lib/coderay/encoders/statistic.rb (revision 200) -+++ lib/coderay/encoders/statistic.rb (revision 250) -@@ -28,19 +28,15 @@ - @type_stats[kind].count += 1 - @type_stats[kind].size += text.size - @type_stats['TOTAL'].size += text.size -+ @type_stats['TOTAL'].count += 1 - end - - # TODO Hierarchy handling - def block_token action, kind -- #@content_type = kind -+ @type_stats['TOTAL'].count += 1 - @type_stats['open/close'].count += 1 - end - -- def token text, kind -- super -- @type_stats['TOTAL'].count += 1 -- end -- - STATS = <<-STATS - - Code Statistics -Index: lib/coderay/encoders/_map.rb -=================================================================== ---- lib/coderay/encoders/_map.rb (revision 200) -+++ lib/coderay/encoders/_map.rb (revision 250) -@@ -2,7 +2,8 @@ - module Encoders - - map :stats => :statistic, -- :plain => :text -+ :plain => :text, -+ :tex => :latex - - end - end -Index: lib/coderay/helpers/filetype.rb -=================================================================== ---- lib/coderay/helpers/filetype.rb (revision 200) -+++ lib/coderay/helpers/filetype.rb (revision 250) -@@ -1,180 +0,0 @@ --# =FileType --# --# A simple filetype recognizer --# --# Author: murphy (mail to murphy cYcnus de) --# --# Version: 0.1 (2005.september.1) --# --# == Documentation --# --# # determine the type of the given --# lang = FileType[ARGV.first] --# --# # return :plaintext if the file type is unknown --# lang = FileType.fetch ARGV.first, :plaintext --# --# # try the shebang line, too --# lang = FileType.fetch ARGV.first, :plaintext, true --module FileType -- -- UnknownFileType = Class.new Exception -- -- class << self -- -- # Try to determine the file type of the file. -- # -- # +filename+ is a relative or absolute path to a file. -- # -- # The file itself is only accessed when +read_shebang+ is set to true. -- # That means you can get filetypes from files that don't exist. -- def [] filename, read_shebang = false -- name = File.basename filename -- ext = File.extname name -- ext.sub!(/^\./, '') # delete the leading dot -- -- type = -- TypeFromExt[ext] || -- TypeFromExt[ext.downcase] || -- TypeFromName[name] || -- TypeFromName[name.downcase] -- type ||= shebang(filename) if read_shebang -- -- type -- end -- -- def shebang filename -- begin -- File.open filename, 'r' do |f| -- first_line = f.gets -- first_line[TypeFromShebang] -- end -- rescue IOError -- nil -- end -- end -- -- # This works like Hash#fetch. -- # -- # If the filetype cannot be found, the +default+ value -- # is returned. -- def fetch filename, default = nil, read_shebang = false -- if default and block_given? -- warn 'block supersedes default value argument' -- end -- -- unless type = self[filename, read_shebang] -- return yield if block_given? -- return default if default -- raise UnknownFileType, 'Could not determine type of %p.' % filename -- end -- type -- end -- -- end -- -- TypeFromExt = { -- 'rb' => :ruby, -- 'rbw' => :ruby, -- 'rake' => :ruby, -- 'cpp' => :c, -- 'c' => :c, -- 'h' => :c, -- 'xml' => :xml, -- 'htm' => :html, -- 'html' => :html, -- 'xhtml' => :xhtml, -- 'rhtml' => :rhtml, -- 'yaml' => :yaml, -- 'yml' => :yaml, -- } -- -- TypeFromShebang = /\b(?:ruby|perl|python|sh)\b/ -- -- TypeFromName = { -- 'Rakefile' => :ruby, -- 'Rantfile' => :ruby, -- } -- --end -- --if $0 == __FILE__ -- $VERBOSE = true -- eval DATA.read, nil, $0, __LINE__+4 --end -- --__END__ -- --require 'test/unit' -- --class TC_FileType < Test::Unit::TestCase -- -- def test_fetch -- assert_raise FileType::UnknownFileType do -- FileType.fetch '' -- end -- -- assert_throws :not_found do -- FileType.fetch '.' do -- throw :not_found -- end -- end -- -- assert_equal :default, FileType.fetch('c', :default) -- -- stderr, fake_stderr = $stderr, Object.new -- $err = '' -- def fake_stderr.write x -- $err << x -- end -- $stderr = fake_stderr -- FileType.fetch('c', :default) { } -- assert_equal "block supersedes default value argument\n", $err -- $stderr = stderr -- end -- -- def test_ruby -- assert_equal :ruby, FileType['test.rb'] -- assert_equal :ruby, FileType['C:\\Program Files\\x\\y\\c\\test.rbw'] -- assert_equal :ruby, FileType['/usr/bin/something/Rakefile'] -- assert_equal :ruby, FileType['~/myapp/gem/Rantfile'] -- assert_equal :ruby, FileType['./lib/tasks\repository.rake'] -- assert_not_equal :ruby, FileType['test_rb'] -- assert_not_equal :ruby, FileType['Makefile'] -- assert_not_equal :ruby, FileType['set.rb/set'] -- assert_not_equal :ruby, FileType['~/projects/blabla/rb'] -- end -- -- def test_c -- assert_equal :c, FileType['test.c'] -- assert_equal :c, FileType['C:\\Program Files\\x\\y\\c\\test.h'] -- assert_not_equal :c, FileType['test_c'] -- assert_not_equal :c, FileType['Makefile'] -- assert_not_equal :c, FileType['set.h/set'] -- assert_not_equal :c, FileType['~/projects/blabla/c'] -- end -- -- def test_html -- assert_equal :html, FileType['test.htm'] -- assert_equal :xhtml, FileType['test.xhtml'] -- assert_equal :xhtml, FileType['test.html.xhtml'] -- assert_equal :rhtml, FileType['_form.rhtml'] -- end -- -- def test_yaml -- assert_equal :yaml, FileType['test.yml'] -- assert_equal :yaml, FileType['test.yaml'] -- assert_equal :yaml, FileType['my.html.yaml'] -- assert_not_equal :yaml, FileType['YAML'] -- end -- -- def test_shebang -- dir = './test' -- if File.directory? dir -- Dir.chdir dir do -- assert_equal :c, FileType['test.c'] -- end -- end -- end -- --end -Index: lib/coderay/helpers/plugin.rb -=================================================================== ---- lib/coderay/helpers/plugin.rb (revision 200) -+++ lib/coderay/helpers/plugin.rb (revision 250) -@@ -1,3 +1,5 @@ -+module CodeRay -+ - # = PluginHost - # - # $Id$ -@@ -20,7 +22,7 @@ - # - # Generators[:fancy] #-> FancyGenerator - # # or --# require_plugin 'Generators/fancy' -+# CodeRay.require_plugin 'Generators/fancy' - module PluginHost - - # Raised if Encoders::[] fails because: -@@ -310,17 +312,18 @@ - - end - -- - # Convenience method for plugin loading. - # The syntax used is: - # --# require_plugin '/' -+# CodeRay.require_plugin '/' - # - # Returns the loaded plugin. --def require_plugin path -+def self.require_plugin path - host_id, plugin_id = path.split '/', 2 - host = PluginHost.host_by_id(host_id) - raise PluginHost::HostNotFound, - "No host for #{host_id.inspect} found." unless host - host.load plugin_id - end -+ -+end -\ No newline at end of file -Index: lib/coderay/helpers/file_type.rb -=================================================================== ---- lib/coderay/helpers/file_type.rb (revision 0) -+++ lib/coderay/helpers/file_type.rb (revision 250) -@@ -0,0 +1,210 @@ -+#!/usr/bin/env ruby -+module CodeRay -+ -+# = FileType -+# -+# A simple filetype recognizer. -+# -+# Copyright (c) 2006 by murphy (Kornelius Kalnbach) -+# -+# License:: LGPL / ask the author -+# Version:: 0.1 (2005-09-01) -+# -+# == Documentation -+# -+# # determine the type of the given -+# lang = FileType[ARGV.first] -+# -+# # return :plaintext if the file type is unknown -+# lang = FileType.fetch ARGV.first, :plaintext -+# -+# # try the shebang line, too -+# lang = FileType.fetch ARGV.first, :plaintext, true -+module FileType -+ -+ UnknownFileType = Class.new Exception -+ -+ class << self -+ -+ # Try to determine the file type of the file. -+ # -+ # +filename+ is a relative or absolute path to a file. -+ # -+ # The file itself is only accessed when +read_shebang+ is set to true. -+ # That means you can get filetypes from files that don't exist. -+ def [] filename, read_shebang = false -+ name = File.basename filename -+ ext = File.extname(name).sub(/^\./, '') # from last dot, delete the leading dot -+ ext2 = filename[/\.(.*)/, 1] # from first dot -+ -+ type = -+ TypeFromExt[ext.downcase] || -+ (TypeFromExt[ext2.downcase] if ext2) || -+ TypeFromName[name] || -+ TypeFromName[name.downcase] -+ type ||= shebang(filename) if read_shebang -+ -+ type -+ end -+ -+ def shebang filename -+ begin -+ File.open filename, 'r' do |f| -+ if first_line = f.gets -+ if type = first_line[TypeFromShebang] -+ type.to_sym -+ end -+ end -+ end -+ rescue IOError -+ nil -+ end -+ end -+ -+ # This works like Hash#fetch. -+ # -+ # If the filetype cannot be found, the +default+ value -+ # is returned. -+ def fetch filename, default = nil, read_shebang = false -+ if default and block_given? -+ warn 'block supersedes default value argument' -+ end -+ -+ unless type = self[filename, read_shebang] -+ return yield if block_given? -+ return default if default -+ raise UnknownFileType, 'Could not determine type of %p.' % filename -+ end -+ type -+ end -+ -+ end -+ -+ TypeFromExt = { -+ 'rb' => :ruby, -+ 'rbw' => :ruby, -+ 'rake' => :ruby, -+ 'mab' => :ruby, -+ 'cpp' => :c, -+ 'c' => :c, -+ 'h' => :c, -+ 'xml' => :xml, -+ 'htm' => :html, -+ 'html' => :html, -+ 'xhtml' => :xhtml, -+ 'raydebug' => :debug, -+ 'rhtml' => :rhtml, -+ 'html.erb' => :rhtml, -+ 'ss' => :scheme, -+ 'sch' => :scheme, -+ 'yaml' => :yaml, -+ 'yml' => :yaml, -+ } -+ -+ TypeFromShebang = /\b(?:ruby|perl|python|sh)\b/ -+ -+ TypeFromName = { -+ 'Rakefile' => :ruby, -+ 'Rantfile' => :ruby, -+ } -+ -+end -+ -+end -+ -+if $0 == __FILE__ -+ $VERBOSE = true -+ eval DATA.read, nil, $0, __LINE__+4 -+end -+ -+__END__ -+require 'test/unit' -+ -+class TC_FileType < Test::Unit::TestCase -+ -+ include CodeRay -+ -+ def test_fetch -+ assert_raise FileType::UnknownFileType do -+ FileType.fetch '' -+ end -+ -+ assert_throws :not_found do -+ FileType.fetch '.' do -+ throw :not_found -+ end -+ end -+ -+ assert_equal :default, FileType.fetch('c', :default) -+ -+ stderr, fake_stderr = $stderr, Object.new -+ $err = '' -+ def fake_stderr.write x -+ $err << x -+ end -+ $stderr = fake_stderr -+ FileType.fetch('c', :default) { } -+ assert_equal "block supersedes default value argument\n", $err -+ $stderr = stderr -+ end -+ -+ def test_ruby -+ assert_equal :ruby, FileType['test.rb'] -+ assert_equal :ruby, FileType['C:\\Program Files\\x\\y\\c\\test.rbw'] -+ assert_equal :ruby, FileType['/usr/bin/something/Rakefile'] -+ assert_equal :ruby, FileType['~/myapp/gem/Rantfile'] -+ assert_equal :ruby, FileType['./lib/tasks\repository.rake'] -+ assert_not_equal :ruby, FileType['test_rb'] -+ assert_not_equal :ruby, FileType['Makefile'] -+ assert_not_equal :ruby, FileType['set.rb/set'] -+ assert_not_equal :ruby, FileType['~/projects/blabla/rb'] -+ end -+ -+ def test_c -+ assert_equal :c, FileType['test.c'] -+ assert_equal :c, FileType['C:\\Program Files\\x\\y\\c\\test.h'] -+ assert_not_equal :c, FileType['test_c'] -+ assert_not_equal :c, FileType['Makefile'] -+ assert_not_equal :c, FileType['set.h/set'] -+ assert_not_equal :c, FileType['~/projects/blabla/c'] -+ end -+ -+ def test_html -+ assert_equal :html, FileType['test.htm'] -+ assert_equal :xhtml, FileType['test.xhtml'] -+ assert_equal :xhtml, FileType['test.html.xhtml'] -+ assert_equal :rhtml, FileType['_form.rhtml'] -+ assert_equal :rhtml, FileType['_form.html.erb'] -+ end -+ -+ def test_yaml -+ assert_equal :yaml, FileType['test.yml'] -+ assert_equal :yaml, FileType['test.yaml'] -+ assert_equal :yaml, FileType['my.html.yaml'] -+ assert_not_equal :yaml, FileType['YAML'] -+ end -+ -+ def test_no_shebang -+ dir = './test' -+ if File.directory? dir -+ Dir.chdir dir do -+ assert_equal :c, FileType['test.c'] -+ end -+ end -+ end -+ -+ def test_shebang_empty_file -+ require 'tmpdir' -+ tmpfile = File.join(Dir.tmpdir, 'bla') -+ File.open(tmpfile, 'w') { } # touch -+ assert_equal nil, FileType[tmpfile] -+ end -+ -+ def test_shebang -+ require 'tmpdir' -+ tmpfile = File.join(Dir.tmpdir, 'bla') -+ File.open(tmpfile, 'w') { |f| f.puts '#!/usr/bin/env ruby' } -+ assert_equal :ruby, FileType[tmpfile, true] -+ end -+ -+end - -Property changes on: lib/coderay/helpers/file_type.rb -___________________________________________________________________ -Added: svn:keywords - + Id Rev - -Index: lib/coderay/helpers/gzip_simple.rb -=================================================================== ---- lib/coderay/helpers/gzip_simple.rb (revision 200) -+++ lib/coderay/helpers/gzip_simple.rb (revision 250) -@@ -46,6 +46,7 @@ - end - end - -+ - # String extensions to use the GZip module. - # - # The methods gzip and gunzip provide an even more simple -Index: lib/coderay/helpers/word_list.rb -=================================================================== ---- lib/coderay/helpers/word_list.rb (revision 200) -+++ lib/coderay/helpers/word_list.rb (revision 250) -@@ -1,15 +1,19 @@ -+module CodeRay -+ - # = WordList -+# -+# A Hash subclass designed for mapping word lists to token types. -+# -+# Copyright (c) 2006 by murphy (Kornelius Kalnbach) - # --# Copyright (c) 2006 by murphy (Kornelius Kalnbach) --# - # License:: LGPL / ask the author --# Version:: 1.0 (2006-Feb-3) -+# Version:: 1.1 (2006-Oct-19) - # - # A WordList is a Hash with some additional features. - # It is intended to be used for keyword recognition. - # - # WordList is highly optimized to be used in Scanners, --# typically to decide whether a given ident is a keyword. -+# typically to decide whether a given ident is a special token. - # - # For case insensitive words use CaseIgnoringWordList. - # -@@ -47,25 +51,30 @@ - # ... - class WordList < Hash - -- # Create a WordList for the given +words+. -- # -- # This WordList responds to [] with +true+, if the word is -- # in +words+, and with +false+ otherwise. -- def self.for words -- new.add words -- end -- - # Creates a new WordList with +default+ as default value. -- def initialize default = false, &block -- super default, &block -+ # -+ # You can activate +caching+ to store the results for every [] request. -+ # -+ # With caching, methods like +include?+ or +delete+ may no longer behave -+ # as you expect. Therefore, it is recommended to use the [] method only. -+ def initialize default = false, caching = false, &block -+ if block -+ raise ArgumentError, 'Can\'t combine block with caching.' if caching -+ super(&block) -+ else -+ if caching -+ super() do |h, k| -+ h[k] = h.fetch k, default -+ end -+ else -+ super default -+ end -+ end - end - -- # Checks if a word is included. -- def include? word -- has_key? word -- end -- - # Add words to the list and associate them with +kind+. -+ # -+ # Returns +self+, so you can concat add calls. - def add words, kind = true - words.each do |word| - self[word] = kind -@@ -78,24 +87,30 @@ - - # A CaseIgnoringWordList is like a WordList, only that - # keys are compared case-insensitively. -+# -+# Ignoring the text case is realized by sending the +downcase+ message to -+# all keys. -+# -+# Caching usually makes a CaseIgnoringWordList faster, but it has to be -+# activated explicitely. - class CaseIgnoringWordList < WordList - -- # Creates a new WordList with +default+ as default value. -- # -- # Text case is ignored. -- def initialize default = false, &block -- block ||= proc do |h, k| -- h[k] = h.fetch k.downcase, default -+ # Creates a new case-insensitive WordList with +default+ as default value. -+ # -+ # You can activate caching to store the results for every [] request. -+ def initialize default = false, caching = false -+ if caching -+ super(default, false) do |h, k| -+ h[k] = h.fetch k.downcase, default -+ end -+ else -+ def self.[] key # :nodoc: -+ super(key.downcase) -+ end - end -- super default - end - -- # Checks if a word is included. -- def include? word -- has_key? word.downcase -- end -- -- # Add words to the list and associate them with +kind+. -+ # Add +words+ to the list and associate them with +kind+. - def add words, kind = true - words.each do |word| - self[word.downcase] = kind -@@ -104,3 +119,5 @@ - end - - end -+ -+end -\ No newline at end of file -Index: lib/coderay/styles/cycnus.rb -=================================================================== ---- lib/coderay/styles/cycnus.rb (revision 200) -+++ lib/coderay/styles/cycnus.rb (revision 250) -@@ -42,12 +42,14 @@ - MAIN - - TOKEN_COLORS = <<-'TOKENS' -+.debug { color:white ! important; background:blue ! important; } -+ - .af { color:#00C } - .an { color:#007 } - .av { color:#700 } - .aw { color:#C00 } - .bi { color:#509; font-weight:bold } --.c { color:#888 } -+.c { color:#666; } - - .ch { color:#04D } - .ch .k { color:#04D } -@@ -83,7 +85,7 @@ - .la { color:#970; font-weight:bold } - .lv { color:#963 } - .oc { color:#40E; font-weight:bold } --.on { color:#000; font-weight:bold } -+.of { color:#000; font-weight:bold } - .op { } - .pc { color:#038; font-weight:bold } - .pd { color:#369; font-weight:bold } -Index: lib/coderay/styles/murphy.rb -=================================================================== ---- lib/coderay/styles/murphy.rb (revision 200) -+++ lib/coderay/styles/murphy.rb (revision 250) -@@ -47,7 +47,7 @@ - .av { color:#700; } - .aw { color:#C00; } - .bi { color:#509; font-weight:bold; } --.c { color:#666; } -+.c { color:#555; background-color: black; } - - .ch { color:#88F; } - .ch .k { color:#04D; } -@@ -77,7 +77,7 @@ - .la { color:#970; font-weight:bold; } - .lv { color:#963; } - .oc { color:#40E; font-weight:bold; } --.on { color:#000; font-weight:bold; } -+.of { color:#000; font-weight:bold; } - .op { } - .pc { color:#08f; font-weight:bold; } - .pd { color:#369; font-weight:bold; } -Index: lib/coderay/tokens.rb -=================================================================== ---- lib/coderay/tokens.rb (revision 200) -+++ lib/coderay/tokens.rb (revision 250) -@@ -115,7 +115,7 @@ - # tokens.each_text_token { |text, kind| text.replace html_escape(text) } - def each_text_token - each do |text, kind| -- next unless text.respond_to? :to_str -+ next unless text.is_a? ::String - yield text, kind - end - end -@@ -252,7 +252,7 @@ - # - # You can configure the level of compression, - # but the default value 7 should be what you want -- # in most cases as it is a good comprimise between -+ # in most cases as it is a good compromise between - # speed and compression rate. - # - # See GZip module. -@@ -267,9 +267,20 @@ - # Should be equal to the input size before - # scanning. - def text_size -- map { |t, k| t }.join.size -+ size = 0 -+ each_text_token do |t, k| -+ size + t.size -+ end -+ size - end - -+ # The total size of the tokens. -+ # Should be equal to the input size before -+ # scanning. -+ def text -+ map { |t, k| t if t.is_a? ::String }.join -+ end -+ - # Include this module to give an object an #undump - # method. - # -@@ -342,7 +353,7 @@ - # - # Returns self. - def << token -- @callback.call token -+ @callback.call(*token) - @size += 1 - self - end -@@ -365,4 +376,8 @@ - - end - -+ -+ # Token name abbreviations -+ require 'coderay/token_classes' -+ - end -Index: lib/coderay/duo.rb -=================================================================== ---- lib/coderay/duo.rb (revision 200) -+++ lib/coderay/duo.rb (revision 250) -@@ -4,26 +4,84 @@ - # - # $Id: scanner.rb 123 2006-03-21 14:46:34Z murphy $ - # -- # TODO: Doc. -+ # A Duo is a convenient way to use CodeRay. You just create a Duo, -+ # giving it a lang (language of the input code) and a format (desired -+ # output format), and call Duo#highlight with the code. -+ # -+ # Duo makes it easy to re-use both scanner and encoder for a repetitive -+ # task. It also provides a very easy interface syntax: -+ # -+ # require 'coderay' -+ # CodeRay::Duo[:python, :div].highlight 'import this' -+ # -+ # Until you want to do uncommon things with CodeRay, I recommend to use -+ # this method, since it takes care of everything. - class Duo - -- attr_accessor :scanner, :encoder -- -- def initialize lang, format, options = {} -- @scanner = CodeRay.scanner lang, CodeRay.get_scanner_options(options) -- @encoder = CodeRay.encoder format, options -+ attr_accessor :lang, :format, :options -+ -+ # Create a new Duo, holding a lang and a format to highlight code. -+ # -+ # simple: -+ # CodeRay::Duo[:ruby, :page].highlight 'bla 42' -+ # -+ # streaming: -+ # CodeRay::Duo[:ruby, :page].highlight 'bar 23', :stream => true -+ # -+ # with options: -+ # CodeRay::Duo[:ruby, :html, :hint => :debug].highlight '????::??' -+ # -+ # alternative syntax without options: -+ # CodeRay::Duo[:ruby => :statistic].encode 'class << self; end' -+ # -+ # alternative syntax with options: -+ # CodeRay::Duo[{ :ruby => :statistic }, :do => :something].encode 'abc' -+ # -+ # The options are forwarded to scanner and encoder -+ # (see CodeRay.get_scanner_options). -+ def initialize lang = nil, format = nil, options = {} -+ if format == nil and lang.is_a? Hash and lang.size == 1 -+ @lang = lang.keys.first -+ @format = lang[@lang] -+ else -+ @lang = lang -+ @format = format -+ end -+ @options = options - end - - class << self -+ # To allow calls like Duo[:ruby, :html].highlight. - alias [] new - end - -- def encode code -- @scanner.string = code -- @encoder.encode_tokens(scanner.tokenize) -+ # The scanner of the duo. Only created once. -+ def scanner -+ @scanner ||= CodeRay.scanner @lang, CodeRay.get_scanner_options(@options) - end -+ -+ # The encoder of the duo. Only created once. -+ def encoder -+ @encoder ||= CodeRay.encoder @format, @options -+ end -+ -+ # Tokenize and highlight the code using +scanner+ and +encoder+. -+ # -+ # If the :stream option is set, the Duo will go into streaming mode, -+ # saving memory for the cost of time. -+ def encode code, options = { :stream => false } -+ stream = options.delete :stream -+ options = @options.merge options -+ if stream -+ encoder.encode_stream(code, @lang, options) -+ else -+ scanner.code = code -+ encoder.encode_tokens(scanner.tokenize, options) -+ end -+ end - alias highlight encode - - end - - end -+ -Index: lib/coderay/scanner.rb -=================================================================== ---- lib/coderay/scanner.rb (revision 200) -+++ lib/coderay/scanner.rb (revision 250) -@@ -66,8 +66,18 @@ - end - - def normify code -- code = code.to_s.to_unix -+ code = code.to_s -+ code.force_encoding 'binary' if code.respond_to? :force_encoding -+ code.to_unix - end -+ -+ def file_extension extension = nil -+ if extension -+ @file_extension = extension.to_s -+ else -+ @file_extension ||= plugin_id.to_s -+ end -+ end - - end - -@@ -117,9 +127,6 @@ - setup - end - -- # More mnemonic accessor name for the input string. -- alias code string -- - def reset - super - reset_instance -@@ -131,6 +138,10 @@ - reset_instance - end - -+ # More mnemonic accessor name for the input string. -+ alias code string -+ alias code= string= -+ - # Scans the code and returns all tokens in a Tokens object. - def tokenize new_string=nil, options = {} - options = @options.merge(options) -@@ -148,6 +159,11 @@ - def tokens - @cached_tokens ||= tokenize - end -+ -+ # Whether the scanner is in streaming mode. -+ def streaming? -+ !!@options[:stream] -+ end - - # Traverses the tokens. - def each &block -@@ -195,7 +211,7 @@ - raise ScanError, <<-EOE % [ - - --***ERROR in %s: %s -+***ERROR in %s: %s (after %d tokens) - - tokens: - %s -@@ -211,13 +227,14 @@ - ***ERROR*** - - EOE -- File.basename(caller[0]), -- msg, -- tokens.last(10).map { |t| t.inspect }.join("\n"), -- line, pos, -- matched, state, bol?, eos?, -- string[pos-ambit,ambit], -- string[pos,ambit], -+ File.basename(caller[0]), -+ msg, -+ tokens.size, -+ tokens.last(10).map { |t| t.inspect }.join("\n"), -+ line, pos, -+ matched, state, bol?, eos?, -+ string[pos-ambit,ambit], -+ string[pos,ambit], - ] - end - -Index: lib/coderay/for_redcloth.rb -=================================================================== ---- lib/coderay/for_redcloth.rb (revision 0) -+++ lib/coderay/for_redcloth.rb (revision 250) -@@ -0,0 +1,72 @@ -+module CodeRay # :nodoc: -+ -+ # A little hack to enable CodeRay highlighting in RedCloth. -+ # -+ # Usage: -+ # require 'coderay' -+ # require 'coderay/for_redcloth' -+ # RedCloth.new('@[ruby]puts "Hello, World!"@').to_html -+ # -+ # Make sure you have RedCloth 4.0.3 activated, for example by calling -+ # require 'rubygems' -+ # before RedCloth is loaded and before calling CodeRay.for_redcloth. -+ module ForRedCloth -+ -+ def self.install -+ gem 'RedCloth', '>= 4.0.3' rescue nil -+ require 'redcloth' -+ raise 'CodeRay.for_redcloth needs RedCloth 4.0.3 or later.' unless RedCloth::VERSION.to_s >= '4.0.3' -+ RedCloth::TextileDoc.send :include, ForRedCloth::TextileDoc -+ RedCloth::Formatters::HTML.module_eval do -+ def unescape(html) -+ replacements = { -+ '&' => '&', -+ '"' => '"', -+ '>' => '>', -+ '<' => '<', -+ } -+ html.gsub(/&(?:amp|quot|[gl]t);/) { |entity| replacements[entity] } -+ end -+ undef_method :code, :bc_open, :bc_close, :escape_pre -+ def code(opts) # :nodoc: -+ opts[:block] = true -+ if opts[:lang] && !filter_coderay -+ require 'coderay' -+ @in_bc ||= nil -+ format = @in_bc ? :div : :span -+ highlighted_code = CodeRay.encode opts[:text], opts[:lang], format, :stream => true -+ highlighted_code.sub!(/\A<(span|div)/) { |m| m + pba(@in_bc || opts) } -+ highlighted_code = unescape(highlighted_code) unless @in_bc -+ highlighted_code -+ else -+ "#{opts[:text]}" -+ end -+ end -+ def bc_open(opts) # :nodoc: -+ opts[:block] = true -+ @in_bc = opts -+ opts[:lang] ? '' : "" -+ end -+ def bc_close(opts) # :nodoc: -+ @in_bc = nil -+ opts[:lang] ? '' : "\n" -+ end -+ def escape_pre(text) -+ if @in_bc ||= nil -+ text -+ else -+ html_esc(text, :html_escape_preformatted) -+ end -+ end -+ end -+ end -+ -+ module TextileDoc # :nodoc: -+ attr_accessor :filter_coderay -+ end -+ -+ end -+ -+end -+ -+CodeRay::ForRedCloth.install -\ No newline at end of file -Index: lib/coderay/scanners/ruby/patterns.rb -=================================================================== ---- lib/coderay/scanners/ruby/patterns.rb (revision 200) -+++ lib/coderay/scanners/ruby/patterns.rb (revision 250) -@@ -14,19 +14,14 @@ - - DEF_KEYWORDS = %w[ def ] - UNDEF_KEYWORDS = %w[ undef ] -+ ALIAS_KEYWORDS = %w[ alias ] - MODULE_KEYWORDS = %w[class module] - DEF_NEW_STATE = WordList.new(:initial). - add(DEF_KEYWORDS, :def_expected). - add(UNDEF_KEYWORDS, :undef_expected). -+ add(ALIAS_KEYWORDS, :alias_expected). - add(MODULE_KEYWORDS, :module_expected) - -- IDENTS_ALLOWING_REGEXP = %w[ -- and or not while until unless if then elsif when sub sub! gsub gsub! -- scan slice slice! split -- ] -- REGEXP_ALLOWED = WordList.new(false). -- add(IDENTS_ALLOWING_REGEXP, :set) -- - PREDEFINED_CONSTANTS = %w[ - nil true false self - DATA ARGV ARGF __FILE__ __LINE__ -@@ -41,19 +36,20 @@ - METHOD_NAME = / #{IDENT} [?!]? /ox - METHOD_NAME_OPERATOR = / - \*\*? # multiplication and power -- | [-+]@? # plus, minus -- | [\/%&|^`~] # division, modulo or format strings, &and, |or, ^xor, `system`, tilde -+ | [-+~]@? # plus, minus, tilde with and without @ -+ | [\/%&|^`] # division, modulo or format strings, &and, |or, ^xor, `system` - | \[\]=? # array getter and setter - | << | >> # append or shift left, shift right - | <=?>? | >=? # comparison, rocket operator -- | ===? # simple equality and case equality -+ | ===? | =~ # simple equality, case equality, match -+ | ![~=@]? # negation with and without @, not-equal and not-match - /ox - METHOD_NAME_EX = / #{IDENT} (?:[?!]|=(?!>))? | #{METHOD_NAME_OPERATOR} /ox - INSTANCE_VARIABLE = / @ #{IDENT} /ox - CLASS_VARIABLE = / @@ #{IDENT} /ox - OBJECT_VARIABLE = / @@? #{IDENT} /ox - GLOBAL_VARIABLE = / \$ (?: #{IDENT} | [1-9]\d* | 0\w* | [~&+`'=\/,;_.<>!@$?*":\\] | -[a-zA-Z_0-9] ) /ox -- PREFIX_VARIABLE = / #{GLOBAL_VARIABLE} |#{OBJECT_VARIABLE} /ox -+ PREFIX_VARIABLE = / #{GLOBAL_VARIABLE} | #{OBJECT_VARIABLE} /ox - VARIABLE = / @?@? #{IDENT} | #{GLOBAL_VARIABLE} /ox - - QUOTE_TO_TYPE = { -@@ -73,7 +69,7 @@ - EXPONENT = / [eE] [+-]? #{DECIMAL} /ox - FLOAT_SUFFIX = / #{EXPONENT} | \. #{DECIMAL} #{EXPONENT}? /ox - FLOAT_OR_INT = / #{DECIMAL} (?: #{FLOAT_SUFFIX} () )? /ox -- NUMERIC = / [-+]? (?: (?=0) (?: #{OCTAL} | #{HEXADECIMAL} | #{BINARY} ) | #{FLOAT_OR_INT} ) /ox -+ NUMERIC = / (?: (?=0) (?: #{OCTAL} | #{HEXADECIMAL} | #{BINARY} ) | #{FLOAT_OR_INT} ) /ox - - SYMBOL = / - : -@@ -83,6 +79,7 @@ - | ['"] - ) - /ox -+ METHOD_NAME_OR_SYMBOL = / #{METHOD_NAME_EX} | #{SYMBOL} /ox - - # TODO investigste \M, \c and \C escape sequences - # (?: M-\\C-|C-\\M-|M-\\c|c\\M-|c|C-|M-)? (?: \\ (?: [0-7]{3} | x[0-9A-Fa-f]{2} | . ) ) -@@ -111,7 +108,7 @@ - (?: - ( [A-Za-z_0-9]+ ) # $2 = delim - | -- ( ["'`] ) # $3 = quote, type -+ ( ["'`\/] ) # $3 = quote, type - ( [^\n]*? ) \3 # $4 = delim - ) - /mx -@@ -129,15 +126,14 @@ - /mx - - # Checks for a valid value to follow. This enables -- # fancy_allowed in method calls. -+ # value_expected in method calls without parentheses. - VALUE_FOLLOWS = / -- \s+ -+ (?>[ \t\f\v]+) - (?: - [%\/][^\s=] -- | -- <<-?\S -- | -- #{CHARACTER} -+ | <<-?\S -+ | [-+] \d -+ | #{CHARACTER} - ) - /x - -Index: lib/coderay/scanners/ruby.rb -=================================================================== ---- lib/coderay/scanners/ruby.rb (revision 200) -+++ lib/coderay/scanners/ruby.rb (revision 250) -@@ -18,6 +18,7 @@ - include Streamable - - register_for :ruby -+ file_extension 'rb' - - helper :patterns - -@@ -90,15 +91,15 @@ - end - - when '#' -- case peek(1)[0] -- when ?{ -+ case peek(1) -+ when '{' - inline_block_stack << [state, depth, heredocs] - value_expected = true - state = :initial - depth = 1 - tokens << [:open, :inline] - tokens << [match + getch, :inline_delimiter] -- when ?$, ?@ -+ when '$', '@' - tokens << [match, :escape] - last_state = state # scan one token as normal code, then return here - state = :initial -@@ -121,36 +122,37 @@ - # }}} - else - # {{{ -- if match = scan(/ [ \t\f]+ | \\? \n | \# .* /x) or -- ( bol? and match = scan(/#{patterns::RUBYDOC_OR_DATA}/o) ) -- case m = match[0] -- when ?\s, ?\t, ?\f -- match << scan(/\s*/) unless eos? or heredocs -- kind = :space -- when ?\n, ?\\ -- kind = :space -- if m == ?\n -- value_expected = true # FIXME not quite true -- state = :initial if state == :undef_comma_expected -- end -- if heredocs -- unscan # heredoc scanning needs \n at start -- state = heredocs.shift -- tokens << [:open, state.type] -- heredocs = nil if heredocs.empty? -- next -- else -- match << scan(/\s*/) unless eos? -- end -- when ?#, ?=, ?_ -- kind = :comment -- value_expected = true -+ if match = scan(/[ \t\f]+/) -+ kind = :space -+ match << scan(/\s*/) unless eos? || heredocs -+ value_expected = true if match.index(?\n) # FIXME not quite true -+ tokens << [match, kind] -+ next -+ -+ elsif match = scan(/\\?\n/) -+ kind = :space -+ if match == "\n" -+ value_expected = true # FIXME not quite true -+ state = :initial if state == :undef_comma_expected -+ end -+ if heredocs -+ unscan # heredoc scanning needs \n at start -+ state = heredocs.shift -+ tokens << [:open, state.type] -+ heredocs = nil if heredocs.empty? -+ next - else -- raise_inspect 'else-case _ reached, because case %p was -- not handled' % [matched[0].chr], tokens -+ match << scan(/\s*/) unless eos? - end - tokens << [match, kind] - next -+ -+ elsif match = scan(/\#.*/) or -+ ( bol? and match = scan(/#{patterns::RUBYDOC_OR_DATA}/o) ) -+ kind = :comment -+ value_expected = true -+ tokens << [match, kind] -+ next - - elsif state == :initial - -@@ -167,19 +169,19 @@ - end - end - ## experimental! -- value_expected = :set if -- patterns::REGEXP_ALLOWED[match] or check(/#{patterns::VALUE_FOLLOWS}/o) -+ value_expected = :set if check(/#{patterns::VALUE_FOLLOWS}/o) - - elsif last_token_dot and match = scan(/#{patterns::METHOD_NAME_OPERATOR}/o) - kind = :ident - value_expected = :set if check(/#{patterns::VALUE_FOLLOWS}/o) - - # OPERATORS # -- elsif not last_token_dot and match = scan(/ ==?=? | \.\.?\.? | [\(\)\[\]\{\}] | :: | , /x) -+ # TODO: match (), [], {} as one single operator -+ elsif not last_token_dot and match = scan(/ \.\.\.? | (?:\.|::)() | [,\(\)\[\]\{\}] | ==?=? /x) - if match !~ / [.\)\]\}] /x or match =~ /\.\.\.?/ - value_expected = :set - end -- last_token_dot = :set if match == '.' or match == '::' -+ last_token_dot = :set if self[1] - kind = :operator - unless inline_block_stack.empty? - case match -@@ -210,8 +212,9 @@ - interpreted = true - state = patterns::StringState.new :regexp, interpreted, match - -- elsif match = scan(/#{patterns::NUMERIC}/o) -- kind = if self[1] then :float else :integer end -+ # elsif match = scan(/[-+]?#{patterns::NUMERIC}/o) -+ elsif match = value_expected ? scan(/[-+]?#{patterns::NUMERIC}/o) : scan(/#{patterns::NUMERIC}/o) -+ kind = self[1] ? :float : :integer - - elsif match = scan(/#{patterns::SYMBOL}/o) - case delim = match[1] -@@ -285,6 +288,18 @@ - next - end - -+ elsif state == :module_expected -+ if match = scan(/<\?~_\^]/i -+ #IDENTIFIER_SUBSEQUENT = /#{IDENTIFIER_INITIAL}|\d|\.|\+|-/ -+ #IDENTIFIER = /#{IDENTIFIER_INITIAL}#{IDENTIFIER_SUBSEQUENT}*|\+|-|\.{3}/ -+ IDENTIFIER = /[a-zA-Z!@$%&*\/:<=>?~_^][\w!@$%&*\/:<=>?~^.+\-]*|[+-]|\.\.\./ -+ DIGIT = /\d/ -+ DIGIT10 = DIGIT -+ DIGIT16 = /[0-9a-f]/i -+ DIGIT8 = /[0-7]/ -+ DIGIT2 = /[01]/ -+ RADIX16 = /\#x/i -+ RADIX8 = /\#o/i -+ RADIX2 = /\#b/i -+ RADIX10 = /\#d/i -+ EXACTNESS = /#i|#e/i -+ SIGN = /[\+-]?/ -+ EXP_MARK = /[esfdl]/i -+ EXP = /#{EXP_MARK}#{SIGN}#{DIGIT}+/ -+ SUFFIX = /#{EXP}?/ -+ PREFIX10 = /#{RADIX10}?#{EXACTNESS}?|#{EXACTNESS}?#{RADIX10}?/ -+ PREFIX16 = /#{RADIX16}#{EXACTNESS}?|#{EXACTNESS}?#{RADIX16}/ -+ PREFIX8 = /#{RADIX8}#{EXACTNESS}?|#{EXACTNESS}?#{RADIX8}/ -+ PREFIX2 = /#{RADIX2}#{EXACTNESS}?|#{EXACTNESS}?#{RADIX2}/ -+ UINT10 = /#{DIGIT10}+#*/ -+ UINT16 = /#{DIGIT16}+#*/ -+ UINT8 = /#{DIGIT8}+#*/ -+ UINT2 = /#{DIGIT2}+#*/ -+ DECIMAL = /#{DIGIT10}+#+\.#*#{SUFFIX}|#{DIGIT10}+\.#{DIGIT10}*#*#{SUFFIX}|\.#{DIGIT10}+#*#{SUFFIX}|#{UINT10}#{EXP}/ -+ UREAL10 = /#{UINT10}\/#{UINT10}|#{DECIMAL}|#{UINT10}/ -+ UREAL16 = /#{UINT16}\/#{UINT16}|#{UINT16}/ -+ UREAL8 = /#{UINT8}\/#{UINT8}|#{UINT8}/ -+ UREAL2 = /#{UINT2}\/#{UINT2}|#{UINT2}/ -+ REAL10 = /#{SIGN}#{UREAL10}/ -+ REAL16 = /#{SIGN}#{UREAL16}/ -+ REAL8 = /#{SIGN}#{UREAL8}/ -+ REAL2 = /#{SIGN}#{UREAL2}/ -+ IMAG10 = /i|#{UREAL10}i/ -+ IMAG16 = /i|#{UREAL16}i/ -+ IMAG8 = /i|#{UREAL8}i/ -+ IMAG2 = /i|#{UREAL2}i/ -+ COMPLEX10 = /#{REAL10}@#{REAL10}|#{REAL10}\+#{IMAG10}|#{REAL10}-#{IMAG10}|\+#{IMAG10}|-#{IMAG10}|#{REAL10}/ -+ COMPLEX16 = /#{REAL16}@#{REAL16}|#{REAL16}\+#{IMAG16}|#{REAL16}-#{IMAG16}|\+#{IMAG16}|-#{IMAG16}|#{REAL16}/ -+ COMPLEX8 = /#{REAL8}@#{REAL8}|#{REAL8}\+#{IMAG8}|#{REAL8}-#{IMAG8}|\+#{IMAG8}|-#{IMAG8}|#{REAL8}/ -+ COMPLEX2 = /#{REAL2}@#{REAL2}|#{REAL2}\+#{IMAG2}|#{REAL2}-#{IMAG2}|\+#{IMAG2}|-#{IMAG2}|#{REAL2}/ -+ NUM10 = /#{PREFIX10}?#{COMPLEX10}/ -+ NUM16 = /#{PREFIX16}#{COMPLEX16}/ -+ NUM8 = /#{PREFIX8}#{COMPLEX8}/ -+ NUM2 = /#{PREFIX2}#{COMPLEX2}/ -+ NUM = /#{NUM10}|#{NUM16}|#{NUM8}|#{NUM2}/ -+ -+ private -+ def scan_tokens tokens,options -+ -+ state = :initial -+ ident_kind = IDENT_KIND -+ -+ until eos? -+ kind = match = nil -+ -+ case state -+ when :initial -+ if scan(/ \s+ | \\\n /x) -+ kind = :space -+ elsif scan(/['\(\[\)\]]|#\(/) -+ kind = :operator_fat -+ elsif scan(/;.*/) -+ kind = :comment -+ elsif scan(/#\\(?:newline|space|.?)/) -+ kind = :char -+ elsif scan(/#[ft]/) -+ kind = :pre_constant -+ elsif scan(/#{IDENTIFIER}/o) -+ kind = ident_kind[matched] -+ elsif scan(/\./) -+ kind = :operator -+ elsif scan(/"/) -+ tokens << [:open, :string] -+ state = :string -+ tokens << ['"', :delimiter] -+ next -+ elsif scan(/#{NUM}/o) and not matched.empty? -+ kind = :integer -+ elsif getch -+ kind = :error -+ end -+ -+ when :string -+ if scan(/[^"\\]+/) or scan(/\\.?/) -+ kind = :content -+ elsif scan(/"/) -+ tokens << ['"', :delimiter] -+ tokens << [:close, :string] -+ state = :initial -+ next -+ else -+ raise_inspect "else case \" reached; %p not handled." % peek(1), -+ tokens, state -+ end -+ -+ else -+ raise "else case reached" -+ end -+ -+ match ||= matched -+ if $DEBUG and not kind -+ raise_inspect 'Error token %p in line %d' % -+ [[match, kind], line], tokens -+ end -+ raise_inspect 'Empty token', tokens, state unless match -+ -+ tokens << [match, kind] -+ -+ end # until eos -+ -+ if state == :string -+ tokens << [:close, :string] -+ end -+ -+ tokens -+ -+ end #scan_tokens -+ end #class -+ end #module scanners -+end #module coderay -\ No newline at end of file -Index: lib/coderay/scanners/delphi.rb -=================================================================== ---- lib/coderay/scanners/delphi.rb (revision 200) -+++ lib/coderay/scanners/delphi.rb (revision 250) -@@ -29,13 +29,18 @@ - 'virtual', 'write', 'writeonly' - ] - -- IDENT_KIND = CaseIgnoringWordList.new(:ident). -+ IDENT_KIND = CaseIgnoringWordList.new(:ident, caching=true). - add(RESERVED_WORDS, :reserved). - add(DIRECTIVES, :directive) -+ -+ NAME_FOLLOWS = CaseIgnoringWordList.new(false, caching=true). -+ add(%w(procedure function .)) - -+ private - def scan_tokens tokens, options - - state = :initial -+ last_token = '' - - until eos? - -@@ -45,19 +50,29 @@ - if state == :initial - - if scan(/ \s+ /x) -- kind = :space -+ tokens << [matched, :space] -+ next - - elsif scan(%r! \{ \$ [^}]* \}? | \(\* \$ (?: .*? \*\) | .* ) !mx) -- kind = :preprocessor -+ tokens << [matched, :preprocessor] -+ next - - elsif scan(%r! // [^\n]* | \{ [^}]* \}? | \(\* (?: .*? \*\) | .* ) !mx) -- kind = :comment -+ tokens << [matched, :comment] -+ next - -- elsif scan(/ [-+*\/=<>:;,.@\^|\(\)\[\]]+ /x) -+ elsif match = scan(/ <[>=]? | >=? | :=? | [-+=*\/;,@\^|\(\)\[\]] | \.\. /x) - kind = :operator -+ -+ elsif match = scan(/\./) -+ kind = :operator -+ if last_token == 'end' -+ tokens << [match, kind] -+ next -+ end - - elsif match = scan(/ [A-Za-z_][A-Za-z_0-9]* /x) -- kind = IDENT_KIND[match] -+ kind = NAME_FOLLOWS[last_token] ? :ident : IDENT_KIND[match] - - elsif match = scan(/ ' ( [^\n']|'' ) (?:'|$) /x) - tokens << [:open, :char] -@@ -101,6 +116,7 @@ - state = :initial - next - elsif scan(/\n/) -+ tokens << [:close, :string] - kind = :error - state = :initial - else -@@ -119,6 +135,7 @@ - end - raise_inspect 'Empty token', tokens unless match - -+ last_token = match - tokens << [match, kind] - - end -Index: lib/coderay/scanners/debug.rb -=================================================================== ---- lib/coderay/scanners/debug.rb (revision 0) -+++ lib/coderay/scanners/debug.rb (revision 250) -@@ -0,0 +1,60 @@ -+module CodeRay -+module Scanners -+ -+ # = Debug Scanner -+ class Debug < Scanner -+ -+ include Streamable -+ register_for :debug -+ -+ protected -+ def scan_tokens tokens, options -+ -+ opened_tokens = [] -+ -+ until eos? -+ -+ kind = nil -+ match = nil -+ -+ if scan(/\s+/) -+ tokens << [matched, :space] -+ next -+ -+ elsif scan(/ (\w+) \( ( [^\)\\]* ( \\. [^\)\\]* )* ) \) /x) -+ kind = self[1].to_sym -+ match = self[2].gsub(/\\(.)/, '\1') -+ -+ elsif scan(/ (\w+) < /x) -+ kind = self[1].to_sym -+ opened_tokens << kind -+ match = :open -+ -+ elsif scan(/ > /x) -+ kind = opened_tokens.pop -+ match = :close -+ -+ else -+ kind = :error -+ getch -+ -+ end -+ -+ match ||= matched -+ if $DEBUG and not kind -+ raise_inspect 'Error token %p in line %d' % -+ [[match, kind], line], tokens -+ end -+ raise_inspect 'Empty token', tokens unless match -+ -+ tokens << [match, kind] -+ -+ end -+ -+ tokens -+ end -+ -+ end -+ -+end -+end -Index: lib/coderay/scanners/rhtml.rb -=================================================================== ---- lib/coderay/scanners/rhtml.rb (revision 200) -+++ lib/coderay/scanners/rhtml.rb (revision 250) -@@ -51,10 +51,10 @@ - start_tag = match[/\A<%[-=]?/] - end_tag = match[/-?%?>?\z/] - tokens << [:open, :inline] -- tokens << [start_tag, :delimiter] -+ tokens << [start_tag, :inline_delimiter] - code = match[start_tag.size .. -1 - end_tag.size] - @ruby_scanner.tokenize code -- tokens << [end_tag, :delimiter] unless end_tag.empty? -+ tokens << [end_tag, :inline_delimiter] unless end_tag.empty? - tokens << [:close, :inline] - - else -Index: lib/coderay/scanners/nitro_xhtml.rb -=================================================================== ---- lib/coderay/scanners/nitro_xhtml.rb (revision 200) -+++ lib/coderay/scanners/nitro_xhtml.rb (revision 250) -@@ -95,20 +95,20 @@ - delimiter = CLOSING_PAREN[start_tag[1,1]] - end_tag = match[-1,1] == delimiter ? delimiter : '' - tokens << [:open, :inline] -- tokens << [start_tag, :delimiter] -+ tokens << [start_tag, :inline_delimiter] - code = match[start_tag.size .. -1 - end_tag.size] - @ruby_scanner.tokenize code -- tokens << [end_tag, :delimiter] unless end_tag.empty? -+ tokens << [end_tag, :inline_delimiter] unless end_tag.empty? - tokens << [:close, :inline] - - elsif match = scan(/#{NITRO_RUBY_BLOCK}/o) - start_tag = '' ? '?>' : '' - tokens << [:open, :inline] -- tokens << [start_tag, :delimiter] -+ tokens << [start_tag, :inline_delimiter] - code = match[start_tag.size .. -(end_tag.size)-1] - @ruby_scanner.tokenize code -- tokens << [end_tag, :delimiter] unless end_tag.empty? -+ tokens << [end_tag, :inline_delimiter] unless end_tag.empty? - tokens << [:close, :inline] - - elsif entity = scan(/#{NITRO_ENTITY}/o) -Index: lib/coderay/scanners/plaintext.rb -=================================================================== ---- lib/coderay/scanners/plaintext.rb (revision 200) -+++ lib/coderay/scanners/plaintext.rb (revision 250) -@@ -4,6 +4,8 @@ - class Plaintext < Scanner - - register_for :plaintext, :plain -+ -+ include Streamable - - def scan_tokens tokens, options - text = (scan_until(/\z/) || '') -Index: lib/coderay.rb -=================================================================== ---- lib/coderay.rb (revision 200) -+++ lib/coderay.rb (revision 250) -@@ -24,8 +24,8 @@ - # - # == Usage - # --# Remember you need RubyGems to use CodeRay. Run Ruby with -rubygems option --# if required. -+# Remember you need RubyGems to use CodeRay, unless you have it in your load path. Run Ruby with -+# -rubygems option if required. - # - # === Highlight Ruby code in a string as html - # -@@ -44,19 +44,15 @@ - # - # You can include this div in your page. The used CSS styles can be printed with - # --# % ruby -rcoderay -e "print CodeRay::Encoders[:html]::CSS" -+# % coderay_stylesheet - # - # === Highlight without typing too much --# -+# - # If you are one of the hasty (or lazy, or extremely curious) people, just run this file: --# --# % ruby -rubygems coderay.rb - # --# If the output was to fast for you, try -+# % ruby -rubygems /path/to/coderay/coderay.rb > example.html - # --# % ruby -rubygems coderay.rb > example.html --# --# and look at the file it created. -+# and look at the file it created in your browser. - # - # = CodeRay Module - # -@@ -111,7 +107,7 @@ - # - # CodeRay.scan_stream:: Scan in stream mode. - # --# == All-in-One Encoding -+# == All-in-One Encoding - # - # CodeRay.encode:: Highlight a string with a given input and output format. - # -@@ -121,11 +117,16 @@ - # for this Encoder must only be done once. - # - # CodeRay.encoder:: Create an Encoder instance with format and options. -+# CodeRay.scanner:: Create an Scanner instance for lang, with '' as default code. - # --# There is no CodeRay.scanner method because Scanners are bound to an input string --# on creation; you can't re-use them with another string. -+# To make use of CodeRay.scanner, use CodeRay::Scanner::code=. - # --# The scanning methods provide more flexibility; we recommend to use these. -+# The scanning methods provide more flexibility; we recommend to use these. -+# -+# == Reusing Scanners and Encoders -+# -+# If you want to re-use scanners and encoders (because that is faster), see -+# CodeRay::Duo for the most convenient (and recommended) interface. - module CodeRay - - # Version: Major.Minor.Teeny[.Revision] -@@ -133,7 +134,7 @@ - # Minor: odd for beta, even for stable - # Teeny: development state - # Revision: Subversion Revision number (generated on rake) -- VERSION = '0.7.4' -+ VERSION = '0.7.9' - - require 'coderay/tokens' - require 'coderay/scanner' -@@ -170,7 +171,7 @@ - def scan_file filename, lang = :auto, options = {}, &block - file = IO.read filename - if lang == :auto -- require 'coderay/helpers/filetype' -+ require 'coderay/helpers/file_type' - lang = FileType.fetch filename, :plaintext, true - end - scan file, lang, options = {}, &block -@@ -314,6 +315,7 @@ - # Run a test script. - if $0 == __FILE__ - $stderr.print 'Press key to print demo.'; gets -- code = File.read($0)[/module CodeRay.*/m] -+ # Just use this file as an example of Ruby code. -+ code = File.read(__FILE__)[/module CodeRay.*/m] - print CodeRay.scan(code, :ruby).html - end - -Property changes on: lib -___________________________________________________________________ -Added: svn:externals - + term http://term-ansicolor.rubyforge.org/svn/trunk/lib/term/ - - diff --git a/test/scanners/diff/const_missing.expected.raydebug b/test/scanners/diff/const_missing.expected.raydebug deleted file mode 100644 index 1fbae49..0000000 --- a/test/scanners/diff/const_missing.expected.raydebug +++ /dev/null @@ -1,75 +0,0 @@ -head[head(Index: )plain(error.c)] -head[head(===================================================================)filename()] -head[head(--- )filename(error.c)plain( (revision 26674\))] -head[head(+++ )filename(error.c)plain( (working copy\))] -change ident(VALUE) ident(rb_eSyntaxError)operator(;) - ident(VALUE) ident(rb_eLoadError)operator(;) - -insert[insert(+)ident(VALUE) ident(rb_eNoConstantError)operator(;)] -insert[insert(+)] - ident(VALUE) ident(rb_eSystemCallError)operator(;) - ident(VALUE) ident(rb_mErrno)operator(;) -change ident(Init_Exception)operator(()directive(void)operator(\)) - ident(rb_define_method)operator(()ident(rb_eNoMethodError)operator(,) stringoperator(,) ident(nometh_err_initialize)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_eNoMethodError)operator(,) stringoperator(,) ident(nometh_err_args)operator(,) integer(0)operator(\);) -insert[insert(+) ident(rb_eNoConstantError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eNameError)operator(\);)] - - ident(rb_eRuntimeError) operator(=) ident(rb_define_class)operator(()stringoperator(,) ident(rb_eStandardError)operator(\);) -head[head(Index: )plain(variable.c)] -head[head(===================================================================)filename()] -head[head(--- )filename(variable.c)plain( (revision 26674\))] -head[head(+++ )filename(variable.c)plain( (working copy\))] -change ident(uninitialized_constant)operator(()ident(VALUE) ident(klass)operator(,) ident(ID) ident(i) - - directive(static) ident(VALUE) -insert[insert(+)ident(const_missing_call)operator(()ident(VALUE) ident(arg)operator(\))] -insert[insert(+)operator({)] -insert[insert(+) ident(VALUE) operator(*)ident(args) operator(=) operator(()ident(VALUE) operator(*\))ident(arg)operator(;)] -insert[insert(+) ident(ID) ident(const_missing_id)operator(;)] -insert[insert(+) ident(CONST_ID)operator(()ident(const_missing_id)operator(,) stringoperator(\);)] -insert[insert(+) reserved(return) ident(rb_check_funcall)operator(()ident(args)operator([)integer(0)operator(],) ident(const_missing_id)operator(,) integer(1)operator(,) operator(&)ident(args)operator([)integer(1)operator(]\);)] -insert[insert(+)operator(})] -insert[insert(+)] -insert[insert(+)directive(static) ident(VALUE)] -insert[insert(+)ident(const_missing_rescue)operator(()ident(VALUE) ident(arg)operator(,) ident(VALUE) ident(errinfo)operator(\))] -insert[insert(+)operator({)] -insert[insert(+) reserved(return) ident(arg)operator(;)] -insert[insert(+)operator(})] -insert[insert(+)] -insert[insert(+)directive(extern) ident(VALUE) ident(rb_eNoConstantError)operator(;)] -insert[insert(+)] -insert[insert(+)directive(static) ident(VALUE)] - ident(const_missing)operator(()ident(VALUE) ident(klass)operator(,) ident(ID) ident(id)operator(\)) - operator({) -delete[delete(-) reserved(return) ident(rb_funcall)operator(()ident(klass)operator(,) ident(rb_intern)operator(()stringoperator(\),) integer(1)operator(,) ident(ID2SYM)operator(()ident(id)operator(\)\);)] -insert[insert(+) ident(VALUE) ident(args)operator([)integer(2)operator(];)] -insert[insert(+) ident(args)operator([)integer(0)operator(]) operator(=) ident(klass)operator(;)] -insert[insert(+) ident(args)operator([)integer(1)operator(]) operator(=) ident(ID2SYM)operator(()ident(id)operator(\);)] -insert[insert(+) reserved(return) ident(rb_rescue2)operator(()ident(const_missing_call)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(,)] -insert[insert(+) ident(const_missing_rescue)operator(,) operator(()ident(VALUE)operator(\))ident(Qundef)operator(,)] -insert[insert(+) ident(rb_eNoConstantError)operator(,) operator(()ident(VALUE)operator(\))integer(0)operator(\);)] - operator(}) - -change ident(rb_const_get_0)operator(()ident(VALUE) ident(klass)operator(,) ident(ID) ident(id)operator(,) pre_type(int) ident(e) - operator(}) - -delete[delete(-) ident(value) operator(=) ident(const_missing)operator(()ident(klass)operator(,) ident(id)operator(\);)] -insert[insert(+) reserved(if) operator((()ident(value) operator(=) ident(const_missing)operator(()ident(tmp)operator(,) ident(id)operator(\)\)) operator(==) ident(Qundef)operator(\)) operator({)] -insert[insert(+) ident(NODE) operator(*)ident(rb_vm_cref)operator(()directive(void)operator(\);)] -insert[insert(+) ident(NODE) operator(*)ident(cref) operator(=) ident(rb_vm_cref)operator((\);)] -insert[insert(+) reserved(while) operator(()ident(cref) operator(&&) ident(cref)operator(->)ident(nd_next) operator(&&)] -insert[insert(+) operator((()ident(cref)operator(->)ident(flags) operator(&) ident(NODE_FL_CREF_PUSHED_BY_EVAL)operator(\)) operator(||)] -insert[insert(+) ident(NIL_P)operator(()ident(tmp) operator(=) ident(cref)operator(->)ident(nd_clss)operator(\)) operator(||)] -insert[insert(+) operator(()ident(value) operator(=) ident(const_missing)operator(()ident(tmp)operator(,) ident(id)operator(\)\)) operator(==) ident(Qundef)operator(\)\)) operator({)] -insert[insert(+) ident(cref) operator(=) ident(cref)operator(->)ident(nd_next)operator(;)] -insert[insert(+) operator(})] -insert[insert(+) reserved(if) operator(()ident(value) operator(==) ident(Qundef)operator(\)) operator({)] -insert[insert(+) reserved(if) operator((!)ident(exclude) operator(&&) ident(BUILTIN_TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_MODULE) operator(&&)] -insert[insert(+) operator(()ident(value) operator(=) ident(const_missing)operator(()ident(rb_cObject)operator(,) ident(id)operator(\)\)) operator(==) ident(Qundef)operator(\)) operator({)] -insert[insert(+) ident(uninitialized_constant)operator(()ident(klass)operator(,) ident(id)operator(\);)] -insert[insert(+) operator(})] -insert[insert(+) operator(})] -insert[insert(+) operator(})] -insert[insert(+)] - ident(rb_vm_inc_const_missing_count)operator((\);) - reserved(return) ident(value)operator(;) diff --git a/test/scanners/diff/const_missing.in.diff b/test/scanners/diff/const_missing.in.diff deleted file mode 100644 index 5549794..0000000 --- a/test/scanners/diff/const_missing.in.diff +++ /dev/null @@ -1,75 +0,0 @@ -Index: error.c -=================================================================== ---- error.c (revision 26674) -+++ error.c (working copy) -@@ -402,4 +402,6 @@ VALUE rb_eSyntaxError; - VALUE rb_eLoadError; - -+VALUE rb_eNoConstantError; -+ - VALUE rb_eSystemCallError; - VALUE rb_mErrno; -@@ -1143,4 +1145,5 @@ Init_Exception(void) - rb_define_method(rb_eNoMethodError, "initialize", nometh_err_initialize, -1); - rb_define_method(rb_eNoMethodError, "args", nometh_err_args, 0); -+ rb_eNoConstantError = rb_define_class("NoConstantError", rb_eNameError); - - rb_eRuntimeError = rb_define_class("RuntimeError", rb_eStandardError); -Index: variable.c -=================================================================== ---- variable.c (revision 26674) -+++ variable.c (working copy) -@@ -1356,7 +1356,29 @@ uninitialized_constant(VALUE klass, ID i - - static VALUE -+const_missing_call(VALUE arg) -+{ -+ VALUE *args = (VALUE *)arg; -+ ID const_missing_id; -+ CONST_ID(const_missing_id, "const_missing"); -+ return rb_check_funcall(args[0], const_missing_id, 1, &args[1]); -+} -+ -+static VALUE -+const_missing_rescue(VALUE arg, VALUE errinfo) -+{ -+ return arg; -+} -+ -+extern VALUE rb_eNoConstantError; -+ -+static VALUE - const_missing(VALUE klass, ID id) - { -- return rb_funcall(klass, rb_intern("const_missing"), 1, ID2SYM(id)); -+ VALUE args[2]; -+ args[0] = klass; -+ args[1] = ID2SYM(id); -+ return rb_rescue2(const_missing_call, (VALUE)args, -+ const_missing_rescue, (VALUE)Qundef, -+ rb_eNoConstantError, (VALUE)0); - } - -@@ -1598,5 +1620,21 @@ rb_const_get_0(VALUE klass, ID id, int e - } - -- value = const_missing(klass, id); -+ if ((value = const_missing(tmp, id)) == Qundef) { -+ NODE *rb_vm_cref(void); -+ NODE *cref = rb_vm_cref(); -+ while (cref && cref->nd_next && -+ ((cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) || -+ NIL_P(tmp = cref->nd_clss) || -+ (value = const_missing(tmp, id)) == Qundef)) { -+ cref = cref->nd_next; -+ } -+ if (value == Qundef) { -+ if (!exclude && BUILTIN_TYPE(klass) == T_MODULE && -+ (value = const_missing(rb_cObject, id)) == Qundef) { -+ uninitialized_constant(klass, id); -+ } -+ } -+ } -+ - rb_vm_inc_const_missing_count(); - return value; diff --git a/test/scanners/diff/example.expected.raydebug b/test/scanners/diff/example.expected.raydebug deleted file mode 100644 index 01eae8c..0000000 --- a/test/scanners/diff/example.expected.raydebug +++ /dev/null @@ -1,27 +0,0 @@ -head[head(===================================================================)filename()] -head[head(--- )filename(/Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb)plain( (revision 1431\))] -head[head(+++ )filename(/Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb)plain( (revision 1437\))] -change[change(@@)plain( -1,6 +1,10 )change(@@)] -insert[insert(+)ident(require) string] - ident(require) string - - reserved(class) class(PastesController) operator(<) constant(ApplicationController) -insert[insert(+) ident(include) constant(LoginSystem)] -insert[insert(+)] -insert[insert(+) ident(before_filter) symbol(:attempt_cookie_login)] - - comment(# caches_action :recent) - -change[change(@@)plain( -10,11 +14,7 )change(@@)] - - reserved(def) method(show) - instance_variable(@paste) operator(=) constant(Paste)operator(.)ident(find)operator(()ident(params)operator([)symbol(:id)operator(])operator(\)) -delete[delete(-) reserved(if) ident(params)operator([)symbol(:key)operator(]) reserved(and) ident(params)operator([)symbol(:key)operator(])operator(==)constant(User)operator(.)ident(new)operator(()instance_variable(@paste)operator(.)ident(nick)operator(\))operator(.)ident(magic_mojo)] -delete[delete(-) ident(session)operator([)symbol(:login)operator(])operator(=)instance_variable(@paste)operator(.)ident(nick)] -delete[delete(-) reserved(return) ident(redirect_to)operator(()symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) instance_variable(@paste)operator(.)ident(id)operator(\))] -delete[delete(-) reserved(end)] -delete[delete(-) ] -insert[insert(+) ident(attempt_key_login) reserved(if) reserved(not) ident(logged_in?)] - reserved(unless) instance_variable(@paste)operator(.)ident(asset) reserved(or) reserved(not) instance_variable(@paste)operator(.)ident(body)operator(.)ident(blank?) - ident(render) symbol(:action) operator(=)operator(>) string - reserved(end) \ No newline at end of file diff --git a/test/scanners/diff/example.in.diff b/test/scanners/diff/example.in.diff deleted file mode 100644 index 319d51b..0000000 --- a/test/scanners/diff/example.in.diff +++ /dev/null @@ -1,27 +0,0 @@ -=================================================================== ---- /Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (revision 1431) -+++ /Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (revision 1437) -@@ -1,6 +1,10 @@ -+require 'login_system' - require 'coderay' - - class PastesController < ApplicationController -+ include LoginSystem -+ -+ before_filter :attempt_cookie_login - - # caches_action :recent - -@@ -10,11 +14,7 @@ - - def show - @paste = Paste.find(params[:id]) -- if params[:key] and params[:key]==User.new(@paste.nick).magic_mojo -- session[:login]=@paste.nick -- return redirect_to(:action => 'show', :id => @paste.id) -- end -- -+ attempt_key_login if not logged_in? - unless @paste.asset or not @paste.body.blank? - render :action => "edit" - end \ No newline at end of file diff --git a/test/scanners/diff/suite.rb b/test/scanners/diff/suite.rb deleted file mode 100644 index ce978d6..0000000 --- a/test/scanners/diff/suite.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Diff < CodeRay::TestCase -end diff --git a/test/scanners/groovy/pleac.expected.raydebug b/test/scanners/groovy/pleac.expected.raydebug deleted file mode 100644 index 80eb2e5..0000000 --- a/test/scanners/groovy/pleac.expected.raydebug +++ /dev/null @@ -1,10953 +0,0 @@ -comment(// -*- groovy -*-) -comment(// The examples make use of Groovy's built-in assert) -comment(// command so that the script is self-checking) - -comment(// @@PLEAC@@_NAME) -comment(// @@SKIP@@ Groovy) - -comment(// @@PLEAC@@_WEB) -comment(// @@SKIP@@ http://groovy.codehaus.org) - -comment(// @@PLEAC@@_1.0) -comment(//----------------------------------------------------------------------------------) -ident(string) operator(=) string comment(// two characters, \\ and an n) -keyword(assert) ident(string)operator(.)ident(size)operator(()operator(\)) operator(==) integer(2) -ident(string) operator(=) string comment(// a "newline" character) -ident(string) operator(=) string comment(// a "newline" character) - -ident(string) operator(=) string comment(// literal single quote inside double quotes) -ident(string) operator(=) string comment(// escaped single quotes) - -ident(string) operator(=) string comment(// literal double quotes inside single quotes) -ident(string) operator(=) string comment(// escaped double quotes) - -ident(string) operator(=) string -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.1) -comment(//----------------------------------------------------------------------------------) -comment(// accessing substrings) -ident(string) operator(=) string -ident(start) operator(=) integer(5)operator(;) ident(end) operator(=) integer(7)operator(;) ident(endplus1) operator(=) integer(8) -keyword(assert) ident(string)operator(.)ident(substring)operator(()ident(start)operator(,) ident(endplus1)operator(\)) operator(==) string -keyword(assert) ident(string)operator([)ident(start)operator(..)ident(end)operator(]) operator(==) string - -keyword(assert) ident(string)operator(.)ident(substring)operator(()ident(start)operator(\)) operator(==) string -keyword(assert) ident(string)operator([)ident(start)operator(..)operator(-)integer(1)operator(]) operator(==) string - -comment(// String is immutable but new strings can be created in various ways) -keyword(assert) ident(string) operator(-) string operator(-) string operator(+) string operator(==) string -keyword(assert) ident(string)operator(.)ident(replace)operator(()stringoperator(,)stringoperator(\)) operator(==) string -keyword(assert) ident(string)operator(.)ident(substring)operator(()integer(0)operator(,) integer(2)operator(\)) operator(+) string operator(+) ident(string)operator([)operator(-)integer(2)operator(..)operator(-)integer(1)operator(]) operator(==) string -comment(// StringBuffer is mutable) -ident(sb) operator(=) keyword(new) pre_type(StringBuffer)operator(()ident(string)operator(\)) -ident(sb)operator([)integer(2)operator(..)operator(-)integer(3)operator(]) operator(=) string -keyword(assert) ident(sb)operator(.)ident(toString)operator(()operator(\)) operator(==) string - -comment(// No exact pack/unpack equivalents exist in Groovy. Examples here use a custom) -comment(// implementation to split an original string into chunks of specified length) -comment(// the method is a modified version of the Java PLEAC version) - -comment(// get a 5-character string, skip 8, then grab 2 5-character strings) -comment(// skipping the trailing spaces, then grab the rest) -ident(data) operator(=) string -keyword(def) ident(fields) operator(=) ident(unpack)operator(()stringoperator(,) ident(data)operator(\)) -keyword(assert) ident(fields) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - -comment(// On a Java 5 or 6 JVM, Groovy can also make use of Scanners:) -ident(s) operator(=) keyword(new) pre_type(Scanner)operator(()ident(data)operator(\)) -ident(s)operator(.)ident(findInLine)operator(()regexpoperator(\)) -ident(m) operator(=) ident(s)operator(.)ident(match)operator(()operator(\)) -ident(fields) operator(=) type([]) -operator(()integer(1)operator(..)ident(m)operator(.)ident(groupCount)operator(()operator(\))operator(\))operator(.)ident(each)operator({) ident(fields) operator(<)operator(<) ident(m)operator(.)ident(group)operator(()local_variable(it)operator(\)) operator(}) -keyword(assert) ident(fields) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - -comment(// another scanner example similar to the javadoc example) -ident(input) operator(=) string -ident(s) operator(=) keyword(new) pre_type(Scanner)operator(()ident(input)operator(\))operator(.)ident(useDelimiter)operator(()regexpoperator(\)) -ident(fields) operator(=) type([]) -integer(2)operator(.)ident(times)operator({) ident(fields) operator(<)operator(<) ident(s)operator(.)ident(nextInt)operator(()operator(\)) operator(}) -integer(2)operator(.)ident(times)operator({) ident(fields) operator(<)operator(<) ident(s)operator(.)ident(next)operator(()operator(\)) operator(}) -keyword(assert) ident(fields) operator(==) operator([)integer(1)operator(,) integer(2)operator(,) stringoperator(,) stringoperator(]) - -comment(// split at five characters boundaries) -pre_type(String)type([]) ident(fivers) operator(=) ident(unpack)operator(()string operator(*) operator(()ident(data)operator(.)ident(length)operator(()operator(\)) operator(/) integer(5)operator(\))operator(,) ident(data)operator(\)) -keyword(assert) ident(fivers) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - -comment(// chop string into individual characters) -keyword(assert) string keyword(as) pre_type(String)type([]) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - -ident(string) operator(=) string -comment(// Indexing forwards (left to right\)) -comment(// tens 000000000011111111112) -comment(// units +012345678901234567890) -comment(// Indexing backwards (right to left\)) -comment(// tens 221111111111000000000) -comment(// units 109876543210987654321-) - -keyword(assert) ident(string)operator([)integer(0)operator(]) operator(==) string -keyword(assert) ident(string)operator([)integer(5)operator(..)integer(6)operator(]) operator(==) string -keyword(assert) ident(string)operator([)integer(13)operator(..)operator(-)integer(1)operator(]) operator(==) string -keyword(assert) ident(string)operator([)operator(-)integer(1)operator(]) operator(==) string -keyword(assert) ident(string)operator([)operator(-)integer(4)operator(..)operator(-)integer(1)operator(]) operator(==) string -keyword(assert) ident(string)operator([)operator(-)integer(8)operator(,) operator(-)integer(7)operator(,) operator(-)integer(6)operator(]) operator(==) string - -ident(data) operator(=) keyword(new) pre_type(StringBuffer)operator(()ident(string)operator(\)) -ident(data)operator([)integer(5)operator(..)integer(6)operator(]) operator(=) string operator(;) keyword(assert) ident(data)operator(.)ident(toString)operator(()operator(\)) operator(==) string -ident(data)operator([)operator(-)integer(12)operator(..)operator(-)integer(1)operator(]) operator(=) string operator(;) keyword(assert) ident(data)operator(.)ident(toString)operator(()operator(\)) operator(==) string -ident(data)operator([)integer(0)operator(..)integer(0)operator(]) operator(=) string operator(;) keyword(assert) ident(data)operator(.)ident(toString)operator(()operator(\)) operator(==) string -ident(data)operator([)operator(-)integer(10)operator(..)operator(-)integer(1)operator(]) operator(=) string operator(;) keyword(assert) ident(data)operator(.)ident(toString)operator(()operator(\)) operator(==) string - -ident(string) operator(=) string -comment(// check last ten characters match some pattern) -keyword(assert) ident(string)operator([)operator(-)integer(10)operator(..)operator(-)integer(1)operator(]) operator(=~) regexp - -ident(string) operator(=) string -keyword(assert) ident(string)operator([)integer(0)operator(..)integer(4)operator(])operator(.)ident(replaceAll)operator(()stringoperator(,) stringoperator(\)) operator(+) ident(string)operator([)integer(5)operator(..)operator(-)integer(1)operator(]) operator(==) string - -comment(// exchange the first and last letters in a string) -ident(string) operator(=) string -ident(string) operator(=) ident(string)operator([)operator(-)integer(1)operator(]) operator(+) ident(string)operator([)integer(1)operator(..)operator(-)integer(2)operator(]) operator(+) ident(string)operator([)integer(0)operator(]) -keyword(assert) ident(string) operator(==) string - -comment(// extract column with unpack) -ident(string) operator(=) string - -comment(// skip 6, grab 6) -keyword(assert) ident(unpack)operator(()stringoperator(,) ident(string)operator(\)) operator(==) operator([)stringoperator(]) - -comment(// forward 6, grab 2, backward 5, grab 2) -keyword(assert) ident(unpack)operator(()stringoperator(,) ident(string)operator(\)) operator(==) operator([)stringoperator(,) stringoperator(]) - -keyword(assert) ident(cut2fmt)operator(()operator([)integer(8)operator(,) integer(14)operator(,) integer(20)operator(,) integer(26)operator(,) integer(30)operator(])operator(\)) operator(==) string - -comment(// utility method (derived from Java PLEAC version\)) -keyword(def) method(unpack)operator(()pre_type(String) ident(format)operator(,) pre_type(String) ident(data)operator(\)) operator({) - keyword(def) ident(result) operator(=) type([]) - type(int) ident(formatOffset) operator(=) integer(0)operator(,) ident(dataOffset) operator(=) integer(0) - type(int) ident(minDataOffset) operator(=) integer(0)operator(,) ident(maxDataOffset) operator(=) ident(data)operator(.)ident(size)operator(()operator(\)) - - keyword(new) pre_type(StringTokenizer)operator(()ident(format)operator(\))operator(.)ident(each)operator({) ident(token) operator(->) - type(int) ident(tokenLen) operator(=) ident(token)operator(.)ident(length)operator(()operator(\)) - - comment(// count determination) - type(int) ident(count) operator(=) integer(0) - keyword(if) operator(()ident(tokenLen) operator(==) integer(1)operator(\)) ident(count) operator(=) integer(1) - keyword(else) keyword(if) operator(()ident(token)operator(.)ident(charAt)operator(()integer(1)operator(\)) operator(==) stringoperator(\)) ident(count) operator(=) operator(-)integer(1) - keyword(else) ident(count) operator(=) ident(token)operator([)integer(1)operator(..)operator(-)integer(1)operator(])operator(.)ident(toInteger)operator(()operator(\)) - - comment(// action determination) - type(char) ident(action) operator(=) ident(token)operator(.)ident(charAt)operator(()integer(0)operator(\)) - keyword(switch) operator(()ident(action)operator(\)) operator({) - keyword(case) stringoperator(:) - keyword(if) operator(()ident(count) operator(==) operator(-)integer(1)operator(\)) operator({) - ident(start) operator(=) operator([)ident(dataOffset)operator(,) ident(maxDataOffset)operator(])operator(.)ident(min)operator(()operator(\)) - ident(result)operator(.)ident(add)operator(()ident(data)operator([)ident(start)operator(..)operator(-)integer(1)operator(])operator(\)) - ident(dataOffset) operator(=) ident(maxDataOffset) - operator(}) keyword(else) operator({) - ident(start) operator(=) operator([)ident(dataOffset)operator(,) ident(maxDataOffset)operator(])operator(.)ident(min)operator(()operator(\)) - ident(end) operator(=) operator([)ident(dataOffset) operator(+) ident(count)operator(,) ident(maxDataOffset)operator(])operator(.)ident(min)operator(()operator(\)) - ident(result)operator(.)ident(add)operator(()ident(data)operator([)ident(start)operator(..<)ident(end)operator(])operator(\)) - ident(dataOffset) operator(+=) ident(count) - operator(}) - keyword(break) - keyword(case) stringoperator(:) - keyword(if) operator(()ident(count) operator(==) operator(-)integer(1)operator(\)) ident(dataOffset) operator(=) ident(maxDataOffset) - keyword(else) ident(dataOffset) operator(+=) ident(count) - keyword(break) - keyword(case) stringoperator(:) - keyword(if) operator(()ident(count) operator(==) operator(-)integer(1)operator(\)) ident(dataOffset) operator(=) ident(minDataOffset) - keyword(else) ident(dataOffset) operator(-=) ident(count) - keyword(break) - keyword(default)operator(:) - keyword(throw) keyword(new) exception(RuntimeException)operator(()stringoperator(,) ident(formatOffset)operator(\)) - operator(}) - ident(formatOffset) operator(+=) ident(tokenLen) operator(+) integer(1) - operator(}) - keyword(return) ident(result) keyword(as) pre_type(String)type([]) -operator(}) - -comment(// utility method) -keyword(def) method(cut2fmt)operator(()ident(positions)operator(\)) operator({) - ident(template) operator(=) string - ident(lastpos) operator(=) integer(1) - keyword(for) operator(()ident(pos) keyword(in) ident(positions)operator(\)) operator({) - ident(template) operator(+=) string operator(+) operator(()ident(pos) operator(-) ident(lastpos)operator(\)) operator(+) string - ident(lastpos) operator(=) ident(pos) - operator(}) - keyword(return) ident(template) operator(+) string -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.2) -comment(//----------------------------------------------------------------------------------) -comment(// use b if b is true, else c) -ident(b) operator(=) pre_constant(false)operator(;) ident(c) operator(=) string -keyword(assert) operator(()ident(b) operator(?) ident(b) operator(:) ident(c)operator(\)) operator(==) string -ident(b) operator(=) pre_constant(true) -keyword(assert) operator(()ident(b) operator(?) ident(b) operator(:) ident(c)operator(\)) -comment(// can be simplified to 'b || c' if c is a boolean) -comment(// strictly speaking, b doesn't have to be a boolean,) -comment(// e.g. an empty list is coerced to boolean false) -ident(b) operator(=) type([]) -keyword(assert) operator(()ident(b) operator(?) ident(b) operator(:) ident(c)operator(\)) operator(==) string - -comment(// set x to y unless x is already true) -ident(x) operator(=) pre_constant(false)operator(;) ident(y) operator(=) string -keyword(if) operator(()operator(!)ident(x)operator(\)) ident(x) operator(=) ident(y) -keyword(assert) ident(x) operator(==) string -comment(// can be simplified to 'x ||= y' if y is a boolean) -comment(// x doesn't need to be a boolean, e.g. a non-empty) -comment(// string is coerced to boolean true) -ident(x) operator(=) string -keyword(if) operator(()operator(!)ident(x)operator(\)) ident(x) operator(=) ident(y) -keyword(assert) ident(x) operator(==) string - -comment(// JVM supplies user name) -comment(// otherwise could use exec or built-in Ant features for reading environment vars) -keyword(assert) pre_type(System)operator(.)ident(getProperty)operator(()stringoperator(\)) - -comment(// test for nullity then for emptyness) -keyword(def) method(setDefaultIfNullOrEmpty)operator(()ident(startingPoint)operator(\)) operator({) - operator(()operator(!)ident(startingPoint) operator(||) ident(startingPoint)operator(.)ident(length)operator(()operator(\)) operator(==) integer(0)operator(\)) operator(?) string operator(:) ident(startingPoint) -operator(}) -keyword(assert) ident(setDefaultIfNullOrEmpty)operator(()pre_constant(null)operator(\)) operator(==) string -keyword(assert) ident(setDefaultIfNullOrEmpty)operator(()stringoperator(\)) operator(==) string -keyword(assert) ident(setDefaultIfNullOrEmpty)operator(()stringoperator(\)) operator(==) string -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.3) -comment(//----------------------------------------------------------------------------------) -ident(v1) operator(=) stringoperator(;) ident(v2) operator(=) string -comment(// this can done with explicit swapping via a temp variable) -comment(// or in a slightly more interesting way with a closure) -ident(swap) operator(=) operator({) ident(temp) operator(=) ident(v1)operator(;) ident(v1) operator(=) ident(v2)operator(;) ident(v2) operator(=) ident(temp) operator(}) -ident(swap)operator(()operator(\)) -keyword(assert) ident(v1) operator(==) string operator(&&) ident(v2) operator(==) string -comment(// a more generic swap(\) is also possible using Groovy's metaclass mechanisms) -comment(// but is not idiomatic of Groovy usage) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.4) -comment(//----------------------------------------------------------------------------------) -comment(// char and int are interchangable, apart from precision difference) -comment(// char use 16 bits while int use 32, requiring a cast from int to char) -type(char) ident(ch) operator(=) string -type(int) ident(num) operator(=) ident(ch) comment(// no problem) -ident(ch) operator(=) operator(()type(char)operator(\)) ident(num) comment(// needs an explicit cast) - -ident(s1) operator(=) string operator(+) ident(num) operator(+) string operator(+) operator(()type(char)operator(\)) ident(num) -keyword(assert) ident(s1) operator(==) string -ident(s2) operator(=) string operator(+) ident(ch) operator(+) string operator(+) operator(()type(int)operator(\)) ident(ch) -keyword(assert) ident(s2) operator(==) string - -comment(// easy conversion between char arrays, char lists and Strings) -type(char)type([]) ident(ascii) operator(=) stringoperator(.)ident(toCharArray)operator(()operator(\)) comment(// {115, 97, 109, 112, 108, 101}) -keyword(assert) keyword(new) pre_type(String)operator(()ident(ascii)operator(\)) operator(==) string -keyword(assert) keyword(new) pre_type(String)operator(()operator([)integer(115)operator(,) integer(97)operator(,) integer(109)operator(,) integer(112)operator(,) integer(108)operator(,) integer(101)operator(]) keyword(as) type(char)type([])operator(\)) operator(==) string - -comment(// convert 'HAL' to 'IBM' (in increasing order of Grooviness\)) -keyword(assert) stringoperator(.)ident(toCharArray)operator(()operator(\))operator(.)ident(collect)operator({)keyword(new) pre_type(String)operator(()local_variable(it)operator(+)integer(1) keyword(as) type(char)type([])operator(\))operator(})operator(.)ident(join)operator(()operator(\)) operator(==) string -keyword(assert) operator(()string keyword(as) pre_type(String)type([])operator(\))operator(.)ident(collect)operator({)local_variable(it)operator(.)ident(next)operator(()operator(\))operator(})operator(.)ident(join)operator(()operator(\)) operator(==) string -keyword(assert) stringoperator(.)ident(replaceAll)operator(()stringoperator(,) operator({)local_variable(it)operator(.)ident(next)operator(()operator(\))operator(})operator(\)) operator(==) string -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.5) -comment(//----------------------------------------------------------------------------------) -ident(string) operator(=) string -keyword(assert) ident(string)operator([)integer(3)operator(..)integer(7)operator(])operator(.)ident(split)operator(()stringoperator(\))operator([)integer(1)operator(..)integer(5)operator(]) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -keyword(assert) ident(string)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\))operator(.)ident(unique)operator(()operator(\))operator(.)ident(sort)operator(()operator(\))operator(.)ident(join)operator(()operator(\)) operator(==) string - -comment(//----------------------------------------------------------------------------------) -comment(// CheckSum.groovy: Compute 16-bit checksum of input file) -comment(// Usage: groovy CheckSum ) -comment(// script:) -ident(checksum) operator(=) integer(0) -keyword(new) pre_type(File)operator(()ident(args)operator([)integer(0)operator(])operator(\))operator(.)ident(eachByte)operator({) ident(checksum) operator(+=) local_variable(it) operator(}) -ident(checksum) operator(%=) operator(()type(int)operator(\)) pre_type(Math)operator(.)ident(pow)operator(()integer(2)operator(,) integer(16)operator(\)) operator(-) integer(1) -ident(println) ident(checksum) -comment(//----------------------------------------------------------------------------------) -comment(// to run on its own source code:) -comment(//=> % groovy CheckSum CheckSum.groovy) -comment(//=> 9349) -comment(//----------------------------------------------------------------------------------) -comment(// Slowcat.groovy: Emulate a s l o w line printer) -comment(// Usage: groovy Slowcat ) -comment(// script:) -ident(delay) operator(=) ident(args)operator([)integer(1)operator(])operator(.)ident(toInteger)operator(()operator(\)) -keyword(new) pre_type(File)operator(()ident(args)operator([)integer(0)operator(])operator(\))operator(.)ident(eachByte)operator({) ident(print) operator(()operator(()type(char)operator(\)) local_variable(it)operator(\))operator(;) pre_type(Thread)operator(.)ident(sleep)operator(()ident(delay)operator(\)) operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.6) -comment(//----------------------------------------------------------------------------------) -keyword(assert) stringoperator(.)ident(reverse)operator(()operator(\)) operator(==) string - -ident(string) operator(=) string -ident(revwords) operator(=) ident(string)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\))operator(.)ident(reverse)operator(()operator(\))operator(.)ident(join)operator(()stringoperator(\)) -keyword(assert) ident(revwords) operator(==) string - -ident(words) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -ident(long_palindromes) operator(=) ident(words)operator(.)ident(findAll)operator({) ident(w) operator(->) ident(w) operator(==) ident(w)operator(.)ident(reverse)operator(()operator(\)) operator(&&) ident(w)operator(.)ident(size)operator(()operator(\)) operator(>) integer(5) operator(}) -keyword(assert) ident(long_palindromes) operator(==) operator([)stringoperator(,) stringoperator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.7) -comment(//----------------------------------------------------------------------------------) -ident(s1) operator(=) string -ident(s2) operator(=) string -keyword(def) method(expand)operator(()ident(s)operator(\)) operator({) - ident(s)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\))operator(.)ident(collect)operator({) - ident(line) operator(=) local_variable(it) - keyword(while) operator(()ident(line)operator(.)ident(contains)operator(()stringoperator(\))operator(\)) operator({) - ident(line) operator(=) ident(line)operator(.)ident(replaceAll)operator(()regexpoperator(\))operator({) - ident(all)operator(,)ident(pre)operator(,)ident(tab)operator(,)ident(suf) operator(->) ident(pre) operator(+) string operator(*) operator(()integer(8) operator(-) ident(pre)operator(.)ident(size)operator(()operator(\)) operator(%) integer(8)operator(\)) operator(+) ident(suf) - operator(}) - operator(}) - keyword(return) ident(line) - operator(})operator(.)ident(join)operator(()stringoperator(\)) -operator(}) -keyword(def) method(unexpand)operator(()ident(s)operator(\)) operator({) - ident(s)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\))operator(.)ident(collect)operator({) - ident(line) operator(=) local_variable(it) - keyword(for) operator(()ident(i) keyword(in) ident(line)operator(.)ident(size)operator(()operator(\))operator(-)integer(1)operator(..)integer(1)operator(\)) operator({) - keyword(if) operator(()ident(i) operator(%) integer(8) operator(==) integer(0)operator(\)) operator({) - ident(prefix) operator(=) ident(line)operator([)integer(0)operator(..<)ident(i)operator(]) - keyword(if) operator(()ident(prefix)operator(.)ident(trim)operator(()operator(\))operator(.)ident(size)operator(()operator(\)) operator(!=) ident(prefix)operator(.)ident(size)operator(()operator(\))operator(\)) operator({) - ident(line) operator(=) ident(prefix)operator(.)ident(trim)operator(()operator(\)) operator(+) string operator(+) ident(line)operator([)ident(i)operator(..)operator(-)integer(1)operator(]) - operator(}) - operator(}) - operator(}) - keyword(return) ident(line) - operator(})operator(.)ident(join)operator(()stringoperator(\)) -operator(}) -keyword(assert) ident(expand)operator(()ident(s1)operator(\)) operator(==) ident(s2) -keyword(assert) ident(unexpand)operator(()ident(s2)operator(\)) operator(==) ident(s1) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.8) -comment(//----------------------------------------------------------------------------------) -ident(debt) operator(=) integer(150) -keyword(assert) stringcontent( to me)delimiter(")> operator(==) string - -ident(rows) operator(=) integer(24)operator(;) ident(cols) operator(=) integer(80) -keyword(assert) stringcontent( high and )inlinecontent( wide)delimiter(")> operator(==) string - -keyword(assert) stringoperator(.)ident(replaceAll)operator(()regexpoperator(,) operator({)integer(2)operator(*)local_variable(it)operator(.)ident(toInteger)operator(()operator(\))operator(})operator(\)) operator(==) string -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.9) -comment(//----------------------------------------------------------------------------------) -keyword(assert) stringoperator(.)ident(toUpperCase)operator(()operator(\)) operator(==) string -keyword(assert) stringoperator(.)ident(toLowerCase)operator(()operator(\)) operator(==) string -keyword(def) method(capitalize)operator(()ident(s)operator(\)) operator({)ident(s)operator([)integer(0)operator(])operator(.)ident(toUpperCase)operator(()operator(\)) operator(+) operator(()ident(s)operator(.)ident(size)operator(()operator(\))operator(<)integer(2) operator(?) string operator(:) ident(s)operator([)integer(1)operator(..)operator(-)integer(1)operator(])operator(?)operator(.)ident(toLowerCase)operator(()operator(\))operator(\))operator(}) -keyword(assert) ident(capitalize)operator(()stringoperator(\)) operator(==) string - -ident(s) operator(=) stringoperator(.)ident(replaceAll)operator(()regexpoperator(\))operator({)ident(capitalize)operator(()local_variable(it)operator(\))operator(}) -keyword(assert) ident(s) operator(==) string - -ident(s1) operator(=) stringoperator(;) ident(s2) operator(=) string -keyword(assert) ident(s1)operator(.)ident(equalsIgnoreCase)operator(()ident(s2)operator(\)) - -directive(private) pre_type(Random) ident(rand) -keyword(def) method(randomCase)operator(()type(char) ident(ch)operator(\)) operator({) - operator(()ident(rand)operator(.)ident(nextInt)operator(()integer(100)operator(\)) operator(<) integer(20)operator(\)) operator(?) pre_type(Character)operator(.)ident(toLowerCase)operator(()ident(ch)operator(\)) operator(:) ident(ch) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.10) -comment(//----------------------------------------------------------------------------------) -ident(n) operator(=) integer(10) -keyword(assert) stringcontent( guanacos.)delimiter(")> operator(==) string -keyword(assert) string operator(+) operator(()ident(n)operator(+)integer(1)operator(\)) operator(+) string operator(==) string - -comment(// sending templated email is solved in two parts: templating and sending) -comment(// Part 1: creating an email template) -ident(naughty) operator(=) string -keyword(def) method(get_manager_list)operator(()ident(s)operator(\)) operator({) string operator(}) -ident(msg) operator(=) stringcontent( -From: Your Bank -Cc: )inlinecontent( -Date: )inlinecontent( - -Dear )inlinecontent(, - -Today, you bounced check number )inlinecontent( to us. -Your account is now closed. - -Sincerely, -the management -)delimiter(""")> -ident(expected) operator(=) string -ident(sanitized) operator(=) ident(msg)operator(.)ident(replaceAll)operator(()stringoperator(,)stringoperator(\)) -ident(sanitized) operator(=) ident(sanitized)operator(.)ident(replaceAll)operator(()regexpoperator(,)stringoperator(\)) -keyword(assert) ident(sanitized) operator(==) ident(expected) -comment(// note: Groovy also has several additional built-in templating facilities) -comment(// Part 2: sending email) -comment(// SendMail.groovy: Send email) -comment(// Usage: groovy SendEmail ) -comment(// script:) -ident(ant) operator(=) keyword(new) ident(AntBuilder)operator(()operator(\)) -ident(ant)operator(.)ident(mail)operator(()key(from)operator(:)stringoperator(,) key(tolist)operator(:)stringoperator(,) - key(encoding)operator(:)stringoperator(,) key(mailhost)operator(:)stringoperator(,) - key(subject)operator(:)stringoperator(,) key(message)operator(:)stringoperator(\)) -comment(// Ant has many options for setting encoding, security, attachments, etc., see:) -comment(// http://ant.apache.org/manual/CoreTasks/mail.html) -comment(// Groovy could also use the Java Mail Api directly if required) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.11) -comment(//----------------------------------------------------------------------------------) -keyword(def) ident(raw) operator(=) string - -keyword(def) ident(expected) operator(=) string - -keyword(assert) ident(raw)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\))operator(.)ident(collect)operator({) - local_variable(it)operator(.)ident(replaceAll)operator(()regexpoperator(,)stringoperator(\)) -operator(})operator(.)ident(join)operator(()stringoperator(\)) operator(+) string operator(==) ident(expected) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.12) -comment(//----------------------------------------------------------------------------------) -ident(input) operator(=) string - -ident(expected) operator(=) string - -keyword(def) method(wrap)operator(()ident(text)operator(,) ident(maxSize)operator(\)) operator({) - ident(all) operator(=) type([]) - ident(line) operator(=) string - ident(text)operator(.)ident(eachMatch)operator(()regexpoperator(\)) operator({) - ident(word) operator(=) local_variable(it)operator([)integer(0)operator(]) - keyword(if) operator(()ident(line)operator(.)ident(size)operator(()operator(\)) operator(+) integer(1) operator(+) ident(word)operator(.)ident(size)operator(()operator(\)) operator(>) ident(maxSize)operator(\)) operator({) - ident(all) operator(+=) ident(line) - ident(line) operator(=) ident(word) - operator(}) keyword(else) operator({) - ident(line) operator(+=) operator(()ident(line) operator(==) string operator(?) ident(word) operator(:) string operator(+) ident(word)operator(\)) - operator(}) - operator(}) - ident(all) operator(+=) ident(line) - keyword(return) ident(all)operator(.)ident(join)operator(()stringoperator(\)) -operator(}) -keyword(assert) ident(wrap)operator(()ident(input)operator(,) integer(20)operator(\)) operator(==) ident(expected) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.13) -comment(//----------------------------------------------------------------------------------) -ident(string) operator(=) regexp -comment(// backslash special chars) -keyword(assert) ident(string)operator(.)ident(replaceAll)operator(()regexpoperator(\))operator({)regexpoperator(+)local_variable(it)operator([)integer(0)operator(])operator(}) operator(==) regexp comment(//') -comment(// double special chars) -keyword(assert) ident(string)operator(.)ident(replaceAll)operator(()regexpoperator(\))operator({)local_variable(it)operator([)integer(0)operator(])operator(+)local_variable(it)operator([)integer(0)operator(])operator(}) operator(==) regexp comment(//') -comment(//backslash quote all non-capital letters) -keyword(assert) stringoperator(.)ident(replaceAll)operator(()regexpoperator(\))operator({)regexpoperator(+)local_variable(it)operator([)integer(0)operator(])operator(}) operator(==) regexp -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.14) -comment(//----------------------------------------------------------------------------------) -keyword(assert) stringoperator(.)ident(trim)operator(()operator(\)) operator(==) string -comment(// print what's typed, but surrounded by >< symbols) -comment(// script:) -keyword(new) pre_type(BufferedReader)operator(()keyword(new) pre_type(InputStreamReader)operator(()pre_type(System)operator(.)ident(in)operator(\))operator(\))operator(.)ident(eachLine)operator({) - ident(println)operator(()string)delimiter(")> operator(+) local_variable(it)operator(.)ident(trim)operator(()operator(\)) operator(+) stringoperator(\))operator(;) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.15) -comment(//----------------------------------------------------------------------------------) -ident(pattern) operator(=) regexp -ident(line) operator(=) regexp -ident(m) operator(=) ident(line) operator(=~) ident(pattern) -ident(expected) operator(=) operator([)regexpoperator(,) stringoperator(,) regexpoperator(,) regexpoperator(,) comment(//') - regexpoperator(,) regexpoperator(,) regexpoperator(]) -keyword(for) operator(()ident(i) keyword(in) integer(0)operator(..<)ident(m)operator(.)ident(size)operator(()operator(\))operator(.)ident(toInteger)operator(()operator(\))operator(\)) - keyword(assert) ident(expected)operator([)ident(i)operator(]) operator(==) operator(()ident(m)operator([)ident(i)operator(])operator([)integer(2)operator(]) operator(?) ident(m)operator([)ident(i)operator(])operator([)integer(2)operator(]) operator(:) ident(m)operator([)ident(i)operator(])operator([)integer(1)operator(])operator(\)) - -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.16) -comment(//----------------------------------------------------------------------------------) -comment(// A quick google search found several Java implementations.) -comment(// As an example, how to use commons codec is shown below.) -comment(// Just place the respective jar in your classpath.) -comment(// Further details: http://jakarta.apache.org/commons/codec) -comment(// require(groupId:'commons-codec', artifactId:'commons-codec', version:'1.3'\)) -ident(soundex) operator(=) keyword(new) ident(org)operator(.)ident(apache)operator(.)ident(commons)operator(.)ident(codec)operator(.)ident(language)operator(.)ident(Soundex)operator(()operator(\)) -keyword(assert) ident(soundex)operator(.)ident(soundex)operator(()stringoperator(\)) operator(==) ident(soundex)operator(.)ident(soundex)operator(()stringoperator(\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.17) -comment(//----------------------------------------------------------------------------------) -ident(input) operator(=) string comment(//') - -ident(expected) operator(=) string comment(//') - -ident(translations) operator(=) operator([)key(colour)operator(:)stringoperator(,) key(analysed)operator(:)stringoperator(,) key(dropin)operator(:)stringoperator(]) - -keyword(def) method(fixstyle)operator(()ident(s)operator(\)) operator({) - ident(s)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\))operator(.)ident(collect)operator({) - ident(line) operator(=) local_variable(it) - ident(translations)operator(.)ident(each)operator({) ident(key)operator(,) ident(value) operator(->) - ident(line) operator(=) ident(line)operator(.)ident(replaceAll)operator(()regexp operator(+) ident(key) operator(+) regexpoperator(,) ident(value)operator(\)) - operator(}) - keyword(return) ident(line) - operator(})operator(.)ident(join)operator(()stringoperator(\)) -operator(}) -keyword(assert) ident(fixstyle)operator(()ident(input)operator(\)) operator(==) ident(expected) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_1.18) -comment(//----------------------------------------------------------------------------------) -comment(// Solved in two parts: 'screenscrape' text stream and return stream from process) -comment(// Part 1: text scraping) -ident(input) operator(=) string -ident(select1) operator(=) string -ident(select2) operator(=) string - -comment(// line below must be configured for your unix - this one's cygwin) -ident(format) operator(=) ident(cut2fmt)operator(()operator([)integer(10)operator(,) integer(18)operator(,) integer(26)operator(,) integer(37)operator(,) integer(42)operator(,) integer(47)operator(,) integer(56)operator(])operator(\)) -keyword(def) method(psgrep)operator(()ident(s)operator(\)) operator({) - ident(out) operator(=) type([]) - ident(lines) operator(=) ident(input)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(findAll)operator({) local_variable(it)operator(.)ident(size)operator(()operator(\)) operator(}) - ident(vars) operator(=) ident(unpack)operator(()ident(format)operator(,) ident(lines)operator([)integer(0)operator(])operator(\))operator(.)ident(toList)operator(()operator(\))operator(.)ident(collect)operator({) local_variable(it)operator(.)ident(toLowerCase)operator(()operator(\))operator(.)ident(trim)operator(()operator(\)) operator(}) - ident(out) operator(+=) ident(lines)operator([)integer(0)operator(]) - ident(lines)operator([)integer(1)operator(..)operator(-)integer(1)operator(])operator(.)ident(each)operator({) - ident(values) operator(=) ident(unpack)operator(()ident(format)operator(,) local_variable(it)operator(\))operator(.)ident(toList)operator(()operator(\))operator(.)ident(collect)operator({) - keyword(try) operator({) - keyword(return) local_variable(it)operator(.)ident(toInteger)operator(()operator(\)) - operator(}) keyword(catch)operator(()exception(NumberFormatException) ident(e)operator(\)) operator({) - keyword(return) local_variable(it)operator(.)ident(trim)operator(()operator(\)) - operator(}) - operator(}) - ident(vars)operator(.)ident(eachWithIndex)operator({) ident(var)operator(,) ident(i) operator(->) - ident(binding)operator(.)ident(setVariable)operator(()ident(var)operator(,) ident(values)operator([)ident(i)operator(])operator(\)) - operator(}) - keyword(if) operator(()keyword(new) ident(GroovyShell)operator(()ident(binding)operator(\))operator(.)ident(evaluate)operator(()ident(s)operator(\))operator(\)) ident(out) operator(+=) local_variable(it) - operator(}) - keyword(return) string operator(+) ident(out)operator(.)ident(join)operator(()stringoperator(\)) operator(+) string -operator(}) -keyword(assert) ident(psgrep)operator(()stringoperator(\)) operator(==) ident(select1) -keyword(assert) ident(psgrep)operator(()stringoperator(\)) operator(==) ident(select2) -comment(// Part 2: obtaining text stream from process) -comment(// unixScript:) -ident(input) operator(=) stringoperator(.)ident(execute)operator(()operator(\))operator(.)ident(text) -comment(// cygwinScript:) -ident(input) operator(=) stringoperator(.)ident(execute)operator(()operator(\))operator(.)ident(text) -comment(// windowsScript:) -comment(// can use something like sysinternal.com s pslist (with minor script tweaks\)) -ident(input) operator(=) stringoperator(.)ident(execute)operator(()operator(\))operator(.)ident(text) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.1) -comment(//----------------------------------------------------------------------------------) -comment(// four approaches possible (shown for Integers, similar for floats, double etc.\):) -comment(// (1\) NumberFormat.getInstance(\).parse(s\) // getInstance(\) can take locale) -comment(// (2\) Integer.parseInt(s\)) -comment(// (3\) new Integer(s\)) -comment(// (4\) regex) -keyword(import) include(java.text.*) -type(int) ident(nb) operator(=) integer(0) -keyword(try) operator({) - ident(nb) operator(=) pre_type(NumberFormat)operator(.)ident(getInstance)operator(()operator(\))operator(.)ident(parse)operator(()stringoperator(\)) comment(// '.5' will be ignored) - ident(nb) operator(=) pre_type(NumberFormat)operator(.)ident(getInstance)operator(()operator(\))operator(.)ident(parse)operator(()stringoperator(\)) -operator(}) keyword(catch) operator(()exception(ParseException) ident(ex)operator(\)) operator({) - keyword(assert) ident(ex)operator(.)ident(getMessage)operator(()operator(\))operator(.)ident(contains)operator(()stringoperator(\)) -operator(}) -keyword(assert) ident(nb) operator(==) integer(33) - -keyword(try) operator({) - ident(nb) operator(=) pre_type(Integer)operator(.)ident(parseInt)operator(()stringoperator(\)) - keyword(assert) ident(nb) operator(==) integer(34) - ident(nb) operator(=) keyword(new) pre_type(Integer)operator(()stringoperator(\)) - ident(nb) operator(=) pre_type(Integer)operator(.)ident(parseInt)operator(()stringoperator(\)) -operator(}) keyword(catch) operator(()exception(NumberFormatException) ident(ex)operator(\)) operator({) - keyword(assert) ident(ex)operator(.)ident(getMessage)operator(()operator(\))operator(.)ident(contains)operator(()stringoperator(\)) -operator(}) -keyword(assert) ident(nb) operator(==) integer(35) - -ident(integerPattern) operator(=) regexp -keyword(assert) string operator(=~) ident(integerPattern) -keyword(assert) operator(!)operator(()string operator(=~) ident(integerPattern)operator(\)) -ident(decimalPattern) operator(=) regexp -keyword(assert) string operator(=~) ident(decimalPattern) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.2) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy defaults to BigDecimal if you don't use an explicit float or double) -ident(wage) operator(=) float(5.36) -ident(week) operator(=) integer(40) operator(*) ident(wage) -keyword(assert) stringdelimiter(")> operator(==) regexp -comment(// if you want to use explicit doubles and floats you can still use) -comment(// printf in version 5, 6 or 7 JVMs) -comment(// printf('%5.2f', week as double\)) -comment(// => 214.40) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.3) -comment(//----------------------------------------------------------------------------------) -ident(a) operator(=) float(0.255) -ident(b) operator(=) ident(a)operator(.)ident(setScale)operator(()integer(2)operator(,) pre_type(BigDecimal)operator(.)ident(ROUND_HALF_UP)operator(\))operator(;) -keyword(assert) ident(a)operator(.)ident(toString)operator(()operator(\)) operator(==) string -keyword(assert) ident(b)operator(.)ident(toString)operator(()operator(\)) operator(==) string - -ident(a) operator(=) operator([)float(3.3) operator(,) float(3.5) operator(,) float(3.7)operator(,) operator(-)float(3.3)operator(]) keyword(as) type(double)type([]) -comment(// warning rint(\) rounds to nearest integer - slightly different to Perl's int(\)) -ident(rintExpected) operator(=) operator([)float(3.0)operator(,) float(4.0)operator(,) float(4.0)operator(,) operator(-)float(3.0)operator(]) keyword(as) type(double)type([]) -ident(floorExpected) operator(=) operator([)float(3.0)operator(,) float(3.0)operator(,) float(3.0)operator(,) operator(-)float(4.0)operator(]) keyword(as) type(double)type([]) -ident(ceilExpected) operator(=) operator([)float(4.0)operator(,) float(4.0)operator(,) float(4.0)operator(,) operator(-)float(3.0)operator(]) keyword(as) type(double)type([]) -ident(a)operator(.)ident(eachWithIndex)operator({) ident(val)operator(,) ident(i) operator(->) - keyword(assert) pre_type(Math)operator(.)ident(rint)operator(()ident(val)operator(\)) operator(==) ident(rintExpected)operator([)ident(i)operator(]) - keyword(assert) pre_type(Math)operator(.)ident(floor)operator(()ident(val)operator(\)) operator(==) ident(floorExpected)operator([)ident(i)operator(]) - keyword(assert) pre_type(Math)operator(.)ident(ceil)operator(()ident(val)operator(\)) operator(==) ident(ceilExpected)operator([)ident(i)operator(]) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.4) -comment(//----------------------------------------------------------------------------------) -keyword(assert) pre_type(Integer)operator(.)ident(parseInt)operator(()stringoperator(,) integer(2)operator(\)) operator(==) integer(54) -keyword(assert) pre_type(Integer)operator(.)ident(toString)operator(()integer(54)operator(,) integer(2)operator(\)) operator(==) string -comment(// also works for other radix values, e.g. hex) -keyword(assert) pre_type(Integer)operator(.)ident(toString)operator(()integer(60)operator(,) integer(16)operator(\)) operator(==) string - -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.5) -comment(//----------------------------------------------------------------------------------) -ident(x) operator(=) integer(3)operator(;) ident(y) operator(=) integer(20) -keyword(for) operator(()ident(i) keyword(in) ident(x)operator(..)ident(y)operator(\)) operator({) - comment(//i is set to every integer from x to y, inclusive) -operator(}) - -operator(()ident(x)operator(..<)ident(y)operator(\))operator(.)ident(each) operator({) - comment(//implicit closure variable it is set to every integer from x up to but excluding y) -operator(}) - -keyword(assert) operator(()ident(x)operator(..)ident(y)operator(\))operator(.)ident(step)operator(()integer(7)operator(\)) operator(==) operator([)integer(3)operator(,) integer(10)operator(,) integer(17)operator(]) - -ident(years) operator(=) type([]) -operator(()integer(5)operator(..<)integer(13)operator(\))operator(.)ident(each)operator({) ident(age) operator(->) ident(years) operator(+=) ident(age) operator(}) -keyword(assert) ident(years) operator(==) operator([)integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.6) -comment(//----------------------------------------------------------------------------------) -comment(// We can add additional methods to the Integer class) -type(class) class(IntegerCategory) operator({) - directive(static) keyword(def) ident(romanMap) operator(=) operator([)integer(1000)operator(:)stringoperator(,) integer(900)operator(:)stringoperator(,) integer(500)operator(:)stringoperator(,) integer(400)operator(:)stringoperator(,) integer(100)operator(:)stringoperator(,) integer(90)operator(:)stringoperator(,) - integer(50)operator(:)stringoperator(,) integer(40)operator(:)stringoperator(,) integer(10)operator(:)stringoperator(,) integer(9)operator(:)stringoperator(,) integer(5)operator(:)stringoperator(,) integer(4)operator(:)stringoperator(,) integer(1)operator(:)stringoperator(]) - - directive(static) ident(getRoman)operator(()pre_type(Integer) ident(self)operator(\)) operator({) - keyword(def) ident(remains) operator(=) ident(self) - keyword(def) ident(text) operator(=) string - ident(romanMap)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(sort)operator(()operator(\))operator(.)ident(reverse)operator(()operator(\))operator(.)ident(each)operator({) ident(key) operator(->) - keyword(while) operator(()ident(remains) operator(>=) ident(key)operator(\)) operator({) - ident(remains) operator(-=) ident(key) - ident(text) operator(+=) ident(romanMap)operator([)ident(key)operator(]) - operator(}) - operator(}) - keyword(return) ident(text) - operator(}) - - directive(static) type(int) ident(parseRoman)operator(()pre_type(Object) ident(self)operator(,) pre_type(String) ident(input)operator(\)) operator({) - keyword(def) ident(ustr) operator(=) ident(input)operator(.)ident(toUpperCase)operator(()operator(\)) - type(int) ident(sum) operator(=) integer(0) - ident(romanMap)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(sort)operator(()operator(\))operator(.)ident(reverse)operator(()operator(\))operator(.)ident(each)operator({) ident(key) operator(->) - keyword(while) operator(()ident(ustr)operator(.)ident(startsWith)operator(()ident(romanMap)operator([)ident(key)operator(])operator(\))operator(\)) operator({) - ident(sum) operator(+=) ident(key) - ident(ustr) operator(-=) ident(romanMap)operator([)ident(key)operator(]) - operator(}) - operator(}) - keyword(return) ident(sum) - operator(}) -operator(}) - -ident(use)operator(()ident(IntegerCategory)operator(\)) operator({) - type(int) ident(fifteen) operator(=) integer(15) - keyword(assert) ident(fifteen)operator(.)ident(roman) operator(==) string - keyword(assert) ident(parseRoman)operator(()stringoperator(\)) operator(==) integer(26) - keyword(for) operator(()ident(i) keyword(in) integer(1)operator(..)integer(3900)operator(\)) operator({) - keyword(assert) ident(i) operator(==) ident(parseRoman)operator(()ident(i)operator(.)ident(roman)operator(\)) - operator(}) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.7) -comment(//----------------------------------------------------------------------------------) -ident(random) operator(=) keyword(new) pre_type(Random)operator(()operator(\)) -integer(100)operator(.)ident(times)operator({) - ident(next) operator(=) ident(random)operator(.)ident(nextInt)operator(()integer(50)operator(\)) operator(+) integer(25) - keyword(assert) ident(next) operator(>) integer(24) - keyword(assert) ident(next) operator(<) integer(76) -operator(}) -ident(chars) operator(=) type([]) -operator([)stringoperator(..)stringoperator(,)stringoperator(..)stringoperator(,)stringoperator(..)stringoperator(,)operator(()string keyword(as) pre_type(String)type([])operator(\))operator(.)ident(toList)operator(()operator(\))operator(])operator(.)ident(each)operator({)ident(chars) operator(+=) local_variable(it)operator(}) -ident(password) operator(=) operator(()integer(1)operator(..)integer(8)operator(\))operator(.)ident(collect)operator({) ident(chars)operator([)ident(random)operator(.)ident(nextInt)operator(()ident(chars)operator(.)ident(size)operator(()operator(\))operator(\))operator(]) operator(})operator(.)ident(join)operator(()operator(\)) -keyword(assert) ident(password)operator(.)ident(size)operator(()operator(\)) operator(==) integer(8) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.8) -comment(//----------------------------------------------------------------------------------) -comment(// By default Groovy uses Java's Random facilities which use the current time) -comment(// as the initial seed. This always changes but does so slowly over time.) -comment(// You are free to select a better seed if you want greater randomness or) -comment(// use the same one each time if you need repeatability.) -type(long) ident(seed) operator(=) pre_type(System)operator(.)ident(currentTimeMillis)operator(()operator(\)) -ident(random1) operator(=) keyword(new) pre_type(Random)operator(()ident(seed)operator(\)) -ident(random2) operator(=) keyword(new) pre_type(Random)operator(()ident(seed)operator(\)) -keyword(assert) ident(random1)operator(.)ident(nextInt)operator(()operator(\)) operator(==) ident(random2)operator(.)ident(nextInt)operator(()operator(\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.9) -comment(//----------------------------------------------------------------------------------) -comment(// java.util.Random which Groovy uses already uses a 48-bit seed) -comment(// You can make use 64 not 48 bits (and make better use of the 48 bits\) see here:) -comment(// http://alife.co.uk/nonrandom/) -comment(// You can choose a better seed, e.g. Ant uses:) -ident(seed) operator(=) pre_type(System)operator(.)ident(currentTimeMillis)operator(()operator(\)) operator(+) pre_type(Runtime)operator(.)ident(runtime)operator(.)ident(freeMemory)operator(()operator(\)) -comment(// You can accept input from the user, e.g.) -comment(// http://examples.oreilly.com/javacrypt/files/oreilly/jonathan/util/Seeder.java) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.10) -comment(//----------------------------------------------------------------------------------) -comment(// use Java's Random.nextGaussian(\) method) -ident(random) operator(=) keyword(new) pre_type(Random)operator(()operator(\)) -ident(mean) operator(=) integer(25) -ident(sdev) operator(=) integer(2) -ident(salary) operator(=) ident(random)operator(.)ident(nextGaussian)operator(()operator(\)) operator(*) ident(sdev) operator(+) ident(mean) -comment(// script:) -ident(printf) stringoperator(,) ident(salary) -comment(// => You have been hired at $25.05) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.11) -comment(//----------------------------------------------------------------------------------) -comment(// radians = Math.toRadians(degrees\)) -keyword(assert) pre_type(Math)operator(.)ident(toRadians)operator(()integer(90)operator(\)) operator(==) pre_type(Math)operator(.)ident(PI) operator(/) integer(2) -comment(// degrees = Math.toDegrees(radians\)) -keyword(assert) pre_type(Math)operator(.)ident(toDegrees)operator(()pre_type(Math)operator(.)ident(PI)operator(\)) operator(==) integer(180) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.12) -comment(//----------------------------------------------------------------------------------) -comment(// use Java's trigonometry methods in java.lang.Math) -comment(//----------------------------------------------------------------------------------) -ident(t) operator(=) pre_type(Math)operator(.)ident(tan)operator(()float(1.5)operator(\)) -keyword(assert) ident(t) operator(>) float(14.1) operator(&&) ident(t) operator(<) float(14.11) -ident(ac) operator(=) pre_type(Math)operator(.)ident(acos)operator(()float(0.1)operator(\)) -keyword(assert) ident(ac) operator(>) float(1.47) operator(&&) ident(ac) operator(<) float(1.48) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.13) -comment(//----------------------------------------------------------------------------------) -keyword(assert) pre_type(Math)operator(.)ident(log)operator(()pre_type(Math)operator(.)ident(E)operator(\)) operator(==) integer(1) -keyword(assert) pre_type(Math)operator(.)ident(log10)operator(()integer(10000)operator(\)) operator(==) integer(4) -keyword(def) method(logn)operator(()ident(base)operator(,) ident(val)operator(\)) operator({) pre_type(Math)operator(.)ident(log)operator(()ident(val)operator(\))operator(/)pre_type(Math)operator(.)ident(log)operator(()ident(base)operator(\)) operator(}) -keyword(assert) ident(logn)operator(()integer(2)operator(,) integer(1024)operator(\)) operator(==) integer(10) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.14) -comment(//----------------------------------------------------------------------------------) -comment(// there are several Java Matrix packages available, e.g.) -comment(// http://math.nist.gov/javanumerics/jama) -keyword(import) include(Jama.Matrix) -ident(matrix1) operator(=) keyword(new) ident(Matrix)operator(()operator([) - operator([)integer(3)operator(,) integer(2)operator(,) integer(3)operator(])operator(,) - operator([)integer(5)operator(,) integer(9)operator(,) integer(8)operator(]) -operator(]) keyword(as) type(double)type([])type([])operator(\)) - -ident(matrix2) operator(=) keyword(new) ident(Matrix)operator(()operator([) - operator([)integer(4)operator(,) integer(7)operator(])operator(,) - operator([)integer(9)operator(,) integer(3)operator(])operator(,) - operator([)integer(8)operator(,) integer(1)operator(]) -operator(]) keyword(as) type(double)type([])type([])operator(\)) - -ident(expectedArray) operator(=) operator([)operator([)float(54.0)operator(,) float(30.0)operator(])operator(,) operator([)float(165.0)operator(,) float(70.0)operator(])operator(]) keyword(as) type(double)type([])type([]) -ident(productArray) operator(=) ident(matrix1)operator(.)ident(times)operator(()ident(matrix2)operator(\))operator(.)ident(array) - -keyword(for) operator(()ident(i) keyword(in) integer(0)operator(..<)ident(productArray)operator(.)ident(size)operator(()operator(\))operator(\)) operator({) - keyword(assert) ident(productArray)operator([)ident(i)operator(]) operator(==) ident(expectedArray)operator([)ident(i)operator(]) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.15) -comment(//----------------------------------------------------------------------------------) -comment(// there are several Java Complex number packages, e.g.:) -comment(// http://jakarta.apache.org/commons/math/userguide/complex.html) -keyword(import) include(org.apache.commons.math.complex.Complex) -ident(a) operator(=) keyword(new) ident(Complex)operator(()integer(3)operator(,) integer(5)operator(\)) comment(// 3 + 5i) -ident(b) operator(=) keyword(new) ident(Complex)operator(()integer(2)operator(,) operator(-)integer(2)operator(\)) comment(// 2 - 2i) -ident(expected) operator(=) keyword(new) ident(Complex) operator(()integer(16)operator(,) integer(4)operator(\)) comment(// 16 + 4i) -keyword(assert) ident(expected) operator(==) ident(a) operator(*) ident(b) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.16) -comment(//----------------------------------------------------------------------------------) -keyword(assert) pre_type(Integer)operator(.)ident(parseInt)operator(()stringoperator(,) integer(16)operator(\)) operator(==) integer(257) -keyword(assert) pre_type(Integer)operator(.)ident(parseInt)operator(()stringoperator(,) integer(8)operator(\)) operator(==) integer(63) -comment(//----------------------------------------------------------------------------------) -comment(// conversionScript:) -ident(print) string -ident(reader) operator(=) keyword(new) pre_type(BufferedReader)operator(()keyword(new) pre_type(InputStreamReader)operator(()pre_type(System)operator(.)ident(in)operator(\))operator(\)) -ident(input) operator(=) ident(reader)operator(.)ident(readLine)operator(()operator(\))operator(.)ident(trim)operator(()operator(\)) -keyword(switch)operator(()ident(input)operator(\)) operator({) - keyword(case) operator(~)stringoperator(:) - ident(number) operator(=) pre_type(Integer)operator(.)ident(parseInt)operator(()ident(input)operator(.)ident(substring)operator(()integer(2)operator(\))operator(,) integer(16)operator(\))operator(;) keyword(break) - keyword(case) operator(~)stringoperator(:) - ident(number) operator(=) pre_type(Integer)operator(.)ident(parseInt)operator(()ident(input)operator(.)ident(substring)operator(()integer(1)operator(\))operator(,) integer(8)operator(\))operator(;) keyword(break) - keyword(default)operator(:) - ident(number) operator(=) pre_type(Integer)operator(.)ident(parseInt)operator(()ident(input)operator(\)) -operator(}) -ident(println) string operator(+) ident(number) - -comment(// permissionScript:) -ident(print) string -ident(input) operator(=) keyword(new) pre_type(BufferedReader)operator(()keyword(new) pre_type(InputStreamReader)operator(()pre_type(System)operator(.)ident(in)operator(\))operator(\)) -ident(num) operator(=) ident(input)operator(.)ident(readLine)operator(()operator(\))operator(.)ident(trim)operator(()operator(\)) -ident(permission) operator(=) pre_type(Integer)operator(.)ident(parseInt)operator(()ident(num)operator(,) integer(8)operator(\)) -ident(println) string operator(+) ident(permission) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.17) -comment(//----------------------------------------------------------------------------------) -ident(nf) operator(=) pre_type(NumberFormat)operator(.)ident(getInstance)operator(()operator(\)) -keyword(assert) ident(nf)operator(.)ident(format)operator(()operator(-)integer(1740525205)operator(\)) operator(==) string -comment(//----------------------------------------------------------------------------------) -comment(// @@PLEAC@@_2.18) -comment(//----------------------------------------------------------------------------------) -keyword(def) method(timeMessage)operator(()ident(hour)operator(\)) operator({) string operator(+) ident(hour) operator(+) string operator(+) operator(()ident(hour) operator(==) integer(1) operator(?) string operator(:) stringoperator(\)) operator(}) -keyword(assert) string operator(==) ident(timeMessage)operator(()integer(1)operator(\)) -keyword(assert) string operator(==) ident(timeMessage)operator(()integer(2)operator(\)) - -comment(// you can also use Java's ChoiceFormat) -comment(// overkill for this example but extensible and compatible with MessageFormat) -ident(limits) operator(=) operator([)integer(1)operator(,) pre_type(ChoiceFormat)operator(.)ident(nextDouble)operator(()integer(1)operator(\))operator(]) keyword(as) type(double)type([]) -ident(names) operator(=) operator([)stringoperator(,) stringoperator(]) keyword(as) pre_type(String)type([]) -ident(choice) operator(=) keyword(new) pre_type(ChoiceFormat)operator(()ident(limits)operator(,) ident(names)operator(\)) -ident(numCenturies) operator(=) integer(1) -ident(expected) operator(=) string -keyword(assert) ident(expected) operator(==) stringcontent( )delimiter(")> operator(+) ident(choice)operator(.)ident(format)operator(()ident(numCenturies)operator(\)) -comment(// an alternate constructor syntax) -ident(choice) operator(=) keyword(new) pre_type(ChoiceFormat)operator(()stringoperator(\)) -keyword(assert) ident(choice)operator(.)ident(format)operator(()integer(3)operator(\)) operator(==) string - -comment(// more complex pluralization can be done with Java libraries, e.g.:) -comment(// http://www.elvis.ac.nz/brain?PluralizationMapping) -comment(// org.springframework.util.Pluralizer within the Spring Framework (springframework.org\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_2.19) -comment(//----------------------------------------------------------------------------------) -comment(// calculating prime factors) -keyword(def) method(factorize)operator(()pre_type(BigInteger) ident(orig)operator(\)) operator({) - ident(factors) operator(=) operator([)operator(:)operator(]) - keyword(def) ident(addFactor) operator(=) operator({) ident(x) operator(->) keyword(if) operator(()ident(factors)operator([)ident(x)operator(])operator(\)) ident(factors)operator([)ident(x)operator(]) operator(+=) integer(1) keyword(else) ident(factors)operator([)ident(x)operator(]) operator(=) integer(1) operator(}) - ident(n) operator(=) ident(orig) - ident(i) operator(=) integer(2) - ident(sqi) operator(=) integer(4) comment(// square of i) - keyword(while) operator(()ident(sqi) operator(<=) ident(n)operator(\)) operator({) - keyword(while) operator(()ident(n)operator(.)ident(remainder)operator(()ident(i)operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(n) operator(/)operator(=) ident(i) - ident(addFactor) ident(i) - operator(}) - comment(// we take advantage of the fact that (i+1\)**2 = i**2 + 2*i + 1) - ident(sqi) operator(+=) integer(2) operator(*) ident(i) operator(+) integer(1) - ident(i) operator(+=) integer(1) - operator(}) - keyword(if) operator(()operator(()ident(n) operator(!=) integer(1)operator(\)) operator(&&) operator(()ident(n) operator(!=) ident(orig)operator(\))operator(\)) ident(addFactor) ident(n) - keyword(return) ident(factors) -operator(}) - -keyword(def) method(pretty)operator(()ident(factors)operator(\)) operator({) - keyword(if) operator(()operator(!)ident(factors)operator(\)) keyword(return) string - ident(sb) operator(=) keyword(new) pre_type(StringBuffer)operator(()operator(\)) - ident(factors)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(sort)operator(()operator(\))operator(.)ident(each) operator({) ident(key) operator(->) - ident(sb) operator(<)operator(<) ident(key) - keyword(if) operator(()ident(factors)operator([)ident(key)operator(]) operator(>) integer(1)operator(\)) ident(sb) operator(<)operator(<) string operator(+) ident(factors)operator([)ident(key)operator(]) - ident(sb) operator(<)operator(<) string - operator(}) - keyword(return) ident(sb)operator(.)ident(toString)operator(()operator(\))operator(.)ident(trim)operator(()operator(\)) -operator(}) - -keyword(assert) ident(pretty)operator(()ident(factorize)operator(()integer(2178)operator(\))operator(\)) operator(==) string -keyword(assert) ident(pretty)operator(()ident(factorize)operator(()integer(39887)operator(\))operator(\)) operator(==) string -keyword(assert) ident(pretty)operator(()ident(factorize)operator(()integer(239322000000000000000000)operator(\))operator(\)) operator(==) string -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.0) -comment(//----------------------------------------------------------------------------------) -comment(// use Date to get the current time) -ident(println) keyword(new) pre_type(Date)operator(()operator(\)) -comment(// => Mon Jan 01 07:12:32 EST 2007) -comment(// use Calendar to compute year, month, day, hour, minute, and second values) -ident(cal) operator(=) pre_type(Calendar)operator(.)ident(instance) -ident(println) string operator(+) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(DAY_OF_YEAR)operator(\)) operator(+) string -comment(// => Today is day 1 of the current year.) -comment(// there are other Java Date/Time packages with extended capabilities, e.g.:) -comment(// http://joda-time.sourceforge.net/) -comment(// there is a special Grails (grails.codehaus.org\) time DSL (see below\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.1) -comment(//----------------------------------------------------------------------------------) -ident(cal) operator(=) pre_type(Calendar)operator(.)ident(instance) -ident(Y) operator(=) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(YEAR)operator(\)) -ident(M) operator(=) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(MONTH)operator(\)) operator(+) integer(1) -ident(D) operator(=) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(DATE)operator(\)) -ident(println) stringcontent( )inlinecontent( )inlinedelimiter(")> -comment(// => The current date is 2006 04 28) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.2) -comment(//----------------------------------------------------------------------------------) -comment(// create a calendar with current time and time zone) -ident(cal) operator(=) pre_type(Calendar)operator(.)ident(instance) -comment(// set time zone using long or short timezone values) -ident(cal)operator(.)ident(timeZone) operator(=) pre_type(TimeZone)operator(.)ident(getTimeZone)operator(()stringoperator(\)) -ident(cal)operator(.)ident(timeZone) operator(=) pre_type(TimeZone)operator(.)ident(getTimeZone)operator(()stringoperator(\)) -comment(// set date fields one at a time) -ident(cal)operator(.)ident(set)operator(()pre_type(Calendar)operator(.)ident(MONTH)operator(,) pre_type(Calendar)operator(.)ident(DECEMBER)operator(\)) -comment(// or several together) -comment(//calendar.set(year, month - 1, day, hour, minute, second\)) -comment(// get time in seconds since EPOCH) -type(long) ident(time) operator(=) ident(cal)operator(.)ident(time)operator(.)ident(time) operator(/) integer(1000) -ident(println) ident(time) -comment(// => 1196522682) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.3) -comment(//----------------------------------------------------------------------------------) -comment(// create a calendar with current time and time zone) -ident(cal) operator(=) pre_type(Calendar)operator(.)ident(instance) -comment(// set time) -ident(cal)operator(.)ident(time) operator(=) keyword(new) pre_type(Date)operator(()ident(time) operator(*) integer(1000)operator(\)) -comment(// get date fields) -ident(println)operator(()string - operator(+) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(HOUR_OF_DAY)operator(\)) operator(+) string - operator(+) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(MINUTE)operator(\)) operator(+) string - operator(+) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(SECOND)operator(\)) operator(+) string - operator(+) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(YEAR)operator(\)) operator(+) string - operator(+) operator(()ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(MONTH)operator(\)) operator(+) integer(1)operator(\)) operator(+) string - operator(+) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(DATE)operator(\))operator(\)) -comment(// => Dateline: 7:33:16-2007/1/1) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.4) -comment(//----------------------------------------------------------------------------------) -keyword(import) include(java.text.SimpleDateFormat) -type(long) ident(difference) operator(=) integer(100) -type(long) ident(after) operator(=) ident(time) operator(+) ident(difference) -type(long) ident(before) operator(=) ident(time) operator(-) ident(difference) - -comment(// any field of a calendar is incrementable via add(\) and roll(\) methods) -ident(cal) operator(=) pre_type(Calendar)operator(.)ident(instance) -ident(df) operator(=) keyword(new) pre_type(SimpleDateFormat)operator(()operator(\)) -ident(printCal) operator(=) operator({)ident(cal) operator(->) ident(df)operator(.)ident(format)operator(()ident(cal)operator(.)ident(time)operator(\))operator(}) -ident(cal)operator(.)ident(set)operator(()integer(2000)operator(,) integer(0)operator(,) integer(1)operator(,) oct(00)operator(,) oct(01)operator(,) integer(0)operator(\)) -keyword(assert) ident(printCal)operator(()ident(cal)operator(\)) operator(==) string -comment(// roll minute back by 2 but don't adjust other fields) -ident(cal)operator(.)ident(roll)operator(()pre_type(Calendar)operator(.)ident(MINUTE)operator(,) operator(-)integer(2)operator(\)) -keyword(assert) ident(printCal)operator(()ident(cal)operator(\)) operator(==) string -comment(// adjust hour back 1 and adjust other fields if needed) -ident(cal)operator(.)ident(add)operator(()pre_type(Calendar)operator(.)ident(HOUR)operator(,) operator(-)integer(1)operator(\)) -keyword(assert) ident(printCal)operator(()ident(cal)operator(\)) operator(==) string - -comment(// larger example) -ident(cal)operator(.)ident(timeZone) operator(=) pre_type(TimeZone)operator(.)ident(getTimeZone)operator(()stringoperator(\)) -ident(cal)operator(.)ident(set)operator(()integer(1973)operator(,) integer(0)operator(,) integer(18)operator(,) integer(3)operator(,) integer(45)operator(,) integer(50)operator(\)) -ident(cal)operator(.)ident(add)operator(()pre_type(Calendar)operator(.)ident(DATE)operator(,) integer(55)operator(\)) -ident(cal)operator(.)ident(add)operator(()pre_type(Calendar)operator(.)ident(HOUR_OF_DAY)operator(,) integer(2)operator(\)) -ident(cal)operator(.)ident(add)operator(()pre_type(Calendar)operator(.)ident(MINUTE)operator(,) integer(17)operator(\)) -ident(cal)operator(.)ident(add)operator(()pre_type(Calendar)operator(.)ident(SECOND)operator(,) integer(5)operator(\)) -keyword(assert) ident(printCal)operator(()ident(cal)operator(\)) operator(==) string - -comment(// alternatively, work with epoch times) -type(long) ident(birthTime) operator(=) integer(96176750359) comment(// 18/Jan/1973, 3:45:50 am) -type(long) ident(interval) operator(=) integer(5) operator(+) comment(// 5 second) - integer(17) operator(*) integer(60) operator(+) comment(// 17 minute) - integer(2) operator(*) integer(60) operator(*) integer(60) operator(+) comment(// 2 hour) - integer(55) operator(*) integer(60) operator(*) integer(60) operator(*) integer(24) comment(// and 55 day) -ident(then) operator(=) keyword(new) pre_type(Date)operator(()ident(birthTime) operator(+) ident(interval) operator(*) integer(1000)operator(\)) -keyword(assert) ident(df)operator(.)ident(format)operator(()ident(then)operator(\)) operator(==) string - -comment(// Alternatively, the Google Data module has a category with DSL-like time support:) -comment(// http://docs.codehaus.org/display/GROOVY/Google+Data+Support) -comment(// which supports the following syntax) -comment(// def interval = 5.seconds + 17.minutes + 2.hours + 55.days) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.5) -comment(//----------------------------------------------------------------------------------) -ident(bree) operator(=) integer(361535725) comment(// 16 Jun 1981, 4:35:25) -ident(nat) operator(=) integer(96201950) comment(// 18 Jan 1973, 3:45:50) -ident(difference) operator(=) ident(bree) operator(-) ident(nat) -ident(println) stringcontent( seconds between Nat and Bree)delimiter(")> -comment(// => There were 265333775 seconds between Nat and Bree) -ident(seconds) operator(=) ident(difference) operator(%) integer(60) -ident(difference) operator(=) operator(()ident(difference) operator(-) ident(seconds)operator(\)) operator(/) integer(60) -ident(minutes) operator(=) ident(difference) operator(%) integer(60) -ident(difference) operator(=) operator(()ident(difference) operator(-) ident(minutes)operator(\)) operator(/) integer(60) -ident(hours) operator(=) ident(difference) operator(%) integer(24) -ident(difference) operator(=) operator(()ident(difference) operator(-) ident(hours)operator(\)) operator(/) integer(24) -ident(days) operator(=) ident(difference) operator(%) integer(7) -ident(weeks) operator(=) operator(()ident(difference) operator(-) ident(days)operator(\)) operator(/) integer(7) -ident(println) stringcontent( weeks, )inlinecontent( days, )inlinecontent(:)inlinecontent(:)inlinecontent(\))delimiter(")> -comment(// => (438 weeks, 4 days, 23:49:35\)) -comment(//----------------------------------------------------------------------------------) -ident(cal) operator(=) pre_type(Calendar)operator(.)ident(getInstance)operator(()pre_type(TimeZone)operator(.)ident(getTimeZone)operator(()stringoperator(\))operator(\)) -ident(cal)operator(.)ident(set)operator(()integer(1981)operator(,) integer(5)operator(,) integer(16)operator(\)) comment(// 16 Jun 1981) -ident(date1) operator(=) ident(cal)operator(.)ident(time) -ident(cal)operator(.)ident(set)operator(()integer(1973)operator(,) integer(0)operator(,) integer(18)operator(\)) comment(// 18 Jan 1973) -ident(date2) operator(=) ident(cal)operator(.)ident(time) -ident(difference) operator(=) pre_type(Math)operator(.)ident(abs)operator(()ident(date2)operator(.)ident(time) operator(-) ident(date1)operator(.)ident(time)operator(\)) -ident(days) operator(=) ident(difference) operator(/) operator(()integer(1000) operator(*) integer(60) operator(*) integer(60) operator(*) integer(24)operator(\)) -keyword(assert) ident(days) operator(==) integer(3071) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.6) -comment(//----------------------------------------------------------------------------------) -comment(// create a calendar with current time and time zone) -ident(cal) operator(=) pre_type(Calendar)operator(.)ident(instance) -ident(cal)operator(.)ident(set)operator(()integer(1981)operator(,) integer(5)operator(,) integer(16)operator(\)) -ident(yearDay) operator(=) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(DAY_OF_YEAR)operator(\))operator(;) -ident(year) operator(=) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(YEAR)operator(\))operator(;) -ident(yearWeek) operator(=) ident(cal)operator(.)ident(get)operator(()pre_type(Calendar)operator(.)ident(WEEK_OF_YEAR)operator(\))operator(;) -ident(df1) operator(=) keyword(new) pre_type(SimpleDateFormat)operator(()stringoperator(\)) -ident(df2) operator(=) keyword(new) pre_type(SimpleDateFormat)operator(()stringoperator(\)) -ident(print)operator(()ident(df1)operator(.)ident(format)operator(()ident(cal)operator(.)ident(time)operator(\)) operator(+) string operator(+) ident(df2)operator(.)ident(format)operator(()ident(cal)operator(.)ident(time)operator(\))operator(\)) -ident(println) stringcontent( and week number )inlinecontent( of )inlinedelimiter(")> -comment(// => 16/Jun/81 was a Tuesday and was day number 167 and week number 25 of 1981) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.7) -comment(//----------------------------------------------------------------------------------) -ident(input) operator(=) string -ident(df1) operator(=) keyword(new) pre_type(SimpleDateFormat)operator(()stringoperator(\)) -ident(date) operator(=) ident(df1)operator(.)ident(parse)operator(()ident(input)operator(\)) -ident(df2) operator(=) keyword(new) pre_type(SimpleDateFormat)operator(()stringoperator(\)) -ident(println) string operator(+) ident(df2)operator(.)ident(format)operator(()ident(date)operator(\)) -comment(// => Date was Jun/03/1998) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.8) -comment(//----------------------------------------------------------------------------------) -keyword(import) include(java.text.DateFormat) -ident(df) operator(=) keyword(new) pre_type(SimpleDateFormat)operator(()stringoperator(\)) -ident(cal)operator(.)ident(set)operator(()integer(2007)operator(,) integer(0)operator(,) integer(1)operator(\)) -ident(println) string operator(+) ident(df)operator(.)ident(format)operator(()ident(cal)operator(.)ident(time)operator(\)) -comment(// => Mon 1 1 09:02:29 EST 2007 (differs depending on your timezone\)) -ident(df) operator(=) pre_type(DateFormat)operator(.)ident(getDateInstance)operator(()pre_type(DateFormat)operator(.)ident(FULL)operator(,) pre_type(Locale)operator(.)ident(FRANCE)operator(\)) -ident(println) string operator(+) ident(df)operator(.)ident(format)operator(()ident(cal)operator(.)ident(time)operator(\)) -comment(// => lundi 1 janvier 2007) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.9) -comment(//----------------------------------------------------------------------------------) -comment(// script:) -ident(println) string -ident(before) operator(=) pre_type(System)operator(.)ident(currentTimeMillis)operator(()operator(\)) -ident(input) operator(=) keyword(new) pre_type(BufferedReader)operator(()keyword(new) pre_type(InputStreamReader)operator(()pre_type(System)operator(.)ident(in)operator(\))operator(\))operator(.)ident(readLine)operator(()operator(\)) -ident(after) operator(=) pre_type(System)operator(.)ident(currentTimeMillis)operator(()operator(\)) -ident(elapsed) operator(=) operator(()ident(after) operator(-) ident(before)operator(\)) operator(/) integer(1000) -ident(println) stringcontent( seconds.)delimiter(")> -comment(// => You took2.313 seconds.) - -comment(// take mean sorting time) -ident(size) operator(=) integer(500)operator(;) ident(number) operator(=) integer(100)operator(;) ident(total) operator(=) integer(0) -keyword(for) operator(()ident(i) keyword(in) integer(0)operator(..<)ident(number)operator(\)) operator({) - ident(array) operator(=) type([]) - ident(size)operator(.)ident(times)operator({) ident(array) operator(<)operator(<) pre_type(Math)operator(.)ident(random)operator(()operator(\)) operator(}) - ident(doubles) operator(=) ident(array) keyword(as) type(double)type([]) - comment(// sort it) - type(long) ident(t0) operator(=) pre_type(System)operator(.)ident(currentTimeMillis)operator(()operator(\)) - pre_type(Arrays)operator(.)ident(sort)operator(()ident(doubles)operator(\)) - type(long) ident(t1) operator(=) pre_type(System)operator(.)ident(currentTimeMillis)operator(()operator(\)) - ident(total) operator(+=) operator(()ident(t1) operator(-) ident(t0)operator(\)) -operator(}) -ident(println) stringcontent( random numbers takes )inlinecontent( milliseconds)delimiter(")> -comment(// => On average, sorting 500 random numbers takes 0.32 milliseconds) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.10) -comment(//----------------------------------------------------------------------------------) -ident(delayMillis) operator(=) integer(50) -pre_type(Thread)operator(.)ident(sleep)operator(()ident(delayMillis)operator(\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_3.11) -comment(//----------------------------------------------------------------------------------) -comment(// this could be done more simply using JavaMail's getAllHeaderLines(\) but is shown) -comment(// in long hand for illustrative purposes) -ident(sampleMessage) operator(=) string; - Sat, 30 Dec 2006 15:16:11 +0000 -From: someone@somewhere.com -To: -Date: Sun, 31 Dec 2006 02:14:57 +1100 -Subject: Re: [Pleac-discuss] C/Posix/GNU - @@pleac@@_10x -Content-Type: text/plain; charset="us-ascii" -Content-Transfer-Encoding: 7bit -Sender: pleac-discuss-bounces@lists.sourceforge.net -Errors-To: pleac-discuss-bounces@lists.sourceforge.net - ------ Original Message ----- -From: someone@somewhere.com -To: otherperson@somewhereelse.com -Cc: -Sent: Wednesday, December 27, 2006 9:18 AM -Subject: Re: [Pleac-discuss] C/Posix/GNU - @@pleac@@_10x - -I really like that description of PLEAC. -)delimiter(''')> -ident(expected) operator(=) string somewhere.com 01:14:57 06/12/31 -win2K001 omta05ps.mx.bigpond.com 01:14:57 06/12/31 1m 14s -omta05ps.mx.bigpond.com mail.sourceforge.net 01:16:11 06/12/31 8s -sc8-sf-mx1-b.sourceforge. sc8-sf-list2-new.sourcefo 01:16:19 06/12/31 1s -sc8-sf-list2-new.sourcefo sc8-sf-spam2.sourceforge. 01:16:20 06/12/31 4s -unknown bne012m.server-web.com 01:16:24 06/12/31 1s -)delimiter(''')> - -type(class) class(MailHopDelta) operator({) - keyword(def) ident(headers)operator(,) ident(firstSender)operator(,) ident(firstDate)operator(,) ident(out) - - ident(MailHopDelta)operator(()ident(mail)operator(\)) operator({) - ident(extractHeaders)operator(()ident(mail)operator(\)) - ident(out) operator(=) keyword(new) pre_type(StringBuffer)operator(()operator(\)) - keyword(def) ident(m) operator(=) operator(()ident(mail) operator(=~) regexpoperator(\)) - ident(firstDate) operator(=) ident(parseDate)operator(()ident(m)operator([)integer(0)operator(])operator([)integer(1)operator(])operator(\)) - ident(firstSender) operator(=) operator(()ident(mail) operator(=~) regexp]*\))delimiter(/)>operator(\))operator([)integer(0)operator(])operator([)integer(1)operator(]) - ident(out)operator(()stringoperator(.)ident(split)operator(()stringoperator(\))operator(\)) - operator(}) - - keyword(def) method(parseDate)operator(()ident(date)operator(\)) operator({) - keyword(try) operator({) - keyword(return) keyword(new) pre_type(SimpleDateFormat)operator(()stringoperator(\))operator(.)ident(parse)operator(()ident(date)operator(\)) - operator(}) keyword(catch)operator(()ident(java)operator(.)ident(text)operator(.)ident(ParseException) ident(ex)operator(\)) operator({)operator(}) - keyword(try) operator({) - keyword(return) keyword(new) pre_type(SimpleDateFormat)operator(()stringoperator(\))operator(.)ident(parse)operator(()ident(date)operator(\)) - operator(}) keyword(catch)operator(()ident(java)operator(.)ident(text)operator(.)ident(ParseException) ident(ex)operator(\)) operator({)operator(}) - keyword(try) operator({) - keyword(return) pre_type(DateFormat)operator(.)ident(getDateInstance)operator(()pre_type(DateFormat)operator(.)ident(FULL)operator(\))operator(.)ident(parse)operator(()ident(date)operator(\)) - operator(}) keyword(catch)operator(()ident(java)operator(.)ident(text)operator(.)ident(ParseException) ident(ex)operator(\)) operator({)operator(}) - pre_type(DateFormat)operator(.)ident(getDateInstance)operator(()pre_type(DateFormat)operator(.)ident(LONG)operator(\))operator(.)ident(parse)operator(()ident(date)operator(\)) - operator(}) - - keyword(def) method(extractHeaders)operator(()ident(mail)operator(\)) operator({) - ident(headers) operator(=) type([]) - keyword(def) ident(isHeader) operator(=) pre_constant(true) - keyword(def) ident(currentHeader) operator(=) string - ident(mail)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each)operator({) ident(line) operator(->) - keyword(if) operator(()operator(!)ident(isHeader)operator(\)) keyword(return) - keyword(switch)operator(()ident(line)operator(\)) operator({) - keyword(case) operator(~)regexpoperator(:) - ident(isHeader) operator(=) pre_constant(false) - keyword(if) operator(()ident(currentHeader)operator(\)) ident(headers) operator(<)operator(<) ident(currentHeader) - keyword(break) - keyword(case) operator(~)regexpoperator(:) - ident(currentHeader) operator(+=) ident(line)operator(;) keyword(break) - keyword(default)operator(:) - keyword(if) operator(()ident(currentHeader)operator(\)) ident(headers) operator(<)operator(<) ident(currentHeader) - ident(currentHeader) operator(=) ident(line) - operator(}) - operator(}) - operator(}) - - keyword(def) method(out)operator(()ident(line)operator(\)) operator({) - ident(out) operator(<)operator(<) ident(line)operator([)integer(0)operator(])operator([)integer(0)operator(..<)operator([)integer(25)operator(,)ident(line)operator([)integer(0)operator(])operator(.)ident(size)operator(()operator(\))operator(])operator(.)ident(min)operator(()operator(\))operator(])operator(.)ident(padRight)operator(()integer(26)operator(\)) - ident(out) operator(<)operator(<) ident(line)operator([)integer(1)operator(])operator([)integer(0)operator(..<)operator([)integer(25)operator(,)ident(line)operator([)integer(1)operator(])operator(.)ident(size)operator(()operator(\))operator(])operator(.)ident(min)operator(()operator(\))operator(])operator(.)ident(padRight)operator(()integer(26)operator(\)) - ident(out) operator(<)operator(<) ident(line)operator([)integer(2)operator(])operator(.)ident(padRight)operator(()integer(17)operator(\)) operator(+) string - ident(out) operator(<)operator(<) ident(line)operator([)integer(3)operator(]) operator(+) string - operator(}) - - keyword(def) method(prettyDate)operator(()ident(date)operator(\)) operator({) - keyword(new) pre_type(SimpleDateFormat)operator(()stringoperator(\))operator(.)ident(format)operator(()ident(date)operator(\)) - operator(}) - - keyword(def) method(process)operator(()operator(\)) operator({) - ident(out)operator(()operator([)string)delimiter(')>operator(,) ident(firstSender)operator(,) ident(prettyDate)operator(()ident(firstDate)operator(\))operator(,) stringoperator(])operator(\)) - keyword(def) ident(prevDate) operator(=) ident(firstDate) - ident(headers)operator(.)ident(grep)operator(()operator(~)regexpoperator(\))operator(.)ident(reverseEach)operator({) ident(hop) operator(->) - keyword(def) ident(from) operator(=) operator(()ident(hop) operator(=~) regexpoperator(\))operator([)integer(0)operator(])operator([)integer(1)operator(]) - keyword(def) ident(by) operator(=) operator(()ident(hop) operator(=~) regexpoperator(\))operator([)integer(0)operator(])operator([)integer(1)operator(]) - keyword(def) ident(hopDate) operator(=) ident(parseDate)operator(()ident(hop)operator([)ident(hop)operator(.)ident(lastIndexOf)operator(()stringoperator(\))operator(+)integer(2)operator(..)operator(-)integer(1)operator(])operator(\)) - ident(out)operator(()operator([)ident(from)operator(,) ident(by)operator(,) ident(prettyDate)operator(()ident(prevDate)operator(\))operator(,) ident(prettyDelta)operator(()ident(hopDate)operator(.)ident(time) operator(-) ident(prevDate)operator(.)ident(time)operator(\))operator(])operator(\)) - ident(prevDate) operator(=) ident(hopDate) - operator(}) - keyword(return) ident(out)operator(.)ident(toString)operator(()operator(\)) - operator(}) - - keyword(def) method(prettyField)operator(()ident(secs)operator(,) ident(sign)operator(,) ident(ch)operator(,) ident(multiplier)operator(,) ident(sb)operator(\)) operator({) - keyword(def) ident(whole) operator(=) operator(()type(int)operator(\))operator(()ident(secs) operator(/) ident(multiplier)operator(\)) - keyword(if) operator(()operator(!)ident(whole)operator(\)) keyword(return) integer(0) - ident(sb) operator(<)operator(<) string operator(+) operator(()ident(sign) operator(*) ident(whole)operator(\)) operator(+) ident(ch) operator(+) string - keyword(return) ident(whole) operator(*) ident(multiplier) - operator(}) - - keyword(def) method(prettyDelta)operator(()ident(millis)operator(\)) operator({) - keyword(def) ident(sign) operator(=) ident(millis) operator(<) integer(0) operator(?) operator(-)integer(1) operator(:) integer(1) - keyword(def) ident(secs) operator(=) operator(()type(int)operator(\))pre_type(Math)operator(.)ident(abs)operator(()ident(millis)operator(/)integer(1000)operator(\)) - keyword(def) ident(sb) operator(=) keyword(new) pre_type(StringBuffer)operator(()operator(\)) - ident(secs) operator(-=) ident(prettyField)operator(()ident(secs)operator(,) ident(sign)operator(,) stringoperator(,) integer(60) operator(*) integer(60) operator(*) integer(24)operator(,) ident(sb)operator(\)) - ident(secs) operator(-=) ident(prettyField)operator(()ident(secs)operator(,) ident(sign)operator(,) stringoperator(,) integer(60) operator(*) integer(60)operator(,) ident(sb)operator(\)) - ident(secs) operator(-=) ident(prettyField)operator(()ident(secs)operator(,) ident(sign)operator(,) stringoperator(,) integer(60)operator(,) ident(sb)operator(\)) - ident(prettyField)operator(()ident(secs)operator(,) ident(sign)operator(,) stringoperator(,) integer(1)operator(,) ident(sb)operator(\)) - keyword(return) ident(sb)operator(.)ident(toString)operator(()operator(\))operator(.)ident(trim)operator(()operator(\)) - operator(}) -operator(}) - -keyword(assert) string operator(+) keyword(new) ident(MailHopDelta)operator(()ident(sampleMessage)operator(\))operator(.)ident(process)operator(()operator(\)) operator(==) ident(expected) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_4.0) -comment(//----------------------------------------------------------------------------------) -ident(simple) operator(=) operator([) stringoperator(,) stringoperator(,) stringoperator(,) string operator(]) -ident(nested) operator(=) operator([) stringoperator(,) stringoperator(,) operator([) stringoperator(,) string operator(]) operator(]) -keyword(assert) ident(nested)operator(.)ident(size)operator(()operator(\)) operator(==) integer(3) -keyword(assert) ident(nested)operator([)integer(2)operator(])operator(.)ident(size)operator(()operator(\)) operator(==) integer(2) - -ident(flattenNestedToSimple) operator(=) operator([) stringoperator(,) stringoperator(,) operator([) stringoperator(,) string operator(]) operator(])operator(.)ident(flatten)operator(()operator(\)) -keyword(assert) ident(flattenNestedToSimple)operator(.)ident(size)operator(()operator(\)) operator(==) integer(4) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.1) -comment(//----------------------------------------------------------------------------------) -ident(a) operator(=) operator([) stringoperator(,) stringoperator(,) string operator(]) -keyword(assert) ident(a)operator(.)ident(size)operator(()operator(\)) operator(==) integer(3) -ident(a) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\)) -keyword(assert) ident(a) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - -ident(removeLeadingSpaces) operator(=) operator({) local_variable(it)operator(.)ident(trim)operator(()operator(\)) operator(}) -ident(nonBlankLines) operator(=) operator({) local_variable(it) operator(}) -ident(lines) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(collect)operator(()ident(removeLeadingSpaces)operator(\))operator(.)ident(findAll)operator(()ident(nonBlankLines)operator(\)) - -keyword(assert) ident(lines) operator(==) operator([)stringoperator(,) - stringoperator(]) - -comment(// initialiseListFromFileScript:) -ident(lines) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(readLines)operator(()operator(\)) - -comment(// processFileScript:) -keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(eachLine)operator({) - comment(// dosomething) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.2) -comment(//----------------------------------------------------------------------------------) -ident(marbleColors) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) -keyword(assert) ident(marbleColors)operator(.)ident(join)operator(()stringoperator(\)) operator(==) string - -keyword(def) method(commify)operator(()ident(items)operator(\)) operator({) - keyword(if) operator(()operator(!)ident(items)operator(\)) keyword(return) ident(items) - keyword(def) ident(sepchar) operator(=) ident(items)operator(.)ident(find)operator({) local_variable(it) operator(=~) regexp operator(}) operator(?) string operator(:) string - keyword(switch) operator(()ident(items)operator(.)ident(size)operator(()operator(\))operator(\)) operator({) - keyword(case) integer(1)operator(:) keyword(return) ident(items)operator([)integer(0)operator(]) - keyword(case) integer(2)operator(:) keyword(return) ident(items)operator(.)ident(join)operator(()stringoperator(\)) - operator(}) - ident(items)operator([)integer(0)operator(..)operator(-)integer(2)operator(])operator(.)ident(join)operator(()ident(sepchar)operator(\)) operator(+) ident(sepchar) operator(+) string operator(+) ident(items)operator([)operator(-)integer(1)operator(]) -operator(}) - -keyword(assert) ident(commify)operator(()ident(marbleColors)operator(\)) operator(==) string - -ident(lists) operator(=) operator([) - operator([) string operator(])operator(,) - operator([) stringoperator(,) string operator(])operator(,) - stringoperator(.)ident(split)operator(()stringoperator(\))operator(,) - operator([) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,) - stringoperator(,) - string operator(])operator(,) -operator(]) - -ident(expected) operator(=) string - -keyword(assert) ident(expected) operator(==) string operator(+) ident(lists)operator(.)ident(collect)operator({)ident(commify)operator(()local_variable(it)operator(\))operator(})operator(.)ident(join)operator(()stringoperator(\)) operator(+) string -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.3) -comment(//----------------------------------------------------------------------------------) -comment(// In Groovy, lists and arrays are more or less interchangeable) -comment(// here is the example using lists) -ident(people) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) -keyword(assert) ident(people)operator(.)ident(size)operator(()operator(\)) operator(==) integer(3) -ident(people)operator([)integer(3)operator(]) operator(=) string -keyword(assert) ident(people)operator(.)ident(size)operator(()operator(\)) operator(==) integer(4) -keyword(assert) ident(people) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -comment(// to use arrays simply do 'people = peopleArray.toList(\)' at the start) -comment(// and 'peopleArray = people as String[]' at the end) -comment(// if you attempt to do extension on a Java array you will get an) -comment(// ArrayIndexOutOfBoundsException - which is why Java has ArrayList et al) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.4) -comment(//----------------------------------------------------------------------------------) -comment(// list to process) -ident(people) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -comment(// helper) -ident(startsWithCapital) operator(=) operator({) ident(word) operator(->) ident(word)operator([)integer(0)operator(]) keyword(in) stringoperator(..)string operator(}) - -comment(// various styles are possible for processing lists) -comment(// closure style) -ident(people)operator(.)ident(each) operator({) ident(person) operator(->) keyword(assert) ident(startsWithCapital)operator(()ident(person)operator(\)) operator(}) -comment(// for loop style) -keyword(for) operator(()ident(person) keyword(in) ident(people)operator(\)) operator({) keyword(assert) ident(startsWithCapital)operator(()ident(person)operator(\)) operator(}) - -comment(// unixScriptToFindAllUsersStartingWithLetterA:) -ident(all) operator(=) stringoperator(.)ident(execute)operator(()operator(\))operator(.)ident(text)operator(.)ident(replaceAll)operator(()stringoperator(,) stringoperator(\))operator(.)ident(split)operator(()stringoperator(\)) -ident(all)operator(.)ident(grep)operator(()operator(~)regexpoperator(\))operator(.)ident(each)operator({) ident(println) local_variable(it) operator(}) - -comment(// printFileWithWordsReversedScript:) -keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(eachLine)operator({) ident(line) operator(->) - ident(line)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each)operator({) ident(print) local_variable(it)operator(.)ident(reverse)operator(()operator(\)) operator(}) -operator(}) - -ident(a) operator(=) operator([)float(0.5)operator(,) integer(3)operator(])operator(;) ident(b) operator(=) operator([)integer(0)operator(,) integer(1)operator(]) -keyword(assert) operator([)ident(a)operator(,) ident(b)operator(])operator(.)ident(flatten)operator(()operator(\))operator(.)ident(collect)operator({) local_variable(it) operator(*) integer(7) operator(}) operator(==) operator([)float(3.5)operator(,) integer(21)operator(,) integer(0)operator(,) integer(7)operator(]) -comment(// above doesn't modify original arrays) -comment(// instead use a = a.collect{ ... }) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.5) -comment(//----------------------------------------------------------------------------------) -comment(// not relevant in Groovy since we have always references) -ident(items) operator(=) type([]) -keyword(for) operator(()ident(item) keyword(in) ident(items)operator(\)) operator({) - comment(// do something with item) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.6) -comment(//----------------------------------------------------------------------------------) -keyword(assert) operator([) integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(2)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(5) operator(])operator(.)ident(unique)operator(()operator(\)) operator(==) operator([) integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(5) operator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.7) -comment(//----------------------------------------------------------------------------------) -keyword(assert) operator([) integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(2)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5) operator(]) operator(-) operator([) integer(1)operator(,) integer(2)operator(,) integer(4) operator(]) operator(==) operator([)integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(5)operator(]) -keyword(assert) operator([) integer(1)operator(,) integer(1)operator(,) integer(2)operator(,) integer(2)operator(,) integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5) operator(])operator(.)ident(unique)operator(()operator(\)) operator(-) operator([) integer(1)operator(,) integer(2)operator(,) integer(4) operator(]) operator(==) operator([)integer(3)operator(,) integer(5)operator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.8) -comment(//----------------------------------------------------------------------------------) -ident(a) operator(=) operator([)integer(1)operator(,) integer(3)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(]) -ident(b) operator(=) operator([)integer(2)operator(,) integer(3)operator(,) integer(5)operator(,) integer(7)operator(,) integer(9)operator(]) -comment(// intersection) -keyword(assert) ident(a)operator(.)ident(intersect)operator(()ident(b)operator(\)) operator(==) operator([)integer(3)operator(,) integer(5)operator(,) integer(7)operator(]) -comment(// union) -keyword(assert) operator(()ident(a) operator(+) ident(b)operator(\))operator(.)ident(unique)operator(()operator(\))operator(.)ident(sort)operator(()operator(\)) operator(==) operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(5)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(]) -comment(// difference) -keyword(assert) operator(()ident(a) operator(-) ident(b)operator(\)) operator(==) operator([)integer(1)operator(,) integer(6)operator(,) integer(8)operator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.9) -comment(//----------------------------------------------------------------------------------) -ident(members) operator(=) operator([) stringoperator(,) string operator(]) -ident(initiates) operator(=) operator([) stringoperator(,) string operator(]) -ident(members) operator(+=) ident(initiates) -keyword(assert) ident(members) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - -ident(members)operator(.)ident(add)operator(()integer(2)operator(,) stringoperator(\)) -keyword(assert) ident(members) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - -ident(members)operator([)integer(0)operator(]) operator(=) string -ident(members)operator([)integer(3)operator(..)integer(4)operator(]) operator(=) operator([)stringoperator(,) stringoperator(]) -keyword(assert) ident(members) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.10) -comment(//----------------------------------------------------------------------------------) -ident(items) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -keyword(assert) ident(items)operator(.)ident(reverse)operator(()operator(\)) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - -ident(firstLetters) operator(=) type([]) -ident(items)operator(.)ident(reverseEach)operator({) ident(firstLetters) operator(+=) local_variable(it)operator([)integer(0)operator(]) operator(}) -keyword(assert) ident(firstLetters)operator(.)ident(join)operator(()operator(\)) operator(==) string - -ident(descending) operator(=) ident(items)operator(.)ident(sort)operator(()operator(\))operator(.)ident(reverse)operator(()operator(\)) -keyword(assert) ident(descending) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -ident(descendingBySecondLastLetter) operator(=) ident(items)operator(.)ident(sort) operator({) ident(a)operator(,)ident(b) operator(->) ident(b)operator([)operator(-)integer(2)operator(]) operator(<=>) ident(a)operator([)operator(-)integer(2)operator(]) operator(}) -keyword(assert) ident(descendingBySecondLastLetter) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.11) -comment(//----------------------------------------------------------------------------------) -comment(// warning: not an exact equivalent, idiomatic use would return copies) -keyword(def) ident(shift2) operator(=) operator({)ident(one) operator(=) ident(friends)operator([)integer(0)operator(])operator(;) ident(two) operator(=) ident(friends)operator([)integer(1)operator(])operator(;) integer(2)operator(.)ident(times)operator({)ident(friends)operator(.)ident(remove)operator(()integer(0)operator(\))operator(})operator(}) -ident(friends) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\)) -ident(shift2)operator(()operator(\)) -keyword(assert) ident(one) operator(==) string -keyword(assert) ident(two) operator(==) string -keyword(assert) ident(friends) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(]) - -keyword(def) method(pop2)operator(()ident(items)operator(\)) operator({) ident(items)operator([)integer(0)operator(..)integer(1)operator(]) operator(}) -ident(beverages) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\)) -ident(pair) operator(=) ident(pop2)operator(()ident(beverages)operator(\)) -keyword(assert) ident(pair) operator(==) operator([)stringoperator(,) stringoperator(]) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_4.12) -comment(//----------------------------------------------------------------------------------) -type(class) class(Employee) operator({) - keyword(def) ident(name) - keyword(def) ident(position) - keyword(def) ident(salary) -operator(}) -ident(staff) operator(=) operator([)keyword(new) ident(Employee)operator(()key(name)operator(:)stringoperator(,)key(position)operator(:)stringoperator(,)key(salary)operator(:)integer(26000)operator(\))operator(,) - keyword(new) ident(Employee)operator(()key(name)operator(:)stringoperator(,)key(position)operator(:)stringoperator(,)key(salary)operator(:)integer(24000)operator(\))operator(,) - keyword(new) ident(Employee)operator(()key(name)operator(:)stringoperator(,)key(position)operator(:)stringoperator(,)key(salary)operator(:)integer(22000)operator(\))operator(]) -ident(highestEngineer) operator(=) ident(staff)operator(.)ident(find) operator({) ident(emp) operator(->) ident(emp)operator(.)ident(position) operator(==) string operator(}) -keyword(assert) ident(highestEngineer)operator(.)ident(salary) operator(==) integer(24000) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.13) -comment(//----------------------------------------------------------------------------------) -ident(engineers) operator(=) ident(staff)operator(.)ident(findAll) operator({) ident(e) operator(->) ident(e)operator(.)ident(position) operator(==) string operator(}) -keyword(assert) ident(engineers)operator(.)ident(size)operator(()operator(\)) operator(==) integer(2) - -ident(highPaid) operator(=) ident(staff)operator(.)ident(findAll) operator({) ident(e) operator(->) ident(e)operator(.)ident(salary) operator(>) integer(23000) operator(}) -keyword(assert) ident(highPaid)operator(*.)ident(name) operator(==) operator([)stringoperator(,) stringoperator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.14) -comment(//----------------------------------------------------------------------------------) -comment(// sort works for numbers) -keyword(assert) operator([)integer(100)operator(,) integer(3)operator(,) integer(20)operator(])operator(.)ident(sort)operator(()operator(\)) operator(==) operator([)integer(3)operator(,) integer(20)operator(,) integer(100)operator(]) -comment(// strings representing numbers will be sorted alphabetically) -keyword(assert) operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(.)ident(sort)operator(()operator(\)) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(]) -comment(// closure style sorting allows arbitrary expressions for the comparison) -keyword(assert) operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(.)ident(sort)operator({) ident(a)operator(,)ident(b) operator(->) ident(a)operator(.)ident(toLong)operator(()operator(\)) operator(<=>) ident(b)operator(.)ident(toLong)operator(()operator(\))operator(}) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(]) - -comment(// obtain the following on unix systems using: 'ps ux'.execute(\).text) -ident(processInput) operator(=) string -ident(nonEmptyLines) operator(=) operator({)local_variable(it)operator(.)ident(trim)operator(()operator(\))operator(}) -ident(lines) operator(=) ident(processInput)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(findAll)operator(()ident(nonEmptyLines)operator(\))operator([)integer(1)operator(..)operator(-)integer(1)operator(]) -keyword(def) method(col)operator(()ident(n)operator(,) ident(s)operator(\)) operator({) ident(s)operator(.)ident(tokenize)operator(()operator(\))operator([)ident(n)operator(]) operator(}) -ident(commandIdx) operator(=) integer(7) -ident(pidIdx) operator(=) integer(0) -ident(ppidIdx) operator(=) integer(1) -ident(linesByPid) operator(=) ident(lines)operator(.)ident(sort)operator({) ident(col)operator(()ident(pidIdx)operator(,)local_variable(it)operator(\))operator(.)ident(toLong)operator(()operator(\)) operator(}) -keyword(assert) ident(col)operator(()ident(commandIdx)operator(,) ident(linesByPid)operator([)integer(0)operator(])operator(\)) operator(==) string -ident(linesByPpid) operator(=) ident(lines)operator(.)ident(sort)operator({) ident(col)operator(()ident(ppidIdx)operator(,)local_variable(it)operator(\))operator(.)ident(toLong)operator(()operator(\)) operator(}) -keyword(assert) ident(col)operator(()ident(commandIdx)operator(,) ident(linesByPpid)operator([)integer(0)operator(])operator(\)) operator(==) string -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.15) -comment(//----------------------------------------------------------------------------------) -comment(// sort staff from 4.12 by name) -keyword(assert) ident(staff)operator(.)ident(sort) operator({) ident(a)operator(,)ident(b) operator(->) ident(a)operator(.)ident(name) operator(<=>) ident(b)operator(.)ident(name) operator(})operator(*.)ident(name) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(]) -comment(// sort by first two characters of name and if equal by descending salary) -keyword(assert) ident(staff)operator(.)ident(sort) operator({) ident(a)operator(,)ident(b) operator(->) - ident(astart) operator(=) ident(a)operator(.)ident(name)operator([)integer(0)operator(..)integer(1)operator(]) - ident(bstart) operator(=) ident(b)operator(.)ident(name)operator([)integer(0)operator(..)integer(1)operator(]) - keyword(if) operator(()ident(astart) operator(==) ident(bstart)operator(\)) keyword(return) ident(b)operator(.)ident(salary) operator(<=>) ident(a)operator(.)ident(salary) - keyword(return) ident(astart) operator(<=>) ident(bstart) -operator(})operator(*.)ident(name) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.16) -comment(//----------------------------------------------------------------------------------) -ident(items) operator(=) operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(]) -ident(processed) operator(=) type([]) -integer(10)operator(.)ident(times)operator({) - ident(processed) operator(<)operator(<) ident(items)operator([)integer(0)operator(]) - ident(items) operator(=) ident(items)operator([)integer(1)operator(..)operator(-)integer(1)operator(]) operator(+) ident(items)operator([)integer(0)operator(]) -operator(}) -keyword(assert) ident(processed) operator(==) operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(,) integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.17) -comment(//----------------------------------------------------------------------------------) -keyword(import) include(java.text.DateFormatSymbols) keyword(as) class(Symbols) -ident(items) operator(=) keyword(new) ident(Symbols)operator(()operator(\))operator(.)ident(shortWeekdays)operator(.)ident(toList)operator(()operator(\))operator([)integer(1)operator(..)integer(7)operator(]) -keyword(assert) ident(items) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -comment(// not as random as you might expect) -ident(println) ident(items)operator(.)ident(sort)operator({) pre_type(Math)operator(.)ident(random)operator(()operator(\)) operator(}) -comment(// => ["Sat", "Tue", "Sun", "Wed", "Mon", "Thu", "Fri"]) -comment(// better to use the built-in method for this purpose) -pre_type(Collections)operator(.)ident(shuffle)operator(()ident(items)operator(\)) -ident(println) ident(items) -comment(// => ["Wed", "Tue", "Fri", "Sun", "Sat", "Thu", "Mon"]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.18) -comment(//----------------------------------------------------------------------------------) -ident(symbols) operator(=) keyword(new) ident(Symbols)operator(()operator(\)) -ident(words) operator(=) ident(symbols)operator(.)ident(weekdays)operator(.)ident(toList)operator(()operator(\))operator([)integer(1)operator(..)integer(7)operator(]) operator(+) - ident(symbols)operator(.)ident(months)operator(.)ident(toList)operator(()operator(\))operator([)integer(0)operator(..)integer(11)operator(]) operator(+) - ident(symbols)operator(.)ident(eras)operator(.)ident(toList)operator(()operator(\)) operator(+) - ident(symbols)operator(.)ident(amPmStrings)operator(.)ident(toList)operator(()operator(\)) - -ident(expected) operator(=) comment(//) -string operator(+) -string operator(+) -string - -type(class) class(WordFormatter) operator({) - keyword(def) ident(cols) - - keyword(def) method(process)operator(()ident(list)operator(\)) operator({) - keyword(def) ident(sb) operator(=) keyword(new) pre_type(StringBuffer)operator(()operator(\)) - keyword(def) ident(colWidth) operator(=) ident(list)operator(.)ident(max)operator({)local_variable(it)operator(.)ident(size)operator(()operator(\))operator(})operator(.)ident(size)operator(()operator(\)) operator(+) integer(1) - type(int) ident(columns) operator(=) operator([)ident(cols)operator(/)ident(colWidth)operator(,) integer(1)operator(])operator(.)ident(max)operator(()operator(\)) - keyword(def) ident(numWords) operator(=) ident(list)operator(.)ident(size)operator(()operator(\)) - type(int) ident(rows) operator(=) operator(()ident(numWords) operator(+) ident(columns) operator(-) integer(1)operator(\)) operator(/) ident(columns) - keyword(for) operator(()ident(row) keyword(in) integer(0)operator(..<)ident(rows)operator(\)) operator({) - keyword(for) operator(()ident(col) keyword(in) integer(0)operator(..<)ident(columns)operator(\)) operator({) - keyword(def) ident(target) operator(=) ident(row) operator(+) ident(col) operator(*) ident(rows) - keyword(if) operator(()ident(target) operator(<) ident(numWords)operator(\)) - ident(sb) operator(<)operator(<) ident(list)operator([)ident(target)operator(])operator(.)ident(padRight)operator(()ident(colWidth)operator(\)) - operator(}) - ident(sb) operator(<)operator(<) string - operator(}) - keyword(return) ident(sb)operator(.)ident(toString)operator(()operator(\)) - operator(}) -operator(}) - -comment(// get nr of chars that fit in window or console, see PLEAC 15.4) -comment(// hard-coded here but several packages are available, e.g. in JLine) -comment(// use a concrete implementation of Terminal.getTerminalWidth(\)) -keyword(def) method(getWinCharWidth)operator(()operator(\)) operator({) integer(80) operator(}) - -comment(// main script) -ident(actual) operator(=) keyword(new) ident(WordFormatter)operator(()key(cols)operator(:)ident(getWinCharWidth)operator(()operator(\))operator(\))operator(.)ident(process)operator(()ident(words)operator(.)ident(sort)operator(()operator(\))operator(\)) -keyword(assert) ident(actual) operator(==) ident(expected) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_4.19) -comment(//----------------------------------------------------------------------------------) -comment(// recursive version is simplest but can be inefficient) -keyword(def) method(fact)operator(()ident(n)operator(\)) operator({) operator(()ident(n) operator(==) integer(1)operator(\)) operator(?) integer(1) operator(:) ident(n) operator(*) ident(fact)operator(()ident(n)operator(-)integer(1)operator(\))operator(}) -keyword(assert) ident(fact)operator(()integer(10)operator(\)) operator(==) integer(3628800) -comment(// unwrapped version: note use of BigInteger) -keyword(def) method(factorial)operator(()ident(n)operator(\)) operator({) - keyword(def) ident(result) operator(=) integer(1G) comment(// 1 as BigInteger) - keyword(while) operator(()ident(n) operator(>) integer(0)operator(\)) operator({) - ident(result) operator(*=) ident(n) - ident(n) operator(-=) integer(1) - operator(}) - keyword(return) ident(result) -operator(}) -ident(expected) operator(=) integer(93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000) -keyword(assert) ident(expected) operator(==) ident(factorial)operator(()integer(100)operator(\)) -comment(// println factorial(10000\)) -comment(// => 284625... (greater than 35,000 digits\)) - -comment(// simple version but less efficient) -keyword(def) method(simplePermute)operator(()ident(items)operator(,) ident(perms)operator(\)) operator({) - keyword(if) operator(()ident(items)operator(.)ident(size)operator(()operator(\)) operator(==) integer(0)operator(\)) - ident(println) ident(perms)operator(.)ident(join)operator(()stringoperator(\)) - keyword(else) - keyword(for) operator(()ident(i) keyword(in) ident(items)operator(\)) operator({) - ident(newitems) operator(=) ident(items)operator(.)ident(clone)operator(()operator(\)) - ident(newperms) operator(=) ident(perms)operator(.)ident(clone)operator(()operator(\)) - ident(newperms)operator(.)ident(add)operator(()ident(i)operator(\)) - ident(newitems)operator(.)ident(remove)operator(()ident(i)operator(\)) - ident(simplePermute)operator(()ident(newitems)operator(,) ident(newperms)operator(\)) - operator(}) -operator(}) -ident(simplePermute)operator(()operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) type([])operator(\)) -comment(// =>) -comment(//dog bites man) -comment(//dog man bites) -comment(//bites dog man) -comment(//bites man dog) -comment(//man dog bites) -comment(//man bites dog) - -comment(// optimised version below) -ident(expected) operator(=) string - -comment(// n2pat(n, len\): produce the N-th pattern of length len) -keyword(def) method(n2pat)operator(()ident(n)operator(,) ident(length)operator(\)) operator({) - keyword(def) ident(pat) operator(=) type([]) - type(int) ident(i) operator(=) integer(1) - keyword(while) operator(()ident(i) operator(<=) ident(length)operator(\)) operator({) - ident(pat) operator(<)operator(<) operator(()ident(n) operator(%) ident(i)operator(\)) - ident(n) operator(=) ident(n)operator(.)ident(intdiv)operator(()ident(i)operator(\)) - ident(i) operator(+=) integer(1) - operator(}) - ident(pat) -operator(}) - -comment(// pat2perm(pat\): turn pattern returned by n2pat(\) into) -comment(// permutation of integers.) -keyword(def) method(pat2perm)operator(()ident(pat)operator(\)) operator({) - keyword(def) ident(source) operator(=) operator(()integer(0) operator(..<) ident(pat)operator(.)ident(size)operator(()operator(\))operator(\))operator(.)ident(collect)operator({) local_variable(it)comment(/*.toString(\)*/) operator(}) - keyword(def) ident(perm) operator(=) type([]) - keyword(while) operator(()ident(pat)operator(.)ident(size)operator(()operator(\)) operator(>) integer(0)operator(\)) operator({) - keyword(def) ident(next) operator(=) ident(pat)operator(.)ident(remove)operator(()ident(pat)operator(.)ident(size)operator(()operator(\))operator(-)integer(1)operator(\)) - ident(perm) operator(<)operator(<) ident(source)operator([)ident(next)operator(]) - ident(source)operator(.)ident(remove)operator(()ident(next)operator(\)) - operator(}) - ident(perm) -operator(}) - -keyword(def) method(n2perm)operator(()ident(n)operator(,) ident(len)operator(\)) operator({) - ident(pat2perm)operator(()ident(n2pat)operator(()operator(()type(int)operator(\))ident(n)operator(,)ident(len)operator(\))operator(\)) -operator(}) - -ident(data) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) -ident(sb) operator(=) keyword(new) pre_type(StringBuffer)operator(()operator(\)) -ident(numPermutations) operator(=) ident(fact)operator(()ident(data)operator(.)ident(size)operator(()operator(\))operator(\)) -keyword(for) operator(()ident(j) keyword(in) integer(0)operator(..<)ident(numPermutations)operator(\)) operator({) - keyword(def) ident(permutation) operator(=) ident(n2perm)operator(()ident(j)operator(,) ident(data)operator(.)ident(size)operator(()operator(\))operator(\))operator(.)ident(collect) operator({) ident(k) operator(->) ident(data)operator([)ident(k)operator(]) operator(}) - ident(sb) operator(<)operator(<) ident(permutation)operator(.)ident(join)operator(()stringoperator(\)) operator(+) string -operator(}) -keyword(assert) string operator(+) ident(sb)operator(.)ident(toString)operator(()operator(\)) operator(==) ident(expected) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.0) -comment(//----------------------------------------------------------------------------------) -comment(// quotes are optional around the key) -ident(age) operator(=) operator([) key(Nat)operator(:)integer(24)operator(,) key(Jules)operator(:)integer(25)operator(,) key(Josh)operator(:)integer(17) operator(]) - -keyword(assert) ident(age)operator([)stringoperator(]) operator(==) integer(24) -comment(// alternate syntax) -keyword(assert) ident(age)operator(.)string operator(==) integer(25) - -ident(foodColor) operator(=) operator([) - key(Apple)operator(:) stringoperator(,) - key(Banana)operator(:) stringoperator(,) - key(Lemon)operator(:) stringoperator(,) - key(Carrot)operator(:) string -operator(]) -keyword(assert) ident(foodColor)operator(.)ident(size)operator(()operator(\)) operator(==) integer(4) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.1) -comment(//----------------------------------------------------------------------------------) -ident(foodColor)operator([)stringoperator(]) operator(=) string -keyword(assert) ident(foodColor)operator(.)ident(size)operator(()operator(\)) operator(==) integer(4) -keyword(assert) ident(foodColor)operator([)stringoperator(]) operator(==) string -ident(foodColor)operator([)stringoperator(]) operator(=) string -keyword(assert) ident(foodColor)operator(.)ident(size)operator(()operator(\)) operator(==) integer(5) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.2) -comment(//----------------------------------------------------------------------------------) -keyword(assert) operator([)stringoperator(,) stringoperator(])operator(.)ident(collect)operator({) ident(foodColor)operator(.)ident(containsKey)operator(()local_variable(it)operator(\))operator(?)stringoperator(:)string operator(}) operator(==) operator([) stringoperator(,) string operator(]) - -ident(age) operator(=) operator([)key(Toddler)operator(:)integer(3)operator(,) key(Unborn)operator(:)integer(0)operator(,) key(Phantasm)operator(:)pre_constant(null)operator(]) -operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(.)ident(each)operator({) ident(key) operator(->) - ident(print) stringcontent(: )delimiter(")> - keyword(if) operator(()ident(age)operator(.)ident(containsKey)operator(()ident(key)operator(\))operator(\)) ident(print) string - keyword(if) operator(()ident(age)operator(.)ident(containsKey)operator(()ident(key)operator(\)) operator(&&) ident(age)operator([)ident(key)operator(])operator(!=)pre_constant(null)operator(\)) ident(print) string - keyword(if) operator(()ident(age)operator(.)ident(containsKey)operator(()ident(key)operator(\)) operator(&&) ident(age)operator([)ident(key)operator(])operator(\)) ident(print) string - ident(println) string -operator(}) -comment(// =>) -comment(// Toddler: has key non-null true) -comment(// Unborn: has key non-null) -comment(// Phantasm: has key) -comment(// Relic:) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.3) -comment(//----------------------------------------------------------------------------------) -keyword(assert) ident(foodColor)operator(.)ident(size)operator(()operator(\)) operator(==) integer(5) -ident(foodColor)operator(.)ident(remove)operator(()stringoperator(\)) -keyword(assert) ident(foodColor)operator(.)ident(size)operator(()operator(\)) operator(==) integer(4) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.4) -comment(//----------------------------------------------------------------------------------) -ident(hash) operator(=) operator([)operator(:)operator(]) -ident(hash)operator(.)ident(each) operator({) ident(key)operator(,) ident(value) operator(->) - comment(// do something with key and value) -operator(}) - -ident(hash)operator(.)ident(each) operator({) ident(entry) operator(->) - comment(// do something with entry) -operator(}) - -ident(hash)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(each) operator({) ident(key) operator(->) - comment(// do something with key) -operator(}) - -ident(sb) operator(=) keyword(new) pre_type(StringBuffer)operator(()operator(\)) -ident(foodColor)operator(.)ident(each) operator({) ident(food)operator(,) ident(color) operator(->) - ident(sb) operator(<)operator(<) stringcontent( is )inlinechar(\\n)delimiter(")> -operator(}) -keyword(assert) string operator(+) ident(sb)operator(.)ident(toString)operator(()operator(\)) operator(==) string - -ident(foodColor)operator(.)ident(each) operator({) ident(entry) operator(->) - keyword(assert) ident(entry)operator(.)ident(key)operator(.)ident(size)operator(()operator(\)) operator(>) integer(4) operator(&&) ident(entry)operator(.)ident(value)operator(.)ident(size)operator(()operator(\)) operator(>) integer(2) -operator(}) - -ident(foodColorsSortedByFood) operator(=) type([]) -ident(foodColor)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(sort)operator(()operator(\))operator(.)ident(each) operator({) ident(k) operator(->) ident(foodColorsSortedByFood) operator(<)operator(<) ident(foodColor)operator([)ident(k)operator(]) operator(}) -keyword(assert) ident(foodColorsSortedByFood) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - -ident(fakedInput) operator(=) string - -ident(from) operator(=) operator([)operator(:)operator(]) -ident(fakedInput)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each)operator({) - ident(matcher) operator(=) operator(()local_variable(it) operator(=~) regexp]*\))delimiter(/)>operator(\)) - keyword(if) operator(()ident(matcher)operator(.)ident(matches)operator(()operator(\))operator(\)) operator({) - ident(sender) operator(=) ident(matcher)operator([)integer(0)operator(])operator([)integer(1)operator(]) - keyword(if) operator(()ident(from)operator(.)ident(containsKey)operator(()ident(sender)operator(\))operator(\)) ident(from)operator([)ident(sender)operator(]) operator(+=) integer(1) - keyword(else) ident(from)operator([)ident(sender)operator(]) operator(=) integer(1) - operator(}) -operator(}) - -comment(// More useful to sort by number of received mail by person) -ident(from)operator(.)ident(entrySet)operator(()operator(\))operator(.)ident(sort) operator({) ident(a)operator(,)ident(b) operator(->) ident(b)operator(.)ident(value)operator(<=>)ident(a)operator(.)ident(value)operator(})operator(.)ident(each) operator({) ident(e)operator(->) - ident(println) stringcontent(: )inlinedelimiter(")> -operator(}) -comment(// =>) -comment(// someone@somewhere.com: 2) -comment(// someone@spam.com: 1) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.5) -comment(//----------------------------------------------------------------------------------) -ident(hash) operator(=) operator([)key(a)operator(:)integer(1)operator(,) key(b)operator(:)integer(2)operator(,) key(c)operator(:)integer(3)operator(]) -comment(// Map#toString already produce a pretty decent output:) -ident(println) ident(hash) -comment(// => ["b":2, "a":1, "c":3]) - -comment(// Or do it by longhand for customised formatting) -ident(hash)operator(.)ident(each) operator({) ident(k)operator(,)ident(v) operator(->) ident(println) stringcontent( => )inlinedelimiter(")> operator(}) -comment(// =>) -comment(// b => 2) -comment(// a => 1) -comment(// c => 3) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.6) -comment(//----------------------------------------------------------------------------------) -comment(// java.util.LinkedHashMap "maintains a doubly-linked list running through all of its entries.) -comment(// This linked list defines the iteration ordering, which is normally the order in which keys) -comment(// were inserted into the map (insertion-order\)".) -ident(foodColor) operator(=) keyword(new) pre_type(LinkedHashMap)operator(()operator(\)) -ident(foodColor)operator([)stringoperator(]) operator(=) string -ident(foodColor)operator([)stringoperator(]) operator(=) string -ident(foodColor)operator([)stringoperator(]) operator(=) string - -ident(foodColor)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(each)operator({) ident(key) operator(->) ident(println) ident(key) operator(}) -comment(// =>) -comment(// Banana) -comment(// Apple) -comment(// Lemon) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.7) -comment(//----------------------------------------------------------------------------------) -ident(foodsOfColor) operator(=) operator([) key(Yellow)operator(:)operator([)stringoperator(,) stringoperator(])operator(,) key(Green)operator(:)operator([)stringoperator(]) operator(]) -ident(foodsOfColor)operator([)stringoperator(]) operator(+=) string -keyword(assert) ident(foodsOfColor) operator(==) operator([)stringoperator(:)operator([)stringoperator(,) stringoperator(])operator(,) stringoperator(:)operator([)stringoperator(,) stringoperator(])operator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.8) -comment(//----------------------------------------------------------------------------------) -ident(surname) operator(=) operator([)key(Mickey)operator(:) stringoperator(,) key(Babe)operator(:) stringoperator(]) -keyword(assert) ident(surname)operator(.)ident(findAll)operator({) local_variable(it)operator(.)ident(value) operator(==) string operator(})operator(.)ident(collect)operator({) local_variable(it)operator(.)ident(key) operator(}) operator(==) operator([)stringoperator(]) - -ident(firstname) operator(=) operator([)operator(:)operator(]) -ident(surname)operator(.)ident(each)operator({) ident(entry) operator(->) ident(firstname)operator([)ident(entry)operator(.)ident(value)operator(]) operator(=) ident(entry)operator(.)ident(key) operator(}) -keyword(assert) ident(firstname) operator(==) operator([)stringoperator(:)stringoperator(,) stringoperator(:)stringoperator(]) - -comment(// foodfindScript:) -doctype(#!/usr/bin/groovy) -comment(// usage: foodfind food_or_color") -ident(color) operator(=) operator([)key(Apple)operator(:)stringoperator(,) key(Banana)operator(:)stringoperator(,) key(Lemon)operator(:)stringoperator(,) key(Carrot)operator(:)stringoperator(]) -ident(given) operator(=) ident(args)operator([)integer(0)operator(]) -keyword(if) operator(()ident(color)operator(.)ident(containsKey)operator(()ident(given)operator(\))operator(\)) - ident(println) stringcontent( is a food with color )inlinecontent(.)delimiter(")> -ident(if) operator(()ident(color)operator(.)ident(containsValue)operator(()ident(given)operator(\))operator(\)) operator({) - comment(// could use commify(\) here - see 4.2) - ident(foods) operator(=) ident(color)operator(.)ident(findAll)operator({)local_variable(it)operator(.)ident(value) operator(==) ident(given)operator(})operator(.)ident(collect)operator({)local_variable(it)operator(.)ident(key)operator(}) - ident(join) operator(=) ident(foods)operator(.)ident(size)operator(()operator(\)) operator(==) integer(1) operator(?) string operator(:) string - ident(println) stringoperator(\))inline_delimiter(})>content( )inlinecontent( with color )inlinecontent(.)delimiter(")> -operator(}) -comment(// foodfind red) -comment(// => Apple is a food with color red.) -comment(// foodfind yellow) -comment(// => Lemon, Banana are foods with color yellow.) -comment(// foodfind Carrot) -comment(// => Carrot is a food with color orange.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.9) -comment(//----------------------------------------------------------------------------------) -ident(foodColor) operator(=) operator([)key(Apple)operator(:)stringoperator(,) key(Carrot)operator(:)stringoperator(,) key(Banana)operator(:)stringoperator(,) key(Cherry)operator(:)stringoperator(]) - -comment(// Sorted by keys) -keyword(assert) ident(foodColor)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(sort)operator(()operator(\)) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -comment(// you could now iterate through the hash with the sorted keys) -keyword(assert) ident(foodColor)operator(.)ident(values)operator(()operator(\))operator(.)ident(sort)operator(()operator(\)) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -keyword(assert) ident(foodColor)operator(.)ident(values)operator(()operator(\))operator(.)ident(sort)operator({)local_variable(it)operator(.)ident(size)operator(()operator(\))operator(}) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.10) -comment(//----------------------------------------------------------------------------------) -comment(//merged = a.clone.update(b\) # because Hash#update changes object in place) - -ident(drinkColor) operator(=) operator([)key(Galliano)operator(:)stringoperator(,) stringoperator(:)stringoperator(]) -ident(ingestedColor) operator(=) operator([)operator(:)operator(]) -ident(ingestedColor)operator(.)ident(putAll)operator(()ident(drinkColor)operator(\)) -comment(// overrides any common keys) -ident(ingestedColor)operator(.)ident(putAll)operator(()ident(foodColor)operator(\)) - -ident(totalColors) operator(=) ident(ingestedColor)operator(.)ident(values)operator(()operator(\))operator(.)ident(sort)operator(()operator(\))operator(.)ident(unique)operator(()operator(\)) -keyword(assert) ident(totalColors) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.11) -comment(//----------------------------------------------------------------------------------) -ident(foodColor)operator([)stringoperator(])operator(=)string -ident(citrusColor) operator(=) operator([)key(Lemon)operator(:)stringoperator(,) key(Orange)operator(:)stringoperator(,) key(Lime)operator(:)stringoperator(]) -ident(println) ident(foodColor) -ident(println) ident(citrusColor) -ident(common) operator(=) ident(foodColor)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(intersect)operator(()ident(citrusColor)operator(.)ident(keySet)operator(()operator(\))operator(\)) -keyword(assert) ident(common) operator(==) operator([)stringoperator(]) - -ident(foodButNotCitrus) operator(=) ident(foodColor)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(toList)operator(()operator(\)) operator(-) ident(citrusColor)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(toList)operator(()operator(\)) -keyword(assert) ident(foodButNotCitrus) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.12) -comment(//----------------------------------------------------------------------------------) -comment(// no problem here, Groovy handles any kind of object for key-ing) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.13) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy uses Java implementations for storing hashes and these) -comment(// support setting an initial capacity and load factor (which determines) -comment(// at what point the hash will be resized if needed\)) -ident(hash) operator(=) operator([)operator(:)operator(]) comment(// Groovy shorthand gets defaults) -ident(hash) operator(=) keyword(new) pre_type(HashMap)operator(()operator(\)) comment(// default capacity and load factor) -ident(println) ident(hash)operator(.)ident(capacity)operator(()operator(\)) -comment(// => 16) -operator(()stringoperator(..)stringoperator(\))operator(.)ident(each)operator({) ident(hash)operator([)local_variable(it)operator(]) operator(=) local_variable(it) operator(}) -ident(println) ident(hash)operator(.)ident(capacity)operator(()operator(\)) -comment(// => 64) -ident(hash) operator(=) keyword(new) pre_type(HashMap)operator(()integer(100)operator(\)) comment(// initial capacity of 100 and default load factor) -ident(hash) operator(=) keyword(new) pre_type(HashMap)operator(()integer(100)operator(,) float(0.8f)operator(\)) comment(// initial capacity of 100 and 0.8 load factor) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.14) -comment(//----------------------------------------------------------------------------------) -ident(count) operator(=) operator([)operator(:)operator(]) -ident(letters) operator(=) type([]) -ident(foodColor)operator(.)ident(values)operator(()operator(\))operator(.)ident(each)operator({) ident(letters)operator(.)ident(addAll)operator(()operator(()local_variable(it) keyword(as) pre_type(String)type([])operator(\))operator(.)ident(toList)operator(()operator(\))operator(\)) operator(}) -ident(letters)operator(.)ident(each)operator({) keyword(if) operator(()ident(count)operator(.)ident(containsKey)operator(()local_variable(it)operator(\))operator(\)) ident(count)operator([)local_variable(it)operator(]) operator(+=) integer(1) keyword(else) ident(count)operator([)local_variable(it)operator(]) operator(=) integer(1) operator(}) -keyword(assert) ident(count) operator(==) operator([)stringoperator(:)integer(3)operator(,) stringoperator(:)integer(1)operator(,) stringoperator(:)integer(1)operator(,) stringoperator(:)integer(2)operator(,) stringoperator(:)integer(2)operator(,) stringoperator(:)integer(1)operator(,) stringoperator(:)integer(5)operator(,) stringoperator(:)integer(1)operator(,) stringoperator(:)integer(1)operator(,) stringoperator(:)integer(2)operator(,) stringoperator(:)integer(2)operator(,) stringoperator(:)integer(1)operator(,) stringoperator(:)integer(4)operator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.15) -comment(//----------------------------------------------------------------------------------) -ident(father) operator(=) operator([) - key(Cain)operator(:)stringoperator(,) - key(Abel)operator(:)stringoperator(,) - key(Seth)operator(:)stringoperator(,) - key(Enoch)operator(:)stringoperator(,) - key(Irad)operator(:)stringoperator(,) - key(Mehujael)operator(:)stringoperator(,) - key(Methusael)operator(:)stringoperator(,) - key(Lamech)operator(:)stringoperator(,) - key(Jabal)operator(:)stringoperator(,) - key(Jubal)operator(:)stringoperator(,) - key(Tubalcain)operator(:)stringoperator(,) - key(Enos)operator(:)string -operator(]) - -keyword(def) method(upline)operator(()ident(person)operator(\)) operator({) - keyword(while) operator(()ident(father)operator(.)ident(containsKey)operator(()ident(person)operator(\))operator(\)) operator({) - ident(print) ident(person) operator(+) string - ident(person) operator(=) ident(father)operator([)ident(person)operator(]) - operator(}) - ident(println) ident(person) -operator(}) - -ident(upline)operator(()stringoperator(\)) -comment(// => Irad Enoch Cain Adam) - -ident(children) operator(=) operator([)operator(:)operator(]) -ident(father)operator(.)ident(each) operator({) ident(k)operator(,)ident(v) operator(->) - keyword(if) operator(()operator(!)ident(children)operator(.)ident(containsKey)operator(()ident(v)operator(\))operator(\)) ident(children)operator([)ident(v)operator(]) operator(=) type([]) - ident(children)operator([)ident(v)operator(]) operator(+=) ident(k) -operator(}) -keyword(def) method(downline)operator(()ident(person)operator(\)) operator({) - ident(println) stringcontent( begat )inlineoperator(\))operator(:)stringinline_delimiter(})>content(.)char(\\n)delimiter(")> -operator(}) -ident(downline)operator(()stringoperator(\)) -comment(// => Tubalcain begat Nobody.) -ident(downline)operator(()stringoperator(\)) -comment(// => Adam begat Abel, Seth, Cain.) - -comment(// This one doesn't recurse through subdirectories (as a simplification\)) -comment(// scriptToFindIncludeFilesWhichContainNoIncludesScript:) -ident(dir) operator(=) string)delimiter(')> -ident(includes) operator(=) operator([)operator(:)operator(]) -keyword(new) pre_type(File)operator(()ident(dir)operator(\))operator(.)ident(eachFile)operator({) ident(file) operator(->) - keyword(if) operator(()ident(file)operator(.)ident(directory)operator(\)) keyword(return) - ident(file)operator(.)ident(eachLine)operator({) ident(line) operator(->) - ident(matcher) operator(=) operator(()ident(line) operator(=~) string]+\)>)delimiter(')>operator(\)) - keyword(if) operator(()ident(matcher)operator(.)ident(matches)operator(()operator(\))operator(\)) operator({) - keyword(if) operator(()operator(!)ident(includes)operator(.)ident(containsKey)operator(()ident(file)operator(.)ident(name)operator(\))operator(\)) ident(includes)operator([)ident(file)operator(.)ident(name)operator(]) operator(=) type([]) - ident(includes)operator([)ident(file)operator(.)ident(name)operator(]) operator(+=) ident(matcher)operator([)integer(0)operator(])operator([)integer(1)operator(]) - operator(}) - operator(}) -operator(}) -comment(// find referenced files which have no includes; assumes all files) -comment(// were processed and none are missing) -ident(println) ident(includes)operator(.)ident(values)operator(()operator(\))operator(.)ident(sort)operator(()operator(\))operator(.)ident(flatten)operator(()operator(\))operator(.)ident(unique)operator(()operator(\)) operator(-) ident(includes)operator(.)ident(keySet)operator(()operator(\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_5.16) -comment(//----------------------------------------------------------------------------------) -comment(// dutree - print sorted indented rendition of du output) -comment(// obtaining this input is not shown, it is similar to other examples) -comment(// on some unix systems it will be: duProcessFakedInput = "du options".process(\).text) -ident(duProcessFakedInput) operator(=) string - -comment(// The DuNode class collects all information about a directory,) -type(class) class(DuNode) operator({) - keyword(def) ident(name) - keyword(def) ident(size) - keyword(def) ident(kids) operator(=) type([]) - - comment(// support for sorting nodes with side) - keyword(def) method(compareTo)operator(()ident(node2)operator(\)) operator({) ident(size) operator(<=>) ident(node2)operator(.)ident(size) operator(}) - - keyword(def) method(getBasename)operator(()operator(\)) operator({) - ident(name)operator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\)) - operator(}) - - comment(// returns substring before last "/", otherwise null) - keyword(def) method(getParent)operator(()operator(\)) operator({) - keyword(def) ident(p) operator(=) ident(name)operator(.)ident(replaceAll)operator(()regexpoperator(,)stringoperator(\)) - keyword(return) operator(()ident(p) operator(==) ident(name)operator(\)) operator(?) pre_constant(null) operator(:) ident(p) - operator(}) -operator(}) - -comment(// The DuTree does the actual work of) -comment(// getting the input, parsing it, building up a tree) -comment(// and formatting it for output) -type(class) class(DuTree) operator({) - keyword(def) ident(input) - keyword(def) ident(topdir) - keyword(def) ident(nodes) operator(=) operator([)operator(:)operator(]) - keyword(def) ident(dirsizes) operator(=) operator([)operator(:)operator(]) - keyword(def) ident(kids) operator(=) operator([)operator(:)operator(]) - - comment(// get a node by name, create it if it does not exist yet) - keyword(def) method(getOrCreateNode)operator(()ident(name)operator(\)) operator({) - keyword(if) operator(()operator(!)ident(nodes)operator(.)ident(containsKey)operator(()ident(name)operator(\))operator(\)) - ident(nodes)operator([)ident(name)operator(]) operator(=) keyword(new) ident(DuNode)operator(()key(name)operator(:)ident(name)operator(\)) - keyword(return) ident(nodes)operator([)ident(name)operator(]) - operator(}) - - comment(// figure out how much is taken in each directory) - comment(// that isn't stored in the subdirectories. Add a new) - comment(// fake kid called "." containing that much.) - keyword(def) method(getDots)operator(()ident(node)operator(\)) operator({) - keyword(def) ident(cursize) operator(=) ident(node)operator(.)ident(size) - keyword(for) operator(()ident(kid) keyword(in) ident(node)operator(.)ident(kids)operator(\)) operator({) - ident(cursize) operator(-=) ident(kid)operator(.)ident(size) - ident(getDots)operator(()ident(kid)operator(\)) - operator(}) - keyword(if) operator(()ident(node)operator(.)ident(size) operator(!=) ident(cursize)operator(\)) operator({) - keyword(def) ident(newnode) operator(=) ident(getOrCreateNode)operator(()ident(node)operator(.)ident(name) operator(+) stringoperator(\)) - ident(newnode)operator(.)ident(size) operator(=) ident(cursize) - ident(node)operator(.)ident(kids) operator(+=) ident(newnode) - operator(}) - operator(}) - - keyword(def) method(processInput)operator(()operator(\)) operator({) - keyword(def) ident(name) operator(=) string - ident(input)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(findAll)operator({)local_variable(it)operator(.)ident(trim)operator(()operator(\))operator(})operator(.)ident(each)operator({) ident(line) operator(->) - keyword(def) ident(tokens) operator(=) ident(line)operator(.)ident(tokenize)operator(()operator(\)) - keyword(def) ident(size) operator(=) ident(tokens)operator([)integer(0)operator(]) - ident(name) operator(=) ident(tokens)operator([)integer(1)operator(]) - keyword(def) ident(node) operator(=) ident(getOrCreateNode)operator(()ident(name)operator(\)) - ident(node)operator(.)ident(size) operator(=) ident(size)operator(.)ident(toInteger)operator(()operator(\)) - ident(nodes)operator([)ident(name)operator(]) operator(=) ident(node) - keyword(def) ident(parent) operator(=) ident(node)operator(.)ident(parent) - keyword(if) operator(()ident(parent)operator(\)) - ident(getOrCreateNode)operator(()ident(parent)operator(\))operator(.)ident(kids) operator(<)operator(<) ident(node) - operator(}) - ident(topdir) operator(=) ident(nodes)operator([)ident(name)operator(]) - operator(}) - - comment(// recursively output everything) - comment(// passing padding and number width as well) - comment(// on recursive calls) - keyword(def) method(output)operator(()ident(node)operator(,) ident(prefix)operator(=)stringoperator(,) ident(width)operator(=)integer(0)operator(\)) operator({) - keyword(def) ident(line) operator(=) ident(node)operator(.)ident(size)operator(.)ident(toString)operator(()operator(\))operator(.)ident(padRight)operator(()ident(width)operator(\)) operator(+) string operator(+) ident(node)operator(.)ident(basename) - ident(println) operator(()ident(prefix) operator(+) ident(line)operator(\)) - ident(prefix) operator(+=) ident(line)operator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\)) - ident(prefix) operator(=) ident(prefix)operator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\)) - keyword(if) operator(()ident(node)operator(.)ident(kids)operator(.)ident(size)operator(()operator(\)) operator(>) integer(0)operator(\)) operator({) comment(// not a bachelor node) - ident(kids) operator(=) ident(node)operator(.)ident(kids) - ident(kids)operator(.)ident(sort)operator({) ident(a)operator(,)ident(b) operator(->) ident(b)operator(.)ident(compareTo)operator(()ident(a)operator(\)) operator(}) - ident(width) operator(=) ident(kids)operator([)integer(0)operator(])operator(.)ident(size)operator(.)ident(toString)operator(()operator(\))operator(.)ident(size)operator(()operator(\)) - keyword(for) operator(()ident(kid) keyword(in) ident(kids)operator(\)) ident(output)operator(()ident(kid)operator(,) ident(prefix)operator(,) ident(width)operator(\)) - operator(}) - operator(}) -operator(}) - -ident(tree) operator(=) keyword(new) ident(DuTree)operator(()key(input)operator(:)ident(duProcessFakedInput)operator(\)) -ident(tree)operator(.)ident(processInput)operator(()operator(\)) -ident(tree)operator(.)ident(getDots)operator(()ident(tree)operator(.)ident(topdir)operator(\)) -ident(tree)operator(.)ident(output)operator(()ident(tree)operator(.)ident(topdir)operator(\)) -comment(// =>) -comment(// 11966 groovysoap) -comment(// | 11732 lib) -comment(// | 202 src) -comment(// | | 102 test) -comment(// | | 77 main) -comment(// | | | 74 groovy) -comment(// | | | | 71 net) -comment(// | | | | | 68 soap) -comment(// | | | | | 3 .) -comment(// | | | | 3 .) -comment(// | | | 3 .) -comment(// | | 14 .) -comment(// | | 9 examples) -comment(// | | | 8 groovy) -comment(// | | | 1 .) -comment(// | 32 .) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_6.0) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy has built-in language support for Regular Expressions:) -comment(// * Strings quoted with '/' characters have special escaping) -comment(// rules for backslashes and the like.) -comment(// * ~string (regex pattern operator\)) -comment(// * m =~ /pattern/ (regex find operator\)) -comment(// * m ==~/pattern/ (regex match operator\)) -comment(// * patterns can be used in case expressions in a switch statement) -comment(// * string.replaceAll can take a closure expression as the second argument) -comment(// In addition, Groovy can make use of Java's Pattern, Matcher and Scanner classes) -comment(// directly. (The sugar coating metnioed above sits on top of these anyway\).) -comment(// There are also additional open source Java regex libraries which can be used.) - -ident(meadow1) operator(=) string -ident(meadow2) operator(=) string -comment(// pattern strings can benefit from 'slashy' quotes) -ident(partial) operator(=) regexp -ident(full) operator(=) regexp - -comment(// find operator) -keyword(assert) operator(!)operator(()ident(meadow1) operator(=~) ident(partial)operator(\)) -keyword(assert) ident(meadow2) operator(=~) ident(partial) -ident(finder) operator(=) operator(()ident(meadow2) operator(=~) ident(partial)operator(\)) -comment(// underneath Groovy sugar coating is Java implementation) -keyword(assert) ident(finder) keyword(instanceof) ident(java)operator(.)ident(util)operator(.)ident(regex)operator(.)ident(Matcher) - -comment(// match operator) -keyword(assert) operator(!)operator(()ident(meadow1) operator(==~) ident(full)operator(\)) -keyword(assert) ident(meadow2) operator(==~) ident(full) -ident(matcher) operator(=) operator(()ident(meadow2) operator(==~) ident(full)operator(\)) -comment(// under the covers is just a boolean) -keyword(assert) ident(matcher) keyword(instanceof) pre_type(Boolean) - -keyword(assert) ident(meadow1) operator(=~) regexp comment(// (?i\) == case flag) - -ident(string) operator(=) string -ident(println) ident(string)operator(.)ident(replaceFirst)operator(()regexpoperator(,) stringoperator(\)) -comment(// => egood food) -ident(println) ident(string)operator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\)) -comment(// => egeede efeede (global\)) -comment(// beware this one is just textual replacement) -ident(println) ident(string)operator(.)ident(replace)operator(()regexpoperator(,) stringoperator(\)) -comment(// => good food) -ident(println) stringoperator(.)ident(replace)operator(()regexpoperator(,) stringoperator(\)) -comment(// => ee) - -comment(// groovy -e "m = args[0] =~ /(a|ba|b\)+(a|ac\)+/; if (m.matches(\)\) println m[0][0]" ababacaca) -comment(// => ababa) - -ident(digits) operator(=) string -ident(nonlap) operator(=) ident(digits) operator(=~) regexp -keyword(assert) ident(nonlap)operator(.)ident(count) operator(==) integer(3) -ident(print) string -operator(()integer(0)operator(..<)ident(nonlap)operator(.)ident(count)operator(\))operator(.)ident(each)operator({) ident(print) ident(nonlap)operator([)local_variable(it)operator(]) operator(+) string operator(})operator(;) ident(print) string -ident(print) string -ident(yeslap) operator(=) operator(()ident(digits) operator(=~) regexpoperator(\)) -keyword(assert) ident(yeslap)operator(.)ident(count) operator(==) integer(7) -operator(()integer(0)operator(..<)ident(yeslap)operator(.)ident(count)operator(\))operator(.)ident(each)operator({) ident(print) ident(yeslap)operator([)local_variable(it)operator(])operator([)integer(1)operator(]) operator(+) string operator(})operator(;) ident(print) string -comment(// Non-overlapping: 123 456 789) -comment(// Overlapping: 123 234 345 456 567 678 789) - -ident(string) operator(=) string -comment(// Greedy version) -ident(parts) operator(=) ident(string) operator(=~) regexp -operator(()integer(1)operator(..)ident(parts)operator(.)ident(groupCount)operator(()operator(\))operator(\))operator(.)ident(each)operator({) ident(print) stringcontent(\) )delimiter(")> operator(})operator(;) ident(print) string -comment(// (And little \) (lambs\) ( eat ivy\)) - -comment(// Reluctant version) -ident(parts) operator(=) ident(string) operator(=~) regexp -operator(()integer(1)operator(..)ident(parts)operator(.)ident(groupCount)operator(()operator(\))operator(\))operator(.)ident(each)operator({) ident(print) stringcontent(\) )delimiter(")> operator(})operator(;) ident(print) string -comment(// (And \) (little lambs\) ( eat ivy\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.1) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy splits src and dest to avoid this problem) -ident(src) operator(=) string -ident(dst) operator(=) ident(src)operator(.)ident(replaceFirst)operator(()stringoperator(,) stringoperator(\)) -keyword(assert) ident(dst) operator(==) string - -comment(// extract basename) -ident(src) operator(=) string -ident(dst) operator(=) ident(src)operator(.)ident(replaceFirst)operator(()stringoperator(,) stringoperator(\)) -keyword(assert) ident(dst) operator(==) string - -comment(// Make All Words Title-Cased (not that you would do it this way\)) -comment(// The preprocessing operations \\X where X is one of l, u, L, and U are not supported) -comment(// in the sun regex library but other Java regex libraries may support this. Instead:) -ident(src) operator(=) string -ident(dst) operator(=) ident(src) -operator(()stringoperator(..)stringoperator(\))operator(.)ident(each)operator({) ident(dst) operator(=) ident(dst)operator(.)ident(replaceAll)operator(()regexpoperator(+)local_variable(it)operator(+)regexpoperator(+)local_variable(it)operator(,) regexpoperator(+)local_variable(it)operator(.)ident(toUpperCase)operator(()operator(\))operator(\)) operator(}) -keyword(assert) ident(dst) operator(==) string - -comment(// rename list of dirs) -ident(bindirs) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\)) -ident(expected) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\)) -ident(libdirs) operator(=) ident(bindirs)operator(.)ident(collect) operator({) ident(dir) operator(->) ident(dir)operator(.)ident(replaceFirst)operator(()stringoperator(,) stringoperator(\)) operator(}) -keyword(assert) ident(libdirs) operator(==) ident(expected) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.2) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy uses Java regex (other Java regex packages would also be possible\)) -comment(// It doesn't support Locale-based settings but you can roll your own to some) -comment(// extent, you can use any Unicode characters as per below and you can use) -comment(// \\p{Punct} Punctuation: One of !"#$%&'(\)*+,-./:;<=>?@[\\]^_`{|}~) -comment(// or the other special character classes) -ident(words) operator(=) string -ident(results) operator(=) string -ident(greekAlpha) operator(=) string -ident(special) operator(=) string operator(+) ident(greekAlpha) -comment(// flag as either Y (alphabetic\) or N (not\)) -ident(words)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(findAll)operator({)local_variable(it)operator(.)ident(trim)operator(()operator(\))operator(})operator(.)ident(each)operator({) ident(results) operator(+=) local_variable(it) operator(==~) regexpoperator(+)ident(special)operator(+)regexp operator(?)stringoperator(:)string operator(}) -keyword(assert) ident(results) operator(==) string -ident(results) operator(=) string -ident(words)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(findAll)operator({)local_variable(it)operator(.)ident(trim)operator(()operator(\))operator(})operator(.)ident(each)operator({) ident(results) operator(+=) local_variable(it) operator(==~) regexp operator(?)stringoperator(:)string operator(}) -keyword(assert) ident(results) operator(==) string -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.3) -comment(//----------------------------------------------------------------------------------) -comment(// as many non-whitespace bytes as possible) -ident(finder) operator(=) string operator(=~) regexp -keyword(assert) ident(finder)operator([)integer(0)operator(]) operator(==) string - -comment(// as many letters, apostrophes, and hyphens) -ident(finder) operator(=) string operator(=~) regexp comment(//') -keyword(assert) ident(finder)operator([)integer(0)operator(]) operator(==) string - -comment(// selecting words) -ident(finder) operator(=) string operator(=~) regexp comment(// usually best) -ident(println) ident(finder)operator([)integer(0)operator(])operator([)integer(0)operator(]) -comment(// => Psalm (23rd is not matched\)) -ident(finder) operator(=) string operator(=~) regexp comment(// fails at ends or w/ punctuation) -ident(println) ident(finder)operator(.)ident(matches)operator(()operator(\)) -comment(// => false (no whitespaces at ends\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.4) -comment(//----------------------------------------------------------------------------------) -ident(str) operator(=) string -ident(re) operator(=) string - -ident(finder) operator(=) ident(str) operator(=~) ident(re) -ident(out) operator(=) ident(str) -operator(()integer(0)operator(..<)ident(finder)operator(.)ident(count)operator(\))operator(.)ident(each)operator({) - ident(adr) operator(=) ident(finder)operator([)local_variable(it)operator(])operator([)integer(0)operator(]) - ident(out) operator(=) ident(out)operator(.)ident(replaceAll)operator(()ident(adr)operator(,) stringcontent( [)inlinecontent(])delimiter(")>operator(\)) -operator(}) -ident(println) ident(out) -comment(// => groovy.codehaus.org [63.246.7.187] and www.aboutgroovy.com [63.246.7.76]) - -comment(// to match whitespace or #-characters in an extended re you need to escape them.) -ident(foo) operator(=) integer(42) -ident(str) operator(=) string -ident(re) operator(=) string -ident(finder) operator(=) ident(str) operator(=~) ident(re) -ident(found) operator(=) ident(finder)operator([)integer(0)operator(]) -ident(out) operator(=) ident(str)operator(.)ident(replaceAll)operator(()ident(found)operator([)integer(0)operator(])operator(,) ident(evaluate)operator(()ident(found)operator([)integer(1)operator(])operator(\))operator(.)ident(toString)operator(()operator(\))operator(\)) -keyword(assert) ident(out) operator(==) string -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.5) -comment(//----------------------------------------------------------------------------------) -ident(fish) operator(=) string -ident(expected) operator(=) string -ident(thirdFish) operator(=) regexp -keyword(assert) ident(expected) operator(==) operator(()ident(fish)operator(.)ident(replaceAll)operator(()ident(thirdFish)operator(,) stringoperator(\))operator(\)) - -ident(anyFish) operator(=) regexp -ident(finder) operator(=) ident(fish) operator(=~) ident(anyFish) -comment(// finder contains an array of matched groups) -comment(// 2 = third one (index start at 0\), 1 = matched word in group) -ident(out) operator(=) stringcontent( one.)delimiter(")> -keyword(assert) ident(out) operator(==) ident(expected) - -ident(evens) operator(=) type([]) -operator(()integer(0)operator(..<)ident(finder)operator(.)ident(count)operator(\))operator(.)ident(findAll)operator({)local_variable(it)operator(%)integer(2)operator(!=)integer(0)operator(})operator(.)ident(each)operator({) ident(evens) operator(+=) ident(finder)operator([)local_variable(it)operator(])operator([)integer(1)operator(]) operator(}) -ident(println) stringoperator(\))inline_delimiter(})>content(.)delimiter(")> -comment(// => Even numbered fish are two blue.) - -comment(// one of several ways to do this) -ident(pond) operator(=) ident(fish) operator(+) string -ident(fishInPond) operator(=) operator(()regexpoperator(\)) operator(*) integer(4) operator(+) regexp -ident(found) operator(=) operator(()ident(pond) operator(=~) ident(fishInPond)operator(\))operator([)integer(0)operator(]) -ident(println) operator(()operator(()ident(found)operator([)integer(1)operator(..)integer(6)operator(]) operator(+) string operator(+) ident(found)operator([)integer(8)operator(..)integer(9)operator(])operator(\))operator(.)ident(join)operator(()operator(\))operator(\)) -comment(// => One fish two fish red fish sushi fish in the pond) - -comment(// find last fish) -ident(expected) operator(=) string -ident(pond) operator(=) string -ident(finder) operator(=) operator(()ident(pond) operator(=~) ident(anyFish)operator(\)) -keyword(assert) ident(expected) operator(==) stringdelimiter(")> -comment(// => Last fish is blue) - -comment(// greedy match version of above) -ident(finder) operator(=) operator(()ident(pond) operator(=~) regexp operator(+) ident(anyFish)operator(\)) -keyword(assert) ident(expected) operator(==) stringdelimiter(")> - -comment(// last fish match version of above) -ident(finder) operator(=) operator(()ident(pond) operator(=~) regexpoperator(\)) -keyword(assert) ident(expected) operator(==) stringdelimiter(")> -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.6) -comment(//----------------------------------------------------------------------------------) -comment(// Html Stripper) -comment(// get this using: fakedfile = new File('path_to_file.htm'\).text) -ident(fakedFile) operator(=) string -Chapter 1 Title - -

Chapter 1: Some Heading

-A paragraph. - - -)delimiter(''')> - -ident(stripExpectations) operator(=) stringoperator(.)ident(trim)operator(()operator(\)) - -ident(stripped) operator(=) ident(fakedFile)operator(.)ident(replaceAll)operator(()regexp)delimiter(/)>operator(,)stringoperator(\))operator(.)ident(trim)operator(()operator(\)) -keyword(assert) ident(stripExpectations) operator(==) ident(stripped) - -ident(pattern) operator(=) string - -ident(headerfyExpectations) operator(=) stringChapter 1: Some Heading -A paragraph. -)delimiter(''')>operator(.)ident(trim)operator(()operator(\)) - -ident(headerfied) operator(=) ident(stripped)operator(.)ident(replaceAll)operator(()ident(pattern)operator(,) string$1)delimiter(')>operator(\)) -keyword(assert) ident(headerfyExpectations) operator(==) ident(headerfied) - -comment(// one liner equivalent which prints to stdout) -comment(//% groovy -p -e "line.replaceAll(/^(Chapter\\s+\\d+\\s*:.*\)/,'

$1

'\)") - -comment(// one liner equivalent which modifies file in place and creates *.bak original file) -comment(//% groovy -pi .bak -e "line.replaceAll(/^(Chapter\\s+\\d+\\s*:.*\)/,'

$1

'\)") - -comment(// use: realFileInput = new File(path_to_file\).text) -ident(fakeFileInput) operator(=) string - -ident(chunkyPattern) operator(=) regexp -ident(finder) operator(=) ident(fakeFileInput) operator(=~) ident(chunkyPattern) -operator(()integer(0)operator(..<)ident(finder)operator(.)ident(count)operator(\))operator(.)ident(each) operator({) - ident(println) stringcontent( contains )inlineoperator(\))operator(.)ident(countTokens)operator(()operator(\))inline_delimiter(})>content( lines.)delimiter(")> -operator(}) -comment(// =>) -comment(// Chunk #0 contains 2 lines.) -comment(// Chunk #1 contains 1 lines.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.7) -comment(//----------------------------------------------------------------------------------) -comment(// general pattern is:) -comment(//file = new File("datafile"\).text.split(/pattern/\)) -comment(// .Ch, .Se and .Ss divide chunks of input text) -ident(fakedFiletext) operator(=) string -ident(chunks) operator(=) ident(fakedFiletext)operator(.)ident(split)operator(()regexpoperator(\)) -ident(println) stringcontent( chunks.)delimiter(")> -comment(// => I read 10 chunks.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.8) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy doesn't support the ~/BEGIN/ .. ~/END/ notation) -comment(// you have to emulate it as shown in the example below) -comment(// The from line number to line number processing is supported) -comment(// from the command line but not within a script, e.g.) -comment(// command-line to print lines 15 through 17 inclusive (see below\)) -comment(// > groovy -p -e "if (count in 15..17\) return line" datafile) -comment(// Within a script itself, you emulate the count by keeping state) - -ident(htmlContent) operator(=) stringA Heading -Here is inline AAA. -And the bigger Example 2: - -line BBB -line CCC - -Done. -)delimiter(''')>operator(.)ident(trim)operator(()operator(\)) - -ident(examplePattern) operator(=) regexp(.*?\)<)char(\\/)content(XMP>)delimiter(/)> -ident(finder) operator(=) ident(htmlContent) operator(=~) ident(examplePattern) -operator(()integer(0)operator(..<)ident(finder)operator(.)ident(count)operator(\))operator(.)ident(each) operator({) - ident(println) stringcontent(:)delimiter(")> - ident(println) ident(finder)operator([)local_variable(it)operator(])operator([)integer(1)operator(]) -operator(}) -comment(// =>) -comment(// Example 1:) -comment(// inline AAA) -comment(// Example 2:) -comment(//) -comment(// line BBB) -comment(// line CCC) -comment(//) - -ident(htmlContent)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(eachWithIndex)operator({) ident(line)operator(,) ident(count) operator(->) - keyword(if) operator(()ident(count) keyword(in) integer(4)operator(..)integer(5)operator(\)) ident(println) ident(line) -operator(}) -comment(// =>) -comment(// line BBB) -comment(// line CCC) - -comment(// You would probably use a mail Api for this in Groovy) -ident(fakedMailInput) operator(=) string -To: -Date: Sun, 31 Dec 2006 02:14:57 +1100 - -From: noone@nowhere.com -To: -Date: Sun, 31 Dec 2006 02:14:58 +1100 - -From: someone@somewhere.com -To: -Date: Sun, 31 Dec 2006 02:14:59 +1100 -)delimiter(''')>operator(.)ident(trim)operator(()operator(\))operator(+)string - -ident(seen) operator(=) operator([)operator(:)operator(]) -ident(fakedMailInput)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each)operator({) ident(line) operator(->) - ident(m) operator(=) operator(()ident(line) operator(=~) regexpoperator(\)) - keyword(if) operator(()ident(m)operator(\)) operator({) - ident(addr) operator(=) ident(m)operator([)integer(0)operator(])operator([)integer(1)operator(]) operator(=~) regexp(\),;)char(\\s)content(]+)content(\\@)content([^<>(\),;)char(\\s)content(]+\))delimiter(/)> - ident(x) operator(=) ident(addr)operator([)integer(0)operator(])operator([)integer(1)operator(]) - keyword(if) operator(()ident(seen)operator(.)ident(containsKey)operator(()ident(x)operator(\))operator(\)) ident(seen)operator([)ident(x)operator(]) operator(+=) integer(1) keyword(else) ident(seen)operator([)ident(x)operator(]) operator(=) integer(1) - operator(}) -operator(}) -ident(seen)operator(.)ident(each)operator({) ident(k)operator(,)ident(v) operator(->) ident(println) stringcontent( seen )inlinecontent( time)inlineoperator(:)stringinline_delimiter(})>content(.)delimiter(")> operator(}) -comment(// =>) -comment(// Address noone@nowhere.com seen 1 time.) -comment(// Address someone@somewhere.com seen 2 times.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.9) -comment(//----------------------------------------------------------------------------------) -keyword(import) include(java.util.regex.Pattern) - -ident(names) operator(=) string - -keyword(def) method(glob2pat)operator(()ident(globstr)operator(\)) operator({) - keyword(def) ident(patmap) operator(=) operator([) stringoperator(:)stringoperator(,) stringoperator(:)stringoperator(,) stringoperator(:)stringoperator(,) stringoperator(:)string operator(]) - keyword(def) ident(result) operator(=) string - string operator(+) ident(globstr)operator(.)ident(replaceAll)operator(()regexpoperator(\)) operator({) ident(all)operator(,) ident(c) operator(->) - ident(result) operator(+=) operator(()ident(patmap)operator(.)ident(containsKey)operator(()ident(c)operator(\)) operator(?) ident(patmap)operator([)ident(c)operator(]) operator(:) pre_type(Pattern)operator(.)ident(quote)operator(()ident(c)operator(\))operator(\)) - operator(}) - ident(result) operator(+) string -operator(}) - -keyword(def) method(checkNumMatches)operator(()ident(pat)operator(,) ident(count)operator(\)) operator({) - keyword(assert) operator(()ident(names) operator(=~) ident(glob2pat)operator(()ident(pat)operator(\))operator(\))operator(.)ident(count) operator(==) ident(count) -operator(}) - -ident(checkNumMatches)operator(()stringoperator(,) integer(3)operator(\)) -ident(checkNumMatches)operator(()stringoperator(,) integer(2)operator(\)) -ident(checkNumMatches)operator(()stringoperator(,) integer(2)operator(\)) -ident(checkNumMatches)operator(()stringoperator(,) integer(2)operator(\)) -ident(checkNumMatches)operator(()stringoperator(,) integer(0)operator(\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.10) -comment(//----------------------------------------------------------------------------------) -comment(// version 1: simple obvious way) -ident(states) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\)) - -keyword(def) method(popgrep1)operator(()ident(file)operator(\)) operator({) - ident(file)operator(.)ident(eachLine)operator({) ident(line) operator(->) - keyword(if) operator(()ident(states)operator(.)ident(any)operator({) ident(line) operator(=~) regexpchar(\\b)delimiter(/)> operator(})operator(\)) ident(println) ident(line) - operator(}) -operator(}) -comment(// popgrep1(new File('path_to_file'\)\)) - -comment(// version 2: eval strings; fast but hard to quote (SLOW\)) -keyword(def) method(popgrep2)operator(()ident(file)operator(\)) operator({) - keyword(def) ident(code) operator(=) string - ident(states)operator(.)ident(each)operator({) - ident(code) operator(+=) stringchar(\\\\)content(b/\) found = true)char(\\n)delimiter(")> - operator(}) - ident(code) operator(+=) string - ident(file)operator(.)ident(eachLine)operator({) ident(line) operator(=) local_variable(it)operator(;) ident(evaluate)operator(()ident(code)operator(\)) operator(}) -operator(}) -comment(// popgrep2(new File('path_to_file'\)\)) - -comment(// version 2b: eval using switch/case (not in Perl cookbook\) (SLOW\)) -keyword(def) method(popgrep2b)operator(()ident(file)operator(\)) operator({) - keyword(def) ident(code) operator(=) string - ident(states)operator(.)ident(each)operator({) - ident(code) operator(+=) stringchar(\\\\)content(b.*/:)char(\\n)content(println line;break)char(\\n)delimiter(")> - operator(}) - ident(code) operator(+=) string - ident(file)operator(.)ident(eachLine)operator({) ident(line) operator(=) local_variable(it)operator(;) ident(evaluate)operator(()ident(code)operator(\)) operator(}) -operator(}) -comment(// popgrep2b(new File('path_to_file'\)\)) - -comment(// version3: build a match_any function as a GString) -keyword(def) method(popgrep3)operator(()ident(file)operator(\)) operator({) - keyword(def) ident(code) operator(=) ident(states)operator(.)ident(collect)operator({) stringchar(\\\\)content(b/)delimiter(")> operator(})operator(.)ident(join)operator(()stringoperator(\)) - ident(file)operator(.)ident(eachLine)operator({) ident(line) operator(=) local_variable(it)operator(;) keyword(if) operator(()ident(evaluate)operator(()ident(code)operator(\))operator(\)) ident(println) ident(line) operator(}) -operator(}) -comment(// popgrep3(new File('path_to_file'\)\)) - -comment(// version4: pretty fast, but simple: compile all re's first:) -ident(patterns) operator(=) ident(states)operator(.)ident(collect)operator({) operator(~)regexpchar(\\b)delimiter(/)> operator(}) -keyword(def) method(popgrep4)operator(()ident(file)operator(\)) operator({) - ident(file)operator(.)ident(eachLine)operator({) ident(line) operator(->) - keyword(if) operator(()ident(patterns)operator(.)ident(any)operator({) local_variable(it)operator(.)ident(matcher)operator(()ident(line)operator(\))operator(})operator(\)) ident(println) ident(line) - operator(}) -operator(}) -comment(// popgrep4(new File('path_to_file'\)\)) - -comment(// version5: faster) -ident(str) operator(=) ident(states)operator(.)ident(collect)operator({) regexpchar(\\b)delimiter(/)> operator(})operator(.)ident(join)operator(()stringoperator(\)) -keyword(def) method(popgrep5)operator(()ident(file)operator(\)) operator({) - ident(file)operator(.)ident(eachLine)operator({) ident(line) operator(->) - keyword(if) operator(()ident(line) operator(=~) ident(str)operator(\)) ident(println) ident(line) - operator(}) -operator(}) -comment(// popgrep5(new File('path_to_file'\)\)) - -comment(// version5b: faster (like 5 but compiled outside loop\)) -ident(pattern) operator(=) operator(~)ident(states)operator(.)ident(collect)operator({) regexpchar(\\b)delimiter(/)> operator(})operator(.)ident(join)operator(()stringoperator(\)) -keyword(def) method(popgrep5b)operator(()ident(file)operator(\)) operator({) - ident(file)operator(.)ident(eachLine)operator({) ident(line) operator(->) - keyword(if) operator(()ident(pattern)operator(.)ident(matcher)operator(()ident(line)operator(\))operator(\)) ident(println) ident(line) - operator(}) -operator(}) -comment(// popgrep5b(new File('path_to_file'\)\)) - -comment(// speeds trials ON the current source file (~1200 lines\)) -comment(// popgrep1 => 0.39s) -comment(// popgrep2 => 25.08s) -comment(// popgrep2b => 23.86s) -comment(// popgrep3 => 22.42s) -comment(// popgrep4 => 0.12s) -comment(// popgrep5 => 0.05s) -comment(// popgrep5b => 0.05s) -comment(// Groovy's built-in support is the way to go in terms of) -comment(// both speed and simplicity of understanding. Avoid using) -comment(// evaluate(\) unless you absolutely need it) - -comment(// generic matching functions) -ident(input) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(findAll)operator({)local_variable(it)operator(.)ident(trim)operator(()operator(\))operator(}) - -keyword(def) method(matchAny)operator(()ident(line)operator(,) ident(patterns)operator(\)) operator({) ident(patterns)operator(.)ident(any)operator({) ident(line) operator(=~) local_variable(it) operator(}) operator(}) -keyword(def) method(matchAll)operator(()ident(line)operator(,) ident(patterns)operator(\)) operator({) ident(patterns)operator(.)ident(every)operator({) ident(line) operator(=~) local_variable(it) operator(}) operator(}) - -keyword(assert) ident(input)operator(.)ident(findAll)operator({) ident(matchAny)operator(()local_variable(it)operator(,) operator([)stringoperator(,)stringoperator(])operator(\)) operator(})operator(.)ident(size)operator(()operator(\)) operator(==) integer(3) -keyword(assert) ident(input)operator(.)ident(findAll)operator({) ident(matchAny)operator(()local_variable(it)operator(,) operator([)stringoperator(,)stringoperator(])operator(\)) operator(})operator(.)ident(size)operator(()operator(\)) operator(==) integer(2) -keyword(assert) ident(input)operator(.)ident(findAll)operator({) ident(matchAll)operator(()local_variable(it)operator(,) operator([)stringoperator(,)stringoperator(])operator(\)) operator(})operator(.)ident(size)operator(()operator(\)) operator(==) integer(1) -keyword(assert) ident(input)operator(.)ident(findAll)operator({) ident(matchAll)operator(()local_variable(it)operator(,) operator([)stringoperator(,)stringoperator(])operator(\)) operator(})operator(.)ident(size)operator(()operator(\)) operator(==) integer(0) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.11) -comment(//----------------------------------------------------------------------------------) -comment(// patternCheckingScript:) -ident(prompt) operator(=) string )delimiter(')> -ident(print) string operator(+) ident(prompt) -keyword(new) pre_type(BufferedReader)operator(()keyword(new) pre_type(InputStreamReader)operator(()pre_type(System)operator(.)ident(in)operator(\))operator(\))operator(.)ident(eachLine)operator({) ident(line) operator(->) - keyword(try) operator({) - pre_type(Pattern)operator(.)ident(compile)operator(()ident(line)operator(\)) - ident(print) string operator(+) ident(prompt) - operator(}) keyword(catch) operator(()ident(java)operator(.)ident(util)operator(.)ident(regex)operator(.)ident(PatternSyntaxException) ident(ex)operator(\)) operator({) - ident(print) string operator(+) ident(ex)operator(.)ident(message) operator(+) ident(prompt) - operator(}) -operator(}) -comment(// =>) -comment(// Enter patterns to check:) -comment(// > ab*.c) -comment(// Valid) -comment(// > ^\\s+[^a-z]*$) -comment(// Valid) -comment(// > **) -comment(// Invalid pattern: Dangling meta character '*' near index 0) -comment(// **) -comment(// ^) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.12) -comment(//----------------------------------------------------------------------------------) -ident(src) operator(=) string -comment(// simplistic with locale issue) -ident(dst) operator(=) ident(src) -operator(()stringoperator(..)stringoperator(\))operator(.)ident(each)operator({) ident(dst) operator(=) ident(dst)operator(.)ident(replaceAll)operator(()regexpoperator(+)local_variable(it)operator(+)regexpoperator(+)local_variable(it)operator(,) local_variable(it)operator(.)ident(toUpperCase)operator(()operator(\))operator(\)) operator(}) -ident(println) ident(dst) -comment(// => Dierk KöNig) -comment(// locale avoidance) -ident(dst) operator(=) ident(src) -operator(()stringoperator(..)stringoperator(\))operator(.)ident(each)operator({) ident(dst) operator(=) ident(dst)operator(.)ident(replaceAll)operator(()regexpoperator(+)local_variable(it)operator(,) local_variable(it)operator(.)ident(toUpperCase)operator(()operator(\))operator(\)) operator(}) -ident(println) ident(dst) -comment(// => Dierk König) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.13) -comment(//----------------------------------------------------------------------------------) -comment(// Several libraries exist, e.g.) -comment(// http://secondstring.sourceforge.net/) -comment(// http://sourceforge.net/projects/simmetrics/) -comment(// both support numerous algorithms. Using the second as an example:) -keyword(import) include(uk.ac.shef.wit.simmetrics.similaritymetrics.*) -ident(target) operator(=) string -ident(candidates) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(findAll)operator({)local_variable(it)operator(.)ident(trim)operator(()operator(\))operator(}) -ident(metrics) operator(=) operator([)keyword(new) ident(Levenshtein)operator(()operator(\))operator(,) keyword(new) ident(MongeElkan)operator(()operator(\))operator(,) keyword(new) ident(JaroWinkler)operator(()operator(\))operator(,) keyword(new) ident(Soundex)operator(()operator(\))operator(]) -keyword(def) method(out)operator(()ident(name)operator(,) ident(results)operator(\)) operator({) - ident(print) ident(name)operator(.)ident(padLeft)operator(()integer(14)operator(\)) operator(+) stringoperator(;) ident(results)operator(.)ident(each)operator({)ident(print)operator(()local_variable(it)operator(.)ident(padRight)operator(()integer(16)operator(\))operator(\))operator(})operator(;) ident(println)operator(()operator(\)) -operator(}) -keyword(def) method(outr)operator(()ident(name)operator(,) ident(results)operator(\))operator({)ident(out)operator(()ident(name)operator(,) ident(results)operator(.)ident(collect)operator({)stringoperator(+)operator(()operator(()type(int)operator(\))operator(()local_variable(it)operator(*)integer(100)operator(\))operator(\))operator(/)integer(100)operator(})operator(\))operator(}) -ident(out) operator(()stringoperator(,) ident(metrics)operator(.)ident(collect)operator({)local_variable(it)operator(.)ident(shortDescriptionString)operator(}) operator(\)) -ident(candidates)operator(.)ident(each)operator({) ident(w) operator(->) ident(outr)operator(()ident(w)operator(,) ident(metrics)operator(.)ident(collect)operator({) ident(m) operator(->) ident(m)operator(.)ident(getSimilarity)operator(()ident(target)operator(,) ident(w)operator(\))operator(}) operator(\))operator(}) -comment(// =>) -comment(// Word/Metric Levenshtein MongeElkan JaroWinkler Soundex) -comment(// quick 0 0.11 0 0.66) -comment(// brown 0.16 0.23 0.5 0.73) -comment(// fox 0 0.2 0 0.66) -comment(// jumped 0 0.2 0 0.66) -comment(// over 0 0.44 0 0.55) -comment(// the 0 0.33 0 0.55) -comment(// lazy 0.33 0.5 0.44 0.66) -comment(// dog 0 0.2 0 0.66) -comment(// ballast 0.85 0.83 0.96 1) -comment(// ballasts 0.75 0.83 0.94 0.94) -comment(// balustrade 0.5 0.93 0.3 0.94) -comment(// balustrades 0.45 0.93 0.3 0.94) -comment(// blast 0.83 0.8 0.88 1) -comment(// blasted 0.57 0.66 0.8 0.94) -comment(// blaster 0.57 0.66 0.8 0.94) -comment(// blasters 0.5 0.66 0.77 0.94) -comment(// blasting 0.5 0.66 0.77 0.94) -comment(// blasts 0.66 0.66 0.84 0.94) -comment(// to implement the example, iterate through /usr/dict/words selecting words) -comment(// where one or a combination of metrics are greater than some threshold) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.14) -comment(//----------------------------------------------------------------------------------) -ident(n) operator(=) string -ident(println) ident(n)operator(.)ident(replaceAll)operator(()regexpoperator(,)stringoperator(\)) -comment(// => 00049 here) - -ident(str) operator(=) string -ident(print) string -ident(str)operator(.)ident(eachMatch)operator(()regexpoperator(\))operator({) ident(print) string operator(+) local_variable(it)operator([)integer(1)operator(]) operator(}) -ident(println)operator(()operator(\)) -comment(// => Found numbers: 3 4 5 9 120) - -comment(// Groovy doesn't have the String.pos or a /c re modifier like Perl) -comment(// But it does have similar functionality. Matcher has start(\) and) -comment(// end(\) for find the position and Matcher's usePattern(\) allows) -comment(// you to swap patterns without changing the buffer position) -ident(text) operator(=) string -ident(p) operator(=) operator(~)regexp -ident(m) operator(=) ident(p)operator(.)ident(matcher)operator(()ident(text)operator(\)) -keyword(while) operator(()ident(m)operator(.)ident(find)operator(()operator(\))operator(\)) operator({) - ident(println) string operator(+) ident(m)operator(.)ident(group)operator(()operator(\)) operator(+) string operator(+) ident(m)operator(.)ident(start)operator(()operator(\)) operator(+) - string operator(+) ident(m)operator(.)ident(end)operator(()operator(\)) -operator(}) -comment(// now reset pos back to between 1st and 2nd numbers) -keyword(if) operator(()ident(m)operator(.)ident(find)operator(()integer(16)operator(\))operator(\)) operator({) ident(println) string operator(+) ident(m)operator(.)ident(group)operator(()operator(\)) operator(}) -comment(// =>) -comment(// Found 1752 starting at pos 9 and ending at pos 13) -comment(// Found 10 starting at pos 19 and ending at pos 21) -comment(// Found 3 starting at pos 34 and ending at pos 35) -comment(// Found 10) - -comment(// Alternatively you can use Scanner in Java 5-7+:) -ident(p1) operator(=) operator(~)regexp -ident(p2) operator(=) operator(~)regexp -ident(s) operator(=) keyword(new) pre_type(Scanner)operator(()ident(text)operator(\)) -keyword(while) operator(()operator(()ident(f) operator(=) ident(s)operator(.)ident(findInLine)operator(()ident(p1)operator(\))operator(\))operator(\)) operator({) ident(println) string operator(+) ident(f) operator(}) -keyword(if) operator(()operator(()ident(f) operator(=) ident(s)operator(.)ident(findInLine)operator(()ident(p2)operator(\))operator(\))operator(\)) operator({) ident(println) stringcontent( after the last number.)delimiter(")> operator(}) -comment(// =>) -comment(// Found: 1752) -comment(// Found: 10) -comment(// Found: 3) -comment(// Found rd after the last number.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.15) -comment(//----------------------------------------------------------------------------------) -ident(html) operator(=) stringthis and that are important Oh, me too!)delimiter(')> - -ident(greedyHtmlStripPattern) operator(=) operator(~)regexp)delimiter(/)> comment(// not good) -ident(nonGreedyHtmlStripPattern) operator(=) operator(~)regexp)delimiter(/)> comment(// not great) -ident(simpleNested) operator(=) operator(~)regexp(.*?\)<)char(\\/)content(i><)char(\\/)content(b>)delimiter(/)> -comment(// match BEGIN, then not BEGIN, then END) -ident(generalPattern) operator(=) operator(~)regexp -ident(betterButInefficient1) operator(=) operator(~)regexp( (?: (?!<)char(\\/)content(b>|<)char(\\/)content(i>\). \)* \) <)char(\\/)content(i><)char(\\/)content(b>)delimiter(/)> -ident(betterButInefficient2) operator(=) operator(~)regexp( (?: (?!<)char(\\/)content([ib]>\). \)* \) <)char(\\/)content(i><)char(\\/)content(b>)delimiter(/)> - -ident(efficientPattern) operator(=) string - [^<]* # stuff not possibly bad, and not possibly the end. - (?: - # at this point, we can have '<' if not part of something bad - (?! \) # what we can't have - < # okay, so match the '<' - [^<]* # and continue with more safe stuff - \) * - -)delimiter(''')> comment(//') -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.16) -comment(//----------------------------------------------------------------------------------) -ident(input) operator(=) string -ident(dupWordPattern) operator(=) string -ident(finder) operator(=) ident(input) operator(=~) ident(dupWordPattern) -ident(println) string operator(+) ident(finder)operator([)integer(0)operator(])operator([)integer(1)operator(]) -comment(// => Found duplicate word: test) - -ident(astr) operator(=) string -ident(bstr) operator(=) string -ident(m) operator(=) stringcontent( )inlinedelimiter(")> operator(=~) regexp -ident(actual) operator(=) stringcontent( overlaps in )inlinecontent(-)inlinecontent(-)inlinedelimiter(")> -keyword(assert) ident(actual) operator(==) string - -ident(cap) operator(=) string operator(*) integer(180) -keyword(while) operator(()ident(m) operator(=) operator(()ident(cap) operator(=~) regexpoperator(\))operator(\)) operator({) - ident(p1) operator(=) ident(m)operator([)integer(0)operator(])operator([)integer(1)operator(]) - ident(print) ident(p1)operator(.)ident(size)operator(()operator(\)) operator(+) string - ident(cap) operator(=) ident(cap)operator(.)ident(replaceAll)operator(()ident(p1)operator(,)stringoperator(\)) -operator(}) -ident(println) ident(cap)operator(.)ident(size)operator(()operator(\)) -comment(// => 2 2 3 3 5) - -comment(// diophantine) -comment(// solve for 12x + 15y + 16z = 281, maximizing x) -keyword(if) operator(()operator(()ident(m) operator(=) operator(()string operator(*) integer(281)operator(\)) operator(=~) regexpoperator(\))operator(\)) operator({) - ident(x)operator(=)ident(m)operator([)integer(0)operator(])operator([)integer(1)operator(])operator(.)ident(size)operator(()operator(\))operator(;) ident(y)operator(=)ident(m)operator([)integer(0)operator(])operator([)integer(2)operator(])operator(.)ident(size)operator(()operator(\))operator(;) ident(z)operator(=)ident(m)operator([)integer(0)operator(])operator([)integer(3)operator(])operator(.)ident(size)operator(()operator(\)) - ident(println) stringcontent(; y=)inlinecontent(; z=)inlinedelimiter(")> -operator(}) keyword(else) ident(println) string -comment(// => One solution is: x=17; y=3; z=2) - -comment(// using different quantifiers:) -comment(// /^(o+\)\\1{11}(o+\)\\2{14}(o+\)\\3{15}$/) -comment(// => One solution is: x=17; y=3; z=2) - -comment(// /^(o*?\)\\1{11}(o*\)\\2{14}(o*\)\\3{15}$/) -comment(// => One solution is: x=0; y=7; z=11) - -comment(// /^(o+?\)\\1{11}(o*\)\\2{14}(o*\)\\3{15}$/) -comment(// => One solution is: x=1; y=3; z=14) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.17) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy doesn't currently support x!~y so you must use the !(x=~y\) style) - -comment(// alpha OR beta) -keyword(assert) string operator(==~) regexp -keyword(assert) string operator(==~) regexp -keyword(assert) string operator(=~) regexp operator(||) string operator(=~) regexp - -comment(// alpha AND beta) -keyword(assert) operator(!)operator(()string operator(=~) regexpoperator(\)) -keyword(assert) string operator(=~) regexp -keyword(assert) string operator(=~) regexp -keyword(assert) string operator(=~) regexp operator(&&) string operator(=~) regexp - -comment(// alpha AND beta, no overlap) -keyword(assert) string operator(=~) regexp -keyword(assert) operator(!)operator(()string operator(=~) regexpoperator(\)) - -comment(// NOT beta) -keyword(assert) string operator(=~) regexp -keyword(assert) operator(!)operator(()string operator(=~) regexpoperator(\)) - -comment(// NOT bad BUT good) -keyword(assert) operator(!)operator(()string operator(=~) regexpoperator(\)) -keyword(assert) operator(!)operator(()string operator(=~) regexpoperator(\)) -keyword(assert) operator(!)operator(()string operator(=~) regexpoperator(\)) -keyword(assert) string operator(=~) regexp - -comment(// minigrep could be done as a one-liner as follows) -comment(// groovy -p -e "if (line =~ /pat/\) return line" datafile) - -ident(string) operator(=) string -keyword(assert) ident(string) operator(=~) regexp -keyword(assert) ident(string) operator(=~) regexp operator(&&) ident(string) operator(=~) string -ident(fakeAddress) operator(=) string -ident(murrayHillRegex) operator(=) string -keyword(assert) ident(string) operator(=~) ident(murrayHillRegex) -keyword(assert) operator(!)operator(()ident(fakeAddress) operator(=~) ident(murrayHillRegex)operator(\)) - -comment(// eliminate overlapping) -keyword(assert) operator(!)operator(()ident(string) operator(=~) regexpoperator(\)) - -ident(brandRegex) operator(=) string -keyword(assert) operator(!)operator(()ident(string) operator(=~) ident(brandRegex)operator(\)) - -ident(map) operator(=) string - -keyword(assert) ident(map) operator(=~) regexp -ident(noWaldoRegex) operator(=) string -keyword(assert) ident(map) operator(=~) ident(noWaldoRegex) - -comment(// on unix systems use: realFakedInput = 'w'.process(\).text) -ident(fakedInput) operator(=) stringoperator(.)ident(trim)operator(()operator(\)) operator(+) string - -keyword(def) method(miniGrepMethod)operator(()ident(input)operator(\)) operator({) - ident(input)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(findAll)operator({)local_variable(it) operator(=~) stringoperator(}) -operator(}) -keyword(assert) ident(miniGrepMethod)operator(()ident(fakedInput)operator(\))operator(.)ident(size)operator(()operator(\)) operator(==) integer(2) - -ident(findUserRegex) operator(=) string -keyword(assert) operator(()ident(fakedInput) operator(=~) ident(findUserRegex)operator(\))operator(.)ident(count) operator(==) integer(2) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.18) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy uses Unicode character encoding) -comment(// special care needs to be taken when using unicode because of the different) -comment(// byte lengths, e.g. à can be encoded as two bytes \\u0061\\u0300 and is also) -comment(// supported in legacy character sets by a single character \\u00E0. To Match) -comment(// this character, you can't use any of /./, /../, /a/, /\\u00E0/, /\\u0061/\\u0300) -comment(// or /\\pL/. The correct way is to use /X (not currently supported\) or one) -comment(// of /\\pL/\\pM*/ to ensure that it is a letter or /\\PM\\pM*/ when you just want) -comment(// to combine multicharacter sequences and don't care whether it is a letter) -keyword(def) method(checkUnicode)operator(()ident(s)operator(\)) operator({) - ident(println) ident(s) operator(+) string operator(+) ident(s)operator(.)ident(size)operator(()operator(\)) - ident(println) string operator(+) operator(()ident(s) operator(==~) regexpoperator(\)) - ident(println) string operator(+) operator(()ident(s) operator(==~) regexpoperator(\)) - ident(println) string operator(+) operator(()ident(s) operator(==~) regexpoperator(\)) - ident(println) string operator(+) operator(()ident(s) operator(==~) regexpoperator(\)) - ident(println) string operator(+) operator(()ident(s) operator(==~) regexpoperator(\)) - ident(println) string operator(+) operator(()ident(s) operator(==~) regexpoperator(\)) - ident(println) string operator(+) operator(()ident(s) operator(==~) regexpoperator(\)) - ident(println) string operator(+) operator(()ident(s) operator(==~) regexpoperator(\)) -operator(}) -ident(checkUnicode)operator(()stringoperator(\)) -ident(checkUnicode)operator(()stringoperator(\)) -ident(checkUnicode)operator(()stringoperator(\)) -comment(// =>) -comment(// à is of size 1) -comment(// Exactly matches /./ true) -comment(// Exactly matches /../ false) -comment(// Exactly matches /a/ false) -comment(// Exactly matches /\\u00E0/ true) -comment(// Exactly matches /\\u0061\\u0300/ false) -comment(// Exactly matches /\\pL/ true) -comment(// Exactly matches /\\pL\\pM*/ true) -comment(// Exactly matches /\\PM\\pM*/ true) -comment(// a? is of size 2) -comment(// Exactly matches /./ false) -comment(// Exactly matches /../ true) -comment(// Exactly matches /a/ false) -comment(// Exactly matches /\\u00E0/ false) -comment(// Exactly matches /\\u0061\\u0300/ true) -comment(// Exactly matches /\\pL/ false) -comment(// Exactly matches /\\pL\\pM*/ true) -comment(// Exactly matches /\\PM\\pM*/ true) -comment(// à is of size 1) -comment(// Exactly matches /./ true) -comment(// Exactly matches /../ false) -comment(// Exactly matches /a/ false) -comment(// Exactly matches /\\u00E0/ true) -comment(// Exactly matches /\\u0061\\u0300/ false) -comment(// Exactly matches /\\pL/ true) -comment(// Exactly matches /\\pL\\pM*/ true) -comment(// Exactly matches /\\PM\\pM*/ true) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.19) -comment(//----------------------------------------------------------------------------------) -comment(// The Perl Cookbook categorizes this as a hard problem ... mostly for) -comment(// reasons not related to the actual regex - but with a 60-line regex) -comment(// perhaps there are some issues with that too. Further details:) -comment(// http://www.perl.com/CPAN/authors/Tom_Christiansen/scripts/ckaddr.gz) - -ident(simpleCommentStripper) operator(=) regexp -ident(println) string (We will spam you\))delimiter(')>operator(.)ident(replaceAll)operator(()ident(simpleCommentStripper)operator(,) stringoperator(\)) -comment(// => Book Publishing ) - -comment(// inspired by the fact that domain names can contain any foreign character these days) -ident(modern) operator(=) regexp?)content($)delimiter(/)> - -comment(// .Net ) -ident(lenient) operator(=) regexp - -comment(// a little more checking) -ident(strict) operator(=) regexp operator(+) - regexp?)content($)delimiter(/)> - -ident(addresses) operator(=) operator([)stringoperator(,) - string)delimiter(')>operator(]) -ident(addresses)operator(.)ident(each)operator({) - keyword(assert) local_variable(it) operator(=~) ident(lenient) - keyword(assert) local_variable(it) operator(=~) ident(strict) - keyword(assert) local_variable(it) operator(=~) ident(modern) -operator(}) - -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.20) -comment(//----------------------------------------------------------------------------------) -keyword(def) method(findAction)operator(()ident(ans)operator(\)) operator({) - keyword(def) ident(re) operator(=) string operator(+) pre_type(Pattern)operator(.)ident(quote)operator(()ident(ans)operator(\)) - keyword(if) operator(()string operator(=~) ident(re)operator(\)) ident(println) string - keyword(else) keyword(if) operator(()string operator(=~) ident(re)operator(\)) ident(println) string - keyword(else) keyword(if) operator(()string operator(=~) ident(re)operator(\)) ident(println) string - keyword(else) keyword(if) operator(()string operator(=~) ident(re)operator(\)) ident(println) string - keyword(else) ident(println) string -operator(}) -ident(findAction)operator(()stringoperator(\)) -comment(// => No Match) -ident(findAction)operator(()stringoperator(\)) -comment(// => Action is edit) -ident(findAction)operator(()stringoperator(\)) -comment(// => Action is send) -ident(findAction)operator(()stringoperator(\)) -comment(// => Action is edit) - -keyword(def) method(buildAbbrev)operator(()ident(words)operator(\)) operator({) - keyword(def) ident(table) operator(=) keyword(new) pre_type(TreeMap)operator(()operator(\)) - ident(words)operator(.)ident(each)operator({) ident(w) operator(->) - operator(()integer(0)operator(..<)ident(w)operator(.)ident(size)operator(()operator(\))operator(\))operator(.)ident(each) operator({) ident(n) operator(->) - keyword(if) operator(()operator(!)operator(()ident(words) operator(-) ident(w)operator(\))operator(.)ident(any)operator({) - local_variable(it)operator(.)ident(size)operator(()operator(\)) operator(>=) ident(n)operator(+)integer(1) operator(&&) local_variable(it)operator([)integer(0)operator(..)ident(n)operator(]) operator(==) ident(w)operator([)integer(0)operator(..)ident(n)operator(]) - operator(})operator(\)) ident(table)operator([)ident(w)operator([)integer(0)operator(..)ident(n)operator(])operator(]) operator(=) ident(w) - operator(}) - operator(}) - ident(table) -operator(}) -ident(println) ident(buildAbbrev)operator(()stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\))operator(\)) -comment(// => ["a":"abort", "ab":"abort", "abo":"abort", "abor":"abort", "abort":"abort",) -comment(// "e":"edit", "ed":"edit", "edi":"edit", "edit":"edit", "se":"send", "sen":"send",) -comment(// "send":"send", "st":"stop", "sto":"stop", "stop":"stop"]) - -comment(// miniShellScript:) -comment(// dummy methods) -keyword(def) method(invokeEditor)operator(()operator(\)) operator({) ident(println) string operator(}) -keyword(def) method(deliverMessage)operator(()operator(\)) operator({) ident(println) string operator(+) keyword(new) pre_type(Date)operator(()operator(\)) operator(}) -ident(actions) operator(=) operator([) - key(edit)operator(:) local_variable(this)operator(.)operator(&)ident(invokeEditor)operator(,) - key(send)operator(:) local_variable(this)operator(.)operator(&)ident(deliverMessage)operator(,) - key(list)operator(:) operator({) ident(println) pre_type(Runtime)operator(.)ident(runtime)operator(.)ident(freeMemory)operator(()operator(\)) operator(})operator(,) - key(abort)operator(:) operator({) pre_type(System)operator(.)ident(exit)operator(()integer(0)operator(\)) operator(})operator(,) - key(unknown)operator(:) operator({) ident(println) stringoperator(}) -operator(]) - -ident(table) operator(=) ident(buildAbbrev)operator(()ident(actions)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(toList)operator(()operator(\))operator(\)) -ident(prompt) operator(=) string )delimiter(')> -ident(print) string operator(+) ident(prompt) -keyword(new) pre_type(BufferedReader)operator(()keyword(new) pre_type(InputStreamReader)operator(()pre_type(System)operator(.)ident(in)operator(\))operator(\))operator(.)ident(eachLine)operator({) ident(line) operator(->) - keyword(def) ident(idx) operator(=) operator(()ident(table)operator(.)ident(containsKey)operator(()ident(line)operator(\))operator(\)) operator(?) ident(table)operator([)ident(line)operator(]) operator(:) string - ident(actions)operator([)ident(idx)operator(])operator(()operator(\)) - ident(print) ident(prompt) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.21) -comment(//----------------------------------------------------------------------------------) -comment(//% gunzip -c ~/mail/archive.gz | urlify > archive.urlified) -comment(//% urlify ~/mail/*.inbox > ~/allmail.urlified) - -ident(urls) operator(=) string -ident(ltrs) operator(=) regexp -ident(gunk) operator(=) regexp -ident(punc) operator(=) regexp -ident(doll) operator(=) regexp -ident(all) operator(=) regexpinlineinlinedelimiter(/)> - -ident(findUrls) operator(=) stringcontent( : # need resource and a colon - [)inlinecontent(] +? # followed by on or more of any valid - # character, but be conservative and - # take only what you need to... - \) # end group 1 } - (?= # look-ahead non-consumptive assertion - [)inlinecontent(]* # either 0 or more punctuation - [^)inlinecontent(] # followed by a non-url character - | # or else - )inlinecontent( # then end of the string - \) -)delimiter(""")> - -ident(input) operator(=) string - -ident(println) ident(input)operator(.)ident(replaceAll)operator(()ident(findUrls)operator(,)string$1)delimiter(')>operator(\)) -comment(// =>) -comment(// If you find a typo on http://groovy.codehaus.org please) -comment(// send an email to mail:spelling.pedant@codehaus.org) - -comment(// urlifyScript:) -doctype(#!/usr/bin/groovy) -comment(// urlify - wrap HTML links around URL-like constructs) -comment(// definitions from above) -ident(args)operator(.)ident(each)operator({) ident(file) operator(->) - keyword(new) pre_type(File)operator(()ident(file)operator(\))operator(.)ident(eachLine)operator({) ident(line) operator(->) - ident(println) ident(line)operator(.)ident(replaceAll)operator(()ident(findUrls)operator(,)string$1)delimiter(')>operator(\)) - operator(}) -operator(}) - -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.22) -comment(//----------------------------------------------------------------------------------) -comment(// @@INCOMPLETE@@) -comment(// @@INCOMPLETE@@) - -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_6.23) -comment(//----------------------------------------------------------------------------------) -ident(romans) operator(=) regexp -keyword(assert) string operator(=~) ident(romans) -comment(// can't have tens before 1000s (M\) or 100s (C\) after 5s (V\)) -keyword(assert) operator(!)operator(()string operator(=~) ident(romans)operator(\)) - -comment(// swap first two words) -keyword(assert) stringoperator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\)) operator(==) string - -comment(// extract keyword and value) -ident(m) operator(=) string operator(=~) regexp -keyword(assert) ident(m)operator(.)ident(matches)operator(()operator(\)) -keyword(assert) ident(m)operator([)integer(0)operator(])operator([)integer(1)operator(]) operator(==) string -keyword(assert) ident(m)operator([)integer(0)operator(])operator([)integer(2)operator(]) operator(==) string - -ident(hasAtLeastSize) operator(=) operator({) ident(n) operator(->) regexpcontent(,})delimiter(/)> operator(}) -keyword(assert) string operator(=~) ident(hasAtLeastSize)operator(()integer(20)operator(\)) - -comment(// MM/DD/YY HH:MM:SS (lenient - doesn't check HH > 23 etc\)) -ident(d) operator(=) regexp -ident(datetime) operator(=) stringcontent(\)/()inlinecontent(\)/()inlinecontent(\) ()inlinecontent(\):()inlinecontent(\):()inlinecontent(\))delimiter(")> -keyword(assert) string operator(=~) ident(datetime) - -ident(orig) operator(=) string -ident(expected) operator(=) string -ident(orig)operator(.)ident(replaceAll)operator(()stringoperator(,)stringoperator(\)) operator(==) ident(expected) - -ident(escapeSequenceRegex) operator(=) regexp -ident(convertEscapeToChar) operator(=) operator({) pre_type(Object)type([]) ident(ch) operator(->) keyword(new) pre_type(Character)operator(()operator(()type(char)operator(\))pre_type(Integer)operator(.)ident(parseInt)operator(()ident(ch)operator([)integer(1)operator(])operator(,)integer(16)operator(\))operator(\)) operator(}) -keyword(assert) stringoperator(.)ident(replaceAll)operator(()ident(escapeSequenceRegex)operator(,) ident(convertEscapeToChar)operator(\)) operator(==) string - -ident(commentStripper) operator(=) string - -ident(input) operator(=) string -ident(expected) operator(=) string - -keyword(assert) ident(input)operator(.)ident(replaceAll)operator(()ident(commentStripper)operator(,)stringoperator(\)) operator(==) ident(expected) - -comment(// emulate s.trim(\)) -keyword(assert) stringoperator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\)) operator(==) string - -comment(// convert \\\\n into \\n) -keyword(assert) operator(()regexpoperator(.)ident(replaceAll)operator(()regexpoperator(,)stringoperator(\)) operator(==) stringoperator(\)) - -comment(// remove package symbol (Groovy/Java doesn't use this as package symbol\)) -keyword(assert) stringoperator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\)) operator(==) string - -comment(// match IP Address (requires leading 0's\)) -ident(ipregex) operator(=) regexp operator(+) - regexp -keyword(assert) operator(!)operator(()string operator(=~) ident(ipregex)operator(\)) -keyword(assert) string operator(=~) ident(ipregex) - -comment(// extract basename) -keyword(assert) stringoperator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\)) operator(==) string - -ident(termcap) operator(=) string -ident(m) operator(=) operator(()ident(termcap) operator(=~) regexpoperator(\)) -keyword(assert) ident(m)operator(.)ident(count) operator(==) integer(1) -keyword(assert) ident(m)operator([)integer(0)operator(])operator([)integer(1)operator(]) operator(==) string - -keyword(assert) stringoperator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\)) operator(==) string - -ident(os) operator(=) pre_type(System)operator(.)ident(getProperty)operator(()stringoperator(\)) -ident(println) string operator(+) operator(()ident(os) operator(==~) regexpoperator(\)) -ident(println) string operator(+) operator(()ident(os) operator(==~) regexpoperator(\)) -ident(println) string operator(+) operator(()ident(os) operator(==~) regexpoperator(\)) - -comment(// join multiline sting) -ident(multi) operator(=) stringoperator(.)ident(trim)operator(()operator(\)) -keyword(assert) ident(multi)operator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\)) operator(==) string - -comment(// nums in string) -ident(string) operator(=) string -ident(nums) operator(=) ident(string) operator(=~) regexp -keyword(assert) operator(()integer(0)operator(..<)ident(nums)operator(.)ident(count)operator(\))operator(.)ident(collect)operator({) ident(nums)operator([)local_variable(it)operator(])operator([)integer(1)operator(]) operator(})operator(.)ident(join)operator(()stringoperator(\)) operator(==) string - -comment(// capitalize words) -ident(words) operator(=) string -ident(capwords) operator(=) ident(words) operator(=~) regexp -keyword(assert) operator(()integer(0)operator(..<)ident(capwords)operator(.)ident(count)operator(\))operator(.)ident(collect)operator({) ident(capwords)operator([)local_variable(it)operator(])operator([)integer(1)operator(]) operator(})operator(.)ident(join)operator(()stringoperator(\)) operator(==) string - -ident(lowords) operator(=) ident(words) operator(=~) regexp -keyword(assert) operator(()integer(0)operator(..<)ident(lowords)operator(.)ident(count)operator(\))operator(.)ident(collect)operator({) ident(lowords)operator([)local_variable(it)operator(])operator([)integer(1)operator(]) operator(})operator(.)ident(join)operator(()stringoperator(\)) operator(==) string - -ident(capWords) operator(=) ident(words) operator(=~) regexp -keyword(assert) operator(()integer(0)operator(..<)ident(capWords)operator(.)ident(count)operator(\))operator(.)ident(collect)operator({) ident(capWords)operator([)local_variable(it)operator(])operator([)integer(1)operator(]) operator(})operator(.)ident(join)operator(()stringoperator(\)) operator(==) string - -ident(input) operator(=) stringhttp://groovy.codehaus.org please -send an email to mail:spelling.pedant@codehaus.org -)delimiter(''')> - -ident(linkRegex) operator(=) regexp]+?HREF)char(\\s)content(*=)char(\\s)content(*["']?([^'" >]+?\)[ '"]?>)delimiter(/)> comment(//') -ident(links) operator(=) ident(input) operator(=~) ident(linkRegex) -operator(()integer(0)operator(..<)ident(links)operator(.)ident(count)operator(\))operator(.)ident(each)operator({) ident(println) ident(links)operator([)local_variable(it)operator(])operator([)integer(1)operator(]) operator(}) -comment(// =>) -comment(// http://groovy.codehaus.org) -comment(// mail:spelling.pedant@codehaus.org) - -comment(// find middle initial if any) -ident(m) operator(=) string operator(=~) regexp -ident(initial) operator(=) ident(m)operator(.)ident(count) operator(?) ident(m)operator([)integer(0)operator(])operator([)integer(1)operator(]) operator(:) string -keyword(assert) ident(initial) operator(==) string - -comment(// inch marks to quotes) -ident(println) stringoperator(.)ident(replaceAll)operator(()regexpoperator(,) regexpoperator(\)) comment(//") -comment(// => I said ``Hello'' to you.) - -comment(// extract sentences (2 spaces or newline after punctuation\)) -ident(input) operator(=) string -ident(sentences) operator(=) type([]) -ident(strip) operator(=) ident(input)operator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(replaceAll)operator(()regexpoperator(,)stringoperator(\)) -ident(m) operator(=) ident(strip) operator(=~) regexp -operator(()integer(0)operator(..<)ident(m)operator(.)ident(count)operator(\))operator(.)ident(each)operator({) ident(sentences) operator(+=) ident(m)operator([)local_variable(it)operator(])operator([)integer(1)operator(]) operator(}) -keyword(assert) ident(sentences) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - -comment(// YYYY-MM-DD) -ident(m) operator(=) string operator(=~) regexp -keyword(assert) ident(m)operator(.)ident(matches)operator(()operator(\)) -keyword(assert) operator([)stringoperator(,) stringoperator(,) stringoperator(]) operator(==) operator([)ident(m)operator([)integer(0)operator(])operator([)integer(1)operator(])operator(,) ident(m)operator([)integer(0)operator(])operator([)integer(2)operator(])operator(,) ident(m)operator([)integer(0)operator(])operator([)integer(3)operator(])operator(]) - -ident(usPhoneRegex) operator(=) regexp -ident(numbers) operator(=) stringoperator(.)ident(trim)operator(()operator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\)) -keyword(assert) ident(numbers)operator(.)ident(every)operator({) local_variable(it) operator(==~) ident(usPhoneRegex) operator(}) - -ident(exclaimRegex) operator(=) regexp -keyword(assert) string operator(=~) ident(exclaimRegex) -keyword(assert) operator(!)operator(()string operator(=~) ident(exclaimRegex)operator(\)) - -ident(input) operator(=) string -ident(m) operator(=) ident(input) operator(=~) regexp -keyword(assert) ident(m)operator(.)ident(count) operator(==) integer(4) - - -comment(// @@PLEAC@@_6.22) -comment(// not an exact equivalent to original cookbook but has) -comment(// a reasonable subset of mostly similar functionality) -comment(// instead of -r recursion option, use Ant fileset wildcards) -comment(// e.g. **/*.c. You can also specify an excludes pattern) -comment(// e.g. **/*.* -X **/*.h will process all but header files) -comment(// (currently not optimised and with minimal error checking\)) -comment(// uses jopt-simple (jopt-simple.sf.net\)) - -ident(op) operator(=) keyword(new) ident(joptsimple)operator(.)ident(OptionParser)operator(()operator(\)) -ident(NOCASE) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(NOCASE)operator(,) string operator(\)) -ident(WITHN) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(WITHN)operator(,) string operator(\)) -ident(WITHF) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(WITHF)operator(,) string operator(\)) -ident(NONAME) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(NONAME)operator(,) string operator(\)) -ident(COUNT) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(COUNT)operator(,) string operator(\)) -ident(TCOUNT) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(TCOUNT)operator(,) string operator(\)) -ident(WORD) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(WORD)operator(,) string operator(\)) -ident(EXACT) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(EXACT)operator(,) string operator(\)) -ident(INVERT) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(INVERT)operator(,) string operator(\)) -ident(EXCLUDE) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(EXCLUDE)operator(,) string operator(\))operator(.) - ident(withRequiredArg)operator(()operator(\))operator(.)ident(describedAs)operator(()stringoperator(\)) -ident(MATCH) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(MATCH)operator(,) string operator(\)) -ident(NOMATCH) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(NOMATCH)operator(,) string operator(\)) -ident(PARA) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(PARA)operator(,) string operator(\))operator(.) - ident(withOptionalArg)operator(()operator(\))operator(.)ident(describedAs)operator(()stringoperator(\)) -ident(EXPR) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(EXPR)operator(,) string operator(\))operator(.) - ident(withRequiredArg)operator(()operator(\))operator(.)ident(describedAs)operator(()stringoperator(\)) -ident(FILE) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(FILE)operator(,) string operator(\))operator(.) - ident(withRequiredArg)operator(()operator(\))operator(.)ident(describedAs)operator(()stringoperator(\)) -ident(HELP) operator(=) stringoperator(;) ident(op)operator(.)ident(accepts)operator(() ident(HELP)operator(,) string operator(\)) - -ident(options) operator(=) ident(op)operator(.)ident(parse)operator(()ident(args)operator(\)) -ident(params) operator(=) ident(options)operator(.)ident(nonOptionArguments)operator(()operator(\)) -keyword(if) operator(()ident(options)operator(.)ident(wasDetected)operator(() ident(HELP) operator(\))operator(\)) operator({) - ident(op)operator(.)ident(printHelpOn)operator(() pre_type(System)operator(.)ident(out) operator(\)) -operator(}) keyword(else) keyword(if) operator(()ident(params)operator(.)ident(size)operator(()operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(println) stringcontent(' for more information.)delimiter(")> -operator(}) keyword(else) operator({) - ident(modifiers) operator(=) type([]) - ident(paraPattern) operator(=) string - ident(o_withn) operator(=) ident(options)operator(.)ident(wasDetected)operator(() ident(WITHN) operator(\)) - ident(o_withf) operator(=) ident(options)operator(.)ident(wasDetected)operator(() ident(WITHF) operator(\)) - ident(o_noname) operator(=) ident(options)operator(.)ident(wasDetected)operator(() ident(NONAME) operator(\)) - ident(o_count) operator(=) ident(options)operator(.)ident(wasDetected)operator(() ident(COUNT) operator(\)) - ident(o_tcount) operator(=) ident(options)operator(.)ident(wasDetected)operator(() ident(TCOUNT) operator(\)) - ident(o_invert) operator(=) ident(options)operator(.)ident(wasDetected)operator(() ident(INVERT) operator(\)) - ident(o_match) operator(=) ident(options)operator(.)ident(wasDetected)operator(() ident(MATCH) operator(\)) - ident(o_nomatch) operator(=) ident(options)operator(.)ident(wasDetected)operator(() ident(NOMATCH) operator(\)) - keyword(if) operator(()ident(options)operator(.)ident(wasDetected)operator(() ident(EXPR) operator(\))operator(\)) operator({) - ident(pattern) operator(=) ident(options)operator(.)ident(valueOf)operator(() ident(EXPR) operator(\)) - operator(}) keyword(else) keyword(if) operator(()ident(options)operator(.)ident(wasDetected)operator(() ident(FILE) operator(\))operator(\)) operator({) - ident(pattern) operator(=) keyword(new) pre_type(File)operator(()ident(options)operator(.)ident(valueOf)operator(() ident(FILE) operator(\))operator(\))operator(.)ident(text)operator(.)ident(trim)operator(()operator(\)) - operator(}) keyword(else) operator({) - ident(pattern) operator(=) ident(params)operator([)integer(0)operator(]) - ident(params) operator(=) ident(params)operator([)integer(1)operator(..)operator(-)integer(1)operator(]) - operator(}) - keyword(if) operator(()ident(options)operator(.)ident(wasDetected)operator(() ident(EXCLUDE) operator(\))operator(\)) ident(excludes) operator(=) ident(options)operator(.)ident(valueOf)operator(() ident(EXCLUDE) operator(\)) - keyword(else) ident(excludes) operator(=) operator([)stringoperator(]) - keyword(if) operator(()ident(options)operator(.)ident(wasDetected)operator(() ident(EXACT) operator(\))operator(\)) ident(pattern) operator(=) string operator(+) ident(pattern) operator(+) string - keyword(else) keyword(if) operator(()ident(options)operator(.)ident(wasDetected)operator(() ident(WORD) operator(\))operator(\)) ident(pattern) operator(=) regexpchar(\\b)delimiter(/)> - keyword(if) operator(()ident(options)operator(.)ident(wasDetected)operator(() ident(NOCASE) operator(\))operator(\)) ident(modifiers) operator(+=) string - keyword(if) operator(()ident(options)operator(.)ident(wasDetected)operator(() ident(PARA) operator(\))operator(\)) operator({) - keyword(if) operator(()ident(options)operator(.)ident(hasArgument)operator(() ident(PARA) operator(\))operator(\)) ident(paraPattern) operator(=) ident(options)operator(.)ident(valueOf)operator(() ident(PARA) operator(\)) - keyword(else) ident(paraPattern) operator(=) string - ident(paraPattern) operator(=) string operator(+) ident(paraPattern) - ident(modifiers) operator(+=) string - operator(}) - keyword(if) operator(()ident(modifiers)operator(\)) ident(pattern) operator(=) stringcontent(\))delimiter(")> operator(+) ident(pattern) - - keyword(if) operator(()ident(params)operator(.)ident(size)operator(()operator(\)) operator(==) integer(0)operator(\)) ident(grepStream)operator(()pre_type(System)operator(.)ident(in)operator(,) string)delimiter(')>operator(\)) - keyword(else) operator({) - ident(scanner) operator(=) keyword(new) ident(AntBuilder)operator(()operator(\))operator(.)ident(fileScanner) operator({) - ident(fileset)operator(()key(dir)operator(:)stringoperator(,) key(includes)operator(:)ident(params)operator(.)ident(join)operator(()stringoperator(\))operator(,) key(excludes)operator(:)ident(excludes)operator(\)) - operator(}) - keyword(for) operator(()ident(f) keyword(in) ident(scanner)operator(\)) operator({) - ident(grepStream)operator(()keyword(new) pre_type(FileInputStream)operator(()ident(f)operator(\))operator(,) ident(f)operator(\)) - operator(}) - operator(}) -operator(}) - -keyword(def) method(grepStream)operator(()ident(s)operator(,) ident(name)operator(\)) operator({) - keyword(def) ident(count) operator(=) integer(0) - keyword(def) ident(tcount) operator(=) integer(0) - keyword(def) ident(pieces) - keyword(if) operator(()ident(paraPattern)operator(\)) ident(pieces) operator(=) ident(s)operator(.)ident(text)operator(.)ident(split)operator(()ident(paraPattern)operator(\)) - keyword(else) ident(pieces) operator(=) ident(s)operator(.)ident(readLines)operator(()operator(\)) - keyword(def) ident(fileMode) operator(=) ident(o_match) operator(||) ident(o_nomatch) operator(||) ident(o_count) operator(||) ident(o_tcount) - ident(pieces)operator(.)ident(eachWithIndex)operator({)ident(line)operator(,) ident(index) operator(->) - keyword(def) ident(m) operator(=) ident(line) operator(=~) ident(pattern) - type(boolean) ident(found) operator(=) ident(m)operator(.)ident(count) - keyword(if) operator(()ident(found) operator(!=) ident(o_invert)operator(\)) operator({) - ident(count)operator(++) - ident(tcount) operator(+=) ident(m)operator(.)ident(count) - keyword(if) operator(()operator(!)ident(fileMode)operator(\)) operator({) - ident(linefields) operator(=) type([]) - keyword(if) operator(()ident(o_withf)operator(\)) ident(linefields) operator(+=) ident(name) - keyword(if) operator(()ident(o_withn)operator(\)) ident(linefields) operator(+=) ident(index) operator(+) integer(1) - ident(linefields) operator(+=) ident(line) - ident(println) ident(linefields)operator(.)ident(join)operator(()stringoperator(\)) - operator(}) - operator(}) - operator(}) - keyword(def) ident(display) operator(=) pre_constant(true) - keyword(if) operator(()operator(()ident(o_match) operator(&&) ident(count) operator(==) integer(0)operator(\)) operator(||) operator(()ident(o_nomatch) operator(&&) ident(count) operator(!=) integer(0)operator(\))operator(\)) ident(display) operator(=) pre_constant(false) - keyword(if) operator(()ident(fileMode) operator(&&) ident(display)operator(\)) operator({) - ident(filefields) operator(=) type([]) - keyword(if) operator(()operator(!)ident(o_noname)operator(\)) ident(filefields) operator(+=) ident(name) - keyword(if) operator(()ident(o_tcount)operator(\)) ident(filefields) operator(+=) ident(tcount) - keyword(else) keyword(if) operator(()ident(o_count)operator(\)) ident(filefields) operator(+=) ident(count) - ident(println) ident(filefields)operator(.)ident(join)operator(()stringoperator(\)) - operator(}) -operator(}) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_7.0) -comment(//----------------------------------------------------------------------------------) -comment(//testfile = new File('/usr/local/widgets/data'\) // unix) -ident(testfile) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) comment(// windows) -ident(testfile)operator(.)ident(eachLine)operator({) keyword(if) operator(()local_variable(it) operator(=~) regexpoperator(\)) ident(println) local_variable(it) operator(}) - -comment(// Groovy (like Java\) uses the File class as an abstraction for) -comment(// the path representing a potential file system resource.) -comment(// Channels and Streams (along with Reader adn Writer helper) -comment(// classes\) are used to read and write to files (and other) -comment(// things\). Files, channels, streams etc are all "normal") -comment(// objects; they can be passed around in your programs just) -comment(// like other objects (though there are some restrictions) -comment(// covered elsewhere - e.g. you can't expect to pass a File) -comment(// object between JVMs on different machines running different) -comment(// operating systems and expect them to maintain a meaningful) -comment(// value across the different JVMs\). In addition to Streams,) -comment(// there is also support for random access to files.) - -comment(// Many operations are available on streams and channels. Some) -comment(// return values to indicate success or failure, some can throw) -comment(// exceptions, other times both styles of error reporting may be) -comment(// available.) - -comment(// Streams at the lowest level are just a sequence of bytes though) -comment(// there are various abstractions at higher levels to allow) -comment(// interacting with streams at encoded character, data type or) -comment(// object levels if desired. Standard streams include System.in,) -comment(// System.out and System.err. Java and Groovy on top of that) -comment(// provide facilities for buffering, filtering and processing) -comment(// streams in various ways.) - -comment(// File channels provide more powerful operations than streams) -comment(// for reading and writing files such as locks, buffering,) -comment(// positioning, concurrent reading and writing, mapping to memory) -comment(// etc. In the examples which follow, streams will be used for) -comment(// simple cases, channels when more advanced features are) -comment(// required. Groovy currently focusses on providing extra support) -comment(// at the file and stream level rather than channel level.) -comment(// This makes the simple things easy but lets you do more complex) -comment(// things by just using the appropriate Java classes. All Java) -comment(// classes are available within Groovy by default.) - -comment(// Groovy provides syntactic sugar over the top of Java's file) -comment(// processing capabilities by providing meaning to shorthand) -comment(// operators and by automatically handling scaffolding type) -comment(// code such as opening, closing and handling exceptions behind) -comment(// the scenes. It also provides many powerful closure operators,) -comment(// e.g. file.eachLineMatch(pattern\){ some_operation } will open) -comment(// the file, process it line-by-line, finding all lines which) -comment(// match the specified pattern and then invoke some operation) -comment(// for the matching line(s\) if any, before closing the file.) - - -comment(// this example shows how to access the standard input stream) -comment(// numericCheckingScript:) -ident(prompt) operator(=) string )delimiter(')> -ident(print) string operator(+) ident(prompt) -keyword(new) pre_type(BufferedReader)operator(()keyword(new) pre_type(InputStreamReader)operator(()pre_type(System)operator(.)ident(in)operator(\))operator(\))operator(.)ident(eachLine)operator({) ident(line) operator(->) - comment(// line is read from System.in) - keyword(if) operator(()ident(line) operator(=~) stringoperator(\)) ident(println) stringdelimiter(")> comment(// normal output to System.out) - keyword(else) pre_type(System)operator(.)ident(err)operator(.)ident(println) string comment(// this message to System.err) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.1) -comment(//----------------------------------------------------------------------------------) -comment(// test values (change for your os and directories\)) -ident(inputPath)operator(=)stringoperator(;) ident(outPath)operator(=)string - -comment(// For input Java uses InputStreams (for byte-oriented processing\) or Readers) -comment(// (for character-oriented processing\). These can throw FileNotFoundException.) -comment(// There are also other stream variants: buffered, data, filters, objects, ...) -ident(inputFile) operator(=) keyword(new) pre_type(File)operator(()ident(inputPath)operator(\)) -ident(inputStream) operator(=) keyword(new) pre_type(FileInputStream)operator(()ident(inputFile)operator(\)) -ident(reader) operator(=) keyword(new) pre_type(FileReader)operator(()ident(inputFile)operator(\)) -ident(inputChannel) operator(=) ident(inputStream)operator(.)ident(channel) - -comment(// Examples for random access to a file) -ident(file) operator(=) keyword(new) pre_type(RandomAccessFile)operator(()ident(inputFile)operator(,) stringoperator(\)) comment(// for read and write) -ident(channel) operator(=) ident(file)operator(.)ident(channel) - -comment(// Groovy provides some sugar coating on top of Java) -ident(println) ident(inputFile)operator(.)ident(text)operator(.)ident(size)operator(()operator(\)) -comment(// => 13496) - -comment(// For output Java use OutputStreams or Writers. Can throw FileNotFound) -comment(// or IO exceptions. There are also other flavours of stream: buffered,) -comment(// data, filters, objects, ...) -ident(outFile) operator(=) keyword(new) pre_type(File)operator(()ident(outPath)operator(\)) -ident(appendFlag) operator(=) pre_constant(false) -ident(outStream) operator(=) keyword(new) pre_type(FileOutputStream)operator(()ident(outFile)operator(,) ident(appendFlag)operator(\)) -ident(writer) operator(=) keyword(new) pre_type(FileWriter)operator(()ident(outFile)operator(,) ident(appendFlag)operator(\)) -ident(outChannel) operator(=) ident(outStream)operator(.)ident(channel) - -comment(// Also some Groovy sugar coating) -ident(outFile) operator(<)operator(<) string -ident(println) ident(outFile)operator(.)ident(text)operator(.)ident(size)operator(()operator(\)) comment(// => 24) - -comment(// @@PLEAC@@_7.2) -comment(//----------------------------------------------------------------------------------) -comment(// No problem with Groovy since the filename doesn't contain characters with) -comment(// special meaning; like Perl's sysopen. Options are either additional parameters) -comment(// or captured in different classes, e.g. Input vs Output, Buffered vs non etc.) -keyword(new) pre_type(FileReader)operator(()ident(inputPath)operator(\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.3) -comment(//----------------------------------------------------------------------------------) -comment(// '~' is a shell expansion feature rather than file system feature per se.) -comment(// Because '~' is a valid filename character in some operating systems, and Java) -comment(// attempts to be cross-platform, it doesn't automatically expand Tilde's.) -comment(// Given that '~' expansion is commonly used however, Java puts the $HOME) -comment(// environment variable (used by shells to do typical expansion\) into the) -comment(// "user.home" system property. This works across operating systems - though) -comment(// the value inside differs from system to system so you shouldn't rely on its) -comment(// content to be of a particular format. In most cases though you should be) -comment(// able to write a regex that will work as expected. Also, Apple's) -comment(// NSPathUtilities can expand and introduce Tildes on platforms it supports.) -ident(path) operator(=) string -ident(name) operator(=) pre_type(System)operator(.)ident(getProperty)operator(()stringoperator(\)) -ident(home) operator(=) pre_type(System)operator(.)ident(getProperty)operator(()stringoperator(\)) -ident(println) ident(home) operator(+) ident(path)operator(.)ident(replaceAll)operator(()stringcontent((.*\))delimiter(")>operator(,) stringoperator(\)) -comment(// => C:\\Documents and Settings\\Paul/.cvspass) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.4) -comment(//----------------------------------------------------------------------------------) -comment(// The exception raised in Groovy reports the filename) -keyword(try) operator({) - keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(text) -operator(}) keyword(catch) operator(()exception(Exception) ident(ex)operator(\)) operator({) - pre_type(System)operator(.)ident(err)operator(.)ident(println)operator(()ident(ex)operator(.)ident(message)operator(\)) -operator(}) -comment(// =>) -comment(// unknown_path\\bad_file.ext (The system cannot find the path specified\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.5) -comment(//----------------------------------------------------------------------------------) -keyword(try) operator({) - ident(temp) operator(=) pre_type(File)operator(.)ident(createTempFile)operator(()stringoperator(,) stringoperator(\)) - ident(temp)operator(.)ident(deleteOnExit)operator(()operator(\)) -operator(}) keyword(catch) operator(()exception(IOException) ident(ex)operator(\)) operator({) - pre_type(System)operator(.)ident(err)operator(.)ident(println)operator(()stringoperator(\)) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.6) -comment(//----------------------------------------------------------------------------------) -comment(// no special features are provided, here is a way to do it manually) -comment(// DO NOT REMOVE THE FOLLOWING STRING DEFINITION.) -ident(pleac_7_6_embeddedFileInfo) operator(=) string -ident(ls) operator(=) pre_type(System)operator(.)ident(getProperty)operator(()stringoperator(\)) -ident(file) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) -ident(regex) operator(=) regexp -keyword(def) method(readEmbeddedInfo)operator(()operator(\)) operator({) - ident(m) operator(=) ident(file)operator(.)ident(text) operator(=~) ident(regex) - ident(println) string operator(+) ident(m)operator([)integer(0)operator(])operator([)integer(1)operator(]) -operator(}) -keyword(def) method(writeEmbeddedInfo)operator(()operator(\)) operator({) - ident(lastMod) operator(=) keyword(new) pre_type(Date)operator(()ident(file)operator(.)ident(lastModified)operator(()operator(\))operator(\)) - ident(newInfo) operator(=) stringcontent(Script size is )inlineinlinecontent(Last script update: )inlineinlinedelimiter(")> - ident(file)operator(.)ident(write)operator(()ident(file)operator(.)ident(text)operator(.)ident(replaceAll)operator(()ident(regex)operator(,) ident(newInfo)operator(\))operator(\)) -operator(}) -ident(readEmbeddedInfo)operator(()operator(\)) -comment(// writeEmbeddedInfo(\) // uncomment to make script update itself) -comment(// readEmbeddedInfo(\) // uncomment to redisplay the embedded info after the update) - -comment(// => (output when above two method call lines are uncommented\)) -comment(// Found:) -comment(//) -comment(// Script size is 13550) -comment(// Last script update: Wed Jan 10 18:56:03 EST 2007) -comment(//) -comment(// Found:) -comment(//) -comment(// Script size is 13731) -comment(// Last script update: Wed Jan 10 19:05:58 EST 2007) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.7) -comment(//----------------------------------------------------------------------------------) -comment(// general pattern for reading from System.in is:) -comment(// System.in.readLines(\).each{ processLine(it\) }) - -comment(// general pattern for a filter which can either process file args or read from System.in is:) -comment(// if (args.size(\) != 0\) args.each{) -comment(// file -> new File(file\).eachLine{ processLine(it\) }) -comment(// } else System.in.readLines(\).each{ processLine(it\) }) - -comment(// note: the following examples are file-related per se. They show) -comment(// how to do option processing in scenarios which typically also) -comment(// involve file arguments. The reader should also consider using a) -comment(// pre-packaged options parser package (there are several popular) -comment(// ones\) rather than the hard-coded processing examples shown here.) - -ident(chopFirst) operator(=) pre_constant(false) -ident(columns) operator(=) integer(0) -ident(args) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) - -comment(// demo1: optional c) -keyword(if) operator(()ident(args)operator([)integer(0)operator(]) operator(==) stringoperator(\)) operator({) - ident(chopFirst) operator(=) pre_constant(true) - ident(args) operator(=) ident(args)operator([)integer(1)operator(..)operator(-)integer(1)operator(]) -operator(}) - -keyword(assert) ident(args) operator(==) operator([)stringoperator(,) stringoperator(]) -keyword(assert) ident(chopFirst) - -comment(// demo2: processing numerical options) -keyword(if) operator(()ident(args)operator([)integer(0)operator(]) operator(=~) regexpoperator(\)) operator({) - ident(columns) operator(=) ident(args)operator([)integer(0)operator(])operator([)integer(1)operator(..)operator(-)integer(1)operator(])operator(.)ident(toInteger)operator(()operator(\)) - ident(args) operator(=) ident(args)operator([)integer(1)operator(..)operator(-)integer(1)operator(]) -operator(}) - -keyword(assert) ident(args) operator(==) operator([)stringoperator(]) -keyword(assert) ident(columns) operator(==) integer(30) - -comment(// demo3: multiple args (again consider option parsing package\)) -ident(args) operator(=) operator([)stringoperator(,)stringoperator(,)stringoperator(,)stringoperator(]) -ident(nostdout) operator(=) pre_constant(false) -ident(append) operator(=) pre_constant(false) -ident(unbuffer) operator(=) pre_constant(false) -ident(ignore_ints) operator(=) pre_constant(false) -ident(files) operator(=) type([]) -ident(args)operator(.)ident(each)operator({) ident(arg) operator(->) - keyword(switch)operator(()ident(arg)operator(\)) operator({) - keyword(case) stringoperator(:) ident(nostdout) operator(=) pre_constant(true)operator(;) keyword(break) - keyword(case) stringoperator(:) ident(append) operator(=) pre_constant(true)operator(;) keyword(break) - keyword(case) stringoperator(:) ident(unbuffer) operator(=) pre_constant(true)operator(;) keyword(break) - keyword(case) stringoperator(:) ident(ignore_ints) operator(=) pre_constant(true)operator(;) keyword(break) - keyword(default)operator(:) ident(files) operator(+=) ident(arg) - operator(}) -operator(}) -keyword(if) operator(()ident(files)operator(.)ident(any)operator({) local_variable(it)operator(.)ident(startsWith)operator(()stringoperator(\))operator(})operator(\)) operator({) - pre_type(System)operator(.)ident(err)operator(.)ident(println)operator(()stringoperator(\)) -operator(}) -comment(// process files ...) -keyword(assert) ident(nostdout) operator(&&) ident(append) operator(&&) operator(!)ident(unbuffer) operator(&&) operator(!)ident(ignore_ints) -keyword(assert) ident(files) operator(==) operator([)stringoperator(,)stringoperator(]) - -comment(// find login: print all lines containing the string "login" (command-line version\)) -comment(//% groovy -ne "if (line =~ 'login'\) println line" filename) - -comment(// find login variation: lines containing "login" with line number (command-line version\)) -comment(//% groovy -ne "if (line =~ 'login'\) println count + ':' + line" filename) - -comment(// lowercase file (command-line version\)) -comment(//% groovy -pe "line.toLowerCase(\)") - - -comment(// count chunks but skip comments and stop when reaching "__DATA__" or "__END__") -ident(chunks) operator(=) integer(0)operator(;) ident(done) operator(=) pre_constant(false) -ident(testfile) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) comment(// change on your system) -ident(lines) operator(=) ident(testfile)operator(.)ident(readLines)operator(()operator(\)) -keyword(for) operator(()ident(line) keyword(in) ident(lines)operator(\)) operator({) - keyword(if) operator(()operator(!)ident(line)operator(.)ident(trim)operator(()operator(\))operator(\)) keyword(continue) - ident(words) operator(=) ident(line)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(toList)operator(()operator(\)) - keyword(for) operator(()ident(word) keyword(in) ident(words)operator(\)) operator({) - keyword(if) operator(()ident(word) operator(=~) regexpoperator(\)) keyword(break) - keyword(if) operator(()ident(word) keyword(in) operator([)stringoperator(,) stringoperator(])operator(\)) operator({) ident(done) operator(=) pre_constant(true)operator(;) keyword(break) operator(}) - ident(chunks) operator(+=) integer(1) - operator(}) - keyword(if) operator(()ident(done)operator(\)) keyword(break) -operator(}) -ident(println) stringcontent( chunks)delimiter(")> - - -comment(// groovy "one-liner" (cough cough\) for turning .history file into pretty version:) -comment(//% groovy -e "m=new File(args[0]\).text=~/(?ms\)^#\\+(\\d+\)\\r?\\n(.*?\)$/;(0..) -comment(// Sun Jan 11 18:26:22 EST 1970 less /etc/motd) -comment(// Sun Jan 11 18:26:22 EST 1970 vi ~/.exrc) -comment(// Sun Jan 11 18:26:22 EST 1970 date) -comment(// Sun Jan 11 18:26:22 EST 1970 who) -comment(// Sun Jan 11 18:26:22 EST 1970 telnet home) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_7.8) -comment(//----------------------------------------------------------------------------------) -comment(// test data for below) -ident(testPath) operator(=) string - -comment(// general pattern) -keyword(def) method(processWithBackup)operator(()ident(inputPath)operator(,) ident(Closure) ident(processLine)operator(\)) operator({) - keyword(def) ident(input) operator(=) keyword(new) pre_type(File)operator(()ident(inputPath)operator(\)) - keyword(def) ident(out) operator(=) pre_type(File)operator(.)ident(createTempFile)operator(()stringoperator(,) stringoperator(\)) - ident(out)operator(.)ident(write)operator(()stringoperator(\)) comment(// create empty file) - ident(count) operator(=) integer(0) - ident(input)operator(.)ident(eachLine)operator({) ident(line) operator(->) - ident(count)operator(++) - ident(processLine)operator(()ident(out)operator(,) ident(line)operator(,) ident(count)operator(\)) - operator(}) - keyword(def) ident(dest) operator(=) keyword(new) pre_type(File)operator(()ident(inputPath) operator(+) stringoperator(\)) - ident(dest)operator(.)ident(delete)operator(()operator(\)) comment(// clobber previous backup) - ident(input)operator(.)ident(renameTo)operator(()ident(dest)operator(\)) - ident(out)operator(.)ident(renameTo)operator(()ident(input)operator(\)) -operator(}) - -comment(// use withPrintWriter if you don't want the '\\n''s appearing) -ident(processWithBackup)operator(()ident(testPath)operator(\)) operator({) ident(out)operator(,) ident(line)operator(,) ident(count) operator(->) - keyword(if) operator(()ident(count) operator(==) integer(20)operator(\)) operator({) comment(// we are at the 20th line) - ident(out) operator(<)operator(<) string - ident(out) operator(<)operator(<) string - operator(}) - ident(out) operator(<)operator(<) ident(line) operator(+) string -operator(}) - -ident(processWithBackup)operator(()ident(testPath)operator(\)) operator({) ident(out)operator(,) ident(line)operator(,) ident(count) operator(->) - keyword(if) operator(()operator(!)operator(()ident(count) keyword(in) integer(20)operator(..)integer(30)operator(\))operator(\)) comment(// skip the 20th line to the 30th) - ident(out) operator(<)operator(<) ident(line) operator(+) string -operator(}) -comment(// equivalent to "one-liner":) -comment(//% groovy -i.orig -pe "if (!(count in 20..30\)\) out << line" testPath) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_7.9) -comment(//----------------------------------------------------------------------------------) -comment(//% groovy -i.orig -pe 'FILTER COMMAND' file1 file2 file3 ...) - -comment(// the following may also be possible on unix systems (unchecked\)) -comment(//#!/usr/bin/groovy -i.orig -p) -comment(// filter commands go here) - -comment(// "one-liner" templating scenario: change DATE -> current time) -comment(//% groovy -pi.orig -e 'line.replaceAll(/DATE/\){new Date(\)}') - -comment(//% groovy -i.old -pe 'line.replaceAll(/\\bhisvar\\b/, 'hervar'\)' *.[Cchy] (globbing platform specific\)) - -comment(// one-liner for correcting spelling typos) -comment(//% groovy -i.orig -pe 'line.replaceAll(/\\b(p\)earl\\b/i, '\\1erl'\)' *.[Cchy] (globbing platform specific\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_7.10) -comment(//----------------------------------------------------------------------------------) -comment(// general pattern) -keyword(def) method(processFileInplace)operator(()ident(file)operator(,) ident(Closure) ident(processText)operator(\)) operator({) - keyword(def) ident(text) operator(=) ident(file)operator(.)ident(text) - ident(file)operator(.)ident(write)operator(()ident(processText)operator(()ident(text)operator(\))operator(\)) -operator(}) - -comment(// templating scenario: change DATE -> current time) -ident(testfile) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) comment(// replace on your system) -ident(processFileInplace)operator(()ident(testfile)operator(\)) operator({) ident(text) operator(->) - ident(text)operator(.)ident(replaceAll)operator(()regexpoperator(,) keyword(new) pre_type(Date)operator(()operator(\))operator(.)ident(toString)operator(()operator(\))operator(\)) -operator(}) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_7.11) -comment(//----------------------------------------------------------------------------------) -comment(// You need to use Java's Channel class to acquire locks. The exact) -comment(// nature of the lock is somewhat dependent on the operating system.) -keyword(def) method(processFileWithLock)operator(()ident(file)operator(,) ident(processStream)operator(\)) operator({) - keyword(def) ident(random) operator(=) keyword(new) pre_type(RandomAccessFile)operator(()ident(file)operator(,) stringoperator(\)) - keyword(def) ident(lock) operator(=) ident(random)operator(.)ident(channel)operator(.)ident(lock)operator(()operator(\)) comment(// acquire exclusive lock) - ident(processStream)operator(()ident(random)operator(\)) - ident(lock)operator(.)ident(release)operator(()operator(\)) - ident(random)operator(.)ident(close)operator(()operator(\)) -operator(}) - -comment(// Instead of an exclusive lock you can acquire a shared lock.) - -comment(// Also, you can acquire a lock for a region of a file by specifying) -comment(// start and end positions of the region when acquiring the lock.) - -comment(// For non-blocking functionality, use tryLock(\) instead of lock(\).) -keyword(def) method(processFileWithTryLock)operator(()ident(file)operator(,) ident(processStream)operator(\)) operator({) - ident(random) operator(=) keyword(new) pre_type(RandomAccessFile)operator(()ident(file)operator(,) stringoperator(\)) - ident(channel) operator(=) ident(random)operator(.)ident(channel) - keyword(def) ident(MAX_ATTEMPTS) operator(=) integer(30) - keyword(for) operator(()ident(i) keyword(in) integer(0)operator(..<)ident(MAX_ATTEMPTS)operator(\)) operator({) - ident(lock) operator(=) ident(channel)operator(.)ident(tryLock)operator(()operator(\)) - keyword(if) operator(()ident(lock) operator(!=) pre_constant(null)operator(\)) keyword(break) - ident(println) string - pre_type(Thread)operator(.)ident(sleep)operator(()integer(500)operator(\)) comment(// 500 millis = 0.5 secs) - operator(}) - keyword(if) operator(()ident(lock) operator(==) pre_constant(null)operator(\)) operator({) - ident(println) string - operator(}) keyword(else) operator({) - ident(processStream)operator(()ident(random)operator(\)) - ident(lock)operator(.)ident(release)operator(()operator(\)) - operator(}) - ident(random)operator(.)ident(close)operator(()operator(\)) -operator(}) - - -comment(// non-blocking multithreaded example: print first line while holding lock) -pre_type(Thread)operator(.)ident(start)operator({) - ident(processFileWithLock)operator(()ident(testfile)operator(\)) operator({) ident(source) operator(->) - ident(println) string operator(+) ident(source)operator(.)ident(readLine)operator(()operator(\))operator(.)ident(toUpperCase)operator(()operator(\)) - pre_type(Thread)operator(.)ident(sleep)operator(()integer(2000)operator(\)) comment(// 2000 millis = 2 secs) - operator(}) -operator(}) -ident(processFileWithTryLock)operator(()ident(testfile)operator(\)) operator({) ident(source) operator(->) - ident(println) string operator(+) ident(source)operator(.)ident(readLine)operator(()operator(\))operator(.)ident(toUpperCase)operator(()operator(\)) -operator(}) -comment(// =>) -comment(// Could not get lock, pausing ...) -comment(// First reader: WAS LOWERCASE) -comment(// Could not get lock, pausing ...) -comment(// Could not get lock, pausing ...) -comment(// Could not get lock, pausing ...) -comment(// Could not get lock, pausing ...) -comment(// Second reader: WAS LOWERCASE) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_7.12) -comment(//----------------------------------------------------------------------------------) -comment(// In Java, input and output streams have a flush(\) method and file channels) -comment(// have a force(\) method (applicable also to memory-mapped files\). When creating) -comment(// PrintWriters and // PrintStreams, an autoFlush option can be provided.) -comment(// From a FileInput or Output Stream you can ask for the FileDescriptor) -comment(// which has a sync(\) method - but you wouldn't you'd just use flush(\).) - -ident(inputStream) operator(=) ident(testfile)operator(.)ident(newInputStream)operator(()operator(\)) comment(// returns a buffered input stream) -ident(autoFlush) operator(=) pre_constant(true) -ident(printStream) operator(=) keyword(new) pre_type(PrintStream)operator(()ident(outStream)operator(,) ident(autoFlush)operator(\)) -ident(printWriter) operator(=) keyword(new) pre_type(PrintWriter)operator(()ident(outStream)operator(,) ident(autoFlush)operator(\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_7.13) -comment(//----------------------------------------------------------------------------------) -comment(// See the comments in 7.14 about scenarios where non-blocking can be) -comment(// avoided. Also see 7.14 regarding basic information about channels.) -comment(// An advanced feature of the java.nio.channels package is supported) -comment(// by the Selector and SelectableChannel classes. These allow efficient) -comment(// server multiplexing amongst responses from a number of potential sources.) -comment(// Under the covers, it allows mapping to native operating system features) -comment(// supporting such multiplexing or using a pool of worker processing threads) -comment(// much smaller in size than the total available connections.) -comment(//) -comment(// The general pattern for using selectors is:) -comment(//) -comment(// while (true\) {) -comment(// selector.select(\)) -comment(// def it = selector.selectedKeys(\).iterator(\)) -comment(// while (it.hasNext(\)\) {) -comment(// handleKey(it++\)) -comment(// it.remove(\)) -comment(// }) -comment(// }) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_7.14) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy has no special support for this apart from making it easier to) -comment(// create threads (see note at end\); it relies on Java's features here.) - -comment(// InputStreams in Java/Groovy block if input is not yet available.) -comment(// This is not normally an issue, because if you have a potential blocking) -comment(// operation, e.g. save a large file, you normally just create a thread) - comment(// and save it in the background.) - -comment(// Channels are one way to do non-blocking stream-based IO.) -comment(// Classes which implement the AbstractSelectableChannel interface provide) -comment(// a configureBlocking(boolean\) method as well as an isBlocking(\) method.) -comment(// When processing a non-blocking stream, you need to process incoming) -comment(// information based on the number of bytes read returned by the various) -comment(// read methods. For non-blocking, this can be 0 bytes even if you pass) -comment(// a fixed size byte[] buffer to the read method. Non-blocking IO is typically) -comment(// not used with Files but more normally with network streams though they) -comment(// can when Pipes (couple sink and source channels\) are involved where) -comment(// one side of the pipe is a file.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_7.15) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy uses Java's features here.) -comment(// For both blocking and non-blocking reads, the read operation returns the number) -comment(// of bytes read. In blocking operations, this normally corresponds to the number) -comment(// of bytes requested (typically the size of some buffer\) but can have a smaller) -comment(// value at the end of a stream. Java also makes no guarantees about whether) -comment(// other streams in general will return bytes as they become available under) -comment(// certain circumstances (rather than blocking until the entire buffer is filled.) -comment(// In non-blocking operations, the number of bytes returned will typically be) -comment(// the number of bytes available (up to some maximum buffer or requested size\).) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_7.16) -comment(//----------------------------------------------------------------------------------) -comment(// This just works in Java and Groovy as per the previous examples.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.17) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy uses Java's features here.) -comment(// More work has been done in the Java on object caching than file caching) -comment(// with several open source and commercial offerings in that area. File caches) -comment(// are also available, for one, see:) -comment(// http://portals.apache.org/jetspeed-1/apidocs/org/apache/jetspeed/cache/FileCache.html) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.18) -comment(//----------------------------------------------------------------------------------) -comment(// The general pattern is: streams.each{ stream -> stream.println 'item to print' }) -comment(// See the MultiStream example in 13.5 for a coded example.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.19) -comment(//----------------------------------------------------------------------------------) -comment(// You wouldn't normally be dealing with FileDescriptors. In case were you have) -comment(// one you would normally walk through all known FileStreams asking each for) -comment(// it's FileDescriptor until you found one that matched. You would then close) -comment(// that stream.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.20) -comment(//----------------------------------------------------------------------------------) -comment(// There are several concepts here. At the object level, any two object references) -comment(// can point to the same object. Any changes made by one of these will be visible) -comment(// in the 'alias'. You can also have multiple stream, reader, writer or channel objects) -comment(// referencing the same resource. Depending on the kind of resource, any potential) -comment(// locks, the operations being requested and the behaviour of third-party programs,) -comment(// the result of trying to perform such concurrent operations may not always be) -comment(// deterministic. There are strategies for coping with such scenarious but the) -comment(// best bet is to avoid the issue.) - -comment(// For the scenario given, copying file handles, that corresponds most closely) -comment(// with cloning streams. The best bet is to just use individual stream objects) -comment(// both created from the same file. If you are attempting to do write operations,) -comment(// then you should consider using locks.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.21) -comment(//----------------------------------------------------------------------------------) -comment(// locking is built in to Java (since 1.4\), so should not be missing) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_7.22) -comment(//----------------------------------------------------------------------------------) -comment(// Java locking supports locking just regions of files.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.0) -comment(//----------------------------------------------------------------------------------) -ident(datafile) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) comment(// change on your system) - -ident(datafile)operator(.)ident(eachLine)operator({) ident(line) operator(->) ident(print) ident(line)operator(.)ident(size)operator(()operator(\)) operator(}) - -ident(lines) operator(=) ident(datafile)operator(.)ident(readLines)operator(()operator(\)) - -ident(wholeTextFile) operator(=) ident(datafile)operator(.)ident(text) - -comment(// on command line Groovy use -a auto split pattern instead of record separator) -comment(// default pattern is /\\s/) -comment(// groovy -a -e 'println "First word is ${split[0][1]}"') - -comment(// (additional examples to original cookbook to illustrate -a\)) -comment(// Print processes owned by root:) -comment(// ps aux|groovy -ane "if(split[0][1] =~ 'root'\)println split[0][10..-1]") - -comment(// Print all logins from /etc/passwd that are not commented:) -comment(// groovy -a':' -ne "if(!(split[0][1] =~ /^#/\)\)println split[0][1]" /etc/passwd) - -comment(// Add the first and the penultimate column of a file:) -comment(// groovy -ape "split[0][1].toInteger(\)+split[0][-2].toInteger(\)" accounts.txt) - -comment(// no BEGIN and END in Groovy (has been proposed, may be added soon\)) - -ident(datafile)operator(.)ident(withOutputStream)operator({) ident(stream) operator(->) - ident(stream)operator(.)ident(print) string operator(+) string operator(+) string comment(// "onetwothree" -> file) - ident(println) string comment(// sent to $stdout) -operator(}) - -comment(// use streams or channels for advanced file handling) -type(int) ident(size) operator(=) ident(datafile)operator(.)ident(size)operator(()operator(\)) -ident(buffer) operator(=) pre_type(ByteBuffer)operator(.)ident(allocate)operator(()ident(size)operator(\)) comment(// for large files, use some block size, e.g. 4096) -ident(channel) operator(=) keyword(new) pre_type(FileInputStream)operator(()ident(datafile)operator(\))operator(.)ident(channel) -ident(println) stringdelimiter(")> comment(// -1 = EOF) - -ident(channel) operator(=) keyword(new) pre_type(FileOutputStream)operator(()pre_type(File)operator(.)ident(createTempFile)operator(()stringoperator(,) stringoperator(\))operator(\))operator(.)ident(channel) -ident(size) operator(=) ident(channel)operator(.)ident(size)operator(()operator(\)) -ident(channel)operator(.)ident(truncate)operator(()ident(size)operator(\)) comment(// shrinks file (in our case to same size\)) - -ident(pos) operator(=) ident(channel)operator(.)ident(position)operator(()operator(\)) -ident(println) stringcontent( bytes from the start of datafile)delimiter(")> -ident(channel)operator(.)ident(position)operator(()ident(pos)operator(\)) comment(// move to pos (in our case unchanged\)) -ident(channel)operator(.)ident(position)operator(()integer(0)operator(\)) comment(// move to start of file) -ident(channel)operator(.)ident(position)operator(()ident(size)operator(\)) comment(// move to end of file) - -comment(// no sysread and syswrite are available but dataInput/output streams) -comment(// can be used to achieve similar functionality, see 8.15.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.1) -comment(//----------------------------------------------------------------------------------) -ident(testfile) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) comment(// change on your system) -comment(// contents of testfile:) -comment(// DISTFILES = $(DIST_COMMON\) $(SOURCES\) $(HEADERS\) \\ -// $(TEXINFOS\) $(INFOS\) $(MANS\) $(DATA\)) -comment(// DEP_DISTFILES = $(DIST_COMMON\) $(SOURCES\) $(HEADERS\) \\ -// $(TEXINFOS\) $(INFO_DEPS\) $(MANS\) $(DATA\) \\ -// $(EXTRA_DIST\)) - -ident(lines) operator(=) type([]) -ident(continuing) operator(=) pre_constant(false) -ident(regex) operator(=) regexp -ident(testfile)operator(.)ident(eachLine)operator({) ident(line) operator(->) - ident(stripped) operator(=) ident(line)operator(.)ident(replaceAll)operator(()ident(regex)operator(,)stringoperator(\)) - keyword(if) operator(()ident(continuing)operator(\)) ident(lines)operator([)operator(-)integer(1)operator(]) operator(+=) ident(stripped) - keyword(else) ident(lines) operator(+=) ident(stripped) - ident(continuing) operator(=) operator(()ident(line) operator(=~) ident(regex)operator(\)) -operator(}) -ident(println) ident(lines)operator(.)ident(join)operator(()stringoperator(\)) -comment(// =>) -comment(// DISTFILES = $(DIST_COMMON\) $(SOURCES\) $(HEADERS\) $(TEXINFOS\) $(INFOS\) $(MANS\) $(DATA\)) -comment(// DEP_DISTFILES = $(DIST_COMMON\) $(SOURCES\) $(HEADERS\) $(TEXINFOS\) $(INFO_DEPS\) $(MANS\) $(DATA\) $(EXTRA_DIST\)) - -comment(// to remove hidden spaces after the slash (but keep the slash\):) -keyword(def) method(trimtail)operator(()ident(line)operator(\)) operator({) - ident(line) operator(=) ident(line)operator(.)ident(replaceAll)operator(()regexpoperator(,) stringoperator(\)) -operator(}) -ident(b) operator(=) regexp comment(// backslash) -keyword(assert) stringdelimiter(")> operator(==) ident(trimtail)operator(()stringdelimiter(")>operator(\)) -keyword(assert) string operator(==) ident(trimtail)operator(()stringoperator(\)) -keyword(assert) stringdelimiter(")> operator(==) ident(trimtail)operator(()stringcontent( )delimiter(")>operator(\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.2) -comment(//----------------------------------------------------------------------------------) -comment(// unixScript:) -ident(println) operator(()stringdelimiter(")>operator(.)ident(execute)operator(()operator(\))operator(.)ident(text)operator(\)) - -comment(// for small files which fit in memory) -ident(println) ident(testfile)operator(.)ident(readLines)operator(()operator(\))operator(.)ident(size)operator(()operator(\)) - -comment(// streaming approach (lines and paras\)) -ident(lines) operator(=) integer(0)operator(;) ident(paras) operator(=) integer(1) -ident(testfile)operator(.)ident(eachLine)operator({) ident(lines)operator(++)operator(;) keyword(if) operator(()local_variable(it) operator(=~) regexpoperator(\)) ident(paras)operator(++) operator(}) -ident(println) stringcontent( lines and )inlinecontent( paras.)delimiter(")> -comment(// note: counts blank line at end as start of next empty para) - -comment(// with a StreamTokenizer) -ident(st) operator(=) keyword(new) pre_type(StreamTokenizer)operator(()ident(testfile)operator(.)ident(newReader)operator(()operator(\))operator(\)) -keyword(while) operator(()ident(st)operator(.)ident(nextToken)operator(()operator(\)) operator(!=) pre_type(StreamTokenizer)operator(.)ident(TT_EOF)operator(\)) operator({)operator(}) -ident(println) ident(st)operator(.)ident(lineno)operator(()operator(\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.3) -comment(//----------------------------------------------------------------------------------) -comment(// general pattern) -keyword(def) method(processWordsInFile)operator(()ident(file)operator(,) ident(processWord)operator(\)) operator({) - ident(testfile)operator(.)ident(splitEachLine)operator(()regexpoperator(\)) operator({) ident(matched) operator(->) - ident(matched)operator(.)ident(each)operator({) ident(w) operator(->) keyword(if) operator(()ident(w)operator(\)) ident(processWord)operator(()ident(w)operator(\)) operator(}) - operator(}) -operator(}) - -ident(testfile) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) comment(// change path on your system) - -comment(// count words) -ident(count) operator(=) integer(0) -ident(processWordsInFile)operator(()ident(testfile)operator(\))operator({) ident(count)operator(++) operator(}) -ident(println) ident(count) - -comment(// (variation to Perl example\)) -comment(// with a StreamTokenizer (counting words and numbers in Pleac chapter 8 source file\)) -ident(words) operator(=) integer(0)operator(;) ident(numbers) operator(=) integer(0) -ident(st) operator(=) keyword(new) pre_type(StreamTokenizer)operator(()ident(testfile)operator(.)ident(newReader)operator(()operator(\))operator(\)) -ident(st)operator(.)ident(slashSlashComments)operator(()pre_constant(true)operator(\)) comment(// ignore words and numbers in comments) -keyword(while) operator(()ident(st)operator(.)ident(nextToken)operator(()operator(\)) operator(!=) pre_type(StreamTokenizer)operator(.)ident(TT_EOF)operator(\)) operator({) - keyword(if) operator(()ident(st)operator(.)ident(ttype) operator(==) pre_type(StreamTokenizer)operator(.)ident(TT_WORD)operator(\)) ident(words)operator(++) - keyword(else) keyword(if) operator(()ident(st)operator(.)ident(ttype) operator(==) pre_type(StreamTokenizer)operator(.)ident(TT_NUMBER)operator(\)) ident(numbers)operator(++) -operator(}) -ident(println) stringcontent( words and )inlinecontent( numbers.)delimiter(")> - - -comment(// word frequency count) -ident(seen) operator(=) operator([)operator(:)operator(]) -ident(processWordsInFile)operator(()ident(testfile)operator(\)) operator({) - ident(w) operator(=) local_variable(it)operator(.)ident(toLowerCase)operator(()operator(\)) - keyword(if) operator(()ident(seen)operator(.)ident(containsKey)operator(()ident(w)operator(\))operator(\)) ident(seen)operator([)ident(w)operator(]) operator(+=) integer(1) - keyword(else) ident(seen)operator([)ident(w)operator(]) operator(=) integer(1) -operator(}) -comment(// output map in a descending numeric sort of its values) -ident(seen)operator(.)ident(entrySet)operator(()operator(\))operator(.)ident(sort) operator({) ident(a)operator(,)ident(b) operator(->) ident(b)operator(.)ident(value) operator(<=>) ident(a)operator(.)ident(value) operator(})operator(.)ident(each)operator({) ident(e) operator(->) - ident(printf)operator(()stringoperator(,) operator([)ident(e)operator(.)ident(value)operator(,) ident(e)operator(.)ident(key)operator(]) operator(\)) -operator(}) -comment(// =>) -comment(// 25 pleac) -comment(// 22 line) -comment(// 20 file) -comment(// 19 println) -comment(// 19 lines) -comment(// 13 testfile) -comment(// ...) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.4) -comment(//----------------------------------------------------------------------------------) -ident(testfile)operator(.)ident(readLines)operator(()operator(\))operator(.)ident(reverseEach)operator({) - ident(println) local_variable(it) -operator(}) - -ident(lines) operator(=) ident(testfile)operator(.)ident(readLines)operator(()operator(\)) -comment(// normally one would use the reverseEach, but you can use) -comment(// a numerical index if you want) -operator(()operator(()ident(lines)operator(.)ident(size)operator(()operator(\)) operator(-) integer(1)operator(\))operator(..)integer(0)operator(\))operator(.)ident(each)operator({) - ident(println) ident(lines)operator([)local_variable(it)operator(]) -operator(}) - -comment(// Paragraph-based processing could be done as in 8.2.) - -comment(// A streaming-based solution could use random file access) -comment(// and have a sliding buffer working from the back of the) -comment(// file to the front.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.5) -comment(//----------------------------------------------------------------------------------) -ident(logfile) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) -comment(// logTailingScript:) -ident(sampleInterval) operator(=) integer(2000) comment(// 2000 millis = 2 secs) -ident(file) operator(=) keyword(new) pre_type(RandomAccessFile)operator(() ident(logfile)operator(,) string operator(\)) -ident(filePointer) operator(=) integer(0) comment(// set to logfile.size(\) to begin tailing from the end of the file) -keyword(while)operator(() pre_constant(true) operator(\)) operator({) - comment(// Compare the length of the file to the file pointer) - type(long) ident(fileLength) operator(=) ident(logfile)operator(.)ident(size)operator(()operator(\)) - keyword(if)operator(() ident(fileLength) operator(<) ident(filePointer) operator(\)) operator({) - comment(// Log file must have been rotated or deleted;) - pre_type(System)operator(.)ident(err)operator(.)ident(println) stringcontent(: Reopening )inlinedelimiter(")> - ident(file) operator(=) keyword(new) pre_type(RandomAccessFile)operator(() ident(logfile)operator(,) string operator(\)) - ident(filePointer) operator(=) integer(0) - operator(}) - keyword(if)operator(() ident(fileLength) operator(>) ident(filePointer) operator(\)) operator({) - comment(// There is data to read) - ident(file)operator(.)ident(seek)operator(() ident(filePointer) operator(\)) - keyword(while)operator(() operator(()ident(line) operator(=) ident(file)operator(.)ident(readLine)operator(()operator(\))operator(\)) operator(!=) pre_constant(null) operator(\)) operator({) - ident(println) string operator(+) ident(line) - operator(}) - ident(filePointer) operator(=) ident(file)operator(.)ident(filePointer) - operator(}) - comment(// Sleep for the specified interval) - pre_type(Thread)operator(.)ident(sleep)operator(() ident(sampleInterval) operator(\)) -operator(}) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.6) -comment(//----------------------------------------------------------------------------------) -comment(//testfile = newFile('/usr/share/fortune/humorists'\)) - -comment(// small files:) -ident(random) operator(=) keyword(new) pre_type(Random)operator(()operator(\)) -ident(lines) operator(=) ident(testfile)operator(.)ident(readLines)operator(()operator(\)) -ident(println) ident(lines)operator([)ident(random)operator(.)ident(nextInt)operator(()ident(lines)operator(.)ident(size)operator(()operator(\))operator(\))operator(]) - -comment(// streamed alternative) -ident(count) operator(=) integer(0) -keyword(def) ident(adage) -ident(testfile)operator(.)ident(eachLine)operator({) ident(line) operator(->) - ident(count)operator(++) - keyword(if) operator(()ident(random)operator(.)ident(nextInt)operator(()ident(count)operator(\)) operator(<) integer(1)operator(\)) ident(adage) operator(=) ident(line) -operator(}) -ident(println) ident(adage) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.7) -comment(//----------------------------------------------------------------------------------) -comment(// non-streamed solution (like Perl and Ruby\)) -ident(lines) operator(=) ident(testfile)operator(.)ident(readLines)operator(()operator(\)) -pre_type(Collections)operator(.)ident(shuffle)operator(()ident(lines)operator(\)) -ident(println) ident(lines)operator(.)ident(join)operator(()stringoperator(\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.8) -comment(//----------------------------------------------------------------------------------) -ident(desiredLine) operator(=) integer(235) -comment(// for small files) -ident(lines) operator(=) ident(testfile)operator(.)ident(readLines)operator(()operator(\)) -ident(println) stringcontent(: )inlinedelimiter(")> - -comment(// streaming solution) -ident(reader) operator(=) ident(testfile)operator(.)ident(newReader)operator(()operator(\)) -ident(count) operator(=) integer(0) -keyword(def) ident(line) -keyword(while) operator(()operator(()ident(line) operator(=) ident(reader)operator(.)ident(readLine)operator(()operator(\))operator(\))operator(!=) pre_constant(null)operator(\)) operator({) - keyword(if) operator(()operator(++)ident(count) operator(==) ident(desiredLine)operator(\)) keyword(break) -operator(}) -ident(println) stringcontent(: )inlinedelimiter(")> -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.9) -comment(//----------------------------------------------------------------------------------) -ident(println) ident(testfile)operator(.)ident(text)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(size)operator(()operator(\)) -comment(// => 23 (21 sections .0 .. .20 plus before .0 plus line above\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.10) -comment(//----------------------------------------------------------------------------------) -ident(file) operator(=) keyword(new) pre_type(RandomAccessFile)operator(() ident(logfile)operator(,) string operator(\)) -type(long) ident(previous)operator(,) ident(lastpos) operator(=) integer(0) -keyword(while)operator(() operator(()ident(line) operator(=) ident(file)operator(.)ident(readLine)operator(()operator(\))operator(\)) operator(!=) pre_constant(null) operator(\)) operator({) - ident(previous) operator(=) ident(lastpos) - ident(lastpos) operator(=) ident(file)operator(.)ident(filePointer) -operator(}) -keyword(if) operator(()ident(previous)operator(\)) ident(file)operator(.)ident(setLength)operator(()ident(previous)operator(\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.11) -comment(//----------------------------------------------------------------------------------) -comment(// Java's streams are binary at the lowest level if not processed with) -comment(// higher level stream mechanisms or readers/writers. Some additions) -comment(// to the Perl cookbook which illustrate the basics.) - -comment(// Print first ten bytes of a binary file:) -keyword(def) method(dumpStart)operator(()ident(filename)operator(\)) operator({) - ident(bytes) operator(=) keyword(new) pre_type(File)operator(()ident(filename)operator(\))operator(.)ident(newInputStream)operator(()operator(\)) - integer(10)operator(.)ident(times)operator({) - ident(print) ident(bytes)operator(.)ident(read)operator(()operator(\)) operator(+) string - operator(}) - ident(println)operator(()operator(\)) -operator(}) -ident(dumpStart)operator(()pre_type(System)operator(.)ident(getProperty)operator(()stringoperator(\))operator(+)stringoperator(\)) -comment(// => 80 75 3 4 10 0 0 0 0 0 (note first two bytes = PK - you might recognize this) -comment(// as the starting sequence of a zip file\)) -ident(dumpStart)operator(()stringoperator(\)) comment(// after running groovyc compiler in src directory) -comment(// => 202 254 186 190 0 0 0 47 2 20 (starting bytes in HEX: CAFEBABE\)) - -ident(binfile) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) -ident(binfile)operator(.)ident(withOutputStream)operator({) ident(stream) operator(->) operator(()integer(0)operator(..<)integer(20)operator(\))operator(.)ident(each)operator({) ident(stream)operator(.)ident(write)operator(()local_variable(it)operator(\)) operator(})operator(}) -ident(binfile)operator(.)ident(eachByte)operator({) ident(print) local_variable(it) operator(+) string operator(})operator(;) ident(println)operator(()operator(\)) -comment(// => 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.12) -comment(//----------------------------------------------------------------------------------) -comment(// lets treat binfile as having 5 records of size 4, let's print out the 3rd record) -ident(recsize) operator(=) integer(4) -ident(recno) operator(=) integer(2) comment(// index starts at 0) -ident(address) operator(=) ident(recsize) operator(*) ident(recno) -ident(randomaccess) operator(=) keyword(new) pre_type(RandomAccessFile)operator(()ident(binfile)operator(,) stringoperator(\)) -ident(randomaccess)operator(.)ident(seek)operator(()ident(address)operator(\)) -ident(recsize)operator(.)ident(times)operator({) ident(print) ident(randomaccess)operator(.)ident(read)operator(()operator(\)) operator(+) string operator(})operator(;) ident(println)operator(()operator(\)) comment(// => 8 9 10 11) -ident(randomaccess)operator(.)ident(close)operator(()operator(\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.13) -comment(//----------------------------------------------------------------------------------) -comment(// let's take the example from 8.12 but replace the 3rd record with) -comment(// 90 - the original value in the file) -comment(// this is an alternative example to the Perl cookbook which is cross platform) -comment(// see chapter 1 regarding un/pack which could be combined with below) -comment(// to achieve the full functionality of the original 8.13) -ident(recsize) operator(=) integer(4) -ident(recno) operator(=) integer(2) comment(// index starts at 0) -ident(address) operator(=) ident(recsize) operator(*) ident(recno) -ident(randomaccess) operator(=) keyword(new) pre_type(RandomAccessFile)operator(()ident(binfile)operator(,) stringoperator(\)) -ident(randomaccess)operator(.)ident(seek)operator(()ident(address)operator(\)) -ident(bytes) operator(=) type([]) -ident(recsize)operator(.)ident(times)operator({) ident(bytes) operator(+=) ident(randomaccess)operator(.)ident(read)operator(()operator(\)) operator(}) -ident(randomaccess)operator(.)ident(seek)operator(()ident(address)operator(\)) -ident(bytes)operator(.)ident(each)operator({) ident(b) operator(->) ident(randomaccess)operator(.)ident(write)operator(()integer(90) operator(-) ident(b)operator(\)) operator(}) -ident(randomaccess)operator(.)ident(close)operator(()operator(\)) -ident(binfile)operator(.)ident(eachByte)operator({) ident(print) local_variable(it) operator(+) string operator(})operator(;) ident(println)operator(()operator(\)) -comment(// => 0 1 2 3 4 5 6 7 82 81 80 79 12 13 14 15 16 17 18 19) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.14) -comment(//----------------------------------------------------------------------------------) -comment(// reading a String would involve looping and collecting the read bytes) - -comment(// simple bgets) -comment(// this is similar to the revised 8.13 but would look for the terminating 0) - -comment(// simplistic strings functionality) -ident(binfile)operator(.)ident(eachByte)operator({) ident(b) operator(->) keyword(if) operator(()operator(()type(int)operator(\))ident(b) keyword(in) integer(32)operator(..)integer(126)operator(\)) ident(print) operator(()operator(()type(char)operator(\))ident(b)operator(\)) operator(})operator(;) ident(println)operator(()operator(\)) comment(// => RQPO) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.15) -comment(//----------------------------------------------------------------------------------) -comment(// You could combine the byte-level reading/writing mechanisms shown) -comment(// in 8.11 - 8.12 and combine that with the un/pack functionality from) -comment(// Chapter 1 to achieve the desired functionality. A more Java and Groovy) -comment(// friendly way to do this would be to use the Scattering and Gathering) -comment(// stream operations of channels for byte-oriented record fields or) -comment(// data-oriented records. Alternatively, the dataInput/output stream) -comment(// capabilities for data-oriented records. Finally, the) -comment(// objectInput/output stream capabilities could be used for object types.) -comment(// Note, these examples mix reading and writing even though the original) -comment(// Perl example was just about reading.) - - -comment(// fixed-length byte-oriented records using channels) -comment(// typical approach used with low-level protocols or file formats) -keyword(import) include(java.nio.*) -ident(binfile)operator(.)ident(delete)operator(()operator(\))operator(;) ident(binfile)operator(.)ident(createNewFile)operator(()operator(\)) comment(// start from scratch) -ident(buf1) operator(=) pre_type(ByteBuffer)operator(.)ident(wrap)operator(()operator([)integer(10)operator(,)integer(11)operator(,)integer(12)operator(,)integer(13)operator(]) keyword(as) type(byte)type([])operator(\)) comment(// simulate 4 byte field) -ident(buf2) operator(=) pre_type(ByteBuffer)operator(.)ident(wrap)operator(()operator([)integer(44)operator(,)integer(45)operator(]) keyword(as) type(byte)type([])operator(\)) comment(// 2 byte field) -ident(buf3) operator(=) pre_type(ByteBuffer)operator(.)ident(wrap)operator(()stringoperator(.)ident(bytes)operator(\)) comment(// String) -ident(records) operator(=) operator([)ident(buf1)operator(,) ident(buf2)operator(,) ident(buf3)operator(]) keyword(as) pre_type(ByteBuffer)type([]) -ident(channel) operator(=) keyword(new) pre_type(FileOutputStream)operator(()ident(binfile)operator(\))operator(.)ident(channel) -ident(channel)operator(.)ident(write)operator(()ident(records)operator(\)) comment(// gathering byte records) -ident(channel)operator(.)ident(close)operator(()operator(\)) -ident(binfile)operator(.)ident(eachByte)operator({) ident(print) local_variable(it) operator(+) string operator(})operator(;) ident(println)operator(()operator(\)) -comment(// => 10 11 12 13 44 45 72 101 108 108 111) -comment(// ScatteringInputStream would convert this back into an array of byte[]) - - -comment(// data-oriented streams using channels) -ident(binfile)operator(.)ident(delete)operator(()operator(\))operator(;) ident(binfile)operator(.)ident(createNewFile)operator(()operator(\)) comment(// start from scratch) -ident(buf) operator(=) pre_type(ByteBuffer)operator(.)ident(allocate)operator(()integer(24)operator(\)) -ident(now) operator(=) pre_type(System)operator(.)ident(currentTimeMillis)operator(()operator(\)) -ident(buf)operator(.)ident(put)operator(()stringoperator(.)ident(bytes)operator(\))operator(.)ident(putDouble)operator(()pre_type(Math)operator(.)ident(PI)operator(\))operator(.)ident(put)operator(()stringoperator(.)ident(bytes)operator(\))operator(.)ident(putLong)operator(()ident(now)operator(\)) -ident(buf)operator(.)ident(flip)operator(()operator(\)) comment(// readies for writing: set length and point back to start) -ident(channel) operator(=) keyword(new) pre_type(FileOutputStream)operator(()ident(binfile)operator(\))operator(.)ident(channel) -ident(channel)operator(.)ident(write)operator(()ident(buf)operator(\)) -ident(channel)operator(.)ident(close)operator(()operator(\)) -comment(// now read it back in) -ident(channel) operator(=) keyword(new) pre_type(FileInputStream)operator(()ident(binfile)operator(\))operator(.)ident(channel) -ident(buf) operator(=) pre_type(ByteBuffer)operator(.)ident(allocate)operator(()integer(24)operator(\)) -ident(channel)operator(.)ident(read)operator(()ident(buf)operator(\)) -ident(buf)operator(.)ident(flip)operator(()operator(\)) -integer(3)operator(.)ident(times)operator({) ident(print) operator(()operator(()type(char)operator(\))ident(buf)operator(.)ident(get)operator(()operator(\))operator(\)) operator(}) -ident(println) operator(()ident(buf)operator(.)ident(getDouble)operator(()operator(\))operator(\)) -integer(5)operator(.)ident(times)operator({) ident(print) operator(()operator(()type(char)operator(\))ident(buf)operator(.)ident(get)operator(()operator(\))operator(\)) operator(}) -ident(println) operator(()keyword(new) pre_type(Date)operator(()ident(buf)operator(.)ident(getLong)operator(()operator(\))operator(\))operator(\)) -ident(channel)operator(.)ident(close)operator(()operator(\)) -comment(// =>) -comment(// PI=3.141592653589793) -comment(// Date=Sat Jan 13 00:14:50 EST 2007) - -comment(// object-oriented streams) -ident(binfile)operator(.)ident(delete)operator(()operator(\))operator(;) ident(binfile)operator(.)ident(createNewFile)operator(()operator(\)) comment(// start from scratch) -type(class) class(Person) directive(implements) pre_type(Serializable) operator({) keyword(def) ident(name)operator(,) ident(age) operator(}) -ident(binfile)operator(.)ident(withObjectOutputStream)operator({) ident(oos) operator(->) - ident(oos)operator(.)ident(writeObject)operator(()keyword(new) ident(Person)operator(()key(name)operator(:)stringoperator(,)key(age)operator(:)integer(16)operator(\))operator(\)) - ident(oos)operator(.)ident(writeObject)operator(()operator([)integer(1)operator(:)stringoperator(,) integer(2)operator(:)stringoperator(])operator(\)) - ident(oos)operator(.)ident(writeObject)operator(()keyword(new) pre_type(Date)operator(()operator(\))operator(\)) -operator(}) -comment(// now read it back in) -ident(binfile)operator(.)ident(withObjectInputStream)operator({) ident(ois) operator(->) - ident(person) operator(=) ident(ois)operator(.)ident(readObject)operator(()operator(\)) - ident(println) stringcontent(.name is )inlinecontent(.age)delimiter(")> - ident(println) ident(ois)operator(.)ident(readObject)operator(()operator(\)) - ident(println) ident(ois)operator(.)ident(readObject)operator(()operator(\)) -operator(}) -comment(// =>) -comment(// Bernie is 16) -comment(// [1:"a", 2:"b"]) -comment(// Sat Jan 13 00:22:13 EST 2007) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.16) -comment(//----------------------------------------------------------------------------------) -comment(// use built-in Java property class) -comment(// suppose you have the following file:) -comment(// # set your database settings here) -comment(// server=localhost) -comment(// url=jdbc:derby:derbyDB;create=true) -comment(// user.name=me) -comment(// user.password=secret) -ident(props) operator(=) keyword(new) pre_type(Properties)operator(()operator(\)) -ident(propsfile)operator(=)keyword(new) pre_type(File)operator(()stringoperator(\)) -ident(props)operator(.)ident(load)operator(()ident(propsfile)operator(.)ident(newInputStream)operator(()operator(\))operator(\)) -ident(props)operator(.)ident(list)operator(()pre_type(System)operator(.)ident(out)operator(\)) -comment(// =>) -comment(// -- listing properties --) -comment(// user.name=me) -comment(// user.password=secret) -comment(// url=jdbc:derby:derbyDB;create=true) -comment(// server=localhost) - -comment(// There are also provisions for writing properties file.) - -comment(// (additional example to Perl\)) -comment(// You can also read and write xml properties files.) -keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(withOutputStream)operator({) ident(os) operator(->) - ident(props)operator(.)ident(storeToXML)operator(()ident(os)operator(,) stringoperator(\)) -operator(}) -comment(// =>) -comment(// ) -comment(// ) -comment(// ) -comment(// Database Settings) -comment(// secret) -comment(// me) -comment(// jdbc:derby:derbyDB;create=true) -comment(// localhost) -comment(// ) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.17) -comment(//----------------------------------------------------------------------------------) -comment(// The File class provides canRead(\), canWrite(\) and canExecute(\) (JDK6\) methods) -comment(// for finding out about security information specific to the user. JSR 203) -comment(// (expected in Java 7\) provides access to additional security related attributes.) - -comment(// Another useful package to use when wondering about the trustworthiness of a) -comment(// file is the java.security package. It contains many classes. Just one is) -comment(// MessageDigest. This would allow you to create a strong checksum of a file.) -comment(// Your program could refuse to operate if a file it was accessing didn't have the) -comment(// checksum it was expecting - an indication that it may have been tampered with.) - -comment(// (additional info\)) -comment(// While getting file-based security permissions correct is important, it isn't the) -comment(// only mechanism to use for security when using Java based systems. Java provides) -comment(// policy files and an authorization and authentication API which lets you secure) -comment(// any reources (not just files\) at various levels of granularity with various) -comment(// security mechanisms.) -comment(// Security policies may be universal, apply to a particular codebase, or) -comment(// using JAAS apply to individuals. Some indicative policy statements:) -comment(// grant {) -comment(// permission java.net.SocketPermission "*", "connect";) -comment(// permission java.io.FilePermission "C:\\\\users\\\\cathy\\\\foo.bat", "read";) -comment(// };) -comment(// grant codebase "file:./*", Principal ExamplePrincipal "Secret" {) -comment(// permission java.io.FilePermission "dummy.txt", "read";) -comment(// };) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.18) -comment(//----------------------------------------------------------------------------------) -comment(// general purpose utility methods) -keyword(def) method(getString)operator(()ident(buf)operator(,)ident(size)operator(\))operator({) - comment(// consider get(buf[]\) instead of get(buf\) for efficiency) - ident(b)operator(=)type([])operator(;) ident(size)operator(.)ident(times)operator({)ident(b)operator(+=)ident(buf)operator(.)ident(get)operator(()operator(\))operator(})operator(;) keyword(new) pre_type(String)operator(()ident(b) keyword(as) type(byte)type([])operator(\))operator(.)ident(trim)operator(()operator(\)) -operator(}) -keyword(def) method(getInt)operator(()ident(buf)operator(,)ident(size)operator(\)) operator({) - comment(// normally in Java we would just use methods like getLong(\)) - comment(// to read a long but wish to ignore platform issues here) - type(long) ident(val) operator(=) integer(0) - keyword(for) operator(()ident(n) keyword(in) integer(0)operator(..<)ident(size)operator(\)) operator({) ident(val) operator(+=) operator(()operator(()type(int)operator(\))ident(buf)operator(.)ident(get)operator(()operator(\)) operator(&) hex(0xFF)operator(\)) operator(<)operator(<) operator(()ident(n) operator(*) integer(8)operator(\)) operator(}) - keyword(return) ident(val) -operator(}) -keyword(def) method(getDate)operator(()ident(buf)operator(\)) operator({) - keyword(return) keyword(new) pre_type(Date)operator(()ident(getInt)operator(()ident(buf)operator(,)integer(4)operator(\)) operator(*) integer(1000)operator(\)) comment(// Java uses millis) -operator(}) - -comment(// specific utility method (wtmp file from ubuntu 6.10\)) -keyword(def) method(processWtmpRecords)operator(()ident(file)operator(,) ident(origpos)operator(\)) operator({) - ident(channel) operator(=) keyword(new) pre_type(RandomAccessFile)operator(()ident(file)operator(,) stringoperator(\))operator(.)ident(channel) - ident(recsize) operator(=) integer(4) operator(+) integer(4) operator(+) integer(32) operator(+) integer(4) operator(+) integer(32) operator(+) integer(256) operator(+) integer(8) operator(+) integer(4) operator(+) integer(40) - ident(channel)operator(.)ident(position)operator(()ident(origpos)operator(\)) - ident(newpos) operator(=) ident(origpos) - ident(buf) operator(=) pre_type(ByteBuffer)operator(.)ident(allocate)operator(()ident(recsize)operator(\)) - keyword(while) operator(()operator(()ident(count) operator(=) ident(channel)operator(.)ident(read)operator(()ident(buf)operator(\))operator(\)) operator(!=) operator(-)integer(1)operator(\)) operator({) - keyword(if) operator(()ident(count) operator(!=) ident(recsize)operator(\)) keyword(break) - ident(buf)operator(.)ident(flip)operator(()operator(\)) - ident(print) ident(getInt)operator(()ident(buf)operator(,)integer(4)operator(\)) operator(+) string comment(// type) - ident(print) ident(getInt)operator(()ident(buf)operator(,)integer(4)operator(\)) operator(+) string comment(// pid) - ident(print) ident(getString)operator(()ident(buf)operator(,)integer(32)operator(\)) operator(+) string comment(// line) - ident(print) ident(getString)operator(()ident(buf)operator(,)integer(4)operator(\)) operator(+) string comment(// inittab) - ident(print) ident(getString)operator(()ident(buf)operator(,)integer(32)operator(\)) operator(+) string comment(// user) - ident(print) ident(getString)operator(()ident(buf)operator(,)integer(256)operator(\)) operator(+) string comment(// hostname) - ident(buf)operator(.)ident(position)operator(()ident(buf)operator(.)ident(position)operator(()operator(\)) operator(+) integer(8)operator(\)) comment(// skip) - ident(println) stringcontent( )delimiter(")> comment(// time) - ident(buf)operator(.)ident(clear)operator(()operator(\)) - ident(newpos) operator(=) ident(channel)operator(.)ident(position)operator(()operator(\)) - operator(}) - keyword(return) ident(newpos) -operator(}) - -ident(wtmp) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) -comment(// wtmpTailingScript:) -ident(sampleInterval) operator(=) integer(2000) comment(// 2000 millis = 2 secs) -ident(filePointer) operator(=) ident(wtmp)operator(.)ident(size)operator(()operator(\)) comment(// begin tailing from the end of the file) -keyword(while)operator(()pre_constant(true)operator(\)) operator({) - comment(// Compare the length of the file to the file pointer) - type(long) ident(fileLength) operator(=) ident(wtmp)operator(.)ident(size)operator(()operator(\)) - keyword(if)operator(() ident(fileLength) operator(>) ident(filePointer) operator(\)) operator({) - comment(// There is data to read) - ident(filePointer) operator(=) ident(processWtmpRecords)operator(()ident(wtmp)operator(,) ident(filePointer)operator(\)) - operator(}) - comment(// Sleep for the specified interval) - pre_type(Thread)operator(.)ident(sleep)operator(() ident(sampleInterval) operator(\)) -operator(}) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.19) -comment(//----------------------------------------------------------------------------------) -comment(// contains most of the functionality of the original (not guaranteed to be perfect\)) -comment(// -i ignores errors, e.g. if one target is write protected, the others will work) -comment(// -u writes files in unbuffered mode (ignore for '|'\)) -comment(// -n not to stdout) -comment(// -a all files are in append mode) -comment(// '>>file1' turn on append for individual file) -comment(// '|wc' or '|grep x' etc sends output to forked process (only one at any time\)) -type(class) class(MultiStream) operator({) - directive(private) ident(targets) - directive(private) ident(ignoreErrors) - ident(MultiStream)operator(()pre_type(List) ident(targets)operator(,) ident(ignore)operator(\)) operator({) - local_variable(this)operator(.)ident(targets) operator(=) ident(targets) - ident(ignoreErrors) operator(=) ident(ignore) - operator(}) - keyword(def) method(println)operator(()pre_type(String) ident(content)operator(\)) operator({) - ident(targets)operator(.)ident(each)operator({) - keyword(try) operator({) - local_variable(it)operator(?)operator(.)ident(write)operator(()ident(content)operator(.)ident(bytes)operator(\)) - operator(}) keyword(catch) operator(()exception(Exception) ident(ex)operator(\)) operator({) - keyword(if) operator(()operator(!)ident(ignoreErrors)operator(\)) keyword(throw) ident(ex) - ident(targets) operator(-=) local_variable(it) - local_variable(it)operator(?)operator(.)ident(close)operator(()operator(\)) - operator(}) - operator(}) - operator(}) - keyword(def) method(close)operator(()operator(\)) operator({) ident(targets)operator(.)ident(each)operator({) local_variable(it)operator(?)operator(.)ident(close)operator(()operator(\)) operator(}) operator(}) -operator(}) - -type(class) class(TeeTarget) operator({) - directive(private) ident(filename) - directive(private) ident(stream) - directive(private) ident(p) - - ident(TeeTarget)operator(()pre_type(String) ident(name)operator(,) ident(append)operator(,) ident(buffered)operator(,) ident(ignore)operator(\)) operator({) - keyword(if) operator(()ident(name)operator(.)ident(startsWith)operator(()string>)delimiter(')>operator(\))operator(\)) operator({) - ident(createFileStream)operator(()ident(name)operator([)integer(2)operator(..)operator(-)integer(1)operator(])operator(,)pre_constant(true)operator(,)ident(buffered)operator(,)ident(ignore)operator(\)) - operator(}) keyword(else) keyword(if) operator(()ident(name)operator(.)ident(startsWith)operator(()stringoperator(\))operator(\)) operator({) - ident(createProcessReader)operator(()ident(name)operator([)integer(1)operator(..)operator(-)integer(1)operator(])operator(\)) - operator(}) keyword(else) operator({) - ident(createFileStream)operator(()ident(name)operator(,)ident(append)operator(,)ident(buffered)operator(,)ident(ignore)operator(\)) - operator(}) - operator(}) - - ident(TeeTarget)operator(()pre_type(OutputStream) ident(stream)operator(\)) operator({) local_variable(this)operator(.)ident(stream) operator(=) ident(stream) operator(}) - - keyword(def) method(write)operator(()ident(bytes)operator(\)) operator({) ident(stream)operator(?)operator(.)ident(write)operator(()ident(bytes)operator(\)) operator(}) - keyword(def) method(close)operator(()operator(\)) operator({) ident(stream)operator(?)operator(.)ident(close)operator(()operator(\)) operator(}) - - directive(private) ident(createFileStream)operator(()ident(name)operator(,) ident(append)operator(,) ident(buffered)operator(,) ident(ignore)operator(\)) operator({) - ident(filename) operator(=) ident(name) - keyword(def) ident(fos) - keyword(try) operator({) - ident(fos) operator(=) keyword(new) pre_type(FileOutputStream)operator(()ident(name)operator(,) ident(append)operator(\)) - operator(}) keyword(catch) operator(()exception(Exception) ident(ex)operator(\)) operator({) - keyword(if) operator(()ident(ignore)operator(\)) keyword(return) - operator(}) - keyword(if) operator(()operator(!)ident(buffered)operator(\)) ident(stream) operator(=) ident(fos) - keyword(else) ident(stream) operator(=) keyword(new) pre_type(BufferedOutputStream)operator(()ident(fos)operator(\)) - operator(}) - directive(private) ident(createWriter)operator(()ident(os)operator(\)) operator({)keyword(new) pre_type(PrintWriter)operator(()keyword(new) pre_type(BufferedOutputStream)operator(()ident(os)operator(\))operator(\))operator(}) - directive(private) ident(createReader)operator(()ident(is)operator(\)) operator({)keyword(new) pre_type(BufferedReader)operator(()keyword(new) pre_type(InputStreamReader)operator(()ident(is)operator(\))operator(\))operator(}) - directive(private) ident(createPiperThread)operator(()ident(br)operator(,) ident(pw)operator(\)) operator({) - pre_type(Thread)operator(.)ident(start)operator({) - keyword(def) ident(next) - keyword(while)operator(()operator(()ident(next) operator(=) ident(br)operator(.)ident(readLine)operator(()operator(\))operator(\))operator(!=)pre_constant(null)operator(\)) operator({) - ident(pw)operator(.)ident(println)operator(()ident(next)operator(\)) - operator(}) - ident(pw)operator(.)ident(flush)operator(()operator(\))operator(;) ident(pw)operator(.)ident(close)operator(()operator(\)) - operator(}) - operator(}) - directive(private) ident(createProcessReader)operator(()ident(name)operator(\)) operator({) - keyword(def) ident(readFromStream) operator(=) keyword(new) pre_type(PipedInputStream)operator(()operator(\)) - keyword(def) ident(r1) operator(=) ident(createReader)operator(()ident(readFromStream)operator(\)) - ident(stream) operator(=) keyword(new) pre_type(BufferedOutputStream)operator(()keyword(new) pre_type(PipedOutputStream)operator(()ident(readFromStream)operator(\))operator(\)) - ident(p) operator(=) pre_type(Runtime)operator(.)ident(runtime)operator(.)ident(exec)operator(()ident(name)operator(\)) - keyword(def) ident(w1) operator(=) ident(createWriter)operator(()ident(p)operator(.)ident(outputStream)operator(\)) - ident(createPiperThread)operator(()ident(r1)operator(,) ident(w1)operator(\)) - keyword(def) ident(w2) operator(=) ident(createWriter)operator(()pre_type(System)operator(.)ident(out)operator(\)) - keyword(def) ident(r2) operator(=) ident(createReader)operator(()ident(p)operator(.)ident(inputStream)operator(\)) - ident(createPiperThread)operator(()ident(r2)operator(,) ident(w2)operator(\)) - operator(}) -operator(}) - -ident(targets) operator(=) type([]) -ident(append) operator(=) pre_constant(false)operator(;) ident(ignore) operator(=) pre_constant(false)operator(;) ident(includeStdout) operator(=) pre_constant(true)operator(;) ident(buffer) operator(=) pre_constant(true) -operator(()integer(0)operator(..<)ident(args)operator(.)ident(size)operator(()operator(\))operator(\))operator(.)ident(each)operator({) - ident(arg) operator(=) ident(args)operator([)local_variable(it)operator(]) - keyword(if) operator(()ident(arg)operator(.)ident(startsWith)operator(()stringoperator(\))operator(\)) operator({) - keyword(switch) operator(()ident(arg)operator(\)) operator({) - keyword(case) stringoperator(:) ident(append) operator(=) pre_constant(true)operator(;) keyword(break) - keyword(case) stringoperator(:) ident(ignore) operator(=) pre_constant(true)operator(;) keyword(break) - keyword(case) stringoperator(:) ident(includeStdout) operator(=) pre_constant(false)operator(;) keyword(break) - keyword(case) stringoperator(:) ident(buffer) operator(=) pre_constant(false)operator(;) keyword(break) - keyword(default)operator(:) - ident(println) string - pre_type(System)operator(.)ident(exit)operator(()integer(1)operator(\)) - operator(}) - operator(}) keyword(else) ident(targets) operator(+=) ident(arg) -operator(}) -ident(targets) operator(=) ident(targets)operator(.)ident(collect)operator({) keyword(new) ident(TeeTarget)operator(()local_variable(it)operator(,) ident(append)operator(,) ident(buffer)operator(,) ident(ignore)operator(\)) operator(}) -keyword(if) operator(()ident(includeStdout)operator(\)) ident(targets) operator(+=) keyword(new) ident(TeeTarget)operator(()pre_type(System)operator(.)ident(out)operator(\)) -keyword(def) ident(tee) operator(=) keyword(new) ident(MultiStream)operator(()ident(targets)operator(,) ident(ignore)operator(\)) -keyword(while) operator(()ident(line) operator(=) pre_type(System)operator(.)ident(in)operator(.)ident(readLine)operator(()operator(\))operator(\)) operator({) - ident(tee)operator(.)ident(println)operator(()ident(line)operator(\)) -operator(}) -ident(tee)operator(.)ident(close)operator(()operator(\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_8.20) -comment(//----------------------------------------------------------------------------------) -comment(// most of the functionality - uses an explicit uid - ran on ubuntu 6.10 on intel) -ident(lastlog) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) -ident(channel) operator(=) keyword(new) pre_type(RandomAccessFile)operator(()ident(lastlog)operator(,) stringoperator(\))operator(.)ident(channel) -ident(uid) operator(=) integer(1000) -ident(recsize) operator(=) integer(4) operator(+) integer(32) operator(+) integer(256) -ident(channel)operator(.)ident(position)operator(()ident(uid) operator(*) ident(recsize)operator(\)) -ident(buf) operator(=) pre_type(ByteBuffer)operator(.)ident(allocate)operator(()ident(recsize)operator(\)) -ident(channel)operator(.)ident(read)operator(()ident(buf)operator(\)) -ident(buf)operator(.)ident(flip)operator(()operator(\)) -ident(date) operator(=) ident(getDate)operator(()ident(buf)operator(\)) -ident(line) operator(=) ident(getString)operator(()ident(buf)operator(,)integer(32)operator(\)) -ident(host) operator(=) ident(getString)operator(()ident(buf)operator(,)integer(256)operator(\)) -ident(println) stringcontent( last logged on )inlinecontent( from )inlineinline_delimiter(})>content( on )inlinedelimiter(")> -comment(// => User with uid 1000 last logged on Sat Jan 13 09:09:35 EST 2007 from unknown on :0) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_9.0) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy builds on Java's file and io classes which provide an operating) -comment(// system independent abstraction of a file system. The actual File class) -comment(// is the main class of interest. It represents a potential file or) -comment(// directory - which may or may not (yet\) exist. In versions of Java up to) -comment(// and including Java 6, the File class was missing some of the functionality) -comment(// required to implement some of the examples in the Chapter (workarounds) -comment(// and alternatives are noted below\). In Java 7, (also known as "Dolphin"\)) -comment(// new File abstraction facilities are being worked on but haven't yet been) -comment(// publically released. These new features are known as JSR 203 and are) -comment(// referred to when relevant to some of the examples. Thanks to Alan Bateman) -comment(// from Sun for clarification regarding various aspects of JSR 203. Apologies) -comment(// if I misunderstood any aspects relayed to me and also usual disclaimers) -comment(// apply regarding features which may change or be dropped before release.) - -comment(// path='/usr/bin'; file='vi' // linux/mac os?) -ident(path)operator(=)stringoperator(;) ident(file)operator(=)string comment(// windows) -ident(entry) operator(=) keyword(new) pre_type(File)operator(()stringdelimiter(")>operator(\)) -keyword(assert) ident(entry)operator(.)ident(isDirectory)operator(()operator(\)) -ident(entry) operator(=) keyword(new) pre_type(File)operator(()stringcontent(/)inlinedelimiter(")>operator(\)) -keyword(assert) ident(entry)operator(.)ident(isFile)operator(()operator(\)) - -ident(println) pre_type(File)operator(.)ident(separator) -comment(// => \\ (on Windows\)) -comment(// => / (on Unix\)) -comment(// however if you just stick to backslashes Java converts for you) -comment(// in most situations) - -comment(// File modification time (no exact equivalent of ctime - but you can) -comment(// call stat(\) using JNI or use exec(\) of dir or ls to get this kind of info\)) -comment(// JSR 203 also plans to provide such info in Java 7.) -ident(println) keyword(new) pre_type(Date)operator(()ident(entry)operator(.)ident(lastModified)operator(()operator(\))operator(\)) -comment(// => Wed Aug 04 07:00:00 EST 2004) - -comment(// file size) -ident(println) ident(entry)operator(.)ident(size)operator(()operator(\)) -comment(// => 1032192) - -comment(// check if we have permission to read the file) -keyword(assert) ident(entry)operator(.)ident(canRead)operator(()operator(\)) - -comment(// check if file is binary or text?) -comment(// There is no functionality for this at the file level.) -comment(// Java has the Java Activation Framework (jaf\) which is used to) -comment(// associate files (and streams\) with MIME Types and subsequently) -comment(// binary data streams or character encodings for (potentially) -comment(// multilanguage\) text files. JSR-203 provides a method to determine) -comment(// the MIME type of a file. Depending on the platform the file type may) -comment(// be determined based on a file attribute, file name "extension", the) -comment(// bytes of the files (byte sniffing\) or other means. It is service) -comment(// provider based so developers can plug in their own file type detection) -comment(// mechanisms as required. "Out of the box" it will ship with file type) -comment(// detectors that are appropriate for the platform (integrates with GNOME,) -comment(// Windows registry, etc.\).) - -comment(// Groovy uses File for directories and files) -comment(// displayAllFilesInUsrBin:) -keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(eachFile)operator({) ident(file) operator(->) - ident(println) stringcontent(.name)delimiter(")> -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.1) -comment(//----------------------------------------------------------------------------------) -ident(file) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) -ident(file) operator(<)operator(<) string -ident(timeModified) operator(=) ident(file)operator(.)ident(lastModified)operator(()operator(\)) -ident(println) keyword(new) pre_type(Date)operator(()ident(timeModified)operator(\)) -comment(// => Sun Jan 07 11:49:02 EST 2007) - -ident(MILLIS_PER_WEEK) operator(=) integer(60) operator(*) integer(60) operator(*) integer(24) operator(*) integer(1000) operator(*) integer(7) -ident(file)operator(.)ident(setLastModified)operator(()ident(timeModified) operator(-) ident(MILLIS_PER_WEEK)operator(\)) -ident(println) keyword(new) pre_type(Date)operator(()ident(file)operator(.)ident(lastModified)operator(()operator(\))operator(\)) -comment(// => Sun Dec 31 11:49:02 EST 2006) - -comment(// Java currently doesn't provide access to other timestamps but) -comment(// there are things that can be done:) -comment(// (1\) You can use JNI to call to C, e.g. stat(\)) -comment(// (2\) Use exec(\) and call another program, e.g. dir, ls, ... to get the value you are after) -comment(// (3\) Here is a Windows specific patch to get lastAccessedTime and creationTime) -comment(// http://forum.java.sun.com/thread.jspa?forumID=31&start=0&threadID=409921&range=100#1800193) -comment(// (4\) There is an informal patch for Java 5/6 which gives lastAccessedTime on Windows and Linux) -comment(// and creationTime on windows:) -comment(// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6314708) -comment(// (5\) JSR 203 (currently targetted for Java 7\) aims to provide) -comment(// "bulk access to file attributes, change notification, escape to filesystem-specific APIs") -comment(// this is supposed to include creationTime and lastAccessedTime along with many) -comment(// security-related file attributes) - -comment(// viFileWithoutChangingModificationTimeScript:) -doctype(#!/usr/bin/groovy) -comment(// uvi - vi a file without changing it's last modified time) -keyword(if) operator(()ident(args)operator(.)ident(size)operator(()operator(\)) operator(!=) integer(1)operator(\)) - ident(println) string - pre_type(System)operator(.)ident(exit)operator(()integer(1)operator(\)) -operator(}) -ident(file) operator(=) ident(args)operator([)integer(0)operator(]) -ident(origTime) operator(=) keyword(new) pre_type(File)operator(()ident(file)operator(\))operator(.)ident(lastModified)operator(()operator(\)) -stringdelimiter(")>operator(.)ident(execute)operator(()operator(\)) -keyword(new) pre_type(File)operator(()ident(file)operator(\))operator(.)ident(setLastModified)operator(()ident(origTime)operator(\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.2) -comment(//----------------------------------------------------------------------------------) -ident(println) keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(exists)operator(()operator(\)) comment(// => false) -ident(println) keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(delete)operator(()operator(\)) comment(// => false) - -keyword(new) pre_type(File)operator(()stringoperator(\)) operator(<)operator(<) string -ident(println) keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(exists)operator(()operator(\)) comment(// => true) -ident(println) keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(delete)operator(()operator(\)) comment(// => true) - -ident(names) operator(=) operator([)stringoperator(,)stringoperator(,)stringoperator(]) -ident(files) operator(=) ident(names)operator(.)ident(collect)operator({) keyword(new) pre_type(File)operator(()local_variable(it)operator(\)) operator(}) -comment(// create 2 of the files) -ident(files)operator([)integer(0)operator(..)integer(1)operator(])operator(.)ident(each)operator({) ident(f) operator(->) ident(f) operator(<)operator(<) ident(f)operator(.)ident(name) operator(}) - -keyword(def) method(deleteFiles)operator(()ident(files)operator(\)) operator({) - keyword(def) ident(problemFileNames) operator(=) type([]) - ident(files)operator(.)ident(each)operator({) ident(f) operator(->) - keyword(if) operator(()operator(!)ident(f)operator(.)ident(delete)operator(()operator(\))operator(\)) - ident(problemFileNames) operator(+=) ident(f)operator(.)ident(name) - operator(}) - keyword(def) ident(delCnt) operator(=) ident(files)operator(.)ident(size)operator(()operator(\)) operator(-) ident(problemFileNames)operator(.)ident(size)operator(()operator(\)) - ident(println) stringcontent( of )inlinecontent( file(s\))delimiter(")> - keyword(if) operator(()ident(problemFileNames)operator(\)) - ident(println) string operator(+) ident(problemFileNames)operator(.)ident(join)operator(()stringoperator(\)) -operator(}) - -ident(deleteFiles)operator(()ident(files)operator(\)) -comment(// =>) -comment(// Successfully deleted 2 of 3 file(s\)) -comment(// Problems file(s\): file3) - -comment(// we can also set files for deletion on exit) -ident(tempFile) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) -keyword(assert) operator(!)ident(tempFile)operator(.)ident(exists)operator(()operator(\)) -ident(tempFile) operator(<)operator(<) string -keyword(assert) ident(tempFile)operator(.)ident(exists)operator(()operator(\)) -ident(tempFile)operator(.)ident(deleteOnExit)operator(()operator(\)) -keyword(assert) ident(tempFile)operator(.)ident(exists)operator(()operator(\)) -comment(// To confirm this is working, run these steps multiple times in a row.) - -comment(// Discussion:) -comment(// Be careful with deleteOnExit(\) as there is no way to cancel it.) -comment(// There are also mechanisms specifically for creating unqiuely named temp files.) -comment(// On completion of JSR 203, there will be additional methods available for) -comment(// deleting which throw exceptions with detailed error messages rather than) -comment(// just return booleans.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.3) -comment(//----------------------------------------------------------------------------------) -comment(// (1\) Copy examples) - -comment(//shared setup) -ident(dummyContent) operator(=) string operator(+) pre_type(System)operator(.)ident(getProperty)operator(()stringoperator(\)) -ident(setUpFromFile)operator(()operator(\)) -ident(setUpToFile)operator(()operator(\)) - -comment(// built-in copy via memory (text files only\)) -ident(to) operator(<)operator(<) ident(from)operator(.)ident(text) -ident(checkSuccessfulCopyAndDelete)operator(()operator(\)) - -comment(// built-in as a stream (text or binary\) with optional encoding) -ident(to) operator(<)operator(<) ident(from)operator(.)ident(asWritable)operator(()stringoperator(\)) -ident(checkSuccessfulCopyAndDelete)operator(()operator(\)) - -comment(// built-in using AntBuilder) -comment(// for options, see: http://ant.apache.org/manual/CoreTasks/copy.html) -keyword(new) ident(AntBuilder)operator(()operator(\))operator(.)ident(copy)operator(() key(file)operator(:) ident(from)operator(.)ident(canonicalPath)operator(,) key(tofile)operator(:) ident(to)operator(.)ident(canonicalPath) operator(\)) -ident(checkSuccessfulCopyAndDelete)operator(()operator(\)) -comment(// =>) -comment(// [copy] Copying 1 file to D:\\ -) - -comment(// use Apache Jakarta Commons IO (jakarta.apache.org\)) -keyword(import) include(org.apache.commons.io.FileUtils) -comment(// Copies a file to a new location preserving the lastModified date.) -ident(FileUtils)operator(.)ident(copyFile)operator(()ident(from)operator(,) ident(to)operator(\)) -ident(checkSuccessfulCopyAndDelete)operator(()operator(\)) - -comment(// using execute(\)) -comment(// "cp $from.canonicalPath $to.canonicalPath".execute(\) // unix) -ident(println) stringcontent(.canonicalPath )inlinecontent(.canonicalPath)char(\\")delimiter(")>operator(.)ident(execute)operator(()operator(\))operator(.)ident(text) comment(// dos vms) -ident(checkSuccessfulCopyAndDelete)operator(()operator(\)) -comment(// =>) -comment(// 1 file(s\) copied.) - -comment(// (2\) Move examples) -comment(// You can just do copy followed by delete but many OS's can just 'rename' in place) -comment(// so you can additionally do using Java's functionality:) -keyword(assert) ident(from)operator(.)ident(renameTo)operator(()ident(to)operator(\)) -keyword(assert) operator(!)ident(from)operator(.)ident(exists)operator(()operator(\)) -ident(checkSuccessfulCopyAndDelete)operator(()operator(\)) -comment(// whether renameTo succeeds if from and to are on different platforms) -comment(// or if to pre-exists is OS dependent, so you should check the return boolean) - -comment(// alternatively, Ant has a move task:) -comment(// http://ant.apache.org/manual/CoreTasks/move.html) - -comment(//helper methods) -keyword(def) method(checkSuccessfulCopyAndDelete)operator(()operator(\)) operator({) - keyword(assert) ident(to)operator(.)ident(text) operator(==) ident(dummyContent) - keyword(assert) ident(to)operator(.)ident(delete)operator(()operator(\)) - keyword(assert) operator(!)ident(to)operator(.)ident(exists)operator(()operator(\)) -operator(}) -keyword(def) method(setUpFromFile)operator(()operator(\)) operator({) - ident(from) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) comment(// just a name) - ident(from) operator(<)operator(<) ident(dummyContent) comment(// now its a real file with content) - ident(from)operator(.)ident(deleteOnExit)operator(()operator(\)) comment(// that will be deleted on exit) -operator(}) -keyword(def) method(setUpToFile)operator(()operator(\)) operator({) - ident(to) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) comment(// target name) - ident(to)operator(.)ident(delete)operator(()operator(\)) comment(// ensure not left from previous aborted run) - keyword(assert) operator(!)ident(to)operator(.)ident(exists)operator(()operator(\)) comment(// double check) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.4) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy (because of its Java heritage\) doesn't have an exact) -comment(// equivalent of stat - as per 9.2 there are numerous mechanisms) -comment(// to achieve the equivalent, in particular, JSR203 (still in draft\)) -comment(// has specific SymLink support including a FileId class in the) -comment(// java.nio.filesystems package. This will allow (depending on the) -comment(// operating system capabilities\) files to be uniquely identified.) -comment(// If you work on Unix or Linux then you'll recognize this as it device/inode.) - -comment(// If you are not interested in the above workarounds/future features) -comment(// and you are on a unix system, you can compare the absolutePath and) -comment(// canonicalPath attributes for a file. If they are different it is) -comment(// a symbolic link. On other operating systems, this difference is not) -comment(// to be relied upon and even on *nix systems, this will only get you) -comment(// so far and will also be relatively expensive resource and timewise.) - -comment(// process only unique files) -ident(seen) operator(=) type([]) -keyword(def) method(myProcessing)operator(()ident(file)operator(\)) operator({) - keyword(def) ident(path) operator(=) ident(file)operator(.)ident(canonicalPath) - keyword(if) operator(()operator(!)ident(seen)operator(.)ident(contains)operator(()ident(path)operator(\))operator(\)) operator({) - ident(seen) operator(<)operator(<) ident(path) - comment(// do something with file because we haven't seen it before) - operator(}) -operator(}) - -comment(// find linked files) -ident(seen) operator(=) operator([)operator(:)operator(]) -ident(filenames) operator(=) operator([)stringoperator(,)stringoperator(,)stringoperator(]) -ident(filenames)operator(.)ident(each)operator({) ident(filename) operator(->) - keyword(def) ident(file) operator(=) keyword(new) pre_type(File)operator(()ident(filename)operator(\)) - keyword(def) ident(cpath) operator(=) ident(file)operator(.)ident(canonicalPath) - keyword(if) operator(()operator(!)ident(seen)operator(.)ident(containsKey)operator(()ident(cpath)operator(\))operator(\)) operator({) - ident(seen)operator([)ident(cpath)operator(]) operator(=) type([]) - operator(}) - ident(seen)operator([)ident(cpath)operator(]) operator(+=) ident(file)operator(.)ident(absolutePath) -operator(}) - -ident(println) string -ident(println) ident(seen)operator(.)ident(findAll)operator({) ident(k)operator(,)ident(v) operator(->) ident(v)operator(.)ident(size)operator(()operator(\)) operator(>) integer(1) operator(}) -comment(//---------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.5) -comment(//----------------------------------------------------------------------------------) -comment(// general pattern is:) -comment(// new File('dirname'\).eachFile{ /* do something ... */ }) - -comment(// setup (change this on your system\)) -ident(basedir) operator(=) string - -comment(// process all files printing out full name (. and .. auto excluded\)) -keyword(new) pre_type(File)operator(()ident(basedir)operator(\))operator(.)ident(eachFile)operator({) ident(f)operator(->) - keyword(if) operator(()ident(f)operator(.)ident(isFile)operator(()operator(\))operator(\)) ident(println) ident(f)operator(.)ident(canonicalPath) -operator(}) -comment(// also remove dot files such as '.svn' and '.cvs' etc.) -keyword(new) pre_type(File)operator(()ident(basedir)operator(\))operator(.)ident(eachFileMatch)operator(()operator(~)stringoperator(\))operator({) ident(f)operator(->) - keyword(if) operator(()ident(f)operator(.)ident(isFile)operator(()operator(\))operator(\)) ident(println) ident(f)operator(.)ident(canonicalPath) -operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.6) -comment(//----------------------------------------------------------------------------------) -comment(// Globbing via Apache Jakarta ORO) -keyword(import) include(org.apache.oro.io.GlobFilenameFilter) -ident(dir) operator(=) keyword(new) pre_type(File)operator(()ident(basedir)operator(\)) -ident(namelist) operator(=) ident(dir)operator(.)ident(list)operator(()keyword(new) ident(GlobFilenameFilter)operator(()stringoperator(\))operator(\)) -ident(filelist) operator(=) ident(dir)operator(.)ident(listFiles)operator(()keyword(new) ident(GlobFilenameFilter)operator(()stringoperator(\)) keyword(as) pre_type(FilenameFilter)operator(\)) - -comment(// Built-in matching using regex's) -ident(files) operator(=) type([]) -keyword(new) pre_type(File)operator(()ident(basedir)operator(\))operator(.)ident(eachFileMatch)operator(()operator(~)regexpoperator(\))operator({) ident(f)operator(->) - keyword(if) operator(()ident(f)operator(.)ident(isFile)operator(()operator(\))operator(\)) ident(files) operator(+=) ident(f) -operator(}) - -comment(// Using Ant's FileScanner (supports arbitrary nested levels using **\)) -comment(// For more details about Ant FileSets, see here:) -comment(// http://ant.apache.org/manual/CoreTypes/fileset.html) -ident(scanner) operator(=) keyword(new) ident(AntBuilder)operator(()operator(\))operator(.)ident(fileScanner) operator({) - ident(fileset)operator(()key(dir)operator(:)ident(basedir)operator(\)) operator({) - ident(include)operator(()key(name)operator(:)stringoperator(\)) - ident(include)operator(()key(name)operator(:)stringoperator(\)) - ident(exclude)operator(()key(name)operator(:)stringoperator(\)) comment(// chaps 10 and above) - ident(exclude)operator(()key(name)operator(:)stringoperator(,) key(unless)operator(:)stringoperator(\)) - operator(}) -operator(}) -keyword(for) operator(()ident(f) keyword(in) ident(scanner)operator(\)) operator({) - ident(println) stringdelimiter(")> -operator(}) - -comment(// find and sort directories with numeric names) -ident(candidateFiles) operator(=) keyword(new) pre_type(File)operator(()ident(basedir)operator(\))operator(.)ident(listFiles)operator(()operator(\)) -ident(allDigits) operator(=) operator({) local_variable(it)operator(.)ident(name) operator(=~) regexp operator(}) -ident(isDir) operator(=) operator({) local_variable(it)operator(.)ident(isDirectory)operator(()operator(\)) operator(}) -ident(dirs) operator(=) ident(candidateFiles)operator(.)ident(findAll)operator(()ident(isDir)operator(\))operator(.)ident(findAll)operator(()ident(allDigits)operator(\))operator(*.)ident(canonicalPath)operator(.)ident(sort)operator(()operator(\)) -ident(println) ident(dirs) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.7) -comment(//----------------------------------------------------------------------------------) -comment(// find all files recursively) -ident(dir) operator(=) keyword(new) pre_type(File)operator(()ident(basedir)operator(\)) -ident(files) operator(=) type([]) -ident(dir)operator(.)ident(eachFileRecurse)operator({) ident(files) operator(+=) local_variable(it) operator(}) - -comment(// find total size) -ident(sum) operator(=) ident(files)operator(.)ident(sum)operator({) local_variable(it)operator(.)ident(size)operator(()operator(\)) operator(}) -ident(println) stringcontent( contains )inlinecontent( bytes)delimiter(")> -comment(// => Pleac/src contains 365676 bytes) - -comment(// find biggest) -ident(biggest) operator(=) ident(files)operator(.)ident(max)operator({) local_variable(it)operator(.)ident(size)operator(()operator(\)) operator(}) -ident(println) stringcontent(.name with )inlinecontent( bytes)delimiter(")> -comment(// => Biggest file is pleac6.groovy with 42415 bytes) - -comment(// find most recently modified) -ident(youngest) operator(=) ident(files)operator(.)ident(max)operator({) local_variable(it)operator(.)ident(lastModified)operator(()operator(\)) operator(}) -ident(println) stringcontent(.name, changed )inlinedelimiter(")> -comment(// => Most recently modified is pleac9.groovy, changed Tue Jan 09 07:35:39 EST 2007) - -comment(// find all directories) -ident(dir)operator(.)ident(eachDir)operator({) ident(println) string operator(+) local_variable(it)operator(.)ident(name)operator(}) - -comment(// find all directories recursively) -ident(dir)operator(.)ident(eachFileRecurse)operator({) ident(f) operator(->) keyword(if) operator(()ident(f)operator(.)ident(isDirectory)operator(()operator(\))operator(\)) ident(println) string operator(+) ident(f)operator(.)ident(canonicalPath)operator(}) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.8) -comment(//----------------------------------------------------------------------------------) -ident(base) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) - -comment(// delete using Jakarta Apache Commons IO) -ident(FileUtils)operator(.)ident(deleteDirectory)operator(()ident(base)operator(\)) - -comment(// delete using Ant, for various options see:) -comment(// http://ant.apache.org/manual/CoreTasks/delete.html) -ident(ant) operator(=) keyword(new) ident(AntBuilder)operator(()operator(\)) -ident(ant)operator(.)ident(delete)operator(()key(dir)operator(:) ident(base)operator(\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.9) -comment(//----------------------------------------------------------------------------------) -ident(names) operator(=) operator([)stringoperator(,) stringoperator(]) -ident(names)operator(.)ident(each)operator({) ident(name) operator(->) keyword(new) pre_type(File)operator(()ident(name)operator(\))operator(.)ident(renameTo)operator(()keyword(new) pre_type(File)operator(()ident(name) operator(+) stringoperator(\))operator(\)) operator(}) - -comment(// The Groovy way of doing rename using an expr would be to use a closure) -comment(// for the expr:) -comment(// groovySimpleRenameScript:) -doctype(#!/usr/bin/groovy) -comment(// usage rename closure_expr filenames) -ident(op) operator(=) ident(args)operator([)integer(0)operator(]) -ident(println) ident(op) -ident(files) operator(=) ident(args)operator([)integer(1)operator(..)operator(-)integer(1)operator(]) -ident(shell) operator(=) keyword(new) ident(GroovyShell)operator(()ident(binding)operator(\)) -ident(files)operator(.)ident(each)operator({) ident(f) operator(->) - ident(newname) operator(=) ident(shell)operator(.)ident(evaluate)operator(()stringcontent((')inlinecontent('\))delimiter(")>operator(\)) - keyword(new) pre_type(File)operator(()ident(f)operator(\))operator(.)ident(renameTo)operator(()keyword(new) pre_type(File)operator(()ident(newname)operator(\))operator(\)) -operator(}) - -comment(// this would allow processing such as:) -comment(//% rename "{n -> 'FILE_' + n.toUpperCase(\)}" files) -comment(// with param pleac9.groovy => FILE_PLEAC9.GROOVY) -comment(//% rename "{n -> n.replaceAll(/9/,'nine'\) }" files) -comment(// with param pleac9.groovy => pleacnine.groovy) -comment(// The script could also be modified to take the list of) -comment(// files from stdin if no args were present (not shown\).) - -comment(// The above lets you type any Groovy code, but instead you might) -comment(// decide to provide the user with some DSL-like additions, e.g.) -comment(// adding the following lines into the script:) -ident(sep) operator(=) pre_type(File)operator(.)ident(separator) -ident(ext) operator(=) operator({) string operator(+) local_variable(it)operator(.)ident(tokenize)operator(()stringoperator(\))operator([)operator(-)integer(1)operator(]) operator(}) -ident(base) operator(=) operator({) keyword(new) pre_type(File)operator(()local_variable(it)operator(\))operator(.)ident(name) operator(-) ident(ext)operator(()local_variable(it)operator(\)) operator(}) -ident(parent) operator(=) operator({) keyword(new) pre_type(File)operator(()local_variable(it)operator(\))operator(.)ident(parent) operator(}) -ident(lastModified) operator(=) operator({) keyword(new) pre_type(Date)operator(()keyword(new) pre_type(File)operator(()local_variable(it)operator(\))operator(.)ident(lastModified)operator(()operator(\))operator(\)) operator(}) -comment(// would then allow the following more succinct expressions:) -comment(//% rename "{ n -> parent(n\) + sep + base(n\).reverse(\) + ext(n\) }" files) -comment(// with param Pleac/src/pleac9.groovy => Pleac\\src\\9caelp.groovy) -comment(//% rename "{ n -> base(n\) + '_' + lastModified(n\).year + ext(n\) }" files) -comment(// with param pleac9.groovy => pleac9_07.groovy) - -comment(// As a different alternative, you could hook into Ant's mapper mechanism.) -comment(// You wouldn't normally type in this from the command-line but it could) -comment(// be part of a script, here is an example (excludes the actual rename part\)) -ident(ant) operator(=) keyword(new) ident(AntBuilder)operator(()operator(\)) -ident(ant)operator(.)ident(pathconvert)operator(()key(property)operator(:)stringoperator(,)key(targetos)operator(:)stringoperator(\))operator({) - ident(path)operator(()operator(\))operator({) ident(fileset)operator(()key(dir)operator(:)stringoperator(,) key(includes)operator(:)stringoperator(\)) operator(}) - ident(compositemapper)operator({) - ident(globmapper)operator(()key(from)operator(:)stringoperator(,) key(to)operator(:)stringoperator(\)) - ident(regexpmapper)operator(()key(from)operator(:)regexpoperator(,) key(to)operator(:)regexpoperator(,) key(casesensitive)operator(:)stringoperator(\)) - ident(chainedmapper)operator({) - ident(packagemapper)operator(()key(from)operator(:)stringoperator(,) key(to)operator(:)stringoperator(\)) - ident(filtermapper)operator(()operator(\))operator({) ident(replacestring)operator(()key(from)operator(:)stringoperator(,) key(to)operator(:)stringoperator(\)) operator(}) - operator(}) - ident(chainedmapper)operator({) - ident(regexpmapper)operator(()key(from)operator(:)regexpoperator(,) key(to)operator(:)regexpoperator(\)) - ident(flattenmapper)operator(()operator(\)) - ident(filtermapper)operator(()operator(\))operator({) ident(replacestring)operator(()key(from)operator(:)stringoperator(,) key(to)operator(:)stringoperator(\)) operator(}) - operator(}) - operator(}) -operator(}) -ident(println) ident(ant)operator(.)ident(antProject)operator(.)ident(getProperty)operator(()stringoperator(\))operator(.)ident(replaceAll)operator(()stringoperator(,)stringoperator(\)) -comment(// =>) -comment(// C:\\Projects\\GroovyExamples\\Pleac\\src\\pleac1.groovy.bak) -comment(// C:\\Projects\\GroovyExamples\\Pleac\\src\\pleac2_beta.groovy) -comment(// Projects.GroovyExamples.Pleac.src.3.xml) -comment(// pleac_four.groovy) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.10) -comment(//----------------------------------------------------------------------------------) -comment(// Splitting a Filename into Its Component Parts) -ident(path) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) -keyword(assert) ident(path)operator(.)ident(parent) operator(==) string operator(+) pre_type(File)operator(.)ident(separator) operator(+) string -keyword(assert) ident(path)operator(.)ident(name) operator(==) string -ident(ext) operator(=) ident(path)operator(.)ident(name)operator(.)ident(tokenize)operator(()stringoperator(\))operator([)operator(-)integer(1)operator(]) -keyword(assert) ident(ext) operator(==) string - -comment(// No fileparse_set_fstype(\) equivalent in Groovy/Java. Java's File constructor) -comment(// automatically performs such a parse and does so appropriately of the operating) -comment(// system it is running on. In addition, 3rd party libraries allow platform) -comment(// specific operations ot be performed. As an example, many Ant tasks are OS) -comment(// aware, e.g. the pathconvert task (callable from an AntBuilder instance\) has) -comment(// a 'targetos' parameter which can be one of 'unix', 'windows', 'netware',) -comment(// 'tandem' or 'os/2'.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.11) -comment(//----------------------------------------------------------------------------------) -comment(// Given the previous discussion regarding the lack of support for symlinks) -comment(// in Java's File class without exec'ing to the operating system or doing) -comment(// a JNI call (at least until JSR 203 arrives\), I have modified this example) -comment(// to perform an actual replica forest of actual file copies rather than) -comment(// a shadow forest full of symlinks pointing back at the real files.) -comment(// Use Apache Jakarta Commons IO) -ident(srcdir) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) comment(// path to src) -ident(destdir) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) comment(// path to dest) -ident(preserveFileStamps) operator(=) pre_constant(true) -ident(FileUtils)operator(.)ident(copyDirectory)operator(()ident(srcdir)operator(,) ident(destdir)operator(,) ident(preserveFileStamps)operator(\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_9.12) -comment(//----------------------------------------------------------------------------------) -doctype(#!/usr/bin/groovy) -comment(// lst - list sorted directory contents (depth first\)) -comment(// Given the previous discussion around Java's more limited Date) -comment(// information available via the File class, this will be a reduced) -comment(// functionality version of ls) -ident(LONG_OPTION) operator(=) string -ident(REVERSE_OPTION) operator(=) string -ident(MODIFY_OPTION) operator(=) string -ident(SIZE_OPTION) operator(=) string -ident(HELP_OPTION) operator(=) string - -ident(op) operator(=) keyword(new) ident(joptsimple)operator(.)ident(OptionParser)operator(()operator(\)) -ident(op)operator(.)ident(accepts)operator(() ident(LONG_OPTION)operator(,) string operator(\)) -ident(op)operator(.)ident(accepts)operator(() ident(REVERSE_OPTION)operator(,) string operator(\)) -ident(op)operator(.)ident(accepts)operator(() ident(MODIFY_OPTION)operator(,) string operator(\)) -ident(op)operator(.)ident(accepts)operator(() ident(SIZE_OPTION)operator(,) string operator(\)) -ident(op)operator(.)ident(accepts)operator(() ident(HELP_OPTION)operator(,) string operator(\)) - -ident(options) operator(=) ident(op)operator(.)ident(parse)operator(()ident(args)operator(\)) -keyword(if) operator(()ident(options)operator(.)ident(wasDetected)operator(() ident(HELP_OPTION) operator(\))operator(\)) operator({) - ident(op)operator(.)ident(printHelpOn)operator(() pre_type(System)operator(.)ident(out) operator(\)) -operator(}) keyword(else) operator({) - ident(sort) operator(=) operator({)operator(}) - ident(params) operator(=) ident(options)operator(.)ident(nonOptionArguments)operator(()operator(\)) - ident(longFormat) operator(=) ident(options)operator(.)ident(wasDetected)operator(() ident(LONG_OPTION) operator(\)) - ident(reversed) operator(=) ident(options)operator(.)ident(wasDetected)operator(() ident(REVERSE_OPTION) operator(\)) - keyword(if) operator(()ident(options)operator(.)ident(wasDetected)operator(() ident(SIZE_OPTION) operator(\))operator(\)) operator({) - ident(sort) operator(=) operator({)ident(a)operator(,)ident(b) operator(->) ident(a)operator(.)ident(size)operator(()operator(\))operator(<=>)ident(b)operator(.)ident(size)operator(()operator(\))operator(}) - operator(}) keyword(else) keyword(if) operator(()ident(options)operator(.)ident(wasDetected)operator(() ident(MODIFY_OPTION) operator(\))operator(\)) operator({) - ident(sort) operator(=) operator({)ident(a)operator(,)ident(b) operator(->) ident(a)operator(.)ident(lastModified)operator(()operator(\))operator(<=>)ident(b)operator(.)ident(lastModified)operator(()operator(\))operator(}) - operator(}) - ident(displayFiles)operator(()ident(params)operator(,) ident(longFormat)operator(,) ident(reversed)operator(,) ident(sort)operator(\)) -operator(}) - -keyword(def) method(displayFiles)operator(()ident(params)operator(,) ident(longFormat)operator(,) ident(reversed)operator(,) ident(sort)operator(\)) operator({) - ident(files) operator(=) type([]) - ident(params)operator(.)ident(each)operator({) ident(name) operator(->) keyword(new) pre_type(File)operator(()ident(name)operator(\))operator(.)ident(eachFileRecurse)operator({) ident(files) operator(+=) local_variable(it) operator(}) operator(}) - ident(files)operator(.)ident(sort)operator(()ident(sort)operator(\)) - keyword(if) operator(()ident(reversed)operator(\)) ident(files) operator(=) ident(files)operator(.)ident(reverse)operator(()operator(\)) - ident(files)operator(.)ident(each) operator({) ident(file) operator(->) - keyword(if) operator(()ident(longFormat)operator(\)) operator({) - ident(print) operator(()ident(file)operator(.)ident(directory) operator(?) string operator(:) string operator(\)) - ident(print) operator(()ident(file)operator(.)ident(canRead)operator(()operator(\)) operator(?) string operator(:) string operator(\)) - ident(print) operator(()ident(file)operator(.)ident(canWrite)operator(()operator(\)) operator(?) string operator(:) string operator(\)) - comment(//print (file.canExecute(\) ? 'x' : '-' \) // Java 6) - ident(print) ident(file)operator(.)ident(size)operator(()operator(\))operator(.)ident(toString)operator(()operator(\))operator(.)ident(padLeft)operator(()integer(12)operator(\)) operator(+) string - ident(print) keyword(new) pre_type(Date)operator(()ident(file)operator(.)ident(lastModified)operator(()operator(\))operator(\))operator(.)ident(toString)operator(()operator(\))operator(.)ident(padRight)operator(()integer(22)operator(\)) - ident(println) string operator(+) ident(file) - operator(}) keyword(else) operator({) - ident(println) ident(file) - operator(}) - operator(}) -operator(}) - -comment(// =>) -comment(// % lst -help) -comment(// Option Description) -comment(// ------ -------------------------------) -comment(// --help display this message) -comment(// -l long listing) -comment(// -m sort based on modification time) -comment(// -r reverse listing) -comment(// -s sort based on size) -comment(//) -comment(// % lst -l -m Pleac/src Pleac/lib) -comment(// ...) -comment(// drw 0 Mon Jan 08 22:33:00 EST 2007 Pleac\\lib\\.svn) -comment(// -rw 18988 Mon Jan 08 22:33:41 EST 2007 Pleac\\src\\pleac9.groovy) -comment(// -rw 2159 Mon Jan 08 23:15:41 EST 2007 Pleac\\src\\lst.groovy) -comment(//) -comment(// % -l -s -r Pleac/src Pleac/lib) -comment(// -rw 1034049 Sun Jan 07 19:24:41 EST 2007 Pleac\\lib\\ant.jar) -comment(// -r- 1034049 Sun Jan 07 19:40:27 EST 2007 Pleac\\lib\\.svn\\text-base\\ant.jar.svn-base) -comment(// -rw 421008 Thu Jun 02 15:15:34 EST 2005 Pleac\\lib\\ant-nodeps.jar) -comment(// -rw 294436 Sat Jan 06 21:19:58 EST 2007 Pleac\\lib\\geronimo-javamail_1.3.1_mail-1.0.jar) -comment(// ...) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_10.0) -comment(//----------------------------------------------------------------------------------) -keyword(def) method(hello)operator(()operator(\)) operator({) - ident(greeted) operator(+=) integer(1) - ident(println) string -operator(}) - -comment(// We need to initialize greeted before it can be used, because "+=" assumes predefinition) -ident(greeted) operator(=) integer(0) -ident(hello)operator(()operator(\)) -ident(println) ident(greeted) -comment(// =>) -comment(// hi there) -comment(// 1) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.1) -comment(//----------------------------------------------------------------------------------) -comment(// basic method calling examples) -comment(// In Groovy, parameters are named anyway) -keyword(def) method(hypotenuse)operator(()ident(side1)operator(,) ident(side2)operator(\)) operator({) - pre_type(Math)operator(.)ident(sqrt)operator(()ident(side1)operator(**)integer(2) operator(+) ident(side2)operator(**)integer(2)operator(\)) comment(// sqrt in Math package) -operator(}) -ident(diag) operator(=) ident(hypotenuse)operator(()integer(3)operator(,) integer(4)operator(\)) -keyword(assert) ident(diag) operator(==) integer(5) - -comment(// the star operator will magically convert an Array into a "tuple") -ident(a) operator(=) operator([)integer(5)operator(,) integer(12)operator(]) -keyword(assert) ident(hypotenuse)operator(()operator(*)ident(a)operator(\)) operator(==) integer(13) - -comment(// both = men + women) - -comment(// In Groovy, all objects are references, so the same problem arises.) -comment(// Typically we just return a new object. Especially for immutable objects) -comment(// this style of processing is very common.) -ident(nums) operator(=) operator([)float(1.4)operator(,) float(3.5)operator(,) float(6.7)operator(]) -keyword(def) method(toInteger)operator(()ident(n)operator(\)) operator({) - ident(n)operator(.)ident(collect) operator({) ident(v) operator(->) ident(v)operator(.)ident(toInteger)operator(()operator(\)) operator(}) -operator(}) -keyword(assert) ident(toInteger)operator(()ident(nums)operator(\)) operator(==) operator([)integer(1)operator(,) integer(3)operator(,) integer(6)operator(]) - -ident(orignums) operator(=) operator([)float(1.4)operator(,) float(3.5)operator(,) float(6.7)operator(]) -keyword(def) method(truncMe)operator(()ident(n)operator(\)) operator({) - operator(()integer(0)operator(..<)ident(n)operator(.)ident(size)operator(()operator(\))operator(\))operator(.)ident(each)operator({) ident(idx) operator(->) ident(n)operator([)ident(idx)operator(]) operator(=) ident(n)operator([)ident(idx)operator(])operator(.)ident(toInteger)operator(()operator(\)) operator(}) -operator(}) -ident(truncMe)operator(()ident(orignums)operator(\)) -keyword(assert) ident(orignums) operator(==) operator([)integer(1)operator(,) integer(3)operator(,) integer(6)operator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.2) -comment(//----------------------------------------------------------------------------------) -comment(// variable scope examples) -keyword(def) method(somefunc)operator(()operator(\)) operator({) - keyword(def) ident(variableInMethod) comment(// private is default in a method) -operator(}) - -keyword(def) ident(name) comment(// private is default for variable in a script) - -ident(bindingVar) operator(=) integer(10) comment(// this will be in the binding (sort of global\)) -ident(globalArray) operator(=) type([]) - -comment(// In Groovy, run_check can't access a, b, or c until they are) -comment(// explicitely defined global (using leading $\), even if they are) -comment(// both defined in the same scope) - -keyword(def) method(checkAccess)operator(()ident(x)operator(\)) operator({) - keyword(def) ident(y) operator(=) integer(200) - keyword(return) ident(x) operator(+) ident(y) operator(+) ident(bindingVar) comment(// access private, param, global) -operator(}) -keyword(assert) ident(checkAccess)operator(()integer(7)operator(\)) operator(==) integer(217) - -keyword(def) method(saveArray)operator(()ident(ary)operator(\)) operator({) - ident(globalArray) operator(<)operator(<) string - ident(globalArray) operator(+=) ident(ary) -operator(}) - -ident(saveArray)operator(()operator([)stringoperator(])operator(\)) -keyword(assert) ident(globalArray) operator(==) operator([)stringoperator(,) stringoperator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.3) -comment(//----------------------------------------------------------------------------------) -comment(// you want a private persistent variable within a script method) - -comment(// you could use a helper class for this) -type(class) class(CounterHelper) operator({) - directive(private) directive(static) ident(counter) operator(=) integer(0) - keyword(def) directive(static) method(next)operator(()operator(\)) operator({) operator(++)ident(counter) operator(}) -operator(}) -keyword(def) method(greeting)operator(()ident(s)operator(\)) operator({) - keyword(def) ident(n) operator(=) ident(CounterHelper)operator(.)ident(next)operator(()operator(\)) - ident(println) stringcontent( (I have been called )inlinecontent( times\))delimiter(")> -operator(}) -ident(greeting)operator(()stringoperator(\)) -ident(greeting)operator(()stringoperator(\)) -ident(greeting)operator(()stringoperator(\)) -comment(// =>) -comment(// Hello tom (I have been called 1 times\)) -comment(// Hello dick (I have been called 2 times\)) -comment(// Hello harry (I have been called 3 times\)) - -comment(// you could make it more fancy by having separate keys,) -comment(// using synchronisation, singleton pattern, ThreadLocal, ...) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_10.4) -comment(//----------------------------------------------------------------------------------) -comment(// Determining Current Method Name) -comment(// Getting class, package and static info is easy. Method info is just a little work.) -comment(// From Java we can use:) -comment(// new Exception(\).stackTrace[0].methodName) -comment(// or for Java 5 and above (saves relatively expensive exception creation\)) -comment(// Thread.currentThread(\).stackTrace[3].methodName) -comment(// But these give the Java method name. Groovy wraps its own runtime) -comment(// system over the top. It's still a Java method, just a little bit further up the) -comment(// stack from where we might expect. Getting the Groovy method name can be done in) -comment(// an implementation specific way (subject to change as the language evolves\):) -keyword(def) method(myMethod)operator(()operator(\)) operator({) - ident(names) operator(=) keyword(new) exception(Exception)operator(()operator(\))operator(.)ident(stackTrace)operator(*.)ident(methodName) - ident(println) ident(groovyUnwrap)operator(()ident(names)operator(\)) -operator(}) -keyword(def) method(myMethod2)operator(()operator(\)) operator({) - ident(names) operator(=) pre_type(Thread)operator(.)ident(currentThread)operator(()operator(\))operator(.)ident(stackTrace)operator(*.)ident(methodName) - ident(names) operator(=) ident(names)operator([)integer(3)operator(..<)ident(names)operator(.)ident(size)operator(()operator(\))operator(]) comment(// skip call to dumpThread) - ident(println) ident(groovyUnwrap)operator(()ident(names)operator(\)) -operator(}) -keyword(def) method(groovyUnwrap)operator(()ident(names)operator(\)) operator({) ident(names)operator([)ident(names)operator(.)ident(indexOf)operator(()stringoperator(\))operator(-)integer(1)operator(]) operator(}) -ident(myMethod)operator(()operator(\)) comment(// => myMethod) -ident(myMethod2)operator(()operator(\)) comment(// => myMethod2) - -comment(// Discussion: If what you really wanted was a tracing mechanism, you could overrie) -comment(// invokeMethod and print out method names before calling the original method. Or) -comment(// you could use one of the Aspect-Oriented Programming packages for Java.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.5) -comment(//----------------------------------------------------------------------------------) -comment(// Passing Arrays and Hashes by Reference) -comment(// In Groovy, every value is a reference to an object, thus there is) -comment(// no such problem, just call: arrayDiff(array1, array2\)) - -comment(// pairwise add (altered so it doesn't require equal sizes\)) -keyword(def) method(pairWiseAdd)operator(()ident(a1)operator(,) ident(a2)operator(\)) operator({) - ident(s1) operator(=) ident(a1)operator(.)ident(size)operator(()operator(\))operator(;) ident(s2) operator(=) ident(a2)operator(.)ident(size)operator(()operator(\)) - operator(()integer(0)operator(..<)operator([)ident(s1)operator(,)ident(s2)operator(])operator(.)ident(max)operator(()operator(\))operator(\))operator(.)ident(collect)operator({) - local_variable(it) operator(>) ident(s1)operator(-)integer(1) operator(?) ident(a2)operator([)local_variable(it)operator(]) operator(:) operator(()local_variable(it) operator(>) ident(s2)operator(-)integer(1) operator(?) ident(a1)operator([)local_variable(it)operator(]) operator(:) ident(a1)operator([)local_variable(it)operator(]) operator(+) ident(a2)operator([)local_variable(it)operator(])operator(\)) - operator(}) -operator(}) -ident(a) operator(=) operator([)integer(1)operator(,) integer(2)operator(]) -ident(b) operator(=) operator([)integer(5)operator(,) integer(8)operator(]) -keyword(assert) ident(pairWiseAdd)operator(()ident(a)operator(,) ident(b)operator(\)) operator(==) operator([)integer(6)operator(,) integer(10)operator(]) - -comment(// also works for unequal sizes) -ident(b) operator(=) operator([)integer(5)operator(,) integer(8)operator(,) operator(-)integer(1)operator(]) -keyword(assert) ident(pairWiseAdd)operator(()ident(a)operator(,) ident(b)operator(\)) operator(==) operator([)integer(6)operator(,) integer(10)operator(,) operator(-)integer(1)operator(]) -ident(b) operator(=) operator([)integer(5)operator(]) -keyword(assert) ident(pairWiseAdd)operator(()ident(a)operator(,) ident(b)operator(\)) operator(==) operator([)integer(6)operator(,) integer(2)operator(]) - -comment(// We could check if both arguments were of a particular type, e.g.) -comment(// (a1 instanceof List\) or (a2.class.isArray(\)\) but duck typing allows) -comment(// it to work on other things as well, so while wouldn't normally do this) -comment(// you do need to be a little careful when calling the method, e.g.) -comment(// here we call it with two maps of strings and get back strings) -comment(// the important thing here was that the arguments were indexed) -comment(// 0..size-1 and that the items supported the '+' operator (as String does\)) -ident(a) operator(=) operator([)integer(0)operator(:)stringoperator(,) integer(1)operator(:)stringoperator(]) -ident(b) operator(=) operator([)integer(0)operator(:)stringoperator(,) integer(1)operator(:)stringoperator(,) integer(2)operator(:)stringoperator(]) -keyword(assert) ident(pairWiseAdd)operator(()ident(a)operator(,) ident(b)operator(\)) operator(==) operator([)stringoperator(,) stringoperator(,) stringoperator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.6) -comment(//----------------------------------------------------------------------------------) -comment(// Detecting Return Context) -comment(// There is no exact equivalent of return context in Groovy but) -comment(// you can behave differently when called under different circumstances) -keyword(def) method(addValueOrSize)operator(()ident(a1)operator(,) ident(a2)operator(\)) operator({) - ident(b1) operator(=) operator(()ident(a1) keyword(instanceof) pre_type(Number)operator(\)) operator(?) ident(a1) operator(:) ident(a1)operator(.)ident(size)operator(()operator(\)) - ident(b2) operator(=) operator(()ident(a2) keyword(instanceof) pre_type(Number)operator(\)) operator(?) ident(a2) operator(:) ident(a2)operator(.)ident(size)operator(()operator(\)) - ident(b1) operator(+) ident(b2) -operator(}) -keyword(assert) operator(()ident(addValueOrSize)operator(()integer(10)operator(,) stringoperator(\))operator(\)) operator(==) integer(14) -keyword(assert) operator(()ident(addValueOrSize)operator(()integer(10)operator(,) operator([)integer(25)operator(,) integer(50)operator(])operator(\))operator(\)) operator(==) integer(12) -keyword(assert) operator(()ident(addValueOrSize)operator(()stringoperator(,) operator([)integer(25)operator(,) integer(50)operator(])operator(\))operator(\)) operator(==) integer(5) -keyword(assert) operator(()ident(addValueOrSize)operator(()integer(25)operator(,) integer(50)operator(\))operator(\)) operator(==) integer(75) - -comment(// Of course, a key feature of many OO languages including Groovy is) -comment(// method overloading so that responding to dofferent parameters has) -comment(// a formal way of being captured in code with typed methods, e.g.) -type(class) class(MakeBiggerHelper) operator({) - keyword(def) method(triple)operator(()pre_type(List) ident(iList)operator(\)) operator({) ident(iList)operator(.)ident(collect)operator({) local_variable(it) operator(*) integer(3) operator(}) operator(}) - keyword(def) method(triple)operator(()type(int) ident(i)operator(\)) operator({) ident(i) operator(*) integer(3) operator(}) -operator(}) -ident(mbh) operator(=) keyword(new) ident(MakeBiggerHelper)operator(()operator(\)) -keyword(assert) ident(mbh)operator(.)ident(triple)operator(()operator([)integer(4)operator(,) integer(5)operator(])operator(\)) operator(==) operator([)integer(12)operator(,) integer(15)operator(]) -keyword(assert) ident(mbh)operator(.)ident(triple)operator(()integer(4)operator(\)) operator(==) integer(12) - -comment(// Of course with duck typing, we can rely on dynamic typing if we want) -keyword(def) method(directTriple)operator(()ident(arg)operator(\)) operator({) - operator(()ident(arg) keyword(instanceof) pre_type(Number)operator(\)) operator(?) ident(arg) operator(*) integer(3) operator(:) ident(arg)operator(.)ident(collect)operator({) local_variable(it) operator(*) integer(3) operator(}) -operator(}) -keyword(assert) ident(directTriple)operator(()operator([)integer(4)operator(,) integer(5)operator(])operator(\)) operator(==) operator([)integer(12)operator(,) integer(15)operator(]) -keyword(assert) ident(directTriple)operator(()integer(4)operator(\)) operator(==) integer(12) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.7) -comment(//----------------------------------------------------------------------------------) -comment(// Passing by Named Parameter) -comment(// Groovy supports named params or positional arguments with optional) -comment(// defaults to simplify method calling) - -comment(// named arguments work by using a map) -keyword(def) method(thefunc)operator(()pre_type(Map) ident(args)operator(\)) operator({) - comment(// in this example, we just call the positional version) - ident(thefunc)operator(()ident(args)operator(.)ident(start)operator(,) ident(args)operator(.)ident(end)operator(,) ident(args)operator(.)ident(step)operator(\)) -operator(}) - -comment(// positional arguments with defaults) -keyword(def) method(thefunc)operator(()ident(start)operator(=)integer(0)operator(,) ident(end)operator(=)integer(30)operator(,) ident(step)operator(=)integer(10)operator(\)) operator({) - operator(()operator(()ident(start)operator(..)ident(end)operator(\))operator(.)ident(step)operator(()ident(step)operator(\))operator(\)) -operator(}) - -keyword(assert) ident(thefunc)operator(()operator(\)) operator(==) operator([)integer(0)operator(,) integer(10)operator(,) integer(20)operator(,) integer(30)operator(]) -keyword(assert) ident(thefunc)operator(()integer(15)operator(\)) operator(==) operator([)integer(15)operator(,) integer(25)operator(]) -keyword(assert) ident(thefunc)operator(()integer(0)operator(,)integer(40)operator(\)) operator(==) operator([)integer(0)operator(,) integer(10)operator(,) integer(20)operator(,) integer(30)operator(,) integer(40)operator(]) -keyword(assert) ident(thefunc)operator(()key(start)operator(:)integer(5)operator(,) key(end)operator(:)integer(20)operator(,) key(step)operator(:)integer(5)operator(\)) operator(==) operator([)integer(5)operator(,) integer(10)operator(,) integer(15)operator(,) integer(20)operator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.8) -comment(//----------------------------------------------------------------------------------) -comment(// Skipping Selected Return Values) -comment(// Groovy 1.0 doesn't support multiple return types, so you always use) -comment(// a holder class, array or collection to return multiple values.) -keyword(def) method(getSystemInfo)operator(()operator(\)) operator({) - keyword(def) ident(millis) operator(=) pre_type(System)operator(.)ident(currentTimeMillis)operator(()operator(\)) - keyword(def) ident(freemem) operator(=) pre_type(Runtime)operator(.)ident(runtime)operator(.)ident(freeMemory)operator(()operator(\)) - keyword(def) ident(version) operator(=) pre_type(System)operator(.)ident(getProperty)operator(()stringoperator(\)) - keyword(return) operator([)key(millis)operator(:)ident(millis)operator(,) key(freemem)operator(:)ident(freemem)operator(,) key(version)operator(:)ident(version)operator(]) - comment(// if you are likely to want all the information use a list) - comment(// return [millis, freemem, version]) - comment(// or dedicated holder class) - comment(// return new SystemInfo(millis, freemem, version\)) -operator(}) -ident(result) operator(=) ident(getSystemInfo)operator(()operator(\)) -ident(println) ident(result)operator(.)ident(version) -comment(// => 1.5.0_08-b03) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.9) -comment(//----------------------------------------------------------------------------------) -comment(// Returning More Than One Array or Hash) -comment(// As per 10.8, Groovy 1.0 doesn't support multiple return types but you) -comment(// just use a holder class, array or collection. There are no limitations) -comment(// on returning arbitrary nested values using this technique.) -keyword(def) method(getInfo)operator(()operator(\)) operator({) - keyword(def) ident(system) operator(=) operator([)key(millis)operator(:)pre_type(System)operator(.)ident(currentTimeMillis)operator(()operator(\))operator(,) - key(version)operator(:)pre_type(System)operator(.)ident(getProperty)operator(()stringoperator(\))operator(]) - keyword(def) ident(runtime) operator(=) operator([)key(freemem)operator(:)pre_type(Runtime)operator(.)ident(runtime)operator(.)ident(freeMemory)operator(()operator(\))operator(,) - key(maxmem)operator(:)pre_type(Runtime)operator(.)ident(runtime)operator(.)ident(maxMemory)operator(()operator(\))operator(]) - keyword(return) operator([)key(system)operator(:)ident(system)operator(,) key(runtime)operator(:)ident(runtime)operator(]) -operator(}) -ident(println) ident(info)operator(.)ident(runtime)operator(.)ident(maxmem) comment(// => 66650112 (info automatically calls getInfo(\) here\)) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.10) -comment(//----------------------------------------------------------------------------------) -comment(// Returning Failure) -comment(// This is normally done in a heavy-weight way via Java Exceptions) -comment(// (see 10.12\) or in a lightweight way by returning null) -keyword(def) method(sizeMinusOne)operator(()ident(thing)operator(\)) operator({) - keyword(if) operator(()ident(thing) keyword(instanceof) pre_type(Number)operator(\)) keyword(return) - ident(thing)operator(.)ident(size)operator(()operator(\)) operator(-) integer(1) -operator(}) -keyword(def) method(check)operator(()ident(thing)operator(\)) operator({) - ident(result) operator(=) ident(sizeMinusOne)operator(()ident(thing)operator(\)) - ident(println) operator(()ident(result) operator(?) stringdelimiter(")> operator(:) stringoperator(\)) -operator(}) -ident(check)operator(()integer(4)operator(\)) -ident(check)operator(()operator([)integer(1)operator(,) integer(2)operator(])operator(\)) -ident(check)operator(()stringoperator(\)) -comment(// =>) -comment(// Failed) -comment(// Worked with result: 1) -comment(// Worked with result: 2) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.11) -comment(//----------------------------------------------------------------------------------) -comment(// Prototyping Functions: Not supported by Groovy but arguably) -comment(// not important given other language features.) - -comment(// Omitting Parentheses Scenario: Groovy only lets you leave out) -comment(// parentheses in simple cases. If you had two methods sum(a1,a2,a3\)) -comment(// and sum(a1,a2\), there would be no way to indicate that whether) -comment(// 'sum sum 2, 3, 4, 5' meant sum(sum(2,3\),4,5\) or sum(sum(2,3,4\),5\).) -comment(// You would have to include the parentheses. Groovy does much less) -comment(// auto flattening than some other languages; it provides a *args) -comment(// operator, varargs style optional params and supports method) -comment(// overloading and ducktyping. Perhaps these other features mean) -comment(// that this scenario is always easy to avoid.) -keyword(def) method(sum)operator(()ident(a)operator(,)ident(b)operator(,)ident(c)operator(\))operator({) ident(a)operator(+)ident(b)operator(+)ident(c)operator(*)integer(2) operator(}) -keyword(def) method(sum)operator(()ident(a)operator(,)ident(b)operator(\))operator({) ident(a)operator(+)ident(b) operator(}) -comment(// sum sum 1,2,4,5) -comment(// => compilation error) -ident(sum) ident(sum)operator(()integer(1)operator(,)integer(2)operator(\))operator(,)integer(4)operator(,)integer(5) -ident(sum) ident(sum)operator(()integer(1)operator(,)integer(2)operator(,)integer(4)operator(\))operator(,)integer(5) -comment(// these work but if you try to do anything fancy you will run into trouble;) -comment(// your best bet is to actually include all the parentheses:) -ident(println) ident(sum)operator(()ident(sum)operator(()integer(1)operator(,)integer(2)operator(\))operator(,)integer(4)operator(,)integer(5)operator(\)) comment(// => 17) -ident(println) ident(sum)operator(()ident(sum)operator(()integer(1)operator(,)integer(2)operator(,)integer(4)operator(\))operator(,)integer(5)operator(\)) comment(// => 16) - -comment(// Mimicking built-ins scenario: this is a mechanism to turn-off) -comment(// auto flattening, Groovy only does flattening in restricted circumstances.) -comment(// func(array, 1, 2, 3\) is never coerced into a single list but varargs) -comment(// and optional args can be used instead) -keyword(def) method(push)operator(()ident(list)operator(,) pre_type(Object)type([]) ident(optionals)operator(\)) operator({) - ident(optionals)operator(.)ident(each)operator({) ident(list)operator(.)ident(add)operator(()local_variable(it)operator(\)) operator(}) -operator(}) -ident(items) operator(=) operator([)integer(1)operator(,)integer(2)operator(]) -ident(newItems) operator(=) operator([)integer(7)operator(,) integer(8)operator(,) integer(9)operator(]) -ident(push) ident(items)operator(,) integer(3)operator(,) integer(4) -ident(push) ident(items)operator(,) integer(6) -ident(push) operator(()ident(items)operator(,) operator(*)ident(newItems)operator(\)) comment(// brackets currently required, *=flattening) - comment(// without *: items = [1, 2, 3, 4, 6, [7, 8, 9]]) -keyword(assert) ident(items) operator(==) operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(]) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.12) -comment(//----------------------------------------------------------------------------------) -comment(// Handling Exceptions) -comment(// Same story as in Java but Groovy has some nice Checked -> Unchecked) -comment(// magic behind the scenes (Java folk will know what this means\)) -comment(// When writing methods:) -comment(// throw exception to raise it) -comment(// When calling methods:) -comment(// try ... catch ... finally surrounds processing logic) -keyword(def) method(getSizeMostOfTheTime)operator(()ident(s)operator(\)) operator({) - keyword(if) operator(()ident(s) operator(=~) stringoperator(\)) keyword(throw) keyword(new) exception(RuntimeException)operator(()stringoperator(\)) - ident(s)operator(.)ident(size)operator(()operator(\)) -operator(}) -keyword(try) operator({) - ident(println) string operator(+) ident(getSizeMostOfTheTime)operator(()stringoperator(\)) - ident(println) string operator(+) ident(getSizeMostOfTheTime)operator(()stringoperator(\)) -operator(}) keyword(catch) operator(()exception(Exception) ident(ex)operator(\)) operator({) - ident(println) stringcontent(.message)delimiter(")> -operator(}) keyword(finally) operator({) - ident(println) string -operator(}) -comment(// =>) -comment(// Size is: 19) -comment(// Error was: The world is ending) -comment(// Doing common cleanup) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.13) -comment(//----------------------------------------------------------------------------------) -comment(// Saving Global Values) -comment(// We can just save the value and restore it later:) -keyword(def) method(printAge)operator(()operator(\)) operator({) ident(println) stringdelimiter(")> operator(}) - -ident(age) operator(=) integer(18) comment(// binding "global" variable) -ident(printAge)operator(()operator(\)) comment(// => 18) - -keyword(if) operator(()ident(age) operator(>) integer(0)operator(\)) operator({) - keyword(def) ident(origAge) operator(=) ident(age) - ident(age) operator(=) integer(23) - ident(printAge)operator(()operator(\)) comment(// => 23) - ident(age) operator(=) ident(origAge) -operator(}) -ident(printAge)operator(()operator(\)) comment(// => 18) - -comment(// Depending on the circmstances we could enhance this in various ways) -comment(// such as synchronizing, surrounding with try ... finally, using a) -comment(// memento pattern, saving the whole binding, using a ThreadLocal ...) - -comment(// There is no need to use local(\) for filehandles or directory) -comment(// handles in Groovy because filehandles are normal objects.) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.14) -comment(//----------------------------------------------------------------------------------) -comment(// Redefining a Function) -comment(// This can be done via a number of ways:) - -comment(// OO approach:) -comment(// The standard trick using OO is to override methods in subclasses) -type(class) class(Parent) operator({) keyword(def) method(foo)operator(()operator(\))operator({) ident(println) string operator(}) operator(}) -type(class) class(Child) directive(extends) ident(Parent) operator({) keyword(def) method(foo)operator(()operator(\))operator({) ident(println) string operator(}) operator(}) -keyword(new) ident(Parent)operator(()operator(\))operator(.)ident(foo)operator(()operator(\)) comment(// => foo) -keyword(new) ident(Child)operator(()operator(\))operator(.)ident(foo)operator(()operator(\)) comment(// => bar) - -comment(// Category approach:) -comment(// If you want to redefine a method from an existing library) -comment(// you can use categories. This can be done to avoid name conflicts) -comment(// or to patch functionality with local mods without changing) -comment(// original code) -ident(println) keyword(new) pre_type(Date)operator(()operator(\))operator(.)ident(toString)operator(()operator(\)) -comment(// => Sat Jan 06 16:44:55 EST 2007) -type(class) class(DateCategory) operator({) - directive(static) ident(toString)operator(()pre_type(Date) ident(self)operator(\)) operator({) string operator(}) -operator(}) -ident(use) operator(()ident(DateCategory)operator(\)) operator({) - ident(println) keyword(new) pre_type(Date)operator(()operator(\))operator(.)ident(toString)operator(()operator(\)) -operator(}) -comment(// => not telling) - -comment(// Closure approach:) -comment(// Groovy's closures let you have "anonymous methods" as objects.) -comment(// This allows you to be very flexible with "method" redefinition, e.g.:) -ident(colors) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(toList)operator(()operator(\)) -ident(color2html) operator(=) keyword(new) ident(Expando)operator(()operator(\)) -ident(colors)operator(.)ident(each) operator({) ident(c) operator(->) - ident(color2html)operator([)ident(c)operator(]) operator(=) operator({) ident(args) operator(->) string)inlinecontent()delimiter(")> operator(}) -operator(}) -ident(println) ident(color2html)operator(.)ident(yellow)operator(()stringoperator(\)) -comment(// => error) -ident(color2html)operator(.)ident(yellow) operator(=) operator({) ident(args) operator(->) string)inlinecontent()delimiter(")> operator(}) comment(// too hard to see yellow) -ident(println) ident(color2html)operator(.)ident(yellow)operator(()stringoperator(\)) -comment(// => error) - -comment(// Other approaches:) -comment(// you could use invokeMethod to intercept the original method and call) -comment(// your modified method on just particular input data) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.15) -comment(//----------------------------------------------------------------------------------) -comment(// Trapping Undefined Function Calls) -type(class) class(FontHelper) operator({) - comment(// we could define all the important colors explicitly like this) - keyword(def) method(pink)operator(()ident(info)operator(\)) operator({) - ident(buildFont)operator(()stringoperator(,) ident(info)operator(\)) - operator(}) - comment(// but this method will catch any undefined ones) - keyword(def) method(invokeMethod)operator(()pre_type(String) ident(name)operator(,) pre_type(Object) ident(args)operator(\)) operator({) - ident(buildFont)operator(()ident(name)operator(,) ident(args)operator(.)ident(join)operator(()stringoperator(\))operator(\)) - operator(}) - keyword(def) method(buildFont)operator(()ident(name)operator(,) ident(info)operator(\)) operator({) - string)delimiter(")> operator(+) ident(info) operator(+) string)delimiter(")> - operator(}) -operator(}) -ident(fh) operator(=) keyword(new) ident(FontHelper)operator(()operator(\)) -ident(println) ident(fh)operator(.)ident(pink)operator(()stringoperator(\)) -ident(println) ident(fh)operator(.)ident(chartreuse)operator(()stringoperator(,) stringoperator(\)) -comment(// =>) -comment(// panther) -comment(// stuff and more stuff) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.16) -comment(//----------------------------------------------------------------------------------) -comment(// Simulating Nested Subroutimes: Using Closures within Methods) -keyword(def) method(outer)operator(()ident(arg)operator(\)) operator({) - keyword(def) ident(x) operator(=) ident(arg) operator(+) integer(35) - ident(inner) operator(=) operator({) ident(x) operator(*) integer(19) operator(}) - ident(x) operator(+) ident(inner)operator(()operator(\)) -operator(}) -keyword(assert) ident(outer)operator(()integer(10)operator(\)) operator(==) integer(900) -comment(//----------------------------------------------------------------------------------) - -comment(// @@PLEAC@@_10.17) -comment(//----------------------------------------------------------------------------------) -comment(// Program: Sorting Your Mail) -doctype(#!/usr/bin/groovy) -keyword(import) include(javax.mail.*) - -comment(// solution using mstor package (mstor.sf.net\)) -ident(session) operator(=) ident(Session)operator(.)ident(getDefaultInstance)operator(()keyword(new) pre_type(Properties)operator(()operator(\))operator(\)) -ident(store) operator(=) ident(session)operator(.)ident(getStore)operator(()keyword(new) ident(URLName)operator(()stringoperator(\))operator(\)) -ident(store)operator(.)ident(connect)operator(()operator(\)) - -comment(// read messages from Inbox) -ident(inbox) operator(=) ident(store)operator(.)ident(defaultFolder)operator(.)ident(getFolder)operator(()stringoperator(\)) -ident(inbox)operator(.)ident(open)operator(()ident(Folder)operator(.)ident(READ_ONLY)operator(\)) -ident(messages) operator(=) ident(inbox)operator(.)ident(messages)operator(.)ident(toList)operator(()operator(\)) - -comment(// extractor closures) -ident(subject) operator(=) operator({) ident(m) operator(->) ident(m)operator(.)ident(subject) operator(}) -ident(subjectExcludingReplyPrefix) operator(=) operator({) ident(m) operator(->) ident(subject)operator(()ident(m)operator(\))operator(.)ident(replaceAll)operator(()regexpoperator(,)stringoperator(\)) operator(}) comment(// double slash to single outside triple quotes) -ident(date) operator(=) operator({) ident(m) operator(->) ident(d) operator(=) ident(m)operator(.)ident(sentDate)operator(;) keyword(new) pre_type(Date)operator(()ident(d)operator(.)ident(year)operator(,) ident(d)operator(.)ident(month)operator(,) ident(d)operator(.)ident(date)operator(\)) operator(}) comment(// ignore time fields) - -comment(// sort by subject excluding 'Re:' prefixs then print subject for first 6) -ident(println) ident(messages)operator(.)ident(sort)operator({)ident(subjectExcludingReplyPrefix)operator(()local_variable(it)operator(\))operator(})operator([)integer(0)operator(..)integer(5)operator(])operator(*.)ident(subject)operator(.)ident(join)operator(()stringoperator(\)) -comment(// =>) -comment(// Additional Resources for JDeveloper 10g (10.1.3\)) -comment(// Amazon Web Services Developer Connection Newsletter #18) -comment(// Re: Ant 1.7.0?) -comment(// ARN Daily | 2007: IT predictions for the year ahead) -comment(// Big Changes at Gentleware) -comment(// BigPond Account Notification) - -comment(// sort by date then subject (print first 6 entries\)) -ident(sorted) operator(=) ident(messages)operator(.)ident(sort)operator({) ident(a)operator(,)ident(b) operator(->) - ident(date)operator(()ident(a)operator(\)) operator(==) ident(date)operator(()ident(b)operator(\)) operator(?) - ident(subjectExcludingReplyPrefix)operator(()ident(a)operator(\)) operator(<=>) ident(subjectExcludingReplyPrefix)operator(()ident(b)operator(\)) operator(:) - ident(date)operator(()ident(a)operator(\)) operator(<=>) ident(date)operator(()ident(b)operator(\)) -operator(}) -ident(sorted)operator([)integer(0)operator(..)integer(5)operator(])operator(.)ident(each)operator({) ident(m) operator(->) ident(println) stringcontent(.sentDate: )inlinecontent(.subject)delimiter(")> operator(}) -comment(// =>) -comment(// Wed Jan 03 08:54:15 EST 2007: ARN Daily | 2007: IT predictions for the year ahead) -comment(// Wed Jan 03 15:33:31 EST 2007: EclipseSource: RCP Adoption, Where Art Thou?) -comment(// Wed Jan 03 00:10:11 EST 2007: What's New at Sams Publishing?) -comment(// Fri Jan 05 08:31:11 EST 2007: Building a Sustainable Open Source Business) -comment(// Fri Jan 05 09:53:45 EST 2007: Call for Participation: Agile 2007) -comment(// Fri Jan 05 05:51:36 EST 2007: IBM developerWorks Weekly Edition, 4 January 2007) - -comment(// group by date then print first 2 entries of first 2 dates) -ident(groups) operator(=) ident(messages)operator(.)ident(groupBy)operator({) ident(date)operator(()local_variable(it)operator(\)) operator(}) -ident(groups)operator(.)ident(keySet)operator(()operator(\))operator(.)ident(toList)operator(()operator(\))operator([)integer(0)operator(..)integer(1)operator(])operator(.)ident(each)operator({) - ident(println) local_variable(it) - ident(println) ident(groups)operator([)local_variable(it)operator(])operator([)integer(0)operator(..)integer(1)operator(])operator(.)ident(collect)operator({) string operator(+) local_variable(it)operator(.)ident(subject) operator(})operator(.)ident(join)operator(()stringoperator(\)) -operator(}) -comment(// =>) -comment(// Wed Jan 03 00:00:00 EST 2007) -comment(// ARN Daily | 2007: IT predictions for the year ahead) -comment(// EclipseSource: RCP Adoption, Where Art Thou?) -comment(// Fri Jan 05 00:00:00 EST 2007) -comment(// Building a Sustainable Open Source Business) -comment(// Call for Participation: Agile 2007) - - -comment(// @@PLEAC@@_11.0) -comment(//----------------------------------------------------------------------------------) -comment(// In Groovy, most usages of names are references (there are some special) -comment(// rules for the map shorthand notation and builders\).) -comment(// Objects are inherently anonymous, they don't know what names refer to them.) -ident(ref) operator(=) integer(3) comment(// points ref to an Integer object with value 3.) -ident(println) ident(ref) comment(// prints the value that the name ref refers to.) - -ident(myList) operator(=) operator([)integer(3)operator(,) integer(4)operator(,) integer(5)operator(]) comment(// myList is a name for this list) -ident(anotherRef) operator(=) ident(myList) -ident(myMap) operator(=) operator([)stringoperator(:) stringoperator(,) stringoperator(:) stringoperator(]) comment(// myMap is a name for this map) - -ident(anArray) operator(=) operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(]) keyword(as) type(int)type([]) comment(// creates an array of three references to Integer objects) - -ident(list) operator(=) operator([)type([])operator(]) comment(// a list containing an empty list) -ident(list)operator([)integer(2)operator(]) operator(=) string -ident(println) ident(list) comment(// => [[], null, "Cat"]) -ident(list)operator([)integer(0)operator(])operator([)integer(2)operator(]) operator(=) string -ident(println) ident(list) comment(// => [[null, null, "Dog"], null, "Cat"]) - -ident(a) operator(=) operator([)integer(2)operator(,) integer(1)operator(]) -ident(b) operator(=) ident(a) comment(// b is a reference to the same thing as a) -ident(a)operator(.)ident(sort)operator(()operator(\)) -ident(println) ident(b) comment(// => [1, 2]) - -ident(nat) operator(=) operator([) pre_type(Name)operator(:) stringoperator(,) - key(Address)operator(:) stringoperator(,) - key(Birthday)operator(:) hex(0x5bb5580) -operator(]) -ident(println) ident(nat) -comment(// =>["Address":"1729 Ramanujan Lane\\nMathworld, PI 31416", "Name":"Leonhard Euler", "Birthday":96163200]) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.1) -comment(//----------------------------------------------------------------------------------) -ident(aref) operator(=) ident(myList) -ident(anonList) operator(=) operator([)integer(1)operator(,) integer(3)operator(,) integer(5)operator(,) integer(7)operator(,) integer(9)operator(]) -ident(anonCopy) operator(=) ident(anonList) -ident(implicitCreation) operator(=) operator([)integer(2)operator(,) integer(4)operator(,) integer(6)operator(,) integer(8)operator(,) integer(10)operator(]) - -ident(anonList) operator(+=) integer(11) -ident(println) ident(anonList) comment(// => [1, 3, 5, 7, 9, 11]) - -ident(two) operator(=) ident(implicitCreation)operator([)integer(0)operator(]) -keyword(assert) ident(two) operator(==) integer(2) - -comment(// To get the last index of a list, you can use size(\)) -comment(// but you never would) -ident(lastIdx) operator(=) ident(aref)operator(.)ident(size)operator(()operator(\)) operator(-) integer(1) - -comment(// Normally, though, you'd use an index of -1 for the last) -comment(// element, -2 for the second last, etc.) -ident(println) ident(implicitCreation)operator([)operator(-)integer(1)operator(]) -comment(//=> 10) - -comment(// And if you were looping through (and not using a list closure operator\)) -operator(()integer(0)operator(..<)ident(aref)operator(.)ident(size)operator(()operator(\))operator(\))operator(.)ident(each)operator({) comment(/* do something */) operator(}) - -ident(numItems) operator(=) ident(aref)operator(.)ident(size)operator(()operator(\)) - -keyword(assert) ident(anArray) keyword(instanceof) type(int)type([]) -keyword(assert) ident(anArray)operator(.)ident(class)operator(.)ident(isArray)operator(()operator(\)) -ident(println) ident(anArray) - -ident(myList)operator(.)ident(sort)operator(()operator(\)) comment(// sort is in place.) -ident(myList) operator(+=) string comment(// append item) - -keyword(def) method(createList)operator(()operator(\)) operator({) keyword(return) type([]) operator(}) -ident(aref1) operator(=) ident(createList)operator(()operator(\)) -ident(aref2) operator(=) ident(createList)operator(()operator(\)) -comment(// aref1 and aref2 point to different lists.) - -ident(println) ident(anonList)operator([)integer(4)operator(]) comment(// refers to the 4th item in the list_ref list.) - -comment(// The following two statements are equivalent and return up to 3 elements) -comment(// at indices 3, 4, and 5 (if they exist\).) -ident(x) operator(=) ident(anonList)operator([)integer(3)operator(..)integer(5)operator(]) -ident(x) operator(=) ident(anonList)operator([)operator(()integer(3)operator(..)integer(5)operator(\))operator(.)ident(step)operator(()integer(1)operator(\))operator(]) - -comment(// This will insert 3 elements, overwriting elements at indices 3,4, or 5 - if they exist.) -ident(anonList)operator([)integer(3)operator(..)integer(5)operator(]) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) - -comment(// non index-based looping) -keyword(for) operator(()ident(item) keyword(in) ident(anonList)operator(\)) ident(println) ident(item) -ident(anonList)operator(.)ident(each)operator({) ident(println) local_variable(it) operator(}) - -comment(// index-based looping) -operator(()integer(0)operator(..<)ident(anonList)operator(.)ident(size)operator(()operator(\))operator(\))operator(.)ident(each)operator({) ident(idx) operator(->) ident(println) ident(anonList)operator([)ident(idx)operator(]) operator(}) -keyword(for) operator(()ident(idx) keyword(in) integer(0)operator(..<)ident(anonList)operator(.)ident(size)operator(()operator(\))operator(\)) ident(println) ident(anonList)operator([)ident(idx)operator(]) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.2) -comment(//----------------------------------------------------------------------------------) -comment(// Making Hashes of Arrays) -ident(hash) operator(=) operator([)operator(:)operator(]) comment(// empty map) -ident(hash)operator([)stringoperator(]) operator(=) string - -ident(hash)operator(.)ident(each)operator({) ident(key)operator(,) ident(value) operator(->) ident(println) ident(key) operator(+) string operator(+) ident(value) operator(}) - -ident(hash)operator([)stringoperator(]) operator(=) operator([)integer(3)operator(,) integer(4)operator(,) integer(5)operator(]) -ident(values) operator(=) ident(hash)operator([)stringoperator(]) - -ident(hash)operator([)stringoperator(]) operator(+=) integer(6) -ident(println) ident(hash) -comment(// => ["KEYNAME":"new value", "a key":[3, 4, 5, 6]]) - -comment(// attempting to access a value for a key not in the map yields null) -keyword(assert) ident(hash)operator([)stringoperator(]) operator(==) pre_constant(null) -keyword(assert) ident(hash)operator(.)ident(get)operator(()stringoperator(,) integer(45)operator(\)) operator(==) integer(45) -ident(println) ident(hash) -comment(// => ["unknown key":45, "KEYNAME":"new value", "a key":[3, 4, 5, 6]]) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.3) -comment(//----------------------------------------------------------------------------------) -comment(// Hashes are no different to other objects) -ident(myHash) operator(=) operator([) key(key1)operator(:)integer(100)operator(,) key(key2)operator(:)integer(200) operator(]) -ident(myHashCopy) operator(=) ident(myHash)operator(.)ident(clone)operator(()operator(\)) - -ident(value) operator(=) ident(myHash)operator([)stringoperator(]) -ident(value) operator(=) ident(myHash)operator(.)string -ident(slice) operator(=) ident(myHash)operator([)integer(1)operator(..)integer(3)operator(]) -ident(keys) operator(=) ident(myHash)operator(.)ident(keySet)operator(()operator(\)) - -keyword(assert) ident(myHash) keyword(instanceof) pre_type(Map) - -operator([)ident(myHash)operator(,) ident(hash)operator(])operator(.)ident(each)operator({) ident(m) operator(->) - ident(m)operator(.)ident(each)operator({) ident(k)operator(,) ident(v) operator(->) ident(println) stringcontent( => )inlinedelimiter(")>operator(}) -operator(}) -comment(// =>) -comment(// key1 => 100) -comment(// key2 => 200) -comment(// unknown key => 45) -comment(// KEYNAME => new value) -comment(// a key => [3, 4, 5, 6]) - -ident(values) operator(=) operator([)stringoperator(,)stringoperator(])operator(.)ident(collect)operator({) ident(myHash)operator([)local_variable(it)operator(]) operator(}) -ident(println) ident(values) comment(// => [100, 200]) - -keyword(for) operator(()ident(key) keyword(in) operator([)stringoperator(,) stringoperator(])operator(\)) operator({) - ident(myHash)operator([)ident(key)operator(]) operator(+=) integer(7) -operator(}) -ident(println) ident(myHash) comment(// => ["key1":107, "key2":207]) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.4) -comment(//----------------------------------------------------------------------------------) -comment(// you can use closures or the &method notation) -keyword(def) method(joy)operator(()operator(\)) operator({) ident(println) string operator(}) -keyword(def) method(sullen)operator(()operator(\)) operator({) ident(println) string operator(}) -ident(angry) operator(=) operator({) ident(println) string operator(}) -ident(commands) operator(=) operator([)key(happy)operator(:) local_variable(this)operator(.)operator(&)ident(joy)operator(,) - key(sad)operator(:) local_variable(this)operator(.)operator(&)ident(sullen)operator(,) - key(done)operator(:) operator({) pre_type(System)operator(.)ident(exit)operator(()integer(0)operator(\)) operator(})operator(,) - key(mad)operator(:) ident(angry) -operator(]) - -ident(print) string -ident(cmd) operator(=) pre_type(System)operator(.)ident(in)operator(.)ident(readLine)operator(()operator(\)) -keyword(if) operator(()ident(cmd) keyword(in) ident(commands)operator(.)ident(keySet)operator(()operator(\))operator(\)) ident(commands)operator([)ident(cmd)operator(])operator(()operator(\)) -keyword(else) ident(println) stringdelimiter(")> - - -comment(// a counter of the type referred to in the original cookbook) -comment(// would be implemented using a class) -keyword(def) method(counterMaker)operator(()operator(\))operator({) - keyword(def) ident(start) operator(=) integer(0) - keyword(return) operator({) operator(->) ident(start)operator(++)operator(;) ident(start)operator(-)integer(1) operator(}) -operator(}) - -ident(counter) operator(=) ident(counterMaker)operator(()operator(\)) -integer(5)operator(.)ident(times)operator({) ident(print) stringcontent( )delimiter(")> operator(})operator(;) ident(println)operator(()operator(\)) - -ident(counter1) operator(=) ident(counterMaker)operator(()operator(\)) -ident(counter2) operator(=) ident(counterMaker)operator(()operator(\)) - -integer(5)operator(.)ident(times)operator({) ident(println) stringcontent( )delimiter(")> operator(}) -ident(println) stringcontent( )inlinedelimiter(")> -comment(//=> 0) -comment(//=> 1) -comment(//=> 2) -comment(//=> 3) -comment(//=> 4) -comment(//=> 5 0) - - -keyword(def) method(timestamp)operator(()operator(\)) operator({) - keyword(def) ident(start) operator(=) pre_type(System)operator(.)ident(currentTimeMillis)operator(()operator(\)) - keyword(return) operator({) operator(()pre_type(System)operator(.)ident(currentTimeMillis)operator(()operator(\)) operator(-) ident(start)operator(\))operator(.)ident(intdiv)operator(()integer(1000)operator(\)) operator(}) -operator(}) -ident(early) operator(=) ident(timestamp)operator(()operator(\)) -comment(//sleep(10000\)) -ident(later) operator(=) ident(timestamp)operator(()operator(\)) -ident(sleep)operator(()integer(2000)operator(\)) -ident(println) stringcontent( seconds since early.)delimiter(")> -ident(println) stringcontent( seconds since later.)delimiter(")> -comment(//=> It's been 12 seconds since early.) -comment(//=> It's been 2 seconds since later.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.5) -comment(//----------------------------------------------------------------------------------) -comment(// All variables in Groovy are objects including primitives. Some objects) -comment(// are immutable. Some operations on objects change mutable objects.) -comment(// Some operations produce new objects.) - -comment(// 15 is an Integer which is an immutable object.) -comment(// passing 15 to a method passes a reference to the Integer object.) -keyword(def) method(print)operator(()ident(n)operator(\)) operator({) ident(println) stringdelimiter(")> operator(}) -ident(print)operator(()integer(15)operator(\)) comment(// no need to create any kind of explicit reference) - -comment(// even though Integers are immutable, references to them are not) -ident(x) operator(=) integer(1) -ident(y) operator(=) ident(x) -ident(println) stringcontent( )inlinedelimiter(")> comment(// => 1 1) -ident(x) operator(+=) integer(1) comment(// "x" now refers to a different object than y) -ident(println) stringcontent( )inlinedelimiter(")> comment(// => 2 1) -ident(y) operator(=) integer(4) comment(// "y" now refers to a different object than it did before) -ident(println) stringcontent( )inlinedelimiter(")> comment(// => 2 4) - -comment(// Some objects (including ints and strings\) are immutable, however, which) -comment(// can give the illusion of a by-value/by-reference distinction:) -ident(list) operator(=) operator([)operator([)integer(1)operator(])operator(,) integer(1)operator(,) stringoperator(]) -ident(list)operator(.)ident(each)operator({) local_variable(it) operator(+=) integer(1) operator(}) comment(// plus operator doesn't operate inplace) -ident(print) ident(list) comment(//=> [[1] 1 s]) -ident(list) operator(=) ident(list)operator(.)ident(collect)operator({) local_variable(it) operator(+) integer(1) operator(}) -ident(print) ident(list) comment(//=> [[1, 1], 2, s1]) - -ident(list) operator(=) operator([)operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) operator([)integer(5)operator(,) integer(3)operator(,) integer(1)operator(])operator(]) -ident(list)operator(.)ident(each)operator({) local_variable(it)operator(.)ident(sort)operator(()operator(\)) operator(}) comment(// sort operation operates inline) -ident(println) ident(list) comment(// => [["X", "Y", "Z"], ["A", "B", "C"], [1, 3, 5]]) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.6) -comment(//----------------------------------------------------------------------------------) -comment(// As indicated by the previous section, everything is referenced, so) -comment(// just create a list as normal, and beware that augmented assignment) -comment(// works differently with immutable objects to mutable ones and depends) -comment(// on the semantics of the particular operation invoked:) -ident(mylist) operator(=) operator([)integer(1)operator(,) stringoperator(,) operator([)integer(1)operator(])operator(]) -ident(print) ident(mylist) -comment(//=> [1, s, [1]]) - -ident(mylist)operator(.)ident(each)operator({) local_variable(it) operator(*=) integer(2) operator(}) -ident(print) ident(mylist) -comment(//=> [1, s, [1,1]]) - -ident(mylist)operator([)integer(0)operator(]) operator(*=) integer(2) -ident(mylist)operator([)operator(-)integer(1)operator(]) operator(*=) integer(2) -ident(print) ident(mylist) -comment(//=> [2, s, [1, 1]]) - -comment(// If you need to modify every value in a list, you use collect) -comment(// which does NOT modify inplace but rather returns a new collection:) -ident(mylist) operator(=) integer(1)operator(..)integer(4) -ident(println) ident(mylist)operator(.)ident(collect)operator({) local_variable(it)operator(**)integer(3) operator(*) integer(4)operator(/)integer(3) operator(*) pre_type(Math)operator(.)ident(PI) operator(}) -comment(// => [4.188790204681671, 33.510321638395844, 113.09733552923255, 268.0825731062243]) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.7) -comment(//----------------------------------------------------------------------------------) -keyword(def) method(mkcounter)operator(()ident(count)operator(\)) operator({) - keyword(def) ident(start) operator(=) ident(count) - keyword(def) ident(bundle) operator(=) operator([)operator(:)operator(]) - ident(bundle)operator(.)string operator(=) operator({) ident(count) operator(+=) integer(1) operator(}) - ident(bundle)operator(.)string operator(=) operator({) ident(count) operator(-=) integer(1) operator(}) - ident(bundle)operator(.)string operator(=) operator({) ident(count) operator(=) ident(start) operator(}) - ident(bundle)operator([)stringoperator(]) operator(=) ident(bundle)operator([)stringoperator(]) - keyword(return) ident(bundle) -operator(}) - -ident(c1) operator(=) ident(mkcounter)operator(()integer(20)operator(\)) -ident(c2) operator(=) ident(mkcounter)operator(()integer(77)operator(\)) - -ident(println) stringoperator(])operator(()operator(\))inline_delimiter(})>delimiter(")> comment(// 21) -ident(println) stringoperator(])operator(()operator(\))inline_delimiter(})>delimiter(")> comment(// 78) -ident(println) stringoperator(])operator(()operator(\))inline_delimiter(})>delimiter(")> comment(// 22) -ident(println) stringoperator(])operator(()operator(\))inline_delimiter(})>delimiter(")> comment(// 21) -ident(println) stringoperator(])operator(()operator(\))inline_delimiter(})>delimiter(")> comment(// 20) -ident(println) stringoperator(])operator(()operator(\))inline_delimiter(})>delimiter(")> comment(// 77) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.8) -comment(//----------------------------------------------------------------------------------) -keyword(def) method(addAndMultiply)operator(()ident(a)operator(,) ident(b)operator(\)) operator({) - ident(println) stringcontent( )inlinedelimiter(")> -operator(}) -ident(methRef) operator(=) local_variable(this)operator(.)operator(&)ident(addAndMultiply) -comment(// or use direct closure) -ident(multiplyAndAdd) operator(=) operator({) ident(a)operator(,)ident(b) operator(->) ident(println) stringcontent( )inlinedelimiter(")> operator(}) -comment(// later ...) -ident(methRef)operator(()integer(2)operator(,)integer(3)operator(\)) comment(// => 5 6) -ident(multiplyAndAdd)operator(()integer(2)operator(,)integer(3)operator(\)) comment(// => 6 5) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.9) -comment(//----------------------------------------------------------------------------------) -ident(record) operator(=) operator([) - stringoperator(:) stringoperator(,) - stringoperator(:) integer(132)operator(,) - stringoperator(:) stringoperator(,) - stringoperator(:) integer(23)operator(,) - stringoperator(:) integer(37000)operator(,) - stringoperator(:) operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) -operator(]) -ident(println) stringinline_delimiter(})>content(, and my pals are )inlineoperator(.)ident(join)operator(()stringoperator(\))inline_delimiter(})>content(.)delimiter(")> -comment(// => I am Jason, and my pals are Norbert, Rhys, Phineas.) - -ident(byname) operator(=) operator([)operator(:)operator(]) -ident(byname)operator([)ident(record)operator([)stringoperator(])operator(]) operator(=) ident(record) - -ident(rp) operator(=) ident(byname)operator(.)ident(get)operator(()stringoperator(\)) -keyword(if) operator(()ident(rp)operator(\)) ident(println) stringoperator(])inline_delimiter(})>content(.)delimiter(")> - -ident(byname)operator([)stringoperator(])operator([)stringoperator(]) operator(+=) string -ident(println) stringoperator(])operator([)stringoperator(])operator(.)ident(size)operator(()operator(\))inline_delimiter(})>content( pals.)delimiter(")> - -ident(byname)operator(.)ident(each)operator({) ident(name)operator(,) ident(record) operator(->) - ident(println) stringcontent( is employee number )inlineoperator(])inline_delimiter(})>content(.)delimiter(")> -operator(}) - -ident(employees) operator(=) operator([)operator(:)operator(]) -ident(employees)operator([)ident(record)operator([)stringoperator(])operator(]) operator(=) ident(record) - -comment(// lookup by id) -ident(rp) operator(=) ident(employees)operator([)integer(132)operator(]) -keyword(if) operator(()ident(rp)operator(\)) ident(println) stringinline_delimiter(})>content(.)delimiter(")> - -ident(byname)operator([)stringoperator(])operator([)stringoperator(]) operator(*=) float(1.035) -ident(println) ident(record) -comment(// => ["pals":["Norbert", "Rhys", "Phineas", "Theodore"], "age":23,) -comment(// "title":"deputy peon", "name":"Jason", "salary":38295.000, "empno":132]) - -ident(peons) operator(=) ident(employees)operator(.)ident(findAll)operator({) ident(k)operator(,) ident(v) operator(->) ident(v)operator(.)string operator(=~) regexp operator(}) -keyword(assert) ident(peons)operator(.)ident(size)operator(()operator(\)) operator(==) integer(1) -ident(tsevens) operator(=) ident(employees)operator(.)ident(findAll)operator({) ident(k)operator(,) ident(v) operator(->) ident(v)operator(.)string operator(==) integer(27) operator(}) -keyword(assert) ident(tsevens)operator(.)ident(size)operator(()operator(\)) operator(==) integer(0) - -comment(// Go through all records) -ident(println) string operator(+) ident(employees)operator(.)ident(values)operator(()operator(\))operator(.)ident(collect)operator({)ident(r)operator(->)ident(r)operator(.)stringoperator(})operator(.)ident(join)operator(()stringoperator(\)) - -ident(byAge) operator(=) operator({)ident(a)operator(,)ident(b)operator(->) ident(a)operator(.)ident(value)operator(()operator(\))operator(.)string operator(<=>) ident(b)operator(.)ident(value)operator(()operator(\))operator(.)stringoperator(}) -ident(employees)operator(.)ident(values)operator(()operator(\))operator(.)ident(sort)operator({)ident(byAge)operator(})operator(.)ident(each)operator({) ident(r)operator(->) - ident(println) stringinline_delimiter(})>content( is )inlineinline_delimiter(})>delimiter(")> -operator(}) - -comment(// byage, a hash: age => list of records) -ident(byage) operator(=) operator([)operator(:)operator(]) -ident(byage)operator([)ident(record)operator([)stringoperator(])operator(]) operator(=) ident(byage)operator(.)ident(get)operator(()ident(record)operator([)stringoperator(])operator(,) type([])operator(\)) operator(+) operator([)ident(record)operator(]) - -ident(byage)operator(.)ident(each)operator({) ident(age)operator(,) ident(list) operator(->) - ident(println) stringcontent(: )inlineoperator(})operator(.)ident(join)operator(()stringoperator(\))inline_delimiter(})>delimiter(")> -operator(}) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.10) -comment(//----------------------------------------------------------------------------------) -comment(// if you are using a Properties (see 8.16\) then just use load) -comment(// and store (or storeToXML\)) -comment(// variation to original cookbook as Groovy can use Java's object serialization) -ident(map) operator(=) operator([)integer(1)operator(:)stringoperator(,) integer(2)operator(:)stringoperator(,) integer(3)operator(:)stringoperator(]) -comment(// write) -keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(withObjectOutputStream)operator({) ident(oos) operator(->) - ident(oos)operator(.)ident(writeObject)operator(()ident(map)operator(\)) -operator(}) -comment(// reset) -ident(map) operator(=) pre_constant(null) -comment(// read) -keyword(new) pre_type(File)operator(()stringoperator(\))operator(.)ident(withObjectInputStream)operator({) ident(ois) operator(->) - ident(map) operator(=) ident(ois)operator(.)ident(readObject)operator(()operator(\)) -operator(}) -ident(println) ident(map) comment(// => [1:"Jan", 2:"Feb", 3:"Mar"]) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.11) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy automatically does pretty printing for some of the key types, e.g.) -ident(mylist) operator(=) operator([)operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(])operator(,) operator([)integer(4)operator(,) operator([)integer(5)operator(,)integer(6)operator(,)integer(7)operator(])operator(,) integer(8)operator(,)integer(9)operator(,) operator([)integer(0)operator(,)integer(3)operator(,)integer(5)operator(])operator(])operator(,) integer(7)operator(,) integer(8)operator(]) -ident(println) ident(mylist) -comment(// => [[1, 2, 3], [4, [5, 6, 7], 8, 9, [0, 3, 5]], 7, 8]) - -ident(mydict) operator(=) operator([)stringoperator(:) stringoperator(,) stringoperator(:)operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(])operator(]) -ident(println) ident(mydict) -comment(// => ["abc":"def", "ghi":[1, 2, 3]]) - -comment(// if you have another type of object you can use the built-in dump(\) method) -type(class) class(PetLover) operator({) - keyword(def) ident(name) - keyword(def) ident(age) - keyword(def) ident(pets) -operator(}) -ident(p) operator(=) keyword(new) ident(PetLover)operator(()key(name)operator(:)stringoperator(,) key(age)operator(:)integer(23)operator(,) key(pets)operator(:)operator([)key(dog)operator(:)stringoperator(,)key(cat)operator(:)stringoperator(])operator(\)) -ident(println) ident(p) -comment(// => PetLover@b957ea) -ident(println) ident(p)operator(.)ident(dump)operator(()operator(\)) -comment(// => ) - -comment(// If that isn't good enough, you can use Boost (http://tara-indigo.org/daisy/geekscape/g2/128\)) -comment(// or Jakarta Commons Lang *ToStringBuilders (jakarta.apache.org/commons\)) -comment(// Here's an example of Boost, just extend the supplied Primordial class) -keyword(import) include(au.net.netstorm.boost.primordial.Primordial) -type(class) class(PetLover2) directive(extends) ident(Primordial) operator({) keyword(def) ident(name)operator(,) ident(age)operator(,) ident(pets) operator(}) -ident(println) keyword(new) ident(PetLover2)operator(()key(name)operator(:)stringoperator(,) key(age)operator(:)integer(23)operator(,) key(pets)operator(:)operator([)key(dog)operator(:)stringoperator(,)key(cat)operator(:)stringoperator(])operator(\)) -comment(// =>) -comment(// PetLover2[) -comment(// name=Jason) -comment(// age=23) -comment(// pets={cat=Garfield, dog=Rover}) -comment(// metaClass=groovy.lang.MetaClassImpl@1d8d39f[class PetLover2]) -comment(// ]) - -comment(// using Commons Lang ReflectionToStringBuilder (equivalent to dump(\)\)) -keyword(import) include(org.apache.commons.lang.builder.*) -type(class) class(PetLover3) operator({) - keyword(def) ident(name)operator(,) ident(age)operator(,) ident(pets) - pre_type(String) ident(toString)operator(()operator(\)) operator({) - ident(ReflectionToStringBuilder)operator(.)ident(toString)operator(()local_variable(this)operator(\)) - operator(}) -operator(}) -ident(println) keyword(new) ident(PetLover3)operator(()key(name)operator(:)stringoperator(,) key(age)operator(:)integer(23)operator(,) key(pets)operator(:)operator([)key(dog)operator(:)stringoperator(,)key(cat)operator(:)stringoperator(])operator(\)) -comment(// => PetLover3@196e136[name=Jason,age=23,pets={cat=Garfield, dog=Rover}]) - -comment(// using Commons Lang ToStringBuilder if you want a custom format) -type(class) class(PetLover4) operator({) - keyword(def) ident(name)operator(,) ident(dob)operator(,) ident(pets) - pre_type(String) ident(toString)operator(()operator(\)) operator({) - keyword(def) ident(d1) operator(=) ident(dob)operator(.)ident(time)operator(;) keyword(def) ident(d2) operator(=) operator(()keyword(new) pre_type(Date)operator(()operator(\))operator(\))operator(.)ident(time) - type(int) ident(age) operator(=) operator(()ident(d2) operator(-) ident(d1)operator(\))operator(/)integer(1000)operator(/)integer(60)operator(/)integer(60)operator(/)integer(24)operator(/)integer(365) comment(// close approx good enough here) - keyword(return) keyword(new) ident(ToStringBuilder)operator(()local_variable(this)operator(\))operator(.) - ident(append)operator(()stringoperator(,) ident(name)operator(\))operator(.) - ident(append)operator(()stringoperator(,) ident(pets)operator(\))operator(.) - ident(append)operator(()stringoperator(,) ident(age)operator(\)) - operator(}) -operator(}) -ident(println) keyword(new) ident(PetLover4)operator(()key(name)operator(:)stringoperator(,) key(dob)operator(:)keyword(new) pre_type(Date)operator(()integer(83)operator(,)oct(03)operator(,)oct(04)operator(\))operator(,) key(pets)operator(:)operator([)key(dog)operator(:)stringoperator(,)key(cat)operator(:)stringoperator(])operator(\)) -comment(// => PetLover4@fdfc58[Pet Lover's name=Jason,Pets={cat=Garfield, dog=Rover},Age=23]) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.12) -comment(//----------------------------------------------------------------------------------) -ident(oldlist) operator(=) operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(]) -ident(newlist) operator(=) keyword(new) pre_type(ArrayList)operator(()ident(oldlist)operator(\)) comment(// shallow copy) -ident(newlist) operator(=) ident(oldlist)operator(.)ident(clone)operator(()operator(\)) comment(// shallow copy) - -ident(oldmap) operator(=) operator([)key(a)operator(:)integer(1)operator(,) key(b)operator(:)integer(2)operator(,) key(c)operator(:)integer(3)operator(]) -ident(newmap) operator(=) keyword(new) pre_type(HashMap)operator(()ident(oldmap)operator(\)) comment(// shallow copy) -ident(newmap) operator(=) ident(oldmap)operator(.)ident(clone)operator(()operator(\)) comment(// shallow copy) - -ident(oldarray) operator(=) operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(]) keyword(as) type(int)type([]) -ident(newarray) operator(=) ident(oldarray)operator(.)ident(clone)operator(()operator(\)) - -comment(// shallow copies copy a data structure, but don't copy the items in those) -comment(// data structures so if there are nested data structures, both copy and) -comment(// original will refer to the same object) -ident(mylist) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) -ident(newlist) operator(=) ident(mylist)operator(.)ident(clone)operator(()operator(\)) -ident(mylist)operator([)integer(0)operator(]) operator(=) string -ident(println) stringcontent( )inlinedelimiter(")> -comment(//=> ["0", "2", "3"] ["1", "2", "3"]) - -ident(mylist) operator(=) operator([)operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) integer(4)operator(]) -ident(newlist) operator(=) ident(mylist)operator(.)ident(clone)operator(()operator(\)) -ident(mylist)operator([)integer(0)operator(])operator([)integer(0)operator(]) operator(=) string -ident(println) stringcontent( )inlinedelimiter(")> -comment(//=> [["0", "2", "3"], 4] [["0", "2", "3"], 4]) - -comment(// standard deep copy implementation) -keyword(def) method(deepcopy)operator(()ident(orig)operator(\)) operator({) - ident(bos) operator(=) keyword(new) pre_type(ByteArrayOutputStream)operator(()operator(\)) - ident(oos) operator(=) keyword(new) pre_type(ObjectOutputStream)operator(()ident(bos)operator(\)) - ident(oos)operator(.)ident(writeObject)operator(()ident(orig)operator(\))operator(;) ident(oos)operator(.)ident(flush)operator(()operator(\)) - ident(bin) operator(=) keyword(new) pre_type(ByteArrayInputStream)operator(()ident(bos)operator(.)ident(toByteArray)operator(()operator(\))operator(\)) - ident(ois) operator(=) keyword(new) pre_type(ObjectInputStream)operator(()ident(bin)operator(\)) - keyword(return) ident(ois)operator(.)ident(readObject)operator(()operator(\)) -operator(}) - -ident(newlist) operator(=) ident(deepcopy)operator(()ident(oldlist)operator(\)) comment(// deep copy) -ident(newmap) operator(=) ident(deepcopy)operator(()ident(oldmap)operator(\)) comment(// deep copy) - -ident(mylist) operator(=) operator([)operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) integer(4)operator(]) -ident(newlist) operator(=) ident(deepcopy)operator(()ident(mylist)operator(\)) -ident(mylist)operator([)integer(0)operator(])operator([)integer(0)operator(]) operator(=) string -ident(println) stringcontent( )inlinedelimiter(")> -comment(//=> [["0", "2", "3"], 4] [["1", "2", "3"], 4]) - -comment(// See also:) -comment(// http://javatechniques.com/public/java/docs/basics/low-memory-deep-copy.html) -comment(// http://javatechniques.com/public/java/docs/basics/faster-deep-copy.html) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.13) -comment(//----------------------------------------------------------------------------------) -comment(// use Java's serialization capabilities as per 11.10) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.14) -comment(//----------------------------------------------------------------------------------) -comment(// There are numerous mechanisms for persisting objects to disk) -comment(// using Groovy and Java mechanisms. Some are completely transparent,) -comment(// some require some initialization only, others make the persistence) -comment(// mechanisms visible. Here is a site that lists over 20 options:) -comment(// http://www.java-source.net/open-source/persistence) -comment(// (This list doesn't include EJB offerings which typically) -comment(// require an application server or XML-based options\)) - -comment(// We'll just consider one possibility from prevayler.sf.net.) -comment(// This package doesn't make changes to persistent data transparent;) -comment(// instead requiring an explicit call via a transaction object.) -comment(// It saves all such transaction objects in a journal file so) -comment(// that it can rollback the system any number of times (or if) -comment(// you make use of the timestamp feature\) to a particular point) -comment(// in time. It can also be set up to create snapshots which) -comment(// consolidate all changes made up to a certain point. The) -comment(// journalling will begin again from that point.) -keyword(import) include(org.prevayler.*) -type(class) class(ImportantHash) directive(implements) pre_type(Serializable) operator({) - directive(private) ident(map) operator(=) operator([)operator(:)operator(]) - keyword(def) method(putAt)operator(()ident(key)operator(,) ident(value)operator(\)) operator({) ident(map)operator([)ident(key)operator(]) operator(=) ident(value) operator(}) - keyword(def) method(getAt)operator(()ident(key)operator(\)) operator({) ident(map)operator([)ident(key)operator(]) operator(}) -operator(}) -type(class) class(StoreTransaction) directive(implements) ident(Transaction) operator({) - directive(private) ident(val) - ident(StoreTransaction)operator(()ident(val)operator(\)) operator({) local_variable(this)operator(.)ident(val) operator(=) ident(val) operator(}) - type(void) ident(executeOn)operator(()ident(prevayler)operator(,) pre_type(Date) ident(ignored)operator(\)) operator({) ident(prevayler)operator(.)ident(putAt)operator(()ident(val)operator(,)ident(val)operator(*)integer(2)operator(\)) operator(}) -operator(}) -keyword(def) method(save)operator(()ident(n)operator(\))operator({) ident(store)operator(.)ident(execute)operator(()keyword(new) ident(StoreTransaction)operator(()ident(n)operator(\))operator(\)) operator(}) -ident(store) operator(=) ident(PrevaylerFactory)operator(.)ident(createPrevayler)operator(()keyword(new) ident(ImportantHash)operator(()operator(\))operator(,) stringoperator(\)) -ident(hash) operator(=) ident(store)operator(.)ident(prevalentSystem)operator(()operator(\)) -keyword(for) operator(()ident(i) keyword(in) integer(0)operator(..)integer(1000)operator(\)) operator({) - ident(save)operator(()ident(i)operator(\)) -operator(}) -ident(println) ident(hash)operator([)integer(750)operator(]) comment(// => 1500) - -ident(store) operator(=) pre_constant(null)operator(;) ident(hash) operator(=) pre_constant(null) comment(// *** could shutdown here) - -ident(store) operator(=) ident(PrevaylerFactory)operator(.)ident(createPrevayler)operator(()keyword(new) ident(ImportantHash)operator(()operator(\))operator(,) stringoperator(\)) -ident(hash) operator(=) ident(store)operator(.)ident(prevalentSystem)operator(()operator(\)) -ident(println) ident(hash)operator([)integer(750)operator(]) comment(// => 1500) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_11.15) -comment(//----------------------------------------------------------------------------------) -comment(// bintree - binary tree demo program) -type(class) class(BinaryTree) operator({) - keyword(def) ident(value)operator(,) ident(left)operator(,) ident(right) - ident(BinaryTree)operator(()ident(val)operator(\)) operator({) - ident(value) operator(=) ident(val) - ident(left) operator(=) pre_constant(null) - ident(right) operator(=) pre_constant(null) - operator(}) - - comment(// insert given value into proper point of) - comment(// provided tree. If no tree provided,) - comment(// use implicit pass by reference aspect of @_) - comment(// to fill one in for our caller.) - keyword(def) method(insert)operator(()ident(val)operator(\)) operator({) - keyword(if) operator(()ident(val) operator(<) ident(value)operator(\)) operator({) - keyword(if) operator(()ident(left)operator(\)) ident(left)operator(.)ident(insert)operator(()ident(val)operator(\)) - keyword(else) ident(left) operator(=) keyword(new) ident(BinaryTree)operator(()ident(val)operator(\)) - operator(}) keyword(else) keyword(if) operator(()ident(val) operator(>) ident(value)operator(\)) operator({) - keyword(if) operator(()ident(right)operator(\)) ident(right)operator(.)ident(insert)operator(()ident(val)operator(\)) - keyword(else) ident(right) operator(=) keyword(new) ident(BinaryTree)operator(()ident(val)operator(\)) - operator(}) keyword(else) ident(println) string comment(// ignore double values) - operator(}) - - comment(// recurse on left child,) - comment(// then show current value,) - comment(// then recurse on right child.) - keyword(def) method(inOrder)operator(()operator(\)) operator({) - keyword(if) operator(()ident(left)operator(\)) ident(left)operator(.)ident(inOrder)operator(()operator(\)) - ident(print) ident(value) operator(+) string - keyword(if) operator(()ident(right)operator(\)) ident(right)operator(.)ident(inOrder)operator(()operator(\)) - operator(}) - - comment(// show current value,) - comment(// then recurse on left child,) - comment(// then recurse on right child.) - keyword(def) method(preOrder)operator(()operator(\)) operator({) - ident(print) ident(value) operator(+) string - keyword(if) operator(()ident(left)operator(\)) ident(left)operator(.)ident(preOrder)operator(()operator(\)) - keyword(if) operator(()ident(right)operator(\)) ident(right)operator(.)ident(preOrder)operator(()operator(\)) - operator(}) - - comment(// show current value,) - comment(// then recurse on left child,) - comment(// then recurse on right child.) - keyword(def) method(dumpOrder)operator(()operator(\)) operator({) - ident(print) local_variable(this)operator(.)ident(dump)operator(()operator(\)) operator(+) string - keyword(if) operator(()ident(left)operator(\)) ident(left)operator(.)ident(dumpOrder)operator(()operator(\)) - keyword(if) operator(()ident(right)operator(\)) ident(right)operator(.)ident(dumpOrder)operator(()operator(\)) - operator(}) - - comment(// recurse on left child,) - comment(// then recurse on right child,) - comment(// then show current value.) - keyword(def) method(postOrder)operator(()operator(\)) operator({) - keyword(if) operator(()ident(left)operator(\)) ident(left)operator(.)ident(postOrder)operator(()operator(\)) - keyword(if) operator(()ident(right)operator(\)) ident(right)operator(.)ident(postOrder)operator(()operator(\)) - ident(print) ident(value) operator(+) string - operator(}) - - comment(// find out whether provided value is in the tree.) - comment(// if so, return the node at which the value was found.) - comment(// cut down search time by only looking in the correct) - comment(// branch, based on current value.) - keyword(def) method(search)operator(()ident(val)operator(\)) operator({) - keyword(if) operator(()ident(val) operator(==) ident(value)operator(\)) operator({) - keyword(return) local_variable(this)operator(.)ident(dump)operator(()operator(\)) - operator(}) keyword(else) keyword(if) operator(()ident(val) operator(<) ident(value)operator(\)) operator({) - keyword(return) ident(left) operator(?) ident(left)operator(.)ident(search)operator(()ident(val)operator(\)) operator(:) pre_constant(null) - operator(}) keyword(else) operator({) - keyword(return) ident(right) operator(?) ident(right)operator(.)ident(search)operator(()ident(val)operator(\)) operator(:) pre_constant(null) - operator(}) - operator(}) -operator(}) - -comment(// first generate 20 random inserts) -ident(test) operator(=) keyword(new) ident(BinaryTree)operator(()integer(500)operator(\)) -ident(rand) operator(=) keyword(new) pre_type(Random)operator(()operator(\)) -integer(20)operator(.)ident(times)operator({) - ident(test)operator(.)ident(insert)operator(()ident(rand)operator(.)ident(nextInt)operator(()integer(1000)operator(\))operator(\)) -operator(}) - -comment(// now dump out the tree all three ways) -ident(print) stringoperator(;) ident(test)operator(.)ident(preOrder)operator(()operator(\))operator(;) ident(println) string -ident(print) stringoperator(;) ident(test)operator(.)ident(inOrder)operator(()operator(\))operator(;) ident(println) string -ident(print) stringoperator(;) ident(test)operator(.)ident(postOrder)operator(()operator(\))operator(;) ident(println) string - -ident(println) string -keyword(while) operator(()operator(()ident(item) operator(=) pre_type(System)operator(.)ident(in)operator(.)ident(readLine)operator(()operator(\))operator(?)operator(.)ident(trim)operator(()operator(\))operator(\)) operator(!=) pre_constant(null)operator(\)) operator({) - ident(println) ident(test)operator(.)ident(search)operator(()ident(item)operator(.)ident(toInteger)operator(()operator(\))operator(\)) - ident(println) string -operator(}) -comment(// Randomly produces a tree such as:) -comment(// -------- 500 ------) -comment(// / \\ -// 181 847) -comment(// / \\ / \\ -// 3 204 814 970) -comment(// \\ / \\ /) -comment(// 126 196 414 800) -comment(// / \\ /) -comment(// 353 438 621) -comment(// / / \\ -// 423 604 776) -comment(// / /) -comment(// 517 765) -comment(// /) -comment(// 646) -comment(// /) -comment(// 630) -comment(// Pre order:) -comment(// 500 181 3 126 204 196 414 353 438 423 847 814 800 621 604 517 776 765 646 630 970) -comment(// In order:) -comment(// 3 126 181 196 204 353 414 423 438 500 517 604 621 630 646 765 776 800 814 847 970) -comment(// Post order:) -comment(// 126 3 196 353 423 438 414 204 181 517 604 630 646 765 776 621 800 814 970 847 500) -comment(//) -comment(// Search?) -comment(// 125) -comment(// null) -comment(//) -comment(// Search?) -comment(// 126) -comment(// ) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.0) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy adopts many of the Java structuring conventions and terminology) -comment(// and adds some concepts of its own.) -comment(// Code-reuse can occur at the script, class, library, component or framework level.) -comment(// Source code including class file source and scripts are organised into packages.) -comment(// These can be thought of as like hierarchical folders or directories. Two class) -comment(// with the same name can be distinguished by having different packages. Compiled) -comment(// byte code and sometimes source code including scripts can be packaged up into) -comment(// jar files. Various conventions exist for packaging classes and resources in) -comment(// such a way to allow them to be easily reused. Some of these conventions allow) -comment(// reusable code to be placed within repositories for easy use by third parties.) -comment(// One such repository is the maven repository, e.g.: ibiblio.org/maven2) -comment(// When reusing classes, it is possible to compartmentalise knowledge of) -comment(// particular packages using multiple (potentially hierarchical\) classloaders.) -comment(// By convention, package names are all lowercase. Class names are capitalized.) -comment(// Naming examples:) -comment(// package my.package1.name // at most one per source file - at top of file) -comment(// class MyClass ... // actually defines my.package1.name.MyClass) -comment(// import my.package1.name.MyClass // allows package to be dropped within current file) -comment(// import my.package2.name.MyClass // if class basenames are the same, can't) -comment(// // import both, leave one fully qualified) -comment(// import my.package.name.* // all classes in package can drop package prefix) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.1) -comment(//----------------------------------------------------------------------------------) -comment(// No equivalent export process exists for Groovy.) - -comment(// If you have some Groovy functionality that you would like others to use) -comment(// you either make the source code available or compile it into class files) -comment(// and package those up in a jar file. Some subset of your class files will) -comment(// define the OO interface to your functionality, e.g. public methods,) -comment(// interfaces, etc. Depending on the circumstances, various conventions are) -comment(// used to indicate this functionality including Manifest files, javadocs,) -comment(// deployment descriptors, project metadata and dependency management files.) -comment(// See 12.18 for an example.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.2) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy supports both static and dynamic (strong\) typing. When trying to) -comment(// compile or run files using static typing, the required classes referenced) -comment(// must be available. Classes used in more dynamic ways may be loaded (or) -comment(// created\) at runtime. Errors in loading such dynamic cases are handled) -comment(// using the normal exception handling mechanisms.) - -comment(// attempt to load an unknown resource or script:) -keyword(try) operator({) - ident(evaluate)operator(()keyword(new) pre_type(File)operator(()stringoperator(\))operator(\)) -operator(}) keyword(catch) operator(()exception(Exception) exception(FileNotFoundException)operator(\)) operator({) - ident(println) string -operator(}) -comment(// => File not found, skipping ...) - -comment(// attempt to load an unknown class:) -keyword(try) operator({) - pre_type(Class)operator(.)ident(forName)operator(()stringoperator(\)) -operator(}) keyword(catch) operator(()exception(ClassNotFoundException) ident(ex)operator(\)) operator({) - ident(println) string -operator(}) -comment(// -> Class not found, skipping ...) - -comment(// dynamicallly look for a database driver (slight variation to original cookbook\)) -comment(// Note: this hypothetical example ignores certain issues e.g. different url) -comment(// formats for configuration when establishing a connection with the driver) -ident(candidates) operator(=) operator([) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - string -operator(]) -ident(loaded) operator(=) pre_constant(null) -keyword(for) operator(()ident(driver) keyword(in) ident(candidates)operator(\)) operator({) - keyword(try) operator({) - ident(loaded) operator(=) pre_type(Class)operator(.)ident(forName)operator(()ident(driver)operator(\))operator(.)ident(newInstance)operator(()operator(\)) - keyword(break) - operator(}) keyword(catch) operator(()exception(Exception) ident(ex)operator(\)) operator({) comment(/* ignore */) operator(}) -operator(}) -ident(println) ident(loaded)operator(?)operator(.)ident(class)operator(?)operator(.)ident(name) comment(// => sun.jdbc.odbc.JdbcOdbcDriver) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.3) -comment(//----------------------------------------------------------------------------------) -comment(// In Groovy (like Java\), any static reference to an external class within) -comment(// your class will cause the external class to be loaded from the classpath.) -comment(// You can dynamically add to the classpath using:) -comment(// this.class.rootLoader.addURL(url\)) -comment(// To delay loading of external classes, use Class.forName(\) or evaluate(\)) -comment(// the script separately as shown in 12.2.) - -comment(// For the specific case of initialization code, here is another example:) -comment(// (The code within the anonymous { ... } block is called whenever the) -comment(// class is loaded.\)) -type(class) class(DbHelper) operator({) - keyword(def) method(driver) - operator({) - keyword(if) operator(()pre_type(System)operator(.)ident(properties)operator(.)string operator(==) stringoperator(\)) - ident(driver) operator(=) pre_type(Class)operator(.)ident(forName)operator(()stringoperator(\)) - keyword(else) - ident(driver) operator(=) pre_type(Class)operator(.)ident(forName)operator(()stringoperator(\)) - operator(}) -operator(}) -ident(println) keyword(new) ident(DbHelper)operator(()operator(\))operator(.)ident(driver)operator(.)ident(name) comment(// => sun.jdbc.odbc.JdbcOdbcDriver) -comment(// call program with -Ddriver=oracle to swap to other driver) - -comment(// A slightly related feature: If you want to load a script (typically in a) -comment(// server environment\) whenever the source file changes, use GroovyScriptEngine(\)) -comment(// instead of GroovyShell(\) when embedding groovy.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.4) -comment(//----------------------------------------------------------------------------------) -comment(// class variables are private unless access functions are defined) -type(class) class(Alpha) operator({) - keyword(def) ident(x) operator(=) integer(10) - directive(private) ident(y) operator(=) integer(12) -operator(}) - -ident(println) keyword(new) ident(Alpha)operator(()operator(\))operator(.)ident(x) comment(// => 10) -ident(println) keyword(new) ident(Alpha)operator(()operator(\))operator(.)ident(y) comment(// => 12 when referenced inside source file, error outside) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.5) -comment(//----------------------------------------------------------------------------------) -comment(// You can examine the stacktrace to determine the calling class: see 10.4) -comment(// When executing a script from a groovy source file, you can either:) -ident(println) ident(getClass)operator(()operator(\))operator(.)ident(classLoader)operator(.)ident(resourceLoader)operator(.)ident(loadGroovySource)operator(()ident(getClass)operator(()operator(\))operator(.)ident(name)operator(\)) -comment(// => file:/C:/Projects/GroovyExamples/Pleac/classes/pleac12.groovy) -comment(// or for the initially started script when started using the standard .bat/.sh files) -ident(println) pre_type(System)operator(.)ident(properties)operator(.)string -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.6) -comment(//----------------------------------------------------------------------------------) -comment(// For code which executes at class startup, see the initialization code block) -comment(// mechanism mentioned in 12.3. For code which should execute during shutdown) -comment(// see the finalize(\) method discussed (including limitations\) in 13.2.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.7) -comment(//----------------------------------------------------------------------------------) -comment(// Each JVM process may have its own classpath (and indeed its own version of Java) -comment(// runtime and libraries\). You "simply" supply a classpath pointing to different) -comment(// locations to obtain different modules.) -comment(// Groovy augments the JVM behaviour by allowing individuals to have a ~/.groovy/lib) -comment(// directory with additional libraries (and potentially other resources\).) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.8) -comment(//----------------------------------------------------------------------------------) -comment(// To make your code available to others could involve any of the following:) -comment(// (1\) make your source code available) -comment(// (2\) if you are creating a standard class, use the jar tool to package the) -comment(// compiled code into a jar - this is then added to the classpath to use) -comment(// (3\) if the jar relies on additional jars, this is sometimes specified in) -comment(// a special manifest file within the jar) -comment(// (4\) if the code is designed to run within a container environment, there) -comment(// might be additional packaging, e.g. servlets might be packaged in a war) -comment(// file - essentially a jar file with extra metadata in xml format.) -comment(// (5\) you might also supply your package to a well known repository such as the) -comment(// maven repository - and you will add dependency information in xml format) -comment(// (6\) you may use platform specific installers to produce easily installable) -comment(// components (e.g. windows .exe files or linux rpm's\)) -comment(// (7\) you may spackage up your components as a plugin (e.g. as an eclipse plugin\)) -comment(// this is also typically in jar/zip like format with additional metadata) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.9) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy has no SelfLoader. Class loading can be delayed using external scripts) -comment(// and by using the Class.forName(\) approach discussed in 12.2/12.3. If you have) -comment(// critical performance issues, you can use these techniques and keep your class) -comment(// size small to maximise the ability to defer loading. There are other kinds of) -comment(// performance tradeoffs you can make too. Alot of work has been done with JIT) -comment(// (just in time\) compilers for bytecode. You can pre-compile Groovy source files) -comment(// into bytecode using the groovy compiler (groovyc\). You can also do this on) -comment(// the fly for scripts you know you are going to need shortly.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.10) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy has no AutoLoader. See the discussion in 12.9 for some techniques to) -comment(// impact program performance. There are many techniques available to speed up) -comment(// program performance (and in particular load speed\). Some of these utilise) -comment(// techniques similar in nature to the technique used by the AutoLoader.) -comment(// As already mentioned, when you load a class into the JVM, any statically) -comment(// referenced class is also loaded. If you reference interfaces rather than) -comment(// concrete implementations, only the interface need be loaded. If you must) -comment(// reference a concrete implementation you can use either a Proxy class or) -comment(// classloader tricks to delay the loading of a full class (e.g. you supply a) -comment(// Proxy class with just one method implemented or a lazy-loading Proxy which) -comment(// loads the real class only when absolutely required\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.11) -comment(//----------------------------------------------------------------------------------) -comment(// You can use Categories to override Groovy and Java base functionality.) -ident(println) keyword(new) pre_type(Date)operator(()operator(\))operator(.)ident(time) comment(// => 1169019557140) - -type(class) class(DateCategory) operator({) comment(// the class name by convention ends with category) - comment(// we can add new functionality) - directive(static) type(float) ident(getFloatTime)operator(()pre_type(Date) ident(self)operator(\)) operator({) - keyword(return) operator(()type(float)operator(\)) ident(self)operator(.)ident(getTime)operator(()operator(\)) - operator(}) - comment(// we can override existing functionality (now seconds since 1970 not millis\)) - directive(static) type(long) ident(asSeconds)operator(()pre_type(Date) ident(self)operator(\)) operator({) - keyword(return) operator(()type(long)operator(\)) operator(()ident(self)operator(.)ident(getTime)operator(()operator(\))operator(/)integer(1000)operator(\)) - operator(}) -operator(}) - -ident(use) operator(()ident(DateCategory)operator(\)) operator({) - ident(println) keyword(new) pre_type(Date)operator(()operator(\))operator(.)ident(floatTime) comment(// => 1.1690195E12) - ident(println) keyword(new) pre_type(Date)operator(()operator(\))operator(.)ident(asSeconds)operator(()operator(\)) comment(// => 1169019557) -operator(}) - -comment(// We can also use the 'as' keyword) -type(class) class(MathLib) operator({) - keyword(def) method(triple)operator(()ident(n)operator(\)) operator({) ident(n) operator(*) integer(4) operator(}) - keyword(def) method(twice)operator(()ident(n)operator(\)) operator({) ident(n) operator(*) integer(2) operator(}) -operator(}) -keyword(def) ident(m) operator(=) keyword(new) ident(MathLib)operator(()operator(\)) -ident(println) ident(m)operator(.)ident(twice)operator(()integer(10)operator(\)) comment(// => 20) -ident(println) ident(m)operator(.)ident(triple)operator(()integer(10)operator(\)) comment(// => 40 (Intentional Bug!\)) -comment(// we might want to make use of some funtionality in the math) -comment(// library but want to later some of its features slightly or fix) -comment(// some bugs, we can simply import the original using a different name) -keyword(import) include(MathLib) keyword(as) class(BuggyMathLib) -comment(// now we could define our own MathLib which extended or had a delegate) -comment(// of the BuggyMathLib class) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.12) -comment(//----------------------------------------------------------------------------------) -comment(// Many Java and Groovy programs emit a stacktrace when an error occurs.) -comment(// This shows both the calling and called programs (with line numbers if) -comment(// supplied\). Groovy pretties up stacktraces to show less noise. You can use -d) -comment(// or --debug on the commandline to force it to always produce full stacktraces.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.13) -comment(//----------------------------------------------------------------------------------) -comment(// already have log10, how to create log11 to log100) -operator(()integer(11)operator(..)integer(100)operator(\))operator(.)ident(each) operator({) type(int) ident(base) operator(->) - ident(binding)operator(.)stringdelimiter(")> operator(=) operator({) type(int) ident(n) operator(->) pre_type(Math)operator(.)ident(log)operator(()ident(n)operator(\)) operator(/) pre_type(Math)operator(.)ident(log)operator(()ident(base)operator(\)) operator(}) -operator(}) -ident(println) ident(log20)operator(()integer(400)operator(\)) comment(// => 2.0) -ident(println) ident(log100)operator(()integer(1000000)operator(\)) comment(// => 3.0 (displays 2.9999999999999996 using doubles\)) - -comment(// same thing again use currying) -keyword(def) ident(logAnyBase) operator(=) operator({) ident(base)operator(,) ident(n) operator(->) pre_type(Math)operator(.)ident(log)operator(()ident(n)operator(\)) operator(/) pre_type(Math)operator(.)ident(log)operator(()ident(base)operator(\)) operator(}) -operator(()integer(11)operator(..)integer(100)operator(\))operator(.)ident(each) operator({) type(int) ident(base) operator(->) - ident(binding)operator(.)stringdelimiter(")> operator(=) ident(logAnyBase)operator(.)ident(curry)operator(()ident(base)operator(\)) -operator(}) -ident(println) ident(log20)operator(()integer(400)operator(\)) comment(// => 2.0) -ident(println) ident(log100)operator(()integer(1000000)operator(\)) comment(// => 3.0 (displays 2.9999999999999996 using doubles\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.14) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy intefaces with C in the same way as Java: using JNI) -comment(// For this discussion we will ignoring platform specific options and CORBA.) -comment(// This tutorial here describes how to allow Java (and hence Groovy\) to) -comment(// call a C program which generates UUIDs:) -comment(// http://ringlord.com/publications/jni-howto/) -comment(// Here's another useful reference:) -comment(// http://weblogs.java.net/blog/kellyohair/archive/2006/01/compilation_of_1.html) -comment(// And of course, Sun's tutorial:) -comment(// http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html) - -comment(// You might also want to consider SWIG which simplifies connecting) -comment(// C/C++ to many scripting languages including Java (and hence Groovy\)) -comment(// More details: http://www.swig.org/) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.15) -comment(//----------------------------------------------------------------------------------) -comment(// See discussion for 12.14) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.16) -comment(//----------------------------------------------------------------------------------) -comment(// The standard documentation system for Java is JavaDoc.) -comment(// Documentation for JavaDoc is part of a Java installation.) -comment(// Groovy has a GroovyDoc tool planned which expands upon the JavaDoc tool) -comment(// but work on the tool hasn't progressed much as yet.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.17) -comment(//----------------------------------------------------------------------------------) -comment(// Most libraries for Java (and hence Groovy\) come precompiled. You simply download) -comment(// the jar and place it somewhere on your CLASSPATH.) - -comment(// If only source code is available, you need to download the source and follow any) -comment(// instuctions which came with the source. Most projects use one of a handful of) -comment(// build tools to compile, test and package their artifacts. Typical ones are Ant) -comment(// and Maven which you need to install according to their respective instructions.) - -comment(// If using Ant, you need to unpack the source files then type 'ant'.) - -comment(// If using Maven, you need to unpack the source files then type 'maven'.) - -comment(// If you are using Maven or Ivy for dependency management you can add) -comment(// the following lines to your project description file.) -comment(/* - - commons-collections - commons-collections - 3.2 - -*/) -comment(// This will automatically download the particular version of the referenced) -comment(// library file and also provide hooks so that you can make this automatically) -comment(// available in your classpath.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.18) -comment(//----------------------------------------------------------------------------------) -comment(// example groovy file for a "module") -keyword(import) include(org.apache.commons.lang.WordUtils) - -type(class) class(Greeter) operator({) - keyword(def) ident(name) - ident(Greeter)operator(()ident(who)operator(\)) operator({) ident(name) operator(=) ident(WordUtils)operator(.)ident(capitalize)operator(()ident(who)operator(\)) operator(}) - keyword(def) method(salute)operator(()operator(\)) operator({) stringcontent(!)delimiter(")> operator(}) -operator(}) - -comment(// test class) -type(class) class(GreeterTest) directive(extends) ident(GroovyTestCase) operator({) - keyword(def) method(testGreeting)operator(()operator(\)) operator({) - keyword(assert) keyword(new) ident(Greeter)operator(()stringoperator(\))operator(.)ident(salute)operator(()operator(\)) - operator(}) -operator(}) - -comment(// Typical Ant build file (could be in Groovy instead of XML\):) -comment(/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/) - -comment(// Typical dependency management file) -comment(/* - - - 4.0.0 - groovy - module - Greeter - 1.0 - jar - Greeter Module/description> - - - commons-lang - commons-lang - 2.2 - - - -*/) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_12.19) -comment(//----------------------------------------------------------------------------------) -comment(// Searching available modules in repositories:) -comment(// You can browse the repositories online, e.g. ibiblio.org/maven2 or various) -comment(// plugins are available for IDEs which do this for you, e.g. JarJuggler for IntelliJ.) - -comment(// Searching currently "installed" modules:) -comment(// Browse your install directory, view your maven POM file, look in your ~/.groovy/lib) -comment(// directory, turn on debug modes and watch classloader messages ...) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.0) -comment(//----------------------------------------------------------------------------------) -comment(// Classes and objects in Groovy are rather straigthforward) -type(class) class(Person) operator({) - comment(// Class variables (also called static attributes\) are prefixed by the keyword static) - directive(static) ident(personCounter)operator(=)integer(0) - keyword(def) ident(age)operator(,) ident(name) comment(// this creates setter and getter methods) - directive(private) ident(alive) - - comment(// object constructor) - ident(Person)operator(()ident(age)operator(,) ident(name)operator(,) ident(alive) operator(=) pre_constant(true)operator(\)) operator({) comment(// Default arg like in C++) - local_variable(this)operator(.)ident(age) operator(=) ident(age) - local_variable(this)operator(.)ident(name) operator(=) ident(name) - local_variable(this)operator(.)ident(alive) operator(=) ident(alive) - ident(personCounter) operator(+=) integer(1) - comment(// There is a '++' operator in Groovy but using += is often clearer.) - operator(}) - - keyword(def) method(die)operator(()operator(\)) operator({) - ident(alive) operator(=) pre_constant(false) - ident(println) stringcontent( has died at the age of )inlinecontent(.)delimiter(")> - ident(alive) - operator(}) - - keyword(def) method(kill)operator(()ident(anotherPerson)operator(\)) operator({) - ident(println) stringcontent( is killing )inlinecontent(.name.)delimiter(")> - ident(anotherPerson)operator(.)ident(die)operator(()operator(\)) - operator(}) - - comment(// methods used as queries generally start with is, are, will or can) - comment(// usually have the '?' suffix) - keyword(def) method(isStillAlive)operator(()operator(\)) operator({) - ident(alive) - operator(}) - - keyword(def) method(getYearOfBirth)operator(()operator(\)) operator({) - keyword(new) pre_type(Date)operator(()operator(\))operator(.)ident(year) operator(-) ident(age) - operator(}) - - comment(// Class method (also called static method\)) - directive(static) ident(getNumberOfPeople)operator(()operator(\)) operator({) comment(// accessors often start with get) - comment(// in which case you can call it like) - comment(// it was a field (without the get\)) - ident(personCounter) - operator(}) -operator(}) - -comment(// Using the class:) -comment(// Create objects of class Person) -ident(lecter) operator(=) keyword(new) ident(Person)operator(()integer(47)operator(,) stringoperator(\)) -ident(starling) operator(=) keyword(new) ident(Person)operator(()integer(29)operator(,) stringoperator(,) pre_constant(true)operator(\)) -ident(pazzi) operator(=) keyword(new) ident(Person)operator(()integer(40)operator(,) stringoperator(,) pre_constant(true)operator(\)) - -comment(// Calling a class method) -ident(println) stringcontent(.numberOfPeople Person objects.)delimiter(")> - -ident(println) stringcontent(.name is )inline operator(:) stringinline_delimiter(})>content(.)delimiter(")> -ident(lecter)operator(.)ident(kill)operator(()ident(pazzi)operator(\)) -ident(println) stringcontent(.name is )inline operator(:) stringinline_delimiter(})>content(.)delimiter(")> - -ident(println) stringcontent(.name was born in )inlinecontent(.yearOfBirth.)delimiter(")> -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.1) -comment(//----------------------------------------------------------------------------------) -comment(// Classes may have no constructor.) -type(class) class(MyClass) operator({) operator(}) - -ident(aValidButNotVeryUsefulObject) operator(=) keyword(new) ident(MyClass)operator(()operator(\)) - -comment(// If no explicit constructor is given a default implicit) -comment(// one which supports named parameters is provided.) -type(class) class(MyClass2) operator({) - keyword(def) ident(start) operator(=) keyword(new) pre_type(Date)operator(()operator(\)) - keyword(def) ident(age) operator(=) integer(0) -operator(}) -ident(println) keyword(new) ident(MyClass2)operator(()key(age)operator(:)integer(4)operator(\))operator(.)ident(age) comment(// => 4) - -comment(// One or more explicit constructors may also be provided) -type(class) class(MyClass3) operator({) - keyword(def) ident(start) - keyword(def) ident(age) - ident(MyClass3)operator(()ident(date)operator(,) ident(age)operator(\)) operator({) - ident(start) operator(=) ident(date) - local_variable(this)operator(.)ident(age) operator(=) ident(age) - operator(}) -operator(}) -ident(println) keyword(new) ident(MyClass3)operator(()keyword(new) pre_type(Date)operator(()operator(\))operator(,) integer(20)operator(\))operator(.)ident(age) comment(// => 20) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.2) -comment(//----------------------------------------------------------------------------------) -comment(// Objects are destroyed by the JVM garbage collector.) -comment(// The time of destroying is not predicated but left up to the JVM.) -comment(// There is no direct support for destructor. There is a courtesy) -comment(// method called finalize(\) which the JVM may call when disposing) -comment(// an object. If you need to free resources for an object, like) -comment(// closing a socket or killing a spawned subprocess, you should do) -comment(// it explicitly - perhaps by supporting your own lifecycle methods) -comment(// on your class, e.g. close(\).) - -type(class) class(MyClass4)operator({) - type(void) ident(finalize)operator(()operator(\)) operator({) - ident(println) stringcontent(] is dying at )inlinedelimiter(")> - operator(}) -operator(}) - -comment(// test code) -integer(50)operator(.)ident(times) operator({) - keyword(new) ident(MyClass4)operator(()operator(\)) -operator(}) -integer(20)operator(.)ident(times) operator({) - pre_type(System)operator(.)ident(gc)operator(()operator(\)) -operator(}) -comment(// => (between 0 and 50 lines similar to below\)) -comment(// Object [internal id=10884088] is dying at Wed Jan 10 16:33:33 EST 2007) -comment(// Object [internal id=6131844] is dying at Wed Jan 10 16:33:33 EST 2007) -comment(// Object [internal id=12245160] is dying at Wed Jan 10 16:33:33 EST 2007) -comment(// ...) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.3) -comment(//----------------------------------------------------------------------------------) -comment(// You can write getter and setter methods explicitly as shown below.) -comment(// One convention is to use set and get at the start of method names.) -type(class) class(Person2) operator({) - directive(private) ident(name) - keyword(def) method(getName)operator(()operator(\)) operator({) ident(name) operator(}) - keyword(def) method(setName)operator(()ident(name)operator(\)) operator({) local_variable(this)operator(.)ident(name) operator(=) ident(name) operator(}) -operator(}) - -comment(// You can also just use def which auto defines default getters and setters.) -type(class) class(Person3) operator({) - keyword(def) ident(age)operator(,) ident(name) -operator(}) - -comment(// Any variables marked as final will only have a default getter.) -comment(// You can also write an explicit getter. For a write-only variable) -comment(// just write only a setter.) -type(class) class(Person4) operator({) - directive(final) ident(age) comment(// getter only) - keyword(def) ident(name) comment(// getter and setter) - directive(private) ident(color) comment(// private) - keyword(def) method(setColor)operator(()operator(\)) operator({) local_variable(this)operator(.)ident(color) operator(=) ident(color) operator(}) comment(// setter only) -operator(}) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.4) -comment(//----------------------------------------------------------------------------------) -type(class) class(Person5) operator({) - comment(// Class variables (also called static attributes\) are prefixed by the keyword static) - directive(static) ident(personCounter) operator(=) integer(0) - - directive(static) ident(getPopulation)operator(()operator(\)) operator({) - ident(personCounter) - operator(}) - ident(Person5)operator(()operator(\)) operator({) - ident(personCounter) operator(+=) integer(1) - operator(}) - type(void) ident(finalize)operator(()operator(\)) operator({) - ident(personCounter) operator(-=) integer(1) - operator(}) -operator(}) -ident(people) operator(=) type([]) -integer(10)operator(.)ident(times) operator({) - ident(people) operator(+=) keyword(new) ident(Person5)operator(()operator(\)) -operator(}) -ident(println) stringcontent( people alive)delimiter(")> -comment(// => There are 10 people alive) - -ident(alpha) operator(=) keyword(new) ident(FixedArray)operator(()operator(\)) -ident(println) stringcontent(.maxBounds)delimiter(")> - -ident(beta) operator(=) keyword(new) ident(FixedArray)operator(()operator(\)) -ident(beta)operator(.)ident(maxBounds) operator(=) integer(50) -ident(println) stringcontent(.maxBounds)delimiter(")> - -type(class) class(FixedArray) operator({) - directive(static) ident(maxBounds) operator(=) integer(100) - - keyword(def) method(getMaxBounds)operator(()operator(\)) operator({) - ident(maxBounds) - operator(}) - keyword(def) method(setMaxBounds)operator(()ident(value)operator(\)) operator({) - ident(maxBounds) operator(=) ident(value) - operator(}) -operator(}) -comment(// =>) -comment(// Bound on alpha is 100) -comment(// Bound on alpha is 50) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.5) -comment(//----------------------------------------------------------------------------------) -comment(// The fields of this struct-like class are dynamically typed) -type(class) class(DynamicPerson) operator({) keyword(def) ident(name)operator(,) ident(age)operator(,) ident(peers) operator(}) -ident(p) operator(=) keyword(new) ident(DynamicPerson)operator(()operator(\)) -ident(p)operator(.)ident(name) operator(=) string -ident(p)operator(.)ident(age) operator(=) integer(13) -ident(p)operator(.)ident(peers) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) -ident(p)operator(.)ident(setPeers)operator(()operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(\)) comment(// alternative using implicit setter) -ident(p)operator([)stringoperator(]) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) comment(// alternative access using name of field) -ident(println) stringcontent(.age, )inlinecontent(.name's first friend is )inlinedelimiter(")> -comment(// => At age 13, Jason Smythe's first friend is Wilbur) - -comment(// The fields of this struct-like class are statically typed) -type(class) class(StaticPerson) operator({) pre_type(String) ident(name)operator(;) type(int) ident(age)operator(;) pre_type(List) ident(peers) operator(}) -ident(p) operator(=) keyword(new) ident(StaticPerson)operator(()key(name)operator(:)stringoperator(,) key(age)operator(:)integer(14)operator(,) key(peers)operator(:)operator([)stringoperator(,)stringoperator(,)stringoperator(])operator(\)) -ident(println) stringcontent(.age, )inlinecontent(.name's first friend is )inlinedelimiter(")> -comment(// => At age 14, Jason's first friend is Fred) - - -type(class) class(Family) operator({) keyword(def) ident(head)operator(,) ident(address)operator(,) ident(members) operator(}) -ident(folks) operator(=) keyword(new) ident(Family)operator(()key(head)operator(:)keyword(new) ident(DynamicPerson)operator(()key(name)operator(:)stringoperator(,)key(age)operator(:)integer(34)operator(\))operator(\)) - -comment(// supply of own accessor method for the struct for error checking) -type(class) class(ValidatingPerson) operator({) - directive(private) ident(age) - keyword(def) method(printAge)operator(()operator(\)) operator({) ident(println) string operator(+) ident(age) operator(}) - keyword(def) method(setAge)operator(()ident(value)operator(\)) operator({) - keyword(if) operator(()operator(!)operator(()ident(value) keyword(instanceof) pre_type(Integer)operator(\))operator(\)) - keyword(throw) keyword(new) exception(IllegalArgumentException)operator(()stringcontent(' isn't an Integer)delimiter(")>operator(\)) - keyword(if) operator(()ident(value) operator(>) integer(150)operator(\)) - keyword(throw) keyword(new) exception(IllegalArgumentException)operator(()stringcontent( is unreasonable)delimiter(")>operator(\)) - ident(age) operator(=) ident(value) - operator(}) -operator(}) - -comment(// test ValidatingPerson) -keyword(def) method(tryCreate)operator(()ident(arg)operator(\)) operator({) - keyword(try) operator({) - keyword(new) ident(ValidatingPerson)operator(()key(age)operator(:)ident(arg)operator(\))operator(.)ident(printAge)operator(()operator(\)) - operator(}) keyword(catch) operator(()exception(Exception) ident(ex)operator(\)) operator({) - ident(println) ident(ex)operator(.)ident(message) - operator(}) -operator(}) - -ident(tryCreate)operator(()integer(20)operator(\)) -ident(tryCreate)operator(()stringoperator(\)) -ident(tryCreate)operator(()integer(200)operator(\)) -comment(// =>) -comment(// Age=20) -comment(// Argument 'Youngish' isn't an Integer) -comment(// Age 200 is unreasonable) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.6) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy objects are (loosely speaking\) extended Java objects.) -comment(// Java's Object class provides a clone(\) method. The conventions of) -comment(// clone(\) are that if I say a = b.clone(\) then a and b should be) -comment(// different objects with the same type and value. Java doesn't) -comment(// enforce a class to implement a clone(\) method at all let alone) -comment(// require that one has to meet these conventions. Classes which) -comment(// do support clone(\) should implement the Cloneable interface and) -comment(// implement an equals(\) method.) -comment(// Groovy follows Java's conventions for clone(\).) - -type(class) class(A) directive(implements) pre_type(Cloneable) operator({) - keyword(def) ident(name) - type(boolean) ident(equals)operator(()pre_type(Object) ident(other)operator(\)) operator({) - ident(other) keyword(instanceof) ident(A) operator(&&) local_variable(this)operator(.)ident(name) operator(==) ident(other)operator(.)ident(name) - operator(}) -operator(}) -ident(ob1) operator(=) keyword(new) ident(A)operator(()key(name)operator(:)stringoperator(\)) - -ident(ob2) operator(=) ident(ob1)operator(.)ident(clone)operator(()operator(\)) -keyword(assert) operator(!)ident(ob1)operator(.)ident(is)operator(()ident(ob2)operator(\)) -keyword(assert) ident(ob1)operator(.)ident(class) operator(==) ident(ob2)operator(.)ident(class) -keyword(assert) ident(ob2)operator(.)ident(name) operator(==) ident(ob1)operator(.)ident(name) -keyword(assert) ident(ob1) operator(==) ident(ob2) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.7) -comment(//----------------------------------------------------------------------------------) -type(class) class(CanFlicker) operator({) - keyword(def) method(flicker)operator(()ident(arg)operator(\)) operator({) keyword(return) ident(arg) operator(*) integer(2) operator(}) -operator(}) -ident(methname) operator(=) string -keyword(assert) keyword(new) ident(CanFlicker)operator(()operator(\))operator(.)ident(invokeMethod)operator(()ident(methname)operator(,) integer(10)operator(\)) operator(==) integer(20) -keyword(assert) keyword(new) ident(CanFlicker)operator(()operator(\))operator(.)stringdelimiter(")>operator(()integer(10)operator(\)) operator(==) integer(20) - -type(class) class(NumberEcho) operator({) - keyword(def) method(one)operator(()operator(\)) operator({) integer(1) operator(}) - keyword(def) method(two)operator(()operator(\)) operator({) integer(2) operator(}) - keyword(def) method(three)operator(()operator(\)) operator({) integer(3) operator(}) -operator(}) -ident(obj) operator(=) keyword(new) ident(NumberEcho)operator(()operator(\)) -comment(// call methods on the object, by name) -keyword(assert) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(.)ident(collect)operator({) ident(obj)operator(.)stringdelimiter(")>operator(()operator(\)) operator(})operator(.)ident(join)operator(()operator(\)) operator(==) string -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.8) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy can work with Groovy objects which inherit from a common base) -comment(// class called GroovyObject or Java objects which inherit from Object.) - -comment(// the class of the object) -keyword(assert) stringoperator(.)ident(class) operator(==) ident(java)operator(.)ident(lang)operator(.)ident(String) - -comment(// Groovy classes are actually objects of class Class and they) -comment(// respond to methods defined in the Class class as well) -keyword(assert) stringoperator(.)ident(class)operator(.)ident(class) operator(==) ident(java)operator(.)ident(lang)operator(.)ident(Class) -keyword(assert) operator(!)stringoperator(.)ident(class)operator(.)ident(isArray)operator(()operator(\)) - -comment(// ask an object whether it is an instance of particular class) -ident(n) operator(=) float(4.7f) -ident(println) operator(()ident(n) keyword(instanceof) pre_type(Integer)operator(\)) comment(// false) -ident(println) operator(()ident(n) keyword(instanceof) pre_type(Float)operator(\)) comment(// true) -ident(println) operator(()ident(n) keyword(instanceof) pre_type(Double)operator(\)) comment(// false) -ident(println) operator(()ident(n) keyword(instanceof) pre_type(String)operator(\)) comment(// false) -ident(println) operator(()ident(n) keyword(instanceof) ident(StaticPerson)operator(\)) comment(// false) - -comment(// ask if a class or interface is either the same as, or is a) -comment(// superclass or superinterface of another class) -ident(println) ident(n)operator(.)ident(class)operator(.)ident(isAssignableFrom)operator(()pre_type(Float)operator(.)ident(class)operator(\)) comment(// true) -ident(println) ident(n)operator(.)ident(class)operator(.)ident(isAssignableFrom)operator(()pre_type(String)operator(.)ident(class)operator(\)) comment(// false) - -comment(// can a Groovy object respond to a particular method?) -keyword(assert) keyword(new) ident(CanFlicker)operator(()operator(\))operator(.)ident(metaClass)operator(.)ident(methods)operator(*.)ident(name)operator(.)ident(contains)operator(()stringoperator(\)) - -type(class) class(POGO)operator({)operator(}) -ident(println) operator(()ident(obj)operator(.)ident(metaClass)operator(.)ident(methods)operator(*.)ident(name) operator(-) keyword(new) ident(POGO)operator(()operator(\))operator(.)ident(metaClass)operator(.)ident(methods)operator(*.)ident(name)operator(\)) -comment(// => ["one", "two", "three"]) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.9) -comment(//----------------------------------------------------------------------------------) -comment(// Most classes in Groovy are inheritable) -type(class) class(Person6)operator({) keyword(def) ident(age)operator(,) ident(name) operator(}) -ident(dude) operator(=) keyword(new) ident(Person6)operator(()key(name)operator(:)stringoperator(,) key(age)operator(:)integer(23)operator(\)) -ident(println) stringcontent(.name is age )inlinecontent(.age.)delimiter(")> - -comment(// Inheriting from Person) -type(class) class(Employee) directive(extends) ident(Person6) operator({) - keyword(def) ident(salary) -operator(}) -ident(empl) operator(=) keyword(new) ident(Employee)operator(()key(name)operator(:)stringoperator(,) key(age)operator(:)integer(23)operator(,) key(salary)operator(:)integer(200)operator(\)) -ident(println) stringcontent(.name is age )inlinecontent(.age and has salary )inlinecontent(.salary.)delimiter(")> - -comment(// Many built-in class can be inherited the same way) -type(class) class(WierdList) directive(extends) pre_type(ArrayList) operator({) - keyword(def) method(size)operator(()operator(\)) operator({) comment(// size method in this class is overridden) - local_variable(super)operator(.)ident(size)operator(()operator(\)) operator(*) integer(2) - operator(}) -operator(}) -ident(a) operator(=) keyword(new) ident(WierdList)operator(()operator(\)) -ident(a)operator(.)ident(add)operator(()stringoperator(\)) -ident(a)operator(.)ident(add)operator(()stringoperator(\)) -ident(println) ident(a)operator(.)ident(size)operator(()operator(\)) comment(// => 4) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.10) -comment(//----------------------------------------------------------------------------------) -type(class) class(Person7) operator({) keyword(def) ident(firstname)operator(,) ident(surname)operator(;) keyword(def) method(getName)operator(()operator(\))operator({) ident(firstname) operator(+) string operator(+) ident(surname) operator(}) operator(}) -type(class) class(Employee2) directive(extends) ident(Person7) operator({) - keyword(def) ident(employeeId) - keyword(def) method(getName)operator(()operator(\))operator({) string operator(+) ident(employeeId) operator(}) - keyword(def) method(getRealName)operator(()operator(\))operator({) local_variable(super)operator(.)ident(getName)operator(()operator(\)) operator(}) -operator(}) -ident(p) operator(=) keyword(new) ident(Person7)operator(()key(firstname)operator(:)stringoperator(,) key(surname)operator(:)stringoperator(\)) -ident(println) ident(p)operator(.)ident(name) -comment(// =>) -comment(// Jason Smythe) -ident(e) operator(=) keyword(new) ident(Employee2)operator(()key(firstname)operator(:)stringoperator(,) key(surname)operator(:)stringoperator(,) key(employeeId)operator(:)integer(12349876)operator(\)) -ident(println) ident(e)operator(.)ident(name) -ident(println) ident(e)operator(.)ident(realName) -comment(// =>) -comment(// Employee Number 12349876) -comment(// Jason Smythe) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.11) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy's built in constructor and auto getter/setter features) - comment(// give you the required functionalty already but you could also) - comment(// override invokeMethod(\) for trickier scenarios.) -type(class) class(Person8) operator({) - keyword(def) ident(name)operator(,) ident(age)operator(,) ident(peers)operator(,) ident(parent) - keyword(def) method(newChild)operator(()ident(args)operator(\)) operator({) keyword(new) ident(Person8)operator(()key(parent)operator(:)local_variable(this)operator(,) operator(*)operator(:)ident(args)operator(\)) operator(}) -operator(}) - -ident(dad) operator(=) keyword(new) ident(Person8)operator(()key(name)operator(:)stringoperator(,) key(age)operator(:)integer(23)operator(\)) -ident(kid) operator(=) ident(dad)operator(.)ident(newChild)operator(()key(name)operator(:)stringoperator(,) key(age)operator(:)integer(2)operator(\)) -ident(println) stringdelimiter(")> -comment(// => Kid's parent is Jason) - -comment(// additional fields ...) -type(class) class(Employee3) directive(extends) ident(Person8) operator({) keyword(def) ident(salary)operator(,) ident(boss) operator(}) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.12) -comment(//----------------------------------------------------------------------------------) -comment(// Fields marked as private in Groovy can't be trampled by another class in) -comment(// the class hierarchy) -type(class) class(Parent) operator({) - directive(private) ident(name) comment(// my child's name) - keyword(def) method(setChildName)operator(()ident(value)operator(\)) operator({) ident(name) operator(=) ident(value) operator(}) - keyword(def) method(getChildName)operator(()operator(\)) operator({) ident(name) operator(}) -operator(}) -type(class) class(GrandParent) directive(extends) ident(Parent) operator({) - directive(private) ident(name) comment(// my grandchild's name) - keyword(def) method(setgrandChildName)operator(()ident(value)operator(\)) operator({) ident(name) operator(=) ident(value) operator(}) - keyword(def) method(getGrandChildName)operator(()operator(\)) operator({) ident(name) operator(}) -operator(}) -ident(g) operator(=) keyword(new) ident(GrandParent)operator(()operator(\)) -ident(g)operator(.)ident(childName) operator(=) string -ident(g)operator(.)ident(grandChildName) operator(=) string -ident(println) ident(g)operator(.)ident(childName) comment(// => Jason) -ident(println) ident(g)operator(.)ident(grandChildName) comment(// => Rachel) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.13) -comment(//----------------------------------------------------------------------------------) -comment(// The JVM garbage collector copes with circular structures.) -comment(// You can test it with this code:) -type(class) class(Person9) operator({) - keyword(def) ident(friend) - type(void) ident(finalize)operator(()operator(\)) operator({) - ident(println) stringcontent(] is dying at )inlinedelimiter(")> - operator(}) -operator(}) - -keyword(def) method(makeSomeFriends)operator(()operator(\)) operator({) - keyword(def) ident(first) operator(=) keyword(new) ident(Person9)operator(()operator(\)) - keyword(def) ident(second) operator(=) keyword(new) ident(Person9)operator(()key(friend)operator(:)ident(first)operator(\)) - keyword(def) ident(third) operator(=) keyword(new) ident(Person9)operator(()key(friend)operator(:)ident(second)operator(\)) - keyword(def) ident(fourth) operator(=) keyword(new) ident(Person9)operator(()key(friend)operator(:)ident(third)operator(\)) - keyword(def) ident(fifth) operator(=) keyword(new) ident(Person9)operator(()key(friend)operator(:)ident(fourth)operator(\)) - ident(first)operator(.)ident(friend) operator(=) ident(fifth) -operator(}) - -ident(makeSomeFriends)operator(()operator(\)) -integer(100)operator(.)ident(times)operator({) - pre_type(System)operator(.)ident(gc)operator(()operator(\)) -operator(}) -comment(// =>) -comment(// Object [internal id=24478976] is dying at Tue Jan 09 22:24:31 EST 2007) -comment(// Object [internal id=32853087] is dying at Tue Jan 09 22:24:31 EST 2007) -comment(// Object [internal id=23664622] is dying at Tue Jan 09 22:24:31 EST 2007) -comment(// Object [internal id=10630672] is dying at Tue Jan 09 22:24:31 EST 2007) -comment(// Object [internal id=25921812] is dying at Tue Jan 09 22:24:31 EST 2007) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.14) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy provides numerous methods which are automatically associated with) -comment(// symbol operators, e.g. here is '<=>' which is associated with compareTo(\)) -comment(// Suppose we have a class with a compareTo operator, such as:) -type(class) class(Person10) directive(implements) pre_type(Comparable) operator({) - keyword(def) ident(firstname)operator(,) ident(initial)operator(,) ident(surname) - ident(Person10)operator(()ident(f)operator(,)ident(i)operator(,)ident(s)operator(\)) operator({) ident(firstname) operator(=) ident(f)operator(;) ident(initial) operator(=) ident(i)operator(;) ident(surname) operator(=) ident(s) operator(}) - type(int) ident(compareTo)operator(()ident(other)operator(\)) operator({) ident(firstname) operator(<=>) ident(other)operator(.)ident(firstname) operator(}) -operator(}) -ident(a) operator(=) keyword(new) ident(Person10)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) -ident(b) operator(=) keyword(new) ident(Person10)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) -ident(println) ident(a) operator(<=>) ident(b) -comment(// => -1) - -comment(// we can override the existing Person10's <=> operator as below) -comment(// so that now comparisons are made using the middle initial) -comment(// instead of the fisrtname:) -type(class) class(Person11) directive(extends) ident(Person10) operator({) - ident(Person11)operator(()ident(f)operator(,)ident(i)operator(,)ident(s)operator(\)) operator({) local_variable(super)operator(()ident(f)operator(,)ident(i)operator(,)ident(s)operator(\)) operator(}) - type(int) ident(compareTo)operator(()ident(other)operator(\)) operator({) ident(initial) operator(<=>) ident(other)operator(.)ident(initial) operator(}) -operator(}) - -ident(a) operator(=) keyword(new) ident(Person11)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) -ident(b) operator(=) keyword(new) ident(Person11)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) -ident(println) ident(a) operator(<=>) ident(b) -comment(// => 1) - -comment(// we could also in general use Groovy's categories to extend class functionality.) - -comment(// There is no way to directly overload the '""' (stringify\)) -comment(// operator in Groovy. However, by convention, classes which) -comment(// can reasonably be converted to a String will define a) -comment(// 'toString(\)' method as in the TimeNumber class defined below.) -comment(// The 'println' method will automatcally call an object's) -comment(// 'toString(\)' method as is demonstrated below. Furthermore,) -comment(// an object of that class can be used most any place where the) -comment(// interpreter is looking for a String value.) - -comment(//---------------------------------------) -comment(// NOTE: Groovy has various built-in Time/Date/Calendar classes) -comment(// which would usually be used to manipulate time objects, the) -comment(// following is supplied for educational purposes to demonstrate) -comment(// operator overloading.) -type(class) class(TimeNumber) operator({) - keyword(def) ident(h)operator(,) ident(m)operator(,) ident(s) - ident(TimeNumber)operator(()ident(hour)operator(,) ident(min)operator(,) ident(sec)operator(\)) operator({) ident(h) operator(=) ident(hour)operator(;) ident(m) operator(=) ident(min)operator(;) ident(s) operator(=) ident(sec) operator(}) - - keyword(def) method(toDigits)operator(()ident(s)operator(\)) operator({) ident(s)operator(.)ident(toString)operator(()operator(\))operator(.)ident(padLeft)operator(()integer(2)operator(,) stringoperator(\)) operator(}) - pre_type(String) ident(toString)operator(()operator(\)) operator({) - keyword(return) ident(toDigits)operator(()ident(h)operator(\)) operator(+) string operator(+) ident(toDigits)operator(()ident(m)operator(\)) operator(+) string operator(+) ident(toDigits)operator(()ident(s)operator(\)) - operator(}) - - keyword(def) method(plus)operator(()ident(other)operator(\)) operator({) - ident(s) operator(=) ident(s) operator(+) ident(other)operator(.)ident(s) - ident(m) operator(=) ident(m) operator(+) ident(other)operator(.)ident(m) - ident(h) operator(=) ident(h) operator(+) ident(other)operator(.)ident(h) - keyword(if) operator(()ident(s) operator(>=) integer(60)operator(\)) operator({) - ident(s) operator(%=) integer(60) - ident(m) operator(+=) integer(1) - operator(}) - keyword(if) operator(()ident(m) operator(>=) integer(60)operator(\)) operator({) - ident(m) operator(%=) integer(60) - ident(h) operator(+=) integer(1) - operator(}) - keyword(return) keyword(new) ident(TimeNumber)operator(()ident(h)operator(,) ident(m)operator(,) ident(s)operator(\)) - operator(}) - -operator(}) - -ident(t1) operator(=) keyword(new) ident(TimeNumber)operator(()integer(0)operator(,) integer(58)operator(,) integer(59)operator(\)) -ident(sec) operator(=) keyword(new) ident(TimeNumber)operator(()integer(0)operator(,) integer(0)operator(,) integer(1)operator(\)) -ident(min) operator(=) keyword(new) ident(TimeNumber)operator(()integer(0)operator(,) integer(1)operator(,) integer(0)operator(\)) -ident(println) ident(t1) operator(+) ident(sec) operator(+) ident(min) operator(+) ident(min) - -comment(//-----------------------------) -comment(// StrNum class example: Groovy's builtin String class already has the) -comment(// capabilities outlined in StrNum Perl example, however the '*' operator) -comment(// on Groovy's String class acts differently: It creates a string which) -comment(// is the original string repeated N times.) -comment(//) -comment(// Using Groovy's String class as is in this example:) -ident(x) operator(=) stringoperator(;) ident(y) operator(=) string -ident(z) operator(=) ident(x)operator(+)ident(y) -ident(r) operator(=) ident(z)operator(*)integer(3) comment(// r is "RedBlackRedBlackRedBlack") -ident(println) stringcontent(, )inlinecontent(, )inlinecontent(, and )inlinedelimiter(")> -ident(println) stringcontent( is )inline operator(:) stringinline_delimiter(})>content( )inlinedelimiter(")> -comment(// prints:) -comment(// values are Red, Black, RedBlack, and RedBlackRedBlackRedBlack) -comment(// Red is GE Black) - -comment(//-----------------------------) -type(class) class(FixNum) operator({) - keyword(def) ident(REGEX) operator(=) regexp - directive(static) directive(final) ident(DEFAULT_PLACES) operator(=) integer(0) - keyword(def) type(float) ident(value) - keyword(def) type(int) ident(places) - ident(FixNum)operator(()ident(value)operator(\)) operator({) - ident(initValue)operator(()ident(value)operator(\)) - keyword(def) ident(m) operator(=) ident(value)operator(.)ident(toString)operator(()operator(\)) operator(=~) ident(REGEX) - keyword(if) operator(()ident(m)operator(\)) ident(places) operator(=) ident(m)operator([)integer(0)operator(])operator([)integer(1)operator(])operator(.)ident(size)operator(()operator(\)) operator(-) integer(1) - keyword(else) ident(places) operator(=) ident(DEFAULT_PLACES) - operator(}) - ident(FixNum)operator(()ident(value)operator(,) ident(places)operator(\)) operator({) - ident(initValue)operator(()ident(value)operator(\)) - local_variable(this)operator(.)ident(places) operator(=) ident(places) - operator(}) - directive(private) ident(initValue)operator(()ident(value)operator(\)) operator({) - local_variable(this)operator(.)ident(value) operator(=) ident(value) - operator(}) - - keyword(def) method(plus)operator(()ident(other)operator(\)) operator({) - keyword(new) ident(FixNum)operator(()ident(value) operator(+) ident(other)operator(.)ident(value)operator(,) operator([)ident(places)operator(,) ident(other)operator(.)ident(places)operator(])operator(.)ident(max)operator(()operator(\))operator(\)) - operator(}) - - keyword(def) method(multiply)operator(()ident(other)operator(\)) operator({) - keyword(new) ident(FixNum)operator(()ident(value) operator(*) ident(other)operator(.)ident(value)operator(,) operator([)ident(places)operator(,) ident(other)operator(.)ident(places)operator(])operator(.)ident(max)operator(()operator(\))operator(\)) - operator(}) - - keyword(def) method(div)operator(()ident(other)operator(\)) operator({) - ident(println) stringdelimiter(")> - keyword(def) ident(result) operator(=) keyword(new) ident(FixNum)operator(()ident(value)operator(/)ident(other)operator(.)ident(value)operator(\)) - ident(result)operator(.)ident(places) operator(=) operator([)ident(places)operator(,)ident(other)operator(.)ident(places)operator(])operator(.)ident(max)operator(()operator(\)) - ident(result) - operator(}) - - pre_type(String) ident(toString)operator(()operator(\)) operator({) - comment(//m = value.toString(\) =~ /(\\d\)/ + REGEX) - pre_type(String)operator(.)ident(format)operator(()stringcontent(f)delimiter(")>operator(,) operator([)local_variable(this)operator(.)ident(class)operator(.)ident(name)operator(,) ident(value) keyword(as) type(float)operator(]) keyword(as) pre_type(Object)type([])operator(\)) - operator(}) -operator(}) - -ident(x) operator(=) keyword(new) ident(FixNum)operator(()integer(40)operator(\)) -ident(y) operator(=) keyword(new) ident(FixNum)operator(()integer(12)operator(,) integer(0)operator(\)) - -ident(println) stringcontent( and )inlinecontent( is )inlinedelimiter(")> -ident(println) stringcontent( and )inlinecontent( is )inlinedelimiter(")> - -ident(z) operator(=) ident(x)operator(/)ident(y) -ident(println) stringcontent( has )inlinecontent(.places places)delimiter(")> -ident(z)operator(.)ident(places) operator(=) integer(2) -ident(println) stringcontent( now has )inlinecontent(.places places)delimiter(")> - -ident(println) stringcontent( by )inlinecontent( is )inlinedelimiter(")> -ident(println) stringdelimiter(")> -comment(// =>) -comment(// sum of STRFixNum: 40 and STRFixNum: 12 is STRFixNum: 52) -comment(// product of STRFixNum: 40 and STRFixNum: 12 is STRFixNum: 480) -comment(// DEUG: Divide = 3.3333333333333335) -comment(// STRFixNum: 3 has 0 places) -comment(// STRFixNum: 3.33 now has 2 places) -comment(// div of STRFixNum: 40 by STRFixNum: 12 is STRFixNum: 3.33) -comment(// square of that is STRFixNum: 11.11) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_13.15) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy doesn't use the tie terminology but you can achieve) -comment(// similar results with Groovy's metaprogramming facilities) -type(class) class(ValueRing) operator({) - directive(private) ident(values) - keyword(def) method(add)operator(()ident(value)operator(\)) operator({) ident(values)operator(.)ident(add)operator(()integer(0)operator(,) ident(value)operator(\)) operator(}) - keyword(def) method(next)operator(()operator(\)) operator({) - keyword(def) ident(head) operator(=) ident(values)operator([)integer(0)operator(]) - ident(values) operator(=) ident(values)operator([)integer(1)operator(..)operator(-)integer(1)operator(]) operator(+) ident(head) - keyword(return) ident(head) - operator(}) -operator(}) -ident(ring) operator(=) keyword(new) ident(ValueRing)operator(()key(values)operator(:)operator([)stringoperator(,) stringoperator(])operator(\)) -keyword(def) method(getColor)operator(()operator(\)) operator({) ident(ring)operator(.)ident(next)operator(()operator(\)) operator(}) -type(void) ident(setProperty)operator(()pre_type(String) ident(n)operator(,) ident(v)operator(\)) operator({) - keyword(if) operator(()ident(n) operator(==) stringoperator(\)) operator({) ident(ring)operator(.)ident(add)operator(()ident(v)operator(\))operator(;) keyword(return) operator(}) - local_variable(super)operator(.)ident(setProperty)operator(()ident(n)operator(,)ident(v)operator(\)) -operator(}) - -ident(println) stringcontent( )inlinecontent( )inlinecontent( )inlinecontent( )inlinecontent( )inlinedelimiter(")> -comment(// => red blue red blue red blue) - -ident(color) operator(=) string -ident(println) stringcontent( )inlinecontent( )inlinecontent( )inlinecontent( )inlinecontent( )inlinedelimiter(")> -comment(// => green red blue green red blue) - -comment(// Groovy doesn't have the $_ implicit variable so we can't show an) -comment(// example that gets rid of it. We can however show an example of how) -comment(// you could add in a simplified version of that facility into Groovy.) -comment(// We use Groovy's metaProgramming facilities. We execute our script) -comment(// in a new GroovyShell so that we don't affect subsequent examples.) -comment(// script:) -ident(x) operator(=) integer(3) -ident(println) stringdelimiter(")> -ident(y) operator(=) string operator(*) ident(x) -ident(println) stringdelimiter(")> - -comment(// metaUnderscore:) -type(void) ident(setProperty)operator(()pre_type(String) ident(n)operator(,) ident(v)operator(\)) operator({) - local_variable(super)operator(.)ident(setProperty)operator(()stringoperator(,)ident(v)operator(\)) - local_variable(super)operator(.)ident(setProperty)operator(()ident(n)operator(,)ident(v)operator(\)) -operator(}) - -keyword(new) ident(GroovyShell)operator(()operator(\))operator(.)ident(evaluate)operator(()ident(metaUnderscore) operator(+) ident(script)operator(\)) -comment(// =>) -comment(// 3) -comment(// catcatcat) - -comment(// We can get a little bit fancier by making an UnderscoreAware class) -comment(// that wraps up some of this functionality. This is not recommended) -comment(// as good Groovy style but mimicks the $_ behaviour in a sinple way.) -type(class) class(UnderscoreAware) directive(implements) ident(GroovyInterceptable) operator({) - directive(private) ident(_saved) - type(void) ident(setProperty)operator(()pre_type(String) ident(n)operator(,) ident(v)operator(\)) operator({) - ident(_saved) operator(=) ident(v) - local_variable(this)operator(.)ident(metaClass)operator(.)ident(setProperty)operator(()local_variable(this)operator(,) ident(n)operator(,) ident(v)operator(\)) - operator(}) - keyword(def) method(getProperty)operator(()pre_type(String) ident(n)operator(\)) operator({) - keyword(if) operator(()ident(n) operator(==) stringoperator(\)) keyword(return) ident(_saved) - local_variable(this)operator(.)ident(metaClass)operator(.)ident(getProperty)operator(()local_variable(this)operator(,) ident(n)operator(\)) - operator(}) - keyword(def) method(invokeMethod)operator(()pre_type(String) ident(name)operator(,) pre_type(Object) ident(args)operator(\)) operator({) - keyword(if) operator(()ident(name)operator(.)ident(startsWith)operator(()stringoperator(\)) operator(&&) ident(args)operator(.)ident(size)operator(()operator(\)) operator(==) integer(0)operator(\)) - ident(args) operator(=) operator([)ident(_saved)operator(]) keyword(as) pre_type(Object)type([]) - local_variable(this)operator(.)ident(metaClass)operator(.)ident(invokeMethod)operator(()local_variable(this)operator(,) ident(name)operator(,) ident(args)operator(\)) - operator(}) -operator(}) - -type(class) class(PerlishClass) directive(extends) ident(UnderscoreAware) operator({) - directive(private) ident(_age) - keyword(def) method(setAge)operator(()ident(age)operator(\))operator({) ident(_age) operator(=) ident(age) operator(}) - keyword(def) method(getAge)operator(()operator(\))operator({) ident(_age) operator(}) - keyword(def) method(test)operator(()operator(\)) operator({) - ident(age) operator(=) integer(25) - ident(println) stringdelimiter(")> comment(// explicit $_ supported) - ident(age)operator(++) - ident(println)operator(()operator(\)) comment(// implicit $_ will be injected) - operator(}) -operator(}) - -keyword(def) ident(x) operator(=) keyword(new) ident(PerlishClass)operator(()operator(\)) -ident(x)operator(.)ident(test)operator(()operator(\)) -comment(// =>) -comment(// 25) -comment(// 26) - -comment(// Autoappending hash:) -type(class) class(AutoMap) directive(extends) pre_type(HashMap) operator({) - type(void) ident(setProperty)operator(()pre_type(String) ident(name)operator(,) ident(v)operator(\)) operator({) - keyword(if) operator(()ident(containsKey)operator(()ident(name)operator(\))operator(\)) operator({) - ident(put)operator(()ident(name)operator(,) ident(get)operator(()ident(name)operator(\)) operator(+) ident(v)operator(\)) - operator(}) keyword(else) operator({) - ident(put)operator(()ident(name)operator(,) operator([)ident(v)operator(])operator(\)) - operator(}) - operator(}) -operator(}) -ident(m) operator(=) keyword(new) ident(AutoMap)operator(()operator(\)) -ident(m)operator(.)ident(beer) operator(=) string -ident(m)operator(.)ident(food) operator(=) string -ident(m)operator(.)ident(food) operator(=) string -ident(println) ident(m) -comment(// => ["food":["potatoes", "peas"], "beer":["guinness"]]) - -comment(// Case-Insensitive Hash:) -type(class) class(FoldedMap) directive(extends) pre_type(HashMap) operator({) - type(void) ident(setProperty)operator(()pre_type(String) ident(name)operator(,) ident(v)operator(\)) operator({) - ident(put)operator(()ident(name)operator(.)ident(toLowerCase)operator(()operator(\))operator(,) ident(v)operator(\)) - operator(}) - keyword(def) method(getProperty)operator(()pre_type(String) ident(name)operator(\)) operator({) - ident(get)operator(()ident(name)operator(.)ident(toLowerCase)operator(()operator(\))operator(\)) - operator(}) -operator(}) -ident(tab) operator(=) keyword(new) ident(FoldedMap)operator(()operator(\)) -ident(tab)operator(.)ident(VILLAIN) operator(=) string -ident(tab)operator(.)ident(herOine) operator(=) string -ident(tab)operator(.)ident(villain) operator(+=) string -ident(println) ident(tab) -comment(// => ["heroine":"red riding hood", "villain":"big bad wolf"]) - -comment(// Hash That "Allows Look-Ups by Key or Value":) -type(class) class(RevMap) directive(extends) pre_type(HashMap) operator({) - type(void) ident(setProperty)operator(()pre_type(String) ident(n)operator(,) ident(v)operator(\)) operator({) ident(put)operator(()ident(n)operator(,)ident(v)operator(\))operator(;) ident(put)operator(()ident(v)operator(,)ident(n)operator(\)) operator(}) - type(void) ident(remove)operator(()ident(n)operator(\)) operator({) local_variable(super)operator(.)ident(remove)operator(()ident(get)operator(()ident(n)operator(\))operator(\))operator(;) local_variable(super)operator(.)ident(remove)operator(()ident(n)operator(\)) operator(}) -operator(}) -ident(rev) operator(=) keyword(new) ident(RevMap)operator(()operator(\)) -ident(rev)operator(.)ident(Rojo) operator(=) string -ident(rev)operator(.)ident(Azul) operator(=) string -ident(rev)operator(.)ident(Verde) operator(=) string -ident(rev)operator(.)ident(EVIL) operator(=) operator([) stringoperator(,) string operator(]) -ident(rev)operator(.)ident(remove)operator(()stringoperator(\)) -ident(rev)operator(.)ident(remove)operator(()stringoperator(\)) -ident(println) ident(rev) -comment(// =>) -comment(// [["No way!", "Way!!"]:"EVIL", "EVIL":["No way!", "Way!!"], "Verde":"Green", "Green":"Verde"]) - -comment(// Infinite loop scenario:) -comment(// def x(n\) { x(++n\) }; x(0\)) -comment(// => Caught: java.lang.StackOverflowError) - -comment(// Multiple Strrams scenario:) -type(class) class(MultiStream) directive(extends) pre_type(PrintStream) operator({) - keyword(def) ident(streams) - ident(MultiStream)operator(()pre_type(List) ident(streams)operator(\)) operator({) - local_variable(super)operator(()ident(streams)operator([)integer(0)operator(])operator(\)) - local_variable(this)operator(.)ident(streams) operator(=) ident(streams) - operator(}) - keyword(def) method(println)operator(()pre_type(String) ident(x)operator(\)) operator({) - ident(streams)operator(.)ident(each)operator({) local_variable(it)operator(.)ident(println)operator(()ident(x)operator(\)) operator(}) - operator(}) -operator(}) -ident(tee) operator(=) keyword(new) ident(MultiStream)operator(()operator([)pre_type(System)operator(.)ident(out)operator(,) pre_type(System)operator(.)ident(err)operator(])operator(\)) -ident(tee)operator(.)ident(println) operator(()stringoperator(\)) -comment(// =>) -comment(// This goes two places) -comment(// This goes two places) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.0) -comment(//----------------------------------------------------------------------------------) -ident(As) ident(discussed) keyword(in) float(14.1)operator(,) ident(many) ident(database) ident(options) ident(exist)operator(,) ident(one) ident(of) ident(which) ident(is) ident(JDBC)operator(.) -ident(Over) integer(200) ident(JDBC) ident(drivers) ident(are) ident(listed) ident(at) ident(the) ident(following) pre_type(URL)operator(:) -key(http)operator(:)comment(//developers.sun.com/product/jdbc/drivers/browse_all.jsp) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.1) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy can make use of various Java persistence libraries and has special) -comment(// support built-in (e.g. datasets\) for interacting wth RDBMS systems.) -comment(// Some of the options include:) -comment(// object serialization (built in to Java\)) -comment(// pbeans: pbeans.sf.net) -comment(// prevayler: http://www.prevayler.org) -comment(// Berkeley DB Java edition: http://www.oracle.com/database/berkeley-db/je/) -comment(// JDBC: Over 200 drivers are listed at http://developers.sun.com/product/jdbc/drivers) -comment(// Datasets (special Groovy support\)) -comment(// XML via e.g. xstream or JAXB or XmlBeans or ...) -comment(// ORM: over 20 are listed at http://java-source.net/open-source/persistence) -comment(// JNI: can be used directly on a platform that supports e.g. DBM or via) -comment(// a cross platform API such as Apache APR which includes DBM routines:) -comment(// http://apr.apache.org/docs/apr-util/0.9/group__APR__Util__DBM.html) -comment(// jmork: used for Firefox/Thunderbird databases, e.g. address books, history files) -comment(// JDBC or Datasets would normally be most common for all examples in this chapter.) - - -comment(// Example shown using berkeley db Java edition - not quite as transparent as) -comment(// cookbook example as Berkeley DB Java addition makes transactions visible.) -keyword(import) include(com.sleepycat.je.*) -ident(tx) operator(=) pre_constant(null) -ident(envHome) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) - -ident(myEnvConfig) operator(=) keyword(new) ident(EnvironmentConfig)operator(()operator(\)) -ident(myEnvConfig)operator(.)ident(setAllowCreate)operator(()pre_constant(true)operator(\)) -ident(myEnv) operator(=) keyword(new) ident(Environment)operator(()ident(envHome)operator(,) ident(myEnvConfig)operator(\)) - -ident(myDbConfig) operator(=) keyword(new) ident(DatabaseConfig)operator(()operator(\)) -ident(myDbConfig)operator(.)ident(setAllowCreate)operator(()pre_constant(true)operator(\)) -ident(myDb) operator(=) ident(myEnv)operator(.)ident(openDatabase)operator(()ident(tx)operator(,) stringoperator(,) ident(myDbConfig)operator(\)) - -ident(theKey) operator(=) keyword(new) ident(DatabaseEntry)operator(()stringoperator(.)ident(getBytes)operator(()stringoperator(\))operator(\)) -ident(theData) operator(=) keyword(new) ident(DatabaseEntry)operator(()stringoperator(.)ident(getBytes)operator(()stringoperator(\))operator(\)) -ident(myDb)operator(.)ident(put)operator(()ident(tx)operator(,) ident(theKey)operator(,) ident(theData)operator(\)) -keyword(if) operator(()ident(myDb)operator(.)ident(get)operator(()ident(tx)operator(,) ident(theKey)operator(,) ident(theData)operator(,) ident(LockMode)operator(.)ident(DEFAULT)operator(\)) operator(==) ident(OperationStatus)operator(.)ident(SUCCESS)operator(\)) operator({) - ident(key) operator(=) keyword(new) pre_type(String)operator(()ident(theKey)operator(.)ident(data)operator(,) stringoperator(\)) - ident(foundData) operator(=) keyword(new) pre_type(String)operator(()ident(theData)operator(.)ident(data)operator(,) stringoperator(\)) - ident(println) stringcontent(' found data: ')inlinecontent('.)delimiter(")> -operator(}) -ident(myDb)operator(.)ident(delete)operator(()ident(tx)operator(,) ident(theKey)operator(\)) -ident(myDb)operator(.)ident(close)operator(()operator(\)) -ident(myEnv)operator(.)ident(close)operator(()operator(\)) - - -comment(// userstats using pbeans) -keyword(import) include(net.sourceforge.pbeans.*) -comment(// on *nix use: whotext = "who".execute(\).text) -ident(whotext) operator(=) string - -type(class) class(LoginInfo) directive(implements) ident(Persistent) operator({) - ident(LoginInfo)operator(()operator(\)) operator({)operator(}) - ident(LoginInfo)operator(()ident(name)operator(\)) operator({) local_variable(this)operator(.)ident(name) operator(=) ident(name)operator(;) ident(loginCount) operator(=) integer(1) operator(}) - pre_type(String) ident(name) - type(int) ident(loginCount) -operator(}) - -keyword(def) method(printAllUsers)operator(()ident(store)operator(\)) operator({) - ident(printUsers)operator(()ident(store)operator(,) ident(store)operator(.)ident(select)operator(()ident(LoginInfo)operator(.)ident(class)operator(\))operator(.)ident(collect)operator({)local_variable(it)operator(.)ident(name)operator(})operator(.)ident(sort)operator(()operator(\))operator(\)) -operator(}) - -keyword(def) method(printUsers)operator(()ident(store)operator(,) ident(list)operator(\)) operator({) - ident(list)operator(.)ident(each)operator({) - ident(println) stringcontent( )inlineoperator(,) local_variable(it)operator(\))operator(.)ident(loginCount)inline_delimiter(})>delimiter(")> - operator(}) -operator(}) - -keyword(def) method(addUsers)operator(()ident(store)operator(\)) operator({) - ident(whotext)operator(.)ident(trim)operator(()operator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each)operator({) - ident(m) operator(=) local_variable(it) operator(=~) regexp - ident(name) operator(=) ident(m)operator([)integer(0)operator(])operator([)integer(1)operator(]) - ident(item) operator(=) ident(store)operator(.)ident(selectSingle)operator(()ident(LoginInfo)operator(.)ident(class)operator(,) stringoperator(,) ident(name)operator(\)) - keyword(if) operator(()ident(item)operator(\)) operator({) - ident(item)operator(.)ident(loginCount)operator(++) - ident(store)operator(.)ident(save)operator(()ident(item)operator(\)) - operator(}) keyword(else) operator({) - ident(store)operator(.)ident(insert)operator(()keyword(new) ident(LoginInfo)operator(()ident(name)operator(\))operator(\)) - operator(}) - operator(}) -operator(}) - -keyword(def) ident(ds) operator(=) keyword(new) ident(org)operator(.)ident(hsqldb)operator(.)ident(jdbc)operator(.)ident(jdbcDataSource)operator(()operator(\)) -ident(ds)operator(.)ident(database) operator(=) string -ident(ds)operator(.)ident(user) operator(=) string -ident(ds)operator(.)ident(password) operator(=) string -ident(store) operator(=) keyword(new) ident(Store)operator(()ident(ds)operator(\)) -keyword(if) operator(()ident(args)operator(.)ident(size)operator(()operator(\)) operator(==) integer(0)operator(\)) operator({) - ident(addUsers)operator(()ident(store)operator(\)) -operator(}) keyword(else) keyword(if) operator(()ident(args) operator(==) operator([)stringoperator(])operator(\)) operator({) - ident(printAllUsers)operator(()ident(store)operator(\)) -operator(}) keyword(else) operator({) - ident(printUsers)operator(()ident(store)operator(,) ident(args)operator(\)) -operator(}) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.2) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy would normally use JDBC here (see 14.1 for details\)) -keyword(import) include(com.sleepycat.je.*) -ident(tx) operator(=) pre_constant(null) -ident(envHome) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) - -ident(myEnvConfig) operator(=) keyword(new) ident(EnvironmentConfig)operator(()operator(\)) -ident(myEnvConfig)operator(.)ident(setAllowCreate)operator(()pre_constant(true)operator(\)) -ident(myEnv) operator(=) keyword(new) ident(Environment)operator(()ident(envHome)operator(,) ident(myEnvConfig)operator(\)) - -ident(myDbConfig) operator(=) keyword(new) ident(DatabaseConfig)operator(()operator(\)) -ident(myDbConfig)operator(.)ident(setAllowCreate)operator(()pre_constant(true)operator(\)) -ident(myDb) operator(=) ident(myEnv)operator(.)ident(openDatabase)operator(()ident(tx)operator(,) stringoperator(,) ident(myDbConfig)operator(\)) - -ident(theKey) operator(=) keyword(new) ident(DatabaseEntry)operator(()stringoperator(.)ident(getBytes)operator(()stringoperator(\))operator(\)) -ident(theData) operator(=) keyword(new) ident(DatabaseEntry)operator(()stringoperator(.)ident(getBytes)operator(()stringoperator(\))operator(\)) -ident(myDb)operator(.)ident(put)operator(()ident(tx)operator(,) ident(theKey)operator(,) ident(theData)operator(\)) -ident(myDb)operator(.)ident(close)operator(()operator(\)) -comment(// clear out database) -ident(returnCount) operator(=) pre_constant(true) -ident(println) ident(myEnv)operator(.)ident(truncateDatabase)operator(()ident(tx)operator(,) stringoperator(,) ident(returnCount)operator(\)) operator(+) string -comment(// remove database) -ident(myEnv)operator(.)ident(removeDatabase)operator(()ident(tx)operator(,) stringoperator(\)) -ident(myEnv)operator(.)ident(close)operator(()operator(\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.3) -comment(//----------------------------------------------------------------------------------) -comment(// Original cookbook example not likely in Groovy.) -comment(// Here is a more realistic example, copying pbeans -> jdbc) -comment(// Creation of pbeans database not strictly needed but shown for completion) - -keyword(import) include(net.sourceforge.pbeans.*) -keyword(import) include(groovy.sql.Sql) - -keyword(def) ident(ds) operator(=) keyword(new) ident(org)operator(.)ident(hsqldb)operator(.)ident(jdbc)operator(.)ident(jdbcDataSource)operator(()operator(\)) -ident(ds)operator(.)ident(database) operator(=) string -ident(ds)operator(.)ident(user) operator(=) string -ident(ds)operator(.)ident(password) operator(=) string -ident(store) operator(=) keyword(new) ident(Store)operator(()ident(ds)operator(\)) - -type(class) class(Person) directive(implements) ident(Persistent) operator({) - pre_type(String) ident(name) - pre_type(String) ident(does) - pre_type(String) ident(email) -operator(}) - -comment(// populate with test data) -ident(store)operator(.)ident(insert)operator(()keyword(new) ident(Person)operator(()key(name)operator(:)stringoperator(,) key(does)operator(:)stringoperator(,) key(email)operator(:)stringoperator(\))operator(\)) -ident(store)operator(.)ident(insert)operator(()keyword(new) ident(Person)operator(()key(name)operator(:)stringoperator(,) key(does)operator(:)stringoperator(,) key(email)operator(:)stringoperator(\))operator(\)) - -ident(people) operator(=) ident(store)operator(.)ident(select)operator(()ident(Person)operator(.)ident(class)operator(\)) - -ident(db) operator(=) keyword(new) ident(Sql)operator(()ident(ds)operator(\)) - -ident(db)operator(.)ident(execute) string -ident(people)operator(.)ident(each)operator({) ident(p) operator(->) - ident(db)operator(.)ident(execute) stringcontent(.name,)inlinecontent(.does,)inlinecontent(.email\);)delimiter(")> -operator(}) -ident(db)operator(.)ident(eachRow)operator(()stringoperator(\))operator({) - ident(println) stringcontent(.name, )inlinecontent(.does, )inlinecontent(.email)delimiter(")> -operator(}) -ident(db)operator(.)ident(execute) string -comment(// => Tom Christiansen, book author, tchrist@perl.com) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.4) -comment(//----------------------------------------------------------------------------------) -comment(// Groovy would normally use JDBC here (see 14.1 for details\)) -keyword(import) include(com.sleepycat.je.*) - -keyword(def) method(copyEntries)operator(()ident(indb)operator(,) ident(outdb)operator(\)) operator({) - ident(cursor) operator(=) ident(indb1)operator(.)ident(openCursor)operator(()pre_constant(null)operator(,) pre_constant(null)operator(\)) - keyword(while) operator(()ident(cursor)operator(.)ident(getNext)operator(()ident(foundKey)operator(,) ident(foundData)operator(,) ident(LockMode)operator(.)ident(DEFAULT)operator(\)) operator(==) ident(OperationStatus)operator(.)ident(SUCCESS)operator(\)) - ident(outdb)operator(.)ident(out)operator(()ident(tx)operator(,) ident(foundKey)operator(,) ident(foundData)operator(\)) - ident(cursor)operator(.)ident(close)operator(()operator(\)) -operator(}) - -ident(tx) operator(=) pre_constant(null) -ident(envHome) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) - -ident(myEnvConfig) operator(=) keyword(new) ident(EnvironmentConfig)operator(()operator(\)) -ident(myEnvConfig)operator(.)ident(setAllowCreate)operator(()pre_constant(true)operator(\)) -ident(myEnv) operator(=) keyword(new) ident(Environment)operator(()ident(envHome)operator(,) ident(myEnvConfig)operator(\)) - -ident(myDbConfig) operator(=) keyword(new) ident(DatabaseConfig)operator(()operator(\)) -ident(myDbConfig)operator(.)ident(setAllowCreate)operator(()pre_constant(true)operator(\)) -ident(indb1) operator(=) ident(myEnv)operator(.)ident(openDatabase)operator(()ident(tx)operator(,) stringoperator(,) ident(myDbConfig)operator(\)) -ident(indb2) operator(=) ident(myEnv)operator(.)ident(openDatabase)operator(()ident(tx)operator(,) stringoperator(,) ident(myDbConfig)operator(\)) -ident(outdb) operator(=) ident(myEnv)operator(.)ident(openDatabase)operator(()ident(tx)operator(,) stringoperator(,) ident(myDbConfig)operator(\)) -ident(foundKey) operator(=) keyword(new) ident(DatabaseEntry)operator(()operator(\)) -ident(foundData) operator(=) keyword(new) ident(DatabaseEntry)operator(()operator(\)) -ident(copyEntries)operator(()ident(indb1)operator(,) ident(outdb)operator(\)) -ident(copyEntries)operator(()ident(indb2)operator(,) ident(outdb)operator(\)) -ident(cursor) operator(=) ident(indb2)operator(.)ident(openCursor)operator(()pre_constant(null)operator(,) pre_constant(null)operator(\)) -keyword(while) operator(()ident(cursor)operator(.)ident(getNext)operator(()ident(foundKey)operator(,) ident(foundData)operator(,) ident(LockMode)operator(.)ident(DEFAULT)operator(\)) operator(==) ident(OperationStatus)operator(.)ident(SUCCESS)operator(\)) - ident(outdb)operator(.)ident(out)operator(()ident(tx)operator(,) ident(foundKey)operator(,) ident(foundData)operator(\)) -ident(cursor)operator(.)ident(close)operator(()operator(\)) -ident(indb1)operator(.)ident(close)operator(()operator(\)) -ident(indb2)operator(.)ident(close)operator(()operator(\)) -ident(outdb)operator(.)ident(close)operator(()operator(\)) -ident(myEnv)operator(.)ident(close)operator(()operator(\)) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.5) -comment(//----------------------------------------------------------------------------------) -comment(// If you are using a single file based persistence mechanism you can) -comment(// use the file locking mechanisms mentioned in 7.11 otherwise the) -comment(// database itself or the ORM layer will provide locking mechanisms.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.6) -comment(//----------------------------------------------------------------------------------) -comment(// N/A for most Java/Groovy persistent technologies.) -comment(// Use indexes for RDBMS systems.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.7) -comment(//----------------------------------------------------------------------------------) - comment(// We can write a category that allows the ArrayList class) - comment(// to be persisted as required.) - type(class) class(ArrayListCategory) operator({) - directive(static) ident(file) operator(=) keyword(new) pre_type(File)operator(()stringoperator(\)) - directive(public) directive(static) type(void) ident(save)operator(()pre_type(ArrayList) ident(self)operator(\)) operator({) - keyword(def) ident(LS) operator(=) pre_type(System)operator(.)ident(getProperty)operator(()stringoperator(\)) - ident(file)operator(.)ident(withWriter)operator({) ident(w) operator(->) - ident(self)operator(.)ident(each)operator({) ident(w)operator(.)ident(write)operator(()local_variable(it) operator(+) ident(LS)operator(\)) operator(}) - operator(}) - operator(}) - operator(}) - - ident(lines) operator(=) stringoperator(.)ident(trim)operator(()operator(\))operator(.)ident(split)operator(()stringoperator(\)) keyword(as) pre_type(ArrayList) - - ident(use)operator(()ident(ArrayListCategory)operator(\)) operator({) - ident(println) string - keyword(for) operator(()ident(i) keyword(in) integer(0)operator(..<)ident(lines)operator(.)ident(size)operator(()operator(\))operator(\)) - ident(println) stringcontent(: )inlinedelimiter(")> - - ident(a) operator(=) ident(lines)operator([)operator(-)integer(1)operator(]) - ident(lines)operator([)operator(-)integer(1)operator(]) operator(=) string - ident(println) stringcontent(])delimiter(")> - - ident(a) operator(=) ident(lines)operator([)integer(0)operator(]) - ident(lines) operator(=) operator([)stringoperator(]) operator(+) ident(lines)operator([)integer(1)operator(..)operator(-)integer(1)operator(]) - ident(println) stringcontent(])delimiter(")> - - ident(lines)operator(.)ident(add)operator(()integer(3)operator(,) stringoperator(\)) - ident(lines)operator(.)ident(add)operator(()integer(1)operator(,) stringoperator(\)) - - ident(lines)operator(.)ident(remove)operator(()integer(3)operator(\)) - - ident(println) string - operator(()ident(lines)operator(.)ident(size)operator(()operator(\)) operator(-) integer(1)operator(\))operator(.)ident(downto)operator(()integer(0)operator(\))operator({) ident(i) operator(->) - ident(println) stringcontent(: )inlinedelimiter(")> - operator(}) - ident(lines)operator(.)ident(save)operator(()operator(\)) - operator(}) - comment(// =>) - comment(// ORIGINAL) - comment(// 0: zero) - comment(// 1: one) - comment(// 2: two) - comment(// 3: three) - comment(// 4: four) - comment(// The last line was [four]) - comment(// The first line was [zero]) - comment(// REVERSE) - comment(// 5: last) - comment(// 4: three) - comment(// 3: Newbie) - comment(// 2: one) - comment(// 1: New One) - comment(// 0: first) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.8) -comment(//----------------------------------------------------------------------------------) -comment(// example using pbeans) -keyword(import) include(net.sourceforge.pbeans.*) -keyword(def) ident(ds) operator(=) keyword(new) ident(org)operator(.)ident(hsqldb)operator(.)ident(jdbc)operator(.)ident(jdbcDataSource)operator(()operator(\)) -ident(ds)operator(.)ident(database) operator(=) string -ident(ds)operator(.)ident(user) operator(=) string -ident(ds)operator(.)ident(password) operator(=) string -ident(store) operator(=) keyword(new) ident(Store)operator(()ident(ds)operator(\)) - -type(class) class(Person) directive(implements) ident(Persistent) operator({) - pre_type(String) ident(name) - pre_type(String) ident(does) - pre_type(String) ident(email) -operator(}) - -ident(name1) operator(=) string -ident(name2) operator(=) string - -ident(store)operator(.)ident(insert)operator(()keyword(new) ident(Person)operator(()key(name)operator(:)ident(name1)operator(,) key(does)operator(:)stringoperator(,) key(email)operator(:)stringoperator(\))operator(\)) -ident(store)operator(.)ident(insert)operator(()keyword(new) ident(Person)operator(()key(name)operator(:)ident(name2)operator(,) key(does)operator(:)stringoperator(,) key(email)operator(:)stringoperator(\))operator(\)) - -ident(tom1) operator(=) ident(store)operator(.)ident(selectSingle)operator(()ident(Person)operator(.)ident(class)operator(,) stringoperator(,) ident(name1)operator(\)) -ident(tom2) operator(=) ident(store)operator(.)ident(selectSingle)operator(()ident(Person)operator(.)ident(class)operator(,) stringoperator(,) ident(name2)operator(\)) - -ident(println) stringcontent( )inlinedelimiter(")> - -keyword(if) operator(()ident(tom1)operator(.)ident(name) operator(==) ident(tom2)operator(.)ident(name) operator(&&) ident(tom1)operator(.)ident(does) operator(==) ident(tom2)operator(.)ident(does) operator(&&) ident(tom1)operator(.)ident(email) operator(==) ident(tom2)operator(.)ident(email)operator(\)) - ident(println) string -keyword(else) - ident(println) string - -ident(tom2)operator(.)ident(does) operator(=) string -ident(store)operator(.)ident(save)operator(()ident(tom2)operator(\)) -comment(// =>) -comment(// Two Toming: Person@12884e0 Person@8ab708) -comment(// No two Toms are ever alike) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.9) -comment(//----------------------------------------------------------------------------------) -comment(// Use one of the mechanisms mentioned in 14.1 to load variables at the start) -comment(// of the script and save them at the end. You can save the binding, individual) -comment(// variables, maps of variables or composite objects.) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.10) -comment(//----------------------------------------------------------------------------------) -keyword(import) include(groovy.sql.Sql) - -ident(users) operator(=) operator([)stringoperator(:)stringoperator(,) stringoperator(:)stringoperator(,) stringoperator(:)stringoperator(]) - -keyword(def) ident(source) operator(=) keyword(new) ident(org)operator(.)ident(hsqldb)operator(.)ident(jdbc)operator(.)ident(jdbcDataSource)operator(()operator(\)) -ident(source)operator(.)ident(database) operator(=) string -ident(source)operator(.)ident(user) operator(=) string -ident(source)operator(.)ident(password) operator(=) string -ident(db) operator(=) keyword(new) ident(Sql)operator(()ident(source)operator(\)) - -ident(db)operator(.)ident(execute) string -ident(users)operator(.)ident(each)operator({) ident(uid)operator(,) ident(login) operator(->) - ident(db)operator(.)ident(execute) stringcontent(,)inlinecontent(\);)delimiter(")> -operator(}) -ident(db)operator(.)ident(eachRow)operator(()stringoperator(\))operator({) - ident(println) stringcontent(.uid )inlinecontent(.login)delimiter(")> -operator(}) -ident(db)operator(.)ident(execute) string -comment(// =>) -comment(// 20 Joe Bloggs) -comment(// 40 Bill Clinton) -comment(//----------------------------------------------------------------------------------) - - -comment(// @@PLEAC@@_14.11) -comment(//----------------------------------------------------------------------------------) -comment(// variation to cookbook: uses Firefox instead of Netscape, always assumes) -comment(// argument is a regex, has some others args, retains no args to list all) - -comment(// uses jmork mork dbm reading library:) -comment(// http://www.smartwerkz.com/projects/jmork/index.html) -keyword(import) include(mork.*) -keyword(def) ident(cli) operator(=) keyword(new) ident(CliBuilder)operator(()operator(\)) -ident(cli)operator(.)ident(h)operator(()key(longOpt)operator(:) stringoperator(,) stringoperator(\)) -ident(cli)operator(.)ident(e)operator(()key(longOpt)operator(:) stringoperator(,) string )delimiter(})modifier(mx)> -comment(#-----------------------------) -regexp( (?: (?!\). \)* \) )delimiter(})modifier(mx)> -comment(#-----------------------------) -regexp - [^<]* # stuff not possibly bad, and not possibly the end. - (?: - # at this point, we can have '<' if not part of something bad - (?! \) # what we can't have - < # okay, so match the '<' - [^<]* # and continue with more safe stuff - \) * - - )delimiter(})modifier(mx)> - - -comment(# @@PLEAC@@_6.16) -comment(#-----------------------------) -global_variable($/) operator(=) string -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(para)operator(|) - ident(para)operator(.)ident(scan) regexp reserved(do) - ident(puts) stringcontent(' at paragraph )inlinedelimiter(")> - reserved(end) -reserved(end) -comment(#-----------------------------) -ident(astr) operator(=) string -ident(bstr) operator(=) string -reserved(if) stringcontent( )inlinedelimiter(")> operator(=)operator(~) regexp - ident(print) stringcontent( overlaps in )inlinecontent(-)inlinecontent(-)inlinedelimiter(")> -reserved(end) -comment(#-----------------------------) -doctype(#!/usr/bin/ruby -w) -comment(# prime_pattern -- find prime factors of argument using patterns) -pre_constant(ARGV) operator(<<) integer(180) -ident(cap) operator(=) string operator(*) pre_constant(ARGV)operator(.)ident(shift) -reserved(while) ident(cap) operator(=)operator(~) regexp - ident(print) global_variable($1)operator(.)ident(size)operator(,) string - ident(cap)operator(.)ident(gsub!)operator(()regexpdelimiter(/)>operator(,)stringoperator(\)) -reserved(end) -ident(puts) ident(cap)operator(.)ident(size) -comment(#-----------------------------) -comment(#diophantine) -comment(# solve for 12x + 15y + 16z = 281, maximizing x) -reserved(if) operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) - ident(x)operator(,) ident(y)operator(,) ident(z) operator(=) global_variable($1)operator(.)ident(size)operator(,) global_variable($2)operator(.)ident(size)operator(,) global_variable($3)operator(.)ident(size) - ident(puts) stringcontent(; y=)inlinecontent(; z=)inlinedelimiter(")> -reserved(else) - ident(puts) string -reserved(end) -comment(# => One solution is: x=17; y=3; z=2) - -comment(#-----------------------------) -comment(# using different quantifiers:) -operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) -comment(# => One solution is: x=17; y=3; z=2) - -operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) -comment(# => One solution is: x=0; y=7; z=11) - -operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) -comment(# => One solution is: x=1; y=3; z=14) - - -comment(# @@PLEAC@@_6.17) -comment(# alpha OR beta) -regexp - -comment(# alpha AND beta) -regexp - -comment(# alpha AND beta, no overlap) -regexp - -comment(# NOT beta) -regexp - -comment(# NOT bad BUT good) -regexp -comment(#-----------------------------) - -reserved(if) operator(!)operator(()ident(string) operator(=)operator(~) regexpoperator(\)) comment(# ugly) - ident(something)operator(()operator(\)) -reserved(end) - -reserved(if) ident(string) operator(!)operator(~) regexp comment(# preferred) - ident(something)operator(()operator(\)) -reserved(end) - - -comment(#-----------------------------) -reserved(if) ident(string) operator(=)operator(~) regexp operator(&&) ident(string) operator(=)operator(~) regexp - ident(something)operator(()operator(\)) -reserved(end) -comment(#-----------------------------) -reserved(if) ident(string) operator(=)operator(~) regexp operator(||) ident(string) operator(=)operator(~) regexp - ident(something)operator(()operator(\)) -reserved(end) -comment(#-----------------------------) -doctype(#!/usr/bin/ruby -w) -comment(# minigrep - trivial grep) -ident(pat) operator(=) pre_constant(ARGV)operator(.)ident(shift) -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(print) ident(line) reserved(if) ident(line) operator(=)operator(~) regexpdelimiter(/)modifier(o)> -reserved(end) -comment(#-----------------------------) - string operator(=)operator(~) regexp -comment(#-----------------------------) -global_variable($string) operator(=)operator(~) regexp operator(&&) global_variable($string) operator(=)operator(~) regexp -comment(#-----------------------------) -global_variable($murray_hill) operator(=) string -reserved(if) global_variable($murray_hill) operator(=)operator(~) regexp comment(# /m means . can match newline) - - ident(print) stringoperator(;) -reserved(end) -comment(#-----------------------------) -string operator(=)operator(~) regexp -comment(#-----------------------------) -global_variable($brand) operator(=) stringoperator(;) -reserved(if) global_variable($brand) operator(=)operator(~) regexp comment(# /m means . can match newline) - ident(print) stringoperator(;) -reserved(end) -comment(#-----------------------------) -global_variable($map) operator(=)operator(~) regexp -comment(#-----------------------------) -global_variable($map) operator(=) string -reserved(if) global_variable($map) operator(=)operator(~) regexp comment(# /m means . can match newline) - ident(print) stringoperator(;) -reserved(end) -comment(=begin - 7:15am up 206 days, 13:30, 4 users, load average: 1.04, 1.07, 1.04 - -USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT - -tchrist tty1 5:16pm 36days 24:43 0.03s xinit - -tchrist tty2 5:19pm 6days 0.43s 0.43s -tcsh - -tchrist ttyp0 chthon 7:58am 3days 23.44s 0.44s -tcsh - -gnat ttyS4 coprolith 2:01pm 13:36m 0.30s 0.30s -tcsh -=end) -comment(#% w | minigrep '^(?!.*ttyp\).*tchrist') -comment(#-----------------------------) -regexp -comment(#-----------------------------) -comment(#% w | grep tchrist | grep -v ttyp) -comment(#-----------------------------) -comment(#% grep -i 'pattern' files) -comment(#% minigrep '(?i\)pattern' files) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_6.20) -ident(ans) operator(=) global_variable($stdin)operator(.)ident(gets)operator(.)ident(chomp) -ident(re) operator(=) regexpdelimiter(/)> -reserved(case) - reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string - reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string - reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string - reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string -reserved(end) -comment(#-----------------------------) -ident(require) string -ident(table) operator(=) constant(Abbrev)operator(.)ident(abbrev) string -ident(loop) reserved(do) - ident(print) string - ident(ans) operator(=) global_variable($stdin)operator(.)ident(gets)operator(.)ident(chomp) - ident(puts) stringcontent( is )inlinedelimiter(")> -reserved(end) - - -comment(#-----------------------------) -comment(# dummy values are defined for 'file', 'PAGER', and) -comment(# the 'invoke_editor' and 'deliver_message' methods) -comment(# do not do anything interesting in this example.) -doctype(#!/usr/bin/ruby -w) -ident(require) string - -ident(file) operator(=) string -constant(PAGER) operator(=) string - -reserved(def) method(invoke_editor) - ident(puts) string -reserved(end) - -reserved(def) method(deliver_message) - ident(puts) string -reserved(end) - -ident(actions) operator(=) operator({) - string operator(=)operator(>) pre_constant(self)operator(.)ident(method)operator(()symbol(:invoke_editor)operator(\))operator(,) - string operator(=)operator(>) pre_constant(self)operator(.)ident(method)operator(()symbol(:deliver_message)operator(\))operator(,) - string operator(=)operator(>) ident(proc) operator({)ident(system)operator(()constant(PAGER)operator(,) ident(file)operator(\))operator(})operator(,) - string operator(=)operator(>) ident(proc) operator({)ident(puts) stringoperator(;) ident(exit)operator(})operator(,) - string operator(=)operator(>) ident(proc) operator({)ident(puts) stringoperator(}) -operator(}) - -ident(dtable) operator(=) constant(Abbrev)operator(.)ident(abbrev)operator(()ident(actions)operator(.)ident(keys)operator(\)) -ident(loop) reserved(do) - ident(print) string - ident(ans) operator(=) global_variable($stdin)operator(.)ident(gets)operator(.)ident(chomp)operator(.)ident(delete)operator(()stringoperator(\)) - ident(actions)operator([) ident(dtable)operator([)ident(ans)operator(.)ident(downcase)operator(]) operator(||) string operator(])operator(.)ident(call) -reserved(end) - - -comment(# @@PLEAC@@_6.19) -comment(#-----------------------------) -comment(# basically, the Perl Cookbook categorizes this as an) -comment(# unsolvable problem ...) -comment(#-----------------------------) -integer(1) reserved(while) ident(addr)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) -comment(#-----------------------------) -constant(Dear) ident(someuser)instance_variable(@host)operator(.)ident(com)operator(,) - -constant(Please) ident(confirm) ident(the) ident(mail) ident(address) ident(you) ident(gave) ident(us) constant(Wed) constant(May) integer(6) integer(09)operator(:)integer(38)operator(:)integer(41) -constant(MDT) integer(1998) ident(by) ident(replying) ident(to) ident(this) ident(message)operator(.) ident(Include) ident(the) ident(string) -string reserved(in) ident(that) ident(reply)operator(,) ident(but) ident(spelled) reserved(in) ident(reverse)operator(;) ident(that) ident(is)operator(,) -ident(start) ident(with) stringoperator(.) ident(Once) ident(this) ident(is) ident(done)operator(,) ident(your) ident(confirmed) ident(address) ident(will) -ident(be) ident(entered) ident(into) ident(our) ident(records)operator(.) - - -comment(# @@PLEAC@@_6.21) -comment(#-----------------------------) -comment(#% gunzip -c ~/mail/archive.gz | urlify > archive.urlified) -comment(#-----------------------------) -comment(#% urlify ~/mail/*.inbox > ~/allmail.urlified) -comment(#-----------------------------) -doctype(#!/usr/bin/ruby -w) -comment(# urlify - wrap HTML links around URL-like constructs) - -ident(urls) operator(=) stringoperator(;) -ident(ltrs) operator(=) stringoperator(;) -ident(gunk) operator(=) stringoperator(;) -ident(punc) operator(=) stringoperator(;) -ident(any) operator(=) stringinlineinlinedelimiter(")>operator(;) - -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(line)operator(.)ident(gsub!) regexpcontent( : # need resource and a colon - [)inlinecontent(] +? # followed by on or more - # of any valid character, but - # be conservative and take only - # what you need to.... - \) # end $1 } - (?= # look-ahead non-consumptive assertion - [)inlinecontent(]* # either 0 or more punctuation - [^)inlinecontent(] # followed by a non-url char - | # or else - $ # then end of the string - \) - )delimiter(/)modifier(iox)> reserved(do) - string)inlinecontent()delimiter(|)> - reserved(end) - ident(print) ident(line) -reserved(end) - - -comment(# @@PLEAC@@_6.23) -regexp -comment(#-----------------------------) -ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) -regexp comment(# keyword is $1, value is $2) -comment(#-----------------------------) -regexp -comment(#-----------------------------) -regexp -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(\))operator({) global_variable($1)operator(.)ident(hex)operator(.)ident(chr) operator(}) -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) -comment(#-----------------------------) -ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) -ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - -comment(# but really, in Ruby we'd just do:) -ident(str)operator(.)ident(strip!) -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) -comment(#-----------------------------) -ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) -regexp -comment(#-----------------------------) -ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) -ident(cols) operator(=) operator(() operator(()pre_constant(ENV)operator([)stringoperator(]) operator(||) stringoperator(\)) operator(=)operator(~) regexp operator(\)) operator(?) global_variable($1) operator(:) integer(80)operator(;) -comment(#-----------------------------) -ident(name) operator(=) stringcontent( )inlinedelimiter(")>operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) -ident(require) string -ident(include) constant(Config) -ident(raise) string reserved(unless) constant(CONFIG)operator([)stringoperator(]) operator(=)operator(~) regexpoperator(;) -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) -ident(nums) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) -comment(#-----------------------------) -ident(capwords) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) -comment(#-----------------------------) -ident(lowords) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) -comment(#-----------------------------) -ident(icwords) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) -comment(#-----------------------------) -ident(links) operator(=) ident(str)operator(.)ident(scan)operator(()regexp]+?HREF)char(\\s)content(*=)char(\\s)content(*["']?([^'" >]+?\)[ '"]?>)delimiter(/)modifier(mi)>operator(\)) -comment(#-----------------------------) -ident(initial) operator(=) ident(str) operator(=)operator(~) regexp operator(?) global_variable($1) operator(:) string -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) - -global_variable($/) operator(=) string -ident(sentences) operator(=) operator([)operator(]) -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(para)operator(|) - ident(para)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - ident(para)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) - ident(sentences) operator(<<) ident(para)operator(.)ident(scan)operator(()regexpoperator(\)) -reserved(end) - -comment(#-----------------------------) -regexp comment(# YYYY in $1, MM in $2, DD in $3) -comment(#-----------------------------) -regexp -comment(#-----------------------------) -regexp -comment(#-----------------------------) -ident(lines) operator(=) operator([)operator(]) -ident(lines) operator(<<) global_variable($1) reserved(while) ident(input)operator(.)ident(sub!)operator(()regexpoperator(,)stringoperator(\)) - - -comment(# @@PLEAC@@_7.0) -comment(# An IO object being Enumerable, we can use 'each' directly on it) -constant(File)operator(.)ident(open)operator(()stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(line)operator(|) - ident(puts) ident(line) reserved(if) ident(line) operator(=)operator(~) regexp -operator(}) - -ident(logfile) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) -ident(mysub)operator(()global_variable($stdin)operator(,) ident(logfile)operator(\)) - -comment(# The method IO#readline is similar to IO#gets) -comment(# but throws an exception when it reaches EOF) -ident(f) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(\)) -reserved(begin) - reserved(while) operator(()ident(line) operator(=) ident(f)operator(.)ident(readline)operator(\)) - ident(line)operator(.)ident(chomp) - global_variable($stdout)operator(.)ident(print) ident(line) reserved(if) ident(line) operator(=)operator(~) regexp - reserved(end) -reserved(rescue) constant(EOFError) - ident(f)operator(.)ident(close) -reserved(end) - -reserved(while) global_variable($stdin)operator(.)ident(gets) comment(# reads from STDIN) - reserved(unless) operator(()regexpoperator(\)) - global_variable($stderr)operator(.)ident(puts) string comment(# writes to STDERR) - reserved(end) - ident(puts) stringdelimiter(")> comment(# writes to STDOUT) -reserved(end) - -ident(logfile) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) - -ident(logfile)operator(.)ident(close) - -comment(# $defout (or its synonym '$>'\) is the destination of output) -comment(# for Kernel#print, Kernel#puts, and family functions) -ident(logfile) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) -ident(old) operator(=) global_variable($defout) -global_variable($defout) operator(=) ident(logfile) comment(# switch to logfile for output) -ident(puts) string -global_variable($defout) operator(=) ident(old) comment(# return to original output) -ident(puts) string - - -comment(# @@PLEAC@@_7.1) -ident(source) operator(=) constant(File)operator(.)ident(new)operator(()ident(path)operator(,) stringoperator(\)) comment(# open file "path" for reading only) -ident(sink) operator(=) constant(File)operator(.)ident(new)operator(()ident(path)operator(,) stringoperator(\)) comment(# open file "path" for writing only) - -ident(source) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDONLY)operator(\)) comment(# open file "path" for reading only) -ident(sink) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(\)) comment(# open file "path" for writing only) - -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) comment(# open "path" for reading and writing) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) ident(flags)operator(\)) comment(# open "path" with the flags "flags" (see examples below for flags\)) - -comment(# open file "path" read only) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDONLY)operator(\)) - -comment(# open file "path" write only, create it if it does not exist) -comment(# truncate it to zero length if it exists) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(TRUNC)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(TRUNC)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0666)operator(\)) comment(# with permission 0666) - -comment(# open file "path" write only, fails if file exists) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0666)operator(\)) - -comment(# open file "path" for appending) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(APPEND)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(APPEND)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0666)operator(\)) - -comment(# open file "path" for appending only when file exists) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(APPEND)operator(\)) - -comment(# open file "path" for reading and writing) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(\)) - -comment(# open file for reading and writing, create a new file if it does not exist) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0600)operator(\)) - -comment(# open file "path" reading and writing, fails if file exists) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0600)operator(\)) - - -comment(# @@PLEAC@@_7.2) -comment(# No problem with Ruby since the filename doesn't contain characters with) -comment(# special meaning; like Perl's sysopen) -constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) stringoperator(\)) - - -comment(# @@PLEAC@@_7.3) -constant(File)operator(.)ident(expand_path)operator(()stringoperator(\)) -comment(#=> "/root/tmp") -constant(File)operator(.)ident(expand_path)operator(()stringoperator(\)) -comment(#=> "/var/lib/nfs") - -comment(# To expand ~/.. it explicitely needs the environment variable HOME) -constant(File)operator(.)ident(expand_path)operator(()stringoperator(\)) -comment(#=> "/home/gc/tmp") - - -comment(# @@PLEAC@@_7.4) -comment(# The exception raised in Ruby reports the filename) -constant(File)operator(.)ident(open)operator(()stringoperator(\)) - - -comment(# @@PLEAC@@_7.5) -comment(# Standard Ruby distribution provides the following useful extension) -ident(require) string -comment(# With the Tempfile class, the file is automatically deleted on garbage) -comment(# collection, so you won't need to remove it, later on.) -ident(tf) operator(=) constant(Tempfile)operator(.)ident(new)operator(()stringoperator(\)) comment(# a name is required to create the filename) - -comment(# If you need to pass the filename to an external program you can use) -comment(# File#path, but don't forget to File#flush in order to flush anything) -comment(# living in some buffer somewhere.) -ident(tf)operator(.)ident(flush) -ident(system)operator(()stringdelimiter(")>operator(\)) - -ident(fh) operator(=) constant(Tempfile)operator(.)ident(new)operator(()stringoperator(\)) -ident(fh)operator(.)ident(sync) operator(=) pre_constant(true) comment(# autoflushes) -integer(10)operator(.)ident(times) operator({) operator(|)ident(i)operator(|) ident(fh)operator(.)ident(puts) ident(i) operator(}) -ident(fh)operator(.)ident(rewind) -ident(puts) stringoperator(,) ident(fh)operator(.)ident(readlines) - - -comment(# @@PLEAC@@_7.6) -reserved(while) operator(()pre_constant(DATA)operator(.)ident(gets)operator(\)) reserved(do) - comment(# process the line ) -reserved(end) -comment(__END__ -# your data goes here -# __DATA__ doesn't exist in Ruby - -)comment(#CODE) -comment(# get info about the script (size, date of last modification\)) -ident(kilosize) operator(=) pre_constant(DATA)operator(.)ident(stat)operator(.)ident(size) operator(/) integer(1024) -ident(last_modif) operator(=) pre_constant(DATA)operator(.)ident(stat)operator(.)ident(mtime) -ident(puts) stringScript size is )inlinedelimiter(")> -ident(puts) stringLast script update: )inlinedelimiter(")> -comment(__END__ -# DO NOT REMOVE THE PRECEEDING LINE. -# Everything else in this file will be ignored. -)comment(#CODE) - - -comment(# @@PLEAC@@_7.7) -reserved(while) ident(line) operator(=) ident(gets) reserved(do) - comment(# do something with line.) -reserved(end) - -comment(# or ) -reserved(while) ident(gets) reserved(do) - comment(# do something with $_) -reserved(end) - -comment(# or more rubyish) -global_variable($stdin)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - comment(# do stuff with line) -reserved(end) - - -comment(# ARGF may makes this more easy) -comment(# this is skipped if ARGV.size==0) -pre_constant(ARGV)operator(.)ident(each) reserved(do) operator(|)ident(filename)operator(|) - comment(# closing and exception handling are done by the block) - ident(open)operator(()ident(filename)operator(\)) reserved(do) operator(|)ident(fd)operator(|) - ident(fd)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - comment(# do stuff with line) - reserved(end) - reserved(end) reserved(rescue) ident(abort)operator(()string operator(%) ident(filename)operator(\)) -reserved(end) - -comment(# globbing is done in the Dir module) -pre_constant(ARGV) operator(=) constant(Dir)operator([)stringoperator(]) reserved(if) pre_constant(ARGV)operator(.)ident(empty?) - -comment(# note: optparse is the preferred way to handle this) -reserved(if) operator(()pre_constant(ARGV)operator([)integer(0)operator(]) operator(==) stringoperator(\)) - ident(chop_first) operator(+=) integer(1) - pre_constant(ARGV)operator(.)ident(shift) -reserved(end) - - -comment(# processing numerical options) -reserved(if) pre_constant(ARGV)operator([)integer(0)operator(]) operator(=)operator(~) regexp - ident(columns) operator(=) global_variable($1) - pre_constant(ARGV)operator(.)ident(shift) -reserved(end) - -comment(# again, better to use optparse:) -ident(require) string -ident(nostdout) operator(=) integer(0) -ident(append) operator(=) integer(0) -ident(unbuffer) operator(=) integer(0) -ident(ignore_ints) operator(=) integer(0) -pre_constant(ARGV)operator(.)ident(options) reserved(do) operator(|)ident(opt)operator(|) - ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(nostdout) operator(+=)integer(1) operator(}) - ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(append) operator(+=)integer(1) operator(}) - ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(unbuffer) operator(+=)integer(1) operator(}) - ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(ignore_ints) operator(+=)integer(1) operator(}) - ident(opt)operator(.)ident(parse!) -reserved(end) reserved(or) ident(abort)operator(()string operator(+) pre_constant(__FILE__) operator(+) stringoperator(\)) - -comment(# no need to do undef $/, we have File.read) -ident(str) operator(=) constant(File)operator(.)ident(read)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(\)) - -comment(# again we have File.read) -ident(str) operator(=) constant(File)operator(.)ident(read)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(\)) - -comment(# not sure what this should do:) -comment(# I believe open the file, print filename, lineno and line:) -pre_constant(ARGF)operator(.)ident(each_with_index) reserved(do) operator(|)ident(line)operator(,) ident(idx)operator(|) - ident(print) pre_constant(ARGF)operator(.)ident(filename)operator(,) stringoperator(,) ident(idx)operator(,) stringoperator(,) ident(line) -reserved(end) - -comment(# print all the lines in every file passed via command line that contains login) -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(puts) ident(line) reserved(if) ident(line) operator(=)operator(~) regexp -reserved(end) -comment(#) -comment(# even this would fit) -comment(#%ruby -ne "print if /f/" 2.log) -comment(#) - -pre_constant(ARGF)operator(.)ident(each) operator({) operator(|)ident(l)operator(|) ident(puts) ident(l)operator(.)ident(downcase!) operator(}) - -comment(#------------------) -doctype(#!/usr/bin/ruby -p) -comment(# just like perl's -p) -global_variable($_)operator(.)ident(downcase!) -comment(#) - -comment(# I don't know who should I trust. ) -comment(# perl's version splits on \\w+ while python's on \\w.) - -ident(chunks) operator(=) integer(0) - -constant(File)operator(.)ident(read)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(\))operator(.)ident(split)operator(.)ident(each) reserved(do) operator(|)ident(word)operator(|) - reserved(next) reserved(if) ident(word) operator(=)operator(~) regexp - reserved(break) reserved(if) operator([)stringoperator(,) stringoperator(])operator(.)ident(member?) ident(word) - ident(chunks) operator(+=) integer(1) -reserved(end) - -ident(print) stringoperator(,) ident(chunks)operator(,) string - - -comment(# @@PLEAC@@_7.8) -ident(old) operator(=) constant(File)operator(.)ident(open)operator(()ident(old_file)operator(\)) -ident(new) operator(=) constant(File)operator(.)ident(open)operator(()ident(new_file)operator(,) stringoperator(\)) -reserved(while) ident(old)operator(.)ident(gets) reserved(do) - comment(# change $_, then...) - ident(new)operator(.)ident(print) global_variable($_) -reserved(end) -ident(old)operator(.)ident(close) -ident(new)operator(.)ident(close) -constant(File)operator(.)ident(rename)operator(()ident(old_file)operator(,) stringoperator(\)) -constant(File)operator(.)ident(rename)operator(()ident(new_file)operator(,) ident(old_file)operator(\)) - -reserved(while) ident(old)operator(.)ident(gets) reserved(do) - reserved(if) global_variable($.) operator(==) integer(20) reserved(then) comment(# we are at the 20th line) - ident(new)operator(.)ident(puts) string - ident(new)operator(.)ident(puts) string - reserved(end) - ident(new)operator(.)ident(print) global_variable($_) -reserved(end) - -reserved(while) ident(old)operator(.)ident(gets) reserved(do) - reserved(next) reserved(if) integer(20)operator(..)integer(30) comment(# skip the 20th line to the 30th) - comment(# Ruby (and Perl\) permit to write if 20..30 ) - comment(# instead of if (20 <= $.\) and ($. <= 30\)) - ident(new)operator(.)ident(print) global_variable($_) -reserved(end) - - -comment(# @@PLEAC@@_7.9) -comment(#% ruby -i.orig -pe 'FILTER COMMAND' file1 file2 file3 ...) -comment(#) -comment(#-----------------------------) -comment(##!/usr/bin/ruby -i.orig -p) -comment(# filter commands go here) -comment(#-----------------------------) - -comment(#% ruby -pi.orig -e 'gsub!(/DATE/\){Time.now\)') - -comment(# effectively becomes:) -pre_constant(ARGV) operator(<<) string -ident(oldfile) operator(=) string -reserved(while) ident(gets) - reserved(if) pre_constant(ARGF)operator(.)ident(filename) operator(!=) ident(oldfile) - ident(newfile) operator(=) pre_constant(ARGF)operator(.)ident(filename) - constant(File)operator(.)ident(rename)operator(()ident(newfile)operator(,) ident(newfile) operator(+) stringoperator(\)) - global_variable($stdout) operator(=) constant(File)operator(.)ident(open)operator(()ident(newfile)operator(,)stringoperator(\)) - ident(oldfile) operator(=) ident(newfile) - reserved(end) - ident(gsub!)operator(()regexpoperator(\))operator({)constant(Time)operator(.)ident(now)operator(}) - ident(print) -reserved(end) -global_variable($stdout) operator(=) pre_constant(STDOUT) -comment(#-----------------------------) -comment(#% ruby -i.old -pe 'gsub!(%r{\\bhisvar\\b}, 'hervar'\)' *.[Cchy]) - -comment(#-----------------------------) -comment(# set up to iterate over the *.c files in the current directory,) -comment(# editing in place and saving the old file with a .orig extension) -global_variable($-i) operator(=) string comment(# set up -i mode) -pre_constant(ARGV)operator(.)ident(replace)operator(()constant(Dir)operator([)stringoperator(])operator(\)) -reserved(while) ident(gets) - reserved(if) global_variable($.) operator(==) integer(1) - ident(print) string - reserved(end) - ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) comment(# Correct typos, preserving case) - ident(print) - pre_constant(ARGF)operator(.)ident(close) reserved(if) pre_constant(ARGF)operator(.)ident(eof) -reserved(end) - - -comment(# @@PLEAC@@_7.10) -constant(File)operator(.)ident(open)operator(()stringoperator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) comment(# open file for update) - ident(lines) operator(=) ident(f)operator(.)ident(readlines) comment(# read into array of lines) - ident(lines)operator(.)ident(each) reserved(do) operator(|)ident(it)operator(|) comment(# modify lines) - ident(it)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - ident(f)operator(.)ident(pos) operator(=) integer(0) comment(# back to start) - ident(f)operator(.)ident(print) ident(lines) comment(# write out modified lines) - ident(f)operator(.)ident(truncate)operator(()ident(f)operator(.)ident(pos)operator(\)) comment(# truncate to new length) -reserved(end) comment(# file is automatically closed) -comment(#-----------------------------) -constant(File)operator(.)ident(open)operator(()stringoperator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(out) operator(=) string - ident(f)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(out) operator(<<) ident(line)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({)constant(Time)operator(.)ident(now)operator(}) - reserved(end) - ident(f)operator(.)ident(pos) operator(=) integer(0) - ident(f)operator(.)ident(print) ident(out) - ident(f)operator(.)ident(truncate)operator(()ident(f)operator(.)ident(pos)operator(\)) -reserved(end) - -comment(# @@PLEAC@@_7.11) -constant(File)operator(.)ident(open)operator(()stringoperator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_EX) - comment(# update file) -reserved(end) -comment(#-----------------------------) -constant(File)operator(::)constant(LOCK_SH) comment(# shared lock (for reading\)) -constant(File)operator(::)constant(LOCK_EX) comment(# exclusive lock (for writing\)) -constant(File)operator(::)constant(LOCK_NB) comment(# non-blocking request) -constant(File)operator(::)constant(LOCK_UN) comment(# free lock) -comment(#-----------------------------) -reserved(unless) ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_EX) operator(|) constant(File)operator(::)constant(LOCK_NB) - ident(warn) string - ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_EX) -reserved(end) -comment(#-----------------------------) -constant(File)operator(.)ident(open)operator(()stringoperator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(f)operator(.)ident(flock)operator(()constant(File)operator(::)constant(LOCK_EX)operator(\)) - ident(num) operator(=) ident(f)operator(.)ident(gets)operator(.)ident(to_i) operator(||) integer(0) - ident(f)operator(.)ident(pos) operator(=) integer(0) - ident(f)operator(.)ident(truncate) integer(0) - ident(f)operator(.)ident(puts) ident(num) operator(+) integer(1)ident(q) -reserved(end) - - -comment(# @@PLEAC@@_7.12) -ident(output_handle)operator(.)ident(sync) operator(=) pre_constant(true) -comment(# Please note that like in Perl, $stderr is already unbuffered) -comment(#-----------------------------) -doctype(#!/usr/bin/ruby -w) -comment(# seeme - demo stdio output buffering) -global_variable($stdout)operator(.)ident(sync) operator(=) pre_constant(ARGV)operator(.)ident(size) operator(>) integer(0) -ident(print) string -ident(sleep) integer(2) -ident(puts) string -comment(#-----------------------------) -global_variable($stderr)operator(.)ident(sync) operator(=) pre_constant(true) -ident(afile)operator(.)ident(sync) operator(=) pre_constant(false) -comment(#-----------------------------) -comment(# assume 'remote_con' is an interactive socket handle,) -comment(# but 'disk_file' is a handle to a regular file.) -ident(remote_con)operator(.)ident(sync) operator(=) pre_constant(true) comment(# unbuffer for clarity) -ident(disk_file)operator(.)ident(sync) operator(=) pre_constant(false) comment(# buffered for speed) -comment(#-----------------------------) -ident(require) string -ident(sock) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) integer(80)operator(\)) -ident(sock)operator(.)ident(sync) operator(=) pre_constant(true) -ident(sock)operator(.)ident(puts) string -ident(resp) operator(=) ident(sock)operator(.)ident(read) -ident(print) stringchar(\\n)delimiter(")> - - -comment(# @@PLEAC@@_7.13) -comment(#-----------------------------) -comment(# assumes fh1, fh2, fh2 are oen IO objects) -ident(nfound) operator(=) ident(select)operator(()operator([)global_variable($stdin)operator(,) ident(fh1)operator(,) ident(fh2)operator(,) ident(fh3)operator(])operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(0)operator(\)) -ident(nfound)operator([)integer(0)operator(])operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - reserved(case) ident(file) - reserved(when) ident(fh1) - comment(# do something with fh1) - reserved(when) ident(fh2) - comment(# do something with fh2) - reserved(when) ident(fh3) - comment(# do something with fh3) - reserved(end) -reserved(end) -comment(#-----------------------------) -ident(input_files) operator(=) operator([)operator(]) -comment(# repeat next line for all in-files to poll) -ident(input_files) operator(<<) ident(fh1) -reserved(if) ident(nfound) operator(=) ident(select)operator(()ident(input_files)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(0)operator(\)) - comment(# input ready on files in nfound[0]) -reserved(end) - - -comment(# @@PLEAC@@_8.0) -comment(#-----------------------------) -comment(# datafile is a file or IO object) -ident(datafile)operator(.)ident(readlines)operator(.)ident(each) operator({) operator(|)ident(line)operator(|) - ident(line)operator(.)ident(chomp!) - ident(size) operator(=) ident(line)operator(.)ident(length) - ident(puts) ident(size) -operator(}) -comment(#-----------------------------) -ident(datafile)operator(.)ident(readlines)operator(.)ident(each) operator({) operator(|)ident(line)operator(|) - ident(puts) ident(line)operator(.)ident(chomp!)operator(.)ident(length) -operator(}) -comment(#-----------------------------) -ident(lines) operator(=) ident(datafile)operator(.)ident(readlines) -comment(#-----------------------------) -ident(whole_file) operator(=) ident(file)operator(.)ident(read) -comment(#-----------------------------) -comment(# ruby -040 -e 'word = gets; puts "First word is #{word}"') -comment(#-----------------------------) -comment(# ruby -ne 'BEGIN { $/="%%\\n" }; $_.chomp; puts $_ if( $_=~/Unix/i\)' fortune.dat) -comment(#-----------------------------) -ident(handle)operator(.)ident(print) stringoperator(,) stringoperator(,) string comment(# "onetwothree") -ident(puts) string comment(# sent to $stdout) -comment(#-----------------------------) -ident(buffer) operator(=) ident(handle)operator(.)ident(read)operator(()integer(4096)operator(\)) -ident(rv) operator(=) ident(buffer)operator(.)ident(length) -comment(#-----------------------------) -ident(handle)operator(.)ident(truncate)operator(()ident(length)operator(\)) -ident(open)operator(()stringcontent(.pid)delimiter(")>operator(,) stringoperator(\)) operator({) operator(|)ident(handle)operator(|) ident(handle)operator(.)ident(truncate)operator(()ident(length)operator(\)) operator(}) -comment(#-----------------------------) -ident(pos) operator(=) ident(datafile)operator(.)ident(pos) comment(# tell is an alias of pos) -ident(puts) stringcontent( bytes from the start of datafile)delimiter(")> -comment(#-----------------------------) -ident(logfile)operator(.)ident(seek)operator(()integer(0)operator(,) constant(IO)operator(::)constant(SEEK_END)operator(\)) -ident(datafile)operator(.)ident(seek)operator(()ident(pos)operator(\)) comment(# IO::SEEK_SET is the default) -ident(out)operator(.)ident(seek)operator(()integer(-20)operator(,) constant(IO)operator(::)constant(SEEK_CUR)operator(\)) -comment(#-----------------------------) -ident(written) operator(=) ident(datafile)operator(.)ident(syswrite)operator(()ident(mystring)operator(\)) -ident(raise) constant(RunTimeError) reserved(unless) ident(written) operator(==) ident(mystring)operator(.)ident(length) -ident(block) operator(=) ident(infile)operator(.)ident(sysread)operator(()integer(256)operator(\)) comment(# no equivalent to perl offset parameter in sysread) -ident(puts) stringcontent( bytes)delimiter(")> reserved(if) integer(256) operator(!=) ident(block)operator(.)ident(length) -comment(#-----------------------------) -ident(pos) operator(=) ident(handle)operator(.)ident(sysseek)operator(()integer(0)operator(,) constant(IO)operator(::)constant(SEEK_CUR)operator(\)) comment(# don't change position) - - -comment(# @@PLEAC@@_8.1) -reserved(while) operator(()ident(line) operator(=) ident(fh)operator(.)ident(gets)operator(\)) - ident(line)operator(.)ident(chomp!) - ident(nextline) operator(=) pre_constant(nil) - ident(line)operator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) operator(|)ident(match)operator(|) ident(nextline) operator(=) ident(fh)operator(.)ident(gets)operator(;) string operator(}) - reserved(if) operator(()ident(nextline) operator(!=) pre_constant(nil)operator(\)) - ident(line) operator(+=) ident(nextline) - reserved(redo) - reserved(end) - comment(# process full record in line here) -reserved(end) -comment(#-----------------------------) -comment(# DISTFILES = $(DIST_COMMON\) $(SOURCES\) $(HEADERS\) \\) -comment(# $(TEXINFOS\) $(INFOS\) $(MANS\) $(DATA\)) -comment(# DEP_DISTFILES = $(DIST_COMMON\) $(SOURCES\) $(HEADERS\) \\) -comment(# $(TEXINFOS\) $(INFO_DEPS\) $(MANS\) $(DATA\) \\) -comment(# $(EXTRA_DIST\)) -comment(#-----------------------------) -ident(line)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) operator({) - comment(# as before) -operator(}) - - -comment(# @@PLEAC@@_8.2) -comment(#-----------------------------) -ident(count) operator(=) shelldelimiter(`)> -ident(fail) stringdelimiter(")> reserved(if) global_variable($?) operator(!=) integer(0) -ident(count)operator(.)ident(chomp!) -comment(#-----------------------------) -ident(count) operator(=) integer(0) -constant(File)operator(.)ident(open)operator(()ident(file)operator(,) stringoperator(\)) operator({) operator(|)ident(fh)operator(|) - ident(count) operator(+=) integer(1) reserved(while) ident(fh)operator(.)ident(gets) -operator(}) -comment(# count now holds the number of lines read) -comment(#-----------------------------) -ident(count) operator(=) integer(0) -reserved(while) operator(()ident(chunk) operator(=) ident(file)operator(.)ident(sysread)operator(()integer(2)operator(**)integer(16)operator(\))operator(\)) - ident(count) operator(+=) ident(chunk)operator(.)ident(count)operator(()stringoperator(\)) -reserved(end) reserved(rescue) constant(EOFError) -comment(#-----------------------------) -constant(File)operator(.)ident(open)operator(()ident(filename)operator(,)stringoperator(\)) operator({) operator(|)ident(fh)operator(|) - ident(count) operator(+=) integer(1) reserved(while) ident(fh)operator(.)ident(gets) -operator(}) -comment(# count now holds the number of lines read) -comment(#-----------------------------) -comment(# As ruby doesn't quite have an equivalent to using a for) -comment(# statement as in perl, I threw this in) -ident(count) operator(=) constant(File)operator(.)ident(readlines)operator(()ident(filename)operator(\))operator(.)ident(size) -comment(#-----------------------------) -integer(1) reserved(while) ident(file)operator(.)ident(gets) -ident(count) operator(=) global_variable($.) -comment(#-----------------------------) -global_variable($/) operator(=) string -ident(open)operator(()ident(filename)operator(,) stringoperator(\)) operator({) operator(|)ident(fh)operator(|) - integer(1) reserved(while) ident(fh)operator(.)ident(gets) - ident(para_count) operator(=) global_variable($.) -operator(}) reserved(rescue) ident(fail)operator(()stringcontent(: $!)delimiter(")>operator(\)) -comment(#-----------------------------) - - -comment(# ^^PLEAC^^_8.3) -comment(#-----------------------------) -reserved(while) operator(()ident(gets)operator(\)) - ident(split)operator(.)ident(each) operator({) operator(|)ident(chunk)operator(|) - comment(# do something with chunk) - operator(}) -reserved(end) -comment(#-----------------------------) -reserved(while) operator(()ident(gets)operator(\)) - ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(word)operator(|) - comment(# do something with word) - operator(}) -reserved(end) -comment(#-----------------------------) -comment(# Make a word frequency count) -comment(# normally hashes can be created using {} or just Hash.new) -comment(# but we want the default value of an entry to be 0 instead ) -comment(# of nil. (nil can't be incremented\)) -ident(seen) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) -reserved(while) operator(()ident(gets)operator(\)) - ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(word)operator(|) - ident(seen)operator([)ident(word)operator(.)ident(downcase)operator(]) operator(+=) integer(1) - operator(}) -reserved(end) -comment(# output hash in a descending numeric sort of its values) -ident(seen)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(b)operator([)integer(1)operator(]) operator(<=>) ident(a)operator([)integer(1)operator(]) operator(})operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) - ident(printf)operator(()stringoperator(,) ident(v)operator(,) ident(k) operator(\)) -reserved(end) - -comment(#-----------------------------) -comment(# Line frequency count) -ident(seen) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) -reserved(while) operator(()ident(gets)operator(\)) - ident(seen)operator([)global_variable($_)operator(.)ident(downcase)operator(]) operator(+=) integer(1) -reserved(end) -ident(seen)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(b)operator([)integer(1)operator(]) operator(<=>) ident(a)operator([)integer(1)operator(]) operator(})operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) - ident(printf)operator(()stringoperator(,) ident(v)operator(,) ident(k) operator(\)) -reserved(end) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_8.4) -comment(#-----------------------------) -comment(# instead of file handle FILE, we can just) -comment(# use a string containing the filename) -constant(File)operator(.)ident(readlines)operator(()ident(file)operator(\))operator(.)ident(each) operator({) operator(|)ident(line)operator(|) - comment(# do something with line) -operator(}) -comment(#-----------------------------) -constant(File)operator(.)ident(readlines)operator(()ident(file)operator(\))operator(.)ident(reverse_each) operator({) operator(|)ident(line)operator(|) - comment(# do something with line) -operator(}) -comment(#-----------------------------) -comment(# the variable lines might have been created) -comment(# this way) -comment(# lines = File.readlines(file\)) -comment(#) -comment(# normally one would use the reverse_each, but) -comment(# if you insist on using a numerical index to) -comment(# iterate over the lines array...) -operator(()ident(lines)operator(.)ident(size) operator(-) integer(1)operator(\))operator(.)ident(downto)operator(()integer(0)operator(\)) operator({) operator(|)ident(i)operator(|) - ident(line) operator(=) ident(lines)operator([)ident(i)operator(]) -operator(}) -comment(#-----------------------------) -comment(# the second readlines argument is a the ) -comment(# record separator $/, just like perl, a blank) -comment(# separator splits the records into paragraphs) -constant(File)operator(.)ident(readlines)operator(()ident(file)operator(,) stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(paragraph)operator(|) - comment(# do something with paragraph) - ident(puts) stringParagraph )inlinedelimiter(")> -operator(}) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_8.6) - -global_variable($/) operator(=) stringoperator(;) -ident(srand)operator(;) - -constant(File)operator(.)ident(open)operator(()stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(adage) operator(=) ident(line) reserved(if) ident(rand)operator(()global_variable($.)operator(\)) operator(<) integer(1) -reserved(end) - -ident(puts) ident(adage)operator(;) - - -comment(# @@PLEAC@@_8.10) -reserved(begin) - ident(fh) operator(=) constant(File)operator(.)ident(open)operator(()ident(file)operator(,) stringoperator(\)) - ident(addr) operator(=) ident(fh)operator(.)ident(tell) reserved(unless) ident(fh)operator(.)ident(eof) reserved(while) ident(fh)operator(.)ident(gets) - ident(fh)operator(.)ident(truncate)operator(()ident(addr)operator(\)) -reserved(rescue) constant(SystemCallError) - global_variable($stderr)operator(.)ident(puts) string -reserved(end) - - -comment(# @@PLEAC@@_9.0) -ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) -ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) -ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()constant(INFILE)operator(\)) - -ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) -ident(ctime) operator(=) ident(entry)operator(.)ident(ctime) -ident(size) operator(=) ident(entry)operator(.)ident(size) - -ident(f) operator(=) constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) stringoperator(\)) - -comment(## There is no -T equivalent in Ruby, but we can still test emptiness) -reserved(if) ident(test)operator(()integer(?s)operator(,) ident(filename)operator(\)) - ident(puts) stringcontent( doesn't have text in it.)delimiter(")> - ident(exit) -reserved(end) - -constant(Dir)operator(.)ident(new)operator(()stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(filename)operator(|) - ident(puts) stringdelimiter(")> -reserved(end) - - -comment(# @@PLEAC@@_9.1) -ident(file) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) -ident(readtime)operator(,) ident(writetime) operator(=) ident(file)operator(.)ident(atime)operator(,) ident(file)operator(.)ident(mtime) -ident(file)operator(.)ident(utime)operator(()ident(readtime)operator(,) ident(writetime)operator(\)) - -constant(SECONDS_PER_DAY) operator(=) integer(60) operator(*) integer(60) operator(*) integer(24) -ident(file) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) -ident(atime)operator(,) ident(mtime) operator(=) ident(file)operator(.)ident(atime)operator(,) ident(file)operator(.)ident(mtime) - -ident(atime) operator(-=) integer(7) operator(*) constant(SECONDS_PER_DAY) -ident(mtime) operator(-=) integer(7) operator(*) constant(SECONDS_PER_DAY) - -constant(File)operator(.)ident(utime)operator(()ident(atime)operator(,) ident(mtime)operator(,) ident(file)operator(\)) -ident(mtime) operator(=) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(mtime) -constant(File)operator(.)ident(utime)operator(()constant(Time)operator(.)ident(new)operator(,) ident(mtime)operator(,) ident(file)operator(\)) -constant(File)operator(.)ident(utime)operator(()constant(Time)operator(.)ident(new)operator(,) constant(File)operator(.)ident(stat)operator(()stringoperator(\))operator(.)ident(mtime)operator(,) ident(file)operator(\)) - -comment(#-----------------------------) -doctype(#!/usr/bin/ruby -w) -comment(## uvi - vi a file without changing it's access times) - -reserved(if) pre_constant(ARGV)operator(.)ident(length) operator(!=) integer(1) - ident(puts) string - ident(exit) -reserved(end) -ident(file) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) -ident(atime)operator(,) ident(mtime) operator(=) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(atime)operator(,) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(mtime) -ident(system)operator(()pre_constant(ENV)operator([)stringoperator(]) operator(||) stringoperator(,) ident(file)operator(\)) -constant(File)operator(.)ident(utime)operator(()ident(atime)operator(,) ident(mtime)operator(,) ident(file)operator(\)) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_9.2) -constant(File)operator(.)ident(unlink)operator(()constant(FILENAME)operator(\)) - -ident(err_flg) operator(=) pre_constant(false) -ident(filenames)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - reserved(begin) - constant(File)operator(.)ident(unlink)operator(()ident(file)operator(\)) - reserved(rescue) - ident(err_flg) operator(=) global_variable($!) - reserved(end) -reserved(end) -ident(err_flg) reserved(and) ident(raise) stringoperator(\))inline_delimiter(})>content(: )inlinedelimiter(")> - -constant(File)operator(.)ident(unlink)operator(()ident(file)operator(\)) - -ident(count) operator(=) ident(filenames)operator(.)ident(length) -ident(filenames)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - reserved(begin) - constant(File)operator(.)ident(unlink)operator(()ident(file)operator(\)) - reserved(rescue) - ident(count) operator(-=) integer(1) - reserved(end) -reserved(end) -reserved(if) ident(count) operator(!=) ident(filenames)operator(.)ident(length) - pre_constant(STDERR)operator(.)ident(puts) stringcontent( of )inlinecontent( files)delimiter(")> -reserved(end) - - -comment(# @@PLEAC@@_9.3) -ident(require) string -constant(File)operator(.)ident(copy)operator(()ident(oldfile)operator(,) ident(newfile)operator(\)) - -ident(infile) operator(=) constant(File)operator(.)ident(open)operator(()ident(oldfile)operator(,) stringoperator(\)) -ident(outfile) operator(=) constant(File)operator(.)ident(open)operator(()ident(newfile)operator(,) stringoperator(\)) - -ident(blksize) operator(=) ident(infile)operator(.)ident(stat)operator(.)ident(blksize) -comment(# This doesn't handle partial writes or ^Z) -comment(# like the Perl version does.) -reserved(while) operator(()ident(line) operator(=) ident(infile)operator(.)ident(read)operator(()ident(blksize)operator(\))operator(\)) - ident(outfile)operator(.)ident(write)operator(()ident(line)operator(\)) -reserved(end) - -ident(infile)operator(.)ident(close) -ident(outfile)operator(.)ident(close) - -ident(system)operator(()stringcontent( )inlinedelimiter(")>operator(\)) comment(# unix) -ident(system)operator(()stringcontent( )inlinedelimiter(")>operator(\)) comment(# dos, vms) - -ident(require) string -constant(File)operator(.)ident(copy)operator(()stringoperator(,) stringoperator(\)) -constant(File)operator(.)ident(move)operator(()stringoperator(,) stringoperator(\)) - - -comment(# @@PLEAC@@_9.4) -global_variable($seen) operator(=) operator({)operator(}) comment(# must use global var to be seen inside of method below) - -reserved(def) method(do_my_thing)operator(()ident(filename)operator(\)) - ident(dev)operator(,) ident(ino) operator(=) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(dev)operator(,) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(ino) - reserved(unless) global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(]) - comment(# do something with $filename because we haven't) - comment(# seen it before) - reserved(end) - global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(]) operator(=) global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(])operator(.)ident(to_i) operator(+) integer(1) -reserved(end) - -ident(files)operator(.)ident(each) reserved(do) operator(|)ident(filename)operator(|) - ident(dev)operator(,) ident(ino) operator(=) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(dev)operator(,) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(ino) - reserved(if) operator(!)global_variable($seen)operator(.)ident(has_key?)operator(()operator([)ident(dev)operator(,) ident(ino)operator(])operator(\)) - global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(]) operator(=) operator([)operator(]) - reserved(end) - global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(])operator(.)ident(push)operator(()ident(filename)operator(\)) -reserved(end) - -global_variable($seen)operator(.)ident(keys)operator(.)ident(sort)operator(.)ident(each) reserved(do) operator(|)ident(devino)operator(|) - ident(ino)operator(,) ident(dev) operator(=) ident(devino) - reserved(if) global_variable($seen)operator([)ident(devino)operator(])operator(.)ident(length) operator(>) integer(1) - comment(# $seen[devino] is a list of filenames for the same file) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_9.5) -constant(Dir)operator(.)ident(open)operator(()ident(dirname)operator(\)) reserved(do) operator(|)ident(dir)operator(|) - ident(dir)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - comment(# do something with dirname/file) - ident(puts) ident(file) - reserved(end) -reserved(end) -comment(# Dir.close is automatic) - -comment(# No -T equivalent in Ruby) - -ident(dir)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - reserved(next) reserved(if) ident(file) operator(=)operator(~) regexp - comment(# ...) -reserved(end) - -reserved(def) method(plainfiles)operator(()ident(dir)operator(\)) - ident(dh) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(dir)operator(\)) - ident(dh)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\))operator(.) - ident(map) operator({)operator(|)ident(file)operator(|) stringcontent(/)inlinedelimiter(")>operator(})operator(.) - ident(find_all) operator({)operator(|)ident(file)operator(|) ident(test)operator(()integer(?f)operator(,) ident(file)operator(\))operator(})operator(.) - ident(sort) -reserved(end) - - -comment(# @@PLEAC@@_9.6) -ident(list) operator(=) constant(Dir)operator(.)ident(glob)operator(()stringoperator(\)) - -ident(dir) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(path)operator(\)) -ident(files) operator(=) ident(dir)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\)) -ident(dir)operator(.)ident(close) - -ident(files) operator(=) constant(Dir)operator(.)ident(glob)operator(()stringoperator(\)) -ident(files) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(path)operator(\))operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\)) - -ident(dir) operator(=) constant(Dir)operator(.)ident(new)operator(()ident(path)operator(\)) -ident(files) operator(=) ident(dir)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\)) - -reserved(begin) - ident(d) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(dir)operator(\)) -reserved(rescue) constant(Errno)operator(::)constant(ENOENT) - ident(raise) stringcontent( for reading: )inlinedelimiter(")> -reserved(end) - -ident(files) operator(=) operator([)operator(]) -ident(d)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - ident(puts) ident(file) - reserved(next) reserved(unless) ident(file) operator(=)operator(~) regexp - - ident(filename) operator(=) stringcontent(/)inlinedelimiter(")> - comment(# There is no -T equivalent in Ruby, but we can still test emptiness) - ident(files)operator(.)ident(push)operator(()ident(filename)operator(\)) reserved(if) ident(test)operator(()integer(?s)operator(,) ident(filename)operator(\)) -reserved(end) - -ident(dirs)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\))operator(.) - ident(map) operator({) operator(|)ident(file)operator(|) operator([)ident(file)operator(,) stringcontent(/)inlinedelimiter(")>operator(])operator(}) operator(.) - ident(select) operator({) operator(|)ident(file)operator(|) ident(test)operator(()integer(?d)operator(,) ident(file)operator([)integer(1)operator(])operator(\)) operator(})operator(.) - ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(})operator(.) - ident(map) operator({) operator(|)ident(file)operator(|) ident(file)operator([)integer(1)operator(]) operator(}) - - -comment(# @@PLEAC@@_9.7) -ident(require) string -constant(Find)operator(.)ident(find)operator(()ident(dirlist)operator(\)) reserved(do) operator(|)ident(file)operator(|) - comment(# do whatever) -reserved(end) - -ident(require) string -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) -constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) - ident(print) ident(file)operator(,) operator(()ident(test)operator(()integer(?d)operator(,) ident(file)operator(\)) operator(?) string operator(:) stringoperator(\)) -reserved(end) - -ident(require) string -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) -ident(sum) operator(=) integer(0) -constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) - ident(size) operator(=) ident(test)operator(()integer(?s)operator(,) ident(file)operator(\)) operator(||) integer(0) - ident(sum) operator(+=) ident(size) -reserved(end) -ident(puts) stringoperator(\))inline_delimiter(})>content( contains )inlinecontent( bytes)delimiter(")> - -ident(require) string -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) -ident(saved_size)operator(,) ident(saved_name) operator(=) integer(-1)operator(,) string -constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) - ident(size) operator(=) ident(test)operator(()integer(?s)operator(,) ident(file)operator(\)) operator(||) integer(0) - reserved(next) reserved(unless) ident(test)operator(()integer(?f)operator(,) ident(file)operator(\)) operator(&&) ident(size) operator(>) ident(saved_size) - ident(saved_size) operator(=) ident(size) - ident(saved_name) operator(=) ident(file) -reserved(end) -ident(puts) stringcontent( in )inlineoperator(\))inline_delimiter(})>content( is )inlinedelimiter(")> - -ident(require) string -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) -ident(age)operator(,) ident(name) operator(=) pre_constant(nil) -constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) - ident(mtime) operator(=) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(mtime) - reserved(next) reserved(if) ident(age) operator(&&) ident(age) operator(>) ident(mtime) - ident(age) operator(=) ident(mtime) - ident(name) operator(=) ident(file) -reserved(end) -ident(puts) stringcontent( )inlinedelimiter(")> - -comment(#-----------------------------) -doctype(#!/usr/bin/ruby -w) -comment(# fdirs - find all directories) -ident(require) string -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) -constant(File)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) operator({) operator(|)ident(file)operator(|) ident(puts) ident(file) reserved(if) ident(test)operator(()integer(?d)operator(,) ident(file)operator(\)) operator(}) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_9.8) -ident(require) string - -ident(puts) stringcontent( dir ...)delimiter(")> reserved(if) pre_constant(ARGV)operator(.)ident(empty?) -pre_constant(ARGV)operator(.)ident(each) reserved(do) operator(|)ident(dir)operator(|) - constant(FileUtils)operator(.)ident(rmtree)operator(()ident(dir)operator(\)) -reserved(end) - - -comment(# @@PLEAC@@_9.9) -ident(require) string -ident(names)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - ident(newname) operator(=) ident(file) - reserved(begin) - constant(File)operator(.)ident(move)operator(()ident(file)operator(,) ident(newname)operator(\)) - reserved(rescue) constant(Errno)operator(::)constant(EPERM) - global_variable($stderr)operator(.)ident(puts) stringcontent( to )inlinecontent(: )inlinedelimiter(")> - reserved(end) -reserved(end) - -ident(require) string -ident(op) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) operator(()ident(raise) stringoperator(\)) operator(:) pre_constant(ARGV)operator(.)ident(shift) -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) global_variable($stdin)operator(.)ident(readlines)operator(.)ident(map) operator({) operator(|)ident(f)operator(|) ident(f)operator(.)ident(chomp) operator(}) operator(:) pre_constant(ARGV) -ident(argv)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - ident(was) operator(=) ident(file) - ident(file) operator(=) ident(eval)operator(()stringdelimiter(")>operator(\)) - constant(File)operator(.)ident(move)operator(()ident(was)operator(,) ident(file)operator(\)) reserved(unless) ident(was) operator(==) ident(file) -reserved(end) - - -comment(# @@PLEAC@@_9.10) -ident(base) operator(=) constant(File)operator(.)ident(basename)operator(()ident(path)operator(\)) -ident(dir) operator(=) constant(File)operator(.)ident(dirname)operator(()ident(path)operator(\)) -comment(# ruby has no fileparse equivalent) -ident(dir)operator(,) ident(base) operator(=) constant(File)operator(.)ident(split)operator(()ident(path)operator(\)) -ident(ext) operator(=) ident(base)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(to_s) - -ident(path) operator(=) string -ident(file) operator(=) constant(File)operator(.)ident(basename)operator(()ident(path)operator(\)) -ident(dir) operator(=) constant(File)operator(.)ident(dirname)operator(()ident(path)operator(\)) - -ident(puts) stringcontent(, file is )inlinedelimiter(")> -comment(# dir is /usr/lib, file is libc.a) - -ident(path) operator(=) string -ident(dir)operator(,) ident(filename) operator(=) constant(File)operator(.)ident(split)operator(()ident(path)operator(\)) -ident(name)operator(,) ident(ext) operator(=) ident(filename)operator(.)ident(split)operator(()regexpoperator(\)) -ident(puts) stringcontent(, name is )inlinecontent(, ext is )inlinedelimiter(")> -comment(# NOTE: The Ruby code prints) -comment(# dir is /usr/lib, name is libc, extension is .a) -comment(# while the Perl code prints a '/' after the directory name) -comment(# dir is /usr/lib/, name is libc, extension is .a) - -comment(# No fileparse_set_fstype(\) equivalent in ruby) - -reserved(def) method(extension)operator(()ident(path)operator(\)) - ident(ext) operator(=) ident(path)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(to_s) - ident(ext)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) -reserved(end) - - -comment(# @@PLEAC@@_9.11) -comment(#-----------------------------) -doctype(#!/usr/bin/ruby -w) -comment(# symirror - build spectral forest of symlinks) - -ident(require) string -ident(require) string - -ident(raise) stringcontent( realdir mirrordir)delimiter(")> reserved(unless) pre_constant(ARGV)operator(.)ident(size) operator(==) integer(2) - -ident(srcdir)operator(,)ident(dstdir) operator(=) pre_constant(ARGV) -ident(srcmode) operator(=) constant(File)operator(::)ident(stat)operator(()ident(srcdir)operator(\))operator(.)ident(mode) -constant(Dir)operator(.)ident(mkdir)operator(()ident(dstdir)operator(,) ident(srcmode) operator(&) integer(07777)operator(\)) reserved(unless) ident(test)operator(()integer(?d)operator(,) ident(dstdir)operator(\)) - -comment(# fix relative paths) -constant(Dir)operator(.)ident(chdir)operator(()ident(srcdir)operator(\)) operator({)ident(srcdir) operator(=) constant(Dir)operator(.)ident(pwd)operator(}) -constant(Dir)operator(.)ident(chdir)operator(()ident(dstdir)operator(\)) operator({)ident(dstdir) operator(=) constant(Dir)operator(.)ident(pwd)operator(}) - -constant(Find)operator(.)ident(find)operator(()ident(srcdir)operator(\)) reserved(do) operator(|)ident(srcfile)operator(|) - reserved(if) ident(test)operator(()integer(?d)operator(,) ident(srcfile)operator(\)) - ident(dest) operator(=) ident(srcfile)operator(.)ident(sub)operator(()regexpdelimiter(/)>operator(,) ident(dstdir)operator(\)) - ident(dmode) operator(=) constant(File)operator(::)ident(stat)operator(()ident(srcfile)operator(\))operator(.)ident(mode) operator(&) integer(07777) - constant(Dir)operator(.)ident(mkdir)operator(()ident(dest)operator(,) ident(dmode)operator(\)) reserved(unless) ident(test)operator(()integer(?d)operator(,) ident(dest)operator(\)) - ident(a) operator(=) constant(Dir)operator([)stringcontent(/*)delimiter(")>operator(])operator(.)ident(reject)operator({)operator(|)ident(f)operator(|) ident(test)operator(()integer(?d)operator(,) ident(f)operator(\))operator(}) - constant(FileUtils)operator(.)ident(ln_s)operator(()ident(a)operator(,) ident(dest)operator(\)) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_9.12) -comment(# we use the Getopt/Declare library here for convenience:) -comment(# http://raa.ruby-lang.org/project/getoptdeclare/) -comment(#-----------------------------) -doctype(#!/usr/bin/ruby -w) -comment(# lst - list sorted directory contents (depth first\)) - -ident(require) string -ident(require) string -ident(require) string - -comment(# Note: in the option-spec below there must by at least one hard) -comment(# tab in between each -option and its description. For example) -comment(# -i read from stdin) - -ident(opts) operator(=) constant(Getopt)operator(::)constant(Declare)operator(.)ident(new)operator(()stringoperator(\))string - -global_variable($sort_criteria) operator(||=) symbol(:mtime) -ident(files) operator(=) operator({)operator(}) -constant(DIRS) operator(=) ident(opts)operator([)stringoperator(]) operator(?) global_variable($stdin)operator(.)ident(readlines)operator(.)ident(map)operator({)operator(|)ident(f)operator(|)ident(f)operator(.)ident(chomp!)operator(}) operator(:) pre_constant(ARGV) -constant(DIRS)operator(.)ident(each) reserved(do) operator(|)ident(dir)operator(|) - constant(Find)operator(.)ident(find)operator(()ident(dir)operator(\)) reserved(do) operator(|)ident(ent)operator(|) - ident(files)operator([)ident(ent)operator(]) operator(=) constant(File)operator(::)ident(stat)operator(()ident(ent)operator(\)) - reserved(end) -reserved(end) -ident(entries) operator(=) ident(files)operator(.)ident(keys)operator(.)ident(sort_by)operator({)operator(|)ident(f)operator(|) ident(files)operator([)ident(f)operator(])operator(.)ident(send)operator(()global_variable($sort_criteria)operator(\))operator(}) -ident(entries) operator(=) ident(entries)operator(.)ident(reverse) reserved(unless) ident(opts)operator([)stringoperator(]) - -ident(entries)operator(.)ident(each) reserved(do) operator(|)ident(ent)operator(|) - reserved(unless) ident(opts)operator([)stringoperator(]) - ident(puts) ident(ent) - reserved(next) - reserved(end) - ident(stats) operator(=) ident(files)operator([)ident(ent)operator(]) - ident(ftime) operator(=) ident(stats)operator(.)ident(send)operator(()global_variable($sort_criteria) operator(==) symbol(:size) operator(?) symbol(:mtime) operator(:) global_variable($sort_criteria)operator(\)) - ident(printf) stringoperator(,) - ident(stats)operator(.)ident(ino)operator(,) - ident(stats)operator(.)ident(mode) operator(&) integer(07777)operator(,) - ident(stats)operator(.)ident(nlink)operator(,) - constant(ETC)operator(::)constant(PASSWD)operator([)ident(stats)operator(.)ident(uid)operator(])operator(.)ident(name)operator(,) - constant(ETC)operator(::)constant(GROUP)operator([)ident(stats)operator(.)ident(gid)operator(])operator(.)ident(name)operator(,) - ident(stats)operator(.)ident(size)operator(,) - ident(ftime)operator(.)ident(strftime)operator(()stringoperator(\))operator(,) - ident(ent) -reserved(end) - - -comment(# @@PLEAC@@_10.0) -reserved(def) method(hello) - global_variable($greeted) operator(+=) integer(1) comment(# in Ruby, a variable beginning with $ is global (can be any type of course\)) - ident(puts) string -reserved(end) - -comment(# We need to initialize $greeted before it can be used, because "+=" is waiting a Numeric object) -global_variable($greeted) operator(=) integer(0) -ident(hello) comment(# note that appending (\) is optional to function calls with no parameters) - - -comment(# @@PLEAC@@_10.1) -comment(# In Ruby, parameters are named anyway) -reserved(def) method(hypotenuse)operator(()ident(side1)operator(,) ident(side2)operator(\)) - constant(Math)operator(.)ident(sqrt)operator(()ident(side1)operator(**)integer(2) operator(+) ident(side2)operator(**)integer(2)operator(\)) comment(# the sqrt function comes from the Math module) -reserved(end) -ident(diag) operator(=) ident(hypotenuse)operator(()integer(3)operator(,) integer(4)operator(\)) - -ident(puts) ident(hypotenuse)operator(()integer(3)operator(,) integer(4)operator(\)) - -ident(a) operator(=) operator([)integer(3)operator(,) integer(4)operator(]) -ident(print) ident(hypotenuse)operator(()operator(*)ident(a)operator(\)) comment(# the star operator will magically convert an Array into a "tuple") - -ident(both) operator(=) ident(men) operator(+) ident(women) - -comment(# In Ruby, all objects are references, so the same problem arises; we then return a new object) -ident(nums) operator(=) operator([)float(1.4)operator(,) float(3.5)operator(,) float(6.7)operator(]) -reserved(def) method(int_all)operator(()ident(n)operator(\)) - ident(n)operator(.)ident(collect) operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(to_i) operator(}) -reserved(end) -ident(ints) operator(=) ident(int_all)operator(()ident(nums)operator(\)) - -ident(nums) operator(=) operator([)float(1.4)operator(,) float(3.5)operator(,) float(6.7)operator(]) -reserved(def) method(trunc_em)operator(()ident(n)operator(\)) - ident(n)operator(.)ident(collect!) operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(to_i) operator(}) comment(# the bang-version of collect modifies the object) -reserved(end) -ident(trunc_em)operator(()ident(nums)operator(\)) - -comment(# Ruby has two chomp version:) -comment(# ``chomp'' chomps the record separator and returns what's expected) -comment(# ``chomp!'' does the same but also modifies the parameter object) - - -comment(# @@PLEAC@@_10.2) -reserved(def) method(somefunc) - ident(variable) operator(=) ident(something) comment(# variable is local by default) -reserved(end) - -ident(name)operator(,) ident(age) operator(=) pre_constant(ARGV) -ident(start) operator(=) ident(fetch_time) - -ident(a)operator(,) ident(b) operator(=) ident(pair) comment(# will succeed if pair is an Array object (like ARGV is\)) -ident(c) operator(=) ident(fetch_time) - -comment(# In ruby, run_check can't access a, b, or c until they are) -comment(# explicitely defined global (using leading $\), even if they are) -comment(# both defined in the same scope) - -reserved(def) method(check_x)operator(()ident(x)operator(\)) - ident(y) operator(=) string - ident(run_check) - reserved(if) global_variable($condition) - ident(puts) string - reserved(end) -reserved(end) - -comment(# The following will keep a reference to the array, though the) -comment(# results will be slightly different from perl: the last element) -comment(# of $global_array will be itself an array) -reserved(def) method(save_array)operator(()ident(ary)operator(\)) - global_variable($global_array) operator(<<) ident(ary) -reserved(end) - -comment(# The following gives the same results as in Perl for $global_array,) -comment(# though it doesn't illustrate anymore the way to keep a reference) -comment(# to an object: $global_array is extended with the elements of ary) -reserved(def) method(save_array)operator(()ident(ary)operator(\)) - global_variable($global_array) operator(+=) ident(ary) -reserved(end) - - -comment(# @@PLEAC@@_10.3) -comment(# In Ruby, AFAIK a method cannot access "local variables" defined) -comment(# upper scope; mostly because everything is an object, so you'll) -comment(# do the same by defining an attribute or a static attribute) - -comment(# In Ruby the BEGIN also exists:) -reserved(BEGIN) operator({) ident(puts) string operator(}) -ident(puts) string -reserved(BEGIN) operator({) ident(puts) string operator(}) -comment(# gives:) -comment(# hello from BEGIN) -comment(# hello from 2nd BEGIN) -comment(# hello from main) - -comment(# In Ruby, it can be written as a static method and a static) -comment(# variable) -reserved(class) class(Counter) - class_variable(@@counter) operator(=) integer(0) - reserved(def) constant(Counter)operator(.)method(next_counter)operator(;) class_variable(@@counter) operator(+=) integer(1)operator(;) reserved(end) -reserved(end) - -comment(# There is no need of BEGIN since the variable will get) -comment(# initialized when parsing) -reserved(class) class(Counter) - class_variable(@@counter) operator(=) integer(42) - reserved(def) constant(Counter)operator(.)method(next_counter)operator(;) class_variable(@@counter) operator(+=) integer(1)operator(;) reserved(end) - reserved(def) constant(Counter)operator(.)method(prev_counter)operator(;) class_variable(@@counter) operator(-=) integer(1)operator(;) reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_10.4) -comment(# You can either get the whole trace as an array of strings, each) -comment(# string telling which file, line and method is calling:) -ident(caller) - -comment(# ...or only the last caller) -ident(caller)operator([)integer(0)operator(]) - -comment(# We need to extract just the method name of the backtrace:) -reserved(def) method(whoami)operator(;) ident(caller)operator(()operator(\))operator([)integer(0)operator(]) operator(=)operator(~) regexp operator(?) global_variable($1) operator(:) stringoperator(;) reserved(end) -reserved(def) method(whowasi)operator(;) ident(caller)operator(()operator(\))operator([)integer(1)operator(]) operator(=)operator(~) regexp operator(?) global_variable($1) operator(:) stringoperator(;) reserved(end) - - -comment(# @@PLEAC@@_10.5) -comment(# In Ruby, every value is a reference on an object, thus there is) -comment(# no such problem) -ident(array_diff)operator(()ident(array1)operator(,) ident(array2)operator(\)) - -reserved(def) method(add_vecpair)operator(()ident(a1)operator(,) ident(a2)operator(\)) - ident(results) operator(=) operator([)operator(]) - ident(a1)operator(.)ident(each_index) operator({) operator(|)ident(i)operator(|) ident(results) operator(<<) operator(()ident(a1)operator([)ident(i)operator(]) operator(+) ident(a2)operator([)ident(i)operator(])operator(\)) operator(}) - ident(results) -reserved(end) -ident(a) operator(=) operator([)integer(1)operator(,) integer(2)operator(]) -ident(b) operator(=) operator([)integer(5)operator(,) integer(8)operator(]) -ident(c) operator(=) ident(add_vecpair)operator(()ident(a)operator(,) ident(b)operator(\)) -ident(p) ident(c) - -comment(# Add this to the beginning of the function to check if we were) -comment(# given two arrays) -ident(a1)operator(.)ident(type) operator(==) constant(Array) operator(&&) ident(a2)operator(.)ident(type) operator(==) constant(Array) reserved(or) - ident(raise) stringcontent( )inlinecontent(\))delimiter(")> - - -comment(# @@PLEAC@@_10.6) -comment(# There is no return context in Ruby) - - -comment(# @@PLEAC@@_10.7) -comment(# Like in Perl, we need to fake with a hash, but it's dirty :-() -reserved(def) method(thefunc)operator(()ident(param_args)operator(\)) - ident(args) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) integer(0) operator(}) - ident(args)operator(.)ident(update)operator(()ident(param_args)operator(\)) - reserved(if) operator(()ident(args)operator([)stringoperator(]) operator(=)operator(~) regexp operator(\)) - comment(# .....) - reserved(end) -reserved(end) - -ident(thefunc)operator(()operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(})operator(\)) -ident(thefunc)operator(()operator({)operator(})operator(\)) - - -comment(# @@PLEAC@@_10.8) -comment(# there is no "undef" direct equivalent but there is the slice equiv:) -ident(a)operator(,) ident(c) operator(=) ident(func)operator(.)ident(indexes)operator(()integer(0)operator(,) integer(2)operator(\)) - - -comment(# @@PLEAC@@_10.9) -comment(# Ruby has no such limitation:) -reserved(def) method(somefunc) - ident(ary) operator(=) operator([)operator(]) - ident(hash) operator(=) operator({)operator(}) - comment(# ...) - reserved(return) ident(ary)operator(,) ident(hash) -reserved(end) -ident(arr)operator(,) ident(dict) operator(=) ident(somefunc) - -ident(array_of_hashes) operator(=) ident(fn) -ident(h1)operator(,) ident(h2)operator(,) ident(h3) operator(=) ident(fn) - - -comment(# @@PLEAC@@_10.10) -reserved(return) -comment(# or (equivalent\)) -reserved(return) pre_constant(nil) - - -comment(# @@PLEAC@@_10.11) -comment(# You can't prototype in Ruby regarding types :-() -comment(# Though, you can force the number of arguments:) -reserved(def) method(func_with_no_arg)operator(;) reserved(end) -reserved(def) method(func_with_no_arg)operator(()operator(\))operator(;) reserved(end) -reserved(def) method(func_with_one_arg)operator(()ident(a1)operator(\))operator(;) reserved(end) -reserved(def) method(func_with_two_args)operator(()ident(a1)operator(,) ident(a2)operator(\))operator(;) reserved(end) -reserved(def) method(func_with_any_number_of_args)operator(()operator(*)ident(args)operator(\))operator(;) reserved(end) - - -comment(# @@PLEAC@@_10.12) -ident(raise) string comment(# raise exception) - -reserved(begin) - ident(val) operator(=) ident(func) -reserved(rescue) constant(Exception) operator(=)operator(>) ident(msg) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> -reserved(end) - -comment(# In Ruby the rescue statement uses an exception class, every) -comment(# exception which is not matched is still continuing) -reserved(begin) - ident(val) operator(=) ident(func) -reserved(rescue) constant(FullMoonError) - operator(...) -reserved(end) - - -comment(# @@PLEAC@@_10.13) -comment(# Saving Global Values) -comment(# Of course we can just save the value and restore it later:) -reserved(def) method(print_age) - ident(puts) stringdelimiter(")> -reserved(end) - -global_variable($age) operator(=) integer(18) comment(# global variable) -ident(print_age)operator(()operator(\)) -reserved(if) ident(condition) - ident(safeage) operator(=) global_variable($age) - global_variable($age) operator(=) integer(23) - ident(print_age)operator(()operator(\)) - global_variable($age) operator(=) ident(safeage) -reserved(end) - -comment(# We can also use a method that saves the global variable and) -comment(# restores it automatically when the block is left:) - -reserved(def) method(local)operator(()ident(var)operator(\)) - ident(eval)operator(()stringdelimiter(")>operator(\)) - reserved(begin) - ident(result) operator(=) reserved(yield) - reserved(ensure) - comment(# we want to call this even if we got an exception) - ident(eval)operator(()stringcontent( = save)delimiter(")>operator(\)) - reserved(end) - ident(result) -reserved(end) - -ident(condition) operator(=) pre_constant(true) -global_variable($age) operator(=) integer(18) -ident(print_age)operator(()operator(\)) -reserved(if) ident(condition) - ident(local)operator(()symbol(:$age)operator(\)) operator({) - global_variable($age) operator(=) integer(23) - ident(print_age)operator(()operator(\)) - operator(}) -reserved(end) -ident(print_age)operator(()operator(\)) - -comment(# There is no need to use local(\) for filehandles or directory) -comment(# handles in ruby because filehandles are normal objects.) - - -comment(# @@PLEAC@@_10.14) -comment(# In Ruby you may redefine a method [but not overload it :-(]) -comment(# just by defining again with the same name.) -reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) -reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) -ident(foo) -comment(#=> bar) - -comment(# You can also take a reference to an existing method before) -comment(# redefining a new one, using the `alias' keyword) -reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) -reserved(alias) method(foo_orig) method(foo) -reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) -ident(foo_orig) -ident(foo) -comment(#=> foo) -comment(#=> bar) - -comment(# AFAIK, there is no direct way to create a new method whose name) -comment(# comes from a variable, so use "eval") -ident(colors) operator(=) string -ident(colors)operator(.)ident(each) operator({) operator(|)ident(c)operator(|) - ident(eval) stringstringcontent((*a\) - "" + a.to_s + "" - end)delimiter( - EOS)> -operator(}) - - -comment(# @@PLEAC@@_10.15) -reserved(def) method(method_missing)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) - string)delimiter(")> operator(+) ident(args)operator(.)ident(join)operator(()stringoperator(\)) operator(+) string)delimiter(")> -reserved(end) -ident(puts) ident(chartreuse)operator(()stringoperator(\)) - - -comment(# @@PLEAC@@_10.16) -reserved(def) method(outer)operator(()ident(arg)operator(\)) - ident(x) operator(=) ident(arg) operator(+) integer(35) - ident(inner) operator(=) ident(proc) operator({) ident(x) operator(*) integer(19) operator(}) - ident(x) operator(+) ident(inner)operator(.)ident(call)operator(()operator(\)) -reserved(end) - - -comment(# @@PLEAC@@_10.17) -doctype(#!/usr/bin/ruby -w) -comment(# mailsort - sort mbox by different criteria) -ident(require) string -ident(require) string - -comment(# Objects of class Mail represent a single mail.) -reserved(class) class(Mail) - ident(attr_accessor) symbol(:no) - ident(attr_accessor) symbol(:subject) - ident(attr_accessor) symbol(:fulltext) - ident(attr_accessor) symbol(:date) - - reserved(def) method(initialize) - instance_variable(@fulltext) operator(=) string - instance_variable(@subject) operator(=) string - reserved(end) - - reserved(def) method(append)operator(()ident(para)operator(\)) - instance_variable(@fulltext) operator(<<) ident(para) - reserved(end) - - comment(# this is called if you call puts(mail\)) - reserved(def) method(to_s) - instance_variable(@fulltext) - reserved(end) -reserved(end) - -comment(# represents a list of mails.) -reserved(class) class(Mailbox) operator(<) constant(Array) - - constant(Subjectpattern) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(\)) - constant(Datepattern) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(\)) - - comment(# reads mails from open file and stores them) - reserved(def) method(read)operator(()ident(file)operator(\)) - global_variable($INPUT_RECORD_SEPARATOR) operator(=) string comment(# paragraph reads) - ident(msgno) operator(=) integer(-1) - ident(file)operator(.)ident(each) operator({) operator(|)ident(para)operator(|) - reserved(if) ident(para) operator(=)operator(~) regexp - ident(mail) operator(=) constant(Mail)operator(.)ident(new) - ident(mail)operator(.)ident(no) operator(=) operator(()ident(msgno) operator(+=) integer(1)operator(\)) - ident(md) operator(=) constant(Subjectpattern)operator(.)ident(match)operator(()ident(para)operator(\)) - reserved(if) ident(md) - ident(mail)operator(.)ident(subject) operator(=) ident(md)operator([)integer(1)operator(]) - reserved(end) - ident(md) operator(=) constant(Datepattern)operator(.)ident(match)operator(()ident(para)operator(\)) - reserved(if) ident(md) - ident(mail)operator(.)ident(date) operator(=) constant(DateTime)operator(.)ident(parse)operator(()ident(md)operator([)integer(1)operator(])operator(\)) - reserved(else) - ident(mail)operator(.)ident(date) operator(=) constant(DateTime)operator(.)ident(now) - reserved(end) - pre_constant(self)operator(.)ident(push)operator(()ident(mail)operator(\)) - reserved(end) - ident(mail)operator(.)ident(append)operator(()ident(para)operator(\)) reserved(if) ident(mail) - operator(}) - reserved(end) - - reserved(def) method(sort_by_subject_and_no) - pre_constant(self)operator(.)ident(sort_by) operator({) operator(|)ident(m)operator(|) - operator([)ident(m)operator(.)ident(subject)operator(,) ident(m)operator(.)ident(no)operator(]) - operator(}) - reserved(end) - - comment(# sorts by a list of attributs of mail, given as symbols) - reserved(def) method(sort_by_attributs)operator(()operator(*)ident(attrs)operator(\)) - comment(# you can sort an Enumerable by an array of) - comment(# values, they would be compared) - comment(# from ary[0] to ary[n]t, say:) - comment(# ['b',1] > ['a',10] > ['a',9]) - pre_constant(self)operator(.)ident(sort_by) operator({) operator(|)ident(elem)operator(|) - ident(attrs)operator(.)ident(map) operator({) operator(|)ident(attr)operator(|) - ident(elem)operator(.)ident(send)operator(()ident(attr)operator(\)) - operator(}) - operator(}) - reserved(end) - -reserved(end) - -ident(mailbox) operator(=) constant(Mailbox)operator(.)ident(new) -ident(mailbox)operator(.)ident(read)operator(()pre_constant(ARGF)operator(\)) - -comment(# print only subjects sorted by subject and number) -reserved(for) ident(m) reserved(in) ident(mailbox)operator(.)ident(sort_by_subject_and_no) - ident(puts)operator(()ident(m)operator(.)ident(subject)operator(\)) -reserved(end) - -comment(# print complete mails sorted by date, then subject, then number) -reserved(for) ident(m) reserved(in) ident(mailbox)operator(.)ident(sort_by_attributs)operator(()symbol(:date)operator(,) symbol(:subject)operator(\)) - ident(puts)operator(()ident(m)operator(\)) -reserved(end) - - -comment(# @@PLEAC@@_11.7) -reserved(def) method(mkcounter)operator(()ident(count)operator(\)) - ident(start) operator(=) ident(count) - ident(bundle) operator(=) operator({) - string operator(=)operator(>) ident(proc) operator({) ident(count) operator(+=) integer(1) operator(})operator(,) - string operator(=)operator(>) ident(proc) operator({) ident(count) operator(-=) integer(1) operator(})operator(,) - string operator(=)operator(>) ident(proc) operator({) ident(count) operator(=) ident(start) operator(}) - operator(}) - ident(bundle)operator([)stringoperator(]) operator(=) ident(bundle)operator([)stringoperator(]) - reserved(return) ident(bundle) -reserved(end) - -ident(c1) operator(=) ident(mkcounter)operator(()integer(20)operator(\)) -ident(c2) operator(=) ident(mkcounter)operator(()integer(77)operator(\)) - -ident(puts) stringoperator(])operator(.)ident(call)inline_delimiter(})>delimiter(")> comment(# 21 ) -ident(puts) stringoperator(])operator(.)ident(call)inline_delimiter(})>delimiter(")> comment(# 78 ) -ident(puts) stringoperator(])operator(.)ident(call)inline_delimiter(})>delimiter(")> comment(# 22 ) -ident(puts) stringoperator(])operator(.)ident(call)inline_delimiter(})>delimiter(")> comment(# 21 ) -ident(puts) stringoperator(])operator(.)ident(call)inline_delimiter(})>delimiter(")> comment(# 20 ) -ident(puts) stringoperator(])operator(.)ident(call)inline_delimiter(})>delimiter(")> comment(# 77 ) - - -comment(# @@PLEAC@@_11.15) -reserved(class) class(Binary_tree) - reserved(def) method(initialize)operator(()ident(val)operator(\)) - instance_variable(@value) operator(=) ident(val) - instance_variable(@left) operator(=) pre_constant(nil) - instance_variable(@right) operator(=) pre_constant(nil) - reserved(end) - - comment(# insert given value into proper point of) - comment(# provided tree. If no tree provided, ) - comment(# use implicit pass by reference aspect of @_) - comment(# to fill one in for our caller.) - reserved(def) method(insert)operator(()ident(val)operator(\)) - reserved(if) ident(val) operator(<) instance_variable(@value) reserved(then) - reserved(if) instance_variable(@left) reserved(then) - instance_variable(@left)operator(.)ident(insert)operator(()ident(val)operator(\)) - reserved(else) - instance_variable(@left) operator(=) constant(Binary_tree)operator(.)ident(new)operator(()ident(val)operator(\)) - reserved(end) - reserved(elsif) ident(val) operator(>) instance_variable(@value) reserved(then) - reserved(if) instance_variable(@right) reserved(then) - instance_variable(@right)operator(.)ident(insert)operator(()ident(val)operator(\)) - reserved(else) - instance_variable(@right) operator(=) constant(Binary_tree)operator(.)ident(new)operator(()ident(val)operator(\)) - reserved(end) - reserved(else) - ident(puts) string - comment(# do nothing, no double values) - reserved(end) - reserved(end) - - comment(# recurse on left child, ) - comment(# then show current value, ) - comment(# then recurse on right child. ) - reserved(def) method(in_order) - instance_variable(@left)operator(.)ident(in_order) reserved(if) instance_variable(@left) - ident(print) instance_variable(@value)operator(,) string - instance_variable(@right)operator(.)ident(in_order) reserved(if) instance_variable(@right) - reserved(end) - - comment(# show current value, ) - comment(# then recurse on left child, ) - comment(# then recurse on right child.) - reserved(def) method(pre_order) - ident(print) instance_variable(@value)operator(,) string - instance_variable(@left)operator(.)ident(pre_order) reserved(if) instance_variable(@left) - instance_variable(@right)operator(.)ident(pre_order) reserved(if) instance_variable(@right) - reserved(end) - - comment(# recurse on left child, ) - comment(# then recurse on right child,) - comment(# then show current value.) - reserved(def) method(post_order) - instance_variable(@left)operator(.)ident(post_order) reserved(if) instance_variable(@left) - instance_variable(@right)operator(.)ident(post_order) reserved(if) instance_variable(@right) - ident(print) instance_variable(@value)operator(,) string - reserved(end) - - comment(# find out whether provided value is in the tree.) - comment(# if so, return the node at which the value was found.) - comment(# cut down search time by only looking in the correct) - comment(# branch, based on current value.) - reserved(def) method(search)operator(()ident(val)operator(\)) - reserved(if) ident(val) operator(==) instance_variable(@value) reserved(then) - reserved(return) pre_constant(self) - reserved(elsif) ident(val) operator(<) instance_variable(@value) reserved(then) - reserved(return) instance_variable(@left)operator(.)ident(search)operator(()ident(val)operator(\)) reserved(if) instance_variable(@left) - reserved(return) pre_constant(nil) - reserved(else) - reserved(return) instance_variable(@right)operator(.)ident(search)operator(()ident(val)operator(\)) reserved(if) instance_variable(@right) - reserved(return) pre_constant(nil) - reserved(end) - reserved(end) -reserved(end) - -comment(# first generate 20 random inserts) -ident(test) operator(=) constant(Binary_tree)operator(.)ident(new)operator(()integer(0)operator(\)) -reserved(for) ident(a) reserved(in) integer(0)operator(..)integer(20) - ident(test)operator(.)ident(insert)operator(()ident(rand)operator(()integer(1000)operator(\))operator(\)) -reserved(end) - -comment(# now dump out the tree all three ways) -ident(print) stringoperator(;) ident(test)operator(.)ident(pre_order)operator(;) ident(puts) string -ident(print) stringoperator(;) ident(test)operator(.)ident(in_order)operator(;) ident(puts) string -ident(print) stringoperator(;) ident(test)operator(.)ident(post_order)operator(;) ident(puts) string - -ident(print) string -reserved(while) ident(gets) - ident(print) ident(test)operator(.)ident(search)operator(()global_variable($_)operator(.)ident(to_i)operator(\)) - ident(print) string -reserved(end) - - -comment(# @@PLEAC@@_12.0) -comment(# class and module names need to have the first letter capitalized) -reserved(module) class(Alpha) - constant(NAME) operator(=) string -reserved(end) -reserved(module) class(Omega) - constant(NAME) operator(=) string -reserved(end) -ident(puts) stringcontent(, Omega is )inlinedelimiter(")> - -comment(# ruby doesn't differentiate beteen compile-time and run-time) -ident(require) string -ident(require) string comment(# assumes the .rb) -ident(require) string -ident(require) string comment(# assumes the .rb) -ident(load) string comment(# require only loads the file once) - -reserved(module) class(Cards) - reserved(module) class(Poker) - instance_variable(@card_deck) operator(=) constant(Array)operator(.)ident(new) comment(# or @card_deck = []) - reserved(def) method(shuffle) - reserved(end) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_12.1) -comment(# a module exports all of its functions) -reserved(module) class(Your_Module) - reserved(def) pre_constant(self)operator(.)method(function) - comment(# this would be called as Your_Module.function) - reserved(end) - - reserved(def) constant(Your_Module)operator(.)method(another) - comment(# this is the same as above, but more specific) - reserved(end) -reserved(end) - -comment(# @@PLEAC@@_12.2) -reserved(begin) - ident(require) string -reserved(rescue) constant(LoadError) - ident(puts) stringdelimiter(")> comment(# $! contains the last error string) -reserved(end) - -comment(# @@PLEAC@@_12.4) -comment(# module variables are private unless access functions are defined) -reserved(module) class(Alpha) - instance_variable(@aa) operator(=) integer(10) - instance_variable(@bb) operator(=) integer(11) - - reserved(def) pre_constant(self)operator(.)method(put_aa) - ident(puts) instance_variable(@aa) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(bb=)operator(()ident(val)operator(\)) - instance_variable(@bb) operator(=) ident(val) - reserved(end) -reserved(end) - -constant(Alpha)operator(.)ident(bb) operator(=) integer(12) -comment(# Alpha.aa = 10 # error, no aa=method) - - -comment(# @@PLEAC@@_12.5) -comment(# caller provides a backtrace of the call stack) -reserved(module) class(MyModule) - reserved(def) method(find_caller) - ident(caller) - reserved(end) - - reserved(def) method(find_caller2)operator(()ident(i)operator(\)) - ident(caller)operator(()ident(i)operator(\)) comment(# an argument limits the size of the stack returned) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_12.6) -reserved(BEGIN) operator({) - global_variable($logfile) operator(=) string reserved(unless) reserved(defined?) global_variable($logfile) - global_variable($LF) operator(=) constant(File)operator(.)ident(open)operator(()global_variable($logfile)operator(,) stringoperator(\)) -operator(}) - -reserved(module) class(Logger) - reserved(def) pre_constant(self)operator(.)method(logmsg)operator(()ident(msg)operator(\)) - global_variable($LF)operator(.)ident(puts) ident(msg) - reserved(end) - - ident(logmsg)operator(()stringoperator(\)) -reserved(end) - -reserved(END) operator({) - constant(Logger)operator(::)ident(logmsg)operator(()stringoperator(\)) - global_variable($LF)operator(.)ident(close) -operator(}) - - -comment(# @@PLEAC@@_12.7) -comment(#-----------------------------) -comment(# results may be different on your system) -comment(# % ruby -e "$LOAD_PATH.each_index { |i| printf("%d %s\\n", i, $LOAD_PATH[i] }) -comment(#0 /usr/local/lib/site_ruby/1.6) -comment(#1 /usr/local/lib/site_ruby/1.6/i386-linux) -comment(#2 /usr/local/lib/site_ruby/) -comment(#3 /usr/lib/ruby/1.6) -comment(#4 /usr/lib/ruby/1.6/i136-linux) -comment(#5 .) -comment(#-----------------------------) -comment(# syntax for sh, bash, ksh, or zsh) -comment(#$ export RUBYLIB=$HOME/rubylib) - -comment(# syntax for csh or tcsh) -comment(# % setenv RUBYLIB ~/rubylib) -comment(#-----------------------------) -global_variable($LOAD_PATH)operator(.)ident(unshift) stringoperator(;) - - -comment(# @@PLEAC@@_12.8) -comment(# equivalents in ruby are mkmf, SWIG, or Ruby/DL depending on usage) - - -comment(# @@PLEAC@@_12.9) -comment(# no equivalent in ruby) - - -comment(# @@PLEAC@@_12.10) -comment(# no equivalent in ruby) - - -comment(# @@PLEAC@@_12.11) -reserved(module) class(FineTime) - reserved(def) pre_constant(self)operator(.)method(time) - comment(# to be defined later) - reserved(end) -reserved(end) - - -reserved(module) class(FineTime) - reserved(def) pre_constant(self)operator(.)method(time) - string - reserved(end) -reserved(end) - -ident(puts) constant(FineTime)operator(.)ident(time) comment(#=> "its a fine time") - - -comment(# @@PLEAC@@_12.12) -reserved(def) method(even_only)operator(()ident(n)operator(\)) - ident(raise) stringcontent( is not even)delimiter(")> reserved(if) operator(()ident(n) operator(&) integer(1)operator(\)) operator(!=) integer(0) comment(# one way to test) - comment(# ...) -reserved(end) -reserved(def) method(even_only)operator(()ident(n)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringcontent( is not even)delimiter(")> reserved(if) operator(()ident(n) operator(&) integer(1)operator(\)) operator(!=) integer(0) - comment(# ...) -reserved(end) - - -comment(# @@PLEAC@@_12.17) -comment(# The library archive for ruby is called Ruby Application archive,) -comment(# or shorter RAA, and can be found at http://raa.ruby-lang.org.) -comment(# A typical library is installed like this:) -comment(# % gunzip some-module-4.54.tar.gz) -comment(# % tar xf some-module-4.54.tar) -comment(# % cd some-module-4.54.tar) -comment(# % ruby install.rb config) -comment(# % ruby install.rb setup) -comment(# get superuser previleges here if needed for next step) -comment(# % ruby install.rb install) - -comment(# Some modules use a different process,) -comment(# you should find details in the documentation) -comment(# Here is an example of such a different process) -comment(# % ruby extconf.rb) -comment(# % make) -comment(# % make install) - -comment(# If you want the module installed in your own directory:) -comment(# For ruby version specific libraries) -comment(# % ruby install.rb config --site-ruby=~/lib) -comment(# For version independent libraries) -comment(# % ruby install.rb config --site-ruby-common=~/lib) - -comment(# Information about possible options for config) -comment(# % ruby install.rb --help) - -comment(# If you have your own complete distribution) -comment(# % ruby install.rb --prefix=path=~/ruby-private) - - -comment(# @@PLEAC@@_13.0) -comment(# Classes and objects in Ruby are rather straigthforward) -reserved(class) class(Person) - comment(# Class variables (also called static attributes\) are prefixed by @@) - class_variable(@@person_counter)operator(=)integer(0) - - comment(# object constructor) - reserved(def) method(initialize)operator(()ident(age)operator(,) ident(name)operator(,) ident(alive) operator(=) pre_constant(true)operator(\)) comment(# Default arg like in C++) - instance_variable(@age)operator(,) instance_variable(@name)operator(,) instance_variable(@alive) operator(=) ident(age)operator(,) ident(name)operator(,) ident(alive) comment(# Object attributes are prefixed by '@') - class_variable(@@person_counter) operator(+=) integer(1) - comment(# There is no '++' operator in Ruby. The '++'/'--' operators are in fact ) - comment(# hidden assignments which affect variables, not objects. You cannot accomplish) - comment(# assignment via method. Since everything in Ruby is object, '++' and '--' ) - comment(# contradict Ruby OO ideology. Instead '-=' and '+=' are used.) - reserved(end) - - ident(attr_accessor) symbol(:name)operator(,) symbol(:age) comment(# This creates setter and getter methods for @name) - comment(# and @age. See 13.3 for detailes.) - - comment(# methods modifying the receiver object usually have the '!' suffix) - reserved(def) method(die!) - instance_variable(@alive) operator(=) pre_constant(false) - ident(puts) stringcontent( has died at the age of )inlinecontent(.)delimiter(")> - instance_variable(@alive) - reserved(end) - - reserved(def) method(kill)operator(()ident(anotherPerson)operator(\)) - ident(print) instance_variable(@name)operator(,) stringoperator(,) ident(anotherPerson)operator(.)ident(name)operator(,) string - ident(anotherPerson)operator(.)ident(die!) - reserved(end) - - comment(# methods used as queries) - comment(# usually have the '?' suffix ) - reserved(def) method(alive?) - instance_variable(@alive) operator(&&) pre_constant(true) - reserved(end) - - reserved(def) method(year_of_birth) - constant(Time)operator(.)ident(now)operator(.)ident(year) operator(-) instance_variable(@age) - reserved(end) - - comment(# Class method (also called static method\)) - reserved(def) constant(Person)operator(.)method(number_of_people) - class_variable(@@person_counter) - reserved(end) -reserved(end) - -comment(# Using the class:) -comment(# Create objects of class Person) -ident(lecter) operator(=) constant(Person)operator(.)ident(new)operator(()integer(47)operator(,) stringoperator(\)) -ident(starling) operator(=) constant(Person)operator(.)ident(new)operator(()integer(29)operator(,) stringoperator(,) pre_constant(true)operator(\)) -ident(pazzi) operator(=) constant(Person)operator(.)ident(new)operator(()integer(40)operator(,) stringoperator(,) pre_constant(true)operator(\)) - -comment(# Calling a class method) -ident(print) stringoperator(,) constant(Person)operator(.)ident(number_of_people)operator(,) string - -ident(print) ident(pazzi)operator(.)ident(name)operator(,) stringoperator(,) operator(()ident(pazzi)operator(.)ident(alive?)operator(\)) operator(?) string operator(:) stringoperator(,) string -ident(lecter)operator(.)ident(kill)operator(()ident(pazzi)operator(\)) -ident(print) ident(pazzi)operator(.)ident(name)operator(,) stringoperator(,) operator(()ident(pazzi)operator(.)ident(alive?)operator(\)) operator(?) string operator(:) stringoperator(,) string - -ident(print) ident(starling)operator(.)ident(name) operator(,) stringoperator(,) ident(starling)operator(.)ident(year_of_birth)operator(,) string - - -comment(# @@PLEAC@@_13.1) -comment(# If you don't need any initialisation in the constructor,) -comment(# you don't need to write a constructor.) -reserved(class) class(MyClass) -reserved(end) - -reserved(class) class(MyClass) - reserved(def) method(initialize) - instance_variable(@start) operator(=) constant(Time)operator(.)ident(new) - instance_variable(@age) operator(=) integer(0) - reserved(end) -reserved(end) - -reserved(class) class(MyClass) - reserved(def) method(initialize)operator(()ident(inithash)operator(\)) - instance_variable(@start) operator(=) constant(Time)operator(.)ident(new) - instance_variable(@age) operator(=) integer(0) - reserved(for) ident(key)operator(,) ident(value) reserved(in) ident(inithash) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) ident(value)operator(\)) - reserved(end) - reserved(end) -reserved(end) - -comment(# @@PLEAC@@_13.2) -comment(# Objects are destroyed by the garbage collector.) -comment(# The time of destroying is not predictable.) -comment(# The ruby garbage collector can handle circular references,) -comment(# so there is no need to write destructor for that.) - -comment(# There is no direct support for destructor.) -comment(# You can call a custom function, or more specific a proc object, when the) -comment(# garbage collector is about to destruct the object, but it is unpredictable) -comment(# when this occurs.) -comment(# Also if such a finalizer object has a reference to the orignal object,) -comment(# this may prevent the original object to get garbage collected.) -comment(# Because of this problem the finalize method below is) -comment(# a class method and not a instance method.) -comment(# So if you need to free resources for an object, like) -comment(# closing a socket or kill a spawned subprocess,) -comment(# you should do it explicitly.) - -reserved(class) class(MyClass) - reserved(def) method(initialize) - constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) - pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) - reserved(end) - reserved(def) constant(MyClass)operator(.)method(finalize)operator(()ident(id)operator(\)) - ident(puts) stringcontent( dying at )inlinedelimiter(")> - reserved(end) -reserved(end) - -comment(# test code) -integer(3)operator(.)ident(times) operator({) - constant(MyClass)operator(.)ident(new) -operator(}) -constant(ObjectSpace)operator(.)ident(garbage_collect) - - -comment(# @@PLEAC@@_13.3) -comment(# You can write getter and setter methods in a natural way:) -reserved(class) class(Person) - reserved(def) method(name) - instance_variable(@name) - reserved(end) - reserved(def) method(name=)operator(()ident(name)operator(\)) - instance_variable(@name) operator(=) ident(name) - reserved(end) -reserved(end) - -comment(# But there is a better and shorter way) -reserved(class) class(Person) - ident(attr_reader) symbol(:age) - ident(attr_writer) symbol(:name) - comment(# attr_reader and attr_writer are actually methods in class Class) - comment(# which set getter and setter methods for you.) -reserved(end) - -comment(# There is also attr_accessor to create both setters and getters) -reserved(class) class(Person) - ident(attr_accessor) symbol(:age)operator(,) symbol(:name) -reserved(end) - - -comment(# @@PLEAC@@_13.4) -reserved(class) class(Person) - comment(# Class variables (also called static attributes\) are prefixed by @@) - class_variable(@@person_counter) operator(=) integer(0) - - reserved(def) constant(Person)operator(.)method(population) - class_variable(@@person_counter) - reserved(end) - reserved(def) method(initialize) - class_variable(@@person_counter) operator(+=) integer(1) - constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) - pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) - reserved(end) - reserved(def) constant(Person)operator(.)method(finalize)operator(()ident(id)operator(\)) - class_variable(@@person_counter) operator(-=) integer(1) - reserved(end) -reserved(end) -ident(people) operator(=) operator([)operator(]) -integer(10)operator(.)ident(times) operator({) - ident(people)operator(.)ident(push)operator(()constant(Person)operator(.)ident(new)operator(\)) -operator(}) -ident(printf)operator(()stringoperator(,) constant(Person)operator(.)ident(population)operator(\)) - - -constant(FixedArray)operator(.)ident(class_max_bounds) operator(=) integer(100) -ident(alpha) operator(=) constant(FixedArray)operator(.)ident(new) -ident(puts) stringdelimiter(")> - -ident(beta) operator(=) constant(FixedArray)operator(.)ident(new) -ident(beta)operator(.)ident(max_bounds) operator(=) integer(50) comment(# calls the instance method) -ident(beta)operator(.)ident(class)operator(.)ident(class_max_bounds) operator(=) integer(50) comment(# alternative, calls the class method) -ident(puts) stringdelimiter(")> - -reserved(class) class(FixedArray) - class_variable(@@bounds) operator(=) integer(7) - - reserved(def) method(max_bounds) - class_variable(@@max_bounds) - reserved(end) - comment(# instance method, which sets the class variable) - reserved(def) method(max_bounds=)operator(()ident(value)operator(\)) - class_variable(@@max_bounds) operator(=) ident(value) - reserved(end) - comment(# class method. This can only be called on a class,) - comment(# but not on the instances) - reserved(def) constant(FixedArray)operator(.)method(class_max_bounds=)operator(()ident(value)operator(\)) - class_variable(@@max_bounds) operator(=) ident(value) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_13.5) -constant(PersonStruct) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:name)operator(,) symbol(:age)operator(,) symbol(:peers)operator(\)) -comment(# creates a class "Person::Struct", which is accessiable with the) -comment(# constant "PersonStruct") -ident(p) operator(=) constant(PersonStruct)operator(.)ident(new) -ident(p) operator(=) constant(Struct)operator(::)constant(Person)operator(.)ident(new) comment(# alternative using the classname) -ident(p)operator(.)ident(name) operator(=) string -ident(p)operator(.)ident(age) operator(=) integer(13) -ident(p)operator(.)ident(peers) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) -ident(p)operator([)symbol(:peers)operator(]) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) comment(# alternative access using symbol) -ident(p)operator([)stringoperator(]) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) comment(# alternative access using name of field) -ident(p)operator([)integer(2)operator(]) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) comment(# alternative access using index of field) -ident(puts) stringcontent(, )inlinecontent('s first friend is )inlinedelimiter(")> - -comment(# The fields of a struct have no special type, like other ruby variables) -comment(# you can put any objects in. Therefore the discussions how to specify) -comment(# the types of the fields do not apply to ruby.) - -constant(FamilyStruct) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:head)operator(,) symbol(:address)operator(,) symbol(:members)operator(\)) -ident(folks) operator(=) constant(FamilyStruct)operator(.)ident(new) -ident(folks)operator(.)ident(head) operator(=) constant(PersonStruct)operator(.)ident(new) -ident(dad) operator(=) ident(folks)operator(.)ident(head) -ident(dad)operator(.)ident(name) operator(=) string -ident(dad)operator(.)ident(age) operator(=) integer(34) - -comment(# supply of own accessor method for the struct for error checking) -reserved(class) class(PersonStruct) - reserved(def) method(age=)operator(()ident(value)operator(\)) - reserved(if) operator(!)ident(value)operator(.)ident(kind_of?)operator(()constant(Integer)operator(\)) - ident(raise)operator(()constant(ArgumentError)operator(,) stringcontent( isn't an Integer)delimiter(")>operator(\)) - reserved(elsif) ident(value) operator(>) integer(150) - ident(raise)operator(()constant(ArgumentError)operator(,) stringcontent( is unreasonable)delimiter(")>operator(\)) - reserved(end) - instance_variable(@age) operator(=) ident(value) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_13.6) -comment(# The ruby Object class defines a dup and a clone method.) -comment(# The dup method is recommended for prototype object creation.) -comment(# The default implementation makes a shallow copy,) -comment(# but each class can override it, for example to make a deep copy.) - -comment(# If you want to call 'new' directly on the instances,) -comment(# you can create a instance method "new", which returns a new duplicate.) -comment(# This method is distinct from the class method new.) -comment(#) -reserved(class) class(A) - reserved(def) method(new) - ident(dup) - reserved(end) -reserved(end) - -ident(ob1) operator(=) constant(A)operator(.)ident(new) -comment(# later on) -ident(ob2) operator(=) ident(ob1)operator(.)ident(new) - - -comment(# @@PLEAC@@_13.7) -ident(methname) operator(=) string -ident(obj)operator(.)ident(send)operator(()ident(methname)operator(,) integer(10)operator(\)) comment(# calls obj.flicker(10\)) - -comment(# call three methods on the object, by name) -operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(.)ident(each) reserved(do) operator(|)ident(method_string)operator(|) - ident(obj)operator(.)ident(send)operator(()ident(method_string)operator(\)) -reserved(end) - -comment(# Another way is to create a Method object) -ident(method_obj) operator(=) ident(obj)operator(.)ident(method)operator(()stringoperator(\)) -comment(# And then call it) -ident(method_obj)operator(.)ident(call)operator(()integer(10)operator(\)) - - -comment(# @@PLEAC@@_13.8) -comment(# All classes in Ruby inherit from class Object) -comment(# and thus all objects share methods defined in this class) - -comment(# the class of the object) -ident(puts) ident(any_object)operator(.)ident(type) - -comment(# Ruby classes are actually objects of class Class and they) -comment(# respond to methods defined in Object class as well) - -comment(# the superclass of this class) -ident(puts) ident(any_object)operator(.)ident(class)operator(.)ident(superclass) - -comment(# ask an object whether it is an instance of particular class) -ident(n) operator(=) float(4.7) -ident(puts) ident(n)operator(.)ident(instance_of?)operator(()constant(Float)operator(\)) comment(# true) -ident(puts) ident(n)operator(.)ident(instance_of?)operator(()constant(Numeric)operator(\)) comment(# false) - -comment(# ask an object whether it is an instance of class, one of the) -comment(# superclasses of the object, or modules included in it) -ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(Float)operator(\)) comment(# true (the class\)) -ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(Numeric)operator(\)) comment(# true (an ancestor class\)) -ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(Comparable)operator(\)) comment(# true (a mixin module\)) -ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) comment(# false) - -comment(# ask an object whether it can respond to a particular method) -ident(puts) ident(n)operator(.)ident(respond_to?)operator(()stringoperator(\)) comment(# true) -ident(puts) ident(n)operator(.)ident(respond_to?)operator(()stringoperator(\)) comment(# false) - -comment(# all methods an object can respond to) -stringoperator(.)ident(methods)operator(.)ident(each) operator({) operator(|)ident(m)operator(|) ident(puts) ident(m) operator(}) - - -comment(# @@PLEAC@@_13.9) -comment(# Actually any class in Ruby is inheritable) -reserved(class) class(Person) - ident(attr_accessor) symbol(:age)operator(,) symbol(:name) - reserved(def) method(initialize) - instance_variable(@name) - instance_variable(@age) - reserved(end) -reserved(end) -comment(#-----------------------------) -ident(dude) operator(=) constant(Person)operator(.)ident(new) -ident(dude)operator(.)ident(name) operator(=) string -ident(dude)operator(.)ident(age) operator(=) integer(23) -ident(printf) stringoperator(,) ident(dude)operator(.)ident(name)operator(,) ident(dude)operator(.)ident(age) -comment(#-----------------------------) -comment(# Inheriting from Person) -reserved(class) class(Employee) operator(<) constant(Person) - ident(attr_accessor) symbol(:salary) -reserved(end) -comment(#-----------------------------) -ident(empl) operator(=) constant(Employee)operator(.)ident(new) -ident(empl)operator(.)ident(name) operator(=) string -ident(empl)operator(.)ident(age) operator(=) integer(23) -ident(empl)operator(.)ident(salary) operator(=) integer(200) -ident(printf) stringoperator(,) ident(empl)operator(.)ident(name)operator(,) ident(empl)operator(.)ident(age)operator(,) ident(empl)operator(.)ident(salary) -comment(#-----------------------------) -comment(# Any built-in class can be inherited the same way) -reserved(class) class(WeirdString) operator(<) constant(String) - reserved(def) method(initialize)operator(()ident(obj)operator(\)) - reserved(super) ident(obj) - reserved(end) - reserved(def) method(+)operator(()ident(anotherObj)operator(\)) comment(# + method in this class is overridden) - comment(# to return the sum of string lengths) - pre_constant(self)operator(.)ident(length) operator(+) ident(anotherObj)operator(.)ident(length) comment(# 'self' can be omitted) - reserved(end) -reserved(end) -comment(#-----------------------------) -ident(a) operator(=) constant(WeirdString)operator(.)ident(new)operator(()stringoperator(\)) -ident(b) operator(=) constant(WeirdString)operator(.)ident(new)operator(()stringoperator(\)) - -ident(puts) ident(a) operator(+) ident(b) comment(# the overridden +) -comment(#=> 8) -ident(puts) ident(a)operator(.)ident(length) comment(# method from the superclass, String) -comment(#=> 5) - - -comment(# @@PLEAC@@_13.11) -comment(# In ruby you can override the method_missing method) -comment(# to have a solution similar to perls AUTOLOAD.) -reserved(class) class(Person) - - reserved(def) method(initialize) - instance_variable(@ok_fields) operator(=) string - reserved(end) - - reserved(def) method(valid_attribute?)operator(()ident(name)operator(\)) - instance_variable(@ok_fields)operator(.)ident(include?)operator(()ident(name)operator(\)) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(namesymbol)operator(,) operator(*)ident(params)operator(\)) - ident(name) operator(=) ident(namesymbol)operator(.)ident(to_s) - reserved(return) reserved(if) ident(name) operator(=)operator(~) regexp - reserved(if) ident(name)operator(.)ident(to_s)operator([)integer(-1)operator(]) operator(==) operator(()stringoperator([)integer(0)operator(])operator(\)) comment(# we have a setter) - ident(isSetter) operator(=) pre_constant(true) - ident(name)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - reserved(if) ident(valid_attribute?)operator(()ident(name)operator(\)) - reserved(if) ident(isSetter) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) operator(*)ident(params)operator(\)) - reserved(else) - ident(instance_variable_get)operator(()stringdelimiter(")>operator(,) operator(*)ident(params)operator(\)) - reserved(end) - reserved(else) - comment(# if no annestor is responsible,) - comment(# the Object class will throw a NoMethodError exception) - reserved(super)operator(()ident(namesymbol)operator(,) operator(*)ident(params)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(new) - ident(kid) operator(=) constant(Person)operator(.)ident(new) - ident(kid)operator(.)ident(parent) operator(=) pre_constant(self) - ident(kid) - reserved(end) - -reserved(end) - -ident(dad) operator(=) constant(Person)operator(.)ident(new) -ident(dad)operator(.)ident(name) operator(=) string -ident(dad)operator(.)ident(age) operator(=) integer(23) -ident(kid) operator(=) ident(dad)operator(.)ident(new) -ident(kid)operator(.)ident(name) operator(=) string -ident(kid)operator(.)ident(age) operator(=) integer(2) -ident(puts) stringdelimiter(")> -ident(puts) ident(dad) -ident(puts) ident(kid) - -reserved(class) class(Employee) operator(<) constant(Person) - reserved(def) method(initialize) - reserved(super) - instance_variable(@ok_fields)operator(.)ident(push)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - reserved(def) method(ok_fields) - instance_variable(@ok_fields) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_13.13) -comment(# The ruby garbage collector pretends to cope with circular structures.) -comment(# You can test it with this code:) -reserved(class) class(RingNode) - ident(attr_accessor) symbol(:next) - ident(attr_accessor) symbol(:prev) - ident(attr_reader) symbol(:name) - - reserved(def) method(initialize)operator(()ident(aName)operator(\)) - instance_variable(@name) operator(=) ident(aName) - constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) - pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) - reserved(end) - - reserved(def) constant(RingNode)operator(.)method(finalize)operator(()ident(id)operator(\)) - ident(puts) stringcontent( dying)delimiter(")> - reserved(end) - - reserved(def) constant(RingNode)operator(.)method(show_all_objects) - constant(ObjectSpace)operator(.)ident(each_object) operator({)operator(|)ident(id)operator(|) - ident(puts) ident(id)operator(.)ident(name) reserved(if) ident(id)operator(.)ident(class) operator(==) constant(RingNode) - operator(}) - reserved(end) -reserved(end) - -reserved(def) method(create_test) - ident(a) operator(=) constant(RingNode)operator(.)ident(new)operator(()stringoperator(\)) - ident(b) operator(=) constant(RingNode)operator(.)ident(new)operator(()stringoperator(\)) - ident(c) operator(=) constant(RingNode)operator(.)ident(new)operator(()stringoperator(\)) - ident(a)operator(.)ident(next) operator(=) ident(b) - ident(b)operator(.)ident(next) operator(=) ident(c) - ident(c)operator(.)ident(next) operator(=) ident(a) - ident(a)operator(.)ident(prev) operator(=) ident(c) - ident(c)operator(.)ident(prev) operator(=) ident(b) - ident(b)operator(.)ident(prev) operator(=) ident(a) - - ident(a) operator(=) pre_constant(nil) - ident(b) operator(=) pre_constant(nil) - ident(c) operator(=) pre_constant(nil) -reserved(end) - -ident(create_test) -constant(RingNode)operator(.)ident(show_all_objects) -constant(ObjectSpace)operator(.)ident(garbage_collect) -ident(puts) string -constant(RingNode)operator(.)ident(show_all_objects) - - -comment(# @@PLEAC@@_13.14) -reserved(class) class(String) - reserved(def) method(<=>)operator(()ident(other)operator(\)) - pre_constant(self)operator(.)ident(casecmp) ident(other) - reserved(end) -reserved(end) - -comment(# There is no way to directly overload the '""' (stringify\) ) -comment(# operator in Ruby. However, by convention, classes which ) -comment(# can reasonably be converted to a String will define a ) -comment(# 'to_s' method as in the TimeNumber class defined below.) -comment(# The 'puts' method will automatcally call an object's) -comment(# 'to_s' method as is demonstrated below.) -comment(# Furthermore, if a class defines a to_str method, an object of that) -comment(# class can be used most any place where the interpreter is looking ) -comment(# for a String value.) - -comment(#---------------------------------------) -comment(# NOTE: Ruby has a builtin Time class which would usually be used ) -comment(# to manipulate time objects, the following is supplied for) -comment(# educational purposes to demonstrate operator overloading.) -comment(#) -reserved(class) class(TimeNumber) - ident(attr_accessor) symbol(:hours)operator(,)symbol(:minutes)operator(,)symbol(:seconds) - reserved(def) method(initialize)operator(() ident(hours)operator(,) ident(minutes)operator(,) ident(seconds)operator(\)) - instance_variable(@hours) operator(=) ident(hours) - instance_variable(@minutes) operator(=) ident(minutes) - instance_variable(@seconds) operator(=) ident(seconds) - reserved(end) - - reserved(def) method(to_s) - reserved(return) ident(sprintf)operator(() stringoperator(,) instance_variable(@hours)operator(,) instance_variable(@minutes)operator(,) instance_variable(@seconds)operator(\)) - reserved(end) - - reserved(def) method(to_str) - ident(to_s) - reserved(end) - - reserved(def) method(+)operator(() ident(other)operator(\)) - ident(seconds) operator(=) instance_variable(@seconds) operator(+) ident(other)operator(.)ident(seconds) - ident(minutes) operator(=) instance_variable(@minutes) operator(+) ident(other)operator(.)ident(minutes) - ident(hours) operator(=) instance_variable(@hours) operator(+) ident(other)operator(.)ident(hours) - reserved(if) ident(seconds) operator(>)operator(=) integer(60) - ident(seconds) operator(%=) integer(60) - ident(minutes) operator(+=) integer(1) - reserved(end) - reserved(if) ident(minutes) operator(>)operator(=) integer(60) - ident(minutes) operator(%=) integer(60) - ident(hours) operator(+=) integer(1) - reserved(end) - reserved(return) constant(TimeNumber)operator(.)ident(new)operator(()ident(hours)operator(,) ident(minutes)operator(,) ident(seconds)operator(\)) - reserved(end) - - reserved(def) method(-)operator(()ident(other)operator(\)) - ident(raise) constant(NotImplementedError) - reserved(end) - - reserved(def) method(*)operator(()ident(other)operator(\)) - ident(raise) constant(NotImplementedError) - reserved(end) - - reserved(def) method(/)operator(() ident(other)operator(\)) - ident(raise) constant(NotImplementedError) - reserved(end) -reserved(end) - -ident(t1) operator(=) constant(TimeNumber)operator(.)ident(new)operator(()integer(0)operator(,) integer(58)operator(,) integer(59)operator(\)) -ident(sec) operator(=) constant(TimeNumber)operator(.)ident(new)operator(()integer(0)operator(,) integer(0)operator(,) integer(1)operator(\)) -ident(min) operator(=) constant(TimeNumber)operator(.)ident(new)operator(()integer(0)operator(,) integer(1)operator(,) integer(0)operator(\)) -ident(puts) ident(t1) operator(+) ident(sec) operator(+) ident(min) operator(+) ident(min) - -comment(#-----------------------------) -comment(# StrNum class example: Ruby's builtin String class already has the ) -comment(# capabilities outlined in StrNum Perl example, however the '*' operator) -comment(# on Ruby's String class acts differently: It creates a string which) -comment(# is the original string repeated N times.) -comment(#) -comment(# Using Ruby's String class as is in this example:) -ident(x) operator(=) stringoperator(;) ident(y) operator(=) string -ident(z) operator(=) ident(x)operator(+)ident(y) -ident(r) operator(=) ident(z)operator(*)integer(3) comment(# r is "RedBlackRedBlackRedBlack") -ident(puts) stringcontent(, )inlinecontent(, )inlinecontent(, and )inlinedelimiter(")> -ident(print) stringcontent( is )delimiter(")>operator(,) ident(x) operator(<) ident(y) operator(?) string operator(:) stringoperator(,) stringchar(\\n)delimiter(")> -comment(# prints:) -comment(# values are Red, Black, RedBlack, and RedBlackRedBlackRedBlack) -comment(# Red is GE Black) - -comment(#-----------------------------) -reserved(class) class(FixNum) - constant(REGEX) operator(=) regexp - constant(DEFAULT_PLACES) operator(=) integer(0) - ident(attr_accessor) symbol(:value)operator(,) symbol(:places) - reserved(def) method(initialize)operator(()ident(value)operator(,) ident(places) operator(=) pre_constant(nil)operator(\)) - instance_variable(@value) operator(=) ident(value) - reserved(if) ident(places) - instance_variable(@places) operator(=) ident(places) - reserved(else) - ident(m) operator(=) constant(REGEX)operator(.)ident(match)operator(()ident(value)operator(.)ident(to_s)operator(\)) - reserved(if) ident(m) - instance_variable(@places) operator(=) ident(m)operator([)integer(0)operator(])operator(.)ident(length) operator(-) integer(1) - reserved(else) - instance_variable(@places) operator(=) constant(DEFAULT_PLACES) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(+)operator(()ident(other)operator(\)) - constant(FixNum)operator(.)ident(new)operator(()instance_variable(@value) operator(+) ident(other)operator(.)ident(value)operator(,) ident(max)operator(()instance_variable(@places)operator(,) ident(other)operator(.)ident(places)operator(\))operator(\)) - reserved(end) - - reserved(def) method(*)operator(()ident(other)operator(\)) - constant(FixNum)operator(.)ident(new)operator(()instance_variable(@value) operator(*) ident(other)operator(.)ident(value)operator(,) ident(max)operator(()instance_variable(@places)operator(,) ident(other)operator(.)ident(places)operator(\))operator(\)) - reserved(end) - - reserved(def) method(/)operator(()ident(other)operator(\)) - ident(puts) stringdelimiter(")> - ident(result) operator(=) constant(FixNum)operator(.)ident(new)operator(()instance_variable(@value)operator(.)ident(to_f)operator(/)ident(other)operator(.)ident(value)operator(.)ident(to_f)operator(\)) - ident(result)operator(.)ident(places) operator(=) ident(max)operator(()ident(result)operator(.)ident(places)operator(,)ident(other)operator(.)ident(places)operator(\)) - ident(result) - reserved(end) - - reserved(def) method(to_s) - ident(sprintf)operator(()stringoperator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(to_s) operator(,) instance_variable(@places)operator(,) instance_variable(@value)operator(\)) comment(#.) - reserved(end) - - reserved(def) method(to_str) - ident(to_s) - reserved(end) - - reserved(def) method(to_i) comment(#convert to int) - instance_variable(@value)operator(.)ident(to_i) - reserved(end) - - reserved(def) method(to_f) comment(#convert to float`) - instance_variable(@value)operator(.)ident(to_f) - reserved(end) - - ident(private) - reserved(def) method(max)operator(()ident(a)operator(,)ident(b)operator(\)) - ident(a) operator(>) ident(b) operator(?) ident(a) operator(:) ident(b) - reserved(end) -reserved(end) - -reserved(def) method(demo)operator(()operator(\)) - ident(x) operator(=) constant(FixNum)operator(.)ident(new)operator(()integer(40)operator(\)) - ident(y) operator(=) constant(FixNum)operator(.)ident(new)operator(()integer(12)operator(,) integer(0)operator(\)) - - ident(puts) stringcontent( and )inlinecontent( is )inlinedelimiter(")> - ident(puts) stringcontent( and )inlinecontent( is )inlinedelimiter(")> - - ident(z) operator(=) ident(x)operator(/)ident(y) - ident(puts) stringcontent( has )inlinecontent( places)delimiter(")> - reserved(unless) ident(z)operator(.)ident(places) - ident(z)operator(.)ident(places) operator(=) integer(2) - reserved(end) - - ident(puts) stringcontent( by )inlinecontent( is )inlinedelimiter(")> - ident(puts) stringdelimiter(")> -reserved(end) - -reserved(if) pre_constant(__FILE__) operator(==) global_variable($0) - ident(demo)operator(()operator(\)) -reserved(end) - - -comment(# @@PLEAC@@_14.1) -comment(# There are dbm, sdbm, gdbm modules) -comment(# and the bdb module for accessing the berkeley db) -comment(# sdbm seem to be available on the most systems,) -comment(# so we use it here) -comment(#) -ident(require) string -constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) operator({) operator(|)ident(dbobj)operator(|) - comment(# raises exception if open error) - - comment(# the returned sdbm-dbobj has most of the methods of a hash) - ident(v) operator(=) ident(dbobj)operator([)stringoperator(]) - ident(dbobj)operator([)stringoperator(]) operator(=) string - reserved(if) ident(dbobj)operator(.)ident(has_key?)operator(()stringoperator(\)) - comment(# ...) - reserved(end) - ident(dbobj)operator(.)ident(delete)operator(()stringoperator(\)) -operator(}) -comment(# database is open only inside the block.) - -comment(# It is also possible to use a open .. close pair:) -ident(dbobj) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) -comment(#.. do something with dbobj) -ident(dbobj)operator(.)ident(close) - -doctype(#!/usr/bin/ruby -w) -comment(# userstats - generate statistics on who is logged in) -comment(# call with usernames as argument to display the totals) -comment(# for the given usernames, call with "ALL" to display all users) - -ident(require) string -ident(filename) operator(=) string -constant(SDBM)operator(.)ident(open)operator(()ident(filename)operator(,) integer(0666)operator(\)) operator({) operator(|)ident(dbobj)operator(|) - reserved(if) pre_constant(ARGV)operator(.)ident(length) operator(>) integer(0) - reserved(if) pre_constant(ARGV)operator([)integer(0)operator(]) operator(==) string - comment(# ARGV is constant, so we need the variable userlist) - ident(userlist) operator(=) ident(dbobj)operator(.)ident(keys)operator(()operator(\))operator(.)ident(sort)operator(()operator(\)) - reserved(else) - ident(userlist) operator(=) pre_constant(ARGV) - reserved(end) - ident(userlist)operator(.)ident(each) operator({) operator(|)ident(user)operator(|) - ident(print) stringchar(\\t)inlinechar(\\n)delimiter(")> - operator(}) - reserved(else) - ident(who) operator(=) shell - ident(who)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(line)operator(|) - ident(md) operator(=) regexpoperator(.)ident(match)operator(()ident(line)operator(\)) - ident(raise) stringdelimiter(")> reserved(unless) ident(md) - comment(# sdbm stores only strings, so "+=" doesn't work,) - comment(# we need to convert them expicitly back to integer.) - reserved(if) ident(dbobj)operator(.)ident(has_key?)operator(()ident(md)operator([)integer(0)operator(])operator(\)) - ident(dbobj)operator([)ident(md)operator([)integer(0)operator(])operator(]) operator(=) ident(dbobj)operator([)ident(md)operator([)integer(0)operator(])operator(])operator(.)ident(to_i) operator(+) integer(1) - reserved(else) - ident(dbobj)operator([)ident(md)operator([)integer(0)operator(])operator(]) operator(=) string - reserved(end) - operator(}) - reserved(end) -operator(}) - - -comment(# @@PLEAC@@_14.2) -comment(# using open and clear) -ident(dbobj) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) -ident(dbobj)operator(.)ident(clear)operator(()operator(\)) -ident(dbobj)operator(.)ident(close)operator(()operator(\)) -comment(# deleting file and recreating it) -comment(# the filenames depend on the flavor of dbm you use,) -comment(# for example sdbm has two files named filename.pag and filename.dir,) -comment(# so you need to delete both files) -reserved(begin) - constant(File)operator(.)ident(delete)operator(()stringoperator(\)) - comment(# raises Exception if not exist) - ident(dbobj) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) -reserved(rescue) - comment(# add error handling here) -reserved(end) - - -comment(# @@PLEAC@@_14.3) -comment(# sdbm2gdbm: converts sdbm database to a gdbm database) -ident(require) string -ident(require) string - -reserved(unless) pre_constant(ARGV)operator(.)ident(length) operator(==) integer(2) - ident(fail) string -reserved(end) -ident(infile) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) -ident(outfile) operator(=) pre_constant(ARGV)operator([)integer(1)operator(]) - -ident(sdb) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(infile)operator(\)) -ident(gdb) operator(=) constant(GDBM)operator(.)ident(open)operator(()ident(outfile)operator(,) integer(0666)operator(\)) -ident(sdb)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(val)operator(|) - ident(gdb)operator([)ident(key)operator(]) operator(=) ident(val) -operator(}) -ident(gdb)operator(.)ident(close) -ident(sdb)operator(.)ident(close) - - -comment(# @@PLEAC@@_14.4) -doctype(#!/usr/bin/ruby -w) -comment(# dbmmerge: merges two dbm databases) -ident(require) string - -reserved(unless) pre_constant(ARGV)operator(.)ident(length) operator(==) integer(3) - ident(fail) string -reserved(end) -ident(infile1) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) -ident(infile2) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) -ident(outfile) operator(=) pre_constant(ARGV)operator([)integer(2)operator(]) - -ident(in1) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(infile1)operator(,) pre_constant(nil)operator(\)) -ident(in2) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(infile2)operator(,) pre_constant(nil)operator(\)) -ident(outdb) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(outfile)operator(,) integer(0666)operator(\)) - -operator([)ident(in1)operator(,) ident(in2)operator(])operator(.)ident(each) operator({) operator(|)ident(indb)operator(|) - ident(indb)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(val)operator(|) - reserved(if) ident(outdb)operator(.)ident(has_key?)operator(()ident(key)operator(\)) - comment(# decide which value to set.) - comment(# set outdb[key] if necessary) - reserved(else) - ident(outdb)operator([)ident(key)operator(]) operator(=) ident(val) - reserved(end) - operator(}) -operator(}) -ident(in1)operator(.)ident(close) -ident(in2)operator(.)ident(close) -ident(outdb)operator(.)ident(close) - - -comment(# @@PLEAC@@_14.7) -comment(# we write a tie method that extends the Array class.) -comment(# It reads the file into the memory, executes the code block) -comment(# in which you can manipulate the array as needed, and writes) -comment(# the array back to the file after the end of the block execution) -reserved(class) class(Array) - reserved(def) method(tie)operator(()ident(filename)operator(,) ident(flags)operator(\)) - constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) ident(flags)operator(\)) operator({) operator(|)ident(f)operator(|) - ident(f)operator(.)ident(each_line) operator({) operator(|)ident(line)operator(|) - pre_constant(self)operator(.)ident(push)operator(()ident(line)operator(.)ident(chomp)operator(\)) - operator(}) - reserved(yield) - ident(f)operator(.)ident(rewind) - ident(each) operator({) operator(|)ident(line)operator(|) - reserved(if) ident(line) - ident(f)operator(.)ident(puts)operator(()ident(line)operator(\)) - reserved(else) - ident(f)operator(.)ident(puts) string - reserved(end) - operator(}) - operator(}) - reserved(end) -reserved(end) - -ident(array) operator(=) constant(Array)operator(.)ident(new) -ident(array)operator(.)ident(tie)operator(()stringoperator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) operator({) - ident(array)operator([)integer(4)operator(]) operator(=) string -operator(}) - -comment(# The tied array can be manipulated like a normal array,) -comment(# so there is no need for a special API, and the recno_demo program) -comment(# to demonstrate is API is useless) - - -comment(# tied array demo: show how to use array with a tied file) -ident(filename) operator(=) string -ident(lines) operator(=) constant(Array)operator(.)ident(new) -constant(File)operator(.)ident(unlink)operator(()ident(filename)operator(\)) reserved(if) constant(File)operator(.)ident(exists?)operator(()ident(filename)operator(\)) -ident(lines)operator(.)ident(tie)operator(()ident(filename)operator(,) constant(File)operator(::)constant(RDWR) operator(|) constant(File)operator(::)constant(CREAT)operator(\)) operator({) - comment(# first create a textfile to play with) - ident(lines)operator([)integer(0)operator(]) operator(=) string - ident(lines)operator([)integer(1)operator(]) operator(=) string - ident(lines)operator([)integer(2)operator(]) operator(=) string - ident(lines)operator([)integer(3)operator(]) operator(=) string - ident(lines)operator([)integer(4)operator(]) operator(=) string - - comment(# print the records in order.) - comment(# Opposed to perl, the tied array behaves exactly as a normal array) - ident(puts) string - reserved(for) ident(i) reserved(in) integer(0)operator(..)operator(()ident(lines)operator(.)ident(length)operator(-)integer(1)operator(\)) - ident(puts) stringcontent(: )inlinedelimiter(")> - reserved(end) - - comment(#use push and pop) - ident(a) operator(=) ident(lines)operator(.)ident(pop) - ident(lines)operator(.)ident(push)operator(()stringoperator(\)) - ident(puts)operator(()stringcontent(])delimiter(")>operator(\)) - - comment(#use shift and unshift) - ident(a) operator(=) ident(lines)operator(.)ident(shift) - ident(lines)operator(.)ident(unshift)operator(()stringoperator(\)) - ident(puts)operator(()stringcontent(])delimiter(")>operator(\)) - - comment(# add record after record 2) - ident(i) operator(=) integer(2) - ident(lines)operator(.)ident(insert)operator(()ident(i) operator(+) integer(1)operator(,) stringoperator(\)) - - comment(# add record before record one) - ident(i) operator(=) integer(1) - ident(lines)operator(.)ident(insert)operator(()ident(i)operator(,) stringoperator(\)) - - comment(# delete record 3) - ident(lines)operator(.)ident(delete_at)operator(()integer(3)operator(\)) - - comment(#now print the records in reverse order) - ident(puts) string - operator(()ident(lines)operator(.)ident(length) operator(-) integer(1)operator(\))operator(.)ident(downto)operator(()integer(0)operator(\))operator({) operator(|)ident(i)operator(|) - ident(puts) stringcontent(: )inlinedelimiter(")> - operator(}) - -operator(}) - - -comment(# @@PLEAC@@_14.8) -comment(# example to store complex data in a database) -comment(# uses marshall from the standard library) -ident(require) string -ident(db) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) - -comment(# convert the Objects into strings and back by using the Marshal module.) -comment(# Most normal objects can be converted out of the box,) -comment(# but not special things like procedure objects,) -comment(# IO instance variables, singleton objects) - -ident(db)operator([)stringoperator(]) operator(=) constant(Marshal)operator(.)ident(dump)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) -ident(db)operator([)stringoperator(]) operator(=) constant(Marshal)operator(.)ident(dump)operator(()operator([)stringoperator(,) -stringoperator(])operator(\)) - -ident(name1) operator(=) string -ident(name2) operator(=) string - -ident(tom1) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(db)operator([)ident(name1)operator(])operator(\)) -ident(tom2) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(db)operator([)ident(name2)operator(])operator(\)) - -ident(puts) stringcontent( )inlinedelimiter(")> - -reserved(if) ident(tom1)operator([)integer(0)operator(]) operator(==) ident(tom2)operator([)integer(0)operator(]) operator(&&) ident(tom1)operator([)integer(1)operator(]) operator(==) ident(tom2)operator([)integer(1)operator(]) - ident(puts) string -reserved(else) - ident(puts) string -reserved(end) - -comment(# To change parts of an entry, get the whole entry, change the parts,) -comment(# and save the whole entry back) -ident(entry) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(db)operator([)stringoperator(])operator(\)) -ident(entry)operator([)integer(0)operator(]) operator(=) string -ident(db)operator([)stringoperator(]) operator(=) constant(Marshal)operator(.)ident(dump)operator(()ident(entry)operator(\)) -ident(db)operator(.)ident(close) - - -comment(# @@PLEAC@@_14.9) -comment(# example to make data persistent) -comment(# uses Marshal from the standard lib) -comment(# Stores the data in a simple file,) -comment(# see 14.8 on how to store it in a dbm file) - -comment(# The BEGIN block is executed before the rest of the script) -comment(# we use global variables here because local variables) -comment(# will go out of scope and are not accessible from the main script) - -reserved(BEGIN) operator({) - global_variable($persistent_store) operator(=) string - reserved(begin) - constant(File)operator(.)ident(open)operator(()global_variable($persistent_store)operator(\)) reserved(do) operator(|)ident(f)operator(|) - global_variable($stringvariable1) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(f)operator(\)) - global_variable($arrayvariable2) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(f)operator(\)) - reserved(end) - reserved(rescue) - ident(puts) stringdelimiter(")> - comment(# Initialisation if this script runs the first time) - global_variable($stringvariable1) operator(=) string - global_variable($arrayvariable2) operator(=) operator([)operator(]) - reserved(end) -operator(}) - -reserved(END) operator({) - constant(File)operator(.)ident(open)operator(()global_variable($persistent_store)operator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) - constant(Marshal)operator(.)ident(dump)operator(()global_variable($stringvariable1)operator(,) ident(f)operator(\)) - constant(Marshal)operator(.)ident(dump)operator(()global_variable($arrayvariable2)operator(,) ident(f)operator(\)) - reserved(end) -operator(}) - -comment(# simple test program) -ident(puts) global_variable($stringvariable1) -ident(puts) global_variable($arrayvariable2) -global_variable($stringvariable1) operator(=) string -global_variable($arrayvariable2)operator(.)ident(push)operator(()integer(5)operator(\)) -ident(puts) global_variable($stringvariable1) -ident(puts) global_variable($arrayvariable2) - - -comment(# @@PLEAC@@_14.10) -doctype(#!/usr/bin/ruby -w) -comment(# Ruby has a dbi module with an architecture similar) -comment(# to the Perl dbi module: the dbi module provides an unified) -comment(# interface and uses specialized drivers for each dbms vendor) -comment(#) -reserved(begin) - constant(DBI)operator(.)ident(connect)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) operator({) - operator(|)ident(dbh)operator(|) - - ident(dbh)operator(.)ident(do)operator(()constant(SQL1)operator(\)) - - ident(dbh)operator(.)ident(prepare)operator(()constant(SQL2)operator(\))operator({) operator(|)ident(sth)operator(|) - ident(sth)operator(.)ident(execute) - ident(sth)operator(.)ident(fetch) operator({)operator(|)ident(row)operator(|) - comment(# ...) - operator(}) - operator(}) comment(# end of block finishes the statement handle) - operator(}) comment(# end of block closes the database connection) -reserved(rescue) constant(DBI)operator(::)constant(DatabaseError) operator(=)operator(>) ident(e) - ident(puts) string - ident(puts) stringdelimiter(")> - ident(puts) stringdelimiter(")> -reserved(end) - -doctype(#!/usr/bin/ruby -w) -comment(# dbusers - example for mysql which creates a table,) -comment(# fills it with values, retrieves the values back,) -comment(# and finally destroys the table.) - -ident(require) string - -comment(# replacement for the User::pwnt module) -reserved(def) method(getpwent) - ident(result) operator(=) operator([)operator(]) - constant(File)operator(.)ident(open)operator(()stringoperator(\)) operator({)operator(|)ident(file)operator(|) - ident(file)operator(.)ident(each_line) operator({)operator(|)ident(line)operator(|) - reserved(next) reserved(if) ident(line)operator(.)ident(match)operator(()regexpoperator(\)) - ident(cols) operator(=) ident(line)operator(.)ident(split)operator(()stringoperator(\)) - ident(result)operator(.)ident(push)operator(()operator([)ident(cols)operator([)integer(2)operator(])operator(,) ident(cols)operator([)integer(0)operator(])operator(])operator(\)) - operator(}) - operator(}) - ident(result) -reserved(end) - -reserved(begin) - constant(DBI)operator(.)ident(connect)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) operator({) - operator(|)ident(conn)operator(|) - - ident(conn)operator(.)ident(do)operator(()stringoperator(\)) - - ident(users) operator(=) ident(getpwent) - - ident(conn)operator(.)ident(prepare)operator(()stringoperator(\)) operator({)operator(|)ident(sth)operator(|) - ident(users)operator(.)ident(each) operator({)operator(|)ident(entry)operator(|) - ident(sth)operator(.)ident(execute)operator(()ident(entry)operator([)integer(0)operator(])operator(,) ident(entry)operator([)integer(1)operator(])operator(\)) - operator(}) - operator(}) - - ident(conn)operator(.)ident(execute)operator(()stringoperator(\)) operator({)operator(|)ident(sth)operator(|) - ident(sth)operator(.)ident(fetch) operator({)operator(|)ident(row)operator(|) - ident(puts) ident(row)operator(.)ident(collect) operator({)operator(|)ident(col)operator(|) - reserved(if) ident(col)operator(.)ident(nil?) - string - reserved(else) - ident(col) - reserved(end) - operator(})operator(.)ident(join)operator(()stringoperator(\)) - operator(}) - operator(}) - - ident(conn)operator(.)ident(do)operator(()stringoperator(\)) - operator(}) -reserved(rescue) constant(DBI)operator(::)constant(DatabaseError) operator(=)operator(>) ident(e) - ident(puts) string - ident(puts) stringdelimiter(")> - ident(puts) stringdelimiter(")> -reserved(end) - - -comment(# @@PLEAC@@_15.1) -comment(# This test program demonstrates parsing program arguments.) -comment(# It uses the optparse library, which is included with ruby 1.8) -comment(# It handles classic unix style and gnu style options) -ident(require) string - -instance_variable(@debugmode) operator(=) pre_constant(false) -instance_variable(@verbose) operator(=) pre_constant(false) - -pre_constant(ARGV)operator(.)ident(options) reserved(do) operator(|)ident(opts)operator(|) - ident(opts)operator(.)ident(banner) operator(=) stringcontent( [OPTIONS] INPUTFILES)delimiter(")> - - ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) operator({) - ident(puts) ident(opts) - ident(exit) - operator(}) - comment(# The OptionParser#on method is called with a specification of short) - comment(# options, of long options, a data type spezification and user help) - comment(# messages for this option.) - comment(# The method analyses the given parameter and decides what it is,) - comment(# so you can leave out the long option if you don't need it) - ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(TrueClass)operator(,) stringoperator(\)) operator({) - operator(|)instance_variable(@verbose)operator(|) comment(# sets @verbose to true or false) - operator(}) - ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(TrueClass)operator(,) string operator(\))operator({) - operator(|)instance_variable(@debugmode)operator(|) comment(# sets @debugmode to true) - operator(}) - ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(Integer)operator(,) string operator(\))operator({) - operator(|)instance_variable(@count)operator(|) comment(# sets @count to given integer) - operator(}) - ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(String)operator(,) stringoperator(\))operator({) - operator(|)instance_variable(@outputfile)operator(|) comment(# sets @outputfile to given string) - operator(}) - ident(opts)operator(.)ident(parse!) -reserved(end) - -comment(# example to use the options in the main program) -ident(puts) string reserved(if) instance_variable(@verbose) -ident(puts) string reserved(if) instance_variable(@debugmode) -ident(puts) stringdelimiter(")> reserved(if) reserved(defined?) instance_variable(@outputfile) -ident(puts) stringdelimiter(")> reserved(if) reserved(defined?) instance_variable(@count) -pre_constant(ARGV)operator(.)ident(each) operator({) operator(|)ident(param)operator(|) - ident(puts) stringdelimiter(")> -operator(}) - - -comment(# @@PLEAC@@_15.4) -ident(buf) operator(=) string operator(*) integer(8) -global_variable($stdout)operator(.)ident(ioctl)operator(()integer(0x5413)operator(,) ident(buf)operator(\)) -ident(ws_row)operator(,) ident(ws_col)operator(,) ident(ws_xpixel)operator(,) ident(ws_ypixel) operator(=) ident(buf)operator(.)ident(unpack)operator(()stringoperator(\)) - -ident(raise) string reserved(unless) ident(ws_col) operator(>)operator(=) integer(20) -ident(max) operator(=) integer(0) -ident(values) operator(=) operator(()integer(1)operator(..)integer(5)operator(\))operator(.)ident(collect) operator({) ident(rand)operator(()integer(20)operator(\)) operator(}) comment(# generate an array[5] of rand values) -reserved(for) ident(i) reserved(in) ident(values) - ident(max) operator(=) ident(i) reserved(if) ident(max) operator(<) ident(i) -reserved(end) -ident(ratio) operator(=) ident(Float)operator(()ident(ws_col)operator(-)integer(12)operator(\))operator(/)ident(max) comment(# chars per unit) -reserved(for) ident(i) reserved(in) ident(values) - ident(printf) stringoperator(,) ident(i)operator(,) string operator(*) operator(()ident(ratio)operator(*)ident(i)operator(\)) -reserved(end) - -comment(# gives, for example:) -comment(# 15.0 *******************************) -comment(# 10.0 *********************) -comment(# 5.0 **********) -comment(# 14.0 *****************************) -comment(# 18.0 **************************************) - - -comment(# @@PLEAC@@_16.1) -ident(output) operator(=) shell comment(# collect output into one multiline string) -ident(output) operator(=) shelloperator(.)ident(split) comment(# collect output into array, one line per) -ident(element) - -ident(readme) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) -ident(output) operator(=) string -reserved(while) ident(readme)operator(.)ident(gets) reserved(do) - ident(output) operator(+=) global_variable($_) -reserved(end) -ident(readme)operator(.)ident(close) - -shell comment(# BAD AND SCARY in Perl because it's managed by the shell) - comment(# I donna in Ruby ...) - -comment(# so the "clean and secure" version) -ident(readme)operator(,) ident(writeme) operator(=) constant(IO)operator(.)ident(pipe) -ident(pid) operator(=) ident(fork) operator({) - comment(# child) - global_variable($stdout) operator(=) ident(writeme) - ident(readme)operator(.)ident(close) - ident(exec)operator(()stringoperator(,) stringoperator(\)) -operator(}) -comment(# parent) -constant(Process)operator(.)ident(waitpid)operator(()ident(pid)operator(,) integer(0)operator(\)) -ident(writeme)operator(.)ident(close) -reserved(while) ident(readme)operator(.)ident(gets) reserved(do) - comment(# do something with $_) -reserved(end) - - -comment(# @@PLEAC@@_16.2) -ident(status) operator(=) ident(system)operator(()stringdelimiter(")>operator(\)) - -ident(status) operator(=) ident(system)operator(()stringoperator(,) ident(myfile)operator(\)) - -ident(system)operator(()stringoutfile)delimiter(")>operator(\)) -ident(system)operator(()stringoutfile 2>errfile)delimiter(")>operator(\)) - -comment(# stop if the command fails) -ident(raise) stringdelimiter(")> reserved(unless) ident(system)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) - -comment(# get the value of the signal sent to the child) -comment(# even if it is a SIGINT or SIGQUIT) -ident(system)operator(()ident(arglist)operator(\)) -ident(raise) stringdelimiter(")> reserved(if) operator(()global_variable($?) operator(&) integer(127)operator(\)) operator(!=) integer(0) - -ident(pid) operator(=) ident(fork) operator({) - ident(trap)operator(()stringoperator(,) stringoperator(\)) - ident(exec)operator(()stringoperator(,) stringoperator(\)) -operator(}) -ident(trap) operator(()stringoperator(\)) operator({) - ident(puts) string -operator(}) -constant(Process)operator(.)ident(waitpid)operator(()ident(pid)operator(,) integer(0)operator(\)) - -comment(# Ruby doesn't permit to lie to the program called by a 'system'.) -comment(# (ie specify what return argv[0] in C, $0 in Perl/Ruby ...\)) -comment(# A (dirty\) way is to create a link (under Unix\), run this link and) -comment(# erase it. Somebody has a best idea ?) - - -comment(# @@PLEAC@@_16.3) -ident(exec)operator(()stringoperator(\)) - -ident(exec)operator(()stringoperator(,) stringoperator(\)) - -ident(exec)operator(()stringoperator(\)) - - -comment(# @@PLEAC@@_16.4) -comment(# read the output of a program) -constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) operator({)operator(|)ident(readme)operator(|) - reserved(while) ident(readme)operator(.)ident(gets) reserved(do) - comment(# ...) - reserved(end) -operator(}) -comment(# or) -ident(readme) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) -reserved(while) ident(readme)operator(.)ident(gets) reserved(do) - comment(# ...) -reserved(end) -ident(readme)operator(.)ident(close) - -comment(# "write" in a program) -constant(IO)operator(.)ident(popen)operator(()stringoperator(,)stringoperator(\)) operator({)operator(|)ident(pipe)operator(|) - ident(pipe)operator(.)ident(puts)operator(()stringoperator(\)) - ident(pipe)operator(.)ident(puts)operator(()stringoperator(\)) -operator(}) - -comment(# close wait for the end of the process) -ident(read) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) comment(# child goes to sleep) -ident(read)operator(.)ident(close) comment(# and the parent goes to lala land) - -ident(writeme) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(,) stringoperator(\)) -ident(writeme)operator(.)ident(puts) string comment(# program will get hello\\n on STDIN) -ident(writeme)operator(.)ident(close) comment(# program will get EOF on STDIN) - -comment(# send in a pager (eg less\) all output) -global_variable($stdout) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(,)stringoperator(\)) -ident(print) string operator(*) integer(10000) - - -comment(# @@PLEAC@@_16.5) -comment(#-----------------------------) -reserved(def) method(head)operator(()ident(lines) operator(=) integer(20)operator(\)) - ident(pid) operator(=) ident(open)operator(()stringoperator(,)stringoperator(\)) - reserved(if) ident(pid) operator(==) pre_constant(nil) - reserved(return) - reserved(else) - reserved(while) ident(gets)operator(()operator(\)) reserved(do) - ident(pid)operator(.)ident(print) - ident(lines) operator(-=) integer(1) - reserved(break) reserved(if) ident(lines) operator(==) integer(0) - reserved(end) - reserved(end) - ident(exit) -reserved(end) - -ident(head)operator(()integer(100)operator(\)) -reserved(while) ident(gets)operator(()operator(\)) reserved(do) - ident(print) -reserved(end) -comment(#-----------------------------) -integer(1)operator(:) operator(>) constant(Welcome) ident(to) constant(Linux)operator(,) ident(version) float(2.0)operator(.)error(33) ident(on) ident(a) ident(i686) - -integer(2)operator(:) operator(>) - -integer(3)operator(:) operator(>) string so I installed Linux.)delimiter(")> -comment(#-----------------------------) -operator(>) integer(1)operator(:) constant(Welcome) ident(to) constant(Linux)operator(,) constant(Kernel) ident(version) float(2.0)operator(.)error(33) ident(on) ident(a) ident(i686) - -operator(>) integer(2)operator(:) - -operator(>) integer(3)operator(:) string 4: so I installed Linux.)delimiter(")> -comment(#-----------------------------) -doctype(#!/usr/bin/ruby) -comment(# qnumcat - demo additive output filters) - -reserved(def) method(number)operator(()operator(\)) - ident(pid) operator(=) ident(open)operator(()stringoperator(,)stringoperator(\)) - reserved(if) ident(pid) operator(==) pre_constant(nil) - reserved(return) - reserved(else) - reserved(while) ident(gets)operator(()operator(\)) reserved(do) ident(pid)operator(.)ident(printf)operator(()stringoperator(,) global_variable($.)operator(,) global_variable($_)operator(\))operator(;) reserved(end) - reserved(end) - ident(exit) -reserved(end) - -reserved(def) method(quote)operator(()operator(\)) - ident(pid) operator(=) ident(open)operator(()stringoperator(,)stringoperator(\)) - reserved(if) ident(pid) operator(==) pre_constant(nil) - reserved(return) - reserved(else) - reserved(while) ident(gets)operator(()operator(\)) reserved(do) ident(pid)operator(.)ident(print) string )inlinedelimiter(")> reserved(end) - reserved(end) - ident(exit) -reserved(end) - -ident(number)operator(()operator(\)) -ident(quote)operator(()operator(\)) - -reserved(while) ident(gets)operator(()operator(\)) reserved(do) - ident(print) -reserved(end) -global_variable($stdout)operator(.)ident(close) -ident(exit) - - -comment(# @@PLEAC@@_16.6) -pre_constant(ARGV)operator(.)ident(map!) operator({) operator(|)ident(arg)operator(|) - ident(arg) operator(=)operator(~) regexp operator(?) stringdelimiter(")> operator(:) ident(arg) -operator(}) -reserved(for) ident(file) reserved(in) pre_constant(ARGV) - ident(fh) operator(=) ident(open)operator(()ident(file)operator(\)) - reserved(while) ident(fh)operator(.)ident(gets)operator(()operator(\)) reserved(do) - comment(# .......) - reserved(end) -reserved(end) -comment(#-----------------------------) -pre_constant(ARGV)operator(.)ident(map!) operator({) operator(|)ident(arg)operator(|) - ident(arg) operator(=)operator(~) regexp operator(?) stringdelimiter(")> operator(:) ident(arg) comment(#) -operator(}) -reserved(for) ident(file) reserved(in) pre_constant(ARGV) - ident(fh) operator(=) ident(open)operator(()ident(file)operator(\)) - reserved(while) ident(fh)operator(.)ident(gets)operator(()operator(\)) reserved(do) - comment(# .......) - reserved(end) -reserved(end) -comment(#-----------------------------) -ident(pwdinfo) operator(=) operator(()shell operator(=)operator(~) regexpoperator(\)) operator(?) string operator(:) stringoperator(;) -ident(pwd) operator(=) ident(open)operator(()ident(pwdinfo)operator(\))operator(;) -comment(#-----------------------------) -ident(puts) stringoperator(;) -ident(file) operator(=) ident(gets)operator(()operator(\))operator(.)ident(chomp)operator(()operator(\))operator(;) -ident(fh) operator(=) ident(open)operator(()ident(file)operator(\))operator(;) - - -comment(# @@PLEAC@@_16.7) -ident(output) operator(=) shell&1)delimiter(`)> comment(# with backticks) -comment(# or) -ident(ph) operator(=) ident(open)operator(()string&1)delimiter(")>operator(\)) comment(# with an open pipe) -reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) -comment(#-----------------------------) -ident(output) operator(=) shell/dev/null)delimiter(`)> comment(# with backticks) -comment(# or) -ident(ph) operator(=) ident(open)operator(()string/dev/null)delimiter(")>operator(\)) comment(# with an open pipe) -reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) -comment(#-----------------------------) -ident(output) operator(=) shell&1 1>/dev/null)delimiter(`)> comment(# with backticks) -comment(# or) -ident(ph) operator(=) ident(open)operator(()string&1 1>/dev/null)delimiter(")>operator(\)) comment(# with an open pipe) -reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) -comment(#-----------------------------) -ident(output) operator(=) shell&1 1>&2 2>&3 3>&-)delimiter(`)> comment(# with backticks) -comment(# or) -ident(ph) operator(=) ident(open)operator(()string&1 1>&2 2>&3 3>&-)delimiter(")>operator(\)) comment(# with an open pipe) -reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) -comment(#-----------------------------) -ident(system)operator(()string/tmp/program.stdout 2>/tmp/program.stderr)delimiter(")>operator(\)) -comment(#-----------------------------) -ident(output) operator(=) shell&1 1>&2 2>&3 3>&-)delimiter(`)> -comment(#-----------------------------) -ident(fd3) operator(=) ident(fd1) -ident(fd1) operator(=) ident(fd2) -ident(fd2) operator(=) ident(fd3) -ident(fd3) operator(=) pre_constant(nil) -comment(#-----------------------------) -ident(system)operator(()stringtmpfile 2>&1)delimiter(")>operator(\)) -ident(system)operator(()string&1 1>tmpfile)delimiter(")>operator(\)) -comment(#-----------------------------) -comment(# system ("prog args 1>tmpfile 2>&1"\) ) -ident(fd1) operator(=) string comment(# change stdout destination first) -ident(fd2) operator(=) ident(fd1) comment(# now point stderr there, too) -comment(#-----------------------------) -comment(# system("prog args 2>&1 1>tmpfile"\) ) -ident(fd2) operator(=) ident(fd1) comment(# stderr same destination as stdout) -ident(fd1) operator(=) string comment(# but change stdout destination ) -comment(#-----------------------------) -comment(# It is often better not to rely on the shell, ) -comment(# because of portability, possible security problems ) -comment(# and bigger resource usage. So, it is often better to use the open3 library. ) -comment(# See below for an example.) -comment(# opening stdin, stdout, stderr) -ident(require) string -ident(stdin)operator(,) ident(stdout)operator(,) ident(stderr) operator(=) constant(Open3)operator(.)ident(popen)operator(()stringoperator(\)) - - -comment(# @@PLEAC@@_16.8) -comment(#-----------------------------) -comment(# Contrary to perl, we don't need to use a module in Ruby) -ident(fh) operator(=) constant(Kernel)operator(.)ident(open)operator(()string operator(+) ident(program)operator(,) stringoperator(\)) -ident(fh)operator(.)ident(puts) string -ident(output) operator(=) ident(fh)operator(.)ident(gets)operator(()operator(\)) -ident(fh)operator(.)ident(close)operator(()operator(\)) -comment(#-----------------------------) -constant(Kernel)operator(.)ident(open)operator(()stringoperator(\))operator(,)stringoperator(\)) comment(# RIGHT !) -comment(#-----------------------------) -comment(# Ruby has already object methods for I/O handles) -comment(#-----------------------------) -reserved(begin) - ident(fh) operator(=) constant(Kernel)operator(.)ident(open)operator(()string operator(+) ident(program_and_options)operator(,) stringoperator(\)) -reserved(rescue) - reserved(if) operator(()global_variable($@) operator(~=) regexpoperator(\)) - global_variable($stderr)operator(.)ident(puts) stringcontent( )char(\\n)content( )inlinecontent( )char(\\n)delimiter(")> - reserved(break) - reserved(end) - ident(raise) comment(# reraise unforseen exception) -reserved(end) - - -comment(# @@PLEAC@@_16.13) -comment(#% kill -l) -comment(#HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE) -comment(#ALRM TERM CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM) -comment(#PROF WINCH POLL PWR) -comment(#-----------------------------) -comment(#% ruby -e 'puts Signal.list.keys.join(" "\)') -comment(#PWR USR1 BUS USR2 TERM SEGV KILL POLL STOP SYS TRAP IOT HUP INT #) -comment(#WINCH XCPU TTIN CLD TSTP FPE IO TTOU PROF CHLD CONT PIPE ABRT) -comment(#VTALRM QUIT ILL XFSZ URG ALRM) -comment(#-----------------------------) -comment(# After that, the perl script create an hash equivalent to Signal.list, ) -comment(# and an array. The array can be obtained by :) -ident(signame) operator(=) operator([)operator(]) -constant(Signal)operator(.)ident(list)operator(.)ident(each) operator({) operator(|)ident(name)operator(,) ident(i)operator(|) ident(signame)operator([)ident(i)operator(]) operator(=) ident(name) operator(}) - - -comment(# @@PLEAC@@_16.14) -constant(Process)operator(.)ident(kill)operator(()integer(9)operator(,) ident(pid)operator(\)) comment(# send $pid a signal 9) -constant(Process)operator(.)ident(kill)operator(()integer(-1)operator(,) constant(Process)operator(.)ident(getpgrp)operator(()operator(\))operator(\)) comment(# send whole job a signal 1) -constant(Process)operator(.)ident(kill)operator(()stringoperator(,) global_variable($$)operator(\)) comment(# send myself a SIGUSR1) -constant(Process)operator(.)ident(kill)operator(()stringoperator(,) ident(pid1)operator(,) ident(pid2)operator(,) ident(pid3)operator(\)) comment(# send a SIGHUP to processes in @pids) -comment(#-----------------------------) -reserved(begin) - constant(Process)operator(.)ident(kill)operator(()integer(0)operator(,) ident(minion)operator(\)) - ident(puts) stringcontent( is alive!)delimiter(")> -reserved(rescue) constant(Errno)operator(::)constant(EPERM) comment(# changed uid) - ident(puts) stringcontent( has escaped my control!)delimiter(")>operator(;) -reserved(rescue) constant(Errno)operator(::)constant(ESRCH) - ident(puts) stringcontent( is deceased.)delimiter(")>operator(;) comment(# or zombied) -reserved(rescue) - ident(puts) stringcontent( : )inlinedelimiter(")> -reserved(end) - - -comment(# @@PLEAC@@_16.15) -constant(Kernel)operator(.)ident(trap)operator(()stringoperator(,) ident(got_sig_quit)operator(\)) comment(# got_sig_quit = Proc.new { puts "Quit\\n" }) -ident(trap)operator(()stringoperator(,) stringoperator(\)) comment(# def got_sig_pipe ...) -ident(trap)operator(()stringoperator(\)) operator({) ident(ouch)operator(+)operator(+) operator(}) comment(# increment ouch for every SIGINT) -comment(#-----------------------------) -ident(trap)operator(()stringoperator(,) stringoperator(\)) comment(# ignore the signal INT) -comment(#-----------------------------) -ident(trap)operator(()stringoperator(,) stringoperator(\)) comment(# restore default STOP signal handling) - - -comment(# @@PLEAC@@_16.16) -comment(# the signal handler) -reserved(def) method(ding) - ident(trap)operator(()stringoperator(,) stringoperator(\)) - ident(puts) string -reserved(end) - -comment(# prompt for name, overriding SIGINT) -reserved(def) method(get_name) - ident(save) operator(=) ident(trap)operator(()stringoperator(,) stringoperator(\)) - - ident(puts) string - ident(name) operator(=) ident(gets)operator(()operator(\))operator(.)ident(chomp)operator(()operator(\)) - ident(trap)operator(()stringoperator(,) ident(save)operator(\)) - ident(name) -reserved(end) - - -comment(# @@PLEAC@@_16.21) -comment(# implemented thanks to http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/1760) -ident(require) string - -comment(# we'll do something vastly more useful than cookbook to demonstrate timeouts) -reserved(begin) - ident(timeout)operator(()integer(5)operator(\)) operator({) - ident(waitsec) operator(=) ident(rand)operator(()integer(10)operator(\)) - ident(puts) stringcontent( seconds is longer than 5 seconds...)delimiter(")> - ident(system)operator(()stringdelimiter(")>operator(\)) - operator(}) - ident(puts) string -reserved(rescue) constant(Timeout)operator(::)constant(Error) - ident(puts) string -reserved(end) - - -comment(# @@PLEAC@@_17.1) -comment(# A basic TCP client connection) -ident(require) string -reserved(begin) - ident(t) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) -reserved(rescue) - ident(puts) stringdelimiter(")> -reserved(else) - comment(# ... do something with the socket) - ident(t)operator(.)ident(print) string - ident(answer) operator(=) ident(t)operator(.)ident(gets)operator(()pre_constant(nil)operator(\)) - comment(# and terminate the connection when we're done) - ident(t)operator(.)ident(close) -reserved(end) - -comment(# Using the evil low level socket API) -ident(require) string -comment(# create a socket) -ident(s) operator(=) constant(Socket)operator(.)ident(new)operator(()constant(Socket)operator(::)constant(AF_INET)operator(,) constant(Socket)operator(::)constant(SOCK_STREAM)operator(,) integer(0)operator(\)) -comment(# build the address of the remote machine) -ident(sockaddr_server) operator(=) operator([)constant(Socket)operator(::)constant(AF_INET)operator(,) integer(80)operator(,) - constant(Socket)operator(.)ident(gethostbyname)operator(()stringoperator(\))operator([)integer(3)operator(])operator(,) - integer(0)operator(,) integer(0)operator(])operator(.)ident(pack)operator(()stringoperator(\)) -comment(# connect) -reserved(begin) - ident(s)operator(.)ident(connect)operator(()ident(sockaddr_server)operator(\)) -reserved(rescue) - ident(puts) stringdelimiter(")> -reserved(else) - comment(# ... do something with the socket) - ident(s)operator(.)ident(print) string - comment(# and terminate the connection when we're done) - ident(s)operator(.)ident(close) -reserved(end) - -comment(# TCP connection with management of error (DNS\)) -ident(require) string -reserved(begin) - ident(client) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) -reserved(rescue) - ident(puts) stringdelimiter(")> -reserved(end) - -comment(# TCP connection with a time out) -ident(require) string -ident(require) string -reserved(begin) - ident(timeout)operator(()integer(1)operator(\)) reserved(do) comment(#the server has one second to answer) - ident(client) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) - reserved(end) -reserved(rescue) - ident(puts) stringdelimiter(")> -reserved(end) - - -comment(# @@PLEAC@@_17.12) -ident(require) string - -reserved(class) class(Preforker) - ident(attr_reader) operator(()symbol(:child_count)operator(\)) - - reserved(def) method(initialize)operator(()ident(prefork)operator(,) ident(max_clients_per_child)operator(,) ident(port)operator(,) ident(client_handler)operator(\)) - instance_variable(@prefork) operator(=) ident(prefork) - instance_variable(@max_clients_per_child) operator(=) ident(max_clients_per_child) - instance_variable(@port) operator(=) ident(port) - instance_variable(@child_count) operator(=) integer(0) - - instance_variable(@reaper) operator(=) ident(proc) operator({) - ident(trap)operator(()stringoperator(,) instance_variable(@reaper)operator(\)) - ident(pid) operator(=) constant(Process)operator(.)ident(wait) - instance_variable(@child_count) operator(-=) integer(1) - operator(}) - - instance_variable(@huntsman) operator(=) ident(proc) operator({) - ident(trap)operator(()stringoperator(,) stringoperator(\)) - ident(trap)operator(()stringoperator(,) stringoperator(\)) - constant(Process)operator(.)ident(kill)operator(()stringoperator(,) integer(0)operator(\)) - ident(exit) - operator(}) - - instance_variable(@client_handler)operator(=)ident(client_handler) - reserved(end) - - reserved(def) method(child_handler) - ident(trap)operator(()stringoperator(,) stringoperator(\)) - instance_variable(@client_handler)operator(.)ident(setUp) - comment(# wish: sigprocmask UNblock SIGINT) - instance_variable(@max_clients_per_child)operator(.)ident(times) operator({) - ident(client) operator(=) instance_variable(@server)operator(.)ident(accept) reserved(or) reserved(break) - instance_variable(@client_handler)operator(.)ident(handle_request)operator(()ident(client)operator(\)) - ident(client)operator(.)ident(close) - operator(}) - instance_variable(@client_handler)operator(.)ident(tearDown) - reserved(end) - - reserved(def) method(make_new_child) - comment(# wish: sigprocmask block SIGINT) - instance_variable(@child_count) operator(+=) integer(1) - ident(pid) operator(=) ident(fork) reserved(do) - ident(child_handler) - reserved(end) - comment(# wish: sigprocmask UNblock SIGINT) - reserved(end) - - reserved(def) method(run) - instance_variable(@server) operator(=) constant(TCPserver)operator(.)ident(open)operator(()instance_variable(@port)operator(\)) - ident(trap)operator(()stringoperator(,) instance_variable(@reaper)operator(\)) - ident(trap)operator(()stringoperator(,) instance_variable(@huntsman)operator(\)) - ident(loop) operator({) - operator(()instance_variable(@prefork) operator(-) instance_variable(@child_count)operator(\))operator(.)ident(times) operator({) operator(|)ident(i)operator(|) - ident(make_new_child) - operator(}) - ident(sleep) operator(.)error(1) - operator(}) - reserved(end) -reserved(end) - -comment(#-----------------------------) -doctype(#!/usr/bin/ruby) - -ident(require) string - -reserved(class) class(ClientHandler) - reserved(def) method(setUp) - reserved(end) - - reserved(def) method(tearDown) - reserved(end) - - reserved(def) method(handle_request)operator(()ident(client)operator(\)) - comment(# do stuff) - reserved(end) -reserved(end) - -ident(server) operator(=) constant(Preforker)operator(.)ident(new)operator(()integer(1)operator(,) integer(100)operator(,) integer(3102)operator(,) constant(ClientHandler)operator(.)ident(new)operator(\)) -ident(server)operator(.)ident(run) - - -comment(# @@PLEAC@@_18.2) -ident(require) string - -reserved(begin) - ident(ftp) operator(=) constant(Net)operator(::)constant(FTP)operator(::)ident(new)operator(()stringoperator(\)) - ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,)ident(password)operator(\)) - ident(ftp)operator(.)ident(chdir)operator(()ident(directory)operator(\)) - ident(ftp)operator(.)ident(get)operator(()ident(filename)operator(\)) - ident(ftp)operator(.)ident(put)operator(()ident(filename)operator(\)) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(print) string operator(+) global_variable($!) -reserved(ensure) - ident(ftp)operator(.)ident(close)operator(()operator(\)) reserved(if) ident(ftp) -reserved(end) - -comment(# A better solution for a local use could be :) -constant(Net)operator(::)constant(FTP)operator(::)ident(new)operator(()stringoperator(\)) reserved(do) operator(|)ident(ftp)operator(|) - ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,)ident(password)operator(\)) - ident(ftp)operator(.)ident(chdir)operator(()ident(directory)operator(\)) - ident(ftp)operator(.)ident(get)operator(()ident(filename)operator(\)) - ident(ftp)operator(.)ident(put)operator(()ident(filename)operator(\)) -reserved(end) - -comment(# If you have only one file to get, there is a simple solution :) -ident(require) string -ident(open)operator(()stringoperator(\)) reserved(do) operator(|)ident(fh)operator(|) - comment(# read from filehandle fh) -reserved(end) -comment(#--------------------------------------------) -comment(# to wait a defined time for the connection, ) -comment(# use the timeout module) -ident(require) string -reserved(begin) - ident(timeout)operator(()integer(30)operator(\))operator({) - ident(ftp) operator(=) constant(Net)operator(::)constant(FTP)operator(::)ident(new)operator(()stringoperator(\)) - ident(ftp)operator(.)ident(debug_mode) operator(=) pre_constant(true) - operator(}) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(puts) string -reserved(rescue) constant(Timeout)operator(::)constant(Error) - global_variable($stderr)operator(.)ident(puts) string -reserved(end) - -reserved(begin) - ident(ftp)operator(.)ident(login)operator(()operator(\)) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(print) string -reserved(end) - -reserved(begin) - ident(ftp)operator(.)ident(login)operator(()ident(username)operator(\)) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(print) string -reserved(end) - -reserved(begin) - ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(\)) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(print) string -reserved(end) - -reserved(begin) - ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(,) ident(account)operator(\)) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(print) string -reserved(end) -comment(#-----------------------------) -ident(ftp)operator(.)ident(put)operator(()ident(localfile)operator(,) ident(remotefile)operator(\)) -comment(#-----------------------------) -comment(# Sending data from STDIN is not directly supported ) -comment(# by the ftp library module. A possible way to do it is to use the ) -comment(# storlines method directly to send raw commands to the ftp server.) -comment(#-----------------------------) -ident(ftp)operator(.)ident(get)operator(()ident(remotefile)operator(,) ident(localfile)operator(\)) -comment(#-----------------------------) -ident(ftp)operator(.)ident(get)operator(()ident(remotefile)operator(\)) operator({) operator(|)ident(data)operator(|) ident(puts) ident(data) operator(}) -comment(#-----------------------------) -ident(ftp)operator(.)ident(chdir)operator(()stringoperator(\)) -ident(print) stringoperator(,) ident(ftp)operator(.)ident(pwd)operator(()operator(\))operator(,) string -comment(#-----------------------------) -ident(ftp)operator(.)ident(mkdir)operator(()stringoperator(\)) -comment(#-----------------------------) -ident(lines) operator(=) ident(ftp)operator(.)ident(ls)operator(()stringoperator(\)) -comment(# => ["drwxr-xr-x 2 matz users 4096 July 17 1998 1.0", ... ]) - -ident(latest) operator(=) ident(ftp)operator(.)ident(dir)operator(()stringoperator(\))operator(.)ident(sort)operator(.)ident(last) - -ident(ftp)operator(.)ident(nlst)operator(()stringoperator(\)) -comment(# => ["/pub/ruby/1.0", ... ]) -comment(#-----------------------------) -ident(ftp)operator(.)ident(quit)operator(()operator(\)) - - -comment(# @@PLEAC@@_18.6) -ident(require) string -ident(t) operator(=) constant(Net)operator(::)constant(Telnet)operator(::)ident(new)operator(() string operator(=)operator(>) integer(10)operator(,) - string operator(=)operator(>) regexpoperator(,) - string operator(=)operator(>) ident(host) operator(\)) -ident(t)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(\)) -ident(files) operator(=) ident(t)operator(.)ident(cmd)operator(()stringoperator(\)) -ident(t)operator(.)ident(print)operator(()stringoperator(\)) -ident(process_string) operator(=) ident(t)operator(.)ident(waitfor)operator(()regexpoperator(\)) -ident(t)operator(.)ident(close) -comment(#-----------------------------) -regexp] )char(\\z)delimiter(/)modifier(n)> -comment(#-----------------------------) -comment(# In case of an error, the telnet module throws an exception.) -comment(# For control of the behavior in case of an error,) -comment(# you just need to catch the exceptions and do your custom) -comment(# error handling.) -comment(#-----------------------------) -reserved(begin) - ident(telnet)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(\)) -reserved(rescue) constant(TimeoutError) - ident(fail) string -reserved(end) -comment(#-----------------------------) -ident(telnet)operator(.)ident(waitfor)operator(()stringoperator(\)) -comment(#-----------------------------) -ident(telnet)operator(.)ident(waitfor)operator(()constant(String) operator(=)operator(>) stringoperator(,) constant(Timeout) operator(=)operator(>) integer(30)operator(\)) - - -comment(# @@PLEAC@@_18.7) -ident(require) string - -ident(puts) stringcontent( is alive.)char(\\n)delimiter(")> reserved(if) constant(Ping)operator(.)ident(pingecho)operator(()ident(host)operator(\))operator(;) -comment(#-----------------------------) -comment(# the ping module only use TCP ping, not ICMP even if we are root) -reserved(if) constant(Ping)operator(.)ident(pingecho)operator(()stringoperator(\)) - ident(puts) stringoperator(;) -reserved(else) - ident(puts) stringoperator(;) -reserved(end) - - -comment(# @@PLEAC@@_19.0) -comment(#-----------------------------) -comment(# http://www.perl.com/CPAN/) -comment(# http://www.perl.com:8001/bad/mojo.html) -comment(# ftp://gatekeeper.dec.com/pub/misc/netlib.tar.Z) -comment(# ftp://anonymous@myplace:gatekeeper.dec.com/pub/misc/netlib.tar.Z) -comment(# file:///etc/motd) -comment(#-----------------------------) -comment(# http://mox.perl.com/cgi-bin/program?name=Johann&born=1685) -comment(#-----------------------------) -comment(# http://mox.perl.com/cgi-bin/program) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_19.1) -doctype(#!/usr/local/bin/ruby -w) -comment(# hiweb - load CGI class to decode information given by web server) - -ident(require) string - -ident(cgi) operator(=) constant(CGI)operator(.)ident(new)operator(()stringoperator(\)) - -comment(# get a parameter from a form) -ident(value) operator(=) ident(cgi)operator(.)ident(params)operator([)stringoperator(])operator([)integer(0)operator(]) - -comment(# output a document) -ident(cgi)operator(.)ident(out) operator({) - ident(cgi)operator(.)ident(html) operator({) - ident(cgi)operator(.)ident(head) operator({) ident(cgi)operator(.)ident(title) operator({) string operator(}) operator(}) operator(+) - ident(cgi)operator(.)ident(body) operator({) ident(cgi)operator(.)ident(p) operator({) string operator(+) ident(cgi)operator(.)ident(tt) operator({) - constant(CGI)operator(.)ident(escapeHTML)operator(()ident(value)operator(\)) operator(}) operator(}) operator(}) - operator(}) -operator(}) - -ident(require) string -ident(cgi) operator(=) constant(CGI)operator(.)ident(new) -ident(who) operator(=) ident(cgi)operator(.)ident(param)operator([)stringoperator(])operator([)integer(0)operator(]) comment(# first param in list) -ident(phone) operator(=) ident(cgi)operator(.)ident(param)operator([)stringoperator(])operator([)integer(0)operator(]) -ident(picks) operator(=) ident(cgi)operator(.)ident(param)operator([)stringoperator(]) comment(# complete list) - -ident(print) ident(cgi)operator(.)ident(header)operator(() string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) constant(Time)operator(.)ident(now) operator(+) operator(()integer(3) operator(*) integer(24) operator(*) integer(60) operator(*) integer(60)operator(\)) operator(\)) - - -comment(# @@PLEAC@@_19.3) -doctype(#!/usr/local/bin/ruby -w) -comment(# webwhoami - show web user's id) -ident(require) string -ident(print) string -ident(print) string operator(+) constant(Etc)operator(.)ident(getpwuid)operator(.)ident(name) operator(+) string - -comment(# % ruby -wc cgi-script # just check syntax) - -comment(# % ruby -w cgi-script # params from stdin) -comment(# (offline mode: enter name=value pairs on standard input\)) -comment(# name=joe) -comment(# number=10) -comment(# ^D) - -comment(# % ruby -w cgi-script name=joe number=10 # run with mock form input) -comment(# % ruby -d cgi-script name=joe number=10 # ditto, under the debugger) - -comment(# POST method script in csh) -comment(# % (setenv HTTP_METHOD POST; ruby -w cgi-script name=joe number=10\)) -comment(# POST method script in sh) -comment(# % HTTP_METHOD=POST perl -w cgi-script name=joe number=10) - - -comment(# @@PLEAC@@_19.4) -comment(# ruby has several security levels, the level "1" is similar to perls taint mode.) -comment(# It can be switched on by providing the -T command line parameter) -comment(# or by setting $SAFE to 1. Setting $SAFE to 2,3 or 4 restricts possible) -comment(# harmful operations further.) - -doctype(#!/usr/bin/ruby -T) -global_variable($SAFE) operator(=) integer(1) -constant(File)operator(.)ident(open)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(,) stringoperator(\)) -comment(# ruby warns with:) -comment(# taint1.rb:2:in `initialize': Insecure operation - initialize (SecurityError\)) - -global_variable($SAFE) operator(=) integer(1) -ident(file) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) -reserved(unless) regexpoperator(.)ident(match)operator(()ident(file)operator(\)) - ident(raise) stringcontent( has invalid characters)delimiter(")> -reserved(end) -ident(file) operator(=) global_variable($1) -comment(# In ruby, even the back reference from a regular expression stays tainted.) -comment(# you need to explicitly untaint the variable:) -ident(file)operator(.)ident(untaint) -constant(File)operator(.)ident(open)operator(()ident(file)operator(,) stringoperator(\)) - -comment(# Race condition exists like in perl:) -reserved(unless) constant(File)operator(.)ident(exists)operator(()ident(filename)operator(\)) comment(# Wrong because of race condition) - constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) stringoperator(\)) -reserved(end) - - -comment(# @@PLEAC@@_19.8) -ident(url) operator(=) string -ident(print) stringchar(\\r)char(\\n)char(\\r)char(\\n)delimiter(")> -ident(exit) - -doctype(#!/usr/bin/ruby) -ident(require) string - -ident(cgi) operator(=) constant(CGI)operator(.)ident(new) -ident(oreo) operator(=) constant(CGI)operator(::)constant(Cookie)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) constant(Time)operator(.)ident(now) operator(+) operator(()integer(3) operator(*) integer(30) operator(*) integer(24) operator(*) integer(60) operator(*) integer(60)operator(\))operator(,) - string operator(=)operator(>) stringoperator(\)) - -ident(whither) operator(=) string - -ident(cgi)operator(.)ident(out)operator(()string operator(=)operator(>) ident(oreo)operator(,) - string operator(=)operator(>) ident(whither)operator(\))operator({)stringoperator(}) - -doctype(#!/usr/bin/ruby) -comment(# os_snipe - redirect to a Jargon File entry about current OS) -ident(dir) operator(=) string - -ident(agent) operator(=) pre_constant(ENV)operator([)stringoperator(]) - -ident(page) operator(=) reserved(case) - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(else) string -reserved(end) - -ident(print) stringcontent(/)inlinechar(\\n)char(\\n)delimiter(")> - -ident(require) string -ident(cgi) operator(=) constant(CGI)operator(.)ident(new) -ident(cgi)operator(.)ident(out)operator(()string operator(=)operator(>) stringoperator(\))operator({)stringoperator(}) -comment(# this produces:) -comment(# Status: 204 No response) -comment(# Content-Type: text/html) -comment(# Content-Length: 0) -comment(# ) - - -comment(# @@PLEAC@@_19.10) -ident(preference_value) operator(=) ident(cgi)operator(.)ident(cookies)operator([)stringoperator(])operator([)integer(0)operator(]) - -ident(packed_cookie) operator(=) constant(CGI)operator(::)constant(Cookie)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) constant(Time)operator(.)ident(local)operator(()constant(Time)operator(.)ident(now)operator(.)ident(year) operator(+) integer(2)operator(,) - constant(Time)operator(.)ident(now)operator(.)ident(mon)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(day)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(hour)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(min)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(sec)operator(\)) operator(\)) - -ident(cgi)operator(.)ident(header)operator(()string operator(=)operator(>) operator([)ident(packed_cookie)operator(])operator(\)) - -doctype(#!/usr/local/bin/ruby -w) -comment(# ic_cookies - sample CGI script that uses a cookie) -ident(require) string - -ident(cgi) operator(=) constant(CGI)operator(.)ident(new)operator(()stringoperator(\)) - -ident(cookname) operator(=) string -ident(favorite) operator(=) ident(cgi)operator(.)ident(params)operator([)stringoperator(])operator([)integer(0)operator(]) -ident(tasty) operator(=) ident(cgi)operator(.)ident(cookies)operator([)ident(cookname)operator(])operator([)integer(0)operator(]) operator(||) string - -reserved(unless) ident(favorite) - ident(cgi)operator(.)ident(out) operator({) - ident(cgi)operator(.)ident(html) operator({) - ident(cgi)operator(.)ident(head) operator({) ident(cgi)operator(.)ident(title) operator({) string operator(}) operator(}) operator(+) - ident(cgi)operator(.)ident(body) operator({) - ident(cgi)operator(.)ident(h1) operator({) string operator(}) operator(+) - ident(cgi)operator(.)ident(hr) operator(+) - ident(cgi)operator(.)ident(form) operator({) - ident(cgi)operator(.)ident(p) operator({) string operator(+) - ident(cgi)operator(.)ident(text_field)operator(()stringoperator(,) ident(tasty) operator(\)) operator(}) - operator(}) operator(+) - ident(cgi)operator(.)ident(hr) - operator(}) - operator(}) - operator(}) -reserved(else) - ident(cookie) operator(=) constant(CGI)operator(::)constant(Cookie)operator(.)ident(new)operator(() string operator(=)operator(>) ident(cookname)operator(,) - string operator(=)operator(>) ident(favorite)operator(,) - string operator(=)operator(>) constant(Time)operator(.)ident(local)operator(()constant(Time)operator(.)ident(now)operator(.)ident(year) operator(+) integer(2)operator(,) -constant(Time)operator(.)ident(now)operator(.)ident(mon)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(day)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(hour)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(min)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(sec)operator(\)) operator(\)) - ident(cgi)operator(.)ident(out)operator(()string operator(=)operator(>) operator([)ident(cookie)operator(])operator(\)) operator({) - ident(cgi)operator(.)ident(html) operator({) - ident(cgi)operator(.)ident(head) operator({) ident(cgi)operator(.)ident(title) operator({) string operator(}) operator(}) operator(+) - ident(cgi)operator(.)ident(body) operator({) - ident(cgi)operator(.)ident(h1) operator({) string operator(}) operator(+) - ident(cgi)operator(.)ident(p) operator({) stringcontent('.)delimiter(")> operator(}) - operator(}) - operator(}) - operator(}) -reserved(end) - - -comment(# @@PLEAC@@_20.9) -reserved(def) method(templatefile)operator(()ident(filename)operator(,) ident(fillings)operator(\)) - ident(aFile) operator(=) constant(File)operator(.)ident(new)operator(()ident(filename)operator(,) stringoperator(\)) - ident(text) operator(=) ident(aFile)operator(.)ident(read)operator(()operator(\)) - ident(aFile)operator(.)ident(close)operator(()operator(\)) - ident(pattern) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(\)) - ident(text)operator(.)ident(gsub!)operator(()ident(pattern)operator(\)) operator({) - ident(fillings)operator([)global_variable($1)operator(]) operator(||) string - operator(}) - ident(text) -reserved(end) - -ident(fields) operator(=) operator({) - string operator(=)operator(>) ident(whats_his_name)operator(,) - string operator(=)operator(>) ident(login_count)operator(,) - string operator(=)operator(>) ident(minutes_used) -operator(}) -ident(puts) ident(templatefile)operator(()stringoperator(,) ident(fields)operator(\)) - -comment(# @@INCOMPLETE@@) -comment(# An example using databases is missing) - - diff --git a/test/scanners/ruby/pleac.in.rb b/test/scanners/ruby/pleac.in.rb deleted file mode 100644 index 0f967b9..0000000 --- a/test/scanners/ruby/pleac.in.rb +++ /dev/null @@ -1,6368 +0,0 @@ -# -*- ruby -*- - -# Local variables: -# indent-tabs-mode: nil -# ruby-indent-level: 4 -# End: - -# @@PLEAC@@_NAME -# @@SKIP@@ Ruby - -# @@PLEAC@@_WEB -# @@SKIP@@ http://www.ruby-lang.org - - -# @@PLEAC@@_1.0 -string = '\n' # two characters, \ and an n -string = 'Jon \'Maddog\' Orwant' # literal single quotes - -string = "\n" # a "newline" character -string = "Jon \"Maddog\" Orwant" # literal double quotes - -string = %q/Jon 'Maddog' Orwant/ # literal single quotes - -string = %q[Jon 'Maddog' Orwant] # literal single quotes -string = %q{Jon 'Maddog' Orwant} # literal single quotes -string = %q(Jon 'Maddog' Orwant) # literal single quotes -string = %q # literal single quotes - -a = <<"EOF" -This is a multiline here document -terminated by EOF on a line by itself -EOF - - -# @@PLEAC@@_1.1 -value = string[offset,count] -value = string[offset..-1] - -string[offset,count] = newstring -string[offset..-1] = newtail - -# in Ruby we can also specify intervals by their two offsets -value = string[offset..offs2] -string[offset..offs2] = newstring - -leading, s1, s2, trailing = data.unpack("A5 x3 A8 A8 A*") - -fivers = string.unpack("A5" * (string.length/5)) - -chars = string.unpack("A1" * string.length) - -string = "This is what you have" -# +012345678901234567890 Indexing forwards (left to right) -# 109876543210987654321- Indexing backwards (right to left) -# note that 0 means 10 or 20, etc. above - -first = string[0, 1] # "T" -start = string[5, 2] # "is" -rest = string[13..-1] # "you have" -last = string[-1, 1] # "e" -end_ = string[-4..-1] # "have" -piece = string[-8, 3] # "you" - -string[5, 2] = "wasn't" # change "is" to "wasn't" -string[-12..-1] = "ondrous" # "This wasn't wondrous" -string[0, 1] = "" # delete first character -string[-10..-1] = "" # delete last 10 characters - -if string[-10..-1] =~ /pattern/ - puts "Pattern matches in last 10 characters" -end - -string[0, 5].gsub!(/is/, 'at') - -a = "make a hat" -a[0, 1], a[-1, 1] = a[-1, 1], a[0, 1] - -a = "To be or not to be" -b = a.unpack("x6 A6") - -b, c = a.unpack("x6 A2 X5 A2") -puts "#{b}\n#{c}\n" - -def cut2fmt(*args) - template = '' - lastpos = 1 - for place in args - template += "A" + (place - lastpos).to_s + " " - lastpos = place - end - template += "A*" - return template -end - -fmt = cut2fmt(8, 14, 20, 26, 30) - - -# @@PLEAC@@_1.2 -# careful! "b is true" doesn't mean "b != 0" (0 is true in Ruby) -# thus no problem of "defined" later since only nil is false -# the following sets to `c' if `b' is nil or false -a = b || c - -# if you need Perl's behaviour (setting to `c' if `b' is 0) the most -# effective way is to use Numeric#nonzero? (thanks to Dave Thomas!) -a = b.nonzero? || c - -# you will still want to use defined? in order to test -# for scope existence of a given object -a = defined?(b) ? b : c - -dir = ARGV.shift || "/tmp" - - -# @@PLEAC@@_1.3 -v1, v2 = v2, v1 - -alpha, beta, production = %w(January March August) -alpha, beta, production = beta, production, alpha - - -# @@PLEAC@@_1.4 -num = char[0] -char = num.chr - -# Ruby also supports having a char from character constant -num = ?r - -char = sprintf("%c", num) -printf("Number %d is character %c\n", num, num) - -ascii = string.unpack("C*") -string = ascii.pack("C*") - -hal = "HAL" -ascii = hal.unpack("C*") -# We can't use Array#each since we can't mutate a Fixnum -ascii.collect! { |i| - i + 1 # add one to each ASCII value -} -ibm = ascii.pack("C*") -puts ibm - - -# @@PLEAC@@_1.5 -array = string.split('') - -array = string.unpack("C*") - -string.scan(/./) { |b| - # do something with b -} - -string = "an apple a day" -print "unique chars are: ", string.split('').uniq.sort, "\n" - -sum = 0 -for ascval in string.unpack("C*") # or use Array#each for a pure OO style :) - sum += ascval -end -puts "sum is #{sum & 0xffffffff}" # since Ruby will go Bignum if necessary - -# @@INCLUDE@@ include/ruby/slowcat.rb - - -# @@PLEAC@@_1.6 -revbytes = string.reverse - -revwords = string.split(" ").reverse.join(" ") - -revwords = string.split(/(\s+)/).reverse.join - -# using the fact that IO is Enumerable, you can directly "select" it -long_palindromes = File.open("/usr/share/dict/words"). - select { |w| w.chomp!; w.reverse == w && w.length > 5 } - - -# @@PLEAC@@_1.7 -while string.sub!("\t+") { ' ' * ($&.length * 8 - $`.length % 8) } -end - - -# @@PLEAC@@_1.8 -'You owe #{debt} to me'.gsub(/\#{(\w+)}/) { eval($1) } - -rows, cols = 24, 80 -text = %q(I am #{rows} high and #{cols} long) -text.gsub!(/\#{(\w+)}/) { eval("#{$1}") } -puts text - -'I am 17 years old'.gsub(/\d+/) { 2 * $&.to_i } - - -# @@PLEAC@@_1.9 -e = "bo peep".upcase -e.downcase! -e.capitalize! - -"thIS is a loNG liNE".gsub!(/\w+/) { $&.capitalize } - - -# @@PLEAC@@_1.10 -"I have #{n+1} guanacos." -print "I have ", n+1, " guanacos." - - -# @@PLEAC@@_1.11 -var = <<'EOF'.gsub(/^\s+/, '') - your text - goes here -EOF - - -# @@PLEAC@@_1.12 -string = "Folding and splicing is the work of an editor,\n"+ - "not a mere collection of silicon\n"+ - "and\n"+ - "mobile electrons!" - -def wrap(str, max_size) - all = [] - line = '' - for l in str.split - if (line+l).length >= max_size - all.push(line) - line = '' - end - line += line == '' ? l : ' ' + l - end - all.push(line).join("\n") -end - -print wrap(string, 20) -#=> Folding and -#=> splicing is the -#=> work of an editor, -#=> not a mere -#=> collection of -#=> silicon and mobile -#=> electrons! - - -# @@PLEAC@@_1.13 -string = %q(Mom said, "Don't do that.") -string.gsub(/['"]/) { '\\'+$& } -string.gsub(/['"]/, '\&\&') -string.gsub(/[^A-Z]/) { '\\'+$& } -"is a test!".gsub(/\W/) { '\\'+$& } # no function like quotemeta? - - -# @@PLEAC@@_1.14 -string.strip! - - -# @@PLEAC@@_1.15 -def parse_csv(text) - new = text.scan(/"([^\"\\]*(?:\\.[^\"\\]*)*)",?|([^,]+),?|,/) - new << nil if text[-1] == ?, - new.flatten.compact -end - -line = %q -fields = parse_csv(line) -fields.each_with_index { |v,i| - print "#{i} : #{v}\n"; -} - - -# @@PLEAC@@_1.16 -# Use the soundex.rb Library from Michael Neumann. -# http://www.s-direktnet.de/homepages/neumann/rb_prgs/Soundex.rb -require 'Soundex' - -code = Text::Soundex.soundex(string) -codes = Text::Soundex.soundex(array) - -# substitution function for getpwent(): -# returns an array of user entries, -# each entry contains the username and the full name -def login_names - result = [] - File.open("/etc/passwd") { |file| - file.each_line { |line| - next if line.match(/^#/) - cols = line.split(":") - result.push([cols[0], cols[4]]) - } - } - result -end - -puts "Lookup user: " -user = STDIN.gets -user.chomp! -exit unless user -name_code = Text::Soundex.soundex(user) - -splitter = Regexp.new('(\w+)[^,]*\b(\w+)') -for username, fullname in login_names do - firstname, lastname = splitter.match(fullname)[1,2] - if name_code == Text::Soundex.soundex(username) - || name_code == Text::Soundex.soundex(firstname) - || name_code == Text::Soundex.soundex(lastname) - then - puts "#{username}: #{firstname} #{lastname}" - end -end - - -# @@PLEAC@@_1.17 -# @@INCLUDE@@ include/ruby/fixstyle.rb - - -# @@PLEAC@@_1.18 -# @@INCLUDE@@ include/ruby/psgrep.rb - - -# @@PLEAC@@_2.1 -# Matz tells that you can use Integer() for strict checked conversion. -Integer("abc") -#=> `Integer': invalid value for Integer: "abc" (ArgumentError) -Integer("567") -#=> 567 - -# You may use Float() for floating point stuff -Integer("56.7") -#=> `Integer': invalid value for Integer: "56.7" (ArgumentError) -Float("56.7") -#=> 56.7 - -# You may also use a regexp for that -if string =~ /^[+-]?\d+$/ - p 'is an integer' -else - p 'is not' -end - -if string =~ /^-?(?:\d+(?:\.\d*)?|\.\d+)$/ - p 'is a decimal number' -else - p 'is not' -end - - -# @@PLEAC@@_2.2 -# equal(num1, num2, accuracy) : returns true if num1 and num2 are -# equal to accuracy number of decimal places -def equal(i, j, a) - sprintf("%.#{a}g", i) == sprintf("%.#{a}g", j) -end - -wage = 536 # $5.36/hour -week = 40 * wage # $214.40 -printf("One week's wage is: \$%.2f\n", week/100.0) - - -# @@PLEAC@@_2.3 -num.round # rounds to integer - -a = 0.255 -b = sprintf("%.2f", a) -print "Unrounded: #{a}\nRounded: #{b}\n" -printf "Unrounded: #{a}\nRounded: %.2f\n", a - -print "number\tint\tfloor\tceil\n" -a = [ 3.3 , 3.5 , 3.7, -3.3 ] -for n in a - printf("% .1f\t% .1f\t% .1f\t% .1f\n", # at least I don't fake my output :) - n, n.to_i, n.floor, n.ceil) -end - - -# @@PLEAC@@_2.4 -def dec2bin(n) - [n].pack("N").unpack("B32")[0].sub(/^0+(?=\d)/, '') -end - -def bin2dec(n) - [("0"*32+n.to_s)[-32..-1]].pack("B32").unpack("N")[0] -end - - -# @@PLEAC@@_2.5 -for i in x .. y - # i is set to every integer from x to y, inclusive -end - -x.step(y,7) { |i| - # i is set to every integer from x to y, stepsize = 7 -} - -print "Infancy is: " -(0..2).each { |i| - print i, " " -} -print "\n" - - -# @@PLEAC@@_2.6 -# We can add conversion methods to the Integer class, -# this makes a roman number just a representation for normal numbers. -class Integer - - @@romanlist = [["M", 1000], - ["CM", 900], - ["D", 500], - ["CD", 400], - ["C", 100], - ["XC", 90], - ["L", 50], - ["XL", 40], - ["X", 10], - ["IX", 9], - ["V", 5], - ["IV", 4], - ["I", 1]] - - def to_roman - remains = self - roman = "" - for sym, num in @@romanlist - while remains >= num - remains -= num - roman << sym - end - end - roman - end - - def Integer.from_roman(roman) - ustr = roman.upcase - sum = 0 - for entry in @@romanlist - sym, num = entry[0], entry[1] - while sym == ustr[0, sym.length] - sum += num - ustr.slice!(0, sym.length) - end - end - sum - end - -end - - -roman_fifteen = 15.to_roman -puts "Roman for fifteen is #{roman_fifteen}" -i = Integer.from_roman(roman_fifteen) -puts "Converted back, #{roman_fifteen} is #{i}" - -# check -for i in (1..3900) - r = i.to_roman - j = Integer.from_roman(r) - if i != j - puts "error: #{i} : #{r} - #{j}" - end -end - - -# @@PLEAC@@_2.7 -random = rand(y-x+1)+x - -chars = ["A".."Z","a".."z","0".."9"].collect { |r| r.to_a }.join + %q(!@$%^&*) -password = (1..8).collect { chars[rand(chars.size)] }.pack("C*") - - -# @@PLEAC@@_2.8 -srand # uses a combination of the time, the process id, and a sequence number -srand(val) # for repeatable behaviour - - -# @@PLEAC@@_2.9 -# from the randomr lib: -# http://raa.ruby-lang.org/project/randomr/ -----> http://raa.ruby-lang.org/project/randomr/ - -require 'random/mersenne_twister' -mers = Random::MersenneTwister.new 123456789 -puts mers.rand(0) # 0.550321932544541 -puts mers.rand(10) # 2 - -# using online sources of random data via the realrand package: -# http://raa.ruby-lang.org/project/realrand/ -# **Note** -# The following online services are used in this package: -# http://www.random.org - source: atmospheric noise -# http://www.fourmilab.ch/hotbits - source: radioactive decay timings -# http://random.hd.org - source: entropy from local and network noise -# Please visit the sites and respect the rules of each service. - -require 'random/online' - -generator1 = Random::RandomOrg.new -puts generator1.randbyte(5).join(",") -puts generator1.randnum(10, 1, 6).join(",") # Roll dice 10 times. - -generator2 = Random::FourmiLab.new -puts generator2.randbyte(5).join(",") -# randnum is not supported. - -generator3 = Random::EntropyPool.new -puts generator3.randbyte(5).join(",") -# randnum is not supported. - - -# @@PLEAC@@_2.10 -def gaussian_rand - begin - u1 = 2 * rand() - 1 - u2 = 2 * rand() - 1 - w = u1*u1 + u2*u2 - end while (w >= 1) - w = Math.sqrt((-2*Math.log(w))/w) - [ u2*w, u1*w ] -end - -mean = 25 -sdev = 2 -salary = gaussian_rand[0] * sdev + mean -printf("You have been hired at \$%.2f\n", salary) - - -# @@PLEAC@@_2.11 -def deg2rad(d) - (d/180.0)*Math::PI -end - -def rad2deg(r) - (r/Math::PI)*180 -end - - -# @@PLEAC@@_2.12 -sin_val = Math.sin(angle) -cos_val = Math.cos(angle) -tan_val = Math.tan(angle) - -# AFAIK Ruby's Math module doesn't provide acos/asin -# While we're at it, let's also define missing hyperbolic functions -module Math - def Math.asin(x) - atan2(x, sqrt(1 - x**2)) - end - def Math.acos(x) - atan2(sqrt(1 - x**2), x) - end - def Math.atan(x) - atan2(x, 1) - end - def Math.sinh(x) - (exp(x) - exp(-x)) / 2 - end - def Math.cosh(x) - (exp(x) + exp(-x)) / 2 - end - def Math.tanh(x) - sinh(x) / cosh(x) - end -end - -# The support for Complex numbers is not built-in -y = Math.acos(3.7) -#=> in `sqrt': square root for negative number (ArgumentError) - -# There is an implementation of Complex numbers in 'complex.rb' in current -# Ruby distro, but it doesn't support atan2 with complex args, so it doesn't -# solve this problem. - - -# @@PLEAC@@_2.13 -log_e = Math.log(val) -log_10 = Math.log10(val) - -def log_base(base, val) - Math.log(val)/Math.log(base) -end - -answer = log_base(10, 10_000) -puts "log10(10,000) = #{answer}" - - -# @@PLEAC@@_2.14 -require 'matrix.rb' - -a = Matrix[[3, 2, 3], [5, 9, 8]] -b = Matrix[[4, 7], [9, 3], [8, 1]] -c = a * b - -a.row_size -a.column_size - -c.det -a.transpose - - -# @@PLEAC@@_2.15 -require 'complex.rb' -require 'rational.rb' - -a = Complex(3, 5) # 3 + 5i -b = Complex(2, -2) # 2 - 2i -puts "c = #{a*b}" - -c = a * b -d = 3 + 4*Complex::I - -printf "sqrt(#{d}) = %s\n", Math.sqrt(d) - - -# @@PLEAC@@_2.16 -number = hexadecimal.hex -number = octal.oct - -print "Gimme a number in decimal, octal, or hex: " -num = gets.chomp -exit unless defined?(num) -num = num.oct if num =~ /^0/ # does both oct and hex -printf "%d %x %o\n", num, num, num - -print "Enter file permission in octal: " -permissions = gets.chomp -raise "Exiting ...\n" unless defined?(permissions) -puts "The decimal value is #{permissions.oct}" - - -# @@PLEAC@@_2.17 -def commify(n) - n.to_s =~ /([^\.]*)(\..*)?/ - int, dec = $1.reverse, $2 ? $2 : "" - while int.gsub!(/(,|\.|^)(\d{3})(\d)/, '\1\2,\3') - end - int.reverse + dec -end - - -# @@PLEAC@@_2.18 -printf "It took %d hour%s\n", time, time == 1 ? "" : "s" - -# dunno if an equivalent to Lingua::EN::Inflect exists... - - -# @@PLEAC@@_2.19 -#----------------------------- -#!/usr/bin/ruby -# bigfact - calculating prime factors -def factorize(orig) - factors = {} - factors.default = 0 # return 0 instead nil if key not found in hash - n = orig - i = 2 - sqi = 4 # square of i - while sqi <= n do - while n.modulo(i) == 0 do - n /= i - factors[i] += 1 - # puts "Found factor #{i}" - end - # we take advantage of the fact that (i +1)**2 = i**2 + 2*i +1 - sqi += 2 * i + 1 - i += 1 - end - - if (n != 1) && (n != orig) - factors[n] += 1 - end - factors -end - -def printfactorhash(orig, factorcount) - print format("%-10d ", orig) - if factorcount.length == 0 - print "PRIME" - else - # sorts after number, because the hash keys are numbers - factorcount.sort.each { |factor,exponent| - print factor - if exponent > 1 - print "**", exponent - end - print " " - } - end - puts -end - -for arg in ARGV - n = arg.to_i - mfactors = factorize(n) - printfactorhash(n, mfactors) -end -#----------------------------- - - -# @@PLEAC@@_3.0 -puts Time.now - -print "Today is day ", Time.now.yday, " of the current year.\n" -print "Today is day ", Time.now.day, " of the current month.\n" - - -# @@PLEAC@@_3.1 -day, month, year = Time.now.day, Time.now.month, Time.now.year -# or -day, month, year = Time.now.to_a[3..5] - -tl = Time.now.localtime -printf("The current date is %04d %02d %02d\n", tl.year, tl.month, tl.day) - -Time.now.localtime.strftime("%Y-%m-%d") - - -# @@PLEAC@@_3.2 -Time.local(year, month, day, hour, minute, second).tv_sec -Time.gm(year, month, day, hour, minute, second).tv_sec - - -# @@PLEAC@@_3.3 -sec, min, hour, day, month, year, wday, yday, isdst, zone = Time.at(epoch_secs).to_a - - -# @@PLEAC@@_3.4 -when_ = now + difference # now -> Time ; difference -> Numeric (delta in seconds) -then_ = now - difference - - -# @@PLEAC@@_3.5 -bree = 361535725 -nat = 96201950 - -difference = bree - nat -puts "There were #{difference} seconds between Nat and Bree" - -seconds = difference % 60 -difference = (difference - seconds) / 60 -minutes = difference % 60 -difference = (difference - minutes) / 60 -hours = difference % 24 -difference = (difference - hours) / 24 -days = difference % 7 -weeks = (difference - days) / 7 - -puts "(#{weeks} weeks, #{days} days, #{hours}:#{minutes}:#{seconds})" - - -# @@PLEAC@@_3.6 -monthday, weekday, yearday = date.mday, date.wday, date.yday - -# AFAIK the week number is not just a division since week boundaries are on sundays -weeknum = d.strftime("%U").to_i + 1 - -year = 1981 -month = "jun" # or `6' if you want to emulate a broken language -day = 16 -t = Time.mktime(year, month, day) -print "#{month}/#{day}/#{year} was a ", t.strftime("%A"), "\n" - - -# @@PLEAC@@_3.7 -yyyy, mm, dd = $1, $2, $3 if "1998-06-25" =~ /(\d+)-(\d+)-(\d+)/ - -epoch_seconds = Time.mktime(yyyy, mm, dd).tv_sec - -# dunno an equivalent to Date::Manip#ParseDate - - -# @@PLEAC@@_3.8 -string = Time.at(epoch_secs) -Time.at(1234567890).gmtime # gives: Fri Feb 13 23:31:30 UTC 2009 - -time = Time.mktime(1973, "jan", 18, 3, 45, 50) -print "In localtime it gives: ", time.localtime, "\n" - - -# @@PLEAC@@_3.9 -# Ruby provides micro-seconds in Time object -Time.now.usec - -# Ruby gives the seconds in floating format when substracting two Time objects -before = Time.now -line = gets -elapsed = Time.now - before -puts "You took #{elapsed} seconds." - -# On my Celeron-400 with Linux-2.2.19-14mdk, average for three execs are: -# This Ruby version: average 0.00321 sec -# Cookbook's Perl version: average 0.00981 sec -size = 500 -number_of_times = 100 -total_time = 0 -number_of_times.times { - # populate array - array = [] - size.times { array << rand } - # sort it - begin_ = Time.now - array.sort! - time = Time.now - begin_ - total_time += time -} -printf "On average, sorting %d random numbers takes %.5f seconds\n", - size, (total_time/Float(number_of_times)) - - -# @@PLEAC@@_3.10 -sleep(0.005) # Ruby is definitely not as broken as Perl :) -# (may be interrupted by sending the process a SIGALRM) - - -# @@PLEAC@@_3.11 -#!/usr/bin/ruby -w -# hopdelta - feed mail header, produce lines -# showing delay at each hop. -require 'time' -class MailHopDelta - - def initialize(mail) - @head = mail.gsub(/\n\s+/,' ') - @topline = %w-Sender Recipient Time Delta- - @start_from = mail.match(/^From.*\@([^\s>]*)/)[1] - @date = Time.parse(mail.match(/^Date:\s+(.*)/)[1]) - end - - def out(line) - "%-20.20s %-20.20s %-20.20s %s" % line - end - - def hop_date(day) - day.strftime("%I:%M:%S %Y/%m/%d") - end - - def puts_hops - puts out(@topline) - puts out(['Start', @start_from, hop_date(@date),'']) - @head.split(/\n/).reverse.grep(/^Received:/).each do |hop| - hop.gsub!(/\bon (.*?) (id.*)/,'; \1') - whence = hop.match(/;\s+(.*)$/)[1] - unless whence - warn "Bad received line: #{hop}" - next - end - from = $+ if hop =~ /from\s+(\S+)|\((.*?)\)/ - by = $1 if hop =~ /by\s+(\S+\.\S+)/ - next unless now = Time.parse(whence).localtime - delta = now - @date - puts out([from, by, hop_date(now), hop_time(delta)]) - @date = now - end - end - - def hop_time(secs) - sign = secs < 0 ? -1 : 1 - days, secs = secs.abs.divmod(60 * 60 * 24) - hours,secs = secs.abs.divmod(60 * 60) - mins, secs = secs.abs.divmod(60) - rtn = "%3ds" % [secs * sign] - rtn << "%3dm" % [mins * sign] if mins != 0 - rtn << "%3dh" % [hours * sign] if hours != 0 - rtn << "%3dd" % [days * sign] if days != 0 - rtn - end -end - -$/ = "" -mail = MailHopDelta.new(ARGF.gets).puts_hops - - -# @@PLEAC@@_4.0 -single_level = [ "this", "that", "the", "other" ] - -# Ruby directly supports nested arrays -double_level = [ "this", "that", [ "the", "other" ] ] -still_single_level = [ "this", "that", [ "the", "other" ] ].flatten - - -# @@PLEAC@@_4.1 -a = [ "quick", "brown", "fox" ] -a = %w(Why are you teasing me?) - -lines = <<"END_OF_HERE_DOC".gsub(/^\s*(.+)/, '\1') - The boy stood on the burning deck, - It was as hot as glass. -END_OF_HERE_DOC - -bigarray = IO.readlines("mydatafile").collect { |l| l.chomp } - -name = "Gandalf" -banner = %Q(Speak, #{name}, and welcome!) - -host_info = `host #{his_host}` - -%x(ps #{$$}) - -banner = 'Costs only $4.95'.split(' ') - -rax = %w! ( ) < > { } [ ] ! - - -# @@PLEAC@@_4.2 -def commify_series(arr) - return '' if not arr - case arr.size - when 0 then '' - when 1 then arr[0] - when 2 then arr.join(' and ') - else arr[0..-2].join(', ') + ', and ' + arr[-1] - end -end - -array = [ "red", "yellow", "green" ] - -print "I have ", array, " marbles\n" -# -> I have redyellowgreen marbles - -# But unlike Perl: -print "I have #{array} marbles\n" -# -> I have redyellowgreen marbles -# So, needs: -print "I have #{array.join(' ')} marbles\n" -# -> I have red yellow green marbles - -#!/usr/bin/ruby -# communify_series - show proper comma insertion in list output - -def commify_series(arr) - return '' if not arr - sepchar = arr.find { |p| p =~ /,/ } ? '; ' : ', ' - case arr.size - when 0 then '' - when 1 then arr[0] - when 2 then arr.join(' and ') - else arr[0..-2].join(sepchar) + sepchar + 'and ' + arr[-1] - end -end - -lists = [ - [ 'just one thing' ], - %w(Mutt Jeff), - %w(Peter Paul Mary), - [ 'To our parents', 'Mother Theresa', 'God' ], - [ 'pastrami', 'ham and cheese', 'peanut butter and jelly', 'tuna' ], - [ 'recycle tired, old phrases', 'ponder big, happy thoughts' ], - [ 'recycle tired, old phrases', - 'ponder big, happy thoughts', - 'sleep and dream peacefully' ], -] - -for list in lists do - puts "The list is: #{commify_series(list)}." -end - - -# @@PLEAC@@_4.3 -# (note: AFAIK Ruby doesn't allow gory change of Array length) -# grow the array by assigning nil to past the end of array -ary[new_size-1] = nil -# shrink the array by slicing it down -ary.slice!(new_size..-1) -# init the array with given size -Array.new(number_of_elems) -# assign to an element past the original end enlarges the array -ary[index_new_last_elem] = value - -def what_about_that_array(a) - print "The array now has ", a.size, " elements.\n" - # Index of last element is not really interesting in Ruby - print "Element #3 is `#{a[3]}'.\n" -end -people = %w(Crosby Stills Nash Young) -what_about_that_array(people) - - -# @@PLEAC@@_4.4 -# OO style -bad_users.each { |user| - complain(user) -} -# or, functional style -for user in bad_users - complain(user) -end - -for var in ENV.keys.sort - puts "#{var}=#{ENV[var]}" -end - -for user in all_users - disk_space = get_usage(user) - if (disk_space > MAX_QUOTA) - complain(user) - end -end - -for l in IO.popen("who").readlines - print l if l =~ /^gc/ -end - -# we can mimic the obfuscated Perl way -while fh.gets # $_ is set to the line just read - chomp # $_ has a trailing \n removed, if it had one - split.each { |w| # $_ is split on whitespace - # but $_ is not set to each chunk as in Perl - print w.reverse - } -end -# ...or use a cleaner way -for l in fh.readlines - l.chomp.split.each { |w| print w.reverse } -end - -# same drawback as in problem 1.4, we can't mutate a Numeric... -array.collect! { |v| v - 1 } - -a = [ .5, 3 ]; b = [ 0, 1 ] -for ary in [ a, b ] - ary.collect! { |v| v * 7 } -end -puts "#{a.join(' ')} #{b.join(' ')}" - -# we can mutate Strings, cool; we need a trick for the scalar -for ary in [ [ scalar ], array, hash.values ] - ary.each { |v| v.strip! } # String#strip rules :) -end - - -# @@PLEAC@@_4.5 -# not relevant in Ruby since we have always references -for item in array - # do somethingh with item -end - - -# @@PLEAC@@_4.6 -unique = list.uniq - -# generate a list of users logged in, removing duplicates -users = `who`.collect { |l| l =~ /(\w+)/; $1 }.sort.uniq -puts("users logged in: #{commify_series(users)}") # see 4.2 for commify_series - - -# @@PLEAC@@_4.7 -a - b -# [ 1, 1, 2, 2, 3, 3, 3, 4, 5 ] - [ 1, 2, 4 ] -> [3, 5] - - -# @@PLEAC@@_4.8 -union = a | b -intersection = a & b -difference = a - b - - -# @@PLEAC@@_4.9 -array1.concat(array2) -# if you will assign to another object, better use: -new_ary = array1 + array2 - -members = [ "Time", "Flies" ] -initiates = [ "An", "Arrow" ] -members += initiates - -members = [ "Time", "Flies" ] -initiates = [ "An", "Arrow" ] -members[2,0] = [ "Like", initiates ].flatten - -members[0] = "Fruit" -members[3,2] = "A", "Banana" - - -# @@PLEAC@@_4.10 -reversed = ary.reverse - -ary.reverse_each { |e| - # do something with e -} - -descending = ary.sort.reverse -descending = ary.sort { |a,b| b <=> a } - - -# @@PLEAC@@_4.11 -# remove n elements from front of ary (shift n) -front = ary.slice!(0, n) - -# remove n elements from the end of ary (pop n) -end_ = ary.slice!(-n .. -1) - -# let's extend the Array class, to make that useful -class Array - def shift2() - slice!(0 .. 1) # more symetric with pop2... - end - def pop2() - slice!(-2 .. -1) - end -end - -friends = %w(Peter Paul Mary Jim Tim) -this, that = friends.shift2 - -beverages = %w(Dew Jolt Cola Sprite Fresca) -pair = beverages.pop2 - - -# @@PLEAC@@_4.12 -# use Enumerable#detect (or the synonym Enumerable#find) -highest_eng = employees.detect { |emp| emp.category == 'engineer' } - - -# @@PLEAC@@_4.13 -# use Enumerable#select (or the synonym Enumerable#find_all) -bigs = nums.select { |i| i > 1_000_000 } -pigs = users.keys.select { |k| users[k] > 1e7 } - -matching = `who`.select { |u| u =~ /^gnat / } - -engineers = employees.select { |e| e.position == 'Engineer' } - -secondary_assistance = applicants.select { |a| - a.income >= 26_000 && a.income < 30_000 -} - - -# @@PLEAC@@_4.14 -# normally you would have an array of Numeric (Float or -# Fixnum or Bignum), so you would use: -sorted = unsorted.sort -# if you have strings representing Integers or Floats -# you may specify another sort method: -sorted = unsorted.sort { |a,b| a.to_f <=> b.to_f } - -# let's use the list of my own PID's -`ps ux`.split("\n")[1..-1]. - select { |i| i =~ /^#{ENV['USER']}/ }. - collect { |i| i.split[1] }. - sort { |a,b| a.to_i <=> b.to_i }.each { |i| puts i } -puts "Select a process ID to kill:" -pid = gets.chomp -raise "Exiting ... \n" unless pid && pid =~ /^\d+$/ -Process.kill('TERM', pid.to_i) -sleep 2 -Process.kill('KILL', pid.to_i) - -descending = unsorted.sort { |a,b| b.to_f <=> a.to_f } - - -# @@PLEAC@@_4.15 -ordered = unordered.sort { |a,b| compare(a,b) } - -precomputed = unordered.collect { |e| [compute, e] } -ordered_precomputed = precomputed.sort { |a,b| a[0] <=> b[0] } -ordered = ordered_precomputed.collect { |e| e[1] } - -ordered = unordered.collect { |e| [compute, e] }. - sort { |a,b| a[0] <=> b[0] }. - collect { |e| e[1] } - -for employee in employees.sort { |a,b| a.name <=> b.name } - print employee.name, " earns \$ ", employee.salary, "\n" -end - -# Beware! `0' is true in Ruby. -# For chaining comparisons, you may use Numeric#nonzero?, which -# returns num if num is not zero, nil otherwise -sorted = employees.sort { |a,b| (a.name <=> b.name).nonzero? || b.age <=> a.age } - -users = [] -# getpwent is not wrapped in Ruby... let's fallback -IO.readlines('/etc/passwd').each { |u| users << u.split(':') } -users.sort! { |a,b| a[0] <=> b[0] } -for user in users - puts user[0] -end - -sorted = names.sort { |a,b| a[1, 1] <=> b[1, 1] } -sorted = strings.sort { |a,b| a.length <=> b.length } - -# let's show only the compact version -ordered = strings.collect { |e| [e.length, e] }. - sort { |a,b| a[0] <=> b[0] }. - collect { |e| e[1] } - -ordered = strings.collect { |e| [/\d+/.match(e)[0].to_i, e] }. - sort { |a,b| a[0] <=> b[0] }. - collect { |e| e[1] } - -print `cat /etc/passwd`.collect { |e| [e, e.split(':').indexes(3,2,0)].flatten }. - sort { |a,b| (a[1] <=> b[1]).nonzero? || (a[2] <=> b[2]).nonzero? || a[3] <=> b[3] }. - collect { |e| e[0] } - - -# @@PLEAC@@_4.16 -circular.unshift(circular.pop) # the last shall be first -circular.push(circular.shift) # and vice versa - -def grab_and_rotate(l) - l.push(ret = l.shift) - ret -end - -processes = [1, 2, 3, 4, 5] -while (1) - process = grab_and_rotate(processes) - puts "Handling process #{process}" - sleep 1 -end - - -# @@PLEAC@@_4.17 -def fisher_yates_shuffle(a) - (a.size-1).downto(1) { |i| - j = rand(i+1) - a[i], a[j] = a[j], a[i] if i != j - } -end - -def naive_shuffle(a) - for i in 0...a.size - j = rand(a.size) - a[i], a[j] = a[j], a[i] - end -end - - -# @@PLEAC@@_4.18 -#!/usr/bin/env ruby -# example 4-2 words -# words - gather lines, present in colums - -# class to encapsulate the word formatting from the input -class WordFormatter - def initialize(cols) - @cols = cols - end - - # helper to return the length of the longest word in the wordlist - def maxlen(wordlist) - max = 1 - for word in wordlist - if word.length > max - max = word.length - end - end - max - end - - # process the wordlist and print it formmated into columns - def output(wordlist) - collen = maxlen(wordlist) + 1 - columns = @cols / collen - columns = 1 if columns == 0 - rows = (wordlist.length + columns - 1) / columns - # now process each item, picking out proper piece for this position - 0.upto(rows * columns - 1) { |item| - target = (item % columns) * rows + (item / columns) - eol = ((item+1) % columns == 0) - piece = wordlist[target] || "" - piece = piece.ljust(collen) unless eol - print piece - puts if eol - } - # no need to finish it up, because eol is always true for the last element - end -end - -# get nr of chars that fit in window or console, see PLEAC 15.4 -# not portable -- linux only (?) -def getWinCharWidth() - buf = "\0" * 8 - $stdout.ioctl(0x5413, buf) - ws_row, ws_col, ws_xpixel, ws_ypixel = buf.unpack("$4") - ws_col || 80 -rescue - 80 -end - -# main program -cols = getWinCharWidth() -formatter = WordFormatter.new(cols) -words = readlines() -words.collect! { |line| - line.chomp -} -formatter.output(words) - - -# @@PLEAC@@_4.19 -# In ruby, Fixnum's are automatically converted to Bignum's when -# needed, so there is no need for an extra module -def factorial(n) - s = 1 - while n > 0 - s *= n - n -= 1 - end - s -end - -puts factorial(500) - -#--------------------------------------------------------- -# Example 4-3. tsc-permute -# tsc_permute: permute each word of input -def permute(items, perms) - unless items.length > 0 - puts perms.join(" ") - else - for i in items - newitems = items.dup - newperms = perms.dup - newperms.unshift(newitems.delete(i)) - permute(newitems, newperms) - end - end -end -# In ruby the main program must be after all definitions it is using -permute(ARGV, []) - -#--------------------------------------------------------- -# mjd_permute: permute each word of input - -def factorial(n) - s = 1 - while n > 0 - s *= n - n -= 1 - end - s -end - -# we use a class with a class variable store the private cache -# for the results of the factorial function. -class Factorial - @@fact = [ 1 ] - def Factorial.compute(n) - if @@fact[n] - @@fact[n] - else - @@fact[n] = n * Factorial.compute(n - 1) - end - end -end - -#--------------------------------------------------------- -# Example 4-4- mjd-permute -# n2pat(n, len): produce the N-th pattern of length len - -# We must use a lower case letter as parameter N, otherwise it is -# handled as constant Length is the length of the resulting -# array, not the index of the last element (length -1) like in -# the perl example. -def n2pat(n, length) - pat = [] - i = 1 - while i <= length - pat.push(n % i) - n /= i - i += 1 - end - pat -end - -# pat2perm(pat): turn pattern returned by n2pat() into -# permutation of integers. -def pat2perm(pat) - source = (0 .. pat.length - 1).to_a - perm = [] - perm.push(source.slice!(pat.pop)) while pat.length > 0 - perm -end - -def n2perm(n, len) - pat2perm(n2pat(n,len)) -end - -# In ruby the main program must be after all definitions -while gets - data = split - # the perl solution has used $#data, which is length-1 - num_permutations = Factorial.compute(data.length()) - 0.upto(num_permutations - 1) do |i| - # in ruby we can not use an array as selector for an array - # but by exchanging the two arrays, we can use the collect method - # which returns an array with the result of all block invocations - permutation = n2perm(i, data.length).collect { - |j| data[j] - } - puts permutation.join(" ") - end -end - - -# @@PLEAC@@_5.0 -age = { "Nat", 24, - "Jules", 25, - "Josh", 17 } - -age["Nat"] = 24 -age["Jules"] = 25 -age["Josh"] = 17 - -food_color = { - "Apple" => "red", - "Banana" => "yellow", - "Lemon" => "yellow", - "Carrot" => "orange" - } - -# In Ruby, you cannot avoid the double or simple quoting -# while manipulatin hashes - - -# @@PLEAC@@_5.1 -hash[key] = value - -food_color["Raspberry"] = "pink" -puts "Known foods:", food_color.keys - - -# @@PLEAC@@_5.2 -# does hash have a value for key ? -if (hash.has_key?(key)) - # it exists -else - # it doesn't -end - -[ "Banana", "Martini" ].each { |name| - print name, " is a ", food_color.has_key?(name) ? "food" : "drink", "\n" -} - -age = {} -age['Toddler'] = 3 -age['Unborn'] = 0 -age['Phantasm'] = nil - -for thing in ['Toddler', 'Unborn', 'Phantasm', 'Relic'] - print "#{thing}: " - print "Has-key " if age.has_key?(thing) - print "True " if age[thing] - print "Nonzero " if age[thing] && age[thing].nonzero? - print "\n" -end - -#=> -# Toddler: Has-key True Nonzero -# Unborn: Has-key True -# Phantasm: Has-key -# Relic: - -# You use Hash#has_key? when you use Perl's exists -> it checks -# for existence of a key in a hash. -# All Numeric are "True" in ruby, so the test doesn't have the -# same semantics as in Perl; you would use Numeric#nonzero? to -# achieve the same semantics (false if 0, true otherwise). - - -# @@PLEAC@@_5.3 -food_color.delete("Banana") - - -# @@PLEAC@@_5.4 -hash.each { |key, value| - # do something with key and value -} - -hash.each_key { |key| - # do something with key -} - -food_color.each { |food, color| - puts "#{food} is #{color}" -} - -food_color.each_key { |food| - puts "#{food} is #{food_color[food]}" -} - -# IMO this demonstrates that OO style is by far more readable -food_color.keys.sort.each { |food| - puts "#{food} is #{food_color[food]}." -} - -#----------------------------- -#!/usr/bin/ruby -# countfrom - count number of messages from each sender - -# Default value is 0 -from = Hash.new(0) -while gets - /^From: (.*)/ and from[$1] += 1 -end - -# More useful to sort by number of received mail by person -from.sort {|a,b| b[1]<=>a[1]}.each { |v| - puts "#{v[1]}: #{v[0]}" -} -#----------------------------- - - -# @@PLEAC@@_5.5 -# You may use the built-in 'inspect' method this way: -p hash - -# Or do it the Cookbook way: -hash.each { |k,v| puts "#{k} => #{v}" } - -# Sorted by keys -hash.sort.each { |e| puts "#{e[0]} => #{e[1]}" } -# Sorted by values -hash.sort{|a,b| a[1]<=>b[1]}.each { |e| puts "#{e[0]} => #{e[1]}" } - - -# @@PLEAC@@_5.7 -ttys = Hash.new -for i in `who` - user, tty = i.split - (ttys[user] ||= []) << tty # see problems_ruby for more infos -end -ttys.keys.sort.each { |k| - puts "#{k}: #{commify_series(ttys[k])}" # from 4.2 -} - - -# @@PLEAC@@_5.8 -surname = { "Mickey" => "Mantle", "Babe" => "Ruth" } -puts surname.index("Mantle") - -# If you really needed to 'invert' the whole hash, use Hash#invert - -#----------------------------- -#!/usr/bin/ruby -w -# foodfind - find match for food or color - -given = ARGV.shift or raise "usage: foodfind food_or_color" - -color = { - "Apple" => "red", - "Banana" => "yellow", - "Lemon" => "yellow", - "Carrot" => "orange", -} - -if (color.has_key?(given)) - puts "#{given} is a food with color #{color[given]}." -end -if (color.has_value?(given)) - puts "#{color.index(given)} is a food with color #{given}." -end -#----------------------------- - - -# @@PLEAC@@_5.9 -# Sorted by keys (Hash#sort gives an Array of pairs made of each key,value) -food_color.sort.each { |f| - puts "#{f[0]} is #{f[1]}." -} - -# Sorted by values -food_color.sort { |a,b| a[1] <=> b[1] }.each { |f| - puts "#{f[0]} is #{f[1]}." -} - -# Sorted by length of values -food_color.sort { |a,b| a[1].length <=> b[1].length }.each { |f| - puts "#{f[0]} is #{f[1]}." -} - - -# @@PLEAC@@_5.10 -merged = a.clone.update(b) # because Hash#update changes object in place - -drink_color = { "Galliano" => "yellow", "Mai Tai" => "blue" } -ingested_color = drink_color.clone.update(food_color) - -substance_color = {} -for i in [ food_color, drink_color ] - i.each_key { |k| - if substance_color.has_key?(k) - puts "Warning: #{k} seen twice. Using the first definition." - next - end - substance_color[k] = 1 - } -end - - -# @@PLEAC@@_5.11 -common = hash1.keys & hash2.keys - -this_not_that = hash1.keys - hash2.keys - - -# @@PLEAC@@_5.12 -# no problem here, Ruby handles any kind of object for key-ing -# (it takes Object#hash, which defaults to Object#id) - - -# @@PLEAC@@_5.13 -# AFAIK, not possible in Ruby - - -# @@PLEAC@@_5.14 -# Be careful, the following is possible only because Fixnum objects are -# special (documentation says: there is effectively only one Fixnum object -# instance for any given integer value). -count = Hash.new(0) -array.each { |e| - count[e] += 1 -} - - -# @@PLEAC@@_5.15 -father = { - "Cain" , "Adam", - "Abel" , "Adam", - "Seth" , "Adam", - "Enoch" , "Cain", - "Irad" , "Enoch", - "Mehujael" , "Irad", - "Methusael" , "Mehujael", - "Lamech" , "Methusael", - "Jabal" , "Lamech", - "Jubal" , "Lamech", - "Tubalcain" , "Lamech", - "Enos" , "Seth", -} - -while gets - chomp - begin - print $_, " " - end while $_ = father[$_] - puts -end - -children = {} -father.each { |k,v| - (children[v] ||= []) << k -} -while gets - chomp - puts "#{$_} begat #{(children[$_] || ['Nobody']).join(', ')}.\n" -end - -includes = {} -files.each { |f| - begin - for l in IO.readlines(f) - next unless l =~ /^\s*#\s*include\s*<([^>]+)>/ - (includes[$1] ||= []) << f - end - rescue SystemCallError - $stderr.puts "#$! (skipping)" - end -} - -include_free = includes.values.flatten.uniq - includes.keys - - -# @@PLEAC@@_5.16 -# dutree - print sorted intented rendition of du output -#% dutree -#% dutree /usr -#% dutree -a -#% dutree -a /bin - -# The DuNode class collects all information about a directory, -# and provides some convenience methods -class DuNode - - attr_reader :name - attr_accessor :size - attr_accessor :kids - - def initialize(name) - @name = name - @kids = [] - @size = 0 - end - - # support for sorting nodes with side - def size_compare(node2) - @size <=> node2.size - end - - def basename - @name.sub(/.*\//, "") - end - - #returns substring before last "/", nil if not there - def parent - p = @name.sub(/\/[^\/]+$/,"") - if p == @name - nil - else - p - end - end - -end - -# The DuTree does the acdtual work of -# getting the input, parsing it, builging up a tree -# and format it for output -class Dutree - - attr_reader :topdir - - def initialize - @nodes = Hash.new - @dirsizes = Hash.new(0) - @kids = Hash.new([]) - end - - # get a node by name, create it if it does not exist yet - def get_create_node(name) - if @nodes.has_key?(name) - @nodes[name] - else - node = DuNode.new(name) - @nodes[name] = node - node - end - end - - # run du, read in input, save sizes and kids - # stores last directory read in instance variable topdir - def input(arguments) - name = "" - cmd = "du " + arguments.join(" ") - IO.popen(cmd) { |pipe| - pipe.each { |line| - size, name = line.chomp.split(/\s+/, 2) - node = get_create_node(name) - node.size = size.to_i - @nodes[name] = node - parent = node.parent - if parent - get_create_node(parent).kids.push(node) - end - } - } - @topdir = @nodes[name] - end - - # figure out how much is taken in each directory - # that isn't stored in the subdirectories. Add a new - # fake kid called "." containing that much. - def get_dots(node) - cursize = node.size - for kid in node.kids - cursize -= kid.size - get_dots(kid) - end - if node.size != cursize - newnode = get_create_node(node.name + "/.") - newnode.size = cursize - node.kids.push(newnode) - end - end - - # recursively output everything - # passing padding and number width as well - # on recursive calls - def output(node, prefix="", width=0) - line = sprintf("%#{width}d %s", node.size, node.basename) - puts(prefix + line) - prefix += line.sub(/\d /, "| ") - prefix.gsub!(/[^|]/, " ") - if node.kids.length > 0 # not a bachelor node - kids = node.kids - kids.sort! { |a,b| - b.size_compare(a) - } - width = kids[0].size.to_s.length - for kid in kids - output(kid, prefix, width) - end - end - end - -end - -tree = Dutree.new -tree.input(ARGV) -tree.get_dots(tree.topdir) -tree.output(tree.topdir) - - -# @@PLEAC@@_6.0 -# The verbose version are match, sub, gsub, sub! and gsub!; -# pattern needs to be a Regexp object; it yields a MatchData -# object. -pattern.match(string) -string.sub(pattern, replacement) -string.gsub(pattern, replacement) -# As usual in Ruby, sub! does the same as sub but also modifies -# the object, the same for gsub!/gsub. - -# Sugared syntax yields the position of the match (or nil if no -# match). Note that the object at the right of the operator needs -# not to be a Regexp object (it can be a String). The "dont -# match" operator yields true or false. -meadow =~ /sheep/ # position of the match, nil if no match -meadow !~ /sheep/ # true if doesn't match, false if it does -# There is no sugared version for the substitution - -meadow =~ /\bovines?\b/i and print "Here be sheep!" - -string = "good food" -string.sub!(/o*/, 'e') - -# % echo ababacaca | ruby -ne 'puts $& if /(a|ba|b)+(a|ac)+/' -# ababa - -# The "global" (or "multiple") match is handled by String#scan -scan (/(\d+)/) { - puts "Found number #{$1}" -} - -# String#scan yields an Array if not used with a block -numbers = scan(/\d+/) - -digits = "123456789" -nonlap = digits.scan(/(\d\d\d)/) -yeslap = digits.scan(/(?=(\d\d\d))/) -puts "Non-overlapping: #{nonlap.join(' ')}" -puts "Overlapping: #{yeslap.join(' ')}"; -# Non-overlapping: 123 456 789 -# Overlapping: 123 234 345 456 567 678 789 - -string = "And little lambs eat ivy" -string =~ /l[^s]*s/ -puts "(#$`) (#$&) (#$')" -# (And ) (little lambs) ( eat ivy) - - -# @@PLEAC@@_6.1 -# Ruby doesn't have the same problem: -dst = src.sub('this', 'that') - -progname = $0.sub('^.*/', '') - -bindirs = %w(/usr/bin /bin /usr/local/bin) -libdirs = bindirs.map { |l| l.sub('bin', 'lib') } - - -# @@PLEAC@@_6.3 -/\S+/ # as many non-whitespace bytes as possible -/[A-Za-z'-]+/ # as many letters, apostrophes, and hyphens - -/\b([A-Za-z]+)\b/ # usually best -/\s([A-Za-z]+)\s/ # fails at ends or w/ punctuation - - -# @@PLEAC@@_6.4 -require 'socket' -str = 'www.ruby-lang.org and www.rubygarden.org' -re = / - ( # capture the hostname in $1 - (?: # these parens for grouping only - (?! [-_] ) # lookahead for neither underscore nor dash - [\w-] + # hostname component - \. # and the domain dot - ) + # now repeat that whole thing a bunch of times - [A-Za-z] # next must be a letter - [\w-] + # now trailing domain part - ) # end of $1 capture - /x # /x for nice formatting - -str.gsub! re do # pass a block to execute replacement - host = TCPsocket.gethostbyname($1) - "#{$1} [#{host[3]}]" -end - -puts str -#----------------------------- -# to match whitespace or #-characters in an extended re you need to escape -# them. - -foo = 42 -str = 'blah #foo# blah' -str.gsub! %r/ # replace - \# # a pound sign - (\w+) # the variable name - \# # another pound sign - /x do - eval $1 # with the value of a local variable - end -puts str # => blah 42 blah - - -# @@PLEAC@@_6.5 -# The 'g' modifier doesn't exist in Ruby, a regexp can't be used -# directly in a while loop; instead, use String#scan { |match| .. } -fish = 'One fish two fish red fish blue fish' -WANT = 3 -count = 0 -fish.scan(/(\w+)\s+fish\b/i) { - if (count += 1) == WANT - puts "The third fish is a #{$1} one." - end -} - -if fish =~ /(?:\w+\s+fish\s+){2}(\w+)\s+fish/i - puts "The third fish is a #{$1} one." -end - -pond = 'One fish two fish red fish blue fish' -# String#scan without a block gives an array of matches, each match -# being an array of all the specified groups -colors = pond.scan(/(\w+)\s+fish\b/i).flatten # get all matches -color = colors[2] # then the one we want -# or without a temporary array -color = pond.scan(/(\w+)\s+fish\b/i).flatten[2] # just grab element 3 -puts "The third fish in the pond is #{color}." - -count = 0 -fishes = 'One fish two fish red fish blue fish' -evens = fishes.scan(/(\w+)\s+fish\b/i).select { (count+=1) % 2 == 0 } -print "Even numbered fish are #{evens.join(' ')}." - -count = 0 -fishes.gsub(/ - \b # makes next \w more efficient - ( \w+ ) # this is what we\'ll be changing - ( - \s+ fish \b - ) - /x) { - if (count += 1) == 4 - 'sushi' + $2 - else - $1 + $2 - end -} - -pond = 'One fish two fish red fish blue fish swim here.' -puts "Last fish is #{pond.scan(/\b(\w+)\s+fish\b/i).flatten[-1]}" - -/ - A # find some pattern A - (?! # mustn\'t be able to find - .* # something - A # and A - ) - $ # through the end of the string -/x - -# The "s" perl modifier is "m" in Ruby (not very nice since there is -# also an "m" in perl..) -pond = "One fish two fish red fish blue fish swim here." -if (pond =~ / - \b ( \w+) \s+ fish \b - (?! .* \b fish \b ) - /mix) - puts "Last fish is #{$1}." -else - puts "Failed!" -end - - -# @@PLEAC@@_6.6 -#----------------------------- -#!/usr/bin/ruby -w -# killtags - very bad html killer -$/ = nil; # each read is whole file -while file = gets() do - file.gsub!(/<.*?>/m,''); # strip tags (terribly) - puts file # print file to STDOUT -end -#----------------------------- -#!/usr/bin/ruby -w -#headerfy - change certain chapter headers to html -$/ = '' -while file = gets() do - pattern = / - \A # start of record - ( # capture in $1 - Chapter # text string - \s+ # mandatory whitespace - \d+ # decimal number - \s* # optional whitespace - : # a real colon - . * # anything not a newline till end of line - ) - /x - puts file.gsub(pattern,'

\1

') -end -#----------------------------- -#% ruby -00pe "gsub!(/\A(Chapter\s+\d+\s*:.*)/,'

\1

')" datafile - -#!/usr/bin/ruby -w -#----------------------------- -for file in ARGV - file = File.open(ARGV.shift) - while file.gets('') do # each read is a paragraph - print "chunk #{$.} in $ARGV has <<#{$1}>>\n" while /^START(.*?)^END/m - end # /m activates the multiline mode -end -#----------------------------- - -# @@PLEAC@@_6.7 -#----------------------------- -$/ = nil; -file = File.open("datafile") -chunks = file.gets.split(/pattern/) -#----------------------------- -# .Ch, .Se and .Ss divide chunks of STDIN -chunks = gets(nil).split(/^\.(Ch|Se|Ss)$/) -print "I read #{chunks.size} chunks.\n" -#----------------------------- - - -# @@PLEAC@@_6.8 -while gets - if ~/BEGIN/ .. ~/END/ - # line falls between BEGIN and END inclusive - end -end - -while gets - if ($. == firstnum) .. ($. == lastnum) - # operate between firstnum and lastnum line number - end -end - -# in ruby versions prior to 1.8, the above two conditional -# expressions could be shortened to: -# if /BEGIN/ .. /END/ -# and -# if firstnum .. lastnum -# but these now only work this way from the command line - -#----------------------------- - -while gets - if ~/BEGIN/ ... ~/END/ - # line falls between BEGIN and END on different lines - end -end - -while gets - if ($. == first) ... ($. == last) - # operate between first and last line number on different lines - end -end - -#----------------------------- -# command-line to print lines 15 through 17 inclusive (see below) -ruby -ne 'print if 15 .. 17' datafile - -# print out all .. displays from HTML doc -while gets - print if ~%r##i .. ~%r##i; -end - -# same, but as shell command -# ruby -ne 'print if %r##i .. %r##i' document.html -#----------------------------- -# ruby -ne 'BEGIN { $top=3; $bottom=5 }; \ -# print if $top .. $bottom' /etc/passwd # FAILS -# ruby -ne 'BEGIN { $top=3; $bottom=5 }; \ -# print if $. == $top .. $. == $bottom' /etc/passwd # works -# ruby -ne 'print if 3 .. 5' /etc/passwd # also works -#----------------------------- -print if ~/begin/ .. ~/end/; -print if ~/begin/ ... ~/end/; -#----------------------------- -while gets - $in_header = $. == 1 .. ~/^$/ ? true : false - $in_body = ~/^$/ .. ARGF.eof ? true : false -end -#----------------------------- -seen = {} -ARGF.each do |line| - next unless line =~ /^From:?\s/i .. line =~ /^$/; - line.scan(%r/([^<>(),;\s]+\@[^<>(),;\s]+)/).each do |addr| - puts addr unless seen[addr] - seen[addr] ||= 1 - end -end - - -# @@PLEAC@@_6.9 -def glob2pat(globstr) - patmap = { - '*' => '.*', - '?' => '.', - '[' => '[', - ']' => ']', - } - globstr.gsub!(/(.)/) { |c| patmap[c] || Regexp::escape(c) } - '^' + globstr + '$' -end - - -# @@PLEAC@@_6.10 -# avoid interpolating patterns like this if the pattern -# isn't going to change: -pattern = ARGV.shift -ARGF.each do |line| - print line if line =~ /#{pattern}/ -end - -# the above creates a new regex each iteration. Instead, -# use the /o modifier so the regex is compiled only once - -pattern = ARGV.shift -ARGF.each do |line| - print line if line =~ /#{pattern}/o -end - -#----------------------------- - -#!/usr/bin/ruby -# popgrep1 - grep for abbreviations of places that say "pop" -# version 1: slow but obvious way -popstates = %w(CO ON MI WI MN) -ARGF.each do |line| - popstates.each do |state| - if line =~ /\b#{state}\b/ - print line - last - end - end -end - -#----------------------------- -#!/usr/bin/ruby -# popgrep2 - grep for abbreviations of places that say "pop" -# version 2: eval strings; fast but hard to quote -popstates = %w(CO ON MI WI MN) -code = "ARGF.each do |line|\n" -popstates.each do |state| - code += "\tif line =~ /\\b#{state}\\b/; print(line); next; end\n" -end -code += "end\n" -print "CODE IS\n---\n#{code}\n---\n" if false # turn on for debugging -eval code - -# CODE IS -# --- -# ARGF.each do |line| -# if line =~ /\bCO\b/; print(line); next; end -# if line =~ /\bON\b/; print(line); next; end -# if line =~ /\bMI\b/; print(line); next; end -# if line =~ /\bWI\b/; print(line); next; end -# if line =~ /\bMN\b/; print(line); next; end -# end -# -# --- - -## alternatively, the same idea as above but compiling -## to a case statement: (not in perlcookbook) -#!/usr/bin/ruby -w -# popgrep2.5 - grep for abbreviations of places that say "pop" -# version 2.5: eval strings; fast but hard to quote -popstates = %w(CO ON MI WI MN) -code = "ARGF.each do |line|\n case line\n" -popstates.each do |state| - code += " when /\\b#{state}\\b/ : print line\n" -end -code += " end\nend\n" -print "CODE IS\n---\n#{code}\n---\n" if false # turn on for debugging -eval code - -# CODE IS -# --- -# ARGF.each do |line| -# case line -# when /\bCO\b/ : print line -# when /\bON\b/ : print line -# when /\bMI\b/ : print line -# when /\bWI\b/ : print line -# when /\bMN\b/ : print line -# end -# end -# -# --- - -# Note: (above) Ruby 1.8+ allows the 'when EXP : EXPR' on one line -# with the colon separator. - -#----------------------------- -#!/usr/bin/ruby -# popgrep3 - grep for abbreviations of places that say "pop" -# version3: build a match_any function -popstates = %w(CO ON MI WI MN) -expr = popstates.map{|e|"line =~ /\\b#{e}\\b/"}.join('||') -eval "def match_any(line); #{expr};end" -ARGF.each do |line| - print line if match_any(line) -end -#----------------------------- - -## building a match_all function is a trivial -## substitution of && for || -## here is a generalized example: -#!/usr/bin/ruby -w -## grepauth - print lines that mention both foo and bar -class MultiMatch - def initialize(*patterns) - _any = build_match('||',patterns) - _all = build_match('&&',patterns) - eval "def match_any(line);#{_any};end\n" - eval "def match_all(line);#{_all};end\n" - end - def build_match(sym,args) - args.map{|e|"line =~ /#{e}/"}.join(sym) - end -end - -mm = MultiMatch.new('foo','bar') -ARGF.each do |line| - print line if mm.match_all(line) -end -#----------------------------- - -#!/usr/bin/ruby -# popgrep4 - grep for abbreviations of places that say "pop" -# version4: pretty fast, but simple: compile all re's first: -popstates = %w(CO ON MI WI MN) -popstates = popstates.map{|re| %r/\b#{re}\b/} -ARGF.each do |line| - popstates.each do |state_re| - if line =~ state_re - print line - break - end - end -end - -## speeds trials on the jargon file(412): 26006 lines, 1.3MB -## popgrep1 => 7.040s -## popgrep2 => 0.656s -## popgrep2.5 => 0.633s -## popgrep3 => 0.675s -## popgrep4 => 1.027s - -# unless speed is criticial, the technique in popgrep4 is a -# reasonable balance between speed and logical simplicity. - - -# @@PLEAC@@_6.11 -begin - print "Pattern? " - pat = $stdin.gets.chomp - Regexp.new(pat) -rescue - warn "Invalid Pattern" - retry -end - - -# @@PLEAC@@_6.13 -# uses the 'amatch' extension found on: -# http://raa.ruby-lang.org/project/amatch/ -require 'amatch' -matcher = Amatch.new('balast') -#$relative, $distance = 0, 1 -File.open('/usr/share/dict/words').each_line do |line| - print line if matcher.search(line) <= 1 -end -__END__ -#CODE -ballast -ballasts -balustrade -balustrades -blast -blasted -blaster -blasters -blasting -blasts - - -# @@PLEAC@@_6.14 -str.scan(/\G(\d)/).each do |token| - puts "found #{token}" -end -#----------------------------- -n = " 49 here" -n.gsub!(/\G /,'0') -puts n -#----------------------------- -str = "3,4,5,9,120" -str.scan(/\G,?(\d+)/).each do |num| - puts "Found number: #{num}" -end -#----------------------------- -# Ruby doesn't have the String.pos or a /c re modifier like Perl -# But it does have StringScanner in the standard library (strscn) -# which allows similar functionality: - -require 'strscan' -text = 'the year 1752 lost 10 days on the 3rd of September' -sc = StringScanner.new(text) -while sc.scan(/.*?(\d+)/) - print "found: #{sc[1]}\n" -end -if sc.scan(/\S+/) - puts "Found #{sc[0]} after last number" -end -#----------------------------- -# assuming continuing from above: -puts "The position in 'text' is: #{sc.pos}" -sc.pos = 30 -puts "The position in 'text' is: #{sc.pos}" - - -# @@PLEAC@@_6.15 -#----------------------------- -# greedy pattern -str.gsub!(/<.*>/m,'') # not good - -# non-greedy (minimal) pattern -str.gsub!(/<.*?>/m,'') # not great - - -#----------------------------- -#this and that are important Oh, me too! -#----------------------------- -%r{ (.*?) }mx -#----------------------------- -%r/BEGIN((?:(?!BEGIN).)*)END/ -#----------------------------- -%r{ ( (?: (?!|). )* )
}mx -#----------------------------- -%r{ ( (?: (?!). )* ) }mx -#----------------------------- -%r{ - - [^<]* # stuff not possibly bad, and not possibly the end. - (?: - # at this point, we can have '<' if not part of something bad - (?! ) # what we can't have - < # okay, so match the '<' - [^<]* # and continue with more safe stuff - ) * - - }mx - - -# @@PLEAC@@_6.16 -#----------------------------- -$/ = "" -ARGF.each do |para| - para.scan %r/ - \b # start at word boundary - (\S+) # find chunk of non-whitespace - \b # until a word boundary - ( - \s+ # followed by whitespace - \1 # and that same chunk again - \b # and a word boundary - ) + # one or more times - /xi do - puts "dup word '#{$1}' at paragraph #{$.}" - end -end -#----------------------------- -astr = 'nobody' -bstr = 'bodysnatcher' -if "#{astr} #{bstr}" =~ /^(\w+)(\w+) \2(\w+)$/ - print "#{$2} overlaps in #{$1}-#{$2}-#{$3}" -end -#----------------------------- -#!/usr/bin/ruby -w -# prime_pattern -- find prime factors of argument using patterns -ARGV << 180 -cap = 'o' * ARGV.shift -while cap =~ /^(oo+?)\1+$/ - print $1.size, " " - cap.gsub!(/#{$1}/,'o') -end -puts cap.size -#----------------------------- -#diophantine -# solve for 12x + 15y + 16z = 281, maximizing x -if ('o' * 281).match(/^(o*)\1{11}(o*)\2{14}(o*)\3{15}$/) - x, y, z = $1.size, $2.size, $3.size - puts "One solution is: x=#{x}; y=#{y}; z=#{z}" -else - puts "No solution." -end -# => One solution is: x=17; y=3; z=2 - -#----------------------------- -# using different quantifiers: -('o' * 281).match(/^(o+)\1{11}(o+)\2{14}(o+)\3{15}$/) -# => One solution is: x=17; y=3; z=2 - -('o' * 281).match(/^(o*?)\1{11}(o*)\2{14}(o*)\3{15}$/) -# => One solution is: x=0; y=7; z=11 - -('o' * 281).match(/^(o+?)\1{11}(o*)\2{14}(o*)\3{15}$/) -# => One solution is: x=1; y=3; z=14 - - -# @@PLEAC@@_6.17 -# alpha OR beta -%r/alpha|beta/ - -# alpha AND beta -%r/(?=.*alpha)(?=.*beta)/m - -# alpha AND beta, no overlap -%r/alpha.*beta|beta.*alpha/m - -# NOT beta -%r/^(?:(?!beta).)*$/m - -# NOT bad BUT good -%r/(?=(?:(?!BAD).)*$)GOOD/m -#----------------------------- - -if !(string =~ /pattern/) # ugly - something() -end - -if string !~ /pattern/ # preferred - something() -end - - -#----------------------------- -if string =~ /pat1/ && string =~ /pat2/ - something() -end -#----------------------------- -if string =~ /pat1/ || string =~ /pat2/ - something() -end -#----------------------------- -#!/usr/bin/ruby -w -# minigrep - trivial grep -pat = ARGV.shift -ARGF.each do |line| - print line if line =~ /#{pat}/o -end -#----------------------------- - "labelled" =~ /^(?=.*bell)(?=.*lab)/m -#----------------------------- -$string =~ /bell/ && $string =~ /lab/ -#----------------------------- -$murray_hill = "blah bell blah " -if $murray_hill =~ %r{ - ^ # start of string - (?= # zero-width lookahead - .* # any amount of intervening stuff - bell # the desired bell string - ) # rewind, since we were only looking - (?= # and do the same thing - .* # any amount of intervening stuff - lab # and the lab part - ) - }mx # /m means . can match newline - - print "Looks like Bell Labs might be in Murray Hill!\n"; -end -#----------------------------- -"labelled" =~ /(?:^.*bell.*lab)|(?:^.*lab.*bell)/ -#----------------------------- -$brand = "labelled"; -if $brand =~ %r{ - (?: # non-capturing grouper - ^ .*? # any amount of stuff at the front - bell # look for a bell - .*? # followed by any amount of anything - lab # look for a lab - ) # end grouper - | # otherwise, try the other direction - (?: # non-capturing grouper - ^ .*? # any amount of stuff at the front - lab # look for a lab - .*? # followed by any amount of anything - bell # followed by a bell - ) # end grouper - }mx # /m means . can match newline - print "Our brand has bell and lab separate.\n"; -end -#----------------------------- -$map =~ /^(?:(?!waldo).)*$/s -#----------------------------- -$map = "the great baldo" -if $map =~ %r{ - ^ # start of string - (?: # non-capturing grouper - (?! # look ahead negation - waldo # is he ahead of us now? - ) # is so, the negation failed - . # any character (cuzza /s) - ) * # repeat that grouping 0 or more - $ # through the end of the string - }mx # /m means . can match newline - print "There's no waldo here!\n"; -end -=begin - 7:15am up 206 days, 13:30, 4 users, load average: 1.04, 1.07, 1.04 - -USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT - -tchrist tty1 5:16pm 36days 24:43 0.03s xinit - -tchrist tty2 5:19pm 6days 0.43s 0.43s -tcsh - -tchrist ttyp0 chthon 7:58am 3days 23.44s 0.44s -tcsh - -gnat ttyS4 coprolith 2:01pm 13:36m 0.30s 0.30s -tcsh -=end -#% w | minigrep '^(?!.*ttyp).*tchrist' -#----------------------------- -%r{ - ^ # anchored to the start - (?! # zero-width look-ahead assertion - .* # any amount of anything (faster than .*?) - ttyp # the string you don't want to find - ) # end look-ahead negation; rewind to start - .* # any amount of anything (faster than .*?) - tchrist # now try to find Tom -}x -#----------------------------- -#% w | grep tchrist | grep -v ttyp -#----------------------------- -#% grep -i 'pattern' files -#% minigrep '(?i)pattern' files -#----------------------------- - - -# @@PLEAC@@_6.20 -ans = $stdin.gets.chomp -re = %r/^#{Regexp.quote(ans)}/ -case - when "SEND" =~ re : puts "Action is send" - when "STOP" =~ re : puts "Action is stop" - when "ABORT" =~ re : puts "Action is abort" - when "EDIT" =~ re : puts "Action is edit" -end -#----------------------------- -require 'abbrev' -table = Abbrev.abbrev %w-send stop abort edit- -loop do - print "Action: " - ans = $stdin.gets.chomp - puts "Action for #{ans} is #{table[ans.downcase]}" -end - - -#----------------------------- -# dummy values are defined for 'file', 'PAGER', and -# the 'invoke_editor' and 'deliver_message' methods -# do not do anything interesting in this example. -#!/usr/bin/ruby -w -require 'abbrev' - -file = 'pleac_ruby.data' -PAGER = 'less' - -def invoke_editor - puts "invoking editor" -end - -def deliver_message - puts "delivering message" -end - -actions = { - 'edit' => self.method(:invoke_editor), - 'send' => self.method(:deliver_message), - 'list' => proc {system(PAGER, file)}, - 'abort' => proc {puts "See ya!"; exit}, - "" => proc {puts "Unknown Command"} -} - -dtable = Abbrev.abbrev(actions.keys) -loop do - print "Action: " - ans = $stdin.gets.chomp.delete(" \t") - actions[ dtable[ans.downcase] || "" ].call -end - - -# @@PLEAC@@_6.19 -#----------------------------- -# basically, the Perl Cookbook categorizes this as an -# unsolvable problem ... -#----------------------------- -1 while addr.gsub!(/\([^()]*\)/,'') -#----------------------------- -Dear someuser@host.com, - -Please confirm the mail address you gave us Wed May 6 09:38:41 -MDT 1998 by replying to this message. Include the string -"Rumpelstiltskin" in that reply, but spelled in reverse; that is, -start with "Nik...". Once this is done, your confirmed address will -be entered into our records. - - -# @@PLEAC@@_6.21 -#----------------------------- -#% gunzip -c ~/mail/archive.gz | urlify > archive.urlified -#----------------------------- -#% urlify ~/mail/*.inbox > ~/allmail.urlified -#----------------------------- -#!/usr/bin/ruby -w -# urlify - wrap HTML links around URL-like constructs - -urls = '(https?|telnet|gopher|file|wais|ftp)'; -ltrs = '\w'; -gunk = '/#~:.?+=&%@!\-'; -punc = '.:?\-'; -any = "#{ltrs}#{gunk}#{punc}"; - -ARGF.each do |line| - line.gsub! %r/ - \b # start at word boundary - ( # begin $1 { - #{urls} : # need resource and a colon - [#{any}] +? # followed by on or more - # of any valid character, but - # be conservative and take only - # what you need to.... - ) # end $1 } - (?= # look-ahead non-consumptive assertion - [#{punc}]* # either 0 or more punctuation - [^#{any}] # followed by a non-url char - | # or else - $ # then end of the string - ) - /iox do - %Q|#{$1}| - end - print line -end - - -# @@PLEAC@@_6.23 -%r/^m*(d?c{0,3}|c[dm])(l?x{0,3}|x[lc])(v?i{0,3}|i[vx])$/i -#----------------------------- -str.sub!(/(\S+)(\s+)(\S+)/, '\3\2\1') -#----------------------------- -%r/(\w+)\s*=\s*(.*)\s*$/ # keyword is $1, value is $2 -#----------------------------- -%r/.{80,}/ -#----------------------------- -%r|(\d+)/(\d+)/(\d+) (\d+):(\d+):(\d+)| -#----------------------------- -str.gsub!(%r|/usr/bin|,'/usr/local/bin') -#----------------------------- -str.gsub!(/%([0-9A-Fa-f][0-9A-Fa-f])/){ $1.hex.chr } -#----------------------------- -str.gsub!(%r{ - /\* # Match the opening delimiter - .*? # Match a minimal number of characters - \*/ # Match the closing delimiter -}xm,'') -#----------------------------- -str.sub!(/^\s+/, '') -str.sub!(/\s+$/, '') - -# but really, in Ruby we'd just do: -str.strip! -#----------------------------- -str.gsub!(/\\n/,"\n") -#----------------------------- -str.sub!(/^.*::/, '') -#----------------------------- -%r/^([01]?\d\d|2[0-4]\d|25[0-5])\.([01]?\d\d|2[0-4]\d|25[0-5])\. - ([01]?\d\d|2[0-4]\d|25[0-5])\.([01]?\d\d|2[0-4]\d|25[0-5])$/x -#----------------------------- -str.sub!(%r|^.*/|, '') -#----------------------------- -cols = ( (ENV['TERMCAP'] || " ") =~ /:co#(\d+):/ ) ? $1 : 80; -#----------------------------- -name = " #{$0} #{ARGV}".gsub(%r| /\S+/|, ' ') -#----------------------------- -require 'rbconfig' -include Config -raise "This isn't Linux" unless CONFIG['target_os'] =~ /linux/i; -#----------------------------- -str.gsub!(%r/\n\s+/, ' ') -#----------------------------- -nums = str.scan(/(\d+\.?\d*|\.\d+)/) -#----------------------------- -capwords = str.scan(%r/(\b[^\Wa-z0-9_]+\b)/) -#----------------------------- -lowords = str.scan(%r/(\b[^\WA-Z0-9_]+\b)/) -#----------------------------- -icwords = str.scan(%r/(\b[^\Wa-z0-9_][^\WA-Z0-9_]*\b)/) -#----------------------------- -links = str.scan(%r/]+?HREF\s*=\s*["']?([^'" >]+?)[ '"]?>/mi) -#----------------------------- -initial = str =~ /^\S+\s+(\S)\S*\s+\S/ ? $1 : "" -#----------------------------- -str.gsub!(%r/"([^"]*)"/, %q-``\1''-) -#----------------------------- - -$/ = "" -sentences = [] -ARGF.each do |para| - para.gsub!(/\n/, ' ') - para.gsub!(/ {3,}/,' ') - sentences << para.scan(/(\S.*?[!?.])(?= |\Z)/) -end - -#----------------------------- -%r/(\d{4})-(\d\d)-(\d\d)/ # YYYY in $1, MM in $2, DD in $3 -#----------------------------- -%r/ ^ - (?: - 1 \s (?: \d\d\d \s)? # 1, or 1 and area code - | # ... or ... - \(\d\d\d\) \s # area code with parens - | # ... or ... - (?: \+\d\d?\d? \s)? # optional +country code - \d\d\d ([\s\-]) # and area code - ) - \d\d\d (\s|\1) # prefix (and area code separator) - \d\d\d\d # exchange - $ - /x -#----------------------------- -%r/\boh\s+my\s+gh?o(d(dess(es)?|s?)|odness|sh)\b/i -#----------------------------- -lines = [] -lines << $1 while input.sub!(/^([^\012\015]*)(\012\015?|\015\012?)/,'') - - -# @@PLEAC@@_7.0 -# An IO object being Enumerable, we can use 'each' directly on it -File.open("/usr/local/widgets/data").each { |line| - puts line if line =~ /blue/ -} - -logfile = File.new("/var/log/rubylog.txt", "w") -mysub($stdin, logfile) - -# The method IO#readline is similar to IO#gets -# but throws an exception when it reaches EOF -f = File.new("bla.txt") -begin - while (line = f.readline) - line.chomp - $stdout.print line if line =~ /blue/ - end -rescue EOFError - f.close -end - -while $stdin.gets # reads from STDIN - unless (/\d/) - $stderr.puts "No digit found." # writes to STDERR - end - puts "Read: #{$_}" # writes to STDOUT -end - -logfile = File.new("/tmp/log", "w") - -logfile.close - -# $defout (or its synonym '$>') is the destination of output -# for Kernel#print, Kernel#puts, and family functions -logfile = File.new("log.txt", "w") -old = $defout -$defout = logfile # switch to logfile for output -puts "Countdown initiated ..." -$defout = old # return to original output -puts "You have 30 seconds to reach minimum safety distance." - - -# @@PLEAC@@_7.1 -source = File.new(path, "r") # open file "path" for reading only -sink = File.new(path, "w") # open file "path" for writing only - -source = File.open(path, File::RDONLY) # open file "path" for reading only -sink = File.open(path, File::WRONLY) # open file "path" for writing only - -file = File.open(path, "r+") # open "path" for reading and writing -file = File.open(path, flags) # open "path" with the flags "flags" (see examples below for flags) - -# open file "path" read only -file = File.open(path, "r") -file = File.open(path, File::RDONLY) - -# open file "path" write only, create it if it does not exist -# truncate it to zero length if it exists -file = File.open(path, "w") -file = File.open(path, File::WRONLY|File::TRUNC|File::CREAT) -file = File.open(path, File::WRONLY|File::TRUNC|File::CREAT, 0666) # with permission 0666 - -# open file "path" write only, fails if file exists -file = File.open(path, File::WRONLY|File::EXCL|File::CREAT) -file = File.open(path, File::WRONLY|File::EXCL|File::CREAT, 0666) - -# open file "path" for appending -file = File.open(path, "a") -file = File.open(path, File::WRONLY|File::APPEND|File::CREAT) -file = File.open(path, File::WRONLY|File::APPEND|File::CREAT, 0666) - -# open file "path" for appending only when file exists -file = File.open(path, File::WRONLY|File::APPEND) - -# open file "path" for reading and writing -file = File.open(path, "r+") -file = File.open(path, File::RDWR) - -# open file for reading and writing, create a new file if it does not exist -file = File.open(path, File::RDWR|File::CREAT) -file = File.open(path, File::RDWR|File::CREAT, 0600) - -# open file "path" reading and writing, fails if file exists -file = File.open(path, File::RDWR|File::EXCL|File::CREAT) -file = File.open(path, File::RDWR|File::EXCL|File::CREAT, 0600) - - -# @@PLEAC@@_7.2 -# No problem with Ruby since the filename doesn't contain characters with -# special meaning; like Perl's sysopen -File.open(filename, 'r') - - -# @@PLEAC@@_7.3 -File.expand_path('~root/tmp') -#=> "/root/tmp" -File.expand_path('~rpcuser') -#=> "/var/lib/nfs" - -# To expand ~/.. it explicitely needs the environment variable HOME -File.expand_path('~/tmp') -#=> "/home/gc/tmp" - - -# @@PLEAC@@_7.4 -# The exception raised in Ruby reports the filename -File.open('afile') - - -# @@PLEAC@@_7.5 -# Standard Ruby distribution provides the following useful extension -require 'tempfile' -# With the Tempfile class, the file is automatically deleted on garbage -# collection, so you won't need to remove it, later on. -tf = Tempfile.new('tmp') # a name is required to create the filename - -# If you need to pass the filename to an external program you can use -# File#path, but don't forget to File#flush in order to flush anything -# living in some buffer somewhere. -tf.flush -system("/usr/bin/dowhatever #{tf.path}") - -fh = Tempfile.new('tmp') -fh.sync = true # autoflushes -10.times { |i| fh.puts i } -fh.rewind -puts 'Tmp file has: ', fh.readlines - - -# @@PLEAC@@_7.6 -while (DATA.gets) do - # process the line -end -__END__ -# your data goes here -# __DATA__ doesn't exist in Ruby - -#CODE -# get info about the script (size, date of last modification) -kilosize = DATA.stat.size / 1024 -last_modif = DATA.stat.mtime -puts "

Script size is #{kilosize}" -puts "

Last script update: #{last_modif}" -__END__ -# DO NOT REMOVE THE PRECEEDING LINE. -# Everything else in this file will be ignored. -#CODE - - -# @@PLEAC@@_7.7 -while line = gets do - # do something with line. -end - -# or -while gets do - # do something with $_ -end - -# or more rubyish -$stdin.each do |line| - # do stuff with line -end - - -# ARGF may makes this more easy -# this is skipped if ARGV.size==0 -ARGV.each do |filename| - # closing and exception handling are done by the block - open(filename) do |fd| - fd.each do |line| - # do stuff with line - end - end rescue abort("can't open %s" % filename) -end - -# globbing is done in the Dir module -ARGV = Dir["*.[Cch]"] if ARGV.empty? - -# note: optparse is the preferred way to handle this -if (ARGV[0] == '-c') - chop_first += 1 - ARGV.shift -end - - -# processing numerical options -if ARGV[0] =~ /^-(\d+)$/ - columns = $1 - ARGV.shift -end - -# again, better to use optparse: -require 'optparse' -nostdout = 0 -append = 0 -unbuffer = 0 -ignore_ints = 0 -ARGV.options do |opt| - opt.on('-n') { nostdout +=1 } - opt.on('-a') { append +=1 } - opt.on('-u') { unbuffer +=1 } - opt.on('-i') { ignore_ints +=1 } - opt.parse! -end or abort("usage: " + __FILE__ + " [-ainu] [filenames]") - -# no need to do undef $/, we have File.read -str = File.read(ARGV[0]) - -# again we have File.read -str = File.read(ARGV[0]) - -# not sure what this should do: -# I believe open the file, print filename, lineno and line: -ARGF.each_with_index do |line, idx| - print ARGF.filename, ":", idx, ";", line -end - -# print all the lines in every file passed via command line that contains login -ARGF.each do |line| - puts line if line =~ /login/ -end -# -# even this would fit -#%ruby -ne "print if /f/" 2.log -# - -ARGF.each { |l| puts l.downcase! } - -#------------------ -#!/usr/bin/ruby -p -# just like perl's -p -$_.downcase! -# - -# I don't know who should I trust. -# perl's version splits on \w+ while python's on \w. - -chunks = 0 - -File.read(ARGV[0]).split.each do |word| - next if word =~ /^#/ - break if ["__DATA__", "__END__"].member? word - chunks += 1 -end - -print "Found ", chunks, " chunks\n" - - -# @@PLEAC@@_7.8 -old = File.open(old_file) -new = File.open(new_file, "w") -while old.gets do - # change $_, then... - new.print $_ -end -old.close -new.close -File.rename(old_file, "old.orig") -File.rename(new_file, old_file) - -while old.gets do - if $. == 20 then # we are at the 20th line - new.puts "Extra line 1" - new.puts "Extra line 2" - end - new.print $_ -end - -while old.gets do - next if 20..30 # skip the 20th line to the 30th - # Ruby (and Perl) permit to write if 20..30 - # instead of if (20 <= $.) and ($. <= 30) - new.print $_ -end - - -# @@PLEAC@@_7.9 -#% ruby -i.orig -pe 'FILTER COMMAND' file1 file2 file3 ... -# -#----------------------------- -##!/usr/bin/ruby -i.orig -p -# filter commands go here -#----------------------------- - -#% ruby -pi.orig -e 'gsub!(/DATE/){Time.now)' - -# effectively becomes: -ARGV << 'I' -oldfile = "" -while gets - if ARGF.filename != oldfile - newfile = ARGF.filename - File.rename(newfile, newfile + ".orig") - $stdout = File.open(newfile,'w') - oldfile = newfile - end - gsub!(/DATE/){Time.now} - print -end -$stdout = STDOUT -#----------------------------- -#% ruby -i.old -pe 'gsub!(%r{\bhisvar\b}, 'hervar')' *.[Cchy] - -#----------------------------- -# set up to iterate over the *.c files in the current directory, -# editing in place and saving the old file with a .orig extension -$-i = '.orig' # set up -i mode -ARGV.replace(Dir['*.[Cchy]']) -while gets - if $. == 1 - print "This line should appear at the top of each file\n" - end - gsub!(/\b(p)earl\b/i, '\1erl') # Correct typos, preserving case - print - ARGF.close if ARGF.eof -end - - -# @@PLEAC@@_7.10 -File.open('itest', 'r+') do |f| # open file for update - lines = f.readlines # read into array of lines - lines.each do |it| # modify lines - it.gsub!(/foo/, 'QQQ') - end - f.pos = 0 # back to start - f.print lines # write out modified lines - f.truncate(f.pos) # truncate to new length -end # file is automatically closed -#----------------------------- -File.open('itest', 'r+') do |f| - out = "" - f.each do |line| - out << line.gsub(/DATE/) {Time.now} - end - f.pos = 0 - f.print out - f.truncate(f.pos) -end - -# @@PLEAC@@_7.11 -File.open('infile', 'r+') do |f| - f.flock File::LOCK_EX - # update file -end -#----------------------------- -File::LOCK_SH # shared lock (for reading) -File::LOCK_EX # exclusive lock (for writing) -File::LOCK_NB # non-blocking request -File::LOCK_UN # free lock -#----------------------------- -unless f.flock File::LOCK_EX | File::LOCK_NB - warn "can't get immediate lock: blocking ..." - f.flock File::LOCK_EX -end -#----------------------------- -File.open('numfile', File::RDWR|File::CREAT) do |f| - f.flock(File::LOCK_EX) - num = f.gets.to_i || 0 - f.pos = 0 - f.truncate 0 - f.puts num + 1q -end - - -# @@PLEAC@@_7.12 -output_handle.sync = true -# Please note that like in Perl, $stderr is already unbuffered -#----------------------------- -#!/usr/bin/ruby -w -# seeme - demo stdio output buffering -$stdout.sync = ARGV.size > 0 -print "Now you don't see it..." -sleep 2 -puts "now you do" -#----------------------------- -$stderr.sync = true -afile.sync = false -#----------------------------- -# assume 'remote_con' is an interactive socket handle, -# but 'disk_file' is a handle to a regular file. -remote_con.sync = true # unbuffer for clarity -disk_file.sync = false # buffered for speed -#----------------------------- -require 'socket' -sock = TCPSocket.new('www.ruby-lang.org', 80) -sock.sync = true -sock.puts "GET /en/ HTTP/1.0 \n\n" -resp = sock.read -print "DOC IS: #{resp}\n" - - -# @@PLEAC@@_7.13 -#----------------------------- -# assumes fh1, fh2, fh2 are oen IO objects -nfound = select([$stdin, fh1, fh2, fh3], nil, nil, 0) -nfound[0].each do |file| - case file - when fh1 - # do something with fh1 - when fh2 - # do something with fh2 - when fh3 - # do something with fh3 - end -end -#----------------------------- -input_files = [] -# repeat next line for all in-files to poll -input_files << fh1 -if nfound = select(input_files, nil, nil, 0) - # input ready on files in nfound[0] -end - - -# @@PLEAC@@_8.0 -#----------------------------- -# datafile is a file or IO object -datafile.readlines.each { |line| - line.chomp! - size = line.length - puts size -} -#----------------------------- -datafile.readlines.each { |line| - puts line.chomp!.length -} -#----------------------------- -lines = datafile.readlines -#----------------------------- -whole_file = file.read -#----------------------------- -# ruby -040 -e 'word = gets; puts "First word is #{word}"' -#----------------------------- -# ruby -ne 'BEGIN { $/="%%\n" }; $_.chomp; puts $_ if( $_=~/Unix/i)' fortune.dat -#----------------------------- -handle.print "one", "two", "three" # "onetwothree" -puts "Baa baa black sheep." # sent to $stdout -#----------------------------- -buffer = handle.read(4096) -rv = buffer.length -#----------------------------- -handle.truncate(length) -open("/tmp#{$$}.pid", 'w') { |handle| handle.truncate(length) } -#----------------------------- -pos = datafile.pos # tell is an alias of pos -puts "I'm #{pos} bytes from the start of datafile" -#----------------------------- -logfile.seek(0, IO::SEEK_END) -datafile.seek(pos) # IO::SEEK_SET is the default -out.seek(-20, IO::SEEK_CUR) -#----------------------------- -written = datafile.syswrite(mystring) -raise RunTimeError unless written == mystring.length -block = infile.sysread(256) # no equivalent to perl offset parameter in sysread -puts "only read #{block.length} bytes" if 256 != block.length -#----------------------------- -pos = handle.sysseek(0, IO::SEEK_CUR) # don't change position - - -# @@PLEAC@@_8.1 -while (line = fh.gets) - line.chomp! - nextline = nil - line.gsub!(/\\$/) { |match| nextline = fh.gets; '' } - if (nextline != nil) - line += nextline - redo - end - # process full record in line here -end -#----------------------------- -# DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) \ -# $(TEXINFOS) $(INFOS) $(MANS) $(DATA) -# DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) \ -# $(TEXINFOS) $(INFO_DEPS) $(MANS) $(DATA) \ -# $(EXTRA_DIST) -#----------------------------- -line.gsub!(/\\\s*$/, '') { - # as before -} - - -# @@PLEAC@@_8.2 -#----------------------------- -count = `wc -l < #{filename}` -fail "wc failed: #{$?}" if $? != 0 -count.chomp! -#----------------------------- -count = 0 -File.open(file, 'r') { |fh| - count += 1 while fh.gets -} -# count now holds the number of lines read -#----------------------------- -count = 0 -while (chunk = file.sysread(2**16)) - count += chunk.count("\n") -end rescue EOFError -#----------------------------- -File.open(filename,'r') { |fh| - count += 1 while fh.gets -} -# count now holds the number of lines read -#----------------------------- -# As ruby doesn't quite have an equivalent to using a for -# statement as in perl, I threw this in -count = File.readlines(filename).size -#----------------------------- -1 while file.gets -count = $. -#----------------------------- -$/ = '' -open(filename, 'r') { |fh| - 1 while fh.gets - para_count = $. -} rescue fail("can't open #{filename}: $!") -#----------------------------- - - -# ^^PLEAC^^_8.3 -#----------------------------- -while (gets) - split.each { |chunk| - # do something with chunk - } -end -#----------------------------- -while (gets) - gsub(/(\w[\w'-]*)/) { |word| - # do something with word - } -end -#----------------------------- -# Make a word frequency count -# normally hashes can be created using {} or just Hash.new -# but we want the default value of an entry to be 0 instead -# of nil. (nil can't be incremented) -seen = Hash.new(0) -while (gets) - gsub(/(\w[\w'-]*)/) { |word| - seen[word.downcase] += 1 - } -end -# output hash in a descending numeric sort of its values -seen.sort { |a,b| b[1] <=> a[1] }.each do |k,v| - printf("%5d %s\n", v, k ) -end - -#----------------------------- -# Line frequency count -seen = Hash.new(0) -while (gets) - seen[$_.downcase] += 1 -end -seen.sort { |a,b| b[1] <=> a[1] }.each do |k,v| - printf("%5d %s\n", v, k ) -end -#----------------------------- - - -# @@PLEAC@@_8.4 -#----------------------------- -# instead of file handle FILE, we can just -# use a string containing the filename -File.readlines(file).each { |line| - # do something with line -} -#----------------------------- -File.readlines(file).reverse_each { |line| - # do something with line -} -#----------------------------- -# the variable lines might have been created -# this way -# lines = File.readlines(file) -# -# normally one would use the reverse_each, but -# if you insist on using a numerical index to -# iterate over the lines array... -(lines.size - 1).downto(0) { |i| - line = lines[i] -} -#----------------------------- -# the second readlines argument is a the -# record separator $/, just like perl, a blank -# separator splits the records into paragraphs -File.readlines(file, '').each { |paragraph| - # do something with paragraph - puts "->Paragraph #{paragraph}" -} -#----------------------------- - - -# @@PLEAC@@_8.6 - -$/ = "%\n"; -srand; - -File.open('/usr/share/fortune/humorists').each do |line| - adage = line if rand($.) < 1 -end - -puts adage; - - -# @@PLEAC@@_8.10 -begin - fh = File.open(file, "r+") - addr = fh.tell unless fh.eof while fh.gets - fh.truncate(addr) -rescue SystemCallError - $stderr.puts "#$!" -end - - -# @@PLEAC@@_9.0 -entry = File.stat("/usr/bin/vi") -entry = File.stat("/usr/bin") -entry = File.stat(INFILE) - -entry = File.stat("/usr/bin/vi") -ctime = entry.ctime -size = entry.size - -f = File.open(filename, "r") - -## There is no -T equivalent in Ruby, but we can still test emptiness -if test(?s, filename) - puts "#{filename} doesn't have text in it." - exit -end - -Dir.new("/usr/bin").each do |filename| - puts "Inside /usr/bin is something called #{filename}" -end - - -# @@PLEAC@@_9.1 -file = File.stat("filename") -readtime, writetime = file.atime, file.mtime -file.utime(readtime, writetime) - -SECONDS_PER_DAY = 60 * 60 * 24 -file = File.stat("filename") -atime, mtime = file.atime, file.mtime - -atime -= 7 * SECONDS_PER_DAY -mtime -= 7 * SECONDS_PER_DAY - -File.utime(atime, mtime, file) -mtime = File.stat(file).mtime -File.utime(Time.new, mtime, file) -File.utime(Time.new, File.stat("testfile").mtime, file) - -#----------------------------- -#!/usr/bin/ruby -w -## uvi - vi a file without changing it's access times - -if ARGV.length != 1 - puts "usage: uvi filename" - exit -end -file = ARGV[0] -atime, mtime = File.stat(file).atime, File.stat(file).mtime -system(ENV["EDITOR"] || "vi", file) -File.utime(atime, mtime, file) -#----------------------------- - - -# @@PLEAC@@_9.2 -File.unlink(FILENAME) - -err_flg = false -filenames.each do |file| - begin - File.unlink(file) - rescue - err_flg = $! - end -end -err_flg and raise "Couldn't unlink all of #{filenames.join(" ")}: #{err_flg}" - -File.unlink(file) - -count = filenames.length -filenames.each do |file| - begin - File.unlink(file) - rescue - count -= 1 - end -end -if count != filenames.length - STDERR.puts "could only delete #{count} of #{filenames.length} files" -end - - -# @@PLEAC@@_9.3 -require "ftools" -File.copy(oldfile, newfile) - -infile = File.open(oldfile, "r") -outfile = File.open(newfile, "w") - -blksize = infile.stat.blksize -# This doesn't handle partial writes or ^Z -# like the Perl version does. -while (line = infile.read(blksize)) - outfile.write(line) -end - -infile.close -outfile.close - -system("cp #{oldfile} #{newfile}") # unix -system("copy #{oldfile} #{newfile}") # dos, vms - -require "ftools" -File.copy("datafile.dat", "datafile.bak") -File.move("datafile.new", "datafile.dat") - - -# @@PLEAC@@_9.4 -$seen = {} # must use global var to be seen inside of method below - -def do_my_thing(filename) - dev, ino = File.stat(filename).dev, File.stat(filename).ino - unless $seen[[dev, ino]] - # do something with $filename because we haven't - # seen it before - end - $seen[[dev, ino]] = $seen[[dev, ino]].to_i + 1 -end - -files.each do |filename| - dev, ino = File.stat(filename).dev, File.stat(filename).ino - if !$seen.has_key?([dev, ino]) - $seen[[dev, ino]] = [] - end - $seen[[dev, ino]].push(filename) -end - -$seen.keys.sort.each do |devino| - ino, dev = devino - if $seen[devino].length > 1 - # $seen[devino] is a list of filenames for the same file - end -end - - -# @@PLEAC@@_9.5 -Dir.open(dirname) do |dir| - dir.each do |file| - # do something with dirname/file - puts file - end -end -# Dir.close is automatic - -# No -T equivalent in Ruby - -dir.each do |file| - next if file =~ /^\.\.?$/ - # ... -end - -def plainfiles(dir) - dh = Dir.open(dir) - dh.entries.grep(/^[^.]/). - map {|file| "#{dir}/#{file}"}. - find_all {|file| test(?f, file)}. - sort -end - - -# @@PLEAC@@_9.6 -list = Dir.glob("*.c") - -dir = Dir.open(path) -files = dir.entries.grep(/\.c$/) -dir.close - -files = Dir.glob("*.c") -files = Dir.open(path).entries.grep(/\.[ch]$/i) - -dir = Dir.new(path) -files = dir.entries.grep(/\.[ch]$/i) - -begin - d = Dir.open(dir) -rescue Errno::ENOENT - raise "Couldn't open #{dir} for reading: #{$!}" -end - -files = [] -d.each do |file| - puts file - next unless file =~ /\.[ch]$/i - - filename = "#{dir}/#{file}" - # There is no -T equivalent in Ruby, but we can still test emptiness - files.push(filename) if test(?s, filename) -end - -dirs.entries.grep(/^\d+$/). - map { |file| [file, "#{path}/#{file}"]} . - select { |file| test(?d, file[1]) }. - sort { |a,b| a[0] <=> b[0] }. - map { |file| file[1] } - - -# @@PLEAC@@_9.7 -require 'find' -Find.find(dirlist) do |file| - # do whatever -end - -require 'find' -argv = ARGV.empty? ? %w{.} : ARGV -Find.find(*argv) do |file| - print file, (test(?d, file) ? "/\n" : "\n") -end - -require 'find' -argv = ARGV.empty? ? %w{.} : ARGV -sum = 0 -Find.find(*argv) do |file| - size = test(?s, file) || 0 - sum += size -end -puts "#{argv.join(' ')} contains #{sum} bytes" - -require 'find' -argv = ARGV.empty? ? %w{.} : ARGV -saved_size, saved_name = -1, "" -Find.find(*argv) do |file| - size = test(?s, file) || 0 - next unless test(?f, file) && size > saved_size - saved_size = size - saved_name = file -end -puts "Biggest file #{saved_name} in #{argv.join(' ')} is #{saved_size}" - -require 'find' -argv = ARGV.empty? ? %w{.} : ARGV -age, name = nil -Find.find(*argv) do |file| - mtime = File.stat(file).mtime - next if age && age > mtime - age = mtime - name = file -end -puts "#{name} #{age}" - -#----------------------------- -#!/usr/bin/ruby -w -# fdirs - find all directories -require 'find' -argv = ARGV.empty? ? %w{.} : ARGV -File.find(*argv) { |file| puts file if test(?d, file) } -#----------------------------- - - -# @@PLEAC@@_9.8 -require 'fileutils' - -puts "Usage #{$0} dir ..." if ARGV.empty? -ARGV.each do |dir| - FileUtils.rmtree(dir) -end - - -# @@PLEAC@@_9.9 -require 'ftools' -names.each do |file| - newname = file - begin - File.move(file, newname) - rescue Errno::EPERM - $stderr.puts "Couldn't rename #{file} to #{newname}: #{$!}" - end -end - -require 'ftools' -op = ARGV.empty? ? (raise "Usage: rename expr [files]\n") : ARGV.shift -argv = ARGV.empty? ? $stdin.readlines.map { |f| f.chomp } : ARGV -argv.each do |file| - was = file - file = eval("file.#{op}") - File.move(was, file) unless was == file -end - - -# @@PLEAC@@_9.10 -base = File.basename(path) -dir = File.dirname(path) -# ruby has no fileparse equivalent -dir, base = File.split(path) -ext = base.scan(/\..*$/).to_s - -path = '/usr/lib/libc.a' -file = File.basename(path) -dir = File.dirname(path) - -puts "dir is #{dir}, file is #{file}" -# dir is /usr/lib, file is libc.a - -path = '/usr/lib/libc.a' -dir, filename = File.split(path) -name, ext = filename.split(/(?=\.)/) -puts "dir is #{dir}, name is #{name}, ext is #{ext}" -# NOTE: The Ruby code prints -# dir is /usr/lib, name is libc, extension is .a -# while the Perl code prints a '/' after the directory name -# dir is /usr/lib/, name is libc, extension is .a - -# No fileparse_set_fstype() equivalent in ruby - -def extension(path) - ext = path.scan(/\..*$/).to_s - ext.sub(/^\./, "") -end - - -# @@PLEAC@@_9.11 -#----------------------------- -#!/usr/bin/ruby -w -# symirror - build spectral forest of symlinks - -require 'find' -require 'fileutils' - -raise "usage: #{$0} realdir mirrordir" unless ARGV.size == 2 - -srcdir,dstdir = ARGV -srcmode = File::stat(srcdir).mode -Dir.mkdir(dstdir, srcmode & 07777) unless test(?d, dstdir) - -# fix relative paths -Dir.chdir(srcdir) {srcdir = Dir.pwd} -Dir.chdir(dstdir) {dstdir = Dir.pwd} - -Find.find(srcdir) do |srcfile| - if test(?d, srcfile) - dest = srcfile.sub(/^#{srcdir}/, dstdir) - dmode = File::stat(srcfile).mode & 07777 - Dir.mkdir(dest, dmode) unless test(?d, dest) - a = Dir["#{srcfile}/*"].reject{|f| test(?d, f)} - FileUtils.ln_s(a, dest) - end -end - - -# @@PLEAC@@_9.12 -# we use the Getopt/Declare library here for convenience: -# http://raa.ruby-lang.org/project/getoptdeclare/ -#----------------------------- -#!/usr/bin/ruby -w -# lst - list sorted directory contents (depth first) - -require 'find' -require 'etc' -require "Getopt/Declare" - -# Note: in the option-spec below there must by at least one hard -# tab in between each -option and its description. For example -# -i read from stdin - -opts = Getopt::Declare.new(<<'EOPARAM') - ============ - Input Format: - -i read from stdin - ============ - Output Format: - -l long listing - -r reverse listing - ============ - Sort on: (one of) - -m mtime (modify time - default) - {$sort_criteria = :mtime} - -u atime (access time) - {$sort_criteria = :atime} - -c ctime (inode change time) - {$sort_criteria = :ctime} - -s size - {$sort_criteria = :size} - [mutex: -m -u -c -s] - -EOPARAM - -$sort_criteria ||= :mtime -files = {} -DIRS = opts['-i'] ? $stdin.readlines.map{|f|f.chomp!} : ARGV -DIRS.each do |dir| - Find.find(dir) do |ent| - files[ent] = File::stat(ent) - end -end -entries = files.keys.sort_by{|f| files[f].send($sort_criteria)} -entries = entries.reverse unless opts['-r'] - -entries.each do |ent| - unless opts['-l'] - puts ent - next - end - stats = files[ent] - ftime = stats.send($sort_criteria == :size ? :mtime : $sort_criteria) - printf "%6d %04o %6d %8s %8s %8d %s %s\n", - stats.ino, - stats.mode & 07777, - stats.nlink, - ETC::PASSWD[stats.uid].name, - ETC::GROUP[stats.gid].name, - stats.size, - ftime.strftime("%a %b %d %H:%M:%S %Y"), - ent -end - - -# @@PLEAC@@_10.0 -def hello - $greeted += 1 # in Ruby, a variable beginning with $ is global (can be any type of course) - puts "hi there!" -end - -# We need to initialize $greeted before it can be used, because "+=" is waiting a Numeric object -$greeted = 0 -hello # note that appending () is optional to function calls with no parameters - - -# @@PLEAC@@_10.1 -# In Ruby, parameters are named anyway -def hypotenuse(side1, side2) - Math.sqrt(side1**2 + side2**2) # the sqrt function comes from the Math module -end -diag = hypotenuse(3, 4) - -puts hypotenuse(3, 4) - -a = [3, 4] -print hypotenuse(*a) # the star operator will magically convert an Array into a "tuple" - -both = men + women - -# In Ruby, all objects are references, so the same problem arises; we then return a new object -nums = [1.4, 3.5, 6.7] -def int_all(n) - n.collect { |v| v.to_i } -end -ints = int_all(nums) - -nums = [1.4, 3.5, 6.7] -def trunc_em(n) - n.collect! { |v| v.to_i } # the bang-version of collect modifies the object -end -trunc_em(nums) - -# Ruby has two chomp version: -# ``chomp'' chomps the record separator and returns what's expected -# ``chomp!'' does the same but also modifies the parameter object - - -# @@PLEAC@@_10.2 -def somefunc - variable = something # variable is local by default -end - -name, age = ARGV -start = fetch_time - -a, b = pair # will succeed if pair is an Array object (like ARGV is) -c = fetch_time - -# In ruby, run_check can't access a, b, or c until they are -# explicitely defined global (using leading $), even if they are -# both defined in the same scope - -def check_x(x) - y = "whatever" - run_check - if $condition - puts "got $x" - end -end - -# The following will keep a reference to the array, though the -# results will be slightly different from perl: the last element -# of $global_array will be itself an array -def save_array(ary) - $global_array << ary -end - -# The following gives the same results as in Perl for $global_array, -# though it doesn't illustrate anymore the way to keep a reference -# to an object: $global_array is extended with the elements of ary -def save_array(ary) - $global_array += ary -end - - -# @@PLEAC@@_10.3 -# In Ruby, AFAIK a method cannot access "local variables" defined -# upper scope; mostly because everything is an object, so you'll -# do the same by defining an attribute or a static attribute - -# In Ruby the BEGIN also exists: -BEGIN { puts "hello from BEGIN" } -puts "hello from main" -BEGIN { puts "hello from 2nd BEGIN" } -# gives: -# hello from BEGIN -# hello from 2nd BEGIN -# hello from main - -# In Ruby, it can be written as a static method and a static -# variable -class Counter - @@counter = 0 - def Counter.next_counter; @@counter += 1; end -end - -# There is no need of BEGIN since the variable will get -# initialized when parsing -class Counter - @@counter = 42 - def Counter.next_counter; @@counter += 1; end - def Counter.prev_counter; @@counter -= 1; end -end - - -# @@PLEAC@@_10.4 -# You can either get the whole trace as an array of strings, each -# string telling which file, line and method is calling: -caller - -# ...or only the last caller -caller[0] - -# We need to extract just the method name of the backtrace: -def whoami; caller()[0] =~ /in `([^']+)'/ ? $1 : '(anonymous)'; end -def whowasi; caller()[1] =~ /in `([^']+)'/ ? $1 : '(anonymous)'; end - - -# @@PLEAC@@_10.5 -# In Ruby, every value is a reference on an object, thus there is -# no such problem -array_diff(array1, array2) - -def add_vecpair(a1, a2) - results = [] - a1.each_index { |i| results << (a1[i] + a2[i]) } - results -end -a = [1, 2] -b = [5, 8] -c = add_vecpair(a, b) -p c - -# Add this to the beginning of the function to check if we were -# given two arrays -a1.type == Array && a2.type == Array or - raise "usage: add_vecpair array1 array2 (was used with: #{a1.type} #{a2.type})" - - -# @@PLEAC@@_10.6 -# There is no return context in Ruby - - -# @@PLEAC@@_10.7 -# Like in Perl, we need to fake with a hash, but it's dirty :-( -def thefunc(param_args) - args = { 'INCREMENT' => '10s', 'FINISH' => '0', 'START' => 0 } - args.update(param_args) - if (args['INCREMENT'] =~ /m$/ ) - # ..... - end -end - -thefunc({ 'INCREMENT' => '20s', 'START' => '+5m', 'FINISH' => '+30m' }) -thefunc({}) - - -# @@PLEAC@@_10.8 -# there is no "undef" direct equivalent but there is the slice equiv: -a, c = func.indexes(0, 2) - - -# @@PLEAC@@_10.9 -# Ruby has no such limitation: -def somefunc - ary = [] - hash = {} - # ... - return ary, hash -end -arr, dict = somefunc - -array_of_hashes = fn -h1, h2, h3 = fn - - -# @@PLEAC@@_10.10 -return -# or (equivalent) -return nil - - -# @@PLEAC@@_10.11 -# You can't prototype in Ruby regarding types :-( -# Though, you can force the number of arguments: -def func_with_no_arg; end -def func_with_no_arg(); end -def func_with_one_arg(a1); end -def func_with_two_args(a1, a2); end -def func_with_any_number_of_args(*args); end - - -# @@PLEAC@@_10.12 -raise "some message" # raise exception - -begin - val = func -rescue Exception => msg - $stderr.puts "func raised an exception: #{msg}" -end - -# In Ruby the rescue statement uses an exception class, every -# exception which is not matched is still continuing -begin - val = func -rescue FullMoonError - ... -end - - -# @@PLEAC@@_10.13 -# Saving Global Values -# Of course we can just save the value and restore it later: -def print_age - puts "Age is #{$age}" -end - -$age = 18 # global variable -print_age() -if condition - safeage = $age - $age = 23 - print_age() - $age = safeage -end - -# We can also use a method that saves the global variable and -# restores it automatically when the block is left: - -def local(var) - eval("save = #{var.id2name}") - begin - result = yield - ensure - # we want to call this even if we got an exception - eval("#{var.id2name} = save") - end - result -end - -condition = true -$age = 18 -print_age() -if condition - local(:$age) { - $age = 23 - print_age() - } -end -print_age() - -# There is no need to use local() for filehandles or directory -# handles in ruby because filehandles are normal objects. - - -# @@PLEAC@@_10.14 -# In Ruby you may redefine a method [but not overload it :-(] -# just by defining again with the same name. -def foo; puts 'foo'; end -def foo; puts 'bar'; end -foo -#=> bar - -# You can also take a reference to an existing method before -# redefining a new one, using the `alias' keyword -def foo; puts 'foo'; end -alias foo_orig foo -def foo; puts 'bar'; end -foo_orig -foo -#=> foo -#=> bar - -# AFAIK, there is no direct way to create a new method whose name -# comes from a variable, so use "eval" -colors = %w(red blue green yellow orange purple violet) -colors.each { |c| - eval <<-EOS - def #{c}(*a) - "" + a.to_s + "" - end - EOS -} - - -# @@PLEAC@@_10.15 -def method_missing(name, *args) - "" + args.join(' ') + "" -end -puts chartreuse("stuff") - - -# @@PLEAC@@_10.16 -def outer(arg) - x = arg + 35 - inner = proc { x * 19 } - x + inner.call() -end - - -# @@PLEAC@@_10.17 -#!/usr/bin/ruby -w -# mailsort - sort mbox by different criteria -require 'English' -require 'Date' - -# Objects of class Mail represent a single mail. -class Mail - attr_accessor :no - attr_accessor :subject - attr_accessor :fulltext - attr_accessor :date - - def initialize - @fulltext = "" - @subject = "" - end - - def append(para) - @fulltext << para - end - - # this is called if you call puts(mail) - def to_s - @fulltext - end -end - -# represents a list of mails. -class Mailbox < Array - - Subjectpattern = Regexp.new('Subject:\s*(?:Re:\s*)*(.*)\n') - Datepattern = Regexp.new('Date:\s*(.*)\n') - - # reads mails from open file and stores them - def read(file) - $INPUT_RECORD_SEPARATOR = '' # paragraph reads - msgno = -1 - file.each { |para| - if para =~ /^From/ - mail = Mail.new - mail.no = (msgno += 1) - md = Subjectpattern.match(para) - if md - mail.subject = md[1] - end - md = Datepattern.match(para) - if md - mail.date = DateTime.parse(md[1]) - else - mail.date = DateTime.now - end - self.push(mail) - end - mail.append(para) if mail - } - end - - def sort_by_subject_and_no - self.sort_by { |m| - [m.subject, m.no] - } - end - - # sorts by a list of attributs of mail, given as symbols - def sort_by_attributs(*attrs) - # you can sort an Enumerable by an array of - # values, they would be compared - # from ary[0] to ary[n]t, say: - # ['b',1] > ['a',10] > ['a',9] - self.sort_by { |elem| - attrs.map { |attr| - elem.send(attr) - } - } - end - -end - -mailbox = Mailbox.new -mailbox.read(ARGF) - -# print only subjects sorted by subject and number -for m in mailbox.sort_by_subject_and_no - puts(m.subject) -end - -# print complete mails sorted by date, then subject, then number -for m in mailbox.sort_by_attributs(:date, :subject) - puts(m) -end - - -# @@PLEAC@@_11.7 -def mkcounter(count) - start = count - bundle = { - "NEXT" => proc { count += 1 }, - "PREV" => proc { count -= 1 }, - "RESET" => proc { count = start } - } - bundle["LAST"] = bundle["PREV"] - return bundle -end - -c1 = mkcounter(20) -c2 = mkcounter(77) - -puts "next c1: #{c1["NEXT"].call}" # 21 -puts "next c2: #{c2["NEXT"].call}" # 78 -puts "next c1: #{c1["NEXT"].call}" # 22 -puts "last c1: #{c1["PREV"].call}" # 21 -puts "last c1: #{c1["LAST"].call}" # 20 -puts "old c2: #{c2["RESET"].call}" # 77 - - -# @@PLEAC@@_11.15 -class Binary_tree - def initialize(val) - @value = val - @left = nil - @right = nil - end - - # insert given value into proper point of - # provided tree. If no tree provided, - # use implicit pass by reference aspect of @_ - # to fill one in for our caller. - def insert(val) - if val < @value then - if @left then - @left.insert(val) - else - @left = Binary_tree.new(val) - end - elsif val > @value then - if @right then - @right.insert(val) - else - @right = Binary_tree.new(val) - end - else - puts "double" - # do nothing, no double values - end - end - - # recurse on left child, - # then show current value, - # then recurse on right child. - def in_order - @left.in_order if @left - print @value, " " - @right.in_order if @right - end - - # show current value, - # then recurse on left child, - # then recurse on right child. - def pre_order - print @value, " " - @left.pre_order if @left - @right.pre_order if @right - end - - # recurse on left child, - # then recurse on right child, - # then show current value. - def post_order - @left.post_order if @left - @right.post_order if @right - print @value, " " - end - - # find out whether provided value is in the tree. - # if so, return the node at which the value was found. - # cut down search time by only looking in the correct - # branch, based on current value. - def search(val) - if val == @value then - return self - elsif val < @value then - return @left.search(val) if @left - return nil - else - return @right.search(val) if @right - return nil - end - end -end - -# first generate 20 random inserts -test = Binary_tree.new(0) -for a in 0..20 - test.insert(rand(1000)) -end - -# now dump out the tree all three ways -print "Pre order: "; test.pre_order; puts "" -print "In order: "; test.in_order; puts "" -print "Post order: "; test.post_order; puts "" - -print "search?" -while gets - print test.search($_.to_i) - print "\nsearch?" -end - - -# @@PLEAC@@_12.0 -# class and module names need to have the first letter capitalized -module Alpha - NAME = 'first' -end -module Omega - NAME = 'last' -end -puts "Alpha is #{Alpha::NAME}, Omega is #{Omega::NAME}" - -# ruby doesn't differentiate beteen compile-time and run-time -require 'getoptlong.rb' -require 'getoptlong' # assumes the .rb -require 'cards/poker.rb' -require 'cards/poker' # assumes the .rb -load 'cards/poker' # require only loads the file once - -module Cards - module Poker - @card_deck = Array.new # or @card_deck = [] - def shuffle - end - end -end - - -# @@PLEAC@@_12.1 -# a module exports all of its functions -module Your_Module - def self.function - # this would be called as Your_Module.function - end - - def Your_Module.another - # this is the same as above, but more specific - end -end - -# @@PLEAC@@_12.2 -begin - require 'nonexistent' -rescue LoadError - puts "Couldn't load #{$!}" # $! contains the last error string -end - -# @@PLEAC@@_12.4 -# module variables are private unless access functions are defined -module Alpha - @aa = 10 - @bb = 11 - - def self.put_aa - puts @aa - end - - def self.bb=(val) - @bb = val - end -end - -Alpha.bb = 12 -# Alpha.aa = 10 # error, no aa=method - - -# @@PLEAC@@_12.5 -# caller provides a backtrace of the call stack -module MyModule - def find_caller - caller - end - - def find_caller2(i) - caller(i) # an argument limits the size of the stack returned - end -end - - -# @@PLEAC@@_12.6 -BEGIN { - $logfile = '/tmp/mylog' unless defined? $logfile - $LF = File.open($logfile, 'a') -} - -module Logger - def self.logmsg(msg) - $LF.puts msg - end - - logmsg('startup') -end - -END { - Logger::logmsg('shutdown') - $LF.close -} - - -# @@PLEAC@@_12.7 -#----------------------------- -# results may be different on your system -# % ruby -e "$LOAD_PATH.each_index { |i| printf("%d %s\n", i, $LOAD_PATH[i] } -#0 /usr/local/lib/site_ruby/1.6 -#1 /usr/local/lib/site_ruby/1.6/i386-linux -#2 /usr/local/lib/site_ruby/ -#3 /usr/lib/ruby/1.6 -#4 /usr/lib/ruby/1.6/i136-linux -#5 . -#----------------------------- -# syntax for sh, bash, ksh, or zsh -#$ export RUBYLIB=$HOME/rubylib - -# syntax for csh or tcsh -# % setenv RUBYLIB ~/rubylib -#----------------------------- -$LOAD_PATH.unshift "/projects/spectre/lib"; - - -# @@PLEAC@@_12.8 -# equivalents in ruby are mkmf, SWIG, or Ruby/DL depending on usage - - -# @@PLEAC@@_12.9 -# no equivalent in ruby - - -# @@PLEAC@@_12.10 -# no equivalent in ruby - - -# @@PLEAC@@_12.11 -module FineTime - def self.time - # to be defined later - end -end - - -module FineTime - def self.time - "its a fine time" - end -end - -puts FineTime.time #=> "its a fine time" - - -# @@PLEAC@@_12.12 -def even_only(n) - raise "#{n} is not even" if (n & 1) != 0 # one way to test - # ... -end -def even_only(n) - $stderr.puts "#{n} is not even" if (n & 1) != 0 - # ... -end - - -# @@PLEAC@@_12.17 -# The library archive for ruby is called Ruby Application archive, -# or shorter RAA, and can be found at http://raa.ruby-lang.org. -# A typical library is installed like this: -# % gunzip some-module-4.54.tar.gz -# % tar xf some-module-4.54.tar -# % cd some-module-4.54.tar -# % ruby install.rb config -# % ruby install.rb setup -# get superuser previleges here if needed for next step -# % ruby install.rb install - -# Some modules use a different process, -# you should find details in the documentation -# Here is an example of such a different process -# % ruby extconf.rb -# % make -# % make install - -# If you want the module installed in your own directory: -# For ruby version specific libraries -# % ruby install.rb config --site-ruby=~/lib -# For version independent libraries -# % ruby install.rb config --site-ruby-common=~/lib - -# Information about possible options for config -# % ruby install.rb --help - -# If you have your own complete distribution -# % ruby install.rb --prefix=path=~/ruby-private - - -# @@PLEAC@@_13.0 -# Classes and objects in Ruby are rather straigthforward -class Person - # Class variables (also called static attributes) are prefixed by @@ - @@person_counter=0 - - # object constructor - def initialize(age, name, alive = true) # Default arg like in C++ - @age, @name, @alive = age, name, alive # Object attributes are prefixed by '@' - @@person_counter += 1 - # There is no '++' operator in Ruby. The '++'/'--' operators are in fact - # hidden assignments which affect variables, not objects. You cannot accomplish - # assignment via method. Since everything in Ruby is object, '++' and '--' - # contradict Ruby OO ideology. Instead '-=' and '+=' are used. - end - - attr_accessor :name, :age # This creates setter and getter methods for @name - # and @age. See 13.3 for detailes. - - # methods modifying the receiver object usually have the '!' suffix - def die! - @alive = false - puts "#{@name} has died at the age of #{@age}." - @alive - end - - def kill(anotherPerson) - print @name, ' is killing ', anotherPerson.name, ".\n" - anotherPerson.die! - end - - # methods used as queries - # usually have the '?' suffix - def alive? - @alive && true - end - - def year_of_birth - Time.now.year - @age - end - - # Class method (also called static method) - def Person.number_of_people - @@person_counter - end -end - -# Using the class: -# Create objects of class Person -lecter = Person.new(47, 'Hannibal') -starling = Person.new(29, 'Clarice', true) -pazzi = Person.new(40, 'Rinaldo', true) - -# Calling a class method -print "There are ", Person.number_of_people, " Person objects\n" - -print pazzi.name, ' is ', (pazzi.alive?) ? 'alive' : 'dead', ".\n" -lecter.kill(pazzi) -print pazzi.name, ' is ', (pazzi.alive?) ? 'alive' : 'dead', ".\n" - -print starling.name , ' was born in ', starling.year_of_birth, "\n" - - -# @@PLEAC@@_13.1 -# If you don't need any initialisation in the constructor, -# you don't need to write a constructor. -class MyClass -end - -class MyClass - def initialize - @start = Time.new - @age = 0 - end -end - -class MyClass - def initialize(inithash) - @start = Time.new - @age = 0 - for key, value in inithash - instance_variable_set("@#{key}", value) - end - end -end - -# @@PLEAC@@_13.2 -# Objects are destroyed by the garbage collector. -# The time of destroying is not predictable. -# The ruby garbage collector can handle circular references, -# so there is no need to write destructor for that. - -# There is no direct support for destructor. -# You can call a custom function, or more specific a proc object, when the -# garbage collector is about to destruct the object, but it is unpredictable -# when this occurs. -# Also if such a finalizer object has a reference to the orignal object, -# this may prevent the original object to get garbage collected. -# Because of this problem the finalize method below is -# a class method and not a instance method. -# So if you need to free resources for an object, like -# closing a socket or kill a spawned subprocess, -# you should do it explicitly. - -class MyClass - def initialize - ObjectSpace.define_finalizer(self, - self.class.method(:finalize).to_proc) - end - def MyClass.finalize(id) - puts "Object #{id} dying at #{Time.new}" - end -end - -# test code -3.times { - MyClass.new -} -ObjectSpace.garbage_collect - - -# @@PLEAC@@_13.3 -# You can write getter and setter methods in a natural way: -class Person - def name - @name - end - def name=(name) - @name = name - end -end - -# But there is a better and shorter way -class Person - attr_reader :age - attr_writer :name - # attr_reader and attr_writer are actually methods in class Class - # which set getter and setter methods for you. -end - -# There is also attr_accessor to create both setters and getters -class Person - attr_accessor :age, :name -end - - -# @@PLEAC@@_13.4 -class Person - # Class variables (also called static attributes) are prefixed by @@ - @@person_counter = 0 - - def Person.population - @@person_counter - end - def initialize - @@person_counter += 1 - ObjectSpace.define_finalizer(self, - self.class.method(:finalize).to_proc) - end - def Person.finalize(id) - @@person_counter -= 1 - end -end -people = [] -10.times { - people.push(Person.new) -} -printf("There are %d people alive", Person.population) - - -FixedArray.class_max_bounds = 100 -alpha = FixedArray.new -puts "Bound on alpha is #{alpha.max_bounds}" - -beta = FixedArray.new -beta.max_bounds = 50 # calls the instance method -beta.class.class_max_bounds = 50 # alternative, calls the class method -puts "Bound on alpha is #{alpha.max_bounds}" - -class FixedArray - @@bounds = 7 - - def max_bounds - @@max_bounds - end - # instance method, which sets the class variable - def max_bounds=(value) - @@max_bounds = value - end - # class method. This can only be called on a class, - # but not on the instances - def FixedArray.class_max_bounds=(value) - @@max_bounds = value - end -end - - -# @@PLEAC@@_13.5 -PersonStruct = Struct.new("Person", :name, :age, :peers) -# creates a class "Person::Struct", which is accessiable with the -# constant "PersonStruct" -p = PersonStruct.new -p = Struct::Person.new # alternative using the classname -p.name = "Jason Smythe" -p.age = 13 -p.peers = ["Wilbur", "Ralph", "Fred"] -p[:peers] = ["Wilbur", "Ralph", "Fred"] # alternative access using symbol -p["peers"] = ["Wilbur", "Ralph", "Fred"] # alternative access using name of field -p[2] = ["Wilbur", "Ralph", "Fred"] # alternative access using index of field -puts "At age #{p.age}, #{p.name}'s first friend is #{p.peers[0]}" - -# The fields of a struct have no special type, like other ruby variables -# you can put any objects in. Therefore the discussions how to specify -# the types of the fields do not apply to ruby. - -FamilyStruct = Struct.new("Family", :head, :address, :members) -folks = FamilyStruct.new -folks.head = PersonStruct.new -dad = folks.head -dad.name = "John" -dad.age = 34 - -# supply of own accessor method for the struct for error checking -class PersonStruct - def age=(value) - if !value.kind_of?(Integer) - raise(ArgumentError, "Age #{value} isn't an Integer") - elsif value > 150 - raise(ArgumentError, "Age #{value} is unreasonable") - end - @age = value - end -end - - -# @@PLEAC@@_13.6 -# The ruby Object class defines a dup and a clone method. -# The dup method is recommended for prototype object creation. -# The default implementation makes a shallow copy, -# but each class can override it, for example to make a deep copy. - -# If you want to call 'new' directly on the instances, -# you can create a instance method "new", which returns a new duplicate. -# This method is distinct from the class method new. -# -class A - def new - dup - end -end - -ob1 = A.new -# later on -ob2 = ob1.new - - -# @@PLEAC@@_13.7 -methname = 'flicker' -obj.send(methname, 10) # calls obj.flicker(10) - -# call three methods on the object, by name -['start', 'run', 'stop'].each do |method_string| - obj.send(method_string) -end - -# Another way is to create a Method object -method_obj = obj.method('flicker') -# And then call it -method_obj.call(10) - - -# @@PLEAC@@_13.8 -# All classes in Ruby inherit from class Object -# and thus all objects share methods defined in this class - -# the class of the object -puts any_object.type - -# Ruby classes are actually objects of class Class and they -# respond to methods defined in Object class as well - -# the superclass of this class -puts any_object.class.superclass - -# ask an object whether it is an instance of particular class -n = 4.7 -puts n.instance_of?(Float) # true -puts n.instance_of?(Numeric) # false - -# ask an object whether it is an instance of class, one of the -# superclasses of the object, or modules included in it -puts n.kind_of?(Float) # true (the class) -puts n.kind_of?(Numeric) # true (an ancestor class) -puts n.kind_of?(Comparable) # true (a mixin module) -puts n.kind_of?(String) # false - -# ask an object whether it can respond to a particular method -puts n.respond_to?('+') # true -puts n.respond_to?('length') # false - -# all methods an object can respond to -'just a string'.methods.each { |m| puts m } - - -# @@PLEAC@@_13.9 -# Actually any class in Ruby is inheritable -class Person - attr_accessor :age, :name - def initialize - @name - @age - end -end -#----------------------------- -dude = Person.new -dude.name = 'Jason' -dude.age = 23 -printf "%s is age %d.\n", dude.name, dude.age -#----------------------------- -# Inheriting from Person -class Employee < Person - attr_accessor :salary -end -#----------------------------- -empl = Employee.new -empl.name = 'Jason' -empl.age = 23 -empl.salary = 200 -printf "%s is age %d, the salary is %d.\n", empl.name, empl.age, empl.salary -#----------------------------- -# Any built-in class can be inherited the same way -class WeirdString < String - def initialize(obj) - super obj - end - def +(anotherObj) # + method in this class is overridden - # to return the sum of string lengths - self.length + anotherObj.length # 'self' can be omitted - end -end -#----------------------------- -a = WeirdString.new('hello') -b = WeirdString.new('bye') - -puts a + b # the overridden + -#=> 8 -puts a.length # method from the superclass, String -#=> 5 - - -# @@PLEAC@@_13.11 -# In ruby you can override the method_missing method -# to have a solution similar to perls AUTOLOAD. -class Person - - def initialize - @ok_fields = %w(name age peers parent) - end - - def valid_attribute?(name) - @ok_fields.include?(name) - end - - def method_missing(namesymbol, *params) - name = namesymbol.to_s - return if name =~ /^A-Z/ - if name.to_s[-1] == ('='[0]) # we have a setter - isSetter = true - name.sub!(/=$/, '') - end - if valid_attribute?(name) - if isSetter - instance_variable_set("@#{name}", *params) - else - instance_variable_get("@#{name}", *params) - end - else - # if no annestor is responsible, - # the Object class will throw a NoMethodError exception - super(namesymbol, *params) - end - end - - def new - kid = Person.new - kid.parent = self - kid - end - -end - -dad = Person.new -dad.name = "Jason" -dad.age = 23 -kid = dad.new -kid.name = "Rachel" -kid.age = 2 -puts "Kid's parent is #{kid.parent.name}" -puts dad -puts kid - -class Employee < Person - def initialize - super - @ok_fields.push("salary", "boss") - end - def ok_fields - @ok_fields - end -end - - -# @@PLEAC@@_13.13 -# The ruby garbage collector pretends to cope with circular structures. -# You can test it with this code: -class RingNode - attr_accessor :next - attr_accessor :prev - attr_reader :name - - def initialize(aName) - @name = aName - ObjectSpace.define_finalizer(self, - self.class.method(:finalize).to_proc) - end - - def RingNode.finalize(id) - puts "Node #{id} dying" - end - - def RingNode.show_all_objects - ObjectSpace.each_object {|id| - puts id.name if id.class == RingNode - } - end -end - -def create_test - a = RingNode.new("Node A") - b = RingNode.new("Node B") - c = RingNode.new("Node C") - a.next = b - b.next = c - c.next = a - a.prev = c - c.prev = b - b.prev = a - - a = nil - b = nil - c = nil -end - -create_test -RingNode.show_all_objects -ObjectSpace.garbage_collect -puts "After garbage collection" -RingNode.show_all_objects - - -# @@PLEAC@@_13.14 -class String - def <=>(other) - self.casecmp other - end -end - -# There is no way to directly overload the '""' (stringify) -# operator in Ruby. However, by convention, classes which -# can reasonably be converted to a String will define a -# 'to_s' method as in the TimeNumber class defined below. -# The 'puts' method will automatcally call an object's -# 'to_s' method as is demonstrated below. -# Furthermore, if a class defines a to_str method, an object of that -# class can be used most any place where the interpreter is looking -# for a String value. - -#--------------------------------------- -# NOTE: Ruby has a builtin Time class which would usually be used -# to manipulate time objects, the following is supplied for -# educational purposes to demonstrate operator overloading. -# -class TimeNumber - attr_accessor :hours,:minutes,:seconds - def initialize( hours, minutes, seconds) - @hours = hours - @minutes = minutes - @seconds = seconds - end - - def to_s - return sprintf( "%d:%02d:%02d", @hours, @minutes, @seconds) - end - - def to_str - to_s - end - - def +( other) - seconds = @seconds + other.seconds - minutes = @minutes + other.minutes - hours = @hours + other.hours - if seconds >= 60 - seconds %= 60 - minutes += 1 - end - if minutes >= 60 - minutes %= 60 - hours += 1 - end - return TimeNumber.new(hours, minutes, seconds) - end - - def -(other) - raise NotImplementedError - end - - def *(other) - raise NotImplementedError - end - - def /( other) - raise NotImplementedError - end -end - -t1 = TimeNumber.new(0, 58, 59) -sec = TimeNumber.new(0, 0, 1) -min = TimeNumber.new(0, 1, 0) -puts t1 + sec + min + min - -#----------------------------- -# StrNum class example: Ruby's builtin String class already has the -# capabilities outlined in StrNum Perl example, however the '*' operator -# on Ruby's String class acts differently: It creates a string which -# is the original string repeated N times. -# -# Using Ruby's String class as is in this example: -x = "Red"; y = "Black" -z = x+y -r = z*3 # r is "RedBlackRedBlackRedBlack" -puts "values are #{x}, #{y}, #{z}, and #{r}" -print "#{x} is ", x < y ? "LT" : "GE", " #{y}\n" -# prints: -# values are Red, Black, RedBlack, and RedBlackRedBlackRedBlack -# Red is GE Black - -#----------------------------- -class FixNum - REGEX = /(\.\d*)/ - DEFAULT_PLACES = 0 - attr_accessor :value, :places - def initialize(value, places = nil) - @value = value - if places - @places = places - else - m = REGEX.match(value.to_s) - if m - @places = m[0].length - 1 - else - @places = DEFAULT_PLACES - end - end - end - - def +(other) - FixNum.new(@value + other.value, max(@places, other.places)) - end - - def *(other) - FixNum.new(@value * other.value, max(@places, other.places)) - end - - def /(other) - puts "Divide: #{@value.to_f/other.value.to_f}" - result = FixNum.new(@value.to_f/other.value.to_f) - result.places = max(result.places,other.places) - result - end - - def to_s - sprintf("STR%s: %.*f", self.class.to_s , @places, @value) #. - end - - def to_str - to_s - end - - def to_i #convert to int - @value.to_i - end - - def to_f #convert to float` - @value.to_f - end - - private - def max(a,b) - a > b ? a : b - end -end - -def demo() - x = FixNum.new(40) - y = FixNum.new(12, 0) - - puts "sum of #{x} and #{y} is #{x+y}" - puts "product of #{x} and #{y} is #{x*y}" - - z = x/y - puts "#{z} has #{z.places} places" - unless z.places - z.places = 2 - end - - puts "div of #{x} by #{y} is #{z}" - puts "square of that is #{z*z}" -end - -if __FILE__ == $0 - demo() -end - - -# @@PLEAC@@_14.1 -# There are dbm, sdbm, gdbm modules -# and the bdb module for accessing the berkeley db -# sdbm seem to be available on the most systems, -# so we use it here -# -require "sdbm" -SDBM.open("filename", 0666) { |dbobj| - # raises exception if open error - - # the returned sdbm-dbobj has most of the methods of a hash - v = dbobj["key"] - dbobj["key"] = "newvalue" - if dbobj.has_key?("key") - # ... - end - dbobj.delete("key2") -} -# database is open only inside the block. - -# It is also possible to use a open .. close pair: -dbobj = SDBM.open("filename", 0666) -#.. do something with dbobj -dbobj.close - -#!/usr/bin/ruby -w -# userstats - generate statistics on who is logged in -# call with usernames as argument to display the totals -# for the given usernames, call with "ALL" to display all users - -require "sdbm" -filename = '/tmp/userstats.db' -SDBM.open(filename, 0666) { |dbobj| - if ARGV.length > 0 - if ARGV[0] == "ALL" - # ARGV is constant, so we need the variable userlist - userlist = dbobj.keys().sort() - else - userlist = ARGV - end - userlist.each { |user| - print "#{user}\t#{dbobj[user]}\n" - } - else - who = `who` - who.split("\n").each { |line| - md = /^(\S+)/.match(line) - raise "Bad line from who: #{line}" unless md - # sdbm stores only strings, so "+=" doesn't work, - # we need to convert them expicitly back to integer. - if dbobj.has_key?(md[0]) - dbobj[md[0]] = dbobj[md[0]].to_i + 1 - else - dbobj[md[0]] = "1" - end - } - end -} - - -# @@PLEAC@@_14.2 -# using open and clear -dbobj = SDBM.open("filename", 0666) -dbobj.clear() -dbobj.close() -# deleting file and recreating it -# the filenames depend on the flavor of dbm you use, -# for example sdbm has two files named filename.pag and filename.dir, -# so you need to delete both files -begin - File.delete("filename") - # raises Exception if not exist - dbobj = SDBM.open("filename", 0666) -rescue - # add error handling here -end - - -# @@PLEAC@@_14.3 -# sdbm2gdbm: converts sdbm database to a gdbm database -require "sdbm" -require "gdbm" - -unless ARGV.length == 2 - fail "usage: sdbm2gdbm infile outfile" -end -infile = ARGV[0] -outfile = ARGV[1] - -sdb = SDBM.open(infile) -gdb = GDBM.open(outfile, 0666) -sdb.each { |key, val| - gdb[key] = val -} -gdb.close -sdb.close - - -# @@PLEAC@@_14.4 -#!/usr/bin/ruby -w -# dbmmerge: merges two dbm databases -require "sdbm" - -unless ARGV.length == 3 - fail "usage: dbmmerge indb1 indb2 outdb" -end -infile1 = ARGV[0] -infile2 = ARGV[0] -outfile = ARGV[2] - -in1 = SDBM.open(infile1, nil) -in2 = SDBM.open(infile2, nil) -outdb = SDBM.open(outfile, 0666) - -[in1, in2].each { |indb| - indb.each { |key, val| - if outdb.has_key?(key) - # decide which value to set. - # set outdb[key] if necessary - else - outdb[key] = val - end - } -} -in1.close -in2.close -outdb.close - - -# @@PLEAC@@_14.7 -# we write a tie method that extends the Array class. -# It reads the file into the memory, executes the code block -# in which you can manipulate the array as needed, and writes -# the array back to the file after the end of the block execution -class Array - def tie(filename, flags) - File.open(filename, flags) { |f| - f.each_line { |line| - self.push(line.chomp) - } - yield - f.rewind - each { |line| - if line - f.puts(line) - else - f.puts "" - end - } - } - end -end - -array = Array.new -array.tie("/tmp/textfile.txt", File::RDWR|File::CREAT) { - array[4] = "a new line 4" -} - -# The tied array can be manipulated like a normal array, -# so there is no need for a special API, and the recno_demo program -# to demonstrate is API is useless - - -# tied array demo: show how to use array with a tied file -filename = "db_file.txt" -lines = Array.new -File.unlink(filename) if File.exists?(filename) -lines.tie(filename, File::RDWR | File::CREAT) { - # first create a textfile to play with - lines[0] = "zero" - lines[1] = "one" - lines[2] = "two" - lines[3] = "three" - lines[4] = "four" - - # print the records in order. - # Opposed to perl, the tied array behaves exactly as a normal array - puts "\nOriginal" - for i in 0..(lines.length-1) - puts "#{i}: #{lines[i]}" - end - - #use push and pop - a = lines.pop - lines.push("last") - puts("The last line was [#{a}]") - - #use shift and unshift - a = lines.shift - lines.unshift("first") - puts("The first line was [#{a}]") - - # add record after record 2 - i = 2 - lines.insert(i + 1, "Newbie") - - # add record before record one - i = 1 - lines.insert(i, "New One") - - # delete record 3 - lines.delete_at(3) - - #now print the records in reverse order - puts "\nReverse" - (lines.length - 1).downto(0){ |i| - puts "#{i}: #{lines[i]}" - } - -} - - -# @@PLEAC@@_14.8 -# example to store complex data in a database -# uses marshall from the standard library -require "sdbm" -db = SDBM.open("pleac14-8-database", 0666) - -# convert the Objects into strings and back by using the Marshal module. -# Most normal objects can be converted out of the box, -# but not special things like procedure objects, -# IO instance variables, singleton objects - -db["Tom Christiansen"] = Marshal.dump(["book author", "tchrist@perl.com"]) -db["Tom Boutell"] = Marshal.dump(["shareware author", -"boutell@boutell.com"]) - -name1 = "Tom Christiansen" -name2 = "Tom Boutell" - -tom1 = Marshal.load(db[name1]) -tom2 = Marshal.load(db[name2]) - -puts "Two Toming: #{tom1} #{tom2}" - -if tom1[0] == tom2[0] && tom1[1] == tom2[1] - puts "You're having runtime fun with one Tom made two." -else - puts "No two Toms are ever alike" -end - -# To change parts of an entry, get the whole entry, change the parts, -# and save the whole entry back -entry = Marshal.load(db["Tom Boutell"]) -entry[0] = "Poet Programmer" -db["Tom Boutell"] = Marshal.dump(entry) -db.close - - -# @@PLEAC@@_14.9 -# example to make data persistent -# uses Marshal from the standard lib -# Stores the data in a simple file, -# see 14.8 on how to store it in a dbm file - -# The BEGIN block is executed before the rest of the script -# we use global variables here because local variables -# will go out of scope and are not accessible from the main script - -BEGIN { - $persistent_store = "persitence.dat" - begin - File.open($persistent_store) do |f| - $stringvariable1 = Marshal.load(f) - $arrayvariable2 = Marshal.load(f) - end - rescue - puts "Can not open #{$persistent_store}" - # Initialisation if this script runs the first time - $stringvariable1 = "" - $arrayvariable2 = [] - end -} - -END { - File.open($persistent_store, "w+") do |f| - Marshal.dump($stringvariable1, f) - Marshal.dump($arrayvariable2, f) - end -} - -# simple test program -puts $stringvariable1 -puts $arrayvariable2 -$stringvariable1 = "Hello World" -$arrayvariable2.push(5) -puts $stringvariable1 -puts $arrayvariable2 - - -# @@PLEAC@@_14.10 -#!/usr/bin/ruby -w -# Ruby has a dbi module with an architecture similar -# to the Perl dbi module: the dbi module provides an unified -# interface and uses specialized drivers for each dbms vendor -# -begin - DBI.connect("DBI:driver:driverspecific", "username", "auth") { - |dbh| - - dbh.do(SQL1) - - dbh.prepare(SQL2){ |sth| - sth.execute - sth.fetch {|row| - # ... - } - } # end of block finishes the statement handle - } # end of block closes the database connection -rescue DBI::DatabaseError => e - puts "dbi error occurred" - puts "Error code: #{e.err}" - puts "Error message: #{e.errstr}" -end - -#!/usr/bin/ruby -w -# dbusers - example for mysql which creates a table, -# fills it with values, retrieves the values back, -# and finally destroys the table. - -require "dbi" - -# replacement for the User::pwnt module -def getpwent - result = [] - File.open("/etc/passwd") {|file| - file.each_line {|line| - next if line.match(/^#/) - cols = line.split(":") - result.push([cols[2], cols[0]]) - } - } - result -end - -begin - DBI.connect("DBI:Mysql:pleacdatabase", "pleac", "pleacpassword") { - |conn| - - conn.do("CREATE TABLE users (uid INT, login CHAR(8))") - - users = getpwent - - conn.prepare("INSERT INTO users VALUES (?,?)") {|sth| - users.each {|entry| - sth.execute(entry[0], entry[1]) - } - } - - conn.execute("SELECT uid, login FROM users WHERE uid < 50") {|sth| - sth.fetch {|row| - puts row.collect {|col| - if col.nil? - "(null)" - else - col - end - }.join(", ") - } - } - - conn.do("DROP TABLE users") - } -rescue DBI::DatabaseError => e - puts "dbi error occurred" - puts "Error code: #{e.err}" - puts "Error message: #{e.errstr}" -end - - -# @@PLEAC@@_15.1 -# This test program demonstrates parsing program arguments. -# It uses the optparse library, which is included with ruby 1.8 -# It handles classic unix style and gnu style options -require 'optparse' - -@debugmode = false -@verbose = false - -ARGV.options do |opts| - opts.banner = "Usage: ruby #{$0} [OPTIONS] INPUTFILES" - - opts.on("-h", "--help", "show this message") { - puts opts - exit - } - # The OptionParser#on method is called with a specification of short - # options, of long options, a data type spezification and user help - # messages for this option. - # The method analyses the given parameter and decides what it is, - # so you can leave out the long option if you don't need it - opts.on("-v", "--[no-]verbose=[FLAG]", TrueClass, "run verbosly") { - |@verbose| # sets @verbose to true or false - } - opts.on("-D", "--DEBUG", TrueClass, "turns on debug mode" ){ - |@debugmode| # sets @debugmode to true - } - opts.on("-c", "--count=NUMBER", Integer, "how many times we do it" ){ - |@count| # sets @count to given integer - } - opts.on("-o", "--output=FILE", String, "file to write output to"){ - |@outputfile| # sets @outputfile to given string - } - opts.parse! -end - -# example to use the options in the main program -puts "Verbose is on" if @verbose -puts "Debugmode is on" if @debugmode -puts "Outfile is #{@outputfile}" if defined? @outputfile -puts "Count is #{@count}" if defined? @count -ARGV.each { |param| - puts "Got parameter #{param}" -} - - -# @@PLEAC@@_15.4 -buf = "\0" * 8 -$stdout.ioctl(0x5413, buf) -ws_row, ws_col, ws_xpixel, ws_ypixel = buf.unpack("S4") - -raise "You must have at least 20 characters" unless ws_col >= 20 -max = 0 -values = (1..5).collect { rand(20) } # generate an array[5] of rand values -for i in values - max = i if max < i -end -ratio = Float(ws_col-12)/max # chars per unit -for i in values - printf "%8.1f %s\n", i, "*" * (ratio*i) -end - -# gives, for example: -# 15.0 ******************************* -# 10.0 ********************* -# 5.0 ********** -# 14.0 ***************************** -# 18.0 ************************************** - - -# @@PLEAC@@_16.1 -output = `program args` # collect output into one multiline string -output = `program args`.split # collect output into array, one line per -element - -readme = IO.popen("ls") -output = "" -while readme.gets do - output += $_ -end -readme.close - -`fsck -y /dev/rsd1a` # BAD AND SCARY in Perl because it's managed by the shell - # I donna in Ruby ... - -# so the "clean and secure" version -readme, writeme = IO.pipe -pid = fork { - # child - $stdout = writeme - readme.close - exec('find', '..') -} -# parent -Process.waitpid(pid, 0) -writeme.close -while readme.gets do - # do something with $_ -end - - -# @@PLEAC@@_16.2 -status = system("xemacs #{myfile}") - -status = system("xemacs", myfile) - -system("cmd1 args | cmd2 | cmd3 >outfile") -system("cmd args outfile 2>errfile") - -# stop if the command fails -raise "$program exited funny: #{$?}" unless system("cmd", "args1", "args2") - -# get the value of the signal sent to the child -# even if it is a SIGINT or SIGQUIT -system(arglist) -raise "program killed by signal #{$?}" if ($? & 127) != 0 - -pid = fork { - trap("SIGINT", "IGNORE") - exec("sleep", "10") -} -trap ("SIGINT") { - puts "Tsk tsk, no process interruptus" -} -Process.waitpid(pid, 0) - -# Ruby doesn't permit to lie to the program called by a 'system'. -# (ie specify what return argv[0] in C, $0 in Perl/Ruby ...) -# A (dirty) way is to create a link (under Unix), run this link and -# erase it. Somebody has a best idea ? - - -# @@PLEAC@@_16.3 -exec("archive *.data") - -exec("archive", "accounting.data") - -exec("archive accounting.data") - - -# @@PLEAC@@_16.4 -# read the output of a program -IO.popen("ls") {|readme| - while readme.gets do - # ... - end -} -# or -readme = IO.popen("ls") -while readme.gets do - # ... -end -readme.close - -# "write" in a program -IO.popen("cmd args","w") {|pipe| - pipe.puts("data") - pipe.puts("foo") -} - -# close wait for the end of the process -read = IO.popen("sleep 10000") # child goes to sleep -read.close # and the parent goes to lala land - -writeme = IO.popen("cmd args", "w") -writeme.puts "hello" # program will get hello\n on STDIN -writeme.close # program will get EOF on STDIN - -# send in a pager (eg less) all output -$stdout = IO.popen("/usr/bin/less","w") -print "huge string\n" * 10000 - - -# @@PLEAC@@_16.5 -#----------------------------- -def head(lines = 20) - pid = open("|-","w") - if pid == nil - return - else - while gets() do - pid.print - lines -= 1 - break if lines == 0 - end - end - exit -end - -head(100) -while gets() do - print -end -#----------------------------- -1: > Welcome to Linux, version 2.0.33 on a i686 - -2: > - -3: > "The software required `Windows 95 or better', - -4: > so I installed Linux." -#----------------------------- -> 1: Welcome to Linux, Kernel version 2.0.33 on a i686 - -> 2: - -> 3: "The software required `Windows 95 or better', - -> 4: so I installed Linux." -#----------------------------- -#!/usr/bin/ruby -# qnumcat - demo additive output filters - -def number() - pid = open("|-","w") - if pid == nil - return - else - while gets() do pid.printf("%d: %s", $., $_); end - end - exit -end - -def quote() - pid = open("|-","w") - if pid == nil - return - else - while gets() do pid.print "> #{$_}" end - end - exit -end - -number() -quote() - -while gets() do - print -end -$stdout.close -exit - - -# @@PLEAC@@_16.6 -ARGV.map! { |arg| - arg =~ /\.(gz|Z)$/ ? "|gzip -dc #{arg}" : arg -} -for file in ARGV - fh = open(file) - while fh.gets() do - # ....... - end -end -#----------------------------- -ARGV.map! { |arg| - arg =~ %r#^\w+://# ? "|GET #{arg}" : arg # -} -for file in ARGV - fh = open(file) - while fh.gets() do - # ....... - end -end -#----------------------------- -pwdinfo = (`domainname` =~ /^(\(none\))?$/) ? '/etc/passwd' : '|ypcat passwd'; -pwd = open(pwdinfo); -#----------------------------- -puts "File, please? "; -file = gets().chomp(); -fh = open(file); - - -# @@PLEAC@@_16.7 -output = `cmd 2>&1` # with backticks -# or -ph = open("|cmd 2>&1") # with an open pipe -while ph.gets() { } # plus a read -#----------------------------- -output = `cmd 2>/dev/null` # with backticks -# or -ph = open("|cmd 2>/dev/null") # with an open pipe -while ph.gets() { } # plus a read -#----------------------------- -output = `cmd 2>&1 1>/dev/null` # with backticks -# or -ph = open("|cmd 2>&1 1>/dev/null") # with an open pipe -while ph.gets() { } # plus a read -#----------------------------- -output = `cmd 3>&1 1>&2 2>&3 3>&-` # with backticks -# or -ph = open("|cmd 3>&1 1>&2 2>&3 3>&-") # with an open pipe -while ph.gets() { } # plus a read -#----------------------------- -system("program args 1>/tmp/program.stdout 2>/tmp/program.stderr") -#----------------------------- -output = `cmd 3>&1 1>&2 2>&3 3>&-` -#----------------------------- -fd3 = fd1 -fd1 = fd2 -fd2 = fd3 -fd3 = nil -#----------------------------- -system("prog args 1>tmpfile 2>&1") -system("prog args 2>&1 1>tmpfile") -#----------------------------- -# system ("prog args 1>tmpfile 2>&1") -fd1 = "tmpfile" # change stdout destination first -fd2 = fd1 # now point stderr there, too -#----------------------------- -# system("prog args 2>&1 1>tmpfile") -fd2 = fd1 # stderr same destination as stdout -fd1 = "tmpfile" # but change stdout destination -#----------------------------- -# It is often better not to rely on the shell, -# because of portability, possible security problems -# and bigger resource usage. So, it is often better to use the open3 library. -# See below for an example. -# opening stdin, stdout, stderr -require "open3" -stdin, stdout, stderr = Open3.popen('cmd') - - -# @@PLEAC@@_16.8 -#----------------------------- -# Contrary to perl, we don't need to use a module in Ruby -fh = Kernel.open("|" + program, "w+") -fh.puts "here's your input\n" -output = fh.gets() -fh.close() -#----------------------------- -Kernel.open("|program"),"w+") # RIGHT ! -#----------------------------- -# Ruby has already object methods for I/O handles -#----------------------------- -begin - fh = Kernel.open("|" + program_and_options, "w+") -rescue - if ($@ ~= /^open/) - $stderr.puts "open failed : #{$!} \n #{$@} \n" - break - end - raise # reraise unforseen exception -end - - -# @@PLEAC@@_16.13 -#% kill -l -#HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE -#ALRM TERM CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM -#PROF WINCH POLL PWR -#----------------------------- -#% ruby -e 'puts Signal.list.keys.join(" ")' -#PWR USR1 BUS USR2 TERM SEGV KILL POLL STOP SYS TRAP IOT HUP INT # -#WINCH XCPU TTIN CLD TSTP FPE IO TTOU PROF CHLD CONT PIPE ABRT -#VTALRM QUIT ILL XFSZ URG ALRM -#----------------------------- -# After that, the perl script create an hash equivalent to Signal.list, -# and an array. The array can be obtained by : -signame = [] -Signal.list.each { |name, i| signame[i] = name } - - -# @@PLEAC@@_16.14 -Process.kill(9, pid) # send $pid a signal 9 -Process.kill(-1, Process.getpgrp()) # send whole job a signal 1 -Process.kill("USR1", $$) # send myself a SIGUSR1 -Process.kill("HUP", pid1, pid2, pid3) # send a SIGHUP to processes in @pids -#----------------------------- -begin - Process.kill(0, minion) - puts "#{minion} is alive!" -rescue Errno::EPERM # changed uid - puts "#{minion} has escaped my control!"; -rescue Errno::ESRCH - puts "#{minion} is deceased."; # or zombied -rescue - puts "Odd; I couldn't check the status of #{minion} : #{$!}" -end - - -# @@PLEAC@@_16.15 -Kernel.trap("QUIT", got_sig_quit) # got_sig_quit = Proc.new { puts "Quit\n" } -trap("PIPE", "got_sig_quit") # def got_sig_pipe ... -trap("INT") { ouch++ } # increment ouch for every SIGINT -#----------------------------- -trap("INT", "IGNORE") # ignore the signal INT -#----------------------------- -trap("STOP", "DEFAULT") # restore default STOP signal handling - - -# @@PLEAC@@_16.16 -# the signal handler -def ding - trap("INT", "ding") - puts "\aEnter your name!" -end - -# prompt for name, overriding SIGINT -def get_name - save = trap("INT", "ding") - - puts "Kindly Stranger, please enter your name: " - name = gets().chomp() - trap("INT", save) - name -end - - -# @@PLEAC@@_16.21 -# implemented thanks to http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/1760 -require 'timeout' - -# we'll do something vastly more useful than cookbook to demonstrate timeouts -begin - timeout(5) { - waitsec = rand(10) - puts "Let's see if a sleep of #{waitsec} seconds is longer than 5 seconds..." - system("sleep #{waitsec}") - } - puts "Timeout didn't occur" -rescue Timeout::Error - puts "Timed out!" -end - - -# @@PLEAC@@_17.1 -# A basic TCP client connection -require 'socket' -begin - t = TCPSocket.new('www.ruby-lang.org', 'www') -rescue - puts "error: #{$!}" -else - # ... do something with the socket - t.print "GET / HTTP/1.0\n\n" - answer = t.gets(nil) - # and terminate the connection when we're done - t.close -end - -# Using the evil low level socket API -require 'socket' -# create a socket -s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0) -# build the address of the remote machine -sockaddr_server = [Socket::AF_INET, 80, - Socket.gethostbyname('www.ruby-lang.org')[3], - 0, 0].pack("snA4NN") -# connect -begin - s.connect(sockaddr_server) -rescue - puts "error: #{$!}" -else - # ... do something with the socket - s.print "GET / HTTP/1.0\n\n" - # and terminate the connection when we're done - s.close -end - -# TCP connection with management of error (DNS) -require 'socket' -begin - client = TCPSocket.new('does not exists', 'www') -rescue - puts "error: #{$!}" -end - -# TCP connection with a time out -require 'socket' -require 'timeout' -begin - timeout(1) do #the server has one second to answer - client = TCPSocket.new('www.host.com', 'www') - end -rescue - puts "error: #{$!}" -end - - -# @@PLEAC@@_17.12 -require 'socket' - -class Preforker - attr_reader (:child_count) - - def initialize(prefork, max_clients_per_child, port, client_handler) - @prefork = prefork - @max_clients_per_child = max_clients_per_child - @port = port - @child_count = 0 - - @reaper = proc { - trap('CHLD', @reaper) - pid = Process.wait - @child_count -= 1 - } - - @huntsman = proc { - trap('CHLD', 'IGNORE') - trap('INT', 'IGNORE') - Process.kill('INT', 0) - exit - } - - @client_handler=client_handler - end - - def child_handler - trap('INT', 'EXIT') - @client_handler.setUp - # wish: sigprocmask UNblock SIGINT - @max_clients_per_child.times { - client = @server.accept or break - @client_handler.handle_request(client) - client.close - } - @client_handler.tearDown - end - - def make_new_child - # wish: sigprocmask block SIGINT - @child_count += 1 - pid = fork do - child_handler - end - # wish: sigprocmask UNblock SIGINT - end - - def run - @server = TCPserver.open(@port) - trap('CHLD', @reaper) - trap('INT', @huntsman) - loop { - (@prefork - @child_count).times { |i| - make_new_child - } - sleep .1 - } - end -end - -#----------------------------- -#!/usr/bin/ruby - -require 'Preforker' - -class ClientHandler - def setUp - end - - def tearDown - end - - def handle_request(client) - # do stuff - end -end - -server = Preforker.new(1, 100, 3102, ClientHandler.new) -server.run - - -# @@PLEAC@@_18.2 -require 'net/ftp' - -begin - ftp = Net::FTP::new("ftp.host.com") - ftp.login(username,password) - ftp.chdir(directory) - ftp.get(filename) - ftp.put(filename) -rescue Net::FTPError - $stderr.print "FTP failed: " + $! -ensure - ftp.close() if ftp -end - -# A better solution for a local use could be : -Net::FTP::new("ftp.host.com") do |ftp| - ftp.login(username,password) - ftp.chdir(directory) - ftp.get(filename) - ftp.put(filename) -end - -# If you have only one file to get, there is a simple solution : -require 'open-uri' -open("ftp://www.ruby-lang.org/path/filename") do |fh| - # read from filehandle fh -end -#-------------------------------------------- -# to wait a defined time for the connection, -# use the timeout module -require 'timeout' -begin - timeout(30){ - ftp = Net::FTP::new("ftp.host.com") - ftp.debug_mode = true - } -rescue Net::FTPError - $stderr.puts "Couldn't connect." -rescue Timeout::Error - $stderr.puts "Timeout while connecting to server." -end - -begin - ftp.login() -rescue Net::FTPError - $stderr.print "Couldn't authentificate.\n" -end - -begin - ftp.login(username) -rescue Net::FTPError - $stderr.print "Still couldn't authenticate.\n" -end - -begin - ftp.login(username, password) -rescue Net::FTPError - $stderr.print "Couldn't authenticate, even with explicit - username and password.\n" -end - -begin - ftp.login(username, password, account) -rescue Net::FTPError - $stderr.print "No dice. It hates me.\n" -end -#----------------------------- -ftp.put(localfile, remotefile) -#----------------------------- -# Sending data from STDIN is not directly supported -# by the ftp library module. A possible way to do it is to use the -# storlines method directly to send raw commands to the ftp server. -#----------------------------- -ftp.get(remotefile, localfile) -#----------------------------- -ftp.get(remotefile) { |data| puts data } -#----------------------------- -ftp.chdir("/pub/ruby") -print "I'm in the directory ", ftp.pwd(), "\n" -#----------------------------- -ftp.mkdir("/pub/ruby/new_dir") -#----------------------------- -lines = ftp.ls("/pub/ruby/") -# => ["drwxr-xr-x 2 matz users 4096 July 17 1998 1.0", ... ] - -latest = ftp.dir("/pub/ruby/*.tgz").sort.last - -ftp.nlst("/pub/ruby") -# => ["/pub/ruby/1.0", ... ] -#----------------------------- -ftp.quit() - - -# @@PLEAC@@_18.6 -require 'net/telnet' -t = Net::Telnet::new( "Timeout" => 10, - "Prompt" => /%/, - "Host" => host ) -t.login(username, password) -files = t.cmd("ls") -t.print("top") -process_string = t.waitfor(/\d+ processes/) -t.close -#----------------------------- -/[$%#>] \z/n -#----------------------------- -# In case of an error, the telnet module throws an exception. -# For control of the behavior in case of an error, -# you just need to catch the exceptions and do your custom -# error handling. -#----------------------------- -begin - telnet.login(username, password) -rescue TimeoutError - fail "Login failed !\n" -end -#----------------------------- -telnet.waitfor('/--more--/') -#----------------------------- -telnet.waitfor(String => 'greasy smoke', Timeout => 30) - - -# @@PLEAC@@_18.7 -require 'ping' - -puts "#{host} is alive.\n" if Ping.pingecho(host); -#----------------------------- -# the ping module only use TCP ping, not ICMP even if we are root -if Ping.pingecho("kingkong.com") - puts "The giant ape lives!\n"; -else - puts "All hail mighty Gamera, friend of children!\n"; -end - - -# @@PLEAC@@_19.0 -#----------------------------- -# http://www.perl.com/CPAN/ -# http://www.perl.com:8001/bad/mojo.html -# ftp://gatekeeper.dec.com/pub/misc/netlib.tar.Z -# ftp://anonymous@myplace:gatekeeper.dec.com/pub/misc/netlib.tar.Z -# file:///etc/motd -#----------------------------- -# http://mox.perl.com/cgi-bin/program?name=Johann&born=1685 -#----------------------------- -# http://mox.perl.com/cgi-bin/program -#----------------------------- - - -# @@PLEAC@@_19.1 -#!/usr/local/bin/ruby -w -# hiweb - load CGI class to decode information given by web server - -require 'cgi' - -cgi = CGI.new('html3') - -# get a parameter from a form -value = cgi.params['PARAM_NAME'][0] - -# output a document -cgi.out { - cgi.html { - cgi.head { cgi.title { "Howdy there!" } } + - cgi.body { cgi.p { "You typed: " + cgi.tt { - CGI.escapeHTML(value) } } } - } -} - -require 'cgi' -cgi = CGI.new -who = cgi.param["Name"][0] # first param in list -phone = cgi.param["Number"][0] -picks = cgi.param["Choices"] # complete list - -print cgi.header( 'type' => 'text/plain', - 'expires' => Time.now + (3 * 24 * 60 * 60) ) - - -# @@PLEAC@@_19.3 -#!/usr/local/bin/ruby -w -# webwhoami - show web user's id -require 'etc' -print "Content-Type: text/plain\n\n" -print "Running as " + Etc.getpwuid.name + "\n" - -# % ruby -wc cgi-script # just check syntax - -# % ruby -w cgi-script # params from stdin -# (offline mode: enter name=value pairs on standard input) -# name=joe -# number=10 -# ^D - -# % ruby -w cgi-script name=joe number=10 # run with mock form input -# % ruby -d cgi-script name=joe number=10 # ditto, under the debugger - -# POST method script in csh -# % (setenv HTTP_METHOD POST; ruby -w cgi-script name=joe number=10) -# POST method script in sh -# % HTTP_METHOD=POST perl -w cgi-script name=joe number=10 - - -# @@PLEAC@@_19.4 -# ruby has several security levels, the level "1" is similar to perls taint mode. -# It can be switched on by providing the -T command line parameter -# or by setting $SAFE to 1. Setting $SAFE to 2,3 or 4 restricts possible -# harmful operations further. - -#!/usr/bin/ruby -T -$SAFE = 1 -File.open(ARGV[0], "w") -# ruby warns with: -# taint1.rb:2:in `initialize': Insecure operation - initialize (SecurityError) - -$SAFE = 1 -file = ARGV[0] -unless /^([\w.-]+)$/.match(file) - raise "filename #{file} has invalid characters" -end -file = $1 -# In ruby, even the back reference from a regular expression stays tainted. -# you need to explicitly untaint the variable: -file.untaint -File.open(file, "w") - -# Race condition exists like in perl: -unless File.exists(filename) # Wrong because of race condition - File.open(filename, "w") -end - - -# @@PLEAC@@_19.8 -url = "http://pleac.sourceforge.net/pleac_ruby/" -print "Location: #{url}\r\n\r\n" -exit - -#!/usr/bin/ruby -require 'cgi' - -cgi = CGI.new -oreo = CGI::Cookie.new('name' => 'filling', - 'value' => 'vanilla creme', - 'expires' => Time.now + (3 * 30 * 24 * 60 * 60), - 'domain' => '.pleac.sourceforge.net') - -whither = 'http://pleac.sourceforge.net/pleac_ruby/cgiprogramming.html' - -cgi.out('cookie' => oreo, - 'Location' => whither){""} - -#!/usr/bin/ruby -# os_snipe - redirect to a Jargon File entry about current OS -dir = 'http://www.elsewhere.org/jargon/html/entry' - -agent = ENV['HTTP_USER_AGENT'] - -page = case - when agent =~ /Mac/: 'Macintrash.html' - when agent =~ /Win(dows )?NT/: 'evil_and_rude.html' - when agent =~ /Win|MSIE|WebTV/: 'Microsloth_Windows.html' - when agent =~ /Linux/: 'Linux.html' - when agent =~ /HP-UX/: 'HP-SUX.html' - when agent =~ /SunOS/: 'ScumOS.html' - else 'Appendix_B.html' -end - -print "Location: #{dir}/#{page}\n\n" - -require 'cgi' -cgi = CGI.new -cgi.out('status' => '204 No response'){""} -# this produces: -# Status: 204 No response -# Content-Type: text/html -# Content-Length: 0 -# - - -# @@PLEAC@@_19.10 -preference_value = cgi.cookies["preference name"][0] - -packed_cookie = CGI::Cookie.new("name" => "preference name", - "value" => "whatever you'd like", - "expires" => Time.local(Time.now.year + 2, - Time.now.mon, Time.now.day, Time.now.hour, Time.now.min, Time.now.sec) ) - -cgi.header("cookie" => [packed_cookie]) - -#!/usr/local/bin/ruby -w -# ic_cookies - sample CGI script that uses a cookie -require 'cgi' - -cgi = CGI.new('html3') - -cookname = "favorite ice cream" -favorite = cgi.params["flavor"][0] -tasty = cgi.cookies[cookname][0] || 'mint' - -unless favorite - cgi.out { - cgi.html { - cgi.head { cgi.title { "Ice Cookies" } } + - cgi.body { - cgi.h1 { "Hello Ice Cream" } + - cgi.hr + - cgi.form { - cgi.p { "Please select a flavor: " + - cgi.text_field("flavor", tasty ) } - } + - cgi.hr - } - } - } -else - cookie = CGI::Cookie.new( "name" => cookname, - "value" => favorite, - "expires" => Time.local(Time.now.year + 2, -Time.now.mon, Time.now.day, Time.now.hour, Time.now.min, Time.now.sec) ) - cgi.out("cookie" => [cookie]) { - cgi.html { - cgi.head { cgi.title { "Ice Cookies" } } + - cgi.body { - cgi.h1 { "Hello Ice Cream" } + - cgi.p { "You chose as your favorite flavor `#{favorite}'." } - } - } - } -end - - -# @@PLEAC@@_20.9 -def templatefile(filename, fillings) - aFile = File.new(filename, "r") - text = aFile.read() - aFile.close() - pattern = Regexp.new('%%(.*?)%%') - text.gsub!(pattern) { - fillings[$1] || "" - } - text -end - -fields = { - 'username' => whats_his_name, - 'count' => login_count, - 'total' => minutes_used -} -puts templatefile('simple.template', fields) - -# @@INCOMPLETE@@ -# An example using databases is missing - - diff --git a/test/scanners/ruby/quotes.expected.raydebug b/test/scanners/ruby/quotes.expected.raydebug deleted file mode 100644 index cbccab7..0000000 --- a/test/scanners/ruby/quotes.expected.raydebug +++ /dev/null @@ -1,3 +0,0 @@ -ident(puts) stringoperator(*)integer(5)inline_delimiter(})>delimiter(})>operator(*)integer(7)inline_delimiter(})>content(, immer wieder)char(\\n)delimiter(})>operator(*)integer(5) - -ident(print) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) diff --git a/test/scanners/ruby/quotes.in.rb b/test/scanners/ruby/quotes.in.rb deleted file mode 100644 index 8c38e1f..0000000 --- a/test/scanners/ruby/quotes.in.rb +++ /dev/null @@ -1,3 +0,0 @@ -puts %}#{%}b#{%}r}*5}}*7}, immer wieder\n}*5 - -print "test\n\\\\".gsub(/[\n\\]/, '\\\\\&') diff --git a/test/scanners/ruby/rails.expected.raydebug b/test/scanners/ruby/rails.expected.raydebug deleted file mode 100644 index 17cd1e7..0000000 --- a/test/scanners/ruby/rails.expected.raydebug +++ /dev/null @@ -1,74259 +0,0 @@ -ident(require) string -ident(require) string -ident(require) string - -ident(include) constant(Config) - -comment(# this was adapted from rdoc's install.rb by way of Log4r) - -global_variable($sitedir) operator(=) constant(CONFIG)operator([)stringoperator(]) -reserved(unless) global_variable($sitedir) - ident(version) operator(=) constant(CONFIG)operator([)stringoperator(]) operator(+) string operator(+) constant(CONFIG)operator([)stringoperator(]) - global_variable($libdir) operator(=) constant(File)operator(.)ident(join)operator(()constant(CONFIG)operator([)stringoperator(])operator(,) stringoperator(,) ident(version)operator(\)) - global_variable($sitedir) operator(=) global_variable($:)operator(.)ident(find) operator({)operator(|)ident(x)operator(|) ident(x) operator(=)operator(~) regexp operator(}) - reserved(if) operator(!)global_variable($sitedir) - global_variable($sitedir) operator(=) constant(File)operator(.)ident(join)operator(()global_variable($libdir)operator(,) stringoperator(\)) - reserved(elsif) global_variable($sitedir) operator(!)operator(~) constant(Regexp)operator(.)ident(quote)operator(()ident(version)operator(\)) - global_variable($sitedir) operator(=) constant(File)operator(.)ident(join)operator(()global_variable($sitedir)operator(,) ident(version)operator(\)) - reserved(end) -reserved(end) - -comment(# the acual gruntwork) -constant(Dir)operator(.)ident(chdir)operator(()stringoperator(\)) - -constant(Find)operator(.)ident(find)operator(()stringoperator(,) stringoperator(\)) operator({) operator(|)ident(f)operator(|) - reserved(if) ident(f)operator([)integer(-3)operator(..)integer(-1)operator(]) operator(==) string - constant(File)operator(::)ident(install)operator(()ident(f)operator(,) constant(File)operator(.)ident(join)operator(()global_variable($sitedir)operator(,) operator(*)ident(f)operator(.)ident(split)operator(()regexpoperator(\))operator(\))operator(,) integer(0644)operator(,) pre_constant(true)operator(\)) - reserved(else) - constant(File)operator(::)ident(makedirs)operator(()constant(File)operator(.)ident(join)operator(()global_variable($sitedir)operator(,) operator(*)ident(f)operator(.)ident(split)operator(()regexpoperator(\))operator(\))operator(\)) - reserved(end) -operator(}) -reserved(module) class(ActionMailer) - reserved(module) class(AdvAttrAccessor) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - reserved(module) class(ClassMethods) comment(#:nodoc:) - reserved(def) method(adv_attr_accessor)operator(()operator(*)ident(names)operator(\)) - ident(names)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - ident(ivar) operator(=) stringdelimiter(")> - - ident(define_method)operator(()stringcontent(=)delimiter(")>operator(\)) reserved(do) operator(|)ident(value)operator(|) - ident(instance_variable_set)operator(()ident(ivar)operator(,) ident(value)operator(\)) - reserved(end) - - ident(define_method)operator(()ident(name)operator(\)) reserved(do) operator(|*)ident(parameters)operator(|) - ident(raise) constant(ArgumentError)operator(,) string reserved(unless) ident(parameters)operator(.)ident(length) operator(<=) integer(1) - reserved(if) ident(parameters)operator(.)ident(empty?) - reserved(if) ident(instance_variables)operator(.)ident(include?)operator(()ident(ivar)operator(\)) - ident(instance_variable_get)operator(()ident(ivar)operator(\)) - reserved(end) - reserved(else) - ident(instance_variable_set)operator(()ident(ivar)operator(,) ident(parameters)operator(.)ident(first)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActionMailer) comment(#:nodoc:) - comment(# ActionMailer allows you to send email from your application using a mailer model and views.) - comment(#) - comment(# = Mailer Models) - comment(# To use ActionMailer, you need to create a mailer model.) - comment(# ) - comment(# $ script/generate mailer Notifier) - comment(#) - comment(# The generated model inherits from ActionMailer::Base. Emails are defined by creating methods within the model which are then ) - comment(# used to set variables to be used in the mail template, to change options on the mail, or ) - comment(# to add attachments.) - comment(#) - comment(# Examples:) - comment(#) - comment(# class Notifier < ActionMailer::Base) - comment(# def signup_notification(recipient\)) - comment(# recipients recipient.email_address_with_name) - comment(# from "system@example.com") - comment(# subject "New account information") - comment(# body "account" => recipient) - comment(# end) - comment(# end) - comment(#) - comment(# Mailer methods have the following configuration methods available.) - comment(#) - comment(# * recipients - Takes one or more email addresses. These addresses are where your email will be delivered to. Sets the To: header.) - comment(# * subject - The subject of your email. Sets the Subject: header.) - comment(# * from - Who the email you are sending is from. Sets the From: header.) - comment(# * cc - Takes one or more email addresses. These addresses will receive a carbon copy of your email. Sets the Cc: header.) - comment(# * bcc - Takes one or more email address. These addresses will receive a blind carbon copy of your email. Sets the Bcc header.) - comment(# * sent_on - The date on which the message was sent. If not set, the header wil be set by the delivery agent.) - comment(# * content_type - Specify the content type of the message. Defaults to text/plain.) - comment(# * headers - Specify additional headers to be set for the message, e.g. headers 'X-Mail-Count' => 107370.) - comment(#) - comment(# The body method has special behavior. It takes a hash which generates an instance variable) - comment(# named after each key in the hash containing the value that that key points to.) - comment(#) - comment(# So, for example, body "account" => recipient would result) - comment(# in an instance variable @account with the value of recipient being accessible in the ) - comment(# view.) - comment(#) - comment(# = Mailer Views) - comment(# Like ActionController, each mailer class has a corresponding view directory) - comment(# in which each method of the class looks for a template with its name.) - comment(# To define a template to be used with a mailing, create an .rhtml file with the same name as the method) - comment(# in your mailer model. For example, in the mailer defined above, the template at ) - comment(# app/views/notifier/signup_notification.rhtml would be used to generate the email.) - comment(#) - comment(# Variables defined in the model are accessible as instance variables in the view.) - comment(#) - comment(# Emails by default are sent in plain text, so a sample view for our model example might look like this:) - comment(#) - comment(# Hi <%= @account.name %>,) - comment(# Thanks for joining our service! Please check back often.) - comment(#) - comment(# = Sending Mail) - comment(# Once a mailer action and template are defined, you can deliver your message or create it and save it ) - comment(# for delivery later:) - comment(#) - comment(# Notifier.deliver_signup_notification(david\) # sends the email) - comment(# mail = Notifier.create_signup_notification(david\) # => a tmail object) - comment(# Notifier.deliver(mail\)) - comment(# ) - comment(# You never instantiate your mailer class. Rather, your delivery instance) - comment(# methods are automatically wrapped in class methods that start with the word) - comment(# deliver_ followed by the name of the mailer method that you would) - comment(# like to deliver. The signup_notification method defined above is) - comment(# delivered by invoking Notifier.deliver_signup_notification.) - comment(#) - comment(# = HTML Email) - comment(# To send mail as HTML, make sure your view (the .rhtml file\) generates HTML and) - comment(# set the content type to html.) - comment(#) - comment(# class MyMailer < ActionMailer::Base) - comment(# def signup_notification(recipient\)) - comment(# recipients recipient.email_address_with_name) - comment(# subject "New account information") - comment(# body "account" => recipient) - comment(# from "system@example.com") - comment(# content_type "text/html" # Here's where the magic happens) - comment(# end) - comment(# end ) - comment(#) - comment(# = Multipart Email) - comment(# You can explicitly specify multipart messages:) - comment(#) - comment(# class ApplicationMailer < ActionMailer::Base) - comment(# def signup_notification(recipient\)) - comment(# recipients recipient.email_address_with_name) - comment(# subject "New account information") - comment(# from "system@example.com") - comment(#) - comment(# part :content_type => "text/html",) - comment(# :body => render_message("signup-as-html", :account => recipient\)) - comment(#) - comment(# part "text/plain" do |p|) - comment(# p.body = render_message("signup-as-plain", :account => recipient\)) - comment(# p.transfer_encoding = "base64") - comment(# end) - comment(# end) - comment(# end) - comment(# ) - comment(# Multipart messages can also be used implicitly because ActionMailer will automatically) - comment(# detect and use multipart templates, where each template is named after the name of the action, followed) - comment(# by the content type. Each such detected template will be added as separate part to the message.) - comment(# ) - comment(# For example, if the following templates existed:) - comment(# * signup_notification.text.plain.rhtml) - comment(# * signup_notification.text.html.rhtml) - comment(# * signup_notification.text.xml.rxml) - comment(# * signup_notification.text.x-yaml.rhtml) - comment(# ) - comment(# Each would be rendered and added as a separate part to the message,) - comment(# with the corresponding content type. The same body hash is passed to) - comment(# each template.) - comment(#) - comment(# = Attachments) - comment(# Attachments can be added by using the +attachment+ method.) - comment(#) - comment(# Example:) - comment(#) - comment(# class ApplicationMailer < ActionMailer::Base) - comment(# # attachments) - comment(# def signup_notification(recipient\)) - comment(# recipients recipient.email_address_with_name) - comment(# subject "New account information") - comment(# from "system@example.com") - comment(#) - comment(# attachment :content_type => "image/jpeg",) - comment(# :body => File.read("an-image.jpg"\)) - comment(#) - comment(# attachment "application/pdf" do |a|) - comment(# a.body = generate_your_pdf_here(\)) - comment(# end) - comment(# end) - comment(# end ) - comment(#) - comment(# = Configuration options) - comment(#) - comment(# These options are specified on the class level, like ActionMailer::Base.template_root = "/my/templates") - comment(#) - comment(# * template_root - template root determines the base from which template references will be made.) - comment(#) - comment(# * logger - the logger is used for generating information on the mailing run if available.) - comment(# Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers.) - comment(#) - comment(# * server_settings - Allows detailed configuration of the server:) - comment(# * :address Allows you to use a remote mail server. Just change it from its default "localhost" setting.) - comment(# * :port On the off chance that your mail server doesn't run on port 25, you can change it.) - comment(# * :domain If you need to specify a HELO domain, you can do it here.) - comment(# * :user_name If your mail server requires authentication, set the username in this setting.) - comment(# * :password If your mail server requires authentication, set the password in this setting.) - comment(# * :authentication If your mail server requires authentication, you need to specify the authentication type here. ) - comment(# This is a symbol and one of :plain, :login, :cram_md5) - comment(#) - comment(# * raise_delivery_errors - whether or not errors should be raised if the email fails to be delivered.) - comment(#) - comment(# * delivery_method - Defines a delivery method. Possible values are :smtp (default\), :sendmail, and :test.) - comment(# Sendmail is assumed to be present at "/usr/sbin/sendmail".) - comment(#) - comment(# * perform_deliveries - Determines whether deliver_* methods are actually carried out. By default they are,) - comment(# but this can be turned off to help functional testing.) - comment(#) - comment(# * deliveries - Keeps an array of all the emails sent out through the Action Mailer with delivery_method :test. Most useful) - comment(# for unit and functional testing.) - comment(#) - comment(# * default_charset - The default charset used for the body and to encode the subject. Defaults to UTF-8. You can also ) - comment(# pick a different charset from inside a method with @charset.) - comment(# * default_content_type - The default content type used for the main part of the message. Defaults to "text/plain". You) - comment(# can also pick a different content type from inside a method with @content_type. ) - comment(# * default_mime_version - The default mime version used for the message. Defaults to nil. You) - comment(# can also pick a different value from inside a method with @mime_version. When multipart messages are in) - comment(# use, @mime_version will be set to "1.0" if it is not set inside a method.) - comment(# * default_implicit_parts_order - When a message is built implicitly (i.e. multiple parts are assembled from templates) - comment(# which specify the content type in their filenames\) this variable controls how the parts are ordered. Defaults to) - comment(# ["text/html", "text/enriched", "text/plain"]. Items that appear first in the array have higher priority in the mail client) - comment(# and appear last in the mime encoded message. You can also pick a different order from inside a method with) - comment(# @implicit_parts_order.) - reserved(class) class(Base) - ident(include) constant(AdvAttrAccessor)operator(,) constant(PartContainer) - - comment(# Action Mailer subclasses should be reloaded by the dispatcher in Rails) - comment(# when Dependencies.mechanism = :load.) - ident(include) constant(Reloadable)operator(::)constant(Subclasses) - - ident(private_class_method) symbol(:new) comment(#:nodoc:) - - ident(class_inheritable_accessor) symbol(:template_root) - ident(cattr_accessor) symbol(:logger) - - class_variable(@@server_settings) operator(=) operator({) - symbol(:address) operator(=)operator(>) stringoperator(,) - symbol(:port) operator(=)operator(>) integer(25)operator(,) - symbol(:domain) operator(=)operator(>) stringoperator(,) - symbol(:user_name) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:password) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:authentication) operator(=)operator(>) pre_constant(nil) - operator(}) - ident(cattr_accessor) symbol(:server_settings) - - class_variable(@@raise_delivery_errors) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:raise_delivery_errors) - - class_variable(@@delivery_method) operator(=) symbol(:smtp) - ident(cattr_accessor) symbol(:delivery_method) - - class_variable(@@perform_deliveries) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:perform_deliveries) - - class_variable(@@deliveries) operator(=) operator([)operator(]) - ident(cattr_accessor) symbol(:deliveries) - - class_variable(@@default_charset) operator(=) string - ident(cattr_accessor) symbol(:default_charset) - - class_variable(@@default_content_type) operator(=) string - ident(cattr_accessor) symbol(:default_content_type) - - class_variable(@@default_mime_version) operator(=) pre_constant(nil) - ident(cattr_accessor) symbol(:default_mime_version) - - class_variable(@@default_implicit_parts_order) operator(=) operator([) stringoperator(,) stringoperator(,) string operator(]) - ident(cattr_accessor) symbol(:default_implicit_parts_order) - - comment(# Specify the BCC addresses for the message) - ident(adv_attr_accessor) symbol(:bcc) - - comment(# Define the body of the message. This is either a Hash (in which case it) - comment(# specifies the variables to pass to the template when it is rendered\),) - comment(# or a string, in which case it specifies the actual text of the message.) - ident(adv_attr_accessor) symbol(:body) - - comment(# Specify the CC addresses for the message.) - ident(adv_attr_accessor) symbol(:cc) - - comment(# Specify the charset to use for the message. This defaults to the) - comment(# +default_charset+ specified for ActionMailer::Base.) - ident(adv_attr_accessor) symbol(:charset) - - comment(# Specify the content type for the message. This defaults to text/plain) - comment(# in most cases, but can be automatically set in some situations.) - ident(adv_attr_accessor) symbol(:content_type) - - comment(# Specify the from address for the message.) - ident(adv_attr_accessor) symbol(:from) - - comment(# Specify additional headers to be added to the message.) - ident(adv_attr_accessor) symbol(:headers) - - comment(# Specify the order in which parts should be sorted, based on content-type.) - comment(# This defaults to the value for the +default_implicit_parts_order+.) - ident(adv_attr_accessor) symbol(:implicit_parts_order) - - comment(# Override the mailer name, which defaults to an inflected version of the) - comment(# mailer's class name. If you want to use a template in a non-standard) - comment(# location, you can use this to specify that location.) - ident(adv_attr_accessor) symbol(:mailer_name) - - comment(# Defaults to "1.0", but may be explicitly given if needed.) - ident(adv_attr_accessor) symbol(:mime_version) - - comment(# The recipient addresses for the message, either as a string (for a single) - comment(# address\) or an array (for multiple addresses\).) - ident(adv_attr_accessor) symbol(:recipients) - - comment(# The date on which the message was sent. If not set (the default\), the) - comment(# header will be set by the delivery agent.) - ident(adv_attr_accessor) symbol(:sent_on) - - comment(# Specify the subject of the message.) - ident(adv_attr_accessor) symbol(:subject) - - comment(# Specify the template name to use for current message. This is the "base") - comment(# template name, without the extension or directory, and may be used to) - comment(# have multiple mailer methods share the same template.) - ident(adv_attr_accessor) symbol(:template) - - comment(# The mail object instance referenced by this mailer.) - ident(attr_reader) symbol(:mail) - - reserved(class) operator(<<) class(self) - reserved(def) method(method_missing)operator(()ident(method_symbol)operator(,) operator(*)ident(parameters)operator(\))comment(#:nodoc:) - reserved(case) ident(method_symbol)operator(.)ident(id2name) - reserved(when) regexp reserved(then) ident(new)operator(()global_variable($1)operator(,) operator(*)ident(parameters)operator(\))operator(.)ident(mail) - reserved(when) regexp reserved(then) ident(new)operator(()global_variable($1)operator(,) operator(*)ident(parameters)operator(\))operator(.)ident(deliver!) - reserved(when) string reserved(then) pre_constant(nil) - reserved(else) reserved(super) - reserved(end) - reserved(end) - - comment(# Receives a raw email, parses it into an email object, decodes it,) - comment(# instantiates a new mailer, and passes the email object to the mailer) - comment(# object's #receive method. If you want your mailer to be able to) - comment(# process incoming messages, you'll need to implement a #receive) - comment(# method that accepts the email object as a parameter:) - comment(#) - comment(# class MyMailer < ActionMailer::Base) - comment(# def receive(mail\)) - comment(# ...) - comment(# end) - comment(# end) - reserved(def) method(receive)operator(()ident(raw_email)operator(\)) - ident(logger)operator(.)ident(info) stringdelimiter(")> reserved(unless) ident(logger)operator(.)ident(nil?) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(raw_email)operator(\)) - ident(mail)operator(.)ident(base64_decode) - ident(new)operator(.)ident(receive)operator(()ident(mail)operator(\)) - reserved(end) - - comment(# Deliver the given mail object directly. This can be used to deliver) - comment(# a preconstructed mail object, like:) - comment(#) - comment(# email = MyMailer.create_some_mail(parameters\)) - comment(# email.set_some_obscure_header "frobnicate") - comment(# MyMailer.deliver(email\)) - reserved(def) method(deliver)operator(()ident(mail)operator(\)) - ident(new)operator(.)ident(deliver!)operator(()ident(mail)operator(\)) - reserved(end) - reserved(end) - - comment(# Instantiate a new mailer object. If +method_name+ is not +nil+, the mailer) - comment(# will be initialized according to the named method. If not, the mailer will) - comment(# remain uninitialized (useful when you only need to invoke the "receive") - comment(# method, for instance\).) - reserved(def) method(initialize)operator(()ident(method_name)operator(=)pre_constant(nil)operator(,) operator(*)ident(parameters)operator(\)) comment(#:nodoc:) - ident(create!)operator(()ident(method_name)operator(,) operator(*)ident(parameters)operator(\)) reserved(if) ident(method_name) - reserved(end) - - comment(# Initialize the mailer via the given +method_name+. The body will be) - comment(# rendered and a new TMail::Mail object created.) - reserved(def) method(create!)operator(()ident(method_name)operator(,) operator(*)ident(parameters)operator(\)) comment(#:nodoc:) - ident(initialize_defaults)operator(()ident(method_name)operator(\)) - ident(send)operator(()ident(method_name)operator(,) operator(*)ident(parameters)operator(\)) - - comment(# If an explicit, textual body has not been set, we check assumptions.) - reserved(unless) constant(String) operator(===) instance_variable(@body) - comment(# First, we look to see if there are any likely templates that match,) - comment(# which include the content-type in their file name (i.e.,) - comment(# "the_template_file.text.html.rhtml", etc.\). Only do this if parts) - comment(# have not already been specified manually.) - reserved(if) instance_variable(@parts)operator(.)ident(empty?) - ident(templates) operator(=) constant(Dir)operator(.)ident(glob)operator(()stringcontent(/)inlinecontent(.*)delimiter(")>operator(\)) - ident(templates)operator(.)ident(each) reserved(do) operator(|)ident(path)operator(|) - comment(# TODO: don't hardcode rhtml|rxml) - ident(basename) operator(=) constant(File)operator(.)ident(basename)operator(()ident(path)operator(\)) - reserved(next) reserved(unless) ident(md) operator(=) regexpoperator(.)ident(match)operator(()ident(basename)operator(\)) - ident(template_name) operator(=) ident(basename) - ident(content_type) operator(=) ident(md)operator(.)ident(captures)operator([)integer(1)operator(])operator(.)ident(gsub)operator(()stringoperator(,) stringoperator(\)) - instance_variable(@parts) operator(<<) constant(Part)operator(.)ident(new)operator(()symbol(:content_type) operator(=)operator(>) ident(content_type)operator(,) - symbol(:disposition) operator(=)operator(>) stringoperator(,) symbol(:charset) operator(=)operator(>) ident(charset)operator(,) - symbol(:body) operator(=)operator(>) ident(render_message)operator(()ident(template_name)operator(,) instance_variable(@body)operator(\))operator(\)) - reserved(end) - reserved(unless) instance_variable(@parts)operator(.)ident(empty?) - instance_variable(@content_type) operator(=) string - instance_variable(@parts) operator(=) ident(sort_parts)operator(()instance_variable(@parts)operator(,) instance_variable(@implicit_parts_order)operator(\)) - reserved(end) - reserved(end) - - comment(# Then, if there were such templates, we check to see if we ought to) - comment(# also render a "normal" template (without the content type\). If a) - comment(# normal template exists (or if there were no implicit parts\) we render) - comment(# it.) - ident(template_exists) operator(=) instance_variable(@parts)operator(.)ident(empty?) - ident(template_exists) operator(||=) constant(Dir)operator(.)ident(glob)operator(()stringcontent(/)inlinecontent(.*)delimiter(")>operator(\))operator(.)ident(any?) operator({) operator(|)ident(i)operator(|) constant(File)operator(.)ident(basename)operator(()ident(i)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(length) operator(==) integer(2) operator(}) - instance_variable(@body) operator(=) ident(render_message)operator(()instance_variable(@template)operator(,) instance_variable(@body)operator(\)) reserved(if) ident(template_exists) - - comment(# Finally, if there are other message parts and a textual body exists,) - comment(# we shift it onto the front of the parts and set the body to nil (so) - comment(# that create_mail doesn't try to render it in addition to the parts\).) - reserved(if) operator(!)instance_variable(@parts)operator(.)ident(empty?) operator(&&) constant(String) operator(===) instance_variable(@body) - instance_variable(@parts)operator(.)ident(unshift) constant(Part)operator(.)ident(new)operator(()symbol(:charset) operator(=)operator(>) ident(charset)operator(,) symbol(:body) operator(=)operator(>) instance_variable(@body)operator(\)) - instance_variable(@body) operator(=) pre_constant(nil) - reserved(end) - reserved(end) - - comment(# If this is a multipart e-mail add the mime_version if it is not) - comment(# already set.) - instance_variable(@mime_version) operator(||=) string reserved(if) operator(!)instance_variable(@parts)operator(.)ident(empty?) - - comment(# build the mail object itself) - instance_variable(@mail) operator(=) ident(create_mail) - reserved(end) - - comment(# Delivers a TMail::Mail object. By default, it delivers the cached mail) - comment(# object (from the #create! method\). If no cached mail object exists, and) - comment(# no alternate has been given as the parameter, this will fail.) - reserved(def) method(deliver!)operator(()ident(mail) operator(=) instance_variable(@mail)operator(\)) - ident(raise) string reserved(unless) ident(mail) - ident(logger)operator(.)ident(info) stringdelimiter(")> reserved(unless) ident(logger)operator(.)ident(nil?) - - reserved(begin) - ident(send)operator(()stringdelimiter(")>operator(,) ident(mail)operator(\)) reserved(if) ident(perform_deliveries) - reserved(rescue) constant(Object) operator(=)operator(>) ident(e) - ident(raise) ident(e) reserved(if) ident(raise_delivery_errors) - reserved(end) - - reserved(return) ident(mail) - reserved(end) - - ident(private) - comment(# Set up the default values for the various instance variables of this) - comment(# mailer. Subclasses may override this method to provide different) - comment(# defaults.) - reserved(def) method(initialize_defaults)operator(()ident(method_name)operator(\)) - instance_variable(@charset) operator(||=) class_variable(@@default_charset)operator(.)ident(dup) - instance_variable(@content_type) operator(||=) class_variable(@@default_content_type)operator(.)ident(dup) - instance_variable(@implicit_parts_order) operator(||=) class_variable(@@default_implicit_parts_order)operator(.)ident(dup) - instance_variable(@template) operator(||=) ident(method_name) - instance_variable(@mailer_name) operator(||=) constant(Inflector)operator(.)ident(underscore)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(name)operator(\)) - instance_variable(@parts) operator(||=) operator([)operator(]) - instance_variable(@headers) operator(||=) operator({)operator(}) - instance_variable(@body) operator(||=) operator({)operator(}) - instance_variable(@mime_version) operator(=) class_variable(@@default_mime_version)operator(.)ident(dup) reserved(if) class_variable(@@default_mime_version) - reserved(end) - - reserved(def) method(render_message)operator(()ident(method_name)operator(,) ident(body)operator(\)) - ident(render) symbol(:file) operator(=)operator(>) ident(method_name)operator(,) symbol(:body) operator(=)operator(>) ident(body) - reserved(end) - - reserved(def) method(render)operator(()ident(opts)operator(\)) - ident(body) operator(=) ident(opts)operator(.)ident(delete)operator(()symbol(:body)operator(\)) - ident(initialize_template_class)operator(()ident(body)operator(\))operator(.)ident(render)operator(()ident(opts)operator(\)) - reserved(end) - - reserved(def) method(template_path) - stringcontent(/)inlinedelimiter(")> - reserved(end) - - reserved(def) method(initialize_template_class)operator(()ident(assigns)operator(\)) - constant(ActionView)operator(::)constant(Base)operator(.)ident(new)operator(()ident(template_path)operator(,) ident(assigns)operator(,) pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(sort_parts)operator(()ident(parts)operator(,) ident(order) operator(=) operator([)operator(])operator(\)) - ident(order) operator(=) ident(order)operator(.)ident(collect) operator({) operator(|)ident(s)operator(|) ident(s)operator(.)ident(downcase) operator(}) - - ident(parts) operator(=) ident(parts)operator(.)ident(sort) reserved(do) operator(|)ident(a)operator(,) ident(b)operator(|) - ident(a_ct) operator(=) ident(a)operator(.)ident(content_type)operator(.)ident(downcase) - ident(b_ct) operator(=) ident(b)operator(.)ident(content_type)operator(.)ident(downcase) - - ident(a_in) operator(=) ident(order)operator(.)ident(include?) ident(a_ct) - ident(b_in) operator(=) ident(order)operator(.)ident(include?) ident(b_ct) - - ident(s) operator(=) reserved(case) - reserved(when) ident(a_in) operator(&&) ident(b_in) - ident(order)operator(.)ident(index)operator(()ident(a_ct)operator(\)) operator(<=>) ident(order)operator(.)ident(index)operator(()ident(b_ct)operator(\)) - reserved(when) ident(a_in) - integer(-1) - reserved(when) ident(b_in) - integer(1) - reserved(else) - ident(a_ct) operator(<=>) ident(b_ct) - reserved(end) - - comment(# reverse the ordering because parts that come last are displayed) - comment(# first in mail clients) - operator(()ident(s) operator(*) integer(-1)operator(\)) - reserved(end) - - ident(parts) - reserved(end) - - reserved(def) method(create_mail) - ident(m) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(new) - - ident(m)operator(.)ident(subject)operator(,) operator(=) ident(quote_any_if_necessary)operator(()ident(charset)operator(,) ident(subject)operator(\)) - ident(m)operator(.)ident(to)operator(,) ident(m)operator(.)ident(from) operator(=) ident(quote_any_address_if_necessary)operator(()ident(charset)operator(,) ident(recipients)operator(,) ident(from)operator(\)) - ident(m)operator(.)ident(bcc) operator(=) ident(quote_address_if_necessary)operator(()ident(bcc)operator(,) ident(charset)operator(\)) reserved(unless) ident(bcc)operator(.)ident(nil?) - ident(m)operator(.)ident(cc) operator(=) ident(quote_address_if_necessary)operator(()ident(cc)operator(,) ident(charset)operator(\)) reserved(unless) ident(cc)operator(.)ident(nil?) - - ident(m)operator(.)ident(mime_version) operator(=) ident(mime_version) reserved(unless) ident(mime_version)operator(.)ident(nil?) - ident(m)operator(.)ident(date) operator(=) ident(sent_on)operator(.)ident(to_time) reserved(rescue) ident(sent_on) reserved(if) ident(sent_on) - ident(headers)operator(.)ident(each) operator({) operator(|)ident(k)operator(,) ident(v)operator(|) ident(m)operator([)ident(k)operator(]) operator(=) ident(v) operator(}) - - ident(real_content_type)operator(,) ident(ctype_attrs) operator(=) ident(parse_content_type) - - reserved(if) instance_variable(@parts)operator(.)ident(empty?) - ident(m)operator(.)ident(set_content_type)operator(()ident(real_content_type)operator(,) pre_constant(nil)operator(,) ident(ctype_attrs)operator(\)) - ident(m)operator(.)ident(body) operator(=) constant(Utils)operator(.)ident(normalize_new_lines)operator(()ident(body)operator(\)) - reserved(else) - reserved(if) constant(String) operator(===) ident(body) - ident(part) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(new) - ident(part)operator(.)ident(body) operator(=) constant(Utils)operator(.)ident(normalize_new_lines)operator(()ident(body)operator(\)) - ident(part)operator(.)ident(set_content_type)operator(()ident(real_content_type)operator(,) pre_constant(nil)operator(,) ident(ctype_attrs)operator(\)) - ident(part)operator(.)ident(set_content_disposition) string - ident(m)operator(.)ident(parts) operator(<<) ident(part) - reserved(end) - - instance_variable(@parts)operator(.)ident(each) reserved(do) operator(|)ident(p)operator(|) - ident(part) operator(=) operator(()constant(TMail)operator(::)constant(Mail) operator(===) ident(p) operator(?) ident(p) operator(:) ident(p)operator(.)ident(to_mail)operator(()pre_constant(self)operator(\))operator(\)) - ident(m)operator(.)ident(parts) operator(<<) ident(part) - reserved(end) - - reserved(if) ident(real_content_type) operator(=)operator(~) regexp - ident(ctype_attrs)operator(.)ident(delete) string - ident(m)operator(.)ident(set_content_type)operator(()ident(real_content_type)operator(,) pre_constant(nil)operator(,) ident(ctype_attrs)operator(\)) - reserved(end) - reserved(end) - - instance_variable(@mail) operator(=) ident(m) - reserved(end) - - reserved(def) method(perform_delivery_smtp)operator(()ident(mail)operator(\)) - ident(destinations) operator(=) ident(mail)operator(.)ident(destinations) - ident(mail)operator(.)ident(ready_to_send) - - constant(Net)operator(::)constant(SMTP)operator(.)ident(start)operator(()ident(server_settings)operator([)symbol(:address)operator(])operator(,) ident(server_settings)operator([)symbol(:port)operator(])operator(,) ident(server_settings)operator([)symbol(:domain)operator(])operator(,) - ident(server_settings)operator([)symbol(:user_name)operator(])operator(,) ident(server_settings)operator([)symbol(:password)operator(])operator(,) ident(server_settings)operator([)symbol(:authentication)operator(])operator(\)) reserved(do) operator(|)ident(smtp)operator(|) - ident(smtp)operator(.)ident(sendmail)operator(()ident(mail)operator(.)ident(encoded)operator(,) ident(mail)operator(.)ident(from)operator(,) ident(destinations)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(perform_delivery_sendmail)operator(()ident(mail)operator(\)) - constant(IO)operator(.)ident(popen)operator(()stringoperator(,)stringoperator(\)) reserved(do) operator(|)ident(sm)operator(|) - ident(sm)operator(.)ident(print)operator(()ident(mail)operator(.)ident(encoded)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(\)) - ident(sm)operator(.)ident(flush) - reserved(end) - reserved(end) - - reserved(def) method(perform_delivery_test)operator(()ident(mail)operator(\)) - ident(deliveries) operator(<<) ident(mail) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionMailer) - reserved(module) class(Helpers) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - - comment(# Initialize the base module to aggregate its helpers.) - ident(base)operator(.)ident(class_inheritable_accessor) symbol(:master_helper_module) - ident(base)operator(.)ident(master_helper_module) operator(=) constant(Module)operator(.)ident(new) - - comment(# Extend base with class methods to declare helpers.) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - - ident(base)operator(.)ident(class_eval) reserved(do) - comment(# Wrap inherited to create a new master helper module for subclasses.) - reserved(class) operator(<<) class(self) - ident(alias_method) symbol(:inherited_without_helper)operator(,) symbol(:inherited) - ident(alias_method) symbol(:inherited)operator(,) symbol(:inherited_with_helper) - reserved(end) - - comment(# Wrap initialize_template_class to extend new template class) - comment(# instances with the master helper module.) - ident(alias_method) symbol(:initialize_template_class_without_helper)operator(,) symbol(:initialize_template_class) - ident(alias_method) symbol(:initialize_template_class)operator(,) symbol(:initialize_template_class_with_helper) - reserved(end) - reserved(end) - - reserved(module) class(ClassMethods) - comment(# Makes all the (instance\) methods in the helper module available to templates rendered through this controller.) - comment(# See ActionView::Helpers (link:classes/ActionView/Helpers.html\) for more about making your own helper modules ) - comment(# available to the templates.) - reserved(def) method(add_template_helper)operator(()ident(helper_module)operator(\)) comment(#:nodoc:) - ident(master_helper_module)operator(.)ident(module_eval) stringdelimiter(")> - reserved(end) - - comment(# Declare a helper:) - comment(# helper :foo) - comment(# requires 'foo_helper' and includes FooHelper in the template class.) - comment(# helper FooHelper) - comment(# includes FooHelper in the template class.) - comment(# helper { def foo(\) "#{bar} is the very best" end }) - comment(# evaluates the block in the template class, adding method #foo.) - comment(# helper(:three, BlindHelper\) { def mice(\) 'mice' end }) - comment(# does all three.) - reserved(def) method(helper)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(args)operator(.)ident(flatten)operator(.)ident(each) reserved(do) operator(|)ident(arg)operator(|) - reserved(case) ident(arg) - reserved(when) constant(Module) - ident(add_template_helper)operator(()ident(arg)operator(\)) - reserved(when) constant(String)operator(,) constant(Symbol) - ident(file_name) operator(=) ident(arg)operator(.)ident(to_s)operator(.)ident(underscore) operator(+) string - ident(class_name) operator(=) ident(file_name)operator(.)ident(camelize) - - reserved(begin) - ident(require_dependency)operator(()ident(file_name)operator(\)) - reserved(rescue) constant(LoadError) operator(=)operator(>) ident(load_error) - ident(requiree) operator(=) regexpoperator(.)ident(match)operator(()ident(load_error)operator(\))operator(.)ident(to_a)operator([)integer(1)operator(]) - ident(msg) operator(=) operator(()ident(requiree) operator(==) ident(file_name)operator(\)) operator(?) stringcontent(.rb)delimiter(")> operator(:) stringdelimiter(")> - ident(raise) constant(LoadError)operator(.)ident(new)operator(()ident(msg)operator(\))operator(.)ident(copy_blame!)operator(()ident(load_error)operator(\)) - reserved(end) - - ident(add_template_helper)operator(()ident(class_name)operator(.)ident(constantize)operator(\)) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - reserved(end) - - comment(# Evaluate block in template class if given.) - ident(master_helper_module)operator(.)ident(module_eval)operator(()operator(&)ident(block)operator(\)) reserved(if) ident(block_given?) - reserved(end) - - comment(# Declare a controller method as a helper. For example,) - comment(# helper_method :link_to) - comment(# def link_to(name, options\) ... end) - comment(# makes the link_to controller method available in the view.) - reserved(def) method(helper_method)operator(()operator(*)ident(methods)operator(\)) - ident(methods)operator(.)ident(flatten)operator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - ident(master_helper_module)operator(.)ident(module_eval) stringstringcontent((*args, &block\) - controller.send(%()inlinecontent(\), *args, &block\) - end)delimiter( - end_eval)> - reserved(end) - reserved(end) - - comment(# Declare a controller attribute as a helper. For example,) - comment(# helper_attr :name) - comment(# attr_accessor :name) - comment(# makes the name and name= controller methods available in the view.) - comment(# The is a convenience wrapper for helper_method.) - reserved(def) method(helper_attr)operator(()operator(*)ident(attrs)operator(\)) - ident(attrs)operator(.)ident(flatten)operator(.)ident(each) operator({) operator(|)ident(attr)operator(|) ident(helper_method)operator(()ident(attr)operator(,) stringcontent(=)delimiter(")>operator(\)) operator(}) - reserved(end) - - ident(private) - reserved(def) method(inherited_with_helper)operator(()ident(child)operator(\)) - ident(inherited_without_helper)operator(()ident(child)operator(\)) - reserved(begin) - ident(child)operator(.)ident(master_helper_module) operator(=) constant(Module)operator(.)ident(new) - ident(child)operator(.)ident(master_helper_module)operator(.)ident(send) symbol(:include)operator(,) ident(master_helper_module) - ident(child)operator(.)ident(helper) ident(child)operator(.)ident(name)operator(.)ident(underscore) - reserved(rescue) constant(MissingSourceFile) operator(=)operator(>) ident(e) - ident(raise) reserved(unless) ident(e)operator(.)ident(is_missing?)operator(()stringcontent(_helper)delimiter(")>operator(\)) - reserved(end) - reserved(end) - reserved(end) - - ident(private) - comment(# Extend the template class instance with our controller's helper module.) - reserved(def) method(initialize_template_class_with_helper)operator(()ident(assigns)operator(\)) - ident(returning)operator(()ident(template) operator(=) ident(initialize_template_class_without_helper)operator(()ident(assigns)operator(\))operator(\)) reserved(do) - ident(template)operator(.)ident(extend) pre_constant(self)operator(.)ident(class)operator(.)ident(master_helper_module) - reserved(end) - reserved(end) - reserved(end) -ident(endrequire) string - -reserved(module) class(MailHelper) - comment(# Uses Text::Format to take the text and format it, indented two spaces for) - comment(# each line, and wrapped at 72 columns.) - reserved(def) method(block_format)operator(()ident(text)operator(\)) - ident(formatted) operator(=) ident(text)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(collect) operator({) operator(|)ident(paragraph)operator(|) - constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(() - symbol(:columns) operator(=)operator(>) integer(72)operator(,) symbol(:first_indent) operator(=)operator(>) integer(2)operator(,) symbol(:body_indent) operator(=)operator(>) integer(2)operator(,) symbol(:text) operator(=)operator(>) ident(paragraph) - operator(\))operator(.)ident(format) - operator(})operator(.)ident(join)operator(()stringoperator(\)) - - comment(# Make list points stand on their own line) - ident(formatted)operator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) operator(|)ident(s)operator(|) stringcontent( )inlinechar(\\n)delimiter(")> operator(}) - ident(formatted)operator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) operator(|)ident(s)operator(|) stringcontent( )inlinechar(\\n)delimiter(")> operator(}) - - ident(formatted) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActionMailer) - comment(# Represents a subpart of an email message. It shares many similar) - comment(# attributes of ActionMailer::Base. Although you can create parts manually) - comment(# and add them to the #parts list of the mailer, it is easier) - comment(# to use the helper methods in ActionMailer::PartContainer.) - reserved(class) class(Part) - ident(include) constant(ActionMailer)operator(::)constant(AdvAttrAccessor) - ident(include) constant(ActionMailer)operator(::)constant(PartContainer) - - comment(# Represents the body of the part, as a string. This should not be a) - comment(# Hash (like ActionMailer::Base\), but if you want a template to be rendered) - comment(# into the body of a subpart you can do it with the mailer's #render method) - comment(# and assign the result here.) - ident(adv_attr_accessor) symbol(:body) - - comment(# Specify the charset for this subpart. By default, it will be the charset) - comment(# of the containing part or mailer.) - ident(adv_attr_accessor) symbol(:charset) - - comment(# The content disposition of this part, typically either "inline" or) - comment(# "attachment".) - ident(adv_attr_accessor) symbol(:content_disposition) - - comment(# The content type of the part.) - ident(adv_attr_accessor) symbol(:content_type) - - comment(# The filename to use for this subpart (usually for attachments\).) - ident(adv_attr_accessor) symbol(:filename) - - comment(# Accessor for specifying additional headers to include with this part.) - ident(adv_attr_accessor) symbol(:headers) - - comment(# The transfer encoding to use for this subpart, like "base64" or) - comment(# "quoted-printable".) - ident(adv_attr_accessor) symbol(:transfer_encoding) - - comment(# Create a new part from the given +params+ hash. The valid params keys) - comment(# correspond to the accessors.) - reserved(def) method(initialize)operator(()ident(params)operator(\)) - instance_variable(@content_type) operator(=) ident(params)operator([)symbol(:content_type)operator(]) - instance_variable(@content_disposition) operator(=) ident(params)operator([)symbol(:disposition)operator(]) operator(||) string - instance_variable(@charset) operator(=) ident(params)operator([)symbol(:charset)operator(]) - instance_variable(@body) operator(=) ident(params)operator([)symbol(:body)operator(]) - instance_variable(@filename) operator(=) ident(params)operator([)symbol(:filename)operator(]) - instance_variable(@transfer_encoding) operator(=) ident(params)operator([)symbol(:transfer_encoding)operator(]) operator(||) string - instance_variable(@headers) operator(=) ident(params)operator([)symbol(:headers)operator(]) operator(||) operator({)operator(}) - instance_variable(@parts) operator(=) operator([)operator(]) - reserved(end) - - comment(# Convert the part to a mail object which can be included in the parts) - comment(# list of another mail object.) - reserved(def) method(to_mail)operator(()ident(defaults)operator(\)) - ident(part) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(new) - - ident(real_content_type)operator(,) ident(ctype_attrs) operator(=) ident(parse_content_type)operator(()ident(defaults)operator(\)) - - reserved(if) instance_variable(@parts)operator(.)ident(empty?) - ident(part)operator(.)ident(content_transfer_encoding) operator(=) ident(transfer_encoding) operator(||) string - reserved(case) operator(()ident(transfer_encoding) operator(||) stringoperator(\))operator(.)ident(downcase) - reserved(when) string reserved(then) - ident(part)operator(.)ident(body) operator(=) constant(TMail)operator(::)constant(Base64)operator(.)ident(folding_encode)operator(()ident(body)operator(\)) - reserved(when) string - ident(part)operator(.)ident(body) operator(=) operator([)constant(Utils)operator(.)ident(normalize_new_lines)operator(()ident(body)operator(\))operator(])operator(.)ident(pack)operator(()stringoperator(\)) - reserved(else) - ident(part)operator(.)ident(body) operator(=) ident(body) - reserved(end) - - comment(# Always set the content_type after setting the body and or parts!) - comment(# Also don't set filename and name when there is none (like in) - comment(# non-attachment parts\)) - reserved(if) ident(content_disposition) operator(==) string - ident(ctype_attrs)operator(.)ident(delete) string - ident(part)operator(.)ident(set_content_type)operator(()ident(real_content_type)operator(,) pre_constant(nil)operator(,) - ident(squish)operator(()string operator(=)operator(>) ident(filename)operator(\))operator(.)ident(merge)operator(()ident(ctype_attrs)operator(\))operator(\)) - ident(part)operator(.)ident(set_content_disposition)operator(()ident(content_disposition)operator(,) - ident(squish)operator(()string operator(=)operator(>) ident(filename)operator(\))operator(.)ident(merge)operator(()ident(ctype_attrs)operator(\))operator(\)) - reserved(else) - ident(part)operator(.)ident(set_content_type)operator(()ident(real_content_type)operator(,) pre_constant(nil)operator(,) ident(ctype_attrs)operator(\)) - ident(part)operator(.)ident(set_content_disposition)operator(()ident(content_disposition)operator(\)) - reserved(end) - reserved(else) - reserved(if) constant(String) operator(===) ident(body) - ident(part) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(new) - ident(part)operator(.)ident(body) operator(=) ident(body) - ident(part)operator(.)ident(set_content_type)operator(()ident(real_content_type)operator(,) pre_constant(nil)operator(,) ident(ctype_attrs)operator(\)) - ident(part)operator(.)ident(set_content_disposition) string - ident(m)operator(.)ident(parts) operator(<<) ident(part) - reserved(end) - - instance_variable(@parts)operator(.)ident(each) reserved(do) operator(|)ident(p)operator(|) - ident(prt) operator(=) operator(()constant(TMail)operator(::)constant(Mail) operator(===) ident(p) operator(?) ident(p) operator(:) ident(p)operator(.)ident(to_mail)operator(()ident(defaults)operator(\))operator(\)) - ident(part)operator(.)ident(parts) operator(<<) ident(prt) - reserved(end) - - ident(part)operator(.)ident(set_content_type)operator(()ident(real_content_type)operator(,) pre_constant(nil)operator(,) ident(ctype_attrs)operator(\)) reserved(if) ident(real_content_type) operator(=)operator(~) regexp - reserved(end) - - ident(headers)operator(.)ident(each) operator({) operator(|)ident(k)operator(,)ident(v)operator(|) ident(part)operator([)ident(k)operator(]) operator(=) ident(v) operator(}) - - ident(part) - reserved(end) - - ident(private) - - reserved(def) method(squish)operator(()ident(values)operator(=)operator({)operator(})operator(\)) - ident(values)operator(.)ident(delete_if) operator({) operator(|)ident(k)operator(,)ident(v)operator(|) ident(v)operator(.)ident(nil?) operator(}) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionMailer) - comment(# Accessors and helpers that ActionMailer::Base and ActionMailer::Part have) - comment(# in common. Using these helpers you can easily add subparts or attachments) - comment(# to your message:) - comment(#) - comment(# def my_mail_message(...\)) - comment(# ...) - comment(# part "text/plain" do |p|) - comment(# p.body "hello, world") - comment(# p.transfer_encoding "base64") - comment(# end) - comment(#) - comment(# attachment "image/jpg" do |a|) - comment(# a.body = File.read("hello.jpg"\)) - comment(# a.filename = "hello.jpg") - comment(# end) - comment(# end) - reserved(module) class(PartContainer) - comment(# The list of subparts of this container) - ident(attr_reader) symbol(:parts) - - comment(# Add a part to a multipart message, with the given content-type. The) - comment(# part itself is yielded to the block so that other properties (charset,) - comment(# body, headers, etc.\) can be set on it.) - reserved(def) method(part)operator(()ident(params)operator(\)) - ident(params) operator(=) operator({)symbol(:content_type) operator(=)operator(>) ident(params)operator(}) reserved(if) constant(String) operator(===) ident(params) - ident(part) operator(=) constant(Part)operator(.)ident(new)operator(()ident(params)operator(\)) - reserved(yield) ident(part) reserved(if) ident(block_given?) - instance_variable(@parts) operator(<<) ident(part) - reserved(end) - - comment(# Add an attachment to a multipart message. This is simply a part with the) - comment(# content-disposition set to "attachment".) - reserved(def) method(attachment)operator(()ident(params)operator(,) operator(&)ident(block)operator(\)) - ident(params) operator(=) operator({) symbol(:content_type) operator(=)operator(>) ident(params) operator(}) reserved(if) constant(String) operator(===) ident(params) - ident(params) operator(=) operator({) symbol(:disposition) operator(=)operator(>) stringoperator(,) - symbol(:transfer_encoding) operator(=)operator(>) string operator(})operator(.)ident(merge)operator(()ident(params)operator(\)) - ident(part)operator(()ident(params)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - ident(private) - - reserved(def) method(parse_content_type)operator(()ident(defaults)operator(=)pre_constant(nil)operator(\)) - reserved(return) operator([)ident(defaults) operator(&&) ident(defaults)operator(.)ident(content_type)operator(,) operator({)operator(})operator(]) reserved(if) ident(content_type)operator(.)ident(blank?) - ident(ctype)operator(,) operator(*)ident(attrs) operator(=) ident(content_type)operator(.)ident(split)operator(()regexpoperator(\)) - ident(attrs) operator(=) ident(attrs)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({) operator(|)ident(h)operator(,)ident(s)operator(|) ident(k)operator(,)ident(v) operator(=) ident(s)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\))operator(;) ident(h)operator([)ident(k)operator(]) operator(=) ident(v)operator(;) ident(h) operator(}) - operator([)ident(ctype)operator(,) operator({)string operator(=)operator(>) ident(charset) operator(||) ident(defaults) operator(&&) ident(defaults)operator(.)ident(charset)operator(})operator(.)ident(merge)operator(()ident(attrs)operator(\))operator(]) - reserved(end) - - reserved(end) -reserved(end) -reserved(module) class(ActionMailer) - reserved(module) class(Quoting) comment(#:nodoc:) - comment(# Convert the given text into quoted printable format, with an instruction) - comment(# that the text be eventually interpreted in the given charset.) - reserved(def) method(quoted_printable)operator(()ident(text)operator(,) ident(charset)operator(\)) - ident(text) operator(=) ident(text)operator(.)ident(gsub)operator(() regexp operator(\)) operator({) ident(quoted_printable_encode)operator(()global_variable($&)operator(\)) operator(})operator(.) - ident(gsub)operator(() regexpoperator(,) string operator(\)) - stringcontent(?Q?)inlinecontent(?=)delimiter(")> - reserved(end) - - comment(# Convert the given character to quoted printable format, taking into) - comment(# account multi-byte characters (if executing with $KCODE="u", for instance\)) - reserved(def) method(quoted_printable_encode)operator(()ident(character)operator(\)) - ident(result) operator(=) string - ident(character)operator(.)ident(each_byte) operator({) operator(|)ident(b)operator(|) ident(result) operator(<<) string operator(%) ident(b) operator(}) - ident(result) - reserved(end) - - comment(# A quick-and-dirty regexp for determining whether a string contains any) - comment(# characters that need escaping.) - reserved(if) operator(!)reserved(defined?)operator(()constant(CHARS_NEEDING_QUOTING)operator(\)) - constant(CHARS_NEEDING_QUOTING) operator(=) regexp - reserved(end) - - comment(# Quote the given text if it contains any "illegal" characters) - reserved(def) method(quote_if_necessary)operator(()ident(text)operator(,) ident(charset)operator(\)) - operator(()ident(text) operator(=)operator(~) constant(CHARS_NEEDING_QUOTING)operator(\)) operator(?) - ident(quoted_printable)operator(()ident(text)operator(,) ident(charset)operator(\)) operator(:) - ident(text) - reserved(end) - - comment(# Quote any of the given strings if they contain any "illegal" characters) - reserved(def) method(quote_any_if_necessary)operator(()ident(charset)operator(,) operator(*)ident(args)operator(\)) - ident(args)operator(.)ident(map) operator({) operator(|)ident(v)operator(|) ident(quote_if_necessary)operator(()ident(v)operator(,) ident(charset)operator(\)) operator(}) - reserved(end) - - comment(# Quote the given address if it needs to be. The address may be a) - comment(# regular email address, or it can be a phrase followed by an address in) - comment(# brackets. The phrase is the only part that will be quoted, and only if) - comment(# it needs to be. This allows extended characters to be used in the) - comment(# "to", "from", "cc", and "bcc" headers.) - reserved(def) method(quote_address_if_necessary)operator(()ident(address)operator(,) ident(charset)operator(\)) - reserved(if) constant(Array) operator(===) ident(address) - ident(address)operator(.)ident(map) operator({) operator(|)ident(a)operator(|) ident(quote_address_if_necessary)operator(()ident(a)operator(,) ident(charset)operator(\)) operator(}) - reserved(elsif) ident(address) operator(=)operator(~) regexp\)$)delimiter(/)> - ident(address) operator(=) global_variable($2) - ident(phrase) operator(=) ident(quote_if_necessary)operator(()global_variable($1)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(,) ident(charset)operator(\)) - stringchar(\\")content( )inlinedelimiter(")> - reserved(else) - ident(address) - reserved(end) - reserved(end) - - comment(# Quote any of the given addresses, if they need to be.) - reserved(def) method(quote_any_address_if_necessary)operator(()ident(charset)operator(,) operator(*)ident(args)operator(\)) - ident(args)operator(.)ident(map) operator({) operator(|)ident(v)operator(|) ident(quote_address_if_necessary)operator(()ident(v)operator(,) ident(charset)operator(\)) operator(}) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionMailer) - reserved(module) class(Utils) comment(#:nodoc:) - reserved(def) method(normalize_new_lines)operator(()ident(text)operator(\)) - ident(text)operator(.)ident(to_s)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - ident(module_function) symbol(:normalize_new_lines) - reserved(end) -reserved(end) -comment(#--) -comment(# Text::Format for Ruby) -comment(# Version 0.63) -comment(#) -comment(# Copyright (c\) 2002 - 2003 Austin Ziegler) -comment(#) -comment(# $Id: format.rb,v 1.1.1.1 2004/10/14 11:59:57 webster132 Exp $) -comment(#) -comment(# ==========================================================================) -comment(# Revision History ::) -comment(# YYYY.MM.DD Change ID Developer) -comment(# Description) -comment(# --------------------------------------------------------------------------) -comment(# 2002.10.18 Austin Ziegler) -comment(# Fixed a minor problem with tabs not being counted. Changed) -comment(# abbreviations from Hash to Array to better suit Ruby's) -comment(# capabilities. Fixed problems with the way that Array arguments) -comment(# are handled in calls to the major object types, excepting in) -comment(# Text::Format#expand and Text::Format#unexpand (these will) -comment(# probably need to be fixed\).) -comment(# 2002.10.30 Austin Ziegler) -comment(# Fixed the ordering of the <=> for binary tests. Fixed) -comment(# Text::Format#expand and Text::Format#unexpand to handle array) -comment(# arguments better.) -comment(# 2003.01.24 Austin Ziegler) -comment(# Fixed a problem with Text::Format::RIGHT_FILL handling where a) -comment(# single word is larger than #columns. Removed Comparable) -comment(# capabilities (<=> doesn't make sense; == does\). Added Symbol) -comment(# equivalents for the Hash initialization. Hash initialization has) -comment(# been modified so that values are set as follows (Symbols are) -comment(# highest priority; strings are middle; defaults are lowest\):) -comment(# @columns = arg[:columns] || arg['columns'] || @columns) -comment(# Added #hard_margins, #split_rules, #hyphenator, and #split_words.) -comment(# 2003.02.07 Austin Ziegler) -comment(# Fixed the installer for proper case-sensitive handling.) -comment(# 2003.03.28 Austin Ziegler) -comment(# Added the ability for a hyphenator to receive the formatter) -comment(# object. Fixed a bug for strings matching /\\A\\s*\\Z/ failing) -comment(# entirely. Fixed a test case failing under 1.6.8. ) -comment(# 2003.04.04 Austin Ziegler) -comment(# Handle the case of hyphenators returning nil for first/rest.) -comment(# 2003.09.17 Austin Ziegler) -comment(# Fixed a problem where #paragraphs(" "\) was raising) -comment(# NoMethodError.) -comment(#) -comment(# ==========================================================================) -comment(#++) - -reserved(module) class(Text) comment(#:nodoc:) - comment(# Text::Format for Ruby is copyright 2002 - 2005 by Austin Ziegler. It) - comment(# is available under Ruby's licence, the Perl Artistic licence, or the) - comment(# GNU GPL version 2 (or at your option, any later version\). As a) - comment(# special exception, for use with official Rails (provided by the) - comment(# rubyonrails.org development team\) and any project created with) - comment(# official Rails, the following alternative MIT-style licence may be) - comment(# used:) - comment(#) - comment(# == Text::Format Licence for Rails and Rails Applications) - comment(# Permission is hereby granted, free of charge, to any person) - comment(# obtaining a copy of this software and associated documentation files) - comment(# (the "Software"\), to deal in the Software without restriction,) - comment(# including without limitation the rights to use, copy, modify, merge,) - comment(# publish, distribute, sublicense, and/or sell copies of the Software,) - comment(# and to permit persons to whom the Software is furnished to do so,) - comment(# subject to the following conditions:) - comment(#) - comment(# * The names of its contributors may not be used to endorse or) - comment(# promote products derived from this software without specific prior) - comment(# written permission.) - comment(#) - comment(# The above copyright notice and this permission notice shall be) - comment(# included in all copies or substantial portions of the Software.) - comment(#) - comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) - comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) - comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) - comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS) - comment(# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN) - comment(# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN) - comment(# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE) - comment(# SOFTWARE. ) - reserved(class) class(Format) - constant(VERSION) operator(=) string - - comment(# Local abbreviations. More can be added with Text::Format.abbreviations) - constant(ABBREV) operator(=) operator([) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) string operator(]) - - comment(# Formatting values) - constant(LEFT_ALIGN) operator(=) integer(0) - constant(RIGHT_ALIGN) operator(=) integer(1) - constant(RIGHT_FILL) operator(=) integer(2) - constant(JUSTIFY) operator(=) integer(3) - - comment(# Word split modes (only applies when #hard_margins is true\).) - constant(SPLIT_FIXED) operator(=) integer(1) - constant(SPLIT_CONTINUATION) operator(=) integer(2) - constant(SPLIT_HYPHENATION) operator(=) integer(4) - constant(SPLIT_CONTINUATION_FIXED) operator(=) constant(SPLIT_CONTINUATION) operator(|) constant(SPLIT_FIXED) - constant(SPLIT_HYPHENATION_FIXED) operator(=) constant(SPLIT_HYPHENATION) operator(|) constant(SPLIT_FIXED) - constant(SPLIT_HYPHENATION_CONTINUATION) operator(=) constant(SPLIT_HYPHENATION) operator(|) constant(SPLIT_CONTINUATION) - constant(SPLIT_ALL) operator(=) constant(SPLIT_HYPHENATION) operator(|) constant(SPLIT_CONTINUATION) operator(|) constant(SPLIT_FIXED) - - comment(# Words forcibly split by Text::Format will be stored as split words.) - comment(# This class represents a word forcibly split.) - reserved(class) class(SplitWord) - comment(# The word that was split.) - ident(attr_reader) symbol(:word) - comment(# The first part of the word that was split.) - ident(attr_reader) symbol(:first) - comment(# The remainder of the word that was split.) - ident(attr_reader) symbol(:rest) - - reserved(def) method(initialize)operator(()ident(word)operator(,) ident(first)operator(,) ident(rest)operator(\)) comment(#:nodoc:) - instance_variable(@word) operator(=) ident(word) - instance_variable(@first) operator(=) ident(first) - instance_variable(@rest) operator(=) ident(rest) - reserved(end) - reserved(end) - - ident(private) - constant(LEQ_RE) operator(=) regexp - - reserved(def) method(brk_re)operator(()ident(i)operator(\)) comment(#:nodoc:) - regexpcontent(}\)(.+\))delimiter(/)> - reserved(end) - - reserved(def) method(posint)operator(()ident(p)operator(\)) comment(#:nodoc:) - ident(p)operator(.)ident(to_i)operator(.)ident(abs) - reserved(end) - - ident(public) - comment(# Compares two Text::Format objects. All settings of the objects are) - comment(# compared *except* #hyphenator. Generated results (e.g., #split_words\)) - comment(# are not compared, either.) - reserved(def) method(==)operator(()ident(o)operator(\)) - operator(()instance_variable(@text) operator(==) ident(o)operator(.)ident(text)operator(\)) operator(&&) - operator(()instance_variable(@columns) operator(==) ident(o)operator(.)ident(columns)operator(\)) operator(&&) - operator(()instance_variable(@left_margin) operator(==) ident(o)operator(.)ident(left_margin)operator(\)) operator(&&) - operator(()instance_variable(@right_margin) operator(==) ident(o)operator(.)ident(right_margin)operator(\)) operator(&&) - operator(()instance_variable(@hard_margins) operator(==) ident(o)operator(.)ident(hard_margins)operator(\)) operator(&&) - operator(()instance_variable(@split_rules) operator(==) ident(o)operator(.)ident(split_rules)operator(\)) operator(&&) - operator(()instance_variable(@first_indent) operator(==) ident(o)operator(.)ident(first_indent)operator(\)) operator(&&) - operator(()instance_variable(@body_indent) operator(==) ident(o)operator(.)ident(body_indent)operator(\)) operator(&&) - operator(()instance_variable(@tag_text) operator(==) ident(o)operator(.)ident(tag_text)operator(\)) operator(&&) - operator(()instance_variable(@tabstop) operator(==) ident(o)operator(.)ident(tabstop)operator(\)) operator(&&) - operator(()instance_variable(@format_style) operator(==) ident(o)operator(.)ident(format_style)operator(\)) operator(&&) - operator(()instance_variable(@extra_space) operator(==) ident(o)operator(.)ident(extra_space)operator(\)) operator(&&) - operator(()instance_variable(@tag_paragraph) operator(==) ident(o)operator(.)ident(tag_paragraph)operator(\)) operator(&&) - operator(()instance_variable(@nobreak) operator(==) ident(o)operator(.)ident(nobreak)operator(\)) operator(&&) - operator(()instance_variable(@abbreviations) operator(==) ident(o)operator(.)ident(abbreviations)operator(\)) operator(&&) - operator(()instance_variable(@nobreak_regex) operator(==) ident(o)operator(.)ident(nobreak_regex)operator(\)) - reserved(end) - - comment(# The text to be manipulated. Note that value is optional, but if the) - comment(# formatting functions are called without values, this text is what will) - comment(# be formatted.) - comment(#) - comment(# *Default*:: []) - comment(# Used in:: All methods) - ident(attr_accessor) symbol(:text) - - comment(# The total width of the format area. The margins, indentation, and text) - comment(# are formatted into this space.) - comment(#) - comment(# COLUMNS) - comment(# <-------------------------------------------------------------->) - comment(# <-----------><------><---------------------------><------------>) - comment(# left margin indent text is formatted into here right margin) - comment(#) - comment(# *Default*:: 72) - comment(# Used in:: #format, #paragraphs,) - comment(# #center) - ident(attr_reader) symbol(:columns) - - comment(# The total width of the format area. The margins, indentation, and text) - comment(# are formatted into this space. The value provided is silently) - comment(# converted to a positive integer.) - comment(#) - comment(# COLUMNS) - comment(# <-------------------------------------------------------------->) - comment(# <-----------><------><---------------------------><------------>) - comment(# left margin indent text is formatted into here right margin) - comment(#) - comment(# *Default*:: 72) - comment(# Used in:: #format, #paragraphs,) - comment(# #center) - reserved(def) method(columns=)operator(()ident(c)operator(\)) - instance_variable(@columns) operator(=) ident(posint)operator(()ident(c)operator(\)) - reserved(end) - - comment(# The number of spaces used for the left margin.) - comment(#) - comment(# columns) - comment(# <-------------------------------------------------------------->) - comment(# <-----------><------><---------------------------><------------>) - comment(# LEFT MARGIN indent text is formatted into here right margin) - comment(#) - comment(# *Default*:: 0) - comment(# Used in:: #format, #paragraphs,) - comment(# #center) - ident(attr_reader) symbol(:left_margin) - - comment(# The number of spaces used for the left margin. The value provided is) - comment(# silently converted to a positive integer value.) - comment(#) - comment(# columns) - comment(# <-------------------------------------------------------------->) - comment(# <-----------><------><---------------------------><------------>) - comment(# LEFT MARGIN indent text is formatted into here right margin) - comment(#) - comment(# *Default*:: 0) - comment(# Used in:: #format, #paragraphs,) - comment(# #center) - reserved(def) method(left_margin=)operator(()ident(left)operator(\)) - instance_variable(@left_margin) operator(=) ident(posint)operator(()ident(left)operator(\)) - reserved(end) - - comment(# The number of spaces used for the right margin.) - comment(#) - comment(# columns) - comment(# <-------------------------------------------------------------->) - comment(# <-----------><------><---------------------------><------------>) - comment(# left margin indent text is formatted into here RIGHT MARGIN) - comment(#) - comment(# *Default*:: 0) - comment(# Used in:: #format, #paragraphs,) - comment(# #center) - ident(attr_reader) symbol(:right_margin) - - comment(# The number of spaces used for the right margin. The value provided is) - comment(# silently converted to a positive integer value.) - comment(#) - comment(# columns) - comment(# <-------------------------------------------------------------->) - comment(# <-----------><------><---------------------------><------------>) - comment(# left margin indent text is formatted into here RIGHT MARGIN) - comment(#) - comment(# *Default*:: 0) - comment(# Used in:: #format, #paragraphs,) - comment(# #center) - reserved(def) method(right_margin=)operator(()ident(r)operator(\)) - instance_variable(@right_margin) operator(=) ident(posint)operator(()ident(r)operator(\)) - reserved(end) - - comment(# The number of spaces to indent the first line of a paragraph.) - comment(#) - comment(# columns) - comment(# <-------------------------------------------------------------->) - comment(# <-----------><------><---------------------------><------------>) - comment(# left margin INDENT text is formatted into here right margin) - comment(#) - comment(# *Default*:: 4) - comment(# Used in:: #format, #paragraphs) - ident(attr_reader) symbol(:first_indent) - - comment(# The number of spaces to indent the first line of a paragraph. The) - comment(# value provided is silently converted to a positive integer value.) - comment(#) - comment(# columns) - comment(# <-------------------------------------------------------------->) - comment(# <-----------><------><---------------------------><------------>) - comment(# left margin INDENT text is formatted into here right margin) - comment(#) - comment(# *Default*:: 4) - comment(# Used in:: #format, #paragraphs) - reserved(def) method(first_indent=)operator(()ident(f)operator(\)) - instance_variable(@first_indent) operator(=) ident(posint)operator(()ident(f)operator(\)) - reserved(end) - - comment(# The number of spaces to indent all lines after the first line of a) - comment(# paragraph.) - comment(#) - comment(# columns) - comment(# <-------------------------------------------------------------->) - comment(# <-----------><------><---------------------------><------------>) - comment(# left margin INDENT text is formatted into here right margin) - comment(#) - comment(# *Default*:: 0) - comment(# Used in:: #format, #paragraphs) - ident(attr_reader) symbol(:body_indent) - - comment(# The number of spaces to indent all lines after the first line of) - comment(# a paragraph. The value provided is silently converted to a) - comment(# positive integer value.) - comment(#) - comment(# columns) - comment(# <-------------------------------------------------------------->) - comment(# <-----------><------><---------------------------><------------>) - comment(# left margin INDENT text is formatted into here right margin) - comment(#) - comment(# *Default*:: 0) - comment(# Used in:: #format, #paragraphs) - reserved(def) method(body_indent=)operator(()ident(b)operator(\)) - instance_variable(@body_indent) operator(=) ident(posint)operator(()ident(b)operator(\)) - reserved(end) - - comment(# Normally, words larger than the format area will be placed on a line) - comment(# by themselves. Setting this to +true+ will force words larger than the) - comment(# format area to be split into one or more "words" each at most the size) - comment(# of the format area. The first line and the original word will be) - comment(# placed into #split_words. Note that this will cause the) - comment(# output to look *similar* to a #format_style of JUSTIFY. (Lines will be) - comment(# filled as much as possible.\)) - comment(#) - comment(# *Default*:: +false+) - comment(# Used in:: #format, #paragraphs) - ident(attr_accessor) symbol(:hard_margins) - - comment(# An array of words split during formatting if #hard_margins is set to) - comment(# +true+.) - comment(# #split_words << Text::Format::SplitWord.new(word, first, rest\)) - ident(attr_reader) symbol(:split_words) - - comment(# The object responsible for hyphenating. It must respond to) - comment(# #hyphenate_to(word, size\) or #hyphenate_to(word, size, formatter\) and) - comment(# return an array of the word split into two parts; if there is a) - comment(# hyphenation mark to be applied, responsibility belongs to the) - comment(# hyphenator object. The size is the MAXIMUM size permitted, including) - comment(# any hyphenation marks. If the #hyphenate_to method has an arity of 3,) - comment(# the formatter will be provided to the method. This allows the) - comment(# hyphenator to make decisions about the hyphenation based on the) - comment(# formatting rules.) - comment(#) - comment(# *Default*:: +nil+) - comment(# Used in:: #format, #paragraphs) - ident(attr_reader) symbol(:hyphenator) - - comment(# The object responsible for hyphenating. It must respond to) - comment(# #hyphenate_to(word, size\) and return an array of the word hyphenated) - comment(# into two parts. The size is the MAXIMUM size permitted, including any) - comment(# hyphenation marks.) - comment(#) - comment(# *Default*:: +nil+) - comment(# Used in:: #format, #paragraphs) - reserved(def) method(hyphenator=)operator(()ident(h)operator(\)) - ident(raise) constant(ArgumentError)operator(,) stringcontent( is not a valid hyphenator.)delimiter(")> reserved(unless) ident(h)operator(.)ident(respond_to?)operator(()symbol(:hyphenate_to)operator(\)) - ident(arity) operator(=) ident(h)operator(.)ident(method)operator(()symbol(:hyphenate_to)operator(\))operator(.)ident(arity) - ident(raise) constant(ArgumentError)operator(,) stringcontent( must have exactly two or three arguments.)delimiter(")> reserved(unless) operator([)integer(2)operator(,) integer(3)operator(])operator(.)ident(include?)operator(()ident(arity)operator(\)) - instance_variable(@hyphenator) operator(=) ident(h) - instance_variable(@hyphenator_arity) operator(=) ident(arity) - reserved(end) - - comment(# Specifies the split mode; used only when #hard_margins is set to) - comment(# +true+. Allowable values are:) - comment(# [+SPLIT_FIXED+] The word will be split at the number of) - comment(# characters needed, with no marking at all.) - comment(# repre) - comment(# senta) - comment(# ion) - comment(# [+SPLIT_CONTINUATION+] The word will be split at the number of) - comment(# characters needed, with a C-style continuation) - comment(# character. If a word is the only item on a) - comment(# line and it cannot be split into an) - comment(# appropriate size, SPLIT_FIXED will be used.) - comment(# repr\\) - comment(# esen\\) - comment(# tati\\) - comment(# on) - comment(# [+SPLIT_HYPHENATION+] The word will be split according to the) - comment(# hyphenator specified in #hyphenator. If there) - comment(# is no #hyphenator specified, works like) - comment(# SPLIT_CONTINUATION. The example is using) - comment(# TeX::Hyphen. If a word is the only item on a) - comment(# line and it cannot be split into an) - comment(# appropriate size, SPLIT_CONTINUATION mode will) - comment(# be used.) - comment(# rep-) - comment(# re-) - comment(# sen-) - comment(# ta-) - comment(# tion) - comment(#) - comment(# *Default*:: Text::Format::SPLIT_FIXED) - comment(# Used in:: #format, #paragraphs) - ident(attr_reader) symbol(:split_rules) - - comment(# Specifies the split mode; used only when #hard_margins is set to) - comment(# +true+. Allowable values are:) - comment(# [+SPLIT_FIXED+] The word will be split at the number of) - comment(# characters needed, with no marking at all.) - comment(# repre) - comment(# senta) - comment(# ion) - comment(# [+SPLIT_CONTINUATION+] The word will be split at the number of) - comment(# characters needed, with a C-style continuation) - comment(# character.) - comment(# repr\\) - comment(# esen\\) - comment(# tati\\) - comment(# on) - comment(# [+SPLIT_HYPHENATION+] The word will be split according to the) - comment(# hyphenator specified in #hyphenator. If there) - comment(# is no #hyphenator specified, works like) - comment(# SPLIT_CONTINUATION. The example is using) - comment(# TeX::Hyphen as the #hyphenator.) - comment(# rep-) - comment(# re-) - comment(# sen-) - comment(# ta-) - comment(# tion) - comment(#) - comment(# These values can be bitwise ORed together (e.g., SPLIT_FIXED |) - comment(# SPLIT_CONTINUATION\) to provide fallback split methods. In the) - comment(# example given, an attempt will be made to split the word using the) - comment(# rules of SPLIT_CONTINUATION; if there is not enough room, the word) - comment(# will be split with the rules of SPLIT_FIXED. These combinations are) - comment(# also available as the following values:) - comment(# * +SPLIT_CONTINUATION_FIXED+) - comment(# * +SPLIT_HYPHENATION_FIXED+) - comment(# * +SPLIT_HYPHENATION_CONTINUATION+) - comment(# * +SPLIT_ALL+) - comment(#) - comment(# *Default*:: Text::Format::SPLIT_FIXED) - comment(# Used in:: #format, #paragraphs) - reserved(def) method(split_rules=)operator(()ident(s)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string reserved(if) operator(()operator(()ident(s) operator(<) constant(SPLIT_FIXED)operator(\)) operator(||) operator(()ident(s) operator(>) constant(SPLIT_ALL)operator(\))operator(\)) - instance_variable(@split_rules) operator(=) ident(s) - reserved(end) - - comment(# Indicates whether sentence terminators should be followed by a single) - comment(# space (+false+\), or two spaces (+true+\).) - comment(#) - comment(# *Default*:: +false+) - comment(# Used in:: #format, #paragraphs) - ident(attr_accessor) symbol(:extra_space) - - comment(# Defines the current abbreviations as an array. This is only used if) - comment(# extra_space is turned on.) - comment(#) - comment(# If one is abbreviating "President" as "Pres." (abbreviations =) - comment(# ["Pres"]\), then the results of formatting will be as illustrated in) - comment(# the table below:) - comment(#) - comment(# extra_space | include? | !include?) - comment(# true | Pres. Lincoln | Pres. Lincoln) - comment(# false | Pres. Lincoln | Pres. Lincoln) - comment(#) - comment(# *Default*:: {}) - comment(# Used in:: #format, #paragraphs) - ident(attr_accessor) symbol(:abbreviations) - - comment(# Indicates whether the formatting of paragraphs should be done with) - comment(# tagged paragraphs. Useful only with #tag_text.) - comment(#) - comment(# *Default*:: +false+) - comment(# Used in:: #format, #paragraphs) - ident(attr_accessor) symbol(:tag_paragraph) - - comment(# The array of text to be placed before each paragraph when) - comment(# #tag_paragraph is +true+. When #format(\) is called,) - comment(# only the first element of the array is used. When #paragraphs) - comment(# is called, then each entry in the array will be used once, with) - comment(# corresponding paragraphs. If the tag elements are exhausted before the) - comment(# text is exhausted, then the remaining paragraphs will not be tagged.) - comment(# Regardless of indentation settings, a blank line will be inserted) - comment(# between all paragraphs when #tag_paragraph is +true+.) - comment(#) - comment(# *Default*:: []) - comment(# Used in:: #format, #paragraphs) - ident(attr_accessor) symbol(:tag_text) - - comment(# Indicates whether or not the non-breaking space feature should be) - comment(# used.) - comment(#) - comment(# *Default*:: +false+) - comment(# Used in:: #format, #paragraphs) - ident(attr_accessor) symbol(:nobreak) - - comment(# A hash which holds the regular expressions on which spaces should not) - comment(# be broken. The hash is set up such that the key is the first word and) - comment(# the value is the second word.) - comment(#) - comment(# For example, if +nobreak_regex+ contains the following hash:) - comment(#) - comment(# { '^Mrs?\\.$' => '\\S+$', '^\\S+$' => '^(?:S|J\)r\\.$'}) - comment(#) - comment(# Then "Mr. Jones", "Mrs. Jones", and "Jones Jr." would not be broken.) - comment(# If this simple matching algorithm indicates that there should not be a) - comment(# break at the current end of line, then a backtrack is done until there) - comment(# are two words on which line breaking is permitted. If two such words) - comment(# are not found, then the end of the line will be broken *regardless*.) - comment(# If there is a single word on the current line, then no backtrack is) - comment(# done and the word is stuck on the end.) - comment(#) - comment(# *Default*:: {}) - comment(# Used in:: #format, #paragraphs) - ident(attr_accessor) symbol(:nobreak_regex) - - comment(# Indicates the number of spaces that a single tab represents.) - comment(#) - comment(# *Default*:: 8) - comment(# Used in:: #expand, #unexpand,) - comment(# #paragraphs) - ident(attr_reader) symbol(:tabstop) - - comment(# Indicates the number of spaces that a single tab represents.) - comment(#) - comment(# *Default*:: 8) - comment(# Used in:: #expand, #unexpand,) - comment(# #paragraphs) - reserved(def) method(tabstop=)operator(()ident(t)operator(\)) - instance_variable(@tabstop) operator(=) ident(posint)operator(()ident(t)operator(\)) - reserved(end) - - comment(# Specifies the format style. Allowable values are:) - comment(# [+LEFT_ALIGN+] Left justified, ragged right.) - comment(# |A paragraph that is|) - comment(# |left aligned.|) - comment(# [+RIGHT_ALIGN+] Right justified, ragged left.) - comment(# |A paragraph that is|) - comment(# | right aligned.|) - comment(# [+RIGHT_FILL+] Left justified, right ragged, filled to width by) - comment(# spaces. (Essentially the same as +LEFT_ALIGN+ except) - comment(# that lines are padded on the right.\)) - comment(# |A paragraph that is|) - comment(# |left aligned. |) - comment(# [+JUSTIFY+] Fully justified, words filled to width by spaces,) - comment(# except the last line.) - comment(# |A paragraph that|) - comment(# |is justified.|) - comment(#) - comment(# *Default*:: Text::Format::LEFT_ALIGN) - comment(# Used in:: #format, #paragraphs) - ident(attr_reader) symbol(:format_style) - - comment(# Specifies the format style. Allowable values are:) - comment(# [+LEFT_ALIGN+] Left justified, ragged right.) - comment(# |A paragraph that is|) - comment(# |left aligned.|) - comment(# [+RIGHT_ALIGN+] Right justified, ragged left.) - comment(# |A paragraph that is|) - comment(# | right aligned.|) - comment(# [+RIGHT_FILL+] Left justified, right ragged, filled to width by) - comment(# spaces. (Essentially the same as +LEFT_ALIGN+ except) - comment(# that lines are padded on the right.\)) - comment(# |A paragraph that is|) - comment(# |left aligned. |) - comment(# [+JUSTIFY+] Fully justified, words filled to width by spaces.) - comment(# |A paragraph that|) - comment(# |is justified.|) - comment(#) - comment(# *Default*:: Text::Format::LEFT_ALIGN) - comment(# Used in:: #format, #paragraphs) - reserved(def) method(format_style=)operator(()ident(fs)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string reserved(if) operator(()operator(()ident(fs) operator(<) constant(LEFT_ALIGN)operator(\)) operator(||) operator(()ident(fs) operator(>) constant(JUSTIFY)operator(\))operator(\)) - instance_variable(@format_style) operator(=) ident(fs) - reserved(end) - - comment(# Indicates that the format style is left alignment.) - comment(#) - comment(# *Default*:: +true+) - comment(# Used in:: #format, #paragraphs) - reserved(def) method(left_align?) - reserved(return) instance_variable(@format_style) operator(==) constant(LEFT_ALIGN) - reserved(end) - - comment(# Indicates that the format style is right alignment.) - comment(#) - comment(# *Default*:: +false+) - comment(# Used in:: #format, #paragraphs) - reserved(def) method(right_align?) - reserved(return) instance_variable(@format_style) operator(==) constant(RIGHT_ALIGN) - reserved(end) - - comment(# Indicates that the format style is right fill.) - comment(#) - comment(# *Default*:: +false+) - comment(# Used in:: #format, #paragraphs) - reserved(def) method(right_fill?) - reserved(return) instance_variable(@format_style) operator(==) constant(RIGHT_FILL) - reserved(end) - - comment(# Indicates that the format style is full justification.) - comment(#) - comment(# *Default*:: +false+) - comment(# Used in:: #format, #paragraphs) - reserved(def) method(justify?) - reserved(return) instance_variable(@format_style) operator(==) constant(JUSTIFY) - reserved(end) - - comment(# The default implementation of #hyphenate_to implements) - comment(# SPLIT_CONTINUATION.) - reserved(def) method(hyphenate_to)operator(()ident(word)operator(,) ident(size)operator(\)) - operator([)ident(word)operator([)integer(0) operator(..) operator(()ident(size) operator(-) integer(2)operator(\))operator(]) operator(+) stringoperator(,) ident(word)operator([)operator(()ident(size) operator(-) integer(1)operator(\)) operator(..) integer(-1)operator(])operator(]) - reserved(end) - - ident(private) - reserved(def) method(__do_split_word)operator(()ident(word)operator(,) ident(size)operator(\)) comment(#:nodoc:) - operator([)ident(word)operator([)integer(0) operator(..) operator(()ident(size) operator(-) integer(1)operator(\))operator(])operator(,) ident(word)operator([)ident(size) operator(..) integer(-1)operator(])operator(]) - reserved(end) - - reserved(def) method(__format)operator(()ident(to_wrap)operator(\)) comment(#:nodoc:) - ident(words) operator(=) ident(to_wrap)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(compact) - ident(words)operator(.)ident(shift) reserved(if) ident(words)operator([)integer(0)operator(])operator(.)ident(nil?) reserved(or) ident(words)operator([)integer(0)operator(])operator(.)ident(empty?) - ident(to_wrap) operator(=) operator([)operator(]) - - ident(abbrev) operator(=) pre_constant(false) - ident(width) operator(=) instance_variable(@columns) operator(-) instance_variable(@first_indent) operator(-) instance_variable(@left_margin) operator(-) instance_variable(@right_margin) - ident(indent_str) operator(=) string operator(*) instance_variable(@first_indent) - ident(first_line) operator(=) pre_constant(true) - ident(line) operator(=) ident(words)operator(.)ident(shift) - ident(abbrev) operator(=) ident(__is_abbrev)operator(()ident(line)operator(\)) reserved(unless) ident(line)operator(.)ident(nil?) operator(||) ident(line)operator(.)ident(empty?) - - reserved(while) ident(w) operator(=) ident(words)operator(.)ident(shift) - reserved(if) operator(()ident(w)operator(.)ident(size) operator(+) ident(line)operator(.)ident(size) operator(<) operator(()ident(width) operator(-) integer(1)operator(\))operator(\)) operator(||) - operator(()operator(()ident(line) operator(!)operator(~) constant(LEQ_RE) operator(||) ident(abbrev)operator(\)) operator(&&) operator(()ident(w)operator(.)ident(size) operator(+) ident(line)operator(.)ident(size) operator(<) ident(width)operator(\))operator(\)) - ident(line) operator(<<) string reserved(if) operator(()ident(line) operator(=)operator(~) constant(LEQ_RE)operator(\)) operator(&&) operator(()reserved(not) ident(abbrev)operator(\)) - ident(line) operator(<<) stringdelimiter(")> - reserved(else) - ident(line)operator(,) ident(w) operator(=) ident(__do_break)operator(()ident(line)operator(,) ident(w)operator(\)) reserved(if) instance_variable(@nobreak) - ident(line)operator(,) ident(w) operator(=) ident(__do_hyphenate)operator(()ident(line)operator(,) ident(w)operator(,) ident(width)operator(\)) reserved(if) instance_variable(@hard_margins) - reserved(if) ident(w)operator(.)ident(index)operator(()regexpoperator(\)) - ident(w)operator(,) operator(*)ident(w2) operator(=) ident(w)operator(.)ident(split)operator(()regexpoperator(\)) - ident(words)operator(.)ident(unshift)operator(()ident(w2)operator(\)) - ident(words)operator(.)ident(flatten!) - reserved(end) - ident(to_wrap) operator(<<) ident(__make_line)operator(()ident(line)operator(,) ident(indent_str)operator(,) ident(width)operator(,) ident(w)operator(.)ident(nil?)operator(\)) reserved(unless) ident(line)operator(.)ident(nil?) - reserved(if) ident(first_line) - ident(first_line) operator(=) pre_constant(false) - ident(width) operator(=) instance_variable(@columns) operator(-) instance_variable(@body_indent) operator(-) instance_variable(@left_margin) operator(-) instance_variable(@right_margin) - ident(indent_str) operator(=) string operator(*) instance_variable(@body_indent) - reserved(end) - ident(line) operator(=) ident(w) - reserved(end) - - ident(abbrev) operator(=) ident(__is_abbrev)operator(()ident(w)operator(\)) reserved(unless) ident(w)operator(.)ident(nil?) - reserved(end) - - ident(loop) reserved(do) - reserved(break) reserved(if) ident(line)operator(.)ident(nil?) reserved(or) ident(line)operator(.)ident(empty?) - ident(line)operator(,) ident(w) operator(=) ident(__do_hyphenate)operator(()ident(line)operator(,) ident(w)operator(,) ident(width)operator(\)) reserved(if) instance_variable(@hard_margins) - ident(to_wrap) operator(<<) ident(__make_line)operator(()ident(line)operator(,) ident(indent_str)operator(,) ident(width)operator(,) ident(w)operator(.)ident(nil?)operator(\)) - ident(line) operator(=) ident(w) - reserved(end) - - reserved(if) operator(()instance_variable(@tag_paragraph) operator(&&) operator(()ident(to_wrap)operator(.)ident(size) operator(>) integer(0)operator(\))operator(\)) reserved(then) - ident(clr) operator(=) regexpoperator(.)ident(match)operator(()operator([)ident(caller)operator(()integer(1)operator(\))operator(])operator(.)ident(flatten)operator([)integer(0)operator(])operator(\))operator([)integer(1)operator(]) - ident(clr) operator(=) string reserved(if) ident(clr)operator(.)ident(nil?) - - reserved(if) operator(()operator(()reserved(not) instance_variable(@tag_text)operator([)integer(0)operator(])operator(.)ident(nil?)operator(\)) operator(&&) operator(()instance_variable(@tag_cur)operator(.)ident(size) operator(<) integer(1)operator(\)) operator(&&) - operator(()ident(clr) operator(!=) stringoperator(\))operator(\)) reserved(then) - instance_variable(@tag_cur) operator(=) instance_variable(@tag_text)operator([)integer(0)operator(]) - reserved(end) - - ident(fchar) operator(=) regexpoperator(.)ident(match)operator(()ident(to_wrap)operator([)integer(0)operator(])operator(\))operator([)integer(1)operator(]) - ident(white) operator(=) ident(to_wrap)operator([)integer(0)operator(])operator(.)ident(index)operator(()ident(fchar)operator(\)) - reserved(if) operator(()operator(()ident(white) operator(-) instance_variable(@left_margin) operator(-) integer(1)operator(\)) operator(>) instance_variable(@tag_cur)operator(.)ident(size)operator(\)) reserved(then) - ident(white) operator(=) instance_variable(@tag_cur)operator(.)ident(size) operator(+) instance_variable(@left_margin) - ident(to_wrap)operator([)integer(0)operator(])operator(.)ident(gsub!)operator(()regexpcontent(})delimiter(/)>operator(,) string operator(*) instance_variable(@left_margin)inline_delimiter(})>inlinedelimiter(")>operator(\)) - reserved(else) - ident(to_wrap)operator(.)ident(unshift)operator(()string operator(*) instance_variable(@left_margin)inline_delimiter(})>inlinechar(\\n)delimiter(")>operator(\)) - reserved(end) - reserved(end) - ident(to_wrap)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - comment(# format lines in text into paragraphs with each element of @wrap a) - comment(# paragraph; uses Text::Format.format for the formatting) - reserved(def) method(__paragraphs)operator(()ident(to_wrap)operator(\)) comment(#:nodoc:) - reserved(if) operator(()operator(()instance_variable(@first_indent) operator(==) instance_variable(@body_indent)operator(\)) operator(||) instance_variable(@tag_paragraph)operator(\)) reserved(then) - ident(p_end) operator(=) string - reserved(else) - ident(p_end) operator(=) string - reserved(end) - - ident(cnt) operator(=) integer(0) - ident(ret) operator(=) operator([)operator(]) - ident(to_wrap)operator(.)ident(each) reserved(do) operator(|)ident(tw)operator(|) - instance_variable(@tag_cur) operator(=) instance_variable(@tag_text)operator([)ident(cnt)operator(]) reserved(if) instance_variable(@tag_paragraph) - instance_variable(@tag_cur) operator(=) string reserved(if) instance_variable(@tag_cur)operator(.)ident(nil?) - ident(line) operator(=) ident(__format)operator(()ident(tw)operator(\)) - ident(ret) operator(<<) stringinlinedelimiter(")> reserved(if) operator(()reserved(not) ident(line)operator(.)ident(nil?)operator(\)) operator(&&) operator(()ident(line)operator(.)ident(size) operator(>) integer(0)operator(\)) - ident(cnt) operator(+=) integer(1) - reserved(end) - - ident(ret)operator([)integer(-1)operator(])operator(.)ident(chomp!) reserved(unless) ident(ret)operator(.)ident(empty?) - ident(ret)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - comment(# center text using spaces on left side to pad it out empty lines) - comment(# are preserved) - reserved(def) method(__center)operator(()ident(to_center)operator(\)) comment(#:nodoc:) - ident(tabs) operator(=) integer(0) - ident(width) operator(=) instance_variable(@columns) operator(-) instance_variable(@left_margin) operator(-) instance_variable(@right_margin) - ident(centered) operator(=) operator([)operator(]) - ident(to_center)operator(.)ident(each) reserved(do) operator(|)ident(tc)operator(|) - ident(s) operator(=) ident(tc)operator(.)ident(strip) - ident(tabs) operator(=) ident(s)operator(.)ident(count)operator(()stringoperator(\)) - ident(tabs) operator(=) integer(0) reserved(if) ident(tabs)operator(.)ident(nil?) - ident(ct) operator(=) operator(()operator(()ident(width) operator(-) ident(s)operator(.)ident(size) operator(-) operator(()ident(tabs) operator(*) instance_variable(@tabstop)operator(\)) operator(+) ident(tabs)operator(\)) operator(/) integer(2)operator(\)) - ident(ct) operator(=) operator(()ident(width) operator(-) instance_variable(@left_margin) operator(-) instance_variable(@right_margin)operator(\)) operator(-) ident(ct) - ident(centered) operator(<<) stringchar(\\n)delimiter(")> - reserved(end) - ident(centered)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - comment(# expand tabs to spaces should be similar to Text::Tabs::expand) - reserved(def) method(__expand)operator(()ident(to_expand)operator(\)) comment(#:nodoc:) - ident(expanded) operator(=) operator([)operator(]) - ident(to_expand)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(te)operator(|) ident(expanded) operator(<<) ident(te)operator(.)ident(gsub)operator(()regexpoperator(,) string operator(*) instance_variable(@tabstop)operator(\)) operator(}) - ident(expanded)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(__unexpand)operator(()ident(to_unexpand)operator(\)) comment(#:nodoc:) - ident(unexpanded) operator(=) operator([)operator(]) - ident(to_unexpand)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(tu)operator(|) ident(unexpanded) operator(<<) ident(tu)operator(.)ident(gsub)operator(()regexpcontent(})delimiter(/)>operator(,) stringoperator(\)) operator(}) - ident(unexpanded)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(__is_abbrev)operator(()ident(word)operator(\)) comment(#:nodoc:) - comment(# remove period if there is one.) - ident(w) operator(=) ident(word)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) reserved(unless) ident(word)operator(.)ident(nil?) - reserved(return) pre_constant(true) reserved(if) operator(()operator(!)instance_variable(@extra_space) operator(||) constant(ABBREV)operator(.)ident(include?)operator(()ident(w)operator(\)) operator(||) instance_variable(@abbreviations)operator(.)ident(include?)operator(()ident(w)operator(\))operator(\)) - pre_constant(false) - reserved(end) - - reserved(def) method(__make_line)operator(()ident(line)operator(,) ident(indent)operator(,) ident(width)operator(,) ident(last) operator(=) pre_constant(false)operator(\)) comment(#:nodoc:) - ident(lmargin) operator(=) string operator(*) instance_variable(@left_margin) - ident(fill) operator(=) string operator(*) operator(()ident(width) operator(-) ident(line)operator(.)ident(size)operator(\)) reserved(if) ident(right_fill?) operator(&&) operator(()ident(line)operator(.)ident(size) operator(<=) ident(width)operator(\)) - - reserved(if) operator(()ident(justify?) operator(&&) operator(()operator(()reserved(not) ident(line)operator(.)ident(nil?)operator(\)) operator(&&) operator(()reserved(not) ident(line)operator(.)ident(empty?)operator(\))operator(\)) operator(&&) ident(line) operator(=)operator(~) regexp operator(&&) operator(!)ident(last)operator(\)) - ident(spaces) operator(=) ident(width) operator(-) ident(line)operator(.)ident(size) - ident(words) operator(=) ident(line)operator(.)ident(split)operator(()regexpoperator(\)) - ident(ws) operator(=) ident(spaces) operator(/) operator(()ident(words)operator(.)ident(size) operator(/) integer(2)operator(\)) - ident(spaces) operator(=) ident(spaces) operator(%) operator(()ident(words)operator(.)ident(size) operator(/) integer(2)operator(\)) reserved(if) ident(ws) operator(>) integer(0) - ident(words)operator(.)ident(reverse)operator(.)ident(each) reserved(do) operator(|)ident(rw)operator(|) - reserved(next) reserved(if) operator(()ident(rw) operator(=)operator(~) regexpoperator(\)) - ident(rw)operator(.)ident(sub!)operator(()regexpoperator(,) string operator(*) ident(ws)operator(\)) - reserved(next) reserved(unless) operator(()ident(spaces) operator(>) integer(0)operator(\)) - ident(rw)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(spaces) operator(-=) integer(1) - reserved(end) - ident(line) operator(=) ident(words)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - ident(line) operator(=) stringinlineinlineinlinechar(\\n)delimiter(")> reserved(unless) ident(line)operator(.)ident(nil?) - reserved(if) ident(right_align?) operator(&&) operator(()reserved(not) ident(line)operator(.)ident(nil?)operator(\)) - ident(line)operator(.)ident(sub)operator(()regexpoperator(,) string operator(*) operator(()instance_variable(@columns) operator(-) instance_variable(@right_margin) operator(-) operator(()ident(line)operator(.)ident(size) operator(-) integer(1)operator(\))operator(\))operator(\)) - reserved(else) - ident(line) - reserved(end) - reserved(end) - - reserved(def) method(__do_hyphenate)operator(()ident(line)operator(,) ident(next_line)operator(,) ident(width)operator(\)) comment(#:nodoc:) - ident(rline) operator(=) ident(line)operator(.)ident(dup) reserved(rescue) ident(line) - ident(rnext) operator(=) ident(next_line)operator(.)ident(dup) reserved(rescue) ident(next_line) - ident(loop) reserved(do) - reserved(if) ident(rline)operator(.)ident(size) operator(==) ident(width) - reserved(break) - reserved(elsif) ident(rline)operator(.)ident(size) operator(>) ident(width) - ident(words) operator(=) ident(rline)operator(.)ident(strip)operator(.)ident(split)operator(()regexpoperator(\)) - ident(word) operator(=) ident(words)operator([)integer(-1)operator(])operator(.)ident(dup) - ident(size) operator(=) ident(width) operator(-) ident(rline)operator(.)ident(size) operator(+) ident(word)operator(.)ident(size) - reserved(if) operator(()ident(size) operator(<=) integer(0)operator(\)) - ident(words)operator([)integer(-1)operator(]) operator(=) pre_constant(nil) - ident(rline) operator(=) ident(words)operator(.)ident(join)operator(()stringoperator(\))operator(.)ident(strip) - ident(rnext) operator(=) stringcontent( )inlinedelimiter(")>operator(.)ident(strip) - reserved(next) - reserved(end) - - ident(first) operator(=) ident(rest) operator(=) pre_constant(nil) - - reserved(if) operator(()operator(()instance_variable(@split_rules) operator(&) constant(SPLIT_HYPHENATION)operator(\)) operator(!=) integer(0)operator(\)) - reserved(if) instance_variable(@hyphenator_arity) operator(==) integer(2) - ident(first)operator(,) ident(rest) operator(=) instance_variable(@hyphenator)operator(.)ident(hyphenate_to)operator(()ident(word)operator(,) ident(size)operator(\)) - reserved(else) - ident(first)operator(,) ident(rest) operator(=) instance_variable(@hyphenator)operator(.)ident(hyphenate_to)operator(()ident(word)operator(,) ident(size)operator(,) pre_constant(self)operator(\)) - reserved(end) - reserved(end) - - reserved(if) operator(()operator(()instance_variable(@split_rules) operator(&) constant(SPLIT_CONTINUATION)operator(\)) operator(!=) integer(0)operator(\)) reserved(and) ident(first)operator(.)ident(nil?) - ident(first)operator(,) ident(rest) operator(=) pre_constant(self)operator(.)ident(hyphenate_to)operator(()ident(word)operator(,) ident(size)operator(\)) - reserved(end) - - reserved(if) operator(()operator(()instance_variable(@split_rules) operator(&) constant(SPLIT_FIXED)operator(\)) operator(!=) integer(0)operator(\)) reserved(and) ident(first)operator(.)ident(nil?) - ident(first)operator(.)ident(nil?) reserved(or) instance_variable(@split_rules) operator(==) constant(SPLIT_FIXED) - ident(first)operator(,) ident(rest) operator(=) ident(__do_split_word)operator(()ident(word)operator(,) ident(size)operator(\)) - reserved(end) - - reserved(if) ident(first)operator(.)ident(nil?) - ident(words)operator([)integer(-1)operator(]) operator(=) pre_constant(nil) - ident(rest) operator(=) ident(word) - reserved(else) - ident(words)operator([)integer(-1)operator(]) operator(=) ident(first) - instance_variable(@split_words) operator(<<) constant(SplitWord)operator(.)ident(new)operator(()ident(word)operator(,) ident(first)operator(,) ident(rest)operator(\)) - reserved(end) - ident(rline) operator(=) ident(words)operator(.)ident(join)operator(()stringoperator(\))operator(.)ident(strip) - ident(rnext) operator(=) stringcontent( )inlinedelimiter(")>operator(.)ident(strip) - reserved(break) - reserved(else) - reserved(break) reserved(if) ident(rnext)operator(.)ident(nil?) reserved(or) ident(rnext)operator(.)ident(empty?) reserved(or) ident(rline)operator(.)ident(nil?) reserved(or) ident(rline)operator(.)ident(empty?) - ident(words) operator(=) ident(rnext)operator(.)ident(split)operator(()regexpoperator(\)) - ident(word) operator(=) ident(words)operator(.)ident(shift) - ident(size) operator(=) ident(width) operator(-) ident(rline)operator(.)ident(size) operator(-) integer(1) - - reserved(if) operator(()ident(size) operator(<=) integer(0)operator(\)) - ident(rnext) operator(=) stringcontent( )inlineoperator(\))inline_delimiter(})>delimiter(")>operator(.)ident(strip) - reserved(break) - reserved(end) - - ident(first) operator(=) ident(rest) operator(=) pre_constant(nil) - - reserved(if) operator(()operator(()instance_variable(@split_rules) operator(&) constant(SPLIT_HYPHENATION)operator(\)) operator(!=) integer(0)operator(\)) - reserved(if) instance_variable(@hyphenator_arity) operator(==) integer(2) - ident(first)operator(,) ident(rest) operator(=) instance_variable(@hyphenator)operator(.)ident(hyphenate_to)operator(()ident(word)operator(,) ident(size)operator(\)) - reserved(else) - ident(first)operator(,) ident(rest) operator(=) instance_variable(@hyphenator)operator(.)ident(hyphenate_to)operator(()ident(word)operator(,) ident(size)operator(,) pre_constant(self)operator(\)) - reserved(end) - reserved(end) - - ident(first)operator(,) ident(rest) operator(=) pre_constant(self)operator(.)ident(hyphenate_to)operator(()ident(word)operator(,) ident(size)operator(\)) reserved(if) operator(()operator(()instance_variable(@split_rules) operator(&) constant(SPLIT_CONTINUATION)operator(\)) operator(!=) integer(0)operator(\)) reserved(and) ident(first)operator(.)ident(nil?) - - ident(first)operator(,) ident(rest) operator(=) ident(__do_split_word)operator(()ident(word)operator(,) ident(size)operator(\)) reserved(if) operator(()operator(()instance_variable(@split_rules) operator(&) constant(SPLIT_FIXED)operator(\)) operator(!=) integer(0)operator(\)) reserved(and) ident(first)operator(.)ident(nil?) - - reserved(if) operator(()ident(rline)operator(.)ident(size) operator(+) operator(()ident(first) operator(?) ident(first)operator(.)ident(size) operator(:) integer(0)operator(\))operator(\)) operator(<) ident(width) - instance_variable(@split_words) operator(<<) constant(SplitWord)operator(.)ident(new)operator(()ident(word)operator(,) ident(first)operator(,) ident(rest)operator(\)) - ident(rline) operator(=) stringcontent( )inlinedelimiter(")>operator(.)ident(strip) - ident(rnext) operator(=) stringcontent( )inlineoperator(\))inline_delimiter(})>delimiter(")>operator(.)ident(strip) - reserved(end) - reserved(break) - reserved(end) - reserved(end) - operator([)ident(rline)operator(,) ident(rnext)operator(]) - reserved(end) - - reserved(def) method(__do_break)operator(()ident(line)operator(,) ident(next_line)operator(\)) comment(#:nodoc:) - ident(no_brk) operator(=) pre_constant(false) - ident(words) operator(=) operator([)operator(]) - ident(words) operator(=) ident(line)operator(.)ident(split)operator(()regexpoperator(\)) reserved(unless) ident(line)operator(.)ident(nil?) - ident(last_word) operator(=) ident(words)operator([)integer(-1)operator(]) - - instance_variable(@nobreak_regex)operator(.)ident(each) operator({) operator(|)ident(k)operator(,) ident(v)operator(|) ident(no_brk) operator(=) operator(()operator(()ident(last_word) operator(=)operator(~) regexpdelimiter(/)>operator(\)) reserved(and) operator(()ident(next_line) operator(=)operator(~) regexpdelimiter(/)>operator(\))operator(\)) operator(}) - - reserved(if) ident(no_brk) operator(&&) ident(words)operator(.)ident(size) operator(>) integer(1) - ident(i) operator(=) ident(words)operator(.)ident(size) - reserved(while) ident(i) operator(>) integer(0) - ident(no_brk) operator(=) pre_constant(false) - instance_variable(@nobreak_regex)operator(.)ident(each) operator({) operator(|)ident(k)operator(,) ident(v)operator(|) ident(no_brk) operator(=) operator(()operator(()ident(words)operator([)ident(i) operator(+) integer(1)operator(]) operator(=)operator(~) regexpdelimiter(/)>operator(\)) operator(&&) operator(()ident(words)operator([)ident(i)operator(]) operator(=)operator(~) regexpdelimiter(/)>operator(\))operator(\)) operator(}) - ident(i) operator(-=) integer(1) - reserved(break) reserved(if) reserved(not) ident(no_brk) - reserved(end) - reserved(if) ident(i) operator(>) integer(0) - ident(l) operator(=) ident(brk_re)operator(()ident(i)operator(\))operator(.)ident(match)operator(()ident(line)operator(\)) - ident(line)operator(.)ident(sub!)operator(()ident(brk_re)operator(()ident(i)operator(\))operator(,) ident(l)operator([)integer(1)operator(])operator(\)) - ident(next_line) operator(=) stringcontent( )inlinedelimiter(")> - ident(line)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - reserved(end) - operator([)ident(line)operator(,) ident(next_line)operator(]) - reserved(end) - - reserved(def) method(__create)operator(()ident(arg) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) comment(#:nodoc:) - comment(# Format::Text.new(text-to-wrap\)) - instance_variable(@text) operator(=) ident(arg) reserved(unless) ident(arg)operator(.)ident(nil?) - comment(# Defaults) - instance_variable(@columns) operator(=) integer(72) - instance_variable(@tabstop) operator(=) integer(8) - instance_variable(@first_indent) operator(=) integer(4) - instance_variable(@body_indent) operator(=) integer(0) - instance_variable(@format_style) operator(=) constant(LEFT_ALIGN) - instance_variable(@left_margin) operator(=) integer(0) - instance_variable(@right_margin) operator(=) integer(0) - instance_variable(@extra_space) operator(=) pre_constant(false) - instance_variable(@text) operator(=) constant(Array)operator(.)ident(new) reserved(if) instance_variable(@text)operator(.)ident(nil?) - instance_variable(@tag_paragraph) operator(=) pre_constant(false) - instance_variable(@tag_text) operator(=) constant(Array)operator(.)ident(new) - instance_variable(@tag_cur) operator(=) string - instance_variable(@abbreviations) operator(=) constant(Array)operator(.)ident(new) - instance_variable(@nobreak) operator(=) pre_constant(false) - instance_variable(@nobreak_regex) operator(=) constant(Hash)operator(.)ident(new) - instance_variable(@split_words) operator(=) constant(Array)operator(.)ident(new) - instance_variable(@hard_margins) operator(=) pre_constant(false) - instance_variable(@split_rules) operator(=) constant(SPLIT_FIXED) - instance_variable(@hyphenator) operator(=) pre_constant(self) - instance_variable(@hyphenator_arity) operator(=) pre_constant(self)operator(.)ident(method)operator(()symbol(:hyphenate_to)operator(\))operator(.)ident(arity) - - ident(instance_eval)operator(()operator(&)ident(block)operator(\)) reserved(unless) ident(block)operator(.)ident(nil?) - reserved(end) - - ident(public) - comment(# Formats text into a nice paragraph format. The text is separated) - comment(# into words and then reassembled a word at a time using the settings) - comment(# of this Format object. If a word is larger than the number of) - comment(# columns available for formatting, then that word will appear on the) - comment(# line by itself.) - comment(#) - comment(# If +to_wrap+ is +nil+, then the value of #text will be) - comment(# worked on.) - reserved(def) method(format)operator(()ident(to_wrap) operator(=) pre_constant(nil)operator(\)) - ident(to_wrap) operator(=) instance_variable(@text) reserved(if) ident(to_wrap)operator(.)ident(nil?) - reserved(if) ident(to_wrap)operator(.)ident(class) operator(==) constant(Array) - ident(__format)operator(()ident(to_wrap)operator([)integer(0)operator(])operator(\)) - reserved(else) - ident(__format)operator(()ident(to_wrap)operator(\)) - reserved(end) - reserved(end) - - comment(# Considers each element of text (provided or internal\) as a paragraph.) - comment(# If #first_indent is the same as #body_indent, then) - comment(# paragraphs will be separated by a single empty line in the result;) - comment(# otherwise, the paragraphs will follow immediately after each other.) - comment(# Uses #format to do the heavy lifting.) - reserved(def) method(paragraphs)operator(()ident(to_wrap) operator(=) pre_constant(nil)operator(\)) - ident(to_wrap) operator(=) instance_variable(@text) reserved(if) ident(to_wrap)operator(.)ident(nil?) - ident(__paragraphs)operator(()operator([)ident(to_wrap)operator(])operator(.)ident(flatten)operator(\)) - reserved(end) - - comment(# Centers the text, preserving empty lines and tabs.) - reserved(def) method(center)operator(()ident(to_center) operator(=) pre_constant(nil)operator(\)) - ident(to_center) operator(=) instance_variable(@text) reserved(if) ident(to_center)operator(.)ident(nil?) - ident(__center)operator(()operator([)ident(to_center)operator(])operator(.)ident(flatten)operator(\)) - reserved(end) - - comment(# Replaces all tab characters in the text with #tabstop spaces.) - reserved(def) method(expand)operator(()ident(to_expand) operator(=) pre_constant(nil)operator(\)) - ident(to_expand) operator(=) instance_variable(@text) reserved(if) ident(to_expand)operator(.)ident(nil?) - reserved(if) ident(to_expand)operator(.)ident(class) operator(==) constant(Array) - ident(to_expand)operator(.)ident(collect) operator({) operator(|)ident(te)operator(|) ident(__expand)operator(()ident(te)operator(\)) operator(}) - reserved(else) - ident(__expand)operator(()ident(to_expand)operator(\)) - reserved(end) - reserved(end) - - comment(# Replaces all occurrences of #tabstop consecutive spaces) - comment(# with a tab character.) - reserved(def) method(unexpand)operator(()ident(to_unexpand) operator(=) pre_constant(nil)operator(\)) - ident(to_unexpand) operator(=) instance_variable(@text) reserved(if) ident(to_unexpand)operator(.)ident(nil?) - reserved(if) ident(to_unexpand)operator(.)ident(class) operator(==) constant(Array) - ident(to_unexpand)operator(.)ident(collect) operator({) operator(|)ident(te)operator(|) ident(v) operator(<<) ident(__unexpand)operator(()ident(te)operator(\)) operator(}) - reserved(else) - ident(__unexpand)operator(()ident(to_unexpand)operator(\)) - reserved(end) - reserved(end) - - comment(# This constructor takes advantage of a technique for Ruby object) - comment(# construction introduced by Andy Hunt and Dave Thomas (see reference\),) - comment(# where optional values are set using commands in a block.) - comment(#) - comment(# Text::Format.new {) - comment(# columns = 72) - comment(# left_margin = 0) - comment(# right_margin = 0) - comment(# first_indent = 4) - comment(# body_indent = 0) - comment(# format_style = Text::Format::LEFT_ALIGN) - comment(# extra_space = false) - comment(# abbreviations = {}) - comment(# tag_paragraph = false) - comment(# tag_text = []) - comment(# nobreak = false) - comment(# nobreak_regex = {}) - comment(# tabstop = 8) - comment(# text = nil) - comment(# }) - comment(#) - comment(# As shown above, +arg+ is optional. If +arg+ is specified and is a) - comment(# +String+, then arg is used as the default value of #text.) - comment(# Alternately, an existing Text::Format object can be used or a Hash can) - comment(# be used. With all forms, a block can be specified.) - comment(#) - comment(# *Reference*:: "Object Construction and Blocks") - comment(# ) - comment(#) - reserved(def) method(initialize)operator(()ident(arg) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - reserved(case) ident(arg) - reserved(when) constant(Text)operator(::)constant(Format) - ident(__create)operator(()ident(arg)operator(.)ident(text)operator(\)) reserved(do) - instance_variable(@columns) operator(=) ident(arg)operator(.)ident(columns) - instance_variable(@tabstop) operator(=) ident(arg)operator(.)ident(tabstop) - instance_variable(@first_indent) operator(=) ident(arg)operator(.)ident(first_indent) - instance_variable(@body_indent) operator(=) ident(arg)operator(.)ident(body_indent) - instance_variable(@format_style) operator(=) ident(arg)operator(.)ident(format_style) - instance_variable(@left_margin) operator(=) ident(arg)operator(.)ident(left_margin) - instance_variable(@right_margin) operator(=) ident(arg)operator(.)ident(right_margin) - instance_variable(@extra_space) operator(=) ident(arg)operator(.)ident(extra_space) - instance_variable(@tag_paragraph) operator(=) ident(arg)operator(.)ident(tag_paragraph) - instance_variable(@tag_text) operator(=) ident(arg)operator(.)ident(tag_text) - instance_variable(@abbreviations) operator(=) ident(arg)operator(.)ident(abbreviations) - instance_variable(@nobreak) operator(=) ident(arg)operator(.)ident(nobreak) - instance_variable(@nobreak_regex) operator(=) ident(arg)operator(.)ident(nobreak_regex) - instance_variable(@text) operator(=) ident(arg)operator(.)ident(text) - instance_variable(@hard_margins) operator(=) ident(arg)operator(.)ident(hard_margins) - instance_variable(@split_words) operator(=) ident(arg)operator(.)ident(split_words) - instance_variable(@split_rules) operator(=) ident(arg)operator(.)ident(split_rules) - instance_variable(@hyphenator) operator(=) ident(arg)operator(.)ident(hyphenator) - reserved(end) - ident(instance_eval)operator(()operator(&)ident(block)operator(\)) reserved(unless) ident(block)operator(.)ident(nil?) - reserved(when) constant(Hash) - ident(__create) reserved(do) - instance_variable(@columns) operator(=) ident(arg)operator([)symbol(:columns)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@columns) - instance_variable(@tabstop) operator(=) ident(arg)operator([)symbol(:tabstop)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@tabstop) - instance_variable(@first_indent) operator(=) ident(arg)operator([)symbol(:first_indent)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@first_indent) - instance_variable(@body_indent) operator(=) ident(arg)operator([)symbol(:body_indent)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@body_indent) - instance_variable(@format_style) operator(=) ident(arg)operator([)symbol(:format_style)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@format_style) - instance_variable(@left_margin) operator(=) ident(arg)operator([)symbol(:left_margin)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@left_margin) - instance_variable(@right_margin) operator(=) ident(arg)operator([)symbol(:right_margin)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@right_margin) - instance_variable(@extra_space) operator(=) ident(arg)operator([)symbol(:extra_space)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@extra_space) - instance_variable(@text) operator(=) ident(arg)operator([)symbol(:text)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@text) - instance_variable(@tag_paragraph) operator(=) ident(arg)operator([)symbol(:tag_paragraph)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@tag_paragraph) - instance_variable(@tag_text) operator(=) ident(arg)operator([)symbol(:tag_text)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@tag_text) - instance_variable(@abbreviations) operator(=) ident(arg)operator([)symbol(:abbreviations)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@abbreviations) - instance_variable(@nobreak) operator(=) ident(arg)operator([)symbol(:nobreak)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@nobreak) - instance_variable(@nobreak_regex) operator(=) ident(arg)operator([)symbol(:nobreak_regex)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@nobreak_regex) - instance_variable(@hard_margins) operator(=) ident(arg)operator([)symbol(:hard_margins)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@hard_margins) - instance_variable(@split_rules) operator(=) ident(arg)operator([)symbol(:split_rules)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@split_rules) - instance_variable(@hyphenator) operator(=) ident(arg)operator([)symbol(:hyphenator)operator(]) operator(||) ident(arg)operator([)stringoperator(]) operator(||) instance_variable(@hyphenator) - reserved(end) - ident(instance_eval)operator(()operator(&)ident(block)operator(\)) reserved(unless) ident(block)operator(.)ident(nil?) - reserved(when) constant(String) - ident(__create)operator(()ident(arg)operator(,) operator(&)ident(block)operator(\)) - reserved(when) constant(NilClass) - ident(__create)operator(()operator(&)ident(block)operator(\)) - reserved(else) - ident(raise) constant(TypeError) - reserved(end) - reserved(end) - reserved(end) -reserved(end) - -reserved(if) pre_constant(__FILE__) operator(==) global_variable($0) - ident(require) string - - reserved(class) class(TestText__Format) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) comment(#:nodoc:) - ident(attr_accessor) symbol(:format_o) - - constant(GETTYSBURG) operator(=) stringstring - - constant(FIVE_COL) operator(=) string - - constant(FIVE_CNT) operator(=) string - - comment(# Tests both abbreviations and abbreviations=) - reserved(def) method(test_abbreviations) - ident(abbr) operator(=) operator([)stringoperator(,) stringoperator(]) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()operator([)operator(])operator(,) instance_variable(@format_o)operator(.)ident(abbreviations)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(abbreviations) operator(=) operator([) stringoperator(,) string operator(]) operator(}) - ident(assert_equal)operator(()operator([) stringoperator(,) string operator(])operator(,) instance_variable(@format_o)operator(.)ident(abbreviations)operator(\)) - ident(assert_equal)operator(()ident(abbr)operator([)integer(0)operator(])operator(,) instance_variable(@format_o)operator(.)ident(format)operator(()ident(abbr)operator([)integer(0)operator(])operator(\))operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(extra_space) operator(=) pre_constant(true) operator(}) - ident(assert_equal)operator(()ident(abbr)operator([)integer(1)operator(])operator(,) instance_variable(@format_o)operator(.)ident(format)operator(()ident(abbr)operator([)integer(0)operator(])operator(\))operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(abbreviations) operator(=) operator([) string operator(]) operator(}) - ident(assert_equal)operator(()operator([) string operator(])operator(,) instance_variable(@format_o)operator(.)ident(abbreviations)operator(\)) - ident(assert_equal)operator(()ident(abbr)operator([)integer(0)operator(])operator(,) instance_variable(@format_o)operator(.)ident(format)operator(()ident(abbr)operator([)integer(0)operator(])operator(\))operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(extra_space) operator(=) pre_constant(false) operator(}) - ident(assert_equal)operator(()ident(abbr)operator([)integer(0)operator(])operator(,) instance_variable(@format_o)operator(.)ident(format)operator(()ident(abbr)operator([)integer(0)operator(])operator(\))operator(\)) - reserved(end) - - comment(# Tests both body_indent and body_indent=) - reserved(def) method(test_body_indent) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()integer(0)operator(,) instance_variable(@format_o)operator(.)ident(body_indent)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(body_indent) operator(=) integer(7) operator(}) - ident(assert_equal)operator(()integer(7)operator(,) instance_variable(@format_o)operator(.)ident(body_indent)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(body_indent) operator(=) integer(-3) operator(}) - ident(assert_equal)operator(()integer(3)operator(,) instance_variable(@format_o)operator(.)ident(body_indent)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(body_indent) operator(=) string operator(}) - ident(assert_equal)operator(()integer(9)operator(,) instance_variable(@format_o)operator(.)ident(body_indent)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(body_indent) operator(=) string operator(}) - ident(assert_equal)operator(()integer(2)operator(,) instance_variable(@format_o)operator(.)ident(body_indent)operator(\)) - ident(assert_match)operator(()regexpoperator(,) instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator([)integer(1)operator(])operator(\)) - reserved(end) - - comment(# Tests both columns and columns=) - reserved(def) method(test_columns) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()integer(72)operator(,) instance_variable(@format_o)operator(.)ident(columns)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(columns) operator(=) integer(7) operator(}) - ident(assert_equal)operator(()integer(7)operator(,) instance_variable(@format_o)operator(.)ident(columns)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(columns) operator(=) integer(-3) operator(}) - ident(assert_equal)operator(()integer(3)operator(,) instance_variable(@format_o)operator(.)ident(columns)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(columns) operator(=) string operator(}) - ident(assert_equal)operator(()integer(9)operator(,) instance_variable(@format_o)operator(.)ident(columns)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(columns) operator(=) string operator(}) - ident(assert_equal)operator(()integer(2)operator(,) instance_variable(@format_o)operator(.)ident(columns)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(columns) operator(=) integer(40) operator(}) - ident(assert_equal)operator(()integer(40)operator(,) instance_variable(@format_o)operator(.)ident(columns)operator(\)) - ident(assert_match)operator(()regexpoperator(,) - instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator([)integer(1)operator(])operator(\)) - reserved(end) - - comment(# Tests both extra_space and extra_space=) - reserved(def) method(test_extra_space) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(extra_space)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(extra_space) operator(=) pre_constant(true) operator(}) - ident(assert)operator(()instance_variable(@format_o)operator(.)ident(extra_space)operator(\)) - comment(# The behaviour of extra_space is tested in test_abbreviations. There) - comment(# is no need to reproduce it here.) - reserved(end) - - comment(# Tests both first_indent and first_indent=) - reserved(def) method(test_first_indent) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()integer(4)operator(,) instance_variable(@format_o)operator(.)ident(first_indent)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(first_indent) operator(=) integer(7) operator(}) - ident(assert_equal)operator(()integer(7)operator(,) instance_variable(@format_o)operator(.)ident(first_indent)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(first_indent) operator(=) integer(-3) operator(}) - ident(assert_equal)operator(()integer(3)operator(,) instance_variable(@format_o)operator(.)ident(first_indent)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(first_indent) operator(=) string operator(}) - ident(assert_equal)operator(()integer(9)operator(,) instance_variable(@format_o)operator(.)ident(first_indent)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(first_indent) operator(=) string operator(}) - ident(assert_equal)operator(()integer(2)operator(,) instance_variable(@format_o)operator(.)ident(first_indent)operator(\)) - ident(assert_match)operator(()regexpoperator(,) instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator([)integer(0)operator(])operator(\)) - reserved(end) - - reserved(def) method(test_format_style) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()constant(Text)operator(::)constant(Format)operator(::)constant(LEFT_ALIGN)operator(,) instance_variable(@format_o)operator(.)ident(format_style)operator(\)) - ident(assert_match)operator(()regexpoperator(,) - instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator([)integer(-1)operator(])operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_ALIGN) - operator(}) - ident(assert_equal)operator(()constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_ALIGN)operator(,) instance_variable(@format_o)operator(.)ident(format_style)operator(\)) - ident(assert_match)operator(()regexpoperator(,) - instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator([)integer(-1)operator(])operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_FILL) - operator(}) - ident(assert_equal)operator(()constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_FILL)operator(,) instance_variable(@format_o)operator(.)ident(format_style)operator(\)) - ident(assert_match)operator(()regexpoperator(,) - instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator([)integer(-1)operator(])operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(JUSTIFY) operator(}) - ident(assert_equal)operator(()constant(Text)operator(::)constant(Format)operator(::)constant(JUSTIFY)operator(,) instance_variable(@format_o)operator(.)ident(format_style)operator(\)) - ident(assert_match)operator(()regexpoperator(,) - instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator([)integer(-3)operator(])operator(\)) - ident(assert_raises)operator(()constant(ArgumentError)operator(\)) operator({) instance_variable(@format_o)operator(.)ident(format_style) operator(=) integer(33) operator(}) - reserved(end) - - reserved(def) method(test_tag_paragraph) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(tag_paragraph)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(tag_paragraph) operator(=) pre_constant(true) operator(}) - ident(assert)operator(()instance_variable(@format_o)operator(.)ident(tag_paragraph)operator(\)) - ident(assert_not_equal)operator(()instance_variable(@format_o)operator(.)ident(paragraphs)operator(()operator([)constant(GETTYSBURG)operator(,) constant(GETTYSBURG)operator(])operator(\))operator(,) - constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(paragraphs)operator(()operator([)constant(GETTYSBURG)operator(,) constant(GETTYSBURG)operator(])operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_tag_text) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()operator([)operator(])operator(,) instance_variable(@format_o)operator(.)ident(tag_text)operator(\)) - ident(assert_equal)operator(()instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(,) - constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(tag_paragraph) operator(=) pre_constant(true) - instance_variable(@format_o)operator(.)ident(tag_text) operator(=) operator([)stringoperator(,) stringoperator(]) - operator(}) - ident(assert_not_equal)operator(()instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(,) - constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(\)) - ident(assert_not_equal)operator(()instance_variable(@format_o)operator(.)ident(paragraphs)operator(()operator([)constant(GETTYSBURG)operator(,) constant(GETTYSBURG)operator(])operator(\))operator(,) - constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(paragraphs)operator(()operator([)constant(GETTYSBURG)operator(,) constant(GETTYSBURG)operator(])operator(\))operator(\)) - ident(assert_not_equal)operator(()instance_variable(@format_o)operator(.)ident(paragraphs)operator(()operator([)constant(GETTYSBURG)operator(,) constant(GETTYSBURG)operator(,) - constant(GETTYSBURG)operator(])operator(\))operator(,) - constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(paragraphs)operator(()operator([)constant(GETTYSBURG)operator(,) constant(GETTYSBURG)operator(,) - constant(GETTYSBURG)operator(])operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_justify?) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(justify?)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_ALIGN) - operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(justify?)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_FILL) - operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(justify?)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(JUSTIFY) - operator(}) - ident(assert)operator(()instance_variable(@format_o)operator(.)ident(justify?)operator(\)) - comment(# The format testing is done in test_format_style) - reserved(end) - - reserved(def) method(test_left_align?) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert)operator(()instance_variable(@format_o)operator(.)ident(left_align?)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_ALIGN) - operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(left_align?)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_FILL) - operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(left_align?)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(JUSTIFY) operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(left_align?)operator(\)) - comment(# The format testing is done in test_format_style) - reserved(end) - - reserved(def) method(test_left_margin) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()integer(0)operator(,) instance_variable(@format_o)operator(.)ident(left_margin)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(left_margin) operator(=) integer(-3) operator(}) - ident(assert_equal)operator(()integer(3)operator(,) instance_variable(@format_o)operator(.)ident(left_margin)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(left_margin) operator(=) string operator(}) - ident(assert_equal)operator(()integer(9)operator(,) instance_variable(@format_o)operator(.)ident(left_margin)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(left_margin) operator(=) string operator(}) - ident(assert_equal)operator(()integer(2)operator(,) instance_variable(@format_o)operator(.)ident(left_margin)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(left_margin) operator(=) integer(7) operator(}) - ident(assert_equal)operator(()integer(7)operator(,) instance_variable(@format_o)operator(.)ident(left_margin)operator(\)) - ident(assert_nothing_raised) operator({) - ident(ft) operator(=) instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(.)ident(split)operator(()stringoperator(\)) - ident(assert_match)operator(()regexpoperator(,) ident(ft)operator([)integer(0)operator(])operator(\)) - ident(assert_match)operator(()regexpoperator(,) ident(ft)operator([)integer(-1)operator(])operator(\)) - operator(}) - reserved(end) - - reserved(def) method(test_hard_margins) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(hard_margins)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(hard_margins) operator(=) pre_constant(true) - instance_variable(@format_o)operator(.)ident(columns) operator(=) integer(5) - instance_variable(@format_o)operator(.)ident(first_indent) operator(=) integer(0) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_FILL) - operator(}) - ident(assert)operator(()instance_variable(@format_o)operator(.)ident(hard_margins)operator(\)) - ident(assert_equal)operator(()constant(FIVE_COL)operator(,) instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(split_rules) operator(|=) constant(Text)operator(::)constant(Format)operator(::)constant(SPLIT_CONTINUATION) - ident(assert_equal)operator(()constant(Text)operator(::)constant(Format)operator(::)constant(SPLIT_CONTINUATION_FIXED)operator(,) - instance_variable(@format_o)operator(.)ident(split_rules)operator(\)) - operator(}) - ident(assert_equal)operator(()constant(FIVE_CNT)operator(,) instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(\)) - reserved(end) - - comment(# Tests both nobreak and nobreak_regex, since one is only useful) - comment(# with the other.) - reserved(def) method(test_nobreak) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(nobreak)operator(\)) - ident(assert)operator(()instance_variable(@format_o)operator(.)ident(nobreak_regex)operator(.)ident(empty?)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(nobreak) operator(=) pre_constant(true) - instance_variable(@format_o)operator(.)ident(nobreak_regex) operator(=) operator({) string operator(=)operator(>) string operator(}) - instance_variable(@format_o)operator(.)ident(columns) operator(=) integer(77) - operator(}) - ident(assert)operator(()instance_variable(@format_o)operator(.)ident(nobreak)operator(\)) - ident(assert_equal)operator(()operator({) string operator(=)operator(>) string operator(})operator(,) instance_variable(@format_o)operator(.)ident(nobreak_regex)operator(\)) - ident(assert_match)operator(()regexpoperator(,) - instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator([)integer(1)operator(])operator(\)) - reserved(end) - - reserved(def) method(test_right_align?) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(right_align?)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_ALIGN) - operator(}) - ident(assert)operator(()instance_variable(@format_o)operator(.)ident(right_align?)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_FILL) - operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(right_align?)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(JUSTIFY) operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(right_align?)operator(\)) - comment(# The format testing is done in test_format_style) - reserved(end) - - reserved(def) method(test_right_fill?) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(right_fill?)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_ALIGN) - operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(right_fill?)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(RIGHT_FILL) - operator(}) - ident(assert)operator(()instance_variable(@format_o)operator(.)ident(right_fill?)operator(\)) - ident(assert_nothing_raised) operator({) - instance_variable(@format_o)operator(.)ident(format_style) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(JUSTIFY) - operator(}) - ident(assert)operator(()operator(!)instance_variable(@format_o)operator(.)ident(right_fill?)operator(\)) - comment(# The format testing is done in test_format_style) - reserved(end) - - reserved(def) method(test_right_margin) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()integer(0)operator(,) instance_variable(@format_o)operator(.)ident(right_margin)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(right_margin) operator(=) integer(-3) operator(}) - ident(assert_equal)operator(()integer(3)operator(,) instance_variable(@format_o)operator(.)ident(right_margin)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(right_margin) operator(=) string operator(}) - ident(assert_equal)operator(()integer(9)operator(,) instance_variable(@format_o)operator(.)ident(right_margin)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(right_margin) operator(=) string operator(}) - ident(assert_equal)operator(()integer(2)operator(,) instance_variable(@format_o)operator(.)ident(right_margin)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(right_margin) operator(=) integer(7) operator(}) - ident(assert_equal)operator(()integer(7)operator(,) instance_variable(@format_o)operator(.)ident(right_margin)operator(\)) - ident(assert_nothing_raised) operator({) - ident(ft) operator(=) instance_variable(@format_o)operator(.)ident(format)operator(()constant(GETTYSBURG)operator(\))operator(.)ident(split)operator(()stringoperator(\)) - ident(assert_match)operator(()regexpoperator(,) ident(ft)operator([)integer(0)operator(])operator(\)) - ident(assert_match)operator(()regexpoperator(,) ident(ft)operator([)integer(-1)operator(])operator(\)) - operator(}) - reserved(end) - - reserved(def) method(test_tabstop) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()integer(8)operator(,) instance_variable(@format_o)operator(.)ident(tabstop)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(tabstop) operator(=) integer(7) operator(}) - ident(assert_equal)operator(()integer(7)operator(,) instance_variable(@format_o)operator(.)ident(tabstop)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(tabstop) operator(=) integer(-3) operator(}) - ident(assert_equal)operator(()integer(3)operator(,) instance_variable(@format_o)operator(.)ident(tabstop)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(tabstop) operator(=) string operator(}) - ident(assert_equal)operator(()integer(9)operator(,) instance_variable(@format_o)operator(.)ident(tabstop)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(tabstop) operator(=) string operator(}) - ident(assert_equal)operator(()integer(2)operator(,) instance_variable(@format_o)operator(.)ident(tabstop)operator(\)) - reserved(end) - - reserved(def) method(test_text) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()operator([)operator(])operator(,) instance_variable(@format_o)operator(.)ident(text)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(text) operator(=) string operator(}) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@format_o)operator(.)ident(text)operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(text) operator(=) operator([)stringoperator(,) stringoperator(]) operator(}) - ident(assert_equal)operator(()operator([)stringoperator(,) stringoperator(])operator(,) instance_variable(@format_o)operator(.)ident(text)operator(\)) - reserved(end) - - reserved(def) method(test_s_new) - comment(# new(NilClass\) { block }) - ident(assert_nothing_raised) reserved(do) - instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator({) - pre_constant(self)operator(.)ident(text) operator(=) string - operator(}) - reserved(end) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@format_o)operator(.)ident(text)operator(\)) - - comment(# new(Hash Symbols\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(()symbol(:columns) operator(=)operator(>) integer(72)operator(\)) operator(}) - ident(assert_equal)operator(()integer(72)operator(,) instance_variable(@format_o)operator(.)ident(columns)operator(\)) - - comment(# new(Hash String\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(()string operator(=)operator(>) integer(72)operator(\)) operator(}) - ident(assert_equal)operator(()integer(72)operator(,) instance_variable(@format_o)operator(.)ident(columns)operator(\)) - - comment(# new(Hash\) { block }) - ident(assert_nothing_raised) reserved(do) - instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(()string operator(=)operator(>) integer(80)operator(\)) operator({) - pre_constant(self)operator(.)ident(text) operator(=) string - operator(}) - reserved(end) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@format_o)operator(.)ident(text)operator(\)) - ident(assert_equal)operator(()integer(80)operator(,) instance_variable(@format_o)operator(.)ident(columns)operator(\)) - - comment(# new(Text::Format\)) - ident(assert_nothing_raised) reserved(do) - ident(fo) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(()instance_variable(@format_o)operator(\)) - ident(assert)operator(()ident(fo) operator(==) instance_variable(@format_o)operator(\)) - reserved(end) - - comment(# new(Text::Format\) { block }) - ident(assert_nothing_raised) reserved(do) - ident(fo) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(()instance_variable(@format_o)operator(\)) operator({) pre_constant(self)operator(.)ident(columns) operator(=) integer(79) operator(}) - ident(assert)operator(()ident(fo) operator(!=) instance_variable(@format_o)operator(\)) - reserved(end) - - comment(# new(String\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(()stringoperator(\)) operator(}) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@format_o)operator(.)ident(text)operator(\)) - - comment(# new(String\) { block }) - ident(assert_nothing_raised) reserved(do) - instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(()stringoperator(\)) operator({) pre_constant(self)operator(.)ident(columns) operator(=) integer(-5) operator(}) - reserved(end) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@format_o)operator(.)ident(text)operator(\)) - ident(assert_equal)operator(()integer(5)operator(,) instance_variable(@format_o)operator(.)ident(columns)operator(\)) - reserved(end) - - reserved(def) method(test_center) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_nothing_raised) reserved(do) - ident(ct) operator(=) instance_variable(@format_o)operator(.)ident(center)operator(()constant(GETTYSBURG)operator(.)ident(split)operator(()stringoperator(\))operator(\))operator(.)ident(split)operator(()stringoperator(\)) - ident(assert_match)operator(()regexpoperator(,) ident(ct)operator([)integer(0)operator(])operator(\)) - ident(assert_match)operator(()regexpoperator(,) ident(ct)operator([)integer(-3)operator(])operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_expand) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@format_o)operator(.)ident(expand)operator(()stringoperator(\))operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(tabstop) operator(=) integer(4) operator(}) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@format_o)operator(.)ident(expand)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_unexpand) - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new) operator(}) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@format_o)operator(.)ident(unexpand)operator(()stringoperator(\))operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(tabstop) operator(=) integer(4) operator(}) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@format_o)operator(.)ident(unexpand)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_space_only) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(format)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(format)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(format)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(format)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(paragraphs)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(paragraphs)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(paragraphs)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(paragraphs)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(paragraphs)operator(()operator([)stringoperator(])operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(paragraphs)operator(()operator([)stringoperator(])operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(paragraphs)operator(()operator([)stringoperator(])operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(.)ident(paragraphs)operator(()operator([)stringoperator(])operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_splendiferous) - ident(h) operator(=) pre_constant(nil) - ident(test) operator(=) string - ident(assert_nothing_raised) operator({) instance_variable(@format_o) operator(=) constant(Text)operator(::)constant(Format)operator(.)ident(new)operator(()symbol(:columns) operator(=)operator(>) integer(6)operator(,) symbol(:left_margin) operator(=)operator(>) integer(0)operator(,) symbol(:indent) operator(=)operator(>) integer(0)operator(,) symbol(:first_indent) operator(=)operator(>) integer(0)operator(\)) operator(}) - ident(assert_match)operator(()regexpoperator(,) instance_variable(@format_o)operator(.)ident(format)operator(()ident(test)operator(\))operator(\)) - ident(assert_nothing_raised) operator({) instance_variable(@format_o)operator(.)ident(hard_margins) operator(=) pre_constant(true) operator(}) - ident(assert_match)operator(()regexpoperator(,) instance_variable(@format_o)operator(.)ident(format)operator(()ident(test)operator(\))operator(\)) - ident(assert_nothing_raised) operator({) ident(h) operator(=) constant(Object)operator(.)ident(new) operator(}) - ident(assert_nothing_raised) reserved(do) - instance_variable(@format_o)operator(.)ident(split_rules) operator(=) constant(Text)operator(::)constant(Format)operator(::)constant(SPLIT_HYPHENATION) - reserved(class) operator(<<) class(h) comment(#:nodoc:) - reserved(def) method(hyphenate_to)operator(()ident(word)operator(,) ident(size)operator(\)) - reserved(return) operator([)stringoperator(,) ident(word)operator(]) reserved(if) ident(size) operator(<) integer(2) - operator([)ident(word)operator([)integer(0) operator(...) ident(size)operator(])operator(,) ident(word)operator([)ident(size) operator(..) integer(-1)operator(])operator(]) - reserved(end) - reserved(end) - instance_variable(@format_o)operator(.)ident(hyphenator) operator(=) ident(h) - reserved(end) - ident(assert_match)operator(()regexpoperator(,) instance_variable(@format_o)operator(.)ident(format)operator(()ident(test)operator(\))operator(\)) - ident(assert_nothing_raised) operator({) ident(h) operator(=) constant(Object)operator(.)ident(new) operator(}) - ident(assert_nothing_raised) reserved(do) - reserved(class) operator(<<) class(h) comment(#:nodoc:) - reserved(def) method(hyphenate_to)operator(()ident(word)operator(,) ident(size)operator(,) ident(formatter)operator(\)) - reserved(return) operator([)stringoperator(,) ident(word)operator(]) reserved(if) ident(word)operator(.)ident(size) operator(<) ident(formatter)operator(.)ident(columns) - operator([)ident(word)operator([)integer(0) operator(...) ident(size)operator(])operator(,) ident(word)operator([)ident(size) operator(..) integer(-1)operator(])operator(]) - reserved(end) - reserved(end) - instance_variable(@format_o)operator(.)ident(hyphenator) operator(=) ident(h) - reserved(end) - ident(assert_match)operator(()regexpoperator(,) instance_variable(@format_o)operator(.)ident(format)operator(()ident(test)operator(\))operator(\)) - reserved(end) - reserved(end) -reserved(end) -comment(#) -comment(# address.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -ident(require) string -ident(require) string - - -reserved(module) class(TMail) - - reserved(class) class(Address) - - ident(include) constant(TextUtils) - - reserved(def) constant(Address)operator(.)method(parse)operator(() ident(str) operator(\)) - constant(Parser)operator(.)ident(parse) symbol(:ADDRESS)operator(,) ident(str) - reserved(end) - - reserved(def) method(address_group?) - pre_constant(false) - reserved(end) - - reserved(def) method(initialize)operator(() ident(local)operator(,) ident(domain) operator(\)) - reserved(if) ident(domain) - ident(domain)operator(.)ident(each) reserved(do) operator(|)ident(s)operator(|) - ident(raise) constant(SyntaxError)operator(,) string reserved(if) ident(s)operator(.)ident(empty?) - reserved(end) - reserved(end) - instance_variable(@local) operator(=) ident(local) - instance_variable(@domain) operator(=) ident(domain) - instance_variable(@name) operator(=) pre_constant(nil) - instance_variable(@routes) operator(=) operator([)operator(]) - reserved(end) - - ident(attr_reader) symbol(:name) - - reserved(def) method(name=)operator(() ident(str) operator(\)) - instance_variable(@name) operator(=) ident(str) - instance_variable(@name) operator(=) pre_constant(nil) reserved(if) ident(str) reserved(and) ident(str)operator(.)ident(empty?) - reserved(end) - - reserved(alias) method(phrase) method(name) - reserved(alias) method(phrase=) method(name=) - - ident(attr_reader) symbol(:routes) - - reserved(def) method(inspect) - stringcontent( )inlinecontent(>)delimiter(")> - reserved(end) - - reserved(def) method(local) - reserved(return) pre_constant(nil) reserved(unless) instance_variable(@local) - reserved(return) string reserved(if) instance_variable(@local)operator(.)ident(size) operator(==) integer(1) reserved(and) instance_variable(@local)operator([)integer(0)operator(])operator(.)ident(empty?) - instance_variable(@local)operator(.)ident(map) operator({)operator(|)ident(i)operator(|) ident(quote_atom)operator(()ident(i)operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(domain) - reserved(return) pre_constant(nil) reserved(unless) instance_variable(@domain) - ident(join_domain)operator(()instance_variable(@domain)operator(\)) - reserved(end) - - reserved(def) method(spec) - ident(s) operator(=) pre_constant(self)operator(.)ident(local) - ident(d) operator(=) pre_constant(self)operator(.)ident(domain) - reserved(if) ident(s) reserved(and) ident(d) - ident(s) operator(+) string operator(+) ident(d) - reserved(else) - ident(s) - reserved(end) - reserved(end) - - reserved(alias) method(address) method(spec) - - - reserved(def) method(==)operator(() ident(other) operator(\)) - ident(other)operator(.)ident(respond_to?) symbol(:spec) reserved(and) pre_constant(self)operator(.)ident(spec) operator(==) ident(other)operator(.)ident(spec) - reserved(end) - - reserved(alias) method(eql?) method(==) - - reserved(def) method(hash) - instance_variable(@local)operator(.)ident(hash) operator(^) instance_variable(@domain)operator(.)ident(hash) - reserved(end) - - reserved(def) method(dup) - ident(obj) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(new)operator(()instance_variable(@local)operator(.)ident(dup)operator(,) instance_variable(@domain)operator(.)ident(dup)operator(\)) - ident(obj)operator(.)ident(name) operator(=) instance_variable(@name)operator(.)ident(dup) reserved(if) instance_variable(@name) - ident(obj)operator(.)ident(routes)operator(.)ident(replace) instance_variable(@routes) - ident(obj) - reserved(end) - - ident(include) constant(StrategyInterface) - - reserved(def) method(accept)operator(() ident(strategy)operator(,) ident(dummy1) operator(=) pre_constant(nil)operator(,) ident(dummy2) operator(=) pre_constant(nil) operator(\)) - reserved(unless) instance_variable(@local) - ident(strategy)operator(.)ident(meta) string)delimiter(')> comment(# empty return-path) - reserved(return) - reserved(end) - - ident(spec_p) operator(=) operator(()reserved(not) instance_variable(@name) reserved(and) instance_variable(@routes)operator(.)ident(empty?)operator(\)) - reserved(if) instance_variable(@name) - ident(strategy)operator(.)ident(phrase) instance_variable(@name) - ident(strategy)operator(.)ident(space) - reserved(end) - ident(tmp) operator(=) ident(spec_p) operator(?) string operator(:) string - reserved(unless) instance_variable(@routes)operator(.)ident(empty?) - ident(tmp) operator(<<) instance_variable(@routes)operator(.)ident(map) operator({)operator(|)ident(i)operator(|) string operator(+) ident(i) operator(})operator(.)ident(join)operator(()stringoperator(\)) operator(<<) string - reserved(end) - ident(tmp) operator(<<) pre_constant(self)operator(.)ident(spec) - ident(tmp) operator(<<) string)delimiter(')> reserved(unless) ident(spec_p) - ident(strategy)operator(.)ident(meta) ident(tmp) - ident(strategy)operator(.)ident(lwsp) string - reserved(end) - - reserved(end) - - - reserved(class) class(AddressGroup) - - ident(include) constant(Enumerable) - - reserved(def) method(address_group?) - pre_constant(true) - reserved(end) - - reserved(def) method(initialize)operator(() ident(name)operator(,) ident(addrs) operator(\)) - instance_variable(@name) operator(=) ident(name) - instance_variable(@addresses) operator(=) ident(addrs) - reserved(end) - - ident(attr_reader) symbol(:name) - - reserved(def) method(==)operator(() ident(other) operator(\)) - ident(other)operator(.)ident(respond_to?) symbol(:to_a) reserved(and) instance_variable(@addresses) operator(==) ident(other)operator(.)ident(to_a) - reserved(end) - - reserved(alias) method(eql?) method(==) - - reserved(def) method(hash) - ident(map) operator({)operator(|)ident(i)operator(|) ident(i)operator(.)ident(hash) operator(})operator(.)ident(hash) - reserved(end) - - reserved(def) method([])operator(() ident(idx) operator(\)) - instance_variable(@addresses)operator([)ident(idx)operator(]) - reserved(end) - - reserved(def) method(size) - instance_variable(@addresses)operator(.)ident(size) - reserved(end) - - reserved(def) method(empty?) - instance_variable(@addresses)operator(.)ident(empty?) - reserved(end) - - reserved(def) method(each)operator(() operator(&)ident(block) operator(\)) - instance_variable(@addresses)operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(to_a) - instance_variable(@addresses)operator(.)ident(dup) - reserved(end) - - reserved(alias) method(to_ary) method(to_a) - - reserved(def) method(include?)operator(() ident(a) operator(\)) - instance_variable(@addresses)operator(.)ident(include?) ident(a) - reserved(end) - - reserved(def) method(flatten) - ident(set) operator(=) operator([)operator(]) - instance_variable(@addresses)operator(.)ident(each) reserved(do) operator(|)ident(a)operator(|) - reserved(if) ident(a)operator(.)ident(respond_to?) symbol(:flatten) - ident(set)operator(.)ident(concat) ident(a)operator(.)ident(flatten) - reserved(else) - ident(set)operator(.)ident(push) ident(a) - reserved(end) - reserved(end) - ident(set) - reserved(end) - - reserved(def) method(each_address)operator(() operator(&)ident(block) operator(\)) - ident(flatten)operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(add)operator(() ident(a) operator(\)) - instance_variable(@addresses)operator(.)ident(push) ident(a) - reserved(end) - - reserved(alias) method(push) method(add) - - reserved(def) method(delete)operator(() ident(a) operator(\)) - instance_variable(@addresses)operator(.)ident(delete) ident(a) - reserved(end) - - ident(include) constant(StrategyInterface) - - reserved(def) method(accept)operator(() ident(strategy)operator(,) ident(dummy1) operator(=) pre_constant(nil)operator(,) ident(dummy2) operator(=) pre_constant(nil) operator(\)) - ident(strategy)operator(.)ident(phrase) instance_variable(@name) - ident(strategy)operator(.)ident(meta) string - ident(strategy)operator(.)ident(space) - ident(first) operator(=) pre_constant(true) - ident(each) reserved(do) operator(|)ident(mbox)operator(|) - reserved(if) ident(first) - ident(first) operator(=) pre_constant(false) - reserved(else) - ident(strategy)operator(.)ident(meta) string - reserved(end) - ident(strategy)operator(.)ident(space) - ident(mbox)operator(.)ident(accept) ident(strategy) - reserved(end) - ident(strategy)operator(.)ident(meta) string - ident(strategy)operator(.)ident(lwsp) string - reserved(end) - - reserved(end) - -reserved(end) comment(# module TMail) -ident(require) string - -reserved(module) class(TMail) - reserved(class) class(Attachment) operator(<) constant(StringIO) - ident(attr_accessor) symbol(:original_filename)operator(,) symbol(:content_type) - reserved(end) - - reserved(class) class(Mail) - reserved(def) method(has_attachments?) - ident(multipart?) operator(&&) ident(parts)operator(.)ident(any?) operator({) operator(|)ident(part)operator(|) ident(attachment?)operator(()ident(part)operator(\)) operator(}) - reserved(end) - - reserved(def) method(attachment?)operator(()ident(part)operator(\)) - operator(()ident(part)operator([)stringoperator(]) operator(&&) ident(part)operator([)stringoperator(])operator(.)ident(disposition) operator(==) stringoperator(\)) operator(||) - ident(part)operator(.)ident(header)operator([)stringoperator(])operator(.)ident(main_type) operator(!=) string - reserved(end) - - reserved(def) method(attachments) - reserved(if) ident(multipart?) - ident(parts)operator(.)ident(collect) operator({) operator(|)ident(part)operator(|) - reserved(if) ident(attachment?)operator(()ident(part)operator(\)) - ident(content) operator(=) ident(part)operator(.)ident(body) comment(# unquoted automatically by TMail#body) - ident(file_name) operator(=) operator(()ident(part)operator([)stringoperator(]) operator(&&) - ident(part)operator([)stringoperator(])operator(.)ident(body)operator(\)) operator(||) - ident(part)operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) operator(||) - ident(part)operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - - reserved(next) reserved(if) ident(file_name)operator(.)ident(blank?) operator(||) ident(content)operator(.)ident(blank?) - - ident(attachment) operator(=) constant(Attachment)operator(.)ident(new)operator(()ident(content)operator(\)) - ident(attachment)operator(.)ident(original_filename) operator(=) ident(file_name)operator(.)ident(strip) - ident(attachment)operator(.)ident(content_type) operator(=) ident(part)operator(.)ident(content_type) - ident(attachment) - reserved(end) - operator(})operator(.)ident(compact) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -comment(#) -comment(# base64.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -reserved(module) class(TMail) - - reserved(module) class(Base64) - - ident(module_function) - - reserved(def) method(rb_folding_encode)operator(() ident(str)operator(,) ident(eol) operator(=) stringoperator(,) ident(limit) operator(=) integer(60) operator(\)) - operator([)ident(str)operator(])operator(.)ident(pack)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(rb_encode)operator(() ident(str) operator(\)) - operator([)ident(str)operator(])operator(.)ident(pack)operator(()stringoperator(\))operator(.)ident(tr)operator(() stringoperator(,) string operator(\)) - reserved(end) - - reserved(def) method(rb_decode)operator(() ident(str)operator(,) ident(strict) operator(=) pre_constant(false) operator(\)) - ident(str)operator(.)ident(unpack)operator(()stringoperator(\)) - reserved(end) - - reserved(begin) - ident(require) string - reserved(alias) method(folding_encode) method(c_folding_encode) - reserved(alias) method(encode) method(c_encode) - reserved(alias) method(decode) method(c_decode) - reserved(class) operator(<<) class(self) - reserved(alias) method(folding_encode) method(c_folding_encode) - reserved(alias) method(encode) method(c_encode) - reserved(alias) method(decode) method(c_decode) - reserved(end) - reserved(rescue) constant(LoadError) - reserved(alias) method(folding_encode) method(rb_folding_encode) - reserved(alias) method(encode) method(rb_encode) - reserved(alias) method(decode) method(rb_decode) - reserved(class) operator(<<) class(self) - reserved(alias) method(folding_encode) method(rb_folding_encode) - reserved(alias) method(encode) method(rb_encode) - reserved(alias) method(decode) method(rb_decode) - reserved(end) - reserved(end) - - reserved(end) - -reserved(end) -comment(#) -comment(# config.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -reserved(module) class(TMail) - - reserved(class) class(Config) - - reserved(def) method(initialize)operator(() ident(strict) operator(\)) - instance_variable(@strict_parse) operator(=) ident(strict) - instance_variable(@strict_base64decode) operator(=) ident(strict) - reserved(end) - - reserved(def) method(strict_parse?) - instance_variable(@strict_parse) - reserved(end) - - ident(attr_writer) symbol(:strict_parse) - - reserved(def) method(strict_base64decode?) - instance_variable(@strict_base64decode) - reserved(end) - - ident(attr_writer) symbol(:strict_base64decode) - - reserved(def) method(new_body_port)operator(() ident(mail) operator(\)) - constant(StringPort)operator(.)ident(new) - reserved(end) - - reserved(alias) method(new_preamble_port) method(new_body_port) - reserved(alias) method(new_part_port) method(new_body_port) - - reserved(end) - - constant(DEFAULT_CONFIG) operator(=) constant(Config)operator(.)ident(new)operator(()pre_constant(false)operator(\)) - constant(DEFAULT_STRICT_CONFIG) operator(=) constant(Config)operator(.)ident(new)operator(()pre_constant(true)operator(\)) - - reserved(def) constant(Config)operator(.)method(to_config)operator(() ident(arg) operator(\)) - reserved(return) constant(DEFAULT_STRICT_CONFIG) reserved(if) ident(arg) operator(==) pre_constant(true) - reserved(return) constant(DEFAULT_CONFIG) reserved(if) ident(arg) operator(==) pre_constant(false) - ident(arg) reserved(or) constant(DEFAULT_CONFIG) - reserved(end) - -reserved(end) -comment(#) -comment(# encode.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string - - -reserved(module) class(TMail) - - reserved(module) class(StrategyInterface) - - reserved(def) method(create_dest)operator(() ident(obj) operator(\)) - reserved(case) ident(obj) - reserved(when) pre_constant(nil) - constant(StringOutput)operator(.)ident(new) - reserved(when) constant(String) - constant(StringOutput)operator(.)ident(new)operator(()ident(obj)operator(\)) - reserved(when) constant(IO)operator(,) constant(StringOutput) - ident(obj) - reserved(else) - ident(raise) constant(TypeError)operator(,) string - reserved(end) - reserved(end) - ident(module_function) symbol(:create_dest) - - reserved(def) method(encoded)operator(() ident(eol) operator(=) stringoperator(,) ident(charset) operator(=) stringoperator(,) ident(dest) operator(=) pre_constant(nil) operator(\)) - ident(accept_strategy) constant(Encoder)operator(,) ident(eol)operator(,) ident(charset)operator(,) ident(dest) - reserved(end) - - reserved(def) method(decoded)operator(() ident(eol) operator(=) stringoperator(,) ident(charset) operator(=) stringoperator(,) ident(dest) operator(=) pre_constant(nil) operator(\)) - ident(accept_strategy) constant(Decoder)operator(,) ident(eol)operator(,) ident(charset)operator(,) ident(dest) - reserved(end) - - reserved(alias) method(to_s) method(decoded) - - reserved(def) method(accept_strategy)operator(() ident(klass)operator(,) ident(eol)operator(,) ident(charset)operator(,) ident(dest) operator(=) pre_constant(nil) operator(\)) - ident(dest) operator(||=) string - ident(accept) ident(klass)operator(.)ident(new)operator(()ident(create_dest)operator(()ident(dest)operator(\))operator(,) ident(charset)operator(,) ident(eol)operator(\)) - ident(dest) - reserved(end) - - reserved(end) - - - comment(###) - comment(### MIME B encoding decoder) - comment(###) - - reserved(class) class(Decoder) - - ident(include) constant(TextUtils) - - ident(encoded) operator(=) string - constant(ENCODED_WORDS) operator(=) regexpcontent((?:)char(\\s)content(+)inlinecontent(\)*)delimiter(/)modifier(i)> - - constant(OUTPUT_ENCODING) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - operator(}) - - reserved(def) pre_constant(self)operator(.)method(decode)operator(() ident(str)operator(,) ident(encoding) operator(=) pre_constant(nil) operator(\)) - ident(encoding) operator(||=) operator(()constant(OUTPUT_ENCODING)operator([)global_variable($KCODE)operator(]) operator(||) stringoperator(\)) - ident(opt) operator(=) string operator(+) ident(encoding) - ident(str)operator(.)ident(gsub)operator(()constant(ENCODED_WORDS)operator(\)) operator({)operator(|)ident(s)operator(|) constant(NKF)operator(.)ident(nkf)operator(()ident(opt)operator(,) ident(s)operator(\)) operator(}) - reserved(end) - - reserved(def) method(initialize)operator(() ident(dest)operator(,) ident(encoding) operator(=) pre_constant(nil)operator(,) ident(eol) operator(=) string operator(\)) - instance_variable(@f) operator(=) constant(StrategyInterface)operator(.)ident(create_dest)operator(()ident(dest)operator(\)) - instance_variable(@encoding) operator(=) operator(()regexp operator(===) ident(encoding)operator(\)) operator(?) ident(encoding)operator([)integer(0)operator(,)integer(1)operator(]) operator(:) pre_constant(nil) - instance_variable(@eol) operator(=) ident(eol) - reserved(end) - - reserved(def) method(decode)operator(() ident(str) operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(decode)operator(()ident(str)operator(,) instance_variable(@encoding)operator(\)) - reserved(end) - ident(private) symbol(:decode) - - reserved(def) method(terminate) - reserved(end) - - reserved(def) method(header_line)operator(() ident(str) operator(\)) - instance_variable(@f) operator(<<) ident(decode)operator(()ident(str)operator(\)) - reserved(end) - - reserved(def) method(header_name)operator(() ident(nm) operator(\)) - instance_variable(@f) operator(<<) ident(nm) operator(<<) string - reserved(end) - - reserved(def) method(header_body)operator(() ident(str) operator(\)) - instance_variable(@f) operator(<<) ident(decode)operator(()ident(str)operator(\)) - reserved(end) - - reserved(def) method(space) - instance_variable(@f) operator(<<) string - reserved(end) - - reserved(alias) method(spc) method(space) - - reserved(def) method(lwsp)operator(() ident(str) operator(\)) - instance_variable(@f) operator(<<) ident(str) - reserved(end) - - reserved(def) method(meta)operator(() ident(str) operator(\)) - instance_variable(@f) operator(<<) ident(str) - reserved(end) - - reserved(def) method(text)operator(() ident(str) operator(\)) - instance_variable(@f) operator(<<) ident(decode)operator(()ident(str)operator(\)) - reserved(end) - - reserved(def) method(phrase)operator(() ident(str) operator(\)) - instance_variable(@f) operator(<<) ident(quote_phrase)operator(()ident(decode)operator(()ident(str)operator(\))operator(\)) - reserved(end) - - reserved(def) method(kv_pair)operator(() ident(k)operator(,) ident(v) operator(\)) - instance_variable(@f) operator(<<) ident(k) operator(<<) string operator(<<) ident(v) - reserved(end) - - reserved(def) method(puts)operator(() ident(str) operator(=) pre_constant(nil) operator(\)) - instance_variable(@f) operator(<<) ident(str) reserved(if) ident(str) - instance_variable(@f) operator(<<) instance_variable(@eol) - reserved(end) - - reserved(def) method(write)operator(() ident(str) operator(\)) - instance_variable(@f) operator(<<) ident(str) - reserved(end) - - reserved(end) - - - comment(###) - comment(### MIME B-encoding encoder) - comment(###) - - comment(#) - comment(# FIXME: This class can handle only (euc-jp/shift_jis -> iso-2022-jp\).) - comment(#) - reserved(class) class(Encoder) - - ident(include) constant(TextUtils) - - constant(BENCODE_DEBUG) operator(=) pre_constant(false) reserved(unless) reserved(defined?)operator(()constant(BENCODE_DEBUG)operator(\)) - - reserved(def) constant(Encoder)operator(.)method(encode)operator(() ident(str) operator(\)) - ident(e) operator(=) ident(new)operator(()operator(\)) - ident(e)operator(.)ident(header_body) ident(str) - ident(e)operator(.)ident(terminate) - ident(e)operator(.)ident(dest)operator(.)ident(string) - reserved(end) - - constant(SPACER) operator(=) string - constant(MAX_LINE_LEN) operator(=) integer(70) - - constant(OPTIONS) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) pre_constant(nil)operator(,) comment(# FIXME) - string operator(=)operator(>) pre_constant(nil) - operator(}) - - reserved(def) method(initialize)operator(() ident(dest) operator(=) pre_constant(nil)operator(,) ident(encoding) operator(=) pre_constant(nil)operator(,) ident(eol) operator(=) stringoperator(,) ident(limit) operator(=) pre_constant(nil) operator(\)) - instance_variable(@f) operator(=) constant(StrategyInterface)operator(.)ident(create_dest)operator(()ident(dest)operator(\)) - instance_variable(@opt) operator(=) constant(OPTIONS)operator([)global_variable($KCODE)operator(]) - instance_variable(@eol) operator(=) ident(eol) - ident(reset) - reserved(end) - - reserved(def) method(normalize_encoding)operator(() ident(str) operator(\)) - reserved(if) instance_variable(@opt) - reserved(then) constant(NKF)operator(.)ident(nkf)operator(()instance_variable(@opt)operator(,) ident(str)operator(\)) - reserved(else) ident(str) - reserved(end) - reserved(end) - - reserved(def) method(reset) - instance_variable(@text) operator(=) string - instance_variable(@lwsp) operator(=) string - instance_variable(@curlen) operator(=) integer(0) - reserved(end) - - reserved(def) method(terminate) - ident(add_lwsp) string - ident(reset) - reserved(end) - - reserved(def) method(dest) - instance_variable(@f) - reserved(end) - - reserved(def) method(puts)operator(() ident(str) operator(=) pre_constant(nil) operator(\)) - instance_variable(@f) operator(<<) ident(str) reserved(if) ident(str) - instance_variable(@f) operator(<<) instance_variable(@eol) - reserved(end) - - reserved(def) method(write)operator(() ident(str) operator(\)) - instance_variable(@f) operator(<<) ident(str) - reserved(end) - - comment(#) - comment(# add) - comment(#) - - reserved(def) method(header_line)operator(() ident(line) operator(\)) - ident(scanadd) ident(line) - reserved(end) - - reserved(def) method(header_name)operator(() ident(name) operator(\)) - ident(add_text) ident(name)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(map) operator({)operator(|)ident(i)operator(|) ident(i)operator(.)ident(capitalize) operator(})operator(.)ident(join)operator(()stringoperator(\)) - ident(add_text) string - ident(add_lwsp) string - reserved(end) - - reserved(def) method(header_body)operator(() ident(str) operator(\)) - ident(scanadd) ident(normalize_encoding)operator(()ident(str)operator(\)) - reserved(end) - - reserved(def) method(space) - ident(add_lwsp) string - reserved(end) - - reserved(alias) method(spc) method(space) - - reserved(def) method(lwsp)operator(() ident(str) operator(\)) - ident(add_lwsp) ident(str)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(meta)operator(() ident(str) operator(\)) - ident(add_text) ident(str) - reserved(end) - - reserved(def) method(text)operator(() ident(str) operator(\)) - ident(scanadd) ident(normalize_encoding)operator(()ident(str)operator(\)) - reserved(end) - - reserved(def) method(phrase)operator(() ident(str) operator(\)) - ident(str) operator(=) ident(normalize_encoding)operator(()ident(str)operator(\)) - reserved(if) constant(CONTROL_CHAR) operator(===) ident(str) - ident(scanadd) ident(str) - reserved(else) - ident(add_text) ident(quote_phrase)operator(()ident(str)operator(\)) - reserved(end) - reserved(end) - - comment(# FIXME: implement line folding) - comment(#) - reserved(def) method(kv_pair)operator(() ident(k)operator(,) ident(v) operator(\)) - reserved(return) reserved(if) ident(v)operator(.)ident(nil?) - ident(v) operator(=) ident(normalize_encoding)operator(()ident(v)operator(\)) - reserved(if) ident(token_safe?)operator(()ident(v)operator(\)) - ident(add_text) ident(k) operator(+) string operator(+) ident(v) - reserved(elsif) reserved(not) constant(CONTROL_CHAR) operator(===) ident(v) - ident(add_text) ident(k) operator(+) string operator(+) ident(quote_token)operator(()ident(v)operator(\)) - reserved(else) - comment(# apply RFC2231 encoding) - ident(kv) operator(=) ident(k) operator(+) string operator(+) string operator(+) ident(encode_value)operator(()ident(v)operator(\)) - ident(add_text) ident(kv) - reserved(end) - reserved(end) - - reserved(def) method(encode_value)operator(() ident(str) operator(\)) - ident(str)operator(.)ident(gsub)operator(()constant(TOKEN_UNSAFE)operator(\)) operator({)operator(|)ident(s)operator(|) string operator(%) ident(s)operator([)integer(0)operator(]) operator(}) - reserved(end) - - ident(private) - - reserved(def) method(scanadd)operator(() ident(str)operator(,) ident(force) operator(=) pre_constant(false) operator(\)) - ident(types) operator(=) string - ident(strs) operator(=) operator([)operator(]) - - reserved(until) ident(str)operator(.)ident(empty?) - reserved(if) ident(m) operator(=) regexpoperator(.)ident(match)operator(()ident(str)operator(\)) - ident(types) operator(<<) operator(()ident(force) operator(?) string operator(:) stringoperator(\)) - ident(strs)operator(.)ident(push) ident(m)operator([)integer(0)operator(]) - - reserved(elsif) ident(m) operator(=) regexpoperator(.)ident(match)operator(()ident(str)operator(\)) - ident(types) operator(<<) string - ident(strs)operator(.)ident(push) ident(m)operator([)integer(0)operator(]) - - reserved(elsif) ident(m) operator(=) regexpoperator(.)ident(match)operator(()ident(str)operator(\)) - ident(esc) operator(=) ident(m)operator([)integer(0)operator(]) - ident(str) operator(=) ident(m)operator(.)ident(post_match) - reserved(if) ident(esc) operator(!=) string reserved(and) ident(m) operator(=) regexpoperator(.)ident(match)operator(()ident(str)operator(\)) - ident(types) operator(<<) string - ident(strs)operator(.)ident(push) ident(m)operator([)integer(0)operator(]) - reserved(end) - - reserved(else) - ident(raise) string - reserved(end) - operator(()ident(str) operator(=) ident(m)operator(.)ident(post_match)operator(\)) reserved(unless) ident(m)operator(.)ident(nil?) - reserved(end) - - ident(do_encode) ident(types)operator(,) ident(strs) - reserved(end) - - reserved(def) method(do_encode)operator(() ident(types)operator(,) ident(strs) operator(\)) - comment(#) - comment(# result : (A|E\)(S(A|E\)\)*) - comment(# E : W(SW\)*) - comment(# W : (J|A\)+ but must contain J # (J|A\)*J(J|A\)*) - comment(# A : <>) - comment(# J : <>) - comment(# S : <>) - comment(#) - comment(# An encoding unit is `E'.) - comment(# Input (parameter `types'\) is (J|A\)(J|A|S\)*(J|A\)) - comment(#) - reserved(if) constant(BENCODE_DEBUG) - ident(puts) - ident(puts) string - ident(puts) ident(types)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(join)operator(()stringoperator(\)) - ident(p) ident(strs) - reserved(end) - - ident(e) operator(=) regexp - - reserved(while) ident(m) operator(=) ident(e)operator(.)ident(match)operator(()ident(types)operator(\)) - ident(pre) operator(=) ident(m)operator(.)ident(pre_match) - ident(concat_A_S) ident(pre)operator(,) ident(strs)operator([)integer(0)operator(,) ident(pre)operator(.)ident(size)operator(]) reserved(unless) ident(pre)operator(.)ident(empty?) - ident(concat_E) ident(m)operator([)integer(0)operator(])operator(,) ident(strs)operator([)ident(m)operator(.)ident(begin)operator(()integer(0)operator(\)) operator(...) ident(m)operator(.)ident(end)operator(()integer(0)operator(\))operator(]) - ident(types) operator(=) ident(m)operator(.)ident(post_match) - ident(strs)operator(.)ident(slice!) integer(0)operator(,) ident(m)operator(.)ident(end)operator(()integer(0)operator(\)) - reserved(end) - ident(concat_A_S) ident(types)operator(,) ident(strs) - reserved(end) - - reserved(def) method(concat_A_S)operator(() ident(types)operator(,) ident(strs) operator(\)) - ident(i) operator(=) integer(0) - ident(types)operator(.)ident(each_byte) reserved(do) operator(|)ident(t)operator(|) - reserved(case) ident(t) - reserved(when) integer(?a) reserved(then) ident(add_text) ident(strs)operator([)ident(i)operator(]) - reserved(when) integer(?s) reserved(then) ident(add_lwsp) ident(strs)operator([)ident(i)operator(]) - reserved(else) - ident(raise) stringdelimiter(")> - reserved(end) - ident(i) operator(+=) integer(1) - reserved(end) - reserved(end) - - constant(METHOD_ID) operator(=) operator({) - integer(?j) operator(=)operator(>) symbol(:extract_J)operator(,) - integer(?e) operator(=)operator(>) symbol(:extract_E)operator(,) - integer(?a) operator(=)operator(>) symbol(:extract_A)operator(,) - integer(?s) operator(=)operator(>) symbol(:extract_S) - operator(}) - - reserved(def) method(concat_E)operator(() ident(types)operator(,) ident(strs) operator(\)) - reserved(if) constant(BENCODE_DEBUG) - ident(puts) string - ident(puts) stringoperator(\))operator(.)ident(join)operator(()stringoperator(\))inline_delimiter(})>delimiter(")> - ident(puts) stringdelimiter(")> - reserved(end) - - ident(flush)operator(()operator(\)) reserved(unless) instance_variable(@text)operator(.)ident(empty?) - - ident(chunk) operator(=) string - ident(strs)operator(.)ident(each_with_index) reserved(do) operator(|)ident(s)operator(,)ident(i)operator(|) - ident(mid) operator(=) constant(METHOD_ID)operator([)ident(types)operator([)ident(i)operator(])operator(]) - reserved(until) ident(s)operator(.)ident(empty?) - reserved(unless) ident(c) operator(=) ident(__send__)operator(()ident(mid)operator(,) ident(chunk)operator(.)ident(size)operator(,) ident(s)operator(\)) - ident(add_with_encode) ident(chunk) reserved(unless) ident(chunk)operator(.)ident(empty?) - ident(flush) - ident(chunk) operator(=) string - ident(fold) - ident(c) operator(=) ident(__send__)operator(()ident(mid)operator(,) integer(0)operator(,) ident(s)operator(\)) - ident(raise) string reserved(unless) ident(c) - reserved(end) - ident(chunk) operator(<<) ident(c) - reserved(end) - reserved(end) - ident(add_with_encode) ident(chunk) reserved(unless) ident(chunk)operator(.)ident(empty?) - reserved(end) - - reserved(def) method(extract_J)operator(() ident(chunksize)operator(,) ident(str) operator(\)) - ident(size) operator(=) ident(max_bytes)operator(()ident(chunksize)operator(,) ident(str)operator(.)ident(size)operator(\)) operator(-) integer(6) - ident(size) operator(=) operator(()ident(size) operator(%) integer(2) operator(==) integer(0)operator(\)) operator(?) operator(()ident(size)operator(\)) operator(:) operator(()ident(size) operator(-) integer(1)operator(\)) - reserved(return) pre_constant(nil) reserved(if) ident(size) operator(<=) integer(0) - stringchar(\\e)content((B)delimiter(")> - reserved(end) - - reserved(def) method(extract_A)operator(() ident(chunksize)operator(,) ident(str) operator(\)) - ident(size) operator(=) ident(max_bytes)operator(()ident(chunksize)operator(,) ident(str)operator(.)ident(size)operator(\)) - reserved(return) pre_constant(nil) reserved(if) ident(size) operator(<=) integer(0) - ident(str)operator(.)ident(slice!)operator(()integer(0)operator(,) ident(size)operator(\)) - reserved(end) - - reserved(alias) method(extract_S) method(extract_A) - - reserved(def) method(max_bytes)operator(() ident(chunksize)operator(,) ident(ssize) operator(\)) - operator(()ident(restsize)operator(()operator(\)) operator(-) stringoperator(.)ident(size)operator(\)) operator(/) integer(4) operator(*) integer(3) operator(-) ident(chunksize) - reserved(end) - - comment(#) - comment(# free length buffer) - comment(#) - - reserved(def) method(add_text)operator(() ident(str) operator(\)) - instance_variable(@text) operator(<<) ident(str) - comment(# puts '---- text -------------------------------------') - comment(# puts "+ #{str.inspect}") - comment(# puts "txt >>>#{@text.inspect}<<<") - reserved(end) - - reserved(def) method(add_with_encode)operator(() ident(str) operator(\)) - instance_variable(@text) operator(<<) stringcontent(?=)delimiter(")> - reserved(end) - - reserved(def) method(add_lwsp)operator(() ident(lwsp) operator(\)) - comment(# puts '---- lwsp -------------------------------------') - comment(# puts "+ #{lwsp.inspect}") - ident(fold) reserved(if) ident(restsize)operator(()operator(\)) operator(<=) integer(0) - ident(flush) - instance_variable(@lwsp) operator(=) ident(lwsp) - reserved(end) - - reserved(def) method(flush) - comment(# puts '---- flush ----') - comment(# puts "spc >>>#{@lwsp.inspect}<<<") - comment(# puts "txt >>>#{@text.inspect}<<<") - instance_variable(@f) operator(<<) instance_variable(@lwsp) operator(<<) instance_variable(@text) - instance_variable(@curlen) operator(+=) operator(()instance_variable(@lwsp)operator(.)ident(size) operator(+) instance_variable(@text)operator(.)ident(size)operator(\)) - instance_variable(@text) operator(=) string - instance_variable(@lwsp) operator(=) string - reserved(end) - - reserved(def) method(fold) - comment(# puts '---- fold ----') - instance_variable(@f) operator(<<) instance_variable(@eol) - instance_variable(@curlen) operator(=) integer(0) - instance_variable(@lwsp) operator(=) constant(SPACER) - reserved(end) - - reserved(def) method(restsize) - constant(MAX_LINE_LEN) operator(-) operator(()instance_variable(@curlen) operator(+) instance_variable(@lwsp)operator(.)ident(size) operator(+) instance_variable(@text)operator(.)ident(size)operator(\)) - reserved(end) - - reserved(end) - -reserved(end) comment(# module TMail) -comment(#) -comment(# facade.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -ident(require) string - - -reserved(module) class(TMail) - - reserved(class) class(Mail) - - reserved(def) method(header_string)operator(() ident(name)operator(,) ident(default) operator(=) pre_constant(nil) operator(\)) - ident(h) operator(=) instance_variable(@header)operator([)ident(name)operator(.)ident(downcase)operator(]) reserved(or) reserved(return) ident(default) - ident(h)operator(.)ident(to_s) - reserved(end) - - comment(###) - comment(### attributes) - comment(###) - - ident(include) constant(TextUtils) - - reserved(def) method(set_string_array_attr)operator(() ident(key)operator(,) ident(strs) operator(\)) - ident(strs)operator(.)ident(flatten!) - reserved(if) ident(strs)operator(.)ident(empty?) - instance_variable(@header)operator(.)ident(delete) ident(key)operator(.)ident(downcase) - reserved(else) - ident(store) ident(key)operator(,) ident(strs)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - ident(strs) - reserved(end) - ident(private) symbol(:set_string_array_attr) - - reserved(def) method(set_string_attr)operator(() ident(key)operator(,) ident(str) operator(\)) - reserved(if) ident(str) - ident(store) ident(key)operator(,) ident(str) - reserved(else) - instance_variable(@header)operator(.)ident(delete) ident(key)operator(.)ident(downcase) - reserved(end) - ident(str) - reserved(end) - ident(private) symbol(:set_string_attr) - - reserved(def) method(set_addrfield)operator(() ident(name)operator(,) ident(arg) operator(\)) - reserved(if) ident(arg) - ident(h) operator(=) constant(HeaderField)operator(.)ident(internal_new)operator(()ident(name)operator(,) instance_variable(@config)operator(\)) - ident(h)operator(.)ident(addrs)operator(.)ident(replace) operator([)ident(arg)operator(])operator(.)ident(flatten) - instance_variable(@header)operator([)ident(name)operator(]) operator(=) ident(h) - reserved(else) - instance_variable(@header)operator(.)ident(delete) ident(name) - reserved(end) - ident(arg) - reserved(end) - ident(private) symbol(:set_addrfield) - - reserved(def) method(addrs2specs)operator(() ident(addrs) operator(\)) - reserved(return) pre_constant(nil) reserved(unless) ident(addrs) - ident(list) operator(=) ident(addrs)operator(.)ident(map) operator({)operator(|)ident(addr)operator(|) - reserved(if) ident(addr)operator(.)ident(address_group?) - reserved(then) ident(addr)operator(.)ident(map) operator({)operator(|)ident(a)operator(|) ident(a)operator(.)ident(spec) operator(}) - reserved(else) ident(addr)operator(.)ident(spec) - reserved(end) - operator(})operator(.)ident(flatten) - reserved(return) pre_constant(nil) reserved(if) ident(list)operator(.)ident(empty?) - ident(list) - reserved(end) - ident(private) symbol(:addrs2specs) - - - comment(#) - comment(# date time) - comment(#) - - reserved(def) method(date)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(date) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(date=)operator(() ident(time) operator(\)) - reserved(if) ident(time) - ident(store) stringoperator(,) ident(time2str)operator(()ident(time)operator(\)) - reserved(else) - instance_variable(@header)operator(.)ident(delete) string - reserved(end) - ident(time) - reserved(end) - - reserved(def) method(strftime)operator(() ident(fmt)operator(,) ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(t) operator(=) ident(date) - ident(t)operator(.)ident(strftime)operator(()ident(fmt)operator(\)) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - - comment(#) - comment(# destination) - comment(#) - - reserved(def) method(to_addrs)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(addrs) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(cc_addrs)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(addrs) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(bcc_addrs)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(addrs) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(to_addrs=)operator(() ident(arg) operator(\)) - ident(set_addrfield) stringoperator(,) ident(arg) - reserved(end) - - reserved(def) method(cc_addrs=)operator(() ident(arg) operator(\)) - ident(set_addrfield) stringoperator(,) ident(arg) - reserved(end) - - reserved(def) method(bcc_addrs=)operator(() ident(arg) operator(\)) - ident(set_addrfield) stringoperator(,) ident(arg) - reserved(end) - - reserved(def) method(to)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - ident(addrs2specs)operator(()ident(to_addrs)operator(()pre_constant(nil)operator(\))operator(\)) operator(||) ident(default) - reserved(end) - - reserved(def) method(cc)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - ident(addrs2specs)operator(()ident(cc_addrs)operator(()pre_constant(nil)operator(\))operator(\)) operator(||) ident(default) - reserved(end) - - reserved(def) method(bcc)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - ident(addrs2specs)operator(()ident(bcc_addrs)operator(()pre_constant(nil)operator(\))operator(\)) operator(||) ident(default) - reserved(end) - - reserved(def) method(to=)operator(() operator(*)ident(strs) operator(\)) - ident(set_string_array_attr) stringoperator(,) ident(strs) - reserved(end) - - reserved(def) method(cc=)operator(() operator(*)ident(strs) operator(\)) - ident(set_string_array_attr) stringoperator(,) ident(strs) - reserved(end) - - reserved(def) method(bcc=)operator(() operator(*)ident(strs) operator(\)) - ident(set_string_array_attr) stringoperator(,) ident(strs) - reserved(end) - - - comment(#) - comment(# originator) - comment(#) - - reserved(def) method(from_addrs)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(addrs) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(from_addrs=)operator(() ident(arg) operator(\)) - ident(set_addrfield) stringoperator(,) ident(arg) - reserved(end) - - reserved(def) method(from)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - ident(addrs2specs)operator(()ident(from_addrs)operator(()pre_constant(nil)operator(\))operator(\)) operator(||) ident(default) - reserved(end) - - reserved(def) method(from=)operator(() operator(*)ident(strs) operator(\)) - ident(set_string_array_attr) stringoperator(,) ident(strs) - reserved(end) - - reserved(def) method(friendly_from)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(a)operator(,) operator(=) ident(h)operator(.)ident(addrs) - reserved(return) ident(default) reserved(unless) ident(a) - reserved(return) ident(a)operator(.)ident(phrase) reserved(if) ident(a)operator(.)ident(phrase) - reserved(return) ident(h)operator(.)ident(comments)operator(.)ident(join)operator(()stringoperator(\)) reserved(unless) ident(h)operator(.)ident(comments)operator(.)ident(empty?) - ident(a)operator(.)ident(spec) - reserved(end) - - - reserved(def) method(reply_to_addrs)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(addrs) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(reply_to_addrs=)operator(() ident(arg) operator(\)) - ident(set_addrfield) stringoperator(,) ident(arg) - reserved(end) - - reserved(def) method(reply_to)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - ident(addrs2specs)operator(()ident(reply_to_addrs)operator(()pre_constant(nil)operator(\))operator(\)) operator(||) ident(default) - reserved(end) - - reserved(def) method(reply_to=)operator(() operator(*)ident(strs) operator(\)) - ident(set_string_array_attr) stringoperator(,) ident(strs) - reserved(end) - - - reserved(def) method(sender_addr)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - ident(f) operator(=) instance_variable(@header)operator([)stringoperator(]) reserved(or) reserved(return) ident(default) - ident(f)operator(.)ident(addr) reserved(or) reserved(return) ident(default) - reserved(end) - - reserved(def) method(sender_addr=)operator(() ident(addr) operator(\)) - reserved(if) ident(addr) - ident(h) operator(=) constant(HeaderField)operator(.)ident(internal_new)operator(()stringoperator(,) instance_variable(@config)operator(\)) - ident(h)operator(.)ident(addr) operator(=) ident(addr) - instance_variable(@header)operator([)stringoperator(]) operator(=) ident(h) - reserved(else) - instance_variable(@header)operator(.)ident(delete) string - reserved(end) - ident(addr) - reserved(end) - - reserved(def) method(sender)operator(() ident(default) operator(\)) - ident(f) operator(=) instance_variable(@header)operator([)stringoperator(]) reserved(or) reserved(return) ident(default) - ident(a) operator(=) ident(f)operator(.)ident(addr) reserved(or) reserved(return) ident(default) - ident(a)operator(.)ident(spec) - reserved(end) - - reserved(def) method(sender=)operator(() ident(str) operator(\)) - ident(set_string_attr) stringoperator(,) ident(str) - reserved(end) - - - comment(#) - comment(# subject) - comment(#) - - reserved(def) method(subject)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(body) - reserved(else) - ident(default) - reserved(end) - reserved(end) - reserved(alias) method(quoted_subject) method(subject) - - reserved(def) method(subject=)operator(() ident(str) operator(\)) - ident(set_string_attr) stringoperator(,) ident(str) - reserved(end) - - - comment(#) - comment(# identity & threading) - comment(#) - - reserved(def) method(message_id)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(id) operator(||) ident(default) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(message_id=)operator(() ident(str) operator(\)) - ident(set_string_attr) stringoperator(,) ident(str) - reserved(end) - - reserved(def) method(in_reply_to)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(ids) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(in_reply_to=)operator(() operator(*)ident(idstrs) operator(\)) - ident(set_string_array_attr) stringoperator(,) ident(idstrs) - reserved(end) - - reserved(def) method(references)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(refs) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(references=)operator(() operator(*)ident(strs) operator(\)) - ident(set_string_array_attr) stringoperator(,) ident(strs) - reserved(end) - - - comment(#) - comment(# MIME headers) - comment(#) - - reserved(def) method(mime_version)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(version) operator(||) ident(default) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(mime_version=)operator(() ident(m)operator(,) ident(opt) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(opt) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(major) operator(=) ident(m) - ident(h)operator(.)ident(minor) operator(=) ident(opt) - reserved(else) - ident(store) stringoperator(,) stringcontent(.)inlinedelimiter(")> - reserved(end) - reserved(else) - ident(store) stringoperator(,) ident(m) - reserved(end) - ident(m) - reserved(end) - - - reserved(def) method(content_type)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(content_type) operator(||) ident(default) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(main_type)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(main_type) operator(||) ident(default) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(sub_type)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(sub_type) operator(||) ident(default) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(set_content_type)operator(() ident(str)operator(,) ident(sub) operator(=) pre_constant(nil)operator(,) ident(param) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(sub) - ident(main)operator(,) ident(sub) operator(=) ident(str)operator(,) ident(sub) - reserved(else) - ident(main)operator(,) ident(sub) operator(=) ident(str)operator(.)ident(split)operator(()regexp)>operator(,) integer(2)operator(\)) - ident(raise) constant(ArgumentError)operator(,) stringdelimiter(")> reserved(unless) ident(sub) - reserved(end) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(main_type) operator(=) ident(main) - ident(h)operator(.)ident(sub_type) operator(=) ident(sub) - ident(h)operator(.)ident(params)operator(.)ident(clear) - reserved(else) - ident(store) stringoperator(,) stringcontent(/)inlinedelimiter(")> - reserved(end) - instance_variable(@header)operator([)stringoperator(])operator(.)ident(params)operator(.)ident(replace) ident(param) reserved(if) ident(param) - - ident(str) - reserved(end) - - reserved(alias) method(content_type=) method(set_content_type) - - reserved(def) method(type_param)operator(() ident(name)operator(,) ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator([)ident(name)operator(]) operator(||) ident(default) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(charset)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator([)stringoperator(]) reserved(or) ident(default) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(charset=)operator(() ident(str) operator(\)) - reserved(if) ident(str) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([) string operator(]) - ident(h)operator([)stringoperator(]) operator(=) ident(str) - reserved(else) - ident(store) stringoperator(,) stringdelimiter(")> - reserved(end) - reserved(end) - ident(str) - reserved(end) - - - reserved(def) method(transfer_encoding)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(encoding) operator(||) ident(default) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(def) method(transfer_encoding=)operator(() ident(str) operator(\)) - ident(set_string_attr) stringoperator(,) ident(str) - reserved(end) - - reserved(alias) method(encoding) method(transfer_encoding) - reserved(alias) method(encoding=) method(transfer_encoding=) - reserved(alias) method(content_transfer_encoding) method(transfer_encoding) - reserved(alias) method(content_transfer_encoding=) method(transfer_encoding=) - - - reserved(def) method(disposition)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(disposition) operator(||) ident(default) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(alias) method(content_disposition) method(disposition) - - reserved(def) method(set_disposition)operator(() ident(str)operator(,) ident(params) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator(.)ident(disposition) operator(=) ident(str) - ident(h)operator(.)ident(params)operator(.)ident(clear) - reserved(else) - ident(store)operator(()stringoperator(,) ident(str)operator(\)) - ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - reserved(end) - ident(h)operator(.)ident(params)operator(.)ident(replace) ident(params) reserved(if) ident(params) - reserved(end) - - reserved(alias) method(disposition=) method(set_disposition) - reserved(alias) method(set_content_disposition) method(set_disposition) - reserved(alias) method(content_disposition=) method(set_disposition) - - reserved(def) method(disposition_param)operator(() ident(name)operator(,) ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)stringoperator(]) - ident(h)operator([)ident(name)operator(]) operator(||) ident(default) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - comment(###) - comment(### utils) - comment(###) - - reserved(def) method(create_reply) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()stringoperator(\)) - ident(mail)operator(.)ident(subject) operator(=) string operator(+) ident(subject)operator(()stringoperator(\))operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - ident(mail)operator(.)ident(to_addrs) operator(=) ident(reply_addresses)operator(()operator([)operator(])operator(\)) - ident(mail)operator(.)ident(in_reply_to) operator(=) operator([)ident(message_id)operator(()pre_constant(nil)operator(\))operator(])operator(.)ident(compact) - ident(mail)operator(.)ident(references) operator(=) ident(references)operator(()operator([)operator(])operator(\)) operator(+) operator([)ident(message_id)operator(()pre_constant(nil)operator(\))operator(])operator(.)ident(compact) - ident(mail)operator(.)ident(mime_version) operator(=) string - ident(mail) - reserved(end) - - - reserved(def) method(base64_encode) - ident(store) stringoperator(,) string - pre_constant(self)operator(.)ident(body) operator(=) constant(Base64)operator(.)ident(folding_encode)operator(()pre_constant(self)operator(.)ident(body)operator(\)) - reserved(end) - - reserved(def) method(base64_decode) - reserved(if) regexp operator(===) pre_constant(self)operator(.)ident(transfer_encoding)operator(()stringoperator(\)) - ident(store) stringoperator(,) string - pre_constant(self)operator(.)ident(body) operator(=) constant(Base64)operator(.)ident(decode)operator(()pre_constant(self)operator(.)ident(body)operator(,) instance_variable(@config)operator(.)ident(strict_base64decode?)operator(\)) - reserved(end) - reserved(end) - - - reserved(def) method(destinations)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - ident(ret) operator(=) operator([)operator(]) - stringoperator(.)ident(each) reserved(do) operator(|)ident(nm)operator(|) - reserved(if) ident(h) operator(=) instance_variable(@header)operator([)ident(nm)operator(]) - ident(h)operator(.)ident(addrs)operator(.)ident(each) operator({)operator(|)ident(i)operator(|) ident(ret)operator(.)ident(push) ident(i)operator(.)ident(address) operator(}) - reserved(end) - reserved(end) - ident(ret)operator(.)ident(empty?) operator(?) ident(default) operator(:) ident(ret) - reserved(end) - - reserved(def) method(each_destination)operator(() operator(&)ident(block) operator(\)) - ident(destinations)operator(()operator([)operator(])operator(\))operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - reserved(if) constant(Address) operator(===) ident(i) - reserved(yield) ident(i) - reserved(else) - ident(i)operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(alias) method(each_dest) method(each_destination) - - - reserved(def) method(reply_addresses)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - ident(reply_to_addrs)operator(()pre_constant(nil)operator(\)) reserved(or) ident(from_addrs)operator(()pre_constant(nil)operator(\)) reserved(or) ident(default) - reserved(end) - - reserved(def) method(error_reply_addresses)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(s) operator(=) ident(sender)operator(()pre_constant(nil)operator(\)) - operator([)ident(s)operator(]) - reserved(else) - ident(from_addrs)operator(()ident(default)operator(\)) - reserved(end) - reserved(end) - - - reserved(def) method(multipart?) - ident(main_type)operator(()stringoperator(\))operator(.)ident(downcase) operator(==) string - reserved(end) - - reserved(end) comment(# class Mail) - -reserved(end) comment(# module TMail) -comment(#) -comment(# header.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - - -reserved(module) class(TMail) - - reserved(class) class(HeaderField) - - ident(include) constant(TextUtils) - - reserved(class) operator(<<) class(self) - - reserved(alias) method(newobj) method(new) - - reserved(def) method(new)operator(() ident(name)operator(,) ident(body)operator(,) ident(conf) operator(=) constant(DEFAULT_CONFIG) operator(\)) - ident(klass) operator(=) constant(FNAME_TO_CLASS)operator([)ident(name)operator(.)ident(downcase)operator(]) operator(||) constant(UnstructuredHeader) - ident(klass)operator(.)ident(newobj) ident(body)operator(,) ident(conf) - reserved(end) - - reserved(def) method(new_from_port)operator(() ident(port)operator(,) ident(name)operator(,) ident(conf) operator(=) constant(DEFAULT_CONFIG) operator(\)) - ident(re) operator(=) constant(Regep)operator(.)ident(new)operator(()string operator(+) constant(Regexp)operator(.)ident(quote)operator(()ident(name)operator(\)) operator(+) stringoperator(,) stringoperator(\)) - ident(str) operator(=) pre_constant(nil) - ident(port)operator(.)ident(ropen) operator({)operator(|)ident(f)operator(|) - ident(f)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - reserved(if) ident(m) operator(=) ident(re)operator(.)ident(match)operator(()ident(line)operator(\)) reserved(then) ident(str) operator(=) ident(m)operator(.)ident(post_match)operator(.)ident(strip) - reserved(elsif) ident(str) reserved(and) regexp operator(===) ident(line) reserved(then) ident(str) operator(<<) string operator(<<) ident(line)operator(.)ident(strip) - reserved(elsif) regexp operator(===) ident(line) reserved(then) reserved(break) - reserved(elsif) ident(str) reserved(then) reserved(break) - reserved(end) - reserved(end) - operator(}) - ident(new)operator(()ident(name)operator(,) ident(str)operator(,) constant(Config)operator(.)ident(to_config)operator(()ident(conf)operator(\))operator(\)) - reserved(end) - - reserved(def) method(internal_new)operator(() ident(name)operator(,) ident(conf) operator(\)) - constant(FNAME_TO_CLASS)operator([)ident(name)operator(])operator(.)ident(newobj)operator(()stringoperator(,) ident(conf)operator(,) pre_constant(true)operator(\)) - reserved(end) - - reserved(end) comment(# class << self) - - reserved(def) method(initialize)operator(() ident(body)operator(,) ident(conf)operator(,) ident(intern) operator(=) pre_constant(false) operator(\)) - instance_variable(@body) operator(=) ident(body) - instance_variable(@config) operator(=) ident(conf) - - instance_variable(@illegal) operator(=) pre_constant(false) - instance_variable(@parsed) operator(=) pre_constant(false) - reserved(if) ident(intern) - instance_variable(@parsed) operator(=) pre_constant(true) - ident(parse_init) - reserved(end) - reserved(end) - - reserved(def) method(inspect) - stringcontent( )inlinecontent(>)delimiter(")> - reserved(end) - - reserved(def) method(illegal?) - instance_variable(@illegal) - reserved(end) - - reserved(def) method(empty?) - ident(ensure_parsed) - reserved(return) pre_constant(true) reserved(if) instance_variable(@illegal) - ident(isempty?) - reserved(end) - - ident(private) - - reserved(def) method(ensure_parsed) - reserved(return) reserved(if) instance_variable(@parsed) - instance_variable(@parsed) operator(=) pre_constant(true) - ident(parse) - reserved(end) - - comment(# defabstract parse) - comment(# end) - - reserved(def) method(clear_parse_status) - instance_variable(@parsed) operator(=) pre_constant(false) - instance_variable(@illegal) operator(=) pre_constant(false) - reserved(end) - - ident(public) - - reserved(def) method(body) - ident(ensure_parsed) - ident(v) operator(=) constant(Decoder)operator(.)ident(new)operator(()ident(s) operator(=) stringoperator(\)) - ident(do_accept) ident(v) - ident(v)operator(.)ident(terminate) - ident(s) - reserved(end) - - reserved(def) method(body=)operator(() ident(str) operator(\)) - instance_variable(@body) operator(=) ident(str) - ident(clear_parse_status) - reserved(end) - - ident(include) constant(StrategyInterface) - - reserved(def) method(accept)operator(() ident(strategy)operator(,) ident(dummy1) operator(=) pre_constant(nil)operator(,) ident(dummy2) operator(=) pre_constant(nil) operator(\)) - ident(ensure_parsed) - ident(do_accept) ident(strategy) - ident(strategy)operator(.)ident(terminate) - reserved(end) - - comment(# abstract do_accept) - - reserved(end) - - - reserved(class) class(UnstructuredHeader) operator(<) constant(HeaderField) - - reserved(def) method(body) - ident(ensure_parsed) - instance_variable(@body) - reserved(end) - - reserved(def) method(body=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@body) operator(=) ident(arg) - reserved(end) - - ident(private) - - reserved(def) method(parse_init) - reserved(end) - - reserved(def) method(parse) - instance_variable(@body) operator(=) constant(Decoder)operator(.)ident(decode)operator(()instance_variable(@body)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(isempty?) - reserved(not) instance_variable(@body) - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(strategy)operator(.)ident(text) instance_variable(@body) - reserved(end) - - reserved(end) - - - reserved(class) class(StructuredHeader) operator(<) constant(HeaderField) - - reserved(def) method(comments) - ident(ensure_parsed) - instance_variable(@comments) - reserved(end) - - ident(private) - - reserved(def) method(parse) - ident(save) operator(=) pre_constant(nil) - - reserved(begin) - ident(parse_init) - ident(do_parse) - reserved(rescue) constant(SyntaxError) - reserved(if) reserved(not) ident(save) reserved(and) ident(mime_encoded?) instance_variable(@body) - ident(save) operator(=) instance_variable(@body) - instance_variable(@body) operator(=) constant(Decoder)operator(.)ident(decode)operator(()ident(save)operator(\)) - reserved(retry) - reserved(elsif) ident(save) - instance_variable(@body) operator(=) ident(save) - reserved(end) - - instance_variable(@illegal) operator(=) pre_constant(true) - ident(raise) reserved(if) instance_variable(@config)operator(.)ident(strict_parse?) - reserved(end) - reserved(end) - - reserved(def) method(parse_init) - instance_variable(@comments) operator(=) operator([)operator(]) - ident(init) - reserved(end) - - reserved(def) method(do_parse) - ident(obj) operator(=) constant(Parser)operator(.)ident(parse)operator(()pre_constant(self)operator(.)ident(class)operator(::)constant(PARSE_TYPE)operator(,) instance_variable(@body)operator(,) instance_variable(@comments)operator(\)) - ident(set) ident(obj) reserved(if) ident(obj) - reserved(end) - - reserved(end) - - - reserved(class) class(DateTimeHeader) operator(<) constant(StructuredHeader) - - constant(PARSE_TYPE) operator(=) symbol(:DATETIME) - - reserved(def) method(date) - ident(ensure_parsed) - instance_variable(@date) - reserved(end) - - reserved(def) method(date=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@date) operator(=) ident(arg) - reserved(end) - - ident(private) - - reserved(def) method(init) - instance_variable(@date) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(set)operator(() ident(t) operator(\)) - instance_variable(@date) operator(=) ident(t) - reserved(end) - - reserved(def) method(isempty?) - reserved(not) instance_variable(@date) - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(strategy)operator(.)ident(meta) ident(time2str)operator(()instance_variable(@date)operator(\)) - reserved(end) - - reserved(end) - - - reserved(class) class(AddressHeader) operator(<) constant(StructuredHeader) - - constant(PARSE_TYPE) operator(=) symbol(:MADDRESS) - - reserved(def) method(addrs) - ident(ensure_parsed) - instance_variable(@addrs) - reserved(end) - - ident(private) - - reserved(def) method(init) - instance_variable(@addrs) operator(=) operator([)operator(]) - reserved(end) - - reserved(def) method(set)operator(() ident(a) operator(\)) - instance_variable(@addrs) operator(=) ident(a) - reserved(end) - - reserved(def) method(isempty?) - instance_variable(@addrs)operator(.)ident(empty?) - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(first) operator(=) pre_constant(true) - instance_variable(@addrs)operator(.)ident(each) reserved(do) operator(|)ident(a)operator(|) - reserved(if) ident(first) - ident(first) operator(=) pre_constant(false) - reserved(else) - ident(strategy)operator(.)ident(meta) string - ident(strategy)operator(.)ident(space) - reserved(end) - ident(a)operator(.)ident(accept) ident(strategy) - reserved(end) - - instance_variable(@comments)operator(.)ident(each) reserved(do) operator(|)ident(c)operator(|) - ident(strategy)operator(.)ident(space) - ident(strategy)operator(.)ident(meta) string - ident(strategy)operator(.)ident(text) ident(c) - ident(strategy)operator(.)ident(meta) string - reserved(end) - reserved(end) - - reserved(end) - - - reserved(class) class(ReturnPathHeader) operator(<) constant(AddressHeader) - - constant(PARSE_TYPE) operator(=) symbol(:RETPATH) - - reserved(def) method(addr) - ident(addrs)operator(()operator(\))operator([)integer(0)operator(]) - reserved(end) - - reserved(def) method(spec) - ident(a) operator(=) ident(addr)operator(()operator(\)) reserved(or) reserved(return) pre_constant(nil) - ident(a)operator(.)ident(spec) - reserved(end) - - reserved(def) method(routes) - ident(a) operator(=) ident(addr)operator(()operator(\)) reserved(or) reserved(return) pre_constant(nil) - ident(a)operator(.)ident(routes) - reserved(end) - - ident(private) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(a) operator(=) ident(addr)operator(()operator(\)) - - ident(strategy)operator(.)ident(meta) string - reserved(unless) ident(a)operator(.)ident(routes)operator(.)ident(empty?) - ident(strategy)operator(.)ident(meta) ident(a)operator(.)ident(routes)operator(.)ident(map) operator({)operator(|)ident(i)operator(|) string operator(+) ident(i) operator(})operator(.)ident(join)operator(()stringoperator(\)) - ident(strategy)operator(.)ident(meta) string - reserved(end) - ident(spec) operator(=) ident(a)operator(.)ident(spec) - ident(strategy)operator(.)ident(meta) ident(spec) reserved(if) ident(spec) - ident(strategy)operator(.)ident(meta) string)delimiter(')> - reserved(end) - - reserved(end) - - - reserved(class) class(SingleAddressHeader) operator(<) constant(AddressHeader) - - reserved(def) method(addr) - ident(addrs)operator(()operator(\))operator([)integer(0)operator(]) - reserved(end) - - ident(private) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(a) operator(=) ident(addr)operator(()operator(\)) - ident(a)operator(.)ident(accept) ident(strategy) - instance_variable(@comments)operator(.)ident(each) reserved(do) operator(|)ident(c)operator(|) - ident(strategy)operator(.)ident(space) - ident(strategy)operator(.)ident(meta) string - ident(strategy)operator(.)ident(text) ident(c) - ident(strategy)operator(.)ident(meta) string - reserved(end) - reserved(end) - - reserved(end) - - - reserved(class) class(MessageIdHeader) operator(<) constant(StructuredHeader) - - reserved(def) method(id) - ident(ensure_parsed) - instance_variable(@id) - reserved(end) - - reserved(def) method(id=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@id) operator(=) ident(arg) - reserved(end) - - ident(private) - - reserved(def) method(init) - instance_variable(@id) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(isempty?) - reserved(not) instance_variable(@id) - reserved(end) - - reserved(def) method(do_parse) - instance_variable(@id) operator(=) instance_variable(@body)operator(.)ident(slice)operator(()constant(MESSAGE_ID)operator(\)) reserved(or) - ident(raise) constant(SyntaxError)operator(,) stringdelimiter(")> - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(strategy)operator(.)ident(meta) instance_variable(@id) - reserved(end) - - reserved(end) - - - reserved(class) class(ReferencesHeader) operator(<) constant(StructuredHeader) - - reserved(def) method(refs) - ident(ensure_parsed) - instance_variable(@refs) - reserved(end) - - reserved(def) method(each_id) - pre_constant(self)operator(.)ident(refs)operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - reserved(yield) ident(i) reserved(if) constant(MESSAGE_ID) operator(===) ident(i) - reserved(end) - reserved(end) - - reserved(def) method(ids) - ident(ensure_parsed) - instance_variable(@ids) - reserved(end) - - reserved(def) method(each_phrase) - pre_constant(self)operator(.)ident(refs)operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - reserved(yield) ident(i) reserved(unless) constant(MESSAGE_ID) operator(===) ident(i) - reserved(end) - reserved(end) - - reserved(def) method(phrases) - ident(ret) operator(=) operator([)operator(]) - ident(each_phrase) operator({)operator(|)ident(i)operator(|) ident(ret)operator(.)ident(push) ident(i) operator(}) - ident(ret) - reserved(end) - - ident(private) - - reserved(def) method(init) - instance_variable(@refs) operator(=) operator([)operator(]) - instance_variable(@ids) operator(=) operator([)operator(]) - reserved(end) - - reserved(def) method(isempty?) - instance_variable(@ids)operator(.)ident(empty?) - reserved(end) - - reserved(def) method(do_parse) - ident(str) operator(=) instance_variable(@body) - reserved(while) ident(m) operator(=) constant(MESSAGE_ID)operator(.)ident(match)operator(()ident(str)operator(\)) - ident(pre) operator(=) ident(m)operator(.)ident(pre_match)operator(.)ident(strip) - instance_variable(@refs)operator(.)ident(push) ident(pre) reserved(unless) ident(pre)operator(.)ident(empty?) - instance_variable(@refs)operator(.)ident(push) ident(s) operator(=) ident(m)operator([)integer(0)operator(]) - instance_variable(@ids)operator(.)ident(push) ident(s) - ident(str) operator(=) ident(m)operator(.)ident(post_match) - reserved(end) - ident(str) operator(=) ident(str)operator(.)ident(strip) - instance_variable(@refs)operator(.)ident(push) ident(str) reserved(unless) ident(str)operator(.)ident(empty?) - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(first) operator(=) pre_constant(true) - instance_variable(@ids)operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - reserved(if) ident(first) - ident(first) operator(=) pre_constant(false) - reserved(else) - ident(strategy)operator(.)ident(space) - reserved(end) - ident(strategy)operator(.)ident(meta) ident(i) - reserved(end) - reserved(end) - - reserved(end) - - - reserved(class) class(ReceivedHeader) operator(<) constant(StructuredHeader) - - constant(PARSE_TYPE) operator(=) symbol(:RECEIVED) - - reserved(def) method(from) - ident(ensure_parsed) - instance_variable(@from) - reserved(end) - - reserved(def) method(from=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@from) operator(=) ident(arg) - reserved(end) - - reserved(def) method(by) - ident(ensure_parsed) - instance_variable(@by) - reserved(end) - - reserved(def) method(by=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@by) operator(=) ident(arg) - reserved(end) - - reserved(def) method(via) - ident(ensure_parsed) - instance_variable(@via) - reserved(end) - - reserved(def) method(via=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@via) operator(=) ident(arg) - reserved(end) - - reserved(def) method(with) - ident(ensure_parsed) - instance_variable(@with) - reserved(end) - - reserved(def) method(id) - ident(ensure_parsed) - instance_variable(@id) - reserved(end) - - reserved(def) method(id=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@id) operator(=) ident(arg) - reserved(end) - - reserved(def) method(_for) - ident(ensure_parsed) - instance_variable(@_for) - reserved(end) - - reserved(def) method(_for=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@_for) operator(=) ident(arg) - reserved(end) - - reserved(def) method(date) - ident(ensure_parsed) - instance_variable(@date) - reserved(end) - - reserved(def) method(date=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@date) operator(=) ident(arg) - reserved(end) - - ident(private) - - reserved(def) method(init) - instance_variable(@from) operator(=) instance_variable(@by) operator(=) instance_variable(@via) operator(=) instance_variable(@with) operator(=) instance_variable(@id) operator(=) instance_variable(@_for) operator(=) pre_constant(nil) - instance_variable(@with) operator(=) operator([)operator(]) - instance_variable(@date) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(set)operator(() ident(args) operator(\)) - instance_variable(@from)operator(,) instance_variable(@by)operator(,) instance_variable(@via)operator(,) instance_variable(@with)operator(,) instance_variable(@id)operator(,) instance_variable(@_for)operator(,) instance_variable(@date) operator(=) operator(*)ident(args) - reserved(end) - - reserved(def) method(isempty?) - instance_variable(@with)operator(.)ident(empty?) reserved(and) reserved(not) operator(()instance_variable(@from) reserved(or) instance_variable(@by) reserved(or) instance_variable(@via) reserved(or) instance_variable(@id) reserved(or) instance_variable(@_for) reserved(or) instance_variable(@date)operator(\)) - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(list) operator(=) operator([)operator(]) - ident(list)operator(.)ident(push) string operator(+) instance_variable(@from) reserved(if) instance_variable(@from) - ident(list)operator(.)ident(push) string operator(+) instance_variable(@by) reserved(if) instance_variable(@by) - ident(list)operator(.)ident(push) string operator(+) instance_variable(@via) reserved(if) instance_variable(@via) - instance_variable(@with)operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - ident(list)operator(.)ident(push) string operator(+) ident(i) - reserved(end) - ident(list)operator(.)ident(push) string operator(+) instance_variable(@id) reserved(if) instance_variable(@id) - ident(list)operator(.)ident(push) string operator(+) instance_variable(@_for) operator(+) string)delimiter(')> reserved(if) instance_variable(@_for) - - ident(first) operator(=) pre_constant(true) - ident(list)operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - ident(strategy)operator(.)ident(space) reserved(unless) ident(first) - ident(strategy)operator(.)ident(meta) ident(i) - ident(first) operator(=) pre_constant(false) - reserved(end) - reserved(if) instance_variable(@date) - ident(strategy)operator(.)ident(meta) string - ident(strategy)operator(.)ident(space) - ident(strategy)operator(.)ident(meta) ident(time2str)operator(()instance_variable(@date)operator(\)) - reserved(end) - reserved(end) - - reserved(end) - - - reserved(class) class(KeywordsHeader) operator(<) constant(StructuredHeader) - - constant(PARSE_TYPE) operator(=) symbol(:KEYWORDS) - - reserved(def) method(keys) - ident(ensure_parsed) - instance_variable(@keys) - reserved(end) - - ident(private) - - reserved(def) method(init) - instance_variable(@keys) operator(=) operator([)operator(]) - reserved(end) - - reserved(def) method(set)operator(() ident(a) operator(\)) - instance_variable(@keys) operator(=) ident(a) - reserved(end) - - reserved(def) method(isempty?) - instance_variable(@keys)operator(.)ident(empty?) - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(first) operator(=) pre_constant(true) - instance_variable(@keys)operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - reserved(if) ident(first) - ident(first) operator(=) pre_constant(false) - reserved(else) - ident(strategy)operator(.)ident(meta) string - reserved(end) - ident(strategy)operator(.)ident(meta) ident(i) - reserved(end) - reserved(end) - - reserved(end) - - - reserved(class) class(EncryptedHeader) operator(<) constant(StructuredHeader) - - constant(PARSE_TYPE) operator(=) symbol(:ENCRYPTED) - - reserved(def) method(encrypter) - ident(ensure_parsed) - instance_variable(@encrypter) - reserved(end) - - reserved(def) method(encrypter=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@encrypter) operator(=) ident(arg) - reserved(end) - - reserved(def) method(keyword) - ident(ensure_parsed) - instance_variable(@keyword) - reserved(end) - - reserved(def) method(keyword=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@keyword) operator(=) ident(arg) - reserved(end) - - ident(private) - - reserved(def) method(init) - instance_variable(@encrypter) operator(=) pre_constant(nil) - instance_variable(@keyword) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(set)operator(() ident(args) operator(\)) - instance_variable(@encrypter)operator(,) instance_variable(@keyword) operator(=) ident(args) - reserved(end) - - reserved(def) method(isempty?) - reserved(not) operator(()instance_variable(@encrypter) reserved(or) instance_variable(@keyword)operator(\)) - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - reserved(if) instance_variable(@key) - ident(strategy)operator(.)ident(meta) instance_variable(@encrypter) operator(+) string - ident(strategy)operator(.)ident(space) - ident(strategy)operator(.)ident(meta) instance_variable(@keyword) - reserved(else) - ident(strategy)operator(.)ident(meta) instance_variable(@encrypter) - reserved(end) - reserved(end) - - reserved(end) - - - reserved(class) class(MimeVersionHeader) operator(<) constant(StructuredHeader) - - constant(PARSE_TYPE) operator(=) symbol(:MIMEVERSION) - - reserved(def) method(major) - ident(ensure_parsed) - instance_variable(@major) - reserved(end) - - reserved(def) method(major=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@major) operator(=) ident(arg) - reserved(end) - - reserved(def) method(minor) - ident(ensure_parsed) - instance_variable(@minor) - reserved(end) - - reserved(def) method(minor=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@minor) operator(=) ident(arg) - reserved(end) - - reserved(def) method(version) - ident(sprintf)operator(()stringoperator(,) ident(major)operator(,) ident(minor)operator(\)) - reserved(end) - - ident(private) - - reserved(def) method(init) - instance_variable(@major) operator(=) pre_constant(nil) - instance_variable(@minor) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(set)operator(() ident(args) operator(\)) - instance_variable(@major)operator(,) instance_variable(@minor) operator(=) operator(*)ident(args) - reserved(end) - - reserved(def) method(isempty?) - reserved(not) operator(()instance_variable(@major) reserved(or) instance_variable(@minor)operator(\)) - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(strategy)operator(.)ident(meta) ident(sprintf)operator(()stringoperator(,) instance_variable(@major)operator(,) instance_variable(@minor)operator(\)) - reserved(end) - - reserved(end) - - - reserved(class) class(ContentTypeHeader) operator(<) constant(StructuredHeader) - - constant(PARSE_TYPE) operator(=) symbol(:CTYPE) - - reserved(def) method(main_type) - ident(ensure_parsed) - instance_variable(@main) - reserved(end) - - reserved(def) method(main_type=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@main) operator(=) ident(arg)operator(.)ident(downcase) - reserved(end) - - reserved(def) method(sub_type) - ident(ensure_parsed) - instance_variable(@sub) - reserved(end) - - reserved(def) method(sub_type=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@sub) operator(=) ident(arg)operator(.)ident(downcase) - reserved(end) - - reserved(def) method(content_type) - ident(ensure_parsed) - instance_variable(@sub) operator(?) ident(sprintf)operator(()stringoperator(,) instance_variable(@main)operator(,) instance_variable(@sub)operator(\)) operator(:) instance_variable(@main) - reserved(end) - - reserved(def) method(params) - ident(ensure_parsed) - instance_variable(@params) - reserved(end) - - reserved(def) method([])operator(() ident(key) operator(\)) - ident(ensure_parsed) - instance_variable(@params) reserved(and) instance_variable(@params)operator([)ident(key)operator(]) - reserved(end) - - reserved(def) method([]=)operator(() ident(key)operator(,) ident(val) operator(\)) - ident(ensure_parsed) - operator(()instance_variable(@params) operator(||=) operator({)operator(})operator(\))operator([)ident(key)operator(]) operator(=) ident(val) - reserved(end) - - ident(private) - - reserved(def) method(init) - instance_variable(@main) operator(=) instance_variable(@sub) operator(=) instance_variable(@params) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(set)operator(() ident(args) operator(\)) - instance_variable(@main)operator(,) instance_variable(@sub)operator(,) instance_variable(@params) operator(=) operator(*)ident(args) - reserved(end) - - reserved(def) method(isempty?) - reserved(not) operator(()instance_variable(@main) reserved(or) instance_variable(@sub)operator(\)) - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - reserved(if) instance_variable(@sub) - ident(strategy)operator(.)ident(meta) ident(sprintf)operator(()stringoperator(,) instance_variable(@main)operator(,) instance_variable(@sub)operator(\)) - reserved(else) - ident(strategy)operator(.)ident(meta) instance_variable(@main) - reserved(end) - instance_variable(@params)operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) - reserved(if) ident(v) - ident(strategy)operator(.)ident(meta) string - ident(strategy)operator(.)ident(space) - ident(strategy)operator(.)ident(kv_pair) ident(k)operator(,) ident(v) - reserved(end) - reserved(end) - reserved(end) - - reserved(end) - - - reserved(class) class(ContentTransferEncodingHeader) operator(<) constant(StructuredHeader) - - constant(PARSE_TYPE) operator(=) symbol(:CENCODING) - - reserved(def) method(encoding) - ident(ensure_parsed) - instance_variable(@encoding) - reserved(end) - - reserved(def) method(encoding=)operator(() ident(arg) operator(\)) - ident(ensure_parsed) - instance_variable(@encoding) operator(=) ident(arg) - reserved(end) - - ident(private) - - reserved(def) method(init) - instance_variable(@encoding) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(set)operator(() ident(s) operator(\)) - instance_variable(@encoding) operator(=) ident(s) - reserved(end) - - reserved(def) method(isempty?) - reserved(not) instance_variable(@encoding) - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(strategy)operator(.)ident(meta) instance_variable(@encoding)operator(.)ident(capitalize) - reserved(end) - - reserved(end) - - - reserved(class) class(ContentDispositionHeader) operator(<) constant(StructuredHeader) - - constant(PARSE_TYPE) operator(=) symbol(:CDISPOSITION) - - reserved(def) method(disposition) - ident(ensure_parsed) - instance_variable(@disposition) - reserved(end) - - reserved(def) method(disposition=)operator(() ident(str) operator(\)) - ident(ensure_parsed) - instance_variable(@disposition) operator(=) ident(str)operator(.)ident(downcase) - reserved(end) - - reserved(def) method(params) - ident(ensure_parsed) - instance_variable(@params) - reserved(end) - - reserved(def) method([])operator(() ident(key) operator(\)) - ident(ensure_parsed) - instance_variable(@params) reserved(and) instance_variable(@params)operator([)ident(key)operator(]) - reserved(end) - - reserved(def) method([]=)operator(() ident(key)operator(,) ident(val) operator(\)) - ident(ensure_parsed) - operator(()instance_variable(@params) operator(||=) operator({)operator(})operator(\))operator([)ident(key)operator(]) operator(=) ident(val) - reserved(end) - - ident(private) - - reserved(def) method(init) - instance_variable(@disposition) operator(=) instance_variable(@params) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(set)operator(() ident(args) operator(\)) - instance_variable(@disposition)operator(,) instance_variable(@params) operator(=) operator(*)ident(args) - reserved(end) - - reserved(def) method(isempty?) - reserved(not) instance_variable(@disposition) reserved(and) operator(()reserved(not) instance_variable(@params) reserved(or) instance_variable(@params)operator(.)ident(empty?)operator(\)) - reserved(end) - - reserved(def) method(do_accept)operator(() ident(strategy) operator(\)) - ident(strategy)operator(.)ident(meta) instance_variable(@disposition) - instance_variable(@params)operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) - ident(strategy)operator(.)ident(meta) string - ident(strategy)operator(.)ident(space) - ident(strategy)operator(.)ident(kv_pair) ident(k)operator(,) ident(v) - reserved(end) - reserved(end) - - reserved(end) - - - reserved(class) class(HeaderField) comment(# redefine) - - constant(FNAME_TO_CLASS) operator(=) operator({) - string operator(=)operator(>) constant(DateTimeHeader)operator(,) - string operator(=)operator(>) constant(DateTimeHeader)operator(,) - string operator(=)operator(>) constant(AddressHeader)operator(,) - string operator(=)operator(>) constant(AddressHeader)operator(,) - string operator(=)operator(>) constant(AddressHeader)operator(,) - string operator(=)operator(>) constant(AddressHeader)operator(,) - string operator(=)operator(>) constant(AddressHeader)operator(,) - string operator(=)operator(>) constant(AddressHeader)operator(,) - string operator(=)operator(>) constant(AddressHeader)operator(,) - string operator(=)operator(>) constant(AddressHeader)operator(,) - string operator(=)operator(>) constant(AddressHeader)operator(,) - string operator(=)operator(>) constant(AddressHeader)operator(,) - string operator(=)operator(>) constant(SingleAddressHeader)operator(,) - string operator(=)operator(>) constant(SingleAddressHeader)operator(,) - string operator(=)operator(>) constant(ReturnPathHeader)operator(,) - string operator(=)operator(>) constant(MessageIdHeader)operator(,) - string operator(=)operator(>) constant(MessageIdHeader)operator(,) - string operator(=)operator(>) constant(ReferencesHeader)operator(,) - string operator(=)operator(>) constant(ReceivedHeader)operator(,) - string operator(=)operator(>) constant(ReferencesHeader)operator(,) - string operator(=)operator(>) constant(KeywordsHeader)operator(,) - string operator(=)operator(>) constant(EncryptedHeader)operator(,) - string operator(=)operator(>) constant(MimeVersionHeader)operator(,) - string operator(=)operator(>) constant(ContentTypeHeader)operator(,) - string operator(=)operator(>) constant(ContentTransferEncodingHeader)operator(,) - string operator(=)operator(>) constant(ContentDispositionHeader)operator(,) - string operator(=)operator(>) constant(MessageIdHeader)operator(,) - string operator(=)operator(>) constant(UnstructuredHeader)operator(,) - string operator(=)operator(>) constant(UnstructuredHeader)operator(,) - string operator(=)operator(>) constant(UnstructuredHeader) - operator(}) - - reserved(end) - -reserved(end) comment(# module TMail) -comment(#) -comment(# info.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -reserved(module) class(TMail) - - constant(Version) operator(=) string - constant(Copyright) operator(=) string - -reserved(end) -ident(require) string -comment(#) -comment(# mail.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - - -reserved(module) class(TMail) - - reserved(class) class(Mail) - - reserved(class) operator(<<) class(self) - reserved(def) method(load)operator(() ident(fname) operator(\)) - ident(new)operator(()constant(FilePort)operator(.)ident(new)operator(()ident(fname)operator(\))operator(\)) - reserved(end) - - reserved(alias) method(load_from) method(load) - reserved(alias) method(loadfrom) method(load) - - reserved(def) method(parse)operator(() ident(str) operator(\)) - ident(new)operator(()constant(StringPort)operator(.)ident(new)operator(()ident(str)operator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(initialize)operator(() ident(port) operator(=) pre_constant(nil)operator(,) ident(conf) operator(=) constant(DEFAULT_CONFIG) operator(\)) - instance_variable(@port) operator(=) ident(port) operator(||) constant(StringPort)operator(.)ident(new) - instance_variable(@config) operator(=) constant(Config)operator(.)ident(to_config)operator(()ident(conf)operator(\)) - - instance_variable(@header) operator(=) operator({)operator(}) - instance_variable(@body_port) operator(=) pre_constant(nil) - instance_variable(@body_parsed) operator(=) pre_constant(false) - instance_variable(@epilogue) operator(=) string - instance_variable(@parts) operator(=) operator([)operator(]) - - instance_variable(@port)operator(.)ident(ropen) operator({)operator(|)ident(f)operator(|) - ident(parse_header) ident(f) - ident(parse_body) ident(f) reserved(unless) instance_variable(@port)operator(.)ident(reproducible?) - operator(}) - reserved(end) - - ident(attr_reader) symbol(:port) - - reserved(def) method(inspect) - stringcontent( port=)inlinecontent( bodyport=)inlinecontent(>)delimiter(")> - reserved(end) - - comment(#) - comment(# to_s interfaces) - comment(#) - - ident(public) - - ident(include) constant(StrategyInterface) - - reserved(def) method(write_back)operator(() ident(eol) operator(=) stringoperator(,) ident(charset) operator(=) string operator(\)) - ident(parse_body) - instance_variable(@port)operator(.)ident(wopen) operator({)operator(|)ident(stream)operator(|) ident(encoded) ident(eol)operator(,) ident(charset)operator(,) ident(stream) operator(}) - reserved(end) - - reserved(def) method(accept)operator(() ident(strategy) operator(\)) - ident(with_multipart_encoding)operator(()ident(strategy)operator(\)) operator({) - ident(ordered_each) reserved(do) operator(|)ident(name)operator(,) ident(field)operator(|) - reserved(next) reserved(if) ident(field)operator(.)ident(empty?) - ident(strategy)operator(.)ident(header_name) ident(canonical)operator(()ident(name)operator(\)) - ident(field)operator(.)ident(accept) ident(strategy) - ident(strategy)operator(.)ident(puts) - reserved(end) - ident(strategy)operator(.)ident(puts) - ident(body_port)operator(()operator(\))operator(.)ident(ropen) operator({)operator(|)ident(r)operator(|) - ident(strategy)operator(.)ident(write) ident(r)operator(.)ident(read) - operator(}) - operator(}) - reserved(end) - - ident(private) - - reserved(def) method(canonical)operator(() ident(name) operator(\)) - ident(name)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(map) operator({)operator(|)ident(s)operator(|) ident(s)operator(.)ident(capitalize) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(with_multipart_encoding)operator(() ident(strategy) operator(\)) - reserved(if) ident(parts)operator(()operator(\))operator(.)ident(empty?) comment(# DO NOT USE @parts) - reserved(yield) - - reserved(else) - ident(bound) operator(=) operator(::)constant(TMail)operator(.)ident(new_boundary) - reserved(if) instance_variable(@header)operator(.)ident(key?) string - instance_variable(@header)operator([)stringoperator(])operator(.)ident(params)operator([)stringoperator(]) operator(=) ident(bound) - reserved(else) - ident(store) stringoperator(,) string)> - reserved(end) - - reserved(yield) - - ident(parts)operator(()operator(\))operator(.)ident(each) reserved(do) operator(|)ident(tm)operator(|) - ident(strategy)operator(.)ident(puts) - ident(strategy)operator(.)ident(puts) string operator(+) ident(bound) - ident(tm)operator(.)ident(accept) ident(strategy) - reserved(end) - ident(strategy)operator(.)ident(puts) - ident(strategy)operator(.)ident(puts) string operator(+) ident(bound) operator(+) string - ident(strategy)operator(.)ident(write) ident(epilogue)operator(()operator(\)) - reserved(end) - reserved(end) - - comment(###) - comment(### header) - comment(###) - - ident(public) - - constant(ALLOW_MULTIPLE) operator(=) operator({) - string operator(=)operator(>) pre_constant(true)operator(,) - string operator(=)operator(>) pre_constant(true)operator(,) - string operator(=)operator(>) pre_constant(true)operator(,) - string operator(=)operator(>) pre_constant(true)operator(,) - string operator(=)operator(>) pre_constant(true)operator(,) - string operator(=)operator(>) pre_constant(true)operator(,) - string operator(=)operator(>) pre_constant(true)operator(,) - string operator(=)operator(>) pre_constant(true)operator(,) - string operator(=)operator(>) pre_constant(true)operator(,) - string operator(=)operator(>) pre_constant(true) - operator(}) - constant(USE_ARRAY) operator(=) constant(ALLOW_MULTIPLE) - - reserved(def) method(header) - instance_variable(@header)operator(.)ident(dup) - reserved(end) - - reserved(def) method([])operator(() ident(key) operator(\)) - instance_variable(@header)operator([)ident(key)operator(.)ident(downcase)operator(]) - reserved(end) - - reserved(def) method(sub_header)operator(()ident(key)operator(,) ident(param)operator(\)) - operator(()ident(hdr) operator(=) pre_constant(self)operator([)ident(key)operator(])operator(\)) operator(?) ident(hdr)operator([)ident(param)operator(]) operator(:) pre_constant(nil) - reserved(end) - - reserved(alias) method(fetch) method([]) - - reserved(def) method([]=)operator(() ident(key)operator(,) ident(val) operator(\)) - ident(dkey) operator(=) ident(key)operator(.)ident(downcase) - - reserved(if) ident(val)operator(.)ident(nil?) - instance_variable(@header)operator(.)ident(delete) ident(dkey) - reserved(return) pre_constant(nil) - reserved(end) - - reserved(case) ident(val) - reserved(when) constant(String) - ident(header) operator(=) ident(new_hf)operator(()ident(key)operator(,) ident(val)operator(\)) - reserved(when) constant(HeaderField) - operator(;) - reserved(when) constant(Array) - constant(ALLOW_MULTIPLE)operator(.)ident(include?) ident(dkey) reserved(or) - ident(raise) constant(ArgumentError)operator(,) stringcontent(: Header must not be multiple)delimiter(")> - instance_variable(@header)operator([)ident(dkey)operator(]) operator(=) ident(val) - reserved(return) ident(val) - reserved(else) - ident(header) operator(=) ident(new_hf)operator(()ident(key)operator(,) ident(val)operator(.)ident(to_s)operator(\)) - reserved(end) - reserved(if) constant(ALLOW_MULTIPLE)operator(.)ident(include?) ident(dkey) - operator(()instance_variable(@header)operator([)ident(dkey)operator(]) operator(||=) operator([)operator(])operator(\))operator(.)ident(push) ident(header) - reserved(else) - instance_variable(@header)operator([)ident(dkey)operator(]) operator(=) ident(header) - reserved(end) - - ident(val) - reserved(end) - - reserved(alias) method(store) method([]=) - - reserved(def) method(each_header) - instance_variable(@header)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(val)operator(|) - operator([)ident(val)operator(])operator(.)ident(flatten)operator(.)ident(each) operator({)operator(|)ident(v)operator(|) reserved(yield) ident(key)operator(,) ident(v) operator(}) - reserved(end) - reserved(end) - - reserved(alias) method(each_pair) method(each_header) - - reserved(def) method(each_header_name)operator(() operator(&)ident(block) operator(\)) - instance_variable(@header)operator(.)ident(each_key)operator(()operator(&)ident(block)operator(\)) - reserved(end) - - reserved(alias) method(each_key) method(each_header_name) - - reserved(def) method(each_field)operator(() operator(&)ident(block) operator(\)) - instance_variable(@header)operator(.)ident(values)operator(.)ident(flatten)operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) - reserved(end) - - reserved(alias) method(each_value) method(each_field) - - constant(FIELD_ORDER) operator(=) string - - reserved(def) method(ordered_each) - ident(list) operator(=) instance_variable(@header)operator(.)ident(keys) - constant(FIELD_ORDER)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - reserved(if) ident(list)operator(.)ident(delete)operator(()ident(name)operator(\)) - operator([)instance_variable(@header)operator([)ident(name)operator(])operator(])operator(.)ident(flatten)operator(.)ident(each) operator({)operator(|)ident(v)operator(|) reserved(yield) ident(name)operator(,) ident(v) operator(}) - reserved(end) - reserved(end) - ident(list)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - operator([)instance_variable(@header)operator([)ident(name)operator(])operator(])operator(.)ident(flatten)operator(.)ident(each) operator({)operator(|)ident(v)operator(|) reserved(yield) ident(name)operator(,) ident(v) operator(}) - reserved(end) - reserved(end) - - reserved(def) method(clear) - instance_variable(@header)operator(.)ident(clear) - reserved(end) - - reserved(def) method(delete)operator(() ident(key) operator(\)) - instance_variable(@header)operator(.)ident(delete) ident(key)operator(.)ident(downcase) - reserved(end) - - reserved(def) method(delete_if) - instance_variable(@header)operator(.)ident(delete_if) reserved(do) operator(|)ident(key)operator(,)ident(val)operator(|) - reserved(if) constant(Array) operator(===) ident(val) - ident(val)operator(.)ident(delete_if) operator({)operator(|)ident(v)operator(|) reserved(yield) ident(key)operator(,) ident(v) operator(}) - ident(val)operator(.)ident(empty?) - reserved(else) - reserved(yield) ident(key)operator(,) ident(val) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(keys) - instance_variable(@header)operator(.)ident(keys) - reserved(end) - - reserved(def) method(key?)operator(() ident(key) operator(\)) - instance_variable(@header)operator(.)ident(key?) ident(key)operator(.)ident(downcase) - reserved(end) - - reserved(def) method(values_at)operator(() operator(*)ident(args) operator(\)) - ident(args)operator(.)ident(map) operator({)operator(|)ident(k)operator(|) instance_variable(@header)operator([)ident(k)operator(.)ident(downcase)operator(]) operator(})operator(.)ident(flatten) - reserved(end) - - reserved(alias) method(indexes) method(values_at) - reserved(alias) method(indices) method(values_at) - - ident(private) - - reserved(def) method(parse_header)operator(() ident(f) operator(\)) - ident(name) operator(=) ident(field) operator(=) pre_constant(nil) - ident(unixfrom) operator(=) pre_constant(nil) - - reserved(while) ident(line) operator(=) ident(f)operator(.)ident(gets) - reserved(case) ident(line) - reserved(when) regexp comment(# continue from prev line) - ident(raise) constant(SyntaxError)operator(,) string reserved(unless) ident(field) - ident(field) operator(<<) string operator(<<) ident(line)operator(.)ident(strip) - - reserved(when) regexp comment(# new header line) - ident(add_hf) ident(name)operator(,) ident(field) reserved(if) ident(field) - ident(name) operator(=) global_variable($1) - ident(field) operator(=) global_variable($') comment(#.strip) - - reserved(when) regexp comment(# end of header) - ident(add_hf) ident(name)operator(,) ident(field) reserved(if) ident(field) - ident(name) operator(=) ident(field) operator(=) pre_constant(nil) - reserved(break) - - reserved(when) regexp - ident(unixfrom) operator(=) global_variable($1) - - reserved(when) regexp - - reserved(else) - ident(raise) constant(SyntaxError)operator(,) stringcontent(')delimiter(")> - reserved(end) - reserved(end) - ident(add_hf) ident(name)operator(,) ident(field) reserved(if) ident(name) - - reserved(if) ident(unixfrom) - ident(add_hf) stringoperator(,) stringcontent(>)delimiter(")> reserved(unless) instance_variable(@header)operator([)stringoperator(]) - reserved(end) - reserved(end) - - reserved(def) method(add_hf)operator(() ident(name)operator(,) ident(field) operator(\)) - ident(key) operator(=) ident(name)operator(.)ident(downcase) - ident(field) operator(=) ident(new_hf)operator(()ident(name)operator(,) ident(field)operator(\)) - - reserved(if) constant(ALLOW_MULTIPLE)operator(.)ident(include?) ident(key) - operator(()instance_variable(@header)operator([)ident(key)operator(]) operator(||=) operator([)operator(])operator(\))operator(.)ident(push) ident(field) - reserved(else) - instance_variable(@header)operator([)ident(key)operator(]) operator(=) ident(field) - reserved(end) - reserved(end) - - reserved(def) method(new_hf)operator(() ident(name)operator(,) ident(field) operator(\)) - constant(HeaderField)operator(.)ident(new)operator(()ident(name)operator(,) ident(field)operator(,) instance_variable(@config)operator(\)) - reserved(end) - - comment(###) - comment(### body) - comment(###) - - ident(public) - - reserved(def) method(body_port) - ident(parse_body) - instance_variable(@body_port) - reserved(end) - - reserved(def) method(each)operator(() operator(&)ident(block) operator(\)) - ident(body_port)operator(()operator(\))operator(.)ident(ropen) operator({)operator(|)ident(f)operator(|) ident(f)operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) operator(}) - reserved(end) - - reserved(def) method(quoted_body) - ident(parse_body) - instance_variable(@body_port)operator(.)ident(ropen) operator({)operator(|)ident(f)operator(|) - reserved(return) ident(f)operator(.)ident(read) - operator(}) - reserved(end) - - reserved(def) method(body=)operator(() ident(str) operator(\)) - ident(parse_body) - instance_variable(@body_port)operator(.)ident(wopen) operator({)operator(|)ident(f)operator(|) ident(f)operator(.)ident(write) ident(str) operator(}) - ident(str) - reserved(end) - - reserved(alias) method(preamble) method(body) - reserved(alias) method(preamble=) method(body=) - - reserved(def) method(epilogue) - ident(parse_body) - instance_variable(@epilogue)operator(.)ident(dup) - reserved(end) - - reserved(def) method(epilogue=)operator(() ident(str) operator(\)) - ident(parse_body) - instance_variable(@epilogue) operator(=) ident(str) - ident(str) - reserved(end) - - reserved(def) method(parts) - ident(parse_body) - instance_variable(@parts) - reserved(end) - - reserved(def) method(each_part)operator(() operator(&)ident(block) operator(\)) - ident(parts)operator(()operator(\))operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) - reserved(end) - - ident(private) - - reserved(def) method(parse_body)operator(() ident(f) operator(=) pre_constant(nil) operator(\)) - reserved(return) reserved(if) instance_variable(@body_parsed) - reserved(if) ident(f) - ident(parse_body_0) ident(f) - reserved(else) - instance_variable(@port)operator(.)ident(ropen) operator({)operator(|)ident(f)operator(|) - ident(skip_header) ident(f) - ident(parse_body_0) ident(f) - operator(}) - reserved(end) - instance_variable(@body_parsed) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(skip_header)operator(() ident(f) operator(\)) - reserved(while) ident(line) operator(=) ident(f)operator(.)ident(gets) - reserved(return) reserved(if) regexp operator(===) ident(line) - reserved(end) - reserved(end) - - reserved(def) method(parse_body_0)operator(() ident(f) operator(\)) - reserved(if) ident(multipart?) - ident(read_multipart) ident(f) - reserved(else) - instance_variable(@body_port) operator(=) instance_variable(@config)operator(.)ident(new_body_port)operator(()pre_constant(self)operator(\)) - instance_variable(@body_port)operator(.)ident(wopen) operator({)operator(|)ident(w)operator(|) - ident(w)operator(.)ident(write) ident(f)operator(.)ident(read) - operator(}) - reserved(end) - reserved(end) - - reserved(def) method(read_multipart)operator(() ident(src) operator(\)) - ident(bound) operator(=) instance_variable(@header)operator([)stringoperator(])operator(.)ident(params)operator([)stringoperator(]) - ident(is_sep) operator(=) regexpcontent((?:--\)?[ )char(\\t)content(]*(?:)char(\\n)content(|)char(\\r)char(\\n)content(|)char(\\r)content(\))delimiter(/)> - ident(lastbound) operator(=) stringcontent(--)delimiter(")> - - ident(ports) operator(=) operator([) instance_variable(@config)operator(.)ident(new_preamble_port)operator(()pre_constant(self)operator(\)) operator(]) - reserved(begin) - ident(f) operator(=) ident(ports)operator(.)ident(last)operator(.)ident(wopen) - reserved(while) ident(line) operator(=) ident(src)operator(.)ident(gets) - reserved(if) ident(is_sep) operator(===) ident(line) - ident(f)operator(.)ident(close) - reserved(break) reserved(if) ident(line)operator(.)ident(strip) operator(==) ident(lastbound) - ident(ports)operator(.)ident(push) instance_variable(@config)operator(.)ident(new_part_port)operator(()pre_constant(self)operator(\)) - ident(f) operator(=) ident(ports)operator(.)ident(last)operator(.)ident(wopen) - reserved(else) - ident(f) operator(<<) ident(line) - reserved(end) - reserved(end) - instance_variable(@epilogue) operator(=) operator(()ident(src)operator(.)ident(read) operator(||) stringoperator(\)) - reserved(ensure) - ident(f)operator(.)ident(close) reserved(if) ident(f) reserved(and) reserved(not) ident(f)operator(.)ident(closed?) - reserved(end) - - instance_variable(@body_port) operator(=) ident(ports)operator(.)ident(shift) - instance_variable(@parts) operator(=) ident(ports)operator(.)ident(map) operator({)operator(|)ident(p)operator(|) pre_constant(self)operator(.)ident(class)operator(.)ident(new)operator(()ident(p)operator(,) instance_variable(@config)operator(\)) operator(}) - reserved(end) - - reserved(end) comment(# class Mail) - -reserved(end) comment(# module TMail) -comment(#) -comment(# mailbox.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -ident(require) string -ident(require) string -ident(require) string - - -reserved(unless) operator([)operator(])operator(.)ident(respond_to?)operator(()symbol(:sort_by)operator(\)) -reserved(module) class(Enumerable)comment(#:nodoc:) - reserved(def) method(sort_by) - ident(map) operator({)operator(|)ident(i)operator(|) operator([)reserved(yield)operator(()ident(i)operator(\))operator(,) ident(i)operator(]) operator(})operator(.)ident(sort) operator({)operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(first) operator(<=>) ident(b)operator(.)ident(first) operator(})operator(.)ident(map) operator({)operator(|)ident(i)operator(|) ident(i)operator([)integer(1)operator(]) operator(}) - reserved(end) -reserved(end) -reserved(end) - - -reserved(module) class(TMail) - - reserved(class) class(MhMailbox) - - constant(PORT_CLASS) operator(=) constant(MhPort) - - reserved(def) method(initialize)operator(() ident(dir) operator(\)) - ident(edir) operator(=) constant(File)operator(.)ident(expand_path)operator(()ident(dir)operator(\)) - ident(raise) constant(ArgumentError)operator(,) stringdelimiter(")>\ - reserved(unless) constant(FileTest)operator(.)ident(directory?) ident(edir) - instance_variable(@dirname) operator(=) ident(edir) - instance_variable(@last_file) operator(=) pre_constant(nil) - instance_variable(@last_atime) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(directory) - instance_variable(@dirname) - reserved(end) - - reserved(alias) method(dirname) method(directory) - - ident(attr_accessor) symbol(:last_atime) - - reserved(def) method(inspect) - stringcontent( )inlinecontent(>)delimiter(")> - reserved(end) - - reserved(def) method(close) - reserved(end) - - reserved(def) method(new_port) - constant(PORT_CLASS)operator(.)ident(new)operator(()ident(next_file_name)operator(()operator(\))operator(\)) - reserved(end) - - reserved(def) method(each_port) - ident(mail_files)operator(()operator(\))operator(.)ident(each) reserved(do) operator(|)ident(path)operator(|) - reserved(yield) constant(PORT_CLASS)operator(.)ident(new)operator(()ident(path)operator(\)) - reserved(end) - instance_variable(@last_atime) operator(=) constant(Time)operator(.)ident(now) - reserved(end) - - reserved(alias) method(each) method(each_port) - - reserved(def) method(reverse_each_port) - ident(mail_files)operator(()operator(\))operator(.)ident(reverse_each) reserved(do) operator(|)ident(path)operator(|) - reserved(yield) constant(PORT_CLASS)operator(.)ident(new)operator(()ident(path)operator(\)) - reserved(end) - instance_variable(@last_atime) operator(=) constant(Time)operator(.)ident(now) - reserved(end) - - reserved(alias) method(reverse_each) method(reverse_each_port) - - comment(# old #each_mail returns Port) - comment(#def each_mail) - comment(# each_port do |port|) - comment(# yield Mail.new(port\)) - comment(# end) - comment(#end) - - reserved(def) method(each_new_port)operator(() ident(mtime) operator(=) pre_constant(nil)operator(,) operator(&)ident(block) operator(\)) - ident(mtime) operator(||=) instance_variable(@last_atime) - reserved(return) ident(each_port)operator(()operator(&)ident(block)operator(\)) reserved(unless) ident(mtime) - reserved(return) reserved(unless) constant(File)operator(.)ident(mtime)operator(()instance_variable(@dirname)operator(\)) operator(>)operator(=) ident(mtime) - - ident(mail_files)operator(()operator(\))operator(.)ident(each) reserved(do) operator(|)ident(path)operator(|) - reserved(yield) constant(PORT_CLASS)operator(.)ident(new)operator(()ident(path)operator(\)) reserved(if) constant(File)operator(.)ident(mtime)operator(()ident(path)operator(\)) operator(>) ident(mtime) - reserved(end) - instance_variable(@last_atime) operator(=) constant(Time)operator(.)ident(now) - reserved(end) - - ident(private) - - reserved(def) method(mail_files) - constant(Dir)operator(.)ident(entries)operator(()instance_variable(@dirname)operator(\))\ - operator(.)ident(select) operator({)operator(|)ident(s)operator(|) regexp operator(===) ident(s) operator(})\ - operator(.)ident(map) operator({)operator(|)ident(s)operator(|) ident(s)operator(.)ident(to_i) operator(})\ - operator(.)ident(sort)\ - operator(.)ident(map) operator({)operator(|)ident(i)operator(|) stringcontent(/)inlinedelimiter(")> operator(})\ - operator(.)ident(select) operator({)operator(|)ident(path)operator(|) constant(FileTest)operator(.)ident(file?) ident(path) operator(}) - reserved(end) - - reserved(def) method(next_file_name) - reserved(unless) ident(n) operator(=) instance_variable(@last_file) - ident(n) operator(=) integer(0) - constant(Dir)operator(.)ident(entries)operator(()instance_variable(@dirname)operator(\))\ - operator(.)ident(select) operator({)operator(|)ident(s)operator(|) regexp operator(===) ident(s) operator(})\ - operator(.)ident(map) operator({)operator(|)ident(s)operator(|) ident(s)operator(.)ident(to_i) operator(})operator(.)ident(sort)\ - operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - reserved(next) reserved(unless) constant(FileTest)operator(.)ident(file?) stringcontent(/)inlinedelimiter(")> - ident(n) operator(=) ident(i) - reserved(end) - reserved(end) - reserved(begin) - ident(n) operator(+=) integer(1) - reserved(end) reserved(while) constant(FileTest)operator(.)ident(exist?) stringcontent(/)inlinedelimiter(")> - instance_variable(@last_file) operator(=) ident(n) - - stringcontent(/)inlinedelimiter(")> - reserved(end) - - reserved(end) comment(# MhMailbox) - - constant(MhLoader) operator(=) constant(MhMailbox) - - - reserved(class) class(UNIXMbox) - - reserved(def) constant(UNIXMbox)operator(.)method(lock)operator(() ident(fname) operator(\)) - reserved(begin) - ident(f) operator(=) constant(File)operator(.)ident(open)operator(()ident(fname)operator(\)) - ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_EX) - reserved(yield) ident(f) - reserved(ensure) - ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_UN) - ident(f)operator(.)ident(close) reserved(if) ident(f) reserved(and) reserved(not) ident(f)operator(.)ident(closed?) - reserved(end) - reserved(end) - - reserved(class) operator(<<) class(self) - reserved(alias) method(newobj) method(new) - reserved(end) - - reserved(def) constant(UNIXMbox)operator(.)method(new)operator(() ident(fname)operator(,) ident(tmpdir) operator(=) pre_constant(nil)operator(,) ident(readonly) operator(=) pre_constant(false) operator(\)) - ident(tmpdir) operator(=) pre_constant(ENV)operator([)stringoperator(]) operator(||) pre_constant(ENV)operator([)stringoperator(]) operator(||) string - ident(newobj)operator(()ident(fname)operator(,) stringcontent(/ruby_tmail_)inlinecontent(_)inlinedelimiter(")>operator(,) ident(readonly)operator(,) pre_constant(false)operator(\)) - reserved(end) - - reserved(def) constant(UNIXMbox)operator(.)method(static_new)operator(() ident(fname)operator(,) ident(dir)operator(,) ident(readonly) operator(=) pre_constant(false) operator(\)) - ident(newobj)operator(()ident(fname)operator(,) ident(dir)operator(,) ident(readonly)operator(,) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(initialize)operator(() ident(fname)operator(,) ident(mhdir)operator(,) ident(readonly)operator(,) ident(static) operator(\)) - instance_variable(@filename) operator(=) ident(fname) - instance_variable(@readonly) operator(=) ident(readonly) - instance_variable(@closed) operator(=) pre_constant(false) - - constant(Dir)operator(.)ident(mkdir) ident(mhdir) - instance_variable(@real) operator(=) constant(MhMailbox)operator(.)ident(new)operator(()ident(mhdir)operator(\)) - instance_variable(@finalizer) operator(=) constant(UNIXMbox)operator(.)ident(mkfinal)operator(()instance_variable(@real)operator(,) instance_variable(@filename)operator(,) operator(!)instance_variable(@readonly)operator(,) operator(!)ident(static)operator(\)) - constant(ObjectSpace)operator(.)ident(define_finalizer) pre_constant(self)operator(,) instance_variable(@finalizer) - reserved(end) - - reserved(def) constant(UNIXMbox)operator(.)method(mkfinal)operator(() ident(mh)operator(,) ident(mboxfile)operator(,) ident(writeback_p)operator(,) ident(cleanup_p) operator(\)) - ident(lambda) operator({) - reserved(if) ident(writeback_p) - ident(lock)operator(()ident(mboxfile)operator(\)) operator({)operator(|)ident(f)operator(|) - ident(mh)operator(.)ident(each_port) reserved(do) operator(|)ident(port)operator(|) - ident(f)operator(.)ident(puts) ident(create_from_line)operator(()ident(port)operator(\)) - ident(port)operator(.)ident(ropen) operator({)operator(|)ident(r)operator(|) - ident(f)operator(.)ident(puts) ident(r)operator(.)ident(read) - operator(}) - reserved(end) - operator(}) - reserved(end) - reserved(if) ident(cleanup_p) - constant(Dir)operator(.)ident(foreach)operator(()ident(mh)operator(.)ident(dirname)operator(\)) reserved(do) operator(|)ident(fname)operator(|) - reserved(next) reserved(if) regexp operator(===) ident(fname) - constant(File)operator(.)ident(unlink) stringcontent(/)inlinedelimiter(")> - reserved(end) - constant(Dir)operator(.)ident(rmdir) ident(mh)operator(.)ident(dirname) - reserved(end) - operator(}) - reserved(end) - - comment(# make _From line) - reserved(def) constant(UNIXMbox)operator(.)method(create_from_line)operator(() ident(port) operator(\)) - ident(sprintf) stringoperator(,) - ident(fromaddr)operator(()operator(\))operator(,) constant(TextUtils)operator(.)ident(time2str)operator(()constant(File)operator(.)ident(mtime)operator(()ident(port)operator(.)ident(filename)operator(\))operator(\)) - reserved(end) - - reserved(def) constant(UNIXMbox)operator(.)method(fromaddr) - ident(h) operator(=) constant(HeaderField)operator(.)ident(new_from_port)operator(()ident(port)operator(,) stringoperator(\)) operator(||) - constant(HeaderField)operator(.)ident(new_from_port)operator(()ident(port)operator(,) stringoperator(\)) reserved(or) reserved(return) string - ident(a) operator(=) ident(h)operator(.)ident(addrs)operator([)integer(0)operator(]) reserved(or) reserved(return) string - ident(a)operator(.)ident(spec) - reserved(end) - ident(private_class_method) symbol(:fromaddr) - - reserved(def) method(close) - reserved(return) reserved(if) instance_variable(@closed) - - constant(ObjectSpace)operator(.)ident(undefine_finalizer) pre_constant(self) - instance_variable(@finalizer)operator(.)ident(call) - instance_variable(@finalizer) operator(=) pre_constant(nil) - instance_variable(@real) operator(=) pre_constant(nil) - instance_variable(@closed) operator(=) pre_constant(true) - instance_variable(@updated) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(each_port)operator(() operator(&)ident(block) operator(\)) - ident(close_check) - ident(update) - instance_variable(@real)operator(.)ident(each_port)operator(()operator(&)ident(block)operator(\)) - reserved(end) - - reserved(alias) method(each) method(each_port) - - reserved(def) method(reverse_each_port)operator(() operator(&)ident(block) operator(\)) - ident(close_check) - ident(update) - instance_variable(@real)operator(.)ident(reverse_each_port)operator(()operator(&)ident(block)operator(\)) - reserved(end) - - reserved(alias) method(reverse_each) method(reverse_each_port) - - comment(# old #each_mail returns Port) - comment(#def each_mail( &block \)) - comment(# each_port do |port|) - comment(# yield Mail.new(port\)) - comment(# end) - comment(#end) - - reserved(def) method(each_new_port)operator(() ident(mtime) operator(=) pre_constant(nil) operator(\)) - ident(close_check) - ident(update) - instance_variable(@real)operator(.)ident(each_new_port)operator(()ident(mtime)operator(\)) operator({)operator(|)ident(p)operator(|) reserved(yield) ident(p) operator(}) - reserved(end) - - reserved(def) method(new_port) - ident(close_check) - instance_variable(@real)operator(.)ident(new_port) - reserved(end) - - ident(private) - - reserved(def) method(close_check) - instance_variable(@closed) reserved(and) ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - reserved(def) method(update) - reserved(return) reserved(if) constant(FileTest)operator(.)ident(zero?)operator(()instance_variable(@filename)operator(\)) - reserved(return) reserved(if) instance_variable(@updated) reserved(and) constant(File)operator(.)ident(mtime)operator(()instance_variable(@filename)operator(\)) operator(<) instance_variable(@updated) - ident(w) operator(=) pre_constant(nil) - ident(port) operator(=) pre_constant(nil) - ident(time) operator(=) pre_constant(nil) - constant(UNIXMbox)operator(.)ident(lock)operator(()instance_variable(@filename)operator(\)) operator({)operator(|)ident(f)operator(|) - reserved(begin) - ident(f)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - reserved(if) regexp operator(===) ident(line) - ident(w)operator(.)ident(close) reserved(if) ident(w) - constant(File)operator(.)ident(utime) ident(time)operator(,) ident(time)operator(,) ident(port)operator(.)ident(filename) reserved(if) ident(time) - - ident(port) operator(=) instance_variable(@real)operator(.)ident(new_port) - ident(w) operator(=) ident(port)operator(.)ident(wopen) - ident(time) operator(=) ident(fromline2time)operator(()ident(line)operator(\)) - reserved(else) - ident(w)operator(.)ident(print) ident(line) reserved(if) ident(w) - reserved(end) - reserved(end) - reserved(ensure) - reserved(if) ident(w) reserved(and) reserved(not) ident(w)operator(.)ident(closed?) - ident(w)operator(.)ident(close) - constant(File)operator(.)ident(utime) ident(time)operator(,) ident(time)operator(,) ident(port)operator(.)ident(filename) reserved(if) ident(time) - reserved(end) - reserved(end) - ident(f)operator(.)ident(truncate)operator(()integer(0)operator(\)) reserved(unless) instance_variable(@readonly) - instance_variable(@updated) operator(=) constant(Time)operator(.)ident(now) - operator(}) - reserved(end) - - reserved(def) method(fromline2time)operator(() ident(line) operator(\)) - ident(m) operator(=) regexpoperator(.)ident(match)operator(()ident(line)operator(\)) \ - reserved(or) reserved(return) pre_constant(nil) - constant(Time)operator(.)ident(local)operator(()ident(m)operator([)integer(6)operator(])operator(.)ident(to_i)operator(,) ident(m)operator([)integer(1)operator(])operator(,) ident(m)operator([)integer(2)operator(])operator(.)ident(to_i)operator(,) ident(m)operator([)integer(3)operator(])operator(.)ident(to_i)operator(,) ident(m)operator([)integer(4)operator(])operator(.)ident(to_i)operator(,) ident(m)operator([)integer(5)operator(])operator(.)ident(to_i)operator(\)) - reserved(end) - - reserved(end) comment(# UNIXMbox) - - constant(MboxLoader) operator(=) constant(UNIXMbox) - - - reserved(class) class(Maildir) - - ident(extend) constant(Mutex_m) - - constant(PORT_CLASS) operator(=) constant(MaildirPort) - - instance_variable(@seq) operator(=) integer(0) - reserved(def) constant(Maildir)operator(.)method(unique_number) - ident(synchronize) operator({) - instance_variable(@seq) operator(+=) integer(1) - reserved(return) instance_variable(@seq) - operator(}) - reserved(end) - - reserved(def) method(initialize)operator(() ident(dir) operator(=) pre_constant(nil) operator(\)) - instance_variable(@dirname) operator(=) ident(dir) operator(||) pre_constant(ENV)operator([)stringoperator(]) - ident(raise) constant(ArgumentError)operator(,) stringdelimiter(")>\ - reserved(unless) constant(FileTest)operator(.)ident(directory?) instance_variable(@dirname) - instance_variable(@new) operator(=) stringcontent(/new)delimiter(")> - instance_variable(@tmp) operator(=) stringcontent(/tmp)delimiter(")> - instance_variable(@cur) operator(=) stringcontent(/cur)delimiter(")> - reserved(end) - - reserved(def) method(directory) - instance_variable(@dirname) - reserved(end) - - reserved(def) method(inspect) - stringcontent( )inlinecontent(>)delimiter(")> - reserved(end) - - reserved(def) method(close) - reserved(end) - - reserved(def) method(each_port) - ident(mail_files)operator(()instance_variable(@cur)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(path)operator(|) - reserved(yield) constant(PORT_CLASS)operator(.)ident(new)operator(()ident(path)operator(\)) - reserved(end) - reserved(end) - - reserved(alias) method(each) method(each_port) - - reserved(def) method(reverse_each_port) - ident(mail_files)operator(()instance_variable(@cur)operator(\))operator(.)ident(reverse_each) reserved(do) operator(|)ident(path)operator(|) - reserved(yield) constant(PORT_CLASS)operator(.)ident(new)operator(()ident(path)operator(\)) - reserved(end) - reserved(end) - - reserved(alias) method(reverse_each) method(reverse_each_port) - - reserved(def) method(new_port) - ident(fname) operator(=) pre_constant(nil) - ident(tmpfname) operator(=) pre_constant(nil) - ident(newfname) operator(=) pre_constant(nil) - - reserved(begin) - ident(fname) operator(=) stringcontent(.)inlinecontent(_)inlinecontent(.)inlinedelimiter(")> - - ident(tmpfname) operator(=) stringcontent(/)inlinedelimiter(")> - ident(newfname) operator(=) stringcontent(/)inlinedelimiter(")> - reserved(end) reserved(while) constant(FileTest)operator(.)ident(exist?) ident(tmpfname) - - reserved(if) ident(block_given?) - constant(File)operator(.)ident(open)operator(()ident(tmpfname)operator(,) stringoperator(\)) operator({)operator(|)ident(f)operator(|) reserved(yield) ident(f) operator(}) - constant(File)operator(.)ident(rename) ident(tmpfname)operator(,) ident(newfname) - constant(PORT_CLASS)operator(.)ident(new)operator(()ident(newfname)operator(\)) - reserved(else) - constant(File)operator(.)ident(open)operator(()ident(tmpfname)operator(,) stringoperator(\)) operator({)operator(|)ident(f)operator(|) ident(f)operator(.)ident(write) string operator(}) - constant(PORT_CLASS)operator(.)ident(new)operator(()ident(tmpfname)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(each_new_port) - ident(mail_files)operator(()instance_variable(@new)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(path)operator(|) - ident(dest) operator(=) instance_variable(@cur) operator(+) string operator(+) constant(File)operator(.)ident(basename)operator(()ident(path)operator(\)) - constant(File)operator(.)ident(rename) ident(path)operator(,) ident(dest) - reserved(yield) constant(PORT_CLASS)operator(.)ident(new)operator(()ident(dest)operator(\)) - reserved(end) - - ident(check_tmp) - reserved(end) - - constant(TOO_OLD) operator(=) integer(60) operator(*) integer(60) operator(*) integer(36) comment(# 36 hour) - - reserved(def) method(check_tmp) - ident(old) operator(=) constant(Time)operator(.)ident(now)operator(.)ident(to_i) operator(-) constant(TOO_OLD) - - ident(each_filename)operator(()instance_variable(@tmp)operator(\)) reserved(do) operator(|)ident(full)operator(,) ident(fname)operator(|) - reserved(if) constant(FileTest)operator(.)ident(file?) ident(full) reserved(and) - constant(File)operator(.)ident(stat)operator(()ident(full)operator(\))operator(.)ident(mtime)operator(.)ident(to_i) operator(<) ident(old) - constant(File)operator(.)ident(unlink) ident(full) - reserved(end) - reserved(end) - reserved(end) - - ident(private) - - reserved(def) method(mail_files)operator(() ident(dir) operator(\)) - constant(Dir)operator(.)ident(entries)operator(()ident(dir)operator(\))\ - operator(.)ident(select) operator({)operator(|)ident(s)operator(|) ident(s)operator([)integer(0)operator(]) operator(!=) integer(?.) operator(})\ - operator(.)ident(sort_by) operator({)operator(|)ident(s)operator(|) ident(s)operator(.)ident(slice)operator(()regexpoperator(\))operator(.)ident(to_i) operator(})\ - operator(.)ident(map) operator({)operator(|)ident(s)operator(|) stringcontent(/)inlinedelimiter(")> operator(})\ - operator(.)ident(select) operator({)operator(|)ident(path)operator(|) constant(FileTest)operator(.)ident(file?) ident(path) operator(}) - reserved(end) - - reserved(def) method(each_filename)operator(() ident(dir) operator(\)) - constant(Dir)operator(.)ident(foreach)operator(()ident(dir)operator(\)) reserved(do) operator(|)ident(fname)operator(|) - ident(path) operator(=) stringcontent(/)inlinedelimiter(")> - reserved(if) ident(fname)operator([)integer(0)operator(]) operator(!=) integer(?.) reserved(and) constant(FileTest)operator(.)ident(file?) ident(path) - reserved(yield) ident(path)operator(,) ident(fname) - reserved(end) - reserved(end) - reserved(end) - - reserved(end) comment(# Maildir) - - constant(MaildirLoader) operator(=) constant(Maildir) - -reserved(end) comment(# module TMail) -ident(require) string -comment(#) -comment(# net.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -ident(require) string - - -reserved(module) class(TMail) - - reserved(class) class(Mail) - - reserved(def) method(send_to)operator(() ident(smtp) operator(\)) - ident(do_send_to)operator(()ident(smtp)operator(\)) reserved(do) - ident(ready_to_send) - reserved(end) - reserved(end) - - reserved(def) method(send_text_to)operator(() ident(smtp) operator(\)) - ident(do_send_to)operator(()ident(smtp)operator(\)) reserved(do) - ident(ready_to_send) - ident(mime_encode) - reserved(end) - reserved(end) - - reserved(def) method(do_send_to)operator(() ident(smtp) operator(\)) - ident(from) operator(=) ident(from_address) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - operator(()ident(dests) operator(=) ident(destinations)operator(\))operator(.)ident(empty?) reserved(and) ident(raise) constant(ArgumentError)operator(,) string - reserved(yield) - ident(send_to_0) ident(smtp)operator(,) ident(from)operator(,) ident(dests) - reserved(end) - ident(private) symbol(:do_send_to) - - reserved(def) method(send_to_0)operator(() ident(smtp)operator(,) ident(from)operator(,) ident(to) operator(\)) - ident(smtp)operator(.)ident(ready)operator(()ident(from)operator(,) ident(to)operator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(encoded) stringoperator(,) stringoperator(,) ident(f)operator(,) string - reserved(end) - reserved(end) - - reserved(def) method(ready_to_send) - ident(delete_no_send_fields) - ident(add_message_id) - ident(add_date) - reserved(end) - - constant(NOSEND_FIELDS) operator(=) string - - reserved(def) method(delete_no_send_fields) - constant(NOSEND_FIELDS)operator(.)ident(each) reserved(do) operator(|)ident(nm)operator(|) - ident(delete) ident(nm) - reserved(end) - ident(delete_if) operator({)operator(|)ident(n)operator(,)ident(v)operator(|) ident(v)operator(.)ident(empty?) operator(}) - reserved(end) - - reserved(def) method(add_message_id)operator(() ident(fqdn) operator(=) pre_constant(nil) operator(\)) - pre_constant(self)operator(.)ident(message_id) operator(=) operator(::)constant(TMail)operator(::)ident(new_message_id)operator(()ident(fqdn)operator(\)) - reserved(end) - - reserved(def) method(add_date) - pre_constant(self)operator(.)ident(date) operator(=) constant(Time)operator(.)ident(now) - reserved(end) - - reserved(def) method(mime_encode) - reserved(if) ident(parts)operator(.)ident(empty?) - ident(mime_encode_singlepart) - reserved(else) - ident(mime_encode_multipart) pre_constant(true) - reserved(end) - reserved(end) - - reserved(def) method(mime_encode_singlepart) - pre_constant(self)operator(.)ident(mime_version) operator(=) string - ident(b) operator(=) ident(body) - reserved(if) constant(NKF)operator(.)ident(guess)operator(()ident(b)operator(\)) operator(!=) constant(NKF)operator(::)constant(BINARY) - ident(mime_encode_text) ident(b) - reserved(else) - ident(mime_encode_binary) ident(b) - reserved(end) - reserved(end) - - reserved(def) method(mime_encode_text)operator(() ident(body) operator(\)) - pre_constant(self)operator(.)ident(body) operator(=) constant(NKF)operator(.)ident(nkf)operator(()stringoperator(,) ident(body)operator(\)) - pre_constant(self)operator(.)ident(set_content_type) stringoperator(,) stringoperator(,) operator({)string operator(=)operator(>) stringoperator(}) - pre_constant(self)operator(.)ident(encoding) operator(=) string - reserved(end) - - reserved(def) method(mime_encode_binary)operator(() ident(body) operator(\)) - pre_constant(self)operator(.)ident(body) operator(=) operator([)ident(body)operator(])operator(.)ident(pack)operator(()stringoperator(\)) - pre_constant(self)operator(.)ident(set_content_type) stringoperator(,) string - pre_constant(self)operator(.)ident(encoding) operator(=) string - reserved(end) - - reserved(def) method(mime_encode_multipart)operator(() ident(top) operator(=) pre_constant(true) operator(\)) - pre_constant(self)operator(.)ident(mime_version) operator(=) string reserved(if) ident(top) - pre_constant(self)operator(.)ident(set_content_type) stringoperator(,) string - ident(e) operator(=) ident(encoding)operator(()pre_constant(nil)operator(\)) - reserved(if) ident(e) reserved(and) reserved(not) regexp operator(===) ident(e) - ident(raise) constant(ArgumentError)operator(,) - string - reserved(end) - reserved(end) - - reserved(def) method(create_empty_mail) - pre_constant(self)operator(.)ident(class)operator(.)ident(new)operator(()constant(StringPort)operator(.)ident(new)operator(()stringoperator(\))operator(,) instance_variable(@config)operator(\)) - reserved(end) - - reserved(def) method(create_reply) - ident(setup_reply) ident(create_empty_mail)operator(()operator(\)) - reserved(end) - - reserved(def) method(setup_reply)operator(() ident(m) operator(\)) - reserved(if) ident(tmp) operator(=) ident(reply_addresses)operator(()pre_constant(nil)operator(\)) - ident(m)operator(.)ident(to_addrs) operator(=) ident(tmp) - reserved(end) - - ident(mid) operator(=) ident(message_id)operator(()pre_constant(nil)operator(\)) - ident(tmp) operator(=) ident(references)operator(()pre_constant(nil)operator(\)) operator(||) operator([)operator(]) - ident(tmp)operator(.)ident(push) ident(mid) reserved(if) ident(mid) - ident(m)operator(.)ident(in_reply_to) operator(=) operator([)ident(mid)operator(]) reserved(if) ident(mid) - ident(m)operator(.)ident(references) operator(=) ident(tmp) reserved(unless) ident(tmp)operator(.)ident(empty?) - ident(m)operator(.)ident(subject) operator(=) string operator(+) ident(subject)operator(()stringoperator(\))operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - - ident(m) - reserved(end) - - reserved(def) method(create_forward) - ident(setup_forward) ident(create_empty_mail)operator(()operator(\)) - reserved(end) - - reserved(def) method(setup_forward)operator(() ident(mail) operator(\)) - ident(m) operator(=) constant(Mail)operator(.)ident(new)operator(()constant(StringPort)operator(.)ident(new)operator(()stringoperator(\))operator(\)) - ident(m)operator(.)ident(body) operator(=) ident(decoded) - ident(m)operator(.)ident(set_content_type) stringoperator(,) string - ident(m)operator(.)ident(encoding) operator(=) ident(encoding)operator(()stringoperator(\)) - ident(mail)operator(.)ident(parts)operator(.)ident(push) ident(m) - reserved(end) - - reserved(end) - - - reserved(class) class(DeleteFields) - - constant(NOSEND_FIELDS) operator(=) string - - reserved(def) method(initialize)operator(() ident(nosend) operator(=) pre_constant(nil)operator(,) ident(delempty) operator(=) pre_constant(true) operator(\)) - instance_variable(@no_send_fields) operator(=) ident(nosend) operator(||) constant(NOSEND_FIELDS)operator(.)ident(dup) - instance_variable(@delete_empty_fields) operator(=) ident(delempty) - reserved(end) - - ident(attr) symbol(:no_send_fields) - ident(attr) symbol(:delete_empty_fields)operator(,) pre_constant(true) - - reserved(def) method(exec)operator(() ident(mail) operator(\)) - instance_variable(@no_send_fields)operator(.)ident(each) reserved(do) operator(|)ident(nm)operator(|) - ident(delete) ident(nm) - reserved(end) - ident(delete_if) operator({)operator(|)ident(n)operator(,)ident(v)operator(|) ident(v)operator(.)ident(empty?) operator(}) reserved(if) instance_variable(@delete_empty_fields) - reserved(end) - - reserved(end) - - - reserved(class) class(AddMessageId) - - reserved(def) method(initialize)operator(() ident(fqdn) operator(=) pre_constant(nil) operator(\)) - instance_variable(@fqdn) operator(=) ident(fqdn) - reserved(end) - - ident(attr) symbol(:fqdn)operator(,) pre_constant(true) - - reserved(def) method(exec)operator(() ident(mail) operator(\)) - ident(mail)operator(.)ident(message_id) operator(=) operator(::)constant(TMail)operator(::)ident(new_msgid)operator(()instance_variable(@fqdn)operator(\)) - reserved(end) - - reserved(end) - - - reserved(class) class(AddDate) - - reserved(def) method(exec)operator(() ident(mail) operator(\)) - ident(mail)operator(.)ident(date) operator(=) constant(Time)operator(.)ident(now) - reserved(end) - - reserved(end) - - - reserved(class) class(MimeEncodeAuto) - - reserved(def) method(initialize)operator(() ident(s) operator(=) pre_constant(nil)operator(,) ident(m) operator(=) pre_constant(nil) operator(\)) - instance_variable(@singlepart_composer) operator(=) ident(s) operator(||) constant(MimeEncodeSingle)operator(.)ident(new) - instance_variable(@multipart_composer) operator(=) ident(m) operator(||) constant(MimeEncodeMulti)operator(.)ident(new) - reserved(end) - - ident(attr) symbol(:singlepart_composer) - ident(attr) symbol(:multipart_composer) - - reserved(def) method(exec)operator(() ident(mail) operator(\)) - reserved(if) ident(mail)operator(.)ident(_builtin_multipart?) - reserved(then) instance_variable(@multipart_composer) - reserved(else) instance_variable(@singlepart_composer) reserved(end)operator(.)ident(exec) ident(mail) - reserved(end) - - reserved(end) - - - reserved(class) class(MimeEncodeSingle) - - reserved(def) method(exec)operator(() ident(mail) operator(\)) - ident(mail)operator(.)ident(mime_version) operator(=) string - ident(b) operator(=) ident(mail)operator(.)ident(body) - reserved(if) constant(NKF)operator(.)ident(guess)operator(()ident(b)operator(\)) operator(!=) constant(NKF)operator(::)constant(BINARY) - ident(on_text) ident(b) - reserved(else) - ident(on_binary) ident(b) - reserved(end) - reserved(end) - - reserved(def) method(on_text)operator(() ident(body) operator(\)) - ident(mail)operator(.)ident(body) operator(=) constant(NKF)operator(.)ident(nkf)operator(()stringoperator(,) ident(body)operator(\)) - ident(mail)operator(.)ident(set_content_type) stringoperator(,) stringoperator(,) operator({)string operator(=)operator(>) stringoperator(}) - ident(mail)operator(.)ident(encoding) operator(=) string - reserved(end) - - reserved(def) method(on_binary)operator(() ident(body) operator(\)) - ident(mail)operator(.)ident(body) operator(=) operator([)ident(body)operator(])operator(.)ident(pack)operator(()stringoperator(\)) - ident(mail)operator(.)ident(set_content_type) stringoperator(,) string - ident(mail)operator(.)ident(encoding) operator(=) string - reserved(end) - - reserved(end) - - - reserved(class) class(MimeEncodeMulti) - - reserved(def) method(exec)operator(() ident(mail)operator(,) ident(top) operator(=) pre_constant(true) operator(\)) - ident(mail)operator(.)ident(mime_version) operator(=) string reserved(if) ident(top) - ident(mail)operator(.)ident(set_content_type) stringoperator(,) string - ident(e) operator(=) ident(encoding)operator(()pre_constant(nil)operator(\)) - reserved(if) ident(e) reserved(and) reserved(not) regexp operator(===) ident(e) - ident(raise) constant(ArgumentError)operator(,) - string - reserved(end) - ident(mail)operator(.)ident(parts)operator(.)ident(each) reserved(do) operator(|)ident(m)operator(|) - ident(exec) ident(m)operator(,) pre_constant(false) reserved(if) ident(m)operator(.)ident(_builtin_multipart?) - reserved(end) - reserved(end) - - reserved(end) - -reserved(end) comment(# module TMail) -comment(#) -comment(# obsolete.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -reserved(module) class(TMail) - - comment(# mail.rb) - reserved(class) class(Mail) - reserved(alias) method(include?) method(key?) - reserved(alias) method(has_key?) method(key?) - - reserved(def) method(values) - ident(ret) operator(=) operator([)operator(]) - ident(each_field) operator({)operator(|)ident(v)operator(|) ident(ret)operator(.)ident(push) ident(v) operator(}) - ident(ret) - reserved(end) - - reserved(def) method(value?)operator(() ident(val) operator(\)) - constant(HeaderField) operator(===) ident(val) reserved(or) reserved(return) pre_constant(false) - - operator([) instance_variable(@header)operator([)ident(val)operator(.)ident(name)operator(.)ident(downcase)operator(]) operator(])operator(.)ident(flatten)operator(.)ident(include?) ident(val) - reserved(end) - - reserved(alias) method(has_value?) method(value?) - reserved(end) - - - comment(# facade.rb) - reserved(class) class(Mail) - reserved(def) method(from_addr)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - ident(addr)operator(,) operator(=) ident(from_addrs)operator(()pre_constant(nil)operator(\)) - ident(addr) operator(||) ident(default) - reserved(end) - - reserved(def) method(from_address)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(a) operator(=) ident(from_addr)operator(()pre_constant(nil)operator(\)) - ident(a)operator(.)ident(spec) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(alias) method(from_address=) method(from_addrs=) - - reserved(def) method(from_phrase)operator(() ident(default) operator(=) pre_constant(nil) operator(\)) - reserved(if) ident(a) operator(=) ident(from_addr)operator(()pre_constant(nil)operator(\)) - ident(a)operator(.)ident(phrase) - reserved(else) - ident(default) - reserved(end) - reserved(end) - - reserved(alias) method(msgid) method(message_id) - reserved(alias) method(msgid=) method(message_id=) - - reserved(alias) method(each_dest) method(each_destination) - reserved(end) - - - comment(# address.rb) - reserved(class) class(Address) - reserved(alias) method(route) method(routes) - reserved(alias) method(addr) method(spec) - - reserved(def) method(spec=)operator(() ident(str) operator(\)) - instance_variable(@local)operator(,) instance_variable(@domain) operator(=) ident(str)operator(.)ident(split)operator(()regexpoperator(,)integer(2)operator(\))operator(.)ident(map) operator({)operator(|)ident(s)operator(|) ident(s)operator(.)ident(split)operator(()regexpoperator(\)) operator(}) - reserved(end) - - reserved(alias) method(addr=) method(spec=) - reserved(alias) method(address=) method(spec=) - reserved(end) - - - comment(# mbox.rb) - reserved(class) class(MhMailbox) - reserved(alias) method(new_mail) method(new_port) - reserved(alias) method(each_mail) method(each_port) - reserved(alias) method(each_newmail) method(each_new_port) - reserved(end) - reserved(class) class(UNIXMbox) - reserved(alias) method(new_mail) method(new_port) - reserved(alias) method(each_mail) method(each_port) - reserved(alias) method(each_newmail) method(each_new_port) - reserved(end) - reserved(class) class(Maildir) - reserved(alias) method(new_mail) method(new_port) - reserved(alias) method(each_mail) method(each_port) - reserved(alias) method(each_newmail) method(each_new_port) - reserved(end) - - - comment(# utils.rb) - ident(extend) constant(TextUtils) - - reserved(class) operator(<<) class(self) - reserved(alias) method(msgid?) method(message_id?) - reserved(alias) method(boundary) method(new_boundary) - reserved(alias) method(msgid) method(new_message_id) - reserved(alias) method(new_msgid) method(new_message_id) - reserved(end) - - reserved(def) constant(Mail)operator(.)method(boundary) - operator(::)constant(TMail)operator(.)ident(new_boundary) - reserved(end) - - reserved(def) constant(Mail)operator(.)method(msgid) - operator(::)constant(TMail)operator(.)ident(new_message_id) - reserved(end) - -reserved(end) comment(# module TMail) -comment(#) -comment(# DO NOT MODIFY!!!!) -comment(# This file is automatically generated by racc 1.4.3) -comment(# from racc grammer file "parser.y".) -comment(#) -comment(#) -comment(# parser.rb: generated by racc (runtime embedded\)) -comment(#) - -comment(###### racc/parser.rb) - -reserved(unless) global_variable($")operator(.)ident(index) string -global_variable($")operator(.)ident(push) string - -pre_constant(self)operator(.)ident(class)operator(.)ident(module_eval) stringoperator(,) stringoperator(,) integer(1)string -# -# This program is free software. -# You can distribute/modify this program under the same terms of ruby. -# -# As a special exception, when this code is copied by Racc -# into a Racc output file, you may use that output file -# without restriction. -# -# $Id: parser.rb,v 1.1.1.1 2004/10/14 11:59:58 webster132 Exp $ -# - -unless defined? NotImplementedError - NotImplementedError = NotImplementError -end - - -module Racc - class ParseError < StandardError; end -end -unless defined?(::ParseError\) - ParseError = Racc::ParseError -end - - -module Racc - - unless defined? Racc_No_Extentions - Racc_No_Extentions = false - end - - class Parser - - Racc_Runtime_Version = '1.4.3' - Racc_Runtime_Revision = '$Revision: 1.1.1.1 $'.split(/)content(\\s)content(+/\)[1] - - Racc_Runtime_Core_Version_R = '1.4.3' - Racc_Runtime_Core_Revision_R = '$Revision: 1.1.1.1 $'.split(/)content(\\s)content(+/\)[1] - begin - require 'racc/cparse' - # Racc_Runtime_Core_Version_C = (defined in extention\) - Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split(/)content(\\s)content(+/\)[2] - unless new.respond_to?(:_racc_do_parse_c, true\) - raise LoadError, 'old cparse.so' - end - if Racc_No_Extentions - raise LoadError, 'selecting ruby version of racc runtime core' - end - - Racc_Main_Parsing_Routine = :_racc_do_parse_c - Racc_YY_Parse_Method = :_racc_yyparse_c - Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C - Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_C - Racc_Runtime_Type = 'c' - rescue LoadError - Racc_Main_Parsing_Routine = :_racc_do_parse_rb - Racc_YY_Parse_Method = :_racc_yyparse_rb - Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R - Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_R - Racc_Runtime_Type = 'ruby' - end - - def self.racc_runtime_type - Racc_Runtime_Type - end - - private - - def _racc_setup - @yydebug = false unless self.class::Racc_debug_parser - @yydebug = false unless defined? @yydebug - if @yydebug - @racc_debug_out = $stderr unless defined? @racc_debug_out - @racc_debug_out ||= $stderr - end - arg = self.class::Racc_arg - arg[13] = true if arg.size < 14 - arg - end - - def _racc_init_sysvars - @racc_state = [0] - @racc_tstack = [] - @racc_vstack = [] - - @racc_t = nil - @racc_val = nil - - @racc_read_next = true - - @racc_user_yyerror = false - @racc_error_status = 0 - end - - - ### - ### do_parse - ### - - def do_parse - __send__ Racc_Main_Parsing_Routine, _racc_setup(\), false - end - - def next_token - raise NotImplementedError, "#{self.class})content(\\#)content(next_token is not defined" - end - - def _racc_do_parse_rb( arg, in_debug \) - action_table, action_check, action_default, action_pointer, - goto_table, goto_check, goto_default, goto_pointer, - nt_base, reduce_table, token_table, shift_n, - reduce_n, use_result, * = arg - - _racc_init_sysvars - tok = act = i = nil - nerr = 0 - - catch(:racc_end_parse\) { - while true - if i = action_pointer[@racc_state[-1]] - if @racc_read_next - if @racc_t != 0 # not EOF - tok, @racc_val = next_token(\) - unless tok # EOF - @racc_t = 0 - else - @racc_t = (token_table[tok] or 1\) # error token - end - racc_read_token(@racc_t, tok, @racc_val\) if @yydebug - @racc_read_next = false - end - end - i += @racc_t - if i >= 0 and - act = action_table[i] and - action_check[i] == @racc_state[-1] - ; - else - act = action_default[@racc_state[-1]] - end - else - act = action_default[@racc_state[-1]] - end - while act = _racc_evalact(act, arg\) - end - end - } - end - - - ### - ### yyparse - ### - - def yyparse( recv, mid \) - __send__ Racc_YY_Parse_Method, recv, mid, _racc_setup(\), true - end - - def _racc_yyparse_rb( recv, mid, arg, c_debug \) - action_table, action_check, action_default, action_pointer, - goto_table, goto_check, goto_default, goto_pointer, - nt_base, reduce_table, token_table, shift_n, - reduce_n, use_result, * = arg - - _racc_init_sysvars - tok = nil - act = nil - i = nil - nerr = 0 - - - catch(:racc_end_parse\) { - until i = action_pointer[@racc_state[-1]] - while act = _racc_evalact(action_default[@racc_state[-1]], arg\) - end - end - - recv.__send__(mid\) do |tok, val| -# $stderr.puts "rd: tok=#{tok}, val=#{val}" - unless tok - @racc_t = 0 - else - @racc_t = (token_table[tok] or 1\) # error token - end - @racc_val = val - @racc_read_next = false - - i += @racc_t - if i >= 0 and - act = action_table[i] and - action_check[i] == @racc_state[-1] - ; -# $stderr.puts "01: act=#{act}" - else - act = action_default[@racc_state[-1]] -# $stderr.puts "02: act=#{act}" -# $stderr.puts "curstate=#{@racc_state[-1]}" - end - - while act = _racc_evalact(act, arg\) - end - - while not (i = action_pointer[@racc_state[-1]]\) or - not @racc_read_next or - @racc_t == 0 # $ - if i and i += @racc_t and - i >= 0 and - act = action_table[i] and - action_check[i] == @racc_state[-1] - ; -# $stderr.puts "03: act=#{act}" - else -# $stderr.puts "04: act=#{act}" - act = action_default[@racc_state[-1]] - end - - while act = _racc_evalact(act, arg\) - end - end - end - } - end - - - ### - ### common - ### - - def _racc_evalact( act, arg \) -# $stderr.puts "ea: act=#{act}" - action_table, action_check, action_default, action_pointer, - goto_table, goto_check, goto_default, goto_pointer, - nt_base, reduce_table, token_table, shift_n, - reduce_n, use_result, * = arg -nerr = 0 # tmp - - if act > 0 and act < shift_n - # - # shift - # - - if @racc_error_status > 0 - @racc_error_status -= 1 unless @racc_t == 1 # error token - end - - @racc_vstack.push @racc_val - @racc_state.push act - @racc_read_next = true - - if @yydebug - @racc_tstack.push @racc_t - racc_shift @racc_t, @racc_tstack, @racc_vstack - end - - elsif act < 0 and act > -reduce_n - # - # reduce - # - - code = catch(:racc_jump\) { - @racc_state.push _racc_do_reduce(arg, act\) - false - } - if code - case code - when 1 # yyerror - @racc_user_yyerror = true # user_yyerror - return -reduce_n - when 2 # yyaccept - return shift_n - else - raise RuntimeError, '[Racc Bug] unknown jump code' - end - end - - elsif act == shift_n - # - # accept - # - - racc_accept if @yydebug - throw :racc_end_parse, @racc_vstack[0] - - elsif act == -reduce_n - # - # error - # - - case @racc_error_status - when 0 - unless arg[21] # user_yyerror - nerr += 1 - on_error @racc_t, @racc_val, @racc_vstack - end - when 3 - if @racc_t == 0 # is $ - throw :racc_end_parse, nil - end - @racc_read_next = true - end - @racc_user_yyerror = false - @racc_error_status = 3 - - while true - if i = action_pointer[@racc_state[-1]] - i += 1 # error token - if i >= 0 and - (act = action_table[i]\) and - action_check[i] == @racc_state[-1] - break - end - end - - throw :racc_end_parse, nil if @racc_state.size < 2 - @racc_state.pop - @racc_vstack.pop - if @yydebug - @racc_tstack.pop - racc_e_pop @racc_state, @racc_tstack, @racc_vstack - end - end - - return act - - else - raise RuntimeError, "[Racc Bug] unknown action #{act.inspect}" - end - - racc_next_state(@racc_state[-1], @racc_state\) if @yydebug - - nil - end - - def _racc_do_reduce( arg, act \) - action_table, action_check, action_default, action_pointer, - goto_table, goto_check, goto_default, goto_pointer, - nt_base, reduce_table, token_table, shift_n, - reduce_n, use_result, * = arg - state = @racc_state - vstack = @racc_vstack - tstack = @racc_tstack - - i = act * -3 - len = reduce_table[i] - reduce_to = reduce_table[i+1] - method_id = reduce_table[i+2] - void_array = [] - - tmp_t = tstack[-len, len] if @yydebug - tmp_v = vstack[-len, len] - tstack[-len, len] = void_array if @yydebug - vstack[-len, len] = void_array - state[-len, len] = void_array - - # tstack must be updated AFTER method call - if use_result - vstack.push __send__(method_id, tmp_v, vstack, tmp_v[0]\) - else - vstack.push __send__(method_id, tmp_v, vstack\) - end - tstack.push reduce_to - - racc_reduce(tmp_t, reduce_to, tstack, vstack\) if @yydebug - - k1 = reduce_to - nt_base - if i = goto_pointer[k1] - i += state[-1] - if i >= 0 and (curstate = goto_table[i]\) and goto_check[i] == k1 - return curstate - end - end - goto_default[k1] - end - - def on_error( t, val, vstack \) - raise ParseError, sprintf(")content(\\n)content(parse error on value %s (%s\)", - val.inspect, token_to_str(t\) || '?'\) - end - - def yyerror - throw :racc_jump, 1 - end - - def yyaccept - throw :racc_jump, 2 - end - - def yyerrok - @racc_error_status = 0 - end - - - # for debugging output - - def racc_read_token( t, tok, val \) - @racc_debug_out.print 'read ' - @racc_debug_out.print tok.inspect, '(', racc_token2str(t\), '\) ' - @racc_debug_out.puts val.inspect - @racc_debug_out.puts - end - - def racc_shift( tok, tstack, vstack \) - @racc_debug_out.puts "shift #{racc_token2str tok}" - racc_print_stacks tstack, vstack - @racc_debug_out.puts - end - - def racc_reduce( toks, sim, tstack, vstack \) - out = @racc_debug_out - out.print 'reduce ' - if toks.empty? - out.print ' ' - else - toks.each {|t| out.print ' ', racc_token2str(t\) } - end - out.puts " --> #{racc_token2str(sim\)}" - - racc_print_stacks tstack, vstack - @racc_debug_out.puts - end - - def racc_accept - @racc_debug_out.puts 'accept' - @racc_debug_out.puts - end - - def racc_e_pop( state, tstack, vstack \) - @racc_debug_out.puts 'error recovering mode: pop token' - racc_print_states state - racc_print_stacks tstack, vstack - @racc_debug_out.puts - end - - def racc_next_state( curstate, state \) - @racc_debug_out.puts "goto #{curstate}" - racc_print_states state - @racc_debug_out.puts - end - - def racc_print_stacks( t, v \) - out = @racc_debug_out - out.print ' [' - t.each_index do |i| - out.print ' (', racc_token2str(t[i]\), ' ', v[i].inspect, '\)' - end - out.puts ' ]' - end - - def racc_print_states( s \) - out = @racc_debug_out - out.print ' [' - s.each {|st| out.print ' ', st } - out.puts ' ]' - end - - def racc_token2str( tok \) - self.class::Racc_token_to_s_table[tok] or - raise RuntimeError, "[Racc Bug] can't convert token #{tok} to string" - end - - def token_to_str( t \) - self.class::Racc_token_to_s_table[t] - end - - end - -end)delimiter( -..end /home/aamine/lib/ruby/racc/parser.rb modeval..idb76f2e220d)> -reserved(end) comment(# end of racc/parser.rb) - - -comment(#) -comment(# parser.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -ident(require) string -ident(require) string - - -reserved(module) class(TMail) - - reserved(class) class(Parser) operator(<) constant(Racc)operator(::)constant(Parser) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(331)string - -comment(##### racc 1.4.3 generates ###) - -ident(racc_reduce_table) operator(=) operator([) - integer(0)operator(,) integer(0)operator(,) symbol(:racc_error)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_1)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_2)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_3)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_4)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_5)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_6)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_7)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_8)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_9)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_10)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_11)operator(,) - integer(2)operator(,) integer(35)operator(,) symbol(:_reduce_12)operator(,) - integer(6)operator(,) integer(36)operator(,) symbol(:_reduce_13)operator(,) - integer(0)operator(,) integer(48)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(48)operator(,) symbol(:_reduce_none)operator(,) - integer(3)operator(,) integer(49)operator(,) symbol(:_reduce_16)operator(,) - integer(5)operator(,) integer(49)operator(,) symbol(:_reduce_17)operator(,) - integer(1)operator(,) integer(50)operator(,) symbol(:_reduce_18)operator(,) - integer(7)operator(,) integer(37)operator(,) symbol(:_reduce_19)operator(,) - integer(0)operator(,) integer(51)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(51)operator(,) symbol(:_reduce_21)operator(,) - integer(0)operator(,) integer(52)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(52)operator(,) symbol(:_reduce_23)operator(,) - integer(1)operator(,) integer(58)operator(,) symbol(:_reduce_24)operator(,) - integer(3)operator(,) integer(58)operator(,) symbol(:_reduce_25)operator(,) - integer(2)operator(,) integer(58)operator(,) symbol(:_reduce_26)operator(,) - integer(0)operator(,) integer(53)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(53)operator(,) symbol(:_reduce_28)operator(,) - integer(0)operator(,) integer(54)operator(,) symbol(:_reduce_29)operator(,) - integer(3)operator(,) integer(54)operator(,) symbol(:_reduce_30)operator(,) - integer(0)operator(,) integer(55)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(55)operator(,) symbol(:_reduce_32)operator(,) - integer(2)operator(,) integer(55)operator(,) symbol(:_reduce_33)operator(,) - integer(0)operator(,) integer(56)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(56)operator(,) symbol(:_reduce_35)operator(,) - integer(1)operator(,) integer(61)operator(,) symbol(:_reduce_36)operator(,) - integer(1)operator(,) integer(61)operator(,) symbol(:_reduce_37)operator(,) - integer(0)operator(,) integer(57)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(57)operator(,) symbol(:_reduce_39)operator(,) - integer(1)operator(,) integer(38)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(38)operator(,) symbol(:_reduce_none)operator(,) - integer(3)operator(,) integer(38)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(46)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(46)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(46)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(39)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(39)operator(,) symbol(:_reduce_47)operator(,) - integer(1)operator(,) integer(64)operator(,) symbol(:_reduce_48)operator(,) - integer(3)operator(,) integer(64)operator(,) symbol(:_reduce_49)operator(,) - integer(1)operator(,) integer(68)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(68)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(69)operator(,) symbol(:_reduce_52)operator(,) - integer(3)operator(,) integer(69)operator(,) symbol(:_reduce_53)operator(,) - integer(1)operator(,) integer(47)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(47)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(47)operator(,) symbol(:_reduce_56)operator(,) - integer(2)operator(,) integer(67)operator(,) symbol(:_reduce_none)operator(,) - integer(3)operator(,) integer(65)operator(,) symbol(:_reduce_58)operator(,) - integer(2)operator(,) integer(65)operator(,) symbol(:_reduce_59)operator(,) - integer(1)operator(,) integer(70)operator(,) symbol(:_reduce_60)operator(,) - integer(2)operator(,) integer(70)operator(,) symbol(:_reduce_61)operator(,) - integer(4)operator(,) integer(62)operator(,) symbol(:_reduce_62)operator(,) - integer(3)operator(,) integer(62)operator(,) symbol(:_reduce_63)operator(,) - integer(2)operator(,) integer(72)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(73)operator(,) symbol(:_reduce_65)operator(,) - integer(4)operator(,) integer(73)operator(,) symbol(:_reduce_66)operator(,) - integer(3)operator(,) integer(63)operator(,) symbol(:_reduce_67)operator(,) - integer(1)operator(,) integer(63)operator(,) symbol(:_reduce_68)operator(,) - integer(1)operator(,) integer(74)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(74)operator(,) symbol(:_reduce_70)operator(,) - integer(1)operator(,) integer(71)operator(,) symbol(:_reduce_71)operator(,) - integer(3)operator(,) integer(71)operator(,) symbol(:_reduce_72)operator(,) - integer(1)operator(,) integer(59)operator(,) symbol(:_reduce_73)operator(,) - integer(3)operator(,) integer(59)operator(,) symbol(:_reduce_74)operator(,) - integer(1)operator(,) integer(76)operator(,) symbol(:_reduce_75)operator(,) - integer(2)operator(,) integer(76)operator(,) symbol(:_reduce_76)operator(,) - integer(1)operator(,) integer(75)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(75)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(75)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(77)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(77)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(77)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(66)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(66)operator(,) symbol(:_reduce_none)operator(,) - integer(3)operator(,) integer(60)operator(,) symbol(:_reduce_85)operator(,) - integer(1)operator(,) integer(40)operator(,) symbol(:_reduce_86)operator(,) - integer(3)operator(,) integer(40)operator(,) symbol(:_reduce_87)operator(,) - integer(1)operator(,) integer(79)operator(,) symbol(:_reduce_none)operator(,) - integer(2)operator(,) integer(79)operator(,) symbol(:_reduce_89)operator(,) - integer(1)operator(,) integer(41)operator(,) symbol(:_reduce_90)operator(,) - integer(2)operator(,) integer(41)operator(,) symbol(:_reduce_91)operator(,) - integer(3)operator(,) integer(42)operator(,) symbol(:_reduce_92)operator(,) - integer(5)operator(,) integer(43)operator(,) symbol(:_reduce_93)operator(,) - integer(3)operator(,) integer(43)operator(,) symbol(:_reduce_94)operator(,) - integer(0)operator(,) integer(80)operator(,) symbol(:_reduce_95)operator(,) - integer(5)operator(,) integer(80)operator(,) symbol(:_reduce_96)operator(,) - integer(1)operator(,) integer(82)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(82)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(44)operator(,) symbol(:_reduce_99)operator(,) - integer(3)operator(,) integer(45)operator(,) symbol(:_reduce_100)operator(,) - integer(0)operator(,) integer(81)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(81)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(78)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(78)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(78)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(78)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(78)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(78)operator(,) symbol(:_reduce_none)operator(,) - integer(1)operator(,) integer(78)operator(,) symbol(:_reduce_none) operator(]) - -ident(racc_reduce_n) operator(=) integer(110) - -ident(racc_shift_n) operator(=) integer(168) - -ident(racc_action_table) operator(=) operator([) - integer(-70)operator(,) integer(-69)operator(,) integer(23)operator(,) integer(25)operator(,) integer(146)operator(,) integer(147)operator(,) integer(29)operator(,) integer(31)operator(,) integer(105)operator(,) integer(106)operator(,) - integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) integer(136)operator(,) integer(27)operator(,) integer(-70)operator(,) integer(-69)operator(,) integer(32)operator(,) integer(101)operator(,) - integer(-70)operator(,) integer(-69)operator(,) integer(154)operator(,) integer(100)operator(,) integer(113)operator(,) integer(115)operator(,) integer(-70)operator(,) integer(-69)operator(,) integer(-70)operator(,) integer(109)operator(,) - integer(75)operator(,) integer(23)operator(,) integer(25)operator(,) integer(101)operator(,) integer(155)operator(,) integer(29)operator(,) integer(31)operator(,) integer(142)operator(,) integer(143)operator(,) integer(16)operator(,) - integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) integer(107)operator(,) integer(27)operator(,) integer(23)operator(,) integer(25)operator(,) integer(32)operator(,) integer(98)operator(,) integer(29)operator(,) - integer(31)operator(,) integer(96)operator(,) integer(94)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) integer(78)operator(,) integer(27)operator(,) integer(23)operator(,) - integer(25)operator(,) integer(32)operator(,) integer(112)operator(,) integer(29)operator(,) integer(31)operator(,) integer(74)operator(,) integer(91)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) - integer(22)operator(,) integer(88)operator(,) integer(117)operator(,) integer(92)operator(,) integer(81)operator(,) integer(32)operator(,) integer(23)operator(,) integer(25)operator(,) integer(80)operator(,) integer(123)operator(,) - integer(29)operator(,) integer(31)operator(,) integer(100)operator(,) integer(125)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) integer(126)operator(,) integer(23)operator(,) - integer(25)operator(,) integer(109)operator(,) integer(32)operator(,) integer(29)operator(,) integer(31)operator(,) integer(91)operator(,) integer(128)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) - integer(22)operator(,) integer(129)operator(,) integer(27)operator(,) integer(23)operator(,) integer(25)operator(,) integer(32)operator(,) integer(101)operator(,) integer(29)operator(,) integer(31)operator(,) integer(101)operator(,) - integer(130)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) integer(79)operator(,) integer(52)operator(,) integer(23)operator(,) integer(25)operator(,) integer(32)operator(,) - integer(78)operator(,) integer(29)operator(,) integer(31)operator(,) integer(133)operator(,) integer(78)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) integer(77)operator(,) - integer(23)operator(,) integer(25)operator(,) integer(75)operator(,) integer(32)operator(,) integer(29)operator(,) integer(31)operator(,) integer(65)operator(,) integer(62)operator(,) integer(16)operator(,) integer(17)operator(,) - integer(20)operator(,) integer(22)operator(,) integer(139)operator(,) integer(23)operator(,) integer(25)operator(,) integer(101)operator(,) integer(32)operator(,) integer(29)operator(,) integer(31)operator(,) integer(60)operator(,) - integer(100)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) integer(44)operator(,) integer(27)operator(,) integer(101)operator(,) integer(148)operator(,) integer(32)operator(,) - integer(23)operator(,) integer(25)operator(,) integer(120)operator(,) integer(149)operator(,) integer(29)operator(,) integer(31)operator(,) integer(152)operator(,) integer(153)operator(,) integer(16)operator(,) integer(17)operator(,) - integer(20)operator(,) integer(22)operator(,) integer(42)operator(,) integer(27)operator(,) integer(157)operator(,) integer(159)operator(,) integer(32)operator(,) integer(23)operator(,) integer(25)operator(,) integer(120)operator(,) - integer(40)operator(,) integer(29)operator(,) integer(31)operator(,) integer(15)operator(,) integer(164)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) integer(40)operator(,) - integer(27)operator(,) integer(23)operator(,) integer(25)operator(,) integer(32)operator(,) integer(68)operator(,) integer(29)operator(,) integer(31)operator(,) integer(166)operator(,) integer(167)operator(,) integer(16)operator(,) - integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) pre_constant(nil)operator(,) integer(27)operator(,) integer(23)operator(,) integer(25)operator(,) integer(32)operator(,) pre_constant(nil)operator(,) integer(29)operator(,) - integer(31)operator(,) integer(74)operator(,) pre_constant(nil)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) pre_constant(nil)operator(,) integer(23)operator(,) integer(25)operator(,) - pre_constant(nil)operator(,) integer(32)operator(,) integer(29)operator(,) integer(31)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) - pre_constant(nil)operator(,) integer(23)operator(,) integer(25)operator(,) pre_constant(nil)operator(,) integer(32)operator(,) integer(29)operator(,) integer(31)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(16)operator(,) - integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) pre_constant(nil)operator(,) integer(23)operator(,) integer(25)operator(,) pre_constant(nil)operator(,) integer(32)operator(,) integer(29)operator(,) integer(31)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) pre_constant(nil)operator(,) integer(23)operator(,) integer(25)operator(,) pre_constant(nil)operator(,) - integer(32)operator(,) integer(29)operator(,) integer(31)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) pre_constant(nil)operator(,) - integer(27)operator(,) integer(23)operator(,) integer(25)operator(,) integer(32)operator(,) pre_constant(nil)operator(,) integer(29)operator(,) integer(31)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(16)operator(,) - integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) pre_constant(nil)operator(,) integer(23)operator(,) integer(25)operator(,) pre_constant(nil)operator(,) integer(32)operator(,) integer(29)operator(,) integer(31)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) pre_constant(nil)operator(,) integer(23)operator(,) integer(25)operator(,) pre_constant(nil)operator(,) - integer(32)operator(,) integer(29)operator(,) integer(31)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) pre_constant(nil)operator(,) - integer(84)operator(,) integer(25)operator(,) pre_constant(nil)operator(,) integer(32)operator(,) integer(29)operator(,) integer(31)operator(,) pre_constant(nil)operator(,) integer(87)operator(,) integer(16)operator(,) integer(17)operator(,) - integer(20)operator(,) integer(22)operator(,) integer(4)operator(,) integer(6)operator(,) integer(7)operator(,) integer(8)operator(,) integer(9)operator(,) integer(10)operator(,) integer(11)operator(,) integer(12)operator(,) - integer(13)operator(,) integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(84)operator(,) integer(25)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(29)operator(,) integer(31)operator(,) - pre_constant(nil)operator(,) integer(87)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) integer(84)operator(,) integer(25)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - integer(29)operator(,) integer(31)operator(,) pre_constant(nil)operator(,) integer(87)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) integer(84)operator(,) integer(25)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(29)operator(,) integer(31)operator(,) pre_constant(nil)operator(,) integer(87)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) - integer(84)operator(,) integer(25)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(29)operator(,) integer(31)operator(,) pre_constant(nil)operator(,) integer(87)operator(,) integer(16)operator(,) integer(17)operator(,) - integer(20)operator(,) integer(22)operator(,) integer(84)operator(,) integer(25)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(29)operator(,) integer(31)operator(,) pre_constant(nil)operator(,) integer(87)operator(,) - integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22)operator(,) integer(84)operator(,) integer(25)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(29)operator(,) integer(31)operator(,) - pre_constant(nil)operator(,) integer(87)operator(,) integer(16)operator(,) integer(17)operator(,) integer(20)operator(,) integer(22) operator(]) - -ident(racc_action_check) operator(=) operator([) - integer(75)operator(,) integer(28)operator(,) integer(68)operator(,) integer(68)operator(,) integer(136)operator(,) integer(136)operator(,) integer(68)operator(,) integer(68)operator(,) integer(72)operator(,) integer(72)operator(,) - integer(68)operator(,) integer(68)operator(,) integer(68)operator(,) integer(68)operator(,) integer(126)operator(,) integer(68)operator(,) integer(75)operator(,) integer(28)operator(,) integer(68)operator(,) integer(67)operator(,) - integer(75)operator(,) integer(28)operator(,) integer(143)operator(,) integer(66)operator(,) integer(86)operator(,) integer(86)operator(,) integer(75)operator(,) integer(28)operator(,) integer(75)operator(,) integer(75)operator(,) - integer(28)operator(,) integer(3)operator(,) integer(3)operator(,) integer(86)operator(,) integer(143)operator(,) integer(3)operator(,) integer(3)operator(,) integer(134)operator(,) integer(134)operator(,) integer(3)operator(,) - integer(3)operator(,) integer(3)operator(,) integer(3)operator(,) integer(73)operator(,) integer(3)operator(,) integer(152)operator(,) integer(152)operator(,) integer(3)operator(,) integer(62)operator(,) integer(152)operator(,) - integer(152)operator(,) integer(60)operator(,) integer(56)operator(,) integer(152)operator(,) integer(152)operator(,) integer(152)operator(,) integer(152)operator(,) integer(51)operator(,) integer(152)operator(,) integer(52)operator(,) - integer(52)operator(,) integer(152)operator(,) integer(80)operator(,) integer(52)operator(,) integer(52)operator(,) integer(52)operator(,) integer(50)operator(,) integer(52)operator(,) integer(52)operator(,) integer(52)operator(,) - integer(52)operator(,) integer(45)operator(,) integer(89)operator(,) integer(52)operator(,) integer(42)operator(,) integer(52)operator(,) integer(71)operator(,) integer(71)operator(,) integer(41)operator(,) integer(96)operator(,) - integer(71)operator(,) integer(71)operator(,) integer(97)operator(,) integer(98)operator(,) integer(71)operator(,) integer(71)operator(,) integer(71)operator(,) integer(71)operator(,) integer(100)operator(,) integer(7)operator(,) - integer(7)operator(,) integer(101)operator(,) integer(71)operator(,) integer(7)operator(,) integer(7)operator(,) integer(102)operator(,) integer(104)operator(,) integer(7)operator(,) integer(7)operator(,) integer(7)operator(,) - integer(7)operator(,) integer(105)operator(,) integer(7)operator(,) integer(8)operator(,) integer(8)operator(,) integer(7)operator(,) integer(108)operator(,) integer(8)operator(,) integer(8)operator(,) integer(111)operator(,) - integer(112)operator(,) integer(8)operator(,) integer(8)operator(,) integer(8)operator(,) integer(8)operator(,) integer(40)operator(,) integer(8)operator(,) integer(9)operator(,) integer(9)operator(,) integer(8)operator(,) - integer(36)operator(,) integer(9)operator(,) integer(9)operator(,) integer(117)operator(,) integer(121)operator(,) integer(9)operator(,) integer(9)operator(,) integer(9)operator(,) integer(9)operator(,) integer(33)operator(,) - integer(10)operator(,) integer(10)operator(,) integer(70)operator(,) integer(9)operator(,) integer(10)operator(,) integer(10)operator(,) integer(13)operator(,) integer(12)operator(,) integer(10)operator(,) integer(10)operator(,) - integer(10)operator(,) integer(10)operator(,) integer(130)operator(,) integer(2)operator(,) integer(2)operator(,) integer(131)operator(,) integer(10)operator(,) integer(2)operator(,) integer(2)operator(,) integer(11)operator(,) - integer(135)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(2)operator(,) integer(6)operator(,) integer(2)operator(,) integer(138)operator(,) integer(139)operator(,) integer(2)operator(,) - integer(90)operator(,) integer(90)operator(,) integer(90)operator(,) integer(140)operator(,) integer(90)operator(,) integer(90)operator(,) integer(141)operator(,) integer(142)operator(,) integer(90)operator(,) integer(90)operator(,) - integer(90)operator(,) integer(90)operator(,) integer(5)operator(,) integer(90)operator(,) integer(148)operator(,) integer(151)operator(,) integer(90)operator(,) integer(127)operator(,) integer(127)operator(,) integer(127)operator(,) - integer(4)operator(,) integer(127)operator(,) integer(127)operator(,) integer(1)operator(,) integer(157)operator(,) integer(127)operator(,) integer(127)operator(,) integer(127)operator(,) integer(127)operator(,) integer(159)operator(,) - integer(127)operator(,) integer(26)operator(,) integer(26)operator(,) integer(127)operator(,) integer(26)operator(,) integer(26)operator(,) integer(26)operator(,) integer(163)operator(,) integer(164)operator(,) integer(26)operator(,) - integer(26)operator(,) integer(26)operator(,) integer(26)operator(,) pre_constant(nil)operator(,) integer(26)operator(,) integer(27)operator(,) integer(27)operator(,) integer(26)operator(,) pre_constant(nil)operator(,) integer(27)operator(,) - integer(27)operator(,) integer(27)operator(,) pre_constant(nil)operator(,) integer(27)operator(,) integer(27)operator(,) integer(27)operator(,) integer(27)operator(,) pre_constant(nil)operator(,) integer(155)operator(,) integer(155)operator(,) - pre_constant(nil)operator(,) integer(27)operator(,) integer(155)operator(,) integer(155)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(155)operator(,) integer(155)operator(,) integer(155)operator(,) integer(155)operator(,) - pre_constant(nil)operator(,) integer(122)operator(,) integer(122)operator(,) pre_constant(nil)operator(,) integer(155)operator(,) integer(122)operator(,) integer(122)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(122)operator(,) - integer(122)operator(,) integer(122)operator(,) integer(122)operator(,) pre_constant(nil)operator(,) integer(76)operator(,) integer(76)operator(,) pre_constant(nil)operator(,) integer(122)operator(,) integer(76)operator(,) integer(76)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(76)operator(,) integer(76)operator(,) integer(76)operator(,) integer(76)operator(,) pre_constant(nil)operator(,) integer(38)operator(,) integer(38)operator(,) pre_constant(nil)operator(,) - integer(76)operator(,) integer(38)operator(,) integer(38)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(38)operator(,) integer(38)operator(,) integer(38)operator(,) integer(38)operator(,) pre_constant(nil)operator(,) - integer(38)operator(,) integer(55)operator(,) integer(55)operator(,) integer(38)operator(,) pre_constant(nil)operator(,) integer(55)operator(,) integer(55)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(55)operator(,) - integer(55)operator(,) integer(55)operator(,) integer(55)operator(,) pre_constant(nil)operator(,) integer(94)operator(,) integer(94)operator(,) pre_constant(nil)operator(,) integer(55)operator(,) integer(94)operator(,) integer(94)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(94)operator(,) integer(94)operator(,) integer(94)operator(,) integer(94)operator(,) pre_constant(nil)operator(,) integer(59)operator(,) integer(59)operator(,) pre_constant(nil)operator(,) - integer(94)operator(,) integer(59)operator(,) integer(59)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(59)operator(,) integer(59)operator(,) integer(59)operator(,) integer(59)operator(,) pre_constant(nil)operator(,) - integer(114)operator(,) integer(114)operator(,) pre_constant(nil)operator(,) integer(59)operator(,) integer(114)operator(,) integer(114)operator(,) pre_constant(nil)operator(,) integer(114)operator(,) integer(114)operator(,) integer(114)operator(,) - integer(114)operator(,) integer(114)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) - integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(77)operator(,) integer(77)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(77)operator(,) integer(77)operator(,) - pre_constant(nil)operator(,) integer(77)operator(,) integer(77)operator(,) integer(77)operator(,) integer(77)operator(,) integer(77)operator(,) integer(44)operator(,) integer(44)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - integer(44)operator(,) integer(44)operator(,) pre_constant(nil)operator(,) integer(44)operator(,) integer(44)operator(,) integer(44)operator(,) integer(44)operator(,) integer(44)operator(,) integer(113)operator(,) integer(113)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(113)operator(,) integer(113)operator(,) pre_constant(nil)operator(,) integer(113)operator(,) integer(113)operator(,) integer(113)operator(,) integer(113)operator(,) integer(113)operator(,) - integer(88)operator(,) integer(88)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(88)operator(,) integer(88)operator(,) pre_constant(nil)operator(,) integer(88)operator(,) integer(88)operator(,) integer(88)operator(,) - integer(88)operator(,) integer(88)operator(,) integer(74)operator(,) integer(74)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(74)operator(,) integer(74)operator(,) pre_constant(nil)operator(,) integer(74)operator(,) - integer(74)operator(,) integer(74)operator(,) integer(74)operator(,) integer(74)operator(,) integer(129)operator(,) integer(129)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(129)operator(,) integer(129)operator(,) - pre_constant(nil)operator(,) integer(129)operator(,) integer(129)operator(,) integer(129)operator(,) integer(129)operator(,) integer(129) operator(]) - -ident(racc_action_pointer) operator(=) operator([) - integer(320)operator(,) integer(152)operator(,) integer(129)operator(,) integer(17)operator(,) integer(165)operator(,) integer(172)operator(,) integer(137)operator(,) integer(75)operator(,) integer(89)operator(,) integer(103)operator(,) - integer(116)operator(,) integer(135)operator(,) integer(106)operator(,) integer(105)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(177)operator(,) integer(191)operator(,) integer(1)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(109)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(94)operator(,) pre_constant(nil)operator(,) integer(243)operator(,) pre_constant(nil)operator(,) - integer(99)operator(,) integer(64)operator(,) integer(74)operator(,) pre_constant(nil)operator(,) integer(332)operator(,) integer(52)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - integer(50)operator(,) integer(31)operator(,) integer(45)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(257)operator(,) integer(36)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(283)operator(,) - integer(22)operator(,) pre_constant(nil)operator(,) integer(16)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(-3)operator(,) integer(-10)operator(,) integer(-12)operator(,) pre_constant(nil)operator(,) - integer(103)operator(,) integer(62)operator(,) integer(-8)operator(,) integer(15)operator(,) integer(368)operator(,) integer(0)operator(,) integer(230)operator(,) integer(320)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - integer(47)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(4)operator(,) pre_constant(nil)operator(,) integer(356)operator(,) integer(50)operator(,) - integer(146)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(270)operator(,) pre_constant(nil)operator(,) integer(65)operator(,) integer(56)operator(,) integer(52)operator(,) pre_constant(nil)operator(,) - integer(57)operator(,) integer(62)operator(,) integer(79)operator(,) pre_constant(nil)operator(,) integer(68)operator(,) integer(81)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(77)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) integer(80)operator(,) integer(96)operator(,) integer(344)operator(,) integer(296)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(108)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) integer(98)operator(,) integer(217)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(-19)operator(,) integer(163)operator(,) pre_constant(nil)operator(,) integer(380)operator(,) - integer(128)operator(,) integer(116)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(14)operator(,) integer(124)operator(,) integer(-26)operator(,) pre_constant(nil)operator(,) integer(128)operator(,) integer(141)operator(,) - integer(148)operator(,) integer(141)operator(,) integer(152)operator(,) integer(7)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(160)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) integer(149)operator(,) integer(31)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(204)operator(,) pre_constant(nil)operator(,) integer(167)operator(,) pre_constant(nil)operator(,) integer(174)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(169)operator(,) integer(184)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil) operator(]) - -ident(racc_action_default) operator(=) operator([) - integer(-110)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-14)operator(,) integer(-110)operator(,) integer(-20)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-110)operator(,) - integer(-110)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-10)operator(,) integer(-95)operator(,) integer(-106)operator(,) integer(-107)operator(,) integer(-77)operator(,) integer(-44)operator(,) - integer(-108)operator(,) integer(-11)operator(,) integer(-109)operator(,) integer(-79)operator(,) integer(-43)operator(,) integer(-103)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-60)operator(,) integer(-104)operator(,) - integer(-55)operator(,) integer(-105)operator(,) integer(-78)operator(,) integer(-68)operator(,) integer(-54)operator(,) integer(-71)operator(,) integer(-45)operator(,) integer(-12)operator(,) integer(-110)operator(,) integer(-1)operator(,) - integer(-110)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-2)operator(,) integer(-110)operator(,) integer(-22)operator(,) integer(-51)operator(,) integer(-48)operator(,) integer(-50)operator(,) integer(-3)operator(,) - integer(-40)operator(,) integer(-41)operator(,) integer(-110)operator(,) integer(-46)operator(,) integer(-4)operator(,) integer(-86)operator(,) integer(-5)operator(,) integer(-88)operator(,) integer(-6)operator(,) integer(-90)operator(,) - integer(-110)operator(,) integer(-7)operator(,) integer(-95)operator(,) integer(-8)operator(,) integer(-9)operator(,) integer(-99)operator(,) integer(-101)operator(,) integer(-61)operator(,) integer(-59)operator(,) integer(-56)operator(,) - integer(-69)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-75)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-57)operator(,) integer(-15)operator(,) - integer(-110)operator(,) integer(168)operator(,) integer(-73)operator(,) integer(-80)operator(,) integer(-82)operator(,) integer(-21)operator(,) integer(-24)operator(,) integer(-81)operator(,) integer(-110)operator(,) integer(-27)operator(,) - integer(-110)operator(,) integer(-83)operator(,) integer(-47)operator(,) integer(-89)operator(,) integer(-110)operator(,) integer(-91)operator(,) integer(-110)operator(,) integer(-101)operator(,) integer(-110)operator(,) integer(-100)operator(,) - integer(-102)operator(,) integer(-75)operator(,) integer(-58)operator(,) integer(-52)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-64)operator(,) integer(-63)operator(,) integer(-65)operator(,) integer(-76)operator(,) - integer(-72)operator(,) integer(-67)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-26)operator(,) integer(-23)operator(,) integer(-110)operator(,) integer(-29)operator(,) integer(-49)operator(,) - integer(-84)operator(,) integer(-42)operator(,) integer(-87)operator(,) integer(-92)operator(,) integer(-94)operator(,) integer(-95)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-62)operator(,) integer(-110)operator(,) - integer(-110)operator(,) integer(-25)operator(,) integer(-74)operator(,) integer(-28)operator(,) integer(-31)operator(,) integer(-101)operator(,) integer(-110)operator(,) integer(-53)operator(,) integer(-66)operator(,) integer(-110)operator(,) - integer(-110)operator(,) integer(-34)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-93)operator(,) integer(-96)operator(,) integer(-98)operator(,) integer(-97)operator(,) integer(-110)operator(,) integer(-18)operator(,) - integer(-13)operator(,) integer(-38)operator(,) integer(-110)operator(,) integer(-30)operator(,) integer(-33)operator(,) integer(-110)operator(,) integer(-32)operator(,) integer(-16)operator(,) integer(-19)operator(,) integer(-14)operator(,) - integer(-35)operator(,) integer(-36)operator(,) integer(-37)operator(,) integer(-110)operator(,) integer(-110)operator(,) integer(-39)operator(,) integer(-85)operator(,) integer(-17) operator(]) - -ident(racc_goto_table) operator(=) operator([) - integer(39)operator(,) integer(67)operator(,) integer(70)operator(,) integer(73)operator(,) integer(24)operator(,) integer(37)operator(,) integer(69)operator(,) integer(66)operator(,) integer(36)operator(,) integer(38)operator(,) - integer(57)operator(,) integer(59)operator(,) integer(55)operator(,) integer(67)operator(,) integer(108)operator(,) integer(83)operator(,) integer(90)operator(,) integer(111)operator(,) integer(69)operator(,) integer(99)operator(,) - integer(85)operator(,) integer(49)operator(,) integer(53)operator(,) integer(76)operator(,) integer(158)operator(,) integer(134)operator(,) integer(141)operator(,) integer(70)operator(,) integer(73)operator(,) integer(151)operator(,) - integer(118)operator(,) integer(89)operator(,) integer(45)operator(,) integer(156)operator(,) integer(160)operator(,) integer(150)operator(,) integer(140)operator(,) integer(21)operator(,) integer(14)operator(,) integer(19)operator(,) - integer(119)operator(,) integer(102)operator(,) integer(64)operator(,) integer(63)operator(,) integer(61)operator(,) integer(83)operator(,) integer(70)operator(,) integer(104)operator(,) integer(83)operator(,) integer(58)operator(,) - integer(124)operator(,) integer(132)operator(,) integer(56)operator(,) integer(131)operator(,) integer(97)operator(,) integer(54)operator(,) integer(93)operator(,) integer(43)operator(,) integer(5)operator(,) integer(83)operator(,) - integer(95)operator(,) integer(145)operator(,) integer(76)operator(,) pre_constant(nil)operator(,) integer(116)operator(,) integer(76)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(127)operator(,) integer(138)operator(,) - integer(103)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(38)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(110)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(83)operator(,) integer(83)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(144)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(57)operator(,) integer(121)operator(,) integer(122)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - integer(83)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(135)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(93)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(70)operator(,) integer(162)operator(,) integer(137)operator(,) - integer(70)operator(,) integer(163)operator(,) integer(161)operator(,) integer(38)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(165) operator(]) - -ident(racc_goto_check) operator(=) operator([) - integer(2)operator(,) integer(37)operator(,) integer(37)operator(,) integer(29)operator(,) integer(13)operator(,) integer(13)operator(,) integer(28)operator(,) integer(46)operator(,) integer(31)operator(,) integer(36)operator(,) - integer(41)operator(,) integer(41)operator(,) integer(45)operator(,) integer(37)operator(,) integer(25)operator(,) integer(44)operator(,) integer(32)operator(,) integer(25)operator(,) integer(28)operator(,) integer(47)operator(,) - integer(24)operator(,) integer(4)operator(,) integer(4)operator(,) integer(42)operator(,) integer(23)operator(,) integer(20)operator(,) integer(21)operator(,) integer(37)operator(,) integer(29)operator(,) integer(22)operator(,) - integer(19)operator(,) integer(18)operator(,) integer(17)operator(,) integer(26)operator(,) integer(27)operator(,) integer(16)operator(,) integer(15)operator(,) integer(12)operator(,) integer(11)operator(,) integer(33)operator(,) - integer(34)operator(,) integer(35)operator(,) integer(10)operator(,) integer(9)operator(,) integer(8)operator(,) integer(44)operator(,) integer(37)operator(,) integer(29)operator(,) integer(44)operator(,) integer(7)operator(,) - integer(47)operator(,) integer(43)operator(,) integer(6)operator(,) integer(25)operator(,) integer(46)operator(,) integer(5)operator(,) integer(41)operator(,) integer(3)operator(,) integer(1)operator(,) integer(44)operator(,) - integer(41)operator(,) integer(48)operator(,) integer(42)operator(,) pre_constant(nil)operator(,) integer(24)operator(,) integer(42)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(32)operator(,) integer(25)operator(,) - integer(13)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(36)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(41)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(44)operator(,) integer(44)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(47)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(41)operator(,) integer(31)operator(,) integer(45)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - integer(44)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(46)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(41)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(37)operator(,) integer(29)operator(,) integer(13)operator(,) - integer(37)operator(,) integer(29)operator(,) integer(28)operator(,) integer(36)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(2) operator(]) - -ident(racc_goto_pointer) operator(=) operator([) - pre_constant(nil)operator(,) integer(58)operator(,) integer(-4)operator(,) integer(51)operator(,) integer(14)operator(,) integer(47)operator(,) integer(43)operator(,) integer(39)operator(,) integer(33)operator(,) integer(31)operator(,) - integer(29)operator(,) integer(37)operator(,) integer(35)operator(,) integer(2)operator(,) pre_constant(nil)operator(,) integer(-94)operator(,) integer(-105)operator(,) integer(26)operator(,) integer(-14)operator(,) integer(-59)operator(,) - integer(-93)operator(,) integer(-108)operator(,) integer(-112)operator(,) integer(-127)operator(,) integer(-24)operator(,) integer(-60)operator(,) integer(-110)operator(,) integer(-118)operator(,) integer(-20)operator(,) integer(-24)operator(,) - pre_constant(nil)operator(,) integer(6)operator(,) integer(-34)operator(,) integer(37)operator(,) integer(-50)operator(,) integer(-27)operator(,) integer(6)operator(,) integer(-25)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) integer(1)operator(,) integer(-5)operator(,) integer(-63)operator(,) integer(-29)operator(,) integer(3)operator(,) integer(-8)operator(,) integer(-47)operator(,) integer(-75) operator(]) - -ident(racc_goto_default) operator(=) operator([) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(48)operator(,) integer(41)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(86)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(30)operator(,) integer(34)operator(,) - integer(50)operator(,) integer(51)operator(,) pre_constant(nil)operator(,) integer(46)operator(,) integer(47)operator(,) pre_constant(nil)operator(,) integer(26)operator(,) integer(28)operator(,) integer(71)operator(,) integer(72)operator(,) - integer(33)operator(,) integer(35)operator(,) integer(114)operator(,) integer(82)operator(,) integer(18)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil) operator(]) - -ident(racc_token_table) operator(=) operator({) - pre_constant(false) operator(=)operator(>) integer(0)operator(,) - constant(Object)operator(.)ident(new) operator(=)operator(>) integer(1)operator(,) - symbol(:DATETIME) operator(=)operator(>) integer(2)operator(,) - symbol(:RECEIVED) operator(=)operator(>) integer(3)operator(,) - symbol(:MADDRESS) operator(=)operator(>) integer(4)operator(,) - symbol(:RETPATH) operator(=)operator(>) integer(5)operator(,) - symbol(:KEYWORDS) operator(=)operator(>) integer(6)operator(,) - symbol(:ENCRYPTED) operator(=)operator(>) integer(7)operator(,) - symbol(:MIMEVERSION) operator(=)operator(>) integer(8)operator(,) - symbol(:CTYPE) operator(=)operator(>) integer(9)operator(,) - symbol(:CENCODING) operator(=)operator(>) integer(10)operator(,) - symbol(:CDISPOSITION) operator(=)operator(>) integer(11)operator(,) - symbol(:ADDRESS) operator(=)operator(>) integer(12)operator(,) - symbol(:MAILBOX) operator(=)operator(>) integer(13)operator(,) - symbol(:DIGIT) operator(=)operator(>) integer(14)operator(,) - symbol(:ATOM) operator(=)operator(>) integer(15)operator(,) - string operator(=)operator(>) integer(16)operator(,) - string operator(=)operator(>) integer(17)operator(,) - symbol(:FROM) operator(=)operator(>) integer(18)operator(,) - symbol(:BY) operator(=)operator(>) integer(19)operator(,) - string operator(=)operator(>) integer(20)operator(,) - symbol(:DOMLIT) operator(=)operator(>) integer(21)operator(,) - symbol(:VIA) operator(=)operator(>) integer(22)operator(,) - symbol(:WITH) operator(=)operator(>) integer(23)operator(,) - symbol(:ID) operator(=)operator(>) integer(24)operator(,) - symbol(:FOR) operator(=)operator(>) integer(25)operator(,) - string operator(=)operator(>) integer(26)operator(,) - string operator(=)operator(>) integer(27)operator(,) - string)delimiter(")> operator(=)operator(>) integer(28)operator(,) - string operator(=)operator(>) integer(29)operator(,) - symbol(:QUOTED) operator(=)operator(>) integer(30)operator(,) - symbol(:TOKEN) operator(=)operator(>) integer(31)operator(,) - string operator(=)operator(>) integer(32)operator(,) - string operator(=)operator(>) integer(33) operator(}) - -ident(racc_use_result_var) operator(=) pre_constant(false) - -ident(racc_nt_base) operator(=) integer(34) - -constant(Racc_arg) operator(=) operator([) - ident(racc_action_table)operator(,) - ident(racc_action_check)operator(,) - ident(racc_action_default)operator(,) - ident(racc_action_pointer)operator(,) - ident(racc_goto_table)operator(,) - ident(racc_goto_check)operator(,) - ident(racc_goto_default)operator(,) - ident(racc_goto_pointer)operator(,) - ident(racc_nt_base)operator(,) - ident(racc_reduce_table)operator(,) - ident(racc_token_table)operator(,) - ident(racc_shift_n)operator(,) - ident(racc_reduce_n)operator(,) - ident(racc_use_result_var) operator(]) - -constant(Racc_token_to_s_table) operator(=) operator([) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -string")delimiter(')>operator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(,) -stringoperator(]) - -constant(Racc_debug_parser) operator(=) pre_constant(false) - -comment(##### racc system variables end #####) - - comment(# reduce 0 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(16)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(17)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(18)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(19)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(20)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(21)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(22)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(23)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(24)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(25)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(26)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(27)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(33)string - - comment(# reduce 14 omitted) - - comment(# reduce 15 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(42)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(47)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(54)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(59)string - - comment(# reduce 20 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(65)string - - comment(# reduce 22 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(71)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(77)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(81)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(85)string - - comment(# reduce 27 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(91)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(96)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(100)string - - comment(# reduce 31 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(107)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(111)string - - comment(# reduce 34 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(117)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(123)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(127)string - - comment(# reduce 38 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(134)string - - comment(# reduce 40 omitted) - - comment(# reduce 41 omitted) - - comment(# reduce 42 omitted) - - comment(# reduce 43 omitted) - - comment(# reduce 44 omitted) - - comment(# reduce 45 omitted) - - comment(# reduce 46 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(146)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(148)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(149)string - - comment(# reduce 50 omitted) - - comment(# reduce 51 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(156)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(160)string - - comment(# reduce 54 omitted) - - comment(# reduce 55 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(168)string - - comment(# reduce 57 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(176)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(178)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(181)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(182)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(186)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(191)string - - comment(# reduce 64 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(196)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(197)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(199)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(200)string - - comment(# reduce 69 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(203)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(206)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(209)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(217)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(220)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(227)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(228)string - - comment(# reduce 77 omitted) - - comment(# reduce 78 omitted) - - comment(# reduce 79 omitted) - - comment(# reduce 80 omitted) - - comment(# reduce 81 omitted) - - comment(# reduce 82 omitted) - - comment(# reduce 83 omitted) - - comment(# reduce 84 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(243)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(247)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(248)string - - comment(# reduce 88 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(251)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(255)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(260)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(265)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(270)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(274)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(279)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(283)string - - comment(# reduce 97 omitted) - - comment(# reduce 98 omitted) - -ident(module_eval) stringoperator(,) stringoperator(,) integer(292)string - -ident(module_eval) stringoperator(,) stringoperator(,) integer(297)string - - comment(# reduce 101 omitted) - - comment(# reduce 102 omitted) - - comment(# reduce 103 omitted) - - comment(# reduce 104 omitted) - - comment(# reduce 105 omitted) - - comment(# reduce 106 omitted) - - comment(# reduce 107 omitted) - - comment(# reduce 108 omitted) - - comment(# reduce 109 omitted) - - reserved(def) method(_reduce_none)operator(() ident(val)operator(,) ident(_values)operator(\)) - ident(val)operator([)integer(0)operator(]) - reserved(end) - - reserved(end) comment(# class Parser) - -reserved(end) comment(# module TMail) -comment(#) -comment(# port.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -ident(require) string - - -reserved(module) class(TMail) - - reserved(class) class(Port) - reserved(def) method(reproducible?) - pre_constant(false) - reserved(end) - reserved(end) - - - comment(###) - comment(### FilePort) - comment(###) - - reserved(class) class(FilePort) operator(<) constant(Port) - - reserved(def) method(initialize)operator(() ident(fname) operator(\)) - instance_variable(@filename) operator(=) constant(File)operator(.)ident(expand_path)operator(()ident(fname)operator(\)) - reserved(super)operator(()operator(\)) - reserved(end) - - ident(attr_reader) symbol(:filename) - - reserved(alias) method(ident) method(filename) - - reserved(def) method(==)operator(() ident(other) operator(\)) - ident(other)operator(.)ident(respond_to?)operator(()symbol(:filename)operator(\)) reserved(and) instance_variable(@filename) operator(==) ident(other)operator(.)ident(filename) - reserved(end) - - reserved(alias) method(eql?) method(==) - - reserved(def) method(hash) - instance_variable(@filename)operator(.)ident(hash) - reserved(end) - - reserved(def) method(inspect) - stringcontent(:)inlinecontent(>)delimiter(")> - reserved(end) - - reserved(def) method(reproducible?) - pre_constant(true) - reserved(end) - - reserved(def) method(size) - constant(File)operator(.)ident(size) instance_variable(@filename) - reserved(end) - - - reserved(def) method(ropen)operator(() operator(&)ident(block) operator(\)) - constant(File)operator(.)ident(open)operator(()instance_variable(@filename)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(wopen)operator(() operator(&)ident(block) operator(\)) - constant(File)operator(.)ident(open)operator(()instance_variable(@filename)operator(,) stringoperator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(aopen)operator(() operator(&)ident(block) operator(\)) - constant(File)operator(.)ident(open)operator(()instance_variable(@filename)operator(,) stringoperator(,) operator(&)ident(block)operator(\)) - reserved(end) - - - reserved(def) method(read_all) - ident(ropen) operator({)operator(|)ident(f)operator(|) - reserved(return) ident(f)operator(.)ident(read) - operator(}) - reserved(end) - - - reserved(def) method(remove) - constant(File)operator(.)ident(unlink) instance_variable(@filename) - reserved(end) - - reserved(def) method(move_to)operator(() ident(port) operator(\)) - reserved(begin) - constant(File)operator(.)ident(link) instance_variable(@filename)operator(,) ident(port)operator(.)ident(filename) - reserved(rescue) constant(Errno)operator(::)constant(EXDEV) - ident(copy_to) ident(port) - reserved(end) - constant(File)operator(.)ident(unlink) instance_variable(@filename) - reserved(end) - - reserved(alias) method(mv) method(move_to) - - reserved(def) method(copy_to)operator(() ident(port) operator(\)) - reserved(if) constant(FilePort) operator(===) ident(port) - ident(copy_file) instance_variable(@filename)operator(,) ident(port)operator(.)ident(filename) - reserved(else) - constant(File)operator(.)ident(open)operator(()instance_variable(@filename)operator(\)) operator({)operator(|)ident(r)operator(|) - ident(port)operator(.)ident(wopen) operator({)operator(|)ident(w)operator(|) - reserved(while) ident(s) operator(=) ident(r)operator(.)ident(sysread)operator(()integer(4096)operator(\)) - ident(w)operator(.)ident(write) operator(<<) ident(s) - reserved(end) - operator(}) operator(}) - reserved(end) - reserved(end) - - reserved(alias) method(cp) method(copy_to) - - ident(private) - - comment(# from fileutils.rb) - reserved(def) method(copy_file)operator(() ident(src)operator(,) ident(dest) operator(\)) - ident(st) operator(=) ident(r) operator(=) ident(w) operator(=) pre_constant(nil) - - constant(File)operator(.)ident(open)operator(()ident(src)operator(,) stringoperator(\)) operator({)operator(|)ident(r)operator(|) - constant(File)operator(.)ident(open)operator(()ident(dest)operator(,) stringoperator(\)) operator({)operator(|)ident(w)operator(|) - ident(st) operator(=) ident(r)operator(.)ident(stat) - reserved(begin) - reserved(while) pre_constant(true) - ident(w)operator(.)ident(write) ident(r)operator(.)ident(sysread)operator(()ident(st)operator(.)ident(blksize)operator(\)) - reserved(end) - reserved(rescue) constant(EOFError) - reserved(end) - operator(}) operator(}) - reserved(end) - - reserved(end) - - - reserved(module) class(MailFlags) - - reserved(def) method(seen=)operator(() ident(b) operator(\)) - ident(set_status) stringoperator(,) ident(b) - reserved(end) - - reserved(def) method(seen?) - ident(get_status) string - reserved(end) - - reserved(def) method(replied=)operator(() ident(b) operator(\)) - ident(set_status) stringoperator(,) ident(b) - reserved(end) - - reserved(def) method(replied?) - ident(get_status) string - reserved(end) - - reserved(def) method(flagged=)operator(() ident(b) operator(\)) - ident(set_status) stringoperator(,) ident(b) - reserved(end) - - reserved(def) method(flagged?) - ident(get_status) string - reserved(end) - - ident(private) - - reserved(def) method(procinfostr)operator(() ident(str)operator(,) ident(tag)operator(,) ident(true_p) operator(\)) - ident(a) operator(=) ident(str)operator(.)ident(upcase)operator(.)ident(split)operator(()regexpoperator(\)) - ident(a)operator(.)ident(push) ident(true_p) operator(?) ident(tag) operator(:) pre_constant(nil) - ident(a)operator(.)ident(delete) ident(tag) reserved(unless) ident(true_p) - ident(a)operator(.)ident(compact)operator(.)ident(sort)operator(.)ident(join)operator(()stringoperator(\))operator(.)ident(squeeze) - reserved(end) - - reserved(end) - - - reserved(class) class(MhPort) operator(<) constant(FilePort) - - ident(include) constant(MailFlags) - - ident(private) - - reserved(def) method(set_status)operator(() ident(tag)operator(,) ident(flag) operator(\)) - reserved(begin) - ident(tmpfile) operator(=) instance_variable(@filename) operator(+) string operator(+) global_variable($$)operator(.)ident(to_s) - constant(File)operator(.)ident(open)operator(()ident(tmpfile)operator(,) stringoperator(\)) operator({)operator(|)ident(f)operator(|) - ident(write_status) ident(f)operator(,) ident(tag)operator(,) ident(flag) - operator(}) - constant(File)operator(.)ident(unlink) instance_variable(@filename) - constant(File)operator(.)ident(link) ident(tmpfile)operator(,) instance_variable(@filename) - reserved(ensure) - constant(File)operator(.)ident(unlink) ident(tmpfile) - reserved(end) - reserved(end) - - reserved(def) method(write_status)operator(() ident(f)operator(,) ident(tag)operator(,) ident(flag) operator(\)) - ident(stat) operator(=) string - constant(File)operator(.)ident(open)operator(()instance_variable(@filename)operator(\)) operator({)operator(|)ident(r)operator(|) - reserved(while) ident(line) operator(=) ident(r)operator(.)ident(gets) - reserved(if) ident(line)operator(.)ident(strip)operator(.)ident(empty?) - reserved(break) - reserved(elsif) ident(m) operator(=) regexpoperator(.)ident(match)operator(()ident(line)operator(\)) - ident(stat) operator(=) ident(m)operator(.)ident(post_match)operator(.)ident(strip) - reserved(else) - ident(f)operator(.)ident(print) ident(line) - reserved(end) - reserved(end) - - ident(s) operator(=) ident(procinfostr)operator(()ident(stat)operator(,) ident(tag)operator(,) ident(flag)operator(\)) - ident(f)operator(.)ident(puts) string operator(+) ident(s) reserved(unless) ident(s)operator(.)ident(empty?) - ident(f)operator(.)ident(puts) - - reserved(while) ident(s) operator(=) ident(r)operator(.)ident(read)operator(()integer(2048)operator(\)) - ident(f)operator(.)ident(write) ident(s) - reserved(end) - operator(}) - reserved(end) - - reserved(def) method(get_status)operator(() ident(tag) operator(\)) - constant(File)operator(.)ident(foreach)operator(()instance_variable(@filename)operator(\)) operator({)operator(|)ident(line)operator(|) - reserved(return) pre_constant(false) reserved(if) ident(line)operator(.)ident(strip)operator(.)ident(empty?) - reserved(if) ident(m) operator(=) regexpoperator(.)ident(match)operator(()ident(line)operator(\)) - reserved(return) ident(m)operator(.)ident(post_match)operator(.)ident(strip)operator(.)ident(include?)operator(()ident(tag)operator([)integer(0)operator(])operator(\)) - reserved(end) - operator(}) - pre_constant(false) - reserved(end) - - reserved(end) - - - reserved(class) class(MaildirPort) operator(<) constant(FilePort) - - reserved(def) method(move_to_new) - ident(new) operator(=) ident(replace_dir)operator(()instance_variable(@filename)operator(,) stringoperator(\)) - constant(File)operator(.)ident(rename) instance_variable(@filename)operator(,) ident(new) - instance_variable(@filename) operator(=) ident(new) - reserved(end) - - reserved(def) method(move_to_cur) - ident(new) operator(=) ident(replace_dir)operator(()instance_variable(@filename)operator(,) stringoperator(\)) - constant(File)operator(.)ident(rename) instance_variable(@filename)operator(,) ident(new) - instance_variable(@filename) operator(=) ident(new) - reserved(end) - - reserved(def) method(replace_dir)operator(() ident(path)operator(,) ident(dir) operator(\)) - stringcontent(/)inlinecontent(/)inlinedelimiter(")> - reserved(end) - ident(private) symbol(:replace_dir) - - - ident(include) constant(MailFlags) - - ident(private) - - constant(MAIL_FILE) operator(=) regexp - - reserved(def) method(set_status)operator(() ident(tag)operator(,) ident(flag) operator(\)) - reserved(if) ident(m) operator(=) constant(MAIL_FILE)operator(.)ident(match)operator(()constant(File)operator(.)ident(basename)operator(()instance_variable(@filename)operator(\))operator(\)) - ident(s)operator(,) ident(uniq)operator(,) ident(type)operator(,) ident(info)operator(,) operator(=) ident(m)operator(.)ident(to_a) - reserved(return) reserved(if) ident(type) reserved(and) ident(type) operator(!=) string comment(# do not change anything) - ident(newname) operator(=) constant(File)operator(.)ident(dirname)operator(()instance_variable(@filename)operator(\)) operator(+) string operator(+) - ident(uniq) operator(+) string operator(+) ident(procinfostr)operator(()ident(info)operator(.)ident(to_s)operator(,) ident(tag)operator(,) ident(flag)operator(\)) - reserved(else) - ident(newname) operator(=) instance_variable(@filename) operator(+) string operator(+) ident(tag) - reserved(end) - - constant(File)operator(.)ident(link) instance_variable(@filename)operator(,) ident(newname) - constant(File)operator(.)ident(unlink) instance_variable(@filename) - instance_variable(@filename) operator(=) ident(newname) - reserved(end) - - reserved(def) method(get_status)operator(() ident(tag) operator(\)) - ident(m) operator(=) constant(MAIL_FILE)operator(.)ident(match)operator(()constant(File)operator(.)ident(basename)operator(()instance_variable(@filename)operator(\))operator(\)) reserved(or) reserved(return) pre_constant(false) - ident(m)operator([)integer(2)operator(]) operator(==) string reserved(and) ident(m)operator([)integer(3)operator(])operator(.)ident(to_s)operator(.)ident(include?)operator(()ident(tag)operator([)integer(0)operator(])operator(\)) - reserved(end) - - reserved(end) - - - comment(###) - comment(### StringPort) - comment(###) - - reserved(class) class(StringPort) operator(<) constant(Port) - - reserved(def) method(initialize)operator(() ident(str) operator(=) string operator(\)) - instance_variable(@buffer) operator(=) ident(str) - reserved(super)operator(()operator(\)) - reserved(end) - - reserved(def) method(string) - instance_variable(@buffer) - reserved(end) - - reserved(def) method(to_s) - instance_variable(@buffer)operator(.)ident(dup) - reserved(end) - - reserved(alias) method(read_all) method(to_s) - - reserved(def) method(size) - instance_variable(@buffer)operator(.)ident(size) - reserved(end) - - reserved(def) method(==)operator(() ident(other) operator(\)) - constant(StringPort) operator(===) ident(other) reserved(and) instance_variable(@buffer)operator(.)ident(equal?) ident(other)operator(.)ident(string) - reserved(end) - - reserved(alias) method(eql?) method(==) - - reserved(def) method(hash) - instance_variable(@buffer)operator(.)ident(object_id)operator(.)ident(hash) - reserved(end) - - reserved(def) method(inspect) - stringcontent(:id=)inlineoperator(,) instance_variable(@buffer)operator(.)ident(object_id)inline_delimiter(})>content(>)delimiter(")> - reserved(end) - - reserved(def) method(reproducible?) - pre_constant(true) - reserved(end) - - reserved(def) method(ropen)operator(() operator(&)ident(block) operator(\)) - instance_variable(@buffer) reserved(or) ident(raise) constant(Errno)operator(::)constant(ENOENT)operator(,) stringcontent( is already removed)delimiter(")> - constant(StringInput)operator(.)ident(open)operator(()instance_variable(@buffer)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(wopen)operator(() operator(&)ident(block) operator(\)) - instance_variable(@buffer) operator(=) string - constant(StringOutput)operator(.)ident(new)operator(()instance_variable(@buffer)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(aopen)operator(() operator(&)ident(block) operator(\)) - instance_variable(@buffer) operator(||=) string - constant(StringOutput)operator(.)ident(new)operator(()instance_variable(@buffer)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(remove) - instance_variable(@buffer) operator(=) pre_constant(nil) - reserved(end) - - reserved(alias) method(rm) method(remove) - - reserved(def) method(copy_to)operator(() ident(port) operator(\)) - ident(port)operator(.)ident(wopen) operator({)operator(|)ident(f)operator(|) - ident(f)operator(.)ident(write) instance_variable(@buffer) - operator(}) - reserved(end) - - reserved(alias) method(cp) method(copy_to) - - reserved(def) method(move_to)operator(() ident(port) operator(\)) - reserved(if) constant(StringPort) operator(===) ident(port) - ident(str) operator(=) instance_variable(@buffer) - ident(port)operator(.)ident(instance_eval) operator({) instance_variable(@buffer) operator(=) ident(str) operator(}) - reserved(else) - ident(copy_to) ident(port) - reserved(end) - ident(remove) - reserved(end) - - reserved(end) - -reserved(end) comment(# module TMail) -reserved(module) class(TMail) - reserved(class) class(Mail) - reserved(def) method(subject)operator(()ident(to_charset) operator(=) stringoperator(\)) - constant(Unquoter)operator(.)ident(unquote_and_convert_to)operator(()ident(quoted_subject)operator(,) ident(to_charset)operator(\)) - reserved(end) - - reserved(def) method(unquoted_body)operator(()ident(to_charset) operator(=) stringoperator(\)) - ident(from_charset) operator(=) ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - reserved(case) operator(()ident(content_transfer_encoding) operator(||) stringoperator(\))operator(.)ident(downcase) - reserved(when) string - constant(Unquoter)operator(.)ident(unquote_quoted_printable_and_convert_to)operator(()ident(quoted_body)operator(,) - ident(to_charset)operator(,) ident(from_charset)operator(,) pre_constant(true)operator(\)) - reserved(when) string - constant(Unquoter)operator(.)ident(unquote_base64_and_convert_to)operator(()ident(quoted_body)operator(,) ident(to_charset)operator(,) - ident(from_charset)operator(\)) - reserved(when) stringoperator(,) string - constant(Unquoter)operator(.)ident(convert_to)operator(()ident(quoted_body)operator(,) ident(to_charset)operator(,) ident(from_charset)operator(\)) - reserved(when) string - ident(quoted_body) - reserved(else) - ident(quoted_body) - reserved(end) - reserved(end) - - reserved(def) method(body)operator(()ident(to_charset) operator(=) stringoperator(,) operator(&)ident(block)operator(\)) - ident(attachment_presenter) operator(=) ident(block) operator(||) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(file_name)operator(|) stringchar(\\n)delimiter(")> operator(}) - - reserved(if) ident(multipart?) - ident(parts)operator(.)ident(collect) operator({) operator(|)ident(part)operator(|) - ident(header) operator(=) ident(part)operator([)stringoperator(]) - - reserved(if) ident(part)operator(.)ident(multipart?) - ident(part)operator(.)ident(body)operator(()ident(to_charset)operator(,) operator(&)ident(attachment_presenter)operator(\)) - reserved(elsif) ident(header)operator(.)ident(nil?) - string - reserved(elsif) operator(!)ident(attachment?)operator(()ident(part)operator(\)) - ident(part)operator(.)ident(unquoted_body)operator(()ident(to_charset)operator(\)) - reserved(else) - ident(attachment_presenter)operator(.)ident(call)operator(()ident(header)operator([)stringoperator(]) operator(||) stringoperator(\)) - reserved(end) - operator(})operator(.)ident(join) - reserved(else) - ident(unquoted_body)operator(()ident(to_charset)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(Unquoter) - reserved(class) operator(<<) class(self) - reserved(def) method(unquote_and_convert_to)operator(()ident(text)operator(,) ident(to_charset)operator(,) ident(from_charset) operator(=) stringoperator(,) ident(preserve_underscores)operator(=)pre_constant(false)operator(\)) - reserved(return) string reserved(if) ident(text)operator(.)ident(nil?) - reserved(if) ident(text) operator(=)operator(~) regexp - ident(from_charset) operator(=) global_variable($1) - ident(quoting_method) operator(=) global_variable($2) - ident(text) operator(=) global_variable($3) - reserved(case) ident(quoting_method)operator(.)ident(upcase) - reserved(when) string reserved(then) - ident(unquote_quoted_printable_and_convert_to)operator(()ident(text)operator(,) ident(to_charset)operator(,) ident(from_charset)operator(,) ident(preserve_underscores)operator(\)) - reserved(when) string reserved(then) - ident(unquote_base64_and_convert_to)operator(()ident(text)operator(,) ident(to_charset)operator(,) ident(from_charset)operator(\)) - reserved(else) - ident(raise) stringdelimiter(")> - reserved(end) - reserved(else) - ident(convert_to)operator(()ident(text)operator(,) ident(to_charset)operator(,) ident(from_charset)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(unquote_quoted_printable_and_convert_to)operator(()ident(text)operator(,) ident(to)operator(,) ident(from)operator(,) ident(preserve_underscores)operator(=)pre_constant(false)operator(\)) - ident(text) operator(=) ident(text)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) reserved(unless) ident(preserve_underscores) - ident(convert_to)operator(()ident(text)operator(.)ident(unpack)operator(()stringoperator(\))operator(.)ident(first)operator(,) ident(to)operator(,) ident(from)operator(\)) - reserved(end) - - reserved(def) method(unquote_base64_and_convert_to)operator(()ident(text)operator(,) ident(to)operator(,) ident(from)operator(\)) - ident(convert_to)operator(()constant(Base64)operator(.)ident(decode)operator(()ident(text)operator(\))operator(.)ident(first)operator(,) ident(to)operator(,) ident(from)operator(\)) - reserved(end) - - reserved(begin) - ident(require) string - reserved(def) method(convert_to)operator(()ident(text)operator(,) ident(to)operator(,) ident(from)operator(\)) - reserved(return) ident(text) reserved(unless) ident(to) operator(&&) ident(from) - ident(text) operator(?) constant(Iconv)operator(.)ident(iconv)operator(()ident(to)operator(,) ident(from)operator(,) ident(text)operator(\))operator(.)ident(first) operator(:) string - reserved(rescue) constant(Iconv)operator(::)constant(IllegalSequence)operator(,) constant(Errno)operator(::)constant(EINVAL) - comment(# the 'from' parameter specifies a charset other than what the text) - comment(# actually is...not much we can do in this case but just return the) - comment(# unconverted text.) - comment(#) - comment(# Ditto if either parameter represents an unknown charset, like) - comment(# X-UNKNOWN.) - ident(text) - reserved(end) - reserved(rescue) constant(LoadError) - comment(# Not providing quoting support) - reserved(def) method(convert_to)operator(()ident(text)operator(,) ident(to)operator(,) ident(from)operator(\)) - ident(warn) stringcontent( to )inlinecontent( ()inlinecontent(:)inlinecontent(\))delimiter(")> - ident(text) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) - -reserved(if) pre_constant(__FILE__) operator(==) global_variable($0) - ident(require) string - - reserved(class) class(TC_Unquoter) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(test_unquote_quoted_printable) - ident(a) operator(=)string - ident(b) operator(=) constant(TMail)operator(::)constant(Unquoter)operator(.)ident(unquote_and_convert_to)operator(()ident(a)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(b) - reserved(end) - - reserved(def) method(test_unquote_base64) - ident(a) operator(=)string - ident(b) operator(=) constant(TMail)operator(::)constant(Unquoter)operator(.)ident(unquote_and_convert_to)operator(()ident(a)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(b) - reserved(end) - - reserved(def) method(test_unquote_without_charset) - ident(a) operator(=)string - ident(b) operator(=) constant(TMail)operator(::)constant(Unquoter)operator(.)ident(unquote_and_convert_to)operator(()ident(a)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(b) - reserved(end) - reserved(end) -reserved(end) -comment(#) -comment(# scanner.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -ident(require) string - -reserved(module) class(TMail) - ident(require) string - reserved(begin) - ident(raise) constant(LoadError)operator(,) string reserved(if) pre_constant(ENV)operator([)stringoperator(]) - ident(require) string - constant(Scanner) operator(=) constant(Scanner_C) - reserved(rescue) constant(LoadError) - constant(Scanner) operator(=) constant(Scanner_R) - reserved(end) -reserved(end) -comment(#) -comment(# scanner_r.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -ident(require) string - - -reserved(module) class(TMail) - - reserved(class) class(Scanner_R) - - constant(Version) operator(=) string - constant(Version)operator(.)ident(freeze) - - constant(MIME_HEADERS) operator(=) operator({) - symbol(:CTYPE) operator(=)operator(>) pre_constant(true)operator(,) - symbol(:CENCODING) operator(=)operator(>) pre_constant(true)operator(,) - symbol(:CDISPOSITION) operator(=)operator(>) pre_constant(true) - operator(}) - - ident(alnum) operator(=) string - ident(atomsyms) operator(=) stringoperator(.)ident(strip) - ident(tokensyms) operator(=) stringoperator(.)ident(strip) - - ident(atomchars) operator(=) ident(alnum) operator(+) constant(Regexp)operator(.)ident(quote)operator(()ident(atomsyms)operator(\)) - ident(tokenchars) operator(=) ident(alnum) operator(+) constant(Regexp)operator(.)ident(quote)operator(()ident(tokensyms)operator(\)) - ident(iso2022str) operator(=) string - - ident(eucstr) operator(=) string - ident(sjisstr) operator(=) string - ident(utf8str) operator(=) string - - ident(quoted_with_iso2022) operator(=) regexpcontent(\)+)delimiter(/)modifier(n)> - ident(domlit_with_iso2022) operator(=) regexpcontent(\)+)delimiter(/)modifier(n)> - ident(comment_with_iso2022) operator(=) regexpcontent(\)+)delimiter(/)modifier(n)> - - ident(quoted_without_iso2022) operator(=) regexp - ident(domlit_without_iso2022) operator(=) regexp - ident(comment_without_iso2022) operator(=) regexp - - constant(PATTERN_TABLE) operator(=) operator({)operator(}) - constant(PATTERN_TABLE)operator([)stringoperator(]) operator(=) - operator([) - regexpcontent(]+|)inlinecontent(|)inlinecontent(\)+)delimiter(/)modifier(n)>operator(,) - regexpcontent(]+|)inlinecontent(|)inlinecontent(\)+)delimiter(/)modifier(n)>operator(,) - ident(quoted_with_iso2022)operator(,) - ident(domlit_with_iso2022)operator(,) - ident(comment_with_iso2022) - operator(]) - constant(PATTERN_TABLE)operator([)stringoperator(]) operator(=) - operator([) - regexpcontent(]+|)inlinecontent(|)inlinecontent(\)+)delimiter(/)modifier(n)>operator(,) - regexpcontent(]+|)inlinecontent(|)inlinecontent(\)+)delimiter(/)modifier(n)>operator(,) - ident(quoted_with_iso2022)operator(,) - ident(domlit_with_iso2022)operator(,) - ident(comment_with_iso2022) - operator(]) - constant(PATTERN_TABLE)operator([)stringoperator(]) operator(=) - operator([) - regexpcontent(]+|)inlinecontent(\)+)delimiter(/)modifier(n)>operator(,) - regexpcontent(]+|)inlinecontent(\)+)delimiter(/)modifier(n)>operator(,) - ident(quoted_without_iso2022)operator(,) - ident(domlit_without_iso2022)operator(,) - ident(comment_without_iso2022) - operator(]) - constant(PATTERN_TABLE)operator([)stringoperator(]) operator(=) - operator([) - regexpcontent(]+)delimiter(/)modifier(n)>operator(,) - regexpcontent(]+)delimiter(/)modifier(n)>operator(,) - ident(quoted_without_iso2022)operator(,) - ident(domlit_without_iso2022)operator(,) - ident(comment_without_iso2022) - operator(]) - - - reserved(def) method(initialize)operator(() ident(str)operator(,) ident(scantype)operator(,) ident(comments) operator(\)) - ident(init_scanner) ident(str) - instance_variable(@comments) operator(=) ident(comments) operator(||) operator([)operator(]) - instance_variable(@debug) operator(=) pre_constant(false) - - comment(# fix scanner mode) - instance_variable(@received) operator(=) operator(()ident(scantype) operator(==) symbol(:RECEIVED)operator(\)) - instance_variable(@is_mime_header) operator(=) constant(MIME_HEADERS)operator([)ident(scantype)operator(]) - - ident(atom)operator(,) ident(token)operator(,) instance_variable(@quoted_re)operator(,) instance_variable(@domlit_re)operator(,) instance_variable(@comment_re) operator(=) constant(PATTERN_TABLE)operator([)global_variable($KCODE)operator(]) - instance_variable(@word_re) operator(=) operator(()constant(MIME_HEADERS)operator([)ident(scantype)operator(]) operator(?) ident(token) operator(:) ident(atom)operator(\)) - reserved(end) - - ident(attr_accessor) symbol(:debug) - - reserved(def) method(scan)operator(() operator(&)ident(block) operator(\)) - reserved(if) instance_variable(@debug) - ident(scan_main) reserved(do) operator(|)ident(arr)operator(|) - ident(s)operator(,) ident(v) operator(=) ident(arr) - ident(printf) stringoperator(,) - ident(rest_size)operator(()operator(\))operator(,) - ident(s)operator(.)ident(respond_to?)operator(()symbol(:id2name)operator(\)) operator(?) ident(s)operator(.)ident(id2name) operator(:) ident(s)operator(.)ident(inspect)operator(,) - ident(v)operator(.)ident(inspect) - reserved(yield) ident(arr) - reserved(end) - reserved(else) - ident(scan_main)operator(()operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - - ident(private) - - constant(RECV_TOKEN) operator(=) operator({) - string operator(=)operator(>) symbol(:FROM)operator(,) - string operator(=)operator(>) symbol(:BY)operator(,) - string operator(=)operator(>) symbol(:VIA)operator(,) - string operator(=)operator(>) symbol(:WITH)operator(,) - string operator(=)operator(>) symbol(:ID)operator(,) - string operator(=)operator(>) symbol(:FOR) - operator(}) - - reserved(def) method(scan_main) - reserved(until) ident(eof?) - reserved(if) ident(skip)operator(()regexpoperator(\)) comment(# LWSP) - reserved(break) reserved(if) ident(eof?) - reserved(end) - - reserved(if) ident(s) operator(=) ident(readstr)operator(()instance_variable(@word_re)operator(\)) - reserved(if) instance_variable(@is_mime_header) - reserved(yield) symbol(:TOKEN)operator(,) ident(s) - reserved(else) - comment(# atom) - reserved(if) regexp operator(===) ident(s) - reserved(yield) symbol(:DIGIT)operator(,) ident(s) - reserved(elsif) instance_variable(@received) - reserved(yield) constant(RECV_TOKEN)operator([)ident(s)operator(.)ident(downcase)operator(]) operator(||) symbol(:ATOM)operator(,) ident(s) - reserved(else) - reserved(yield) symbol(:ATOM)operator(,) ident(s) - reserved(end) - reserved(end) - - reserved(elsif) ident(skip)operator(()regexpoperator(\)) - reserved(yield) symbol(:QUOTED)operator(,) ident(scan_quoted_word)operator(()operator(\)) - - reserved(elsif) ident(skip)operator(()regexpoperator(\)) - reserved(yield) symbol(:DOMLIT)operator(,) ident(scan_domain_literal)operator(()operator(\)) - - reserved(elsif) ident(skip)operator(()regexpoperator(\)) - instance_variable(@comments)operator(.)ident(push) ident(scan_comment)operator(()operator(\)) - - reserved(else) - ident(c) operator(=) ident(readchar)operator(()operator(\)) - reserved(yield) ident(c)operator(,) ident(c) - reserved(end) - reserved(end) - - reserved(yield) pre_constant(false)operator(,) string - reserved(end) - - reserved(def) method(scan_quoted_word) - ident(scan_qstr)operator(()instance_variable(@quoted_re)operator(,) regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(scan_domain_literal) - string operator(+) ident(scan_qstr)operator(()instance_variable(@domlit_re)operator(,) regexpoperator(,) stringoperator(\)) operator(+) string - reserved(end) - - reserved(def) method(scan_qstr)operator(() ident(pattern)operator(,) ident(terminal)operator(,) ident(type) operator(\)) - ident(result) operator(=) string - reserved(until) ident(eof?) - reserved(if) ident(s) operator(=) ident(readstr)operator(()ident(pattern)operator(\)) reserved(then) ident(result) operator(<<) ident(s) - reserved(elsif) ident(skip)operator(()ident(terminal)operator(\)) reserved(then) reserved(return) ident(result) - reserved(elsif) ident(skip)operator(()regexpoperator(\)) reserved(then) ident(result) operator(<<) ident(readchar)operator(()operator(\)) - reserved(else) - ident(raise) stringdelimiter(")> - reserved(end) - reserved(end) - ident(scan_error!) stringdelimiter(")> - reserved(end) - - reserved(def) method(scan_comment) - ident(result) operator(=) string - ident(nest) operator(=) integer(1) - ident(content) operator(=) instance_variable(@comment_re) - - reserved(until) ident(eof?) - reserved(if) ident(s) operator(=) ident(readstr)operator(()ident(content)operator(\)) reserved(then) ident(result) operator(<<) ident(s) - reserved(elsif) ident(skip)operator(()regexpoperator(\)) reserved(then) ident(nest) operator(-=) integer(1) - reserved(return) ident(result) reserved(if) ident(nest) operator(==) integer(0) - ident(result) operator(<<) string - reserved(elsif) ident(skip)operator(()regexpoperator(\)) reserved(then) ident(nest) operator(+=) integer(1) - ident(result) operator(<<) string - reserved(elsif) ident(skip)operator(()regexpoperator(\)) reserved(then) ident(result) operator(<<) ident(readchar)operator(()operator(\)) - reserved(else) - ident(raise) string - reserved(end) - reserved(end) - ident(scan_error!) string - reserved(end) - - comment(# string scanner) - - reserved(def) method(init_scanner)operator(() ident(str) operator(\)) - instance_variable(@src) operator(=) ident(str) - reserved(end) - - reserved(def) method(eof?) - instance_variable(@src)operator(.)ident(empty?) - reserved(end) - - reserved(def) method(rest_size) - instance_variable(@src)operator(.)ident(size) - reserved(end) - - reserved(def) method(readstr)operator(() ident(re) operator(\)) - reserved(if) ident(m) operator(=) ident(re)operator(.)ident(match)operator(()instance_variable(@src)operator(\)) - instance_variable(@src) operator(=) ident(m)operator(.)ident(post_match) - ident(m)operator([)integer(0)operator(]) - reserved(else) - pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(readchar) - ident(readstr)operator(()regexpoperator(\)) - reserved(end) - - reserved(def) method(skip)operator(() ident(re) operator(\)) - reserved(if) ident(m) operator(=) ident(re)operator(.)ident(match)operator(()instance_variable(@src)operator(\)) - instance_variable(@src) operator(=) ident(m)operator(.)ident(post_match) - pre_constant(true) - reserved(else) - pre_constant(false) - reserved(end) - reserved(end) - - reserved(def) method(scan_error!)operator(() ident(msg) operator(\)) - ident(raise) constant(SyntaxError)operator(,) ident(msg) - reserved(end) - - reserved(end) - -reserved(end) comment(# module TMail) -comment(#) -comment(# stringio.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -reserved(class) class(StringInput)comment(#:nodoc:) - - ident(include) constant(Enumerable) - - reserved(class) operator(<<) class(self) - - reserved(def) method(new)operator(() ident(str) operator(\)) - reserved(if) ident(block_given?) - reserved(begin) - ident(f) operator(=) reserved(super) - reserved(yield) ident(f) - reserved(ensure) - ident(f)operator(.)ident(close) reserved(if) ident(f) - reserved(end) - reserved(else) - reserved(super) - reserved(end) - reserved(end) - - reserved(alias) method(open) method(new) - - reserved(end) - - reserved(def) method(initialize)operator(() ident(str) operator(\)) - instance_variable(@src) operator(=) ident(str) - instance_variable(@pos) operator(=) integer(0) - instance_variable(@closed) operator(=) pre_constant(false) - instance_variable(@lineno) operator(=) integer(0) - reserved(end) - - ident(attr_reader) symbol(:lineno) - - reserved(def) method(string) - instance_variable(@src) - reserved(end) - - reserved(def) method(inspect) - stringcontent(:)inline operator(:) stringinline_delimiter(})>content(,src=)inlinecontent(>)delimiter(")> - reserved(end) - - reserved(def) method(close) - ident(stream_check!) - instance_variable(@pos) operator(=) pre_constant(nil) - instance_variable(@closed) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(closed?) - instance_variable(@closed) - reserved(end) - - reserved(def) method(pos) - ident(stream_check!) - operator([)instance_variable(@pos)operator(,) instance_variable(@src)operator(.)ident(size)operator(])operator(.)ident(min) - reserved(end) - - reserved(alias) method(tell) method(pos) - - reserved(def) method(seek)operator(() ident(offset)operator(,) ident(whence) operator(=) constant(IO)operator(::)constant(SEEK_SET) operator(\)) - ident(stream_check!) - reserved(case) ident(whence) - reserved(when) constant(IO)operator(::)constant(SEEK_SET) - instance_variable(@pos) operator(=) ident(offset) - reserved(when) constant(IO)operator(::)constant(SEEK_CUR) - instance_variable(@pos) operator(+=) ident(offset) - reserved(when) constant(IO)operator(::)constant(SEEK_END) - instance_variable(@pos) operator(=) instance_variable(@src)operator(.)ident(size) operator(-) ident(offset) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) stringdelimiter(")> - reserved(end) - instance_variable(@pos) operator(=) integer(0) reserved(if) instance_variable(@pos) operator(<) integer(0) - instance_variable(@pos) operator(=) operator([)instance_variable(@pos)operator(,) instance_variable(@src)operator(.)ident(size) operator(+) integer(1)operator(])operator(.)ident(min) - ident(offset) - reserved(end) - - reserved(def) method(rewind) - ident(stream_check!) - instance_variable(@pos) operator(=) integer(0) - reserved(end) - - reserved(def) method(eof?) - ident(stream_check!) - instance_variable(@pos) operator(>) instance_variable(@src)operator(.)ident(size) - reserved(end) - - reserved(def) method(each)operator(() operator(&)ident(block) operator(\)) - ident(stream_check!) - reserved(begin) - instance_variable(@src)operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) - reserved(ensure) - instance_variable(@pos) operator(=) integer(0) - reserved(end) - reserved(end) - - reserved(def) method(gets) - ident(stream_check!) - reserved(if) ident(idx) operator(=) instance_variable(@src)operator(.)ident(index)operator(()integer(?\\n)operator(,) instance_variable(@pos)operator(\)) - ident(idx) operator(+=) integer(1) comment(# "\\n".size) - ident(line) operator(=) instance_variable(@src)operator([) instance_variable(@pos) operator(...) ident(idx) operator(]) - instance_variable(@pos) operator(=) ident(idx) - instance_variable(@pos) operator(+=) integer(1) reserved(if) instance_variable(@pos) operator(==) instance_variable(@src)operator(.)ident(size) - reserved(else) - ident(line) operator(=) instance_variable(@src)operator([) instance_variable(@pos) operator(..) integer(-1) operator(]) - instance_variable(@pos) operator(=) instance_variable(@src)operator(.)ident(size) operator(+) integer(1) - reserved(end) - instance_variable(@lineno) operator(+=) integer(1) - - ident(line) - reserved(end) - - reserved(def) method(getc) - ident(stream_check!) - ident(ch) operator(=) instance_variable(@src)operator([)instance_variable(@pos)operator(]) - instance_variable(@pos) operator(+=) integer(1) - instance_variable(@pos) operator(+=) integer(1) reserved(if) instance_variable(@pos) operator(==) instance_variable(@src)operator(.)ident(size) - ident(ch) - reserved(end) - - reserved(def) method(read)operator(() ident(len) operator(=) pre_constant(nil) operator(\)) - ident(stream_check!) - reserved(return) ident(read_all) reserved(unless) ident(len) - ident(str) operator(=) instance_variable(@src)operator([)instance_variable(@pos)operator(,) ident(len)operator(]) - instance_variable(@pos) operator(+=) ident(len) - instance_variable(@pos) operator(+=) integer(1) reserved(if) instance_variable(@pos) operator(==) instance_variable(@src)operator(.)ident(size) - ident(str) - reserved(end) - - reserved(alias) method(sysread) method(read) - - reserved(def) method(read_all) - ident(stream_check!) - reserved(return) pre_constant(nil) reserved(if) ident(eof?) - ident(rest) operator(=) instance_variable(@src)operator([)instance_variable(@pos) operator(...) instance_variable(@src)operator(.)ident(size)operator(]) - instance_variable(@pos) operator(=) instance_variable(@src)operator(.)ident(size) operator(+) integer(1) - ident(rest) - reserved(end) - - reserved(def) method(stream_check!) - instance_variable(@closed) reserved(and) ident(raise) constant(IOError)operator(,) string - reserved(end) - -reserved(end) - - -reserved(class) class(StringOutput)comment(#:nodoc:) - - reserved(class) operator(<<) class(self) - - reserved(def) method(new)operator(() ident(str) operator(=) string operator(\)) - reserved(if) ident(block_given?) - reserved(begin) - ident(f) operator(=) reserved(super) - reserved(yield) ident(f) - reserved(ensure) - ident(f)operator(.)ident(close) reserved(if) ident(f) - reserved(end) - reserved(else) - reserved(super) - reserved(end) - reserved(end) - - reserved(alias) method(open) method(new) - - reserved(end) - - reserved(def) method(initialize)operator(() ident(str) operator(=) string operator(\)) - instance_variable(@dest) operator(=) ident(str) - instance_variable(@closed) operator(=) pre_constant(false) - reserved(end) - - reserved(def) method(close) - instance_variable(@closed) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(closed?) - instance_variable(@closed) - reserved(end) - - reserved(def) method(string) - instance_variable(@dest) - reserved(end) - - reserved(alias) method(value) method(string) - reserved(alias) method(to_str) method(string) - - reserved(def) method(size) - instance_variable(@dest)operator(.)ident(size) - reserved(end) - - reserved(alias) method(pos) method(size) - - reserved(def) method(inspect) - stringcontent(:)inline operator(:) stringinline_delimiter(})>content(,)inlinecontent(>)delimiter(")> - reserved(end) - - reserved(def) method(print)operator(() operator(*)ident(args) operator(\)) - ident(stream_check!) - ident(raise) constant(ArgumentError)operator(,) string1\))delimiter(')> reserved(if) ident(args)operator(.)ident(empty?) - ident(args)operator(.)ident(each) reserved(do) operator(|)ident(s)operator(|) - ident(raise) constant(ArgumentError)operator(,) string reserved(if) ident(s)operator(.)ident(nil?) - instance_variable(@dest) operator(<<) ident(s)operator(.)ident(to_s) - reserved(end) - pre_constant(nil) - reserved(end) - - reserved(def) method(puts)operator(() operator(*)ident(args) operator(\)) - ident(stream_check!) - ident(args)operator(.)ident(each) reserved(do) operator(|)ident(str)operator(|) - instance_variable(@dest) operator(<<) operator(()ident(s) operator(=) ident(str)operator(.)ident(to_s)operator(\)) - instance_variable(@dest) operator(<<) string reserved(unless) ident(s)operator([)integer(-1)operator(]) operator(==) integer(?\\n) - reserved(end) - instance_variable(@dest) operator(<<) string reserved(if) ident(args)operator(.)ident(empty?) - pre_constant(nil) - reserved(end) - - reserved(def) method(putc)operator(() ident(ch) operator(\)) - ident(stream_check!) - instance_variable(@dest) operator(<<) ident(ch)operator(.)ident(chr) - pre_constant(nil) - reserved(end) - - reserved(def) method(printf)operator(() operator(*)ident(args) operator(\)) - ident(stream_check!) - instance_variable(@dest) operator(<<) ident(sprintf)operator(()operator(*)ident(args)operator(\)) - pre_constant(nil) - reserved(end) - - reserved(def) method(write)operator(() ident(str) operator(\)) - ident(stream_check!) - ident(s) operator(=) ident(str)operator(.)ident(to_s) - instance_variable(@dest) operator(<<) ident(s) - ident(s)operator(.)ident(size) - reserved(end) - - reserved(alias) method(syswrite) method(write) - - reserved(def) method(<<)operator(() ident(str) operator(\)) - ident(stream_check!) - instance_variable(@dest) operator(<<) ident(str)operator(.)ident(to_s) - pre_constant(self) - reserved(end) - - ident(private) - - reserved(def) method(stream_check!) - instance_variable(@closed) reserved(and) ident(raise) constant(IOError)operator(,) string - reserved(end) - -reserved(end) -ident(require) string -comment(#) -comment(# utils.rb) -comment(#) -comment(#--) -comment(# Copyright (c\) 1998-2003 Minero Aoki ) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) -comment(#++) - -reserved(module) class(TMail) - - reserved(class) class(SyntaxError) operator(<) constant(StandardError)operator(;) reserved(end) - - - reserved(def) constant(TMail)operator(.)method(new_boundary) - string operator(+) ident(random_tag) - reserved(end) - - reserved(def) constant(TMail)operator(.)method(new_message_id)operator(() ident(fqdn) operator(=) pre_constant(nil) operator(\)) - ident(fqdn) operator(||=) operator(::)constant(Socket)operator(.)ident(gethostname) - stringcontent(@)inlinecontent(.tmail>)delimiter(")> - reserved(end) - - reserved(def) constant(TMail)operator(.)method(random_tag) - instance_variable(@uniq) operator(+=) integer(1) - ident(t) operator(=) constant(Time)operator(.)ident(now) - ident(sprintf)operator(()stringoperator(,) - ident(t)operator(.)ident(to_i)operator(,) ident(t)operator(.)ident(tv_usec)operator(,) - global_variable($$)operator(,) constant(Thread)operator(.)ident(current)operator(.)ident(object_id)operator(,) instance_variable(@uniq)operator(,) ident(rand)operator(()integer(255)operator(\))operator(\)) - reserved(end) - ident(private_class_method) symbol(:random_tag) - - instance_variable(@uniq) operator(=) integer(0) - - - reserved(module) class(TextUtils) - - ident(aspecial) operator(=) string[]:;.)char(\\\\)content(,")delimiter(')> - ident(tspecial) operator(=) string[];:)char(\\\\)content(,"/?=)delimiter(')> - ident(lwsp) operator(=) string - ident(control) operator(=) string - - constant(ATOM_UNSAFE) operator(=) regexpinlineinlinecontent(])delimiter(/)modifier(n)> - constant(PHRASE_UNSAFE) operator(=) regexpinlinecontent(])delimiter(/)modifier(n)> - constant(TOKEN_UNSAFE) operator(=) regexpinlineinlinecontent(])delimiter(/)modifier(n)> - constant(CONTROL_CHAR) operator(=) regexpcontent(])delimiter(/)modifier(n)> - - reserved(def) method(atom_safe?)operator(() ident(str) operator(\)) - reserved(not) constant(ATOM_UNSAFE) operator(===) ident(str) - reserved(end) - - reserved(def) method(quote_atom)operator(() ident(str) operator(\)) - operator(()constant(ATOM_UNSAFE) operator(===) ident(str)operator(\)) operator(?) ident(dquote)operator(()ident(str)operator(\)) operator(:) ident(str) - reserved(end) - - reserved(def) method(quote_phrase)operator(() ident(str) operator(\)) - operator(()constant(PHRASE_UNSAFE) operator(===) ident(str)operator(\)) operator(?) ident(dquote)operator(()ident(str)operator(\)) operator(:) ident(str) - reserved(end) - - reserved(def) method(token_safe?)operator(() ident(str) operator(\)) - reserved(not) constant(TOKEN_UNSAFE) operator(===) ident(str) - reserved(end) - - reserved(def) method(quote_token)operator(() ident(str) operator(\)) - operator(()constant(TOKEN_UNSAFE) operator(===) ident(str)operator(\)) operator(?) ident(dquote)operator(()ident(str)operator(\)) operator(:) ident(str) - reserved(end) - - reserved(def) method(dquote)operator(() ident(str) operator(\)) - string operator(+) ident(str)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({)operator(|)ident(s)operator(|) string operator(+) ident(s) operator(}) operator(+) string - reserved(end) - ident(private) symbol(:dquote) - - - reserved(def) method(join_domain)operator(() ident(arr) operator(\)) - ident(arr)operator(.)ident(map) operator({)operator(|)ident(i)operator(|) - reserved(if) regexp operator(===) ident(i) - ident(i) - reserved(else) - ident(quote_atom)operator(()ident(i)operator(\)) - reserved(end) - operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - - constant(ZONESTR_TABLE) operator(=) operator({) - string operator(=)operator(>) integer(9) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(2) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(1) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(1) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(0)operator(,) - string operator(=)operator(>) integer(0)operator(,) - string operator(=)operator(>) integer(0)operator(,) - string operator(=)operator(>) operator(-)operator(()integer(3) operator(*) integer(60) operator(+) integer(30)operator(\))operator(,) - string operator(=)operator(>) integer(-4) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-4) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-5) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-5) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-6) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-6) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-7) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-7) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-8) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-1) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-2) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-3) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-4) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-5) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-6) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-7) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-8) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-9) operator(*) integer(60)operator(,) - comment(# j not use) - string operator(=)operator(>) integer(-10) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-11) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(-12) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(1) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(2) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(3) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(4) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(5) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(6) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(7) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(8) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(9) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(10) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(11) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(12) operator(*) integer(60)operator(,) - string operator(=)operator(>) integer(0) operator(*) integer(60) - operator(}) - - reserved(def) method(timezone_string_to_unixtime)operator(() ident(str) operator(\)) - reserved(if) ident(m) operator(=) regexpoperator(.)ident(match)operator(()ident(str)operator(\)) - ident(sec) operator(=) operator(()ident(m)operator([)integer(2)operator(])operator(.)ident(to_i) operator(*) integer(60) operator(+) ident(m)operator([)integer(3)operator(])operator(.)ident(to_i)operator(\)) operator(*) integer(60) - ident(m)operator([)integer(1)operator(]) operator(==) string operator(?) operator(-)ident(sec) operator(:) ident(sec) - reserved(else) - ident(min) operator(=) constant(ZONESTR_TABLE)operator([)ident(str)operator(.)ident(downcase)operator(]) reserved(or) - ident(raise) constant(SyntaxError)operator(,) stringcontent(')delimiter(")> - ident(min) operator(*) integer(60) - reserved(end) - reserved(end) - - - constant(WDAY) operator(=) string - constant(MONTH) operator(=) string - - reserved(def) method(time2str)operator(() ident(tm) operator(\)) - comment(# [ruby-list:7928]) - ident(gmt) operator(=) constant(Time)operator(.)ident(at)operator(()ident(tm)operator(.)ident(to_i)operator(\)) - ident(gmt)operator(.)ident(gmtime) - ident(offset) operator(=) ident(tm)operator(.)ident(to_i) operator(-) constant(Time)operator(.)ident(local)operator(()operator(*)ident(gmt)operator(.)ident(to_a)operator([)integer(0)operator(,)integer(6)operator(])operator(.)ident(reverse)operator(\))operator(.)ident(to_i) - - comment(# DO NOT USE strftime: setlocale(\) breaks it) - ident(sprintf) stringoperator(,) - constant(WDAY)operator([)ident(tm)operator(.)ident(wday)operator(])operator(,) ident(tm)operator(.)ident(mday)operator(,) constant(MONTH)operator([)ident(tm)operator(.)ident(month)operator(])operator(,) - ident(tm)operator(.)ident(year)operator(,) ident(tm)operator(.)ident(hour)operator(,) ident(tm)operator(.)ident(min)operator(,) ident(tm)operator(.)ident(sec)operator(,) - operator(*)operator(()ident(offset) operator(/) integer(60)operator(\))operator(.)ident(divmod)operator(()integer(60)operator(\)) - reserved(end) - - - constant(MESSAGE_ID) operator(=) regexp]+)char(\\@)content([^>)char(\\@)content(]+>)delimiter(/)> - - reserved(def) method(message_id?)operator(() ident(str) operator(\)) - constant(MESSAGE_ID) operator(===) ident(str) - reserved(end) - - - constant(MIME_ENCODED) operator(=) regexp - - reserved(def) method(mime_encoded?)operator(() ident(str) operator(\)) - constant(MIME_ENCODED) operator(===) ident(str) - reserved(end) - - - reserved(def) method(decode_params)operator(() ident(hash) operator(\)) - ident(new) operator(=) constant(Hash)operator(.)ident(new) - ident(encoded) operator(=) pre_constant(nil) - ident(hash)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(if) ident(m) operator(=) regexpoperator(.)ident(match)operator(()ident(key)operator(\)) - operator(()operator(()ident(encoded) operator(||=) operator({)operator(})operator(\))operator([)ident(m)operator(.)ident(pre_match)operator(]) operator(||=) operator([)operator(])operator(\))operator([)operator(()ident(m)operator([)integer(1)operator(]) operator(||) integer(0)operator(\))operator(.)ident(to_i)operator(]) operator(=) ident(value) - reserved(else) - ident(new)operator([)ident(key)operator(]) operator(=) ident(to_kcode)operator(()ident(value)operator(\)) - reserved(end) - reserved(end) - reserved(if) ident(encoded) - ident(encoded)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(strings)operator(|) - ident(new)operator([)ident(key)operator(]) operator(=) ident(decode_RFC2231)operator(()ident(strings)operator(.)ident(join)operator(()stringoperator(\))operator(\)) - reserved(end) - reserved(end) - - ident(new) - reserved(end) - - constant(NKF_FLAGS) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) string - operator(}) - - reserved(def) method(to_kcode)operator(() ident(str) operator(\)) - ident(flag) operator(=) constant(NKF_FLAGS)operator([)global_variable($KCODE)operator(]) reserved(or) reserved(return) ident(str) - constant(NKF)operator(.)ident(nkf)operator(()ident(flag)operator(,) ident(str)operator(\)) - reserved(end) - - constant(RFC2231_ENCODED) operator(=) regexp - - reserved(def) method(decode_RFC2231)operator(() ident(str) operator(\)) - ident(m) operator(=) constant(RFC2231_ENCODED)operator(.)ident(match)operator(()ident(str)operator(\)) reserved(or) reserved(return) ident(str) - reserved(begin) - constant(NKF)operator(.)ident(nkf)operator(()constant(NKF_FLAGS)operator([)global_variable($KCODE)operator(])operator(,) - ident(m)operator(.)ident(post_match)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({)operator(|)ident(s)operator(|) ident(s)operator([)integer(1)operator(,)integer(2)operator(])operator(.)ident(hex)operator(.)ident(chr) operator(})operator(\)) - reserved(rescue) - ident(m)operator(.)ident(post_match)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - reserved(end) - - reserved(end) - -reserved(end) -ident(require) string -ident(require) string -ident(require) string -reserved(module) class(ActionMailer) - reserved(module) class(VERSION) comment(#:nodoc:) - constant(MAJOR) operator(=) integer(1) - constant(MINOR) operator(=) integer(2) - constant(TINY) operator(=) integer(5) - - constant(STRING) operator(=) operator([)constant(MAJOR)operator(,) constant(MINOR)operator(,) constant(TINY)operator(])operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) -reserved(end) -comment(#--) -comment(# Copyright (c\) 2004 David Heinemeier Hansson) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#++) - -reserved(begin) - ident(require) string -reserved(rescue) constant(LoadError) - reserved(begin) - ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - reserved(rescue) constant(LoadError) - ident(require) string - ident(require_gem) stringoperator(,) string= 1.9.1)delimiter(')> - reserved(end) -reserved(end) - -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -constant(ActionMailer)operator(::)constant(Base)operator(.)ident(class_eval) reserved(do) - ident(include) constant(ActionMailer)operator(::)constant(Quoting) - ident(include) constant(ActionMailer)operator(::)constant(Helpers) - - ident(helper) constant(MailHelper) -reserved(end) - -ident(silence_warnings) operator({) constant(TMail)operator(::)constant(Encoder)operator(.)ident(const_set)operator(()stringoperator(,) integer(200)operator(\)) operator(})reserved(module) class(TestHelper) - reserved(def) method(test_format)operator(()ident(text)operator(\)) - string)inlinecontent()delimiter(")> - reserved(end) -reserved(end) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -global_variable($:)operator(.)ident(unshift) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -ident(require) string -ident(require) string - -reserved(module) class(MailerHelper) - reserved(def) method(person_name) - string - reserved(end) -reserved(end) - -reserved(class) class(HelperMailer) operator(<) constant(ActionMailer)operator(::)constant(Base) - ident(helper) constant(MailerHelper) - ident(helper) symbol(:test) - - reserved(def) method(use_helper)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - reserved(end) - - reserved(def) method(use_test_helper)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - pre_constant(self)operator(.)ident(body) operator(=) operator({) symbol(:text) operator(=)operator(>) string operator(}) - reserved(end) - - reserved(def) method(use_mail_helper)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - pre_constant(self)operator(.)ident(body) operator(=) operator({) symbol(:text) operator(=)operator(>) - string operator(+) - string operator(+) - string operator(+) - string operator(+) - string operator(+) - string - operator(}) - reserved(end) - - reserved(def) method(use_helper_method)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - pre_constant(self)operator(.)ident(body) operator(=) operator({) symbol(:text) operator(=)operator(>) string operator(}) - reserved(end) - - ident(private) - - reserved(def) method(name_of_the_mailer_class) - pre_constant(self)operator(.)ident(class)operator(.)ident(name) - reserved(end) - ident(helper_method) symbol(:name_of_the_mailer_class) -reserved(end) - -constant(HelperMailer)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(MailerHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(new_mail)operator(() ident(charset)operator(=)string operator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(new) - ident(mail)operator(.)ident(set_content_type) stringoperator(,) stringoperator(,) operator({) string operator(=)operator(>) ident(charset) operator(}) reserved(if) ident(charset) - ident(mail) - reserved(end) - - reserved(def) method(setup) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(delivery_method) operator(=) symbol(:test) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(perform_deliveries) operator(=) pre_constant(true) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries) operator(=) operator([)operator(]) - - instance_variable(@recipient) operator(=) string - reserved(end) - - reserved(def) method(test_use_helper) - ident(mail) operator(=) constant(HelperMailer)operator(.)ident(create_use_helper)operator(()instance_variable(@recipient)operator(\)) - ident(assert_match) regexpoperator(,) ident(mail)operator(.)ident(encoded) - reserved(end) - - reserved(def) method(test_use_test_helper) - ident(mail) operator(=) constant(HelperMailer)operator(.)ident(create_use_test_helper)operator(()instance_variable(@recipient)operator(\)) - ident(assert_match) regexpemphasize me!)delimiter(})>operator(,) ident(mail)operator(.)ident(encoded) - reserved(end) - - reserved(def) method(test_use_helper_method) - ident(mail) operator(=) constant(HelperMailer)operator(.)ident(create_use_helper_method)operator(()instance_variable(@recipient)operator(\)) - ident(assert_match) regexpoperator(,) ident(mail)operator(.)ident(encoded) - reserved(end) - - reserved(def) method(test_use_mail_helper) - ident(mail) operator(=) constant(HelperMailer)operator(.)ident(create_use_mail_helper)operator(()instance_variable(@recipient)operator(\)) - ident(assert_match) regexpoperator(,) ident(mail)operator(.)ident(encoded) - ident(assert_match) regexpoperator(,) ident(mail)operator(.)ident(encoded) - reserved(end) -reserved(end) - -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - -ident(require) string -ident(require) string - -reserved(class) class(RenderMailer) operator(<) constant(ActionMailer)operator(::)constant(Base) - reserved(def) method(inline_template)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(body) ident(render)operator(()symbol(:inline) operator(=)operator(>) string)delimiter(")>operator(,) symbol(:body) operator(=)operator(>) operator({) symbol(:world) operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(file_template)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(body) ident(render)operator(()symbol(:file) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) operator({) symbol(:recipient) operator(=)operator(>) ident(recipient) operator(})operator(\)) - reserved(end) - - reserved(def) method(initialize_defaults)operator(()ident(method_name)operator(\)) - reserved(super) - ident(mailer_name) string - reserved(end) -reserved(end) - -constant(RenderMailer)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(RenderHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(delivery_method) operator(=) symbol(:test) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(perform_deliveries) operator(=) pre_constant(true) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries) operator(=) operator([)operator(]) - - instance_variable(@recipient) operator(=) string - reserved(end) - - reserved(def) method(test_inline_template) - ident(mail) operator(=) constant(RenderMailer)operator(.)ident(create_inline_template)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(body)operator(.)ident(strip) - reserved(end) - - reserved(def) method(test_file_template) - ident(mail) operator(=) constant(RenderMailer)operator(.)ident(create_file_template)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(body)operator(.)ident(strip) - reserved(end) -reserved(end) - -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - -ident(require) string -ident(require) string - -reserved(class) class(MockSMTP) - reserved(def) pre_constant(self)operator(.)method(deliveries) - class_variable(@@deliveries) - reserved(end) - - reserved(def) method(initialize) - class_variable(@@deliveries) operator(=) operator([)operator(]) - reserved(end) - - reserved(def) method(sendmail)operator(()ident(mail)operator(,) ident(from)operator(,) ident(to)operator(\)) - class_variable(@@deliveries) operator(<<) operator([)ident(mail)operator(,) ident(from)operator(,) ident(to)operator(]) - reserved(end) -reserved(end) - -reserved(class) class(Net::SMTP) - reserved(def) pre_constant(self)operator(.)method(start)operator(()operator(*)ident(args)operator(\)) - reserved(yield) constant(MockSMTP)operator(.)ident(new) - reserved(end) -reserved(end) - -reserved(class) class(FunkyPathMailer) operator(<) constant(ActionMailer)operator(::)constant(Base) - pre_constant(self)operator(.)ident(template_root) operator(=) stringcontent(/fixtures/path.with.dots)delimiter(")> - - reserved(def) method(multipart_with_template_path_with_dots)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string)delimiter(")> - ident(attachment) symbol(:content_type) operator(=)operator(>) stringoperator(,) - symbol(:body) operator(=)operator(>) string - reserved(end) - - reserved(def) method(template_path) - stringcontent(/fixtures/path.with.dots)delimiter(")> - reserved(end) -reserved(end) - -reserved(class) class(TestMailer) operator(<) constant(ActionMailer)operator(::)constant(Base) - - reserved(def) method(signed_up)operator(()ident(recipient)operator(\)) - instance_variable(@recipients) operator(=) ident(recipient) - instance_variable(@subject) operator(=) stringdelimiter(")> - instance_variable(@from) operator(=) string - instance_variable(@sent_on) operator(=) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(12)operator(,) integer(12)operator(\)) - instance_variable(@body)operator([)stringoperator(]) operator(=) ident(recipient) - reserved(end) - - reserved(def) method(cancelled_account)operator(()ident(recipient)operator(\)) - pre_constant(self)operator(.)ident(recipients) operator(=) ident(recipient) - pre_constant(self)operator(.)ident(subject) operator(=) stringdelimiter(")> - pre_constant(self)operator(.)ident(from) operator(=) string - pre_constant(self)operator(.)ident(sent_on) operator(=) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(12)operator(,) integer(12)operator(\)) - pre_constant(self)operator(.)ident(body) operator(=) stringdelimiter(")> - reserved(end) - - reserved(def) method(cc_bcc)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(sent_on) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(12)operator(,) integer(12)operator(\)) - ident(cc) string - ident(bcc) string - ident(body) string - reserved(end) - - reserved(def) method(iso_charset)operator(()ident(recipient)operator(\)) - instance_variable(@recipients) operator(=) ident(recipient) - instance_variable(@subject) operator(=) string - instance_variable(@from) operator(=) string - instance_variable(@sent_on) operator(=) constant(Time)operator(.)ident(local) integer(2004)operator(,) integer(12)operator(,) integer(12) - instance_variable(@cc) operator(=) string - instance_variable(@bcc) operator(=) string - instance_variable(@body) operator(=) string - instance_variable(@charset) operator(=) string - reserved(end) - - reserved(def) method(unencoded_subject)operator(()ident(recipient)operator(\)) - instance_variable(@recipients) operator(=) ident(recipient) - instance_variable(@subject) operator(=) string - instance_variable(@from) operator(=) string - instance_variable(@sent_on) operator(=) constant(Time)operator(.)ident(local) integer(2004)operator(,) integer(12)operator(,) integer(12) - instance_variable(@cc) operator(=) string - instance_variable(@bcc) operator(=) string - instance_variable(@body) operator(=) string - reserved(end) - - reserved(def) method(extended_headers)operator(()ident(recipient)operator(\)) - instance_variable(@recipients) operator(=) ident(recipient) - instance_variable(@subject) operator(=) string - instance_variable(@from) operator(=) string)delimiter(")> - instance_variable(@sent_on) operator(=) constant(Time)operator(.)ident(local) integer(2004)operator(,) integer(12)operator(,) integer(12) - instance_variable(@cc) operator(=) string)delimiter(")> - instance_variable(@bcc) operator(=) string)delimiter(")> - instance_variable(@body) operator(=) string - instance_variable(@charset) operator(=) string - reserved(end) - - reserved(def) method(utf8_body)operator(()ident(recipient)operator(\)) - instance_variable(@recipients) operator(=) ident(recipient) - instance_variable(@subject) operator(=) string - instance_variable(@from) operator(=) string)delimiter(")> - instance_variable(@sent_on) operator(=) constant(Time)operator(.)ident(local) integer(2004)operator(,) integer(12)operator(,) integer(12) - instance_variable(@cc) operator(=) string)delimiter(")> - instance_variable(@bcc) operator(=) string)delimiter(")> - instance_variable(@body) operator(=) string - instance_variable(@charset) operator(=) string - reserved(end) - - reserved(def) method(multipart_with_mime_version)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(sent_on) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(12)operator(,) integer(12)operator(\)) - ident(mime_version) string - ident(content_type) string - - ident(part) string reserved(do) operator(|)ident(p)operator(|) - ident(p)operator(.)ident(body) operator(=) string - reserved(end) - - ident(part) string reserved(do) operator(|)ident(p)operator(|) - ident(p)operator(.)ident(body) operator(=) stringblah)delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(multipart_with_utf8_subject)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(charset) string - - ident(part) string reserved(do) operator(|)ident(p)operator(|) - ident(p)operator(.)ident(body) operator(=) string - reserved(end) - - ident(part) string reserved(do) operator(|)ident(p)operator(|) - ident(p)operator(.)ident(body) operator(=) stringblah)delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(explicitly_multipart_example)operator(()ident(recipient)operator(,) ident(ct)operator(=)pre_constant(nil)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(sent_on) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(12)operator(,) integer(12)operator(\)) - ident(body) string - ident(content_type) ident(ct) reserved(if) ident(ct) - - ident(part) string reserved(do) operator(|)ident(p)operator(|) - ident(p)operator(.)ident(charset) operator(=) string - ident(p)operator(.)ident(body) operator(=) string - reserved(end) - - ident(attachment) symbol(:content_type) operator(=)operator(>) stringoperator(,) symbol(:filename) operator(=)operator(>) stringoperator(,) - symbol(:body) operator(=)operator(>) string - reserved(end) - - reserved(def) method(implicitly_multipart_example)operator(()ident(recipient)operator(,) ident(cs) operator(=) pre_constant(nil)operator(,) ident(order) operator(=) pre_constant(nil)operator(\)) - instance_variable(@recipients) operator(=) ident(recipient) - instance_variable(@subject) operator(=) string - instance_variable(@from) operator(=) string - instance_variable(@sent_on) operator(=) constant(Time)operator(.)ident(local) integer(2004)operator(,) integer(12)operator(,) integer(12) - instance_variable(@body) operator(=) operator({) string operator(=)operator(>) ident(recipient) operator(}) - instance_variable(@charset) operator(=) ident(cs) reserved(if) ident(cs) - instance_variable(@implicit_parts_order) operator(=) ident(order) reserved(if) ident(order) - reserved(end) - - reserved(def) method(implicitly_multipart_with_utf8) - ident(recipients) string - ident(subject) string - ident(from) string - ident(template) string - ident(body) operator(()operator({) string operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(html_mail)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(body) stringEmphasize this)delimiter(")> - ident(content_type) string - reserved(end) - - reserved(def) method(html_mail_with_underscores)operator(()ident(recipient)operator(\)) - ident(subject) string - ident(body) string_Google)delimiter(})> - reserved(end) - - reserved(def) method(custom_template)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) stringdelimiter(")> - ident(from) string - ident(sent_on) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(12)operator(,) integer(12)operator(\)) - ident(template) string - - ident(body)operator([)stringoperator(]) operator(=) ident(recipient) - reserved(end) - - reserved(def) method(various_newlines)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(body) string operator(+) - string - reserved(end) - - reserved(def) method(various_newlines_multipart)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(content_type) string - ident(part) symbol(:content_type) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) string - ident(part) symbol(:content_type) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) stringline #1

)char(\\n)content(

line #2

)char(\\r)content(

line #3

)char(\\r)char(\\n)content(

line #4

)char(\\r)char(\\r)delimiter(")> - reserved(end) - - reserved(def) method(nested_multipart)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(content_type) string - ident(part) symbol(:content_type) operator(=)operator(>) stringoperator(,) symbol(:content_disposition) operator(=)operator(>) string reserved(do) operator(|)ident(p)operator(|) - ident(p)operator(.)ident(part) symbol(:content_type) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) string - ident(p)operator(.)ident(part) symbol(:content_type) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) stringtest HTML
)char(\\n)content(line #2)delimiter(")> - reserved(end) - ident(attachment) symbol(:content_type) operator(=)operator(>) stringoperator(,)symbol(:filename) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) string - reserved(end) - - reserved(def) method(attachment_with_custom_header)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(content_type) string - ident(part) symbol(:content_type) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) string - ident(attachment) symbol(:content_type) operator(=)operator(>) stringoperator(,)symbol(:filename) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) stringoperator(,) symbol(:headers) operator(=)operator(>) operator({) string operator(=)operator(>) string)delimiter(')> operator(}) - reserved(end) - - reserved(def) method(unnamed_attachment)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string - ident(content_type) string - ident(part) symbol(:content_type) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) string - ident(attachment) symbol(:content_type) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) string - reserved(end) - - reserved(def) method(headers_with_nonalpha_chars)operator(()ident(recipient)operator(\)) - ident(recipients) ident(recipient) - ident(subject) string - ident(from) string)delimiter(")> - ident(cc) string)delimiter(")> - ident(bcc) string)delimiter(")> - ident(body) string - reserved(end) - - reserved(def) method(custom_content_type_attributes) - ident(recipients) string - ident(subject) string - ident(from) string - ident(content_type) string - ident(body) string - reserved(end) - - reserved(class) operator(<<)class(self) - ident(attr_accessor) symbol(:received_body) - reserved(end) - - reserved(def) method(receive)operator(()ident(mail)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(received_body) operator(=) ident(mail)operator(.)ident(body) - reserved(end) -reserved(end) - -constant(TestMailer)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(ActionMailerTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionMailer)operator(::)constant(Quoting) - - reserved(def) method(encode)operator(() ident(text)operator(,) ident(charset)operator(=)string operator(\)) - ident(quoted_printable)operator(() ident(text)operator(,) ident(charset) operator(\)) - reserved(end) - - reserved(def) method(new_mail)operator(() ident(charset)operator(=)string operator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(new) - reserved(if) ident(charset) - ident(mail)operator(.)ident(set_content_type) stringoperator(,) stringoperator(,) operator({) string operator(=)operator(>) ident(charset) operator(}) - reserved(end) - ident(mail) - reserved(end) - - reserved(def) method(setup) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(delivery_method) operator(=) symbol(:test) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(perform_deliveries) operator(=) pre_constant(true) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries) operator(=) operator([)operator(]) - - instance_variable(@recipient) operator(=) string - reserved(end) - - reserved(def) method(test_nested_parts) - ident(created) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(created) operator(=) constant(TestMailer)operator(.)ident(create_nested_multipart)operator(()instance_variable(@recipient)operator(\))operator(}) - ident(assert_equal) integer(2)operator(,)ident(created)operator(.)ident(parts)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,)ident(created)operator(.)ident(parts)operator(.)ident(first)operator(.)ident(parts)operator(.)ident(size) - - ident(assert_equal) stringoperator(,) ident(created)operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(created)operator(.)ident(parts)operator(.)ident(first)operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(created)operator(.)ident(parts)operator(.)ident(first)operator(.)ident(parts)operator(.)ident(first)operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(created)operator(.)ident(parts)operator(.)ident(first)operator(.)ident(parts)operator([)integer(1)operator(])operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(created)operator(.)ident(parts)operator([)integer(1)operator(])operator(.)ident(content_type) - reserved(end) - - reserved(def) method(test_attachment_with_custom_header) - ident(created) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(created) operator(=) constant(TestMailer)operator(.)ident(create_attachment_with_custom_header)operator(()instance_variable(@recipient)operator(\))operator(}) - ident(assert_equal) string)delimiter(")>operator(,) ident(created)operator(.)ident(parts)operator([)integer(1)operator(])operator(.)ident(header)operator([)stringoperator(])operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_signed_up) - ident(expected) operator(=) ident(new_mail) - ident(expected)operator(.)ident(to) operator(=) instance_variable(@recipient) - ident(expected)operator(.)ident(subject) operator(=) stringdelimiter(")> - ident(expected)operator(.)ident(body) operator(=) stringdelimiter(")> - ident(expected)operator(.)ident(from) operator(=) string - ident(expected)operator(.)ident(date) operator(=) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(12)operator(,) integer(12)operator(\)) - ident(expected)operator(.)ident(mime_version) operator(=) pre_constant(nil) - - ident(created) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(created) operator(=) constant(TestMailer)operator(.)ident(create_signed_up)operator(()instance_variable(@recipient)operator(\)) operator(}) - ident(assert_not_nil) ident(created) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) ident(created)operator(.)ident(encoded) - - ident(assert_nothing_raised) operator({) constant(TestMailer)operator(.)ident(deliver_signed_up)operator(()instance_variable(@recipient)operator(\)) operator(}) - ident(assert_not_nil) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first)operator(.)ident(encoded) - reserved(end) - - reserved(def) method(test_custom_template) - ident(expected) operator(=) ident(new_mail) - ident(expected)operator(.)ident(to) operator(=) instance_variable(@recipient) - ident(expected)operator(.)ident(subject) operator(=) stringdelimiter(")> - ident(expected)operator(.)ident(body) operator(=) stringdelimiter(")> - ident(expected)operator(.)ident(from) operator(=) string - ident(expected)operator(.)ident(date) operator(=) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(12)operator(,) integer(12)operator(\)) - - ident(created) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(created) operator(=) constant(TestMailer)operator(.)ident(create_custom_template)operator(()instance_variable(@recipient)operator(\)) operator(}) - ident(assert_not_nil) ident(created) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) ident(created)operator(.)ident(encoded) - reserved(end) - - reserved(def) method(test_cancelled_account) - ident(expected) operator(=) ident(new_mail) - ident(expected)operator(.)ident(to) operator(=) instance_variable(@recipient) - ident(expected)operator(.)ident(subject) operator(=) stringdelimiter(")> - ident(expected)operator(.)ident(body) operator(=) stringdelimiter(")> - ident(expected)operator(.)ident(from) operator(=) string - ident(expected)operator(.)ident(date) operator(=) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(12)operator(,) integer(12)operator(\)) - - ident(created) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(created) operator(=) constant(TestMailer)operator(.)ident(create_cancelled_account)operator(()instance_variable(@recipient)operator(\)) operator(}) - ident(assert_not_nil) ident(created) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) ident(created)operator(.)ident(encoded) - - ident(assert_nothing_raised) operator({) constant(TestMailer)operator(.)ident(deliver_cancelled_account)operator(()instance_variable(@recipient)operator(\)) operator(}) - ident(assert_not_nil) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first)operator(.)ident(encoded) - reserved(end) - - reserved(def) method(test_cc_bcc) - ident(expected) operator(=) ident(new_mail) - ident(expected)operator(.)ident(to) operator(=) instance_variable(@recipient) - ident(expected)operator(.)ident(subject) operator(=) string - ident(expected)operator(.)ident(body) operator(=) string - ident(expected)operator(.)ident(from) operator(=) string - ident(expected)operator(.)ident(cc) operator(=) string - ident(expected)operator(.)ident(bcc) operator(=) string - ident(expected)operator(.)ident(date) operator(=) constant(Time)operator(.)ident(local) integer(2004)operator(,) integer(12)operator(,) integer(12) - - ident(created) operator(=) pre_constant(nil) - ident(assert_nothing_raised) reserved(do) - ident(created) operator(=) constant(TestMailer)operator(.)ident(create_cc_bcc) instance_variable(@recipient) - reserved(end) - ident(assert_not_nil) ident(created) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) ident(created)operator(.)ident(encoded) - - ident(assert_nothing_raised) reserved(do) - constant(TestMailer)operator(.)ident(deliver_cc_bcc) instance_variable(@recipient) - reserved(end) - - ident(assert_not_nil) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first)operator(.)ident(encoded) - reserved(end) - - reserved(def) method(test_iso_charset) - ident(expected) operator(=) ident(new_mail)operator(() string operator(\)) - ident(expected)operator(.)ident(to) operator(=) instance_variable(@recipient) - ident(expected)operator(.)ident(subject) operator(=) ident(encode) stringoperator(,) string - ident(expected)operator(.)ident(body) operator(=) string - ident(expected)operator(.)ident(from) operator(=) string - ident(expected)operator(.)ident(cc) operator(=) string - ident(expected)operator(.)ident(bcc) operator(=) string - ident(expected)operator(.)ident(date) operator(=) constant(Time)operator(.)ident(local) integer(2004)operator(,) integer(12)operator(,) integer(12) - - ident(created) operator(=) pre_constant(nil) - ident(assert_nothing_raised) reserved(do) - ident(created) operator(=) constant(TestMailer)operator(.)ident(create_iso_charset) instance_variable(@recipient) - reserved(end) - ident(assert_not_nil) ident(created) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) ident(created)operator(.)ident(encoded) - - ident(assert_nothing_raised) reserved(do) - constant(TestMailer)operator(.)ident(deliver_iso_charset) instance_variable(@recipient) - reserved(end) - - ident(assert_not_nil) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first)operator(.)ident(encoded) - reserved(end) - - reserved(def) method(test_unencoded_subject) - ident(expected) operator(=) ident(new_mail) - ident(expected)operator(.)ident(to) operator(=) instance_variable(@recipient) - ident(expected)operator(.)ident(subject) operator(=) string - ident(expected)operator(.)ident(body) operator(=) string - ident(expected)operator(.)ident(from) operator(=) string - ident(expected)operator(.)ident(cc) operator(=) string - ident(expected)operator(.)ident(bcc) operator(=) string - ident(expected)operator(.)ident(date) operator(=) constant(Time)operator(.)ident(local) integer(2004)operator(,) integer(12)operator(,) integer(12) - - ident(created) operator(=) pre_constant(nil) - ident(assert_nothing_raised) reserved(do) - ident(created) operator(=) constant(TestMailer)operator(.)ident(create_unencoded_subject) instance_variable(@recipient) - reserved(end) - ident(assert_not_nil) ident(created) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) ident(created)operator(.)ident(encoded) - - ident(assert_nothing_raised) reserved(do) - constant(TestMailer)operator(.)ident(deliver_unencoded_subject) instance_variable(@recipient) - reserved(end) - - ident(assert_not_nil) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first)operator(.)ident(encoded) - reserved(end) - - reserved(def) method(test_instances_are_nil) - ident(assert_nil) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(new) - ident(assert_nil) constant(TestMailer)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_deliveries_array) - ident(assert_not_nil) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries) - ident(assert_equal) integer(0)operator(,) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(size) - constant(TestMailer)operator(.)ident(deliver_signed_up)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) integer(1)operator(,) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(size) - ident(assert_not_nil) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first) - reserved(end) - - reserved(def) method(test_perform_deliveries_flag) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(perform_deliveries) operator(=) pre_constant(false) - constant(TestMailer)operator(.)ident(deliver_signed_up)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) integer(0)operator(,) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(size) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(perform_deliveries) operator(=) pre_constant(true) - constant(TestMailer)operator(.)ident(deliver_signed_up)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) integer(1)operator(,) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_unquote_quoted_printable_subject) - ident(msg) operator(=) stringstring - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(msg)operator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(subject) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(quoted_subject) - reserved(end) - - reserved(def) method(test_unquote_7bit_subject) - ident(msg) operator(=) stringstring - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(msg)operator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(subject) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(quoted_subject) - reserved(end) - - reserved(def) method(test_unquote_7bit_body) - ident(msg) operator(=) stringstring - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(msg)operator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(body)operator(.)ident(strip) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(quoted_body)operator(.)ident(strip) - reserved(end) - - reserved(def) method(test_unquote_quoted_printable_body) - ident(msg) operator(=) stringstring - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(msg)operator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(body)operator(.)ident(strip) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(quoted_body)operator(.)ident(strip) - reserved(end) - - reserved(def) method(test_unquote_base64_body) - ident(msg) operator(=) stringstring - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(msg)operator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(body)operator(.)ident(strip) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(quoted_body)operator(.)ident(strip) - reserved(end) - - reserved(def) method(test_extended_headers) - instance_variable(@recipient) operator(=) string)delimiter(")> - - ident(expected) operator(=) ident(new_mail) string - ident(expected)operator(.)ident(to) operator(=) ident(quote_address_if_necessary) instance_variable(@recipient)operator(,) string - ident(expected)operator(.)ident(subject) operator(=) string - ident(expected)operator(.)ident(body) operator(=) string - ident(expected)operator(.)ident(from) operator(=) ident(quote_address_if_necessary) string)delimiter(")>operator(,) string - ident(expected)operator(.)ident(cc) operator(=) ident(quote_address_if_necessary) string)delimiter(")>operator(,) string - ident(expected)operator(.)ident(bcc) operator(=) ident(quote_address_if_necessary) string)delimiter(")>operator(,) string - ident(expected)operator(.)ident(date) operator(=) constant(Time)operator(.)ident(local) integer(2004)operator(,) integer(12)operator(,) integer(12) - - ident(created) operator(=) pre_constant(nil) - ident(assert_nothing_raised) reserved(do) - ident(created) operator(=) constant(TestMailer)operator(.)ident(create_extended_headers) instance_variable(@recipient) - reserved(end) - - ident(assert_not_nil) ident(created) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) ident(created)operator(.)ident(encoded) - - ident(assert_nothing_raised) reserved(do) - constant(TestMailer)operator(.)ident(deliver_extended_headers) instance_variable(@recipient) - reserved(end) - - ident(assert_not_nil) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first) - ident(assert_equal) ident(expected)operator(.)ident(encoded)operator(,) constant(ActionMailer)operator(::)constant(Base)operator(.)ident(deliveries)operator(.)ident(first)operator(.)ident(encoded) - reserved(end) - - reserved(def) method(test_utf8_body_is_not_quoted) - instance_variable(@recipient) operator(=) string)delimiter(")> - ident(expected) operator(=) ident(new_mail) string - ident(expected)operator(.)ident(to) operator(=) ident(quote_address_if_necessary) instance_variable(@recipient)operator(,) string - ident(expected)operator(.)ident(subject) operator(=) string - ident(expected)operator(.)ident(body) operator(=) string - ident(expected)operator(.)ident(from) operator(=) ident(quote_address_if_necessary) instance_variable(@recipient)operator(,) string - ident(expected)operator(.)ident(cc) operator(=) ident(quote_address_if_necessary) instance_variable(@recipient)operator(,) string - ident(expected)operator(.)ident(bcc) operator(=) ident(quote_address_if_necessary) instance_variable(@recipient)operator(,) string - ident(expected)operator(.)ident(date) operator(=) constant(Time)operator(.)ident(local) integer(2004)operator(,) integer(12)operator(,) integer(12) - - ident(created) operator(=) constant(TestMailer)operator(.)ident(create_utf8_body) instance_variable(@recipient) - ident(assert_match)operator(()regexpoperator(,) ident(created)operator(.)ident(encoded)operator(\)) - reserved(end) - - reserved(def) method(test_multiple_utf8_recipients) - instance_variable(@recipient) operator(=) operator([)string)delimiter(")>operator(,) string)delimiter(")>operator(]) - ident(expected) operator(=) ident(new_mail) string - ident(expected)operator(.)ident(to) operator(=) ident(quote_address_if_necessary) instance_variable(@recipient)operator(,) string - ident(expected)operator(.)ident(subject) operator(=) string - ident(expected)operator(.)ident(body) operator(=) string - ident(expected)operator(.)ident(from) operator(=) ident(quote_address_if_necessary) instance_variable(@recipient)operator(.)ident(first)operator(,) string - ident(expected)operator(.)ident(cc) operator(=) ident(quote_address_if_necessary) instance_variable(@recipient)operator(,) string - ident(expected)operator(.)ident(bcc) operator(=) ident(quote_address_if_necessary) instance_variable(@recipient)operator(,) string - ident(expected)operator(.)ident(date) operator(=) constant(Time)operator(.)ident(local) integer(2004)operator(,) integer(12)operator(,) integer(12) - - ident(created) operator(=) constant(TestMailer)operator(.)ident(create_utf8_body) instance_variable(@recipient) - ident(assert_match)operator(()regexp)char(\\r)delimiter(/)>operator(,) ident(created)operator(.)ident(encoded)operator(\)) - ident(assert_match)operator(()regexp, Example Recipient operator(,) ident(created)operator(.)ident(encoded)operator(\)) - reserved(end) - - reserved(def) method(test_receive_decodes_base64_encoded_mail) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - constant(TestMailer)operator(.)ident(receive)operator(()ident(fixture)operator(\)) - ident(assert_match)operator(()regexpoperator(,) constant(TestMailer)operator(.)ident(received_body)operator(\)) - reserved(end) - - reserved(def) method(test_receive_attachments) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) - ident(attachment) operator(=) ident(mail)operator(.)ident(attachments)operator(.)ident(last) - ident(assert_equal) stringoperator(,) ident(attachment)operator(.)ident(original_filename) - ident(assert_equal) stringoperator(,) ident(attachment)operator(.)ident(content_type) - reserved(end) - - reserved(def) method(test_decode_attachment_without_charset) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) - ident(attachment) operator(=) ident(mail)operator(.)ident(attachments)operator(.)ident(last) - ident(assert_equal) integer(1026)operator(,) ident(attachment)operator(.)ident(read)operator(.)ident(length) - reserved(end) - - reserved(def) method(test_attachment_using_content_location) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(mail)operator(.)ident(attachments)operator(.)ident(length) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(attachments)operator(.)ident(first)operator(.)ident(original_filename) - reserved(end) - - reserved(def) method(test_attachment_with_text_type) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) - ident(assert) ident(mail)operator(.)ident(has_attachments?) - ident(assert_equal) integer(1)operator(,) ident(mail)operator(.)ident(attachments)operator(.)ident(length) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(attachments)operator(.)ident(first)operator(.)ident(original_filename) - reserved(end) - - reserved(def) method(test_decode_part_without_content_type) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) - ident(assert_nothing_raised) operator({) ident(mail)operator(.)ident(body) operator(}) - reserved(end) - - reserved(def) method(test_decode_message_without_content_type) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) - ident(assert_nothing_raised) operator({) ident(mail)operator(.)ident(body) operator(}) - reserved(end) - - reserved(def) method(test_decode_message_with_incorrect_charset) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) - ident(assert_nothing_raised) operator({) ident(mail)operator(.)ident(body) operator(}) - reserved(end) - - reserved(def) method(test_multipart_with_mime_version) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_multipart_with_mime_version)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(mime_version) - reserved(end) - - reserved(def) method(test_multipart_with_utf8_subject) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_multipart_with_utf8_subject)operator(()instance_variable(@recipient)operator(\)) - ident(assert_match)operator(()regexpoperator(,) ident(mail)operator(.)ident(encoded)operator(\)) - reserved(end) - - reserved(def) method(test_implicitly_multipart_with_utf8) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_implicitly_multipart_with_utf8) - ident(assert_match)operator(()regexpoperator(,) ident(mail)operator(.)ident(encoded)operator(\)) - reserved(end) - - reserved(def) method(test_explicitly_multipart_messages) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_explicitly_multipart_example)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(mail)operator(.)ident(parts)operator(.)ident(length) - ident(assert_nil) ident(mail)operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(0)operator(])operator(.)ident(content_type) - - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(1)operator(])operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(1)operator(])operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(1)operator(])operator(.)ident(content_disposition) - - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(2)operator(])operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(2)operator(])operator(.)ident(content_disposition) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(2)operator(])operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(2)operator(])operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - ident(assert_nil) ident(mail)operator(.)ident(parts)operator([)integer(2)operator(])operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_explicitly_multipart_with_content_type) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_explicitly_multipart_example)operator(()instance_variable(@recipient)operator(,) stringoperator(\)) - ident(assert_equal) integer(3)operator(,) ident(mail)operator(.)ident(parts)operator(.)ident(length) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(content_type) - reserved(end) - - reserved(def) method(test_explicitly_multipart_with_invalid_content_type) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_explicitly_multipart_example)operator(()instance_variable(@recipient)operator(,) stringoperator(\)) - ident(assert_equal) integer(3)operator(,) ident(mail)operator(.)ident(parts)operator(.)ident(length) - ident(assert_nil) ident(mail)operator(.)ident(content_type) - reserved(end) - - reserved(def) method(test_implicitly_multipart_messages) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_implicitly_multipart_example)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(mail)operator(.)ident(parts)operator(.)ident(length) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(mime_version) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(0)operator(])operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(0)operator(])operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(1)operator(])operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(1)operator(])operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(2)operator(])operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(2)operator(])operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_implicitly_multipart_messages_with_custom_order) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_implicitly_multipart_example)operator(()instance_variable(@recipient)operator(,) pre_constant(nil)operator(,) operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_equal) integer(3)operator(,) ident(mail)operator(.)ident(parts)operator(.)ident(length) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(0)operator(])operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(1)operator(])operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(2)operator(])operator(.)ident(content_type) - reserved(end) - - reserved(def) method(test_implicitly_multipart_messages_with_charset) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_implicitly_multipart_example)operator(()instance_variable(@recipient)operator(,) stringoperator(\)) - - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(header)operator([)stringoperator(])operator(.)ident(body) - - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(0)operator(])operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(1)operator(])operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(2)operator(])operator(.)ident(sub_header)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_html_mail) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_html_mail)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(content_type) - reserved(end) - - reserved(def) method(test_html_mail_with_underscores) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_html_mail_with_underscores)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) string_Google)delimiter(})>operator(,) ident(mail)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_various_newlines) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_various_newlines)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal)operator(()string operator(+) - stringoperator(,) ident(mail)operator(.)ident(body)operator(\)) - reserved(end) - - reserved(def) method(test_various_newlines_multipart) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_various_newlines_multipart)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(parts)operator([)integer(0)operator(])operator(.)ident(body) - ident(assert_equal) stringline #1

)char(\\n)content(

line #2

)char(\\n)content(

line #3

)char(\\n)content(

line #4

)char(\\n)char(\\n)delimiter(")>operator(,) ident(mail)operator(.)ident(parts)operator([)integer(1)operator(])operator(.)ident(body) - reserved(end) - - reserved(def) method(test_headers_removed_on_smtp_delivery) - constant(ActionMailer)operator(::)constant(Base)operator(.)ident(delivery_method) operator(=) symbol(:smtp) - constant(TestMailer)operator(.)ident(deliver_cc_bcc)operator(()instance_variable(@recipient)operator(\)) - ident(assert) constant(MockSMTP)operator(.)ident(deliveries)operator([)integer(0)operator(])operator([)integer(2)operator(])operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) constant(MockSMTP)operator(.)ident(deliveries)operator([)integer(0)operator(])operator([)integer(2)operator(])operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) constant(MockSMTP)operator(.)ident(deliveries)operator([)integer(0)operator(])operator([)integer(2)operator(])operator(.)ident(include?)operator(()instance_variable(@recipient)operator(\)) - ident(assert_match) regexpoperator(,) constant(MockSMTP)operator(.)ident(deliveries)operator([)integer(0)operator(])operator([)integer(0)operator(]) - ident(assert_match) regexpdelimiter(})>operator(,) constant(MockSMTP)operator(.)ident(deliveries)operator([)integer(0)operator(])operator([)integer(0)operator(]) - ident(assert_no_match) regexpoperator(,) constant(MockSMTP)operator(.)ident(deliveries)operator([)integer(0)operator(])operator([)integer(0)operator(]) - reserved(end) - - reserved(def) method(test_recursive_multipart_processing) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) - ident(assert_equal) stringoperator(,) ident(mail)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_decode_encoded_attachment_filename) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) - ident(attachment) operator(=) ident(mail)operator(.)ident(attachments)operator(.)ident(last) - ident(assert_equal) stringoperator(,) ident(attachment)operator(.)ident(original_filename) - reserved(end) - - reserved(def) method(test_wrong_mail_header) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(assert_raise)operator(()constant(TMail)operator(::)constant(SyntaxError)operator(\)) operator({) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_decode_message_with_unknown_charset) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) - ident(assert_nothing_raised) operator({) ident(mail)operator(.)ident(body) operator(}) - reserved(end) - - reserved(def) method(test_decode_message_with_unquoted_atchar_in_header) - ident(fixture) operator(=) constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(mail) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(parse)operator(()ident(fixture)operator(\)) - ident(assert_not_nil) ident(mail)operator(.)ident(from) - reserved(end) - - reserved(def) method(test_empty_header_values_omitted) - ident(result) operator(=) constant(TestMailer)operator(.)ident(create_unnamed_attachment)operator(()instance_variable(@recipient)operator(\))operator(.)ident(encoded) - ident(assert_match) regexpoperator(,) ident(result) - ident(assert_match) regexpoperator(,) ident(result) - reserved(end) - - reserved(def) method(test_headers_with_nonalpha_chars) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_headers_with_nonalpha_chars)operator(()instance_variable(@recipient)operator(\)) - ident(assert) operator(!)ident(mail)operator(.)ident(from_addrs)operator(.)ident(empty?) - ident(assert) operator(!)ident(mail)operator(.)ident(cc_addrs)operator(.)ident(empty?) - ident(assert) operator(!)ident(mail)operator(.)ident(bcc_addrs)operator(.)ident(empty?) - ident(assert_match)operator(()regexpoperator(,) ident(mail)operator(.)ident(from_addrs)operator(.)ident(to_s)operator(\)) - ident(assert_match)operator(()regexpoperator(,) ident(mail)operator(.)ident(cc_addrs)operator(.)ident(to_s)operator(\)) - ident(assert_match)operator(()regexpoperator(,) ident(mail)operator(.)ident(bcc_addrs)operator(.)ident(to_s)operator(\)) - reserved(end) - - reserved(def) method(test_deliver_with_mail_object) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_headers_with_nonalpha_chars)operator(()instance_variable(@recipient)operator(\)) - ident(assert_nothing_raised) operator({) constant(TestMailer)operator(.)ident(deliver)operator(()ident(mail)operator(\)) operator(}) - ident(assert_equal) integer(1)operator(,) constant(TestMailer)operator(.)ident(deliveries)operator(.)ident(length) - reserved(end) - - reserved(def) method(test_multipart_with_template_path_with_dots) - ident(mail) operator(=) constant(FunkyPathMailer)operator(.)ident(create_multipart_with_template_path_with_dots)operator(()instance_variable(@recipient)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(mail)operator(.)ident(parts)operator(.)ident(length) - reserved(end) - - reserved(def) method(test_custom_content_type_attributes) - ident(mail) operator(=) constant(TestMailer)operator(.)ident(create_custom_content_type_attributes) - ident(assert_match) regexpoperator(,) ident(mail)operator([)stringoperator(])operator(.)ident(to_s) - ident(assert_match) regexpoperator(,) ident(mail)operator([)stringoperator(])operator(.)ident(to_s) - reserved(end) -reserved(end) - -reserved(class) class(InheritableTemplateRootTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(test_attr) - ident(expected) operator(=) stringcontent(/fixtures/path.with.dots)delimiter(")> - ident(assert_equal) ident(expected)operator(,) constant(FunkyPathMailer)operator(.)ident(template_root) - - ident(sub) operator(=) constant(Class)operator(.)ident(new)operator(()constant(FunkyPathMailer)operator(\)) - ident(sub)operator(.)ident(template_root) operator(=) string - - ident(assert_equal) stringoperator(,) ident(sub)operator(.)ident(template_root) - ident(assert_equal) ident(expected)operator(,) constant(FunkyPathMailer)operator(.)ident(template_root) - reserved(end) -reserved(end) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(QuotingTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(test_quote_multibyte_chars) - ident(original) operator(=) string - - ident(result) operator(=) ident(execute_in_sandbox)operator(()stringoperator(\))stringcontent(, "UTF-8"\))delimiter( - CODE)> - - ident(unquoted) operator(=) constant(TMail)operator(::)constant(Unquoter)operator(.)ident(unquote_and_convert_to)operator(()ident(result)operator(,) pre_constant(nil)operator(\)) - ident(assert_equal) ident(unquoted)operator(,) ident(original) - reserved(end) - - ident(private) - - comment(# This whole thing *could* be much simpler, but I don't think Tempfile,) - comment(# popen and others exist on all platforms (like Windows\).) - reserved(def) method(execute_in_sandbox)operator(()ident(code)operator(\)) - ident(test_name) operator(=) stringcontent(/am-quoting-test.)inlinecontent(.rb)delimiter(")> - ident(res_name) operator(=) stringcontent(/am-quoting-test.)inlinecontent(.out)delimiter(")> - - constant(File)operator(.)ident(open)operator(()ident(test_name)operator(,) stringoperator(\)) reserved(do) operator(|)ident(file)operator(|) - ident(file)operator(.)ident(write)operator(()stringoperator(\))stringcontent( - end - puts block.call)delimiter( - CODE)> - reserved(end) - - ident(system)operator(()stringcontent( > )inlinedelimiter(")>operator(\)) reserved(or) ident(raise) string - constant(File)operator(.)ident(read)operator(()ident(res_name)operator(\)) - reserved(ensure) - constant(File)operator(.)ident(delete)operator(()ident(test_name)operator(\)) reserved(rescue) pre_constant(nil) - constant(File)operator(.)ident(delete)operator(()ident(res_name)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) -reserved(end) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -global_variable($:)operator(.)ident(unshift) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -ident(require) string -ident(require) string - -reserved(class) class(TMailMailTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(test_body) - ident(m) operator(=) constant(TMail)operator(::)constant(Mail)operator(.)ident(new) - ident(expected) operator(=) string - ident(m)operator(.)ident(encoding) operator(=) string - ident(quoted_body) operator(=) operator([)ident(expected)operator(])operator(.)ident(pack)operator(()stringoperator(\)) - ident(m)operator(.)ident(body) operator(=) ident(quoted_body) - ident(assert_equal) stringoperator(,) ident(m)operator(.)ident(quoted_body) - ident(assert_equal) ident(expected)operator(,) ident(m)operator(.)ident(body) - reserved(end) -reserved(end) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - -ident(require) string -ident(require) string - -constant(Person) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:id)operator(,) symbol(:name)operator(,) symbol(:email_address)operator(,) symbol(:phone_number)operator(\)) - -reserved(class) class(AddressBookService) - ident(attr_reader) symbol(:people) - - reserved(def) method(initialize)operator(()operator(\)) instance_variable(@people) operator(=) operator([)operator(]) reserved(end) - reserved(def) method(create_person)operator(()ident(data)operator(\)) ident(people)operator(.)ident(unshift)operator(()constant(Person)operator(.)ident(new)operator(()ident(next_person_id)operator(,) ident(data)operator([)stringoperator(])operator(,) ident(data)operator([)stringoperator(])operator(,) ident(data)operator([)stringoperator(])operator(\))operator(\)) reserved(end) - reserved(def) method(find_person)operator(()ident(topic_id)operator(\)) ident(people)operator(.)ident(select) operator({) operator(|)ident(person)operator(|) ident(person)operator(.)ident(id) operator(==) ident(person)operator(.)ident(to_i) operator(})operator(.)ident(first) reserved(end) - reserved(def) method(next_person_id)operator(()operator(\)) ident(people)operator(.)ident(first)operator(.)ident(id) operator(+) integer(1) reserved(end) -reserved(end) - -reserved(class) class(AddressBookController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(layout) string - - ident(before_filter) symbol(:initialize_session_storage) - - comment(# Could also have used a proc) - comment(# before_filter proc { |c| c.instance_variable_set("@address_book", c.session["address_book"] ||= AddressBookService.new\) } ) - - reserved(def) method(index) - instance_variable(@title) operator(=) string - instance_variable(@people) operator(=) instance_variable(@address_book)operator(.)ident(people) - reserved(end) - - reserved(def) method(person) - instance_variable(@person) operator(=) instance_variable(@address_book)operator(.)ident(find_person)operator(()instance_variable(@params)operator([)stringoperator(])operator(\)) - reserved(end) - - reserved(def) method(create_person) - instance_variable(@address_book)operator(.)ident(create_person)operator(()instance_variable(@params)operator([)stringoperator(])operator(\)) - ident(redirect_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - ident(private) - reserved(def) method(initialize_session_storage) - instance_variable(@address_book) operator(=) instance_variable(@session)operator([)stringoperator(]) operator(||=) constant(AddressBookService)operator(.)ident(new) - reserved(end) -reserved(end) - -constant(ActionController)operator(::)constant(Base)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) -comment(# ActionController::Base.logger = Logger.new("debug.log"\) # Remove first comment to turn on logging in current dir) - -reserved(begin) - constant(AddressBookController)operator(.)ident(process_cgi)operator(()constant(CGI)operator(.)ident(new)operator(\)) reserved(if) global_variable($0) operator(==) pre_constant(__FILE__) -reserved(rescue) operator(=)operator(>) ident(e) - constant(CGI)operator(.)ident(new)operator(.)ident(out) operator({) stringcontent(: )inlinedelimiter(")> operator(}) -reserved(end)global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - -ident(require) string -ident(require) string - -constant(Person) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:name)operator(,) symbol(:address)operator(,) symbol(:age)operator(\)) - -reserved(class) class(BenchmarkController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(message) - ident(render_text) string - reserved(end) - - reserved(def) method(list) - instance_variable(@people) operator(=) operator([) constant(Person)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Person)operator(.)ident(new)operator(()stringoperator(\)) operator(]) - ident(render_template) stringName: <%= person.name %><% end %>)delimiter(")> - reserved(end) - - reserved(def) method(form_helper) - instance_variable(@person) operator(=) constant(Person)operator(.)ident(new) stringoperator(,) stringoperator(,) integer(24) - ident(render_template)operator(() - string )delimiter(")> operator(+) - string and <%= text_field 'person', 'address' %> and <%= text_field 'person', 'age' %>)delimiter(")> - operator(\)) - reserved(end) -reserved(end) - -comment(#ActionController::Base.template_root = File.dirname(__FILE__\)) - -ident(require) string - -constant(RUNS) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) operator(?) pre_constant(ARGV)operator([)integer(0)operator(])operator(.)ident(to_i) operator(:) integer(50) - -ident(require) string reserved(if) pre_constant(ARGV)operator([)integer(1)operator(]) - -ident(runtime) operator(=) constant(Benchmark)operator(.)ident(measure) operator({) - constant(RUNS)operator(.)ident(times) operator({) constant(BenchmarkController)operator(.)ident(process_test)operator(()constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new)operator(()operator({) string operator(=)operator(>) string operator(})operator(\))operator(\)) operator(}) -operator(}) - -ident(puts) stringdelimiter(")> - - -ident(runtime) operator(=) constant(Benchmark)operator(.)ident(measure) operator({) - constant(RUNS)operator(.)ident(times) operator({) constant(BenchmarkController)operator(.)ident(process_test)operator(()constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new)operator(()operator({) string operator(=)operator(>) string operator(})operator(\))operator(\)) operator(}) -operator(}) - -ident(puts) stringdelimiter(")> - -ident(runtime) operator(=) constant(Benchmark)operator(.)ident(measure) operator({) - constant(RUNS)operator(.)ident(times) operator({) constant(BenchmarkController)operator(.)ident(process_test)operator(()constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new)operator(()operator({) string operator(=)operator(>) string operator(})operator(\))operator(\)) operator(}) -operator(}) - -ident(puts) stringdelimiter(")> -ident(require) string -ident(require) string -ident(require) string - -ident(include) constant(Config) - -comment(# this was adapted from rdoc's install.rb by ways of Log4r) - -global_variable($sitedir) operator(=) constant(CONFIG)operator([)stringoperator(]) -reserved(unless) global_variable($sitedir) - ident(version) operator(=) constant(CONFIG)operator([)stringoperator(]) operator(+) string operator(+) constant(CONFIG)operator([)stringoperator(]) - global_variable($libdir) operator(=) constant(File)operator(.)ident(join)operator(()constant(CONFIG)operator([)stringoperator(])operator(,) stringoperator(,) ident(version)operator(\)) - global_variable($sitedir) operator(=) global_variable($:)operator(.)ident(find) operator({)operator(|)ident(x)operator(|) ident(x) operator(=)operator(~) regexp operator(}) - reserved(if) operator(!)global_variable($sitedir) - global_variable($sitedir) operator(=) constant(File)operator(.)ident(join)operator(()global_variable($libdir)operator(,) stringoperator(\)) - reserved(elsif) global_variable($sitedir) operator(!)operator(~) constant(Regexp)operator(.)ident(quote)operator(()ident(version)operator(\)) - global_variable($sitedir) operator(=) constant(File)operator(.)ident(join)operator(()global_variable($sitedir)operator(,) ident(version)operator(\)) - reserved(end) -reserved(end) - -comment(# the acual gruntwork) -constant(Dir)operator(.)ident(chdir)operator(()stringoperator(\)) - -constant(Find)operator(.)ident(find)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) operator({) operator(|)ident(f)operator(|) - reserved(if) ident(f)operator([)integer(-3)operator(..)integer(-1)operator(]) operator(==) string - constant(File)operator(::)ident(install)operator(()ident(f)operator(,) constant(File)operator(.)ident(join)operator(()global_variable($sitedir)operator(,) operator(*)ident(f)operator(.)ident(split)operator(()regexpoperator(\))operator(\))operator(,) integer(0644)operator(,) pre_constant(true)operator(\)) - reserved(else) - constant(File)operator(::)ident(makedirs)operator(()constant(File)operator(.)ident(join)operator(()global_variable($sitedir)operator(,) operator(*)ident(f)operator(.)ident(split)operator(()regexpoperator(\))operator(\))operator(\)) - reserved(end) -operator(})ident(require) string -ident(require) string -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(Test) comment(#:nodoc:) - reserved(module) class(Unit) comment(#:nodoc:) - comment(# In addition to these specific assertions, you also have easy access to various collections that the regular test/unit assertions) - comment(# can be used against. These collections are:) - comment(#) - comment(# * assigns: Instance variables assigned in the action that are available for the view.) - comment(# * session: Objects being saved in the session.) - comment(# * flash: The flash objects currently in the session.) - comment(# * cookies: Cookies being sent to the user on this request.) - comment(# ) - comment(# These collections can be used just like any other hash:) - comment(#) - comment(# assert_not_nil assigns(:person\) # makes sure that a @person instance variable was set) - comment(# assert_equal "Dave", cookies[:name] # makes sure that a cookie called :name was set as "Dave") - comment(# assert flash.empty? # makes sure that there's nothing in the flash) - comment(#) - comment(# For historic reasons, the assigns hash uses string-based keys. So assigns[:person] won't work, but assigns["person"] will. To) - comment(# appease our yearning for symbols, though, an alternative accessor has been deviced using a method call instead of index referencing.) - comment(# So assigns(:person\) will work just like assigns["person"], but again, assigns[:person] will not work.) - comment(#) - comment(# On top of the collections, you have the complete url that a given action redirected to available in redirect_to_url.) - comment(#) - comment(# For redirects within the same controller, you can even call follow_redirect and the redirect will be followed, triggering another) - comment(# action call which can then be asserted against.) - comment(#) - comment(# == Manipulating the request collections) - comment(#) - comment(# The collections described above link to the response, so you can test if what the actions were expected to do happened. But) - comment(# sometimes you also want to manipulate these collections in the incoming request. This is really only relevant for sessions) - comment(# and cookies, though. For sessions, you just do:) - comment(#) - comment(# @request.session[:key] = "value") - comment(#) - comment(# For cookies, you need to manually create the cookie, like this:) - comment(#) - comment(# @request.cookies["key"] = CGI::Cookie.new("key", "value"\)) - comment(#) - comment(# == Testing named routes) - comment(#) - comment(# If you're using named routes, they can be easily tested using the original named routes methods straight in the test case.) - comment(# Example: ) - comment(#) - comment(# assert_redirected_to page_url(:title => 'foo'\)) - reserved(module) class(Assertions) - comment(# Asserts that the response is one of the following types:) - comment(# ) - comment(# * :success: Status code was 200) - comment(# * :redirect: Status code was in the 300-399 range) - comment(# * :missing: Status code was 404) - comment(# * :error: Status code was in the 500-599 range) - comment(#) - comment(# You can also pass an explicit status code number as the type, like assert_response(501\)) - reserved(def) method(assert_response)operator(()ident(type)operator(,) ident(message) operator(=) pre_constant(nil)operator(\)) - ident(clean_backtrace) reserved(do) - reserved(if) operator([) symbol(:success)operator(,) symbol(:missing)operator(,) symbol(:redirect)operator(,) symbol(:error) operator(])operator(.)ident(include?)operator(()ident(type)operator(\)) operator(&&) instance_variable(@response)operator(.)ident(send)operator(()stringcontent(?)delimiter(")>operator(\)) - ident(assert_block)operator(()stringoperator(\)) operator({) pre_constant(true) operator(}) comment(# to count the assertion) - reserved(elsif) ident(type)operator(.)ident(is_a?)operator(()constant(Fixnum)operator(\)) operator(&&) instance_variable(@response)operator(.)ident(response_code) operator(==) ident(type) - ident(assert_block)operator(()stringoperator(\)) operator({) pre_constant(true) operator(}) comment(# to count the assertion) - reserved(else) - ident(assert_block)operator(()ident(build_message)operator(()ident(message)operator(,) string, but was )delimiter(")>operator(,) ident(type)operator(,) instance_variable(@response)operator(.)ident(response_code)operator(\))operator(\)) operator({) pre_constant(false) operator(}) - reserved(end) - reserved(end) - reserved(end) - - comment(# Assert that the redirection options passed in match those of the redirect called in the latest action. This match can be partial,) - comment(# such that assert_redirected_to(:controller => "weblog"\) will also match the redirection of ) - comment(# redirect_to(:controller => "weblog", :action => "show"\) and so on.) - reserved(def) method(assert_redirected_to)operator(()ident(options) operator(=) operator({)operator(})operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) - ident(clean_backtrace) reserved(do) - ident(assert_response)operator(()symbol(:redirect)operator(,) ident(message)operator(\)) - - reserved(if) ident(options)operator(.)ident(is_a?)operator(()constant(String)operator(\)) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string, found one to )delimiter(")>operator(,) ident(options)operator(,) instance_variable(@response)operator(.)ident(redirect_url)operator(\)) - ident(url_regexp) operator(=) regexp - ident(eurl)operator(,) ident(epath)operator(,) ident(url)operator(,) ident(path) operator(=) operator([)ident(options)operator(,) instance_variable(@response)operator(.)ident(redirect_url)operator(])operator(.)ident(collect) reserved(do) operator(|)ident(url)operator(|) - ident(u)operator(,) ident(p) operator(=) operator(()ident(url_regexp) operator(=)operator(~) ident(url)operator(\)) operator(?) operator([)global_variable($1)operator(,) global_variable($3)operator(]) operator(:) operator([)pre_constant(nil)operator(,) ident(url)operator(]) - operator([)ident(u)operator(,) operator(()ident(p)operator([)integer(0)operator(..)integer(0)operator(]) operator(==) stringoperator(\)) operator(?) ident(p) operator(:) string operator(+) ident(p)operator(]) - reserved(end)operator(.)ident(flatten) - - ident(assert_equal)operator(()ident(eurl)operator(,) ident(url)operator(,) ident(msg)operator(\)) reserved(if) ident(eurl) operator(&&) ident(url) - ident(assert_equal)operator(()ident(epath)operator(,) ident(path)operator(,) ident(msg)operator(\)) reserved(if) ident(epath) operator(&&) ident(path) - reserved(else) - instance_variable(@response_diff) operator(=) ident(options)operator(.)ident(diff)operator(()instance_variable(@response)operator(.)ident(redirected_to)operator(\)) reserved(if) ident(options)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(&&) instance_variable(@response)operator(.)ident(redirected_to)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string\))inline)delimiter(')> reserved(if) instance_variable(@response_diff)inline_delimiter(})>delimiter(")>operator(,) - instance_variable(@response)operator(.)ident(redirected_to) operator(||) instance_variable(@response)operator(.)ident(redirect_url)operator(,) instance_variable(@response_diff)operator(\)) - - ident(assert_block)operator(()ident(msg)operator(\)) reserved(do) - reserved(if) ident(options)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - instance_variable(@response)operator(.)ident(redirected_to) operator(==) ident(options) - reserved(else) - ident(options)operator(.)ident(keys)operator(.)ident(all?) reserved(do) operator(|)ident(k)operator(|) - reserved(if) ident(k) operator(==) symbol(:controller) reserved(then) ident(options)operator([)ident(k)operator(]) operator(==) constant(ActionController)operator(::)constant(Routing)operator(.)ident(controller_relative_to)operator(()instance_variable(@response)operator(.)ident(redirected_to)operator([)ident(k)operator(])operator(,) instance_variable(@controller)operator(.)ident(class)operator(.)ident(controller_path)operator(\)) - reserved(else) ident(options)operator([)ident(k)operator(]) operator(==) operator(()instance_variable(@response)operator(.)ident(redirected_to)operator([)ident(k)operator(])operator(.)ident(respond_to?)operator(()symbol(:to_param)operator(\)) operator(?) instance_variable(@response)operator(.)ident(redirected_to)operator([)ident(k)operator(])operator(.)ident(to_param) operator(:) instance_variable(@response)operator(.)ident(redirected_to)operator([)ident(k)operator(]) reserved(unless) instance_variable(@response)operator(.)ident(redirected_to)operator([)ident(k)operator(])operator(.)ident(nil?)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# Asserts that the request was rendered with the appropriate template file.) - reserved(def) method(assert_template)operator(()ident(expected) operator(=) pre_constant(nil)operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) - ident(clean_backtrace) reserved(do) - ident(rendered) operator(=) ident(expected) operator(?) instance_variable(@response)operator(.)ident(rendered_file)operator(()operator(!)ident(expected)operator(.)ident(include?)operator(()stringoperator(\))operator(\)) operator(:) instance_variable(@response)operator(.)ident(rendered_file) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string but rendering with )delimiter(")>operator(,) ident(expected)operator(,) ident(rendered)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) reserved(do) - reserved(if) ident(expected)operator(.)ident(nil?) - operator(!)instance_variable(@response)operator(.)ident(rendered_with_file?) - reserved(else) - ident(expected) operator(==) ident(rendered) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# Asserts that the routing of the given path was handled correctly and that the parsed options match.) - reserved(def) method(assert_recognizes)operator(()ident(expected_options)operator(,) ident(path)operator(,) ident(extras)operator(=)operator({)operator(})operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) - ident(clean_backtrace) reserved(do) - ident(path) operator(=) stringdelimiter(")> reserved(unless) ident(path)operator([)integer(0)operator(..)integer(0)operator(]) operator(==) string - comment(# Load routes.rb if it hasn't been loaded.) - constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(reload) reserved(if) constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(empty?) - - comment(# Assume given controller) - ident(request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new)operator(()operator({)operator(})operator(,) operator({)operator(})operator(,) pre_constant(nil)operator(\)) - ident(request)operator(.)ident(path) operator(=) ident(path) - constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(recognize!)operator(()ident(request)operator(\)) - - ident(expected_options) operator(=) ident(expected_options)operator(.)ident(clone) - ident(extras)operator(.)ident(each_key) operator({) operator(|)ident(key)operator(|) ident(expected_options)operator(.)ident(delete) ident(key) operator(}) reserved(unless) ident(extras)operator(.)ident(nil?) - - ident(expected_options)operator(.)ident(stringify_keys!) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string did not match )delimiter(")>operator(,) - ident(request)operator(.)ident(path_parameters)operator(,) ident(expected_options)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(request)operator(.)ident(path_parameters) operator(==) ident(expected_options) operator(}) - reserved(end) - reserved(end) - - comment(# Asserts that the provided options can be used to generate the provided path.) - reserved(def) method(assert_generates)operator(()ident(expected_path)operator(,) ident(options)operator(,) ident(defaults)operator(=)operator({)operator(})operator(,) ident(extras) operator(=) operator({)operator(})operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) - ident(clean_backtrace) reserved(do) - ident(expected_path) operator(=) stringdelimiter(")> reserved(unless) ident(expected_path)operator([)integer(0)operator(]) operator(==) integer(?/) - comment(# Load routes.rb if it hasn't been loaded.) - constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(reload) reserved(if) constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(empty?) - - ident(generated_path)operator(,) ident(extra_keys) operator(=) constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(generate)operator(()ident(options)operator(,) ident(extras)operator(\)) - ident(found_extras) operator(=) ident(options)operator(.)ident(reject) operator({)operator(|)ident(k)operator(,) ident(v)operator(|) operator(!) ident(extra_keys)operator(.)ident(include?) ident(k)operator(}) - - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string, not )delimiter(")>operator(,) ident(found_extras)operator(,) ident(extras)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(found_extras) operator(==) ident(extras) operator(}) - - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string did not match )delimiter(")>operator(,) ident(generated_path)operator(,) - ident(expected_path)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(expected_path) operator(==) ident(generated_path) operator(}) - reserved(end) - reserved(end) - - comment(# Asserts that path and options match both ways; in other words, the URL generated from ) - comment(# options is the same as path, and also that the options recognized from path are the same as options) - reserved(def) method(assert_routing)operator(()ident(path)operator(,) ident(options)operator(,) ident(defaults)operator(=)operator({)operator(})operator(,) ident(extras)operator(=)operator({)operator(})operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) - ident(assert_recognizes)operator(()ident(options)operator(,) ident(path)operator(,) ident(extras)operator(,) ident(message)operator(\)) - - ident(controller)operator(,) ident(default_controller) operator(=) ident(options)operator([)symbol(:controller)operator(])operator(,) ident(defaults)operator([)symbol(:controller)operator(]) - reserved(if) ident(controller) operator(&&) ident(controller)operator(.)ident(include?)operator(()integer(?/)operator(\)) operator(&&) ident(default_controller) operator(&&) ident(default_controller)operator(.)ident(include?)operator(()integer(?/)operator(\)) - ident(options)operator([)symbol(:controller)operator(]) operator(=) stringdelimiter(")> - reserved(end) - - ident(assert_generates)operator(()ident(path)operator(,) ident(options)operator(,) ident(defaults)operator(,) ident(extras)operator(,) ident(message)operator(\)) - reserved(end) - - comment(# Asserts that there is a tag/node/element in the body of the response) - comment(# that meets all of the given conditions. The +conditions+ parameter must) - comment(# be a hash of any of the following keys (all are optional\):) - comment(#) - comment(# * :tag: the node type must match the corresponding value) - comment(# * :attributes: a hash. The node's attributes must match the) - comment(# corresponding values in the hash.) - comment(# * :parent: a hash. The node's parent must match the) - comment(# corresponding hash.) - comment(# * :child: a hash. At least one of the node's immediate children) - comment(# must meet the criteria described by the hash.) - comment(# * :ancestor: a hash. At least one of the node's ancestors must) - comment(# meet the criteria described by the hash.) - comment(# * :descendant: a hash. At least one of the node's descendants) - comment(# must meet the criteria described by the hash.) - comment(# * :sibling: a hash. At least one of the node's siblings must) - comment(# meet the criteria described by the hash.) - comment(# * :after: a hash. The node must be after any sibling meeting) - comment(# the criteria described by the hash, and at least one sibling must match.) - comment(# * :before: a hash. The node must be before any sibling meeting) - comment(# the criteria described by the hash, and at least one sibling must match.) - comment(# * :children: a hash, for counting children of a node. Accepts) - comment(# the keys:) - comment(# * :count: either a number or a range which must equal (or) - comment(# include\) the number of children that match.) - comment(# * :less_than: the number of matching children must be less) - comment(# than this number.) - comment(# * :greater_than: the number of matching children must be) - comment(# greater than this number.) - comment(# * :only: another hash consisting of the keys to use) - comment(# to match on the children, and only matching children will be) - comment(# counted.) - comment(# * :content: the textual content of the node must match the) - comment(# given value. This will not match HTML tags in the body of a) - comment(# tag--only text.) - comment(#) - comment(# Conditions are matched using the following algorithm:) - comment(#) - comment(# * if the condition is a string, it must be a substring of the value.) - comment(# * if the condition is a regexp, it must match the value.) - comment(# * if the condition is a number, the value must match number.to_s.) - comment(# * if the condition is +true+, the value must not be +nil+.) - comment(# * if the condition is +false+ or +nil+, the value must be +nil+.) - comment(#) - comment(# Usage:) - comment(#) - comment(# # assert that there is a "span" tag) - comment(# assert_tag :tag => "span") - comment(#) - comment(# # assert that there is a "span" tag with id="x") - comment(# assert_tag :tag => "span", :attributes => { :id => "x" }) - comment(#) - comment(# # assert that there is a "span" tag using the short-hand) - comment(# assert_tag :span) - comment(#) - comment(# # assert that there is a "span" tag with id="x" using the short-hand) - comment(# assert_tag :span, :attributes => { :id => "x" }) - comment(#) - comment(# # assert that there is a "span" inside of a "div") - comment(# assert_tag :tag => "span", :parent => { :tag => "div" }) - comment(#) - comment(# # assert that there is a "span" somewhere inside a table) - comment(# assert_tag :tag => "span", :ancestor => { :tag => "table" }) - comment(#) - comment(# # assert that there is a "span" with at least one "em" child) - comment(# assert_tag :tag => "span", :child => { :tag => "em" }) - comment(#) - comment(# # assert that there is a "span" containing a (possibly nested\)) - comment(# # "strong" tag.) - comment(# assert_tag :tag => "span", :descendant => { :tag => "strong" }) - comment(#) - comment(# # assert that there is a "span" containing between 2 and 4 "em" tags) - comment(# # as immediate children) - comment(# assert_tag :tag => "span",) - comment(# :children => { :count => 2..4, :only => { :tag => "em" } } ) - comment(#) - comment(# # get funky: assert that there is a "div", with an "ul" ancestor) - comment(# # and an "li" parent (with "class" = "enum"\), and containing a ) - comment(# # "span" descendant that contains text matching /hello world/) - comment(# assert_tag :tag => "div",) - comment(# :ancestor => { :tag => "ul" },) - comment(# :parent => { :tag => "li",) - comment(# :attributes => { :class => "enum" } },) - comment(# :descendant => { :tag => "span",) - comment(# :child => /hello world/ }) - comment(#) - comment(# Please noteYou must explicitly) - comment(# close all of your tags to use these assertions.) - reserved(def) method(assert_tag)operator(()operator(*)ident(opts)operator(\)) - ident(clean_backtrace) reserved(do) - ident(opts) operator(=) ident(opts)operator(.)ident(size) operator(>) integer(1) operator(?) ident(opts)operator(.)ident(last)operator(.)ident(merge)operator(()operator({) symbol(:tag) operator(=)operator(>) ident(opts)operator(.)ident(first)operator(.)ident(to_s) operator(})operator(\)) operator(:) ident(opts)operator(.)ident(first) - ident(tag) operator(=) ident(find_tag)operator(()ident(opts)operator(\)) - ident(assert) ident(tag)operator(,) stringcontent( in:)char(\\n)inlinedelimiter(")> - reserved(end) - reserved(end) - - comment(# Identical to #assert_tag, but asserts that a matching tag does _not_) - comment(# exist. (See #assert_tag for a full discussion of the syntax.\)) - reserved(def) method(assert_no_tag)operator(()operator(*)ident(opts)operator(\)) - ident(clean_backtrace) reserved(do) - ident(opts) operator(=) ident(opts)operator(.)ident(size) operator(>) integer(1) operator(?) ident(opts)operator(.)ident(last)operator(.)ident(merge)operator(()operator({) symbol(:tag) operator(=)operator(>) ident(opts)operator(.)ident(first)operator(.)ident(to_s) operator(})operator(\)) operator(:) ident(opts)operator(.)ident(first) - ident(tag) operator(=) ident(find_tag)operator(()ident(opts)operator(\)) - ident(assert) operator(!)ident(tag)operator(,) stringcontent( in:)char(\\n)inlinedelimiter(")> - reserved(end) - reserved(end) - - comment(# test 2 html strings to be equivalent, i.e. identical up to reordering of attributes) - reserved(def) method(assert_dom_equal)operator(()ident(expected)operator(,) ident(actual)operator(,) ident(message)operator(=)stringoperator(\)) - ident(clean_backtrace) reserved(do) - ident(expected_dom) operator(=) constant(HTML)operator(::)constant(Document)operator(.)ident(new)operator(()ident(expected)operator(\))operator(.)ident(root) - ident(actual_dom) operator(=) constant(HTML)operator(::)constant(Document)operator(.)ident(new)operator(()ident(actual)operator(\))operator(.)ident(root) - ident(full_message) operator(=) ident(build_message)operator(()ident(message)operator(,) string expected to be == to)char(\\n)content(.)delimiter(")>operator(,) ident(expected_dom)operator(.)ident(to_s)operator(,) ident(actual_dom)operator(.)ident(to_s)operator(\)) - ident(assert_block)operator(()ident(full_message)operator(\)) operator({) ident(expected_dom) operator(==) ident(actual_dom) operator(}) - reserved(end) - reserved(end) - - comment(# negated form of +assert_dom_equivalent+) - reserved(def) method(assert_dom_not_equal)operator(()ident(expected)operator(,) ident(actual)operator(,) ident(message)operator(=)stringoperator(\)) - ident(clean_backtrace) reserved(do) - ident(expected_dom) operator(=) constant(HTML)operator(::)constant(Document)operator(.)ident(new)operator(()ident(expected)operator(\))operator(.)ident(root) - ident(actual_dom) operator(=) constant(HTML)operator(::)constant(Document)operator(.)ident(new)operator(()ident(actual)operator(\))operator(.)ident(root) - ident(full_message) operator(=) ident(build_message)operator(()ident(message)operator(,) string expected to be != to)char(\\n)content(.)delimiter(")>operator(,) ident(expected_dom)operator(.)ident(to_s)operator(,) ident(actual_dom)operator(.)ident(to_s)operator(\)) - ident(assert_block)operator(()ident(full_message)operator(\)) operator({) ident(expected_dom) operator(!=) ident(actual_dom) operator(}) - reserved(end) - reserved(end) - - comment(# ensures that the passed record is valid by active record standards. returns the error messages if not) - reserved(def) method(assert_valid)operator(()ident(record)operator(\)) - ident(clean_backtrace) reserved(do) - ident(assert) ident(record)operator(.)ident(valid?)operator(,) ident(record)operator(.)ident(errors)operator(.)ident(full_messages)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(clean_backtrace)operator(()operator(&)ident(block)operator(\)) - reserved(yield) - reserved(rescue) constant(AssertionFailedError) operator(=)operator(>) ident(e) - ident(path) operator(=) constant(File)operator(.)ident(expand_path)operator(()pre_constant(__FILE__)operator(\)) - ident(raise) constant(AssertionFailedError)operator(,) ident(e)operator(.)ident(message)operator(,) ident(e)operator(.)ident(backtrace)operator(.)ident(reject) operator({) operator(|)ident(line)operator(|) constant(File)operator(.)ident(expand_path)operator(()ident(line)operator(\)) operator(=)operator(~) regexpdelimiter(/)> operator(}) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActionController) comment(#:nodoc:) - reserved(class) class(ActionControllerError) operator(<) constant(StandardError) comment(#:nodoc:) - reserved(end) - reserved(class) class(SessionRestoreError) operator(<) constant(ActionControllerError) comment(#:nodoc:) - reserved(end) - reserved(class) class(MissingTemplate) operator(<) constant(ActionControllerError) comment(#:nodoc:) - reserved(end) - reserved(class) class(RoutingError) operator(<) constant(ActionControllerError) comment(#:nodoc:) - ident(attr_reader) symbol(:failures) - reserved(def) method(initialize)operator(()ident(message)operator(,) ident(failures)operator(=)operator([)operator(])operator(\)) - reserved(super)operator(()ident(message)operator(\)) - instance_variable(@failures) operator(=) ident(failures) - reserved(end) - reserved(end) - reserved(class) class(UnknownController) operator(<) constant(ActionControllerError) comment(#:nodoc:) - reserved(end) - reserved(class) class(UnknownAction) operator(<) constant(ActionControllerError) comment(#:nodoc:) - reserved(end) - reserved(class) class(MissingFile) operator(<) constant(ActionControllerError) comment(#:nodoc:) - reserved(end) - reserved(class) class(SessionOverflowError) operator(<) constant(ActionControllerError) comment(#:nodoc:) - constant(DEFAULT_MESSAGE) operator(=) string - - reserved(def) method(initialize)operator(()ident(message) operator(=) pre_constant(nil)operator(\)) - reserved(super)operator(()ident(message) operator(||) constant(DEFAULT_MESSAGE)operator(\)) - reserved(end) - reserved(end) - reserved(class) class(DoubleRenderError) operator(<) constant(ActionControllerError) comment(#:nodoc:) - constant(DEFAULT_MESSAGE) operator(=) string - - reserved(def) method(initialize)operator(()ident(message) operator(=) pre_constant(nil)operator(\)) - reserved(super)operator(()ident(message) operator(||) constant(DEFAULT_MESSAGE)operator(\)) - reserved(end) - reserved(end) - reserved(class) class(RedirectBackError) operator(<) constant(ActionControllerError) comment(#:nodoc:) - constant(DEFAULT_MESSAGE) operator(=) string - - reserved(def) method(initialize)operator(()ident(message) operator(=) pre_constant(nil)operator(\)) - reserved(super)operator(()ident(message) operator(||) constant(DEFAULT_MESSAGE)operator(\)) - reserved(end) - reserved(end) - - comment(# Action Controllers are the core of a web request in Rails. They are made up of one or more actions that are executed ) - comment(# on request and then either render a template or redirect to another action. An action is defined as a public method) - comment(# on the controller, which will automatically be made accessible to the web-server through Rails Routes. ) - comment(#) - comment(# A sample controller could look like this:) - comment(#) - comment(# class GuestBookController < ActionController::Base) - comment(# def index) - comment(# @entries = Entry.find(:all\)) - comment(# end) - comment(# ) - comment(# def sign) - comment(# Entry.create(params[:entry]\)) - comment(# redirect_to :action => "index") - comment(# end) - comment(# end) - comment(#) - comment(# Actions, by default, render a template in the app/views directory corresponding to the name of the controller and action) - comment(# after executing code in the action. For example, the +index+ action of the +GuestBookController+ would render the ) - comment(# template app/views/guestbook/index.rhtml by default after populating the @entries instance variable.) - comment(#) - comment(# Unlike index, the sign action will not render a template. After performing its main purpose (creating a ) - comment(# new entry in the guest book\), it initiates a redirect instead. This redirect works by returning an external ) - comment(# "302 Moved" HTTP response that takes the user to the index action.) - comment(#) - comment(# The index and sign represent the two basic action archetypes used in Action Controllers. Get-and-show and do-and-redirect.) - comment(# Most actions are variations of these themes.) - comment(#) - comment(# == Requests) - comment(#) - comment(# Requests are processed by the Action Controller framework by extracting the value of the "action" key in the request parameters.) - comment(# This value should hold the name of the action to be performed. Once the action has been identified, the remaining) - comment(# request parameters, the session (if one is available\), and the full request with all the http headers are made available to) - comment(# the action through instance variables. Then the action is performed.) - comment(#) - comment(# The full request object is available with the request accessor and is primarily used to query for http headers. These queries) - comment(# are made by accessing the environment hash, like this:) - comment(#) - comment(# def server_ip) - comment(# location = request.env["SERVER_ADDR"]) - comment(# render :text => "This server hosted at #{location}") - comment(# end) - comment(#) - comment(# == Parameters) - comment(#) - comment(# All request parameters, whether they come from a GET or POST request, or from the URL, are available through the params method) - comment(# which returns a hash. For example, an action that was performed through /weblog/list?category=All&limit=5 will include ) - comment(# { "category" => "All", "limit" => 5 } in params.) - comment(#) - comment(# It's also possible to construct multi-dimensional parameter hashes by specifying keys using brackets, such as:) - comment(#) - comment(# ) - comment(# ) - comment(#) - comment(# A request stemming from a form holding these inputs will include { "post" => { "name" => "david", "address" => "hyacintvej" } }.) - comment(# If the address input had been named "post[address][street]", the params would have included ) - comment(# { "post" => { "address" => { "street" => "hyacintvej" } } }. There's no limit to the depth of the nesting.) - comment(#) - comment(# == Sessions) - comment(#) - comment(# Sessions allows you to store objects in between requests. This is useful for objects that are not yet ready to be persisted,) - comment(# such as a Signup object constructed in a multi-paged process, or objects that don't change much and are needed all the time, such) - comment(# as a User object for a system that requires login. The session should not be used, however, as a cache for objects where it's likely ) - comment(# they could be changed unknowingly. It's usually too much work to keep it all synchronized -- something databases already excel at.) - comment(#) - comment(# You can place objects in the session by using the session method, which accesses a hash:) - comment(#) - comment(# session[:person] = Person.authenticate(user_name, password\)) - comment(#) - comment(# And retrieved again through the same hash:) - comment(#) - comment(# Hello #{session[:person]}) - comment(#) - comment(# For removing objects from the session, you can either assign a single key to nil, like session[:person] = nil, or you can) - comment(# remove the entire session with reset_session.) - comment(#) - comment(# By default, sessions are stored on the file system in RAILS_ROOT/tmp/sessions. Any object can be placed in the session ) - comment(# (as long as it can be Marshalled\). But remember that 1000 active sessions each storing a 50kb object could lead to a 50MB store on the filesystem.) - comment(# In other words, think carefully about size and caching before resorting to the use of the session on the filesystem.) - comment(#) - comment(# An alternative to storing sessions on disk is to use ActiveRecordStore to store sessions in your database, which can solve problems) - comment(# caused by storing sessions in the file system and may speed up your application. To use ActiveRecordStore, uncomment the line:) - comment(# ) - comment(# config.action_controller.session_store = :active_record_store) - comment(#) - comment(# in your environment.rb and run rake db:sessions:create.) - comment(#) - comment(# == Responses) - comment(#) - comment(# Each action results in a response, which holds the headers and document to be sent to the user's browser. The actual response) - comment(# object is generated automatically through the use of renders and redirects and requires no user intervention.) - comment(#) - comment(# == Renders) - comment(#) - comment(# Action Controller sends content to the user by using one of five rendering methods. The most versatile and common is the rendering) - comment(# of a template. Included in the Action Pack is the Action View, which enables rendering of ERb templates. It's automatically configured.) - comment(# The controller passes objects to the view by assigning instance variables:) - comment(#) - comment(# def show) - comment(# @post = Post.find(params[:id]\)) - comment(# end) - comment(#) - comment(# Which are then automatically available to the view:) - comment(#) - comment(# Title: <%= @post.title %>) - comment(#) - comment(# You don't have to rely on the automated rendering. Especially actions that could result in the rendering of different templates will use) - comment(# the manual rendering methods:) - comment(#) - comment(# def search) - comment(# @results = Search.find(params[:query]\)) - comment(# case @results) - comment(# when 0 then render :action => "no_results") - comment(# when 1 then render :action => "show") - comment(# when 2..10 then render :action => "show_many") - comment(# end) - comment(# end) - comment(#) - comment(# Read more about writing ERb and Builder templates in link:classes/ActionView/Base.html.) - comment(#) - comment(# == Redirects) - comment(#) - comment(# Redirects are used to move from one action to another. For example, after a create action, which stores a blog entry to a database,) - comment(# we might like to show the user the new entry. Because we're following good DRY principles (Don't Repeat Yourself\), we're going to reuse (and redirect to\)) - comment(# a show action that we'll assume has already been created. The code might look like this:) - comment(#) - comment(# def create) - comment(# @entry = Entry.new(params[:entry]\)) - comment(# if @entry.save) - comment(# # The entry was saved correctly, redirect to show) - comment(# redirect_to :action => 'show', :id => @entry.id) - comment(# else) - comment(# # things didn't go so well, do something else) - comment(# end) - comment(# end) - comment(#) - comment(# In this case, after saving our new entry to the database, the user is redirected to the show method which is then executed.) - comment(#) - comment(# == Calling multiple redirects or renders) - comment(#) - comment(# An action should conclude with a single render or redirect. Attempting to try to do either again will result in a DoubleRenderError:) - comment(#) - comment(# def do_something) - comment(# redirect_to :action => "elsewhere") - comment(# render :action => "overthere" # raises DoubleRenderError) - comment(# end) - comment(#) - comment(# If you need to redirect on the condition of something, then be sure to add "and return" to halt execution.) - comment(#) - comment(# def do_something) - comment(# redirect_to(:action => "elsewhere"\) and return if monkeys.nil?) - comment(# render :action => "overthere" # won't be called unless monkeys is nil) - comment(# end) - comment(#) - reserved(class) class(Base) - constant(DEFAULT_RENDER_STATUS_CODE) operator(=) string - - ident(include) constant(Reloadable)operator(::)constant(Subclasses) - - comment(# Determines whether the view has access to controller internals @request, @response, @session, and @template.) - comment(# By default, it does.) - class_variable(@@view_controller_internals) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:view_controller_internals) - - comment(# Protected instance variable cache) - class_variable(@@protected_variables_cache) operator(=) pre_constant(nil) - ident(cattr_accessor) symbol(:protected_variables_cache) - - comment(# Prepends all the URL-generating helpers from AssetHelper. This makes it possible to easily move javascripts, stylesheets, ) - comment(# and images to a dedicated asset server away from the main web server. Example: ) - comment(# ActionController::Base.asset_host = "http://assets.example.com") - class_variable(@@asset_host) operator(=) string - ident(cattr_accessor) symbol(:asset_host) - - comment(# All requests are considered local by default, so everyone will be exposed to detailed debugging screens on errors.) - comment(# When the application is ready to go public, this should be set to false, and the protected method local_request?) - comment(# should instead be implemented in the controller to determine when debugging screens should be shown.) - class_variable(@@consider_all_requests_local) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:consider_all_requests_local) - - comment(# Enable or disable the collection of failure information for RoutingErrors.) - comment(# This information can be extremely useful when tweaking custom routes, but is) - comment(# pointless once routes have been tested and verified.) - class_variable(@@debug_routes) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:debug_routes) - - comment(# Controls whether the application is thread-safe, so multi-threaded servers like WEBrick know whether to apply a mutex) - comment(# around the performance of each action. Action Pack and Active Record are by default thread-safe, but many applications) - comment(# may not be. Turned off by default.) - class_variable(@@allow_concurrency) operator(=) pre_constant(false) - ident(cattr_accessor) symbol(:allow_concurrency) - - comment(# Modern REST web services often need to submit complex data to the web application. ) - comment(# The param_parsers hash lets you register handlers wich will process the http body and add parameters to the ) - comment(# params hash. These handlers are invoked for post and put requests.) - comment(#) - comment(# By default application/xml is enabled. A XmlSimple class with the same param name as the root will be instanciated ) - comment(# in the params. This allows XML requests to mask themselves as regular form submissions, so you can have one) - comment(# action serve both regular forms and web service requests.) - comment(# ) - comment(# Example of doing your own parser for a custom content type:) - comment(#) - comment(# ActionController::Base.param_parsers[Mime::Type.lookup('application/atom+xml'\)] = Proc.new do |data| ) - comment(# node = REXML::Document.new(post\) ) - comment(# { node.root.name => node.root }) - comment(# end) - comment(#) - comment(# Note: Up until release 1.1 of Rails, Action Controller would default to using XmlSimple configured to discard the ) - comment(# root node for such requests. The new default is to keep the root, such that "David" results) - comment(# in params[:r][:name] for "David" instead of params[:name]. To get the old behavior, you can ) - comment(# re-register XmlSimple as application/xml handler ike this:) - comment(#) - comment(# ActionController::Base.param_parsers[Mime::XML] = ) - comment(# Proc.new { |data| XmlSimple.xml_in(data, 'ForceArray' => false\) }) - comment(#) - comment(# A YAML parser is also available and can be turned on with:) - comment(#) - comment(# ActionController::Base.param_parsers[Mime::YAML] = :yaml) - class_variable(@@param_parsers) operator(=) operator({) constant(Mime)operator(::)constant(XML) operator(=)operator(>) symbol(:xml_simple) operator(}) - ident(cattr_accessor) symbol(:param_parsers) - - comment(# Template root determines the base from which template references will be made. So a call to render("test/template"\)) - comment(# will be converted to "#{template_root}/test/template.rhtml".) - ident(class_inheritable_accessor) symbol(:template_root) - - comment(# The logger is used for generating information on the action run-time (including benchmarking\) if available.) - comment(# Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers.) - ident(cattr_accessor) symbol(:logger) - - comment(# Determines which template class should be used by ActionController.) - ident(cattr_accessor) symbol(:template_class) - - comment(# Turn on +ignore_missing_templates+ if you want to unit test actions without making the associated templates.) - ident(cattr_accessor) symbol(:ignore_missing_templates) - - comment(# Holds the request object that's primarily used to get environment variables through access like) - comment(# request.env["REQUEST_URI"].) - ident(attr_accessor) symbol(:request) - - comment(# Holds a hash of all the GET, POST, and Url parameters passed to the action. Accessed like params["post_id"]) - comment(# to get the post_id. No type casts are made, so all values are returned as strings.) - ident(attr_accessor) symbol(:params) - - comment(# Holds the response object that's primarily used to set additional HTTP headers through access like ) - comment(# response.headers["Cache-Control"] = "no-cache". Can also be used to access the final body HTML after a template) - comment(# has been rendered through response.body -- useful for after_filters that wants to manipulate the output,) - comment(# such as a OutputCompressionFilter.) - ident(attr_accessor) symbol(:response) - - comment(# Holds a hash of objects in the session. Accessed like session[:person] to get the object tied to the "person") - comment(# key. The session will hold any type of object as values, but the key should be a string or symbol.) - ident(attr_accessor) symbol(:session) - - comment(# Holds a hash of header names and values. Accessed like headers["Cache-Control"] to get the value of the Cache-Control) - comment(# directive. Values should always be specified as strings.) - ident(attr_accessor) symbol(:headers) - - comment(# Holds the hash of variables that are passed on to the template class to be made available to the view. This hash) - comment(# is generated by taking a snapshot of all the instance variables in the current scope just before a template is rendered.) - ident(attr_accessor) symbol(:assigns) - - comment(# Returns the name of the action this controller is processing.) - ident(attr_accessor) symbol(:action_name) - - reserved(class) operator(<<) class(self) - comment(# Factory for the standard create, process loop where the controller is discarded after processing.) - reserved(def) method(process)operator(()ident(request)operator(,) ident(response)operator(\)) comment(#:nodoc:) - ident(new)operator(.)ident(process)operator(()ident(request)operator(,) ident(response)operator(\)) - reserved(end) - - comment(# Converts the class name from something like "OneModule::TwoModule::NeatController" to "NeatController".) - reserved(def) method(controller_class_name) - instance_variable(@controller_class_name) operator(||=) ident(name)operator(.)ident(demodulize) - reserved(end) - - comment(# Converts the class name from something like "OneModule::TwoModule::NeatController" to "neat".) - reserved(def) method(controller_name) - instance_variable(@controller_name) operator(||=) ident(controller_class_name)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(underscore) - reserved(end) - - comment(# Converts the class name from something like "OneModule::TwoModule::NeatController" to "one_module/two_module/neat".) - reserved(def) method(controller_path) - instance_variable(@controller_path) operator(||=) ident(name)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(underscore) - reserved(end) - - comment(# Return an array containing the names of public methods that have been marked hidden from the action processor.) - comment(# By default, all methods defined in ActionController::Base and included modules are hidden.) - comment(# More methods can be hidden using hide_actions.) - reserved(def) method(hidden_actions) - ident(write_inheritable_attribute)operator(()symbol(:hidden_actions)operator(,) constant(ActionController)operator(::)constant(Base)operator(.)ident(public_instance_methods)operator(\)) reserved(unless) ident(read_inheritable_attribute)operator(()symbol(:hidden_actions)operator(\)) - ident(read_inheritable_attribute)operator(()symbol(:hidden_actions)operator(\)) - reserved(end) - - comment(# Hide each of the given methods from being callable as actions.) - reserved(def) method(hide_action)operator(()operator(*)ident(names)operator(\)) - ident(write_inheritable_attribute)operator(()symbol(:hidden_actions)operator(,) ident(hidden_actions) operator(|) ident(names)operator(.)ident(collect) operator({) operator(|)ident(n)operator(|) ident(n)operator(.)ident(to_s) operator(})operator(\)) - reserved(end) - - comment(# Replace sensitive paramater data from the request log.) - comment(# Filters paramaters that have any of the arguments as a substring.) - comment(# Looks in all subhashes of the param hash for keys to filter.) - comment(# If a block is given, each key and value of the paramater hash and all) - comment(# subhashes is passed to it, the value or key) - comment(# can be replaced using String#replace or similar method.) - comment(#) - comment(# Examples:) - comment(# filter_parameter_logging) - comment(# => Does nothing, just slows the logging process down) - comment(#) - comment(# filter_parameter_logging :password) - comment(# => replaces the value to all keys matching /password/i with "[FILTERED]") - comment(#) - comment(# filter_parameter_logging :foo, "bar") - comment(# => replaces the value to all keys matching /foo|bar/i with "[FILTERED]") - comment(#) - comment(# filter_parameter_logging { |k,v| v.reverse! if k =~ /secret/i }) - comment(# => reverses the value to all keys matching /secret/i) - comment(#) - comment(# filter_parameter_logging(:foo, "bar"\) { |k,v| v.reverse! if k =~ /secret/i }) - comment(# => reverses the value to all keys matching /secret/i, and ) - comment(# replaces the value to all keys matching /foo|bar/i with "[FILTERED]") - reserved(def) method(filter_parameter_logging)operator(()operator(*)ident(filter_words)operator(,) operator(&)ident(block)operator(\)) - ident(parameter_filter) operator(=) constant(Regexp)operator(.)ident(new)operator(()ident(filter_words)operator(.)ident(collect)operator({) operator(|)ident(s)operator(|) ident(s)operator(.)ident(to_s) operator(})operator(.)ident(join)operator(()stringoperator(\))operator(,) pre_constant(true)operator(\)) reserved(if) ident(filter_words)operator(.)ident(length) operator(>) integer(0) - - ident(define_method)operator(()symbol(:filter_parameters)operator(\)) reserved(do) operator(|)ident(unfiltered_parameters)operator(|) - ident(filtered_parameters) operator(=) operator({)operator(}) - - ident(unfiltered_parameters)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(if) ident(key) operator(=)operator(~) ident(parameter_filter) - ident(filtered_parameters)operator([)ident(key)operator(]) operator(=) string - reserved(elsif) ident(value)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(filtered_parameters)operator([)ident(key)operator(]) operator(=) ident(filter_parameters)operator(()ident(value)operator(\)) - reserved(elsif) ident(block_given?) - ident(key)operator(,) ident(value) operator(=) ident(key)operator(.)ident(dup)operator(,) ident(value)operator(.)ident(dup) - reserved(yield) ident(key)operator(,) ident(value) - ident(filtered_parameters)operator([)ident(key)operator(]) operator(=) ident(value) - reserved(else) - ident(filtered_parameters)operator([)ident(key)operator(]) operator(=) ident(value) - reserved(end) - reserved(end) - - ident(filtered_parameters) - reserved(end) - reserved(end) - reserved(end) - - ident(public) - comment(# Extracts the action_name from the request parameters and performs that action.) - reserved(def) method(process)operator(()ident(request)operator(,) ident(response)operator(,) ident(method) operator(=) symbol(:perform_action)operator(,) operator(*)ident(arguments)operator(\)) comment(#:nodoc:) - ident(initialize_template_class)operator(()ident(response)operator(\)) - ident(assign_shortcuts)operator(()ident(request)operator(,) ident(response)operator(\)) - ident(initialize_current_url) - ident(assign_names) - ident(forget_variables_added_to_assigns) - - ident(log_processing) - ident(send)operator(()ident(method)operator(,) operator(*)ident(arguments)operator(\)) - - ident(response) - reserved(ensure) - ident(process_cleanup) - reserved(end) - - comment(# Returns a URL that has been rewritten according to the options hash and the defined Routes. ) - comment(# (For doing a complete redirect, use redirect_to\).) - comment(#  ) - comment(# url_for is used to:) - comment(#  ) - comment(# All keys given to url_for are forwarded to the Route module, save for the following:) - comment(# * :anchor -- specifies the anchor name to be appended to the path. For example, ) - comment(# url_for :controller => 'posts', :action => 'show', :id => 10, :anchor => 'comments' ) - comment(# will produce "/posts/show/10#comments".) - comment(# * :only_path -- if true, returns the absolute URL (omitting the protocol, host name, and port\)) - comment(# * :trailing_slash -- if true, adds a trailing slash, as in "/archive/2005/". Note that this) - comment(# is currently not recommended since it breaks caching.) - comment(# * :host -- overrides the default (current\) host if provided) - comment(# * :protocol -- overrides the default (current\) protocol if provided) - comment(#) - comment(# The URL is generated from the remaining keys in the hash. A URL contains two key parts: the and a query string.) - comment(# Routes composes a query string as the key/value pairs not included in the .) - comment(#) - comment(# The default Routes setup supports a typical Rails path of "controller/action/id" where action and id are optional, with) - comment(# action defaulting to 'index' when not given. Here are some typical url_for statements and their corresponding URLs:) - comment(#  ) - comment(# url_for :controller => 'posts', :action => 'recent' # => 'proto://host.com/posts/recent') - comment(# url_for :controller => 'posts', :action => 'index' # => 'proto://host.com/posts') - comment(# url_for :controller => 'posts', :action => 'show', :id => 10 # => 'proto://host.com/posts/show/10') - comment(#) - comment(# When generating a new URL, missing values may be filled in from the current request's parameters. For example,) - comment(# url_for :action => 'some_action' will retain the current controller, as expected. This behavior extends to) - comment(# other parameters, including :controller, :id, and any other parameters that are placed into a Route's) - comment(# path.) - comment(#  ) - comment(# The URL helpers such as url_for have a limited form of memory: when generating a new URL, they can look for) - comment(# missing values in the current request's parameters. Routes attempts to guess when a value should and should not be) - comment(# taken from the defaults. There are a few simple rules on how this is performed:) - comment(#) - comment(# * If the controller name begins with a slash, no defaults are used: url_for :controller => '/home') - comment(# * If the controller changes, the action will default to index unless provided) - comment(#) - comment(# The final rule is applied while the URL is being generated and is best illustrated by an example. Let us consider the) - comment(# route given by map.connect 'people/:last/:first/:action', :action => 'bio', :controller => 'people'.) - comment(#) - comment(# Suppose that the current URL is "people/hh/david/contacts". Let's consider a few different cases of URLs which are generated) - comment(# from this page.) - comment(#) - comment(# * url_for :action => 'bio' -- During the generation of this URL, default values will be used for the first and) - comment(# last components, and the action shall change. The generated URL will be, "people/hh/david/bio".) - comment(# * url_for :first => 'davids-little-brother' This generates the URL 'people/hh/davids-little-brother' -- note) - comment(# that this URL leaves out the assumed action of 'bio'.) - comment(#) - comment(# However, you might ask why the action from the current request, 'contacts', isn't carried over into the new URL. The) - comment(# answer has to do with the order in which the parameters appear in the generated path. In a nutshell, since the) - comment(# value that appears in the slot for :first is not equal to default value for :first we stop using) - comment(# defaults. On it's own, this rule can account for much of the typical Rails URL behavior.) - comment(#  ) - comment(# Although a convienence, defaults can occasionaly get in your way. In some cases a default persists longer than desired.) - comment(# The default may be cleared by adding :name => nil to url_for's options.) - comment(# This is often required when writing form helpers, since the defaults in play may vary greatly depending upon where the) - comment(# helper is used from. The following line will redirect to PostController's default action, regardless of the page it is) - comment(# displayed on:) - comment(#) - comment(# url_for :controller => 'posts', :action => nil) - comment(# ) - comment(# If you explicitly want to create a URL that's almost the same as the current URL, you can do so using the) - comment(# :overwrite_params options. Say for your posts you have different views for showing and printing them.) - comment(# Then, in the show view, you get the URL for the print view like this) - comment(#) - comment(# url_for :overwrite_params => { :action => 'print' }) - comment(#) - comment(# This takes the current URL as is and only exchanges the action. In contrast, url_for :action => 'print') - comment(# would have slashed-off the path components after the changed action.) - reserved(def) method(url_for)operator(()ident(options) operator(=) operator({)operator(})operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) comment(#:doc:) - reserved(case) ident(options) - reserved(when) constant(String) reserved(then) ident(options) - reserved(when) constant(Symbol) reserved(then) ident(send)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) - reserved(when) constant(Hash) reserved(then) instance_variable(@url)operator(.)ident(rewrite)operator(()ident(rewrite_options)operator(()ident(options)operator(\))operator(\)) - reserved(end) - reserved(end) - - comment(# Converts the class name from something like "OneModule::TwoModule::NeatController" to "NeatController".) - reserved(def) method(controller_class_name) - pre_constant(self)operator(.)ident(class)operator(.)ident(controller_class_name) - reserved(end) - - comment(# Converts the class name from something like "OneModule::TwoModule::NeatController" to "neat".) - reserved(def) method(controller_name) - pre_constant(self)operator(.)ident(class)operator(.)ident(controller_name) - reserved(end) - - reserved(def) method(session_enabled?) - ident(request)operator(.)ident(session_options)operator([)symbol(:disabled)operator(]) operator(!=) pre_constant(false) - reserved(end) - - ident(protected) - comment(# Renders the content that will be returned to the browser as the response body.) - comment(#) - comment(# === Rendering an action) - comment(# ) - comment(# Action rendering is the most common form and the type used automatically by Action Controller when nothing else is) - comment(# specified. By default, actions are rendered within the current layout (if one exists\).) - comment(#) - comment(# # Renders the template for the action "goal" within the current controller) - comment(# render :action => "goal") - comment(#) - comment(# # Renders the template for the action "short_goal" within the current controller,) - comment(# # but without the current active layout) - comment(# render :action => "short_goal", :layout => false) - comment(#) - comment(# # Renders the template for the action "long_goal" within the current controller,) - comment(# # but with a custom layout) - comment(# render :action => "long_goal", :layout => "spectacular") - comment(#) - comment(# _Deprecation_ _notice_: This used to have the signatures render_action("action", status = 200\),) - comment(# render_without_layout("controller/action", status = 200\), and ) - comment(# render_with_layout("controller/action", status = 200, layout\).) - comment(#) - comment(# === Rendering partials) - comment(# ) - comment(# Partial rendering is most commonly used together with Ajax calls that only update one or a few elements on a page) - comment(# without reloading. Rendering of partials from the controller makes it possible to use the same partial template in) - comment(# both the full-page rendering (by calling it from within the template\) and when sub-page updates happen (from the) - comment(# controller action responding to Ajax calls\). By default, the current layout is not used.) - comment(#) - comment(# # Renders the partial located at app/views/controller/_win.r(html|xml\)) - comment(# render :partial => "win") - comment(#) - comment(# # Renders the partial with a status code of 500 (internal error\)) - comment(# render :partial => "broken", :status => 500) - comment(#) - comment(# # Renders the same partial but also makes a local variable available to it) - comment(# render :partial => "win", :locals => { :name => "david" }) - comment(#) - comment(# # Renders a collection of the same partial by making each element of @wins available through ) - comment(# # the local variable "win" as it builds the complete response) - comment(# render :partial => "win", :collection => @wins) - comment(#) - comment(# # Renders the same collection of partials, but also renders the win_divider partial in between) - comment(# # each win partial.) - comment(# render :partial => "win", :collection => @wins, :spacer_template => "win_divider") - comment(#) - comment(# _Deprecation_ _notice_: This used to have the signatures ) - comment(# render_partial(partial_path = default_template_name, object = nil, local_assigns = {}\) and) - comment(# render_partial_collection(partial_name, collection, partial_spacer_template = nil, local_assigns = {}\).) - comment(#) - comment(# === Rendering a template) - comment(# ) - comment(# Template rendering works just like action rendering except that it takes a path relative to the template root. ) - comment(# The current layout is automatically applied.) - comment(#) - comment(# # Renders the template located in [TEMPLATE_ROOT]/weblog/show.r(html|xml\) (in Rails, app/views/weblog/show.rhtml\)) - comment(# render :template => "weblog/show") - comment(#) - comment(# === Rendering a file) - comment(# ) - comment(# File rendering works just like action rendering except that it takes a filesystem path. By default, the path) - comment(# is assumed to be absolute, and the current layout is not applied.) - comment(#) - comment(# # Renders the template located at the absolute filesystem path) - comment(# render :file => "/path/to/some/template.rhtml") - comment(# render :file => "c:/path/to/some/template.rhtml") - comment(#) - comment(# # Renders a template within the current layout, and with a 404 status code) - comment(# render :file => "/path/to/some/template.rhtml", :layout => true, :status => 404) - comment(# render :file => "c:/path/to/some/template.rhtml", :layout => true, :status => 404) - comment(#) - comment(# # Renders a template relative to the template root and chooses the proper file extension) - comment(# render :file => "some/template", :use_full_path => true) - comment(#) - comment(# _Deprecation_ _notice_: This used to have the signature render_file(path, status = 200\)) - comment(#) - comment(# === Rendering text) - comment(# ) - comment(# Rendering of text is usually used for tests or for rendering prepared content, such as a cache. By default, text) - comment(# rendering is not done within the active layout.) - comment(#) - comment(# # Renders the clear text "hello world" with status code 200) - comment(# render :text => "hello world!") - comment(#) - comment(# # Renders the clear text "Explosion!" with status code 500) - comment(# render :text => "Explosion!", :status => 500 ) - comment(#) - comment(# # Renders the clear text "Hi there!" within the current active layout (if one exists\)) - comment(# render :text => "Explosion!", :layout => true) - comment(#) - comment(# # Renders the clear text "Hi there!" within the layout ) - comment(# # placed in "app/views/layouts/special.r(html|xml\)") - comment(# render :text => "Explosion!", :layout => "special") - comment(#) - comment(# _Deprecation_ _notice_: This used to have the signature render_text("text", status = 200\)) - comment(#) - comment(# === Rendering an inline template) - comment(#) - comment(# Rendering of an inline template works as a cross between text and action rendering where the source for the template) - comment(# is supplied inline, like text, but its interpreted with ERb or Builder, like action. By default, ERb is used for rendering) - comment(# and the current layout is not used.) - comment(#) - comment(# # Renders "hello, hello, hello, again") - comment(# render :inline => "<%= 'hello, ' * 3 + 'again' %>" ) - comment(#) - comment(# # Renders "

Good seeing you!

" using Builder) - comment(# render :inline => "xml.p { 'Good seeing you!' }", :type => :rxml) - comment(#) - comment(# # Renders "hello david") - comment(# render :inline => "<%= 'hello ' + name %>", :locals => { :name => "david" }) - comment(#) - comment(# _Deprecation_ _notice_: This used to have the signature render_template(template, status = 200, type = :rhtml\)) - comment(#) - comment(# === Rendering inline JavaScriptGenerator page updates) - comment(#) - comment(# In addition to rendering JavaScriptGenerator page updates with Ajax in RJS templates (see ActionView::Base for details\),) - comment(# you can also pass the :update parameter to +render+, along with a block, to render page updates inline.) - comment(#) - comment(# render :update do |page|) - comment(# page.replace_html 'user_list', :partial => 'user', :collection => @users) - comment(# page.visual_effect :highlight, 'user_list') - comment(# end) - comment(#) - comment(# === Rendering nothing) - comment(#) - comment(# Rendering nothing is often convenient in combination with Ajax calls that perform their effect client-side or) - comment(# when you just want to communicate a status code. Due to a bug in Safari, nothing actually means a single space.) - comment(#) - comment(# # Renders an empty response with status code 200) - comment(# render :nothing => true) - comment(#) - comment(# # Renders an empty response with status code 401 (access denied\)) - comment(# render :nothing => true, :status => 401) - reserved(def) method(render)operator(()ident(options) operator(=) pre_constant(nil)operator(,) ident(deprecated_status) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) comment(#:doc:) - ident(raise) constant(DoubleRenderError)operator(,) string reserved(if) ident(performed?) - - comment(# Backwards compatibility) - reserved(unless) ident(options)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - reserved(if) ident(options) operator(==) symbol(:update) - ident(options) operator(=) operator({)symbol(:update) operator(=)operator(>) pre_constant(true)operator(}) - reserved(else) - reserved(return) ident(render_file)operator(()ident(options) operator(||) ident(default_template_name)operator(,) ident(deprecated_status)operator(,) pre_constant(true)operator(\)) - reserved(end) - reserved(end) - - reserved(if) ident(content_type) operator(=) ident(options)operator([)symbol(:content_type)operator(]) - ident(headers)operator([)stringoperator(]) operator(=) ident(content_type) - reserved(end) - - reserved(if) ident(text) operator(=) ident(options)operator([)symbol(:text)operator(]) - ident(render_text)operator(()ident(text)operator(,) ident(options)operator([)symbol(:status)operator(])operator(\)) - - reserved(else) - reserved(if) ident(file) operator(=) ident(options)operator([)symbol(:file)operator(]) - ident(render_file)operator(()ident(file)operator(,) ident(options)operator([)symbol(:status)operator(])operator(,) ident(options)operator([)symbol(:use_full_path)operator(])operator(,) ident(options)operator([)symbol(:locals)operator(]) operator(||) operator({)operator(})operator(\)) - - reserved(elsif) ident(template) operator(=) ident(options)operator([)symbol(:template)operator(]) - ident(render_file)operator(()ident(template)operator(,) ident(options)operator([)symbol(:status)operator(])operator(,) pre_constant(true)operator(\)) - - reserved(elsif) ident(inline) operator(=) ident(options)operator([)symbol(:inline)operator(]) - ident(render_template)operator(()ident(inline)operator(,) ident(options)operator([)symbol(:status)operator(])operator(,) ident(options)operator([)symbol(:type)operator(])operator(,) ident(options)operator([)symbol(:locals)operator(]) operator(||) operator({)operator(})operator(\)) - - reserved(elsif) ident(action_name) operator(=) ident(options)operator([)symbol(:action)operator(]) - ident(render_action)operator(()ident(action_name)operator(,) ident(options)operator([)symbol(:status)operator(])operator(,) ident(options)operator([)symbol(:layout)operator(])operator(\)) - - reserved(elsif) ident(xml) operator(=) ident(options)operator([)symbol(:xml)operator(]) - ident(render_xml)operator(()ident(xml)operator(,) ident(options)operator([)symbol(:status)operator(])operator(\)) - - reserved(elsif) ident(partial) operator(=) ident(options)operator([)symbol(:partial)operator(]) - ident(partial) operator(=) ident(default_template_name) reserved(if) ident(partial) operator(==) pre_constant(true) - reserved(if) ident(collection) operator(=) ident(options)operator([)symbol(:collection)operator(]) - ident(render_partial_collection)operator(()ident(partial)operator(,) ident(collection)operator(,) ident(options)operator([)symbol(:spacer_template)operator(])operator(,) ident(options)operator([)symbol(:locals)operator(])operator(,) ident(options)operator([)symbol(:status)operator(])operator(\)) - reserved(else) - ident(render_partial)operator(()ident(partial)operator(,) constant(ActionView)operator(::)constant(Base)operator(::)constant(ObjectWrapper)operator(.)ident(new)operator(()ident(options)operator([)symbol(:object)operator(])operator(\))operator(,) ident(options)operator([)symbol(:locals)operator(])operator(,) ident(options)operator([)symbol(:status)operator(])operator(\)) - reserved(end) - - reserved(elsif) ident(options)operator([)symbol(:update)operator(]) - ident(add_variables_to_assigns) - instance_variable(@template)operator(.)ident(send) symbol(:evaluate_assigns) - - ident(generator) operator(=) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(PrototypeHelper)operator(::)constant(JavaScriptGenerator)operator(.)ident(new)operator(()instance_variable(@template)operator(,) operator(&)ident(block)operator(\)) - ident(render_javascript)operator(()ident(generator)operator(.)ident(to_s)operator(\)) - - reserved(elsif) ident(options)operator([)symbol(:nothing)operator(]) - comment(# Safari doesn't pass the headers of the return if the response is zero length) - ident(render_text)operator(()stringoperator(,) ident(options)operator([)symbol(:status)operator(])operator(\)) - - reserved(else) - ident(render_file)operator(()ident(default_template_name)operator(,) ident(options)operator([)symbol(:status)operator(])operator(,) pre_constant(true)operator(\)) - - reserved(end) - reserved(end) - reserved(end) - - comment(# Renders according to the same rules as render, but returns the result in a string instead) - comment(# of sending it as the response body to the browser.) - reserved(def) method(render_to_string)operator(()ident(options) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) comment(#:doc:) - ident(result) operator(=) ident(render)operator(()ident(options)operator(,) operator(&)ident(block)operator(\)) - - ident(erase_render_results) - ident(forget_variables_added_to_assigns) - ident(reset_variables_added_to_assigns) - - ident(result) - reserved(end) - - reserved(def) method(render_action)operator(()ident(action_name)operator(,) ident(status) operator(=) pre_constant(nil)operator(,) ident(with_layout) operator(=) pre_constant(true)operator(\)) comment(#:nodoc:) - ident(template) operator(=) ident(default_template_name)operator(()ident(action_name)operator(.)ident(to_s)operator(\)) - reserved(if) ident(with_layout) operator(&&) operator(!)ident(template_exempt_from_layout?)operator(()ident(template)operator(\)) - ident(render_with_layout)operator(()ident(template)operator(,) ident(status)operator(\)) - reserved(else) - ident(render_without_layout)operator(()ident(template)operator(,) ident(status)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(render_file)operator(()ident(template_path)operator(,) ident(status) operator(=) pre_constant(nil)operator(,) ident(use_full_path) operator(=) pre_constant(false)operator(,) ident(locals) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(add_variables_to_assigns) - ident(assert_existence_of_template_file)operator(()ident(template_path)operator(\)) reserved(if) ident(use_full_path) - ident(logger)operator(.)ident(info)operator(()stringdelimiter(")> operator(+) operator(()ident(status) operator(?) stringcontent(\))delimiter(")> operator(:) stringoperator(\))operator(\)) reserved(if) ident(logger) - ident(render_text)operator(()instance_variable(@template)operator(.)ident(render_file)operator(()ident(template_path)operator(,) ident(use_full_path)operator(,) ident(locals)operator(\))operator(,) ident(status)operator(\)) - reserved(end) - - reserved(def) method(render_template)operator(()ident(template)operator(,) ident(status) operator(=) pre_constant(nil)operator(,) ident(type) operator(=) symbol(:rhtml)operator(,) ident(local_assigns) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(add_variables_to_assigns) - ident(render_text)operator(()instance_variable(@template)operator(.)ident(render_template)operator(()ident(type)operator(,) ident(template)operator(,) pre_constant(nil)operator(,) ident(local_assigns)operator(\))operator(,) ident(status)operator(\)) - reserved(end) - - reserved(def) method(render_text)operator(()ident(text) operator(=) pre_constant(nil)operator(,) ident(status) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@performed_render) operator(=) pre_constant(true) - instance_variable(@response)operator(.)ident(headers)operator([)stringoperator(]) operator(=) operator(()ident(status) operator(||) constant(DEFAULT_RENDER_STATUS_CODE)operator(\))operator(.)ident(to_s) - instance_variable(@response)operator(.)ident(body) operator(=) ident(text) - reserved(end) - - reserved(def) method(render_javascript)operator(()ident(javascript)operator(,) ident(status) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@response)operator(.)ident(headers)operator([)stringoperator(]) operator(=) string - ident(render_text)operator(()ident(javascript)operator(,) ident(status)operator(\)) - reserved(end) - - reserved(def) method(render_xml)operator(()ident(xml)operator(,) ident(status) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@response)operator(.)ident(headers)operator([)stringoperator(]) operator(=) string - ident(render_text)operator(()ident(xml)operator(,) ident(status)operator(\)) - reserved(end) - - reserved(def) method(render_nothing)operator(()ident(status) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(render_text)operator(()stringoperator(,) ident(status)operator(\)) - reserved(end) - - reserved(def) method(render_partial)operator(()ident(partial_path) operator(=) ident(default_template_name)operator(,) ident(object) operator(=) pre_constant(nil)operator(,) ident(local_assigns) operator(=) pre_constant(nil)operator(,) ident(status) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(add_variables_to_assigns) - ident(render_text)operator(()instance_variable(@template)operator(.)ident(render_partial)operator(()ident(partial_path)operator(,) ident(object)operator(,) ident(local_assigns)operator(\))operator(,) ident(status)operator(\)) - reserved(end) - - reserved(def) method(render_partial_collection)operator(()ident(partial_name)operator(,) ident(collection)operator(,) ident(partial_spacer_template) operator(=) pre_constant(nil)operator(,) ident(local_assigns) operator(=) pre_constant(nil)operator(,) ident(status) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(add_variables_to_assigns) - ident(render_text)operator(()instance_variable(@template)operator(.)ident(render_partial_collection)operator(()ident(partial_name)operator(,) ident(collection)operator(,) ident(partial_spacer_template)operator(,) ident(local_assigns)operator(\))operator(,) ident(status)operator(\)) - reserved(end) - - reserved(def) method(render_with_layout)operator(()ident(template_name) operator(=) ident(default_template_name)operator(,) ident(status) operator(=) pre_constant(nil)operator(,) ident(layout) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(render_with_a_layout)operator(()ident(template_name)operator(,) ident(status)operator(,) ident(layout)operator(\)) - reserved(end) - - reserved(def) method(render_without_layout)operator(()ident(template_name) operator(=) ident(default_template_name)operator(,) ident(status) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(render_with_no_layout)operator(()ident(template_name)operator(,) ident(status)operator(\)) - reserved(end) - - - comment(# Clears the rendered results, allowing for another render to be performed.) - reserved(def) method(erase_render_results) comment(#:nodoc:) - instance_variable(@response)operator(.)ident(body) operator(=) pre_constant(nil) - instance_variable(@performed_render) operator(=) pre_constant(false) - reserved(end) - - comment(# Clears the redirected results from the headers, resets the status to 200 and returns ) - comment(# the URL that was used to redirect or nil if there was no redirected URL) - comment(# Note that +redirect_to+ will change the body of the response to indicate a redirection.) - comment(# The response body is not reset here, see +erase_render_results+) - reserved(def) method(erase_redirect_results) comment(#:nodoc:) - instance_variable(@performed_redirect) operator(=) pre_constant(false) - ident(response)operator(.)ident(redirected_to) operator(=) pre_constant(nil) - ident(response)operator(.)ident(redirected_to_method_params) operator(=) pre_constant(nil) - ident(response)operator(.)ident(headers)operator([)stringoperator(]) operator(=) constant(DEFAULT_RENDER_STATUS_CODE) - ident(response)operator(.)ident(headers)operator(.)ident(delete)operator(()stringoperator(\)) - reserved(end) - - comment(# Erase both render and redirect results) - reserved(def) method(erase_results) comment(#:nodoc:) - ident(erase_render_results) - ident(erase_redirect_results) - reserved(end) - - reserved(def) method(rewrite_options)operator(()ident(options)operator(\)) comment(#:nodoc:) - reserved(if) ident(defaults) operator(=) ident(default_url_options)operator(()ident(options)operator(\)) - ident(defaults)operator(.)ident(merge)operator(()ident(options)operator(\)) - reserved(else) - ident(options) - reserved(end) - reserved(end) - - comment(# Overwrite to implement a number of default options that all url_for-based methods will use. The default options should come in) - comment(# the form of a hash, just like the one you would use for url_for directly. Example:) - comment(#) - comment(# def default_url_options(options\)) - comment(# { :project => @project.active? ? @project.url_name : "unknown" }) - comment(# end) - comment(#) - comment(# As you can infer from the example, this is mostly useful for situations where you want to centralize dynamic decisions about the) - comment(# urls as they stem from the business domain. Please note that any individual url_for call can always override the defaults set) - comment(# by this method.) - reserved(def) method(default_url_options)operator(()ident(options)operator(\)) comment(#:doc:) - reserved(end) - - comment(# Redirects the browser to the target specified in +options+. This parameter can take one of three forms:) - comment(#) - comment(# * Hash: The URL will be generated by calling url_for with the +options+.) - comment(# * String starting with protocol:// (like http://\): Is passed straight through as the target for redirection.) - comment(# * String not containing a protocol: The current protocol and host is prepended to the string.) - comment(# * :back: Back to the page that issued the request. Useful for forms that are triggered from multiple places.) - comment(# Short-hand for redirect_to(request.env["HTTP_REFERER"]\)) - comment(# ) - comment(# Examples:) - comment(# redirect_to :action => "show", :id => 5) - comment(# redirect_to "http://www.rubyonrails.org") - comment(# redirect_to "/images/screenshot.jpg") - comment(# redirect_to :back) - comment(#) - comment(# The redirection happens as a "302 Moved" header.) - comment(#) - comment(# When using redirect_to :back, if there is no referrer,) - comment(# RedirectBackError will be raised. You may specify some fallback) - comment(# behavior for this case by rescueing RedirectBackError.) - reserved(def) method(redirect_to)operator(()ident(options) operator(=) operator({)operator(})operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) comment(#:doc:) - reserved(case) ident(options) - reserved(when) regexp - ident(raise) constant(DoubleRenderError) reserved(if) ident(performed?) - ident(logger)operator(.)ident(info)operator(()stringdelimiter(")>operator(\)) reserved(if) ident(logger) - ident(response)operator(.)ident(redirect)operator(()ident(options)operator(\)) - ident(response)operator(.)ident(redirected_to) operator(=) ident(options) - instance_variable(@performed_redirect) operator(=) pre_constant(true) - - reserved(when) constant(String) - ident(redirect_to)operator(()ident(request)operator(.)ident(protocol) operator(+) ident(request)operator(.)ident(host_with_port) operator(+) ident(options)operator(\)) - - reserved(when) symbol(:back) - ident(request)operator(.)ident(env)operator([)stringoperator(]) operator(?) ident(redirect_to)operator(()ident(request)operator(.)ident(env)operator([)stringoperator(])operator(\)) operator(:) ident(raise)operator(()constant(RedirectBackError)operator(\)) - - reserved(else) - reserved(if) ident(parameters_for_method_reference)operator(.)ident(empty?) - ident(redirect_to)operator(()ident(url_for)operator(()ident(options)operator(\))operator(\)) - ident(response)operator(.)ident(redirected_to) operator(=) ident(options) - reserved(else) - ident(redirect_to)operator(()ident(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\))operator(\)) - ident(response)operator(.)ident(redirected_to)operator(,) ident(response)operator(.)ident(redirected_to_method_params) operator(=) ident(options)operator(,) ident(parameters_for_method_reference) - reserved(end) - reserved(end) - reserved(end) - - comment(# Sets a HTTP 1.1 Cache-Control header. Defaults to issuing a "private" instruction, so that) - comment(# intermediate caches shouldn't cache the response.) - comment(#) - comment(# Examples:) - comment(# expires_in 20.minutes) - comment(# expires_in 3.hours, :private => false) - comment(# expires in 3.hours, 'max-stale' => 5.hours, :private => nil, :public => true) - comment(# ) - comment(# This method will overwrite an existing Cache-Control header.) - comment(# See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities.) - reserved(def) method(expires_in)operator(()ident(seconds)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:doc:) - ident(cache_options) operator(=) operator({) string operator(=)operator(>) ident(seconds)operator(,) string operator(=)operator(>) pre_constant(true) operator(})operator(.)ident(symbolize_keys)operator(.)ident(merge!)operator(()ident(options)operator(.)ident(symbolize_keys)operator(\)) - ident(cache_options)operator(.)ident(delete_if) operator({) operator(|)ident(k)operator(,)ident(v)operator(|) ident(v)operator(.)ident(nil?) reserved(or) ident(v) operator(==) pre_constant(false) operator(}) - ident(cache_control) operator(=) ident(cache_options)operator(.)ident(map)operator({) operator(|)ident(k)operator(,)ident(v)operator(|) ident(v) operator(==) pre_constant(true) operator(?) ident(k)operator(.)ident(to_s) operator(:) stringcontent(=)inlinedelimiter(")>operator(}) - instance_variable(@response)operator(.)ident(headers)operator([)stringoperator(]) operator(=) ident(cache_control)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - comment(# Sets a HTTP 1.1 Cache-Control header of "no-cache" so no caching should occur by the browser or) - comment(# intermediate caches (like caching proxy servers\).) - reserved(def) method(expires_now) comment(#:doc:) - instance_variable(@response)operator(.)ident(headers)operator([)stringoperator(]) operator(=) string - reserved(end) - - comment(# Resets the session by clearing out all the objects stored within and initializing a new session object.) - reserved(def) method(reset_session) comment(#:doc:) - instance_variable(@request)operator(.)ident(reset_session) - instance_variable(@session) operator(=) instance_variable(@request)operator(.)ident(session) - instance_variable(@response)operator(.)ident(session) operator(=) instance_variable(@session) - reserved(end) - - ident(private) - reserved(def) pre_constant(self)operator(.)method(view_class) - instance_variable(@view_class) operator(||=) - comment(# create a new class based on the default template class and include helper methods) - ident(returning) constant(Class)operator(.)ident(new)operator(()constant(ActionView)operator(::)constant(Base)operator(\)) reserved(do) operator(|)ident(view_class)operator(|) - ident(view_class)operator(.)ident(send)operator(()symbol(:include)operator(,) ident(master_helper_module)operator(\)) - reserved(end) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(view_root) - instance_variable(@view_root) operator(||=) ident(template_root) - reserved(end) - - reserved(def) method(initialize_template_class)operator(()ident(response)operator(\)) - ident(raise) string reserved(unless) class_variable(@@template_class) - - ident(response)operator(.)ident(template) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(view_class)operator(.)ident(new)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(view_root)operator(,) operator({)operator(})operator(,) pre_constant(self)operator(\)) - ident(response)operator(.)ident(redirected_to) operator(=) pre_constant(nil) - instance_variable(@performed_render) operator(=) instance_variable(@performed_redirect) operator(=) pre_constant(false) - reserved(end) - - reserved(def) method(assign_shortcuts)operator(()ident(request)operator(,) ident(response)operator(\)) - instance_variable(@request)operator(,) instance_variable(@params)operator(,) instance_variable(@cookies) operator(=) ident(request)operator(,) ident(request)operator(.)ident(parameters)operator(,) ident(request)operator(.)ident(cookies) - - instance_variable(@response) operator(=) ident(response) - instance_variable(@response)operator(.)ident(session) operator(=) ident(request)operator(.)ident(session) - - instance_variable(@session) operator(=) instance_variable(@response)operator(.)ident(session) - instance_variable(@template) operator(=) instance_variable(@response)operator(.)ident(template) - instance_variable(@assigns) operator(=) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns) - - instance_variable(@headers) operator(=) instance_variable(@response)operator(.)ident(headers) - reserved(end) - - reserved(def) method(initialize_current_url) - instance_variable(@url) operator(=) constant(UrlRewriter)operator(.)ident(new)operator(()instance_variable(@request)operator(,) instance_variable(@params)operator(.)ident(clone)operator(()operator(\))operator(\)) - reserved(end) - - reserved(def) method(log_processing) - reserved(if) ident(logger) - ident(logger)operator(.)ident(info) stringchar(\\#)inlinecontent( (for )inlinecontent(\) [)inlinecontent(])delimiter(")> - ident(logger)operator(.)ident(info) stringdelimiter(")> reserved(if) instance_variable(@session) reserved(and) instance_variable(@session)operator(.)ident(respond_to?)operator(()symbol(:session_id)operator(\)) - ident(logger)operator(.)ident(info) stringdelimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(perform_action) - reserved(if) pre_constant(self)operator(.)ident(class)operator(.)ident(action_methods)operator(.)ident(include?)operator(()ident(action_name)operator(\)) operator(||) pre_constant(self)operator(.)ident(class)operator(.)ident(action_methods)operator(.)ident(include?)operator(()stringoperator(\)) - ident(send)operator(()ident(action_name)operator(\)) - ident(render) reserved(unless) ident(performed?) - reserved(elsif) ident(template_exists?) operator(&&) ident(template_public?) - ident(render) - reserved(else) - ident(raise) constant(UnknownAction)operator(,) stringdelimiter(")>operator(,) ident(caller) - reserved(end) - reserved(end) - - reserved(def) method(performed?) - instance_variable(@performed_render) operator(||) instance_variable(@performed_redirect) - reserved(end) - - reserved(def) method(assign_names) - instance_variable(@action_name) operator(=) operator(()ident(params)operator([)stringoperator(]) operator(||) stringoperator(\)) - reserved(end) - - reserved(def) method(action_methods) - pre_constant(self)operator(.)ident(class)operator(.)ident(action_methods) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(action_methods) - instance_variable(@action_methods) operator(||=) constant(Set)operator(.)ident(new)operator(()ident(public_instance_methods) operator(-) ident(hidden_actions)operator(\)) - reserved(end) - - reserved(def) method(add_variables_to_assigns) - reserved(unless) instance_variable(@variables_added) - ident(add_instance_variables_to_assigns) - ident(add_class_variables_to_assigns) reserved(if) ident(view_controller_internals) - instance_variable(@variables_added) operator(=) pre_constant(true) - reserved(end) - reserved(end) - - reserved(def) method(forget_variables_added_to_assigns) - instance_variable(@variables_added) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(reset_variables_added_to_assigns) - instance_variable(@template)operator(.)ident(instance_variable_set)operator(()stringoperator(,) pre_constant(nil)operator(\)) - reserved(end) - - reserved(def) method(add_instance_variables_to_assigns) - class_variable(@@protected_variables_cache) operator(||=) ident(protected_instance_variables)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({) operator(|)ident(h)operator(,) ident(k)operator(|) ident(h)operator([)ident(k)operator(]) operator(=) pre_constant(true)operator(;) ident(h) operator(}) - ident(instance_variables)operator(.)ident(each) reserved(do) operator(|)ident(var)operator(|) - reserved(next) reserved(if) class_variable(@@protected_variables_cache)operator(.)ident(include?)operator(()ident(var)operator(\)) - instance_variable(@assigns)operator([)ident(var)operator([)integer(1)operator(..)integer(-1)operator(])operator(]) operator(=) ident(instance_variable_get)operator(()ident(var)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(add_class_variables_to_assigns) - stringoperator(.)ident(each) reserved(do) operator(|)ident(cvar)operator(|) - instance_variable(@assigns)operator([)ident(cvar)operator(]) operator(=) pre_constant(self)operator(.)ident(send)operator(()ident(cvar)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(protected_instance_variables) - reserved(if) ident(view_controller_internals) - operator([) stringoperator(,) stringoperator(,) string operator(]) - reserved(else) - operator([) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) string operator(]) - reserved(end) - reserved(end) - - reserved(def) method(request_origin) - comment(# this *needs* to be cached!) - comment(# otherwise you'd get different results if calling it more than once) - instance_variable(@request_origin) operator(||=) stringcontent( at )inlinedelimiter(")> - reserved(end) - - reserved(def) method(complete_request_uri) - stringinlineinlinedelimiter(")> - reserved(end) - - reserved(def) method(close_session) - instance_variable(@session)operator(.)ident(close) reserved(unless) instance_variable(@session)operator(.)ident(nil?) operator(||) constant(Hash) operator(===) instance_variable(@session) - reserved(end) - - reserved(def) method(template_exists?)operator(()ident(template_name) operator(=) ident(default_template_name)operator(\)) - instance_variable(@template)operator(.)ident(file_exists?)operator(()ident(template_name)operator(\)) - reserved(end) - - reserved(def) method(template_public?)operator(()ident(template_name) operator(=) ident(default_template_name)operator(\)) - instance_variable(@template)operator(.)ident(file_public?)operator(()ident(template_name)operator(\)) - reserved(end) - - reserved(def) method(template_exempt_from_layout?)operator(()ident(template_name) operator(=) ident(default_template_name)operator(\)) - ident(template_name) operator(=)operator(~) regexp operator(||) operator(()instance_variable(@template)operator(.)ident(pick_template_extension)operator(()ident(template_name)operator(\)) operator(==) symbol(:rjs) reserved(rescue) pre_constant(false)operator(\)) - reserved(end) - - reserved(def) method(assert_existence_of_template_file)operator(()ident(template_name)operator(\)) - reserved(unless) ident(template_exists?)operator(()ident(template_name)operator(\)) operator(||) ident(ignore_missing_templates) - ident(full_template_path) operator(=) instance_variable(@template)operator(.)ident(send)operator(()symbol(:full_template_path)operator(,) ident(template_name)operator(,) stringoperator(\)) - ident(template_type) operator(=) operator(()ident(template_name) operator(=)operator(~) regexpoperator(\)) operator(?) string operator(:) string - ident(raise)operator(()constant(MissingTemplate)operator(,) stringcontent( )inlinedelimiter(")>operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(default_template_name)operator(()ident(action_name) operator(=) pre_constant(self)operator(.)ident(action_name)operator(\)) - reserved(if) ident(action_name) - ident(action_name) operator(=) ident(action_name)operator(.)ident(to_s) - reserved(if) ident(action_name)operator(.)ident(include?)operator(()stringoperator(\)) operator(&&) ident(template_path_includes_controller?)operator(()ident(action_name)operator(\)) - ident(action_name) operator(=) ident(strip_out_controller)operator(()ident(action_name)operator(\)) - reserved(end) - reserved(end) - stringcontent(/)inlinedelimiter(")> - reserved(end) - - reserved(def) method(strip_out_controller)operator(()ident(path)operator(\)) - ident(path)operator(.)ident(split)operator(()stringoperator(,) integer(2)operator(\))operator(.)ident(last) - reserved(end) - - reserved(def) method(template_path_includes_controller?)operator(()ident(path)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(controller_path)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(-1)operator(]) operator(==) ident(path)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(0)operator(]) - reserved(end) - - reserved(def) method(process_cleanup) - ident(close_session) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActionController) comment(#:nodoc:) - comment(# The benchmarking module times the performance of actions and reports to the logger. If the Active Record) - comment(# package has been included, a separate timing section for database calls will be added as well.) - reserved(module) class(Benchmarking) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:perform_action_without_benchmark)operator(,) symbol(:perform_action) - ident(alias_method) symbol(:perform_action)operator(,) symbol(:perform_action_with_benchmark) - - ident(alias_method) symbol(:render_without_benchmark)operator(,) symbol(:render) - ident(alias_method) symbol(:render)operator(,) symbol(:render_with_benchmark) - reserved(end) - reserved(end) - - reserved(module) class(ClassMethods) - comment(# Log and benchmark the workings of a single block and silence whatever logging that may have happened inside it ) - comment(# (unless use_silence is set to false\).) - comment(#) - comment(# The benchmark is only recorded if the current level of the logger matches the log_level, which makes it) - comment(# easy to include benchmarking statements in production software that will remain inexpensive because the benchmark) - comment(# will only be conducted if the log level is low enough.) - reserved(def) method(benchmark)operator(()ident(title)operator(,) ident(log_level) operator(=) constant(Logger)operator(::)constant(DEBUG)operator(,) ident(use_silence) operator(=) pre_constant(true)operator(\)) - reserved(if) ident(logger) operator(&&) ident(logger)operator(.)ident(level) operator(==) ident(log_level) - ident(result) operator(=) pre_constant(nil) - ident(seconds) operator(=) constant(Benchmark)operator(.)ident(realtime) operator({) ident(result) operator(=) ident(use_silence) operator(?) ident(silence) operator({) reserved(yield) operator(}) operator(:) reserved(yield) operator(}) - ident(logger)operator(.)ident(add)operator(()ident(log_level)operator(,) stringcontent( ()inline operator(%) ident(seconds)inline_delimiter(})>content(\))delimiter(")>operator(\)) - ident(result) - reserved(else) - reserved(yield) - reserved(end) - reserved(end) - - comment(# Silences the logger for the duration of the block.) - reserved(def) method(silence) - ident(old_logger_level)operator(,) ident(logger)operator(.)ident(level) operator(=) ident(logger)operator(.)ident(level)operator(,) constant(Logger)operator(::)constant(ERROR) reserved(if) ident(logger) - reserved(yield) - reserved(ensure) - ident(logger)operator(.)ident(level) operator(=) ident(old_logger_level) reserved(if) ident(logger) - reserved(end) - reserved(end) - - reserved(def) method(render_with_benchmark)operator(()ident(options) operator(=) pre_constant(nil)operator(,) ident(deprecated_status) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - reserved(unless) ident(logger) - ident(render_without_benchmark)operator(()ident(options)operator(,) ident(deprecated_status)operator(,) operator(&)ident(block)operator(\)) - reserved(else) - ident(db_runtime) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(reset_runtime) reserved(if) constant(Object)operator(.)ident(const_defined?)operator(()stringoperator(\)) operator(&&) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connected?) - - ident(render_output) operator(=) pre_constant(nil) - instance_variable(@rendering_runtime) operator(=) constant(Benchmark)operator(::)ident(measure)operator({) ident(render_output) operator(=) ident(render_without_benchmark)operator(()ident(options)operator(,) ident(deprecated_status)operator(,) operator(&)ident(block)operator(\)) operator(})operator(.)ident(real) - - reserved(if) constant(Object)operator(.)ident(const_defined?)operator(()stringoperator(\)) operator(&&) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connected?) - instance_variable(@db_rt_before_render) operator(=) ident(db_runtime) - instance_variable(@db_rt_after_render) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(reset_runtime) - instance_variable(@rendering_runtime) operator(-=) instance_variable(@db_rt_after_render) - reserved(end) - - ident(render_output) - reserved(end) - reserved(end) - - reserved(def) method(perform_action_with_benchmark) - reserved(unless) ident(logger) - ident(perform_action_without_benchmark) - reserved(else) - ident(runtime) operator(=) operator([)constant(Benchmark)operator(::)ident(measure)operator({) ident(perform_action_without_benchmark) operator(})operator(.)ident(real)operator(,) float(0.0001)operator(])operator(.)ident(max) - ident(log_message) operator(=) stringoperator(,) ident(runtime)operator(\))inline_delimiter(})>content( ()inlinecontent( reqs/sec\))delimiter(")> - ident(log_message) operator(<<) ident(rendering_runtime)operator(()ident(runtime)operator(\)) reserved(if) instance_variable(@rendering_runtime) - ident(log_message) operator(<<) ident(active_record_runtime)operator(()ident(runtime)operator(\)) reserved(if) constant(Object)operator(.)ident(const_defined?)operator(()stringoperator(\)) operator(&&) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connected?) - ident(log_message) operator(<<) stringoperator(])inline_delimiter(})>delimiter(")> - ident(log_message) operator(<<) stringinline_delimiter(})>content(])delimiter(")> - ident(logger)operator(.)ident(info)operator(()ident(log_message)operator(\)) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(rendering_runtime)operator(()ident(runtime)operator(\)) - stringoperator(,) instance_variable(@rendering_runtime)operator(\))inline_delimiter(})>content( ()inlineoperator(,) operator(()instance_variable(@rendering_runtime) operator(*) integer(100)operator(\)) operator(/) ident(runtime)operator(\))inline_delimiter(})>content(%\))delimiter(")> - reserved(end) - - reserved(def) method(active_record_runtime)operator(()ident(runtime)operator(\)) - ident(db_runtime) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(reset_runtime) - ident(db_runtime) operator(+=) instance_variable(@db_rt_before_render) reserved(if) instance_variable(@db_rt_before_render) - ident(db_runtime) operator(+=) instance_variable(@db_rt_after_render) reserved(if) instance_variable(@db_rt_after_render) - ident(db_percentage) operator(=) operator(()ident(db_runtime) operator(*) integer(100)operator(\)) operator(/) ident(runtime) - stringoperator(,) ident(db_runtime)operator(\))inline_delimiter(})>content( ()inlineoperator(,) ident(db_percentage)operator(\))inline_delimiter(})>content(%\))delimiter(")> - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActionController) comment(#:nodoc:) - comment(# Caching is a cheap way of speeding up slow applications by keeping the result of calculations, renderings, and database calls) - comment(# around for subsequent requests. Action Controller affords you three approaches in varying levels of granularity: Page, Action, Fragment.) - comment(#) - comment(# You can read more about each approach and the sweeping assistance by clicking the modules below.) - comment(#) - comment(# Note: To turn off all caching and sweeping, set Base.perform_caching = false.) - reserved(module) class(Caching) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) comment(#:nodoc:) - ident(base)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(Pages)operator(,) constant(Actions)operator(,) constant(Fragments)operator(,) constant(Sweeping)operator(\)) - - ident(base)operator(.)ident(class_eval) reserved(do) - class_variable(@@perform_caching) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:perform_caching) - reserved(end) - reserved(end) - - comment(# Page caching is an approach to caching where the entire action output of is stored as a HTML file that the web server) - comment(# can serve without going through the Action Pack. This can be as much as 100 times faster than going through the process of dynamically) - comment(# generating the content. Unfortunately, this incredible speed-up is only available to stateless pages where all visitors) - comment(# are treated the same. Content management systems -- including weblogs and wikis -- have many pages that are a great fit) - comment(# for this approach, but account-based systems where people log in and manipulate their own data are often less likely candidates.) - comment(#) - comment(# Specifying which actions to cache is done through the caches class method:) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# caches_page :show, :new) - comment(# end) - comment(#) - comment(# This will generate cache files such as weblog/show/5 and weblog/new, which match the URLs used to trigger the dynamic) - comment(# generation. This is how the web server is able pick up a cache file when it exists and otherwise let the request pass on to) - comment(# the Action Pack to generate it.) - comment(#) - comment(# Expiration of the cache is handled by deleting the cached file, which results in a lazy regeneration approach where the cache) - comment(# is not restored before another hit is made against it. The API for doing so mimics the options from url_for and friends:) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# def update) - comment(# List.update(params[:list][:id], params[:list]\)) - comment(# expire_page :action => "show", :id => params[:list][:id]) - comment(# redirect_to :action => "show", :id => params[:list][:id]) - comment(# end) - comment(# end) - comment(#) - comment(# Additionally, you can expire caches using Sweepers that act on changes in the model to determine when a cache is supposed to be) - comment(# expired.) - comment(#) - comment(# == Setting the cache directory) - comment(#) - comment(# The cache directory should be the document root for the web server and is set using Base.page_cache_directory = "/document/root".) - comment(# For Rails, this directory has already been set to RAILS_ROOT + "/public".) - comment(#) - comment(# == Setting the cache extension) - comment(#) - comment(# By default, the cache extension is .html, which makes it easy for the cached files to be picked up by the web server. If you want) - comment(# something else, like .php or .shtml, just set Base.page_cache_extension.) - reserved(module) class(Pages) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) comment(#:nodoc:) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - ident(base)operator(.)ident(class_eval) reserved(do) - class_variable(@@page_cache_directory) operator(=) reserved(defined?)operator(()constant(RAILS_ROOT)operator(\)) operator(?) stringcontent(/public)delimiter(")> operator(:) string - ident(cattr_accessor) symbol(:page_cache_directory) - - class_variable(@@page_cache_extension) operator(=) string - ident(cattr_accessor) symbol(:page_cache_extension) - reserved(end) - reserved(end) - - reserved(module) class(ClassMethods) - comment(# Expires the page that was cached with the +path+ as a key. Example:) - comment(# expire_page "/lists/show") - reserved(def) method(expire_page)operator(()ident(path)operator(\)) - reserved(return) reserved(unless) ident(perform_caching) - - ident(benchmark) stringdelimiter(")> reserved(do) - constant(File)operator(.)ident(delete)operator(()ident(page_cache_path)operator(()ident(path)operator(\))operator(\)) reserved(if) constant(File)operator(.)ident(exists?)operator(()ident(page_cache_path)operator(()ident(path)operator(\))operator(\)) - reserved(end) - reserved(end) - - comment(# Manually cache the +content+ in the key determined by +path+. Example:) - comment(# cache_page "I'm the cached content", "/lists/show") - reserved(def) method(cache_page)operator(()ident(content)operator(,) ident(path)operator(\)) - reserved(return) reserved(unless) ident(perform_caching) - - ident(benchmark) stringdelimiter(")> reserved(do) - constant(FileUtils)operator(.)ident(makedirs)operator(()constant(File)operator(.)ident(dirname)operator(()ident(page_cache_path)operator(()ident(path)operator(\))operator(\))operator(\)) - constant(File)operator(.)ident(open)operator(()ident(page_cache_path)operator(()ident(path)operator(\))operator(,) stringoperator(\)) operator({) operator(|)ident(f)operator(|) ident(f)operator(.)ident(write)operator(()ident(content)operator(\)) operator(}) - reserved(end) - reserved(end) - - comment(# Caches the +actions+ using the page-caching approach that'll store the cache in a path within the page_cache_directory that) - comment(# matches the triggering url.) - reserved(def) method(caches_page)operator(()operator(*)ident(actions)operator(\)) - reserved(return) reserved(unless) ident(perform_caching) - ident(actions)operator(.)ident(each) reserved(do) operator(|)ident(action)operator(|) - ident(class_eval) stringcontent(' })delimiter(")> - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(page_cache_file)operator(()ident(path)operator(\)) - ident(name) operator(=) operator(()operator(()ident(path)operator(.)ident(empty?) operator(||) ident(path) operator(==) stringoperator(\)) operator(?) string operator(:) constant(URI)operator(.)ident(unescape)operator(()ident(path)operator(\))operator(\)) - ident(name) operator(<<) ident(page_cache_extension) reserved(unless) operator(()ident(name)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last) operator(||) ident(name)operator(\))operator(.)ident(include?) string - reserved(return) ident(name) - reserved(end) - - reserved(def) method(page_cache_path)operator(()ident(path)operator(\)) - ident(page_cache_directory) operator(+) ident(page_cache_file)operator(()ident(path)operator(\)) - reserved(end) - reserved(end) - - comment(# Expires the page that was cached with the +options+ as a key. Example:) - comment(# expire_page :controller => "lists", :action => "show") - reserved(def) method(expire_page)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - reserved(return) reserved(unless) ident(perform_caching) - reserved(if) ident(options)operator([)symbol(:action)operator(])operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - ident(options)operator([)symbol(:action)operator(])operator(.)ident(dup)operator(.)ident(each) reserved(do) operator(|)ident(action)operator(|) - pre_constant(self)operator(.)ident(class)operator(.)ident(expire_page)operator(()ident(url_for)operator(()ident(options)operator(.)ident(merge)operator(()operator({) symbol(:only_path) operator(=)operator(>) pre_constant(true)operator(,) symbol(:skip_relative_url_root) operator(=)operator(>) pre_constant(true)operator(,) symbol(:action) operator(=)operator(>) ident(action) operator(})operator(\))operator(\))operator(\)) - reserved(end) - reserved(else) - pre_constant(self)operator(.)ident(class)operator(.)ident(expire_page)operator(()ident(url_for)operator(()ident(options)operator(.)ident(merge)operator(()operator({) symbol(:only_path) operator(=)operator(>) pre_constant(true)operator(,) symbol(:skip_relative_url_root) operator(=)operator(>) pre_constant(true) operator(})operator(\))operator(\))operator(\)) - reserved(end) - reserved(end) - - comment(# Manually cache the +content+ in the key determined by +options+. If no content is provided, the contents of @response.body is used) - comment(# If no options are provided, the current +options+ for this action is used. Example:) - comment(# cache_page "I'm the cached content", :controller => "lists", :action => "show") - reserved(def) method(cache_page)operator(()ident(content) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - reserved(return) reserved(unless) ident(perform_caching) operator(&&) ident(caching_allowed) - pre_constant(self)operator(.)ident(class)operator(.)ident(cache_page)operator(()ident(content) operator(||) instance_variable(@response)operator(.)ident(body)operator(,) ident(url_for)operator(()ident(options)operator(.)ident(merge)operator(()operator({) symbol(:only_path) operator(=)operator(>) pre_constant(true)operator(,) symbol(:skip_relative_url_root) operator(=)operator(>) pre_constant(true) operator(})operator(\))operator(\))operator(\)) - reserved(end) - - ident(private) - reserved(def) method(caching_allowed) - operator(!)instance_variable(@request)operator(.)ident(post?) operator(&&) instance_variable(@response)operator(.)ident(headers)operator([)stringoperator(]) operator(&&) instance_variable(@response)operator(.)ident(headers)operator([)stringoperator(])operator(.)ident(to_i) operator(<) integer(400) - reserved(end) - reserved(end) - - comment(# Action caching is similar to page caching by the fact that the entire output of the response is cached, but unlike page caching,) - comment(# every request still goes through the Action Pack. The key benefit of this is that filters are run before the cache is served, which) - comment(# allows for authentication and other restrictions on whether someone is allowed to see the cache. Example:) - comment(#) - comment(# class ListsController < ApplicationController) - comment(# before_filter :authenticate, :except => :public) - comment(# caches_page :public) - comment(# caches_action :show, :feed) - comment(# end) - comment(#) - comment(# In this example, the public action doesn't require authentication, so it's possible to use the faster page caching method. But both the) - comment(# show and feed action are to be shielded behind the authenticate filter, so we need to implement those as action caches.) - comment(#) - comment(# Action caching internally uses the fragment caching and an around filter to do the job. The fragment cache is named according to both) - comment(# the current host and the path. So a page that is accessed at http://david.somewhere.com/lists/show/1 will result in a fragment named) - comment(# "david.somewhere.com/lists/show/1". This allows the cacher to differentiate between "david.somewhere.com/lists/" and) - comment(# "jamis.somewhere.com/lists/" -- which is a helpful way of assisting the subdomain-as-account-key pattern.) - reserved(module) class(Actions) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - ident(base)operator(.)ident(send)operator(()symbol(:attr_accessor)operator(,) symbol(:rendered_action_cache)operator(\)) - reserved(end) - - reserved(module) class(ClassMethods) comment(#:nodoc:) - reserved(def) method(caches_action)operator(()operator(*)ident(actions)operator(\)) - reserved(return) reserved(unless) ident(perform_caching) - ident(around_filter)operator(()constant(ActionCacheFilter)operator(.)ident(new)operator(()operator(*)ident(actions)operator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(expire_action)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - reserved(return) reserved(unless) ident(perform_caching) - reserved(if) ident(options)operator([)symbol(:action)operator(])operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - ident(options)operator([)symbol(:action)operator(])operator(.)ident(dup)operator(.)ident(each) reserved(do) operator(|)ident(action)operator(|) - ident(expire_fragment)operator(()ident(url_for)operator(()ident(options)operator(.)ident(merge)operator(()operator({) symbol(:action) operator(=)operator(>) ident(action) operator(})operator(\))operator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last)operator(\)) - reserved(end) - reserved(else) - ident(expire_fragment)operator(()ident(url_for)operator(()ident(options)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last)operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(ActionCacheFilter) comment(#:nodoc:) - reserved(def) method(initialize)operator(()operator(*)ident(actions)operator(\)) - instance_variable(@actions) operator(=) ident(actions) - reserved(end) - - reserved(def) method(before)operator(()ident(controller)operator(\)) - reserved(return) reserved(unless) instance_variable(@actions)operator(.)ident(include?)operator(()ident(controller)operator(.)ident(action_name)operator(.)ident(intern)operator(\)) - reserved(if) ident(cache) operator(=) ident(controller)operator(.)ident(read_fragment)operator(()ident(controller)operator(.)ident(url_for)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last)operator(\)) - ident(controller)operator(.)ident(rendered_action_cache) operator(=) pre_constant(true) - ident(controller)operator(.)ident(send)operator(()symbol(:render_text)operator(,) ident(cache)operator(\)) - pre_constant(false) - reserved(end) - reserved(end) - - reserved(def) method(after)operator(()ident(controller)operator(\)) - reserved(return) reserved(if) operator(!)instance_variable(@actions)operator(.)ident(include?)operator(()ident(controller)operator(.)ident(action_name)operator(.)ident(intern)operator(\)) operator(||) ident(controller)operator(.)ident(rendered_action_cache) - ident(controller)operator(.)ident(write_fragment)operator(()ident(controller)operator(.)ident(url_for)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last)operator(,) ident(controller)operator(.)ident(response)operator(.)ident(body)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Fragment caching is used for caching various blocks within templates without caching the entire action as a whole. This is useful when) - comment(# certain elements of an action change frequently or depend on complicated state while other parts rarely change or can be shared amongst multiple) - comment(# parties. The caching is doing using the cache helper available in the Action View. A template with caching might look something like:) - comment(#) - comment(# Hello <%= @name %>) - comment(# <% cache do %>) - comment(# All the topics in the system:) - comment(# <%= render_collection_of_partials "topic", Topic.find_all %>) - comment(# <% end %>) - comment(#) - comment(# This cache will bind to the name of action that called it. So you would be able to invalidate it using) - comment(# expire_fragment(:controller => "topics", :action => "list"\) -- if that was the controller/action used. This is not too helpful) - comment(# if you need to cache multiple fragments per action or if the action itself is cached using caches_action. So instead we should) - comment(# qualify the name of the action used with something like:) - comment(#) - comment(# <% cache(:action => "list", :action_suffix => "all_topics"\) do %>) - comment(#) - comment(# That would result in a name such as "/topics/list/all_topics", which wouldn't conflict with any action cache and neither with another) - comment(# fragment using a different suffix. Note that the URL doesn't have to really exist or be callable. We're just using the url_for system) - comment(# to generate unique cache names that we can refer to later for expirations. The expiration call for this example would be) - comment(# expire_fragment(:controller => "topics", :action => "list", :action_suffix => "all_topics"\).) - comment(#) - comment(# == Fragment stores) - comment(#) - comment(# In order to use the fragment caching, you need to designate where the caches should be stored. This is done by assigning a fragment store) - comment(# of which there are four different kinds:) - comment(#) - comment(# * FileStore: Keeps the fragments on disk in the +cache_path+, which works well for all types of environments and shares the fragments for) - comment(# all the web server processes running off the same application directory.) - comment(# * MemoryStore: Keeps the fragments in memory, which is fine for WEBrick and for FCGI (if you don't care that each FCGI process holds its) - comment(# own fragment store\). It's not suitable for CGI as the process is thrown away at the end of each request. It can potentially also take) - comment(# up a lot of memory since each process keeps all the caches in memory.) - comment(# * DRbStore: Keeps the fragments in the memory of a separate, shared DRb process. This works for all environments and only keeps one cache) - comment(# around for all processes, but requires that you run and manage a separate DRb process.) - comment(# * MemCacheStore: Works like DRbStore, but uses Danga's MemCache instead.) - comment(# Requires the ruby-memcache library: gem install ruby-memcache.) - comment(#) - comment(# Configuration examples (MemoryStore is the default\):) - comment(#) - comment(# ActionController::Base.fragment_cache_store = :memory_store) - comment(# ActionController::Base.fragment_cache_store = :file_store, "/path/to/cache/directory") - comment(# ActionController::Base.fragment_cache_store = :drb_store, "druby://localhost:9192") - comment(# ActionController::Base.fragment_cache_store = :mem_cache_store, "localhost") - comment(# ActionController::Base.fragment_cache_store = MyOwnStore.new("parameter"\)) - reserved(module) class(Fragments) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - ident(base)operator(.)ident(class_eval) reserved(do) - class_variable(@@fragment_cache_store) operator(=) constant(MemoryStore)operator(.)ident(new) - ident(cattr_reader) symbol(:fragment_cache_store) - - reserved(def) pre_constant(self)operator(.)method(fragment_cache_store=)operator(()ident(store_option)operator(\)) - ident(store)operator(,) operator(*)ident(parameters) operator(=) operator(*)operator(()operator([) ident(store_option) operator(])operator(.)ident(flatten)operator(\)) - class_variable(@@fragment_cache_store) operator(=) reserved(if) ident(store)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - ident(store_class_name) operator(=) operator(()ident(store) operator(==) symbol(:drb_store) operator(?) string operator(:) ident(store)operator(.)ident(to_s)operator(.)ident(camelize)operator(\)) - ident(store_class) operator(=) constant(ActionController)operator(::)constant(Caching)operator(::)constant(Fragments)operator(.)ident(const_get)operator(()ident(store_class_name)operator(\)) - ident(store_class)operator(.)ident(new)operator(()operator(*)ident(parameters)operator(\)) - reserved(else) - ident(store) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(fragment_cache_key)operator(()ident(name)operator(\)) - ident(name)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(url_for)operator(()ident(name)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last) operator(:) ident(name) - reserved(end) - - comment(# Called by CacheHelper#cache) - reserved(def) method(cache_erb_fragment)operator(()ident(block)operator(,) ident(name) operator(=) operator({)operator(})operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) - reserved(unless) ident(perform_caching) reserved(then) ident(block)operator(.)ident(call)operator(;) reserved(return) reserved(end) - - ident(buffer) operator(=) ident(eval)operator(()stringoperator(,) ident(block)operator(.)ident(binding)operator(\)) - - reserved(if) ident(cache) operator(=) ident(read_fragment)operator(()ident(name)operator(,) ident(options)operator(\)) - ident(buffer)operator(.)ident(concat)operator(()ident(cache)operator(\)) - reserved(else) - ident(pos) operator(=) ident(buffer)operator(.)ident(length) - ident(block)operator(.)ident(call) - ident(write_fragment)operator(()ident(name)operator(,) ident(buffer)operator([)ident(pos)operator(..)integer(-1)operator(])operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(write_fragment)operator(()ident(name)operator(,) ident(content)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) - reserved(return) reserved(unless) ident(perform_caching) - - ident(key) operator(=) ident(fragment_cache_key)operator(()ident(name)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(benchmark) stringdelimiter(")> reserved(do) - ident(fragment_cache_store)operator(.)ident(write)operator(()ident(key)operator(,) ident(content)operator(,) ident(options)operator(\)) - reserved(end) - ident(content) - reserved(end) - - reserved(def) method(read_fragment)operator(()ident(name)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) - reserved(return) reserved(unless) ident(perform_caching) - - ident(key) operator(=) ident(fragment_cache_key)operator(()ident(name)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(benchmark) stringdelimiter(")> reserved(do) - ident(fragment_cache_store)operator(.)ident(read)operator(()ident(key)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - comment(# Name can take one of three forms:) - comment(# * String: This would normally take the form of a path like "pages/45/notes") - comment(# * Hash: Is treated as an implicit call to url_for, like { :controller => "pages", :action => "notes", :id => 45 }) - comment(# * Regexp: Will destroy all the matched fragments, example: %r{pages/\\d*/notes} Ensure you do not specify start and finish in the regex (^$\) because the actual filename matched looks like ./cache/filename/path.cache) - reserved(def) method(expire_fragment)operator(()ident(name)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) - reserved(return) reserved(unless) ident(perform_caching) - - ident(key) operator(=) ident(fragment_cache_key)operator(()ident(name)operator(\)) - - reserved(if) ident(key)operator(.)ident(is_a?)operator(()constant(Regexp)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(benchmark) stringdelimiter(")> reserved(do) - ident(fragment_cache_store)operator(.)ident(delete_matched)operator(()ident(key)operator(,) ident(options)operator(\)) - reserved(end) - reserved(else) - pre_constant(self)operator(.)ident(class)operator(.)ident(benchmark) stringdelimiter(")> reserved(do) - ident(fragment_cache_store)operator(.)ident(delete)operator(()ident(key)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Deprecated -- just call expire_fragment with a regular expression) - reserved(def) method(expire_matched_fragments)operator(()ident(matcher) operator(=) regexpoperator(,) ident(options) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(expire_fragment)operator(()ident(matcher)operator(,) ident(options)operator(\)) - reserved(end) - - - reserved(class) class(UnthreadedMemoryStore) comment(#:nodoc:) - reserved(def) method(initialize) comment(#:nodoc:) - instance_variable(@data) operator(=) operator({)operator(}) - reserved(end) - - reserved(def) method(read)operator(()ident(name)operator(,) ident(options)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@data)operator([)ident(name)operator(]) - reserved(end) - - reserved(def) method(write)operator(()ident(name)operator(,) ident(value)operator(,) ident(options)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@data)operator([)ident(name)operator(]) operator(=) ident(value) - reserved(end) - - reserved(def) method(delete)operator(()ident(name)operator(,) ident(options)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@data)operator(.)ident(delete)operator(()ident(name)operator(\)) - reserved(end) - - reserved(def) method(delete_matched)operator(()ident(matcher)operator(,) ident(options)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@data)operator(.)ident(delete_if) operator({) operator(|)ident(k)operator(,)ident(v)operator(|) ident(k) operator(=)operator(~) ident(matcher) operator(}) - reserved(end) - reserved(end) - - reserved(module) class(ThreadSafety) comment(#:nodoc:) - reserved(def) method(read)operator(()ident(name)operator(,) ident(options)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@mutex)operator(.)ident(synchronize) operator({) reserved(super) operator(}) - reserved(end) - - reserved(def) method(write)operator(()ident(name)operator(,) ident(value)operator(,) ident(options)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@mutex)operator(.)ident(synchronize) operator({) reserved(super) operator(}) - reserved(end) - - reserved(def) method(delete)operator(()ident(name)operator(,) ident(options)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@mutex)operator(.)ident(synchronize) operator({) reserved(super) operator(}) - reserved(end) - - reserved(def) method(delete_matched)operator(()ident(matcher)operator(,) ident(options)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@mutex)operator(.)ident(synchronize) operator({) reserved(super) operator(}) - reserved(end) - reserved(end) - - reserved(class) class(MemoryStore) operator(<) constant(UnthreadedMemoryStore) comment(#:nodoc:) - reserved(def) method(initialize) comment(#:nodoc:) - reserved(super) - reserved(if) constant(ActionController)operator(::)constant(Base)operator(.)ident(allow_concurrency) - instance_variable(@mutex) operator(=) constant(Mutex)operator(.)ident(new) - constant(MemoryStore)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(ThreadSafety)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(DRbStore) operator(<) constant(MemoryStore) comment(#:nodoc:) - ident(attr_reader) symbol(:address) - - reserved(def) method(initialize)operator(()ident(address) operator(=) stringoperator(\)) - reserved(super)operator(()operator(\)) - instance_variable(@address) operator(=) ident(address) - instance_variable(@data) operator(=) constant(DRbObject)operator(.)ident(new)operator(()pre_constant(nil)operator(,) ident(address)operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(MemCacheStore) operator(<) constant(MemoryStore) comment(#:nodoc:) - ident(attr_reader) symbol(:addresses) - - reserved(def) method(initialize)operator(()operator(*)ident(addresses)operator(\)) - reserved(super)operator(()operator(\)) - ident(addresses) operator(=) ident(addresses)operator(.)ident(flatten) - ident(addresses) operator(=) operator([)stringoperator(]) reserved(if) ident(addresses)operator(.)ident(empty?) - instance_variable(@addresses) operator(=) ident(addresses) - instance_variable(@data) operator(=) constant(MemCache)operator(.)ident(new)operator(()operator(*)ident(addresses)operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(UnthreadedFileStore) comment(#:nodoc:) - ident(attr_reader) symbol(:cache_path) - - reserved(def) method(initialize)operator(()ident(cache_path)operator(\)) - instance_variable(@cache_path) operator(=) ident(cache_path) - reserved(end) - - reserved(def) method(write)operator(()ident(name)operator(,) ident(value)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(ensure_cache_path)operator(()constant(File)operator(.)ident(dirname)operator(()ident(real_file_path)operator(()ident(name)operator(\))operator(\))operator(\)) - constant(File)operator(.)ident(open)operator(()ident(real_file_path)operator(()ident(name)operator(\))operator(,) stringoperator(\)) operator({) operator(|)ident(f)operator(|) ident(f)operator(.)ident(write)operator(()ident(value)operator(\)) operator(}) - reserved(rescue) operator(=)operator(>) ident(e) - constant(Base)operator(.)ident(logger)operator(.)ident(error) stringcontent( ()inlinecontent(\))delimiter(")> reserved(if) constant(Base)operator(.)ident(logger) - reserved(end) - - reserved(def) method(read)operator(()ident(name)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - constant(File)operator(.)ident(open)operator(()ident(real_file_path)operator(()ident(name)operator(\))operator(,) stringoperator(\)) operator({) operator(|)ident(f)operator(|) ident(f)operator(.)ident(read) operator(}) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(delete)operator(()ident(name)operator(,) ident(options)operator(\)) comment(#:nodoc:) - constant(File)operator(.)ident(delete)operator(()ident(real_file_path)operator(()ident(name)operator(\))operator(\)) - reserved(rescue) constant(SystemCallError) operator(=)operator(>) ident(e) - comment(# If there's no cache, then there's nothing to complain about) - reserved(end) - - reserved(def) method(delete_matched)operator(()ident(matcher)operator(,) ident(options)operator(\)) comment(#:nodoc:) - ident(search_dir)operator(()instance_variable(@cache_path)operator(\)) reserved(do) operator(|)ident(f)operator(|) - reserved(if) ident(f) operator(=)operator(~) ident(matcher) - reserved(begin) - constant(File)operator(.)ident(delete)operator(()ident(f)operator(\)) - reserved(rescue) constant(Object) operator(=)operator(>) ident(e) - comment(# If there's no cache, then there's nothing to complain about) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(real_file_path)operator(()ident(name)operator(\)) - string operator(%) operator([)instance_variable(@cache_path)operator(,) ident(name)operator(.)ident(gsub)operator(()stringoperator(,) stringoperator(\))operator(.)ident(gsub)operator(()stringoperator(,) stringoperator(\))operator(]) - reserved(end) - - reserved(def) method(ensure_cache_path)operator(()ident(path)operator(\)) - constant(FileUtils)operator(.)ident(makedirs)operator(()ident(path)operator(\)) reserved(unless) constant(File)operator(.)ident(exists?)operator(()ident(path)operator(\)) - reserved(end) - - reserved(def) method(search_dir)operator(()ident(dir)operator(,) operator(&)ident(callback)operator(\)) - constant(Dir)operator(.)ident(foreach)operator(()ident(dir)operator(\)) reserved(do) operator(|)ident(d)operator(|) - reserved(next) reserved(if) ident(d) operator(==) string operator(||) ident(d) operator(==) string - ident(name) operator(=) constant(File)operator(.)ident(join)operator(()ident(dir)operator(,) ident(d)operator(\)) - reserved(if) constant(File)operator(.)ident(directory?)operator(()ident(name)operator(\)) - ident(search_dir)operator(()ident(name)operator(,) operator(&)ident(callback)operator(\)) - reserved(else) - ident(callback)operator(.)ident(call) ident(name) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(FileStore) operator(<) constant(UnthreadedFileStore) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(cache_path)operator(\)) - reserved(super)operator(()ident(cache_path)operator(\)) - reserved(if) constant(ActionController)operator(::)constant(Base)operator(.)ident(allow_concurrency) - instance_variable(@mutex) operator(=) constant(Mutex)operator(.)ident(new) - constant(FileStore)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(ThreadSafety)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# Sweepers are the terminators of the caching world and responsible for expiring caches when model objects change.) - comment(# They do this by being half-observers, half-filters and implementing callbacks for both roles. A Sweeper example:) - comment(#) - comment(# class ListSweeper < ActionController::Caching::Sweeper) - comment(# observe List, Item) - comment(#) - comment(# def after_save(record\)) - comment(# list = record.is_a?(List\) ? record : record.list) - comment(# expire_page(:controller => "lists", :action => %w( show public feed \), :id => list.id\)) - comment(# expire_action(:controller => "lists", :action => "all"\)) - comment(# list.shares.each { |share| expire_page(:controller => "lists", :action => "show", :id => share.url_key\) }) - comment(# end) - comment(# end) - comment(#) - comment(# The sweeper is assigned in the controllers that wish to have its job performed using the cache_sweeper class method:) - comment(#) - comment(# class ListsController < ApplicationController) - comment(# caches_action :index, :show, :public, :feed) - comment(# cache_sweeper :list_sweeper, :only => [ :edit, :destroy, :share ]) - comment(# end) - comment(#) - comment(# In the example above, four actions are cached and three actions are responsible for expiring those caches.) - reserved(module) class(Sweeping) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - reserved(module) class(ClassMethods) comment(#:nodoc:) - reserved(def) method(cache_sweeper)operator(()operator(*)ident(sweepers)operator(\)) - reserved(return) reserved(unless) ident(perform_caching) - ident(configuration) operator(=) ident(sweepers)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(sweepers)operator(.)ident(pop) operator(:) operator({)operator(}) - ident(sweepers)operator(.)ident(each) reserved(do) operator(|)ident(sweeper)operator(|) - ident(observer)operator(()ident(sweeper)operator(\)) - - ident(sweeper_instance) operator(=) constant(Object)operator(.)ident(const_get)operator(()constant(Inflector)operator(.)ident(classify)operator(()ident(sweeper)operator(\))operator(\))operator(.)ident(instance) - - reserved(if) ident(sweeper_instance)operator(.)ident(is_a?)operator(()constant(Sweeper)operator(\)) - ident(around_filter)operator(()ident(sweeper_instance)operator(,) symbol(:only) operator(=)operator(>) ident(configuration)operator([)symbol(:only)operator(])operator(\)) - reserved(else) - ident(after_filter)operator(()ident(sweeper_instance)operator(,) symbol(:only) operator(=)operator(>) ident(configuration)operator([)symbol(:only)operator(])operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(if) reserved(defined?)operator(()constant(ActiveRecord)operator(\)) reserved(and) reserved(defined?)operator(()constant(ActiveRecord)operator(::)constant(Observer)operator(\)) - reserved(class) class(Sweeper) operator(<) constant(ActiveRecord)operator(::)constant(Observer) comment(#:nodoc:) - ident(attr_accessor) symbol(:controller) - - comment(# ActiveRecord::Observer will mark this class as reloadable even though it should not be.) - comment(# However, subclasses of ActionController::Caching::Sweeper should be Reloadable) - ident(include) constant(Reloadable)operator(::)constant(Subclasses) - - reserved(def) method(before)operator(()ident(controller)operator(\)) - pre_constant(self)operator(.)ident(controller) operator(=) ident(controller) - ident(callback)operator(()symbol(:before)operator(\)) - reserved(end) - - reserved(def) method(after)operator(()ident(controller)operator(\)) - ident(callback)operator(()symbol(:after)operator(\)) - comment(# Clean up, so that the controller can be collected after this request) - pre_constant(self)operator(.)ident(controller) operator(=) pre_constant(nil) - reserved(end) - - ident(private) - reserved(def) method(callback)operator(()ident(timing)operator(\)) - ident(controller_callback_method_name) operator(=) stringcontent(_)inlinedelimiter(")> - ident(action_callback_method_name) operator(=) stringcontent(_)inlinedelimiter(")> - - ident(send)operator(()ident(controller_callback_method_name)operator(\)) reserved(if) ident(respond_to?)operator(()ident(controller_callback_method_name)operator(\)) - ident(send)operator(()ident(action_callback_method_name)operator(\)) reserved(if) ident(respond_to?)operator(()ident(action_callback_method_name)operator(\)) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(method)operator(,) operator(*)ident(arguments)operator(\)) - reserved(return) reserved(if) instance_variable(@controller)operator(.)ident(nil?) - instance_variable(@controller)operator(.)ident(send)operator(()ident(method)operator(,) operator(*)ident(arguments)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -comment(# Wrapper around the CGIMethods that have been secluded to allow testing without ) -comment(# an instantiated CGI object) -reserved(class) class(CGI) comment(#:nodoc:) - reserved(class) operator(<<) class(self) - reserved(alias) symbol(:escapeHTML_fail_on_nil) symbol(:escapeHTML) - - reserved(def) method(escapeHTML)operator(()ident(string)operator(\)) - ident(escapeHTML_fail_on_nil)operator(()ident(string)operator(\)) reserved(unless) ident(string)operator(.)ident(nil?) - reserved(end) - reserved(end) - - comment(# Returns a parameter hash including values from both the request (POST/GET\)) - comment(# and the query string with the latter taking precedence.) - reserved(def) method(parameters) - ident(request_parameters)operator(.)ident(update)operator(()ident(query_parameters)operator(\)) - reserved(end) - - reserved(def) method(query_parameters) - constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()ident(query_string)operator(\)) - reserved(end) - - reserved(def) method(request_parameters) - constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()ident(params)operator(,) ident(env_table)operator(\)) - reserved(end) - - reserved(def) method(redirect)operator(()ident(where)operator(\)) - ident(header)operator(()operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringdelimiter(")> - operator(})operator(\)) - reserved(end) - - reserved(def) method(session)operator(()ident(parameters) operator(=) pre_constant(nil)operator(\)) - ident(parameters) operator(=) operator({)operator(}) reserved(if) ident(parameters)operator(.)ident(nil?) - ident(parameters)operator([)stringoperator(]) operator(=) constant(CGI)operator(::)constant(Session)operator(::)constant(PStore) - constant(CGI)operator(::)constant(Session)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(parameters)operator(\)) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -comment(# Static methods for parsing the query and request parameters that can be used in) -comment(# a CGI extension class or testing in isolation.) -reserved(class) class(CGIMethods) comment(#:nodoc:) - ident(public) - comment(# Returns a hash with the pairs from the query string. The implicit hash construction that is done in) - comment(# parse_request_params is not done here.) - reserved(def) constant(CGIMethods)operator(.)method(parse_query_parameters)operator(()ident(query_string)operator(\)) - ident(parsed_params) operator(=) operator({)operator(}) - - ident(query_string)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(each) operator({) operator(|)ident(p)operator(|) - comment(# Ignore repeated delimiters.) - reserved(next) reserved(if) ident(p)operator(.)ident(empty?) - - ident(k)operator(,) ident(v) operator(=) ident(p)operator(.)ident(split)operator(()stringoperator(,)integer(2)operator(\)) - ident(v) operator(=) pre_constant(nil) reserved(if) operator(()ident(v) operator(&&) ident(v)operator(.)ident(empty?)operator(\)) - - ident(k) operator(=) constant(CGI)operator(.)ident(unescape)operator(()ident(k)operator(\)) reserved(if) ident(k) - ident(v) operator(=) constant(CGI)operator(.)ident(unescape)operator(()ident(v)operator(\)) reserved(if) ident(v) - - reserved(unless) ident(k)operator(.)ident(include?)operator(()integer(?[)operator(\)) - ident(parsed_params)operator([)ident(k)operator(]) operator(=) ident(v) - reserved(else) - ident(keys) operator(=) ident(split_key)operator(()ident(k)operator(\)) - ident(last_key) operator(=) ident(keys)operator(.)ident(pop) - ident(last_key) operator(=) ident(keys)operator(.)ident(pop) reserved(if) operator(()ident(use_array) operator(=) ident(last_key)operator(.)ident(empty?)operator(\)) - ident(parent) operator(=) ident(keys)operator(.)ident(inject)operator(()ident(parsed_params)operator(\)) operator({)operator(|)ident(h)operator(,) ident(k)operator(|) ident(h)operator([)ident(k)operator(]) operator(||=) operator({)operator(})operator(}) - - reserved(if) ident(use_array) reserved(then) operator(()ident(parent)operator([)ident(last_key)operator(]) operator(||=) operator([)operator(])operator(\)) operator(<<) ident(v) - reserved(else) ident(parent)operator([)ident(last_key)operator(]) operator(=) ident(v) - reserved(end) - reserved(end) - operator(}) - - ident(parsed_params) - reserved(end) - - comment(# Returns the request (POST/GET\) parameters in a parsed form where pairs such as "customer[address][street]" / ) - comment(# "Somewhere cool!" are translated into a full hash hierarchy, like) - comment(# { "customer" => { "address" => { "street" => "Somewhere cool!" } } }) - reserved(def) constant(CGIMethods)operator(.)method(parse_request_parameters)operator(()ident(params)operator(\)) - ident(parsed_params) operator(=) operator({)operator(}) - - reserved(for) ident(key)operator(,) ident(value) reserved(in) ident(params) - ident(value) operator(=) operator([)ident(value)operator(]) reserved(if) ident(key) operator(=)operator(~) regexp - reserved(unless) ident(key)operator(.)ident(include?)operator(()stringoperator(\)) - comment(# much faster to test for the most common case first (GET\)) - comment(# and avoid the call to build_deep_hash) - ident(parsed_params)operator([)ident(key)operator(]) operator(=) ident(get_typed_value)operator(()ident(value)operator([)integer(0)operator(])operator(\)) - reserved(else) - ident(build_deep_hash)operator(()ident(get_typed_value)operator(()ident(value)operator([)integer(0)operator(])operator(\))operator(,) ident(parsed_params)operator(,) ident(get_levels)operator(()ident(key)operator(\))operator(\)) - reserved(end) - reserved(end) - - ident(parsed_params) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(parse_formatted_request_parameters)operator(()ident(mime_type)operator(,) ident(raw_post_data)operator(\)) - ident(params) operator(=) reserved(case) ident(strategy) operator(=) constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator([)ident(mime_type)operator(]) - reserved(when) constant(Proc) - ident(strategy)operator(.)ident(call)operator(()ident(raw_post_data)operator(\)) - reserved(when) symbol(:xml_simple) - ident(raw_post_data)operator(.)ident(blank?) operator(?) pre_constant(nil) operator(:) - ident(typecast_xml_value)operator(()constant(XmlSimple)operator(.)ident(xml_in)operator(()ident(raw_post_data)operator(,) - string operator(=)operator(>) pre_constant(false)operator(,) - string operator(=)operator(>) pre_constant(true)operator(,) - string operator(=)operator(>) pre_constant(true)operator(,) - string operator(=)operator(>) stringoperator(\))operator(\)) - reserved(when) symbol(:yaml) - constant(YAML)operator(.)ident(load)operator(()ident(raw_post_data)operator(\)) - reserved(when) symbol(:xml_node) - ident(node) operator(=) constant(XmlNode)operator(.)ident(from_xml)operator(()ident(raw_post_data)operator(\)) - operator({) ident(node)operator(.)ident(node_name) operator(=)operator(>) ident(node) operator(}) - reserved(end) - - ident(dasherize_keys)operator(()ident(params) operator(||) operator({)operator(})operator(\)) - reserved(rescue) constant(Object) operator(=)operator(>) ident(e) - operator({) string operator(=)operator(>) stringcontent( ()inlinecontent(\))delimiter(")>operator(,) string operator(=)operator(>) ident(e)operator(.)ident(backtrace)operator(,) - string operator(=)operator(>) ident(raw_post_data)operator(,) string operator(=)operator(>) ident(mime_type) operator(}) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(typecast_xml_value)operator(()ident(value)operator(\)) - reserved(case) ident(value) - reserved(when) constant(Hash) - reserved(if) ident(value)operator(.)ident(has_key?)operator(()stringoperator(\)) - ident(content) operator(=) ident(translate_xml_entities)operator(()ident(value)operator([)stringoperator(])operator(\)) - reserved(case) ident(value)operator([)stringoperator(]) - reserved(when) string reserved(then) ident(content)operator(.)ident(to_i) - reserved(when) string reserved(then) ident(content) operator(==) string - reserved(when) string reserved(then) constant(Time)operator(.)ident(parse)operator(()ident(content)operator(\)) - reserved(when) string reserved(then) constant(Date)operator(.)ident(parse)operator(()ident(content)operator(\)) - reserved(else) ident(content) - reserved(end) - reserved(else) - ident(value)operator(.)ident(empty?) operator(?) pre_constant(nil) operator(:) ident(value)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(h)operator(,)operator(()ident(k)operator(,)ident(v)operator(\))operator(|) - ident(h)operator([)ident(k)operator(]) operator(=) ident(typecast_xml_value)operator(()ident(v)operator(\)) - ident(h) - reserved(end) - reserved(end) - reserved(when) constant(Array) - ident(value)operator(.)ident(map!) operator({) operator(|)ident(i)operator(|) ident(typecast_xml_value)operator(()ident(i)operator(\)) operator(}) - reserved(case) ident(value)operator(.)ident(length) - reserved(when) integer(0) reserved(then) pre_constant(nil) - reserved(when) integer(1) reserved(then) ident(value)operator(.)ident(first) - reserved(else) ident(value) - reserved(end) - reserved(else) - ident(raise) stringdelimiter(")> - reserved(end) - reserved(end) - - ident(private) - - reserved(def) pre_constant(self)operator(.)method(translate_xml_entities)operator(()ident(value)operator(\)) - ident(value)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.) - ident(gsub)operator(()regexpoperator(,) string)delimiter(")>operator(\))operator(.) - ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.) - ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.) - ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(dasherize_keys)operator(()ident(params)operator(\)) - reserved(case) ident(params)operator(.)ident(class)operator(.)ident(to_s) - reserved(when) string - ident(params)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(h)operator(,)operator(()ident(k)operator(,)ident(v)operator(\))operator(|) - ident(h)operator([)ident(k)operator(.)ident(to_s)operator(.)ident(tr)operator(()stringoperator(,) stringoperator(\))operator(]) operator(=) ident(dasherize_keys)operator(()ident(v)operator(\)) - ident(h) - reserved(end) - reserved(when) string - ident(params)operator(.)ident(map) operator({) operator(|)ident(v)operator(|) ident(dasherize_keys)operator(()ident(v)operator(\)) operator(}) - reserved(else) - ident(params) - reserved(end) - reserved(end) - - comment(# Splits the given key into several pieces. Example keys are 'name', 'person[name]',) - comment(# 'person[name][first]', and 'people[]'. In each instance, an Array instance is returned.) - comment(# 'person[name][first]' produces ['person', 'name', 'first']; 'people[]' produces ['people', '']) - reserved(def) constant(CGIMethods)operator(.)method(split_key)operator(()ident(key)operator(\)) - reserved(if) regexp operator(=)operator(~) ident(key) - ident(keys) operator(=) operator([)global_variable($1)operator(]) - - ident(keys)operator(.)ident(concat)operator(()global_variable($2)operator([)integer(1)operator(..)integer(-2)operator(])operator(.)ident(split)operator(()stringoperator(\))operator(\)) - ident(keys) operator(<<) string reserved(if) ident(key)operator([)integer(-2)operator(..)integer(-1)operator(]) operator(==) string comment(# Have to add it since split will drop empty strings) - - ident(keys) - reserved(else) - operator([)ident(key)operator(]) - reserved(end) - reserved(end) - - reserved(def) constant(CGIMethods)operator(.)method(get_typed_value)operator(()ident(value)operator(\)) - comment(# test most frequent case first) - reserved(if) ident(value)operator(.)ident(is_a?)operator(()constant(String)operator(\)) - ident(value) - reserved(elsif) ident(value)operator(.)ident(respond_to?)operator(()symbol(:content_type)operator(\)) operator(&&) operator(!) ident(value)operator(.)ident(content_type)operator(.)ident(blank?) - comment(# Uploaded file) - reserved(unless) ident(value)operator(.)ident(respond_to?)operator(()symbol(:full_original_filename)operator(\)) - reserved(class) operator(<<) class(value) - ident(alias_method) symbol(:full_original_filename)operator(,) symbol(:original_filename) - - comment(# Take the basename of the upload's original filename.) - comment(# This handles the full Windows paths given by Internet Explorer) - comment(# (and perhaps other broken user agents\) without affecting) - comment(# those which give the lone filename.) - comment(# The Windows regexp is adapted from Perl's File::Basename.) - reserved(def) method(original_filename) - reserved(if) ident(md) operator(=) regexpoperator(.)ident(match)operator(()ident(full_original_filename)operator(\)) - ident(md)operator(.)ident(captures)operator(.)ident(first) - reserved(else) - constant(File)operator(.)ident(basename) ident(full_original_filename) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# Return the same value after overriding original_filename.) - ident(value) - - reserved(elsif) ident(value)operator(.)ident(respond_to?)operator(()symbol(:read)operator(\)) - comment(# Value as part of a multipart request) - ident(value)operator(.)ident(read) - reserved(elsif) ident(value)operator(.)ident(class) operator(==) constant(Array) - ident(value)operator(.)ident(collect) operator({) operator(|)ident(v)operator(|) constant(CGIMethods)operator(.)ident(get_typed_value)operator(()ident(v)operator(\)) operator(}) - reserved(else) - comment(# other value (neither string nor a multipart request\)) - ident(value)operator(.)ident(to_s) - reserved(end) - reserved(end) - - constant(PARAMS_HASH_RE) operator(=) regexp - reserved(def) constant(CGIMethods)operator(.)method(get_levels)operator(()ident(key)operator(\)) - ident(all)operator(,) ident(main)operator(,) ident(bracketed)operator(,) ident(trailing) operator(=) constant(PARAMS_HASH_RE)operator(.)ident(match)operator(()ident(key)operator(\))operator(.)ident(to_a) - reserved(if) ident(main)operator(.)ident(nil?) - operator([)operator(]) - reserved(elsif) ident(trailing) - operator([)ident(key)operator(]) - reserved(elsif) ident(bracketed) - operator([)ident(main)operator(]) operator(+) ident(bracketed)operator(.)ident(slice)operator(()integer(1)operator(...)integer(-1)operator(\))operator(.)ident(split)operator(()stringoperator(\)) - reserved(else) - operator([)ident(main)operator(]) - reserved(end) - reserved(end) - - reserved(def) constant(CGIMethods)operator(.)method(build_deep_hash)operator(()ident(value)operator(,) ident(hash)operator(,) ident(levels)operator(\)) - reserved(if) ident(levels)operator(.)ident(length) operator(==) integer(0) - ident(value) - reserved(elsif) ident(hash)operator(.)ident(nil?) - operator({) ident(levels)operator(.)ident(first) operator(=)operator(>) constant(CGIMethods)operator(.)ident(build_deep_hash)operator(()ident(value)operator(,) pre_constant(nil)operator(,) ident(levels)operator([)integer(1)operator(..)integer(-1)operator(])operator(\)) operator(}) - reserved(else) - ident(hash)operator(.)ident(update)operator(()operator({) ident(levels)operator(.)ident(first) operator(=)operator(>) constant(CGIMethods)operator(.)ident(build_deep_hash)operator(()ident(value)operator(,) ident(hash)operator([)ident(levels)operator(.)ident(first)operator(])operator(,) ident(levels)operator([)integer(1)operator(..)integer(-1)operator(])operator(\)) operator(})operator(\)) - reserved(end) - reserved(end) -reserved(end) -constant(CGI)operator(.)ident(module_eval) operator({) ident(remove_const) string operator(}) - -reserved(class) class(CGI) comment(#:nodoc:) - comment(# This is a cookie class that fixes the performance problems with the default one that ships with 1.8.1 and below.) - comment(# It replaces the inheritance on SimpleDelegator with DelegateClass(Array\) following the suggestion from Matz on) - comment(# http://groups.google.com/groups?th=e3a4e68ba042f842&seekm=c3sioe%241qvm%241%40news.cybercity.dk#link14) - reserved(class) class(Cookie) operator(<) ident(DelegateClass)operator(()constant(Array)operator(\)) - comment(# Create a new CGI::Cookie object.) - comment(#) - comment(# The contents of the cookie can be specified as a +name+ and one) - comment(# or more +value+ arguments. Alternatively, the contents can) - comment(# be specified as a single hash argument. The possible keywords of) - comment(# this hash are as follows:) - comment(#) - comment(# name:: the name of the cookie. Required.) - comment(# value:: the cookie's value or list of values.) - comment(# path:: the path for which this cookie applies. Defaults to the) - comment(# base directory of the CGI script.) - comment(# domain:: the domain for which this cookie applies.) - comment(# expires:: the time at which this cookie expires, as a +Time+ object.) - comment(# secure:: whether this cookie is a secure cookie or not (default to) - comment(# false\). Secure cookies are only transmitted to HTTPS ) - comment(# servers.) - comment(#) - comment(# These keywords correspond to attributes of the cookie object.) - reserved(def) method(initialize)operator(()ident(name) operator(=) stringoperator(,) operator(*)ident(value)operator(\)) - reserved(if) ident(name)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) - instance_variable(@name) operator(=) ident(name) - instance_variable(@value) operator(=) ident(Array)operator(()ident(value)operator(\)) - instance_variable(@domain) operator(=) pre_constant(nil) - instance_variable(@expires) operator(=) pre_constant(nil) - instance_variable(@secure) operator(=) pre_constant(false) - instance_variable(@path) operator(=) pre_constant(nil) - reserved(else) - instance_variable(@name) operator(=) ident(name)operator([)stringoperator(]) - instance_variable(@value) operator(=) ident(Array)operator(()ident(name)operator([)stringoperator(])operator(\)) - instance_variable(@domain) operator(=) ident(name)operator([)stringoperator(]) - instance_variable(@expires) operator(=) ident(name)operator([)stringoperator(]) - instance_variable(@secure) operator(=) ident(name)operator([)stringoperator(]) operator(||) pre_constant(false) - instance_variable(@path) operator(=) ident(name)operator([)stringoperator(]) - reserved(end) - - reserved(unless) instance_variable(@name) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - comment(# simple support for IE) - reserved(unless) instance_variable(@path) - regexpoperator(.)ident(match)operator(()pre_constant(ENV)operator([)stringoperator(])operator(\)) - instance_variable(@path) operator(=) operator(()global_variable($1) reserved(or) stringoperator(\)) - reserved(end) - - reserved(super)operator(()instance_variable(@value)operator(\)) - reserved(end) - - reserved(def) method(__setobj__)operator(()ident(obj)operator(\)) - instance_variable(@_dc_obj) operator(=) ident(obj) - reserved(end) - - ident(attr_accessor)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) - ident(attr_reader)operator(()stringoperator(\)) - - comment(# Set whether the Cookie is a secure cookie or not.) - comment(#) - comment(# +val+ must be a boolean.) - reserved(def) method(secure=)operator(()ident(val)operator(\)) - instance_variable(@secure) operator(=) ident(val) reserved(if) ident(val) operator(==) pre_constant(true) reserved(or) ident(val) operator(==) pre_constant(false) - instance_variable(@secure) - reserved(end) - - comment(# Convert the Cookie to its string representation.) - reserved(def) method(to_s) - ident(buf) operator(=) string - ident(buf) operator(<<) instance_variable(@name) operator(<<) string - - reserved(if) instance_variable(@value)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) - ident(buf) operator(<<) constant(CGI)operator(::)ident(escape)operator(()instance_variable(@value)operator(\)) - reserved(else) - ident(buf) operator(<<) instance_variable(@value)operator(.)ident(collect)operator({)operator(|)ident(v)operator(|) constant(CGI)operator(::)ident(escape)operator(()ident(v)operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(if) instance_variable(@domain) - ident(buf) operator(<<) string operator(<<) instance_variable(@domain) - reserved(end) - - reserved(if) instance_variable(@path) - ident(buf) operator(<<) string operator(<<) instance_variable(@path) - reserved(end) - - reserved(if) instance_variable(@expires) - ident(buf) operator(<<) string operator(<<) constant(CGI)operator(::)ident(rfc1123_date)operator(()instance_variable(@expires)operator(\)) - reserved(end) - - reserved(if) instance_variable(@secure) operator(==) pre_constant(true) - ident(buf) operator(<<) string - reserved(end) - - ident(buf) - reserved(end) - - comment(# Parse a raw cookie string into a hash of cookie-name=>Cookie) - comment(# pairs.) - comment(#) - comment(# cookies = CGI::Cookie::parse("raw_cookie_string"\)) - comment(# # { "name1" => cookie1, "name2" => cookie2, ... }) - comment(#) - reserved(def) pre_constant(self)operator(.)method(parse)operator(()ident(raw_cookie)operator(\)) - ident(cookies) operator(=) constant(Hash)operator(.)ident(new)operator(()operator([)operator(])operator(\)) - - reserved(if) ident(raw_cookie) - ident(raw_cookie)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(pairs)operator(|) - ident(name)operator(,) ident(values) operator(=) ident(pairs)operator(.)ident(split)operator(()stringoperator(,)integer(2)operator(\)) - reserved(next) reserved(unless) ident(name) reserved(and) ident(values) - ident(name) operator(=) constant(CGI)operator(::)ident(unescape)operator(()ident(name)operator(\)) - ident(values) operator(=) ident(values)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(collect!)operator({)operator(|)ident(v)operator(|) constant(CGI)operator(::)ident(unescape)operator(()ident(v)operator(\)) operator(}) - reserved(unless) ident(cookies)operator(.)ident(has_key?)operator(()ident(name)operator(\)) - ident(cookies)operator([)ident(name)operator(]) operator(=) ident(new)operator(()ident(name)operator(,) operator(*)ident(values)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - ident(cookies) - reserved(end) - reserved(end) comment(# class Cookie) -reserved(end) -reserved(class) class(CGI) comment(#:nodoc:) - comment(# Add @request.env['RAW_POST_DATA'] for the vegans.) - reserved(module) class(QueryExtension) - comment(# Initialize the data from the query.) - comment(#) - comment(# Handles multipart forms (in particular, forms that involve file uploads\).) - comment(# Reads query parameters in the @params field, and cookies into @cookies.) - reserved(def) method(initialize_query)operator(()operator(\)) - instance_variable(@cookies) operator(=) constant(CGI)operator(::)constant(Cookie)operator(::)ident(parse)operator(()ident(env_table)operator([)stringoperator(]) operator(||) ident(env_table)operator([)stringoperator(])operator(\)) - - comment(#fix some strange request environments) - reserved(if) ident(method) operator(=) ident(env_table)operator([)stringoperator(]) - ident(method) operator(=) ident(method)operator(.)ident(to_s)operator(.)ident(downcase)operator(.)ident(intern) - reserved(else) - ident(method) operator(=) symbol(:get) - reserved(end) - - reserved(if) ident(method) operator(==) symbol(:post) operator(&&) operator(()ident(boundary) operator(=) ident(multipart_form_boundary)operator(\)) - instance_variable(@multipart) operator(=) pre_constant(true) - instance_variable(@params) operator(=) ident(read_multipart)operator(()ident(boundary)operator(,) ident(Integer)operator(()ident(env_table)operator([)stringoperator(])operator(\))operator(\)) - reserved(else) - instance_variable(@multipart) operator(=) pre_constant(false) - instance_variable(@params) operator(=) constant(CGI)operator(::)ident(parse)operator(()ident(read_query_params)operator(()ident(method)operator(\)) operator(||) stringoperator(\)) - reserved(end) - reserved(end) - - ident(private) - reserved(unless) reserved(defined?)operator(()constant(MULTIPART_FORM_BOUNDARY_RE)operator(\)) - constant(MULTIPART_FORM_BOUNDARY_RE) operator(=) regexp comment(#") - reserved(end) - - reserved(def) method(multipart_form_boundary) - constant(MULTIPART_FORM_BOUNDARY_RE)operator(.)ident(match)operator(()ident(env_table)operator([)stringoperator(])operator(\))operator(.)ident(to_a)operator(.)ident(pop) - reserved(end) - - reserved(if) reserved(defined?) constant(MOD_RUBY) - reserved(def) method(read_params_from_query) - constant(Apache)operator(::)ident(request)operator(.)ident(args) operator(||) string - reserved(end) - reserved(else) - reserved(def) method(read_params_from_query) - comment(# fixes CGI querystring parsing for lighttpd) - ident(env_qs) operator(=) ident(env_table)operator([)stringoperator(]) - reserved(if) ident(env_qs)operator(.)ident(blank?) operator(&&) operator(!)operator(()ident(uri) operator(=) ident(env_table)operator([)stringoperator(])operator(\))operator(.)ident(blank?) - ident(uri)operator(.)ident(split)operator(()stringoperator(,) integer(2)operator(\))operator([)integer(1)operator(]) operator(||) string - reserved(else) - ident(env_qs) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(read_params_from_post) - ident(stdinput)operator(.)ident(binmode) reserved(if) ident(stdinput)operator(.)ident(respond_to?)operator(()symbol(:binmode)operator(\)) - ident(content) operator(=) ident(stdinput)operator(.)ident(read)operator(()ident(Integer)operator(()ident(env_table)operator([)stringoperator(])operator(\))operator(\)) operator(||) string - comment(# fix for Safari Ajax postings that always append \\000) - ident(content)operator(.)ident(chop!) reserved(if) ident(content)operator([)integer(-1)operator(]) operator(==) integer(0) - ident(content)operator(.)ident(gsub!) regexpoperator(,) string - ident(env_table)operator([)stringoperator(]) operator(=) ident(content)operator(.)ident(freeze) - reserved(end) - - reserved(def) method(read_query_params)operator(()ident(method)operator(\)) - reserved(case) ident(method) - reserved(when) symbol(:get) - ident(read_params_from_query) - reserved(when) symbol(:post)operator(,) symbol(:put) - ident(read_params_from_post) - reserved(when) symbol(:cmd) - ident(read_from_cmdline) - reserved(else) comment(# when :head, :delete, :options) - ident(read_params_from_query) - reserved(end) - reserved(end) - reserved(end) comment(# module QueryExtension) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActionController) comment(#:nodoc:) - reserved(class) class(Base) - comment(# Process a request extracted from an CGI object and return a response. Pass false as session_options to disable) - comment(# sessions (large performance increase if sessions are not needed\). The session_options are the same as for CGI::Session:) - comment(#) - comment(# * :database_manager - standard options are CGI::Session::FileStore, CGI::Session::MemoryStore, and CGI::Session::PStore) - comment(# (default\). Additionally, there is CGI::Session::DRbStore and CGI::Session::ActiveRecordStore. Read more about these in ) - comment(# lib/action_controller/session.) - comment(# * :session_key - the parameter name used for the session id. Defaults to '_session_id'.) - comment(# * :session_id - the session id to use. If not provided, then it is retrieved from the +session_key+ parameter) - comment(# of the request, or automatically generated for a new session.) - comment(# * :new_session - if true, force creation of a new session. If not set, a new session is only created if none currently) - comment(# exists. If false, a new session is never created, and if none currently exists and the +session_id+ option is not set, ) - comment(# an ArgumentError is raised.) - comment(# * :session_expires - the time the current session expires, as a +Time+ object. If not set, the session will continue) - comment(# indefinitely.) - comment(# * :session_domain - the hostname domain for which this session is valid. If not set, defaults to the hostname of the) - comment(# server.) - comment(# * :session_secure - if +true+, this session will only work over HTTPS.) - comment(# * :session_path - the path for which this session applies. Defaults to the directory of the CGI script.) - reserved(def) pre_constant(self)operator(.)method(process_cgi)operator(()ident(cgi) operator(=) constant(CGI)operator(.)ident(new)operator(,) ident(session_options) operator(=) operator({)operator(})operator(\)) - ident(new)operator(.)ident(process_cgi)operator(()ident(cgi)operator(,) ident(session_options)operator(\)) - reserved(end) - - reserved(def) method(process_cgi)operator(()ident(cgi)operator(,) ident(session_options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(process)operator(()constant(CgiRequest)operator(.)ident(new)operator(()ident(cgi)operator(,) ident(session_options)operator(\))operator(,) constant(CgiResponse)operator(.)ident(new)operator(()ident(cgi)operator(\))operator(\))operator(.)ident(out) - reserved(end) - reserved(end) - - reserved(class) class(CgiRequest) operator(<) constant(AbstractRequest) comment(#:nodoc:) - ident(attr_accessor) symbol(:cgi)operator(,) symbol(:session_options) - - constant(DEFAULT_SESSION_OPTIONS) operator(=) operator({) - symbol(:database_manager) operator(=)operator(>) constant(CGI)operator(::)constant(Session)operator(::)constant(PStore)operator(,) - symbol(:prefix) operator(=)operator(>) stringoperator(,) - symbol(:session_path) operator(=)operator(>) string - operator(}) reserved(unless) ident(const_defined?)operator(()symbol(:DEFAULT_SESSION_OPTIONS)operator(\)) - - reserved(def) method(initialize)operator(()ident(cgi)operator(,) ident(session_options) operator(=) operator({)operator(})operator(\)) - instance_variable(@cgi) operator(=) ident(cgi) - instance_variable(@session_options) operator(=) ident(session_options) - instance_variable(@env) operator(=) instance_variable(@cgi)operator(.)ident(send)operator(()symbol(:env_table)operator(\)) - reserved(super)operator(()operator(\)) - reserved(end) - - reserved(def) method(query_string) - reserved(if) operator(()ident(qs) operator(=) instance_variable(@cgi)operator(.)ident(query_string)operator(\)) operator(&&) operator(!)ident(qs)operator(.)ident(empty?) - ident(qs) - reserved(elsif) ident(uri) operator(=) instance_variable(@env)operator([)stringoperator(]) - ident(parts) operator(=) ident(uri)operator(.)ident(split)operator(()stringoperator(\)) - ident(parts)operator(.)ident(shift) - ident(parts)operator(.)ident(join)operator(()stringoperator(\)) - reserved(else) - instance_variable(@env)operator([)stringoperator(]) operator(||) string - reserved(end) - reserved(end) - - reserved(def) method(query_parameters) - operator(()ident(qs) operator(=) pre_constant(self)operator(.)ident(query_string)operator(\))operator(.)ident(empty?) operator(?) operator({)operator(}) operator(:) constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()ident(qs)operator(\)) - reserved(end) - - reserved(def) method(request_parameters) - instance_variable(@request_parameters) operator(||=) - reserved(if) constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator(.)ident(has_key?)operator(()ident(content_type)operator(\)) - constant(CGIMethods)operator(.)ident(parse_formatted_request_parameters)operator(()ident(content_type)operator(,) instance_variable(@env)operator([)stringoperator(])operator(\)) - reserved(else) - constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()instance_variable(@cgi)operator(.)ident(params)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(cookies) - instance_variable(@cgi)operator(.)ident(cookies)operator(.)ident(freeze) - reserved(end) - - reserved(def) method(host_with_port) - reserved(if) ident(forwarded) operator(=) ident(env)operator([)stringoperator(]) - ident(forwarded)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(last) - reserved(elsif) ident(http_host) operator(=) ident(env)operator([)stringoperator(]) - ident(http_host) - reserved(elsif) ident(server_name) operator(=) ident(env)operator([)stringoperator(]) - ident(server_name) - reserved(else) - stringoperator(])inline_delimiter(})>content(:)inlineoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(host) - ident(host_with_port)operator([)regexpoperator(]) - reserved(end) - - reserved(def) method(port) - reserved(if) ident(host_with_port) operator(=)operator(~) regexp - global_variable($1)operator(.)ident(to_i) - reserved(else) - ident(standard_port) - reserved(end) - reserved(end) - - reserved(def) method(session) - reserved(unless) instance_variable(@session) - reserved(if) instance_variable(@session_options) operator(==) pre_constant(false) - instance_variable(@session) operator(=) constant(Hash)operator(.)ident(new) - reserved(else) - ident(stale_session_check!) reserved(do) - reserved(if) ident(session_options_with_string_keys)operator([)stringoperator(]) operator(==) pre_constant(true) - instance_variable(@session) operator(=) ident(new_session) - reserved(else) - instance_variable(@session) operator(=) constant(CGI)operator(::)constant(Session)operator(.)ident(new)operator(()instance_variable(@cgi)operator(,) ident(session_options_with_string_keys)operator(\)) - reserved(end) - instance_variable(@session)operator([)stringoperator(]) - reserved(end) - reserved(end) - reserved(end) - instance_variable(@session) - reserved(end) - - reserved(def) method(reset_session) - instance_variable(@session)operator(.)ident(delete) reserved(if) constant(CGI)operator(::)constant(Session) operator(===) instance_variable(@session) - instance_variable(@session) operator(=) ident(new_session) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(method_id)operator(,) operator(*)ident(arguments)operator(\)) - instance_variable(@cgi)operator(.)ident(send)operator(()ident(method_id)operator(,) operator(*)ident(arguments)operator(\)) reserved(rescue) reserved(super) - reserved(end) - - ident(private) - comment(# Delete an old session if it exists then create a new one.) - reserved(def) method(new_session) - reserved(if) instance_variable(@session_options) operator(==) pre_constant(false) - constant(Hash)operator(.)ident(new) - reserved(else) - constant(CGI)operator(::)constant(Session)operator(.)ident(new)operator(()instance_variable(@cgi)operator(,) ident(session_options_with_string_keys)operator(.)ident(merge)operator(()string operator(=)operator(>) pre_constant(false)operator(\))operator(\))operator(.)ident(delete) reserved(rescue) pre_constant(nil) - constant(CGI)operator(::)constant(Session)operator(.)ident(new)operator(()instance_variable(@cgi)operator(,) ident(session_options_with_string_keys)operator(.)ident(merge)operator(()string operator(=)operator(>) pre_constant(true)operator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(stale_session_check!) - reserved(yield) - reserved(rescue) constant(ArgumentError) operator(=)operator(>) ident(argument_error) - reserved(if) ident(argument_error)operator(.)ident(message) operator(=)operator(~) regexp - reserved(begin) - constant(Module)operator(.)ident(const_missing)operator(()global_variable($1)operator(\)) - reserved(rescue) constant(LoadError)operator(,) constant(NameError) operator(=)operator(>) ident(const_error) - ident(raise) constant(ActionController)operator(::)constant(SessionRestoreError)operator(,) stringstringcontent( [)inlinecontent(]\))delimiter( -end_msg)> - reserved(end) - - reserved(retry) - reserved(else) - ident(raise) - reserved(end) - reserved(end) - - reserved(def) method(session_options_with_string_keys) - instance_variable(@session_options_with_string_keys) operator(||=) constant(DEFAULT_SESSION_OPTIONS)operator(.)ident(merge)operator(()instance_variable(@session_options)operator(\))operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({) operator(|)ident(options)operator(,) operator(()ident(k)operator(,)ident(v)operator(\))operator(|) ident(options)operator([)ident(k)operator(.)ident(to_s)operator(]) operator(=) ident(v)operator(;) ident(options) operator(}) - reserved(end) - reserved(end) - - reserved(class) class(CgiResponse) operator(<) constant(AbstractResponse) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(cgi)operator(\)) - instance_variable(@cgi) operator(=) ident(cgi) - reserved(super)operator(()operator(\)) - reserved(end) - - reserved(def) method(out)operator(()ident(output) operator(=) global_variable($stdout)operator(\)) - ident(convert_content_type!)operator(()instance_variable(@headers)operator(\)) - ident(output)operator(.)ident(binmode) reserved(if) ident(output)operator(.)ident(respond_to?)operator(()symbol(:binmode)operator(\)) - ident(output)operator(.)ident(sync) operator(=) pre_constant(false) reserved(if) ident(output)operator(.)ident(respond_to?)operator(()symbol(:sync=)operator(\)) - - reserved(begin) - ident(output)operator(.)ident(write)operator(()instance_variable(@cgi)operator(.)ident(header)operator(()instance_variable(@headers)operator(\))operator(\)) - - reserved(if) instance_variable(@cgi)operator(.)ident(send)operator(()symbol(:env_table)operator(\))operator([)stringoperator(]) operator(==) string - reserved(return) - reserved(elsif) instance_variable(@body)operator(.)ident(respond_to?)operator(()symbol(:call)operator(\)) - instance_variable(@body)operator(.)ident(call)operator(()pre_constant(self)operator(,) ident(output)operator(\)) - reserved(else) - ident(output)operator(.)ident(write)operator(()instance_variable(@body)operator(\)) - reserved(end) - - ident(output)operator(.)ident(flush) reserved(if) ident(output)operator(.)ident(respond_to?)operator(()symbol(:flush)operator(\)) - reserved(rescue) constant(Errno)operator(::)constant(EPIPE) operator(=)operator(>) ident(e) - comment(# lost connection to the FCGI process -- ignore the output, then) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(convert_content_type!)operator(()ident(headers)operator(\)) - reserved(if) ident(header) operator(=) ident(headers)operator(.)ident(delete)operator(()stringoperator(\)) - ident(headers)operator([)stringoperator(]) operator(=) ident(header) - reserved(end) - reserved(if) ident(header) operator(=) ident(headers)operator(.)ident(delete)operator(()stringoperator(\)) - ident(headers)operator([)stringoperator(]) operator(=) ident(header) - reserved(end) - reserved(if) ident(header) operator(=) ident(headers)operator(.)ident(delete)operator(()stringoperator(\)) - ident(headers)operator([)stringoperator(]) operator(=) ident(header) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) - reserved(module) class(CodeGeneration) comment(#:nodoc:) - reserved(class) class(GenerationError) operator(<) constant(StandardError) comment(#:nodoc:) - reserved(end) - - reserved(class) class(Source) comment(#:nodoc:) - ident(attr_reader) symbol(:lines)operator(,) symbol(:indentation_level) - constant(IndentationString) operator(=) string - reserved(def) method(initialize) - instance_variable(@lines)operator(,) instance_variable(@indentation_level) operator(=) operator([)operator(])operator(,) integer(0) - reserved(end) - reserved(def) method(line)operator(()ident(line)operator(\)) - instance_variable(@lines) operator(<<) operator(()constant(IndentationString) operator(*) instance_variable(@indentation_level) operator(+) ident(line)operator(\)) - reserved(end) - reserved(alias) symbol(:<<) symbol(:line) - - reserved(def) method(indent) - instance_variable(@indentation_level) operator(+=) integer(1) - reserved(yield) - reserved(ensure) - instance_variable(@indentation_level) operator(-=) integer(1) - reserved(end) - - reserved(def) method(to_s)operator(()operator(\)) ident(lines)operator(.)ident(join)operator(()stringoperator(\)) reserved(end) - reserved(end) - - reserved(class) class(CodeGenerator) comment(#:nodoc:) - ident(attr_accessor) symbol(:source)operator(,) symbol(:locals) - reserved(def) method(initialize)operator(()ident(source) operator(=) pre_constant(nil)operator(\)) - instance_variable(@locals) operator(=) operator([)operator(]) - instance_variable(@source) operator(=) ident(source) operator(||) constant(Source)operator(.)ident(new) - reserved(end) - - constant(BeginKeywords) operator(=) stringoperator(.)ident(collect) operator({)operator(|)ident(kw)operator(|) ident(kw)operator(.)ident(to_sym)operator(}) - constant(ResumeKeywords) operator(=) stringoperator(.)ident(collect) operator({)operator(|)ident(kw)operator(|) ident(kw)operator(.)ident(to_sym)operator(}) - constant(Keywords) operator(=) constant(BeginKeywords) operator(+) constant(ResumeKeywords) - - reserved(def) method(method_missing)operator(()ident(keyword)operator(,) operator(*)ident(text)operator(\)) - reserved(if) constant(Keywords)operator(.)ident(include?) ident(keyword) - reserved(if) constant(ResumeKeywords)operator(.)ident(include?) ident(keyword) - ident(raise) constant(GenerationError)operator(,) stringcontent( immediately after an end)delimiter(")> reserved(unless) ident(source)operator(.)ident(lines)operator(.)ident(last) operator(=)operator(~) regexp - ident(source)operator(.)ident(lines)operator(.)ident(pop) comment(# Remove the 'end') - reserved(end) - - ident(line) stringcontent( )inlineinline_delimiter(})>delimiter(")> - reserved(begin) ident(source)operator(.)ident(indent) operator({) reserved(yield)operator(()pre_constant(self)operator(.)ident(dup)operator(\)) operator(}) - reserved(ensure) ident(line) string - reserved(end) - reserved(else) - reserved(super)operator(()ident(keyword)operator(,) operator(*)ident(text)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(line)operator(()operator(*)ident(args)operator(\)) pre_constant(self)operator(.)ident(source)operator(.)ident(line)operator(()operator(*)ident(args)operator(\)) reserved(end) - reserved(alias) symbol(:<<) symbol(:line) - reserved(def) method(indent)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) ident(source)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) reserved(end) - reserved(def) method(to_s)operator(()operator(\)) ident(source)operator(.)ident(to_s) reserved(end) - - reserved(def) method(share_locals_with)operator(()ident(other)operator(\)) - ident(other)operator(.)ident(locals) operator(=) pre_constant(self)operator(.)ident(locals) operator(=) operator(()ident(other)operator(.)ident(locals) operator(|) ident(locals)operator(\)) - reserved(end) - - constant(FieldsToDuplicate) operator(=) operator([)symbol(:locals)operator(]) - reserved(def) method(dup) - ident(copy) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(new)operator(()ident(source)operator(\)) - pre_constant(self)operator(.)ident(class)operator(::)constant(FieldsToDuplicate)operator(.)ident(each) reserved(do) operator(|)ident(sym)operator(|) - ident(value) operator(=) pre_constant(self)operator(.)ident(send)operator(()ident(sym)operator(\)) - ident(value) operator(=) ident(value)operator(.)ident(dup) reserved(unless) ident(value)operator(.)ident(nil?) operator(||) ident(value)operator(.)ident(is_a?)operator(()constant(Numeric)operator(\)) - ident(copy)operator(.)ident(send)operator(()stringcontent(=)delimiter(")>operator(,) ident(value)operator(\)) - reserved(end) - reserved(return) ident(copy) - reserved(end) - reserved(end) - - reserved(class) class(RecognitionGenerator) operator(<) constant(CodeGenerator) comment(#:nodoc:) - constant(Attributes) operator(=) operator([)symbol(:after)operator(,) symbol(:before)operator(,) symbol(:current)operator(,) symbol(:results)operator(,) symbol(:constants)operator(,) symbol(:depth)operator(,) symbol(:move_ahead)operator(,) symbol(:finish_statement)operator(]) - ident(attr_accessor)operator(()operator(*)constant(Attributes)operator(\)) - constant(FieldsToDuplicate) operator(=) constant(CodeGenerator)operator(::)constant(FieldsToDuplicate) operator(+) constant(Attributes) - - reserved(def) method(initialize)operator(()operator(*)ident(args)operator(\)) - reserved(super)operator(()operator(*)ident(args)operator(\)) - instance_variable(@after)operator(,) instance_variable(@before) operator(=) operator([)operator(])operator(,) operator([)operator(]) - instance_variable(@current) operator(=) pre_constant(nil) - instance_variable(@results)operator(,) instance_variable(@constants) operator(=) operator({)operator(})operator(,) operator({)operator(}) - instance_variable(@depth) operator(=) integer(0) - instance_variable(@move_ahead) operator(=) pre_constant(nil) - instance_variable(@finish_statement) operator(=) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(hash_expr)operator(|) ident(hash_expr)operator(}) - reserved(end) - - reserved(def) method(if_next_matches)operator(()ident(string)operator(,) operator(&)ident(block)operator(\)) - ident(test) operator(=) constant(Routing)operator(.)ident(test_condition)operator(()ident(next_segment)operator(()pre_constant(true)operator(\))operator(,) ident(string)operator(\)) - pre_constant(self)operator(.)ident(if)operator(()ident(test)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(move_forward)operator(()ident(places) operator(=) integer(1)operator(\)) - ident(dup) operator(=) pre_constant(self)operator(.)ident(dup) - ident(dup)operator(.)ident(depth) operator(+=) integer(1) - ident(dup)operator(.)ident(move_ahead) operator(=) ident(places) - reserved(yield) ident(dup) - reserved(end) - - reserved(def) method(next_segment)operator(()ident(assign_inline) operator(=) pre_constant(false)operator(,) ident(default) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(locals)operator(.)ident(include?)operator(()ident(segment_name)operator(\)) - ident(code) operator(=) ident(segment_name) - reserved(else) - ident(code) operator(=) stringcontent( = )inlinecontent([)inlinecontent(])delimiter(")> - reserved(if) ident(assign_inline) - ident(code) operator(=) stringcontent(\))delimiter(")> - reserved(else) - ident(line)operator(()ident(code)operator(\)) - ident(code) operator(=) ident(segment_name) - reserved(end) - - ident(locals) operator(<<) ident(segment_name) - reserved(end) - ident(code) operator(=) stringcontent( || )inlinecontent(\))delimiter(")> reserved(if) ident(default) - - reserved(return) ident(code)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(segment_name)operator(()operator(\)) stringdelimiter(")>operator(.)ident(to_sym) reserved(end) - reserved(def) method(path_name)operator(()operator(\)) symbol(:path) reserved(end) - reserved(def) method(index_name) - ident(move_ahead)operator(,) instance_variable(@move_ahead) operator(=) instance_variable(@move_ahead)operator(,) pre_constant(nil) - ident(move_ahead) operator(?) stringdelimiter(")> operator(:) string - reserved(end) - - reserved(def) method(continue) - ident(dup) operator(=) pre_constant(self)operator(.)ident(dup) - ident(dup)operator(.)ident(before) operator(<<) ident(dup)operator(.)ident(current) - ident(dup)operator(.)ident(current) operator(=) ident(dup)operator(.)ident(after)operator(.)ident(shift) - ident(dup)operator(.)ident(go) - reserved(end) - - reserved(def) method(go) - reserved(if) ident(current) reserved(then) ident(current)operator(.)ident(write_recognition)operator(()pre_constant(self)operator(\)) - reserved(else) pre_constant(self)operator(.)ident(finish) - reserved(end) - reserved(end) - - reserved(def) method(result)operator(()ident(key)operator(,) ident(expression)operator(,) ident(delay) operator(=) pre_constant(false)operator(\)) - reserved(unless) ident(delay) - ident(line) stringcontent(_value = )inlinedelimiter(")> - ident(expression) operator(=) stringcontent(_value)delimiter(")> - reserved(end) - ident(results)operator([)ident(key)operator(]) operator(=) ident(expression) - reserved(end) - reserved(def) method(constant_result)operator(()ident(key)operator(,) ident(object)operator(\)) - ident(constants)operator([)ident(key)operator(]) operator(=) ident(object) - reserved(end) - - reserved(def) method(finish)operator(()ident(ensure_traversal_finished) operator(=) pre_constant(true)operator(\)) - ident(pairs) operator(=) operator([)operator(]) - operator(()ident(results)operator(.)ident(keys) operator(+) ident(constants)operator(.)ident(keys)operator(\))operator(.)ident(uniq)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(|) - ident(pairs) operator(<<) stringcontent( => )inlinedelimiter(")> - reserved(end) - ident(hash_expr) operator(=) stringoperator(\))inline_delimiter(})>content(})delimiter(")> - - ident(statement) operator(=) ident(finish_statement)operator(.)ident(call)operator(()ident(hash_expr)operator(\)) - reserved(if) ident(ensure_traversal_finished) reserved(then) pre_constant(self)operator(.)ident(if)operator(()stringdelimiter(")>operator(\)) operator({)operator(|)ident(gp)operator(|) ident(gp) operator(<<) ident(statement)operator(}) - reserved(else) pre_constant(self) operator(<<) ident(statement) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(GenerationGenerator) operator(<) constant(CodeGenerator) comment(#:nodoc:) - constant(Attributes) operator(=) operator([)symbol(:after)operator(,) symbol(:before)operator(,) symbol(:current)operator(,) symbol(:segments)operator(]) - ident(attr_accessor)operator(()operator(*)constant(Attributes)operator(\)) - constant(FieldsToDuplicate) operator(=) constant(CodeGenerator)operator(::)constant(FieldsToDuplicate) operator(+) constant(Attributes) - - reserved(def) method(initialize)operator(()operator(*)ident(args)operator(\)) - reserved(super)operator(()operator(*)ident(args)operator(\)) - instance_variable(@after)operator(,) instance_variable(@before) operator(=) operator([)operator(])operator(,) operator([)operator(]) - instance_variable(@current) operator(=) pre_constant(nil) - instance_variable(@segments) operator(=) operator([)operator(]) - reserved(end) - - reserved(def) method(hash_name)operator(()operator(\)) string reserved(end) - reserved(def) method(local_name)operator(()ident(key)operator(\)) stringcontent(_value)delimiter(")> reserved(end) - - reserved(def) method(hash_value)operator(()ident(key)operator(,) ident(assign) operator(=) pre_constant(true)operator(,) ident(default) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(locals)operator(.)ident(include?)operator(()ident(local_name)operator(()ident(key)operator(\))operator(\)) reserved(then) ident(code) operator(=) ident(local_name)operator(()ident(key)operator(\)) - reserved(else) - ident(code) operator(=) stringcontent(])delimiter(")> - reserved(if) ident(assign) - ident(code) operator(=) stringcontent( = )inlinecontent(\))delimiter(")> - ident(locals) operator(<<) ident(local_name)operator(()ident(key)operator(\)) - reserved(end) - reserved(end) - ident(code) operator(=) stringcontent( || ()inlinecontent(\)\))delimiter(")> reserved(if) ident(default) - reserved(return) ident(code) - reserved(end) - - reserved(def) method(expire_for_keys)operator(()operator(*)ident(keys)operator(\)) - reserved(return) reserved(if) ident(keys)operator(.)ident(empty?) - ident(conds) operator(=) ident(keys)operator(.)ident(collect) operator({)operator(|)ident(key)operator(|) stringcontent(])delimiter(")>operator(}) - ident(line) stringcontent( = false, options if not_expired && )inlineoperator(\))inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(add_segment)operator(()operator(*)ident(segments)operator(\)) - ident(d) operator(=) ident(dup) - ident(d)operator(.)ident(segments)operator(.)ident(concat) ident(segments) - reserved(yield) ident(d) - reserved(end) - - reserved(def) method(go) - reserved(if) ident(current) reserved(then) ident(current)operator(.)ident(write_generation)operator(()pre_constant(self)operator(\)) - reserved(else) pre_constant(self)operator(.)ident(finish) - reserved(end) - reserved(end) - - reserved(def) method(continue) - ident(d) operator(=) ident(dup) - ident(d)operator(.)ident(before) operator(<<) ident(d)operator(.)ident(current) - ident(d)operator(.)ident(current) operator(=) ident(d)operator(.)ident(after)operator(.)ident(shift) - ident(d)operator(.)ident(go) - reserved(end) - - reserved(def) method(finish) - ident(line) stringoperator(\))inline_delimiter(})>content(")delimiter(\))> - reserved(end) - - reserved(def) method(check_conditions)operator(()ident(conditions)operator(\)) - ident(tests) operator(=) operator([)operator(]) - ident(generator) operator(=) pre_constant(nil) - ident(conditions)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(condition)operator(|) - ident(tests) operator(<<) operator(()ident(generator) operator(||) pre_constant(self)operator(\))operator(.)ident(hash_value)operator(()ident(key)operator(,) pre_constant(true)operator(\)) reserved(if) ident(condition)operator(.)ident(is_a?) constant(Regexp) - ident(tests) operator(<<) constant(Routing)operator(.)ident(test_condition)operator(()operator(()ident(generator) operator(||) pre_constant(self)operator(\))operator(.)ident(hash_value)operator(()ident(key)operator(,) pre_constant(false)operator(\))operator(,) ident(condition)operator(\)) - ident(generator) operator(=) pre_constant(self)operator(.)ident(dup) reserved(unless) ident(generator) - reserved(end) - reserved(return) ident(tests)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) comment(#:nodoc:) - comment(# Components allow you to call other actions for their rendered response while executing another action. You can either delegate) - comment(# the entire response rendering or you can mix a partial response in with your other content.) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# # Performs a method and then lets hello_world output its render) - comment(# def delegate_action) - comment(# do_other_stuff_before_hello_world) - comment(# render_component :controller => "greeter", :action => "hello_world", :params => { :person => "david" }) - comment(# end) - comment(# end) - comment(#) - comment(# class GreeterController < ActionController::Base) - comment(# def hello_world) - comment(# render :text => "#{params[:person]} says, Hello World!") - comment(# end) - comment(# end) - comment(#) - comment(# The same can be done in a view to do a partial rendering:) - comment(# ) - comment(# Let's see a greeting: ) - comment(# <%= render_component :controller => "greeter", :action => "hello_world" %>) - comment(#) - comment(# It is also possible to specify the controller as a class constant, bypassing the inflector) - comment(# code to compute the controller class at runtime:) - comment(# ) - comment(# <%= render_component :controller => GreeterController, :action => "hello_world" %>) - comment(#) - comment(# == When to use components) - comment(#) - comment(# Components should be used with care. They're significantly slower than simply splitting reusable parts into partials and) - comment(# conceptually more complicated. Don't use components as a way of separating concerns inside a single application. Instead,) - comment(# reserve components to those rare cases where you truly have reusable view and controller elements that can be employed ) - comment(# across many applications at once.) - comment(#) - comment(# So to repeat: Components are a special-purpose approach that can often be replaced with better use of partials and filters.) - reserved(module) class(Components) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) comment(#:nodoc:) - ident(base)operator(.)ident(send) symbol(:include)operator(,) constant(InstanceMethods) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - - ident(base)operator(.)ident(helper) reserved(do) - reserved(def) method(render_component)operator(()ident(options)operator(\)) - instance_variable(@controller)operator(.)ident(send)operator(()symbol(:render_component_as_string)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - comment(# If this controller was instantiated to process a component request,) - comment(# +parent_controller+ points to the instantiator of this controller.) - ident(base)operator(.)ident(send) symbol(:attr_accessor)operator(,) symbol(:parent_controller) - - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:process_cleanup_without_components)operator(,) symbol(:process_cleanup) - ident(alias_method) symbol(:process_cleanup)operator(,) symbol(:process_cleanup_with_components) - - ident(alias_method) symbol(:set_session_options_without_components)operator(,) symbol(:set_session_options) - ident(alias_method) symbol(:set_session_options)operator(,) symbol(:set_session_options_with_components) - - ident(alias_method) symbol(:flash_without_components)operator(,) symbol(:flash) - ident(alias_method) symbol(:flash)operator(,) symbol(:flash_with_components) - - ident(alias_method) symbol(:component_request?)operator(,) symbol(:parent_controller) - reserved(end) - reserved(end) - - reserved(module) class(ClassMethods) - comment(# Track parent controller to identify component requests) - reserved(def) method(process_with_components)operator(()ident(request)operator(,) ident(response)operator(,) ident(parent_controller) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(controller) operator(=) ident(new) - ident(controller)operator(.)ident(parent_controller) operator(=) ident(parent_controller) - ident(controller)operator(.)ident(process)operator(()ident(request)operator(,) ident(response)operator(\)) - reserved(end) - - comment(# Set the template root to be one directory behind the root dir of the controller. Examples:) - comment(# /code/weblog/components/admin/users_controller.rb with Admin::UsersController ) - comment(# will use /code/weblog/components as template root ) - comment(# and find templates in /code/weblog/components/admin/users/) - comment(#) - comment(# /code/weblog/components/admin/parties/users_controller.rb with Admin::Parties::UsersController ) - comment(# will also use /code/weblog/components as template root ) - comment(# and find templates in /code/weblog/components/admin/parties/users/) - reserved(def) method(uses_component_template_root) - ident(path_of_calling_controller) operator(=) constant(File)operator(.)ident(dirname)operator(()ident(caller)operator([)integer(0)operator(])operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(first)operator(\)) - ident(path_of_controller_root) operator(=) ident(path_of_calling_controller)operator(.)ident(sub)operator(()regexpoperator(\))operator([)integer(0)operator(..)integer(-2)operator(])inline_delimiter(})>content($)delimiter(/)>operator(,) stringoperator(\)) comment(# " (for ruby-mode\)) - - pre_constant(self)operator(.)ident(template_root) operator(=) ident(path_of_controller_root) - reserved(end) - reserved(end) - - reserved(module) class(InstanceMethods) - comment(# Extracts the action_name from the request parameters and performs that action.) - reserved(def) method(process_with_components)operator(()ident(request)operator(,) ident(response)operator(,) ident(method) operator(=) symbol(:perform_action)operator(,) operator(*)ident(arguments)operator(\)) comment(#:nodoc:) - ident(flash)operator(.)ident(discard) reserved(if) ident(component_request?) - ident(process_without_components)operator(()ident(request)operator(,) ident(response)operator(,) ident(method)operator(,) operator(*)ident(arguments)operator(\)) - reserved(end) - - ident(protected) - comment(# Renders the component specified as the response for the current method) - reserved(def) method(render_component)operator(()ident(options)operator(\)) comment(#:doc:) - ident(component_logging)operator(()ident(options)operator(\)) reserved(do) - ident(render_text)operator(()ident(component_response)operator(()ident(options)operator(,) pre_constant(true)operator(\))operator(.)ident(body)operator(,) ident(response)operator(.)ident(headers)operator([)stringoperator(])operator(\)) - reserved(end) - reserved(end) - - comment(# Returns the component response as a string) - reserved(def) method(render_component_as_string)operator(()ident(options)operator(\)) comment(#:doc:) - ident(component_logging)operator(()ident(options)operator(\)) reserved(do) - ident(response) operator(=) ident(component_response)operator(()ident(options)operator(,) pre_constant(false)operator(\)) - - reserved(if) ident(redirected) operator(=) ident(response)operator(.)ident(redirected_to) - ident(render_component_as_string)operator(()ident(redirected)operator(\)) - reserved(else) - ident(response)operator(.)ident(body) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(flash_with_components)operator(()ident(refresh) operator(=) pre_constant(false)operator(\)) comment(#:nodoc:) - reserved(if) instance_variable(@flash)operator(.)ident(nil?) operator(||) ident(refresh) - instance_variable(@flash) operator(=) - reserved(if) instance_variable(@parent_controller) - instance_variable(@parent_controller)operator(.)ident(flash) - reserved(else) - ident(flash_without_components) - reserved(end) - reserved(end) - - instance_variable(@flash) - reserved(end) - - ident(private) - reserved(def) method(component_response)operator(()ident(options)operator(,) ident(reuse_response)operator(\)) - ident(klass) operator(=) ident(component_class)operator(()ident(options)operator(\)) - ident(request) operator(=) ident(request_for_component)operator(()ident(klass)operator(.)ident(controller_name)operator(,) ident(options)operator(\)) - ident(response) operator(=) ident(reuse_response) operator(?) instance_variable(@response) operator(:) instance_variable(@response)operator(.)ident(dup) - - ident(klass)operator(.)ident(process_with_components)operator(()ident(request)operator(,) ident(response)operator(,) pre_constant(self)operator(\)) - reserved(end) - - comment(# determine the controller class for the component request) - reserved(def) method(component_class)operator(()ident(options)operator(\)) - reserved(if) ident(controller) operator(=) ident(options)operator([)symbol(:controller)operator(]) - ident(controller)operator(.)ident(is_a?)operator(()constant(Class)operator(\)) operator(?) ident(controller) operator(:) stringcontent(Controller)delimiter(")>operator(.)ident(constantize) - reserved(else) - pre_constant(self)operator(.)ident(class) - reserved(end) - reserved(end) - - comment(# Create a new request object based on the current request.) - comment(# The new request inherits the session from the current request,) - comment(# bypassing any session options set for the component controller's class) - reserved(def) method(request_for_component)operator(()ident(controller_name)operator(,) ident(options)operator(\)) - ident(request) operator(=) instance_variable(@request)operator(.)ident(dup) - ident(request)operator(.)ident(session) operator(=) instance_variable(@request)operator(.)ident(session) - - ident(request)operator(.)ident(instance_variable_set)operator(() - symbol(:@parameters)operator(,) - operator(()ident(options)operator([)symbol(:params)operator(]) operator(||) operator({)operator(})operator(\))operator(.)ident(with_indifferent_access)operator(.)ident(update)operator(() - string operator(=)operator(>) ident(controller_name)operator(,) string operator(=)operator(>) ident(options)operator([)symbol(:action)operator(])operator(,) string operator(=)operator(>) ident(options)operator([)symbol(:id)operator(]) - operator(\)) - operator(\)) - - ident(request) - reserved(end) - - reserved(def) method(component_logging)operator(()ident(options)operator(\)) - reserved(if) ident(logger) - ident(logger)operator(.)ident(info) stringcontent(\): )delimiter(")> - ident(result) operator(=) reserved(yield) - ident(logger)operator(.)ident(info) string - ident(result) - reserved(else) - reserved(yield) - reserved(end) - reserved(end) - - reserved(def) method(set_session_options_with_components)operator(()ident(request)operator(\)) - ident(set_session_options_without_components)operator(()ident(request)operator(\)) reserved(unless) ident(component_request?) - reserved(end) - - reserved(def) method(process_cleanup_with_components) - ident(process_cleanup_without_components) reserved(unless) ident(component_request?) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) comment(#:nodoc:) - comment(# Cookies are read and written through ActionController#cookies. The cookies being read are what were received along with the request,) - comment(# the cookies being written are what will be sent out with the response. Cookies are read by value (so you won't get the cookie object) - comment(# itself back -- just the value it holds\). Examples for writing:) - comment(#) - comment(# cookies[:user_name] = "david" # => Will set a simple session cookie) - comment(# cookies[:login] = { :value => "XJ-122", :expires => Time.now + 360} # => Will set a cookie that expires in 1 hour) - comment(# ) - comment(# Examples for reading:) - comment(#) - comment(# cookies[:user_name] # => "david") - comment(# cookies.size # => 2) - comment(# ) - comment(# Example for deleting:) - comment(#) - comment(# cookies.delete :user_name) - comment(#) - comment(# All the option symbols for setting cookies are:) - comment(#) - comment(# * value - the cookie's value or list of values (as an array\).) - comment(# * path - the path for which this cookie applies. Defaults to the root of the application.) - comment(# * domain - the domain for which this cookie applies.) - comment(# * expires - the time at which this cookie expires, as a +Time+ object.) - comment(# * secure - whether this cookie is a secure cookie or not (default to false\).) - comment(# Secure cookies are only transmitted to HTTPS servers.) - reserved(module) class(Cookies) - ident(protected) - comment(# Returns the cookie container, which operates as described above.) - reserved(def) method(cookies) - constant(CookieJar)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - reserved(end) - - comment(# Deprecated cookie writer method) - reserved(def) method(cookie)operator(()operator(*)ident(options)operator(\)) - instance_variable(@response)operator(.)ident(headers)operator([)stringoperator(]) operator(<<) constant(CGI)operator(::)constant(Cookie)operator(.)ident(new)operator(()operator(*)ident(options)operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(CookieJar) operator(<) constant(Hash) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(controller)operator(\)) - instance_variable(@controller)operator(,) instance_variable(@cookies) operator(=) ident(controller)operator(,) ident(controller)operator(.)ident(instance_variable_get)operator(()stringoperator(\)) - reserved(super)operator(()operator(\)) - ident(update)operator(()instance_variable(@cookies)operator(\)) - reserved(end) - - comment(# Returns the value of the cookie by +name+ -- or nil if no such cookie exists. You set new cookies using either the cookie method) - comment(# or cookies[]= (for simple name/value cookies without options\).) - reserved(def) method([])operator(()ident(name)operator(\)) - instance_variable(@cookies)operator([)ident(name)operator(.)ident(to_s)operator(])operator(.)ident(value)operator(.)ident(first) reserved(if) instance_variable(@cookies)operator([)ident(name)operator(.)ident(to_s)operator(]) operator(&&) instance_variable(@cookies)operator([)ident(name)operator(.)ident(to_s)operator(])operator(.)ident(respond_to?)operator(()symbol(:value)operator(\)) - reserved(end) - - reserved(def) method([]=)operator(()ident(name)operator(,) ident(options)operator(\)) - reserved(if) ident(options)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(options) operator(=) ident(options)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({) operator(|)ident(options)operator(,) ident(pair)operator(|) ident(options)operator([)ident(pair)operator(.)ident(first)operator(.)ident(to_s)operator(]) operator(=) ident(pair)operator(.)ident(last)operator(;) ident(options) operator(}) - ident(options)operator([)stringoperator(]) operator(=) ident(name)operator(.)ident(to_s) - reserved(else) - ident(options) operator(=) operator({) string operator(=)operator(>) ident(name)operator(.)ident(to_s)operator(,) string operator(=)operator(>) ident(options) operator(}) - reserved(end) - - ident(set_cookie)operator(()ident(options)operator(\)) - reserved(end) - - comment(# Removes the cookie on the client machine by setting the value to an empty string) - comment(# and setting its expiration date into the past) - reserved(def) method(delete)operator(()ident(name)operator(\)) - ident(set_cookie)operator(()string operator(=)operator(>) ident(name)operator(.)ident(to_s)operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) constant(Time)operator(.)ident(at)operator(()integer(0)operator(\))operator(\)) - reserved(end) - - ident(private) - reserved(def) method(set_cookie)operator(()ident(options)operator(\)) comment(#:doc:) - ident(options)operator([)stringoperator(]) operator(=) string reserved(unless) ident(options)operator([)stringoperator(]) - ident(cookie) operator(=) constant(CGI)operator(::)constant(Cookie)operator(.)ident(new)operator(()ident(options)operator(\)) - instance_variable(@controller)operator(.)ident(logger)operator(.)ident(info) stringdelimiter(")> reserved(unless) instance_variable(@controller)operator(.)ident(logger)operator(.)ident(nil?) - instance_variable(@controller)operator(.)ident(response)operator(.)ident(headers)operator([)stringoperator(]) operator(<<) ident(cookie) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) comment(#:nodoc:) - reserved(module) class(Dependencies) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - comment(# Dependencies control what classes are needed for the controller to run its course. This is an alternative to doing explicit) - comment(# +require+ statements that bring a number of benefits. It's more succinct, communicates what type of dependency we're talking about,) - comment(# can trigger special behavior (as in the case of +observer+\), and enables Rails to be clever about reloading in cached environments) - comment(# like FCGI. Example:) - comment(#) - comment(# class ApplicationController < ActionController::Base) - comment(# model :account, :company, :person, :project, :category) - comment(# helper :access_control) - comment(# service :notifications, :billings) - comment(# observer :project_change_observer) - comment(# end) - comment(#) - comment(# Please note that a controller like ApplicationController will automatically attempt to require_dependency on a model of its ) - comment(# singuralized name and a helper of its name. If nothing is found, no error is raised. This is especially useful for concrete ) - comment(# controllers like PostController:) - comment(#) - comment(# class PostController < ApplicationController) - comment(# # model :post (already required\)) - comment(# # helper :post (already required\)) - comment(# end) - comment(#) - comment(# Also note, that if the models follow the pattern of just 1 class per file in the form of MyClass => my_class.rb, then these) - comment(# classes don't have to be required as Active Support will auto-require them.) - reserved(module) class(ClassMethods) comment(#:nodoc:) - comment(# Specifies a variable number of models that this controller depends on. Models are normally Active Record classes or a similar) - comment(# backend for modelling entity classes.) - reserved(def) method(model)operator(()operator(*)ident(models)operator(\)) - ident(require_dependencies)operator(()symbol(:model)operator(,) ident(models)operator(\)) - ident(depend_on)operator(()symbol(:model)operator(,) ident(models)operator(\)) - reserved(end) - - comment(# Specifies a variable number of services that this controller depends on. Services are normally singletons or factories, like) - comment(# Action Mailer service or a Payment Gateway service.) - reserved(def) method(service)operator(()operator(*)ident(services)operator(\)) - ident(require_dependencies)operator(()symbol(:service)operator(,) ident(services)operator(\)) - ident(depend_on)operator(()symbol(:service)operator(,) ident(services)operator(\)) - reserved(end) - - comment(# Specifies a variable number of observers that are to govern when this controller is handling actions. The observers will) - comment(# automatically have .instance called on them to make them active on assignment.) - reserved(def) method(observer)operator(()operator(*)ident(observers)operator(\)) - ident(require_dependencies)operator(()symbol(:observer)operator(,) ident(observers)operator(\)) - ident(depend_on)operator(()symbol(:observer)operator(,) ident(observers)operator(\)) - ident(instantiate_observers)operator(()ident(observers)operator(\)) - reserved(end) - - comment(# Returns an array of symbols that specify the dependencies on a given layer. For the example at the top, calling) - comment(# ApplicationController.dependencies_on(:model\) would return [:account, :company, :person, :project, :category]) - reserved(def) method(dependencies_on)operator(()ident(layer)operator(\)) - ident(read_inheritable_attribute)operator(()stringcontent(_dependencies)delimiter(")>operator(\)) - reserved(end) - - reserved(def) method(depend_on)operator(()ident(layer)operator(,) ident(dependencies)operator(\)) comment(#:nodoc:) - ident(write_inheritable_array)operator(()stringcontent(_dependencies)delimiter(")>operator(,) ident(dependencies)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(instantiate_observers)operator(()ident(observers)operator(\)) - ident(observers)operator(.)ident(flatten)operator(.)ident(each) operator({) operator(|)ident(observer)operator(|) constant(Object)operator(.)ident(const_get)operator(()constant(Inflector)operator(.)ident(classify)operator(()ident(observer)operator(.)ident(to_s)operator(\))operator(\))operator(.)ident(instance) operator(}) - reserved(end) - - reserved(def) method(require_dependencies)operator(()ident(layer)operator(,) ident(dependencies)operator(\)) - ident(dependencies)operator(.)ident(flatten)operator(.)ident(each) reserved(do) operator(|)ident(dependency)operator(|) - reserved(begin) - ident(require_dependency)operator(()ident(dependency)operator(.)ident(to_s)operator(\)) - reserved(rescue) constant(LoadError) operator(=)operator(>) ident(e) - ident(raise) constant(LoadError)operator(.)ident(new)operator(()stringcontent( )inlinecontent(.rb)delimiter(")>operator(\))operator(.)ident(copy_blame!)operator(()ident(e)operator(\)) - reserved(rescue) constant(Object) operator(=)operator(>) ident(exception) - ident(exception)operator(.)ident(blame_file!) string )inlinecontent( )inlinecontent(.rb)delimiter(")> - ident(raise) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(Test) comment(#:nodoc:) - reserved(module) class(Unit) comment(#:nodoc:) - reserved(module) class(Assertions) - reserved(def) method(assert_success)operator(()ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(assert_response)operator(()symbol(:success)operator(,) ident(message)operator(\)) - reserved(end) - - reserved(def) method(assert_redirect)operator(()ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(assert_response)operator(()symbol(:redirect)operator(,) ident(message)operator(\)) - reserved(end) - - reserved(def) method(assert_rendered_file)operator(()ident(expected)operator(=)pre_constant(nil)operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(assert_template)operator(()ident(expected)operator(,) ident(message)operator(\)) - reserved(end) - - comment(# ensure that the session has an object with the specified name) - reserved(def) method(assert_session_has)operator(()ident(key)operator(=)pre_constant(nil)operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string is not in the session )delimiter(")>operator(,) ident(key)operator(,) instance_variable(@response)operator(.)ident(session)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) instance_variable(@response)operator(.)ident(has_session_object?)operator(()ident(key)operator(\)) operator(}) - reserved(end) - - comment(# ensure that the session has no object with the specified name) - reserved(def) method(assert_session_has_no)operator(()ident(key)operator(=)pre_constant(nil)operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string is in the session )delimiter(")>operator(,) ident(key)operator(,) instance_variable(@response)operator(.)ident(session)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) operator(!)instance_variable(@response)operator(.)ident(has_session_object?)operator(()ident(key)operator(\)) operator(}) - reserved(end) - - reserved(def) method(assert_session_equal)operator(()ident(expected) operator(=) pre_constant(nil)operator(,) ident(key) operator(=) pre_constant(nil)operator(,) ident(message) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string expected in session['?'] but was )delimiter(")>operator(,) ident(expected)operator(,) ident(key)operator(,) instance_variable(@response)operator(.)ident(session)operator([)ident(key)operator(])operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(expected) operator(==) instance_variable(@response)operator(.)ident(session)operator([)ident(key)operator(]) operator(}) - reserved(end) - - comment(# -- cookie assertions ---------------------------------------------------) - - reserved(def) method(assert_no_cookie)operator(()ident(key) operator(=) pre_constant(nil)operator(,) ident(message) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(actual) operator(=) instance_variable(@response)operator(.)ident(cookies)operator([)ident(key)operator(]) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string not expected in cookies['?'])delimiter(")>operator(,) ident(actual)operator(,) ident(key)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(actual)operator(.)ident(nil?) reserved(or) ident(actual)operator(.)ident(empty?) operator(}) - reserved(end) - - reserved(def) method(assert_cookie_equal)operator(()ident(expected) operator(=) pre_constant(nil)operator(,) ident(key) operator(=) pre_constant(nil)operator(,) ident(message) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(actual) operator(=) instance_variable(@response)operator(.)ident(cookies)operator([)ident(key)operator(]) - ident(actual) operator(=) ident(actual)operator(.)ident(first) reserved(if) ident(actual) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string expected in cookies['?'] but was )delimiter(")>operator(,) ident(expected)operator(,) ident(key)operator(,) ident(actual)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(expected) operator(==) ident(actual) operator(}) - reserved(end) - - comment(# -- flash assertions ---------------------------------------------------) - - comment(# ensure that the flash has an object with the specified name) - reserved(def) method(assert_flash_has)operator(()ident(key)operator(=)pre_constant(nil)operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string is not in the flash )delimiter(")>operator(,) ident(key)operator(,) instance_variable(@response)operator(.)ident(flash)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) instance_variable(@response)operator(.)ident(has_flash_object?)operator(()ident(key)operator(\)) operator(}) - reserved(end) - - comment(# ensure that the flash has no object with the specified name) - reserved(def) method(assert_flash_has_no)operator(()ident(key)operator(=)pre_constant(nil)operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string is in the flash )delimiter(")>operator(,) ident(key)operator(,) instance_variable(@response)operator(.)ident(flash)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) operator(!)instance_variable(@response)operator(.)ident(has_flash_object?)operator(()ident(key)operator(\)) operator(}) - reserved(end) - - comment(# ensure the flash exists) - reserved(def) method(assert_flash_exists)operator(()ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(session)operator([)stringoperator(]) operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) instance_variable(@response)operator(.)ident(has_flash?) operator(}) - reserved(end) - - comment(# ensure the flash does not exist) - reserved(def) method(assert_flash_not_exists)operator(()ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(flash)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) operator(!)instance_variable(@response)operator(.)ident(has_flash?) operator(}) - reserved(end) - - comment(# ensure the flash is empty but existent) - reserved(def) method(assert_flash_empty)operator(()ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(flash)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) operator(!)instance_variable(@response)operator(.)ident(has_flash_with_contents?) operator(}) - reserved(end) - - comment(# ensure the flash is not empty) - reserved(def) method(assert_flash_not_empty)operator(()ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) stringoperator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) instance_variable(@response)operator(.)ident(has_flash_with_contents?) operator(}) - reserved(end) - - reserved(def) method(assert_flash_equal)operator(()ident(expected) operator(=) pre_constant(nil)operator(,) ident(key) operator(=) pre_constant(nil)operator(,) ident(message) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string expected in flash['?'] but was )delimiter(")>operator(,) ident(expected)operator(,) ident(key)operator(,) instance_variable(@response)operator(.)ident(flash)operator([)ident(key)operator(])operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(expected) operator(==) instance_variable(@response)operator(.)ident(flash)operator([)ident(key)operator(]) operator(}) - reserved(end) - - - comment(# ensure our redirection url is an exact match) - reserved(def) method(assert_redirect_url)operator(()ident(url)operator(=)pre_constant(nil)operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(assert_redirect)operator(()ident(message)operator(\)) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string is not the redirected location )delimiter(")>operator(,) ident(url)operator(,) instance_variable(@response)operator(.)ident(redirect_url)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) instance_variable(@response)operator(.)ident(redirect_url) operator(==) ident(url) operator(}) - reserved(end) - - comment(# ensure our redirection url matches a pattern) - reserved(def) method(assert_redirect_url_match)operator(()ident(pattern)operator(=)pre_constant(nil)operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(assert_redirect)operator(()ident(message)operator(\)) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string was not found in the location: )delimiter(")>operator(,) ident(pattern)operator(,) instance_variable(@response)operator(.)ident(redirect_url)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) instance_variable(@response)operator(.)ident(redirect_url_match?)operator(()ident(pattern)operator(\)) operator(}) - reserved(end) - - - comment(# -- template assertions ------------------------------------------------) - - comment(# ensure that a template object with the given name exists) - reserved(def) method(assert_template_has)operator(()ident(key)operator(=)pre_constant(nil)operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string is not a template object)delimiter(")>operator(,) ident(key) operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) instance_variable(@response)operator(.)ident(has_template_object?)operator(()ident(key)operator(\)) operator(}) - reserved(end) - - comment(# ensure that a template object with the given name does not exist) - reserved(def) method(assert_template_has_no)operator(()ident(key)operator(=)pre_constant(nil)operator(,)ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string is a template object )delimiter(")>operator(,) ident(key)operator(,) instance_variable(@response)operator(.)ident(template_objects)operator([)ident(key)operator(])operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) operator(!)instance_variable(@response)operator(.)ident(has_template_object?)operator(()ident(key)operator(\)) operator(}) - reserved(end) - - comment(# ensures that the object assigned to the template on +key+ is equal to +expected+ object.) - reserved(def) method(assert_template_equal)operator(()ident(expected) operator(=) pre_constant(nil)operator(,) ident(key) operator(=) pre_constant(nil)operator(,) ident(message) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string expected in assigns['?'] but was )delimiter(")>operator(,) ident(expected)operator(,) ident(key)operator(,) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)ident(key)operator(.)ident(to_s)operator(])operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(expected) operator(==) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)ident(key)operator(.)ident(to_s)operator(]) operator(}) - reserved(end) - ident(alias_method) symbol(:assert_assigned_equal)operator(,) symbol(:assert_template_equal) - - comment(# Asserts that the template returns the +expected+ string or array based on the XPath +expression+.) - comment(# This will only work if the template rendered a valid XML document.) - reserved(def) method(assert_template_xpath_match)operator(()ident(expression)operator(=)pre_constant(nil)operator(,) ident(expected)operator(=)pre_constant(nil)operator(,) ident(message)operator(=)pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(xml)operator(,) ident(matches) operator(=) constant(REXML)operator(::)constant(Document)operator(.)ident(new)operator(()instance_variable(@response)operator(.)ident(body)operator(\))operator(,) operator([)operator(]) - ident(xml)operator(.)ident(elements)operator(.)ident(each)operator(()ident(expression)operator(\)) operator({) operator(|)ident(e)operator(|) ident(matches) operator(<<) ident(e)operator(.)ident(text) operator(}) - reserved(if) ident(matches)operator(.)ident(empty?) reserved(then) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string not found in document)delimiter(")>operator(,) ident(expression)operator(\)) - ident(flunk)operator(()ident(msg)operator(\)) - reserved(return) - reserved(elsif) ident(matches)operator(.)ident(length) operator(<) integer(2) reserved(then) - ident(matches) operator(=) ident(matches)operator(.)ident(first) - reserved(end) - - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string found , not )delimiter(")>operator(,) ident(expression)operator(,) ident(matches)operator(,) ident(expected)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(matches) operator(==) ident(expected) operator(}) - reserved(end) - - comment(# Assert the template object with the given name is an Active Record descendant and is valid.) - reserved(def) method(assert_valid_record)operator(()ident(key) operator(=) pre_constant(nil)operator(,) ident(message) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(record) operator(=) ident(find_record_in_template)operator(()ident(key)operator(\)) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string\))delimiter(")>operator(,) ident(record)operator(.)ident(errors)operator(.)ident(full_messages)operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(record)operator(.)ident(valid?) operator(}) - reserved(end) - - comment(# Assert the template object with the given name is an Active Record descendant and is invalid.) - reserved(def) method(assert_invalid_record)operator(()ident(key) operator(=) pre_constant(nil)operator(,) ident(message) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(record) operator(=) ident(find_record_in_template)operator(()ident(key)operator(\)) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) stringoperator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) operator(!)ident(record)operator(.)ident(valid?) operator(}) - reserved(end) - - comment(# Assert the template object with the given name is an Active Record descendant and the specified column(s\) are valid.) - reserved(def) method(assert_valid_column_on_record)operator(()ident(key) operator(=) pre_constant(nil)operator(,) ident(columns) operator(=) stringoperator(,) ident(message) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(record) operator(=) ident(find_record_in_template)operator(()ident(key)operator(\)) - ident(record)operator(.)ident(send)operator(()symbol(:validate)operator(\)) - - ident(cols) operator(=) ident(glue_columns)operator(()ident(columns)operator(\)) - ident(cols)operator(.)ident(delete_if) operator({) operator(|)ident(col)operator(|) operator(!)ident(record)operator(.)ident(errors)operator(.)ident(invalid?)operator(()ident(col)operator(\)) operator(}) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string\))delimiter(")>operator(,) ident(cols)operator(.)ident(join)operator(()stringoperator(\)) operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(cols)operator(.)ident(empty?) operator(}) - reserved(end) - - comment(# Assert the template object with the given name is an Active Record descendant and the specified column(s\) are invalid.) - reserved(def) method(assert_invalid_column_on_record)operator(()ident(key) operator(=) pre_constant(nil)operator(,) ident(columns) operator(=) stringoperator(,) ident(message) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(record) operator(=) ident(find_record_in_template)operator(()ident(key)operator(\)) - ident(record)operator(.)ident(send)operator(()symbol(:validate)operator(\)) - - ident(cols) operator(=) ident(glue_columns)operator(()ident(columns)operator(\)) - ident(cols)operator(.)ident(delete_if) operator({) operator(|)ident(col)operator(|) ident(record)operator(.)ident(errors)operator(.)ident(invalid?)operator(()ident(col)operator(\)) operator(}) - ident(msg) operator(=) ident(build_message)operator(()ident(message)operator(,) string\))delimiter(")>operator(,) ident(cols)operator(.)ident(join)operator(()stringoperator(\)) operator(\)) - ident(assert_block)operator(()ident(msg)operator(\)) operator({) ident(cols)operator(.)ident(empty?) operator(}) - reserved(end) - - ident(private) - reserved(def) method(glue_columns)operator(()ident(columns)operator(\)) - ident(cols) operator(=) operator([)operator(]) - ident(cols) operator(<<) ident(columns) reserved(if) ident(columns)operator(.)ident(class) operator(==) constant(String) - ident(cols) operator(+=) ident(columns) reserved(if) ident(columns)operator(.)ident(class) operator(==) constant(Array) - ident(cols) - reserved(end) - - reserved(def) method(find_record_in_template)operator(()ident(key) operator(=) pre_constant(nil)operator(\)) - ident(assert_template_has)operator(()ident(key)operator(\)) - ident(record) operator(=) instance_variable(@response)operator(.)ident(template_objects)operator([)ident(key)operator(]) - - ident(assert_not_nil)operator(()ident(record)operator(\)) - ident(assert_kind_of) constant(ActiveRecord)operator(::)constant(Base)operator(,) ident(record) - - reserved(return) ident(record) - reserved(end) - reserved(end) - reserved(end) -ident(endmodule) constant(ActionController) - reserved(class) class(Base) - ident(protected) - comment(# Deprecated in favor of calling redirect_to directly with the path.) - reserved(def) method(redirect_to_path)operator(()ident(path)operator(\)) comment(#:nodoc:) - ident(redirect_to)operator(()ident(path)operator(\)) - reserved(end) - - comment(# Deprecated in favor of calling redirect_to directly with the url. If the resource has moved permanently, it's possible to pass) - comment(# true as the second parameter and the browser will get "301 Moved Permanently" instead of "302 Found". This can also be done through) - comment(# just setting the headers["Status"] to "301 Moved Permanently" before using the redirect_to.) - reserved(def) method(redirect_to_url)operator(()ident(url)operator(,) ident(permanently) operator(=) pre_constant(false)operator(\)) comment(#:nodoc:) - ident(headers)operator([)stringoperator(]) operator(=) string reserved(if) ident(permanently) - ident(redirect_to)operator(()ident(url)operator(\)) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) - reserved(class) class(AbstractRequest) - comment(# Determine whether the body of a HTTP call is URL-encoded (default\)) - comment(# or matches one of the registered param_parsers. ) - comment(#) - comment(# For backward compatibility, the post format is extracted from the) - comment(# X-Post-Data-Format HTTP header if present.) - reserved(def) method(post_format) - reserved(case) ident(content_type)operator(.)ident(to_s) - reserved(when) string - symbol(:xml) - reserved(when) string - symbol(:yaml) - reserved(else) - symbol(:url_encoded) - reserved(end) - reserved(end) - - comment(# Is this a POST request formatted as XML or YAML?) - reserved(def) method(formatted_post?) - ident(post?) operator(&&) operator(()ident(post_format) operator(==) symbol(:yaml) operator(||) ident(post_format) operator(==) symbol(:xml)operator(\)) - reserved(end) - - comment(# Is this a POST request formatted as XML?) - reserved(def) method(xml_post?) - ident(post?) operator(&&) ident(post_format) operator(==) symbol(:xml) - reserved(end) - - comment(# Is this a POST request formatted as YAML?) - reserved(def) method(yaml_post?) - ident(post?) operator(&&) ident(post_format) operator(==) symbol(:yaml) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) comment(#:nodoc:) - reserved(module) class(Filters) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - ident(base)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(ActionController)operator(::)constant(Filters)operator(::)constant(InstanceMethods)operator(\)) - reserved(end) - - comment(# Filters enable controllers to run shared pre and post processing code for its actions. These filters can be used to do ) - comment(# authentication, caching, or auditing before the intended action is performed. Or to do localization or output ) - comment(# compression after the action has been performed.) - comment(#) - comment(# Filters have access to the request, response, and all the instance variables set by other filters in the chain) - comment(# or by the action (in the case of after filters\). Additionally, it's possible for a pre-processing before_filter) - comment(# to halt the processing before the intended action is processed by returning false or performing a redirect or render. ) - comment(# This is especially useful for filters like authentication where you're not interested in allowing the action to be ) - comment(# performed if the proper credentials are not in order.) - comment(#) - comment(# == Filter inheritance) - comment(#) - comment(# Controller inheritance hierarchies share filters downwards, but subclasses can also add new filters without) - comment(# affecting the superclass. For example:) - comment(#) - comment(# class BankController < ActionController::Base) - comment(# before_filter :audit) - comment(#) - comment(# private) - comment(# def audit) - comment(# # record the action and parameters in an audit log) - comment(# end) - comment(# end) - comment(#) - comment(# class VaultController < BankController) - comment(# before_filter :verify_credentials) - comment(#) - comment(# private) - comment(# def verify_credentials) - comment(# # make sure the user is allowed into the vault) - comment(# end) - comment(# end) - comment(#) - comment(# Now any actions performed on the BankController will have the audit method called before. On the VaultController,) - comment(# first the audit method is called, then the verify_credentials method. If the audit method returns false, then ) - comment(# verify_credentials and the intended action are never called.) - comment(#) - comment(# == Filter types) - comment(#) - comment(# A filter can take one of three forms: method reference (symbol\), external class, or inline method (proc\). The first) - comment(# is the most common and works by referencing a protected or private method somewhere in the inheritance hierarchy of) - comment(# the controller by use of a symbol. In the bank example above, both BankController and VaultController use this form.) - comment(#) - comment(# Using an external class makes for more easily reused generic filters, such as output compression. External filter classes) - comment(# are implemented by having a static +filter+ method on any class and then passing this class to the filter method. Example:) - comment(#) - comment(# class OutputCompressionFilter) - comment(# def self.filter(controller\)) - comment(# controller.response.body = compress(controller.response.body\)) - comment(# end) - comment(# end) - comment(#) - comment(# class NewspaperController < ActionController::Base) - comment(# after_filter OutputCompressionFilter) - comment(# end) - comment(#) - comment(# The filter method is passed the controller instance and is hence granted access to all aspects of the controller and can) - comment(# manipulate them as it sees fit.) - comment(#) - comment(# The inline method (using a proc\) can be used to quickly do something small that doesn't require a lot of explanation. ) - comment(# Or just as a quick test. It works like this:) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# before_filter { |controller| false if controller.params["stop_action"] }) - comment(# end) - comment(#) - comment(# As you can see, the block expects to be passed the controller after it has assigned the request to the internal variables.) - comment(# This means that the block has access to both the request and response objects complete with convenience methods for params,) - comment(# session, template, and assigns. Note: The inline method doesn't strictly have to be a block; any object that responds to call) - comment(# and returns 1 or -1 on arity will do (such as a Proc or an Method object\).) - comment(#) - comment(# == Filter chain ordering) - comment(#) - comment(# Using before_filter and after_filter appends the specified filters to the existing chain. That's usually) - comment(# just fine, but some times you care more about the order in which the filters are executed. When that's the case, you) - comment(# can use prepend_before_filter and prepend_after_filter. Filters added by these methods will be put at the) - comment(# beginning of their respective chain and executed before the rest. For example:) - comment(#) - comment(# class ShoppingController) - comment(# before_filter :verify_open_shop) - comment(#) - comment(# class CheckoutController) - comment(# prepend_before_filter :ensure_items_in_cart, :ensure_items_in_stock) - comment(#) - comment(# The filter chain for the CheckoutController is now :ensure_items_in_cart, :ensure_items_in_stock,) - comment(# :verify_open_shop. So if either of the ensure filters return false, we'll never get around to see if the shop ) - comment(# is open or not.) - comment(#) - comment(# You may pass multiple filter arguments of each type as well as a filter block.) - comment(# If a block is given, it is treated as the last argument.) - comment(#) - comment(# == Around filters) - comment(#) - comment(# In addition to the individual before and after filters, it's also possible to specify that a single object should handle) - comment(# both the before and after call. That's especially useful when you need to keep state active between the before and after,) - comment(# such as the example of a benchmark filter below:) - comment(# ) - comment(# class WeblogController < ActionController::Base) - comment(# around_filter BenchmarkingFilter.new) - comment(# ) - comment(# # Before this action is performed, BenchmarkingFilter#before(controller\) is executed) - comment(# def index) - comment(# end) - comment(# # After this action has been performed, BenchmarkingFilter#after(controller\) is executed) - comment(# end) - comment(#) - comment(# class BenchmarkingFilter) - comment(# def initialize) - comment(# @runtime) - comment(# end) - comment(# ) - comment(# def before) - comment(# start_timer) - comment(# end) - comment(# ) - comment(# def after) - comment(# stop_timer) - comment(# report_result) - comment(# end) - comment(# end) - comment(#) - comment(# == Filter chain skipping) - comment(#) - comment(# Some times its convenient to specify a filter chain in a superclass that'll hold true for the majority of the ) - comment(# subclasses, but not necessarily all of them. The subclasses that behave in exception can then specify which filters) - comment(# they would like to be relieved of. Examples) - comment(#) - comment(# class ApplicationController < ActionController::Base) - comment(# before_filter :authenticate) - comment(# end) - comment(#) - comment(# class WeblogController < ApplicationController) - comment(# # will run the :authenticate filter) - comment(# end) - comment(#) - comment(# class SignupController < ApplicationController) - comment(# # will not run the :authenticate filter) - comment(# skip_before_filter :authenticate) - comment(# end) - comment(#) - comment(# == Filter conditions) - comment(#) - comment(# Filters can be limited to run for only specific actions. This can be expressed either by listing the actions to) - comment(# exclude or the actions to include when executing the filter. Available conditions are +:only+ or +:except+, both ) - comment(# of which accept an arbitrary number of method references. For example:) - comment(#) - comment(# class Journal < ActionController::Base) - comment(# # only require authentication if the current action is edit or delete) - comment(# before_filter :authorize, :only => [ :edit, :delete ]) - comment(# ) - comment(# private) - comment(# def authorize) - comment(# # redirect to login unless authenticated) - comment(# end) - comment(# end) - comment(# ) - comment(# When setting conditions on inline method (proc\) filters the condition must come first and be placed in parentheses.) - comment(#) - comment(# class UserPreferences < ActionController::Base) - comment(# before_filter(:except => :new\) { # some proc ... }) - comment(# # ...) - comment(# end) - comment(#) - reserved(module) class(ClassMethods) - comment(# The passed filters will be appended to the array of filters that's run _before_ actions) - comment(# on this controller are performed.) - reserved(def) method(append_before_filter)operator(()operator(*)ident(filters)operator(,) operator(&)ident(block)operator(\)) - ident(conditions) operator(=) ident(extract_conditions!)operator(()ident(filters)operator(\)) - ident(filters) operator(<<) ident(block) reserved(if) ident(block_given?) - ident(add_action_conditions)operator(()ident(filters)operator(,) ident(conditions)operator(\)) - ident(append_filter_to_chain)operator(()stringoperator(,) ident(filters)operator(\)) - reserved(end) - - comment(# The passed filters will be prepended to the array of filters that's run _before_ actions) - comment(# on this controller are performed.) - reserved(def) method(prepend_before_filter)operator(()operator(*)ident(filters)operator(,) operator(&)ident(block)operator(\)) - ident(conditions) operator(=) ident(extract_conditions!)operator(()ident(filters)operator(\)) - ident(filters) operator(<<) ident(block) reserved(if) ident(block_given?) - ident(add_action_conditions)operator(()ident(filters)operator(,) ident(conditions)operator(\)) - ident(prepend_filter_to_chain)operator(()stringoperator(,) ident(filters)operator(\)) - reserved(end) - - comment(# Short-hand for append_before_filter since that's the most common of the two.) - reserved(alias) symbol(:before_filter) symbol(:append_before_filter) - - comment(# The passed filters will be appended to the array of filters that's run _after_ actions) - comment(# on this controller are performed.) - reserved(def) method(append_after_filter)operator(()operator(*)ident(filters)operator(,) operator(&)ident(block)operator(\)) - ident(conditions) operator(=) ident(extract_conditions!)operator(()ident(filters)operator(\)) - ident(filters) operator(<<) ident(block) reserved(if) ident(block_given?) - ident(add_action_conditions)operator(()ident(filters)operator(,) ident(conditions)operator(\)) - ident(append_filter_to_chain)operator(()stringoperator(,) ident(filters)operator(\)) - reserved(end) - - comment(# The passed filters will be prepended to the array of filters that's run _after_ actions) - comment(# on this controller are performed.) - reserved(def) method(prepend_after_filter)operator(()operator(*)ident(filters)operator(,) operator(&)ident(block)operator(\)) - ident(conditions) operator(=) ident(extract_conditions!)operator(()ident(filters)operator(\)) - ident(filters) operator(<<) ident(block) reserved(if) ident(block_given?) - ident(add_action_conditions)operator(()ident(filters)operator(,) ident(conditions)operator(\)) - ident(prepend_filter_to_chain)operator(()stringoperator(,) ident(filters)operator(\)) - reserved(end) - - comment(# Short-hand for append_after_filter since that's the most common of the two.) - reserved(alias) symbol(:after_filter) symbol(:append_after_filter) - - comment(# The passed filters will have their +before+ method appended to the array of filters that's run both before actions) - comment(# on this controller are performed and have their +after+ method prepended to the after actions. The filter objects must all ) - comment(# respond to both +before+ and +after+. So if you do append_around_filter A.new, B.new, the callstack will look like:) - comment(#) - comment(# B#before) - comment(# A#before) - comment(# A#after) - comment(# B#after) - reserved(def) method(append_around_filter)operator(()operator(*)ident(filters)operator(\)) - ident(conditions) operator(=) ident(extract_conditions!)operator(()ident(filters)operator(\)) - reserved(for) ident(filter) reserved(in) ident(filters)operator(.)ident(flatten) - ident(ensure_filter_responds_to_before_and_after)operator(()ident(filter)operator(\)) - ident(append_before_filter)operator(()ident(conditions) operator(||) operator({)operator(})operator(\)) operator({) operator(|)ident(c)operator(|) ident(filter)operator(.)ident(before)operator(()ident(c)operator(\)) operator(}) - ident(prepend_after_filter)operator(()ident(conditions) operator(||) operator({)operator(})operator(\)) operator({) operator(|)ident(c)operator(|) ident(filter)operator(.)ident(after)operator(()ident(c)operator(\)) operator(}) - reserved(end) - reserved(end) - - comment(# The passed filters will have their +before+ method prepended to the array of filters that's run both before actions) - comment(# on this controller are performed and have their +after+ method appended to the after actions. The filter objects must all ) - comment(# respond to both +before+ and +after+. So if you do prepend_around_filter A.new, B.new, the callstack will look like:) - comment(#) - comment(# A#before) - comment(# B#before) - comment(# B#after) - comment(# A#after) - reserved(def) method(prepend_around_filter)operator(()operator(*)ident(filters)operator(\)) - reserved(for) ident(filter) reserved(in) ident(filters)operator(.)ident(flatten) - ident(ensure_filter_responds_to_before_and_after)operator(()ident(filter)operator(\)) - ident(prepend_before_filter) operator({) operator(|)ident(c)operator(|) ident(filter)operator(.)ident(before)operator(()ident(c)operator(\)) operator(}) - ident(append_after_filter) operator({) operator(|)ident(c)operator(|) ident(filter)operator(.)ident(after)operator(()ident(c)operator(\)) operator(}) - reserved(end) - reserved(end) - - comment(# Short-hand for append_around_filter since that's the most common of the two.) - reserved(alias) symbol(:around_filter) symbol(:append_around_filter) - - comment(# Removes the specified filters from the +before+ filter chain. Note that this only works for skipping method-reference ) - comment(# filters, not procs. This is especially useful for managing the chain in inheritance hierarchies where only one out) - comment(# of many sub-controllers need a different hierarchy.) - comment(#) - comment(# You can control the actions to skip the filter for with the :only and :except options, ) - comment(# just like when you apply the filters.) - reserved(def) method(skip_before_filter)operator(()operator(*)ident(filters)operator(\)) - reserved(if) ident(conditions) operator(=) ident(extract_conditions!)operator(()ident(filters)operator(\)) - ident(remove_contradicting_conditions!)operator(()ident(filters)operator(,) ident(conditions)operator(\)) - ident(conditions)operator([)symbol(:only)operator(])operator(,) ident(conditions)operator([)symbol(:except)operator(]) operator(=) ident(conditions)operator([)symbol(:except)operator(])operator(,) ident(conditions)operator([)symbol(:only)operator(]) - ident(add_action_conditions)operator(()ident(filters)operator(,) ident(conditions)operator(\)) - reserved(else) - reserved(for) ident(filter) reserved(in) ident(filters)operator(.)ident(flatten) - ident(write_inheritable_attribute)operator(()stringoperator(,) ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(-) operator([) ident(filter) operator(])operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Removes the specified filters from the +after+ filter chain. Note that this only works for skipping method-reference ) - comment(# filters, not procs. This is especially useful for managing the chain in inheritance hierarchies where only one out) - comment(# of many sub-controllers need a different hierarchy.) - comment(#) - comment(# You can control the actions to skip the filter for with the :only and :except options, ) - comment(# just like when you apply the filters.) - reserved(def) method(skip_after_filter)operator(()operator(*)ident(filters)operator(\)) - reserved(if) ident(conditions) operator(=) ident(extract_conditions!)operator(()ident(filters)operator(\)) - ident(remove_contradicting_conditions!)operator(()ident(filters)operator(,) ident(conditions)operator(\)) - ident(conditions)operator([)symbol(:only)operator(])operator(,) ident(conditions)operator([)symbol(:except)operator(]) operator(=) ident(conditions)operator([)symbol(:except)operator(])operator(,) ident(conditions)operator([)symbol(:only)operator(]) - ident(add_action_conditions)operator(()ident(filters)operator(,) ident(conditions)operator(\)) - reserved(else) - reserved(for) ident(filter) reserved(in) ident(filters)operator(.)ident(flatten) - ident(write_inheritable_attribute)operator(()stringoperator(,) ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(-) operator([) ident(filter) operator(])operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Returns all the before filters for this class and all its ancestors.) - reserved(def) method(before_filters) comment(#:nodoc:) - instance_variable(@before_filters) operator(||=) ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator([)operator(]) - reserved(end) - - comment(# Returns all the after filters for this class and all its ancestors.) - reserved(def) method(after_filters) comment(#:nodoc:) - instance_variable(@after_filters) operator(||=) ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator([)operator(]) - reserved(end) - - comment(# Returns a mapping between filters and the actions that may run them.) - reserved(def) method(included_actions) comment(#:nodoc:) - instance_variable(@included_actions) operator(||=) ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator({)operator(}) - reserved(end) - - comment(# Returns a mapping between filters and actions that may not run them.) - reserved(def) method(excluded_actions) comment(#:nodoc:) - instance_variable(@excluded_actions) operator(||=) ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator({)operator(}) - reserved(end) - - ident(private) - reserved(def) method(append_filter_to_chain)operator(()ident(condition)operator(,) ident(filters)operator(\)) - ident(write_inheritable_array)operator(()stringcontent(_filters)delimiter(")>operator(,) ident(filters)operator(\)) - reserved(end) - - reserved(def) method(prepend_filter_to_chain)operator(()ident(condition)operator(,) ident(filters)operator(\)) - ident(old_filters) operator(=) ident(read_inheritable_attribute)operator(()stringcontent(_filters)delimiter(")>operator(\)) operator(||) operator([)operator(]) - ident(write_inheritable_attribute)operator(()stringcontent(_filters)delimiter(")>operator(,) ident(filters) operator(+) ident(old_filters)operator(\)) - reserved(end) - - reserved(def) method(ensure_filter_responds_to_before_and_after)operator(()ident(filter)operator(\)) - reserved(unless) ident(filter)operator(.)ident(respond_to?)operator(()symbol(:before)operator(\)) operator(&&) ident(filter)operator(.)ident(respond_to?)operator(()symbol(:after)operator(\)) - ident(raise) constant(ActionControllerError)operator(,) string - reserved(end) - reserved(end) - - reserved(def) method(extract_conditions!)operator(()ident(filters)operator(\)) - reserved(return) pre_constant(nil) reserved(unless) ident(filters)operator(.)ident(last)operator(.)ident(is_a?) constant(Hash) - ident(filters)operator(.)ident(pop) - reserved(end) - - reserved(def) method(add_action_conditions)operator(()ident(filters)operator(,) ident(conditions)operator(\)) - reserved(return) reserved(unless) ident(conditions) - ident(included)operator(,) ident(excluded) operator(=) ident(conditions)operator([)symbol(:only)operator(])operator(,) ident(conditions)operator([)symbol(:except)operator(]) - ident(write_inheritable_hash)operator(()stringoperator(,) ident(condition_hash)operator(()ident(filters)operator(,) ident(included)operator(\))operator(\)) operator(&&) reserved(return) reserved(if) ident(included) - ident(write_inheritable_hash)operator(()stringoperator(,) ident(condition_hash)operator(()ident(filters)operator(,) ident(excluded)operator(\))operator(\)) reserved(if) ident(excluded) - reserved(end) - - reserved(def) method(condition_hash)operator(()ident(filters)operator(,) operator(*)ident(actions)operator(\)) - ident(filters)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({)operator(|)ident(hash)operator(,) ident(filter)operator(|) ident(hash)operator(.)ident(merge)operator(()ident(filter) operator(=)operator(>) ident(actions)operator(.)ident(flatten)operator(.)ident(map) operator({)operator(|)ident(action)operator(|) ident(action)operator(.)ident(to_s)operator(})operator(\))operator(}) - reserved(end) - - reserved(def) method(remove_contradicting_conditions!)operator(()ident(filters)operator(,) ident(conditions)operator(\)) - reserved(return) reserved(unless) ident(conditions)operator([)symbol(:only)operator(]) - ident(filters)operator(.)ident(each) reserved(do) operator(|)ident(filter)operator(|) - reserved(next) reserved(unless) ident(included_actions_for_filter) operator(=) operator(()ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator({)operator(})operator(\))operator([)ident(filter)operator(]) - operator([)operator(*)ident(conditions)operator([)symbol(:only)operator(])operator(])operator(.)ident(each) reserved(do) operator(|)ident(conditional_action)operator(|) - ident(conditional_action) operator(=) ident(conditional_action)operator(.)ident(to_s) - ident(included_actions_for_filter)operator(.)ident(delete)operator(()ident(conditional_action)operator(\)) reserved(if) ident(included_actions_for_filter)operator(.)ident(include?)operator(()ident(conditional_action)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(module) class(InstanceMethods) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:perform_action_without_filters)operator(,) symbol(:perform_action) - ident(alias_method) symbol(:perform_action)operator(,) symbol(:perform_action_with_filters) - - ident(alias_method) symbol(:process_without_filters)operator(,) symbol(:process) - ident(alias_method) symbol(:process)operator(,) symbol(:process_with_filters) - - ident(alias_method) symbol(:process_cleanup_without_filters)operator(,) symbol(:process_cleanup) - ident(alias_method) symbol(:process_cleanup)operator(,) symbol(:process_cleanup_with_filters) - reserved(end) - reserved(end) - - reserved(def) method(perform_action_with_filters) - ident(before_action_result) operator(=) ident(before_action) - - reserved(unless) ident(before_action_result) operator(==) pre_constant(false) operator(||) ident(performed?) - ident(perform_action_without_filters) - ident(after_action) - reserved(end) - - instance_variable(@before_filter_chain_aborted) operator(=) operator(()ident(before_action_result) operator(==) pre_constant(false)operator(\)) - reserved(end) - - reserved(def) method(process_with_filters)operator(()ident(request)operator(,) ident(response)operator(,) ident(method) operator(=) symbol(:perform_action)operator(,) operator(*)ident(arguments)operator(\)) comment(#:nodoc:) - instance_variable(@before_filter_chain_aborted) operator(=) pre_constant(false) - ident(process_without_filters)operator(()ident(request)operator(,) ident(response)operator(,) ident(method)operator(,) operator(*)ident(arguments)operator(\)) - reserved(end) - - comment(# Calls all the defined before-filter filters, which are added by using "before_filter :method".) - comment(# If any of the filters return false, no more filters will be executed and the action is aborted.) - reserved(def) method(before_action) comment(#:doc:) - ident(call_filters)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(before_filters)operator(\)) - reserved(end) - - comment(# Calls all the defined after-filter filters, which are added by using "after_filter :method".) - comment(# If any of the filters return false, no more filters will be executed.) - reserved(def) method(after_action) comment(#:doc:) - ident(call_filters)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(after_filters)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(call_filters)operator(()ident(filters)operator(\)) - ident(filters)operator(.)ident(each) reserved(do) operator(|)ident(filter)operator(|) - reserved(next) reserved(if) ident(action_exempted?)operator(()ident(filter)operator(\)) - - ident(filter_result) operator(=) reserved(case) - reserved(when) ident(filter)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - pre_constant(self)operator(.)ident(send)operator(()ident(filter)operator(\)) - reserved(when) ident(filter_block?)operator(()ident(filter)operator(\)) - ident(filter)operator(.)ident(call)operator(()pre_constant(self)operator(\)) - reserved(when) ident(filter_class?)operator(()ident(filter)operator(\)) - ident(filter)operator(.)ident(filter)operator(()pre_constant(self)operator(\)) - reserved(else) - ident(raise)operator(() - constant(ActionControllerError)operator(,) - string - operator(\)) - reserved(end) - - reserved(if) ident(filter_result) operator(==) pre_constant(false) - ident(logger)operator(.)ident(info) stringcontent(] returned false)delimiter(")> reserved(if) ident(logger) - reserved(return) pre_constant(false) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(filter_block?)operator(()ident(filter)operator(\)) - ident(filter)operator(.)ident(respond_to?)operator(()stringoperator(\)) operator(&&) operator(()ident(filter)operator(.)ident(arity) operator(==) integer(1) operator(||) ident(filter)operator(.)ident(arity) operator(==) integer(-1)operator(\)) - reserved(end) - - reserved(def) method(filter_class?)operator(()ident(filter)operator(\)) - ident(filter)operator(.)ident(respond_to?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(action_exempted?)operator(()ident(filter)operator(\)) - reserved(case) - reserved(when) ident(ia) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(included_actions)operator([)ident(filter)operator(]) - operator(!)ident(ia)operator(.)ident(include?)operator(()ident(action_name)operator(\)) - reserved(when) ident(ea) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(excluded_actions)operator([)ident(filter)operator(]) - ident(ea)operator(.)ident(include?)operator(()ident(action_name)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(process_cleanup_with_filters) - reserved(if) instance_variable(@before_filter_chain_aborted) - ident(close_session) - reserved(else) - ident(process_cleanup_without_filters) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) comment(#:nodoc:) - comment(# The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed) - comment(# to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create action) - comment(# that sets flash[:notice] = "Successfully created" before redirecting to a display action that can then expose ) - comment(# the flash to its template. Actually, that exposure is automatically done. Example:) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# def create) - comment(# # save post) - comment(# flash[:notice] = "Successfully created post") - comment(# redirect_to :action => "display", :params => { :id => post.id }) - comment(# end) - comment(#) - comment(# def display) - comment(# # doesn't need to assign the flash notice to the template, that's done automatically) - comment(# end) - comment(# end) - comment(#) - comment(# display.rhtml) - comment(# <% if @flash[:notice] %>
<%= @flash[:notice] %>
<% end %>) - comment(#) - comment(# This example just places a string in the flash, but you can put any object in there. And of course, you can put as many) - comment(# as you like at a time too. Just remember: They'll be gone by the time the next action has been performed.) - comment(#) - comment(# See docs on the FlashHash class for more details about the flash.) - reserved(module) class(Flash) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(send) symbol(:include)operator(,) constant(InstanceMethods) - - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:assign_shortcuts_without_flash)operator(,) symbol(:assign_shortcuts) - ident(alias_method) symbol(:assign_shortcuts)operator(,) symbol(:assign_shortcuts_with_flash) - - ident(alias_method) symbol(:process_cleanup_without_flash)operator(,) symbol(:process_cleanup) - ident(alias_method) symbol(:process_cleanup)operator(,) symbol(:process_cleanup_with_flash) - reserved(end) - reserved(end) - - - reserved(class) class(FlashNow) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(flash)operator(\)) - instance_variable(@flash) operator(=) ident(flash) - reserved(end) - - reserved(def) method([]=)operator(()ident(k)operator(,) ident(v)operator(\)) - instance_variable(@flash)operator([)ident(k)operator(]) operator(=) ident(v) - instance_variable(@flash)operator(.)ident(discard)operator(()ident(k)operator(\)) - ident(v) - reserved(end) - - reserved(def) method([])operator(()ident(k)operator(\)) - instance_variable(@flash)operator([)ident(k)operator(]) - reserved(end) - reserved(end) - - reserved(class) class(FlashHash) operator(<) constant(Hash) - reserved(def) method(initialize) comment(#:nodoc:) - reserved(super) - instance_variable(@used) operator(=) operator({)operator(}) - reserved(end) - - reserved(def) method([]=)operator(()ident(k)operator(,) ident(v)operator(\)) comment(#:nodoc:) - ident(keep)operator(()ident(k)operator(\)) - reserved(super) - reserved(end) - - reserved(def) method(update)operator(()ident(h)operator(\)) comment(#:nodoc:) - ident(h)operator(.)ident(keys)operator(.)ident(each)operator({) operator(|)ident(k)operator(|) ident(discard)operator(()ident(k)operator(\)) operator(}) - reserved(super) - reserved(end) - - reserved(alias) symbol(:merge!) symbol(:update) - - reserved(def) method(replace)operator(()ident(h)operator(\)) comment(#:nodoc:) - instance_variable(@used) operator(=) operator({)operator(}) - reserved(super) - reserved(end) - - comment(# Sets a flash that will not be available to the next action, only to the current.) - comment(#) - comment(# flash.now[:message] = "Hello current action") - comment(# ) - comment(# This method enables you to use the flash as a central messaging system in your app.) - comment(# When you need to pass an object to the next action, you use the standard flash assign ([]=\).) - comment(# When you need to pass an object to the current action, you use now, and your object will) - comment(# vanish when the current action is done.) - comment(#) - comment(# Entries set via now are accessed the same way as standard entries: flash['my-key'].) - reserved(def) method(now) - constant(FlashNow)operator(.)ident(new) pre_constant(self) - reserved(end) - - comment(# Keeps either the entire current flash or a specific flash entry available for the next action:) - comment(#) - comment(# flash.keep # keeps the entire flash) - comment(# flash.keep(:notice\) # keeps only the "notice" entry, the rest of the flash is discarded) - reserved(def) method(keep)operator(()ident(k)operator(=)pre_constant(nil)operator(\)) - ident(use)operator(()ident(k)operator(,) pre_constant(false)operator(\)) - reserved(end) - - comment(# Marks the entire flash or a single flash entry to be discarded by the end of the current action) - comment(#) - comment(# flash.keep # keep entire flash available for the next action) - comment(# flash.discard(:warning\) # discard the "warning" entry (it'll still be available for the current action\)) - reserved(def) method(discard)operator(()ident(k)operator(=)pre_constant(nil)operator(\)) - ident(use)operator(()ident(k)operator(\)) - reserved(end) - - comment(# Mark for removal entries that were kept, and delete unkept ones.) - comment(#) - comment(# This method is called automatically by filters, so you generally don't need to care about it.) - reserved(def) method(sweep) comment(#:nodoc:) - ident(keys)operator(.)ident(each) reserved(do) operator(|)ident(k)operator(|) - reserved(unless) instance_variable(@used)operator([)ident(k)operator(]) - ident(use)operator(()ident(k)operator(\)) - reserved(else) - ident(delete)operator(()ident(k)operator(\)) - instance_variable(@used)operator(.)ident(delete)operator(()ident(k)operator(\)) - reserved(end) - reserved(end) - operator(()instance_variable(@used)operator(.)ident(keys) operator(-) ident(keys)operator(\))operator(.)ident(each)operator({)operator(|)ident(k)operator(|) instance_variable(@used)operator(.)ident(delete) ident(k) operator(}) comment(# clean up after keys that could have been left over by calling reject! or shift on the flash) - reserved(end) - - ident(private) - comment(# Used internally by the keep and discard methods) - comment(# use(\) # marks the entire flash as used) - comment(# use('msg'\) # marks the "msg" entry as used) - comment(# use(nil, false\) # marks the entire flash as unused (keeps it around for one more action\)) - comment(# use('msg', false\) # marks the "msg" entry as unused (keeps it around for one more action\)) - reserved(def) method(use)operator(()ident(k)operator(=)pre_constant(nil)operator(,) ident(v)operator(=)pre_constant(true)operator(\)) - reserved(unless) ident(k)operator(.)ident(nil?) - instance_variable(@used)operator([)ident(k)operator(]) operator(=) ident(v) - reserved(else) - ident(keys)operator(.)ident(each)operator({)operator(|)ident(key)operator(|) ident(use) ident(key)operator(,) ident(v) operator(}) - reserved(end) - reserved(end) - reserved(end) - - reserved(module) class(InstanceMethods) comment(#:nodoc:) - reserved(def) method(assign_shortcuts_with_flash)operator(()ident(request)operator(,) ident(response)operator(\)) comment(#:nodoc:) - ident(assign_shortcuts_without_flash)operator(()ident(request)operator(,) ident(response)operator(\)) - ident(flash)operator(()symbol(:refresh)operator(\)) - reserved(end) - - reserved(def) method(process_cleanup_with_flash) - ident(flash)operator(.)ident(sweep) reserved(if) instance_variable(@session) - ident(process_cleanup_without_flash) - reserved(end) - - ident(protected) - comment(# Access the contents of the flash. Use flash["notice"] to read a notice you put there or ) - comment(# flash["notice"] = "hello" to put a new one.) - comment(# Note that if sessions are disabled only flash.now will work.) - reserved(def) method(flash)operator(()ident(refresh) operator(=) pre_constant(false)operator(\)) comment(#:doc:) - reserved(if) instance_variable(@flash)operator(.)ident(nil?) operator(||) ident(refresh) - instance_variable(@flash) operator(=) - reserved(if) instance_variable(@session)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - comment(# @session is a Hash, if sessions are disabled) - comment(# we don't put the flash in the session in this case) - constant(FlashHash)operator(.)ident(new) - reserved(else) - comment(# otherwise, @session is a CGI::Session or a TestSession) - comment(# so make sure it gets retrieved from/saved to session storage after request processing) - instance_variable(@session)operator([)stringoperator(]) operator(||=) constant(FlashHash)operator(.)ident(new) - reserved(end) - reserved(end) - - instance_variable(@flash) - reserved(end) - - comment(# deprecated. use flash.keep instead) - reserved(def) method(keep_flash) comment(#:doc:) - ident(warn) string - ident(flash)operator(.)ident(keep) - reserved(end) - reserved(end) - reserved(end) -ident(endmodule) constant(ActionController) comment(#:nodoc:) - reserved(module) class(Helpers) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - - comment(# Initialize the base module to aggregate its helpers.) - ident(base)operator(.)ident(class_inheritable_accessor) symbol(:master_helper_module) - ident(base)operator(.)ident(master_helper_module) operator(=) constant(Module)operator(.)ident(new) - - comment(# Extend base with class methods to declare helpers.) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - - ident(base)operator(.)ident(class_eval) reserved(do) - comment(# Wrap inherited to create a new master helper module for subclasses.) - reserved(class) operator(<<) class(self) - ident(alias_method) symbol(:inherited_without_helper)operator(,) symbol(:inherited) - ident(alias_method) symbol(:inherited)operator(,) symbol(:inherited_with_helper) - reserved(end) - reserved(end) - reserved(end) - - comment(# The template helpers serve to relieve the templates from including the same inline code again and again. It's a) - comment(# set of standardized methods for working with forms (FormHelper\), dates (DateHelper\), texts (TextHelper\), and ) - comment(# Active Records (ActiveRecordHelper\) that's available to all templates by default.) - comment(#) - comment(# It's also really easy to make your own helpers and it's much encouraged to keep the template files free) - comment(# from complicated logic. It's even encouraged to bundle common compositions of methods from other helpers ) - comment(# (often the common helpers\) as they're used by the specific application.) - comment(# ) - comment(# module MyHelper) - comment(# def hello_world(\) "hello world" end) - comment(# end) - comment(# ) - comment(# MyHelper can now be included in a controller, like this:) - comment(# ) - comment(# class MyController < ActionController::Base) - comment(# helper :my_helper) - comment(# end) - comment(# ) - comment(# ...and, same as above, used in any template rendered from MyController, like this:) - comment(# ) - comment(# Let's hear what the helper has to say: <%= hello_world %>) - reserved(module) class(ClassMethods) - comment(# Makes all the (instance\) methods in the helper module available to templates rendered through this controller.) - comment(# See ActionView::Helpers (link:classes/ActionView/Helpers.html\) for more about making your own helper modules ) - comment(# available to the templates.) - reserved(def) method(add_template_helper)operator(()ident(helper_module)operator(\)) comment(#:nodoc:) - ident(master_helper_module)operator(.)ident(send)operator(()symbol(:include)operator(,) ident(helper_module)operator(\)) - reserved(end) - - comment(# Declare a helper:) - comment(# helper :foo) - comment(# requires 'foo_helper' and includes FooHelper in the template class.) - comment(# helper FooHelper) - comment(# includes FooHelper in the template class.) - comment(# helper { def foo(\) "#{bar} is the very best" end }) - comment(# evaluates the block in the template class, adding method #foo.) - comment(# helper(:three, BlindHelper\) { def mice(\) 'mice' end }) - comment(# does all three.) - reserved(def) method(helper)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(args)operator(.)ident(flatten)operator(.)ident(each) reserved(do) operator(|)ident(arg)operator(|) - reserved(case) ident(arg) - reserved(when) constant(Module) - ident(add_template_helper)operator(()ident(arg)operator(\)) - reserved(when) constant(String)operator(,) constant(Symbol) - ident(file_name) operator(=) ident(arg)operator(.)ident(to_s)operator(.)ident(underscore) operator(+) string - ident(class_name) operator(=) ident(file_name)operator(.)ident(camelize) - - reserved(begin) - ident(require_dependency)operator(()ident(file_name)operator(\)) - reserved(rescue) constant(LoadError) operator(=)operator(>) ident(load_error) - ident(requiree) operator(=) regexpoperator(.)ident(match)operator(()ident(load_error)operator(\))operator(.)ident(to_a)operator([)integer(1)operator(]) - ident(msg) operator(=) operator(()ident(requiree) operator(==) ident(file_name)operator(\)) operator(?) stringcontent(.rb)delimiter(")> operator(:) stringdelimiter(")> - ident(raise) constant(LoadError)operator(.)ident(new)operator(()ident(msg)operator(\))operator(.)ident(copy_blame!)operator(()ident(load_error)operator(\)) - reserved(end) - - ident(add_template_helper)operator(()ident(class_name)operator(.)ident(constantize)operator(\)) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - reserved(end) - - comment(# Evaluate block in template class if given.) - ident(master_helper_module)operator(.)ident(module_eval)operator(()operator(&)ident(block)operator(\)) reserved(if) ident(block_given?) - reserved(end) - - comment(# Declare a controller method as a helper. For example,) - comment(# helper_method :link_to) - comment(# def link_to(name, options\) ... end) - comment(# makes the link_to controller method available in the view.) - reserved(def) method(helper_method)operator(()operator(*)ident(methods)operator(\)) - ident(methods)operator(.)ident(flatten)operator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - ident(master_helper_module)operator(.)ident(module_eval) stringstringcontent((*args, &block\) - controller.send(%()inlinecontent(\), *args, &block\) - end)delimiter( - end_eval)> - reserved(end) - reserved(end) - - comment(# Declare a controller attribute as a helper. For example,) - comment(# helper_attr :name) - comment(# attr_accessor :name) - comment(# makes the name and name= controller methods available in the view.) - comment(# The is a convenience wrapper for helper_method.) - reserved(def) method(helper_attr)operator(()operator(*)ident(attrs)operator(\)) - ident(attrs)operator(.)ident(flatten)operator(.)ident(each) operator({) operator(|)ident(attr)operator(|) ident(helper_method)operator(()ident(attr)operator(,) stringcontent(=)delimiter(")>operator(\)) operator(}) - reserved(end) - - ident(private) - reserved(def) method(default_helper_module!) - ident(module_name) operator(=) ident(name)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - ident(module_path) operator(=) ident(module_name)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(map) operator({) operator(|)ident(m)operator(|) ident(m)operator(.)ident(underscore) operator(})operator(.)ident(join)operator(()stringoperator(\)) - ident(require_dependency) ident(module_path) - ident(helper) ident(module_name)operator(.)ident(constantize) - reserved(rescue) constant(LoadError) - ident(logger)operator(.)ident(debug)operator(()stringcontent(: missing default helper path )inlinedelimiter(")>operator(\)) reserved(if) ident(logger) - reserved(rescue) constant(NameError) - ident(logger)operator(.)ident(debug)operator(()stringcontent(: missing default helper module )inlinedelimiter(")>operator(\)) reserved(if) ident(logger) - reserved(end) - - reserved(def) method(inherited_with_helper)operator(()ident(child)operator(\)) - ident(inherited_without_helper)operator(()ident(child)operator(\)) - reserved(begin) - ident(child)operator(.)ident(master_helper_module) operator(=) constant(Module)operator(.)ident(new) - ident(child)operator(.)ident(master_helper_module)operator(.)ident(send) symbol(:include)operator(,) ident(master_helper_module) - ident(child)operator(.)ident(send) symbol(:default_helper_module!) - reserved(rescue) constant(MissingSourceFile) operator(=)operator(>) ident(e) - ident(raise) reserved(unless) ident(e)operator(.)ident(is_missing?)operator(()stringcontent(_helper)delimiter(")>operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActionController) - reserved(module) class(Integration) comment(#:nodoc:) - comment(# An integration Session instance represents a set of requests and responses) - comment(# performed sequentially by some virtual user. Becase you can instantiate) - comment(# multiple sessions and run them side-by-side, you can also mimic (to some) - comment(# limited extent\) multiple simultaneous users interacting with your system.) - comment(#) - comment(# Typically, you will instantiate a new session using IntegrationTest#open_session,) - comment(# rather than instantiating Integration::Session directly.) - reserved(class) class(Session) - ident(include) constant(Test)operator(::)constant(Unit)operator(::)constant(Assertions) - ident(include) constant(ActionController)operator(::)constant(TestProcess) - - comment(# The integer HTTP status code of the last request.) - ident(attr_reader) symbol(:status) - - comment(# The status message that accompanied the status code of the last request.) - ident(attr_reader) symbol(:status_message) - - comment(# The URI of the last request.) - ident(attr_reader) symbol(:path) - - comment(# The hostname used in the last request.) - ident(attr_accessor) symbol(:host) - - comment(# The remote_addr used in the last request.) - ident(attr_accessor) symbol(:remote_addr) - - comment(# The Accept header to send.) - ident(attr_accessor) symbol(:accept) - - comment(# A map of the cookies returned by the last response, and which will be) - comment(# sent with the next request.) - ident(attr_reader) symbol(:cookies) - - comment(# A map of the headers returned by the last response.) - ident(attr_reader) symbol(:headers) - - comment(# A reference to the controller instance used by the last request.) - ident(attr_reader) symbol(:controller) - - comment(# A reference to the request instance used by the last request.) - ident(attr_reader) symbol(:request) - - comment(# A reference to the response instance used by the last request.) - ident(attr_reader) symbol(:response) - - comment(# Create an initialize a new Session instance.) - reserved(def) method(initialize) - ident(reset!) - reserved(end) - - comment(# Resets the instance. This can be used to reset the state information) - comment(# in an existing session instance, so it can be used from a clean-slate) - comment(# condition.) - comment(#) - comment(# session.reset!) - reserved(def) method(reset!) - instance_variable(@status) operator(=) instance_variable(@path) operator(=) instance_variable(@headers) operator(=) pre_constant(nil) - instance_variable(@result) operator(=) instance_variable(@status_message) operator(=) pre_constant(nil) - instance_variable(@https) operator(=) pre_constant(false) - instance_variable(@cookies) operator(=) operator({)operator(}) - instance_variable(@controller) operator(=) instance_variable(@request) operator(=) instance_variable(@response) operator(=) pre_constant(nil) - - pre_constant(self)operator(.)ident(host) operator(=) string - pre_constant(self)operator(.)ident(remote_addr) operator(=) string - pre_constant(self)operator(.)ident(accept) operator(=) string - - reserved(unless) instance_variable(@named_routes_configured) - comment(# install the named routes in this session instance.) - ident(klass) operator(=) reserved(class)operator(<<)class(self)operator(;) pre_constant(self)operator(;) reserved(end) - constant(Routing)operator(::)constant(NamedRoutes)operator(.)ident(install)operator(()ident(klass)operator(\)) - - comment(# the helpers are made protected by default--we make them public for) - comment(# easier access during testing and troubleshooting.) - ident(klass)operator(.)ident(send)operator(()symbol(:public)operator(,) operator(*)constant(Routing)operator(::)constant(NamedRoutes)operator(::)constant(Helpers)operator(\)) - instance_variable(@named_routes_configured) operator(=) pre_constant(true) - reserved(end) - reserved(end) - - comment(# Specify whether or not the session should mimic a secure HTTPS request.) - comment(#) - comment(# session.https!) - comment(# session.https!(false\)) - reserved(def) method(https!)operator(()ident(flag)operator(=)pre_constant(true)operator(\)) - instance_variable(@https) operator(=) ident(flag) - reserved(end) - - comment(# Return +true+ if the session is mimicing a secure HTTPS request.) - comment(#) - comment(# if session.https?) - comment(# ...) - comment(# end) - reserved(def) method(https?) - instance_variable(@https) - reserved(end) - - comment(# Set the host name to use in the next request.) - comment(#) - comment(# session.host! "www.example.com") - reserved(def) method(host!)operator(()ident(name)operator(\)) - instance_variable(@host) operator(=) ident(name) - reserved(end) - - comment(# Follow a single redirect response. If the last response was not a) - comment(# redirect, an exception will be raised. Otherwise, the redirect is) - comment(# performed on the location header.) - reserved(def) method(follow_redirect!) - ident(raise) stringcontent( )inlinedelimiter(")> reserved(unless) ident(redirect?) - ident(get)operator(()ident(interpret_uri)operator(()ident(headers)operator([)stringoperator(])operator(.)ident(first)operator(\))operator(\)) - ident(status) - reserved(end) - - comment(# Performs a GET request, following any subsequent redirect. Note that) - comment(# the redirects are followed until the response is not a redirect--this) - comment(# means you may run into an infinite loop if your redirect loops back to) - comment(# itself.) - reserved(def) method(get_via_redirect)operator(()ident(path)operator(,) ident(args)operator(=)operator({)operator(})operator(\)) - ident(get) ident(path)operator(,) ident(args) - ident(follow_redirect!) reserved(while) ident(redirect?) - ident(status) - reserved(end) - - comment(# Performs a POST request, following any subsequent redirect. This is) - comment(# vulnerable to infinite loops, the same as #get_via_redirect.) - reserved(def) method(post_via_redirect)operator(()ident(path)operator(,) ident(args)operator(=)operator({)operator(})operator(\)) - ident(post) ident(path)operator(,) ident(args) - ident(follow_redirect!) reserved(while) ident(redirect?) - ident(status) - reserved(end) - - comment(# Returns +true+ if the last response was a redirect.) - reserved(def) method(redirect?) - ident(status)operator(/)integer(100) operator(==) integer(3) - reserved(end) - - comment(# Performs a GET request with the given parameters. The parameters may) - comment(# be +nil+, a Hash, or a string that is appropriately encoded) - comment(# (application/x-www-form-urlencoded or multipart/form-data\). The headers) - comment(# should be a hash. The keys will automatically be upcased, with the ) - comment(# prefix 'HTTP_' added if needed.) - reserved(def) method(get)operator(()ident(path)operator(,) ident(parameters)operator(=)pre_constant(nil)operator(,) ident(headers)operator(=)pre_constant(nil)operator(\)) - ident(process) symbol(:get)operator(,) ident(path)operator(,) ident(parameters)operator(,) ident(headers) - reserved(end) - - comment(# Performs a POST request with the given parameters. The parameters may) - comment(# be +nil+, a Hash, or a string that is appropriately encoded) - comment(# (application/x-www-form-urlencoded or multipart/form-data\). The headers) - comment(# should be a hash. The keys will automatically be upcased, with the ) - comment(# prefix 'HTTP_' added if needed.) - reserved(def) method(post)operator(()ident(path)operator(,) ident(parameters)operator(=)pre_constant(nil)operator(,) ident(headers)operator(=)pre_constant(nil)operator(\)) - ident(process) symbol(:post)operator(,) ident(path)operator(,) ident(parameters)operator(,) ident(headers) - reserved(end) - - comment(# Performs an XMLHttpRequest request with the given parameters, mimicing) - comment(# the request environment created by the Prototype library. The parameters) - comment(# may be +nil+, a Hash, or a string that is appropriately encoded) - comment(# (application/x-www-form-urlencoded or multipart/form-data\). The headers) - comment(# should be a hash. The keys will automatically be upcased, with the ) - comment(# prefix 'HTTP_' added if needed.) - reserved(def) method(xml_http_request)operator(()ident(path)operator(,) ident(parameters)operator(=)pre_constant(nil)operator(,) ident(headers)operator(=)pre_constant(nil)operator(\)) - ident(headers) operator(=) operator(()ident(headers) operator(||) operator({)operator(})operator(\))operator(.)ident(merge)operator(()string operator(=)operator(>) stringoperator(\)) - ident(post)operator(()ident(path)operator(,) ident(parameters)operator(,) ident(headers)operator(\)) - reserved(end) - - comment(# Returns the URL for the given options, according to the rules specified) - comment(# in the application's routes.) - reserved(def) method(url_for)operator(()ident(options)operator(\)) - ident(controller) operator(?) ident(controller)operator(.)ident(url_for)operator(()ident(options)operator(\)) operator(:) ident(generic_url_rewriter)operator(.)ident(rewrite)operator(()ident(options)operator(\)) - reserved(end) - - ident(private) - - reserved(class) class(MockCGI) operator(<) constant(CGI) comment(#:nodoc:) - ident(attr_accessor) symbol(:stdinput)operator(,) symbol(:stdoutput)operator(,) symbol(:env_table) - - reserved(def) method(initialize)operator(()ident(env)operator(,) ident(input)operator(=)pre_constant(nil)operator(\)) - pre_constant(self)operator(.)ident(env_table) operator(=) ident(env) - pre_constant(self)operator(.)ident(stdinput) operator(=) constant(StringIO)operator(.)ident(new)operator(()ident(input) operator(||) stringoperator(\)) - pre_constant(self)operator(.)ident(stdoutput) operator(=) constant(StringIO)operator(.)ident(new) - - reserved(super)operator(()operator(\)) - reserved(end) - reserved(end) - - comment(# Tailors the session based on the given URI, setting the HTTPS value) - comment(# and the hostname.) - reserved(def) method(interpret_uri)operator(()ident(path)operator(\)) - ident(location) operator(=) constant(URI)operator(.)ident(parse)operator(()ident(path)operator(\)) - ident(https!) constant(URI)operator(::)constant(HTTPS) operator(===) ident(location) reserved(if) ident(location)operator(.)ident(scheme) - ident(host!) ident(location)operator(.)ident(host) reserved(if) ident(location)operator(.)ident(host) - ident(location)operator(.)ident(query) operator(?) stringcontent(?)inlinedelimiter(")> operator(:) ident(location)operator(.)ident(path) - reserved(end) - - comment(# Performs the actual request.) - reserved(def) method(process)operator(()ident(method)operator(,) ident(path)operator(,) ident(parameters)operator(=)pre_constant(nil)operator(,) ident(headers)operator(=)pre_constant(nil)operator(\)) - ident(data) operator(=) ident(requestify)operator(()ident(parameters)operator(\)) - ident(path) operator(=) ident(interpret_uri)operator(()ident(path)operator(\)) reserved(if) ident(path) operator(=)operator(~) regexp - ident(path) operator(=) stringdelimiter(")> reserved(unless) ident(path)operator([)integer(0)operator(]) operator(==) integer(?/) - instance_variable(@path) operator(=) ident(path) - ident(env) operator(=) operator({)operator(}) - - reserved(if) ident(method) operator(==) symbol(:get) - ident(env)operator([)stringoperator(]) operator(=) ident(data) - ident(data) operator(=) pre_constant(nil) - reserved(end) - - ident(env)operator(.)ident(update)operator(() - string operator(=)operator(>) ident(method)operator(.)ident(to_s)operator(.)ident(upcase)operator(,) - string operator(=)operator(>) ident(path)operator(,) - string operator(=)operator(>) ident(host)operator(,) - string operator(=)operator(>) ident(remote_addr)operator(,) - string operator(=)operator(>) operator(()ident(https?) operator(?) string operator(:) stringoperator(\))operator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) ident(data) operator(?) ident(data)operator(.)ident(length)operator(.)ident(to_s) operator(:) pre_constant(nil)operator(,) - string operator(=)operator(>) ident(encode_cookies)operator(,) - string operator(=)operator(>) ident(https?) operator(?) string operator(:) stringoperator(,) - string operator(=)operator(>) ident(accept) - operator(\)) - - operator(()ident(headers) operator(||) operator({)operator(})operator(\))operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - ident(key) operator(=) ident(key)operator(.)ident(to_s)operator(.)ident(upcase)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - ident(key) operator(=) stringdelimiter(")> reserved(unless) ident(env)operator(.)ident(has_key?)operator(()ident(key)operator(\)) operator(||) ident(env) operator(=)operator(~) regexp - ident(env)operator([)ident(key)operator(]) operator(=) ident(value) - reserved(end) - - reserved(unless) constant(ActionController)operator(::)constant(Base)operator(.)ident(respond_to?)operator(()symbol(:clear_last_instantiation!)operator(\)) - constant(ActionController)operator(::)constant(Base)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(ControllerCapture)operator(\)) - reserved(end) - - constant(ActionController)operator(::)constant(Base)operator(.)ident(clear_last_instantiation!) - - ident(cgi) operator(=) constant(MockCGI)operator(.)ident(new)operator(()ident(env)operator(,) ident(data)operator(\)) - constant(Dispatcher)operator(.)ident(dispatch)operator(()ident(cgi)operator(,) constant(ActionController)operator(::)constant(CgiRequest)operator(::)constant(DEFAULT_SESSION_OPTIONS)operator(,) ident(cgi)operator(.)ident(stdoutput)operator(\)) - instance_variable(@result) operator(=) ident(cgi)operator(.)ident(stdoutput)operator(.)ident(string) - - instance_variable(@controller) operator(=) constant(ActionController)operator(::)constant(Base)operator(.)ident(last_instantiation) - instance_variable(@request) operator(=) instance_variable(@controller)operator(.)ident(request) - instance_variable(@response) operator(=) instance_variable(@controller)operator(.)ident(response) - - comment(# Decorate the response with the standard behavior of the TestResponse) - comment(# so that things like assert_response can be used in integration) - comment(# tests.) - instance_variable(@response)operator(.)ident(extend)operator(()constant(TestResponseBehavior)operator(\)) - - ident(parse_result) - reserved(return) ident(status) - reserved(end) - - comment(# Parses the result of the response and extracts the various values,) - comment(# like cookies, status, headers, etc.) - reserved(def) method(parse_result) - ident(headers)operator(,) ident(result_body) operator(=) instance_variable(@result)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) - - instance_variable(@headers) operator(=) constant(Hash)operator(.)ident(new) operator({) operator(|)ident(h)operator(,)ident(k)operator(|) ident(h)operator([)ident(k)operator(]) operator(=) operator([)operator(]) operator(}) - ident(headers)operator(.)ident(each_line) reserved(do) operator(|)ident(line)operator(|) - ident(key)operator(,) ident(value) operator(=) ident(line)operator(.)ident(strip)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) - instance_variable(@headers)operator([)ident(key)operator(.)ident(downcase)operator(]) operator(<<) ident(value) - reserved(end) - - operator(()instance_variable(@headers)operator([)stringoperator(]) operator(||) operator([)operator(]) operator(\))operator(.)ident(each) reserved(do) operator(|)ident(string)operator(|) - ident(name)operator(,) ident(value) operator(=) ident(string)operator(.)ident(match)operator(()regexpoperator(\))operator([)integer(1)operator(,)integer(2)operator(]) - instance_variable(@cookies)operator([)ident(name)operator(]) operator(=) ident(value) - reserved(end) - - instance_variable(@status)operator(,) instance_variable(@status_message) operator(=) instance_variable(@headers)operator([)stringoperator(])operator(.)ident(first)operator(.)ident(split)operator(()regexpoperator(\)) - instance_variable(@status) operator(=) instance_variable(@status)operator(.)ident(to_i) - reserved(end) - - comment(# Encode the cookies hash in a format suitable for passing to a ) - comment(# request.) - reserved(def) method(encode_cookies) - ident(cookies)operator(.)ident(inject)operator(()stringoperator(\)) reserved(do) operator(|)ident(string)operator(,) operator(()ident(name)operator(,) ident(value)operator(\))operator(|) - ident(string) operator(<<) stringcontent(=)inlinecontent(; )delimiter(")> - reserved(end) - reserved(end) - - comment(# Get a temporarly URL writer object) - reserved(def) method(generic_url_rewriter) - ident(cgi) operator(=) constant(MockCGI)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) ident(host)operator(,) - string operator(=)operator(>) ident(https?) operator(?) string operator(:) stringoperator(,) - string operator(=)operator(>) ident(https?) operator(?) string operator(:) stringoperator(\)) - constant(ActionController)operator(::)constant(UrlRewriter)operator(.)ident(new)operator(()constant(ActionController)operator(::)constant(CgiRequest)operator(.)ident(new)operator(()ident(cgi)operator(\))operator(,) operator({)operator(})operator(\)) - reserved(end) - - reserved(def) method(name_with_prefix)operator(()ident(prefix)operator(,) ident(name)operator(\)) - ident(prefix) operator(?) stringcontent([)inlinecontent(])delimiter(")> operator(:) ident(name)operator(.)ident(to_s) - reserved(end) - - comment(# Convert the given parameters to a request string. The parameters may) - comment(# be a string, +nil+, or a Hash.) - reserved(def) method(requestify)operator(()ident(parameters)operator(,) ident(prefix)operator(=)pre_constant(nil)operator(\)) - reserved(if) constant(Hash) operator(===) ident(parameters) - reserved(return) pre_constant(nil) reserved(if) ident(parameters)operator(.)ident(empty?) - ident(parameters)operator(.)ident(map) operator({) operator(|)ident(k)operator(,)ident(v)operator(|) ident(requestify)operator(()ident(v)operator(,) ident(name_with_prefix)operator(()ident(prefix)operator(,) ident(k)operator(\))operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(elsif) constant(Array) operator(===) ident(parameters) - ident(parameters)operator(.)ident(map) operator({) operator(|)ident(v)operator(|) ident(requestify)operator(()ident(v)operator(,) ident(name_with_prefix)operator(()ident(prefix)operator(,) stringoperator(\))operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(elsif) ident(prefix)operator(.)ident(nil?) - ident(parameters) - reserved(else) - stringcontent(=)inlinedelimiter(")> - reserved(end) - reserved(end) - - reserved(end) - - comment(# A module used to extend ActionController::Base, so that integration tests) - comment(# can capture the controller used to satisfy a request.) - reserved(module) class(ControllerCapture) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - ident(base)operator(.)ident(class_eval) reserved(do) - reserved(class) operator(<<)class(self) - ident(alias_method) symbol(:new_without_capture)operator(,) symbol(:new) - ident(alias_method) symbol(:new)operator(,) symbol(:new_with_capture) - reserved(end) - reserved(end) - reserved(end) - - reserved(module) class(ClassMethods) comment(#:nodoc:) - ident(mattr_accessor) symbol(:last_instantiation) - - reserved(def) method(clear_last_instantiation!) - pre_constant(self)operator(.)ident(last_instantiation) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(new_with_capture)operator(()operator(*)ident(args)operator(\)) - pre_constant(self)operator(.)ident(last_instantiation) operator(||=) ident(new_without_capture)operator(()operator(*)ident(args)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# An IntegrationTest is one that spans multiple controllers and actions,) - comment(# tying them all together to ensure they work together as expected. It tests) - comment(# more completely than either unit or functional tests do, exercising the) - comment(# entire stack, from the dispatcher to the database.) - comment(#) - comment(# At its simplest, you simply extend IntegrationTest and write your tests) - comment(# using the get/post methods:) - comment(#) - comment(# require "#{File.dirname(__FILE__\)}/test_helper") - comment(#) - comment(# class ExampleTest < ActionController::IntegrationTest) - comment(# fixtures :people) - comment(#) - comment(# def test_login) - comment(# # get the login page) - comment(# get "/login") - comment(# assert_equal 200, status) - comment(#) - comment(# # post the login and follow through to the home page) - comment(# post "/login", :username => people(:jamis\).username,) - comment(# :password => people(:jamis\).password) - comment(# follow_redirect!) - comment(# assert_equal 200, status) - comment(# assert_equal "/home", path) - comment(# end) - comment(# end) - comment(#) - comment(# However, you can also have multiple session instances open per test, and) - comment(# even extend those instances with assertions and methods to create a very) - comment(# powerful testing DSL that is specific for your application. You can even) - comment(# reference any named routes you happen to have defined!) - comment(#) - comment(# require "#{File.dirname(__FILE__\)}/test_helper") - comment(#) - comment(# class AdvancedTest < ActionController::IntegrationTest) - comment(# fixtures :people, :rooms) - comment(#) - comment(# def test_login_and_speak) - comment(# jamis, david = login(:jamis\), login(:david\)) - comment(# room = rooms(:office\)) - comment(#) - comment(# jamis.enter(room\)) - comment(# jamis.speak(room, "anybody home?"\)) - comment(#) - comment(# david.enter(room\)) - comment(# david.speak(room, "hello!"\)) - comment(# end) - comment(#) - comment(# private) - comment(#) - comment(# module CustomAssertions) - comment(# def enter(room\)) - comment(# # reference a named route, for maximum internal consistency!) - comment(# get(room_url(:id => room.id\)\)) - comment(# assert(...\)) - comment(# ...) - comment(# end) - comment(#) - comment(# def speak(room, message\)) - comment(# xml_http_request "/say/#{room.id}", :message => message) - comment(# assert(...\)) - comment(# ...) - comment(# end) - comment(# end) - comment(#) - comment(# def login(who\)) - comment(# open_session do |sess|) - comment(# sess.extend(CustomAssertions\)) - comment(# who = people(who\)) - comment(# sess.post "/login", :username => who.username,) - comment(# :password => who.password) - comment(# assert(...\)) - comment(# end) - comment(# end) - comment(# end) - reserved(class) class(IntegrationTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - comment(# Work around a bug in test/unit caused by the default test being named) - comment(# as a symbol (:default_test\), which causes regex test filters) - comment(# (like "ruby test.rb -n /foo/"\) to fail because =~ doesn't work on) - comment(# symbols.) - reserved(def) method(initialize)operator(()ident(name)operator(\)) comment(#:nodoc:) - reserved(super)operator(()ident(name)operator(.)ident(to_s)operator(\)) - reserved(end) - - comment(# Work around test/unit's requirement that every subclass of TestCase have) - comment(# at least one test method. Note that this implementation extends to all) - comment(# subclasses, as well, so subclasses of IntegrationTest may also exist) - comment(# without any test methods.) - reserved(def) method(run)operator(()operator(*)ident(args)operator(\)) comment(#:nodoc:) - reserved(return) reserved(if) instance_variable(@method_name) operator(==) string - reserved(super) - reserved(end) - - comment(# Because of how use_instantiated_fixtures and use_transactional_fixtures) - comment(# are defined, we need to treat them as special cases. Otherwise, users) - comment(# would potentially have to set their values for both Test::Unit::TestCase) - comment(# ActionController::IntegrationTest, since by the time the value is set on) - comment(# TestCase, IntegrationTest has already been defined and cannot inherit) - comment(# changes to those variables. So, we make those two attributes copy-on-write.) - - reserved(class) operator(<<) class(self) - reserved(def) method(use_transactional_fixtures=)operator(()ident(flag)operator(\)) comment(#:nodoc:) - instance_variable(@_use_transactional_fixtures) operator(=) pre_constant(true) - instance_variable(@use_transactional_fixtures) operator(=) ident(flag) - reserved(end) - - reserved(def) method(use_instantiated_fixtures=)operator(()ident(flag)operator(\)) comment(#:nodoc:) - instance_variable(@_use_instantiated_fixtures) operator(=) pre_constant(true) - instance_variable(@use_instantiated_fixtures) operator(=) ident(flag) - reserved(end) - - reserved(def) method(use_transactional_fixtures) comment(#:nodoc:) - instance_variable(@_use_transactional_fixtures) operator(?) - instance_variable(@use_transactional_fixtures) operator(:) - ident(superclass)operator(.)ident(use_transactional_fixtures) - reserved(end) - - reserved(def) method(use_instantiated_fixtures) comment(#:nodoc:) - instance_variable(@_use_instantiated_fixtures) operator(?) - instance_variable(@use_instantiated_fixtures) operator(:) - ident(superclass)operator(.)ident(use_instantiated_fixtures) - reserved(end) - reserved(end) - - comment(# Reset the current session. This is useful for testing multiple sessions) - comment(# in a single test case.) - reserved(def) method(reset!) - instance_variable(@integration_session) operator(=) ident(open_session) - reserved(end) - - stringoperator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - ident(define_method)operator(()ident(method)operator(\)) reserved(do) operator(|*)ident(args)operator(|) - ident(reset!) reserved(unless) instance_variable(@integration_session) - ident(returning) instance_variable(@integration_session)operator(.)ident(send)operator(()ident(method)operator(,) operator(*)ident(args)operator(\)) reserved(do) - ident(copy_session_variables!) - reserved(end) - reserved(end) - reserved(end) - - comment(# Open a new session instance. If a block is given, the new session is) - comment(# yielded to the block before being returned.) - comment(#) - comment(# session = open_session do |sess|) - comment(# sess.extend(CustomAssertions\)) - comment(# end) - comment(#) - comment(# By default, a single session is automatically created for you, but you) - comment(# can use this method to open multiple sessions that ought to be tested) - comment(# simultaneously.) - reserved(def) method(open_session) - ident(session) operator(=) constant(Integration)operator(::)constant(Session)operator(.)ident(new) - - comment(# delegate the fixture accessors back to the test instance) - ident(extras) operator(=) constant(Module)operator(.)ident(new) operator({) ident(attr_accessor) symbol(:delegate)operator(,) symbol(:test_result) operator(}) - pre_constant(self)operator(.)ident(class)operator(.)ident(fixture_table_names)operator(.)ident(each) reserved(do) operator(|)ident(table_name)operator(|) - ident(name) operator(=) ident(table_name)operator(.)ident(tr)operator(()stringoperator(,) stringoperator(\)) - reserved(next) reserved(unless) ident(respond_to?)operator(()ident(name)operator(\)) - ident(extras)operator(.)ident(send)operator(()symbol(:define_method)operator(,) ident(name)operator(\)) operator({) operator(|*)ident(args)operator(|) ident(delegate)operator(.)ident(send)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) operator(}) - reserved(end) - - comment(# delegate add_assertion to the test case) - ident(extras)operator(.)ident(send)operator(()symbol(:define_method)operator(,) symbol(:add_assertion)operator(\)) operator({) ident(test_result)operator(.)ident(add_assertion) operator(}) - ident(session)operator(.)ident(extend)operator(()ident(extras)operator(\)) - ident(session)operator(.)ident(delegate) operator(=) pre_constant(self) - ident(session)operator(.)ident(test_result) operator(=) instance_variable(@_result) - - reserved(yield) ident(session) reserved(if) ident(block_given?) - ident(session) - reserved(end) - - comment(# Copy the instance variables from the current session instance into the) - comment(# test instance.) - reserved(def) method(copy_session_variables!) comment(#:nodoc:) - reserved(return) reserved(unless) instance_variable(@integration_session) - stringoperator(.)ident(each) reserved(do) operator(|)ident(var)operator(|) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) instance_variable(@integration_session)operator(.)ident(send)operator(()ident(var)operator(\))operator(\)) - reserved(end) - reserved(end) - - comment(# Delegate unhandled messages to the current session instance.) - reserved(def) method(method_missing)operator(()ident(sym)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(reset!) reserved(unless) instance_variable(@integration_session) - ident(returning) instance_variable(@integration_session)operator(.)ident(send)operator(()ident(sym)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) reserved(do) - ident(copy_session_variables!) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) comment(#:nodoc:) - reserved(module) class(Layout) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:render_with_no_layout)operator(,) symbol(:render) - ident(alias_method) symbol(:render)operator(,) symbol(:render_with_a_layout) - - reserved(class) operator(<<) class(self) - ident(alias_method) symbol(:inherited_without_layout)operator(,) symbol(:inherited) - ident(alias_method) symbol(:inherited)operator(,) symbol(:inherited_with_layout) - reserved(end) - reserved(end) - reserved(end) - - comment(# Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in) - comment(# repeated setups. The inclusion pattern has pages that look like this:) - comment(#) - comment(# <%= render "shared/header" %>) - comment(# Hello World) - comment(# <%= render "shared/footer" %>) - comment(#) - comment(# This approach is a decent way of keeping common structures isolated from the changing content, but it's verbose) - comment(# and if you ever want to change the structure of these two includes, you'll have to change all the templates.) - comment(#) - comment(# With layouts, you can flip it around and have the common structure know where to insert changing content. This means) - comment(# that the header and footer are only mentioned in one place, like this:) - comment(#) - comment(# ) - comment(# <%= yield %>) - comment(# ) - comment(#) - comment(# And then you have content pages that look like this:) - comment(#) - comment(# hello world) - comment(#) - comment(# Not a word about common structures. At rendering time, the content page is computed and then inserted in the layout, ) - comment(# like this:) - comment(#) - comment(# ) - comment(# hello world) - comment(# ) - comment(#) - comment(# == Accessing shared variables) - comment(#) - comment(# Layouts have access to variables specified in the content pages and vice versa. This allows you to have layouts with) - comment(# references that won't materialize before rendering time:) - comment(#) - comment(#

<%= @page_title %>

) - comment(# <%= yield %>) - comment(#) - comment(# ...and content pages that fulfill these references _at_ rendering time:) - comment(#) - comment(# <% @page_title = "Welcome" %>) - comment(# Off-world colonies offers you a chance to start a new life) - comment(#) - comment(# The result after rendering is:) - comment(#) - comment(#

Welcome

) - comment(# Off-world colonies offers you a chance to start a new life) - comment(#) - comment(# == Automatic layout assignment) - comment(#) - comment(# If there is a template in app/views/layouts/ with the same name as the current controller then it will be automatically) - comment(# set as that controller's layout unless explicitly told otherwise. Say you have a WeblogController, for example. If a template named ) - comment(# app/views/layouts/weblog.rhtml or app/views/layouts/weblog.rxml exists then it will be automatically set as) - comment(# the layout for your WeblogController. You can create a layout with the name application.rhtml or application.rxml) - comment(# and this will be set as the default controller if there is no layout with the same name as the current controller and there is ) - comment(# no layout explicitly assigned with the +layout+ method. Nested controllers use the same folder structure for automatic layout.) - comment(# assignment. So an Admin::WeblogController will look for a template named app/views/layouts/admin/weblog.rhtml.) - comment(# Setting a layout explicitly will always override the automatic behaviour for the controller where the layout is set.) - comment(# Explicitly setting the layout in a parent class, though, will not override the child class's layout assignement if the child) - comment(# class has a layout with the same name. ) - comment(#) - comment(# == Inheritance for layouts) - comment(#) - comment(# Layouts are shared downwards in the inheritance hierarchy, but not upwards. Examples:) - comment(#) - comment(# class BankController < ActionController::Base) - comment(# layout "bank_standard") - comment(#) - comment(# class InformationController < BankController) - comment(#) - comment(# class VaultController < BankController) - comment(# layout :access_level_layout) - comment(#) - comment(# class EmployeeController < BankController) - comment(# layout nil) - comment(#) - comment(# The InformationController uses "bank_standard" inherited from the BankController, the VaultController overwrites) - comment(# and picks the layout dynamically, and the EmployeeController doesn't want to use a layout at all.) - comment(#) - comment(# == Types of layouts) - comment(#) - comment(# Layouts are basically just regular templates, but the name of this template needs not be specified statically. Sometimes) - comment(# you want to alternate layouts depending on runtime information, such as whether someone is logged in or not. This can) - comment(# be done either by specifying a method reference as a symbol or using an inline method (as a proc\).) - comment(#) - comment(# The method reference is the preferred approach to variable layouts and is used like this:) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# layout :writers_and_readers) - comment(#) - comment(# def index) - comment(# # fetching posts) - comment(# end) - comment(#) - comment(# private) - comment(# def writers_and_readers) - comment(# logged_in? ? "writer_layout" : "reader_layout") - comment(# end) - comment(#) - comment(# Now when a new request for the index action is processed, the layout will vary depending on whether the person accessing ) - comment(# is logged in or not.) - comment(#) - comment(# If you want to use an inline method, such as a proc, do something like this:) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# layout proc{ |controller| controller.logged_in? ? "writer_layout" : "reader_layout" }) - comment(#) - comment(# Of course, the most common way of specifying a layout is still just as a plain template name:) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# layout "weblog_standard") - comment(#) - comment(# If no directory is specified for the template name, the template will by default by looked for in +app/views/layouts/+.) - comment(#) - comment(# == Conditional layouts) - comment(#) - comment(# If you have a layout that by default is applied to all the actions of a controller, you still have the option of rendering) - comment(# a given action or set of actions without a layout, or restricting a layout to only a single action or a set of actions. The ) - comment(# :only and :except options can be passed to the layout call. For example:) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# layout "weblog_standard", :except => :rss) - comment(# ) - comment(# # ...) - comment(#) - comment(# end) - comment(#) - comment(# This will assign "weblog_standard" as the WeblogController's layout except for the +rss+ action, which will not wrap a layout ) - comment(# around the rendered view.) - comment(#) - comment(# Both the :only and :except condition can accept an arbitrary number of method references, so ) - comment(# #:except => [ :rss, :text_only ] is valid, as is :except => :rss.) - comment(#) - comment(# == Using a different layout in the action render call) - comment(# ) - comment(# If most of your actions use the same layout, it makes perfect sense to define a controller-wide layout as described above.) - comment(# Some times you'll have exceptions, though, where one action wants to use a different layout than the rest of the controller.) - comment(# This is possible using the render method. It's just a bit more manual work as you'll have to supply fully) - comment(# qualified template and layout names as this example shows:) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# def help) - comment(# render :action => "help/index", :layout => "help") - comment(# end) - comment(# end) - comment(#) - comment(# As you can see, you pass the template as the first parameter, the status code as the second ("200" is OK\), and the layout) - comment(# as the third.) - comment(#) - comment(# NOTE: The old notation for rendering the view from a layout was to expose the magic @content_for_layout instance ) - comment(# variable. The preferred notation now is to use yield, as documented above.) - reserved(module) class(ClassMethods) - comment(# If a layout is specified, all rendered actions will have their result rendered ) - comment(# when the layoutyield's. This layout can itself depend on instance variables assigned during action) - comment(# performance and have access to them as any normal template would.) - reserved(def) method(layout)operator(()ident(template_name)operator(,) ident(conditions) operator(=) operator({)operator(})operator(\)) - ident(add_layout_conditions)operator(()ident(conditions)operator(\)) - ident(write_inheritable_attribute) stringoperator(,) ident(template_name) - reserved(end) - - reserved(def) method(layout_conditions) comment(#:nodoc:) - instance_variable(@layout_conditions) operator(||=) ident(read_inheritable_attribute)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(default_layout) comment(#:nodoc:) - instance_variable(@default_layout) operator(||=) ident(read_inheritable_attribute)operator(()stringoperator(\)) - reserved(end) - - ident(private) - reserved(def) method(inherited_with_layout)operator(()ident(child)operator(\)) - ident(inherited_without_layout)operator(()ident(child)operator(\)) - ident(child)operator(.)ident(send) symbol(:include)operator(,) constant(Reloadable) - ident(layout_match) operator(=) ident(child)operator(.)ident(name)operator(.)ident(underscore)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - ident(child)operator(.)ident(layout)operator(()ident(layout_match)operator(\)) reserved(unless) ident(layout_list)operator(.)ident(grep)operator(()regexpchar(\\.)content([a-z][0-9a-z]*$)delimiter(})>operator(\))operator(.)ident(empty?) - reserved(end) - - reserved(def) method(layout_list) - constant(Dir)operator(.)ident(glob)operator(()stringcontent(/layouts/**/*)delimiter(")>operator(\)) - reserved(end) - - reserved(def) method(add_layout_conditions)operator(()ident(conditions)operator(\)) - ident(write_inheritable_hash) stringoperator(,) ident(normalize_conditions)operator(()ident(conditions)operator(\)) - reserved(end) - - reserved(def) method(normalize_conditions)operator(()ident(conditions)operator(\)) - ident(conditions)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({)operator(|)ident(hash)operator(,) operator(()ident(key)operator(,) ident(value)operator(\))operator(|) ident(hash)operator(.)ident(merge)operator(()ident(key) operator(=)operator(>) operator([)ident(value)operator(])operator(.)ident(flatten)operator(.)ident(map) operator({)operator(|)ident(action)operator(|) ident(action)operator(.)ident(to_s)operator(})operator(\))operator(}) - reserved(end) - - reserved(def) method(layout_directory_exists_cache) - class_variable(@@layout_directory_exists_cache) operator(||=) constant(Hash)operator(.)ident(new) reserved(do) operator(|)ident(h)operator(,) ident(dirname)operator(|) - ident(h)operator([)ident(dirname)operator(]) operator(=) constant(File)operator(.)ident(directory?) ident(dirname) - reserved(end) - reserved(end) - reserved(end) - - comment(# Returns the name of the active layout. If the layout was specified as a method reference (through a symbol\), this method) - comment(# is called and the return value is used. Likewise if the layout was specified as an inline method (through a proc or method) - comment(# object\). If the layout was defined without a directory, layouts is assumed. So layout "weblog/standard" will return) - comment(# weblog/standard, but layout "standard" will return layouts/standard.) - reserved(def) method(active_layout)operator(()ident(passed_layout) operator(=) pre_constant(nil)operator(\)) - ident(layout) operator(=) ident(passed_layout) operator(||) pre_constant(self)operator(.)ident(class)operator(.)ident(default_layout) - - ident(active_layout) operator(=) reserved(case) ident(layout) - reserved(when) constant(String) reserved(then) ident(layout) - reserved(when) constant(Symbol) reserved(then) ident(send)operator(()ident(layout)operator(\)) - reserved(when) constant(Proc) reserved(then) ident(layout)operator(.)ident(call)operator(()pre_constant(self)operator(\)) - reserved(end) - - comment(# Explicitly passed layout names with slashes are looked up relative to the template root,) - comment(# but auto-discovered layouts derived from a nested controller will contain a slash, though be relative) - comment(# to the 'layouts' directory so we have to check the file system to infer which case the layout name came from.) - reserved(if) ident(active_layout) - reserved(if) ident(active_layout)operator(.)ident(include?)operator(()stringoperator(\)) operator(&&) operator(!) ident(layout_directory?)operator(()ident(active_layout)operator(\)) - ident(active_layout) - reserved(else) - stringdelimiter(")> - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(render_with_a_layout)operator(()ident(options) operator(=) pre_constant(nil)operator(,) ident(deprecated_status) operator(=) pre_constant(nil)operator(,) ident(deprecated_layout) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) comment(#:nodoc:) - ident(template_with_options) operator(=) ident(options)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - reserved(if) ident(apply_layout?)operator(()ident(template_with_options)operator(,) ident(options)operator(\)) operator(&&) operator(()ident(layout) operator(=) ident(pick_layout)operator(()ident(template_with_options)operator(,) ident(options)operator(,) ident(deprecated_layout)operator(\))operator(\)) - ident(options) operator(=) ident(options)operator(.)ident(merge) symbol(:layout) operator(=)operator(>) pre_constant(false) reserved(if) ident(template_with_options) - ident(logger)operator(.)ident(info)operator(()stringcontent( within )inlinedelimiter(")>operator(\)) reserved(if) ident(logger) - - reserved(if) ident(template_with_options) - ident(content_for_layout) operator(=) ident(render_with_no_layout)operator(()ident(options)operator(,) operator(&)ident(block)operator(\)) - ident(deprecated_status) operator(=) ident(options)operator([)symbol(:status)operator(]) operator(||) ident(deprecated_status) - reserved(else) - ident(content_for_layout) operator(=) ident(render_with_no_layout)operator(()ident(options)operator(,) ident(deprecated_status)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - ident(erase_render_results) - ident(add_variables_to_assigns) - instance_variable(@template)operator(.)ident(instance_variable_set)operator(()stringoperator(,) ident(content_for_layout)operator(\)) - ident(render_text)operator(()instance_variable(@template)operator(.)ident(render_file)operator(()ident(layout)operator(,) pre_constant(true)operator(\))operator(,) ident(deprecated_status)operator(\)) - reserved(else) - ident(render_with_no_layout)operator(()ident(options)operator(,) ident(deprecated_status)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - - ident(private) - - reserved(def) method(apply_layout?)operator(()ident(template_with_options)operator(,) ident(options)operator(\)) - reserved(return) pre_constant(false) reserved(if) ident(options) operator(==) symbol(:update) - ident(template_with_options) operator(?) ident(candidate_for_layout?)operator(()ident(options)operator(\)) operator(:) operator(!)ident(template_exempt_from_layout?) - reserved(end) - - reserved(def) method(candidate_for_layout?)operator(()ident(options)operator(\)) - operator(()ident(options)operator(.)ident(has_key?)operator(()symbol(:layout)operator(\)) operator(&&) ident(options)operator([)symbol(:layout)operator(]) operator(!=) pre_constant(false)operator(\)) operator(||) - ident(options)operator(.)ident(values_at)operator(()symbol(:text)operator(,) symbol(:xml)operator(,) symbol(:file)operator(,) symbol(:inline)operator(,) symbol(:partial)operator(,) symbol(:nothing)operator(\))operator(.)ident(compact)operator(.)ident(empty?) operator(&&) - operator(!)ident(template_exempt_from_layout?)operator(()ident(default_template_name)operator(()ident(options)operator([)symbol(:action)operator(]) operator(||) ident(options)operator([)symbol(:template)operator(])operator(\))operator(\)) - reserved(end) - - reserved(def) method(pick_layout)operator(()ident(template_with_options)operator(,) ident(options)operator(,) ident(deprecated_layout)operator(\)) - reserved(if) ident(deprecated_layout) - ident(deprecated_layout) - reserved(elsif) ident(template_with_options) - reserved(case) ident(layout) operator(=) ident(options)operator([)symbol(:layout)operator(]) - reserved(when) constant(FalseClass) - pre_constant(nil) - reserved(when) constant(NilClass)operator(,) constant(TrueClass) - ident(active_layout) reserved(if) ident(action_has_layout?) - reserved(else) - ident(active_layout)operator(()ident(layout)operator(\)) - reserved(end) - reserved(else) - ident(active_layout) reserved(if) ident(action_has_layout?) - reserved(end) - reserved(end) - - reserved(def) method(action_has_layout?) - reserved(if) ident(conditions) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(layout_conditions) - reserved(case) - reserved(when) ident(only) operator(=) ident(conditions)operator([)symbol(:only)operator(]) - ident(only)operator(.)ident(include?)operator(()ident(action_name)operator(\)) - reserved(when) ident(except) operator(=) ident(conditions)operator([)symbol(:except)operator(]) - operator(!)ident(except)operator(.)ident(include?)operator(()ident(action_name)operator(\)) - reserved(else) - pre_constant(true) - reserved(end) - reserved(else) - pre_constant(true) - reserved(end) - reserved(end) - - comment(# Does a layout directory for this class exist?) - comment(# we cache this info in a class level hash) - reserved(def) method(layout_directory?)operator(()ident(layout_name)operator(\)) - ident(template_path) operator(=) constant(File)operator(.)ident(join)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(view_root)operator(,) stringoperator(,) ident(layout_name)operator(\)) - ident(dirname) operator(=) constant(File)operator(.)ident(dirname)operator(()ident(template_path)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(send)operator(()symbol(:layout_directory_exists_cache)operator(\))operator([)ident(dirname)operator(]) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) - comment(# Macros are class-level calls that add pre-defined actions to the controller based on the parameters passed in.) - comment(# Currently, they're used to bridge the JavaScript macros, like autocompletion and in-place editing, with the controller) - comment(# backing.) - reserved(module) class(Macros) - reserved(module) class(AutoComplete) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - comment(# Example:) - comment(#) - comment(# # Controller) - comment(# class BlogController < ApplicationController) - comment(# auto_complete_for :post, :title) - comment(# end) - comment(#) - comment(# # View) - comment(# <%= text_field_with_auto_complete :post, title %>) - comment(#) - comment(# By default, auto_complete_for limits the results to 10 entries,) - comment(# and sorts by the given field.) - comment(# ) - comment(# auto_complete_for takes a third parameter, an options hash to) - comment(# the find method used to search for the records:) - comment(#) - comment(# auto_complete_for :post, :title, :limit => 15, :order => 'created_at DESC') - comment(#) - comment(# For help on defining text input fields with autocompletion, ) - comment(# see ActionView::Helpers::JavaScriptHelper.) - comment(#) - comment(# For more examples, see script.aculo.us:) - comment(# * http://script.aculo.us/demos/ajax/autocompleter) - comment(# * http://script.aculo.us/demos/ajax/autocompleter_customized) - reserved(module) class(ClassMethods) - reserved(def) method(auto_complete_for)operator(()ident(object)operator(,) ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(define_method)operator(()stringcontent(_)inlinedelimiter(")>operator(\)) reserved(do) - ident(find_options) operator(=) operator({) - symbol(:conditions) operator(=)operator(>) operator([) stringcontent(\) LIKE ?)delimiter(")>operator(,) string operator(+) ident(params)operator([)ident(object)operator(])operator([)ident(method)operator(])operator(.)ident(downcase) operator(+) string operator(])operator(,) - symbol(:order) operator(=)operator(>) stringcontent( ASC)delimiter(")>operator(,) - symbol(:limit) operator(=)operator(>) integer(10) operator(})operator(.)ident(merge!)operator(()ident(options)operator(\)) - - instance_variable(@items) operator(=) ident(object)operator(.)ident(to_s)operator(.)ident(camelize)operator(.)ident(constantize)operator(.)ident(find)operator(()symbol(:all)operator(,) ident(find_options)operator(\)) - - ident(render) symbol(:inline) operator(=)operator(>) stringcontent(' %>)delimiter(")> - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -ident(endmodule) constant(ActionController) - reserved(module) class(Macros) - reserved(module) class(InPlaceEditing) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - comment(# Example:) - comment(#) - comment(# # Controller) - comment(# class BlogController < ApplicationController) - comment(# in_place_edit_for :post, :title) - comment(# end) - comment(#) - comment(# # View) - comment(# <%= in_place_editor_field :post, 'title' %>) - comment(#) - comment(# For help on defining an in place editor in the browser,) - comment(# see ActionView::Helpers::JavaScriptHelper.) - reserved(module) class(ClassMethods) - reserved(def) method(in_place_edit_for)operator(()ident(object)operator(,) ident(attribute)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(define_method)operator(()stringcontent(_)inlinedelimiter(")>operator(\)) reserved(do) - instance_variable(@item) operator(=) ident(object)operator(.)ident(to_s)operator(.)ident(camelize)operator(.)ident(constantize)operator(.)ident(find)operator(()ident(params)operator([)symbol(:id)operator(])operator(\)) - instance_variable(@item)operator(.)ident(update_attribute)operator(()ident(attribute)operator(,) ident(params)operator([)symbol(:value)operator(])operator(\)) - ident(render) symbol(:text) operator(=)operator(>) instance_variable(@item)operator(.)ident(send)operator(()ident(attribute)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) comment(#:nodoc:) - reserved(module) class(MimeResponds) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(ActionController)operator(::)constant(MimeResponds)operator(::)constant(InstanceMethods)operator(\)) - reserved(end) - - reserved(module) class(InstanceMethods) - comment(# Without web-service support, an action which collects the data for displaying a list of people) - comment(# might look something like this:) - comment(#) - comment(# def list) - comment(# @people = Person.find(:all\)) - comment(# end) - comment(# ) - comment(# Here's the same action, with web-service support baked in:) - comment(# ) - comment(# def list) - comment(# @people = Person.find(:all\)) - comment(# ) - comment(# respond_to do |wants|) - comment(# wants.html) - comment(# wants.xml { render :xml => @people.to_xml }) - comment(# end) - comment(# end) - comment(# ) - comment(# What that says is, "if the client wants HTML in response to this action, just respond as we ) - comment(# would have before, but if the client wants XML, return them the list of people in XML format." ) - comment(# (Rails determines the desired response format from the HTTP Accept header submitted by the client.\)) - comment(# ) - comment(# Supposing you have an action that adds a new person, optionally creating their company ) - comment(# (by name\) if it does not already exist, without web-services, it might look like this:) - comment(# ) - comment(# def add) - comment(# @company = Company.find_or_create_by_name(params[:company][:name]\)) - comment(# @person = @company.people.create(params[:person]\)) - comment(# ) - comment(# redirect_to(person_list_url\)) - comment(# end) - comment(# ) - comment(# Here's the same action, with web-service support baked in:) - comment(# ) - comment(# def add) - comment(# company = params[:person].delete(:company\)) - comment(# @company = Company.find_or_create_by_name(company[:name]\)) - comment(# @person = @company.people.create(params[:person]\)) - comment(# ) - comment(# respond_to do |wants|) - comment(# wants.html { redirect_to(person_list_url\) }) - comment(# wants.js) - comment(# wants.xml { render :xml => @person.to_xml(:include => @company\) }) - comment(# end) - comment(# end) - comment(# ) - comment(# If the client wants HTML, we just redirect them back to the person list. If they want Javascript ) - comment(# (wants.js\), then it is an RJS request and we render the RJS template associated with this action. ) - comment(# Lastly, if the client wants XML, we render the created person as XML, but with a twist: we also ) - comment(# include the person’s company in the rendered XML, so you get something like this:) - comment(# ) - comment(# ) - comment(# ...) - comment(# ...) - comment(# ) - comment(# ...) - comment(# ...) - comment(# ...) - comment(# ) - comment(# ) - comment(# ) - comment(# Note, however, the extra bit at the top of that action:) - comment(# ) - comment(# company = params[:person].delete(:company\)) - comment(# @company = Company.find_or_create_by_name(company[:name]\)) - comment(# ) - comment(# This is because the incoming XML document (if a web-service request is in process\) can only contain a ) - comment(# single root-node. So, we have to rearrange things so that the request looks like this (url-encoded\):) - comment(# ) - comment(# person[name]=...&person[company][name]=...&...) - comment(# ) - comment(# And, like this (xml-encoded\):) - comment(# ) - comment(# ) - comment(# ...) - comment(# ) - comment(# ...) - comment(# ) - comment(# ) - comment(# ) - comment(# In other words, we make the request so that it operates on a single entity—a person. Then, in the action, ) - comment(# we extract the company data from the request, find or create the company, and then create the new person ) - comment(# with the remaining data.) - comment(# ) - comment(# Note that you can define your own XML parameter parser which would allow you to describe multiple entities ) - comment(# in a single request (i.e., by wrapping them all in a single root note\), but if you just go with the flow ) - comment(# and accept Rails' defaults, life will be much easier.) - comment(# ) - comment(# If you need to use a MIME type which isn't supported by default, you can register your own handlers in) - comment(# environment.rb as follows.) - comment(# ) - comment(# Mime::Type.register "image/jpg", :jpg) - comment(# ) - reserved(def) method(respond_to)operator(()operator(*)ident(types)operator(,) operator(&)ident(block)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string reserved(unless) ident(types)operator(.)ident(any?) operator(^) ident(block) - ident(block) operator(||=) ident(lambda) operator({) operator(|)ident(responder)operator(|) ident(types)operator(.)ident(each) operator({) operator(|)ident(type)operator(|) ident(responder)operator(.)ident(send)operator(()ident(type)operator(\)) operator(}) operator(}) - ident(responder) operator(=) constant(Responder)operator(.)ident(new)operator(()ident(block)operator(.)ident(binding)operator(\)) - ident(block)operator(.)ident(call)operator(()ident(responder)operator(\)) - ident(responder)operator(.)ident(respond) - reserved(end) - reserved(end) - - reserved(class) class(Responder) comment(#:nodoc:) - constant(DEFAULT_BLOCKS) operator(=) operator({) - symbol(:html) operator(=)operator(>) stringoperator(,) - symbol(:js) operator(=)operator(>) string "#{action_name}.rjs" })delimiter(')>operator(,) - symbol(:xml) operator(=)operator(>) string "#{action_name}.rxml" })delimiter(')> - operator(}) - - reserved(def) method(initialize)operator(()ident(block_binding)operator(\)) - instance_variable(@block_binding) operator(=) ident(block_binding) - instance_variable(@mime_type_priority) operator(=) ident(eval)operator(()stringoperator(,) ident(block_binding)operator(\)) - instance_variable(@order) operator(=) operator([)operator(]) - instance_variable(@responses) operator(=) operator({)operator(}) - reserved(end) - - reserved(def) method(custom)operator(()ident(mime_type)operator(,) operator(&)ident(block)operator(\)) - ident(mime_type) operator(=) ident(mime_type)operator(.)ident(is_a?)operator(()constant(Mime)operator(::)constant(Type)operator(\)) operator(?) ident(mime_type) operator(:) constant(Mime)operator(::)constant(Type)operator(.)ident(lookup)operator(()ident(mime_type)operator(.)ident(to_s)operator(\)) - - instance_variable(@order) operator(<<) ident(mime_type) - - reserved(if) ident(block_given?) - instance_variable(@responses)operator([)ident(mime_type)operator(]) operator(=) ident(block) - reserved(else) - instance_variable(@responses)operator([)ident(mime_type)operator(]) operator(=) ident(eval)operator(()constant(DEFAULT_BLOCKS)operator([)ident(mime_type)operator(.)ident(to_sym)operator(])operator(,) instance_variable(@block_binding)operator(\)) - reserved(end) - reserved(end) - - reserved(for) ident(mime_type) reserved(in) string - ident(eval) stringstringcontent((&block\) - custom(Mime::)inlinecontent(, &block\) - end)delimiter( - EOT)> - reserved(end) - - reserved(def) method(any)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(args)operator(.)ident(each) operator({) operator(|)ident(type)operator(|) ident(send)operator(()ident(type)operator(,) operator(&)ident(block)operator(\)) operator(}) - reserved(end) - - reserved(def) method(respond) - reserved(for) ident(priority) reserved(in) instance_variable(@mime_type_priority) - reserved(if) ident(priority) operator(==) constant(Mime)operator(::)constant(ALL) - instance_variable(@responses)operator([)instance_variable(@order)operator(.)ident(first)operator(])operator(.)ident(call) - reserved(return) - reserved(else) - reserved(if) ident(priority) operator(===) instance_variable(@order) - instance_variable(@responses)operator([)ident(priority)operator(])operator(.)ident(call) - reserved(return) comment(# mime type match found, be happy and return) - reserved(end) - reserved(end) - reserved(end) - - reserved(if) instance_variable(@order)operator(.)ident(include?)operator(()constant(Mime)operator(::)constant(ALL)operator(\)) - instance_variable(@responses)operator([)constant(Mime)operator(::)constant(ALL)operator(])operator(.)ident(call) - reserved(else) - ident(eval) string true, :status => "406 Not Acceptable"\))delimiter(')>operator(,) instance_variable(@block_binding) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(Mime) - reserved(class) class(Type) comment(#:nodoc:) - comment(# A simple helper class used in parsing the accept header) - reserved(class) class(AcceptItem) comment(#:nodoc:) - ident(attr_accessor) symbol(:order)operator(,) symbol(:name)operator(,) symbol(:q) - - reserved(def) method(initialize)operator(()ident(order)operator(,) ident(name)operator(,) ident(q)operator(=)pre_constant(nil)operator(\)) - instance_variable(@order) operator(=) ident(order) - instance_variable(@name) operator(=) ident(name)operator(.)ident(strip) - ident(q) operator(||=) float(0.0) reserved(if) instance_variable(@name) operator(==) string comment(# default "*/*" to end of list) - instance_variable(@q) operator(=) operator(()operator(()ident(q) operator(||) float(1.0)operator(\))operator(.)ident(to_f) operator(*) integer(100)operator(\))operator(.)ident(to_i) - reserved(end) - - reserved(def) method(to_s) - instance_variable(@name) - reserved(end) - - reserved(def) method(<=>)operator(()ident(item)operator(\)) - ident(result) operator(=) ident(item)operator(.)ident(q) operator(<=>) ident(q) - ident(result) operator(=) ident(order) operator(<=>) ident(item)operator(.)ident(order) reserved(if) ident(result) operator(==) integer(0) - ident(result) - reserved(end) - - reserved(def) method(==)operator(()ident(item)operator(\)) - ident(name) operator(==) operator(()ident(item)operator(.)ident(respond_to?)operator(()symbol(:name)operator(\)) operator(?) ident(item)operator(.)ident(name) operator(:) ident(item)operator(\)) - reserved(end) - reserved(end) - - reserved(class) operator(<<) class(self) - reserved(def) method(lookup)operator(()ident(string)operator(\)) - constant(LOOKUP)operator([)ident(string)operator(]) - reserved(end) - - reserved(def) method(parse)operator(()ident(accept_header)operator(\)) - comment(# keep track of creation order to keep the subsequent sort stable) - ident(index) operator(=) integer(0) - ident(list) operator(=) ident(accept_header)operator(.)ident(split)operator(()regexpoperator(\))operator(.) - ident(map!) operator({) operator(|)ident(i)operator(|) constant(AcceptItem)operator(.)ident(new)operator(()ident(index) operator(+=) integer(1)operator(,) operator(*)ident(i)operator(.)ident(split)operator(()regexpoperator(\))operator(\)) operator(})operator(.)ident(sort!) - - comment(# Take care of the broken text/xml entry by renaming or deleting it) - - ident(text_xml) operator(=) ident(list)operator(.)ident(index)operator(()stringoperator(\)) - ident(app_xml) operator(=) ident(list)operator(.)ident(index)operator(()stringoperator(\)) - - reserved(if) ident(text_xml) operator(&&) ident(app_xml) - comment(# set the q value to the max of the two) - ident(list)operator([)ident(app_xml)operator(])operator(.)ident(q) operator(=) operator([)ident(list)operator([)ident(text_xml)operator(])operator(.)ident(q)operator(,) ident(list)operator([)ident(app_xml)operator(])operator(.)ident(q)operator(])operator(.)ident(max) - - comment(# make sure app_xml is ahead of text_xml in the list) - reserved(if) ident(app_xml) operator(>) ident(text_xml) - ident(list)operator([)ident(app_xml)operator(])operator(,) ident(list)operator([)ident(text_xml)operator(]) operator(=) ident(list)operator([)ident(text_xml)operator(])operator(,) ident(list)operator([)ident(app_xml)operator(]) - ident(app_xml)operator(,) ident(text_xml) operator(=) ident(text_xml)operator(,) ident(app_xml) - reserved(end) - - comment(# delete text_xml from the list) - ident(list)operator(.)ident(delete_at)operator(()ident(text_xml)operator(\)) - - reserved(elsif) ident(text_xml) - ident(list)operator([)ident(text_xml)operator(])operator(.)ident(name) operator(=) string - reserved(end) - - comment(# Look for more specific xml-based types and sort them ahead of app/xml) - - reserved(if) ident(app_xml) - ident(idx) operator(=) ident(app_xml) - ident(app_xml_type) operator(=) ident(list)operator([)ident(app_xml)operator(]) - - reserved(while)operator(()ident(idx) operator(<) ident(list)operator(.)ident(length)operator(\)) - ident(type) operator(=) ident(list)operator([)ident(idx)operator(]) - reserved(break) reserved(if) ident(type)operator(.)ident(q) operator(<) ident(app_xml_type)operator(.)ident(q) - reserved(if) ident(type)operator(.)ident(name) operator(=)operator(~) regexp - ident(list)operator([)ident(app_xml)operator(])operator(,) ident(list)operator([)ident(idx)operator(]) operator(=) ident(list)operator([)ident(idx)operator(])operator(,) ident(list)operator([)ident(app_xml)operator(]) - ident(app_xml) operator(=) ident(idx) - reserved(end) - ident(idx) operator(+=) integer(1) - reserved(end) - reserved(end) - - ident(list)operator(.)ident(map!) operator({) operator(|)ident(i)operator(|) constant(Mime)operator(::)constant(Type)operator(.)ident(lookup)operator(()ident(i)operator(.)ident(name)operator(\)) operator(})operator(.)ident(uniq!) - ident(list) - reserved(end) - reserved(end) - - reserved(def) method(initialize)operator(()ident(string)operator(,) ident(symbol) operator(=) pre_constant(nil)operator(,) ident(synonyms) operator(=) operator([)operator(])operator(\)) - instance_variable(@symbol)operator(,) instance_variable(@synonyms) operator(=) ident(symbol)operator(,) ident(synonyms) - instance_variable(@string) operator(=) ident(string) - reserved(end) - - reserved(def) method(to_s) - instance_variable(@string) - reserved(end) - - reserved(def) method(to_str) - ident(to_s) - reserved(end) - - reserved(def) method(to_sym) - instance_variable(@symbol) operator(||) instance_variable(@string)operator(.)ident(to_sym) - reserved(end) - - reserved(def) method(===)operator(()ident(list)operator(\)) - reserved(if) ident(list)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - operator(()instance_variable(@synonyms) operator(+) operator([) pre_constant(self) operator(])operator(\))operator(.)ident(any?) operator({) operator(|)ident(synonym)operator(|) ident(list)operator(.)ident(include?)operator(()ident(synonym)operator(\)) operator(}) - reserved(else) - reserved(super) - reserved(end) - reserved(end) - - reserved(def) method(==)operator(()ident(mime_type)operator(\)) - operator(()instance_variable(@synonyms) operator(+) operator([) pre_constant(self) operator(])operator(\))operator(.)ident(any?) operator({) operator(|)ident(synonym)operator(|) ident(synonym)operator(.)ident(to_s) operator(==) ident(mime_type)operator(.)ident(to_s) operator(}) reserved(if) ident(mime_type) - reserved(end) - reserved(end) - - constant(ALL) operator(=) constant(Type)operator(.)ident(new) stringoperator(,) symbol(:all) - constant(HTML) operator(=) constant(Type)operator(.)ident(new) stringoperator(,) symbol(:html)operator(,) string - constant(JS) operator(=) constant(Type)operator(.)ident(new) stringoperator(,) symbol(:js)operator(,) string - constant(XML) operator(=) constant(Type)operator(.)ident(new) stringoperator(,) symbol(:xml)operator(,) string - constant(RSS) operator(=) constant(Type)operator(.)ident(new) stringoperator(,) symbol(:rss) - constant(ATOM) operator(=) constant(Type)operator(.)ident(new) stringoperator(,) symbol(:atom) - constant(YAML) operator(=) constant(Type)operator(.)ident(new) stringoperator(,) symbol(:yaml)operator(,) string - - constant(LOOKUP) operator(=) constant(Hash)operator(.)ident(new) operator({) operator(|)ident(h)operator(,) ident(k)operator(|) ident(h)operator([)ident(k)operator(]) operator(=) constant(Type)operator(.)ident(new)operator(()ident(k)operator(\)) operator(}) - - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(ALL) - - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(HTML) - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(HTML) - - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(XML) - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(XML) - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(XML) - - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(JS) - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(JS) - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(JS) - - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(YAML) - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(YAML) - - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(RSS) - constant(LOOKUP)operator([)stringoperator(]) operator(=) constant(ATOM) -ident(endmodule) constant(ActionController) - comment(# === Action Pack pagination for Active Record collections) - comment(#) - comment(# The Pagination module aids in the process of paging large collections of) - comment(# Active Record objects. It offers macro-style automatic fetching of your) - comment(# model for multiple views, or explicit fetching for single actions. And if) - comment(# the magic isn't flexible enough for your needs, you can create your own) - comment(# paginators with a minimal amount of code.) - comment(#) - comment(# The Pagination module can handle as much or as little as you wish. In the) - comment(# controller, have it automatically query your model for pagination; or,) - comment(# if you prefer, create Paginator objects yourself.) - comment(#) - comment(# Pagination is included automatically for all controllers.) - comment(#) - comment(# For help rendering pagination links, see ) - comment(# ActionView::Helpers::PaginationHelper.) - comment(#) - comment(# ==== Automatic pagination for every action in a controller) - comment(#) - comment(# class PersonController < ApplicationController ) - comment(# model :person) - comment(#) - comment(# paginate :people, :order => 'last_name, first_name',) - comment(# :per_page => 20) - comment(# ) - comment(# # ...) - comment(# end) - comment(#) - comment(# Each action in this controller now has access to a @people) - comment(# instance variable, which is an ordered collection of model objects for the) - comment(# current page (at most 20, sorted by last name and first name\), and a ) - comment(# @person_pages Paginator instance. The current page is determined) - comment(# by the params[:page] variable.) - comment(#) - comment(# ==== Pagination for a single action) - comment(#) - comment(# def list) - comment(# @person_pages, @people =) - comment(# paginate :people, :order => 'last_name, first_name') - comment(# end) - comment(#) - comment(# Like the previous example, but explicitly creates @person_pages) - comment(# and @people for a single action, and uses the default of 10 items) - comment(# per page.) - comment(#) - comment(# ==== Custom/"classic" pagination ) - comment(#) - comment(# def list) - comment(# @person_pages = Paginator.new self, Person.count, 10, params[:page]) - comment(# @people = Person.find :all, :order => 'last_name, first_name', ) - comment(# :limit => @person_pages.items_per_page,) - comment(# :offset => @person_pages.current.offset) - comment(# end) - comment(# ) - comment(# Explicitly creates the paginator from the previous example and uses ) - comment(# Paginator#to_sql to retrieve @people from the model.) - comment(#) - reserved(module) class(Pagination) - reserved(unless) ident(const_defined?)operator(()symbol(:OPTIONS)operator(\)) - comment(# A hash holding options for controllers using macro-style pagination) - constant(OPTIONS) operator(=) constant(Hash)operator(.)ident(new) - - comment(# The default options for pagination) - constant(DEFAULT_OPTIONS) operator(=) operator({) - symbol(:class_name) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:singular_name) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:per_page) operator(=)operator(>) integer(10)operator(,) - symbol(:conditions) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:order_by) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:order) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:join) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:joins) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:count) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:include) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:select) operator(=)operator(>) pre_constant(nil)operator(,) - symbol(:parameter) operator(=)operator(>) string - operator(}) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(validate_options!)operator(()ident(collection_id)operator(,) ident(options)operator(,) ident(in_action)operator(\)) comment(#:nodoc:) - ident(options)operator(.)ident(merge!)operator(()constant(DEFAULT_OPTIONS)operator(\)) operator({)operator(|)ident(key)operator(,) ident(old)operator(,) ident(new)operator(|) ident(old)operator(}) - - ident(valid_options) operator(=) constant(DEFAULT_OPTIONS)operator(.)ident(keys) - ident(valid_options) operator(<<) symbol(:actions) reserved(unless) ident(in_action) - - ident(unknown_option_keys) operator(=) ident(options)operator(.)ident(keys) operator(-) ident(valid_options) - ident(raise) constant(ActionController)operator(::)constant(ActionControllerError)operator(,) - stringoperator(\))inline_delimiter(})>delimiter(")> reserved(unless) - ident(unknown_option_keys)operator(.)ident(empty?) - - ident(options)operator([)symbol(:singular_name)operator(]) operator(||=) constant(Inflector)operator(.)ident(singularize)operator(()ident(collection_id)operator(.)ident(to_s)operator(\)) - ident(options)operator([)symbol(:class_name)operator(]) operator(||=) constant(Inflector)operator(.)ident(camelize)operator(()ident(options)operator([)symbol(:singular_name)operator(])operator(\)) - reserved(end) - - comment(# Returns a paginator and a collection of Active Record model instances) - comment(# for the paginator's current page. This is designed to be used in a) - comment(# single action; to automatically paginate multiple actions, consider) - comment(# ClassMethods#paginate.) - comment(#) - comment(# +options+ are:) - comment(# :singular_name:: the singular name to use, if it can't be inferred by) - comment(# singularizing the collection name) - comment(# :class_name:: the class name to use, if it can't be inferred by) - comment(# camelizing the singular name) - comment(# :per_page:: the maximum number of items to include in a ) - comment(# single page. Defaults to 10) - comment(# :conditions:: optional conditions passed to Model.find(:all, *params\) and) - comment(# Model.count) - comment(# :order:: optional order parameter passed to Model.find(:all, *params\)) - comment(# :order_by:: (deprecated, used :order\) optional order parameter passed to Model.find(:all, *params\)) - comment(# :joins:: optional joins parameter passed to Model.find(:all, *params\)) - comment(# and Model.count) - comment(# :join:: (deprecated, used :joins or :include\) optional join parameter passed to Model.find(:all, *params\)) - comment(# and Model.count) - comment(# :include:: optional eager loading parameter passed to Model.find(:all, *params\)) - comment(# and Model.count) - comment(# :select:: :select parameter passed to Model.find(:all, *params\)) - comment(#) - comment(# :count:: parameter passed as :select option to Model.count(*params\)) - comment(#) - reserved(def) method(paginate)operator(()ident(collection_id)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - constant(Pagination)operator(.)ident(validate_options!)operator(()ident(collection_id)operator(,) ident(options)operator(,) pre_constant(true)operator(\)) - ident(paginator_and_collection_for)operator(()ident(collection_id)operator(,) ident(options)operator(\)) - reserved(end) - - comment(# These methods become class methods on any controller ) - reserved(module) class(ClassMethods) - comment(# Creates a +before_filter+ which automatically paginates an Active) - comment(# Record model for all actions in a controller (or certain actions if) - comment(# specified with the :actions option\).) - comment(#) - comment(# +options+ are the same as PaginationHelper#paginate, with the addition ) - comment(# of:) - comment(# :actions:: an array of actions for which the pagination is) - comment(# active. Defaults to +nil+ (i.e., every action\)) - reserved(def) method(paginate)operator(()ident(collection_id)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - constant(Pagination)operator(.)ident(validate_options!)operator(()ident(collection_id)operator(,) ident(options)operator(,) pre_constant(false)operator(\)) - ident(module_eval) reserved(do) - ident(before_filter) symbol(:create_paginators_and_retrieve_collections) - constant(OPTIONS)operator([)pre_constant(self)operator(]) operator(||=) constant(Hash)operator(.)ident(new) - constant(OPTIONS)operator([)pre_constant(self)operator(])operator([)ident(collection_id)operator(]) operator(=) ident(options) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(create_paginators_and_retrieve_collections) comment(#:nodoc:) - constant(Pagination)operator(::)constant(OPTIONS)operator([)pre_constant(self)operator(.)ident(class)operator(])operator(.)ident(each) reserved(do) operator(|)ident(collection_id)operator(,) ident(options)operator(|) - reserved(next) reserved(unless) ident(options)operator([)symbol(:actions)operator(])operator(.)ident(include?) ident(action_name) reserved(if) - ident(options)operator([)symbol(:actions)operator(]) - - ident(paginator)operator(,) ident(collection) operator(=) - ident(paginator_and_collection_for)operator(()ident(collection_id)operator(,) ident(options)operator(\)) - - ident(paginator_name) operator(=) stringcontent(_pages)delimiter(")> - pre_constant(self)operator(.)ident(instance_variable_set)operator(()ident(paginator_name)operator(,) ident(paginator)operator(\)) - - ident(collection_name) operator(=) stringdelimiter(")> - pre_constant(self)operator(.)ident(instance_variable_set)operator(()ident(collection_name)operator(,) ident(collection)operator(\)) - reserved(end) - reserved(end) - - comment(# Returns the total number of items in the collection to be paginated for) - comment(# the +model+ and given +conditions+. Override this method to implement a) - comment(# custom counter.) - reserved(def) method(count_collection_for_pagination)operator(()ident(model)operator(,) ident(options)operator(\)) - ident(model)operator(.)ident(count)operator(()symbol(:conditions) operator(=)operator(>) ident(options)operator([)symbol(:conditions)operator(])operator(,) - symbol(:joins) operator(=)operator(>) ident(options)operator([)symbol(:join)operator(]) operator(||) ident(options)operator([)symbol(:joins)operator(])operator(,) - symbol(:include) operator(=)operator(>) ident(options)operator([)symbol(:include)operator(])operator(,) - symbol(:select) operator(=)operator(>) ident(options)operator([)symbol(:count)operator(])operator(\)) - reserved(end) - - comment(# Returns a collection of items for the given +model+ and +options[conditions]+,) - comment(# ordered by +options[order]+, for the current page in the given +paginator+.) - comment(# Override this method to implement a custom finder.) - reserved(def) method(find_collection_for_pagination)operator(()ident(model)operator(,) ident(options)operator(,) ident(paginator)operator(\)) - ident(model)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) ident(options)operator([)symbol(:conditions)operator(])operator(,) - symbol(:order) operator(=)operator(>) ident(options)operator([)symbol(:order_by)operator(]) operator(||) ident(options)operator([)symbol(:order)operator(])operator(,) - symbol(:joins) operator(=)operator(>) ident(options)operator([)symbol(:join)operator(]) operator(||) ident(options)operator([)symbol(:joins)operator(])operator(,) symbol(:include) operator(=)operator(>) ident(options)operator([)symbol(:include)operator(])operator(,) - symbol(:select) operator(=)operator(>) ident(options)operator([)symbol(:select)operator(])operator(,) symbol(:limit) operator(=)operator(>) ident(options)operator([)symbol(:per_page)operator(])operator(,) - symbol(:offset) operator(=)operator(>) ident(paginator)operator(.)ident(current)operator(.)ident(offset)operator(\)) - reserved(end) - - ident(protected) symbol(:create_paginators_and_retrieve_collections)operator(,) - symbol(:count_collection_for_pagination)operator(,) - symbol(:find_collection_for_pagination) - - reserved(def) method(paginator_and_collection_for)operator(()ident(collection_id)operator(,) ident(options)operator(\)) comment(#:nodoc:) - ident(klass) operator(=) ident(options)operator([)symbol(:class_name)operator(])operator(.)ident(constantize) - ident(page) operator(=) instance_variable(@params)operator([)ident(options)operator([)symbol(:parameter)operator(])operator(]) - ident(count) operator(=) ident(count_collection_for_pagination)operator(()ident(klass)operator(,) ident(options)operator(\)) - ident(paginator) operator(=) constant(Paginator)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(count)operator(,) ident(options)operator([)symbol(:per_page)operator(])operator(,) ident(page)operator(\)) - ident(collection) operator(=) ident(find_collection_for_pagination)operator(()ident(klass)operator(,) ident(options)operator(,) ident(paginator)operator(\)) - - reserved(return) ident(paginator)operator(,) ident(collection) - reserved(end) - - ident(private) symbol(:paginator_and_collection_for) - - comment(# A class representing a paginator for an Active Record collection.) - reserved(class) class(Paginator) - ident(include) constant(Enumerable) - - comment(# Creates a new Paginator on the given +controller+ for a set of items) - comment(# of size +item_count+ and having +items_per_page+ items per page.) - comment(# Raises ArgumentError if items_per_page is out of bounds (i.e., less) - comment(# than or equal to zero\). The page CGI parameter for links defaults to) - comment(# "page" and can be overridden with +page_parameter+.) - reserved(def) method(initialize)operator(()ident(controller)operator(,) ident(item_count)operator(,) ident(items_per_page)operator(,) ident(current_page)operator(=)integer(1)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string reserved(if) - ident(items_per_page) operator(<=) integer(0) - - instance_variable(@controller) operator(=) ident(controller) - instance_variable(@item_count) operator(=) ident(item_count) operator(||) integer(0) - instance_variable(@items_per_page) operator(=) ident(items_per_page) - instance_variable(@pages) operator(=) operator({)operator(}) - - pre_constant(self)operator(.)ident(current_page) operator(=) ident(current_page) - reserved(end) - ident(attr_reader) symbol(:controller)operator(,) symbol(:item_count)operator(,) symbol(:items_per_page) - - comment(# Sets the current page number of this paginator. If +page+ is a Page) - comment(# object, its +number+ attribute is used as the value; if the page does ) - comment(# not belong to this Paginator, an ArgumentError is raised.) - reserved(def) method(current_page=)operator(()ident(page)operator(\)) - reserved(if) ident(page)operator(.)ident(is_a?) constant(Page) - ident(raise) constant(ArgumentError)operator(,) string reserved(unless) - ident(page)operator(.)ident(paginator) operator(==) pre_constant(self) - reserved(end) - ident(page) operator(=) ident(page)operator(.)ident(to_i) - instance_variable(@current_page_number) operator(=) ident(has_page_number?)operator(()ident(page)operator(\)) operator(?) ident(page) operator(:) integer(1) - reserved(end) - - comment(# Returns a Page object representing this paginator's current page.) - reserved(def) method(current_page) - instance_variable(@current_page) operator(||=) pre_constant(self)operator([)instance_variable(@current_page_number)operator(]) - reserved(end) - reserved(alias) method(current) symbol(:current_page) - - comment(# Returns a new Page representing the first page in this paginator.) - reserved(def) method(first_page) - instance_variable(@first_page) operator(||=) pre_constant(self)operator([)integer(1)operator(]) - reserved(end) - reserved(alias) method(first) symbol(:first_page) - - comment(# Returns a new Page representing the last page in this paginator.) - reserved(def) method(last_page) - instance_variable(@last_page) operator(||=) pre_constant(self)operator([)ident(page_count)operator(]) - reserved(end) - reserved(alias) method(last) symbol(:last_page) - - comment(# Returns the number of pages in this paginator.) - reserved(def) method(page_count) - instance_variable(@page_count) operator(||=) instance_variable(@item_count)operator(.)ident(zero?) operator(?) integer(1) operator(:) - operator(()ident(q)operator(,)ident(r)operator(=)instance_variable(@item_count)operator(.)ident(divmod)operator(()instance_variable(@items_per_page)operator(\))operator(;) ident(r)operator(==)integer(0)operator(?) ident(q) operator(:) ident(q)operator(+)integer(1)operator(\)) - reserved(end) - - reserved(alias) method(length) symbol(:page_count) - - comment(# Returns true if this paginator contains the page of index +number+.) - reserved(def) method(has_page_number?)operator(()ident(number)operator(\)) - ident(number) operator(>)operator(=) integer(1) reserved(and) ident(number) operator(<=) ident(page_count) - reserved(end) - - comment(# Returns a new Page representing the page with the given index) - comment(# +number+.) - reserved(def) method([])operator(()ident(number)operator(\)) - instance_variable(@pages)operator([)ident(number)operator(]) operator(||=) constant(Page)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(number)operator(\)) - reserved(end) - - comment(# Successively yields all the paginator's pages to the given block.) - reserved(def) method(each)operator(()operator(&)ident(block)operator(\)) - ident(page_count)operator(.)ident(times) reserved(do) operator(|)ident(n)operator(|) - reserved(yield) pre_constant(self)operator([)ident(n)operator(+)integer(1)operator(]) - reserved(end) - reserved(end) - - comment(# A class representing a single page in a paginator.) - reserved(class) class(Page) - ident(include) constant(Comparable) - - comment(# Creates a new Page for the given +paginator+ with the index) - comment(# +number+. If +number+ is not in the range of valid page numbers or) - comment(# is not a number at all, it defaults to 1.) - reserved(def) method(initialize)operator(()ident(paginator)operator(,) ident(number)operator(\)) - instance_variable(@paginator) operator(=) ident(paginator) - instance_variable(@number) operator(=) ident(number)operator(.)ident(to_i) - instance_variable(@number) operator(=) integer(1) reserved(unless) instance_variable(@paginator)operator(.)ident(has_page_number?) instance_variable(@number) - reserved(end) - ident(attr_reader) symbol(:paginator)operator(,) symbol(:number) - reserved(alias) method(to_i) symbol(:number) - - comment(# Compares two Page objects and returns true when they represent the ) - comment(# same page (i.e., their paginators are the same and they have the) - comment(# same page number\).) - reserved(def) method(==)operator(()ident(page)operator(\)) - reserved(return) pre_constant(false) reserved(if) ident(page)operator(.)ident(nil?) - instance_variable(@paginator) operator(==) ident(page)operator(.)ident(paginator) reserved(and) - instance_variable(@number) operator(==) ident(page)operator(.)ident(number) - reserved(end) - - comment(# Compares two Page objects and returns -1 if the left-hand page comes) - comment(# before the right-hand page, 0 if the pages are equal, and 1 if the) - comment(# left-hand page comes after the right-hand page. Raises ArgumentError) - comment(# if the pages do not belong to the same Paginator object.) - reserved(def) method(<=>)operator(()ident(page)operator(\)) - ident(raise) constant(ArgumentError) reserved(unless) instance_variable(@paginator) operator(==) ident(page)operator(.)ident(paginator) - instance_variable(@number) operator(<=>) ident(page)operator(.)ident(number) - reserved(end) - - comment(# Returns the item offset for the first item in this page.) - reserved(def) method(offset) - instance_variable(@paginator)operator(.)ident(items_per_page) operator(*) operator(()instance_variable(@number) operator(-) integer(1)operator(\)) - reserved(end) - - comment(# Returns the number of the first item displayed.) - reserved(def) method(first_item) - ident(offset) operator(+) integer(1) - reserved(end) - - comment(# Returns the number of the last item displayed.) - reserved(def) method(last_item) - operator([)instance_variable(@paginator)operator(.)ident(items_per_page) operator(*) instance_variable(@number)operator(,) instance_variable(@paginator)operator(.)ident(item_count)operator(])operator(.)ident(min) - reserved(end) - - comment(# Returns true if this page is the first page in the paginator.) - reserved(def) method(first?) - pre_constant(self) operator(==) instance_variable(@paginator)operator(.)ident(first) - reserved(end) - - comment(# Returns true if this page is the last page in the paginator.) - reserved(def) method(last?) - pre_constant(self) operator(==) instance_variable(@paginator)operator(.)ident(last) - reserved(end) - - comment(# Returns a new Page object representing the page just before this) - comment(# page, or nil if this is the first page.) - reserved(def) method(previous) - reserved(if) ident(first?) reserved(then) pre_constant(nil) reserved(else) instance_variable(@paginator)operator([)instance_variable(@number) operator(-) integer(1)operator(]) reserved(end) - reserved(end) - - comment(# Returns a new Page object representing the page just after this) - comment(# page, or nil if this is the last page.) - reserved(def) method(next) - reserved(if) ident(last?) reserved(then) pre_constant(nil) reserved(else) instance_variable(@paginator)operator([)instance_variable(@number) operator(+) integer(1)operator(]) reserved(end) - reserved(end) - - comment(# Returns a new Window object for this page with the specified ) - comment(# +padding+.) - reserved(def) method(window)operator(()ident(padding)operator(=)integer(2)operator(\)) - constant(Window)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(padding)operator(\)) - reserved(end) - - comment(# Returns the limit/offset array for this page.) - reserved(def) method(to_sql) - operator([)instance_variable(@paginator)operator(.)ident(items_per_page)operator(,) ident(offset)operator(]) - reserved(end) - - reserved(def) method(to_param) comment(#:nodoc:) - instance_variable(@number)operator(.)ident(to_s) - reserved(end) - reserved(end) - - comment(# A class for representing ranges around a given page.) - reserved(class) class(Window) - comment(# Creates a new Window object for the given +page+ with the specified) - comment(# +padding+.) - reserved(def) method(initialize)operator(()ident(page)operator(,) ident(padding)operator(=)integer(2)operator(\)) - instance_variable(@paginator) operator(=) ident(page)operator(.)ident(paginator) - instance_variable(@page) operator(=) ident(page) - pre_constant(self)operator(.)ident(padding) operator(=) ident(padding) - reserved(end) - ident(attr_reader) symbol(:paginator)operator(,) symbol(:page) - - comment(# Sets the window's padding (the number of pages on either side of the) - comment(# window page\).) - reserved(def) method(padding=)operator(()ident(padding)operator(\)) - instance_variable(@padding) operator(=) ident(padding) operator(<) integer(0) operator(?) integer(0) operator(:) ident(padding) - comment(# Find the beginning and end pages of the window) - instance_variable(@first) operator(=) instance_variable(@paginator)operator(.)ident(has_page_number?)operator(()instance_variable(@page)operator(.)ident(number) operator(-) instance_variable(@padding)operator(\)) operator(?) - instance_variable(@paginator)operator([)instance_variable(@page)operator(.)ident(number) operator(-) instance_variable(@padding)operator(]) operator(:) instance_variable(@paginator)operator(.)ident(first) - instance_variable(@last) operator(=) instance_variable(@paginator)operator(.)ident(has_page_number?)operator(()instance_variable(@page)operator(.)ident(number) operator(+) instance_variable(@padding)operator(\)) operator(?) - instance_variable(@paginator)operator([)instance_variable(@page)operator(.)ident(number) operator(+) instance_variable(@padding)operator(]) operator(:) instance_variable(@paginator)operator(.)ident(last) - reserved(end) - ident(attr_reader) symbol(:padding)operator(,) symbol(:first)operator(,) symbol(:last) - - comment(# Returns an array of Page objects in the current window.) - reserved(def) method(pages) - operator(()instance_variable(@first)operator(.)ident(number)operator(..)instance_variable(@last)operator(.)ident(number)operator(\))operator(.)ident(to_a)operator(.)ident(collect!) operator({)operator(|)ident(n)operator(|) instance_variable(@paginator)operator([)ident(n)operator(])operator(}) - reserved(end) - reserved(alias) method(to_a) symbol(:pages) - reserved(end) - reserved(end) - - reserved(end) -reserved(end) -reserved(module) class(ActionController) - comment(# Subclassing AbstractRequest makes these methods available to the request objects used in production and testing,) - comment(# CgiRequest and TestRequest) - reserved(class) class(AbstractRequest) - ident(cattr_accessor) symbol(:relative_url_root) - - comment(# Returns the hash of environment variables for this request,) - comment(# such as { 'RAILS_ENV' => 'production' }.) - ident(attr_reader) symbol(:env) - - comment(# Returns both GET and POST parameters in a single hash.) - reserved(def) method(parameters) - instance_variable(@parameters) operator(||=) ident(request_parameters)operator(.)ident(update)operator(()ident(query_parameters)operator(\))operator(.)ident(update)operator(()ident(path_parameters)operator(\))operator(.)ident(with_indifferent_access) - reserved(end) - - comment(# Returns the HTTP request method as a lowercase symbol (:get, for example\)) - reserved(def) method(method) - instance_variable(@request_method) operator(||=) instance_variable(@env)operator([)stringoperator(])operator(.)ident(downcase)operator(.)ident(to_sym) - reserved(end) - - comment(# Is this a GET request? Equivalent to request.method == :get) - reserved(def) method(get?) - ident(method) operator(==) symbol(:get) - reserved(end) - - comment(# Is this a POST request? Equivalent to request.method == :post) - reserved(def) method(post?) - ident(method) operator(==) symbol(:post) - reserved(end) - - comment(# Is this a PUT request? Equivalent to request.method == :put) - reserved(def) method(put?) - ident(method) operator(==) symbol(:put) - reserved(end) - - comment(# Is this a DELETE request? Equivalent to request.method == :delete) - reserved(def) method(delete?) - ident(method) operator(==) symbol(:delete) - reserved(end) - - comment(# Is this a HEAD request? Equivalent to request.method == :head) - reserved(def) method(head?) - ident(method) operator(==) symbol(:head) - reserved(end) - - comment(# Determine whether the body of a HTTP call is URL-encoded (default\)) - comment(# or matches one of the registered param_parsers. ) - comment(#) - comment(# For backward compatibility, the post format is extracted from the) - comment(# X-Post-Data-Format HTTP header if present.) - reserved(def) method(content_type) - instance_variable(@content_type) operator(||=) - reserved(begin) - ident(content_type) operator(=) instance_variable(@env)operator([)stringoperator(])operator(.)ident(to_s)operator(.)ident(downcase) - - reserved(if) ident(x_post_format) operator(=) instance_variable(@env)operator([)stringoperator(]) - reserved(case) ident(x_post_format)operator(.)ident(to_s)operator(.)ident(downcase) - reserved(when) string - ident(content_type) operator(=) string - reserved(when) string - ident(content_type) operator(=) string - reserved(end) - reserved(end) - - constant(Mime)operator(::)constant(Type)operator(.)ident(lookup)operator(()ident(content_type)operator(\)) - reserved(end) - reserved(end) - - comment(# Returns the accepted MIME type for the request) - reserved(def) method(accepts) - instance_variable(@accepts) operator(||=) - reserved(if) instance_variable(@env)operator([)stringoperator(])operator(.)ident(to_s)operator(.)ident(strip)operator(.)ident(empty?) - operator([) ident(content_type)operator(,) constant(Mime)operator(::)constant(ALL) operator(]) - reserved(else) - constant(Mime)operator(::)constant(Type)operator(.)ident(parse)operator(()instance_variable(@env)operator([)stringoperator(])operator(\)) - reserved(end) - reserved(end) - - comment(# Returns true if the request's "X-Requested-With" header contains) - comment(# "XMLHttpRequest". (The Prototype Javascript library sends this header with) - comment(# every Ajax request.\)) - reserved(def) method(xml_http_request?) - reserved(not) regexpoperator(.)ident(match)operator(()instance_variable(@env)operator([)stringoperator(])operator(\))operator(.)ident(nil?) - reserved(end) - reserved(alias) method(xhr?) symbol(:xml_http_request?) - - comment(# Determine originating IP address. REMOTE_ADDR is the standard) - comment(# but will fail if the user is behind a proxy. HTTP_CLIENT_IP and/or) - comment(# HTTP_X_FORWARDED_FOR are set by proxies so check for these before) - comment(# falling back to REMOTE_ADDR. HTTP_X_FORWARDED_FOR may be a comma-) - comment(# delimited list in the case of multiple chained proxies; the first is) - comment(# the originating IP.) - reserved(def) method(remote_ip) - reserved(return) instance_variable(@env)operator([)stringoperator(]) reserved(if) instance_variable(@env)operator(.)ident(include?) string - - reserved(if) instance_variable(@env)operator(.)ident(include?) string reserved(then) - ident(remote_ips) operator(=) instance_variable(@env)operator([)stringoperator(])operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(reject) reserved(do) operator(|)ident(ip)operator(|) - ident(ip) operator(=)operator(~) regexp - reserved(end) - - reserved(return) ident(remote_ips)operator(.)ident(first)operator(.)ident(strip) reserved(unless) ident(remote_ips)operator(.)ident(empty?) - reserved(end) - - instance_variable(@env)operator([)stringoperator(]) - reserved(end) - - comment(# Returns the domain part of a host, such as rubyonrails.org in "www.rubyonrails.org". You can specify) - comment(# a different tld_length, such as 2 to catch rubyonrails.co.uk in "www.rubyonrails.co.uk".) - reserved(def) method(domain)operator(()ident(tld_length) operator(=) integer(1)operator(\)) - reserved(return) pre_constant(nil) reserved(if) operator(!)regexpoperator(.)ident(match)operator(()ident(host)operator(\))operator(.)ident(nil?) reserved(or) ident(host)operator(.)ident(nil?) - - ident(host)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last)operator(()integer(1) operator(+) ident(tld_length)operator(\))operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - comment(# Returns all the subdomains as an array, so ["dev", "www"] would be returned for "dev.www.rubyonrails.org".) - comment(# You can specify a different tld_length, such as 2 to catch ["www"] instead of ["www", "rubyonrails"]) - comment(# in "www.rubyonrails.co.uk".) - reserved(def) method(subdomains)operator(()ident(tld_length) operator(=) integer(1)operator(\)) - reserved(return) operator([)operator(]) reserved(unless) ident(host) - ident(parts) operator(=) ident(host)operator(.)ident(split)operator(()stringoperator(\)) - ident(parts)operator([)integer(0)operator(..)operator(-)operator(()ident(tld_length)operator(+)integer(2)operator(\))operator(]) - reserved(end) - - comment(# Receive the raw post data.) - comment(# This is useful for services such as REST, XMLRPC and SOAP) - comment(# which communicate over HTTP POST but don't use the traditional parameter format.) - reserved(def) method(raw_post) - instance_variable(@env)operator([)stringoperator(]) - reserved(end) - - comment(# Returns the request URI correctly, taking into account the idiosyncracies) - comment(# of the various servers.) - reserved(def) method(request_uri) - reserved(if) ident(uri) operator(=) instance_variable(@env)operator([)stringoperator(]) - operator(()regexp operator(=)operator(~) ident(uri)operator(\)) operator(?) global_variable($1) operator(:) ident(uri) comment(# Remove domain, which webrick puts into the request_uri.) - reserved(else) comment(# REQUEST_URI is blank under IIS - get this from PATH_INFO and SCRIPT_NAME) - ident(script_filename) operator(=) instance_variable(@env)operator([)stringoperator(])operator(.)ident(to_s)operator(.)ident(match)operator(()regexpoperator(\)) - ident(uri) operator(=) instance_variable(@env)operator([)stringoperator(]) - ident(uri) operator(=) ident(uri)operator(.)ident(sub)operator(()regexpchar(\\/)delimiter(/)>operator(,) stringoperator(\)) reserved(unless) ident(script_filename)operator(.)ident(nil?) - reserved(unless) operator(()ident(env_qs) operator(=) instance_variable(@env)operator([)stringoperator(])operator(\))operator(.)ident(nil?) operator(||) ident(env_qs)operator(.)ident(empty?) - ident(uri) operator(<<) string operator(<<) ident(env_qs) - reserved(end) - ident(uri) - reserved(end) - reserved(end) - - comment(# Return 'https://' if this is an SSL request and 'http://' otherwise.) - reserved(def) method(protocol) - ident(ssl?) operator(?) string operator(:) string - reserved(end) - - comment(# Is this an SSL request?) - reserved(def) method(ssl?) - instance_variable(@env)operator([)stringoperator(]) operator(==) string operator(||) instance_variable(@env)operator([)stringoperator(]) operator(==) string - reserved(end) - - comment(# Returns the interpreted path to requested resource after all the installation directory of this application was taken into account) - reserved(def) method(path) - ident(path) operator(=) operator(()ident(uri) operator(=) ident(request_uri)operator(\)) operator(?) ident(uri)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(first) operator(:) string - - comment(# Cut off the path to the installation directory if given) - ident(root) operator(=) ident(relative_url_root) - ident(path)operator([)integer(0)operator(,) ident(root)operator(.)ident(length)operator(]) operator(=) string reserved(if) ident(root) - ident(path) operator(||) string - reserved(end) - - comment(# Returns the path minus the web server relative installation directory.) - comment(# This can be set with the environment variable RAILS_RELATIVE_URL_ROOT.) - comment(# It can be automatically extracted for Apache setups. If the server is not) - comment(# Apache, this method returns an empty string.) - reserved(def) method(relative_url_root) - class_variable(@@relative_url_root) operator(||=) reserved(case) - reserved(when) instance_variable(@env)operator([)stringoperator(]) - instance_variable(@env)operator([)stringoperator(]) - reserved(when) ident(server_software) operator(==) string - instance_variable(@env)operator([)stringoperator(])operator(.)ident(to_s)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - reserved(else) - string - reserved(end) - reserved(end) - - comment(# Returns the port number of this request as an integer.) - reserved(def) method(port) - instance_variable(@port_as_int) operator(||=) instance_variable(@env)operator([)stringoperator(])operator(.)ident(to_i) - reserved(end) - - comment(# Returns the standard port number for this request's protocol) - reserved(def) method(standard_port) - reserved(case) ident(protocol) - reserved(when) string reserved(then) integer(443) - reserved(else) integer(80) - reserved(end) - reserved(end) - - comment(# Returns a port suffix like ":8080" if the port number of this request) - comment(# is not the default HTTP port 80 or HTTPS port 443.) - reserved(def) method(port_string) - operator(()ident(port) operator(==) ident(standard_port)operator(\)) operator(?) string operator(:) stringdelimiter(")> - reserved(end) - - comment(# Returns a host:port string for this request, such as example.com or) - comment(# example.com:8080.) - reserved(def) method(host_with_port) - ident(host) operator(+) ident(port_string) - reserved(end) - - reserved(def) method(path_parameters=)operator(()ident(parameters)operator(\)) comment(#:nodoc:) - instance_variable(@path_parameters) operator(=) ident(parameters) - instance_variable(@symbolized_path_parameters) operator(=) instance_variable(@parameters) operator(=) pre_constant(nil) - reserved(end) - - comment(# The same as path_parameters with explicitly symbolized keys ) - reserved(def) method(symbolized_path_parameters) - instance_variable(@symbolized_path_parameters) operator(||=) ident(path_parameters)operator(.)ident(symbolize_keys) - reserved(end) - - comment(# Returns a hash with the parameters used to form the path of the request ) - comment(#) - comment(# Example: ) - comment(#) - comment(# {:action => 'my_action', :controller => 'my_controller'}) - reserved(def) method(path_parameters) - instance_variable(@path_parameters) operator(||=) operator({)operator(}) - reserved(end) - - comment(# Returns the lowercase name of the HTTP server software.) - reserved(def) method(server_software) - operator(()instance_variable(@env)operator([)stringoperator(]) operator(&&) regexp operator(=)operator(~) instance_variable(@env)operator([)stringoperator(])operator(\)) operator(?) global_variable($1)operator(.)ident(downcase) operator(:) pre_constant(nil) - reserved(end) - - comment(#--) - comment(# Must be implemented in the concrete request) - comment(#++) - reserved(def) method(query_parameters) comment(#:nodoc:) - reserved(end) - - reserved(def) method(request_parameters) comment(#:nodoc:) - reserved(end) - - comment(# Returns the host for this request, such as example.com.) - reserved(def) method(host) - reserved(end) - - reserved(def) method(cookies) comment(#:nodoc:) - reserved(end) - - reserved(def) method(session) comment(#:nodoc:) - reserved(end) - - reserved(def) method(session=)operator(()ident(session)operator(\)) comment(#:nodoc:) - instance_variable(@session) operator(=) ident(session) - reserved(end) - - reserved(def) method(reset_session) comment(#:nodoc:) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) comment(#:nodoc:) - comment(# Actions that fail to perform as expected throw exceptions. These exceptions can either be rescued for the public view ) - comment(# (with a nice user-friendly explanation\) or for the developers view (with tons of debugging information\). The developers view) - comment(# is already implemented by the Action Controller, but the public view should be tailored to your specific application. So too) - comment(# could the decision on whether something is a public or a developer request.) - comment(#) - comment(# You can tailor the rescuing behavior and appearance by overwriting the following two stub methods.) - reserved(module) class(Rescue) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:perform_action_without_rescue)operator(,) symbol(:perform_action) - ident(alias_method) symbol(:perform_action)operator(,) symbol(:perform_action_with_rescue) - reserved(end) - reserved(end) - - reserved(module) class(ClassMethods) comment(#:nodoc:) - reserved(def) method(process_with_exception)operator(()ident(request)operator(,) ident(response)operator(,) ident(exception)operator(\)) - ident(new)operator(.)ident(process)operator(()ident(request)operator(,) ident(response)operator(,) symbol(:rescue_action)operator(,) ident(exception)operator(\)) - reserved(end) - reserved(end) - - ident(protected) - comment(# Exception handler called when the performance of an action raises an exception.) - reserved(def) method(rescue_action)operator(()ident(exception)operator(\)) - ident(log_error)operator(()ident(exception)operator(\)) reserved(if) ident(logger) - ident(erase_results) reserved(if) ident(performed?) - - reserved(if) ident(consider_all_requests_local) operator(||) ident(local_request?) - ident(rescue_action_locally)operator(()ident(exception)operator(\)) - reserved(else) - ident(rescue_action_in_public)operator(()ident(exception)operator(\)) - reserved(end) - reserved(end) - - comment(# Overwrite to implement custom logging of errors. By default logs as fatal.) - reserved(def) method(log_error)operator(()ident(exception)operator(\)) comment(#:doc:) - reserved(if) constant(ActionView)operator(::)constant(TemplateError) operator(===) ident(exception) - ident(logger)operator(.)ident(fatal)operator(()ident(exception)operator(.)ident(to_s)operator(\)) - reserved(else) - ident(logger)operator(.)ident(fatal)operator(() - stringcontent( ()inlinecontent(\):)char(\\n)content( )delimiter(")> operator(+) - ident(clean_backtrace)operator(()ident(exception)operator(\))operator(.)ident(join)operator(()stringoperator(\)) operator(+) - string - operator(\)) - reserved(end) - reserved(end) - - comment(# Overwrite to implement public exception handling (for requests answering false to local_request?\).) - reserved(def) method(rescue_action_in_public)operator(()ident(exception)operator(\)) comment(#:doc:) - reserved(case) ident(exception) - reserved(when) constant(RoutingError)operator(,) constant(UnknownAction) reserved(then) - ident(render_text)operator(()constant(IO)operator(.)ident(read)operator(()constant(File)operator(.)ident(join)operator(()constant(RAILS_ROOT)operator(,) stringoperator(,) stringoperator(\))operator(\))operator(,) stringoperator(\)) - reserved(else) ident(render_text) string

Application error (Rails\)

)delimiter(")> - reserved(end) - reserved(end) - - comment(# Overwrite to expand the meaning of a local request in order to show local rescues on other occurrences than) - comment(# the remote IP being 127.0.0.1. For example, this could include the IP of the developer machine when debugging) - comment(# remotely.) - reserved(def) method(local_request?) comment(#:doc:) - operator([)instance_variable(@request)operator(.)ident(remote_addr)operator(,) instance_variable(@request)operator(.)ident(remote_ip)operator(]) operator(==) operator([)stringoperator(]) operator(*) integer(2) - reserved(end) - - comment(# Renders a detailed diagnostics screen on action exceptions. ) - reserved(def) method(rescue_action_locally)operator(()ident(exception)operator(\)) - ident(add_variables_to_assigns) - instance_variable(@template)operator(.)ident(instance_variable_set)operator(()stringoperator(,) ident(exception)operator(\)) - instance_variable(@template)operator(.)ident(instance_variable_set)operator(()stringoperator(,) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - instance_variable(@template)operator(.)ident(send)operator(()symbol(:assign_variables_from_controller)operator(\)) - - instance_variable(@template)operator(.)ident(instance_variable_set)operator(()stringoperator(,) instance_variable(@template)operator(.)ident(render_file)operator(()ident(template_path_for_local_rescue)operator(()ident(exception)operator(\))operator(,) pre_constant(false)operator(\))operator(\)) - - instance_variable(@headers)operator([)stringoperator(]) operator(=) string - ident(render_file)operator(()ident(rescues_path)operator(()stringoperator(\))operator(,) ident(response_code_for_rescue)operator(()ident(exception)operator(\))operator(\)) - reserved(end) - - ident(private) - reserved(def) method(perform_action_with_rescue) comment(#:nodoc:) - reserved(begin) - ident(perform_action_without_rescue) - reserved(rescue) constant(Object) operator(=)operator(>) ident(exception) - reserved(if) reserved(defined?)operator(()constant(Breakpoint)operator(\)) operator(&&) instance_variable(@params)operator([)stringoperator(]) - ident(msg) operator(=) ident(exception)operator(.)ident(backtrace)operator(.)ident(first) - reserved(if) ident(md) operator(=) regexpoperator(.)ident(match)operator(()ident(msg)operator(\)) reserved(then) - ident(origin_file)operator(,) ident(origin_line) operator(=) ident(md)operator([)integer(1)operator(])operator(,) ident(md)operator([)integer(2)operator(])operator(.)ident(to_i) - - ident(set_trace_func)operator(()ident(lambda) reserved(do) operator(|)ident(type)operator(,) ident(file)operator(,) ident(line)operator(,) ident(method)operator(,) ident(context)operator(,) ident(klass)operator(|) - reserved(if) ident(file) operator(==) ident(origin_file) reserved(and) ident(line) operator(==) ident(origin_line) reserved(then) - ident(set_trace_func)operator(()pre_constant(nil)operator(\)) - instance_variable(@params)operator([)stringoperator(]) operator(=) pre_constant(false) - - ident(callstack) operator(=) ident(caller) - ident(callstack)operator(.)ident(slice!)operator(()integer(0)operator(\)) reserved(if) ident(callstack)operator(.)ident(first)operator([)stringoperator(]) - ident(file)operator(,) ident(line)operator(,) ident(method) operator(=) operator(*)ident(callstack)operator(.)ident(first)operator(.)ident(match)operator(()regexpoperator(\))operator(.)ident(captures) - - ident(message) operator(=) stringcontent(:)inlineinlinecontent(')delimiter(")> reserved(if) ident(method)inline_delimiter(})>content(.)delimiter(")> comment(# `´ ( for ruby-mode\)) - - constant(Breakpoint)operator(.)ident(handle_breakpoint)operator(()ident(context)operator(,) ident(message)operator(,) ident(file)operator(,) ident(line)operator(\)) - reserved(end) - reserved(end)operator(\)) - - reserved(retry) - reserved(end) - reserved(end) - - ident(rescue_action)operator(()ident(exception)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(rescues_path)operator(()ident(template_name)operator(\)) - constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringcontent(.rhtml)delimiter(")> - reserved(end) - - reserved(def) method(template_path_for_local_rescue)operator(()ident(exception)operator(\)) - ident(rescues_path)operator(() - reserved(case) ident(exception) - reserved(when) constant(MissingTemplate) reserved(then) string - reserved(when) constant(RoutingError) reserved(then) string - reserved(when) constant(UnknownAction) reserved(then) string - reserved(when) constant(ActionView)operator(::)constant(TemplateError) reserved(then) string - reserved(else) string - reserved(end) - operator(\)) - reserved(end) - - reserved(def) method(response_code_for_rescue)operator(()ident(exception)operator(\)) - reserved(case) ident(exception) - reserved(when) constant(UnknownAction)operator(,) constant(RoutingError) reserved(then) string - reserved(else) string - reserved(end) - reserved(end) - - reserved(def) method(clean_backtrace)operator(()ident(exception)operator(\)) - ident(exception)operator(.)ident(backtrace)operator(.)ident(collect) operator({) operator(|)ident(line)operator(|) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:RAILS_ROOT)operator(\)) operator(?) ident(line)operator(.)ident(gsub)operator(()constant(RAILS_ROOT)operator(,) stringoperator(\)) operator(:) ident(line) operator(}) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) - reserved(class) class(AbstractResponse) comment(#:nodoc:) - constant(DEFAULT_HEADERS) operator(=) operator({) string operator(=)operator(>) string operator(}) - ident(attr_accessor) symbol(:body)operator(,) symbol(:headers)operator(,) symbol(:session)operator(,) symbol(:cookies)operator(,) symbol(:assigns)operator(,) symbol(:template)operator(,) symbol(:redirected_to)operator(,) symbol(:redirected_to_method_params) - - reserved(def) method(initialize) - instance_variable(@body)operator(,) instance_variable(@headers)operator(,) instance_variable(@session)operator(,) instance_variable(@assigns) operator(=) stringoperator(,) constant(DEFAULT_HEADERS)operator(.)ident(merge)operator(()string operator(=)operator(>) operator([)operator(])operator(\))operator(,) operator([)operator(])operator(,) operator([)operator(]) - reserved(end) - - reserved(def) method(redirect)operator(()ident(to_url)operator(,) ident(permanently) operator(=) pre_constant(false)operator(\)) - instance_variable(@headers)operator([)stringoperator(]) operator(=) string reserved(unless) instance_variable(@headers)operator([)stringoperator(]) operator(==) string - instance_variable(@headers)operator([)stringoperator(]) operator(=) ident(to_url) - - instance_variable(@body) operator(=) stringYou are being char(\\")content(>redirected.)delimiter(")> - reserved(end) - reserved(end) -ident(endmodule) constant(ActionController) - reserved(module) class(Routing) comment(#:nodoc:) - reserved(class) operator(<<) class(self) - reserved(def) method(expiry_hash)operator(()ident(options)operator(,) ident(recall)operator(\)) - ident(k) operator(=) ident(v) operator(=) pre_constant(nil) - ident(expire_on) operator(=) operator({)operator(}) - ident(options)operator(.)ident(each) operator({)operator(|)ident(k)operator(,) ident(v)operator(|) ident(expire_on)operator([)ident(k)operator(]) operator(=) operator(()operator(()ident(rcv) operator(=) ident(recall)operator([)ident(k)operator(])operator(\)) operator(&&) operator(()ident(rcv) operator(!=) ident(v)operator(\))operator(\))operator(}) - ident(expire_on) - reserved(end) - - reserved(def) method(extract_parameter_value)operator(()ident(parameter)operator(\)) comment(#:nodoc:) - constant(CGI)operator(.)ident(escape)operator(()operator(()ident(parameter)operator(.)ident(respond_to?)operator(()symbol(:to_param)operator(\)) operator(?) ident(parameter)operator(.)ident(to_param) operator(:) ident(parameter)operator(\))operator(.)ident(to_s)operator(\)) - reserved(end) - reserved(def) method(controller_relative_to)operator(()ident(controller)operator(,) ident(previous)operator(\)) - reserved(if) ident(controller)operator(.)ident(nil?) reserved(then) ident(previous) - reserved(elsif) ident(controller)operator([)integer(0)operator(]) operator(==) integer(?/) reserved(then) ident(controller)operator([)integer(1)operator(..)integer(-1)operator(]) - reserved(elsif) regexp operator(=)operator(~) ident(previous) reserved(then) stringcontent(/)inlinedelimiter(")> - reserved(else) ident(controller) - reserved(end) - reserved(end) - - reserved(def) method(treat_hash)operator(()ident(hash)operator(,) ident(keys_to_delete) operator(=) operator([)operator(])operator(\)) - ident(k) operator(=) ident(v) operator(=) pre_constant(nil) - ident(hash)operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,) ident(v)operator(|) - reserved(if) ident(v) reserved(then) ident(hash)operator([)ident(k)operator(]) operator(=) operator(()ident(v)operator(.)ident(respond_to?) symbol(:to_param)operator(\)) operator(?) ident(v)operator(.)ident(to_param)operator(.)ident(to_s) operator(:) ident(v)operator(.)ident(to_s) - reserved(else) - ident(hash)operator(.)ident(delete) ident(k) - ident(keys_to_delete) operator(<<) ident(k) - reserved(end) - reserved(end) - ident(hash) - reserved(end) - - reserved(def) method(test_condition)operator(()ident(expression)operator(,) ident(condition)operator(\)) - reserved(case) ident(condition) - reserved(when) constant(String) reserved(then) stringcontent( == )inlinecontent(\))delimiter(")> - reserved(when) constant(Regexp) reserved(then) - ident(condition) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringcontent($)delimiter(")>operator(\)) reserved(unless) regexp operator(=)operator(~) ident(condition)operator(.)ident(source) - stringcontent( =~ )inlinecontent(\))delimiter(")> - reserved(when) constant(Array) reserved(then) - ident(conds) operator(=) ident(condition)operator(.)ident(collect) reserved(do) operator(|)ident(condition)operator(|) - ident(cond) operator(=) ident(test_condition)operator(()ident(expression)operator(,) ident(condition)operator(\)) - operator(()ident(cond)operator([)integer(0)operator(,) integer(1)operator(]) operator(==) string operator(&&) ident(cond)operator([)integer(-1)operator(,) integer(1)operator(]) operator(==) stringoperator(\)) operator(?) ident(cond) operator(:) stringcontent(\))delimiter(")> - reserved(end) - stringoperator(\))inline_delimiter(})>content(\))delimiter(")> - reserved(when) pre_constant(true) reserved(then) ident(expression) - reserved(when) pre_constant(nil) reserved(then) stringdelimiter(")> - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(Component) comment(#:nodoc:) - reserved(def) method(dynamic?)operator(()operator(\)) pre_constant(false) reserved(end) - reserved(def) method(optional?)operator(()operator(\)) pre_constant(false) reserved(end) - - reserved(def) method(key)operator(()operator(\)) pre_constant(nil) reserved(end) - - reserved(def) pre_constant(self)operator(.)method(new)operator(()ident(string)operator(,) operator(*)ident(args)operator(\)) - reserved(return) reserved(super)operator(()ident(string)operator(,) operator(*)ident(args)operator(\)) reserved(unless) pre_constant(self) operator(==) constant(Component) - reserved(case) ident(string) - reserved(when) string reserved(then) constant(ControllerComponent)operator(.)ident(new)operator(()symbol(:controller)operator(,) operator(*)ident(args)operator(\)) - reserved(when) regexp reserved(then) constant(DynamicComponent)operator(.)ident(new)operator(()global_variable($1)operator(,) operator(*)ident(args)operator(\)) - reserved(when) regexp reserved(then) constant(PathComponent)operator(.)ident(new)operator(()global_variable($1)operator(,) operator(*)ident(args)operator(\)) - reserved(else) constant(StaticComponent)operator(.)ident(new)operator(()ident(string)operator(,) operator(*)ident(args)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(StaticComponent) operator(<) constant(Component) comment(#:nodoc:) - ident(attr_reader) symbol(:value) - - reserved(def) method(initialize)operator(()ident(value)operator(\)) - instance_variable(@value) operator(=) ident(value) - reserved(end) - - reserved(def) method(write_recognition)operator(()ident(g)operator(\)) - ident(g)operator(.)ident(if_next_matches)operator(()ident(value)operator(\)) reserved(do) operator(|)ident(gp)operator(|) - ident(gp)operator(.)ident(move_forward) operator({)operator(|)ident(gpp)operator(|) ident(gpp)operator(.)ident(continue)operator(}) - reserved(end) - reserved(end) - - reserved(def) method(write_generation)operator(()ident(g)operator(\)) - ident(g)operator(.)ident(add_segment)operator(()ident(value)operator(\)) operator({)operator(|)ident(gp)operator(|) ident(gp)operator(.)ident(continue) operator(}) - reserved(end) - reserved(end) - - reserved(class) class(DynamicComponent) operator(<) constant(Component) comment(#:nodoc:) - ident(attr_reader) symbol(:key)operator(,) symbol(:default) - ident(attr_accessor) symbol(:condition) - - reserved(def) method(dynamic?)operator(()operator(\)) pre_constant(true) reserved(end) - reserved(def) method(optional?)operator(()operator(\)) instance_variable(@optional) reserved(end) - - reserved(def) method(default=)operator(()ident(default)operator(\)) - instance_variable(@optional) operator(=) pre_constant(true) - instance_variable(@default) operator(=) ident(default) - reserved(end) - - reserved(def) method(initialize)operator(()ident(key)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - instance_variable(@key) operator(=) ident(key)operator(.)ident(to_sym) - instance_variable(@optional) operator(=) pre_constant(false) - ident(default)operator(,) instance_variable(@condition) operator(=) ident(options)operator([)symbol(:default)operator(])operator(,) ident(options)operator([)symbol(:condition)operator(]) - pre_constant(self)operator(.)ident(default) operator(=) ident(default) reserved(if) ident(options)operator(.)ident(key?)operator(()symbol(:default)operator(\)) - reserved(end) - - reserved(def) method(default_check)operator(()ident(g)operator(\)) - ident(presence) operator(=) stringdelimiter(")> - reserved(if) ident(default) - stringcontent( && )inlinecontent( != )inlinecontent(\))delimiter(")> - reserved(else) - stringdelimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(write_generation)operator(()ident(g)operator(\)) - ident(wrote_dropout) operator(=) ident(write_dropout_generation)operator(()ident(g)operator(\)) - ident(write_continue_generation)operator(()ident(g)operator(,) ident(wrote_dropout)operator(\)) - reserved(end) - - reserved(def) method(write_dropout_generation)operator(()ident(g)operator(\)) - reserved(return) pre_constant(false) reserved(unless) ident(optional?) operator(&&) ident(g)operator(.)ident(after)operator(.)ident(all?) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(optional?)operator(}) - - ident(check) operator(=) operator([)ident(default_check)operator(()ident(g)operator(\))operator(]) - ident(gp) operator(=) ident(g)operator(.)ident(dup) comment(# Use another generator to write the conditions after the first &&) - comment(# We do this to ensure that the generator will not assume x_value is set. It will) - comment(# not be set if it follows a false condition -- for example, false && (x = 2\)) - - ident(check) operator(+=) ident(gp)operator(.)ident(after)operator(.)ident(map) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(default_check) ident(gp)operator(}) - ident(gp)operator(.)ident(if)operator(()ident(check)operator(.)ident(join)operator(()stringoperator(\))operator(\)) operator({) ident(gp)operator(.)ident(finish) operator(}) comment(# If this condition is met, we stop here) - pre_constant(true) - reserved(end) - - reserved(def) method(write_continue_generation)operator(()ident(g)operator(,) ident(use_else)operator(\)) - ident(test) operator(=) constant(Routing)operator(.)ident(test_condition)operator(()ident(g)operator(.)ident(hash_value)operator(()ident(key)operator(,) pre_constant(true)operator(,) ident(default)operator(\))operator(,) ident(condition) operator(||) pre_constant(true)operator(\)) - ident(check) operator(=) operator(()ident(use_else) operator(&&) ident(condition)operator(.)ident(nil?) operator(&&) ident(default)operator(\)) operator(?) operator([)symbol(:else)operator(]) operator(:) operator([)ident(use_else) operator(?) symbol(:elsif) operator(:) symbol(:if)operator(,) ident(test)operator(]) - - ident(g)operator(.)ident(send)operator(()operator(*)ident(check)operator(\)) reserved(do) operator(|)ident(gp)operator(|) - ident(gp)operator(.)ident(expire_for_keys)operator(()ident(key)operator(\)) reserved(unless) ident(gp)operator(.)ident(after)operator(.)ident(empty?) - ident(add_segments_to)operator(()ident(gp)operator(\)) operator({)operator(|)ident(gpp)operator(|) ident(gpp)operator(.)ident(continue)operator(}) - reserved(end) - reserved(end) - - reserved(def) method(add_segments_to)operator(()ident(g)operator(\)) - ident(g)operator(.)ident(add_segment)operator(()stringnesting_delimiter(\))content(})delimiter(\))>operator(\)) operator({)operator(|)ident(gp)operator(|) reserved(yield) ident(gp)operator(}) - reserved(end) - - reserved(def) method(recognition_check)operator(()ident(g)operator(\)) - ident(test_type) operator(=) operator([)pre_constant(true)operator(,) pre_constant(nil)operator(])operator(.)ident(include?)operator(()ident(condition)operator(\)) operator(?) symbol(:presence) operator(:) symbol(:constraint) - - ident(prefix) operator(=) ident(condition)operator(.)ident(is_a?)operator(()constant(Regexp)operator(\)) operator(?) stringcontent( && )delimiter(")> operator(:) string - ident(check) operator(=) ident(prefix) operator(+) constant(Routing)operator(.)ident(test_condition)operator(()ident(g)operator(.)ident(next_segment)operator(()pre_constant(true)operator(\))operator(,) ident(condition) operator(||) pre_constant(true)operator(\)) - - ident(g)operator(.)ident(if)operator(()ident(check)operator(\)) operator({)operator(|)ident(gp)operator(|) reserved(yield) ident(gp)operator(,) ident(test_type)operator(}) - reserved(end) - - reserved(def) method(write_recognition)operator(()ident(g)operator(\)) - ident(test_type) operator(=) pre_constant(nil) - ident(recognition_check)operator(()ident(g)operator(\)) reserved(do) operator(|)ident(gp)operator(,) ident(test_type)operator(|) - ident(assign_result)operator(()ident(gp)operator(\)) operator({)operator(|)ident(gpp)operator(|) ident(gpp)operator(.)ident(continue)operator(}) - reserved(end) - - reserved(if) ident(optional?) operator(&&) ident(g)operator(.)ident(after)operator(.)ident(all?) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(optional?)operator(}) - ident(call) operator(=) operator(()ident(test_type) operator(==) symbol(:presence)operator(\)) operator(?) operator([)symbol(:else)operator(]) operator(:) operator([)symbol(:elsif)operator(,) stringdelimiter(")>operator(]) - - ident(g)operator(.)ident(send)operator(()operator(*)ident(call)operator(\)) reserved(do) operator(|)ident(gp)operator(|) - ident(assign_default)operator(()ident(gp)operator(\)) - ident(gp)operator(.)ident(after)operator(.)ident(each) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(assign_default)operator(()ident(gp)operator(\))operator(}) - ident(gp)operator(.)ident(finish)operator(()pre_constant(false)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(assign_result)operator(()ident(g)operator(,) ident(with_default) operator(=) pre_constant(false)operator(\)) - ident(g)operator(.)ident(result) ident(key)operator(,) stringcontent(\))delimiter(")> - ident(g)operator(.)ident(move_forward) operator({)operator(|)ident(gp)operator(|) reserved(yield) ident(gp)operator(}) - reserved(end) - - reserved(def) method(assign_default)operator(()ident(g)operator(\)) - ident(g)operator(.)ident(constant_result) ident(key)operator(,) ident(default) reserved(unless) ident(default)operator(.)ident(nil?) - reserved(end) - reserved(end) - - reserved(class) class(ControllerComponent) operator(<) constant(DynamicComponent) comment(#:nodoc:) - reserved(def) method(key)operator(()operator(\)) symbol(:controller) reserved(end) - - reserved(def) method(add_segments_to)operator(()ident(g)operator(\)) - ident(g)operator(.)ident(add_segment)operator(()stringcontent(})delimiter(\))>operator(\)) operator({)operator(|)ident(gp)operator(|) reserved(yield) ident(gp)operator(}) - reserved(end) - - reserved(def) method(recognition_check)operator(()ident(g)operator(\)) - ident(g) operator(<<) stringcontent(, )inlinecontent(\))delimiter(")> - ident(g)operator(.)ident(if)operator(()stringoperator(\)) reserved(do) operator(|)ident(gp)operator(|) - ident(gp) operator(<<) string - reserved(if) ident(condition) - ident(gp) operator(<<) stringcontent([)inlinecontent(,segments_to_controller].join('/'\))delimiter(")> - ident(gp)operator(.)ident(if)operator(()constant(Routing)operator(.)ident(test_condition)operator(()stringoperator(,) ident(condition)operator(\))operator(\)) reserved(do) operator(|)ident(gpp)operator(|) - ident(gpp)operator(.)ident(move_forward)operator(()stringoperator(\)) operator({)operator(|)ident(gppp)operator(|) reserved(yield) ident(gppp)operator(,) symbol(:constraint)operator(}) - reserved(end) - reserved(else) - ident(gp)operator(.)ident(move_forward)operator(()stringoperator(\)) operator({)operator(|)ident(gpp)operator(|) reserved(yield) ident(gpp)operator(,) symbol(:constraint)operator(}) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(assign_result)operator(()ident(g)operator(\)) - ident(g)operator(.)ident(result) ident(key)operator(,) string - reserved(yield) ident(g) - reserved(end) - - reserved(def) method(assign_default)operator(()ident(g)operator(\)) - constant(ControllerComponent)operator(.)ident(assign_controller)operator(()ident(g)operator(,) ident(default)operator(\)) - reserved(end) - - reserved(class) operator(<<) class(self) - reserved(def) method(assign_controller)operator(()ident(g)operator(,) ident(controller)operator(\)) - ident(expr) operator(=) stringoperator(\))operator(.)ident(collect) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(camelize)operator(})operator(.)ident(join)operator(()stringoperator(\))inline_delimiter(})>content(Controller)delimiter(")> - ident(g)operator(.)ident(result) symbol(:controller)operator(,) ident(expr)operator(,) pre_constant(true) - reserved(end) - - reserved(def) method(traverse_to_controller)operator(()ident(segments)operator(,) ident(start_at) operator(=) integer(0)operator(\)) - ident(mod) operator(=) operator(::)constant(Object) - ident(length) operator(=) ident(segments)operator(.)ident(length) - ident(index) operator(=) ident(start_at) - ident(mod_name) operator(=) ident(controller_name) operator(=) ident(segment) operator(=) pre_constant(nil) - reserved(while) ident(index) operator(<) ident(length) - reserved(return) pre_constant(nil) reserved(unless) regexp operator(=)operator(~) operator(()ident(segment) operator(=) ident(segments)operator([)ident(index)operator(])operator(\)) - ident(index) operator(+=) integer(1) - - ident(mod_name) operator(=) ident(segment)operator(.)ident(camelize) - ident(controller_name) operator(=) stringcontent(Controller)delimiter(")> - ident(path_suffix) operator(=) constant(File)operator(.)ident(join)operator(()ident(segments)operator([)ident(start_at)operator(..)operator(()ident(index) operator(-) integer(1)operator(\))operator(])operator(\)) - ident(next_mod) operator(=) pre_constant(nil) - - comment(# If the controller is already present, or if we load it, return it.) - reserved(if) ident(mod)operator(.)ident(const_defined?)operator(()ident(controller_name)operator(\)) operator(||) ident(attempt_load)operator(()ident(mod)operator(,) ident(controller_name)operator(,) ident(path_suffix) operator(+) stringoperator(\)) operator(==) symbol(:defined) - ident(controller) operator(=) ident(mod)operator(.)ident(const_get)operator(()ident(controller_name)operator(\)) - reserved(return) pre_constant(nil) reserved(unless) ident(controller)operator(.)ident(is_a?)operator(()constant(Class)operator(\)) operator(&&) ident(controller)operator(.)ident(ancestors)operator(.)ident(include?)operator(()constant(ActionController)operator(::)constant(Base)operator(\)) comment(# it's not really a controller?) - reserved(return) operator([)ident(controller)operator(,) operator(()ident(index) operator(-) ident(start_at)operator(\))operator(]) - reserved(end) - - comment(# No controller? Look for the module) - reserved(if) ident(mod)operator(.)ident(const_defined?) ident(mod_name) - ident(next_mod) operator(=) ident(mod)operator(.)ident(send)operator(()symbol(:const_get)operator(,) ident(mod_name)operator(\)) - ident(next_mod) operator(=) pre_constant(nil) reserved(unless) ident(next_mod)operator(.)ident(is_a?)operator(()constant(Module)operator(\)) - reserved(else) - comment(# Try to load a file that defines the module we want.) - reserved(case) ident(attempt_load)operator(()ident(mod)operator(,) ident(mod_name)operator(,) ident(path_suffix)operator(\)) - reserved(when) symbol(:defined) reserved(then) ident(next_mod) operator(=) ident(mod)operator(.)ident(const_get) ident(mod_name) - reserved(when) symbol(:dir) reserved(then) comment(# We didn't find a file, but there's a dir.) - ident(next_mod) operator(=) constant(Module)operator(.)ident(new) comment(# So create a module for the directory) - ident(mod)operator(.)ident(send) symbol(:const_set)operator(,) ident(mod_name)operator(,) ident(next_mod) - reserved(else) - reserved(return) pre_constant(nil) - reserved(end) - reserved(end) - ident(mod) operator(=) ident(next_mod) - - reserved(return) pre_constant(nil) reserved(unless) ident(mod) operator(&&) ident(mod)operator(.)ident(is_a?)operator(()constant(Module)operator(\)) - reserved(end) - pre_constant(nil) - reserved(end) - - ident(protected) - reserved(def) method(safe_load_paths) comment(#:nodoc:) - reserved(if) reserved(defined?)operator(()constant(RAILS_ROOT)operator(\)) - global_variable($LOAD_PATH)operator(.)ident(select) reserved(do) operator(|)ident(base)operator(|) - ident(base) operator(=) constant(File)operator(.)ident(expand_path)operator(()ident(base)operator(\)) - ident(extended_root) operator(=) constant(File)operator(.)ident(expand_path)operator(()constant(RAILS_ROOT)operator(\)) - comment(# Exclude all paths that are not nested within app, lib, or components.) - ident(base)operator(.)ident(match)operator(()regexpchar(\\/)content(*(app|lib|components\))char(\\/)content([a-z])delimiter(/)>operator(\)) operator(||) ident(base) operator(=)operator(~) regexp - reserved(end) - reserved(else) - global_variable($LOAD_PATH) - reserved(end) - reserved(end) - - reserved(def) method(attempt_load)operator(()ident(mod)operator(,) ident(const_name)operator(,) ident(path)operator(\)) - ident(has_dir) operator(=) pre_constant(false) - ident(safe_load_paths)operator(.)ident(each) reserved(do) operator(|)ident(load_path)operator(|) - ident(full_path) operator(=) constant(File)operator(.)ident(join)operator(()ident(load_path)operator(,) ident(path)operator(\)) - ident(file_path) operator(=) ident(full_path) operator(+) string - reserved(if) constant(File)operator(.)ident(file?)operator(()ident(file_path)operator(\)) comment(# Found a .rb file? Load it up) - ident(require_dependency)operator(()ident(file_path)operator(\)) - reserved(return) symbol(:defined) reserved(if) ident(mod)operator(.)ident(const_defined?) ident(const_name) - reserved(else) - ident(has_dir) operator(||=) constant(File)operator(.)ident(directory?)operator(()ident(full_path)operator(\)) - reserved(end) - reserved(end) - reserved(return) operator(()ident(has_dir) operator(?) symbol(:dir) operator(:) pre_constant(nil)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(PathComponent) operator(<) constant(DynamicComponent) comment(#:nodoc:) - reserved(def) method(optional?)operator(()operator(\)) pre_constant(true) reserved(end) - reserved(def) method(default)operator(()operator(\)) operator([)operator(]) reserved(end) - reserved(def) method(condition)operator(()operator(\)) pre_constant(nil) reserved(end) - - reserved(def) method(default=)operator(()ident(value)operator(\)) - ident(raise) constant(RoutingError)operator(,) string reserved(unless) ident(value) operator(==) operator([)operator(]) - reserved(end) - - reserved(def) method(write_generation)operator(()ident(g)operator(\)) - ident(raise) constant(RoutingError)operator(,) string reserved(unless) ident(g)operator(.)ident(after)operator(.)ident(empty?) - ident(g)operator(.)ident(if)operator(()stringcontent( && ! )inlinecontent(.empty?)delimiter(")>operator(\)) reserved(do) - ident(g) operator(<<) stringcontent( = )inlinecontent(.join('/'\) unless )inlinecontent(.is_a?(String\))delimiter(")> - ident(g)operator(.)ident(add_segment)operator(()stringcontent(\)})delimiter(")>operator(\)) operator({)operator(|)ident(gp)operator(|) ident(gp)operator(.)ident(finish) operator(}) - reserved(end) - ident(g)operator(.)ident(else) operator({) ident(g)operator(.)ident(finish) operator(}) - reserved(end) - - reserved(def) method(write_recognition)operator(()ident(g)operator(\)) - ident(raise) constant(RoutingError)operator(,) string reserved(unless) ident(g)operator(.)ident(after)operator(.)ident(empty?) - - ident(start) operator(=) ident(g)operator(.)ident(index_name) - ident(start) operator(=) stringcontent(\))delimiter(")> reserved(unless) regexp operator(=)operator(~) ident(start) - - ident(value_expr) operator(=) stringcontent([)inlinecontent(..-1] || [])delimiter(")> - ident(g)operator(.)ident(result) ident(key)operator(,) stringcontent(\))delimiter(")> - ident(g)operator(.)ident(finish)operator(()pre_constant(false)operator(\)) - reserved(end) - - reserved(class) class(Result) operator(<) operator(::)constant(Array) comment(#:nodoc:) - reserved(def) method(to_s)operator(()operator(\)) ident(join) string reserved(end) - reserved(def) pre_constant(self)operator(.)method(new_escaped)operator(()ident(strings)operator(\)) - ident(new) ident(strings)operator(.)ident(collect) operator({)operator(|)ident(str)operator(|) constant(CGI)operator(.)ident(unescape) ident(str)operator(}) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(Route) comment(#:nodoc:) - ident(attr_accessor) symbol(:components)operator(,) symbol(:known) - ident(attr_reader) symbol(:path)operator(,) symbol(:options)operator(,) symbol(:keys)operator(,) symbol(:defaults) - - reserved(def) method(initialize)operator(()ident(path)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - instance_variable(@path)operator(,) instance_variable(@options) operator(=) ident(path)operator(,) ident(options) - - ident(initialize_components) ident(path) - ident(defaults)operator(,) ident(conditions) operator(=) ident(initialize_hashes) ident(options)operator(.)ident(dup) - instance_variable(@defaults) operator(=) ident(defaults)operator(.)ident(dup) - ident(configure_components)operator(()ident(defaults)operator(,) ident(conditions)operator(\)) - ident(add_default_requirements) - ident(initialize_keys) - reserved(end) - - reserved(def) method(inspect) - stringcontent( )inlinecontent(, )inlinecontent(>)delimiter(")> - reserved(end) - - reserved(def) method(write_generation)operator(()ident(generator) operator(=) constant(CodeGeneration)operator(::)constant(GenerationGenerator)operator(.)ident(new)operator(\)) - ident(generator)operator(.)ident(before)operator(,) ident(generator)operator(.)ident(current)operator(,) ident(generator)operator(.)ident(after) operator(=) operator([)operator(])operator(,) ident(components)operator(.)ident(first)operator(,) operator(()ident(components)operator([)integer(1)operator(..)integer(-1)operator(]) operator(||) operator([)operator(])operator(\)) - - reserved(if) ident(known)operator(.)ident(empty?) reserved(then) ident(generator)operator(.)ident(go) - reserved(else) - comment(# Alter the conditions to allow :action => 'index' to also catch :action => nil) - ident(altered_known) operator(=) ident(known)operator(.)ident(collect) reserved(do) operator(|)ident(k)operator(,) ident(v)operator(|) - reserved(if) ident(k) operator(==) symbol(:action) operator(&&) ident(v)operator(==) string reserved(then) operator([)ident(k)operator(,) operator([)pre_constant(nil)operator(,) stringoperator(])operator(]) - reserved(else) operator([)ident(k)operator(,) ident(v)operator(]) - reserved(end) - reserved(end) - ident(generator)operator(.)ident(if)operator(()ident(generator)operator(.)ident(check_conditions)operator(()ident(altered_known)operator(\))operator(\)) operator({)operator(|)ident(gp)operator(|) ident(gp)operator(.)ident(go) operator(}) - reserved(end) - - ident(generator) - reserved(end) - - reserved(def) method(write_recognition)operator(()ident(generator) operator(=) constant(CodeGeneration)operator(::)constant(RecognitionGenerator)operator(.)ident(new)operator(\)) - ident(g) operator(=) ident(generator)operator(.)ident(dup) - ident(g)operator(.)ident(share_locals_with) ident(generator) - ident(g)operator(.)ident(before)operator(,) ident(g)operator(.)ident(current)operator(,) ident(g)operator(.)ident(after) operator(=) operator([)operator(])operator(,) ident(components)operator(.)ident(first)operator(,) operator(()ident(components)operator([)integer(1)operator(..)integer(-1)operator(]) operator(||) operator([)operator(])operator(\)) - - ident(known)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(if) ident(key) operator(==) symbol(:controller) reserved(then) constant(ControllerComponent)operator(.)ident(assign_controller)operator(()ident(g)operator(,) ident(value)operator(\)) - reserved(else) ident(g)operator(.)ident(constant_result)operator(()ident(key)operator(,) ident(value)operator(\)) - reserved(end) - reserved(end) - - ident(g)operator(.)ident(go) - - ident(generator) - reserved(end) - - reserved(def) method(initialize_keys) - instance_variable(@keys) operator(=) operator(()ident(components)operator(.)ident(collect) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(key)operator(}) operator(+) ident(known)operator(.)ident(keys)operator(\))operator(.)ident(compact) - instance_variable(@keys)operator(.)ident(freeze) - reserved(end) - - reserved(def) method(extra_keys)operator(()ident(options)operator(\)) - ident(options)operator(.)ident(keys) operator(-) instance_variable(@keys) - reserved(end) - - reserved(def) method(matches_controller?)operator(()ident(controller)operator(\)) - reserved(if) ident(known)operator([)symbol(:controller)operator(]) reserved(then) ident(known)operator([)symbol(:controller)operator(]) operator(==) ident(controller) - reserved(else) - ident(c) operator(=) ident(components)operator(.)ident(find) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(key) operator(==) symbol(:controller)operator(}) - reserved(return) pre_constant(false) reserved(unless) ident(c) - reserved(return) ident(c)operator(.)ident(condition)operator(.)ident(nil?) operator(||) ident(eval)operator(()constant(Routing)operator(.)ident(test_condition)operator(()stringoperator(,) ident(c)operator(.)ident(condition)operator(\))operator(\)) - reserved(end) - reserved(end) - - ident(protected) - reserved(def) method(initialize_components)operator(()ident(path)operator(\)) - ident(path) operator(=) ident(path)operator(.)ident(split)operator(()stringoperator(\)) reserved(if) ident(path)operator(.)ident(is_a?) constant(String) - ident(path)operator(.)ident(shift) reserved(if) ident(path)operator(.)ident(first)operator(.)ident(blank?) - pre_constant(self)operator(.)ident(components) operator(=) ident(path)operator(.)ident(collect) operator({)operator(|)ident(str)operator(|) constant(Component)operator(.)ident(new) ident(str)operator(}) - reserved(end) - - reserved(def) method(initialize_hashes)operator(()ident(options)operator(\)) - ident(path_keys) operator(=) ident(components)operator(.)ident(collect) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(key) operator(})operator(.)ident(compact) - pre_constant(self)operator(.)ident(known) operator(=) operator({)operator(}) - ident(defaults) operator(=) ident(options)operator(.)ident(delete)operator(()symbol(:defaults)operator(\)) operator(||) operator({)operator(}) - ident(conditions) operator(=) ident(options)operator(.)ident(delete)operator(()symbol(:require)operator(\)) operator(||) operator({)operator(}) - ident(conditions)operator(.)ident(update)operator(()ident(options)operator(.)ident(delete)operator(()symbol(:requirements)operator(\)) operator(||) operator({)operator(})operator(\)) - - ident(options)operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,) ident(v)operator(|) - reserved(if) ident(path_keys)operator(.)ident(include?)operator(()ident(k)operator(\)) reserved(then) operator(()ident(v)operator(.)ident(is_a?)operator(()constant(Regexp)operator(\)) operator(?) ident(conditions) operator(:) ident(defaults)operator(\))operator([)ident(k)operator(]) operator(=) ident(v) - reserved(else) ident(known)operator([)ident(k)operator(]) operator(=) ident(v) - reserved(end) - reserved(end) - operator([)ident(defaults)operator(,) ident(conditions)operator(]) - reserved(end) - - reserved(def) method(configure_components)operator(()ident(defaults)operator(,) ident(conditions)operator(\)) - ident(components)operator(.)ident(each) reserved(do) operator(|)ident(component)operator(|) - reserved(if) ident(defaults)operator(.)ident(key?)operator(()ident(component)operator(.)ident(key)operator(\)) reserved(then) ident(component)operator(.)ident(default) operator(=) ident(defaults)operator([)ident(component)operator(.)ident(key)operator(]) - reserved(elsif) ident(component)operator(.)ident(key) operator(==) symbol(:action) reserved(then) ident(component)operator(.)ident(default) operator(=) string - reserved(elsif) ident(component)operator(.)ident(key) operator(==) symbol(:id) reserved(then) ident(component)operator(.)ident(default) operator(=) pre_constant(nil) - reserved(end) - - ident(component)operator(.)ident(condition) operator(=) ident(conditions)operator([)ident(component)operator(.)ident(key)operator(]) reserved(if) ident(conditions)operator(.)ident(key?)operator(()ident(component)operator(.)ident(key)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(add_default_requirements) - ident(component_keys) operator(=) ident(components)operator(.)ident(collect) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(key)operator(}) - ident(known)operator([)symbol(:action)operator(]) operator(||=) string reserved(unless) ident(component_keys)operator(.)ident(include?) symbol(:action) - reserved(end) - reserved(end) - - reserved(class) class(RouteSet) comment(#:nodoc:) - ident(attr_reader) symbol(:routes)operator(,) symbol(:categories)operator(,) symbol(:controller_to_selector) - reserved(def) method(initialize) - instance_variable(@routes) operator(=) operator([)operator(]) - instance_variable(@generation_methods) operator(=) constant(Hash)operator(.)ident(new)operator(()symbol(:generate_default_path)operator(\)) - reserved(end) - - reserved(def) method(generate)operator(()ident(options)operator(,) ident(request_or_recall_hash) operator(=) operator({)operator(})operator(\)) - ident(recall) operator(=) ident(request_or_recall_hash)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(request_or_recall_hash) operator(:) ident(request_or_recall_hash)operator(.)ident(symbolized_path_parameters) - ident(use_recall) operator(=) pre_constant(true) - - ident(controller) operator(=) ident(options)operator([)symbol(:controller)operator(]) - ident(options)operator([)symbol(:action)operator(]) operator(||=) string reserved(if) ident(controller) - ident(recall_controller) operator(=) ident(recall)operator([)symbol(:controller)operator(]) - reserved(if) operator(()ident(recall_controller) operator(&&) ident(recall_controller)operator(.)ident(include?)operator(()integer(?/)operator(\))operator(\)) operator(||) operator(()ident(controller) operator(&&) ident(controller)operator(.)ident(include?)operator(()integer(?/)operator(\))operator(\)) - ident(recall) operator(=) operator({)operator(}) reserved(if) ident(controller) operator(&&) ident(controller)operator([)integer(0)operator(]) operator(==) integer(?/) - ident(options)operator([)symbol(:controller)operator(]) operator(=) constant(Routing)operator(.)ident(controller_relative_to)operator(()ident(controller)operator(,) ident(recall_controller)operator(\)) - reserved(end) - ident(options) operator(=) ident(recall)operator(.)ident(dup) reserved(if) ident(options)operator(.)ident(empty?) comment(# XXX move to url_rewriter?) - - ident(keys_to_delete) operator(=) operator([)operator(]) - constant(Routing)operator(.)ident(treat_hash)operator(()ident(options)operator(,) ident(keys_to_delete)operator(\)) - - ident(merged) operator(=) ident(recall)operator(.)ident(merge)operator(()ident(options)operator(\)) - ident(keys_to_delete)operator(.)ident(each) operator({)operator(|)ident(key)operator(|) ident(merged)operator(.)ident(delete) ident(key)operator(}) - ident(expire_on) operator(=) constant(Routing)operator(.)ident(expiry_hash)operator(()ident(options)operator(,) ident(recall)operator(\)) - - ident(generate_path)operator(()ident(merged)operator(,) ident(options)operator(,) ident(expire_on)operator(\)) - reserved(end) - - reserved(def) method(generate_path)operator(()ident(merged)operator(,) ident(options)operator(,) ident(expire_on)operator(\)) - ident(send) instance_variable(@generation_methods)operator([)ident(merged)operator([)symbol(:controller)operator(])operator(])operator(,) ident(merged)operator(,) ident(options)operator(,) ident(expire_on) - reserved(end) - reserved(def) method(generate_default_path)operator(()operator(*)ident(args)operator(\)) - ident(write_generation) - ident(generate_default_path)operator(()operator(*)ident(args)operator(\)) - reserved(end) - - reserved(def) method(write_generation) - ident(method_sources) operator(=) operator([)operator(]) - instance_variable(@generation_methods) operator(=) constant(Hash)operator(.)ident(new)operator(()symbol(:generate_default_path)operator(\)) - ident(categorize_routes)operator(.)ident(each) reserved(do) operator(|)ident(controller)operator(,) ident(routes)operator(|) - reserved(next) reserved(unless) ident(routes)operator(.)ident(length) operator(<) instance_variable(@routes)operator(.)ident(length) - - ident(ivar) operator(=) ident(controller)operator(.)ident(gsub)operator(()stringoperator(,) stringoperator(\)) - ident(method_name) operator(=) stringdelimiter(")>operator(.)ident(to_sym) - ident(instance_variable_set) stringdelimiter(")>operator(,) ident(routes) - ident(code) operator(=) ident(generation_code_for)operator(()ident(ivar)operator(,) ident(method_name)operator(\))operator(.)ident(to_s) - ident(method_sources) operator(<<) ident(code) - - ident(filename) operator(=) stringcontent(.rb)delimiter(")> - ident(eval)operator(()ident(code)operator(,) pre_constant(nil)operator(,) ident(filename)operator(\)) - - instance_variable(@generation_methods)operator([)ident(controller)operator(.)ident(to_s)operator(]) operator(=) ident(method_name) - instance_variable(@generation_methods)operator([)ident(controller)operator(.)ident(to_sym)operator(]) operator(=) ident(method_name) - reserved(end) - - ident(code) operator(=) ident(generation_code_for)operator(()stringoperator(,) stringoperator(\))operator(.)ident(to_s) - ident(eval)operator(()ident(code)operator(,) pre_constant(nil)operator(,) stringoperator(\)) - - reserved(return) operator(()ident(method_sources) operator(<<) ident(code)operator(\)) - reserved(end) - - reserved(def) method(recognize)operator(()ident(request)operator(\)) - ident(string_path) operator(=) ident(request)operator(.)ident(path) - ident(string_path)operator(.)ident(chomp!) reserved(if) ident(string_path)operator([)integer(0)operator(]) operator(==) integer(?/) - ident(path) operator(=) ident(string_path)operator(.)ident(split) string - ident(path)operator(.)ident(shift) - - ident(hash) operator(=) ident(recognize_path)operator(()ident(path)operator(\)) - reserved(return) ident(recognition_failed)operator(()ident(request)operator(\)) reserved(unless) ident(hash) operator(&&) ident(hash)operator([)stringoperator(]) - - ident(controller) operator(=) ident(hash)operator([)stringoperator(]) - ident(hash)operator([)stringoperator(]) operator(=) ident(controller)operator(.)ident(controller_path) - ident(request)operator(.)ident(path_parameters) operator(=) ident(hash) - ident(controller)operator(.)ident(new) - reserved(end) - reserved(alias) symbol(:recognize!) symbol(:recognize) - - reserved(def) method(recognition_failed)operator(()ident(request)operator(\)) - ident(raise) constant(ActionController)operator(::)constant(RoutingError)operator(,) stringdelimiter(")> - reserved(end) - - reserved(def) method(write_recognition) - ident(g) operator(=) ident(generator) operator(=) constant(CodeGeneration)operator(::)constant(RecognitionGenerator)operator(.)ident(new) - ident(g)operator(.)ident(finish_statement) operator(=) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(hash_expr)operator(|) stringdelimiter(")>operator(}) - - ident(g)operator(.)ident(def) string reserved(do) - ident(each) reserved(do) operator(|)ident(route)operator(|) - ident(g) operator(<<) string - ident(route)operator(.)ident(write_recognition)operator(()ident(g)operator(\)) - reserved(end) - reserved(end) - - ident(eval) ident(g)operator(.)ident(to_s)operator(,) pre_constant(nil)operator(,) string - reserved(return) ident(g)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(generation_code_for)operator(()ident(ivar) operator(=) stringoperator(,) ident(method_name) operator(=) pre_constant(nil)operator(\)) - ident(routes) operator(=) ident(instance_variable_get)operator(()string operator(+) ident(ivar)operator(\)) - ident(key_ivar) operator(=) stringdelimiter(")> - ident(instance_variable_set)operator(()ident(key_ivar)operator(,) ident(routes)operator(.)ident(collect) operator({)operator(|)ident(route)operator(|) ident(route)operator(.)ident(keys)operator(})operator(\)) - - ident(g) operator(=) ident(generator) operator(=) constant(CodeGeneration)operator(::)constant(GenerationGenerator)operator(.)ident(new) - ident(g)operator(.)ident(def) stringcontent((merged, options, expire_on\))delimiter(")> reserved(do) - ident(g) operator(<<) string - ident(g) operator(<<) string - ident(g) operator(<<) string - - ident(routes)operator(.)ident(each_with_index) reserved(do) operator(|)ident(route)operator(,) ident(index)operator(|) - ident(g) operator(<<) stringcontent([)inlinecontent(])delimiter(")> - ident(g) operator(<<) string - ident(g)operator(.)ident(source)operator(.)ident(indent) reserved(do) - reserved(if) ident(index)operator(.)ident(zero?) - ident(g) operator(<<) string - ident(g) operator(<<) string - ident(route)operator(.)ident(write_generation)operator(()ident(g)operator(.)ident(dup)operator(\)) - reserved(else) - ident(g)operator(.)ident(if) string reserved(do) operator(|)ident(gp)operator(|) - ident(gp) operator(<<) string - ident(route)operator(.)ident(write_generation)operator(()ident(gp)operator(\)) - reserved(end) - reserved(end) - reserved(end) - ident(g)operator(.)ident(source)operator(.)ident(lines)operator(.)ident(last) operator(<<) string comment(# Add the closing brace to the end line) - ident(g)operator(.)ident(if) string reserved(do) - ident(g) operator(<<) string - ident(g) operator(<<) string - reserved(end) - reserved(end) - - ident(g) operator(<<) string - ident(g) operator(<<) string - reserved(end) - - reserved(return) ident(g) - reserved(end) - - reserved(def) method(categorize_routes) - instance_variable(@categorized_routes) operator(=) ident(by_controller) operator(=) constant(Hash)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - - ident(known_controllers)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - ident(set) operator(=) ident(by_controller)operator([)ident(name)operator(]) operator(=) operator([)operator(]) - ident(each) reserved(do) operator(|)ident(route)operator(|) - ident(set) operator(<<) ident(route) reserved(if) ident(route)operator(.)ident(matches_controller?) ident(name) - reserved(end) - reserved(end) - - instance_variable(@categorized_routes) - reserved(end) - - reserved(def) method(known_controllers) - instance_variable(@routes)operator(.)ident(inject)operator(()operator([)operator(])operator(\)) reserved(do) operator(|)ident(known)operator(,) ident(route)operator(|) - reserved(if) operator(()ident(controller) operator(=) ident(route)operator(.)ident(known)operator([)symbol(:controller)operator(])operator(\)) - reserved(if) ident(controller)operator(.)ident(is_a?)operator(()constant(Regexp)operator(\)) - ident(known) operator(<<) ident(controller)operator(.)ident(source)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(select) operator({)operator(|)ident(word)operator(|) ident(controller) operator(=)operator(~) ident(word)operator(}) - reserved(else) ident(known) operator(<<) ident(controller) - reserved(end) - reserved(end) - ident(known) - reserved(end)operator(.)ident(uniq) - reserved(end) - - reserved(def) method(reload) - constant(NamedRoutes)operator(.)ident(clear) - - reserved(if) reserved(defined?)operator(()constant(RAILS_ROOT)operator(\)) reserved(then) ident(load)operator(()constant(File)operator(.)ident(join)operator(()constant(RAILS_ROOT)operator(,) stringoperator(,) stringoperator(\))operator(\)) - reserved(else) ident(connect)operator(()stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) pre_constant(nil)operator(\)) - reserved(end) - - constant(NamedRoutes)operator(.)ident(install) - reserved(end) - - reserved(def) method(connect)operator(()operator(*)ident(args)operator(\)) - ident(new_route) operator(=) constant(Route)operator(.)ident(new)operator(()operator(*)ident(args)operator(\)) - instance_variable(@routes) operator(<<) ident(new_route) - reserved(return) ident(new_route) - reserved(end) - - reserved(def) method(draw) - ident(old_routes) operator(=) instance_variable(@routes) - instance_variable(@routes) operator(=) operator([)operator(]) - - reserved(begin) reserved(yield) pre_constant(self) - reserved(rescue) - instance_variable(@routes) operator(=) ident(old_routes) - ident(raise) - reserved(end) - ident(write_generation) - ident(write_recognition) - reserved(end) - - reserved(def) method(empty?)operator(()operator(\)) instance_variable(@routes)operator(.)ident(empty?) reserved(end) - - reserved(def) method(each)operator(()operator(&)ident(block)operator(\)) instance_variable(@routes)operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) reserved(end) - - comment(# Defines a new named route with the provided name and arguments.) - comment(# This method need only be used when you wish to use a name that a RouteSet instance) - comment(# method exists for, such as categories.) - comment(#) - comment(# For example, map.categories '/categories', :controller => 'categories' will not work) - comment(# due to RouteSet#categories.) - reserved(def) method(named_route)operator(()ident(name)operator(,) ident(path)operator(,) ident(hash) operator(=) operator({)operator(})operator(\)) - ident(route) operator(=) ident(connect)operator(()ident(path)operator(,) ident(hash)operator(\)) - constant(NamedRoutes)operator(.)ident(name_route)operator(()ident(route)operator(,) ident(name)operator(\)) - ident(route) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) - operator(()integer(1)operator(..)integer(2)operator(\))operator(.)ident(include?)operator(()ident(args)operator(.)ident(length)operator(\)) operator(?) ident(named_route)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) operator(:) reserved(super)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) - reserved(end) - - reserved(def) method(extra_keys)operator(()ident(options)operator(,) ident(recall) operator(=) operator({)operator(})operator(\)) - ident(generate)operator(()ident(options)operator(.)ident(dup)operator(,) ident(recall)operator(\))operator(.)ident(last) - reserved(end) - reserved(end) - - reserved(module) class(NamedRoutes) comment(#:nodoc:) - constant(Helpers) operator(=) operator([)operator(]) - reserved(class) operator(<<) class(self) - reserved(def) method(clear)operator(()operator(\)) constant(Helpers)operator(.)ident(clear) reserved(end) - - reserved(def) method(hash_access_name)operator(()ident(name)operator(\)) - stringcontent(_url)delimiter(")> - reserved(end) - - reserved(def) method(url_helper_name)operator(()ident(name)operator(\)) - stringcontent(_url)delimiter(")> - reserved(end) - - reserved(def) method(known_hash_for_route)operator(()ident(route)operator(\)) - ident(hash) operator(=) ident(route)operator(.)ident(known)operator(.)ident(symbolize_keys) - ident(route)operator(.)ident(defaults)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - ident(hash)operator([)ident(key)operator(.)ident(to_sym)operator(]) operator(||=) ident(value) reserved(if) ident(value) - reserved(end) - ident(hash)operator([)symbol(:controller)operator(]) operator(=) stringdelimiter(")> - - ident(hash) - reserved(end) - - reserved(def) method(define_hash_access_method)operator(()ident(route)operator(,) ident(name)operator(\)) - ident(hash) operator(=) ident(known_hash_for_route)operator(()ident(route)operator(\)) - ident(define_method)operator(()ident(hash_access_name)operator(()ident(name)operator(\))operator(\)) reserved(do) operator(|*)ident(args)operator(|) - ident(args)operator(.)ident(first) operator(?) ident(hash)operator(.)ident(merge)operator(()ident(args)operator(.)ident(first)operator(\)) operator(:) ident(hash) - reserved(end) - reserved(end) - - reserved(def) method(name_route)operator(()ident(route)operator(,) ident(name)operator(\)) - ident(define_hash_access_method)operator(()ident(route)operator(,) ident(name)operator(\)) - - ident(module_eval)operator(()stringcontent((options = )nesting_delimiter({)nesting_delimiter(})content(\) - url_for()inlinecontent(.merge(options\)\) - end)delimiter(})>operator(,) stringcontent(.rb)delimiter(")>operator(\)) - - ident(protected) ident(url_helper_name)operator(()ident(name)operator(\))operator(,) ident(hash_access_name)operator(()ident(name)operator(\)) - - constant(Helpers) operator(<<) ident(url_helper_name)operator(()ident(name)operator(\))operator(.)ident(to_sym) - constant(Helpers) operator(<<) ident(hash_access_name)operator(()ident(name)operator(\))operator(.)ident(to_sym) - constant(Helpers)operator(.)ident(uniq!) - reserved(end) - - reserved(def) method(install)operator(()ident(cls) operator(=) constant(ActionController)operator(::)constant(Base)operator(\)) - ident(cls)operator(.)ident(send) symbol(:include)operator(,) pre_constant(self) - reserved(if) ident(cls)operator(.)ident(respond_to?) symbol(:helper_method) - constant(Helpers)operator(.)ident(each) reserved(do) operator(|)ident(helper_name)operator(|) - ident(cls)operator(.)ident(send) symbol(:helper_method)operator(,) ident(helper_name) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - constant(Routes) operator(=) constant(RouteSet)operator(.)ident(new) - reserved(end) -reserved(end) -reserved(module) class(ActionController) - reserved(module) class(Scaffolding) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - comment(# Scaffolding is a way to quickly put an Active Record class online by providing a series of standardized actions) - comment(# for listing, showing, creating, updating, and destroying objects of the class. These standardized actions come) - comment(# with both controller logic and default templates that through introspection already know which fields to display) - comment(# and which input types to use. Example:) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# scaffold :entry) - comment(# end) - comment(#) - comment(# This tiny piece of code will add all of the following methods to the controller:) - comment(#) - comment(# class WeblogController < ActionController::Base) - comment(# verify :method => :post, :only => [ :destroy, :create, :update ],) - comment(# :redirect_to => { :action => :list }) - comment(#) - comment(# def index) - comment(# list) - comment(# end) - comment(#) - comment(# def list) - comment(# @entries = Entry.find_all) - comment(# render_scaffold "list") - comment(# end) - comment(# ) - comment(# def show) - comment(# @entry = Entry.find(params[:id]\)) - comment(# render_scaffold) - comment(# end) - comment(# ) - comment(# def destroy) - comment(# Entry.find(params[:id]\).destroy) - comment(# redirect_to :action => "list") - comment(# end) - comment(# ) - comment(# def new) - comment(# @entry = Entry.new) - comment(# render_scaffold) - comment(# end) - comment(# ) - comment(# def create) - comment(# @entry = Entry.new(params[:entry]\)) - comment(# if @entry.save) - comment(# flash[:notice] = "Entry was successfully created") - comment(# redirect_to :action => "list") - comment(# else) - comment(# render_scaffold('new'\)) - comment(# end) - comment(# end) - comment(# ) - comment(# def edit) - comment(# @entry = Entry.find(params[:id]\)) - comment(# render_scaffold) - comment(# end) - comment(# ) - comment(# def update) - comment(# @entry = Entry.find(params[:id]\)) - comment(# @entry.attributes = params[:entry]) - comment(# ) - comment(# if @entry.save) - comment(# flash[:notice] = "Entry was successfully updated") - comment(# redirect_to :action => "show", :id => @entry) - comment(# else) - comment(# render_scaffold('edit'\)) - comment(# end) - comment(# end) - comment(# end) - comment(#) - comment(# The render_scaffold method will first check to see if you've made your own template (like "weblog/show.rhtml" for ) - comment(# the show action\) and if not, then render the generic template for that action. This gives you the possibility of using the ) - comment(# scaffold while you're building your specific application. Start out with a totally generic setup, then replace one template ) - comment(# and one action at a time while relying on the rest of the scaffolded templates and actions.) - reserved(module) class(ClassMethods) - comment(# Adds a swath of generic CRUD actions to the controller. The +model_id+ is automatically converted into a class name unless) - comment(# one is specifically provide through options[:class_name]. So scaffold :post would use Post as the class) - comment(# and @post/@posts for the instance variables.) - comment(# ) - comment(# It's possible to use more than one scaffold in a single controller by specifying options[:suffix] = true. This will) - comment(# make scaffold :post, :suffix => true use method names like list_post, show_post, and create_post ) - comment(# instead of just list, show, and post. If suffix is used, then no index method is added.) - reserved(def) method(scaffold)operator(()ident(model_id)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options)operator(.)ident(assert_valid_keys)operator(()symbol(:class_name)operator(,) symbol(:suffix)operator(\)) - - ident(singular_name) operator(=) ident(model_id)operator(.)ident(to_s) - ident(class_name) operator(=) ident(options)operator([)symbol(:class_name)operator(]) operator(||) ident(singular_name)operator(.)ident(camelize) - ident(plural_name) operator(=) ident(singular_name)operator(.)ident(pluralize) - ident(suffix) operator(=) ident(options)operator([)symbol(:suffix)operator(]) operator(?) stringdelimiter(")> operator(:) string - - reserved(unless) ident(options)operator([)symbol(:suffix)operator(]) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)string - reserved(end) - - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)string :post, :only => [ :destroy)inlinecontent(, :create)inlinecontent(, :update)inlinecontent( ], - :redirect_to => { :action => :list)inlinecontent( } - - - def list)inlinecontent( - @)inlinecontent(_pages, @)inlinecontent( = paginate :)inlinecontent(, :per_page => 10 - render)inlinecontent(_scaffold "list)inlinecontent(" - end - - def show)inlinecontent( - @)inlinecontent( = )inlinecontent(.find(params[:id]\) - render)inlinecontent(_scaffold - end - - def destroy)inlinecontent( - )inlinecontent(.find(params[:id]\).destroy - redirect_to :action => "list)inlinecontent(" - end - - def new)inlinecontent( - @)inlinecontent( = )inlinecontent(.new - render)inlinecontent(_scaffold - end - - def create)inlinecontent( - @)inlinecontent( = )inlinecontent(.new(params[:)inlinecontent(]\) - if @)inlinecontent(.save - flash[:notice] = ")inlinecontent( was successfully created" - redirect_to :action => "list)inlinecontent(" - else - render)inlinecontent(_scaffold('new'\) - end - end - - def edit)inlinecontent( - @)inlinecontent( = )inlinecontent(.find(params[:id]\) - render)inlinecontent(_scaffold - end - - def update)inlinecontent( - @)inlinecontent( = )inlinecontent(.find(params[:id]\) - @)inlinecontent(.attributes = params[:)inlinecontent(] - - if @)inlinecontent(.save - flash[:notice] = ")inlinecontent( was successfully updated" - redirect_to :action => "show)inlinecontent(", :id => @)inlinecontent( - else - render)inlinecontent(_scaffold('edit'\) - end - end - - private - def render)inlinecontent(_scaffold(action=nil\) - action ||= caller_method_name(caller\) - # logger.info ("testing template:" + ")char(\\#)content({self.class.controller_path}/)char(\\#)content({action}"\) if logger - - if template_exists?(")char(\\#)content({self.class.controller_path}/)char(\\#)content({action}"\) - render_action(action\) - else - @scaffold_class = )inlinecontent( - @scaffold_singular_name, @scaffold_plural_name = ")inlinecontent(", ")inlinecontent(" - @scaffold_suffix = ")inlinecontent(" - add_instance_variables_to_assigns - - @template.instance_variable_set("@content_for_layout", @template.render_file(scaffold_path(action.sub(/)inlinecontent($/, ""\)\), false\)\) - - if !active_layout.nil? - render_file(active_layout, nil, true\) - else - render_file(scaffold_path("layout"\)\) - end - end - end - - def scaffold_path(template_name\) - File.dirname(__FILE__\) + "/templates/scaffolds/" + template_name + ".rhtml" - end - - def caller_method_name(caller\) - caller.first.scan(/`(.*\)'/\).first.first # ' ruby-mode - end)delimiter( - end_eval)> - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(CGI) - reserved(class) class(Session) - comment(# Return this session's underlying Session instance. Useful for the DB-backed session stores.) - reserved(def) method(model) - instance_variable(@dbman)operator(.)ident(model) reserved(if) instance_variable(@dbman) - reserved(end) - - - comment(# A session store backed by an Active Record class. A default class is) - comment(# provided, but any object duck-typing to an Active Record +Session+ class) - comment(# with text +session_id+ and +data+ attributes is sufficient.) - comment(#) - comment(# The default assumes a +sessions+ tables with columns:) - comment(# +id+ (numeric primary key\),) - comment(# +session_id+ (text, or longtext if your session data exceeds 65K\), and) - comment(# +data+ (text or longtext; careful if your session data exceeds 65KB\).) - comment(# The +session_id+ column should always be indexed for speedy lookups.) - comment(# Session data is marshaled to the +data+ column in Base64 format.) - comment(# If the data you write is larger than the column's size limit,) - comment(# ActionController::SessionOverflowError will be raised.) - comment(#) - comment(# You may configure the table name, primary key, and data column.) - comment(# For example, at the end of config/environment.rb:) - comment(# CGI::Session::ActiveRecordStore::Session.table_name = 'legacy_session_table') - comment(# CGI::Session::ActiveRecordStore::Session.primary_key = 'session_id') - comment(# CGI::Session::ActiveRecordStore::Session.data_column_name = 'legacy_session_data') - comment(# Note that setting the primary key to the session_id frees you from) - comment(# having a separate id column if you don't want it. However, you must) - comment(# set session.model.id = session.session_id by hand! A before_filter) - comment(# on ApplicationController is a good place.) - comment(#) - comment(# Since the default class is a simple Active Record, you get timestamps) - comment(# for free if you add +created_at+ and +updated_at+ datetime columns to) - comment(# the +sessions+ table, making periodic session expiration a snap.) - comment(#) - comment(# You may provide your own session class implementation, whether a) - comment(# feature-packed Active Record or a bare-metal high-performance SQL) - comment(# store, by setting) - comment(# +CGI::Session::ActiveRecordStore.session_class = MySessionClass+) - comment(# You must implement these methods:) - comment(# self.find_by_session_id(session_id\)) - comment(# initialize(hash_of_session_id_and_data\)) - comment(# attr_reader :session_id) - comment(# attr_accessor :data) - comment(# save) - comment(# destroy) - comment(#) - comment(# The example SqlBypass class is a generic SQL session store. You may) - comment(# use it as a basis for high-performance database-specific stores.) - reserved(class) class(ActiveRecordStore) - comment(# The default Active Record class.) - reserved(class) class(Session) operator(<) constant(ActiveRecord)operator(::)constant(Base) - comment(# Customizable data column name. Defaults to 'data'.) - ident(cattr_accessor) symbol(:data_column_name) - pre_constant(self)operator(.)ident(data_column_name) operator(=) string - - ident(before_save) symbol(:marshal_data!) - ident(before_save) symbol(:raise_on_session_data_overflow!) - - reserved(class) operator(<<) class(self) - comment(# Don't try to reload ARStore::Session in dev mode.) - reserved(def) method(reloadable?) comment(#:nodoc:) - pre_constant(false) - reserved(end) - - reserved(def) method(data_column_size_limit) - instance_variable(@data_column_size_limit) operator(||=) ident(columns_hash)operator([)class_variable(@@data_column_name)operator(])operator(.)ident(limit) - reserved(end) - - comment(# Hook to set up sessid compatibility.) - reserved(def) method(find_by_session_id)operator(()ident(session_id)operator(\)) - ident(setup_sessid_compatibility!) - ident(find_by_session_id)operator(()ident(session_id)operator(\)) - reserved(end) - - reserved(def) method(marshal)operator(()ident(data)operator(\)) constant(Base64)operator(.)ident(encode64)operator(()constant(Marshal)operator(.)ident(dump)operator(()ident(data)operator(\))operator(\)) reserved(if) ident(data) reserved(end) - reserved(def) method(unmarshal)operator(()ident(data)operator(\)) constant(Marshal)operator(.)ident(load)operator(()constant(Base64)operator(.)ident(decode64)operator(()ident(data)operator(\))operator(\)) reserved(if) ident(data) reserved(end) - - reserved(def) method(create_table!) - ident(connection)operator(.)ident(execute) stringstringcontent( ( - id INTEGER PRIMARY KEY, - )inlineoperator(\))inline_delimiter(})>content( TEXT UNIQUE, - )inlinecontent( TEXT(255\) - \))delimiter( - end_sql)> - reserved(end) - - reserved(def) method(drop_table!) - ident(connection)operator(.)ident(execute) stringdelimiter(")> - reserved(end) - - ident(private) - comment(# Compatibility with tables using sessid instead of session_id.) - reserved(def) method(setup_sessid_compatibility!) - comment(# Reset column info since it may be stale.) - ident(reset_column_information) - reserved(if) ident(columns_hash)operator([)stringoperator(]) - reserved(def) pre_constant(self)operator(.)method(find_by_session_id)operator(()operator(*)ident(args)operator(\)) - ident(find_by_sessid)operator(()operator(*)ident(args)operator(\)) - reserved(end) - - ident(define_method)operator(()symbol(:session_id)operator(\)) operator({) ident(sessid) operator(}) - ident(define_method)operator(()symbol(:session_id=)operator(\)) operator({) operator(|)ident(session_id)operator(|) pre_constant(self)operator(.)ident(sessid) operator(=) ident(session_id) operator(}) - reserved(else) - reserved(def) pre_constant(self)operator(.)method(find_by_session_id)operator(()ident(session_id)operator(\)) - ident(find) symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringdelimiter(")>operator(,) ident(session_id)operator(]) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# Lazy-unmarshal session state.) - reserved(def) method(data) - instance_variable(@data) operator(||=) pre_constant(self)operator(.)ident(class)operator(.)ident(unmarshal)operator(()ident(read_attribute)operator(()class_variable(@@data_column_name)operator(\))operator(\)) operator(||) operator({)operator(}) - reserved(end) - - comment(# Has the session been loaded yet?) - reserved(def) method(loaded?) - operator(!)operator(!) instance_variable(@data) - reserved(end) - - ident(private) - ident(attr_writer) symbol(:data) - - reserved(def) method(marshal_data!) - reserved(return) pre_constant(false) reserved(if) operator(!)ident(loaded?) - ident(write_attribute)operator(()class_variable(@@data_column_name)operator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(marshal)operator(()pre_constant(self)operator(.)ident(data)operator(\))operator(\)) - reserved(end) - - comment(# Ensures that the data about to be stored in the database is not) - comment(# larger than the data storage column. Raises) - comment(# ActionController::SessionOverflowError.) - reserved(def) method(raise_on_session_data_overflow!) - reserved(return) pre_constant(false) reserved(if) operator(!)ident(loaded?) - ident(limit) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(data_column_size_limit) - reserved(if) ident(loaded?) reserved(and) ident(limit) reserved(and) ident(read_attribute)operator(()class_variable(@@data_column_name)operator(\))operator(.)ident(size) operator(>) ident(limit) - ident(raise) constant(ActionController)operator(::)constant(SessionOverflowError) - reserved(end) - reserved(end) - reserved(end) - - comment(# A barebones session store which duck-types with the default session) - comment(# store but bypasses Active Record and issues SQL directly. This is) - comment(# an example session model class meant as a basis for your own classes.) - comment(#) - comment(# The database connection, table name, and session id and data columns) - comment(# are configurable class attributes. Marshaling and unmarshaling) - comment(# are implemented as class methods that you may override. By default,) - comment(# marshaling data is +Base64.encode64(Marshal.dump(data\)\)+ and) - comment(# unmarshaling data is +Marshal.load(Base64.decode64(data\)\)+.) - comment(#) - comment(# This marshaling behavior is intended to store the widest range of) - comment(# binary session data in a +text+ column. For higher performance,) - comment(# store in a +blob+ column instead and forgo the Base64 encoding.) - reserved(class) class(SqlBypass) - comment(# Use the ActiveRecord::Base.connection by default.) - ident(cattr_accessor) symbol(:connection) - - comment(# The table name defaults to 'sessions'.) - ident(cattr_accessor) symbol(:table_name) - class_variable(@@table_name) operator(=) string - - comment(# The session id field defaults to 'session_id'.) - ident(cattr_accessor) symbol(:session_id_column) - class_variable(@@session_id_column) operator(=) string - - comment(# The data field defaults to 'data'.) - ident(cattr_accessor) symbol(:data_column) - class_variable(@@data_column) operator(=) string - - reserved(class) operator(<<) class(self) - - reserved(def) method(connection) - class_variable(@@connection) operator(||=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection) - reserved(end) - - comment(# Look up a session by id and unmarshal its data if found.) - reserved(def) method(find_by_session_id)operator(()ident(session_id)operator(\)) - reserved(if) ident(record) operator(=) class_variable(@@connection)operator(.)ident(select_one)operator(()stringcontent( WHERE )inlinecontent(=)inlinedelimiter(")>operator(\)) - ident(new)operator(()symbol(:session_id) operator(=)operator(>) ident(session_id)operator(,) symbol(:marshaled_data) operator(=)operator(>) ident(record)operator([)stringoperator(])operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(marshal)operator(()ident(data)operator(\)) constant(Base64)operator(.)ident(encode64)operator(()constant(Marshal)operator(.)ident(dump)operator(()ident(data)operator(\))operator(\)) reserved(if) ident(data) reserved(end) - reserved(def) method(unmarshal)operator(()ident(data)operator(\)) constant(Marshal)operator(.)ident(load)operator(()constant(Base64)operator(.)ident(decode64)operator(()ident(data)operator(\))operator(\)) reserved(if) ident(data) reserved(end) - - reserved(def) method(create_table!) - class_variable(@@connection)operator(.)ident(execute) stringstringcontent( ( - id INTEGER PRIMARY KEY, - )inlinecontent( TEXT UNIQUE, - )inlinecontent( TEXT - \))delimiter( - end_sql)> - reserved(end) - - reserved(def) method(drop_table!) - class_variable(@@connection)operator(.)ident(execute) stringdelimiter(")> - reserved(end) - reserved(end) - - ident(attr_reader) symbol(:session_id) - ident(attr_writer) symbol(:data) - - comment(# Look for normal and marshaled data, self.find_by_session_id's way of) - comment(# telling us to postpone unmarshaling until the data is requested.) - comment(# We need to handle a normal data attribute in case of a new record.) - reserved(def) method(initialize)operator(()ident(attributes)operator(\)) - instance_variable(@session_id)operator(,) instance_variable(@data)operator(,) instance_variable(@marshaled_data) operator(=) ident(attributes)operator([)symbol(:session_id)operator(])operator(,) ident(attributes)operator([)symbol(:data)operator(])operator(,) ident(attributes)operator([)symbol(:marshaled_data)operator(]) - instance_variable(@new_record) operator(=) instance_variable(@marshaled_data)operator(.)ident(nil?) - reserved(end) - - reserved(def) method(new_record?) - instance_variable(@new_record) - reserved(end) - - comment(# Lazy-unmarshal session state.) - reserved(def) method(data) - reserved(unless) instance_variable(@data) - reserved(if) instance_variable(@marshaled_data) - instance_variable(@data)operator(,) instance_variable(@marshaled_data) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(unmarshal)operator(()instance_variable(@marshaled_data)operator(\)) operator(||) operator({)operator(})operator(,) pre_constant(nil) - reserved(else) - instance_variable(@data) operator(=) operator({)operator(}) - reserved(end) - reserved(end) - instance_variable(@data) - reserved(end) - - reserved(def) method(loaded?) - operator(!)operator(!) instance_variable(@data) - reserved(end) - - reserved(def) method(save) - reserved(return) pre_constant(false) reserved(if) operator(!)ident(loaded?) - ident(marshaled_data) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(marshal)operator(()ident(data)operator(\)) - - reserved(if) instance_variable(@new_record) - instance_variable(@new_record) operator(=) pre_constant(false) - class_variable(@@connection)operator(.)ident(update) stringoperator(,) stringstringcontent( ( - )inlinecontent(, - )inlinecontent( \) - VALUES ( - )inlinecontent(, - )inlinecontent( \))delimiter( - end_sql)> - reserved(else) - class_variable(@@connection)operator(.)ident(update) stringoperator(,) stringstringcontent( - SET )inlinecontent(=)inlinecontent( - WHERE )inlinecontent(=)inlinedelimiter( - end_sql)> - reserved(end) - reserved(end) - - reserved(def) method(destroy) - reserved(unless) instance_variable(@new_record) - class_variable(@@connection)operator(.)ident(delete) stringoperator(,) stringstringcontent( - WHERE )inlinecontent(=)inlinedelimiter( - end_sql)> - reserved(end) - reserved(end) - reserved(end) - - - comment(# The class used for session storage. Defaults to) - comment(# CGI::Session::ActiveRecordStore::Session.) - ident(cattr_accessor) symbol(:session_class) - pre_constant(self)operator(.)ident(session_class) operator(=) constant(Session) - - comment(# Find or instantiate a session given a CGI::Session.) - reserved(def) method(initialize)operator(()ident(session)operator(,) ident(option) operator(=) pre_constant(nil)operator(\)) - ident(session_id) operator(=) ident(session)operator(.)ident(session_id) - reserved(unless) instance_variable(@session) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(silence) operator({) class_variable(@@session_class)operator(.)ident(find_by_session_id)operator(()ident(session_id)operator(\)) operator(}) - reserved(unless) ident(session)operator(.)ident(new_session) - ident(raise) constant(CGI)operator(::)constant(Session)operator(::)constant(NoSession)operator(,) string - reserved(end) - instance_variable(@session) operator(=) class_variable(@@session_class)operator(.)ident(new)operator(()symbol(:session_id) operator(=)operator(>) ident(session_id)operator(,) symbol(:data) operator(=)operator(>) operator({)operator(})operator(\)) - comment(# session saving can be lazy again, because of improved component implementation) - comment(# therefore next line gets commented out:) - comment(# @session.save) - reserved(end) - reserved(end) - - comment(# Access the underlying session model.) - reserved(def) method(model) - instance_variable(@session) - reserved(end) - - comment(# Restore session state. The session model handles unmarshaling.) - reserved(def) method(restore) - reserved(if) instance_variable(@session) - instance_variable(@session)operator(.)ident(data) - reserved(end) - reserved(end) - - comment(# Save session store.) - reserved(def) method(update) - reserved(if) instance_variable(@session) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(silence) operator({) instance_variable(@session)operator(.)ident(save) operator(}) - reserved(end) - reserved(end) - - comment(# Save and close the session store.) - reserved(def) method(close) - reserved(if) instance_variable(@session) - ident(update) - instance_variable(@session) operator(=) pre_constant(nil) - reserved(end) - reserved(end) - - comment(# Delete and close the session store.) - reserved(def) method(delete) - reserved(if) instance_variable(@session) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(silence) operator({) instance_variable(@session)operator(.)ident(destroy) operator(}) - instance_variable(@session) operator(=) pre_constant(nil) - reserved(end) - reserved(end) - - ident(protected) - reserved(def) method(logger) - constant(ActionController)operator(::)constant(Base)operator(.)ident(logger) reserved(rescue) pre_constant(nil) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -doctype(#!/usr/local/bin/ruby -w) - -comment(# This is a really simple session storage daemon, basically just a hash, ) -comment(# which is enabled for DRb access.) - -ident(require) string - -ident(session_hash) operator(=) constant(Hash)operator(.)ident(new) -ident(session_hash)operator(.)ident(instance_eval) operator({) instance_variable(@mutex) operator(=) constant(Mutex)operator(.)ident(new) operator(}) - -reserved(class) operator(<<)class(session_hash) - reserved(def) method([]=)operator(()ident(key)operator(,) ident(value)operator(\)) - instance_variable(@mutex)operator(.)ident(synchronize) reserved(do) - reserved(super)operator(()ident(key)operator(,) ident(value)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method([])operator(()ident(key)operator(\)) - instance_variable(@mutex)operator(.)ident(synchronize) reserved(do) - reserved(super)operator(()ident(key)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(delete)operator(()ident(key)operator(\)) - instance_variable(@mutex)operator(.)ident(synchronize) reserved(do) - reserved(super)operator(()ident(key)operator(\)) - reserved(end) - reserved(end) -reserved(end) - -constant(DRb)operator(.)ident(start_service)operator(()stringoperator(,) ident(session_hash)operator(\)) -constant(DRb)operator(.)ident(thread)operator(.)ident(joinrequire) string -ident(require) string -ident(require) string - -reserved(class) class(CGI) comment(#:nodoc:all) - reserved(class) class(Session) - reserved(class) class(DRbStore) - class_variable(@@session_data) operator(=) constant(DRbObject)operator(.)ident(new)operator(()pre_constant(nil)operator(,) stringoperator(\)) - - reserved(def) method(initialize)operator(()ident(session)operator(,) ident(option)operator(=)pre_constant(nil)operator(\)) - instance_variable(@session_id) operator(=) ident(session)operator(.)ident(session_id) - reserved(end) - - reserved(def) method(restore) - instance_variable(@h) operator(=) class_variable(@@session_data)operator([)instance_variable(@session_id)operator(]) operator(||) operator({)operator(}) - reserved(end) - - reserved(def) method(update) - class_variable(@@session_data)operator([)instance_variable(@session_id)operator(]) operator(=) instance_variable(@h) - reserved(end) - - reserved(def) method(close) - ident(update) - reserved(end) - - reserved(def) method(delete) - class_variable(@@session_data)operator(.)ident(delete)operator(()instance_variable(@session_id)operator(\)) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -comment(# cgi/session/memcached.rb - persistent storage of marshalled session data) -comment(#) -comment(# == Overview) -comment(#) -comment(# This file provides the CGI::Session::MemCache class, which builds) -comment(# persistence of storage data on top of the MemCache library. See) -comment(# cgi/session.rb for more details on session storage managers.) -comment(#) - -reserved(begin) - ident(require) string - ident(require) string - - reserved(class) class(CGI) - reserved(class) class(Session) - comment(# MemCache-based session storage class.) - comment(#) - comment(# This builds upon the top-level MemCache class provided by the) - comment(# library file memcache.rb. Session data is marshalled and stored) - comment(# in a memcached cache.) - reserved(class) class(MemCacheStore) - reserved(def) method(check_id)operator(()ident(id)operator(\)) comment(#:nodoc:#) - regexp operator(=)operator(~) ident(id)operator(.)ident(to_s) operator(?) pre_constant(false) operator(:) pre_constant(true) - reserved(end) - - comment(# Create a new CGI::Session::MemCache instance) - comment(#) - comment(# This constructor is used internally by CGI::Session. The) - comment(# user does not generally need to call it directly.) - comment(#) - comment(# +session+ is the session for which this instance is being) - comment(# created. The session id must only contain alphanumeric) - comment(# characters; automatically generated session ids observe) - comment(# this requirement.) - comment(#) - comment(# +options+ is a hash of options for the initializer. The) - comment(# following options are recognized:) - comment(#) - comment(# cache:: an instance of a MemCache client to use as the) - comment(# session cache.) - comment(#) - comment(# expires:: an expiry time value to use for session entries in) - comment(# the session cache. +expires+ is interpreted in seconds) - comment(# relative to the current time if it’s less than 60*60*24*30) - comment(# (30 days\), or as an absolute Unix time (e.g., Time#to_i\) if) - comment(# greater. If +expires+ is +0+, or not passed on +options+,) - comment(# the entry will never expire.) - comment(#) - comment(# This session's memcache entry will be created if it does) - comment(# not exist, or retrieved if it does.) - reserved(def) method(initialize)operator(()ident(session)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(id) operator(=) ident(session)operator(.)ident(session_id) - reserved(unless) ident(check_id)operator(()ident(id)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string operator(%) ident(id) - reserved(end) - instance_variable(@cache) operator(=) ident(options)operator([)stringoperator(]) operator(||) constant(MemCache)operator(.)ident(new)operator(()stringoperator(\)) - instance_variable(@expires) operator(=) ident(options)operator([)stringoperator(]) operator(||) integer(0) - instance_variable(@session_key) operator(=) stringdelimiter(")> - instance_variable(@session_data) operator(=) operator({)operator(}) - reserved(end) - - comment(# Restore session state from the session's memcache entry.) - comment(#) - comment(# Returns the session state as a hash.) - reserved(def) method(restore) - reserved(begin) - instance_variable(@session_data) operator(=) instance_variable(@cache)operator([)instance_variable(@session_key)operator(]) operator(||) operator({)operator(}) - reserved(rescue) - instance_variable(@session_data) operator(=) operator({)operator(}) - reserved(end) - reserved(end) - - comment(# Save session state to the session's memcache entry.) - reserved(def) method(update) - reserved(begin) - instance_variable(@cache)operator(.)ident(set)operator(()instance_variable(@session_key)operator(,) instance_variable(@session_data)operator(,) instance_variable(@expires)operator(\)) - reserved(rescue) - comment(# Ignore session update failures.) - reserved(end) - reserved(end) - - comment(# Update and close the session's memcache entry.) - reserved(def) method(close) - ident(update) - reserved(end) - - comment(# Delete the session's memcache entry.) - reserved(def) method(delete) - reserved(begin) - instance_variable(@cache)operator(.)ident(delete)operator(()instance_variable(@session_key)operator(\)) - reserved(rescue) - comment(# Ignore session delete failures.) - reserved(end) - instance_variable(@session_data) operator(=) operator({)operator(}) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(rescue) constant(LoadError) - comment(# MemCache wasn't available so neither can the store be) -reserved(end) -ident(require) string -ident(require) string -reserved(if) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:ActiveRecord)operator(\)) - ident(require) string -reserved(end) - -reserved(module) class(ActionController) comment(#:nodoc:) - reserved(module) class(SessionManagement) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - - ident(base)operator(.)ident(send) symbol(:alias_method)operator(,) symbol(:process_without_session_management_support)operator(,) symbol(:process) - ident(base)operator(.)ident(send) symbol(:alias_method)operator(,) symbol(:process)operator(,) symbol(:process_with_session_management_support) - - ident(base)operator(.)ident(send) symbol(:alias_method)operator(,) symbol(:process_cleanup_without_session_management_support)operator(,) symbol(:process_cleanup) - ident(base)operator(.)ident(send) symbol(:alias_method)operator(,) symbol(:process_cleanup)operator(,) symbol(:process_cleanup_with_session_management_support) - reserved(end) - - reserved(module) class(ClassMethods) - comment(# Set the session store to be used for keeping the session data between requests. The default is using the) - comment(# file system, but you can also specify one of the other included stores (:active_record_store, :drb_store, ) - comment(# :mem_cache_store, or :memory_store\) or use your own class.) - reserved(def) method(session_store=)operator(()ident(store)operator(\)) - constant(ActionController)operator(::)constant(CgiRequest)operator(::)constant(DEFAULT_SESSION_OPTIONS)operator([)symbol(:database_manager)operator(]) operator(=) - ident(store)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) operator(?) constant(CGI)operator(::)constant(Session)operator(.)ident(const_get)operator(()ident(store) operator(==) symbol(:drb_store) operator(?) string operator(:) ident(store)operator(.)ident(to_s)operator(.)ident(camelize)operator(\)) operator(:) ident(store) - reserved(end) - - comment(# Returns the session store class currently used.) - reserved(def) method(session_store) - constant(ActionController)operator(::)constant(CgiRequest)operator(::)constant(DEFAULT_SESSION_OPTIONS)operator([)symbol(:database_manager)operator(]) - reserved(end) - - comment(# Returns the hash used to configure the session. Example use:) - comment(#) - comment(# ActionController::Base.session_options[:session_secure] = true # session only available over HTTPS) - reserved(def) method(session_options) - constant(ActionController)operator(::)constant(CgiRequest)operator(::)constant(DEFAULT_SESSION_OPTIONS) - reserved(end) - - comment(# Specify how sessions ought to be managed for a subset of the actions on) - comment(# the controller. Like filters, you can specify :only and) - comment(# :except clauses to restrict the subset, otherwise options) - comment(# apply to all actions on this controller.) - comment(#) - comment(# The session options are inheritable, as well, so if you specify them in) - comment(# a parent controller, they apply to controllers that extend the parent.) - comment(#) - comment(# Usage:) - comment(#) - comment(# # turn off session management for all actions.) - comment(# session :off) - comment(#) - comment(# # turn off session management for all actions _except_ foo and bar.) - comment(# session :off, :except => %w(foo bar\)) - comment(#) - comment(# # turn off session management for only the foo and bar actions.) - comment(# session :off, :only => %w(foo bar\)) - comment(#) - comment(# # the session will only work over HTTPS, but only for the foo action) - comment(# session :only => :foo, :session_secure => true) - comment(#) - comment(# # the session will only be disabled for 'foo', and only if it is) - comment(# # requested as a web service) - comment(# session :off, :only => :foo,) - comment(# :if => Proc.new { |req| req.parameters[:ws] }) - comment(#) - comment(# All session options described for ActionController::Base.process_cgi) - comment(# are valid arguments.) - reserved(def) method(session)operator(()operator(*)ident(args)operator(\)) - ident(options) operator(=) constant(Hash) operator(===) ident(args)operator(.)ident(last) operator(?) ident(args)operator(.)ident(pop) operator(:) operator({)operator(}) - - ident(options)operator([)symbol(:disabled)operator(]) operator(=) pre_constant(true) reserved(if) operator(!)ident(args)operator(.)ident(empty?) - ident(options)operator([)symbol(:only)operator(]) operator(=) operator([)operator(*)ident(options)operator([)symbol(:only)operator(])operator(])operator(.)ident(map) operator({) operator(|)ident(o)operator(|) ident(o)operator(.)ident(to_s) operator(}) reserved(if) ident(options)operator([)symbol(:only)operator(]) - ident(options)operator([)symbol(:except)operator(]) operator(=) operator([)operator(*)ident(options)operator([)symbol(:except)operator(])operator(])operator(.)ident(map) operator({) operator(|)ident(o)operator(|) ident(o)operator(.)ident(to_s) operator(}) reserved(if) ident(options)operator([)symbol(:except)operator(]) - reserved(if) ident(options)operator([)symbol(:only)operator(]) operator(&&) ident(options)operator([)symbol(:except)operator(]) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - ident(write_inheritable_array)operator(()stringoperator(,) operator([)ident(options)operator(])operator(\)) - reserved(end) - - reserved(def) method(cached_session_options) comment(#:nodoc:) - instance_variable(@session_options) operator(||=) ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator([)operator(]) - reserved(end) - - reserved(def) method(session_options_for)operator(()ident(request)operator(,) ident(action)operator(\)) comment(#:nodoc:) - reserved(if) operator(()ident(session_options) operator(=) ident(cached_session_options)operator(\))operator(.)ident(empty?) - operator({)operator(}) - reserved(else) - ident(options) operator(=) operator({)operator(}) - - ident(action) operator(=) ident(action)operator(.)ident(to_s) - ident(session_options)operator(.)ident(each) reserved(do) operator(|)ident(opts)operator(|) - reserved(next) reserved(if) ident(opts)operator([)symbol(:if)operator(]) operator(&&) operator(!)ident(opts)operator([)symbol(:if)operator(])operator(.)ident(call)operator(()ident(request)operator(\)) - reserved(if) ident(opts)operator([)symbol(:only)operator(]) operator(&&) ident(opts)operator([)symbol(:only)operator(])operator(.)ident(include?)operator(()ident(action)operator(\)) - ident(options)operator(.)ident(merge!)operator(()ident(opts)operator(\)) - reserved(elsif) ident(opts)operator([)symbol(:except)operator(]) operator(&&) operator(!)ident(opts)operator([)symbol(:except)operator(])operator(.)ident(include?)operator(()ident(action)operator(\)) - ident(options)operator(.)ident(merge!)operator(()ident(opts)operator(\)) - reserved(elsif) operator(!)ident(opts)operator([)symbol(:only)operator(]) operator(&&) operator(!)ident(opts)operator([)symbol(:except)operator(]) - ident(options)operator(.)ident(merge!)operator(()ident(opts)operator(\)) - reserved(end) - reserved(end) - - reserved(if) ident(options)operator(.)ident(empty?) reserved(then) ident(options) - reserved(else) - ident(options)operator(.)ident(delete) symbol(:only) - ident(options)operator(.)ident(delete) symbol(:except) - ident(options)operator(.)ident(delete) symbol(:if) - ident(options)operator([)symbol(:disabled)operator(]) operator(?) pre_constant(false) operator(:) ident(options) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(process_with_session_management_support)operator(()ident(request)operator(,) ident(response)operator(,) ident(method) operator(=) symbol(:perform_action)operator(,) operator(*)ident(arguments)operator(\)) comment(#:nodoc:) - ident(set_session_options)operator(()ident(request)operator(\)) - ident(process_without_session_management_support)operator(()ident(request)operator(,) ident(response)operator(,) ident(method)operator(,) operator(*)ident(arguments)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(set_session_options)operator(()ident(request)operator(\)) - ident(request)operator(.)ident(session_options) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(session_options_for)operator(()ident(request)operator(,) ident(request)operator(.)ident(parameters)operator([)stringoperator(]) operator(||) stringoperator(\)) - reserved(end) - - reserved(def) method(process_cleanup_with_session_management_support) - ident(process_cleanup_without_session_management_support) - ident(clear_persistent_model_associations) - reserved(end) - - comment(# Clear cached associations in session data so they don't overflow) - comment(# the database field. Only applies to ActiveRecordStore since there) - comment(# is not a standard way to iterate over session data.) - reserved(def) method(clear_persistent_model_associations) comment(#:doc:) - reserved(if) reserved(defined?)operator(()instance_variable(@session)operator(\)) operator(&&) instance_variable(@session)operator(.)ident(instance_variables)operator(.)ident(include?)operator(()stringoperator(\)) - ident(session_data) operator(=) instance_variable(@session)operator(.)ident(instance_variable_get)operator(()stringoperator(\)) - - reserved(if) ident(session_data) operator(&&) ident(session_data)operator(.)ident(respond_to?)operator(()symbol(:each_value)operator(\)) - ident(session_data)operator(.)ident(each_value) reserved(do) operator(|)ident(obj)operator(|) - ident(obj)operator(.)ident(clear_association_cache) reserved(if) ident(obj)operator(.)ident(respond_to?)operator(()symbol(:clear_association_cache)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) comment(#:nodoc:) - comment(# Methods for sending files and streams to the browser instead of rendering.) - reserved(module) class(Streaming) - constant(DEFAULT_SEND_FILE_OPTIONS) operator(=) operator({) - symbol(:type) operator(=)operator(>) stringoperator(.)ident(freeze)operator(,) - symbol(:disposition) operator(=)operator(>) stringoperator(.)ident(freeze)operator(,) - symbol(:stream) operator(=)operator(>) pre_constant(true)operator(,) - symbol(:buffer_size) operator(=)operator(>) integer(4096) - operator(})operator(.)ident(freeze) - - ident(protected) - comment(# Sends the file by streaming it 4096 bytes at a time. This way the) - comment(# whole file doesn't need to be read into memory at once. This makes) - comment(# it feasible to send even large files.) - comment(#) - comment(# Be careful to sanitize the path parameter if it coming from a web) - comment(# page. send_file(params[:path]\) allows a malicious user to) - comment(# download any file on your server.) - comment(#) - comment(# Options:) - comment(# * :filename - suggests a filename for the browser to use.) - comment(# Defaults to File.basename(path\).) - comment(# * :type - specifies an HTTP content type.) - comment(# Defaults to 'application/octet-stream'.) - comment(# * :disposition - specifies whether the file will be shown inline or downloaded. ) - comment(# Valid values are 'inline' and 'attachment' (default\).) - comment(# * :stream - whether to send the file to the user agent as it is read (true\)) - comment(# or to read the entire file before sending (false\). Defaults to true.) - comment(# * :buffer_size - specifies size (in bytes\) of the buffer used to stream the file.) - comment(# Defaults to 4096.) - comment(# * :status - specifies the status code to send with the response. Defaults to '200 OK'.) - comment(#) - comment(# The default Content-Type and Content-Disposition headers are) - comment(# set to download arbitrary binary files in as many browsers as) - comment(# possible. IE versions 4, 5, 5.5, and 6 are all known to have) - comment(# a variety of quirks (especially when downloading over SSL\).) - comment(#) - comment(# Simple download:) - comment(# send_file '/path/to.zip') - comment(#) - comment(# Show a JPEG in the browser:) - comment(# send_file '/path/to.jpeg', :type => 'image/jpeg', :disposition => 'inline') - comment(#) - comment(# Show a 404 page in the browser:) - comment(# send_file '/path/to/404.html, :type => 'text/html; charset=utf-8', :status => 404) - comment(#) - comment(# Read about the other Content-* HTTP headers if you'd like to) - comment(# provide the user with more information (such as Content-Description\).) - comment(# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11) - comment(#) - comment(# Also be aware that the document may be cached by proxies and browsers.) - comment(# The Pragma and Cache-Control headers declare how the file may be cached) - comment(# by intermediaries. They default to require clients to validate with) - comment(# the server before releasing cached responses. See) - comment(# http://www.mnot.net/cache_docs/ for an overview of web caching and) - comment(# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) - comment(# for the Cache-Control header spec.) - reserved(def) method(send_file)operator(()ident(path)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:doc:) - ident(raise) constant(MissingFile)operator(,) stringdelimiter(")> reserved(unless) constant(File)operator(.)ident(file?)operator(()ident(path)operator(\)) reserved(and) constant(File)operator(.)ident(readable?)operator(()ident(path)operator(\)) - - ident(options)operator([)symbol(:length)operator(]) operator(||=) constant(File)operator(.)ident(size)operator(()ident(path)operator(\)) - ident(options)operator([)symbol(:filename)operator(]) operator(||=) constant(File)operator(.)ident(basename)operator(()ident(path)operator(\)) - ident(send_file_headers!) ident(options) - - instance_variable(@performed_render) operator(=) pre_constant(false) - - reserved(if) ident(options)operator([)symbol(:stream)operator(]) - ident(render) symbol(:status) operator(=)operator(>) ident(options)operator([)symbol(:status)operator(])operator(,) symbol(:text) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(response)operator(,) ident(output)operator(|) - ident(logger)operator(.)ident(info) stringdelimiter(")> reserved(unless) ident(logger)operator(.)ident(nil?) - ident(len) operator(=) ident(options)operator([)symbol(:buffer_size)operator(]) operator(||) integer(4096) - constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) reserved(do) operator(|)ident(file)operator(|) - reserved(if) ident(output)operator(.)ident(respond_to?)operator(()symbol(:syswrite)operator(\)) - reserved(begin) - reserved(while) pre_constant(true) - ident(output)operator(.)ident(syswrite)operator(()ident(file)operator(.)ident(sysread)operator(()ident(len)operator(\))operator(\)) - reserved(end) - reserved(rescue) constant(EOFError) - reserved(end) - reserved(else) - reserved(while) ident(buf) operator(=) ident(file)operator(.)ident(read)operator(()ident(len)operator(\)) - ident(output)operator(.)ident(write)operator(()ident(buf)operator(\)) - reserved(end) - reserved(end) - reserved(end) - operator(}) - reserved(else) - ident(logger)operator(.)ident(info) stringdelimiter(")> reserved(unless) ident(logger)operator(.)ident(nil?) - constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) operator({) operator(|)ident(file)operator(|) ident(render) symbol(:status) operator(=)operator(>) ident(options)operator([)symbol(:status)operator(])operator(,) symbol(:text) operator(=)operator(>) ident(file)operator(.)ident(read) operator(}) - reserved(end) - reserved(end) - - comment(# Send binary data to the user as a file download. May set content type, apparent file name,) - comment(# and specify whether to show data inline or download as an attachment.) - comment(#) - comment(# Options:) - comment(# * :filename - Suggests a filename for the browser to use.) - comment(# * :type - specifies an HTTP content type.) - comment(# Defaults to 'application/octet-stream'.) - comment(# * :disposition - specifies whether the file will be shown inline or downloaded. ) - comment(# * :status - specifies the status code to send with the response. Defaults to '200 OK'.) - comment(# Valid values are 'inline' and 'attachment' (default\).) - comment(#) - comment(# Generic data download:) - comment(# send_data buffer) - comment(#) - comment(# Download a dynamically-generated tarball:) - comment(# send_data generate_tgz('dir'\), :filename => 'dir.tgz') - comment(#) - comment(# Display an image Active Record in the browser:) - comment(# send_data image.data, :type => image.content_type, :disposition => 'inline') - comment(#) - comment(# See +send_file+ for more information on HTTP Content-* headers and caching.) - reserved(def) method(send_data)operator(()ident(data)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:doc:) - ident(logger)operator(.)ident(info) stringdelimiter(")> reserved(unless) ident(logger)operator(.)ident(nil?) - ident(send_file_headers!) ident(options)operator(.)ident(merge)operator(()symbol(:length) operator(=)operator(>) ident(data)operator(.)ident(size)operator(\)) - instance_variable(@performed_render) operator(=) pre_constant(false) - ident(render) symbol(:status) operator(=)operator(>) ident(options)operator([)symbol(:status)operator(])operator(,) symbol(:text) operator(=)operator(>) ident(data) - reserved(end) - - ident(private) - reserved(def) method(send_file_headers!)operator(()ident(options)operator(\)) - ident(options)operator(.)ident(update)operator(()constant(DEFAULT_SEND_FILE_OPTIONS)operator(.)ident(merge)operator(()ident(options)operator(\))operator(\)) - operator([)symbol(:length)operator(,) symbol(:type)operator(,) symbol(:disposition)operator(])operator(.)ident(each) reserved(do) operator(|)ident(arg)operator(|) - ident(raise) constant(ArgumentError)operator(,) stringcontent( option required)delimiter(")> reserved(if) ident(options)operator([)ident(arg)operator(])operator(.)ident(nil?) - reserved(end) - - ident(disposition) operator(=) ident(options)operator([)symbol(:disposition)operator(])operator(.)ident(dup) operator(||) string - - ident(disposition) operator(<<)operator(=) string reserved(if) ident(options)operator([)symbol(:filename)operator(]) - - instance_variable(@headers)operator(.)ident(update)operator(() - string operator(=)operator(>) ident(options)operator([)symbol(:length)operator(])operator(,) - string operator(=)operator(>) ident(options)operator([)symbol(:type)operator(])operator(.)ident(strip)operator(,) comment(# fixes a problem with extra '\\r' with some browsers) - string operator(=)operator(>) ident(disposition)operator(,) - string operator(=)operator(>) string - operator(\)) - - comment(# Fix a problem with IE 6.0 on opening downloaded files:) - comment(# If Cache-Control: no-cache is set (which Rails does by default\), ) - comment(# IE removes the file it just downloaded from its cache immediately ) - comment(# after it displays the "open/save" dialog, which means that if you ) - comment(# hit "open" the file isn't there anymore when the application that ) - comment(# is called for handling the download is run, so let's workaround that) - instance_variable(@headers)operator([)stringoperator(]) operator(=) string reserved(if) instance_variable(@headers)operator([)stringoperator(]) operator(==) string - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(ActionController) comment(#:nodoc:) - reserved(class) class(Base) - comment(# Process a test request called with a +TestRequest+ object.) - reserved(def) pre_constant(self)operator(.)method(process_test)operator(()ident(request)operator(\)) - ident(new)operator(.)ident(process_test)operator(()ident(request)operator(\)) - reserved(end) - - reserved(def) method(process_test)operator(()ident(request)operator(\)) comment(#:nodoc:) - ident(process)operator(()ident(request)operator(,) constant(TestResponse)operator(.)ident(new)operator(\)) - reserved(end) - - reserved(def) method(process_with_test)operator(()operator(*)ident(args)operator(\)) - ident(returning) ident(process_without_test)operator(()operator(*)ident(args)operator(\)) reserved(do) - ident(add_variables_to_assigns) - reserved(end) - reserved(end) - - ident(alias_method) symbol(:process_without_test)operator(,) symbol(:process) - ident(alias_method) symbol(:process)operator(,) symbol(:process_with_test) - reserved(end) - - reserved(class) class(TestRequest) operator(<) constant(AbstractRequest) comment(#:nodoc:) - ident(attr_accessor) symbol(:cookies)operator(,) symbol(:session_options) - ident(attr_accessor) symbol(:query_parameters)operator(,) symbol(:request_parameters)operator(,) symbol(:path)operator(,) symbol(:session)operator(,) symbol(:env) - ident(attr_accessor) symbol(:host) - - reserved(def) method(initialize)operator(()ident(query_parameters) operator(=) pre_constant(nil)operator(,) ident(request_parameters) operator(=) pre_constant(nil)operator(,) ident(session) operator(=) pre_constant(nil)operator(\)) - instance_variable(@query_parameters) operator(=) ident(query_parameters) operator(||) operator({)operator(}) - instance_variable(@request_parameters) operator(=) ident(request_parameters) operator(||) operator({)operator(}) - instance_variable(@session) operator(=) ident(session) operator(||) constant(TestSession)operator(.)ident(new) - - ident(initialize_containers) - ident(initialize_default_values) - - reserved(super)operator(()operator(\)) - reserved(end) - - reserved(def) method(reset_session) - instance_variable(@session) operator(=) operator({)operator(}) - reserved(end) - - reserved(def) method(raw_post) - reserved(if) ident(raw_post) operator(=) ident(env)operator([)stringoperator(]) - ident(raw_post) - reserved(else) - ident(params) operator(=) pre_constant(self)operator(.)ident(request_parameters)operator(.)ident(dup) - stringoperator(.)ident(each) reserved(do) operator(|)ident(k)operator(|) - ident(params)operator(.)ident(delete)operator(()ident(k)operator(\)) - ident(params)operator(.)ident(delete)operator(()ident(k)operator(.)ident(to_sym)operator(\)) - reserved(end) - - ident(params)operator(.)ident(map) operator({) operator(|)ident(k)operator(,)ident(v)operator(|) operator([) constant(CGI)operator(.)ident(escape)operator(()ident(k)operator(.)ident(to_s)operator(\))operator(,) constant(CGI)operator(.)ident(escape)operator(()ident(v)operator(.)ident(to_s)operator(\)) operator(])operator(.)ident(join)operator(()stringoperator(\)) operator(})operator(.)ident(sort)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(port=)operator(()ident(number)operator(\)) - instance_variable(@env)operator([)stringoperator(]) operator(=) ident(number)operator(.)ident(to_i) - instance_variable(@port_as_int) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(action=)operator(()ident(action_name)operator(\)) - instance_variable(@query_parameters)operator(.)ident(update)operator(()operator({) string operator(=)operator(>) ident(action_name) operator(})operator(\)) - instance_variable(@parameters) operator(=) pre_constant(nil) - reserved(end) - - comment(# Used to check AbstractRequest's request_uri functionality.) - comment(# Disables the use of @path and @request_uri so superclass can handle those.) - reserved(def) method(set_REQUEST_URI)operator(()ident(value)operator(\)) - instance_variable(@env)operator([)stringoperator(]) operator(=) ident(value) - instance_variable(@request_uri) operator(=) pre_constant(nil) - instance_variable(@path) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(request_uri=)operator(()ident(uri)operator(\)) - instance_variable(@request_uri) operator(=) ident(uri) - instance_variable(@path) operator(=) ident(uri)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(first) - reserved(end) - - reserved(def) method(remote_addr=)operator(()ident(addr)operator(\)) - instance_variable(@env)operator([)stringoperator(]) operator(=) ident(addr) - reserved(end) - - reserved(def) method(remote_addr) - instance_variable(@env)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(request_uri) - instance_variable(@request_uri) operator(||) reserved(super)operator(()operator(\)) - reserved(end) - - reserved(def) method(path) - instance_variable(@path) operator(||) reserved(super)operator(()operator(\)) - reserved(end) - - reserved(def) method(assign_parameters)operator(()ident(controller_path)operator(,) ident(action)operator(,) ident(parameters)operator(\)) - ident(parameters) operator(=) ident(parameters)operator(.)ident(symbolize_keys)operator(.)ident(merge)operator(()symbol(:controller) operator(=)operator(>) ident(controller_path)operator(,) symbol(:action) operator(=)operator(>) ident(action)operator(\)) - ident(extra_keys) operator(=) constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(extra_keys)operator(()ident(parameters)operator(\)) - ident(non_path_parameters) operator(=) ident(get?) operator(?) ident(query_parameters) operator(:) ident(request_parameters) - ident(parameters)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(if) ident(value)operator(.)ident(is_a?) constant(Fixnum) - ident(value) operator(=) ident(value)operator(.)ident(to_s) - reserved(elsif) ident(value)operator(.)ident(is_a?) constant(Array) - ident(value) operator(=) constant(ActionController)operator(::)constant(Routing)operator(::)constant(PathComponent)operator(::)constant(Result)operator(.)ident(new)operator(()ident(value)operator(\)) - reserved(end) - - reserved(if) ident(extra_keys)operator(.)ident(include?)operator(()ident(key)operator(.)ident(to_sym)operator(\)) - ident(non_path_parameters)operator([)ident(key)operator(]) operator(=) ident(value) - reserved(else) - ident(path_parameters)operator([)ident(key)operator(.)ident(to_s)operator(]) operator(=) ident(value) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(recycle!) - pre_constant(self)operator(.)ident(request_parameters) operator(=) operator({)operator(}) - pre_constant(self)operator(.)ident(query_parameters) operator(=) operator({)operator(}) - pre_constant(self)operator(.)ident(path_parameters) operator(=) operator({)operator(}) - instance_variable(@request_method)operator(,) instance_variable(@accepts)operator(,) instance_variable(@content_type) operator(=) pre_constant(nil)operator(,) pre_constant(nil)operator(,) pre_constant(nil) - reserved(end) - - ident(private) - reserved(def) method(initialize_containers) - instance_variable(@env)operator(,) instance_variable(@cookies) operator(=) operator({)operator(})operator(,) operator({)operator(}) - reserved(end) - - reserved(def) method(initialize_default_values) - instance_variable(@host) operator(=) string - instance_variable(@request_uri) operator(=) string - pre_constant(self)operator(.)ident(remote_addr) operator(=) string - instance_variable(@env)operator([)stringoperator(]) operator(=) integer(80) - instance_variable(@env)operator([)stringoperator(]) operator(=) string - reserved(end) - reserved(end) - - comment(# A refactoring of TestResponse to allow the same behavior to be applied) - comment(# to the "real" CgiResponse class in integration tests.) - reserved(module) class(TestResponseBehavior) comment(#:nodoc:) - comment(# the response code of the request) - reserved(def) method(response_code) - ident(headers)operator([)stringoperator(])operator([)integer(0)operator(,)integer(3)operator(])operator(.)ident(to_i) reserved(rescue) integer(0) - reserved(end) - - comment(# returns a String to ensure compatibility with Net::HTTPResponse) - reserved(def) method(code) - ident(headers)operator([)stringoperator(])operator(.)ident(to_s)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(0)operator(]) - reserved(end) - - reserved(def) method(message) - ident(headers)operator([)stringoperator(])operator(.)ident(to_s)operator(.)ident(split)operator(()stringoperator(,)integer(2)operator(\))operator([)integer(1)operator(]) - reserved(end) - - comment(# was the response successful?) - reserved(def) method(success?) - ident(response_code) operator(==) integer(200) - reserved(end) - - comment(# was the URL not found?) - reserved(def) method(missing?) - ident(response_code) operator(==) integer(404) - reserved(end) - - comment(# were we redirected?) - reserved(def) method(redirect?) - operator(()integer(300)operator(..)integer(399)operator(\))operator(.)ident(include?)operator(()ident(response_code)operator(\)) - reserved(end) - - comment(# was there a server-side error?) - reserved(def) method(error?) - operator(()integer(500)operator(..)integer(599)operator(\))operator(.)ident(include?)operator(()ident(response_code)operator(\)) - reserved(end) - - ident(alias_method) symbol(:server_error?)operator(,) symbol(:error?) - - comment(# returns the redirection location or nil) - reserved(def) method(redirect_url) - ident(redirect?) operator(?) ident(headers)operator([)stringoperator(]) operator(:) pre_constant(nil) - reserved(end) - - comment(# does the redirect location match this regexp pattern?) - reserved(def) method(redirect_url_match?)operator(() ident(pattern) operator(\)) - reserved(return) pre_constant(false) reserved(if) ident(redirect_url)operator(.)ident(nil?) - ident(p) operator(=) constant(Regexp)operator(.)ident(new)operator(()ident(pattern)operator(\)) reserved(if) ident(pattern)operator(.)ident(class) operator(==) constant(String) - ident(p) operator(=) ident(pattern) reserved(if) ident(pattern)operator(.)ident(class) operator(==) constant(Regexp) - reserved(return) pre_constant(false) reserved(if) ident(p)operator(.)ident(nil?) - ident(p)operator(.)ident(match)operator(()ident(redirect_url)operator(\)) operator(!=) pre_constant(nil) - reserved(end) - - comment(# returns the template path of the file which was used to) - comment(# render this response (or nil\) ) - reserved(def) method(rendered_file)operator(()ident(with_controller)operator(=)pre_constant(false)operator(\)) - reserved(unless) ident(template)operator(.)ident(first_render)operator(.)ident(nil?) - reserved(unless) ident(with_controller) - ident(template)operator(.)ident(first_render) - reserved(else) - ident(template)operator(.)ident(first_render)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last) operator(||) ident(template)operator(.)ident(first_render) - reserved(end) - reserved(end) - reserved(end) - - comment(# was this template rendered by a file?) - reserved(def) method(rendered_with_file?) - operator(!)ident(rendered_file)operator(.)ident(nil?) - reserved(end) - - comment(# a shortcut to the flash (or an empty hash if no flash.. hey! that rhymes!\)) - reserved(def) method(flash) - ident(session)operator([)stringoperator(]) operator(||) operator({)operator(}) - reserved(end) - - comment(# do we have a flash? ) - reserved(def) method(has_flash?) - operator(!)ident(session)operator([)stringoperator(])operator(.)ident(empty?) - reserved(end) - - comment(# do we have a flash that has contents?) - reserved(def) method(has_flash_with_contents?) - operator(!)ident(flash)operator(.)ident(empty?) - reserved(end) - - comment(# does the specified flash object exist?) - reserved(def) method(has_flash_object?)operator(()ident(name)operator(=)pre_constant(nil)operator(\)) - operator(!)ident(flash)operator([)ident(name)operator(])operator(.)ident(nil?) - reserved(end) - - comment(# does the specified object exist in the session?) - reserved(def) method(has_session_object?)operator(()ident(name)operator(=)pre_constant(nil)operator(\)) - operator(!)ident(session)operator([)ident(name)operator(])operator(.)ident(nil?) - reserved(end) - - comment(# a shortcut to the template.assigns) - reserved(def) method(template_objects) - ident(template)operator(.)ident(assigns) operator(||) operator({)operator(}) - reserved(end) - - comment(# does the specified template object exist? ) - reserved(def) method(has_template_object?)operator(()ident(name)operator(=)pre_constant(nil)operator(\)) - operator(!)ident(template_objects)operator([)ident(name)operator(])operator(.)ident(nil?) - reserved(end) - - comment(# Returns the response cookies, converted to a Hash of (name => CGI::Cookie\) pairs) - comment(# Example:) - comment(# ) - comment(# assert_equal ['AuthorOfNewPage'], r.cookies['author'].value) - reserved(def) method(cookies) - ident(headers)operator([)stringoperator(])operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({) operator(|)ident(hash)operator(,) ident(cookie)operator(|) ident(hash)operator([)ident(cookie)operator(.)ident(name)operator(]) operator(=) ident(cookie)operator(;) ident(hash) operator(}) - reserved(end) - - comment(# Returns binary content (downloadable file\), converted to a String) - reserved(def) method(binary_content) - ident(raise) stringdelimiter(")> reserved(unless) ident(body)operator(.)ident(kind_of?)operator(()constant(Proc)operator(\)) - ident(require) string - - ident(sio) operator(=) constant(StringIO)operator(.)ident(new) - - reserved(begin) - global_variable($stdout) operator(=) ident(sio) - ident(body)operator(.)ident(call) - reserved(ensure) - global_variable($stdout) operator(=) pre_constant(STDOUT) - reserved(end) - - ident(sio)operator(.)ident(rewind) - ident(sio)operator(.)ident(read) - reserved(end) - reserved(end) - - reserved(class) class(TestResponse) operator(<) constant(AbstractResponse) comment(#:nodoc:) - ident(include) constant(TestResponseBehavior) - reserved(end) - - reserved(class) class(TestSession) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(attributes) operator(=) operator({)operator(})operator(\)) - instance_variable(@attributes) operator(=) ident(attributes) - reserved(end) - - reserved(def) method([])operator(()ident(key)operator(\)) - instance_variable(@attributes)operator([)ident(key)operator(]) - reserved(end) - - reserved(def) method([]=)operator(()ident(key)operator(,) ident(value)operator(\)) - instance_variable(@attributes)operator([)ident(key)operator(]) operator(=) ident(value) - reserved(end) - - reserved(def) method(session_id) - string - reserved(end) - - reserved(def) method(update)operator(()operator(\)) reserved(end) - reserved(def) method(close)operator(()operator(\)) reserved(end) - reserved(def) method(delete)operator(()operator(\)) instance_variable(@attributes) operator(=) operator({)operator(}) reserved(end) - reserved(end) - - comment(# Essentially generates a modified Tempfile object similar to the object) - comment(# you'd get from the standard library CGI module in a multipart) - comment(# request. This means you can use an ActionController::TestUploadedFile) - comment(# object in the params of a test request in order to simulate) - comment(# a file upload.) - comment(#) - comment(# Usage example, within a functional test:) - comment(# post :change_avatar, :avatar => ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + '/files/spongebob.png', 'image/png'\)) - reserved(class) class(TestUploadedFile) - comment(# The filename, *not* including the path, of the "uploaded" file) - ident(attr_reader) symbol(:original_filename) - - comment(# The content type of the "uploaded" file) - ident(attr_reader) symbol(:content_type) - - reserved(def) method(initialize)operator(()ident(path)operator(,) ident(content_type) operator(=) stringoperator(\)) - ident(raise) string reserved(unless) constant(File)operator(.)ident(exist?)operator(()ident(path)operator(\)) - instance_variable(@content_type) operator(=) ident(content_type) - instance_variable(@original_filename) operator(=) ident(path)operator(.)ident(sub)operator(()regexpcontent(([^)inlinecontent(]+\)$)delimiter(/)>operator(\)) operator({) global_variable($1) operator(}) - instance_variable(@tempfile) operator(=) constant(Tempfile)operator(.)ident(new)operator(()instance_variable(@original_filename)operator(\)) - constant(FileUtils)operator(.)ident(copy_file)operator(()ident(path)operator(,) instance_variable(@tempfile)operator(.)ident(path)operator(\)) - reserved(end) - - reserved(def) method(path) comment(#:nodoc:) - instance_variable(@tempfile)operator(.)ident(path) - reserved(end) - - reserved(alias) method(local_path) method(path) - - reserved(def) method(method_missing)operator(()ident(method_name)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) comment(#:nodoc:) - instance_variable(@tempfile)operator(.)ident(send)operator(()ident(method_name)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - - reserved(module) class(TestProcess) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - comment(# execute the request simulating a specific http method and set/volley the response) - stringoperator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - ident(base)operator(.)ident(class_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent((action, parameters = nil, session = nil, flash = nil\) - @request.env['REQUEST_METHOD'] = ")inlinecontent(" if @request - process(action, parameters, session, flash\) - end)delimiter( - EOV)> - reserved(end) - reserved(end) - - comment(# execute the request and set/volley the response) - reserved(def) method(process)operator(()ident(action)operator(,) ident(parameters) operator(=) pre_constant(nil)operator(,) ident(session) operator(=) pre_constant(nil)operator(,) ident(flash) operator(=) pre_constant(nil)operator(\)) - comment(# Sanity check for required instance variables so we can give an) - comment(# understandable error message.) - stringoperator(.)ident(each) reserved(do) operator(|)ident(iv_name)operator(|) - ident(raise) stringcontent( is nil: make sure you set it in your test's setup method.)delimiter(")> reserved(if) ident(instance_variable_get)operator(()stringdelimiter(")>operator(\))operator(.)ident(nil?) - reserved(end) - - instance_variable(@request)operator(.)ident(recycle!) - - instance_variable(@html_document) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(||=) string - instance_variable(@request)operator(.)ident(action) operator(=) ident(action)operator(.)ident(to_s) - - ident(parameters) operator(||=) operator({)operator(}) - instance_variable(@request)operator(.)ident(assign_parameters)operator(()instance_variable(@controller)operator(.)ident(class)operator(.)ident(controller_path)operator(,) ident(action)operator(.)ident(to_s)operator(,) ident(parameters)operator(\)) - - instance_variable(@request)operator(.)ident(session) operator(=) constant(ActionController)operator(::)constant(TestSession)operator(.)ident(new)operator(()ident(session)operator(\)) reserved(unless) ident(session)operator(.)ident(nil?) - instance_variable(@request)operator(.)ident(session)operator([)stringoperator(]) operator(=) constant(ActionController)operator(::)constant(Flash)operator(::)constant(FlashHash)operator(.)ident(new)operator(.)ident(update)operator(()ident(flash)operator(\)) reserved(if) ident(flash) - ident(build_request_uri)operator(()ident(action)operator(,) ident(parameters)operator(\)) - instance_variable(@controller)operator(.)ident(process)operator(()instance_variable(@request)operator(,) instance_variable(@response)operator(\)) - reserved(end) - - reserved(def) method(xml_http_request)operator(()ident(request_method)operator(,) ident(action)operator(,) ident(parameters) operator(=) pre_constant(nil)operator(,) ident(session) operator(=) pre_constant(nil)operator(,) ident(flash) operator(=) pre_constant(nil)operator(\)) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(returning) pre_constant(self)operator(.)ident(send)operator(()ident(request_method)operator(,) ident(action)operator(,) ident(parameters)operator(,) ident(session)operator(,) ident(flash)operator(\)) reserved(do) - instance_variable(@request)operator(.)ident(env)operator(.)ident(delete) string - instance_variable(@request)operator(.)ident(env)operator(.)ident(delete) string - reserved(end) - reserved(end) - reserved(alias) method(xhr) symbol(:xml_http_request) - - reserved(def) method(follow_redirect) - reserved(if) instance_variable(@response)operator(.)ident(redirected_to)operator([)symbol(:controller)operator(]) - ident(raise) stringcontent(\))delimiter(")> - reserved(end) - - ident(get)operator(()instance_variable(@response)operator(.)ident(redirected_to)operator(.)ident(delete)operator(()symbol(:action)operator(\))operator(,) instance_variable(@response)operator(.)ident(redirected_to)operator(.)ident(stringify_keys)operator(\)) - reserved(end) - - reserved(def) method(assigns)operator(()ident(key) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(key)operator(.)ident(nil?) - instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns) - reserved(else) - instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)ident(key)operator(.)ident(to_s)operator(]) - reserved(end) - reserved(end) - - reserved(def) method(session) - instance_variable(@response)operator(.)ident(session) - reserved(end) - - reserved(def) method(flash) - instance_variable(@response)operator(.)ident(flash) - reserved(end) - - reserved(def) method(cookies) - instance_variable(@response)operator(.)ident(cookies) - reserved(end) - - reserved(def) method(redirect_to_url) - instance_variable(@response)operator(.)ident(redirect_url) - reserved(end) - - reserved(def) method(build_request_uri)operator(()ident(action)operator(,) ident(parameters)operator(\)) - reserved(unless) instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) - ident(options) operator(=) instance_variable(@controller)operator(.)ident(send)operator(()symbol(:rewrite_options)operator(,) ident(parameters)operator(\)) - ident(options)operator(.)ident(update)operator(()symbol(:only_path) operator(=)operator(>) pre_constant(true)operator(,) symbol(:action) operator(=)operator(>) ident(action)operator(\)) - - ident(url) operator(=) constant(ActionController)operator(::)constant(UrlRewriter)operator(.)ident(new)operator(()instance_variable(@request)operator(,) ident(parameters)operator(\)) - instance_variable(@request)operator(.)ident(set_REQUEST_URI)operator(()ident(url)operator(.)ident(rewrite)operator(()ident(options)operator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(html_document) - instance_variable(@html_document) operator(||=) constant(HTML)operator(::)constant(Document)operator(.)ident(new)operator(()instance_variable(@response)operator(.)ident(body)operator(\)) - reserved(end) - - reserved(def) method(find_tag)operator(()ident(conditions)operator(\)) - ident(html_document)operator(.)ident(find)operator(()ident(conditions)operator(\)) - reserved(end) - - reserved(def) method(find_all_tag)operator(()ident(conditions)operator(\)) - ident(html_document)operator(.)ident(find_all)operator(()ident(conditions)operator(\)) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(selector)operator(,) operator(*)ident(args)operator(\)) - reserved(return) instance_variable(@controller)operator(.)ident(send)operator(()ident(selector)operator(,) operator(*)ident(args)operator(\)) reserved(if) constant(ActionController)operator(::)constant(Routing)operator(::)constant(NamedRoutes)operator(::)constant(Helpers)operator(.)ident(include?)operator(()ident(selector)operator(\)) - reserved(return) reserved(super) - reserved(end) - - comment(# Shortcut for ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + path, type\). Example:) - comment(# post :change_avatar, :avatar => fixture_file_upload('/files/spongebob.png', 'image/png'\)) - reserved(def) method(fixture_file_upload)operator(()ident(path)operator(,) ident(mime_type) operator(=) pre_constant(nil)operator(\)) - constant(ActionController)operator(::)constant(TestUploadedFile)operator(.)ident(new)operator(() - constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase)operator(.)ident(respond_to?)operator(()symbol(:fixture_path)operator(\)) operator(?) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase)operator(.)ident(fixture_path) operator(+) ident(path) operator(:) ident(path)operator(,) - ident(mime_type) - operator(\)) - reserved(end) - - comment(# A helper to make it easier to test different route configurations.) - comment(# This method temporarily replaces ActionController::Routing::Routes) - comment(# with a new RouteSet instance. ) - comment(#) - comment(# The new instance is yielded to the passed block. Typically the block) - comment(# will create some routes using map.draw { map.connect ... }:) - comment(#) - comment(# with_routing do |set|) - comment(# set.draw { set.connect ':controller/:id/:action' }) - comment(# assert_equal() - comment(# ['/content/10/show', {}],) - comment(# set.generate(:controller => 'content', :id => 10, :action => 'show'\)) - comment(# \)) - comment(# end) - comment(#) - reserved(def) method(with_routing) - ident(real_routes) operator(=) constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes) - constant(ActionController)operator(::)constant(Routing)operator(.)ident(send) symbol(:remove_const)operator(,) symbol(:Routes) - - ident(temporary_routes) operator(=) constant(ActionController)operator(::)constant(Routing)operator(::)constant(RouteSet)operator(.)ident(new) - constant(ActionController)operator(::)constant(Routing)operator(.)ident(send) symbol(:const_set)operator(,) symbol(:Routes)operator(,) ident(temporary_routes) - - reserved(yield) ident(temporary_routes) - reserved(ensure) - reserved(if) constant(ActionController)operator(::)constant(Routing)operator(.)ident(const_defined?) symbol(:Routes) - constant(ActionController)operator(::)constant(Routing)operator(.)ident(send)operator(()symbol(:remove_const)operator(,) symbol(:Routes)operator(\)) - reserved(end) - constant(ActionController)operator(::)constant(Routing)operator(.)ident(const_set)operator(()symbol(:Routes)operator(,) ident(real_routes)operator(\)) reserved(if) ident(real_routes) - reserved(end) - reserved(end) -reserved(end) - -reserved(module) class(Test) - reserved(module) class(Unit) - reserved(class) class(TestCase) comment(#:nodoc:) - ident(include) constant(ActionController)operator(::)constant(TestProcess) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionController) - comment(# Rewrites URLs for Base.redirect_to and Base.url_for in the controller.) - - reserved(class) class(UrlRewriter) comment(#:nodoc:) - constant(RESERVED_OPTIONS) operator(=) operator([)symbol(:anchor)operator(,) symbol(:params)operator(,) symbol(:only_path)operator(,) symbol(:host)operator(,) symbol(:protocol)operator(,) symbol(:trailing_slash)operator(,) symbol(:skip_relative_url_root)operator(]) - reserved(def) method(initialize)operator(()ident(request)operator(,) ident(parameters)operator(\)) - instance_variable(@request)operator(,) instance_variable(@parameters) operator(=) ident(request)operator(,) ident(parameters) - reserved(end) - - reserved(def) method(rewrite)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(rewrite_url)operator(()ident(rewrite_path)operator(()ident(options)operator(\))operator(,) ident(options)operator(\)) - reserved(end) - - reserved(def) method(to_str) - stringcontent(, )inlinecontent(, )inlinecontent(, )inlinecontent(, )inlinecontent(, )inlinedelimiter(")> - reserved(end) - - ident(alias_method) symbol(:to_s)operator(,) symbol(:to_str) - - ident(private) - reserved(def) method(rewrite_url)operator(()ident(path)operator(,) ident(options)operator(\)) - ident(rewritten_url) operator(=) string - reserved(unless) ident(options)operator([)symbol(:only_path)operator(]) - ident(rewritten_url) operator(<<) operator(()ident(options)operator([)symbol(:protocol)operator(]) operator(||) instance_variable(@request)operator(.)ident(protocol)operator(\)) - ident(rewritten_url) operator(<<) operator(()ident(options)operator([)symbol(:host)operator(]) operator(||) instance_variable(@request)operator(.)ident(host_with_port)operator(\)) - reserved(end) - - ident(rewritten_url) operator(<<) instance_variable(@request)operator(.)ident(relative_url_root)operator(.)ident(to_s) reserved(unless) ident(options)operator([)symbol(:skip_relative_url_root)operator(]) - ident(rewritten_url) operator(<<) ident(path) - ident(rewritten_url) operator(<<) string reserved(if) ident(options)operator([)symbol(:trailing_slash)operator(]) - ident(rewritten_url) operator(<<) stringdelimiter(")> reserved(if) ident(options)operator([)symbol(:anchor)operator(]) - - ident(rewritten_url) - reserved(end) - - reserved(def) method(rewrite_path)operator(()ident(options)operator(\)) - ident(options) operator(=) ident(options)operator(.)ident(symbolize_keys) - ident(options)operator(.)ident(update)operator(()ident(options)operator([)symbol(:params)operator(])operator(.)ident(symbolize_keys)operator(\)) reserved(if) ident(options)operator([)symbol(:params)operator(]) - reserved(if) operator(()ident(overwrite) operator(=) ident(options)operator(.)ident(delete)operator(()symbol(:overwrite_params)operator(\))operator(\)) - ident(options)operator(.)ident(update)operator(()instance_variable(@parameters)operator(.)ident(symbolize_keys)operator(\)) - ident(options)operator(.)ident(update)operator(()ident(overwrite)operator(\)) - reserved(end) - constant(RESERVED_OPTIONS)operator(.)ident(each) operator({)operator(|)ident(k)operator(|) ident(options)operator(.)ident(delete) ident(k)operator(}) - ident(path)operator(,) ident(extra_keys) operator(=) constant(Routing)operator(::)constant(Routes)operator(.)ident(generate)operator(()ident(options)operator(.)ident(dup)operator(,) instance_variable(@request)operator(\)) comment(# Warning: Routes will mutate and violate the options hash) - - ident(path) operator(<<) ident(build_query_string)operator(()ident(options)operator(,) ident(extra_keys)operator(\)) reserved(unless) ident(extra_keys)operator(.)ident(empty?) - - ident(path) - reserved(end) - - comment(# Returns a query string with escaped keys and values from the passed hash. If the passed hash contains an "id" it'll) - comment(# be added as a path element instead of a regular parameter pair.) - reserved(def) method(build_query_string)operator(()ident(hash)operator(,) ident(only_keys) operator(=) pre_constant(nil)operator(\)) - ident(elements) operator(=) operator([)operator(]) - ident(query_string) operator(=) string - - ident(only_keys) operator(||=) ident(hash)operator(.)ident(keys) - - ident(only_keys)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(|) - ident(value) operator(=) ident(hash)operator([)ident(key)operator(]) - ident(key) operator(=) constant(CGI)operator(.)ident(escape) ident(key)operator(.)ident(to_s) - reserved(if) ident(value)operator(.)ident(class) operator(==) constant(Array) - ident(key) operator(<<) string - reserved(else) - ident(value) operator(=) operator([) ident(value) operator(]) - reserved(end) - ident(value)operator(.)ident(each) operator({) operator(|)ident(val)operator(|) ident(elements) operator(<<) stringcontent(=)inlinedelimiter(")> operator(}) - reserved(end) - - ident(query_string) operator(<<) operator(()string operator(+) ident(elements)operator(.)ident(join)operator(()stringoperator(\))operator(\)) reserved(unless) ident(elements)operator(.)ident(empty?) - ident(query_string) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(HTML) comment(#:nodoc:) - - comment(# A top-level HTMl document. You give it a body of text, and it will parse that) - comment(# text into a tree of nodes.) - reserved(class) class(Document) comment(#:nodoc:) - - comment(# The root of the parsed document.) - ident(attr_reader) symbol(:root) - - comment(# Create a new Document from the given text.) - reserved(def) method(initialize)operator(()ident(text)operator(,) ident(strict)operator(=)pre_constant(false)operator(,) ident(xml)operator(=)pre_constant(false)operator(\)) - ident(tokenizer) operator(=) constant(Tokenizer)operator(.)ident(new)operator(()ident(text)operator(\)) - instance_variable(@root) operator(=) constant(Node)operator(.)ident(new)operator(()pre_constant(nil)operator(\)) - ident(node_stack) operator(=) operator([) instance_variable(@root) operator(]) - reserved(while) ident(token) operator(=) ident(tokenizer)operator(.)ident(next) - ident(node) operator(=) constant(Node)operator(.)ident(parse)operator(()ident(node_stack)operator(.)ident(last)operator(,) ident(tokenizer)operator(.)ident(line)operator(,) ident(tokenizer)operator(.)ident(position)operator(,) ident(token)operator(\)) - - ident(node_stack)operator(.)ident(last)operator(.)ident(children) operator(<<) ident(node) reserved(unless) ident(node)operator(.)ident(tag?) operator(&&) ident(node)operator(.)ident(closing) operator(==) symbol(:close) - reserved(if) ident(node)operator(.)ident(tag?) - reserved(if) ident(node_stack)operator(.)ident(length) operator(>) integer(1) operator(&&) ident(node)operator(.)ident(closing) operator(==) symbol(:close) - reserved(if) ident(node_stack)operator(.)ident(last)operator(.)ident(name) operator(==) ident(node)operator(.)ident(name) - ident(node_stack)operator(.)ident(pop) - reserved(else) - ident(open_start) operator(=) ident(node_stack)operator(.)ident(last)operator(.)ident(position) operator(-) integer(20) - ident(open_start) operator(=) integer(0) reserved(if) ident(open_start) operator(<) integer(0) - ident(close_start) operator(=) ident(node)operator(.)ident(position) operator(-) integer(20) - ident(close_start) operator(=) integer(0) reserved(if) ident(close_start) operator(<) integer(0) - ident(msg) operator(=) stringoperator(.)ident(strip)stringcontent( with )inlinecontent( - opened at byte )inlinecontent(, line )inlinecontent( - closed at byte )inlinecontent(, line )inlinecontent( - attributes at open: )inlinecontent( - text around open: )inlinecontent( - text around close: )inlinedelimiter( -EOF)> - ident(strict) operator(?) ident(raise)operator(()ident(msg)operator(\)) operator(:) ident(warn)operator(()ident(msg)operator(\)) - reserved(end) - reserved(elsif) operator(!)ident(node)operator(.)ident(childless?)operator(()ident(xml)operator(\)) operator(&&) ident(node)operator(.)ident(closing) operator(!=) symbol(:close) - ident(node_stack)operator(.)ident(push) ident(node) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# Search the tree for (and return\) the first node that matches the given) - comment(# conditions. The conditions are interpreted differently for different node) - comment(# types, see HTML::Text#find and HTML::Tag#find.) - reserved(def) method(find)operator(()ident(conditions)operator(\)) - instance_variable(@root)operator(.)ident(find)operator(()ident(conditions)operator(\)) - reserved(end) - - comment(# Search the tree for (and return\) all nodes that match the given) - comment(# conditions. The conditions are interpreted differently for different node) - comment(# types, see HTML::Text#find and HTML::Tag#find.) - reserved(def) method(find_all)operator(()ident(conditions)operator(\)) - instance_variable(@root)operator(.)ident(find_all)operator(()ident(conditions)operator(\)) - reserved(end) - - reserved(end) - -reserved(end) -ident(require) string - -reserved(module) class(HTML) comment(#:nodoc:) - - reserved(class) class(Conditions) operator(<) constant(Hash) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(hash)operator(\)) - reserved(super)operator(()operator(\)) - ident(hash) operator(=) operator({) symbol(:content) operator(=)operator(>) ident(hash) operator(}) reserved(unless) constant(Hash) operator(===) ident(hash) - ident(hash) operator(=) ident(keys_to_symbols)operator(()ident(hash)operator(\)) - ident(hash)operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) - reserved(case) ident(k) - reserved(when) symbol(:tag)operator(,) symbol(:content) reserved(then) - comment(# keys are valid, and require no further processing) - reserved(when) symbol(:attributes) reserved(then) - ident(hash)operator([)ident(k)operator(]) operator(=) ident(keys_to_strings)operator(()ident(v)operator(\)) - reserved(when) symbol(:parent)operator(,) symbol(:child)operator(,) symbol(:ancestor)operator(,) symbol(:descendant)operator(,) symbol(:sibling)operator(,) symbol(:before)operator(,) - symbol(:after) - ident(hash)operator([)ident(k)operator(]) operator(=) constant(Conditions)operator(.)ident(new)operator(()ident(v)operator(\)) - reserved(when) symbol(:children) - ident(hash)operator([)ident(k)operator(]) operator(=) ident(v) operator(=) ident(keys_to_symbols)operator(()ident(v)operator(\)) - ident(v)operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v2)operator(|) - reserved(case) ident(k) - reserved(when) symbol(:count)operator(,) symbol(:greater_than)operator(,) symbol(:less_than) - comment(# keys are valid, and require no further processing) - reserved(when) symbol(:only) - ident(v)operator([)ident(k)operator(]) operator(=) constant(Conditions)operator(.)ident(new)operator(()ident(v2)operator(\)) - reserved(else) - ident(raise) stringcontent( => )inlinedelimiter(")> - reserved(end) - reserved(end) - reserved(else) - ident(raise) stringcontent( => )inlinedelimiter(")> - reserved(end) - reserved(end) - ident(update) ident(hash) - reserved(end) - - ident(private) - - reserved(def) method(keys_to_strings)operator(()ident(hash)operator(\)) - ident(hash)operator(.)ident(keys)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(h)operator(,)ident(k)operator(|) - ident(h)operator([)ident(k)operator(.)ident(to_s)operator(]) operator(=) ident(hash)operator([)ident(k)operator(]) - ident(h) - reserved(end) - reserved(end) - - reserved(def) method(keys_to_symbols)operator(()ident(hash)operator(\)) - ident(hash)operator(.)ident(keys)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(h)operator(,)ident(k)operator(|) - ident(raise) stringdelimiter(")> reserved(unless) ident(k)operator(.)ident(respond_to?)operator(()symbol(:to_sym)operator(\)) - ident(h)operator([)ident(k)operator(.)ident(to_sym)operator(]) operator(=) ident(hash)operator([)ident(k)operator(]) - ident(h) - reserved(end) - reserved(end) - reserved(end) - - comment(# The base class of all nodes, textual and otherwise, in an HTML document.) - reserved(class) class(Node) comment(#:nodoc:) - comment(# The array of children of this node. Not all nodes have children.) - ident(attr_reader) symbol(:children) - - comment(# The parent node of this node. All nodes have a parent, except for the) - comment(# root node.) - ident(attr_reader) symbol(:parent) - - comment(# The line number of the input where this node was begun) - ident(attr_reader) symbol(:line) - - comment(# The byte position in the input where this node was begun) - ident(attr_reader) symbol(:position) - - comment(# Create a new node as a child of the given parent.) - reserved(def) method(initialize)operator(()ident(parent)operator(,) ident(line)operator(=)integer(0)operator(,) ident(pos)operator(=)integer(0)operator(\)) - instance_variable(@parent) operator(=) ident(parent) - instance_variable(@children) operator(=) operator([)operator(]) - instance_variable(@line)operator(,) instance_variable(@position) operator(=) ident(line)operator(,) ident(pos) - reserved(end) - - comment(# Return a textual representation of the node.) - reserved(def) method(to_s) - ident(s) operator(=) string - instance_variable(@children)operator(.)ident(each) operator({) operator(|)ident(child)operator(|) ident(s) operator(<<) ident(child)operator(.)ident(to_s) operator(}) - ident(s) - reserved(end) - - comment(# Return false (subclasses must override this to provide specific matching) - comment(# behavior.\) +conditions+ may be of any type.) - reserved(def) method(match)operator(()ident(conditions)operator(\)) - pre_constant(false) - reserved(end) - - comment(# Search the children of this node for the first node for which #find) - comment(# returns non +nil+. Returns the result of the #find call that succeeded.) - reserved(def) method(find)operator(()ident(conditions)operator(\)) - ident(conditions) operator(=) ident(validate_conditions)operator(()ident(conditions)operator(\)) - - instance_variable(@children)operator(.)ident(each) reserved(do) operator(|)ident(child)operator(|) - ident(node) operator(=) ident(child)operator(.)ident(find)operator(()ident(conditions)operator(\)) - reserved(return) ident(node) reserved(if) ident(node) - reserved(end) - pre_constant(nil) - reserved(end) - - comment(# Search for all nodes that match the given conditions, and return them) - comment(# as an array.) - reserved(def) method(find_all)operator(()ident(conditions)operator(\)) - ident(conditions) operator(=) ident(validate_conditions)operator(()ident(conditions)operator(\)) - - ident(matches) operator(=) operator([)operator(]) - ident(matches) operator(<<) pre_constant(self) reserved(if) ident(match)operator(()ident(conditions)operator(\)) - instance_variable(@children)operator(.)ident(each) reserved(do) operator(|)ident(child)operator(|) - ident(matches)operator(.)ident(concat) ident(child)operator(.)ident(find_all)operator(()ident(conditions)operator(\)) - reserved(end) - ident(matches) - reserved(end) - - comment(# Returns +false+. Subclasses may override this if they define a kind of) - comment(# tag.) - reserved(def) method(tag?) - pre_constant(false) - reserved(end) - - reserved(def) method(validate_conditions)operator(()ident(conditions)operator(\)) - constant(Conditions) operator(===) ident(conditions) operator(?) ident(conditions) operator(:) constant(Conditions)operator(.)ident(new)operator(()ident(conditions)operator(\)) - reserved(end) - - reserved(def) method(==)operator(()ident(node)operator(\)) - reserved(return) pre_constant(false) reserved(unless) pre_constant(self)operator(.)ident(class) operator(==) ident(node)operator(.)ident(class) operator(&&) ident(children)operator(.)ident(size) operator(==) ident(node)operator(.)ident(children)operator(.)ident(size) - - ident(equivalent) operator(=) pre_constant(true) - - ident(children)operator(.)ident(size)operator(.)ident(times) reserved(do) operator(|)ident(i)operator(|) - ident(equivalent) operator(&&=) ident(children)operator([)ident(i)operator(]) operator(==) ident(node)operator(.)ident(children)operator([)ident(i)operator(]) - reserved(end) - - ident(equivalent) - reserved(end) - - reserved(class) operator(<<)class(self) - reserved(def) method(parse)operator(()ident(parent)operator(,) ident(line)operator(,) ident(pos)operator(,) ident(content)operator(,) ident(strict)operator(=)pre_constant(true)operator(\)) - reserved(if) ident(content) operator(!)operator(~) regexp - constant(Text)operator(.)ident(new)operator(()ident(parent)operator(,) ident(line)operator(,) ident(pos)operator(,) ident(content)operator(\)) - reserved(else) - ident(scanner) operator(=) constant(StringScanner)operator(.)ident(new)operator(()ident(content)operator(\)) - - reserved(unless) ident(scanner)operator(.)ident(skip)operator(()regexpoperator(\)) - reserved(if) ident(strict) - ident(raise) string - reserved(else) - reserved(return) constant(Text)operator(.)ident(new)operator(()ident(parent)operator(,) ident(line)operator(,) ident(pos)operator(,) ident(content)operator(\)) - reserved(end) - reserved(end) - - reserved(if) ident(scanner)operator(.)ident(skip)operator(()regexpoperator(\)) - ident(scanner)operator(.)ident(scan_until)operator(()regexp)delimiter(/)>operator(\)) - reserved(return) constant(CDATA)operator(.)ident(new)operator(()ident(parent)operator(,) ident(line)operator(,) ident(pos)operator(,) ident(scanner)operator(.)ident(pre_match)operator(\)) - reserved(end) - - ident(closing) operator(=) operator(() ident(scanner)operator(.)ident(scan)operator(()regexpoperator(\)) operator(?) symbol(:close) operator(:) pre_constant(nil) operator(\)) - reserved(return) constant(Text)operator(.)ident(new)operator(()ident(parent)operator(,) ident(line)operator(,) ident(pos)operator(,) ident(content)operator(\)) reserved(unless) ident(name) operator(=) ident(scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(name)operator(.)ident(downcase!) - - reserved(unless) ident(closing) - ident(scanner)operator(.)ident(skip)operator(()regexpoperator(\)) - ident(attributes) operator(=) operator({)operator(}) - reserved(while) ident(attr) operator(=) ident(scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(value) operator(=) pre_constant(true) - reserved(if) ident(scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - reserved(if) ident(delim) operator(=) ident(scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(value) operator(=) string - reserved(while) ident(text) operator(=) ident(scanner)operator(.)ident(scan)operator(()regexpchar(\\\\)content(]+|.)delimiter(/)>operator(\)) - reserved(case) ident(text) - reserved(when) string reserved(then) - ident(value) operator(<<) ident(text) - ident(value) operator(<<) ident(scanner)operator(.)ident(getch) - reserved(when) ident(delim) - reserved(break) - reserved(else) ident(value) operator(<<) ident(text) - reserved(end) - reserved(end) - reserved(else) - ident(value) operator(=) ident(scanner)operator(.)ident(scan)operator(()regexp)char(\\/)content(]+)delimiter(/)>operator(\)) - reserved(end) - reserved(end) - ident(attributes)operator([)ident(attr)operator(.)ident(downcase)operator(]) operator(=) ident(value) - ident(scanner)operator(.)ident(skip)operator(()regexpoperator(\)) - reserved(end) - - ident(closing) operator(=) operator(() ident(scanner)operator(.)ident(scan)operator(()regexpoperator(\)) operator(?) symbol(:self) operator(:) pre_constant(nil) operator(\)) - reserved(end) - - reserved(unless) ident(scanner)operator(.)ident(scan)operator(()regexp)delimiter(/)>operator(\)) - reserved(if) ident(strict) - ident(raise) string (got )inlinecontent( for )inlinecontent(, )inlinecontent(\))delimiter(")> - reserved(else) - comment(# throw away all text until we find what we're looking for) - ident(scanner)operator(.)ident(skip_until)operator(()regexp)delimiter(/)>operator(\)) reserved(or) ident(scanner)operator(.)ident(terminate) - reserved(end) - reserved(end) - - constant(Tag)operator(.)ident(new)operator(()ident(parent)operator(,) ident(line)operator(,) ident(pos)operator(,) ident(name)operator(,) ident(attributes)operator(,) ident(closing)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# A node that represents text, rather than markup.) - reserved(class) class(Text) operator(<) constant(Node) comment(#:nodoc:) - - ident(attr_reader) symbol(:content) - - comment(# Creates a new text node as a child of the given parent, with the given) - comment(# content.) - reserved(def) method(initialize)operator(()ident(parent)operator(,) ident(line)operator(,) ident(pos)operator(,) ident(content)operator(\)) - reserved(super)operator(()ident(parent)operator(,) ident(line)operator(,) ident(pos)operator(\)) - instance_variable(@content) operator(=) ident(content) - reserved(end) - - comment(# Returns the content of this node.) - reserved(def) method(to_s) - instance_variable(@content) - reserved(end) - - comment(# Returns +self+ if this node meets the given conditions. Text nodes support) - comment(# conditions of the following kinds:) - comment(#) - comment(# * if +conditions+ is a string, it must be a substring of the node's) - comment(# content) - comment(# * if +conditions+ is a regular expression, it must match the node's) - comment(# content) - comment(# * if +conditions+ is a hash, it must contain a :content key that) - comment(# is either a string or a regexp, and which is interpreted as described) - comment(# above.) - reserved(def) method(find)operator(()ident(conditions)operator(\)) - ident(match)operator(()ident(conditions)operator(\)) operator(&&) pre_constant(self) - reserved(end) - - comment(# Returns non-+nil+ if this node meets the given conditions, or +nil+) - comment(# otherwise. See the discussion of #find for the valid conditions.) - reserved(def) method(match)operator(()ident(conditions)operator(\)) - reserved(case) ident(conditions) - reserved(when) constant(String) - instance_variable(@content)operator(.)ident(index)operator(()ident(conditions)operator(\)) - reserved(when) constant(Regexp) - instance_variable(@content) operator(=)operator(~) ident(conditions) - reserved(when) constant(Hash) - ident(conditions) operator(=) ident(validate_conditions)operator(()ident(conditions)operator(\)) - - comment(# Text nodes only have :content, :parent, :ancestor) - reserved(unless) operator(()ident(conditions)operator(.)ident(keys) operator(-) operator([)symbol(:content)operator(,) symbol(:parent)operator(,) symbol(:ancestor)operator(])operator(\))operator(.)ident(empty?) - reserved(return) pre_constant(false) - reserved(end) - - ident(match)operator(()ident(conditions)operator([)symbol(:content)operator(])operator(\)) - reserved(else) - pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(==)operator(()ident(node)operator(\)) - reserved(return) pre_constant(false) reserved(unless) reserved(super) - ident(content) operator(==) ident(node)operator(.)ident(content) - reserved(end) - reserved(end) - - comment(# A CDATA node is simply a text node with a specialized way of displaying) - comment(# itself.) - reserved(class) class(CDATA) operator(<) constant(Text) comment(#:nodoc:) - reserved(def) method(to_s) - stringcontent(]>)delimiter(")> - reserved(end) - reserved(end) - - comment(# A Tag is any node that represents markup. It may be an opening tag, a) - comment(# closing tag, or a self-closing tag. It has a name, and may have a hash of) - comment(# attributes.) - reserved(class) class(Tag) operator(<) constant(Node) comment(#:nodoc:) - - comment(# Either +nil+, :close, or :self) - ident(attr_reader) symbol(:closing) - - comment(# Either +nil+, or a hash of attributes for this node.) - ident(attr_reader) symbol(:attributes) - - comment(# The name of this tag.) - ident(attr_reader) symbol(:name) - - comment(# Create a new node as a child of the given parent, using the given content) - comment(# to describe the node. It will be parsed and the node name, attributes and) - comment(# closing status extracted.) - reserved(def) method(initialize)operator(()ident(parent)operator(,) ident(line)operator(,) ident(pos)operator(,) ident(name)operator(,) ident(attributes)operator(,) ident(closing)operator(\)) - reserved(super)operator(()ident(parent)operator(,) ident(line)operator(,) ident(pos)operator(\)) - instance_variable(@name) operator(=) ident(name) - instance_variable(@attributes) operator(=) ident(attributes) - instance_variable(@closing) operator(=) ident(closing) - reserved(end) - - comment(# A convenience for obtaining an attribute of the node. Returns +nil+ if) - comment(# the node has no attributes.) - reserved(def) method([])operator(()ident(attr)operator(\)) - instance_variable(@attributes) operator(?) instance_variable(@attributes)operator([)ident(attr)operator(]) operator(:) pre_constant(nil) - reserved(end) - - comment(# Returns non-+nil+ if this tag can contain child nodes.) - reserved(def) method(childless?)operator(()ident(xml) operator(=) pre_constant(false)operator(\)) - reserved(return) pre_constant(false) reserved(if) ident(xml) operator(&&) instance_variable(@closing)operator(.)ident(nil?) - operator(!)instance_variable(@closing)operator(.)ident(nil?) operator(||) - instance_variable(@name) operator(=)operator(~) regexp - reserved(end) - - comment(# Returns a textual representation of the node) - reserved(def) method(to_s) - reserved(if) instance_variable(@closing) operator(==) symbol(:close) - stringcontent(>)delimiter(")> - reserved(else) - ident(s) operator(=) stringdelimiter(")> - instance_variable(@attributes)operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) - ident(s) operator(<<) stringdelimiter(")> - ident(s) operator(<<) stringoperator(,)stringoperator(\))inline_delimiter(})>content(')delimiter(")> reserved(if) constant(String) operator(===) ident(v) - reserved(end) - ident(s) operator(<<) string reserved(if) instance_variable(@closing) operator(==) symbol(:self) - ident(s) operator(<<) string)delimiter(")> - instance_variable(@children)operator(.)ident(each) operator({) operator(|)ident(child)operator(|) ident(s) operator(<<) ident(child)operator(.)ident(to_s) operator(}) - ident(s) operator(<<) stringcontent(>)delimiter(")> reserved(if) instance_variable(@closing) operator(!=) symbol(:self) operator(&&) operator(!)instance_variable(@children)operator(.)ident(empty?) - ident(s) - reserved(end) - reserved(end) - - comment(# If either the node or any of its children meet the given conditions, the) - comment(# matching node is returned. Otherwise, +nil+ is returned. (See the) - comment(# description of the valid conditions in the +match+ method.\)) - reserved(def) method(find)operator(()ident(conditions)operator(\)) - ident(match)operator(()ident(conditions)operator(\)) operator(&&) pre_constant(self) operator(||) reserved(super) - reserved(end) - - comment(# Returns +true+, indicating that this node represents an HTML tag.) - reserved(def) method(tag?) - pre_constant(true) - reserved(end) - - comment(# Returns +true+ if the node meets any of the given conditions. The) - comment(# +conditions+ parameter must be a hash of any of the following keys) - comment(# (all are optional\):) - comment(#) - comment(# * :tag: the node name must match the corresponding value) - comment(# * :attributes: a hash. The node's values must match the) - comment(# corresponding values in the hash.) - comment(# * :parent: a hash. The node's parent must match the) - comment(# corresponding hash.) - comment(# * :child: a hash. At least one of the node's immediate children) - comment(# must meet the criteria described by the hash.) - comment(# * :ancestor: a hash. At least one of the node's ancestors must) - comment(# meet the criteria described by the hash.) - comment(# * :descendant: a hash. At least one of the node's descendants) - comment(# must meet the criteria described by the hash.) - comment(# * :sibling: a hash. At least one of the node's siblings must) - comment(# meet the criteria described by the hash.) - comment(# * :after: a hash. The node must be after any sibling meeting) - comment(# the criteria described by the hash, and at least one sibling must match.) - comment(# * :before: a hash. The node must be before any sibling meeting) - comment(# the criteria described by the hash, and at least one sibling must match.) - comment(# * :children: a hash, for counting children of a node. Accepts the) - comment(# keys:) - comment(# ** :count: either a number or a range which must equal (or) - comment(# include\) the number of children that match.) - comment(# ** :less_than: the number of matching children must be less than) - comment(# this number.) - comment(# ** :greater_than: the number of matching children must be) - comment(# greater than this number.) - comment(# ** :only: another hash consisting of the keys to use) - comment(# to match on the children, and only matching children will be) - comment(# counted.) - comment(#) - comment(# Conditions are matched using the following algorithm:) - comment(#) - comment(# * if the condition is a string, it must be a substring of the value.) - comment(# * if the condition is a regexp, it must match the value.) - comment(# * if the condition is a number, the value must match number.to_s.) - comment(# * if the condition is +true+, the value must not be +nil+.) - comment(# * if the condition is +false+ or +nil+, the value must be +nil+.) - comment(#) - comment(# Usage:) - comment(#) - comment(# # test if the node is a "span" tag) - comment(# node.match :tag => "span") - comment(#) - comment(# # test if the node's parent is a "div") - comment(# node.match :parent => { :tag => "div" }) - comment(#) - comment(# # test if any of the node's ancestors are "table" tags) - comment(# node.match :ancestor => { :tag => "table" }) - comment(#) - comment(# # test if any of the node's immediate children are "em" tags) - comment(# node.match :child => { :tag => "em" }) - comment(#) - comment(# # test if any of the node's descendants are "strong" tags) - comment(# node.match :descendant => { :tag => "strong" }) - comment(#) - comment(# # test if the node has between 2 and 4 span tags as immediate children) - comment(# node.match :children => { :count => 2..4, :only => { :tag => "span" } } ) - comment(#) - comment(# # get funky: test to see if the node is a "div", has a "ul" ancestor) - comment(# # and an "li" parent (with "class" = "enum"\), and whether or not it has) - comment(# # a "span" descendant that contains # text matching /hello world/:) - comment(# node.match :tag => "div",) - comment(# :ancestor => { :tag => "ul" },) - comment(# :parent => { :tag => "li",) - comment(# :attributes => { :class => "enum" } },) - comment(# :descendant => { :tag => "span",) - comment(# :child => /hello world/ }) - reserved(def) method(match)operator(()ident(conditions)operator(\)) - ident(conditions) operator(=) ident(validate_conditions)operator(()ident(conditions)operator(\)) - - comment(# check content of child nodes) - reserved(if) ident(conditions)operator([)symbol(:content)operator(]) - reserved(if) ident(children)operator(.)ident(empty?) - reserved(return) pre_constant(false) reserved(unless) ident(match_condition)operator(()stringoperator(,) ident(conditions)operator([)symbol(:content)operator(])operator(\)) - reserved(else) - reserved(return) pre_constant(false) reserved(unless) ident(children)operator(.)ident(find) operator({) operator(|)ident(child)operator(|) ident(child)operator(.)ident(match)operator(()ident(conditions)operator([)symbol(:content)operator(])operator(\)) operator(}) - reserved(end) - reserved(end) - - comment(# test the name) - reserved(return) pre_constant(false) reserved(unless) ident(match_condition)operator(()instance_variable(@name)operator(,) ident(conditions)operator([)symbol(:tag)operator(])operator(\)) reserved(if) ident(conditions)operator([)symbol(:tag)operator(]) - - comment(# test attributes) - operator(()ident(conditions)operator([)symbol(:attributes)operator(]) operator(||) operator({)operator(})operator(\))operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(return) pre_constant(false) reserved(unless) ident(match_condition)operator(()pre_constant(self)operator([)ident(key)operator(])operator(,) ident(value)operator(\)) - reserved(end) - - comment(# test parent) - reserved(return) pre_constant(false) reserved(unless) ident(parent)operator(.)ident(match)operator(()ident(conditions)operator([)symbol(:parent)operator(])operator(\)) reserved(if) ident(conditions)operator([)symbol(:parent)operator(]) - - comment(# test children) - reserved(return) pre_constant(false) reserved(unless) ident(children)operator(.)ident(find) operator({) operator(|)ident(child)operator(|) ident(child)operator(.)ident(match)operator(()ident(conditions)operator([)symbol(:child)operator(])operator(\)) operator(}) reserved(if) ident(conditions)operator([)symbol(:child)operator(]) - - comment(# test ancestors) - reserved(if) ident(conditions)operator([)symbol(:ancestor)operator(]) - reserved(return) pre_constant(false) reserved(unless) ident(catch) symbol(:found) reserved(do) - ident(p) operator(=) pre_constant(self) - ident(throw) symbol(:found)operator(,) pre_constant(true) reserved(if) ident(p)operator(.)ident(match)operator(()ident(conditions)operator([)symbol(:ancestor)operator(])operator(\)) reserved(while) ident(p) operator(=) ident(p)operator(.)ident(parent) - reserved(end) - reserved(end) - - comment(# test descendants) - reserved(if) ident(conditions)operator([)symbol(:descendant)operator(]) - reserved(return) pre_constant(false) reserved(unless) ident(children)operator(.)ident(find) reserved(do) operator(|)ident(child)operator(|) - comment(# test the child) - ident(child)operator(.)ident(match)operator(()ident(conditions)operator([)symbol(:descendant)operator(])operator(\)) operator(||) - comment(# test the child's descendants) - ident(child)operator(.)ident(match)operator(()symbol(:descendant) operator(=)operator(>) ident(conditions)operator([)symbol(:descendant)operator(])operator(\)) - reserved(end) - reserved(end) - - comment(# count children) - reserved(if) ident(opts) operator(=) ident(conditions)operator([)symbol(:children)operator(]) - ident(matches) operator(=) ident(children)operator(.)ident(select) reserved(do) operator(|)ident(c)operator(|) - ident(c)operator(.)ident(match)operator(()regexpoperator(\)) reserved(or) - operator(()ident(c)operator(.)ident(kind_of?)operator(()constant(HTML)operator(::)constant(Tag)operator(\)) reserved(and) operator(()ident(c)operator(.)ident(closing) operator(==) symbol(:self) reserved(or) operator(!) ident(c)operator(.)ident(childless?)operator(\))operator(\)) - reserved(end) - - ident(matches) operator(=) ident(matches)operator(.)ident(select) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(match)operator(()ident(opts)operator([)symbol(:only)operator(])operator(\)) operator(}) reserved(if) ident(opts)operator([)symbol(:only)operator(]) - ident(opts)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(next) reserved(if) ident(key) operator(==) symbol(:only) - reserved(case) ident(key) - reserved(when) symbol(:count) - reserved(if) constant(Integer) operator(===) ident(value) - reserved(return) pre_constant(false) reserved(if) ident(matches)operator(.)ident(length) operator(!=) ident(value) - reserved(else) - reserved(return) pre_constant(false) reserved(unless) ident(value)operator(.)ident(include?)operator(()ident(matches)operator(.)ident(length)operator(\)) - reserved(end) - reserved(when) symbol(:less_than) - reserved(return) pre_constant(false) reserved(unless) ident(matches)operator(.)ident(length) operator(<) ident(value) - reserved(when) symbol(:greater_than) - reserved(return) pre_constant(false) reserved(unless) ident(matches)operator(.)ident(length) operator(>) ident(value) - reserved(else) ident(raise) stringdelimiter(")> - reserved(end) - reserved(end) - reserved(end) - - comment(# test siblings) - reserved(if) ident(conditions)operator([)symbol(:sibling)operator(]) operator(||) ident(conditions)operator([)symbol(:before)operator(]) operator(||) ident(conditions)operator([)symbol(:after)operator(]) - ident(siblings) operator(=) ident(parent) operator(?) ident(parent)operator(.)ident(children) operator(:) operator([)operator(]) - ident(self_index) operator(=) ident(siblings)operator(.)ident(index)operator(()pre_constant(self)operator(\)) - - reserved(if) ident(conditions)operator([)symbol(:sibling)operator(]) - reserved(return) pre_constant(false) reserved(unless) ident(siblings)operator(.)ident(detect) reserved(do) operator(|)ident(s)operator(|) - ident(s) operator(!=) pre_constant(self) operator(&&) ident(s)operator(.)ident(match)operator(()ident(conditions)operator([)symbol(:sibling)operator(])operator(\)) - reserved(end) - reserved(end) - - reserved(if) ident(conditions)operator([)symbol(:before)operator(]) - reserved(return) pre_constant(false) reserved(unless) ident(siblings)operator([)ident(self_index)operator(+)integer(1)operator(..)integer(-1)operator(])operator(.)ident(detect) reserved(do) operator(|)ident(s)operator(|) - ident(s) operator(!=) pre_constant(self) operator(&&) ident(s)operator(.)ident(match)operator(()ident(conditions)operator([)symbol(:before)operator(])operator(\)) - reserved(end) - reserved(end) - - reserved(if) ident(conditions)operator([)symbol(:after)operator(]) - reserved(return) pre_constant(false) reserved(unless) ident(siblings)operator([)integer(0)operator(,)ident(self_index)operator(])operator(.)ident(detect) reserved(do) operator(|)ident(s)operator(|) - ident(s) operator(!=) pre_constant(self) operator(&&) ident(s)operator(.)ident(match)operator(()ident(conditions)operator([)symbol(:after)operator(])operator(\)) - reserved(end) - reserved(end) - reserved(end) - - pre_constant(true) - reserved(end) - - reserved(def) method(==)operator(()ident(node)operator(\)) - reserved(return) pre_constant(false) reserved(unless) reserved(super) - reserved(return) pre_constant(false) reserved(unless) ident(closing) operator(==) ident(node)operator(.)ident(closing) operator(&&) pre_constant(self)operator(.)ident(name) operator(==) ident(node)operator(.)ident(name) - ident(attributes) operator(==) ident(node)operator(.)ident(attributes) - reserved(end) - - ident(private) - comment(# Match the given value to the given condition.) - reserved(def) method(match_condition)operator(()ident(value)operator(,) ident(condition)operator(\)) - reserved(case) ident(condition) - reserved(when) constant(String) - ident(value) operator(&&) ident(value) operator(==) ident(condition) - reserved(when) constant(Regexp) - ident(value) operator(&&) ident(value)operator(.)ident(match)operator(()ident(condition)operator(\)) - reserved(when) constant(Numeric) - ident(value) operator(==) ident(condition)operator(.)ident(to_s) - reserved(when) pre_constant(true) - operator(!)ident(value)operator(.)ident(nil?) - reserved(when) pre_constant(false)operator(,) pre_constant(nil) - ident(value)operator(.)ident(nil?) - reserved(else) - pre_constant(false) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(HTML) comment(#:nodoc:) - - comment(# A simple HTML tokenizer. It simply breaks a stream of text into tokens, where each) - comment(# token is a string. Each string represents either "text", or an HTML element.) - comment(#) - comment(# This currently assumes valid XHTML, which means no free < or > characters.) - comment(#) - comment(# Usage:) - comment(#) - comment(# tokenizer = HTML::Tokenizer.new(text\)) - comment(# while token = tokenizer.next) - comment(# p token) - comment(# end) - reserved(class) class(Tokenizer) comment(#:nodoc:) - - comment(# The current (byte\) position in the text) - ident(attr_reader) symbol(:position) - - comment(# The current line number) - ident(attr_reader) symbol(:line) - - comment(# Create a new Tokenizer for the given text.) - reserved(def) method(initialize)operator(()ident(text)operator(\)) - instance_variable(@scanner) operator(=) constant(StringScanner)operator(.)ident(new)operator(()ident(text)operator(\)) - instance_variable(@position) operator(=) integer(0) - instance_variable(@line) operator(=) integer(0) - instance_variable(@current_line) operator(=) integer(1) - reserved(end) - - comment(# Return the next token in the sequence, or +nil+ if there are no more tokens in) - comment(# the stream.) - reserved(def) method(next) - reserved(return) pre_constant(nil) reserved(if) instance_variable(@scanner)operator(.)ident(eos?) - instance_variable(@position) operator(=) instance_variable(@scanner)operator(.)ident(pos) - instance_variable(@line) operator(=) instance_variable(@current_line) - reserved(if) instance_variable(@scanner)operator(.)ident(check)operator(()regexpoperator(\)) - ident(update_current_line)operator(()ident(scan_tag)operator(\)) - reserved(else) - ident(update_current_line)operator(()ident(scan_text)operator(\)) - reserved(end) - reserved(end) - - ident(private) - - comment(# Treat the text at the current position as a tag, and scan it. Supports) - comment(# comments, doctype tags, and regular tags, and ignores less-than and) - comment(# greater-than characters within quoted strings.) - reserved(def) method(scan_tag) - ident(tag) operator(=) instance_variable(@scanner)operator(.)ident(getch) - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) comment(# comment) - ident(tag) operator(<<) instance_variable(@scanner)operator(.)ident(matched) - ident(tag) operator(<<) operator(()instance_variable(@scanner)operator(.)ident(scan_until)operator(()regexp)delimiter(/)>operator(\)) operator(||) instance_variable(@scanner)operator(.)ident(scan_until)operator(()regexpoperator(\))operator(\)) - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(tag) operator(<<) instance_variable(@scanner)operator(.)ident(matched) - ident(tag) operator(<<) instance_variable(@scanner)operator(.)ident(scan_until)operator(()regexp)delimiter(/)>operator(\)) - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) comment(# doctype) - ident(tag) operator(<<) instance_variable(@scanner)operator(.)ident(matched) - ident(tag) operator(<<) ident(consume_quoted_regions) - reserved(else) - ident(tag) operator(<<) ident(consume_quoted_regions) - reserved(end) - ident(tag) - reserved(end) - - comment(# Scan all text up to the next < character and return it.) - reserved(def) method(scan_text) - stringinlineoperator(\))inline_delimiter(})>delimiter(")> - reserved(end) - - comment(# Counts the number of newlines in the text and updates the current line) - comment(# accordingly.) - reserved(def) method(update_current_line)operator(()ident(text)operator(\)) - ident(text)operator(.)ident(scan)operator(()regexpoperator(\)) operator({) instance_variable(@current_line) operator(+=) integer(1) operator(}) - reserved(end) - - comment(# Skips over quoted strings, so that less-than and greater-than characters) - comment(# within the strings are ignored.) - reserved(def) method(consume_quoted_regions) - ident(text) operator(=) string - ident(loop) reserved(do) - ident(match) operator(=) instance_variable(@scanner)operator(.)ident(scan_until)operator(()regexp])delimiter(/)>operator(\)) reserved(or) reserved(break) - - ident(delim) operator(=) instance_variable(@scanner)operator(.)ident(matched) - reserved(if) ident(delim) operator(==) string - ident(match) operator(=) ident(match)operator(.)ident(chop) - instance_variable(@scanner)operator(.)ident(pos) operator(-=) integer(1) - reserved(end) - - ident(text) operator(<<) ident(match) - reserved(break) reserved(if) ident(delim) operator(==) string operator(||) ident(delim) operator(==) string)delimiter(")> - - comment(# consume the quoted region) - reserved(while) ident(match) operator(=) instance_variable(@scanner)operator(.)ident(scan_until)operator(()regexpcontent(])delimiter(/)>operator(\)) - ident(text) operator(<<) ident(match) - reserved(break) reserved(if) instance_variable(@scanner)operator(.)ident(matched) operator(==) ident(delim) - ident(text) operator(<<) instance_variable(@scanner)operator(.)ident(getch) comment(# skip the escaped character) - reserved(end) - reserved(end) - ident(text) - reserved(end) - reserved(end) - -reserved(end) -reserved(module) class(HTML) comment(#:nodoc:) - reserved(module) class(Version) comment(#:nodoc:) - - constant(MAJOR) operator(=) integer(0) - constant(MINOR) operator(=) integer(5) - constant(TINY) operator(=) integer(3) - - constant(STRING) operator(=) operator([) constant(MAJOR)operator(,) constant(MINOR)operator(,) constant(TINY) operator(])operator(.)ident(join)operator(()stringoperator(\)) - - reserved(end) -reserved(end) -ident(require) string - -comment(# SimpleXML like xml parser. Written by leon breet from the ruby on rails Mailing list) -reserved(class) class(XmlNode) comment(#:nodoc:) - ident(attr) symbol(:node) - - reserved(def) method(initialize)operator(()ident(node)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - instance_variable(@node) operator(=) ident(node) - instance_variable(@children) operator(=) operator({)operator(}) - instance_variable(@raise_errors) operator(=) ident(options)operator([)symbol(:raise_errors)operator(]) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(from_xml)operator(()ident(xml_or_io)operator(\)) - ident(document) operator(=) constant(REXML)operator(::)constant(Document)operator(.)ident(new)operator(()ident(xml_or_io)operator(\)) - reserved(if) ident(document)operator(.)ident(root) - constant(XmlNode)operator(.)ident(new)operator(()ident(document)operator(.)ident(root)operator(\)) - reserved(else) - constant(XmlNode)operator(.)ident(new)operator(()ident(document)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(node_encoding) - instance_variable(@node)operator(.)ident(encoding) - reserved(end) - - reserved(def) method(node_name) - instance_variable(@node)operator(.)ident(name) - reserved(end) - - reserved(def) method(node_value) - instance_variable(@node)operator(.)ident(text) - reserved(end) - - reserved(def) method(node_value=)operator(()ident(value)operator(\)) - instance_variable(@node)operator(.)ident(text) operator(=) ident(value) - reserved(end) - - reserved(def) method(xpath)operator(()ident(expr)operator(\)) - ident(matches) operator(=) pre_constant(nil) - constant(REXML)operator(::)constant(XPath)operator(.)ident(each)operator(()instance_variable(@node)operator(,) ident(expr)operator(\)) reserved(do) operator(|)ident(element)operator(|) - ident(matches) operator(||=) constant(XmlNodeList)operator(.)ident(new) - ident(matches) operator(<<) operator(()instance_variable(@children)operator([)ident(element)operator(]) operator(||=) constant(XmlNode)operator(.)ident(new)operator(()ident(element)operator(\))operator(\)) - reserved(end) - ident(matches) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) - ident(name) operator(=) ident(name)operator(.)ident(to_s) - ident(nodes) operator(=) pre_constant(nil) - instance_variable(@node)operator(.)ident(each_element)operator(()ident(name)operator(\)) reserved(do) operator(|)ident(element)operator(|) - ident(nodes) operator(||=) constant(XmlNodeList)operator(.)ident(new) - ident(nodes) operator(<<) operator(()instance_variable(@children)operator([)ident(element)operator(]) operator(||=) constant(XmlNode)operator(.)ident(new)operator(()ident(element)operator(\))operator(\)) - reserved(end) - ident(nodes) - reserved(end) - - reserved(def) method(<<)operator(()ident(node)operator(\)) - reserved(if) ident(node)operator(.)ident(is_a?) constant(REXML)operator(::)constant(Node) - ident(child) operator(=) ident(node) - reserved(elsif) ident(node)operator(.)ident(respond_to?) symbol(:node) - ident(child) operator(=) ident(node)operator(.)ident(node) - reserved(end) - instance_variable(@node)operator(.)ident(add_element) ident(child) - instance_variable(@children)operator([)ident(child)operator(]) operator(||=) constant(XmlNode)operator(.)ident(new)operator(()ident(child)operator(\)) - reserved(end) - - reserved(def) method([])operator(()ident(name)operator(\)) - instance_variable(@node)operator(.)ident(attributes)operator([)ident(name)operator(.)ident(to_s)operator(]) - reserved(end) - - reserved(def) method([]=)operator(()ident(name)operator(,) ident(value)operator(\)) - instance_variable(@node)operator(.)ident(attributes)operator([)ident(name)operator(.)ident(to_s)operator(]) operator(=) ident(value) - reserved(end) - - reserved(def) method(to_s) - instance_variable(@node)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(to_i) - ident(to_s)operator(.)ident(to_i) - reserved(end) -reserved(end) - -reserved(class) class(XmlNodeList) operator(<) constant(Array) comment(#:nodoc:) - reserved(def) method([])operator(()ident(i)operator(\)) - ident(i)operator(.)ident(is_a?)operator(()constant(String)operator(\)) operator(?) reserved(super)operator(()integer(0)operator(\))operator([)ident(i)operator(]) operator(:) reserved(super)operator(()ident(i)operator(\)) - reserved(end) - - reserved(def) method([]=)operator(()ident(i)operator(,) ident(value)operator(\)) - ident(i)operator(.)ident(is_a?)operator(()constant(String)operator(\)) operator(?) pre_constant(self)operator([)integer(0)operator(])operator([)ident(i)operator(]) operator(=) ident(value) operator(:) reserved(super)operator(()ident(i)operator(,) ident(value)operator(\)) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) - ident(name) operator(=) ident(name)operator(.)ident(to_s) - pre_constant(self)operator([)integer(0)operator(])operator(.)ident(__send__)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) - reserved(end) -reserved(end)comment(# = XmlSimple) -comment(#) -comment(# Author:: Maik Schmidt ) -comment(# Copyright:: Copyright (c\) 2003 Maik Schmidt) -comment(# License:: Distributes under the same terms as Ruby.) -comment(#) -ident(require) string - -comment(# Easy API to maintain XML (especially configuration files\).) -reserved(class) class(XmlSimple) comment(#:nodoc:) - ident(include) constant(REXML) - - class_variable(@@VERSION) operator(=) string - - comment(# A simple cache for XML documents that were already transformed) - comment(# by xml_in.) - reserved(class) class(Cache) comment(#:nodoc:) - comment(# Creates and initializes a new Cache object.) - reserved(def) method(initialize) - instance_variable(@mem_share_cache) operator(=) operator({)operator(}) - instance_variable(@mem_copy_cache) operator(=) operator({)operator(}) - reserved(end) - - comment(# Saves a data structure into a file.) - comment(# ) - comment(# data::) - comment(# Data structure to be saved.) - comment(# filename::) - comment(# Name of the file belonging to the data structure.) - reserved(def) method(save_storable)operator(()ident(data)operator(,) ident(filename)operator(\)) - ident(cache_file) operator(=) ident(get_cache_filename)operator(()ident(filename)operator(\)) - constant(File)operator(.)ident(open)operator(()ident(cache_file)operator(,) stringoperator(\)) operator({) operator(|)ident(f)operator(|) constant(Marshal)operator(.)ident(dump)operator(()ident(data)operator(,) ident(f)operator(\)) operator(}) - reserved(end) - - comment(# Restores a data structure from a file. If restoring the data) - comment(# structure failed for any reason, nil will be returned.) - comment(#) - comment(# filename::) - comment(# Name of the file belonging to the data structure.) - reserved(def) method(restore_storable)operator(()ident(filename)operator(\)) - ident(cache_file) operator(=) ident(get_cache_filename)operator(()ident(filename)operator(\)) - reserved(return) pre_constant(nil) reserved(unless) constant(File)operator(::)ident(exist?)operator(()ident(cache_file)operator(\)) - reserved(return) pre_constant(nil) reserved(unless) constant(File)operator(::)ident(mtime)operator(()ident(cache_file)operator(\))operator(.)ident(to_i) operator(>) constant(File)operator(::)ident(mtime)operator(()ident(filename)operator(\))operator(.)ident(to_i) - ident(data) operator(=) pre_constant(nil) - constant(File)operator(.)ident(open)operator(()ident(cache_file)operator(\)) operator({) operator(|)ident(f)operator(|) ident(data) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(f)operator(\)) operator(}) - ident(data) - reserved(end) - - comment(# Saves a data structure in a shared memory cache.) - comment(#) - comment(# data::) - comment(# Data structure to be saved.) - comment(# filename::) - comment(# Name of the file belonging to the data structure.) - reserved(def) method(save_mem_share)operator(()ident(data)operator(,) ident(filename)operator(\)) - instance_variable(@mem_share_cache)operator([)ident(filename)operator(]) operator(=) operator([)constant(Time)operator(::)ident(now)operator(.)ident(to_i)operator(,) ident(data)operator(]) - reserved(end) - - comment(# Restores a data structure from a shared memory cache. You) - comment(# should consider these elements as "read only". If restoring) - comment(# the data structure failed for any reason, nil will be) - comment(# returned.) - comment(#) - comment(# filename::) - comment(# Name of the file belonging to the data structure.) - reserved(def) method(restore_mem_share)operator(()ident(filename)operator(\)) - ident(get_from_memory_cache)operator(()ident(filename)operator(,) instance_variable(@mem_share_cache)operator(\)) - reserved(end) - - comment(# Copies a data structure to a memory cache.) - comment(#) - comment(# data::) - comment(# Data structure to be copied.) - comment(# filename::) - comment(# Name of the file belonging to the data structure.) - reserved(def) method(save_mem_copy)operator(()ident(data)operator(,) ident(filename)operator(\)) - instance_variable(@mem_share_cache)operator([)ident(filename)operator(]) operator(=) operator([)constant(Time)operator(::)ident(now)operator(.)ident(to_i)operator(,) constant(Marshal)operator(.)ident(dump)operator(()ident(data)operator(\))operator(]) - reserved(end) - - comment(# Restores a data structure from a memory cache. If restoring) - comment(# the data structure failed for any reason, nil will be) - comment(# returned.) - comment(#) - comment(# filename::) - comment(# Name of the file belonging to the data structure.) - reserved(def) method(restore_mem_copy)operator(()ident(filename)operator(\)) - ident(data) operator(=) ident(get_from_memory_cache)operator(()ident(filename)operator(,) instance_variable(@mem_share_cache)operator(\)) - ident(data) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(data)operator(\)) reserved(unless) ident(data)operator(.)ident(nil?) - ident(data) - reserved(end) - - ident(private) - - comment(# Returns the "cache filename" belonging to a filename, i.e.) - comment(# the extension '.xml' in the original filename will be replaced) - comment(# by '.stor'. If filename does not have this extension, '.stor') - comment(# will be appended.) - comment(#) - comment(# filename::) - comment(# Filename to get "cache filename" for.) - reserved(def) method(get_cache_filename)operator(()ident(filename)operator(\)) - ident(filename)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - comment(# Returns a cache entry from a memory cache belonging to a) - comment(# certain filename. If no entry could be found for any reason,) - comment(# nil will be returned.) - comment(#) - comment(# filename::) - comment(# Name of the file the cache entry belongs to.) - comment(# cache::) - comment(# Memory cache to get entry from.) - reserved(def) method(get_from_memory_cache)operator(()ident(filename)operator(,) ident(cache)operator(\)) - reserved(return) pre_constant(nil) reserved(unless) ident(cache)operator([)ident(filename)operator(]) - reserved(return) pre_constant(nil) reserved(unless) ident(cache)operator([)ident(filename)operator(])operator([)integer(0)operator(]) operator(>) constant(File)operator(::)ident(mtime)operator(()ident(filename)operator(\))operator(.)ident(to_i) - reserved(return) ident(cache)operator([)ident(filename)operator(])operator([)integer(1)operator(]) - reserved(end) - reserved(end) - - comment(# Create a "global" cache.) - class_variable(@@cache) operator(=) constant(Cache)operator(.)ident(new) - - comment(# Creates and intializes a new XmlSimple object.) - comment(# ) - comment(# defaults::) - comment(# Default values for options.) - reserved(def) method(initialize)operator(()ident(defaults) operator(=) pre_constant(nil)operator(\)) - reserved(unless) ident(defaults)operator(.)ident(nil?) operator(||) ident(defaults)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - instance_variable(@default_options) operator(=) ident(normalize_option_names)operator(()ident(defaults)operator(,) constant(KNOWN_OPTIONS)operator([)stringoperator(]) operator(&) constant(KNOWN_OPTIONS)operator([)stringoperator(])operator(\)) - instance_variable(@options) operator(=) constant(Hash)operator(.)ident(new) - instance_variable(@_var_values) operator(=) pre_constant(nil) - reserved(end) - - comment(# Converts an XML document in the same way as the Perl module XML::Simple.) - comment(#) - comment(# string::) - comment(# XML source. Could be one of the following:) - comment(#) - comment(# - nil: Tries to load and parse '.xml'.) - comment(# - filename: Tries to load and parse filename.) - comment(# - IO object: Reads from object until EOF is detected and parses result.) - comment(# - XML string: Parses string.) - comment(# ) - comment(# options::) - comment(# Options to be used.) - reserved(def) method(xml_in)operator(()ident(string) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) - ident(handle_options)operator(()stringoperator(,) ident(options)operator(\)) - - comment(# If no XML string or filename was supplied look for scriptname.xml.) - reserved(if) ident(string)operator(.)ident(nil?) - ident(string) operator(=) constant(File)operator(::)ident(basename)operator(()global_variable($0)operator(\)) - ident(string)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(string) operator(+=) string - - ident(directory) operator(=) constant(File)operator(::)ident(dirname)operator(()global_variable($0)operator(\)) - instance_variable(@options)operator([)stringoperator(])operator(.)ident(unshift)operator(()ident(directory)operator(\)) reserved(unless) ident(directory)operator(.)ident(nil?) - reserved(end) - - reserved(if) ident(string)operator(.)ident(instance_of?)operator(()constant(String)operator(\)) - reserved(if) ident(string) operator(=)operator(~) regexp)delimiter(/)modifier(m)> - instance_variable(@doc) operator(=) ident(parse)operator(()ident(string)operator(\)) - reserved(elsif) ident(string) operator(==) string - instance_variable(@doc) operator(=) ident(parse)operator(()global_variable($stdin)operator(.)ident(readlines)operator(.)ident(to_s)operator(\)) - reserved(else) - ident(filename) operator(=) ident(find_xml_file)operator(()ident(string)operator(,) instance_variable(@options)operator([)stringoperator(])operator(\)) - - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - instance_variable(@options)operator([)stringoperator(])operator(.)ident(each) operator({) operator(|)ident(scheme)operator(|) - reserved(case)operator(()ident(scheme)operator(\)) - reserved(when) string - ident(content) operator(=) class_variable(@@cache)operator(.)ident(restore_storable)operator(()ident(filename)operator(\)) - reserved(when) string - ident(content) operator(=) class_variable(@@cache)operator(.)ident(restore_mem_share)operator(()ident(filename)operator(\)) - reserved(when) string - ident(content) operator(=) class_variable(@@cache)operator(.)ident(restore_mem_copy)operator(()ident(filename)operator(\)) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) stringcontent(>.)delimiter(")> - reserved(end) - reserved(return) ident(content) reserved(if) ident(content) - operator(}) - reserved(end) - - instance_variable(@doc) operator(=) ident(load_xml_file)operator(()ident(filename)operator(\)) - reserved(end) - reserved(elsif) ident(string)operator(.)ident(kind_of?)operator(()constant(IO)operator(\)) - instance_variable(@doc) operator(=) ident(parse)operator(()ident(string)operator(.)ident(readlines)operator(.)ident(to_s)operator(\)) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) stringcontent(>.)delimiter(")> - reserved(end) - - ident(result) operator(=) ident(collapse)operator(()instance_variable(@doc)operator(.)ident(root)operator(\)) - ident(result) operator(=) instance_variable(@options)operator([)stringoperator(]) operator(?) ident(merge)operator(()operator({)operator(})operator(,) instance_variable(@doc)operator(.)ident(root)operator(.)ident(name)operator(,) ident(result)operator(\)) operator(:) ident(result) - ident(put_into_cache)operator(()ident(result)operator(,) ident(filename)operator(\)) - ident(result) - reserved(end) - - comment(# This is the functional version of the instance method xml_in.) - reserved(def) constant(XmlSimple)operator(.)method(xml_in)operator(()ident(string) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) - ident(xml_simple) operator(=) constant(XmlSimple)operator(.)ident(new) - ident(xml_simple)operator(.)ident(xml_in)operator(()ident(string)operator(,) ident(options)operator(\)) - reserved(end) - - comment(# Converts a data structure into an XML document.) - comment(#) - comment(# ref::) - comment(# Reference to data structure to be converted into XML.) - comment(# options::) - comment(# Options to be used.) - reserved(def) method(xml_out)operator(()ident(ref)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) - ident(handle_options)operator(()stringoperator(,) ident(options)operator(\)) - reserved(if) ident(ref)operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - ident(ref) operator(=) operator({) instance_variable(@options)operator([)stringoperator(]) operator(=)operator(>) ident(ref) operator(}) - reserved(end) - - reserved(if) instance_variable(@options)operator([)stringoperator(]) - ident(keys) operator(=) ident(ref)operator(.)ident(keys) - reserved(if) ident(keys)operator(.)ident(size) operator(==) integer(1) - ident(ref) operator(=) ident(ref)operator([)ident(keys)operator([)integer(0)operator(])operator(]) - instance_variable(@options)operator([)stringoperator(]) operator(=) ident(keys)operator([)integer(0)operator(]) - reserved(end) - reserved(elsif) instance_variable(@options)operator([)stringoperator(]) operator(==) string - reserved(if) ident(ref)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - ident(refsave) operator(=) ident(ref) - ident(ref) operator(=) operator({)operator(}) - ident(refsave)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(if) operator(!)ident(scalar)operator(()ident(value)operator(\)) - ident(ref)operator([)ident(key)operator(]) operator(=) ident(value) - reserved(else) - ident(ref)operator([)ident(key)operator(]) operator(=) operator([) ident(value)operator(.)ident(to_s) operator(]) - reserved(end) - operator(}) - reserved(end) - reserved(end) - - instance_variable(@ancestors) operator(=) operator([)operator(]) - ident(xml) operator(=) ident(value_to_xml)operator(()ident(ref)operator(,) instance_variable(@options)operator([)stringoperator(])operator(,) stringoperator(\)) - instance_variable(@ancestors) operator(=) pre_constant(nil) - - reserved(if) instance_variable(@options)operator([)stringoperator(]) - ident(xml) operator(=) instance_variable(@options)operator([)stringoperator(]) operator(+) string operator(+) ident(xml) - reserved(end) - - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - reserved(if) instance_variable(@options)operator([)stringoperator(])operator(.)ident(kind_of?)operator(()constant(IO)operator(\)) - reserved(return) instance_variable(@options)operator([)stringoperator(])operator(.)ident(write)operator(()ident(xml)operator(\)) - reserved(else) - constant(File)operator(.)ident(open)operator(()instance_variable(@options)operator([)stringoperator(])operator(,) stringoperator(\)) operator({) operator(|)ident(file)operator(|) ident(file)operator(.)ident(write)operator(()ident(xml)operator(\)) operator(}) - reserved(end) - reserved(end) - ident(xml) - reserved(end) - - comment(# This is the functional version of the instance method xml_out.) - reserved(def) constant(XmlSimple)operator(.)method(xml_out)operator(()ident(hash)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) - ident(xml_simple) operator(=) constant(XmlSimple)operator(.)ident(new) - ident(xml_simple)operator(.)ident(xml_out)operator(()ident(hash)operator(,) ident(options)operator(\)) - reserved(end) - - ident(private) - - comment(# Declare options that are valid for xml_in and xml_out.) - constant(KNOWN_OPTIONS) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) string - operator(}) - - comment(# Define some reasonable defaults.) - constant(DEF_KEY_ATTRIBUTES) operator(=) operator([)operator(]) - constant(DEF_ROOT_NAME) operator(=) string - constant(DEF_CONTENT_KEY) operator(=) string - constant(DEF_XML_DECLARATION) operator(=) string)delimiter(")> - constant(DEF_ANONYMOUS_TAG) operator(=) string - constant(DEF_FORCE_ARRAY) operator(=) pre_constant(true) - constant(DEF_INDENTATION) operator(=) string - - comment(# Normalizes option names in a hash, i.e., turns all) - comment(# characters to lower case and removes all underscores.) - comment(# Additionally, this method checks, if an unknown option) - comment(# was used and raises an according exception.) - comment(#) - comment(# options::) - comment(# Hash to be normalized.) - comment(# known_options::) - comment(# List of known options.) - reserved(def) method(normalize_option_names)operator(()ident(options)operator(,) ident(known_options)operator(\)) - reserved(return) pre_constant(nil) reserved(if) ident(options)operator(.)ident(nil?) - ident(result) operator(=) constant(Hash)operator(.)ident(new) - ident(options)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) - ident(lkey) operator(=) ident(key)operator(.)ident(downcase) - ident(lkey)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(if) operator(!)ident(known_options)operator(.)ident(member?)operator(()ident(lkey)operator(\)) - ident(raise) constant(ArgumentError)operator(,) stringcontent(.)delimiter(")> - reserved(end) - ident(result)operator([)ident(lkey)operator(]) operator(=) ident(value) - operator(}) - ident(result) - reserved(end) - - comment(# Merges a set of options with the default options.) - comment(# ) - comment(# direction::) - comment(# 'in': If options should be handled for xml_in.) - comment(# 'out': If options should be handled for xml_out.) - comment(# options::) - comment(# Options to be merged with the default options.) - reserved(def) method(handle_options)operator(()ident(direction)operator(,) ident(options)operator(\)) - instance_variable(@options) operator(=) ident(options) operator(||) constant(Hash)operator(.)ident(new) - - ident(raise) constant(ArgumentError)operator(,) string reserved(unless) instance_variable(@options)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - - reserved(unless) constant(KNOWN_OPTIONS)operator(.)ident(has_key?)operator(()ident(direction)operator(\)) - ident(raise) constant(ArgumentError)operator(,) stringcontent(>.)delimiter(")> - reserved(end) - - ident(known_options) operator(=) constant(KNOWN_OPTIONS)operator([)ident(direction)operator(]) - instance_variable(@options) operator(=) ident(normalize_option_names)operator(()instance_variable(@options)operator(,) ident(known_options)operator(\)) - - reserved(unless) instance_variable(@default_options)operator(.)ident(nil?) - ident(known_options)operator(.)ident(each) operator({) operator(|)ident(option)operator(|) - reserved(unless) instance_variable(@options)operator(.)ident(has_key?)operator(()ident(option)operator(\)) - reserved(if) instance_variable(@default_options)operator(.)ident(has_key?)operator(()ident(option)operator(\)) - instance_variable(@options)operator([)ident(option)operator(]) operator(=) instance_variable(@default_options)operator([)ident(option)operator(]) - reserved(end) - reserved(end) - operator(}) - reserved(end) - - reserved(unless) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - instance_variable(@options)operator([)stringoperator(]) operator(=) pre_constant(false) - reserved(end) - - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - instance_variable(@options)operator([)stringoperator(]) operator(=) string reserved(if) instance_variable(@options)operator([)stringoperator(])operator(.)ident(nil?) - reserved(else) - instance_variable(@options)operator([)stringoperator(]) operator(=) constant(DEF_ROOT_NAME) - reserved(end) - - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) operator(&&) instance_variable(@options)operator([)stringoperator(]) operator(==) pre_constant(true) - instance_variable(@options)operator([)stringoperator(]) operator(=) constant(DEF_XML_DECLARATION) - reserved(end) - - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - reserved(if) instance_variable(@options)operator([)stringoperator(]) operator(=)operator(~) regexp - instance_variable(@options)operator([)stringoperator(]) operator(=) global_variable($1) - instance_variable(@options)operator([)stringoperator(]) operator(=) pre_constant(true) - reserved(end) - reserved(else) - instance_variable(@options)operator([)stringoperator(]) operator(=) constant(DEF_CONTENT_KEY) - reserved(end) - - reserved(unless) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - instance_variable(@options)operator([)stringoperator(]) operator(=) instance_variable(@options)operator([)stringoperator(]) - reserved(end) - instance_variable(@options)operator([)stringoperator(]) operator(=) integer(0) reserved(if) instance_variable(@options)operator([)stringoperator(])operator(.)ident(nil?) - - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - reserved(unless) instance_variable(@options)operator([)stringoperator(])operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - instance_variable(@options)operator([)stringoperator(]) operator(=) operator([) instance_variable(@options)operator([)stringoperator(]) operator(]) - reserved(end) - reserved(else) - instance_variable(@options)operator([)stringoperator(]) operator(=) operator([)operator(]) - reserved(end) - - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) operator(&&) ident(scalar)operator(()instance_variable(@options)operator([)stringoperator(])operator(\)) - instance_variable(@options)operator([)stringoperator(]) operator(=) operator([) instance_variable(@options)operator([)stringoperator(]) operator(]) - reserved(end) - - instance_variable(@options)operator([)stringoperator(]) operator(=) constant(DEF_ANONYMOUS_TAG) reserved(unless) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - - reserved(if) operator(!)instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) operator(||) instance_variable(@options)operator([)stringoperator(])operator(.)ident(nil?) - instance_variable(@options)operator([)stringoperator(]) operator(=) constant(DEF_INDENTATION) - reserved(end) - - instance_variable(@options)operator([)stringoperator(]) operator(=) string reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - - comment(# Special cleanup for 'keyattr' which could be an array or) - comment(# a hash or left to default to array.) - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - reserved(if) operator(!)ident(scalar)operator(()instance_variable(@options)operator([)stringoperator(])operator(\)) - comment(# Convert keyattr => { elem => '+attr' }) - comment(# to keyattr => { elem => ['attr', '+'] }) - reserved(if) instance_variable(@options)operator([)stringoperator(])operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - instance_variable(@options)operator([)stringoperator(])operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(if) ident(value) operator(=)operator(~) regexp - instance_variable(@options)operator([)stringoperator(])operator([)ident(key)operator(]) operator(=) operator([)global_variable($2)operator(,) global_variable($1) operator(?) global_variable($1) operator(:) stringoperator(]) - reserved(end) - operator(}) - reserved(elsif) operator(!)instance_variable(@options)operator([)stringoperator(])operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - reserved(else) - instance_variable(@options)operator([)stringoperator(]) operator(=) operator([) instance_variable(@options)operator([)stringoperator(]) operator(]) - reserved(end) - reserved(else) - instance_variable(@options)operator([)stringoperator(]) operator(=) constant(DEF_KEY_ATTRIBUTES) - reserved(end) - - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - reserved(if) instance_variable(@options)operator([)stringoperator(])operator(.)ident(instance_of?)operator(()constant(Regexp)operator(\)) - instance_variable(@options)operator([)stringoperator(]) operator(=) operator([) instance_variable(@options)operator([)stringoperator(]) operator(]) - reserved(end) - - reserved(if) instance_variable(@options)operator([)stringoperator(])operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - ident(force_list) operator(=) instance_variable(@options)operator([)stringoperator(]) - reserved(unless) ident(force_list)operator(.)ident(empty?) - instance_variable(@options)operator([)stringoperator(]) operator(=) operator({)operator(}) - ident(force_list)operator(.)ident(each) operator({) operator(|)ident(tag)operator(|) - reserved(if) ident(tag)operator(.)ident(instance_of?)operator(()constant(Regexp)operator(\)) - reserved(unless) instance_variable(@options)operator([)stringoperator(])operator([)stringoperator(])operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - instance_variable(@options)operator([)stringoperator(])operator([)stringoperator(]) operator(=) operator([)operator(]) - reserved(end) - instance_variable(@options)operator([)stringoperator(])operator([)stringoperator(]) operator(<<) ident(tag) - reserved(else) - instance_variable(@options)operator([)stringoperator(])operator([)ident(tag)operator(]) operator(=) pre_constant(true) - reserved(end) - operator(}) - reserved(else) - instance_variable(@options)operator([)stringoperator(]) operator(=) pre_constant(false) - reserved(end) - reserved(else) - instance_variable(@options)operator([)stringoperator(]) operator(=) instance_variable(@options)operator([)stringoperator(]) operator(?) pre_constant(true) operator(:) pre_constant(false) - reserved(end) - reserved(else) - instance_variable(@options)operator([)stringoperator(]) operator(=) constant(DEF_FORCE_ARRAY) - reserved(end) - - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) operator(&&) operator(!)instance_variable(@options)operator([)stringoperator(])operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) operator(&&) operator(!)instance_variable(@options)operator([)stringoperator(])operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - instance_variable(@_var_values) operator(=) instance_variable(@options)operator([)stringoperator(]) - reserved(elsif) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - instance_variable(@_var_values) operator(=) operator({)operator(}) - reserved(end) - reserved(end) - - comment(# Actually converts an XML document element into a data structure.) - comment(#) - comment(# element::) - comment(# The document element to be collapsed.) - reserved(def) method(collapse)operator(()ident(element)operator(\)) - ident(result) operator(=) instance_variable(@options)operator([)stringoperator(]) operator(?) operator({)operator(}) operator(:) ident(get_attributes)operator(()ident(element)operator(\)) - - reserved(if) instance_variable(@options)operator([)stringoperator(]) operator(==) integer(2) - ident(result)operator(.)ident(each) operator({) operator(|)ident(k)operator(,) ident(v)operator(|) ident(result)operator([)ident(k)operator(]) operator(=) ident(normalise_space)operator(()ident(v)operator(\)) operator(}) - reserved(end) - - reserved(if) ident(element)operator(.)ident(has_elements?) - ident(element)operator(.)ident(each_element) operator({) operator(|)ident(child)operator(|) - ident(value) operator(=) ident(collapse)operator(()ident(child)operator(\)) - reserved(if) ident(empty)operator(()ident(value)operator(\)) operator(&&) operator(()ident(element)operator(.)ident(attributes)operator(.)ident(empty?) operator(||) instance_variable(@options)operator([)stringoperator(])operator(\)) - reserved(next) reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) operator(&&) instance_variable(@options)operator([)stringoperator(]) operator(==) pre_constant(true) - reserved(end) - ident(result) operator(=) ident(merge)operator(()ident(result)operator(,) ident(child)operator(.)ident(name)operator(,) ident(value)operator(\)) - operator(}) - reserved(if) ident(has_mixed_content?)operator(()ident(element)operator(\)) - comment(# normalisespace?) - ident(content) operator(=) ident(element)operator(.)ident(texts)operator(.)ident(map) operator({) operator(|)ident(x)operator(|) ident(x)operator(.)ident(to_s) operator(}) - ident(content) operator(=) ident(content)operator([)integer(0)operator(]) reserved(if) ident(content)operator(.)ident(size) operator(==) integer(1) - ident(result)operator([)instance_variable(@options)operator([)stringoperator(])operator(]) operator(=) ident(content) - reserved(end) - reserved(elsif) ident(element)operator(.)ident(has_text?) comment(# i.e. it has only text.) - reserved(return) ident(collapse_text_node)operator(()ident(result)operator(,) ident(element)operator(\)) - reserved(end) - - comment(# Turn Arrays into Hashes if key fields present.) - ident(count) operator(=) ident(fold_arrays)operator(()ident(result)operator(\)) - - comment(# Disintermediate grouped tags.) - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - ident(result)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(next) reserved(unless) operator(()ident(value)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) operator(&&) operator(()ident(value)operator(.)ident(size) operator(==) integer(1)operator(\))operator(\)) - ident(child_key)operator(,) ident(child_value) operator(=) ident(value)operator(.)ident(to_a)operator([)integer(0)operator(]) - reserved(if) instance_variable(@options)operator([)stringoperator(])operator([)ident(key)operator(]) operator(==) ident(child_key) - ident(result)operator([)ident(key)operator(]) operator(=) ident(child_value) - reserved(end) - operator(}) - reserved(end) - - comment(# Fold Hases containing a single anonymous Array up into just the Array.) - reserved(if) ident(count) operator(==) integer(1) - ident(anonymoustag) operator(=) instance_variable(@options)operator([)stringoperator(]) - reserved(if) ident(result)operator(.)ident(has_key?)operator(()ident(anonymoustag)operator(\)) operator(&&) ident(result)operator([)ident(anonymoustag)operator(])operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - reserved(return) ident(result)operator([)ident(anonymoustag)operator(]) - reserved(end) - reserved(end) - - reserved(if) ident(result)operator(.)ident(empty?) operator(&&) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - reserved(return) instance_variable(@options)operator([)stringoperator(]) operator(==) string operator(?) string operator(:) pre_constant(nil) - reserved(end) - - ident(result) - reserved(end) - - comment(# Collapses a text node and merges it with an existing Hash, if) - comment(# possible.) - comment(# Thanks to Curtis Schofield for reporting a subtle bug.) - comment(#) - comment(# hash::) - comment(# Hash to merge text node value with, if possible.) - comment(# element::) - comment(# Text node to be collapsed.) - reserved(def) method(collapse_text_node)operator(()ident(hash)operator(,) ident(element)operator(\)) - ident(value) operator(=) ident(node_to_text)operator(()ident(element)operator(\)) - reserved(if) ident(empty)operator(()ident(value)operator(\)) operator(&&) operator(!)ident(element)operator(.)ident(has_attributes?) - reserved(return) operator({)operator(}) - reserved(end) - - reserved(if) ident(element)operator(.)ident(has_attributes?) operator(&&) operator(!)instance_variable(@options)operator([)stringoperator(]) - reserved(return) ident(merge)operator(()ident(hash)operator(,) instance_variable(@options)operator([)stringoperator(])operator(,) ident(value)operator(\)) - reserved(else) - reserved(if) instance_variable(@options)operator([)stringoperator(]) - reserved(return) ident(merge)operator(()ident(hash)operator(,) instance_variable(@options)operator([)stringoperator(])operator(,) ident(value)operator(\)) - reserved(else) - reserved(return) ident(value) - reserved(end) - reserved(end) - reserved(end) - - comment(# Folds all arrays in a Hash.) - comment(# ) - comment(# hash::) - comment(# Hash to be folded.) - reserved(def) method(fold_arrays)operator(()ident(hash)operator(\)) - ident(fold_amount) operator(=) integer(0) - ident(keyattr) operator(=) instance_variable(@options)operator([)stringoperator(]) - reserved(if) operator(()ident(keyattr)operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) operator(||) ident(keyattr)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\))operator(\)) - ident(hash)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(if) ident(value)operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - reserved(if) ident(keyattr)operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - ident(hash)operator([)ident(key)operator(]) operator(=) ident(fold_array)operator(()ident(value)operator(\)) - reserved(else) - ident(hash)operator([)ident(key)operator(]) operator(=) ident(fold_array_by_name)operator(()ident(key)operator(,) ident(value)operator(\)) - reserved(end) - ident(fold_amount) operator(+=) integer(1) - reserved(end) - operator(}) - reserved(end) - ident(fold_amount) - reserved(end) - - comment(# Folds an Array to a Hash, if possible. Folding happens) - comment(# according to the content of keyattr, which has to be) - comment(# an array.) - comment(#) - comment(# array::) - comment(# Array to be folded.) - reserved(def) method(fold_array)operator(()ident(array)operator(\)) - ident(hash) operator(=) constant(Hash)operator(.)ident(new) - ident(array)operator(.)ident(each) operator({) operator(|)ident(x)operator(|) - reserved(return) ident(array) reserved(unless) ident(x)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - ident(key_matched) operator(=) pre_constant(false) - instance_variable(@options)operator([)stringoperator(])operator(.)ident(each) operator({) operator(|)ident(key)operator(|) - reserved(if) ident(x)operator(.)ident(has_key?)operator(()ident(key)operator(\)) - ident(key_matched) operator(=) pre_constant(true) - ident(value) operator(=) ident(x)operator([)ident(key)operator(]) - reserved(return) ident(array) reserved(if) ident(value)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) operator(||) ident(value)operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - ident(value) operator(=) ident(normalise_space)operator(()ident(value)operator(\)) reserved(if) instance_variable(@options)operator([)stringoperator(]) operator(==) integer(1) - ident(x)operator(.)ident(delete)operator(()ident(key)operator(\)) - ident(hash)operator([)ident(value)operator(]) operator(=) ident(x) - reserved(break) - reserved(end) - operator(}) - reserved(return) ident(array) reserved(unless) ident(key_matched) - operator(}) - ident(hash) operator(=) ident(collapse_content)operator(()ident(hash)operator(\)) reserved(if) instance_variable(@options)operator([)stringoperator(]) - ident(hash) - reserved(end) - - comment(# Folds an Array to a Hash, if possible. Folding happens) - comment(# according to the content of keyattr, which has to be) - comment(# a Hash.) - comment(#) - comment(# name::) - comment(# Name of the attribute to be folded upon.) - comment(# array::) - comment(# Array to be folded.) - reserved(def) method(fold_array_by_name)operator(()ident(name)operator(,) ident(array)operator(\)) - reserved(return) ident(array) reserved(unless) instance_variable(@options)operator([)stringoperator(])operator(.)ident(has_key?)operator(()ident(name)operator(\)) - ident(key)operator(,) ident(flag) operator(=) instance_variable(@options)operator([)stringoperator(])operator([)ident(name)operator(]) - - ident(hash) operator(=) constant(Hash)operator(.)ident(new) - ident(array)operator(.)ident(each) operator({) operator(|)ident(x)operator(|) - reserved(if) ident(x)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) operator(&&) ident(x)operator(.)ident(has_key?)operator(()ident(key)operator(\)) - ident(value) operator(=) ident(x)operator([)ident(key)operator(]) - reserved(return) ident(array) reserved(if) ident(value)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) operator(||) ident(value)operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - ident(value) operator(=) ident(normalise_space)operator(()ident(value)operator(\)) reserved(if) instance_variable(@options)operator([)stringoperator(]) operator(==) integer(1) - ident(hash)operator([)ident(value)operator(]) operator(=) ident(x) - ident(hash)operator([)ident(value)operator(])operator([)stringdelimiter(")>operator(]) operator(=) ident(hash)operator([)ident(value)operator(])operator([)ident(key)operator(]) reserved(if) ident(flag) operator(==) string - ident(hash)operator([)ident(value)operator(])operator(.)ident(delete)operator(()ident(key)operator(\)) reserved(unless) ident(flag) operator(==) string - reserved(else) - global_variable($stderr)operator(.)ident(puts)operator(()stringcontent(> element has no ')inlinecontent(' attribute.)delimiter(")>operator(\)) - reserved(return) ident(array) - reserved(end) - operator(}) - ident(hash) operator(=) ident(collapse_content)operator(()ident(hash)operator(\)) reserved(if) instance_variable(@options)operator([)stringoperator(]) - ident(hash) - reserved(end) - - comment(# Tries to collapse a Hash even more ;-\)) - comment(#) - comment(# hash::) - comment(# Hash to be collapsed again.) - reserved(def) method(collapse_content)operator(()ident(hash)operator(\)) - ident(content_key) operator(=) instance_variable(@options)operator([)stringoperator(]) - ident(hash)operator(.)ident(each_value) operator({) operator(|)ident(value)operator(|) - reserved(return) ident(hash) reserved(unless) ident(value)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) operator(&&) ident(value)operator(.)ident(size) operator(==) integer(1) operator(&&) ident(value)operator(.)ident(has_key?)operator(()ident(content_key)operator(\)) - ident(hash)operator(.)ident(each_key) operator({) operator(|)ident(key)operator(|) ident(hash)operator([)ident(key)operator(]) operator(=) ident(hash)operator([)ident(key)operator(])operator([)ident(content_key)operator(]) operator(}) - operator(}) - ident(hash) - reserved(end) - - comment(# Adds a new key/value pair to an existing Hash. If the key to be added) - comment(# does already exist and the existing value associated with key is not) - comment(# an Array, it will be converted into an Array. Then the new value is) - comment(# appended to that Array.) - comment(#) - comment(# hash::) - comment(# Hash to add key/value pair to.) - comment(# key::) - comment(# Key to be added.) - comment(# value::) - comment(# Value to be associated with key.) - reserved(def) method(merge)operator(()ident(hash)operator(,) ident(key)operator(,) ident(value)operator(\)) - reserved(if) ident(value)operator(.)ident(instance_of?)operator(()constant(String)operator(\)) - ident(value) operator(=) ident(normalise_space)operator(()ident(value)operator(\)) reserved(if) instance_variable(@options)operator([)stringoperator(]) operator(==) integer(2) - - comment(# do variable substitutions) - reserved(unless) instance_variable(@_var_values)operator(.)ident(nil?) operator(||) instance_variable(@_var_values)operator(.)ident(empty?) - ident(value)operator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) operator(|)ident(x)operator(|) ident(get_var)operator(()global_variable($1)operator(\)) operator(}) - reserved(end) - - comment(# look for variable definitions) - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - ident(varattr) operator(=) instance_variable(@options)operator([)stringoperator(]) - reserved(if) ident(hash)operator(.)ident(has_key?)operator(()ident(varattr)operator(\)) - ident(set_var)operator(()ident(hash)operator([)ident(varattr)operator(])operator(,) ident(value)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(if) ident(hash)operator(.)ident(has_key?)operator(()ident(key)operator(\)) - reserved(if) ident(hash)operator([)ident(key)operator(])operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - ident(hash)operator([)ident(key)operator(]) operator(<<) ident(value) - reserved(else) - ident(hash)operator([)ident(key)operator(]) operator(=) operator([) ident(hash)operator([)ident(key)operator(])operator(,) ident(value) operator(]) - reserved(end) - reserved(elsif) ident(value)operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) comment(# Handle anonymous arrays.) - ident(hash)operator([)ident(key)operator(]) operator(=) operator([) ident(value) operator(]) - reserved(else) - reserved(if) ident(force_array?)operator(()ident(key)operator(\)) - ident(hash)operator([)ident(key)operator(]) operator(=) operator([) ident(value) operator(]) - reserved(else) - ident(hash)operator([)ident(key)operator(]) operator(=) ident(value) - reserved(end) - reserved(end) - ident(hash) - reserved(end) - - comment(# Checks, if the 'forcearray' option has to be used for) - comment(# a certain key.) - reserved(def) method(force_array?)operator(()ident(key)operator(\)) - reserved(return) pre_constant(false) reserved(if) ident(key) operator(==) instance_variable(@options)operator([)stringoperator(]) - reserved(return) pre_constant(true) reserved(if) instance_variable(@options)operator([)stringoperator(]) operator(==) pre_constant(true) - ident(forcearray) operator(=) instance_variable(@options)operator([)stringoperator(]) - reserved(if) ident(forcearray)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - reserved(return) pre_constant(true) reserved(if) ident(forcearray)operator(.)ident(has_key?)operator(()ident(key)operator(\)) - reserved(return) pre_constant(false) reserved(unless) ident(forcearray)operator(.)ident(has_key?)operator(()stringoperator(\)) - ident(forcearray)operator([)stringoperator(])operator(.)ident(each) operator({) operator(|)ident(x)operator(|) reserved(return) pre_constant(true) reserved(if) ident(key) operator(=)operator(~) ident(x) operator(}) - reserved(end) - reserved(return) pre_constant(false) - reserved(end) - - comment(# Converts the attributes array of a document node into a Hash.) - comment(# Returns an empty Hash, if node has no attributes.) - comment(#) - comment(# node::) - comment(# Document node to extract attributes from.) - reserved(def) method(get_attributes)operator(()ident(node)operator(\)) - ident(attributes) operator(=) operator({)operator(}) - ident(node)operator(.)ident(attributes)operator(.)ident(each) operator({) operator(|)ident(n)operator(,)ident(v)operator(|) ident(attributes)operator([)ident(n)operator(]) operator(=) ident(v) operator(}) - ident(attributes) - reserved(end) - - comment(# Determines, if a document element has mixed content.) - comment(#) - comment(# element::) - comment(# Document element to be checked.) - reserved(def) method(has_mixed_content?)operator(()ident(element)operator(\)) - reserved(if) ident(element)operator(.)ident(has_text?) operator(&&) ident(element)operator(.)ident(has_elements?) - reserved(return) pre_constant(true) reserved(if) ident(element)operator(.)ident(texts)operator(.)ident(join)operator(()stringoperator(\)) operator(!)operator(~) regexp - reserved(end) - pre_constant(false) - reserved(end) - - comment(# Called when a variable definition is encountered in the XML.) - comment(# A variable definition looks like) - comment(# value) - comment(# where attrname matches the varattr setting.) - reserved(def) method(set_var)operator(()ident(name)operator(,) ident(value)operator(\)) - instance_variable(@_var_values)operator([)ident(name)operator(]) operator(=) ident(value) - reserved(end) - - comment(# Called during variable substitution to get the value for the) - comment(# named variable.) - reserved(def) method(get_var)operator(()ident(name)operator(\)) - reserved(if) instance_variable(@_var_values)operator(.)ident(has_key?)operator(()ident(name)operator(\)) - reserved(return) instance_variable(@_var_values)operator([)ident(name)operator(]) - reserved(else) - reserved(return) stringcontent(})delimiter(")> - reserved(end) - reserved(end) - - comment(# Recurses through a data structure building up and returning an) - comment(# XML representation of that structure as a string.) - comment(#) - comment(# ref::) - comment(# Reference to the data structure to be encoded.) - comment(# name::) - comment(# The XML tag name to be used for this item.) - comment(# indent::) - comment(# A string of spaces for use as the current indent level.) - reserved(def) method(value_to_xml)operator(()ident(ref)operator(,) ident(name)operator(,) ident(indent)operator(\)) - ident(named) operator(=) operator(!)ident(name)operator(.)ident(nil?) operator(&&) ident(name) operator(!=) string - ident(nl) operator(=) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) operator(?) string operator(:) string - - reserved(if) operator(!)ident(scalar)operator(()ident(ref)operator(\)) - reserved(if) instance_variable(@ancestors)operator(.)ident(member?)operator(()ident(ref)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - instance_variable(@ancestors) operator(<<) ident(ref) - reserved(else) - reserved(if) ident(named) - reserved(return) operator([)ident(indent)operator(,) stringoperator(,) ident(name)operator(,) string)delimiter(')>operator(,) instance_variable(@options)operator([)stringoperator(]) operator(?) ident(ref)operator(.)ident(to_s) operator(:) ident(escape_value)operator(()ident(ref)operator(.)ident(to_s)operator(\))operator(,) stringoperator(,) ident(name)operator(,) string)delimiter(')>operator(,) ident(nl)operator(])operator(.)ident(join)operator(()stringoperator(\)) - reserved(else) - reserved(return) ident(ref)operator(.)ident(to_s) operator(+) ident(nl) - reserved(end) - reserved(end) - - comment(# Unfold hash to array if possible.) - reserved(if) ident(ref)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) operator(&&) operator(!)ident(ref)operator(.)ident(empty?) operator(&&) operator(!)instance_variable(@options)operator([)stringoperator(])operator(.)ident(empty?) operator(&&) ident(indent) operator(!=) string - ident(ref) operator(=) ident(hash_to_array)operator(()ident(name)operator(,) ident(ref)operator(\)) - reserved(end) - - ident(result) operator(=) operator([)operator(]) - reserved(if) ident(ref)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - comment(# Reintermediate grouped values if applicable.) - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - ident(ref)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(if) instance_variable(@options)operator([)stringoperator(])operator(.)ident(has_key?)operator(()ident(key)operator(\)) - ident(ref)operator([)ident(key)operator(]) operator(=) operator({) instance_variable(@options)operator([)stringoperator(])operator([)ident(key)operator(]) operator(=)operator(>) ident(value) operator(}) - reserved(end) - operator(}) - reserved(end) - - ident(nested) operator(=) operator([)operator(]) - ident(text_content) operator(=) pre_constant(nil) - reserved(if) ident(named) - ident(result) operator(<<) ident(indent) operator(<<) string operator(<<) ident(name) - reserved(end) - - reserved(if) operator(!)ident(ref)operator(.)ident(empty?) - ident(ref)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(next) reserved(if) operator(!)ident(key)operator(.)ident(nil?) operator(&&) ident(key)operator([)integer(0)operator(,) integer(1)operator(]) operator(==) string - reserved(if) ident(value)operator(.)ident(nil?) - reserved(unless) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) operator(&&) instance_variable(@options)operator([)stringoperator(])operator(.)ident(nil?) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - ident(value) operator(=) operator({)operator(}) - reserved(end) - - reserved(if) operator(!)ident(scalar)operator(()ident(value)operator(\)) operator(||) instance_variable(@options)operator([)stringoperator(]) - ident(nested) operator(<<) ident(value_to_xml)operator(()ident(value)operator(,) ident(key)operator(,) ident(indent) operator(+) instance_variable(@options)operator([)stringoperator(])operator(\)) - reserved(else) - ident(value) operator(=) ident(value)operator(.)ident(to_s) - ident(value) operator(=) ident(escape_value)operator(()ident(value)operator(\)) reserved(unless) instance_variable(@options)operator([)stringoperator(]) - reserved(if) ident(key) operator(==) instance_variable(@options)operator([)stringoperator(]) - ident(text_content) operator(=) ident(value) - reserved(else) - ident(result) operator(<<) string operator(<<) ident(key) operator(<<) string operator(<<) ident(value) operator(<<) string - reserved(end) - reserved(end) - operator(}) - reserved(else) - ident(text_content) operator(=) string - reserved(end) - - reserved(if) operator(!)ident(nested)operator(.)ident(empty?) operator(||) operator(!)ident(text_content)operator(.)ident(nil?) - reserved(if) ident(named) - ident(result) operator(<<) string)delimiter(')> - reserved(if) operator(!)ident(text_content)operator(.)ident(nil?) - ident(result) operator(<<) ident(text_content) - ident(nested)operator([)integer(0)operator(])operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) reserved(if) operator(!)ident(nested)operator(.)ident(empty?) - reserved(else) - ident(result) operator(<<) ident(nl) - reserved(end) - reserved(if) operator(!)ident(nested)operator(.)ident(empty?) - ident(result) operator(<<) ident(nested) operator(<<) ident(indent) - reserved(end) - ident(result) operator(<<) string operator(<<) ident(name) operator(<<) string)delimiter(')> operator(<<) ident(nl) - reserved(else) - ident(result) operator(<<) ident(nested) - reserved(end) - reserved(else) - ident(result) operator(<<) string)delimiter(')> operator(<<) ident(nl) - reserved(end) - reserved(elsif) ident(ref)operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - ident(ref)operator(.)ident(each) operator({) operator(|)ident(value)operator(|) - reserved(if) ident(scalar)operator(()ident(value)operator(\)) - ident(result) operator(<<) ident(indent) operator(<<) string operator(<<) ident(name) operator(<<) string)delimiter(')> - ident(result) operator(<<) operator(()instance_variable(@options)operator([)stringoperator(]) operator(?) ident(value)operator(.)ident(to_s) operator(:) ident(escape_value)operator(()ident(value)operator(.)ident(to_s)operator(\))operator(\)) - ident(result) operator(<<) string operator(<<) ident(name) operator(<<) string)delimiter(')> operator(<<) ident(nl) - reserved(elsif) ident(value)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - ident(result) operator(<<) ident(value_to_xml)operator(()ident(value)operator(,) ident(name)operator(,) ident(indent)operator(\)) - reserved(else) - ident(result) operator(<<) ident(indent) operator(<<) string operator(<<) ident(name) operator(<<) string)delimiter(')> operator(<<) ident(nl) - ident(result) operator(<<) ident(value_to_xml)operator(()ident(value)operator(,) instance_variable(@options)operator([)stringoperator(])operator(,) ident(indent) operator(+) instance_variable(@options)operator([)stringoperator(])operator(\)) - ident(result) operator(<<) ident(indent) operator(<<) string operator(<<) ident(name) operator(<<) string)delimiter(')> operator(<<) ident(nl) - reserved(end) - operator(}) - reserved(else) - comment(# Probably, this is obsolete.) - ident(raise) constant(ArgumentError)operator(,) stringcontent(.)delimiter(")> - reserved(end) - instance_variable(@ancestors)operator(.)ident(pop) reserved(if) operator(!)ident(scalar)operator(()ident(ref)operator(\)) - ident(result)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - comment(# Checks, if a certain value is a "scalar" value. Whatever) - comment(# that will be in Ruby ... ;-\)) - comment(# ) - comment(# value::) - comment(# Value to be checked.) - reserved(def) method(scalar)operator(()ident(value)operator(\)) - reserved(return) pre_constant(false) reserved(if) ident(value)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) operator(||) ident(value)operator(.)ident(instance_of?)operator(()constant(Array)operator(\)) - reserved(return) pre_constant(true) - reserved(end) - - comment(# Attempts to unfold a hash of hashes into an array of hashes. Returns) - comment(# a reference to th array on success or the original hash, if unfolding) - comment(# is not possible.) - comment(# ) - comment(# parent::) - comment(# ) - comment(# hashref::) - comment(# Reference to the hash to be unfolded.) - reserved(def) method(hash_to_array)operator(()ident(parent)operator(,) ident(hashref)operator(\)) - ident(arrayref) operator(=) operator([)operator(]) - ident(hashref)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(return) ident(hashref) reserved(unless) ident(value)operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - - reserved(if) instance_variable(@options)operator([)stringoperator(])operator(.)ident(instance_of?)operator(()constant(Hash)operator(\)) - reserved(return) ident(hashref) reserved(unless) instance_variable(@options)operator([)stringoperator(])operator(.)ident(has_key?)operator(()ident(parent)operator(\)) - ident(arrayref) operator(<<) operator({) instance_variable(@options)operator([)stringoperator(])operator([)ident(parent)operator(])operator([)integer(0)operator(]) operator(=)operator(>) ident(key) operator(})operator(.)ident(update)operator(()ident(value)operator(\)) - reserved(else) - ident(arrayref) operator(<<) operator({) instance_variable(@options)operator([)stringoperator(])operator([)integer(0)operator(]) operator(=)operator(>) ident(key) operator(})operator(.)ident(update)operator(()ident(value)operator(\)) - reserved(end) - operator(}) - ident(arrayref) - reserved(end) - - comment(# Replaces XML markup characters by their external entities.) - comment(#) - comment(# data::) - comment(# The string to be escaped.) - reserved(def) method(escape_value)operator(()ident(data)operator(\)) - reserved(return) ident(data) reserved(if) ident(data)operator(.)ident(nil?) operator(||) ident(data) operator(==) string - ident(result) operator(=) ident(data)operator(.)ident(dup) - ident(result)operator(.)ident(gsub!)operator(()stringoperator(,) stringoperator(\)) - ident(result)operator(.)ident(gsub!)operator(()stringoperator(,) stringoperator(\)) - ident(result)operator(.)ident(gsub!)operator(()string)delimiter(')>operator(,) stringoperator(\)) - ident(result)operator(.)ident(gsub!)operator(()stringoperator(,) stringoperator(\)) - ident(result)operator(.)ident(gsub!)operator(()stringoperator(,) stringoperator(\)) - ident(result) - reserved(end) - - comment(# Removes leading and trailing whitespace and sequences of) - comment(# whitespaces from a string.) - comment(#) - comment(# text::) - comment(# String to be normalised.) - reserved(def) method(normalise_space)operator(()ident(text)operator(\)) - ident(text)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(text)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(text)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - ident(text) - reserved(end) - - comment(# Checks, if an object is nil, an empty String or an empty Hash.) - comment(# Thanks to Norbert Gawor for a bugfix.) - comment(#) - comment(# value::) - comment(# Value to be checked for emptyness.) - reserved(def) method(empty)operator(()ident(value)operator(\)) - reserved(case) ident(value) - reserved(when) constant(Hash) - reserved(return) ident(value)operator(.)ident(empty?) - reserved(when) constant(String) - reserved(return) ident(value) operator(!)operator(~) regexp - reserved(else) - reserved(return) ident(value)operator(.)ident(nil?) - reserved(end) - reserved(end) - - comment(# Converts a document node into a String.) - comment(# If the node could not be converted into a String) - comment(# for any reason, default will be returned.) - comment(#) - comment(# node::) - comment(# Document node to be converted.) - comment(# default::) - comment(# Value to be returned, if node could not be converted.) - reserved(def) method(node_to_text)operator(()ident(node)operator(,) ident(default) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(node)operator(.)ident(instance_of?)operator(()constant(Element)operator(\)) - reserved(return) ident(node)operator(.)ident(texts)operator(.)ident(join)operator(()stringoperator(\)) - reserved(elsif) ident(node)operator(.)ident(instance_of?)operator(()constant(Attribute)operator(\)) - reserved(return) ident(node)operator(.)ident(value)operator(.)ident(nil?) operator(?) ident(default) operator(:) ident(node)operator(.)ident(value)operator(.)ident(strip) - reserved(elsif) ident(node)operator(.)ident(instance_of?)operator(()constant(Text)operator(\)) - reserved(return) ident(node)operator(.)ident(to_s)operator(.)ident(strip) - reserved(else) - reserved(return) ident(default) - reserved(end) - reserved(end) - - comment(# Parses an XML string and returns the according document.) - comment(#) - comment(# xml_string::) - comment(# XML string to be parsed.) - comment(#) - comment(# The following exception may be raised:) - comment(#) - comment(# REXML::ParseException::) - comment(# If the specified file is not wellformed.) - reserved(def) method(parse)operator(()ident(xml_string)operator(\)) - constant(Document)operator(.)ident(new)operator(()ident(xml_string)operator(\)) - reserved(end) - - comment(# Searches in a list of paths for a certain file. Returns) - comment(# the full path to the file, if it could be found. Otherwise,) - comment(# an exception will be raised.) - comment(#) - comment(# filename::) - comment(# Name of the file to search for.) - comment(# searchpath::) - comment(# List of paths to search in.) - reserved(def) method(find_xml_file)operator(()ident(file)operator(,) ident(searchpath)operator(\)) - ident(filename) operator(=) constant(File)operator(::)ident(basename)operator(()ident(file)operator(\)) - - reserved(if) ident(filename) operator(!=) ident(file) - reserved(return) ident(file) reserved(if) constant(File)operator(::)ident(file?)operator(()ident(file)operator(\)) - reserved(else) - ident(searchpath)operator(.)ident(each) operator({) operator(|)ident(path)operator(|) - ident(full_path) operator(=) constant(File)operator(::)ident(join)operator(()ident(path)operator(,) ident(filename)operator(\)) - reserved(return) ident(full_path) reserved(if) constant(File)operator(::)ident(file?)operator(()ident(full_path)operator(\)) - operator(}) - reserved(end) - - reserved(if) ident(searchpath)operator(.)ident(empty?) - reserved(return) ident(file) reserved(if) constant(File)operator(::)ident(file?)operator(()ident(file)operator(\)) - ident(raise) constant(ArgumentError)operator(,) stringcontent(.)delimiter(")> - reserved(end) - ident(raise) constant(ArgumentError)operator(,) stringcontent(> in <)inlineoperator(\))inline_delimiter(})>content(>)delimiter(")> - reserved(end) - - comment(# Loads and parses an XML configuration file.) - comment(#) - comment(# filename::) - comment(# Name of the configuration file to be loaded.) - comment(#) - comment(# The following exceptions may be raised:) - comment(# ) - comment(# Errno::ENOENT::) - comment(# If the specified file does not exist.) - comment(# REXML::ParseException::) - comment(# If the specified file is not wellformed.) - reserved(def) method(load_xml_file)operator(()ident(filename)operator(\)) - ident(parse)operator(()constant(File)operator(.)ident(readlines)operator(()ident(filename)operator(\))operator(.)ident(to_s)operator(\)) - reserved(end) - - comment(# Caches the data belonging to a certain file.) - comment(#) - comment(# data::) - comment(# Data to be cached.) - comment(# filename::) - comment(# Name of file the data was read from.) - reserved(def) method(put_into_cache)operator(()ident(data)operator(,) ident(filename)operator(\)) - reserved(if) instance_variable(@options)operator(.)ident(has_key?)operator(()stringoperator(\)) - instance_variable(@options)operator([)stringoperator(])operator(.)ident(each) operator({) operator(|)ident(scheme)operator(|) - reserved(case)operator(()ident(scheme)operator(\)) - reserved(when) string - class_variable(@@cache)operator(.)ident(save_storable)operator(()ident(data)operator(,) ident(filename)operator(\)) - reserved(when) string - class_variable(@@cache)operator(.)ident(save_mem_share)operator(()ident(data)operator(,) ident(filename)operator(\)) - reserved(when) string - class_variable(@@cache)operator(.)ident(save_mem_copy)operator(()ident(data)operator(,) ident(filename)operator(\)) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) stringcontent(>.)delimiter(")> - reserved(end) - operator(}) - reserved(end) - reserved(end) -reserved(end) - -comment(# vim:sw=2) -reserved(module) class(ActionController) comment(#:nodoc:) - reserved(module) class(Verification) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - comment(# This module provides a class-level method for specifying that certain) - comment(# actions are guarded against being called without certain prerequisites) - comment(# being met. This is essentially a special kind of before_filter.) - comment(#) - comment(# An action may be guarded against being invoked without certain request) - comment(# parameters being set, or without certain session values existing.) - comment(#) - comment(# When a verification is violated, values may be inserted into the flash, and) - comment(# a specified redirection is triggered.) - comment(#) - comment(# Usage:) - comment(#) - comment(# class GlobalController < ActionController::Base) - comment(# # prevent the #update_settings action from being invoked unless) - comment(# # the 'admin_privileges' request parameter exists.) - comment(# verify :params => "admin_privileges", :only => :update_post,) - comment(# :redirect_to => { :action => "settings" }) - comment(#) - comment(# # disallow a post from being updated if there was no information) - comment(# # submitted with the post, and if there is no active post in the) - comment(# # session, and if there is no "note" key in the flash.) - comment(# verify :params => "post", :session => "post", "flash" => "note",) - comment(# :only => :update_post,) - comment(# :add_flash => { "alert" => "Failed to create your message" },) - comment(# :redirect_to => :category_url) - comment(#) - reserved(module) class(ClassMethods) - comment(# Verify the given actions so that if certain prerequisites are not met,) - comment(# the user is redirected to a different action. The +options+ parameter) - comment(# is a hash consisting of the following key/value pairs:) - comment(#) - comment(# * :params: a single key or an array of keys that must) - comment(# be in the params hash in order for the action(s\) to be safely) - comment(# called.) - comment(# * :session: a single key or an array of keys that must) - comment(# be in the @session in order for the action(s\) to be safely called.) - comment(# * :flash: a single key or an array of keys that must) - comment(# be in the flash in order for the action(s\) to be safely called.) - comment(# * :method: a single key or an array of keys--any one of which) - comment(# must match the current request method in order for the action(s\) to) - comment(# be safely called. (The key should be a symbol: :get or) - comment(# :post, for example.\)) - comment(# * :xhr: true/false option to ensure that the request is coming) - comment(# from an Ajax call or not. ) - comment(# * :add_flash: a hash of name/value pairs that should be merged) - comment(# into the session's flash if the prerequisites cannot be satisfied.) - comment(# * :redirect_to: the redirection parameters to be used when) - comment(# redirecting if the prerequisites cannot be satisfied.) - comment(# * :render: the render parameters to be used when) - comment(# the prerequisites cannot be satisfied.) - comment(# * :only: only apply this verification to the actions specified) - comment(# in the associated array (may also be a single value\).) - comment(# * :except: do not apply this verification to the actions) - comment(# specified in the associated array (may also be a single value\).) - reserved(def) method(verify)operator(()ident(options)operator(=)operator({)operator(})operator(\)) - ident(filter_opts) operator(=) operator({) symbol(:only) operator(=)operator(>) ident(options)operator([)symbol(:only)operator(])operator(,) symbol(:except) operator(=)operator(>) ident(options)operator([)symbol(:except)operator(]) operator(}) - ident(before_filter)operator(()ident(filter_opts)operator(\)) reserved(do) operator(|)ident(c)operator(|) - ident(c)operator(.)ident(send) symbol(:verify_action)operator(,) ident(options) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(verify_action)operator(()ident(options)operator(\)) comment(#:nodoc:) - ident(prereqs_invalid) operator(=) - operator([)operator(*)ident(options)operator([)symbol(:params)operator(]) operator(])operator(.)ident(find) operator({) operator(|)ident(v)operator(|) instance_variable(@params)operator([)ident(v)operator(])operator(.)ident(nil?) operator(}) operator(||) - operator([)operator(*)ident(options)operator([)symbol(:session)operator(])operator(])operator(.)ident(find) operator({) operator(|)ident(v)operator(|) instance_variable(@session)operator([)ident(v)operator(])operator(.)ident(nil?) operator(}) operator(||) - operator([)operator(*)ident(options)operator([)symbol(:flash)operator(]) operator(])operator(.)ident(find) operator({) operator(|)ident(v)operator(|) ident(flash)operator([)ident(v)operator(])operator(.)ident(nil?) operator(}) - - reserved(if) operator(!)ident(prereqs_invalid) operator(&&) ident(options)operator([)symbol(:method)operator(]) - ident(prereqs_invalid) operator(||=) - operator([)operator(*)ident(options)operator([)symbol(:method)operator(])operator(])operator(.)ident(all?) operator({) operator(|)ident(v)operator(|) instance_variable(@request)operator(.)ident(method) operator(!=) ident(v)operator(.)ident(to_sym) operator(}) - reserved(end) - - ident(prereqs_invalid) operator(||=) operator(()ident(request)operator(.)ident(xhr?) operator(!=) ident(options)operator([)symbol(:xhr)operator(])operator(\)) reserved(unless) ident(options)operator([)symbol(:xhr)operator(])operator(.)ident(nil?) - - reserved(if) ident(prereqs_invalid) - ident(flash)operator(.)ident(update)operator(()ident(options)operator([)symbol(:add_flash)operator(])operator(\)) reserved(if) ident(options)operator([)symbol(:add_flash)operator(]) - reserved(unless) ident(performed?) - ident(render)operator(()ident(options)operator([)symbol(:render)operator(])operator(\)) reserved(if) ident(options)operator([)symbol(:render)operator(]) - ident(redirect_to)operator(()ident(options)operator([)symbol(:redirect_to)operator(])operator(\)) reserved(if) ident(options)operator([)symbol(:redirect_to)operator(]) - reserved(end) - reserved(return) pre_constant(false) - reserved(end) - - pre_constant(true) - reserved(end) - ident(private) symbol(:verify_action) - reserved(end) -reserved(end) -comment(#--) -comment(# Copyright (c\) 2004 David Heinemeier Hansson) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#++) - -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(\)) reserved(unless) - global_variable($:)operator(.)ident(include?)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(\)) operator(||) global_variable($:)operator(.)ident(include?)operator(()constant(File)operator(.)ident(expand_path)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(\))operator(\)) - -reserved(unless) reserved(defined?)operator(()constant(ActiveSupport)operator(\)) - reserved(begin) - global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(require) string - reserved(rescue) constant(LoadError) - ident(require) string - ident(require_gem) string - reserved(end) -reserved(end) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -ident(require) string -constant(ActionController)operator(::)constant(Base)operator(.)ident(template_class) operator(=) constant(ActionView)operator(::)constant(Base) - -constant(ActionController)operator(::)constant(Base)operator(.)ident(class_eval) reserved(do) - ident(include) constant(ActionController)operator(::)constant(Flash) - ident(include) constant(ActionController)operator(::)constant(Filters) - ident(include) constant(ActionController)operator(::)constant(Layout) - ident(include) constant(ActionController)operator(::)constant(Benchmarking) - ident(include) constant(ActionController)operator(::)constant(Rescue) - ident(include) constant(ActionController)operator(::)constant(Dependencies) - ident(include) constant(ActionController)operator(::)constant(MimeResponds) - ident(include) constant(ActionController)operator(::)constant(Pagination) - ident(include) constant(ActionController)operator(::)constant(Scaffolding) - ident(include) constant(ActionController)operator(::)constant(Helpers) - ident(include) constant(ActionController)operator(::)constant(Cookies) - ident(include) constant(ActionController)operator(::)constant(Caching) - ident(include) constant(ActionController)operator(::)constant(Verification) - ident(include) constant(ActionController)operator(::)constant(Streaming) - ident(include) constant(ActionController)operator(::)constant(SessionManagement) - ident(include) constant(ActionController)operator(::)constant(Components) - ident(include) constant(ActionController)operator(::)constant(Macros)operator(::)constant(AutoComplete) - ident(include) constant(ActionController)operator(::)constant(Macros)operator(::)constant(InPlaceEditing) -reserved(end) -reserved(module) class(ActionPack) comment(#:nodoc:) - reserved(module) class(VERSION) comment(#:nodoc:) - constant(MAJOR) operator(=) integer(1) - constant(MINOR) operator(=) integer(12) - constant(TINY) operator(=) integer(5) - - constant(STRING) operator(=) operator([)constant(MAJOR)operator(,) constant(MINOR)operator(,) constant(TINY)operator(])operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) -reserved(end) -comment(#--) -comment(# Copyright (c\) 2004 David Heinemeier Hansson) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#++) - -ident(require) string -ident(require) string - -reserved(module) class(ActionView) comment(#:nodoc:) - - reserved(class) class(ActionViewError) operator(<) constant(StandardError) comment(#:nodoc:) - reserved(end) - - comment(# Action View templates can be written in three ways. If the template file has a +.rhtml+ extension then it uses a mixture of ERb ) - comment(# (included in Ruby\) and HTML. If the template file has a +.rxml+ extension then Jim Weirich's Builder::XmlMarkup library is used. ) - comment(# If the template file has a +.rjs+ extension then it will use ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.) - comment(# ) - comment(# = ERb) - comment(# ) - comment(# You trigger ERb by using embeddings such as <% %>, <% -%>, and <%= %>. The <%= %> tag set is used when you want output. Consider the ) - comment(# following loop for names:) - comment(#) - comment(# Names of all the people) - comment(# <% for person in @people %>) - comment(# Name: <%= person.name %>
) - comment(# <% end %>) - comment(#) - comment(# The loop is setup in regular embedding tags <% %> and the name is written using the output embedding tag <%= %>. Note that this) - comment(# is not just a usage suggestion. Regular output functions like print or puts won't work with ERb templates. So this would be wrong:) - comment(#) - comment(# Hi, Mr. <% puts "Frodo" %>) - comment(#) - comment(# If you absolutely must write from within a function, you can use the TextHelper#concat) - comment(#) - comment(# <%- and -%> suppress leading and trailing whitespace, including the trailing newline, and can be used interchangeably with <% and %>.) - comment(#) - comment(# == Using sub templates) - comment(#) - comment(# Using sub templates allows you to sidestep tedious replication and extract common display structures in shared templates. The) - comment(# classic example is the use of a header and footer (even though the Action Pack-way would be to use Layouts\):) - comment(#) - comment(# <%= render "shared/header" %>) - comment(# Something really specific and terrific) - comment(# <%= render "shared/footer" %>) - comment(#) - comment(# As you see, we use the output embeddings for the render methods. The render call itself will just return a string holding the) - comment(# result of the rendering. The output embedding writes it to the current template.) - comment(#) - comment(# But you don't have to restrict yourself to static includes. Templates can share variables amongst themselves by using instance) - comment(# variables defined using the regular embedding tags. Like this:) - comment(#) - comment(# <% @page_title = "A Wonderful Hello" %>) - comment(# <%= render "shared/header" %>) - comment(#) - comment(# Now the header can pick up on the @page_title variable and use it for outputting a title tag:) - comment(#) - comment(# <%= @page_title %>) - comment(#) - comment(# == Passing local variables to sub templates) - comment(# ) - comment(# You can pass local variables to sub templates by using a hash with the variable names as keys and the objects as values:) - comment(#) - comment(# <%= render "shared/header", { "headline" => "Welcome", "person" => person } %>) - comment(#) - comment(# These can now be accessed in shared/header with:) - comment(#) - comment(# Headline: <%= headline %>) - comment(# First name: <%= person.first_name %>) - comment(#) - comment(# == Template caching) - comment(#) - comment(# By default, Rails will compile each template to a method in order to render it. When you alter a template, Rails will) - comment(# check the file's modification time and recompile it.) - comment(#) - comment(# == Builder) - comment(#) - comment(# Builder templates are a more programmatic alternative to ERb. They are especially useful for generating XML content. An +XmlMarkup+ object ) - comment(# named +xml+ is automatically made available to templates with a +.rxml+ extension. ) - comment(#) - comment(# Here are some basic examples:) - comment(#) - comment(# xml.em("emphasized"\) # => emphasized) - comment(# xml.em { xml.b("emp & bold"\) } # => emph & bold) - comment(# xml.a("A Link", "href"=>"http://onestepback.org"\) # => A Link) - comment(# xml.target("name"=>"compile", "option"=>"fast"\) # => ) - comment(# # NOTE: order of attributes is not specified.) - comment(# ) - comment(# Any method with a block will be treated as an XML markup tag with nested markup in the block. For example, the following:) - comment(#) - comment(# xml.div {) - comment(# xml.h1(@person.name\)) - comment(# xml.p(@person.bio\)) - comment(# }) - comment(#) - comment(# would produce something like:) - comment(#) - comment(#
) - comment(#

David Heinemeier Hansson

) - comment(#

A product of Danish Design during the Winter of '79...

) - comment(#
) - comment(#) - comment(# A full-length RSS example actually used on Basecamp:) - comment(#) - comment(# xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/"\) do) - comment(# xml.channel do) - comment(# xml.title(@feed_title\)) - comment(# xml.link(@url\)) - comment(# xml.description "Basecamp: Recent items") - comment(# xml.language "en-us") - comment(# xml.ttl "40") - comment(# ) - comment(# for item in @recent_items) - comment(# xml.item do) - comment(# xml.title(item_title(item\)\)) - comment(# xml.description(item_description(item\)\) if item_description(item\)) - comment(# xml.pubDate(item_pubDate(item\)\)) - comment(# xml.guid(@person.firm.account.url + @recent_items.url(item\)\)) - comment(# xml.link(@person.firm.account.url + @recent_items.url(item\)\)) - comment(# ) - comment(# xml.tag!("dc:creator", item.author_name\) if item_has_creator?(item\)) - comment(# end) - comment(# end) - comment(# end) - comment(# end) - comment(#) - comment(# More builder documentation can be found at http://builder.rubyforge.org.) - comment(#) - comment(# == JavaScriptGenerator) - comment(#) - comment(# JavaScriptGenerator templates end in +.rjs+. Unlike conventional templates which are used to ) - comment(# render the results of an action, these templates generate instructions on how to modify an already rendered page. This makes it easy to ) - comment(# modify multiple elements on your page in one declarative Ajax response. Actions with these templates are called in the background with Ajax ) - comment(# and make updates to the page where the request originated from.) - comment(# ) - comment(# An instance of the JavaScriptGenerator object named +page+ is automatically made available to your template, which is implicitly wrapped in an ActionView::Helpers::PrototypeHelper#update_page block. ) - comment(#) - comment(# When an .rjs action is called with +link_to_remote+, the generated JavaScript is automatically evaluated. Example:) - comment(#) - comment(# link_to_remote :url => {:action => 'delete'}) - comment(#) - comment(# The subsequently rendered +delete.rjs+ might look like:) - comment(#) - comment(# page.replace_html 'sidebar', :partial => 'sidebar') - comment(# page.remove "person-#{@person.id}") - comment(# page.visual_effect :highlight, 'user-list' ) - comment(#) - comment(# This refreshes the sidebar, removes a person element and highlights the user list.) - comment(# ) - comment(# See the ActionView::Helpers::PrototypeHelper::JavaScriptGenerator documentation for more details.) - reserved(class) class(Base) - ident(include) constant(ERB)operator(::)constant(Util) - - ident(attr_reader) symbol(:first_render) - ident(attr_accessor) symbol(:base_path)operator(,) symbol(:assigns)operator(,) symbol(:template_extension) - ident(attr_accessor) symbol(:controller) - - ident(attr_reader) symbol(:logger)operator(,) symbol(:params)operator(,) symbol(:request)operator(,) symbol(:response)operator(,) symbol(:session)operator(,) symbol(:headers)operator(,) symbol(:flash) - - comment(# Specify trim mode for the ERB compiler. Defaults to '-'.) - comment(# See ERB documentation for suitable values.) - class_variable(@@erb_trim_mode) operator(=) string - ident(cattr_accessor) symbol(:erb_trim_mode) - - comment(# Specify whether file modification times should be checked to see if a template needs recompilation) - class_variable(@@cache_template_loading) operator(=) pre_constant(false) - ident(cattr_accessor) symbol(:cache_template_loading) - - comment(# Specify whether file extension lookup should be cached.) - comment(# Should be +false+ for development environments. Defaults to +true+.) - class_variable(@@cache_template_extensions) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:cache_template_extensions) - - comment(# Specify whether local_assigns should be able to use string keys.) - comment(# Defaults to +true+. String keys are deprecated and will be removed) - comment(# shortly.) - class_variable(@@local_assigns_support_string_keys) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:local_assigns_support_string_keys) - - comment(# Specify whether RJS responses should be wrapped in a try/catch block) - comment(# that alert(\)s the caught exception (and then re-raises it\). ) - class_variable(@@debug_rjs) operator(=) pre_constant(false) - ident(cattr_accessor) symbol(:debug_rjs) - - class_variable(@@template_handlers) operator(=) constant(HashWithIndifferentAccess)operator(.)ident(new) - - reserved(module) class(CompiledTemplates) comment(#:nodoc:) - comment(# holds compiled template code) - reserved(end) - ident(include) constant(CompiledTemplates) - - comment(# maps inline templates to their method names ) - class_variable(@@method_names) operator(=) operator({)operator(}) - comment(# map method names to their compile time) - class_variable(@@compile_time) operator(=) operator({)operator(}) - comment(# map method names to the names passed in local assigns so far) - class_variable(@@template_args) operator(=) operator({)operator(}) - comment(# count the number of inline templates) - class_variable(@@inline_template_count) operator(=) integer(0) - comment(# maps template paths without extension to their file extension returned by pick_template_extension.) - comment(# if for a given path, path.ext1 and path.ext2 exist on the file system, the order of extensions) - comment(# used by pick_template_extension determines whether ext1 or ext2 will be stored) - class_variable(@@cached_template_extension) operator(=) operator({)operator(}) - - reserved(class) class(ObjectWrapper) operator(<) constant(Struct)operator(.)ident(new)operator(()symbol(:value)operator(\)) comment(#:nodoc:) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(load_helpers)operator(()ident(helper_dir)operator(\))comment(#:nodoc:) - constant(Dir)operator(.)ident(foreach)operator(()ident(helper_dir)operator(\)) reserved(do) operator(|)ident(helper_file)operator(|) - reserved(next) reserved(unless) ident(helper_file) operator(=)operator(~) regexp - ident(require) constant(File)operator(.)ident(join)operator(()ident(helper_dir)operator(,) global_variable($1)operator(\)) - ident(helper_module_name) operator(=) global_variable($1)operator(.)ident(camelize) - ident(class_eval)operator(()stringdelimiter(")>operator(\)) reserved(if) constant(Helpers)operator(.)ident(const_defined?)operator(()ident(helper_module_name)operator(\)) - reserved(end) - reserved(end) - - comment(# Register a class that knows how to handle template files with the given) - comment(# extension. This can be used to implement new template types.) - comment(# The constructor for the class must take the ActiveView::Base instance) - comment(# as a parameter, and the class must implement a #render method that) - comment(# takes the contents of the template to render as well as the Hash of) - comment(# local assigns available to the template. The #render method ought to) - comment(# return the rendered template as a string.) - reserved(def) pre_constant(self)operator(.)method(register_template_handler)operator(()ident(extension)operator(,) ident(klass)operator(\)) - class_variable(@@template_handlers)operator([)ident(extension)operator(]) operator(=) ident(klass) - reserved(end) - - reserved(def) method(initialize)operator(()ident(base_path) operator(=) pre_constant(nil)operator(,) ident(assigns_for_first_render) operator(=) operator({)operator(})operator(,) ident(controller) operator(=) pre_constant(nil)operator(\))comment(#:nodoc:) - instance_variable(@base_path)operator(,) instance_variable(@assigns) operator(=) ident(base_path)operator(,) ident(assigns_for_first_render) - instance_variable(@assigns_added) operator(=) pre_constant(nil) - instance_variable(@controller) operator(=) ident(controller) - instance_variable(@logger) operator(=) ident(controller) operator(&&) ident(controller)operator(.)ident(logger) - reserved(end) - - comment(# Renders the template present at template_path. If use_full_path is set to true, ) - comment(# it's relative to the template_root, otherwise it's absolute. The hash in local_assigns ) - comment(# is made available as local variables.) - reserved(def) method(render_file)operator(()ident(template_path)operator(,) ident(use_full_path) operator(=) pre_constant(true)operator(,) ident(local_assigns) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - instance_variable(@first_render) operator(||=) ident(template_path) - - reserved(if) ident(use_full_path) - ident(template_path_without_extension)operator(,) ident(template_extension) operator(=) ident(path_and_extension)operator(()ident(template_path)operator(\)) - - reserved(if) ident(template_extension) - ident(template_file_name) operator(=) ident(full_template_path)operator(()ident(template_path_without_extension)operator(,) ident(template_extension)operator(\)) - reserved(else) - ident(template_extension) operator(=) ident(pick_template_extension)operator(()ident(template_path)operator(\))operator(.)ident(to_s) - ident(template_file_name) operator(=) ident(full_template_path)operator(()ident(template_path)operator(,) ident(template_extension)operator(\)) - reserved(end) - reserved(else) - ident(template_file_name) operator(=) ident(template_path) - ident(template_extension) operator(=) ident(template_path)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last) - reserved(end) - - ident(template_source) operator(=) pre_constant(nil) comment(# Don't read the source until we know that it is required) - - reserved(begin) - ident(render_template)operator(()ident(template_extension)operator(,) ident(template_source)operator(,) ident(template_file_name)operator(,) ident(local_assigns)operator(\)) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - reserved(if) constant(TemplateError) operator(===) ident(e) - ident(e)operator(.)ident(sub_template_of)operator(()ident(template_file_name)operator(\)) - ident(raise) ident(e) - reserved(else) - ident(raise) constant(TemplateError)operator(.)ident(new)operator(()instance_variable(@base_path)operator(,) ident(template_file_name)operator(,) instance_variable(@assigns)operator(,) ident(template_source)operator(,) ident(e)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Renders the template present at template_path (relative to the template_root\). ) - comment(# The hash in local_assigns is made available as local variables.) - reserved(def) method(render)operator(()ident(options) operator(=) operator({)operator(})operator(,) ident(old_local_assigns) operator(=) operator({)operator(})operator(,) operator(&)ident(block)operator(\)) comment(#:nodoc:) - reserved(if) ident(options)operator(.)ident(is_a?)operator(()constant(String)operator(\)) - ident(render_file)operator(()ident(options)operator(,) pre_constant(true)operator(,) ident(old_local_assigns)operator(\)) - reserved(elsif) ident(options) operator(==) symbol(:update) - ident(update_page)operator(()operator(&)ident(block)operator(\)) - reserved(elsif) ident(options)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(options)operator([)symbol(:locals)operator(]) operator(||=) operator({)operator(}) - ident(options)operator([)symbol(:use_full_path)operator(]) operator(=) ident(options)operator([)symbol(:use_full_path)operator(])operator(.)ident(nil?) operator(?) pre_constant(true) operator(:) ident(options)operator([)symbol(:use_full_path)operator(]) - - reserved(if) ident(options)operator([)symbol(:file)operator(]) - ident(render_file)operator(()ident(options)operator([)symbol(:file)operator(])operator(,) ident(options)operator([)symbol(:use_full_path)operator(])operator(,) ident(options)operator([)symbol(:locals)operator(])operator(\)) - reserved(elsif) ident(options)operator([)symbol(:partial)operator(]) operator(&&) ident(options)operator([)symbol(:collection)operator(]) - ident(render_partial_collection)operator(()ident(options)operator([)symbol(:partial)operator(])operator(,) ident(options)operator([)symbol(:collection)operator(])operator(,) ident(options)operator([)symbol(:spacer_template)operator(])operator(,) ident(options)operator([)symbol(:locals)operator(])operator(\)) - reserved(elsif) ident(options)operator([)symbol(:partial)operator(]) - ident(render_partial)operator(()ident(options)operator([)symbol(:partial)operator(])operator(,) constant(ActionView)operator(::)constant(Base)operator(::)constant(ObjectWrapper)operator(.)ident(new)operator(()ident(options)operator([)symbol(:object)operator(])operator(\))operator(,) ident(options)operator([)symbol(:locals)operator(])operator(\)) - reserved(elsif) ident(options)operator([)symbol(:inline)operator(]) - ident(render_template)operator(()ident(options)operator([)symbol(:type)operator(]) operator(||) symbol(:rhtml)operator(,) ident(options)operator([)symbol(:inline)operator(])operator(,) pre_constant(nil)operator(,) ident(options)operator([)symbol(:locals)operator(]) operator(||) operator({)operator(})operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Renders the +template+ which is given as a string as either rhtml or rxml depending on template_extension.) - comment(# The hash in local_assigns is made available as local variables.) - reserved(def) method(render_template)operator(()ident(template_extension)operator(,) ident(template)operator(,) ident(file_path) operator(=) pre_constant(nil)operator(,) ident(local_assigns) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - reserved(if) ident(handler) operator(=) class_variable(@@template_handlers)operator([)ident(template_extension)operator(]) - ident(template) operator(||=) ident(read_template_file)operator(()ident(file_path)operator(,) ident(template_extension)operator(\)) comment(# Make sure that a lazyily-read template is loaded.) - ident(delegate_render)operator(()ident(handler)operator(,) ident(template)operator(,) ident(local_assigns)operator(\)) - reserved(else) - ident(compile_and_render_template)operator(()ident(template_extension)operator(,) ident(template)operator(,) ident(file_path)operator(,) ident(local_assigns)operator(\)) - reserved(end) - reserved(end) - - comment(# Render the provided template with the given local assigns. If the template has not been rendered with the provided) - comment(# local assigns yet, or if the template has been updated on disk, then the template will be compiled to a method.) - comment(#) - - comment(# Either, but not both, of template and file_path may be nil. If file_path is given, the template) - comment(# will only be read if it has to be compiled.) - comment(#) - reserved(def) method(compile_and_render_template)operator(()ident(extension)operator(,) ident(template) operator(=) pre_constant(nil)operator(,) ident(file_path) operator(=) pre_constant(nil)operator(,) ident(local_assigns) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - comment(# compile the given template, if necessary) - reserved(if) ident(compile_template?)operator(()ident(template)operator(,) ident(file_path)operator(,) ident(local_assigns)operator(\)) - ident(template) operator(||=) ident(read_template_file)operator(()ident(file_path)operator(,) ident(extension)operator(\)) - ident(compile_template)operator(()ident(extension)operator(,) ident(template)operator(,) ident(file_path)operator(,) ident(local_assigns)operator(\)) - reserved(end) - - comment(# Get the method name for this template and run it) - ident(method_name) operator(=) class_variable(@@method_names)operator([)ident(file_path) operator(||) ident(template)operator(]) - ident(evaluate_assigns) - - ident(local_assigns) operator(=) ident(local_assigns)operator(.)ident(symbolize_keys) reserved(if) class_variable(@@local_assigns_support_string_keys) - - ident(send)operator(()ident(method_name)operator(,) ident(local_assigns)operator(\)) reserved(do) operator(|*)ident(name)operator(|) - ident(instance_variable_get) stringinline_delimiter(})>delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(pick_template_extension)operator(()ident(template_path)operator(\))comment(#:nodoc:) - reserved(if) class_variable(@@cache_template_extensions) - class_variable(@@cached_template_extension)operator([)ident(template_path)operator(]) operator(||=) ident(find_template_extension_for)operator(()ident(template_path)operator(\)) - reserved(else) - ident(find_template_extension_for)operator(()ident(template_path)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(delegate_template_exists?)operator(()ident(template_path)operator(\))comment(#:nodoc:) - class_variable(@@template_handlers)operator(.)ident(find) operator({) operator(|)ident(k)operator(,)operator(|) ident(template_exists?)operator(()ident(template_path)operator(,) ident(k)operator(\)) operator(}) - reserved(end) - - reserved(def) method(erb_template_exists?)operator(()ident(template_path)operator(\))comment(#:nodoc:) - ident(template_exists?)operator(()ident(template_path)operator(,) symbol(:rhtml)operator(\)) - reserved(end) - - reserved(def) method(builder_template_exists?)operator(()ident(template_path)operator(\))comment(#:nodoc:) - ident(template_exists?)operator(()ident(template_path)operator(,) symbol(:rxml)operator(\)) - reserved(end) - - reserved(def) method(javascript_template_exists?)operator(()ident(template_path)operator(\))comment(#:nodoc:) - ident(template_exists?)operator(()ident(template_path)operator(,) symbol(:rjs)operator(\)) - reserved(end) - - reserved(def) method(file_exists?)operator(()ident(template_path)operator(\))comment(#:nodoc:) - ident(template_file_name)operator(,) ident(template_file_extension) operator(=) ident(path_and_extension)operator(()ident(template_path)operator(\)) - - reserved(if) ident(template_file_extension) - ident(template_exists?)operator(()ident(template_file_name)operator(,) ident(template_file_extension)operator(\)) - reserved(else) - ident(cached_template_extension)operator(()ident(template_path)operator(\)) operator(||) - stringoperator(.)ident(any?) reserved(do) operator(|)ident(template_type)operator(|) - ident(send)operator(()stringcontent(_template_exists?)delimiter(")>operator(,) ident(template_path)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Returns true is the file may be rendered implicitly.) - reserved(def) method(file_public?)operator(()ident(template_path)operator(\))comment(#:nodoc:) - ident(template_path)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last)operator([)integer(0)operator(,)integer(1)operator(]) operator(!=) string - reserved(end) - - ident(private) - reserved(def) method(full_template_path)operator(()ident(template_path)operator(,) ident(extension)operator(\)) - stringcontent(/)inlinecontent(.)inlinedelimiter(")> - reserved(end) - - reserved(def) method(template_exists?)operator(()ident(template_path)operator(,) ident(extension)operator(\)) - ident(file_path) operator(=) ident(full_template_path)operator(()ident(template_path)operator(,) ident(extension)operator(\)) - class_variable(@@method_names)operator(.)ident(has_key?)operator(()ident(file_path)operator(\)) operator(||) constant(FileTest)operator(.)ident(exists?)operator(()ident(file_path)operator(\)) - reserved(end) - - reserved(def) method(path_and_extension)operator(()ident(template_path)operator(\)) - ident(template_path_without_extension) operator(=) ident(template_path)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - operator([) ident(template_path_without_extension)operator(,) global_variable($1) operator(]) - reserved(end) - - reserved(def) method(cached_template_extension)operator(()ident(template_path)operator(\)) - class_variable(@@cache_template_extensions) operator(&&) class_variable(@@cached_template_extension)operator([)ident(template_path)operator(]) - reserved(end) - - reserved(def) method(find_template_extension_for)operator(()ident(template_path)operator(\)) - reserved(if) ident(match) operator(=) ident(delegate_template_exists?)operator(()ident(template_path)operator(\)) - ident(match)operator(.)ident(first)operator(.)ident(to_sym) - reserved(elsif) ident(erb_template_exists?)operator(()ident(template_path)operator(\))operator(:) symbol(:rhtml) - reserved(elsif) ident(builder_template_exists?)operator(()ident(template_path)operator(\))operator(:) symbol(:rxml) - reserved(elsif) ident(javascript_template_exists?)operator(()ident(template_path)operator(\))operator(:) symbol(:rjs) - reserved(else) - ident(raise) constant(ActionViewError)operator(,) stringdelimiter(")> - reserved(end) - reserved(end) - - comment(# This method reads a template file.) - reserved(def) method(read_template_file)operator(()ident(template_path)operator(,) ident(extension)operator(\)) - constant(File)operator(.)ident(read)operator(()ident(template_path)operator(\)) - reserved(end) - - reserved(def) method(evaluate_assigns) - reserved(unless) instance_variable(@assigns_added) - ident(assign_variables_from_controller) - instance_variable(@assigns_added) operator(=) pre_constant(true) - reserved(end) - reserved(end) - - reserved(def) method(delegate_render)operator(()ident(handler)operator(,) ident(template)operator(,) ident(local_assigns)operator(\)) - ident(handler)operator(.)ident(new)operator(()pre_constant(self)operator(\))operator(.)ident(render)operator(()ident(template)operator(,) ident(local_assigns)operator(\)) - reserved(end) - - reserved(def) method(assign_variables_from_controller) - instance_variable(@assigns)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) ident(value)operator(\)) operator(}) - reserved(end) - - - comment(# Return true if the given template was compiled for a superset of the keys in local_assigns) - reserved(def) method(supports_local_assigns?)operator(()ident(render_symbol)operator(,) ident(local_assigns)operator(\)) - ident(local_assigns)operator(.)ident(empty?) operator(||) - operator(()operator(()ident(args) operator(=) class_variable(@@template_args)operator([)ident(render_symbol)operator(])operator(\)) operator(&&) ident(local_assigns)operator(.)ident(all?) operator({) operator(|)ident(k)operator(,)ident(_)operator(|) ident(args)operator(.)ident(has_key?)operator(()ident(k)operator(\)) operator(})operator(\)) - reserved(end) - - comment(# Check whether compilation is necessary.) - comment(# Compile if the inline template or file has not been compiled yet.) - comment(# Or if local_assigns has a new key, which isn't supported by the compiled code yet.) - comment(# Or if the file has changed on disk and checking file mods hasn't been disabled. ) - reserved(def) method(compile_template?)operator(()ident(template)operator(,) ident(file_name)operator(,) ident(local_assigns)operator(\)) - ident(method_key) operator(=) ident(file_name) operator(||) ident(template) - ident(render_symbol) operator(=) class_variable(@@method_names)operator([)ident(method_key)operator(]) - - reserved(if) class_variable(@@compile_time)operator([)ident(render_symbol)operator(]) operator(&&) ident(supports_local_assigns?)operator(()ident(render_symbol)operator(,) ident(local_assigns)operator(\)) - reserved(if) ident(file_name) operator(&&) operator(!)class_variable(@@cache_template_loading) - class_variable(@@compile_time)operator([)ident(render_symbol)operator(]) operator(<) constant(File)operator(.)ident(mtime)operator(()ident(file_name)operator(\)) operator(||) operator(()constant(File)operator(.)ident(symlink?)operator(()ident(file_name)operator(\)) operator(?) - class_variable(@@compile_time)operator([)ident(render_symbol)operator(]) operator(<) constant(File)operator(.)ident(lstat)operator(()ident(file_name)operator(\))operator(.)ident(mtime) operator(:) pre_constant(false)operator(\)) - reserved(end) - reserved(else) - pre_constant(true) - reserved(end) - reserved(end) - - comment(# Create source code for given template) - reserved(def) method(create_template_source)operator(()ident(extension)operator(,) ident(template)operator(,) ident(render_symbol)operator(,) ident(locals)operator(\)) - reserved(if) ident(template_requires_setup?)operator(()ident(extension)operator(\)) - ident(body) operator(=) reserved(case) ident(extension)operator(.)ident(to_sym) - reserved(when) symbol(:rxml) - string 2\))char(\\n)delimiter(")> operator(+) - string operator(+) - ident(template) - reserved(when) symbol(:rjs) - string operator(+) - stringchar(\\n)content(end)delimiter(")> - reserved(end) - reserved(else) - ident(body) operator(=) constant(ERB)operator(.)ident(new)operator(()ident(template)operator(,) pre_constant(nil)operator(,) class_variable(@@erb_trim_mode)operator(\))operator(.)ident(src) - reserved(end) - - class_variable(@@template_args)operator([)ident(render_symbol)operator(]) operator(||=) operator({)operator(}) - ident(locals_keys) operator(=) class_variable(@@template_args)operator([)ident(render_symbol)operator(])operator(.)ident(keys) operator(|) ident(locals) - class_variable(@@template_args)operator([)ident(render_symbol)operator(]) operator(=) ident(locals_keys)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({) operator(|)ident(h)operator(,) ident(k)operator(|) ident(h)operator([)ident(k)operator(]) operator(=) pre_constant(true)operator(;) ident(h) operator(}) - - ident(locals_code) operator(=) string - ident(locals_keys)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(|) - ident(locals_code) operator(<<) stringcontent( = local_assigns[:)inlinecontent(] if local_assigns.has_key?(:)inlinecontent(\))char(\\n)delimiter(")> - reserved(end) - - stringcontent((local_assigns\))char(\\n)inlineinlinechar(\\n)content(end)delimiter(")> - reserved(end) - - reserved(def) method(template_requires_setup?)operator(()ident(extension)operator(\)) - ident(templates_requiring_setup)operator(.)ident(include?) ident(extension)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(templates_requiring_setup) - string - reserved(end) - - reserved(def) method(assign_method_name)operator(()ident(extension)operator(,) ident(template)operator(,) ident(file_name)operator(\)) - ident(method_name) operator(=) string - ident(method_name) operator(<<) stringcontent(_)delimiter(")> reserved(if) ident(extension) - - reserved(if) ident(file_name) - ident(file_path) operator(=) constant(File)operator(.)ident(expand_path)operator(()ident(file_name)operator(\)) - ident(base_path) operator(=) constant(File)operator(.)ident(expand_path)operator(()instance_variable(@base_path)operator(\)) - - ident(i) operator(=) ident(file_path)operator(.)ident(index)operator(()ident(base_path)operator(\)) - ident(l) operator(=) ident(base_path)operator(.)ident(length) - - ident(method_name_file_part) operator(=) ident(i) operator(?) ident(file_path)operator([)ident(i)operator(+)ident(l)operator(+)integer(1)operator(,)ident(file_path)operator(.)ident(length)operator(-)ident(l)operator(-)integer(1)operator(]) operator(:) ident(file_path)operator(.)ident(clone) - ident(method_name_file_part)operator(.)ident(sub!)operator(()regexpoperator(,)stringoperator(\)) - ident(method_name_file_part)operator(.)ident(tr!)operator(()stringoperator(,) stringoperator(\)) - ident(method_name_file_part)operator(.)ident(gsub!)operator(()regexpoperator(\))operator({)operator(|)ident(s)operator(|) ident(s)operator([)integer(0)operator(])operator(.)ident(to_s)operator(}) - - ident(method_name) operator(+=) ident(method_name_file_part) - reserved(else) - class_variable(@@inline_template_count) operator(+=) integer(1) - ident(method_name) operator(<<) class_variable(@@inline_template_count)operator(.)ident(to_s) - reserved(end) - - class_variable(@@method_names)operator([)ident(file_name) operator(||) ident(template)operator(]) operator(=) ident(method_name)operator(.)ident(intern) - reserved(end) - - reserved(def) method(compile_template)operator(()ident(extension)operator(,) ident(template)operator(,) ident(file_name)operator(,) ident(local_assigns)operator(\)) - ident(method_key) operator(=) ident(file_name) operator(||) ident(template) - - ident(render_symbol) operator(=) class_variable(@@method_names)operator([)ident(method_key)operator(]) operator(||) ident(assign_method_name)operator(()ident(extension)operator(,) ident(template)operator(,) ident(file_name)operator(\)) - ident(render_source) operator(=) ident(create_template_source)operator(()ident(extension)operator(,) ident(template)operator(,) ident(render_symbol)operator(,) ident(local_assigns)operator(.)ident(keys)operator(\)) - - ident(line_offset) operator(=) class_variable(@@template_args)operator([)ident(render_symbol)operator(])operator(.)ident(size) - reserved(if) ident(extension) - reserved(case) ident(extension)operator(.)ident(to_sym) - reserved(when) symbol(:rxml)operator(,) symbol(:rjs) - ident(line_offset) operator(+=) integer(2) - reserved(end) - reserved(end) - - reserved(begin) - reserved(unless) ident(file_name)operator(.)ident(blank?) - constant(CompiledTemplates)operator(.)ident(module_eval)operator(()ident(render_source)operator(,) ident(file_name)operator(,) operator(-)ident(line_offset)operator(\)) - reserved(else) - constant(CompiledTemplates)operator(.)ident(module_eval)operator(()ident(render_source)operator(,) stringoperator(,) operator(-)ident(line_offset)operator(\)) - reserved(end) - reserved(rescue) constant(Object) operator(=)operator(>) ident(e) - reserved(if) ident(logger) - ident(logger)operator(.)ident(debug) stringcontent( RAISED )inlinedelimiter(")> - ident(logger)operator(.)ident(debug) stringdelimiter(")> - ident(logger)operator(.)ident(debug) stringoperator(\))inline_delimiter(})>delimiter(")> - reserved(end) - - ident(raise) constant(TemplateError)operator(.)ident(new)operator(()instance_variable(@base_path)operator(,) ident(method_key)operator(,) instance_variable(@assigns)operator(,) ident(template)operator(,) ident(e)operator(\)) - reserved(end) - - class_variable(@@compile_time)operator([)ident(render_symbol)operator(]) operator(=) constant(Time)operator(.)ident(now) - comment(# logger.debug "Compiled template #{method_key}\\n ==> #{render_symbol}" if logger) - reserved(end) - reserved(end) -reserved(end) - -ident(require) string - -reserved(module) class(ActionView) - - comment(# CompiledTemplates modules hold methods that have been compiled.) - comment(# Templates are compiled into these methods so that they do not need to be) - comment(# re-read and re-parsed each request.) - comment(#) - comment(# Each template may be compiled into one or more methods. Each method accepts a given) - comment(# set of parameters which is used to implement local assigns passing.) - comment(#) - comment(# To use a compiled template module, create a new instance and include it into the class) - comment(# in which you want the template to be rendered.) - reserved(class) class(CompiledTemplates) operator(<) constant(Module) comment(#:nodoc:) - ident(attr_reader) symbol(:method_names) - - reserved(def) method(initialize) - instance_variable(@method_names) operator(=) constant(Hash)operator(.)ident(new) reserved(do) operator(|)ident(hash)operator(,) ident(key)operator(|) - ident(hash)operator([)ident(key)operator(]) operator(=) stringdelimiter(")> - reserved(end) - instance_variable(@mtimes) operator(=) operator({)operator(}) - reserved(end) - - comment(# Return the full key for the given identifier and argument names) - reserved(def) method(full_key)operator(()ident(identifier)operator(,) ident(arg_names)operator(\)) - operator([)ident(identifier)operator(,) ident(arg_names)operator(]) - reserved(end) - - comment(# Return the selector for this method or nil if it has not been compiled) - reserved(def) method(selector)operator(()ident(identifier)operator(,) ident(arg_names)operator(\)) - ident(key) operator(=) ident(full_key)operator(()ident(identifier)operator(,) ident(arg_names)operator(\)) - ident(method_names)operator(.)ident(key?)operator(()ident(key)operator(\)) operator(?) ident(method_names)operator([)ident(key)operator(]) operator(:) pre_constant(nil) - reserved(end) - reserved(alias) symbol(:compiled?) symbol(:selector) - - comment(# Return the time at which the method for the given identifier and argument names was compiled.) - reserved(def) method(mtime)operator(()ident(identifier)operator(,) ident(arg_names)operator(\)) - instance_variable(@mtimes)operator([)ident(full_key)operator(()ident(identifier)operator(,) ident(arg_names)operator(\))operator(]) - reserved(end) - - comment(# Compile the provided source code for the given argument names and with the given initial line number.) - comment(# The identifier should be unique to this source.) - comment(#) - comment(# The file_name, if provided will appear in backtraces. If not provded, the file_name defaults) - comment(# to the identifier.) - comment(#) - comment(# This method will return the selector for the compiled version of this method.) - reserved(def) method(compile_source)operator(()ident(identifier)operator(,) ident(arg_names)operator(,) ident(source)operator(,) ident(initial_line_number) operator(=) integer(0)operator(,) ident(file_name) operator(=) pre_constant(nil)operator(\)) - ident(file_name) operator(||=) ident(identifier) - ident(name) operator(=) ident(method_names)operator([)ident(full_key)operator(()ident(identifier)operator(,) ident(arg_names)operator(\))operator(]) - ident(arg_desc) operator(=) ident(arg_names)operator(.)ident(empty?) operator(?) string operator(:) stringinline_delimiter(})>content(\))delimiter(")> - ident(fake_file_name) operator(=) stringinlinedelimiter(")> comment(# Include the arguments for this version (for now\)) - - ident(method_def) operator(=) ident(wrap_source)operator(()ident(name)operator(,) ident(arg_names)operator(,) ident(source)operator(\)) - - reserved(begin) - ident(module_eval)operator(()ident(method_def)operator(,) ident(fake_file_name)operator(,) ident(initial_line_number)operator(\)) - instance_variable(@mtimes)operator([)ident(full_key)operator(()ident(identifier)operator(,) ident(arg_names)operator(\))operator(]) operator(=) constant(Time)operator(.)ident(now) - reserved(rescue) constant(Object) operator(=)operator(>) ident(e) - ident(e)operator(.)ident(blame_file!) ident(identifier) - ident(raise) - reserved(end) - ident(name) - reserved(end) - - comment(# Wrap the provided source in a def ... end block.) - reserved(def) method(wrap_source)operator(()ident(name)operator(,) ident(arg_names)operator(,) ident(source)operator(\)) - stringcontent(()inlineinline_delimiter(})>content(\))char(\\n)inlinechar(\\n)content(end)delimiter(")> - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(ActionView) - reserved(class) class(Base) - class_variable(@@field_error_proc) operator(=) constant(Proc)operator(.)ident(new)operator({) operator(|)ident(html_tag)operator(,) ident(instance)operator(|) string)inlinecontent(
)delimiter(")> operator(}) - ident(cattr_accessor) symbol(:field_error_proc) - reserved(end) - - reserved(module) class(Helpers) - comment(# The Active Record Helper makes it easier to create forms for records kept in instance variables. The most far-reaching is the form) - comment(# method that creates a complete form for all the basic content types of the record (not associations or aggregations, though\). This) - comment(# is a great of making the record quickly available for editing, but likely to prove lackluster for a complicated real-world form.) - comment(# In that case, it's better to use the input method and the specialized form methods in link:classes/ActionView/Helpers/FormHelper.html) - reserved(module) class(ActiveRecordHelper) - comment(# Returns a default input tag for the type of object returned by the method. Example) - comment(# (title is a VARCHAR column and holds "Hello World"\):) - comment(# input("post", "title"\) =>) - comment(# ) - reserved(def) method(input)operator(()ident(record_name)operator(,) ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(record_name)operator(,) ident(method)operator(,) pre_constant(self)operator(\))operator(.)ident(to_tag)operator(()ident(options)operator(\)) - reserved(end) - - comment(# Returns an entire form with input tags and everything for a specified Active Record object. Example) - comment(# (post is a new record that has a title using VARCHAR and a body using TEXT\):) - comment(# form("post"\) =>) - comment(#
) - comment(#

) - comment(#
) - comment(# ) - comment(#

) - comment(#

) - comment(#
) - comment(# ) - comment(#

) - comment(# ) - comment(#
) - comment(#) - comment(# It's possible to specialize the form builder by using a different action name and by supplying another) - comment(# block renderer. Example (entry is a new record that has a message attribute using VARCHAR\):) - comment(#) - comment(# form("entry", :action => "sign", :input_block =>) - comment(# Proc.new { |record, column| "#{column.human_name}: #{input(record, column.name\)}
" }\) =>) - comment(#) - comment(#
) - comment(# Message:) - comment(#
) - comment(# ) - comment(#
) - comment(#) - comment(# It's also possible to add additional content to the form by giving it a block, such as:) - comment(#) - comment(# form("entry", :action => "sign"\) do |form|) - comment(# form << content_tag("b", "Department"\)) - comment(# form << collection_select("department", "id", @departments, "id", "name"\)) - comment(# end) - reserved(def) method(form)operator(()ident(record_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(record) operator(=) ident(instance_variable_get)operator(()stringdelimiter(")>operator(\)) - - ident(options) operator(=) ident(options)operator(.)ident(symbolize_keys) - ident(options)operator([)symbol(:action)operator(]) operator(||=) ident(record)operator(.)ident(new_record?) operator(?) string operator(:) string - ident(action) operator(=) ident(url_for)operator(()symbol(:action) operator(=)operator(>) ident(options)operator([)symbol(:action)operator(])operator(,) symbol(:id) operator(=)operator(>) ident(record)operator(\)) - - ident(submit_value) operator(=) ident(options)operator([)symbol(:submit_value)operator(]) operator(||) ident(options)operator([)symbol(:action)operator(])operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(capitalize) - - ident(contents) operator(=) string - ident(contents) operator(<<) ident(hidden_field)operator(()ident(record_name)operator(,) symbol(:id)operator(\)) reserved(unless) ident(record)operator(.)ident(new_record?) - ident(contents) operator(<<) ident(all_input_tags)operator(()ident(record)operator(,) ident(record_name)operator(,) ident(options)operator(\)) - reserved(yield) ident(contents) reserved(if) ident(block_given?) - ident(contents) operator(<<) ident(submit_tag)operator(()ident(submit_value)operator(\)) - - ident(content_tag)operator(()stringoperator(,) ident(contents)operator(,) symbol(:action) operator(=)operator(>) ident(action)operator(,) symbol(:method) operator(=)operator(>) stringoperator(,) symbol(:enctype) operator(=)operator(>) ident(options)operator([)symbol(:multipart)operator(]) operator(?) stringoperator(:) pre_constant(nil)operator(\)) - reserved(end) - - comment(# Returns a string containing the error message attached to the +method+ on the +object+, if one exists.) - comment(# This error message is wrapped in a DIV tag, which can be specialized to include both a +prepend_text+ and +append_text+) - comment(# to properly introduce the error and a +css_class+ to style it accordingly. Examples (post has an error message) - comment(# "can't be empty" on the title attribute\):) - comment(#) - comment(# <%= error_message_on "post", "title" %> =>) - comment(#
can't be empty
) - comment(#) - comment(# <%= error_message_on "post", "title", "Title simply ", " (or it won't work\)", "inputError" %> =>) - comment(#
Title simply can't be empty (or it won't work\)
) - reserved(def) method(error_message_on)operator(()ident(object)operator(,) ident(method)operator(,) ident(prepend_text) operator(=) stringoperator(,) ident(append_text) operator(=) stringoperator(,) ident(css_class) operator(=) stringoperator(\)) - reserved(if) ident(errors) operator(=) ident(instance_variable_get)operator(()stringdelimiter(")>operator(\))operator(.)ident(errors)operator(.)ident(on)operator(()ident(method)operator(\)) - ident(content_tag)operator(()stringoperator(,) stringinlineinlinedelimiter(")>operator(,) symbol(:class) operator(=)operator(>) ident(css_class)operator(\)) - reserved(end) - reserved(end) - - comment(# Returns a string with a div containing all the error messages for the object located as an instance variable by the name) - comment(# of object_name. This div can be tailored by the following options:) - comment(#) - comment(# * header_tag - Used for the header of the error div (default: h2\)) - comment(# * id - The id of the error div (default: errorExplanation\)) - comment(# * class - The class of the error div (default: errorExplanation\)) - comment(#) - comment(# NOTE: This is a pre-packaged presentation of the errors with embedded strings and a certain HTML structure. If what) - comment(# you need is significantly different from the default presentation, it makes plenty of sense to access the object.errors) - comment(# instance yourself and set it up. View the source of this method to see how easy it is.) - reserved(def) method(error_messages_for)operator(()ident(object_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options) operator(=) ident(options)operator(.)ident(symbolize_keys) - ident(object) operator(=) ident(instance_variable_get)operator(()stringdelimiter(")>operator(\)) - reserved(if) ident(object) operator(&&) operator(!)ident(object)operator(.)ident(errors)operator(.)ident(empty?) - ident(content_tag)operator(()stringoperator(,) - ident(content_tag)operator(() - ident(options)operator([)symbol(:header_tag)operator(]) operator(||) stringoperator(,) - stringoperator(\))inline_delimiter(})>content( prohibited this )inlineoperator(,) stringoperator(\))inline_delimiter(})>content( from being saved)delimiter(")> - operator(\)) operator(+) - ident(content_tag)operator(()stringoperator(,) stringoperator(\)) operator(+) - ident(content_tag)operator(()stringoperator(,) ident(object)operator(.)ident(errors)operator(.)ident(full_messages)operator(.)ident(collect) operator({) operator(|)ident(msg)operator(|) ident(content_tag)operator(()stringoperator(,) ident(msg)operator(\)) operator(})operator(\))operator(,) - string operator(=)operator(>) ident(options)operator([)symbol(:id)operator(]) operator(||) stringoperator(,) string operator(=)operator(>) ident(options)operator([)symbol(:class)operator(]) operator(||) string - operator(\)) - reserved(else) - string - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(all_input_tags)operator(()ident(record)operator(,) ident(record_name)operator(,) ident(options)operator(\)) - ident(input_block) operator(=) ident(options)operator([)symbol(:input_block)operator(]) operator(||) ident(default_input_block) - ident(record)operator(.)ident(class)operator(.)ident(content_columns)operator(.)ident(collect)operator({) operator(|)ident(column)operator(|) ident(input_block)operator(.)ident(call)operator(()ident(record_name)operator(,) ident(column)operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(default_input_block) - constant(Proc)operator(.)ident(new) operator({) operator(|)ident(record)operator(,) ident(column)operator(|) string
)inlinecontent(

)delimiter(\))> operator(}) - reserved(end) - reserved(end) - - reserved(class) class(InstanceTag) comment(#:nodoc:) - reserved(def) method(to_tag)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - reserved(case) ident(column_type) - reserved(when) symbol(:string) - ident(field_type) operator(=) instance_variable(@method_name)operator(.)ident(include?)operator(()stringoperator(\)) operator(?) string operator(:) string - ident(to_input_field_tag)operator(()ident(field_type)operator(,) ident(options)operator(\)) - reserved(when) symbol(:text) - ident(to_text_area_tag)operator(()ident(options)operator(\)) - reserved(when) symbol(:integer)operator(,) symbol(:float) - ident(to_input_field_tag)operator(()stringoperator(,) ident(options)operator(\)) - reserved(when) symbol(:date) - ident(to_date_select_tag)operator(()ident(options)operator(\)) - reserved(when) symbol(:datetime)operator(,) symbol(:timestamp) - ident(to_datetime_select_tag)operator(()ident(options)operator(\)) - reserved(when) symbol(:boolean) - ident(to_boolean_select_tag)operator(()ident(options)operator(\)) - reserved(end) - reserved(end) - - ident(alias_method) symbol(:tag_without_error_wrapping)operator(,) symbol(:tag) - reserved(def) method(tag)operator(()ident(name)operator(,) ident(options)operator(\)) - reserved(if) ident(object)operator(.)ident(respond_to?)operator(()stringoperator(\)) operator(&&) ident(object)operator(.)ident(errors)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(error_wrapping)operator(()ident(tag_without_error_wrapping)operator(()ident(name)operator(,) ident(options)operator(\))operator(,) ident(object)operator(.)ident(errors)operator(.)ident(on)operator(()instance_variable(@method_name)operator(\))operator(\)) - reserved(else) - ident(tag_without_error_wrapping)operator(()ident(name)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - ident(alias_method) symbol(:content_tag_without_error_wrapping)operator(,) symbol(:content_tag) - reserved(def) method(content_tag)operator(()ident(name)operator(,) ident(value)operator(,) ident(options)operator(\)) - reserved(if) ident(object)operator(.)ident(respond_to?)operator(()stringoperator(\)) operator(&&) ident(object)operator(.)ident(errors)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(error_wrapping)operator(()ident(content_tag_without_error_wrapping)operator(()ident(name)operator(,) ident(value)operator(,) ident(options)operator(\))operator(,) ident(object)operator(.)ident(errors)operator(.)ident(on)operator(()instance_variable(@method_name)operator(\))operator(\)) - reserved(else) - ident(content_tag_without_error_wrapping)operator(()ident(name)operator(,) ident(value)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - ident(alias_method) symbol(:to_date_select_tag_without_error_wrapping)operator(,) symbol(:to_date_select_tag) - reserved(def) method(to_date_select_tag)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - reserved(if) ident(object)operator(.)ident(respond_to?)operator(()stringoperator(\)) operator(&&) ident(object)operator(.)ident(errors)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(error_wrapping)operator(()ident(to_date_select_tag_without_error_wrapping)operator(()ident(options)operator(\))operator(,) ident(object)operator(.)ident(errors)operator(.)ident(on)operator(()instance_variable(@method_name)operator(\))operator(\)) - reserved(else) - ident(to_date_select_tag_without_error_wrapping)operator(()ident(options)operator(\)) - reserved(end) - reserved(end) - - ident(alias_method) symbol(:to_datetime_select_tag_without_error_wrapping)operator(,) symbol(:to_datetime_select_tag) - reserved(def) method(to_datetime_select_tag)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - reserved(if) ident(object)operator(.)ident(respond_to?)operator(()stringoperator(\)) operator(&&) ident(object)operator(.)ident(errors)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(error_wrapping)operator(()ident(to_datetime_select_tag_without_error_wrapping)operator(()ident(options)operator(\))operator(,) ident(object)operator(.)ident(errors)operator(.)ident(on)operator(()instance_variable(@method_name)operator(\))operator(\)) - reserved(else) - ident(to_datetime_select_tag_without_error_wrapping)operator(()ident(options)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(error_wrapping)operator(()ident(html_tag)operator(,) ident(has_error)operator(\)) - ident(has_error) operator(?) constant(Base)operator(.)ident(field_error_proc)operator(.)ident(call)operator(()ident(html_tag)operator(,) pre_constant(self)operator(\)) operator(:) ident(html_tag) - reserved(end) - - reserved(def) method(error_message) - ident(object)operator(.)ident(errors)operator(.)ident(on)operator(()instance_variable(@method_name)operator(\)) - reserved(end) - - reserved(def) method(column_type) - ident(object)operator(.)ident(send)operator(()stringoperator(,) instance_variable(@method_name)operator(\))operator(.)ident(type) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# Provides methods for linking a HTML page together with other assets, such as javascripts, stylesheets, and feeds.) - reserved(module) class(AssetTagHelper) - comment(# Returns a link tag that browsers and news readers can use to auto-detect a RSS or ATOM feed for this page. The +type+ can) - comment(# either be :rss (default\) or :atom and the +options+ follow the url_for style of declaring a link target.) - comment(#) - comment(# Examples:) - comment(# auto_discovery_link_tag # =>) - comment(# ) - comment(# auto_discovery_link_tag(:atom\) # =>) - comment(# ) - comment(# auto_discovery_link_tag(:rss, {:action => "feed"}\) # =>) - comment(# ) - comment(# auto_discovery_link_tag(:rss, {:action => "feed"}, {:title => "My RSS"}\) # =>) - comment(# ) - reserved(def) method(auto_discovery_link_tag)operator(()ident(type) operator(=) symbol(:rss)operator(,) ident(url_options) operator(=) operator({)operator(})operator(,) ident(tag_options) operator(=) operator({)operator(})operator(\)) - ident(tag)operator(() - stringoperator(,) - string operator(=)operator(>) ident(tag_options)operator([)symbol(:rel)operator(]) operator(||) stringoperator(,) - string operator(=)operator(>) ident(tag_options)operator([)symbol(:type)operator(]) operator(||) stringcontent(+xml)delimiter(")>operator(,) - string operator(=)operator(>) ident(tag_options)operator([)symbol(:title)operator(]) operator(||) ident(type)operator(.)ident(to_s)operator(.)ident(upcase)operator(,) - string operator(=)operator(>) ident(url_options)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(url_for)operator(()ident(url_options)operator(.)ident(merge)operator(()symbol(:only_path) operator(=)operator(>) pre_constant(false)operator(\))operator(\)) operator(:) ident(url_options) - operator(\)) - reserved(end) - - comment(# Returns path to a javascript asset. Example:) - comment(#) - comment(# javascript_path "xmlhr" # => /javascripts/xmlhr.js) - reserved(def) method(javascript_path)operator(()ident(source)operator(\)) - ident(compute_public_path)operator(()ident(source)operator(,) stringoperator(,) stringoperator(\)) - reserved(end) - - constant(JAVASCRIPT_DEFAULT_SOURCES) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) reserved(unless) ident(const_defined?)operator(()symbol(:JAVASCRIPT_DEFAULT_SOURCES)operator(\)) - class_variable(@@javascript_default_sources) operator(=) constant(JAVASCRIPT_DEFAULT_SOURCES)operator(.)ident(dup) - - comment(# Returns a script include tag per source given as argument. Examples:) - comment(#) - comment(# javascript_include_tag "xmlhr" # =>) - comment(# ) - comment(#) - comment(# javascript_include_tag "common.javascript", "/elsewhere/cools" # =>) - comment(# ) - comment(# ) - comment(#) - comment(# javascript_include_tag :defaults # =>) - comment(# ) - comment(# ) - comment(# ...) - comment(# *see below) - comment(# ) - comment(# If there's an application.js file in your public/javascripts directory,) - comment(# javascript_include_tag :defaults will automatically include it. This file) - comment(# facilitates the inclusion of small snippets of JavaScript code, along the lines of) - comment(# controllers/application.rb and helpers/application_helper.rb.) - reserved(def) method(javascript_include_tag)operator(()operator(*)ident(sources)operator(\)) - ident(options) operator(=) ident(sources)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(sources)operator(.)ident(pop)operator(.)ident(stringify_keys) operator(:) operator({) operator(}) - - reserved(if) ident(sources)operator(.)ident(include?)operator(()symbol(:defaults)operator(\)) - ident(sources) operator(=) ident(sources)operator([)integer(0)operator(..)operator(()ident(sources)operator(.)ident(index)operator(()symbol(:defaults)operator(\))operator(\))operator(]) operator(+) - class_variable(@@javascript_default_sources)operator(.)ident(dup) operator(+) - ident(sources)operator([)operator(()ident(sources)operator(.)ident(index)operator(()symbol(:defaults)operator(\)) operator(+) integer(1)operator(\))operator(..)ident(sources)operator(.)ident(length)operator(]) - - ident(sources)operator(.)ident(delete)operator(()symbol(:defaults)operator(\)) - ident(sources) operator(<<) string reserved(if) reserved(defined?)operator(()constant(RAILS_ROOT)operator(\)) operator(&&) constant(File)operator(.)ident(exists?)operator(()stringcontent(/public/javascripts/application.js)delimiter(")>operator(\)) - reserved(end) - - ident(sources)operator(.)ident(collect) operator({) operator(|)ident(source)operator(|) - ident(source) operator(=) ident(javascript_path)operator(()ident(source)operator(\)) - ident(content_tag)operator(()stringoperator(,) stringoperator(,) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(source) operator(})operator(.)ident(merge)operator(()ident(options)operator(\))operator(\)) - operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - comment(# Register one or more additional JavaScript files to be included when) - comment(# ) - comment(# javascript_include_tag :defaults) - comment(#) - comment(# is called. This method is intended to be called only from plugin initialization) - comment(# to register extra .js files the plugin installed in public/javascripts.) - reserved(def) pre_constant(self)operator(.)method(register_javascript_include_default)operator(()operator(*)ident(sources)operator(\)) - class_variable(@@javascript_default_sources)operator(.)ident(concat)operator(()ident(sources)operator(\)) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(reset_javascript_include_default) comment(#:nodoc:) - class_variable(@@javascript_default_sources) operator(=) constant(JAVASCRIPT_DEFAULT_SOURCES)operator(.)ident(dup) - reserved(end) - - comment(# Returns path to a stylesheet asset. Example:) - comment(#) - comment(# stylesheet_path "style" # => /stylesheets/style.css) - reserved(def) method(stylesheet_path)operator(()ident(source)operator(\)) - ident(compute_public_path)operator(()ident(source)operator(,) stringoperator(,) stringoperator(\)) - reserved(end) - - comment(# Returns a css link tag per source given as argument. Examples:) - comment(#) - comment(# stylesheet_link_tag "style" # =>) - comment(# ) - comment(#) - comment(# stylesheet_link_tag "style", :media => "all" # =>) - comment(# ) - comment(#) - comment(# stylesheet_link_tag "random.styles", "/css/stylish" # =>) - comment(# ) - comment(# ) - reserved(def) method(stylesheet_link_tag)operator(()operator(*)ident(sources)operator(\)) - ident(options) operator(=) ident(sources)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(sources)operator(.)ident(pop)operator(.)ident(stringify_keys) operator(:) operator({) operator(}) - ident(sources)operator(.)ident(collect) operator({) operator(|)ident(source)operator(|) - ident(source) operator(=) ident(stylesheet_path)operator(()ident(source)operator(\)) - ident(tag)operator(()stringoperator(,) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(source) operator(})operator(.)ident(merge)operator(()ident(options)operator(\))operator(\)) - operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - comment(# Returns path to an image asset. Example:) - comment(#) - comment(# The +src+ can be supplied as a...) - comment(# * full path, like "/my_images/image.gif") - comment(# * file name, like "rss.gif", that gets expanded to "/images/rss.gif") - comment(# * file name without extension, like "logo", that gets expanded to "/images/logo.png") - reserved(def) method(image_path)operator(()ident(source)operator(\)) - ident(compute_public_path)operator(()ident(source)operator(,) stringoperator(,) stringoperator(\)) - reserved(end) - - comment(# Returns an image tag converting the +options+ into html options on the tag, but with these special cases:) - comment(#) - comment(# * :alt - If no alt text is given, the file name part of the +src+ is used (capitalized and without the extension\)) - comment(# * :size - Supplied as "XxY", so "30x45" becomes width="30" and height="45") - comment(#) - comment(# The +src+ can be supplied as a...) - comment(# * full path, like "/my_images/image.gif") - comment(# * file name, like "rss.gif", that gets expanded to "/images/rss.gif") - comment(# * file name without extension, like "logo", that gets expanded to "/images/logo.png") - reserved(def) method(image_tag)operator(()ident(source)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options)operator(.)ident(symbolize_keys!) - - ident(options)operator([)symbol(:src)operator(]) operator(=) ident(image_path)operator(()ident(source)operator(\)) - ident(options)operator([)symbol(:alt)operator(]) operator(||=) constant(File)operator(.)ident(basename)operator(()ident(options)operator([)symbol(:src)operator(])operator(,) stringoperator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(first)operator(.)ident(capitalize) - - reserved(if) ident(options)operator([)symbol(:size)operator(]) - ident(options)operator([)symbol(:width)operator(])operator(,) ident(options)operator([)symbol(:height)operator(]) operator(=) ident(options)operator([)symbol(:size)operator(])operator(.)ident(split)operator(()stringoperator(\)) - ident(options)operator(.)ident(delete) symbol(:size) - reserved(end) - - ident(tag)operator(()stringoperator(,) ident(options)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(compute_public_path)operator(()ident(source)operator(,) ident(dir)operator(,) ident(ext)operator(\)) - ident(source) operator(=) stringcontent(/)inlinedelimiter(")> reserved(unless) ident(source)operator(.)ident(first) operator(==) string operator(||) ident(source)operator(.)ident(include?)operator(()stringoperator(\)) - ident(source) operator(<<) stringdelimiter(")> reserved(unless) ident(source)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last)operator(.)ident(include?)operator(()stringoperator(\)) - ident(source) operator(<<) string operator(+) ident(rails_asset_id)operator(()ident(source)operator(\)) reserved(if) reserved(defined?)operator(()constant(RAILS_ROOT)operator(\)) operator(&&) regexp operator(!)operator(~) ident(source) - ident(source) operator(=) stringinlinedelimiter(")> reserved(unless) regexp operator(=)operator(~) ident(source) - ident(source) operator(=) constant(ActionController)operator(::)constant(Base)operator(.)ident(asset_host) operator(+) ident(source) reserved(unless) ident(source)operator(.)ident(include?)operator(()stringoperator(\)) - ident(source) - reserved(end) - - reserved(def) method(rails_asset_id)operator(()ident(source)operator(\)) - pre_constant(ENV)operator([)stringoperator(]) operator(||) - constant(File)operator(.)ident(mtime)operator(()stringcontent(/public/)inlinedelimiter(")>operator(\))operator(.)ident(to_i)operator(.)ident(to_s) reserved(rescue) string - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActionView) - reserved(module) class(Helpers) - reserved(module) class(BenchmarkHelper) - comment(# Measures the execution time of a block in a template and reports the result to the log. Example:) - comment(#) - comment(# <% benchmark "Notes section" do %>) - comment(# <%= expensive_notes_operation %>) - comment(# <% end %>) - comment(#) - comment(# Will add something like "Notes section (0.34523\)" to the log.) - comment(#) - comment(# You may give an optional logger level as the second argument) - comment(# (:debug, :info, :warn, :error\). The default is :info.) - reserved(def) method(benchmark)operator(()ident(message) operator(=) stringoperator(,) ident(level) operator(=) symbol(:info)operator(\)) - reserved(if) instance_variable(@logger) - ident(real) operator(=) constant(Benchmark)operator(.)ident(realtime) operator({) reserved(yield) operator(}) - instance_variable(@logger)operator(.)ident(send) ident(level)operator(,) stringcontent( ()inline operator(%) ident(real)inline_delimiter(})>content(\))delimiter(")> - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# See ActionController::Caching::Fragments for usage instructions.) - reserved(module) class(CacheHelper) - reserved(def) method(cache)operator(()ident(name) operator(=) operator({)operator(})operator(,) operator(&)ident(block)operator(\)) - instance_variable(@controller)operator(.)ident(cache_erb_fragment)operator(()ident(block)operator(,) ident(name)operator(\)) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# Capture lets you extract parts of code which) - comment(# can be used in other points of the template or even layout file.) - comment(#) - comment(# == Capturing a block into an instance variable) - comment(#) - comment(# <% @script = capture do %>) - comment(# [some html...]) - comment(# <% end %>) - comment(#) - comment(# == Add javascript to header using content_for) - comment(#) - comment(# content_for("name"\) is a wrapper for capture which will ) - comment(# make the fragment available by name to a yielding layout or template.) - comment(#) - comment(# layout.rhtml:) - comment(#) - comment(# ) - comment(# ) - comment(# layout with js) - comment(# ) - comment(# ) - comment(# ) - comment(# <%= yield %>) - comment(# ) - comment(# ) - comment(#) - comment(# view.rhtml) - comment(# ) - comment(# This page shows an alert box!) - comment(#) - comment(# <% content_for("script"\) do %>) - comment(# alert('hello world'\)) - comment(# <% end %>) - comment(#) - comment(# Normal view text) - reserved(module) class(CaptureHelper) - comment(# Capture allows you to extract a part of the template into an ) - comment(# instance variable. You can use this instance variable anywhere) - comment(# in your templates and even in your layout. ) - comment(# ) - comment(# Example of capture being used in a .rhtml page:) - comment(# ) - comment(# <% @greeting = capture do %>) - comment(# Welcome To my shiny new web page!) - comment(# <% end %>) - comment(#) - comment(# Example of capture being used in a .rxml page:) - comment(# ) - comment(# @greeting = capture do) - comment(# 'Welcome To my shiny new web page!') - comment(# end) - reserved(def) method(capture)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - comment(# execute the block) - reserved(begin) - ident(buffer) operator(=) ident(eval)operator(()stringoperator(,) ident(block)operator(.)ident(binding)operator(\)) - reserved(rescue) - ident(buffer) operator(=) pre_constant(nil) - reserved(end) - - reserved(if) ident(buffer)operator(.)ident(nil?) - ident(capture_block)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(else) - ident(capture_erb_with_buffer)operator(()ident(buffer)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - - comment(# Calling content_for stores the block of markup for later use.) - comment(# Subsequently, you can make calls to it by name with yield) - comment(# in another template or in the layout. ) - comment(# ) - comment(# Example:) - comment(# ) - comment(# <% content_for("header"\) do %>) - comment(# alert('hello world'\)) - comment(# <% end %>) - comment(#) - comment(# You can use yield :header anywhere in your templates.) - comment(#) - comment(# <%= yield :header %>) - comment(#) - comment(# NOTE: Beware that content_for is ignored in caches. So you shouldn't use it) - comment(# for elements that are going to be fragment cached.) - comment(#) - comment(# The deprecated way of accessing a content_for block was to use a instance variable) - comment(# named @@content_for_#{name_of_the_content_block}@. So <%= content_for('footer'\) %>) - comment(# would be avaiable as <%= @content_for_footer %>. The preferred notation now is) - comment(# <%= yield :footer %>.) - reserved(def) method(content_for)operator(()ident(name)operator(,) operator(&)ident(block)operator(\)) - ident(eval) stringcontent( = (@content_for_)inlinecontent( || ''\) + capture(&block\))delimiter(")> - reserved(end) - - ident(private) - reserved(def) method(capture_block)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(block)operator(.)ident(call)operator(()operator(*)ident(args)operator(\)) - reserved(end) - - reserved(def) method(capture_erb)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(buffer) operator(=) ident(eval)operator(()stringoperator(,) ident(block)operator(.)ident(binding)operator(\)) - ident(capture_erb_with_buffer)operator(()ident(buffer)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(capture_erb_with_buffer)operator(()ident(buffer)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(pos) operator(=) ident(buffer)operator(.)ident(length) - ident(block)operator(.)ident(call)operator(()operator(*)ident(args)operator(\)) - - comment(# extract the block ) - ident(data) operator(=) ident(buffer)operator([)ident(pos)operator(..)integer(-1)operator(]) - - comment(# replace it in the original with empty string) - ident(buffer)operator([)ident(pos)operator(..)integer(-1)operator(]) operator(=) string - - ident(data) - reserved(end) - - reserved(def) method(erb_content_for)operator(()ident(name)operator(,) operator(&)ident(block)operator(\)) - ident(eval) stringcontent( = (@content_for_)inlinecontent( || ''\) + capture_erb(&block\))delimiter(")> - reserved(end) - - reserved(def) method(block_content_for)operator(()ident(name)operator(,) operator(&)ident(block)operator(\)) - ident(eval) stringcontent( = (@content_for_)inlinecontent( || ''\) + capture_block(&block\))delimiter(")> - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# The Date Helper primarily creates select/option tags for different kinds of dates and date elements. All of the select-type methods) - comment(# share a number of common options that are as follows:) - comment(#) - comment(# * :prefix - overwrites the default prefix of "date" used for the select names. So specifying "birthday" would give) - comment(# birthday[month] instead of date[month] if passed to the select_month method.) - comment(# * :include_blank - set to true if it should be possible to set an empty date.) - comment(# * :discard_type - set to true if you want to discard the type part of the select name. If set to true, the select_month) - comment(# method would use simply "date" (which can be overwritten using :prefix\) instead of "date[month]".) - reserved(module) class(DateHelper) - constant(DEFAULT_PREFIX) operator(=) string reserved(unless) ident(const_defined?)operator(()stringoperator(\)) - - comment(# Reports the approximate distance in time between two Time objects or integers. ) - comment(# For example, if the distance is 47 minutes, it'll return) - comment(# "about 1 hour". See the source for the complete wording list.) - comment(#) - comment(# Integers are interpreted as seconds. So,) - comment(# distance_of_time_in_words(50\) returns "less than a minute".) - comment(#) - comment(# Set include_seconds to true if you want more detailed approximations if distance < 1 minute) - reserved(def) method(distance_of_time_in_words)operator(()ident(from_time)operator(,) ident(to_time) operator(=) integer(0)operator(,) ident(include_seconds) operator(=) pre_constant(false)operator(\)) - ident(from_time) operator(=) ident(from_time)operator(.)ident(to_time) reserved(if) ident(from_time)operator(.)ident(respond_to?)operator(()symbol(:to_time)operator(\)) - ident(to_time) operator(=) ident(to_time)operator(.)ident(to_time) reserved(if) ident(to_time)operator(.)ident(respond_to?)operator(()symbol(:to_time)operator(\)) - ident(distance_in_minutes) operator(=) operator(()operator(()operator(()ident(to_time) operator(-) ident(from_time)operator(\))operator(.)ident(abs)operator(\))operator(/)integer(60)operator(\))operator(.)ident(round) - ident(distance_in_seconds) operator(=) operator(()operator(()ident(to_time) operator(-) ident(from_time)operator(\))operator(.)ident(abs)operator(\))operator(.)ident(round) - - reserved(case) ident(distance_in_minutes) - reserved(when) integer(0)operator(..)integer(1) - reserved(return) operator(()ident(distance_in_minutes)operator(==)integer(0)operator(\)) operator(?) string operator(:) string reserved(unless) ident(include_seconds) - reserved(case) ident(distance_in_seconds) - reserved(when) integer(0)operator(..)integer(5) reserved(then) string - reserved(when) integer(6)operator(..)integer(10) reserved(then) string - reserved(when) integer(11)operator(..)integer(20) reserved(then) string - reserved(when) integer(21)operator(..)integer(40) reserved(then) string - reserved(when) integer(41)operator(..)integer(59) reserved(then) string - reserved(else) string - reserved(end) - - reserved(when) integer(2)operator(..)integer(45) reserved(then) stringcontent( minutes)delimiter(")> - reserved(when) integer(46)operator(..)integer(90) reserved(then) string - reserved(when) integer(90)operator(..)integer(1440) reserved(then) stringcontent( hours)delimiter(")> - reserved(when) integer(1441)operator(..)integer(2880) reserved(then) string - reserved(else) stringcontent( days)delimiter(")> - reserved(end) - reserved(end) - - comment(# Like distance_of_time_in_words, but where to_time is fixed to Time.now.) - reserved(def) method(time_ago_in_words)operator(()ident(from_time)operator(,) ident(include_seconds) operator(=) pre_constant(false)operator(\)) - ident(distance_of_time_in_words)operator(()ident(from_time)operator(,) constant(Time)operator(.)ident(now)operator(,) ident(include_seconds)operator(\)) - reserved(end) - - ident(alias_method) symbol(:distance_of_time_in_words_to_now)operator(,) symbol(:time_ago_in_words) - - comment(# Returns a set of select tags (one for year, month, and day\) pre-selected for accessing a specified date-based attribute (identified by) - comment(# +method+\) on an object assigned to the template (identified by +object+\). It's possible to tailor the selects through the +options+ hash,) - comment(# which accepts all the keys that each of the individual select builders do (like :use_month_numbers for select_month\) as well as a range of) - comment(# discard options. The discard options are :discard_year, :discard_month and :discard_day. Set to true, they'll) - comment(# drop the respective select. Discarding the month select will also automatically discard the day select. It's also possible to explicitly) - comment(# set the order of the tags using the :order option with an array of symbols :year, :month and :day in) - comment(# the desired order. Symbols may be omitted and the respective select is not included.) - comment(#) - comment(# Passing :disabled => true as part of the +options+ will make elements inaccessible for change.) - comment(#) - comment(# NOTE: Discarded selects will default to 1. So if no month select is available, January will be assumed.) - comment(#) - comment(# Examples:) - comment(#) - comment(# date_select("post", "written_on"\)) - comment(# date_select("post", "written_on", :start_year => 1995\)) - comment(# date_select("post", "written_on", :start_year => 1995, :use_month_numbers => true,) - comment(# :discard_day => true, :include_blank => true\)) - comment(# date_select("post", "written_on", :order => [:day, :month, :year]\)) - comment(# date_select("user", "birthday", :order => [:month, :day]\)) - comment(#) - comment(# The selects are prepared for multi-parameter assignment to an Active Record object.) - reserved(def) method(date_select)operator(()ident(object_name)operator(,) ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object_name)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_date_select_tag)operator(()ident(options)operator(\)) - reserved(end) - - comment(# Returns a set of select tags (one for year, month, day, hour, and minute\) pre-selected for accessing a specified datetime-based) - comment(# attribute (identified by +method+\) on an object assigned to the template (identified by +object+\). Examples:) - comment(#) - comment(# datetime_select("post", "written_on"\)) - comment(# datetime_select("post", "written_on", :start_year => 1995\)) - comment(#) - comment(# The selects are prepared for multi-parameter assignment to an Active Record object.) - reserved(def) method(datetime_select)operator(()ident(object_name)operator(,) ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object_name)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_datetime_select_tag)operator(()ident(options)operator(\)) - reserved(end) - - comment(# Returns a set of html select-tags (one for year, month, and day\) pre-selected with the +date+.) - reserved(def) method(select_date)operator(()ident(date) operator(=) constant(Date)operator(.)ident(today)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(select_year)operator(()ident(date)operator(,) ident(options)operator(\)) operator(+) ident(select_month)operator(()ident(date)operator(,) ident(options)operator(\)) operator(+) ident(select_day)operator(()ident(date)operator(,) ident(options)operator(\)) - reserved(end) - - comment(# Returns a set of html select-tags (one for year, month, day, hour, and minute\) pre-selected with the +datetime+.) - reserved(def) method(select_datetime)operator(()ident(datetime) operator(=) constant(Time)operator(.)ident(now)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(select_year)operator(()ident(datetime)operator(,) ident(options)operator(\)) operator(+) ident(select_month)operator(()ident(datetime)operator(,) ident(options)operator(\)) operator(+) ident(select_day)operator(()ident(datetime)operator(,) ident(options)operator(\)) operator(+) - ident(select_hour)operator(()ident(datetime)operator(,) ident(options)operator(\)) operator(+) ident(select_minute)operator(()ident(datetime)operator(,) ident(options)operator(\)) - reserved(end) - - comment(# Returns a set of html select-tags (one for hour and minute\)) - reserved(def) method(select_time)operator(()ident(datetime) operator(=) constant(Time)operator(.)ident(now)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(h) operator(=) ident(select_hour)operator(()ident(datetime)operator(,) ident(options)operator(\)) operator(+) ident(select_minute)operator(()ident(datetime)operator(,) ident(options)operator(\)) operator(+) operator(()ident(options)operator([)symbol(:include_seconds)operator(]) operator(?) ident(select_second)operator(()ident(datetime)operator(,) ident(options)operator(\)) operator(:) stringoperator(\)) - reserved(end) - - comment(# Returns a select tag with options for each of the seconds 0 through 59 with the current second selected.) - comment(# The second can also be substituted for a second number.) - comment(# Override the field name using the :field_name option, 'second' by default.) - reserved(def) method(select_second)operator(()ident(datetime)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(second_options) operator(=) operator([)operator(]) - - integer(0)operator(.)ident(upto)operator(()integer(59)operator(\)) reserved(do) operator(|)ident(second)operator(|) - ident(second_options) operator(<<) operator(()operator(()ident(datetime) operator(&&) operator(()ident(datetime)operator(.)ident(kind_of?)operator(()constant(Fixnum)operator(\)) operator(?) ident(datetime) operator(:) ident(datetime)operator(.)ident(sec)operator(\)) operator(==) ident(second)operator(\)) operator(?) - string)inlinecontent()char(\\n)delimiter(\))> operator(:) - string)inlinecontent()char(\\n)delimiter(\))> - operator(\)) - reserved(end) - - ident(select_html)operator(()ident(options)operator([)symbol(:field_name)operator(]) operator(||) stringoperator(,) ident(second_options)operator(,) ident(options)operator([)symbol(:prefix)operator(])operator(,) ident(options)operator([)symbol(:include_blank)operator(])operator(,) ident(options)operator([)symbol(:discard_type)operator(])operator(,) ident(options)operator([)symbol(:disabled)operator(])operator(\)) - reserved(end) - - comment(# Returns a select tag with options for each of the minutes 0 through 59 with the current minute selected.) - comment(# Also can return a select tag with options by minute_step from 0 through 59 with the 00 minute selected) - comment(# The minute can also be substituted for a minute number.) - comment(# Override the field name using the :field_name option, 'minute' by default.) - reserved(def) method(select_minute)operator(()ident(datetime)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(minute_options) operator(=) operator([)operator(]) - - integer(0)operator(.)ident(step)operator(()integer(59)operator(,) ident(options)operator([)symbol(:minute_step)operator(]) operator(||) integer(1)operator(\)) reserved(do) operator(|)ident(minute)operator(|) - ident(minute_options) operator(<<) operator(()operator(()ident(datetime) operator(&&) operator(()ident(datetime)operator(.)ident(kind_of?)operator(()constant(Fixnum)operator(\)) operator(?) ident(datetime) operator(:) ident(datetime)operator(.)ident(min)operator(\)) operator(==) ident(minute)operator(\)) operator(?) - string)inlinecontent()char(\\n)delimiter(\))> operator(:) - string)inlinecontent()char(\\n)delimiter(\))> - operator(\)) - reserved(end) - - ident(select_html)operator(()ident(options)operator([)symbol(:field_name)operator(]) operator(||) stringoperator(,) ident(minute_options)operator(,) ident(options)operator([)symbol(:prefix)operator(])operator(,) ident(options)operator([)symbol(:include_blank)operator(])operator(,) ident(options)operator([)symbol(:discard_type)operator(])operator(,) ident(options)operator([)symbol(:disabled)operator(])operator(\)) - reserved(end) - - comment(# Returns a select tag with options for each of the hours 0 through 23 with the current hour selected.) - comment(# The hour can also be substituted for a hour number.) - comment(# Override the field name using the :field_name option, 'hour' by default.) - reserved(def) method(select_hour)operator(()ident(datetime)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(hour_options) operator(=) operator([)operator(]) - - integer(0)operator(.)ident(upto)operator(()integer(23)operator(\)) reserved(do) operator(|)ident(hour)operator(|) - ident(hour_options) operator(<<) operator(()operator(()ident(datetime) operator(&&) operator(()ident(datetime)operator(.)ident(kind_of?)operator(()constant(Fixnum)operator(\)) operator(?) ident(datetime) operator(:) ident(datetime)operator(.)ident(hour)operator(\)) operator(==) ident(hour)operator(\)) operator(?) - string)inlinecontent()char(\\n)delimiter(\))> operator(:) - string)inlinecontent()char(\\n)delimiter(\))> - operator(\)) - reserved(end) - - ident(select_html)operator(()ident(options)operator([)symbol(:field_name)operator(]) operator(||) stringoperator(,) ident(hour_options)operator(,) ident(options)operator([)symbol(:prefix)operator(])operator(,) ident(options)operator([)symbol(:include_blank)operator(])operator(,) ident(options)operator([)symbol(:discard_type)operator(])operator(,) ident(options)operator([)symbol(:disabled)operator(])operator(\)) - reserved(end) - - comment(# Returns a select tag with options for each of the days 1 through 31 with the current day selected.) - comment(# The date can also be substituted for a hour number.) - comment(# Override the field name using the :field_name option, 'day' by default.) - reserved(def) method(select_day)operator(()ident(date)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(day_options) operator(=) operator([)operator(]) - - integer(1)operator(.)ident(upto)operator(()integer(31)operator(\)) reserved(do) operator(|)ident(day)operator(|) - ident(day_options) operator(<<) operator(()operator(()ident(date) operator(&&) operator(()ident(date)operator(.)ident(kind_of?)operator(()constant(Fixnum)operator(\)) operator(?) ident(date) operator(:) ident(date)operator(.)ident(day)operator(\)) operator(==) ident(day)operator(\)) operator(?) - string)inlinecontent()char(\\n)delimiter(\))> operator(:) - string)inlinecontent()char(\\n)delimiter(\))> - operator(\)) - reserved(end) - - ident(select_html)operator(()ident(options)operator([)symbol(:field_name)operator(]) operator(||) stringoperator(,) ident(day_options)operator(,) ident(options)operator([)symbol(:prefix)operator(])operator(,) ident(options)operator([)symbol(:include_blank)operator(])operator(,) ident(options)operator([)symbol(:discard_type)operator(])operator(,) ident(options)operator([)symbol(:disabled)operator(])operator(\)) - reserved(end) - - comment(# Returns a select tag with options for each of the months January through December with the current month selected.) - comment(# The month names are presented as keys (what's shown to the user\) and the month numbers (1-12\) are used as values) - comment(# (what's submitted to the server\). It's also possible to use month numbers for the presentation instead of names --) - comment(# set the :use_month_numbers key in +options+ to true for this to happen. If you want both numbers and names,) - comment(# set the :add_month_numbers key in +options+ to true. Examples:) - comment(#) - comment(# select_month(Date.today\) # Will use keys like "January", "March") - comment(# select_month(Date.today, :use_month_numbers => true\) # Will use keys like "1", "3") - comment(# select_month(Date.today, :add_month_numbers => true\) # Will use keys like "1 - January", "3 - March") - comment(#) - comment(# Override the field name using the :field_name option, 'month' by default.) - comment(#) - comment(# If you would prefer to show month names as abbreviations, set the) - comment(# :use_short_month key in +options+ to true.) - reserved(def) method(select_month)operator(()ident(date)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(month_options) operator(=) operator([)operator(]) - ident(month_names) operator(=) ident(options)operator([)symbol(:use_short_month)operator(]) operator(?) constant(Date)operator(::)constant(ABBR_MONTHNAMES) operator(:) constant(Date)operator(::)constant(MONTHNAMES) - - integer(1)operator(.)ident(upto)operator(()integer(12)operator(\)) reserved(do) operator(|)ident(month_number)operator(|) - ident(month_name) operator(=) reserved(if) ident(options)operator([)symbol(:use_month_numbers)operator(]) - ident(month_number) - reserved(elsif) ident(options)operator([)symbol(:add_month_numbers)operator(]) - ident(month_number)operator(.)ident(to_s) operator(+) string operator(+) ident(month_names)operator([)ident(month_number)operator(]) - reserved(else) - ident(month_names)operator([)ident(month_number)operator(]) - reserved(end) - - ident(month_options) operator(<<) operator(()operator(()ident(date) operator(&&) operator(()ident(date)operator(.)ident(kind_of?)operator(()constant(Fixnum)operator(\)) operator(?) ident(date) operator(:) ident(date)operator(.)ident(month)operator(\)) operator(==) ident(month_number)operator(\)) operator(?) - string)inlinecontent()char(\\n)delimiter(\))> operator(:) - string)inlinecontent()char(\\n)delimiter(\))> - operator(\)) - reserved(end) - - ident(select_html)operator(()ident(options)operator([)symbol(:field_name)operator(]) operator(||) stringoperator(,) ident(month_options)operator(,) ident(options)operator([)symbol(:prefix)operator(])operator(,) ident(options)operator([)symbol(:include_blank)operator(])operator(,) ident(options)operator([)symbol(:discard_type)operator(])operator(,) ident(options)operator([)symbol(:disabled)operator(])operator(\)) - reserved(end) - - comment(# Returns a select tag with options for each of the five years on each side of the current, which is selected. The five year radius) - comment(# can be changed using the :start_year and :end_year keys in the +options+. Both ascending and descending year) - comment(# lists are supported by making :start_year less than or greater than :end_year. The date can also be) - comment(# substituted for a year given as a number. Example:) - comment(#) - comment(# select_year(Date.today, :start_year => 1992, :end_year => 2007\) # ascending year values) - comment(# select_year(Date.today, :start_year => 2005, :end_year => 1900\) # descending year values) - comment(#) - comment(# Override the field name using the :field_name option, 'year' by default.) - reserved(def) method(select_year)operator(()ident(date)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(year_options) operator(=) operator([)operator(]) - ident(y) operator(=) ident(date) operator(?) operator(()ident(date)operator(.)ident(kind_of?)operator(()constant(Fixnum)operator(\)) operator(?) operator(()ident(y) operator(=) operator(()ident(date) operator(==) integer(0)operator(\)) operator(?) constant(Date)operator(.)ident(today)operator(.)ident(year) operator(:) ident(date)operator(\)) operator(:) ident(date)operator(.)ident(year)operator(\)) operator(:) constant(Date)operator(.)ident(today)operator(.)ident(year) - - ident(start_year)operator(,) ident(end_year) operator(=) operator(()ident(options)operator([)symbol(:start_year)operator(]) operator(||) ident(y)operator(-)integer(5)operator(\))operator(,) operator(()ident(options)operator([)symbol(:end_year)operator(]) operator(||) ident(y)operator(+)integer(5)operator(\)) - ident(step_val) operator(=) ident(start_year) operator(<) ident(end_year) operator(?) integer(1) operator(:) integer(-1) - - ident(start_year)operator(.)ident(step)operator(()ident(end_year)operator(,) ident(step_val)operator(\)) reserved(do) operator(|)ident(year)operator(|) - ident(year_options) operator(<<) operator(()operator(()ident(date) operator(&&) operator(()ident(date)operator(.)ident(kind_of?)operator(()constant(Fixnum)operator(\)) operator(?) ident(date) operator(:) ident(date)operator(.)ident(year)operator(\)) operator(==) ident(year)operator(\)) operator(?) - string)inlinecontent()char(\\n)delimiter(\))> operator(:) - string)inlinecontent()char(\\n)delimiter(\))> - operator(\)) - reserved(end) - - ident(select_html)operator(()ident(options)operator([)symbol(:field_name)operator(]) operator(||) stringoperator(,) ident(year_options)operator(,) ident(options)operator([)symbol(:prefix)operator(])operator(,) ident(options)operator([)symbol(:include_blank)operator(])operator(,) ident(options)operator([)symbol(:discard_type)operator(])operator(,) ident(options)operator([)symbol(:disabled)operator(])operator(\)) - reserved(end) - - ident(private) - reserved(def) method(select_html)operator(()ident(type)operator(,) ident(options)operator(,) ident(prefix) operator(=) pre_constant(nil)operator(,) ident(include_blank) operator(=) pre_constant(false)operator(,) ident(discard_type) operator(=) pre_constant(false)operator(,) ident(disabled) operator(=) pre_constant(false)operator(\)) - ident(select_html) operator(=) stringcontent(])delimiter(")> reserved(unless) ident(discard_type) - ident(select_html) operator(<<) string - ident(select_html) operator(<<) string reserved(if) ident(disabled) - ident(select_html) operator(<<) string)char(\\n)delimiter(\))> - ident(select_html) operator(<<) string)char(\\n)delimiter(\))> reserved(if) ident(include_blank) - ident(select_html) operator(<<) ident(options)operator(.)ident(to_s) - ident(select_html) operator(<<) string)char(\\n)delimiter(")> - reserved(end) - - reserved(def) method(leading_zero_on_single_digits)operator(()ident(number)operator(\)) - ident(number) operator(>) integer(9) operator(?) ident(number) operator(:) stringdelimiter(")> - reserved(end) - reserved(end) - - reserved(class) class(InstanceTag) comment(#:nodoc:) - ident(include) constant(DateHelper) - - reserved(def) method(to_date_select_tag)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(defaults) operator(=) operator({) symbol(:discard_type) operator(=)operator(>) pre_constant(true) operator(}) - ident(options) operator(=) ident(defaults)operator(.)ident(merge)operator(()ident(options)operator(\)) - ident(options_with_prefix) operator(=) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(position)operator(|) ident(options)operator(.)ident(merge)operator(()symbol(:prefix) operator(=)operator(>) stringcontent([)inlinecontent(()inlinecontent(i\)])delimiter(")>operator(\)) operator(}) - ident(date) operator(=) ident(options)operator([)symbol(:include_blank)operator(]) operator(?) operator(()ident(value) operator(||) integer(0)operator(\)) operator(:) operator(()ident(value) operator(||) constant(Date)operator(.)ident(today)operator(\)) - - ident(date_select) operator(=) string - ident(options)operator([)symbol(:order)operator(]) operator(=) operator([)symbol(:month)operator(,) symbol(:year)operator(,) symbol(:day)operator(]) reserved(if) ident(options)operator([)symbol(:month_before_year)operator(]) comment(# For backwards compatibility) - ident(options)operator([)symbol(:order)operator(]) operator(||=) operator([)symbol(:year)operator(,) symbol(:month)operator(,) symbol(:day)operator(]) - - ident(position) operator(=) operator({)symbol(:year) operator(=)operator(>) integer(1)operator(,) symbol(:month) operator(=)operator(>) integer(2)operator(,) symbol(:day) operator(=)operator(>) integer(3)operator(}) - - ident(discard) operator(=) operator({)operator(}) - ident(discard)operator([)symbol(:year)operator(]) operator(=) pre_constant(true) reserved(if) ident(options)operator([)symbol(:discard_year)operator(]) - ident(discard)operator([)symbol(:month)operator(]) operator(=) pre_constant(true) reserved(if) ident(options)operator([)symbol(:discard_month)operator(]) - ident(discard)operator([)symbol(:day)operator(]) operator(=) pre_constant(true) reserved(if) ident(options)operator([)symbol(:discard_day)operator(]) reserved(or) ident(options)operator([)symbol(:discard_month)operator(]) - - ident(options)operator([)symbol(:order)operator(])operator(.)ident(each) reserved(do) operator(|)ident(param)operator(|) - ident(date_select) operator(<<) pre_constant(self)operator(.)ident(send)operator(()stringdelimiter(")>operator(,) ident(date)operator(,) ident(options_with_prefix)operator(.)ident(call)operator(()ident(position)operator([)ident(param)operator(])operator(\))operator(\)) reserved(unless) ident(discard)operator([)ident(param)operator(]) - reserved(end) - - ident(date_select) - reserved(end) - - reserved(def) method(to_datetime_select_tag)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(defaults) operator(=) operator({) symbol(:discard_type) operator(=)operator(>) pre_constant(true) operator(}) - ident(options) operator(=) ident(defaults)operator(.)ident(merge)operator(()ident(options)operator(\)) - ident(options_with_prefix) operator(=) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(position)operator(|) ident(options)operator(.)ident(merge)operator(()symbol(:prefix) operator(=)operator(>) stringcontent([)inlinecontent(()inlinecontent(i\)])delimiter(")>operator(\)) operator(}) - ident(datetime) operator(=) ident(options)operator([)symbol(:include_blank)operator(]) operator(?) operator(()ident(value) operator(||) pre_constant(nil)operator(\)) operator(:) operator(()ident(value) operator(||) constant(Time)operator(.)ident(now)operator(\)) - - ident(datetime_select) operator(=) ident(select_year)operator(()ident(datetime)operator(,) ident(options_with_prefix)operator(.)ident(call)operator(()integer(1)operator(\))operator(\)) - ident(datetime_select) operator(<<) ident(select_month)operator(()ident(datetime)operator(,) ident(options_with_prefix)operator(.)ident(call)operator(()integer(2)operator(\))operator(\)) reserved(unless) ident(options)operator([)symbol(:discard_month)operator(]) - ident(datetime_select) operator(<<) ident(select_day)operator(()ident(datetime)operator(,) ident(options_with_prefix)operator(.)ident(call)operator(()integer(3)operator(\))operator(\)) reserved(unless) ident(options)operator([)symbol(:discard_day)operator(]) operator(||) ident(options)operator([)symbol(:discard_month)operator(]) - ident(datetime_select) operator(<<) string operator(+) ident(select_hour)operator(()ident(datetime)operator(,) ident(options_with_prefix)operator(.)ident(call)operator(()integer(4)operator(\))operator(\)) reserved(unless) ident(options)operator([)symbol(:discard_hour)operator(]) - ident(datetime_select) operator(<<) string operator(+) ident(select_minute)operator(()ident(datetime)operator(,) ident(options_with_prefix)operator(.)ident(call)operator(()integer(5)operator(\))operator(\)) reserved(unless) ident(options)operator([)symbol(:discard_minute)operator(]) operator(||) ident(options)operator([)symbol(:discard_hour)operator(]) - - ident(datetime_select) - reserved(end) - reserved(end) - - reserved(class) class(FormBuilder) - reserved(def) method(date_select)operator(()ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - instance_variable(@template)operator(.)ident(date_select)operator(()instance_variable(@object_name)operator(,) ident(method)operator(,) ident(options)operator(.)ident(merge)operator(()symbol(:object) operator(=)operator(>) instance_variable(@object)operator(\))operator(\)) - reserved(end) - - reserved(def) method(datetime_select)operator(()ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - instance_variable(@template)operator(.)ident(datetime_select)operator(()instance_variable(@object_name)operator(,) ident(method)operator(,) ident(options)operator(.)ident(merge)operator(()symbol(:object) operator(=)operator(>) instance_variable(@object)operator(\))operator(\)) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# Provides a set of methods for making it easier to locate problems.) - reserved(module) class(DebugHelper) - comment(# Returns a
-tag set with the +object+ dumped by YAML. Very readable way to inspect an object.)
-      reserved(def) method(debug)operator(()ident(object)operator(\))
-        reserved(begin)
-          constant(Marshal)operator(::)ident(dump)operator(()ident(object)operator(\))
-          string)inlineoperator(,) stringoperator(\))inline_delimiter(})>content(
)delimiter(")> - reserved(rescue) constant(Object) operator(=)operator(>) ident(e) - comment(# Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback) - string)inlinecontent()delimiter(")> - reserved(end) - reserved(end) - reserved(end) - reserved(end) -ident(endrequire) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# Provides a set of methods for working with forms and especially forms related to objects assigned to the template.) - comment(# The following is an example of a complete form for a person object that works for both creates and updates built) - comment(# with all the form helpers. The @person object was assigned by an action on the controller:) - comment(#
) - comment(# Name:) - comment(# <%= text_field "person", "name", "size" => 20 %>) - comment(#) - comment(# Password:) - comment(# <%= password_field "person", "password", "maxsize" => 20 %>) - comment(#) - comment(# Single?:) - comment(# <%= check_box "person", "single" %>) - comment(#) - comment(# Description:) - comment(# <%= text_area "person", "description", "cols" => 20 %>) - comment(#) - comment(# ) - comment(#
) - comment(#) - comment(# ...is compiled to:) - comment(#) - comment(#
) - comment(# Name:) - comment(# ) - comment(#) - comment(# Password:) - comment(# ) - comment(#) - comment(# Single?:) - comment(# ) - comment(#) - comment(# Description:) - comment(# ) - comment(#) - comment(# ) - comment(#
) - comment(#) - comment(# If the object name contains square brackets the id for the object will be inserted. Example:) - comment(#) - comment(# <%= text_field "person[]", "name" %> ) - comment(# ) - comment(# ...becomes:) - comment(#) - comment(# ) - comment(#) - comment(# If the helper is being used to generate a repetitive sequence of similar form elements, for example in a partial) - comment(# used by render_collection_of_partials, the "index" option may come in handy. Example:) - comment(#) - comment(# <%= text_field "person", "name", "index" => 1 %>) - comment(#) - comment(# becomes) - comment(#) - comment(# ) - comment(#) - comment(# There's also methods for helping to build form tags in link:classes/ActionView/Helpers/FormOptionsHelper.html,) - comment(# link:classes/ActionView/Helpers/DateHelper.html, and link:classes/ActionView/Helpers/ActiveRecordHelper.html) - reserved(module) class(FormHelper) - comment(# Creates a form and a scope around a specific model object, which is then used as a base for questioning about) - comment(# values for the fields. Examples:) - comment(#) - comment(# <% form_for :person, @person, :url => { :action => "update" } do |f| %>) - comment(# First name: <%= f.text_field :first_name %>) - comment(# Last name : <%= f.text_field :last_name %>) - comment(# Biography : <%= f.text_area :biography %>) - comment(# Admin? : <%= f.check_box :admin %>) - comment(# <% end %>) - comment(#) - comment(# Worth noting is that the form_for tag is called in a ERb evaluation block, not a ERb output block. So that's <% %>, ) - comment(# not <%= %>. Also worth noting is that the form_for yields a form_builder object, in this example as f, which emulates) - comment(# the API for the stand-alone FormHelper methods, but without the object name. So instead of text_field :person, :name,) - comment(# you get away with f.text_field :name. ) - comment(#) - comment(# That in itself is a modest increase in comfort. The big news is that form_for allows us to more easily escape the instance) - comment(# variable convention, so while the stand-alone approach would require text_field :person, :name, :object => person ) - comment(# to work with local variables instead of instance ones, the form_for calls remain the same. You simply declare once with ) - comment(# :person, person and all subsequent field calls save :person and :object => person.) - comment(#) - comment(# Also note that form_for doesn't create an exclusive scope. It's still possible to use both the stand-alone FormHelper methods) - comment(# and methods from FormTagHelper. Example:) - comment(#) - comment(# <% form_for :person, @person, :url => { :action => "update" } do |f| %>) - comment(# First name: <%= f.text_field :first_name %>) - comment(# Last name : <%= f.text_field :last_name %>) - comment(# Biography : <%= text_area :person, :biography %>) - comment(# Admin? : <%= check_box_tag "person[admin]", @person.company.admin? %>) - comment(# <% end %>) - comment(#) - comment(# Note: This also works for the methods in FormOptionHelper and DateHelper that are designed to work with an object as base.) - comment(# Like collection_select and datetime_select.) - comment(#) - comment(# Html attributes for the form tag can be given as :html => {...}. Example:) - comment(# ) - comment(# <% form_for :person, @person, :html => {:id => 'person_form'} do |f| %>) - comment(# ...) - comment(# <% end %>) - comment(#) - comment(# You can also build forms using a customized FormBuilder class. Subclass FormBuilder and override or define some more helpers,) - comment(# then use your custom builder like so:) - comment(# ) - comment(# <% form_for :person, @person, :url => { :action => "update" }, :builder => LabellingFormBuilder do |f| %>) - comment(# <%= f.text_field :first_name %>) - comment(# <%= f.text_field :last_name %>) - comment(# <%= text_area :person, :biography %>) - comment(# <%= check_box_tag "person[admin]", @person.company.admin? %>) - comment(# <% end %>) - comment(# ) - comment(# In many cases you will want to wrap the above in another helper, such as:) - comment(#) - comment(# def labelled_form_for(name, object, options, &proc\)) - comment(# form_for(name, object, options.merge(:builder => LabellingFormBuiler\), &proc\)) - comment(# end) - comment(#) - reserved(def) method(form_for)operator(()ident(object_name)operator(,) operator(*)ident(args)operator(,) operator(&)ident(proc)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string reserved(unless) ident(block_given?) - ident(options) operator(=) ident(args)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(args)operator(.)ident(pop) operator(:) operator({)operator(}) - ident(concat)operator(()ident(form_tag)operator(()ident(options)operator(.)ident(delete)operator(()symbol(:url)operator(\)) operator(||) operator({)operator(})operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:html)operator(\)) operator(||) operator({)operator(})operator(\))operator(,) ident(proc)operator(.)ident(binding)operator(\)) - ident(fields_for)operator(()ident(object_name)operator(,) operator(*)operator(()ident(args) operator(<<) ident(options)operator(\))operator(,) operator(&)ident(proc)operator(\)) - ident(concat)operator(()string)delimiter(')>operator(,) ident(proc)operator(.)ident(binding)operator(\)) - reserved(end) - - comment(# Creates a scope around a specific model object like form_for, but doesn't create the form tags themselves. This makes) - comment(# fields_for suitable for specifying additional model objects in the same form. Example:) - comment(#) - comment(# <% form_for :person, @person, :url => { :action => "update" } do |person_form| %>) - comment(# First name: <%= person_form.text_field :first_name %>) - comment(# Last name : <%= person_form.text_field :last_name %>) - comment(# ) - comment(# <% fields_for :permission, @person.permission do |permission_fields| %>) - comment(# Admin? : <%= permission_fields.check_box :admin %>) - comment(# <% end %>) - comment(# <% end %>) - comment(#) - comment(# Note: This also works for the methods in FormOptionHelper and DateHelper that are designed to work with an object as base.) - comment(# Like collection_select and datetime_select.) - reserved(def) method(fields_for)operator(()ident(object_name)operator(,) operator(*)ident(args)operator(,) operator(&)ident(proc)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string reserved(unless) ident(block_given?) - ident(options) operator(=) ident(args)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(args)operator(.)ident(pop) operator(:) operator({)operator(}) - ident(object) operator(=) ident(args)operator(.)ident(first) - reserved(yield)operator(()operator(()ident(options)operator([)symbol(:builder)operator(]) operator(||) constant(FormBuilder)operator(\))operator(.)ident(new)operator(()ident(object_name)operator(,) ident(object)operator(,) pre_constant(self)operator(,) ident(options)operator(,) ident(proc)operator(\))operator(\)) - reserved(end) - - comment(# Returns an input tag of the "text" type tailored for accessing a specified attribute (identified by +method+\) on an object) - comment(# assigned to the template (identified by +object+\). Additional options on the input tag can be passed as a) - comment(# hash with +options+.) - comment(#) - comment(# Examples (call, result\):) - comment(# text_field("post", "title", "size" => 20\)) - comment(# ) - reserved(def) method(text_field)operator(()ident(object_name)operator(,) ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object_name)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_input_field_tag)operator(()stringoperator(,) ident(options)operator(\)) - reserved(end) - - comment(# Works just like text_field, but returns an input tag of the "password" type instead.) - reserved(def) method(password_field)operator(()ident(object_name)operator(,) ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object_name)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_input_field_tag)operator(()stringoperator(,) ident(options)operator(\)) - reserved(end) - - comment(# Works just like text_field, but returns an input tag of the "hidden" type instead.) - reserved(def) method(hidden_field)operator(()ident(object_name)operator(,) ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object_name)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_input_field_tag)operator(()stringoperator(,) ident(options)operator(\)) - reserved(end) - - comment(# Works just like text_field, but returns an input tag of the "file" type instead, which won't have a default value.) - reserved(def) method(file_field)operator(()ident(object_name)operator(,) ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object_name)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_input_field_tag)operator(()stringoperator(,) ident(options)operator(\)) - reserved(end) - - comment(# Returns a textarea opening and closing tag set tailored for accessing a specified attribute (identified by +method+\)) - comment(# on an object assigned to the template (identified by +object+\). Additional options on the input tag can be passed as a) - comment(# hash with +options+.) - comment(#) - comment(# Example (call, result\):) - comment(# text_area("post", "body", "cols" => 20, "rows" => 40\)) - comment(# ) - reserved(def) method(text_area)operator(()ident(object_name)operator(,) ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object_name)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_text_area_tag)operator(()ident(options)operator(\)) - reserved(end) - - comment(# Returns a checkbox tag tailored for accessing a specified attribute (identified by +method+\) on an object) - comment(# assigned to the template (identified by +object+\). It's intended that +method+ returns an integer and if that) - comment(# integer is above zero, then the checkbox is checked. Additional options on the input tag can be passed as a) - comment(# hash with +options+. The +checked_value+ defaults to 1 while the default +unchecked_value+) - comment(# is set to 0 which is convenient for boolean values. Usually unchecked checkboxes don't post anything.) - comment(# We work around this problem by adding a hidden value with the same name as the checkbox.) - comment(#) - comment(# Example (call, result\). Imagine that @post.validated? returns 1:) - comment(# check_box("post", "validated"\)) - comment(# ) - comment(# ) - comment(#) - comment(# Example (call, result\). Imagine that @puppy.gooddog returns no:) - comment(# check_box("puppy", "gooddog", {}, "yes", "no"\)) - comment(# ) - comment(# ) - reserved(def) method(check_box)operator(()ident(object_name)operator(,) ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(,) ident(checked_value) operator(=) stringoperator(,) ident(unchecked_value) operator(=) stringoperator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object_name)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_check_box_tag)operator(()ident(options)operator(,) ident(checked_value)operator(,) ident(unchecked_value)operator(\)) - reserved(end) - - comment(# Returns a radio button tag for accessing a specified attribute (identified by +method+\) on an object) - comment(# assigned to the template (identified by +object+\). If the current value of +method+ is +tag_value+ the) - comment(# radio button will be checked. Additional options on the input tag can be passed as a) - comment(# hash with +options+.) - comment(# Example (call, result\). Imagine that @post.category returns "rails":) - comment(# radio_button("post", "category", "rails"\)) - comment(# radio_button("post", "category", "java"\)) - comment(# ) - comment(# ) - comment(#) - reserved(def) method(radio_button)operator(()ident(object_name)operator(,) ident(method)operator(,) ident(tag_value)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object_name)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_radio_button_tag)operator(()ident(tag_value)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(InstanceTag) comment(#:nodoc:) - ident(include) constant(Helpers)operator(::)constant(TagHelper) - - ident(attr_reader) symbol(:method_name)operator(,) symbol(:object_name) - - constant(DEFAULT_FIELD_OPTIONS) operator(=) operator({) string operator(=)operator(>) integer(30) operator(})operator(.)ident(freeze) reserved(unless) ident(const_defined?)operator(()symbol(:DEFAULT_FIELD_OPTIONS)operator(\)) - constant(DEFAULT_RADIO_OPTIONS) operator(=) operator({) operator(})operator(.)ident(freeze) reserved(unless) ident(const_defined?)operator(()symbol(:DEFAULT_RADIO_OPTIONS)operator(\)) - constant(DEFAULT_TEXT_AREA_OPTIONS) operator(=) operator({) string operator(=)operator(>) integer(40)operator(,) string operator(=)operator(>) integer(20) operator(})operator(.)ident(freeze) reserved(unless) ident(const_defined?)operator(()symbol(:DEFAULT_TEXT_AREA_OPTIONS)operator(\)) - constant(DEFAULT_DATE_OPTIONS) operator(=) operator({) symbol(:discard_type) operator(=)operator(>) pre_constant(true) operator(})operator(.)ident(freeze) reserved(unless) ident(const_defined?)operator(()symbol(:DEFAULT_DATE_OPTIONS)operator(\)) - - reserved(def) method(initialize)operator(()ident(object_name)operator(,) ident(method_name)operator(,) ident(template_object)operator(,) ident(local_binding) operator(=) pre_constant(nil)operator(,) ident(object) operator(=) pre_constant(nil)operator(\)) - instance_variable(@object_name)operator(,) instance_variable(@method_name) operator(=) ident(object_name)operator(.)ident(to_s)operator(.)ident(dup)operator(,) ident(method_name)operator(.)ident(to_s)operator(.)ident(dup) - instance_variable(@template_object)operator(,) instance_variable(@local_binding) operator(=) ident(template_object)operator(,) ident(local_binding) - instance_variable(@object) operator(=) ident(object) - reserved(if) instance_variable(@object_name)operator(.)ident(sub!)operator(()regexpoperator(,)stringoperator(\)) - instance_variable(@auto_index) operator(=) instance_variable(@template_object)operator(.)ident(instance_variable_get)operator(()stringdelimiter(")>operator(\))operator(.)ident(id_before_type_cast) - reserved(end) - reserved(end) - - reserved(def) method(to_input_field_tag)operator(()ident(field_type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options) operator(=) ident(options)operator(.)ident(stringify_keys) - ident(options)operator([)stringoperator(]) operator(||=) ident(options)operator([)stringoperator(]) operator(||) constant(DEFAULT_FIELD_OPTIONS)operator([)stringoperator(]) - ident(options) operator(=) constant(DEFAULT_FIELD_OPTIONS)operator(.)ident(merge)operator(()ident(options)operator(\)) - reserved(if) ident(field_type) operator(==) string - ident(options)operator(.)ident(delete)operator(()stringoperator(\)) - reserved(end) - ident(options)operator([)stringoperator(]) operator(=) ident(field_type) - ident(options)operator([)stringoperator(]) operator(||=) ident(value_before_type_cast) reserved(unless) ident(field_type) operator(==) string - ident(add_default_name_and_id)operator(()ident(options)operator(\)) - ident(tag)operator(()stringoperator(,) ident(options)operator(\)) - reserved(end) - - reserved(def) method(to_radio_button_tag)operator(()ident(tag_value)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options) operator(=) constant(DEFAULT_RADIO_OPTIONS)operator(.)ident(merge)operator(()ident(options)operator(.)ident(stringify_keys)operator(\)) - ident(options)operator([)stringoperator(]) operator(=) string - ident(options)operator([)stringoperator(]) operator(=) ident(tag_value) - ident(options)operator([)stringoperator(]) operator(=) string reserved(if) ident(value)operator(.)ident(to_s) operator(==) ident(tag_value)operator(.)ident(to_s) - ident(pretty_tag_value) operator(=) ident(tag_value)operator(.)ident(to_s)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(downcase) - ident(options)operator([)stringoperator(]) operator(=) instance_variable(@auto_index) operator(?) - stringcontent(_)inlinecontent(_)inlinecontent(_)inlinedelimiter(")> operator(:) - stringcontent(_)inlinecontent(_)inlinedelimiter(")> - ident(add_default_name_and_id)operator(()ident(options)operator(\)) - ident(tag)operator(()stringoperator(,) ident(options)operator(\)) - reserved(end) - - reserved(def) method(to_text_area_tag)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(options) operator(=) constant(DEFAULT_TEXT_AREA_OPTIONS)operator(.)ident(merge)operator(()ident(options)operator(.)ident(stringify_keys)operator(\)) - ident(add_default_name_and_id)operator(()ident(options)operator(\)) - ident(content_tag)operator(()stringoperator(,) ident(html_escape)operator(()ident(options)operator(.)ident(delete)operator(()stringoperator(\)) operator(||) ident(value_before_type_cast)operator(\))operator(,) ident(options)operator(\)) - reserved(end) - - reserved(def) method(to_check_box_tag)operator(()ident(options) operator(=) operator({)operator(})operator(,) ident(checked_value) operator(=) stringoperator(,) ident(unchecked_value) operator(=) stringoperator(\)) - ident(options) operator(=) ident(options)operator(.)ident(stringify_keys) - ident(options)operator([)stringoperator(]) operator(=) string - ident(options)operator([)stringoperator(]) operator(=) ident(checked_value) - ident(checked) operator(=) reserved(case) ident(value) - reserved(when) constant(TrueClass)operator(,) constant(FalseClass) - ident(value) - reserved(when) constant(NilClass) - pre_constant(false) - reserved(when) constant(Integer) - ident(value) operator(!=) integer(0) - reserved(when) constant(String) - ident(value) operator(==) ident(checked_value) - reserved(else) - ident(value)operator(.)ident(to_i) operator(!=) integer(0) - reserved(end) - reserved(if) ident(checked) operator(||) ident(options)operator([)stringoperator(]) operator(==) string - ident(options)operator([)stringoperator(]) operator(=) string - reserved(else) - ident(options)operator(.)ident(delete)operator(()stringoperator(\)) - reserved(end) - ident(add_default_name_and_id)operator(()ident(options)operator(\)) - ident(tag)operator(()stringoperator(,) ident(options)operator(\)) operator(<<) ident(tag)operator(()stringoperator(,) string operator(=)operator(>) ident(options)operator([)stringoperator(])operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(unchecked_value)operator(\)) - reserved(end) - - reserved(def) method(to_date_tag)operator(()operator(\)) - ident(defaults) operator(=) constant(DEFAULT_DATE_OPTIONS)operator(.)ident(dup) - ident(date) operator(=) ident(value) operator(||) constant(Date)operator(.)ident(today) - ident(options) operator(=) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(position)operator(|) ident(defaults)operator(.)ident(merge)operator(()symbol(:prefix) operator(=)operator(>) stringcontent([)inlinecontent(()inlinecontent(i\)])delimiter(")>operator(\)) operator(}) - ident(html_day_select)operator(()ident(date)operator(,) ident(options)operator(.)ident(call)operator(()integer(3)operator(\))operator(\)) operator(+) - ident(html_month_select)operator(()ident(date)operator(,) ident(options)operator(.)ident(call)operator(()integer(2)operator(\))operator(\)) operator(+) - ident(html_year_select)operator(()ident(date)operator(,) ident(options)operator(.)ident(call)operator(()integer(1)operator(\))operator(\)) - reserved(end) - - reserved(def) method(to_boolean_select_tag)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(options) operator(=) ident(options)operator(.)ident(stringify_keys) - ident(add_default_name_and_id)operator(()ident(options)operator(\)) - ident(tag_text) operator(=) string - ident(tag_text) operator(<<) ident(tag_options)operator(()ident(options)operator(\)) - ident(tag_text) operator(<<) string)delimiter(")> - reserved(end) - - reserved(def) method(to_content_tag)operator(()ident(tag_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(content_tag)operator(()ident(tag_name)operator(,) ident(value)operator(,) ident(options)operator(\)) - reserved(end) - - reserved(def) method(object) - instance_variable(@object) operator(||) instance_variable(@template_object)operator(.)ident(instance_variable_get)operator(()stringdelimiter(")>operator(\)) - reserved(end) - - reserved(def) method(value) - reserved(unless) ident(object)operator(.)ident(nil?) - ident(object)operator(.)ident(send)operator(()instance_variable(@method_name)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(value_before_type_cast) - reserved(unless) ident(object)operator(.)ident(nil?) - ident(object)operator(.)ident(respond_to?)operator(()instance_variable(@method_name) operator(+) stringoperator(\)) operator(?) - ident(object)operator(.)ident(send)operator(()instance_variable(@method_name) operator(+) stringoperator(\)) operator(:) - ident(object)operator(.)ident(send)operator(()instance_variable(@method_name)operator(\)) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(add_default_name_and_id)operator(()ident(options)operator(\)) - reserved(if) ident(options)operator(.)ident(has_key?)operator(()stringoperator(\)) - ident(options)operator([)stringoperator(]) operator(||=) ident(tag_name_with_index)operator(()ident(options)operator([)stringoperator(])operator(\)) - ident(options)operator([)stringoperator(]) operator(||=) ident(tag_id_with_index)operator(()ident(options)operator([)stringoperator(])operator(\)) - ident(options)operator(.)ident(delete)operator(()stringoperator(\)) - reserved(elsif) instance_variable(@auto_index) - ident(options)operator([)stringoperator(]) operator(||=) ident(tag_name_with_index)operator(()instance_variable(@auto_index)operator(\)) - ident(options)operator([)stringoperator(]) operator(||=) ident(tag_id_with_index)operator(()instance_variable(@auto_index)operator(\)) - reserved(else) - ident(options)operator([)stringoperator(]) operator(||=) ident(tag_name) - ident(options)operator([)stringoperator(]) operator(||=) ident(tag_id) - reserved(end) - reserved(end) - - reserved(def) method(tag_name) - stringcontent([)inlinecontent(])delimiter(")> - reserved(end) - - reserved(def) method(tag_name_with_index)operator(()ident(index)operator(\)) - stringcontent([)inlinecontent(][)inlinecontent(])delimiter(")> - reserved(end) - - reserved(def) method(tag_id) - stringcontent(_)inlinedelimiter(")> - reserved(end) - - reserved(def) method(tag_id_with_index)operator(()ident(index)operator(\)) - stringcontent(_)inlinecontent(_)inlinedelimiter(")> - reserved(end) - reserved(end) - - reserved(class) class(FormBuilder) comment(#:nodoc:) - comment(# The methods which wrap a form helper call.) - ident(class_inheritable_accessor) symbol(:field_helpers) - pre_constant(self)operator(.)ident(field_helpers) operator(=) operator(()constant(FormHelper)operator(.)ident(instance_methods) operator(-) operator([)stringoperator(])operator(\)) - - ident(attr_accessor) symbol(:object_name)operator(,) symbol(:object) - - reserved(def) method(initialize)operator(()ident(object_name)operator(,) ident(object)operator(,) ident(template)operator(,) ident(options)operator(,) ident(proc)operator(\)) - instance_variable(@object_name)operator(,) instance_variable(@object)operator(,) instance_variable(@template)operator(,) instance_variable(@options)operator(,) instance_variable(@proc) operator(=) ident(object_name)operator(,) ident(object)operator(,) ident(template)operator(,) ident(options)operator(,) ident(proc) - reserved(end) - - operator(()ident(field_helpers) operator(-) stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(selector)operator(|) - ident(src) operator(=) stringstringcontent((method, options = {}\) - @template.send()inlinecontent(, @object_name, method, options.merge(:object => @object\)\) - end)delimiter( - end_src)> - ident(class_eval) ident(src)operator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__) - reserved(end) - - reserved(def) method(check_box)operator(()ident(method)operator(,) ident(options) operator(=) operator({)operator(})operator(,) ident(checked_value) operator(=) stringoperator(,) ident(unchecked_value) operator(=) stringoperator(\)) - instance_variable(@template)operator(.)ident(check_box)operator(()instance_variable(@object_name)operator(,) ident(method)operator(,) ident(options)operator(.)ident(merge)operator(()symbol(:object) operator(=)operator(>) instance_variable(@object)operator(\))operator(,) ident(checked_value)operator(,) ident(unchecked_value)operator(\)) - reserved(end) - - reserved(def) method(radio_button)operator(()ident(method)operator(,) ident(tag_value)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - instance_variable(@template)operator(.)ident(radio_button)operator(()instance_variable(@object_name)operator(,) ident(method)operator(,) ident(tag_value)operator(,) ident(options)operator(.)ident(merge)operator(()symbol(:object) operator(=)operator(>) instance_variable(@object)operator(\))operator(\)) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# Provides a number of methods for turning different kinds of containers into a set of option tags.) - comment(# == Options) - comment(# The collection_select, country_select, select,) - comment(# and time_zone_select methods take an options parameter,) - comment(# a hash.) - comment(#) - comment(# * :include_blank - set to true if the first option element of the select element is a blank. Useful if there is not a default value required for the select element. For example,) - comment(#) - comment(# select("post", "category", Post::CATEGORIES, {:include_blank => true}\)) - comment(#) - comment(# could become:) - comment(#) - comment(# ) - comment(#) - comment(# * :prompt - set to true or a prompt string. When the select element doesn't have a value yet, this prepends an option with a generic prompt -- "Please select" -- or the given prompt string.) - comment(#) - comment(# Another common case is a select tag for an belongs_to-associated object. For example,) - comment(#) - comment(# select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] }\)) - comment(#) - comment(# could become:) - comment(#) - comment(# ) - reserved(module) class(FormOptionsHelper) - ident(include) constant(ERB)operator(::)constant(Util) - - comment(# Create a select tag and a series of contained option tags for the provided object and method.) - comment(# The option currently held by the object will be selected, provided that the object is available.) - comment(# See options_for_select for the required format of the choices parameter.) - comment(#) - comment(# Example with @post.person_id => 1:) - comment(# select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] }, { :include_blank => true }\)) - comment(#) - comment(# could become:) - comment(#) - comment(# ) - comment(#) - comment(# This can be used to provide a default set of options in the standard way: before rendering the create form, a) - comment(# new model instance is assigned the default options and bound to @model_name. Usually this model is not saved) - comment(# to the database. Instead, a second model object is created when the create request is received.) - comment(# This allows the user to submit a form page more than once with the expected results of creating multiple records.) - comment(# In addition, this allows a single partial to be used to generate form inputs for both edit and create forms.) - comment(#) - comment(# By default, post.person_id is the selected option. Specify :selected => value to use a different selection) - comment(# or :selected => nil to leave all options unselected.) - reserved(def) method(select)operator(()ident(object)operator(,) ident(method)operator(,) ident(choices)operator(,) ident(options) operator(=) operator({)operator(})operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_select_tag)operator(()ident(choices)operator(,) ident(options)operator(,) ident(html_options)operator(\)) - reserved(end) - - comment(# Return select and option tags for the given object and method using options_from_collection_for_select to generate the list of option tags.) - reserved(def) method(collection_select)operator(()ident(object)operator(,) ident(method)operator(,) ident(collection)operator(,) ident(value_method)operator(,) ident(text_method)operator(,) ident(options) operator(=) operator({)operator(})operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_collection_select_tag)operator(()ident(collection)operator(,) ident(value_method)operator(,) ident(text_method)operator(,) ident(options)operator(,) ident(html_options)operator(\)) - reserved(end) - - comment(# Return select and option tags for the given object and method, using country_options_for_select to generate the list of option tags.) - reserved(def) method(country_select)operator(()ident(object)operator(,) ident(method)operator(,) ident(priority_countries) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_country_select_tag)operator(()ident(priority_countries)operator(,) ident(options)operator(,) ident(html_options)operator(\)) - reserved(end) - - comment(# Return select and option tags for the given object and method, using) - comment(# #time_zone_options_for_select to generate the list of option tags.) - comment(#) - comment(# In addition to the :include_blank option documented above,) - comment(# this method also supports a :model option, which defaults) - comment(# to TimeZone. This may be used by users to specify a different time) - comment(# zone model object. (See #time_zone_options_for_select for more) - comment(# information.\)) - reserved(def) method(time_zone_select)operator(()ident(object)operator(,) ident(method)operator(,) ident(priority_zones) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - constant(InstanceTag)operator(.)ident(new)operator(()ident(object)operator(,) ident(method)operator(,) pre_constant(self)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(delete)operator(()symbol(:object)operator(\))operator(\))operator(.)ident(to_time_zone_select_tag)operator(()ident(priority_zones)operator(,) ident(options)operator(,) ident(html_options)operator(\)) - reserved(end) - - comment(# Accepts a container (hash, array, enumerable, your type\) and returns a string of option tags. Given a container) - comment(# where the elements respond to first and last (such as a two-element array\), the "lasts" serve as option values and) - comment(# the "firsts" as option text. Hashes are turned into this form automatically, so the keys become "firsts" and values) - comment(# become lasts. If +selected+ is specified, the matching "last" or element will get the selected option-tag. +Selected+) - comment(# may also be an array of values to be selected when using a multiple select.) - comment(#) - comment(# Examples (call, result\):) - comment(# options_for_select([["Dollar", "$"], ["Kroner", "DKK"]]\)) - comment(# \\n) - comment(#) - comment(# options_for_select([ "VISA", "MasterCard" ], "MasterCard"\)) - comment(# \\n) - comment(#) - comment(# options_for_select({ "Basic" => "$20", "Plus" => "$40" }, "$40"\)) - comment(# \\n) - comment(#) - comment(# options_for_select([ "VISA", "MasterCard", "Discover" ], ["VISA", "Discover"]\)) - comment(# \\n\\n) - comment(#) - comment(# NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.) - reserved(def) method(options_for_select)operator(()ident(container)operator(,) ident(selected) operator(=) pre_constant(nil)operator(\)) - ident(container) operator(=) ident(container)operator(.)ident(to_a) reserved(if) constant(Hash) operator(===) ident(container) - - ident(options_for_select) operator(=) ident(container)operator(.)ident(inject)operator(()operator([)operator(])operator(\)) reserved(do) operator(|)ident(options)operator(,) ident(element)operator(|) - reserved(if) operator(!)ident(element)operator(.)ident(is_a?)operator(()constant(String)operator(\)) reserved(and) ident(element)operator(.)ident(respond_to?)operator(()symbol(:first)operator(\)) reserved(and) ident(element)operator(.)ident(respond_to?)operator(()symbol(:last)operator(\)) - ident(is_selected) operator(=) operator(() operator(()ident(selected)operator(.)ident(respond_to?)operator(()symbol(:include?)operator(\)) operator(?) ident(selected)operator(.)ident(include?)operator(()ident(element)operator(.)ident(last)operator(\)) operator(:) ident(element)operator(.)ident(last) operator(==) ident(selected)operator(\)) operator(\)) - ident(is_selected) operator(=) operator(() operator(()ident(selected)operator(.)ident(respond_to?)operator(()symbol(:include?)operator(\)) operator(&&) operator(!)ident(selected)operator(.)ident(is_a?)operator(()constant(String)operator(\)) operator(?) ident(selected)operator(.)ident(include?)operator(()ident(element)operator(.)ident(last)operator(\)) operator(:) ident(element)operator(.)ident(last) operator(==) ident(selected)operator(\)) operator(\)) - reserved(if) ident(is_selected) - ident(options) operator(<<) stringchar(\\")content( selected=)char(\\")content(selected)char(\\")content(>)inlinecontent()delimiter(")> - reserved(else) - ident(options) operator(<<) stringchar(\\")content(>)inlinecontent()delimiter(")> - reserved(end) - reserved(else) - ident(is_selected) operator(=) operator(() operator(()ident(selected)operator(.)ident(respond_to?)operator(()symbol(:include?)operator(\)) operator(?) ident(selected)operator(.)ident(include?)operator(()ident(element)operator(\)) operator(:) ident(element) operator(==) ident(selected)operator(\)) operator(\)) - ident(is_selected) operator(=) operator(() operator(()ident(selected)operator(.)ident(respond_to?)operator(()symbol(:include?)operator(\)) operator(&&) operator(!)ident(selected)operator(.)ident(is_a?)operator(()constant(String)operator(\)) operator(?) ident(selected)operator(.)ident(include?)operator(()ident(element)operator(\)) operator(:) ident(element) operator(==) ident(selected)operator(\)) operator(\)) - ident(options) operator(<<) operator(()operator(()ident(is_selected)operator(\)) operator(?) stringchar(\\")content( selected=)char(\\")content(selected)char(\\")content(>)inlinecontent()delimiter(")> operator(:) stringchar(\\")content(>)inlinecontent()delimiter(")>operator(\)) - reserved(end) - reserved(end) - - ident(options_for_select)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - comment(# Returns a string of option tags that have been compiled by iterating over the +collection+ and assigning the) - comment(# the result of a call to the +value_method+ as the option value and the +text_method+ as the option text.) - comment(# If +selected_value+ is specified, the element returning a match on +value_method+ will get the selected option tag.) - comment(#) - comment(# Example (call, result\). Imagine a loop iterating over each +person+ in @project.people to generate an input tag:) - comment(# options_from_collection_for_select(@project.people, "id", "name"\)) - comment(# ) - comment(#) - comment(# NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.) - reserved(def) method(options_from_collection_for_select)operator(()ident(collection)operator(,) ident(value_method)operator(,) ident(text_method)operator(,) ident(selected_value) operator(=) pre_constant(nil)operator(\)) - ident(options_for_select)operator(() - ident(collection)operator(.)ident(inject)operator(()operator([)operator(])operator(\)) operator({) operator(|)ident(options)operator(,) ident(object)operator(|) ident(options) operator(<<) operator([) ident(object)operator(.)ident(send)operator(()ident(text_method)operator(\))operator(,) ident(object)operator(.)ident(send)operator(()ident(value_method)operator(\)) operator(]) operator(})operator(,) - ident(selected_value) - operator(\)) - reserved(end) - - comment(# Returns a string of option tags, like options_from_collection_for_select, but surrounds them with tags.) - comment(#) - comment(# An array of group objects are passed. Each group should return an array of options when calling group_method) - comment(# Each group should return its name when calling group_label_method.) - comment(#) - comment(# html_option_groups_from_collection(@continents, "countries", "continent_name", "country_id", "country_name", @selected_country.id\)) - comment(#) - comment(# Could become:) - comment(# ) - comment(# ) - comment(# ) - comment(# ...) - comment(# ) - comment(# ) - comment(# ) - comment(# ) - comment(# ) - comment(# ...) - comment(# ) - comment(#) - comment(# with objects of the following classes:) - comment(# class Continent) - comment(# def initialize(p_name, p_countries\) @continent_name = p_name; @countries = p_countries; end) - comment(# def continent_name(\) @continent_name; end) - comment(# def countries(\) @countries; end) - comment(# end) - comment(# class Country) - comment(# def initialize(id, name\) @id = id; @name = name end) - comment(# def country_id(\) @id; end) - comment(# def country_name(\) @name; end) - comment(# end) - comment(#) - comment(# NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.) - reserved(def) method(option_groups_from_collection_for_select)operator(()ident(collection)operator(,) ident(group_method)operator(,) ident(group_label_method)operator(,) - ident(option_key_method)operator(,) ident(option_value_method)operator(,) ident(selected_key) operator(=) pre_constant(nil)operator(\)) - ident(collection)operator(.)ident(inject)operator(()stringoperator(\)) reserved(do) operator(|)ident(options_for_select)operator(,) ident(group)operator(|) - ident(group_label_string) operator(=) ident(eval)operator(()stringdelimiter(")>operator(\)) - ident(options_for_select) operator(+=) stringchar(\\")content(>)delimiter(")> - ident(options_for_select) operator(+=) ident(options_from_collection_for_select)operator(()ident(eval)operator(()stringdelimiter(")>operator(\))operator(,) ident(option_key_method)operator(,) ident(option_value_method)operator(,) ident(selected_key)operator(\)) - ident(options_for_select) operator(+=) string)delimiter(')> - reserved(end) - reserved(end) - - comment(# Returns a string of option tags for pretty much any country in the world. Supply a country name as +selected+ to) - comment(# have it marked as the selected option tag. You can also supply an array of countries as +priority_countries+, so) - comment(# that they will be listed above the rest of the (long\) list.) - comment(#) - comment(# NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.) - reserved(def) method(country_options_for_select)operator(()ident(selected) operator(=) pre_constant(nil)operator(,) ident(priority_countries) operator(=) pre_constant(nil)operator(\)) - ident(country_options) operator(=) string - - reserved(if) ident(priority_countries) - ident(country_options) operator(+=) ident(options_for_select)operator(()ident(priority_countries)operator(,) ident(selected)operator(\)) - ident(country_options) operator(+=) string-------------)char(\\n)delimiter(")> - reserved(end) - - reserved(if) ident(priority_countries) operator(&&) ident(priority_countries)operator(.)ident(include?)operator(()ident(selected)operator(\)) - ident(country_options) operator(+=) ident(options_for_select)operator(()constant(COUNTRIES) operator(-) ident(priority_countries)operator(,) ident(selected)operator(\)) - reserved(else) - ident(country_options) operator(+=) ident(options_for_select)operator(()constant(COUNTRIES)operator(,) ident(selected)operator(\)) - reserved(end) - - reserved(return) ident(country_options) - reserved(end) - - comment(# Returns a string of option tags for pretty much any time zone in the) - comment(# world. Supply a TimeZone name as +selected+ to have it marked as the) - comment(# selected option tag. You can also supply an array of TimeZone objects) - comment(# as +priority_zones+, so that they will be listed above the rest of the) - comment(# (long\) list. (You can use TimeZone.us_zones as a convenience for) - comment(# obtaining a list of the US time zones.\)) - comment(#) - comment(# The +selected+ parameter must be either +nil+, or a string that names) - comment(# a TimeZone.) - comment(#) - comment(# By default, +model+ is the TimeZone constant (which can be obtained) - comment(# in ActiveRecord as a value object\). The only requirement is that the) - comment(# +model+ parameter be an object that responds to #all, and returns) - comment(# an array of objects that represent time zones.) - comment(#) - comment(# NOTE: Only the option tags are returned, you have to wrap this call in) - comment(# a regular HTML select tag.) - reserved(def) method(time_zone_options_for_select)operator(()ident(selected) operator(=) pre_constant(nil)operator(,) ident(priority_zones) operator(=) pre_constant(nil)operator(,) ident(model) operator(=) constant(TimeZone)operator(\)) - ident(zone_options) operator(=) string - - ident(zones) operator(=) ident(model)operator(.)ident(all) - ident(convert_zones) operator(=) ident(lambda) operator({) operator(|)ident(list)operator(|) ident(list)operator(.)ident(map) operator({) operator(|)ident(z)operator(|) operator([) ident(z)operator(.)ident(to_s)operator(,) ident(z)operator(.)ident(name) operator(]) operator(}) operator(}) - - reserved(if) ident(priority_zones) - ident(zone_options) operator(+=) ident(options_for_select)operator(()ident(convert_zones)operator([)ident(priority_zones)operator(])operator(,) ident(selected)operator(\)) - ident(zone_options) operator(+=) string-------------)char(\\n)delimiter(")> - - ident(zones) operator(=) ident(zones)operator(.)ident(reject) operator({) operator(|)ident(z)operator(|) ident(priority_zones)operator(.)ident(include?)operator(() ident(z) operator(\)) operator(}) - reserved(end) - - ident(zone_options) operator(+=) ident(options_for_select)operator(()ident(convert_zones)operator([)ident(zones)operator(])operator(,) ident(selected)operator(\)) - ident(zone_options) - reserved(end) - - ident(private) - comment(# All the countries included in the country_options output.) - constant(COUNTRIES) operator(=) operator([) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) string operator(]) reserved(unless) ident(const_defined?)operator(()stringoperator(\)) - reserved(end) - - reserved(class) class(InstanceTag) comment(#:nodoc:) - ident(include) constant(FormOptionsHelper) - - reserved(def) method(to_select_tag)operator(()ident(choices)operator(,) ident(options)operator(,) ident(html_options)operator(\)) - ident(html_options) operator(=) ident(html_options)operator(.)ident(stringify_keys) - ident(add_default_name_and_id)operator(()ident(html_options)operator(\)) - ident(selected_value) operator(=) ident(options)operator(.)ident(has_key?)operator(()symbol(:selected)operator(\)) operator(?) ident(options)operator([)symbol(:selected)operator(]) operator(:) ident(value) - ident(content_tag)operator(()stringoperator(,) ident(add_options)operator(()ident(options_for_select)operator(()ident(choices)operator(,) ident(selected_value)operator(\))operator(,) ident(options)operator(,) ident(value)operator(\))operator(,) ident(html_options)operator(\)) - reserved(end) - - reserved(def) method(to_collection_select_tag)operator(()ident(collection)operator(,) ident(value_method)operator(,) ident(text_method)operator(,) ident(options)operator(,) ident(html_options)operator(\)) - ident(html_options) operator(=) ident(html_options)operator(.)ident(stringify_keys) - ident(add_default_name_and_id)operator(()ident(html_options)operator(\)) - ident(content_tag)operator(() - stringoperator(,) ident(add_options)operator(()ident(options_from_collection_for_select)operator(()ident(collection)operator(,) ident(value_method)operator(,) ident(text_method)operator(,) ident(value)operator(\))operator(,) ident(options)operator(,) ident(value)operator(\))operator(,) ident(html_options) - operator(\)) - reserved(end) - - reserved(def) method(to_country_select_tag)operator(()ident(priority_countries)operator(,) ident(options)operator(,) ident(html_options)operator(\)) - ident(html_options) operator(=) ident(html_options)operator(.)ident(stringify_keys) - ident(add_default_name_and_id)operator(()ident(html_options)operator(\)) - ident(content_tag)operator(()stringoperator(,) ident(add_options)operator(()ident(country_options_for_select)operator(()ident(value)operator(,) ident(priority_countries)operator(\))operator(,) ident(options)operator(,) ident(value)operator(\))operator(,) ident(html_options)operator(\)) - reserved(end) - - reserved(def) method(to_time_zone_select_tag)operator(()ident(priority_zones)operator(,) ident(options)operator(,) ident(html_options)operator(\)) - ident(html_options) operator(=) ident(html_options)operator(.)ident(stringify_keys) - ident(add_default_name_and_id)operator(()ident(html_options)operator(\)) - ident(content_tag)operator(()stringoperator(,) - ident(add_options)operator(() - ident(time_zone_options_for_select)operator(()ident(value)operator(,) ident(priority_zones)operator(,) ident(options)operator([)symbol(:model)operator(]) operator(||) constant(TimeZone)operator(\))operator(,) - ident(options)operator(,) ident(value) - operator(\))operator(,) ident(html_options) - operator(\)) - reserved(end) - - ident(private) - reserved(def) method(add_options)operator(()ident(option_tags)operator(,) ident(options)operator(,) ident(value) operator(=) pre_constant(nil)operator(\)) - ident(option_tags) operator(=) string)char(\\n)delimiter(")> operator(+) ident(option_tags) reserved(if) ident(options)operator([)symbol(:include_blank)operator(]) - - reserved(if) ident(value)operator(.)ident(blank?) operator(&&) ident(options)operator([)symbol(:prompt)operator(]) - operator(()string)inlineinline_delimiter(})>content()char(\\n)delimiter(")>operator(\)) operator(+) ident(option_tags) - reserved(else) - ident(option_tags) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(FormBuilder) - reserved(def) method(select)operator(()ident(method)operator(,) ident(choices)operator(,) ident(options) operator(=) operator({)operator(})operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - instance_variable(@template)operator(.)ident(select)operator(()instance_variable(@object_name)operator(,) ident(method)operator(,) ident(choices)operator(,) ident(options)operator(.)ident(merge)operator(()symbol(:object) operator(=)operator(>) instance_variable(@object)operator(\))operator(,) ident(html_options)operator(\)) - reserved(end) - - reserved(def) method(collection_select)operator(()ident(method)operator(,) ident(collection)operator(,) ident(value_method)operator(,) ident(text_method)operator(,) ident(options) operator(=) operator({)operator(})operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - instance_variable(@template)operator(.)ident(collection_select)operator(()instance_variable(@object_name)operator(,) ident(method)operator(,) ident(collection)operator(,) ident(value_method)operator(,) ident(text_method)operator(,) ident(options)operator(.)ident(merge)operator(()symbol(:object) operator(=)operator(>) instance_variable(@object)operator(\))operator(,) ident(html_options)operator(\)) - reserved(end) - - reserved(def) method(country_select)operator(()ident(method)operator(,) ident(priority_countries) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - instance_variable(@template)operator(.)ident(country_select)operator(()instance_variable(@object_name)operator(,) ident(method)operator(,) ident(priority_countries)operator(,) ident(options)operator(.)ident(merge)operator(()symbol(:object) operator(=)operator(>) instance_variable(@object)operator(\))operator(,) ident(html_options)operator(\)) - reserved(end) - - reserved(def) method(time_zone_select)operator(()ident(method)operator(,) ident(priority_zones) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - instance_variable(@template)operator(.)ident(time_zone_select)operator(()instance_variable(@object_name)operator(,) ident(method)operator(,) ident(priority_zones)operator(,) ident(options)operator(.)ident(merge)operator(()symbol(:object) operator(=)operator(>) instance_variable(@object)operator(\))operator(,) ident(html_options)operator(\)) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# Provides a number of methods for creating form tags that doesn't rely on conventions with an object assigned to the template like) - comment(# FormHelper does. With the FormTagHelper, you provide the names and values yourself.) - comment(#) - comment(# NOTE: The html options disabled, readonly, and multiple can all be treated as booleans. So specifying :disabled => true) - comment(# will give disabled="disabled".) - reserved(module) class(FormTagHelper) - comment(# Starts a form tag that points the action to an url configured with url_for_options just like) - comment(# ActionController::Base#url_for. The method for the form defaults to POST.) - comment(#) - comment(# Options:) - comment(# * :multipart - If set to true, the enctype is set to "multipart/form-data".) - comment(# * :method - The method to use when submitting the form, usually either "get" or "post".) - reserved(def) method(form_tag)operator(()ident(url_for_options) operator(=) operator({)operator(})operator(,) ident(options) operator(=) operator({)operator(})operator(,) operator(*)ident(parameters_for_url)operator(,) operator(&)ident(proc)operator(\)) - ident(html_options) operator(=) operator({) string operator(=)operator(>) string operator(})operator(.)ident(merge)operator(()ident(options)operator(.)ident(stringify_keys)operator(\)) - ident(html_options)operator([)stringoperator(]) operator(=) string reserved(if) ident(html_options)operator(.)ident(delete)operator(()stringoperator(\)) - ident(html_options)operator([)stringoperator(]) operator(=) ident(url_for)operator(()ident(url_for_options)operator(,) operator(*)ident(parameters_for_url)operator(\)) - ident(tag) symbol(:form)operator(,) ident(html_options)operator(,) pre_constant(true) - reserved(end) - - ident(alias_method) symbol(:start_form_tag)operator(,) symbol(:form_tag) - - comment(# Outputs "") - reserved(def) method(end_form_tag) - string)delimiter(")> - reserved(end) - - comment(# Creates a dropdown selection box, or if the :multiple option is set to true, a multiple) - comment(# choice selection box.) - comment(#) - comment(# Helpers::FormOptions can be used to create common select boxes such as countries, time zones, or) - comment(# associated records.) - comment(#) - comment(# option_tags is a string containing the option tags for the select box:) - comment(# # Outputs ) - comment(# select_tag "people", "") - comment(#) - comment(# Options:) - comment(# * :multiple - If set to true the selection will allow multiple choices.) - reserved(def) method(select_tag)operator(()ident(name)operator(,) ident(option_tags) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(content_tag) symbol(:select)operator(,) ident(option_tags)operator(,) operator({) string operator(=)operator(>) ident(name)operator(,) string operator(=)operator(>) ident(name) operator(})operator(.)ident(update)operator(()ident(options)operator(.)ident(stringify_keys)operator(\)) - reserved(end) - - comment(# Creates a standard text field.) - comment(#) - comment(# Options:) - comment(# * :disabled - If set to true, the user will not be able to use this input.) - comment(# * :size - The number of visible characters that will fit in the input.) - comment(# * :maxlength - The maximum number of characters that the browser will allow the user to enter.) - comment(# ) - comment(# A hash of standard HTML options for the tag.) - reserved(def) method(text_field_tag)operator(()ident(name)operator(,) ident(value) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(tag) symbol(:input)operator(,) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(name)operator(,) string operator(=)operator(>) ident(name)operator(,) string operator(=)operator(>) ident(value) operator(})operator(.)ident(update)operator(()ident(options)operator(.)ident(stringify_keys)operator(\)) - reserved(end) - - comment(# Creates a hidden field.) - comment(#) - comment(# Takes the same options as text_field_tag) - reserved(def) method(hidden_field_tag)operator(()ident(name)operator(,) ident(value) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(text_field_tag)operator(()ident(name)operator(,) ident(value)operator(,) ident(options)operator(.)ident(stringify_keys)operator(.)ident(update)operator(()string operator(=)operator(>) stringoperator(\))operator(\)) - reserved(end) - - comment(# Creates a file upload field.) - comment(#) - comment(# If you are using file uploads then you will also need to set the multipart option for the form:) - comment(# <%= form_tag { :action => "post" }, { :multipart => true } %>) - comment(# <%= file_field_tag "file" %>) - comment(# <%= submit_tag %>) - comment(# <%= end_form_tag %>) - comment(#) - comment(# The specified URL will then be passed a File object containing the selected file, or if the field ) - comment(# was left blank, a StringIO object.) - reserved(def) method(file_field_tag)operator(()ident(name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(text_field_tag)operator(()ident(name)operator(,) pre_constant(nil)operator(,) ident(options)operator(.)ident(update)operator(()string operator(=)operator(>) stringoperator(\))operator(\)) - reserved(end) - - comment(# Creates a password field.) - comment(#) - comment(# Takes the same options as text_field_tag) - reserved(def) method(password_field_tag)operator(()ident(name) operator(=) stringoperator(,) ident(value) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(text_field_tag)operator(()ident(name)operator(,) ident(value)operator(,) ident(options)operator(.)ident(update)operator(()string operator(=)operator(>) stringoperator(\))operator(\)) - reserved(end) - - comment(# Creates a text input area.) - comment(#) - comment(# Options:) - comment(# * :size - A string specifying the dimensions of the textarea.) - comment(# # Outputs ) - comment(# <%= text_area_tag "body", nil, :size => "25x10" %>) - reserved(def) method(text_area_tag)operator(()ident(name)operator(,) ident(content) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options)operator(.)ident(stringify_keys!) - - reserved(if) ident(size) operator(=) ident(options)operator(.)ident(delete)operator(()stringoperator(\)) - ident(options)operator([)stringoperator(])operator(,) ident(options)operator([)stringoperator(]) operator(=) ident(size)operator(.)ident(split)operator(()stringoperator(\)) - reserved(end) - - ident(content_tag) symbol(:textarea)operator(,) ident(content)operator(,) operator({) string operator(=)operator(>) ident(name)operator(,) string operator(=)operator(>) ident(name) operator(})operator(.)ident(update)operator(()ident(options)operator(.)ident(stringify_keys)operator(\)) - reserved(end) - - comment(# Creates a check box.) - reserved(def) method(check_box_tag)operator(()ident(name)operator(,) ident(value) operator(=) stringoperator(,) ident(checked) operator(=) pre_constant(false)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(html_options) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(name)operator(,) string operator(=)operator(>) ident(name)operator(,) string operator(=)operator(>) ident(value) operator(})operator(.)ident(update)operator(()ident(options)operator(.)ident(stringify_keys)operator(\)) - ident(html_options)operator([)stringoperator(]) operator(=) string reserved(if) ident(checked) - ident(tag) symbol(:input)operator(,) ident(html_options) - reserved(end) - - comment(# Creates a radio button.) - reserved(def) method(radio_button_tag)operator(()ident(name)operator(,) ident(value)operator(,) ident(checked) operator(=) pre_constant(false)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(html_options) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(name)operator(,) string operator(=)operator(>) ident(name)operator(,) string operator(=)operator(>) ident(value) operator(})operator(.)ident(update)operator(()ident(options)operator(.)ident(stringify_keys)operator(\)) - ident(html_options)operator([)stringoperator(]) operator(=) string reserved(if) ident(checked) - ident(tag) symbol(:input)operator(,) ident(html_options) - reserved(end) - - comment(# Creates a submit button with the text value as the caption. If options contains a pair with the key of "disable_with",) - comment(# then the value will be used to rename a disabled version of the submit button.) - reserved(def) method(submit_tag)operator(()ident(value) operator(=) stringoperator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options)operator(.)ident(stringify_keys!) - - reserved(if) ident(disable_with) operator(=) ident(options)operator(.)ident(delete)operator(()stringoperator(\)) - ident(options)operator([)stringoperator(]) operator(=) stringcontent(';this.form.submit(\);)inlineoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - ident(tag) symbol(:input)operator(,) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(value) operator(})operator(.)ident(update)operator(()ident(options)operator(.)ident(stringify_keys)operator(\)) - reserved(end) - - comment(# Displays an image which when clicked will submit the form.) - comment(#) - comment(# source is passed to AssetTagHelper#image_path) - reserved(def) method(image_submit_tag)operator(()ident(source)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(tag) symbol(:input)operator(,) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(image_path)operator(()ident(source)operator(\)) operator(})operator(.)ident(update)operator(()ident(options)operator(.)ident(stringify_keys)operator(\)) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# Provides a set of helpers for creating JavaScript macros that rely on and often bundle methods from JavaScriptHelper into) - comment(# larger units. These macros also rely on counterparts in the controller that provide them with their backing. The in-place) - comment(# editing relies on ActionController::Base.in_place_edit_for and the autocompletion relies on ) - comment(# ActionController::Base.auto_complete_for.) - reserved(module) class(JavaScriptMacrosHelper) - comment(# Makes an HTML element specified by the DOM ID +field_id+ become an in-place) - comment(# editor of a property.) - comment(#) - comment(# A form is automatically created and displayed when the user clicks the element,) - comment(# something like this:) - comment(#
) - comment(# ) - comment(# ) - comment(# cancel) - comment(#
) - comment(# ) - comment(# The form is serialized and sent to the server using an AJAX call, the action on) - comment(# the server should process the value and return the updated value in the body of) - comment(# the reponse. The element will automatically be updated with the changed value) - comment(# (as returned from the server\).) - comment(# ) - comment(# Required +options+ are:) - comment(# :url:: Specifies the url where the updated value should) - comment(# be sent after the user presses "ok".) - comment(# ) - comment(#) - comment(# Addtional +options+ are:) - comment(# :rows:: Number of rows (more than 1 will use a TEXTAREA\)) - comment(# :cols:: Number of characters the text input should span (works for both INPUT and TEXTAREA\)) - comment(# :size:: Synonym for :cols when using a single line text input.) - comment(# :cancel_text:: The text on the cancel link. (default: "cancel"\)) - comment(# :save_text:: The text on the save link. (default: "ok"\)) - comment(# :loading_text:: The text to display when submitting to the server (default: "Saving..."\)) - comment(# :external_control:: The id of an external control used to enter edit mode.) - comment(# :load_text_url:: URL where initial value of editor (content\) is retrieved.) - comment(# :options:: Pass through options to the AJAX call (see prototype's Ajax.Updater\)) - comment(# :with:: JavaScript snippet that should return what is to be sent) - comment(# in the AJAX call, +form+ is an implicit parameter) - comment(# :script:: Instructs the in-place editor to evaluate the remote JavaScript response (default: false\)) - reserved(def) method(in_place_editor)operator(()ident(field_id)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(function) operator(=) string - ident(function) operator(<<) stringcontent(', )delimiter(")> - ident(function) operator(<<) stringcontent(')delimiter(")> - - ident(js_options) operator(=) operator({)operator(}) - ident(js_options)operator([)stringoperator(]) operator(=) stringcontent(')delimiter(\))> reserved(if) ident(options)operator([)symbol(:cancel_text)operator(]) - ident(js_options)operator([)stringoperator(]) operator(=) stringcontent(')delimiter(\))> reserved(if) ident(options)operator([)symbol(:save_text)operator(]) - ident(js_options)operator([)stringoperator(]) operator(=) stringcontent(')delimiter(\))> reserved(if) ident(options)operator([)symbol(:loading_text)operator(]) - ident(js_options)operator([)stringoperator(]) operator(=) ident(options)operator([)symbol(:rows)operator(]) reserved(if) ident(options)operator([)symbol(:rows)operator(]) - ident(js_options)operator([)stringoperator(]) operator(=) ident(options)operator([)symbol(:cols)operator(]) reserved(if) ident(options)operator([)symbol(:cols)operator(]) - ident(js_options)operator([)stringoperator(]) operator(=) ident(options)operator([)symbol(:size)operator(]) reserved(if) ident(options)operator([)symbol(:size)operator(]) - ident(js_options)operator([)stringoperator(]) operator(=) stringcontent(')delimiter(")> reserved(if) ident(options)operator([)symbol(:external_control)operator(]) - ident(js_options)operator([)stringoperator(]) operator(=) stringcontent(')delimiter(")> reserved(if) ident(options)operator([)symbol(:load_text_url)operator(]) - ident(js_options)operator([)stringoperator(]) operator(=) ident(options)operator([)symbol(:options)operator(]) reserved(if) ident(options)operator([)symbol(:options)operator(]) - ident(js_options)operator([)stringoperator(]) operator(=) ident(options)operator([)symbol(:script)operator(]) reserved(if) ident(options)operator([)symbol(:script)operator(]) - ident(js_options)operator([)stringoperator(]) operator(=) stringcontent( })delimiter(")> reserved(if) ident(options)operator([)symbol(:with)operator(]) - ident(function) operator(<<) operator(()string operator(+) ident(options_for_javascript)operator(()ident(js_options)operator(\))operator(\)) reserved(unless) ident(js_options)operator(.)ident(empty?) - - ident(function) operator(<<) string - - ident(javascript_tag)operator(()ident(function)operator(\)) - reserved(end) - - comment(# Renders the value of the specified object and method with in-place editing capabilities.) - comment(#) - comment(# See the RDoc on ActionController::InPlaceEditing to learn more about this.) - reserved(def) method(in_place_editor_field)operator(()ident(object)operator(,) ident(method)operator(,) ident(tag_options) operator(=) operator({)operator(})operator(,) ident(in_place_editor_options) operator(=) operator({)operator(})operator(\)) - ident(tag) operator(=) operator(::)constant(ActionView)operator(::)constant(Helpers)operator(::)constant(InstanceTag)operator(.)ident(new)operator(()ident(object)operator(,) ident(method)operator(,) pre_constant(self)operator(\)) - ident(tag_options) operator(=) operator({)symbol(:tag) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringcontent(_)inlinecontent(_)inlinecontent(_in_place_editor)delimiter(")>operator(,) symbol(:class) operator(=)operator(>) stringoperator(})operator(.)ident(merge!)operator(()ident(tag_options)operator(\)) - ident(in_place_editor_options)operator([)symbol(:url)operator(]) operator(=) ident(in_place_editor_options)operator([)symbol(:url)operator(]) operator(||) ident(url_for)operator(()operator({) symbol(:action) operator(=)operator(>) stringcontent(_)inlinedelimiter(")>operator(,) symbol(:id) operator(=)operator(>) ident(tag)operator(.)ident(object)operator(.)ident(id) operator(})operator(\)) - ident(tag)operator(.)ident(to_content_tag)operator(()ident(tag_options)operator(.)ident(delete)operator(()symbol(:tag)operator(\))operator(,) ident(tag_options)operator(\)) operator(+) - ident(in_place_editor)operator(()ident(tag_options)operator([)symbol(:id)operator(])operator(,) ident(in_place_editor_options)operator(\)) - reserved(end) - - comment(# Adds AJAX autocomplete functionality to the text input field with the ) - comment(# DOM ID specified by +field_id+.) - comment(#) - comment(# This function expects that the called action returns a HTML
    list,) - comment(# or nothing if no entries should be displayed for autocompletion.) - comment(#) - comment(# You'll probably want to turn the browser's built-in autocompletion off,) - comment(# so be sure to include a autocomplete="off" attribute with your text) - comment(# input field.) - comment(#) - comment(# The autocompleter object is assigned to a Javascript variable named field_id_auto_completer.) - comment(# This object is useful if you for example want to trigger the auto-complete suggestions through) - comment(# other means than user input (for that specific case, call the activate method on that object\). ) - comment(# ) - comment(# Required +options+ are:) - comment(# :url:: URL to call for autocompletion results) - comment(# in url_for format.) - comment(# ) - comment(# Addtional +options+ are:) - comment(# :update:: Specifies the DOM ID of the element whose ) - comment(# innerHTML should be updated with the autocomplete) - comment(# entries returned by the AJAX request. ) - comment(# Defaults to field_id + '_auto_complete') - comment(# :with:: A JavaScript expression specifying the) - comment(# parameters for the XMLHttpRequest. This defaults) - comment(# to 'fieldname=value'.) - comment(# :frequency:: Determines the time to wait after the last keystroke) - comment(# for the AJAX request to be initiated.) - comment(# :indicator:: Specifies the DOM ID of an element which will be) - comment(# displayed while autocomplete is running.) - comment(# :tokens:: A string or an array of strings containing) - comment(# separator tokens for tokenized incremental ) - comment(# autocompletion. Example: :tokens => ',' would) - comment(# allow multiple autocompletion entries, separated) - comment(# by commas.) - comment(# :min_chars:: The minimum number of characters that should be) - comment(# in the input field before an Ajax call is made) - comment(# to the server.) - comment(# :on_hide:: A Javascript expression that is called when the) - comment(# autocompletion div is hidden. The expression) - comment(# should take two variables: element and update.) - comment(# Element is a DOM element for the field, update) - comment(# is a DOM element for the div from which the) - comment(# innerHTML is replaced.) - comment(# :on_show:: Like on_hide, only now the expression is called) - comment(# then the div is shown.) - comment(# :after_update_element:: A Javascript expression that is called when the) - comment(# user has selected one of the proposed values. ) - comment(# The expression should take two variables: element and value.) - comment(# Element is a DOM element for the field, value) - comment(# is the value selected by the user.) - comment(# :select:: Pick the class of the element from which the value for ) - comment(# insertion should be extracted. If this is not specified,) - comment(# the entire element is used.) - reserved(def) method(auto_complete_field)operator(()ident(field_id)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(function) operator(=) stringcontent(_auto_completer = new Ajax.Autocompleter()delimiter(")> - ident(function) operator(<<) stringcontent(', )delimiter(")> - ident(function) operator(<<) string operator(+) operator(()ident(options)operator([)symbol(:update)operator(]) operator(||) stringcontent(_auto_complete)delimiter(")>operator(\)) operator(+) string - ident(function) operator(<<) stringcontent(')delimiter(")> - - ident(js_options) operator(=) operator({)operator(}) - ident(js_options)operator([)symbol(:tokens)operator(]) operator(=) ident(array_or_string_for_javascript)operator(()ident(options)operator([)symbol(:tokens)operator(])operator(\)) reserved(if) ident(options)operator([)symbol(:tokens)operator(]) - ident(js_options)operator([)symbol(:callback)operator(]) operator(=) stringcontent( })delimiter(")> reserved(if) ident(options)operator([)symbol(:with)operator(]) - ident(js_options)operator([)symbol(:indicator)operator(]) operator(=) stringcontent(')delimiter(")> reserved(if) ident(options)operator([)symbol(:indicator)operator(]) - ident(js_options)operator([)symbol(:select)operator(]) operator(=) stringcontent(')delimiter(")> reserved(if) ident(options)operator([)symbol(:select)operator(]) - ident(js_options)operator([)symbol(:frequency)operator(]) operator(=) stringdelimiter(")> reserved(if) ident(options)operator([)symbol(:frequency)operator(]) - - operator({) symbol(:after_update_element) operator(=)operator(>) symbol(:afterUpdateElement)operator(,) - symbol(:on_show) operator(=)operator(>) symbol(:onShow)operator(,) symbol(:on_hide) operator(=)operator(>) symbol(:onHide)operator(,) symbol(:min_chars) operator(=)operator(>) symbol(:minChars) operator(})operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) - ident(js_options)operator([)ident(v)operator(]) operator(=) ident(options)operator([)ident(k)operator(]) reserved(if) ident(options)operator([)ident(k)operator(]) - reserved(end) - - ident(function) operator(<<) operator(()string operator(+) ident(options_for_javascript)operator(()ident(js_options)operator(\)) operator(+) stringoperator(\)) - - ident(javascript_tag)operator(()ident(function)operator(\)) - reserved(end) - - comment(# Use this method in your view to generate a return for the AJAX autocomplete requests.) - comment(#) - comment(# Example action:) - comment(#) - comment(# def auto_complete_for_item_title) - comment(# @items = Item.find(:all, ) - comment(# :conditions => [ 'LOWER(description\) LIKE ?', ) - comment(# '%' + request.raw_post.downcase + '%' ]\)) - comment(# render :inline => '<%= auto_complete_result(@items, 'description'\) %>') - comment(# end) - comment(#) - comment(# The auto_complete_result can of course also be called from a view belonging to the ) - comment(# auto_complete action if you need to decorate it further.) - reserved(def) method(auto_complete_result)operator(()ident(entries)operator(,) ident(field)operator(,) ident(phrase) operator(=) pre_constant(nil)operator(\)) - reserved(return) reserved(unless) ident(entries) - ident(items) operator(=) ident(entries)operator(.)ident(map) operator({) operator(|)ident(entry)operator(|) ident(content_tag)operator(()stringoperator(,) ident(phrase) operator(?) ident(highlight)operator(()ident(entry)operator([)ident(field)operator(])operator(,) ident(phrase)operator(\)) operator(:) ident(h)operator(()ident(entry)operator([)ident(field)operator(])operator(\))operator(\)) operator(}) - ident(content_tag)operator(()stringoperator(,) ident(items)operator(.)ident(uniq)operator(\)) - reserved(end) - - comment(# Wrapper for text_field with added AJAX autocompletion functionality.) - comment(#) - comment(# In your controller, you'll need to define an action called) - comment(# auto_complete_for_object_method to respond the AJAX calls,) - comment(# ) - comment(# See the RDoc on ActionController::AutoComplete to learn more about this.) - reserved(def) method(text_field_with_auto_complete)operator(()ident(object)operator(,) ident(method)operator(,) ident(tag_options) operator(=) operator({)operator(})operator(,) ident(completion_options) operator(=) operator({)operator(})operator(\)) - operator(()ident(completion_options)operator([)symbol(:skip_style)operator(]) operator(?) string operator(:) ident(auto_complete_stylesheet)operator(\)) operator(+) - ident(text_field)operator(()ident(object)operator(,) ident(method)operator(,) ident(tag_options)operator(\)) operator(+) - ident(content_tag)operator(()stringoperator(,) stringoperator(,) symbol(:id) operator(=)operator(>) stringcontent(_)inlinecontent(_auto_complete)delimiter(")>operator(,) symbol(:class) operator(=)operator(>) stringoperator(\)) operator(+) - ident(auto_complete_field)operator(()stringcontent(_)inlinedelimiter(")>operator(,) operator({) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) stringcontent(_)inlinedelimiter(")> operator(}) operator(})operator(.)ident(update)operator(()ident(completion_options)operator(\))operator(\)) - reserved(end) - - ident(private) - reserved(def) method(auto_complete_stylesheet) - ident(content_tag)operator(()stringoperator(,) stringstring - operator(\)) - reserved(end) - - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# Provides functionality for working with JavaScript in your views.) - comment(# ) - comment(# == Ajax, controls and visual effects) - comment(# ) - comment(# * For information on using Ajax, see ) - comment(# ActionView::Helpers::PrototypeHelper.) - comment(# * For information on using controls and visual effects, see) - comment(# ActionView::Helpers::ScriptaculousHelper.) - comment(#) - comment(# == Including the JavaScript libraries into your pages) - comment(#) - comment(# Rails includes the Prototype JavaScript framework and the Scriptaculous) - comment(# JavaScript controls and visual effects library. If you wish to use) - comment(# these libraries and their helpers (ActionView::Helpers::PrototypeHelper) - comment(# and ActionView::Helpers::ScriptaculousHelper\), you must do one of the) - comment(# following:) - comment(#) - comment(# * Use <%= javascript_include_tag :defaults %> in the HEAD ) - comment(# section of your page (recommended\): This function will return ) - comment(# references to the JavaScript files created by the +rails+ command in) - comment(# your public/javascripts directory. Using it is recommended as) - comment(# the browser can then cache the libraries instead of fetching all the ) - comment(# functions anew on every request.) - comment(# * Use <%= javascript_include_tag 'prototype' %>: As above, but ) - comment(# will only include the Prototype core library, which means you are able) - comment(# to use all basic AJAX functionality. For the Scriptaculous-based ) - comment(# JavaScript helpers, like visual effects, autocompletion, drag and drop ) - comment(# and so on, you should use the method described above.) - comment(# * Use <%= define_javascript_functions %>: this will copy all the) - comment(# JavaScript support functions within a single script block. Not) - comment(# recommended.) - comment(#) - comment(# For documentation on +javascript_include_tag+ see ) - comment(# ActionView::Helpers::AssetTagHelper.) - reserved(module) class(JavaScriptHelper) - reserved(unless) ident(const_defined?) symbol(:JAVASCRIPT_PATH) - constant(JAVASCRIPT_PATH) operator(=) constant(File)operator(.)ident(join)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(,) stringoperator(\)) - reserved(end) - - comment(# Returns a link that'll trigger a JavaScript +function+ using the ) - comment(# onclick handler and return false after the fact.) - comment(#) - comment(# Examples:) - comment(# link_to_function "Greeting", "alert('Hello world!'\)") - comment(# link_to_function(image_tag("delete"\), "if confirm('Really?'\){ do_delete(\); }"\)) - reserved(def) method(link_to_function)operator(()ident(name)operator(,) ident(function)operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - ident(html_options)operator(.)ident(symbolize_keys!) - ident(content_tag)operator(() - stringoperator(,) ident(name)operator(,) - ident(html_options)operator(.)ident(merge)operator(()operator({) - symbol(:href) operator(=)operator(>) ident(html_options)operator([)symbol(:href)operator(]) operator(||) stringoperator(,) - symbol(:onclick) operator(=)operator(>) operator(()ident(html_options)operator([)symbol(:onclick)operator(]) operator(?) stringcontent(; )delimiter(")> operator(:) stringoperator(\)) operator(+) stringcontent(; return false;)delimiter(")> - operator(})operator(\)) - operator(\)) - reserved(end) - - comment(# Returns a link that'll trigger a JavaScript +function+ using the ) - comment(# onclick handler.) - comment(#) - comment(# Examples:) - comment(# button_to_function "Greeting", "alert('Hello world!'\)") - comment(# button_to_function "Delete", "if confirm('Really?'\){ do_delete(\); }"\)) - reserved(def) method(button_to_function)operator(()ident(name)operator(,) ident(function)operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - ident(html_options)operator(.)ident(symbolize_keys!) - ident(tag)operator(()symbol(:input)operator(,) ident(html_options)operator(.)ident(merge)operator(()operator({) - symbol(:type) operator(=)operator(>) stringoperator(,) symbol(:value) operator(=)operator(>) ident(name)operator(,) - symbol(:onclick) operator(=)operator(>) operator(()ident(html_options)operator([)symbol(:onclick)operator(]) operator(?) stringcontent(; )delimiter(")> operator(:) stringoperator(\)) operator(+) stringcontent(;)delimiter(")> - operator(})operator(\))operator(\)) - reserved(end) - - comment(# Includes the Action Pack JavaScript libraries inside a single )delimiter(')> - reserved(end) - - comment(# Escape carrier returns and single and double quotes for JavaScript segments.) - reserved(def) method(escape_javascript)operator(()ident(javascript)operator(\)) - operator(()ident(javascript) operator(||) stringoperator(\))operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(m)operator(|) stringdelimiter(")> operator(}) - reserved(end) - - comment(# Returns a JavaScript tag with the +content+ inside. Example:) - comment(# javascript_tag "alert('All is good'\)" # => ) - reserved(def) method(javascript_tag)operator(()ident(content)operator(\)) - ident(content_tag)operator(()stringoperator(,) ident(javascript_cdata_section)operator(()ident(content)operator(\))operator(,) symbol(:type) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(javascript_cdata_section)operator(()ident(content)operator(\)) comment(#:nodoc:) - stringchar(\\n)content(//)delimiter(")>operator(\))inline_delimiter(})>char(\\n)delimiter(")> - reserved(end) - - ident(protected) - reserved(def) method(options_for_javascript)operator(()ident(options)operator(\)) - string operator(+) ident(options)operator(.)ident(map) operator({)operator(|)ident(k)operator(,) ident(v)operator(|) stringcontent(:)inlinedelimiter(")>operator(})operator(.)ident(sort)operator(.)ident(join)operator(()stringoperator(\)) operator(+) string - reserved(end) - - reserved(def) method(array_or_string_for_javascript)operator(()ident(option)operator(\)) - ident(js_option) operator(=) reserved(if) ident(option)operator(.)ident(kind_of?)operator(()constant(Array)operator(\)) - stringoperator(\))inline_delimiter(})>content('])delimiter(")> - reserved(elsif) operator(!)ident(option)operator(.)ident(nil?) - stringcontent(')delimiter(")> - reserved(end) - ident(js_option) - reserved(end) - reserved(end) - - constant(JavascriptHelper) operator(=) constant(JavaScriptHelper) reserved(unless) ident(const_defined?) symbol(:JavascriptHelper) - reserved(end) -reserved(end) -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# Provides methods for converting a number into a formatted string that currently represents) - comment(# one of the following forms: phone number, percentage, money, or precision level.) - reserved(module) class(NumberHelper) - - comment(# Formats a +number+ into a US phone number string. The +options+ can be a hash used to customize the format of the output.) - comment(# The area code can be surrounded by parentheses by setting +:area_code+ to true; default is false) - comment(# The delimiter can be set using +:delimiter+; default is "-") - comment(# Examples:) - comment(# number_to_phone(1235551234\) => 123-555-1234) - comment(# number_to_phone(1235551234, {:area_code => true}\) => (123\) 555-1234) - comment(# number_to_phone(1235551234, {:delimiter => " "}\) => 123 555 1234) - comment(# number_to_phone(1235551234, {:area_code => true, :extension => 555}\) => (123\) 555-1234 x 555) - reserved(def) method(number_to_phone)operator(()ident(number)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options) operator(=) ident(options)operator(.)ident(stringify_keys) - ident(area_code) operator(=) ident(options)operator(.)ident(delete)operator(()stringoperator(\)) operator({) pre_constant(false) operator(}) - ident(delimiter) operator(=) ident(options)operator(.)ident(delete)operator(()stringoperator(\)) operator({) string operator(}) - ident(extension) operator(=) ident(options)operator(.)ident(delete)operator(()stringoperator(\)) operator({) string operator(}) - reserved(begin) - ident(str) operator(=) ident(area_code) operator(==) pre_constant(true) operator(?) ident(number)operator(.)ident(to_s)operator(.)ident(gsub)operator(()regexpoperator(,)stringchar(\\\\)content(3)delimiter(")>operator(\)) operator(:) ident(number)operator(.)ident(to_s)operator(.)ident(gsub)operator(()regexpoperator(,)stringchar(\\\\)content(2)inlinechar(\\\\)content(3)delimiter(")>operator(\)) - ident(extension)operator(.)ident(to_s)operator(.)ident(strip)operator(.)ident(empty?) operator(?) ident(str) operator(:) stringcontent( x )inlinedelimiter(")> - reserved(rescue) - ident(number) - reserved(end) - reserved(end) - - comment(# Formats a +number+ into a currency string. The +options+ hash can be used to customize the format of the output.) - comment(# The +number+ can contain a level of precision using the +precision+ key; default is 2) - comment(# The currency type can be set using the +unit+ key; default is "$") - comment(# The unit separator can be set using the +separator+ key; default is ".") - comment(# The delimiter can be set using the +delimiter+ key; default is ",") - comment(# Examples:) - comment(# number_to_currency(1234567890.50\) => $1,234,567,890.50) - comment(# number_to_currency(1234567890.506\) => $1,234,567,890.51) - comment(# number_to_currency(1234567890.50, {:unit => "£", :separator => ",", :delimiter => ""}\) => £1234567890,50) - reserved(def) method(number_to_currency)operator(()ident(number)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options) operator(=) ident(options)operator(.)ident(stringify_keys) - ident(precision)operator(,) ident(unit)operator(,) ident(separator)operator(,) ident(delimiter) operator(=) ident(options)operator(.)ident(delete)operator(()stringoperator(\)) operator({) integer(2) operator(})operator(,) ident(options)operator(.)ident(delete)operator(()stringoperator(\)) operator({) string operator(})operator(,) ident(options)operator(.)ident(delete)operator(()stringoperator(\)) operator({) string operator(})operator(,) ident(options)operator(.)ident(delete)operator(()stringoperator(\)) operator({) string operator(}) - ident(separator) operator(=) string reserved(unless) ident(precision) operator(>) integer(0) - reserved(begin) - ident(parts) operator(=) ident(number_with_precision)operator(()ident(number)operator(,) ident(precision)operator(\))operator(.)ident(split)operator(()stringoperator(\)) - ident(unit) operator(+) ident(number_with_delimiter)operator(()ident(parts)operator([)integer(0)operator(])operator(,) ident(delimiter)operator(\)) operator(+) ident(separator) operator(+) ident(parts)operator([)integer(1)operator(])operator(.)ident(to_s) - reserved(rescue) - ident(number) - reserved(end) - reserved(end) - - comment(# Formats a +number+ as into a percentage string. The +options+ hash can be used to customize the format of the output.) - comment(# The +number+ can contain a level of precision using the +precision+ key; default is 3) - comment(# The unit separator can be set using the +separator+ key; default is ".") - comment(# Examples:) - comment(# number_to_percentage(100\) => 100.000%) - comment(# number_to_percentage(100, {:precision => 0}\) => 100%) - comment(# number_to_percentage(302.0574, {:precision => 2}\) => 302.06%) - reserved(def) method(number_to_percentage)operator(()ident(number)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options) operator(=) ident(options)operator(.)ident(stringify_keys) - ident(precision)operator(,) ident(separator) operator(=) ident(options)operator(.)ident(delete)operator(()stringoperator(\)) operator({) integer(3) operator(})operator(,) ident(options)operator(.)ident(delete)operator(()stringoperator(\)) operator({) string operator(}) - reserved(begin) - ident(number) operator(=) ident(number_with_precision)operator(()ident(number)operator(,) ident(precision)operator(\)) - ident(parts) operator(=) ident(number)operator(.)ident(split)operator(()stringoperator(\)) - reserved(if) ident(parts)operator(.)ident(at)operator(()integer(1)operator(\))operator(.)ident(nil?) - ident(parts)operator([)integer(0)operator(]) operator(+) string - reserved(else) - ident(parts)operator([)integer(0)operator(]) operator(+) ident(separator) operator(+) ident(parts)operator([)integer(1)operator(])operator(.)ident(to_s) operator(+) string - reserved(end) - reserved(rescue) - ident(number) - reserved(end) - reserved(end) - - comment(# Formats a +number+ with a +delimiter+.) - comment(# Example:) - comment(# number_with_delimiter(12345678\) => 12,345,678) - reserved(def) method(number_with_delimiter)operator(()ident(number)operator(,) ident(delimiter)operator(=)stringoperator(\)) - ident(number)operator(.)ident(to_s)operator(.)ident(gsub)operator(()regexpoperator(,) stringdelimiter(")>operator(\)) - reserved(end) - - comment(# Returns a formatted-for-humans file size.) - comment(# ) - comment(# Examples:) - comment(# human_size(123\) => 123 Bytes) - comment(# human_size(1234\) => 1.2 KB) - comment(# human_size(12345\) => 12.1 KB) - comment(# human_size(1234567\) => 1.2 MB) - comment(# human_size(1234567890\) => 1.1 GB) - reserved(def) method(number_to_human_size)operator(()ident(size)operator(\)) - reserved(case) - reserved(when) ident(size) operator(<) integer(1)operator(.)ident(kilobyte)operator(:) string operator(%) ident(size) - reserved(when) ident(size) operator(<) integer(1)operator(.)ident(megabyte)operator(:) string operator(%) operator(()ident(size) operator(/) float(1.0)operator(.)ident(kilobyte)operator(\)) - reserved(when) ident(size) operator(<) integer(1)operator(.)ident(gigabyte)operator(:) string operator(%) operator(()ident(size) operator(/) float(1.0)operator(.)ident(megabyte)operator(\)) - reserved(when) ident(size) operator(<) integer(1)operator(.)ident(terabyte)operator(:) string operator(%) operator(()ident(size) operator(/) float(1.0)operator(.)ident(gigabyte)operator(\)) - reserved(else) string operator(%) operator(()ident(size) operator(/) float(1.0)operator(.)ident(terabyte)operator(\)) - reserved(end)operator(.)ident(sub)operator(()stringoperator(,) stringoperator(\)) - reserved(rescue) - pre_constant(nil) - reserved(end) - - ident(alias_method) symbol(:human_size)operator(,) symbol(:number_to_human_size) comment(# deprecated alias) - - comment(# Formats a +number+ with a level of +precision+.) - comment(# Example:) - comment(# number_with_precision(111.2345\) => 111.235) - reserved(def) method(number_with_precision)operator(()ident(number)operator(,) ident(precision)operator(=)integer(3)operator(\)) - ident(sprintf)operator(()stringcontent(f)delimiter(")>operator(,) ident(number)operator(\)) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# Provides methods for linking to ActionController::Pagination objects.) - comment(#) - comment(# You can also build your links manually, like in this example:) - comment(#) - comment(# <%= link_to "Previous page", { :page => paginator.current.previous } if paginator.current.previous %>) - comment(#) - comment(# <%= link_to "Next page", { :page => paginator.current.next } if paginator.current.next %>) - reserved(module) class(PaginationHelper) - reserved(unless) ident(const_defined?)operator(()symbol(:DEFAULT_OPTIONS)operator(\)) - constant(DEFAULT_OPTIONS) operator(=) operator({) - symbol(:name) operator(=)operator(>) symbol(:page)operator(,) - symbol(:window_size) operator(=)operator(>) integer(2)operator(,) - symbol(:always_show_anchors) operator(=)operator(>) pre_constant(true)operator(,) - symbol(:link_to_current_page) operator(=)operator(>) pre_constant(false)operator(,) - symbol(:params) operator(=)operator(>) operator({)operator(}) - operator(}) - reserved(end) - - comment(# Creates a basic HTML link bar for the given +paginator+.) - comment(# +html_options+ are passed to +link_to+.) - comment(#) - comment(# +options+ are:) - comment(# :name:: the routing name for this paginator) - comment(# (defaults to +page+\)) - comment(# :window_size:: the number of pages to show around ) - comment(# the current page (defaults to +2+\)) - comment(# :always_show_anchors:: whether or not the first and last) - comment(# pages should always be shown) - comment(# (defaults to +true+\)) - comment(# :link_to_current_page:: whether or not the current page) - comment(# should be linked to (defaults to) - comment(# +false+\)) - comment(# :params:: any additional routing parameters) - comment(# for page URLs) - reserved(def) method(pagination_links)operator(()ident(paginator)operator(,) ident(options)operator(=)operator({)operator(})operator(,) ident(html_options)operator(=)operator({)operator(})operator(\)) - ident(name) operator(=) ident(options)operator([)symbol(:name)operator(]) operator(||) constant(DEFAULT_OPTIONS)operator([)symbol(:name)operator(]) - ident(params) operator(=) operator(()ident(options)operator([)symbol(:params)operator(]) operator(||) constant(DEFAULT_OPTIONS)operator([)symbol(:params)operator(])operator(\))operator(.)ident(clone) - - ident(pagination_links_each)operator(()ident(paginator)operator(,) ident(options)operator(\)) reserved(do) operator(|)ident(n)operator(|) - ident(params)operator([)ident(name)operator(]) operator(=) ident(n) - ident(link_to)operator(()ident(n)operator(.)ident(to_s)operator(,) ident(params)operator(,) ident(html_options)operator(\)) - reserved(end) - reserved(end) - - comment(# Iterate through the pages of a given +paginator+, invoking a) - comment(# block for each page number that needs to be rendered as a link.) - reserved(def) method(pagination_links_each)operator(()ident(paginator)operator(,) ident(options)operator(\)) - ident(options) operator(=) constant(DEFAULT_OPTIONS)operator(.)ident(merge)operator(()ident(options)operator(\)) - ident(link_to_current_page) operator(=) ident(options)operator([)symbol(:link_to_current_page)operator(]) - ident(always_show_anchors) operator(=) ident(options)operator([)symbol(:always_show_anchors)operator(]) - - ident(current_page) operator(=) ident(paginator)operator(.)ident(current_page) - ident(window_pages) operator(=) ident(current_page)operator(.)ident(window)operator(()ident(options)operator([)symbol(:window_size)operator(])operator(\))operator(.)ident(pages) - reserved(return) reserved(if) ident(window_pages)operator(.)ident(length) operator(<=) integer(1) reserved(unless) ident(link_to_current_page) - - ident(first)operator(,) ident(last) operator(=) ident(paginator)operator(.)ident(first)operator(,) ident(paginator)operator(.)ident(last) - - ident(html) operator(=) string - reserved(if) ident(always_show_anchors) reserved(and) reserved(not) operator(()ident(wp_first) operator(=) ident(window_pages)operator([)integer(0)operator(])operator(\))operator(.)ident(first?) - ident(html) operator(<<) reserved(yield)operator(()ident(first)operator(.)ident(number)operator(\)) - ident(html) operator(<<) string reserved(if) ident(wp_first)operator(.)ident(number) operator(-) ident(first)operator(.)ident(number) operator(>) integer(1) - ident(html) operator(<<) string - reserved(end) - - ident(window_pages)operator(.)ident(each) reserved(do) operator(|)ident(page)operator(|) - reserved(if) ident(current_page) operator(==) ident(page) operator(&&) operator(!)ident(link_to_current_page) - ident(html) operator(<<) ident(page)operator(.)ident(number)operator(.)ident(to_s) - reserved(else) - ident(html) operator(<<) reserved(yield)operator(()ident(page)operator(.)ident(number)operator(\)) - reserved(end) - ident(html) operator(<<) string - reserved(end) - - reserved(if) ident(always_show_anchors) reserved(and) reserved(not) operator(()ident(wp_last) operator(=) ident(window_pages)operator([)integer(-1)operator(])operator(\))operator(.)ident(last?) - ident(html) operator(<<) string reserved(if) ident(last)operator(.)ident(number) operator(-) ident(wp_last)operator(.)ident(number) operator(>) integer(1) - ident(html) operator(<<) reserved(yield)operator(()ident(last)operator(.)ident(number)operator(\)) - reserved(end) - - ident(html) - reserved(end) - - reserved(end) comment(# PaginationHelper) - reserved(end) comment(# Helpers) -reserved(end) comment(# ActionView) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string - -reserved(module) class(ActionView) - reserved(module) class(Helpers) - comment(# Provides a set of helpers for calling Prototype JavaScript functions, ) - comment(# including functionality to call remote methods using ) - comment(# Ajax[http://www.adaptivepath.com/publications/essays/archives/000385.php]. ) - comment(# This means that you can call actions in your controllers without ) - comment(# reloading the page, but still update certain parts of it using ) - comment(# injections into the DOM. The common use case is having a form that adds) - comment(# a new element to a list without reloading the page.) - comment(#) - comment(# To be able to use these helpers, you must include the Prototype ) - comment(# JavaScript framework in your pages. See the documentation for ) - comment(# ActionView::Helpers::JavaScriptHelper for more information on including ) - comment(# the necessary JavaScript.) - comment(#) - comment(# See link_to_remote for documentation of options common to all Ajax) - comment(# helpers.) - comment(#) - comment(# See also ActionView::Helpers::ScriptaculousHelper for helpers which work) - comment(# with the Scriptaculous controls and visual effects library.) - comment(#) - comment(# See JavaScriptGenerator for information on updating multiple elements) - comment(# on the page in an Ajax response. ) - reserved(module) class(PrototypeHelper) - reserved(unless) ident(const_defined?) symbol(:CALLBACKS) - constant(CALLBACKS) operator(=) constant(Set)operator(.)ident(new)operator(()operator([) symbol(:uninitialized)operator(,) symbol(:loading)operator(,) symbol(:loaded)operator(,) - symbol(:interactive)operator(,) symbol(:complete)operator(,) symbol(:failure)operator(,) symbol(:success) operator(]) operator(+) - operator(()integer(100)operator(..)integer(599)operator(\))operator(.)ident(to_a)operator(\)) - constant(AJAX_OPTIONS) operator(=) constant(Set)operator(.)ident(new)operator(()operator([) symbol(:before)operator(,) symbol(:after)operator(,) symbol(:condition)operator(,) symbol(:url)operator(,) - symbol(:asynchronous)operator(,) symbol(:method)operator(,) symbol(:insertion)operator(,) symbol(:position)operator(,) - symbol(:form)operator(,) symbol(:with)operator(,) symbol(:update)operator(,) symbol(:script) operator(])operator(\))operator(.)ident(merge)operator(()constant(CALLBACKS)operator(\)) - reserved(end) - - comment(# Returns a link to a remote action defined by options[:url] ) - comment(# (using the url_for format\) that's called in the background using ) - comment(# XMLHttpRequest. The result of that request can then be inserted into a) - comment(# DOM object whose id can be specified with options[:update]. ) - comment(# Usually, the result would be a partial prepared by the controller with) - comment(# either render_partial or render_partial_collection. ) - comment(#) - comment(# Examples:) - comment(# link_to_remote "Delete this post", :update => "posts", ) - comment(# :url => { :action => "destroy", :id => post.id }) - comment(# link_to_remote(image_tag("refresh"\), :update => "emails", ) - comment(# :url => { :action => "list_emails" }\)) - comment(#) - comment(# You can also specify a hash for options[:update] to allow for) - comment(# easy redirection of output to an other DOM element if a server-side ) - comment(# error occurs:) - comment(#) - comment(# Example:) - comment(# link_to_remote "Delete this post",) - comment(# :url => { :action => "destroy", :id => post.id },) - comment(# :update => { :success => "posts", :failure => "error" }) - comment(#) - comment(# Optionally, you can use the options[:position] parameter to ) - comment(# influence how the target DOM element is updated. It must be one of ) - comment(# :before, :top, :bottom, or :after.) - comment(#) - comment(# By default, these remote requests are processed asynchronous during ) - comment(# which various JavaScript callbacks can be triggered (for progress ) - comment(# indicators and the likes\). All callbacks get access to the ) - comment(# request object, which holds the underlying XMLHttpRequest. ) - comment(#) - comment(# To access the server response, use request.responseText, to) - comment(# find out the HTTP status, use request.status.) - comment(#) - comment(# Example:) - comment(# link_to_remote word,) - comment(# :url => { :action => "undo", :n => word_counter },) - comment(# :complete => "undoRequestCompleted(request\)") - comment(#) - comment(# The callbacks that may be specified are (in order\):) - comment(#) - comment(# :loading:: Called when the remote document is being ) - comment(# loaded with data by the browser.) - comment(# :loaded:: Called when the browser has finished loading) - comment(# the remote document.) - comment(# :interactive:: Called when the user can interact with the ) - comment(# remote document, even though it has not ) - comment(# finished loading.) - comment(# :success:: Called when the XMLHttpRequest is completed,) - comment(# and the HTTP status code is in the 2XX range.) - comment(# :failure:: Called when the XMLHttpRequest is completed,) - comment(# and the HTTP status code is not in the 2XX) - comment(# range.) - comment(# :complete:: Called when the XMLHttpRequest is complete ) - comment(# (fires after success/failure if they are ) - comment(# present\).) - comment(# ) - comment(# You can further refine :success and :failure by ) - comment(# adding additional callbacks for specific status codes.) - comment(#) - comment(# Example:) - comment(# link_to_remote word,) - comment(# :url => { :action => "action" },) - comment(# 404 => "alert('Not found...? Wrong URL...?'\)",) - comment(# :failure => "alert('HTTP Error ' + request.status + '!'\)") - comment(#) - comment(# A status code callback overrides the success/failure handlers if ) - comment(# present.) - comment(#) - comment(# If you for some reason or another need synchronous processing (that'll) - comment(# block the browser while the request is happening\), you can specify ) - comment(# options[:type] = :synchronous.) - comment(#) - comment(# You can customize further browser side call logic by passing in) - comment(# JavaScript code snippets via some optional parameters. In their order ) - comment(# of use these are:) - comment(#) - comment(# :confirm:: Adds confirmation dialog.) - comment(# :condition:: Perform remote request conditionally) - comment(# by this expression. Use this to) - comment(# describe browser-side conditions when) - comment(# request should not be initiated.) - comment(# :before:: Called before request is initiated.) - comment(# :after:: Called immediately after request was) - comment(# initiated and before :loading.) - comment(# :submit:: Specifies the DOM element ID that's used) - comment(# as the parent of the form elements. By ) - comment(# default this is the current form, but) - comment(# it could just as well be the ID of a) - comment(# table row or any other DOM element.) - reserved(def) method(link_to_remote)operator(()ident(name)operator(,) ident(options) operator(=) operator({)operator(})operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - ident(link_to_function)operator(()ident(name)operator(,) ident(remote_function)operator(()ident(options)operator(\))operator(,) ident(html_options)operator(\)) - reserved(end) - - comment(# Periodically calls the specified url (options[:url]\) every ) - comment(# options[:frequency] seconds (default is 10\). Usually used to) - comment(# update a specified div (options[:update]\) with the results ) - comment(# of the remote call. The options for specifying the target with :url ) - comment(# and defining callbacks is the same as link_to_remote.) - reserved(def) method(periodically_call_remote)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(frequency) operator(=) ident(options)operator([)symbol(:frequency)operator(]) operator(||) integer(10) comment(# every ten seconds by default) - ident(code) operator(=) stringcontent(}, )inlinecontent(\))delimiter(")> - ident(javascript_tag)operator(()ident(code)operator(\)) - reserved(end) - - comment(# Returns a form tag that will submit using XMLHttpRequest in the ) - comment(# background instead of the regular reloading POST arrangement. Even ) - comment(# though it's using JavaScript to serialize the form elements, the form) - comment(# submission will work just like a regular submission as viewed by the) - comment(# receiving side (all elements available in params\). The options for ) - comment(# specifying the target with :url and defining callbacks is the same as) - comment(# link_to_remote.) - comment(#) - comment(# A "fall-through" target for browsers that doesn't do JavaScript can be) - comment(# specified with the :action/:method options on :html.) - comment(#) - comment(# Example:) - comment(# form_remote_tag :html => { :action => ) - comment(# url_for(:controller => "some", :action => "place"\) }) - comment(#) - comment(# The Hash passed to the :html key is equivalent to the options (2nd\) ) - comment(# argument in the FormTagHelper.form_tag method.) - comment(#) - comment(# By default the fall-through action is the same as the one specified in ) - comment(# the :url (and the default method is :post\).) - reserved(def) method(form_remote_tag)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(options)operator([)symbol(:form)operator(]) operator(=) pre_constant(true) - - ident(options)operator([)symbol(:html)operator(]) operator(||=) operator({)operator(}) - ident(options)operator([)symbol(:html)operator(])operator([)symbol(:onsubmit)operator(]) operator(=) stringcontent(; return false;)delimiter(")> - ident(options)operator([)symbol(:html)operator(])operator([)symbol(:action)operator(]) operator(=) ident(options)operator([)symbol(:html)operator(])operator([)symbol(:action)operator(]) operator(||) ident(url_for)operator(()ident(options)operator([)symbol(:url)operator(])operator(\)) - ident(options)operator([)symbol(:html)operator(])operator([)symbol(:method)operator(]) operator(=) ident(options)operator([)symbol(:html)operator(])operator([)symbol(:method)operator(]) operator(||) string - - ident(tag)operator(()stringoperator(,) ident(options)operator([)symbol(:html)operator(])operator(,) pre_constant(true)operator(\)) - reserved(end) - - comment(# Works like form_remote_tag, but uses form_for semantics.) - reserved(def) method(remote_form_for)operator(()ident(object_name)operator(,) operator(*)ident(args)operator(,) operator(&)ident(proc)operator(\)) - ident(options) operator(=) ident(args)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(args)operator(.)ident(pop) operator(:) operator({)operator(}) - ident(concat)operator(()ident(form_remote_tag)operator(()ident(options)operator(\))operator(,) ident(proc)operator(.)ident(binding)operator(\)) - ident(fields_for)operator(()ident(object_name)operator(,) operator(*)operator(()ident(args) operator(<<) ident(options)operator(\))operator(,) operator(&)ident(proc)operator(\)) - ident(concat)operator(()string)delimiter(')>operator(,) ident(proc)operator(.)ident(binding)operator(\)) - reserved(end) - ident(alias_method) symbol(:form_remote_for)operator(,) symbol(:remote_form_for) - - comment(# Returns a button input tag that will submit form using XMLHttpRequest ) - comment(# in the background instead of regular reloading POST arrangement. ) - comment(# options argument is the same as in form_remote_tag.) - reserved(def) method(submit_to_remote)operator(()ident(name)operator(,) ident(value)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options)operator([)symbol(:with)operator(]) operator(||=) string - - ident(options)operator([)symbol(:html)operator(]) operator(||=) operator({)operator(}) - ident(options)operator([)symbol(:html)operator(])operator([)symbol(:type)operator(]) operator(=) string - ident(options)operator([)symbol(:html)operator(])operator([)symbol(:onclick)operator(]) operator(=) stringcontent(; return false;)delimiter(")> - ident(options)operator([)symbol(:html)operator(])operator([)symbol(:name)operator(]) operator(=) ident(name) - ident(options)operator([)symbol(:html)operator(])operator([)symbol(:value)operator(]) operator(=) ident(value) - - ident(tag)operator(()stringoperator(,) ident(options)operator([)symbol(:html)operator(])operator(,) pre_constant(false)operator(\)) - reserved(end) - - comment(# Returns a JavaScript function (or expression\) that'll update a DOM ) - comment(# element according to the options passed.) - comment(#) - comment(# * :content: The content to use for updating. Can be left out) - comment(# if using block, see example.) - comment(# * :action: Valid options are :update (assumed by default\), ) - comment(# :empty, :remove) - comment(# * :position If the :action is :update, you can optionally ) - comment(# specify one of the following positions: :before, :top, :bottom, ) - comment(# :after.) - comment(#) - comment(# Examples:) - comment(# <%= javascript_tag(update_element_function("products", ) - comment(# :position => :bottom, :content => "

    New product!

    "\)\) %>) - comment(#) - comment(# <% replacement_function = update_element_function("products"\) do %>) - comment(#

    Product 1

    ) - comment(#

    Product 2

    ) - comment(# <% end %>) - comment(# <%= javascript_tag(replacement_function\) %>) - comment(#) - comment(# This method can also be used in combination with remote method call ) - comment(# where the result is evaluated afterwards to cause multiple updates on) - comment(# a page. Example:) - comment(#) - comment(# # Calling view) - comment(# <%= form_remote_tag :url => { :action => "buy" }, ) - comment(# :complete => evaluate_remote_response %>) - comment(# all the inputs here...) - comment(#) - comment(# # Controller action) - comment(# def buy) - comment(# @product = Product.find(1\)) - comment(# end) - comment(#) - comment(# # Returning view) - comment(# <%= update_element_function() - comment(# "cart", :action => :update, :position => :bottom, ) - comment(# :content => "

    New Product: #{@product.name}

    "\)\) %>) - comment(# <% update_element_function("status", :binding => binding\) do %>) - comment(# You've bought a new product!) - comment(# <% end %>) - comment(#) - comment(# Notice how the second call doesn't need to be in an ERb output block) - comment(# since it uses a block and passes in the binding to render directly. ) - comment(# This trick will however only work in ERb (not Builder or other ) - comment(# template forms\).) - comment(#) - comment(# See also JavaScriptGenerator and update_page.) - reserved(def) method(update_element_function)operator(()ident(element_id)operator(,) ident(options) operator(=) operator({)operator(})operator(,) operator(&)ident(block)operator(\)) - ident(content) operator(=) ident(escape_javascript)operator(()ident(options)operator([)symbol(:content)operator(]) operator(||) stringoperator(\)) - ident(content) operator(=) ident(escape_javascript)operator(()ident(capture)operator(()operator(&)ident(block)operator(\))operator(\)) reserved(if) ident(block) - - ident(javascript_function) operator(=) reserved(case) operator(()ident(options)operator([)symbol(:action)operator(]) operator(||) symbol(:update)operator(\)) - reserved(when) symbol(:update) - reserved(if) ident(options)operator([)symbol(:position)operator(]) - stringcontent((')inlinecontent(',')inlinecontent('\))delimiter(")> - reserved(else) - stringcontent('\).innerHTML = ')inlinecontent(')delimiter(")> - reserved(end) - - reserved(when) symbol(:empty) - stringcontent('\).innerHTML = '')delimiter(")> - - reserved(when) symbol(:remove) - stringcontent('\))delimiter(")> - - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - ident(javascript_function) operator(<<) string - ident(options)operator([)symbol(:binding)operator(]) operator(?) ident(concat)operator(()ident(javascript_function)operator(,) ident(options)operator([)symbol(:binding)operator(])operator(\)) operator(:) ident(javascript_function) - reserved(end) - - comment(# Returns 'eval(request.responseText\)' which is the JavaScript function) - comment(# that form_remote_tag can call in :complete to evaluate a multiple) - comment(# update return document using update_element_function calls.) - reserved(def) method(evaluate_remote_response) - string - reserved(end) - - comment(# Returns the JavaScript needed for a remote function.) - comment(# Takes the same arguments as link_to_remote.) - comment(# ) - comment(# Example:) - comment(# ) - reserved(def) method(remote_function)operator(()ident(options)operator(\)) - ident(javascript_options) operator(=) ident(options_for_ajax)operator(()ident(options)operator(\)) - - ident(update) operator(=) string - reserved(if) ident(options)operator([)symbol(:update)operator(]) reserved(and) ident(options)operator([)symbol(:update)operator(])operator(.)ident(is_a?)constant(Hash) - ident(update) operator(=) operator([)operator(]) - ident(update) operator(<<) stringcontent(')delimiter(")> reserved(if) ident(options)operator([)symbol(:update)operator(])operator([)symbol(:success)operator(]) - ident(update) operator(<<) stringcontent(')delimiter(")> reserved(if) ident(options)operator([)symbol(:update)operator(])operator([)symbol(:failure)operator(]) - ident(update) operator(=) string operator(+) ident(update)operator(.)ident(join)operator(()stringoperator(\)) operator(+) string - reserved(elsif) ident(options)operator([)symbol(:update)operator(]) - ident(update) operator(<<) stringcontent(')delimiter(")> - reserved(end) - - ident(function) operator(=) ident(update)operator(.)ident(empty?) operator(?) - string operator(:) - stringcontent(, )delimiter(")> - - ident(url_options) operator(=) ident(options)operator([)symbol(:url)operator(]) - ident(url_options) operator(=) ident(url_options)operator(.)ident(merge)operator(()symbol(:escape) operator(=)operator(>) pre_constant(false)operator(\)) reserved(if) ident(url_options)operator(.)ident(is_a?) constant(Hash) - ident(function) operator(<<) stringcontent(')delimiter(")> - ident(function) operator(<<) stringcontent(\))delimiter(")> - - ident(function) operator(=) stringcontent(; )inlinedelimiter(")> reserved(if) ident(options)operator([)symbol(:before)operator(]) - ident(function) operator(=) stringcontent(; )inlinedelimiter(")> reserved(if) ident(options)operator([)symbol(:after)operator(]) - ident(function) operator(=) stringcontent(\) { )inlinecontent(; })delimiter(")> reserved(if) ident(options)operator([)symbol(:condition)operator(]) - ident(function) operator(=) stringcontent('\)\) { )inlinecontent(; })delimiter(")> reserved(if) ident(options)operator([)symbol(:confirm)operator(]) - - reserved(return) ident(function) - reserved(end) - - comment(# Observes the field with the DOM ID specified by +field_id+ and makes) - comment(# an Ajax call when its contents have changed.) - comment(# ) - comment(# Required +options+ are either of:) - comment(# :url:: +url_for+-style options for the action to call) - comment(# when the field has changed.) - comment(# :function:: Instead of making a remote call to a URL, you) - comment(# can specify a function to be called instead.) - comment(# ) - comment(# Additional options are:) - comment(# :frequency:: The frequency (in seconds\) at which changes to) - comment(# this field will be detected. Not setting this) - comment(# option at all or to a value equal to or less than) - comment(# zero will use event based observation instead of) - comment(# time based observation.) - comment(# :update:: Specifies the DOM ID of the element whose ) - comment(# innerHTML should be updated with the) - comment(# XMLHttpRequest response text.) - comment(# :with:: A JavaScript expression specifying the) - comment(# parameters for the XMLHttpRequest. This defaults) - comment(# to 'value', which in the evaluated context ) - comment(# refers to the new field value. If you specify a) - comment(# string without a "=", it'll be extended to mean) - comment(# the form key that the value should be assigned to.) - comment(# So :with => "term" gives "'term'=value". If a "=" is) - comment(# present, no extension will happen.) - comment(# :on:: Specifies which event handler to observe. By default,) - comment(# it's set to "changed" for text fields and areas and) - comment(# "click" for radio buttons and checkboxes. With this,) - comment(# you can specify it instead to be "blur" or "focus" or) - comment(# any other event.) - comment(#) - comment(# Additionally, you may specify any of the options documented in) - comment(# link_to_remote.) - reserved(def) method(observe_field)operator(()ident(field_id)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - reserved(if) ident(options)operator([)symbol(:frequency)operator(]) operator(&&) ident(options)operator([)symbol(:frequency)operator(]) operator(>) integer(0) - ident(build_observer)operator(()stringoperator(,) ident(field_id)operator(,) ident(options)operator(\)) - reserved(else) - ident(build_observer)operator(()stringoperator(,) ident(field_id)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - comment(# Like +observe_field+, but operates on an entire form identified by the) - comment(# DOM ID +form_id+. +options+ are the same as +observe_field+, except ) - comment(# the default value of the :with option evaluates to the) - comment(# serialized (request string\) value of the form.) - reserved(def) method(observe_form)operator(()ident(form_id)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - reserved(if) ident(options)operator([)symbol(:frequency)operator(]) - ident(build_observer)operator(()stringoperator(,) ident(form_id)operator(,) ident(options)operator(\)) - reserved(else) - ident(build_observer)operator(()stringoperator(,) ident(form_id)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - comment(# All the methods were moved to GeneratorMethods so that ) - comment(# #include_helpers_from_context has nothing to overwrite.) - reserved(class) class(JavaScriptGenerator) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(context)operator(,) operator(&)ident(block)operator(\)) comment(#:nodoc:) - instance_variable(@context)operator(,) instance_variable(@lines) operator(=) ident(context)operator(,) operator([)operator(]) - ident(include_helpers_from_context) - instance_variable(@context)operator(.)ident(instance_exec)operator(()pre_constant(self)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(include_helpers_from_context) - instance_variable(@context)operator(.)ident(extended_by)operator(.)ident(each) reserved(do) operator(|)ident(mod)operator(|) - ident(extend) ident(mod) reserved(unless) ident(mod)operator(.)ident(name) operator(=)operator(~) regexp - reserved(end) - ident(extend) constant(GeneratorMethods) - reserved(end) - - comment(# JavaScriptGenerator generates blocks of JavaScript code that allow you ) - comment(# to change the content and presentation of multiple DOM elements. Use ) - comment(# this in your Ajax response bodies, either in a ) - comment(#) - comment(# mail_to "me@domain.com", "My email", :encode => "hex" # =>) - comment(# My email) - comment(#) - comment(# You can also specify the cc address, bcc address, subject, and body parts of the message header to create a complex e-mail using the) - comment(# corresponding +cc+, +bcc+, +subject+, and +body+ html_options keys. Each of these options are URI escaped and then appended to) - comment(# the email_address before being output. Be aware that javascript keywords will not be escaped and may break this feature) - comment(# when encoding with javascript.) - comment(# Examples:) - comment(# mail_to "me@domain.com", "My email", :cc => "ccaddress@domain.com", :bcc => "bccaddress@domain.com", :subject => "This is an example email", :body => "This is the body of the message." # =>) - comment(# My email) - reserved(def) method(mail_to)operator(()ident(email_address)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(html_options) operator(=) operator({)operator(})operator(\)) - ident(html_options) operator(=) ident(html_options)operator(.)ident(stringify_keys) - ident(encode) operator(=) ident(html_options)operator(.)ident(delete)operator(()stringoperator(\)) - ident(cc)operator(,) ident(bcc)operator(,) ident(subject)operator(,) ident(body) operator(=) ident(html_options)operator(.)ident(delete)operator(()stringoperator(\))operator(,) ident(html_options)operator(.)ident(delete)operator(()stringoperator(\))operator(,) ident(html_options)operator(.)ident(delete)operator(()stringoperator(\))operator(,) ident(html_options)operator(.)ident(delete)operator(()stringoperator(\)) - - ident(string) operator(=) string - ident(extras) operator(=) string - ident(extras) operator(<<) stringoperator(,) stringoperator(\))inline_delimiter(})>content(&)delimiter(")> reserved(unless) ident(cc)operator(.)ident(nil?) - ident(extras) operator(<<) stringoperator(,) stringoperator(\))inline_delimiter(})>content(&)delimiter(")> reserved(unless) ident(bcc)operator(.)ident(nil?) - ident(extras) operator(<<) stringoperator(,) stringoperator(\))inline_delimiter(})>content(&)delimiter(")> reserved(unless) ident(body)operator(.)ident(nil?) - ident(extras) operator(<<) stringoperator(,) stringoperator(\))inline_delimiter(})>content(&)delimiter(")> reserved(unless) ident(subject)operator(.)ident(nil?) - ident(extras) operator(=) string operator(<<) ident(extras)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) reserved(unless) ident(extras)operator(.)ident(empty?) - - ident(email_address_obfuscated) operator(=) ident(email_address)operator(.)ident(dup) - ident(email_address_obfuscated)operator(.)ident(gsub!)operator(()regexpoperator(,) ident(html_options)operator(.)ident(delete)operator(()stringoperator(\))operator(\)) reserved(if) ident(html_options)operator(.)ident(has_key?)operator(()stringoperator(\)) - ident(email_address_obfuscated)operator(.)ident(gsub!)operator(()regexpoperator(,) ident(html_options)operator(.)ident(delete)operator(()stringoperator(\))operator(\)) reserved(if) ident(html_options)operator(.)ident(has_key?)operator(()stringoperator(\)) - - reserved(if) ident(encode) operator(==) string - ident(tmp) operator(=) stringoperator(,) ident(name) operator(||) ident(email_address)operator(,) ident(html_options)operator(.)ident(merge)operator(()operator({) string operator(=)operator(>) stringoperator(+)ident(email_address)operator(.)ident(to_s)operator(+)ident(extras) operator(})operator(\))operator(\))inline_delimiter(})>content('\);)delimiter(")> - reserved(for) ident(i) reserved(in) integer(0)operator(...)ident(tmp)operator(.)ident(length) - ident(string) operator(<<) ident(sprintf)operator(()stringoperator(,)ident(tmp)operator([)ident(i)operator(])operator(\)) - reserved(end) - stringeval(unescape(')inlinecontent('\)\))delimiter(")> - reserved(elsif) ident(encode) operator(==) string - reserved(for) ident(i) reserved(in) integer(0)operator(...)ident(email_address)operator(.)ident(length) - reserved(if) ident(email_address)operator([)ident(i)operator(,)integer(1)operator(]) operator(=)operator(~) regexp - ident(string) operator(<<) ident(sprintf)operator(()stringoperator(,)ident(email_address)operator([)ident(i)operator(])operator(\)) - reserved(else) - ident(string) operator(<<) ident(email_address)operator([)ident(i)operator(,)integer(1)operator(]) - reserved(end) - reserved(end) - ident(content_tag) stringoperator(,) ident(name) operator(||) ident(email_address_obfuscated)operator(,) ident(html_options)operator(.)ident(merge)operator(()operator({) string operator(=)operator(>) stringinlinedelimiter(")> operator(})operator(\)) - reserved(else) - ident(content_tag) stringoperator(,) ident(name) operator(||) ident(email_address_obfuscated)operator(,) ident(html_options)operator(.)ident(merge)operator(()operator({) string operator(=)operator(>) stringinlinedelimiter(")> operator(})operator(\)) - reserved(end) - reserved(end) - - comment(# Returns true if the current page uri is generated by the options passed (in url_for format\).) - reserved(def) method(current_page?)operator(()ident(options)operator(\)) - constant(CGI)operator(.)ident(escapeHTML)operator(()ident(url_for)operator(()ident(options)operator(\))operator(\)) operator(==) instance_variable(@controller)operator(.)ident(request)operator(.)ident(request_uri) - reserved(end) - - ident(private) - reserved(def) method(convert_options_to_javascript!)operator(()ident(html_options)operator(\)) - ident(confirm)operator(,) ident(popup)operator(,) ident(post) operator(=) ident(html_options)operator(.)ident(delete)operator(()stringoperator(\))operator(,) ident(html_options)operator(.)ident(delete)operator(()stringoperator(\))operator(,) ident(html_options)operator(.)ident(delete)operator(()stringoperator(\)) - - ident(html_options)operator([)stringoperator(]) operator(=) reserved(case) - reserved(when) ident(popup) operator(&&) ident(post) - ident(raise) constant(ActionView)operator(::)constant(ActionViewError)operator(,) string - reserved(when) ident(confirm) operator(&&) ident(popup) - stringcontent(\) { )inlinecontent( };return false;)delimiter(")> - reserved(when) ident(confirm) operator(&&) ident(post) - stringcontent(\) { )inlinecontent( };return false;)delimiter(")> - reserved(when) ident(confirm) - stringcontent(;)delimiter(")> - reserved(when) ident(post) - stringcontent(return false;)delimiter(")> - reserved(when) ident(popup) - ident(popup_javascript_function)operator(()ident(popup)operator(\)) operator(+) string - reserved(else) - ident(html_options)operator([)stringoperator(]) - reserved(end) - reserved(end) - - reserved(def) method(confirm_javascript_function)operator(()ident(confirm)operator(\)) - stringcontent('\))delimiter(")> - reserved(end) - - reserved(def) method(popup_javascript_function)operator(()ident(popup)operator(\)) - ident(popup)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) operator(?) stringcontent(',')inlinecontent('\);)delimiter(")> operator(:) string - reserved(end) - - reserved(def) method(post_javascript_function) - string - reserved(end) - - comment(# Processes the _html_options_ hash, converting the boolean) - comment(# attributes from true/false form into the form required by) - comment(# HTML/XHTML. (An attribute is considered to be boolean if) - comment(# its name is listed in the given _bool_attrs_ array.\)) - comment(#) - comment(# More specifically, for each boolean attribute in _html_options_) - comment(# given as:) - comment(#) - comment(# "attr" => bool_value) - comment(#) - comment(# if the associated _bool_value_ evaluates to true, it is) - comment(# replaced with the attribute's name; otherwise the attribute is) - comment(# removed from the _html_options_ hash. (See the XHTML 1.0 spec,) - comment(# section 4.5 "Attribute Minimization" for more:) - comment(# http://www.w3.org/TR/xhtml1/#h-4.5\)) - comment(#) - comment(# Returns the updated _html_options_ hash, which is also modified) - comment(# in place.) - comment(#) - comment(# Example:) - comment(#) - comment(# convert_boolean_attributes!( html_options,) - comment(# %w( checked disabled readonly \) \)) - reserved(def) method(convert_boolean_attributes!)operator(()ident(html_options)operator(,) ident(bool_attrs)operator(\)) - ident(bool_attrs)operator(.)ident(each) operator({) operator(|)ident(x)operator(|) ident(html_options)operator([)ident(x)operator(]) operator(=) ident(x) reserved(if) ident(html_options)operator(.)ident(delete)operator(()ident(x)operator(\)) operator(}) - ident(html_options) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionView) - comment(# There's also a convenience method for rendering sub templates within the current controller that depends on a single object ) - comment(# (we call this kind of sub templates for partials\). It relies on the fact that partials should follow the naming convention of being ) - comment(# prefixed with an underscore -- as to separate them from regular templates that could be rendered on their own. ) - comment(#) - comment(# In a template for Advertiser#account:) - comment(#) - comment(# <%= render :partial => "account" %>) - comment(#) - comment(# This would render "advertiser/_account.rhtml" and pass the instance variable @account in as a local variable +account+ to ) - comment(# the template for display.) - comment(#) - comment(# In another template for Advertiser#buy, we could have:) - comment(#) - comment(# <%= render :partial => "account", :locals => { :account => @buyer } %>) - comment(#) - comment(# <% for ad in @advertisements %>) - comment(# <%= render :partial => "ad", :locals => { :ad => ad } %>) - comment(# <% end %>) - comment(#) - comment(# This would first render "advertiser/_account.rhtml" with @buyer passed in as the local variable +account+, then render ) - comment(# "advertiser/_ad.rhtml" and pass the local variable +ad+ to the template for display.) - comment(#) - comment(# == Rendering a collection of partials) - comment(#) - comment(# The example of partial use describes a familiar pattern where a template needs to iterate over an array and render a sub) - comment(# template for each of the elements. This pattern has been implemented as a single method that accepts an array and renders) - comment(# a partial by the same name as the elements contained within. So the three-lined example in "Using partials" can be rewritten) - comment(# with a single line:) - comment(#) - comment(# <%= render :partial => "ad", :collection => @advertisements %>) - comment(#) - comment(# This will render "advertiser/_ad.rhtml" and pass the local variable +ad+ to the template for display. An iteration counter) - comment(# will automatically be made available to the template with a name of the form +partial_name_counter+. In the case of the ) - comment(# example above, the template would be fed +ad_counter+.) - comment(#) - comment(# NOTE: Due to backwards compatibility concerns, the collection can't be one of hashes. Normally you'd also just keep domain objects,) - comment(# like Active Records, in there.) - comment(# ) - comment(# == Rendering shared partials) - comment(#) - comment(# Two controllers can share a set of partials and render them like this:) - comment(#) - comment(# <%= render :partial => "advertisement/ad", :locals => { :ad => @advertisement } %>) - comment(#) - comment(# This will render the partial "advertisement/_ad.rhtml" regardless of which controller this is being called from.) - reserved(module) class(Partials) - comment(# Deprecated, use render :partial) - reserved(def) method(render_partial)operator(()ident(partial_path)operator(,) ident(local_assigns) operator(=) pre_constant(nil)operator(,) ident(deprecated_local_assigns) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(path)operator(,) ident(partial_name) operator(=) ident(partial_pieces)operator(()ident(partial_path)operator(\)) - ident(object) operator(=) ident(extracting_object)operator(()ident(partial_name)operator(,) ident(local_assigns)operator(,) ident(deprecated_local_assigns)operator(\)) - ident(local_assigns) operator(=) ident(extract_local_assigns)operator(()ident(local_assigns)operator(,) ident(deprecated_local_assigns)operator(\)) - ident(local_assigns) operator(=) ident(local_assigns) operator(?) ident(local_assigns)operator(.)ident(clone) operator(:) operator({)operator(}) - ident(add_counter_to_local_assigns!)operator(()ident(partial_name)operator(,) ident(local_assigns)operator(\)) - ident(add_object_to_local_assigns!)operator(()ident(partial_name)operator(,) ident(local_assigns)operator(,) ident(object)operator(\)) - - reserved(if) ident(logger) - constant(ActionController)operator(::)constant(Base)operator(.)ident(benchmark)operator(()stringcontent(/_)inlinedelimiter(")>operator(,) constant(Logger)operator(::)constant(DEBUG)operator(,) pre_constant(false)operator(\)) reserved(do) - ident(render)operator(()stringcontent(/_)inlinedelimiter(")>operator(,) ident(local_assigns)operator(\)) - reserved(end) - reserved(else) - ident(render)operator(()stringcontent(/_)inlinedelimiter(")>operator(,) ident(local_assigns)operator(\)) - reserved(end) - reserved(end) - - comment(# Deprecated, use render :partial, :collection) - reserved(def) method(render_partial_collection)operator(()ident(partial_name)operator(,) ident(collection)operator(,) ident(partial_spacer_template) operator(=) pre_constant(nil)operator(,) ident(local_assigns) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(collection_of_partials) operator(=) constant(Array)operator(.)ident(new) - ident(counter_name) operator(=) ident(partial_counter_name)operator(()ident(partial_name)operator(\)) - ident(local_assigns) operator(=) ident(local_assigns) operator(?) ident(local_assigns)operator(.)ident(clone) operator(:) operator({)operator(}) - ident(collection)operator(.)ident(each_with_index) reserved(do) operator(|)ident(element)operator(,) ident(counter)operator(|) - ident(local_assigns)operator([)ident(counter_name)operator(]) operator(=) ident(counter) - ident(collection_of_partials)operator(.)ident(push)operator(()ident(render_partial)operator(()ident(partial_name)operator(,) ident(element)operator(,) ident(local_assigns)operator(\))operator(\)) - reserved(end) - - reserved(return) string reserved(if) ident(collection_of_partials)operator(.)ident(empty?) - - reserved(if) ident(partial_spacer_template) - ident(spacer_path)operator(,) ident(spacer_name) operator(=) ident(partial_pieces)operator(()ident(partial_spacer_template)operator(\)) - ident(collection_of_partials)operator(.)ident(join)operator(()ident(render)operator(()stringcontent(/_)inlinedelimiter(")>operator(\))operator(\)) - reserved(else) - ident(collection_of_partials)operator(.)ident(join) - reserved(end) - reserved(end) - - ident(alias_method) symbol(:render_collection_of_partials)operator(,) symbol(:render_partial_collection) - - ident(private) - reserved(def) method(partial_pieces)operator(()ident(partial_path)operator(\)) - reserved(if) ident(partial_path)operator(.)ident(include?)operator(()stringoperator(\)) - reserved(return) constant(File)operator(.)ident(dirname)operator(()ident(partial_path)operator(\))operator(,) constant(File)operator(.)ident(basename)operator(()ident(partial_path)operator(\)) - reserved(else) - reserved(return) ident(controller)operator(.)ident(class)operator(.)ident(controller_path)operator(,) ident(partial_path) - reserved(end) - reserved(end) - - reserved(def) method(partial_counter_name)operator(()ident(partial_name)operator(\)) - stringoperator(\))operator(.)ident(last)inline_delimiter(})>content(_counter)delimiter(")>operator(.)ident(intern) - reserved(end) - - reserved(def) method(extracting_object)operator(()ident(partial_name)operator(,) ident(local_assigns)operator(,) ident(deprecated_local_assigns)operator(\)) - reserved(if) ident(local_assigns)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(||) ident(local_assigns)operator(.)ident(nil?) - ident(controller)operator(.)ident(instance_variable_get)operator(()stringdelimiter(")>operator(\)) - reserved(else) - comment(# deprecated form where object could be passed in as second parameter) - ident(local_assigns) - reserved(end) - reserved(end) - - reserved(def) method(extract_local_assigns)operator(()ident(local_assigns)operator(,) ident(deprecated_local_assigns)operator(\)) - ident(local_assigns)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(local_assigns) operator(:) ident(deprecated_local_assigns) - reserved(end) - - reserved(def) method(add_counter_to_local_assigns!)operator(()ident(partial_name)operator(,) ident(local_assigns)operator(\)) - ident(counter_name) operator(=) ident(partial_counter_name)operator(()ident(partial_name)operator(\)) - ident(local_assigns)operator([)ident(counter_name)operator(]) operator(=) integer(1) reserved(unless) ident(local_assigns)operator(.)ident(has_key?)operator(()ident(counter_name)operator(\)) - reserved(end) - - reserved(def) method(add_object_to_local_assigns!)operator(()ident(partial_name)operator(,) ident(local_assigns)operator(,) ident(object)operator(\)) - ident(local_assigns)operator([)ident(partial_name)operator(.)ident(intern)operator(]) operator(||=) - reserved(if) ident(object)operator(.)ident(is_a?)operator(()constant(ActionView)operator(::)constant(Base)operator(::)constant(ObjectWrapper)operator(\)) - ident(object)operator(.)ident(value) - reserved(else) - ident(object) - reserved(end) operator(||) ident(controller)operator(.)ident(instance_variable_get)operator(()stringdelimiter(")>operator(\)) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionView) - comment(# The TemplateError exception is raised when the compilation of the template fails. This exception then gathers a) - comment(# bunch of intimate details and uses it to report a very precise exception message.) - reserved(class) class(TemplateError) operator(<) constant(ActionViewError) comment(#:nodoc:) - constant(SOURCE_CODE_RADIUS) operator(=) integer(3) - - ident(attr_reader) symbol(:original_exception) - - reserved(def) method(initialize)operator(()ident(base_path)operator(,) ident(file_name)operator(,) ident(assigns)operator(,) ident(source)operator(,) ident(original_exception)operator(\)) - instance_variable(@base_path)operator(,) instance_variable(@assigns)operator(,) instance_variable(@source)operator(,) instance_variable(@original_exception) operator(=) - ident(base_path)operator(,) ident(assigns)operator(,) ident(source)operator(,) ident(original_exception) - instance_variable(@file_name) operator(=) ident(file_name) - reserved(end) - - reserved(def) method(message) - ident(original_exception)operator(.)ident(message) - reserved(end) - - reserved(def) method(sub_template_message) - reserved(if) instance_variable(@sub_templates) - string operator(+) - instance_variable(@sub_templates)operator(.)ident(collect) operator({) operator(|)ident(template)operator(|) ident(strip_base_path)operator(()ident(template)operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(else) - string - reserved(end) - reserved(end) - - reserved(def) method(source_extract)operator(()ident(indention) operator(=) integer(0)operator(\)) - ident(source_code) operator(=) constant(IO)operator(.)ident(readlines)operator(()instance_variable(@file_name)operator(\)) - - ident(start_on_line) operator(=) operator([) ident(line_number) operator(-) constant(SOURCE_CODE_RADIUS) operator(-) integer(1)operator(,) integer(0) operator(])operator(.)ident(max) - ident(end_on_line) operator(=) operator([) ident(line_number) operator(+) constant(SOURCE_CODE_RADIUS) operator(-) integer(1)operator(,) ident(source_code)operator(.)ident(length)operator(])operator(.)ident(min) - - ident(line_counter) operator(=) ident(start_on_line) - ident(extract) operator(=) ident(source_code)operator([)ident(start_on_line)operator(..)ident(end_on_line)operator(])operator(.)ident(collect) reserved(do) operator(|)ident(line)operator(|) - ident(line_counter) operator(+=) integer(1) - string operator(*) ident(indention)inline_delimiter(})>inlinecontent(: )delimiter(")> operator(+) ident(line) - reserved(end) - - ident(extract)operator(.)ident(join) - reserved(end) - - reserved(def) method(sub_template_of)operator(()ident(file_name)operator(\)) - instance_variable(@sub_templates) operator(||=) operator([)operator(]) - instance_variable(@sub_templates) operator(<<) ident(file_name) - reserved(end) - - reserved(def) method(line_number) - reserved(if) ident(file_name) - ident(regexp) operator(=) regexpcontent(:()char(\\d)content(+\))delimiter(/)> - operator([)instance_variable(@original_exception)operator(.)ident(message)operator(,) instance_variable(@original_exception)operator(.)ident(clean_backtrace)operator(])operator(.)ident(flatten)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - reserved(return) global_variable($1)operator(.)ident(to_i) reserved(if) ident(regexp) operator(=)operator(~) ident(line) - reserved(end) - reserved(end) - integer(0) - reserved(end) - - reserved(def) method(file_name) - ident(stripped) operator(=) ident(strip_base_path)operator(()instance_variable(@file_name)operator(\)) - ident(stripped)operator([)integer(0)operator(]) operator(==) integer(?/) operator(?) ident(stripped)operator([)integer(1)operator(..)integer(-1)operator(]) operator(:) ident(stripped) - reserved(end) - - reserved(def) method(to_s) - stringcontent( ()inlinecontent(\) on line #)inlinecontent( of )inlinecontent(:)char(\\n)delimiter(")> operator(+) - ident(source_extract) operator(+) string operator(+) - ident(original_exception)operator(.)ident(clean_backtrace)operator(.)ident(join)operator(()stringoperator(\)) operator(+) - string - reserved(end) - - reserved(def) method(backtrace) - operator([) - stringcontent( of )inlinechar(\\n)char(\\n)inlinechar(\\n)content( )delimiter(")> operator(+) - ident(original_exception)operator(.)ident(clean_backtrace)operator(.)ident(join)operator(()stringoperator(\)) - operator(]) - reserved(end) - - ident(private) - reserved(def) method(strip_base_path)operator(()ident(file_name)operator(\)) - ident(file_name) operator(=) constant(File)operator(.)ident(expand_path)operator(()ident(file_name)operator(\))operator(.)ident(gsub)operator(()regexpdelimiter(/)>operator(,) stringoperator(\)) - ident(file_name)operator(.)ident(gsub)operator(()instance_variable(@base_path)operator(,) stringoperator(\)) - reserved(end) - reserved(end) -reserved(end) - -constant(Exception)operator(::)constant(TraceSubstitutions) operator(<<) operator([)regexpoperator(,) stringoperator(]) reserved(if) reserved(defined?)operator(()constant(Exception)operator(::)constant(TraceSubstitutions)operator(\)) -constant(Exception)operator(::)constant(TraceSubstitutions) operator(<<) operator([)regexpdelimiter(})>operator(,) stringoperator(]) reserved(if) reserved(defined?)operator(()constant(RAILS_ROOT)operator(\)) -comment(#--) -comment(# Copyright (c\) 2004 David Heinemeier Hansson) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#++) - -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -ident(require) string -ident(require) string - -constant(ActionView)operator(::)constant(Base)operator(.)ident(class_eval) reserved(do) - ident(include) constant(ActionView)operator(::)constant(Partials) -reserved(end) - -constant(ActionView)operator(::)constant(Base)operator(.)ident(load_helpers)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -ident(require) string - -constant(ActionController)operator(::)constant(Base)operator(.)ident(logger) operator(=) pre_constant(nil) -constant(ActionController)operator(::)constant(Base)operator(.)ident(ignore_missing_templates) operator(=) pre_constant(false) -constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(reload) reserved(rescue) ident(nilrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -comment(# Define the essentials) -reserved(class) class(ActiveRecordTestConnector) - ident(cattr_accessor) symbol(:able_to_connect) - ident(cattr_accessor) symbol(:connected) - - comment(# Set our defaults) - pre_constant(self)operator(.)ident(connected) operator(=) pre_constant(false) - pre_constant(self)operator(.)ident(able_to_connect) operator(=) pre_constant(true) -reserved(end) - -comment(# Try to grab AR) -reserved(begin) - constant(PATH_TO_AR) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - ident(require) stringcontent(/lib/active_record)delimiter(")> reserved(unless) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:ActiveRecord)operator(\)) - ident(require) stringcontent(/lib/active_record/fixtures)delimiter(")> reserved(unless) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:Fixtures)operator(\)) -reserved(rescue) constant(Object) operator(=)operator(>) ident(e) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> - constant(ActiveRecordTestConnector)operator(.)ident(able_to_connect) operator(=) pre_constant(false) -reserved(end) - -comment(# Define the rest of the connector) -reserved(class) class(ActiveRecordTestConnector) - reserved(def) pre_constant(self)operator(.)method(setup) - reserved(unless) pre_constant(self)operator(.)ident(connected) operator(||) operator(!)pre_constant(self)operator(.)ident(able_to_connect) - ident(setup_connection) - ident(load_schema) - pre_constant(self)operator(.)ident(connected) operator(=) pre_constant(true) - reserved(end) - reserved(rescue) constant(Object) operator(=)operator(>) ident(e) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> - comment(#$stderr.puts " #{e.backtrace.join("\\n "\)}\\n") - pre_constant(self)operator(.)ident(able_to_connect) operator(=) pre_constant(false) - reserved(end) - - ident(private) - - reserved(def) pre_constant(self)operator(.)method(setup_connection) - reserved(if) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:ActiveRecord)operator(\)) - - reserved(begin) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(()symbol(:adapter) operator(=)operator(>) stringoperator(,) symbol(:dbfile) operator(=)operator(>) stringoperator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection) - reserved(rescue) constant(Object) - global_variable($stderr)operator(.)ident(puts) string - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(()symbol(:adapter) operator(=)operator(>) stringoperator(,) symbol(:dbfile) operator(=)operator(>) stringoperator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection) - reserved(end) - - constant(Object)operator(.)ident(send)operator(()symbol(:const_set)operator(,) symbol(:QUOTED_TYPE)operator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(quote_column_name)operator(()stringoperator(\))operator(\)) reserved(unless) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:QUOTED_TYPE)operator(\)) - reserved(else) - ident(raise) string - reserved(end) - reserved(end) - - comment(# Load actionpack sqlite tables) - reserved(def) pre_constant(self)operator(.)method(load_schema) - constant(File)operator(.)ident(read)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(sql)operator(|) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(execute)operator(()ident(sql)operator(\)) reserved(unless) ident(sql)operator(.)ident(blank?) - reserved(end) - reserved(end) -reserved(end) - -comment(# Test case for inheiritance ) -reserved(class) class(ActiveRecordTestCase) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - comment(# Set our fixture path) - pre_constant(self)operator(.)ident(fixture_path) operator(=) stringcontent(/fixtures/)delimiter(")> - - reserved(def) method(setup) - ident(abort_tests) reserved(unless) constant(ActiveRecordTestConnector)operator(.)ident(connected) operator(=) pre_constant(true) - reserved(end) - - comment(# Default so Test::Unit::TestCase doesn't complain) - reserved(def) method(test_truth) - reserved(end) - - ident(private) - - comment(# If things go wrong, we don't want to run our test cases. We'll just define them to test nothing.) - reserved(def) method(abort_tests) - pre_constant(self)operator(.)ident(class)operator(.)ident(public_instance_methods)operator(.)ident(grep)operator(()regexpoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - pre_constant(self)operator(.)ident(class)operator(.)ident(class_eval) operator({) ident(define_method)operator(()ident(method)operator(.)ident(to_sym)operator(\))operator({)operator(}) operator(}) - reserved(end) - reserved(end) -reserved(end) - -constant(ActiveRecordTestConnector)operator(.)ident(setuprequire) stringcontent(/../active_record_unit)delimiter(")> -ident(require) string - -reserved(class) class(ActiveRecordAssertionsController) operator(<) constant(ActionController)operator(::)constant(Base) - pre_constant(self)operator(.)ident(template_root) operator(=) stringcontent(/../fixtures/)delimiter(")> - - comment(# fail with 1 bad column) - reserved(def) method(nasty_columns_1) - instance_variable(@company) operator(=) constant(Company)operator(.)ident(new) - instance_variable(@company)operator(.)ident(name) operator(=) string - instance_variable(@company)operator(.)ident(rating) operator(=) integer(2) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - comment(# fail with 2 bad columns) - reserved(def) method(nasty_columns_2) - instance_variable(@company) operator(=) constant(Company)operator(.)ident(new) - instance_variable(@company)operator(.)ident(name) operator(=) string - instance_variable(@company)operator(.)ident(rating) operator(=) integer(2) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - comment(# this will pass validation) - reserved(def) method(good_company) - instance_variable(@company) operator(=) constant(Company)operator(.)ident(new) - instance_variable(@company)operator(.)ident(name) operator(=) string - instance_variable(@company)operator(.)ident(rating) operator(=) integer(69) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - comment(# this will fail validation) - reserved(def) method(bad_company) - instance_variable(@company) operator(=) constant(Company)operator(.)ident(new) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - comment(# the safety dance......) - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise)operator(;) reserved(end) -reserved(end) - -reserved(class) class(ActiveRecordAssertionsControllerTest) operator(<) constant(ActiveRecordTestCase) - ident(fixtures) symbol(:companies) - - reserved(def) method(setup) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - instance_variable(@controller) operator(=) constant(ActiveRecordAssertionsController)operator(.)ident(new) - reserved(super) - reserved(end) - - comment(# test for 1 bad apple column) - reserved(def) method(test_some_invalid_columns) - ident(process) symbol(:nasty_columns_1) - ident(assert_success) - ident(assert_invalid_record) string - ident(assert_invalid_column_on_record) stringoperator(,) string - ident(assert_valid_column_on_record) stringoperator(,) string - ident(assert_valid_column_on_record) stringoperator(,) string - reserved(end) - - comment(# test for 2 bad apples columns) - reserved(def) method(test_all_invalid_columns) - ident(process) symbol(:nasty_columns_2) - ident(assert_success) - ident(assert_invalid_record) string - ident(assert_invalid_column_on_record) stringoperator(,) string - ident(assert_invalid_column_on_record) stringoperator(,) string - ident(assert_invalid_column_on_record) stringoperator(,) string - reserved(end) - - comment(# ensure we have no problems with an ActiveRecord) - reserved(def) method(test_valid_record) - ident(process) symbol(:good_company) - ident(assert_success) - ident(assert_valid_record) string - reserved(end) - - comment(# ensure we have problems with an ActiveRecord) - reserved(def) method(test_invalid_record) - ident(process) symbol(:bad_company) - ident(assert_success) - ident(assert_invalid_record) string - reserved(end) -reserved(end)comment(# Unfurl the safety net.) -ident(path_to_ar) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -reserved(if) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:ActiveRecord)operator(\)) reserved(or) constant(File)operator(.)ident(exist?)operator(()ident(path_to_ar)operator(\)) - reserved(begin) - -comment(# These tests exercise CGI::Session::ActiveRecordStore, so you're going to) -comment(# need AR in a sibling directory to AP and have SQLite installed.) - -reserved(unless) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:ActiveRecord)operator(\)) - ident(require) constant(File)operator(.)ident(join)operator(()ident(path_to_ar)operator(,) stringoperator(,) stringoperator(\)) -reserved(end) - -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string - -comment(#ActiveRecord::Base.logger = Logger.new($stdout\)) -reserved(begin) - constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(::)constant(Session)operator(.)ident(establish_connection)operator(()symbol(:adapter) operator(=)operator(>) stringoperator(,) symbol(:database) operator(=)operator(>) stringoperator(\)) - constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(::)constant(Session)operator(.)ident(connection) -reserved(rescue) constant(Object) - global_variable($stderr)operator(.)ident(puts) string - reserved(begin) - constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(::)constant(Session)operator(.)ident(establish_connection)operator(()symbol(:adapter) operator(=)operator(>) stringoperator(,) symbol(:database) operator(=)operator(>) stringoperator(\)) - constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(::)constant(Session)operator(.)ident(connection) - reserved(rescue) constant(Object) - global_variable($stderr)operator(.)ident(puts) string - ident(raise) constant(SystemExit) - reserved(end) -reserved(end) - - -reserved(module) class(CommonActiveRecordStoreTests) - reserved(def) method(test_basics) - ident(s) operator(=) ident(session_class)operator(.)ident(new)operator(()symbol(:session_id) operator(=)operator(>) stringoperator(,) symbol(:data) operator(=)operator(>) operator({) string operator(=)operator(>) string operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(s)operator(.)ident(data)operator([)stringoperator(]) - ident(assert) ident(s)operator(.)ident(save) - ident(assert_equal) stringoperator(,) ident(s)operator(.)ident(data)operator([)stringoperator(]) - - ident(assert_not_nil) ident(t) operator(=) ident(session_class)operator(.)ident(find_by_session_id)operator(()stringoperator(\)) - ident(assert_not_nil) ident(t)operator(.)ident(data) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(data)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_reload_same_session) - instance_variable(@new_session)operator(.)ident(update) - ident(reloaded) operator(=) constant(CGI)operator(::)constant(Session)operator(.)ident(new)operator(()constant(CGI)operator(.)ident(new)operator(,) string operator(=)operator(>) instance_variable(@new_session)operator(.)ident(session_id)operator(,) string operator(=)operator(>) constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(\)) - ident(assert_equal) stringoperator(,) ident(reloaded)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_tolerates_close_close) - ident(assert_nothing_raised) reserved(do) - instance_variable(@new_session)operator(.)ident(close) - instance_variable(@new_session)operator(.)ident(close) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(ActiveRecordStoreTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(CommonActiveRecordStoreTests) - - reserved(def) method(session_class) - constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(::)constant(Session) - reserved(end) - - reserved(def) method(session_id_column) - string - reserved(end) - - reserved(def) method(setup) - ident(session_class)operator(.)ident(create_table!) - - pre_constant(ENV)operator([)stringoperator(]) operator(=) string - constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(.)ident(session_class) operator(=) ident(session_class) - - instance_variable(@cgi) operator(=) constant(CGI)operator(.)ident(new) - instance_variable(@new_session) operator(=) constant(CGI)operator(::)constant(Session)operator(.)ident(new)operator(()instance_variable(@cgi)operator(,) string operator(=)operator(>) constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(,) string operator(=)operator(>) pre_constant(true)operator(\)) - instance_variable(@new_session)operator([)stringoperator(]) operator(=) string - reserved(end) - -comment(# this test only applies for eager sesssion saving) -comment(# def test_another_instance) -comment(# @another = CGI::Session.new(@cgi, 'session_id' => @new_session.session_id, 'database_manager' => CGI::Session::ActiveRecordStore\)) -comment(# assert_equal @new_session.session_id, @another.session_id) -comment(# end) - - reserved(def) method(test_model_attribute) - ident(assert_kind_of) constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(::)constant(Session)operator(,) instance_variable(@new_session)operator(.)ident(model) - ident(assert_equal)operator(()operator({) string operator(=)operator(>) string operator(})operator(,) instance_variable(@new_session)operator(.)ident(model)operator(.)ident(data)operator(\)) - reserved(end) - - reserved(def) method(test_save_unloaded_session) - ident(c) operator(=) ident(session_class)operator(.)ident(connection) - ident(bogus_class) operator(=) ident(c)operator(.)ident(quote)operator(()constant(Base64)operator(.)ident(encode64)operator(()stringoperator(\))operator(\)) - ident(c)operator(.)ident(insert)operator(()stringcontent( (')inlinecontent(', 'data'\) VALUES ('abcdefghijklmnop', )inlinecontent(\))delimiter(")>operator(\)) - - ident(sess) operator(=) ident(session_class)operator(.)ident(find_by_session_id)operator(()stringoperator(\)) - ident(assert_not_nil) ident(sess) - ident(assert) operator(!)ident(sess)operator(.)ident(loaded?) - - comment(# because the session is not loaded, the save should be a no-op. If it) - comment(# isn't, this'll try and unmarshall the bogus class, and should get an error.) - ident(assert_nothing_raised) operator({) ident(sess)operator(.)ident(save) operator(}) - reserved(end) - - reserved(def) method(teardown) - ident(session_class)operator(.)ident(drop_table!) - reserved(end) -reserved(end) - -reserved(class) class(ColumnLimitTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@session_class) operator(=) constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(::)constant(Session) - instance_variable(@session_class)operator(.)ident(create_table!) - reserved(end) - - reserved(def) method(teardown) - instance_variable(@session_class)operator(.)ident(drop_table!) - reserved(end) - - reserved(def) method(test_protection_from_data_larger_than_column) - comment(# Can't test this unless there is a limit) - reserved(return) reserved(unless) ident(limit) operator(=) instance_variable(@session_class)operator(.)ident(data_column_size_limit) - ident(too_big) operator(=) string operator(*) ident(limit) - ident(s) operator(=) instance_variable(@session_class)operator(.)ident(new)operator(()symbol(:session_id) operator(=)operator(>) stringoperator(,) symbol(:data) operator(=)operator(>) operator({)string operator(=)operator(>) ident(too_big)operator(})operator(\)) - ident(s)operator(.)ident(data) - ident(assert_raise)operator(()constant(ActionController)operator(::)constant(SessionOverflowError)operator(\)) operator({) ident(s)operator(.)ident(save) operator(}) - reserved(end) -reserved(end) - -reserved(class) class(DeprecatedActiveRecordStoreTest) operator(<) constant(ActiveRecordStoreTest) - reserved(def) method(session_id_column) - string - reserved(end) - - reserved(def) method(setup) - ident(session_class)operator(.)ident(connection)operator(.)ident(execute) string - ident(session_class)operator(.)ident(table_name) operator(=) string - ident(session_class)operator(.)ident(send) symbol(:setup_sessid_compatibility!) - - pre_constant(ENV)operator([)stringoperator(]) operator(=) string - constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(.)ident(session_class) operator(=) ident(session_class) - - instance_variable(@new_session) operator(=) constant(CGI)operator(::)constant(Session)operator(.)ident(new)operator(()constant(CGI)operator(.)ident(new)operator(,) string operator(=)operator(>) constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(,) string operator(=)operator(>) pre_constant(true)operator(\)) - instance_variable(@new_session)operator([)stringoperator(]) operator(=) string - reserved(end) - - reserved(def) method(teardown) - ident(session_class)operator(.)ident(connection)operator(.)ident(execute) string - ident(session_class)operator(.)ident(table_name) operator(=) string - reserved(end) -reserved(end) - -reserved(class) class(SqlBypassActiveRecordStoreTest) operator(<) constant(ActiveRecordStoreTest) - reserved(def) method(session_class) - reserved(unless) instance_variable(@session_class) - instance_variable(@session_class) operator(=) constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(::)constant(SqlBypass) - instance_variable(@session_class)operator(.)ident(connection) operator(=) constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(::)constant(Session)operator(.)ident(connection) - reserved(end) - instance_variable(@session_class) - reserved(end) - - reserved(def) method(test_model_attribute) - ident(assert_kind_of) constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(::)constant(SqlBypass)operator(,) instance_variable(@new_session)operator(.)ident(model) - ident(assert_equal)operator(()operator({) string operator(=)operator(>) string operator(})operator(,) instance_variable(@new_session)operator(.)ident(model)operator(.)ident(data)operator(\)) - reserved(end) -reserved(end) - - -comment(# End of safety net.) - reserved(rescue) constant(Object) operator(=)operator(>) ident(e) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> - comment(#$stderr.puts " #{e.backtrace.join("\\n "\)}") - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(PaginationTest) operator(<) constant(ActiveRecordTestCase) - ident(fixtures) symbol(:topics)operator(,) symbol(:replies)operator(,) symbol(:developers)operator(,) symbol(:projects)operator(,) symbol(:developers_projects) - - reserved(class) class(PaginationController) operator(<) constant(ActionController)operator(::)constant(Base) - pre_constant(self)operator(.)ident(template_root) operator(=) stringcontent(/../fixtures/)delimiter(")> - - reserved(def) method(simple_paginate) - instance_variable(@topic_pages)operator(,) instance_variable(@topics) operator(=) ident(paginate)operator(()symbol(:topics)operator(\)) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(paginate_with_per_page) - instance_variable(@topic_pages)operator(,) instance_variable(@topics) operator(=) ident(paginate)operator(()symbol(:topics)operator(,) symbol(:per_page) operator(=)operator(>) integer(1)operator(\)) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(paginate_with_order) - instance_variable(@topic_pages)operator(,) instance_variable(@topics) operator(=) ident(paginate)operator(()symbol(:topics)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(paginate_with_order_by) - instance_variable(@topic_pages)operator(,) instance_variable(@topics) operator(=) ident(paginate)operator(()symbol(:topics)operator(,) symbol(:order_by) operator(=)operator(>) stringoperator(\)) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(paginate_with_include_and_order) - instance_variable(@topic_pages)operator(,) instance_variable(@topics) operator(=) ident(paginate)operator(()symbol(:topics)operator(,) symbol(:include) operator(=)operator(>) symbol(:replies)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(paginate_with_conditions) - instance_variable(@topic_pages)operator(,) instance_variable(@topics) operator(=) ident(paginate)operator(()symbol(:topics)operator(,) symbol(:conditions) operator(=)operator(>) operator([)string ?)delimiter(")>operator(,) integer(30)operator(.)ident(minutes)operator(.)ident(ago)operator(])operator(\)) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(paginate_with_class_name) - instance_variable(@developer_pages)operator(,) instance_variable(@developers) operator(=) ident(paginate)operator(()symbol(:developers)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(\)) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(paginate_with_singular_name) - instance_variable(@developer_pages)operator(,) instance_variable(@developers) operator(=) ident(paginate)operator(()operator(\)) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(paginate_with_joins) - instance_variable(@developer_pages)operator(,) instance_variable(@developers) operator(=) ident(paginate)operator(()symbol(:developers)operator(,) - symbol(:joins) operator(=)operator(>) stringoperator(,) - symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(paginate_with_join) - instance_variable(@developer_pages)operator(,) instance_variable(@developers) operator(=) ident(paginate)operator(()symbol(:developers)operator(,) - symbol(:join) operator(=)operator(>) stringoperator(,) - symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(paginate_with_join_and_count) - instance_variable(@developer_pages)operator(,) instance_variable(@developers) operator(=) ident(paginate)operator(()symbol(:developers)operator(,) - symbol(:join) operator(=)operator(>) stringoperator(,) - symbol(:conditions) operator(=)operator(>) stringoperator(,) - symbol(:count) operator(=)operator(>) stringoperator(\)) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(rescue_errors)operator(()ident(e)operator(\)) ident(raise) ident(e) reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) - - reserved(end) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(PaginationController)operator(.)ident(new) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - reserved(super) - reserved(end) - - comment(# Single Action Pagination Tests) - - reserved(def) method(test_simple_paginate) - ident(get) symbol(:simple_paginate) - ident(assert_equal) integer(1)operator(,) ident(assigns)operator(()symbol(:topic_pages)operator(\))operator(.)ident(page_count) - ident(assert_equal) integer(3)operator(,) ident(assigns)operator(()symbol(:topics)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_paginate_with_per_page) - ident(get) symbol(:paginate_with_per_page) - ident(assert_equal) integer(1)operator(,) ident(assigns)operator(()symbol(:topics)operator(\))operator(.)ident(size) - ident(assert_equal) integer(3)operator(,) ident(assigns)operator(()symbol(:topic_pages)operator(\))operator(.)ident(page_count) - reserved(end) - - reserved(def) method(test_paginate_with_order) - ident(get) symbol(:paginate_with_order) - ident(expected) operator(=) operator([)ident(topics)operator(()symbol(:futurama)operator(\))operator(,) - ident(topics)operator(()symbol(:harvey_birdman)operator(\))operator(,) - ident(topics)operator(()symbol(:rails)operator(\))operator(]) - ident(assert_equal) ident(expected)operator(,) ident(assigns)operator(()symbol(:topics)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(assigns)operator(()symbol(:topic_pages)operator(\))operator(.)ident(page_count) - reserved(end) - - reserved(def) method(test_paginate_with_order_by) - ident(get) symbol(:paginate_with_order) - ident(expected) operator(=) ident(assigns)operator(()symbol(:topics)operator(\)) - ident(get) symbol(:paginate_with_order_by) - ident(assert_equal) ident(expected)operator(,) ident(assigns)operator(()symbol(:topics)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(assigns)operator(()symbol(:topic_pages)operator(\))operator(.)ident(page_count) - reserved(end) - - reserved(def) method(test_paginate_with_conditions) - ident(get) symbol(:paginate_with_conditions) - ident(expected) operator(=) operator([)ident(topics)operator(()symbol(:rails)operator(\))operator(]) - ident(assert_equal) ident(expected)operator(,) ident(assigns)operator(()symbol(:topics)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(assigns)operator(()symbol(:topic_pages)operator(\))operator(.)ident(page_count) - reserved(end) - - reserved(def) method(test_paginate_with_class_name) - ident(get) symbol(:paginate_with_class_name) - - ident(assert) ident(assigns)operator(()symbol(:developers)operator(\))operator(.)ident(size) operator(>) integer(0) - ident(assert_equal) constant(DeVeLoPeR)operator(,) ident(assigns)operator(()symbol(:developers)operator(\))operator(.)ident(first)operator(.)ident(class) - reserved(end) - - reserved(def) method(test_paginate_with_joins) - ident(get) symbol(:paginate_with_joins) - ident(assert_equal) integer(2)operator(,) ident(assigns)operator(()symbol(:developers)operator(\))operator(.)ident(size) - ident(developer_names) operator(=) ident(assigns)operator(()symbol(:developers)operator(\))operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - ident(assert) ident(developer_names)operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(developer_names)operator(.)ident(include?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_paginate_with_join_and_conditions) - ident(get) symbol(:paginate_with_joins) - ident(expected) operator(=) ident(assigns)operator(()symbol(:developers)operator(\)) - ident(get) symbol(:paginate_with_join) - ident(assert_equal) ident(expected)operator(,) ident(assigns)operator(()symbol(:developers)operator(\)) - reserved(end) - - reserved(def) method(test_paginate_with_join_and_count) - ident(get) symbol(:paginate_with_joins) - ident(expected) operator(=) ident(assigns)operator(()symbol(:developers)operator(\)) - ident(get) symbol(:paginate_with_join_and_count) - ident(assert_equal) ident(expected)operator(,) ident(assigns)operator(()symbol(:developers)operator(\)) - reserved(end) - - reserved(def) method(test_paginate_with_include_and_order) - ident(get) symbol(:paginate_with_include_and_order) - ident(expected) operator(=) constant(Topic)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(10)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(assigns)operator(()symbol(:topics)operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -comment(# a controller class to facilitate the tests) -reserved(class) class(ActionPackAssertionsController) operator(<) constant(ActionController)operator(::)constant(Base) - - comment(# this does absolutely nothing) - reserved(def) method(nothing)operator(()operator(\)) ident(render_text) stringoperator(;) reserved(end) - - comment(# a standard template) - reserved(def) method(hello_world)operator(()operator(\)) ident(render) stringoperator(;) reserved(end) - - comment(# a standard template) - reserved(def) method(hello_xml_world)operator(()operator(\)) ident(render) stringoperator(;) reserved(end) - - comment(# a redirect to an internal location) - reserved(def) method(redirect_internal)operator(()operator(\)) ident(redirect_to) stringoperator(;) reserved(end) - - reserved(def) method(redirect_to_action)operator(()operator(\)) ident(redirect_to) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(1)operator(,) symbol(:params) operator(=)operator(>) operator({) string operator(=)operator(>) string operator(})operator(;) reserved(end) - - reserved(def) method(redirect_to_controller)operator(()operator(\)) ident(redirect_to) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(;) reserved(end) - - reserved(def) method(redirect_to_path)operator(()operator(\)) ident(redirect_to) string reserved(end) - - reserved(def) method(redirect_to_named_route)operator(()operator(\)) ident(redirect_to) ident(route_one_url) reserved(end) - - comment(# a redirect to an external location) - reserved(def) method(redirect_external)operator(()operator(\)) ident(redirect_to_url) stringoperator(;) reserved(end) - - comment(# a 404) - reserved(def) method(response404)operator(()operator(\)) ident(render_text) stringoperator(,) stringoperator(;) reserved(end) - - comment(# a 500) - reserved(def) method(response500)operator(()operator(\)) ident(render_text) stringoperator(,) stringoperator(;) reserved(end) - - comment(# a fictional 599) - reserved(def) method(response599)operator(()operator(\)) ident(render_text) stringoperator(,) stringoperator(;) reserved(end) - - comment(# putting stuff in the flash) - reserved(def) method(flash_me) - ident(flash)operator([)stringoperator(]) operator(=) string - ident(render_text) string - reserved(end) - - comment(# we have a flash, but nothing is in it) - reserved(def) method(flash_me_naked) - ident(flash)operator(.)ident(clear) - ident(render_text) string - reserved(end) - - comment(# assign some template instance variables) - reserved(def) method(assign_this) - instance_variable(@howdy) operator(=) string - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - reserved(def) method(render_based_on_parameters) - ident(render_text) stringoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(render_url) - ident(render_text) string)inline) stringoperator(,) symbol(:only_path) operator(=)operator(>) pre_constant(true)operator(\))inline_delimiter(})>content(
)delimiter(")> - reserved(end) - - comment(# puts something in the session) - reserved(def) method(session_stuffing) - ident(session)operator([)stringoperator(]) operator(=) string - ident(render_text) string - reserved(end) - - comment(# raises exception on get requests) - reserved(def) method(raise_on_get) - ident(raise) string reserved(if) instance_variable(@request)operator(.)ident(get?) - ident(render_text) stringoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - comment(# raises exception on post requests) - reserved(def) method(raise_on_post) - ident(raise) string reserved(if) instance_variable(@request)operator(.)ident(post?) - ident(render_text) stringoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(get_valid_record) - instance_variable(@record) operator(=) constant(Class)operator(.)ident(new) reserved(do) - reserved(def) method(valid?) - pre_constant(true) - reserved(end) - - reserved(def) method(errors) - constant(Class)operator(.)ident(new) reserved(do) - reserved(def) method(full_messages)operator(;) operator([)operator(])operator(;) reserved(end) - reserved(end)operator(.)ident(new) - reserved(end) - - reserved(end)operator(.)ident(new) - - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - - reserved(def) method(get_invalid_record) - instance_variable(@record) operator(=) constant(Class)operator(.)ident(new) reserved(do) - - reserved(def) method(valid?) - pre_constant(false) - reserved(end) - - reserved(def) method(errors) - constant(Class)operator(.)ident(new) reserved(do) - reserved(def) method(full_messages)operator(;) operator([)stringoperator(])operator(;) reserved(end) - reserved(end)operator(.)ident(new) - reserved(end) - reserved(end)operator(.)ident(new) - - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - comment(# 911) - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise)operator(;) reserved(end) -reserved(end) - -reserved(module) class(Admin) - reserved(class) class(InnerModuleController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(redirect_to_absolute_controller) - ident(redirect_to) symbol(:controller) operator(=)operator(>) string - reserved(end) - reserved(def) method(redirect_to_fellow_controller) - ident(redirect_to) symbol(:controller) operator(=)operator(>) string - reserved(end) - reserved(end) -reserved(end) - -comment(# ---------------------------------------------------------------------------) - - -comment(# tell the controller where to find its templates but start from parent ) -comment(# directory of test_request_response to simulate the behaviour of a ) -comment(# production environment) -constant(ActionPackAssertionsController)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - - -comment(# a test case to exercise the new capabilities TestRequest & TestResponse) -reserved(class) class(ActionPackAssertionsControllerTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - comment(# let's get this party started ) - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(ActionPackAssertionsController)operator(.)ident(new) - instance_variable(@request)operator(,) instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new)operator(,) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - reserved(end) - - comment(# -- assertion-based testing ------------------------------------------------) - - reserved(def) method(test_assert_tag_and_url_for) - ident(get) symbol(:render_url) - ident(assert_tag) symbol(:content) operator(=)operator(>) string - reserved(end) - - comment(# test the session assertion to make sure something is there.) - reserved(def) method(test_assert_session_has) - ident(process) symbol(:session_stuffing) - ident(assert_session_has) string - ident(assert_session_has_no) string - reserved(end) - - comment(# test the get method, make sure the request really was a get) - reserved(def) method(test_get) - ident(assert_raise)operator(()constant(RuntimeError)operator(\)) operator({) ident(get) symbol(:raise_on_get) operator(}) - ident(get) symbol(:raise_on_post) - ident(assert_equal) instance_variable(@response)operator(.)ident(body)operator(,) string - reserved(end) - - comment(# test the get method, make sure the request really was a get) - reserved(def) method(test_post) - ident(assert_raise)operator(()constant(RuntimeError)operator(\)) operator({) ident(post) symbol(:raise_on_post) operator(}) - ident(post) symbol(:raise_on_get) - ident(assert_equal) instance_variable(@response)operator(.)ident(body)operator(,) string - reserved(end) - -comment(# the following test fails because the request_method is now cached on the request instance) -comment(# test the get/post switch within one test action) -comment(# def test_get_post_switch) -comment(# post :raise_on_get) -comment(# assert_equal @response.body, 'request method: POST') -comment(# get :raise_on_post) -comment(# assert_equal @response.body, 'request method: GET') -comment(# post :raise_on_get) -comment(# assert_equal @response.body, 'request method: POST') -comment(# get :raise_on_post) -comment(# assert_equal @response.body, 'request method: GET') -comment(# end) - - comment(# test the assertion of goodies in the template) - reserved(def) method(test_assert_template_has) - ident(process) symbol(:assign_this) - ident(assert_template_has) string - reserved(end) - - comment(# test the assertion for goodies that shouldn't exist in the template) - reserved(def) method(test_assert_template_has_no) - ident(process) symbol(:nothing) - ident(assert_template_has_no) string - ident(assert_template_has_no) string - reserved(end) - - comment(# test the redirection assertions) - reserved(def) method(test_assert_redirect) - ident(process) symbol(:redirect_internal) - ident(assert_redirect) - reserved(end) - - comment(# test the redirect url string) - reserved(def) method(test_assert_redirect_url) - ident(process) symbol(:redirect_external) - ident(assert_redirect_url) string - reserved(end) - - comment(# test the redirection pattern matching on a string) - reserved(def) method(test_assert_redirect_url_match_string) - ident(process) symbol(:redirect_external) - ident(assert_redirect_url_match) string - reserved(end) - - comment(# test the redirection pattern matching on a pattern) - reserved(def) method(test_assert_redirect_url_match_pattern) - ident(process) symbol(:redirect_external) - ident(assert_redirect_url_match) regexp - reserved(end) - - comment(# test the redirection to a named route) - reserved(def) method(test_assert_redirect_to_named_route) - ident(process) symbol(:redirect_to_named_route) - ident(assert_raise)operator(()constant(Test)operator(::)constant(Unit)operator(::)constant(AssertionFailedError)operator(\)) reserved(do) - ident(assert_redirected_to) string - reserved(end) - reserved(end) - - comment(# test the flash-based assertions with something is in the flash) - reserved(def) method(test_flash_assertions_full) - ident(process) symbol(:flash_me) - ident(assert) instance_variable(@response)operator(.)ident(has_flash_with_contents?) - ident(assert_flash_exists) - ident(assert_flash_not_empty) - ident(assert_flash_has) string - ident(assert_flash_has_no) string - reserved(end) - - comment(# test the flash-based assertions with no flash at all) - reserved(def) method(test_flash_assertions_negative) - ident(process) symbol(:nothing) - ident(assert_flash_empty) - ident(assert_flash_has_no) string - ident(assert_flash_has_no) string - reserved(end) - - comment(# test the assert_rendered_file ) - reserved(def) method(test_assert_rendered_file) - ident(process) symbol(:hello_world) - ident(assert_rendered_file) string - ident(assert_rendered_file) string - reserved(end) - - comment(# test the assert_success assertion) - reserved(def) method(test_assert_success) - ident(process) symbol(:nothing) - ident(assert_success) - ident(assert_rendered_file) - reserved(end) - - comment(# -- standard request/response object testing --------------------------------) - - comment(# ensure our session is working properly) - reserved(def) method(test_session_objects) - ident(process) symbol(:session_stuffing) - ident(assert) instance_variable(@response)operator(.)ident(has_session_object?)operator(()stringoperator(\)) - ident(assert_session_equal) stringoperator(,) string - ident(assert) operator(!)instance_variable(@response)operator(.)ident(has_session_object?)operator(()stringoperator(\)) - reserved(end) - - comment(# make sure that the template objects exist) - reserved(def) method(test_template_objects_alive) - ident(process) symbol(:assign_this) - ident(assert) operator(!)instance_variable(@response)operator(.)ident(has_template_object?)operator(()stringoperator(\)) - ident(assert) instance_variable(@response)operator(.)ident(has_template_object?)operator(()stringoperator(\)) - reserved(end) - - comment(# make sure we don't have template objects when we shouldn't) - reserved(def) method(test_template_object_missing) - ident(process) symbol(:nothing) - ident(assert_nil) instance_variable(@response)operator(.)ident(template_objects)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_assigned_equal) - ident(process) symbol(:assign_this) - ident(assert_assigned_equal) stringoperator(,) symbol(:howdy) - reserved(end) - - comment(# check the empty flashing) - reserved(def) method(test_flash_me_naked) - ident(process) symbol(:flash_me_naked) - ident(assert) operator(!)instance_variable(@response)operator(.)ident(has_flash?) - ident(assert) operator(!)instance_variable(@response)operator(.)ident(has_flash_with_contents?) - reserved(end) - - comment(# check if we have flash objects) - reserved(def) method(test_flash_haves) - ident(process) symbol(:flash_me) - ident(assert) instance_variable(@response)operator(.)ident(has_flash?) - ident(assert) instance_variable(@response)operator(.)ident(has_flash_with_contents?) - ident(assert) instance_variable(@response)operator(.)ident(has_flash_object?)operator(()stringoperator(\)) - reserved(end) - - comment(# ensure we don't have flash objects) - reserved(def) method(test_flash_have_nots) - ident(process) symbol(:nothing) - ident(assert) operator(!)instance_variable(@response)operator(.)ident(has_flash?) - ident(assert) operator(!)instance_variable(@response)operator(.)ident(has_flash_with_contents?) - ident(assert_nil) instance_variable(@response)operator(.)ident(flash)operator([)stringoperator(]) - reserved(end) - - comment(# examine that the flash objects are what we expect) - reserved(def) method(test_flash_equals) - ident(process) symbol(:flash_me) - ident(assert_flash_equal) stringoperator(,) string - reserved(end) - - - comment(# check if we were rendered by a file-based template? ) - reserved(def) method(test_rendered_action) - ident(process) symbol(:nothing) - ident(assert) operator(!)instance_variable(@response)operator(.)ident(rendered_with_file?) - - ident(process) symbol(:hello_world) - ident(assert) instance_variable(@response)operator(.)ident(rendered_with_file?) - ident(assert) stringoperator(,) instance_variable(@response)operator(.)ident(rendered_file) - reserved(end) - - comment(# check the redirection location) - reserved(def) method(test_redirection_location) - ident(process) symbol(:redirect_internal) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(redirect_url) - - ident(process) symbol(:redirect_external) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(redirect_url) - - ident(process) symbol(:nothing) - ident(assert_nil) instance_variable(@response)operator(.)ident(redirect_url) - reserved(end) - - - comment(# check server errors ) - reserved(def) method(test_server_error_response_code) - ident(process) symbol(:response500) - ident(assert) instance_variable(@response)operator(.)ident(server_error?) - - ident(process) symbol(:response599) - ident(assert) instance_variable(@response)operator(.)ident(server_error?) - - ident(process) symbol(:response404) - ident(assert) operator(!)instance_variable(@response)operator(.)ident(server_error?) - reserved(end) - - comment(# check a 404 response code) - reserved(def) method(test_missing_response_code) - ident(process) symbol(:response404) - ident(assert) instance_variable(@response)operator(.)ident(missing?) - reserved(end) - - comment(# check to see if our redirection matches a pattern) - reserved(def) method(test_redirect_url_match) - ident(process) symbol(:redirect_external) - ident(assert) instance_variable(@response)operator(.)ident(redirect?) - ident(assert) instance_variable(@response)operator(.)ident(redirect_url_match?)operator(()stringoperator(\)) - ident(assert) instance_variable(@response)operator(.)ident(redirect_url_match?)operator(()regexpoperator(\)) - ident(assert) operator(!)instance_variable(@response)operator(.)ident(redirect_url_match?)operator(()stringoperator(\)) - ident(assert) operator(!)instance_variable(@response)operator(.)ident(redirect_url_match?)operator(()regexpoperator(\)) - reserved(end) - - comment(# check for a redirection) - reserved(def) method(test_redirection) - ident(process) symbol(:redirect_internal) - ident(assert) instance_variable(@response)operator(.)ident(redirect?) - - ident(process) symbol(:redirect_external) - ident(assert) instance_variable(@response)operator(.)ident(redirect?) - - ident(process) symbol(:nothing) - ident(assert) operator(!)instance_variable(@response)operator(.)ident(redirect?) - reserved(end) - - comment(# check a successful response code) - reserved(def) method(test_successful_response_code) - ident(process) symbol(:nothing) - ident(assert) instance_variable(@response)operator(.)ident(success?) - reserved(end) - - comment(# a basic check to make sure we have a TestResponse object) - reserved(def) method(test_has_response) - ident(process) symbol(:nothing) - ident(assert_kind_of) constant(ActionController)operator(::)constant(TestResponse)operator(,) instance_variable(@response) - reserved(end) - - reserved(def) method(test_render_based_on_parameters) - ident(process) symbol(:render_based_on_parameters)operator(,) string operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_assert_template_xpath_match_no_matches) - ident(process) symbol(:hello_xml_world) - ident(assert_raises) constant(Test)operator(::)constant(Unit)operator(::)constant(AssertionFailedError) reserved(do) - ident(assert_template_xpath_match)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_simple_one_element_xpath_match) - ident(process) symbol(:hello_xml_world) - ident(assert_template_xpath_match)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_array_of_elements_in_xpath_match) - ident(process) symbol(:hello_xml_world) - ident(assert_template_xpath_match)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_follow_redirect) - ident(process) symbol(:redirect_to_action) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - - ident(follow_redirect) - ident(assert_equal) integer(1)operator(,) instance_variable(@request)operator(.)ident(parameters)operator([)stringoperator(])operator(.)ident(to_i) - - ident(assert) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_follow_redirect_outside_current_action) - ident(process) symbol(:redirect_to_controller) - ident(assert_redirected_to) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - - ident(assert_raises)operator(()constant(RuntimeError)operator(,) stringoperator(\)) operator({) ident(follow_redirect) operator(}) - reserved(end) - - reserved(def) method(test_redirected_to_url_leadling_slash) - ident(process) symbol(:redirect_to_path) - ident(assert_redirected_to) string - reserved(end) - reserved(def) method(test_redirected_to_url_no_leadling_slash) - ident(process) symbol(:redirect_to_path) - ident(assert_redirected_to) string - reserved(end) - reserved(def) method(test_redirected_to_url_full_url) - ident(process) symbol(:redirect_to_path) - ident(assert_redirected_to) string - reserved(end) - - reserved(def) method(test_redirected_to_with_nested_controller) - instance_variable(@controller) operator(=) constant(Admin)operator(::)constant(InnerModuleController)operator(.)ident(new) - ident(get) symbol(:redirect_to_absolute_controller) - ident(assert_redirected_to) symbol(:controller) operator(=)operator(>) string - - ident(get) symbol(:redirect_to_fellow_controller) - ident(assert_redirected_to) symbol(:controller) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_assert_valid) - ident(get) symbol(:get_valid_record) - ident(assert_valid) ident(assigns)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_assert_valid_failing) - ident(get) symbol(:get_invalid_record) - - reserved(begin) - ident(assert_valid) ident(assigns)operator(()stringoperator(\)) - ident(assert) pre_constant(false) - reserved(rescue) constant(Test)operator(::)constant(Unit)operator(::)constant(AssertionFailedError) operator(=)operator(>) ident(e) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(ActionPackHeaderTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(ActionPackAssertionsController)operator(.)ident(new) - instance_variable(@request)operator(,) instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new)operator(,) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_rendering_xml_sets_content_type) - ident(process) symbol(:hello_xml_world) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@controller)operator(.)ident(headers)operator([)stringoperator(])operator(\)) - reserved(end) - - reserved(def) method(test_rendering_xml_respects_content_type) - instance_variable(@response)operator(.)ident(headers)operator([)stringoperator(]) operator(=) string - ident(process) symbol(:hello_xml_world) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@controller)operator(.)ident(headers)operator([)stringoperator(])operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(Address) - - reserved(def) constant(Address)operator(.)method(count)operator(()ident(conditions) operator(=) pre_constant(nil)operator(,) ident(join) operator(=) pre_constant(nil)operator(\)) - pre_constant(nil) - reserved(end) - - reserved(def) constant(Address)operator(.)method(find_all)operator(()ident(arg1)operator(,) ident(arg2)operator(,) ident(arg3)operator(,) ident(arg4)operator(\)) - operator([)operator(]) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(find)operator(()operator(*)ident(args)operator(\)) - operator([)operator(]) - reserved(end) -reserved(end) - -reserved(class) class(AddressesTestController) operator(<) constant(ActionController)operator(::)constant(Base) - - ident(scaffold) symbol(:address) - - reserved(def) pre_constant(self)operator(.)method(controller_name)operator(;) stringoperator(;) reserved(end) - reserved(def) pre_constant(self)operator(.)method(controller_path)operator(;) stringoperator(;) reserved(end) - -reserved(end) - -constant(AddressesTestController)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(AddressesTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(AddressesTestController)operator(.)ident(new) - - comment(# enable a logger so that (e.g.\) the benchmarking stuff runs, so we can get) - comment(# a more accurate simulation of what happens in "real life".) - instance_variable(@controller)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()pre_constant(nil)operator(\)) - - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - - instance_variable(@request)operator(.)ident(host) operator(=) string - reserved(end) - - reserved(def) method(test_list) - ident(get) symbol(:list) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body)operator(.)ident(chomp) - reserved(end) - - -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string -ident(require) string comment(# require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late) - -comment(# Provide some controller to run the tests on.) -reserved(module) class(Submodule) - reserved(class) class(ContainedEmptyController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(end) - reserved(class) class(ContainedNonEmptyController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(public_action) - reserved(end) - - ident(hide_action) symbol(:hidden_action) - reserved(def) method(hidden_action) - reserved(end) - - reserved(def) method(another_hidden_action) - reserved(end) - ident(hide_action) symbol(:another_hidden_action) - reserved(end) - reserved(class) class(SubclassedController) operator(<) constant(ContainedNonEmptyController) - ident(hide_action) symbol(:public_action) comment(# Hiding it here should not affect the superclass.) - reserved(end) -reserved(end) -reserved(class) class(EmptyController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(include) constant(ActionController)operator(::)constant(Caching) -reserved(end) -reserved(class) class(NonEmptyController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(public_action) - reserved(end) - - ident(hide_action) symbol(:hidden_action) - reserved(def) method(hidden_action) - reserved(end) -reserved(end) - -reserved(class) class(ControllerClassTests) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(test_controller_path) - ident(assert_equal) stringoperator(,) constant(EmptyController)operator(.)ident(controller_path) - ident(assert_equal) stringoperator(,) constant(Submodule)operator(::)constant(ContainedEmptyController)operator(.)ident(controller_path) - reserved(end) - reserved(def) method(test_controller_name) - ident(assert_equal) stringoperator(,) constant(EmptyController)operator(.)ident(controller_name) - ident(assert_equal) stringoperator(,) constant(Submodule)operator(::)constant(ContainedEmptyController)operator(.)ident(controller_name) - reserved(end) -reserved(end) - -reserved(class) class(ControllerInstanceTests) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@empty) operator(=) constant(EmptyController)operator(.)ident(new) - instance_variable(@contained) operator(=) constant(Submodule)operator(::)constant(ContainedEmptyController)operator(.)ident(new) - instance_variable(@empty_controllers) operator(=) operator([)instance_variable(@empty)operator(,) instance_variable(@contained)operator(,) constant(Submodule)operator(::)constant(SubclassedController)operator(.)ident(new)operator(]) - - instance_variable(@non_empty_controllers) operator(=) operator([)constant(NonEmptyController)operator(.)ident(new)operator(,) - constant(Submodule)operator(::)constant(ContainedNonEmptyController)operator(.)ident(new)operator(]) - reserved(end) - - reserved(def) method(test_action_methods) - instance_variable(@empty_controllers)operator(.)ident(each) reserved(do) operator(|)ident(c)operator(|) - ident(assert_equal) constant(Set)operator(.)ident(new)operator(,) ident(c)operator(.)ident(send)operator(()symbol(:action_methods)operator(\))operator(,) stringcontent( should be empty!)delimiter(")> - reserved(end) - instance_variable(@non_empty_controllers)operator(.)ident(each) reserved(do) operator(|)ident(c)operator(|) - ident(assert_equal) constant(Set)operator(.)ident(new)operator(()stringoperator(\))operator(,) ident(c)operator(.)ident(send)operator(()symbol(:action_methods)operator(\))operator(,) stringcontent( should not be empty!)delimiter(")> - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string - -comment(# Provide some static controllers.) -reserved(class) class(BenchmarkedController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(public_action) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) - ident(raise) ident(e) - reserved(end) -reserved(end) - -reserved(class) class(BenchmarkTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(class) class(MockLogger) - reserved(def) method(method_missing)operator(()operator(*)ident(args)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(BenchmarkedController)operator(.)ident(new) - comment(# benchmark doesn't do anything unless a logger is set) - instance_variable(@controller)operator(.)ident(logger) operator(=) constant(MockLogger)operator(.)ident(new) - instance_variable(@request)operator(,) instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new)operator(,) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - instance_variable(@request)operator(.)ident(host) operator(=) string - reserved(end) - - reserved(def) method(test_with_http_1_0_request) - instance_variable(@request)operator(.)ident(host) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(get) symbol(:public_action) operator(}) - reserved(end) -reserved(end) -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(TestLogDevice) operator(<) constant(Logger)operator(::)constant(LogDevice) - ident(attr) symbol(:last_message)operator(,) pre_constant(true) - - reserved(def) method(initialize) - instance_variable(@last_message)operator(=)constant(String)operator(.)ident(new) - reserved(end) - - reserved(def) method(write)operator(()ident(message)operator(\)) - instance_variable(@last_message) operator(<<) ident(message) - reserved(end) - - reserved(def) method(clear) - instance_variable(@last_message) operator(=) constant(String)operator(.)ident(new) - reserved(end) -reserved(end) - -comment(#setup our really sophisticated logger) -constant(TestLog) operator(=) constant(TestLogDevice)operator(.)ident(new) -constant(RAILS_DEFAULT_LOGGER) operator(=) constant(Logger)operator(.)ident(new)operator(()constant(TestLog)operator(\)) -constant(ActionController)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(RAILS_DEFAULT_LOGGER) - -reserved(def) method(use_store) - comment(#generate a random key to ensure the cache is always in a different location) - constant(RANDOM_KEY) operator(=) ident(rand)operator(()integer(99999999)operator(\))operator(.)ident(to_s) - constant(FILE_STORE_PATH) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string operator(+) constant(RANDOM_KEY) - constant(ActionController)operator(::)constant(Base)operator(.)ident(perform_caching) operator(=) pre_constant(true) - constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store) operator(=) symbol(:file_store)operator(,) constant(FILE_STORE_PATH) -reserved(end) - -reserved(class) class(TestController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(caches_action) symbol(:render_to_cache)operator(,) symbol(:index) - - reserved(def) method(render_to_cache) - ident(render_text) string - reserved(end) - reserved(alias) symbol(:index) symbol(:render_to_cache) -reserved(end) - -reserved(class) class(FileStoreTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - instance_variable(@controller) operator(=) constant(TestController)operator(.)ident(new) - instance_variable(@request)operator(.)ident(host) operator(=) string - reserved(end) - - reserved(def) method(teardown) - constant(FileUtils)operator(.)ident(rm_rf)operator(()constant(FILE_STORE_PATH)operator(\)) - reserved(end) - - reserved(def) method(test_render_cached) - ident(assert_fragment_cached) operator({) ident(get) symbol(:render_to_cache) operator(}) - ident(assert_fragment_hit) operator({) ident(get) symbol(:render_to_cache) operator(}) - reserved(end) - - - ident(private) - reserved(def) method(assert_fragment_cached) - reserved(yield) - ident(assert)operator(()constant(TestLog)operator(.)ident(last_message)operator(.)ident(include?)operator(()stringoperator(\))operator(,) stringoperator(\)) - ident(assert)operator(()operator(!)constant(TestLog)operator(.)ident(last_message)operator(.)ident(include?)operator(()stringoperator(\))operator(,) stringoperator(\)) - constant(TestLog)operator(.)ident(clear) - reserved(end) - - reserved(def) method(assert_fragment_hit) - reserved(yield) - ident(assert)operator(()constant(TestLog)operator(.)ident(last_message)operator(.)ident(include?)operator(()stringoperator(\))operator(,) stringoperator(\)) - ident(assert)operator(()operator(!)constant(TestLog)operator(.)ident(last_message)operator(.)ident(include?)operator(()stringoperator(\))operator(,) stringoperator(\)) - constant(TestLog)operator(.)ident(clear) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(CaptureController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) pre_constant(self)operator(.)method(controller_name)operator(;) stringoperator(;) reserved(end) - reserved(def) pre_constant(self)operator(.)method(controller_path)operator(;) stringoperator(;) reserved(end) - - reserved(def) method(content_for) - ident(render) symbol(:layout) operator(=)operator(>) string - reserved(end) - - reserved(def) method(erb_content_for) - ident(render) symbol(:layout) operator(=)operator(>) string - reserved(end) - - reserved(def) method(block_content_for) - ident(render) symbol(:layout) operator(=)operator(>) string - reserved(end) - - reserved(def) method(non_erb_block_content_for) - ident(render) symbol(:layout) operator(=)operator(>) string - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) -reserved(end) - -constant(CaptureController)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(CaptureTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(CaptureController)operator(.)ident(new) - - comment(# enable a logger so that (e.g.\) the benchmarking stuff runs, so we can get) - comment(# a more accurate simulation of what happens in "real life".) - instance_variable(@controller)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()pre_constant(nil)operator(\)) - - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - - instance_variable(@request)operator(.)ident(host) operator(=) string - reserved(end) - - reserved(def) method(test_simple_capture) - ident(get) symbol(:capturing) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body)operator(.)ident(strip) - reserved(end) - - reserved(def) method(test_content_for) - ident(get) symbol(:content_for) - ident(assert_equal) ident(expected_content_for_output)operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_erb_content_for) - ident(get) symbol(:content_for) - ident(assert_equal) ident(expected_content_for_output)operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_block_content_for) - ident(get) symbol(:block_content_for) - ident(assert_equal) ident(expected_content_for_output)operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_non_erb_block_content_for) - ident(get) symbol(:non_erb_block_content_for) - ident(assert_equal) ident(expected_content_for_output)operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_update_element_with_capture) - ident(get) symbol(:update_element_with_capture) - ident(assert_equal)operator(() - string)char(\\n)content(//Product 1

)char(\\\\)content(n

Product 2

)char(\\\\)content(n';)char(\\n)char(\\n)content(//]]>)char(\\n)content()delimiter(")> operator(+) - stringYou bought something!)char(\\\\)content(n';)delimiter(")>operator(,) - instance_variable(@response)operator(.)ident(body)operator(.)ident(strip) - operator(\)) - reserved(end) - - ident(private) - reserved(def) method(expected_content_for_output) - stringPutting stuff in the title!)char(\\n)char(\\n)content(Great stuff!)delimiter(")> - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string -ident(require) string - - -ident(require) string - -reserved(class) class(CGITest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@query_string) operator(=) string - instance_variable(@query_string_with_nil) operator(=) string - instance_variable(@query_string_with_array) operator(=) string - instance_variable(@query_string_with_amps) operator(=) string - instance_variable(@query_string_with_multiple_of_same_name) operator(=) - string - instance_variable(@query_string_with_many_equal) operator(=) string - instance_variable(@query_string_without_equal) operator(=) string - instance_variable(@query_string_with_many_ampersands) operator(=) - string - reserved(end) - - reserved(def) method(test_query_string) - ident(assert_equal)operator(() - operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(,) - constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()instance_variable(@query_string)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_deep_query_string) - ident(assert_equal)operator(()operator({)string operator(=)operator(>) operator({)string operator(=)operator(>) operator({)string operator(=)operator(>) stringoperator(})operator(})operator(})operator(,) constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_deep_query_string_with_array) - ident(assert_equal)operator(()operator({)string operator(=)operator(>) operator({)string operator(=)operator(>) operator({)string operator(=)operator(>) operator([)stringoperator(])operator(})operator(})operator(})operator(,) constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)string operator(=)operator(>) operator({)string operator(=)operator(>) operator({)string operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(})operator(})operator(})operator(,) constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_query_string_with_nil) - ident(assert_equal)operator(() - operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) pre_constant(nil)operator(})operator(,) - constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()instance_variable(@query_string_with_nil)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_query_string_with_array) - ident(assert_equal)operator(() - operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(})operator(,) - constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()instance_variable(@query_string_with_array)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_query_string_with_amps) - ident(assert_equal)operator(() - operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(,) - constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()instance_variable(@query_string_with_amps)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_query_string_with_many_equal) - ident(assert_equal)operator(() - operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(,) - constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()instance_variable(@query_string_with_many_equal)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_query_string_without_equal) - ident(assert_equal)operator(() - operator({) string operator(=)operator(>) pre_constant(nil) operator(})operator(,) - constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()instance_variable(@query_string_without_equal)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_query_string_with_many_ampersands) - ident(assert_equal)operator(() - operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(,) - constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()instance_variable(@query_string_with_many_ampersands)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_parse_params) - ident(input) operator(=) operator({) - string operator(=)operator(>) operator([) string operator(])operator(,) - string operator(=)operator(>) operator([) string operator(])operator(,) - string operator(=)operator(>) operator([) string operator(])operator(,) - string operator(=)operator(>) operator([) string operator(])operator(,) - string operator(=)operator(>) operator([) string operator(])operator(,) - string operator(=)operator(>) operator([) pre_constant(nil) operator(])operator(,) - string operator(=)operator(>) operator([) string operator(])operator(,) - string operator(=)operator(>) operator([) string operator(])operator(,) - string operator(=)operator(>) operator([) string operator(]) - operator(}) - - ident(expected_output) operator(=) operator({) - string operator(=)operator(>) operator({) - string operator(=)operator(>) operator({) - string operator(=)operator(>) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) string - operator(})operator(,) - string operator(=)operator(>) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) string - operator(}) - operator(}) - operator(})operator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) string - operator(}) - operator(}) - - ident(assert_equal) ident(expected_output)operator(,) constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()ident(input)operator(\)) - reserved(end) - - reserved(def) method(test_parse_params_from_multipart_upload) - ident(mockup) operator(=) constant(Struct)operator(.)ident(new)operator(()symbol(:content_type)operator(,) symbol(:original_filename)operator(\)) - ident(file) operator(=) ident(mockup)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) - ident(ie_file) operator(=) ident(mockup)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) - - ident(input) operator(=) operator({) - string operator(=)operator(>) operator([) constant(StringIO)operator(.)ident(new)operator(()stringoperator(\)) operator(])operator(,) - string operator(=)operator(>) operator([)operator([) constant(StringIO)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(StringIO)operator(.)ident(new)operator(()stringoperator(\)) operator(])operator(])operator(,) - string operator(=)operator(>) operator([)operator([) constant(StringIO)operator(.)ident(new)operator(()stringoperator(\))operator(,) string operator(])operator(])operator(,) - string operator(=)operator(>) operator([)operator([) ident(file)operator(,) stringoperator(,) constant(StringIO)operator(.)ident(new)operator(()stringoperator(\))operator(])operator(])operator(,) - string operator(=)operator(>) operator([)operator([) ident(ie_file)operator(,) stringoperator(,) constant(StringIO)operator(.)ident(new)operator(()stringoperator(\))operator(])operator(])operator(,) - string operator(=)operator(>) operator([) constant(StringIO)operator(.)ident(new)operator(()stringoperator(\)) operator(])operator(,) - string operator(=)operator(>) operator([) ident(file) operator(])operator(,) - string operator(=)operator(>) operator([) constant(StringIO)operator(.)ident(new)operator(()stringoperator(\)) operator(])operator(,) - string operator(=)operator(>) operator([) ident(ie_file) operator(]) - operator(}) - - ident(expected_output) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(,) - string operator(=)operator(>) operator([) stringoperator(,) string operator(])operator(,) - string operator(=)operator(>) operator({) - string operator(=)operator(>) operator({) - string operator(=)operator(>) operator([) ident(file)operator(,) stringoperator(,) string operator(]) - operator(})operator(,) - operator(})operator(,) - string operator(=)operator(>) operator({) - string operator(=)operator(>) operator({) - string operator(=)operator(>) operator([) ident(ie_file)operator(,) stringoperator(,) string operator(]) - operator(})operator(,) - operator(})operator(,) - string operator(=)operator(>) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) ident(file) - operator(})operator(,) - string operator(=)operator(>) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) ident(ie_file) - operator(}) - operator(}) - - ident(params) operator(=) constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()ident(input)operator(\)) - ident(assert_equal) ident(expected_output)operator(,) ident(params) - - comment(# Lone filenames are preserved.) - ident(assert_equal) stringoperator(,) ident(params)operator([)stringoperator(])operator([)stringoperator(])operator([)stringoperator(])operator(.)ident(first)operator(.)ident(original_filename) - ident(assert_equal) stringoperator(,) ident(params)operator([)stringoperator(])operator([)stringoperator(])operator(.)ident(original_filename) - - comment(# But full Windows paths are reduced to their basename.) - ident(assert_equal) stringoperator(,) ident(params)operator([)stringoperator(])operator([)stringoperator(])operator([)stringoperator(])operator(.)ident(first)operator(.)ident(original_filename) - ident(assert_equal) stringoperator(,) ident(params)operator([)stringoperator(])operator([)stringoperator(])operator(.)ident(original_filename) - reserved(end) - - reserved(def) method(test_parse_params_with_file) - ident(input) operator(=) operator({) - string operator(=)operator(>) operator([) string operator(])operator(,) - string operator(=)operator(>) operator([) string operator(])operator(,) - string operator(=)operator(>) operator([) constant(File)operator(.)ident(new)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\))operator(.)ident(path) operator(]) - operator(}) - - ident(expected_output) operator(=) operator({) - string operator(=)operator(>) operator({) - string operator(=)operator(>) operator({) - string operator(=)operator(>) operator({) - string operator(=)operator(>) string - operator(}) - operator(}) - operator(})operator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) constant(File)operator(.)ident(new)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\))operator(.)ident(path)operator(,) - operator(}) - - ident(assert_equal) ident(expected_output)operator(,) constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()ident(input)operator(\)) - reserved(end) - - reserved(def) method(test_parse_params_with_array) - ident(input) operator(=) operator({) string operator(=)operator(>) operator([) stringoperator(,) stringoperator(,) string operator(]) operator(}) - - ident(expected_output) operator(=) operator({) string operator(=)operator(>) operator([) stringoperator(,) stringoperator(,) string operator(]) operator(}) - - ident(assert_equal) ident(expected_output)operator(,) constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()ident(input)operator(\)) - reserved(end) - - reserved(def) method(test_parse_params_with_non_alphanumeric_name) - ident(input) operator(=) operator({) string operator(=)operator(>) string operator(}) - ident(expected) operator(=) operator({) string operator(=)operator(>) operator({) string operator(=)operator(>) string operator(})operator(}) - ident(assert_equal) ident(expected)operator(,) constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()ident(input)operator(\)) - reserved(end) - - reserved(def) method(test_parse_params_with_single_brackets_in_middle) - ident(input) operator(=) operator({) string operator(=)operator(>) string operator(}) - ident(expected) operator(=) operator({) string operator(=)operator(>) string operator(}) - ident(assert_equal) ident(expected)operator(,) constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()ident(input)operator(\)) - reserved(end) - - reserved(def) method(test_parse_params_with_separated_brackets) - ident(input) operator(=) operator({) string operator(=)operator(>) string operator(}) - ident(expected) operator(=) operator({) string operator(=)operator(>) operator({) string operator(=)operator(>) string operator(})operator(}) - ident(assert_equal) ident(expected)operator(,) constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()ident(input)operator(\)) - reserved(end) - - reserved(def) method(test_parse_params_with_separated_brackets_and_array) - ident(input) operator(=) operator({) string operator(=)operator(>) string operator(}) - ident(expected) operator(=) operator({) string operator(=)operator(>) operator({) string operator(=)operator(>) operator([)stringoperator(]) operator(})operator(}) - ident(assert_equal) ident(expected) operator(,) constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()ident(input)operator(\)) - reserved(end) - - reserved(def) method(test_parse_params_with_unmatched_brackets_and_array) - ident(input) operator(=) operator({) string operator(=)operator(>) string operator(}) - ident(expected) operator(=) operator({) string operator(=)operator(>) operator({) string operator(=)operator(>) operator({) string operator(=)operator(>) operator([)stringoperator(]) operator(})operator(})operator(}) - ident(assert_equal) ident(expected)operator(,) constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()ident(input)operator(\)) - reserved(end) -reserved(end) - -reserved(class) class(MultipartCGITest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - constant(FIXTURE_PATH) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - - reserved(def) method(setup) - pre_constant(ENV)operator([)stringoperator(]) operator(=) string - pre_constant(ENV)operator([)stringoperator(]) operator(=) string - pre_constant(ENV)operator([)stringoperator(]) operator(=) string - reserved(end) - - reserved(def) method(test_single_parameter) - ident(params) operator(=) ident(process)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({) string operator(=)operator(>) string operator(})operator(,) ident(params)operator(\)) - reserved(end) - - reserved(def) method(test_text_file) - ident(params) operator(=) ident(process)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(params)operator(.)ident(keys)operator(.)ident(sort) - ident(assert_equal) stringoperator(,) ident(params)operator([)stringoperator(]) - - ident(file) operator(=) ident(params)operator([)stringoperator(]) - ident(assert_kind_of) constant(StringIO)operator(,) ident(file) - ident(assert_equal) stringoperator(,) ident(file)operator(.)ident(original_filename) - ident(assert_equal) stringoperator(,) ident(file)operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(file)operator(.)ident(read) - reserved(end) - - reserved(def) method(test_large_text_file) - ident(params) operator(=) ident(process)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(params)operator(.)ident(keys)operator(.)ident(sort) - ident(assert_equal) stringoperator(,) ident(params)operator([)stringoperator(]) - - ident(file) operator(=) ident(params)operator([)stringoperator(]) - ident(assert_kind_of) constant(Tempfile)operator(,) ident(file) - ident(assert_equal) stringoperator(,) ident(file)operator(.)ident(original_filename) - ident(assert_equal) stringoperator(,) ident(file)operator(.)ident(content_type) - ident(assert) operator(()string operator(*) integer(20480)operator(\)) operator(==) ident(file)operator(.)ident(read) - reserved(end) - - reserved(def) method(test_binary_file) - ident(params) operator(=) ident(process)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(params)operator(.)ident(keys)operator(.)ident(sort) - ident(assert_equal) stringoperator(,) ident(params)operator([)stringoperator(]) - - ident(file) operator(=) ident(params)operator([)stringoperator(]) - ident(assert_kind_of) constant(StringIO)operator(,) ident(file) - ident(assert_equal) stringoperator(,) ident(file)operator(.)ident(original_filename) - ident(assert_equal) stringoperator(,) ident(file)operator(.)ident(content_type) - ident(assert_equal) stringoperator(,) ident(file)operator(.)ident(read) - - ident(file) operator(=) ident(params)operator([)stringoperator(]) - ident(assert_kind_of) constant(StringIO)operator(,) ident(file) - ident(assert_equal) stringoperator(,) ident(file)operator(.)ident(original_filename) - ident(assert_equal) stringoperator(,) ident(file)operator(.)ident(content_type) - ident(assert_equal) integer(19512)operator(,) ident(file)operator(.)ident(size) - comment(#assert_equal File.read(File.dirname(__FILE__\) + '/../../../activerecord/test/fixtures/flowers.jpg'\), file.read) - reserved(end) - - reserved(def) method(test_mixed_files) - ident(params) operator(=) ident(process)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(params)operator(.)ident(keys)operator(.)ident(sort) - ident(assert_equal) stringoperator(,) ident(params)operator([)stringoperator(]) - - comment(# Ruby CGI doesn't handle multipart/mixed for us.) - ident(assert_kind_of) constant(StringIO)operator(,) ident(params)operator([)stringoperator(]) - ident(assert_equal) integer(19756)operator(,) ident(params)operator([)stringoperator(])operator(.)ident(size) - reserved(end) - - ident(private) - reserved(def) method(process)operator(()ident(name)operator(\)) - ident(old_stdin) operator(=) global_variable($stdin) - constant(File)operator(.)ident(open)operator(()constant(File)operator(.)ident(join)operator(()constant(FIXTURE_PATH)operator(,) ident(name)operator(\))operator(,) stringoperator(\)) reserved(do) operator(|)ident(file)operator(|) - pre_constant(ENV)operator([)stringoperator(]) operator(=) ident(file)operator(.)ident(stat)operator(.)ident(size)operator(.)ident(to_s) - global_variable($stdin) operator(=) ident(file) - constant(CGIMethods)operator(.)ident(parse_request_parameters) constant(CGI)operator(.)ident(new)operator(.)ident(params) - reserved(end) - reserved(ensure) - global_variable($stdin) operator(=) ident(old_stdin) - reserved(end) -reserved(end) - - -reserved(class) class(CGIRequestTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@request_hash) operator(=) operator({)stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(}) - comment(# cookie as returned by some Nokia phone browsers (no space after semicolon separator\)) - instance_variable(@alt_cookie_fmt_request_hash) operator(=) operator({)stringoperator(=)operator(>)stringoperator(}) - instance_variable(@fake_cgi) operator(=) constant(Struct)operator(.)ident(new)operator(()symbol(:env_table)operator(\))operator(.)ident(new)operator(()instance_variable(@request_hash)operator(\)) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(CgiRequest)operator(.)ident(new)operator(()instance_variable(@fake_cgi)operator(\)) - reserved(end) - - reserved(def) method(test_proxy_request) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(host_with_port) - reserved(end) - - reserved(def) method(test_http_host) - instance_variable(@request_hash)operator(.)ident(delete) string - instance_variable(@request_hash)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(host_with_port) - - instance_variable(@request_hash)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(host) - reserved(end) - - reserved(def) method(test_http_host_with_default_port_overrides_server_port) - instance_variable(@request_hash)operator(.)ident(delete) string - instance_variable(@request_hash)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(host_with_port) - reserved(end) - - reserved(def) method(test_host_with_port_defaults_to_server_name_if_no_host_headers) - instance_variable(@request_hash)operator(.)ident(delete) string - instance_variable(@request_hash)operator(.)ident(delete) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(host_with_port) - reserved(end) - - reserved(def) method(test_host_with_port_falls_back_to_server_addr_if_necessary) - instance_variable(@request_hash)operator(.)ident(delete) string - instance_variable(@request_hash)operator(.)ident(delete) string - instance_variable(@request_hash)operator(.)ident(delete) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(host_with_port) - reserved(end) - - reserved(def) method(test_cookie_syntax_resilience) - ident(cookies) operator(=) constant(CGI)operator(::)constant(Cookie)operator(::)ident(parse)operator(()instance_variable(@request_hash)operator([)stringoperator(])operator(\))operator(;) - ident(assert_equal) operator([)stringoperator(])operator(,) ident(cookies)operator([)stringoperator(]) - ident(assert_equal) operator([)stringoperator(])operator(,) ident(cookies)operator([)stringoperator(]) - - ident(alt_cookies) operator(=) constant(CGI)operator(::)constant(Cookie)operator(::)ident(parse)operator(()instance_variable(@alt_cookie_fmt_request_hash)operator([)stringoperator(])operator(\))operator(;) - ident(assert_equal) operator([)stringoperator(])operator(,) ident(alt_cookies)operator([)stringoperator(]) - ident(assert_equal) operator([)stringoperator(])operator(,) ident(alt_cookies)operator([)stringoperator(]) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(CallerController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(calling_from_controller) - ident(render_component)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(calling_from_controller_with_params) - ident(render_component)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:params) operator(=)operator(>) operator({) string operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(calling_from_controller_with_different_status_code) - ident(render_component)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(calling_from_template) - ident(render_template) string 'callee', :action => 'being_called'\) %>)delimiter(")> - reserved(end) - - reserved(def) method(internal_caller) - ident(render_template) string 'internal_callee'\) %>)delimiter(")> - reserved(end) - - reserved(def) method(internal_callee) - ident(render_text) string - reserved(end) - - reserved(def) method(set_flash) - ident(render_component)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(use_flash) - ident(render_component)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(calling_redirected) - ident(render_component)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(calling_redirected_as_string) - ident(render_template) string 'callee', :action => 'redirected'\) %>)delimiter(")> - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) -reserved(end) - -reserved(class) class(CalleeController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(being_called) - ident(render_text) stringoperator(]) operator(||) stringinline_delimiter(})>content( of the House, speaking)delimiter(")> - reserved(end) - - reserved(def) method(blowing_up) - ident(render_text) stringoperator(,) string - reserved(end) - - reserved(def) method(set_flash) - ident(flash)operator([)symbol(:notice)operator(]) operator(=) string - ident(render) symbol(:text) operator(=)operator(>) string - reserved(end) - - reserved(def) method(use_flash) - ident(render) symbol(:text) operator(=)operator(>) ident(flash)operator([)symbol(:notice)operator(]) operator(||) string - reserved(end) - - reserved(def) method(redirected) - ident(redirect_to) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) -reserved(end) - -reserved(class) class(ComponentsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(CallerController)operator(.)ident(new) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_calling_from_controller) - ident(get) symbol(:calling_from_controller) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_calling_from_controller_with_params) - ident(get) symbol(:calling_from_controller_with_params) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_calling_from_controller_with_different_status_code) - ident(get) symbol(:calling_from_controller_with_different_status_code) - ident(assert_equal) integer(500)operator(,) instance_variable(@response)operator(.)ident(response_code) - reserved(end) - - reserved(def) method(test_calling_from_template) - ident(get) symbol(:calling_from_template) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_internal_calling) - ident(get) symbol(:internal_caller) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_flash) - ident(get) symbol(:set_flash) - ident(assert_equal) stringoperator(,) ident(flash)operator([)symbol(:notice)operator(]) - ident(get) symbol(:use_flash) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - ident(get) symbol(:use_flash) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_component_redirect_redirects) - ident(get) symbol(:calling_redirected) - - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_component_multiple_redirect_redirects) - ident(test_component_redirect_redirects) - ident(test_internal_calling) - reserved(end) - - reserved(def) method(test_component_as_string_redirect_renders_redirecte_action) - ident(get) symbol(:calling_redirected_as_string) - - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(CookieTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(class) class(TestController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(authenticate_with_deprecated_writer) - ident(cookie) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - ident(render_text) string - reserved(end) - - reserved(def) method(authenticate) - ident(cookies)operator([)stringoperator(]) operator(=) string - ident(render_text) string - reserved(end) - - reserved(def) method(authenticate_for_fourten_days) - ident(cookies)operator([)stringoperator(]) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) constant(Time)operator(.)ident(local)operator(()integer(2005)operator(,) integer(10)operator(,) integer(10)operator(\)) operator(}) - ident(render_text) string - reserved(end) - - reserved(def) method(authenticate_for_fourten_days_with_symbols) - ident(cookies)operator([)symbol(:user_name)operator(]) operator(=) operator({) symbol(:value) operator(=)operator(>) stringoperator(,) symbol(:expires) operator(=)operator(>) constant(Time)operator(.)ident(local)operator(()integer(2005)operator(,) integer(10)operator(,) integer(10)operator(\)) operator(}) - ident(render_text) string - reserved(end) - - reserved(def) method(set_multiple_cookies) - ident(cookies)operator([)stringoperator(]) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) constant(Time)operator(.)ident(local)operator(()integer(2005)operator(,) integer(10)operator(,) integer(10)operator(\)) operator(}) - ident(cookies)operator([)stringoperator(]) operator(=) string - ident(render_text) string - reserved(end) - - reserved(def) method(access_frozen_cookies) - instance_variable(@cookies)operator([)stringoperator(]) operator(=) string - ident(render_text) string - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) - reserved(end) - - reserved(def) method(setup) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - - instance_variable(@request)operator(.)ident(host) operator(=) string - reserved(end) - - reserved(def) method(test_setting_cookie_with_deprecated_writer) - instance_variable(@request)operator(.)ident(action) operator(=) string - ident(assert_equal) operator([) constant(CGI)operator(::)constant(Cookie)operator(::)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) operator(])operator(,) ident(process_request)operator(.)ident(headers)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_setting_cookie) - instance_variable(@request)operator(.)ident(action) operator(=) string - ident(assert_equal) operator([) constant(CGI)operator(::)constant(Cookie)operator(::)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) operator(])operator(,) ident(process_request)operator(.)ident(headers)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_setting_cookie_for_fourteen_days) - instance_variable(@request)operator(.)ident(action) operator(=) string - ident(assert_equal) operator([) constant(CGI)operator(::)constant(Cookie)operator(::)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) constant(Time)operator(.)ident(local)operator(()integer(2005)operator(,) integer(10)operator(,) integer(10)operator(\))operator(\)) operator(])operator(,) ident(process_request)operator(.)ident(headers)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_setting_cookie_for_fourteen_days_with_symbols) - instance_variable(@request)operator(.)ident(action) operator(=) string - ident(assert_equal) operator([) constant(CGI)operator(::)constant(Cookie)operator(::)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) constant(Time)operator(.)ident(local)operator(()integer(2005)operator(,) integer(10)operator(,) integer(10)operator(\))operator(\)) operator(])operator(,) ident(process_request)operator(.)ident(headers)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_multiple_cookies) - instance_variable(@request)operator(.)ident(action) operator(=) string - ident(assert_equal) integer(2)operator(,) ident(process_request)operator(.)ident(headers)operator([)stringoperator(])operator(.)ident(size) - reserved(end) - - reserved(def) method(test_setting_test_cookie) - instance_variable(@request)operator(.)ident(action) operator(=) string - ident(assert_nothing_raised) operator({) ident(process_request) operator(}) - reserved(end) - - ident(private) - reserved(def) method(process_request) - constant(TestController)operator(.)ident(process)operator(()instance_variable(@request)operator(,) instance_variable(@response)operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(CustomHandler) - reserved(def) method(initialize)operator(() ident(view) operator(\)) - instance_variable(@view) operator(=) ident(view) - reserved(end) - - reserved(def) method(render)operator(() ident(template)operator(,) ident(local_assigns) operator(\)) - operator([) ident(template)operator(,) - ident(local_assigns)operator(,) - instance_variable(@view) operator(]) - reserved(end) -reserved(end) - -reserved(class) class(CustomHandlerTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - constant(ActionView)operator(::)constant(Base)operator(.)ident(register_template_handler) stringoperator(,) constant(CustomHandler) - constant(ActionView)operator(::)constant(Base)operator(.)ident(register_template_handler) symbol(:foo2)operator(,) constant(CustomHandler) - instance_variable(@view) operator(=) constant(ActionView)operator(::)constant(Base)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_custom_render) - ident(result) operator(=) instance_variable(@view)operator(.)ident(render_template)operator(() stringoperator(,) string)delimiter(")>operator(,) pre_constant(nil)operator(,) symbol(:one) operator(=)operator(>) string operator(\)) - ident(assert_equal)operator(() - operator([) string)delimiter(")>operator(,) operator({) symbol(:one) operator(=)operator(>) string operator(})operator(,) instance_variable(@view) operator(])operator(,) - ident(result) operator(\)) - reserved(end) - - reserved(def) method(test_custom_render2) - ident(result) operator(=) instance_variable(@view)operator(.)ident(render_template)operator(() stringoperator(,) string)delimiter(")>operator(,) pre_constant(nil)operator(,) symbol(:one) operator(=)operator(>) string operator(\)) - ident(assert_equal)operator(() - operator([) string)delimiter(")>operator(,) operator({) symbol(:one) operator(=)operator(>) string operator(})operator(,) instance_variable(@view) operator(])operator(,) - ident(result) operator(\)) - reserved(end) - - reserved(def) method(test_unhandled_extension) - comment(# uses the ERb handler by default if the extension isn't recognized) - ident(result) operator(=) instance_variable(@view)operator(.)ident(render_template)operator(() stringoperator(,) string)delimiter(")>operator(,) pre_constant(nil)operator(,) symbol(:one) operator(=)operator(>) string operator(\)) - ident(assert_equal) stringoperator(,) ident(result) - reserved(end) -reserved(end) -reserved(class) operator(<<) class(Object)operator(;) ident(alias_method) symbol(:const_available?)operator(,) symbol(:const_defined?)operator(;) reserved(end) - -reserved(class) class(ContentController) operator(<) constant(Class)operator(.)ident(new)operator(()constant(ActionController)operator(::)constant(Base)operator(\)) -reserved(end) -reserved(class) class(NotAController) -reserved(end) -reserved(module) class(Admin) - reserved(class) operator(<<) class(self)operator(;) ident(alias_method) symbol(:const_available?)operator(,) symbol(:const_defined?)operator(;) reserved(end) - constant(SomeConstant) operator(=) integer(10) - reserved(class) class(UserController) operator(<) constant(Class)operator(.)ident(new)operator(()constant(ActionController)operator(::)constant(Base)operator(\))operator(;) reserved(end) - reserved(class) class(NewsFeedController) operator(<) constant(Class)operator(.)ident(new)operator(()constant(ActionController)operator(::)constant(Base)operator(\))operator(;) reserved(end) -reserved(end) - -constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(map)operator(.)ident(route_one) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - ident(map)operator(.)ident(connect) string -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(FilterParamController) operator(<) constant(ActionController)operator(::)constant(Base) -reserved(end) - -reserved(class) class(FilterParamTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(FilterParamController)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_filter_parameters) - ident(assert) constant(FilterParamController)operator(.)ident(respond_to?)operator(()symbol(:filter_parameter_logging)operator(\)) - ident(assert) operator(!)instance_variable(@controller)operator(.)ident(respond_to?)operator(()symbol(:filter_parameters)operator(\)) - - constant(FilterParamController)operator(.)ident(filter_parameter_logging) - ident(assert) instance_variable(@controller)operator(.)ident(respond_to?)operator(()symbol(:filter_parameters)operator(\)) - - ident(test_hashes) operator(=) operator([)operator([)operator({)operator(})operator(,)operator({)operator(})operator(,)operator([)operator(])operator(])operator(,) - operator([)operator({)stringoperator(=)operator(>)stringoperator(})operator(,)operator({)stringoperator(=)operator(>)stringoperator(})operator(,)operator([)operator(])operator(])operator(,) - operator([)operator({)stringoperator(=)operator(>)stringoperator(})operator(,)operator({)stringoperator(=)operator(>)stringoperator(})operator(,)stringoperator(])operator(,) - operator([)operator({)stringoperator(=)operator(>)stringoperator(})operator(,)operator({)stringoperator(=)operator(>)stringoperator(})operator(,)stringoperator(])operator(,) - operator([)operator({)stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(})operator(,)operator({)stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(})operator(,)stringoperator(])operator(,) - operator([)operator({)stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(})operator(,)operator({)stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(})operator(,)stringoperator(])operator(,) - operator([)operator({)stringoperator(=)operator(>)operator({)stringoperator(=)operator(>)stringoperator(,)stringoperator(=)operator(>)stringoperator(})operator(})operator(,)operator({)stringoperator(=)operator(>)operator({)stringoperator(=)operator(>)stringoperator(,)stringoperator(=)operator(>)stringoperator(})operator(})operator(,)stringoperator(])operator(,) - operator([)operator({)stringoperator(=)operator(>)operator({)stringoperator(=)operator(>)stringoperator(,)stringoperator(=)operator(>)stringoperator(})operator(})operator(,)operator({)stringoperator(=)operator(>)stringoperator(})operator(,)stringoperator(])operator(]) - - ident(test_hashes)operator(.)ident(each) reserved(do) operator(|)ident(before_filter)operator(,) ident(after_filter)operator(,) ident(filter_words)operator(|) - constant(FilterParamController)operator(.)ident(filter_parameter_logging)operator(()operator(*)ident(filter_words)operator(\)) - ident(assert_equal) ident(after_filter)operator(,) instance_variable(@controller)operator(.)ident(filter_parameters)operator(()ident(before_filter)operator(\)) - - ident(filter_words)operator(.)ident(push)operator(()stringoperator(\)) - constant(FilterParamController)operator(.)ident(filter_parameter_logging)operator(()operator(*)ident(filter_words)operator(\)) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - ident(value)operator(.)ident(reverse!) reserved(if) ident(key) operator(=)operator(~) regexp - reserved(end) - - ident(before_filter)operator([)stringoperator(]) operator(=) operator({)stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)operator({)stringoperator(=)operator(>)operator({)stringoperator(=)operator(>)stringoperator(})operator(})operator(}) - ident(after_filter)operator([)stringoperator(]) operator(=) operator({)stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)stringoperator(,) stringoperator(=)operator(>)operator({)stringoperator(=)operator(>)operator({)stringoperator(=)operator(>)stringoperator(})operator(})operator(}) - - ident(assert_equal) ident(after_filter)operator(,) instance_variable(@controller)operator(.)ident(filter_parameters)operator(()ident(before_filter)operator(\)) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(FilterTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(class) class(TestController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(before_filter) symbol(:ensure_login) - ident(after_filter) symbol(:clean_up) - - reserved(def) method(show) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - ident(private) - reserved(def) method(ensure_login) - instance_variable(@ran_filter) operator(||=) operator([)operator(]) - instance_variable(@ran_filter) operator(<<) string - reserved(end) - - reserved(def) method(clean_up) - instance_variable(@ran_after_filter) operator(||=) operator([)operator(]) - instance_variable(@ran_after_filter) operator(<<) string - reserved(end) - reserved(end) - - reserved(class) class(RenderingController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(before_filter) symbol(:render_something_else) - - reserved(def) method(show) - instance_variable(@ran_action) operator(=) pre_constant(true) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - ident(private) - reserved(def) method(render_something_else) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - reserved(end) - - reserved(class) class(ConditionalFilterController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(show) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - reserved(def) method(another_action) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - reserved(def) method(show_without_filter) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - ident(private) - reserved(def) method(ensure_login) - instance_variable(@ran_filter) operator(||=) operator([)operator(]) - instance_variable(@ran_filter) operator(<<) string - reserved(end) - - reserved(def) method(clean_up_tmp) - instance_variable(@ran_filter) operator(||=) operator([)operator(]) - instance_variable(@ran_filter) operator(<<) string - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise)operator(()ident(e)operator(\)) reserved(end) - reserved(end) - - reserved(class) class(ConditionalCollectionFilterController) operator(<) constant(ConditionalFilterController) - ident(before_filter) symbol(:ensure_login)operator(,) symbol(:except) operator(=)operator(>) operator([) symbol(:show_without_filter)operator(,) symbol(:another_action) operator(]) - reserved(end) - - reserved(class) class(OnlyConditionSymController) operator(<) constant(ConditionalFilterController) - ident(before_filter) symbol(:ensure_login)operator(,) symbol(:only) operator(=)operator(>) symbol(:show) - reserved(end) - - reserved(class) class(ExceptConditionSymController) operator(<) constant(ConditionalFilterController) - ident(before_filter) symbol(:ensure_login)operator(,) symbol(:except) operator(=)operator(>) symbol(:show_without_filter) - reserved(end) - - reserved(class) class(BeforeAndAfterConditionController) operator(<) constant(ConditionalFilterController) - ident(before_filter) symbol(:ensure_login)operator(,) symbol(:only) operator(=)operator(>) symbol(:show) - ident(after_filter) symbol(:clean_up_tmp)operator(,) symbol(:only) operator(=)operator(>) symbol(:show) - reserved(end) - - reserved(class) class(OnlyConditionProcController) operator(<) constant(ConditionalFilterController) - ident(before_filter)operator(()symbol(:only) operator(=)operator(>) symbol(:show)operator(\)) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(assigns)operator([)stringoperator(]) operator(=) pre_constant(true) operator(}) - reserved(end) - - reserved(class) class(ExceptConditionProcController) operator(<) constant(ConditionalFilterController) - ident(before_filter)operator(()symbol(:except) operator(=)operator(>) symbol(:show_without_filter)operator(\)) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(assigns)operator([)stringoperator(]) operator(=) pre_constant(true) operator(}) - reserved(end) - - reserved(class) class(ConditionalClassFilter) - reserved(def) pre_constant(self)operator(.)method(filter)operator(()ident(controller)operator(\)) ident(controller)operator(.)ident(assigns)operator([)stringoperator(]) operator(=) pre_constant(true) reserved(end) - reserved(end) - - reserved(class) class(OnlyConditionClassController) operator(<) constant(ConditionalFilterController) - ident(before_filter) constant(ConditionalClassFilter)operator(,) symbol(:only) operator(=)operator(>) symbol(:show) - reserved(end) - - reserved(class) class(ExceptConditionClassController) operator(<) constant(ConditionalFilterController) - ident(before_filter) constant(ConditionalClassFilter)operator(,) symbol(:except) operator(=)operator(>) symbol(:show_without_filter) - reserved(end) - - reserved(class) class(AnomolousYetValidConditionController) operator(<) constant(ConditionalFilterController) - ident(before_filter)operator(()constant(ConditionalClassFilter)operator(,) symbol(:ensure_login)operator(,) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(assigns)operator([)stringoperator(]) operator(=) pre_constant(true) operator(})operator(,) symbol(:except) operator(=)operator(>) symbol(:show_without_filter)operator(\)) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(assigns)operator([)stringoperator(]) operator(=) pre_constant(true)operator(}) - reserved(end) - - reserved(class) class(PrependingController) operator(<) constant(TestController) - ident(prepend_before_filter) symbol(:wonderful_life) - comment(# skip_before_filter :fire_flash) - - ident(private) - reserved(def) method(wonderful_life) - instance_variable(@ran_filter) operator(||=) operator([)operator(]) - instance_variable(@ran_filter) operator(<<) string - reserved(end) - reserved(end) - - reserved(class) class(ConditionalSkippingController) operator(<) constant(TestController) - ident(skip_before_filter) symbol(:ensure_login)operator(,) symbol(:only) operator(=)operator(>) operator([) symbol(:login) operator(]) - ident(skip_after_filter) symbol(:clean_up)operator(,) symbol(:only) operator(=)operator(>) operator([) symbol(:login) operator(]) - - ident(before_filter) symbol(:find_user)operator(,) symbol(:only) operator(=)operator(>) operator([) symbol(:change_password) operator(]) - - reserved(def) method(login) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - reserved(def) method(change_password) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - ident(protected) - reserved(def) method(find_user) - instance_variable(@ran_filter) operator(||=) operator([)operator(]) - instance_variable(@ran_filter) operator(<<) string - reserved(end) - reserved(end) - - reserved(class) class(ConditionalParentOfConditionalSkippingController) operator(<) constant(ConditionalFilterController) - ident(before_filter) symbol(:conditional_in_parent)operator(,) symbol(:only) operator(=)operator(>) operator([)symbol(:show)operator(,) symbol(:another_action)operator(]) - ident(after_filter) symbol(:conditional_in_parent)operator(,) symbol(:only) operator(=)operator(>) operator([)symbol(:show)operator(,) symbol(:another_action)operator(]) - - ident(private) - - reserved(def) method(conditional_in_parent) - instance_variable(@ran_filter) operator(||=) operator([)operator(]) - instance_variable(@ran_filter) operator(<<) string - reserved(end) - reserved(end) - - reserved(class) class(ChildOfConditionalParentController) operator(<) constant(ConditionalParentOfConditionalSkippingController) - ident(skip_before_filter) symbol(:conditional_in_parent)operator(,) symbol(:only) operator(=)operator(>) symbol(:another_action) - ident(skip_after_filter) symbol(:conditional_in_parent)operator(,) symbol(:only) operator(=)operator(>) symbol(:another_action) - reserved(end) - - reserved(class) class(ProcController) operator(<) constant(PrependingController) - ident(before_filter)operator(()ident(proc) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(assigns)operator([)stringoperator(]) operator(=) pre_constant(true) operator(})operator(\)) - reserved(end) - - reserved(class) class(ImplicitProcController) operator(<) constant(PrependingController) - ident(before_filter) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(assigns)operator([)stringoperator(]) operator(=) pre_constant(true) operator(}) - reserved(end) - - reserved(class) class(AuditFilter) - reserved(def) pre_constant(self)operator(.)method(filter)operator(()ident(controller)operator(\)) - ident(controller)operator(.)ident(assigns)operator([)stringoperator(]) operator(=) pre_constant(true) - reserved(end) - reserved(end) - - reserved(class) class(AroundFilter) - reserved(def) method(before)operator(()ident(controller)operator(\)) - instance_variable(@execution_log) operator(=) string - ident(controller)operator(.)ident(class)operator(.)ident(execution_log) operator(<<) string reserved(if) ident(controller)operator(.)ident(respond_to?) symbol(:execution_log) - ident(controller)operator(.)ident(assigns)operator([)stringoperator(]) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(after)operator(()ident(controller)operator(\)) - ident(controller)operator(.)ident(assigns)operator([)stringoperator(]) operator(=) instance_variable(@execution_log) operator(+) string - ident(controller)operator(.)ident(assigns)operator([)stringoperator(]) operator(=) pre_constant(true) - ident(controller)operator(.)ident(class)operator(.)ident(execution_log) operator(<<) string reserved(if) ident(controller)operator(.)ident(respond_to?) symbol(:execution_log) - reserved(end) - reserved(end) - - reserved(class) class(AppendedAroundFilter) - reserved(def) method(before)operator(()ident(controller)operator(\)) - ident(controller)operator(.)ident(class)operator(.)ident(execution_log) operator(<<) string - reserved(end) - - reserved(def) method(after)operator(()ident(controller)operator(\)) - ident(controller)operator(.)ident(class)operator(.)ident(execution_log) operator(<<) string - reserved(end) - reserved(end) - - reserved(class) class(AuditController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(before_filter)operator(()constant(AuditFilter)operator(\)) - - reserved(def) method(show) - ident(render_text) string - reserved(end) - reserved(end) - - reserved(class) class(BadFilterController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(before_filter) integer(2) - - reserved(def) method(show)operator(()operator(\)) string reserved(end) - - ident(protected) - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise)operator(()ident(e)operator(\)) reserved(end) - reserved(end) - - reserved(class) class(AroundFilterController) operator(<) constant(PrependingController) - ident(around_filter) constant(AroundFilter)operator(.)ident(new) - reserved(end) - - reserved(class) class(MixedFilterController) operator(<) constant(PrependingController) - ident(cattr_accessor) symbol(:execution_log) - - reserved(def) method(initialize) - class_variable(@@execution_log) operator(=) string - reserved(end) - - ident(before_filter) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(class)operator(.)ident(execution_log) operator(<<) string operator(}) - ident(prepend_around_filter) constant(AroundFilter)operator(.)ident(new) - - ident(after_filter) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(class)operator(.)ident(execution_log) operator(<<) string operator(}) - ident(append_around_filter) constant(AppendedAroundFilter)operator(.)ident(new) - reserved(end) - - reserved(class) class(MixedSpecializationController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(class) class(OutOfOrder) operator(<) constant(StandardError)operator(;) reserved(end) - - ident(before_filter) symbol(:first) - ident(before_filter) symbol(:second)operator(,) symbol(:only) operator(=)operator(>) symbol(:foo) - - reserved(def) method(foo) - ident(render_text) string - reserved(end) - - reserved(def) method(bar) - ident(render_text) string - reserved(end) - - ident(protected) - reserved(def) method(first) - instance_variable(@first) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(second) - ident(raise) constant(OutOfOrder) reserved(unless) instance_variable(@first) - reserved(end) - reserved(end) - - reserved(class) class(DynamicDispatchController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(before_filter) symbol(:choose) - - stringoperator(.)ident(each) reserved(do) operator(|)ident(action)operator(|) - ident(define_method)operator(()ident(action)operator(\)) operator({) ident(render) symbol(:text) operator(=)operator(>) ident(action) operator(}) - reserved(end) - - ident(private) - reserved(def) method(choose) - pre_constant(self)operator(.)ident(action_name) operator(=) ident(params)operator([)symbol(:choose)operator(]) - reserved(end) - reserved(end) - - reserved(def) method(test_added_filter_to_inheritance_graph) - ident(assert_equal) operator([) symbol(:ensure_login) operator(])operator(,) constant(TestController)operator(.)ident(before_filters) - reserved(end) - - reserved(def) method(test_base_class_in_isolation) - ident(assert_equal) operator([) operator(])operator(,) constant(ActionController)operator(::)constant(Base)operator(.)ident(before_filters) - reserved(end) - - reserved(def) method(test_prepending_filter) - ident(assert_equal) operator([) symbol(:wonderful_life)operator(,) symbol(:ensure_login) operator(])operator(,) constant(PrependingController)operator(.)ident(before_filters) - reserved(end) - - reserved(def) method(test_running_filters) - ident(assert_equal) stringoperator(,) ident(test_process)operator(()constant(PrependingController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_running_filters_with_proc) - ident(assert) ident(test_process)operator(()constant(ProcController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_running_filters_with_implicit_proc) - ident(assert) ident(test_process)operator(()constant(ImplicitProcController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_running_filters_with_class) - ident(assert) ident(test_process)operator(()constant(AuditController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_running_anomolous_yet_valid_condition_filters) - ident(response) operator(=) ident(test_process)operator(()constant(AnomolousYetValidConditionController)operator(\)) - ident(assert_equal) stringoperator(,) ident(response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert) ident(response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert) ident(response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert) ident(response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - - ident(response) operator(=) ident(test_process)operator(()constant(AnomolousYetValidConditionController)operator(,) stringoperator(\)) - ident(assert_equal) pre_constant(nil)operator(,) ident(response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert) operator(!)ident(response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert) operator(!)ident(response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert) operator(!)ident(response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_running_collection_condition_filters) - ident(assert_equal) stringoperator(,) ident(test_process)operator(()constant(ConditionalCollectionFilterController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert_equal) pre_constant(nil)operator(,) ident(test_process)operator(()constant(ConditionalCollectionFilterController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert_equal) pre_constant(nil)operator(,) ident(test_process)operator(()constant(ConditionalCollectionFilterController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_running_only_condition_filters) - ident(assert_equal) stringoperator(,) ident(test_process)operator(()constant(OnlyConditionSymController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert_equal) pre_constant(nil)operator(,) ident(test_process)operator(()constant(OnlyConditionSymController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - - ident(assert) ident(test_process)operator(()constant(OnlyConditionProcController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert) operator(!)ident(test_process)operator(()constant(OnlyConditionProcController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - - ident(assert) ident(test_process)operator(()constant(OnlyConditionClassController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert) operator(!)ident(test_process)operator(()constant(OnlyConditionClassController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_running_except_condition_filters) - ident(assert_equal) stringoperator(,) ident(test_process)operator(()constant(ExceptConditionSymController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert_equal) pre_constant(nil)operator(,) ident(test_process)operator(()constant(ExceptConditionSymController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - - ident(assert) ident(test_process)operator(()constant(ExceptConditionProcController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert) operator(!)ident(test_process)operator(()constant(ExceptConditionProcController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - - ident(assert) ident(test_process)operator(()constant(ExceptConditionClassController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert) operator(!)ident(test_process)operator(()constant(ExceptConditionClassController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_running_before_and_after_condition_filters) - ident(assert_equal) stringoperator(,) ident(test_process)operator(()constant(BeforeAndAfterConditionController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert_equal) pre_constant(nil)operator(,) ident(test_process)operator(()constant(BeforeAndAfterConditionController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_bad_filter) - ident(assert_raises)operator(()constant(ActionController)operator(::)constant(ActionControllerError)operator(\)) operator({) - ident(test_process)operator(()constant(BadFilterController)operator(\)) - operator(}) - reserved(end) - - reserved(def) method(test_around_filter) - ident(controller) operator(=) ident(test_process)operator(()constant(AroundFilterController)operator(\)) - ident(assert) ident(controller)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert) ident(controller)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_having_properties_in_around_filter) - ident(controller) operator(=) ident(test_process)operator(()constant(AroundFilterController)operator(\)) - ident(assert_equal) stringoperator(,) ident(controller)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_prepending_and_appending_around_filter) - ident(controller) operator(=) ident(test_process)operator(()constant(MixedFilterController)operator(\)) - ident(assert_equal) string operator(+) - stringoperator(,) - constant(MixedFilterController)operator(.)ident(execution_log) - reserved(end) - - reserved(def) method(test_rendering_breaks_filtering_chain) - ident(response) operator(=) ident(test_process)operator(()constant(RenderingController)operator(\)) - ident(assert_equal) stringoperator(,) ident(response)operator(.)ident(body) - ident(assert) operator(!)ident(response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_filters_with_mixed_specialization_run_in_order) - ident(assert_nothing_raised) reserved(do) - ident(response) operator(=) ident(test_process)operator(()constant(MixedSpecializationController)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(response)operator(.)ident(body) - reserved(end) - - ident(assert_nothing_raised) reserved(do) - ident(response) operator(=) ident(test_process)operator(()constant(MixedSpecializationController)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(response)operator(.)ident(body) - reserved(end) - reserved(end) - - reserved(def) method(test_dynamic_dispatch) - stringoperator(.)ident(each) reserved(do) operator(|)ident(action)operator(|) - ident(request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - ident(request)operator(.)ident(query_parameters)operator([)symbol(:choose)operator(]) operator(=) ident(action) - ident(response) operator(=) constant(DynamicDispatchController)operator(.)ident(process)operator(()ident(request)operator(,) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new)operator(\)) - ident(assert_equal) ident(action)operator(,) ident(response)operator(.)ident(body) - reserved(end) - reserved(end) - - reserved(def) method(test_conditional_skipping_of_filters) - ident(assert_nil) ident(test_process)operator(()constant(ConditionalSkippingController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) ident(test_process)operator(()constant(ConditionalSkippingController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - - ident(assert_nil) ident(test_process)operator(()constant(ConditionalSkippingController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(controller)operator(.)ident(instance_variable_get)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(test_process)operator(()constant(ConditionalSkippingController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(controller)operator(.)ident(instance_variable_get)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_conditional_skipping_of_filters_when_parent_filter_is_also_conditional) - ident(assert_equal) stringoperator(,) ident(test_process)operator(()constant(ChildOfConditionalParentController)operator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - ident(assert_nil) ident(test_process)operator(()constant(ChildOfConditionalParentController)operator(,) stringoperator(\))operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) - - ident(private) - reserved(def) method(test_process)operator(()ident(controller)operator(,) ident(action) operator(=) stringoperator(\)) - ident(request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - ident(request)operator(.)ident(action) operator(=) ident(action) - ident(controller)operator(.)ident(process)operator(()ident(request)operator(,) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new)operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(FlashTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(class) class(TestController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(set_flash) - ident(flash)operator([)stringoperator(]) operator(=) string - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - reserved(def) method(set_flash_now) - ident(flash)operator(.)ident(now)operator([)stringoperator(]) operator(=) string - ident(flash)operator(.)ident(now)operator([)stringoperator(]) operator(||=) string - ident(flash)operator(.)ident(now)operator([)stringoperator(]) operator(||=) string - instance_variable(@flashy) operator(=) ident(flash)operator(.)ident(now)operator([)stringoperator(]) - instance_variable(@flash_copy) operator(=) operator({)operator(})operator(.)ident(update) ident(flash) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - reserved(def) method(attempt_to_use_flash_now) - instance_variable(@flash_copy) operator(=) operator({)operator(})operator(.)ident(update) ident(flash) - instance_variable(@flashy) operator(=) ident(flash)operator([)stringoperator(]) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - reserved(def) method(use_flash) - instance_variable(@flash_copy) operator(=) operator({)operator(})operator(.)ident(update) ident(flash) - instance_variable(@flashy) operator(=) ident(flash)operator([)stringoperator(]) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - reserved(def) method(use_flash_and_keep_it) - instance_variable(@flash_copy) operator(=) operator({)operator(})operator(.)ident(update) ident(flash) - instance_variable(@flashy) operator(=) ident(flash)operator([)stringoperator(]) - ident(silence_warnings) operator({) ident(keep_flash) operator(}) - ident(render) symbol(:inline) operator(=)operator(>) string - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) - ident(raise) reserved(unless) constant(ActionController)operator(::)constant(MissingTemplate) operator(===) ident(e) - reserved(end) - reserved(end) - - reserved(def) method(setup) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - instance_variable(@controller) operator(=) constant(TestController)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_flash) - ident(get) symbol(:set_flash) - - ident(get) symbol(:use_flash) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(])operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - - ident(get) symbol(:use_flash) - ident(assert_nil) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(])operator([)stringoperator(])operator(,) string - reserved(end) - - reserved(def) method(test_keep_flash) - ident(get) symbol(:set_flash) - - ident(get) symbol(:use_flash_and_keep_it) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(])operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - - ident(get) symbol(:use_flash) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(])operator([)stringoperator(])operator(,) string - - ident(get) symbol(:use_flash) - ident(assert_nil) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(])operator([)stringoperator(])operator(,) string - reserved(end) - - reserved(def) method(test_flash_now) - ident(get) symbol(:set_flash_now) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(])operator([)stringoperator(]) - ident(assert_equal) string operator(,) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(])operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - - ident(get) symbol(:attempt_to_use_flash_now) - ident(assert_nil) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(])operator([)stringoperator(]) - ident(assert_nil) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(])operator([)stringoperator(]) - ident(assert_nil) instance_variable(@response)operator(.)ident(template)operator(.)ident(assigns)operator([)stringoperator(]) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -constant(MemCache) operator(=) constant(Struct)operator(.)ident(new)operator(()symbol(:MemCache)operator(,) symbol(:address)operator(\)) reserved(unless) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:MemCache)operator(\)) - -reserved(class) class(FragmentCacheStoreSettingTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(teardown) - constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store) operator(=) constant(ActionController)operator(::)constant(Caching)operator(::)constant(Fragments)operator(::)constant(MemoryStore)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_file_fragment_cache_store) - constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store) operator(=) symbol(:file_store)operator(,) string - ident(assert_kind_of)operator(() - constant(ActionController)operator(::)constant(Caching)operator(::)constant(Fragments)operator(::)constant(FileStore)operator(,) - constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store) - operator(\)) - ident(assert_equal) stringoperator(,) constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store)operator(.)ident(cache_path) - reserved(end) - - reserved(def) method(test_drb_fragment_cache_store) - constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store) operator(=) symbol(:drb_store)operator(,) string - ident(assert_kind_of)operator(() - constant(ActionController)operator(::)constant(Caching)operator(::)constant(Fragments)operator(::)constant(DRbStore)operator(,) - constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store) - operator(\)) - ident(assert_equal) stringoperator(,) constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store)operator(.)ident(address) - reserved(end) - - reserved(def) method(test_mem_cache_fragment_cache_store) - constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store) operator(=) symbol(:mem_cache_store)operator(,) string - ident(assert_kind_of)operator(() - constant(ActionController)operator(::)constant(Caching)operator(::)constant(Fragments)operator(::)constant(MemCacheStore)operator(,) - constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store) - operator(\)) - ident(assert_equal) stringoperator(,) constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store)operator(.)ident(addresses) - reserved(end) - - reserved(def) method(test_object_assigned_fragment_cache_store) - constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store) operator(=) constant(ActionController)operator(::)constant(Caching)operator(::)constant(Fragments)operator(::)constant(FileStore)operator(.)ident(new)operator(()stringoperator(\)) - ident(assert_kind_of)operator(() - constant(ActionController)operator(::)constant(Caching)operator(::)constant(Fragments)operator(::)constant(FileStore)operator(,) - constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store) - operator(\)) - ident(assert_equal) stringoperator(,) constant(ActionController)operator(::)constant(Base)operator(.)ident(fragment_cache_store)operator(.)ident(cache_path) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(TestController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(attr_accessor) symbol(:delegate_attr) - reserved(def) method(delegate_method)operator(()operator(\)) reserved(end) - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) -reserved(end) - -reserved(module) class(Fun) - reserved(class) class(GamesController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(render_hello_world) - ident(render) symbol(:inline) operator(=)operator(>) string)delimiter(")> - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) - reserved(end) - - reserved(class) class(PDFController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(test) - ident(render) symbol(:inline) operator(=)operator(>) string)delimiter(")> - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) - reserved(end) -reserved(end) - -reserved(module) class(LocalAbcHelper) - reserved(def) method(a)operator(()operator(\)) reserved(end) - reserved(def) method(b)operator(()operator(\)) reserved(end) - reserved(def) method(c)operator(()operator(\)) reserved(end) -reserved(end) - -reserved(class) class(HelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - comment(# Increment symbol counter.) - instance_variable(@symbol) operator(=) operator(()class_variable(@@counter) operator(||=) stringoperator(\))operator(.)ident(succ!)operator(.)ident(dup) - - comment(# Generate new controller class.) - ident(controller_class_name) operator(=) stringcontent(Controller)delimiter(")> - ident(eval)operator(()stringcontent( < TestController; end)delimiter(")>operator(\)) - instance_variable(@controller_class) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(const_get)operator(()ident(controller_class_name)operator(\)) - - comment(# Generate new template class and assign to controller.) - ident(template_class_name) operator(=) stringcontent(View)delimiter(")> - ident(eval)operator(()stringcontent( < ActionView::Base; end)delimiter(")>operator(\)) - instance_variable(@template_class) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(const_get)operator(()ident(template_class_name)operator(\)) - instance_variable(@controller_class)operator(.)ident(template_class) operator(=) instance_variable(@template_class) - - comment(# Set default test helper.) - pre_constant(self)operator(.)ident(test_helper) operator(=) constant(LocalAbcHelper) - reserved(end) - - reserved(def) method(teardown) - comment(# Reset template class.) - comment(#ActionController::Base.template_class = ActionView::Base) - reserved(end) - - - reserved(def) method(test_deprecated_helper) - ident(assert_equal) ident(expected_helper_methods)operator(,) ident(missing_methods) - ident(assert_nothing_raised) operator({) instance_variable(@controller_class)operator(.)ident(helper) constant(TestHelper) operator(}) - ident(assert_equal) operator([)operator(])operator(,) ident(missing_methods) - reserved(end) - - reserved(def) method(test_declare_helper) - ident(require) string - pre_constant(self)operator(.)ident(test_helper) operator(=) constant(AbcHelper) - ident(assert_equal) ident(expected_helper_methods)operator(,) ident(missing_methods) - ident(assert_nothing_raised) operator({) instance_variable(@controller_class)operator(.)ident(helper) symbol(:abc) operator(}) - ident(assert_equal) operator([)operator(])operator(,) ident(missing_methods) - reserved(end) - - reserved(def) method(test_declare_missing_helper) - ident(assert_equal) ident(expected_helper_methods)operator(,) ident(missing_methods) - ident(assert_raise)operator(()constant(MissingSourceFile)operator(\)) operator({) instance_variable(@controller_class)operator(.)ident(helper) symbol(:missing) operator(}) - reserved(end) - - reserved(def) method(test_declare_missing_file_from_helper) - ident(require) string - reserved(rescue) constant(LoadError) operator(=)operator(>) ident(e) - ident(assert_nil) regexpoperator(.)ident(match)operator(()ident(e)operator(.)ident(to_s)operator(\))operator([)integer(1)operator(]) - reserved(end) - - reserved(def) method(test_helper_block) - ident(assert_nothing_raised) operator({) - instance_variable(@controller_class)operator(.)ident(helper) operator({) reserved(def) method(block_helper_method)operator(;) reserved(end) operator(}) - operator(}) - ident(assert) ident(master_helper_methods)operator(.)ident(include?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_helper_block_include) - ident(assert_equal) ident(expected_helper_methods)operator(,) ident(missing_methods) - ident(assert_nothing_raised) operator({) - instance_variable(@controller_class)operator(.)ident(helper) operator({) ident(include) constant(TestHelper) operator(}) - operator(}) - ident(assert) operator([)operator(])operator(,) ident(missing_methods) - reserved(end) - - reserved(def) method(test_helper_method) - ident(assert_nothing_raised) operator({) instance_variable(@controller_class)operator(.)ident(helper_method) symbol(:delegate_method) operator(}) - ident(assert) ident(master_helper_methods)operator(.)ident(include?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_helper_attr) - ident(assert_nothing_raised) operator({) instance_variable(@controller_class)operator(.)ident(helper_attr) symbol(:delegate_attr) operator(}) - ident(assert) ident(master_helper_methods)operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(master_helper_methods)operator(.)ident(include?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_helper_for_nested_controller) - ident(request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - ident(response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - ident(request)operator(.)ident(action) operator(=) string - - ident(assert_equal) stringoperator(,) constant(Fun)operator(::)constant(GamesController)operator(.)ident(process)operator(()ident(request)operator(,) ident(response)operator(\))operator(.)ident(body) - reserved(end) - - reserved(def) method(test_helper_for_acronym_controller) - ident(request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - ident(response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - ident(request)operator(.)ident(action) operator(=) string - - ident(assert_equal) stringoperator(,) constant(Fun)operator(::)constant(PDFController)operator(.)ident(process)operator(()ident(request)operator(,) ident(response)operator(\))operator(.)ident(body) - reserved(end) - - ident(private) - reserved(def) method(expected_helper_methods) - constant(TestHelper)operator(.)ident(instance_methods) - reserved(end) - - reserved(def) method(master_helper_methods) - instance_variable(@controller_class)operator(.)ident(master_helper_module)operator(.)ident(instance_methods) - reserved(end) - - reserved(def) method(missing_methods) - ident(expected_helper_methods) operator(-) ident(master_helper_methods) - reserved(end) - - reserved(def) method(test_helper=)operator(()ident(helper_module)operator(\)) - ident(silence_warnings) operator({) pre_constant(self)operator(.)ident(class)operator(.)ident(const_set)operator(()stringoperator(,) ident(helper_module)operator(\)) operator(}) - reserved(end) -reserved(end) - - -reserved(class) class(IsolatedHelpersTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(class) class(A) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(index) - ident(render) symbol(:inline) operator(=)operator(>) string)delimiter(')> - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) - reserved(end) - - reserved(class) class(B) operator(<) constant(A) - ident(helper) operator({) reserved(def) method(shout)operator(;) string reserved(end) operator(}) - - reserved(def) method(index) - ident(render) symbol(:inline) operator(=)operator(>) string)delimiter(')> - reserved(end) - reserved(end) - - reserved(class) class(C) operator(<) constant(A) - ident(helper) operator({) reserved(def) method(shout)operator(;) string reserved(end) operator(}) - - reserved(def) method(index) - ident(render) symbol(:inline) operator(=)operator(>) string)delimiter(')> - reserved(end) - reserved(end) - - reserved(def) method(setup) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - instance_variable(@request)operator(.)ident(action) operator(=) string - reserved(end) - - reserved(def) method(test_helper_in_a) - ident(assert_raise)operator(()constant(NameError)operator(\)) operator({) constant(A)operator(.)ident(process)operator(()instance_variable(@request)operator(,) instance_variable(@response)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_helper_in_b) - ident(assert_equal) stringoperator(,) constant(B)operator(.)ident(process)operator(()instance_variable(@request)operator(,) instance_variable(@response)operator(\))operator(.)ident(body) - reserved(end) - - reserved(def) method(test_helper_in_c) - ident(assert_equal) stringoperator(,) constant(C)operator(.)ident(process)operator(()instance_variable(@request)operator(,) instance_variable(@response)operator(\))operator(.)ident(body) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -comment(# The template_root must be set on Base and not LayoutTest so that LayoutTest's inherited method has access to) -comment(# the template_root when looking for a layout) -constant(ActionController)operator(::)constant(Base)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(LayoutTest) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) pre_constant(self)operator(.)method(controller_path)operator(;) string reserved(end) -reserved(end) - -comment(# Restore template root to be unset) -constant(ActionController)operator(::)constant(Base)operator(.)ident(template_root) operator(=) pre_constant(nil) - -reserved(class) class(ProductController) operator(<) constant(LayoutTest) -reserved(end) - -reserved(class) class(ItemController) operator(<) constant(LayoutTest) -reserved(end) - -reserved(class) class(ThirdPartyTemplateLibraryController) operator(<) constant(LayoutTest) -reserved(end) - -reserved(module) class(ControllerNameSpace) -reserved(end) - -reserved(class) class(ControllerNameSpace::NestedController) operator(<) constant(LayoutTest) -reserved(end) - -reserved(class) class(MabView) - reserved(def) method(initialize)operator(()ident(view)operator(\)) - reserved(end) - - reserved(def) method(render)operator(()ident(text)operator(,) ident(locals) operator(=) operator({)operator(})operator(\)) - ident(text) - reserved(end) -reserved(end) - -constant(ActionView)operator(::)constant(Base)operator(::)ident(register_template_handler) symbol(:mab)operator(,) constant(MabView) - -reserved(class) class(LayoutAutoDiscoveryTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - - instance_variable(@request)operator(.)ident(host) operator(=) string - reserved(end) - - reserved(def) method(test_application_layout_is_default_when_no_controller_match) - instance_variable(@controller) operator(=) constant(ProductController)operator(.)ident(new) - ident(get) symbol(:hello) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_controller_name_layout_name_match) - instance_variable(@controller) operator(=) constant(ItemController)operator(.)ident(new) - ident(get) symbol(:hello) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_third_party_template_library_auto_discovers_layout) - instance_variable(@controller) operator(=) constant(ThirdPartyTemplateLibraryController)operator(.)ident(new) - ident(get) symbol(:hello) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(active_layout) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_namespaced_controllers_auto_detect_layouts) - instance_variable(@controller) operator(=) constant(ControllerNameSpace)operator(::)constant(NestedController)operator(.)ident(new) - ident(get) symbol(:hello) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(active_layout) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(RespondToController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(layout) symbol(:set_layout) - - reserved(def) method(html_xml_or_rss) - ident(respond_to) reserved(do) operator(|)ident(type)operator(|) - ident(type)operator(.)ident(html) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(xml) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(rss) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(all) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - reserved(end) - reserved(end) - - reserved(def) method(js_or_html) - ident(respond_to) reserved(do) operator(|)ident(type)operator(|) - ident(type)operator(.)ident(html) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(js) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(all) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - reserved(end) - reserved(end) - - reserved(def) method(html_or_xml) - ident(respond_to) reserved(do) operator(|)ident(type)operator(|) - ident(type)operator(.)ident(html) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(xml) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(all) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - reserved(end) - reserved(end) - - reserved(def) method(just_xml) - ident(respond_to) reserved(do) operator(|)ident(type)operator(|) - ident(type)operator(.)ident(xml) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - reserved(end) - reserved(end) - - reserved(def) method(using_defaults) - ident(respond_to) reserved(do) operator(|)ident(type)operator(|) - ident(type)operator(.)ident(html) - ident(type)operator(.)ident(js) - ident(type)operator(.)ident(xml) - reserved(end) - reserved(end) - - reserved(def) method(using_defaults_with_type_list) - ident(respond_to)operator(()symbol(:html)operator(,) symbol(:js)operator(,) symbol(:xml)operator(\)) - reserved(end) - - reserved(def) method(made_for_content_type) - ident(respond_to) reserved(do) operator(|)ident(type)operator(|) - ident(type)operator(.)ident(rss) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(atom) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(all) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - reserved(end) - reserved(end) - - reserved(def) method(custom_type_handling) - ident(respond_to) reserved(do) operator(|)ident(type)operator(|) - ident(type)operator(.)ident(html) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(custom)operator(()stringoperator(\)) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(all) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - reserved(end) - reserved(end) - - reserved(def) method(handle_any) - ident(respond_to) reserved(do) operator(|)ident(type)operator(|) - ident(type)operator(.)ident(html) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - ident(type)operator(.)ident(any)operator(()symbol(:js)operator(,) symbol(:xml)operator(\)) operator({) ident(render) symbol(:text) operator(=)operator(>) string operator(}) - reserved(end) - reserved(end) - - reserved(def) method(all_types_with_layout) - ident(respond_to) reserved(do) operator(|)ident(type)operator(|) - ident(type)operator(.)ident(html) - ident(type)operator(.)ident(js) - reserved(end) - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) - ident(raise) - reserved(end) - - ident(protected) - reserved(def) method(set_layout) - reserved(if) ident(action_name) operator(==) string - string - reserved(end) - reserved(end) -reserved(end) - -constant(RespondToController)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(MimeControllerTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - - instance_variable(@controller) operator(=) constant(RespondToController)operator(.)ident(new) - instance_variable(@request)operator(.)ident(host) operator(=) string - reserved(end) - - reserved(def) method(test_html) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:js_or_html) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - ident(get) symbol(:html_or_xml) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - ident(get) symbol(:just_xml) - ident(assert_response) integer(406) - reserved(end) - - reserved(def) method(test_all) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:js_or_html) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) comment(# js is not part of all) - - ident(get) symbol(:html_or_xml) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - ident(get) symbol(:just_xml) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_xml) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:html_xml_or_rss) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_js_or_html) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:js_or_html) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - ident(get) symbol(:html_or_xml) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - ident(get) symbol(:just_xml) - ident(assert_response) integer(406) - reserved(end) - - reserved(def) method(test_js_or_anything) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:js_or_html) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - ident(get) symbol(:html_or_xml) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - ident(get) symbol(:just_xml) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_using_defaults) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:using_defaults) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:using_defaults) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:using_defaults) - ident(assert_equal) stringHello world!

)char(\\n)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_using_defaults_with_type_list) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:using_defaults_with_type_list) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:using_defaults_with_type_list) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:using_defaults_with_type_list) - ident(assert_equal) stringHello world!

)char(\\n)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_with_content_type) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:made_for_content_type) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:made_for_content_type) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_synonyms) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:js_or_html) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:html_xml_or_rss) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_custom_types) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:custom_type_handling) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:custom_type_handling) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_xhtml_alias) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:html_or_xml) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_firefox_simulation) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:html_or_xml) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_handle_any) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:handle_any) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:handle_any) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:handle_any) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_all_types_with_layout) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:all_types_with_layout) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:all_types_with_layout) - ident(assert_equal) stringHTML for all_types_with_layout)delimiter(')>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_xhr) - ident(xhr) symbol(:get)operator(,) symbol(:js_or_html) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - ident(xhr) symbol(:get)operator(,) symbol(:using_defaults) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(MimeTypeTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - constant(Mime)operator(::)constant(PNG) operator(=) constant(Mime)operator(::)constant(Type)operator(.)ident(new)operator(()stringoperator(\)) - constant(Mime)operator(::)constant(PLAIN) operator(=) constant(Mime)operator(::)constant(Type)operator(.)ident(new)operator(()stringoperator(\)) - - reserved(def) method(test_parse_single) - constant(Mime)operator(::)constant(LOOKUP)operator(.)ident(keys)operator(.)ident(each) reserved(do) operator(|)ident(mime_type)operator(|) - ident(assert_equal) operator([)constant(Mime)operator(::)constant(Type)operator(.)ident(lookup)operator(()ident(mime_type)operator(\))operator(])operator(,) constant(Mime)operator(::)constant(Type)operator(.)ident(parse)operator(()ident(mime_type)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_parse_without_q) - ident(accept) operator(=) string - ident(expect) operator(=) operator([)constant(Mime)operator(::)constant(HTML)operator(,) constant(Mime)operator(::)constant(XML)operator(,) constant(Mime)operator(::)constant(YAML)operator(,) constant(Mime)operator(::)constant(PNG)operator(,) constant(Mime)operator(::)constant(PLAIN)operator(,) constant(Mime)operator(::)constant(ALL)operator(]) - ident(assert_equal) ident(expect)operator(,) constant(Mime)operator(::)constant(Type)operator(.)ident(parse)operator(()ident(accept)operator(\)) - reserved(end) - - reserved(def) method(test_parse_with_q) - ident(accept) operator(=) string - ident(expect) operator(=) operator([)constant(Mime)operator(::)constant(HTML)operator(,) constant(Mime)operator(::)constant(XML)operator(,) constant(Mime)operator(::)constant(PNG)operator(,) constant(Mime)operator(::)constant(PLAIN)operator(,) constant(Mime)operator(::)constant(YAML)operator(,) constant(Mime)operator(::)constant(ALL)operator(]) - ident(assert_equal) ident(expect)operator(,) constant(Mime)operator(::)constant(Type)operator(.)ident(parse)operator(()ident(accept)operator(\)) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -ident(silence_warnings) operator({) constant(Customer) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:name)operator(\)) operator(}) - -reserved(module) class(Fun) - reserved(class) class(GamesController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(hello_world) - reserved(end) - reserved(end) -reserved(end) - -reserved(module) class(NewRenderTestHelper) - reserved(def) method(rjs_helper_method_from_module) - ident(page)operator(.)ident(visual_effect) symbol(:highlight) - reserved(end) -reserved(end) - -reserved(class) class(NewRenderTestController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(layout) symbol(:determine_layout) - - reserved(def) pre_constant(self)operator(.)method(controller_name)operator(;) stringoperator(;) reserved(end) - reserved(def) pre_constant(self)operator(.)method(controller_path)operator(;) stringoperator(;) reserved(end) - - reserved(def) method(hello_world) - reserved(end) - - reserved(def) method(render_hello_world) - ident(render) symbol(:template) operator(=)operator(>) string - reserved(end) - - reserved(def) method(render_hello_world_from_variable) - instance_variable(@person) operator(=) string - ident(render) symbol(:text) operator(=)operator(>) stringdelimiter(")> - reserved(end) - - reserved(def) method(render_action_hello_world) - ident(render) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(render_action_hello_world_as_symbol) - ident(render) symbol(:action) operator(=)operator(>) symbol(:hello_world) - reserved(end) - - reserved(def) method(render_text_hello_world) - ident(render) symbol(:text) operator(=)operator(>) string - reserved(end) - - reserved(def) method(render_text_hello_world_with_layout) - instance_variable(@variable_for_layout) operator(=) string - ident(render) symbol(:text) operator(=)operator(>) stringoperator(,) symbol(:layout) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(hello_world_with_layout_false) - ident(render) symbol(:layout) operator(=)operator(>) pre_constant(false) - reserved(end) - - reserved(def) method(render_custom_code) - ident(render) symbol(:text) operator(=)operator(>) stringoperator(,) symbol(:status) operator(=)operator(>) string - reserved(end) - - reserved(def) method(render_file_with_instance_variables) - instance_variable(@secret) operator(=) string - ident(path) operator(=) constant(File)operator(.)ident(join)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(,) stringoperator(\)) - ident(render) symbol(:file) operator(=)operator(>) ident(path) - reserved(end) - - reserved(def) method(render_file_with_locals) - ident(path) operator(=) constant(File)operator(.)ident(join)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(,) stringoperator(\)) - ident(render) symbol(:file) operator(=)operator(>) ident(path)operator(,) symbol(:locals) operator(=)operator(>) operator({)symbol(:secret) operator(=)operator(>) stringoperator(}) - reserved(end) - - reserved(def) method(render_file_not_using_full_path) - instance_variable(@secret) operator(=) string - ident(render) symbol(:file) operator(=)operator(>) stringoperator(,) symbol(:use_full_path) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(render_file_not_using_full_path_with_relative_path) - instance_variable(@secret) operator(=) string - ident(render) symbol(:file) operator(=)operator(>) stringoperator(,) symbol(:use_full_path) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(render_file_not_using_full_path_with_dot_in_path) - instance_variable(@secret) operator(=) string - ident(render) symbol(:file) operator(=)operator(>) stringoperator(,) symbol(:use_full_path) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(render_xml_hello) - instance_variable(@name) operator(=) string - ident(render) symbol(:template) operator(=)operator(>) string - reserved(end) - - reserved(def) method(greeting) - comment(# let's just rely on the template) - reserved(end) - - reserved(def) method(layout_test) - ident(render) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(layout_test_with_different_layout) - ident(render) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:layout) operator(=)operator(>) string - reserved(end) - - reserved(def) method(rendering_without_layout) - ident(render) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:layout) operator(=)operator(>) pre_constant(false) - reserved(end) - - reserved(def) method(layout_overriding_layout) - ident(render) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:layout) operator(=)operator(>) string - reserved(end) - - reserved(def) method(rendering_nothing_on_layout) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(builder_layout_test) - ident(render) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(partials_list) - instance_variable(@test_unchanged) operator(=) string - instance_variable(@customers) operator(=) operator([) constant(Customer)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Customer)operator(.)ident(new)operator(()stringoperator(\)) operator(]) - ident(render) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(partial_only) - ident(render) symbol(:partial) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(partial_only_with_layout) - ident(render) symbol(:partial) operator(=)operator(>) stringoperator(,) symbol(:layout) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(partial_with_locals) - ident(render) symbol(:partial) operator(=)operator(>) stringoperator(,) symbol(:locals) operator(=)operator(>) operator({) symbol(:customer) operator(=)operator(>) constant(Customer)operator(.)ident(new)operator(()stringoperator(\)) operator(}) - reserved(end) - - reserved(def) method(partial_collection) - ident(render) symbol(:partial) operator(=)operator(>) stringoperator(,) symbol(:collection) operator(=)operator(>) operator([) constant(Customer)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Customer)operator(.)ident(new)operator(()stringoperator(\)) operator(]) - reserved(end) - - reserved(def) method(partial_collection_with_locals) - ident(render) symbol(:partial) operator(=)operator(>) stringoperator(,) symbol(:collection) operator(=)operator(>) operator([) constant(Customer)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Customer)operator(.)ident(new)operator(()stringoperator(\)) operator(])operator(,) symbol(:locals) operator(=)operator(>) operator({) symbol(:greeting) operator(=)operator(>) string operator(}) - reserved(end) - - reserved(def) method(empty_partial_collection) - ident(render) symbol(:partial) operator(=)operator(>) stringoperator(,) symbol(:collection) operator(=)operator(>) operator([)operator(]) - reserved(end) - - reserved(def) method(partial_with_hash_object) - ident(render) symbol(:partial) operator(=)operator(>) stringoperator(,) symbol(:object) operator(=)operator(>) operator({)symbol(:first_name) operator(=)operator(>) stringoperator(}) - reserved(end) - - reserved(def) method(partial_with_implicit_local_assignment) - instance_variable(@customer) operator(=) constant(Customer)operator(.)ident(new)operator(()stringoperator(\)) - ident(render) symbol(:partial) operator(=)operator(>) string - reserved(end) - - reserved(def) method(hello_in_a_string) - instance_variable(@customers) operator(=) operator([) constant(Customer)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Customer)operator(.)ident(new)operator(()stringoperator(\)) operator(]) - ident(render) symbol(:text) operator(=)operator(>) stringoperator(\))inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(accessing_params_in_template) - ident(render) symbol(:inline) operator(=)operator(>) string)delimiter(")> - reserved(end) - - reserved(def) method(accessing_params_in_template_with_layout) - ident(render) symbol(:layout) operator(=)operator(>) pre_constant(nil)operator(,) symbol(:inline) operator(=)operator(>) string)delimiter(")> - reserved(end) - - reserved(def) method(render_with_explicit_template) - ident(render) string - reserved(end) - - reserved(def) method(double_render) - ident(render) symbol(:text) operator(=)operator(>) string - ident(render) symbol(:text) operator(=)operator(>) string - reserved(end) - - reserved(def) method(double_redirect) - ident(redirect_to) symbol(:action) operator(=)operator(>) string - ident(redirect_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(render_and_redirect) - ident(render) symbol(:text) operator(=)operator(>) string - ident(redirect_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(rendering_with_conflicting_local_vars) - instance_variable(@name) operator(=) string - reserved(def) instance_variable(@template)operator(.)method(name)operator(()operator(\)) pre_constant(nil) reserved(end) - ident(render) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(hello_world_from_rxml_using_action) - ident(render) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(hello_world_from_rxml_using_template) - ident(render) symbol(:template) operator(=)operator(>) string - reserved(end) - - ident(helper) constant(NewRenderTestHelper) - ident(helper) reserved(do) - reserved(def) method(rjs_helper_method)operator(()ident(value)operator(\)) - ident(page)operator(.)ident(visual_effect) symbol(:highlight)operator(,) ident(value) - reserved(end) - reserved(end) - - reserved(def) method(enum_rjs_test) - ident(render) symbol(:update) reserved(do) operator(|)ident(page)operator(|) - ident(page)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(value)operator(|) - ident(page)operator(.)ident(rjs_helper_method_from_module) - ident(page)operator(.)ident(rjs_helper_method)operator(()ident(value)operator(\)) - ident(page)operator(.)ident(sortable)operator(()ident(value)operator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - ident(page)operator(.)ident(draggable)operator(()ident(value)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(delete_with_js) - instance_variable(@project_id) operator(=) integer(4) - reserved(end) - - reserved(def) method(render_js_with_explicit_template) - instance_variable(@project_id) operator(=) integer(4) - ident(render) symbol(:template) operator(=)operator(>) string - reserved(end) - - reserved(def) method(render_js_with_explicit_action_template) - instance_variable(@project_id) operator(=) integer(4) - ident(render) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(update_page) - ident(render) symbol(:update) reserved(do) operator(|)ident(page)operator(|) - ident(page)operator(.)ident(replace_html) stringoperator(,) string - ident(page)operator(.)ident(visual_effect) symbol(:highlight)operator(,) string - reserved(end) - reserved(end) - - reserved(def) method(update_page_with_instance_variables) - instance_variable(@money) operator(=) string - instance_variable(@div_id) operator(=) string - ident(render) symbol(:update) reserved(do) operator(|)ident(page)operator(|) - ident(page)operator(.)ident(replace_html) instance_variable(@div_id)operator(,) instance_variable(@money) - ident(page)operator(.)ident(visual_effect) symbol(:highlight)operator(,) instance_variable(@div_id) - reserved(end) - reserved(end) - - reserved(def) method(action_talk_to_layout) - comment(# Action template sets variable that's picked up by layout) - reserved(end) - - reserved(def) method(render_text_with_assigns) - instance_variable(@hello) operator(=) string - ident(render) symbol(:text) operator(=)operator(>) string - reserved(end) - - reserved(def) method(yield_content_for) - ident(render) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:layout) operator(=)operator(>) string - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) - - ident(private) - reserved(def) method(determine_layout) - reserved(case) ident(action_name) - reserved(when) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) stringoperator(,) string - - string - reserved(when) string - string - reserved(when) stringoperator(,) string - string - reserved(end) - reserved(end) -reserved(end) - -constant(NewRenderTestController)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -constant(Fun)operator(::)constant(GamesController)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(NewRenderTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(NewRenderTestController)operator(.)ident(new) - - comment(# enable a logger so that (e.g.\) the benchmarking stuff runs, so we can get) - comment(# a more accurate simulation of what happens in "real life".) - instance_variable(@controller)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()pre_constant(nil)operator(\)) - - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - - instance_variable(@request)operator(.)ident(host) operator(=) string - reserved(end) - - reserved(def) method(test_simple_show) - ident(get) symbol(:hello_world) - ident(assert_response) symbol(:success) - ident(assert_template) string - ident(assert_equal) stringHello world!)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_do_with_render) - ident(get) symbol(:render_hello_world) - ident(assert_template) string - reserved(end) - - reserved(def) method(test_do_with_render_from_variable) - ident(get) symbol(:render_hello_world_from_variable) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_do_with_render_action) - ident(get) symbol(:render_action_hello_world) - ident(assert_template) string - reserved(end) - - reserved(def) method(test_do_with_render_action_as_symbol) - ident(get) symbol(:render_action_hello_world_as_symbol) - ident(assert_template) string - reserved(end) - - reserved(def) method(test_do_with_render_text) - ident(get) symbol(:render_text_hello_world) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_do_with_render_text_and_layout) - ident(get) symbol(:render_text_hello_world_with_layout) - ident(assert_equal) stringhello world, I'm here!)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_do_with_render_action_and_layout_false) - ident(get) symbol(:hello_world_with_layout_false) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_do_with_render_custom_code) - ident(get) symbol(:render_custom_code) - ident(assert_response) symbol(:missing) - reserved(end) - - reserved(def) method(test_render_file_with_instance_variables) - ident(get) symbol(:render_file_with_instance_variables) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_file_not_using_full_path) - ident(get) symbol(:render_file_not_using_full_path) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_file_not_using_full_path_with_relative_path) - ident(get) symbol(:render_file_not_using_full_path_with_relative_path) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_file_not_using_full_path_with_dot_in_path) - ident(get) symbol(:render_file_not_using_full_path_with_dot_in_path) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_file_with_locals) - ident(get) symbol(:render_file_with_locals) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_attempt_to_access_object_method) - ident(assert_raises)operator(()constant(ActionController)operator(::)constant(UnknownAction)operator(,) stringoperator(\)) operator({) ident(get) symbol(:clone) operator(}) - reserved(end) - - reserved(def) method(test_private_methods) - ident(assert_raises)operator(()constant(ActionController)operator(::)constant(UnknownAction)operator(,) stringoperator(\)) operator({) ident(get) symbol(:determine_layout) operator(}) - reserved(end) - - reserved(def) method(test_access_to_request_in_view) - ident(view_internals_old_value) operator(=) constant(ActionController)operator(::)constant(Base)operator(.)ident(view_controller_internals) - - constant(ActionController)operator(::)constant(Base)operator(.)ident(view_controller_internals) operator(=) pre_constant(false) - constant(ActionController)operator(::)constant(Base)operator(.)ident(protected_variables_cache) operator(=) pre_constant(nil) - - ident(get) symbol(:hello_world) - ident(assert_nil)operator(()ident(assigns)operator([)stringoperator(])operator(\)) - - constant(ActionController)operator(::)constant(Base)operator(.)ident(view_controller_internals) operator(=) pre_constant(true) - constant(ActionController)operator(::)constant(Base)operator(.)ident(protected_variables_cache) operator(=) pre_constant(nil) - - ident(get) symbol(:hello_world) - ident(assert_kind_of) constant(ActionController)operator(::)constant(AbstractRequest)operator(,) ident(assigns)operator([)stringoperator(]) - - constant(ActionController)operator(::)constant(Base)operator(.)ident(view_controller_internals) operator(=) ident(view_internals_old_value) - constant(ActionController)operator(::)constant(Base)operator(.)ident(protected_variables_cache) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(test_render_xml) - ident(get) symbol(:render_xml_hello) - ident(assert_equal) string)char(\\n)content(

Hello David

)char(\\n)content(

This is grand!

)char(\\n)content()char(\\n)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_enum_rjs_test) - ident(get) symbol(:enum_rjs_test) - ident(assert_equal) stringoperator(.)ident(strip)operator(,) instance_variable(@response)operator(.)ident(body)string - reserved(end) - - reserved(def) method(test_render_xml_with_default) - ident(get) symbol(:greeting) - ident(assert_equal) stringThis is grand!

)char(\\n)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_rjs_with_default) - ident(get) symbol(:delete_with_js) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_rjs_template_explicitly) - ident(get) symbol(:render_js_with_explicit_template) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_rendering_rjs_action_explicitly) - ident(get) symbol(:render_js_with_explicit_action_template) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_layout_rendering) - ident(get) symbol(:layout_test) - ident(assert_equal) stringHello world!)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_layout_test_with_different_layout) - ident(get) symbol(:layout_test_with_different_layout) - ident(assert_equal) stringHello world!)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_rendering_without_layout) - ident(get) symbol(:rendering_without_layout) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_layout_overriding_layout) - ident(get) symbol(:layout_overriding_layout) - ident(assert_no_match) regexp)delimiter(})>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_rendering_nothing_on_layout) - ident(get) symbol(:rendering_nothing_on_layout) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_xml_with_layouts) - ident(get) symbol(:builder_layout_test) - ident(assert_equal) string)char(\\n)content()char(\\n)content(

Hello

)char(\\n)content(

This is grand!

)char(\\n)content()char(\\n)content()char(\\n)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_partial_only) - ident(get) symbol(:partial_only) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_partial_only_with_layout) - ident(get) symbol(:partial_only_with_layout) - ident(assert_equal) stringonly partial)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_to_string) - ident(get) symbol(:hello_in_a_string) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_nested_rendering) - ident(get) symbol(:hello_world) - ident(assert_equal) stringoperator(,) constant(Fun)operator(::)constant(GamesController)operator(.)ident(process)operator(()instance_variable(@request)operator(,) instance_variable(@response)operator(\))operator(.)ident(body) - reserved(end) - - reserved(def) method(test_accessing_params_in_template) - ident(get) symbol(:accessing_params_in_template)operator(,) symbol(:name) operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_accessing_params_in_template_with_layout) - ident(get) symbol(:accessing_params_in_template_with_layout)operator(,) symbol(:name) operator(=)operator(>) string - ident(assert_equal) stringHello: David)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_with_explicit_template) - ident(get) symbol(:render_with_explicit_template) - ident(assert_response) symbol(:success) - reserved(end) - - reserved(def) method(test_double_render) - ident(assert_raises)operator(()constant(ActionController)operator(::)constant(DoubleRenderError)operator(\)) operator({) ident(get) symbol(:double_render) operator(}) - reserved(end) - - reserved(def) method(test_double_redirect) - ident(assert_raises)operator(()constant(ActionController)operator(::)constant(DoubleRenderError)operator(\)) operator({) ident(get) symbol(:double_redirect) operator(}) - reserved(end) - - reserved(def) method(test_render_and_redirect) - ident(assert_raises)operator(()constant(ActionController)operator(::)constant(DoubleRenderError)operator(\)) operator({) ident(get) symbol(:render_and_redirect) operator(}) - reserved(end) - - reserved(def) method(test_rendering_with_conflicting_local_vars) - ident(get) symbol(:rendering_with_conflicting_local_vars) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@response)operator(.)ident(body)operator(\)) - reserved(end) - - reserved(def) method(test_action_talk_to_layout) - ident(get) symbol(:action_talk_to_layout) - ident(assert_equal) stringTalking to the layout)char(\\n)content(Action was here!)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_partials_list) - ident(get) symbol(:partials_list) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_partial_with_locals) - ident(get) symbol(:partial_with_locals) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_partial_collection) - ident(get) symbol(:partial_collection) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_partial_collection_with_locals) - ident(get) symbol(:partial_collection_with_locals) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_empty_partial_collection) - ident(get) symbol(:empty_partial_collection) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_partial_with_hash_object) - ident(get) symbol(:partial_with_hash_object) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_partial_with_implicit_local_assignment) - ident(get) symbol(:partial_with_implicit_local_assignment) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_text_with_assigns) - ident(get) symbol(:render_text_with_assigns) - ident(assert_equal) stringoperator(,) ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_update_page) - ident(get) symbol(:update_page) - ident(assert_template) pre_constant(nil) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(headers)operator([)stringoperator(]) - ident(assert_equal) integer(2)operator(,) instance_variable(@response)operator(.)ident(body)operator(.)ident(split)operator(()global_variable($/)operator(\))operator(.)ident(length) - reserved(end) - - reserved(def) method(test_update_page_with_instance_variables) - ident(get) symbol(:update_page_with_instance_variables) - ident(assert_template) pre_constant(nil) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(headers)operator([)stringoperator(]) - ident(assert_match) regexpoperator(,) instance_variable(@response)operator(.)ident(body) - ident(assert_match) regexpoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_yield_content_for) - ident(get) symbol(:yield_content_for) - ident(assert_equal) stringPutting stuff in the title!)char(\\n)char(\\n)content(Great stuff!)char(\\n)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - - reserved(def) method(test_overwritting_rendering_relative_file_with_extension) - ident(get) symbol(:hello_world_from_rxml_using_template) - ident(assert_equal) string)char(\\n)content(

Hello

)char(\\n)content()char(\\n)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - - ident(get) symbol(:hello_world_from_rxml_using_action) - ident(assert_equal) string)char(\\n)content(

Hello

)char(\\n)content()char(\\n)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(RawPostDataTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - pre_constant(ENV)operator([)stringoperator(]) operator(=) string - pre_constant(ENV)operator([)stringoperator(]) operator(=) string - pre_constant(ENV)operator([)stringoperator(]) operator(=) string - reserved(end) - - reserved(def) method(test_raw_post_data) - ident(process_raw) string - reserved(end) - - ident(private) - reserved(def) method(process_raw)operator(()ident(query_string)operator(\)) - ident(old_stdin) operator(=) global_variable($stdin) - reserved(begin) - global_variable($stdin) operator(=) constant(StringIO)operator(.)ident(new)operator(()ident(query_string)operator(.)ident(dup)operator(\)) - pre_constant(ENV)operator([)stringoperator(]) operator(=) global_variable($stdin)operator(.)ident(size)operator(.)ident(to_s) - constant(CGI)operator(.)ident(new) - ident(assert_not_nil) pre_constant(ENV)operator([)stringoperator(]) - ident(assert) pre_constant(ENV)operator([)stringoperator(])operator(.)ident(frozen?) - ident(assert_equal) ident(query_string)operator(,) pre_constant(ENV)operator([)stringoperator(]) - reserved(ensure) - global_variable($stdin) operator(=) ident(old_stdin) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(RedirectController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(simple_redirect) - ident(redirect_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(method_redirect) - ident(redirect_to) symbol(:dashbord_url)operator(,) integer(1)operator(,) string - reserved(end) - - reserved(def) method(host_redirect) - ident(redirect_to) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:only_path) operator(=)operator(>) pre_constant(false)operator(,) symbol(:host) operator(=)operator(>) string - reserved(end) - - reserved(def) method(module_redirect) - ident(redirect_to) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(redirect_with_assigns) - instance_variable(@hello) operator(=) string - ident(redirect_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(redirect_to_back) - ident(redirect_to) symbol(:back) - reserved(end) - - reserved(def) method(rescue_errors)operator(()ident(e)operator(\)) ident(raise) ident(e) reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) - - ident(protected) - reserved(def) method(dashbord_url)operator(()ident(id)operator(,) ident(message)operator(\)) - ident(url_for) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:params) operator(=)operator(>) operator({) string operator(=)operator(>) ident(id)operator(,) string operator(=)operator(>) ident(message) operator(}) - reserved(end) -reserved(end) - -reserved(class) class(RedirectTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(RedirectController)operator(.)ident(new) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_simple_redirect) - ident(get) symbol(:simple_redirect) - ident(assert_redirect_url) string - reserved(end) - - reserved(def) method(test_redirect_with_method_reference_and_parameters) - ident(get) symbol(:method_redirect) - ident(assert_redirect_url) string - reserved(end) - - reserved(def) method(test_simple_redirect_using_options) - ident(get) symbol(:host_redirect) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:only_path) operator(=)operator(>) pre_constant(false)operator(,) symbol(:host) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_redirect_error_with_pretty_diff) - ident(get) symbol(:host_redirect) - reserved(begin) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:only_path) operator(=)operator(>) pre_constant(true) - reserved(rescue) constant(Test)operator(::)constant(Unit)operator(::)constant(AssertionFailedError) operator(=)operator(>) ident(err) - ident(redirection_msg)operator(,) ident(diff_msg) operator(=) ident(err)operator(.)ident(message)operator(.)ident(scan)operator(()regexp)delimiter(/)>operator(\))operator(.)ident(collect) operator({) operator(|)ident(s)operator(|) ident(s)operator([)integer(2)operator(..)integer(-3)operator(]) operator(}) - ident(assert_match) regexpfalse)delimiter(\))>operator(,) ident(redirection_msg) - ident(assert_match) regexp"other.test.host")delimiter(\))>operator(,) ident(redirection_msg) - ident(assert_match) regexp"other_host")delimiter(\))>operator(,) ident(redirection_msg) - ident(assert_match) regexptrue)delimiter(\))>operator(,) ident(diff_msg) - ident(assert_match) regexp"other.test.host")delimiter(\))>operator(,) ident(diff_msg) - reserved(end) - reserved(end) - - reserved(def) method(test_module_redirect) - ident(get) symbol(:module_redirect) - ident(assert_redirect_url) string - reserved(end) - - reserved(def) method(test_module_redirect_using_options) - ident(get) symbol(:module_redirect) - ident(assert_redirected_to) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_redirect_with_assigns) - ident(get) symbol(:redirect_with_assigns) - ident(assert_equal) stringoperator(,) ident(assigns)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_redirect_to_back) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(get) symbol(:redirect_to_back) - ident(assert_redirect_url) string - reserved(end) - - reserved(def) method(test_redirect_to_back_with_no_referer) - ident(assert_raises)operator(()constant(ActionController)operator(::)constant(RedirectBackError)operator(\)) operator({) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) pre_constant(nil) - ident(get) symbol(:redirect_to_back) - operator(}) - reserved(end) -reserved(end) - -reserved(module) class(ModuleTest) - reserved(class) class(ModuleRedirectController) operator(<) operator(::)constant(RedirectController) - reserved(def) method(module_redirect) - ident(redirect_to) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - reserved(end) - reserved(end) - - reserved(class) class(ModuleRedirectTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(ModuleRedirectController)operator(.)ident(new) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_simple_redirect) - ident(get) symbol(:simple_redirect) - ident(assert_redirect_url) string - reserved(end) - - reserved(def) method(test_redirect_with_method_reference_and_parameters) - ident(get) symbol(:method_redirect) - ident(assert_redirect_url) string - reserved(end) - - reserved(def) method(test_simple_redirect_using_options) - ident(get) symbol(:host_redirect) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:only_path) operator(=)operator(>) pre_constant(false)operator(,) symbol(:host) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_module_redirect) - ident(get) symbol(:module_redirect) - ident(assert_redirect_url) string - reserved(end) - - reserved(def) method(test_module_redirect_using_options) - ident(get) symbol(:module_redirect) - ident(assert_redirected_to) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(unless) reserved(defined?)operator(()constant(Customer)operator(\)) - constant(Customer) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:name)operator(\)) -reserved(end) - -reserved(module) class(Fun) - reserved(class) class(GamesController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(hello_world) - reserved(end) - reserved(end) -reserved(end) - - -reserved(class) class(TestController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(layout) symbol(:determine_layout) - - reserved(def) method(hello_world) - reserved(end) - - reserved(def) method(render_hello_world) - ident(render) string - reserved(end) - - reserved(def) method(render_hello_world_from_variable) - instance_variable(@person) operator(=) string - ident(render_text) stringdelimiter(")> - reserved(end) - - reserved(def) method(render_action_hello_world) - ident(render_action) string - reserved(end) - - reserved(def) method(render_action_hello_world_with_symbol) - ident(render_action) symbol(:hello_world) - reserved(end) - - reserved(def) method(render_text_hello_world) - ident(render_text) string - reserved(end) - - reserved(def) method(render_custom_code) - ident(render_text) stringoperator(,) string - reserved(end) - - reserved(def) method(render_xml_hello) - instance_variable(@name) operator(=) string - ident(render) string - reserved(end) - - reserved(def) method(greeting) - comment(# let's just rely on the template) - reserved(end) - - reserved(def) method(layout_test) - ident(render_action) string - reserved(end) - - reserved(def) method(builder_layout_test) - ident(render_action) string - reserved(end) - - reserved(def) method(partials_list) - instance_variable(@test_unchanged) operator(=) string - instance_variable(@customers) operator(=) operator([) constant(Customer)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Customer)operator(.)ident(new)operator(()stringoperator(\)) operator(]) - ident(render_action) string - reserved(end) - - reserved(def) method(partial_only) - ident(render_partial) - reserved(end) - - reserved(def) method(hello_in_a_string) - instance_variable(@customers) operator(=) operator([) constant(Customer)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Customer)operator(.)ident(new)operator(()stringoperator(\)) operator(]) - ident(render_text) stringoperator(\))inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(accessing_params_in_template) - ident(render_template) string)delimiter(")> - reserved(end) - - reserved(def) method(accessing_local_assigns_in_inline_template) - ident(name) operator(=) ident(params)operator([)symbol(:local_name)operator(]) - ident(render) symbol(:inline) operator(=)operator(>) string)delimiter(")>operator(,) - symbol(:locals) operator(=)operator(>) operator({) symbol(:local_name) operator(=)operator(>) ident(name) operator(}) - reserved(end) - - reserved(def) method(accessing_local_assigns_in_inline_template_with_string_keys) - ident(name) operator(=) ident(params)operator([)symbol(:local_name)operator(]) - constant(ActionView)operator(::)constant(Base)operator(.)ident(local_assigns_support_string_keys) operator(=) pre_constant(true) - ident(render) symbol(:inline) operator(=)operator(>) string)delimiter(")>operator(,) - symbol(:locals) operator(=)operator(>) operator({) string operator(=)operator(>) ident(name) operator(}) - constant(ActionView)operator(::)constant(Base)operator(.)ident(local_assigns_support_string_keys) operator(=) pre_constant(false) - reserved(end) - - reserved(def) method(render_to_string_test) - instance_variable(@foo) operator(=) ident(render_to_string) symbol(:inline) operator(=)operator(>) string - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) - - ident(private) - reserved(def) method(determine_layout) - reserved(case) ident(action_name) - reserved(when) stringoperator(:) string - reserved(when) stringoperator(:) string - reserved(end) - reserved(end) -reserved(end) - -constant(TestController)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -constant(Fun)operator(::)constant(GamesController)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(RenderTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - instance_variable(@controller) operator(=) constant(TestController)operator(.)ident(new) - - instance_variable(@request)operator(.)ident(host) operator(=) string - reserved(end) - - reserved(def) method(test_simple_show) - ident(get) symbol(:hello_world) - ident(assert_response) integer(200) - ident(assert_template) string - reserved(end) - - reserved(def) method(test_do_with_render) - ident(get) symbol(:render_hello_world) - ident(assert_template) string - reserved(end) - - reserved(def) method(test_do_with_render_from_variable) - ident(get) symbol(:render_hello_world_from_variable) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_do_with_render_action) - ident(get) symbol(:render_action_hello_world) - ident(assert_template) string - reserved(end) - - reserved(def) method(test_do_with_render_action_with_symbol) - ident(get) symbol(:render_action_hello_world_with_symbol) - ident(assert_template) string - reserved(end) - - reserved(def) method(test_do_with_render_text) - ident(get) symbol(:render_text_hello_world) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_do_with_render_custom_code) - ident(get) symbol(:render_custom_code) - ident(assert_response) integer(404) - reserved(end) - - reserved(def) method(test_attempt_to_access_object_method) - ident(assert_raises)operator(()constant(ActionController)operator(::)constant(UnknownAction)operator(,) stringoperator(\)) operator({) ident(get) symbol(:clone) operator(}) - reserved(end) - - reserved(def) method(test_private_methods) - ident(assert_raises)operator(()constant(ActionController)operator(::)constant(UnknownAction)operator(,) stringoperator(\)) operator({) ident(get) symbol(:determine_layout) operator(}) - reserved(end) - - reserved(def) method(test_access_to_request_in_view) - ident(view_internals_old_value) operator(=) constant(ActionController)operator(::)constant(Base)operator(.)ident(view_controller_internals) - - constant(ActionController)operator(::)constant(Base)operator(.)ident(view_controller_internals) operator(=) pre_constant(false) - constant(ActionController)operator(::)constant(Base)operator(.)ident(protected_variables_cache) operator(=) pre_constant(nil) - - ident(get) symbol(:hello_world) - ident(assert_nil) ident(assigns)operator([)stringoperator(]) - - constant(ActionController)operator(::)constant(Base)operator(.)ident(view_controller_internals) operator(=) pre_constant(true) - constant(ActionController)operator(::)constant(Base)operator(.)ident(protected_variables_cache) operator(=) pre_constant(nil) - - ident(get) symbol(:hello_world) - ident(assert_kind_of) constant(ActionController)operator(::)constant(AbstractRequest)operator(,) ident(assigns)operator([)stringoperator(]) - - constant(ActionController)operator(::)constant(Base)operator(.)ident(view_controller_internals) operator(=) ident(view_internals_old_value) - constant(ActionController)operator(::)constant(Base)operator(.)ident(protected_variables_cache) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(test_render_xml) - ident(get) symbol(:render_xml_hello) - ident(assert_equal) string)char(\\n)content(

Hello David

)char(\\n)content(

This is grand!

)char(\\n)content()char(\\n)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_xml_with_default) - ident(get) symbol(:greeting) - ident(assert_equal) stringThis is grand!

)char(\\n)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_layout_rendering) - ident(get) symbol(:layout_test) - ident(assert_equal) stringHello world!)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_xml_with_layouts) - ident(get) symbol(:builder_layout_test) - ident(assert_equal) string)char(\\n)content()char(\\n)content(

Hello

)char(\\n)content(

This is grand!

)char(\\n)content()char(\\n)content()char(\\n)delimiter(")>operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - comment(# def test_partials_list) - comment(# get :partials_list) - comment(# assert_equal "goodbyeHello: davidHello: marygoodbye\\n", process_request.body) - comment(# end) - - reserved(def) method(test_partial_only) - ident(get) symbol(:partial_only) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_to_string) - ident(get) symbol(:hello_in_a_string) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_render_to_string_resets_assigns) - ident(get) symbol(:render_to_string_test) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_nested_rendering) - instance_variable(@controller) operator(=) constant(Fun)operator(::)constant(GamesController)operator(.)ident(new) - ident(get) symbol(:hello_world) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_accessing_params_in_template) - ident(get) symbol(:accessing_params_in_template)operator(,) symbol(:name) operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_accessing_local_assigns_in_inline_template) - ident(get) symbol(:accessing_local_assigns_in_inline_template)operator(,) symbol(:local_name) operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_accessing_local_assigns_in_inline_template_with_string_keys) - ident(get) symbol(:accessing_local_assigns_in_inline_template_with_string_keys)operator(,) symbol(:local_name) operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(RequestTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_remote_ip) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(remote_ip) - - instance_variable(@request)operator(.)ident(remote_addr) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(remote_ip) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(remote_ip) - instance_variable(@request)operator(.)ident(env)operator(.)ident(delete) string - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(remote_ip) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(remote_ip) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(remote_ip) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(remote_ip) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(remote_ip) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(remote_ip) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(remote_ip) - instance_variable(@request)operator(.)ident(env)operator(.)ident(delete) string - reserved(end) - - reserved(def) method(test_domains) - instance_variable(@request)operator(.)ident(host) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(domain) - - instance_variable(@request)operator(.)ident(host) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(domain)operator(()integer(2)operator(\)) - - instance_variable(@request)operator(.)ident(host) operator(=) string - ident(assert_nil) instance_variable(@request)operator(.)ident(domain) - - instance_variable(@request)operator(.)ident(host) operator(=) pre_constant(nil) - ident(assert_nil) instance_variable(@request)operator(.)ident(domain) - reserved(end) - - reserved(def) method(test_subdomains) - instance_variable(@request)operator(.)ident(host) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(subdomains) - - instance_variable(@request)operator(.)ident(host) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(subdomains)operator(()integer(2)operator(\)) - - instance_variable(@request)operator(.)ident(host) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(subdomains)operator(()integer(2)operator(\)) - - instance_variable(@request)operator(.)ident(host) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(subdomains) - - instance_variable(@request)operator(.)ident(host) operator(=) pre_constant(nil) - ident(assert_equal) operator([)operator(])operator(,) instance_variable(@request)operator(.)ident(subdomains) - reserved(end) - - reserved(def) method(test_port_string) - instance_variable(@request)operator(.)ident(port) operator(=) integer(80) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(port_string) - - instance_variable(@request)operator(.)ident(port) operator(=) integer(8080) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(port_string) - reserved(end) - - reserved(def) method(test_relative_url_root) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(relative_url_root)operator(,) string - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) pre_constant(nil) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(relative_url_root) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(relative_url_root) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(relative_url_root) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(relative_url_root) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(relative_url_root) - - comment(# apache/scgi case) - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(relative_url_root) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(relative_url_root) - - comment(# @env overrides path guess) - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(relative_url_root) - reserved(end) - - reserved(def) method(test_request_uri) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(set_REQUEST_URI) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(set_REQUEST_URI) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(set_REQUEST_URI) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(set_REQUEST_URI) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(set_REQUEST_URI) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(set_REQUEST_URI) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(set_REQUEST_URI) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(set_REQUEST_URI) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - comment(# The following tests are for when REQUEST_URI is not supplied (as in IIS\)) - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(set_REQUEST_URI) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) pre_constant(nil) comment(#"/path/dispatch.rb") - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) pre_constant(nil) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - - comment(# This test ensures that Rails uses REQUEST_URI over PATH_INFO) - instance_variable(@request)operator(.)ident(relative_url_root) operator(=) pre_constant(nil) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(request_uri) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path) - reserved(end) - - - reserved(def) method(test_host_with_port) - instance_variable(@request)operator(.)ident(host) operator(=) string - instance_variable(@request)operator(.)ident(port) operator(=) integer(80) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(host_with_port) - - instance_variable(@request)operator(.)ident(host) operator(=) string - instance_variable(@request)operator(.)ident(port) operator(=) integer(81) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(host_with_port) - reserved(end) - - reserved(def) method(test_server_software) - ident(assert_equal) pre_constant(nil)operator(,) instance_variable(@request)operator(.)ident(server_software) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(server_software) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(server_software) - reserved(end) - - reserved(def) method(test_xml_http_request) - ident(assert) operator(!)instance_variable(@request)operator(.)ident(xml_http_request?) - ident(assert) operator(!)instance_variable(@request)operator(.)ident(xhr?) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert) operator(!)instance_variable(@request)operator(.)ident(xml_http_request?) - ident(assert) operator(!)instance_variable(@request)operator(.)ident(xhr?) - - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert) instance_variable(@request)operator(.)ident(xml_http_request?) - ident(assert) instance_variable(@request)operator(.)ident(xhr?) - reserved(end) - - reserved(def) method(test_reports_ssl) - ident(assert) operator(!)instance_variable(@request)operator(.)ident(ssl?) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert) instance_variable(@request)operator(.)ident(ssl?) - reserved(end) - - reserved(def) method(test_reports_ssl_when_proxied_via_lighttpd) - ident(assert) operator(!)instance_variable(@request)operator(.)ident(ssl?) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(assert) instance_variable(@request)operator(.)ident(ssl?) - reserved(end) - -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string - -constant(RunTimeTests) operator(=) pre_constant(ARGV)operator(.)ident(include?) string - -reserved(module) class(ActionController::CodeGeneration) - -reserved(class) class(SourceTests) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(attr_accessor) symbol(:source) - reserved(def) method(setup) - instance_variable(@source) operator(=) constant(Source)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_initial_state) - ident(assert_equal) operator([)operator(])operator(,) ident(source)operator(.)ident(lines) - ident(assert_equal) integer(0)operator(,) ident(source)operator(.)ident(indentation_level) - reserved(end) - - reserved(def) method(test_trivial_operations) - ident(source) operator(<<) string - ident(assert_equal) operator([)stringoperator(])operator(,) ident(source)operator(.)ident(lines) - ident(assert_equal) stringoperator(,) ident(source)operator(.)ident(to_s) - - ident(source)operator(.)ident(line) string - ident(assert_equal) operator([)stringoperator(,) stringoperator(])operator(,) ident(source)operator(.)ident(lines) - ident(assert_equal) stringoperator(,) ident(source)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_indentation) - ident(source) operator(<<) string - ident(source) operator(<<) string - ident(source)operator(.)ident(indent) operator({) ident(source) operator(<<) string operator(}) - ident(source) operator(<<) string - ident(source)operator(.)ident(indent) operator({) ident(source) operator(<<) string operator(}) - ident(source) operator(<<) string - - ident(assert_equal) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(source)operator(.)ident(lines) - - ident(text) operator(=) string - - ident(assert_equal) ident(text)operator(,) ident(source)operator(.)ident(to_s) - reserved(end) -reserved(end) - -reserved(class) class(CodeGeneratorTests) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(attr_accessor) symbol(:generator) - reserved(def) method(setup) - instance_variable(@generator) operator(=) constant(CodeGenerator)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_initial_state) - ident(assert_equal) operator([)operator(])operator(,) ident(generator)operator(.)ident(source)operator(.)ident(lines) - ident(assert_equal) operator([)operator(])operator(,) ident(generator)operator(.)ident(locals) - reserved(end) - - reserved(def) method(test_trivial_operations) - operator([)stringoperator(,) stringoperator(])operator(.)ident(each) operator({)operator(|)ident(l)operator(|) ident(generator) operator(<<) ident(l)operator(}) - ident(assert_equal) operator([)stringoperator(,) stringoperator(])operator(,) ident(generator)operator(.)ident(source)operator(.)ident(lines) - ident(assert_equal) stringoperator(,) ident(generator)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_if) - ident(generator) operator(<<) string - ident(generator)operator(.)ident(if)operator(()stringoperator(\)) operator({) ident(generator) operator(<<) string operator(}) - - ident(assert_equal) stringoperator(,) ident(generator)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_else) - ident(test_if) - ident(generator)operator(.)ident(else) operator({) ident(generator) operator(<<) string operator(}) - - ident(assert_equal) stringoperator(,) ident(generator)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_dup) - ident(generator) operator(<<) string - ident(generator)operator(.)ident(locals) operator(<<) symbol(:x) - - ident(g) operator(=) ident(generator)operator(.)ident(dup) - ident(assert_equal) ident(generator)operator(.)ident(source)operator(,) ident(g)operator(.)ident(source) - ident(assert_equal) ident(generator)operator(.)ident(locals)operator(,) ident(g)operator(.)ident(locals) - - ident(g) operator(<<) string - ident(g)operator(.)ident(locals) operator(<<) symbol(:y) - ident(assert_equal) operator([)symbol(:x)operator(,) symbol(:y)operator(])operator(,) ident(g)operator(.)ident(locals) comment(# Make sure they don't share the same array.) - ident(assert_equal) operator([)symbol(:x)operator(])operator(,) ident(generator)operator(.)ident(locals) - reserved(end) -reserved(end) - -reserved(class) class(RecognitionTests) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(attr_accessor) symbol(:generator) - reserved(alias) symbol(:g) symbol(:generator) - reserved(def) method(setup) - instance_variable(@generator) operator(=) constant(RecognitionGenerator)operator(.)ident(new) - reserved(end) - - reserved(def) method(go)operator(()ident(components)operator(\)) - ident(g)operator(.)ident(current) operator(=) ident(components)operator(.)ident(first) - ident(g)operator(.)ident(after) operator(=) ident(components)operator([)integer(1)operator(..)integer(-1)operator(]) operator(||) operator([)operator(]) - ident(g)operator(.)ident(go) - reserved(end) - - reserved(def) method(execute)operator(()ident(path)operator(,) ident(show) operator(=) pre_constant(false)operator(\)) - ident(path) operator(=) ident(path)operator(.)ident(split)operator(()stringoperator(\)) reserved(if) ident(path)operator(.)ident(is_a?) constant(String) - ident(source) operator(=) stringchar(\\n)inlinedelimiter(")> - ident(puts) ident(source) reserved(if) ident(show) - ident(r) operator(=) ident(eval) ident(source) - ident(r) operator(?) ident(r)operator(.)ident(symbolize_keys) operator(:) pre_constant(nil) - reserved(end) - - constant(Static) operator(=) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(StaticComponent) - constant(Dynamic) operator(=) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(DynamicComponent) - constant(Path) operator(=) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(PathComponent) - constant(Controller) operator(=) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(ControllerComponent) - - reserved(def) method(test_all_static) - ident(c) operator(=) stringoperator(.)ident(collect) operator({)operator(|)ident(str)operator(|) constant(Static)operator(.)ident(new)operator(()ident(str)operator(\))operator(}) - - ident(g)operator(.)ident(result) symbol(:controller)operator(,) stringoperator(,) pre_constant(true) - ident(g)operator(.)ident(constant_result) symbol(:action)operator(,) string - - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_basic_dynamic) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(\))operator(]) - ident(g)operator(.)ident(result) symbol(:controller)operator(,) stringoperator(,) pre_constant(true) - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_basic_dynamic_backwards) - ident(c) operator(=) operator([)constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(\))operator(,) constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(]) - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_dynamic_with_default) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(,) symbol(:default) operator(=)operator(>) stringoperator(\))operator(]) - ident(g)operator(.)ident(result) symbol(:controller)operator(,) stringoperator(,) pre_constant(true) - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_dynamic_with_string_condition) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(,) symbol(:condition) operator(=)operator(>) stringoperator(\))operator(]) - ident(g)operator(.)ident(result) symbol(:controller)operator(,) stringoperator(,) pre_constant(true) - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_dynamic_with_string_condition_backwards) - ident(c) operator(=) operator([)constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(,) symbol(:condition) operator(=)operator(>) stringoperator(\))operator(,) constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(]) - ident(g)operator(.)ident(result) symbol(:controller)operator(,) stringoperator(,) pre_constant(true) - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_dynamic_with_regexp_condition) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(,) symbol(:condition) operator(=)operator(>) regexpoperator(\))operator(]) - ident(g)operator(.)ident(result) symbol(:controller)operator(,) stringoperator(,) pre_constant(true) - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_dynamic_with_regexp_and_default) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(,) symbol(:condition) operator(=)operator(>) regexpoperator(,) symbol(:default) operator(=)operator(>) stringoperator(\))operator(]) - ident(g)operator(.)ident(result) symbol(:controller)operator(,) stringoperator(,) pre_constant(true) - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_path) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Path)operator(.)ident(new)operator(()symbol(:file)operator(\))operator(]) - ident(g)operator(.)ident(result) symbol(:controller)operator(,) stringoperator(,) pre_constant(true) - ident(g)operator(.)ident(constant_result) symbol(:action)operator(,) string - - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:file) operator(=)operator(>) operator([)operator(])operator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:file) operator(=)operator(>) stringoperator(})operator(,) - ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:file) operator(=)operator(>) operator([)stringoperator(])operator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()stringoperator(\))operator([)symbol(:file)operator(])operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_path_with_dynamic) - ident(c) operator(=) operator([)constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(\))operator(,) constant(Path)operator(.)ident(new)operator(()symbol(:file)operator(\))operator(]) - ident(g)operator(.)ident(result) symbol(:controller)operator(,) stringoperator(,) pre_constant(true) - - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:file) operator(=)operator(>) operator([)operator(])operator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:file) operator(=)operator(>) stringoperator(})operator(,) - ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:file) operator(=)operator(>) operator([)stringoperator(])operator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()stringoperator(\))operator([)symbol(:file)operator(])operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_path_with_dynamic_and_default) - ident(c) operator(=) operator([)constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(,) symbol(:default) operator(=)operator(>) stringoperator(\))operator(,) constant(Path)operator(.)ident(new)operator(()symbol(:file)operator(\))operator(]) - - ident(go) ident(c) - - ident(assert_equal)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:file) operator(=)operator(>) operator([)operator(])operator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:file) operator(=)operator(>) operator([)operator(])operator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:file) operator(=)operator(>) operator([)operator(])operator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:file) operator(=)operator(>) operator([)stringoperator(])operator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:file) operator(=)operator(>) operator([)stringoperator(])operator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_controller) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Controller)operator(.)ident(new)operator(()symbol(:controller)operator(\))operator(]) - ident(g)operator(.)ident(constant_result) symbol(:action)operator(,) string - - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(UserController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_controller_with_regexp) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Controller)operator(.)ident(new)operator(()symbol(:controller)operator(,) symbol(:condition) operator(=)operator(>) regexpoperator(\))operator(]) - ident(g)operator(.)ident(constant_result) symbol(:action)operator(,) string - - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(UserController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(NewsFeedController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_standard_route)operator(()ident(time) operator(=) operator(::)constant(RunTimeTests)operator(\)) - ident(c) operator(=) operator([)constant(Controller)operator(.)ident(new)operator(()symbol(:controller)operator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(,) symbol(:default) operator(=)operator(>) stringoperator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:id)operator(,) symbol(:default) operator(=)operator(>) pre_constant(nil)operator(\))operator(]) - ident(go) ident(c) - - comment(# Make sure we get the right answers) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(UserController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(UserController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(UserController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()stringoperator(\))operator(\)) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - - reserved(if) ident(time) - ident(source) operator(=) stringcontent( - end)delimiter(")> - ident(eval)operator(()ident(source)operator(\)) - - constant(GC)operator(.)ident(start) - ident(n) operator(=) integer(1000) - ident(time) operator(=) constant(Benchmark)operator(.)ident(realtime) reserved(do) ident(n)operator(.)ident(times) operator({) - ident(execute)operator(()stringoperator(\)) - ident(execute)operator(()stringoperator(\)) - ident(execute)operator(()stringoperator(\)) - - ident(execute)operator(()stringoperator(\)) - ident(execute)operator(()stringoperator(\)) - ident(execute)operator(()stringoperator(\)) - - ident(execute)operator(()stringoperator(\)) - ident(execute)operator(()stringoperator(\)) - ident(execute)operator(()stringoperator(\)) - ident(execute)operator(()stringoperator(\)) - operator(}) reserved(end) - ident(time) operator(-=) constant(Benchmark)operator(.)ident(realtime) reserved(do) ident(n)operator(.)ident(times) operator({) operator(}) reserved(end) - - - ident(puts) string - ident(per_url) operator(=) ident(time) operator(/) operator(()ident(n) operator(*) integer(10)operator(\)) - - ident(puts) stringcontent( ms/url)delimiter(")> - ident(puts) stringcontent( urls/s)char(\\n)char(\\n)delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(test_default_route) - ident(g)operator(.)ident(result) symbol(:controller)operator(,) stringoperator(,) pre_constant(true) - ident(g)operator(.)ident(constant_result) symbol(:action)operator(,) string - - ident(go) operator([)operator(]) - - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_nil) ident(execute)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(execute)operator(()operator([)operator(])operator(\))operator(\)) - reserved(end) -reserved(end) - -reserved(class) class(GenerationTests) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(attr_accessor) symbol(:generator) - reserved(alias) symbol(:g) symbol(:generator) - reserved(def) method(setup) - instance_variable(@generator) operator(=) constant(GenerationGenerator)operator(.)ident(new) comment(# ha!) - reserved(end) - - reserved(def) method(go)operator(()ident(components)operator(\)) - ident(g)operator(.)ident(current) operator(=) ident(components)operator(.)ident(first) - ident(g)operator(.)ident(after) operator(=) ident(components)operator([)integer(1)operator(..)integer(-1)operator(]) operator(||) operator([)operator(]) - ident(g)operator(.)ident(go) - reserved(end) - - reserved(def) method(execute)operator(()ident(options)operator(,) ident(recall)operator(,) ident(show) operator(=) pre_constant(false)operator(\)) - ident(source) operator(=) stringchar(\\n)char(\\n)delimiter(")> - ident(puts) ident(source) reserved(if) ident(show) - ident(eval)operator(()ident(source)operator(\)) - reserved(end) - - constant(Static) operator(=) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(StaticComponent) - constant(Dynamic) operator(=) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(DynamicComponent) - constant(Path) operator(=) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(PathComponent) - constant(Controller) operator(=) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(ControllerComponent) - - reserved(def) method(test_all_static_no_requirements) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(]) - ident(go) ident(c) - - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)operator(})operator(,) operator({)operator(})operator(\)) - reserved(end) - - reserved(def) method(test_basic_dynamic) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(\))operator(]) - ident(go) ident(c) - - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)operator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)operator(})operator(,)operator({)operator(})operator(\)) - reserved(end) - - reserved(def) method(test_dynamic_with_default) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(,) symbol(:default) operator(=)operator(>) stringoperator(\))operator(]) - ident(go) ident(c) - - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)operator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)operator(})operator(,) operator({)operator(})operator(\)) - reserved(end) - - reserved(def) method(test_dynamic_with_regexp_condition) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(,) symbol(:condition) operator(=)operator(>) regexpoperator(\))operator(]) - ident(go) ident(c) - - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)operator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)operator(})operator(,) operator({)operator(})operator(\)) - reserved(end) - - reserved(def) method(test_dynamic_with_default_and_regexp_condition) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(,) symbol(:default) operator(=)operator(>) stringoperator(,) symbol(:condition) operator(=)operator(>) regexpoperator(\))operator(]) - ident(go) ident(c) - - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)operator(})operator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)operator(})operator(,) operator({)operator(})operator(\)) - reserved(end) - - reserved(def) method(test_path) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Path)operator(.)ident(new)operator(()symbol(:file)operator(\))operator(]) - ident(go) ident(c) - - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:file) operator(=)operator(>) operator([)operator(])operator(})operator(,) operator({)operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:file) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:file) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:file) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:file) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:file) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - reserved(end) - - reserved(def) method(test_controller) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Controller)operator(.)ident(new)operator(()symbol(:controller)operator(\))operator(]) - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()operator({)operator(})operator(,) operator({)operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)operator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)operator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(\)) - reserved(end) - - reserved(def) method(test_controller_with_regexp) - ident(c) operator(=) operator([)constant(Static)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(Controller)operator(.)ident(new)operator(()symbol(:controller)operator(,) symbol(:condition) operator(=)operator(>) regexpoperator(\))operator(]) - ident(go) ident(c) - - ident(assert_nil) ident(execute)operator(()operator({)operator(})operator(,) operator({)operator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)operator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)operator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(\)) - reserved(end) - - reserved(def) method(test_standard_route)operator(()ident(time) operator(=) operator(::)constant(RunTimeTests)operator(\)) - ident(c) operator(=) operator([)constant(Controller)operator(.)ident(new)operator(()symbol(:controller)operator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:action)operator(,) symbol(:default) operator(=)operator(>) stringoperator(\))operator(,) constant(Dynamic)operator(.)ident(new)operator(()symbol(:id)operator(,) symbol(:default) operator(=)operator(>) pre_constant(nil)operator(\))operator(]) - ident(go) ident(c) - - comment(# Make sure we get the right answers) - ident(assert_equal)operator(()stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\))operator(\)) - - ident(assert_equal)operator(()stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\))operator(\)) - - reserved(if) ident(time) - constant(GC)operator(.)ident(start) - ident(n) operator(=) integer(1000) - ident(time) operator(=) constant(Benchmark)operator(.)ident(realtime) reserved(do) ident(n)operator(.)ident(times) operator({) - ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - - ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - operator(}) reserved(end) - ident(time) operator(-=) constant(Benchmark)operator(.)ident(realtime) reserved(do) ident(n)operator(.)ident(times) operator({) operator(}) reserved(end) - - ident(puts) string - ident(per_url) operator(=) ident(time) operator(/) operator(()ident(n) operator(*) integer(6)operator(\)) - - ident(puts) stringcontent( ms/url)delimiter(")> - ident(puts) stringcontent( urls/s)char(\\n)char(\\n)delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(test_default_route) - ident(g)operator(.)ident(if)operator(()ident(g)operator(.)ident(check_conditions)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\))operator(\)) operator({) ident(go) operator([)operator(]) operator(}) - - ident(assert_nil) ident(execute)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_nil) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(\)) - - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(execute)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(\)) - reserved(end) -reserved(end) - -reserved(class) class(RouteTests) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - - reserved(def) method(route)operator(()operator(*)ident(args)operator(\)) - instance_variable(@route) operator(=) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(Route)operator(.)ident(new)operator(()operator(*)ident(args)operator(\)) reserved(unless) ident(args)operator(.)ident(empty?) - reserved(return) instance_variable(@route) - reserved(end) - - reserved(def) method(rec)operator(()ident(path)operator(,) ident(show) operator(=) pre_constant(false)operator(\)) - ident(path) operator(=) ident(path)operator(.)ident(split)operator(()stringoperator(\)) reserved(if) ident(path)operator(.)ident(is_a?) constant(String) - ident(index) operator(=) integer(0) - ident(source) operator(=) ident(route)operator(.)ident(write_recognition)operator(.)ident(to_s) - ident(puts) stringchar(\\n)char(\\n)delimiter(")> reserved(if) ident(show) - ident(r) operator(=) ident(eval)operator(()ident(source)operator(\)) - ident(r) operator(?) ident(r)operator(.)ident(symbolize_keys) operator(:) ident(r) - reserved(end) - reserved(def) method(gen)operator(()ident(options)operator(,) ident(recall) operator(=) pre_constant(nil)operator(,) ident(show) operator(=) pre_constant(false)operator(\)) - ident(recall) operator(||=) ident(options)operator(.)ident(dup) - - ident(expire_on) operator(=) operator(::)constant(ActionController)operator(::)constant(Routing)operator(.)ident(expiry_hash)operator(()ident(options)operator(,) ident(recall)operator(\)) - ident(hash) operator(=) ident(merged) operator(=) ident(recall)operator(.)ident(merge)operator(()ident(options)operator(\)) - ident(not_expired) operator(=) pre_constant(true) - - ident(source) operator(=) ident(route)operator(.)ident(write_generation)operator(.)ident(to_s) - ident(puts) stringchar(\\n)char(\\n)delimiter(")> reserved(if) ident(show) - ident(eval)operator(()ident(source)operator(\)) - - reserved(end) - - reserved(def) method(test_static) - ident(route) stringoperator(,) symbol(:known) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - - ident(assert_nil) ident(rec)operator(()stringoperator(\)) - ident(assert_nil) ident(rec)operator(()stringoperator(\)) - ident(assert_equal)operator(() - operator({)symbol(:known) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) - ident(rec)operator(()stringoperator(\)) - operator(\)) - - ident(assert_nil) ident(gen)operator(()symbol(:known) operator(=)operator(>) stringoperator(\)) - ident(assert_nil) ident(gen)operator(()operator({)operator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(gen)operator(()symbol(:known) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(gen)operator(()symbol(:known) operator(=)operator(>) stringoperator(,) symbol(:extra) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)symbol(:extra)operator(])operator(,) ident(route)operator(.)ident(extra_keys)operator(()symbol(:known) operator(=)operator(>) stringoperator(,) symbol(:extra) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_dynamic) - ident(route) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - - ident(assert_nil) ident(rec)operator(()stringoperator(\)) - ident(assert_nil) ident(rec)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(})operator(,) ident(rec)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(})operator(,) ident(rec)operator(()stringoperator(\))operator(\)) - - ident(assert_nil) ident(gen)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(assert_nil) ident(gen)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_nil) ident(gen)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(gen)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(gen)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_typical) - ident(route) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) pre_constant(nil) - ident(assert_nil) ident(rec)operator(()stringoperator(\)) - ident(assert_nil) ident(rec)operator(()stringoperator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(rec)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(UserController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(rec)operator(()stringoperator(\))operator(\)) - - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(UserController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(rec)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(UserController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(rec)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(UserController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(,) ident(rec)operator(()stringoperator(\))operator(\)) - - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) ident(rec)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(,) ident(rec)operator(()stringoperator(\))operator(\)) - - - ident(assert_equal) stringoperator(,) ident(gen)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(gen)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(gen)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(\)) - - ident(assert_equal) stringoperator(,) ident(gen)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(gen)operator(()symbol(:controller) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(gen)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringoperator(,) ident(gen)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(\)) - reserved(end) -reserved(end) - -reserved(class) class(RouteSetTests) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(attr_reader) symbol(:rs) - reserved(def) method(setup) - instance_variable(@rs) operator(=) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(RouteSet)operator(.)ident(new) - instance_variable(@rs)operator(.)ident(draw) operator({)operator(|)ident(m)operator(|) ident(m)operator(.)ident(connect) string operator(}) - operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(NamedRoutes)operator(.)ident(clear) - reserved(end) - - reserved(def) method(test_default_setup) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(.)ident(stringify_keys)operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(.)ident(stringify_keys)operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(.)ident(stringify_keys)operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(UserController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(.)ident(stringify_keys)operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(10)operator(})operator(\)) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()operator({)operator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(\)) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(\)) - reserved(end) - - reserved(def) method(test_ignores_leading_slash) - instance_variable(@rs)operator(.)ident(draw) operator({)operator(|)ident(m)operator(|) ident(m)operator(.)ident(connect) stringoperator(}) - ident(test_default_setup) - reserved(end) - - reserved(def) method(test_time_recognition) - ident(n) operator(=) integer(10000) - reserved(if) constant(RunTimeTests) - constant(GC)operator(.)ident(start) - ident(rectime) operator(=) constant(Benchmark)operator(.)ident(realtime) reserved(do) - ident(n)operator(.)ident(times) reserved(do) - ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\)) - ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\)) - ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\)) - ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\)) - ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\)) - ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\)) - reserved(end) - reserved(end) - ident(puts) string - ident(per_url) operator(=) ident(rectime) operator(/) operator(()ident(n) operator(*) integer(6)operator(\)) - ident(puts) stringcontent( ms/url)delimiter(")> - ident(puts) stringcontent( url/s)char(\\n)char(\\n)delimiter(")> - reserved(end) - reserved(end) - reserved(def) method(test_time_generation) - ident(n) operator(=) integer(5000) - reserved(if) constant(RunTimeTests) - constant(GC)operator(.)ident(start) - ident(pairs) operator(=) operator([) - operator([)operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(])operator(,) - operator([)operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(])operator(,) - operator([)operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(])operator(,) - operator([)operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(])operator(,) - operator([)operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(])operator(,) - operator([)operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(])operator(,) - operator([)operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(])operator(,) - operator([)operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(])operator(,) - operator(]) - ident(p) operator(=) pre_constant(nil) - ident(gentime) operator(=) constant(Benchmark)operator(.)ident(realtime) reserved(do) - ident(n)operator(.)ident(times) reserved(do) - ident(pairs)operator(.)ident(each) operator({)operator(|)operator(()ident(a)operator(,) ident(b)operator(\))operator(|) ident(rs)operator(.)ident(generate)operator(()ident(a)operator(,) ident(b)operator(\))operator(}) - reserved(end) - reserved(end) - - ident(puts) stringcontent( urls\))delimiter(")> - ident(per_url) operator(=) ident(gentime) operator(/) operator(()ident(n) operator(*) integer(8)operator(\)) - ident(puts) stringcontent( ms/url)delimiter(")> - ident(puts) stringcontent( url/s)char(\\n)char(\\n)delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(test_route_with_colon_first) - ident(rs)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(map)operator(.)ident(connect) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) pre_constant(nil) - ident(map)operator(.)ident(connect) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - reserved(end) - reserved(end) - - reserved(def) method(test_route_generating_string_literal_in_comparison_warning) - ident(old_stderr) operator(=) global_variable($stderr) - global_variable($stderr) operator(=) constant(StringIO)operator(.)ident(new) - ident(rs)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(map)operator(.)ident(connect) stringoperator(,) symbol(:controller) operator(=)operator(>) string - reserved(end) - ident(assert_equal) stringoperator(,) global_variable($stderr)operator(.)ident(string) - reserved(ensure) - global_variable($stderr) operator(=) ident(old_stderr) - reserved(end) - - reserved(def) method(test_route_with_regexp_for_controller) - ident(rs)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(map)operator(.)ident(connect) stringoperator(,) symbol(:controller) operator(=)operator(>) regexp - ident(map)operator(.)ident(connect) string - reserved(end) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(UserController)operator(,) symbol(:admintoken) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(.)ident(stringify_keys)operator(,) - ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) operator(::)constant(ContentController)operator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(.)ident(stringify_keys)operator(,) - ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:admintoken) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)stringoperator(,)operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_basic_named_route) - ident(rs)operator(.)ident(home) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - ident(x) operator(=) ident(setup_for_named_route) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) - ident(x)operator(.)ident(new)operator(.)ident(send)operator(()symbol(:home_url)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_named_route_with_option) - ident(rs)operator(.)ident(page) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - ident(x) operator(=) ident(setup_for_named_route) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:title) operator(=)operator(>) stringoperator(})operator(,) - ident(x)operator(.)ident(new)operator(.)ident(send)operator(()symbol(:page_url)operator(,) symbol(:title) operator(=)operator(>) stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_named_route_with_default) - ident(rs)operator(.)ident(page) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:title) operator(=)operator(>) string - ident(x) operator(=) ident(setup_for_named_route) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:title) operator(=)operator(>) stringoperator(})operator(,) - ident(x)operator(.)ident(new)operator(.)ident(send)operator(()symbol(:page_url)operator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:title) operator(=)operator(>) stringoperator(})operator(,) - ident(x)operator(.)ident(new)operator(.)ident(send)operator(()symbol(:page_url)operator(,) symbol(:title) operator(=)operator(>) stringoperator(\))operator(\)) - - reserved(end) - - reserved(def) method(setup_for_named_route) - ident(x) operator(=) constant(Class)operator(.)ident(new) - ident(x)operator(.)ident(send)operator(()symbol(:define_method)operator(,) symbol(:url_for)operator(\)) operator({)operator(|)ident(x)operator(|) ident(x)operator(}) - ident(x)operator(.)ident(send) symbol(:include)operator(,) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(NamedRoutes) - ident(x) - reserved(end) - - reserved(def) method(test_named_route_without_hash) - ident(rs)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(rs)operator(.)ident(normal) string - reserved(end) - reserved(end) - - reserved(def) method(test_named_route_with_regexps) - ident(rs)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(rs)operator(.)ident(article) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) - symbol(:year) operator(=)operator(>) regexpoperator(,) symbol(:month) operator(=)operator(>) regexpoperator(,) symbol(:day) operator(=)operator(>) regexp - ident(rs)operator(.)ident(connect) string - reserved(end) - ident(x) operator(=) ident(setup_for_named_route) - ident(assert_equal)operator(() - operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:title) operator(=)operator(>) stringoperator(})operator(,) - ident(x)operator(.)ident(new)operator(.)ident(send)operator(()symbol(:article_url)operator(,) symbol(:title) operator(=)operator(>) stringoperator(\)) - operator(\)) - ident(assert_equal)operator(() - operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:title) operator(=)operator(>) stringoperator(,) symbol(:day) operator(=)operator(>) integer(10)operator(,) symbol(:year) operator(=)operator(>) integer(2005)operator(,) symbol(:month) operator(=)operator(>) integer(6)operator(})operator(,) - ident(x)operator(.)ident(new)operator(.)ident(send)operator(()symbol(:article_url)operator(,) symbol(:title) operator(=)operator(>) stringoperator(,) symbol(:day) operator(=)operator(>) integer(10)operator(,) symbol(:year) operator(=)operator(>) integer(2005)operator(,) symbol(:month) operator(=)operator(>) integer(6)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_changing_controller) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(() - operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(10)operator(})operator(,) - operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(}) - operator(\)) - reserved(end) - - reserved(def) method(test_paths_escaped) - ident(rs)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(rs)operator(.)ident(path) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - ident(rs)operator(.)ident(connect) string - reserved(end) - ident(results) operator(=) ident(rs)operator(.)ident(recognize_path) string - ident(assert) ident(results)operator(,) string - ident(assert_equal) operator([)stringoperator(,) stringoperator(])operator(,) ident(results)operator([)stringoperator(]) - - ident(results) operator(=) ident(rs)operator(.)ident(recognize_path) string - ident(assert) ident(results)operator(,) string - ident(assert_equal) operator([)operator(])operator(,) ident(results)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_non_controllers_cannot_be_matched) - ident(rs)operator(.)ident(draw) reserved(do) - ident(rs)operator(.)ident(connect) string - reserved(end) - ident(assert_nil) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(,) string - reserved(end) - - reserved(def) method(test_paths_do_not_accept_defaults) - ident(assert_raises)operator(()constant(ActionController)operator(::)constant(RoutingError)operator(\)) reserved(do) - ident(rs)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(rs)operator(.)ident(path) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:path) operator(=)operator(>) string - ident(rs)operator(.)ident(connect) string - reserved(end) - reserved(end) - - ident(rs)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(rs)operator(.)ident(path) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:path) operator(=)operator(>) operator([)operator(]) - ident(rs)operator(.)ident(connect) string - reserved(end) - reserved(end) - - reserved(def) method(test_backwards) - ident(rs)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(rs)operator(.)ident(connect) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - ident(rs)operator(.)ident(connect) string - reserved(end) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:id) operator(=)operator(>) integer(20)operator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(20)operator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_route_with_fixnum_default) - ident(rs)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(rs)operator(.)ident(connect) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(1) - ident(rs)operator(.)ident(connect) string - reserved(end) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(1)operator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(10)operator(\)) - - ident(ctrl) operator(=) operator(::)constant(ContentController) - - ident(assert_equal)operator(()operator({)string operator(=)operator(>) ident(ctrl)operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) integer(1)operator(})operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)string operator(=)operator(>) ident(ctrl)operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)string operator(=)operator(>) ident(ctrl)operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_action_expiry) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - reserved(end) - - reserved(def) method(test_recognition_with_uppercase_controller_name) - ident(assert_equal)operator(()operator({)string operator(=)operator(>) operator(::)constant(ContentController)operator(,) string operator(=)operator(>) stringoperator(})operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)string operator(=)operator(>) operator(::)constant(ContentController)operator(,) string operator(=)operator(>) stringoperator(})operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)string operator(=)operator(>) operator(::)constant(ContentController)operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - - ident(assert_equal)operator(()operator({)string operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(NewsFeedController)operator(,) string operator(=)operator(>) stringoperator(})operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)string operator(=)operator(>) operator(::)constant(Admin)operator(::)constant(NewsFeedController)operator(,) string operator(=)operator(>) stringoperator(})operator(,) ident(rs)operator(.)ident(recognize_path)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_both_requirement_and_optional) - ident(rs)operator(.)ident(draw) reserved(do) - ident(rs)operator(.)ident(blog)operator(()stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) - symbol(:defaults) operator(=)operator(>) operator({) symbol(:year) operator(=)operator(>) pre_constant(nil) operator(})operator(,) - symbol(:requirements) operator(=)operator(>) operator({) symbol(:year) operator(=)operator(>) regexp operator(}) - operator(\)) - ident(rs)operator(.)ident(connect) string - reserved(end) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:year) operator(=)operator(>) pre_constant(nil)operator(\)) - - ident(x) operator(=) ident(setup_for_named_route) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) - ident(x)operator(.)ident(new)operator(.)ident(send)operator(()symbol(:blog_url)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_set_to_nil_forgets) - ident(rs)operator(.)ident(draw) reserved(do) - ident(rs)operator(.)ident(connect) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:month) operator(=)operator(>) pre_constant(nil)operator(,) symbol(:day) operator(=)operator(>) pre_constant(nil) - ident(rs)operator(.)ident(connect) string - reserved(end) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) - ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:year) operator(=)operator(>) integer(2005)operator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) - ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:year) operator(=)operator(>) integer(2005)operator(,) symbol(:month) operator(=)operator(>) integer(6)operator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) - ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:year) operator(=)operator(>) integer(2005)operator(,) symbol(:month) operator(=)operator(>) integer(6)operator(,) symbol(:day) operator(=)operator(>) integer(12)operator(\)) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) - ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:day) operator(=)operator(>) integer(4)operator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:year) operator(=)operator(>) stringoperator(,) symbol(:month) operator(=)operator(>) stringoperator(,) symbol(:day) operator(=)operator(>) stringoperator(})operator(\)) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) - ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:day) operator(=)operator(>) pre_constant(nil)operator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:year) operator(=)operator(>) stringoperator(,) symbol(:month) operator(=)operator(>) stringoperator(,) symbol(:day) operator(=)operator(>) stringoperator(})operator(\)) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) - ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:day) operator(=)operator(>) pre_constant(nil)operator(,) symbol(:month) operator(=)operator(>) pre_constant(nil)operator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:year) operator(=)operator(>) stringoperator(,) symbol(:month) operator(=)operator(>) stringoperator(,) symbol(:day) operator(=)operator(>) stringoperator(})operator(\)) - reserved(end) - - reserved(def) method(test_url_with_no_action_specified) - ident(rs)operator(.)ident(draw) reserved(do) - ident(rs)operator(.)ident(connect) stringoperator(,) symbol(:controller) operator(=)operator(>) string - ident(rs)operator(.)ident(connect) string - reserved(end) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_named_url_with_no_action_specified) - ident(rs)operator(.)ident(draw) reserved(do) - ident(rs)operator(.)ident(root) stringoperator(,) symbol(:controller) operator(=)operator(>) string - ident(rs)operator(.)ident(connect) string - reserved(end) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(\)) - - ident(x) operator(=) ident(setup_for_named_route) - ident(assert_equal)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) - ident(x)operator(.)ident(new)operator(.)ident(send)operator(()symbol(:root_url)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_url_generated_when_forgetting_action) - operator([)operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(])operator(.)ident(each) reserved(do) operator(|)ident(hash)operator(|) - ident(rs)operator(.)ident(draw) reserved(do) - ident(rs)operator(.)ident(root) stringoperator(,) ident(hash) - ident(rs)operator(.)ident(connect) string - reserved(end) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:action) operator(=)operator(>) pre_constant(nil)operator(})operator(,) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_named_route_method) - ident(rs)operator(.)ident(draw) reserved(do) - ident(assert_raises)operator(()constant(ArgumentError)operator(\)) operator({) ident(rs)operator(.)ident(categories) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string operator(}) - - ident(rs)operator(.)ident(named_route) symbol(:categories)operator(,) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - ident(rs)operator(.)ident(connect) string - reserved(end) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - reserved(end) - - reserved(def) method(test_named_route_helper_array) - ident(test_named_route_method) - ident(assert_equal) operator([)symbol(:categories_url)operator(,) symbol(:hash_for_categories_url)operator(])operator(,) operator(::)constant(ActionController)operator(::)constant(Routing)operator(::)constant(NamedRoutes)operator(::)constant(Helpers) - reserved(end) - - reserved(def) method(test_nil_defaults) - ident(rs)operator(.)ident(draw) reserved(do) - ident(rs)operator(.)ident(connect) stringoperator(,) - symbol(:controller) operator(=)operator(>) stringoperator(,) - symbol(:action) operator(=)operator(>) stringoperator(,) - symbol(:date) operator(=)operator(>) pre_constant(nil)operator(,) symbol(:user_id) operator(=)operator(>) pre_constant(nil) - ident(rs)operator(.)ident(connect) string - reserved(end) - - ident(assert_equal) operator([)stringoperator(,) operator([)operator(])operator(])operator(,) ident(rs)operator(.)ident(generate)operator(()symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:date) operator(=)operator(>) pre_constant(nil)operator(,) symbol(:user_id) operator(=)operator(>) pre_constant(nil)operator(\)) - reserved(end) -reserved(end) - -reserved(class) class(ControllerComponentTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - - reserved(def) method(test_traverse_to_controller_should_not_load_arbitrary_files) - ident(load_path) operator(=) global_variable($:)operator(.)ident(dup) - ident(base) operator(=) constant(File)operator(.)ident(dirname)operator(()constant(File)operator(.)ident(dirname)operator(()constant(File)operator(.)ident(expand_path)operator(()pre_constant(__FILE__)operator(\))operator(\))operator(\)) - global_variable($:) operator(<<) constant(File)operator(.)ident(join)operator(()ident(base)operator(,) stringoperator(\)) - constant(Object)operator(.)ident(send) symbol(:const_set)operator(,) symbol(:RAILS_ROOT)operator(,) constant(File)operator(.)ident(join)operator(()ident(base)operator(,) stringoperator(\)) - ident(assert_equal) pre_constant(nil)operator(,) constant(ActionController)operator(::)constant(Routing)operator(::)constant(ControllerComponent)operator(.)ident(traverse_to_controller)operator(()stringoperator(\)) - reserved(ensure) - global_variable($:)operator([)integer(0)operator(..)integer(-1)operator(]) operator(=) ident(load_path) - constant(Object)operator(.)ident(send) symbol(:remove_const)operator(,) symbol(:RAILS_ROOT) - reserved(end) - - reserved(def) method(test_traverse_should_not_trip_on_non_module_constants) - ident(assert_equal) pre_constant(nil)operator(,) constant(ActionController)operator(::)constant(Routing)operator(::)constant(ControllerComponent)operator(.)ident(traverse_to_controller)operator(()stringoperator(\)) - reserved(end) - - comment(# This is evil, but people do it.) - reserved(def) method(test_traverse_to_controller_should_pass_thru_classes) - ident(load_path) operator(=) global_variable($:)operator(.)ident(dup) - ident(base) operator(=) constant(File)operator(.)ident(dirname)operator(()constant(File)operator(.)ident(dirname)operator(()constant(File)operator(.)ident(expand_path)operator(()pre_constant(__FILE__)operator(\))operator(\))operator(\)) - global_variable($:) operator(<<) constant(File)operator(.)ident(join)operator(()ident(base)operator(,) stringoperator(\)) - global_variable($:) operator(<<) constant(File)operator(.)ident(join)operator(()ident(base)operator(,) stringoperator(\)) - global_variable($:) operator(<<) constant(File)operator(.)ident(join)operator(()ident(base)operator(,) stringoperator(\)) - constant(Object)operator(.)ident(send) symbol(:const_set)operator(,) symbol(:RAILS_ROOT)operator(,) constant(File)operator(.)ident(join)operator(()ident(base)operator(,) stringoperator(\)) - ident(pair) operator(=) constant(ActionController)operator(::)constant(Routing)operator(::)constant(ControllerComponent)operator(.)ident(traverse_to_controller)operator(()stringoperator(\)) - - comment(# Make sure the container class was loaded properly) - ident(assert) reserved(defined?)operator(()constant(AClassThatContainsAController)operator(\)) - ident(assert_kind_of) constant(Class)operator(,) constant(AClassThatContainsAController) - ident(assert_equal) symbol(:you_know_it)operator(,) constant(AClassThatContainsAController)operator(.)ident(is_special?) - - comment(# Make sure the controller was too) - ident(assert_kind_of) constant(Array)operator(,) ident(pair) - ident(assert_equal) integer(2)operator(,) ident(pair)operator([)integer(1)operator(]) - ident(klass) operator(=) ident(pair)operator(.)ident(first) - ident(assert_kind_of) constant(Class)operator(,) ident(klass) - ident(assert_equal) symbol(:decidedly_so)operator(,) ident(klass)operator(.)ident(is_evil?) - ident(assert) ident(klass)operator(.)ident(ancestors)operator(.)ident(include?)operator(()constant(ActionController)operator(::)constant(Base)operator(\)) - ident(assert) reserved(defined?)operator(()constant(AClassThatContainsAController)operator(::)constant(PoorlyPlacedController)operator(\)) - ident(assert_equal) ident(klass)operator(,) constant(AClassThatContainsAController)operator(::)constant(PoorlyPlacedController) - reserved(ensure) - global_variable($:)operator([)integer(0)operator(..)integer(-1)operator(]) operator(=) ident(load_path) - constant(Object)operator(.)ident(send) symbol(:remove_const)operator(,) symbol(:RAILS_ROOT) - reserved(end) - - reserved(def) method(test_traverse_to_nested_controller) - ident(load_path) operator(=) global_variable($:)operator(.)ident(dup) - ident(base) operator(=) constant(File)operator(.)ident(dirname)operator(()constant(File)operator(.)ident(dirname)operator(()constant(File)operator(.)ident(expand_path)operator(()pre_constant(__FILE__)operator(\))operator(\))operator(\)) - global_variable($:) operator(<<) constant(File)operator(.)ident(join)operator(()ident(base)operator(,) stringoperator(\)) - global_variable($:) operator(<<) constant(File)operator(.)ident(join)operator(()ident(base)operator(,) stringoperator(\)) - constant(Object)operator(.)ident(send) symbol(:const_set)operator(,) symbol(:RAILS_ROOT)operator(,) constant(File)operator(.)ident(join)operator(()ident(base)operator(,) stringoperator(\)) - ident(pair) operator(=) constant(ActionController)operator(::)constant(Routing)operator(::)constant(ControllerComponent)operator(.)ident(traverse_to_controller)operator(()stringoperator(\)) - - ident(assert_not_equal) pre_constant(nil)operator(,) ident(pair) - - comment(# Make sure that we created a module for the dir) - ident(assert) reserved(defined?)operator(()constant(ModuleThatHoldsControllers)operator(\)) - ident(assert_kind_of) constant(Module)operator(,) constant(ModuleThatHoldsControllers) - - comment(# Make sure the controller is ok) - ident(assert_kind_of) constant(Array)operator(,) ident(pair) - ident(assert_equal) integer(2)operator(,) ident(pair)operator([)integer(1)operator(]) - ident(klass) operator(=) ident(pair)operator(.)ident(first) - ident(assert_kind_of) constant(Class)operator(,) ident(klass) - ident(assert) ident(klass)operator(.)ident(ancestors)operator(.)ident(include?)operator(()constant(ActionController)operator(::)constant(Base)operator(\)) - ident(assert) reserved(defined?)operator(()constant(ModuleThatHoldsControllers)operator(::)constant(NestedController)operator(\)) - ident(assert_equal) ident(klass)operator(,) constant(ModuleThatHoldsControllers)operator(::)constant(NestedController) - reserved(ensure) - global_variable($:)operator([)integer(0)operator(..)integer(-1)operator(]) operator(=) ident(load_path) - constant(Object)operator(.)ident(send) symbol(:remove_const)operator(,) symbol(:RAILS_ROOT) - reserved(end) - -reserved(end) - -reserved(end) -ident(require) constant(File)operator(.)ident(join)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(,) stringoperator(,) stringoperator(\)) - - -reserved(module) class(TestFileUtils) - reserved(def) method(file_name)operator(()operator(\)) constant(File)operator(.)ident(basename)operator(()pre_constant(__FILE__)operator(\)) reserved(end) - reserved(def) method(file_path)operator(()operator(\)) constant(File)operator(.)ident(expand_path)operator(()pre_constant(__FILE__)operator(\)) reserved(end) - reserved(def) method(file_data)operator(()operator(\)) constant(File)operator(.)ident(open)operator(()ident(file_path)operator(,) stringoperator(\)) operator({) operator(|)ident(f)operator(|) ident(f)operator(.)ident(read) operator(}) reserved(end) -reserved(end) - - -reserved(class) class(SendFileController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(include) constant(TestFileUtils) - ident(layout) string comment(# to make sure layouts don't interfere) - - ident(attr_writer) symbol(:options) - reserved(def) method(options)operator(()operator(\)) instance_variable(@options) operator(||=) operator({)operator(}) reserved(end) - - reserved(def) method(file)operator(()operator(\)) ident(send_file)operator(()ident(file_path)operator(,) ident(options)operator(\)) reserved(end) - reserved(def) method(data)operator(()operator(\)) ident(send_data)operator(()ident(file_data)operator(,) ident(options)operator(\)) reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) -reserved(end) - -constant(SendFileController)operator(.)ident(template_root) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(SendFileTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(TestFileUtils) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(SendFileController)operator(.)ident(new) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_file_nostream) - instance_variable(@controller)operator(.)ident(options) operator(=) operator({) symbol(:stream) operator(=)operator(>) pre_constant(false) operator(}) - ident(response) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(response) operator(=) ident(process)operator(()stringoperator(\)) operator(}) - ident(assert_not_nil) ident(response) - ident(assert_kind_of) constant(String)operator(,) ident(response)operator(.)ident(body) - ident(assert_equal) ident(file_data)operator(,) ident(response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_file_stream) - ident(response) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(response) operator(=) ident(process)operator(()stringoperator(\)) operator(}) - ident(assert_not_nil) ident(response) - ident(assert_kind_of) constant(Proc)operator(,) ident(response)operator(.)ident(body) - - ident(require) string - ident(output) operator(=) constant(StringIO)operator(.)ident(new) - ident(output)operator(.)ident(binmode) - ident(assert_nothing_raised) operator({) ident(response)operator(.)ident(body)operator(.)ident(call)operator(()ident(response)operator(,) ident(output)operator(\)) operator(}) - ident(assert_equal) ident(file_data)operator(,) ident(output)operator(.)ident(string) - reserved(end) - - reserved(def) method(test_data) - ident(response) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(response) operator(=) ident(process)operator(()stringoperator(\)) operator(}) - ident(assert_not_nil) ident(response) - - ident(assert_kind_of) constant(String)operator(,) ident(response)operator(.)ident(body) - ident(assert_equal) ident(file_data)operator(,) ident(response)operator(.)ident(body) - reserved(end) - - comment(# Test that send_file_headers! is setting the correct HTTP headers.) - reserved(def) method(test_send_file_headers!) - ident(options) operator(=) operator({) - symbol(:length) operator(=)operator(>) integer(1)operator(,) - symbol(:type) operator(=)operator(>) stringoperator(,) - symbol(:disposition) operator(=)operator(>) stringoperator(,) - symbol(:filename) operator(=)operator(>) string - operator(}) - - comment(# Do it a few times: the resulting headers should be identical) - comment(# no matter how many times you send with the same options.) - comment(# Test resolving Ticket #458.) - instance_variable(@controller)operator(.)ident(headers) operator(=) operator({)operator(}) - instance_variable(@controller)operator(.)ident(send)operator(()symbol(:send_file_headers!)operator(,) ident(options)operator(\)) - instance_variable(@controller)operator(.)ident(send)operator(()symbol(:send_file_headers!)operator(,) ident(options)operator(\)) - instance_variable(@controller)operator(.)ident(send)operator(()symbol(:send_file_headers!)operator(,) ident(options)operator(\)) - - ident(h) operator(=) instance_variable(@controller)operator(.)ident(headers) - ident(assert_equal) integer(1)operator(,) ident(h)operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) ident(h)operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) ident(h)operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) ident(h)operator([)stringoperator(]) - - comment(# test overriding Cache-Control: no-cache header to fix IE open/save dialog) - instance_variable(@controller)operator(.)ident(headers) operator(=) operator({) string operator(=)operator(>) string operator(}) - instance_variable(@controller)operator(.)ident(send)operator(()symbol(:send_file_headers!)operator(,) ident(options)operator(\)) - ident(h) operator(=) instance_variable(@controller)operator(.)ident(headers) - ident(assert_equal) stringoperator(,) ident(h)operator([)stringoperator(]) - reserved(end) - - stringoperator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - ident(define_method) stringcontent(_status)delimiter(")> reserved(do) - instance_variable(@controller)operator(.)ident(options) operator(=) operator({) symbol(:stream) operator(=)operator(>) pre_constant(false)operator(,) symbol(:status) operator(=)operator(>) integer(500) operator(}) - ident(assert_nothing_raised) operator({) ident(assert_not_nil) ident(process)operator(()ident(method)operator(\)) operator(}) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(headers)operator([)stringoperator(]) - reserved(end) - - ident(define_method) stringcontent(_status)delimiter(")> reserved(do) - instance_variable(@controller)operator(.)ident(options) operator(=) operator({) symbol(:stream) operator(=)operator(>) pre_constant(false) operator(}) - ident(assert_nothing_raised) operator({) ident(assert_not_nil) ident(process)operator(()ident(method)operator(\)) operator(}) - ident(assert_equal) constant(ActionController)operator(::)constant(Base)operator(::)constant(DEFAULT_RENDER_STATUS_CODE)operator(,) instance_variable(@controller)operator(.)ident(headers)operator([)stringoperator(]) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(SessionManagementTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(class) class(SessionOffController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(session) symbol(:off) - - reserved(def) method(show) - ident(render_text) string - reserved(end) - - reserved(def) method(tell) - ident(render_text) string - reserved(end) - reserved(end) - - reserved(class) class(TestController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(session) symbol(:off)operator(,) symbol(:only) operator(=)operator(>) symbol(:show) - ident(session) symbol(:session_secure) operator(=)operator(>) pre_constant(true)operator(,) symbol(:except) operator(=)operator(>) symbol(:show) - ident(session) symbol(:off)operator(,) symbol(:only) operator(=)operator(>) symbol(:conditional)operator(,) - symbol(:if) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(r)operator(|) ident(r)operator(.)ident(parameters)operator([)symbol(:ws)operator(]) operator(}) - - reserved(def) method(show) - ident(render_text) string - reserved(end) - - reserved(def) method(tell) - ident(render_text) string - reserved(end) - - reserved(def) method(conditional) - ident(render_text) string>>)inlinecontent(<<<)delimiter(")> - reserved(end) - reserved(end) - - reserved(class) class(SpecializedController) operator(<) constant(SessionOffController) - ident(session) symbol(:disabled) operator(=)operator(>) pre_constant(false)operator(,) symbol(:only) operator(=)operator(>) symbol(:something) - - reserved(def) method(something) - ident(render_text) string - reserved(end) - - reserved(def) method(another) - ident(render_text) string - reserved(end) - reserved(end) - - reserved(def) method(setup) - instance_variable(@request)operator(,) instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new)operator(,) - constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_session_off_globally) - instance_variable(@controller) operator(=) constant(SessionOffController)operator(.)ident(new) - ident(get) symbol(:show) - ident(assert_equal) pre_constant(false)operator(,) instance_variable(@request)operator(.)ident(session_options) - ident(get) symbol(:tell) - ident(assert_equal) pre_constant(false)operator(,) instance_variable(@request)operator(.)ident(session_options) - reserved(end) - - reserved(def) method(test_session_off_conditionally) - instance_variable(@controller) operator(=) constant(TestController)operator(.)ident(new) - ident(get) symbol(:show) - ident(assert_equal) pre_constant(false)operator(,) instance_variable(@request)operator(.)ident(session_options) - ident(get) symbol(:tell) - ident(assert_instance_of) constant(Hash)operator(,) instance_variable(@request)operator(.)ident(session_options) - ident(assert) instance_variable(@request)operator(.)ident(session_options)operator([)symbol(:session_secure)operator(]) - reserved(end) - - reserved(def) method(test_controller_specialization_overrides_settings) - instance_variable(@controller) operator(=) constant(SpecializedController)operator(.)ident(new) - ident(get) symbol(:something) - ident(assert_instance_of) constant(Hash)operator(,) instance_variable(@request)operator(.)ident(session_options) - ident(get) symbol(:another) - ident(assert_equal) pre_constant(false)operator(,) instance_variable(@request)operator(.)ident(session_options) - reserved(end) - - reserved(def) method(test_session_off_with_if) - instance_variable(@controller) operator(=) constant(TestController)operator(.)ident(new) - ident(get) symbol(:conditional) - ident(assert_instance_of) constant(Hash)operator(,) instance_variable(@request)operator(.)ident(session_options) - ident(get) symbol(:conditional)operator(,) symbol(:ws) operator(=)operator(>) string - ident(assert_equal) pre_constant(false)operator(,) instance_variable(@request)operator(.)ident(session_options) - reserved(end) - - reserved(def) method(test_session_store_setting) - constant(ActionController)operator(::)constant(Base)operator(.)ident(session_store) operator(=) symbol(:drb_store) - ident(assert_equal) constant(CGI)operator(::)constant(Session)operator(::)constant(DRbStore)operator(,) constant(ActionController)operator(::)constant(Base)operator(.)ident(session_store) - - reserved(if) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:ActiveRecord)operator(\)) - constant(ActionController)operator(::)constant(Base)operator(.)ident(session_store) operator(=) symbol(:active_record_store) - ident(assert_equal) constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(,) constant(ActionController)operator(::)constant(Base)operator(.)ident(session_store) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(TestTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(class) class(TestController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(set_flash) - ident(flash)operator([)stringoperator(]) operator(=) string)inlineoperator(])inline_delimiter(})>content(<)delimiter(")> - ident(render) symbol(:text) operator(=)operator(>) string - reserved(end) - - reserved(def) method(render_raw_post) - ident(raise) constant(Test)operator(::)constant(Unit)operator(::)constant(AssertionFailedError)operator(,) string reserved(if) ident(request)operator(.)ident(raw_post)operator(.)ident(blank?) - ident(render) symbol(:text) operator(=)operator(>) ident(request)operator(.)ident(raw_post) - reserved(end) - - reserved(def) method(test_params) - ident(render) symbol(:text) operator(=)operator(>) ident(params)operator(.)ident(inspect) - reserved(end) - - reserved(def) method(test_uri) - ident(render) symbol(:text) operator(=)operator(>) ident(request)operator(.)ident(request_uri) - reserved(end) - - reserved(def) method(test_html_output) - ident(render) symbol(:text) operator(=)operator(>) stringstring - - -
-
    -
  • hello
  • -
  • goodbye
  • -
-
-
-
- Name: -
-
- -)delimiter( -HTML)> - reserved(end) - - reserved(def) method(test_only_one_param) - ident(render) symbol(:text) operator(=)operator(>) operator(()ident(params)operator([)symbol(:left)operator(]) operator(&&) ident(params)operator([)symbol(:right)operator(])operator(\)) operator(?) string operator(:) string - reserved(end) - - reserved(def) method(test_remote_addr) - ident(render) symbol(:text) operator(=)operator(>) operator(()ident(request)operator(.)ident(remote_addr) operator(||) stringoperator(\)) - reserved(end) - - reserved(def) method(test_file_upload) - ident(render) symbol(:text) operator(=)operator(>) ident(params)operator([)symbol(:file)operator(])operator(.)ident(size) - reserved(end) - - reserved(def) method(redirect_to_symbol) - ident(redirect_to) symbol(:generate_url)operator(,) symbol(:id) operator(=)operator(>) integer(5) - reserved(end) - - ident(private) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) - ident(raise) ident(e) - reserved(end) - - reserved(def) method(generate_url)operator(()ident(opts)operator(\)) - ident(url_for)operator(()ident(opts)operator(.)ident(merge)operator(()symbol(:action) operator(=)operator(>) stringoperator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(TestController)operator(.)ident(new) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(reload) - reserved(end) - - reserved(def) method(teardown) - constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(reload) - reserved(end) - - reserved(def) method(test_raw_post_handling) - ident(params) operator(=) operator({)symbol(:page) operator(=)operator(>) operator({)symbol(:name) operator(=)operator(>) stringoperator(})operator(,) string operator(=)operator(>) integer(123)operator(}) - ident(get) symbol(:render_raw_post)operator(,) ident(params)operator(.)ident(dup) - - ident(raw_post) operator(=) ident(params)operator(.)ident(map) operator({)operator(|)ident(k)operator(,)ident(v)operator(|) operator([)constant(CGI)operator(::)ident(escape)operator(()ident(k)operator(.)ident(to_s)operator(\))operator(,) constant(CGI)operator(::)ident(escape)operator(()ident(v)operator(.)ident(to_s)operator(\))operator(])operator(.)ident(join)operator(()stringoperator(\))operator(})operator(.)ident(sort)operator(.)ident(join)operator(()stringoperator(\)) - ident(assert_equal) ident(raw_post)operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_process_without_flash) - ident(process) symbol(:set_flash) - ident(assert_equal) string<)delimiter(')>operator(,) ident(flash)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_process_with_flash) - ident(process) symbol(:set_flash)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) operator({) string operator(=)operator(>) string operator(}) - ident(assert_equal) stringvalue<)delimiter(')>operator(,) ident(flash)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_process_with_request_uri_with_no_params) - ident(process) symbol(:test_uri) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_process_with_request_uri_with_params) - ident(process) symbol(:test_uri)operator(,) symbol(:id) operator(=)operator(>) integer(7) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_process_with_request_uri_with_params_with_explicit_uri) - instance_variable(@request)operator(.)ident(set_REQUEST_URI) string - ident(process) symbol(:test_uri)operator(,) symbol(:id) operator(=)operator(>) integer(7) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_multiple_calls) - ident(process) symbol(:test_only_one_param)operator(,) symbol(:left) operator(=)operator(>) pre_constant(true) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - ident(process) symbol(:test_only_one_param)operator(,) symbol(:right) operator(=)operator(>) pre_constant(true) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_assert_tag_tag) - ident(process) symbol(:test_html_output) - - comment(# there is a 'form' tag) - ident(assert_tag) symbol(:tag) operator(=)operator(>) string - comment(# there is not an 'hr' tag) - ident(assert_no_tag) symbol(:tag) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_assert_tag_attributes) - ident(process) symbol(:test_html_output) - - comment(# there is a tag with an 'id' of 'bar') - ident(assert_tag) symbol(:attributes) operator(=)operator(>) operator({) symbol(:id) operator(=)operator(>) string operator(}) - comment(# there is no tag with a 'name' of 'baz') - ident(assert_no_tag) symbol(:attributes) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_parent) - ident(process) symbol(:test_html_output) - - comment(# there is a tag with a parent 'form' tag) - ident(assert_tag) symbol(:parent) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) - comment(# there is no tag with a parent of 'input') - ident(assert_no_tag) symbol(:parent) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_child) - ident(process) symbol(:test_html_output) - - comment(# there is a tag with a child 'input' tag) - ident(assert_tag) symbol(:child) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) - comment(# there is no tag with a child 'strong' tag) - ident(assert_no_tag) symbol(:child) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_ancestor) - ident(process) symbol(:test_html_output) - - comment(# there is a 'li' tag with an ancestor having an id of 'foo') - ident(assert_tag) symbol(:ancestor) operator(=)operator(>) operator({) symbol(:attributes) operator(=)operator(>) operator({) symbol(:id) operator(=)operator(>) string operator(}) operator(})operator(,) symbol(:tag) operator(=)operator(>) string - comment(# there is no tag of any kind with an ancestor having an href matching 'foo') - ident(assert_no_tag) symbol(:ancestor) operator(=)operator(>) operator({) symbol(:attributes) operator(=)operator(>) operator({) symbol(:href) operator(=)operator(>) regexp operator(}) operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_descendant) - ident(process) symbol(:test_html_output) - - comment(# there is a tag with a decendant 'li' tag) - ident(assert_tag) symbol(:descendant) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) - comment(# there is no tag with a descendant 'html' tag) - ident(assert_no_tag) symbol(:descendant) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_sibling) - ident(process) symbol(:test_html_output) - - comment(# there is a tag with a sibling of class 'item') - ident(assert_tag) symbol(:sibling) operator(=)operator(>) operator({) symbol(:attributes) operator(=)operator(>) operator({) symbol(:class) operator(=)operator(>) string operator(}) operator(}) - comment(# there is no tag with a sibling 'ul' tag) - ident(assert_no_tag) symbol(:sibling) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_after) - ident(process) symbol(:test_html_output) - - comment(# there is a tag following a sibling 'div' tag) - ident(assert_tag) symbol(:after) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) - comment(# there is no tag following a sibling tag with id 'bar') - ident(assert_no_tag) symbol(:after) operator(=)operator(>) operator({) symbol(:attributes) operator(=)operator(>) operator({) symbol(:id) operator(=)operator(>) string operator(}) operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_before) - ident(process) symbol(:test_html_output) - - comment(# there is a tag preceeding a tag with id 'bar') - ident(assert_tag) symbol(:before) operator(=)operator(>) operator({) symbol(:attributes) operator(=)operator(>) operator({) symbol(:id) operator(=)operator(>) string operator(}) operator(}) - comment(# there is no tag preceeding a 'form' tag) - ident(assert_no_tag) symbol(:before) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_children_count) - ident(process) symbol(:test_html_output) - - comment(# there is a tag with 2 children) - ident(assert_tag) symbol(:children) operator(=)operator(>) operator({) symbol(:count) operator(=)operator(>) integer(2) operator(}) - comment(# there is no tag with 4 children) - ident(assert_no_tag) symbol(:children) operator(=)operator(>) operator({) symbol(:count) operator(=)operator(>) integer(4) operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_children_less_than) - ident(process) symbol(:test_html_output) - - comment(# there is a tag with less than 5 children) - ident(assert_tag) symbol(:children) operator(=)operator(>) operator({) symbol(:less_than) operator(=)operator(>) integer(5) operator(}) - comment(# there is no 'ul' tag with less than 2 children) - ident(assert_no_tag) symbol(:children) operator(=)operator(>) operator({) symbol(:less_than) operator(=)operator(>) integer(2) operator(})operator(,) symbol(:tag) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_assert_tag_children_greater_than) - ident(process) symbol(:test_html_output) - - comment(# there is a 'body' tag with more than 1 children) - ident(assert_tag) symbol(:children) operator(=)operator(>) operator({) symbol(:greater_than) operator(=)operator(>) integer(1) operator(})operator(,) symbol(:tag) operator(=)operator(>) string - comment(# there is no tag with more than 10 children) - ident(assert_no_tag) symbol(:children) operator(=)operator(>) operator({) symbol(:greater_than) operator(=)operator(>) integer(10) operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_children_only) - ident(process) symbol(:test_html_output) - - comment(# there is a tag containing only one child with an id of 'foo') - ident(assert_tag) symbol(:children) operator(=)operator(>) operator({) symbol(:count) operator(=)operator(>) integer(1)operator(,) - symbol(:only) operator(=)operator(>) operator({) symbol(:attributes) operator(=)operator(>) operator({) symbol(:id) operator(=)operator(>) string operator(}) operator(}) operator(}) - comment(# there is no tag containing only one 'li' child) - ident(assert_no_tag) symbol(:children) operator(=)operator(>) operator({) symbol(:count) operator(=)operator(>) integer(1)operator(,) symbol(:only) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_content) - ident(process) symbol(:test_html_output) - - comment(# the output contains the string "Name") - ident(assert_tag) symbol(:content) operator(=)operator(>) string - comment(# the output does not contain the string "test") - ident(assert_no_tag) symbol(:content) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_assert_tag_multiple) - ident(process) symbol(:test_html_output) - - comment(# there is a 'div', id='bar', with an immediate child whose 'action') - comment(# attribute matches the regexp /somewhere/.) - ident(assert_tag) symbol(:tag) operator(=)operator(>) stringoperator(,) symbol(:attributes) operator(=)operator(>) operator({) symbol(:id) operator(=)operator(>) string operator(})operator(,) - symbol(:child) operator(=)operator(>) operator({) symbol(:attributes) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) regexp operator(}) operator(}) - - comment(# there is no 'div', id='foo', with a 'ul' child with more than) - comment(# 2 "li" children.) - ident(assert_no_tag) symbol(:tag) operator(=)operator(>) stringoperator(,) symbol(:attributes) operator(=)operator(>) operator({) symbol(:id) operator(=)operator(>) string operator(})operator(,) - symbol(:child) operator(=)operator(>) operator({) - symbol(:tag) operator(=)operator(>) stringoperator(,) - symbol(:children) operator(=)operator(>) operator({) symbol(:greater_than) operator(=)operator(>) integer(2)operator(,) - symbol(:only) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) operator(}) operator(}) - reserved(end) - - reserved(def) method(test_assert_tag_children_without_content) - ident(process) symbol(:test_html_output) - - comment(# there is a form tag with an 'input' child which is a self closing tag) - ident(assert_tag) symbol(:tag) operator(=)operator(>) stringoperator(,) - symbol(:children) operator(=)operator(>) operator({) symbol(:count) operator(=)operator(>) integer(1)operator(,) - symbol(:only) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) operator(}) - - comment(# the body tag has an 'a' child which in turn has an 'img' child) - ident(assert_tag) symbol(:tag) operator(=)operator(>) stringoperator(,) - symbol(:children) operator(=)operator(>) operator({) symbol(:count) operator(=)operator(>) integer(1)operator(,) - symbol(:only) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) stringoperator(,) - symbol(:children) operator(=)operator(>) operator({) symbol(:count) operator(=)operator(>) integer(1)operator(,) - symbol(:only) operator(=)operator(>) operator({) symbol(:tag) operator(=)operator(>) string operator(}) operator(}) operator(}) operator(}) - reserved(end) - - reserved(def) method(test_assert_generates) - ident(assert_generates) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_assert_routing) - ident(assert_routing) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_assert_routing_in_module) - ident(assert_routing) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_params_passing) - ident(get) symbol(:test_params)operator(,) symbol(:page) operator(=)operator(>) operator({)symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:month) operator(=)operator(>) stringoperator(,) symbol(:year) operator(=)operator(>) stringoperator(,) symbol(:day) operator(=)operator(>) stringoperator(}) - ident(parsed_params) operator(=) ident(eval)operator(()instance_variable(@response)operator(.)ident(body)operator(\)) - ident(assert_equal)operator(() - operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(})operator(,) - ident(parsed_params) - operator(\)) - reserved(end) - - reserved(def) method(test_id_converted_to_string) - ident(get) symbol(:test_params)operator(,) symbol(:id) operator(=)operator(>) integer(20)operator(,) symbol(:foo) operator(=)operator(>) constant(Object)operator(.)ident(new) - ident(assert_kind_of) constant(String)operator(,) instance_variable(@request)operator(.)ident(path_parameters)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_array_path_parameter_handled_properly) - ident(with_routing) reserved(do) operator(|)ident(set)operator(|) - ident(set)operator(.)ident(draw) reserved(do) - ident(set)operator(.)ident(connect) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) string - ident(set)operator(.)ident(connect) string - reserved(end) - - ident(get) symbol(:test_params)operator(,) symbol(:path) operator(=)operator(>) operator([)stringoperator(,) stringoperator(]) - ident(assert_equal) operator([)stringoperator(,) stringoperator(])operator(,) instance_variable(@request)operator(.)ident(path_parameters)operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) instance_variable(@request)operator(.)ident(path_parameters)operator([)stringoperator(])operator(.)ident(to_s) - reserved(end) - reserved(end) - - reserved(def) method(test_assert_realistic_path_parameters) - ident(get) symbol(:test_params)operator(,) symbol(:id) operator(=)operator(>) integer(20)operator(,) symbol(:foo) operator(=)operator(>) constant(Object)operator(.)ident(new) - - comment(# All elements of path_parameters should use string keys) - instance_variable(@request)operator(.)ident(path_parameters)operator(.)ident(keys)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(|) - ident(assert_kind_of) constant(String)operator(,) ident(key) - reserved(end) - reserved(end) - - reserved(def) method(test_with_routing_places_routes_back) - ident(assert) constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes) - ident(routes_id) operator(=) constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(object_id) - - reserved(begin) - ident(with_routing) operator({) ident(raise) string operator(}) - ident(fail) string - reserved(rescue) constant(RuntimeError) - reserved(end) - - ident(assert) constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes) - ident(assert_equal) ident(routes_id)operator(,) constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(object_id) - reserved(end) - - reserved(def) method(test_remote_addr) - ident(get) symbol(:test_remote_addr) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - - instance_variable(@request)operator(.)ident(remote_addr) operator(=) string - ident(get) symbol(:test_remote_addr) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_header_properly_reset_after_remote_http_request) - ident(xhr) symbol(:get)operator(,) symbol(:test_params) - ident(assert_nil) instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_header_properly_reset_after_get_request) - ident(get) symbol(:test_params) - instance_variable(@request)operator(.)ident(recycle!) - ident(assert_nil) instance_variable(@request)operator(.)ident(instance_variable_get)operator(()stringoperator(\)) - reserved(end) - - stringoperator(.)ident(each) reserved(do) operator(|)ident(variable)operator(|) - stringoperator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - ident(define_method)operator(()stringcontent(_missing_for_)inlinecontent(_raises_error)delimiter(")>operator(\)) reserved(do) - ident(remove_instance_variable) stringdelimiter(")> - reserved(begin) - ident(send)operator(()ident(method)operator(,) symbol(:test_remote_addr)operator(\)) - ident(assert) pre_constant(false)operator(,) string - reserved(rescue) constant(RuntimeError) operator(=)operator(>) ident(error) - ident(assert) pre_constant(true) - ident(assert_match) regexpcontent( is nil)delimiter(})>operator(,) ident(error)operator(.)ident(message) - reserved(rescue) operator(=)operator(>) ident(error) - ident(assert) pre_constant(false)operator(,) stringdelimiter(")> - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - constant(FILES_DIR) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - - reserved(def) method(test_test_uploaded_file) - ident(filename) operator(=) string - ident(path) operator(=) stringcontent(/)inlinedelimiter(")> - ident(content_type) operator(=) string - - ident(file) operator(=) constant(ActionController)operator(::)constant(TestUploadedFile)operator(.)ident(new)operator(()ident(path)operator(,) ident(content_type)operator(\)) - ident(assert_equal) ident(filename)operator(,) ident(file)operator(.)ident(original_filename) - ident(assert_equal) ident(content_type)operator(,) ident(file)operator(.)ident(content_type) - ident(assert_equal) ident(file)operator(.)ident(path)operator(,) ident(file)operator(.)ident(local_path) - ident(assert_equal) constant(File)operator(.)ident(read)operator(()ident(path)operator(\))operator(,) ident(file)operator(.)ident(read) - reserved(end) - - reserved(def) method(test_fixture_file_upload) - ident(post) symbol(:test_file_upload)operator(,) symbol(:file) operator(=)operator(>) ident(fixture_file_upload)operator(()constant(FILES_DIR) operator(+) stringoperator(,) stringoperator(\)) - ident(assert_equal) integer(159528)operator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_test_uploaded_file_exception_when_file_doesnt_exist) - ident(assert_raise)operator(()constant(RuntimeError)operator(\)) operator({) constant(ActionController)operator(::)constant(TestUploadedFile)operator(.)ident(new)operator(()stringoperator(\)) operator(}) - reserved(end) - - reserved(def) method(test_assert_redirected_to_symbol) - ident(get) symbol(:redirect_to_symbol) - ident(assert_redirected_to) symbol(:generate_url) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(UrlRewriterTests) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@params) operator(=) operator({)operator(}) - instance_variable(@rewriter) operator(=) constant(ActionController)operator(::)constant(UrlRewriter)operator(.)ident(new)operator(()instance_variable(@request)operator(,) instance_variable(@params)operator(\)) - reserved(end) - - reserved(def) method(test_simple_build_query_string) - ident(assert_query_equal) stringoperator(,) instance_variable(@rewriter)operator(.)ident(send)operator(()symbol(:build_query_string)operator(,) symbol(:x) operator(=)operator(>) stringoperator(,) symbol(:y) operator(=)operator(>) stringoperator(\)) - reserved(end) - reserved(def) method(test_convert_ints_build_query_string) - ident(assert_query_equal) stringoperator(,) instance_variable(@rewriter)operator(.)ident(send)operator(()symbol(:build_query_string)operator(,) symbol(:x) operator(=)operator(>) integer(1)operator(,) symbol(:y) operator(=)operator(>) integer(2)operator(\)) - reserved(end) - reserved(def) method(test_escape_spaces_build_query_string) - ident(assert_query_equal) stringoperator(,) instance_variable(@rewriter)operator(.)ident(send)operator(()symbol(:build_query_string)operator(,) symbol(:x) operator(=)operator(>) stringoperator(,) symbol(:y) operator(=)operator(>) stringoperator(\)) - reserved(end) - reserved(def) method(test_expand_array_build_query_string) - ident(assert_query_equal) stringoperator(,) instance_variable(@rewriter)operator(.)ident(send)operator(()symbol(:build_query_string)operator(,) symbol(:x) operator(=)operator(>) operator([)integer(1)operator(,) integer(2)operator(])operator(\)) - reserved(end) - - reserved(def) method(test_escape_spaces_build_query_string_selected_keys) - ident(assert_query_equal) stringoperator(,) instance_variable(@rewriter)operator(.)ident(send)operator(()symbol(:build_query_string)operator(,) operator({)symbol(:x) operator(=)operator(>) stringoperator(,) symbol(:y) operator(=)operator(>) stringoperator(})operator(,) operator([)symbol(:x)operator(])operator(\)) - reserved(end) - - reserved(def) method(test_overwrite_params) - instance_variable(@params)operator([)symbol(:controller)operator(]) operator(=) string - instance_variable(@params)operator([)symbol(:action)operator(]) operator(=) string - instance_variable(@params)operator([)symbol(:id)operator(]) operator(=) string - - ident(assert_equal) stringoperator(,) instance_variable(@rewriter)operator(.)ident(rewrite)operator(()symbol(:only_path) operator(=)operator(>) pre_constant(true)operator(,) symbol(:overwrite_params) operator(=)operator(>) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(u) operator(=) instance_variable(@rewriter)operator(.)ident(rewrite)operator(()symbol(:only_path) operator(=)operator(>) pre_constant(false)operator(,) symbol(:overwrite_params) operator(=)operator(>) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_match) regexpoperator(,) ident(u) - reserved(end) - - - ident(private) - reserved(def) method(split_query_string)operator(()ident(str)operator(\)) - operator([)ident(str)operator([)integer(0)operator(])operator(.)ident(chr)operator(]) operator(+) ident(str)operator([)integer(1)operator(..)integer(-1)operator(])operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(sort) - reserved(end) - - reserved(def) method(assert_query_equal)operator(()ident(q1)operator(,) ident(q2)operator(\)) - ident(assert_equal)operator(()ident(split_query_string)operator(()ident(q1)operator(\))operator(,) ident(split_query_string)operator(()ident(q2)operator(\))operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(VerificationTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(class) class(TestController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(verify) symbol(:only) operator(=)operator(>) symbol(:guarded_one)operator(,) symbol(:params) operator(=)operator(>) stringoperator(,) - symbol(:redirect_to) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(}) - - ident(verify) symbol(:only) operator(=)operator(>) symbol(:guarded_two)operator(,) symbol(:params) operator(=)operator(>) stringoperator(,) - symbol(:redirect_to) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(}) - - ident(verify) symbol(:only) operator(=)operator(>) symbol(:guarded_with_flash)operator(,) symbol(:params) operator(=)operator(>) stringoperator(,) - symbol(:add_flash) operator(=)operator(>) operator({) string operator(=)operator(>) string operator(})operator(,) - symbol(:redirect_to) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(}) - - ident(verify) symbol(:only) operator(=)operator(>) symbol(:guarded_in_session)operator(,) symbol(:session) operator(=)operator(>) stringoperator(,) - symbol(:redirect_to) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(}) - - ident(verify) symbol(:only) operator(=)operator(>) operator([)symbol(:multi_one)operator(,) symbol(:multi_two)operator(])operator(,) symbol(:session) operator(=)operator(>) stringoperator(,) - symbol(:redirect_to) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(}) - - ident(verify) symbol(:only) operator(=)operator(>) symbol(:guarded_by_method)operator(,) symbol(:method) operator(=)operator(>) symbol(:post)operator(,) - symbol(:redirect_to) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(}) - - ident(verify) symbol(:only) operator(=)operator(>) symbol(:guarded_by_xhr)operator(,) symbol(:xhr) operator(=)operator(>) pre_constant(true)operator(,) - symbol(:redirect_to) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(}) - - ident(verify) symbol(:only) operator(=)operator(>) symbol(:guarded_by_not_xhr)operator(,) symbol(:xhr) operator(=)operator(>) pre_constant(false)operator(,) - symbol(:redirect_to) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(}) - - ident(before_filter) symbol(:unconditional_redirect)operator(,) symbol(:only) operator(=)operator(>) symbol(:two_redirects) - ident(verify) symbol(:only) operator(=)operator(>) symbol(:two_redirects)operator(,) symbol(:method) operator(=)operator(>) symbol(:post)operator(,) - symbol(:redirect_to) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(}) - - ident(verify) symbol(:only) operator(=)operator(>) symbol(:must_be_post)operator(,) symbol(:method) operator(=)operator(>) symbol(:post)operator(,) symbol(:render) operator(=)operator(>) operator({) symbol(:status) operator(=)operator(>) integer(500)operator(,) symbol(:text) operator(=)operator(>) stringoperator(}) - - reserved(def) method(guarded_one) - ident(render) symbol(:text) operator(=)operator(>) stringoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(guarded_with_flash) - ident(render) symbol(:text) operator(=)operator(>) stringoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(guarded_two) - ident(render) symbol(:text) operator(=)operator(>) stringoperator(])inline_delimiter(})>content(:)inlineoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(guarded_in_session) - ident(render) symbol(:text) operator(=)operator(>) stringoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(multi_one) - ident(render) symbol(:text) operator(=)operator(>) stringoperator(])inline_delimiter(})>content(:)inlineoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(multi_two) - ident(render) symbol(:text) operator(=)operator(>) stringoperator(])inline_delimiter(})>content(:)inlineoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(guarded_by_method) - ident(render) symbol(:text) operator(=)operator(>) stringdelimiter(")> - reserved(end) - - reserved(def) method(guarded_by_xhr) - ident(render) symbol(:text) operator(=)operator(>) stringdelimiter(")> - reserved(end) - - reserved(def) method(guarded_by_not_xhr) - ident(render) symbol(:text) operator(=)operator(>) stringdelimiter(")> - reserved(end) - - reserved(def) method(unguarded) - ident(render) symbol(:text) operator(=)operator(>) stringoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(two_redirects) - ident(render) symbol(:nothing) operator(=)operator(>) pre_constant(true) - reserved(end) - - reserved(def) method(must_be_post) - ident(render) symbol(:text) operator(=)operator(>) string - reserved(end) - - ident(protected) - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) - - reserved(def) method(unconditional_redirect) - ident(redirect_to) symbol(:action) operator(=)operator(>) string - reserved(end) - reserved(end) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(TestController)operator(.)ident(new) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_guarded_one_with_prereqs) - ident(get) symbol(:guarded_one)operator(,) symbol(:one) operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_guarded_one_without_prereqs) - ident(get) symbol(:guarded_one) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_guarded_with_flash_with_prereqs) - ident(get) symbol(:guarded_with_flash)operator(,) symbol(:one) operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - ident(assert_flash_empty) - reserved(end) - - reserved(def) method(test_guarded_with_flash_without_prereqs) - ident(get) symbol(:guarded_with_flash) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - ident(assert_flash_equal) stringoperator(,) string - reserved(end) - - reserved(def) method(test_guarded_two_with_prereqs) - ident(get) symbol(:guarded_two)operator(,) symbol(:one) operator(=)operator(>) stringoperator(,) symbol(:two) operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_guarded_two_without_prereqs_one) - ident(get) symbol(:guarded_two)operator(,) symbol(:two) operator(=)operator(>) string - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_guarded_two_without_prereqs_two) - ident(get) symbol(:guarded_two)operator(,) symbol(:one) operator(=)operator(>) string - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_guarded_two_without_prereqs_both) - ident(get) symbol(:guarded_two) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_unguarded_with_params) - ident(get) symbol(:unguarded)operator(,) symbol(:one) operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_unguarded_without_params) - ident(get) symbol(:unguarded) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_guarded_in_session_with_prereqs) - ident(get) symbol(:guarded_in_session)operator(,) operator({)operator(})operator(,) string operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_guarded_in_session_without_prereqs) - ident(get) symbol(:guarded_in_session) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_multi_one_with_prereqs) - ident(get) symbol(:multi_one)operator(,) operator({)operator(})operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_multi_one_without_prereqs) - ident(get) symbol(:multi_one) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_multi_two_with_prereqs) - ident(get) symbol(:multi_two)operator(,) operator({)operator(})operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_multi_two_without_prereqs) - ident(get) symbol(:multi_two) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_guarded_by_method_with_prereqs) - ident(post) symbol(:guarded_by_method) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_guarded_by_method_without_prereqs) - ident(get) symbol(:guarded_by_method) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_guarded_by_xhr_with_prereqs) - ident(xhr) symbol(:post)operator(,) symbol(:guarded_by_xhr) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_guarded_by_xhr_without_prereqs) - ident(get) symbol(:guarded_by_xhr) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_guarded_by_not_xhr_with_prereqs) - ident(get) symbol(:guarded_by_not_xhr) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_guarded_by_not_xhr_without_prereqs) - ident(xhr) symbol(:post)operator(,) symbol(:guarded_by_not_xhr) - ident(assert_redirected_to) symbol(:action) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_guarded_post_and_calls_render_succeeds) - ident(post) symbol(:must_be_post) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_guarded_post_and_calls_render_fails) - ident(get) symbol(:must_be_post) - ident(assert_response) integer(500) - ident(assert_equal) stringoperator(,) instance_variable(@response)operator(.)ident(body) - reserved(end) - - - reserved(def) method(test_second_redirect) - ident(assert_nothing_raised) operator({) ident(get) symbol(:two_redirects) operator(}) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string - -reserved(class) class(WebServiceTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - - reserved(class) class(MockCGI) operator(<) constant(CGI) comment(#:nodoc:) - ident(attr_accessor) symbol(:stdinput)operator(,) symbol(:stdoutput)operator(,) symbol(:env_table) - - reserved(def) method(initialize)operator(()ident(env)operator(,) ident(data) operator(=) stringoperator(\)) - pre_constant(self)operator(.)ident(env_table) operator(=) ident(env) - pre_constant(self)operator(.)ident(stdinput) operator(=) constant(StringIO)operator(.)ident(new)operator(()ident(data)operator(\)) - pre_constant(self)operator(.)ident(stdoutput) operator(=) constant(StringIO)operator(.)ident(new) - reserved(super)operator(()operator(\)) - reserved(end) - reserved(end) - - - reserved(class) class(TestController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(session) symbol(:off) - - reserved(def) method(assign_parameters) - reserved(if) ident(params)operator([)symbol(:full)operator(]) - ident(render) symbol(:text) operator(=)operator(>) ident(dump_params_keys) - reserved(else) - ident(render) symbol(:text) operator(=)operator(>) operator(()ident(params)operator(.)ident(keys) operator(-) operator([)stringoperator(,) stringoperator(])operator(\))operator(.)ident(sort)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(dump_params_keys)operator(()ident(hash)operator(=)ident(params)operator(\)) - ident(hash)operator(.)ident(keys)operator(.)ident(sort)operator(.)ident(inject)operator(()stringoperator(\)) reserved(do) operator(|)ident(s)operator(,) ident(k)operator(|) - ident(value) operator(=) ident(hash)operator([)ident(k)operator(]) - ident(value) operator(=) constant(Hash) operator(===) ident(value) operator(?) stringcontent(\))delimiter(")> operator(:) string - ident(s) operator(<<) string reserved(unless) ident(s)operator(.)ident(empty?) - ident(s) operator(<<) stringinlinedelimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) reserved(end) - reserved(end) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(TestController)operator(.)ident(new) - constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator(.)ident(clear) - constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator([)constant(Mime)operator(::)constant(XML)operator(]) operator(=) symbol(:xml_node) - reserved(end) - - reserved(def) method(test_check_parameters) - ident(process)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_post_xml) - ident(process)operator(()stringoperator(,) stringoperator(,) stringcontent...)delimiter(')>operator(\)) - - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(response)operator(.)ident(body) - ident(assert) instance_variable(@controller)operator(.)ident(params)operator(.)ident(has_key?)operator(()symbol(:entry)operator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(params)operator([)stringoperator(])operator(.)ident(summary)operator(.)ident(node_value) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(params)operator([)stringoperator(])operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_put_xml) - ident(process)operator(()stringoperator(,) stringoperator(,) stringcontent...)delimiter(')>operator(\)) - - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(response)operator(.)ident(body) - ident(assert) instance_variable(@controller)operator(.)ident(params)operator(.)ident(has_key?)operator(()symbol(:entry)operator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(params)operator([)stringoperator(])operator(.)ident(summary)operator(.)ident(node_value) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(params)operator([)stringoperator(])operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_register_and_use_yaml) - constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator([)constant(Mime)operator(::)constant(YAML)operator(]) operator(=) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(d)operator(|) constant(YAML)operator(.)ident(load)operator(()ident(d)operator(\)) operator(}) - ident(process)operator(()stringoperator(,) stringoperator(,) operator({)string operator(=)operator(>) stringoperator(})operator(.)ident(to_yaml)operator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(response)operator(.)ident(body) - ident(assert) instance_variable(@controller)operator(.)ident(params)operator(.)ident(has_key?)operator(()symbol(:entry)operator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(params)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_register_and_use_yaml_as_symbol) - constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator([)constant(Mime)operator(::)constant(YAML)operator(]) operator(=) symbol(:yaml) - ident(process)operator(()stringoperator(,) stringoperator(,) operator({)string operator(=)operator(>) stringoperator(})operator(.)ident(to_yaml)operator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(response)operator(.)ident(body) - ident(assert) instance_variable(@controller)operator(.)ident(params)operator(.)ident(has_key?)operator(()symbol(:entry)operator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(params)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_register_and_use_xml_simple) - constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator([)constant(Mime)operator(::)constant(XML)operator(]) operator(=) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(data)operator(|) constant(XmlSimple)operator(.)ident(xml_in)operator(()ident(data)operator(,) string operator(=)operator(>) pre_constant(false)operator(\)) operator(}) - ident(process)operator(()stringoperator(,) stringoperator(,) stringcontent...SimpleXml)delimiter(')> operator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(response)operator(.)ident(body) - ident(assert) instance_variable(@controller)operator(.)ident(params)operator(.)ident(has_key?)operator(()symbol(:summary)operator(\)) - ident(assert) instance_variable(@controller)operator(.)ident(params)operator(.)ident(has_key?)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(params)operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(params)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_use_xml_ximple_with_empty_request) - constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator([)constant(Mime)operator(::)constant(XML)operator(]) operator(=) symbol(:xml_simple) - ident(assert_nothing_raised) operator({) ident(process)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) operator(}) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(response)operator(.)ident(body) - reserved(end) - - reserved(def) method(test_deprecated_request_methods) - ident(process)operator(()stringoperator(,) stringoperator(\)) - ident(assert_equal) constant(Mime)operator(::)constant(YAML)operator(,) instance_variable(@controller)operator(.)ident(request)operator(.)ident(content_type) - ident(assert_equal) pre_constant(true)operator(,) instance_variable(@controller)operator(.)ident(request)operator(.)ident(post?) - ident(assert_equal) symbol(:yaml)operator(,) instance_variable(@controller)operator(.)ident(request)operator(.)ident(post_format) - ident(assert_equal) pre_constant(true)operator(,) instance_variable(@controller)operator(.)ident(request)operator(.)ident(yaml_post?) - ident(assert_equal) pre_constant(false)operator(,) instance_variable(@controller)operator(.)ident(request)operator(.)ident(xml_post?) - reserved(end) - - reserved(def) method(test_dasherized_keys_as_xml) - constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator([)constant(Mime)operator(::)constant(XML)operator(]) operator(=) symbol(:xml_simple) - ident(process)operator(()stringoperator(,) stringoperator(,) string)char(\\n)content(...)char(\\n)content()delimiter(")>operator(,) pre_constant(true)operator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(response)operator(.)ident(body) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(params)operator([)symbol(:first_key)operator(])operator([)symbol(:sub_key)operator(]) - reserved(end) - - reserved(def) method(test_typecast_as_xml) - constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator([)constant(Mime)operator(::)constant(XML)operator(]) operator(=) symbol(:xml_simple) - ident(process)operator(()stringoperator(,) stringoperator(,) stringoperator(\))string - 15 - false - true - 2005-03-17 - 2005-03-17T21:41:07Z - unparsed - 1 - hello - 1974-07-25 - )delimiter( - XML)> - ident(params) operator(=) instance_variable(@controller)operator(.)ident(params) - ident(assert_equal) integer(15)operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:a)operator(]) - ident(assert_equal) pre_constant(false)operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:b)operator(]) - ident(assert_equal) pre_constant(true)operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:c)operator(]) - ident(assert_equal) constant(Date)operator(.)ident(new)operator(()integer(2005)operator(,)integer(3)operator(,)integer(17)operator(\))operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:d)operator(]) - ident(assert_equal) constant(Time)operator(.)ident(utc)operator(()integer(2005)operator(,)integer(3)operator(,)integer(17)operator(,)integer(21)operator(,)integer(41)operator(,)integer(7)operator(\))operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:e)operator(]) - ident(assert_equal) stringoperator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:f)operator(]) - ident(assert_equal) operator([)integer(1)operator(,) stringoperator(,) constant(Date)operator(.)ident(new)operator(()integer(1974)operator(,)integer(7)operator(,)integer(25)operator(\))operator(])operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:g)operator(]) - reserved(end) - - reserved(def) method(test_entities_unescaped_as_xml_simple) - constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator([)constant(Mime)operator(::)constant(XML)operator(]) operator(=) symbol(:xml_simple) - ident(process)operator(()stringoperator(,) stringoperator(,) stringoperator(\))string<foo "bar's" & friends>)delimiter( - XML)> - ident(assert_equal) string)delimiter(\))>operator(,) instance_variable(@controller)operator(.)ident(params)operator([)symbol(:data)operator(]) - reserved(end) - - reserved(def) method(test_dasherized_keys_as_yaml) - constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator([)constant(Mime)operator(::)constant(YAML)operator(]) operator(=) symbol(:yaml) - ident(process)operator(()stringoperator(,) stringoperator(,) stringoperator(,) pre_constant(true)operator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(response)operator(.)ident(body) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(params)operator([)symbol(:first_key)operator(])operator([)symbol(:sub_key)operator(]) - reserved(end) - - reserved(def) method(test_typecast_as_yaml) - constant(ActionController)operator(::)constant(Base)operator(.)ident(param_parsers)operator([)constant(Mime)operator(::)constant(YAML)operator(]) operator(=) symbol(:yaml) - ident(process)operator(()stringoperator(,) stringoperator(,) stringoperator(\))string - ident(params) operator(=) instance_variable(@controller)operator(.)ident(params) - ident(assert_equal) integer(15)operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:a)operator(]) - ident(assert_equal) pre_constant(false)operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:b)operator(]) - ident(assert_equal) pre_constant(true)operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:c)operator(]) - ident(assert_equal) constant(Date)operator(.)ident(new)operator(()integer(2005)operator(,)integer(3)operator(,)integer(17)operator(\))operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:d)operator(]) - ident(assert_equal) constant(Time)operator(.)ident(utc)operator(()integer(2005)operator(,)integer(3)operator(,)integer(17)operator(,)integer(21)operator(,)integer(41)operator(,)integer(7)operator(\))operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:e)operator(]) - ident(assert_equal) stringoperator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:f)operator(]) - ident(assert_equal) operator([)integer(1)operator(,) stringoperator(,) constant(Date)operator(.)ident(new)operator(()integer(1974)operator(,)integer(7)operator(,)integer(25)operator(\))operator(])operator(,) ident(params)operator([)symbol(:data)operator(])operator([)symbol(:g)operator(]) - reserved(end) - - ident(private) - - reserved(def) method(process)operator(()ident(verb)operator(,) ident(content_type) operator(=) stringoperator(,) ident(data) operator(=) stringoperator(,) ident(full)operator(=)pre_constant(false)operator(\)) - - ident(cgi) operator(=) constant(MockCGI)operator(.)ident(new)operator(()operator({) - string operator(=)operator(>) ident(verb)operator(,) - string operator(=)operator(>) ident(content_type)operator(,) - string operator(=)operator(>) string reserved(if) ident(full)inline_delimiter(})>delimiter(")>operator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) ident(data)operator(.)ident(size)operator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(})operator(,) ident(data)operator(\)) - - instance_variable(@controller)operator(.)ident(send)operator(()symbol(:process)operator(,) constant(ActionController)operator(::)constant(CgiRequest)operator(.)ident(new)operator(()ident(cgi)operator(,) operator({)operator(})operator(\))operator(,) constant(ActionController)operator(::)constant(CgiResponse)operator(.)ident(new)operator(()ident(cgi)operator(\))operator(\)) - reserved(end) - -reserved(end) - - -reserved(class) class(XmlNodeTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(test_all) - ident(xn) operator(=) constant(XmlNode)operator(.)ident(from_xml)operator(()string - - - With O'Reilly and Adaptive Path - - - Staying at the Savoy - - - - - - - - - )delimiter(})> - operator(\)) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(node)operator(.)ident(document)operator(.)ident(encoding) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(node)operator(.)ident(document)operator(.)ident(version) - ident(assert_equal) stringoperator(,) ident(xn)operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(node_name) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator(.)ident(description)operator(.)ident(node_value) - ident(assert_equal) pre_constant(nil)operator(,) ident(xn)operator(.)ident(nonexistent) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator(.)ident(notes)operator(.)ident(note)operator(.)ident(node_value)operator(.)ident(strip) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator(.)ident(tags)operator(.)ident(tag)operator([)integer(0)operator(])operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator(.)ident(tags)operator(.)ident(tag)operator([)integer(1)operator(])operator([)symbol(:name)operator(]) - ident(matches) operator(=) ident(xn)operator(.)ident(xpath)operator(()stringoperator(\))operator(.)ident(map)operator({) operator(|)ident(id)operator(|) ident(id)operator(.)ident(to_i) operator(}) - ident(assert_equal) operator([)integer(4)operator(,) integer(5)operator(,) integer(1020)operator(,) integer(1133)operator(])operator(,) ident(matches)operator(.)ident(sort) - ident(matches) operator(=) ident(xn)operator(.)ident(xpath)operator(()stringoperator(\))operator(.)ident(map)operator({) operator(|)ident(tag)operator(|) ident(tag)operator([)stringoperator(]) operator(}) - ident(assert_equal) operator([)stringoperator(,) stringoperator(])operator(,) ident(matches)operator(.)ident(sort) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator([)stringoperator(]) - ident(xn)operator(.)ident(page)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator([)stringoperator(]) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator(.)ident(notes)operator(.)ident(note)operator(.)ident(node_value)operator(.)ident(strip) - ident(xn)operator(.)ident(page)operator(.)ident(notes)operator(.)ident(note)operator(.)ident(node_value) operator(=) string - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator(.)ident(notes)operator(.)ident(note)operator(.)ident(node_value)operator(.)ident(strip) - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator(.)ident(tags)operator(.)ident(tag)operator([)integer(1)operator(])operator([)symbol(:id)operator(]) - ident(xn)operator(.)ident(page)operator(.)ident(tags)operator(.)ident(tag)operator([)integer(1)operator(])operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) ident(xn)operator(.)ident(page)operator(.)ident(tags)operator(.)ident(tag)operator([)integer(1)operator(])operator([)stringoperator(]) - reserved(end) - - - reserved(def) method(test_small_entry) - ident(node) operator(=) constant(XmlNode)operator(.)ident(from_xml)operator(()stringhi)delimiter(')>operator(\)) - ident(assert_equal) stringoperator(,) ident(node)operator(.)ident(node_value) - reserved(end) - -reserved(end) -reserved(class) class(AClassThatContainsAController::PoorlyPlacedController) operator(<) constant(ActionController)operator(::)constant(Base) - - reserved(def) pre_constant(self)operator(.)method(is_evil?) - symbol(:decidedly_so) - reserved(end) - -ident(endclass) constant(ModuleThatHoldsControllers)operator(::)constant(NestedController) operator(<) constant(ActionController)operator(::)constant(Base) - -ident(endclass) constant(AClassThatContainsAController) comment(#often < ActiveRecord::Base) - - reserved(def) pre_constant(self)operator(.)method(is_special?) - symbol(:you_know_it) - reserved(end) - -ident(endclass) constant(Company) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(attr_protected) symbol(:rating) - ident(set_sequence_name) symbol(:companies_nonstd_seq) - - ident(validates_presence_of) symbol(:name) - reserved(def) method(validate) - ident(errors)operator(.)ident(add)operator(()stringoperator(,) stringoperator(\)) reserved(if) ident(rating) operator(==) integer(2) - reserved(end) -ident(endclass) constant(Developer) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_and_belongs_to_many) symbol(:projects) -reserved(end) - -reserved(class) class(DeVeLoPeR) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_table_name) string -reserved(end) -comment(# see routing/controller component tests) - -ident(raise) constant(Exception)operator(,) stringreserved(module) class(AbcHelper) - reserved(def) method(bare_a)operator(()operator(\)) reserved(end) - reserved(def) method(bare_b)operator(()operator(\)) reserved(end) - reserved(def) method(bare_c)operator(()operator(\)) reserved(end) -reserved(end) -reserved(module) class(Fun::GamesHelper) - reserved(def) method(stratego)operator(()operator(\)) string reserved(end) -ident(endmodule) constant(Fun)operator(::)constant(PDFHelper) - reserved(def) method(foobar)operator(()operator(\)) string reserved(end) -reserved(end) -reserved(class) class(Project) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_and_belongs_to_many) symbol(:developers)operator(,) symbol(:uniq) operator(=)operator(>) pre_constant(true) -reserved(end) -reserved(class) class(Reply) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:topic)operator(,) symbol(:include) operator(=)operator(>) operator([)symbol(:replies)operator(]) - - ident(validates_presence_of) symbol(:content) -reserved(end) -reserved(class) class(Topic) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_many) symbol(:replies)operator(,) symbol(:include) operator(=)operator(>) operator([)symbol(:user)operator(])operator(,) symbol(:dependent) operator(=)operator(>) pre_constant(true) -ident(endrequire) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -comment(# require File.dirname(__FILE__\) + '/../../lib/action_view/helpers/active_record_helper') - -reserved(class) class(ActiveRecordHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(ActiveRecordHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TextHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(UrlHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormTagHelper) - - ident(silence_warnings) reserved(do) - constant(Post) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:title)operator(,) symbol(:author_name)operator(,) symbol(:body)operator(,) symbol(:secret)operator(,) symbol(:written_on)operator(\)) - constant(Post)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:title_before_type_cast)operator(,) symbol(:title) reserved(unless) ident(respond_to?)operator(()symbol(:title_before_type_cast)operator(\)) - ident(alias_method) symbol(:body_before_type_cast)operator(,) symbol(:body) reserved(unless) ident(respond_to?)operator(()symbol(:body_before_type_cast)operator(\)) - ident(alias_method) symbol(:author_name_before_type_cast)operator(,) symbol(:author_name) reserved(unless) ident(respond_to?)operator(()symbol(:author_name_before_type_cast)operator(\)) - reserved(end) - constant(Column) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:type)operator(,) symbol(:name)operator(,) symbol(:human_name)operator(\)) - reserved(end) - - reserved(def) method(setup) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - reserved(def) instance_variable(@post)operator(.)method(errors) - constant(Class)operator(.)ident(new) operator({) - reserved(def) method(on)operator(()ident(field)operator(\)) ident(field) operator(==) string operator(||) ident(field) operator(==) string reserved(end) - reserved(def) method(empty?)operator(()operator(\)) pre_constant(false) reserved(end) - reserved(def) method(count)operator(()operator(\)) integer(1) reserved(end) - reserved(def) method(full_messages)operator(()operator(\)) operator([) string operator(]) reserved(end) - operator(})operator(.)ident(new) - reserved(end) - - reserved(def) instance_variable(@post)operator(.)method(new_record?)operator(()operator(\)) pre_constant(true) reserved(end) - reserved(def) instance_variable(@post)operator(.)method(to_param)operator(()operator(\)) pre_constant(nil) reserved(end) - - reserved(def) instance_variable(@post)operator(.)method(column_for_attribute)operator(()ident(attr_name)operator(\)) - constant(Post)operator(.)ident(content_columns)operator(.)ident(select) operator({) operator(|)ident(column)operator(|) ident(column)operator(.)ident(name) operator(==) ident(attr_name) operator(})operator(.)ident(first) - reserved(end) - - reserved(def) constant(Post)operator(.)method(content_columns)operator(()operator(\)) operator([) constant(Column)operator(.)ident(new)operator(()symbol(:string)operator(,) stringoperator(,) stringoperator(\))operator(,) constant(Column)operator(.)ident(new)operator(()symbol(:text)operator(,) stringoperator(,) stringoperator(\)) operator(]) reserved(end) - - instance_variable(@post)operator(.)ident(title) operator(=) string - instance_variable(@post)operator(.)ident(author_name) operator(=) string - instance_variable(@post)operator(.)ident(body) operator(=) string - instance_variable(@post)operator(.)ident(secret) operator(=) integer(1) - instance_variable(@post)operator(.)ident(written_on) operator(=) constant(Date)operator(.)ident(new)operator(()integer(2004)operator(,) integer(6)operator(,) integer(15)operator(\)) - - instance_variable(@controller) operator(=) constant(Object)operator(.)ident(new) - reserved(def) instance_variable(@controller)operator(.)method(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) - ident(options) operator(=) ident(options)operator(.)ident(symbolize_keys) - - operator([)ident(options)operator([)symbol(:action)operator(])operator(,) ident(options)operator([)symbol(:id)operator(])operator(.)ident(to_param)operator(])operator(.)ident(compact)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_generic_input_tag) - ident(assert_dom_equal)operator(() - string)delimiter(\))>operator(,) ident(input)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_text_area_with_errors) - ident(assert_dom_equal)operator(() - string
)delimiter(\))>operator(,) - ident(text_area)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_text_field_with_errors) - ident(assert_dom_equal)operator(() - string)delimiter(\))>operator(,) - ident(text_field)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_form_with_string) - ident(assert_dom_equal)operator(() - string


)char(\\n)content(


)delimiter(\))>operator(,) - ident(form)operator(()stringoperator(\)) - operator(\)) - - reserved(class) operator(<<) instance_variable(@post) - reserved(def) method(new_record?)operator(()operator(\)) pre_constant(false) reserved(end) - reserved(def) method(to_param)operator(()operator(\)) ident(id) reserved(end) - reserved(def) method(id)operator(()operator(\)) integer(1) reserved(end) - reserved(end) - ident(assert_dom_equal)operator(() - string


)char(\\n)content(


)delimiter(\))>operator(,) - ident(form)operator(()stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_form_with_date) - reserved(def) constant(Post)operator(.)method(content_columns)operator(()operator(\)) operator([) constant(Column)operator(.)ident(new)operator(()symbol(:date)operator(,) stringoperator(,) stringoperator(\)) operator(]) reserved(end) - - ident(assert_dom_equal)operator(() - string


)char(\\n)content()char(\\n)content()char(\\n)content(

)delimiter(\))>operator(,) - ident(form)operator(()stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_form_with_datetime) - reserved(def) constant(Post)operator(.)method(content_columns)operator(()operator(\)) operator([) constant(Column)operator(.)ident(new)operator(()symbol(:datetime)operator(,) stringoperator(,) stringoperator(\)) operator(]) reserved(end) - instance_variable(@post)operator(.)ident(written_on) operator(=) constant(Time)operator(.)ident(gm)operator(()integer(2004)operator(,) integer(6)operator(,) integer(15)operator(,) integer(16)operator(,) integer(30)operator(\)) - - ident(assert_dom_equal)operator(() - string


)char(\\n)content()char(\\n)content()char(\\n)content( — )char(\\n)content( : )char(\\n)content(

)delimiter(\))>operator(,) - ident(form)operator(()stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_error_for_block) - ident(assert_dom_equal) string

1 error prohibited this post from being saved

There were problems with the following fields:

  • Author name can't be empty
)delimiter(\))>operator(,) ident(error_messages_for)operator(()stringoperator(\)) - ident(assert_equal) string

1 error prohibited this post from being saved

There were problems with the following fields:

  • Author name can't be empty
)delimiter(\))>operator(,) ident(error_messages_for)operator(()stringoperator(,) symbol(:class) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(,) symbol(:header_tag) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_error_messages_for_handles_nil) - ident(assert_equal) stringoperator(,) ident(error_messages_for)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_form_with_string_multipart) - ident(assert_dom_equal)operator(() - string


)char(\\n)content(


)delimiter(\))>operator(,) - ident(form)operator(()stringoperator(,) symbol(:multipart) operator(=)operator(>) pre_constant(true)operator(\)) - operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(AssetTagHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(UrlHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(AssetTagHelper) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(Class)operator(.)ident(new) reserved(do) - - ident(attr_accessor) symbol(:request) - - reserved(def) method(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) - string - reserved(end) - - reserved(end)operator(.)ident(new) - - instance_variable(@request) operator(=) constant(Class)operator(.)ident(new) reserved(do) - reserved(def) method(relative_url_root) - string - reserved(end) - reserved(end)operator(.)ident(new) - - instance_variable(@controller)operator(.)ident(request) operator(=) instance_variable(@request) - - constant(ActionView)operator(::)constant(Helpers)operator(::)constant(AssetTagHelper)operator(::)ident(reset_javascript_include_default) - reserved(end) - - reserved(def) method(teardown) - constant(Object)operator(.)ident(send)operator(()symbol(:remove_const)operator(,) symbol(:RAILS_ROOT)operator(\)) reserved(if) reserved(defined?)operator(()constant(RAILS_ROOT)operator(\)) - pre_constant(ENV)operator([)stringoperator(]) operator(=) pre_constant(nil) - reserved(end) - - constant(AutoDiscoveryToTag) operator(=) operator({) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string "feed")nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string "feed"}, {:title => "My RSS"})nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string "My RSS"})nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string "text/html"})nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string "No stream.. really", :type => "text/html"})nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string "My RSS", :type => "text/html"})nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string "Not so alternate"})nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - operator(}) - - constant(JavascriptPathToTag) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) string - operator(}) - - constant(JavascriptIncludeToTag) operator(=) operator({) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string "vbscript")nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)char(\\n)content()delimiter(\))>operator(,) - string operator(=)operator(>) string)char(\\n)content()char(\\n)content()char(\\n)content()delimiter(\))>operator(,) - string operator(=)operator(>) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()delimiter(\))>operator(,) - string operator(=)operator(>) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()delimiter(\))> - operator(}) - - constant(StylePathToTag) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) string - operator(}) - - constant(StyleLinkToTag) operator(=) operator({) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string "all")nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)char(\\n)content()delimiter(\))> - operator(}) - - constant(ImagePathToTag) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - operator(}) - - constant(ImageLinkToTag) operator(=) operator({) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string "rss syndication")nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string "45x70")nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string "45x70")nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)delimiter(\))> - operator(}) - - reserved(def) method(test_auto_discovery) - constant(AutoDiscoveryToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_javascript_path) - constant(JavascriptPathToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_javascript_include) - constant(JavascriptIncludeToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_register_javascript_include_default) - constant(ActionView)operator(::)constant(Helpers)operator(::)constant(AssetTagHelper)operator(::)ident(register_javascript_include_default) string - ident(assert_dom_equal) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()delimiter(\))>operator(,) ident(javascript_include_tag)operator(()symbol(:defaults)operator(\)) - constant(ActionView)operator(::)constant(Helpers)operator(::)constant(AssetTagHelper)operator(::)ident(register_javascript_include_default) stringoperator(,) string - ident(assert_dom_equal) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()delimiter(\))>operator(,) ident(javascript_include_tag)operator(()symbol(:defaults)operator(\)) - reserved(end) - - reserved(def) method(test_style_path) - constant(StylePathToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_style_link) - constant(StyleLinkToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_image_path) - constant(ImagePathToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_image_tag) - constant(ImageLinkToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_timebased_asset_id) - constant(Object)operator(.)ident(send)operator(()symbol(:const_set)operator(,) symbol(:RAILS_ROOT)operator(,) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(expected_time) operator(=) constant(File)operator(.)ident(stat)operator(()constant(File)operator(.)ident(expand_path)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\))operator(\))operator(.)ident(mtime)operator(.)ident(to_i)operator(.)ident(to_s) - ident(assert_equal) string)delimiter(\))>operator(,) ident(image_tag)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_skipping_asset_id_on_complete_url) - constant(Object)operator(.)ident(send)operator(()symbol(:const_set)operator(,) symbol(:RAILS_ROOT)operator(,) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(assert_equal) string)delimiter(\))>operator(,) ident(image_tag)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_preset_asset_id) - constant(Object)operator(.)ident(send)operator(()symbol(:const_set)operator(,) symbol(:RAILS_ROOT)operator(,) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - pre_constant(ENV)operator([)stringoperator(]) operator(=) string - ident(assert_equal) string)delimiter(\))>operator(,) ident(image_tag)operator(()stringoperator(\)) - reserved(end) -reserved(end) - -reserved(class) class(AssetTagHelperNonVhostTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(UrlHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(AssetTagHelper) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(Class)operator(.)ident(new) reserved(do) - - ident(attr_accessor) symbol(:request) - - reserved(def) method(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) - string - reserved(end) - - reserved(end)operator(.)ident(new) - - instance_variable(@request) operator(=) constant(Class)operator(.)ident(new) reserved(do) - reserved(def) method(relative_url_root) - string - reserved(end) - reserved(end)operator(.)ident(new) - - instance_variable(@controller)operator(.)ident(request) operator(=) instance_variable(@request) - - constant(ActionView)operator(::)constant(Helpers)operator(::)constant(AssetTagHelper)operator(::)ident(reset_javascript_include_default) - reserved(end) - - constant(AutoDiscoveryToTag) operator(=) operator({) - string "feed")nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)delimiter(\))>operator(,) - operator(}) - - constant(JavascriptPathToTag) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - operator(}) - - constant(JavascriptIncludeToTag) operator(=) operator({) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)char(\\n)content()delimiter(\))>operator(,) - string operator(=)operator(>) string)char(\\n)content()char(\\n)content()char(\\n)content()delimiter(\))> - operator(}) - - constant(StylePathToTag) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - operator(}) - - constant(StyleLinkToTag) operator(=) operator({) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)char(\\n)content()delimiter(\))> - operator(}) - - constant(ImagePathToTag) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - operator(}) - - constant(ImageLinkToTag) operator(=) operator({) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string "rss syndication")nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string "45x70")nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))>operator(,) - string operator(=)operator(>) string)delimiter(\))>operator(,) - string "45x70")nesting_delimiter(\))delimiter(\))> operator(=)operator(>) string)delimiter(\))> - operator(}) - - reserved(def) method(test_auto_discovery) - constant(AutoDiscoveryToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_javascript_path) - constant(JavascriptPathToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_javascript_include) - constant(JavascriptIncludeToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_register_javascript_include_default) - constant(ActionView)operator(::)constant(Helpers)operator(::)constant(AssetTagHelper)operator(::)ident(register_javascript_include_default) string - ident(assert_dom_equal) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()delimiter(\))>operator(,) ident(javascript_include_tag)operator(()symbol(:defaults)operator(\)) - constant(ActionView)operator(::)constant(Helpers)operator(::)constant(AssetTagHelper)operator(::)ident(register_javascript_include_default) stringoperator(,) string - ident(assert_dom_equal) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()delimiter(\))>operator(,) ident(javascript_include_tag)operator(()symbol(:defaults)operator(\)) - reserved(end) - - reserved(def) method(test_style_path) - constant(StylePathToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_style_link) - constant(StyleLinkToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_image_path) - constant(ImagePathToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_image_tag) - constant(ImageLinkToTag)operator(.)ident(each) operator({) operator(|)ident(method)operator(,) ident(tag)operator(|) ident(assert_dom_equal)operator(()ident(tag)operator(,) ident(eval)operator(()ident(method)operator(\))operator(\)) operator(}) - comment(# Assigning a default alt tag should not cause an exception to be raised) - ident(assert_nothing_raised) operator({) ident(image_tag)operator(()stringoperator(\)) operator(}) - reserved(end) - - reserved(def) method(test_stylesheet_with_asset_host_already_encoded) - constant(ActionController)operator(::)constant(Base)operator(.)ident(asset_host) operator(=) string - ident(result) operator(=) ident(stylesheet_link_tag)operator(()stringoperator(\)) - ident(assert_dom_equal)operator(() - string)delimiter(\))>operator(,) - ident(result)operator(\)) - reserved(ensure) - constant(ActionController)operator(::)constant(Base)operator(.)ident(asset_host) operator(=) string - reserved(end) - -reserved(end) -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(BenchmarkHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(BenchmarkHelper) - - reserved(class) class(MockLogger) - ident(attr_reader) symbol(:logged) - - reserved(def) method(initialize) - instance_variable(@logged) operator(=) operator([)operator(]) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(method)operator(,) operator(*)ident(args)operator(\)) - instance_variable(@logged) operator(<<) operator([)ident(method)operator(,) ident(args)operator(]) - reserved(end) - reserved(end) - - reserved(def) method(setup) - instance_variable(@logger) operator(=) constant(MockLogger)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_without_logger_or_block) - instance_variable(@logger) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(benchmark) operator(}) - reserved(end) - - reserved(def) method(test_without_block) - ident(assert_raise)operator(()constant(LocalJumpError)operator(\)) operator({) ident(benchmark) operator(}) - ident(assert) instance_variable(@logger)operator(.)ident(logged)operator(.)ident(empty?) - reserved(end) - - reserved(def) method(test_without_logger) - instance_variable(@logger) operator(=) pre_constant(nil) - ident(i_was_run) operator(=) pre_constant(false) - ident(benchmark) operator({) ident(i_was_run) operator(=) pre_constant(true) operator(}) - ident(assert) operator(!)ident(i_was_run) - reserved(end) - - reserved(def) method(test_defaults) - ident(i_was_run) operator(=) pre_constant(false) - ident(benchmark) operator({) ident(i_was_run) operator(=) pre_constant(true) operator(}) - ident(assert) ident(i_was_run) - ident(assert) integer(1)operator(,) instance_variable(@logger)operator(.)ident(logged)operator(.)ident(size) - ident(assert_last_logged) - reserved(end) - - reserved(def) method(test_with_message) - ident(i_was_run) operator(=) pre_constant(false) - ident(benchmark)operator(()stringoperator(\)) operator({) ident(i_was_run) operator(=) pre_constant(true) operator(}) - ident(assert) ident(i_was_run) - ident(assert) integer(1)operator(,) instance_variable(@logger)operator(.)ident(logged)operator(.)ident(size) - ident(assert_last_logged) string - reserved(end) - - reserved(def) method(test_with_message_and_level) - ident(i_was_run) operator(=) pre_constant(false) - ident(benchmark)operator(()stringoperator(,) symbol(:debug)operator(\)) operator({) ident(i_was_run) operator(=) pre_constant(true) operator(}) - ident(assert) ident(i_was_run) - ident(assert) integer(1)operator(,) instance_variable(@logger)operator(.)ident(logged)operator(.)ident(size) - ident(assert_last_logged) stringoperator(,) symbol(:debug) - reserved(end) - - ident(private) - reserved(def) method(assert_last_logged)operator(()ident(message) operator(=) stringoperator(,) ident(level) operator(=) symbol(:info)operator(\)) - ident(last) operator(=) instance_variable(@logger)operator(.)ident(logged)operator(.)ident(last) - ident(assert) integer(2)operator(,) ident(last)operator(.)ident(size) - ident(assert_equal) ident(level)operator(,) ident(last)operator(.)ident(first) - ident(assert) integer(1)operator(,) ident(last)operator([)integer(1)operator(])operator(.)ident(size) - ident(assert) ident(last)operator([)integer(1)operator(])operator([)integer(0)operator(]) operator(=)operator(~) regexpcontent( )char(\\()content(.*)char(\\\))content($)delimiter(/)> - reserved(end) -reserved(end) -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(CompiledTemplateTests) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - - reserved(def) method(setup) - instance_variable(@ct) operator(=) constant(ActionView)operator(::)constant(CompiledTemplates)operator(.)ident(new) - instance_variable(@v) operator(=) constant(Class)operator(.)ident(new) - instance_variable(@v)operator(.)ident(send) symbol(:include)operator(,) instance_variable(@ct) - instance_variable(@a) operator(=) string - instance_variable(@b) operator(=) string - instance_variable(@s) operator(=) string - reserved(end) - reserved(def) method(teardown) - operator([)instance_variable(@a)operator(,) instance_variable(@b)operator(,) instance_variable(@s)operator(])operator(.)ident(each) reserved(do) operator(|)ident(f)operator(|) - shelldelimiter(`)> reserved(if) constant(File)operator(.)ident(exist?)operator(()ident(f)operator(\)) operator(||) constant(File)operator(.)ident(symlink?)operator(()ident(f)operator(\)) - reserved(end) - reserved(end) - ident(attr_reader) symbol(:ct)operator(,) symbol(:v) - - reserved(def) method(test_name_allocation) - ident(hi_world) operator(=) ident(ct)operator(.)ident(method_names)operator([)stringoperator(]) - ident(hi_sexy) operator(=) ident(ct)operator(.)ident(method_names)operator([)stringoperator(]) - ident(wish_upon_a_star) operator(=) ident(ct)operator(.)ident(method_names)operator([)stringoperator(]) - - ident(assert_equal) ident(hi_world)operator(,) ident(ct)operator(.)ident(method_names)operator([)stringoperator(]) - ident(assert_equal) ident(hi_sexy)operator(,) ident(ct)operator(.)ident(method_names)operator([)stringoperator(]) - ident(assert_equal) ident(wish_upon_a_star)operator(,) ident(ct)operator(.)ident(method_names)operator([)stringoperator(]) - ident(assert_equal) integer(3)operator(,) operator([)ident(hi_world)operator(,) ident(hi_sexy)operator(,) ident(wish_upon_a_star)operator(])operator(.)ident(uniq)operator(.)ident(length) - reserved(end) - - reserved(def) method(test_wrap_source) - ident(assert_equal)operator(() - stringoperator(,) - instance_variable(@ct)operator(.)ident(wrap_source)operator(()symbol(:aliased_assignment)operator(,) operator([)symbol(:value)operator(])operator(,) stringoperator(\)) - operator(\)) - - ident(assert_equal)operator(() - stringoperator(,) - instance_variable(@ct)operator(.)ident(wrap_source)operator(()symbol(:simple)operator(,) operator([)operator(])operator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_compile_source_single_method) - ident(selector) operator(=) ident(ct)operator(.)ident(compile_source)operator(()stringoperator(,) operator([)symbol(:a)operator(])operator(,) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) instance_variable(@v)operator(.)ident(new)operator(.)ident(send)operator(()ident(selector)operator(,) integer(1)operator(\)) - ident(assert_equal) integer(4)operator(,) instance_variable(@v)operator(.)ident(new)operator(.)ident(send)operator(()ident(selector)operator(,) integer(2)operator(\)) - ident(assert_equal) integer(-4)operator(,) instance_variable(@v)operator(.)ident(new)operator(.)ident(send)operator(()ident(selector)operator(,) integer(-2)operator(\)) - ident(assert_equal) integer(0)operator(,) instance_variable(@v)operator(.)ident(new)operator(.)ident(send)operator(()ident(selector)operator(,) integer(0)operator(\)) - ident(selector) - reserved(end) - - reserved(def) method(test_compile_source_two_method) - ident(sel1) operator(=) ident(test_compile_source_single_method) comment(# compile the method in the other test) - ident(sel2) operator(=) ident(ct)operator(.)ident(compile_source)operator(()stringoperator(,) operator([)symbol(:a)operator(,) symbol(:b)operator(])operator(,) stringoperator(\)) - ident(assert_not_equal) ident(sel1)operator(,) ident(sel2) - - ident(assert_equal) integer(2)operator(,) instance_variable(@v)operator(.)ident(new)operator(.)ident(send)operator(()ident(sel1)operator(,) integer(1)operator(\)) - ident(assert_equal) integer(4)operator(,) instance_variable(@v)operator(.)ident(new)operator(.)ident(send)operator(()ident(sel1)operator(,) integer(2)operator(\)) - - ident(assert_equal) integer(6)operator(,) instance_variable(@v)operator(.)ident(new)operator(.)ident(send)operator(()ident(sel2)operator(,) integer(1)operator(,) integer(2)operator(\)) - ident(assert_equal) integer(32)operator(,) instance_variable(@v)operator(.)ident(new)operator(.)ident(send)operator(()ident(sel2)operator(,) integer(15)operator(,) integer(1)operator(\)) - reserved(end) - - reserved(def) method(test_mtime) - ident(t1) operator(=) constant(Time)operator(.)ident(now) - ident(test_compile_source_single_method) - ident(assert) operator(()ident(t1)operator(..)constant(Time)operator(.)ident(now)operator(\))operator(.)ident(include?)operator(()ident(ct)operator(.)ident(mtime)operator(()stringoperator(,) operator([)symbol(:a)operator(])operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_compile_time) - shellcontent(' > )inlinecontent(; echo ')inlinecontent(' > )inlinecontent(; ln -s )inlinecontent( )inlinedelimiter(`)> - - ident(v) operator(=) constant(ActionView)operator(::)constant(Base)operator(.)ident(new) - ident(v)operator(.)ident(base_path) operator(=) string - ident(v)operator(.)ident(cache_template_loading) operator(=) pre_constant(false)operator(;) - - ident(sleep) integer(1) - ident(t) operator(=) constant(Time)operator(.)ident(now) - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@a)operator(\)) - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@b)operator(\)) - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@s)operator(\)) - ident(a_n) operator(=) ident(v)operator(.)ident(method_names)operator([)instance_variable(@a)operator(]) - ident(b_n) operator(=) ident(v)operator(.)ident(method_names)operator([)instance_variable(@b)operator(]) - ident(s_n) operator(=) ident(v)operator(.)ident(method_names)operator([)instance_variable(@s)operator(]) - comment(# all of the files have changed since last compile) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(a_n)operator(]) operator(>) ident(t) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(b_n)operator(]) operator(>) ident(t) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(s_n)operator(]) operator(>) ident(t) - - ident(sleep) integer(1) - ident(t) operator(=) constant(Time)operator(.)ident(now) - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@a)operator(\)) - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@b)operator(\)) - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@s)operator(\)) - comment(# none of the files have changed since last compile) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(a_n)operator(]) operator(<) ident(t) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(b_n)operator(]) operator(<) ident(t) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(s_n)operator(]) operator(<) ident(t) - - shellcontent(; ln -s )inlinecontent( )inlinedelimiter(`)> - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@a)operator(\)) - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@b)operator(\)) - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@s)operator(\)) - comment(# the symlink has changed since last compile) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(a_n)operator(]) operator(<) ident(t) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(b_n)operator(]) operator(<) ident(t) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(s_n)operator(]) operator(>) ident(t) - - ident(sleep) integer(1) - shelldelimiter(`)> - ident(t) operator(=) constant(Time)operator(.)ident(now) - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@a)operator(\)) - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@b)operator(\)) - ident(v)operator(.)ident(compile_and_render_template)operator(()symbol(:rhtml)operator(,) stringoperator(,) instance_variable(@s)operator(\)) - comment(# the file at the end of the symlink has changed since last compile) - comment(# both the symlink and the file at the end of it should be recompiled) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(a_n)operator(]) operator(<) ident(t) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(b_n)operator(]) operator(>) ident(t) - ident(assert) ident(v)operator(.)ident(compile_time)operator([)ident(s_n)operator(]) operator(>) ident(t) - reserved(end) -reserved(end) - -reserved(module) class(ActionView) - reserved(class) class(Base) - reserved(def) method(compile_time) - class_variable(@@compile_time) - reserved(end) - reserved(def) method(method_names) - class_variable(@@method_names) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(DateHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(DateHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormHelper) - - ident(silence_warnings) reserved(do) - constant(Post) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:written_on)operator(,) symbol(:updated_at)operator(\)) - reserved(end) - - reserved(def) method(test_distance_in_words) - ident(from) operator(=) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(41)operator(,) integer(18)operator(\)) - - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(41)operator(,) integer(25)operator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(46)operator(,) integer(25)operator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(22)operator(,) integer(47)operator(,) integer(25)operator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(7)operator(,) integer(0)operator(,) integer(41)operator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(7)operator(,) integer(1)operator(,) integer(20)operator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(9)operator(,) integer(15)operator(,) integer(40)operator(\))operator(\)) - - comment(# include seconds ) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(41)operator(,) integer(19)operator(\))operator(,) pre_constant(false)operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(41)operator(,) integer(19)operator(\))operator(,) pre_constant(true)operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(41)operator(,) integer(28)operator(\))operator(,) pre_constant(true)operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(41)operator(,) integer(38)operator(\))operator(,) pre_constant(true)operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(41)operator(,) integer(48)operator(\))operator(,) pre_constant(true)operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(42)operator(,) integer(17)operator(\))operator(,) pre_constant(true)operator(\)) - - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(42)operator(,) integer(18)operator(\))operator(,) pre_constant(true)operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(42)operator(,) integer(28)operator(\))operator(,) pre_constant(true)operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()ident(from)operator(,) constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(42)operator(,) integer(48)operator(\))operator(,) pre_constant(true)operator(\)) - - comment(# test to < from) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(7)operator(,) integer(1)operator(,) integer(20)operator(\))operator(,) ident(from)operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2004)operator(,) integer(3)operator(,) integer(6)operator(,) integer(21)operator(,) integer(41)operator(,) integer(38)operator(\))operator(,) ident(from)operator(,) pre_constant(true)operator(\)) - - comment(# test with integers) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()integer(50)operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()integer(60)operator(*)integer(60)operator(\)) - - comment(# more cumbersome test with integers) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()integer(0)operator(,) integer(50)operator(\)) - ident(assert_equal) stringoperator(,) ident(distance_of_time_in_words)operator(()integer(60)operator(*)integer(60)operator(,) integer(0)operator(\)) - - reserved(end) - - reserved(def) method(test_distance_in_words_date) - ident(start_date) operator(=) constant(Date)operator(.)ident(new) integer(1975)operator(,) integer(1)operator(,) integer(31) - ident(end_date) operator(=) constant(Date)operator(.)ident(new) integer(1977)operator(,) integer(4)operator(,) integer(17) - ident(assert_not_equal)operator(()stringoperator(,) - ident(distance_of_time_in_words)operator(()ident(start_date)operator(,) ident(end_date)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_select_day) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_day)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_day)operator(()integer(16)operator(\)) - reserved(end) - - reserved(def) method(test_select_day_with_blank) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_day)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_day)operator(()integer(16)operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_day_nil_with_blank) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_day)operator(()pre_constant(nil)operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_month) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()integer(8)operator(\)) - reserved(end) - - reserved(def) method(test_select_month_with_disabled) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:disabled) operator(=)operator(>) pre_constant(true)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()integer(8)operator(,) symbol(:disabled) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_month_with_field_name_override) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:field_name) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()integer(8)operator(,) symbol(:field_name) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_select_month_with_blank) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()integer(8)operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_month_nil_with_blank) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()pre_constant(nil)operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_month_with_numbers) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:use_month_numbers) operator(=)operator(>) pre_constant(true)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()integer(8)operator(,) symbol(:use_month_numbers) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_month_with_numbers_and_names) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string1 - January)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:add_month_numbers) operator(=)operator(>) pre_constant(true)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()integer(8)operator(,) symbol(:add_month_numbers) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_month_with_numbers_and_names_with_abbv) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string1 - Jan)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:add_month_numbers) operator(=)operator(>) pre_constant(true)operator(,) symbol(:use_short_month) operator(=)operator(>) pre_constant(true)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()integer(8)operator(,) symbol(:add_month_numbers) operator(=)operator(>) pre_constant(true)operator(,) symbol(:use_short_month) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_month_with_abbv) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJan)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:use_short_month) operator(=)operator(>) pre_constant(true)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_month)operator(()integer(8)operator(,) symbol(:use_short_month) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_year) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string2003)char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_year)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:end_year) operator(=)operator(>) integer(2005)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_year)operator(()integer(2003)operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:end_year) operator(=)operator(>) integer(2005)operator(\)) - reserved(end) - - reserved(def) method(test_select_year_with_disabled) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string2003)char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_year)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:disabled) operator(=)operator(>) pre_constant(true)operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:end_year) operator(=)operator(>) integer(2005)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_year)operator(()integer(2003)operator(,) symbol(:disabled) operator(=)operator(>) pre_constant(true)operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:end_year) operator(=)operator(>) integer(2005)operator(\)) - reserved(end) - - reserved(def) method(test_select_year_with_field_name_override) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string2003)char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_year)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:end_year) operator(=)operator(>) integer(2005)operator(,) symbol(:field_name) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_year)operator(()integer(2003)operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:end_year) operator(=)operator(>) integer(2005)operator(,) symbol(:field_name) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_select_year_with_type_discarding) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string2003)char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_year)operator(() - constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:prefix) operator(=)operator(>) stringoperator(,) symbol(:discard_type) operator(=)operator(>) pre_constant(true)operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:end_year) operator(=)operator(>) integer(2005)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_year)operator(() - integer(2003)operator(,) symbol(:prefix) operator(=)operator(>) stringoperator(,) symbol(:discard_type) operator(=)operator(>) pre_constant(true)operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:end_year) operator(=)operator(>) integer(2005)operator(\)) - reserved(end) - - reserved(def) method(test_select_year_descending) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string2005)char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_year)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2005)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:start_year) operator(=)operator(>) integer(2005)operator(,) symbol(:end_year) operator(=)operator(>) integer(2003)operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_year)operator(()integer(2005)operator(,) symbol(:start_year) operator(=)operator(>) integer(2005)operator(,) symbol(:end_year) operator(=)operator(>) integer(2003)operator(\)) - reserved(end) - - reserved(def) method(test_select_hour) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_hour)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_select_hour_with_disabled) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_hour)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) symbol(:disabled) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_hour_with_field_name_override) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_hour)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) symbol(:field_name) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_select_hour_with_blank) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_hour)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_hour_nil_with_blank) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_hour)operator(()pre_constant(nil)operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_minute) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_minute)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_select_minute_with_disabled) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_minute)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) symbol(:disabled) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_minute_with_field_name_override) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_minute)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) symbol(:field_name) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_select_minute_with_blank) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_minute)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_minute_with_blank_and_step) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_minute)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) operator({) symbol(:include_blank) operator(=)operator(>) pre_constant(true) operator(,) symbol(:minute_step) operator(=)operator(>) integer(15) operator(})operator(\)) - reserved(end) - - reserved(def) method(test_select_minute_nil_with_blank) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_minute)operator(()pre_constant(nil)operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_minute_nil_with_blank_and_step) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_minute)operator(()pre_constant(nil)operator(,) operator({) symbol(:include_blank) operator(=)operator(>) pre_constant(true) operator(,) symbol(:minute_step) operator(=)operator(>) integer(15) operator(})operator(\)) - reserved(end) - - reserved(def) method(test_select_second) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_second)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_select_second_with_disabled) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_second)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) symbol(:disabled) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_second_with_field_name_override) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_second)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) symbol(:field_name) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_select_second_with_blank) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_second)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_second_nil_with_blank) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_second)operator(()pre_constant(nil)operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_date) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string2003)char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_date)operator(() - constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:end_year) operator(=)operator(>) integer(2005)operator(,) symbol(:prefix) operator(=)operator(>) string - operator(\)) - reserved(end) - - reserved(def) method(test_select_date_with_disabled) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string2003)char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_date)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:end_year) operator(=)operator(>) integer(2005)operator(,) symbol(:prefix) operator(=)operator(>) stringoperator(,) symbol(:disabled) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - - reserved(def) method(test_select_date_with_no_start_year) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(-)integer(5)operator(\))operator(.)ident(upto)operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(+)integer(1)operator(\)) reserved(do) operator(|)ident(y)operator(|) - reserved(if) ident(y) operator(==) constant(Date)operator(.)ident(today)operator(.)ident(year) - ident(expected) operator(<<) string)inlinecontent()char(\\n)delimiter(\))> - reserved(else) - ident(expected) operator(<<) string)inlinecontent()char(\\n)delimiter(\))> - reserved(end) - reserved(end) - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_date)operator(() - constant(Time)operator(.)ident(mktime)operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:end_year) operator(=)operator(>) constant(Date)operator(.)ident(today)operator(.)ident(year)operator(+)integer(1)operator(,) symbol(:prefix) operator(=)operator(>) string - operator(\)) - reserved(end) - - reserved(def) method(test_select_date_with_no_end_year) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - integer(2003)operator(.)ident(upto)operator(()integer(2008)operator(\)) reserved(do) operator(|)ident(y)operator(|) - reserved(if) ident(y) operator(==) integer(2003) - ident(expected) operator(<<) string)inlinecontent()char(\\n)delimiter(\))> - reserved(else) - ident(expected) operator(<<) string)inlinecontent()char(\\n)delimiter(\))> - reserved(end) - reserved(end) - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_date)operator(() - constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:prefix) operator(=)operator(>) string - operator(\)) - reserved(end) - - reserved(def) method(test_select_date_with_no_start_or_end_year) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(-)integer(5)operator(\))operator(.)ident(upto)operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(+)integer(5)operator(\)) reserved(do) operator(|)ident(y)operator(|) - reserved(if) ident(y) operator(==) constant(Date)operator(.)ident(today)operator(.)ident(year) - ident(expected) operator(<<) string)inlinecontent()char(\\n)delimiter(\))> - reserved(else) - ident(expected) operator(<<) string)inlinecontent()char(\\n)delimiter(\))> - reserved(end) - reserved(end) - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_date)operator(() - constant(Time)operator(.)ident(mktime)operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(,) integer(8)operator(,) integer(16)operator(\))operator(,) symbol(:prefix) operator(=)operator(>) string - operator(\)) - reserved(end) - - reserved(def) method(test_select_time_with_seconds) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_time)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) symbol(:include_seconds) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_select_time_without_seconds) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_time)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(\)) - ident(assert_equal) ident(expected)operator(,) ident(select_time)operator(()constant(Time)operator(.)ident(mktime)operator(()integer(2003)operator(,) integer(8)operator(,) integer(16)operator(,) integer(8)operator(,) integer(4)operator(,) integer(18)operator(\))operator(,) symbol(:include_seconds) operator(=)operator(>) pre_constant(false)operator(\)) - reserved(end) - - reserved(def) method(test_date_select_with_zero_value) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string2003)char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_date)operator(()integer(0)operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:end_year) operator(=)operator(>) integer(2005)operator(,) symbol(:prefix) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_date_select_within_fields_for) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(written_on) operator(=) constant(Date)operator(.)ident(new)operator(()integer(2004)operator(,) integer(6)operator(,) integer(15)operator(\)) - - ident(_erbout) operator(=) string - - ident(fields_for) symbol(:post)operator(,) instance_variable(@post) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(date_select)operator(()symbol(:written_on)operator(\)) - reserved(end) - - ident(expected) operator(=) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(")> operator(+) - string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(")> operator(+) - string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(")> - - ident(assert_dom_equal)operator(()ident(expected)operator(,) ident(_erbout)operator(\)) - reserved(end) - - reserved(def) method(test_datetime_select_within_fields_for) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(updated_at) operator(=) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(6)operator(,) integer(15)operator(,) integer(16)operator(,) integer(35)operator(\)) - - ident(_erbout) operator(=) string - - ident(fields_for) symbol(:post)operator(,) instance_variable(@post) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(datetime_select)operator(()symbol(:updated_at)operator(\)) - reserved(end) - - ident(expected) operator(=) string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content( — )char(\\n)content( : )char(\\n)delimiter(")> - - ident(assert_dom_equal)operator(()ident(expected)operator(,) ident(_erbout)operator(\)) - reserved(end) - - reserved(def) method(test_date_select_with_zero_value_and_no_start_year) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(-)integer(5)operator(\))operator(.)ident(upto)operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(+)integer(1)operator(\)) operator({) operator(|)ident(y)operator(|) ident(expected) operator(<<) string)inlinecontent()char(\\n)delimiter(\))> operator(}) - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_date)operator(()integer(0)operator(,) symbol(:end_year) operator(=)operator(>) constant(Date)operator(.)ident(today)operator(.)ident(year)operator(+)integer(1)operator(,) symbol(:prefix) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_date_select_with_zero_value_and_no_end_year) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - ident(last_year) operator(=) constant(Time)operator(.)ident(now)operator(.)ident(year) operator(+) integer(5) - integer(2003)operator(.)ident(upto)operator(()ident(last_year)operator(\)) operator({) operator(|)ident(y)operator(|) ident(expected) operator(<<) string)inlinecontent()char(\\n)delimiter(\))> operator(}) - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_date)operator(()integer(0)operator(,) symbol(:start_year) operator(=)operator(>) integer(2003)operator(,) symbol(:prefix) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_date_select_with_zero_value_and_no_start_and_end_year) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(-)integer(5)operator(\))operator(.)ident(upto)operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(+)integer(5)operator(\)) operator({) operator(|)ident(y)operator(|) ident(expected) operator(<<) string)inlinecontent()char(\\n)delimiter(\))> operator(}) - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_date)operator(()integer(0)operator(,) symbol(:prefix) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_date_select_with_nil_value_and_no_start_and_end_year) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(-)integer(5)operator(\))operator(.)ident(upto)operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(+)integer(5)operator(\)) operator({) operator(|)ident(y)operator(|) ident(expected) operator(<<) string)inlinecontent()char(\\n)delimiter(\))> operator(}) - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_date)operator(()pre_constant(nil)operator(,) symbol(:prefix) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_datetime_select_with_nil_value_and_no_start_and_end_year) - ident(expected) operator(=) string)char(\\n)delimiter(\))> - operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(-)integer(5)operator(\))operator(.)ident(upto)operator(()constant(Date)operator(.)ident(today)operator(.)ident(year)operator(+)integer(5)operator(\)) operator({) operator(|)ident(y)operator(|) ident(expected) operator(<<) string)inlinecontent()char(\\n)delimiter(\))> operator(}) - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) stringJanuary)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) -string1)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(expected) operator(<<) string)char(\\n)delimiter(\))> - ident(expected) operator(<<) string00)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(\))> - ident(expected) operator(<<) string)char(\\n)delimiter(")> - - ident(assert_equal) ident(expected)operator(,) ident(select_datetime)operator(()pre_constant(nil)operator(,) symbol(:prefix) operator(=)operator(>) stringoperator(\)) - reserved(end) - -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(FormHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormTagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(UrlHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TextHelper) - - ident(silence_warnings) reserved(do) - constant(Post) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:title)operator(,) symbol(:author_name)operator(,) symbol(:body)operator(,) symbol(:secret)operator(,) symbol(:written_on)operator(,) symbol(:cost)operator(\)) - constant(Post)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:title_before_type_cast)operator(,) symbol(:title) reserved(unless) ident(respond_to?)operator(()symbol(:title_before_type_cast)operator(\)) - ident(alias_method) symbol(:body_before_type_cast)operator(,) symbol(:body) reserved(unless) ident(respond_to?)operator(()symbol(:body_before_type_cast)operator(\)) - ident(alias_method) symbol(:author_name_before_type_cast)operator(,) symbol(:author_name) reserved(unless) ident(respond_to?)operator(()symbol(:author_name_before_type_cast)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(setup) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - reserved(def) instance_variable(@post)operator(.)method(errors)operator(()operator(\)) constant(Class)operator(.)ident(new)operator({) reserved(def) method(on)operator(()ident(field)operator(\)) ident(field) operator(==) string reserved(end) operator(})operator(.)ident(new) reserved(end) - - reserved(def) instance_variable(@post)operator(.)method(id)operator(;) integer(123)operator(;) reserved(end) - reserved(def) instance_variable(@post)operator(.)method(id_before_type_cast)operator(;) integer(123)operator(;) reserved(end) - - instance_variable(@post)operator(.)ident(title) operator(=) string - instance_variable(@post)operator(.)ident(author_name) operator(=) string - instance_variable(@post)operator(.)ident(body) operator(=) string - instance_variable(@post)operator(.)ident(secret) operator(=) integer(1) - instance_variable(@post)operator(.)ident(written_on) operator(=) constant(Date)operator(.)ident(new)operator(()integer(2004)operator(,) integer(6)operator(,) integer(15)operator(\)) - - instance_variable(@controller) operator(=) constant(Class)operator(.)ident(new) reserved(do) - ident(attr_reader) symbol(:url_for_options) - reserved(def) method(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) - instance_variable(@url_for_options) operator(=) ident(options) - string - reserved(end) - reserved(end) - instance_variable(@controller) operator(=) instance_variable(@controller)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_text_field) - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) ident(text_field)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) ident(password_field)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) ident(password_field)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_text_field_with_escapes) - instance_variable(@post)operator(.)ident(title) operator(=) stringHello World)delimiter(")> - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) ident(text_field)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_text_field_with_options) - ident(expected) operator(=) string)delimiter(')> - ident(assert_dom_equal) ident(expected)operator(,) ident(text_field)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) integer(35)operator(\)) - ident(assert_dom_equal) ident(expected)operator(,) ident(text_field)operator(()stringoperator(,) stringoperator(,) symbol(:size) operator(=)operator(>) integer(35)operator(\)) - reserved(end) - - reserved(def) method(test_text_field_assuming_size) - ident(expected) operator(=) string)delimiter(')> - ident(assert_dom_equal) ident(expected)operator(,) ident(text_field)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) integer(35)operator(\)) - ident(assert_dom_equal) ident(expected)operator(,) ident(text_field)operator(()stringoperator(,) stringoperator(,) symbol(:maxlength) operator(=)operator(>) integer(35)operator(\)) - reserved(end) - - reserved(def) method(test_text_field_doesnt_change_param_values) - ident(object_name) operator(=) string - ident(expected) operator(=) string)delimiter(')> - ident(assert_equal) ident(expected)operator(,) ident(text_field)operator(()ident(object_name)operator(,) stringoperator(\)) - ident(assert_equal) ident(object_name)operator(,) string - reserved(end) - - reserved(def) method(test_check_box) - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) - ident(check_box)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - instance_variable(@post)operator(.)ident(secret) operator(=) integer(0) - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) - ident(check_box)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) - ident(check_box)operator(()stringoperator(,) string operator(,)operator({)stringoperator(=)operator(>)stringoperator(})operator(\)) - operator(\)) - instance_variable(@post)operator(.)ident(secret) operator(=) pre_constant(true) - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) - ident(check_box)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_check_box_with_explicit_checked_and_unchecked_values) - instance_variable(@post)operator(.)ident(secret) operator(=) string - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) - ident(check_box)operator(()stringoperator(,) stringoperator(,) operator({)operator(})operator(,) stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_radio_button) - ident(assert_dom_equal)operator(()string)delimiter(')>operator(,) - ident(radio_button)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(()string)delimiter(')>operator(,) - ident(radio_button)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_radio_button_is_checked_with_integers) - ident(assert_dom_equal)operator(()string)delimiter(')>operator(,) - ident(radio_button)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_text_area) - ident(assert_dom_equal)operator(() - stringBack to the hill and over it again!)delimiter(')>operator(,) - ident(text_area)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_text_area_with_escapes) - instance_variable(@post)operator(.)ident(body) operator(=) stringthe hill and over it again!)delimiter(")> - ident(assert_dom_equal)operator(() - stringBack to <i>the</i> hill and over it again!)delimiter(')>operator(,) - ident(text_area)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_text_area_with_alternate_value) - ident(assert_dom_equal)operator(() - stringTesting alternate values.)delimiter(')>operator(,) - ident(text_area)operator(()stringoperator(,) stringoperator(,) symbol(:value) operator(=)operator(>) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_date_selects) - ident(assert_dom_equal)operator(() - stringBack to the hill and over it again!)delimiter(')>operator(,) - ident(text_area)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_explicit_name) - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) ident(text_field)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - stringBack to the hill and over it again!)delimiter(')>operator(,) - ident(text_area)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) - ident(check_box)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - operator(\)) - ident(assert_dom_equal) ident(text_field)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(,) - ident(text_field)operator(()stringoperator(,) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) ident(text_area)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(,) - ident(text_area)operator(()stringoperator(,) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) ident(check_box)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(,) - ident(check_box)operator(()stringoperator(,) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_explicit_id) - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) ident(text_field)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - stringBack to the hill and over it again!)delimiter(')>operator(,) - ident(text_area)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - string)delimiter(')>operator(,) - ident(check_box)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - operator(\)) - ident(assert_dom_equal) ident(text_field)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(,) - ident(text_field)operator(()stringoperator(,) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) ident(text_area)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(,) - ident(text_area)operator(()stringoperator(,) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) ident(check_box)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(,) - ident(check_box)operator(()stringoperator(,) stringoperator(,) symbol(:id) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_auto_index) - ident(pid) operator(=) instance_variable(@post)operator(.)ident(id) - ident(assert_dom_equal)operator(() - stringcontent(_title)char(\\")content( name=)char(\\")content(post[)inlinecontent(][title])char(\\")content( size=)char(\\")content(30)char(\\")content( type=)char(\\")content(text)char(\\")content( value=)char(\\")content(Hello World)char(\\")content( />)delimiter(")>operator(,) ident(text_field)operator(()stringoperator(,)stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - stringcontent(_body)char(\\")content( name=)char(\\")content(post[)inlinecontent(][body])char(\\")content( rows=)char(\\")content(20)char(\\")content(>Back to the hill and over it again!)delimiter(")>operator(,) - ident(text_area)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - stringcontent(_secret)char(\\")content( name=)char(\\")content(post[)inlinecontent(][secret])char(\\")content( type=)char(\\")content(checkbox)char(\\")content( value=)char(\\")content(1)char(\\")content( />content(][secret])char(\\")content( type=)char(\\")content(hidden)char(\\")content( value=)char(\\")content(0)char(\\")content( />)delimiter(")>operator(,) - ident(check_box)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() -stringcontent(_title_hello_world)char(\\")content( name=)char(\\")content(post[)inlinecontent(][title])char(\\")content( type=)char(\\")content(radio)char(\\")content( value=)char(\\")content(Hello World)char(\\")content( />)delimiter(")>operator(,) - ident(radio_button)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(()stringcontent(_title_goodbye_world)char(\\")content( name=)char(\\")content(post[)inlinecontent(][title])char(\\")content( type=)char(\\")content(radio)char(\\")content( value=)char(\\")content(Goodbye World)char(\\")content( />)delimiter(")>operator(,) - ident(radio_button)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_form_for) - ident(_erbout) operator(=) string - - ident(form_for)operator(()symbol(:post)operator(,) instance_variable(@post)operator(,) symbol(:html) operator(=)operator(>) operator({) symbol(:id) operator(=)operator(>) string operator(})operator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_field)operator(()symbol(:title)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_area)operator(()symbol(:body)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(check_box)operator(()symbol(:secret)operator(\)) - reserved(end) - - ident(expected) operator(=) - string)delimiter(")> operator(+) - string)delimiter(")> operator(+) - stringBack to the hill and over it again!)delimiter(")> operator(+) - string)delimiter(")> operator(+) - string)delimiter(")> operator(+) - string)delimiter(")> - - ident(assert_dom_equal) ident(expected)operator(,) ident(_erbout) - reserved(end) - - reserved(def) method(test_form_for_without_object) - ident(_erbout) operator(=) string - - ident(form_for)operator(()symbol(:post)operator(,) symbol(:html) operator(=)operator(>) operator({) symbol(:id) operator(=)operator(>) string operator(})operator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_field)operator(()symbol(:title)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_area)operator(()symbol(:body)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(check_box)operator(()symbol(:secret)operator(\)) - reserved(end) - - ident(expected) operator(=) - string)delimiter(")> operator(+) - string)delimiter(")> operator(+) - stringBack to the hill and over it again!)delimiter(")> operator(+) - string)delimiter(")> operator(+) - string)delimiter(")> operator(+) - string)delimiter(")> - - ident(assert_dom_equal) ident(expected)operator(,) ident(_erbout) - reserved(end) - - reserved(def) method(test_fields_for) - ident(_erbout) operator(=) string - - ident(fields_for)operator(()symbol(:post)operator(,) instance_variable(@post)operator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_field)operator(()symbol(:title)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_area)operator(()symbol(:body)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(check_box)operator(()symbol(:secret)operator(\)) - reserved(end) - - ident(expected) operator(=) - string)delimiter(")> operator(+) - stringBack to the hill and over it again!)delimiter(")> operator(+) - string)delimiter(")> operator(+) - string)delimiter(")> - - ident(assert_dom_equal) ident(expected)operator(,) ident(_erbout) - reserved(end) - - reserved(def) method(test_fields_for_without_object) - ident(_erbout) operator(=) string - ident(fields_for)operator(()symbol(:post)operator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_field)operator(()symbol(:title)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_area)operator(()symbol(:body)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(check_box)operator(()symbol(:secret)operator(\)) - reserved(end) - - ident(expected) operator(=) - string)delimiter(")> operator(+) - stringBack to the hill and over it again!)delimiter(")> operator(+) - string)delimiter(")> operator(+) - string)delimiter(")> - - ident(assert_dom_equal) ident(expected)operator(,) ident(_erbout) - reserved(end) - - reserved(def) method(test_form_builder_does_not_have_form_for_method) - ident(assert) operator(!) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormBuilder)operator(.)ident(instance_methods)operator(.)ident(include?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_form_for_and_fields_for) - ident(_erbout) operator(=) string - - ident(form_for)operator(()symbol(:post)operator(,) instance_variable(@post)operator(,) symbol(:html) operator(=)operator(>) operator({) symbol(:id) operator(=)operator(>) string operator(})operator(\)) reserved(do) operator(|)ident(post_form)operator(|) - ident(_erbout)operator(.)ident(concat) ident(post_form)operator(.)ident(text_field)operator(()symbol(:title)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(post_form)operator(.)ident(text_area)operator(()symbol(:body)operator(\)) - - ident(fields_for)operator(()symbol(:parent_post)operator(,) instance_variable(@post)operator(\)) reserved(do) operator(|)ident(parent_fields)operator(|) - ident(_erbout)operator(.)ident(concat) ident(parent_fields)operator(.)ident(check_box)operator(()symbol(:secret)operator(\)) - reserved(end) - reserved(end) - - ident(expected) operator(=) - string)delimiter(")> operator(+) - string)delimiter(")> operator(+) - stringBack to the hill and over it again!)delimiter(")> operator(+) - string)delimiter(")> operator(+) - string)delimiter(")> operator(+) - string)delimiter(")> - - ident(assert_dom_equal) ident(expected)operator(,) ident(_erbout) - reserved(end) - - reserved(class) class(LabelledFormBuilder) operator(<) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormBuilder) - operator(()ident(field_helpers) operator(-) stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(selector)operator(|) - ident(src) operator(=) stringstringcontent((field, *args, &proc\) - " " + super + "
" - end)delimiter( - END_SRC)> - ident(class_eval) ident(src)operator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__) - reserved(end) - reserved(end) - - reserved(def) method(test_form_for_with_labelled_builder) - ident(_erbout) operator(=) string - - ident(form_for)operator(()symbol(:post)operator(,) instance_variable(@post)operator(,) symbol(:builder) operator(=)operator(>) constant(LabelledFormBuilder)operator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_field)operator(()symbol(:title)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_area)operator(()symbol(:body)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(check_box)operator(()symbol(:secret)operator(\)) - reserved(end) - - ident(expected) operator(=) - string)delimiter(")> operator(+) - stringTitle:
)delimiter(")> operator(+) - stringBody:
)delimiter(")> operator(+) - stringSecret: )delimiter(")> operator(+) - string
)delimiter(")> operator(+) - string)delimiter(")> - - ident(assert_dom_equal) ident(expected)operator(,) ident(_erbout) - reserved(end) - - comment(# Perhaps this test should be moved to prototype helper tests.) - reserved(def) method(test_remote_form_for_with_labelled_builder) - pre_constant(self)operator(.)ident(extend) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(PrototypeHelper) - ident(_erbout) operator(=) string - - ident(remote_form_for)operator(()symbol(:post)operator(,) instance_variable(@post)operator(,) symbol(:builder) operator(=)operator(>) constant(LabelledFormBuilder)operator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_field)operator(()symbol(:title)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_area)operator(()symbol(:body)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(check_box)operator(()symbol(:secret)operator(\)) - reserved(end) - - ident(expected) operator(=) - string)delimiter(\))> operator(+) - stringTitle:
)delimiter(")> operator(+) - stringBody:
)delimiter(")> operator(+) - stringSecret: )delimiter(")> operator(+) - string
)delimiter(")> operator(+) - string)delimiter(")> - - ident(assert_dom_equal) ident(expected)operator(,) ident(_erbout) - reserved(end) - - reserved(def) method(test_fields_for_with_labelled_builder) - ident(_erbout) operator(=) string - - ident(fields_for)operator(()symbol(:post)operator(,) instance_variable(@post)operator(,) symbol(:builder) operator(=)operator(>) constant(LabelledFormBuilder)operator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_field)operator(()symbol(:title)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(text_area)operator(()symbol(:body)operator(\)) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(check_box)operator(()symbol(:secret)operator(\)) - reserved(end) - - ident(expected) operator(=) - stringTitle:
)delimiter(")> operator(+) - stringBody:
)delimiter(")> operator(+) - stringSecret: )delimiter(")> operator(+) - string
)delimiter(")> - - ident(assert_dom_equal) ident(expected)operator(,) ident(_erbout) - reserved(end) - - reserved(def) method(test_form_for_with_html_options_adds_options_to_form_tag) - ident(_erbout) operator(=) string - - ident(form_for)operator(()symbol(:post)operator(,) instance_variable(@post)operator(,) symbol(:html) operator(=)operator(>) operator({)symbol(:id) operator(=)operator(>) stringoperator(,) symbol(:class) operator(=)operator(>) stringoperator(})operator(\)) reserved(do) operator(|)ident(f)operator(|) reserved(end) - ident(expected) operator(=) string)delimiter(")> - - ident(assert_dom_equal) ident(expected)operator(,) ident(_erbout) - reserved(end) - - reserved(def) method(test_form_for_with_string_url_option) - ident(_erbout) operator(=) string - - ident(form_for)operator(()symbol(:post)operator(,) instance_variable(@post)operator(,) symbol(:url) operator(=)operator(>) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) reserved(end) - - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(url_for_options) - reserved(end) - - reserved(def) method(test_form_for_with_hash_url_option) - ident(_erbout) operator(=) string - - ident(form_for)operator(()symbol(:post)operator(,) instance_variable(@post)operator(,) symbol(:url) operator(=)operator(>) operator({)symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(})operator(\)) reserved(do) operator(|)ident(f)operator(|) reserved(end) - - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(url_for_options)operator([)symbol(:controller)operator(]) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(url_for_options)operator([)symbol(:action)operator(]) - reserved(end) - - reserved(def) method(test_remote_form_for_with_html_options_adds_options_to_form_tag) - pre_constant(self)operator(.)ident(extend) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(PrototypeHelper) - ident(_erbout) operator(=) string - - ident(remote_form_for)operator(()symbol(:post)operator(,) instance_variable(@post)operator(,) symbol(:html) operator(=)operator(>) operator({)symbol(:id) operator(=)operator(>) stringoperator(,) symbol(:class) operator(=)operator(>) stringoperator(})operator(\)) reserved(do) operator(|)ident(f)operator(|) reserved(end) - ident(expected) operator(=) string)delimiter(")> - - ident(assert_dom_equal) ident(expected)operator(,) ident(_erbout) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(MockTimeZone) - ident(attr_reader) symbol(:name) - - reserved(def) method(initialize)operator(() ident(name) operator(\)) - instance_variable(@name) operator(=) ident(name) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(all) - operator([) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) string operator(])operator(.)ident(map) operator({) operator(|)ident(s)operator(|) ident(new) ident(s) operator(}) - reserved(end) - - reserved(def) method(==)operator(() ident(z) operator(\)) - ident(z) operator(&&) instance_variable(@name) operator(==) ident(z)operator(.)ident(name) - reserved(end) - - reserved(def) method(to_s) - instance_variable(@name) - reserved(end) -reserved(end) - -constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormOptionsHelper)operator(::)constant(TimeZone) operator(=) constant(MockTimeZone) - -reserved(class) class(FormOptionsHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormOptionsHelper) - - ident(silence_warnings) reserved(do) - constant(Post) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:title)operator(,) symbol(:author_name)operator(,) symbol(:body)operator(,) symbol(:secret)operator(,) symbol(:written_on)operator(,) symbol(:category)operator(,) symbol(:origin)operator(\)) - constant(Continent) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:continent_name)operator(,) symbol(:countries)operator(\)) - constant(Country) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:country_id)operator(,) symbol(:country_name)operator(\)) - constant(Firm) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:time_zone)operator(\)) - reserved(end) - - reserved(def) method(test_collection_options) - instance_variable(@posts) operator(=) operator([) - constant(Post)operator(.)ident(new)operator(()string went home)delimiter(")>operator(,) string)delimiter(")>operator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) - operator(]) - - ident(assert_dom_equal)operator(() - string<Abe> went home)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(options_from_collection_for_select)operator(()instance_variable(@posts)operator(,) stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - - reserved(def) method(test_collection_options_with_preselected_value) - instance_variable(@posts) operator(=) operator([) - constant(Post)operator(.)ident(new)operator(()string went home)delimiter(")>operator(,) string)delimiter(")>operator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) - operator(]) - - ident(assert_dom_equal)operator(() - string<Abe> went home)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(options_from_collection_for_select)operator(()instance_variable(@posts)operator(,) stringoperator(,) stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_collection_options_with_preselected_value_array) - instance_variable(@posts) operator(=) operator([) - constant(Post)operator(.)ident(new)operator(()string went home)delimiter(")>operator(,) string)delimiter(")>operator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) - operator(]) - - ident(assert_dom_equal)operator(() - string<Abe> went home)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(options_from_collection_for_select)operator(()instance_variable(@posts)operator(,) stringoperator(,) stringoperator(,) operator([) stringoperator(,) string operator(])operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_array_options_for_select) - ident(assert_dom_equal)operator(() - string<Denmark>)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(options_for_select)operator(()operator([) string)delimiter(")>operator(,) stringoperator(,) string operator(])operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_array_options_for_select_with_selection) - ident(assert_dom_equal)operator(() - stringDenmark)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(options_for_select)operator(()operator([) stringoperator(,) string)delimiter(")>operator(,) string operator(])operator(,) string)delimiter(")>operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_array_options_for_select_with_selection_array) - ident(assert_dom_equal)operator(() - stringDenmark)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(options_for_select)operator(()operator([) stringoperator(,) string)delimiter(")>operator(,) string operator(])operator(,) operator([) string)delimiter(")>operator(,) string operator(])operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_array_options_for_string_include_in_other_string_bug_fix) - ident(assert_dom_equal)operator(() - stringruby)char(\\n)content()delimiter(")>operator(,) - ident(options_for_select)operator(()operator([) stringoperator(,) string operator(])operator(,) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - stringruby)char(\\n)content()delimiter(")>operator(,) - ident(options_for_select)operator(()operator([) stringoperator(,) string operator(])operator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_hash_options_for_select) - ident(assert_dom_equal)operator(() - string<DKR>)char(\\n)content()delimiter(")>operator(,) - ident(options_for_select)operator(()operator({) string operator(=)operator(>) stringoperator(,) string)delimiter(")> operator(=)operator(>) string)delimiter(")> operator(})operator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - string<DKR>)char(\\n)content()delimiter(")>operator(,) - ident(options_for_select)operator(()operator({) string operator(=)operator(>) stringoperator(,) string)delimiter(")> operator(=)operator(>) string)delimiter(")> operator(})operator(,) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - string<DKR>)char(\\n)content()delimiter(")>operator(,) - ident(options_for_select)operator(()operator({) string operator(=)operator(>) stringoperator(,) string)delimiter(")> operator(=)operator(>) string)delimiter(")> operator(})operator(,) operator([) stringoperator(,) string)delimiter(")> operator(])operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_ducktyped_options_for_select) - ident(quack) operator(=) constant(Struct)operator(.)ident(new)operator(()symbol(:first)operator(,) symbol(:last)operator(\)) - ident(assert_dom_equal)operator(() - string<DKR>)char(\\n)content()delimiter(")>operator(,) - ident(options_for_select)operator(()operator([)ident(quack)operator(.)ident(new)operator(()string)delimiter(")>operator(,) string)delimiter(")>operator(\))operator(,) ident(quack)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\))operator(])operator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - string<DKR>)char(\\n)content()delimiter(")>operator(,) - ident(options_for_select)operator(()operator([)ident(quack)operator(.)ident(new)operator(()string)delimiter(")>operator(,) string)delimiter(")>operator(\))operator(,) ident(quack)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\))operator(])operator(,) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - string<DKR>)char(\\n)content()delimiter(")>operator(,) - ident(options_for_select)operator(()operator([)ident(quack)operator(.)ident(new)operator(()string)delimiter(")>operator(,) string)delimiter(")>operator(\))operator(,) ident(quack)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\))operator(])operator(,) operator([)stringoperator(,) string)delimiter(")>operator(])operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_html_option_groups_from_collection) - instance_variable(@continents) operator(=) operator([) - constant(Continent)operator(.)ident(new)operator(()string)delimiter(")>operator(,) operator([)constant(Country)operator(.)ident(new)operator(()string)delimiter(")>operator(,) string)delimiter(")>operator(\))operator(,) constant(Country)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\))operator(]) operator(\))operator(,) - constant(Continent)operator(.)ident(new)operator(()stringoperator(,) operator([)constant(Country)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\))operator(,) constant(Country)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\))operator(]) operator(\)) - operator(]) - - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(option_groups_from_collection_for_select)operator(()instance_variable(@continents)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_time_zone_options_no_parms) - ident(opts) operator(=) ident(time_zone_options_for_select) - ident(assert_dom_equal) stringA)char(\\n)delimiter(")> operator(+) - stringB)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringD)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")>operator(,) - ident(opts) - reserved(end) - - reserved(def) method(test_time_zone_options_with_selected) - ident(opts) operator(=) ident(time_zone_options_for_select)operator(() string operator(\)) - ident(assert_dom_equal) stringA)char(\\n)delimiter(")> operator(+) - stringB)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringD)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")>operator(,) - ident(opts) - reserved(end) - - reserved(def) method(test_time_zone_options_with_unknown_selected) - ident(opts) operator(=) ident(time_zone_options_for_select)operator(() string operator(\)) - ident(assert_dom_equal) stringA)char(\\n)delimiter(")> operator(+) - stringB)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringD)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")>operator(,) - ident(opts) - reserved(end) - - reserved(def) method(test_time_zone_options_with_priority_zones) - ident(zones) operator(=) operator([) constant(TimeZone)operator(.)ident(new)operator(() string operator(\))operator(,) constant(TimeZone)operator(.)ident(new)operator(() string operator(\)) operator(]) - ident(opts) operator(=) ident(time_zone_options_for_select)operator(() pre_constant(nil)operator(,) ident(zones) operator(\)) - ident(assert_dom_equal) stringB)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")> operator(+) - string-------------)char(\\n)delimiter(")> operator(+) - stringA)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringD)delimiter(")>operator(,) - ident(opts) - reserved(end) - - reserved(def) method(test_time_zone_options_with_selected_priority_zones) - ident(zones) operator(=) operator([) constant(TimeZone)operator(.)ident(new)operator(() string operator(\))operator(,) constant(TimeZone)operator(.)ident(new)operator(() string operator(\)) operator(]) - ident(opts) operator(=) ident(time_zone_options_for_select)operator(() stringoperator(,) ident(zones) operator(\)) - ident(assert_dom_equal) stringB)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")> operator(+) - string-------------)char(\\n)delimiter(")> operator(+) - stringA)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringD)delimiter(")>operator(,) - ident(opts) - reserved(end) - - reserved(def) method(test_time_zone_options_with_unselected_priority_zones) - ident(zones) operator(=) operator([) constant(TimeZone)operator(.)ident(new)operator(() string operator(\))operator(,) constant(TimeZone)operator(.)ident(new)operator(() string operator(\)) operator(]) - ident(opts) operator(=) ident(time_zone_options_for_select)operator(() stringoperator(,) ident(zones) operator(\)) - ident(assert_dom_equal) stringB)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")> operator(+) - string-------------)char(\\n)delimiter(")> operator(+) - stringA)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringD)delimiter(")>operator(,) - ident(opts) - reserved(end) - - reserved(def) method(test_select) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(category) operator(=) string)delimiter(")> - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(select)operator(()stringoperator(,) stringoperator(,) string hest)delimiter(\))>operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_select_under_fields_for) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(category) operator(=) string)delimiter(")> - - ident(_erbout) operator(=) string - - ident(fields_for) symbol(:post)operator(,) instance_variable(@post) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(select)operator(()symbol(:category)operator(,) string hest)delimiter(\))>operator(\)) - reserved(end) - - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(_erbout) - operator(\)) - reserved(end) - - reserved(def) method(test_select_with_blank) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(category) operator(=) string)delimiter(")> - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(select)operator(()stringoperator(,) stringoperator(,) string hest)delimiter(\))>operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_select_with_default_prompt) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(category) operator(=) string - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(select)operator(()stringoperator(,) stringoperator(,) string hest)delimiter(\))>operator(,) symbol(:prompt) operator(=)operator(>) pre_constant(true)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_select_no_prompt_when_select_has_value) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(category) operator(=) string)delimiter(")> - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(select)operator(()stringoperator(,) stringoperator(,) string hest)delimiter(\))>operator(,) symbol(:prompt) operator(=)operator(>) pre_constant(true)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_select_with_given_prompt) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(category) operator(=) string - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(select)operator(()stringoperator(,) stringoperator(,) string hest)delimiter(\))>operator(,) symbol(:prompt) operator(=)operator(>) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_select_with_prompt_and_blank) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(category) operator(=) string - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(select)operator(()stringoperator(,) stringoperator(,) string hest)delimiter(\))>operator(,) symbol(:prompt) operator(=)operator(>) pre_constant(true)operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_select_with_selected_value) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(category) operator(=) string)delimiter(")> - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(select)operator(()stringoperator(,) stringoperator(,) string hest )delimiter(\))>operator(,) symbol(:selected) operator(=)operator(>) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_select_with_selected_nil) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(category) operator(=) string)delimiter(")> - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(select)operator(()stringoperator(,) stringoperator(,) string hest )delimiter(\))>operator(,) symbol(:selected) operator(=)operator(>) pre_constant(nil)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_collection_select) - instance_variable(@posts) operator(=) operator([) - constant(Post)operator(.)ident(new)operator(()string went home)delimiter(")>operator(,) string)delimiter(")>operator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) - operator(]) - - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(author_name) operator(=) string - - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(collection_select)operator(()stringoperator(,) stringoperator(,) instance_variable(@posts)operator(,) stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_collection_select_under_fields_for) - instance_variable(@posts) operator(=) operator([) - constant(Post)operator(.)ident(new)operator(()string went home)delimiter(")>operator(,) string)delimiter(")>operator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) - operator(]) - - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(author_name) operator(=) string - - ident(_erbout) operator(=) string - - ident(fields_for) symbol(:post)operator(,) instance_variable(@post) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(collection_select)operator(()symbol(:author_name)operator(,) instance_variable(@posts)operator(,) symbol(:author_name)operator(,) symbol(:author_name)operator(\)) - reserved(end) - - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(_erbout) - operator(\)) - reserved(end) - - reserved(def) method(test_collection_select_with_blank_and_style) - instance_variable(@posts) operator(=) operator([) - constant(Post)operator(.)ident(new)operator(()string went home)delimiter(")>operator(,) string)delimiter(")>operator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\))operator(,) - constant(Post)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) - operator(]) - - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(author_name) operator(=) string - - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()char(\\n)content()delimiter(")>operator(,) - ident(collection_select)operator(()stringoperator(,) stringoperator(,) instance_variable(@posts)operator(,) stringoperator(,) stringoperator(,) operator({) symbol(:include_blank) operator(=)operator(>) pre_constant(true) operator(})operator(,) string operator(=)operator(>) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_country_select) - instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - instance_variable(@post)operator(.)ident(origin) operator(=) string - ident(assert_dom_equal)operator(() - string)char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)content()char(\\n)delimiter(")> operator(+) - stringB)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringD)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")> operator(+) - string)delimiter(")>operator(,) - ident(html) - reserved(end) - - reserved(def) method(test_time_zone_select_under_fields_for) - instance_variable(@firm) operator(=) constant(Firm)operator(.)ident(new)operator(()stringoperator(\)) - - ident(_erbout) operator(=) string - - ident(fields_for) symbol(:firm)operator(,) instance_variable(@firm) reserved(do) operator(|)ident(f)operator(|) - ident(_erbout)operator(.)ident(concat) ident(f)operator(.)ident(time_zone_select)operator(()symbol(:time_zone)operator(\)) - reserved(end) - - ident(assert_dom_equal)operator(() - string)delimiter(")> operator(+) - stringA)char(\\n)delimiter(")> operator(+) - stringB)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringD)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")> operator(+) - string)delimiter(")>operator(,) - ident(_erbout) - operator(\)) - reserved(end) - - reserved(def) method(test_time_zone_select_with_blank) - instance_variable(@firm) operator(=) constant(Firm)operator(.)ident(new)operator(()stringoperator(\)) - ident(html) operator(=) ident(time_zone_select)operator(()stringoperator(,) stringoperator(,) pre_constant(nil)operator(,) symbol(:include_blank) operator(=)operator(>) pre_constant(true)operator(\)) - ident(assert_dom_equal) string)delimiter(")> operator(+) - string)char(\\n)delimiter(")> operator(+) - stringA)char(\\n)delimiter(")> operator(+) - stringB)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringD)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")> operator(+) - string)delimiter(")>operator(,) - ident(html) - reserved(end) - - reserved(def) method(test_time_zone_select_with_style) - instance_variable(@firm) operator(=) constant(Firm)operator(.)ident(new)operator(()stringoperator(\)) - ident(html) operator(=) ident(time_zone_select)operator(()stringoperator(,) stringoperator(,) pre_constant(nil)operator(,) operator({)operator(})operator(,) - string operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) string)delimiter(")> operator(+) - stringA)char(\\n)delimiter(")> operator(+) - stringB)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringD)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")> operator(+) - string)delimiter(")>operator(,) - ident(html) - ident(assert_dom_equal) ident(html)operator(,) ident(time_zone_select)operator(()stringoperator(,) stringoperator(,) pre_constant(nil)operator(,) operator({)operator(})operator(,) - symbol(:style) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_time_zone_select_with_blank_and_style) - instance_variable(@firm) operator(=) constant(Firm)operator(.)ident(new)operator(()stringoperator(\)) - ident(html) operator(=) ident(time_zone_select)operator(()stringoperator(,) stringoperator(,) pre_constant(nil)operator(,) - operator({) symbol(:include_blank) operator(=)operator(>) pre_constant(true) operator(})operator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) string)delimiter(")> operator(+) - string)char(\\n)delimiter(")> operator(+) - stringA)char(\\n)delimiter(")> operator(+) - stringB)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringD)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")> operator(+) - string)delimiter(")>operator(,) - ident(html) - ident(assert_dom_equal) ident(html)operator(,) ident(time_zone_select)operator(()stringoperator(,) stringoperator(,) pre_constant(nil)operator(,) - operator({) symbol(:include_blank) operator(=)operator(>) pre_constant(true) operator(})operator(,) symbol(:style) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_time_zone_select_with_priority_zones) - instance_variable(@firm) operator(=) constant(Firm)operator(.)ident(new)operator(()stringoperator(\)) - ident(zones) operator(=) operator([) constant(TimeZone)operator(.)ident(new)operator(()stringoperator(\))operator(,) constant(TimeZone)operator(.)ident(new)operator(()stringoperator(\)) operator(]) - ident(html) operator(=) ident(time_zone_select)operator(()stringoperator(,) stringoperator(,) ident(zones) operator(\)) - ident(assert_dom_equal) string)delimiter(")> operator(+) - stringA)char(\\n)delimiter(")> operator(+) - stringD)delimiter(")> operator(+) - string-------------)char(\\n)delimiter(")> operator(+) - stringB)char(\\n)delimiter(")> operator(+) - stringC)char(\\n)delimiter(")> operator(+) - stringE)delimiter(")> operator(+) - string)delimiter(")>operator(,) - ident(html) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(FormTagHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(UrlHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormTagHelper) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(Class)operator(.)ident(new) reserved(do) - reserved(def) method(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) - string - reserved(end) - reserved(end) - instance_variable(@controller) operator(=) instance_variable(@controller)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_check_box_tag) - ident(actual) operator(=) ident(check_box_tag) string - ident(expected) operator(=) string)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_form_tag) - ident(actual) operator(=) ident(form_tag) - ident(expected) operator(=) string)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_form_tag_multipart) - ident(actual) operator(=) ident(form_tag)operator(()operator({)operator(})operator(,) operator({) string operator(=)operator(>) pre_constant(true) operator(})operator(\)) - ident(expected) operator(=) string)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_hidden_field_tag) - ident(actual) operator(=) ident(hidden_field_tag) stringoperator(,) integer(3) - ident(expected) operator(=) string)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_password_field_tag) - ident(actual) operator(=) ident(password_field_tag) - ident(expected) operator(=) string)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_radio_button_tag) - ident(actual) operator(=) ident(radio_button_tag) stringoperator(,) string - ident(expected) operator(=) string)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_select_tag) - ident(actual) operator(=) ident(select_tag) stringoperator(,) stringdavid)delimiter(")> - ident(expected) operator(=) string)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_text_area_tag_size_string) - ident(actual) operator(=) ident(text_area_tag) stringoperator(,) stringoperator(,) string operator(=)operator(>) string - ident(expected) operator(=) stringhello world)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_text_area_tag_size_symbol) - ident(actual) operator(=) ident(text_area_tag) stringoperator(,) stringoperator(,) symbol(:size) operator(=)operator(>) string - ident(expected) operator(=) stringhello world)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_text_field_tag) - ident(actual) operator(=) ident(text_field_tag) stringoperator(,) string - ident(expected) operator(=) string)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_text_field_tag_class_string) - ident(actual) operator(=) ident(text_field_tag) stringoperator(,) stringoperator(,) string operator(=)operator(>) string - ident(expected) operator(=) string)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_boolean_optios) - ident(assert_dom_equal) string)delimiter(\))>operator(,) ident(check_box_tag)operator(()stringoperator(,) integer(1)operator(,) pre_constant(true)operator(,) string operator(=)operator(>) pre_constant(true)operator(,) symbol(:readonly) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) string)delimiter(\))>operator(,) ident(check_box_tag)operator(()stringoperator(,) integer(1)operator(,) pre_constant(true)operator(,) symbol(:disabled) operator(=)operator(>) pre_constant(false)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(nil)operator(\)) - ident(assert_dom_equal) string)delimiter(\))>operator(,) ident(select_tag)operator(()stringoperator(,) stringdavid)delimiter(")>operator(,) symbol(:multiple) operator(=)operator(>) pre_constant(true)operator(\)) - ident(assert_dom_equal) string)delimiter(\))>operator(,) ident(select_tag)operator(()stringoperator(,) stringdavid)delimiter(")>operator(,) symbol(:multiple) operator(=)operator(>) pre_constant(nil)operator(\)) - reserved(end) - - reserved(def) method(test_stringify_symbol_keys) - ident(actual) operator(=) ident(text_field_tag) stringoperator(,) stringoperator(,) symbol(:id) operator(=)operator(>) string - ident(expected) operator(=) string)delimiter(\))> - ident(assert_dom_equal) ident(expected)operator(,) ident(actual) - reserved(end) - - reserved(def) method(test_submit_tag) - ident(assert_dom_equal)operator(() - string)delimiter(\))>operator(,) - ident(submit_tag)operator(()stringoperator(,) symbol(:disable_with) operator(=)operator(>) stringoperator(,) symbol(:onclick) operator(=)operator(>) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_pass) - ident(assert_equal) integer(1)operator(,) integer(1) - reserved(end) -reserved(end) - -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(JavaScriptMacrosHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(JavaScriptHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(JavaScriptMacrosHelper) - - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(UrlHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TextHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(CaptureHelper) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(Class)operator(.)ident(new) reserved(do) - reserved(def) method(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) - ident(url) operator(=) string - ident(url) operator(<<) ident(options)operator([)symbol(:action)operator(])operator(.)ident(to_s) reserved(if) ident(options) reserved(and) ident(options)operator([)symbol(:action)operator(]) - ident(url) - reserved(end) - reserved(end) - instance_variable(@controller) operator(=) instance_variable(@controller)operator(.)ident(new) - reserved(end) - - - reserved(def) method(test_auto_complete_field) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(auto_complete_field)operator(()stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\))operator(;) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(auto_complete_field)operator(()stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(,) symbol(:tokens) operator(=)operator(>) stringoperator(\))operator(;) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(auto_complete_field)operator(()stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(,) symbol(:tokens) operator(=)operator(>) operator([)stringoperator(])operator(\))operator(;) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(auto_complete_field)operator(()stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(,) symbol(:min_chars) operator(=)operator(>) integer(3)operator(\))operator(;) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(auto_complete_field)operator(()stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(,) symbol(:on_hide) operator(=)operator(>) stringoperator(\))operator(;) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(auto_complete_field)operator(()stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(,) symbol(:frequency) operator(=)operator(>) integer(2)operator(\))operator(;) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(auto_complete_field)operator(()stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(,) - symbol(:after_update_element) operator(=)operator(>) stringoperator(\))operator(;) - reserved(end) - - reserved(def) method(test_auto_complete_result) - ident(result) operator(=) operator([) operator({) symbol(:title) operator(=)operator(>) string operator(})operator(,) operator({) symbol(:title) operator(=)operator(>) string operator(}) operator(]) - ident(assert_equal) string
  • test1
  • test2
  • )delimiter(\))>operator(,) - ident(auto_complete_result)operator(()ident(result)operator(,) symbol(:title)operator(\)) - ident(assert_equal) string
  • test1
  • test2
  • )delimiter(\))>operator(,) - ident(auto_complete_result)operator(()ident(result)operator(,) symbol(:title)operator(,) stringoperator(\)) - - ident(resultuniq) operator(=) operator([) operator({) symbol(:title) operator(=)operator(>) string operator(})operator(,) operator({) symbol(:title) operator(=)operator(>) string operator(}) operator(]) - ident(assert_equal) string
  • test1
  • )delimiter(\))>operator(,) - ident(auto_complete_result)operator(()ident(resultuniq)operator(,) symbol(:title)operator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_text_field_with_auto_complete) - ident(assert_match) string)delimiter(")>operator(,) - ident(text_field_with_auto_complete)operator(()symbol(:message)operator(,) symbol(:recipient)operator(\)) - ident(assert_dom_equal) string
    )delimiter(\))>operator(,) - ident(text_field_with_auto_complete)operator(()symbol(:message)operator(,) symbol(:recipient)operator(,) operator({)operator(})operator(,) symbol(:skip_style) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_in_place_editor_external_control) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(in_place_editor)operator(()stringoperator(,) operator({)symbol(:url) operator(=)operator(>) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) symbol(:external_control) operator(=)operator(>) stringoperator(})operator(\)) - reserved(end) - - reserved(def) method(test_in_place_editor_size) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(in_place_editor)operator(()stringoperator(,) operator({)symbol(:url) operator(=)operator(>) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) symbol(:size) operator(=)operator(>) integer(4)operator(})operator(\)) - reserved(end) - - reserved(def) method(test_in_place_editor_cols_no_rows) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(in_place_editor)operator(()stringoperator(,) operator({)symbol(:url) operator(=)operator(>) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) symbol(:cols) operator(=)operator(>) integer(4)operator(})operator(\)) - reserved(end) - - reserved(def) method(test_in_place_editor_cols_with_rows) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(in_place_editor)operator(()stringoperator(,) operator({)symbol(:url) operator(=)operator(>) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) symbol(:rows) operator(=)operator(>) integer(5)operator(,) symbol(:cols) operator(=)operator(>) integer(40)operator(})operator(\)) - reserved(end) - - reserved(def) method(test_inplace_editor_loading_text) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(in_place_editor)operator(()stringoperator(,) operator({)symbol(:url) operator(=)operator(>) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) symbol(:loading_text) operator(=)operator(>) stringoperator(})operator(\)) - reserved(end) - - reserved(def) method(test_in_place_editor_url) - ident(assert_match) stringoperator(,) - ident(in_place_editor)operator(() stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(test_in_place_editor_load_text_url) - ident(assert_match) stringoperator(,) - ident(in_place_editor)operator(() stringoperator(,) - symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(,) - symbol(:load_text_url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(test_in_place_editor_eval_scripts) - ident(assert_match) stringoperator(,) - ident(in_place_editor)operator(() stringoperator(,) - symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(,) - symbol(:script) operator(=)operator(>) pre_constant(true) operator(\)) - reserved(end) - -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(JavaScriptHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(JavaScriptHelper) - - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(UrlHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TextHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(CaptureHelper) - - reserved(def) method(test_define_javascript_functions) - comment(# check if prototype.js is included first) - ident(assert_not_nil) ident(define_javascript_functions)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(1)operator(])operator(.)ident(match)operator(()regexpoperator(\)) - - comment(# check that scriptaculous.js is not in here, only needed if loaded remotely) - ident(assert_nil) ident(define_javascript_functions)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(1)operator(])operator(.)ident(match)operator(()regexpoperator(\)) - reserved(end) - - reserved(def) method(test_escape_javascript) - ident(assert_equal) stringoperator(,) ident(escape_javascript)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_link_to_function) - ident(assert_dom_equal) stringGreeting)delimiter(\))>operator(,) - ident(link_to_function)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_link_to_function_with_existing_onclick) - ident(assert_dom_equal) stringGreeting)delimiter(\))>operator(,) - ident(link_to_function)operator(()stringoperator(,) stringoperator(,) symbol(:onclick) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_button_to_function) - ident(assert_dom_equal) string)delimiter(\))>operator(,) - ident(button_to_function)operator(()stringoperator(,) stringoperator(\)) - reserved(end) -reserved(end) -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string comment(# for stringify_keys) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string comment(# for human_size) - -reserved(class) class(NumberHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(NumberHelper) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Hash) - - reserved(def) method(test_number_to_phone) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_phone)operator(()integer(1235551234)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_phone)operator(()integer(1235551234)operator(,) operator({)symbol(:area_code) operator(=)operator(>) pre_constant(true)operator(})operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_phone)operator(()integer(1235551234)operator(,) operator({)symbol(:delimiter) operator(=)operator(>) stringoperator(})operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_phone)operator(()integer(1235551234)operator(,) operator({)symbol(:area_code) operator(=)operator(>) pre_constant(true)operator(,) symbol(:extension) operator(=)operator(>) integer(555)operator(})operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_phone)operator(()integer(1235551234)operator(,) symbol(:extension) operator(=)operator(>) stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_number_to_currency) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_currency)operator(()float(1234567890.50)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_currency)operator(()float(1234567890.506)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_currency)operator(()float(1234567890.50)operator(,) operator({)symbol(:precision) operator(=)operator(>) integer(0)operator(})operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_currency)operator(()float(1234567890.50)operator(,) operator({)symbol(:precision) operator(=)operator(>) integer(1)operator(})operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_currency)operator(()float(1234567890.50)operator(,) operator({)symbol(:unit) operator(=)operator(>) stringoperator(,) symbol(:separator) operator(=)operator(>) stringoperator(,) symbol(:delimiter) operator(=)operator(>) stringoperator(})operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_number_to_percentage) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_percentage)operator(()integer(100)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_percentage)operator(()integer(100)operator(,) operator({)symbol(:precision) operator(=)operator(>) integer(0)operator(})operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(number_to_percentage)operator(()float(302.0574)operator(,) operator({)symbol(:precision) operator(=)operator(>) integer(2)operator(})operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_number_with_delimiter) - ident(assert_equal)operator(()stringoperator(,) ident(number_with_delimiter)operator(()integer(12345678)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_number_to_human_size) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()integer(0)operator(\)) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()float(3.14159265)operator(\)) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()float(123.0)operator(\)) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()integer(123)operator(\)) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()integer(1234)operator(\)) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()integer(12345)operator(\)) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()integer(1234567)operator(\)) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()integer(1234567890)operator(\)) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()integer(1234567890123)operator(\)) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()integer(444)operator(.)ident(kilobytes)operator(\)) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()integer(1023)operator(.)ident(megabytes)operator(\)) - ident(assert_equal) stringoperator(,) ident(human_size)operator(()integer(3)operator(.)ident(terabytes)operator(\)) - ident(assert_nil) ident(human_size)operator(()stringoperator(\)) - ident(assert_nil) ident(human_size)operator(()pre_constant(nil)operator(\)) - reserved(end) - - reserved(def) method(test_number_with_precision) - ident(assert_equal)operator(()stringoperator(,) ident(number_with_precision)operator(()float(111.2346)operator(\))operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(BaseTest) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(JavaScriptHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(PrototypeHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(ScriptaculousHelper) - - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(UrlHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TextHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(CaptureHelper) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(Class)operator(.)ident(new) reserved(do) - reserved(def) method(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) - ident(url) operator(=) string - ident(url) operator(<<) ident(options)operator([)symbol(:action)operator(])operator(.)ident(to_s) reserved(if) ident(options) reserved(and) ident(options)operator([)symbol(:action)operator(]) - ident(url) operator(<<) stringdelimiter(")> reserved(if) ident(options) operator(&&) ident(options)operator([)symbol(:a)operator(]) - ident(url) operator(<<) stringdelimiter(")> reserved(if) ident(options) operator(&&) ident(options)operator([)symbol(:a)operator(]) operator(&&) ident(options)operator([)symbol(:b)operator(]) - ident(url) - reserved(end) - reserved(end)operator(.)ident(new) - reserved(end) - -ident(protected) - reserved(def) method(create_generator) - ident(block) operator(=) constant(Proc)operator(.)ident(new) operator({) operator(|*)ident(args)operator(|) reserved(yield) operator(*)ident(args) reserved(if) ident(block_given?) operator(}) - constant(JavaScriptGenerator)operator(.)ident(new) pre_constant(self)operator(,) operator(&)ident(block) - reserved(end) -reserved(end) - -reserved(class) class(PrototypeHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(BaseTest) - - reserved(def) method(test_link_to_remote) - ident(assert_dom_equal) stringRemote outpost)delimiter(\))>operator(,) - ident(link_to_remote)operator(()stringoperator(,) operator({) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(})operator(,) operator({) symbol(:class) operator(=)operator(>) string operator(})operator(\)) - ident(assert_dom_equal) stringRemote outpost)delimiter(\))>operator(,) - ident(link_to_remote)operator(()stringoperator(,) symbol(:complete) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - ident(assert_dom_equal) stringRemote outpost)delimiter(\))>operator(,) - ident(link_to_remote)operator(()stringoperator(,) symbol(:success) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - ident(assert_dom_equal) stringRemote outpost)delimiter(\))>operator(,) - ident(link_to_remote)operator(()stringoperator(,) symbol(:failure) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - ident(assert_dom_equal) stringRemote outpost)delimiter(\))>operator(,) - ident(link_to_remote)operator(()stringoperator(,) symbol(:failure) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:a) operator(=)operator(>) stringoperator(,) symbol(:b) operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(test_periodically_call_remote) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(periodically_call_remote)operator(()symbol(:update) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(test_form_remote_tag) - ident(assert_dom_equal) string)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(\)) - ident(assert_dom_equal) string)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) operator({) symbol(:success) operator(=)operator(>) string operator(})operator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(\)) - ident(assert_dom_equal) string)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) operator({) symbol(:failure) operator(=)operator(>) string operator(})operator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(\)) - ident(assert_dom_equal) string)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) operator({) symbol(:success) operator(=)operator(>) stringoperator(,) symbol(:failure) operator(=)operator(>) string operator(})operator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(\)) - reserved(end) - - reserved(def) method(test_on_callbacks) - ident(callbacks) operator(=) operator([)symbol(:uninitialized)operator(,) symbol(:loading)operator(,) symbol(:loaded)operator(,) symbol(:interactive)operator(,) symbol(:complete)operator(,) symbol(:success)operator(,) symbol(:failure)operator(]) - ident(callbacks)operator(.)ident(each) reserved(do) operator(|)ident(callback)operator(|) - ident(assert_dom_equal) stringcontent(:function)nesting_delimiter(()content(request)nesting_delimiter(\))content({monkeys)nesting_delimiter(()nesting_delimiter(\))content(;}, parameters:Form.serialize)nesting_delimiter(()content(this)nesting_delimiter(\))content(})nesting_delimiter(\))content(; return false;">)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(,) ident(callback)operator(=)operator(>)stringoperator(\)) - ident(assert_dom_equal) stringcontent(:function)nesting_delimiter(()content(request)nesting_delimiter(\))content({monkeys)nesting_delimiter(()nesting_delimiter(\))content(;}, parameters:Form.serialize)nesting_delimiter(()content(this)nesting_delimiter(\))content(})nesting_delimiter(\))content(; return false;">)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) operator({) symbol(:success) operator(=)operator(>) string operator(})operator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(,) ident(callback)operator(=)operator(>)stringoperator(\)) - ident(assert_dom_equal) stringcontent(:function)nesting_delimiter(()content(request)nesting_delimiter(\))content({monkeys)nesting_delimiter(()nesting_delimiter(\))content(;}, parameters:Form.serialize)nesting_delimiter(()content(this)nesting_delimiter(\))content(})nesting_delimiter(\))content(; return false;">)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) operator({) symbol(:failure) operator(=)operator(>) string operator(})operator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(,) ident(callback)operator(=)operator(>)stringoperator(\)) - ident(assert_dom_equal) stringcontent(:function)nesting_delimiter(()content(request)nesting_delimiter(\))content({monkeys)nesting_delimiter(()nesting_delimiter(\))content(;}, parameters:Form.serialize)nesting_delimiter(()content(this)nesting_delimiter(\))content(})nesting_delimiter(\))content(; return false;">)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) operator({) symbol(:success) operator(=)operator(>) stringoperator(,) symbol(:failure) operator(=)operator(>) string operator(})operator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(,) ident(callback)operator(=)operator(>)stringoperator(\)) - reserved(end) - - comment(#HTTP status codes 200 up to 599 have callbacks) - comment(#these should work) - integer(100)operator(.)ident(upto)operator(()integer(599)operator(\)) reserved(do) operator(|)ident(callback)operator(|) - ident(assert_dom_equal) stringcontent(:function)nesting_delimiter(()content(request)nesting_delimiter(\))content({monkeys)nesting_delimiter(()nesting_delimiter(\))content(;}, parameters:Form.serialize)nesting_delimiter(()content(this)nesting_delimiter(\))content(})nesting_delimiter(\))content(; return false;">)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(,) ident(callback)operator(=)operator(>)stringoperator(\)) - reserved(end) - - comment(#test 200 and 404) - ident(assert_dom_equal) string)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(,) integer(200)operator(=)operator(>)stringoperator(,) integer(404)operator(=)operator(>)stringoperator(\)) - - comment(#these shouldn't) - integer(1)operator(.)ident(upto)operator(()integer(99)operator(\)) reserved(do) operator(|)ident(callback)operator(|) - ident(assert_dom_equal) string)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(,) ident(callback)operator(=)operator(>)stringoperator(\)) - reserved(end) - integer(600)operator(.)ident(upto)operator(()integer(999)operator(\)) reserved(do) operator(|)ident(callback)operator(|) - ident(assert_dom_equal) string)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(,) ident(callback)operator(=)operator(>)stringoperator(\)) - reserved(end) - - comment(#test ultimate combo) - ident(assert_dom_equal) string)delimiter(\))>operator(,) - ident(form_remote_tag)operator(()symbol(:update) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) symbol(:fast) operator(})operator(,) symbol(:loading) operator(=)operator(>) stringoperator(,) symbol(:success) operator(=)operator(>) stringoperator(,) symbol(:failure) operator(=)operator(>) stringoperator(,) symbol(:complete) operator(=)operator(>) stringoperator(,) integer(200)operator(=)operator(>)stringoperator(,) integer(404)operator(=)operator(>)stringoperator(\)) - - reserved(end) - - reserved(def) method(test_submit_to_remote) - ident(assert_dom_equal) string)delimiter(\))>operator(,) - ident(submit_to_remote)operator(()stringoperator(,) integer(1_000_000)operator(,) symbol(:update) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_observe_field) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(observe_field)operator(()stringoperator(,) symbol(:frequency) operator(=)operator(>) integer(5)operator(.)ident(minutes)operator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(test_observe_field_using_function_for_callback) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(observe_field)operator(()stringoperator(,) symbol(:frequency) operator(=)operator(>) integer(5)operator(.)ident(minutes)operator(,) symbol(:function) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_observe_form) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(observe_form)operator(()stringoperator(,) symbol(:frequency) operator(=)operator(>) integer(2)operator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(test_observe_form_using_function_for_callback) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(observe_form)operator(()stringoperator(,) symbol(:frequency) operator(=)operator(>) integer(2)operator(,) symbol(:function) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_update_element_function) - ident(assert_equal) stringoperator(,) - ident(update_element_function)operator(()stringoperator(,) symbol(:content) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) - ident(update_element_function)operator(()stringoperator(,) symbol(:action) operator(=)operator(>) symbol(:update)operator(,) symbol(:content) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) - ident(update_element_function)operator(()stringoperator(,) symbol(:action) operator(=)operator(>) symbol(:empty)operator(\)) - ident(assert_equal) stringoperator(,) - ident(update_element_function)operator(()stringoperator(,) symbol(:action) operator(=)operator(>) symbol(:remove)operator(\)) - - ident(assert_equal) stringoperator(,) - ident(update_element_function)operator(()stringoperator(,) symbol(:position) operator(=)operator(>) stringoperator(,) symbol(:content) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) - ident(update_element_function)operator(()stringoperator(,) symbol(:action) operator(=)operator(>) symbol(:update)operator(,) symbol(:position) operator(=)operator(>) symbol(:bottom)operator(,) symbol(:content) operator(=)operator(>) stringoperator(\)) - - ident(_erbout) operator(=) string - ident(assert_equal) stringoperator(,) - ident(update_element_function)operator(()stringoperator(\)) operator({) ident(_erbout) operator(<<) string operator(}) - - ident(_erbout) operator(=) string - ident(assert_equal) stringoperator(,) - ident(update_element_function)operator(()stringoperator(,) symbol(:content) operator(=)operator(>) stringoperator(\)) operator({) ident(_erbout) operator(<<) string operator(}) - reserved(end) - - reserved(def) method(test_update_page) - ident(block) operator(=) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(page)operator(|) ident(page)operator(.)ident(replace_html)operator(()stringoperator(,) stringoperator(\)) operator(}) - ident(assert_equal) ident(create_generator)operator(()operator(&)ident(block)operator(\))operator(.)ident(to_s)operator(,) ident(update_page)operator(()operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(test_update_page_tag) - ident(block) operator(=) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(page)operator(|) ident(page)operator(.)ident(replace_html)operator(()stringoperator(,) stringoperator(\)) operator(}) - ident(assert_equal) ident(javascript_tag)operator(()ident(create_generator)operator(()operator(&)ident(block)operator(\))operator(.)ident(to_s)operator(\))operator(,) ident(update_page_tag)operator(()operator(&)ident(block)operator(\)) - reserved(end) -reserved(end) - -reserved(class) class(JavaScriptGeneratorTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(BaseTest) - - reserved(def) method(setup) - reserved(super) - instance_variable(@generator) operator(=) ident(create_generator) - reserved(end) - - reserved(def) method(test_insert_html_with_string) - ident(assert_equal) stringThis is a test

    "\);)delimiter(')>operator(,) - instance_variable(@generator)operator(.)ident(insert_html)operator(()symbol(:top)operator(,) stringoperator(,) stringThis is a test

    )delimiter(')>operator(\)) - ident(assert_equal) stringThis is a test

    "\);)delimiter(')>operator(,) - instance_variable(@generator)operator(.)ident(insert_html)operator(()symbol(:bottom)operator(,) stringoperator(,) stringThis is a test

    )delimiter(')>operator(\)) - ident(assert_equal) stringThis is a test

    "\);)delimiter(')>operator(,) - instance_variable(@generator)operator(.)ident(insert_html)operator(()symbol(:before)operator(,) stringoperator(,) stringThis is a test

    )delimiter(')>operator(\)) - ident(assert_equal) stringThis is a test

    "\);)delimiter(')>operator(,) - instance_variable(@generator)operator(.)ident(insert_html)operator(()symbol(:after)operator(,) stringoperator(,) stringThis is a test

    )delimiter(')>operator(\)) - reserved(end) - - reserved(def) method(test_replace_html_with_string) - ident(assert_equal) stringThis is a test

    "\);)delimiter(')>operator(,) - instance_variable(@generator)operator(.)ident(replace_html)operator(()stringoperator(,) stringThis is a test

    )delimiter(')>operator(\)) - reserved(end) - - reserved(def) method(test_replace_element_with_string) - ident(assert_equal) string

    This is a test

    "\);)delimiter(')>operator(,) - instance_variable(@generator)operator(.)ident(replace)operator(()stringoperator(,) string

    This is a test

    )delimiter(')>operator(\)) - reserved(end) - - reserved(def) method(test_remove) - ident(assert_equal) stringoperator(,) - instance_variable(@generator)operator(.)ident(remove)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) - instance_variable(@generator)operator(.)ident(remove)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_show) - ident(assert_equal) stringoperator(,) - instance_variable(@generator)operator(.)ident(show)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) - instance_variable(@generator)operator(.)ident(show)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_hide) - ident(assert_equal) stringoperator(,) - instance_variable(@generator)operator(.)ident(hide)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) - instance_variable(@generator)operator(.)ident(hide)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_alert) - ident(assert_equal) stringoperator(,) instance_variable(@generator)operator(.)ident(alert)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_redirect_to) - ident(assert_equal) stringoperator(,) - instance_variable(@generator)operator(.)ident(redirect_to)operator(()symbol(:action) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_delay) - instance_variable(@generator)operator(.)ident(delay)operator(()integer(20)operator(\)) reserved(do) - instance_variable(@generator)operator(.)ident(hide)operator(()stringoperator(\)) - reserved(end) - - ident(assert_equal) stringoperator(,) instance_variable(@generator)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_to_s) - instance_variable(@generator)operator(.)ident(insert_html)operator(()symbol(:top)operator(,) stringoperator(,) stringThis is a test

    )delimiter(')>operator(\)) - instance_variable(@generator)operator(.)ident(insert_html)operator(()symbol(:bottom)operator(,) stringoperator(,) stringThis is a test

    )delimiter(')>operator(\)) - instance_variable(@generator)operator(.)ident(remove)operator(()stringoperator(,) stringoperator(\)) - instance_variable(@generator)operator(.)ident(replace_html)operator(()stringoperator(,) stringThis is a test

    )delimiter(')>operator(\)) - - ident(assert_equal) stringoperator(.)ident(chomp)operator(,) instance_variable(@generator)operator(.)ident(to_s)stringThis is a test

    "\); -new Insertion.Bottom("element", "

    This is a test

    "\); -["foo", "bar"].each(Element.remove\); -Element.update("baz", "

    This is a test

    "\);)delimiter( - EOS)> - reserved(end) - - reserved(def) method(test_element_access) - ident(assert_equal) stringoperator(,) instance_variable(@generator)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_element_proxy_one_deep) - instance_variable(@generator)operator([)stringoperator(])operator(.)ident(hide) - ident(assert_equal) stringoperator(,) instance_variable(@generator)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_element_proxy_assignment) - instance_variable(@generator)operator([)stringoperator(])operator(.)ident(width) operator(=) integer(400) - ident(assert_equal) stringoperator(,) instance_variable(@generator)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_element_proxy_two_deep) - instance_variable(@generator)operator([)stringoperator(])operator(.)ident(hide)operator(()stringoperator(\))operator(.)ident(clean_whitespace) - ident(assert_equal) stringoperator(,) instance_variable(@generator)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_select_access) - ident(assert_equal) stringoperator(,) instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_select_proxy_one_deep) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(first)operator(.)ident(hide) - ident(assert_equal) stringoperator(,) instance_variable(@generator)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_visual_effect) - ident(assert_equal) stringoperator(,) - instance_variable(@generator)operator(.)ident(visual_effect)operator(()symbol(:puff)operator(,)stringoperator(\)) - reserved(end) - - reserved(def) method(test_visual_effect_toggle) - ident(assert_equal) stringoperator(,) - instance_variable(@generator)operator(.)ident(visual_effect)operator(()symbol(:toggle_appear)operator(,)stringoperator(\)) - reserved(end) - - reserved(def) method(test_sortable) - ident(assert_equal) stringoperator(,) - instance_variable(@generator)operator(.)ident(sortable)operator(()stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(test_draggable) - ident(assert_equal) stringoperator(,) - instance_variable(@generator)operator(.)ident(draggable)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_drop_receiving) - ident(assert_equal) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(test_collection_first_and_last) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(first)operator(.)ident(hide)operator(()operator(\)) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(last)operator(.)ident(show)operator(()operator(\)) - ident(assert_equal) stringoperator(.)ident(strip)operator(,) instance_variable(@generator)operator(.)ident(to_s)string - reserved(end) - - reserved(def) method(test_collection_proxy_with_each) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(value)operator(|) - ident(value)operator(.)ident(remove_class_name) string - reserved(end) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(value)operator(,) ident(index)operator(|) - instance_variable(@generator)operator(.)ident(visual_effect) symbol(:highlight)operator(,) ident(value) - reserved(end) - ident(assert_equal) stringoperator(.)ident(strip)operator(,) instance_variable(@generator)operator(.)ident(to_s)string - reserved(end) - - reserved(def) method(test_collection_proxy_on_collect) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(collect)operator(()stringoperator(\)) operator({) operator(|)ident(para)operator(|) ident(para)operator(.)ident(show) operator(}) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(collect) operator({) operator(|)ident(para)operator(|) ident(para)operator(.)ident(hide) operator(}) - ident(assert_equal) stringoperator(.)ident(strip)operator(,) instance_variable(@generator)operator(.)ident(to_s)string - instance_variable(@generator) operator(=) ident(create_generator) - reserved(end) - - reserved(def) method(test_collection_proxy_with_grep) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(grep) stringoperator(,) regexp reserved(do) operator(|)ident(value)operator(|) - instance_variable(@generator) operator(<<) string - reserved(end) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(grep) stringoperator(,) regexp reserved(do) operator(|)ident(value)operator(,) ident(index)operator(|) - instance_variable(@generator)operator(.)ident(call) stringoperator(,) ident(value) - instance_variable(@generator) operator(<<) string - reserved(end) - - ident(assert_equal) stringoperator(.)ident(strip)operator(,) instance_variable(@generator)operator(.)ident(to_s)string - reserved(end) - - reserved(def) method(test_collection_proxy_with_inject) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(inject) stringoperator(,) operator([)operator(]) reserved(do) operator(|)ident(memo)operator(,) ident(value)operator(|) - instance_variable(@generator) operator(<<) string - reserved(end) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(inject) stringoperator(,) pre_constant(nil) reserved(do) operator(|)ident(memo)operator(,) ident(value)operator(,) ident(index)operator(|) - instance_variable(@generator)operator(.)ident(call) stringoperator(,) ident(memo) - instance_variable(@generator) operator(<<) string - reserved(end) - - ident(assert_equal) stringoperator(.)ident(strip)operator(,) instance_variable(@generator)operator(.)ident(to_s)string - reserved(end) - - reserved(def) method(test_collection_proxy_with_pluck) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(pluck)operator(()stringoperator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@generator)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_collection_proxy_with_zip) - constant(ActionView)operator(::)constant(Helpers)operator(::)constant(JavaScriptCollectionProxy)operator(.)ident(new)operator(()instance_variable(@generator)operator(,) stringoperator(\))operator(.)ident(zip)operator(()stringoperator(,) operator([)integer(4)operator(,) integer(5)operator(,) integer(6)operator(])operator(,) operator([)integer(7)operator(,) integer(8)operator(,) integer(9)operator(])operator(\)) - constant(ActionView)operator(::)constant(Helpers)operator(::)constant(JavaScriptCollectionProxy)operator(.)ident(new)operator(()instance_variable(@generator)operator(,) stringoperator(\))operator(.)ident(zip)operator(()stringoperator(,) operator([)integer(4)operator(,) integer(5)operator(,) integer(6)operator(])operator(,) operator([)integer(7)operator(,) integer(8)operator(,) integer(9)operator(])operator(\)) reserved(do) operator(|)ident(array)operator(|) - instance_variable(@generator)operator(.)ident(call) string - reserved(end) - - ident(assert_equal) stringoperator(.)ident(strip)operator(,) instance_variable(@generator)operator(.)ident(to_s)string - reserved(end) - - reserved(def) method(test_collection_proxy_with_find_all) - instance_variable(@generator)operator(.)ident(select)operator(()stringoperator(\))operator(.)ident(find_all) string reserved(do) operator(|)ident(value)operator(,) ident(index)operator(|) - instance_variable(@generator) operator(<<) string - reserved(end) - - ident(assert_equal) stringoperator(.)ident(strip)operator(,) instance_variable(@generator)operator(.)ident(to_s)string - reserved(end) - - reserved(def) method(test_debug_rjs) - constant(ActionView)operator(::)constant(Base)operator(.)ident(debug_rjs) operator(=) pre_constant(true) - instance_variable(@generator)operator([)stringoperator(])operator(.)ident(replace_html) string - ident(assert_equal) stringoperator(,) instance_variable(@generator)operator(.)ident(to_s) - reserved(ensure) - constant(ActionView)operator(::)constant(Base)operator(.)ident(debug_rjs) operator(=) pre_constant(false) - reserved(end) - - reserved(def) method(test_class_proxy) - instance_variable(@generator)operator(.)ident(form)operator(.)ident(focus)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@generator)operator(.)ident(to_s) - reserved(end) -reserved(end) - -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(ScriptaculousHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(JavaScriptHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(PrototypeHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(ScriptaculousHelper) - - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(UrlHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TextHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(FormHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(CaptureHelper) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(Class)operator(.)ident(new) reserved(do) - reserved(def) method(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) - ident(url) operator(=) string - ident(url) operator(<<) ident(options)operator([)symbol(:action)operator(])operator(.)ident(to_s) reserved(if) ident(options) reserved(and) ident(options)operator([)symbol(:action)operator(]) - ident(url) - reserved(end) - reserved(end)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_effect) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()symbol(:highlight)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()stringoperator(,) symbol(:posts)operator(\)) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()symbol(:highlight)operator(,) symbol(:posts)operator(\)) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()symbol(:fade)operator(,) stringoperator(,) symbol(:duration) operator(=)operator(>) float(4.0)operator(\)) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()symbol(:shake)operator(\)) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()symbol(:drop_out)operator(,) stringoperator(,) symbol(:queue) operator(=)operator(>) symbol(:end)operator(\)) - - comment(# chop the queue params into a comma separated list) - ident(beginning)operator(,) ident(ending) operator(=) stringoperator(,) string - ident(ve) operator(=) operator([) - ident(visual_effect)operator(()symbol(:drop_out)operator(,) stringoperator(,) symbol(:queue) operator(=)operator(>) operator({)symbol(:position) operator(=)operator(>) stringoperator(,) symbol(:scope) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(})operator(\))operator(,) - ident(visual_effect)operator(()symbol(:drop_out)operator(,) stringoperator(,) symbol(:queue) operator(=)operator(>) operator({)symbol(:scope) operator(=)operator(>) symbol(:list)operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(})operator(\))operator(,) - ident(visual_effect)operator(()symbol(:drop_out)operator(,) stringoperator(,) symbol(:queue) operator(=)operator(>) operator({)symbol(:position) operator(=)operator(>) symbol(:end)operator(,) symbol(:scope) operator(=)operator(>) symbol(:test)operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(})operator(\)) - operator(])operator(.)ident(collect) operator({) operator(|)ident(v)operator(|) ident(v)operator([)ident(beginning)operator(.)ident(length)operator(..)operator(-)ident(ending)operator(.)ident(length)operator(-)integer(1)operator(])operator(.)ident(split)operator(()stringoperator(\)) operator(}) - - ident(assert) ident(ve)operator([)integer(0)operator(])operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(ve)operator([)integer(0)operator(])operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(ve)operator([)integer(0)operator(])operator(.)ident(include?)operator(()stringoperator(\)) - - ident(assert) ident(ve)operator([)integer(1)operator(])operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(ve)operator([)integer(1)operator(])operator(.)ident(include?)operator(()stringoperator(\)) - - ident(assert) ident(ve)operator([)integer(2)operator(])operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(ve)operator([)integer(2)operator(])operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(ve)operator([)integer(2)operator(])operator(.)ident(include?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_toggle_effects) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()symbol(:toggle_appear)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()symbol(:toggle_slide)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()symbol(:toggle_blind)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()stringoperator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()stringoperator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(visual_effect)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - - reserved(def) method(test_sortable_element) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(sortable_element)operator(()stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - ident(assert_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(sortable_element)operator(()stringoperator(,) symbol(:tag) operator(=)operator(>) stringoperator(,) symbol(:constraint) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(|)>operator(,) - ident(sortable_element)operator(()stringoperator(,) symbol(:containment) operator(=)operator(>) operator([)stringoperator(,)stringoperator(])operator(,) symbol(:constraint) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(sortable_element)operator(()stringoperator(,) symbol(:containment) operator(=)operator(>) stringoperator(,) symbol(:constraint) operator(=)operator(>) stringoperator(,) symbol(:url) operator(=)operator(>) operator({) symbol(:action) operator(=)operator(>) string operator(})operator(\)) - reserved(end) - - reserved(def) method(test_draggable_element) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(draggable_element)operator(()stringoperator(\)) - ident(assert_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(draggable_element)operator(()stringoperator(,) symbol(:revert) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_drop_receiving_element) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(drop_receiving_element)operator(()stringoperator(\)) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(drop_receiving_element)operator(()stringoperator(,) symbol(:accept) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(drop_receiving_element)operator(()stringoperator(,) symbol(:accept) operator(=)operator(>) stringoperator(,) symbol(:update) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) string)char(\\n)content(//)char(\\n)content()delimiter(\))>operator(,) - ident(drop_receiving_element)operator(()stringoperator(,) symbol(:accept) operator(=)operator(>) operator([)stringoperator(,)stringoperator(])operator(,) symbol(:update) operator(=)operator(>) stringoperator(\)) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(TagHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(UrlHelper) - - reserved(def) method(test_tag) - ident(assert_equal) string)delimiter(")>operator(,) ident(tag)operator(()stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(tag)operator(()stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(,) ident(tag)operator(()stringoperator(,) symbol(:class) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_tag_options) - ident(assert_equal) string)delimiter(")>operator(,) ident(tag)operator(()stringoperator(,) string operator(=)operator(>) stringoperator(,) symbol(:class) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_tag_options_rejects_nil_option) - ident(assert_equal) string)delimiter(")>operator(,) ident(tag)operator(()stringoperator(,) symbol(:ignored) operator(=)operator(>) pre_constant(nil)operator(\)) - reserved(end) - - reserved(def) method(test_tag_options_accepts_blank_option) - ident(assert_equal) string)delimiter(")>operator(,) ident(tag)operator(()stringoperator(,) symbol(:included) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_tag_options_converts_boolean_option) - ident(assert_equal) string)delimiter(')>operator(,) - ident(tag)operator(()stringoperator(,) symbol(:disabled) operator(=)operator(>) pre_constant(true)operator(,) symbol(:multiple) operator(=)operator(>) pre_constant(true)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_content_tag) - ident(assert_equal) stringCreate)delimiter(")>operator(,) ident(content_tag)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(content_tag)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(,) - ident(content_tag)operator(()stringoperator(,) stringoperator(,) symbol(:href) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_cdata_section) - ident(assert_equal) string]]>)delimiter(")>operator(,) ident(cdata_section)operator(()string)delimiter(")>operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) stringcontent(/../testing_sandbox)delimiter(")> - -reserved(class) class(TextHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TextHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - ident(include) constant(TestingSandbox) - - reserved(def) method(setup) - comment(# This simulates the fact that instance variables are reset every time) - comment(# a view is rendered. The cycle helper depends on this behavior.) - instance_variable(@_cycles) operator(=) pre_constant(nil) reserved(if) operator(()reserved(defined?) instance_variable(@_cycles)operator(\)) - reserved(end) - - reserved(def) method(test_simple_format) - ident(assert_equal) stringcrazy)char(\\n)content(
    cross)char(\\n)content(
    platform linebreaks

    )delimiter(")>operator(,) ident(simple_format)operator(()stringoperator(\)) - ident(assert_equal) stringA paragraph

    )char(\\n)char(\\n)content(

    and another one!

    )delimiter(")>operator(,) ident(simple_format)operator(()stringoperator(\)) - ident(assert_equal) stringA paragraph)char(\\n)content(
    With a newline

    )delimiter(")>operator(,) ident(simple_format)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_truncate) - ident(assert_equal) stringoperator(,) ident(truncate)operator(()stringoperator(,) integer(12)operator(\)) - ident(assert_equal) stringoperator(,) ident(truncate)operator(()stringoperator(,) integer(12)operator(\)) - reserved(end) - - reserved(def) method(test_truncate_multibyte_without_kcode) - ident(result) operator(=) ident(execute_in_sandbox)operator(()stringoperator(\))string - - ident(assert_equal) stringoperator(,) ident(result) - reserved(end) - - reserved(def) method(test_truncate_multibyte_with_kcode) - ident(result) operator(=) ident(execute_in_sandbox)operator(()stringoperator(\))string - - ident(assert_equal) stringoperator(,) ident(result) - reserved(end) - - reserved(def) method(test_strip_links) - ident(assert_equal) stringoperator(,) ident(strip_links)operator(()stringon my mind)delimiter(")>operator(\)) - reserved(end) - - reserved(def) method(test_highlighter) - ident(assert_equal)operator(() - stringbeautiful
    morning)delimiter(")>operator(,) - ident(highlight)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - - ident(assert_equal)operator(() - stringbeautiful
    morning, but also a beautiful day)delimiter(")>operator(,) - ident(highlight)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - - ident(assert_equal)operator(() - stringbeautiful morning, but also a beautiful day)delimiter(")>operator(,) - ident(highlight)operator(()stringoperator(,) stringoperator(,) string)content(\\1)content()delimiter(')>operator(\)) - operator(\)) - - ident(assert_equal)operator(() - stringoperator(,) - ident(highlight)operator(()stringoperator(,) pre_constant(nil)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_highlighter_with_regexp) - ident(assert_equal)operator(() - stringbeautiful! morning)delimiter(")>operator(,) - ident(highlight)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - - ident(assert_equal)operator(() - stringbeautiful! morning)delimiter(")>operator(,) - ident(highlight)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - - ident(assert_equal)operator(() - stringbeautiful? morning)delimiter(")>operator(,) - ident(highlight)operator(()stringoperator(,) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_excerpt) - ident(assert_equal)operator(()stringoperator(,) ident(excerpt)operator(()stringoperator(,) stringoperator(,) integer(5)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(excerpt)operator(()stringoperator(,) stringoperator(,) integer(5)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(excerpt)operator(()stringoperator(,) stringoperator(,) integer(5)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(excerpt)operator(()stringoperator(,) stringoperator(,) integer(5)operator(\))operator(\)) - ident(assert_nil) ident(excerpt)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_excerpt_with_regex) - ident(assert_equal)operator(()stringoperator(,) ident(excerpt)operator(()stringoperator(,) stringoperator(,) integer(5)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(excerpt)operator(()stringoperator(,) stringoperator(,) integer(5)operator(\))operator(\)) - reserved(end) - - - reserved(def) method(test_word_wrap) - ident(assert_equal)operator(()stringoperator(,) ident(word_wrap)operator(()stringoperator(,) integer(15)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_pluralization) - ident(assert_equal)operator(()stringoperator(,) ident(pluralize)operator(()integer(1)operator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(pluralize)operator(()integer(2)operator(,) stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_auto_linking) - ident(email_raw) operator(=) string - ident(email_result) operator(=) string)inlinecontent()delimiter(})> - ident(link_raw) operator(=) string - ident(link_result) operator(=) string)inlinecontent()delimiter(})> - ident(link_result_with_options) operator(=) string)inlinecontent()delimiter(})> - ident(link2_raw) operator(=) string - ident(link2_result) operator(=) string)inlinecontent()delimiter(})> - ident(link3_raw) operator(=) string - ident(link3_result) operator(=) string)inlinecontent()delimiter(})> - ident(link4_raw) operator(=) string - ident(link4_result) operator(=) string)inlinecontent()delimiter(})> - ident(link5_raw) operator(=) string - ident(link5_result) operator(=) string)inlinecontent()delimiter(})> - - ident(assert_equal) stringdelimiter(\))>operator(,) ident(auto_link)operator(()stringdelimiter(")>operator(,) symbol(:email_addresses)operator(\)) - ident(assert_equal) stringdelimiter(\))>operator(,) ident(auto_link)operator(()stringdelimiter(")>operator(,) symbol(:urls)operator(\)) - ident(assert_equal) stringdelimiter(\))>operator(,) ident(auto_link)operator(()stringdelimiter(")>operator(,) symbol(:email_addresses)operator(\)) - ident(assert_equal) stringcontent( and say hello to )inlinedelimiter(\))>operator(,) ident(auto_link)operator(()stringcontent( and say hello to )inlinedelimiter(")>operator(\)) - ident(assert_equal) stringLink )inlinecontent(

    )delimiter(\))>operator(,) ident(auto_link)operator(()stringLink )inlinecontent(

    )delimiter(")>operator(\)) - ident(assert_equal) string)inlinecontent( Link

    )delimiter(\))>operator(,) ident(auto_link)operator(()string)inlinecontent( Link

    )delimiter(")>operator(\)) - ident(assert_equal) stringLink )inlinecontent(

    )delimiter(\))>operator(,) ident(auto_link)operator(()stringLink )inlinecontent(

    )delimiter(")>operator(,) symbol(:all)operator(,) operator({)symbol(:target) operator(=)operator(>) stringoperator(})operator(\)) - ident(assert_equal) stringcontent(.)delimiter(\))>operator(,) ident(auto_link)operator(()stringcontent(.)delimiter(\))>operator(\)) - ident(assert_equal) stringGo to )inlinecontent(, then say hello to )inlinecontent(.

    )delimiter(\))>operator(,) ident(auto_link)operator(()stringGo to )inlinecontent(, then say hello to )inlinecontent(.

    )delimiter(\))>operator(\)) - ident(assert_equal) stringdelimiter(\))>operator(,) ident(auto_link)operator(()stringdelimiter(")>operator(,) symbol(:urls)operator(\)) - ident(assert_equal) stringdelimiter(\))>operator(,) ident(auto_link)operator(()stringdelimiter(")>operator(,) symbol(:email_addresses)operator(\)) - ident(assert_equal) stringLink )inlinecontent(

    )delimiter(\))>operator(,) ident(auto_link)operator(()stringLink )inlinecontent(

    )delimiter(")>operator(\)) - ident(assert_equal) string)inlinecontent( Link

    )delimiter(\))>operator(,) ident(auto_link)operator(()string)inlinecontent( Link

    )delimiter(")>operator(\)) - ident(assert_equal) stringcontent(.)delimiter(\))>operator(,) ident(auto_link)operator(()stringcontent(.)delimiter(\))>operator(\)) - ident(assert_equal) stringSay hello to )inlinecontent(, then go to )inlinecontent(.

    )delimiter(\))>operator(,) ident(auto_link)operator(()stringSay hello to )inlinecontent(, then go to )inlinecontent(.

    )delimiter(\))>operator(\)) - ident(assert_equal) stringdelimiter(\))>operator(,) ident(auto_link)operator(()stringdelimiter(")>operator(,) symbol(:urls)operator(\)) - ident(assert_equal) stringdelimiter(\))>operator(,) ident(auto_link)operator(()stringdelimiter(")>operator(,) symbol(:email_addresses)operator(\)) - ident(assert_equal) stringLink )inlinecontent(

    )delimiter(\))>operator(,) ident(auto_link)operator(()stringLink )inlinecontent(

    )delimiter(")>operator(\)) - ident(assert_equal) string)inlinecontent( Link

    )delimiter(\))>operator(,) ident(auto_link)operator(()string)inlinecontent( Link

    )delimiter(")>operator(\)) - ident(assert_equal) stringcontent(.)delimiter(\))>operator(,) ident(auto_link)operator(()stringcontent(.)delimiter(\))>operator(\)) - ident(assert_equal) stringGo to )inlinecontent(. seriously, )inlinecontent(? i think I'll say hello to )inlinecontent(. instead.

    )delimiter(\))>operator(,) ident(auto_link)operator(()stringGo to )inlinecontent(. seriously, )inlinecontent(? i think I'll say hello to )inlinecontent(. instead.

    )delimiter(\))>operator(\)) - ident(assert_equal) stringLink )inlinecontent(

    )delimiter(\))>operator(,) ident(auto_link)operator(()stringLink )inlinecontent(

    )delimiter(")>operator(\)) - ident(assert_equal) string)inlinecontent( Link

    )delimiter(\))>operator(,) ident(auto_link)operator(()string)inlinecontent( Link

    )delimiter(")>operator(\)) - ident(assert_equal) string)inlinecontent( Link

    )delimiter(\))>operator(,) ident(auto_link)operator(()string)inlinecontent( Link

    )delimiter(")>operator(\)) - ident(assert_equal) stringoperator(,) ident(auto_link)operator(()pre_constant(nil)operator(\)) - ident(assert_equal) stringoperator(,) ident(auto_link)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_auto_link_at_eol) - ident(url1) operator(=) string - ident(url2) operator(=) string - - ident(assert_equal) string)inlinecontent(
    )inlinecontent(

    )delimiter(\))>operator(,) ident(auto_link)operator(()string)inlinecontent(
    )inlinecontent(

    )delimiter(")>operator(\)) - reserved(end) - - reserved(def) method(test_auto_link_with_block) - ident(url) operator(=) string - ident(email) operator(=) string - - ident(assert_equal) string)inlinecontent(...
    )inlinecontent(...

    )delimiter(\))>operator(,) ident(auto_link)operator(()string)inlinecontent(
    )inlinecontent(

    )delimiter(")>operator(\)) operator({) operator(|)ident(url)operator(|) ident(truncate)operator(()ident(url)operator(,) integer(10)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_sanitize_form) - ident(raw) operator(=) string)delimiter(")> - ident(result) operator(=) ident(sanitize)operator(()ident(raw)operator(\)) - ident(assert_equal) string</form>)delimiter(")>operator(,) ident(result) - reserved(end) - - reserved(def) method(test_sanitize_script) - ident(raw) operator(=) stringblah blah blah)delimiter(")> - ident(result) operator(=) ident(sanitize)operator(()ident(raw)operator(\)) - ident(assert_equal) stringblah blah blah</script>)delimiter(")>operator(,) ident(result) - reserved(end) - - reserved(def) method(test_sanitize_js_handlers) - ident(raw) operator(=) stringhello)delimiter(})> - ident(result) operator(=) ident(sanitize)operator(()ident(raw)operator(\)) - ident(assert_equal) stringhello)delimiter(})>operator(,) ident(result) - reserved(end) - - reserved(def) method(test_sanitize_javascript_href) - ident(raw) operator(=) stringfoo, bar)delimiter(})> - ident(result) operator(=) ident(sanitize)operator(()ident(raw)operator(\)) - ident(assert_equal) stringfoo, bar)delimiter(})>operator(,) ident(result) - reserved(end) - - reserved(def) method(test_cycle_class) - ident(value) operator(=) constant(Cycle)operator(.)ident(new)operator(()stringoperator(,) integer(2)operator(,) stringoperator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(value)operator(.)ident(to_s)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(value)operator(.)ident(to_s)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(value)operator(.)ident(to_s)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(value)operator(.)ident(to_s)operator(\)) - ident(value)operator(.)ident(reset) - ident(assert_equal)operator(()stringoperator(,) ident(value)operator(.)ident(to_s)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(value)operator(.)ident(to_s)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(value)operator(.)ident(to_s)operator(\)) - reserved(end) - - reserved(def) method(test_cycle_class_with_no_arguments) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) ident(value) operator(=) constant(Cycle)operator(.)ident(new)operator(()operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_cycle) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) integer(2)operator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) integer(2)operator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) integer(2)operator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) integer(2)operator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) integer(2)operator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) integer(2)operator(,) stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_cycle_with_no_arguments) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) ident(value) operator(=) ident(cycle)operator(()operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_cycle_resets_with_new_values) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_named_cycles) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_default_named_cycle) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_reset_cycle) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(\))operator(\)) - ident(reset_cycle) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_reset_unknown_cycle) - ident(reset_cycle)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_recet_named_cycle) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - ident(reset_cycle)operator(()stringoperator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_cycle_no_instance_variable_clashes) - instance_variable(@cycles) operator(=) string - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(cycle)operator(()stringoperator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@cycles)operator(\)) - reserved(end) - - reserved(def) method(test_strip_tags) - ident(assert_equal)operator(()stringoperator(,) ident(strip_tags)operator(()stringThis is a test.

    )delimiter(")>operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(strip_tags)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(() - stringoperator(,) ident(strip_tags)operator(() - stringThis is a test.)char(\\n)char(\\n)content()char(\\n)char(\\n)content(

    It no longer contains any HTML.

    )char(\\n)delimiter(})>operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(strip_tags)operator(()string here.)delimiter(")>operator(\))operator(\)) - reserved(end) - -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -constant(RequestMock) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:request_uri)operator(\)) - -reserved(class) class(UrlHelperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(AssetTagHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(UrlHelper) - ident(include) constant(ActionView)operator(::)constant(Helpers)operator(::)constant(TagHelper) - - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(Class)operator(.)ident(new) reserved(do) - ident(attr_accessor) symbol(:url) - reserved(def) method(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) - ident(url) - reserved(end) - reserved(end) - instance_variable(@controller) operator(=) instance_variable(@controller)operator(.)ident(new) - instance_variable(@controller)operator(.)ident(url) operator(=) string - reserved(end) - - reserved(def) method(test_url_for_escapes_urls) - instance_variable(@controller)operator(.)ident(url) operator(=) string - ident(assert_equal) stringoperator(,) ident(url_for)operator(()symbol(:a) operator(=)operator(>) stringoperator(,) symbol(:c) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(url_for)operator(()symbol(:a) operator(=)operator(>) stringoperator(,) symbol(:c) operator(=)operator(>) stringoperator(,) symbol(:escape) operator(=)operator(>) pre_constant(true)operator(\)) - ident(assert_equal) stringoperator(,) ident(url_for)operator(()symbol(:a) operator(=)operator(>) stringoperator(,) symbol(:c) operator(=)operator(>) stringoperator(,) symbol(:escape) operator(=)operator(>) pre_constant(false)operator(\)) - reserved(end) - - comment(# todo: missing test cases) - reserved(def) method(test_button_to_with_straight_url) - ident(assert_dom_equal) string
    )delimiter(")>operator(,) ident(button_to)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_button_to_with_query) - ident(assert_dom_equal) string
    )delimiter(")>operator(,) ident(button_to)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_button_to_with_query_and_no_name) - ident(assert_dom_equal) string
    )delimiter(")>operator(,) ident(button_to)operator(()pre_constant(nil)operator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_button_to_with_javascript_confirm) - ident(assert_dom_equal)operator(() - string
    )delimiter(")>operator(,) - ident(button_to)operator(()stringoperator(,) stringoperator(,) symbol(:confirm) operator(=)operator(>) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_button_to_enabled_disabled) - ident(assert_dom_equal)operator(() - string
    )delimiter(")>operator(,) - ident(button_to)operator(()stringoperator(,) stringoperator(,) symbol(:disabled) operator(=)operator(>) pre_constant(false)operator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - string
    )delimiter(")>operator(,) - ident(button_to)operator(()stringoperator(,) stringoperator(,) symbol(:disabled) operator(=)operator(>) pre_constant(true)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_link_tag_with_straight_url) - ident(assert_dom_equal) stringHello)delimiter(")>operator(,) ident(link_to)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_link_tag_with_query) - ident(assert_dom_equal) stringHello)delimiter(")>operator(,) ident(link_to)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_link_tag_with_query_and_no_name) - ident(assert_dom_equal) stringhttp://www.example.com?q1=v1&q2=v2)delimiter(")>operator(,) ident(link_to)operator(()pre_constant(nil)operator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_link_tag_with_img) - ident(assert_dom_equal) string)delimiter(")>operator(,) ident(link_to)operator(()string)delimiter(")>operator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_link_with_nil_html_options) - ident(assert_dom_equal) stringHello)delimiter(")>operator(,) ident(link_to)operator(()stringoperator(,) operator({)symbol(:action) operator(=)operator(>) stringoperator(})operator(,) pre_constant(nil)operator(\)) - reserved(end) - - reserved(def) method(test_link_tag_with_custom_onclick) - ident(assert_dom_equal) stringHello)delimiter(")>operator(,) ident(link_to)operator(()stringoperator(,) stringoperator(,) symbol(:onclick) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_link_tag_with_javascript_confirm) - ident(assert_dom_equal)operator(() - stringHello)delimiter(")>operator(,) - ident(link_to)operator(()stringoperator(,) stringoperator(,) symbol(:confirm) operator(=)operator(>) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - stringHello)delimiter(")>operator(,) - ident(link_to)operator(()stringoperator(,) stringoperator(,) symbol(:confirm) operator(=)operator(>) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - stringHello)delimiter(")>operator(,) - ident(link_to)operator(()stringoperator(,) stringoperator(,) symbol(:confirm) operator(=)operator(>) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_link_tag_with_popup) - ident(assert_dom_equal)operator(() - stringHello)delimiter(")>operator(,) - ident(link_to)operator(()stringoperator(,) stringoperator(,) symbol(:popup) operator(=)operator(>) pre_constant(true)operator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - stringHello)delimiter(")>operator(,) - ident(link_to)operator(()stringoperator(,) stringoperator(,) symbol(:popup) operator(=)operator(>) stringoperator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - stringHello)delimiter(")>operator(,) - ident(link_to)operator(()stringoperator(,) stringoperator(,) symbol(:popup) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_link_tag_with_popup_and_javascript_confirm) - ident(assert_dom_equal)operator(() - stringHello)delimiter(")>operator(,) - ident(link_to)operator(()stringoperator(,) stringoperator(,) operator({) symbol(:popup) operator(=)operator(>) pre_constant(true)operator(,) symbol(:confirm) operator(=)operator(>) string operator(})operator(\)) - operator(\)) - ident(assert_dom_equal)operator(() - stringHello)delimiter(")>operator(,) - ident(link_to)operator(()stringoperator(,) stringoperator(,) operator({) symbol(:popup) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(,) symbol(:confirm) operator(=)operator(>) string operator(})operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_link_tag_using_post_javascript) - ident(assert_dom_equal)operator(() - stringHello)delimiter(")>operator(,) - ident(link_to)operator(()stringoperator(,) stringoperator(,) symbol(:post) operator(=)operator(>) pre_constant(true)operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_link_tag_using_post_javascript_and_confirm) - ident(assert_dom_equal)operator(() - stringHello)delimiter(")>operator(,) - ident(link_to)operator(()stringoperator(,) stringoperator(,) symbol(:post) operator(=)operator(>) pre_constant(true)operator(,) symbol(:confirm) operator(=)operator(>) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_link_tag_using_post_javascript_and_popup) - ident(assert_raises)operator(()constant(ActionView)operator(::)constant(ActionViewError)operator(\)) operator({) ident(link_to)operator(()stringoperator(,) stringoperator(,) symbol(:popup) operator(=)operator(>) pre_constant(true)operator(,) symbol(:post) operator(=)operator(>) pre_constant(true)operator(,) symbol(:confirm) operator(=)operator(>) stringoperator(\)) operator(}) - reserved(end) - - reserved(def) method(test_link_to_unless) - ident(assert_equal) stringoperator(,) ident(link_to_unless)operator(()pre_constant(true)operator(,) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) stringListing)delimiter(")>operator(,) ident(link_to_unless)operator(()pre_constant(false)operator(,) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(link_to_unless)operator(()pre_constant(true)operator(,) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(1)operator(\)) - ident(assert_equal) stringShowing)delimiter(")>operator(,) ident(link_to_unless)operator(()pre_constant(true)operator(,) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(1)operator(\)) operator({) operator(|)ident(name)operator(,) ident(options)operator(,) ident(html_options)operator(,) operator(*)ident(parameters_for_method_reference)operator(|) - string)inlinecontent()delimiter(")> - operator(}) - ident(assert_equal) stringShowing)delimiter(")>operator(,) ident(link_to_unless)operator(()pre_constant(true)operator(,) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(1)operator(\)) operator({) operator(|)ident(name)operator(|) - string)inlinecontent()delimiter(")> - operator(}) - ident(assert_equal) stringoperator(,) ident(link_to_unless)operator(()pre_constant(true)operator(,) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(1)operator(\)) operator({) - string - operator(}) - reserved(end) - - reserved(def) method(test_link_to_if) - ident(assert_equal) stringoperator(,) ident(link_to_if)operator(()pre_constant(false)operator(,) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) stringListing)delimiter(")>operator(,) ident(link_to_if)operator(()pre_constant(true)operator(,) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(link_to_if)operator(()pre_constant(false)operator(,) stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(1)operator(\)) - reserved(end) - - reserved(def) method(xtest_link_unless_current) - instance_variable(@request) operator(=) constant(RequestMock)operator(.)ident(new)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(link_to_unless_current)operator(()stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(\)) - instance_variable(@request) operator(=) constant(RequestMock)operator(.)ident(new)operator(()stringoperator(\)) - ident(assert) stringListing)delimiter(")>operator(,) ident(link_to_unless_current)operator(()stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(\)) - - instance_variable(@request) operator(=) constant(RequestMock)operator(.)ident(new)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(link_to_unless_current)operator(()stringoperator(,) symbol(:action) operator(=)operator(>) stringoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:id) operator(=)operator(>) integer(1)operator(\)) - reserved(end) - - reserved(def) method(test_mail_to) - ident(assert_dom_equal) stringdavid@loudthinking.com)delimiter(")>operator(,) ident(mail_to)operator(()stringoperator(\)) - ident(assert_dom_equal) stringDavid Heinemeier Hansson)delimiter(")>operator(,) ident(mail_to)operator(()stringoperator(,) stringoperator(\)) - ident(assert_dom_equal)operator(() - stringDavid Heinemeier Hansson)delimiter(")>operator(,) - ident(mail_to)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - operator(\)) - ident(assert_equal) ident(mail_to)operator(()stringoperator(,) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(,) - ident(mail_to)operator(()stringoperator(,) stringoperator(,) symbol(:class) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_mail_to_with_javascript) - ident(assert_dom_equal) stringeval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%22%3e%4d%79%20%65%6d%61%69%6c%3c%2f%61%3e%27%29%3b'\)\))delimiter(")>operator(,) ident(mail_to)operator(()stringoperator(,) stringoperator(,) symbol(:encode) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_mail_with_options) - ident(assert_dom_equal)operator(() - stringMy email)delimiter(\))>operator(,) - ident(mail_to)operator(()stringoperator(,) stringoperator(,) symbol(:cc) operator(=)operator(>) stringoperator(,) symbol(:bcc) operator(=)operator(>) stringoperator(,) symbol(:subject) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) stringoperator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_mail_to_with_img) - ident(assert_dom_equal) string)delimiter(\))>operator(,) ident(mail_to)operator(()stringoperator(,) string)delimiter(')>operator(\)) - reserved(end) - - reserved(def) method(test_mail_to_with_hex) - ident(assert_dom_equal) stringMy email)delimiter(")>operator(,) ident(mail_to)operator(()stringoperator(,) stringoperator(,) symbol(:encode) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_mail_to_with_replace_options) - ident(assert_dom_equal) stringwolfgang(at\)stufenlos(dot\)net)delimiter(")>operator(,) ident(mail_to)operator(()stringoperator(,) pre_constant(nil)operator(,) symbol(:replace_at) operator(=)operator(>) stringoperator(,) symbol(:replace_dot) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) stringme(at\)domain.com)delimiter(")>operator(,) ident(mail_to)operator(()stringoperator(,) pre_constant(nil)operator(,) symbol(:encode) operator(=)operator(>) stringoperator(,) symbol(:replace_at) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) stringMy email)delimiter(")>operator(,) ident(mail_to)operator(()stringoperator(,) stringoperator(,) symbol(:encode) operator(=)operator(>) stringoperator(,) symbol(:replace_at) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) stringme(at\)domain(dot\)com)delimiter(")>operator(,) ident(mail_to)operator(()stringoperator(,) pre_constant(nil)operator(,) symbol(:encode) operator(=)operator(>) stringoperator(,) symbol(:replace_at) operator(=)operator(>) stringoperator(,) symbol(:replace_dot) operator(=)operator(>) stringoperator(\)) - ident(assert_dom_equal) stringeval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%22%3e%4d%79%20%65%6d%61%69%6c%3c%2f%61%3e%27%29%3b'\)\))delimiter(")>operator(,) ident(mail_to)operator(()stringoperator(,) stringoperator(,) symbol(:encode) operator(=)operator(>) stringoperator(,) symbol(:replace_at) operator(=)operator(>) stringoperator(,) symbol(:replace_dot) operator(=)operator(>) stringoperator(\)) - reserved(end) -reserved(end) -reserved(module) class(TestingSandbox) - - comment(# This whole thing *could* be much simpler, but I don't think Tempfile,) - comment(# popen and others exist on all platforms (like Windows\).) - reserved(def) method(execute_in_sandbox)operator(()ident(code)operator(\)) - ident(test_name) operator(=) stringcontent(/test.)inlinecontent(.rb)delimiter(")> - ident(res_name) operator(=) stringcontent(/test.)inlinecontent(.out)delimiter(")> - - constant(File)operator(.)ident(open)operator(()ident(test_name)operator(,) stringoperator(\)) reserved(do) operator(|)ident(file)operator(|) - ident(file)operator(.)ident(write)operator(()stringoperator(\))stringcontent( - end - print block.call)delimiter( - CODE)> - reserved(end) - - ident(system)operator(()stringcontent( > )inlinedelimiter(")>operator(\)) reserved(or) ident(raise) string - constant(File)operator(.)ident(read)operator(()ident(res_name)operator(\)) - reserved(ensure) - constant(File)operator(.)ident(delete)operator(()ident(test_name)operator(\)) reserved(rescue) pre_constant(nil) - constant(File)operator(.)ident(delete)operator(()ident(res_name)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - -reserved(end) -reserved(class) class(DirectoryCategory) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:fullViewableName)operator(,) symbol(:string) - ident(member) symbol(:specialEncoding)operator(,) symbol(:string) -reserved(end) - -reserved(class) class(ResultElement) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:summary)operator(,) symbol(:string) - ident(member) symbol(:URL)operator(,) symbol(:string) - ident(member) symbol(:snippet)operator(,) symbol(:string) - ident(member) symbol(:title)operator(,) symbol(:string) - ident(member) symbol(:cachedSize)operator(,) symbol(:string) - ident(member) symbol(:relatedInformationPresent)operator(,) symbol(:bool) - ident(member) symbol(:hostName)operator(,) symbol(:string) - ident(member) symbol(:directoryCategory)operator(,) constant(DirectoryCategory) - ident(member) symbol(:directoryTitle)operator(,) symbol(:string) -reserved(end) - -reserved(class) class(GoogleSearchResult) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:documentFiltering)operator(,) symbol(:bool) - ident(member) symbol(:searchComments)operator(,) symbol(:string) - ident(member) symbol(:estimatedTotalResultsCount)operator(,) symbol(:int) - ident(member) symbol(:estimateIsExact)operator(,) symbol(:bool) - ident(member) symbol(:resultElements)operator(,) operator([)constant(ResultElement)operator(]) - ident(member) symbol(:searchQuery)operator(,) symbol(:string) - ident(member) symbol(:startIndex)operator(,) symbol(:int) - ident(member) symbol(:endIndex)operator(,) symbol(:int) - ident(member) symbol(:searchTips)operator(,) symbol(:string) - ident(member) symbol(:directoryCategories)operator(,) operator([)constant(DirectoryCategory)operator(]) - ident(member) symbol(:searchTime)operator(,) symbol(:float) -reserved(end) - -reserved(class) class(GoogleSearchAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(inflect_names) pre_constant(false) - - ident(api_method) symbol(:doGetCachedPage)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:key)operator(=)operator(>)symbol(:string)operator(})operator(,) operator({)symbol(:url)operator(=)operator(>)symbol(:string)operator(})operator(]) - ident(api_method) symbol(:doGetSpellingSuggestion)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:key)operator(=)operator(>)symbol(:string)operator(})operator(,) operator({)symbol(:phrase)operator(=)operator(>)symbol(:string)operator(})operator(]) - - ident(api_method) symbol(:doGoogleSearch)operator(,) symbol(:returns) operator(=)operator(>) operator([)constant(GoogleSearchResult)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:key)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:q)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:start)operator(=)operator(>)symbol(:int)operator(})operator(,) - operator({)symbol(:maxResults)operator(=)operator(>)symbol(:int)operator(})operator(,) - operator({)symbol(:filter)operator(=)operator(>)symbol(:bool)operator(})operator(,) - operator({)symbol(:restrict)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:safeSearch)operator(=)operator(>)symbol(:bool)operator(})operator(,) - operator({)symbol(:lr)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:ie)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:oe)operator(=)operator(>)symbol(:string)operator(}) - operator(]) -reserved(end) -reserved(class) class(GoogleSearchController) operator(<) constant(ApplicationController) - ident(wsdl_service_name) string - - reserved(def) method(doGetCachedPage) - stringi am a cached page. my key was %s, url was %s)delimiter(")> operator(%) operator([)instance_variable(@params)operator([)stringoperator(])operator(,) instance_variable(@params)operator([)stringoperator(])operator(]) - reserved(end) - - reserved(def) method(doSpellingSuggestion) - string operator(%) operator([)instance_variable(@params)operator([)stringoperator(])operator(,) instance_variable(@params)operator([)stringoperator(])operator(]) - reserved(end) - - reserved(def) method(doGoogleSearch) - ident(resultElement) operator(=) constant(ResultElement)operator(.)ident(new) - ident(resultElement)operator(.)ident(summary) operator(=) string - ident(resultElement)operator(.)ident(URL) operator(=) string - ident(resultElement)operator(.)ident(snippet) operator(=) string operator(+) - string - ident(resultElement)operator(.)ident(title) operator(=) string - ident(resultElement)operator(.)ident(cachedSize) operator(=) string - ident(resultElement)operator(.)ident(relatedInformationPresent) operator(=) pre_constant(true) - ident(resultElement)operator(.)ident(hostName) operator(=) string - ident(resultElement)operator(.)ident(directoryCategory) operator(=) ident(category)operator(()stringoperator(,) stringoperator(\)) - - ident(result) operator(=) constant(GoogleSearchResult)operator(.)ident(new) - ident(result)operator(.)ident(documentFiltering) operator(=) instance_variable(@params)operator([)stringoperator(]) - ident(result)operator(.)ident(searchComments) operator(=) string - ident(result)operator(.)ident(estimatedTotalResultsCount) operator(=) integer(322000) - ident(result)operator(.)ident(estimateIsExact) operator(=) pre_constant(false) - ident(result)operator(.)ident(resultElements) operator(=) operator([)ident(resultElement)operator(]) - ident(result)operator(.)ident(searchQuery) operator(=) string - ident(result)operator(.)ident(startIndex) operator(=) instance_variable(@params)operator([)stringoperator(]) - ident(result)operator(.)ident(endIndex) operator(=) instance_variable(@params)operator([)stringoperator(]) operator(+) instance_variable(@params)operator([)stringoperator(]) - ident(result)operator(.)ident(searchTips) operator(=) string - ident(result)operator(.)ident(searchTime) operator(=) float(0.000001) - - comment(# For Mono, we have to clone objects if they're referenced by more than one place, otherwise) - comment(# the Ruby SOAP collapses them into one instance and uses references all over the) - comment(# place, confusing Mono. ) - comment(#) - comment(# This has recently been fixed:) - comment(# http://bugzilla.ximian.com/show_bug.cgi?id=72265) - ident(result)operator(.)ident(directoryCategories) operator(=) operator([) - ident(category)operator(()stringoperator(,) stringoperator(\))operator(,) - ident(category)operator(()stringoperator(,) stringoperator(\))operator(,) - operator(]) - - ident(result) - reserved(end) - - ident(private) - reserved(def) method(category)operator(()ident(name)operator(,) ident(encoding)operator(\)) - ident(cat) operator(=) constant(DirectoryCategory)operator(.)ident(new) - ident(cat)operator(.)ident(fullViewableName) operator(=) ident(name)operator(.)ident(dup) - ident(cat)operator(.)ident(specialEncoding) operator(=) ident(encoding)operator(.)ident(dup) - ident(cat) - reserved(end) -reserved(end) -reserved(class) class(DirectoryCategory) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:fullViewableName)operator(,) symbol(:string) - ident(member) symbol(:specialEncoding)operator(,) symbol(:string) -reserved(end) - -reserved(class) class(ResultElement) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:summary)operator(,) symbol(:string) - ident(member) symbol(:URL)operator(,) symbol(:string) - ident(member) symbol(:snippet)operator(,) symbol(:string) - ident(member) symbol(:title)operator(,) symbol(:string) - ident(member) symbol(:cachedSize)operator(,) symbol(:string) - ident(member) symbol(:relatedInformationPresent)operator(,) symbol(:bool) - ident(member) symbol(:hostName)operator(,) symbol(:string) - ident(member) symbol(:directoryCategory)operator(,) constant(DirectoryCategory) - ident(member) symbol(:directoryTitle)operator(,) symbol(:string) -reserved(end) - -reserved(class) class(GoogleSearchResult) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:documentFiltering)operator(,) symbol(:bool) - ident(member) symbol(:searchComments)operator(,) symbol(:string) - ident(member) symbol(:estimatedTotalResultsCount)operator(,) symbol(:int) - ident(member) symbol(:estimateIsExact)operator(,) symbol(:bool) - ident(member) symbol(:resultElements)operator(,) operator([)constant(ResultElement)operator(]) - ident(member) symbol(:searchQuery)operator(,) symbol(:string) - ident(member) symbol(:startIndex)operator(,) symbol(:int) - ident(member) symbol(:endIndex)operator(,) symbol(:int) - ident(member) symbol(:searchTips)operator(,) symbol(:string) - ident(member) symbol(:directoryCategories)operator(,) operator([)constant(DirectoryCategory)operator(]) - ident(member) symbol(:searchTime)operator(,) symbol(:float) -reserved(end) - -reserved(class) class(GoogleSearchAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(inflect_names) pre_constant(false) - - ident(api_method) symbol(:doGetCachedPage)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:key)operator(=)operator(>)symbol(:string)operator(})operator(,) operator({)symbol(:url)operator(=)operator(>)symbol(:string)operator(})operator(]) - ident(api_method) symbol(:doGetSpellingSuggestion)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:key)operator(=)operator(>)symbol(:string)operator(})operator(,) operator({)symbol(:phrase)operator(=)operator(>)symbol(:string)operator(})operator(]) - - ident(api_method) symbol(:doGoogleSearch)operator(,) symbol(:returns) operator(=)operator(>) operator([)constant(GoogleSearchResult)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:key)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:q)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:start)operator(=)operator(>)symbol(:int)operator(})operator(,) - operator({)symbol(:maxResults)operator(=)operator(>)symbol(:int)operator(})operator(,) - operator({)symbol(:filter)operator(=)operator(>)symbol(:bool)operator(})operator(,) - operator({)symbol(:restrict)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:safeSearch)operator(=)operator(>)symbol(:bool)operator(})operator(,) - operator({)symbol(:lr)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:ie)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:oe)operator(=)operator(>)symbol(:string)operator(}) - operator(]) -reserved(end) - -reserved(class) class(GoogleSearchService) operator(<) constant(ActionWebService)operator(::)constant(Base) - ident(web_service_api) constant(GoogleSearchAPI) - - reserved(def) method(doGetCachedPage)operator(()ident(key)operator(,) ident(url)operator(\)) - stringi am a cached page)delimiter(")> - reserved(end) - - reserved(def) method(doSpellingSuggestion)operator(()ident(key)operator(,) ident(phrase)operator(\)) - string - reserved(end) - - reserved(def) method(doGoogleSearch)operator(()ident(key)operator(,) ident(q)operator(,) ident(start)operator(,) ident(maxResults)operator(,) ident(filter)operator(,) ident(restrict)operator(,) ident(safeSearch)operator(,) ident(lr)operator(,) ident(ie)operator(,) ident(oe)operator(\)) - ident(resultElement) operator(=) constant(ResultElement)operator(.)ident(new) - ident(resultElement)operator(.)ident(summary) operator(=) string - ident(resultElement)operator(.)ident(URL) operator(=) string - ident(resultElement)operator(.)ident(snippet) operator(=) string operator(+) - string - ident(resultElement)operator(.)ident(title) operator(=) string - ident(resultElement)operator(.)ident(cachedSize) operator(=) string - ident(resultElement)operator(.)ident(relatedInformationPresent) operator(=) pre_constant(true) - ident(resultElement)operator(.)ident(hostName) operator(=) string - ident(resultElement)operator(.)ident(directoryCategory) operator(=) ident(category)operator(()stringoperator(,) stringoperator(\)) - - ident(result) operator(=) constant(GoogleSearchResult)operator(.)ident(new) - ident(result)operator(.)ident(documentFiltering) operator(=) ident(filter) - ident(result)operator(.)ident(searchComments) operator(=) string - ident(result)operator(.)ident(estimatedTotalResultsCount) operator(=) integer(322000) - ident(result)operator(.)ident(estimateIsExact) operator(=) pre_constant(false) - ident(result)operator(.)ident(resultElements) operator(=) operator([)ident(resultElement)operator(]) - ident(result)operator(.)ident(searchQuery) operator(=) string - ident(result)operator(.)ident(startIndex) operator(=) ident(start) - ident(result)operator(.)ident(endIndex) operator(=) ident(start) operator(+) ident(maxResults) - ident(result)operator(.)ident(searchTips) operator(=) string - ident(result)operator(.)ident(searchTime) operator(=) float(0.000001) - - comment(# For Mono, we have to clone objects if they're referenced by more than one place, otherwise) - comment(# the Ruby SOAP collapses them into one instance and uses references all over the) - comment(# place, confusing Mono. ) - comment(#) - comment(# This has recently been fixed:) - comment(# http://bugzilla.ximian.com/show_bug.cgi?id=72265) - ident(result)operator(.)ident(directoryCategories) operator(=) operator([) - ident(category)operator(()stringoperator(,) stringoperator(\))operator(,) - ident(category)operator(()stringoperator(,) stringoperator(\))operator(,) - operator(]) - - ident(result) - reserved(end) - - ident(private) - reserved(def) method(category)operator(()ident(name)operator(,) ident(encoding)operator(\)) - ident(cat) operator(=) constant(DirectoryCategory)operator(.)ident(new) - ident(cat)operator(.)ident(fullViewableName) operator(=) ident(name)operator(.)ident(dup) - ident(cat)operator(.)ident(specialEncoding) operator(=) ident(encoding)operator(.)ident(dup) - ident(cat) - reserved(end) -reserved(end) -ident(require) string - -reserved(class) class(SearchController) operator(<) constant(ApplicationController) - ident(wsdl_service_name) string - ident(web_service_dispatching_mode) symbol(:delegated) - ident(web_service) symbol(:beta3)operator(,) constant(GoogleSearchService)operator(.)ident(new) -reserved(end) -reserved(class) class(DirectoryCategory) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:fullViewableName)operator(,) symbol(:string) - ident(member) symbol(:specialEncoding)operator(,) symbol(:string) -reserved(end) - -reserved(class) class(ResultElement) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:summary)operator(,) symbol(:string) - ident(member) symbol(:URL)operator(,) symbol(:string) - ident(member) symbol(:snippet)operator(,) symbol(:string) - ident(member) symbol(:title)operator(,) symbol(:string) - ident(member) symbol(:cachedSize)operator(,) symbol(:string) - ident(member) symbol(:relatedInformationPresent)operator(,) symbol(:bool) - ident(member) symbol(:hostName)operator(,) symbol(:string) - ident(member) symbol(:directoryCategory)operator(,) constant(DirectoryCategory) - ident(member) symbol(:directoryTitle)operator(,) symbol(:string) -reserved(end) - -reserved(class) class(GoogleSearchResult) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:documentFiltering)operator(,) symbol(:bool) - ident(member) symbol(:searchComments)operator(,) symbol(:string) - ident(member) symbol(:estimatedTotalResultsCount)operator(,) symbol(:int) - ident(member) symbol(:estimateIsExact)operator(,) symbol(:bool) - ident(member) symbol(:resultElements)operator(,) operator([)constant(ResultElement)operator(]) - ident(member) symbol(:searchQuery)operator(,) symbol(:string) - ident(member) symbol(:startIndex)operator(,) symbol(:int) - ident(member) symbol(:endIndex)operator(,) symbol(:int) - ident(member) symbol(:searchTips)operator(,) symbol(:string) - ident(member) symbol(:directoryCategories)operator(,) operator([)constant(DirectoryCategory)operator(]) - ident(member) symbol(:searchTime)operator(,) symbol(:float) -reserved(end) - -reserved(class) class(GoogleSearchAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(inflect_names) pre_constant(false) - - ident(api_method) symbol(:doGetCachedPage)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:key)operator(=)operator(>)symbol(:string)operator(})operator(,) operator({)symbol(:url)operator(=)operator(>)symbol(:string)operator(})operator(]) - ident(api_method) symbol(:doGetSpellingSuggestion)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:key)operator(=)operator(>)symbol(:string)operator(})operator(,) operator({)symbol(:phrase)operator(=)operator(>)symbol(:string)operator(})operator(]) - - ident(api_method) symbol(:doGoogleSearch)operator(,) symbol(:returns) operator(=)operator(>) operator([)constant(GoogleSearchResult)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:key)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:q)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:start)operator(=)operator(>)symbol(:int)operator(})operator(,) - operator({)symbol(:maxResults)operator(=)operator(>)symbol(:int)operator(})operator(,) - operator({)symbol(:filter)operator(=)operator(>)symbol(:bool)operator(})operator(,) - operator({)symbol(:restrict)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:safeSearch)operator(=)operator(>)symbol(:bool)operator(})operator(,) - operator({)symbol(:lr)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:ie)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:oe)operator(=)operator(>)symbol(:string)operator(}) - operator(]) -reserved(end) -reserved(class) class(SearchController) operator(<) constant(ApplicationController) - ident(web_service_api) symbol(:google_search) - ident(wsdl_service_name) string - - reserved(def) method(doGetCachedPage) - stringi am a cached page. my key was %s, url was %s)delimiter(")> operator(%) operator([)instance_variable(@params)operator([)stringoperator(])operator(,) instance_variable(@params)operator([)stringoperator(])operator(]) - reserved(end) - - reserved(def) method(doSpellingSuggestion) - string operator(%) operator([)instance_variable(@params)operator([)stringoperator(])operator(,) instance_variable(@params)operator([)stringoperator(])operator(]) - reserved(end) - - reserved(def) method(doGoogleSearch) - ident(resultElement) operator(=) constant(ResultElement)operator(.)ident(new) - ident(resultElement)operator(.)ident(summary) operator(=) string - ident(resultElement)operator(.)ident(URL) operator(=) string - ident(resultElement)operator(.)ident(snippet) operator(=) string operator(+) - string - ident(resultElement)operator(.)ident(title) operator(=) string - ident(resultElement)operator(.)ident(cachedSize) operator(=) string - ident(resultElement)operator(.)ident(relatedInformationPresent) operator(=) pre_constant(true) - ident(resultElement)operator(.)ident(hostName) operator(=) string - ident(resultElement)operator(.)ident(directoryCategory) operator(=) ident(category)operator(()stringoperator(,) stringoperator(\)) - - ident(result) operator(=) constant(GoogleSearchResult)operator(.)ident(new) - ident(result)operator(.)ident(documentFiltering) operator(=) instance_variable(@params)operator([)stringoperator(]) - ident(result)operator(.)ident(searchComments) operator(=) string - ident(result)operator(.)ident(estimatedTotalResultsCount) operator(=) integer(322000) - ident(result)operator(.)ident(estimateIsExact) operator(=) pre_constant(false) - ident(result)operator(.)ident(resultElements) operator(=) operator([)ident(resultElement)operator(]) - ident(result)operator(.)ident(searchQuery) operator(=) string - ident(result)operator(.)ident(startIndex) operator(=) instance_variable(@params)operator([)stringoperator(]) - ident(result)operator(.)ident(endIndex) operator(=) instance_variable(@params)operator([)stringoperator(]) operator(+) instance_variable(@params)operator([)stringoperator(]) - ident(result)operator(.)ident(searchTips) operator(=) string - ident(result)operator(.)ident(searchTime) operator(=) float(0.000001) - - comment(# For Mono, we have to clone objects if they're referenced by more than one place, otherwise) - comment(# the Ruby SOAP collapses them into one instance and uses references all over the) - comment(# place, confusing Mono. ) - comment(#) - comment(# This has recently been fixed:) - comment(# http://bugzilla.ximian.com/show_bug.cgi?id=72265) - ident(result)operator(.)ident(directoryCategories) operator(=) operator([) - ident(category)operator(()stringoperator(,) stringoperator(\))operator(,) - ident(category)operator(()stringoperator(,) stringoperator(\))operator(,) - operator(]) - - ident(result) - reserved(end) - - ident(private) - reserved(def) method(category)operator(()ident(name)operator(,) ident(encoding)operator(\)) - ident(cat) operator(=) constant(DirectoryCategory)operator(.)ident(new) - ident(cat)operator(.)ident(fullViewableName) operator(=) ident(name)operator(.)ident(dup) - ident(cat)operator(.)ident(specialEncoding) operator(=) ident(encoding)operator(.)ident(dup) - ident(cat) - reserved(end) -reserved(end) -comment(#) -comment(# see the blogger API spec at http://www.blogger.com/developers/api/1_docs/) -comment(# note that the method signatures are subtly different to metaWeblog, they) -comment(# are not identical. take care to ensure you handle the different semantics) -comment(# properly if you want to support blogger API too, to get maximum compatibility.) -comment(#) - -reserved(module) class(Blog) - reserved(class) class(Blog) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:url)operator(,) symbol(:string) - ident(member) symbol(:blogid)operator(,) symbol(:string) - ident(member) symbol(:blogName)operator(,) symbol(:string) - reserved(end) - - reserved(class) class(User) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:nickname)operator(,) symbol(:string) - ident(member) symbol(:userid)operator(,) symbol(:string) - ident(member) symbol(:url)operator(,) symbol(:string) - ident(member) symbol(:email)operator(,) symbol(:string) - ident(member) symbol(:lastname)operator(,) symbol(:string) - ident(member) symbol(:firstname)operator(,) symbol(:string) - reserved(end) -reserved(end) - -comment(#) -comment(# blogger) -comment(#) -reserved(class) class(BloggerAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(inflect_names) pre_constant(false) - - ident(api_method) symbol(:newPost)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:appkey)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:blogid)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:username)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:password)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:content)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:publish)operator(=)operator(>)symbol(:bool)operator(}) - operator(]) - - ident(api_method) symbol(:editPost)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:bool)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:appkey)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:postid)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:username)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:password)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:content)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:publish)operator(=)operator(>)symbol(:bool)operator(}) - operator(]) - - ident(api_method) symbol(:getUsersBlogs)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)constant(Blog)operator(::)constant(Blog)operator(])operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:appkey)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:username)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:password)operator(=)operator(>)symbol(:string)operator(}) - operator(]) - - ident(api_method) symbol(:getUserInfo)operator(,) symbol(:returns) operator(=)operator(>) operator([)constant(Blog)operator(::)constant(User)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:appkey)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:username)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:password)operator(=)operator(>)symbol(:string)operator(}) - operator(]) -reserved(end) -ident(require) string - -reserved(class) class(BloggerService) operator(<) constant(ActionWebService)operator(::)constant(Base) - ident(web_service_api) constant(BloggerAPI) - - reserved(def) method(initialize) - instance_variable(@postid) operator(=) integer(0) - reserved(end) - - reserved(def) method(newPost)operator(()ident(key)operator(,) ident(id)operator(,) ident(user)operator(,) ident(pw)operator(,) ident(content)operator(,) ident(publish)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringcontent( user=)inlinecontent( pw=)inlinecontent(, content=)inlinecontent( [)inlinecontent(])delimiter(")> - operator(()instance_variable(@postid) operator(+=) integer(1)operator(\))operator(.)ident(to_s) - reserved(end) - - reserved(def) method(editPost)operator(()ident(key)operator(,) ident(post_id)operator(,) ident(user)operator(,) ident(pw)operator(,) ident(content)operator(,) ident(publish)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringcontent( user=)inlinecontent( pw=)inlinecontent( content=)inlinecontent( [)inlinecontent(])delimiter(")> - pre_constant(true) - reserved(end) - - reserved(def) method(getUsersBlogs)operator(()ident(key)operator(,) ident(user)operator(,) ident(pw)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> - ident(blog) operator(=) constant(Blog)operator(::)constant(Blog)operator(.)ident(new)operator(() - symbol(:url) operator(=)operator(>)stringoperator(,) - symbol(:blogid) operator(=)operator(>) stringoperator(,) - symbol(:blogName) operator(=)operator(>) string - operator(\)) - operator([)ident(blog)operator(]) - reserved(end) - - reserved(def) method(getUserInfo)operator(()ident(key)operator(,) ident(user)operator(,) ident(pw)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> - constant(Blog)operator(::)constant(User)operator(.)ident(new)operator(()symbol(:nickname) operator(=)operator(>) stringoperator(,) symbol(:email) operator(=)operator(>) stringoperator(\)) - reserved(end) -reserved(end) -comment(# ) -comment(# here lie structures, cousins of those on http://www.xmlrpc.com/metaWeblog) -comment(# but they don't necessarily the real world reflect) -comment(# so if you do, find that your client complains:) -comment(# please tell, of problems you suffered through) -comment(#) - -reserved(module) class(Blog) - reserved(class) class(Post) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:title)operator(,) symbol(:string) - ident(member) symbol(:link)operator(,) symbol(:string) - ident(member) symbol(:description)operator(,) symbol(:string) - ident(member) symbol(:author)operator(,) symbol(:string) - ident(member) symbol(:category)operator(,) symbol(:string) - ident(member) symbol(:comments)operator(,) symbol(:string) - ident(member) symbol(:guid)operator(,) symbol(:string) - ident(member) symbol(:pubDate)operator(,) symbol(:string) - reserved(end) - - reserved(class) class(Category) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:description)operator(,) symbol(:string) - ident(member) symbol(:htmlUrl)operator(,) symbol(:string) - ident(member) symbol(:rssUrl)operator(,) symbol(:string) - reserved(end) -reserved(end) - -comment(#) -comment(# metaWeblog) -comment(#) -reserved(class) class(MetaWeblogAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(inflect_names) pre_constant(false) - - ident(api_method) symbol(:newPost)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:blogid)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:username)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:password)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:struct)operator(=)operator(>)constant(Blog)operator(::)constant(Post)operator(})operator(,) - operator({)symbol(:publish)operator(=)operator(>)symbol(:bool)operator(}) - operator(]) - - ident(api_method) symbol(:editPost)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:bool)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:postid)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:username)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:password)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:struct)operator(=)operator(>)constant(Blog)operator(::)constant(Post)operator(})operator(,) - operator({)symbol(:publish)operator(=)operator(>)symbol(:bool)operator(})operator(,) - operator(]) - - ident(api_method) symbol(:getPost)operator(,) symbol(:returns) operator(=)operator(>) operator([)constant(Blog)operator(::)constant(Post)operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:postid)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:username)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:password)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator(]) - - ident(api_method) symbol(:getCategories)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)constant(Blog)operator(::)constant(Category)operator(])operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:blogid)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:username)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:password)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator(]) - - ident(api_method) symbol(:getRecentPosts)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)constant(Blog)operator(::)constant(Post)operator(])operator(])operator(,) symbol(:expects) operator(=)operator(>) operator([) - operator({)symbol(:blogid)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:username)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:password)operator(=)operator(>)symbol(:string)operator(})operator(,) - operator({)symbol(:numberOfPosts)operator(=)operator(>)symbol(:int)operator(})operator(,) - operator(]) -reserved(end) -ident(require) string - -reserved(class) class(MetaWeblogService) operator(<) constant(ActionWebService)operator(::)constant(Base) - ident(web_service_api) constant(MetaWeblogAPI) - - reserved(def) method(initialize) - instance_variable(@postid) operator(=) integer(0) - reserved(end) - - reserved(def) method(newPost)operator(()ident(id)operator(,) ident(user)operator(,) ident(pw)operator(,) ident(struct)operator(,) ident(publish)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringcontent( user=)inlinecontent( pw=)inlinecontent(, struct=)inlinecontent( [)inlinecontent(])delimiter(")> - operator(()instance_variable(@postid) operator(+=) integer(1)operator(\))operator(.)ident(to_s) - reserved(end) - - reserved(def) method(editPost)operator(()ident(post_id)operator(,) ident(user)operator(,) ident(pw)operator(,) ident(struct)operator(,) ident(publish)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringcontent( user=)inlinecontent( pw=)inlinecontent( struct=)inlinecontent( [)inlinecontent(])delimiter(")> - pre_constant(true) - reserved(end) - - reserved(def) method(getPost)operator(()ident(post_id)operator(,) ident(user)operator(,) ident(pw)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> - constant(Blog)operator(::)constant(Post)operator(.)ident(new)operator(()symbol(:title) operator(=)operator(>) stringoperator(,) symbol(:description) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(getCategories)operator(()ident(id)operator(,) ident(user)operator(,) ident(pw)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> - ident(cat) operator(=) constant(Blog)operator(::)constant(Category)operator(.)ident(new)operator(() - symbol(:description) operator(=)operator(>) stringoperator(,) - symbol(:htmlUrl) operator(=)operator(>) stringoperator(,) - symbol(:rssUrl) operator(=)operator(>) stringoperator(\)) - operator([)ident(cat)operator(]) - reserved(end) - - reserved(def) method(getRecentPosts)operator(()ident(id)operator(,) ident(user)operator(,) ident(pw)operator(,) ident(num)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringcontent( posts for )inlinecontent( on blog )inlinedelimiter(")> - ident(post1) operator(=) constant(Blog)operator(::)constant(Post)operator(.)ident(new)operator(() - symbol(:title) operator(=)operator(>) stringoperator(,) - symbol(:link) operator(=)operator(>) stringoperator(,) - symbol(:description) operator(=)operator(>) string - operator(\)) - ident(post2) operator(=) constant(Blog)operator(::)constant(Post)operator(.)ident(new)operator(() - symbol(:title) operator(=)operator(>) stringoperator(,) - symbol(:link) operator(=)operator(>) stringoperator(,) - symbol(:description) operator(=)operator(>) string - operator(\)) - operator([)ident(post1)operator(,) ident(post2)operator(]) - reserved(end) -reserved(end) -comment(#) -comment(# example controller implementing both blogger and metaWeblog APIs) -comment(# in a way that should be compatible with clients supporting both/either.) -comment(#) -comment(# test by pointing your client at http://URL/xmlrpc/api) -comment(# ) - -ident(require) string -ident(require) string - -reserved(class) class(XmlrpcController) operator(<) constant(ApplicationController) - ident(web_service_dispatching_mode) symbol(:layered) - - ident(web_service) symbol(:metaWeblog)operator(,) constant(MetaWeblogService)operator(.)ident(new) - ident(web_service) symbol(:blogger)operator(,) constant(BloggerService)operator(.)ident(new) -reserved(end) -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(API) comment(# :nodoc:) - comment(# A web service API class specifies the methods that will be available for) - comment(# invocation for an API. It also contains metadata such as the method type) - comment(# signature hints.) - comment(#) - comment(# It is not intended to be instantiated.) - comment(#) - comment(# It is attached to web service implementation classes like) - comment(# ActionWebService::Base and ActionController::Base derivatives by using) - comment(# container.web_service_api, where container is an) - comment(# ActionController::Base or a ActionWebService::Base.) - comment(#) - comment(# See ActionWebService::Container::Direct::ClassMethods for an example) - comment(# of use.) - reserved(class) class(Base) - comment(# Action WebService API subclasses should be reloaded by the dispatcher in Rails) - comment(# when Dependencies.mechanism = :load.) - ident(include) constant(Reloadable)operator(::)constant(Subclasses) - - comment(# Whether to transform the public API method names into camel-cased names ) - ident(class_inheritable_option) symbol(:inflect_names)operator(,) pre_constant(true) - - comment(# Whether to allow ActiveRecord::Base models in :expects.) - comment(# The default is +false+; you should be aware of the security implications) - comment(# of allowing this, and ensure that you don't allow remote callers to) - comment(# easily overwrite data they should not have access to.) - ident(class_inheritable_option) symbol(:allow_active_record_expects)operator(,) pre_constant(false) - - comment(# If present, the name of a method to call when the remote caller) - comment(# tried to call a nonexistent method. Semantically equivalent to) - comment(# +method_missing+.) - ident(class_inheritable_option) symbol(:default_api_method) - - comment(# Disallow instantiation) - ident(private_class_method) symbol(:new)operator(,) symbol(:allocate) - - reserved(class) operator(<<) class(self) - ident(include) constant(ActionWebService)operator(::)constant(SignatureTypes) - - comment(# API methods have a +name+, which must be the Ruby method name to use when) - comment(# performing the invocation on the web service object.) - comment(#) - comment(# The signatures for the method input parameters and return value can) - comment(# by specified in +options+.) - comment(#) - comment(# A signature is an array of one or more parameter specifiers. ) - comment(# A parameter specifier can be one of the following:) - comment(#) - comment(# * A symbol or string representing one of the Action Web Service base types.) - comment(# See ActionWebService::SignatureTypes for a canonical list of the base types.) - comment(# * The Class object of the parameter type) - comment(# * A single-element Array containing one of the two preceding items. This) - comment(# will cause Action Web Service to treat the parameter at that position) - comment(# as an array containing only values of the given type.) - comment(# * A Hash containing as key the name of the parameter, and as value) - comment(# one of the three preceding items) - comment(# ) - comment(# If no method input parameter or method return value signatures are given,) - comment(# the method is assumed to take no parameters and/or return no values of) - comment(# interest, and any values that are received by the server will be) - comment(# discarded and ignored.) - comment(#) - comment(# Valid options:) - comment(# [:expects] Signature for the method input parameters) - comment(# [:returns] Signature for the method return value) - comment(# [:expects_and_returns] Signature for both input parameters and return value) - reserved(def) method(api_method)operator(()ident(name)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - reserved(unless) ident(options)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(raise)operator(()constant(ActionWebServiceError)operator(,) stringoperator(\)) - reserved(end) - ident(validate_options)operator(()operator([)symbol(:expects)operator(,) symbol(:returns)operator(,) symbol(:expects_and_returns)operator(])operator(,) ident(options)operator(.)ident(keys)operator(\)) - reserved(if) ident(options)operator([)symbol(:expects_and_returns)operator(]) - ident(expects) operator(=) ident(options)operator([)symbol(:expects_and_returns)operator(]) - ident(returns) operator(=) ident(options)operator([)symbol(:expects_and_returns)operator(]) - reserved(else) - ident(expects) operator(=) ident(options)operator([)symbol(:expects)operator(]) - ident(returns) operator(=) ident(options)operator([)symbol(:returns)operator(]) - reserved(end) - ident(expects) operator(=) ident(canonical_signature)operator(()ident(expects)operator(\)) - ident(returns) operator(=) ident(canonical_signature)operator(()ident(returns)operator(\)) - reserved(if) ident(expects) - ident(expects)operator(.)ident(each) reserved(do) operator(|)ident(type)operator(|) - ident(type) operator(=) ident(type)operator(.)ident(element_type) reserved(if) ident(type)operator(.)ident(is_a?)operator(()constant(ArrayType)operator(\)) - reserved(if) ident(type)operator(.)ident(type_class)operator(.)ident(ancestors)operator(.)ident(include?)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(\)) operator(&&) operator(!)ident(allow_active_record_expects) - ident(raise)operator(()constant(ActionWebServiceError)operator(,) stringoperator(\)) - reserved(end) - reserved(end) - reserved(end) - ident(name) operator(=) ident(name)operator(.)ident(to_sym) - ident(public_name) operator(=) ident(public_api_method_name)operator(()ident(name)operator(\)) - ident(method) operator(=) constant(Method)operator(.)ident(new)operator(()ident(name)operator(,) ident(public_name)operator(,) ident(expects)operator(,) ident(returns)operator(\)) - ident(write_inheritable_hash)operator(()stringoperator(,) ident(name) operator(=)operator(>) ident(method)operator(\)) - ident(write_inheritable_hash)operator(()stringoperator(,) ident(public_name) operator(=)operator(>) ident(name)operator(\)) - reserved(end) - - comment(# Whether the given method name is a service method on this API) - reserved(def) method(has_api_method?)operator(()ident(name)operator(\)) - ident(api_methods)operator(.)ident(has_key?)operator(()ident(name)operator(\)) - reserved(end) - - comment(# Whether the given public method name has a corresponding service method) - comment(# on this API) - reserved(def) method(has_public_api_method?)operator(()ident(public_name)operator(\)) - ident(api_public_method_names)operator(.)ident(has_key?)operator(()ident(public_name)operator(\)) - reserved(end) - - comment(# The corresponding public method name for the given service method name) - reserved(def) method(public_api_method_name)operator(()ident(name)operator(\)) - reserved(if) ident(inflect_names) - ident(name)operator(.)ident(to_s)operator(.)ident(camelize) - reserved(else) - ident(name)operator(.)ident(to_s) - reserved(end) - reserved(end) - - comment(# The corresponding service method name for the given public method name) - reserved(def) method(api_method_name)operator(()ident(public_name)operator(\)) - ident(api_public_method_names)operator([)ident(public_name)operator(]) - reserved(end) - - comment(# A Hash containing all service methods on this API, and their) - comment(# associated metadata.) - reserved(def) method(api_methods) - ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator({)operator(}) - reserved(end) - - comment(# The Method instance for the given public API method name, if any) - reserved(def) method(public_api_method_instance)operator(()ident(public_method_name)operator(\)) - ident(api_method_instance)operator(()ident(api_method_name)operator(()ident(public_method_name)operator(\))operator(\)) - reserved(end) - - comment(# The Method instance for the given API method name, if any) - reserved(def) method(api_method_instance)operator(()ident(method_name)operator(\)) - ident(api_methods)operator([)ident(method_name)operator(]) - reserved(end) - - comment(# The Method instance for the default API method, if any) - reserved(def) method(default_api_method_instance) - reserved(return) pre_constant(nil) reserved(unless) ident(name) operator(=) ident(default_api_method) - ident(instance) operator(=) ident(read_inheritable_attribute)operator(()stringoperator(\)) - reserved(if) ident(instance) operator(&&) ident(instance)operator(.)ident(name) operator(==) ident(name) - reserved(return) ident(instance) - reserved(end) - ident(instance) operator(=) constant(Method)operator(.)ident(new)operator(()ident(name)operator(,) ident(public_api_method_name)operator(()ident(name)operator(\))operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(\)) - ident(write_inheritable_attribute)operator(()stringoperator(,) ident(instance)operator(\)) - ident(instance) - reserved(end) - - ident(private) - reserved(def) method(api_public_method_names) - ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator({)operator(}) - reserved(end) - - reserved(def) method(validate_options)operator(()ident(valid_option_keys)operator(,) ident(supplied_option_keys)operator(\)) - ident(unknown_option_keys) operator(=) ident(supplied_option_keys) operator(-) ident(valid_option_keys) - reserved(unless) ident(unknown_option_keys)operator(.)ident(empty?) - ident(raise)operator(()constant(ActionWebServiceError)operator(,) stringdelimiter(")>operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# Represents an API method and its associated metadata, and provides functionality) - comment(# to assist in commonly performed API method tasks.) - reserved(class) class(Method) - ident(attr) symbol(:name) - ident(attr) symbol(:public_name) - ident(attr) symbol(:expects) - ident(attr) symbol(:returns) - - reserved(def) method(initialize)operator(()ident(name)operator(,) ident(public_name)operator(,) ident(expects)operator(,) ident(returns)operator(\)) - instance_variable(@name) operator(=) ident(name) - instance_variable(@public_name) operator(=) ident(public_name) - instance_variable(@expects) operator(=) ident(expects) - instance_variable(@returns) operator(=) ident(returns) - instance_variable(@caster) operator(=) constant(ActionWebService)operator(::)constant(Casting)operator(::)constant(BaseCaster)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - reserved(end) - - comment(# The list of parameter names for this method) - reserved(def) method(param_names) - reserved(return) operator([)operator(]) reserved(unless) instance_variable(@expects) - instance_variable(@expects)operator(.)ident(map)operator({) operator(|)ident(type)operator(|) ident(type)operator(.)ident(name) operator(}) - reserved(end) - - comment(# Casts a set of Ruby values into the expected Ruby values) - reserved(def) method(cast_expects)operator(()ident(params)operator(\)) - instance_variable(@caster)operator(.)ident(cast_expects)operator(()ident(params)operator(\)) - reserved(end) - - comment(# Cast a Ruby return value into the expected Ruby value) - reserved(def) method(cast_returns)operator(()ident(return_value)operator(\)) - instance_variable(@caster)operator(.)ident(cast_returns)operator(()ident(return_value)operator(\)) - reserved(end) - - comment(# Returns the index of the first expected parameter) - comment(# with the given name) - reserved(def) method(expects_index_of)operator(()ident(param_name)operator(\)) - reserved(return) integer(-1) reserved(if) instance_variable(@expects)operator(.)ident(nil?) - operator(()integer(0)operator(..)operator(()instance_variable(@expects)operator(.)ident(length)operator(-)integer(1)operator(\))operator(\))operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - reserved(return) ident(i) reserved(if) instance_variable(@expects)operator([)ident(i)operator(])operator(.)ident(name)operator(.)ident(to_s) operator(==) ident(param_name)operator(.)ident(to_s) - reserved(end) - integer(-1) - reserved(end) - - comment(# Returns a hash keyed by parameter name for the given) - comment(# parameter list) - reserved(def) method(expects_to_hash)operator(()ident(params)operator(\)) - reserved(return) operator({)operator(}) reserved(if) instance_variable(@expects)operator(.)ident(nil?) - ident(h) operator(=) operator({)operator(}) - instance_variable(@expects)operator(.)ident(zip)operator(()ident(params)operator(\))operator({) operator(|)ident(type)operator(,) ident(param)operator(|) ident(h)operator([)ident(type)operator(.)ident(name)operator(]) operator(=) ident(param) operator(}) - ident(h) - reserved(end) - - comment(# Backwards compatibility with previous API) - reserved(def) method([])operator(()ident(sig_type)operator(\)) - reserved(case) ident(sig_type) - reserved(when) symbol(:expects) - instance_variable(@expects)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) ident(compat_signature_entry)operator(()ident(x)operator(\))operator(}) - reserved(when) symbol(:returns) - instance_variable(@returns)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) ident(compat_signature_entry)operator(()ident(x)operator(\))operator(}) - reserved(end) - reserved(end) - - comment(# String representation of this method) - reserved(def) method(to_s) - ident(fqn) operator(=) string - ident(fqn) operator(<<) operator(()instance_variable(@returns) operator(?) operator(()instance_variable(@returns)operator([)integer(0)operator(])operator(.)ident(human_name)operator(()pre_constant(false)operator(\)) operator(+) stringoperator(\)) operator(:) stringoperator(\)) - ident(fqn) operator(<<) stringcontent(()delimiter(")> - ident(fqn) operator(<<) instance_variable(@expects)operator(.)ident(map)operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(human_name) operator(})operator(.)ident(join)operator(()stringoperator(\)) reserved(if) instance_variable(@expects) - ident(fqn) operator(<<) string - ident(fqn) - reserved(end) - - ident(private) - reserved(def) method(compat_signature_entry)operator(()ident(entry)operator(\)) - reserved(if) ident(entry)operator(.)ident(array?) - operator([)ident(compat_signature_entry)operator(()ident(entry)operator(.)ident(element_type)operator(\))operator(]) - reserved(else) - reserved(if) ident(entry)operator(.)ident(spec)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - operator({)ident(entry)operator(.)ident(spec)operator(.)ident(keys)operator(.)ident(first) operator(=)operator(>) ident(entry)operator(.)ident(type_class)operator(}) - reserved(else) - ident(entry)operator(.)ident(type_class) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(class) class(ActionWebServiceError) operator(<) constant(StandardError) comment(# :nodoc:) - reserved(end) - - comment(# An Action Web Service object implements a specified API.) - comment(#) - comment(# Used by controllers operating in _Delegated_ dispatching mode.) - comment(#) - comment(# ==== Example) - comment(# ) - comment(# class PersonService < ActionWebService::Base) - comment(# web_service_api PersonAPI) - comment(#) - comment(# def find_person(criteria\)) - comment(# Person.find_all [...]) - comment(# end) - comment(#) - comment(# def delete_person(id\)) - comment(# Person.find_by_id(id\).destroy) - comment(# end) - comment(# end) - comment(#) - comment(# class PersonAPI < ActionWebService::API::Base) - comment(# api_method :find_person, :expects => [SearchCriteria], :returns => [[Person]]) - comment(# api_method :delete_person, :expects => [:int]) - comment(# end) - comment(#) - comment(# class SearchCriteria < ActionWebService::Struct) - comment(# member :firstname, :string) - comment(# member :lastname, :string) - comment(# member :email, :string) - comment(# end) - reserved(class) class(Base) - comment(# Action WebService subclasses should be reloaded by the dispatcher in Rails) - comment(# when Dependencies.mechanism = :load.) - ident(include) constant(Reloadable)operator(::)constant(Subclasses) - - comment(# Whether to report exceptions back to the caller in the protocol's exception) - comment(# format) - ident(class_inheritable_option) symbol(:web_service_exception_reporting)operator(,) pre_constant(true) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Casting) comment(# :nodoc:) - reserved(class) class(CastingError) operator(<) constant(ActionWebServiceError) comment(# :nodoc:) - reserved(end) - - comment(# Performs casting of arbitrary values into the correct types for the signature) - reserved(class) class(BaseCaster) comment(# :nodoc:) - reserved(def) method(initialize)operator(()ident(api_method)operator(\)) - instance_variable(@api_method) operator(=) ident(api_method) - reserved(end) - - comment(# Coerces the parameters in +params+ (an Enumerable\) into the types) - comment(# this method expects) - reserved(def) method(cast_expects)operator(()ident(params)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(cast_expects)operator(()instance_variable(@api_method)operator(,) ident(params)operator(\)) - reserved(end) - - comment(# Coerces the given +return_value+ into the type returned by this) - comment(# method) - reserved(def) method(cast_returns)operator(()ident(return_value)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(cast_returns)operator(()instance_variable(@api_method)operator(,) ident(return_value)operator(\)) - reserved(end) - - reserved(class) operator(<<) class(self) - ident(include) constant(ActionWebService)operator(::)constant(SignatureTypes) - - reserved(def) method(cast_expects)operator(()ident(api_method)operator(,) ident(params)operator(\)) comment(# :nodoc:) - reserved(return) operator([)operator(]) reserved(if) ident(api_method)operator(.)ident(expects)operator(.)ident(nil?) - ident(api_method)operator(.)ident(expects)operator(.)ident(zip)operator(()ident(params)operator(\))operator(.)ident(map)operator({) operator(|)ident(type)operator(,) ident(param)operator(|) ident(cast)operator(()ident(param)operator(,) ident(type)operator(\)) operator(}) - reserved(end) - - reserved(def) method(cast_returns)operator(()ident(api_method)operator(,) ident(return_value)operator(\)) comment(# :nodoc:) - reserved(return) pre_constant(nil) reserved(if) ident(api_method)operator(.)ident(returns)operator(.)ident(nil?) - ident(cast)operator(()ident(return_value)operator(,) ident(api_method)operator(.)ident(returns)operator([)integer(0)operator(])operator(\)) - reserved(end) - - reserved(def) method(cast)operator(()ident(value)operator(,) ident(signature_type)operator(\)) comment(# :nodoc:) - reserved(return) ident(value) reserved(if) ident(signature_type)operator(.)ident(nil?) comment(# signature.length != params.length) - reserved(return) pre_constant(nil) reserved(if) ident(value)operator(.)ident(nil?) - comment(# XMLRPC protocol doesn't support nil values. It uses false instead.) - comment(# It should never happen for SOAP.) - reserved(if) ident(signature_type)operator(.)ident(structured?) operator(&&) ident(value)operator(.)ident(equal?)operator(()pre_constant(false)operator(\)) - reserved(return) pre_constant(nil) - reserved(end) - reserved(unless) ident(signature_type)operator(.)ident(array?) operator(||) ident(signature_type)operator(.)ident(structured?) - reserved(return) ident(value) reserved(if) ident(canonical_type)operator(()ident(value)operator(.)ident(class)operator(\)) operator(==) ident(signature_type)operator(.)ident(type) - reserved(end) - reserved(if) ident(signature_type)operator(.)ident(array?) - reserved(unless) ident(value)operator(.)ident(respond_to?)operator(()symbol(:entries)operator(\)) operator(&&) operator(!)ident(value)operator(.)ident(is_a?)operator(()constant(String)operator(\)) - ident(raise) constant(CastingError)operator(,) stringcontent( into )inlinedelimiter(")> - reserved(end) - ident(value)operator(.)ident(entries)operator(.)ident(map) reserved(do) operator(|)ident(entry)operator(|) - ident(cast)operator(()ident(entry)operator(,) ident(signature_type)operator(.)ident(element_type)operator(\)) - reserved(end) - reserved(elsif) ident(signature_type)operator(.)ident(structured?) - ident(cast_to_structured_type)operator(()ident(value)operator(,) ident(signature_type)operator(\)) - reserved(elsif) operator(!)ident(signature_type)operator(.)ident(custom?) - ident(cast_base_type)operator(()ident(value)operator(,) ident(signature_type)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(cast_base_type)operator(()ident(value)operator(,) ident(signature_type)operator(\)) comment(# :nodoc:) - comment(# This is a work-around for the fact that XML-RPC special-cases DateTime values into its own DateTime type) - comment(# in order to support iso8601 dates. This doesn't work too well for us, so we'll convert it into a Time,) - comment(# with the caveat that we won't be able to handle pre-1970 dates that are sent to us.) - comment(# ) - comment(# See http://dev.rubyonrails.com/ticket/2516) - ident(value) operator(=) ident(value)operator(.)ident(to_time) reserved(if) ident(value)operator(.)ident(is_a?)operator(()constant(XMLRPC)operator(::)constant(DateTime)operator(\)) - - reserved(case) ident(signature_type)operator(.)ident(type) - reserved(when) symbol(:int) - ident(Integer)operator(()ident(value)operator(\)) - reserved(when) symbol(:string) - ident(value)operator(.)ident(to_s) - reserved(when) symbol(:base64) - reserved(if) ident(value)operator(.)ident(is_a?)operator(()constant(ActionWebService)operator(::)constant(Base64)operator(\)) - ident(value) - reserved(else) - constant(ActionWebService)operator(::)constant(Base64)operator(.)ident(new)operator(()ident(value)operator(.)ident(to_s)operator(\)) - reserved(end) - reserved(when) symbol(:bool) - reserved(return) pre_constant(false) reserved(if) ident(value)operator(.)ident(nil?) - reserved(return) ident(value) reserved(if) ident(value) operator(==) pre_constant(true) operator(||) ident(value) operator(==) pre_constant(false) - reserved(case) ident(value)operator(.)ident(to_s)operator(.)ident(downcase) - reserved(when) stringoperator(,) stringoperator(,) stringoperator(,) string - pre_constant(true) - reserved(when) stringoperator(,) stringoperator(,) stringoperator(,) string - pre_constant(false) - reserved(else) - ident(raise) constant(CastingError)operator(,) stringcontent( into Boolean)delimiter(")> - reserved(end) - reserved(when) symbol(:float) - ident(Float)operator(()ident(value)operator(\)) - reserved(when) symbol(:time) - ident(value) operator(=) stringoperator(])inline_delimiter(})>content(/)inlineoperator(])inline_delimiter(})>content(/)inlineoperator(])inline_delimiter(})>content( )inlineoperator(])inline_delimiter(})>content(:)inlineoperator(])inline_delimiter(})>content(:)inlineoperator(])inline_delimiter(})>delimiter(")> reserved(if) ident(value)operator(.)ident(kind_of?)operator(()constant(Hash)operator(\)) - constant(Time)operator(.)ident(parse)operator(()ident(value)operator(.)ident(to_s)operator(\)) - reserved(when) symbol(:date) - ident(value) operator(=) stringoperator(])inline_delimiter(})>content(/)inlineoperator(])inline_delimiter(})>content(/)inlineoperator(])inline_delimiter(})>delimiter(")> reserved(if) ident(value)operator(.)ident(kind_of?)operator(()constant(Hash)operator(\)) - constant(Date)operator(.)ident(parse)operator(()ident(value)operator(.)ident(to_s)operator(\)) - reserved(when) symbol(:datetime) - ident(value) operator(=) stringoperator(])inline_delimiter(})>content(/)inlineoperator(])inline_delimiter(})>content(/)inlineoperator(])inline_delimiter(})>content( )inlineoperator(])inline_delimiter(})>content(:)inlineoperator(])inline_delimiter(})>content(:)inlineoperator(])inline_delimiter(})>delimiter(")> reserved(if) ident(value)operator(.)ident(kind_of?)operator(()constant(Hash)operator(\)) - constant(DateTime)operator(.)ident(parse)operator(()ident(value)operator(.)ident(to_s)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(cast_to_structured_type)operator(()ident(value)operator(,) ident(signature_type)operator(\)) comment(# :nodoc:) - ident(obj) operator(=) pre_constant(nil) - ident(obj) operator(=) ident(value) reserved(if) ident(canonical_type)operator(()ident(value)operator(.)ident(class)operator(\)) operator(==) ident(canonical_type)operator(()ident(signature_type)operator(.)ident(type)operator(\)) - ident(obj) operator(||=) ident(signature_type)operator(.)ident(type_class)operator(.)ident(new) - reserved(if) ident(value)operator(.)ident(respond_to?)operator(()symbol(:each_pair)operator(\)) - ident(klass) operator(=) ident(signature_type)operator(.)ident(type_class) - ident(value)operator(.)ident(each_pair) reserved(do) operator(|)ident(name)operator(,) ident(val)operator(|) - ident(type) operator(=) ident(klass)operator(.)ident(respond_to?)operator(()symbol(:member_type)operator(\)) operator(?) ident(klass)operator(.)ident(member_type)operator(()ident(name)operator(\)) operator(:) pre_constant(nil) - ident(val) operator(=) ident(cast)operator(()ident(val)operator(,) ident(type)operator(\)) reserved(if) ident(type) - comment(# See http://dev.rubyonrails.com/ticket/3567) - ident(val) operator(=) ident(val)operator(.)ident(to_time) reserved(if) ident(val)operator(.)ident(is_a?)operator(()constant(XMLRPC)operator(::)constant(DateTime)operator(\)) - ident(obj)operator(.)ident(__send__)operator(()stringcontent(=)delimiter(")>operator(,) ident(val)operator(\)) reserved(if) ident(obj)operator(.)ident(respond_to?)operator(()ident(name)operator(\)) - reserved(end) - reserved(elsif) ident(value)operator(.)ident(respond_to?)operator(()symbol(:attributes)operator(\)) - ident(signature_type)operator(.)ident(each_member) reserved(do) operator(|)ident(name)operator(,) ident(type)operator(|) - ident(val) operator(=) ident(value)operator(.)ident(__send__)operator(()ident(name)operator(\)) - ident(obj)operator(.)ident(__send__)operator(()stringcontent(=)delimiter(")>operator(,) ident(cast)operator(()ident(val)operator(,) ident(type)operator(\))operator(\)) reserved(if) ident(obj)operator(.)ident(respond_to?)operator(()ident(name)operator(\)) - reserved(end) - reserved(else) - ident(raise) constant(CastingError)operator(,) stringcontent( to )inlinedelimiter(")> - reserved(end) - ident(obj) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Client) comment(# :nodoc:) - reserved(class) class(ClientError) operator(<) constant(StandardError) comment(# :nodoc:) - reserved(end) - - reserved(class) class(Base) comment(# :nodoc:) - reserved(def) method(initialize)operator(()ident(api)operator(,) ident(endpoint_uri)operator(\)) - instance_variable(@api) operator(=) ident(api) - instance_variable(@endpoint_uri) operator(=) ident(endpoint_uri) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) comment(# :nodoc:) - ident(call_name) operator(=) ident(method_name)operator(()ident(name)operator(\)) - reserved(return) reserved(super)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) reserved(if) ident(call_name)operator(.)ident(nil?) - pre_constant(self)operator(.)ident(perform_invocation)operator(()ident(call_name)operator(,) ident(args)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(method_name)operator(()ident(name)operator(\)) - reserved(if) instance_variable(@api)operator(.)ident(has_api_method?)operator(()ident(name)operator(.)ident(to_sym)operator(\)) - ident(name)operator(.)ident(to_s) - reserved(elsif) instance_variable(@api)operator(.)ident(has_public_api_method?)operator(()ident(name)operator(.)ident(to_s)operator(\)) - instance_variable(@api)operator(.)ident(api_method_name)operator(()ident(name)operator(.)ident(to_s)operator(\))operator(.)ident(to_s) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string - -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Client) comment(# :nodoc:) - - comment(# Implements SOAP client support (using RPC encoding for the messages\).) - comment(#) - comment(# ==== Example Usage) - comment(#) - comment(# class PersonAPI < ActionWebService::API::Base) - comment(# api_method :find_all, :returns => [[Person]]) - comment(# end) - comment(#) - comment(# soap_client = ActionWebService::Client::Soap.new(PersonAPI, "http://..."\)) - comment(# persons = soap_client.find_all) - comment(#) - reserved(class) class(Soap) operator(<) constant(Base) - - comment(# Creates a new web service client using the SOAP RPC protocol.) - comment(#) - comment(# +api+ must be an ActionWebService::API::Base derivative, and) - comment(# +endpoint_uri+ must point at the relevant URL to which protocol requests) - comment(# will be sent with HTTP POST.) - comment(#) - comment(# Valid options:) - comment(# [:namespace] If the remote server has used a custom namespace to) - comment(# declare its custom types, you can specify it here. This would) - comment(# be the namespace declared with a [WebService(Namespace = "http://namespace"\)] attribute) - comment(# in .NET, for example.) - comment(# [:driver_options] If you want to supply any custom SOAP RPC driver) - comment(# options, you can provide them as a Hash here) - comment(#) - comment(# The :driver_options option can be used to configure the backend SOAP) - comment(# RPC driver. An example of configuring the SOAP backend to do) - comment(# client-certificate authenticated SSL connections to the server:) - comment(#) - comment(# opts = {}) - comment(# opts['protocol.http.ssl_config.verify_mode'] = 'OpenSSL::SSL::VERIFY_PEER') - comment(# opts['protocol.http.ssl_config.client_cert'] = client_cert_file_path) - comment(# opts['protocol.http.ssl_config.client_key'] = client_key_file_path) - comment(# opts['protocol.http.ssl_config.ca_file'] = ca_cert_file_path) - comment(# client = ActionWebService::Client::Soap.new(api, 'https://some/service', :driver_options => opts\)) - reserved(def) method(initialize)operator(()ident(api)operator(,) ident(endpoint_uri)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - reserved(super)operator(()ident(api)operator(,) ident(endpoint_uri)operator(\)) - instance_variable(@namespace) operator(=) ident(options)operator([)symbol(:namespace)operator(]) operator(||) string - instance_variable(@driver_options) operator(=) ident(options)operator([)symbol(:driver_options)operator(]) operator(||) operator({)operator(}) - instance_variable(@protocol) operator(=) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(Soap)operator(::)constant(SoapProtocol)operator(.)ident(new) instance_variable(@namespace) - instance_variable(@soap_action_base) operator(=) ident(options)operator([)symbol(:soap_action_base)operator(]) - instance_variable(@soap_action_base) operator(||=) constant(URI)operator(.)ident(parse)operator(()ident(endpoint_uri)operator(\))operator(.)ident(path) - instance_variable(@driver) operator(=) ident(create_soap_rpc_driver)operator(()ident(api)operator(,) ident(endpoint_uri)operator(\)) - instance_variable(@driver_options)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(value)operator(|) - instance_variable(@driver)operator(.)ident(options)operator([)ident(name)operator(.)ident(to_s)operator(]) operator(=) ident(value) - reserved(end) - reserved(end) - - ident(protected) - reserved(def) method(perform_invocation)operator(()ident(method_name)operator(,) ident(args)operator(\)) - ident(method) operator(=) instance_variable(@api)operator(.)ident(api_methods)operator([)ident(method_name)operator(.)ident(to_sym)operator(]) - ident(args) operator(=) ident(method)operator(.)ident(cast_expects)operator(()ident(args)operator(.)ident(dup)operator(\)) reserved(rescue) ident(args) - ident(return_value) operator(=) instance_variable(@driver)operator(.)ident(send)operator(()ident(method_name)operator(,) operator(*)ident(args)operator(\)) - ident(method)operator(.)ident(cast_returns)operator(()ident(return_value)operator(.)ident(dup)operator(\)) reserved(rescue) ident(return_value) - reserved(end) - - reserved(def) method(soap_action)operator(()ident(method_name)operator(\)) - stringcontent(/)inlinedelimiter(")> - reserved(end) - - ident(private) - reserved(def) method(create_soap_rpc_driver)operator(()ident(api)operator(,) ident(endpoint_uri)operator(\)) - instance_variable(@protocol)operator(.)ident(register_api)operator(()ident(api)operator(\)) - ident(driver) operator(=) constant(SoapDriver)operator(.)ident(new)operator(()ident(endpoint_uri)operator(,) pre_constant(nil)operator(\)) - ident(driver)operator(.)ident(mapping_registry) operator(=) instance_variable(@protocol)operator(.)ident(marshaler)operator(.)ident(registry) - ident(api)operator(.)ident(api_methods)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(method)operator(|) - ident(qname) operator(=) constant(XSD)operator(::)constant(QName)operator(.)ident(new)operator(()instance_variable(@namespace)operator(,) ident(method)operator(.)ident(public_name)operator(\)) - ident(action) operator(=) ident(soap_action)operator(()ident(method)operator(.)ident(public_name)operator(\)) - ident(expects) operator(=) ident(method)operator(.)ident(expects) - ident(returns) operator(=) ident(method)operator(.)ident(returns) - ident(param_def) operator(=) operator([)operator(]) - reserved(if) ident(expects) - ident(expects)operator(.)ident(each) reserved(do) operator(|)ident(type)operator(|) - ident(type_binding) operator(=) instance_variable(@protocol)operator(.)ident(marshaler)operator(.)ident(lookup_type)operator(()ident(type)operator(\)) - reserved(if) constant(SOAP)operator(::)constant(Version) operator(>)operator(=) string - ident(param_def) operator(<<) operator([)stringoperator(,) ident(type)operator(.)ident(name)operator(.)ident(to_s)operator(,) operator([)ident(type_binding)operator(.)ident(type)operator(.)ident(type_class)operator(.)ident(to_s)operator(])operator(]) - reserved(else) - ident(param_def) operator(<<) operator([)stringoperator(,) ident(type)operator(.)ident(name)operator(,) ident(type_binding)operator(.)ident(mapping)operator(]) - reserved(end) - reserved(end) - reserved(end) - reserved(if) ident(returns) - ident(type_binding) operator(=) instance_variable(@protocol)operator(.)ident(marshaler)operator(.)ident(lookup_type)operator(()ident(returns)operator([)integer(0)operator(])operator(\)) - reserved(if) constant(SOAP)operator(::)constant(Version) operator(>)operator(=) string - ident(param_def) operator(<<) operator([)stringoperator(,) stringoperator(,) operator([)ident(type_binding)operator(.)ident(type)operator(.)ident(type_class)operator(.)ident(to_s)operator(])operator(]) - reserved(else) - ident(param_def) operator(<<) operator([)stringoperator(,) stringoperator(,) ident(type_binding)operator(.)ident(mapping)operator(]) - reserved(end) - reserved(end) - ident(driver)operator(.)ident(add_method)operator(()ident(qname)operator(,) ident(action)operator(,) ident(method)operator(.)ident(name)operator(.)ident(to_s)operator(,) ident(param_def)operator(\)) - reserved(end) - ident(driver) - reserved(end) - - reserved(class) class(SoapDriver) operator(<) constant(SOAP)operator(::)constant(RPC)operator(::)constant(Driver) comment(# :nodoc:) - reserved(def) method(add_method)operator(()ident(qname)operator(,) ident(soapaction)operator(,) ident(name)operator(,) ident(param_def)operator(\)) - instance_variable(@proxy)operator(.)ident(add_rpc_method)operator(()ident(qname)operator(,) ident(soapaction)operator(,) ident(name)operator(,) ident(param_def)operator(\)) - ident(add_rpc_method_interface)operator(()ident(name)operator(,) ident(param_def)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string - -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Client) comment(# :nodoc:) - - comment(# Implements XML-RPC client support) - comment(#) - comment(# ==== Example Usage) - comment(#) - comment(# class BloggerAPI < ActionWebService::API::Base) - comment(# inflect_names false) - comment(# api_method :getRecentPosts, :returns => [[Blog::Post]]) - comment(# end) - comment(#) - comment(# blog = ActionWebService::Client::XmlRpc.new(BloggerAPI, "http://.../RPC", :handler_name => "blogger"\)) - comment(# posts = blog.getRecentPosts) - reserved(class) class(XmlRpc) operator(<) constant(Base) - - comment(# Creates a new web service client using the XML-RPC protocol.) - comment(#) - comment(# +api+ must be an ActionWebService::API::Base derivative, and) - comment(# +endpoint_uri+ must point at the relevant URL to which protocol requests) - comment(# will be sent with HTTP POST.) - comment(#) - comment(# Valid options:) - comment(# [:handler_name] If the remote server defines its services inside special) - comment(# handler (the Blogger API uses a "blogger" handler name for example\),) - comment(# provide it here, or your method calls will fail) - reserved(def) method(initialize)operator(()ident(api)operator(,) ident(endpoint_uri)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - instance_variable(@api) operator(=) ident(api) - instance_variable(@handler_name) operator(=) ident(options)operator([)symbol(:handler_name)operator(]) - instance_variable(@protocol) operator(=) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(XmlRpc)operator(::)constant(XmlRpcProtocol)operator(.)ident(new) - instance_variable(@client) operator(=) constant(XMLRPC)operator(::)constant(Client)operator(.)ident(new2)operator(()ident(endpoint_uri)operator(,) ident(options)operator([)symbol(:proxy)operator(])operator(,) ident(options)operator([)symbol(:timeout)operator(])operator(\)) - reserved(end) - - ident(protected) - reserved(def) method(perform_invocation)operator(()ident(method_name)operator(,) ident(args)operator(\)) - ident(method) operator(=) instance_variable(@api)operator(.)ident(api_methods)operator([)ident(method_name)operator(.)ident(to_sym)operator(]) - reserved(if) ident(method)operator(.)ident(expects) operator(&&) ident(method)operator(.)ident(expects)operator(.)ident(length) operator(!=) ident(args)operator(.)ident(length) - ident(raise)operator(()constant(ArgumentError)operator(,) stringcontent(: wrong number of arguments ()inlinecontent( for )inlinecontent(\))delimiter(")>operator(\)) - reserved(end) - ident(args) operator(=) ident(method)operator(.)ident(cast_expects)operator(()ident(args)operator(.)ident(dup)operator(\)) reserved(rescue) ident(args) - reserved(if) ident(method)operator(.)ident(expects) - ident(method)operator(.)ident(expects)operator(.)ident(each_with_index)operator({) operator(|)ident(type)operator(,) ident(i)operator(|) ident(args)operator([)ident(i)operator(]) operator(=) instance_variable(@protocol)operator(.)ident(value_to_xmlrpc_wire_format)operator(()ident(args)operator([)ident(i)operator(])operator(,) ident(type)operator(\)) operator(}) - reserved(end) - ident(ok)operator(,) ident(return_value) operator(=) instance_variable(@client)operator(.)ident(call2)operator(()ident(public_name)operator(()ident(method_name)operator(\))operator(,) operator(*)ident(args)operator(\)) - reserved(return) operator(()ident(method)operator(.)ident(cast_returns)operator(()ident(return_value)operator(.)ident(dup)operator(\)) reserved(rescue) ident(return_value)operator(\)) reserved(if) ident(ok) - ident(raise)operator(()constant(ClientError)operator(,) stringcontent(: )inlinedelimiter(")>operator(\)) - reserved(end) - - reserved(def) method(public_name)operator(()ident(method_name)operator(\)) - ident(public_name) operator(=) instance_variable(@api)operator(.)ident(public_api_method_name)operator(()ident(method_name)operator(\)) - instance_variable(@handler_name) operator(?) stringcontent(.)inlinedelimiter(")> operator(:) ident(public_name) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Container) comment(# :nodoc:) - reserved(module) class(ActionController) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(# :nodoc:) - reserved(class) operator(<<) class(base) - ident(include) constant(ClassMethods) - ident(alias_method) symbol(:inherited_without_api)operator(,) symbol(:inherited) - ident(alias_method) symbol(:inherited)operator(,) symbol(:inherited_with_api) - ident(alias_method) symbol(:web_service_api_without_require)operator(,) symbol(:web_service_api) - ident(alias_method) symbol(:web_service_api)operator(,) symbol(:web_service_api_with_require) - reserved(end) - reserved(end) - - reserved(module) class(ClassMethods) - comment(# Creates a client for accessing remote web services, using the) - comment(# given +protocol+ to communicate with the +endpoint_uri+.) - comment(#) - comment(# ==== Example) - comment(#) - comment(# class MyController < ActionController::Base) - comment(# web_client_api :blogger, :xmlrpc, "http://blogger.com/myblog/api/RPC2", :handler_name => 'blogger') - comment(# end) - comment(#) - comment(# In this example, a protected method named blogger will) - comment(# now exist on the controller, and calling it will return the) - comment(# XML-RPC client object for working with that remote service.) - comment(#) - comment(# +options+ is the set of protocol client specific options (see) - comment(# a protocol client class for details\).) - comment(#) - comment(# If your API definition does not exist on the load path with the) - comment(# correct rules for it to be found using +name+, you can pass in) - comment(# the API definition class via +options+, using a key of :api) - reserved(def) method(web_client_api)operator(()ident(name)operator(,) ident(protocol)operator(,) ident(endpoint_uri)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - reserved(unless) ident(method_defined?)operator(()ident(name)operator(\)) - ident(api_klass) operator(=) ident(options)operator(.)ident(delete)operator(()symbol(:api)operator(\)) operator(||) ident(require_web_service_api)operator(()ident(name)operator(\)) - ident(class_eval) reserved(do) - ident(define_method)operator(()ident(name)operator(\)) reserved(do) - ident(create_web_service_client)operator(()ident(api_klass)operator(,) ident(protocol)operator(,) ident(endpoint_uri)operator(,) ident(options)operator(\)) - reserved(end) - ident(protected) ident(name) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(web_service_api_with_require)operator(()ident(definition)operator(=)pre_constant(nil)operator(\)) comment(# :nodoc:) - reserved(return) ident(web_service_api_without_require) reserved(if) ident(definition)operator(.)ident(nil?) - reserved(case) ident(definition) - reserved(when) constant(String)operator(,) constant(Symbol) - ident(klass) operator(=) ident(require_web_service_api)operator(()ident(definition)operator(\)) - reserved(else) - ident(klass) operator(=) ident(definition) - reserved(end) - ident(web_service_api_without_require)operator(()ident(klass)operator(\)) - reserved(end) - - reserved(def) method(require_web_service_api)operator(()ident(name)operator(\)) comment(# :nodoc:) - reserved(case) ident(name) - reserved(when) constant(String)operator(,) constant(Symbol) - ident(file_name) operator(=) ident(name)operator(.)ident(to_s)operator(.)ident(underscore) operator(+) string - ident(class_name) operator(=) ident(file_name)operator(.)ident(camelize) - ident(class_names) operator(=) operator([)ident(class_name)operator(,) ident(class_name)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\))operator(]) - reserved(begin) - ident(require_dependency)operator(()ident(file_name)operator(\)) - reserved(rescue) constant(LoadError) operator(=)operator(>) ident(load_error) - ident(requiree) operator(=) regexpoperator(.)ident(match)operator(()ident(load_error)operator(\))operator(.)ident(to_a)operator([)integer(1)operator(]) - ident(msg) operator(=) ident(requiree) operator(==) ident(file_name) operator(?) stringcontent(.rb)delimiter(")> operator(:) stringdelimiter(")> - ident(raise) constant(LoadError)operator(.)ident(new)operator(()ident(msg)operator(\))operator(.)ident(copy_blame!)operator(()ident(load_error)operator(\)) - reserved(end) - ident(klass) operator(=) pre_constant(nil) - ident(class_names)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - ident(klass) operator(=) ident(name)operator(.)ident(constantize) reserved(rescue) pre_constant(nil) - reserved(break) reserved(unless) ident(klass)operator(.)ident(nil?) - reserved(end) - reserved(unless) ident(klass) - ident(raise)operator(()constant(NameError)operator(,) stringcontent( or )inlinecontent( found)delimiter(")>operator(\)) - reserved(end) - ident(klass) - reserved(else) - ident(raise)operator(()constant(ArgumentError)operator(,) stringoperator(\)) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(inherited_with_api)operator(()ident(child)operator(\)) - ident(inherited_without_api)operator(()ident(child)operator(\)) - reserved(begin) ident(child)operator(.)ident(web_service_api)operator(()ident(child)operator(.)ident(controller_path)operator(\)) - reserved(rescue) constant(MissingSourceFile) operator(=)operator(>) ident(e) - ident(raise) reserved(unless) ident(e)operator(.)ident(is_missing?)operator(()stringcontent(_api)delimiter(")>operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Container) comment(# :nodoc:) - reserved(module) class(Delegated) comment(# :nodoc:) - reserved(class) class(ContainerError) operator(<) constant(ActionWebServiceError) comment(# :nodoc:) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(# :nodoc:) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - ident(base)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(ActionWebService)operator(::)constant(Container)operator(::)constant(Delegated)operator(::)constant(InstanceMethods)operator(\)) - reserved(end) - - reserved(module) class(ClassMethods) - comment(# Declares a web service that will provide access to the API of the given) - comment(# +object+. +object+ must be an ActionWebService::Base derivative.) - comment(#) - comment(# Web service object creation can either be _immediate_, where the object) - comment(# instance is given at class definition time, or _deferred_, where) - comment(# object instantiation is delayed until request time.) - comment(#) - comment(# ==== Immediate web service object example) - comment(#) - comment(# class ApiController < ApplicationController) - comment(# web_service_dispatching_mode :delegated) - comment(#) - comment(# web_service :person, PersonService.new) - comment(# end) - comment(#) - comment(# For deferred instantiation, a block should be given instead of an) - comment(# object instance. This block will be executed in controller instance) - comment(# context, so it can rely on controller instance variables being present.) - comment(#) - comment(# ==== Deferred web service object example) - comment(#) - comment(# class ApiController < ApplicationController) - comment(# web_service_dispatching_mode :delegated) - comment(#) - comment(# web_service(:person\) { PersonService.new(request.env\) }) - comment(# end) - reserved(def) method(web_service)operator(()ident(name)operator(,) ident(object)operator(=)pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - reserved(if) operator(()ident(object) operator(&&) ident(block_given?)operator(\)) operator(||) operator(()ident(object)operator(.)ident(nil?) operator(&&) ident(block)operator(.)ident(nil?)operator(\)) - ident(raise)operator(()constant(ContainerError)operator(,) stringoperator(\)) - reserved(end) - ident(name) operator(=) ident(name)operator(.)ident(to_sym) - reserved(if) ident(block_given?) - ident(info) operator(=) operator({) ident(name) operator(=)operator(>) operator({) symbol(:block) operator(=)operator(>) ident(block) operator(}) operator(}) - reserved(else) - ident(info) operator(=) operator({) ident(name) operator(=)operator(>) operator({) symbol(:object) operator(=)operator(>) ident(object) operator(}) operator(}) - reserved(end) - ident(write_inheritable_hash)operator(()stringoperator(,) ident(info)operator(\)) - ident(call_web_service_definition_callbacks)operator(()pre_constant(self)operator(,) ident(name)operator(,) ident(info)operator(\)) - reserved(end) - - comment(# Whether this service contains a service with the given +name+) - reserved(def) method(has_web_service?)operator(()ident(name)operator(\)) - ident(web_services)operator(.)ident(has_key?)operator(()ident(name)operator(.)ident(to_sym)operator(\)) - reserved(end) - - reserved(def) method(web_services) comment(# :nodoc:) - ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator({)operator(}) - reserved(end) - - reserved(def) method(add_web_service_definition_callback)operator(()operator(&)ident(block)operator(\)) comment(# :nodoc:) - ident(write_inheritable_array)operator(()stringoperator(,) operator([)ident(block)operator(])operator(\)) - reserved(end) - - ident(private) - reserved(def) method(call_web_service_definition_callbacks)operator(()ident(container_class)operator(,) ident(web_service_name)operator(,) ident(service_info)operator(\)) - operator(()ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator([)operator(])operator(\))operator(.)ident(each) reserved(do) operator(|)ident(block)operator(|) - ident(block)operator(.)ident(call)operator(()ident(container_class)operator(,) ident(web_service_name)operator(,) ident(service_info)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(module) class(InstanceMethods) comment(# :nodoc:) - reserved(def) method(web_service_object)operator(()ident(web_service_name)operator(\)) - ident(info) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(web_services)operator([)ident(web_service_name)operator(.)ident(to_sym)operator(]) - reserved(unless) ident(info) - ident(raise)operator(()constant(ContainerError)operator(,) stringcontent(')delimiter(")>operator(\)) - reserved(end) - ident(service) operator(=) ident(info)operator([)symbol(:block)operator(]) - ident(service) operator(?) pre_constant(self)operator(.)ident(instance_eval)operator(()operator(&)ident(service)operator(\)) operator(:) ident(info)operator([)symbol(:object)operator(]) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Container) comment(# :nodoc:) - reserved(module) class(Direct) comment(# :nodoc:) - reserved(class) class(ContainerError) operator(<) constant(ActionWebServiceError) comment(# :nodoc:) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(# :nodoc:) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - reserved(module) class(ClassMethods) - comment(# Attaches ActionWebService API +definition+ to the calling class.) - comment(#) - comment(# Action Controllers can have a default associated API, removing the need) - comment(# to call this method if you follow the Action Web Service naming conventions.) - comment(#) - comment(# A controller with a class name of GoogleSearchController will) - comment(# implicitly load app/apis/google_search_api.rb, and expect the) - comment(# API definition class to be named GoogleSearchAPI or) - comment(# GoogleSearchApi.) - comment(#) - comment(# ==== Service class example) - comment(#) - comment(# class MyService < ActionWebService::Base) - comment(# web_service_api MyAPI) - comment(# end) - comment(#) - comment(# class MyAPI < ActionWebService::API::Base) - comment(# ...) - comment(# end) - comment(#) - comment(# ==== Controller class example) - comment(#) - comment(# class MyController < ActionController::Base) - comment(# web_service_api MyAPI) - comment(# end) - comment(#) - comment(# class MyAPI < ActionWebService::API::Base) - comment(# ...) - comment(# end) - reserved(def) method(web_service_api)operator(()ident(definition)operator(=)pre_constant(nil)operator(\)) - reserved(if) ident(definition)operator(.)ident(nil?) - ident(read_inheritable_attribute)operator(()stringoperator(\)) - reserved(else) - reserved(if) ident(definition)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - ident(raise)operator(()constant(ContainerError)operator(,) stringoperator(\)) - reserved(end) - reserved(unless) ident(definition)operator(.)ident(respond_to?)operator(()symbol(:ancestors)operator(\)) operator(&&) ident(definition)operator(.)ident(ancestors)operator(.)ident(include?)operator(()constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base)operator(\)) - ident(raise)operator(()constant(ContainerError)operator(,) stringcontent( is not a valid API definition)delimiter(")>operator(\)) - reserved(end) - ident(write_inheritable_attribute)operator(()stringoperator(,) ident(definition)operator(\)) - ident(call_web_service_api_callbacks)operator(()pre_constant(self)operator(,) ident(definition)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(add_web_service_api_callback)operator(()operator(&)ident(block)operator(\)) comment(# :nodoc:) - ident(write_inheritable_array)operator(()stringoperator(,) operator([)ident(block)operator(])operator(\)) - reserved(end) - - ident(private) - reserved(def) method(call_web_service_api_callbacks)operator(()ident(container_class)operator(,) ident(definition)operator(\)) - operator(()ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator([)operator(])operator(\))operator(.)ident(each) reserved(do) operator(|)ident(block)operator(|) - ident(block)operator(.)ident(call)operator(()ident(container_class)operator(,) ident(definition)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Dispatcher) comment(# :nodoc:) - reserved(class) class(DispatcherError) operator(<) constant(ActionWebService)operator(::)constant(ActionWebServiceError) comment(# :nodoc:) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(# :nodoc:) - reserved(super) - ident(base)operator(.)ident(class_inheritable_option)operator(()symbol(:web_service_dispatching_mode)operator(,) symbol(:direct)operator(\)) - ident(base)operator(.)ident(class_inheritable_option)operator(()symbol(:web_service_exception_reporting)operator(,) pre_constant(true)operator(\)) - ident(base)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(ActionWebService)operator(::)constant(Dispatcher)operator(::)constant(InstanceMethods)operator(\)) - reserved(end) - - reserved(module) class(InstanceMethods) comment(# :nodoc:) - ident(private) - reserved(def) method(invoke_web_service_request)operator(()ident(protocol_request)operator(\)) - ident(invocation) operator(=) ident(web_service_invocation)operator(()ident(protocol_request)operator(\)) - reserved(if) ident(invocation)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) operator(&&) ident(protocol_request)operator(.)ident(protocol)operator(.)ident(is_a?)operator(()constant(Protocol)operator(::)constant(XmlRpc)operator(::)constant(XmlRpcProtocol)operator(\)) - ident(xmlrpc_multicall_invoke)operator(()ident(invocation)operator(\)) - reserved(else) - ident(web_service_invoke)operator(()ident(invocation)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(web_service_direct_invoke)operator(()ident(invocation)operator(\)) - instance_variable(@method_params) operator(=) ident(invocation)operator(.)ident(method_ordered_params) - ident(arity) operator(=) ident(method)operator(()ident(invocation)operator(.)ident(api_method)operator(.)ident(name)operator(\))operator(.)ident(arity) reserved(rescue) integer(0) - reserved(if) ident(arity) operator(<) integer(0) operator(||) ident(arity) operator(>) integer(0) - ident(params) operator(=) instance_variable(@method_params) - reserved(else) - ident(params) operator(=) operator([)operator(]) - reserved(end) - ident(web_service_filtered_invoke)operator(()ident(invocation)operator(,) ident(params)operator(\)) - reserved(end) - - reserved(def) method(web_service_delegated_invoke)operator(()ident(invocation)operator(\)) - ident(web_service_filtered_invoke)operator(()ident(invocation)operator(,) ident(invocation)operator(.)ident(method_ordered_params)operator(\)) - reserved(end) - - reserved(def) method(web_service_filtered_invoke)operator(()ident(invocation)operator(,) ident(params)operator(\)) - ident(cancellation_reason) operator(=) pre_constant(nil) - ident(return_value) operator(=) ident(invocation)operator(.)ident(service)operator(.)ident(perform_invocation)operator(()ident(invocation)operator(.)ident(api_method)operator(.)ident(name)operator(,) ident(params)operator(\)) reserved(do) operator(|)ident(x)operator(|) - ident(cancellation_reason) operator(=) ident(x) - reserved(end) - reserved(if) ident(cancellation_reason) - ident(raise)operator(()constant(DispatcherError)operator(,) stringdelimiter(")>operator(\)) - reserved(end) - ident(return_value) - reserved(end) - - reserved(def) method(web_service_invoke)operator(()ident(invocation)operator(\)) - reserved(case) ident(web_service_dispatching_mode) - reserved(when) symbol(:direct) - ident(return_value) operator(=) ident(web_service_direct_invoke)operator(()ident(invocation)operator(\)) - reserved(when) symbol(:delegated)operator(,) symbol(:layered) - ident(return_value) operator(=) ident(web_service_delegated_invoke)operator(()ident(invocation)operator(\)) - reserved(end) - ident(web_service_create_response)operator(()ident(invocation)operator(.)ident(protocol)operator(,) ident(invocation)operator(.)ident(protocol_options)operator(,) ident(invocation)operator(.)ident(api)operator(,) ident(invocation)operator(.)ident(api_method)operator(,) ident(return_value)operator(\)) - reserved(end) - - reserved(def) method(xmlrpc_multicall_invoke)operator(()ident(invocations)operator(\)) - ident(responses) operator(=) operator([)operator(]) - ident(invocations)operator(.)ident(each) reserved(do) operator(|)ident(invocation)operator(|) - reserved(if) ident(invocation)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(responses) operator(<<) ident(invocation) - reserved(next) - reserved(end) - reserved(begin) - reserved(case) ident(web_service_dispatching_mode) - reserved(when) symbol(:direct) - ident(return_value) operator(=) ident(web_service_direct_invoke)operator(()ident(invocation)operator(\)) - reserved(when) symbol(:delegated)operator(,) symbol(:layered) - ident(return_value) operator(=) ident(web_service_delegated_invoke)operator(()ident(invocation)operator(\)) - reserved(end) - ident(api_method) operator(=) ident(invocation)operator(.)ident(api_method) - reserved(if) ident(invocation)operator(.)ident(api)operator(.)ident(has_api_method?)operator(()ident(api_method)operator(.)ident(name)operator(\)) - ident(return_value) operator(=) ident(api_method)operator(.)ident(cast_returns)operator(()ident(return_value)operator(\)) - reserved(end) - ident(responses) operator(<<) operator([)ident(return_value)operator(]) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - ident(responses) operator(<<) operator({) string operator(=)operator(>) integer(3)operator(,) string operator(=)operator(>) ident(e)operator(.)ident(message) operator(}) - reserved(end) - reserved(end) - ident(invocation) operator(=) ident(invocations)operator([)integer(0)operator(]) - ident(invocation)operator(.)ident(protocol)operator(.)ident(encode_response)operator(()stringoperator(,) ident(responses)operator(,) pre_constant(nil)operator(,) ident(invocation)operator(.)ident(protocol_options)operator(\)) - reserved(end) - - reserved(def) method(web_service_invocation)operator(()ident(request)operator(,) ident(level) operator(=) integer(0)operator(\)) - ident(public_method_name) operator(=) ident(request)operator(.)ident(method_name) - ident(invocation) operator(=) constant(Invocation)operator(.)ident(new) - ident(invocation)operator(.)ident(protocol) operator(=) ident(request)operator(.)ident(protocol) - ident(invocation)operator(.)ident(protocol_options) operator(=) ident(request)operator(.)ident(protocol_options) - ident(invocation)operator(.)ident(service_name) operator(=) ident(request)operator(.)ident(service_name) - reserved(if) ident(web_service_dispatching_mode) operator(==) symbol(:layered) - reserved(case) ident(invocation)operator(.)ident(protocol) - reserved(when) constant(Protocol)operator(::)constant(Soap)operator(::)constant(SoapProtocol) - ident(soap_action) operator(=) ident(request)operator(.)ident(protocol_options)operator([)symbol(:soap_action)operator(]) - reserved(if) ident(soap_action) operator(&&) ident(soap_action) operator(=)operator(~) regexp - ident(invocation)operator(.)ident(service_name) operator(=) global_variable($1) - reserved(end) - reserved(when) constant(Protocol)operator(::)constant(XmlRpc)operator(::)constant(XmlRpcProtocol) - reserved(if) ident(request)operator(.)ident(method_name) operator(=)operator(~) regexp - ident(public_method_name) operator(=) global_variable($2) - ident(invocation)operator(.)ident(service_name) operator(=) global_variable($1) - reserved(end) - reserved(end) - reserved(end) - reserved(if) ident(invocation)operator(.)ident(protocol)operator(.)ident(is_a?) constant(Protocol)operator(::)constant(XmlRpc)operator(::)constant(XmlRpcProtocol) - reserved(if) ident(public_method_name) operator(==) string operator(&&) ident(invocation)operator(.)ident(service_name) operator(==) string - reserved(if) ident(level) operator(>) integer(0) - ident(raise)operator(()constant(DispatcherError)operator(,) stringoperator(\)) - reserved(end) - ident(multicall) operator(=) ident(request)operator(.)ident(method_params)operator(.)ident(dup) - reserved(unless) ident(multicall)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) operator(&&) ident(multicall)operator([)integer(0)operator(])operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - ident(raise)operator(()constant(DispatcherError)operator(,) stringoperator(\)) - reserved(end) - ident(multicall) operator(=) ident(multicall)operator([)integer(0)operator(]) - reserved(return) ident(multicall)operator(.)ident(map) reserved(do) operator(|)ident(item)operator(|) - ident(raise)operator(()constant(DispatcherError)operator(,) stringoperator(\)) reserved(unless) ident(item)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(raise)operator(()constant(DispatcherError)operator(,) stringoperator(\)) reserved(unless) ident(item)operator(.)ident(has_key?)operator(()stringoperator(\)) - ident(method_name) operator(=) ident(item)operator([)stringoperator(]) - ident(params) operator(=) ident(item)operator(.)ident(has_key?)operator(()stringoperator(\)) operator(?) ident(item)operator([)stringoperator(]) operator(:) operator([)operator(]) - ident(multicall_request) operator(=) ident(request)operator(.)ident(dup) - ident(multicall_request)operator(.)ident(method_name) operator(=) ident(method_name) - ident(multicall_request)operator(.)ident(method_params) operator(=) ident(params) - reserved(begin) - ident(web_service_invocation)operator(()ident(multicall_request)operator(,) ident(level) operator(+) integer(1)operator(\)) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - operator({)string operator(=)operator(>) integer(4)operator(,) string operator(=)operator(>) ident(e)operator(.)ident(message)operator(}) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(case) ident(web_service_dispatching_mode) - reserved(when) symbol(:direct) - ident(invocation)operator(.)ident(api) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(web_service_api) - ident(invocation)operator(.)ident(service) operator(=) pre_constant(self) - reserved(when) symbol(:delegated)operator(,) symbol(:layered) - ident(invocation)operator(.)ident(service) operator(=) ident(web_service_object)operator(()ident(invocation)operator(.)ident(service_name)operator(\)) - ident(invocation)operator(.)ident(api) operator(=) ident(invocation)operator(.)ident(service)operator(.)ident(class)operator(.)ident(web_service_api) - reserved(end) - reserved(if) ident(invocation)operator(.)ident(api)operator(.)ident(nil?) - ident(raise)operator(()constant(DispatcherError)operator(,) stringdelimiter(")>operator(\)) - reserved(end) - ident(invocation)operator(.)ident(protocol)operator(.)ident(register_api)operator(()ident(invocation)operator(.)ident(api)operator(\)) - ident(request)operator(.)ident(api) operator(=) ident(invocation)operator(.)ident(api) - reserved(if) ident(invocation)operator(.)ident(api)operator(.)ident(has_public_api_method?)operator(()ident(public_method_name)operator(\)) - ident(invocation)operator(.)ident(api_method) operator(=) ident(invocation)operator(.)ident(api)operator(.)ident(public_api_method_instance)operator(()ident(public_method_name)operator(\)) - reserved(else) - reserved(if) ident(invocation)operator(.)ident(api)operator(.)ident(default_api_method)operator(.)ident(nil?) - ident(raise)operator(()constant(DispatcherError)operator(,) stringcontent(' on API )inlinedelimiter(")>operator(\)) - reserved(else) - ident(invocation)operator(.)ident(api_method) operator(=) ident(invocation)operator(.)ident(api)operator(.)ident(default_api_method_instance) - reserved(end) - reserved(end) - reserved(if) ident(invocation)operator(.)ident(service)operator(.)ident(nil?) - ident(raise)operator(()constant(DispatcherError)operator(,) stringdelimiter(")>operator(\)) - reserved(end) - reserved(unless) ident(invocation)operator(.)ident(service)operator(.)ident(respond_to?)operator(()ident(invocation)operator(.)ident(api_method)operator(.)ident(name)operator(\)) - ident(raise)operator(()constant(DispatcherError)operator(,) stringcontent(' on API )inlinecontent( ()inlinecontent(\))delimiter(")>operator(\)) - reserved(end) - ident(request)operator(.)ident(api_method) operator(=) ident(invocation)operator(.)ident(api_method) - reserved(begin) - ident(invocation)operator(.)ident(method_ordered_params) operator(=) ident(invocation)operator(.)ident(api_method)operator(.)ident(cast_expects)operator(()ident(request)operator(.)ident(method_params)operator(.)ident(dup)operator(\)) - reserved(rescue) - ident(logger)operator(.)ident(warn) string reserved(unless) ident(logger)operator(.)ident(nil?) - ident(invocation)operator(.)ident(method_ordered_params) operator(=) ident(request)operator(.)ident(method_params) - reserved(end) - ident(request)operator(.)ident(method_params) operator(=) ident(invocation)operator(.)ident(method_ordered_params) - ident(invocation)operator(.)ident(method_named_params) operator(=) operator({)operator(}) - ident(invocation)operator(.)ident(api_method)operator(.)ident(param_names)operator(.)ident(inject)operator(()integer(0)operator(\)) reserved(do) operator(|)ident(m)operator(,) ident(n)operator(|) - ident(invocation)operator(.)ident(method_named_params)operator([)ident(n)operator(]) operator(=) ident(invocation)operator(.)ident(method_ordered_params)operator([)ident(m)operator(]) - ident(m) operator(+) integer(1) - reserved(end) - ident(invocation) - reserved(end) - - reserved(def) method(web_service_create_response)operator(()ident(protocol)operator(,) ident(protocol_options)operator(,) ident(api)operator(,) ident(api_method)operator(,) ident(return_value)operator(\)) - reserved(if) ident(api)operator(.)ident(has_api_method?)operator(()ident(api_method)operator(.)ident(name)operator(\)) - ident(return_type) operator(=) ident(api_method)operator(.)ident(returns) operator(?) ident(api_method)operator(.)ident(returns)operator([)integer(0)operator(]) operator(:) pre_constant(nil) - ident(return_value) operator(=) ident(api_method)operator(.)ident(cast_returns)operator(()ident(return_value)operator(\)) - reserved(else) - ident(return_type) operator(=) constant(ActionWebService)operator(::)constant(SignatureTypes)operator(.)ident(canonical_signature_entry)operator(()ident(return_value)operator(.)ident(class)operator(,) integer(0)operator(\)) - reserved(end) - ident(protocol)operator(.)ident(encode_response)operator(()ident(api_method)operator(.)ident(public_name) operator(+) stringoperator(,) ident(return_value)operator(,) ident(return_type)operator(,) ident(protocol_options)operator(\)) - reserved(end) - - reserved(class) class(Invocation) comment(# :nodoc:) - ident(attr_accessor) symbol(:protocol) - ident(attr_accessor) symbol(:protocol_options) - ident(attr_accessor) symbol(:service_name) - ident(attr_accessor) symbol(:api) - ident(attr_accessor) symbol(:api_method) - ident(attr_accessor) symbol(:method_ordered_params) - ident(attr_accessor) symbol(:method_named_params) - ident(attr_accessor) symbol(:service) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string - -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Dispatcher) comment(# :nodoc:) - reserved(module) class(ActionController) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(# :nodoc:) - reserved(super) - reserved(class) operator(<<) class(base) - ident(include) constant(ClassMethods) - ident(alias_method) symbol(:inherited_without_action_controller)operator(,) symbol(:inherited) - ident(alias_method) symbol(:inherited)operator(,) symbol(:inherited_with_action_controller) - reserved(end) - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:web_service_direct_invoke_without_controller)operator(,) symbol(:web_service_direct_invoke) - reserved(end) - ident(base)operator(.)ident(add_web_service_api_callback) reserved(do) operator(|)ident(klass)operator(,) ident(api)operator(|) - reserved(if) ident(klass)operator(.)ident(web_service_dispatching_mode) operator(==) symbol(:direct) - ident(klass)operator(.)ident(class_eval) string - reserved(end) - reserved(end) - ident(base)operator(.)ident(add_web_service_definition_callback) reserved(do) operator(|)ident(klass)operator(,) ident(name)operator(,) ident(info)operator(|) - reserved(if) ident(klass)operator(.)ident(web_service_dispatching_mode) operator(==) symbol(:delegated) - ident(klass)operator(.)ident(class_eval) stringcontent(; dispatch_web_service_request; end)delimiter(")> - reserved(elsif) ident(klass)operator(.)ident(web_service_dispatching_mode) operator(==) symbol(:layered) - ident(klass)operator(.)ident(class_eval) string - reserved(end) - reserved(end) - ident(base)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(ActionWebService)operator(::)constant(Dispatcher)operator(::)constant(ActionController)operator(::)constant(InstanceMethods)operator(\)) - reserved(end) - - reserved(module) class(ClassMethods) comment(# :nodoc:) - reserved(def) method(inherited_with_action_controller)operator(()ident(child)operator(\)) - ident(inherited_without_action_controller)operator(()ident(child)operator(\)) - ident(child)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(ActionWebService)operator(::)constant(Dispatcher)operator(::)constant(ActionController)operator(::)constant(WsdlAction)operator(\)) - reserved(end) - reserved(end) - - reserved(module) class(InstanceMethods) comment(# :nodoc:) - ident(private) - reserved(def) method(dispatch_web_service_request) - ident(exception) operator(=) pre_constant(nil) - reserved(begin) - ident(ws_request) operator(=) ident(discover_web_service_request)operator(()ident(request)operator(\)) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - ident(exception) operator(=) ident(e) - reserved(end) - reserved(if) ident(ws_request) - ident(ws_response) operator(=) pre_constant(nil) - ident(exception) operator(=) pre_constant(nil) - ident(bm) operator(=) constant(Benchmark)operator(.)ident(measure) reserved(do) - reserved(begin) - ident(ws_response) operator(=) ident(invoke_web_service_request)operator(()ident(ws_request)operator(\)) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - ident(exception) operator(=) ident(e) - reserved(end) - reserved(end) - ident(log_request)operator(()ident(ws_request)operator(,) ident(request)operator(.)ident(raw_post)operator(\)) - reserved(if) ident(exception) - ident(log_error)operator(()ident(exception)operator(\)) reserved(unless) ident(logger)operator(.)ident(nil?) - ident(send_web_service_error_response)operator(()ident(ws_request)operator(,) ident(exception)operator(\)) - reserved(else) - ident(send_web_service_response)operator(()ident(ws_response)operator(,) ident(bm)operator(.)ident(real)operator(\)) - reserved(end) - reserved(else) - ident(exception) operator(||=) constant(DispatcherError)operator(.)ident(new)operator(()stringoperator(\)) - ident(log_error)operator(()ident(exception)operator(\)) reserved(unless) ident(logger)operator(.)ident(nil?) - ident(send_web_service_error_response)operator(()ident(ws_request)operator(,) ident(exception)operator(\)) - reserved(end) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - ident(log_error)operator(()ident(e)operator(\)) reserved(unless) ident(logger)operator(.)ident(nil?) - ident(send_web_service_error_response)operator(()ident(ws_request)operator(,) ident(e)operator(\)) - reserved(end) - - reserved(def) method(send_web_service_response)operator(()ident(ws_response)operator(,) ident(elapsed)operator(=)pre_constant(nil)operator(\)) - ident(log_response)operator(()ident(ws_response)operator(,) ident(elapsed)operator(\)) - ident(options) operator(=) operator({) symbol(:type) operator(=)operator(>) ident(ws_response)operator(.)ident(content_type)operator(,) symbol(:disposition) operator(=)operator(>) string operator(}) - ident(send_data)operator(()ident(ws_response)operator(.)ident(body)operator(,) ident(options)operator(\)) - reserved(end) - - reserved(def) method(send_web_service_error_response)operator(()ident(ws_request)operator(,) ident(exception)operator(\)) - reserved(if) ident(ws_request) - reserved(unless) pre_constant(self)operator(.)ident(class)operator(.)ident(web_service_exception_reporting) - ident(exception) operator(=) constant(DispatcherError)operator(.)ident(new)operator(()stringoperator(\)) - reserved(end) - ident(api_method) operator(=) ident(ws_request)operator(.)ident(api_method) - ident(public_method_name) operator(=) ident(api_method) operator(?) ident(api_method)operator(.)ident(public_name) operator(:) ident(ws_request)operator(.)ident(method_name) - ident(return_type) operator(=) constant(ActionWebService)operator(::)constant(SignatureTypes)operator(.)ident(canonical_signature_entry)operator(()constant(Exception)operator(,) integer(0)operator(\)) - ident(ws_response) operator(=) ident(ws_request)operator(.)ident(protocol)operator(.)ident(encode_response)operator(()ident(public_method_name) operator(+) stringoperator(,) ident(exception)operator(,) ident(return_type)operator(,) ident(ws_request)operator(.)ident(protocol_options)operator(\)) - ident(send_web_service_response)operator(()ident(ws_response)operator(\)) - reserved(else) - reserved(if) pre_constant(self)operator(.)ident(class)operator(.)ident(web_service_exception_reporting) - ident(message) operator(=) ident(exception)operator(.)ident(message) - ident(backtrace) operator(=) stringoperator(\))inline_delimiter(})>delimiter(")> - reserved(else) - ident(message) operator(=) string - ident(backtrace) operator(=) string - reserved(end) - ident(render_text)operator(()stringinlinedelimiter(")>operator(,) stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(web_service_direct_invoke)operator(()ident(invocation)operator(\)) - ident(invocation)operator(.)ident(method_named_params)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(value)operator(|) - ident(params)operator([)ident(name)operator(]) operator(=) ident(value) - reserved(end) - ident(params)operator([)stringoperator(]) operator(=) ident(invocation)operator(.)ident(api_method)operator(.)ident(name)operator(.)ident(to_s) - reserved(if) ident(before_action) operator(==) pre_constant(false) - ident(raise)operator(()constant(DispatcherError)operator(,) stringoperator(\)) - reserved(end) - ident(return_value) operator(=) ident(web_service_direct_invoke_without_controller)operator(()ident(invocation)operator(\)) - ident(after_action) - ident(return_value) - reserved(end) - - reserved(def) method(log_request)operator(()ident(ws_request)operator(,) ident(body)operator(\)) - reserved(unless) ident(logger)operator(.)ident(nil?) - ident(name) operator(=) ident(ws_request)operator(.)ident(method_name) - ident(api_method) operator(=) ident(ws_request)operator(.)ident(api_method) - ident(params) operator(=) ident(ws_request)operator(.)ident(method_params) - reserved(if) ident(api_method) operator(&&) ident(api_method)operator(.)ident(expects) - ident(params) operator(=) ident(api_method)operator(.)ident(expects)operator(.)ident(zip)operator(()ident(params)operator(\))operator(.)ident(map)operator({) operator(|)ident(type)operator(,) ident(param)operator(|) stringcontent(=>)inlinedelimiter(")> operator(}) - reserved(else) - ident(params) operator(=) ident(params)operator(.)ident(map)operator({) operator(|)ident(param)operator(|) ident(param)operator(.)ident(inspect) operator(}) - reserved(end) - ident(service) operator(=) ident(ws_request)operator(.)ident(service_name) - ident(logger)operator(.)ident(debug)operator(()stringcontent(()inlineoperator(\))inline_delimiter(})>content(\) Entrypoint: )inlinedelimiter(")>operator(\)) - ident(logger)operator(.)ident(debug)operator(()ident(indent)operator(()ident(body)operator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(log_response)operator(()ident(ws_response)operator(,) ident(elapsed)operator(=)pre_constant(nil)operator(\)) - reserved(unless) ident(logger)operator(.)ident(nil?) - ident(elapsed) operator(=) operator(()ident(elapsed) operator(?) string operator(%) ident(elapsed) operator(:) stringoperator(\)) - ident(logger)operator(.)ident(debug)operator(()string operator(+) ident(elapsed) operator(+) string )inlinedelimiter(")>operator(\)) - ident(logger)operator(.)ident(debug)operator(()ident(indent)operator(()ident(ws_response)operator(.)ident(body)operator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(indent)operator(()ident(body)operator(\)) - ident(body)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(map)operator({)operator(|)ident(x)operator(|) stringdelimiter(")>operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(module) class(WsdlAction) comment(# :nodoc:) - constant(XsdNs) operator(=) string - constant(WsdlNs) operator(=) string - constant(SoapNs) operator(=) string - constant(SoapEncodingNs) operator(=) string - constant(SoapHttpTransport) operator(=) string - - reserved(def) method(wsdl) - reserved(case) ident(request)operator(.)ident(method) - reserved(when) symbol(:get) - reserved(begin) - ident(options) operator(=) operator({) symbol(:type) operator(=)operator(>) stringoperator(,) symbol(:disposition) operator(=)operator(>) string operator(}) - ident(send_data)operator(()ident(to_wsdl)operator(,) ident(options)operator(\)) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - ident(log_error)operator(()ident(e)operator(\)) reserved(unless) ident(logger)operator(.)ident(nil?) - reserved(end) - reserved(when) symbol(:post) - ident(render_text)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(base_uri) - ident(host) operator(=) ident(request)operator(.)ident(env)operator([)stringoperator(]) operator(||) ident(request)operator(.)ident(env)operator([)stringoperator(]) operator(||) string - ident(relative_url_root) operator(=) ident(request)operator(.)ident(relative_url_root) - ident(scheme) operator(=) ident(request)operator(.)ident(ssl?) operator(?) string operator(:) string - string operator(%) operator([)ident(scheme)operator(,) ident(host)operator(,) ident(relative_url_root)operator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(controller_path)operator(]) - reserved(end) - - reserved(def) method(to_wsdl) - ident(xml) operator(=) string - ident(dispatching_mode) operator(=) ident(web_service_dispatching_mode) - ident(global_service_name) operator(=) ident(wsdl_service_name) - ident(namespace) operator(=) ident(wsdl_namespace) operator(||) string - ident(soap_action_base) operator(=) stringdelimiter(")> - - ident(marshaler) operator(=) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(Soap)operator(::)constant(SoapMarshaler)operator(.)ident(new)operator(()ident(namespace)operator(\)) - ident(apis) operator(=) operator({)operator(}) - reserved(case) ident(dispatching_mode) - reserved(when) symbol(:direct) - ident(api) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(web_service_api) - ident(web_service_name) operator(=) ident(controller_class_name)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(underscore) - ident(apis)operator([)ident(web_service_name)operator(]) operator(=) operator([)ident(api)operator(,) ident(register_api)operator(()ident(api)operator(,) ident(marshaler)operator(\))operator(]) - reserved(when) symbol(:delegated)operator(,) symbol(:layered) - pre_constant(self)operator(.)ident(class)operator(.)ident(web_services)operator(.)ident(each) reserved(do) operator(|)ident(web_service_name)operator(,) ident(info)operator(|) - ident(service) operator(=) ident(web_service_object)operator(()ident(web_service_name)operator(\)) - ident(api) operator(=) ident(service)operator(.)ident(class)operator(.)ident(web_service_api) - ident(apis)operator([)ident(web_service_name)operator(]) operator(=) operator([)ident(api)operator(,) ident(register_api)operator(()ident(api)operator(,) ident(marshaler)operator(\))operator(]) - reserved(end) - reserved(end) - ident(custom_types) operator(=) operator([)operator(]) - ident(apis)operator(.)ident(values)operator(.)ident(each) reserved(do) operator(|)ident(api)operator(,) ident(bindings)operator(|) - ident(bindings)operator(.)ident(each) reserved(do) operator(|)ident(b)operator(|) - ident(custom_types) operator(<<) ident(b) reserved(unless) ident(custom_types)operator(.)ident(include?)operator(()ident(b)operator(\)) - reserved(end) - reserved(end) - - ident(xm) operator(=) constant(Builder)operator(::)constant(XmlMarkup)operator(.)ident(new)operator(()symbol(:target) operator(=)operator(>) ident(xml)operator(,) symbol(:indent) operator(=)operator(>) integer(2)operator(\)) - ident(xm)operator(.)ident(instruct!) - ident(xm)operator(.)ident(definitions)operator(()string operator(=)operator(>) ident(wsdl_service_name)operator(,) - string operator(=)operator(>) ident(namespace)operator(,) - string operator(=)operator(>) ident(namespace)operator(,) - string operator(=)operator(>) constant(XsdNs)operator(,) - string operator(=)operator(>) constant(SoapNs)operator(,) - string operator(=)operator(>) constant(SoapEncodingNs)operator(,) - string operator(=)operator(>) constant(WsdlNs)operator(,) - string operator(=)operator(>) constant(WsdlNs)operator(\)) reserved(do) - comment(# Generate XSD) - reserved(if) ident(custom_types)operator(.)ident(size) operator(>) integer(0) - ident(xm)operator(.)ident(types) reserved(do) - ident(xm)operator(.)ident(xsd)operator(()symbol(:schema)operator(,) string operator(=)operator(>) constant(XsdNs)operator(,) string operator(=)operator(>) ident(namespace)operator(\)) reserved(do) - ident(custom_types)operator(.)ident(each) reserved(do) operator(|)ident(binding)operator(|) - reserved(case) - reserved(when) ident(binding)operator(.)ident(type)operator(.)ident(array?) - ident(xm)operator(.)ident(xsd)operator(()symbol(:complexType)operator(,) string operator(=)operator(>) ident(binding)operator(.)ident(type_name)operator(\)) reserved(do) - ident(xm)operator(.)ident(xsd)operator(()symbol(:complexContent)operator(\)) reserved(do) - ident(xm)operator(.)ident(xsd)operator(()symbol(:restriction)operator(,) string operator(=)operator(>) stringoperator(\)) reserved(do) - ident(xm)operator(.)ident(xsd)operator(()symbol(:attribute)operator(,) string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) ident(binding)operator(.)ident(element_binding)operator(.)ident(qualified_type_name)operator(()stringoperator(\)) operator(+) stringoperator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(when) ident(binding)operator(.)ident(type)operator(.)ident(structured?) - ident(xm)operator(.)ident(xsd)operator(()symbol(:complexType)operator(,) string operator(=)operator(>) ident(binding)operator(.)ident(type_name)operator(\)) reserved(do) - ident(xm)operator(.)ident(xsd)operator(()symbol(:all)operator(\)) reserved(do) - ident(binding)operator(.)ident(type)operator(.)ident(each_member) reserved(do) operator(|)ident(name)operator(,) ident(type)operator(|) - ident(b) operator(=) ident(marshaler)operator(.)ident(register_type)operator(()ident(type)operator(\)) - ident(xm)operator(.)ident(xsd)operator(()symbol(:element)operator(,) string operator(=)operator(>) ident(name)operator(,) string operator(=)operator(>) ident(b)operator(.)ident(qualified_type_name)operator(()stringoperator(\))operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# APIs) - ident(apis)operator(.)ident(each) reserved(do) operator(|)ident(api_name)operator(,) ident(values)operator(|) - ident(api) operator(=) ident(values)operator([)integer(0)operator(]) - ident(api)operator(.)ident(api_methods)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(method)operator(|) - ident(gen) operator(=) ident(lambda) reserved(do) operator(|)ident(msg_name)operator(,) ident(direction)operator(|) - ident(xm)operator(.)ident(message)operator(()string operator(=)operator(>) ident(message_name_for)operator(()ident(api_name)operator(,) ident(msg_name)operator(\))operator(\)) reserved(do) - ident(sym) operator(=) pre_constant(nil) - reserved(if) ident(direction) operator(==) symbol(:out) - ident(returns) operator(=) ident(method)operator(.)ident(returns) - reserved(if) ident(returns) - ident(binding) operator(=) ident(marshaler)operator(.)ident(register_type)operator(()ident(returns)operator([)integer(0)operator(])operator(\)) - ident(xm)operator(.)ident(part)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(binding)operator(.)ident(qualified_type_name)operator(()stringoperator(\))operator(\)) - reserved(end) - reserved(else) - ident(expects) operator(=) ident(method)operator(.)ident(expects) - ident(expects)operator(.)ident(each) reserved(do) operator(|)ident(type)operator(|) - ident(binding) operator(=) ident(marshaler)operator(.)ident(register_type)operator(()ident(type)operator(\)) - ident(xm)operator(.)ident(part)operator(()string operator(=)operator(>) ident(type)operator(.)ident(name)operator(,) string operator(=)operator(>) ident(binding)operator(.)ident(qualified_type_name)operator(()stringoperator(\))operator(\)) - reserved(end) reserved(if) ident(expects) - reserved(end) - reserved(end) - reserved(end) - ident(public_name) operator(=) ident(method)operator(.)ident(public_name) - ident(gen)operator(.)ident(call)operator(()ident(public_name)operator(,) symbol(:in)operator(\)) - ident(gen)operator(.)ident(call)operator(()stringcontent(Response)delimiter(")>operator(,) symbol(:out)operator(\)) - reserved(end) - - comment(# Port) - ident(port_name) operator(=) ident(port_name_for)operator(()ident(global_service_name)operator(,) ident(api_name)operator(\)) - ident(xm)operator(.)ident(portType)operator(()string operator(=)operator(>) ident(port_name)operator(\)) reserved(do) - ident(api)operator(.)ident(api_methods)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(method)operator(|) - ident(xm)operator(.)ident(operation)operator(()string operator(=)operator(>) ident(method)operator(.)ident(public_name)operator(\)) reserved(do) - ident(xm)operator(.)ident(input)operator(()string operator(=)operator(>) string operator(+) ident(message_name_for)operator(()ident(api_name)operator(,) ident(method)operator(.)ident(public_name)operator(\))operator(\)) - ident(xm)operator(.)ident(output)operator(()string operator(=)operator(>) string operator(+) ident(message_name_for)operator(()ident(api_name)operator(,) stringcontent(Response)delimiter(")>operator(\))operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Bind it) - ident(binding_name) operator(=) ident(binding_name_for)operator(()ident(global_service_name)operator(,) ident(api_name)operator(\)) - ident(xm)operator(.)ident(binding)operator(()string operator(=)operator(>) ident(binding_name)operator(,) string operator(=)operator(>) stringdelimiter(")>operator(\)) reserved(do) - ident(xm)operator(.)ident(soap)operator(()symbol(:binding)operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) constant(SoapHttpTransport)operator(\)) - ident(api)operator(.)ident(api_methods)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(method)operator(|) - ident(xm)operator(.)ident(operation)operator(()string operator(=)operator(>) ident(method)operator(.)ident(public_name)operator(\)) reserved(do) - reserved(case) ident(web_service_dispatching_mode) - reserved(when) symbol(:direct) - ident(soap_action) operator(=) ident(soap_action_base) operator(+) string operator(+) ident(method)operator(.)ident(public_name) - reserved(when) symbol(:delegated)operator(,) symbol(:layered) - ident(soap_action) operator(=) ident(soap_action_base) \ - operator(+) string operator(+) ident(api_name)operator(.)ident(to_s) \ - operator(+) string operator(+) ident(method)operator(.)ident(public_name) - reserved(end) - ident(xm)operator(.)ident(soap)operator(()symbol(:operation)operator(,) string operator(=)operator(>) ident(soap_action)operator(\)) - ident(xm)operator(.)ident(input) reserved(do) - ident(xm)operator(.)ident(soap)operator(()symbol(:body)operator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) ident(namespace)operator(,) - string operator(=)operator(>) constant(SoapEncodingNs)operator(\)) - reserved(end) - ident(xm)operator(.)ident(output) reserved(do) - ident(xm)operator(.)ident(soap)operator(()symbol(:body)operator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) ident(namespace)operator(,) - string operator(=)operator(>) constant(SoapEncodingNs)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# Define it) - ident(xm)operator(.)ident(service)operator(()string operator(=)operator(>) stringcontent(Service)delimiter(")>operator(\)) reserved(do) - ident(apis)operator(.)ident(each) reserved(do) operator(|)ident(api_name)operator(,) ident(values)operator(|) - ident(port_name) operator(=) ident(port_name_for)operator(()ident(global_service_name)operator(,) ident(api_name)operator(\)) - ident(binding_name) operator(=) ident(binding_name_for)operator(()ident(global_service_name)operator(,) ident(api_name)operator(\)) - reserved(case) ident(web_service_dispatching_mode) - reserved(when) symbol(:direct)operator(,) symbol(:layered) - ident(binding_target) operator(=) string - reserved(when) symbol(:delegated) - ident(binding_target) operator(=) ident(api_name)operator(.)ident(to_s) - reserved(end) - ident(xm)operator(.)ident(port)operator(()string operator(=)operator(>) ident(port_name)operator(,) string operator(=)operator(>) stringdelimiter(")>operator(\)) reserved(do) - ident(xm)operator(.)ident(soap)operator(()symbol(:address)operator(,) string operator(=)operator(>) stringinlinedelimiter(")>operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(port_name_for)operator(()ident(global_service)operator(,) ident(service)operator(\)) - stringinlinecontent(Port)delimiter(")> - reserved(end) - - reserved(def) method(binding_name_for)operator(()ident(global_service)operator(,) ident(service)operator(\)) - stringinlinecontent(Binding)delimiter(")> - reserved(end) - - reserved(def) method(message_name_for)operator(()ident(api_name)operator(,) ident(message_name)operator(\)) - ident(mode) operator(=) ident(web_service_dispatching_mode) - reserved(if) ident(mode) operator(==) symbol(:layered) operator(||) ident(mode) operator(==) symbol(:delegated) - ident(api_name)operator(.)ident(to_s) operator(+) string operator(+) ident(message_name) - reserved(else) - ident(message_name) - reserved(end) - reserved(end) - - reserved(def) method(register_api)operator(()ident(api)operator(,) ident(marshaler)operator(\)) - ident(bindings) operator(=) operator({)operator(}) - ident(traverse_custom_types)operator(()ident(api)operator(,) ident(marshaler)operator(,) ident(bindings)operator(\)) reserved(do) operator(|)ident(binding)operator(|) - ident(bindings)operator([)ident(binding)operator(]) operator(=) pre_constant(nil) reserved(unless) ident(bindings)operator(.)ident(has_key?)operator(()ident(binding)operator(\)) - ident(element_binding) operator(=) ident(binding)operator(.)ident(element_binding) - ident(bindings)operator([)ident(element_binding)operator(]) operator(=) pre_constant(nil) reserved(if) ident(element_binding) operator(&&) operator(!)ident(bindings)operator(.)ident(has_key?)operator(()ident(element_binding)operator(\)) - reserved(end) - ident(bindings)operator(.)ident(keys) - reserved(end) - - reserved(def) method(traverse_custom_types)operator(()ident(api)operator(,) ident(marshaler)operator(,) ident(bindings)operator(,) operator(&)ident(block)operator(\)) - ident(api)operator(.)ident(api_methods)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(method)operator(|) - ident(expects)operator(,) ident(returns) operator(=) ident(method)operator(.)ident(expects)operator(,) ident(method)operator(.)ident(returns) - ident(expects)operator(.)ident(each)operator({) operator(|)ident(type)operator(|) ident(traverse_type)operator(()ident(marshaler)operator(,) ident(type)operator(,) ident(bindings)operator(,) operator(&)ident(block)operator(\)) reserved(if) ident(type)operator(.)ident(custom?) operator(}) reserved(if) ident(expects) - ident(returns)operator(.)ident(each)operator({) operator(|)ident(type)operator(|) ident(traverse_type)operator(()ident(marshaler)operator(,) ident(type)operator(,) ident(bindings)operator(,) operator(&)ident(block)operator(\)) reserved(if) ident(type)operator(.)ident(custom?) operator(}) reserved(if) ident(returns) - reserved(end) - reserved(end) - - reserved(def) method(traverse_type)operator(()ident(marshaler)operator(,) ident(type)operator(,) ident(bindings)operator(,) operator(&)ident(block)operator(\)) - ident(binding) operator(=) ident(marshaler)operator(.)ident(register_type)operator(()ident(type)operator(\)) - reserved(return) reserved(if) ident(bindings)operator(.)ident(has_key?)operator(()ident(binding)operator(\)) - ident(bindings)operator([)ident(binding)operator(]) operator(=) pre_constant(nil) - reserved(yield) ident(binding) - reserved(if) ident(type)operator(.)ident(array?) - reserved(yield) ident(marshaler)operator(.)ident(register_type)operator(()ident(type)operator(.)ident(element_type)operator(\)) - ident(type) operator(=) ident(type)operator(.)ident(element_type) - reserved(end) - ident(type)operator(.)ident(each_member)operator({) operator(|)ident(name)operator(,) ident(type)operator(|) ident(traverse_type)operator(()ident(marshaler)operator(,) ident(type)operator(,) ident(bindings)operator(,) operator(&)ident(block)operator(\)) operator(}) reserved(if) ident(type)operator(.)ident(structured?) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Invocation) comment(# :nodoc:) - reserved(class) class(InvocationError) operator(<) constant(ActionWebService)operator(::)constant(ActionWebServiceError) comment(# :nodoc:) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(# :nodoc:) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - ident(base)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(ActionWebService)operator(::)constant(Invocation)operator(::)constant(InstanceMethods)operator(\)) - reserved(end) - - comment(# Invocation interceptors provide a means to execute custom code before) - comment(# and after method invocations on ActionWebService::Base objects.) - comment(#) - comment(# When running in _Direct_ dispatching mode, ActionController filters) - comment(# should be used for this functionality instead.) - comment(#) - comment(# The semantics of invocation interceptors are the same as ActionController) - comment(# filters, and accept the same parameters and options.) - comment(#) - comment(# A _before_ interceptor can also cancel execution by returning +false+,) - comment(# or returning a [false, "cancel reason"] array if it wishes to supply) - comment(# a reason for canceling the request.) - comment(#) - comment(# === Example) - comment(#) - comment(# class CustomService < ActionWebService::Base) - comment(# before_invocation :intercept_add, :only => [:add]) - comment(#) - comment(# def add(a, b\)) - comment(# a + b) - comment(# end) - comment(#) - comment(# private) - comment(# def intercept_add) - comment(# return [false, "permission denied"] # cancel it) - comment(# end) - comment(# end) - comment(#) - comment(# Options:) - comment(# [:except] A list of methods for which the interceptor will NOT be called) - comment(# [:only] A list of methods for which the interceptor WILL be called) - reserved(module) class(ClassMethods) - comment(# Appends the given +interceptors+ to be called) - comment(# _before_ method invocation.) - reserved(def) method(append_before_invocation)operator(()operator(*)ident(interceptors)operator(,) operator(&)ident(block)operator(\)) - ident(conditions) operator(=) ident(extract_conditions!)operator(()ident(interceptors)operator(\)) - ident(interceptors) operator(<<) ident(block) reserved(if) ident(block_given?) - ident(add_interception_conditions)operator(()ident(interceptors)operator(,) ident(conditions)operator(\)) - ident(append_interceptors_to_chain)operator(()stringoperator(,) ident(interceptors)operator(\)) - reserved(end) - - comment(# Prepends the given +interceptors+ to be called) - comment(# _before_ method invocation.) - reserved(def) method(prepend_before_invocation)operator(()operator(*)ident(interceptors)operator(,) operator(&)ident(block)operator(\)) - ident(conditions) operator(=) ident(extract_conditions!)operator(()ident(interceptors)operator(\)) - ident(interceptors) operator(<<) ident(block) reserved(if) ident(block_given?) - ident(add_interception_conditions)operator(()ident(interceptors)operator(,) ident(conditions)operator(\)) - ident(prepend_interceptors_to_chain)operator(()stringoperator(,) ident(interceptors)operator(\)) - reserved(end) - - reserved(alias) symbol(:before_invocation) symbol(:append_before_invocation) - - comment(# Appends the given +interceptors+ to be called) - comment(# _after_ method invocation.) - reserved(def) method(append_after_invocation)operator(()operator(*)ident(interceptors)operator(,) operator(&)ident(block)operator(\)) - ident(conditions) operator(=) ident(extract_conditions!)operator(()ident(interceptors)operator(\)) - ident(interceptors) operator(<<) ident(block) reserved(if) ident(block_given?) - ident(add_interception_conditions)operator(()ident(interceptors)operator(,) ident(conditions)operator(\)) - ident(append_interceptors_to_chain)operator(()stringoperator(,) ident(interceptors)operator(\)) - reserved(end) - - comment(# Prepends the given +interceptors+ to be called) - comment(# _after_ method invocation.) - reserved(def) method(prepend_after_invocation)operator(()operator(*)ident(interceptors)operator(,) operator(&)ident(block)operator(\)) - ident(conditions) operator(=) ident(extract_conditions!)operator(()ident(interceptors)operator(\)) - ident(interceptors) operator(<<) ident(block) reserved(if) ident(block_given?) - ident(add_interception_conditions)operator(()ident(interceptors)operator(,) ident(conditions)operator(\)) - ident(prepend_interceptors_to_chain)operator(()stringoperator(,) ident(interceptors)operator(\)) - reserved(end) - - reserved(alias) symbol(:after_invocation) symbol(:append_after_invocation) - - reserved(def) method(before_invocation_interceptors) comment(# :nodoc:) - ident(read_inheritable_attribute)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(after_invocation_interceptors) comment(# :nodoc:) - ident(read_inheritable_attribute)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(included_intercepted_methods) comment(# :nodoc:) - ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator({)operator(}) - reserved(end) - - reserved(def) method(excluded_intercepted_methods) comment(# :nodoc:) - ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator({)operator(}) - reserved(end) - - ident(private) - reserved(def) method(append_interceptors_to_chain)operator(()ident(condition)operator(,) ident(interceptors)operator(\)) - ident(write_inheritable_array)operator(()stringcontent(_invocation_interceptors)delimiter(")>operator(,) ident(interceptors)operator(\)) - reserved(end) - - reserved(def) method(prepend_interceptors_to_chain)operator(()ident(condition)operator(,) ident(interceptors)operator(\)) - ident(interceptors) operator(=) ident(interceptors) operator(+) ident(read_inheritable_attribute)operator(()stringcontent(_invocation_interceptors)delimiter(")>operator(\)) - ident(write_inheritable_attribute)operator(()stringcontent(_invocation_interceptors)delimiter(")>operator(,) ident(interceptors)operator(\)) - reserved(end) - - reserved(def) method(extract_conditions!)operator(()ident(interceptors)operator(\)) - reserved(return) pre_constant(nil) reserved(unless) ident(interceptors)operator(.)ident(last)operator(.)ident(is_a?) constant(Hash) - ident(interceptors)operator(.)ident(pop) - reserved(end) - - reserved(def) method(add_interception_conditions)operator(()ident(interceptors)operator(,) ident(conditions)operator(\)) - reserved(return) reserved(unless) ident(conditions) - ident(included)operator(,) ident(excluded) operator(=) ident(conditions)operator([)symbol(:only)operator(])operator(,) ident(conditions)operator([)symbol(:except)operator(]) - ident(write_inheritable_hash)operator(()stringoperator(,) ident(condition_hash)operator(()ident(interceptors)operator(,) ident(included)operator(\))operator(\)) operator(&&) reserved(return) reserved(if) ident(included) - ident(write_inheritable_hash)operator(()stringoperator(,) ident(condition_hash)operator(()ident(interceptors)operator(,) ident(excluded)operator(\))operator(\)) reserved(if) ident(excluded) - reserved(end) - - reserved(def) method(condition_hash)operator(()ident(interceptors)operator(,) operator(*)ident(methods)operator(\)) - ident(interceptors)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({)operator(|)ident(hash)operator(,) ident(interceptor)operator(|) ident(hash)operator(.)ident(merge)operator(()ident(interceptor) operator(=)operator(>) ident(methods)operator(.)ident(flatten)operator(.)ident(map) operator({)operator(|)ident(method)operator(|) ident(method)operator(.)ident(to_s)operator(})operator(\))operator(}) - reserved(end) - reserved(end) - - reserved(module) class(InstanceMethods) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:perform_invocation_without_interception)operator(,) symbol(:perform_invocation) - ident(alias_method) symbol(:perform_invocation)operator(,) symbol(:perform_invocation_with_interception) - reserved(end) - reserved(end) - - reserved(def) method(perform_invocation_with_interception)operator(()ident(method_name)operator(,) ident(params)operator(,) operator(&)ident(block)operator(\)) - reserved(return) reserved(if) ident(before_invocation)operator(()ident(method_name)operator(,) ident(params)operator(,) operator(&)ident(block)operator(\)) operator(==) pre_constant(false) - ident(return_value) operator(=) ident(perform_invocation_without_interception)operator(()ident(method_name)operator(,) ident(params)operator(\)) - ident(after_invocation)operator(()ident(method_name)operator(,) ident(params)operator(,) ident(return_value)operator(\)) - ident(return_value) - reserved(end) - - reserved(def) method(perform_invocation)operator(()ident(method_name)operator(,) ident(params)operator(\)) - ident(send)operator(()ident(method_name)operator(,) operator(*)ident(params)operator(\)) - reserved(end) - - reserved(def) method(before_invocation)operator(()ident(name)operator(,) ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(call_interceptors)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(before_invocation_interceptors)operator(,) operator([)ident(name)operator(,) ident(args)operator(])operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(after_invocation)operator(()ident(name)operator(,) ident(args)operator(,) ident(result)operator(\)) - ident(call_interceptors)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(after_invocation_interceptors)operator(,) operator([)ident(name)operator(,) ident(args)operator(,) ident(result)operator(])operator(\)) - reserved(end) - - ident(private) - - reserved(def) method(call_interceptors)operator(()ident(interceptors)operator(,) ident(interceptor_args)operator(,) operator(&)ident(block)operator(\)) - reserved(if) ident(interceptors) reserved(and) reserved(not) ident(interceptors)operator(.)ident(empty?) - ident(interceptors)operator(.)ident(each) reserved(do) operator(|)ident(interceptor)operator(|) - reserved(next) reserved(if) ident(method_exempted?)operator(()ident(interceptor)operator(,) ident(interceptor_args)operator([)integer(0)operator(])operator(.)ident(to_s)operator(\)) - ident(result) operator(=) reserved(case) - reserved(when) ident(interceptor)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - pre_constant(self)operator(.)ident(send)operator(()ident(interceptor)operator(,) operator(*)ident(interceptor_args)operator(\)) - reserved(when) ident(interceptor_block?)operator(()ident(interceptor)operator(\)) - ident(interceptor)operator(.)ident(call)operator(()pre_constant(self)operator(,) operator(*)ident(interceptor_args)operator(\)) - reserved(when) ident(interceptor_class?)operator(()ident(interceptor)operator(\)) - ident(interceptor)operator(.)ident(intercept)operator(()pre_constant(self)operator(,) operator(*)ident(interceptor_args)operator(\)) - reserved(else) - ident(raise)operator(() - constant(InvocationError)operator(,) - string - operator(\)) - reserved(end) - ident(reason) operator(=) pre_constant(nil) - reserved(if) ident(result)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - ident(reason) operator(=) ident(result)operator([)integer(1)operator(]) reserved(if) ident(result)operator([)integer(1)operator(]) - ident(result) operator(=) ident(result)operator([)integer(0)operator(]) - reserved(end) - reserved(if) ident(result) operator(==) pre_constant(false) - ident(block)operator(.)ident(call)operator(()ident(reason)operator(\)) reserved(if) ident(block) operator(&&) ident(reason) - reserved(return) pre_constant(false) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(interceptor_block?)operator(()ident(interceptor)operator(\)) - ident(interceptor)operator(.)ident(respond_to?)operator(()stringoperator(\)) operator(&&) operator(()ident(interceptor)operator(.)ident(arity) operator(==) integer(3) operator(||) ident(interceptor)operator(.)ident(arity) operator(==) integer(-1)operator(\)) - reserved(end) - - reserved(def) method(interceptor_class?)operator(()ident(interceptor)operator(\)) - ident(interceptor)operator(.)ident(respond_to?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(method_exempted?)operator(()ident(interceptor)operator(,) ident(method_name)operator(\)) - reserved(case) - reserved(when) pre_constant(self)operator(.)ident(class)operator(.)ident(included_intercepted_methods)operator([)ident(interceptor)operator(]) - operator(!)pre_constant(self)operator(.)ident(class)operator(.)ident(included_intercepted_methods)operator([)ident(interceptor)operator(])operator(.)ident(include?)operator(()ident(method_name)operator(\)) - reserved(when) pre_constant(self)operator(.)ident(class)operator(.)ident(excluded_intercepted_methods)operator([)ident(interceptor)operator(]) - pre_constant(self)operator(.)ident(class)operator(.)ident(excluded_intercepted_methods)operator([)ident(interceptor)operator(])operator(.)ident(include?)operator(()ident(method_name)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Protocol) comment(# :nodoc:) - reserved(class) class(ProtocolError) operator(<) constant(ActionWebServiceError) comment(# :nodoc:) - reserved(end) - - reserved(class) class(AbstractProtocol) comment(# :nodoc:) - reserved(def) method(setup)operator(()ident(controller)operator(\)) - reserved(end) - - reserved(def) method(decode_action_pack_request)operator(()ident(action_pack_request)operator(\)) - reserved(end) - - reserved(def) method(encode_action_pack_request)operator(()ident(service_name)operator(,) ident(public_method_name)operator(,) ident(raw_body)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - ident(klass) operator(=) ident(options)operator([)symbol(:request_class)operator(]) operator(||) constant(SimpleActionPackRequest) - ident(request) operator(=) ident(klass)operator(.)ident(new) - ident(request)operator(.)ident(request_parameters)operator([)stringoperator(]) operator(=) ident(service_name)operator(.)ident(to_s) - ident(request)operator(.)ident(env)operator([)stringoperator(]) operator(=) ident(raw_body) - ident(request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(request) - reserved(end) - - reserved(def) method(decode_request)operator(()ident(raw_request)operator(,) ident(service_name)operator(,) ident(protocol_options)operator(=)operator({)operator(})operator(\)) - reserved(end) - - reserved(def) method(encode_request)operator(()ident(method_name)operator(,) ident(params)operator(,) ident(param_types)operator(\)) - reserved(end) - - reserved(def) method(decode_response)operator(()ident(raw_response)operator(\)) - reserved(end) - - reserved(def) method(encode_response)operator(()ident(method_name)operator(,) ident(return_value)operator(,) ident(return_type)operator(,) ident(protocol_options)operator(=)operator({)operator(})operator(\)) - reserved(end) - - reserved(def) method(protocol_client)operator(()ident(api)operator(,) ident(protocol_name)operator(,) ident(endpoint_uri)operator(,) ident(options)operator(\)) - reserved(end) - - reserved(def) method(register_api)operator(()ident(api)operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(Request) comment(# :nodoc:) - ident(attr) symbol(:protocol) - ident(attr_accessor) symbol(:method_name) - ident(attr_accessor) symbol(:method_params) - ident(attr) symbol(:service_name) - ident(attr_accessor) symbol(:api) - ident(attr_accessor) symbol(:api_method) - ident(attr) symbol(:protocol_options) - - reserved(def) method(initialize)operator(()ident(protocol)operator(,) ident(method_name)operator(,) ident(method_params)operator(,) ident(service_name)operator(,) ident(api)operator(=)pre_constant(nil)operator(,) ident(api_method)operator(=)pre_constant(nil)operator(,) ident(protocol_options)operator(=)pre_constant(nil)operator(\)) - instance_variable(@protocol) operator(=) ident(protocol) - instance_variable(@method_name) operator(=) ident(method_name) - instance_variable(@method_params) operator(=) ident(method_params) - instance_variable(@service_name) operator(=) ident(service_name) - instance_variable(@api) operator(=) ident(api) - instance_variable(@api_method) operator(=) ident(api_method) - instance_variable(@protocol_options) operator(=) ident(protocol_options) operator(||) operator({)operator(}) - reserved(end) - reserved(end) - - reserved(class) class(Response) comment(# :nodoc:) - ident(attr) symbol(:body) - ident(attr) symbol(:content_type) - ident(attr) symbol(:return_value) - - reserved(def) method(initialize)operator(()ident(body)operator(,) ident(content_type)operator(,) ident(return_value)operator(\)) - instance_variable(@body) operator(=) ident(body) - instance_variable(@content_type) operator(=) ident(content_type) - instance_variable(@return_value) operator(=) ident(return_value) - reserved(end) - reserved(end) - - reserved(class) class(SimpleActionPackRequest) operator(<) constant(ActionController)operator(::)constant(AbstractRequest) comment(# :nodoc:) - reserved(def) method(initialize) - instance_variable(@env) operator(=) operator({)operator(}) - instance_variable(@qparams) operator(=) operator({)operator(}) - instance_variable(@rparams) operator(=) operator({)operator(}) - instance_variable(@cookies) operator(=) operator({)operator(}) - ident(reset_session) - reserved(end) - - reserved(def) method(query_parameters) - instance_variable(@qparams) - reserved(end) - - reserved(def) method(request_parameters) - instance_variable(@rparams) - reserved(end) - - reserved(def) method(env) - instance_variable(@env) - reserved(end) - - reserved(def) method(host) - string - reserved(end) - - reserved(def) method(cookies) - instance_variable(@cookies) - reserved(end) - - reserved(def) method(session) - instance_variable(@session) - reserved(end) - - reserved(def) method(reset_session) - instance_variable(@session) operator(=) operator({)operator(}) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(Protocol) comment(# :nodoc:) - reserved(module) class(Discovery) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - ident(base)operator(.)ident(send)operator(()symbol(:include)operator(,) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(Discovery)operator(::)constant(InstanceMethods)operator(\)) - reserved(end) - - reserved(module) class(ClassMethods) comment(# :nodoc:) - reserved(def) method(register_protocol)operator(()ident(klass)operator(\)) - ident(write_inheritable_array)operator(()stringoperator(,) operator([)ident(klass)operator(])operator(\)) - reserved(end) - reserved(end) - - reserved(module) class(InstanceMethods) comment(# :nodoc:) - ident(private) - reserved(def) method(discover_web_service_request)operator(()ident(action_pack_request)operator(\)) - operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator([)operator(])operator(\))operator(.)ident(each) reserved(do) operator(|)ident(protocol)operator(|) - ident(protocol) operator(=) ident(protocol)operator(.)ident(create)operator(()pre_constant(self)operator(\)) - ident(request) operator(=) ident(protocol)operator(.)ident(decode_action_pack_request)operator(()ident(action_pack_request)operator(\)) - reserved(return) ident(request) reserved(unless) ident(request)operator(.)ident(nil?) - reserved(end) - pre_constant(nil) - reserved(end) - - reserved(def) method(create_web_service_client)operator(()ident(api)operator(,) ident(protocol_name)operator(,) ident(endpoint_uri)operator(,) ident(options)operator(\)) - operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator([)operator(])operator(\))operator(.)ident(each) reserved(do) operator(|)ident(protocol)operator(|) - ident(protocol) operator(=) ident(protocol)operator(.)ident(create)operator(()pre_constant(self)operator(\)) - ident(client) operator(=) ident(protocol)operator(.)ident(protocol_client)operator(()ident(api)operator(,) ident(protocol_name)operator(,) ident(endpoint_uri)operator(,) ident(options)operator(\)) - reserved(return) ident(client) reserved(unless) ident(client)operator(.)ident(nil?) - reserved(end) - pre_constant(nil) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActionWebService) - reserved(module) class(Protocol) - reserved(module) class(Soap) - comment(# Workaround for SOAP4R return values changing) - reserved(class) class(Registry) operator(<) constant(SOAP)operator(::)constant(Mapping)operator(::)constant(Registry) - reserved(if) constant(SOAP)operator(::)constant(Version) operator(>)operator(=) string - reserved(def) method(find_mapped_soap_class)operator(()ident(obj_class)operator(\)) - reserved(return) instance_variable(@map)operator(.)ident(instance_eval) operator({) instance_variable(@obj2soap)operator([)ident(obj_class)operator(])operator([)integer(0)operator(]) operator(}) - reserved(end) - - reserved(def) method(find_mapped_obj_class)operator(()ident(soap_class)operator(\)) - reserved(return) instance_variable(@map)operator(.)ident(instance_eval) operator({) instance_variable(@soap2obj)operator([)ident(soap_class)operator(])operator([)integer(0)operator(]) operator(}) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(SoapMarshaler) - ident(attr) symbol(:namespace) - ident(attr) symbol(:registry) - - reserved(def) method(initialize)operator(()ident(namespace)operator(=)pre_constant(nil)operator(\)) - instance_variable(@namespace) operator(=) ident(namespace) operator(||) string - instance_variable(@registry) operator(=) constant(Registry)operator(.)ident(new) - instance_variable(@type2binding) operator(=) operator({)operator(}) - ident(register_static_factories) - reserved(end) - - reserved(def) method(soap_to_ruby)operator(()ident(obj)operator(\)) - constant(SOAP)operator(::)constant(Mapping)operator(.)ident(soap2obj)operator(()ident(obj)operator(,) instance_variable(@registry)operator(\)) - reserved(end) - - reserved(def) method(ruby_to_soap)operator(()ident(obj)operator(\)) - ident(soap) operator(=) constant(SOAP)operator(::)constant(Mapping)operator(.)ident(obj2soap)operator(()ident(obj)operator(,) instance_variable(@registry)operator(\)) - ident(soap)operator(.)ident(elename) operator(=) constant(XSD)operator(::)constant(QName)operator(.)ident(new) reserved(if) constant(SOAP)operator(::)constant(Version) operator(>)operator(=) string operator(&&) ident(soap)operator(.)ident(elename) operator(==) constant(XSD)operator(::)constant(QName)operator(::)constant(EMPTY) - ident(soap) - reserved(end) - - reserved(def) method(register_type)operator(()ident(type)operator(\)) - reserved(return) instance_variable(@type2binding)operator([)ident(type)operator(]) reserved(if) instance_variable(@type2binding)operator(.)ident(has_key?)operator(()ident(type)operator(\)) - - reserved(if) ident(type)operator(.)ident(array?) - ident(array_mapping) operator(=) instance_variable(@registry)operator(.)ident(find_mapped_soap_class)operator(()constant(Array)operator(\)) - ident(qname) operator(=) constant(XSD)operator(::)constant(QName)operator(.)ident(new)operator(()instance_variable(@namespace)operator(,) ident(soap_type_name)operator(()ident(type)operator(.)ident(element_type)operator(.)ident(type_class)operator(.)ident(name)operator(\)) operator(+) stringoperator(\)) - ident(element_type_binding) operator(=) ident(register_type)operator(()ident(type)operator(.)ident(element_type)operator(\)) - instance_variable(@type2binding)operator([)ident(type)operator(]) operator(=) constant(SoapBinding)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(qname)operator(,) ident(type)operator(,) ident(array_mapping)operator(,) ident(element_type_binding)operator(\)) - reserved(elsif) operator(()ident(mapping) operator(=) instance_variable(@registry)operator(.)ident(find_mapped_soap_class)operator(()ident(type)operator(.)ident(type_class)operator(\)) reserved(rescue) pre_constant(nil)operator(\)) - ident(qname) operator(=) ident(mapping)operator([)integer(2)operator(]) operator(?) ident(mapping)operator([)integer(2)operator(])operator([)symbol(:type)operator(]) operator(:) pre_constant(nil) - ident(qname) operator(||=) ident(soap_base_type_name)operator(()ident(mapping)operator([)integer(0)operator(])operator(\)) - instance_variable(@type2binding)operator([)ident(type)operator(]) operator(=) constant(SoapBinding)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(qname)operator(,) ident(type)operator(,) ident(mapping)operator(\)) - reserved(else) - ident(qname) operator(=) constant(XSD)operator(::)constant(QName)operator(.)ident(new)operator(()instance_variable(@namespace)operator(,) ident(soap_type_name)operator(()ident(type)operator(.)ident(type_class)operator(.)ident(name)operator(\))operator(\)) - instance_variable(@registry)operator(.)ident(add)operator(()ident(type)operator(.)ident(type_class)operator(,) - constant(SOAP)operator(::)constant(SOAPStruct)operator(,) - ident(typed_struct_factory)operator(()ident(type)operator(.)ident(type_class)operator(\))operator(,) - operator({) symbol(:type) operator(=)operator(>) ident(qname) operator(})operator(\)) - ident(mapping) operator(=) instance_variable(@registry)operator(.)ident(find_mapped_soap_class)operator(()ident(type)operator(.)ident(type_class)operator(\)) - instance_variable(@type2binding)operator([)ident(type)operator(]) operator(=) constant(SoapBinding)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(qname)operator(,) ident(type)operator(,) ident(mapping)operator(\)) - reserved(end) - - reserved(if) ident(type)operator(.)ident(structured?) - ident(type)operator(.)ident(each_member) reserved(do) operator(|)ident(m_name)operator(,) ident(m_type)operator(|) - ident(register_type)operator(()ident(m_type)operator(\)) - reserved(end) - reserved(end) - - instance_variable(@type2binding)operator([)ident(type)operator(]) - reserved(end) - reserved(alias) symbol(:lookup_type) symbol(:register_type) - - reserved(def) method(annotate_arrays)operator(()ident(binding)operator(,) ident(value)operator(\)) - reserved(if) ident(value)operator(.)ident(nil?) - reserved(return) - reserved(elsif) ident(binding)operator(.)ident(type)operator(.)ident(array?) - ident(mark_typed_array)operator(()ident(value)operator(,) ident(binding)operator(.)ident(element_binding)operator(.)ident(qname)operator(\)) - reserved(if) ident(binding)operator(.)ident(element_binding)operator(.)ident(type)operator(.)ident(custom?) - ident(value)operator(.)ident(each) reserved(do) operator(|)ident(element)operator(|) - ident(annotate_arrays)operator(()ident(binding)operator(.)ident(element_binding)operator(,) ident(element)operator(\)) - reserved(end) - reserved(end) - reserved(elsif) ident(binding)operator(.)ident(type)operator(.)ident(structured?) - ident(binding)operator(.)ident(type)operator(.)ident(each_member) reserved(do) operator(|)ident(name)operator(,) ident(type)operator(|) - ident(member_binding) operator(=) ident(register_type)operator(()ident(type)operator(\)) - ident(member_value) operator(=) ident(value)operator(.)ident(respond_to?)operator(()stringoperator(\)) operator(?) ident(value)operator([)ident(name)operator(]) operator(:) ident(value)operator(.)ident(send)operator(()ident(name)operator(\)) - ident(annotate_arrays)operator(()ident(member_binding)operator(,) ident(member_value)operator(\)) reserved(if) ident(type)operator(.)ident(custom?) - reserved(end) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(typed_struct_factory)operator(()ident(type_class)operator(\)) - reserved(if) constant(Object)operator(.)ident(const_defined?)operator(()stringoperator(\)) - reserved(if) ident(type_class)operator(.)ident(ancestors)operator(.)ident(include?)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(\)) - ident(qname) operator(=) constant(XSD)operator(::)constant(QName)operator(.)ident(new)operator(()instance_variable(@namespace)operator(,) ident(soap_type_name)operator(()ident(type_class)operator(.)ident(name)operator(\))operator(\)) - ident(type_class)operator(.)ident(instance_variable_set)operator(()stringoperator(,) ident(qname)operator(\)) - reserved(return) constant(SoapActiveRecordStructFactory)operator(.)ident(new) - reserved(end) - reserved(end) - constant(SOAP)operator(::)constant(Mapping)operator(::)constant(Registry)operator(::)constant(TypedStructFactory) - reserved(end) - - reserved(def) method(mark_typed_array)operator(()ident(array)operator(,) ident(qname)operator(\)) - operator(()reserved(class) operator(<<) class(array)operator(;) pre_constant(self)operator(;) reserved(end)operator(\))operator(.)ident(class_eval) reserved(do) - ident(define_method)operator(()symbol(:arytype)operator(\)) reserved(do) - ident(qname) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(soap_base_type_name)operator(()ident(type)operator(\)) - ident(xsd_type) operator(=) ident(type)operator(.)ident(ancestors)operator(.)ident(find)operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(const_defined?) string operator(}) - ident(xsd_type) operator(?) ident(xsd_type)operator(.)ident(const_get)operator(()stringoperator(\)) operator(:) constant(XSD)operator(::)constant(XSDAnySimpleType)operator(::)constant(Type) - reserved(end) - - reserved(def) method(soap_type_name)operator(()ident(type_name)operator(\)) - ident(type_name)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(register_static_factories) - instance_variable(@registry)operator(.)ident(add)operator(()constant(ActionWebService)operator(::)constant(Base64)operator(,) - constant(SOAP)operator(::)constant(SOAPBase64)operator(,) - constant(SoapBase64Factory)operator(.)ident(new)operator(,) - pre_constant(nil)operator(\)) - ident(mapping) operator(=) instance_variable(@registry)operator(.)ident(find_mapped_soap_class)operator(()constant(ActionWebService)operator(::)constant(Base64)operator(\)) - instance_variable(@type2binding)operator([)constant(ActionWebService)operator(::)constant(Base64)operator(]) operator(=) - constant(SoapBinding)operator(.)ident(new)operator(()pre_constant(self)operator(,) constant(SOAP)operator(::)constant(SOAPBase64)operator(::)constant(Type)operator(,) - constant(ActionWebService)operator(::)constant(Base64)operator(,) ident(mapping)operator(\)) - instance_variable(@registry)operator(.)ident(add)operator(()constant(Array)operator(,) - constant(SOAP)operator(::)constant(SOAPArray)operator(,) - constant(SoapTypedArrayFactory)operator(.)ident(new)operator(,) - pre_constant(nil)operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(SoapBinding) - ident(attr) symbol(:qname) - ident(attr) symbol(:type) - ident(attr) symbol(:mapping) - ident(attr) symbol(:element_binding) - - reserved(def) method(initialize)operator(()ident(marshaler)operator(,) ident(qname)operator(,) ident(type)operator(,) ident(mapping)operator(,) ident(element_binding)operator(=)pre_constant(nil)operator(\)) - instance_variable(@marshaler) operator(=) ident(marshaler) - instance_variable(@qname) operator(=) ident(qname) - instance_variable(@type) operator(=) ident(type) - instance_variable(@mapping) operator(=) ident(mapping) - instance_variable(@element_binding) operator(=) ident(element_binding) - reserved(end) - - reserved(def) method(type_name) - instance_variable(@type)operator(.)ident(custom?) operator(?) instance_variable(@qname)operator(.)ident(name) operator(:) pre_constant(nil) - reserved(end) - - reserved(def) method(qualified_type_name)operator(()ident(ns)operator(=)pre_constant(nil)operator(\)) - reserved(if) instance_variable(@type)operator(.)ident(custom?) - stringcontent(:)inlinedelimiter(")> - reserved(else) - ident(ns) operator(=) constant(XSD)operator(::)constant(NS)operator(.)ident(new) - ident(ns)operator(.)ident(assign)operator(()constant(XSD)operator(::)constant(Namespace)operator(,) constant(SOAP)operator(::)constant(XSDNamespaceTag)operator(\)) - ident(ns)operator(.)ident(assign)operator(()constant(SOAP)operator(::)constant(EncodingNamespace)operator(,) stringoperator(\)) - ident(xsd_klass) operator(=) ident(mapping)operator([)integer(0)operator(])operator(.)ident(ancestors)operator(.)ident(find)operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(const_defined?)operator(()stringoperator(\))operator(}) - reserved(return) ident(ns)operator(.)ident(name)operator(()constant(XSD)operator(::)constant(AnyTypeName)operator(\)) reserved(unless) ident(xsd_klass) - ident(ns)operator(.)ident(name)operator(()ident(xsd_klass)operator(.)ident(const_get)operator(()stringoperator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(eql?)operator(()ident(other)operator(\)) - instance_variable(@qname) operator(==) ident(other)operator(.)ident(qname) - reserved(end) - reserved(alias) symbol(:==) symbol(:eql?) - - reserved(def) method(hash) - instance_variable(@qname)operator(.)ident(hash) - reserved(end) - reserved(end) - - reserved(class) class(SoapActiveRecordStructFactory) operator(<) constant(SOAP)operator(::)constant(Mapping)operator(::)constant(Factory) - reserved(def) method(obj2soap)operator(()ident(soap_class)operator(,) ident(obj)operator(,) ident(info)operator(,) ident(map)operator(\)) - reserved(unless) ident(obj)operator(.)ident(is_a?)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(\)) - reserved(return) pre_constant(nil) - reserved(end) - ident(soap_obj) operator(=) ident(soap_class)operator(.)ident(new)operator(()ident(obj)operator(.)ident(class)operator(.)ident(instance_variable_get)operator(()stringoperator(\))operator(\)) - ident(obj)operator(.)ident(class)operator(.)ident(columns)operator(.)ident(each) reserved(do) operator(|)ident(column)operator(|) - ident(key) operator(=) ident(column)operator(.)ident(name)operator(.)ident(to_s) - ident(value) operator(=) ident(obj)operator(.)ident(send)operator(()ident(key)operator(\)) - ident(soap_obj)operator([)ident(key)operator(]) operator(=) constant(SOAP)operator(::)constant(Mapping)operator(.)ident(_obj2soap)operator(()ident(value)operator(,) ident(map)operator(\)) - reserved(end) - ident(soap_obj) - reserved(end) - - reserved(def) method(soap2obj)operator(()ident(obj_class)operator(,) ident(node)operator(,) ident(info)operator(,) ident(map)operator(\)) - reserved(unless) ident(node)operator(.)ident(type) operator(==) ident(obj_class)operator(.)ident(instance_variable_get)operator(()stringoperator(\)) - reserved(return) pre_constant(false) - reserved(end) - ident(obj) operator(=) ident(obj_class)operator(.)ident(new) - ident(node)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - ident(obj)operator([)ident(key)operator(]) operator(=) ident(value)operator(.)ident(data) - reserved(end) - ident(obj)operator(.)ident(instance_variable_set)operator(()stringoperator(,) pre_constant(false)operator(\)) - reserved(return) pre_constant(true)operator(,) ident(obj) - reserved(end) - reserved(end) - - reserved(class) class(SoapTypedArrayFactory) operator(<) constant(SOAP)operator(::)constant(Mapping)operator(::)constant(Factory) - reserved(def) method(obj2soap)operator(()ident(soap_class)operator(,) ident(obj)operator(,) ident(info)operator(,) ident(map)operator(\)) - reserved(unless) ident(obj)operator(.)ident(respond_to?)operator(()symbol(:arytype)operator(\)) - reserved(return) pre_constant(nil) - reserved(end) - ident(soap_obj) operator(=) ident(soap_class)operator(.)ident(new)operator(()constant(SOAP)operator(::)constant(ValueArrayName)operator(,) integer(1)operator(,) ident(obj)operator(.)ident(arytype)operator(\)) - ident(mark_marshalled_obj)operator(()ident(obj)operator(,) ident(soap_obj)operator(\)) - ident(obj)operator(.)ident(each) reserved(do) operator(|)ident(item)operator(|) - ident(child) operator(=) constant(SOAP)operator(::)constant(Mapping)operator(.)ident(_obj2soap)operator(()ident(item)operator(,) ident(map)operator(\)) - ident(soap_obj)operator(.)ident(add)operator(()ident(child)operator(\)) - reserved(end) - ident(soap_obj) - reserved(end) - - reserved(def) method(soap2obj)operator(()ident(obj_class)operator(,) ident(node)operator(,) ident(info)operator(,) ident(map)operator(\)) - reserved(return) pre_constant(false) - reserved(end) - reserved(end) - - reserved(class) class(SoapBase64Factory) operator(<) constant(SOAP)operator(::)constant(Mapping)operator(::)constant(Factory) - reserved(def) method(obj2soap)operator(()ident(soap_class)operator(,) ident(obj)operator(,) ident(info)operator(,) ident(map)operator(\)) - reserved(unless) ident(obj)operator(.)ident(is_a?)operator(()constant(ActionWebService)operator(::)constant(Base64)operator(\)) - reserved(return) pre_constant(nil) - reserved(end) - reserved(return) ident(soap_class)operator(.)ident(new)operator(()ident(obj)operator(\)) - reserved(end) - - reserved(def) method(soap2obj)operator(()ident(obj_class)operator(,) ident(node)operator(,) ident(info)operator(,) ident(map)operator(\)) - reserved(unless) ident(node)operator(.)ident(type) operator(==) constant(SOAP)operator(::)constant(SOAPBase64)operator(::)constant(Type) - reserved(return) pre_constant(false) - reserved(end) - reserved(return) pre_constant(true)operator(,) ident(obj_class)operator(.)ident(new)operator(()ident(node)operator(.)ident(string)operator(\)) - reserved(end) - reserved(end) - - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(API) comment(# :nodoc:) - reserved(class) class(Base) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(soap_client)operator(()ident(endpoint_uri)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - constant(ActionWebService)operator(::)constant(Client)operator(::)constant(Soap)operator(.)ident(new) pre_constant(self)operator(,) ident(endpoint_uri)operator(,) ident(options) - reserved(end) - reserved(end) - reserved(end) - - reserved(module) class(Protocol) comment(# :nodoc:) - reserved(module) class(Soap) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(register_protocol)operator(()constant(SoapProtocol)operator(\)) - ident(base)operator(.)ident(class_inheritable_option)operator(()symbol(:wsdl_service_name)operator(\)) - ident(base)operator(.)ident(class_inheritable_option)operator(()symbol(:wsdl_namespace)operator(\)) - reserved(end) - - reserved(class) class(SoapProtocol) operator(<) constant(AbstractProtocol) comment(# :nodoc:) - constant(AWSEncoding) operator(=) string - constant(XSDEncoding) operator(=) string - - ident(attr) symbol(:marshaler) - - reserved(def) method(initialize)operator(()ident(namespace)operator(=)pre_constant(nil)operator(\)) - ident(namespace) operator(||=) string - instance_variable(@marshaler) operator(=) constant(SoapMarshaler)operator(.)ident(new) ident(namespace) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(create)operator(()ident(controller)operator(\)) - constant(SoapProtocol)operator(.)ident(new)operator(()ident(controller)operator(.)ident(wsdl_namespace)operator(\)) - reserved(end) - - reserved(def) method(decode_action_pack_request)operator(()ident(action_pack_request)operator(\)) - reserved(return) pre_constant(nil) reserved(unless) ident(soap_action) operator(=) ident(has_valid_soap_action?)operator(()ident(action_pack_request)operator(\)) - ident(service_name) operator(=) ident(action_pack_request)operator(.)ident(parameters)operator([)stringoperator(]) - ident(input_encoding) operator(=) ident(parse_charset)operator(()ident(action_pack_request)operator(.)ident(env)operator([)stringoperator(])operator(\)) - ident(protocol_options) operator(=) operator({) - symbol(:soap_action) operator(=)operator(>) ident(soap_action)operator(,) - symbol(:charset) operator(=)operator(>) ident(input_encoding) - operator(}) - ident(decode_request)operator(()ident(action_pack_request)operator(.)ident(raw_post)operator(,) ident(service_name)operator(,) ident(protocol_options)operator(\)) - reserved(end) - - reserved(def) method(encode_action_pack_request)operator(()ident(service_name)operator(,) ident(public_method_name)operator(,) ident(raw_body)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - ident(request) operator(=) reserved(super) - ident(request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string operator(%) operator([)ident(service_name)operator(,) ident(public_method_name)operator(]) - ident(request) - reserved(end) - - reserved(def) method(decode_request)operator(()ident(raw_request)operator(,) ident(service_name)operator(,) ident(protocol_options)operator(=)operator({)operator(})operator(\)) - ident(envelope) operator(=) constant(SOAP)operator(::)constant(Processor)operator(.)ident(unmarshal)operator(()ident(raw_request)operator(,) symbol(:charset) operator(=)operator(>) ident(protocol_options)operator([)symbol(:charset)operator(])operator(\)) - reserved(unless) ident(envelope) - ident(raise) constant(ProtocolError)operator(,) string - reserved(end) - ident(request) operator(=) ident(envelope)operator(.)ident(body)operator(.)ident(request) - ident(method_name) operator(=) ident(request)operator(.)ident(elename)operator(.)ident(name) - ident(params) operator(=) ident(request)operator(.)ident(collect)operator({) operator(|)ident(k)operator(,) ident(v)operator(|) ident(marshaler)operator(.)ident(soap_to_ruby)operator(()ident(request)operator([)ident(k)operator(])operator(\)) operator(}) - constant(Request)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(method_name)operator(,) ident(params)operator(,) ident(service_name)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) ident(protocol_options)operator(\)) - reserved(end) - - reserved(def) method(encode_request)operator(()ident(method_name)operator(,) ident(params)operator(,) ident(param_types)operator(\)) - ident(param_types)operator(.)ident(each)operator({) operator(|)ident(type)operator(|) ident(marshaler)operator(.)ident(register_type)operator(()ident(type)operator(\)) operator(}) reserved(if) ident(param_types) - ident(qname) operator(=) constant(XSD)operator(::)constant(QName)operator(.)ident(new)operator(()ident(marshaler)operator(.)ident(namespace)operator(,) ident(method_name)operator(\)) - ident(param_def) operator(=) operator([)operator(]) - reserved(if) ident(param_types) - ident(params) operator(=) ident(param_types)operator(.)ident(zip)operator(()ident(params)operator(\))operator(.)ident(map) reserved(do) operator(|)ident(type)operator(,) ident(param)operator(|) - ident(param_def) operator(<<) operator([)stringoperator(,) ident(type)operator(.)ident(name)operator(,) ident(marshaler)operator(.)ident(lookup_type)operator(()ident(type)operator(\))operator(.)ident(mapping)operator(]) - operator([)ident(type)operator(.)ident(name)operator(,) ident(marshaler)operator(.)ident(ruby_to_soap)operator(()ident(param)operator(\))operator(]) - reserved(end) - reserved(else) - ident(params) operator(=) operator([)operator(]) - reserved(end) - ident(request) operator(=) constant(SOAP)operator(::)constant(RPC)operator(::)constant(SOAPMethodRequest)operator(.)ident(new)operator(()ident(qname)operator(,) ident(param_def)operator(\)) - ident(request)operator(.)ident(set_param)operator(()ident(params)operator(\)) - ident(envelope) operator(=) ident(create_soap_envelope)operator(()ident(request)operator(\)) - constant(SOAP)operator(::)constant(Processor)operator(.)ident(marshal)operator(()ident(envelope)operator(\)) - reserved(end) - - reserved(def) method(decode_response)operator(()ident(raw_response)operator(\)) - ident(envelope) operator(=) constant(SOAP)operator(::)constant(Processor)operator(.)ident(unmarshal)operator(()ident(raw_response)operator(\)) - reserved(unless) ident(envelope) - ident(raise) constant(ProtocolError)operator(,) string - reserved(end) - ident(method_name) operator(=) ident(envelope)operator(.)ident(body)operator(.)ident(request)operator(.)ident(elename)operator(.)ident(name) - ident(return_value) operator(=) ident(envelope)operator(.)ident(body)operator(.)ident(response) - ident(return_value) operator(=) ident(marshaler)operator(.)ident(soap_to_ruby)operator(()ident(return_value)operator(\)) reserved(unless) ident(return_value)operator(.)ident(nil?) - operator([)ident(method_name)operator(,) ident(return_value)operator(]) - reserved(end) - - reserved(def) method(encode_response)operator(()ident(method_name)operator(,) ident(return_value)operator(,) ident(return_type)operator(,) ident(protocol_options)operator(=)operator({)operator(})operator(\)) - reserved(if) ident(return_type) - ident(return_binding) operator(=) ident(marshaler)operator(.)ident(register_type)operator(()ident(return_type)operator(\)) - ident(marshaler)operator(.)ident(annotate_arrays)operator(()ident(return_binding)operator(,) ident(return_value)operator(\)) - reserved(end) - ident(qname) operator(=) constant(XSD)operator(::)constant(QName)operator(.)ident(new)operator(()ident(marshaler)operator(.)ident(namespace)operator(,) ident(method_name)operator(\)) - reserved(if) ident(return_value)operator(.)ident(nil?) - ident(response) operator(=) constant(SOAP)operator(::)constant(RPC)operator(::)constant(SOAPMethodResponse)operator(.)ident(new)operator(()ident(qname)operator(,) pre_constant(nil)operator(\)) - reserved(else) - reserved(if) ident(return_value)operator(.)ident(is_a?)operator(()constant(Exception)operator(\)) - ident(detail) operator(=) constant(SOAP)operator(::)constant(Mapping)operator(::)constant(SOAPException)operator(.)ident(new)operator(()ident(return_value)operator(\)) - ident(response) operator(=) constant(SOAP)operator(::)constant(SOAPFault)operator(.)ident(new)operator(() - constant(SOAP)operator(::)constant(SOAPQName)operator(.)ident(new)operator(()string operator(%) operator([)constant(SOAP)operator(::)constant(SOAPNamespaceTag)operator(,) stringoperator(])operator(\))operator(,) - constant(SOAP)operator(::)constant(SOAPString)operator(.)ident(new)operator(()ident(return_value)operator(.)ident(to_s)operator(\))operator(,) - constant(SOAP)operator(::)constant(SOAPString)operator(.)ident(new)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(name)operator(\))operator(,) - ident(marshaler)operator(.)ident(ruby_to_soap)operator(()ident(detail)operator(\))operator(\)) - reserved(else) - reserved(if) ident(return_type) - ident(param_def) operator(=) operator([)operator([)stringoperator(,) stringoperator(,) ident(marshaler)operator(.)ident(lookup_type)operator(()ident(return_type)operator(\))operator(.)ident(mapping)operator(])operator(]) - ident(response) operator(=) constant(SOAP)operator(::)constant(RPC)operator(::)constant(SOAPMethodResponse)operator(.)ident(new)operator(()ident(qname)operator(,) ident(param_def)operator(\)) - ident(response)operator(.)ident(retval) operator(=) ident(marshaler)operator(.)ident(ruby_to_soap)operator(()ident(return_value)operator(\)) - reserved(else) - ident(response) operator(=) constant(SOAP)operator(::)constant(RPC)operator(::)constant(SOAPMethodResponse)operator(.)ident(new)operator(()ident(qname)operator(,) pre_constant(nil)operator(\)) - reserved(end) - reserved(end) - reserved(end) - ident(envelope) operator(=) ident(create_soap_envelope)operator(()ident(response)operator(\)) - - comment(# FIXME: This is not thread-safe, but StringFactory_ in SOAP4R only) - comment(# reads target encoding from the XSD::Charset.encoding variable.) - comment(# This is required to ensure $KCODE strings are converted) - comment(# correctly to UTF-8 for any values of $KCODE.) - ident(previous_encoding) operator(=) constant(XSD)operator(::)constant(Charset)operator(.)ident(encoding) - constant(XSD)operator(::)constant(Charset)operator(.)ident(encoding) operator(=) constant(XSDEncoding) - ident(response_body) operator(=) constant(SOAP)operator(::)constant(Processor)operator(.)ident(marshal)operator(()ident(envelope)operator(,) symbol(:charset) operator(=)operator(>) constant(AWSEncoding)operator(\)) - constant(XSD)operator(::)constant(Charset)operator(.)ident(encoding) operator(=) ident(previous_encoding) - - constant(Response)operator(.)ident(new)operator(()ident(response_body)operator(,) stringdelimiter(")>operator(,) ident(return_value)operator(\)) - reserved(end) - - reserved(def) method(protocol_client)operator(()ident(api)operator(,) ident(protocol_name)operator(,) ident(endpoint_uri)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - reserved(return) pre_constant(nil) reserved(unless) ident(protocol_name) operator(==) symbol(:soap) - constant(ActionWebService)operator(::)constant(Client)operator(::)constant(Soap)operator(.)ident(new)operator(()ident(api)operator(,) ident(endpoint_uri)operator(,) ident(options)operator(\)) - reserved(end) - - reserved(def) method(register_api)operator(()ident(api)operator(\)) - ident(api)operator(.)ident(api_methods)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(method)operator(|) - ident(method)operator(.)ident(expects)operator(.)ident(each)operator({) operator(|)ident(type)operator(|) ident(marshaler)operator(.)ident(register_type)operator(()ident(type)operator(\)) operator(}) reserved(if) ident(method)operator(.)ident(expects) - ident(method)operator(.)ident(returns)operator(.)ident(each)operator({) operator(|)ident(type)operator(|) ident(marshaler)operator(.)ident(register_type)operator(()ident(type)operator(\)) operator(}) reserved(if) ident(method)operator(.)ident(returns) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(has_valid_soap_action?)operator(()ident(request)operator(\)) - reserved(return) pre_constant(nil) reserved(unless) ident(request)operator(.)ident(method) operator(==) symbol(:post) - ident(soap_action) operator(=) ident(request)operator(.)ident(env)operator([)stringoperator(]) - reserved(return) pre_constant(nil) reserved(unless) ident(soap_action) - ident(soap_action) operator(=) ident(soap_action)operator(.)ident(dup) - ident(soap_action)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - ident(soap_action)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - ident(soap_action)operator(.)ident(strip!) - reserved(return) pre_constant(nil) reserved(if) ident(soap_action)operator(.)ident(empty?) - ident(soap_action) - reserved(end) - - reserved(def) method(create_soap_envelope)operator(()ident(body)operator(\)) - ident(header) operator(=) constant(SOAP)operator(::)constant(SOAPHeader)operator(.)ident(new) - ident(body) operator(=) constant(SOAP)operator(::)constant(SOAPBody)operator(.)ident(new)operator(()ident(body)operator(\)) - constant(SOAP)operator(::)constant(SOAPEnvelope)operator(.)ident(new)operator(()ident(header)operator(,) ident(body)operator(\)) - reserved(end) - - reserved(def) method(parse_charset)operator(()ident(content_type)operator(\)) - reserved(return) constant(AWSEncoding) reserved(if) ident(content_type)operator(.)ident(nil?) - reserved(if) regexp operator(=)operator(~) ident(content_type) - global_variable($1) - reserved(else) - constant(AWSEncoding) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string - -reserved(module) class(XMLRPC) comment(# :nodoc:) - reserved(class) class(FaultException) comment(# :nodoc:) - reserved(alias) symbol(:message) symbol(:faultString) - reserved(end) -reserved(end) - -reserved(module) class(ActionWebService) comment(# :nodoc:) - reserved(module) class(API) comment(# :nodoc: ) - reserved(class) class(Base) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(xmlrpc_client)operator(()ident(endpoint_uri)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - constant(ActionWebService)operator(::)constant(Client)operator(::)constant(XmlRpc)operator(.)ident(new) pre_constant(self)operator(,) ident(endpoint_uri)operator(,) ident(options) - reserved(end) - reserved(end) - reserved(end) - - reserved(module) class(Protocol) comment(# :nodoc:) - reserved(module) class(XmlRpc) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(register_protocol)operator(()constant(XmlRpcProtocol)operator(\)) - reserved(end) - - reserved(class) class(XmlRpcProtocol) operator(<) constant(AbstractProtocol) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(create)operator(()ident(controller)operator(\)) - constant(XmlRpcProtocol)operator(.)ident(new) - reserved(end) - - reserved(def) method(decode_action_pack_request)operator(()ident(action_pack_request)operator(\)) - ident(service_name) operator(=) ident(action_pack_request)operator(.)ident(parameters)operator([)stringoperator(]) - ident(decode_request)operator(()ident(action_pack_request)operator(.)ident(raw_post)operator(,) ident(service_name)operator(\)) - reserved(end) - - reserved(def) method(decode_request)operator(()ident(raw_request)operator(,) ident(service_name)operator(\)) - ident(method_name)operator(,) ident(params) operator(=) constant(XMLRPC)operator(::)constant(Marshal)operator(.)ident(load_call)operator(()ident(raw_request)operator(\)) - constant(Request)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(method_name)operator(,) ident(params)operator(,) ident(service_name)operator(\)) - reserved(end) - - reserved(def) method(encode_request)operator(()ident(method_name)operator(,) ident(params)operator(,) ident(param_types)operator(\)) - reserved(if) ident(param_types) - ident(params) operator(=) ident(params)operator(.)ident(dup) - ident(param_types)operator(.)ident(each_with_index)operator({) operator(|)ident(type)operator(,) ident(i)operator(|) ident(params)operator([)ident(i)operator(]) operator(=) ident(value_to_xmlrpc_wire_format)operator(()ident(params)operator([)ident(i)operator(])operator(,) ident(type)operator(\)) operator(}) - reserved(end) - constant(XMLRPC)operator(::)constant(Marshal)operator(.)ident(dump_call)operator(()ident(method_name)operator(,) operator(*)ident(params)operator(\)) - reserved(end) - - reserved(def) method(decode_response)operator(()ident(raw_response)operator(\)) - operator([)pre_constant(nil)operator(,) constant(XMLRPC)operator(::)constant(Marshal)operator(.)ident(load_response)operator(()ident(raw_response)operator(\))operator(]) - reserved(end) - - reserved(def) method(encode_response)operator(()ident(method_name)operator(,) ident(return_value)operator(,) ident(return_type)operator(,) ident(protocol_options)operator(=)operator({)operator(})operator(\)) - reserved(if) ident(return_value) operator(&&) ident(return_type) - ident(return_value) operator(=) ident(value_to_xmlrpc_wire_format)operator(()ident(return_value)operator(,) ident(return_type)operator(\)) - reserved(end) - ident(return_value) operator(=) pre_constant(false) reserved(if) ident(return_value)operator(.)ident(nil?) - ident(raw_response) operator(=) constant(XMLRPC)operator(::)constant(Marshal)operator(.)ident(dump_response)operator(()ident(return_value)operator(\)) - constant(Response)operator(.)ident(new)operator(()ident(raw_response)operator(,) stringoperator(,) ident(return_value)operator(\)) - reserved(end) - - reserved(def) method(protocol_client)operator(()ident(api)operator(,) ident(protocol_name)operator(,) ident(endpoint_uri)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) - reserved(return) pre_constant(nil) reserved(unless) ident(protocol_name) operator(==) symbol(:xmlrpc) - constant(ActionWebService)operator(::)constant(Client)operator(::)constant(XmlRpc)operator(.)ident(new)operator(()ident(api)operator(,) ident(endpoint_uri)operator(,) ident(options)operator(\)) - reserved(end) - - reserved(def) method(value_to_xmlrpc_wire_format)operator(()ident(value)operator(,) ident(value_type)operator(\)) - reserved(if) ident(value_type)operator(.)ident(array?) - ident(value)operator(.)ident(map)operator({) operator(|)ident(val)operator(|) ident(value_to_xmlrpc_wire_format)operator(()ident(val)operator(,) ident(value_type)operator(.)ident(element_type)operator(\)) operator(}) - reserved(else) - reserved(if) ident(value)operator(.)ident(is_a?)operator(()constant(ActionWebService)operator(::)constant(Struct)operator(\)) - ident(struct) operator(=) operator({)operator(}) - ident(value)operator(.)ident(class)operator(.)ident(members)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(type)operator(|) - ident(member_value) operator(=) ident(value)operator([)ident(name)operator(]) - reserved(next) reserved(if) ident(member_value)operator(.)ident(nil?) - ident(struct)operator([)ident(name)operator(.)ident(to_s)operator(]) operator(=) ident(value_to_xmlrpc_wire_format)operator(()ident(member_value)operator(,) ident(type)operator(\)) - reserved(end) - ident(struct) - reserved(elsif) ident(value)operator(.)ident(is_a?)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(\)) - ident(struct) operator(=) operator({)operator(}) - ident(value)operator(.)ident(attributes)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(member_value)operator(|) - reserved(next) reserved(if) ident(member_value)operator(.)ident(nil?) - ident(struct)operator([)ident(key)operator(.)ident(to_s)operator(]) operator(=) ident(member_value) - reserved(end) - ident(struct) - reserved(elsif) ident(value)operator(.)ident(is_a?)operator(()constant(ActionWebService)operator(::)constant(Base64)operator(\)) - constant(XMLRPC)operator(::)constant(Base64)operator(.)ident(new)operator(()ident(value)operator(\)) - reserved(elsif) ident(value)operator(.)ident(is_a?)operator(()constant(Exception)operator(\)) operator(&&) operator(!)ident(value)operator(.)ident(is_a?)operator(()constant(XMLRPC)operator(::)constant(FaultException)operator(\)) - constant(XMLRPC)operator(::)constant(FaultException)operator(.)ident(new)operator(()integer(2)operator(,) ident(value)operator(.)ident(message)operator(\)) - reserved(else) - ident(value) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActionWebService) - reserved(module) class(Scaffolding) comment(# :nodoc:) - reserved(class) class(ScaffoldingError) operator(<) constant(ActionWebServiceError) comment(# :nodoc:) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - comment(# Web service invocation scaffolding provides a way to quickly invoke web service methods in a controller. The) - comment(# generated scaffold actions have default views to let you enter the method parameters and view the) - comment(# results.) - comment(#) - comment(# Example:) - comment(#) - comment(# class ApiController < ActionController) - comment(# web_service_scaffold :invoke) - comment(# end) - comment(#) - comment(# This example generates an +invoke+ action in the +ApiController+ that you can navigate to from) - comment(# your browser, select the API method, enter its parameters, and perform the invocation.) - comment(#) - comment(# If you want to customize the default views, create the following views in "app/views":) - comment(#) - comment(# * action_name/methods.rhtml) - comment(# * action_name/parameters.rhtml) - comment(# * action_name/result.rhtml) - comment(# * action_name/layout.rhtml) - comment(#) - comment(# Where action_name is the name of the action you gave to ClassMethods#web_service_scaffold.) - comment(#) - comment(# You can use the default views in RAILS_DIR/lib/action_web_service/templates/scaffolds as) - comment(# a guide.) - reserved(module) class(ClassMethods) - comment(# Generates web service invocation scaffolding for the current controller. The given action name) - comment(# can then be used as the entry point for invoking API methods from a web browser.) - reserved(def) method(web_service_scaffold)operator(()ident(action_name)operator(\)) - ident(add_template_helper)operator(()constant(Helpers)operator(\)) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent( - if request.method == :get - setup_invocation_assigns - render_invocation_scaffold 'methods' - end - end - - def )inlinecontent(_method_params - if request.method == :get - setup_invocation_assigns - render_invocation_scaffold 'parameters' - end - end - - def )inlinecontent(_submit - if request.method == :post - setup_invocation_assigns - protocol_name = params['protocol'] ? params['protocol'].to_sym : :soap - case protocol_name - when :soap - @protocol = Protocol::Soap::SoapProtocol.create(self\) - when :xmlrpc - @protocol = Protocol::XmlRpc::XmlRpcProtocol.create(self\) - end - bm = Benchmark.measure do - @protocol.register_api(@scaffold_service.api\) - post_params = params['method_params'] ? params['method_params'].dup : nil - params = [] - @scaffold_method.expects.each_with_index do |spec, i| - params << post_params[i.to_s] - end if @scaffold_method.expects - params = @scaffold_method.cast_expects(params\) - method_name = public_method_name(@scaffold_service.name, @scaffold_method.public_name\) - @method_request_xml = @protocol.encode_request(method_name, params, @scaffold_method.expects\) - new_request = @protocol.encode_action_pack_request(@scaffold_service.name, @scaffold_method.public_name, @method_request_xml\) - prepare_request(new_request, @scaffold_service.name, @scaffold_method.public_name\) - @request = new_request - if @scaffold_container.dispatching_mode != :direct - request.parameters['action'] = @scaffold_service.name - end - dispatch_web_service_request - @method_response_xml = @response.body - method_name, obj = @protocol.decode_response(@method_response_xml\) - return if handle_invocation_exception(obj\) - @method_return_value = @scaffold_method.cast_returns(obj\) - end - @method_elapsed = bm.real - add_instance_variables_to_assigns - reset_invocation_response - render_invocation_scaffold 'result' - end - end - - private - def setup_invocation_assigns - @scaffold_class = self.class - @scaffold_action_name = ")inlinecontent(" - @scaffold_container = WebServiceModel::Container.new(self\) - if params['service'] && params['method'] - @scaffold_service = @scaffold_container.services.find{ |x| x.name == params['service'] } - @scaffold_method = @scaffold_service.api_methods[params['method']] - end - add_instance_variables_to_assigns - end - - def render_invocation_scaffold(action\) - customized_template = ")char(\\#)content({self.class.controller_path}/)inlinecontent(/)char(\\#)content({action}" - default_template = scaffold_path(action\) - if template_exists?(customized_template\) - content = @template.render_file(customized_template\) - else - content = @template.render_file(default_template, false\) - end - @template.instance_variable_set("@content_for_layout", content\) - if self.active_layout.nil? - render_file(scaffold_path("layout"\)\) - else - render_file(self.active_layout, "200 OK", true\) - end - end - - def scaffold_path(template_name\) - File.dirname(__FILE__\) + "/templates/scaffolds/" + template_name + ".rhtml" - end - - def reset_invocation_response - erase_render_results - @response.headers = ::ActionController::AbstractResponse::DEFAULT_HEADERS.merge("cookie" => []\) - end - - def public_method_name(service_name, method_name\) - if web_service_dispatching_mode == :layered && @protocol.is_a?(ActionWebService::Protocol::XmlRpc::XmlRpcProtocol\) - service_name + '.' + method_name - else - method_name - end - end - - def prepare_request(new_request, service_name, method_name\) - new_request.parameters.update(request.parameters\) - request.env.each{ |k, v| new_request.env[k] = v unless new_request.env.has_key?(k\) } - if web_service_dispatching_mode == :layered && @protocol.is_a?(ActionWebService::Protocol::Soap::SoapProtocol\) - new_request.env['HTTP_SOAPACTION'] = "/)char(\\#)content({controller_name(\)}/)char(\\#)content({service_name}/)char(\\#)content({method_name}" - end - end - - def handle_invocation_exception(obj\) - exception = nil - if obj.respond_to?(:detail\) && obj.detail.respond_to?(:cause\) && obj.detail.cause.is_a?(Exception\) - exception = obj.detail.cause - elsif obj.is_a?(XMLRPC::FaultException\) - exception = obj - end - return unless exception - reset_invocation_response - rescue_action(exception\) - true - end)delimiter( - end_eval)> - reserved(end) - reserved(end) - - reserved(module) class(Helpers) comment(# :nodoc:) - reserved(def) method(method_parameter_input_fields)operator(()ident(method)operator(,) ident(type)operator(,) ident(field_name_base)operator(,) ident(idx)operator(,) ident(was_structured)operator(=)pre_constant(false)operator(\)) - reserved(if) ident(type)operator(.)ident(array?) - reserved(return) ident(content_tag)operator(()stringoperator(,) stringcontent(\))delimiter(")>operator(\)) - reserved(end) - reserved(if) ident(type)operator(.)ident(structured?) - reserved(return) ident(content_tag)operator(()stringoperator(,) stringcontent(\))delimiter(")>operator(\)) reserved(if) ident(was_structured) - ident(parameters) operator(=) string - ident(type)operator(.)ident(each_member) reserved(do) operator(|)ident(member_name)operator(,) ident(member_type)operator(|) - ident(label) operator(=) ident(method_parameter_label)operator(()ident(member_name)operator(,) ident(member_type)operator(\)) - ident(nested_content) operator(=) ident(method_parameter_input_fields)operator(() - ident(method)operator(,) - ident(member_type)operator(,) - stringcontent([)inlinecontent(][)inlinecontent(])delimiter(")>operator(,) - ident(idx)operator(,) - pre_constant(true)operator(\)) - reserved(if) ident(member_type)operator(.)ident(custom?) - ident(parameters) operator(<<) ident(content_tag)operator(()stringoperator(,) ident(label)operator(\)) - ident(parameters) operator(<<) ident(content_tag)operator(()stringoperator(,) ident(nested_content)operator(\)) - reserved(else) - ident(parameters) operator(<<) ident(content_tag)operator(()stringoperator(,) ident(label) operator(+) string operator(+) ident(nested_content)operator(\)) - reserved(end) - reserved(end) - ident(content_tag)operator(()stringoperator(,) ident(parameters)operator(\)) - reserved(else) - comment(# If the data source was structured previously we already have the index set ) - ident(field_name_base) operator(=) stringcontent([)inlinecontent(])delimiter(")> reserved(unless) ident(was_structured) - - reserved(case) ident(type)operator(.)ident(type) - reserved(when) symbol(:int) - ident(text_field_tag) stringdelimiter(")> - reserved(when) symbol(:string) - ident(text_field_tag) stringdelimiter(")> - reserved(when) symbol(:base64) - ident(text_area_tag) stringdelimiter(")>operator(,) pre_constant(nil)operator(,) symbol(:size) operator(=)operator(>) string - reserved(when) symbol(:bool) - ident(radio_button_tag)operator(()stringdelimiter(")>operator(,) stringoperator(\)) operator(+) string operator(+) - ident(radio_button_tag)operator(()stringdelimiter(")>operator(,) stringoperator(\)) operator(+) string - reserved(when) symbol(:float) - ident(text_field_tag) stringdelimiter(")> - reserved(when) symbol(:time)operator(,) symbol(:datetime) - ident(time) operator(=) constant(Time)operator(.)ident(now) - ident(i) operator(=) integer(0) - stringoperator(.)ident(map) reserved(do) operator(|)ident(name)operator(|) - ident(i) operator(+=) integer(1) - ident(send)operator(()stringdelimiter(")>operator(,) ident(time)operator(,) symbol(:prefix) operator(=)operator(>) stringcontent([)inlinecontent(])delimiter(")>operator(,) symbol(:discard_type) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end)operator(.)ident(join) - reserved(when) symbol(:date) - ident(date) operator(=) constant(Date)operator(.)ident(today) - ident(i) operator(=) integer(0) - stringoperator(.)ident(map) reserved(do) operator(|)ident(name)operator(|) - ident(i) operator(+=) integer(1) - ident(send)operator(()stringdelimiter(")>operator(,) ident(date)operator(,) symbol(:prefix) operator(=)operator(>) stringcontent([)inlinecontent(])delimiter(")>operator(,) symbol(:discard_type) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end)operator(.)ident(join) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(method_parameter_label)operator(()ident(name)operator(,) ident(type)operator(\)) - ident(name)operator(.)ident(to_s)operator(.)ident(capitalize) operator(+) string operator(+) ident(type)operator(.)ident(human_name)operator(()pre_constant(false)operator(\)) operator(+) string - reserved(end) - - reserved(def) method(service_method_list)operator(()ident(service)operator(\)) - ident(action) operator(=) instance_variable(@scaffold_action_name) operator(+) string - ident(methods) operator(=) ident(service)operator(.)ident(api_methods_full)operator(.)ident(map) reserved(do) operator(|)ident(desc)operator(,) ident(name)operator(|) - ident(content_tag)operator(()stringoperator(,) ident(link_to)operator(()ident(desc)operator(,) symbol(:action) operator(=)operator(>) ident(action)operator(,) symbol(:service) operator(=)operator(>) ident(service)operator(.)ident(name)operator(,) symbol(:method) operator(=)operator(>) ident(name)operator(\))operator(\)) - reserved(end) - ident(content_tag)operator(()stringoperator(,) ident(methods)operator(.)ident(join)operator(()stringoperator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(module) class(WebServiceModel) comment(# :nodoc:) - reserved(class) class(Container) comment(# :nodoc:) - ident(attr) symbol(:services) - ident(attr) symbol(:dispatching_mode) - - reserved(def) method(initialize)operator(()ident(real_container)operator(\)) - instance_variable(@real_container) operator(=) ident(real_container) - instance_variable(@dispatching_mode) operator(=) instance_variable(@real_container)operator(.)ident(class)operator(.)ident(web_service_dispatching_mode) - instance_variable(@services) operator(=) operator([)operator(]) - reserved(if) instance_variable(@dispatching_mode) operator(==) symbol(:direct) - instance_variable(@services) operator(<<) constant(Service)operator(.)ident(new)operator(()instance_variable(@real_container)operator(.)ident(controller_name)operator(,) instance_variable(@real_container)operator(\)) - reserved(else) - instance_variable(@real_container)operator(.)ident(class)operator(.)ident(web_services)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(obj)operator(|) - instance_variable(@services) operator(<<) constant(Service)operator(.)ident(new)operator(()ident(name)operator(,) instance_variable(@real_container)operator(.)ident(instance_eval)operator({) ident(web_service_object)operator(()ident(name)operator(\)) operator(})operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(Service) comment(# :nodoc:) - ident(attr) symbol(:name) - ident(attr) symbol(:object) - ident(attr) symbol(:api) - ident(attr) symbol(:api_methods) - ident(attr) symbol(:api_methods_full) - - reserved(def) method(initialize)operator(()ident(name)operator(,) ident(real_service)operator(\)) - instance_variable(@name) operator(=) ident(name)operator(.)ident(to_s) - instance_variable(@object) operator(=) ident(real_service) - instance_variable(@api) operator(=) instance_variable(@object)operator(.)ident(class)operator(.)ident(web_service_api) - reserved(if) instance_variable(@api)operator(.)ident(nil?) - ident(raise) constant(ScaffoldingError)operator(,) stringdelimiter(")> - reserved(end) - instance_variable(@api_methods) operator(=) operator({)operator(}) - instance_variable(@api_methods_full) operator(=) operator([)operator(]) - instance_variable(@api)operator(.)ident(api_methods)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(method)operator(|) - instance_variable(@api_methods)operator([)ident(method)operator(.)ident(public_name)operator(.)ident(to_s)operator(]) operator(=) ident(method) - instance_variable(@api_methods_full) operator(<<) operator([)ident(method)operator(.)ident(to_s)operator(,) ident(method)operator(.)ident(public_name)operator(.)ident(to_s)operator(]) - reserved(end) - reserved(end) - - reserved(def) method(to_s) - pre_constant(self)operator(.)ident(name)operator(.)ident(camelize) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionWebService) - comment(# To send structured types across the wire, derive from ActionWebService::Struct,) - comment(# and use +member+ to declare structure members.) - comment(#) - comment(# ActionWebService::Struct should be used in method signatures when you want to accept or return) - comment(# structured types that have no Active Record model class representations, or you don't) - comment(# want to expose your entire Active Record model to remote callers.) - comment(#) - comment(# === Example) - comment(#) - comment(# class Person < ActionWebService::Struct) - comment(# member :id, :int) - comment(# member :firstnames, [:string]) - comment(# member :lastname, :string) - comment(# member :email, :string) - comment(# end) - comment(# person = Person.new(:id => 5, :firstname => 'john', :lastname => 'doe'\)) - comment(#) - comment(# Active Record model classes are already implicitly supported in method) - comment(# signatures.) - reserved(class) class(Struct) - comment(# Action WebService Struct subclasses should be reloaded by the dispatcher in Rails) - comment(# when Dependencies.mechanism = :load.) - ident(include) constant(Reloadable)operator(::)constant(Subclasses) - - comment(# If a Hash is given as argument to an ActionWebService::Struct constructor,) - comment(# it can contain initial values for the structure member.) - reserved(def) method(initialize)operator(()ident(values)operator(=)operator({)operator(})operator(\)) - reserved(if) ident(values)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(values)operator(.)ident(map)operator({)operator(|)ident(k)operator(,)ident(v)operator(|) ident(__send__)operator(()string operator(%) ident(k)operator(.)ident(to_s)operator(,) ident(v)operator(\))operator(}) - reserved(end) - reserved(end) - - comment(# The member with the given name) - reserved(def) method([])operator(()ident(name)operator(\)) - ident(send)operator(()ident(name)operator(.)ident(to_s)operator(\)) - reserved(end) - - comment(# Iterates through each member) - reserved(def) method(each_pair)operator(()operator(&)ident(block)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(members)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(type)operator(|) - reserved(yield) ident(name)operator(,) pre_constant(self)operator(.)ident(__send__)operator(()ident(name)operator(\)) - reserved(end) - reserved(end) - - reserved(class) operator(<<) class(self) - comment(# Creates a structure member with the specified +name+ and +type+. Generates) - comment(# accessor methods for reading and writing the member value.) - reserved(def) method(member)operator(()ident(name)operator(,) ident(type)operator(\)) - ident(name) operator(=) ident(name)operator(.)ident(to_sym) - ident(type) operator(=) constant(ActionWebService)operator(::)constant(SignatureTypes)operator(.)ident(canonical_signature_entry)operator(()operator({) ident(name) operator(=)operator(>) ident(type) operator(})operator(,) integer(0)operator(\)) - ident(write_inheritable_hash)operator(()stringoperator(,) ident(name) operator(=)operator(>) ident(type)operator(\)) - ident(class_eval) stringstringcontent(; @)inlinecontent(; end - def )inlinecontent(=(value\); @)inlinecontent( = value; end)delimiter( - END)> - reserved(end) - - reserved(def) method(members) comment(# :nodoc:) - ident(read_inheritable_attribute)operator(()stringoperator(\)) operator(||) operator({)operator(}) - reserved(end) - - reserved(def) method(member_type)operator(()ident(name)operator(\)) comment(# :nodoc:) - ident(members)operator([)ident(name)operator(.)ident(to_sym)operator(]) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(class) class(Class) comment(# :nodoc:) - reserved(def) method(class_inheritable_option)operator(()ident(sym)operator(,) ident(default_value)operator(=)pre_constant(nil)operator(\)) - ident(write_inheritable_attribute) ident(sym)operator(,) ident(default_value) - ident(class_eval) stringstringcontent((value=nil\) - if !value.nil? - write_inheritable_attribute(:)inlinecontent(, value\) - else - read_inheritable_attribute(:)inlinecontent(\) - end - end - - def self.)inlinecontent(=(value\) - write_inheritable_attribute(:)inlinecontent(, value\) - end - - def )inlinecontent( - self.class.)inlinecontent( - end - - def )inlinecontent(=(value\) - self.class.)inlinecontent( = value - end)delimiter( - EOS)> - reserved(end) -reserved(end) -reserved(module) class(ActionWebService) comment(# :nodoc:) - comment(# Action Web Service supports the following base types in a signature:) - comment(#) - comment(# [:int] Represents an integer value, will be cast to an integer using Integer(value\)) - comment(# [:string] Represents a string value, will be cast to an string using the to_s method on an object) - comment(# [:base64] Represents a Base 64 value, will contain the binary bytes of a Base 64 value sent by the caller) - comment(# [:bool] Represents a boolean value, whatever is passed will be cast to boolean (true, '1', 'true', 'y', 'yes' are taken to represent true; false, '0', 'false', 'n', 'no' and nil represent false\)) - comment(# [:float] Represents a floating point value, will be cast to a float using Float(value\)) - comment(# [:time] Represents a timestamp, will be cast to a Time object) - comment(# [:datetime] Represents a timestamp, will be cast to a DateTime object) - comment(# [:date] Represents a date, will be cast to a Date object) - comment(#) - comment(# For structured types, you'll need to pass in the Class objects of) - comment(# ActionWebService::Struct and ActiveRecord::Base derivatives.) - reserved(module) class(SignatureTypes) - reserved(def) method(canonical_signature)operator(()ident(signature)operator(\)) comment(# :nodoc:) - reserved(return) pre_constant(nil) reserved(if) ident(signature)operator(.)ident(nil?) - reserved(unless) ident(signature)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - ident(raise)operator(()constant(ActionWebServiceError)operator(,) stringoperator(\)) - reserved(end) - ident(i) operator(=) integer(-1) - ident(signature)operator(.)ident(map)operator({) operator(|)ident(spec)operator(|) ident(canonical_signature_entry)operator(()ident(spec)operator(,) ident(i) operator(+=) integer(1)operator(\)) operator(}) - reserved(end) - - reserved(def) method(canonical_signature_entry)operator(()ident(spec)operator(,) ident(i)operator(\)) comment(# :nodoc:) - ident(orig_spec) operator(=) ident(spec) - ident(name) operator(=) stringdelimiter(")> - reserved(if) ident(spec)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(name)operator(,) ident(spec) operator(=) ident(spec)operator(.)ident(keys)operator(.)ident(first)operator(,) ident(spec)operator(.)ident(values)operator(.)ident(first) - reserved(end) - ident(type) operator(=) ident(spec) - reserved(if) ident(spec)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - constant(ArrayType)operator(.)ident(new)operator(()ident(orig_spec)operator(,) ident(canonical_signature_entry)operator(()ident(spec)operator([)integer(0)operator(])operator(,) integer(0)operator(\))operator(,) ident(name)operator(\)) - reserved(else) - ident(type) operator(=) ident(canonical_type)operator(()ident(type)operator(\)) - reserved(if) ident(type)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - constant(BaseType)operator(.)ident(new)operator(()ident(orig_spec)operator(,) ident(type)operator(,) ident(name)operator(\)) - reserved(else) - constant(StructuredType)operator(.)ident(new)operator(()ident(orig_spec)operator(,) ident(type)operator(,) ident(name)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(canonical_type)operator(()ident(type)operator(\)) comment(# :nodoc:) - ident(type_name) operator(=) ident(symbol_name)operator(()ident(type)operator(\)) operator(||) ident(class_to_type_name)operator(()ident(type)operator(\)) - ident(type) operator(=) ident(type_name) operator(||) ident(type) - reserved(return) ident(canonical_type_name)operator(()ident(type)operator(\)) reserved(if) ident(type)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - ident(type) - reserved(end) - - reserved(def) method(canonical_type_name)operator(()ident(name)operator(\)) comment(# :nodoc:) - ident(name) operator(=) ident(name)operator(.)ident(to_sym) - reserved(case) ident(name) - reserved(when) symbol(:int)operator(,) symbol(:integer)operator(,) symbol(:fixnum)operator(,) symbol(:bignum) - symbol(:int) - reserved(when) symbol(:string)operator(,) symbol(:text) - symbol(:string) - reserved(when) symbol(:base64)operator(,) symbol(:binary) - symbol(:base64) - reserved(when) symbol(:bool)operator(,) symbol(:boolean) - symbol(:bool) - reserved(when) symbol(:float)operator(,) symbol(:double) - symbol(:float) - reserved(when) symbol(:time)operator(,) symbol(:timestamp) - symbol(:time) - reserved(when) symbol(:datetime) - symbol(:datetime) - reserved(when) symbol(:date) - symbol(:date) - reserved(else) - ident(raise)operator(()constant(TypeError)operator(,) stringcontent( is not a valid base type)delimiter(")>operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(canonical_type_class)operator(()ident(type)operator(\)) comment(# :nodoc:) - ident(type) operator(=) ident(canonical_type)operator(()ident(type)operator(\)) - ident(type)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) operator(?) ident(type_name_to_class)operator(()ident(type)operator(\)) operator(:) ident(type) - reserved(end) - - reserved(def) method(symbol_name)operator(()ident(name)operator(\)) comment(# :nodoc:) - reserved(return) ident(name)operator(.)ident(to_sym) reserved(if) ident(name)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) operator(||) ident(name)operator(.)ident(is_a?)operator(()constant(String)operator(\)) - pre_constant(nil) - reserved(end) - - reserved(def) method(class_to_type_name)operator(()ident(klass)operator(\)) comment(# :nodoc:) - ident(klass) operator(=) ident(klass)operator(.)ident(class) reserved(unless) ident(klass)operator(.)ident(is_a?)operator(()constant(Class)operator(\)) - reserved(if) ident(derived_from?)operator(()constant(Integer)operator(,) ident(klass)operator(\)) operator(||) ident(derived_from?)operator(()constant(Fixnum)operator(,) ident(klass)operator(\)) operator(||) ident(derived_from?)operator(()constant(Bignum)operator(,) ident(klass)operator(\)) - symbol(:int) - reserved(elsif) ident(klass) operator(==) constant(String) - symbol(:string) - reserved(elsif) ident(klass) operator(==) constant(Base64) - symbol(:base64) - reserved(elsif) ident(klass) operator(==) constant(TrueClass) operator(||) ident(klass) operator(==) constant(FalseClass) - symbol(:bool) - reserved(elsif) ident(derived_from?)operator(()constant(Float)operator(,) ident(klass)operator(\)) operator(||) ident(derived_from?)operator(()constant(Precision)operator(,) ident(klass)operator(\)) operator(||) ident(derived_from?)operator(()constant(Numeric)operator(,) ident(klass)operator(\)) - symbol(:float) - reserved(elsif) ident(klass) operator(==) constant(Time) - symbol(:time) - reserved(elsif) ident(klass) operator(==) constant(DateTime) - symbol(:datetime) - reserved(elsif) ident(klass) operator(==) constant(Date) - symbol(:date) - reserved(else) - pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(type_name_to_class)operator(()ident(name)operator(\)) comment(# :nodoc:) - reserved(case) ident(canonical_type_name)operator(()ident(name)operator(\)) - reserved(when) symbol(:int) - constant(Integer) - reserved(when) symbol(:string) - constant(String) - reserved(when) symbol(:base64) - constant(Base64) - reserved(when) symbol(:bool) - constant(TrueClass) - reserved(when) symbol(:float) - constant(Float) - reserved(when) symbol(:time) - constant(Time) - reserved(when) symbol(:date) - constant(Date) - reserved(when) symbol(:datetime) - constant(DateTime) - reserved(else) - pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(derived_from?)operator(()ident(ancestor)operator(,) ident(child)operator(\)) comment(# :nodoc:) - ident(child)operator(.)ident(ancestors)operator(.)ident(include?)operator(()ident(ancestor)operator(\)) - reserved(end) - - ident(module_function) symbol(:type_name_to_class) - ident(module_function) symbol(:class_to_type_name) - ident(module_function) symbol(:symbol_name) - ident(module_function) symbol(:canonical_type_class) - ident(module_function) symbol(:canonical_type_name) - ident(module_function) symbol(:canonical_type) - ident(module_function) symbol(:canonical_signature_entry) - ident(module_function) symbol(:canonical_signature) - ident(module_function) symbol(:derived_from?) - reserved(end) - - reserved(class) class(BaseType) comment(# :nodoc:) - ident(include) constant(SignatureTypes) - - ident(attr) symbol(:spec) - ident(attr) symbol(:type) - ident(attr) symbol(:type_class) - ident(attr) symbol(:name) - - reserved(def) method(initialize)operator(()ident(spec)operator(,) ident(type)operator(,) ident(name)operator(\)) - instance_variable(@spec) operator(=) ident(spec) - instance_variable(@type) operator(=) ident(canonical_type)operator(()ident(type)operator(\)) - instance_variable(@type_class) operator(=) ident(canonical_type_class)operator(()instance_variable(@type)operator(\)) - instance_variable(@name) operator(=) ident(name) - reserved(end) - - reserved(def) method(custom?) - pre_constant(false) - reserved(end) - - reserved(def) method(array?) - pre_constant(false) - reserved(end) - - reserved(def) method(structured?) - pre_constant(false) - reserved(end) - - reserved(def) method(human_name)operator(()ident(show_name)operator(=)pre_constant(true)operator(\)) - ident(type_type) operator(=) ident(array?) operator(?) ident(element_type)operator(.)ident(type)operator(.)ident(to_s) operator(:) pre_constant(self)operator(.)ident(type)operator(.)ident(to_s) - ident(str) operator(=) ident(array?) operator(?) operator(()ident(type_type) operator(+) stringoperator(\)) operator(:) ident(type_type) - ident(show_name) operator(?) operator(()ident(str) operator(+) string operator(+) ident(name)operator(.)ident(to_s)operator(\)) operator(:) ident(str) - reserved(end) - reserved(end) - - reserved(class) class(ArrayType) operator(<) constant(BaseType) comment(# :nodoc:) - ident(attr) symbol(:element_type) - - reserved(def) method(initialize)operator(()ident(spec)operator(,) ident(element_type)operator(,) ident(name)operator(\)) - reserved(super)operator(()ident(spec)operator(,) constant(Array)operator(,) ident(name)operator(\)) - instance_variable(@element_type) operator(=) ident(element_type) - reserved(end) - - reserved(def) method(custom?) - pre_constant(true) - reserved(end) - - reserved(def) method(array?) - pre_constant(true) - reserved(end) - reserved(end) - - reserved(class) class(StructuredType) operator(<) constant(BaseType) comment(# :nodoc:) - reserved(def) method(each_member) - reserved(if) instance_variable(@type_class)operator(.)ident(respond_to?)operator(()symbol(:members)operator(\)) - instance_variable(@type_class)operator(.)ident(members)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(type)operator(|) - reserved(yield) ident(name)operator(,) ident(type) - reserved(end) - reserved(elsif) instance_variable(@type_class)operator(.)ident(respond_to?)operator(()symbol(:columns)operator(\)) - ident(i) operator(=) integer(-1) - instance_variable(@type_class)operator(.)ident(columns)operator(.)ident(each) reserved(do) operator(|)ident(column)operator(|) - reserved(yield) ident(column)operator(.)ident(name)operator(,) ident(canonical_signature_entry)operator(()ident(column)operator(.)ident(type)operator(,) ident(i) operator(+=) integer(1)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(custom?) - pre_constant(true) - reserved(end) - - reserved(def) method(structured?) - pre_constant(true) - reserved(end) - reserved(end) - - reserved(class) class(Base64) operator(<) constant(String) comment(# :nodoc:) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(Test) comment(# :nodoc:) - reserved(module) class(Unit) comment(# :nodoc:) - reserved(class) class(TestCase) comment(# :nodoc:) - ident(private) - comment(# invoke the specified API method) - reserved(def) method(invoke_direct)operator(()ident(method_name)operator(,) operator(*)ident(args)operator(\)) - ident(prepare_request)operator(()stringoperator(,) stringoperator(,) ident(method_name)operator(,) operator(*)ident(args)operator(\)) - instance_variable(@controller)operator(.)ident(process)operator(()instance_variable(@request)operator(,) instance_variable(@response)operator(\)) - ident(decode_rpc_response) - reserved(end) - ident(alias_method) symbol(:invoke)operator(,) symbol(:invoke_direct) - - comment(# invoke the specified API method on the specified service) - reserved(def) method(invoke_delegated)operator(()ident(service_name)operator(,) ident(method_name)operator(,) operator(*)ident(args)operator(\)) - ident(prepare_request)operator(()ident(service_name)operator(.)ident(to_s)operator(,) ident(service_name)operator(,) ident(method_name)operator(,) operator(*)ident(args)operator(\)) - instance_variable(@controller)operator(.)ident(process)operator(()instance_variable(@request)operator(,) instance_variable(@response)operator(\)) - ident(decode_rpc_response) - reserved(end) - - comment(# invoke the specified layered API method on the correct service) - reserved(def) method(invoke_layered)operator(()ident(service_name)operator(,) ident(method_name)operator(,) operator(*)ident(args)operator(\)) - ident(prepare_request)operator(()stringoperator(,) ident(service_name)operator(,) ident(method_name)operator(,) operator(*)ident(args)operator(\)) - instance_variable(@controller)operator(.)ident(process)operator(()instance_variable(@request)operator(,) instance_variable(@response)operator(\)) - ident(decode_rpc_response) - reserved(end) - - comment(# ---------------------- internal ---------------------------) - - reserved(def) method(prepare_request)operator(()ident(action)operator(,) ident(service_name)operator(,) ident(api_method_name)operator(,) operator(*)ident(args)operator(\)) - instance_variable(@request)operator(.)ident(recycle!) - instance_variable(@request)operator(.)ident(request_parameters)operator([)stringoperator(]) operator(=) ident(action) - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) ident(encode_rpc_call)operator(()ident(service_name)operator(,) ident(api_method_name)operator(,) operator(*)ident(args)operator(\)) - reserved(case) ident(protocol) - reserved(when) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(Soap)operator(::)constant(SoapProtocol) - ident(soap_action) operator(=) stringcontent(/)inlinecontent(/)inlinedelimiter(")> - instance_variable(@request)operator(.)ident(env)operator([)stringoperator(]) operator(=) ident(soap_action) - reserved(when) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(XmlRpc)operator(::)constant(XmlRpcProtocol) - instance_variable(@request)operator(.)ident(env)operator(.)ident(delete)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(encode_rpc_call)operator(()ident(service_name)operator(,) ident(api_method_name)operator(,) operator(*)ident(args)operator(\)) - reserved(case) instance_variable(@controller)operator(.)ident(web_service_dispatching_mode) - reserved(when) symbol(:direct) - ident(api) operator(=) instance_variable(@controller)operator(.)ident(class)operator(.)ident(web_service_api) - reserved(when) symbol(:delegated)operator(,) symbol(:layered) - ident(api) operator(=) instance_variable(@controller)operator(.)ident(web_service_object)operator(()ident(service_name)operator(.)ident(to_sym)operator(\))operator(.)ident(class)operator(.)ident(web_service_api) - reserved(end) - ident(protocol)operator(.)ident(register_api)operator(()ident(api)operator(\)) - ident(method) operator(=) ident(api)operator(.)ident(api_methods)operator([)ident(api_method_name)operator(.)ident(to_sym)operator(]) - ident(raise) constant(ArgumentError)operator(,) stringcontent( for )inlinecontent(\))delimiter(")> reserved(unless) ident(args)operator(.)ident(length) operator(==) ident(method)operator(.)ident(expects)operator(.)ident(length) - ident(protocol)operator(.)ident(encode_request)operator(()ident(public_method_name)operator(()ident(service_name)operator(,) ident(api_method_name)operator(\))operator(,) ident(args)operator(.)ident(dup)operator(,) ident(method)operator(.)ident(expects)operator(\)) - reserved(end) - - reserved(def) method(decode_rpc_response) - ident(public_method_name)operator(,) ident(return_value) operator(=) ident(protocol)operator(.)ident(decode_response)operator(()instance_variable(@response)operator(.)ident(body)operator(\)) - ident(exception) operator(=) ident(is_exception?)operator(()ident(return_value)operator(\)) - ident(raise) ident(exception) reserved(if) ident(exception) - ident(return_value) - reserved(end) - - reserved(def) method(public_method_name)operator(()ident(service_name)operator(,) ident(api_method_name)operator(\)) - ident(public_name) operator(=) ident(service_api)operator(()ident(service_name)operator(\))operator(.)ident(public_api_method_name)operator(()ident(api_method_name)operator(\)) - reserved(if) instance_variable(@controller)operator(.)ident(web_service_dispatching_mode) operator(==) symbol(:layered) operator(&&) ident(protocol)operator(.)ident(is_a?)operator(()constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(XmlRpc)operator(::)constant(XmlRpcProtocol)operator(\)) - string operator(%) operator([)ident(service_name)operator(.)ident(to_s)operator(,) ident(public_name)operator(]) - reserved(else) - ident(public_name) - reserved(end) - reserved(end) - - reserved(def) method(service_api)operator(()ident(service_name)operator(\)) - reserved(case) instance_variable(@controller)operator(.)ident(web_service_dispatching_mode) - reserved(when) symbol(:direct) - instance_variable(@controller)operator(.)ident(class)operator(.)ident(web_service_api) - reserved(when) symbol(:delegated)operator(,) symbol(:layered) - instance_variable(@controller)operator(.)ident(web_service_object)operator(()ident(service_name)operator(.)ident(to_sym)operator(\))operator(.)ident(class)operator(.)ident(web_service_api) - reserved(end) - reserved(end) - - reserved(def) method(protocol) - reserved(if) instance_variable(@protocol)operator(.)ident(nil?) - instance_variable(@protocol) operator(||=) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(Soap)operator(::)constant(SoapProtocol)operator(.)ident(create)operator(()instance_variable(@controller)operator(\)) - reserved(else) - reserved(case) instance_variable(@protocol) - reserved(when) symbol(:xmlrpc) - instance_variable(@protocol) operator(=) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(XmlRpc)operator(::)constant(XmlRpcProtocol)operator(.)ident(create)operator(()instance_variable(@controller)operator(\)) - reserved(when) symbol(:soap) - instance_variable(@protocol) operator(=) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(Soap)operator(::)constant(SoapProtocol)operator(.)ident(create)operator(()instance_variable(@controller)operator(\)) - reserved(else) - instance_variable(@protocol) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(is_exception?)operator(()ident(obj)operator(\)) - reserved(case) ident(protocol) - reserved(when) symbol(:soap)operator(,) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(Soap)operator(::)constant(SoapProtocol) - operator(()ident(obj)operator(.)ident(respond_to?)operator(()symbol(:detail)operator(\)) operator(&&) ident(obj)operator(.)ident(detail)operator(.)ident(respond_to?)operator(()symbol(:cause)operator(\)) operator(&&) \ - ident(obj)operator(.)ident(detail)operator(.)ident(cause)operator(.)ident(is_a?)operator(()constant(Exception)operator(\))operator(\)) operator(?) ident(obj)operator(.)ident(detail)operator(.)ident(cause) operator(:) pre_constant(nil) - reserved(when) symbol(:xmlrpc)operator(,) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(XmlRpc)operator(::)constant(XmlRpcProtocol) - ident(obj)operator(.)ident(is_a?)operator(()constant(XMLRPC)operator(::)constant(FaultException)operator(\)) operator(?) ident(obj) operator(:) pre_constant(nil) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActionWebService) - reserved(module) class(VERSION) comment(#:nodoc:) - constant(MAJOR) operator(=) integer(1) - constant(MINOR) operator(=) integer(1) - constant(TINY) operator(=) integer(6) - - constant(STRING) operator(=) operator([)constant(MAJOR)operator(,) constant(MINOR)operator(,) constant(TINY)operator(])operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) -reserved(end) -comment(#--) -comment(# Copyright (C\) 2005 Leon Breedt) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#++) - -reserved(begin) - ident(require) string - ident(require) string - ident(require) string -reserved(rescue) constant(LoadError) - ident(require) string - ident(require_gem) stringoperator(,) string= 1.0.2)delimiter(')> - ident(require_gem) stringoperator(,) string= 1.6.0)delimiter(')> - ident(require_gem) stringoperator(,) string= 1.9.0)delimiter(')> -reserved(end) - -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -constant(ActionWebService)operator(::)constant(Base)operator(.)ident(class_eval) reserved(do) - ident(include) constant(ActionWebService)operator(::)constant(Container)operator(::)constant(Direct) - ident(include) constant(ActionWebService)operator(::)constant(Invocation) -reserved(end) - -constant(ActionController)operator(::)constant(Base)operator(.)ident(class_eval) reserved(do) - ident(include) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(Discovery) - ident(include) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(Soap) - ident(include) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(XmlRpc) - ident(include) constant(ActionWebService)operator(::)constant(Container)operator(::)constant(Direct) - ident(include) constant(ActionWebService)operator(::)constant(Container)operator(::)constant(Delegated) - ident(include) constant(ActionWebService)operator(::)constant(Container)operator(::)constant(ActionController) - ident(include) constant(ActionWebService)operator(::)constant(Invocation) - ident(include) constant(ActionWebService)operator(::)constant(Dispatcher) - ident(include) constant(ActionWebService)operator(::)constant(Dispatcher)operator(::)constant(ActionController) - ident(include) constant(ActionWebService)operator(::)constant(Scaffolding) -reserved(end) -comment(#) -comment(# setup.rb) -comment(#) -comment(# Copyright (c\) 2000-2004 Minero Aoki) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#) -comment(# Note: Originally licensed under LGPL v2+. Using MIT license for Rails) -comment(# with permission of Minero Aoki.) - -comment(#) - -reserved(unless) constant(Enumerable)operator(.)ident(method_defined?)operator(()symbol(:map)operator(\)) comment(# Ruby 1.4.6) - reserved(module) class(Enumerable) - reserved(alias) method(map) method(collect) - reserved(end) -reserved(end) - -reserved(unless) constant(File)operator(.)ident(respond_to?)operator(()symbol(:read)operator(\)) comment(# Ruby 1.6) - reserved(def) constant(File)operator(.)method(read)operator(()ident(fname)operator(\)) - ident(open)operator(()ident(fname)operator(\)) operator({)operator(|)ident(f)operator(|) - reserved(return) ident(f)operator(.)ident(read) - operator(}) - reserved(end) -reserved(end) - -reserved(def) constant(File)operator(.)method(binread)operator(()ident(fname)operator(\)) - ident(open)operator(()ident(fname)operator(,) stringoperator(\)) operator({)operator(|)ident(f)operator(|) - reserved(return) ident(f)operator(.)ident(read) - operator(}) -reserved(end) - -comment(# for corrupted windows stat(2\)) -reserved(def) constant(File)operator(.)method(dir?)operator(()ident(path)operator(\)) - constant(File)operator(.)ident(directory?)operator(()operator(()ident(path)operator([)integer(-1)operator(,)integer(1)operator(]) operator(==) stringoperator(\)) operator(?) ident(path) operator(:) ident(path) operator(+) stringoperator(\)) -reserved(end) - - -reserved(class) class(SetupError) operator(<) constant(StandardError)operator(;) reserved(end) - -reserved(def) method(setup_rb_error)operator(()ident(msg)operator(\)) - ident(raise) constant(SetupError)operator(,) ident(msg) -reserved(end) - -comment(#) -comment(# Config) -comment(#) - -reserved(if) ident(arg) operator(=) pre_constant(ARGV)operator(.)ident(detect) operator({)operator(|)ident(arg)operator(|) regexp operator(=)operator(~) ident(arg) operator(}) - pre_constant(ARGV)operator(.)ident(delete)operator(()ident(arg)operator(\)) - ident(require) ident(arg)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\))operator([)integer(1)operator(]) - global_variable($")operator(.)ident(push) string -reserved(else) - ident(require) string -reserved(end) - -reserved(def) method(multipackage_install?) - constant(FileTest)operator(.)ident(directory?)operator(()constant(File)operator(.)ident(dirname)operator(()global_variable($0)operator(\)) operator(+) stringoperator(\)) -reserved(end) - - -reserved(class) class(ConfigItem) - reserved(def) method(initialize)operator(()ident(name)operator(,) ident(template)operator(,) ident(default)operator(,) ident(desc)operator(\)) - instance_variable(@name) operator(=) ident(name)operator(.)ident(freeze) - instance_variable(@template) operator(=) ident(template) - instance_variable(@value) operator(=) ident(default) - instance_variable(@default) operator(=) ident(default)operator(.)ident(dup)operator(.)ident(freeze) - instance_variable(@description) operator(=) ident(desc) - reserved(end) - - ident(attr_reader) symbol(:name) - ident(attr_reader) symbol(:description) - - ident(attr_accessor) symbol(:default) - reserved(alias) method(help_default) method(default) - - reserved(def) method(help_opt) - stringcontent(=)inlinedelimiter(")> - reserved(end) - - reserved(def) method(value) - instance_variable(@value) - reserved(end) - - reserved(def) method(eval)operator(()ident(table)operator(\)) - instance_variable(@value)operator(.)ident(gsub)operator(()regexp)>operator(\)) operator({) ident(table)operator([)global_variable($1)operator(]) operator(}) - reserved(end) - - reserved(def) method(set)operator(()ident(val)operator(\)) - instance_variable(@value) operator(=) ident(check)operator(()ident(val)operator(\)) - reserved(end) - - ident(private) - - reserved(def) method(check)operator(()ident(val)operator(\)) - ident(setup_rb_error) stringcontent( requires argument)delimiter(")> reserved(unless) ident(val) - ident(val) - reserved(end) -reserved(end) - -reserved(class) class(BoolItem) operator(<) constant(ConfigItem) - reserved(def) method(config_type) - string - reserved(end) - - reserved(def) method(help_opt) - stringdelimiter(")> - reserved(end) - - ident(private) - - reserved(def) method(check)operator(()ident(val)operator(\)) - reserved(return) string reserved(unless) ident(val) - reserved(unless) regexp operator(=)operator(~) ident(val) - ident(setup_rb_error) stringcontent( accepts only yes/no for argument)delimiter(")> - reserved(end) - operator(()regexp operator(=)operator(~) ident(value)operator(\)) operator(?) string operator(:) string - reserved(end) -reserved(end) - -reserved(class) class(PathItem) operator(<) constant(ConfigItem) - reserved(def) method(config_type) - string - reserved(end) - - ident(private) - - reserved(def) method(check)operator(()ident(path)operator(\)) - ident(setup_rb_error) stringcontent( requires argument)delimiter(")> reserved(unless) ident(path) - ident(path)operator([)integer(0)operator(,)integer(1)operator(]) operator(==) string operator(?) ident(path) operator(:) constant(File)operator(.)ident(expand_path)operator(()ident(path)operator(\)) - reserved(end) -reserved(end) - -reserved(class) class(ProgramItem) operator(<) constant(ConfigItem) - reserved(def) method(config_type) - string - reserved(end) -reserved(end) - -reserved(class) class(SelectItem) operator(<) constant(ConfigItem) - reserved(def) method(initialize)operator(()ident(name)operator(,) ident(template)operator(,) ident(default)operator(,) ident(desc)operator(\)) - reserved(super) - instance_variable(@ok) operator(=) ident(template)operator(.)ident(split)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(config_type) - string - reserved(end) - - ident(private) - - reserved(def) method(check)operator(()ident(val)operator(\)) - reserved(unless) instance_variable(@ok)operator(.)ident(include?)operator(()ident(val)operator(.)ident(strip)operator(\)) - ident(setup_rb_error) stringcontent(=)inlinecontent( ()inlinecontent(\))delimiter(")> - reserved(end) - ident(val)operator(.)ident(strip) - reserved(end) -reserved(end) - -reserved(class) class(PackageSelectionItem) operator(<) constant(ConfigItem) - reserved(def) method(initialize)operator(()ident(name)operator(,) ident(template)operator(,) ident(default)operator(,) ident(help_default)operator(,) ident(desc)operator(\)) - reserved(super) ident(name)operator(,) ident(template)operator(,) ident(default)operator(,) ident(desc) - instance_variable(@help_default) operator(=) ident(help_default) - reserved(end) - - ident(attr_reader) symbol(:help_default) - - reserved(def) method(config_type) - string - reserved(end) - - ident(private) - - reserved(def) method(check)operator(()ident(val)operator(\)) - reserved(unless) constant(File)operator(.)ident(dir?)operator(()stringdelimiter(")>operator(\)) - ident(setup_rb_error) stringdelimiter(")> - reserved(end) - ident(val) - reserved(end) -reserved(end) - -reserved(class) class(ConfigTable_class) - - reserved(def) method(initialize)operator(()ident(items)operator(\)) - instance_variable(@items) operator(=) ident(items) - instance_variable(@table) operator(=) operator({)operator(}) - ident(items)operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - instance_variable(@table)operator([)ident(i)operator(.)ident(name)operator(]) operator(=) ident(i) - reserved(end) - constant(ALIASES)operator(.)ident(each) reserved(do) operator(|)ident(ali)operator(,) ident(name)operator(|) - instance_variable(@table)operator([)ident(ali)operator(]) operator(=) instance_variable(@table)operator([)ident(name)operator(]) - reserved(end) - reserved(end) - - ident(include) constant(Enumerable) - - reserved(def) method(each)operator(()operator(&)ident(block)operator(\)) - instance_variable(@items)operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(key?)operator(()ident(name)operator(\)) - instance_variable(@table)operator(.)ident(key?)operator(()ident(name)operator(\)) - reserved(end) - - reserved(def) method(lookup)operator(()ident(name)operator(\)) - instance_variable(@table)operator([)ident(name)operator(]) reserved(or) ident(raise) constant(ArgumentError)operator(,) stringdelimiter(")> - reserved(end) - - reserved(def) method(add)operator(()ident(item)operator(\)) - instance_variable(@items)operator(.)ident(push) ident(item) - instance_variable(@table)operator([)ident(item)operator(.)ident(name)operator(]) operator(=) ident(item) - reserved(end) - - reserved(def) method(remove)operator(()ident(name)operator(\)) - ident(item) operator(=) ident(lookup)operator(()ident(name)operator(\)) - instance_variable(@items)operator(.)ident(delete_if) operator({)operator(|)ident(i)operator(|) ident(i)operator(.)ident(name) operator(==) ident(name) operator(}) - instance_variable(@table)operator(.)ident(delete_if) operator({)operator(|)ident(name)operator(,) ident(i)operator(|) ident(i)operator(.)ident(name) operator(==) ident(name) operator(}) - ident(item) - reserved(end) - - reserved(def) method(new) - ident(dup)operator(()operator(\)) - reserved(end) - - reserved(def) method(savefile) - string - reserved(end) - - reserved(def) method(load) - reserved(begin) - ident(t) operator(=) ident(dup)operator(()operator(\)) - constant(File)operator(.)ident(foreach)operator(()ident(savefile)operator(()operator(\))operator(\)) reserved(do) operator(|)ident(line)operator(|) - ident(k)operator(,) ident(v) operator(=) operator(*)ident(line)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) - ident(t)operator([)ident(k)operator(]) operator(=) ident(v)operator(.)ident(strip) - reserved(end) - ident(t) - reserved(rescue) constant(Errno)operator(::)constant(ENOENT) - ident(setup_rb_error) global_variable($!)operator(.)ident(message) operator(+) stringcontent( config first)delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(save) - instance_variable(@items)operator(.)ident(each) operator({)operator(|)ident(i)operator(|) ident(i)operator(.)ident(value) operator(}) - constant(File)operator(.)ident(open)operator(()ident(savefile)operator(()operator(\))operator(,) stringoperator(\)) operator({)operator(|)ident(f)operator(|) - instance_variable(@items)operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - ident(f)operator(.)ident(printf) stringoperator(,) ident(i)operator(.)ident(name)operator(,) ident(i)operator(.)ident(value) reserved(if) ident(i)operator(.)ident(value) - reserved(end) - operator(}) - reserved(end) - - reserved(def) method([])operator(()ident(key)operator(\)) - ident(lookup)operator(()ident(key)operator(\))operator(.)ident(eval)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method([]=)operator(()ident(key)operator(,) ident(val)operator(\)) - ident(lookup)operator(()ident(key)operator(\))operator(.)ident(set) ident(val) - reserved(end) - -reserved(end) - -ident(c) operator(=) operator(::)constant(Config)operator(::)constant(CONFIG) - -ident(rubypath) operator(=) ident(c)operator([)stringoperator(]) operator(+) string operator(+) ident(c)operator([)stringoperator(]) - -ident(major) operator(=) ident(c)operator([)stringoperator(])operator(.)ident(to_i) -ident(minor) operator(=) ident(c)operator([)stringoperator(])operator(.)ident(to_i) -ident(teeny) operator(=) ident(c)operator([)stringoperator(])operator(.)ident(to_i) -ident(version) operator(=) stringcontent(.)inlinedelimiter(")> - -comment(# ruby ver. >= 1.4.4?) -ident(newpath_p) operator(=) operator(()operator(()ident(major) operator(>)operator(=) integer(2)operator(\)) reserved(or) - operator(()operator(()ident(major) operator(==) integer(1)operator(\)) reserved(and) - operator(()operator(()ident(minor) operator(>)operator(=) integer(5)operator(\)) reserved(or) - operator(()operator(()ident(minor) operator(==) integer(4)operator(\)) reserved(and) operator(()ident(teeny) operator(>)operator(=) integer(4)operator(\))operator(\))operator(\))operator(\))operator(\)) - -reserved(if) ident(c)operator([)stringoperator(]) - comment(# V < 1.6.3) - ident(_stdruby) operator(=) ident(c)operator([)stringoperator(]) - ident(_siteruby) operator(=) ident(c)operator([)stringoperator(]) - ident(_siterubyver) operator(=) ident(c)operator([)stringoperator(]) - ident(_siterubyverarch) operator(=) ident(c)operator([)stringoperator(]) -reserved(elsif) ident(newpath_p) - comment(# 1.4.4 <= V <= 1.6.3) - ident(_stdruby) operator(=) stringdelimiter(")> - ident(_siteruby) operator(=) ident(c)operator([)stringoperator(]) - ident(_siterubyver) operator(=) stringdelimiter(")> - ident(_siterubyverarch) operator(=) stringoperator(])inline_delimiter(})>delimiter(")> -reserved(else) - comment(# V < 1.4.4) - ident(_stdruby) operator(=) stringdelimiter(")> - ident(_siteruby) operator(=) stringcontent(/site_ruby)delimiter(")> - ident(_siterubyver) operator(=) ident(_siteruby) - ident(_siterubyverarch) operator(=) stringoperator(])inline_delimiter(})>delimiter(")> -reserved(end) -ident(libdir) operator(=) string -ident(stdruby) operator(=) string -ident(siteruby) operator(=) string -ident(siterubyver) operator(=) string -ident(parameterize) operator(=) ident(lambda) operator({)operator(|)ident(path)operator(|) - ident(path)operator(.)ident(sub)operator(()regexpoperator(])operator(\))inline_delimiter(})>delimiter(/)>operator(,) stringoperator(\))\ - operator(.)ident(sub)operator(()regexpdelimiter(/)>operator(,) stringoperator(\))\ - operator(.)ident(sub)operator(()regexpdelimiter(/)>operator(,) stringoperator(\))\ - operator(.)ident(sub)operator(()regexpdelimiter(/)>operator(,) stringoperator(\))\ - operator(.)ident(sub)operator(()regexpdelimiter(/)>operator(,) stringoperator(\)) -operator(}) -ident(libdir) operator(=) ident(parameterize)operator(.)ident(call)operator(()ident(c)operator([)stringoperator(])operator(\)) -ident(stdruby) operator(=) ident(parameterize)operator(.)ident(call)operator(()ident(_stdruby)operator(\)) -ident(siteruby) operator(=) ident(parameterize)operator(.)ident(call)operator(()ident(_siteruby)operator(\)) -ident(siterubyver) operator(=) ident(parameterize)operator(.)ident(call)operator(()ident(_siterubyver)operator(\)) -ident(siterubyverarch) operator(=) ident(parameterize)operator(.)ident(call)operator(()ident(_siterubyverarch)operator(\)) - -reserved(if) ident(arg) operator(=) ident(c)operator([)stringoperator(])operator(.)ident(split)operator(.)ident(detect) operator({)operator(|)ident(arg)operator(|) regexp operator(=)operator(~) ident(arg) operator(}) - ident(makeprog) operator(=) ident(arg)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\))operator([)integer(1)operator(]) -reserved(else) - ident(makeprog) operator(=) string -reserved(end) - -ident(common_conf) operator(=) operator([) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(c)operator([)stringoperator(])operator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(parameterize)operator(.)ident(call)operator(()ident(c)operator([)stringoperator(])operator(\))operator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(libdir)operator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(parameterize)operator(.)ident(call)operator(()ident(c)operator([)stringoperator(])operator(\))operator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(parameterize)operator(.)ident(call)operator(()ident(c)operator([)stringoperator(])operator(\))operator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(parameterize)operator(.)ident(call)operator(()ident(c)operator([)stringoperator(])operator(\))operator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(stdruby)operator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(siteruby)operator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(siterubyver)operator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(siterubyverarch)operator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(\))operator(,) - constant(PathItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(rubypath)operator(,) - stringoperator(\))operator(,) - constant(ProgramItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(rubypath)operator(,) - stringoperator(\))operator(,) - constant(ProgramItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) ident(makeprog)operator(,) - stringoperator(\))operator(,) - constant(SelectItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(\))operator(,) - constant(BoolItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(\)) -operator(]) -reserved(class) class(ConfigTable_class) comment(# open again) - constant(ALIASES) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) comment(# For backward compatibility) - string operator(=)operator(>) stringoperator(,) comment(# For backward compatibility) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) string - operator(}) -reserved(end) -ident(multipackage_conf) operator(=) operator([) - constant(PackageSelectionItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(\))operator(,) - constant(PackageSelectionItem)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(\)) -operator(]) -reserved(if) ident(multipackage_install?) - constant(ConfigTable) operator(=) constant(ConfigTable_class)operator(.)ident(new)operator(()ident(common_conf) operator(+) ident(multipackage_conf)operator(\)) -reserved(else) - constant(ConfigTable) operator(=) constant(ConfigTable_class)operator(.)ident(new)operator(()ident(common_conf)operator(\)) -reserved(end) - - -reserved(module) class(MetaConfigAPI) - - reserved(def) method(eval_file_ifexist)operator(()ident(fname)operator(\)) - ident(instance_eval) constant(File)operator(.)ident(read)operator(()ident(fname)operator(\))operator(,) ident(fname)operator(,) integer(1) reserved(if) constant(File)operator(.)ident(file?)operator(()ident(fname)operator(\)) - reserved(end) - - reserved(def) method(config_names) - constant(ConfigTable)operator(.)ident(map) operator({)operator(|)ident(i)operator(|) ident(i)operator(.)ident(name) operator(}) - reserved(end) - - reserved(def) method(config?)operator(()ident(name)operator(\)) - constant(ConfigTable)operator(.)ident(key?)operator(()ident(name)operator(\)) - reserved(end) - - reserved(def) method(bool_config?)operator(()ident(name)operator(\)) - constant(ConfigTable)operator(.)ident(lookup)operator(()ident(name)operator(\))operator(.)ident(config_type) operator(==) string - reserved(end) - - reserved(def) method(path_config?)operator(()ident(name)operator(\)) - constant(ConfigTable)operator(.)ident(lookup)operator(()ident(name)operator(\))operator(.)ident(config_type) operator(==) string - reserved(end) - - reserved(def) method(value_config?)operator(()ident(name)operator(\)) - reserved(case) constant(ConfigTable)operator(.)ident(lookup)operator(()ident(name)operator(\))operator(.)ident(config_type) - reserved(when) stringoperator(,) string - pre_constant(true) - reserved(else) - pre_constant(false) - reserved(end) - reserved(end) - - reserved(def) method(add_config)operator(()ident(item)operator(\)) - constant(ConfigTable)operator(.)ident(add) ident(item) - reserved(end) - - reserved(def) method(add_bool_config)operator(()ident(name)operator(,) ident(default)operator(,) ident(desc)operator(\)) - constant(ConfigTable)operator(.)ident(add) constant(BoolItem)operator(.)ident(new)operator(()ident(name)operator(,) stringoperator(,) ident(default) operator(?) string operator(:) stringoperator(,) ident(desc)operator(\)) - reserved(end) - - reserved(def) method(add_path_config)operator(()ident(name)operator(,) ident(default)operator(,) ident(desc)operator(\)) - constant(ConfigTable)operator(.)ident(add) constant(PathItem)operator(.)ident(new)operator(()ident(name)operator(,) stringoperator(,) ident(default)operator(,) ident(desc)operator(\)) - reserved(end) - - reserved(def) method(set_config_default)operator(()ident(name)operator(,) ident(default)operator(\)) - constant(ConfigTable)operator(.)ident(lookup)operator(()ident(name)operator(\))operator(.)ident(default) operator(=) ident(default) - reserved(end) - - reserved(def) method(remove_config)operator(()ident(name)operator(\)) - constant(ConfigTable)operator(.)ident(remove)operator(()ident(name)operator(\)) - reserved(end) - -reserved(end) - - -comment(#) -comment(# File Operations) -comment(#) - -reserved(module) class(FileOperations) - - reserved(def) method(mkdir_p)operator(()ident(dirname)operator(,) ident(prefix) operator(=) pre_constant(nil)operator(\)) - ident(dirname) operator(=) ident(prefix) operator(+) constant(File)operator(.)ident(expand_path)operator(()ident(dirname)operator(\)) reserved(if) ident(prefix) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> reserved(if) ident(verbose?) - reserved(return) reserved(if) ident(no_harm?) - - comment(# does not check '/'... it's too abnormal case) - ident(dirs) operator(=) constant(File)operator(.)ident(expand_path)operator(()ident(dirname)operator(\))operator(.)ident(split)operator(()regexp)>operator(\)) - reserved(if) regexp operator(=)operator(~) ident(dirs)operator([)integer(0)operator(]) - ident(disk) operator(=) ident(dirs)operator(.)ident(shift) - ident(dirs)operator([)integer(0)operator(]) operator(=) ident(disk) operator(+) ident(dirs)operator([)integer(0)operator(]) - reserved(end) - ident(dirs)operator(.)ident(each_index) reserved(do) operator(|)ident(idx)operator(|) - ident(path) operator(=) ident(dirs)operator([)integer(0)operator(..)ident(idx)operator(])operator(.)ident(join)operator(()stringoperator(\)) - constant(Dir)operator(.)ident(mkdir) ident(path) reserved(unless) constant(File)operator(.)ident(dir?)operator(()ident(path)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(rm_f)operator(()ident(fname)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> reserved(if) ident(verbose?) - reserved(return) reserved(if) ident(no_harm?) - - reserved(if) constant(File)operator(.)ident(exist?)operator(()ident(fname)operator(\)) reserved(or) constant(File)operator(.)ident(symlink?)operator(()ident(fname)operator(\)) - constant(File)operator(.)ident(chmod) integer(0777)operator(,) ident(fname) - constant(File)operator(.)ident(unlink) ident(fname) - reserved(end) - reserved(end) - - reserved(def) method(rm_rf)operator(()ident(dn)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> reserved(if) ident(verbose?) - reserved(return) reserved(if) ident(no_harm?) - - constant(Dir)operator(.)ident(chdir) ident(dn) - constant(Dir)operator(.)ident(foreach)operator(()stringoperator(\)) reserved(do) operator(|)ident(fn)operator(|) - reserved(next) reserved(if) ident(fn) operator(==) string - reserved(next) reserved(if) ident(fn) operator(==) string - reserved(if) constant(File)operator(.)ident(dir?)operator(()ident(fn)operator(\)) - ident(verbose_off) operator({) - ident(rm_rf) ident(fn) - operator(}) - reserved(else) - ident(verbose_off) operator({) - ident(rm_f) ident(fn) - operator(}) - reserved(end) - reserved(end) - constant(Dir)operator(.)ident(chdir) string - constant(Dir)operator(.)ident(rmdir) ident(dn) - reserved(end) - - reserved(def) method(move_file)operator(()ident(src)operator(,) ident(dest)operator(\)) - constant(File)operator(.)ident(unlink) ident(dest) reserved(if) constant(File)operator(.)ident(exist?)operator(()ident(dest)operator(\)) - reserved(begin) - constant(File)operator(.)ident(rename) ident(src)operator(,) ident(dest) - reserved(rescue) - constant(File)operator(.)ident(open)operator(()ident(dest)operator(,) stringoperator(\)) operator({)operator(|)ident(f)operator(|) ident(f)operator(.)ident(write) constant(File)operator(.)ident(binread)operator(()ident(src)operator(\)) operator(}) - constant(File)operator(.)ident(chmod) constant(File)operator(.)ident(stat)operator(()ident(src)operator(\))operator(.)ident(mode)operator(,) ident(dest) - constant(File)operator(.)ident(unlink) ident(src) - reserved(end) - reserved(end) - - reserved(def) method(install)operator(()ident(from)operator(,) ident(dest)operator(,) ident(mode)operator(,) ident(prefix) operator(=) pre_constant(nil)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringcontent( )inlinedelimiter(")> reserved(if) ident(verbose?) - reserved(return) reserved(if) ident(no_harm?) - - ident(realdest) operator(=) ident(prefix) operator(?) ident(prefix) operator(+) constant(File)operator(.)ident(expand_path)operator(()ident(dest)operator(\)) operator(:) ident(dest) - ident(realdest) operator(=) constant(File)operator(.)ident(join)operator(()ident(realdest)operator(,) constant(File)operator(.)ident(basename)operator(()ident(from)operator(\))operator(\)) reserved(if) constant(File)operator(.)ident(dir?)operator(()ident(realdest)operator(\)) - ident(str) operator(=) constant(File)operator(.)ident(binread)operator(()ident(from)operator(\)) - reserved(if) ident(diff?)operator(()ident(str)operator(,) ident(realdest)operator(\)) - ident(verbose_off) operator({) - ident(rm_f) ident(realdest) reserved(if) constant(File)operator(.)ident(exist?)operator(()ident(realdest)operator(\)) - operator(}) - constant(File)operator(.)ident(open)operator(()ident(realdest)operator(,) stringoperator(\)) operator({)operator(|)ident(f)operator(|) - ident(f)operator(.)ident(write) ident(str) - operator(}) - constant(File)operator(.)ident(chmod) ident(mode)operator(,) ident(realdest) - - constant(File)operator(.)ident(open)operator(()stringcontent(/InstalledFiles)delimiter(")>operator(,) stringoperator(\)) operator({)operator(|)ident(f)operator(|) - reserved(if) ident(prefix) - ident(f)operator(.)ident(puts) ident(realdest)operator(.)ident(sub)operator(()ident(prefix)operator(,) stringoperator(\)) - reserved(else) - ident(f)operator(.)ident(puts) ident(realdest) - reserved(end) - operator(}) - reserved(end) - reserved(end) - - reserved(def) method(diff?)operator(()ident(new_content)operator(,) ident(path)operator(\)) - reserved(return) pre_constant(true) reserved(unless) constant(File)operator(.)ident(exist?)operator(()ident(path)operator(\)) - ident(new_content) operator(!=) constant(File)operator(.)ident(binread)operator(()ident(path)operator(\)) - reserved(end) - - reserved(def) method(command)operator(()ident(str)operator(\)) - global_variable($stderr)operator(.)ident(puts) ident(str) reserved(if) ident(verbose?) - ident(system) ident(str) reserved(or) ident(raise) constant(RuntimeError)operator(,) stringcontent(' failed)delimiter(")> - reserved(end) - - reserved(def) method(ruby)operator(()ident(str)operator(\)) - ident(command) ident(config)operator(()stringoperator(\)) operator(+) string operator(+) ident(str) - reserved(end) - - reserved(def) method(make)operator(()ident(task) operator(=) stringoperator(\)) - ident(command) ident(config)operator(()stringoperator(\)) operator(+) string operator(+) ident(task) - reserved(end) - - reserved(def) method(extdir?)operator(()ident(dir)operator(\)) - constant(File)operator(.)ident(exist?)operator(()ident(dir) operator(+) stringoperator(\)) - reserved(end) - - reserved(def) method(all_files_in)operator(()ident(dirname)operator(\)) - constant(Dir)operator(.)ident(open)operator(()ident(dirname)operator(\)) operator({)operator(|)ident(d)operator(|) - reserved(return) ident(d)operator(.)ident(select) operator({)operator(|)ident(ent)operator(|) constant(File)operator(.)ident(file?)operator(()stringcontent(/)inlinedelimiter(")>operator(\)) operator(}) - operator(}) - reserved(end) - - constant(REJECT_DIRS) operator(=) string - - reserved(def) method(all_dirs_in)operator(()ident(dirname)operator(\)) - constant(Dir)operator(.)ident(open)operator(()ident(dirname)operator(\)) operator({)operator(|)ident(d)operator(|) - reserved(return) ident(d)operator(.)ident(select) operator({)operator(|)ident(n)operator(|) constant(File)operator(.)ident(dir?)operator(()stringcontent(/)inlinedelimiter(")>operator(\)) operator(}) operator(-) string operator(-) constant(REJECT_DIRS) - operator(}) - reserved(end) - -reserved(end) - - -comment(#) -comment(# Main Installer) -comment(#) - -reserved(module) class(HookUtils) - - reserved(def) method(run_hook)operator(()ident(name)operator(\)) - ident(try_run_hook) stringcontent(/)inlinedelimiter(")> reserved(or) - ident(try_run_hook) stringcontent(/)inlinecontent(.rb)delimiter(")> - reserved(end) - - reserved(def) method(try_run_hook)operator(()ident(fname)operator(\)) - reserved(return) pre_constant(false) reserved(unless) constant(File)operator(.)ident(file?)operator(()ident(fname)operator(\)) - reserved(begin) - ident(instance_eval) constant(File)operator(.)ident(read)operator(()ident(fname)operator(\))operator(,) ident(fname)operator(,) integer(1) - reserved(rescue) - ident(setup_rb_error) stringcontent( failed:)char(\\n)delimiter(")> operator(+) global_variable($!)operator(.)ident(message) - reserved(end) - pre_constant(true) - reserved(end) - -reserved(end) - - -reserved(module) class(HookScriptAPI) - - reserved(def) method(get_config)operator(()ident(key)operator(\)) - instance_variable(@config)operator([)ident(key)operator(]) - reserved(end) - - reserved(alias) method(config) method(get_config) - - reserved(def) method(set_config)operator(()ident(key)operator(,) ident(val)operator(\)) - instance_variable(@config)operator([)ident(key)operator(]) operator(=) ident(val) - reserved(end) - - comment(#) - comment(# srcdir/objdir (works only in the package directory\)) - comment(#) - - comment(#abstract srcdir_root) - comment(#abstract objdir_root) - comment(#abstract relpath) - - reserved(def) method(curr_srcdir) - stringcontent(/)inlinedelimiter(")> - reserved(end) - - reserved(def) method(curr_objdir) - stringcontent(/)inlinedelimiter(")> - reserved(end) - - reserved(def) method(srcfile)operator(()ident(path)operator(\)) - stringcontent(/)inlinedelimiter(")> - reserved(end) - - reserved(def) method(srcexist?)operator(()ident(path)operator(\)) - constant(File)operator(.)ident(exist?)operator(()ident(srcfile)operator(()ident(path)operator(\))operator(\)) - reserved(end) - - reserved(def) method(srcdirectory?)operator(()ident(path)operator(\)) - constant(File)operator(.)ident(dir?)operator(()ident(srcfile)operator(()ident(path)operator(\))operator(\)) - reserved(end) - - reserved(def) method(srcfile?)operator(()ident(path)operator(\)) - constant(File)operator(.)ident(file?) ident(srcfile)operator(()ident(path)operator(\)) - reserved(end) - - reserved(def) method(srcentries)operator(()ident(path) operator(=) stringoperator(\)) - constant(Dir)operator(.)ident(open)operator(()stringcontent(/)inlinedelimiter(")>operator(\)) operator({)operator(|)ident(d)operator(|) - reserved(return) ident(d)operator(.)ident(to_a) operator(-) string - operator(}) - reserved(end) - - reserved(def) method(srcfiles)operator(()ident(path) operator(=) stringoperator(\)) - ident(srcentries)operator(()ident(path)operator(\))operator(.)ident(select) operator({)operator(|)ident(fname)operator(|) - constant(File)operator(.)ident(file?)operator(()constant(File)operator(.)ident(join)operator(()ident(curr_srcdir)operator(()operator(\))operator(,) ident(path)operator(,) ident(fname)operator(\))operator(\)) - operator(}) - reserved(end) - - reserved(def) method(srcdirectories)operator(()ident(path) operator(=) stringoperator(\)) - ident(srcentries)operator(()ident(path)operator(\))operator(.)ident(select) operator({)operator(|)ident(fname)operator(|) - constant(File)operator(.)ident(dir?)operator(()constant(File)operator(.)ident(join)operator(()ident(curr_srcdir)operator(()operator(\))operator(,) ident(path)operator(,) ident(fname)operator(\))operator(\)) - operator(}) - reserved(end) - -reserved(end) - - -reserved(class) class(ToplevelInstaller) - - constant(Version) operator(=) string - constant(Copyright) operator(=) string - - constant(TASKS) operator(=) operator([) - operator([) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,)string operator(]) - operator(]) - - reserved(def) constant(ToplevelInstaller)operator(.)method(invoke) - ident(instance)operator(()operator(\))operator(.)ident(invoke) - reserved(end) - - instance_variable(@singleton) operator(=) pre_constant(nil) - - reserved(def) constant(ToplevelInstaller)operator(.)method(instance) - instance_variable(@singleton) operator(||=) ident(new)operator(()constant(File)operator(.)ident(dirname)operator(()global_variable($0)operator(\))operator(\)) - instance_variable(@singleton) - reserved(end) - - ident(include) constant(MetaConfigAPI) - - reserved(def) method(initialize)operator(()ident(ardir_root)operator(\)) - instance_variable(@config) operator(=) pre_constant(nil) - instance_variable(@options) operator(=) operator({) string operator(=)operator(>) pre_constant(true) operator(}) - instance_variable(@ardir) operator(=) constant(File)operator(.)ident(expand_path)operator(()ident(ardir_root)operator(\)) - reserved(end) - - reserved(def) method(inspect) - stringcontent( )inlinecontent(>)delimiter(")> - reserved(end) - - reserved(def) method(invoke) - ident(run_metaconfigs) - reserved(case) ident(task) operator(=) ident(parsearg_global)operator(()operator(\)) - reserved(when) pre_constant(nil)operator(,) string - instance_variable(@config) operator(=) ident(load_config)operator(()stringoperator(\)) - ident(parsearg_config) - ident(init_installers) - ident(exec_config) - ident(exec_setup) - ident(exec_install) - reserved(else) - instance_variable(@config) operator(=) ident(load_config)operator(()ident(task)operator(\)) - ident(__send__) stringdelimiter(")> - ident(init_installers) - ident(__send__) stringdelimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(run_metaconfigs) - ident(eval_file_ifexist) stringcontent(/metaconfig)delimiter(")> - reserved(end) - - reserved(def) method(load_config)operator(()ident(task)operator(\)) - reserved(case) ident(task) - reserved(when) string - constant(ConfigTable)operator(.)ident(new) - reserved(when) stringoperator(,) string - reserved(if) constant(File)operator(.)ident(exist?)operator(()constant(ConfigTable)operator(.)ident(savefile)operator(\)) - reserved(then) constant(ConfigTable)operator(.)ident(load) - reserved(else) constant(ConfigTable)operator(.)ident(new) - reserved(end) - reserved(else) - constant(ConfigTable)operator(.)ident(load) - reserved(end) - reserved(end) - - reserved(def) method(init_installers) - instance_variable(@installer) operator(=) constant(Installer)operator(.)ident(new)operator(()instance_variable(@config)operator(,) instance_variable(@options)operator(,) instance_variable(@ardir)operator(,) constant(File)operator(.)ident(expand_path)operator(()stringoperator(\))operator(\)) - reserved(end) - - comment(#) - comment(# Hook Script API bases) - comment(#) - - reserved(def) method(srcdir_root) - instance_variable(@ardir) - reserved(end) - - reserved(def) method(objdir_root) - string - reserved(end) - - reserved(def) method(relpath) - string - reserved(end) - - comment(#) - comment(# Option Parsing) - comment(#) - - reserved(def) method(parsearg_global) - ident(valid_task) operator(=) regexpinline_delimiter(})>content(\))char(\\z)delimiter(/)> - - reserved(while) ident(arg) operator(=) pre_constant(ARGV)operator(.)ident(shift) - reserved(case) ident(arg) - reserved(when) regexp - ident(setup_rb_error) stringdelimiter(")> reserved(unless) ident(valid_task) operator(=)operator(~) ident(arg) - reserved(return) ident(arg) - - reserved(when) stringoperator(,) string - instance_variable(@options)operator([)stringoperator(]) operator(=) pre_constant(false) - - reserved(when) string - instance_variable(@options)operator([)stringoperator(]) operator(=) pre_constant(true) - - reserved(when) stringoperator(,) string - ident(print_usage) global_variable($stdout) - ident(exit) integer(0) - - reserved(when) stringoperator(,) string - ident(puts) stringcontent( version )inlinedelimiter(")> - ident(exit) integer(0) - - reserved(when) string - ident(puts) constant(Copyright) - ident(exit) integer(0) - - reserved(else) - ident(setup_rb_error) stringcontent(')delimiter(")> - reserved(end) - reserved(end) - - pre_constant(nil) - reserved(end) - - - reserved(def) method(parsearg_no_options) - reserved(unless) pre_constant(ARGV)operator(.)ident(empty?) - ident(setup_rb_error) stringcontent(: unknown options: )inlineinline_delimiter(})>delimiter(")> - reserved(end) - reserved(end) - - reserved(alias) method(parsearg_show) method(parsearg_no_options) - reserved(alias) method(parsearg_setup) method(parsearg_no_options) - reserved(alias) method(parsearg_clean) method(parsearg_no_options) - reserved(alias) method(parsearg_distclean) method(parsearg_no_options) - - reserved(def) method(parsearg_config) - ident(re) operator(=) regexpoperator(\))inline_delimiter(})>content(\)(?:=(.*\)\)?)char(\\z)delimiter(/)> - instance_variable(@options)operator([)stringoperator(]) operator(=) operator([)operator(]) - - reserved(while) ident(i) operator(=) pre_constant(ARGV)operator(.)ident(shift) - reserved(if) regexp operator(=)operator(~) ident(i) - instance_variable(@options)operator([)stringoperator(]) operator(=) pre_constant(ARGV)operator(.)ident(dup) - reserved(break) - reserved(end) - ident(m) operator(=) ident(re)operator(.)ident(match)operator(()ident(i)operator(\)) reserved(or) ident(setup_rb_error) stringdelimiter(")> - ident(name)operator(,) ident(value) operator(=) operator(*)ident(m)operator(.)ident(to_a)operator([)integer(1)operator(,)integer(2)operator(]) - instance_variable(@config)operator([)ident(name)operator(]) operator(=) ident(value) - reserved(end) - reserved(end) - - reserved(def) method(parsearg_install) - instance_variable(@options)operator([)stringoperator(]) operator(=) pre_constant(false) - instance_variable(@options)operator([)stringoperator(]) operator(=) string - reserved(while) ident(a) operator(=) pre_constant(ARGV)operator(.)ident(shift) - reserved(case) ident(a) - reserved(when) regexp - instance_variable(@options)operator([)stringoperator(]) operator(=) pre_constant(true) - reserved(when) regexp - ident(path) operator(=) global_variable($1) - ident(path) operator(=) constant(File)operator(.)ident(expand_path)operator(()ident(path)operator(\)) reserved(unless) ident(path)operator([)integer(0)operator(,)integer(1)operator(]) operator(==) string - instance_variable(@options)operator([)stringoperator(]) operator(=) ident(path) - reserved(else) - ident(setup_rb_error) stringdelimiter(")> - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(print_usage)operator(()ident(out)operator(\)) - ident(out)operator(.)ident(puts) string - ident(out)operator(.)ident(puts) stringcontent( config)delimiter(")> - ident(out)operator(.)ident(puts) stringcontent( setup)delimiter(")> - ident(out)operator(.)ident(puts) stringcontent( install (may require root privilege\))delimiter(")> - ident(out)operator(.)ident(puts) - ident(out)operator(.)ident(puts) string - ident(out)operator(.)ident(puts) stringcontent( )delimiter(")> - ident(out)operator(.)ident(puts) stringcontent( [] [])delimiter(")> - - ident(fmt) operator(=) string - ident(out)operator(.)ident(puts) - ident(out)operator(.)ident(puts) string - ident(out)operator(.)ident(printf) ident(fmt)operator(,) stringoperator(,) string - ident(out)operator(.)ident(printf) ident(fmt)operator(,) stringoperator(,) string - ident(out)operator(.)ident(printf) ident(fmt)operator(,) stringoperator(,) string - ident(out)operator(.)ident(printf) ident(fmt)operator(,) stringoperator(,) string - ident(out)operator(.)ident(printf) ident(fmt)operator(,) stringoperator(,) string - ident(out)operator(.)ident(puts) - ident(out)operator(.)ident(puts) string - constant(TASKS)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(desc)operator(|) - ident(out)operator(.)ident(printf) ident(fmt)operator(,) ident(name)operator(,) ident(desc) - reserved(end) - - ident(fmt) operator(=) string - ident(out)operator(.)ident(puts) - ident(out)operator(.)ident(puts) string - constant(ConfigTable)operator(.)ident(each) reserved(do) operator(|)ident(item)operator(|) - ident(out)operator(.)ident(printf) ident(fmt)operator(,) ident(item)operator(.)ident(help_opt)operator(,) ident(item)operator(.)ident(description)operator(,) ident(item)operator(.)ident(help_default) - reserved(end) - ident(out)operator(.)ident(printf) ident(fmt)operator(,) stringoperator(,) stringoperator(,)string - ident(out)operator(.)ident(puts) - ident(out)operator(.)ident(puts) string - ident(out)operator(.)ident(printf) ident(fmt)operator(,) stringoperator(,) stringoperator(,) string - ident(out)operator(.)ident(printf) ident(fmt)operator(,) stringoperator(,) stringoperator(,) string - ident(out)operator(.)ident(puts) - reserved(end) - - comment(#) - comment(# Task Handlers) - comment(#) - - reserved(def) method(exec_config) - instance_variable(@installer)operator(.)ident(exec_config) - instance_variable(@config)operator(.)ident(save) comment(# must be final) - reserved(end) - - reserved(def) method(exec_setup) - instance_variable(@installer)operator(.)ident(exec_setup) - reserved(end) - - reserved(def) method(exec_install) - instance_variable(@installer)operator(.)ident(exec_install) - reserved(end) - - reserved(def) method(exec_show) - constant(ConfigTable)operator(.)ident(each) reserved(do) operator(|)ident(i)operator(|) - ident(printf) stringoperator(,) ident(i)operator(.)ident(name)operator(,) ident(i)operator(.)ident(value) - reserved(end) - reserved(end) - - reserved(def) method(exec_clean) - instance_variable(@installer)operator(.)ident(exec_clean) - reserved(end) - - reserved(def) method(exec_distclean) - instance_variable(@installer)operator(.)ident(exec_distclean) - reserved(end) - -reserved(end) - - -reserved(class) class(ToplevelInstallerMulti) operator(<) constant(ToplevelInstaller) - - ident(include) constant(HookUtils) - ident(include) constant(HookScriptAPI) - ident(include) constant(FileOperations) - - reserved(def) method(initialize)operator(()ident(ardir)operator(\)) - reserved(super) - instance_variable(@packages) operator(=) ident(all_dirs_in)operator(()stringcontent(/packages)delimiter(")>operator(\)) - ident(raise) string reserved(if) instance_variable(@packages)operator(.)ident(empty?) - reserved(end) - - reserved(def) method(run_metaconfigs) - ident(eval_file_ifexist) stringcontent(/metaconfig)delimiter(")> - instance_variable(@packages)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - ident(eval_file_ifexist) stringcontent(/packages/)inlinecontent(/metaconfig)delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(init_installers) - instance_variable(@installers) operator(=) operator({)operator(}) - instance_variable(@packages)operator(.)ident(each) reserved(do) operator(|)ident(pack)operator(|) - instance_variable(@installers)operator([)ident(pack)operator(]) operator(=) constant(Installer)operator(.)ident(new)operator(()instance_variable(@config)operator(,) instance_variable(@options)operator(,) - stringcontent(/packages/)inlinedelimiter(")>operator(,) - stringdelimiter(")>operator(\)) - reserved(end) - - ident(with) operator(=) ident(extract_selection)operator(()ident(config)operator(()stringoperator(\))operator(\)) - ident(without) operator(=) ident(extract_selection)operator(()ident(config)operator(()stringoperator(\))operator(\)) - instance_variable(@selected) operator(=) instance_variable(@installers)operator(.)ident(keys)operator(.)ident(select) operator({)operator(|)ident(name)operator(|) - operator(()ident(with)operator(.)ident(empty?) reserved(or) ident(with)operator(.)ident(include?)operator(()ident(name)operator(\))operator(\)) \ - reserved(and) reserved(not) ident(without)operator(.)ident(include?)operator(()ident(name)operator(\)) - operator(}) - reserved(end) - - reserved(def) method(extract_selection)operator(()ident(list)operator(\)) - ident(a) operator(=) ident(list)operator(.)ident(split)operator(()regexpoperator(\)) - ident(a)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - ident(setup_rb_error) stringdelimiter(")> reserved(unless) instance_variable(@installers)operator(.)ident(key?)operator(()ident(name)operator(\)) - reserved(end) - ident(a) - reserved(end) - - reserved(def) method(print_usage)operator(()ident(f)operator(\)) - reserved(super) - ident(f)operator(.)ident(puts) string - ident(f)operator(.)ident(puts) string operator(+) instance_variable(@packages)operator(.)ident(sort)operator(.)ident(join)operator(()stringoperator(\)) - ident(f)operator(.)ident(puts) - reserved(end) - - comment(#) - comment(# multi-package metaconfig API) - comment(#) - - ident(attr_reader) symbol(:packages) - - reserved(def) method(declare_packages)operator(()ident(list)operator(\)) - ident(raise) string reserved(if) ident(list)operator(.)ident(empty?) - ident(list)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - ident(raise) stringcontent( does not exist)delimiter(")>\ - reserved(unless) constant(File)operator(.)ident(dir?)operator(()stringcontent(/packages/)inlinedelimiter(")>operator(\)) - reserved(end) - instance_variable(@packages) operator(=) ident(list) - reserved(end) - - comment(#) - comment(# Task Handlers) - comment(#) - - reserved(def) method(exec_config) - ident(run_hook) string - ident(each_selected_installers) operator({)operator(|)ident(inst)operator(|) ident(inst)operator(.)ident(exec_config) operator(}) - ident(run_hook) string - instance_variable(@config)operator(.)ident(save) comment(# must be final) - reserved(end) - - reserved(def) method(exec_setup) - ident(run_hook) string - ident(each_selected_installers) operator({)operator(|)ident(inst)operator(|) ident(inst)operator(.)ident(exec_setup) operator(}) - ident(run_hook) string - reserved(end) - - reserved(def) method(exec_install) - ident(run_hook) string - ident(each_selected_installers) operator({)operator(|)ident(inst)operator(|) ident(inst)operator(.)ident(exec_install) operator(}) - ident(run_hook) string - reserved(end) - - reserved(def) method(exec_clean) - ident(rm_f) constant(ConfigTable)operator(.)ident(savefile) - ident(run_hook) string - ident(each_selected_installers) operator({)operator(|)ident(inst)operator(|) ident(inst)operator(.)ident(exec_clean) operator(}) - ident(run_hook) string - reserved(end) - - reserved(def) method(exec_distclean) - ident(rm_f) constant(ConfigTable)operator(.)ident(savefile) - ident(run_hook) string - ident(each_selected_installers) operator({)operator(|)ident(inst)operator(|) ident(inst)operator(.)ident(exec_distclean) operator(}) - ident(run_hook) string - reserved(end) - - comment(#) - comment(# lib) - comment(#) - - reserved(def) method(each_selected_installers) - constant(Dir)operator(.)ident(mkdir) string reserved(unless) constant(File)operator(.)ident(dir?)operator(()stringoperator(\)) - instance_variable(@selected)operator(.)ident(each) reserved(do) operator(|)ident(pack)operator(|) - global_variable($stderr)operator(.)ident(puts) stringcontent(' ...)delimiter(")> reserved(if) instance_variable(@options)operator([)stringoperator(]) - constant(Dir)operator(.)ident(mkdir) stringdelimiter(")> reserved(unless) constant(File)operator(.)ident(dir?)operator(()stringdelimiter(")>operator(\)) - constant(Dir)operator(.)ident(chdir) stringdelimiter(")> - reserved(yield) instance_variable(@installers)operator([)ident(pack)operator(]) - constant(Dir)operator(.)ident(chdir) string - reserved(end) - reserved(end) - - reserved(def) method(verbose?) - instance_variable(@options)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(no_harm?) - instance_variable(@options)operator([)stringoperator(]) - reserved(end) - -reserved(end) - - -reserved(class) class(Installer) - - constant(FILETYPES) operator(=) string - - ident(include) constant(HookScriptAPI) - ident(include) constant(HookUtils) - ident(include) constant(FileOperations) - - reserved(def) method(initialize)operator(()ident(config)operator(,) ident(opt)operator(,) ident(srcroot)operator(,) ident(objroot)operator(\)) - instance_variable(@config) operator(=) ident(config) - instance_variable(@options) operator(=) ident(opt) - instance_variable(@srcdir) operator(=) constant(File)operator(.)ident(expand_path)operator(()ident(srcroot)operator(\)) - instance_variable(@objdir) operator(=) constant(File)operator(.)ident(expand_path)operator(()ident(objroot)operator(\)) - instance_variable(@currdir) operator(=) string - reserved(end) - - reserved(def) method(inspect) - stringcontent( )inlinecontent(>)delimiter(")> - reserved(end) - - comment(#) - comment(# Hook Script API base methods) - comment(#) - - reserved(def) method(srcdir_root) - instance_variable(@srcdir) - reserved(end) - - reserved(def) method(objdir_root) - instance_variable(@objdir) - reserved(end) - - reserved(def) method(relpath) - instance_variable(@currdir) - reserved(end) - - comment(#) - comment(# configs/options) - comment(#) - - reserved(def) method(no_harm?) - instance_variable(@options)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(verbose?) - instance_variable(@options)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(verbose_off) - reserved(begin) - ident(save)operator(,) instance_variable(@options)operator([)stringoperator(]) operator(=) instance_variable(@options)operator([)stringoperator(])operator(,) pre_constant(false) - reserved(yield) - reserved(ensure) - instance_variable(@options)operator([)stringoperator(]) operator(=) ident(save) - reserved(end) - reserved(end) - - comment(#) - comment(# TASK config) - comment(#) - - reserved(def) method(exec_config) - ident(exec_task_traverse) string - reserved(end) - - reserved(def) method(config_dir_bin)operator(()ident(rel)operator(\)) - reserved(end) - - reserved(def) method(config_dir_lib)operator(()ident(rel)operator(\)) - reserved(end) - - reserved(def) method(config_dir_ext)operator(()ident(rel)operator(\)) - ident(extconf) reserved(if) ident(extdir?)operator(()ident(curr_srcdir)operator(()operator(\))operator(\)) - reserved(end) - - reserved(def) method(extconf) - ident(opt) operator(=) instance_variable(@options)operator([)stringoperator(])operator(.)ident(join)operator(()stringoperator(\)) - ident(command) stringoperator(\))inline_delimiter(})>content( )inlinecontent(/extconf.rb )inlinedelimiter(")> - reserved(end) - - reserved(def) method(config_dir_data)operator(()ident(rel)operator(\)) - reserved(end) - - comment(#) - comment(# TASK setup) - comment(#) - - reserved(def) method(exec_setup) - ident(exec_task_traverse) string - reserved(end) - - reserved(def) method(setup_dir_bin)operator(()ident(rel)operator(\)) - ident(all_files_in)operator(()ident(curr_srcdir)operator(()operator(\))operator(\))operator(.)ident(each) reserved(do) operator(|)ident(fname)operator(|) - ident(adjust_shebang) stringcontent(/)inlinedelimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(adjust_shebang)operator(()ident(path)operator(\)) - reserved(return) reserved(if) ident(no_harm?) - ident(tmpfile) operator(=) constant(File)operator(.)ident(basename)operator(()ident(path)operator(\)) operator(+) string - reserved(begin) - constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) operator({)operator(|)ident(r)operator(|) - ident(first) operator(=) ident(r)operator(.)ident(gets) - reserved(return) reserved(unless) constant(File)operator(.)ident(basename)operator(()ident(config)operator(()stringoperator(\))operator(\)) operator(==) string - reserved(return) reserved(unless) constant(File)operator(.)ident(basename)operator(()ident(first)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(split)operator([)integer(0)operator(])operator(\)) operator(==) string - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> reserved(if) ident(verbose?) - constant(File)operator(.)ident(open)operator(()ident(tmpfile)operator(,) stringoperator(\)) operator({)operator(|)ident(w)operator(|) - ident(w)operator(.)ident(print) ident(first)operator(.)ident(sub)operator(()regexpoperator(,) string operator(+) ident(config)operator(()stringoperator(\))operator(\)) - ident(w)operator(.)ident(write) ident(r)operator(.)ident(read) - operator(}) - ident(move_file) ident(tmpfile)operator(,) constant(File)operator(.)ident(basename)operator(()ident(path)operator(\)) - operator(}) - reserved(ensure) - constant(File)operator(.)ident(unlink) ident(tmpfile) reserved(if) constant(File)operator(.)ident(exist?)operator(()ident(tmpfile)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(setup_dir_lib)operator(()ident(rel)operator(\)) - reserved(end) - - reserved(def) method(setup_dir_ext)operator(()ident(rel)operator(\)) - ident(make) reserved(if) ident(extdir?)operator(()ident(curr_srcdir)operator(()operator(\))operator(\)) - reserved(end) - - reserved(def) method(setup_dir_data)operator(()ident(rel)operator(\)) - reserved(end) - - comment(#) - comment(# TASK install) - comment(#) - - reserved(def) method(exec_install) - ident(rm_f) string - ident(exec_task_traverse) string - reserved(end) - - reserved(def) method(install_dir_bin)operator(()ident(rel)operator(\)) - ident(install_files) ident(collect_filenames_auto)operator(()operator(\))operator(,) stringoperator(\))inline_delimiter(})>content(/)inlinedelimiter(")>operator(,) integer(0755) - reserved(end) - - reserved(def) method(install_dir_lib)operator(()ident(rel)operator(\)) - ident(install_files) ident(ruby_scripts)operator(()operator(\))operator(,) stringoperator(\))inline_delimiter(})>content(/)inlinedelimiter(")>operator(,) integer(0644) - reserved(end) - - reserved(def) method(install_dir_ext)operator(()ident(rel)operator(\)) - reserved(return) reserved(unless) ident(extdir?)operator(()ident(curr_srcdir)operator(()operator(\))operator(\)) - ident(install_files) ident(ruby_extentions)operator(()stringoperator(\))operator(,) - stringoperator(\))inline_delimiter(})>content(/)inlinedelimiter(")>operator(,) - integer(0555) - reserved(end) - - reserved(def) method(install_dir_data)operator(()ident(rel)operator(\)) - ident(install_files) ident(collect_filenames_auto)operator(()operator(\))operator(,) stringoperator(\))inline_delimiter(})>content(/)inlinedelimiter(")>operator(,) integer(0644) - reserved(end) - - reserved(def) method(install_files)operator(()ident(list)operator(,) ident(dest)operator(,) ident(mode)operator(\)) - ident(mkdir_p) ident(dest)operator(,) instance_variable(@options)operator([)stringoperator(]) - ident(list)operator(.)ident(each) reserved(do) operator(|)ident(fname)operator(|) - ident(install) ident(fname)operator(,) ident(dest)operator(,) ident(mode)operator(,) instance_variable(@options)operator([)stringoperator(]) - reserved(end) - reserved(end) - - reserved(def) method(ruby_scripts) - ident(collect_filenames_auto)operator(()operator(\))operator(.)ident(select) operator({)operator(|)ident(n)operator(|) regexp operator(=)operator(~) ident(n) operator(}) - reserved(end) - - comment(# picked up many entries from cvs-1.11.1/src/ignore.c) - ident(reject_patterns) operator(=) string - ident(mapping) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) string - operator(}) - constant(REJECT_PATTERNS) operator(=) constant(Regexp)operator(.)ident(new)operator(()string operator(+) - ident(reject_patterns)operator(.)ident(map) operator({)operator(|)ident(pat)operator(|) - ident(pat)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({)operator(|)ident(ch)operator(|) ident(mapping)operator([)ident(ch)operator(]) operator(}) - operator(})operator(.)ident(join)operator(()stringoperator(\)) operator(+) - stringoperator(\)) - - reserved(def) method(collect_filenames_auto) - ident(mapdir)operator(()operator(()ident(existfiles)operator(()operator(\)) operator(-) ident(hookfiles)operator(()operator(\))operator(\))operator(.)ident(reject) operator({)operator(|)ident(fname)operator(|) - constant(REJECT_PATTERNS) operator(=)operator(~) ident(fname) - operator(})operator(\)) - reserved(end) - - reserved(def) method(existfiles) - ident(all_files_in)operator(()ident(curr_srcdir)operator(()operator(\))operator(\)) operator(|) ident(all_files_in)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(hookfiles) - stringoperator(.)ident(map) operator({)operator(|)ident(fmt)operator(|) - stringoperator(.)ident(map) operator({)operator(|)ident(t)operator(|) ident(sprintf)operator(()ident(fmt)operator(,) ident(t)operator(\)) operator(}) - operator(})operator(.)ident(flatten) - reserved(end) - - reserved(def) method(mapdir)operator(()ident(filelist)operator(\)) - ident(filelist)operator(.)ident(map) operator({)operator(|)ident(fname)operator(|) - reserved(if) constant(File)operator(.)ident(exist?)operator(()ident(fname)operator(\)) comment(# objdir) - ident(fname) - reserved(else) comment(# srcdir) - constant(File)operator(.)ident(join)operator(()ident(curr_srcdir)operator(()operator(\))operator(,) ident(fname)operator(\)) - reserved(end) - operator(}) - reserved(end) - - reserved(def) method(ruby_extentions)operator(()ident(dir)operator(\)) - constant(Dir)operator(.)ident(open)operator(()ident(dir)operator(\)) operator({)operator(|)ident(d)operator(|) - ident(ents) operator(=) ident(d)operator(.)ident(select) operator({)operator(|)ident(fname)operator(|) regexpoperator(])inline_delimiter(})>char(\\z)delimiter(/)> operator(=)operator(~) ident(fname) operator(}) - reserved(if) ident(ents)operator(.)ident(empty?) - ident(setup_rb_error) stringcontent( setup' first)delimiter(")> - reserved(end) - reserved(return) ident(ents) - operator(}) - reserved(end) - - comment(#) - comment(# TASK clean) - comment(#) - - reserved(def) method(exec_clean) - ident(exec_task_traverse) string - ident(rm_f) constant(ConfigTable)operator(.)ident(savefile) - ident(rm_f) string - reserved(end) - - reserved(def) method(clean_dir_bin)operator(()ident(rel)operator(\)) - reserved(end) - - reserved(def) method(clean_dir_lib)operator(()ident(rel)operator(\)) - reserved(end) - - reserved(def) method(clean_dir_ext)operator(()ident(rel)operator(\)) - reserved(return) reserved(unless) ident(extdir?)operator(()ident(curr_srcdir)operator(()operator(\))operator(\)) - ident(make) string reserved(if) constant(File)operator(.)ident(file?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(clean_dir_data)operator(()ident(rel)operator(\)) - reserved(end) - - comment(#) - comment(# TASK distclean) - comment(#) - - reserved(def) method(exec_distclean) - ident(exec_task_traverse) string - ident(rm_f) constant(ConfigTable)operator(.)ident(savefile) - ident(rm_f) string - reserved(end) - - reserved(def) method(distclean_dir_bin)operator(()ident(rel)operator(\)) - reserved(end) - - reserved(def) method(distclean_dir_lib)operator(()ident(rel)operator(\)) - reserved(end) - - reserved(def) method(distclean_dir_ext)operator(()ident(rel)operator(\)) - reserved(return) reserved(unless) ident(extdir?)operator(()ident(curr_srcdir)operator(()operator(\))operator(\)) - ident(make) string reserved(if) constant(File)operator(.)ident(file?)operator(()stringoperator(\)) - reserved(end) - - comment(#) - comment(# lib) - comment(#) - - reserved(def) method(exec_task_traverse)operator(()ident(task)operator(\)) - ident(run_hook) stringdelimiter(")> - constant(FILETYPES)operator(.)ident(each) reserved(do) operator(|)ident(type)operator(|) - reserved(if) ident(config)operator(()stringoperator(\)) operator(==) string reserved(and) ident(type) operator(==) string - global_variable($stderr)operator(.)ident(puts) string reserved(if) ident(verbose?) - reserved(next) - reserved(end) - ident(traverse) ident(task)operator(,) ident(type)operator(,) stringcontent(_dir_)inlinedelimiter(")> - reserved(end) - ident(run_hook) stringdelimiter(")> - reserved(end) - - reserved(def) method(traverse)operator(()ident(task)operator(,) ident(rel)operator(,) ident(mid)operator(\)) - ident(dive_into)operator(()ident(rel)operator(\)) operator({) - ident(run_hook) stringdelimiter(")> - ident(__send__) ident(mid)operator(,) ident(rel)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - ident(all_dirs_in)operator(()ident(curr_srcdir)operator(()operator(\))operator(\))operator(.)ident(each) reserved(do) operator(|)ident(d)operator(|) - ident(traverse) ident(task)operator(,) stringcontent(/)inlinedelimiter(")>operator(,) ident(mid) - reserved(end) - ident(run_hook) stringdelimiter(")> - operator(}) - reserved(end) - - reserved(def) method(dive_into)operator(()ident(rel)operator(\)) - reserved(return) reserved(unless) constant(File)operator(.)ident(dir?)operator(()stringcontent(/)inlinedelimiter(")>operator(\)) - - ident(dir) operator(=) constant(File)operator(.)ident(basename)operator(()ident(rel)operator(\)) - constant(Dir)operator(.)ident(mkdir) ident(dir) reserved(unless) constant(File)operator(.)ident(dir?)operator(()ident(dir)operator(\)) - ident(prevdir) operator(=) constant(Dir)operator(.)ident(pwd) - constant(Dir)operator(.)ident(chdir) ident(dir) - global_variable($stderr)operator(.)ident(puts) string )delimiter(')> operator(+) ident(rel) reserved(if) ident(verbose?) - instance_variable(@currdir) operator(=) ident(rel) - reserved(yield) - constant(Dir)operator(.)ident(chdir) ident(prevdir) - global_variable($stderr)operator(.)ident(puts) string operator(+) ident(rel) reserved(if) ident(verbose?) - instance_variable(@currdir) operator(=) constant(File)operator(.)ident(dirname)operator(()ident(rel)operator(\)) - reserved(end) - -reserved(end) - - -reserved(if) global_variable($0) operator(==) pre_constant(__FILE__) - reserved(begin) - reserved(if) ident(multipackage_install?) - constant(ToplevelInstallerMulti)operator(.)ident(invoke) - reserved(else) - constant(ToplevelInstaller)operator(.)ident(invoke) - reserved(end) - reserved(rescue) constant(SetupError) - ident(raise) reserved(if) global_variable($DEBUG) - global_variable($stderr)operator(.)ident(puts) global_variable($!)operator(.)ident(message) - global_variable($stderr)operator(.)ident(puts) stringcontent( --help' for detailed usage.)delimiter(")> - ident(exit) integer(1) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ClientTest) - reserved(class) class(Person) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:firstnames)operator(,) operator([)symbol(:string)operator(]) - ident(member) symbol(:lastname)operator(,) symbol(:string) - - reserved(def) method(==)operator(()ident(other)operator(\)) - ident(firstnames) operator(==) ident(other)operator(.)ident(firstnames) operator(&&) ident(lastname) operator(==) ident(other)operator(.)ident(lastname) - reserved(end) - reserved(end) - - reserved(class) class(Inner) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:name)operator(,) symbol(:string) - reserved(end) - - reserved(class) class(Outer) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:name)operator(,) symbol(:string) - ident(member) symbol(:inner)operator(,) constant(Inner) - reserved(end) - - reserved(class) class(User) operator(<) constant(ActiveRecord)operator(::)constant(Base) - reserved(end) - - reserved(module) class(Accounting) - reserved(class) class(User) operator(<) constant(ActiveRecord)operator(::)constant(Base) - reserved(end) - reserved(end) - - reserved(class) class(WithModel) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:user)operator(,) constant(User) - ident(member) symbol(:users)operator(,) operator([)constant(User)operator(]) - reserved(end) - - reserved(class) class(WithMultiDimArray) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:pref)operator(,) operator([)operator([)symbol(:string)operator(])operator(]) - reserved(end) - - reserved(class) class(API) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(api_method) symbol(:void) - ident(api_method) symbol(:normal)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:int)operator(,) symbol(:int)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:int)operator(]) - ident(api_method) symbol(:array_return)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)constant(Person)operator(])operator(]) - ident(api_method) symbol(:struct_pass)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator([)constant(Person)operator(])operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:bool)operator(]) - ident(api_method) symbol(:nil_struct_return)operator(,) symbol(:returns) operator(=)operator(>) operator([)constant(Person)operator(]) - ident(api_method) symbol(:inner_nil)operator(,) symbol(:returns) operator(=)operator(>) operator([)constant(Outer)operator(]) - ident(api_method) symbol(:client_container)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:int)operator(]) - ident(api_method) symbol(:named_parameters)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:key)operator(=)operator(>)symbol(:string)operator(})operator(,) operator({)symbol(:id)operator(=)operator(>)symbol(:int)operator(})operator(]) - ident(api_method) symbol(:thrower) - ident(api_method) symbol(:user_return)operator(,) symbol(:returns) operator(=)operator(>) operator([)constant(User)operator(]) - ident(api_method) symbol(:with_model_return)operator(,) symbol(:returns) operator(=)operator(>) operator([)constant(WithModel)operator(]) - ident(api_method) symbol(:scoped_model_return)operator(,) symbol(:returns) operator(=)operator(>) operator([)constant(Accounting)operator(::)constant(User)operator(]) - ident(api_method) symbol(:multi_dim_return)operator(,) symbol(:returns) operator(=)operator(>) operator([)constant(WithMultiDimArray)operator(]) - reserved(end) - - reserved(class) class(NullLogOut) - reserved(def) method(<<)operator(()operator(*)ident(args)operator(\))operator(;) reserved(end) - reserved(end) - - reserved(class) class(Container) operator(<) constant(ActionController)operator(::)constant(Base) - ident(web_service_api) constant(API) - - ident(attr_accessor) symbol(:value_void) - ident(attr_accessor) symbol(:value_normal) - ident(attr_accessor) symbol(:value_array_return) - ident(attr_accessor) symbol(:value_struct_pass) - ident(attr_accessor) symbol(:value_named_parameters) - - reserved(def) method(initialize) - instance_variable(@session) operator(=) instance_variable(@assigns) operator(=) operator({)operator(}) - instance_variable(@value_void) operator(=) pre_constant(nil) - instance_variable(@value_normal) operator(=) pre_constant(nil) - instance_variable(@value_array_return) operator(=) pre_constant(nil) - instance_variable(@value_struct_pass) operator(=) pre_constant(nil) - instance_variable(@value_named_parameters) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(void) - instance_variable(@value_void) operator(=) instance_variable(@method_params) - reserved(end) - - reserved(def) method(normal) - instance_variable(@value_normal) operator(=) instance_variable(@method_params) - integer(5) - reserved(end) - - reserved(def) method(array_return) - ident(person) operator(=) constant(Person)operator(.)ident(new) - ident(person)operator(.)ident(firstnames) operator(=) operator([)stringoperator(,) stringoperator(]) - ident(person)operator(.)ident(lastname) operator(=) string - instance_variable(@value_array_return) operator(=) operator([)ident(person)operator(]) - reserved(end) - - reserved(def) method(struct_pass) - instance_variable(@value_struct_pass) operator(=) instance_variable(@method_params) - pre_constant(true) - reserved(end) - - reserved(def) method(nil_struct_return) - pre_constant(nil) - reserved(end) - - reserved(def) method(inner_nil) - constant(Outer)operator(.)ident(new) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:inner) operator(=)operator(>) pre_constant(nil) - reserved(end) - - reserved(def) method(client_container) - integer(50) - reserved(end) - - reserved(def) method(named_parameters) - instance_variable(@value_named_parameters) operator(=) instance_variable(@method_params) - reserved(end) - - reserved(def) method(thrower) - ident(raise) string - reserved(end) - - reserved(def) method(user_return) - constant(User)operator(.)ident(find)operator(()integer(1)operator(\)) - reserved(end) - - reserved(def) method(with_model_return) - constant(WithModel)operator(.)ident(new) symbol(:user) operator(=)operator(>) constant(User)operator(.)ident(find)operator(()integer(1)operator(\))operator(,) symbol(:users) operator(=)operator(>) constant(User)operator(.)ident(find)operator(()symbol(:all)operator(\)) - reserved(end) - - reserved(def) method(scoped_model_return) - constant(Accounting)operator(::)constant(User)operator(.)ident(find)operator(()integer(1)operator(\)) - reserved(end) - - reserved(def) method(multi_dim_return) - constant(WithMultiDimArray)operator(.)ident(new) symbol(:pref) operator(=)operator(>) operator([)stringoperator(,) stringoperator(]) - reserved(end) - reserved(end) - - reserved(class) class(AbstractClientLet) operator(<) constant(WEBrick)operator(::)constant(HTTPServlet)operator(::)constant(AbstractServlet) - reserved(def) method(initialize)operator(()ident(controller)operator(\)) - instance_variable(@controller) operator(=) ident(controller) - reserved(end) - - reserved(def) method(get_instance)operator(()operator(*)ident(args)operator(\)) - pre_constant(self) - reserved(end) - - reserved(def) method(require_path_info?) - pre_constant(false) - reserved(end) - - reserved(def) method(do_GET)operator(()ident(req)operator(,) ident(res)operator(\)) - ident(raise) constant(WEBrick)operator(::)constant(HTTPStatus)operator(::)constant(MethodNotAllowed)operator(,) string - reserved(end) - - reserved(def) method(do_POST)operator(()ident(req)operator(,) ident(res)operator(\)) - ident(raise) constant(NotImplementedError) - reserved(end) - reserved(end) - - reserved(class) class(AbstractServer) - ident(include) constant(ClientTest) - ident(include) constant(Singleton) - ident(attr) symbol(:container) - reserved(def) method(initialize) - instance_variable(@container) operator(=) constant(Container)operator(.)ident(new) - instance_variable(@clientlet) operator(=) ident(create_clientlet)operator(()instance_variable(@container)operator(\)) - ident(log) operator(=) constant(WEBrick)operator(::)constant(BasicLog)operator(.)ident(new)operator(()constant(NullLogOut)operator(.)ident(new)operator(\)) - instance_variable(@server) operator(=) constant(WEBrick)operator(::)constant(HTTPServer)operator(.)ident(new)operator(()symbol(:Port) operator(=)operator(>) ident(server_port)operator(,) symbol(:Logger) operator(=)operator(>) ident(log)operator(,) symbol(:AccessLog) operator(=)operator(>) ident(log)operator(\)) - instance_variable(@server)operator(.)ident(mount)operator(()stringoperator(,) instance_variable(@clientlet)operator(\)) - instance_variable(@thr) operator(=) constant(Thread)operator(.)ident(new) operator({) instance_variable(@server)operator(.)ident(start) operator(}) - reserved(until) instance_variable(@server)operator(.)ident(status) operator(==) symbol(:Running)operator(;) reserved(end) - ident(at_exit) operator({) instance_variable(@server)operator(.)ident(stop)operator(;) instance_variable(@thr)operator(.)ident(join) operator(}) - reserved(end) - - ident(protected) - reserved(def) method(create_clientlet) - ident(raise) constant(NotImplementedError) - reserved(end) - - reserved(def) method(server_port) - ident(raise) constant(NotImplementedError) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string - -reserved(class) class(ActionController::Base)operator(;) reserved(def) method(rescue_action)operator(()ident(e)operator(\)) ident(raise) ident(e) reserved(end)operator(;) reserved(end) - -reserved(module) class(DispatcherTest) - constant(Utf8String) operator(=) string - constant(WsdlNamespace) operator(=) string - - reserved(class) class(Node) operator(<) constant(ActiveRecord)operator(::)constant(Base) - reserved(def) method(initialize)operator(()operator(*)ident(args)operator(\)) - reserved(super)operator(()operator(*)ident(args)operator(\)) - instance_variable(@new_record) operator(=) pre_constant(false) - reserved(end) - - reserved(class) operator(<<) class(self) - reserved(def) method(name) - string - reserved(end) - - reserved(def) method(columns)operator(()operator(*)ident(args)operator(\)) - operator([) - constant(ActiveRecord)operator(::)constant(ConnectionAdapters)operator(::)constant(Column)operator(.)ident(new)operator(()stringoperator(,) integer(0)operator(,) stringoperator(\))operator(,) - constant(ActiveRecord)operator(::)constant(ConnectionAdapters)operator(::)constant(Column)operator(.)ident(new)operator(()stringoperator(,) pre_constant(nil)operator(,) stringoperator(\))operator(,) - constant(ActiveRecord)operator(::)constant(ConnectionAdapters)operator(::)constant(Column)operator(.)ident(new)operator(()stringoperator(,) pre_constant(nil)operator(,) stringoperator(\))operator(,) - operator(]) - reserved(end) - - reserved(def) method(connection) - pre_constant(self) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(Person) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:id)operator(,) symbol(:int) - ident(member) symbol(:name)operator(,) symbol(:string) - - reserved(def) method(==)operator(()ident(other)operator(\)) - pre_constant(self)operator(.)ident(id) operator(==) ident(other)operator(.)ident(id) operator(&&) pre_constant(self)operator(.)ident(name) operator(==) ident(other)operator(.)ident(name) - reserved(end) - reserved(end) - - reserved(class) class(API) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(api_method) symbol(:add)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:int)operator(,) symbol(:int)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:int)operator(]) - ident(api_method) symbol(:interceptee) - ident(api_method) symbol(:struct_return)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)constant(Node)operator(])operator(]) - ident(api_method) symbol(:void) - reserved(end) - - reserved(class) class(DirectAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(api_method) symbol(:add)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:a)operator(=)operator(>)symbol(:int)operator(})operator(,) operator({)symbol(:b)operator(=)operator(>)symbol(:int)operator(})operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:int)operator(]) - ident(api_method) symbol(:add2)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:a)operator(=)operator(>)symbol(:int)operator(})operator(,) operator({)symbol(:b)operator(=)operator(>)symbol(:int)operator(})operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:int)operator(]) - ident(api_method) symbol(:before_filtered) - ident(api_method) symbol(:after_filtered)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)symbol(:int)operator(])operator(]) - ident(api_method) symbol(:struct_return)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)constant(Node)operator(])operator(]) - ident(api_method) symbol(:struct_pass)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:person) operator(=)operator(>) constant(Person)operator(})operator(]) - ident(api_method) symbol(:base_struct_return)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)constant(Person)operator(])operator(]) - ident(api_method) symbol(:hash_struct_return)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)constant(Person)operator(])operator(]) - ident(api_method) symbol(:thrower) - ident(api_method) symbol(:void) - ident(api_method) symbol(:test_utf8)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(]) - ident(api_method) symbol(:hex)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:base64)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(]) - ident(api_method) symbol(:unhex)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:string)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:base64)operator(]) - ident(api_method) symbol(:time)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:time)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:time)operator(]) - reserved(end) - - reserved(class) class(VirtualAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(default_api_method) symbol(:fallback) - reserved(end) - - reserved(class) class(Service) operator(<) constant(ActionWebService)operator(::)constant(Base) - ident(web_service_api) constant(API) - - ident(before_invocation) symbol(:do_intercept)operator(,) symbol(:only) operator(=)operator(>) operator([)symbol(:interceptee)operator(]) - - ident(attr) symbol(:added) - ident(attr) symbol(:intercepted) - ident(attr) symbol(:void_called) - - reserved(def) method(initialize) - instance_variable(@void_called) operator(=) pre_constant(false) - reserved(end) - - reserved(def) method(add)operator(()ident(a)operator(,) ident(b)operator(\)) - instance_variable(@added) operator(=) ident(a) operator(+) ident(b) - reserved(end) - - reserved(def) method(interceptee) - instance_variable(@intercepted) operator(=) pre_constant(false) - reserved(end) - - reserved(def) method(struct_return) - ident(n1) operator(=) constant(Node)operator(.)ident(new)operator(()string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(n2) operator(=) constant(Node)operator(.)ident(new)operator(()string operator(=)operator(>) integer(2)operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - operator([)ident(n1)operator(,) ident(n2)operator(]) - reserved(end) - - reserved(def) method(void)operator(()operator(*)ident(args)operator(\)) - instance_variable(@void_called) operator(=) ident(args) - reserved(end) - - reserved(def) method(do_intercept)operator(()ident(name)operator(,) ident(args)operator(\)) - operator([)pre_constant(false)operator(,) stringoperator(]) - reserved(end) - reserved(end) - - reserved(class) class(MTAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(inflect_names) pre_constant(false) - ident(api_method) symbol(:getCategories)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)symbol(:string)operator(])operator(]) - ident(api_method) symbol(:bool)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:bool)operator(]) - ident(api_method) symbol(:alwaysFail) - reserved(end) - - reserved(class) class(BloggerAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(inflect_names) pre_constant(false) - ident(api_method) symbol(:getCategories)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)symbol(:string)operator(])operator(]) - ident(api_method) symbol(:str)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:int)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(]) - ident(api_method) symbol(:alwaysFail) - reserved(end) - - reserved(class) class(MTService) operator(<) constant(ActionWebService)operator(::)constant(Base) - ident(web_service_api) constant(MTAPI) - - reserved(def) method(getCategories) - operator([)stringoperator(,) stringoperator(]) - reserved(end) - - reserved(def) method(bool) - string - reserved(end) - - reserved(def) method(alwaysFail) - ident(raise) string - reserved(end) - reserved(end) - - reserved(class) class(BloggerService) operator(<) constant(ActionWebService)operator(::)constant(Base) - ident(web_service_api) constant(BloggerAPI) - - reserved(def) method(getCategories) - operator([)stringoperator(,) stringoperator(]) - reserved(end) - - reserved(def) method(str)operator(()ident(int)operator(\)) - reserved(unless) ident(int)operator(.)ident(is_a?)operator(()constant(Integer)operator(\)) - ident(raise) string - reserved(end) - integer(500) operator(+) ident(int) - reserved(end) - - reserved(def) method(alwaysFail) - ident(raise) string - reserved(end) - reserved(end) - - reserved(class) class(AbstractController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(generate_wsdl) - instance_variable(@request) operator(||=) operator(::)constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - ident(to_wsdl) - reserved(end) - reserved(end) - - reserved(class) class(DelegatedController) operator(<) constant(AbstractController) - ident(web_service_dispatching_mode) symbol(:delegated) - ident(wsdl_namespace) constant(WsdlNamespace) - - ident(web_service)operator(()symbol(:test_service)operator(\)) operator({) instance_variable(@service) operator(||=) constant(Service)operator(.)ident(new)operator(;) instance_variable(@service) operator(}) - reserved(end) - - reserved(class) class(LayeredController) operator(<) constant(AbstractController) - ident(web_service_dispatching_mode) symbol(:layered) - ident(wsdl_namespace) constant(WsdlNamespace) - - ident(web_service)operator(()symbol(:mt)operator(\)) operator({) instance_variable(@mt_service) operator(||=) constant(MTService)operator(.)ident(new)operator(;) instance_variable(@mt_service) operator(}) - ident(web_service)operator(()symbol(:blogger)operator(\)) operator({) instance_variable(@blogger_service) operator(||=) constant(BloggerService)operator(.)ident(new)operator(;) instance_variable(@blogger_service) operator(}) - reserved(end) - - reserved(class) class(DirectController) operator(<) constant(AbstractController) - ident(web_service_api) constant(DirectAPI) - ident(web_service_dispatching_mode) symbol(:direct) - ident(wsdl_namespace) constant(WsdlNamespace) - - ident(before_invocation) symbol(:alwaysfail)operator(,) symbol(:only) operator(=)operator(>) operator([)symbol(:before_filtered)operator(]) - ident(after_invocation) symbol(:alwaysok)operator(,) symbol(:only) operator(=)operator(>) operator([)symbol(:after_filtered)operator(]) - - ident(attr) symbol(:added) - ident(attr) symbol(:added2) - ident(attr) symbol(:before_filter_called) - ident(attr) symbol(:before_filter_target_called) - ident(attr) symbol(:after_filter_called) - ident(attr) symbol(:after_filter_target_called) - ident(attr) symbol(:void_called) - ident(attr) symbol(:struct_pass_value) - - reserved(def) method(initialize) - instance_variable(@before_filter_called) operator(=) pre_constant(false) - instance_variable(@before_filter_target_called) operator(=) pre_constant(false) - instance_variable(@after_filter_called) operator(=) pre_constant(false) - instance_variable(@after_filter_target_called) operator(=) pre_constant(false) - instance_variable(@void_called) operator(=) pre_constant(false) - instance_variable(@struct_pass_value) operator(=) pre_constant(false) - reserved(end) - - reserved(def) method(add) - instance_variable(@added) operator(=) instance_variable(@params)operator([)stringoperator(]) operator(+) instance_variable(@params)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(add2)operator(()ident(a)operator(,) ident(b)operator(\)) - instance_variable(@added2) operator(=) ident(a) operator(+) ident(b) - reserved(end) - - reserved(def) method(before_filtered) - instance_variable(@before_filter_target_called) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(after_filtered) - instance_variable(@after_filter_target_called) operator(=) pre_constant(true) - operator([)integer(5)operator(,) integer(6)operator(,) integer(7)operator(]) - reserved(end) - - reserved(def) method(thrower) - ident(raise) string - reserved(end) - - reserved(def) method(struct_return) - ident(n1) operator(=) constant(Node)operator(.)ident(new)operator(()string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(n2) operator(=) constant(Node)operator(.)ident(new)operator(()string operator(=)operator(>) integer(2)operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - operator([)ident(n1)operator(,) ident(n2)operator(]) - reserved(end) - - reserved(def) method(struct_pass)operator(()ident(person)operator(\)) - instance_variable(@struct_pass_value) operator(=) ident(person) - reserved(end) - - reserved(def) method(base_struct_return) - ident(p1) operator(=) constant(Person)operator(.)ident(new)operator(()string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) stringoperator(\)) - ident(p2) operator(=) constant(Person)operator(.)ident(new)operator(()string operator(=)operator(>) integer(2)operator(,) string operator(=)operator(>) stringoperator(\)) - operator([)ident(p1)operator(,) ident(p2)operator(]) - reserved(end) - - reserved(def) method(hash_struct_return) - ident(p1) operator(=) operator({) symbol(:id) operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(}) - ident(p2) operator(=) operator({) string operator(=)operator(>) stringoperator(,) symbol(:name) operator(=)operator(>) string operator(}) - operator([)ident(p1)operator(,) ident(p2)operator(]) - reserved(end) - - reserved(def) method(void) - instance_variable(@void_called) operator(=) instance_variable(@method_params) - reserved(end) - - reserved(def) method(test_utf8) - constant(Utf8String) - reserved(end) - - reserved(def) method(hex)operator(()ident(s)operator(\)) - reserved(return) ident(s)operator(.)ident(unpack)operator(()stringoperator(\))operator([)integer(0)operator(]) - reserved(end) - - reserved(def) method(unhex)operator(()ident(s)operator(\)) - reserved(return) operator([)ident(s)operator(])operator(.)ident(pack)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(time)operator(()ident(t)operator(\)) - ident(t) - reserved(end) - - ident(protected) - reserved(def) method(alwaysfail)operator(()ident(method_name)operator(,) ident(params)operator(\)) - instance_variable(@before_filter_called) operator(=) pre_constant(true) - pre_constant(false) - reserved(end) - - reserved(def) method(alwaysok)operator(()ident(method_name)operator(,) ident(params)operator(,) ident(return_value)operator(\)) - instance_variable(@after_filter_called) operator(=) pre_constant(true) - reserved(end) - reserved(end) - - reserved(class) class(VirtualController) operator(<) constant(AbstractController) - ident(web_service_api) constant(VirtualAPI) - ident(wsdl_namespace) constant(WsdlNamespace) - - reserved(def) method(fallback) - string - reserved(end) - reserved(end) -reserved(end) - -reserved(module) class(DispatcherCommonTests) - reserved(def) method(test_direct_dispatching) - ident(assert_equal)operator(()integer(70)operator(,) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(,) integer(20)operator(,) integer(50)operator(\))operator(\)) - ident(assert_equal)operator(()integer(70)operator(,) instance_variable(@direct_controller)operator(.)ident(added)operator(\)) - ident(assert_equal)operator(()integer(50)operator(,) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(,) integer(25)operator(,) integer(25)operator(\))operator(\)) - ident(assert_equal)operator(()integer(50)operator(,) instance_variable(@direct_controller)operator(.)ident(added2)operator(\)) - ident(assert)operator(()instance_variable(@direct_controller)operator(.)ident(void_called) operator(==) pre_constant(false)operator(\)) - ident(assert)operator(()ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(\))operator(.)ident(nil?)operator(\)) - ident(assert)operator(()instance_variable(@direct_controller)operator(.)ident(void_called) operator(==) operator([)operator(])operator(\)) - ident(result) operator(=) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(\)) - ident(assert)operator(()ident(result)operator([)integer(0)operator(])operator(.)ident(is_a?)operator(()constant(DispatcherTest)operator(::)constant(Person)operator(\))operator(\)) - ident(assert)operator(()ident(result)operator([)integer(1)operator(])operator(.)ident(is_a?)operator(()constant(DispatcherTest)operator(::)constant(Person)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(,) stringoperator(\))operator(\)) - ident(time) operator(=) constant(Time)operator(.)ident(gm)operator(()integer(1998)operator(,) stringoperator(,) integer(02)operator(,) integer(15)operator(,) integer(12)operator(,) integer(01)operator(\)) - ident(assert_equal)operator(()ident(time)operator(,) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(,) ident(time)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_direct_entrypoint) - ident(assert)operator(()instance_variable(@direct_controller)operator(.)ident(respond_to?)operator(()symbol(:api)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_virtual_dispatching) - ident(assert_equal)operator(()stringoperator(,) ident(do_method_call)operator(()instance_variable(@virtual_controller)operator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(do_method_call)operator(()instance_variable(@virtual_controller)operator(,) stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_direct_filtering) - ident(assert_equal)operator(()pre_constant(false)operator(,) instance_variable(@direct_controller)operator(.)ident(before_filter_called)operator(\)) - ident(assert_equal)operator(()pre_constant(false)operator(,) instance_variable(@direct_controller)operator(.)ident(before_filter_target_called)operator(\)) - ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(\)) - ident(assert_equal)operator(()pre_constant(true)operator(,) instance_variable(@direct_controller)operator(.)ident(before_filter_called)operator(\)) - ident(assert_equal)operator(()pre_constant(false)operator(,) instance_variable(@direct_controller)operator(.)ident(before_filter_target_called)operator(\)) - ident(assert_equal)operator(()pre_constant(false)operator(,) instance_variable(@direct_controller)operator(.)ident(after_filter_called)operator(\)) - ident(assert_equal)operator(()pre_constant(false)operator(,) instance_variable(@direct_controller)operator(.)ident(after_filter_target_called)operator(\)) - ident(assert_equal)operator(()operator([)integer(5)operator(,) integer(6)operator(,) integer(7)operator(])operator(,) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()pre_constant(true)operator(,) instance_variable(@direct_controller)operator(.)ident(after_filter_called)operator(\)) - ident(assert_equal)operator(()pre_constant(true)operator(,) instance_variable(@direct_controller)operator(.)ident(after_filter_target_called)operator(\)) - reserved(end) - - reserved(def) method(test_delegated_dispatching) - ident(assert_equal)operator(()integer(130)operator(,) ident(do_method_call)operator(()instance_variable(@delegated_controller)operator(,) stringoperator(,) integer(50)operator(,) integer(80)operator(\))operator(\)) - ident(service) operator(=) instance_variable(@delegated_controller)operator(.)ident(web_service_object)operator(()symbol(:test_service)operator(\)) - ident(assert_equal)operator(()integer(130)operator(,) ident(service)operator(.)ident(added)operator(\)) - instance_variable(@delegated_controller)operator(.)ident(web_service_exception_reporting) operator(=) pre_constant(true) - ident(assert)operator(()ident(service)operator(.)ident(intercepted)operator(.)ident(nil?)operator(\)) - ident(result) operator(=) ident(do_method_call)operator(()instance_variable(@delegated_controller)operator(,) stringoperator(\)) - ident(assert)operator(()ident(service)operator(.)ident(intercepted)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()ident(is_exception?)operator(()ident(result)operator(\))operator(\)) - ident(assert_match)operator(()regexpoperator(,) ident(exception_message)operator(()ident(result)operator(\))operator(\)) - ident(result) operator(=) ident(do_method_call)operator(()instance_variable(@delegated_controller)operator(,) stringoperator(\)) - ident(assert)operator(()ident(is_exception?)operator(()ident(result)operator(\))operator(\)) - ident(assert_match)operator(()regexpoperator(,) ident(exception_message)operator(()ident(result)operator(\))operator(\)) - ident(assert)operator(()ident(service)operator(.)ident(void_called) operator(==) pre_constant(false)operator(\)) - ident(assert)operator(()ident(do_method_call)operator(()instance_variable(@delegated_controller)operator(,) stringoperator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(\))operator(.)ident(nil?)operator(\)) - ident(assert)operator(()ident(service)operator(.)ident(void_called) operator(==) operator([)operator(])operator(\)) - reserved(end) - - reserved(def) method(test_garbage_request) - operator([)instance_variable(@direct_controller)operator(,) instance_variable(@delegated_controller)operator(])operator(.)ident(each) reserved(do) operator(|)ident(controller)operator(|) - ident(controller)operator(.)ident(class)operator(.)ident(web_service_exception_reporting) operator(=) pre_constant(true) - ident(send_garbage_request) operator(=) ident(lambda) reserved(do) - ident(service_name) operator(=) ident(service_name)operator(()ident(controller)operator(\)) - ident(request) operator(=) ident(protocol)operator(.)ident(encode_action_pack_request)operator(()ident(service_name)operator(,) stringoperator(,) stringoperator(,) symbol(:request_class) operator(=)operator(>) constant(ActionController)operator(::)constant(TestRequest)operator(\)) - ident(response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - ident(controller)operator(.)ident(process)operator(()ident(request)operator(,) ident(response)operator(\)) - comment(# puts response.body) - ident(assert)operator(()ident(response)operator(.)ident(headers)operator([)stringoperator(]) operator(=)operator(~) regexpoperator(\)) - reserved(end) - ident(send_garbage_request)operator(.)ident(call) - ident(controller)operator(.)ident(class)operator(.)ident(web_service_exception_reporting) operator(=) pre_constant(false) - ident(send_garbage_request)operator(.)ident(call) - reserved(end) - reserved(end) - - reserved(def) method(test_exception_marshaling) - instance_variable(@direct_controller)operator(.)ident(web_service_exception_reporting) operator(=) pre_constant(true) - ident(result) operator(=) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(\)) - ident(assert)operator(()ident(is_exception?)operator(()ident(result)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(exception_message)operator(()ident(result)operator(\))operator(\)) - instance_variable(@direct_controller)operator(.)ident(web_service_exception_reporting) operator(=) pre_constant(false) - ident(result) operator(=) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(\)) - ident(assert)operator(()ident(exception_message)operator(()ident(result)operator(\)) operator(!=) stringoperator(\)) - reserved(end) - - reserved(def) method(test_ar_struct_return) - operator([)instance_variable(@direct_controller)operator(,) instance_variable(@delegated_controller)operator(])operator(.)ident(each) reserved(do) operator(|)ident(controller)operator(|) - ident(result) operator(=) ident(do_method_call)operator(()ident(controller)operator(,) stringoperator(\)) - ident(assert)operator(()ident(result)operator([)integer(0)operator(])operator(.)ident(is_a?)operator(()constant(DispatcherTest)operator(::)constant(Node)operator(\))operator(\)) - ident(assert)operator(()ident(result)operator([)integer(1)operator(])operator(.)ident(is_a?)operator(()constant(DispatcherTest)operator(::)constant(Node)operator(\))operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(result)operator([)integer(0)operator(])operator(.)ident(name)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(result)operator([)integer(1)operator(])operator(.)ident(name)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_casting) - ident(assert_equal) integer(70)operator(,) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(,) stringoperator(,) stringoperator(\)) - ident(assert_equal) pre_constant(false)operator(,) instance_variable(@direct_controller)operator(.)ident(struct_pass_value) - ident(person) operator(=) constant(DispatcherTest)operator(::)constant(Person)operator(.)ident(new)operator(()symbol(:id) operator(=)operator(>) integer(1)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(result) operator(=) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(,) ident(person)operator(\)) - ident(assert)operator(()pre_constant(nil) operator(==) ident(result) operator(||) pre_constant(true) operator(==) ident(result)operator(\)) - ident(assert_equal) ident(person)operator(,) instance_variable(@direct_controller)operator(.)ident(struct_pass_value) - ident(assert) operator(!)ident(person)operator(.)ident(equal?)operator(()instance_variable(@direct_controller)operator(.)ident(struct_pass_value)operator(\)) - ident(result) operator(=) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(,) operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(\)) - reserved(case) - reserved(when) ident(soap?) - ident(assert_equal)operator(()ident(person)operator(,) instance_variable(@direct_controller)operator(.)ident(struct_pass_value)operator(\)) - ident(assert) operator(!)ident(person)operator(.)ident(equal?)operator(()instance_variable(@direct_controller)operator(.)ident(struct_pass_value)operator(\)) - reserved(when) ident(xmlrpc?) - ident(assert_equal)operator(()ident(person)operator(,) instance_variable(@direct_controller)operator(.)ident(struct_pass_value)operator(\)) - ident(assert) operator(!)ident(person)operator(.)ident(equal?)operator(()instance_variable(@direct_controller)operator(.)ident(struct_pass_value)operator(\)) - reserved(end) - ident(assert_equal) ident(person)operator(,) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(\))operator([)integer(0)operator(]) - ident(result) operator(=) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(,) operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(\)) - reserved(case) - reserved(when) ident(soap?) - ident(assert_equal)operator(()ident(person)operator(,) instance_variable(@direct_controller)operator(.)ident(struct_pass_value)operator(\)) - ident(assert) operator(!)ident(person)operator(.)ident(equal?)operator(()instance_variable(@direct_controller)operator(.)ident(struct_pass_value)operator(\)) - reserved(when) ident(xmlrpc?) - ident(assert_equal)operator(()ident(person)operator(,) instance_variable(@direct_controller)operator(.)ident(struct_pass_value)operator(\)) - ident(assert) operator(!)ident(person)operator(.)ident(equal?)operator(()instance_variable(@direct_controller)operator(.)ident(struct_pass_value)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_logging) - ident(buf) operator(=) string - constant(ActionController)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()constant(StringIO)operator(.)ident(new)operator(()ident(buf)operator(\))operator(\)) - ident(test_casting) - ident(test_garbage_request) - ident(test_exception_marshaling) - constant(ActionController)operator(::)constant(Base)operator(.)ident(logger) operator(=) pre_constant(nil) - ident(assert_match) regexpoperator(,) ident(buf) - ident(assert_match) regexpoperator(,) ident(buf) - reserved(end) - - ident(protected) - reserved(def) method(service_name)operator(()ident(container)operator(\)) - ident(raise) constant(NotImplementedError) - reserved(end) - - reserved(def) method(exception_message)operator(()ident(obj)operator(\)) - ident(raise) constant(NotImplementedError) - reserved(end) - - reserved(def) method(is_exception?)operator(()ident(obj)operator(\)) - ident(raise) constant(NotImplementedError) - reserved(end) - - reserved(def) method(protocol) - instance_variable(@protocol) - reserved(end) - - reserved(def) method(soap?) - ident(protocol)operator(.)ident(is_a?) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(Soap)operator(::)constant(SoapProtocol) - reserved(end) - - reserved(def) method(xmlrpc?) - ident(protocol)operator(.)ident(is_a?) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(XmlRpc)operator(::)constant(XmlRpcProtocol) - reserved(end) - - reserved(def) method(do_method_call)operator(()ident(container)operator(,) ident(public_method_name)operator(,) operator(*)ident(params)operator(\)) - ident(request_env) operator(=) operator({)operator(}) - ident(mode) operator(=) ident(container)operator(.)ident(web_service_dispatching_mode) - reserved(case) ident(mode) - reserved(when) symbol(:direct) - ident(service_name) operator(=) ident(service_name)operator(()ident(container)operator(\)) - ident(api) operator(=) ident(container)operator(.)ident(class)operator(.)ident(web_service_api) - ident(method) operator(=) ident(api)operator(.)ident(public_api_method_instance)operator(()ident(public_method_name)operator(\)) - reserved(when) symbol(:delegated) - ident(service_name) operator(=) ident(service_name)operator(()ident(container)operator(\)) - ident(api) operator(=) ident(container)operator(.)ident(web_service_object)operator(()ident(service_name)operator(\))operator(.)ident(class)operator(.)ident(web_service_api) - ident(method) operator(=) ident(api)operator(.)ident(public_api_method_instance)operator(()ident(public_method_name)operator(\)) - reserved(when) symbol(:layered) - ident(service_name) operator(=) pre_constant(nil) - ident(real_method_name) operator(=) pre_constant(nil) - reserved(if) ident(public_method_name) operator(=)operator(~) regexp - ident(service_name) operator(=) global_variable($1) - ident(real_method_name) operator(=) global_variable($2) - reserved(end) - reserved(if) ident(soap?) - ident(public_method_name) operator(=) ident(real_method_name) - ident(request_env)operator([)stringoperator(]) operator(=) stringcontent(/)inlinedelimiter(")> - reserved(end) - ident(api) operator(=) ident(container)operator(.)ident(web_service_object)operator(()ident(service_name)operator(.)ident(to_sym)operator(\))operator(.)ident(class)operator(.)ident(web_service_api) reserved(rescue) pre_constant(nil) - ident(method) operator(=) ident(api)operator(.)ident(public_api_method_instance)operator(()ident(real_method_name)operator(\)) reserved(rescue) pre_constant(nil) - ident(service_name) operator(=) pre_constant(self)operator(.)ident(service_name)operator(()ident(container)operator(\)) - reserved(end) - ident(protocol)operator(.)ident(register_api)operator(()ident(api)operator(\)) - ident(virtual) operator(=) pre_constant(false) - reserved(unless) ident(method) - ident(virtual) operator(=) pre_constant(true) - ident(method) operator(||=) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Method)operator(.)ident(new)operator(()ident(public_method_name)operator(.)ident(underscore)operator(.)ident(to_sym)operator(,) ident(public_method_name)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(\)) - reserved(end) - ident(body) operator(=) ident(protocol)operator(.)ident(encode_request)operator(()ident(public_method_name)operator(,) ident(params)operator(.)ident(dup)operator(,) ident(method)operator(.)ident(expects)operator(\)) - comment(# puts body) - ident(ap_request) operator(=) ident(protocol)operator(.)ident(encode_action_pack_request)operator(()ident(service_name)operator(,) ident(public_method_name)operator(,) ident(body)operator(,) symbol(:request_class) operator(=)operator(>) constant(ActionController)operator(::)constant(TestRequest)operator(\)) - ident(ap_request)operator(.)ident(env)operator(.)ident(update)operator(()ident(request_env)operator(\)) - ident(ap_response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - ident(container)operator(.)ident(process)operator(()ident(ap_request)operator(,) ident(ap_response)operator(\)) - comment(# puts ap_response.body) - instance_variable(@response_body) operator(=) ident(ap_response)operator(.)ident(body) - ident(public_method_name)operator(,) ident(return_value) operator(=) ident(protocol)operator(.)ident(decode_response)operator(()ident(ap_response)operator(.)ident(body)operator(\)) - reserved(unless) ident(is_exception?)operator(()ident(return_value)operator(\)) operator(||) ident(virtual) - ident(return_value) operator(=) ident(method)operator(.)ident(cast_returns)operator(()ident(return_value)operator(\)) - reserved(end) - reserved(if) ident(soap?) - comment(# http://dev.rubyonrails.com/changeset/920) - ident(assert_match)operator(()regexpoperator(,) ident(public_method_name)operator(\)) reserved(unless) ident(public_method_name) operator(==) string - reserved(end) - ident(return_value) - reserved(end) -reserved(end) -pre_constant(ENV)operator([)stringoperator(]) operator(=) string -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -constant(ActionController)operator(::)constant(Base)operator(.)ident(logger) operator(=) pre_constant(nil) -constant(ActionController)operator(::)constant(Base)operator(.)ident(ignore_missing_templates) operator(=) pre_constant(true) - -reserved(begin) - constant(PATH_TO_AR) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - ident(require) stringcontent(/lib/active_record)delimiter(")> reserved(unless) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:ActiveRecord)operator(\)) - ident(require) stringcontent(/lib/active_record/fixtures)delimiter(")> reserved(unless) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:Fixtures)operator(\)) -reserved(rescue) constant(Object) operator(=)operator(>) ident(e) - ident(fail) stringdelimiter(")> -reserved(end) - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:encoding) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) string -operator(\)) -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection) - -constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase)operator(.)ident(fixture_path) operator(=) stringcontent(/fixtures/)delimiter(")> - -comment(# restore default raw_post functionality) -reserved(class) class(ActionController::TestRequest) - reserved(def) method(raw_post) - reserved(super) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(APITest) - reserved(class) class(API) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(api_method) symbol(:void) - ident(api_method) symbol(:expects_and_returns)operator(,) symbol(:expects_and_returns) operator(=)operator(>) operator([)symbol(:string)operator(]) - ident(api_method) symbol(:expects)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:int)operator(,) symbol(:bool)operator(]) - ident(api_method) symbol(:returns)operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:int)operator(,) operator([)symbol(:string)operator(])operator(]) - ident(api_method) symbol(:named_signature)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:appkey)operator(=)operator(>)symbol(:int)operator(})operator(,) operator({)symbol(:publish)operator(=)operator(>)symbol(:bool)operator(})operator(]) - ident(api_method) symbol(:string_types)operator(,) symbol(:expects) operator(=)operator(>) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - ident(api_method) symbol(:class_types)operator(,) symbol(:expects) operator(=)operator(>) operator([)constant(TrueClass)operator(,) constant(Bignum)operator(,) constant(String)operator(]) - reserved(end) -reserved(end) - -reserved(class) class(TC_API) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - constant(API) operator(=) constant(APITest)operator(::)constant(API) - - reserved(def) method(test_api_method_declaration) - stringoperator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - ident(name) operator(=) ident(name)operator(.)ident(to_sym) - ident(public_name) operator(=) constant(API)operator(.)ident(public_api_method_name)operator(()ident(name)operator(\)) - ident(assert)operator(()constant(API)operator(.)ident(has_api_method?)operator(()ident(name)operator(\))operator(\)) - ident(assert)operator(()constant(API)operator(.)ident(has_public_api_method?)operator(()ident(public_name)operator(\))operator(\)) - ident(assert)operator(()constant(API)operator(.)ident(api_method_name)operator(()ident(public_name)operator(\)) operator(==) ident(name)operator(\)) - ident(assert)operator(()constant(API)operator(.)ident(api_methods)operator(.)ident(has_key?)operator(()ident(name)operator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_signature_canonicalization) - ident(assert_equal)operator(()pre_constant(nil)operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:void)operator(])operator(.)ident(expects)operator(\)) - ident(assert_equal)operator(()pre_constant(nil)operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:void)operator(])operator(.)ident(returns)operator(\)) - ident(assert_equal)operator(()operator([)constant(String)operator(])operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:expects_and_returns)operator(])operator(.)ident(expects)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) ident(x)operator(.)ident(type_class)operator(})operator(\)) - ident(assert_equal)operator(()operator([)constant(String)operator(])operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:expects_and_returns)operator(])operator(.)ident(returns)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) ident(x)operator(.)ident(type_class)operator(})operator(\)) - ident(assert_equal)operator(()operator([)constant(Integer)operator(,) constant(TrueClass)operator(])operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:expects)operator(])operator(.)ident(expects)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) ident(x)operator(.)ident(type_class)operator(})operator(\)) - ident(assert_equal)operator(()pre_constant(nil)operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:expects)operator(])operator(.)ident(returns)operator(\)) - ident(assert_equal)operator(()pre_constant(nil)operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:returns)operator(])operator(.)ident(expects)operator(\)) - ident(assert_equal)operator(()operator([)constant(Integer)operator(,) operator([)constant(String)operator(])operator(])operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:returns)operator(])operator(.)ident(returns)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) ident(x)operator(.)ident(array?)operator(?) operator([)ident(x)operator(.)ident(element_type)operator(.)ident(type_class)operator(]) operator(:) ident(x)operator(.)ident(type_class)operator(})operator(\)) - ident(assert_equal)operator(()operator([)operator([)symbol(:appkey)operator(,) constant(Integer)operator(])operator(,) operator([)symbol(:publish)operator(,) constant(TrueClass)operator(])operator(])operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:named_signature)operator(])operator(.)ident(expects)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) operator([)ident(x)operator(.)ident(name)operator(,) ident(x)operator(.)ident(type_class)operator(])operator(})operator(\)) - ident(assert_equal)operator(()pre_constant(nil)operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:named_signature)operator(])operator(.)ident(returns)operator(\)) - ident(assert_equal)operator(()operator([)constant(Integer)operator(,) constant(String)operator(,) constant(TrueClass)operator(,) constant(ActionWebService)operator(::)constant(Base64)operator(])operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:string_types)operator(])operator(.)ident(expects)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) ident(x)operator(.)ident(type_class)operator(})operator(\)) - ident(assert_equal)operator(()pre_constant(nil)operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:string_types)operator(])operator(.)ident(returns)operator(\)) - ident(assert_equal)operator(()operator([)constant(TrueClass)operator(,) constant(Integer)operator(,) constant(String)operator(])operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:class_types)operator(])operator(.)ident(expects)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) ident(x)operator(.)ident(type_class)operator(})operator(\)) - ident(assert_equal)operator(()pre_constant(nil)operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:class_types)operator(])operator(.)ident(returns)operator(\)) - reserved(end) - - reserved(def) method(test_not_instantiable) - ident(assert_raises)operator(()constant(NoMethodError)operator(\)) reserved(do) - constant(API)operator(.)ident(new) - reserved(end) - reserved(end) - - reserved(def) method(test_api_errors) - ident(assert_raises)operator(()constant(ActionWebService)operator(::)constant(ActionWebServiceError)operator(\)) reserved(do) - ident(klass) operator(=) constant(Class)operator(.)ident(new)operator(()constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base)operator(\)) reserved(do) - ident(api_method) symbol(:test)operator(,) symbol(:expects) operator(=)operator(>) operator([)constant(ActiveRecord)operator(::)constant(Base)operator(]) - reserved(end) - reserved(end) - ident(klass) operator(=) constant(Class)operator(.)ident(new)operator(()constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base)operator(\)) reserved(do) - ident(allow_active_record_expects) pre_constant(true) - ident(api_method) symbol(:test2)operator(,) symbol(:expects) operator(=)operator(>) operator([)constant(ActiveRecord)operator(::)constant(Base)operator(]) - reserved(end) - ident(assert_raises)operator(()constant(ActionWebService)operator(::)constant(ActionWebServiceError)operator(\)) reserved(do) - ident(klass) operator(=) constant(Class)operator(.)ident(new)operator(()constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base)operator(\)) reserved(do) - ident(api_method) symbol(:test)operator(,) symbol(:invalid) operator(=)operator(>) operator([)symbol(:int)operator(]) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_parameter_names) - ident(method) operator(=) constant(API)operator(.)ident(api_methods)operator([)symbol(:named_signature)operator(]) - ident(assert_equal) integer(0)operator(,) ident(method)operator(.)ident(expects_index_of)operator(()symbol(:appkey)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(method)operator(.)ident(expects_index_of)operator(()symbol(:publish)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(method)operator(.)ident(expects_index_of)operator(()stringoperator(\)) - ident(assert_equal) integer(0)operator(,) ident(method)operator(.)ident(expects_index_of)operator(()stringoperator(\)) - ident(assert_equal) integer(-1)operator(,) ident(method)operator(.)ident(expects_index_of)operator(()stringoperator(\)) - ident(assert_equal) integer(-1)operator(,) ident(method)operator(.)ident(expects_index_of)operator(()symbol(:missing)operator(\)) - ident(assert_equal) integer(-1)operator(,) constant(API)operator(.)ident(api_methods)operator([)symbol(:void)operator(])operator(.)ident(expects_index_of)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_parameter_hash) - ident(method) operator(=) constant(API)operator(.)ident(api_methods)operator([)symbol(:named_signature)operator(]) - ident(hash) operator(=) ident(method)operator(.)ident(expects_to_hash)operator(()operator([)integer(5)operator(,) pre_constant(false)operator(])operator(\)) - ident(assert_equal)operator(()operator({)symbol(:appkey) operator(=)operator(>) integer(5)operator(,) symbol(:publish) operator(=)operator(>) pre_constant(false)operator(})operator(,) ident(hash)operator(\)) - reserved(end) - - reserved(def) method(test_api_methods_compat) - ident(sig) operator(=) constant(API)operator(.)ident(api_methods)operator([)symbol(:named_signature)operator(])operator([)symbol(:expects)operator(]) - ident(assert_equal) operator([)operator({)symbol(:appkey)operator(=)operator(>)constant(Integer)operator(})operator(,) operator({)symbol(:publish)operator(=)operator(>)constant(TrueClass)operator(})operator(])operator(,) ident(sig) - reserved(end) - - reserved(def) method(test_to_s) - ident(assert_equal) stringoperator(,) constant(APITest)operator(::)constant(API)operator(.)ident(api_methods)operator([)symbol(:expects)operator(])operator(.)ident(to_s) - reserved(end) -reserved(end) -reserved(class) class(AutoLoadAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(api_method) symbol(:void) -reserved(end) - - -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(BaseTest) - reserved(class) class(API) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(api_method) symbol(:add)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:int)operator(,) symbol(:int)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:int)operator(]) - ident(api_method) symbol(:void) - reserved(end) - - reserved(class) class(PristineAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(inflect_names) pre_constant(false) - - ident(api_method) symbol(:add) - ident(api_method) symbol(:under_score) - reserved(end) - - reserved(class) class(Service) operator(<) constant(ActionWebService)operator(::)constant(Base) - ident(web_service_api) constant(API) - - reserved(def) method(add)operator(()ident(a)operator(,) ident(b)operator(\)) - reserved(end) - - reserved(def) method(void) - reserved(end) - reserved(end) - - reserved(class) class(PristineService) operator(<) constant(ActionWebService)operator(::)constant(Base) - ident(web_service_api) constant(PristineAPI) - - reserved(def) method(add) - reserved(end) - - reserved(def) method(under_score) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(TC_Base) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(test_options) - ident(assert)operator(()constant(BaseTest)operator(::)constant(PristineService)operator(.)ident(web_service_api)operator(.)ident(inflect_names) operator(==) pre_constant(false)operator(\)) - ident(assert)operator(()constant(BaseTest)operator(::)constant(Service)operator(.)ident(web_service_api)operator(.)ident(inflect_names) operator(==) pre_constant(true)operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(CastingTest) - reserved(class) class(API) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(api_method) symbol(:int)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:int)operator(]) - ident(api_method) symbol(:str)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:string)operator(]) - ident(api_method) symbol(:base64)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:base64)operator(]) - ident(api_method) symbol(:bool)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:bool)operator(]) - ident(api_method) symbol(:float)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:float)operator(]) - ident(api_method) symbol(:time)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:time)operator(]) - ident(api_method) symbol(:datetime)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:datetime)operator(]) - ident(api_method) symbol(:date)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:date)operator(]) - - ident(api_method) symbol(:int_array)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator([)symbol(:int)operator(])operator(]) - ident(api_method) symbol(:str_array)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator([)symbol(:string)operator(])operator(]) - ident(api_method) symbol(:bool_array)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator([)symbol(:bool)operator(])operator(]) - reserved(end) -reserved(end) - -reserved(class) class(TC_Casting) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(CastingTest) - - reserved(def) method(test_base_type_casting_valid) - ident(assert_equal) integer(10000)operator(,) ident(cast_expects)operator(()symbol(:int)operator(,) stringoperator(\))operator([)integer(0)operator(]) - ident(assert_equal) stringoperator(,) ident(cast_expects)operator(()symbol(:str)operator(,) integer(10000)operator(\))operator([)integer(0)operator(]) - ident(base64) operator(=) ident(cast_expects)operator(()symbol(:base64)operator(,) integer(10000)operator(\))operator([)integer(0)operator(]) - ident(assert_equal) stringoperator(,) ident(base64) - ident(assert_instance_of) constant(ActionWebService)operator(::)constant(Base64)operator(,) ident(base64) - operator([)integer(1)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(.)ident(each) reserved(do) operator(|)ident(val)operator(|) - ident(assert_equal) pre_constant(true)operator(,) ident(cast_expects)operator(()symbol(:bool)operator(,) ident(val)operator(\))operator([)integer(0)operator(]) - reserved(end) - operator([)integer(0)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(.)ident(each) reserved(do) operator(|)ident(val)operator(|) - ident(assert_equal) pre_constant(false)operator(,) ident(cast_expects)operator(()symbol(:bool)operator(,) ident(val)operator(\))operator([)integer(0)operator(]) - reserved(end) - ident(assert_equal) float(3.14159)operator(,) ident(cast_expects)operator(()symbol(:float)operator(,) stringoperator(\))operator([)integer(0)operator(]) - ident(now) operator(=) constant(Time)operator(.)ident(at)operator(()constant(Time)operator(.)ident(now)operator(.)ident(tv_sec)operator(\)) - ident(casted) operator(=) ident(cast_expects)operator(()symbol(:time)operator(,) ident(now)operator(.)ident(to_s)operator(\))operator([)integer(0)operator(]) - ident(assert_equal) ident(now)operator(,) ident(casted) - ident(now) operator(=) constant(DateTime)operator(.)ident(now) - ident(assert_equal) ident(now)operator(.)ident(to_s)operator(,) ident(cast_expects)operator(()symbol(:datetime)operator(,) ident(now)operator(.)ident(to_s)operator(\))operator([)integer(0)operator(])operator(.)ident(to_s) - ident(today) operator(=) constant(Date)operator(.)ident(today) - ident(assert_equal) ident(today)operator(,) ident(cast_expects)operator(()symbol(:date)operator(,) ident(today)operator(.)ident(to_s)operator(\))operator([)integer(0)operator(]) - reserved(end) - - reserved(def) method(test_base_type_casting_invalid) - ident(assert_raises) constant(ArgumentError) reserved(do) - ident(cast_expects)operator(()symbol(:int)operator(,) stringoperator(\)) - reserved(end) - ident(assert_raises) constant(ActionWebService)operator(::)constant(Casting)operator(::)constant(CastingError) reserved(do) - comment(# neither true or false ;\)) - ident(cast_expects)operator(()symbol(:bool)operator(,) stringoperator(\)) - reserved(end) - ident(assert_raises) constant(ArgumentError) reserved(do) - ident(cast_expects)operator(()symbol(:float)operator(,) stringoperator(\)) - reserved(end) - ident(assert_raises) constant(ArgumentError) reserved(do) - ident(cast_expects)operator(()symbol(:time)operator(,) stringoperator(\)) - reserved(end) - ident(assert_raises) constant(ArgumentError) reserved(do) - ident(cast_expects)operator(()symbol(:datetime)operator(,) stringoperator(\)) - reserved(end) - ident(assert_raises) constant(ArgumentError) reserved(do) - ident(cast_expects)operator(()symbol(:date)operator(,) stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_array_type_casting) - ident(assert_equal) operator([)integer(1)operator(,) integer(2)operator(,) integer(3213992)operator(,) integer(4)operator(])operator(,) ident(cast_expects)operator(()symbol(:int_array)operator(,) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(\))operator([)integer(0)operator(]) - ident(assert_equal) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) pre_constant(nil)operator(,) stringoperator(])operator(,) ident(cast_expects)operator(()symbol(:str_array)operator(,) operator([)symbol(:one)operator(,) stringoperator(,) float(5.0)operator(,) integer(200)operator(,) pre_constant(nil)operator(,) pre_constant(true)operator(])operator(\))operator([)integer(0)operator(]) - ident(assert_equal) operator([)pre_constant(true)operator(,) pre_constant(nil)operator(,) pre_constant(true)operator(,) pre_constant(true)operator(,) pre_constant(false)operator(])operator(,) ident(cast_expects)operator(()symbol(:bool_array)operator(,) operator([)stringoperator(,) pre_constant(nil)operator(,) stringoperator(,) pre_constant(true)operator(,) stringoperator(])operator(\))operator([)integer(0)operator(]) - reserved(end) - - reserved(def) method(test_array_type_casting_failure) - ident(assert_raises) constant(ActionWebService)operator(::)constant(Casting)operator(::)constant(CastingError) reserved(do) - ident(cast_expects)operator(()symbol(:bool_array)operator(,) operator([)stringoperator(,) stringoperator(])operator(\)) - reserved(end) - ident(assert_raises) constant(ArgumentError) reserved(do) - ident(cast_expects)operator(()symbol(:int_array)operator(,) operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(\)) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(cast_expects)operator(()ident(method_name)operator(,) operator(*)ident(args)operator(\)) - constant(API)operator(.)ident(api_method_instance)operator(()ident(method_name)operator(.)ident(to_sym)operator(\))operator(.)ident(cast_expects)operator(()operator([)operator(*)ident(args)operator(])operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - - -reserved(module) class(ClientSoapTest) - constant(PORT) operator(=) integer(8998) - - reserved(class) class(SoapClientLet) operator(<) constant(ClientTest)operator(::)constant(AbstractClientLet) - reserved(def) method(do_POST)operator(()ident(req)operator(,) ident(res)operator(\)) - ident(test_request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - ident(test_request)operator(.)ident(request_parameters)operator([)stringoperator(]) operator(=) ident(req)operator(.)ident(path)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(split)operator(()regexpoperator(\))operator([)integer(1)operator(]) - ident(test_request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(test_request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(test_request)operator(.)ident(env)operator([)stringoperator(]) operator(=) ident(req)operator(.)ident(header)operator([)stringoperator(])operator([)integer(0)operator(]) - ident(test_request)operator(.)ident(env)operator([)stringoperator(]) operator(=) ident(req)operator(.)ident(body) - ident(response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - instance_variable(@controller)operator(.)ident(process)operator(()ident(test_request)operator(,) ident(response)operator(\)) - ident(res)operator(.)ident(header)operator([)stringoperator(]) operator(=) string - ident(res)operator(.)ident(body) operator(=) ident(response)operator(.)ident(body) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - global_variable($stderr)operator(.)ident(puts) ident(e)operator(.)ident(message) - global_variable($stderr)operator(.)ident(puts) ident(e)operator(.)ident(backtrace)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(class) class(ClientContainer) operator(<) constant(ActionController)operator(::)constant(Base) - ident(web_client_api) symbol(:client)operator(,) symbol(:soap)operator(,) stringcontent(/client/api)delimiter(")>operator(,) symbol(:api) operator(=)operator(>) constant(ClientTest)operator(::)constant(API) - ident(web_client_api) symbol(:invalid)operator(,) symbol(:null)operator(,) stringoperator(,) symbol(:api) operator(=)operator(>) pre_constant(true) - - reserved(def) method(get_client) - ident(client) - reserved(end) - - reserved(def) method(get_invalid) - ident(invalid) - reserved(end) - reserved(end) - - reserved(class) class(SoapServer) operator(<) constant(ClientTest)operator(::)constant(AbstractServer) - reserved(def) method(create_clientlet)operator(()ident(controller)operator(\)) - constant(SoapClientLet)operator(.)ident(new)operator(()ident(controller)operator(\)) - reserved(end) - - reserved(def) method(server_port) - constant(PORT) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(TC_ClientSoap) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ClientTest) - ident(include) constant(ClientSoapTest) - - ident(fixtures) symbol(:users) - - reserved(def) method(setup) - instance_variable(@server) operator(=) constant(SoapServer)operator(.)ident(instance) - instance_variable(@container) operator(=) instance_variable(@server)operator(.)ident(container) - instance_variable(@client) operator(=) constant(ActionWebService)operator(::)constant(Client)operator(::)constant(Soap)operator(.)ident(new)operator(()constant(API)operator(,) stringcontent(/client/api)delimiter(")>operator(\)) - reserved(end) - - reserved(def) method(test_void) - ident(assert)operator(()instance_variable(@container)operator(.)ident(value_void)operator(.)ident(nil?)operator(\)) - instance_variable(@client)operator(.)ident(void) - ident(assert)operator(()operator(!)instance_variable(@container)operator(.)ident(value_void)operator(.)ident(nil?)operator(\)) - reserved(end) - - reserved(def) method(test_normal) - ident(assert)operator(()instance_variable(@container)operator(.)ident(value_normal)operator(.)ident(nil?)operator(\)) - ident(assert_equal)operator(()integer(5)operator(,) instance_variable(@client)operator(.)ident(normal)operator(()integer(5)operator(,) integer(6)operator(\))operator(\)) - ident(assert_equal)operator(()operator([)integer(5)operator(,) integer(6)operator(])operator(,) instance_variable(@container)operator(.)ident(value_normal)operator(\)) - ident(assert_equal)operator(()integer(5)operator(,) instance_variable(@client)operator(.)ident(normal)operator(()stringoperator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator([)integer(7)operator(,) integer(8)operator(])operator(,) instance_variable(@container)operator(.)ident(value_normal)operator(\)) - ident(assert_equal)operator(()integer(5)operator(,) instance_variable(@client)operator(.)ident(normal)operator(()pre_constant(true)operator(,) pre_constant(false)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_array_return) - ident(assert)operator(()instance_variable(@container)operator(.)ident(value_array_return)operator(.)ident(nil?)operator(\)) - ident(new_person) operator(=) constant(Person)operator(.)ident(new) - ident(new_person)operator(.)ident(firstnames) operator(=) operator([)stringoperator(,) stringoperator(]) - ident(new_person)operator(.)ident(lastname) operator(=) string - ident(assert_equal)operator(()operator([)ident(new_person)operator(])operator(,) instance_variable(@client)operator(.)ident(array_return)operator(\)) - ident(assert_equal)operator(()operator([)ident(new_person)operator(])operator(,) instance_variable(@container)operator(.)ident(value_array_return)operator(\)) - reserved(end) - - reserved(def) method(test_struct_pass) - ident(assert)operator(()instance_variable(@container)operator(.)ident(value_struct_pass)operator(.)ident(nil?)operator(\)) - ident(new_person) operator(=) constant(Person)operator(.)ident(new) - ident(new_person)operator(.)ident(firstnames) operator(=) operator([)stringoperator(,) stringoperator(]) - ident(new_person)operator(.)ident(lastname) operator(=) string - ident(assert_equal)operator(()pre_constant(true)operator(,) instance_variable(@client)operator(.)ident(struct_pass)operator(()operator([)ident(new_person)operator(])operator(\))operator(\)) - ident(assert_equal)operator(()operator([)operator([)ident(new_person)operator(])operator(])operator(,) instance_variable(@container)operator(.)ident(value_struct_pass)operator(\)) - reserved(end) - - reserved(def) method(test_nil_struct_return) - ident(assert_nil) instance_variable(@client)operator(.)ident(nil_struct_return) - reserved(end) - - reserved(def) method(test_inner_nil) - ident(outer) operator(=) instance_variable(@client)operator(.)ident(inner_nil) - ident(assert_equal) stringoperator(,) ident(outer)operator(.)ident(name) - ident(assert_nil) ident(outer)operator(.)ident(inner) - reserved(end) - - reserved(def) method(test_client_container) - ident(assert_equal)operator(()integer(50)operator(,) constant(ClientContainer)operator(.)ident(new)operator(.)ident(get_client)operator(.)ident(client_container)operator(\)) - ident(assert)operator(()constant(ClientContainer)operator(.)ident(new)operator(.)ident(get_invalid)operator(.)ident(nil?)operator(\)) - reserved(end) - - reserved(def) method(test_named_parameters) - ident(assert)operator(()instance_variable(@container)operator(.)ident(value_named_parameters)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()instance_variable(@client)operator(.)ident(named_parameters)operator(()stringoperator(,) integer(5)operator(\))operator(.)ident(nil?)operator(\)) - ident(assert_equal)operator(()operator([)stringoperator(,) integer(5)operator(])operator(,) instance_variable(@container)operator(.)ident(value_named_parameters)operator(\)) - reserved(end) - - reserved(def) method(test_capitalized_method_name) - instance_variable(@container)operator(.)ident(value_normal) operator(=) pre_constant(nil) - ident(assert_equal)operator(()integer(5)operator(,) instance_variable(@client)operator(.)ident(Normal)operator(()integer(5)operator(,) integer(6)operator(\))operator(\)) - ident(assert_equal)operator(()operator([)integer(5)operator(,) integer(6)operator(])operator(,) instance_variable(@container)operator(.)ident(value_normal)operator(\)) - instance_variable(@container)operator(.)ident(value_normal) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(test_model_return) - ident(user) operator(=) instance_variable(@client)operator(.)ident(user_return) - ident(assert_equal) integer(1)operator(,) ident(user)operator(.)ident(id) - ident(assert_equal) stringoperator(,) ident(user)operator(.)ident(name) - ident(assert) ident(user)operator(.)ident(active?) - ident(assert_kind_of) constant(Date)operator(,) ident(user)operator(.)ident(created_on) - ident(assert_equal) constant(Date)operator(.)ident(today)operator(,) ident(user)operator(.)ident(created_on) - reserved(end) - - reserved(def) method(test_with_model) - ident(with_model) operator(=) instance_variable(@client)operator(.)ident(with_model_return) - ident(assert_equal) stringoperator(,) ident(with_model)operator(.)ident(user)operator(.)ident(name) - ident(assert_equal) integer(2)operator(,) ident(with_model)operator(.)ident(users)operator(.)ident(size) - ident(with_model)operator(.)ident(users)operator(.)ident(each) reserved(do) operator(|)ident(user)operator(|) - ident(assert_kind_of) constant(User)operator(,) ident(user) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_model_return) - ident(scoped_model) operator(=) instance_variable(@client)operator(.)ident(scoped_model_return) - ident(assert_kind_of) constant(Accounting)operator(::)constant(User)operator(,) ident(scoped_model) - ident(assert_equal) stringoperator(,) ident(scoped_model)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_multi_dim_return) - ident(md_struct) operator(=) instance_variable(@client)operator(.)ident(multi_dim_return) - ident(assert_kind_of) constant(Array)operator(,) ident(md_struct)operator(.)ident(pref) - ident(assert_equal) integer(2)operator(,) ident(md_struct)operator(.)ident(pref)operator(.)ident(size) - ident(assert_kind_of) constant(Array)operator(,) ident(md_struct)operator(.)ident(pref)operator([)integer(0)operator(]) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - - -reserved(module) class(ClientXmlRpcTest) - constant(PORT) operator(=) integer(8999) - - reserved(class) class(XmlRpcClientLet) operator(<) constant(ClientTest)operator(::)constant(AbstractClientLet) - reserved(def) method(do_POST)operator(()ident(req)operator(,) ident(res)operator(\)) - ident(test_request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - ident(test_request)operator(.)ident(request_parameters)operator([)stringoperator(]) operator(=) ident(req)operator(.)ident(path)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(split)operator(()regexpoperator(\))operator([)integer(1)operator(]) - ident(test_request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(test_request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(test_request)operator(.)ident(env)operator([)stringoperator(]) operator(=) ident(req)operator(.)ident(body) - ident(response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - instance_variable(@controller)operator(.)ident(process)operator(()ident(test_request)operator(,) ident(response)operator(\)) - ident(res)operator(.)ident(header)operator([)stringoperator(]) operator(=) string - ident(res)operator(.)ident(body) operator(=) ident(response)operator(.)ident(body) - comment(# puts res.body) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - global_variable($stderr)operator(.)ident(puts) ident(e)operator(.)ident(message) - global_variable($stderr)operator(.)ident(puts) ident(e)operator(.)ident(backtrace)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(class) class(ClientContainer) operator(<) constant(ActionController)operator(::)constant(Base) - ident(web_client_api) symbol(:client)operator(,) symbol(:xmlrpc)operator(,) stringcontent(/client/api)delimiter(")>operator(,) symbol(:api) operator(=)operator(>) constant(ClientTest)operator(::)constant(API) - - reserved(def) method(get_client) - ident(client) - reserved(end) - reserved(end) - - reserved(class) class(XmlRpcServer) operator(<) constant(ClientTest)operator(::)constant(AbstractServer) - reserved(def) method(create_clientlet)operator(()ident(controller)operator(\)) - constant(XmlRpcClientLet)operator(.)ident(new)operator(()ident(controller)operator(\)) - reserved(end) - - reserved(def) method(server_port) - constant(PORT) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(TC_ClientXmlRpc) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ClientTest) - ident(include) constant(ClientXmlRpcTest) - - ident(fixtures) symbol(:users) - - reserved(def) method(setup) - instance_variable(@server) operator(=) constant(XmlRpcServer)operator(.)ident(instance) - instance_variable(@container) operator(=) instance_variable(@server)operator(.)ident(container) - instance_variable(@client) operator(=) constant(ActionWebService)operator(::)constant(Client)operator(::)constant(XmlRpc)operator(.)ident(new)operator(()constant(API)operator(,) stringcontent(/client/api)delimiter(")>operator(\)) - reserved(end) - - reserved(def) method(test_void) - ident(assert)operator(()instance_variable(@container)operator(.)ident(value_void)operator(.)ident(nil?)operator(\)) - instance_variable(@client)operator(.)ident(void) - ident(assert)operator(()operator(!)instance_variable(@container)operator(.)ident(value_void)operator(.)ident(nil?)operator(\)) - reserved(end) - - reserved(def) method(test_normal) - ident(assert)operator(()instance_variable(@container)operator(.)ident(value_normal)operator(.)ident(nil?)operator(\)) - ident(assert_equal)operator(()integer(5)operator(,) instance_variable(@client)operator(.)ident(normal)operator(()integer(5)operator(,) integer(6)operator(\))operator(\)) - ident(assert_equal)operator(()operator([)integer(5)operator(,) integer(6)operator(])operator(,) instance_variable(@container)operator(.)ident(value_normal)operator(\)) - ident(assert_equal)operator(()integer(5)operator(,) instance_variable(@client)operator(.)ident(normal)operator(()stringoperator(,) stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator([)integer(7)operator(,) integer(8)operator(])operator(,) instance_variable(@container)operator(.)ident(value_normal)operator(\)) - ident(assert_equal)operator(()integer(5)operator(,) instance_variable(@client)operator(.)ident(normal)operator(()pre_constant(true)operator(,) pre_constant(false)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_array_return) - ident(assert)operator(()instance_variable(@container)operator(.)ident(value_array_return)operator(.)ident(nil?)operator(\)) - ident(new_person) operator(=) constant(Person)operator(.)ident(new) - ident(new_person)operator(.)ident(firstnames) operator(=) operator([)stringoperator(,) stringoperator(]) - ident(new_person)operator(.)ident(lastname) operator(=) string - ident(assert_equal)operator(()operator([)ident(new_person)operator(])operator(,) instance_variable(@client)operator(.)ident(array_return)operator(\)) - ident(assert_equal)operator(()operator([)ident(new_person)operator(])operator(,) instance_variable(@container)operator(.)ident(value_array_return)operator(\)) - reserved(end) - - reserved(def) method(test_struct_pass) - ident(assert)operator(()instance_variable(@container)operator(.)ident(value_struct_pass)operator(.)ident(nil?)operator(\)) - ident(new_person) operator(=) constant(Person)operator(.)ident(new) - ident(new_person)operator(.)ident(firstnames) operator(=) operator([)stringoperator(,) stringoperator(]) - ident(new_person)operator(.)ident(lastname) operator(=) string - ident(assert_equal)operator(()pre_constant(true)operator(,) instance_variable(@client)operator(.)ident(struct_pass)operator(()operator([)ident(new_person)operator(])operator(\))operator(\)) - ident(assert_equal)operator(()operator([)operator([)ident(new_person)operator(])operator(])operator(,) instance_variable(@container)operator(.)ident(value_struct_pass)operator(\)) - reserved(end) - - reserved(def) method(test_nil_struct_return) - ident(assert_equal) pre_constant(false)operator(,) instance_variable(@client)operator(.)ident(nil_struct_return) - reserved(end) - - reserved(def) method(test_inner_nil) - ident(outer) operator(=) instance_variable(@client)operator(.)ident(inner_nil) - ident(assert_equal) stringoperator(,) ident(outer)operator(.)ident(name) - ident(assert_nil) ident(outer)operator(.)ident(inner) - reserved(end) - - reserved(def) method(test_client_container) - ident(assert_equal)operator(()integer(50)operator(,) constant(ClientContainer)operator(.)ident(new)operator(.)ident(get_client)operator(.)ident(client_container)operator(\)) - reserved(end) - - reserved(def) method(test_named_parameters) - ident(assert)operator(()instance_variable(@container)operator(.)ident(value_named_parameters)operator(.)ident(nil?)operator(\)) - ident(assert_equal)operator(()pre_constant(false)operator(,) instance_variable(@client)operator(.)ident(named_parameters)operator(()stringoperator(,) integer(7)operator(\))operator(\)) - ident(assert_equal)operator(()operator([)stringoperator(,) integer(7)operator(])operator(,) instance_variable(@container)operator(.)ident(value_named_parameters)operator(\)) - reserved(end) - - reserved(def) method(test_exception) - ident(assert_raises)operator(()constant(ActionWebService)operator(::)constant(Client)operator(::)constant(ClientError)operator(\)) reserved(do) - ident(assert)operator(()instance_variable(@client)operator(.)ident(thrower)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_invalid_signature) - ident(assert_raises)operator(()constant(ArgumentError)operator(\)) reserved(do) - instance_variable(@client)operator(.)ident(normal) - reserved(end) - reserved(end) - - reserved(def) method(test_model_return) - ident(user) operator(=) instance_variable(@client)operator(.)ident(user_return) - ident(assert_equal) integer(1)operator(,) ident(user)operator(.)ident(id) - ident(assert_equal) stringoperator(,) ident(user)operator(.)ident(name) - ident(assert) ident(user)operator(.)ident(active?) - ident(assert_kind_of) constant(Time)operator(,) ident(user)operator(.)ident(created_on) - ident(assert_equal) constant(Time)operator(.)ident(utc)operator(()constant(Time)operator(.)ident(now)operator(.)ident(year)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(month)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(day)operator(\))operator(,) ident(user)operator(.)ident(created_on) - reserved(end) - - reserved(def) method(test_with_model) - ident(with_model) operator(=) instance_variable(@client)operator(.)ident(with_model_return) - ident(assert_equal) stringoperator(,) ident(with_model)operator(.)ident(user)operator(.)ident(name) - ident(assert_equal) integer(2)operator(,) ident(with_model)operator(.)ident(users)operator(.)ident(size) - ident(with_model)operator(.)ident(users)operator(.)ident(each) reserved(do) operator(|)ident(user)operator(|) - ident(assert_kind_of) constant(User)operator(,) ident(user) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_model_return) - ident(scoped_model) operator(=) instance_variable(@client)operator(.)ident(scoped_model_return) - ident(assert_kind_of) constant(Accounting)operator(::)constant(User)operator(,) ident(scoped_model) - ident(assert_equal) stringoperator(,) ident(scoped_model)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_multi_dim_return) - ident(md_struct) operator(=) instance_variable(@client)operator(.)ident(multi_dim_return) - ident(assert_kind_of) constant(Array)operator(,) ident(md_struct)operator(.)ident(pref) - ident(assert_equal) integer(2)operator(,) ident(md_struct)operator(.)ident(pref)operator(.)ident(size) - ident(assert_kind_of) constant(Array)operator(,) ident(md_struct)operator(.)ident(pref)operator([)integer(0)operator(]) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(ContainerTest) - global_variable($immediate_service) operator(=) constant(Object)operator(.)ident(new) - global_variable($deferred_service) operator(=) constant(Object)operator(.)ident(new) - - reserved(class) class(DelegateContainer) operator(<) constant(ActionController)operator(::)constant(Base) - ident(web_service_dispatching_mode) symbol(:delegated) - - ident(attr) symbol(:flag) - ident(attr) symbol(:previous_flag) - - reserved(def) method(initialize) - instance_variable(@previous_flag) operator(=) pre_constant(nil) - instance_variable(@flag) operator(=) pre_constant(true) - reserved(end) - - ident(web_service) symbol(:immediate_service)operator(,) global_variable($immediate_service) - ident(web_service)operator(()symbol(:deferred_service)operator(\)) operator({) instance_variable(@previous_flag) operator(=) instance_variable(@flag)operator(;) instance_variable(@flag) operator(=) pre_constant(false)operator(;) global_variable($deferred_service) operator(}) - reserved(end) - - reserved(class) class(DirectContainer) operator(<) constant(ActionController)operator(::)constant(Base) - ident(web_service_dispatching_mode) symbol(:direct) - reserved(end) - - reserved(class) class(InvalidContainer) - ident(include) constant(ActionWebService)operator(::)constant(Container)operator(::)constant(Direct) - reserved(end) -reserved(end) - -reserved(class) class(TC_Container) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ContainerTest) - - reserved(def) method(setup) - instance_variable(@delegate_container) operator(=) constant(DelegateContainer)operator(.)ident(new) - instance_variable(@direct_container) operator(=) constant(DirectContainer)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_registration) - ident(assert)operator(()constant(DelegateContainer)operator(.)ident(has_web_service?)operator(()symbol(:immediate_service)operator(\))operator(\)) - ident(assert)operator(()constant(DelegateContainer)operator(.)ident(has_web_service?)operator(()symbol(:deferred_service)operator(\))operator(\)) - ident(assert)operator(()operator(!)constant(DelegateContainer)operator(.)ident(has_web_service?)operator(()symbol(:fake_service)operator(\))operator(\)) - ident(assert_raises)operator(()constant(ActionWebService)operator(::)constant(Container)operator(::)constant(Delegated)operator(::)constant(ContainerError)operator(\)) reserved(do) - constant(DelegateContainer)operator(.)ident(web_service)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_service_object) - ident(assert_raises)operator(()constant(ActionWebService)operator(::)constant(Container)operator(::)constant(Delegated)operator(::)constant(ContainerError)operator(\)) reserved(do) - instance_variable(@delegate_container)operator(.)ident(web_service_object)operator(()symbol(:nonexistent)operator(\)) - reserved(end) - ident(assert)operator(()instance_variable(@delegate_container)operator(.)ident(flag) operator(==) pre_constant(true)operator(\)) - ident(assert)operator(()instance_variable(@delegate_container)operator(.)ident(web_service_object)operator(()symbol(:immediate_service)operator(\)) operator(==) global_variable($immediate_service)operator(\)) - ident(assert)operator(()instance_variable(@delegate_container)operator(.)ident(previous_flag)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()instance_variable(@delegate_container)operator(.)ident(flag) operator(==) pre_constant(true)operator(\)) - ident(assert)operator(()instance_variable(@delegate_container)operator(.)ident(web_service_object)operator(()symbol(:deferred_service)operator(\)) operator(==) global_variable($deferred_service)operator(\)) - ident(assert)operator(()instance_variable(@delegate_container)operator(.)ident(previous_flag) operator(==) pre_constant(true)operator(\)) - ident(assert)operator(()instance_variable(@delegate_container)operator(.)ident(flag) operator(==) pre_constant(false)operator(\)) - reserved(end) - - reserved(def) method(test_direct_container) - ident(assert)operator(()constant(DirectContainer)operator(.)ident(web_service_dispatching_mode) operator(==) symbol(:direct)operator(\)) - reserved(end) - - reserved(def) method(test_validity) - ident(assert_raises)operator(()constant(ActionWebService)operator(::)constant(Container)operator(::)constant(Direct)operator(::)constant(ContainerError)operator(\)) reserved(do) - constant(InvalidContainer)operator(.)ident(web_service_api) symbol(:test) - reserved(end) - ident(assert_raises)operator(()constant(ActionWebService)operator(::)constant(Container)operator(::)constant(Direct)operator(::)constant(ContainerError)operator(\)) reserved(do) - constant(InvalidContainer)operator(.)ident(web_service_api) float(50.0) - reserved(end) - reserved(end) -reserved(end) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string - -reserved(class) class(ActionController::Base) - reserved(class) operator(<<) class(self) - reserved(alias) symbol(:inherited_without_name_error) symbol(:inherited) - reserved(def) method(inherited)operator(()ident(child)operator(\)) - reserved(begin) - ident(inherited_without_name_error)operator(()ident(child)operator(\)) - reserved(rescue) constant(NameError) operator(=)operator(>) ident(e) - reserved(end) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(AutoLoadController) operator(<) constant(ActionController)operator(::)constant(Base)operator(;) reserved(end) -reserved(class) class(FailingAutoLoadController) operator(<) constant(ActionController)operator(::)constant(Base)operator(;) reserved(end) -reserved(class) class(BrokenAutoLoadController) operator(<) constant(ActionController)operator(::)constant(Base)operator(;) reserved(end) - -reserved(class) class(TC_DispatcherActionControllerSoap) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(DispatcherTest) - ident(include) constant(DispatcherCommonTests) - - reserved(def) method(setup) - instance_variable(@direct_controller) operator(=) constant(DirectController)operator(.)ident(new) - instance_variable(@delegated_controller) operator(=) constant(DelegatedController)operator(.)ident(new) - instance_variable(@virtual_controller) operator(=) constant(VirtualController)operator(.)ident(new) - instance_variable(@layered_controller) operator(=) constant(LayeredController)operator(.)ident(new) - instance_variable(@protocol) operator(=) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(Soap)operator(::)constant(SoapProtocol)operator(.)ident(create)operator(()instance_variable(@direct_controller)operator(\)) - reserved(end) - - reserved(def) method(test_wsdl_generation) - ident(ensure_valid_wsdl_generation) constant(DelegatedController)operator(.)ident(new)operator(,) constant(DispatcherTest)operator(::)constant(WsdlNamespace) - ident(ensure_valid_wsdl_generation) constant(DirectController)operator(.)ident(new)operator(,) constant(DispatcherTest)operator(::)constant(WsdlNamespace) - reserved(end) - - reserved(def) method(test_wsdl_action) - ident(delegated_types) operator(=) ident(ensure_valid_wsdl_action) constant(DelegatedController)operator(.)ident(new) - ident(delegated_names) operator(=) ident(delegated_types)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) ident(x)operator(.)ident(name)operator(.)ident(name)operator(}) - ident(assert)operator(()ident(delegated_names)operator(.)ident(include?)operator(()stringoperator(\))operator(\)) - ident(assert)operator(()ident(delegated_names)operator(.)ident(include?)operator(()stringoperator(\))operator(\)) - ident(direct_types) operator(=) ident(ensure_valid_wsdl_action) constant(DirectController)operator(.)ident(new) - ident(direct_names) operator(=) ident(direct_types)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) ident(x)operator(.)ident(name)operator(.)ident(name)operator(}) - ident(assert)operator(()ident(direct_names)operator(.)ident(include?)operator(()stringoperator(\))operator(\)) - ident(assert)operator(()ident(direct_names)operator(.)ident(include?)operator(()stringoperator(\))operator(\)) - ident(assert)operator(()ident(direct_names)operator(.)ident(include?)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_autoloading) - ident(assert)operator(()operator(!)constant(AutoLoadController)operator(.)ident(web_service_api)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()constant(AutoLoadController)operator(.)ident(web_service_api)operator(.)ident(has_public_api_method?)operator(()stringoperator(\))operator(\)) - ident(assert)operator(()constant(FailingAutoLoadController)operator(.)ident(web_service_api)operator(.)ident(nil?)operator(\)) - ident(assert_raises)operator(()constant(MissingSourceFile)operator(\)) reserved(do) - constant(FailingAutoLoadController)operator(.)ident(require_web_service_api) symbol(:blah) - reserved(end) - ident(assert_raises)operator(()constant(ArgumentError)operator(\)) reserved(do) - constant(FailingAutoLoadController)operator(.)ident(require_web_service_api) float(50.0) - reserved(end) - ident(assert)operator(()constant(BrokenAutoLoadController)operator(.)ident(web_service_api)operator(.)ident(nil?)operator(\)) - reserved(end) - - reserved(def) method(test_layered_dispatching) - ident(mt_cats) operator(=) ident(do_method_call)operator(()instance_variable(@layered_controller)operator(,) stringoperator(\)) - ident(assert_equal)operator(()operator([)stringoperator(,) stringoperator(])operator(,) ident(mt_cats)operator(\)) - ident(blogger_cats) operator(=) ident(do_method_call)operator(()instance_variable(@layered_controller)operator(,) stringoperator(\)) - ident(assert_equal)operator(()operator([)stringoperator(,) stringoperator(])operator(,) ident(blogger_cats)operator(\)) - reserved(end) - - reserved(def) method(test_utf8) - instance_variable(@direct_controller)operator(.)ident(web_service_exception_reporting) operator(=) pre_constant(true) - global_variable($KCODE) operator(=) string - ident(assert_equal)operator(()constant(Utf8String)operator(,) ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(\))operator(\)) - ident(retval) operator(=) constant(SOAP)operator(::)constant(Processor)operator(.)ident(unmarshal)operator(()instance_variable(@response_body)operator(\))operator(.)ident(body)operator(.)ident(response) - ident(assert) ident(retval)operator(.)ident(is_a?)operator(()constant(SOAP)operator(::)constant(SOAPString)operator(\)) - - comment(# If $KCODE is not set to UTF-8, any strings with non-ASCII UTF-8 data) - comment(# will be sent back as base64 by SOAP4R. By the time we get it here though,) - comment(# it will be decoded back into a string. So lets read the base64 value) - comment(# from the message body directly.) - global_variable($KCODE) operator(=) string - ident(do_method_call)operator(()instance_variable(@direct_controller)operator(,) stringoperator(\)) - ident(retval) operator(=) constant(SOAP)operator(::)constant(Processor)operator(.)ident(unmarshal)operator(()instance_variable(@response_body)operator(\))operator(.)ident(body)operator(.)ident(response) - ident(assert) ident(retval)operator(.)ident(is_a?)operator(()constant(SOAP)operator(::)constant(SOAPBase64)operator(\)) - ident(assert_equal) stringoperator(,) ident(retval)operator(.)ident(data)operator(.)ident(to_s) - reserved(end) - - ident(protected) - reserved(def) method(exception_message)operator(()ident(soap_fault_exception)operator(\)) - ident(soap_fault_exception)operator(.)ident(detail)operator(.)ident(cause)operator(.)ident(message) - reserved(end) - - reserved(def) method(is_exception?)operator(()ident(obj)operator(\)) - ident(obj)operator(.)ident(respond_to?)operator(()symbol(:detail)operator(\)) operator(&&) ident(obj)operator(.)ident(detail)operator(.)ident(respond_to?)operator(()symbol(:cause)operator(\)) operator(&&) \ - ident(obj)operator(.)ident(detail)operator(.)ident(cause)operator(.)ident(is_a?)operator(()constant(Exception)operator(\)) - reserved(end) - - reserved(def) method(service_name)operator(()ident(container)operator(\)) - ident(container)operator(.)ident(is_a?)operator(()constant(DelegatedController)operator(\)) operator(?) string operator(:) string - reserved(end) - - reserved(def) method(ensure_valid_wsdl_generation)operator(()ident(controller)operator(,) ident(expected_namespace)operator(\)) - ident(wsdl) operator(=) ident(controller)operator(.)ident(generate_wsdl) - ident(ensure_valid_wsdl)operator(()ident(controller)operator(,) ident(wsdl)operator(,) ident(expected_namespace)operator(\)) - reserved(end) - - reserved(def) method(ensure_valid_wsdl)operator(()ident(controller)operator(,) ident(wsdl)operator(,) ident(expected_namespace)operator(\)) - ident(definitions) operator(=) constant(WSDL)operator(::)constant(Parser)operator(.)ident(new)operator(.)ident(parse)operator(()ident(wsdl)operator(\)) - ident(assert)operator(()ident(definitions)operator(.)ident(is_a?)operator(()constant(WSDL)operator(::)constant(Definitions)operator(\))operator(\)) - ident(definitions)operator(.)ident(bindings)operator(.)ident(each) reserved(do) operator(|)ident(binding)operator(|) - ident(assert)operator(()ident(binding)operator(.)ident(name)operator(.)ident(name)operator(.)ident(index)operator(()stringoperator(\))operator(.)ident(nil?)operator(\)) - reserved(end) - ident(definitions)operator(.)ident(services)operator(.)ident(each) reserved(do) operator(|)ident(service)operator(|) - ident(service)operator(.)ident(ports)operator(.)ident(each) reserved(do) operator(|)ident(port)operator(|) - ident(assert)operator(()ident(port)operator(.)ident(name)operator(.)ident(name)operator(.)ident(index)operator(()stringoperator(\))operator(.)ident(nil?)operator(\)) - reserved(end) - reserved(end) - ident(types) operator(=) ident(definitions)operator(.)ident(collect_complextypes)operator(.)ident(map)operator({)operator(|)ident(x)operator(|) ident(x)operator(.)ident(name)operator(}) - ident(types)operator(.)ident(each) reserved(do) operator(|)ident(type)operator(|) - ident(assert)operator(()ident(type)operator(.)ident(namespace) operator(==) ident(expected_namespace)operator(\)) - reserved(end) - ident(location) operator(=) ident(definitions)operator(.)ident(services)operator([)integer(0)operator(])operator(.)ident(ports)operator([)integer(0)operator(])operator(.)ident(soap_address)operator(.)ident(location) - reserved(if) ident(controller)operator(.)ident(is_a?)operator(()constant(DelegatedController)operator(\)) - ident(assert_match) regexpoperator(,) ident(location) - reserved(elsif) ident(controller)operator(.)ident(is_a?)operator(()constant(DirectController)operator(\)) - ident(assert_match) regexpoperator(,) ident(location) - reserved(end) - ident(definitions)operator(.)ident(collect_complextypes) - reserved(end) - - reserved(def) method(ensure_valid_wsdl_action)operator(()ident(controller)operator(\)) - ident(test_request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new)operator(()operator({) string operator(=)operator(>) string operator(})operator(\)) - ident(test_request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(test_request)operator(.)ident(env)operator([)stringoperator(]) operator(=) string - ident(test_response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - ident(wsdl) operator(=) ident(controller)operator(.)ident(process)operator(()ident(test_request)operator(,) ident(test_response)operator(\))operator(.)ident(body) - ident(ensure_valid_wsdl)operator(()ident(controller)operator(,) ident(wsdl)operator(,) constant(DispatcherTest)operator(::)constant(WsdlNamespace)operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(TC_DispatcherActionControllerXmlRpc) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(DispatcherTest) - ident(include) constant(DispatcherCommonTests) - - reserved(def) method(setup) - instance_variable(@direct_controller) operator(=) constant(DirectController)operator(.)ident(new) - instance_variable(@delegated_controller) operator(=) constant(DelegatedController)operator(.)ident(new) - instance_variable(@layered_controller) operator(=) constant(LayeredController)operator(.)ident(new) - instance_variable(@virtual_controller) operator(=) constant(VirtualController)operator(.)ident(new) - instance_variable(@protocol) operator(=) constant(ActionWebService)operator(::)constant(Protocol)operator(::)constant(XmlRpc)operator(::)constant(XmlRpcProtocol)operator(.)ident(create)operator(()instance_variable(@direct_controller)operator(\)) - reserved(end) - - reserved(def) method(test_layered_dispatching) - ident(mt_cats) operator(=) ident(do_method_call)operator(()instance_variable(@layered_controller)operator(,) stringoperator(\)) - ident(assert_equal)operator(()operator([)stringoperator(,) stringoperator(])operator(,) ident(mt_cats)operator(\)) - ident(blogger_cats) operator(=) ident(do_method_call)operator(()instance_variable(@layered_controller)operator(,) stringoperator(\)) - ident(assert_equal)operator(()operator([)stringoperator(,) stringoperator(])operator(,) ident(blogger_cats)operator(\)) - reserved(end) - - reserved(def) method(test_multicall) - ident(response) operator(=) ident(do_method_call)operator(()instance_variable(@layered_controller)operator(,) stringoperator(,) operator([) - operator({)string operator(=)operator(>) stringoperator(})operator(,) - operator({)string operator(=)operator(>) stringoperator(})operator(,) - operator({)string operator(=)operator(>) stringoperator(})operator(,) - operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) operator([)stringoperator(])operator(})operator(,) - operator({)string operator(=)operator(>) stringoperator(})operator(,) - operator({)string operator(=)operator(>) stringoperator(})operator(,) - operator({)string operator(=)operator(>) stringoperator(})operator(,) - operator({)string operator(=)operator(>) stringoperator(}) - operator(])operator(\)) - ident(assert_equal) operator([) - operator([)operator([)stringoperator(,) stringoperator(])operator(])operator(,) - operator([)operator([)stringoperator(,) stringoperator(])operator(])operator(,) - operator([)pre_constant(true)operator(])operator(,) - operator([)stringoperator(])operator(,) - operator({)string operator(=)operator(>) integer(3)operator(,) string operator(=)operator(>) stringoperator(})operator(,) - operator({)string operator(=)operator(>) integer(3)operator(,) string operator(=)operator(>) stringoperator(})operator(,) - operator({)string operator(=)operator(>) integer(4)operator(,) string operator(=)operator(>) stringoperator(})operator(,) - operator({)string operator(=)operator(>) integer(4)operator(,) string operator(=)operator(>) stringoperator(}) - operator(])operator(,) ident(response) - reserved(end) - - ident(protected) - reserved(def) method(exception_message)operator(()ident(xmlrpc_fault_exception)operator(\)) - ident(xmlrpc_fault_exception)operator(.)ident(faultString) - reserved(end) - - reserved(def) method(is_exception?)operator(()ident(obj)operator(\)) - ident(obj)operator(.)ident(is_a?)operator(()constant(XMLRPC)operator(::)constant(FaultException)operator(\)) - reserved(end) - - reserved(def) method(service_name)operator(()ident(container)operator(\)) - ident(container)operator(.)ident(is_a?)operator(()constant(DelegatedController)operator(\)) operator(?) string operator(:) string - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(InvocationTest) - reserved(class) class(API) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(api_method) symbol(:add)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:int)operator(,) symbol(:int)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:int)operator(]) - ident(api_method) symbol(:transmogrify)operator(,) symbol(:expects_and_returns) operator(=)operator(>) operator([)symbol(:string)operator(]) - ident(api_method) symbol(:fail_with_reason) - ident(api_method) symbol(:fail_generic) - ident(api_method) symbol(:no_before) - ident(api_method) symbol(:no_after) - ident(api_method) symbol(:only_one) - ident(api_method) symbol(:only_two) - reserved(end) - - reserved(class) class(Interceptor) - ident(attr) symbol(:args) - - reserved(def) method(initialize) - instance_variable(@args) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(intercept)operator(()operator(*)ident(args)operator(\)) - instance_variable(@args) operator(=) ident(args) - reserved(end) - reserved(end) - - constant(InterceptorClass) operator(=) constant(Interceptor)operator(.)ident(new) - - reserved(class) class(Service) operator(<) constant(ActionController)operator(::)constant(Base) - ident(web_service_api) constant(API) - - ident(before_invocation) symbol(:intercept_before)operator(,) symbol(:except) operator(=)operator(>) operator([)symbol(:no_before)operator(]) - ident(after_invocation) symbol(:intercept_after)operator(,) symbol(:except) operator(=)operator(>) operator([)symbol(:no_after)operator(]) - ident(prepend_after_invocation) symbol(:intercept_after_first)operator(,) symbol(:except) operator(=)operator(>) operator([)symbol(:no_after)operator(]) - ident(prepend_before_invocation) symbol(:intercept_only)operator(,) symbol(:only) operator(=)operator(>) operator([)symbol(:only_one)operator(,) symbol(:only_two)operator(]) - ident(after_invocation)operator(()symbol(:only) operator(=)operator(>) operator([)symbol(:only_one)operator(])operator(\)) reserved(do) operator(|*)ident(args)operator(|) - ident(args)operator([)integer(0)operator(])operator(.)ident(instance_variable_set)operator(()stringoperator(,) ident(args)operator([)integer(1)operator(])operator(\)) - reserved(end) - ident(after_invocation) constant(InterceptorClass)operator(,) symbol(:only) operator(=)operator(>) operator([)symbol(:only_one)operator(]) - - ident(attr_accessor) symbol(:before_invoked) - ident(attr_accessor) symbol(:after_invoked) - ident(attr_accessor) symbol(:after_first_invoked) - ident(attr_accessor) symbol(:only_invoked) - ident(attr_accessor) symbol(:block_invoked) - ident(attr_accessor) symbol(:invocation_result) - - reserved(def) method(initialize) - instance_variable(@before_invoked) operator(=) pre_constant(nil) - instance_variable(@after_invoked) operator(=) pre_constant(nil) - instance_variable(@after_first_invoked) operator(=) pre_constant(nil) - instance_variable(@only_invoked) operator(=) pre_constant(nil) - instance_variable(@invocation_result) operator(=) pre_constant(nil) - instance_variable(@block_invoked) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(add)operator(()ident(a)operator(,) ident(b)operator(\)) - ident(a) operator(+) ident(b) - reserved(end) - - reserved(def) method(transmogrify)operator(()ident(str)operator(\)) - ident(str)operator(.)ident(upcase) - reserved(end) - - reserved(def) method(fail_with_reason) - reserved(end) - - reserved(def) method(fail_generic) - reserved(end) - - reserved(def) method(no_before) - integer(5) - reserved(end) - - reserved(def) method(no_after) - reserved(end) - - reserved(def) method(only_one) - reserved(end) - - reserved(def) method(only_two) - reserved(end) - - ident(protected) - reserved(def) method(intercept_before)operator(()ident(name)operator(,) ident(args)operator(\)) - instance_variable(@before_invoked) operator(=) ident(name) - reserved(return) operator([)pre_constant(false)operator(,) stringoperator(]) reserved(if) ident(name) operator(==) symbol(:fail_with_reason) - reserved(return) pre_constant(false) reserved(if) ident(name) operator(==) symbol(:fail_generic) - reserved(end) - - reserved(def) method(intercept_after)operator(()ident(name)operator(,) ident(args)operator(,) ident(result)operator(\)) - instance_variable(@after_invoked) operator(=) ident(name) - instance_variable(@invocation_result) operator(=) ident(result) - reserved(end) - - reserved(def) method(intercept_after_first)operator(()ident(name)operator(,) ident(args)operator(,) ident(result)operator(\)) - instance_variable(@after_first_invoked) operator(=) ident(name) - reserved(end) - - reserved(def) method(intercept_only)operator(()ident(name)operator(,) ident(args)operator(\)) - ident(raise) string reserved(unless) ident(name) operator(==) symbol(:only_one) operator(||) ident(name) operator(==) symbol(:only_two) - instance_variable(@only_invoked) operator(=) ident(name) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(TC_Invocation) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(ActionWebService)operator(::)constant(Invocation) - - reserved(def) method(setup) - instance_variable(@service) operator(=) constant(InvocationTest)operator(::)constant(Service)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_invocation) - ident(assert)operator(()ident(perform_invocation)operator(()symbol(:add)operator(,) integer(5)operator(,) integer(10)operator(\)) operator(==) integer(15)operator(\)) - ident(assert)operator(()ident(perform_invocation)operator(()symbol(:transmogrify)operator(,) stringoperator(\)) operator(==) stringoperator(\)) - ident(assert_raises)operator(()constant(NoMethodError)operator(\)) reserved(do) - ident(perform_invocation)operator(()symbol(:nonexistent_method_xyzzy)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_interceptor_registration) - ident(assert)operator(()constant(InvocationTest)operator(::)constant(Service)operator(.)ident(before_invocation_interceptors)operator(.)ident(length) operator(==) integer(2)operator(\)) - ident(assert)operator(()constant(InvocationTest)operator(::)constant(Service)operator(.)ident(after_invocation_interceptors)operator(.)ident(length) operator(==) integer(4)operator(\)) - ident(assert_equal)operator(()symbol(:intercept_only)operator(,) constant(InvocationTest)operator(::)constant(Service)operator(.)ident(before_invocation_interceptors)operator([)integer(0)operator(])operator(\)) - ident(assert_equal)operator(()symbol(:intercept_after_first)operator(,) constant(InvocationTest)operator(::)constant(Service)operator(.)ident(after_invocation_interceptors)operator([)integer(0)operator(])operator(\)) - reserved(end) - - reserved(def) method(test_interception) - ident(assert)operator(()instance_variable(@service)operator(.)ident(before_invoked)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(after_invoked)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(only_invoked)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(block_invoked)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(invocation_result)operator(.)ident(nil?)operator(\)) - ident(perform_invocation)operator(()symbol(:add)operator(,) integer(20)operator(,) integer(50)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(before_invoked) operator(==) symbol(:add)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(after_invoked) operator(==) symbol(:add)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(invocation_result) operator(==) integer(70)operator(\)) - reserved(end) - - reserved(def) method(test_interception_canceling) - ident(reason) operator(=) pre_constant(nil) - ident(perform_invocation)operator(()symbol(:fail_with_reason)operator(\))operator({)operator(|)ident(r)operator(|) ident(reason) operator(=) ident(r)operator(}) - ident(assert)operator(()instance_variable(@service)operator(.)ident(before_invoked) operator(==) symbol(:fail_with_reason)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(after_invoked)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(invocation_result)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()ident(reason) operator(==) stringoperator(\)) - ident(reason) operator(=) pre_constant(true) - instance_variable(@service)operator(.)ident(before_invoked) operator(=) instance_variable(@service)operator(.)ident(after_invoked) operator(=) instance_variable(@service)operator(.)ident(invocation_result) operator(=) pre_constant(nil) - ident(perform_invocation)operator(()symbol(:fail_generic)operator(\))operator({)operator(|)ident(r)operator(|) ident(reason) operator(=) ident(r)operator(}) - ident(assert)operator(()instance_variable(@service)operator(.)ident(before_invoked) operator(==) symbol(:fail_generic)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(after_invoked)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(invocation_result)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()ident(reason) operator(==) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_interception_except_conditions) - ident(perform_invocation)operator(()symbol(:no_before)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(before_invoked)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(after_first_invoked) operator(==) symbol(:no_before)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(after_invoked) operator(==) symbol(:no_before)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(invocation_result) operator(==) integer(5)operator(\)) - instance_variable(@service)operator(.)ident(before_invoked) operator(=) instance_variable(@service)operator(.)ident(after_invoked) operator(=) instance_variable(@service)operator(.)ident(invocation_result) operator(=) pre_constant(nil) - ident(perform_invocation)operator(()symbol(:no_after)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(before_invoked) operator(==) symbol(:no_after)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(after_invoked)operator(.)ident(nil?)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(invocation_result)operator(.)ident(nil?)operator(\)) - reserved(end) - - reserved(def) method(test_interception_only_conditions) - ident(assert)operator(()instance_variable(@service)operator(.)ident(only_invoked)operator(.)ident(nil?)operator(\)) - ident(perform_invocation)operator(()symbol(:only_one)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(only_invoked) operator(==) symbol(:only_one)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(block_invoked) operator(==) symbol(:only_one)operator(\)) - ident(assert)operator(()constant(InvocationTest)operator(::)constant(InterceptorClass)operator(.)ident(args)operator([)integer(1)operator(]) operator(==) symbol(:only_one)operator(\)) - instance_variable(@service)operator(.)ident(only_invoked) operator(=) pre_constant(nil) - ident(perform_invocation)operator(()symbol(:only_two)operator(\)) - ident(assert)operator(()instance_variable(@service)operator(.)ident(only_invoked) operator(==) symbol(:only_two)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(perform_invocation)operator(()ident(method_name)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - instance_variable(@service)operator(.)ident(perform_invocation)operator(()ident(method_name)operator(,) ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -constant(ActionController)operator(::)constant(Routing)operator(::)constant(Routes)operator(.)ident(draw) reserved(do) operator(|)ident(map)operator(|) - ident(map)operator(.)ident(connect) stringoperator(,) symbol(:controller) operator(=)operator(>) string - ident(map)operator(.)ident(connect) string -reserved(end) - -constant(ActionController)operator(::)constant(Base)operator(.)ident(template_root) operator(=) string - -reserved(class) class(ScaffoldPerson) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:id)operator(,) symbol(:int) - ident(member) symbol(:name)operator(,) symbol(:string) - ident(member) symbol(:birth)operator(,) symbol(:date) - - reserved(def) method(==)operator(()ident(other)operator(\)) - pre_constant(self)operator(.)ident(id) operator(==) ident(other)operator(.)ident(id) operator(&&) pre_constant(self)operator(.)ident(name) operator(==) ident(other)operator(.)ident(name) - reserved(end) -reserved(end) - -reserved(class) class(ScaffoldedControllerTestAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(api_method) symbol(:hello)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:integer)operator(=)operator(>)symbol(:int)operator(})operator(,) symbol(:string)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:bool)operator(]) - ident(api_method) symbol(:hello_struct_param)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:person) operator(=)operator(>) constant(ScaffoldPerson)operator(})operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:bool)operator(]) - ident(api_method) symbol(:date_of_birth)operator(,) symbol(:expects) operator(=)operator(>) operator([)constant(ScaffoldPerson)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:string)operator(]) - ident(api_method) symbol(:bye)operator(,) symbol(:returns) operator(=)operator(>) operator([)operator([)constant(ScaffoldPerson)operator(])operator(]) - ident(api_method) symbol(:date_diff)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:start_date) operator(=)operator(>) symbol(:date)operator(})operator(,) operator({)symbol(:end_date) operator(=)operator(>) symbol(:date)operator(})operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:int)operator(]) - ident(api_method) symbol(:time_diff)operator(,) symbol(:expects) operator(=)operator(>) operator([)operator({)symbol(:start_time) operator(=)operator(>) symbol(:time)operator(})operator(,) operator({)symbol(:end_time) operator(=)operator(>) symbol(:time)operator(})operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:int)operator(]) - ident(api_method) symbol(:base64_upcase)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:base64)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:base64)operator(]) -reserved(end) - -reserved(class) class(ScaffoldedController) operator(<) constant(ActionController)operator(::)constant(Base) - ident(web_service_api) constant(ScaffoldedControllerTestAPI) - ident(web_service_scaffold) symbol(:scaffold_invoke) - - reserved(def) method(hello)operator(()ident(int)operator(,) ident(string)operator(\)) - integer(0) - reserved(end) - - reserved(def) method(hello_struct_param)operator(()ident(person)operator(\)) - integer(0) - reserved(end) - - reserved(def) method(date_of_birth)operator(()ident(person)operator(\)) - ident(person)operator(.)ident(birth)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(bye) - operator([)constant(ScaffoldPerson)operator(.)ident(new)operator(()symbol(:id) operator(=)operator(>) integer(1)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(,) constant(ScaffoldPerson)operator(.)ident(new)operator(()symbol(:id) operator(=)operator(>) integer(2)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(]) - reserved(end) - - reserved(def) method(rescue_action)operator(()ident(e)operator(\)) - ident(raise) ident(e) - reserved(end) - - reserved(def) method(date_diff)operator(()ident(start_date)operator(,) ident(end_date)operator(\)) - ident(end_date) operator(-) ident(start_date) - reserved(end) - - reserved(def) method(time_diff)operator(()ident(start_time)operator(,) ident(end_time)operator(\)) - ident(end_time) operator(-) ident(start_time) - reserved(end) - - reserved(def) method(base64_upcase)operator(()ident(data)operator(\)) - ident(data)operator(.)ident(upcase) - reserved(end) -reserved(end) - -reserved(class) class(ScaffoldedControllerTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@controller) operator(=) constant(ScaffoldedController)operator(.)ident(new) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_scaffold_invoke) - ident(get) symbol(:scaffold_invoke) - ident(assert_rendered_file) string - reserved(end) - - reserved(def) method(test_scaffold_invoke_method_params) - ident(get) symbol(:scaffold_invoke_method_params)operator(,) symbol(:service) operator(=)operator(>) stringoperator(,) symbol(:method) operator(=)operator(>) string - ident(assert_rendered_file) string - reserved(end) - - reserved(def) method(test_scaffold_invoke_method_params_with_struct) - ident(get) symbol(:scaffold_invoke_method_params)operator(,) symbol(:service) operator(=)operator(>) stringoperator(,) symbol(:method) operator(=)operator(>) string - ident(assert_rendered_file) string - ident(assert_tag) symbol(:tag) operator(=)operator(>) stringoperator(,) symbol(:attributes) operator(=)operator(>) operator({)symbol(:name) operator(=)operator(>) stringoperator(}) - reserved(end) - - reserved(def) method(test_scaffold_invoke_submit_hello) - ident(post) symbol(:scaffold_invoke_submit)operator(,) symbol(:service) operator(=)operator(>) stringoperator(,) symbol(:method) operator(=)operator(>) stringoperator(,) symbol(:method_params) operator(=)operator(>) operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(}) - ident(assert_rendered_file) string - ident(assert_equal) pre_constant(false)operator(,) instance_variable(@controller)operator(.)ident(instance_eval)operator({) instance_variable(@method_return_value) operator(}) - reserved(end) - - reserved(def) method(test_scaffold_invoke_submit_bye) - ident(post) symbol(:scaffold_invoke_submit)operator(,) symbol(:service) operator(=)operator(>) stringoperator(,) symbol(:method) operator(=)operator(>) string - ident(assert_rendered_file) string - ident(persons) operator(=) operator([)constant(ScaffoldPerson)operator(.)ident(new)operator(()symbol(:id) operator(=)operator(>) integer(1)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(,) constant(ScaffoldPerson)operator(.)ident(new)operator(()symbol(:id) operator(=)operator(>) integer(2)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\))operator(]) - ident(assert_equal) ident(persons)operator(,) instance_variable(@controller)operator(.)ident(instance_eval)operator({) instance_variable(@method_return_value) operator(}) - reserved(end) - - reserved(def) method(test_scaffold_date_params) - ident(get) symbol(:scaffold_invoke_method_params)operator(,) symbol(:service) operator(=)operator(>) stringoperator(,) symbol(:method) operator(=)operator(>) string - operator(()integer(0)operator(..)integer(1)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(param)operator(|) - operator(()integer(1)operator(..)integer(3)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(date_part)operator(|) - ident(assert_tag) symbol(:tag) operator(=)operator(>) stringoperator(,) symbol(:attributes) operator(=)operator(>) operator({)symbol(:name) operator(=)operator(>) stringcontent(][)inlinecontent(])delimiter(")>operator(})operator(,) - symbol(:children) operator(=)operator(>) operator({)symbol(:greater_than) operator(=)operator(>) integer(1)operator(,) symbol(:only) operator(=)operator(>) operator({)symbol(:tag) operator(=)operator(>) stringoperator(})operator(}) - reserved(end) - reserved(end) - - ident(post) symbol(:scaffold_invoke_submit)operator(,) symbol(:service) operator(=)operator(>) stringoperator(,) symbol(:method) operator(=)operator(>) stringoperator(,) - symbol(:method_params) operator(=)operator(>) operator({)string operator(=)operator(>) operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(,) string operator(=)operator(>) operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(}) - ident(assert_equal) integer(1)operator(,) instance_variable(@controller)operator(.)ident(instance_eval)operator({) instance_variable(@method_return_value) operator(}) - reserved(end) - - reserved(def) method(test_scaffold_struct_date_params) - ident(post) symbol(:scaffold_invoke_submit)operator(,) symbol(:service) operator(=)operator(>) stringoperator(,) symbol(:method) operator(=)operator(>) stringoperator(,) - symbol(:method_params) operator(=)operator(>) operator({)string operator(=)operator(>) operator({)string operator(=)operator(>) operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(}) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(instance_eval)operator({) instance_variable(@method_return_value) operator(}) - reserved(end) - - reserved(def) method(test_scaffold_time_params) - ident(get) symbol(:scaffold_invoke_method_params)operator(,) symbol(:service) operator(=)operator(>) stringoperator(,) symbol(:method) operator(=)operator(>) string - operator(()integer(0)operator(..)integer(1)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(param)operator(|) - operator(()integer(1)operator(..)integer(6)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(date_part)operator(|) - ident(assert_tag) symbol(:tag) operator(=)operator(>) stringoperator(,) symbol(:attributes) operator(=)operator(>) operator({)symbol(:name) operator(=)operator(>) stringcontent(][)inlinecontent(])delimiter(")>operator(})operator(,) - symbol(:children) operator(=)operator(>) operator({)symbol(:greater_than) operator(=)operator(>) integer(1)operator(,) symbol(:only) operator(=)operator(>) operator({)symbol(:tag) operator(=)operator(>) stringoperator(})operator(}) - reserved(end) - reserved(end) - - ident(post) symbol(:scaffold_invoke_submit)operator(,) symbol(:service) operator(=)operator(>) stringoperator(,) symbol(:method) operator(=)operator(>) stringoperator(,) - symbol(:method_params) operator(=)operator(>) operator({)string operator(=)operator(>) operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(,) - string operator(=)operator(>) operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(}) - ident(assert_equal) integer(86400)operator(,) instance_variable(@controller)operator(.)ident(instance_eval)operator({) instance_variable(@method_return_value) operator(}) - reserved(end) - - reserved(def) method(test_scaffold_base64) - ident(get) symbol(:scaffold_invoke_method_params)operator(,) symbol(:service) operator(=)operator(>) stringoperator(,) symbol(:method) operator(=)operator(>) string - ident(assert_tag) symbol(:tag) operator(=)operator(>) stringoperator(,) symbol(:attributes) operator(=)operator(>) operator({)symbol(:name) operator(=)operator(>) stringoperator(}) - - ident(post) symbol(:scaffold_invoke_submit)operator(,) symbol(:service) operator(=)operator(>) stringoperator(,) symbol(:method) operator(=)operator(>) stringoperator(,) symbol(:method_params) operator(=)operator(>) operator({)string operator(=)operator(>) stringoperator(}) - ident(assert_equal) stringoperator(,) instance_variable(@controller)operator(.)ident(instance_eval)operator({) instance_variable(@method_return_value) operator(}) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(StructTest) - reserved(class) class(Struct) operator(<) constant(ActionWebService)operator(::)constant(Struct) - ident(member) symbol(:id)operator(,) constant(Integer) - ident(member) symbol(:name)operator(,) constant(String) - ident(member) symbol(:items)operator(,) operator([)constant(String)operator(]) - ident(member) symbol(:deleted)operator(,) symbol(:bool) - ident(member) symbol(:emails)operator(,) operator([)symbol(:string)operator(]) - reserved(end) -reserved(end) - -reserved(class) class(TC_Struct) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(include) constant(StructTest) - - reserved(def) method(setup) - instance_variable(@struct) operator(=) constant(Struct)operator(.)ident(new)operator(()symbol(:id) operator(=)operator(>) integer(5)operator(,) - symbol(:name) operator(=)operator(>) stringoperator(,) - symbol(:items) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(,) - symbol(:deleted) operator(=)operator(>) pre_constant(true)operator(,) - symbol(:emails) operator(=)operator(>) operator([)stringoperator(])operator(\)) - reserved(end) - - reserved(def) method(test_members) - ident(assert_equal)operator(()integer(5)operator(,) constant(Struct)operator(.)ident(members)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()constant(Integer)operator(,) constant(Struct)operator(.)ident(members)operator([)symbol(:id)operator(])operator(.)ident(type_class)operator(\)) - ident(assert_equal)operator(()constant(String)operator(,) constant(Struct)operator(.)ident(members)operator([)symbol(:name)operator(])operator(.)ident(type_class)operator(\)) - ident(assert_equal)operator(()constant(String)operator(,) constant(Struct)operator(.)ident(members)operator([)symbol(:items)operator(])operator(.)ident(element_type)operator(.)ident(type_class)operator(\)) - ident(assert_equal)operator(()constant(TrueClass)operator(,) constant(Struct)operator(.)ident(members)operator([)symbol(:deleted)operator(])operator(.)ident(type_class)operator(\)) - ident(assert_equal)operator(()constant(String)operator(,) constant(Struct)operator(.)ident(members)operator([)symbol(:emails)operator(])operator(.)ident(element_type)operator(.)ident(type_class)operator(\)) - reserved(end) - - reserved(def) method(test_initializer_and_lookup) - ident(assert_equal)operator(()integer(5)operator(,) instance_variable(@struct)operator(.)ident(id)operator(\)) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@struct)operator(.)ident(name)operator(\)) - ident(assert_equal)operator(()operator([)stringoperator(,) stringoperator(])operator(,) instance_variable(@struct)operator(.)ident(items)operator(\)) - ident(assert_equal)operator(()pre_constant(true)operator(,) instance_variable(@struct)operator(.)ident(deleted)operator(\)) - ident(assert_equal)operator(()operator([)stringoperator(])operator(,) instance_variable(@struct)operator(.)ident(emails)operator(\)) - ident(assert_equal)operator(()integer(5)operator(,) instance_variable(@struct)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()stringoperator(,) instance_variable(@struct)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()operator([)stringoperator(,) stringoperator(])operator(,) instance_variable(@struct)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()pre_constant(true)operator(,) instance_variable(@struct)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()operator([)stringoperator(])operator(,) instance_variable(@struct)operator([)stringoperator(])operator(\)) - reserved(end) - - reserved(def) method(test_each_pair) - instance_variable(@struct)operator(.)ident(each_pair) reserved(do) operator(|)ident(name)operator(,) ident(value)operator(|) - ident(assert_equal) instance_variable(@struct)operator(.)ident(__send__)operator(()ident(name)operator(\))operator(,) ident(value) - ident(assert_equal) instance_variable(@struct)operator([)ident(name)operator(])operator(,) ident(value) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string - -reserved(class) class(TestInvokeAPI) operator(<) constant(ActionWebService)operator(::)constant(API)operator(::)constant(Base) - ident(api_method) symbol(:add)operator(,) symbol(:expects) operator(=)operator(>) operator([)symbol(:int)operator(,) symbol(:int)operator(])operator(,) symbol(:returns) operator(=)operator(>) operator([)symbol(:int)operator(]) -reserved(end) - -reserved(class) class(TestInvokeService) operator(<) constant(ActionWebService)operator(::)constant(Base) - ident(web_service_api) constant(TestInvokeAPI) - - ident(attr) symbol(:invoked) - - reserved(def) method(add)operator(()ident(a)operator(,) ident(b)operator(\)) - instance_variable(@invoked) operator(=) pre_constant(true) - ident(a) operator(+) ident(b) - reserved(end) -reserved(end) - -reserved(class) class(TestController) operator(<) constant(ActionController)operator(::)constant(Base) - reserved(def) method(rescue_action)operator(()ident(e)operator(\))operator(;) ident(raise) ident(e)operator(;) reserved(end) -reserved(end) - -reserved(class) class(TestInvokeDirectController) operator(<) constant(TestController) - ident(web_service_api) constant(TestInvokeAPI) - - ident(attr) symbol(:invoked) - - reserved(def) method(add) - instance_variable(@invoked) operator(=) pre_constant(true) - instance_variable(@method_params)operator([)integer(0)operator(]) operator(+) instance_variable(@method_params)operator([)integer(1)operator(]) - reserved(end) -reserved(end) - -reserved(class) class(TestInvokeDelegatedController) operator(<) constant(TestController) - ident(web_service_dispatching_mode) symbol(:delegated) - ident(web_service) symbol(:service)operator(,) constant(TestInvokeService)operator(.)ident(new) -reserved(end) - -reserved(class) class(TestInvokeLayeredController) operator(<) constant(TestController) - ident(web_service_dispatching_mode) symbol(:layered) - ident(web_service)operator(()symbol(:one)operator(\)) operator({) instance_variable(@service_one) operator(||=) constant(TestInvokeService)operator(.)ident(new) operator(}) - ident(web_service)operator(()symbol(:two)operator(\)) operator({) instance_variable(@service_two) operator(||=) constant(TestInvokeService)operator(.)ident(new) operator(}) -reserved(end) - -reserved(class) class(TestInvokeTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@request) operator(=) constant(ActionController)operator(::)constant(TestRequest)operator(.)ident(new) - instance_variable(@response) operator(=) constant(ActionController)operator(::)constant(TestResponse)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_direct_add) - instance_variable(@controller) operator(=) constant(TestInvokeDirectController)operator(.)ident(new) - ident(assert_equal) pre_constant(nil)operator(,) instance_variable(@controller)operator(.)ident(invoked) - ident(result) operator(=) ident(invoke) symbol(:add)operator(,) integer(25)operator(,) integer(25) - ident(assert_equal) integer(50)operator(,) ident(result) - ident(assert_equal) pre_constant(true)operator(,) instance_variable(@controller)operator(.)ident(invoked) - reserved(end) - - reserved(def) method(test_delegated_add) - instance_variable(@controller) operator(=) constant(TestInvokeDelegatedController)operator(.)ident(new) - ident(assert_equal) pre_constant(nil)operator(,) instance_variable(@controller)operator(.)ident(web_service_object)operator(()symbol(:service)operator(\))operator(.)ident(invoked) - ident(result) operator(=) ident(invoke_delegated) symbol(:service)operator(,) symbol(:add)operator(,) integer(100)operator(,) integer(50) - ident(assert_equal) integer(150)operator(,) ident(result) - ident(assert_equal) pre_constant(true)operator(,) instance_variable(@controller)operator(.)ident(web_service_object)operator(()symbol(:service)operator(\))operator(.)ident(invoked) - reserved(end) - - reserved(def) method(test_layered_add) - operator([)symbol(:soap)operator(,) symbol(:xmlrpc)operator(])operator(.)ident(each) reserved(do) operator(|)ident(protocol)operator(|) - instance_variable(@protocol) operator(=) ident(protocol) - operator([)symbol(:one)operator(,) symbol(:two)operator(])operator(.)ident(each) reserved(do) operator(|)ident(service)operator(|) - instance_variable(@controller) operator(=) constant(TestInvokeLayeredController)operator(.)ident(new) - ident(assert_equal) pre_constant(nil)operator(,) instance_variable(@controller)operator(.)ident(web_service_object)operator(()ident(service)operator(\))operator(.)ident(invoked) - ident(result) operator(=) ident(invoke_layered) ident(service)operator(,) symbol(:add)operator(,) integer(200)operator(,) integer(-50) - ident(assert_equal) integer(150)operator(,) ident(result) - ident(assert_equal) pre_constant(true)operator(,) instance_variable(@controller)operator(.)ident(web_service_object)operator(()ident(service)operator(\))operator(.)ident(invoked) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_layered_fail_with_wrong_number_of_arguments) - operator([)symbol(:soap)operator(,) symbol(:xmlrpc)operator(])operator(.)ident(each) reserved(do) operator(|)ident(protocol)operator(|) - instance_variable(@protocol) operator(=) ident(protocol) - operator([)symbol(:one)operator(,) symbol(:two)operator(])operator(.)ident(each) reserved(do) operator(|)ident(service)operator(|) - instance_variable(@controller) operator(=) constant(TestInvokeLayeredController)operator(.)ident(new) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) ident(invoke_layered) ident(service)operator(,) symbol(:add)operator(,) integer(1) operator(}) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_delegated_fail_with_wrong_number_of_arguments) - instance_variable(@controller) operator(=) constant(TestInvokeDelegatedController)operator(.)ident(new) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) ident(invoke_delegated) symbol(:service)operator(,) symbol(:add)operator(,) integer(1) operator(}) - reserved(end) - - reserved(def) method(test_direct_fail_with_wrong_number_of_arguments) - instance_variable(@controller) operator(=) constant(TestInvokeDirectController)operator(.)ident(new) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) ident(invoke) symbol(:add)operator(,) integer(1) operator(}) - reserved(end) - -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()pre_constant(STDOUT)operator(\)) - -comment(# Database setup ---------------) - -ident(logger)operator(.)ident(info) string - -operator([) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) -operator(])operator(.)ident(each) operator({) operator(|)ident(statement)operator(|) - comment(# Tables doesn't necessarily already exist) - reserved(begin)operator(;) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(execute)operator(()ident(statement)operator(\))operator(;) reserved(rescue) constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(;) reserved(end) -operator(}) - - -comment(# Class setup ---------------) - -reserved(class) class(Company) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_and_belongs_to_many) symbol(:people)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:join_table) operator(=)operator(>) stringoperator(,) symbol(:table_name) operator(=)operator(>) string -reserved(end) - -reserved(class) class(Firm) operator(<) constant(Company) - ident(has_many) symbol(:clients)operator(,) symbol(:foreign_key) operator(=)operator(>) string - - reserved(def) method(people_with_all_clients) - ident(clients)operator(.)ident(inject)operator(()operator([)operator(])operator(\)) operator({) operator(|)ident(people)operator(,) ident(client)operator(|) ident(people) operator(+) ident(client)operator(.)ident(people) operator(}) - reserved(end) -reserved(end) - -reserved(class) class(Client) operator(<) constant(Company) - ident(belongs_to) symbol(:firm)operator(,) symbol(:foreign_key) operator(=)operator(>) string -reserved(end) - -reserved(class) class(Person) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_and_belongs_to_many) symbol(:companies)operator(,) symbol(:join_table) operator(=)operator(>) string - reserved(def) pre_constant(self)operator(.)method(table_name)operator(()operator(\)) string reserved(end) -reserved(end) - - -comment(# Usage ---------------) - -ident(logger)operator(.)ident(info) string - -constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\))operator(.)ident(save) -constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) integer(1)operator(\))operator(.)ident(save) -constant(Person)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\))operator(.)ident(save) - - -ident(logger)operator(.)ident(info) string - -ident(next_angle) operator(=) constant(Company)operator(.)ident(find)operator(()integer(1)operator(\)) -ident(next_angle) operator(=) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\)) -ident(next_angle) operator(=) constant(Company)operator(.)ident(find_first) string -ident(next_angle) operator(=) constant(Firm)operator(.)ident(find_by_sql)operator(()stringoperator(\))operator(.)ident(first) - -constant(Firm) operator(===) ident(next_angle) - - -ident(logger)operator(.)ident(info) string - -ident(next_angle)operator(.)ident(has_clients?) -ident(next_angle)operator(.)ident(clients_count) -ident(all_clients) operator(=) ident(next_angle)operator(.)ident(clients) - -ident(thirty_seven_signals) operator(=) ident(next_angle)operator(.)ident(find_in_clients)operator(()integer(2)operator(\)) - - -ident(logger)operator(.)ident(info) string - -ident(thirty_seven_signals)operator(.)ident(has_firm?) -ident(thirty_seven_signals)operator(.)ident(firm?)operator(()ident(next_angle)operator(\)) - - -ident(logger)operator(.)ident(info) string - -ident(david) operator(=) constant(Person)operator(.)ident(find)operator(()integer(1)operator(\)) -ident(david)operator(.)ident(add_companies)operator(()ident(thirty_seven_signals)operator(,) ident(next_angle)operator(\)) -ident(david)operator(.)ident(companies)operator(.)ident(include?)operator(()ident(next_angle)operator(\)) -ident(david)operator(.)ident(companies_count) operator(==) integer(2) - -ident(david)operator(.)ident(remove_companies)operator(()ident(next_angle)operator(\)) -ident(david)operator(.)ident(companies_count) operator(==) integer(1) - -ident(thirty_seven_signals)operator(.)ident(people)operator(.)ident(include?)operator(()ident(david)operator(\))comment(# Be sure to change the mysql_connection details and create a database for the example) - -global_variable($:) operator(<<) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -ident(require) string -ident(require) stringoperator(;) reserved(class) class(Logger)operator(;) reserved(def) method(format_message)operator(()ident(severity)operator(,) ident(timestamp)operator(,) ident(msg)operator(,) ident(progname)operator(\)) stringchar(\\n)delimiter(")> reserved(end)operator(;) reserved(end) - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()pre_constant(STDOUT)operator(\)) -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:host) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) string -operator(\)) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()pre_constant(STDOUT)operator(\)) - -comment(# Database setup ---------------) - -ident(logger)operator(.)ident(info) string - -operator([) stringoperator(,) - string -operator(])operator(.)ident(each) operator({) operator(|)ident(statement)operator(|) - reserved(begin)operator(;) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(execute)operator(()ident(statement)operator(\))operator(;) reserved(rescue) constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(;) reserved(end) comment(# Tables doesn't necessarily already exist) -operator(}) - - -comment(# Class setup ---------------) - -reserved(class) class(Person) operator(<) constant(ActiveRecord)operator(::)constant(Base) - comment(# Using ) - reserved(def) pre_constant(self)operator(.)method(authenticate)operator(()ident(name)operator(,) ident(pass)operator(\)) - comment(# find_first "name = '#{name}' AND pass = '#{pass}'" would be open to sql-injection (in a web-app scenario\)) - ident(find_first) operator([) stringoperator(,) ident(name)operator(,) ident(pass) operator(]) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(name_exists?)operator(()ident(name)operator(,) ident(id) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(id)operator(.)ident(nil?) - ident(condition) operator(=) operator([) stringoperator(,) ident(name) operator(]) - reserved(else) - comment(# Check if anyone else than the person identified by person_id has that user_name) - ident(condition) operator(=) operator([) string %d)delimiter(")>operator(,) ident(name)operator(,) ident(id) operator(]) - reserved(end) - - operator(!)ident(find_first)operator(()ident(condition)operator(\))operator(.)ident(nil?) - reserved(end) - - reserved(def) method(email_address_with_name) - stringchar(\\")content( <)inlinecontent(>)delimiter(")> - reserved(end) - - ident(protected) - reserved(def) method(validate) - ident(errors)operator(.)ident(add_on_empty)operator(()stringoperator(\)) - ident(errors)operator(.)ident(add)operator(()stringoperator(,) stringoperator(\)) reserved(unless) ident(email_address_valid?) - reserved(end) - - reserved(def) method(validate_on_create) - reserved(if) ident(attribute_present?)operator(()stringoperator(\)) operator(&&) constant(Person)operator(.)ident(name_exists?)operator(()ident(name)operator(\)) - ident(errors)operator(.)ident(add)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(validate_on_update) - reserved(if) ident(attribute_present?)operator(()stringoperator(\)) operator(&&) constant(Person)operator(.)ident(name_exists?)operator(()ident(name)operator(,) ident(id)operator(\)) - ident(errors)operator(.)ident(add)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(email_address_valid?)operator(()operator(\)) ident(email) operator(=)operator(~) regexp reserved(end) -reserved(end) - -comment(# Usage ---------------) - -ident(logger)operator(.)ident(info) string -ident(david) operator(=) constant(Person)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) -reserved(unless) ident(david)operator(.)ident(save) - ident(puts) stringcontent( error(s\))delimiter(")> - ident(david)operator(.)ident(errors)operator(.)ident(each_full) operator({) operator(|)ident(error)operator(|) ident(puts) ident(error) operator(}) -reserved(end) - -ident(david)operator(.)ident(pass) operator(=) string -ident(david)operator(.)ident(email) operator(=) string -reserved(unless) ident(david)operator(.)ident(save) - ident(puts) stringcontent( error(s\))delimiter(")> - ident(puts) string operator(+) ident(david)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\)) -reserved(end) - -ident(david)operator(.)ident(email) operator(=) string -reserved(if) ident(david)operator(.)ident(save) reserved(then) ident(puts) string reserved(end) - - -ident(another_david) operator(=) constant(Person)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) -reserved(unless) ident(another_david)operator(.)ident(save) - ident(puts) string operator(+) ident(another_david)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\)) -ident(endrequire) string -ident(require) string -ident(require) string - -ident(include) constant(Config) - -comment(# this was adapted from rdoc's install.rb by ways of Log4r) - -global_variable($sitedir) operator(=) constant(CONFIG)operator([)stringoperator(]) -reserved(unless) global_variable($sitedir) - ident(version) operator(=) constant(CONFIG)operator([)stringoperator(]) operator(+) string operator(+) constant(CONFIG)operator([)stringoperator(]) - global_variable($libdir) operator(=) constant(File)operator(.)ident(join)operator(()constant(CONFIG)operator([)stringoperator(])operator(,) stringoperator(,) ident(version)operator(\)) - global_variable($sitedir) operator(=) global_variable($:)operator(.)ident(find) operator({)operator(|)ident(x)operator(|) ident(x) operator(=)operator(~) regexp operator(}) - reserved(if) operator(!)global_variable($sitedir) - global_variable($sitedir) operator(=) constant(File)operator(.)ident(join)operator(()global_variable($libdir)operator(,) stringoperator(\)) - reserved(elsif) global_variable($sitedir) operator(!)operator(~) constant(Regexp)operator(.)ident(quote)operator(()ident(version)operator(\)) - global_variable($sitedir) operator(=) constant(File)operator(.)ident(join)operator(()global_variable($sitedir)operator(,) ident(version)operator(\)) - reserved(end) -reserved(end) - -comment(# the acual gruntwork) -constant(Dir)operator(.)ident(chdir)operator(()stringoperator(\)) - -constant(Find)operator(.)ident(find)operator(()stringoperator(,) stringoperator(\)) operator({) operator(|)ident(f)operator(|) - reserved(if) ident(f)operator([)integer(-3)operator(..)integer(-1)operator(]) operator(==) string - constant(File)operator(::)ident(install)operator(()ident(f)operator(,) constant(File)operator(.)ident(join)operator(()global_variable($sitedir)operator(,) operator(*)ident(f)operator(.)ident(split)operator(()regexpoperator(\))operator(\))operator(,) integer(0644)operator(,) pre_constant(true)operator(\)) - reserved(else) - constant(File)operator(::)ident(makedirs)operator(()constant(File)operator(.)ident(join)operator(()global_variable($sitedir)operator(,) operator(*)ident(f)operator(.)ident(split)operator(()regexpoperator(\))operator(\))operator(\)) - reserved(end) -operator(}) -reserved(module) class(ActiveRecord) - reserved(module) class(Acts) comment(#:nodoc:) - reserved(module) class(List) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - comment(# This act provides the capabilities for sorting and reordering a number of objects in a list.) - comment(# The class that has this specified needs to have a "position" column defined as an integer on) - comment(# the mapped database table.) - comment(#) - comment(# Todo list example:) - comment(#) - comment(# class TodoList < ActiveRecord::Base) - comment(# has_many :todo_items, :order => "position") - comment(# end) - comment(#) - comment(# class TodoItem < ActiveRecord::Base) - comment(# belongs_to :todo_list) - comment(# acts_as_list :scope => :todo_list) - comment(# end) - comment(#) - comment(# todo_list.first.move_to_bottom) - comment(# todo_list.last.move_higher) - reserved(module) class(ClassMethods) - comment(# Configuration options are:) - comment(#) - comment(# * +column+ - specifies the column name to use for keeping the position integer (default: position\)) - comment(# * +scope+ - restricts what is to be considered a list. Given a symbol, it'll attach "_id" ) - comment(# (if that hasn't been already\) and use that as the foreign key restriction. It's also possible ) - comment(# to give it an entire string that is interpolated if you need a tighter scope than just a foreign key.) - comment(# Example: acts_as_list :scope => 'todo_list_id = #{todo_list_id} AND completed = 0') - reserved(def) method(acts_as_list)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(configuration) operator(=) operator({) symbol(:column) operator(=)operator(>) stringoperator(,) symbol(:scope) operator(=)operator(>) string operator(}) - ident(configuration)operator(.)ident(update)operator(()ident(options)operator(\)) reserved(if) ident(options)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - ident(configuration)operator([)symbol(:scope)operator(]) operator(=) stringcontent(_id)delimiter(")>operator(.)ident(intern) reserved(if) ident(configuration)operator([)symbol(:scope)operator(])operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) operator(&&) ident(configuration)operator([)symbol(:scope)operator(])operator(.)ident(to_s) operator(!)operator(~) regexp - - reserved(if) ident(configuration)operator([)symbol(:scope)operator(])operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - ident(scope_condition_method) operator(=) stringcontent(.nil? - ")inlinecontent( IS NULL" - else - ")inlinecontent( = )char(\\#)content({)inlinecontent(}" - end - end - )delimiter(\))> - reserved(else) - ident(scope_condition_method) operator(=) stringchar(\\")content( end)delimiter(")> - reserved(end) - - ident(class_eval) stringstringcontent( - end - - def position_column - ')inlinecontent(' - end - - )inlinecontent( - - after_destroy :remove_from_list - before_create :add_to_list_bottom)delimiter( - EOV)> - reserved(end) - reserved(end) - - comment(# All the methods available to a record that has had acts_as_list specified. Each method works) - comment(# by assuming the object to be the item in the list, so chapter.move_lower would move that chapter) - comment(# lower in the list of all chapters. Likewise, chapter.first? would return true if that chapter is) - comment(# the first in the list of all chapters.) - reserved(module) class(InstanceMethods) - reserved(def) method(insert_at)operator(()ident(position) operator(=) integer(1)operator(\)) - ident(insert_at_position)operator(()ident(position)operator(\)) - reserved(end) - - reserved(def) method(move_lower) - reserved(return) reserved(unless) ident(lower_item) - - ident(acts_as_list_class)operator(.)ident(transaction) reserved(do) - ident(lower_item)operator(.)ident(decrement_position) - ident(increment_position) - reserved(end) - reserved(end) - - reserved(def) method(move_higher) - reserved(return) reserved(unless) ident(higher_item) - - ident(acts_as_list_class)operator(.)ident(transaction) reserved(do) - ident(higher_item)operator(.)ident(increment_position) - ident(decrement_position) - reserved(end) - reserved(end) - - reserved(def) method(move_to_bottom) - reserved(return) reserved(unless) ident(in_list?) - ident(acts_as_list_class)operator(.)ident(transaction) reserved(do) - ident(decrement_positions_on_lower_items) - ident(assume_bottom_position) - reserved(end) - reserved(end) - - reserved(def) method(move_to_top) - reserved(return) reserved(unless) ident(in_list?) - ident(acts_as_list_class)operator(.)ident(transaction) reserved(do) - ident(increment_positions_on_higher_items) - ident(assume_top_position) - reserved(end) - reserved(end) - - reserved(def) method(remove_from_list) - ident(decrement_positions_on_lower_items) reserved(if) ident(in_list?) - reserved(end) - - reserved(def) method(increment_position) - reserved(return) reserved(unless) ident(in_list?) - ident(update_attribute) ident(position_column)operator(,) pre_constant(self)operator(.)ident(send)operator(()ident(position_column)operator(\))operator(.)ident(to_i) operator(+) integer(1) - reserved(end) - - reserved(def) method(decrement_position) - reserved(return) reserved(unless) ident(in_list?) - ident(update_attribute) ident(position_column)operator(,) pre_constant(self)operator(.)ident(send)operator(()ident(position_column)operator(\))operator(.)ident(to_i) operator(-) integer(1) - reserved(end) - - reserved(def) method(first?) - reserved(return) pre_constant(false) reserved(unless) ident(in_list?) - pre_constant(self)operator(.)ident(send)operator(()ident(position_column)operator(\)) operator(==) integer(1) - reserved(end) - - reserved(def) method(last?) - reserved(return) pre_constant(false) reserved(unless) ident(in_list?) - pre_constant(self)operator(.)ident(send)operator(()ident(position_column)operator(\)) operator(==) ident(bottom_position_in_list) - reserved(end) - - reserved(def) method(higher_item) - reserved(return) pre_constant(nil) reserved(unless) ident(in_list?) - ident(acts_as_list_class)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) - stringcontent( AND )inlinecontent( = )inlinedelimiter(")> - operator(\)) - reserved(end) - - reserved(def) method(lower_item) - reserved(return) pre_constant(nil) reserved(unless) ident(in_list?) - ident(acts_as_list_class)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) - stringcontent( AND )inlinecontent( = )inlinedelimiter(")> - operator(\)) - reserved(end) - - reserved(def) method(in_list?) - operator(!)ident(send)operator(()ident(position_column)operator(\))operator(.)ident(nil?) - reserved(end) - - ident(private) - reserved(def) method(add_to_list_top) - ident(increment_positions_on_all_items) - reserved(end) - - reserved(def) method(add_to_list_bottom) - pre_constant(self)operator([)ident(position_column)operator(]) operator(=) ident(bottom_position_in_list)operator(.)ident(to_i) operator(+) integer(1) - reserved(end) - - comment(# Overwrite this method to define the scope of the list changes) - reserved(def) method(scope_condition)operator(()operator(\)) string reserved(end) - - reserved(def) method(bottom_position_in_list)operator(()ident(except) operator(=) pre_constant(nil)operator(\)) - ident(item) operator(=) ident(bottom_item)operator(()ident(except)operator(\)) - ident(item) operator(?) ident(item)operator(.)ident(send)operator(()ident(position_column)operator(\)) operator(:) integer(0) - reserved(end) - - reserved(def) method(bottom_item)operator(()ident(except) operator(=) pre_constant(nil)operator(\)) - ident(conditions) operator(=) ident(scope_condition) - ident(conditions) operator(=) stringcontent( AND )inlinecontent( != )inlinedelimiter(")> reserved(if) ident(except) - ident(acts_as_list_class)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) ident(conditions)operator(,) symbol(:order) operator(=)operator(>) stringcontent( DESC)delimiter(")>operator(\)) - reserved(end) - - reserved(def) method(assume_bottom_position) - ident(update_attribute)operator(()ident(position_column)operator(,) ident(bottom_position_in_list)operator(()pre_constant(self)operator(\))operator(.)ident(to_i) operator(+) integer(1)operator(\)) - reserved(end) - - reserved(def) method(assume_top_position) - ident(update_attribute)operator(()ident(position_column)operator(,) integer(1)operator(\)) - reserved(end) - - comment(# This has the effect of moving all the higher items up one.) - reserved(def) method(decrement_positions_on_higher_items)operator(()ident(position)operator(\)) - ident(acts_as_list_class)operator(.)ident(update_all)operator(() - stringcontent( = ()inlinecontent( - 1\))delimiter(")>operator(,) stringcontent( AND )inlinecontent( <= )inlinedelimiter(")> - operator(\)) - reserved(end) - - comment(# This has the effect of moving all the lower items up one.) - reserved(def) method(decrement_positions_on_lower_items) - reserved(return) reserved(unless) ident(in_list?) - ident(acts_as_list_class)operator(.)ident(update_all)operator(() - stringcontent( = ()inlinecontent( - 1\))delimiter(")>operator(,) stringcontent( AND )inlinecontent( > )inlinedelimiter(")> - operator(\)) - reserved(end) - - comment(# This has the effect of moving all the higher items down one.) - reserved(def) method(increment_positions_on_higher_items) - reserved(return) reserved(unless) ident(in_list?) - ident(acts_as_list_class)operator(.)ident(update_all)operator(() - stringcontent( = ()inlinecontent( + 1\))delimiter(")>operator(,) stringcontent( AND )inlinecontent( < )inlinedelimiter(")> - operator(\)) - reserved(end) - - comment(# This has the effect of moving all the lower items down one.) - reserved(def) method(increment_positions_on_lower_items)operator(()ident(position)operator(\)) - ident(acts_as_list_class)operator(.)ident(update_all)operator(() - stringcontent( = ()inlinecontent( + 1\))delimiter(")>operator(,) stringcontent( AND )inlinecontent( >= )inlinedelimiter(")> - operator(\)) - reserved(end) - - reserved(def) method(increment_positions_on_all_items) - ident(acts_as_list_class)operator(.)ident(update_all)operator(() - stringcontent( = ()inlinecontent( + 1\))delimiter(")>operator(,) stringdelimiter(")> - operator(\)) - reserved(end) - - reserved(def) method(insert_at_position)operator(()ident(position)operator(\)) - ident(remove_from_list) - ident(increment_positions_on_lower_items)operator(()ident(position)operator(\)) - pre_constant(self)operator(.)ident(update_attribute)operator(()ident(position_column)operator(,) ident(position)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Acts) comment(#:nodoc:) - reserved(module) class(NestedSet) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - comment(# This acts provides Nested Set functionality. Nested Set is similiar to Tree, but with) - comment(# the added feature that you can select the children and all of their descendents with) - comment(# a single query. A good use case for this is a threaded post system, where you want) - comment(# to display every reply to a comment without multiple selects.) - comment(#) - comment(# A google search for "Nested Set" should point you in the direction to explain the) - comment(# database theory. I figured out a bunch of this from) - comment(# http://threebit.net/tutorials/nestedset/tutorial1.html) - comment(#) - comment(# Instead of picturing a leaf node structure with children pointing back to their parent,) - comment(# the best way to imagine how this works is to think of the parent entity surrounding all) - comment(# of its children, and its parent surrounding it, etc. Assuming that they are lined up) - comment(# horizontally, we store the left and right boundries in the database.) - comment(#) - comment(# Imagine:) - comment(# root) - comment(# |_ Child 1) - comment(# |_ Child 1.1) - comment(# |_ Child 1.2) - comment(# |_ Child 2) - comment(# |_ Child 2.1) - comment(# |_ Child 2.2) - comment(#) - comment(# If my cirlces in circles description didn't make sense, check out this sweet) - comment(# ASCII art:) - comment(#) - comment(# ___________________________________________________________________) - comment(# | Root |) - comment(# | ____________________________ ____________________________ |) - comment(# | | Child 1 | | Child 2 | |) - comment(# | | __________ _________ | | __________ _________ | |) - comment(# | | | C 1.1 | | C 1.2 | | | | C 2.1 | | C 2.2 | | |) - comment(# 1 2 3_________4 5________6 7 8 9_________10 11_______12 13 14) - comment(# | |___________________________| |___________________________| |) - comment(# |___________________________________________________________________| ) - comment(#) - comment(# The numbers represent the left and right boundries. The table then might) - comment(# look like this:) - comment(# ID | PARENT | LEFT | RIGHT | DATA) - comment(# 1 | 0 | 1 | 14 | root) - comment(# 2 | 1 | 2 | 7 | Child 1) - comment(# 3 | 2 | 3 | 4 | Child 1.1) - comment(# 4 | 2 | 5 | 6 | Child 1.2) - comment(# 5 | 1 | 8 | 13 | Child 2) - comment(# 6 | 5 | 9 | 10 | Child 2.1) - comment(# 7 | 5 | 11 | 12 | Child 2.2) - comment(#) - comment(# So, to get all children of an entry, you) - comment(# SELECT * WHERE CHILD.LEFT IS BETWEEN PARENT.LEFT AND PARENT.RIGHT) - comment(#) - comment(# To get the count, it's (LEFT - RIGHT + 1\)/2, etc.) - comment(#) - comment(# To get the direct parent, it falls back to using the PARENT_ID field. ) - comment(#) - comment(# There are instance methods for all of these.) - comment(#) - comment(# The structure is good if you need to group things together; the downside is that) - comment(# keeping data integrity is a pain, and both adding and removing an entry) - comment(# require a full table write. ) - comment(#) - comment(# This sets up a before_destroy trigger to prune the tree correctly if one of its) - comment(# elements gets deleted.) - comment(#) - reserved(module) class(ClassMethods) - comment(# Configuration options are:) - comment(#) - comment(# * +parent_column+ - specifies the column name to use for keeping the position integer (default: parent_id\)) - comment(# * +left_column+ - column name for left boundry data, default "lft") - comment(# * +right_column+ - column name for right boundry data, default "rgt") - comment(# * +scope+ - restricts what is to be considered a list. Given a symbol, it'll attach "_id" ) - comment(# (if that hasn't been already\) and use that as the foreign key restriction. It's also possible ) - comment(# to give it an entire string that is interpolated if you need a tighter scope than just a foreign key.) - comment(# Example: acts_as_list :scope => 'todo_list_id = #{todo_list_id} AND completed = 0') - reserved(def) method(acts_as_nested_set)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(configuration) operator(=) operator({) symbol(:parent_column) operator(=)operator(>) stringoperator(,) symbol(:left_column) operator(=)operator(>) stringoperator(,) symbol(:right_column) operator(=)operator(>) stringoperator(,) symbol(:scope) operator(=)operator(>) string operator(}) - - ident(configuration)operator(.)ident(update)operator(()ident(options)operator(\)) reserved(if) ident(options)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - ident(configuration)operator([)symbol(:scope)operator(]) operator(=) stringcontent(_id)delimiter(")>operator(.)ident(intern) reserved(if) ident(configuration)operator([)symbol(:scope)operator(])operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) operator(&&) ident(configuration)operator([)symbol(:scope)operator(])operator(.)ident(to_s) operator(!)operator(~) regexp - - reserved(if) ident(configuration)operator([)symbol(:scope)operator(])operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - ident(scope_condition_method) operator(=) stringcontent(.nil? - ")inlinecontent( IS NULL" - else - ")inlinecontent( = )char(\\#)content({)inlinecontent(}" - end - end - )delimiter(\))> - reserved(else) - ident(scope_condition_method) operator(=) stringchar(\\")content( end)delimiter(")> - reserved(end) - - ident(class_eval) stringstringcontent( - - def left_col_name(\) ")inlinecontent(" end - - def right_col_name(\) ")inlinecontent(" end - - def parent_column(\) ")inlinecontent(" end -)delimiter( - EOV)> - reserved(end) - reserved(end) - - reserved(module) class(InstanceMethods) - comment(# Returns true is this is a root node. ) - reserved(def) method(root?) - ident(parent_id) operator(=) pre_constant(self)operator([)ident(parent_column)operator(]) - operator(()ident(parent_id) operator(==) integer(0) operator(||) ident(parent_id)operator(.)ident(nil?)operator(\)) operator(&&) operator(()pre_constant(self)operator([)ident(left_col_name)operator(]) operator(==) integer(1)operator(\)) operator(&&) operator(()pre_constant(self)operator([)ident(right_col_name)operator(]) operator(>) pre_constant(self)operator([)ident(left_col_name)operator(])operator(\)) - reserved(end) - - comment(# Returns true is this is a child node) - reserved(def) method(child?) - ident(parent_id) operator(=) pre_constant(self)operator([)ident(parent_column)operator(]) - operator(!)operator(()ident(parent_id) operator(==) integer(0) operator(||) ident(parent_id)operator(.)ident(nil?)operator(\)) operator(&&) operator(()pre_constant(self)operator([)ident(left_col_name)operator(]) operator(>) integer(1)operator(\)) operator(&&) operator(()pre_constant(self)operator([)ident(right_col_name)operator(]) operator(>) pre_constant(self)operator([)ident(left_col_name)operator(])operator(\)) - reserved(end) - - comment(# Returns true if we have no idea what this is) - reserved(def) method(unknown?) - operator(!)ident(root?) operator(&&) operator(!)ident(child?) - reserved(end) - - - comment(# Adds a child to this object in the tree. If this object hasn't been initialized,) - comment(# it gets set up as a root node. Otherwise, this method will update all of the) - comment(# other elements in the tree and shift them to the right, keeping everything) - comment(# balanced. ) - reserved(def) method(add_child)operator(() ident(child) operator(\)) - pre_constant(self)operator(.)ident(reload) - ident(child)operator(.)ident(reload) - - reserved(if) ident(child)operator(.)ident(root?) - ident(raise) string - reserved(else) - reserved(if) operator(() operator(()pre_constant(self)operator([)ident(left_col_name)operator(]) operator(==) pre_constant(nil)operator(\)) operator(||) operator(()pre_constant(self)operator([)ident(right_col_name)operator(]) operator(==) pre_constant(nil)operator(\)) operator(\)) - comment(# Looks like we're now the root node! Woo) - pre_constant(self)operator([)ident(left_col_name)operator(]) operator(=) integer(1) - pre_constant(self)operator([)ident(right_col_name)operator(]) operator(=) integer(4) - - comment(# What do to do about validation?) - reserved(return) pre_constant(nil) reserved(unless) pre_constant(self)operator(.)ident(save) - - ident(child)operator([)ident(parent_column)operator(]) operator(=) pre_constant(self)operator(.)ident(id) - ident(child)operator([)ident(left_col_name)operator(]) operator(=) integer(2) - ident(child)operator([)ident(right_col_name)operator(])operator(=) integer(3) - reserved(return) ident(child)operator(.)ident(save) - reserved(else) - comment(# OK, we need to add and shift everything else to the right) - ident(child)operator([)ident(parent_column)operator(]) operator(=) pre_constant(self)operator(.)ident(id) - ident(right_bound) operator(=) pre_constant(self)operator([)ident(right_col_name)operator(]) - ident(child)operator([)ident(left_col_name)operator(]) operator(=) ident(right_bound) - ident(child)operator([)ident(right_col_name)operator(]) operator(=) ident(right_bound) operator(+) integer(1) - pre_constant(self)operator([)ident(right_col_name)operator(]) operator(+=) integer(2) - pre_constant(self)operator(.)ident(class)operator(.)ident(transaction) operator({) - pre_constant(self)operator(.)ident(class)operator(.)ident(update_all)operator(() stringcontent( = ()inlinecontent( + 2\))delimiter(")>operator(,) stringcontent( AND )inlinecontent( >= )inlinedelimiter(")> operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(update_all)operator(() stringcontent( = ()inlinecontent( + 2\))delimiter(")>operator(,) stringcontent( AND )inlinecontent( >= )inlinedelimiter(")> operator(\)) - pre_constant(self)operator(.)ident(save) - ident(child)operator(.)ident(save) - operator(}) - reserved(end) - reserved(end) - reserved(end) - - comment(# Returns the number of nested children of this object.) - reserved(def) method(children_count) - reserved(return) operator(()pre_constant(self)operator([)ident(right_col_name)operator(]) operator(-) pre_constant(self)operator([)ident(left_col_name)operator(]) operator(-) integer(1)operator(\))operator(/)integer(2) - reserved(end) - - comment(# Returns a set of itself and all of its nested children) - reserved(def) method(full_set) - pre_constant(self)operator(.)ident(class)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringcontent( AND ()inlinecontent( BETWEEN )inlinecontent( and )inlinecontent(\))delimiter(")> operator(\)) - reserved(end) - - comment(# Returns a set of all of its children and nested children) - reserved(def) method(all_children) - pre_constant(self)operator(.)ident(class)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringcontent( AND ()inlinecontent( > )inlinecontent(\) and ()inlinecontent( < )inlinecontent(\))delimiter(")> operator(\)) - reserved(end) - - comment(# Returns a set of only this entry's immediate children) - reserved(def) method(direct_children) - pre_constant(self)operator(.)ident(class)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringcontent( and )inlinecontent( = )inlinedelimiter(")>operator(\)) - reserved(end) - - comment(# Prunes a branch off of the tree, shifting all of the elements on the right) - comment(# back to the left so the counts still work.) - reserved(def) method(before_destroy) - reserved(return) reserved(if) pre_constant(self)operator([)ident(right_col_name)operator(])operator(.)ident(nil?) operator(||) pre_constant(self)operator([)ident(left_col_name)operator(])operator(.)ident(nil?) - ident(dif) operator(=) pre_constant(self)operator([)ident(right_col_name)operator(]) operator(-) pre_constant(self)operator([)ident(left_col_name)operator(]) operator(+) integer(1) - - pre_constant(self)operator(.)ident(class)operator(.)ident(transaction) operator({) - pre_constant(self)operator(.)ident(class)operator(.)ident(delete_all)operator(() stringcontent( and )inlinecontent( > )inlinecontent( and )inlinecontent( < )inlinedelimiter(")> operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(update_all)operator(() stringcontent( = ()inlinecontent( - )inlinecontent(\))delimiter(")>operator(,) stringcontent( AND )inlinecontent( >= )inlinedelimiter(")> operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(update_all)operator(() stringcontent( = ()inlinecontent( - )inlinecontent( \))delimiter(")>operator(,) stringcontent( AND )inlinecontent( >= )inlinedelimiter(")> operator(\)) - operator(}) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Acts) comment(#:nodoc:) - reserved(module) class(Tree) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - comment(# Specify this act if you want to model a tree structure by providing a parent association and a children ) - comment(# association. This act requires that you have a foreign key column, which by default is called parent_id.) - comment(# ) - comment(# class Category < ActiveRecord::Base) - comment(# acts_as_tree :order => "name") - comment(# end) - comment(# ) - comment(# Example : ) - comment(# root) - comment(# \\_ child1 ) - comment(# \\_ subchild1) - comment(# \\_ subchild2) - comment(#) - comment(# root = Category.create("name" => "root"\)) - comment(# child1 = root.children.create("name" => "child1"\)) - comment(# subchild1 = child1.children.create("name" => "subchild1"\)) - comment(#) - comment(# root.parent # => nil) - comment(# child1.parent # => root) - comment(# root.children # => [child1]) - comment(# root.children.first.children.first # => subchild1) - comment(#) - comment(# In addition to the parent and children associations, the following instance methods are added to the class ) - comment(# after specifying the act:) - comment(# * siblings : Returns all the children of the parent, excluding the current node ([ subchild2 ] when called from subchild1\)) - comment(# * self_and_siblings : Returns all the children of the parent, including the current node ([ subchild1, subchild2 ] when called from subchild1\)) - comment(# * ancestors : Returns all the ancestors of the current node ([child1, root] when called from subchild2\)) - comment(# * root : Returns the root of the current node (root when called from subchild2\)) - reserved(module) class(ClassMethods) - comment(# Configuration options are:) - comment(#) - comment(# * foreign_key - specifies the column name to use for tracking of the tree (default: parent_id\)) - comment(# * order - makes it possible to sort the children according to this SQL snippet.) - comment(# * counter_cache - keeps a count in a children_count column if set to true (default: false\).) - reserved(def) method(acts_as_tree)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(configuration) operator(=) operator({) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) pre_constant(nil)operator(,) symbol(:counter_cache) operator(=)operator(>) pre_constant(nil) operator(}) - ident(configuration)operator(.)ident(update)operator(()ident(options)operator(\)) reserved(if) ident(options)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - ident(belongs_to) symbol(:parent)operator(,) symbol(:class_name) operator(=)operator(>) ident(name)operator(,) symbol(:foreign_key) operator(=)operator(>) ident(configuration)operator([)symbol(:foreign_key)operator(])operator(,) symbol(:counter_cache) operator(=)operator(>) ident(configuration)operator([)symbol(:counter_cache)operator(]) - ident(has_many) symbol(:children)operator(,) symbol(:class_name) operator(=)operator(>) ident(name)operator(,) symbol(:foreign_key) operator(=)operator(>) ident(configuration)operator([)symbol(:foreign_key)operator(])operator(,) symbol(:order) operator(=)operator(>) ident(configuration)operator([)symbol(:order)operator(])operator(,) symbol(:dependent) operator(=)operator(>) symbol(:destroy) - - ident(class_eval) stringstring ")inlinecontent( IS NULL", :order => )inline operator(:) stringcontent(")delimiter(})>inline_delimiter(})>content(\) - end - - def self.root - find(:first, :conditions => ")inlinecontent( IS NULL", :order => )inline operator(:) stringcontent(")delimiter(})>inline_delimiter(})>content(\) - end)delimiter( - EOV)> - reserved(end) - reserved(end) - - reserved(module) class(InstanceMethods) - comment(# Returns list of ancestors, starting from parent until root.) - comment(#) - comment(# subchild1.ancestors # => [child1, root]) - reserved(def) method(ancestors) - ident(node)operator(,) ident(nodes) operator(=) pre_constant(self)operator(,) operator([)operator(]) - ident(nodes) operator(<<) ident(node) operator(=) ident(node)operator(.)ident(parent) reserved(until) reserved(not) ident(node)operator(.)ident(has_parent?) - ident(nodes) - reserved(end) - - reserved(def) method(root) - ident(node) operator(=) pre_constant(self) - ident(node) operator(=) ident(node)operator(.)ident(parent) reserved(until) reserved(not) ident(node)operator(.)ident(has_parent?) - ident(node) - reserved(end) - - reserved(def) method(siblings) - ident(self_and_siblings) operator(-) operator([)pre_constant(self)operator(]) - reserved(end) - - reserved(def) method(self_and_siblings) - ident(has_parent?) operator(?) ident(parent)operator(.)ident(children) operator(:) pre_constant(self)operator(.)ident(class)operator(.)ident(roots) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Aggregations) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - reserved(def) method(clear_aggregation_cache) comment(#:nodoc:) - pre_constant(self)operator(.)ident(class)operator(.)ident(reflect_on_all_aggregations)operator(.)ident(to_a)operator(.)ident(each) reserved(do) operator(|)ident(assoc)operator(|) - ident(instance_variable_set) stringdelimiter(")>operator(,) pre_constant(nil) - reserved(end) reserved(unless) pre_constant(self)operator(.)ident(new_record?) - reserved(end) - - comment(# Active Record implements aggregation through a macro-like class method called +composed_of+ for representing attributes ) - comment(# as value objects. It expresses relationships like "Account [is] composed of Money [among other things]" or "Person [is]) - comment(# composed of [an] address". Each call to the macro adds a description of how the value objects are created from the ) - comment(# attributes of the entity object (when the entity is initialized either as a new object or from finding an existing object\) ) - comment(# and how it can be turned back into attributes (when the entity is saved to the database\). Example:) - comment(#) - comment(# class Customer < ActiveRecord::Base) - comment(# composed_of :balance, :class_name => "Money", :mapping => %w(balance amount\)) - comment(# composed_of :address, :mapping => [ %w(address_street street\), %w(address_city city\) ]) - comment(# end) - comment(#) - comment(# The customer class now has the following methods to manipulate the value objects:) - comment(# * Customer#balance, Customer#balance=(money\)) - comment(# * Customer#address, Customer#address=(address\)) - comment(#) - comment(# These methods will operate with value objects like the ones described below:) - comment(#) - comment(# class Money) - comment(# include Comparable) - comment(# attr_reader :amount, :currency) - comment(# EXCHANGE_RATES = { "USD_TO_DKK" => 6 } ) - comment(# ) - comment(# def initialize(amount, currency = "USD"\) ) - comment(# @amount, @currency = amount, currency ) - comment(# end) - comment(#) - comment(# def exchange_to(other_currency\)) - comment(# exchanged_amount = (amount * EXCHANGE_RATES["#{currency}_TO_#{other_currency}"]\).floor) - comment(# Money.new(exchanged_amount, other_currency\)) - comment(# end) - comment(#) - comment(# def ==(other_money\)) - comment(# amount == other_money.amount && currency == other_money.currency) - comment(# end) - comment(#) - comment(# def <=>(other_money\)) - comment(# if currency == other_money.currency) - comment(# amount <=> amount) - comment(# else) - comment(# amount <=> other_money.exchange_to(currency\).amount) - comment(# end) - comment(# end) - comment(# end) - comment(#) - comment(# class Address) - comment(# attr_reader :street, :city) - comment(# def initialize(street, city\) ) - comment(# @street, @city = street, city ) - comment(# end) - comment(#) - comment(# def close_to?(other_address\) ) - comment(# city == other_address.city ) - comment(# end) - comment(#) - comment(# def ==(other_address\)) - comment(# city == other_address.city && street == other_address.street) - comment(# end) - comment(# end) - comment(# ) - comment(# Now it's possible to access attributes from the database through the value objects instead. If you choose to name the) - comment(# composition the same as the attributes name, it will be the only way to access that attribute. That's the case with our) - comment(# +balance+ attribute. You interact with the value objects just like you would any other attribute, though:) - comment(#) - comment(# customer.balance = Money.new(20\) # sets the Money value object and the attribute) - comment(# customer.balance # => Money value object) - comment(# customer.balance.exchanged_to("DKK"\) # => Money.new(120, "DKK"\)) - comment(# customer.balance > Money.new(10\) # => true) - comment(# customer.balance == Money.new(20\) # => true) - comment(# customer.balance < Money.new(5\) # => false) - comment(#) - comment(# Value objects can also be composed of multiple attributes, such as the case of Address. The order of the mappings will) - comment(# determine the order of the parameters. Example:) - comment(#) - comment(# customer.address_street = "Hyancintvej") - comment(# customer.address_city = "Copenhagen") - comment(# customer.address # => Address.new("Hyancintvej", "Copenhagen"\)) - comment(# customer.address = Address.new("May Street", "Chicago"\)) - comment(# customer.address_street # => "May Street" ) - comment(# customer.address_city # => "Chicago" ) - comment(#) - comment(# == Writing value objects) - comment(#) - comment(# Value objects are immutable and interchangeable objects that represent a given value, such as a Money object representing) - comment(# $5. Two Money objects both representing $5 should be equal (through methods such as == and <=> from Comparable if ranking) - comment(# makes sense\). This is unlike entity objects where equality is determined by identity. An entity class such as Customer can) - comment(# easily have two different objects that both have an address on Hyancintvej. Entity identity is determined by object or) - comment(# relational unique identifiers (such as primary keys\). Normal ActiveRecord::Base classes are entity objects.) - comment(#) - comment(# It's also important to treat the value objects as immutable. Don't allow the Money object to have its amount changed after) - comment(# creation. Create a new money object with the new value instead. This is exemplified by the Money#exchanged_to method that) - comment(# returns a new value object instead of changing its own values. Active Record won't persist value objects that have been) - comment(# changed through other means than the writer method.) - comment(#) - comment(# The immutable requirement is enforced by Active Record by freezing any object assigned as a value object. Attempting to ) - comment(# change it afterwards will result in a TypeError.) - comment(# ) - comment(# Read more about value objects on http://c2.com/cgi/wiki?ValueObject and on the dangers of not keeping value objects) - comment(# immutable on http://c2.com/cgi/wiki?ValueObjectsShouldBeImmutable) - reserved(module) class(ClassMethods) - comment(# Adds the a reader and writer method for manipulating a value object, so) - comment(# composed_of :address would add address and address=(new_address\).) - comment(#) - comment(# Options are:) - comment(# * :class_name - specify the class name of the association. Use it only if that name can't be inferred) - comment(# from the part id. So composed_of :address will by default be linked to the +Address+ class, but) - comment(# if the real class name is +CompanyAddress+, you'll have to specify it with this option.) - comment(# * :mapping - specifies a number of mapping arrays (attribute, parameter\) that bind an attribute name) - comment(# to a constructor parameter on the value class.) - comment(#) - comment(# Option examples:) - comment(# composed_of :temperature, :mapping => %w(reading celsius\)) - comment(# composed_of :balance, :class_name => "Money", :mapping => %w(balance amount\)) - comment(# composed_of :address, :mapping => [ %w(address_street street\), %w(address_city city\) ]) - comment(# composed_of :gps_location) - reserved(def) method(composed_of)operator(()ident(part_id)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(options)operator(.)ident(assert_valid_keys)operator(()symbol(:class_name)operator(,) symbol(:mapping)operator(\)) - - ident(name) operator(=) ident(part_id)operator(.)ident(id2name) - ident(class_name) operator(=) ident(options)operator([)symbol(:class_name)operator(]) operator(||) ident(name_to_class_name)operator(()ident(name)operator(\)) - ident(mapping) operator(=) ident(options)operator([)symbol(:mapping)operator(]) operator(||) operator([) ident(name)operator(,) ident(name) operator(]) - - ident(reader_method)operator(()ident(name)operator(,) ident(class_name)operator(,) ident(mapping)operator(\)) - ident(writer_method)operator(()ident(name)operator(,) ident(class_name)operator(,) ident(mapping)operator(\)) - - ident(create_reflection)operator(()symbol(:composed_of)operator(,) ident(part_id)operator(,) ident(options)operator(,) pre_constant(self)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(name_to_class_name)operator(()ident(name)operator(\)) - ident(name)operator(.)ident(capitalize)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(s)operator(|) global_variable($1)operator(.)ident(capitalize) operator(}) - reserved(end) - - reserved(def) method(reader_method)operator(()ident(name)operator(,) ident(class_name)operator(,) ident(mapping)operator(\)) - ident(module_eval) stringstringcontent((force_reload = false\) - if @)inlinecontent(.nil? || force_reload - @)inlinecontent( = )inlinecontent(.new()inlinechar(\\")content(\))delimiter(")>operator(})operator(.)ident(join)operator(()stringoperator(\))inline_delimiter(})>content(\) - end - - return @)inlinecontent( - end)delimiter( - end_eval)> - reserved(end) - - reserved(def) method(writer_method)operator(()ident(name)operator(,) ident(class_name)operator(,) ident(mapping)operator(\)) - ident(module_eval) stringstringcontent(=(part\) - @)inlinecontent( = part.freeze - )inlinechar(\\")content(] = part.)inlinedelimiter(")> operator(})operator(.)ident(join)operator(()stringoperator(\))inline_delimiter(})>content( - end)delimiter( - end_eval)> - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(module) class(Associations) - reserved(class) class(AssociationCollection) operator(<) constant(AssociationProxy) comment(#:nodoc:) - reserved(def) method(to_ary) - ident(load_target) - instance_variable(@target)operator(.)ident(to_ary) - reserved(end) - - reserved(def) method(reset) - instance_variable(@target) operator(=) operator([)operator(]) - instance_variable(@loaded) operator(=) pre_constant(false) - reserved(end) - - comment(# Add +records+ to this association. Returns +self+ so method calls may be chained. ) - comment(# Since << flattens its argument list and inserts each record, +push+ and +concat+ behave identically.) - reserved(def) method(<<)operator(()operator(*)ident(records)operator(\)) - ident(result) operator(=) pre_constant(true) - ident(load_target) - - instance_variable(@owner)operator(.)ident(transaction) reserved(do) - ident(flatten_deeper)operator(()ident(records)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(record)operator(|) - ident(raise_on_type_mismatch)operator(()ident(record)operator(\)) - ident(callback)operator(()symbol(:before_add)operator(,) ident(record)operator(\)) - ident(result) operator(&&=) ident(insert_record)operator(()ident(record)operator(\)) reserved(unless) instance_variable(@owner)operator(.)ident(new_record?) - instance_variable(@target) operator(<<) ident(record) - ident(callback)operator(()symbol(:after_add)operator(,) ident(record)operator(\)) - reserved(end) - reserved(end) - - ident(result) operator(&&) pre_constant(self) - reserved(end) - - ident(alias_method) symbol(:push)operator(,) symbol(:<<) - ident(alias_method) symbol(:concat)operator(,) symbol(:<<) - - comment(# Remove all records from this association) - reserved(def) method(delete_all) - ident(load_target) - ident(delete)operator(()instance_variable(@target)operator(\)) - instance_variable(@target) operator(=) operator([)operator(]) - reserved(end) - - comment(# Remove +records+ from this association. Does not destroy +records+.) - reserved(def) method(delete)operator(()operator(*)ident(records)operator(\)) - ident(records) operator(=) ident(flatten_deeper)operator(()ident(records)operator(\)) - ident(records)operator(.)ident(each) operator({) operator(|)ident(record)operator(|) ident(raise_on_type_mismatch)operator(()ident(record)operator(\)) operator(}) - ident(records)operator(.)ident(reject!) operator({) operator(|)ident(record)operator(|) instance_variable(@target)operator(.)ident(delete)operator(()ident(record)operator(\)) reserved(if) ident(record)operator(.)ident(new_record?) operator(}) - reserved(return) reserved(if) ident(records)operator(.)ident(empty?) - - instance_variable(@owner)operator(.)ident(transaction) reserved(do) - ident(records)operator(.)ident(each) operator({) operator(|)ident(record)operator(|) ident(callback)operator(()symbol(:before_remove)operator(,) ident(record)operator(\)) operator(}) - ident(delete_records)operator(()ident(records)operator(\)) - ident(records)operator(.)ident(each) reserved(do) operator(|)ident(record)operator(|) - instance_variable(@target)operator(.)ident(delete)operator(()ident(record)operator(\)) - ident(callback)operator(()symbol(:after_remove)operator(,) ident(record)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Removes all records from this association. Returns +self+ so method calls may be chained.) - reserved(def) method(clear) - reserved(return) pre_constant(self) reserved(if) ident(length)operator(.)ident(zero?) comment(# forces load_target if hasn't happened already) - - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:dependent)operator(]) operator(&&) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:dependent)operator(]) operator(==) symbol(:delete_all) - ident(destroy_all) - reserved(else) - ident(delete_all) - reserved(end) - - pre_constant(self) - reserved(end) - - reserved(def) method(destroy_all) - instance_variable(@owner)operator(.)ident(transaction) reserved(do) - ident(each) operator({) operator(|)ident(record)operator(|) ident(record)operator(.)ident(destroy) operator(}) - reserved(end) - - instance_variable(@target) operator(=) operator([)operator(]) - reserved(end) - - reserved(def) method(create)operator(()ident(attributes) operator(=) operator({)operator(})operator(\)) - comment(# Can't use Base.create since the foreign key may be a protected attribute.) - reserved(if) ident(attributes)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - ident(attributes)operator(.)ident(collect) operator({) operator(|)ident(attr)operator(|) ident(create)operator(()ident(attr)operator(\)) operator(}) - reserved(else) - ident(record) operator(=) ident(build)operator(()ident(attributes)operator(\)) - ident(record)operator(.)ident(save) reserved(unless) instance_variable(@owner)operator(.)ident(new_record?) - ident(record) - reserved(end) - reserved(end) - - comment(# Returns the size of the collection by executing a SELECT COUNT(*\) query if the collection hasn't been loaded and) - comment(# calling collection.size if it has. If it's more likely than not that the collection does have a size larger than zero) - comment(# and you need to fetch that collection afterwards, it'll take one less SELECT query if you use length.) - reserved(def) method(size) - reserved(if) ident(loaded?) reserved(then) instance_variable(@target)operator(.)ident(size) reserved(else) ident(count_records) reserved(end) - reserved(end) - - comment(# Returns the size of the collection by loading it and calling size on the array. If you want to use this method to check) - comment(# whether the collection is empty, use collection.length.zero? instead of collection.empty?) - reserved(def) method(length) - ident(load_target)operator(.)ident(size) - reserved(end) - - reserved(def) method(empty?) - ident(size)operator(.)ident(zero?) - reserved(end) - - reserved(def) method(uniq)operator(()ident(collection) operator(=) pre_constant(self)operator(\)) - ident(collection)operator(.)ident(inject)operator(()operator([)operator(])operator(\)) operator({) operator(|)ident(uniq_records)operator(,) ident(record)operator(|) ident(uniq_records) operator(<<) ident(record) reserved(unless) ident(uniq_records)operator(.)ident(include?)operator(()ident(record)operator(\))operator(;) ident(uniq_records) operator(}) - reserved(end) - - comment(# Replace this collection with +other_array+) - comment(# This will perform a diff and delete/add only records that have changed.) - reserved(def) method(replace)operator(()ident(other_array)operator(\)) - ident(other_array)operator(.)ident(each) operator({) operator(|)ident(val)operator(|) ident(raise_on_type_mismatch)operator(()ident(val)operator(\)) operator(}) - - ident(load_target) - ident(other) operator(=) ident(other_array)operator(.)ident(size) operator(<) integer(100) operator(?) ident(other_array) operator(:) ident(other_array)operator(.)ident(to_set) - ident(current) operator(=) instance_variable(@target)operator(.)ident(size) operator(<) integer(100) operator(?) instance_variable(@target) operator(:) instance_variable(@target)operator(.)ident(to_set) - - instance_variable(@owner)operator(.)ident(transaction) reserved(do) - ident(delete)operator(()instance_variable(@target)operator(.)ident(select) operator({) operator(|)ident(v)operator(|) operator(!)ident(other)operator(.)ident(include?)operator(()ident(v)operator(\)) operator(})operator(\)) - ident(concat)operator(()ident(other_array)operator(.)ident(select) operator({) operator(|)ident(v)operator(|) operator(!)ident(current)operator(.)ident(include?)operator(()ident(v)operator(\)) operator(})operator(\)) - reserved(end) - reserved(end) - - ident(private) - comment(# Array#flatten has problems with recursive arrays. Going one level deeper solves the majority of the problems.) - reserved(def) method(flatten_deeper)operator(()ident(array)operator(\)) - ident(array)operator(.)ident(collect) operator({) operator(|)ident(element)operator(|) ident(element)operator(.)ident(respond_to?)operator(()symbol(:flatten)operator(\)) operator(?) ident(element)operator(.)ident(flatten) operator(:) ident(element) operator(})operator(.)ident(flatten) - reserved(end) - - reserved(def) method(callback)operator(()ident(method)operator(,) ident(record)operator(\)) - ident(callbacks_for)operator(()ident(method)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(callback)operator(|) - reserved(case) ident(callback) - reserved(when) constant(Symbol) - instance_variable(@owner)operator(.)ident(send)operator(()ident(callback)operator(,) ident(record)operator(\)) - reserved(when) constant(Proc)operator(,) constant(Method) - ident(callback)operator(.)ident(call)operator(()instance_variable(@owner)operator(,) ident(record)operator(\)) - reserved(else) - reserved(if) ident(callback)operator(.)ident(respond_to?)operator(()ident(method)operator(\)) - ident(callback)operator(.)ident(send)operator(()ident(method)operator(,) instance_variable(@owner)operator(,) ident(record)operator(\)) - reserved(else) - ident(raise) constant(ActiveRecordError)operator(,) string - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(callbacks_for)operator(()ident(callback_name)operator(\)) - ident(full_callback_name) operator(=) stringcontent(_for_)inlinedelimiter(")> - instance_variable(@owner)operator(.)ident(class)operator(.)ident(read_inheritable_attribute)operator(()ident(full_callback_name)operator(.)ident(to_sym)operator(\)) operator(||) operator([)operator(]) - reserved(end) - - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Associations) - reserved(class) class(AssociationProxy) comment(#:nodoc:) - ident(attr_reader) symbol(:reflection) - ident(alias_method) symbol(:proxy_respond_to?)operator(,) symbol(:respond_to?) - ident(alias_method) symbol(:proxy_extend)operator(,) symbol(:extend) - ident(instance_methods)operator(.)ident(each) operator({) operator(|)ident(m)operator(|) ident(undef_method) ident(m) reserved(unless) ident(m) operator(=)operator(~) regexp operator(}) - - reserved(def) method(initialize)operator(()ident(owner)operator(,) ident(reflection)operator(\)) - instance_variable(@owner)operator(,) instance_variable(@reflection) operator(=) ident(owner)operator(,) ident(reflection) - ident(proxy_extend)operator(()ident(reflection)operator(.)ident(options)operator([)symbol(:extend)operator(])operator(\)) reserved(if) ident(reflection)operator(.)ident(options)operator([)symbol(:extend)operator(]) - ident(reset) - reserved(end) - - reserved(def) method(respond_to?)operator(()ident(symbol)operator(,) ident(include_priv) operator(=) pre_constant(false)operator(\)) - ident(proxy_respond_to?)operator(()ident(symbol)operator(,) ident(include_priv)operator(\)) operator(||) operator(()ident(load_target) operator(&&) instance_variable(@target)operator(.)ident(respond_to?)operator(()ident(symbol)operator(,) ident(include_priv)operator(\))operator(\)) - reserved(end) - - comment(# Explicitly proxy === because the instance method removal above) - comment(# doesn't catch it.) - reserved(def) method(===)operator(()ident(other)operator(\)) - ident(load_target) - ident(other) operator(===) instance_variable(@target) - reserved(end) - - reserved(def) method(aliased_table_name) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(table_name) - reserved(end) - - reserved(def) method(conditions) - instance_variable(@conditions) operator(||=) ident(eval)operator(()stringcontent(\))delimiter(")>operator(\)) reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:conditions)operator(]) - reserved(end) - reserved(alias) symbol(:sql_conditions) symbol(:conditions) - - reserved(def) method(reset) - instance_variable(@target) operator(=) pre_constant(nil) - instance_variable(@loaded) operator(=) pre_constant(false) - reserved(end) - - reserved(def) method(reload) - ident(reset) - ident(load_target) - reserved(end) - - reserved(def) method(loaded?) - instance_variable(@loaded) - reserved(end) - - reserved(def) method(loaded) - instance_variable(@loaded) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(target) - instance_variable(@target) - reserved(end) - - reserved(def) method(target=)operator(()ident(target)operator(\)) - instance_variable(@target) operator(=) ident(target) - ident(loaded) - reserved(end) - - ident(protected) - reserved(def) method(dependent?) - instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:dependent)operator(]) operator(||) pre_constant(false) - reserved(end) - - reserved(def) method(quoted_record_ids)operator(()ident(records)operator(\)) - ident(records)operator(.)ident(map) operator({) operator(|)ident(record)operator(|) ident(record)operator(.)ident(quoted_id) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(interpolate_sql_options!)operator(()ident(options)operator(,) operator(*)ident(keys)operator(\)) - ident(keys)operator(.)ident(each) operator({) operator(|)ident(key)operator(|) ident(options)operator([)ident(key)operator(]) operator(&&=) ident(interpolate_sql)operator(()ident(options)operator([)ident(key)operator(])operator(\)) operator(}) - reserved(end) - - reserved(def) method(interpolate_sql)operator(()ident(sql)operator(,) ident(record) operator(=) pre_constant(nil)operator(\)) - instance_variable(@owner)operator(.)ident(send)operator(()symbol(:interpolate_sql)operator(,) ident(sql)operator(,) ident(record)operator(\)) - reserved(end) - - reserved(def) method(sanitize_sql)operator(()ident(sql)operator(\)) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(send)operator(()symbol(:sanitize_sql)operator(,) ident(sql)operator(\)) - reserved(end) - - reserved(def) method(extract_options_from_args!)operator(()ident(args)operator(\)) - instance_variable(@owner)operator(.)ident(send)operator(()symbol(:extract_options_from_args!)operator(,) ident(args)operator(\)) - reserved(end) - - reserved(def) method(set_belongs_to_association_for)operator(()ident(record)operator(\)) - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:as)operator(]) - ident(record)operator([)stringcontent(_id)delimiter(")>operator(]) operator(=) instance_variable(@owner)operator(.)ident(id) reserved(unless) instance_variable(@owner)operator(.)ident(new_record?) - ident(record)operator([)stringcontent(_type)delimiter(")>operator(]) operator(=) instance_variable(@owner)operator(.)ident(class)operator(.)ident(base_class)operator(.)ident(name)operator(.)ident(to_s) - reserved(else) - ident(record)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(]) operator(=) instance_variable(@owner)operator(.)ident(id) reserved(unless) instance_variable(@owner)operator(.)ident(new_record?) - reserved(end) - reserved(end) - - reserved(def) method(merge_options_from_reflection!)operator(()ident(options)operator(\)) - ident(options)operator(.)ident(reverse_merge!)operator(() - symbol(:group) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:group)operator(])operator(,) - symbol(:limit) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:limit)operator(])operator(,) - symbol(:offset) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:offset)operator(])operator(,) - symbol(:joins) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:joins)operator(])operator(,) - symbol(:include) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:include)operator(])operator(,) - symbol(:select) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:select)operator(]) - operator(\)) - reserved(end) - - ident(private) - reserved(def) method(method_missing)operator(()ident(method)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(load_target) - instance_variable(@target)operator(.)ident(send)operator(()ident(method)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(load_target) - reserved(if) operator(!)instance_variable(@owner)operator(.)ident(new_record?) operator(||) ident(foreign_key_present) - reserved(begin) - instance_variable(@target) operator(=) ident(find_target) reserved(if) operator(!)ident(loaded?) - reserved(rescue) constant(ActiveRecord)operator(::)constant(RecordNotFound) - ident(reset) - reserved(end) - reserved(end) - - ident(loaded) reserved(if) ident(target) - ident(target) - reserved(end) - - comment(# Can be overwritten by associations that might have the foreign key available for an association without) - comment(# having the object itself (and still being a new record\). Currently, only belongs_to present this scenario.) - reserved(def) method(foreign_key_present) - pre_constant(false) - reserved(end) - - reserved(def) method(raise_on_type_mismatch)operator(()ident(record)operator(\)) - reserved(unless) ident(record)operator(.)ident(is_a?)operator(()instance_variable(@reflection)operator(.)ident(klass)operator(\)) - ident(raise) constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(,) stringcontent( expected, got )inlinedelimiter(")> - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Associations) - reserved(class) class(BelongsToAssociation) operator(<) constant(AssociationProxy) comment(#:nodoc:) - reserved(def) method(create)operator(()ident(attributes) operator(=) operator({)operator(})operator(\)) - ident(replace)operator(()instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(create)operator(()ident(attributes)operator(\))operator(\)) - reserved(end) - - reserved(def) method(build)operator(()ident(attributes) operator(=) operator({)operator(})operator(\)) - ident(replace)operator(()instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(new)operator(()ident(attributes)operator(\))operator(\)) - reserved(end) - - reserved(def) method(replace)operator(()ident(record)operator(\)) - ident(counter_cache_name) operator(=) instance_variable(@reflection)operator(.)ident(counter_cache_column) - - reserved(if) ident(record)operator(.)ident(nil?) - reserved(if) ident(counter_cache_name) operator(&&) instance_variable(@owner)operator([)ident(counter_cache_name)operator(]) operator(&&) operator(!)instance_variable(@owner)operator(.)ident(new_record?) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(decrement_counter)operator(()ident(counter_cache_name)operator(,) instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(])operator(\)) reserved(if) instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(]) - reserved(end) - - instance_variable(@target) operator(=) instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(]) operator(=) pre_constant(nil) - reserved(else) - ident(raise_on_type_mismatch)operator(()ident(record)operator(\)) - - reserved(if) ident(counter_cache_name) operator(&&) operator(!)instance_variable(@owner)operator(.)ident(new_record?) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(increment_counter)operator(()ident(counter_cache_name)operator(,) ident(record)operator(.)ident(id)operator(\)) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(decrement_counter)operator(()ident(counter_cache_name)operator(,) instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(])operator(\)) reserved(if) instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(]) - reserved(end) - - instance_variable(@target) operator(=) operator(()constant(AssociationProxy) operator(===) ident(record) operator(?) ident(record)operator(.)ident(target) operator(:) ident(record)operator(\)) - instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(]) operator(=) ident(record)operator(.)ident(id) reserved(unless) ident(record)operator(.)ident(new_record?) - instance_variable(@updated) operator(=) pre_constant(true) - reserved(end) - - ident(loaded) - ident(record) - reserved(end) - - reserved(def) method(updated?) - instance_variable(@updated) - reserved(end) - - ident(private) - reserved(def) method(find_target) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(find)operator(() - instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(])operator(,) - symbol(:conditions) operator(=)operator(>) ident(conditions)operator(,) - symbol(:include) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:include)operator(]) - operator(\)) - reserved(end) - - reserved(def) method(foreign_key_present) - operator(!)instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(])operator(.)ident(nil?) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Associations) - reserved(class) class(BelongsToPolymorphicAssociation) operator(<) constant(AssociationProxy) comment(#:nodoc:) - reserved(def) method(replace)operator(()ident(record)operator(\)) - reserved(if) ident(record)operator(.)ident(nil?) - instance_variable(@target) operator(=) instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(]) operator(=) instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:foreign_type)operator(])operator(]) operator(=) pre_constant(nil) - reserved(else) - instance_variable(@target) operator(=) operator(()constant(AssociationProxy) operator(===) ident(record) operator(?) ident(record)operator(.)ident(target) operator(:) ident(record)operator(\)) - - reserved(unless) ident(record)operator(.)ident(new_record?) - instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(]) operator(=) ident(record)operator(.)ident(id) - instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:foreign_type)operator(])operator(]) operator(=) ident(record)operator(.)ident(class)operator(.)ident(base_class)operator(.)ident(name)operator(.)ident(to_s) - reserved(end) - - instance_variable(@updated) operator(=) pre_constant(true) - reserved(end) - - ident(loaded) - ident(record) - reserved(end) - - reserved(def) method(updated?) - instance_variable(@updated) - reserved(end) - - ident(private) - reserved(def) method(find_target) - reserved(return) pre_constant(nil) reserved(if) ident(association_class)operator(.)ident(nil?) - - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:conditions)operator(]) - ident(association_class)operator(.)ident(find)operator(() - instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(])operator(,) - symbol(:conditions) operator(=)operator(>) ident(conditions)operator(,) - symbol(:include) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:include)operator(]) - operator(\)) - reserved(else) - ident(association_class)operator(.)ident(find)operator(()instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(])operator(,) symbol(:include) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:include)operator(])operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(foreign_key_present) - operator(!)instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(])operator(.)ident(nil?) - reserved(end) - - reserved(def) method(association_class) - instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:foreign_type)operator(])operator(]) operator(?) instance_variable(@owner)operator([)instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:foreign_type)operator(])operator(])operator(.)ident(constantize) operator(:) pre_constant(nil) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Associations) - reserved(class) class(HasAndBelongsToManyAssociation) operator(<) constant(AssociationCollection) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(owner)operator(,) ident(reflection)operator(\)) - reserved(super) - ident(construct_sql) - reserved(end) - - reserved(def) method(build)operator(()ident(attributes) operator(=) operator({)operator(})operator(\)) - ident(load_target) - ident(record) operator(=) instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(new)operator(()ident(attributes)operator(\)) - instance_variable(@target) operator(<<) ident(record) - ident(record) - reserved(end) - - reserved(def) method(find_first) - ident(load_target)operator(.)ident(first) - reserved(end) - - reserved(def) method(find)operator(()operator(*)ident(args)operator(\)) - ident(options) operator(=) constant(Base)operator(.)ident(send)operator(()symbol(:extract_options_from_args!)operator(,) ident(args)operator(\)) - - comment(# If using a custom finder_sql, scan the entire collection.) - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - ident(expects_array) operator(=) ident(args)operator(.)ident(first)operator(.)ident(kind_of?)operator(()constant(Array)operator(\)) - ident(ids) operator(=) ident(args)operator(.)ident(flatten)operator(.)ident(compact)operator(.)ident(uniq) - - reserved(if) ident(ids)operator(.)ident(size) operator(==) integer(1) - ident(id) operator(=) ident(ids)operator(.)ident(first)operator(.)ident(to_i) - ident(record) operator(=) ident(load_target)operator(.)ident(detect) operator({) operator(|)ident(record)operator(|) ident(id) operator(==) ident(record)operator(.)ident(id) operator(}) - ident(expects_array) operator(?) operator([)ident(record)operator(]) operator(:) ident(record) - reserved(else) - ident(load_target)operator(.)ident(select) operator({) operator(|)ident(record)operator(|) ident(ids)operator(.)ident(include?)operator(()ident(record)operator(.)ident(id)operator(\)) operator(}) - reserved(end) - reserved(else) - ident(conditions) operator(=) stringdelimiter(")> - - reserved(if) ident(sanitized_conditions) operator(=) ident(sanitize_sql)operator(()ident(options)operator([)symbol(:conditions)operator(])operator(\)) - ident(conditions) operator(<<) stringcontent(\))delimiter(")> - reserved(end) - - ident(options)operator([)symbol(:conditions)operator(]) operator(=) ident(conditions) - ident(options)operator([)symbol(:joins)operator(]) operator(=) instance_variable(@join_sql) - ident(options)operator([)symbol(:readonly)operator(]) operator(=) ident(finding_with_ambigious_select?)operator(()ident(options)operator([)symbol(:select)operator(])operator(\)) - - reserved(if) ident(options)operator([)symbol(:order)operator(]) operator(&&) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(]) - ident(options)operator([)symbol(:order)operator(]) operator(=) stringcontent(, )inlinedelimiter(")> - reserved(elsif) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(]) - ident(options)operator([)symbol(:order)operator(]) operator(=) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(]) - reserved(end) - - ident(merge_options_from_reflection!)operator(()ident(options)operator(\)) - - comment(# Pass through args exactly as we received them.) - ident(args) operator(<<) ident(options) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(find)operator(()operator(*)ident(args)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(push_with_attributes)operator(()ident(record)operator(,) ident(join_attributes) operator(=) operator({)operator(})operator(\)) - ident(raise_on_type_mismatch)operator(()ident(record)operator(\)) - ident(join_attributes)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) ident(record)operator([)ident(key)operator(.)ident(to_s)operator(]) operator(=) ident(value) operator(}) - - ident(callback)operator(()symbol(:before_add)operator(,) ident(record)operator(\)) - ident(insert_record)operator(()ident(record)operator(\)) reserved(unless) instance_variable(@owner)operator(.)ident(new_record?) - instance_variable(@target) operator(<<) ident(record) - ident(callback)operator(()symbol(:after_add)operator(,) ident(record)operator(\)) - - pre_constant(self) - reserved(end) - - reserved(alias) symbol(:concat_with_attributes) symbol(:push_with_attributes) - - reserved(def) method(size) - instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:uniq)operator(]) operator(?) ident(count_records) operator(:) reserved(super) - reserved(end) - - ident(protected) - reserved(def) method(method_missing)operator(()ident(method)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(if) instance_variable(@target)operator(.)ident(respond_to?)operator(()ident(method)operator(\)) operator(||) operator(()operator(!)instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(respond_to?)operator(()ident(method)operator(\)) operator(&&) constant(Class)operator(.)ident(respond_to?)operator(()ident(method)operator(\))operator(\)) - reserved(super) - reserved(else) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) instance_variable(@finder_sql)operator(,) symbol(:joins) operator(=)operator(>) instance_variable(@join_sql)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(false) operator(})operator(\)) reserved(do) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(send)operator(()ident(method)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(find_target) - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - ident(records) operator(=) instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(find_by_sql)operator(()instance_variable(@finder_sql)operator(\)) - reserved(else) - ident(records) operator(=) ident(find)operator(()symbol(:all)operator(\)) - reserved(end) - - instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:uniq)operator(]) operator(?) ident(uniq)operator(()ident(records)operator(\)) operator(:) ident(records) - reserved(end) - - reserved(def) method(count_records) - ident(load_target)operator(.)ident(size) - reserved(end) - - reserved(def) method(insert_record)operator(()ident(record)operator(\)) - reserved(if) ident(record)operator(.)ident(new_record?) - reserved(return) pre_constant(false) reserved(unless) ident(record)operator(.)ident(save) - reserved(end) - - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:insert_sql)operator(]) - instance_variable(@owner)operator(.)ident(connection)operator(.)ident(execute)operator(()ident(interpolate_sql)operator(()instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:insert_sql)operator(])operator(,) ident(record)operator(\))operator(\)) - reserved(else) - ident(columns) operator(=) instance_variable(@owner)operator(.)ident(connection)operator(.)ident(columns)operator(()instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:join_table)operator(])operator(,) stringcontent( Columns)delimiter(")>operator(\)) - - ident(attributes) operator(=) ident(columns)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(attributes)operator(,) ident(column)operator(|) - reserved(case) ident(column)operator(.)ident(name) - reserved(when) instance_variable(@reflection)operator(.)ident(primary_key_name) - ident(attributes)operator([)ident(column)operator(.)ident(name)operator(]) operator(=) instance_variable(@owner)operator(.)ident(quoted_id) - reserved(when) instance_variable(@reflection)operator(.)ident(association_foreign_key) - ident(attributes)operator([)ident(column)operator(.)ident(name)operator(]) operator(=) ident(record)operator(.)ident(quoted_id) - reserved(else) - reserved(if) ident(record)operator(.)ident(attributes)operator(.)ident(has_key?)operator(()ident(column)operator(.)ident(name)operator(\)) - ident(value) operator(=) instance_variable(@owner)operator(.)ident(send)operator(()symbol(:quote)operator(,) ident(record)operator([)ident(column)operator(.)ident(name)operator(])operator(,) ident(column)operator(\)) - ident(attributes)operator([)ident(column)operator(.)ident(name)operator(]) operator(=) ident(value) reserved(unless) ident(value)operator(.)ident(nil?) - reserved(end) - reserved(end) - ident(attributes) - reserved(end) - - ident(sql) operator(=) - stringcontent( ()inlineoperator(\))inline_delimiter(})>content(\) )delimiter(")> operator(+) - stringoperator(\))inline_delimiter(})>content(\))delimiter(")> - - instance_variable(@owner)operator(.)ident(connection)operator(.)ident(execute)operator(()ident(sql)operator(\)) - reserved(end) - - reserved(return) pre_constant(true) - reserved(end) - - reserved(def) method(delete_records)operator(()ident(records)operator(\)) - reserved(if) ident(sql) operator(=) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:delete_sql)operator(]) - ident(records)operator(.)ident(each) operator({) operator(|)ident(record)operator(|) instance_variable(@owner)operator(.)ident(connection)operator(.)ident(execute)operator(()ident(interpolate_sql)operator(()ident(sql)operator(,) ident(record)operator(\))operator(\)) operator(}) - reserved(else) - ident(ids) operator(=) ident(quoted_record_ids)operator(()ident(records)operator(\)) - ident(sql) operator(=) stringcontent( WHERE )inlinecontent( = )inlinecontent( AND )inlinecontent( IN ()inlinecontent(\))delimiter(")> - instance_variable(@owner)operator(.)ident(connection)operator(.)ident(execute)operator(()ident(sql)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(construct_sql) - ident(interpolate_sql_options!)operator(()instance_variable(@reflection)operator(.)ident(options)operator(,) symbol(:finder_sql)operator(\)) - - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - instance_variable(@finder_sql) operator(=) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - reserved(else) - instance_variable(@finder_sql) operator(=) stringcontent(.)inlinecontent( = )inlinecontent( )delimiter(")> - instance_variable(@finder_sql) operator(<<) stringcontent(\))delimiter(")> reserved(if) ident(conditions) - reserved(end) - - instance_variable(@join_sql) operator(=) stringcontent( ON )inlinecontent(.)inlinecontent( = )inlinecontent(.)inlinedelimiter(")> - reserved(end) - - comment(# Join tables with additional columns on top of the two foreign keys must be considered ambigious unless a select) - comment(# clause has been explicitly defined. Otherwise you can get broken records back, if, say, the join column also has) - comment(# and id column, which will then overwrite the id column of the records coming back.) - reserved(def) method(finding_with_ambigious_select?)operator(()ident(select_clause)operator(\)) - operator(!)ident(select_clause) operator(&&) instance_variable(@owner)operator(.)ident(connection)operator(.)ident(columns)operator(()instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:join_table)operator(])operator(,) stringoperator(\))operator(.)ident(size) operator(!=) integer(2) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Associations) - reserved(class) class(HasManyAssociation) operator(<) constant(AssociationCollection) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(owner)operator(,) ident(reflection)operator(\)) - reserved(super) - ident(construct_sql) - reserved(end) - - reserved(def) method(build)operator(()ident(attributes) operator(=) operator({)operator(})operator(\)) - reserved(if) ident(attributes)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - ident(attributes)operator(.)ident(collect) operator({) operator(|)ident(attr)operator(|) ident(build)operator(()ident(attr)operator(\)) operator(}) - reserved(else) - ident(load_target) - ident(record) operator(=) instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(new)operator(()ident(attributes)operator(\)) - ident(set_belongs_to_association_for)operator(()ident(record)operator(\)) - instance_variable(@target) operator(<<) ident(record) - ident(record) - reserved(end) - reserved(end) - - comment(# DEPRECATED.) - reserved(def) method(find_all)operator(()ident(runtime_conditions) operator(=) pre_constant(nil)operator(,) ident(orderings) operator(=) pre_constant(nil)operator(,) ident(limit) operator(=) pre_constant(nil)operator(,) ident(joins) operator(=) pre_constant(nil)operator(\)) - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(find_by_sql)operator(()instance_variable(@finder_sql)operator(\)) - reserved(else) - ident(conditions) operator(=) instance_variable(@finder_sql) - ident(conditions) operator(+=) stringcontent(\))delimiter(")> reserved(if) ident(runtime_conditions) - ident(orderings) operator(||=) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(]) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(find_all)operator(()ident(conditions)operator(,) ident(orderings)operator(,) ident(limit)operator(,) ident(joins)operator(\)) - reserved(end) - reserved(end) - - comment(# DEPRECATED. Find the first associated record. All arguments are optional.) - reserved(def) method(find_first)operator(()ident(conditions) operator(=) pre_constant(nil)operator(,) ident(orderings) operator(=) pre_constant(nil)operator(\)) - ident(find_all)operator(()ident(conditions)operator(,) ident(orderings)operator(,) integer(1)operator(\))operator(.)ident(first) - reserved(end) - - comment(# Count the number of associated records. All arguments are optional.) - reserved(def) method(count)operator(()ident(runtime_conditions) operator(=) pre_constant(nil)operator(\)) - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:counter_sql)operator(]) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(count_by_sql)operator(()instance_variable(@counter_sql)operator(\)) - reserved(elsif) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(count_by_sql)operator(()instance_variable(@finder_sql)operator(\)) - reserved(else) - ident(sql) operator(=) instance_variable(@finder_sql) - ident(sql) operator(+=) stringcontent(\))delimiter(")> reserved(if) ident(runtime_conditions) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(count)operator(()ident(sql)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(find)operator(()operator(*)ident(args)operator(\)) - ident(options) operator(=) constant(Base)operator(.)ident(send)operator(()symbol(:extract_options_from_args!)operator(,) ident(args)operator(\)) - - comment(# If using a custom finder_sql, scan the entire collection.) - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - ident(expects_array) operator(=) ident(args)operator(.)ident(first)operator(.)ident(kind_of?)operator(()constant(Array)operator(\)) - ident(ids) operator(=) ident(args)operator(.)ident(flatten)operator(.)ident(compact)operator(.)ident(uniq) - - reserved(if) ident(ids)operator(.)ident(size) operator(==) integer(1) - ident(id) operator(=) ident(ids)operator(.)ident(first) - ident(record) operator(=) ident(load_target)operator(.)ident(detect) operator({) operator(|)ident(record)operator(|) ident(id) operator(==) ident(record)operator(.)ident(id) operator(}) - ident(expects_array) operator(?) operator([) ident(record) operator(]) operator(:) ident(record) - reserved(else) - ident(load_target)operator(.)ident(select) operator({) operator(|)ident(record)operator(|) ident(ids)operator(.)ident(include?)operator(()ident(record)operator(.)ident(id)operator(\)) operator(}) - reserved(end) - reserved(else) - ident(conditions) operator(=) stringdelimiter(")> - reserved(if) ident(sanitized_conditions) operator(=) ident(sanitize_sql)operator(()ident(options)operator([)symbol(:conditions)operator(])operator(\)) - ident(conditions) operator(<<) stringcontent(\))delimiter(")> - reserved(end) - ident(options)operator([)symbol(:conditions)operator(]) operator(=) ident(conditions) - - reserved(if) ident(options)operator([)symbol(:order)operator(]) operator(&&) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(]) - ident(options)operator([)symbol(:order)operator(]) operator(=) stringcontent(, )inlinedelimiter(")> - reserved(elsif) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(]) - ident(options)operator([)symbol(:order)operator(]) operator(=) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(]) - reserved(end) - - ident(merge_options_from_reflection!)operator(()ident(options)operator(\)) - - comment(# Pass through args exactly as we received them.) - ident(args) operator(<<) ident(options) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(find)operator(()operator(*)ident(args)operator(\)) - reserved(end) - reserved(end) - - ident(protected) - reserved(def) method(method_missing)operator(()ident(method)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(if) instance_variable(@target)operator(.)ident(respond_to?)operator(()ident(method)operator(\)) operator(||) operator(()operator(!)instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(respond_to?)operator(()ident(method)operator(\)) operator(&&) constant(Class)operator(.)ident(respond_to?)operator(()ident(method)operator(\))operator(\)) - reserved(super) - reserved(else) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(with_scope)operator(() - symbol(:find) operator(=)operator(>) operator({) - symbol(:conditions) operator(=)operator(>) instance_variable(@finder_sql)operator(,) - symbol(:joins) operator(=)operator(>) instance_variable(@join_sql)operator(,) - symbol(:readonly) operator(=)operator(>) pre_constant(false) - operator(})operator(,) - symbol(:create) operator(=)operator(>) operator({) - instance_variable(@reflection)operator(.)ident(primary_key_name) operator(=)operator(>) instance_variable(@owner)operator(.)ident(id) - operator(}) - operator(\)) reserved(do) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(send)operator(()ident(method)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(find_target) - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(find_by_sql)operator(()instance_variable(@finder_sql)operator(\)) - reserved(else) - ident(find)operator(()symbol(:all)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(count_records) - ident(count) operator(=) reserved(if) ident(has_cached_counter?) - instance_variable(@owner)operator(.)ident(send)operator(()symbol(:read_attribute)operator(,) ident(cached_counter_attribute_name)operator(\)) - reserved(elsif) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:counter_sql)operator(]) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(count_by_sql)operator(()instance_variable(@counter_sql)operator(\)) - reserved(else) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(count)operator(()instance_variable(@counter_sql)operator(\)) - reserved(end) - - instance_variable(@target) operator(=) operator([)operator(]) reserved(and) ident(loaded) reserved(if) ident(count) operator(==) integer(0) - - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:limit)operator(]) - ident(count) operator(=) operator([) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:limit)operator(])operator(,) ident(count) operator(])operator(.)ident(min) - reserved(end) - - reserved(return) ident(count) - reserved(end) - - reserved(def) method(has_cached_counter?) - instance_variable(@owner)operator(.)ident(attribute_present?)operator(()ident(cached_counter_attribute_name)operator(\)) - reserved(end) - - reserved(def) method(cached_counter_attribute_name) - stringcontent(_count)delimiter(")> - reserved(end) - - reserved(def) method(insert_record)operator(()ident(record)operator(\)) - ident(set_belongs_to_association_for)operator(()ident(record)operator(\)) - ident(record)operator(.)ident(save) - reserved(end) - - reserved(def) method(delete_records)operator(()ident(records)operator(\)) - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:dependent)operator(]) - ident(records)operator(.)ident(each) operator({) operator(|)ident(r)operator(|) ident(r)operator(.)ident(destroy) operator(}) - reserved(else) - ident(ids) operator(=) ident(quoted_record_ids)operator(()ident(records)operator(\)) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(update_all)operator(() - stringcontent( = NULL)delimiter(")>operator(,) - stringcontent( = )inlinecontent( AND )inlinecontent( IN ()inlinecontent(\))delimiter(")> - operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(target_obsolete?) - pre_constant(false) - reserved(end) - - reserved(def) method(construct_sql) - reserved(case) - reserved(when) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - instance_variable(@finder_sql) operator(=) ident(interpolate_sql)operator(()instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(])operator(\)) - - reserved(when) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:as)operator(]) - instance_variable(@finder_sql) operator(=) - stringcontent(.)inlinecontent(_id = )inlinecontent( AND )delimiter(")> operator(+) - stringcontent(.)inlinecontent(_type = )inlinedelimiter(")> - instance_variable(@finder_sql) operator(<<) stringcontent(\))delimiter(")> reserved(if) ident(conditions) - - reserved(else) - instance_variable(@finder_sql) operator(=) stringcontent(.)inlinecontent( = )inlinedelimiter(")> - instance_variable(@finder_sql) operator(<<) stringcontent(\))delimiter(")> reserved(if) ident(conditions) - reserved(end) - - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:counter_sql)operator(]) - instance_variable(@counter_sql) operator(=) ident(interpolate_sql)operator(()instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:counter_sql)operator(])operator(\)) - reserved(elsif) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - comment(# replace the SELECT clause with COUNT(*\), preserving any hints within /* ... */) - instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:counter_sql)operator(]) operator(=) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(])operator(.)ident(sub)operator(()regexpoperator(\)) operator({) stringcontent(COUNT(*\) FROM)delimiter(")> operator(}) - instance_variable(@counter_sql) operator(=) ident(interpolate_sql)operator(()instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:counter_sql)operator(])operator(\)) - reserved(else) - instance_variable(@counter_sql) operator(=) instance_variable(@finder_sql) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Associations) - reserved(class) class(HasManyThroughAssociation) operator(<) constant(AssociationProxy) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(owner)operator(,) ident(reflection)operator(\)) - reserved(super) - ident(reflection)operator(.)ident(check_validity!) - instance_variable(@finder_sql) operator(=) ident(construct_conditions) - ident(construct_sql) - reserved(end) - - - reserved(def) method(find)operator(()operator(*)ident(args)operator(\)) - ident(options) operator(=) constant(Base)operator(.)ident(send)operator(()symbol(:extract_options_from_args!)operator(,) ident(args)operator(\)) - - ident(conditions) operator(=) stringdelimiter(")> - reserved(if) ident(sanitized_conditions) operator(=) ident(sanitize_sql)operator(()ident(options)operator([)symbol(:conditions)operator(])operator(\)) - ident(conditions) operator(<<) stringcontent(\))delimiter(")> - reserved(end) - ident(options)operator([)symbol(:conditions)operator(]) operator(=) ident(conditions) - - reserved(if) ident(options)operator([)symbol(:order)operator(]) operator(&&) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(]) - ident(options)operator([)symbol(:order)operator(]) operator(=) stringcontent(, )inlinedelimiter(")> - reserved(elsif) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(]) - ident(options)operator([)symbol(:order)operator(]) operator(=) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(]) - reserved(end) - - ident(options)operator([)symbol(:select)operator(]) operator(=) ident(construct_select)operator(()ident(options)operator([)symbol(:select)operator(])operator(\)) - ident(options)operator([)symbol(:from)operator(]) operator(||=) ident(construct_from) - ident(options)operator([)symbol(:joins)operator(]) operator(=) ident(construct_joins)operator(()ident(options)operator([)symbol(:joins)operator(])operator(\)) - ident(options)operator([)symbol(:include)operator(]) operator(=) instance_variable(@reflection)operator(.)ident(source_reflection)operator(.)ident(options)operator([)symbol(:include)operator(]) reserved(if) ident(options)operator([)symbol(:include)operator(])operator(.)ident(nil?) - - ident(merge_options_from_reflection!)operator(()ident(options)operator(\)) - - comment(# Pass through args exactly as we received them.) - ident(args) operator(<<) ident(options) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(find)operator(()operator(*)ident(args)operator(\)) - reserved(end) - - reserved(def) method(reset) - instance_variable(@target) operator(=) operator([)operator(]) - instance_variable(@loaded) operator(=) pre_constant(false) - reserved(end) - - ident(protected) - reserved(def) method(method_missing)operator(()ident(method)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(if) instance_variable(@target)operator(.)ident(respond_to?)operator(()ident(method)operator(\)) operator(||) operator(()operator(!)instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(respond_to?)operator(()ident(method)operator(\)) operator(&&) constant(Class)operator(.)ident(respond_to?)operator(()ident(method)operator(\))operator(\)) - reserved(super) - reserved(else) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(with_scope)operator(()ident(construct_scope)operator(\)) operator({) instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(send)operator(()ident(method)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) operator(}) - reserved(end) - reserved(end) - - reserved(def) method(find_target) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(find)operator(()symbol(:all)operator(,) - symbol(:select) operator(=)operator(>) ident(construct_select)operator(,) - symbol(:conditions) operator(=)operator(>) ident(construct_conditions)operator(,) - symbol(:from) operator(=)operator(>) ident(construct_from)operator(,) - symbol(:joins) operator(=)operator(>) ident(construct_joins)operator(,) - symbol(:order) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(])operator(,) - symbol(:limit) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:limit)operator(])operator(,) - symbol(:group) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:group)operator(])operator(,) - symbol(:include) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:include)operator(]) operator(||) instance_variable(@reflection)operator(.)ident(source_reflection)operator(.)ident(options)operator([)symbol(:include)operator(]) - operator(\)) - reserved(end) - - reserved(def) method(construct_conditions) - ident(conditions) operator(=) reserved(if) instance_variable(@reflection)operator(.)ident(through_reflection)operator(.)ident(options)operator([)symbol(:as)operator(]) - stringcontent(.)inlinecontent(_id = )inlinecontent( )delimiter(")> operator(+) - stringcontent(.)inlinecontent(_type = )inlinedelimiter(")> - reserved(else) - stringcontent(.)inlinecontent( = )inlinedelimiter(")> - reserved(end) - ident(conditions) operator(<<) stringcontent(\))delimiter(")> reserved(if) ident(sql_conditions) - - reserved(return) ident(conditions) - reserved(end) - - reserved(def) method(construct_from) - instance_variable(@reflection)operator(.)ident(table_name) - reserved(end) - - reserved(def) method(construct_select)operator(()ident(custom_select) operator(=) pre_constant(nil)operator(\)) - ident(selected) operator(=) ident(custom_select) operator(||) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:select)operator(]) operator(||) stringcontent(.*)delimiter(")> - reserved(end) - - reserved(def) method(construct_joins)operator(()ident(custom_joins) operator(=) pre_constant(nil)operator(\)) - ident(polymorphic_join) operator(=) pre_constant(nil) - reserved(if) instance_variable(@reflection)operator(.)ident(through_reflection)operator(.)ident(options)operator([)symbol(:as)operator(]) operator(||) instance_variable(@reflection)operator(.)ident(source_reflection)operator(.)ident(macro) operator(==) symbol(:belongs_to) - ident(reflection_primary_key) operator(=) instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(primary_key) - ident(source_primary_key) operator(=) instance_variable(@reflection)operator(.)ident(source_reflection)operator(.)ident(primary_key_name) - reserved(else) - ident(reflection_primary_key) operator(=) instance_variable(@reflection)operator(.)ident(source_reflection)operator(.)ident(primary_key_name) - ident(source_primary_key) operator(=) instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(primary_key) - reserved(if) instance_variable(@reflection)operator(.)ident(source_reflection)operator(.)ident(options)operator([)symbol(:as)operator(]) - ident(polymorphic_join) operator(=) string operator(%) operator([) - instance_variable(@reflection)operator(.)ident(table_name)operator(,) stringcontent(_type)delimiter(")>operator(,) - instance_variable(@owner)operator(.)ident(class)operator(.)ident(quote)operator(()instance_variable(@reflection)operator(.)ident(through_reflection)operator(.)ident(klass)operator(.)ident(name)operator(\)) - operator(]) - reserved(end) - reserved(end) - - stringcontent( )inlinedelimiter(")> operator(%) operator([) - instance_variable(@reflection)operator(.)ident(through_reflection)operator(.)ident(table_name)operator(,) - instance_variable(@reflection)operator(.)ident(table_name)operator(,) ident(reflection_primary_key)operator(,) - instance_variable(@reflection)operator(.)ident(through_reflection)operator(.)ident(table_name)operator(,) ident(source_primary_key)operator(,) - ident(polymorphic_join) - operator(]) - reserved(end) - - reserved(def) method(construct_scope) - operator({) - symbol(:find) operator(=)operator(>) operator({) symbol(:from) operator(=)operator(>) ident(construct_from)operator(,) symbol(:conditions) operator(=)operator(>) ident(construct_conditions)operator(,) symbol(:joins) operator(=)operator(>) ident(construct_joins)operator(,) symbol(:select) operator(=)operator(>) ident(construct_select) operator(})operator(,) - symbol(:create) operator(=)operator(>) operator({) instance_variable(@reflection)operator(.)ident(primary_key_name) operator(=)operator(>) instance_variable(@owner)operator(.)ident(id) operator(}) - operator(}) - reserved(end) - - reserved(def) method(construct_sql) - reserved(case) - reserved(when) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - instance_variable(@finder_sql) operator(=) ident(interpolate_sql)operator(()instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(])operator(\)) - - instance_variable(@finder_sql) operator(=) stringcontent(.)inlinecontent( = )inlinedelimiter(")> - instance_variable(@finder_sql) operator(<<) stringcontent(\))delimiter(")> reserved(if) ident(conditions) - reserved(end) - - reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:counter_sql)operator(]) - instance_variable(@counter_sql) operator(=) ident(interpolate_sql)operator(()instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:counter_sql)operator(])operator(\)) - reserved(elsif) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(]) - comment(# replace the SELECT clause with COUNT(*\), preserving any hints within /* ... */) - instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:counter_sql)operator(]) operator(=) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:finder_sql)operator(])operator(.)ident(sub)operator(()regexpoperator(\)) operator({) stringcontent(COUNT(*\) FROM)delimiter(")> operator(}) - instance_variable(@counter_sql) operator(=) ident(interpolate_sql)operator(()instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:counter_sql)operator(])operator(\)) - reserved(else) - instance_variable(@counter_sql) operator(=) instance_variable(@finder_sql) - reserved(end) - reserved(end) - - reserved(def) method(conditions) - instance_variable(@conditions) operator(||=) operator([) - operator(()ident(interpolate_sql)operator(()instance_variable(@reflection)operator(.)ident(active_record)operator(.)ident(send)operator(()symbol(:sanitize_sql)operator(,) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:conditions)operator(])operator(\))operator(\)) reserved(if) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:conditions)operator(])operator(\))operator(,) - operator(()ident(interpolate_sql)operator(()instance_variable(@reflection)operator(.)ident(active_record)operator(.)ident(send)operator(()symbol(:sanitize_sql)operator(,) instance_variable(@reflection)operator(.)ident(through_reflection)operator(.)ident(options)operator([)symbol(:conditions)operator(])operator(\))operator(\)) reserved(if) instance_variable(@reflection)operator(.)ident(through_reflection)operator(.)ident(options)operator([)symbol(:conditions)operator(])operator(\)) - operator(])operator(.)ident(compact)operator(.)ident(collect) operator({) operator(|)ident(condition)operator(|) stringcontent(\))delimiter(")> operator(})operator(.)ident(join)operator(()stringoperator(\)) reserved(unless) operator(()operator(!)instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:conditions)operator(]) operator(&&) operator(!)instance_variable(@reflection)operator(.)ident(through_reflection)operator(.)ident(options)operator([)symbol(:conditions)operator(])operator(\)) - reserved(end) - - ident(alias_method) symbol(:sql_conditions)operator(,) symbol(:conditions) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Associations) - reserved(class) class(HasOneAssociation) operator(<) constant(BelongsToAssociation) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(owner)operator(,) ident(reflection)operator(\)) - reserved(super) - ident(construct_sql) - reserved(end) - - reserved(def) method(create)operator(()ident(attributes) operator(=) operator({)operator(})operator(,) ident(replace_existing) operator(=) pre_constant(true)operator(\)) - ident(record) operator(=) ident(build)operator(()ident(attributes)operator(,) ident(replace_existing)operator(\)) - ident(record)operator(.)ident(save) - ident(record) - reserved(end) - - reserved(def) method(build)operator(()ident(attributes) operator(=) operator({)operator(})operator(,) ident(replace_existing) operator(=) pre_constant(true)operator(\)) - ident(record) operator(=) instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(new)operator(()ident(attributes)operator(\)) - - reserved(if) ident(replace_existing) - ident(replace)operator(()ident(record)operator(,) pre_constant(true)operator(\)) - reserved(else) - ident(record)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(]) operator(=) instance_variable(@owner)operator(.)ident(id) reserved(unless) instance_variable(@owner)operator(.)ident(new_record?) - pre_constant(self)operator(.)ident(target) operator(=) ident(record) - reserved(end) - - ident(record) - reserved(end) - - reserved(def) method(replace)operator(()ident(obj)operator(,) ident(dont_save) operator(=) pre_constant(false)operator(\)) - ident(load_target) - - reserved(unless) instance_variable(@target)operator(.)ident(nil?) - reserved(if) ident(dependent?) operator(&&) operator(!)ident(dont_save) operator(&&) instance_variable(@target) operator(!=) ident(obj) - instance_variable(@target)operator(.)ident(destroy) reserved(unless) instance_variable(@target)operator(.)ident(new_record?) - instance_variable(@owner)operator(.)ident(clear_association_cache) - reserved(else) - instance_variable(@target)operator([)instance_variable(@reflection)operator(.)ident(primary_key_name)operator(]) operator(=) pre_constant(nil) - instance_variable(@target)operator(.)ident(save) reserved(unless) instance_variable(@owner)operator(.)ident(new_record?) operator(||) instance_variable(@target)operator(.)ident(new_record?) - reserved(end) - reserved(end) - - reserved(if) ident(obj)operator(.)ident(nil?) - instance_variable(@target) operator(=) pre_constant(nil) - reserved(else) - ident(raise_on_type_mismatch)operator(()ident(obj)operator(\)) - ident(set_belongs_to_association_for)operator(()ident(obj)operator(\)) - instance_variable(@target) operator(=) operator(()constant(AssociationProxy) operator(===) ident(obj) operator(?) ident(obj)operator(.)ident(target) operator(:) ident(obj)operator(\)) - reserved(end) - - instance_variable(@loaded) operator(=) pre_constant(true) - - reserved(unless) instance_variable(@owner)operator(.)ident(new_record?) reserved(or) ident(obj)operator(.)ident(nil?) reserved(or) ident(dont_save) - reserved(return) operator(()ident(obj)operator(.)ident(save) operator(?) pre_constant(self) operator(:) pre_constant(false)operator(\)) - reserved(else) - reserved(return) operator(()ident(obj)operator(.)ident(nil?) operator(?) pre_constant(nil) operator(:) pre_constant(self)operator(\)) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(find_target) - instance_variable(@reflection)operator(.)ident(klass)operator(.)ident(find)operator(()symbol(:first)operator(,) - symbol(:conditions) operator(=)operator(>) instance_variable(@finder_sql)operator(,) - symbol(:order) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:order)operator(])operator(,) - symbol(:include) operator(=)operator(>) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:include)operator(]) - operator(\)) - reserved(end) - - reserved(def) method(construct_sql) - reserved(case) - reserved(when) instance_variable(@reflection)operator(.)ident(options)operator([)symbol(:as)operator(]) - instance_variable(@finder_sql) operator(=) - stringcontent(.)inlinecontent(_id = )inlinecontent( AND )delimiter(")> operator(+) - stringcontent(.)inlinecontent(_type = )inlinedelimiter(")> - reserved(else) - instance_variable(@finder_sql) operator(=) stringcontent(.)inlinecontent( = )inlinedelimiter(")> - reserved(end) - instance_variable(@finder_sql) operator(<<) stringcontent(\))delimiter(")> reserved(if) ident(conditions) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(class) class(HasManyThroughAssociationNotFoundError) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(reflection)operator(\)) - instance_variable(@reflection) operator(=) ident(reflection) - reserved(end) - - reserved(def) method(message) - stringcontent( in model )inlinedelimiter(")> - reserved(end) - reserved(end) - - reserved(class) class(HasManyThroughAssociationPolymorphicError) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(owner_class_name)operator(,) ident(reflection)operator(,) ident(source_reflection)operator(\)) - instance_variable(@owner_class_name) operator(=) ident(owner_class_name) - instance_variable(@reflection) operator(=) ident(reflection) - instance_variable(@source_reflection) operator(=) ident(source_reflection) - reserved(end) - - reserved(def) method(message) - stringcontent(#)inlinecontent(' on the polymorphic object ')inlinecontent(#)inlinecontent('.)delimiter(")> - reserved(end) - reserved(end) - - reserved(class) class(HasManyThroughSourceAssociationNotFoundError) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(reflection)operator(\)) - instance_variable(@reflection) operator(=) ident(reflection) - instance_variable(@through_reflection) operator(=) ident(reflection)operator(.)ident(through_reflection) - instance_variable(@source_reflection_names) operator(=) ident(reflection)operator(.)ident(source_reflection_names) - instance_variable(@source_associations) operator(=) ident(reflection)operator(.)ident(through_reflection)operator(.)ident(klass)operator(.)ident(reflect_on_all_associations)operator(.)ident(collect) operator({) operator(|)ident(a)operator(|) ident(a)operator(.)ident(name)operator(.)ident(inspect) operator(}) - reserved(end) - - reserved(def) method(message) - string) stringinline_delimiter(})>content( in model )inlinecontent(. Try 'has_many )inlinecontent(, :through => )inlinecontent(, :source => '. Is it one of )inline) stringinline_delimiter(})>content(?)delimiter(")> - reserved(end) - reserved(end) - - reserved(class) class(HasManyThroughSourceAssociationMacroError) operator(<) constant(ActiveRecordError) comment(#:nodoc) - reserved(def) method(initialize)operator(()ident(reflection)operator(\)) - instance_variable(@reflection) operator(=) ident(reflection) - instance_variable(@through_reflection) operator(=) ident(reflection)operator(.)ident(through_reflection) - instance_variable(@source_reflection) operator(=) ident(reflection)operator(.)ident(source_reflection) - reserved(end) - - reserved(def) method(message) - stringinline reserved(if) instance_variable(@source_reflection)operator(.)ident(options)operator([)symbol(:through)operator(])inline_delimiter(})>content( for has_many )inlinecontent(, :through => )inlinecontent(. Use :source to specify the source reflection.)delimiter(")> - reserved(end) - reserved(end) - - reserved(class) class(EagerLoadPolymorphicError) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(reflection)operator(\)) - instance_variable(@reflection) operator(=) ident(reflection) - reserved(end) - - reserved(def) method(message) - stringdelimiter(")> - reserved(end) - reserved(end) - - reserved(module) class(Associations) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - comment(# Clears out the association cache ) - reserved(def) method(clear_association_cache) comment(#:nodoc:) - pre_constant(self)operator(.)ident(class)operator(.)ident(reflect_on_all_associations)operator(.)ident(to_a)operator(.)ident(each) reserved(do) operator(|)ident(assoc)operator(|) - ident(instance_variable_set) stringdelimiter(")>operator(,) pre_constant(nil) - reserved(end) reserved(unless) pre_constant(self)operator(.)ident(new_record?) - reserved(end) - - comment(# Associations are a set of macro-like class methods for tying objects together through foreign keys. They express relationships like ) - comment(# "Project has one Project Manager" or "Project belongs to a Portfolio". Each macro adds a number of methods to the class which are ) - comment(# specialized according to the collection or association symbol and the options hash. It works much the same way as Ruby's own attr* ) - comment(# methods. Example:) - comment(#) - comment(# class Project < ActiveRecord::Base) - comment(# belongs_to :portfolio) - comment(# has_one :project_manager ) - comment(# has_many :milestones) - comment(# has_and_belongs_to_many :categories) - comment(# end) - comment(#) - comment(# The project class now has the following methods (and more\) to ease the traversal and manipulation of its relationships:) - comment(# * Project#portfolio, Project#portfolio=(portfolio\), Project#portfolio.nil?) - comment(# * Project#project_manager, Project#project_manager=(project_manager\), Project#project_manager.nil?,) - comment(# * Project#milestones.empty?, Project#milestones.size, Project#milestones, Project#milestones<<(milestone\),) - comment(# Project#milestones.delete(milestone\), Project#milestones.find(milestone_id\), Project#milestones.find_all(conditions\),) - comment(# Project#milestones.build, Project#milestones.create) - comment(# * Project#categories.empty?, Project#categories.size, Project#categories, Project#categories<<(category1\),) - comment(# Project#categories.delete(category1\)) - comment(#) - comment(# == Example) - comment(#) - comment(# link:files/examples/associations.png) - comment(#) - comment(# == Is it belongs_to or has_one?) - comment(#) - comment(# Both express a 1-1 relationship, the difference is mostly where to place the foreign key, which goes on the table for the class) - comment(# saying belongs_to. Example:) - comment(#) - comment(# class Post < ActiveRecord::Base) - comment(# has_one :author) - comment(# end) - comment(#) - comment(# class Author < ActiveRecord::Base) - comment(# belongs_to :post) - comment(# end) - comment(#) - comment(# The tables for these classes could look something like:) - comment(#) - comment(# CREATE TABLE posts () - comment(# id int(11\) NOT NULL auto_increment,) - comment(# title varchar default NULL,) - comment(# PRIMARY KEY (id\)) - comment(# \)) - comment(#) - comment(# CREATE TABLE authors () - comment(# id int(11\) NOT NULL auto_increment,) - comment(# post_id int(11\) default NULL,) - comment(# name varchar default NULL,) - comment(# PRIMARY KEY (id\)) - comment(# \)) - comment(#) - comment(# == Unsaved objects and associations) - comment(#) - comment(# You can manipulate objects and associations before they are saved to the database, but there is some special behaviour you should be) - comment(# aware of, mostly involving the saving of associated objects.) - comment(#) - comment(# === One-to-one associations) - comment(#) - comment(# * Assigning an object to a has_one association automatically saves that object and the object being replaced (if there is one\), in) - comment(# order to update their primary keys - except if the parent object is unsaved (new_record? == true\).) - comment(# * If either of these saves fail (due to one of the objects being invalid\) the assignment statement returns false and the assignment) - comment(# is cancelled.) - comment(# * If you wish to assign an object to a has_one association without saving it, use the #association.build method (documented below\).) - comment(# * Assigning an object to a belongs_to association does not save the object, since the foreign key field belongs on the parent. It does) - comment(# not save the parent either.) - comment(#) - comment(# === Collections) - comment(#) - comment(# * Adding an object to a collection (has_many or has_and_belongs_to_many\) automatically saves that object, except if the parent object) - comment(# (the owner of the collection\) is not yet stored in the database.) - comment(# * If saving any of the objects being added to a collection (via #push or similar\) fails, then #push returns false.) - comment(# * You can add an object to a collection without automatically saving it by using the #collection.build method (documented below\).) - comment(# * All unsaved (new_record? == true\) members of the collection are automatically saved when the parent is saved.) - comment(#) - comment(# === Association callbacks) - comment(#) - comment(# Similiar to the normal callbacks that hook into the lifecycle of an Active Record object, you can also define callbacks that get) - comment(# trigged when you add an object to or removing an object from a association collection. Example:) - comment(#) - comment(# class Project) - comment(# has_and_belongs_to_many :developers, :after_add => :evaluate_velocity) - comment(#) - comment(# def evaluate_velocity(developer\)) - comment(# ...) - comment(# end) - comment(# end ) - comment(#) - comment(# It's possible to stack callbacks by passing them as an array. Example:) - comment(# ) - comment(# class Project) - comment(# has_and_belongs_to_many :developers, :after_add => [:evaluate_velocity, Proc.new { |p, d| p.shipping_date = Time.now}]) - comment(# end) - comment(#) - comment(# Possible callbacks are: before_add, after_add, before_remove and after_remove.) - comment(#) - comment(# Should any of the before_add callbacks throw an exception, the object does not get added to the collection. Same with) - comment(# the before_remove callbacks, if an exception is thrown the object doesn't get removed.) - comment(#) - comment(# === Association extensions) - comment(#) - comment(# The proxy objects that controls the access to associations can be extended through anonymous modules. This is especially) - comment(# beneficial for adding new finders, creators, and other factory-type methods that are only used as part of this association.) - comment(# Example:) - comment(#) - comment(# class Account < ActiveRecord::Base) - comment(# has_many :people do) - comment(# def find_or_create_by_name(name\)) - comment(# first_name, last_name = name.split(" ", 2\)) - comment(# find_or_create_by_first_name_and_last_name(first_name, last_name\)) - comment(# end) - comment(# end) - comment(# end) - comment(#) - comment(# person = Account.find(:first\).people.find_or_create_by_name("David Heinemeier Hansson"\)) - comment(# person.first_name # => "David") - comment(# person.last_name # => "Heinemeier Hansson") - comment(#) - comment(# If you need to share the same extensions between many associations, you can use a named extension module. Example:) - comment(#) - comment(# module FindOrCreateByNameExtension) - comment(# def find_or_create_by_name(name\)) - comment(# first_name, last_name = name.split(" ", 2\)) - comment(# find_or_create_by_first_name_and_last_name(first_name, last_name\)) - comment(# end) - comment(# end) - comment(#) - comment(# class Account < ActiveRecord::Base) - comment(# has_many :people, :extend => FindOrCreateByNameExtension) - comment(# end) - comment(#) - comment(# class Company < ActiveRecord::Base) - comment(# has_many :people, :extend => FindOrCreateByNameExtension) - comment(# end) - comment(#) - comment(# === Association Join Models) - comment(# ) - comment(# Has Many associations can be configured with the :through option to use an explicit join model to retrieve the data. This) - comment(# operates similarly to a has_and_belongs_to_many association. The advantage is that you're able to add validations,) - comment(# callbacks, and extra attributes on the join model. Consider the following schema:) - comment(# ) - comment(# class Author < ActiveRecord::Base) - comment(# has_many :authorships) - comment(# has_many :books, :through => :authorships) - comment(# end) - comment(# ) - comment(# class Authorship < ActiveRecord::Base) - comment(# belongs_to :author) - comment(# belongs_to :book) - comment(# end) - comment(# ) - comment(# @author = Author.find :first) - comment(# @author.authorships.collect { |a| a.book } # selects all books that the author's authorships belong to.) - comment(# @author.books # selects all books by using the Authorship join model) - comment(# ) - comment(# You can also go through a has_many association on the join model:) - comment(# ) - comment(# class Firm < ActiveRecord::Base) - comment(# has_many :clients) - comment(# has_many :invoices, :through => :clients) - comment(# end) - comment(# ) - comment(# class Client < ActiveRecord::Base) - comment(# belongs_to :firm) - comment(# has_many :invoices) - comment(# end) - comment(# ) - comment(# class Invoice < ActiveRecord::Base) - comment(# belongs_to :client) - comment(# end) - comment(#) - comment(# @firm = Firm.find :first) - comment(# @firm.clients.collect { |c| c.invoices }.flatten # select all invoices for all clients of the firm) - comment(# @firm.invoices # selects all invoices by going through the Client join model.) - comment(#) - comment(# === Polymorphic Associations) - comment(# ) - comment(# Polymorphic associations on models are not restricted on what types of models they can be associated with. Rather, they ) - comment(# specify an interface that a has_many association must adhere to.) - comment(# ) - comment(# class Asset < ActiveRecord::Base) - comment(# belongs_to :attachable, :polymorphic => true) - comment(# end) - comment(# ) - comment(# class Post < ActiveRecord::Base) - comment(# has_many :assets, :as => :attachable # The :as option specifies the polymorphic interface to use.) - comment(# end) - comment(#) - comment(# @asset.attachable = @post) - comment(# ) - comment(# This works by using a type column in addition to a foreign key to specify the associated record. In the Asset example, you'd need) - comment(# an attachable_id integer column and an attachable_type string column.) - comment(#) - comment(# == Caching) - comment(#) - comment(# All of the methods are built on a simple caching principle that will keep the result of the last query around unless specifically) - comment(# instructed not to. The cache is even shared across methods to make it even cheaper to use the macro-added methods without ) - comment(# worrying too much about performance at the first go. Example:) - comment(#) - comment(# project.milestones # fetches milestones from the database) - comment(# project.milestones.size # uses the milestone cache) - comment(# project.milestones.empty? # uses the milestone cache) - comment(# project.milestones(true\).size # fetches milestones from the database) - comment(# project.milestones # uses the milestone cache) - comment(#) - comment(# == Eager loading of associations) - comment(#) - comment(# Eager loading is a way to find objects of a certain class and a number of named associations along with it in a single SQL call. This is) - comment(# one of the easiest ways of to prevent the dreaded 1+N problem in which fetching 100 posts that each needs to display their author) - comment(# triggers 101 database queries. Through the use of eager loading, the 101 queries can be reduced to 1. Example:) - comment(#) - comment(# class Post < ActiveRecord::Base) - comment(# belongs_to :author) - comment(# has_many :comments) - comment(# end) - comment(#) - comment(# Consider the following loop using the class above:) - comment(#) - comment(# for post in Post.find(:all\)) - comment(# puts "Post: " + post.title) - comment(# puts "Written by: " + post.author.name) - comment(# puts "Last comment on: " + post.comments.first.created_on) - comment(# end ) - comment(#) - comment(# To iterate over these one hundred posts, we'll generate 201 database queries. Let's first just optimize it for retrieving the author:) - comment(#) - comment(# for post in Post.find(:all, :include => :author\)) - comment(#) - comment(# This references the name of the belongs_to association that also used the :author symbol, so the find will now weave in a join something) - comment(# like this: LEFT OUTER JOIN authors ON authors.id = posts.author_id. Doing so will cut down the number of queries from 201 to 101.) - comment(#) - comment(# We can improve upon the situation further by referencing both associations in the finder with:) - comment(#) - comment(# for post in Post.find(:all, :include => [ :author, :comments ]\)) - comment(#) - comment(# That'll add another join along the lines of: LEFT OUTER JOIN comments ON comments.post_id = posts.id. And we'll be down to 1 query.) - comment(# But that shouldn't fool you to think that you can pull out huge amounts of data with no performance penalty just because you've reduced) - comment(# the number of queries. The database still needs to send all the data to Active Record and it still needs to be processed. So it's no) - comment(# catch-all for performance problems, but it's a great way to cut down on the number of queries in a situation as the one described above.) - comment(#) - comment(# Please note that limited eager loading with has_many and has_and_belongs_to_many associations is not compatible with describing conditions) - comment(# on these eager tables. This will work:) - comment(#) - comment(# Post.find(:all, :include => :comments, :conditions => "posts.title = 'magic forest'", :limit => 2\)) - comment(#) - comment(# ...but this will not (and an ArgumentError will be raised\):) - comment(#) - comment(# Post.find(:all, :include => :comments, :conditions => "comments.body like 'Normal%'", :limit => 2\)) - comment(#) - comment(# Also have in mind that since the eager loading is pulling from multiple tables, you'll have to disambiguate any column references) - comment(# in both conditions and orders. So :order => "posts.id DESC" will work while :order => "id DESC" will not. This may require that) - comment(# you alter the :order and :conditions on the association definitions themselves.) - comment(#) - comment(# It's currently not possible to use eager loading on multiple associations from the same table. Eager loading will not pull) - comment(# additional attributes on join tables, so "rich associations" with has_and_belongs_to_many is not a good fit for eager loading.) - comment(# ) - comment(# == Table Aliasing) - comment(#) - comment(# ActiveRecord uses table aliasing in the case that a table is referenced multiple times in a join. If a table is referenced only once,) - comment(# the standard table name is used. The second time, the table is aliased as #{reflection_name}_#{parent_table_name}. Indexes are appended) - comment(# for any more successive uses of the table name.) - comment(# ) - comment(# Post.find :all, :include => :comments) - comment(# # => SELECT ... FROM posts LEFT OUTER JOIN comments ON ...) - comment(# Post.find :all, :include => :special_comments # STI) - comment(# # => SELECT ... FROM posts LEFT OUTER JOIN comments ON ... AND comments.type = 'SpecialComment') - comment(# Post.find :all, :include => [:comments, :special_comments] # special_comments is the reflection name, posts is the parent table name) - comment(# # => SELECT ... FROM posts LEFT OUTER JOIN comments ON ... LEFT OUTER JOIN comments special_comments_posts) - comment(# ) - comment(# Acts as tree example:) - comment(# ) - comment(# TreeMixin.find :all, :include => :children) - comment(# # => SELECT ... FROM mixins LEFT OUTER JOIN mixins childrens_mixins ...) - comment(# TreeMixin.find :all, :include => {:children => :parent} # using cascading eager includes) - comment(# # => SELECT ... FROM mixins LEFT OUTER JOIN mixins childrens_mixins ... ) - comment(# LEFT OUTER JOIN parents_mixins ...) - comment(# TreeMixin.find :all, :include => {:children => {:parent => :children}} ) - comment(# # => SELECT ... FROM mixins LEFT OUTER JOIN mixins childrens_mixins ... ) - comment(# LEFT OUTER JOIN parents_mixins ... ) - comment(# LEFT OUTER JOIN mixins childrens_mixins_2) - comment(# ) - comment(# Has and Belongs to Many join tables use the same idea, but add a _join suffix:) - comment(# ) - comment(# Post.find :all, :include => :categories) - comment(# # => SELECT ... FROM posts LEFT OUTER JOIN categories_posts ... LEFT OUTER JOIN categories ...) - comment(# Post.find :all, :include => {:categories => :posts}) - comment(# # => SELECT ... FROM posts LEFT OUTER JOIN categories_posts ... LEFT OUTER JOIN categories ...) - comment(# LEFT OUTER JOIN categories_posts posts_categories_join LEFT OUTER JOIN posts posts_categories) - comment(# Post.find :all, :include => {:categories => {:posts => :categories}}) - comment(# # => SELECT ... FROM posts LEFT OUTER JOIN categories_posts ... LEFT OUTER JOIN categories ...) - comment(# LEFT OUTER JOIN categories_posts posts_categories_join LEFT OUTER JOIN posts posts_categories) - comment(# LEFT OUTER JOIN categories_posts categories_posts_join LEFT OUTER JOIN categories categories_posts) - comment(# ) - comment(# If you wish to specify your own custom joins using a :joins option, those table names will take precedence over the eager associations..) - comment(# ) - comment(# Post.find :all, :include => :comments, :joins => "inner join comments ...") - comment(# # => SELECT ... FROM posts LEFT OUTER JOIN comments_posts ON ... INNER JOIN comments ...) - comment(# Post.find :all, :include => [:comments, :special_comments], :joins => "inner join comments ...") - comment(# # => SELECT ... FROM posts LEFT OUTER JOIN comments comments_posts ON ... ) - comment(# LEFT OUTER JOIN comments special_comments_posts ...) - comment(# INNER JOIN comments ...) - comment(# ) - comment(# Table aliases are automatically truncated according to the maximum length of table identifiers according to the specific database.) - comment(# ) - comment(# == Modules) - comment(#) - comment(# By default, associations will look for objects within the current module scope. Consider:) - comment(#) - comment(# module MyApplication) - comment(# module Business) - comment(# class Firm < ActiveRecord::Base) - comment(# has_many :clients) - comment(# end) - comment(#) - comment(# class Company < ActiveRecord::Base; end) - comment(# end) - comment(# end) - comment(#) - comment(# When Firm#clients is called, it'll in turn call MyApplication::Business::Company.find(firm.id\). If you want to associate) - comment(# with a class in another module scope this can be done by specifying the complete class name, such as:) - comment(#) - comment(# module MyApplication) - comment(# module Business) - comment(# class Firm < ActiveRecord::Base; end) - comment(# end) - comment(#) - comment(# module Billing) - comment(# class Account < ActiveRecord::Base) - comment(# belongs_to :firm, :class_name => "MyApplication::Business::Firm") - comment(# end) - comment(# end) - comment(# end) - comment(#) - comment(# == Type safety with ActiveRecord::AssociationTypeMismatch) - comment(#) - comment(# If you attempt to assign an object to an association that doesn't match the inferred or specified :class_name, you'll) - comment(# get a ActiveRecord::AssociationTypeMismatch.) - comment(#) - comment(# == Options) - comment(#) - comment(# All of the association macros can be specialized through options which makes more complex cases than the simple and guessable ones) - comment(# possible.) - reserved(module) class(ClassMethods) - comment(# Adds the following methods for retrieval and query of collections of associated objects.) - comment(# +collection+ is replaced with the symbol passed as the first argument, so ) - comment(# has_many :clients would add among others clients.empty?.) - comment(# * collection(force_reload = false\) - returns an array of all the associated objects.) - comment(# An empty array is returned if none are found.) - comment(# * collection<<(object, ...\) - adds one or more objects to the collection by setting their foreign keys to the collection's primary key.) - comment(# * collection.delete(object, ...\) - removes one or more objects from the collection by setting their foreign keys to NULL. ) - comment(# This will also destroy the objects if they're declared as belongs_to and dependent on this model.) - comment(# * collection=objects - replaces the collections content by deleting and adding objects as appropriate.) - comment(# * collection_singular_ids=ids - replace the collection by the objects identified by the primary keys in +ids+) - comment(# * collection.clear - removes every object from the collection. This destroys the associated objects if they) - comment(# are :dependent, deletes them directly from the database if they are :dependent => :delete_all,) - comment(# and sets their foreign keys to NULL otherwise.) - comment(# * collection.empty? - returns true if there are no associated objects.) - comment(# * collection.size - returns the number of associated objects.) - comment(# * collection.find - finds an associated object according to the same rules as Base.find.) - comment(# * collection.build(attributes = {}\) - returns a new object of the collection type that has been instantiated) - comment(# with +attributes+ and linked to this object through a foreign key but has not yet been saved. *Note:* This only works if an ) - comment(# associated object already exists, not if it's nil!) - comment(# * collection.create(attributes = {}\) - returns a new object of the collection type that has been instantiated) - comment(# with +attributes+ and linked to this object through a foreign key and that has already been saved (if it passed the validation\).) - comment(# *Note:* This only works if an associated object already exists, not if it's nil!) - comment(#) - comment(# Example: A Firm class declares has_many :clients, which will add:) - comment(# * Firm#clients (similar to Clients.find :all, :conditions => "firm_id = #{id}"\)) - comment(# * Firm#clients<<) - comment(# * Firm#clients.delete) - comment(# * Firm#clients=) - comment(# * Firm#client_ids=) - comment(# * Firm#clients.clear) - comment(# * Firm#clients.empty? (similar to firm.clients.size == 0\)) - comment(# * Firm#clients.size (similar to Client.count "firm_id = #{id}"\)) - comment(# * Firm#clients.find (similar to Client.find(id, :conditions => "firm_id = #{id}"\)\)) - comment(# * Firm#clients.build (similar to Client.new("firm_id" => id\)\)) - comment(# * Firm#clients.create (similar to c = Client.new("firm_id" => id\); c.save; c\)) - comment(# The declaration can also include an options hash to specialize the behavior of the association.) - comment(# ) - comment(# Options are:) - comment(# * :class_name - specify the class name of the association. Use it only if that name can't be inferred) - comment(# from the association name. So has_many :products will by default be linked to the +Product+ class, but) - comment(# if the real class name is +SpecialProduct+, you'll have to specify it with this option.) - comment(# * :conditions - specify the conditions that the associated objects must meet in order to be included as a "WHERE") - comment(# sql fragment, such as "price > 5 AND name LIKE 'B%'".) - comment(# * :order - specify the order in which the associated objects are returned as a "ORDER BY" sql fragment,) - comment(# such as "last_name, first_name DESC") - comment(# * :group - specify the attribute by which the associated objects are returned as a "GROUP BY" sql fragment,) - comment(# such as "category" ) - comment(# * :foreign_key - specify the foreign key used for the association. By default this is guessed to be the name) - comment(# of this class in lower-case and "_id" suffixed. So a +Person+ class that makes a has_many association will use "person_id") - comment(# as the default foreign_key.) - comment(# * :dependent - if set to :destroy all the associated objects are destroyed) - comment(# alongside this object by calling their destroy method. If set to :delete_all all associated) - comment(# objects are deleted *without* calling their destroy method. If set to :nullify all associated) - comment(# objects' foreign keys are set to NULL *without* calling their save callbacks.) - comment(# NOTE: :dependent => true is deprecated and has been replaced with :dependent => :destroy. ) - comment(# May not be set if :exclusively_dependent is also set.) - comment(# * :exclusively_dependent - Deprecated; equivalent to :dependent => :delete_all. If set to true all) - comment(# the associated object are deleted in one SQL statement without having their) - comment(# before_destroy callback run. This should only be used on associations that depend solely on this class and don't need to do any) - comment(# clean-up in before_destroy. The upside is that it's much faster, especially if there's a counter_cache involved.) - comment(# May not be set if :dependent is also set.) - comment(# * :finder_sql - specify a complete SQL statement to fetch the association. This is a good way to go for complex) - comment(# associations that depend on multiple tables. Note: When this option is used, +find_in_collection+ is _not_ added.) - comment(# * :counter_sql - specify a complete SQL statement to fetch the size of the association. If +:finder_sql+ is) - comment(# specified but +:counter_sql+, +:counter_sql+ will be generated by replacing SELECT ... FROM with SELECT COUNT(*\) FROM.) - comment(# * :extend - specify a named module for extending the proxy, see "Association extensions".) - comment(# * :include - specify second-order associations that should be eager loaded when the collection is loaded.) - comment(# * :group: An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.) - comment(# * :limit: An integer determining the limit on the number of rows that should be returned.) - comment(# * :offset: An integer determining the offset from where the rows should be fetched. So at 5, it would skip the first 4 rows.) - comment(# * :select: By default, this is * as in SELECT * FROM, but can be changed if you for example want to do a join, but not) - comment(# include the joined columns.) - comment(# * :as: Specifies a polymorphic interface (See #belongs_to\).) - comment(# * :through: Specifies a Join Model to perform the query through. Options for :class_name and :foreign_key ) - comment(# are ignored, as the association uses the source reflection. You can only use a :through query through a belongs_to) - comment(# or has_many association.) - comment(# * :source: Specifies the source association name used by has_many :through queries. Only use it if the name cannot be ) - comment(# inferred from the association. has_many :subscribers, :through => :subscriptions will look for either +:subscribers+ or) - comment(# +:subscriber+ on +Subscription+, unless a +:source+ is given.) - comment(#) - comment(# Option examples:) - comment(# has_many :comments, :order => "posted_on") - comment(# has_many :comments, :include => :author) - comment(# has_many :people, :class_name => "Person", :conditions => "deleted = 0", :order => "name") - comment(# has_many :tracks, :order => "position", :dependent => :destroy) - comment(# has_many :comments, :dependent => :nullify) - comment(# has_many :tags, :as => :taggable) - comment(# has_many :subscribers, :through => :subscriptions, :source => :user) - comment(# has_many :subscribers, :class_name => "Person", :finder_sql =>) - comment(# 'SELECT DISTINCT people.* ' +) - comment(# 'FROM people p, post_subscriptions ps ' +) - comment(# 'WHERE ps.post_id = #{id} AND ps.person_id = p.id ' +) - comment(# 'ORDER BY p.first_name') - reserved(def) method(has_many)operator(()ident(association_id)operator(,) ident(options) operator(=) operator({)operator(})operator(,) operator(&)ident(extension)operator(\)) - ident(reflection) operator(=) ident(create_has_many_reflection)operator(()ident(association_id)operator(,) ident(options)operator(,) operator(&)ident(extension)operator(\)) - - ident(configure_dependency_for_has_many)operator(()ident(reflection)operator(\)) - - reserved(if) ident(options)operator([)symbol(:through)operator(]) - ident(collection_reader_method)operator(()ident(reflection)operator(,) constant(HasManyThroughAssociation)operator(\)) - reserved(else) - ident(add_multiple_associated_save_callbacks)operator(()ident(reflection)operator(.)ident(name)operator(\)) - ident(add_association_callbacks)operator(()ident(reflection)operator(.)ident(name)operator(,) ident(reflection)operator(.)ident(options)operator(\)) - ident(collection_accessor_methods)operator(()ident(reflection)operator(,) constant(HasManyAssociation)operator(\)) - reserved(end) - - ident(add_deprecated_api_for_has_many)operator(()ident(reflection)operator(.)ident(name)operator(\)) - reserved(end) - - comment(# Adds the following methods for retrieval and query of a single associated object.) - comment(# +association+ is replaced with the symbol passed as the first argument, so ) - comment(# has_one :manager would add among others manager.nil?.) - comment(# * association(force_reload = false\) - returns the associated object. Nil is returned if none is found.) - comment(# * association=(associate\) - assigns the associate object, extracts the primary key, sets it as the foreign key, ) - comment(# and saves the associate object.) - comment(# * association.nil? - returns true if there is no associated object.) - comment(# * build_association(attributes = {}\) - returns a new object of the associated type that has been instantiated) - comment(# with +attributes+ and linked to this object through a foreign key but has not yet been saved. Note: This ONLY works if) - comment(# an association already exists. It will NOT work if the association is nil.) - comment(# * create_association(attributes = {}\) - returns a new object of the associated type that has been instantiated) - comment(# with +attributes+ and linked to this object through a foreign key and that has already been saved (if it passed the validation\).) - comment(#) - comment(# Example: An Account class declares has_one :beneficiary, which will add:) - comment(# * Account#beneficiary (similar to Beneficiary.find(:first, :conditions => "account_id = #{id}"\)\)) - comment(# * Account#beneficiary=(beneficiary\) (similar to beneficiary.account_id = account.id; beneficiary.save\)) - comment(# * Account#beneficiary.nil?) - comment(# * Account#build_beneficiary (similar to Beneficiary.new("account_id" => id\)\)) - comment(# * Account#create_beneficiary (similar to b = Beneficiary.new("account_id" => id\); b.save; b\)) - comment(#) - comment(# The declaration can also include an options hash to specialize the behavior of the association.) - comment(# ) - comment(# Options are:) - comment(# * :class_name - specify the class name of the association. Use it only if that name can't be inferred) - comment(# from the association name. So has_one :manager will by default be linked to the +Manager+ class, but) - comment(# if the real class name is +Person+, you'll have to specify it with this option.) - comment(# * :conditions - specify the conditions that the associated object must meet in order to be included as a "WHERE") - comment(# sql fragment, such as "rank = 5".) - comment(# * :order - specify the order from which the associated object will be picked at the top. Specified as) - comment(# an "ORDER BY" sql fragment, such as "last_name, first_name DESC") - comment(# * :dependent - if set to :destroy (or true\) all the associated objects are destroyed when this object is. Also,) - comment(# association is assigned.) - comment(# * :foreign_key - specify the foreign key used for the association. By default this is guessed to be the name) - comment(# of this class in lower-case and "_id" suffixed. So a +Person+ class that makes a has_one association will use "person_id") - comment(# as the default foreign_key.) - comment(# * :include - specify second-order associations that should be eager loaded when this object is loaded.) - comment(#) - comment(# Option examples:) - comment(# has_one :credit_card, :dependent => :destroy # destroys the associated credit card) - comment(# has_one :credit_card, :dependent => :nullify # updates the associated records foriegn key value to null rather than destroying it) - comment(# has_one :last_comment, :class_name => "Comment", :order => "posted_on") - comment(# has_one :project_manager, :class_name => "Person", :conditions => "role = 'project_manager'") - reserved(def) method(has_one)operator(()ident(association_id)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(reflection) operator(=) ident(create_has_one_reflection)operator(()ident(association_id)operator(,) ident(options)operator(\)) - - ident(module_eval) reserved(do) - ident(after_save) stringstringcontent("\) - unless association.nil? - association[")inlinecontent("] = id - association.save(true\) - end)delimiter( - EOF)> - reserved(end) - - ident(association_accessor_methods)operator(()ident(reflection)operator(,) constant(HasOneAssociation)operator(\)) - ident(association_constructor_method)operator(()symbol(:build)operator(,) ident(reflection)operator(,) constant(HasOneAssociation)operator(\)) - ident(association_constructor_method)operator(()symbol(:create)operator(,) ident(reflection)operator(,) constant(HasOneAssociation)operator(\)) - - ident(configure_dependency_for_has_one)operator(()ident(reflection)operator(\)) - - comment(# deprecated api) - ident(deprecated_has_association_method)operator(()ident(reflection)operator(.)ident(name)operator(\)) - ident(deprecated_association_comparison_method)operator(()ident(reflection)operator(.)ident(name)operator(,) ident(reflection)operator(.)ident(class_name)operator(\)) - reserved(end) - - comment(# Adds the following methods for retrieval and query for a single associated object that this object holds an id to.) - comment(# +association+ is replaced with the symbol passed as the first argument, so ) - comment(# belongs_to :author would add among others author.nil?.) - comment(# * association(force_reload = false\) - returns the associated object. Nil is returned if none is found.) - comment(# * association=(associate\) - assigns the associate object, extracts the primary key, and sets it as the foreign key.) - comment(# * association.nil? - returns true if there is no associated object.) - comment(# * build_association(attributes = {}\) - returns a new object of the associated type that has been instantiated) - comment(# with +attributes+ and linked to this object through a foreign key but has not yet been saved.) - comment(# * create_association(attributes = {}\) - returns a new object of the associated type that has been instantiated) - comment(# with +attributes+ and linked to this object through a foreign key and that has already been saved (if it passed the validation\).) - comment(#) - comment(# Example: A Post class declares belongs_to :author, which will add:) - comment(# * Post#author (similar to Author.find(author_id\)\)) - comment(# * Post#author=(author\) (similar to post.author_id = author.id\)) - comment(# * Post#author? (similar to post.author == some_author\)) - comment(# * Post#author.nil?) - comment(# * Post#build_author (similar to post.author = Author.new\)) - comment(# * Post#create_author (similar to post.author = Author.new; post.author.save; post.author\)) - comment(# The declaration can also include an options hash to specialize the behavior of the association.) - comment(# ) - comment(# Options are:) - comment(# * :class_name - specify the class name of the association. Use it only if that name can't be inferred) - comment(# from the association name. So has_one :author will by default be linked to the +Author+ class, but) - comment(# if the real class name is +Person+, you'll have to specify it with this option.) - comment(# * :conditions - specify the conditions that the associated object must meet in order to be included as a "WHERE") - comment(# sql fragment, such as "authorized = 1".) - comment(# * :order - specify the order from which the associated object will be picked at the top. Specified as) - comment(# an "ORDER BY" sql fragment, such as "last_name, first_name DESC") - comment(# * :foreign_key - specify the foreign key used for the association. By default this is guessed to be the name) - comment(# of the associated class in lower-case and "_id" suffixed. So a +Person+ class that makes a belongs_to association to a) - comment(# +Boss+ class will use "boss_id" as the default foreign_key.) - comment(# * :counter_cache - caches the number of belonging objects on the associate class through use of increment_counter ) - comment(# and decrement_counter. The counter cache is incremented when an object of this class is created and decremented when it's) - comment(# destroyed. This requires that a column named "#{table_name}_count" (such as comments_count for a belonging Comment class\)) - comment(# is used on the associate class (such as a Post class\). You can also specify a custom counter cache column by given that) - comment(# name instead of a true/false value to this option (e.g., :counter_cache => :my_custom_counter.\)) - comment(# * :include - specify second-order associations that should be eager loaded when this object is loaded.) - comment(# * :polymorphic - specify this association is a polymorphic association by passing true.) - comment(#) - comment(# Option examples:) - comment(# belongs_to :firm, :foreign_key => "client_of") - comment(# belongs_to :author, :class_name => "Person", :foreign_key => "author_id") - comment(# belongs_to :valid_coupon, :class_name => "Coupon", :foreign_key => "coupon_id", ) - comment(# :conditions => 'discounts > #{payments_count}') - comment(# belongs_to :attachable, :polymorphic => true) - reserved(def) method(belongs_to)operator(()ident(association_id)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(reflection) operator(=) ident(create_belongs_to_reflection)operator(()ident(association_id)operator(,) ident(options)operator(\)) - - reserved(if) ident(reflection)operator(.)ident(options)operator([)symbol(:polymorphic)operator(]) - ident(association_accessor_methods)operator(()ident(reflection)operator(,) constant(BelongsToPolymorphicAssociation)operator(\)) - - ident(module_eval) reserved(do) - ident(before_save) stringstringcontent("\) - if !association.nil? - if association.new_record? - association.save(true\) - end - - if association.updated? - self[")inlinecontent("] = association.id - self[")inlinecontent("] = association.class.base_class.name.to_s - end - end)delimiter( - EOF)> - reserved(end) - reserved(else) - ident(association_accessor_methods)operator(()ident(reflection)operator(,) constant(BelongsToAssociation)operator(\)) - ident(association_constructor_method)operator(()symbol(:build)operator(,) ident(reflection)operator(,) constant(BelongsToAssociation)operator(\)) - ident(association_constructor_method)operator(()symbol(:create)operator(,) ident(reflection)operator(,) constant(BelongsToAssociation)operator(\)) - - ident(module_eval) reserved(do) - ident(before_save) stringstringcontent("\) - if !association.nil? - if association.new_record? - association.save(true\) - end - - if association.updated? - self[")inlinecontent("] = association.id - end - end )delimiter( - EOF)> - reserved(end) - - comment(# deprecated api) - ident(deprecated_has_association_method)operator(()ident(reflection)operator(.)ident(name)operator(\)) - ident(deprecated_association_comparison_method)operator(()ident(reflection)operator(.)ident(name)operator(,) ident(reflection)operator(.)ident(class_name)operator(\)) - reserved(end) - - reserved(if) ident(options)operator([)symbol(:counter_cache)operator(]) - ident(cache_column) operator(=) ident(options)operator([)symbol(:counter_cache)operator(]) operator(==) pre_constant(true) operator(?) - stringcontent(_count)delimiter(")> operator(:) - ident(options)operator([)symbol(:counter_cache)operator(]) - - ident(module_eval)operator(() - stringcontent(.class.increment_counter()char(\\")inlinechar(\\")content(, )inlinecontent(\))delimiter(")> operator(+) - stringcontent(.nil?')delimiter(")> - operator(\)) - - ident(module_eval)operator(() - stringcontent(.class.decrement_counter()char(\\")inlinechar(\\")content(, )inlinecontent(\))delimiter(")> operator(+) - stringcontent(.nil?')delimiter(")> - operator(\)) - reserved(end) - reserved(end) - - comment(# Associates two classes via an intermediate join table. Unless the join table is explicitly specified as) - comment(# an option, it is guessed using the lexical order of the class names. So a join between Developer and Project) - comment(# will give the default join table name of "developers_projects" because "D" outranks "P".) - comment(#) - comment(# Deprecated: Any additional fields added to the join table will be placed as attributes when pulling records out through) - comment(# has_and_belongs_to_many associations. Records returned from join tables with additional attributes will be marked as) - comment(# ReadOnly (because we can't save changes to the additional attrbutes\). It's strongly recommended that you upgrade any) - comment(# associations with attributes to a real join model (see introduction\).) - comment(#) - comment(# Adds the following methods for retrieval and query.) - comment(# +collection+ is replaced with the symbol passed as the first argument, so ) - comment(# has_and_belongs_to_many :categories would add among others categories.empty?.) - comment(# * collection(force_reload = false\) - returns an array of all the associated objects.) - comment(# An empty array is returned if none is found.) - comment(# * collection<<(object, ...\) - adds one or more objects to the collection by creating associations in the join table ) - comment(# (collection.push and collection.concat are aliases to this method\).) - comment(# * collection.push_with_attributes(object, join_attributes\) - adds one to the collection by creating an association in the join table that) - comment(# also holds the attributes from join_attributes (should be a hash with the column names as keys\). This can be used to have additional) - comment(# attributes on the join, which will be injected into the associated objects when they are retrieved through the collection.) - comment(# (collection.concat_with_attributes is an alias to this method\). This method is now deprecated.) - comment(# * collection.delete(object, ...\) - removes one or more objects from the collection by removing their associations from the join table. ) - comment(# This does not destroy the objects.) - comment(# * collection=objects - replaces the collections content by deleting and adding objects as appropriate.) - comment(# * collection_singular_ids=ids - replace the collection by the objects identified by the primary keys in +ids+) - comment(# * collection.clear - removes every object from the collection. This does not destroy the objects.) - comment(# * collection.empty? - returns true if there are no associated objects.) - comment(# * collection.size - returns the number of associated objects.) - comment(# * collection.find(id\) - finds an associated object responding to the +id+ and that) - comment(# meets the condition that it has to be associated with this object.) - comment(#) - comment(# Example: An Developer class declares has_and_belongs_to_many :projects, which will add:) - comment(# * Developer#projects) - comment(# * Developer#projects<<) - comment(# * Developer#projects.push_with_attributes) - comment(# * Developer#projects.delete) - comment(# * Developer#projects=) - comment(# * Developer#project_ids=) - comment(# * Developer#projects.clear) - comment(# * Developer#projects.empty?) - comment(# * Developer#projects.size) - comment(# * Developer#projects.find(id\)) - comment(# The declaration may include an options hash to specialize the behavior of the association.) - comment(# ) - comment(# Options are:) - comment(# * :class_name - specify the class name of the association. Use it only if that name can't be inferred) - comment(# from the association name. So has_and_belongs_to_many :projects will by default be linked to the ) - comment(# +Project+ class, but if the real class name is +SuperProject+, you'll have to specify it with this option.) - comment(# * :join_table - specify the name of the join table if the default based on lexical order isn't what you want.) - comment(# WARNING: If you're overwriting the table name of either class, the table_name method MUST be declared underneath any) - comment(# has_and_belongs_to_many declaration in order to work.) - comment(# * :foreign_key - specify the foreign key used for the association. By default this is guessed to be the name) - comment(# of this class in lower-case and "_id" suffixed. So a +Person+ class that makes a has_and_belongs_to_many association) - comment(# will use "person_id" as the default foreign_key.) - comment(# * :association_foreign_key - specify the association foreign key used for the association. By default this is) - comment(# guessed to be the name of the associated class in lower-case and "_id" suffixed. So if the associated class is +Project+,) - comment(# the has_and_belongs_to_many association will use "project_id" as the default association foreign_key.) - comment(# * :conditions - specify the conditions that the associated object must meet in order to be included as a "WHERE") - comment(# sql fragment, such as "authorized = 1".) - comment(# * :order - specify the order in which the associated objects are returned as a "ORDER BY" sql fragment, such as "last_name, first_name DESC") - comment(# * :uniq - if set to true, duplicate associated objects will be ignored by accessors and query methods) - comment(# * :finder_sql - overwrite the default generated SQL used to fetch the association with a manual one) - comment(# * :delete_sql - overwrite the default generated SQL used to remove links between the associated ) - comment(# classes with a manual one) - comment(# * :insert_sql - overwrite the default generated SQL used to add links between the associated classes) - comment(# with a manual one) - comment(# * :extend - anonymous module for extending the proxy, see "Association extensions".) - comment(# * :include - specify second-order associations that should be eager loaded when the collection is loaded.) - comment(# * :group: An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.) - comment(# * :limit: An integer determining the limit on the number of rows that should be returned.) - comment(# * :offset: An integer determining the offset from where the rows should be fetched. So at 5, it would skip the first 4 rows.) - comment(# * :select: By default, this is * as in SELECT * FROM, but can be changed if you for example want to do a join, but not) - comment(# include the joined columns.) - comment(#) - comment(# Option examples:) - comment(# has_and_belongs_to_many :projects) - comment(# has_and_belongs_to_many :projects, :include => [ :milestones, :manager ]) - comment(# has_and_belongs_to_many :nations, :class_name => "Country") - comment(# has_and_belongs_to_many :categories, :join_table => "prods_cats") - comment(# has_and_belongs_to_many :active_projects, :join_table => 'developers_projects', :delete_sql => ) - comment(# 'DELETE FROM developers_projects WHERE active=1 AND developer_id = #{id} AND project_id = #{record.id}') - reserved(def) method(has_and_belongs_to_many)operator(()ident(association_id)operator(,) ident(options) operator(=) operator({)operator(})operator(,) operator(&)ident(extension)operator(\)) - ident(reflection) operator(=) ident(create_has_and_belongs_to_many_reflection)operator(()ident(association_id)operator(,) ident(options)operator(,) operator(&)ident(extension)operator(\)) - - ident(add_multiple_associated_save_callbacks)operator(()ident(reflection)operator(.)ident(name)operator(\)) - ident(collection_accessor_methods)operator(()ident(reflection)operator(,) constant(HasAndBelongsToManyAssociation)operator(\)) - - comment(# Don't use a before_destroy callback since users' before_destroy) - comment(# callbacks will be executed after the association is wiped out.) - ident(old_method) operator(=) stringdelimiter(")> - ident(class_eval) stringstringcontent(, :destroy_without_callbacks - def destroy_without_callbacks - )inlinecontent(.clear - )inlinecontent( - end)delimiter( - end_eval)> - - ident(add_association_callbacks)operator(()ident(reflection)operator(.)ident(name)operator(,) ident(options)operator(\)) - - comment(# deprecated api) - ident(deprecated_collection_count_method)operator(()ident(reflection)operator(.)ident(name)operator(\)) - ident(deprecated_add_association_relation)operator(()ident(reflection)operator(.)ident(name)operator(\)) - ident(deprecated_remove_association_relation)operator(()ident(reflection)operator(.)ident(name)operator(\)) - ident(deprecated_has_collection_method)operator(()ident(reflection)operator(.)ident(name)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(join_table_name)operator(()ident(first_table_name)operator(,) ident(second_table_name)operator(\)) - reserved(if) ident(first_table_name) operator(<) ident(second_table_name) - ident(join_table) operator(=) stringcontent(_)inlinedelimiter(")> - reserved(else) - ident(join_table) operator(=) stringcontent(_)inlinedelimiter(")> - reserved(end) - - ident(table_name_prefix) operator(+) ident(join_table) operator(+) ident(table_name_suffix) - reserved(end) - - reserved(def) method(association_accessor_methods)operator(()ident(reflection)operator(,) ident(association_proxy_class)operator(\)) - ident(define_method)operator(()ident(reflection)operator(.)ident(name)operator(\)) reserved(do) operator(|*)ident(params)operator(|) - ident(force_reload) operator(=) ident(params)operator(.)ident(first) reserved(unless) ident(params)operator(.)ident(empty?) - ident(association) operator(=) ident(instance_variable_get)operator(()stringdelimiter(")>operator(\)) - - reserved(if) ident(association)operator(.)ident(nil?) operator(||) ident(force_reload) - ident(association) operator(=) ident(association_proxy_class)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(reflection)operator(\)) - ident(retval) operator(=) ident(association)operator(.)ident(reload) - reserved(unless) ident(retval)operator(.)ident(nil?) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) ident(association)operator(\)) - reserved(else) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) pre_constant(nil)operator(\)) - reserved(return) pre_constant(nil) - reserved(end) - reserved(end) - ident(association) - reserved(end) - - ident(define_method)operator(()stringcontent(=)delimiter(")>operator(\)) reserved(do) operator(|)ident(new_value)operator(|) - ident(association) operator(=) ident(instance_variable_get)operator(()stringdelimiter(")>operator(\)) - reserved(if) ident(association)operator(.)ident(nil?) - ident(association) operator(=) ident(association_proxy_class)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(reflection)operator(\)) - reserved(end) - - ident(association)operator(.)ident(replace)operator(()ident(new_value)operator(\)) - - reserved(unless) ident(new_value)operator(.)ident(nil?) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) ident(association)operator(\)) - reserved(else) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) pre_constant(nil)operator(\)) - reserved(return) pre_constant(nil) - reserved(end) - - ident(association) - reserved(end) - - ident(define_method)operator(()stringcontent(_target)delimiter(")>operator(\)) reserved(do) operator(|)ident(target)operator(|) - reserved(return) reserved(if) ident(target)operator(.)ident(nil?) - ident(association) operator(=) ident(association_proxy_class)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(reflection)operator(\)) - ident(association)operator(.)ident(target) operator(=) ident(target) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) ident(association)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(collection_reader_method)operator(()ident(reflection)operator(,) ident(association_proxy_class)operator(\)) - ident(define_method)operator(()ident(reflection)operator(.)ident(name)operator(\)) reserved(do) operator(|*)ident(params)operator(|) - ident(force_reload) operator(=) ident(params)operator(.)ident(first) reserved(unless) ident(params)operator(.)ident(empty?) - ident(association) operator(=) ident(instance_variable_get)operator(()stringdelimiter(")>operator(\)) - - reserved(unless) ident(association)operator(.)ident(respond_to?)operator(()symbol(:loaded?)operator(\)) - ident(association) operator(=) ident(association_proxy_class)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(reflection)operator(\)) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) ident(association)operator(\)) - reserved(end) - - ident(association)operator(.)ident(reload) reserved(if) ident(force_reload) - - ident(association) - reserved(end) - reserved(end) - - reserved(def) method(collection_accessor_methods)operator(()ident(reflection)operator(,) ident(association_proxy_class)operator(\)) - ident(collection_reader_method)operator(()ident(reflection)operator(,) ident(association_proxy_class)operator(\)) - - ident(define_method)operator(()stringcontent(=)delimiter(")>operator(\)) reserved(do) operator(|)ident(new_value)operator(|) - ident(association) operator(=) ident(instance_variable_get)operator(()stringdelimiter(")>operator(\)) - reserved(unless) ident(association)operator(.)ident(respond_to?)operator(()symbol(:loaded?)operator(\)) - ident(association) operator(=) ident(association_proxy_class)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(reflection)operator(\)) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) ident(association)operator(\)) - reserved(end) - ident(association)operator(.)ident(replace)operator(()ident(new_value)operator(\)) - ident(association) - reserved(end) - - ident(define_method)operator(()stringcontent(_ids=)delimiter(")>operator(\)) reserved(do) operator(|)ident(new_value)operator(|) - ident(send)operator(()stringcontent(=)delimiter(")>operator(,) ident(reflection)operator(.)ident(class_name)operator(.)ident(constantize)operator(.)ident(find)operator(()ident(new_value)operator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(require_association_class)operator(()ident(class_name)operator(\)) - ident(require_association)operator(()constant(Inflector)operator(.)ident(underscore)operator(()ident(class_name)operator(\))operator(\)) reserved(if) ident(class_name) - reserved(end) - - reserved(def) method(add_multiple_associated_save_callbacks)operator(()ident(association_name)operator(\)) - ident(method_name) operator(=) stringdelimiter(")>operator(.)ident(to_sym) - ident(define_method)operator(()ident(method_name)operator(\)) reserved(do) - ident(association) operator(=) ident(instance_variable_get)operator(()stringdelimiter(")>operator(\)) - reserved(if) ident(association)operator(.)ident(respond_to?)operator(()symbol(:loaded?)operator(\)) - reserved(if) ident(new_record?) - ident(association) - reserved(else) - ident(association)operator(.)ident(select) operator({) operator(|)ident(record)operator(|) ident(record)operator(.)ident(new_record?) operator(}) - reserved(end)operator(.)ident(each) reserved(do) operator(|)ident(record)operator(|) - ident(errors)operator(.)ident(add) stringdelimiter(")> reserved(unless) ident(record)operator(.)ident(valid?) - reserved(end) - reserved(end) - reserved(end) - - ident(validate) ident(method_name) - ident(before_save)operator(()stringoperator(\)) - - ident(after_callback) operator(=) stringstringcontent("\) - - if association.respond_to?(:loaded?\) - if @new_record_before_save - records_to_save = association - else - records_to_save = association.select { |record| record.new_record? } - end - records_to_save.each { |record| association.send(:insert_record, record\) } - association.send(:construct_sql\) # reconstruct the SQL queries now that we know the owner's id - end)delimiter( - end_eval)> - - comment(# Doesn't use after_save as that would save associations added in after_create/after_update twice) - ident(after_create)operator(()ident(after_callback)operator(\)) - ident(after_update)operator(()ident(after_callback)operator(\)) - reserved(end) - - reserved(def) method(association_constructor_method)operator(()ident(constructor)operator(,) ident(reflection)operator(,) ident(association_proxy_class)operator(\)) - ident(define_method)operator(()stringcontent(_)inlinedelimiter(")>operator(\)) reserved(do) operator(|*)ident(params)operator(|) - ident(attributees) operator(=) ident(params)operator(.)ident(first) reserved(unless) ident(params)operator(.)ident(empty?) - ident(replace_existing) operator(=) ident(params)operator([)integer(1)operator(])operator(.)ident(nil?) operator(?) pre_constant(true) operator(:) ident(params)operator([)integer(1)operator(]) - ident(association) operator(=) ident(instance_variable_get)operator(()stringdelimiter(")>operator(\)) - - reserved(if) ident(association)operator(.)ident(nil?) - ident(association) operator(=) ident(association_proxy_class)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(reflection)operator(\)) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) ident(association)operator(\)) - reserved(end) - - reserved(if) ident(association_proxy_class) operator(==) constant(HasOneAssociation) - ident(association)operator(.)ident(send)operator(()ident(constructor)operator(,) ident(attributees)operator(,) ident(replace_existing)operator(\)) - reserved(else) - ident(association)operator(.)ident(send)operator(()ident(constructor)operator(,) ident(attributees)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(count_with_associations)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(catch) symbol(:invalid_query) reserved(do) - ident(join_dependency) operator(=) constant(JoinDependency)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(merge_includes)operator(()ident(scope)operator(()symbol(:find)operator(,) symbol(:include)operator(\))operator(,) ident(options)operator([)symbol(:include)operator(])operator(\))operator(,) ident(options)operator([)symbol(:joins)operator(])operator(\)) - reserved(return) ident(count_by_sql)operator(()ident(construct_counter_sql_with_included_associations)operator(()ident(options)operator(,) ident(join_dependency)operator(\))operator(\)) - reserved(end) - integer(0) - reserved(end) - - reserved(def) method(find_with_associations)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(catch) symbol(:invalid_query) reserved(do) - ident(join_dependency) operator(=) constant(JoinDependency)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(merge_includes)operator(()ident(scope)operator(()symbol(:find)operator(,) symbol(:include)operator(\))operator(,) ident(options)operator([)symbol(:include)operator(])operator(\))operator(,) ident(options)operator([)symbol(:joins)operator(])operator(\)) - ident(rows) operator(=) ident(select_all_rows)operator(()ident(options)operator(,) ident(join_dependency)operator(\)) - reserved(return) ident(join_dependency)operator(.)ident(instantiate)operator(()ident(rows)operator(\)) - reserved(end) - operator([)operator(]) - reserved(end) - - reserved(def) method(configure_dependency_for_has_many)operator(()ident(reflection)operator(\)) - reserved(if) ident(reflection)operator(.)ident(options)operator([)symbol(:dependent)operator(]) operator(&&) ident(reflection)operator(.)ident(options)operator([)symbol(:exclusively_dependent)operator(]) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - reserved(if) ident(reflection)operator(.)ident(options)operator([)symbol(:exclusively_dependent)operator(]) - ident(reflection)operator(.)ident(options)operator([)symbol(:dependent)operator(]) operator(=) symbol(:delete_all) - comment(#warn "The :exclusively_dependent option is deprecated. Please use :dependent => :delete_all instead."\)) - reserved(end) - - comment(# See HasManyAssociation#delete_records. Dependent associations) - comment(# delete children, otherwise foreign key is set to NULL.) - - comment(# Add polymorphic type if the :as option is present) - ident(dependent_conditions) operator(=) stringcontent( = )char(\\#)content({record.quoted_id})delimiter(\))> - reserved(if) ident(reflection)operator(.)ident(options)operator([)symbol(:as)operator(]) - ident(dependent_conditions) operator(+=) stringcontent(_type = ')inlinecontent(')delimiter(")> - reserved(end) - - reserved(case) ident(reflection)operator(.)ident(options)operator([)symbol(:dependent)operator(]) - reserved(when) symbol(:destroy)operator(,) pre_constant(true) - ident(module_eval) stringcontent(.each { |o| o.destroy }')delimiter(")> - reserved(when) symbol(:delete_all) - ident(module_eval) stringcontent(.delete_all(%()inlinecontent(\)\) })delimiter(")> - reserved(when) symbol(:nullify) - ident(module_eval) stringcontent(.update_all(%()inlinecontent( = NULL\), %()inlinecontent(\)\) })delimiter(")> - reserved(when) pre_constant(nil)operator(,) pre_constant(false) - comment(# pass) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - reserved(end) - - reserved(def) method(configure_dependency_for_has_one)operator(()ident(reflection)operator(\)) - reserved(case) ident(reflection)operator(.)ident(options)operator([)symbol(:dependent)operator(]) - reserved(when) symbol(:destroy)operator(,) pre_constant(true) - ident(module_eval) stringcontent(.destroy unless )inlinecontent(.nil?')delimiter(")> - reserved(when) symbol(:nullify) - ident(module_eval) stringcontent(.update_attribute()char(\\")inlinechar(\\")content(, nil\)')delimiter(")> - reserved(when) pre_constant(nil)operator(,) pre_constant(false) - comment(# pass) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - reserved(end) - - - reserved(def) method(add_deprecated_api_for_has_many)operator(()ident(association_name)operator(\)) - ident(deprecated_collection_count_method)operator(()ident(association_name)operator(\)) - ident(deprecated_add_association_relation)operator(()ident(association_name)operator(\)) - ident(deprecated_remove_association_relation)operator(()ident(association_name)operator(\)) - ident(deprecated_has_collection_method)operator(()ident(association_name)operator(\)) - ident(deprecated_find_in_collection_method)operator(()ident(association_name)operator(\)) - ident(deprecated_find_all_in_collection_method)operator(()ident(association_name)operator(\)) - ident(deprecated_collection_create_method)operator(()ident(association_name)operator(\)) - ident(deprecated_collection_build_method)operator(()ident(association_name)operator(\)) - reserved(end) - - reserved(def) method(create_has_many_reflection)operator(()ident(association_id)operator(,) ident(options)operator(,) operator(&)ident(extension)operator(\)) - ident(options)operator(.)ident(assert_valid_keys)operator(() - symbol(:class_name)operator(,) symbol(:table_name)operator(,) symbol(:foreign_key)operator(,) - symbol(:exclusively_dependent)operator(,) symbol(:dependent)operator(,) - symbol(:select)operator(,) symbol(:conditions)operator(,) symbol(:include)operator(,) symbol(:order)operator(,) symbol(:group)operator(,) symbol(:limit)operator(,) symbol(:offset)operator(,) - symbol(:as)operator(,) symbol(:through)operator(,) symbol(:source)operator(,) - symbol(:finder_sql)operator(,) symbol(:counter_sql)operator(,) - symbol(:before_add)operator(,) symbol(:after_add)operator(,) symbol(:before_remove)operator(,) symbol(:after_remove)operator(,) - symbol(:extend) - operator(\)) - - ident(options)operator([)symbol(:extend)operator(]) operator(=) ident(create_extension_module)operator(()ident(association_id)operator(,) ident(extension)operator(\)) reserved(if) ident(block_given?) - - ident(create_reflection)operator(()symbol(:has_many)operator(,) ident(association_id)operator(,) ident(options)operator(,) pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(create_has_one_reflection)operator(()ident(association_id)operator(,) ident(options)operator(\)) - ident(options)operator(.)ident(assert_valid_keys)operator(() - symbol(:class_name)operator(,) symbol(:foreign_key)operator(,) symbol(:remote)operator(,) symbol(:conditions)operator(,) symbol(:order)operator(,) symbol(:include)operator(,) symbol(:dependent)operator(,) symbol(:counter_cache)operator(,) symbol(:extend)operator(,) symbol(:as) - operator(\)) - - ident(create_reflection)operator(()symbol(:has_one)operator(,) ident(association_id)operator(,) ident(options)operator(,) pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(create_belongs_to_reflection)operator(()ident(association_id)operator(,) ident(options)operator(\)) - ident(options)operator(.)ident(assert_valid_keys)operator(() - symbol(:class_name)operator(,) symbol(:foreign_key)operator(,) symbol(:foreign_type)operator(,) symbol(:remote)operator(,) symbol(:conditions)operator(,) symbol(:order)operator(,) symbol(:include)operator(,) symbol(:dependent)operator(,) - symbol(:counter_cache)operator(,) symbol(:extend)operator(,) symbol(:polymorphic) - operator(\)) - - ident(reflection) operator(=) ident(create_reflection)operator(()symbol(:belongs_to)operator(,) ident(association_id)operator(,) ident(options)operator(,) pre_constant(self)operator(\)) - - reserved(if) ident(options)operator([)symbol(:polymorphic)operator(]) - ident(reflection)operator(.)ident(options)operator([)symbol(:foreign_type)operator(]) operator(||=) ident(reflection)operator(.)ident(class_name)operator(.)ident(underscore) operator(+) string - reserved(end) - - ident(reflection) - reserved(end) - - reserved(def) method(create_has_and_belongs_to_many_reflection)operator(()ident(association_id)operator(,) ident(options)operator(,) operator(&)ident(extension)operator(\)) - ident(options)operator(.)ident(assert_valid_keys)operator(() - symbol(:class_name)operator(,) symbol(:table_name)operator(,) symbol(:join_table)operator(,) symbol(:foreign_key)operator(,) symbol(:association_foreign_key)operator(,) - symbol(:select)operator(,) symbol(:conditions)operator(,) symbol(:include)operator(,) symbol(:order)operator(,) symbol(:group)operator(,) symbol(:limit)operator(,) symbol(:offset)operator(,) - symbol(:finder_sql)operator(,) symbol(:delete_sql)operator(,) symbol(:insert_sql)operator(,) symbol(:uniq)operator(,) - symbol(:before_add)operator(,) symbol(:after_add)operator(,) symbol(:before_remove)operator(,) symbol(:after_remove)operator(,) - symbol(:extend) - operator(\)) - - ident(options)operator([)symbol(:extend)operator(]) operator(=) ident(create_extension_module)operator(()ident(association_id)operator(,) ident(extension)operator(\)) reserved(if) ident(block_given?) - - ident(reflection) operator(=) ident(create_reflection)operator(()symbol(:has_and_belongs_to_many)operator(,) ident(association_id)operator(,) ident(options)operator(,) pre_constant(self)operator(\)) - - ident(reflection)operator(.)ident(options)operator([)symbol(:join_table)operator(]) operator(||=) ident(join_table_name)operator(()ident(undecorated_table_name)operator(()pre_constant(self)operator(.)ident(to_s)operator(\))operator(,) ident(undecorated_table_name)operator(()ident(reflection)operator(.)ident(class_name)operator(\))operator(\)) - - ident(reflection) - reserved(end) - - reserved(def) method(reflect_on_included_associations)operator(()ident(associations)operator(\)) - operator([) ident(associations) operator(])operator(.)ident(flatten)operator(.)ident(collect) operator({) operator(|)ident(association)operator(|) ident(reflect_on_association)operator(()ident(association)operator(.)ident(to_s)operator(.)ident(intern)operator(\)) operator(}) - reserved(end) - - reserved(def) method(guard_against_unlimitable_reflections)operator(()ident(reflections)operator(,) ident(options)operator(\)) - reserved(if) operator(()ident(options)operator([)symbol(:offset)operator(]) operator(||) ident(options)operator([)symbol(:limit)operator(])operator(\)) operator(&&) operator(!)ident(using_limitable_reflections?)operator(()ident(reflections)operator(\)) - ident(raise)operator(() - constant(ConfigurationError)operator(,) - string - operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(select_all_rows)operator(()ident(options)operator(,) ident(join_dependency)operator(\)) - ident(connection)operator(.)ident(select_all)operator(() - ident(construct_finder_sql_with_included_associations)operator(()ident(options)operator(,) ident(join_dependency)operator(\))operator(,) - stringcontent( Load Including Associations)delimiter(")> - operator(\)) - reserved(end) - - reserved(def) method(construct_counter_sql_with_included_associations)operator(()ident(options)operator(,) ident(join_dependency)operator(\)) - ident(scope) operator(=) ident(scope)operator(()symbol(:find)operator(\)) - ident(sql) operator(=) stringcontent(.)inlinecontent(\))delimiter(")> - - comment(# A (slower\) workaround if we're using a backend, like sqlite, that doesn't support COUNT DISTINCT.) - reserved(if) operator(!)constant(Base)operator(.)ident(connection)operator(.)ident(supports_count_distinct?) - ident(sql) operator(=) stringcontent(.)inlinedelimiter(")> - reserved(end) - - ident(sql) operator(<<) stringcontent( )delimiter(")> - ident(sql) operator(<<) ident(join_dependency)operator(.)ident(join_associations)operator(.)ident(collect)operator({)operator(|)ident(join)operator(|) ident(join)operator(.)ident(association_join) operator(})operator(.)ident(join) - - ident(add_joins!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(scope)operator(\)) - ident(add_conditions!)operator(()ident(sql)operator(,) ident(options)operator([)symbol(:conditions)operator(])operator(,) ident(scope)operator(\)) - ident(add_limited_ids_condition!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(join_dependency)operator(\)) reserved(if) operator(!)ident(using_limitable_reflections?)operator(()ident(join_dependency)operator(.)ident(reflections)operator(\)) operator(&&) operator(()operator(()ident(scope) operator(&&) ident(scope)operator([)symbol(:limit)operator(])operator(\)) operator(||) ident(options)operator([)symbol(:limit)operator(])operator(\)) - - ident(add_limit!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(scope)operator(\)) reserved(if) ident(using_limitable_reflections?)operator(()ident(join_dependency)operator(.)ident(reflections)operator(\)) - - reserved(if) operator(!)constant(Base)operator(.)ident(connection)operator(.)ident(supports_count_distinct?) - ident(sql) operator(<<) string - reserved(end) - - reserved(return) ident(sanitize_sql)operator(()ident(sql)operator(\)) - reserved(end) - - reserved(def) method(construct_finder_sql_with_included_associations)operator(()ident(options)operator(,) ident(join_dependency)operator(\)) - ident(scope) operator(=) ident(scope)operator(()symbol(:find)operator(\)) - ident(sql) operator(=) stringcontent( FROM )inlinecontent( )delimiter(")> - ident(sql) operator(<<) ident(join_dependency)operator(.)ident(join_associations)operator(.)ident(collect)operator({)operator(|)ident(join)operator(|) ident(join)operator(.)ident(association_join) operator(})operator(.)ident(join) - - ident(add_joins!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(scope)operator(\)) - ident(add_conditions!)operator(()ident(sql)operator(,) ident(options)operator([)symbol(:conditions)operator(])operator(,) ident(scope)operator(\)) - ident(add_limited_ids_condition!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(join_dependency)operator(\)) reserved(if) operator(!)ident(using_limitable_reflections?)operator(()ident(join_dependency)operator(.)ident(reflections)operator(\)) operator(&&) ident(options)operator([)symbol(:limit)operator(]) - - ident(sql) operator(<<) stringcontent( )delimiter(")> reserved(if) ident(options)operator([)symbol(:order)operator(]) - - ident(add_limit!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(scope)operator(\)) reserved(if) ident(using_limitable_reflections?)operator(()ident(join_dependency)operator(.)ident(reflections)operator(\)) - - reserved(return) ident(sanitize_sql)operator(()ident(sql)operator(\)) - reserved(end) - - reserved(def) method(add_limited_ids_condition!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(join_dependency)operator(\)) - reserved(unless) operator(()ident(id_list) operator(=) ident(select_limited_ids_list)operator(()ident(options)operator(,) ident(join_dependency)operator(\))operator(\))operator(.)ident(empty?) - ident(sql) operator(<<) stringcontent( )inlinecontent(.)inlinecontent( IN ()inlinecontent(\) )delimiter(")> - reserved(else) - ident(throw) symbol(:invalid_query) - reserved(end) - reserved(end) - - reserved(def) method(select_limited_ids_list)operator(()ident(options)operator(,) ident(join_dependency)operator(\)) - ident(connection)operator(.)ident(select_all)operator(() - ident(construct_finder_sql_for_association_limiting)operator(()ident(options)operator(,) ident(join_dependency)operator(\))operator(,) - stringcontent( Load IDs For Limited Eager Loading)delimiter(")> - operator(\))operator(.)ident(collect) operator({) operator(|)ident(row)operator(|) ident(connection)operator(.)ident(quote)operator(()ident(row)operator([)ident(primary_key)operator(])operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(construct_finder_sql_for_association_limiting)operator(()ident(options)operator(,) ident(join_dependency)operator(\)) - ident(scope) operator(=) ident(scope)operator(()symbol(:find)operator(\)) - ident(sql) operator(=) string - ident(sql) operator(<<) stringcontent(.)delimiter(")> reserved(if) ident(include_eager_conditions?)operator(()ident(options)operator(\)) operator(||) ident(include_eager_order?)operator(()ident(options)operator(\)) - ident(sql) operator(<<) ident(primary_key) - ident(sql) operator(<<) stringoperator(\))operator(.)ident(collect) operator({) operator(|)ident(s)operator(|) ident(s)operator(.)ident(split)operator(.)ident(first) operator(}) operator(*) stringinline_delimiter(})>delimiter(")> reserved(if) ident(options)operator([)symbol(:order)operator(]) operator(&&) operator(()ident(include_eager_conditions?)operator(()ident(options)operator(\)) operator(||) ident(include_eager_order?)operator(()ident(options)operator(\))operator(\)) - ident(sql) operator(<<) stringcontent( )delimiter(")> - - reserved(if) ident(include_eager_conditions?)operator(()ident(options)operator(\)) operator(||) ident(include_eager_order?)operator(()ident(options)operator(\)) - ident(sql) operator(<<) ident(join_dependency)operator(.)ident(join_associations)operator(.)ident(collect)operator({)operator(|)ident(join)operator(|) ident(join)operator(.)ident(association_join) operator(})operator(.)ident(join) - ident(add_joins!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(scope)operator(\)) - reserved(end) - - ident(add_conditions!)operator(()ident(sql)operator(,) ident(options)operator([)symbol(:conditions)operator(])operator(,) ident(scope)operator(\)) - ident(sql) operator(<<) stringcontent( )delimiter(")> reserved(if) ident(options)operator([)symbol(:order)operator(]) - ident(add_limit!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(scope)operator(\)) - reserved(return) ident(sanitize_sql)operator(()ident(sql)operator(\)) - reserved(end) - - comment(# Checks if the conditions reference a table other than the current model table) - reserved(def) method(include_eager_conditions?)operator(()ident(options)operator(\)) - comment(# look in both sets of conditions) - ident(conditions) operator(=) operator([)ident(scope)operator(()symbol(:find)operator(,) symbol(:conditions)operator(\))operator(,) ident(options)operator([)symbol(:conditions)operator(])operator(])operator(.)ident(inject)operator(()operator([)operator(])operator(\)) reserved(do) operator(|)ident(all)operator(,) ident(cond)operator(|) - reserved(case) ident(cond) - reserved(when) pre_constant(nil) reserved(then) ident(all) - reserved(when) constant(Array) reserved(then) ident(all) operator(<<) ident(cond)operator(.)ident(first) - reserved(else) ident(all) operator(<<) ident(cond) - reserved(end) - reserved(end) - reserved(return) pre_constant(false) reserved(unless) ident(conditions)operator(.)ident(any?) - ident(conditions)operator(.)ident(join)operator(()stringoperator(\))operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(flatten)operator(.)ident(any?) reserved(do) operator(|)ident(condition_table_name)operator(|) - ident(condition_table_name) operator(!=) ident(table_name) - reserved(end) - reserved(end) - - comment(# Checks if the query order references a table other than the current model's table.) - reserved(def) method(include_eager_order?)operator(()ident(options)operator(\)) - ident(order) operator(=) ident(options)operator([)symbol(:order)operator(]) - reserved(return) pre_constant(false) reserved(unless) ident(order) - ident(order)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(flatten)operator(.)ident(any?) reserved(do) operator(|)ident(order_table_name)operator(|) - ident(order_table_name) operator(!=) ident(table_name) - reserved(end) - reserved(end) - - reserved(def) method(using_limitable_reflections?)operator(()ident(reflections)operator(\)) - ident(reflections)operator(.)ident(reject) operator({) operator(|)ident(r)operator(|) operator([) symbol(:belongs_to)operator(,) symbol(:has_one) operator(])operator(.)ident(include?)operator(()ident(r)operator(.)ident(macro)operator(\)) operator(})operator(.)ident(length)operator(.)ident(zero?) - reserved(end) - - reserved(def) method(column_aliases)operator(()ident(join_dependency)operator(\)) - ident(join_dependency)operator(.)ident(joins)operator(.)ident(collect)operator({)operator(|)ident(join)operator(|) ident(join)operator(.)ident(column_names_with_alias)operator(.)ident(collect)operator({)operator(|)ident(column_name)operator(,) ident(aliased_name)operator(|) - stringcontent(.)inlinecontent( AS )inlinedelimiter(")>operator(})operator(})operator(.)ident(flatten)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(add_association_callbacks)operator(()ident(association_name)operator(,) ident(options)operator(\)) - ident(callbacks) operator(=) string - ident(callbacks)operator(.)ident(each) reserved(do) operator(|)ident(callback_name)operator(|) - ident(full_callback_name) operator(=) stringcontent(_for_)inlinedelimiter(")> - ident(defined_callbacks) operator(=) ident(options)operator([)ident(callback_name)operator(.)ident(to_sym)operator(]) - reserved(if) ident(options)operator(.)ident(has_key?)operator(()ident(callback_name)operator(.)ident(to_sym)operator(\)) - ident(class_inheritable_reader) ident(full_callback_name)operator(.)ident(to_sym) - ident(write_inheritable_array)operator(()ident(full_callback_name)operator(.)ident(to_sym)operator(,) operator([)ident(defined_callbacks)operator(])operator(.)ident(flatten)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(condition_word)operator(()ident(sql)operator(\)) - ident(sql) operator(=)operator(~) regexp operator(?) string operator(:) string - reserved(end) - - reserved(def) method(create_extension_module)operator(()ident(association_id)operator(,) ident(extension)operator(\)) - ident(extension_module_name) operator(=) stringinlinecontent(AssociationExtension)delimiter(")> - - ident(silence_warnings) reserved(do) - constant(Object)operator(.)ident(const_set)operator(()ident(extension_module_name)operator(,) constant(Module)operator(.)ident(new)operator(()operator(&)ident(extension)operator(\))operator(\)) - reserved(end) - - ident(extension_module_name)operator(.)ident(constantize) - reserved(end) - - reserved(class) class(JoinDependency) - ident(attr_reader) symbol(:joins)operator(,) symbol(:reflections)operator(,) symbol(:table_aliases) - - reserved(def) method(initialize)operator(()ident(base)operator(,) ident(associations)operator(,) ident(joins)operator(\)) - instance_variable(@joins) operator(=) operator([)constant(JoinBase)operator(.)ident(new)operator(()ident(base)operator(,) ident(joins)operator(\))operator(]) - instance_variable(@associations) operator(=) ident(associations) - instance_variable(@reflections) operator(=) operator([)operator(]) - instance_variable(@base_records_hash) operator(=) operator({)operator(}) - instance_variable(@base_records_in_order) operator(=) operator([)operator(]) - instance_variable(@table_aliases) operator(=) constant(Hash)operator(.)ident(new) operator({) operator(|)ident(aliases)operator(,) ident(table)operator(|) ident(aliases)operator([)ident(table)operator(]) operator(=) integer(0) operator(}) - instance_variable(@table_aliases)operator([)ident(base)operator(.)ident(table_name)operator(]) operator(=) integer(1) - ident(build)operator(()ident(associations)operator(\)) - reserved(end) - - reserved(def) method(join_associations) - instance_variable(@joins)operator([)integer(1)operator(..)integer(-1)operator(])operator(.)ident(to_a) - reserved(end) - - reserved(def) method(join_base) - instance_variable(@joins)operator([)integer(0)operator(]) - reserved(end) - - reserved(def) method(instantiate)operator(()ident(rows)operator(\)) - ident(rows)operator(.)ident(each_with_index) reserved(do) operator(|)ident(row)operator(,) ident(i)operator(|) - ident(primary_id) operator(=) ident(join_base)operator(.)ident(record_id)operator(()ident(row)operator(\)) - reserved(unless) instance_variable(@base_records_hash)operator([)ident(primary_id)operator(]) - instance_variable(@base_records_in_order) operator(<<) operator(()instance_variable(@base_records_hash)operator([)ident(primary_id)operator(]) operator(=) ident(join_base)operator(.)ident(instantiate)operator(()ident(row)operator(\))operator(\)) - reserved(end) - ident(construct)operator(()instance_variable(@base_records_hash)operator([)ident(primary_id)operator(])operator(,) instance_variable(@associations)operator(,) ident(join_associations)operator(.)ident(dup)operator(,) ident(row)operator(\)) - reserved(end) - reserved(return) instance_variable(@base_records_in_order) - reserved(end) - - reserved(def) method(aliased_table_names_for)operator(()ident(table_name)operator(\)) - ident(joins)operator(.)ident(select)operator({)operator(|)ident(join)operator(|) ident(join)operator(.)ident(table_name) operator(==) ident(table_name) operator(})operator(.)ident(collect)operator({)operator(|)ident(join)operator(|) ident(join)operator(.)ident(aliased_table_name)operator(}) - reserved(end) - - ident(protected) - reserved(def) method(build)operator(()ident(associations)operator(,) ident(parent) operator(=) pre_constant(nil)operator(\)) - ident(parent) operator(||=) instance_variable(@joins)operator(.)ident(last) - reserved(case) ident(associations) - reserved(when) constant(Symbol)operator(,) constant(String) - ident(reflection) operator(=) ident(parent)operator(.)ident(reflections)operator([)ident(associations)operator(.)ident(to_s)operator(.)ident(intern)operator(]) reserved(or) - ident(raise) constant(ConfigurationError)operator(,) stringcontent(' was not found; perhaps you misspelled it?)delimiter(")> - instance_variable(@reflections) operator(<<) ident(reflection) - instance_variable(@joins) operator(<<) constant(JoinAssociation)operator(.)ident(new)operator(()ident(reflection)operator(,) pre_constant(self)operator(,) ident(parent)operator(\)) - reserved(when) constant(Array) - ident(associations)operator(.)ident(each) reserved(do) operator(|)ident(association)operator(|) - ident(build)operator(()ident(association)operator(,) ident(parent)operator(\)) - reserved(end) - reserved(when) constant(Hash) - ident(associations)operator(.)ident(keys)operator(.)ident(sort)operator({)operator(|)ident(a)operator(,)ident(b)operator(|)ident(a)operator(.)ident(to_s)operator(<=>)ident(b)operator(.)ident(to_s)operator(})operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - ident(build)operator(()ident(name)operator(,) ident(parent)operator(\)) - ident(build)operator(()ident(associations)operator([)ident(name)operator(])operator(\)) - reserved(end) - reserved(else) - ident(raise) constant(ConfigurationError)operator(,) ident(associations)operator(.)ident(inspect) - reserved(end) - reserved(end) - - reserved(def) method(construct)operator(()ident(parent)operator(,) ident(associations)operator(,) ident(joins)operator(,) ident(row)operator(\)) - reserved(case) ident(associations) - reserved(when) constant(Symbol)operator(,) constant(String) - reserved(while) operator(()ident(join) operator(=) ident(joins)operator(.)ident(shift)operator(\))operator(.)ident(reflection)operator(.)ident(name)operator(.)ident(to_s) operator(!=) ident(associations)operator(.)ident(to_s) - ident(raise) constant(ConfigurationError)operator(,) string reserved(if) ident(joins)operator(.)ident(empty?) - reserved(end) - ident(construct_association)operator(()ident(parent)operator(,) ident(join)operator(,) ident(row)operator(\)) - reserved(when) constant(Array) - ident(associations)operator(.)ident(each) reserved(do) operator(|)ident(association)operator(|) - ident(construct)operator(()ident(parent)operator(,) ident(association)operator(,) ident(joins)operator(,) ident(row)operator(\)) - reserved(end) - reserved(when) constant(Hash) - ident(associations)operator(.)ident(keys)operator(.)ident(sort)operator({)operator(|)ident(a)operator(,)ident(b)operator(|)ident(a)operator(.)ident(to_s)operator(<=>)ident(b)operator(.)ident(to_s)operator(})operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - ident(association) operator(=) ident(construct_association)operator(()ident(parent)operator(,) ident(joins)operator(.)ident(shift)operator(,) ident(row)operator(\)) - ident(construct)operator(()ident(association)operator(,) ident(associations)operator([)ident(name)operator(])operator(,) ident(joins)operator(,) ident(row)operator(\)) reserved(if) ident(association) - reserved(end) - reserved(else) - ident(raise) constant(ConfigurationError)operator(,) ident(associations)operator(.)ident(inspect) - reserved(end) - reserved(end) - - reserved(def) method(construct_association)operator(()ident(record)operator(,) ident(join)operator(,) ident(row)operator(\)) - reserved(case) ident(join)operator(.)ident(reflection)operator(.)ident(macro) - reserved(when) symbol(:has_many)operator(,) symbol(:has_and_belongs_to_many) - ident(collection) operator(=) ident(record)operator(.)ident(send)operator(()ident(join)operator(.)ident(reflection)operator(.)ident(name)operator(\)) - ident(collection)operator(.)ident(loaded) - - reserved(return) pre_constant(nil) reserved(if) ident(record)operator(.)ident(id)operator(.)ident(to_s) operator(!=) ident(join)operator(.)ident(parent)operator(.)ident(record_id)operator(()ident(row)operator(\))operator(.)ident(to_s) reserved(or) ident(row)operator([)ident(join)operator(.)ident(aliased_primary_key)operator(])operator(.)ident(nil?) - ident(association) operator(=) ident(join)operator(.)ident(instantiate)operator(()ident(row)operator(\)) - ident(collection)operator(.)ident(target)operator(.)ident(push)operator(()ident(association)operator(\)) reserved(unless) ident(collection)operator(.)ident(target)operator(.)ident(include?)operator(()ident(association)operator(\)) - reserved(when) symbol(:has_one)operator(,) symbol(:belongs_to) - reserved(return) reserved(if) ident(record)operator(.)ident(id)operator(.)ident(to_s) operator(!=) ident(join)operator(.)ident(parent)operator(.)ident(record_id)operator(()ident(row)operator(\))operator(.)ident(to_s) reserved(or) ident(row)operator([)ident(join)operator(.)ident(aliased_primary_key)operator(])operator(.)ident(nil?) - ident(association) operator(=) ident(join)operator(.)ident(instantiate)operator(()ident(row)operator(\)) - ident(record)operator(.)ident(send)operator(()stringcontent(_target)delimiter(")>operator(,) ident(association)operator(\)) - reserved(else) - ident(raise) constant(ConfigurationError)operator(,) stringdelimiter(")> - reserved(end) - reserved(return) ident(association) - reserved(end) - - reserved(class) class(JoinBase) - ident(attr_reader) symbol(:active_record)operator(,) symbol(:table_joins) - ident(delegate) symbol(:table_name)operator(,) symbol(:column_names)operator(,) symbol(:primary_key)operator(,) symbol(:reflections)operator(,) symbol(:sanitize_sql)operator(,) symbol(:to) operator(=)operator(>) symbol(:active_record) - - reserved(def) method(initialize)operator(()ident(active_record)operator(,) ident(joins) operator(=) pre_constant(nil)operator(\)) - instance_variable(@active_record) operator(=) ident(active_record) - instance_variable(@cached_record) operator(=) operator({)operator(}) - instance_variable(@table_joins) operator(=) ident(joins) - reserved(end) - - reserved(def) method(aliased_prefix) - string - reserved(end) - - reserved(def) method(aliased_primary_key) - stringcontent(_r0)delimiter(")> - reserved(end) - - reserved(def) method(aliased_table_name) - ident(active_record)operator(.)ident(table_name) - reserved(end) - - reserved(def) method(column_names_with_alias) - reserved(unless) instance_variable(@column_names_with_alias) - instance_variable(@column_names_with_alias) operator(=) operator([)operator(]) - operator(()operator([)ident(primary_key)operator(]) operator(+) operator(()ident(column_names) operator(-) operator([)ident(primary_key)operator(])operator(\))operator(\))operator(.)ident(each_with_index) reserved(do) operator(|)ident(column_name)operator(,) ident(i)operator(|) - instance_variable(@column_names_with_alias) operator(<<) operator([)ident(column_name)operator(,) stringcontent(_r)inlinedelimiter(")>operator(]) - reserved(end) - reserved(end) - reserved(return) instance_variable(@column_names_with_alias) - reserved(end) - - reserved(def) method(extract_record)operator(()ident(row)operator(\)) - ident(column_names_with_alias)operator(.)ident(inject)operator(()operator({)operator(})operator(\))operator({)operator(|)ident(record)operator(,) operator(()ident(cn)operator(,) ident(an)operator(\))operator(|) ident(record)operator([)ident(cn)operator(]) operator(=) ident(row)operator([)ident(an)operator(])operator(;) ident(record)operator(}) - reserved(end) - - reserved(def) method(record_id)operator(()ident(row)operator(\)) - ident(row)operator([)ident(aliased_primary_key)operator(]) - reserved(end) - - reserved(def) method(instantiate)operator(()ident(row)operator(\)) - instance_variable(@cached_record)operator([)ident(record_id)operator(()ident(row)operator(\))operator(]) operator(||=) ident(active_record)operator(.)ident(instantiate)operator(()ident(extract_record)operator(()ident(row)operator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(JoinAssociation) operator(<) constant(JoinBase) - ident(attr_reader) symbol(:reflection)operator(,) symbol(:parent)operator(,) symbol(:aliased_table_name)operator(,) symbol(:aliased_prefix)operator(,) symbol(:aliased_join_table_name)operator(,) symbol(:parent_table_name) - ident(delegate) symbol(:options)operator(,) symbol(:klass)operator(,) symbol(:through_reflection)operator(,) symbol(:source_reflection)operator(,) symbol(:to) operator(=)operator(>) symbol(:reflection) - - reserved(def) method(initialize)operator(()ident(reflection)operator(,) ident(join_dependency)operator(,) ident(parent) operator(=) pre_constant(nil)operator(\)) - ident(reflection)operator(.)ident(check_validity!) - reserved(if) ident(reflection)operator(.)ident(options)operator([)symbol(:polymorphic)operator(]) - ident(raise) constant(EagerLoadPolymorphicError)operator(.)ident(new)operator(()ident(reflection)operator(\)) - reserved(end) - - reserved(super)operator(()ident(reflection)operator(.)ident(klass)operator(\)) - instance_variable(@parent) operator(=) ident(parent) - instance_variable(@reflection) operator(=) ident(reflection) - instance_variable(@aliased_prefix) operator(=) stringdelimiter(")> - instance_variable(@aliased_table_name) operator(=) ident(table_name) comment(# start with the table name) - instance_variable(@parent_table_name) operator(=) ident(parent)operator(.)ident(active_record)operator(.)ident(table_name) - - reserved(if) operator(!)ident(parent)operator(.)ident(table_joins)operator(.)ident(blank?) operator(&&) ident(parent)operator(.)ident(table_joins)operator(.)ident(to_s)operator(.)ident(downcase) operator(=)operator(~) regexpchar(\\s)content(on)delimiter(})> - ident(join_dependency)operator(.)ident(table_aliases)operator([)ident(aliased_table_name)operator(]) operator(+=) integer(1) - reserved(end) - - reserved(unless) ident(join_dependency)operator(.)ident(table_aliases)operator([)ident(aliased_table_name)operator(])operator(.)ident(zero?) - comment(# if the table name has been used, then use an alias) - instance_variable(@aliased_table_name) operator(=) ident(active_record)operator(.)ident(connection)operator(.)ident(table_alias_for) stringcontent(_)inlinedelimiter(")> - ident(table_index) operator(=) ident(join_dependency)operator(.)ident(table_aliases)operator([)ident(aliased_table_name)operator(]) - instance_variable(@aliased_table_name) operator(=) instance_variable(@aliased_table_name)operator([)integer(0)operator(..)ident(active_record)operator(.)ident(connection)operator(.)ident(table_alias_length)operator(-)integer(3)operator(]) operator(+) stringdelimiter(")> reserved(if) ident(table_index) operator(>) integer(0) - reserved(end) - ident(join_dependency)operator(.)ident(table_aliases)operator([)ident(aliased_table_name)operator(]) operator(+=) integer(1) - - reserved(if) ident(reflection)operator(.)ident(macro) operator(==) symbol(:has_and_belongs_to_many) operator(||) operator(()ident(reflection)operator(.)ident(macro) operator(==) symbol(:has_many) operator(&&) ident(reflection)operator(.)ident(options)operator([)symbol(:through)operator(])operator(\)) - instance_variable(@aliased_join_table_name) operator(=) ident(reflection)operator(.)ident(macro) operator(==) symbol(:has_and_belongs_to_many) operator(?) ident(reflection)operator(.)ident(options)operator([)symbol(:join_table)operator(]) operator(:) ident(reflection)operator(.)ident(through_reflection)operator(.)ident(klass)operator(.)ident(table_name) - reserved(unless) ident(join_dependency)operator(.)ident(table_aliases)operator([)ident(aliased_join_table_name)operator(])operator(.)ident(zero?) - instance_variable(@aliased_join_table_name) operator(=) ident(active_record)operator(.)ident(connection)operator(.)ident(table_alias_for) stringcontent(_)inlinecontent(_join)delimiter(")> - ident(table_index) operator(=) ident(join_dependency)operator(.)ident(table_aliases)operator([)ident(aliased_join_table_name)operator(]) - instance_variable(@aliased_join_table_name) operator(=) instance_variable(@aliased_join_table_name)operator([)integer(0)operator(..)ident(active_record)operator(.)ident(connection)operator(.)ident(table_alias_length)operator(-)integer(3)operator(]) operator(+) stringdelimiter(")> reserved(if) ident(table_index) operator(>) integer(0) - reserved(end) - ident(join_dependency)operator(.)ident(table_aliases)operator([)ident(aliased_join_table_name)operator(]) operator(+=) integer(1) - reserved(end) - reserved(end) - - reserved(def) method(association_join) - ident(join) operator(=) reserved(case) ident(reflection)operator(.)ident(macro) - reserved(when) symbol(:has_and_belongs_to_many) - string operator(%) operator([) - ident(table_alias_for)operator(()ident(options)operator([)symbol(:join_table)operator(])operator(,) ident(aliased_join_table_name)operator(\))operator(,) - ident(aliased_join_table_name)operator(,) - ident(options)operator([)symbol(:foreign_key)operator(]) operator(||) ident(reflection)operator(.)ident(active_record)operator(.)ident(to_s)operator(.)ident(classify)operator(.)ident(foreign_key)operator(,) - ident(reflection)operator(.)ident(active_record)operator(.)ident(table_name)operator(,) ident(reflection)operator(.)ident(active_record)operator(.)ident(primary_key)operator(]) operator(+) - string operator(%) operator([) - ident(table_name_and_alias)operator(,) ident(aliased_table_name)operator(,) ident(klass)operator(.)ident(primary_key)operator(,) - ident(aliased_join_table_name)operator(,) ident(options)operator([)symbol(:association_foreign_key)operator(]) operator(||) ident(klass)operator(.)ident(table_name)operator(.)ident(classify)operator(.)ident(foreign_key) - operator(]) - reserved(when) symbol(:has_many)operator(,) symbol(:has_one) - reserved(case) - reserved(when) ident(reflection)operator(.)ident(macro) operator(==) symbol(:has_many) operator(&&) ident(reflection)operator(.)ident(options)operator([)symbol(:through)operator(]) - ident(through_conditions) operator(=) ident(through_reflection)operator(.)ident(options)operator([)symbol(:conditions)operator(]) operator(?) stringdelimiter(")> operator(:) string - reserved(if) ident(through_reflection)operator(.)ident(options)operator([)symbol(:as)operator(]) comment(# has_many :through against a polymorphic join) - ident(polymorphic_foreign_key) operator(=) ident(through_reflection)operator(.)ident(options)operator([)symbol(:as)operator(])operator(.)ident(to_s) operator(+) string - ident(polymorphic_foreign_type) operator(=) ident(through_reflection)operator(.)ident(options)operator([)symbol(:as)operator(])operator(.)ident(to_s) operator(+) string - - string operator(%) operator([) - ident(table_alias_for)operator(()ident(through_reflection)operator(.)ident(klass)operator(.)ident(table_name)operator(,) ident(aliased_join_table_name)operator(\))operator(,) - ident(aliased_join_table_name)operator(,) ident(polymorphic_foreign_key)operator(,) - ident(parent)operator(.)ident(aliased_table_name)operator(,) ident(parent)operator(.)ident(primary_key)operator(,) - ident(aliased_join_table_name)operator(,) ident(polymorphic_foreign_type)operator(,) ident(klass)operator(.)ident(quote)operator(()ident(parent)operator(.)ident(active_record)operator(.)ident(base_class)operator(.)ident(name)operator(\))operator(]) operator(+) - string operator(%) operator([)ident(table_name_and_alias)operator(,) - ident(aliased_table_name)operator(,) ident(primary_key)operator(,) ident(aliased_join_table_name)operator(,) ident(options)operator([)symbol(:foreign_key)operator(]) operator(||) ident(reflection)operator(.)ident(klass)operator(.)ident(to_s)operator(.)ident(classify)operator(.)ident(foreign_key) - operator(]) - reserved(else) - reserved(if) ident(source_reflection)operator(.)ident(macro) operator(==) symbol(:has_many) operator(&&) ident(source_reflection)operator(.)ident(options)operator([)symbol(:as)operator(]) - string operator(%) operator([) - ident(table_alias_for)operator(()ident(through_reflection)operator(.)ident(klass)operator(.)ident(table_name)operator(,) ident(aliased_join_table_name)operator(\))operator(,) ident(aliased_join_table_name)operator(,) - ident(through_reflection)operator(.)ident(primary_key_name)operator(,) - ident(parent)operator(.)ident(aliased_table_name)operator(,) ident(parent)operator(.)ident(primary_key)operator(]) operator(+) - string operator(%) operator([) - ident(table_name_and_alias)operator(,) - ident(aliased_table_name)operator(,) stringcontent(_id)delimiter(")>operator(,) - ident(aliased_join_table_name)operator(,) ident(options)operator([)symbol(:foreign_key)operator(]) operator(||) ident(primary_key)operator(,) - ident(aliased_table_name)operator(,) stringcontent(_type)delimiter(")>operator(,) - ident(klass)operator(.)ident(quote)operator(()ident(source_reflection)operator(.)ident(active_record)operator(.)ident(base_class)operator(.)ident(name)operator(\)) - operator(]) - reserved(else) - reserved(case) ident(source_reflection)operator(.)ident(macro) - reserved(when) symbol(:belongs_to) - ident(first_key) operator(=) ident(primary_key) - ident(second_key) operator(=) ident(options)operator([)symbol(:foreign_key)operator(]) operator(||) ident(klass)operator(.)ident(to_s)operator(.)ident(classify)operator(.)ident(foreign_key) - reserved(when) symbol(:has_many) - ident(first_key) operator(=) ident(through_reflection)operator(.)ident(klass)operator(.)ident(to_s)operator(.)ident(classify)operator(.)ident(foreign_key) - ident(second_key) operator(=) ident(options)operator([)symbol(:foreign_key)operator(]) operator(||) ident(primary_key) - reserved(end) - - string operator(%) operator([) - ident(table_alias_for)operator(()ident(through_reflection)operator(.)ident(klass)operator(.)ident(table_name)operator(,) ident(aliased_join_table_name)operator(\))operator(,) ident(aliased_join_table_name)operator(,) - ident(through_reflection)operator(.)ident(primary_key_name)operator(,) - ident(parent)operator(.)ident(aliased_table_name)operator(,) ident(parent)operator(.)ident(primary_key)operator(]) operator(+) - string operator(%) operator([) - ident(table_name_and_alias)operator(,) - ident(aliased_table_name)operator(,) ident(first_key)operator(,) - ident(aliased_join_table_name)operator(,) ident(second_key) - operator(]) - reserved(end) - reserved(end) - - reserved(when) ident(reflection)operator(.)ident(macro) operator(==) symbol(:has_many) operator(&&) ident(reflection)operator(.)ident(options)operator([)symbol(:as)operator(]) - string operator(%) operator([) - ident(table_name_and_alias)operator(,) - ident(aliased_table_name)operator(,) stringcontent(_id)delimiter(")>operator(,) - ident(parent)operator(.)ident(aliased_table_name)operator(,) ident(parent)operator(.)ident(primary_key)operator(,) - ident(aliased_table_name)operator(,) stringcontent(_type)delimiter(")>operator(,) - ident(klass)operator(.)ident(quote)operator(()ident(parent)operator(.)ident(active_record)operator(.)ident(base_class)operator(.)ident(name)operator(\)) - operator(]) - reserved(when) ident(reflection)operator(.)ident(macro) operator(==) symbol(:has_one) operator(&&) ident(reflection)operator(.)ident(options)operator([)symbol(:as)operator(]) - string operator(%) operator([) - ident(table_name_and_alias)operator(,) - ident(aliased_table_name)operator(,) stringcontent(_id)delimiter(")>operator(,) - ident(parent)operator(.)ident(aliased_table_name)operator(,) ident(parent)operator(.)ident(primary_key)operator(,) - ident(aliased_table_name)operator(,) stringcontent(_type)delimiter(")>operator(,) - ident(klass)operator(.)ident(quote)operator(()ident(reflection)operator(.)ident(active_record)operator(.)ident(base_class)operator(.)ident(name)operator(\)) - operator(]) - reserved(else) - ident(foreign_key) operator(=) ident(options)operator([)symbol(:foreign_key)operator(]) operator(||) ident(reflection)operator(.)ident(active_record)operator(.)ident(name)operator(.)ident(foreign_key) - string operator(%) operator([) - ident(table_name_and_alias)operator(,) - ident(aliased_table_name)operator(,) ident(foreign_key)operator(,) - ident(parent)operator(.)ident(aliased_table_name)operator(,) ident(parent)operator(.)ident(primary_key) - operator(]) - reserved(end) - reserved(when) symbol(:belongs_to) - string operator(%) operator([) - ident(table_name_and_alias)operator(,) ident(aliased_table_name)operator(,) ident(reflection)operator(.)ident(klass)operator(.)ident(primary_key)operator(,) - ident(parent)operator(.)ident(aliased_table_name)operator(,) ident(options)operator([)symbol(:foreign_key)operator(]) operator(||) ident(klass)operator(.)ident(to_s)operator(.)ident(foreign_key) - operator(]) - reserved(else) - string - reserved(end) operator(||) string - ident(join) operator(<<) string operator(%) operator([) - ident(aliased_table_name)operator(,) - ident(reflection)operator(.)ident(active_record)operator(.)ident(connection)operator(.)ident(quote_column_name)operator(()ident(reflection)operator(.)ident(active_record)operator(.)ident(inheritance_column)operator(\))operator(,) - ident(klass)operator(.)ident(quote)operator(()ident(klass)operator(.)ident(name)operator(\))operator(]) reserved(unless) ident(klass)operator(.)ident(descends_from_active_record?) - ident(join) operator(<<) stringcontent( )delimiter(")> reserved(if) ident(reflection)operator(.)ident(options)operator([)symbol(:conditions)operator(]) - ident(join) - reserved(end) - - ident(protected) - reserved(def) method(pluralize)operator(()ident(table_name)operator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(pluralize_table_names) operator(?) ident(table_name)operator(.)ident(to_s)operator(.)ident(pluralize) operator(:) ident(table_name) - reserved(end) - - reserved(def) method(table_alias_for)operator(()ident(table_name)operator(,) ident(table_alias)operator(\)) - stringcontent( )inlinedelimiter(")>operator(.)ident(strip) - reserved(end) - - reserved(def) method(table_name_and_alias) - ident(table_alias_for) ident(table_name)operator(,) instance_variable(@aliased_table_name) - reserved(end) - - reserved(def) method(interpolate_sql)operator(()ident(sql)operator(\)) - ident(instance_eval)operator(()stringoperator(,) stringoperator(\))inline_delimiter(})>content(@)delimiter(")>operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActiveRecord) comment(#:nodoc:) - reserved(class) class(ActiveRecordError) operator(<) constant(StandardError) comment(#:nodoc:) - reserved(end) - reserved(class) class(SubclassNotFound) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(end) - reserved(class) class(AssociationTypeMismatch) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(end) - reserved(class) class(SerializationTypeMismatch) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(end) - reserved(class) class(AdapterNotSpecified) operator(<) constant(ActiveRecordError) comment(# :nodoc:) - reserved(end) - reserved(class) class(AdapterNotFound) operator(<) constant(ActiveRecordError) comment(# :nodoc:) - reserved(end) - reserved(class) class(ConnectionNotEstablished) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(end) - reserved(class) class(ConnectionFailed) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(end) - reserved(class) class(RecordNotFound) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(end) - reserved(class) class(RecordNotSaved) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(end) - reserved(class) class(StatementInvalid) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(end) - reserved(class) class(PreparedStatementInvalid) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(end) - reserved(class) class(StaleObjectError) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - reserved(end) - reserved(class) class(ConfigurationError) operator(<) constant(StandardError) comment(#:nodoc:) - reserved(end) - reserved(class) class(ReadOnlyRecord) operator(<) constant(StandardError) comment(#:nodoc:) - reserved(end) - - reserved(class) class(AttributeAssignmentError) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - ident(attr_reader) symbol(:exception)operator(,) symbol(:attribute) - reserved(def) method(initialize)operator(()ident(message)operator(,) ident(exception)operator(,) ident(attribute)operator(\)) - instance_variable(@exception) operator(=) ident(exception) - instance_variable(@attribute) operator(=) ident(attribute) - instance_variable(@message) operator(=) ident(message) - reserved(end) - reserved(end) - - reserved(class) class(MultiparameterAssignmentErrors) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - ident(attr_reader) symbol(:errors) - reserved(def) method(initialize)operator(()ident(errors)operator(\)) - instance_variable(@errors) operator(=) ident(errors) - reserved(end) - reserved(end) - - comment(# Active Record objects don't specify their attributes directly, but rather infer them from the table definition with) - comment(# which they're linked. Adding, removing, and changing attributes and their type is done directly in the database. Any change) - comment(# is instantly reflected in the Active Record objects. The mapping that binds a given Active Record class to a certain) - comment(# database table will happen automatically in most common cases, but can be overwritten for the uncommon ones.) - comment(#) - comment(# See the mapping rules in table_name and the full example in link:files/README.html for more insight.) - comment(#) - comment(# == Creation) - comment(#) - comment(# Active Records accept constructor parameters either in a hash or as a block. The hash method is especially useful when) - comment(# you're receiving the data from somewhere else, like a HTTP request. It works like this:) - comment(#) - comment(# user = User.new(:name => "David", :occupation => "Code Artist"\)) - comment(# user.name # => "David") - comment(#) - comment(# You can also use block initialization:) - comment(#) - comment(# user = User.new do |u|) - comment(# u.name = "David") - comment(# u.occupation = "Code Artist") - comment(# end) - comment(#) - comment(# And of course you can just create a bare object and specify the attributes after the fact:) - comment(#) - comment(# user = User.new) - comment(# user.name = "David") - comment(# user.occupation = "Code Artist") - comment(#) - comment(# == Conditions) - comment(#) - comment(# Conditions can either be specified as a string or an array representing the WHERE-part of an SQL statement.) - comment(# The array form is to be used when the condition input is tainted and requires sanitization. The string form can) - comment(# be used for statements that don't involve tainted data. Examples:) - comment(#) - comment(# User < ActiveRecord::Base) - comment(# def self.authenticate_unsafely(user_name, password\)) - comment(# find(:first, :conditions => "user_name = '#{user_name}' AND password = '#{password}'"\)) - comment(# end) - comment(#) - comment(# def self.authenticate_safely(user_name, password\)) - comment(# find(:first, :conditions => [ "user_name = ? AND password = ?", user_name, password ]\)) - comment(# end) - comment(# end) - comment(#) - comment(# The authenticate_unsafely method inserts the parameters directly into the query and is thus susceptible to SQL-injection) - comment(# attacks if the user_name and +password+ parameters come directly from a HTTP request. The authenticate_safely method,) - comment(# on the other hand, will sanitize the user_name and +password+ before inserting them in the query, which will ensure that) - comment(# an attacker can't escape the query and fake the login (or worse\).) - comment(#) - comment(# When using multiple parameters in the conditions, it can easily become hard to read exactly what the fourth or fifth) - comment(# question mark is supposed to represent. In those cases, you can resort to named bind variables instead. That's done by replacing) - comment(# the question marks with symbols and supplying a hash with values for the matching symbol keys:) - comment(#) - comment(# Company.find(:first, [) - comment(# "id = :id AND name = :name AND division = :division AND created_at > :accounting_date",) - comment(# { :id => 3, :name => "37signals", :division => "First", :accounting_date => '2005-01-01' }) - comment(# ]\)) - comment(#) - comment(# == Overwriting default accessors) - comment(#) - comment(# All column values are automatically available through basic accessors on the Active Record object, but some times you) - comment(# want to specialize this behavior. This can be done by either by overwriting the default accessors (using the same) - comment(# name as the attribute\) calling read_attribute(attr_name\) and write_attribute(attr_name, value\) to actually change things.) - comment(# Example:) - comment(#) - comment(# class Song < ActiveRecord::Base) - comment(# # Uses an integer of seconds to hold the length of the song) - comment(#) - comment(# def length=(minutes\)) - comment(# write_attribute(:length, minutes * 60\)) - comment(# end) - comment(#) - comment(# def length) - comment(# read_attribute(:length\) / 60) - comment(# end) - comment(# end) - comment(#) - comment(# You can alternatively use self[:attribute]=(value\) and self[:attribute] instead of write_attribute(:attribute, vaule\) and) - comment(# read_attribute(:attribute\) as a shorter form.) - comment(#) - comment(# == Accessing attributes before they have been typecasted) - comment(#) - comment(# Sometimes you want to be able to read the raw attribute data without having the column-determined typecast run its course first.) - comment(# That can be done by using the _before_type_cast accessors that all attributes have. For example, if your Account model) - comment(# has a balance attribute, you can call account.balance_before_type_cast or account.id_before_type_cast.) - comment(#) - comment(# This is especially useful in validation situations where the user might supply a string for an integer field and you want to display) - comment(# the original string back in an error message. Accessing the attribute normally would typecast the string to 0, which isn't what you) - comment(# want.) - comment(#) - comment(# == Dynamic attribute-based finders) - comment(#) - comment(# Dynamic attribute-based finders are a cleaner way of getting (and/or creating\) objects by simple queries without turning to SQL. They work by) - comment(# appending the name of an attribute to find_by_ or find_all_by_, so you get finders like Person.find_by_user_name,) - comment(# Person.find_all_by_last_name, Payment.find_by_transaction_id. So instead of writing) - comment(# Person.find(:first, ["user_name = ?", user_name]\), you just do Person.find_by_user_name(user_name\).) - comment(# And instead of writing Person.find(:all, ["last_name = ?", last_name]\), you just do Person.find_all_by_last_name(last_name\).) - comment(#) - comment(# It's also possible to use multiple attributes in the same find by separating them with "_and_", so you get finders like) - comment(# Person.find_by_user_name_and_password or even Payment.find_by_purchaser_and_state_and_country. So instead of writing) - comment(# Person.find(:first, ["user_name = ? AND password = ?", user_name, password]\), you just do) - comment(# Person.find_by_user_name_and_password(user_name, password\).) - comment(#) - comment(# It's even possible to use all the additional parameters to find. For example, the full interface for Payment.find_all_by_amount) - comment(# is actually Payment.find_all_by_amount(amount, options\). And the full interface to Person.find_by_user_name is) - comment(# actually Person.find_by_user_name(user_name, options\). So you could call Payment.find_all_by_amount(50, :order => "created_on"\).) - comment(#) - comment(# The same dynamic finder style can be used to create the object if it doesn't already exist. This dynamic finder is called with) - comment(# find_or_create_by_ and will return the object if it already exists and otherwise creates it, then returns it. Example:) - comment(#) - comment(# # No 'Summer' tag exists) - comment(# Tag.find_or_create_by_name("Summer"\) # equal to Tag.create(:name => "Summer"\)) - comment(# ) - comment(# # Now the 'Summer' tag does exist) - comment(# Tag.find_or_create_by_name("Summer"\) # equal to Tag.find_by_name("Summer"\)) - comment(#) - comment(# == Saving arrays, hashes, and other non-mappable objects in text columns) - comment(#) - comment(# Active Record can serialize any object in text columns using YAML. To do so, you must specify this with a call to the class method +serialize+.) - comment(# This makes it possible to store arrays, hashes, and other non-mappable objects without doing any additional work. Example:) - comment(#) - comment(# class User < ActiveRecord::Base) - comment(# serialize :preferences) - comment(# end) - comment(#) - comment(# user = User.create(:preferences => { "background" => "black", "display" => large }\)) - comment(# User.find(user.id\).preferences # => { "background" => "black", "display" => large }) - comment(#) - comment(# You can also specify a class option as the second parameter that'll raise an exception if a serialized object is retrieved as a) - comment(# descendent of a class not in the hierarchy. Example:) - comment(#) - comment(# class User < ActiveRecord::Base) - comment(# serialize :preferences, Hash) - comment(# end) - comment(#) - comment(# user = User.create(:preferences => %w( one two three \)\)) - comment(# User.find(user.id\).preferences # raises SerializationTypeMismatch) - comment(#) - comment(# == Single table inheritance) - comment(#) - comment(# Active Record allows inheritance by storing the name of the class in a column that by default is called "type" (can be changed) - comment(# by overwriting Base.inheritance_column\). This means that an inheritance looking like this:) - comment(#) - comment(# class Company < ActiveRecord::Base; end) - comment(# class Firm < Company; end) - comment(# class Client < Company; end) - comment(# class PriorityClient < Client; end) - comment(#) - comment(# When you do Firm.create(:name => "37signals"\), this record will be saved in the companies table with type = "Firm". You can then) - comment(# fetch this row again using Company.find(:first, "name = '37signals'"\) and it will return a Firm object.) - comment(#) - comment(# If you don't have a type column defined in your table, single-table inheritance won't be triggered. In that case, it'll work just) - comment(# like normal subclasses with no special magic for differentiating between them or reloading the right type with find.) - comment(#) - comment(# Note, all the attributes for all the cases are kept in the same table. Read more:) - comment(# http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html) - comment(#) - comment(# == Connection to multiple databases in different models) - comment(#) - comment(# Connections are usually created through ActiveRecord::Base.establish_connection and retrieved by ActiveRecord::Base.connection.) - comment(# All classes inheriting from ActiveRecord::Base will use this connection. But you can also set a class-specific connection.) - comment(# For example, if Course is a ActiveRecord::Base, but resides in a different database you can just say Course.establish_connection) - comment(# and Course *and all its subclasses* will use this connection instead.) - comment(#) - comment(# This feature is implemented by keeping a connection pool in ActiveRecord::Base that is a Hash indexed by the class. If a connection is) - comment(# requested, the retrieve_connection method will go up the class-hierarchy until a connection is found in the connection pool.) - comment(#) - comment(# == Exceptions) - comment(#) - comment(# * +ActiveRecordError+ -- generic error class and superclass of all other errors raised by Active Record) - comment(# * +AdapterNotSpecified+ -- the configuration hash used in establish_connection didn't include a) - comment(# :adapter key.) - comment(# * +AdapterNotFound+ -- the :adapter key used in establish_connection specified an non-existent adapter) - comment(# (or a bad spelling of an existing one\).) - comment(# * +AssociationTypeMismatch+ -- the object assigned to the association wasn't of the type specified in the association definition.) - comment(# * +SerializationTypeMismatch+ -- the object serialized wasn't of the class specified as the second parameter.) - comment(# * +ConnectionNotEstablished+ -- no connection has been established. Use establish_connection before querying.) - comment(# * +RecordNotFound+ -- no record responded to the find* method.) - comment(# Either the row with the given ID doesn't exist or the row didn't meet the additional restrictions.) - comment(# * +StatementInvalid+ -- the database server rejected the SQL statement. The precise error is added in the message.) - comment(# Either the record with the given ID doesn't exist or the record didn't meet the additional restrictions.) - comment(# * +MultiparameterAssignmentErrors+ -- collection of errors that occurred during a mass assignment using the) - comment(# +attributes=+ method. The +errors+ property of this exception contains an array of +AttributeAssignmentError+) - comment(# objects that should be inspected to determine which attributes triggered the errors.) - comment(# * +AttributeAssignmentError+ -- an error occurred while doing a mass assignment through the +attributes=+ method.) - comment(# You can inspect the +attribute+ property of the exception object to determine which attribute triggered the error.) - comment(#) - comment(# *Note*: The attributes listed are class-level attributes (accessible from both the class and instance level\).) - comment(# So it's possible to assign a logger to the class through Base.logger= which will then be used by all) - comment(# instances in the current object space.) - reserved(class) class(Base) - comment(# Accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then passed) - comment(# on to any new database connections made and which can be retrieved on both a class and instance level by calling +logger+.) - ident(cattr_accessor) symbol(:logger) - - ident(include) constant(Reloadable)operator(::)constant(Subclasses) - - reserved(def) pre_constant(self)operator(.)method(inherited)operator(()ident(child)operator(\)) comment(#:nodoc:) - class_variable(@@subclasses)operator([)pre_constant(self)operator(]) operator(||=) operator([)operator(]) - class_variable(@@subclasses)operator([)pre_constant(self)operator(]) operator(<<) ident(child) - reserved(super) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(reset_subclasses) comment(#:nodoc:) - ident(nonreloadables) operator(=) operator([)operator(]) - ident(subclasses)operator(.)ident(each) reserved(do) operator(|)ident(klass)operator(|) - reserved(unless) ident(klass)operator(.)ident(reloadable?) - ident(nonreloadables) operator(<<) ident(klass) - reserved(next) - reserved(end) - ident(klass)operator(.)ident(instance_variables)operator(.)ident(each) operator({) operator(|)ident(var)operator(|) ident(klass)operator(.)ident(send)operator(()symbol(:remove_instance_variable)operator(,) ident(var)operator(\)) operator(}) - ident(klass)operator(.)ident(instance_methods)operator(()pre_constant(false)operator(\))operator(.)ident(each) operator({) operator(|)ident(m)operator(|) ident(klass)operator(.)ident(send) symbol(:undef_method)operator(,) ident(m) operator(}) - reserved(end) - class_variable(@@subclasses) operator(=) operator({)operator(}) - ident(nonreloadables)operator(.)ident(each) operator({) operator(|)ident(klass)operator(|) operator(()class_variable(@@subclasses)operator([)ident(klass)operator(.)ident(superclass)operator(]) operator(||=) operator([)operator(])operator(\)) operator(<<) ident(klass) operator(}) - reserved(end) - - class_variable(@@subclasses) operator(=) operator({)operator(}) - - ident(cattr_accessor) symbol(:configurations) - class_variable(@@configurations) operator(=) operator({)operator(}) - - comment(# Accessor for the prefix type that will be prepended to every primary key column name. The options are :table_name and) - comment(# :table_name_with_underscore. If the first is specified, the Product class will look for "productid" instead of "id" as) - comment(# the primary column. If the latter is specified, the Product class will look for "product_id" instead of "id". Remember) - comment(# that this is a global setting for all Active Records.) - ident(cattr_accessor) symbol(:primary_key_prefix_type) - class_variable(@@primary_key_prefix_type) operator(=) pre_constant(nil) - - comment(# Accessor for the name of the prefix string to prepend to every table name. So if set to "basecamp_", all) - comment(# table names will be named like "basecamp_projects", "basecamp_people", etc. This is a convenient way of creating a namespace) - comment(# for tables in a shared database. By default, the prefix is the empty string.) - ident(cattr_accessor) symbol(:table_name_prefix) - class_variable(@@table_name_prefix) operator(=) string - - comment(# Works like +table_name_prefix+, but appends instead of prepends (set to "_basecamp" gives "projects_basecamp",) - comment(# "people_basecamp"\). By default, the suffix is the empty string.) - ident(cattr_accessor) symbol(:table_name_suffix) - class_variable(@@table_name_suffix) operator(=) string - - comment(# Indicates whether or not table names should be the pluralized versions of the corresponding class names.) - comment(# If true, the default table name for a +Product+ class will be +products+. If false, it would just be +product+.) - comment(# See table_name for the full rules on table/class naming. This is true, by default.) - ident(cattr_accessor) symbol(:pluralize_table_names) - class_variable(@@pluralize_table_names) operator(=) pre_constant(true) - - comment(# Determines whether or not to use ANSI codes to colorize the logging statements committed by the connection adapter. These colors) - comment(# make it much easier to overview things during debugging (when used through a reader like +tail+ and on a black background\), but) - comment(# may complicate matters if you use software like syslog. This is true, by default.) - ident(cattr_accessor) symbol(:colorize_logging) - class_variable(@@colorize_logging) operator(=) pre_constant(true) - - comment(# Determines whether to use Time.local (using :local\) or Time.utc (using :utc\) when pulling dates and times from the database.) - comment(# This is set to :local by default.) - ident(cattr_accessor) symbol(:default_timezone) - class_variable(@@default_timezone) operator(=) symbol(:local) - - comment(# Determines whether or not to use a connection for each thread, or a single shared connection for all threads.) - comment(# Defaults to false. Set to true if you're writing a threaded application.) - ident(cattr_accessor) symbol(:allow_concurrency) - class_variable(@@allow_concurrency) operator(=) pre_constant(false) - - comment(# Determines whether to speed up access by generating optimized reader) - comment(# methods to avoid expensive calls to method_missing when accessing) - comment(# attributes by name. You might want to set this to false in development) - comment(# mode, because the methods would be regenerated on each request.) - ident(cattr_accessor) symbol(:generate_read_methods) - class_variable(@@generate_read_methods) operator(=) pre_constant(true) - - comment(# Specifies the format to use when dumping the database schema with Rails') - comment(# Rakefile. If :sql, the schema is dumped as (potentially database-) - comment(# specific\) SQL statements. If :ruby, the schema is dumped as an ) - comment(# ActiveRecord::Schema file which can be loaded into any database that) - comment(# supports migrations. Use :ruby if you want to have different database) - comment(# adapters for, e.g., your development and test environments.) - ident(cattr_accessor) symbol(:schema_format) - class_variable(@@schema_format) operator(=) symbol(:ruby) - - reserved(class) operator(<<) class(self) comment(# Class methods) - comment(# Find operates with three different retrieval approaches:) - comment(#) - comment(# * Find by id: This can either be a specific id (1\), a list of ids (1, 5, 6\), or an array of ids ([5, 6, 10]\).) - comment(# If no record can be found for all of the listed ids, then RecordNotFound will be raised.) - comment(# * Find first: This will return the first record matched by the options used. These options can either be specific) - comment(# conditions or merely an order. If no record can matched, nil is returned.) - comment(# * Find all: This will return all the records matched by the options used. If no records are found, an empty array is returned.) - comment(#) - comment(# All approaches accept an option hash as their last parameter. The options are:) - comment(#) - comment(# * :conditions: An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. See conditions in the intro.) - comment(# * :order: An SQL fragment like "created_at DESC, name".) - comment(# * :group: An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.) - comment(# * :limit: An integer determining the limit on the number of rows that should be returned.) - comment(# * :offset: An integer determining the offset from where the rows should be fetched. So at 5, it would skip the first 4 rows.) - comment(# * :joins: An SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id". (Rarely needed\).) - comment(# The records will be returned read-only since they will have attributes that do not correspond to the table's columns.) - comment(# Pass :readonly => false to override.) - comment(# * :include: Names associations that should be loaded alongside using LEFT OUTER JOINs. The symbols named refer) - comment(# to already defined associations. See eager loading under Associations.) - comment(# * :select: By default, this is * as in SELECT * FROM, but can be changed if you for example want to do a join, but not) - comment(# include the joined columns.) - comment(# * :readonly: Mark the returned records read-only so they cannot be saved or updated.) - comment(#) - comment(# Examples for find by id:) - comment(# Person.find(1\) # returns the object for ID = 1) - comment(# Person.find(1, 2, 6\) # returns an array for objects with IDs in (1, 2, 6\)) - comment(# Person.find([7, 17]\) # returns an array for objects with IDs in (7, 17\)) - comment(# Person.find([1]\) # returns an array for objects the object with ID = 1) - comment(# Person.find(1, :conditions => "administrator = 1", :order => "created_on DESC"\)) - comment(#) - comment(# Examples for find first:) - comment(# Person.find(:first\) # returns the first object fetched by SELECT * FROM people) - comment(# Person.find(:first, :conditions => [ "user_name = ?", user_name]\)) - comment(# Person.find(:first, :order => "created_on DESC", :offset => 5\)) - comment(#) - comment(# Examples for find all:) - comment(# Person.find(:all\) # returns an array of objects for all the rows fetched by SELECT * FROM people) - comment(# Person.find(:all, :conditions => [ "category IN (?\)", categories], :limit => 50\)) - comment(# Person.find(:all, :offset => 10, :limit => 10\)) - comment(# Person.find(:all, :include => [ :account, :friends ]\)) - comment(# Person.find(:all, :group => "category"\)) - reserved(def) method(find)operator(()operator(*)ident(args)operator(\)) - ident(options) operator(=) ident(extract_options_from_args!)operator(()ident(args)operator(\)) - ident(validate_find_options)operator(()ident(options)operator(\)) - ident(set_readonly_option!)operator(()ident(options)operator(\)) - - reserved(case) ident(args)operator(.)ident(first) - reserved(when) symbol(:first) reserved(then) ident(find_initial)operator(()ident(options)operator(\)) - reserved(when) symbol(:all) reserved(then) ident(find_every)operator(()ident(options)operator(\)) - reserved(else) ident(find_from_ids)operator(()ident(args)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - comment(# Works like find(:all\), but requires a complete SQL string. Examples:) - comment(# Post.find_by_sql "SELECT p.*, c.author FROM posts p, comments c WHERE p.id = c.post_id") - comment(# Post.find_by_sql ["SELECT * FROM posts WHERE author = ? AND created > ?", author_id, start_date]) - reserved(def) method(find_by_sql)operator(()ident(sql)operator(\)) - ident(connection)operator(.)ident(select_all)operator(()ident(sanitize_sql)operator(()ident(sql)operator(\))operator(,) stringcontent( Load)delimiter(")>operator(\))operator(.)ident(collect!) operator({) operator(|)ident(record)operator(|) ident(instantiate)operator(()ident(record)operator(\)) operator(}) - reserved(end) - - comment(# Returns true if the given +id+ represents the primary key of a record in the database, false otherwise.) - comment(# Example:) - comment(# Person.exists?(5\)) - reserved(def) method(exists?)operator(()ident(id)operator(\)) - operator(!)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringcontent( = ?)delimiter(")>operator(,) ident(id)operator(])operator(\))operator(.)ident(nil?) reserved(rescue) pre_constant(false) - reserved(end) - - comment(# Creates an object, instantly saves it as a record (if the validation permits it\), and returns it. If the save) - comment(# fails under validations, the unsaved object is still returned.) - reserved(def) method(create)operator(()ident(attributes) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(attributes)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - ident(attributes)operator(.)ident(collect) operator({) operator(|)ident(attr)operator(|) ident(create)operator(()ident(attr)operator(\)) operator(}) - reserved(else) - ident(object) operator(=) ident(new)operator(()ident(attributes)operator(\)) - ident(scope)operator(()symbol(:create)operator(\))operator(.)ident(each) operator({) operator(|)ident(att)operator(,)ident(value)operator(|) ident(object)operator(.)ident(send)operator(()stringcontent(=)delimiter(")>operator(,) ident(value)operator(\)) operator(}) reserved(if) ident(scoped?)operator(()symbol(:create)operator(\)) - ident(object)operator(.)ident(save) - ident(object) - reserved(end) - reserved(end) - - comment(# Finds the record from the passed +id+, instantly saves it with the passed +attributes+ (if the validation permits it\),) - comment(# and returns it. If the save fails under validations, the unsaved object is still returned.) - comment(#) - comment(# The arguments may also be given as arrays in which case the update method is called for each pair of +id+ and ) - comment(# +attributes+ and an array of objects is returned.) - comment(#) - comment(# Example of updating one record:) - comment(# Person.update(15, {:user_name => 'Samuel', :group => 'expert'}\)) - comment(# ) - comment(# Example of updating multiple records:) - comment(# people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy"} } ) - comment(# Person.update(people.keys, people.values\)) - reserved(def) method(update)operator(()ident(id)operator(,) ident(attributes)operator(\)) - reserved(if) ident(id)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - ident(idx) operator(=) integer(-1) - ident(id)operator(.)ident(collect) operator({) operator(|)ident(id)operator(|) ident(idx) operator(+=) integer(1)operator(;) ident(update)operator(()ident(id)operator(,) ident(attributes)operator([)ident(idx)operator(])operator(\)) operator(}) - reserved(else) - ident(object) operator(=) ident(find)operator(()ident(id)operator(\)) - ident(object)operator(.)ident(update_attributes)operator(()ident(attributes)operator(\)) - ident(object) - reserved(end) - reserved(end) - - comment(# Deletes the record with the given +id+ without instantiating an object first. If an array of ids is provided, all of them) - comment(# are deleted.) - reserved(def) method(delete)operator(()ident(id)operator(\)) - ident(delete_all)operator(()operator([) stringcontent( IN (?\))delimiter(")>operator(,) ident(id) operator(])operator(\)) - reserved(end) - - comment(# Destroys the record with the given +id+ by instantiating the object and calling #destroy (all the callbacks are the triggered\).) - comment(# If an array of ids is provided, all of them are destroyed.) - reserved(def) method(destroy)operator(()ident(id)operator(\)) - ident(id)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) operator(?) ident(id)operator(.)ident(each) operator({) operator(|)ident(id)operator(|) ident(destroy)operator(()ident(id)operator(\)) operator(}) operator(:) ident(find)operator(()ident(id)operator(\))operator(.)ident(destroy) - reserved(end) - - comment(# Updates all records with the SET-part of an SQL update statement in +updates+ and returns an integer with the number of rows updated.) - comment(# A subset of the records can be selected by specifying +conditions+. Example:) - comment(# Billing.update_all "category = 'authorized', approved = 1", "author = 'David'") - reserved(def) method(update_all)operator(()ident(updates)operator(,) ident(conditions) operator(=) pre_constant(nil)operator(\)) - ident(sql) operator(=) stringcontent( SET )inlinecontent( )delimiter(")> - ident(add_conditions!)operator(()ident(sql)operator(,) ident(conditions)operator(,) ident(scope)operator(()symbol(:find)operator(\))operator(\)) - ident(connection)operator(.)ident(update)operator(()ident(sql)operator(,) stringcontent( Update)delimiter(")>operator(\)) - reserved(end) - - comment(# Destroys the objects for all the records that match the +condition+ by instantiating each object and calling) - comment(# the destroy method. Example:) - comment(# Person.destroy_all "last_login < '2004-04-04'") - reserved(def) method(destroy_all)operator(()ident(conditions) operator(=) pre_constant(nil)operator(\)) - ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) ident(conditions)operator(\))operator(.)ident(each) operator({) operator(|)ident(object)operator(|) ident(object)operator(.)ident(destroy) operator(}) - reserved(end) - - comment(# Deletes all the records that match the +condition+ without instantiating the objects first (and hence not) - comment(# calling the destroy method\). Example:) - comment(# Post.delete_all "person_id = 5 AND (category = 'Something' OR category = 'Else'\)") - reserved(def) method(delete_all)operator(()ident(conditions) operator(=) pre_constant(nil)operator(\)) - ident(sql) operator(=) stringcontent( )delimiter(")> - ident(add_conditions!)operator(()ident(sql)operator(,) ident(conditions)operator(,) ident(scope)operator(()symbol(:find)operator(\))operator(\)) - ident(connection)operator(.)ident(delete)operator(()ident(sql)operator(,) stringcontent( Delete all)delimiter(")>operator(\)) - reserved(end) - - comment(# Returns the result of an SQL statement that should only include a COUNT(*\) in the SELECT part.) - comment(# Product.count_by_sql "SELECT COUNT(*\) FROM sales s, customers c WHERE s.customer_id = c.id") - reserved(def) method(count_by_sql)operator(()ident(sql)operator(\)) - ident(sql) operator(=) ident(sanitize_conditions)operator(()ident(sql)operator(\)) - ident(connection)operator(.)ident(select_value)operator(()ident(sql)operator(,) stringcontent( Count)delimiter(")>operator(\))operator(.)ident(to_i) - reserved(end) - - comment(# Increments the specified counter by one. So DiscussionBoard.increment_counter("post_count",) - comment(# discussion_board_id\) would increment the "post_count" counter on the board responding to discussion_board_id.) - comment(# This is used for caching aggregate values, so that they don't need to be computed every time. Especially important) - comment(# for looping over a collection where each element require a number of aggregate values. Like the DiscussionBoard) - comment(# that needs to list both the number of posts and comments.) - reserved(def) method(increment_counter)operator(()ident(counter_name)operator(,) ident(id)operator(\)) - ident(update_all) stringcontent( = )inlinecontent( + 1)delimiter(")>operator(,) stringcontent( = )inlinedelimiter(")> - reserved(end) - - comment(# Works like increment_counter, but decrements instead.) - reserved(def) method(decrement_counter)operator(()ident(counter_name)operator(,) ident(id)operator(\)) - ident(update_all) stringcontent( = )inlinecontent( - 1)delimiter(")>operator(,) stringcontent( = )inlinedelimiter(")> - reserved(end) - - - comment(# Attributes named in this macro are protected from mass-assignment, such as new(attributes\) and) - comment(# attributes=(attributes\). Their assignment will simply be ignored. Instead, you can use the direct writer) - comment(# methods to do assignment. This is meant to protect sensitive attributes from being overwritten by URL/form hackers. Example:) - comment(#) - comment(# class Customer < ActiveRecord::Base) - comment(# attr_protected :credit_rating) - comment(# end) - comment(#) - comment(# customer = Customer.new("name" => David, "credit_rating" => "Excellent"\)) - comment(# customer.credit_rating # => nil) - comment(# customer.attributes = { "description" => "Jolly fellow", "credit_rating" => "Superb" }) - comment(# customer.credit_rating # => nil) - comment(#) - comment(# customer.credit_rating = "Average") - comment(# customer.credit_rating # => "Average") - reserved(def) method(attr_protected)operator(()operator(*)ident(attributes)operator(\)) - ident(write_inheritable_array)operator(()stringoperator(,) ident(attributes) operator(-) operator(()ident(protected_attributes) operator(||) operator([)operator(])operator(\))operator(\)) - reserved(end) - - comment(# Returns an array of all the attributes that have been protected from mass-assignment.) - reserved(def) method(protected_attributes) comment(# :nodoc:) - ident(read_inheritable_attribute)operator(()stringoperator(\)) - reserved(end) - - comment(# If this macro is used, only those attributes named in it will be accessible for mass-assignment, such as) - comment(# new(attributes\) and attributes=(attributes\). This is the more conservative choice for mass-assignment) - comment(# protection. If you'd rather start from an all-open default and restrict attributes as needed, have a look at) - comment(# attr_protected.) - reserved(def) method(attr_accessible)operator(()operator(*)ident(attributes)operator(\)) - ident(write_inheritable_array)operator(()stringoperator(,) ident(attributes) operator(-) operator(()ident(accessible_attributes) operator(||) operator([)operator(])operator(\))operator(\)) - reserved(end) - - comment(# Returns an array of all the attributes that have been made accessible to mass-assignment.) - reserved(def) method(accessible_attributes) comment(# :nodoc:) - ident(read_inheritable_attribute)operator(()stringoperator(\)) - reserved(end) - - - comment(# Specifies that the attribute by the name of +attr_name+ should be serialized before saving to the database and unserialized) - comment(# after loading from the database. The serialization is done through YAML. If +class_name+ is specified, the serialized) - comment(# object must be of that class on retrieval or +SerializationTypeMismatch+ will be raised.) - reserved(def) method(serialize)operator(()ident(attr_name)operator(,) ident(class_name) operator(=) constant(Object)operator(\)) - ident(serialized_attributes)operator([)ident(attr_name)operator(.)ident(to_s)operator(]) operator(=) ident(class_name) - reserved(end) - - comment(# Returns a hash of all the attributes that have been specified for serialization as keys and their class restriction as values.) - reserved(def) method(serialized_attributes) - ident(read_inheritable_attribute)operator(()stringoperator(\)) reserved(or) ident(write_inheritable_attribute)operator(()stringoperator(,) operator({)operator(})operator(\)) - reserved(end) - - - comment(# Guesses the table name (in forced lower-case\) based on the name of the class in the inheritance hierarchy descending) - comment(# directly from ActiveRecord. So if the hierarchy looks like: Reply < Message < ActiveRecord, then Message is used) - comment(# to guess the table name from even when called on Reply. The rules used to do the guess are handled by the Inflector class) - comment(# in Active Support, which knows almost all common English inflections (report a bug if your inflection isn't covered\).) - comment(#) - comment(# Additionally, the class-level table_name_prefix is prepended to the table_name and the table_name_suffix is appended.) - comment(# So if you have "myapp_" as a prefix, the table name guess for an Account class becomes "myapp_accounts".) - comment(#) - comment(# You can also overwrite this class method to allow for unguessable links, such as a Mouse class with a link to a) - comment(# "mice" table. Example:) - comment(#) - comment(# class Mouse < ActiveRecord::Base) - comment(# set_table_name "mice") - comment(# end) - reserved(def) method(table_name) - ident(reset_table_name) - reserved(end) - - reserved(def) method(reset_table_name) comment(#:nodoc:) - ident(name) operator(=) stringinlineinlinedelimiter(")> - ident(set_table_name)operator(()ident(name)operator(\)) - ident(name) - reserved(end) - - comment(# Defines the primary key field -- can be overridden in subclasses. Overwriting will negate any effect of the) - comment(# primary_key_prefix_type setting, though.) - reserved(def) method(primary_key) - ident(reset_primary_key) - reserved(end) - - reserved(def) method(reset_primary_key) comment(#:nodoc:) - ident(key) operator(=) string - reserved(case) ident(primary_key_prefix_type) - reserved(when) symbol(:table_name) - ident(key) operator(=) constant(Inflector)operator(.)ident(foreign_key)operator(()ident(base_class)operator(.)ident(name)operator(,) pre_constant(false)operator(\)) - reserved(when) symbol(:table_name_with_underscore) - ident(key) operator(=) constant(Inflector)operator(.)ident(foreign_key)operator(()ident(base_class)operator(.)ident(name)operator(\)) - reserved(end) - ident(set_primary_key)operator(()ident(key)operator(\)) - ident(key) - reserved(end) - - comment(# Defines the column name for use with single table inheritance -- can be overridden in subclasses.) - reserved(def) method(inheritance_column) - string - reserved(end) - - comment(# Lazy-set the sequence name to the connection's default. This method) - comment(# is only ever called once since set_sequence_name overrides it.) - reserved(def) method(sequence_name) comment(#:nodoc:) - ident(reset_sequence_name) - reserved(end) - - reserved(def) method(reset_sequence_name) comment(#:nodoc:) - ident(default) operator(=) ident(connection)operator(.)ident(default_sequence_name)operator(()ident(table_name)operator(,) ident(primary_key)operator(\)) - ident(set_sequence_name)operator(()ident(default)operator(\)) - ident(default) - reserved(end) - - comment(# Sets the table name to use to the given value, or (if the value) - comment(# is nil or false\) to the value returned by the given block.) - comment(#) - comment(# Example:) - comment(#) - comment(# class Project < ActiveRecord::Base) - comment(# set_table_name "project") - comment(# end) - reserved(def) method(set_table_name)operator(()ident(value) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - ident(define_attr_method) symbol(:table_name)operator(,) ident(value)operator(,) operator(&)ident(block) - reserved(end) - reserved(alias) symbol(:table_name=) symbol(:set_table_name) - - comment(# Sets the name of the primary key column to use to the given value,) - comment(# or (if the value is nil or false\) to the value returned by the given) - comment(# block.) - comment(#) - comment(# Example:) - comment(#) - comment(# class Project < ActiveRecord::Base) - comment(# set_primary_key "sysid") - comment(# end) - reserved(def) method(set_primary_key)operator(()ident(value) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - ident(define_attr_method) symbol(:primary_key)operator(,) ident(value)operator(,) operator(&)ident(block) - reserved(end) - reserved(alias) symbol(:primary_key=) symbol(:set_primary_key) - - comment(# Sets the name of the inheritance column to use to the given value,) - comment(# or (if the value # is nil or false\) to the value returned by the) - comment(# given block.) - comment(#) - comment(# Example:) - comment(#) - comment(# class Project < ActiveRecord::Base) - comment(# set_inheritance_column do) - comment(# original_inheritance_column + "_id") - comment(# end) - comment(# end) - reserved(def) method(set_inheritance_column)operator(()ident(value) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - ident(define_attr_method) symbol(:inheritance_column)operator(,) ident(value)operator(,) operator(&)ident(block) - reserved(end) - reserved(alias) symbol(:inheritance_column=) symbol(:set_inheritance_column) - - comment(# Sets the name of the sequence to use when generating ids to the given) - comment(# value, or (if the value is nil or false\) to the value returned by the) - comment(# given block. This is required for Oracle and is useful for any) - comment(# database which relies on sequences for primary key generation.) - comment(#) - comment(# If a sequence name is not explicitly set when using Oracle or Firebird,) - comment(# it will default to the commonly used pattern of: #{table_name}_seq) - comment(#) - comment(# If a sequence name is not explicitly set when using PostgreSQL, it) - comment(# will discover the sequence corresponding to your primary key for you.) - comment(#) - comment(# Example:) - comment(#) - comment(# class Project < ActiveRecord::Base) - comment(# set_sequence_name "projectseq" # default would have been "project_seq") - comment(# end) - reserved(def) method(set_sequence_name)operator(()ident(value) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - ident(define_attr_method) symbol(:sequence_name)operator(,) ident(value)operator(,) operator(&)ident(block) - reserved(end) - reserved(alias) symbol(:sequence_name=) symbol(:set_sequence_name) - - comment(# Turns the +table_name+ back into a class name following the reverse rules of +table_name+.) - reserved(def) method(class_name)operator(()ident(table_name) operator(=) ident(table_name)operator(\)) comment(# :nodoc:) - comment(# remove any prefix and/or suffix from the table name) - ident(class_name) operator(=) ident(table_name)operator([)ident(table_name_prefix)operator(.)ident(length)operator(..)operator(-)operator(()ident(table_name_suffix)operator(.)ident(length) operator(+) integer(1)operator(\))operator(])operator(.)ident(camelize) - ident(class_name) operator(=) ident(class_name)operator(.)ident(singularize) reserved(if) ident(pluralize_table_names) - ident(class_name) - reserved(end) - - comment(# Indicates whether the table associated with this class exists) - reserved(def) method(table_exists?) - reserved(if) ident(connection)operator(.)ident(respond_to?)operator(()symbol(:tables)operator(\)) - ident(connection)operator(.)ident(tables)operator(.)ident(include?) ident(table_name) - reserved(else) - comment(# if the connection adapter hasn't implemented tables, there are two crude tests that can be) - comment(# used - see if getting column info raises an error, or if the number of columns returned is zero) - reserved(begin) - ident(reset_column_information) - ident(columns)operator(.)ident(size) operator(>) integer(0) - reserved(rescue) constant(ActiveRecord)operator(::)constant(StatementInvalid) - pre_constant(false) - reserved(end) - reserved(end) - reserved(end) - - comment(# Returns an array of column objects for the table associated with this class.) - reserved(def) method(columns) - reserved(unless) instance_variable(@columns) - instance_variable(@columns) operator(=) ident(connection)operator(.)ident(columns)operator(()ident(table_name)operator(,) stringcontent( Columns)delimiter(")>operator(\)) - instance_variable(@columns)operator(.)ident(each) operator({)operator(|)ident(column)operator(|) ident(column)operator(.)ident(primary) operator(=) ident(column)operator(.)ident(name) operator(==) ident(primary_key)operator(}) - reserved(end) - instance_variable(@columns) - reserved(end) - - comment(# Returns an array of column objects for the table associated with this class.) - reserved(def) method(columns_hash) - instance_variable(@columns_hash) operator(||=) ident(columns)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({) operator(|)ident(hash)operator(,) ident(column)operator(|) ident(hash)operator([)ident(column)operator(.)ident(name)operator(]) operator(=) ident(column)operator(;) ident(hash) operator(}) - reserved(end) - - comment(# Returns an array of column names as strings.) - reserved(def) method(column_names) - instance_variable(@column_names) operator(||=) ident(columns)operator(.)ident(map) operator({) operator(|)ident(column)operator(|) ident(column)operator(.)ident(name) operator(}) - reserved(end) - - comment(# Returns an array of column objects where the primary id, all columns ending in "_id" or "_count",) - comment(# and columns used for single table inheritance have been removed.) - reserved(def) method(content_columns) - instance_variable(@content_columns) operator(||=) ident(columns)operator(.)ident(reject) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(primary) operator(||) ident(c)operator(.)ident(name) operator(=)operator(~) regexp operator(||) ident(c)operator(.)ident(name) operator(==) ident(inheritance_column) operator(}) - reserved(end) - - comment(# Returns a hash of all the methods added to query each of the columns in the table with the name of the method as the key) - comment(# and true as the value. This makes it possible to do O(1\) lookups in respond_to? to check if a given method for attribute) - comment(# is available.) - reserved(def) method(column_methods_hash) comment(#:nodoc:) - instance_variable(@dynamic_methods_hash) operator(||=) ident(column_names)operator(.)ident(inject)operator(()constant(Hash)operator(.)ident(new)operator(()pre_constant(false)operator(\))operator(\)) reserved(do) operator(|)ident(methods)operator(,) ident(attr)operator(|) - ident(attr_name) operator(=) ident(attr)operator(.)ident(to_s) - ident(methods)operator([)ident(attr)operator(.)ident(to_sym)operator(]) operator(=) ident(attr_name) - ident(methods)operator([)stringcontent(=)delimiter(")>operator(.)ident(to_sym)operator(]) operator(=) ident(attr_name) - ident(methods)operator([)stringcontent(?)delimiter(")>operator(.)ident(to_sym)operator(]) operator(=) ident(attr_name) - ident(methods)operator([)stringcontent(_before_type_cast)delimiter(")>operator(.)ident(to_sym)operator(]) operator(=) ident(attr_name) - ident(methods) - reserved(end) - reserved(end) - - comment(# Contains the names of the generated reader methods.) - reserved(def) method(read_methods) comment(#:nodoc:) - instance_variable(@read_methods) operator(||=) constant(Set)operator(.)ident(new) - reserved(end) - - comment(# Resets all the cached information about columns, which will cause them to be reloaded on the next request.) - reserved(def) method(reset_column_information) - ident(read_methods)operator(.)ident(each) operator({) operator(|)ident(name)operator(|) ident(undef_method)operator(()ident(name)operator(\)) operator(}) - instance_variable(@column_names) operator(=) instance_variable(@columns) operator(=) instance_variable(@columns_hash) operator(=) instance_variable(@content_columns) operator(=) instance_variable(@dynamic_methods_hash) operator(=) instance_variable(@read_methods) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(reset_column_information_and_inheritable_attributes_for_all_subclasses)comment(#:nodoc:) - ident(subclasses)operator(.)ident(each) operator({) operator(|)ident(klass)operator(|) ident(klass)operator(.)ident(reset_inheritable_attributes)operator(;) ident(klass)operator(.)ident(reset_column_information) operator(}) - reserved(end) - - comment(# Transforms attribute key names into a more humane format, such as "First name" instead of "first_name". Example:) - comment(# Person.human_attribute_name("first_name"\) # => "First name") - comment(# Deprecated in favor of just calling "first_name".humanize) - reserved(def) method(human_attribute_name)operator(()ident(attribute_key_name)operator(\)) comment(#:nodoc:) - ident(attribute_key_name)operator(.)ident(humanize) - reserved(end) - - reserved(def) method(descends_from_active_record?) comment(# :nodoc:) - ident(superclass) operator(==) constant(Base) operator(||) operator(!)ident(columns_hash)operator(.)ident(include?)operator(()ident(inheritance_column)operator(\)) - reserved(end) - - reserved(def) method(quote)operator(()ident(object)operator(\)) comment(#:nodoc:) - ident(connection)operator(.)ident(quote)operator(()ident(object)operator(\)) - reserved(end) - - comment(# Used to sanitize objects before they're used in an SELECT SQL-statement. Delegates to connection.quote.) - reserved(def) method(sanitize)operator(()ident(object)operator(\)) comment(#:nodoc:) - ident(connection)operator(.)ident(quote)operator(()ident(object)operator(\)) - reserved(end) - - comment(# Log and benchmark multiple statements in a single block. Example:) - comment(#) - comment(# Project.benchmark("Creating project"\) do) - comment(# project = Project.create("name" => "stuff"\)) - comment(# project.create_manager("name" => "David"\)) - comment(# project.milestones << Milestone.find(:all\)) - comment(# end) - comment(#) - comment(# The benchmark is only recorded if the current level of the logger matches the log_level, which makes it) - comment(# easy to include benchmarking statements in production software that will remain inexpensive because the benchmark) - comment(# will only be conducted if the log level is low enough.) - comment(#) - comment(# The logging of the multiple statements is turned off unless use_silence is set to false.) - reserved(def) method(benchmark)operator(()ident(title)operator(,) ident(log_level) operator(=) constant(Logger)operator(::)constant(DEBUG)operator(,) ident(use_silence) operator(=) pre_constant(true)operator(\)) - reserved(if) ident(logger) operator(&&) ident(logger)operator(.)ident(level) operator(==) ident(log_level) - ident(result) operator(=) pre_constant(nil) - ident(seconds) operator(=) constant(Benchmark)operator(.)ident(realtime) operator({) ident(result) operator(=) ident(use_silence) operator(?) ident(silence) operator({) reserved(yield) operator(}) operator(:) reserved(yield) operator(}) - ident(logger)operator(.)ident(add)operator(()ident(log_level)operator(,) stringcontent( ()inline operator(%) ident(seconds)inline_delimiter(})>content(\))delimiter(")>operator(\)) - ident(result) - reserved(else) - reserved(yield) - reserved(end) - reserved(end) - - comment(# Silences the logger for the duration of the block.) - reserved(def) method(silence) - ident(old_logger_level)operator(,) ident(logger)operator(.)ident(level) operator(=) ident(logger)operator(.)ident(level)operator(,) constant(Logger)operator(::)constant(ERROR) reserved(if) ident(logger) - reserved(yield) - reserved(ensure) - ident(logger)operator(.)ident(level) operator(=) ident(old_logger_level) reserved(if) ident(logger) - reserved(end) - - comment(# Scope parameters to method calls within the block. Takes a hash of method_name => parameters hash.) - comment(# method_name may be :find or :create. :find parameters may include the :conditions, :joins,) - comment(# :include, :offset, :limit, and :readonly options. :create parameters are an attributes hash.) - comment(#) - comment(# Article.with_scope(:find => { :conditions => "blog_id = 1" }, :create => { :blog_id => 1 }\) do) - comment(# Article.find(1\) # => SELECT * from articles WHERE blog_id = 1 AND id = 1) - comment(# a = Article.create(1\)) - comment(# a.blog_id # => 1) - comment(# end) - comment(#) - comment(# In nested scopings, all previous parameters are overwritten by inner rule) - comment(# except :conditions in :find, that are merged as hash.) - comment(#) - comment(# Article.with_scope(:find => { :conditions => "blog_id = 1", :limit => 1 }, :create => { :blog_id => 1 }\) do) - comment(# Article.with_scope(:find => { :limit => 10}\)) - comment(# Article.find(:all\) # => SELECT * from articles WHERE blog_id = 1 LIMIT 10) - comment(# end) - comment(# Article.with_scope(:find => { :conditions => "author_id = 3" }\)) - comment(# Article.find(:all\) # => SELECT * from articles WHERE blog_id = 1 AND author_id = 3 LIMIT 1) - comment(# end) - comment(# end) - comment(#) - comment(# You can ignore any previous scopings by using with_exclusive_scope method.) - comment(#) - comment(# Article.with_scope(:find => { :conditions => "blog_id = 1", :limit => 1 }\) do) - comment(# Article.with_exclusive_scope(:find => { :limit => 10 }\)) - comment(# Article.find(:all\) # => SELECT * from articles LIMIT 10) - comment(# end) - comment(# end) - reserved(def) method(with_scope)operator(()ident(method_scoping) operator(=) operator({)operator(})operator(,) ident(action) operator(=) symbol(:merge)operator(,) operator(&)ident(block)operator(\)) - ident(method_scoping) operator(=) ident(method_scoping)operator(.)ident(method_scoping) reserved(if) ident(method_scoping)operator(.)ident(respond_to?)operator(()symbol(:method_scoping)operator(\)) - - comment(# Dup first and second level of hash (method and params\).) - ident(method_scoping) operator(=) ident(method_scoping)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(hash)operator(,) operator(()ident(method)operator(,) ident(params)operator(\))operator(|) - ident(hash)operator([)ident(method)operator(]) operator(=) operator(()ident(params) operator(==) pre_constant(true)operator(\)) operator(?) ident(params) operator(:) ident(params)operator(.)ident(dup) - ident(hash) - reserved(end) - - ident(method_scoping)operator(.)ident(assert_valid_keys)operator(()operator([) symbol(:find)operator(,) symbol(:create) operator(])operator(\)) - - reserved(if) ident(f) operator(=) ident(method_scoping)operator([)symbol(:find)operator(]) - ident(f)operator(.)ident(assert_valid_keys)operator(()operator([) symbol(:conditions)operator(,) symbol(:joins)operator(,) symbol(:select)operator(,) symbol(:include)operator(,) symbol(:from)operator(,) symbol(:offset)operator(,) symbol(:limit)operator(,) symbol(:readonly) operator(])operator(\)) - ident(f)operator([)symbol(:readonly)operator(]) operator(=) pre_constant(true) reserved(if) operator(!)ident(f)operator([)symbol(:joins)operator(])operator(.)ident(blank?) operator(&&) operator(!)ident(f)operator(.)ident(has_key?)operator(()symbol(:readonly)operator(\)) - reserved(end) - - comment(# Merge scopings) - reserved(if) ident(action) operator(==) symbol(:merge) operator(&&) ident(current_scoped_methods) - ident(method_scoping) operator(=) ident(current_scoped_methods)operator(.)ident(inject)operator(()ident(method_scoping)operator(\)) reserved(do) operator(|)ident(hash)operator(,) operator(()ident(method)operator(,) ident(params)operator(\))operator(|) - reserved(case) ident(hash)operator([)ident(method)operator(]) - reserved(when) constant(Hash) - reserved(if) ident(method) operator(==) symbol(:find) - operator(()ident(hash)operator([)ident(method)operator(])operator(.)ident(keys) operator(+) ident(params)operator(.)ident(keys)operator(\))operator(.)ident(uniq)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(|) - ident(merge) operator(=) ident(hash)operator([)ident(method)operator(])operator([)ident(key)operator(]) operator(&&) ident(params)operator([)ident(key)operator(]) comment(# merge if both scopes have the same key) - reserved(if) ident(key) operator(==) symbol(:conditions) operator(&&) ident(merge) - ident(hash)operator([)ident(method)operator(])operator([)ident(key)operator(]) operator(=) operator([)ident(params)operator([)ident(key)operator(])operator(,) ident(hash)operator([)ident(method)operator(])operator([)ident(key)operator(])operator(])operator(.)ident(collect)operator({) operator(|)ident(sql)operator(|) string operator(%) ident(sanitize_sql)operator(()ident(sql)operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(elsif) ident(key) operator(==) symbol(:include) operator(&&) ident(merge) - ident(hash)operator([)ident(method)operator(])operator([)ident(key)operator(]) operator(=) ident(merge_includes)operator(()ident(hash)operator([)ident(method)operator(])operator([)ident(key)operator(])operator(,) ident(params)operator([)ident(key)operator(])operator(\))operator(.)ident(uniq) - reserved(else) - ident(hash)operator([)ident(method)operator(])operator([)ident(key)operator(]) operator(=) ident(hash)operator([)ident(method)operator(])operator([)ident(key)operator(]) operator(||) ident(params)operator([)ident(key)operator(]) - reserved(end) - reserved(end) - reserved(else) - ident(hash)operator([)ident(method)operator(]) operator(=) ident(params)operator(.)ident(merge)operator(()ident(hash)operator([)ident(method)operator(])operator(\)) - reserved(end) - reserved(else) - ident(hash)operator([)ident(method)operator(]) operator(=) ident(params) - reserved(end) - ident(hash) - reserved(end) - reserved(end) - - pre_constant(self)operator(.)ident(scoped_methods) operator(<<) ident(method_scoping) - - reserved(begin) - reserved(yield) - reserved(ensure) - pre_constant(self)operator(.)ident(scoped_methods)operator(.)ident(pop) - reserved(end) - reserved(end) - - comment(# Works like with_scope, but discards any nested properties.) - reserved(def) method(with_exclusive_scope)operator(()ident(method_scoping) operator(=) operator({)operator(})operator(,) operator(&)ident(block)operator(\)) - ident(with_scope)operator(()ident(method_scoping)operator(,) symbol(:overwrite)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - comment(# Overwrite the default class equality method to provide support for association proxies.) - reserved(def) method(===)operator(()ident(object)operator(\)) - ident(object)operator(.)ident(is_a?)operator(()pre_constant(self)operator(\)) - reserved(end) - - comment(# Deprecated ) - reserved(def) method(threaded_connections) comment(#:nodoc:) - ident(allow_concurrency) - reserved(end) - - comment(# Deprecated ) - reserved(def) method(threaded_connections=)operator(()ident(value)operator(\)) comment(#:nodoc:) - pre_constant(self)operator(.)ident(allow_concurrency) operator(=) ident(value) - reserved(end) - - comment(# Returns the base AR subclass that this class descends from. If A) - comment(# extends AR::Base, A.base_class will return A. If B descends from A) - comment(# through some arbitrarily deep hierarchy, B.base_class will return A.) - reserved(def) method(base_class) - ident(class_of_active_record_descendant)operator(()pre_constant(self)operator(\)) - reserved(end) - - comment(# Set this to true if this is an abstract class (see #abstract_class?\).) - ident(attr_accessor) symbol(:abstract_class) - - comment(# Returns whether this class is a base AR class. If A is a base class and) - comment(# B descends from A, then B.base_class will return B.) - reserved(def) method(abstract_class?) - ident(abstract_class) operator(==) pre_constant(true) - reserved(end) - - ident(private) - reserved(def) method(find_initial)operator(()ident(options)operator(\)) - ident(options)operator(.)ident(update)operator(()symbol(:limit) operator(=)operator(>) integer(1)operator(\)) reserved(unless) ident(options)operator([)symbol(:include)operator(]) - ident(find_every)operator(()ident(options)operator(\))operator(.)ident(first) - reserved(end) - - reserved(def) method(find_every)operator(()ident(options)operator(\)) - ident(records) operator(=) ident(scoped?)operator(()symbol(:find)operator(,) symbol(:include)operator(\)) operator(||) ident(options)operator([)symbol(:include)operator(]) operator(?) - ident(find_with_associations)operator(()ident(options)operator(\)) operator(:) - ident(find_by_sql)operator(()ident(construct_finder_sql)operator(()ident(options)operator(\))operator(\)) - - ident(records)operator(.)ident(each) operator({) operator(|)ident(record)operator(|) ident(record)operator(.)ident(readonly!) operator(}) reserved(if) ident(options)operator([)symbol(:readonly)operator(]) - - ident(records) - reserved(end) - - reserved(def) method(find_from_ids)operator(()ident(ids)operator(,) ident(options)operator(\)) - ident(expects_array) operator(=) ident(ids)operator(.)ident(first)operator(.)ident(kind_of?)operator(()constant(Array)operator(\)) - reserved(return) ident(ids)operator(.)ident(first) reserved(if) ident(expects_array) operator(&&) ident(ids)operator(.)ident(first)operator(.)ident(empty?) - - ident(ids) operator(=) ident(ids)operator(.)ident(flatten)operator(.)ident(compact)operator(.)ident(uniq) - - reserved(case) ident(ids)operator(.)ident(size) - reserved(when) integer(0) - ident(raise) constant(RecordNotFound)operator(,) stringcontent( without an ID)delimiter(")> - reserved(when) integer(1) - ident(result) operator(=) ident(find_one)operator(()ident(ids)operator(.)ident(first)operator(,) ident(options)operator(\)) - ident(expects_array) operator(?) operator([) ident(result) operator(]) operator(:) ident(result) - reserved(else) - ident(find_some)operator(()ident(ids)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(find_one)operator(()ident(id)operator(,) ident(options)operator(\)) - ident(conditions) operator(=) stringcontent(\))delimiter(")> reserved(if) ident(options)operator([)symbol(:conditions)operator(]) - ident(options)operator(.)ident(update) symbol(:conditions) operator(=)operator(>) stringcontent(.)inlinecontent( = )inlineinlinedelimiter(")> - - reserved(if) ident(result) operator(=) ident(find_initial)operator(()ident(options)operator(\)) - ident(result) - reserved(else) - ident(raise) constant(RecordNotFound)operator(,) stringcontent( with ID=)inlineinlinedelimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(find_some)operator(()ident(ids)operator(,) ident(options)operator(\)) - ident(conditions) operator(=) stringcontent(\))delimiter(")> reserved(if) ident(options)operator([)symbol(:conditions)operator(]) - ident(ids_list) operator(=) ident(ids)operator(.)ident(map) operator({) operator(|)ident(id)operator(|) ident(sanitize)operator(()ident(id)operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - ident(options)operator(.)ident(update) symbol(:conditions) operator(=)operator(>) stringcontent(.)inlinecontent( IN ()inlinecontent(\))inlinedelimiter(")> - - ident(result) operator(=) ident(find_every)operator(()ident(options)operator(\)) - - reserved(if) ident(result)operator(.)ident(size) operator(==) ident(ids)operator(.)ident(size) - ident(result) - reserved(else) - ident(raise) constant(RecordNotFound)operator(,) stringcontent( with IDs ()inlinecontent(\))inlinedelimiter(")> - reserved(end) - reserved(end) - - comment(# Finder methods must instantiate through this method to work with the single-table inheritance model) - comment(# that makes it possible to create objects of different types from the same table.) - reserved(def) method(instantiate)operator(()ident(record)operator(\)) - ident(object) operator(=) - reserved(if) ident(subclass_name) operator(=) ident(record)operator([)ident(inheritance_column)operator(]) - reserved(if) ident(subclass_name)operator(.)ident(empty?) - ident(allocate) - reserved(else) - ident(require_association_class)operator(()ident(subclass_name)operator(\)) - reserved(begin) - ident(compute_type)operator(()ident(subclass_name)operator(\))operator(.)ident(allocate) - reserved(rescue) constant(NameError) - ident(raise) constant(SubclassNotFound)operator(,) - stringcontent('. )delimiter(")> operator(+) - stringcontent(' is reserved for storing the class in case of inheritance. )delimiter(")> operator(+) - string operator(+) - stringcontent(.inheritance_column to use another column for that information.)delimiter(")> - reserved(end) - reserved(end) - reserved(else) - ident(allocate) - reserved(end) - - ident(object)operator(.)ident(instance_variable_set)operator(()stringoperator(,) ident(record)operator(\)) - ident(object) - reserved(end) - - comment(# Nest the type name in the same module as this class.) - comment(# Bar is "MyApp::Business::Bar" relative to MyApp::Business::Foo) - reserved(def) method(type_name_with_module)operator(()ident(type_name)operator(\)) - operator(()regexp operator(=)operator(~) ident(type_name)operator(\)) operator(?) ident(type_name) operator(:) stringcontent(::)inlinedelimiter(")> - reserved(end) - - reserved(def) method(construct_finder_sql)operator(()ident(options)operator(\)) - ident(scope) operator(=) ident(scope)operator(()symbol(:find)operator(\)) - ident(sql) operator(=) stringinline_delimiter(})>content( )delimiter(")> - ident(sql) operator(<<) stringcontent( )delimiter(")> - - ident(add_joins!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(scope)operator(\)) - ident(add_conditions!)operator(()ident(sql)operator(,) ident(options)operator([)symbol(:conditions)operator(])operator(,) ident(scope)operator(\)) - - ident(sql) operator(<<) stringcontent( )delimiter(")> reserved(if) ident(options)operator([)symbol(:group)operator(]) - ident(sql) operator(<<) stringcontent( )delimiter(")> reserved(if) ident(options)operator([)symbol(:order)operator(]) - - ident(add_limit!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(scope)operator(\)) - - ident(sql) - reserved(end) - - comment(# Merges includes so that the result is a valid +include+) - reserved(def) method(merge_includes)operator(()ident(first)operator(,) ident(second)operator(\)) - ident(safe_to_array)operator(()ident(first)operator(\)) operator(+) ident(safe_to_array)operator(()ident(second)operator(\)) - reserved(end) - - comment(# Object#to_a is deprecated, though it does have the desired behaviour) - reserved(def) method(safe_to_array)operator(()ident(o)operator(\)) - reserved(case) ident(o) - reserved(when) constant(NilClass) - operator([)operator(]) - reserved(when) constant(Array) - ident(o) - reserved(else) - operator([)ident(o)operator(]) - reserved(end) - reserved(end) - - comment(# The optional scope argument is for the current :find scope.) - reserved(def) method(add_limit!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(scope) operator(=) symbol(:auto)operator(\)) - ident(scope) operator(=) ident(scope)operator(()symbol(:find)operator(\)) reserved(if) symbol(:auto) operator(==) ident(scope) - reserved(if) ident(scope) - ident(options)operator([)symbol(:limit)operator(]) operator(||=) ident(scope)operator([)symbol(:limit)operator(]) - ident(options)operator([)symbol(:offset)operator(]) operator(||=) ident(scope)operator([)symbol(:offset)operator(]) - reserved(end) - ident(connection)operator(.)ident(add_limit_offset!)operator(()ident(sql)operator(,) ident(options)operator(\)) - reserved(end) - - comment(# The optional scope argument is for the current :find scope.) - reserved(def) method(add_joins!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(scope) operator(=) symbol(:auto)operator(\)) - ident(scope) operator(=) ident(scope)operator(()symbol(:find)operator(\)) reserved(if) symbol(:auto) operator(==) ident(scope) - ident(join) operator(=) operator(()ident(scope) operator(&&) ident(scope)operator([)symbol(:joins)operator(])operator(\)) operator(||) ident(options)operator([)symbol(:joins)operator(]) - ident(sql) operator(<<) stringcontent( )delimiter(")> reserved(if) ident(join) - reserved(end) - - comment(# Adds a sanitized version of +conditions+ to the +sql+ string. Note that the passed-in +sql+ string is changed.) - comment(# The optional scope argument is for the current :find scope.) - reserved(def) method(add_conditions!)operator(()ident(sql)operator(,) ident(conditions)operator(,) ident(scope) operator(=) symbol(:auto)operator(\)) - ident(scope) operator(=) ident(scope)operator(()symbol(:find)operator(\)) reserved(if) symbol(:auto) operator(==) ident(scope) - ident(segments) operator(=) operator([)operator(]) - ident(segments) operator(<<) ident(sanitize_sql)operator(()ident(scope)operator([)symbol(:conditions)operator(])operator(\)) reserved(if) ident(scope) operator(&&) ident(scope)operator([)symbol(:conditions)operator(]) - ident(segments) operator(<<) ident(sanitize_sql)operator(()ident(conditions)operator(\)) reserved(unless) ident(conditions)operator(.)ident(nil?) - ident(segments) operator(<<) ident(type_condition) reserved(unless) ident(descends_from_active_record?) - ident(segments)operator(.)ident(compact!) - ident(sql) operator(<<) stringoperator(\))inline_delimiter(})>content(\) )delimiter(")> reserved(unless) ident(segments)operator(.)ident(empty?) - reserved(end) - - reserved(def) method(type_condition) - ident(quoted_inheritance_column) operator(=) ident(connection)operator(.)ident(quote_column_name)operator(()ident(inheritance_column)operator(\)) - ident(type_condition) operator(=) ident(subclasses)operator(.)ident(inject)operator(()stringcontent(.)inlinecontent( = ')inlinecontent(' )delimiter(")>operator(\)) reserved(do) operator(|)ident(condition)operator(,) ident(subclass)operator(|) - ident(condition) operator(<<) stringcontent(.)inlinecontent( = ')inlinecontent(' )delimiter(")> - reserved(end) - - stringcontent(\) )delimiter(")> - reserved(end) - - comment(# Guesses the table name, but does not decorate it with prefix and suffix information.) - reserved(def) method(undecorated_table_name)operator(()ident(class_name) operator(=) ident(base_class)operator(.)ident(name)operator(\)) - ident(table_name) operator(=) constant(Inflector)operator(.)ident(underscore)operator(()constant(Inflector)operator(.)ident(demodulize)operator(()ident(class_name)operator(\))operator(\)) - ident(table_name) operator(=) constant(Inflector)operator(.)ident(pluralize)operator(()ident(table_name)operator(\)) reserved(if) ident(pluralize_table_names) - ident(table_name) - reserved(end) - - comment(# Enables dynamic finders like find_by_user_name(user_name\) and find_by_user_name_and_password(user_name, password\) that are turned into) - comment(# find(:first, :conditions => ["user_name = ?", user_name]\) and find(:first, :conditions => ["user_name = ? AND password = ?", user_name, password]\)) - comment(# respectively. Also works for find(:all\), but using find_all_by_amount(50\) that are turned into find(:all, :conditions => ["amount = ?", 50]\).) - comment(#) - comment(# It's even possible to use all the additional parameters to find. For example, the full interface for find_all_by_amount) - comment(# is actually find_all_by_amount(amount, options\).) - reserved(def) method(method_missing)operator(()ident(method_id)operator(,) operator(*)ident(arguments)operator(\)) - reserved(if) ident(match) operator(=) regexpoperator(.)ident(match)operator(()ident(method_id)operator(.)ident(to_s)operator(\)) - ident(finder)operator(,) ident(deprecated_finder) operator(=) ident(determine_finder)operator(()ident(match)operator(\))operator(,) ident(determine_deprecated_finder)operator(()ident(match)operator(\)) - - ident(attribute_names) operator(=) ident(extract_attribute_names_from_match)operator(()ident(match)operator(\)) - reserved(super) reserved(unless) ident(all_attributes_exists?)operator(()ident(attribute_names)operator(\)) - - ident(conditions) operator(=) ident(construct_conditions_from_arguments)operator(()ident(attribute_names)operator(,) ident(arguments)operator(\)) - - reserved(case) ident(extra_options) operator(=) ident(arguments)operator([)ident(attribute_names)operator(.)ident(size)operator(]) - reserved(when) pre_constant(nil) - ident(options) operator(=) operator({) symbol(:conditions) operator(=)operator(>) ident(conditions) operator(}) - ident(set_readonly_option!)operator(()ident(options)operator(\)) - ident(send)operator(()ident(finder)operator(,) ident(options)operator(\)) - - reserved(when) constant(Hash) - ident(finder_options) operator(=) ident(extra_options)operator(.)ident(merge)operator(()symbol(:conditions) operator(=)operator(>) ident(conditions)operator(\)) - ident(validate_find_options)operator(()ident(finder_options)operator(\)) - ident(set_readonly_option!)operator(()ident(finder_options)operator(\)) - - reserved(if) ident(extra_options)operator([)symbol(:conditions)operator(]) - ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) ident(extra_options)operator([)symbol(:conditions)operator(]) operator(})operator(\)) reserved(do) - ident(send)operator(()ident(finder)operator(,) ident(finder_options)operator(\)) - reserved(end) - reserved(else) - ident(send)operator(()ident(finder)operator(,) ident(finder_options)operator(\)) - reserved(end) - - reserved(else) - ident(send)operator(()ident(deprecated_finder)operator(,) ident(conditions)operator(,) operator(*)ident(arguments)operator([)ident(attribute_names)operator(.)ident(length)operator(..)integer(-1)operator(])operator(\)) comment(# deprecated API) - reserved(end) - reserved(elsif) ident(match) operator(=) regexpoperator(.)ident(match)operator(()ident(method_id)operator(.)ident(to_s)operator(\)) - ident(attribute_names) operator(=) ident(extract_attribute_names_from_match)operator(()ident(match)operator(\)) - reserved(super) reserved(unless) ident(all_attributes_exists?)operator(()ident(attribute_names)operator(\)) - - ident(options) operator(=) operator({) symbol(:conditions) operator(=)operator(>) ident(construct_conditions_from_arguments)operator(()ident(attribute_names)operator(,) ident(arguments)operator(\)) operator(}) - ident(set_readonly_option!)operator(()ident(options)operator(\)) - ident(find_initial)operator(()ident(options)operator(\)) operator(||) ident(create)operator(()ident(construct_attributes_from_arguments)operator(()ident(attribute_names)operator(,) ident(arguments)operator(\))operator(\)) - reserved(else) - reserved(super) - reserved(end) - reserved(end) - - reserved(def) method(determine_finder)operator(()ident(match)operator(\)) - ident(match)operator(.)ident(captures)operator(.)ident(first) operator(==) string operator(?) symbol(:find_every) operator(:) symbol(:find_initial) - reserved(end) - - reserved(def) method(determine_deprecated_finder)operator(()ident(match)operator(\)) - ident(match)operator(.)ident(captures)operator(.)ident(first) operator(==) string operator(?) symbol(:find_all) operator(:) symbol(:find_first) - reserved(end) - - reserved(def) method(extract_attribute_names_from_match)operator(()ident(match)operator(\)) - ident(match)operator(.)ident(captures)operator(.)ident(last)operator(.)ident(split)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(construct_conditions_from_arguments)operator(()ident(attribute_names)operator(,) ident(arguments)operator(\)) - ident(conditions) operator(=) operator([)operator(]) - ident(attribute_names)operator(.)ident(each_with_index) operator({) operator(|)ident(name)operator(,) ident(idx)operator(|) ident(conditions) operator(<<) stringcontent(.)inlinecontent( )inlinecontent( )delimiter(")> operator(}) - operator([) ident(conditions)operator(.)ident(join)operator(()stringoperator(\))operator(,) operator(*)ident(arguments)operator([)integer(0)operator(...)ident(attribute_names)operator(.)ident(length)operator(]) operator(]) - reserved(end) - - reserved(def) method(construct_attributes_from_arguments)operator(()ident(attribute_names)operator(,) ident(arguments)operator(\)) - ident(attributes) operator(=) operator({)operator(}) - ident(attribute_names)operator(.)ident(each_with_index) operator({) operator(|)ident(name)operator(,) ident(idx)operator(|) ident(attributes)operator([)ident(name)operator(]) operator(=) ident(arguments)operator([)ident(idx)operator(]) operator(}) - ident(attributes) - reserved(end) - - reserved(def) method(all_attributes_exists?)operator(()ident(attribute_names)operator(\)) - ident(attribute_names)operator(.)ident(all?) operator({) operator(|)ident(name)operator(|) ident(column_methods_hash)operator(.)ident(include?)operator(()ident(name)operator(.)ident(to_sym)operator(\)) operator(}) - reserved(end) - - reserved(def) method(attribute_condition)operator(()ident(argument)operator(\)) - reserved(case) ident(argument) - reserved(when) pre_constant(nil) reserved(then) string - reserved(when) constant(Array) reserved(then) string - reserved(else) string - reserved(end) - reserved(end) - - comment(# Defines an "attribute" method (like #inheritance_column or) - comment(# #table_name\). A new (class\) method will be created with the) - comment(# given name. If a value is specified, the new method will) - comment(# return that value (as a string\). Otherwise, the given block) - comment(# will be used to compute the value of the method.) - comment(#) - comment(# The original method will be aliased, with the new name being) - comment(# prefixed with "original_". This allows the new method to) - comment(# access the original value.) - comment(#) - comment(# Example:) - comment(#) - comment(# class A < ActiveRecord::Base) - comment(# define_attr_method :primary_key, "sysid") - comment(# define_attr_method( :inheritance_column \) do) - comment(# original_inheritance_column + "_id") - comment(# end) - comment(# end) - reserved(def) method(define_attr_method)operator(()ident(name)operator(,) ident(value)operator(=)pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - ident(sing) operator(=) reserved(class) operator(<<) class(self)operator(;) pre_constant(self)operator(;) reserved(end) - ident(sing)operator(.)ident(send) symbol(:alias_method)operator(,) stringdelimiter(")>operator(,) ident(name) - reserved(if) ident(block_given?) - ident(sing)operator(.)ident(send) symbol(:define_method)operator(,) ident(name)operator(,) operator(&)ident(block) - reserved(else) - comment(# use eval instead of a block to work around a memory leak in dev) - comment(# mode in fcgi) - ident(sing)operator(.)ident(class_eval) stringcontent(; )inlinecontent(; end)delimiter(")> - reserved(end) - reserved(end) - - ident(protected) - reserved(def) method(subclasses) comment(#:nodoc:) - class_variable(@@subclasses)operator([)pre_constant(self)operator(]) operator(||=) operator([)operator(]) - class_variable(@@subclasses)operator([)pre_constant(self)operator(]) operator(+) ident(extra) operator(=) class_variable(@@subclasses)operator([)pre_constant(self)operator(])operator(.)ident(inject)operator(()operator([)operator(])operator(\)) operator({)operator(|)ident(list)operator(,) ident(subclass)operator(|) ident(list) operator(+) ident(subclass)operator(.)ident(subclasses) operator(}) - reserved(end) - - comment(# Test whether the given method and optional key are scoped.) - reserved(def) method(scoped?)operator(()ident(method)operator(,) ident(key) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - reserved(if) ident(current_scoped_methods) operator(&&) operator(()ident(scope) operator(=) ident(current_scoped_methods)operator([)ident(method)operator(])operator(\)) - operator(!)ident(key) operator(||) ident(scope)operator(.)ident(has_key?)operator(()ident(key)operator(\)) - reserved(end) - reserved(end) - - comment(# Retrieve the scope for the given method and optional key.) - reserved(def) method(scope)operator(()ident(method)operator(,) ident(key) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - reserved(if) ident(current_scoped_methods) operator(&&) operator(()ident(scope) operator(=) ident(current_scoped_methods)operator([)ident(method)operator(])operator(\)) - ident(key) operator(?) ident(scope)operator([)ident(key)operator(]) operator(:) ident(scope) - reserved(end) - reserved(end) - - reserved(def) method(thread_safe_scoped_methods) comment(#:nodoc:) - ident(scoped_methods) operator(=) operator(()constant(Thread)operator(.)ident(current)operator([)symbol(:scoped_methods)operator(]) operator(||=) operator({)operator(})operator(\)) - ident(scoped_methods)operator([)pre_constant(self)operator(]) operator(||=) operator([)operator(]) - reserved(end) - - reserved(def) method(single_threaded_scoped_methods) comment(#:nodoc:) - instance_variable(@scoped_methods) operator(||=) operator([)operator(]) - reserved(end) - - comment(# pick up the correct scoped_methods version from @@allow_concurrency) - reserved(if) class_variable(@@allow_concurrency) - ident(alias_method) symbol(:scoped_methods)operator(,) symbol(:thread_safe_scoped_methods) - reserved(else) - ident(alias_method) symbol(:scoped_methods)operator(,) symbol(:single_threaded_scoped_methods) - reserved(end) - - reserved(def) method(current_scoped_methods) comment(#:nodoc:) - ident(scoped_methods)operator(.)ident(last) - reserved(end) - - comment(# Returns the class type of the record using the current module as a prefix. So descendents of) - comment(# MyApp::Business::Account would appear as MyApp::Business::AccountSubclass.) - reserved(def) method(compute_type)operator(()ident(type_name)operator(\)) - ident(modularized_name) operator(=) ident(type_name_with_module)operator(()ident(type_name)operator(\)) - reserved(begin) - ident(instance_eval)operator(()ident(modularized_name)operator(\)) - reserved(rescue) constant(NameError) operator(=)operator(>) ident(e) - ident(instance_eval)operator(()ident(type_name)operator(\)) - reserved(end) - reserved(end) - - comment(# Returns the class descending directly from ActiveRecord in the inheritance hierarchy.) - reserved(def) method(class_of_active_record_descendant)operator(()ident(klass)operator(\)) - reserved(if) ident(klass)operator(.)ident(superclass) operator(==) constant(Base) operator(||) ident(klass)operator(.)ident(superclass)operator(.)ident(abstract_class?) - ident(klass) - reserved(elsif) ident(klass)operator(.)ident(superclass)operator(.)ident(nil?) - ident(raise) constant(ActiveRecordError)operator(,) stringcontent( doesn't belong in a hierarchy descending from ActiveRecord)delimiter(")> - reserved(else) - ident(class_of_active_record_descendant)operator(()ident(klass)operator(.)ident(superclass)operator(\)) - reserved(end) - reserved(end) - - comment(# Returns the name of the class descending directly from ActiveRecord in the inheritance hierarchy.) - reserved(def) method(class_name_of_active_record_descendant)operator(()ident(klass)operator(\)) comment(#:nodoc:) - ident(klass)operator(.)ident(base_class)operator(.)ident(name) - reserved(end) - - comment(# Accepts an array or string. The string is returned untouched, but the array has each value) - comment(# sanitized and interpolated into the sql statement.) - comment(# ["name='%s' and group_id='%s'", "foo'bar", 4] returns "name='foo''bar' and group_id='4'") - reserved(def) method(sanitize_sql)operator(()ident(ary)operator(\)) - reserved(return) ident(ary) reserved(unless) ident(ary)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - - ident(statement)operator(,) operator(*)ident(values) operator(=) ident(ary) - reserved(if) ident(values)operator(.)ident(first)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) reserved(and) ident(statement) operator(=)operator(~) regexp - ident(replace_named_bind_variables)operator(()ident(statement)operator(,) ident(values)operator(.)ident(first)operator(\)) - reserved(elsif) ident(statement)operator(.)ident(include?)operator(()stringoperator(\)) - ident(replace_bind_variables)operator(()ident(statement)operator(,) ident(values)operator(\)) - reserved(else) - ident(statement) operator(%) ident(values)operator(.)ident(collect) operator({) operator(|)ident(value)operator(|) ident(connection)operator(.)ident(quote_string)operator(()ident(value)operator(.)ident(to_s)operator(\)) operator(}) - reserved(end) - reserved(end) - - ident(alias_method) symbol(:sanitize_conditions)operator(,) symbol(:sanitize_sql) - - reserved(def) method(replace_bind_variables)operator(()ident(statement)operator(,) ident(values)operator(\)) comment(#:nodoc:) - ident(raise_if_bind_arity_mismatch)operator(()ident(statement)operator(,) ident(statement)operator(.)ident(count)operator(()stringoperator(\))operator(,) ident(values)operator(.)ident(size)operator(\)) - ident(bound) operator(=) ident(values)operator(.)ident(dup) - ident(statement)operator(.)ident(gsub)operator(()stringoperator(\)) operator({) ident(quote_bound_value)operator(()ident(bound)operator(.)ident(shift)operator(\)) operator(}) - reserved(end) - - reserved(def) method(replace_named_bind_variables)operator(()ident(statement)operator(,) ident(bind_vars)operator(\)) comment(#:nodoc:) - ident(statement)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) - ident(match) operator(=) global_variable($1)operator(.)ident(to_sym) - reserved(if) ident(bind_vars)operator(.)ident(include?)operator(()ident(match)operator(\)) - ident(quote_bound_value)operator(()ident(bind_vars)operator([)ident(match)operator(])operator(\)) - reserved(else) - ident(raise) constant(PreparedStatementInvalid)operator(,) stringcontent( in )inlinedelimiter(")> - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(quote_bound_value)operator(()ident(value)operator(\)) comment(#:nodoc:) - reserved(if) operator(()ident(value)operator(.)ident(respond_to?)operator(()symbol(:map)operator(\)) operator(&&) operator(!)ident(value)operator(.)ident(is_a?)operator(()constant(String)operator(\))operator(\)) - ident(value)operator(.)ident(map) operator({) operator(|)ident(v)operator(|) ident(connection)operator(.)ident(quote)operator(()ident(v)operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(else) - ident(connection)operator(.)ident(quote)operator(()ident(value)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(raise_if_bind_arity_mismatch)operator(()ident(statement)operator(,) ident(expected)operator(,) ident(provided)operator(\)) comment(#:nodoc:) - reserved(unless) ident(expected) operator(==) ident(provided) - ident(raise) constant(PreparedStatementInvalid)operator(,) stringcontent( for )inlinecontent(\) in: )inlinedelimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(extract_options_from_args!)operator(()ident(args)operator(\)) comment(#:nodoc:) - ident(args)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(args)operator(.)ident(pop) operator(:) operator({)operator(}) - reserved(end) - - constant(VALID_FIND_OPTIONS) operator(=) operator([) symbol(:conditions)operator(,) symbol(:include)operator(,) symbol(:joins)operator(,) symbol(:limit)operator(,) symbol(:offset)operator(,) - symbol(:order)operator(,) symbol(:select)operator(,) symbol(:readonly)operator(,) symbol(:group)operator(,) symbol(:from) operator(]) - - reserved(def) method(validate_find_options)operator(()ident(options)operator(\)) comment(#:nodoc:) - ident(options)operator(.)ident(assert_valid_keys)operator(()constant(VALID_FIND_OPTIONS)operator(\)) - reserved(end) - - reserved(def) method(set_readonly_option!)operator(()ident(options)operator(\)) comment(#:nodoc:) - comment(# Inherit :readonly from finder scope if set. Otherwise,) - comment(# if :joins is not blank then :readonly defaults to true.) - reserved(unless) ident(options)operator(.)ident(has_key?)operator(()symbol(:readonly)operator(\)) - reserved(if) ident(scoped?)operator(()symbol(:find)operator(,) symbol(:readonly)operator(\)) - ident(options)operator([)symbol(:readonly)operator(]) operator(=) ident(scope)operator(()symbol(:find)operator(,) symbol(:readonly)operator(\)) - reserved(elsif) operator(!)ident(options)operator([)symbol(:joins)operator(])operator(.)ident(blank?) operator(&&) operator(!)ident(options)operator([)symbol(:select)operator(]) - ident(options)operator([)symbol(:readonly)operator(]) operator(=) pre_constant(true) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(encode_quoted_value)operator(()ident(value)operator(\)) comment(#:nodoc:) - ident(quoted_value) operator(=) ident(connection)operator(.)ident(quote)operator(()ident(value)operator(\)) - ident(quoted_value) operator(=) stringoperator(,) stringoperator(\))inline_delimiter(})>content(')delimiter(")> reserved(if) ident(quoted_value)operator(.)ident(include?)operator(()stringoperator(\)) comment(# (for ruby mode\) " ) - ident(quoted_value) - reserved(end) - reserved(end) - - ident(public) - comment(# New objects can be instantiated as either empty (pass no construction parameter\) or pre-set with) - comment(# attributes but not yet saved (pass a hash with key names matching the associated table column names\).) - comment(# In both instances, valid attribute keys are determined by the column names of the associated table --) - comment(# hence you can't have attributes that aren't part of the table columns.) - reserved(def) method(initialize)operator(()ident(attributes) operator(=) pre_constant(nil)operator(\)) - instance_variable(@attributes) operator(=) ident(attributes_from_column_definition) - instance_variable(@new_record) operator(=) pre_constant(true) - ident(ensure_proper_type) - pre_constant(self)operator(.)ident(attributes) operator(=) ident(attributes) reserved(unless) ident(attributes)operator(.)ident(nil?) - reserved(yield) pre_constant(self) reserved(if) ident(block_given?) - reserved(end) - - comment(# A model instance's primary key is always available as model.id) - comment(# whether you name it the default 'id' or set it to something else.) - reserved(def) method(id) - ident(attr_name) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key) - ident(column) operator(=) ident(column_for_attribute)operator(()ident(attr_name)operator(\)) - ident(define_read_method)operator(()symbol(:id)operator(,) ident(attr_name)operator(,) ident(column)operator(\)) reserved(if) pre_constant(self)operator(.)ident(class)operator(.)ident(generate_read_methods) - ident(read_attribute)operator(()ident(attr_name)operator(\)) - reserved(end) - - comment(# Enables Active Record objects to be used as URL parameters in Action Pack automatically.) - ident(alias_method) symbol(:to_param)operator(,) symbol(:id) - - reserved(def) method(id_before_type_cast) comment(#:nodoc:) - ident(read_attribute_before_type_cast)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(\)) - reserved(end) - - reserved(def) method(quoted_id) comment(#:nodoc:) - ident(quote)operator(()ident(id)operator(,) ident(column_for_attribute)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(\))operator(\)) - reserved(end) - - comment(# Sets the primary ID.) - reserved(def) method(id=)operator(()ident(value)operator(\)) - ident(write_attribute)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(,) ident(value)operator(\)) - reserved(end) - - comment(# Returns true if this object hasn't been saved yet -- that is, a record for the object doesn't exist yet.) - reserved(def) method(new_record?) - instance_variable(@new_record) - reserved(end) - - comment(# * No record exists: Creates a new record with values matching those of the object attributes.) - comment(# * A record does exist: Updates the record with values matching those of the object attributes.) - reserved(def) method(save) - ident(raise) constant(ReadOnlyRecord) reserved(if) ident(readonly?) - ident(create_or_update) - reserved(end) - - comment(# Attempts to save the record, but instead of just returning false if it couldn't happen, it raises a ) - comment(# RecordNotSaved exception) - reserved(def) method(save!) - ident(save) operator(||) ident(raise)operator(()constant(RecordNotSaved)operator(\)) - reserved(end) - - comment(# Deletes the record in the database and freezes this instance to reflect that no changes should) - comment(# be made (since they can't be persisted\).) - reserved(def) method(destroy) - reserved(unless) ident(new_record?) - ident(connection)operator(.)ident(delete) stringoperator(,) stringcontent( Destroy)delimiter(")>stringcontent( - WHERE )inlinecontent( = )inlinedelimiter( - end_sql)> - reserved(end) - - ident(freeze) - reserved(end) - - comment(# Returns a clone of the record that hasn't been assigned an id yet and) - comment(# is treated as a new record. Note that this is a "shallow" clone:) - comment(# it copies the object's attributes only, not its associations.) - comment(# The extent of a "deep" clone is application-specific and is therefore) - comment(# left to the application to implement according to its need.) - reserved(def) method(clone) - ident(attrs) operator(=) pre_constant(self)operator(.)ident(attributes_before_type_cast) - ident(attrs)operator(.)ident(delete)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(new) reserved(do) operator(|)ident(record)operator(|) - ident(record)operator(.)ident(send) symbol(:instance_variable_set)operator(,) stringoperator(,) ident(attrs) - reserved(end) - reserved(end) - - comment(# Updates a single attribute and saves the record. This is especially useful for boolean flags on existing records.) - comment(# Note: This method is overwritten by the Validation module that'll make sure that updates made with this method) - comment(# doesn't get subjected to validation checks. Hence, attributes can be updated even if the full object isn't valid.) - reserved(def) method(update_attribute)operator(()ident(name)operator(,) ident(value)operator(\)) - ident(send)operator(()ident(name)operator(.)ident(to_s) operator(+) stringoperator(,) ident(value)operator(\)) - ident(save) - reserved(end) - - comment(# Updates all the attributes from the passed-in Hash and saves the record. If the object is invalid, the saving will) - comment(# fail and false will be returned.) - reserved(def) method(update_attributes)operator(()ident(attributes)operator(\)) - pre_constant(self)operator(.)ident(attributes) operator(=) ident(attributes) - ident(save) - reserved(end) - - comment(# Initializes the +attribute+ to zero if nil and adds one. Only makes sense for number-based attributes. Returns self.) - reserved(def) method(increment)operator(()ident(attribute)operator(\)) - pre_constant(self)operator([)ident(attribute)operator(]) operator(||=) integer(0) - pre_constant(self)operator([)ident(attribute)operator(]) operator(+=) integer(1) - pre_constant(self) - reserved(end) - - comment(# Increments the +attribute+ and saves the record.) - reserved(def) method(increment!)operator(()ident(attribute)operator(\)) - ident(increment)operator(()ident(attribute)operator(\))operator(.)ident(update_attribute)operator(()ident(attribute)operator(,) pre_constant(self)operator([)ident(attribute)operator(])operator(\)) - reserved(end) - - comment(# Initializes the +attribute+ to zero if nil and subtracts one. Only makes sense for number-based attributes. Returns self.) - reserved(def) method(decrement)operator(()ident(attribute)operator(\)) - pre_constant(self)operator([)ident(attribute)operator(]) operator(||=) integer(0) - pre_constant(self)operator([)ident(attribute)operator(]) operator(-=) integer(1) - pre_constant(self) - reserved(end) - - comment(# Decrements the +attribute+ and saves the record.) - reserved(def) method(decrement!)operator(()ident(attribute)operator(\)) - ident(decrement)operator(()ident(attribute)operator(\))operator(.)ident(update_attribute)operator(()ident(attribute)operator(,) pre_constant(self)operator([)ident(attribute)operator(])operator(\)) - reserved(end) - - comment(# Turns an +attribute+ that's currently true into false and vice versa. Returns self.) - reserved(def) method(toggle)operator(()ident(attribute)operator(\)) - pre_constant(self)operator([)ident(attribute)operator(]) operator(=) operator(!)ident(send)operator(()stringcontent(?)delimiter(")>operator(\)) - pre_constant(self) - reserved(end) - - comment(# Toggles the +attribute+ and saves the record.) - reserved(def) method(toggle!)operator(()ident(attribute)operator(\)) - ident(toggle)operator(()ident(attribute)operator(\))operator(.)ident(update_attribute)operator(()ident(attribute)operator(,) pre_constant(self)operator([)ident(attribute)operator(])operator(\)) - reserved(end) - - comment(# Reloads the attributes of this object from the database.) - reserved(def) method(reload) - ident(clear_aggregation_cache) - ident(clear_association_cache) - instance_variable(@attributes)operator(.)ident(update)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(find)operator(()pre_constant(self)operator(.)ident(id)operator(\))operator(.)ident(instance_variable_get)operator(()stringoperator(\))operator(\)) - pre_constant(self) - reserved(end) - - comment(# Returns the value of the attribute identified by attr_name after it has been typecast (for example,) - comment(# "2004-12-12" in a data column is cast to a date object, like Date.new(2004, 12, 12\)\).) - comment(# (Alias for the protected read_attribute method\).) - reserved(def) method([])operator(()ident(attr_name)operator(\)) - ident(read_attribute)operator(()ident(attr_name)operator(\)) - reserved(end) - - comment(# Updates the attribute identified by attr_name with the specified +value+.) - comment(# (Alias for the protected write_attribute method\).) - reserved(def) method([]=)operator(()ident(attr_name)operator(,) ident(value)operator(\)) - ident(write_attribute)operator(()ident(attr_name)operator(,) ident(value)operator(\)) - reserved(end) - - comment(# Allows you to set all the attributes at once by passing in a hash with keys) - comment(# matching the attribute names (which again matches the column names\). Sensitive attributes can be protected) - comment(# from this form of mass-assignment by using the +attr_protected+ macro. Or you can alternatively) - comment(# specify which attributes *can* be accessed in with the +attr_accessible+ macro. Then all the) - comment(# attributes not included in that won't be allowed to be mass-assigned.) - reserved(def) method(attributes=)operator(()ident(new_attributes)operator(\)) - reserved(return) reserved(if) ident(new_attributes)operator(.)ident(nil?) - ident(attributes) operator(=) ident(new_attributes)operator(.)ident(dup) - ident(attributes)operator(.)ident(stringify_keys!) - - ident(multi_parameter_attributes) operator(=) operator([)operator(]) - ident(remove_attributes_protected_from_mass_assignment)operator(()ident(attributes)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,) ident(v)operator(|) - ident(k)operator(.)ident(include?)operator(()stringoperator(\)) operator(?) ident(multi_parameter_attributes) operator(<<) operator([) ident(k)operator(,) ident(v) operator(]) operator(:) ident(send)operator(()ident(k) operator(+) stringoperator(,) ident(v)operator(\)) - reserved(end) - - ident(assign_multiparameter_attributes)operator(()ident(multi_parameter_attributes)operator(\)) - reserved(end) - - - comment(# Returns a hash of all the attributes with their names as keys and clones of their objects as values.) - reserved(def) method(attributes)operator(()ident(options) operator(=) pre_constant(nil)operator(\)) - ident(attributes) operator(=) ident(clone_attributes) symbol(:read_attribute) - - reserved(if) ident(options)operator(.)ident(nil?) - ident(attributes) - reserved(else) - reserved(if) ident(except) operator(=) ident(options)operator([)symbol(:except)operator(]) - ident(except) operator(=) ident(Array)operator(()ident(except)operator(\))operator(.)ident(collect) operator({) operator(|)ident(attribute)operator(|) ident(attribute)operator(.)ident(to_s) operator(}) - ident(except)operator(.)ident(each) operator({) operator(|)ident(attribute_name)operator(|) ident(attributes)operator(.)ident(delete)operator(()ident(attribute_name)operator(\)) operator(}) - ident(attributes) - reserved(elsif) ident(only) operator(=) ident(options)operator([)symbol(:only)operator(]) - ident(only) operator(=) ident(Array)operator(()ident(only)operator(\))operator(.)ident(collect) operator({) operator(|)ident(attribute)operator(|) ident(attribute)operator(.)ident(to_s) operator(}) - ident(attributes)operator(.)ident(delete_if) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) operator(!)ident(only)operator(.)ident(include?)operator(()ident(key)operator(\)) operator(}) - ident(attributes) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) stringcontent(\))delimiter(")> - reserved(end) - reserved(end) - reserved(end) - - comment(# Returns a hash of cloned attributes before typecasting and deserialization.) - reserved(def) method(attributes_before_type_cast) - ident(clone_attributes) symbol(:read_attribute_before_type_cast) - reserved(end) - - comment(# Returns true if the specified +attribute+ has been set by the user or by a database load and is neither) - comment(# nil nor empty? (the latter only applies to objects that respond to empty?, most notably Strings\).) - reserved(def) method(attribute_present?)operator(()ident(attribute)operator(\)) - ident(value) operator(=) ident(read_attribute)operator(()ident(attribute)operator(\)) - operator(!)ident(value)operator(.)ident(blank?) reserved(or) ident(value) operator(==) integer(0) - reserved(end) - - comment(# Returns true if the given attribute is in the attributes hash) - reserved(def) method(has_attribute?)operator(()ident(attr_name)operator(\)) - instance_variable(@attributes)operator(.)ident(has_key?)operator(()ident(attr_name)operator(.)ident(to_s)operator(\)) - reserved(end) - - comment(# Returns an array of names for the attributes available on this object sorted alphabetically.) - reserved(def) method(attribute_names) - instance_variable(@attributes)operator(.)ident(keys)operator(.)ident(sort) - reserved(end) - - comment(# Returns the column object for the named attribute.) - reserved(def) method(column_for_attribute)operator(()ident(name)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(columns_hash)operator([)ident(name)operator(.)ident(to_s)operator(]) - reserved(end) - - comment(# Returns true if the +comparison_object+ is the same object, or is of the same type and has the same id.) - reserved(def) method(==)operator(()ident(comparison_object)operator(\)) - ident(comparison_object)operator(.)ident(equal?)operator(()pre_constant(self)operator(\)) operator(||) - operator(()ident(comparison_object)operator(.)ident(instance_of?)operator(()pre_constant(self)operator(.)ident(class)operator(\)) operator(&&) - ident(comparison_object)operator(.)ident(id) operator(==) ident(id) operator(&&) - operator(!)ident(comparison_object)operator(.)ident(new_record?)operator(\)) - reserved(end) - - comment(# Delegates to ==) - reserved(def) method(eql?)operator(()ident(comparison_object)operator(\)) - pre_constant(self) operator(==) operator(()ident(comparison_object)operator(\)) - reserved(end) - - comment(# Delegates to id in order to allow two records of the same type and id to work with something like:) - comment(# [ Person.find(1\), Person.find(2\), Person.find(3\) ] & [ Person.find(1\), Person.find(4\) ] # => [ Person.find(1\) ]) - reserved(def) method(hash) - ident(id)operator(.)ident(hash) - reserved(end) - - comment(# For checking respond_to? without searching the attributes (which is faster\).) - ident(alias_method) symbol(:respond_to_without_attributes?)operator(,) symbol(:respond_to?) - - comment(# A Person object with a name attribute can ask person.respond_to?("name"\), person.respond_to?("name="\), and) - comment(# person.respond_to?("name?"\) which will all return true.) - reserved(def) method(respond_to?)operator(()ident(method)operator(,) ident(include_priv) operator(=) pre_constant(false)operator(\)) - reserved(if) instance_variable(@attributes)operator(.)ident(nil?) - reserved(return) reserved(super) - reserved(elsif) ident(attr_name) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(column_methods_hash)operator([)ident(method)operator(.)ident(to_sym)operator(]) - reserved(return) pre_constant(true) reserved(if) instance_variable(@attributes)operator(.)ident(include?)operator(()ident(attr_name)operator(\)) operator(||) ident(attr_name) operator(==) pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key) - reserved(return) pre_constant(false) reserved(if) pre_constant(self)operator(.)ident(class)operator(.)ident(read_methods)operator(.)ident(include?)operator(()ident(attr_name)operator(\)) - reserved(elsif) instance_variable(@attributes)operator(.)ident(include?)operator(()ident(method_name) operator(=) ident(method)operator(.)ident(to_s)operator(\)) - reserved(return) pre_constant(true) - reserved(elsif) ident(md) operator(=) regexpoperator(.)ident(match)operator(()ident(method_name)operator(\)) - reserved(return) pre_constant(true) reserved(if) instance_variable(@attributes)operator(.)ident(include?)operator(()ident(md)operator(.)ident(pre_match)operator(\)) - reserved(end) - comment(# super must be called at the end of the method, because the inherited respond_to?) - comment(# would return true for generated readers, even if the attribute wasn't present) - reserved(super) - reserved(end) - - comment(# Just freeze the attributes hash, such that associations are still accessible even on destroyed records.) - reserved(def) method(freeze) - instance_variable(@attributes)operator(.)ident(freeze)operator(;) pre_constant(self) - reserved(end) - - reserved(def) method(frozen?) - instance_variable(@attributes)operator(.)ident(frozen?) - reserved(end) - - comment(# Records loaded through joins with piggy-back attributes will be marked as read only as they cannot be saved and return true to this query.) - reserved(def) method(readonly?) - instance_variable(@readonly) operator(==) pre_constant(true) - reserved(end) - - reserved(def) method(readonly!) comment(#:nodoc:) - instance_variable(@readonly) operator(=) pre_constant(true) - reserved(end) - - comment(# Builds an XML document to represent the model. Some configuration is) - comment(# availble through +options+, however more complicated cases should use ) - comment(# Builder.) - comment(#) - comment(# By default the generated XML document will include the processing ) - comment(# instruction and all object's attributes. For example:) - comment(# ) - comment(# ) - comment(# ) - comment(# The First Topic) - comment(# David) - comment(# 1) - comment(# false) - comment(# 0) - comment(# 2000-01-01T08:28:00+12:00) - comment(# 2003-07-16T09:28:00+1200) - comment(# Have a nice day) - comment(# david@loudthinking.com) - comment(# ) - comment(# 2004-04-15) - comment(# ) - comment(#) - comment(# This behaviour can be controlled with :only, :except, and :skip_instruct ) - comment(# for instance:) - comment(#) - comment(# topic.to_xml(:skip_instruct => true, :except => [ :id, bonus_time, :written_on, replies_count ]\)) - comment(#) - comment(# ) - comment(# The First Topic) - comment(# David) - comment(# false) - comment(# Have a nice day) - comment(# david@loudthinking.com) - comment(# ) - comment(# 2004-04-15) - comment(# ) - comment(# ) - comment(# To include first level associations use :include) - comment(#) - comment(# firm.to_xml :include => [ :account, :clients ]) - comment(#) - comment(# ) - comment(# ) - comment(# 1) - comment(# 1) - comment(# 37signals) - comment(# ) - comment(# ) - comment(# 1) - comment(# Summit) - comment(# ) - comment(# ) - comment(# 1) - comment(# Microsoft) - comment(# ) - comment(# ) - comment(# ) - comment(# 1) - comment(# 50) - comment(# ) - comment(# ) - reserved(def) method(to_xml)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(options)operator([)symbol(:root)operator(]) operator(||=) pre_constant(self)operator(.)ident(class)operator(.)ident(to_s)operator(.)ident(underscore) - ident(options)operator([)symbol(:except)operator(]) operator(=) ident(Array)operator(()ident(options)operator([)symbol(:except)operator(])operator(\)) operator(<<) pre_constant(self)operator(.)ident(class)operator(.)ident(inheritance_column) reserved(unless) ident(options)operator([)symbol(:only)operator(]) comment(# skip type column) - ident(root_only_or_except) operator(=) operator({) symbol(:only) operator(=)operator(>) ident(options)operator([)symbol(:only)operator(])operator(,) symbol(:except) operator(=)operator(>) ident(options)operator([)symbol(:except)operator(]) operator(}) - - ident(attributes_for_xml) operator(=) ident(attributes)operator(()ident(root_only_or_except)operator(\)) - - reserved(if) ident(include_associations) operator(=) ident(options)operator(.)ident(delete)operator(()symbol(:include)operator(\)) - ident(include_has_options) operator(=) ident(include_associations)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - reserved(for) ident(association) reserved(in) ident(include_has_options) operator(?) ident(include_associations)operator(.)ident(keys) operator(:) ident(Array)operator(()ident(include_associations)operator(\)) - ident(association_options) operator(=) ident(include_has_options) operator(?) ident(include_associations)operator([)ident(association)operator(]) operator(:) ident(root_only_or_except) - - reserved(case) pre_constant(self)operator(.)ident(class)operator(.)ident(reflect_on_association)operator(()ident(association)operator(\))operator(.)ident(macro) - reserved(when) symbol(:has_many)operator(,) symbol(:has_and_belongs_to_many) - ident(records) operator(=) ident(send)operator(()ident(association)operator(\))operator(.)ident(to_a) - reserved(unless) ident(records)operator(.)ident(empty?) - ident(attributes_for_xml)operator([)ident(association)operator(]) operator(=) ident(records)operator(.)ident(collect) reserved(do) operator(|)ident(record)operator(|) - ident(record)operator(.)ident(attributes)operator(()ident(association_options)operator(\)) - reserved(end) - reserved(end) - reserved(when) symbol(:has_one)operator(,) symbol(:belongs_to) - reserved(if) ident(record) operator(=) ident(send)operator(()ident(association)operator(\)) - ident(attributes_for_xml)operator([)ident(association)operator(]) operator(=) ident(record)operator(.)ident(attributes)operator(()ident(association_options)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - ident(attributes_for_xml)operator(.)ident(to_xml)operator(()ident(options)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(create_or_update) - reserved(if) ident(new_record?) reserved(then) ident(create) reserved(else) ident(update) reserved(end) - reserved(end) - - comment(# Updates the associated record with values matching those of the instance attributes.) - reserved(def) method(update) - ident(connection)operator(.)ident(update)operator(() - stringcontent( )delimiter(")> operator(+) - stringcontent( )delimiter(")> operator(+) - stringcontent( = )inlinedelimiter(")>operator(,) - stringcontent( Update)delimiter(")> - operator(\)) - - reserved(return) pre_constant(true) - reserved(end) - - comment(# Creates a new record with values matching those of the instance attributes.) - reserved(def) method(create) - reserved(if) pre_constant(self)operator(.)ident(id)operator(.)ident(nil?) operator(&&) ident(connection)operator(.)ident(prefetch_primary_key?)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(table_name)operator(\)) - pre_constant(self)operator(.)ident(id) operator(=) ident(connection)operator(.)ident(next_sequence_value)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(sequence_name)operator(\)) - reserved(end) - - pre_constant(self)operator(.)ident(id) operator(=) ident(connection)operator(.)ident(insert)operator(() - stringcontent( )delimiter(")> operator(+) - stringoperator(\))inline_delimiter(})>content(\) )delimiter(")> operator(+) - stringoperator(\))inline_delimiter(})>content(\))delimiter(")>operator(,) - stringcontent( Create)delimiter(")>operator(,) - pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(,) pre_constant(self)operator(.)ident(id)operator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(sequence_name) - operator(\)) - - instance_variable(@new_record) operator(=) pre_constant(false) - - reserved(return) pre_constant(true) - reserved(end) - - comment(# Sets the attribute used for single table inheritance to this class name if this is not the ActiveRecord descendent.) - comment(# Considering the hierarchy Reply < Message < ActiveRecord, this makes it possible to do Reply.new without having to) - comment(# set Reply[Reply.inheritance_column] = "Reply" yourself. No such attribute would be set for objects of the) - comment(# Message class in that example.) - reserved(def) method(ensure_proper_type) - reserved(unless) pre_constant(self)operator(.)ident(class)operator(.)ident(descends_from_active_record?) - ident(write_attribute)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(inheritance_column)operator(,) constant(Inflector)operator(.)ident(demodulize)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(name)operator(\))operator(\)) - reserved(end) - reserved(end) - - comment(# Allows access to the object attributes, which are held in the @attributes hash, as were) - comment(# they first-class methods. So a Person class with a name attribute can use Person#name and) - comment(# Person#name= and never directly use the attributes hash -- except for multiple assigns with) - comment(# ActiveRecord#attributes=. A Milestone class can also ask Milestone#completed? to test that) - comment(# the completed attribute is not nil or 0.) - comment(#) - comment(# It's also possible to instantiate related objects, so a Client class belonging to the clients) - comment(# table with a master_id foreign key can instantiate master through Client#master.) - reserved(def) method(method_missing)operator(()ident(method_id)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(method_name) operator(=) ident(method_id)operator(.)ident(to_s) - reserved(if) instance_variable(@attributes)operator(.)ident(include?)operator(()ident(method_name)operator(\)) reserved(or) - operator(()ident(md) operator(=) regexpoperator(.)ident(match)operator(()ident(method_name)operator(\)) reserved(and) - instance_variable(@attributes)operator(.)ident(include?)operator(()ident(method_name) operator(=) ident(md)operator(.)ident(pre_match)operator(\))operator(\)) - ident(define_read_methods) reserved(if) pre_constant(self)operator(.)ident(class)operator(.)ident(read_methods)operator(.)ident(empty?) operator(&&) pre_constant(self)operator(.)ident(class)operator(.)ident(generate_read_methods) - ident(md) operator(?) ident(query_attribute)operator(()ident(method_name)operator(\)) operator(:) ident(read_attribute)operator(()ident(method_name)operator(\)) - reserved(elsif) pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(.)ident(to_s) operator(==) ident(method_name) - ident(id) - reserved(elsif) ident(md) operator(=) regexpoperator(.)ident(match)operator(()ident(method_name)operator(\)) - ident(attribute_name)operator(,) ident(method_type) operator(=) ident(md)operator(.)ident(pre_match)operator(,) ident(md)operator(.)ident(to_s) - reserved(if) instance_variable(@attributes)operator(.)ident(include?)operator(()ident(attribute_name)operator(\)) - reserved(case) ident(method_type) - reserved(when) string - ident(write_attribute)operator(()ident(attribute_name)operator(,) ident(args)operator(.)ident(first)operator(\)) - reserved(when) string - ident(read_attribute_before_type_cast)operator(()ident(attribute_name)operator(\)) - reserved(end) - reserved(else) - reserved(super) - reserved(end) - reserved(else) - reserved(super) - reserved(end) - reserved(end) - - comment(# Returns the value of the attribute identified by attr_name after it has been typecast (for example,) - comment(# "2004-12-12" in a data column is cast to a date object, like Date.new(2004, 12, 12\)\).) - reserved(def) method(read_attribute)operator(()ident(attr_name)operator(\)) - ident(attr_name) operator(=) ident(attr_name)operator(.)ident(to_s) - reserved(if) operator(!)operator(()ident(value) operator(=) instance_variable(@attributes)operator([)ident(attr_name)operator(])operator(\))operator(.)ident(nil?) - reserved(if) ident(column) operator(=) ident(column_for_attribute)operator(()ident(attr_name)operator(\)) - reserved(if) ident(unserializable_attribute?)operator(()ident(attr_name)operator(,) ident(column)operator(\)) - ident(unserialize_attribute)operator(()ident(attr_name)operator(\)) - reserved(else) - ident(column)operator(.)ident(type_cast)operator(()ident(value)operator(\)) - reserved(end) - reserved(else) - ident(value) - reserved(end) - reserved(else) - pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(read_attribute_before_type_cast)operator(()ident(attr_name)operator(\)) - instance_variable(@attributes)operator([)ident(attr_name)operator(]) - reserved(end) - - comment(# Called on first read access to any given column and generates reader) - comment(# methods for all columns in the columns_hash if) - comment(# ActiveRecord::Base.generate_read_methods is set to true.) - reserved(def) method(define_read_methods) - pre_constant(self)operator(.)ident(class)operator(.)ident(columns_hash)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(column)operator(|) - reserved(unless) pre_constant(self)operator(.)ident(class)operator(.)ident(serialized_attributes)operator([)ident(name)operator(]) - ident(define_read_method)operator(()ident(name)operator(.)ident(to_sym)operator(,) ident(name)operator(,) ident(column)operator(\)) reserved(unless) ident(respond_to_without_attributes?)operator(()ident(name)operator(\)) - ident(define_question_method)operator(()ident(name)operator(\)) reserved(unless) ident(respond_to_without_attributes?)operator(()stringcontent(?)delimiter(")>operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Define an attribute reader method. Cope with nil column.) - reserved(def) method(define_read_method)operator(()ident(symbol)operator(,) ident(attr_name)operator(,) ident(column)operator(\)) - ident(cast_code) operator(=) ident(column)operator(.)ident(type_cast_code)operator(()stringoperator(\)) reserved(if) ident(column) - ident(access_code) operator(=) ident(cast_code) operator(?) stringcontent(']\) && )inlinedelimiter(")> operator(:) stringcontent('])delimiter(")> - - reserved(unless) ident(attr_name)operator(.)ident(to_s) operator(==) pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(.)ident(to_s) - ident(access_code) operator(=) ident(access_code)operator(.)ident(insert)operator(()integer(0)operator(,) stringcontent(', caller unless @attributes.has_key?(')inlinecontent('\); )delimiter(")>operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(read_methods) operator(<<) ident(attr_name) - reserved(end) - - ident(evaluate_read_method) ident(attr_name)operator(,) stringcontent(; )inlinecontent(; end)delimiter(")> - reserved(end) - - comment(# Define an attribute ? method.) - reserved(def) method(define_question_method)operator(()ident(attr_name)operator(\)) - reserved(unless) ident(attr_name)operator(.)ident(to_s) operator(==) pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(.)ident(to_s) - pre_constant(self)operator(.)ident(class)operator(.)ident(read_methods) operator(<<) stringcontent(?)delimiter(")> - reserved(end) - - ident(evaluate_read_method) ident(attr_name)operator(,) stringcontent(?; query_attribute(')inlinecontent('\); end)delimiter(")> - reserved(end) - - comment(# Evaluate the definition for an attribute reader or ? method) - reserved(def) method(evaluate_read_method)operator(()ident(attr_name)operator(,) ident(method_definition)operator(\)) - reserved(begin) - pre_constant(self)operator(.)ident(class)operator(.)ident(class_eval)operator(()ident(method_definition)operator(\)) - reserved(rescue) constant(SyntaxError) operator(=)operator(>) ident(err) - pre_constant(self)operator(.)ident(class)operator(.)ident(read_methods)operator(.)ident(delete)operator(()ident(attr_name)operator(\)) - reserved(if) ident(logger) - ident(logger)operator(.)ident(warn) string - ident(logger)operator(.)ident(warn) stringcontent( is not a valid Ruby identifier?)delimiter(")> - ident(logger)operator(.)ident(warn) stringdelimiter(")> - reserved(end) - reserved(end) - reserved(end) - - comment(# Returns true if the attribute is of a text column and marked for serialization.) - reserved(def) method(unserializable_attribute?)operator(()ident(attr_name)operator(,) ident(column)operator(\)) - ident(column)operator(.)ident(text?) operator(&&) pre_constant(self)operator(.)ident(class)operator(.)ident(serialized_attributes)operator([)ident(attr_name)operator(]) - reserved(end) - - comment(# Returns the unserialized object of the attribute.) - reserved(def) method(unserialize_attribute)operator(()ident(attr_name)operator(\)) - ident(unserialized_object) operator(=) ident(object_from_yaml)operator(()instance_variable(@attributes)operator([)ident(attr_name)operator(])operator(\)) - - reserved(if) ident(unserialized_object)operator(.)ident(is_a?)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(serialized_attributes)operator([)ident(attr_name)operator(])operator(\)) - instance_variable(@attributes)operator([)ident(attr_name)operator(]) operator(=) ident(unserialized_object) - reserved(else) - ident(raise) constant(SerializationTypeMismatch)operator(,) - stringcontent( was supposed to be a )inlinecontent(, but was a )inlinedelimiter(")> - reserved(end) - reserved(end) - - comment(# Updates the attribute identified by attr_name with the specified +value+. Empty strings for fixnum and float) - comment(# columns are turned into nil.) - reserved(def) method(write_attribute)operator(()ident(attr_name)operator(,) ident(value)operator(\)) - ident(attr_name) operator(=) ident(attr_name)operator(.)ident(to_s) - reserved(if) operator(()ident(column) operator(=) ident(column_for_attribute)operator(()ident(attr_name)operator(\))operator(\)) operator(&&) ident(column)operator(.)ident(number?) - instance_variable(@attributes)operator([)ident(attr_name)operator(]) operator(=) ident(convert_number_column_value)operator(()ident(value)operator(\)) - reserved(else) - instance_variable(@attributes)operator([)ident(attr_name)operator(]) operator(=) ident(value) - reserved(end) - reserved(end) - - reserved(def) method(convert_number_column_value)operator(()ident(value)operator(\)) - reserved(case) ident(value) - reserved(when) constant(FalseClass)operator(:) integer(0) - reserved(when) constant(TrueClass)operator(:) integer(1) - reserved(when) stringoperator(:) pre_constant(nil) - reserved(else) ident(value) - reserved(end) - reserved(end) - - reserved(def) method(query_attribute)operator(()ident(attr_name)operator(\)) - ident(attribute) operator(=) instance_variable(@attributes)operator([)ident(attr_name)operator(]) - reserved(if) ident(attribute)operator(.)ident(kind_of?)operator(()constant(Fixnum)operator(\)) operator(&&) ident(attribute) operator(==) integer(0) - pre_constant(false) - reserved(elsif) ident(attribute)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) operator(&&) ident(attribute) operator(==) string - pre_constant(false) - reserved(elsif) ident(attribute)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) operator(&&) ident(attribute)operator(.)ident(empty?) - pre_constant(false) - reserved(elsif) ident(attribute)operator(.)ident(nil?) - pre_constant(false) - reserved(elsif) ident(attribute) operator(==) pre_constant(false) - pre_constant(false) - reserved(elsif) ident(attribute) operator(==) string - pre_constant(false) - reserved(elsif) ident(attribute) operator(==) string - pre_constant(false) - reserved(else) - pre_constant(true) - reserved(end) - reserved(end) - - reserved(def) method(remove_attributes_protected_from_mass_assignment)operator(()ident(attributes)operator(\)) - reserved(if) pre_constant(self)operator(.)ident(class)operator(.)ident(accessible_attributes)operator(.)ident(nil?) operator(&&) pre_constant(self)operator(.)ident(class)operator(.)ident(protected_attributes)operator(.)ident(nil?) - ident(attributes)operator(.)ident(reject) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) ident(attributes_protected_by_default)operator(.)ident(include?)operator(()ident(key)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(\)) operator(}) - reserved(elsif) pre_constant(self)operator(.)ident(class)operator(.)ident(protected_attributes)operator(.)ident(nil?) - ident(attributes)operator(.)ident(reject) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) operator(!)pre_constant(self)operator(.)ident(class)operator(.)ident(accessible_attributes)operator(.)ident(include?)operator(()ident(key)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(intern)operator(\)) operator(||) ident(attributes_protected_by_default)operator(.)ident(include?)operator(()ident(key)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(\)) operator(}) - reserved(elsif) pre_constant(self)operator(.)ident(class)operator(.)ident(accessible_attributes)operator(.)ident(nil?) - ident(attributes)operator(.)ident(reject) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) pre_constant(self)operator(.)ident(class)operator(.)ident(protected_attributes)operator(.)ident(include?)operator(()ident(key)operator(.)ident(gsub)operator(()regexpoperator(,)stringoperator(\))operator(.)ident(intern)operator(\)) operator(||) ident(attributes_protected_by_default)operator(.)ident(include?)operator(()ident(key)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(\)) operator(}) - reserved(end) - reserved(end) - - comment(# The primary key and inheritance column can never be set by mass-assignment for security reasons.) - reserved(def) method(attributes_protected_by_default) - ident(default) operator(=) operator([) pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(inheritance_column) operator(]) - ident(default) operator(<<) string reserved(unless) pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(.)ident(eql?) string - ident(default) - reserved(end) - - comment(# Returns copy of the attributes hash where all the values have been safely quoted for use in) - comment(# an SQL statement.) - reserved(def) method(attributes_with_quotes)operator(()ident(include_primary_key) operator(=) pre_constant(true)operator(\)) - ident(attributes)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(quoted)operator(,) operator(()ident(name)operator(,) ident(value)operator(\))operator(|) - reserved(if) ident(column) operator(=) ident(column_for_attribute)operator(()ident(name)operator(\)) - ident(quoted)operator([)ident(name)operator(]) operator(=) ident(quote)operator(()ident(value)operator(,) ident(column)operator(\)) reserved(unless) operator(!)ident(include_primary_key) operator(&&) ident(column)operator(.)ident(primary) - reserved(end) - ident(quoted) - reserved(end) - reserved(end) - - comment(# Quote strings appropriately for SQL statements.) - reserved(def) method(quote)operator(()ident(value)operator(,) ident(column) operator(=) pre_constant(nil)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(connection)operator(.)ident(quote)operator(()ident(value)operator(,) ident(column)operator(\)) - reserved(end) - - comment(# Interpolate custom sql string in instance context.) - comment(# Optional record argument is meant for custom insert_sql.) - reserved(def) method(interpolate_sql)operator(()ident(sql)operator(,) ident(record) operator(=) pre_constant(nil)operator(\)) - ident(instance_eval)operator(()stringoperator(,) stringoperator(\))inline_delimiter(})>content(@)delimiter(")>operator(\)) - reserved(end) - - comment(# Initializes the attributes array with keys matching the columns from the linked table and) - comment(# the values matching the corresponding default value of that column, so) - comment(# that a new instance, or one populated from a passed-in Hash, still has all the attributes) - comment(# that instances loaded from the database would.) - reserved(def) method(attributes_from_column_definition) - pre_constant(self)operator(.)ident(class)operator(.)ident(columns)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(attributes)operator(,) ident(column)operator(|) - ident(attributes)operator([)ident(column)operator(.)ident(name)operator(]) operator(=) ident(column)operator(.)ident(default) reserved(unless) ident(column)operator(.)ident(name) operator(==) pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key) - ident(attributes) - reserved(end) - reserved(end) - - comment(# Instantiates objects for all attribute classes that needs more than one constructor parameter. This is done) - comment(# by calling new on the column type or aggregation type (through composed_of\) object with these parameters.) - comment(# So having the pairs written_on(1\) = "2004", written_on(2\) = "6", written_on(3\) = "24", will instantiate) - comment(# written_on (a date type\) with Date.new("2004", "6", "24"\). You can also specify a typecast character in the) - comment(# parentheses to have the parameters typecasted before they're used in the constructor. Use i for Fixnum, f for Float,) - comment(# s for String, and a for Array. If all the values for a given attribute is empty, the attribute will be set to nil.) - reserved(def) method(assign_multiparameter_attributes)operator(()ident(pairs)operator(\)) - ident(execute_callstack_for_multiparameter_attributes)operator(() - ident(extract_callstack_for_multiparameter_attributes)operator(()ident(pairs)operator(\)) - operator(\)) - reserved(end) - - comment(# Includes an ugly hack for Time.local instead of Time.new because the latter is reserved by Time itself.) - reserved(def) method(execute_callstack_for_multiparameter_attributes)operator(()ident(callstack)operator(\)) - ident(errors) operator(=) operator([)operator(]) - ident(callstack)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(values)operator(|) - ident(klass) operator(=) operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(reflect_on_aggregation)operator(()ident(name)operator(.)ident(to_sym)operator(\)) operator(||) ident(column_for_attribute)operator(()ident(name)operator(\))operator(\))operator(.)ident(klass) - reserved(if) ident(values)operator(.)ident(empty?) - ident(send)operator(()ident(name) operator(+) stringoperator(,) pre_constant(nil)operator(\)) - reserved(else) - reserved(begin) - ident(send)operator(()ident(name) operator(+) stringoperator(,) constant(Time) operator(==) ident(klass) operator(?) ident(klass)operator(.)ident(local)operator(()operator(*)ident(values)operator(\)) operator(:) ident(klass)operator(.)ident(new)operator(()operator(*)ident(values)operator(\))operator(\)) - reserved(rescue) operator(=)operator(>) ident(ex) - ident(errors) operator(<<) constant(AttributeAssignmentError)operator(.)ident(new)operator(()stringcontent( to )inlinedelimiter(")>operator(,) ident(ex)operator(,) ident(name)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(unless) ident(errors)operator(.)ident(empty?) - ident(raise) constant(MultiparameterAssignmentErrors)operator(.)ident(new)operator(()ident(errors)operator(\))operator(,) stringcontent( error(s\) on assignment of multiparameter attributes)delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(extract_callstack_for_multiparameter_attributes)operator(()ident(pairs)operator(\)) - ident(attributes) operator(=) operator({) operator(}) - - reserved(for) ident(pair) reserved(in) ident(pairs) - ident(multiparameter_name)operator(,) ident(value) operator(=) ident(pair) - ident(attribute_name) operator(=) ident(multiparameter_name)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(first) - ident(attributes)operator([)ident(attribute_name)operator(]) operator(=) operator([)operator(]) reserved(unless) ident(attributes)operator(.)ident(include?)operator(()ident(attribute_name)operator(\)) - - reserved(unless) ident(value)operator(.)ident(empty?) - ident(attributes)operator([)ident(attribute_name)operator(]) operator(<<) - operator([) ident(find_parameter_position)operator(()ident(multiparameter_name)operator(\))operator(,) ident(type_cast_attribute_value)operator(()ident(multiparameter_name)operator(,) ident(value)operator(\)) operator(]) - reserved(end) - reserved(end) - - ident(attributes)operator(.)ident(each) operator({) operator(|)ident(name)operator(,) ident(values)operator(|) ident(attributes)operator([)ident(name)operator(]) operator(=) ident(values)operator(.)ident(sort_by)operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(first) operator(})operator(.)ident(collect) operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(last) operator(}) operator(}) - reserved(end) - - reserved(def) method(type_cast_attribute_value)operator(()ident(multiparameter_name)operator(,) ident(value)operator(\)) - ident(multiparameter_name) operator(=)operator(~) regexp operator(?) ident(value)operator(.)ident(send)operator(()string operator(+) global_variable($1)operator(\)) operator(:) ident(value) - reserved(end) - - reserved(def) method(find_parameter_position)operator(()ident(multiparameter_name)operator(\)) - ident(multiparameter_name)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(first)operator(.)ident(first) - reserved(end) - - comment(# Returns a comma-separated pair list, like "key1 = val1, key2 = val2".) - reserved(def) method(comma_pair_list)operator(()ident(hash)operator(\)) - ident(hash)operator(.)ident(inject)operator(()operator([)operator(])operator(\)) operator({) operator(|)ident(list)operator(,) ident(pair)operator(|) ident(list) operator(<<) stringcontent( = )inlinedelimiter(")> operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(quoted_column_names)operator(()ident(attributes) operator(=) ident(attributes_with_quotes)operator(\)) - ident(attributes)operator(.)ident(keys)operator(.)ident(collect) reserved(do) operator(|)ident(column_name)operator(|) - pre_constant(self)operator(.)ident(class)operator(.)ident(connection)operator(.)ident(quote_column_name)operator(()ident(column_name)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(quote_columns)operator(()ident(quoter)operator(,) ident(hash)operator(\)) - ident(hash)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(quoted)operator(,) operator(()ident(name)operator(,) ident(value)operator(\))operator(|) - ident(quoted)operator([)ident(quoter)operator(.)ident(quote_column_name)operator(()ident(name)operator(\))operator(]) operator(=) ident(value) - ident(quoted) - reserved(end) - reserved(end) - - reserved(def) method(quoted_comma_pair_list)operator(()ident(quoter)operator(,) ident(hash)operator(\)) - ident(comma_pair_list)operator(()ident(quote_columns)operator(()ident(quoter)operator(,) ident(hash)operator(\))operator(\)) - reserved(end) - - reserved(def) method(object_from_yaml)operator(()ident(string)operator(\)) - reserved(return) ident(string) reserved(unless) ident(string)operator(.)ident(is_a?)operator(()constant(String)operator(\)) - constant(YAML)operator(::)ident(load)operator(()ident(string)operator(\)) reserved(rescue) ident(string) - reserved(end) - - reserved(def) method(clone_attributes)operator(()ident(reader_method) operator(=) symbol(:read_attribute)operator(,) ident(attributes) operator(=) operator({)operator(})operator(\)) - pre_constant(self)operator(.)ident(attribute_names)operator(.)ident(inject)operator(()ident(attributes)operator(\)) reserved(do) operator(|)ident(attributes)operator(,) ident(name)operator(|) - ident(attributes)operator([)ident(name)operator(]) operator(=) ident(clone_attribute_value)operator(()ident(reader_method)operator(,) ident(name)operator(\)) - ident(attributes) - reserved(end) - reserved(end) - - reserved(def) method(clone_attribute_value)operator(()ident(reader_method)operator(,) ident(attribute_name)operator(\)) - ident(value) operator(=) ident(send)operator(()ident(reader_method)operator(,) ident(attribute_name)operator(\)) - ident(value)operator(.)ident(clone) - reserved(rescue) constant(TypeError)operator(,) constant(NoMethodError) - ident(value) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Calculations) comment(#:nodoc:) - constant(CALCULATIONS_OPTIONS) operator(=) operator([)symbol(:conditions)operator(,) symbol(:joins)operator(,) symbol(:order)operator(,) symbol(:select)operator(,) symbol(:group)operator(,) symbol(:having)operator(,) symbol(:distinct)operator(,) symbol(:limit)operator(,) symbol(:offset)operator(]) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - reserved(module) class(ClassMethods) - comment(# Count operates using three different approaches. ) - comment(#) - comment(# * Count all: By not passing any parameters to count, it will return a count of all the rows for the model.) - comment(# * Count by conditions or joins: For backwards compatibility, you can pass in +conditions+ and +joins+ as individual parameters.) - comment(# * Count using options will find the row count matched by the options used.) - comment(#) - comment(# The last approach, count using options, accepts an option hash as the only parameter. The options are:) - comment(#) - comment(# * :conditions: An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. See conditions in the intro.) - comment(# * :joins: An SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id". (Rarely needed\).) - comment(# The records will be returned read-only since they will have attributes that do not correspond to the table's columns.) - comment(# * :include: Named associations that should be loaded alongside using LEFT OUTER JOINs. The symbols named refer) - comment(# to already defined associations. When using named associations count returns the number DISTINCT items for the model you're counting.) - comment(# See eager loading under Associations.) - comment(# * :order: An SQL fragment like "created_at DESC, name" (really only used with GROUP BY calculations\).) - comment(# * :group: An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.) - comment(# * :select: By default, this is * as in SELECT * FROM, but can be changed if you for example want to do a join, but not) - comment(# include the joined columns.) - comment(# * :distinct: Set this to true to make this a distinct calculation, such as SELECT COUNT(DISTINCT posts.id\) ...) - comment(#) - comment(# Examples for counting all:) - comment(# Person.count # returns the total count of all people) - comment(#) - comment(# Examples for count by +conditions+ and +joins+ (for backwards compatibility\):) - comment(# Person.count("age > 26"\) # returns the number of people older than 26) - comment(# Person.find("age > 26 AND job.salary > 60000", "LEFT JOIN jobs on jobs.person_id = person.id"\) # returns the total number of rows matching the conditions and joins fetched by SELECT COUNT(*\).) - comment(#) - comment(# Examples for count with options:) - comment(# Person.count(:conditions => "age > 26"\)) - comment(# Person.count(:conditions => "age > 26 AND job.salary > 60000", :include => :job\) # because of the named association, it finds the DISTINCT count using LEFT OUTER JOIN.) - comment(# Person.count(:conditions => "age > 26 AND job.salary > 60000", :joins => "LEFT JOIN jobs on jobs.person_id = person.id"\) # finds the number of rows matching the conditions and joins. ) - comment(# Person.count('id', :conditions => "age > 26"\) # Performs a COUNT(id\)) - comment(# Person.count(:all, :conditions => "age > 26"\) # Performs a COUNT(*\) (:all is an alias for '*'\)) - comment(#) - comment(# Note: Person.count(:all\) will not work because it will use :all as the condition. Use Person.count instead.) - reserved(def) method(count)operator(()operator(*)ident(args)operator(\)) - ident(options) operator(=) operator({)operator(}) - ident(column_name) operator(=) symbol(:all) - comment(# For backwards compatibility, we need to handle both count(conditions=nil, joins=nil\) or count(options={}\) or count(column_name=:all, options={}\).) - reserved(if) ident(args)operator(.)ident(size) operator(>)operator(=) integer(0) operator(&&) ident(args)operator(.)ident(size) operator(<=) integer(2) - reserved(if) ident(args)operator(.)ident(first)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(options) operator(=) ident(args)operator(.)ident(first) - reserved(elsif) ident(args)operator([)integer(1)operator(])operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(options) operator(=) ident(args)operator([)integer(1)operator(]) - ident(column_name) operator(=) ident(args)operator(.)ident(first) - reserved(else) - comment(# Handle legacy paramter options: def count(conditions=nil, joins=nil\)) - ident(options)operator(.)ident(merge!)operator(()symbol(:conditions) operator(=)operator(>) ident(args)operator([)integer(0)operator(])operator(\)) reserved(if) ident(args)operator(.)ident(length) operator(>) integer(0) - ident(options)operator(.)ident(merge!)operator(()symbol(:joins) operator(=)operator(>) ident(args)operator([)integer(1)operator(])operator(\)) reserved(if) ident(args)operator(.)ident(length) operator(>) integer(1) - reserved(end) - reserved(else) - ident(raise)operator(()constant(ArgumentError)operator(,) stringoperator(\)) - reserved(end) - - reserved(if) ident(options)operator([)symbol(:include)operator(]) operator(||) ident(scope)operator(()symbol(:find)operator(,) symbol(:include)operator(\)) - ident(count_with_associations)operator(()ident(options)operator(\)) - reserved(else) - ident(calculate)operator(()symbol(:count)operator(,) ident(column_name)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - comment(# Calculates average value on a given column. The value is returned as a float. See #calculate for examples with options.) - comment(#) - comment(# Person.average('age'\)) - reserved(def) method(average)operator(()ident(column_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(calculate)operator(()symbol(:avg)operator(,) ident(column_name)operator(,) ident(options)operator(\)) - reserved(end) - - comment(# Calculates the minimum value on a given column. The value is returned with the same data type of the column.. See #calculate for examples with options.) - comment(#) - comment(# Person.minimum('age'\)) - reserved(def) method(minimum)operator(()ident(column_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(calculate)operator(()symbol(:min)operator(,) ident(column_name)operator(,) ident(options)operator(\)) - reserved(end) - - comment(# Calculates the maximum value on a given column. The value is returned with the same data type of the column.. See #calculate for examples with options.) - comment(#) - comment(# Person.maximum('age'\)) - reserved(def) method(maximum)operator(()ident(column_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(calculate)operator(()symbol(:max)operator(,) ident(column_name)operator(,) ident(options)operator(\)) - reserved(end) - - comment(# Calculates the sum value on a given column. The value is returned with the same data type of the column.. See #calculate for examples with options.) - comment(#) - comment(# Person.sum('age'\)) - reserved(def) method(sum)operator(()ident(column_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(calculate)operator(()symbol(:sum)operator(,) ident(column_name)operator(,) ident(options)operator(\)) - reserved(end) - - comment(# This calculates aggregate values in the given column: Methods for count, sum, average, minimum, and maximum have been added as shortcuts.) - comment(# Options such as :conditions, :order, :group, :having, and :joins can be passed to customize the query. ) - comment(#) - comment(# There are two basic forms of output:) - comment(# * Single aggregate value: The single value is type cast to Fixnum for COUNT, Float for AVG, and the given column's type for everything else.) - comment(# * Grouped values: This returns an ordered hash of the values and groups them by the :group option. It takes either a column name, or the name ) - comment(# of a belongs_to association.) - comment(#) - comment(# values = Person.maximum(:age, :group => 'last_name'\)) - comment(# puts values["Drake"]) - comment(# => 43) - comment(#) - comment(# drake = Family.find_by_last_name('Drake'\)) - comment(# values = Person.maximum(:age, :group => :family\) # Person belongs_to :family) - comment(# puts values[drake]) - comment(# => 43) - comment(#) - comment(# values.each do |family, max_age|) - comment(# ...) - comment(# end) - comment(#) - comment(# Options:) - comment(# * :conditions: An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. See conditions in the intro.) - comment(# * :joins: An SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id". (Rarely needed\).) - comment(# The records will be returned read-only since they will have attributes that do not correspond to the table's columns.) - comment(# * :order: An SQL fragment like "created_at DESC, name" (really only used with GROUP BY calculations\).) - comment(# * :group: An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.) - comment(# * :select: By default, this is * as in SELECT * FROM, but can be changed if you for example want to do a join, but not) - comment(# include the joined columns.) - comment(# * :distinct: Set this to true to make this a distinct calculation, such as SELECT COUNT(DISTINCT posts.id\) ...) - comment(#) - comment(# Examples:) - comment(# Person.calculate(:count, :all\) # The same as Person.count) - comment(# Person.average(:age\) # SELECT AVG(age\) FROM people...) - comment(# Person.minimum(:age, :conditions => ['last_name != ?', 'Drake']\) # Selects the minimum age for everyone with a last name other than 'Drake') - comment(# Person.minimum(:age, :having => 'min(age\) > 17', :group => :last_name\) # Selects the minimum age for any family without any minors) - reserved(def) method(calculate)operator(()ident(operation)operator(,) ident(column_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(validate_calculation_options)operator(()ident(operation)operator(,) ident(options)operator(\)) - ident(column_name) operator(=) ident(options)operator([)symbol(:select)operator(]) reserved(if) ident(options)operator([)symbol(:select)operator(]) - ident(column_name) operator(=) string reserved(if) ident(column_name) operator(==) symbol(:all) - ident(column) operator(=) ident(column_for) ident(column_name) - ident(aggregate) operator(=) ident(select_aggregate)operator(()ident(operation)operator(,) ident(column_name)operator(,) ident(options)operator(\)) - ident(aggregate_alias) operator(=) ident(column_alias_for)operator(()ident(operation)operator(,) ident(column_name)operator(\)) - reserved(if) ident(options)operator([)symbol(:group)operator(]) - ident(execute_grouped_calculation)operator(()ident(operation)operator(,) ident(column_name)operator(,) ident(column)operator(,) ident(aggregate)operator(,) ident(aggregate_alias)operator(,) ident(options)operator(\)) - reserved(else) - ident(execute_simple_calculation)operator(()ident(operation)operator(,) ident(column_name)operator(,) ident(column)operator(,) ident(aggregate)operator(,) ident(aggregate_alias)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - ident(protected) - reserved(def) method(construct_calculation_sql)operator(()ident(aggregate)operator(,) ident(aggregate_alias)operator(,) ident(options)operator(\)) comment(#:nodoc:) - ident(scope) operator(=) ident(scope)operator(()symbol(:find)operator(\)) - ident(sql) operator(=) stringcontent( AS )inlinedelimiter(")> - ident(sql) operator(<<) stringcontent( AS )inlinedelimiter(")> reserved(if) ident(options)operator([)symbol(:group)operator(]) - ident(sql) operator(<<) stringcontent( )delimiter(")> - ident(add_joins!)operator(()ident(sql)operator(,) ident(options)operator(,) ident(scope)operator(\)) - ident(add_conditions!)operator(()ident(sql)operator(,) ident(options)operator([)symbol(:conditions)operator(])operator(,) ident(scope)operator(\)) - ident(sql) operator(<<) stringdelimiter(")> reserved(if) ident(options)operator([)symbol(:group)operator(]) - ident(sql) operator(<<) stringdelimiter(")> reserved(if) ident(options)operator([)symbol(:group)operator(]) operator(&&) ident(options)operator([)symbol(:having)operator(]) - ident(sql) operator(<<) stringdelimiter(")> reserved(if) ident(options)operator([)symbol(:order)operator(]) - ident(add_limit!)operator(()ident(sql)operator(,) ident(options)operator(\)) - ident(sql) - reserved(end) - - reserved(def) method(execute_simple_calculation)operator(()ident(operation)operator(,) ident(column_name)operator(,) ident(column)operator(,) ident(aggregate)operator(,) ident(aggregate_alias)operator(,) ident(options)operator(\)) comment(#:nodoc:) - ident(value) operator(=) ident(connection)operator(.)ident(select_value)operator(()ident(construct_calculation_sql)operator(()ident(aggregate)operator(,) ident(aggregate_alias)operator(,) ident(options)operator(\))operator(\)) - ident(type_cast_calculated_value)operator(()ident(value)operator(,) ident(column)operator(,) ident(operation)operator(\)) - reserved(end) - - reserved(def) method(execute_grouped_calculation)operator(()ident(operation)operator(,) ident(column_name)operator(,) ident(column)operator(,) ident(aggregate)operator(,) ident(aggregate_alias)operator(,) ident(options)operator(\)) comment(#:nodoc:) - ident(group_attr) operator(=) ident(options)operator([)symbol(:group)operator(])operator(.)ident(to_s) - ident(association) operator(=) ident(reflect_on_association)operator(()ident(group_attr)operator(.)ident(to_sym)operator(\)) - ident(associated) operator(=) ident(association) operator(&&) ident(association)operator(.)ident(macro) operator(==) symbol(:belongs_to) comment(# only count belongs_to associations) - ident(group_field) operator(=) operator(()ident(associated) operator(?) stringcontent(_id)delimiter(")> operator(:) ident(options)operator([)symbol(:group)operator(])operator(\))operator(.)ident(to_s) - ident(group_alias) operator(=) ident(column_alias_for)operator(()ident(group_field)operator(\)) - ident(group_column) operator(=) ident(column_for) ident(group_field) - ident(sql) operator(=) ident(construct_calculation_sql)operator(()ident(aggregate)operator(,) ident(aggregate_alias)operator(,) ident(options)operator(.)ident(merge)operator(()symbol(:group_field) operator(=)operator(>) ident(group_field)operator(,) symbol(:group_alias) operator(=)operator(>) ident(group_alias)operator(\))operator(\)) - ident(calculated_data) operator(=) ident(connection)operator(.)ident(select_all)operator(()ident(sql)operator(\)) - - reserved(if) ident(association) - ident(key_ids) operator(=) ident(calculated_data)operator(.)ident(collect) operator({) operator(|)ident(row)operator(|) ident(row)operator([)ident(group_alias)operator(]) operator(}) - ident(key_records) operator(=) ident(association)operator(.)ident(klass)operator(.)ident(base_class)operator(.)ident(find)operator(()ident(key_ids)operator(\)) - ident(key_records) operator(=) ident(key_records)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({) operator(|)ident(hsh)operator(,) ident(r)operator(|) ident(hsh)operator(.)ident(merge)operator(()ident(r)operator(.)ident(id) operator(=)operator(>) ident(r)operator(\)) operator(}) - reserved(end) - - ident(calculated_data)operator(.)ident(inject)operator(()constant(OrderedHash)operator(.)ident(new)operator(\)) reserved(do) operator(|)ident(all)operator(,) ident(row)operator(|) - ident(key) operator(=) ident(associated) operator(?) ident(key_records)operator([)ident(row)operator([)ident(group_alias)operator(])operator(.)ident(to_i)operator(]) operator(:) ident(type_cast_calculated_value)operator(()ident(row)operator([)ident(group_alias)operator(])operator(,) ident(group_column)operator(\)) - ident(value) operator(=) ident(row)operator([)ident(aggregate_alias)operator(]) - ident(all) operator(<<) operator([)ident(key)operator(,) ident(type_cast_calculated_value)operator(()ident(value)operator(,) ident(column)operator(,) ident(operation)operator(\))operator(]) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(validate_calculation_options)operator(()ident(operation)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - reserved(if) ident(operation)operator(.)ident(to_s) operator(==) string - ident(options)operator(.)ident(assert_valid_keys)operator(()constant(CALCULATIONS_OPTIONS) operator(+) operator([)symbol(:include)operator(])operator(\)) - reserved(else) - ident(options)operator(.)ident(assert_valid_keys)operator(()constant(CALCULATIONS_OPTIONS)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(select_aggregate)operator(()ident(operation)operator(,) ident(column_name)operator(,) ident(options)operator(\)) - stringcontent(()inline reserved(if) ident(options)operator([)symbol(:distinct)operator(])inline_delimiter(})>inlinecontent(\))delimiter(")> - reserved(end) - - comment(# converts a given key to the value that the database adapter returns as) - comment(#) - comment(# users.id #=> users_id) - comment(# sum(id\) #=> sum_id) - comment(# count(distinct users.id\) #=> count_distinct_users_id) - comment(# count(*\) #=> count_all) - reserved(def) method(column_alias_for)operator(()operator(*)ident(keys)operator(\)) - ident(keys)operator(.)ident(join)operator(()stringoperator(\))operator(.)ident(downcase)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(strip)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(column_for)operator(()ident(field)operator(\)) - ident(field_name) operator(=) ident(field)operator(.)ident(to_s)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last) - ident(columns)operator(.)ident(detect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name)operator(.)ident(to_s) operator(==) ident(field_name) operator(}) - reserved(end) - - reserved(def) method(type_cast_calculated_value)operator(()ident(value)operator(,) ident(column)operator(,) ident(operation) operator(=) pre_constant(nil)operator(\)) - ident(operation) operator(=) ident(operation)operator(.)ident(to_s)operator(.)ident(downcase) - reserved(case) ident(operation) - reserved(when) string reserved(then) ident(value)operator(.)ident(to_i) - reserved(when) string reserved(then) ident(value)operator(.)ident(to_f) - reserved(else) ident(column) operator(?) ident(column)operator(.)ident(type_cast)operator(()ident(value)operator(\)) operator(:) ident(value) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActiveRecord) - comment(# Callbacks are hooks into the lifecycle of an Active Record object that allows you to trigger logic) - comment(# before or after an alteration of the object state. This can be used to make sure that associated and) - comment(# dependent objects are deleted when destroy is called (by overwriting before_destroy\) or to massage attributes) - comment(# before they're validated (by overwriting before_validation\). As an example of the callbacks initiated, consider) - comment(# the Base#save call:) - comment(#) - comment(# * (-\) save) - comment(# * (-\) valid?) - comment(# * (1\) before_validation) - comment(# * (2\) before_validation_on_create) - comment(# * (-\) validate) - comment(# * (-\) validate_on_create) - comment(# * (3\) after_validation) - comment(# * (4\) after_validation_on_create) - comment(# * (5\) before_save) - comment(# * (6\) before_create) - comment(# * (-\) create) - comment(# * (7\) after_create) - comment(# * (8\) after_save) - comment(#) - comment(# That's a total of eight callbacks, which gives you immense power to react and prepare for each state in the) - comment(# Active Record lifecycle.) - comment(#) - comment(# Examples:) - comment(# class CreditCard < ActiveRecord::Base) - comment(# # Strip everything but digits, so the user can specify "555 234 34" or) - comment(# # "5552-3434" or both will mean "55523434") - comment(# def before_validation_on_create) - comment(# self.number = number.gsub(/[^0-9]/, ""\) if attribute_present?("number"\)) - comment(# end) - comment(# end) - comment(#) - comment(# class Subscription < ActiveRecord::Base) - comment(# before_create :record_signup) - comment(#) - comment(# private) - comment(# def record_signup) - comment(# self.signed_up_on = Date.today) - comment(# end) - comment(# end) - comment(#) - comment(# class Firm < ActiveRecord::Base) - comment(# # Destroys the associated clients and people when the firm is destroyed) - comment(# before_destroy { |record| Person.destroy_all "firm_id = #{record.id}" }) - comment(# before_destroy { |record| Client.destroy_all "client_of = #{record.id}" }) - comment(# end) - comment(#) - comment(# == Inheritable callback queues) - comment(#) - comment(# Besides the overwriteable callback methods, it's also possible to register callbacks through the use of the callback macros.) - comment(# Their main advantage is that the macros add behavior into a callback queue that is kept intact down through an inheritance) - comment(# hierarchy. Example:) - comment(#) - comment(# class Topic < ActiveRecord::Base) - comment(# before_destroy :destroy_author) - comment(# end) - comment(#) - comment(# class Reply < Topic) - comment(# before_destroy :destroy_readers) - comment(# end) - comment(#) - comment(# Now, when Topic#destroy is run only +destroy_author+ is called. When Reply#destroy is run both +destroy_author+ and) - comment(# +destroy_readers+ is called. Contrast this to the situation where we've implemented the save behavior through overwriteable) - comment(# methods:) - comment(#) - comment(# class Topic < ActiveRecord::Base) - comment(# def before_destroy(\) destroy_author end) - comment(# end) - comment(#) - comment(# class Reply < Topic) - comment(# def before_destroy(\) destroy_readers end) - comment(# end) - comment(#) - comment(# In that case, Reply#destroy would only run +destroy_readers+ and _not_ +destroy_author+. So use the callback macros when) - comment(# you want to ensure that a certain callback is called for the entire hierarchy and the regular overwriteable methods when you) - comment(# want to leave it up to each descendent to decide whether they want to call +super+ and trigger the inherited callbacks.) - comment(#) - comment(# *IMPORTANT:* In order for inheritance to work for the callback queues, you must specify the callbacks before specifying the) - comment(# associations. Otherwise, you might trigger the loading of a child before the parent has registered the callbacks and they won't) - comment(# be inherited.) - comment(#) - comment(# == Types of callbacks) - comment(#) - comment(# There are four types of callbacks accepted by the callback macros: Method references (symbol\), callback objects,) - comment(# inline methods (using a proc\), and inline eval methods (using a string\). Method references and callback objects are the) - comment(# recommended approaches, inline methods using a proc are sometimes appropriate (such as for creating mix-ins\), and inline) - comment(# eval methods are deprecated.) - comment(#) - comment(# The method reference callbacks work by specifying a protected or private method available in the object, like this:) - comment(#) - comment(# class Topic < ActiveRecord::Base) - comment(# before_destroy :delete_parents) - comment(#) - comment(# private) - comment(# def delete_parents) - comment(# self.class.delete_all "parent_id = #{id}") - comment(# end) - comment(# end) - comment(#) - comment(# The callback objects have methods named after the callback called with the record as the only parameter, such as:) - comment(#) - comment(# class BankAccount < ActiveRecord::Base) - comment(# before_save EncryptionWrapper.new("credit_card_number"\)) - comment(# after_save EncryptionWrapper.new("credit_card_number"\)) - comment(# after_initialize EncryptionWrapper.new("credit_card_number"\)) - comment(# end) - comment(#) - comment(# class EncryptionWrapper) - comment(# def initialize(attribute\)) - comment(# @attribute = attribute) - comment(# end) - comment(#) - comment(# def before_save(record\)) - comment(# record.credit_card_number = encrypt(record.credit_card_number\)) - comment(# end) - comment(#) - comment(# def after_save(record\)) - comment(# record.credit_card_number = decrypt(record.credit_card_number\)) - comment(# end) - comment(#) - comment(# alias_method :after_find, :after_save) - comment(#) - comment(# private) - comment(# def encrypt(value\)) - comment(# # Secrecy is committed) - comment(# end) - comment(#) - comment(# def decrypt(value\)) - comment(# # Secrecy is unveiled) - comment(# end) - comment(# end) - comment(#) - comment(# So you specify the object you want messaged on a given callback. When that callback is triggered, the object has) - comment(# a method by the name of the callback messaged.) - comment(#) - comment(# The callback macros usually accept a symbol for the method they're supposed to run, but you can also pass a "method string",) - comment(# which will then be evaluated within the binding of the callback. Example:) - comment(#) - comment(# class Topic < ActiveRecord::Base) - comment(# before_destroy 'self.class.delete_all "parent_id = #{id}"') - comment(# end) - comment(#) - comment(# Notice that single plings ('\) are used so the #{id} part isn't evaluated until the callback is triggered. Also note that these) - comment(# inline callbacks can be stacked just like the regular ones:) - comment(#) - comment(# class Topic < ActiveRecord::Base) - comment(# before_destroy 'self.class.delete_all "parent_id = #{id}"',) - comment(# 'puts "Evaluated after parents are destroyed"') - comment(# end) - comment(#) - comment(# == The after_find and after_initialize exceptions) - comment(#) - comment(# Because after_find and after_initialize are called for each object found and instantiated by a finder, such as Base.find(:all\), we've had) - comment(# to implement a simple performance constraint (50% more speed on a simple test case\). Unlike all the other callbacks, after_find and) - comment(# after_initialize will only be run if an explicit implementation is defined (def after_find\). In that case, all of the) - comment(# callback types will be called.) - comment(#) - comment(# == Cancelling callbacks) - comment(#) - comment(# If a before_* callback returns false, all the later callbacks and the associated action are cancelled. If an after_* callback returns) - comment(# false, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks) - comment(# defined as methods on the model, which are called last.) - reserved(module) class(Callbacks) - constant(CALLBACKS) operator(=) string - - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - ident(base)operator(.)ident(class_eval) reserved(do) - reserved(class) operator(<<) class(self) - ident(include) constant(Observable) - ident(alias_method) symbol(:instantiate_without_callbacks)operator(,) symbol(:instantiate) - ident(alias_method) symbol(:instantiate)operator(,) symbol(:instantiate_with_callbacks) - reserved(end) - - ident(alias_method) symbol(:initialize_without_callbacks)operator(,) symbol(:initialize) - ident(alias_method) symbol(:initialize)operator(,) symbol(:initialize_with_callbacks) - - ident(alias_method) symbol(:create_or_update_without_callbacks)operator(,) symbol(:create_or_update) - ident(alias_method) symbol(:create_or_update)operator(,) symbol(:create_or_update_with_callbacks) - - ident(alias_method) symbol(:valid_without_callbacks)operator(,) symbol(:valid?) - ident(alias_method) symbol(:valid?)operator(,) symbol(:valid_with_callbacks) - - ident(alias_method) symbol(:create_without_callbacks)operator(,) symbol(:create) - ident(alias_method) symbol(:create)operator(,) symbol(:create_with_callbacks) - - ident(alias_method) symbol(:update_without_callbacks)operator(,) symbol(:update) - ident(alias_method) symbol(:update)operator(,) symbol(:update_with_callbacks) - - ident(alias_method) symbol(:destroy_without_callbacks)operator(,) symbol(:destroy) - ident(alias_method) symbol(:destroy)operator(,) symbol(:destroy_with_callbacks) - reserved(end) - - constant(CALLBACKS)operator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - ident(base)operator(.)ident(class_eval) stringstringcontent((*callbacks, &block\) - callbacks << block if block_given? - write_inheritable_array()inlinecontent(, callbacks\) - end)delimiter( - end_eval)> - reserved(end) - reserved(end) - - reserved(module) class(ClassMethods) comment(#:nodoc:) - reserved(def) method(instantiate_with_callbacks)operator(()ident(record)operator(\)) - ident(object) operator(=) ident(instantiate_without_callbacks)operator(()ident(record)operator(\)) - - reserved(if) ident(object)operator(.)ident(respond_to_without_attributes?)operator(()symbol(:after_find)operator(\)) - ident(object)operator(.)ident(send)operator(()symbol(:callback)operator(,) symbol(:after_find)operator(\)) - reserved(end) - - reserved(if) ident(object)operator(.)ident(respond_to_without_attributes?)operator(()symbol(:after_initialize)operator(\)) - ident(object)operator(.)ident(send)operator(()symbol(:callback)operator(,) symbol(:after_initialize)operator(\)) - reserved(end) - - ident(object) - reserved(end) - reserved(end) - - comment(# Is called when the object was instantiated by one of the finders, like Base.find.) - comment(#def after_find(\) end) - - comment(# Is called after the object has been instantiated by a call to Base.new.) - comment(#def after_initialize(\) end) - - reserved(def) method(initialize_with_callbacks)operator(()ident(attributes) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(initialize_without_callbacks)operator(()ident(attributes)operator(\)) - ident(result) operator(=) reserved(yield) pre_constant(self) reserved(if) ident(block_given?) - ident(callback)operator(()symbol(:after_initialize)operator(\)) reserved(if) ident(respond_to_without_attributes?)operator(()symbol(:after_initialize)operator(\)) - ident(result) - reserved(end) - - comment(# Is called _before_ Base.save (regardless of whether it's a create or update save\).) - reserved(def) method(before_save)operator(()operator(\)) reserved(end) - - comment(# Is called _after_ Base.save (regardless of whether it's a create or update save\).) - comment(#) - comment(# class Contact < ActiveRecord::Base) - comment(# after_save { logger.info( 'New contact saved!' \) }) - comment(# end) - reserved(def) method(after_save)operator(()operator(\)) reserved(end) - reserved(def) method(create_or_update_with_callbacks) comment(#:nodoc:) - reserved(return) pre_constant(false) reserved(if) ident(callback)operator(()symbol(:before_save)operator(\)) operator(==) pre_constant(false) - ident(result) operator(=) ident(create_or_update_without_callbacks) - ident(callback)operator(()symbol(:after_save)operator(\)) - ident(result) - reserved(end) - - comment(# Is called _before_ Base.save on new objects that haven't been saved yet (no record exists\).) - reserved(def) method(before_create)operator(()operator(\)) reserved(end) - - comment(# Is called _after_ Base.save on new objects that haven't been saved yet (no record exists\).) - reserved(def) method(after_create)operator(()operator(\)) reserved(end) - reserved(def) method(create_with_callbacks) comment(#:nodoc:) - reserved(return) pre_constant(false) reserved(if) ident(callback)operator(()symbol(:before_create)operator(\)) operator(==) pre_constant(false) - ident(result) operator(=) ident(create_without_callbacks) - ident(callback)operator(()symbol(:after_create)operator(\)) - ident(result) - reserved(end) - - comment(# Is called _before_ Base.save on existing objects that have a record.) - reserved(def) method(before_update)operator(()operator(\)) reserved(end) - - comment(# Is called _after_ Base.save on existing objects that have a record.) - reserved(def) method(after_update)operator(()operator(\)) reserved(end) - - reserved(def) method(update_with_callbacks) comment(#:nodoc:) - reserved(return) pre_constant(false) reserved(if) ident(callback)operator(()symbol(:before_update)operator(\)) operator(==) pre_constant(false) - ident(result) operator(=) ident(update_without_callbacks) - ident(callback)operator(()symbol(:after_update)operator(\)) - ident(result) - reserved(end) - - comment(# Is called _before_ Validations.validate (which is part of the Base.save call\).) - reserved(def) method(before_validation)operator(()operator(\)) reserved(end) - - comment(# Is called _after_ Validations.validate (which is part of the Base.save call\).) - reserved(def) method(after_validation)operator(()operator(\)) reserved(end) - - comment(# Is called _before_ Validations.validate (which is part of the Base.save call\) on new objects) - comment(# that haven't been saved yet (no record exists\).) - reserved(def) method(before_validation_on_create)operator(()operator(\)) reserved(end) - - comment(# Is called _after_ Validations.validate (which is part of the Base.save call\) on new objects) - comment(# that haven't been saved yet (no record exists\).) - reserved(def) method(after_validation_on_create)operator(()operator(\)) reserved(end) - - comment(# Is called _before_ Validations.validate (which is part of the Base.save call\) on) - comment(# existing objects that have a record.) - reserved(def) method(before_validation_on_update)operator(()operator(\)) reserved(end) - - comment(# Is called _after_ Validations.validate (which is part of the Base.save call\) on) - comment(# existing objects that have a record.) - reserved(def) method(after_validation_on_update)operator(()operator(\)) reserved(end) - - reserved(def) method(valid_with_callbacks) comment(#:nodoc:) - reserved(return) pre_constant(false) reserved(if) ident(callback)operator(()symbol(:before_validation)operator(\)) operator(==) pre_constant(false) - reserved(if) ident(new_record?) reserved(then) ident(result) operator(=) ident(callback)operator(()symbol(:before_validation_on_create)operator(\)) reserved(else) ident(result) operator(=) ident(callback)operator(()symbol(:before_validation_on_update)operator(\)) reserved(end) - reserved(return) pre_constant(false) reserved(if) ident(result) operator(==) pre_constant(false) - - ident(result) operator(=) ident(valid_without_callbacks) - - ident(callback)operator(()symbol(:after_validation)operator(\)) - reserved(if) ident(new_record?) reserved(then) ident(callback)operator(()symbol(:after_validation_on_create)operator(\)) reserved(else) ident(callback)operator(()symbol(:after_validation_on_update)operator(\)) reserved(end) - - reserved(return) ident(result) - reserved(end) - - comment(# Is called _before_ Base.destroy.) - comment(#) - comment(# Note: If you need to _destroy_ or _nullify_ associated records first,) - comment(# use the _:dependent_ option on your associations.) - reserved(def) method(before_destroy)operator(()operator(\)) reserved(end) - - comment(# Is called _after_ Base.destroy (and all the attributes have been frozen\).) - comment(#) - comment(# class Contact < ActiveRecord::Base) - comment(# after_destroy { |record| logger.info( "Contact #{record.id} was destroyed." \) }) - comment(# end) - reserved(def) method(after_destroy)operator(()operator(\)) reserved(end) - reserved(def) method(destroy_with_callbacks) comment(#:nodoc:) - reserved(return) pre_constant(false) reserved(if) ident(callback)operator(()symbol(:before_destroy)operator(\)) operator(==) pre_constant(false) - ident(result) operator(=) ident(destroy_without_callbacks) - ident(callback)operator(()symbol(:after_destroy)operator(\)) - ident(result) - reserved(end) - - ident(private) - reserved(def) method(callback)operator(()ident(method)operator(\)) - ident(notify)operator(()ident(method)operator(\)) - - ident(callbacks_for)operator(()ident(method)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(callback)operator(|) - ident(result) operator(=) reserved(case) ident(callback) - reserved(when) constant(Symbol) - pre_constant(self)operator(.)ident(send)operator(()ident(callback)operator(\)) - reserved(when) constant(String) - ident(eval)operator(()ident(callback)operator(,) ident(binding)operator(\)) - reserved(when) constant(Proc)operator(,) constant(Method) - ident(callback)operator(.)ident(call)operator(()pre_constant(self)operator(\)) - reserved(else) - reserved(if) ident(callback)operator(.)ident(respond_to?)operator(()ident(method)operator(\)) - ident(callback)operator(.)ident(send)operator(()ident(method)operator(,) pre_constant(self)operator(\)) - reserved(else) - ident(raise) constant(ActiveRecordError)operator(,) string - reserved(end) - reserved(end) - reserved(return) pre_constant(false) reserved(if) ident(result) operator(==) pre_constant(false) - reserved(end) - - ident(result) operator(=) ident(send)operator(()ident(method)operator(\)) reserved(if) ident(respond_to_without_attributes?)operator(()ident(method)operator(\)) - - reserved(return) ident(result) - reserved(end) - - reserved(def) method(callbacks_for)operator(()ident(method)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(read_inheritable_attribute)operator(()ident(method)operator(.)ident(to_sym)operator(\)) reserved(or) operator([)operator(]) - reserved(end) - - reserved(def) method(invoke_and_notify)operator(()ident(method)operator(\)) - ident(notify)operator(()ident(method)operator(\)) - ident(send)operator(()ident(method)operator(\)) reserved(if) ident(respond_to_without_attributes?)operator(()ident(method)operator(\)) - reserved(end) - - reserved(def) method(notify)operator(()ident(method)operator(\)) comment(#:nodoc:) - pre_constant(self)operator(.)ident(class)operator(.)ident(changed) - pre_constant(self)operator(.)ident(class)operator(.)ident(notify_observers)operator(()ident(method)operator(,) pre_constant(self)operator(\)) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(class) class(Base) - reserved(class) class(ConnectionSpecification) comment(#:nodoc:) - ident(attr_reader) symbol(:config)operator(,) symbol(:adapter_method) - reserved(def) method(initialize) operator(()ident(config)operator(,) ident(adapter_method)operator(\)) - instance_variable(@config)operator(,) instance_variable(@adapter_method) operator(=) ident(config)operator(,) ident(adapter_method) - reserved(end) - reserved(end) - - comment(# Check for activity after at least +verification_timeout+ seconds.) - comment(# Defaults to 0 (always check.\)) - ident(cattr_accessor) symbol(:verification_timeout) - class_variable(@@verification_timeout) operator(=) integer(0) - - comment(# The class -> [adapter_method, config] map) - class_variable(@@defined_connections) operator(=) operator({)operator(}) - - comment(# The class -> thread id -> adapter cache. (class -> adapter if not allow_concurrency\)) - class_variable(@@active_connections) operator(=) operator({)operator(}) - - reserved(class) operator(<<) class(self) - comment(# Retrieve the connection cache.) - reserved(def) method(thread_safe_active_connections) comment(#:nodoc:) - class_variable(@@active_connections)operator([)constant(Thread)operator(.)ident(current)operator(.)ident(object_id)operator(]) operator(||=) operator({)operator(}) - reserved(end) - - reserved(def) method(single_threaded_active_connections) comment(#:nodoc:) - class_variable(@@active_connections) - reserved(end) - - comment(# pick up the right active_connection method from @@allow_concurrency) - reserved(if) class_variable(@@allow_concurrency) - ident(alias_method) symbol(:active_connections)operator(,) symbol(:thread_safe_active_connections) - reserved(else) - ident(alias_method) symbol(:active_connections)operator(,) symbol(:single_threaded_active_connections) - reserved(end) - - comment(# set concurrency support flag (not thread safe, like most of the methods in this file\)) - reserved(def) method(allow_concurrency=)operator(()ident(threaded)operator(\)) comment(#:nodoc:) - ident(logger)operator(.)ident(debug) stringdelimiter(")> reserved(if) ident(logger) - reserved(return) reserved(if) class_variable(@@allow_concurrency) operator(==) ident(threaded) - ident(clear_all_cached_connections!) - class_variable(@@allow_concurrency) operator(=) ident(threaded) - ident(method_prefix) operator(=) ident(threaded) operator(?) string operator(:) string - ident(sing) operator(=) operator(()reserved(class) operator(<<) class(self)operator(;) pre_constant(self)operator(;) reserved(end)operator(\)) - operator([)symbol(:active_connections)operator(,) symbol(:scoped_methods)operator(])operator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - ident(sing)operator(.)ident(send)operator(()symbol(:alias_method)operator(,) ident(method)operator(,) stringcontent(_)inlinedelimiter(")>operator(\)) - reserved(end) - ident(log_connections) reserved(if) ident(logger) - reserved(end) - - reserved(def) method(active_connection_name) comment(#:nodoc:) - instance_variable(@active_connection_name) operator(||=) - reserved(if) ident(active_connections)operator([)ident(name)operator(]) operator(||) class_variable(@@defined_connections)operator([)ident(name)operator(]) - ident(name) - reserved(elsif) pre_constant(self) operator(==) constant(ActiveRecord)operator(::)constant(Base) - pre_constant(nil) - reserved(else) - ident(superclass)operator(.)ident(active_connection_name) - reserved(end) - reserved(end) - - reserved(def) method(clear_active_connection_name) comment(#:nodoc:) - instance_variable(@active_connection_name) operator(=) pre_constant(nil) - ident(subclasses)operator(.)ident(each) operator({) operator(|)ident(klass)operator(|) ident(klass)operator(.)ident(clear_active_connection_name) operator(}) - reserved(end) - - comment(# Returns the connection currently associated with the class. This can) - comment(# also be used to "borrow" the connection to do database work unrelated) - comment(# to any of the specific Active Records.) - reserved(def) method(connection) - reserved(if) instance_variable(@active_connection_name) operator(&&) operator(()ident(conn) operator(=) ident(active_connections)operator([)instance_variable(@active_connection_name)operator(])operator(\)) - ident(conn) - reserved(else) - comment(# retrieve_connection sets the cache key.) - ident(conn) operator(=) ident(retrieve_connection) - ident(active_connections)operator([)instance_variable(@active_connection_name)operator(]) operator(=) ident(conn) - reserved(end) - reserved(end) - - comment(# Clears the cache which maps classes to connections.) - reserved(def) method(clear_active_connections!) - ident(clear_cache!)operator(()class_variable(@@active_connections)operator(\)) reserved(do) operator(|)ident(name)operator(,) ident(conn)operator(|) - ident(conn)operator(.)ident(disconnect!) - reserved(end) - reserved(end) - - comment(# Verify active connections.) - reserved(def) method(verify_active_connections!) comment(#:nodoc:) - reserved(if) class_variable(@@allow_concurrency) - ident(remove_stale_cached_threads!)operator(()class_variable(@@active_connections)operator(\)) reserved(do) operator(|)ident(name)operator(,) ident(conn)operator(|) - ident(conn)operator(.)ident(disconnect!) - reserved(end) - reserved(end) - - ident(active_connections)operator(.)ident(each_value) reserved(do) operator(|)ident(connection)operator(|) - ident(connection)operator(.)ident(verify!)operator(()class_variable(@@verification_timeout)operator(\)) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(clear_cache!)operator(()ident(cache)operator(,) ident(thread_id) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - reserved(if) ident(cache) - reserved(if) class_variable(@@allow_concurrency) - ident(thread_id) operator(||=) constant(Thread)operator(.)ident(current)operator(.)ident(object_id) - ident(thread_cache)operator(,) ident(cache) operator(=) ident(cache)operator(,) ident(cache)operator([)ident(thread_id)operator(]) - reserved(return) reserved(unless) ident(cache) - reserved(end) - - ident(cache)operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) reserved(if) ident(block_given?) - ident(cache)operator(.)ident(clear) - reserved(end) - reserved(ensure) - reserved(if) ident(thread_cache) operator(&&) class_variable(@@allow_concurrency) - ident(thread_cache)operator(.)ident(delete)operator(()ident(thread_id)operator(\)) - reserved(end) - reserved(end) - - comment(# Remove stale threads from the cache.) - reserved(def) method(remove_stale_cached_threads!)operator(()ident(cache)operator(,) operator(&)ident(block)operator(\)) - ident(stale) operator(=) constant(Set)operator(.)ident(new)operator(()ident(cache)operator(.)ident(keys)operator(\)) - - constant(Thread)operator(.)ident(list)operator(.)ident(each) reserved(do) operator(|)ident(thread)operator(|) - ident(stale)operator(.)ident(delete)operator(()ident(thread)operator(.)ident(object_id)operator(\)) reserved(if) ident(thread)operator(.)ident(alive?) - reserved(end) - - ident(stale)operator(.)ident(each) reserved(do) operator(|)ident(thread_id)operator(|) - ident(clear_cache!)operator(()ident(cache)operator(,) ident(thread_id)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(clear_all_cached_connections!) - reserved(if) class_variable(@@allow_concurrency) - class_variable(@@active_connections)operator(.)ident(each_value) reserved(do) operator(|)ident(connection_hash_for_thread)operator(|) - ident(connection_hash_for_thread)operator(.)ident(each_value) operator({)operator(|)ident(conn)operator(|) ident(conn)operator(.)ident(disconnect!) operator(}) - ident(connection_hash_for_thread)operator(.)ident(clear) - reserved(end) - reserved(else) - class_variable(@@active_connections)operator(.)ident(each_value) operator({)operator(|)ident(conn)operator(|) ident(conn)operator(.)ident(disconnect!) operator(}) - reserved(end) - class_variable(@@active_connections)operator(.)ident(clear) - reserved(end) - reserved(end) - - comment(# Returns the connection currently associated with the class. This can) - comment(# also be used to "borrow" the connection to do database work that isn't) - comment(# easily done without going straight to SQL.) - reserved(def) method(connection) - pre_constant(self)operator(.)ident(class)operator(.)ident(connection) - reserved(end) - - comment(# Establishes the connection to the database. Accepts a hash as input where) - comment(# the :adapter key must be specified with the name of a database adapter (in lower-case\)) - comment(# example for regular databases (MySQL, Postgresql, etc\):) - comment(#) - comment(# ActiveRecord::Base.establish_connection() - comment(# :adapter => "mysql",) - comment(# :host => "localhost",) - comment(# :username => "myuser",) - comment(# :password => "mypass",) - comment(# :database => "somedatabase") - comment(# \)) - comment(#) - comment(# Example for SQLite database:) - comment(#) - comment(# ActiveRecord::Base.establish_connection() - comment(# :adapter => "sqlite",) - comment(# :database => "path/to/dbfile") - comment(# \)) - comment(#) - comment(# Also accepts keys as strings (for parsing from yaml for example\):) - comment(# ActiveRecord::Base.establish_connection() - comment(# "adapter" => "sqlite",) - comment(# "database" => "path/to/dbfile") - comment(# \)) - comment(#) - comment(# The exceptions AdapterNotSpecified, AdapterNotFound and ArgumentError) - comment(# may be returned on an error.) - reserved(def) pre_constant(self)operator(.)method(establish_connection)operator(()ident(spec) operator(=) pre_constant(nil)operator(\)) - reserved(case) ident(spec) - reserved(when) pre_constant(nil) - ident(raise) constant(AdapterNotSpecified) reserved(unless) reserved(defined?) constant(RAILS_ENV) - ident(establish_connection)operator(()constant(RAILS_ENV)operator(\)) - reserved(when) constant(ConnectionSpecification) - ident(clear_active_connection_name) - instance_variable(@active_connection_name) operator(=) ident(name) - class_variable(@@defined_connections)operator([)ident(name)operator(]) operator(=) ident(spec) - reserved(when) constant(Symbol)operator(,) constant(String) - reserved(if) ident(configuration) operator(=) ident(configurations)operator([)ident(spec)operator(.)ident(to_s)operator(]) - ident(establish_connection)operator(()ident(configuration)operator(\)) - reserved(else) - ident(raise) constant(AdapterNotSpecified)operator(,) stringcontent( database is not configured)delimiter(")> - reserved(end) - reserved(else) - ident(spec) operator(=) ident(spec)operator(.)ident(symbolize_keys) - reserved(unless) ident(spec)operator(.)ident(key?)operator(()symbol(:adapter)operator(\)) reserved(then) ident(raise) constant(AdapterNotSpecified)operator(,) string reserved(end) - ident(adapter_method) operator(=) stringcontent(_connection)delimiter(")> - reserved(unless) ident(respond_to?)operator(()ident(adapter_method)operator(\)) reserved(then) ident(raise) constant(AdapterNotFound)operator(,) stringcontent( adapter)delimiter(")> reserved(end) - ident(remove_connection) - ident(establish_connection)operator(()constant(ConnectionSpecification)operator(.)ident(new)operator(()ident(spec)operator(,) ident(adapter_method)operator(\))operator(\)) - reserved(end) - reserved(end) - - comment(# Locate the connection of the nearest super class. This can be an) - comment(# active or defined connections: if it is the latter, it will be) - comment(# opened and set as the active connection for the class it was defined) - comment(# for (not necessarily the current class\).) - reserved(def) pre_constant(self)operator(.)method(retrieve_connection) comment(#:nodoc:) - comment(# Name is nil if establish_connection hasn't been called for) - comment(# some class along the inheritance chain up to AR::Base yet.) - reserved(if) ident(name) operator(=) ident(active_connection_name) - reserved(if) ident(conn) operator(=) ident(active_connections)operator([)ident(name)operator(]) - comment(# Verify the connection.) - ident(conn)operator(.)ident(verify!)operator(()class_variable(@@verification_timeout)operator(\)) - reserved(elsif) ident(spec) operator(=) class_variable(@@defined_connections)operator([)ident(name)operator(]) - comment(# Activate this connection specification.) - ident(klass) operator(=) ident(name)operator(.)ident(constantize) - ident(klass)operator(.)ident(connection) operator(=) ident(spec) - ident(conn) operator(=) ident(active_connections)operator([)ident(name)operator(]) - reserved(end) - reserved(end) - - ident(conn) reserved(or) ident(raise) constant(ConnectionNotEstablished) - reserved(end) - - comment(# Returns true if a connection that's accessible to this class have already been opened.) - reserved(def) pre_constant(self)operator(.)method(connected?) - ident(active_connections)operator([)ident(active_connection_name)operator(]) operator(?) pre_constant(true) operator(:) pre_constant(false) - reserved(end) - - comment(# Remove the connection for this class. This will close the active) - comment(# connection and the defined connection (if they exist\). The result) - comment(# can be used as argument for establish_connection, for easy) - comment(# re-establishing of the connection.) - reserved(def) pre_constant(self)operator(.)method(remove_connection)operator(()ident(klass)operator(=)pre_constant(self)operator(\)) - ident(spec) operator(=) class_variable(@@defined_connections)operator([)ident(klass)operator(.)ident(name)operator(]) - ident(konn) operator(=) ident(active_connections)operator([)ident(klass)operator(.)ident(name)operator(]) - class_variable(@@defined_connections)operator(.)ident(delete_if) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) ident(value) operator(==) ident(spec) operator(}) - ident(active_connections)operator(.)ident(delete_if) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) ident(value) operator(==) ident(konn) operator(}) - ident(konn)operator(.)ident(disconnect!) reserved(if) ident(konn) - ident(spec)operator(.)ident(config) reserved(if) ident(spec) - reserved(end) - - comment(# Set the connection for the class.) - reserved(def) pre_constant(self)operator(.)method(connection=)operator(()ident(spec)operator(\)) comment(#:nodoc:) - reserved(if) ident(spec)operator(.)ident(kind_of?)operator(()constant(ActiveRecord)operator(::)constant(ConnectionAdapters)operator(::)constant(AbstractAdapter)operator(\)) - ident(active_connections)operator([)ident(name)operator(]) operator(=) ident(spec) - reserved(elsif) ident(spec)operator(.)ident(kind_of?)operator(()constant(ConnectionSpecification)operator(\)) - pre_constant(self)operator(.)ident(connection) operator(=) pre_constant(self)operator(.)ident(send)operator(()ident(spec)operator(.)ident(adapter_method)operator(,) ident(spec)operator(.)ident(config)operator(\)) - reserved(elsif) ident(spec)operator(.)ident(nil?) - ident(raise) constant(ConnectionNotEstablished) - reserved(else) - ident(establish_connection) ident(spec) - reserved(end) - reserved(end) - - comment(# connection state logging) - reserved(def) pre_constant(self)operator(.)method(log_connections) comment(#:nodoc:) - reserved(if) ident(logger) - ident(logger)operator(.)ident(info) stringdelimiter(")> - ident(logger)operator(.)ident(info) stringdelimiter(")> - ident(logger)operator(.)ident(info) stringdelimiter(")> - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(ConnectionAdapters) comment(# :nodoc:) - reserved(module) class(DatabaseStatements) - comment(# Returns an array of record hashes with the column names as keys and) - comment(# column values as values.) - reserved(def) method(select_all)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - reserved(end) - - comment(# Returns a record hash with the column names as keys and column values) - comment(# as values.) - reserved(def) method(select_one)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - reserved(end) - - comment(# Returns a single value from a record) - reserved(def) method(select_value)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(result) operator(=) ident(select_one)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(result)operator(.)ident(nil?) operator(?) pre_constant(nil) operator(:) ident(result)operator(.)ident(values)operator(.)ident(first) - reserved(end) - - comment(# Returns an array of the values of the first column in a select:) - comment(# select_values("SELECT id FROM companies LIMIT 3"\) => [1,2,3]) - reserved(def) method(select_values)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(result) operator(=) ident(select_all)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(result)operator(.)ident(map)operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(values)operator(.)ident(first) operator(}) - reserved(end) - - comment(# Executes the SQL statement in the context of this connection.) - comment(# This abstract method raises a NotImplementedError.) - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(raise) constant(NotImplementedError)operator(,) string - reserved(end) - - comment(# Returns the last auto-generated ID from the affected table.) - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(,) ident(sequence_name) operator(=) pre_constant(nil)operator(\)) reserved(end) - - comment(# Executes the update statement and returns the number of rows affected.) - reserved(def) method(update)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) reserved(end) - - comment(# Executes the delete statement and returns the number of rows affected.) - reserved(def) method(delete)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) reserved(end) - - comment(# Wrap a block in a transaction. Returns result of block.) - reserved(def) method(transaction)operator(()ident(start_db_transaction) operator(=) pre_constant(true)operator(\)) - ident(transaction_open) operator(=) pre_constant(false) - reserved(begin) - reserved(if) ident(block_given?) - reserved(if) ident(start_db_transaction) - ident(begin_db_transaction) - ident(transaction_open) operator(=) pre_constant(true) - reserved(end) - reserved(yield) - reserved(end) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(database_transaction_rollback) - reserved(if) ident(transaction_open) - ident(transaction_open) operator(=) pre_constant(false) - ident(rollback_db_transaction) - reserved(end) - ident(raise) - reserved(end) - reserved(ensure) - ident(commit_db_transaction) reserved(if) ident(transaction_open) - reserved(end) - - comment(# Begins the transaction (and turns off auto-committing\).) - reserved(def) method(begin_db_transaction)operator(()operator(\)) reserved(end) - - comment(# Commits the transaction (and turns on auto-committing\).) - reserved(def) method(commit_db_transaction)operator(()operator(\)) reserved(end) - - comment(# Rolls back the transaction (and turns on auto-committing\). Must be) - comment(# done if the transaction block raises an exception or returns false.) - reserved(def) method(rollback_db_transaction)operator(()operator(\)) reserved(end) - - comment(# Alias for #add_limit_offset!.) - reserved(def) method(add_limit!)operator(()ident(sql)operator(,) ident(options)operator(\)) - ident(add_limit_offset!)operator(()ident(sql)operator(,) ident(options)operator(\)) reserved(if) ident(options) - reserved(end) - - comment(# Appends +LIMIT+ and +OFFSET+ options to a SQL statement.) - comment(# This method *modifies* the +sql+ parameter.) - comment(# ===== Examples) - comment(# add_limit_offset!('SELECT * FROM suppliers', {:limit => 10, :offset => 50}\)) - comment(# generates) - comment(# SELECT * FROM suppliers LIMIT 10 OFFSET 50) - reserved(def) method(add_limit_offset!)operator(()ident(sql)operator(,) ident(options)operator(\)) - reserved(if) ident(limit) operator(=) ident(options)operator([)symbol(:limit)operator(]) - ident(sql) operator(<<) stringdelimiter(")> - reserved(if) ident(offset) operator(=) ident(options)operator([)symbol(:offset)operator(]) - ident(sql) operator(<<) stringdelimiter(")> - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(default_sequence_name)operator(()ident(table)operator(,) ident(column)operator(\)) - pre_constant(nil) - reserved(end) - - comment(# Set the sequence to the max value of the table's column.) - reserved(def) method(reset_sequence!)operator(()ident(table)operator(,) ident(column)operator(,) ident(sequence) operator(=) pre_constant(nil)operator(\)) - comment(# Do nothing by default. Implement for PostgreSQL, Oracle, ...) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(ConnectionAdapters) comment(# :nodoc:) - reserved(module) class(Quoting) - comment(# Quotes the column value to help prevent) - comment(# {SQL injection attacks}[http://en.wikipedia.org/wiki/SQL_injection].) - reserved(def) method(quote)operator(()ident(value)operator(,) ident(column) operator(=) pre_constant(nil)operator(\)) - reserved(case) ident(value) - reserved(when) constant(String) - reserved(if) ident(column) operator(&&) ident(column)operator(.)ident(type) operator(==) symbol(:binary) operator(&&) ident(column)operator(.)ident(class)operator(.)ident(respond_to?)operator(()symbol(:string_to_binary)operator(\)) - stringcontent(')delimiter(")> comment(# ' (for ruby-mode\)) - reserved(elsif) ident(column) operator(&&) operator([)symbol(:integer)operator(,) symbol(:float)operator(])operator(.)ident(include?)operator(()ident(column)operator(.)ident(type)operator(\)) - ident(value)operator(.)ident(to_s) - reserved(else) - stringcontent(')delimiter(")> comment(# ' (for ruby-mode\)) - reserved(end) - reserved(when) constant(NilClass) reserved(then) string - reserved(when) constant(TrueClass) reserved(then) operator(()ident(column) operator(&&) ident(column)operator(.)ident(type) operator(==) symbol(:integer) operator(?) string operator(:) ident(quoted_true)operator(\)) - reserved(when) constant(FalseClass) reserved(then) operator(()ident(column) operator(&&) ident(column)operator(.)ident(type) operator(==) symbol(:integer) operator(?) string operator(:) ident(quoted_false)operator(\)) - reserved(when) constant(Float)operator(,) constant(Fixnum)operator(,) constant(Bignum) reserved(then) ident(value)operator(.)ident(to_s) - reserved(when) constant(Date) reserved(then) stringcontent(')delimiter(")> - reserved(when) constant(Time)operator(,) constant(DateTime) reserved(then) stringcontent(')delimiter(")> - reserved(else) stringcontent(')delimiter(")> - reserved(end) - reserved(end) - - comment(# Quotes a string, escaping any ' (single quote\) and \\ (backslash\)) - comment(# characters.) - reserved(def) method(quote_string)operator(()ident(s)operator(\)) - ident(s)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) comment(# ' (for ruby-mode\)) - reserved(end) - - comment(# Returns a quoted form of the column name. This is highly adapter) - comment(# specific.) - reserved(def) method(quote_column_name)operator(()ident(name)operator(\)) - ident(name) - reserved(end) - - reserved(def) method(quoted_true) - string - reserved(end) - - reserved(def) method(quoted_false) - string - reserved(end) - - reserved(def) method(quoted_date)operator(()ident(value)operator(\)) - ident(value)operator(.)ident(strftime)operator(()stringoperator(\)) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(module) class(ConnectionAdapters) comment(#:nodoc:) - comment(# An abstract definition of a column in a table.) - reserved(class) class(Column) - ident(attr_reader) symbol(:name)operator(,) symbol(:default)operator(,) symbol(:type)operator(,) symbol(:limit)operator(,) symbol(:null)operator(,) symbol(:sql_type) - ident(attr_accessor) symbol(:primary) - - comment(# Instantiates a new column in the table.) - comment(#) - comment(# +name+ is the column's name, as in supplier_id int(11\).) - comment(# +default+ is the type-casted default value, such as sales_stage varchar(20\) default 'new'.) - comment(# +sql_type+ is only used to extract the column's length, if necessary. For example, company_name varchar(60\).) - comment(# +null+ determines if this column allows +NULL+ values.) - reserved(def) method(initialize)operator(()ident(name)operator(,) ident(default)operator(,) ident(sql_type) operator(=) pre_constant(nil)operator(,) ident(null) operator(=) pre_constant(true)operator(\)) - instance_variable(@name)operator(,) instance_variable(@type)operator(,) instance_variable(@null) operator(=) ident(name)operator(,) ident(simplified_type)operator(()ident(sql_type)operator(\))operator(,) ident(null) - instance_variable(@sql_type) operator(=) ident(sql_type) - comment(# have to do this one separately because type_cast depends on #type) - instance_variable(@default) operator(=) ident(type_cast)operator(()ident(default)operator(\)) - instance_variable(@limit) operator(=) ident(extract_limit)operator(()ident(sql_type)operator(\)) reserved(unless) ident(sql_type)operator(.)ident(nil?) - instance_variable(@primary) operator(=) pre_constant(nil) - instance_variable(@text) operator(=) operator([)symbol(:string)operator(,) symbol(:text)operator(])operator(.)ident(include?) instance_variable(@type) - instance_variable(@number) operator(=) operator([)symbol(:float)operator(,) symbol(:integer)operator(])operator(.)ident(include?) instance_variable(@type) - reserved(end) - - reserved(def) method(text?) - instance_variable(@text) - reserved(end) - - reserved(def) method(number?) - instance_variable(@number) - reserved(end) - - comment(# Returns the Ruby class that corresponds to the abstract data type.) - reserved(def) method(klass) - reserved(case) ident(type) - reserved(when) symbol(:integer) reserved(then) constant(Fixnum) - reserved(when) symbol(:float) reserved(then) constant(Float) - reserved(when) symbol(:datetime) reserved(then) constant(Time) - reserved(when) symbol(:date) reserved(then) constant(Date) - reserved(when) symbol(:timestamp) reserved(then) constant(Time) - reserved(when) symbol(:time) reserved(then) constant(Time) - reserved(when) symbol(:text)operator(,) symbol(:string) reserved(then) constant(String) - reserved(when) symbol(:binary) reserved(then) constant(String) - reserved(when) symbol(:boolean) reserved(then) constant(Object) - reserved(end) - reserved(end) - - comment(# Casts value (which is a String\) to an appropriate instance.) - reserved(def) method(type_cast)operator(()ident(value)operator(\)) - reserved(return) pre_constant(nil) reserved(if) ident(value)operator(.)ident(nil?) - reserved(case) ident(type) - reserved(when) symbol(:string) reserved(then) ident(value) - reserved(when) symbol(:text) reserved(then) ident(value) - reserved(when) symbol(:integer) reserved(then) ident(value)operator(.)ident(to_i) reserved(rescue) ident(value) operator(?) integer(1) operator(:) integer(0) - reserved(when) symbol(:float) reserved(then) ident(value)operator(.)ident(to_f) - reserved(when) symbol(:datetime) reserved(then) pre_constant(self)operator(.)ident(class)operator(.)ident(string_to_time)operator(()ident(value)operator(\)) - reserved(when) symbol(:timestamp) reserved(then) pre_constant(self)operator(.)ident(class)operator(.)ident(string_to_time)operator(()ident(value)operator(\)) - reserved(when) symbol(:time) reserved(then) pre_constant(self)operator(.)ident(class)operator(.)ident(string_to_dummy_time)operator(()ident(value)operator(\)) - reserved(when) symbol(:date) reserved(then) pre_constant(self)operator(.)ident(class)operator(.)ident(string_to_date)operator(()ident(value)operator(\)) - reserved(when) symbol(:binary) reserved(then) pre_constant(self)operator(.)ident(class)operator(.)ident(binary_to_string)operator(()ident(value)operator(\)) - reserved(when) symbol(:boolean) reserved(then) pre_constant(self)operator(.)ident(class)operator(.)ident(value_to_boolean)operator(()ident(value)operator(\)) - reserved(else) ident(value) - reserved(end) - reserved(end) - - reserved(def) method(type_cast_code)operator(()ident(var_name)operator(\)) - reserved(case) ident(type) - reserved(when) symbol(:string) reserved(then) pre_constant(nil) - reserved(when) symbol(:text) reserved(then) pre_constant(nil) - reserved(when) symbol(:integer) reserved(then) stringcontent(.to_i rescue )inlinecontent( ? 1 : 0\))delimiter(")> - reserved(when) symbol(:float) reserved(then) stringcontent(.to_f)delimiter(")> - reserved(when) symbol(:datetime) reserved(then) stringcontent(.string_to_time()inlinecontent(\))delimiter(")> - reserved(when) symbol(:timestamp) reserved(then) stringcontent(.string_to_time()inlinecontent(\))delimiter(")> - reserved(when) symbol(:time) reserved(then) stringcontent(.string_to_dummy_time()inlinecontent(\))delimiter(")> - reserved(when) symbol(:date) reserved(then) stringcontent(.string_to_date()inlinecontent(\))delimiter(")> - reserved(when) symbol(:binary) reserved(then) stringcontent(.binary_to_string()inlinecontent(\))delimiter(")> - reserved(when) symbol(:boolean) reserved(then) stringcontent(.value_to_boolean()inlinecontent(\))delimiter(")> - reserved(else) pre_constant(nil) - reserved(end) - reserved(end) - - comment(# Returns the human name of the column name.) - comment(#) - comment(# ===== Examples) - comment(# Column.new('sales_stage', ...\).human_name #=> 'Sales stage') - reserved(def) method(human_name) - constant(Base)operator(.)ident(human_attribute_name)operator(()instance_variable(@name)operator(\)) - reserved(end) - - comment(# Used to convert from Strings to BLOBs) - reserved(def) pre_constant(self)operator(.)method(string_to_binary)operator(()ident(value)operator(\)) - ident(value) - reserved(end) - - comment(# Used to convert from BLOBs to Strings) - reserved(def) pre_constant(self)operator(.)method(binary_to_string)operator(()ident(value)operator(\)) - ident(value) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(string_to_date)operator(()ident(string)operator(\)) - reserved(return) ident(string) reserved(unless) ident(string)operator(.)ident(is_a?)operator(()constant(String)operator(\)) - ident(date_array) operator(=) constant(ParseDate)operator(.)ident(parsedate)operator(()ident(string)operator(\)) - comment(# treat 0000-00-00 as nil) - constant(Date)operator(.)ident(new)operator(()ident(date_array)operator([)integer(0)operator(])operator(,) ident(date_array)operator([)integer(1)operator(])operator(,) ident(date_array)operator([)integer(2)operator(])operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(string_to_time)operator(()ident(string)operator(\)) - reserved(return) ident(string) reserved(unless) ident(string)operator(.)ident(is_a?)operator(()constant(String)operator(\)) - ident(time_array) operator(=) constant(ParseDate)operator(.)ident(parsedate)operator(()ident(string)operator(\))operator([)integer(0)operator(..)integer(5)operator(]) - comment(# treat 0000-00-00 00:00:00 as nil) - constant(Time)operator(.)ident(send)operator(()constant(Base)operator(.)ident(default_timezone)operator(,) operator(*)ident(time_array)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(string_to_dummy_time)operator(()ident(string)operator(\)) - reserved(return) ident(string) reserved(unless) ident(string)operator(.)ident(is_a?)operator(()constant(String)operator(\)) - ident(time_array) operator(=) constant(ParseDate)operator(.)ident(parsedate)operator(()ident(string)operator(\)) - comment(# pad the resulting array with dummy date information) - ident(time_array)operator([)integer(0)operator(]) operator(=) integer(2000)operator(;) ident(time_array)operator([)integer(1)operator(]) operator(=) integer(1)operator(;) ident(time_array)operator([)integer(2)operator(]) operator(=) integer(1)operator(;) - constant(Time)operator(.)ident(send)operator(()constant(Base)operator(.)ident(default_timezone)operator(,) operator(*)ident(time_array)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - - comment(# convert something to a boolean) - reserved(def) pre_constant(self)operator(.)method(value_to_boolean)operator(()ident(value)operator(\)) - reserved(return) ident(value) reserved(if) ident(value)operator(==)pre_constant(true) operator(||) ident(value)operator(==)pre_constant(false) - reserved(case) ident(value)operator(.)ident(to_s)operator(.)ident(downcase) - reserved(when) stringoperator(,) stringoperator(,) string reserved(then) pre_constant(true) - reserved(else) pre_constant(false) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(extract_limit)operator(()ident(sql_type)operator(\)) - global_variable($1)operator(.)ident(to_i) reserved(if) ident(sql_type) operator(=)operator(~) regexp - reserved(end) - - reserved(def) method(simplified_type)operator(()ident(field_type)operator(\)) - reserved(case) ident(field_type) - reserved(when) regexp - symbol(:integer) - reserved(when) regexp - symbol(:float) - reserved(when) regexp - symbol(:datetime) - reserved(when) regexp - symbol(:timestamp) - reserved(when) regexp - symbol(:time) - reserved(when) regexp - symbol(:date) - reserved(when) regexpoperator(,) regexp - symbol(:text) - reserved(when) regexpoperator(,) regexp - symbol(:binary) - reserved(when) regexpoperator(,) regexp - symbol(:string) - reserved(when) regexp - symbol(:boolean) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(IndexDefinition) operator(<) constant(Struct)operator(.)ident(new)operator(()symbol(:table)operator(,) symbol(:name)operator(,) symbol(:unique)operator(,) symbol(:columns)operator(\)) comment(#:nodoc:) - reserved(end) - - reserved(class) class(ColumnDefinition) operator(<) constant(Struct)operator(.)ident(new)operator(()symbol(:base)operator(,) symbol(:name)operator(,) symbol(:type)operator(,) symbol(:limit)operator(,) symbol(:default)operator(,) symbol(:null)operator(\)) comment(#:nodoc:) - reserved(def) method(to_sql) - ident(column_sql) operator(=) stringcontent( )inlinedelimiter(")> - ident(add_column_options!)operator(()ident(column_sql)operator(,) symbol(:null) operator(=)operator(>) ident(null)operator(,) symbol(:default) operator(=)operator(>) ident(default)operator(\)) - ident(column_sql) - reserved(end) - reserved(alias) method(to_s) symbol(:to_sql) - - ident(private) - reserved(def) method(type_to_sql)operator(()ident(name)operator(,) ident(limit)operator(\)) - ident(base)operator(.)ident(type_to_sql)operator(()ident(name)operator(,) ident(limit)operator(\)) reserved(rescue) ident(name) - reserved(end) - - reserved(def) method(add_column_options!)operator(()ident(sql)operator(,) ident(options)operator(\)) - ident(base)operator(.)ident(add_column_options!)operator(()ident(sql)operator(,) ident(options)operator(.)ident(merge)operator(()symbol(:column) operator(=)operator(>) pre_constant(self)operator(\))operator(\)) - reserved(end) - reserved(end) - - comment(# Represents a SQL table in an abstract way.) - comment(# Columns are stored as ColumnDefinition in the #columns attribute.) - reserved(class) class(TableDefinition) - ident(attr_accessor) symbol(:columns) - - reserved(def) method(initialize)operator(()ident(base)operator(\)) - instance_variable(@columns) operator(=) operator([)operator(]) - instance_variable(@base) operator(=) ident(base) - reserved(end) - - comment(# Appends a primary key definition to the table definition.) - comment(# Can be called multiple times, but this is probably not a good idea.) - reserved(def) method(primary_key)operator(()ident(name)operator(\)) - ident(column)operator(()ident(name)operator(,) ident(native)operator([)symbol(:primary_key)operator(])operator(\)) - reserved(end) - - comment(# Returns a ColumnDefinition for the column with name +name+.) - reserved(def) method([])operator(()ident(name)operator(\)) - instance_variable(@columns)operator(.)ident(find) operator({)operator(|)ident(column)operator(|) ident(column)operator(.)ident(name)operator(.)ident(to_s) operator(==) ident(name)operator(.)ident(to_s)operator(}) - reserved(end) - - comment(# Instantiates a new column for the table.) - comment(# The +type+ parameter must be one of the following values:) - comment(# :primary_key, :string, :text,) - comment(# :integer, :float, :datetime,) - comment(# :timestamp, :time, :date,) - comment(# :binary, :boolean.) - comment(#) - comment(# Available options are (none of these exists by default\):) - comment(# * :limit:) - comment(# Requests a maximum column length (:string, :text,) - comment(# :binary or :integer columns only\)) - comment(# * :default:) - comment(# The column's default value. You cannot explicitely set the default) - comment(# value to +NULL+. Simply leave off this option if you want a +NULL+) - comment(# default value.) - comment(# * :null:) - comment(# Allows or disallows +NULL+ values in the column. This option could) - comment(# have been named :null_allowed.) - comment(#) - comment(# This method returns self.) - comment(#) - comment(# ===== Examples) - comment(# # Assuming def is an instance of TableDefinition) - comment(# def.column(:granted, :boolean\)) - comment(# #=> granted BOOLEAN) - comment(#) - comment(# def.column(:picture, :binary, :limit => 2.megabytes\)) - comment(# #=> picture BLOB(2097152\)) - comment(#) - comment(# def.column(:sales_stage, :string, :limit => 20, :default => 'new', :null => false\)) - comment(# #=> sales_stage VARCHAR(20\) DEFAULT 'new' NOT NULL) - reserved(def) method(column)operator(()ident(name)operator(,) ident(type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(column) operator(=) pre_constant(self)operator([)ident(name)operator(]) operator(||) constant(ColumnDefinition)operator(.)ident(new)operator(()instance_variable(@base)operator(,) ident(name)operator(,) ident(type)operator(\)) - ident(column)operator(.)ident(limit) operator(=) ident(options)operator([)symbol(:limit)operator(]) operator(||) ident(native)operator([)ident(type)operator(.)ident(to_sym)operator(])operator([)symbol(:limit)operator(]) reserved(if) ident(options)operator([)symbol(:limit)operator(]) reserved(or) ident(native)operator([)ident(type)operator(.)ident(to_sym)operator(]) - ident(column)operator(.)ident(default) operator(=) ident(options)operator([)symbol(:default)operator(]) - ident(column)operator(.)ident(null) operator(=) ident(options)operator([)symbol(:null)operator(]) - instance_variable(@columns) operator(<<) ident(column) reserved(unless) instance_variable(@columns)operator(.)ident(include?) ident(column) - pre_constant(self) - reserved(end) - - comment(# Returns a String whose contents are the column definitions) - comment(# concatenated together. This string can then be pre and appended to) - comment(# to generate the final SQL to create the table.) - reserved(def) method(to_sql) - instance_variable(@columns) operator(*) string - reserved(end) - - ident(private) - reserved(def) method(native) - instance_variable(@base)operator(.)ident(native_database_types) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(ConnectionAdapters) comment(# :nodoc:) - reserved(module) class(SchemaStatements) - comment(# Returns a Hash of mappings from the abstract data types to the native) - comment(# database types. See TableDefinition#column for details on the recognized) - comment(# abstract data types.) - reserved(def) method(native_database_types) - operator({)operator(}) - reserved(end) - - comment(# This is the maximum length a table alias can be) - reserved(def) method(table_alias_length) - integer(255) - reserved(end) - - comment(# Truncates a table alias according to the limits of the current adapter. ) - reserved(def) method(table_alias_for)operator(()ident(table_name)operator(\)) - ident(table_name)operator([)integer(0)operator(..)ident(table_alias_length)operator(-)integer(1)operator(])operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - comment(# def tables(name = nil\) end) - - comment(# Returns an array of indexes for the given table.) - comment(# def indexes(table_name, name = nil\) end) - - comment(# Returns an array of Column objects for the table specified by +table_name+.) - comment(# See the concrete implementation for details on the expected parameter values.) - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) reserved(end) - - comment(# Creates a new table) - comment(# There are two ways to work with #create_table. You can use the block) - comment(# form or the regular form, like this:) - comment(#) - comment(# === Block form) - comment(# # create_table(\) yields a TableDefinition instance) - comment(# create_table(:suppliers\) do |t|) - comment(# t.column :name, :string, :limit => 60) - comment(# # Other fields here) - comment(# end) - comment(#) - comment(# === Regular form) - comment(# create_table(:suppliers\)) - comment(# add_column(:suppliers, :name, :string, {:limit => 60}\)) - comment(#) - comment(# The +options+ hash can include the following keys:) - comment(# [:id]) - comment(# Set to true or false to add/not add a primary key column) - comment(# automatically. Defaults to true.) - comment(# [:primary_key]) - comment(# The name of the primary key, if one is to be added automatically.) - comment(# Defaults to +id+.) - comment(# [:options]) - comment(# Any extra options you want appended to the table definition.) - comment(# [:temporary]) - comment(# Make a temporary table.) - comment(# [:force]) - comment(# Set to true or false to drop the table before creating it.) - comment(# Defaults to false.) - comment(#) - comment(# ===== Examples) - comment(# ====== Add a backend specific option to the generated SQL (MySQL\)) - comment(# create_table(:suppliers, :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8'\)) - comment(# generates:) - comment(# CREATE TABLE suppliers () - comment(# id int(11\) DEFAULT NULL auto_increment PRIMARY KEY) - comment(# \) ENGINE=InnoDB DEFAULT CHARSET=utf8) - comment(#) - comment(# ====== Rename the primary key column) - comment(# create_table(:objects, :primary_key => 'guid'\) do |t|) - comment(# t.column :name, :string, :limit => 80) - comment(# end) - comment(# generates:) - comment(# CREATE TABLE objects () - comment(# guid int(11\) DEFAULT NULL auto_increment PRIMARY KEY,) - comment(# name varchar(80\)) - comment(# \)) - comment(#) - comment(# ====== Do not add a primary key column) - comment(# create_table(:categories_suppliers, :id => false\) do |t|) - comment(# t.column :category_id, :integer) - comment(# t.column :supplier_id, :integer) - comment(# end) - comment(# generates:) - comment(# CREATE TABLE categories_suppliers_join () - comment(# category_id int,) - comment(# supplier_id int) - comment(# \)) - comment(#) - comment(# See also TableDefinition#column for details on how to create columns.) - reserved(def) method(create_table)operator(()ident(name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(table_definition) operator(=) constant(TableDefinition)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - ident(table_definition)operator(.)ident(primary_key)operator(()ident(options)operator([)symbol(:primary_key)operator(]) operator(||) stringoperator(\)) reserved(unless) ident(options)operator([)symbol(:id)operator(]) operator(==) pre_constant(false) - - reserved(yield) ident(table_definition) - - reserved(if) ident(options)operator([)symbol(:force)operator(]) - ident(drop_table)operator(()ident(name)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - - ident(create_sql) operator(=) string reserved(if) ident(options)operator([)symbol(:temporary)operator(])inline_delimiter(})>content( TABLE )delimiter(")> - ident(create_sql) operator(<<) stringcontent( ()delimiter(")> - ident(create_sql) operator(<<) ident(table_definition)operator(.)ident(to_sql) - ident(create_sql) operator(<<) stringdelimiter(")> - ident(execute) ident(create_sql) - reserved(end) - - comment(# Renames a table.) - comment(# ===== Example) - comment(# rename_table('octopuses', 'octopi'\)) - reserved(def) method(rename_table)operator(()ident(name)operator(,) ident(new_name)operator(\)) - ident(raise) constant(NotImplementedError)operator(,) string - reserved(end) - - comment(# Drops a table from the database.) - reserved(def) method(drop_table)operator(()ident(name)operator(\)) - ident(execute) stringdelimiter(")> - reserved(end) - - comment(# Adds a new column to the named table.) - comment(# See TableDefinition#column for details of the options you can use.) - reserved(def) method(add_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(add_column_sql) operator(=) stringcontent( ADD )inlinecontent( )inlinedelimiter(")> - ident(add_column_options!)operator(()ident(add_column_sql)operator(,) ident(options)operator(\)) - ident(execute)operator(()ident(add_column_sql)operator(\)) - reserved(end) - - comment(# Removes the column from the table definition.) - comment(# ===== Examples) - comment(# remove_column(:suppliers, :qualification\)) - reserved(def) method(remove_column)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) - ident(execute) stringcontent( DROP )inlinedelimiter(")> - reserved(end) - - comment(# Changes the column's definition according to the new options.) - comment(# See TableDefinition#column for details of the options you can use.) - comment(# ===== Examples) - comment(# change_column(:suppliers, :name, :string, :limit => 80\)) - comment(# change_column(:accounts, :description, :text\)) - reserved(def) method(change_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(raise) constant(NotImplementedError)operator(,) string - reserved(end) - - comment(# Sets a new default value for a column. If you want to set the default) - comment(# value to +NULL+, you are out of luck. You need to) - comment(# DatabaseStatements#execute the apppropriate SQL statement yourself.) - comment(# ===== Examples) - comment(# change_column_default(:suppliers, :qualification, 'new'\)) - comment(# change_column_default(:accounts, :authorized, 1\)) - reserved(def) method(change_column_default)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(default)operator(\)) - ident(raise) constant(NotImplementedError)operator(,) string - reserved(end) - - comment(# Renames a column.) - comment(# ===== Example) - comment(# rename_column(:suppliers, :description, :name\)) - reserved(def) method(rename_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(new_column_name)operator(\)) - ident(raise) constant(NotImplementedError)operator(,) string - reserved(end) - - comment(# Adds a new index to the table. +column_name+ can be a single Symbol, or) - comment(# an Array of Symbols.) - comment(#) - comment(# The index will be named after the table and the first column names,) - comment(# unless you pass +:name+ as an option.) - comment(#) - comment(# When creating an index on multiple columns, the first column is used as a name) - comment(# for the index. For example, when you specify an index on two columns) - comment(# [+:first+, +:last+], the DBMS creates an index for both columns as well as an) - comment(# index for the first colum +:first+. Using just the first name for this index) - comment(# makes sense, because you will never have to create a singular index with this) - comment(# name.) - comment(#) - comment(# ===== Examples) - comment(# ====== Creating a simple index) - comment(# add_index(:suppliers, :name\)) - comment(# generates) - comment(# CREATE INDEX suppliers_name_index ON suppliers(name\)) - comment(# ====== Creating a unique index) - comment(# add_index(:accounts, [:branch_id, :party_id], :unique => true\)) - comment(# generates) - comment(# CREATE UNIQUE INDEX accounts_branch_id_index ON accounts(branch_id, party_id\)) - comment(# ====== Creating a named index) - comment(# add_index(:accounts, [:branch_id, :party_id], :unique => true, :name => 'by_branch_party'\)) - comment(# generates) - comment(# CREATE UNIQUE INDEX by_branch_party ON accounts(branch_id, party_id\)) - reserved(def) method(add_index)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(column_names) operator(=) ident(Array)operator(()ident(column_name)operator(\)) - ident(index_name) operator(=) ident(index_name)operator(()ident(table_name)operator(,) symbol(:column) operator(=)operator(>) ident(column_names)operator(.)ident(first)operator(\)) - - reserved(if) constant(Hash) operator(===) ident(options) comment(# legacy support, since this param was a string) - ident(index_type) operator(=) ident(options)operator([)symbol(:unique)operator(]) operator(?) string operator(:) string - ident(index_name) operator(=) ident(options)operator([)symbol(:name)operator(]) operator(||) ident(index_name) - reserved(else) - ident(index_type) operator(=) ident(options) - reserved(end) - ident(quoted_column_names) operator(=) ident(column_names)operator(.)ident(map) operator({) operator(|)ident(e)operator(|) ident(quote_column_name)operator(()ident(e)operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - ident(execute) stringcontent( INDEX )inlinecontent( ON )inlinecontent( ()inlinecontent(\))delimiter(")> - reserved(end) - - comment(# Remove the given index from the table.) - comment(#) - comment(# Remove the suppliers_name_index in the suppliers table (legacy support, use the second or third forms\).) - comment(# remove_index :suppliers, :name) - comment(# Remove the index named accounts_branch_id in the accounts table.) - comment(# remove_index :accounts, :column => :branch_id) - comment(# Remove the index named by_branch_party in the accounts table.) - comment(# remove_index :accounts, :name => :by_branch_party) - comment(#) - comment(# You can remove an index on multiple columns by specifying the first column.) - comment(# add_index :accounts, [:username, :password]) - comment(# remove_index :accounts, :username) - reserved(def) method(remove_index)operator(()ident(table_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(execute) stringcontent( ON )inlinedelimiter(")> - reserved(end) - - reserved(def) method(index_name)operator(()ident(table_name)operator(,) ident(options)operator(\)) comment(#:nodoc:) - reserved(if) constant(Hash) operator(===) ident(options) comment(# legacy support) - reserved(if) ident(options)operator([)symbol(:column)operator(]) - stringcontent(_)inlinecontent(_index)delimiter(")> - reserved(elsif) ident(options)operator([)symbol(:name)operator(]) - ident(options)operator([)symbol(:name)operator(]) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - reserved(else) - stringcontent(_)inlinecontent(_index)delimiter(")> - reserved(end) - reserved(end) - - comment(# Returns a string of CREATE TABLE SQL statement(s\) for recreating the) - comment(# entire structure of the database.) - reserved(def) method(structure_dump) - reserved(end) - - comment(# Should not be called normally, but this operation is non-destructive.) - comment(# The migrations module handles this automatically.) - reserved(def) method(initialize_schema_information) - reserved(begin) - ident(execute) stringcontent( (version )inlinecontent(\))delimiter(")> - ident(execute) stringcontent( (version\) VALUES(0\))delimiter(")> - reserved(rescue) constant(ActiveRecord)operator(::)constant(StatementInvalid) - comment(# Schema has been intialized) - reserved(end) - reserved(end) - - reserved(def) method(dump_schema_information) comment(#:nodoc:) - reserved(begin) - reserved(if) operator(()ident(current_schema) operator(=) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(current_version)operator(\)) operator(>) integer(0) - reserved(return) stringcontent( (version\) VALUES ()inlinecontent(\))delimiter(")> - reserved(end) - reserved(rescue) constant(ActiveRecord)operator(::)constant(StatementInvalid) - comment(# No Schema Info) - reserved(end) - reserved(end) - - - reserved(def) method(type_to_sql)operator(()ident(type)operator(,) ident(limit) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(native) operator(=) ident(native_database_types)operator([)ident(type)operator(]) - ident(limit) operator(||=) ident(native)operator([)symbol(:limit)operator(]) - ident(column_type_sql) operator(=) ident(native)operator([)symbol(:name)operator(]) - ident(column_type_sql) operator(<<) stringcontent(\))delimiter(")> reserved(if) ident(limit) - ident(column_type_sql) - reserved(end) - - reserved(def) method(add_column_options!)operator(()ident(sql)operator(,) ident(options)operator(\)) comment(#:nodoc:) - ident(sql) operator(<<) stringdelimiter(")> reserved(unless) ident(options)operator([)symbol(:default)operator(])operator(.)ident(nil?) - ident(sql) operator(<<) string reserved(if) ident(options)operator([)symbol(:null)operator(]) operator(==) pre_constant(false) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string - -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(module) class(ConnectionAdapters) comment(# :nodoc:) - comment(# All the concrete database adapters follow the interface laid down in this class.) - comment(# You can use this interface directly by borrowing the database connection from the Base with) - comment(# Base.connection.) - comment(#) - comment(# Most of the methods in the adapter are useful during migrations. Most) - comment(# notably, SchemaStatements#create_table, SchemaStatements#drop_table,) - comment(# SchemaStatements#add_index, SchemaStatements#remove_index,) - comment(# SchemaStatements#add_column, SchemaStatements#change_column and) - comment(# SchemaStatements#remove_column are very useful.) - reserved(class) class(AbstractAdapter) - ident(include) constant(Quoting)operator(,) constant(DatabaseStatements)operator(,) constant(SchemaStatements) - class_variable(@@row_even) operator(=) pre_constant(true) - - reserved(def) method(initialize)operator(()ident(connection)operator(,) ident(logger) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@connection)operator(,) instance_variable(@logger) operator(=) ident(connection)operator(,) ident(logger) - instance_variable(@runtime) operator(=) integer(0) - instance_variable(@last_verification) operator(=) integer(0) - reserved(end) - - comment(# Returns the human-readable name of the adapter. Use mixed case - one) - comment(# can always use downcase if needed.) - reserved(def) method(adapter_name) - string - reserved(end) - - comment(# Does this adapter support migrations? Backend specific, as the) - comment(# abstract adapter always returns +false+.) - reserved(def) method(supports_migrations?) - pre_constant(false) - reserved(end) - - comment(# Does this adapter support using DISTINCT within COUNT? This is +true+) - comment(# for all adapters except sqlite.) - reserved(def) method(supports_count_distinct?) - pre_constant(true) - reserved(end) - - comment(# Should primary key values be selected from their corresponding) - comment(# sequence before the insert statement? If true, next_sequence_value) - comment(# is called before each insert to set the record's primary key.) - comment(# This is false for all adapters but Firebird.) - reserved(def) method(prefetch_primary_key?)operator(()ident(table_name) operator(=) pre_constant(nil)operator(\)) - pre_constant(false) - reserved(end) - - reserved(def) method(reset_runtime) comment(#:nodoc:) - ident(rt)operator(,) instance_variable(@runtime) operator(=) instance_variable(@runtime)operator(,) integer(0) - ident(rt) - reserved(end) - - - comment(# CONNECTION MANAGEMENT ====================================) - - comment(# Is this connection active and ready to perform queries?) - reserved(def) method(active?) - instance_variable(@active) operator(!=) pre_constant(false) - reserved(end) - - comment(# Close this connection and open a new one in its place.) - reserved(def) method(reconnect!) - instance_variable(@active) operator(=) pre_constant(true) - reserved(end) - - comment(# Close this connection) - reserved(def) method(disconnect!) - instance_variable(@active) operator(=) pre_constant(false) - reserved(end) - - comment(# Lazily verify this connection, calling +active?+ only if it hasn't) - comment(# been called for +timeout+ seconds. ) - reserved(def) method(verify!)operator(()ident(timeout)operator(\)) - ident(now) operator(=) constant(Time)operator(.)ident(now)operator(.)ident(to_i) - reserved(if) operator(()ident(now) operator(-) instance_variable(@last_verification)operator(\)) operator(>) ident(timeout) - ident(reconnect!) reserved(unless) ident(active?) - instance_variable(@last_verification) operator(=) ident(now) - reserved(end) - reserved(end) - - comment(# Provides access to the underlying database connection. Useful for) - comment(# when you need to call a proprietary method such as postgresql's lo_*) - comment(# methods) - reserved(def) method(raw_connection) - instance_variable(@connection) - reserved(end) - - ident(protected) - reserved(def) method(log)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(if) ident(block_given?) - reserved(if) instance_variable(@logger) reserved(and) instance_variable(@logger)operator(.)ident(level) operator(<=) constant(Logger)operator(::)constant(INFO) - ident(result) operator(=) pre_constant(nil) - ident(seconds) operator(=) constant(Benchmark)operator(.)ident(realtime) operator({) ident(result) operator(=) reserved(yield) operator(}) - instance_variable(@runtime) operator(+=) ident(seconds) - ident(log_info)operator(()ident(sql)operator(,) ident(name)operator(,) ident(seconds)operator(\)) - ident(result) - reserved(else) - reserved(yield) - reserved(end) - reserved(else) - ident(log_info)operator(()ident(sql)operator(,) ident(name)operator(,) integer(0)operator(\)) - pre_constant(nil) - reserved(end) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - comment(# Log message and raise exception.) - comment(# Set last_verfication to 0, so that connection gets verified) - comment(# upon reentering the request loop) - instance_variable(@last_verification) operator(=) integer(0) - ident(message) operator(=) stringcontent(: )inlinecontent(: )inlinedelimiter(")> - ident(log_info)operator(()ident(message)operator(,) ident(name)operator(,) integer(0)operator(\)) - ident(raise) constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(,) ident(message) - reserved(end) - - reserved(def) method(log_info)operator(()ident(sql)operator(,) ident(name)operator(,) ident(runtime)operator(\)) - reserved(return) reserved(unless) instance_variable(@logger) - - instance_variable(@logger)operator(.)ident(debug)operator(() - ident(format_log_entry)operator(() - string operator(:) ident(name)inline_delimiter(})>content( ()inlineoperator(,) ident(runtime)operator(\))inline_delimiter(})>content(\))delimiter(")>operator(,) - ident(sql)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(format_log_entry)operator(()ident(message)operator(,) ident(dump) operator(=) pre_constant(nil)operator(\)) - reserved(if) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(colorize_logging) - reserved(if) class_variable(@@row_even) - class_variable(@@row_even) operator(=) pre_constant(false) - ident(message_color)operator(,) ident(dump_color) operator(=) stringoperator(,) string - reserved(else) - class_variable(@@row_even) operator(=) pre_constant(true) - ident(message_color)operator(,) ident(dump_color) operator(=) stringoperator(,) string - reserved(end) - - ident(log_entry) operator(=) stringcontent(m)inlinechar(\\e)content([0m )delimiter(")> - ident(log_entry) operator(<<) stringcontent(m%)inline operator(:) stringinline_delimiter(})>char(\\e)content([0m)delimiter(")> operator(%) ident(dump) reserved(if) ident(dump) - ident(log_entry) - reserved(else) - string operator(%) operator([)ident(message)operator(,) ident(dump)operator(]) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -comment(# Author/Maintainer: Maik Schmidt ) - -ident(require) string - -reserved(begin) - ident(require) string reserved(unless) pre_constant(self)operator(.)ident(class)operator(.)ident(const_defined?)operator(()symbol(:DB2CLI)operator(\)) - ident(require) string - - reserved(module) class(ActiveRecord) - reserved(class) class(Base) - comment(# Establishes a connection to the database that's used by) - comment(# all Active Record objects) - reserved(def) pre_constant(self)operator(.)method(db2_connection)operator(()ident(config)operator(\)) comment(# :nodoc:) - ident(config) operator(=) ident(config)operator(.)ident(symbolize_keys) - ident(usr) operator(=) ident(config)operator([)symbol(:username)operator(]) - ident(pwd) operator(=) ident(config)operator([)symbol(:password)operator(]) - ident(schema) operator(=) ident(config)operator([)symbol(:schema)operator(]) - - reserved(if) ident(config)operator(.)ident(has_key?)operator(()symbol(:database)operator(\)) - ident(database) operator(=) ident(config)operator([)symbol(:database)operator(]) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - ident(connection) operator(=) constant(DB2)operator(::)constant(Connection)operator(.)ident(new)operator(()constant(DB2)operator(::)constant(Environment)operator(.)ident(new)operator(\)) - ident(connection)operator(.)ident(connect)operator(()ident(database)operator(,) ident(usr)operator(,) ident(pwd)operator(\)) - constant(ConnectionAdapters)operator(::)constant(DB2Adapter)operator(.)ident(new)operator(()ident(connection)operator(,) ident(logger)operator(,) symbol(:schema) operator(=)operator(>) ident(schema)operator(\)) - reserved(end) - reserved(end) - - reserved(module) class(ConnectionAdapters) - comment(# The DB2 adapter works with the C-based CLI driver (http://rubyforge.org/projects/ruby-dbi/\)) - comment(#) - comment(# Options:) - comment(#) - comment(# * :username -- Defaults to nothing) - comment(# * :password -- Defaults to nothing) - comment(# * :database -- The name of the database. No default, must be provided.) - comment(# * :schema -- Database schema to be set initially.) - reserved(class) class(DB2Adapter) operator(<) constant(AbstractAdapter) - reserved(def) method(initialize)operator(()ident(connection)operator(,) ident(logger)operator(,) ident(connection_options)operator(\)) - reserved(super)operator(()ident(connection)operator(,) ident(logger)operator(\)) - instance_variable(@connection_options) operator(=) ident(connection_options) - reserved(if) ident(schema) operator(=) instance_variable(@connection_options)operator([)symbol(:schema)operator(]) - ident(with_statement) reserved(do) operator(|)ident(stmt)operator(|) - ident(stmt)operator(.)ident(exec_direct)operator(()stringdelimiter(")>operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(select_all)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - - reserved(def) method(select_one)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(select)operator(()ident(sql)operator(,) ident(name)operator(\))operator(.)ident(first) - reserved(end) - - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(,) ident(sequence_name) operator(=) pre_constant(nil)operator(\)) - ident(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(id_value) operator(||) ident(last_insert_id) - reserved(end) - - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(rows_affected) operator(=) integer(0) - ident(with_statement) reserved(do) operator(|)ident(stmt)operator(|) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) reserved(do) - ident(stmt)operator(.)ident(exec_direct)operator(()ident(sql)operator(\)) - ident(rows_affected) operator(=) ident(stmt)operator(.)ident(row_count) - reserved(end) - reserved(end) - ident(rows_affected) - reserved(end) - - ident(alias_method) symbol(:update)operator(,) symbol(:execute) - ident(alias_method) symbol(:delete)operator(,) symbol(:execute) - - reserved(def) method(begin_db_transaction) - instance_variable(@connection)operator(.)ident(set_auto_commit_off) - reserved(end) - - reserved(def) method(commit_db_transaction) - instance_variable(@connection)operator(.)ident(commit) - instance_variable(@connection)operator(.)ident(set_auto_commit_on) - reserved(end) - - reserved(def) method(rollback_db_transaction) - instance_variable(@connection)operator(.)ident(rollback) - instance_variable(@connection)operator(.)ident(set_auto_commit_on) - reserved(end) - - reserved(def) method(quote_column_name)operator(()ident(column_name)operator(\)) - ident(column_name) - reserved(end) - - reserved(def) method(adapter_name)operator(()operator(\)) - string - reserved(end) - - reserved(def) method(quote_string)operator(()ident(string)operator(\)) - ident(string)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) comment(# ' (for ruby-mode\)) - reserved(end) - - reserved(def) method(add_limit_offset!)operator(()ident(sql)operator(,) ident(options)operator(\)) - reserved(if) ident(limit) operator(=) ident(options)operator([)symbol(:limit)operator(]) - ident(offset) operator(=) ident(options)operator([)symbol(:offset)operator(]) operator(||) integer(0) - comment(# The following trick was added by andrea+rails@webcom.it.) - ident(sql)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - ident(sql) operator(<<) string )inlinecontent( AND B.internal$rownum <= )inlinedelimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(tables)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) - ident(result) operator(=) operator([)operator(]) - ident(schema) operator(=) instance_variable(@connection_options)operator([)symbol(:schema)operator(]) operator(||) string - ident(with_statement) reserved(do) operator(|)ident(stmt)operator(|) - ident(stmt)operator(.)ident(tables)operator(()ident(schema)operator(\))operator(.)ident(each) operator({) operator(|)ident(t)operator(|) ident(result) operator(<<) ident(t)operator([)integer(2)operator(])operator(.)ident(downcase) operator(}) - reserved(end) - ident(result) - reserved(end) - - reserved(def) method(indexes)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(tmp) operator(=) operator({)operator(}) - ident(schema) operator(=) instance_variable(@connection_options)operator([)symbol(:schema)operator(]) operator(||) string - ident(with_statement) reserved(do) operator(|)ident(stmt)operator(|) - ident(stmt)operator(.)ident(indexes)operator(()ident(table_name)operator(,) ident(schema)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(t)operator(|) - reserved(next) reserved(unless) ident(t)operator([)integer(5)operator(]) - reserved(next) reserved(if) ident(t)operator([)integer(4)operator(]) operator(==) string comment(# Skip system indexes.) - ident(idx_name) operator(=) ident(t)operator([)integer(5)operator(])operator(.)ident(downcase) - ident(col_name) operator(=) ident(t)operator([)integer(8)operator(])operator(.)ident(downcase) - reserved(if) ident(tmp)operator(.)ident(has_key?)operator(()ident(idx_name)operator(\)) - ident(tmp)operator([)ident(idx_name)operator(])operator(.)ident(columns) operator(<<) ident(col_name) - reserved(else) - ident(is_unique) operator(=) ident(t)operator([)integer(3)operator(]) operator(==) integer(0) - ident(tmp)operator([)ident(idx_name)operator(]) operator(=) constant(IndexDefinition)operator(.)ident(new)operator(()ident(table_name)operator(,) ident(idx_name)operator(,) ident(is_unique)operator(,) operator([)ident(col_name)operator(])operator(\)) - reserved(end) - reserved(end) - reserved(end) - ident(tmp)operator(.)ident(values) - reserved(end) - - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(result) operator(=) operator([)operator(]) - ident(schema) operator(=) instance_variable(@connection_options)operator([)symbol(:schema)operator(]) operator(||) string - ident(with_statement) reserved(do) operator(|)ident(stmt)operator(|) - ident(stmt)operator(.)ident(columns)operator(()ident(table_name)operator(,) ident(schema)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(c)operator(|) - ident(c_name) operator(=) ident(c)operator([)integer(3)operator(])operator(.)ident(downcase) - ident(c_default) operator(=) ident(c)operator([)integer(12)operator(]) operator(==) string operator(?) pre_constant(nil) operator(:) ident(c)operator([)integer(12)operator(]) - ident(c_default)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) reserved(if) operator(!)ident(c_default)operator(.)ident(nil?) - ident(c_type) operator(=) ident(c)operator([)integer(5)operator(])operator(.)ident(downcase) - ident(c_type) operator(+=) stringcontent(\))delimiter(")> reserved(if) operator(!)ident(c)operator([)integer(6)operator(])operator(.)ident(nil?) operator(&&) ident(c)operator([)integer(6)operator(]) operator(!=) string - ident(result) operator(<<) constant(Column)operator(.)ident(new)operator(()ident(c_name)operator(,) ident(c_default)operator(,) ident(c_type)operator(,) ident(c)operator([)integer(17)operator(]) operator(==) stringoperator(\)) - reserved(end) - reserved(end) - ident(result) - reserved(end) - - reserved(def) method(native_database_types) - operator({) - symbol(:primary_key) operator(=)operator(>) stringoperator(,) - symbol(:string) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(255) operator(})operator(,) - symbol(:text) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(32768) operator(})operator(,) - symbol(:integer) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:float) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:datetime) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:timestamp) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:time) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:date) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:binary) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(32768) operator(})operator(,) - symbol(:boolean) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(1) operator(}) - operator(}) - reserved(end) - - reserved(def) method(quoted_true) - string - reserved(end) - - reserved(def) method(quoted_false) - string - reserved(end) - - reserved(def) method(active?) - instance_variable(@connection)operator(.)ident(select_one) string - pre_constant(true) - reserved(rescue) constant(Exception) - pre_constant(false) - reserved(end) - - reserved(def) method(reconnect!) - reserved(end) - - reserved(def) method(table_alias_length) - integer(128) - reserved(end) - - ident(private) - - reserved(def) method(with_statement) - ident(stmt) operator(=) constant(DB2)operator(::)constant(Statement)operator(.)ident(new)operator(()instance_variable(@connection)operator(\)) - reserved(yield) ident(stmt) - ident(stmt)operator(.)ident(free) - reserved(end) - - reserved(def) method(last_insert_id) - ident(row) operator(=) ident(select_one)operator(()stringoperator(.)ident(strip)operator(\))string - ident(row)operator([)stringoperator(])operator(.)ident(to_i) - reserved(end) - - reserved(def) method(select)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(rows) operator(=) operator([)operator(]) - ident(with_statement) reserved(do) operator(|)ident(stmt)operator(|) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) reserved(do) - ident(stmt)operator(.)ident(exec_direct)operator(()stringoperator(,) stringoperator(\))inline_delimiter(})>content( with ur)delimiter(")>operator(\)) - reserved(end) - - reserved(while) ident(row) operator(=) ident(stmt)operator(.)ident(fetch_as_hash) - ident(row)operator(.)ident(delete)operator(()stringoperator(\)) - ident(rows) operator(<<) ident(row) - reserved(end) - reserved(end) - ident(rows) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(rescue) constant(LoadError) - comment(# DB2 driver is unavailable.) - reserved(module) class(ActiveRecord) comment(# :nodoc:) - reserved(class) class(Base) - reserved(def) pre_constant(self)operator(.)method(db2_connection)operator(()ident(config)operator(\)) comment(# :nodoc:) - comment(# Set up a reasonable error message) - ident(raise) constant(LoadError)operator(,) string - reserved(end) - reserved(end) - reserved(end) -reserved(end) -comment(# Author: Ken Kunz ) - -ident(require) string - -reserved(module) class(FireRuby) comment(# :nodoc: all) - reserved(class) class(Database) - reserved(def) pre_constant(self)operator(.)method(new_from_params)operator(()ident(database)operator(,) ident(host)operator(,) ident(port)operator(,) ident(service)operator(\)) - ident(db_string) operator(=) string - reserved(if) ident(host) - ident(db_string) operator(<<) ident(host) - ident(db_string) operator(<<) stringdelimiter(")> reserved(if) ident(service) operator(||) ident(port) - ident(db_string) operator(<<) string - reserved(end) - ident(db_string) operator(<<) ident(database) - ident(new)operator(()ident(db_string)operator(\)) - reserved(end) - reserved(end) -reserved(end) - -reserved(module) class(ActiveRecord) - reserved(class) operator(<<) class(Base) - reserved(def) method(firebird_connection)operator(()ident(config)operator(\)) comment(# :nodoc:) - ident(require_library_or_gem) string - reserved(unless) reserved(defined?) constant(FireRuby)operator(::)constant(SQLType) - ident(raise) constant(AdapterNotFound)operator(,) - string operator(<<) - string - reserved(end) - ident(config) operator(=) ident(config)operator(.)ident(symbolize_keys) - reserved(unless) ident(config)operator(.)ident(has_key?)operator(()symbol(:database)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - ident(options) operator(=) ident(config)operator([)symbol(:charset)operator(]) operator(?) operator({) constant(CHARACTER_SET) operator(=)operator(>) ident(config)operator([)symbol(:charset)operator(]) operator(}) operator(:) operator({)operator(}) - ident(connection_params) operator(=) operator([)ident(config)operator([)symbol(:username)operator(])operator(,) ident(config)operator([)symbol(:password)operator(])operator(,) ident(options)operator(]) - ident(db) operator(=) constant(FireRuby)operator(::)constant(Database)operator(.)ident(new_from_params)operator(()operator(*)ident(config)operator(.)ident(values_at)operator(()symbol(:database)operator(,) symbol(:host)operator(,) symbol(:port)operator(,) symbol(:service)operator(\))operator(\)) - ident(connection) operator(=) ident(db)operator(.)ident(connect)operator(()operator(*)ident(connection_params)operator(\)) - constant(ConnectionAdapters)operator(::)constant(FirebirdAdapter)operator(.)ident(new)operator(()ident(connection)operator(,) ident(logger)operator(,) ident(connection_params)operator(\)) - reserved(end) - reserved(end) - - reserved(module) class(ConnectionAdapters) - reserved(class) class(FirebirdColumn) operator(<) constant(Column) comment(# :nodoc:) - constant(VARCHAR_MAX_LENGTH) operator(=) integer(32_765) - constant(BLOB_MAX_LENGTH) operator(=) integer(32_767) - - reserved(def) method(initialize)operator(()ident(name)operator(,) ident(domain)operator(,) ident(type)operator(,) ident(sub_type)operator(,) ident(length)operator(,) ident(precision)operator(,) ident(scale)operator(,) ident(default_source)operator(,) ident(null_flag)operator(\)) - instance_variable(@firebird_type) operator(=) constant(FireRuby)operator(::)constant(SQLType)operator(.)ident(to_base_type)operator(()ident(type)operator(,) ident(sub_type)operator(\))operator(.)ident(to_s) - reserved(super)operator(()ident(name)operator(.)ident(downcase)operator(,) pre_constant(nil)operator(,) instance_variable(@firebird_type)operator(,) operator(!)ident(null_flag)operator(\)) - instance_variable(@default) operator(=) ident(parse_default)operator(()ident(default_source)operator(\)) reserved(if) ident(default_source) - instance_variable(@limit) operator(=) ident(type) operator(==) string operator(?) constant(BLOB_MAX_LENGTH) operator(:) ident(length) - instance_variable(@domain)operator(,) instance_variable(@sub_type)operator(,) instance_variable(@precision)operator(,) instance_variable(@scale) operator(=) ident(domain)operator(,) ident(sub_type)operator(,) ident(precision)operator(,) ident(scale) - reserved(end) - - reserved(def) method(type) - reserved(if) instance_variable(@domain) operator(=)operator(~) regexp - symbol(:boolean) - reserved(elsif) instance_variable(@type) operator(==) symbol(:binary) reserved(and) instance_variable(@sub_type) operator(==) integer(1) - symbol(:text) - reserved(else) - instance_variable(@type) - reserved(end) - reserved(end) - - comment(# Submits a _CAST_ query to the database, casting the default value to the specified SQL type.) - comment(# This enables Firebird to provide an actual value when context variables are used as column) - comment(# defaults (such as CURRENT_TIMESTAMP\).) - reserved(def) method(default) - reserved(if) instance_variable(@default) - ident(sql) operator(=) stringcontent( AS )inlinecontent(\) FROM RDB$DATABASE)delimiter(")> - ident(connection) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(active_connections)operator(.)ident(values)operator(.)ident(detect) operator({) operator(|)ident(conn)operator(|) ident(conn) operator(&&) ident(conn)operator(.)ident(adapter_name) operator(==) string operator(}) - reserved(if) ident(connection) - ident(type_cast) ident(connection)operator(.)ident(execute)operator(()ident(sql)operator(\))operator(.)ident(to_a)operator(.)ident(first)operator([)stringoperator(]) - reserved(else) - ident(raise) constant(ConnectionNotEstablished)operator(,) string - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(type_cast)operator(()ident(value)operator(\)) - reserved(if) ident(type) operator(==) symbol(:boolean) - ident(value) operator(==) pre_constant(true) reserved(or) ident(value) operator(==) constant(ActiveRecord)operator(::)constant(ConnectionAdapters)operator(::)constant(FirebirdAdapter)operator(.)ident(boolean_domain)operator([)symbol(:true)operator(]) - reserved(else) - reserved(super) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(parse_default)operator(()ident(default_source)operator(\)) - ident(default_source) operator(=)operator(~) regexp - reserved(return) global_variable($1) reserved(unless) global_variable($1)operator(.)ident(upcase) operator(==) string - reserved(end) - - reserved(def) method(column_def) - reserved(case) instance_variable(@firebird_type) - reserved(when) string reserved(then) stringcontent(\))delimiter(")> - reserved(when) stringoperator(,) string reserved(then) stringcontent(()inlinecontent(\))delimiter(")> - reserved(when) stringoperator(,) string reserved(then) stringcontent(()inlinecontent(,)inlinecontent(\))delimiter(")> - reserved(when) string reserved(then) string - reserved(else) instance_variable(@firebird_type) - reserved(end) - reserved(end) - - reserved(def) method(simplified_type)operator(()ident(field_type)operator(\)) - reserved(if) ident(field_type) operator(==) string - symbol(:datetime) - reserved(else) - reserved(super) - reserved(end) - reserved(end) - reserved(end) - - comment(# The Firebird adapter relies on the FireRuby[http://rubyforge.org/projects/fireruby/]) - comment(# extension, version 0.4.0 or later (available as a gem or from) - comment(# RubyForge[http://rubyforge.org/projects/fireruby/]\). FireRuby works with) - comment(# Firebird 1.5.x on Linux, OS X and Win32 platforms.) - comment(#) - comment(# == Usage Notes) - comment(#) - comment(# === Sequence (Generator\) Names) - comment(# The Firebird adapter supports the same approach adopted for the Oracle) - comment(# adapter. See ActiveRecord::Base#set_sequence_name for more details.) - comment(#) - comment(# Note that in general there is no need to create a BEFORE INSERT) - comment(# trigger corresponding to a Firebird sequence generator when using) - comment(# ActiveRecord. In other words, you don't have to try to make Firebird) - comment(# simulate an AUTO_INCREMENT or +IDENTITY+ column. When saving a) - comment(# new record, ActiveRecord pre-fetches the next sequence value for the table) - comment(# and explicitly includes it in the +INSERT+ statement. (Pre-fetching the) - comment(# next primary key value is the only reliable method for the Firebird) - comment(# adapter to report back the +id+ after a successful insert.\)) - comment(#) - comment(# === BOOLEAN Domain) - comment(# Firebird 1.5 does not provide a native +BOOLEAN+ type. But you can easily) - comment(# define a +BOOLEAN+ _domain_ for this purpose, e.g.:) - comment(#) - comment(# CREATE DOMAIN D_BOOLEAN AS SMALLINT CHECK (VALUE IN (0, 1\)\);) - comment(#) - comment(# When the Firebird adapter encounters a column that is based on a domain) - comment(# that includes "BOOLEAN" in the domain name, it will attempt to treat) - comment(# the column as a +BOOLEAN+.) - comment(#) - comment(# By default, the Firebird adapter will assume that the BOOLEAN domain is) - comment(# defined as above. This can be modified if needed. For example, if you) - comment(# have a legacy schema with the following +BOOLEAN+ domain defined:) - comment(#) - comment(# CREATE DOMAIN BOOLEAN AS CHAR(1\) CHECK (VALUE IN ('T', 'F'\)\);) - comment(#) - comment(# ...you can add the following line to your environment.rb file:) - comment(#) - comment(# ActiveRecord::ConnectionAdapters::FirebirdAdapter.boolean_domain = { :true => 'T', :false => 'F' }) - comment(#) - comment(# === BLOB Elements) - comment(# The Firebird adapter currently provides only limited support for +BLOB+) - comment(# columns. You cannot currently retrieve or insert a +BLOB+ as an IO stream.) - comment(# When selecting a +BLOB+, the entire element is converted into a String.) - comment(# When inserting or updating a +BLOB+, the entire value is included in-line) - comment(# in the SQL statement, limiting you to values <= 32KB in size.) - comment(#) - comment(# === Column Name Case Semantics) - comment(# Firebird and ActiveRecord have somewhat conflicting case semantics for) - comment(# column names.) - comment(#) - comment(# [*Firebird*]) - comment(# The standard practice is to use unquoted column names, which can be) - comment(# thought of as case-insensitive. (In fact, Firebird converts them to) - comment(# uppercase.\) Quoted column names (not typically used\) are case-sensitive.) - comment(# [*ActiveRecord*]) - comment(# Attribute accessors corresponding to column names are case-sensitive.) - comment(# The defaults for primary key and inheritance columns are lowercase, and) - comment(# in general, people use lowercase attribute names.) - comment(#) - comment(# In order to map between the differing semantics in a way that conforms) - comment(# to common usage for both Firebird and ActiveRecord, uppercase column names) - comment(# in Firebird are converted to lowercase attribute names in ActiveRecord,) - comment(# and vice-versa. Mixed-case column names retain their case in both) - comment(# directions. Lowercase (quoted\) Firebird column names are not supported.) - comment(# This is similar to the solutions adopted by other adapters.) - comment(#) - comment(# In general, the best approach is to use unqouted (case-insensitive\) column) - comment(# names in your Firebird DDL (or if you must quote, use uppercase column) - comment(# names\). These will correspond to lowercase attributes in ActiveRecord.) - comment(#) - comment(# For example, a Firebird table based on the following DDL:) - comment(#) - comment(# CREATE TABLE products () - comment(# id BIGINT NOT NULL PRIMARY KEY,) - comment(# "TYPE" VARCHAR(50\),) - comment(# name VARCHAR(255\) \);) - comment(#) - comment(# ...will correspond to an ActiveRecord model class called +Product+ with) - comment(# the following attributes: +id+, +type+, +name+.) - comment(#) - comment(# ==== Quoting "TYPE" and other Firebird reserved words:) - comment(# In ActiveRecord, the default inheritance column name is +type+. The word) - comment(# _type_ is a Firebird reserved word, so it must be quoted in any Firebird) - comment(# SQL statements. Because of the case mapping described above, you should) - comment(# always reference this column using quoted-uppercase syntax) - comment(# ("TYPE"\) within Firebird DDL or other SQL statements (as in the) - comment(# example above\). This holds true for any other Firebird reserved words used) - comment(# as column names as well.) - comment(#) - comment(# === Migrations) - comment(# The Firebird adapter does not currently support Migrations. I hope to) - comment(# add this feature in the near future.) - comment(#) - comment(# == Connection Options) - comment(# The following options are supported by the Firebird adapter. None of the) - comment(# options have default values.) - comment(#) - comment(# :database::) - comment(# Required option. Specifies one of: (i\) a Firebird database alias;) - comment(# (ii\) the full path of a database file; _or_ (iii\) a full Firebird) - comment(# connection string. Do not specify :host, :service) - comment(# or :port as separate options when using a full connection) - comment(# string.) - comment(# :host::) - comment(# Set to "remote.host.name" for remote database connections.) - comment(# May be omitted for local connections if a full database path is) - comment(# specified for :database. Some platforms require a value of) - comment(# "localhost" for local connections when using a Firebird) - comment(# database _alias_.) - comment(# :service::) - comment(# Specifies a service name for the connection. Only used if :host) - comment(# is provided. Required when connecting to a non-standard service.) - comment(# :port::) - comment(# Specifies the connection port. Only used if :host is provided) - comment(# and :service is not. Required when connecting to a non-standard) - comment(# port and :service is not defined.) - comment(# :username::) - comment(# Specifies the database user. May be omitted or set to +nil+ (together) - comment(# with :password\) to use the underlying operating system user) - comment(# credentials on supported platforms.) - comment(# :password::) - comment(# Specifies the database password. Must be provided if :username) - comment(# is explicitly specified; should be omitted if OS user credentials are) - comment(# are being used.) - comment(# :charset::) - comment(# Specifies the character set to be used by the connection. Refer to) - comment(# Firebird documentation for valid options.) - reserved(class) class(FirebirdAdapter) operator(<) constant(AbstractAdapter) - class_variable(@@boolean_domain) operator(=) operator({) symbol(:true) operator(=)operator(>) integer(1)operator(,) symbol(:false) operator(=)operator(>) integer(0) operator(}) - ident(cattr_accessor) symbol(:boolean_domain) - - reserved(def) method(initialize)operator(()ident(connection)operator(,) ident(logger)operator(,) ident(connection_params)operator(=)pre_constant(nil)operator(\)) - reserved(super)operator(()ident(connection)operator(,) ident(logger)operator(\)) - instance_variable(@connection_params) operator(=) ident(connection_params) - reserved(end) - - reserved(def) method(adapter_name) comment(# :nodoc:) - string - reserved(end) - - comment(# Returns true for Firebird adapter (since Firebird requires primary key) - comment(# values to be pre-fetched before insert\). See also #next_sequence_value.) - reserved(def) method(prefetch_primary_key?)operator(()ident(table_name) operator(=) pre_constant(nil)operator(\)) - pre_constant(true) - reserved(end) - - reserved(def) method(default_sequence_name)operator(()ident(table_name)operator(,) ident(primary_key)operator(\)) comment(# :nodoc:) - stringcontent(_seq)delimiter(")> - reserved(end) - - - comment(# QUOTING ==================================================) - - reserved(def) method(quote)operator(()ident(value)operator(,) ident(column) operator(=) pre_constant(nil)operator(\)) comment(# :nodoc:) - reserved(if) operator([)constant(Time)operator(,) constant(DateTime)operator(])operator(.)ident(include?)operator(()ident(value)operator(.)ident(class)operator(\)) - stringoperator(\))inline_delimiter(})>content(' AS TIMESTAMP\))delimiter(")> - reserved(else) - reserved(super) - reserved(end) - reserved(end) - - reserved(def) method(quote_string)operator(()ident(string)operator(\)) comment(# :nodoc:) - ident(string)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(quote_column_name)operator(()ident(column_name)operator(\)) comment(# :nodoc:) - stringcontent(")delimiter(\))> - reserved(end) - - reserved(def) method(quoted_true) comment(# :nodoc:) - ident(quote)operator(()ident(boolean_domain)operator([)symbol(:true)operator(])operator(\)) - reserved(end) - - reserved(def) method(quoted_false) comment(# :nodoc:) - ident(quote)operator(()ident(boolean_domain)operator([)symbol(:false)operator(])operator(\)) - reserved(end) - - - comment(# CONNECTION MANAGEMENT ====================================) - - reserved(def) method(active?) - reserved(not) instance_variable(@connection)operator(.)ident(closed?) - reserved(end) - - reserved(def) method(reconnect!) - instance_variable(@connection)operator(.)ident(close) - instance_variable(@connection) operator(=) instance_variable(@connection)operator(.)ident(database)operator(.)ident(connect)operator(()operator(*)instance_variable(@connection_params)operator(\)) - reserved(end) - - - comment(# DATABASE STATEMENTS ======================================) - - reserved(def) method(select_all)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(# :nodoc:) - ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - - reserved(def) method(select_one)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(# :nodoc:) - ident(result) operator(=) ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(result)operator(.)ident(nil?) operator(?) pre_constant(nil) operator(:) ident(result)operator(.)ident(first) - reserved(end) - - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) comment(# :nodoc:) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) reserved(do) - reserved(if) instance_variable(@transaction) - instance_variable(@connection)operator(.)ident(execute)operator(()ident(sql)operator(,) instance_variable(@transaction)operator(,) operator(&)ident(block)operator(\)) - reserved(else) - instance_variable(@connection)operator(.)ident(execute_immediate)operator(()ident(sql)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(,) ident(sequence_name) operator(=) pre_constant(nil)operator(\)) comment(# :nodoc:) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(id_value) - reserved(end) - - ident(alias_method) symbol(:update)operator(,) symbol(:execute) - ident(alias_method) symbol(:delete)operator(,) symbol(:execute) - - reserved(def) method(begin_db_transaction)operator(()operator(\)) comment(# :nodoc:) - instance_variable(@transaction) operator(=) instance_variable(@connection)operator(.)ident(start_transaction) - reserved(end) - - reserved(def) method(commit_db_transaction)operator(()operator(\)) comment(# :nodoc:) - instance_variable(@transaction)operator(.)ident(commit) - reserved(ensure) - instance_variable(@transaction) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(rollback_db_transaction)operator(()operator(\)) comment(# :nodoc:) - instance_variable(@transaction)operator(.)ident(rollback) - reserved(ensure) - instance_variable(@transaction) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(add_limit_offset!)operator(()ident(sql)operator(,) ident(options)operator(\)) comment(# :nodoc:) - reserved(if) ident(options)operator([)symbol(:limit)operator(]) - ident(limit_string) operator(=) stringdelimiter(")> - ident(limit_string) operator(<<) stringdelimiter(")> reserved(if) ident(options)operator([)symbol(:offset)operator(]) - ident(sql)operator(.)ident(sub!)operator(()regexpoperator(,) string operator(+) ident(limit_string) operator(+) stringoperator(\)) - reserved(end) - reserved(end) - - comment(# Returns the next sequence value from a sequence generator. Not generally) - comment(# called directly; used by ActiveRecord to get the next primary key value) - comment(# when inserting a new database record (see #prefetch_primary_key?\).) - reserved(def) method(next_sequence_value)operator(()ident(sequence_name)operator(\)) - constant(FireRuby)operator(::)constant(Generator)operator(.)ident(new)operator(()ident(sequence_name)operator(,) instance_variable(@connection)operator(\))operator(.)ident(next)operator(()integer(1)operator(\)) - reserved(end) - - - comment(# SCHEMA STATEMENTS ========================================) - - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(# :nodoc:) - ident(sql) operator(=) stringstring - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\))operator(.)ident(collect) reserved(do) operator(|)ident(field)operator(|) - ident(field_values) operator(=) ident(field)operator(.)ident(values)operator(.)ident(collect) reserved(do) operator(|)ident(value)operator(|) - reserved(case) ident(value) - reserved(when) constant(String) reserved(then) ident(value)operator(.)ident(rstrip) - reserved(when) constant(FireRuby)operator(::)constant(Blob) reserved(then) ident(value)operator(.)ident(to_s) - reserved(else) ident(value) - reserved(end) - reserved(end) - constant(FirebirdColumn)operator(.)ident(new)operator(()operator(*)ident(field_values)operator(\)) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(select)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\))operator(.)ident(collect) reserved(do) operator(|)ident(row)operator(|) - ident(hashed_row) operator(=) operator({)operator(}) - ident(row)operator(.)ident(each) reserved(do) operator(|)ident(column)operator(,) ident(value)operator(|) - ident(value) operator(=) ident(value)operator(.)ident(to_s) reserved(if) constant(FireRuby)operator(::)constant(Blob) operator(===) ident(value) - ident(hashed_row)operator([)ident(fb_to_ar_case)operator(()ident(column)operator(\))operator(]) operator(=) ident(value) - reserved(end) - ident(hashed_row) - reserved(end) - reserved(end) - - comment(# Maps uppercase Firebird column names to lowercase for ActiveRecord;) - comment(# mixed-case columns retain their original case.) - reserved(def) method(fb_to_ar_case)operator(()ident(column_name)operator(\)) - ident(column_name) operator(=)operator(~) regexp operator(?) ident(column_name) operator(:) ident(column_name)operator(.)ident(downcase) - reserved(end) - - comment(# Maps lowercase ActiveRecord column names to uppercase for Fierbird;) - comment(# mixed-case columns retain their original case.) - reserved(def) method(ar_to_fb_case)operator(()ident(column_name)operator(\)) - ident(column_name) operator(=)operator(~) regexp operator(?) ident(column_name) operator(:) ident(column_name)operator(.)ident(upcase) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(class) class(Base) - comment(# Establishes a connection to the database that's used by all Active Record objects.) - reserved(def) pre_constant(self)operator(.)method(mysql_connection)operator(()ident(config)operator(\)) comment(# :nodoc:) - comment(# Only include the MySQL driver if one hasn't already been loaded) - reserved(unless) reserved(defined?) constant(Mysql) - reserved(begin) - ident(require_library_or_gem) string - reserved(rescue) constant(LoadError) operator(=)operator(>) ident(cannot_require_mysql) - comment(# Only use the supplied backup Ruby/MySQL driver if no driver is already in place) - reserved(begin) - ident(require) string - reserved(rescue) constant(LoadError) - ident(raise) ident(cannot_require_mysql) - reserved(end) - reserved(end) - reserved(end) - - ident(config) operator(=) ident(config)operator(.)ident(symbolize_keys) - ident(host) operator(=) ident(config)operator([)symbol(:host)operator(]) - ident(port) operator(=) ident(config)operator([)symbol(:port)operator(]) - ident(socket) operator(=) ident(config)operator([)symbol(:socket)operator(]) - ident(username) operator(=) ident(config)operator([)symbol(:username)operator(]) operator(?) ident(config)operator([)symbol(:username)operator(])operator(.)ident(to_s) operator(:) string - ident(password) operator(=) ident(config)operator([)symbol(:password)operator(])operator(.)ident(to_s) - - reserved(if) ident(config)operator(.)ident(has_key?)operator(()symbol(:database)operator(\)) - ident(database) operator(=) ident(config)operator([)symbol(:database)operator(]) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - ident(mysql) operator(=) constant(Mysql)operator(.)ident(init) - ident(mysql)operator(.)ident(ssl_set)operator(()ident(config)operator([)symbol(:sslkey)operator(])operator(,) ident(config)operator([)symbol(:sslcert)operator(])operator(,) ident(config)operator([)symbol(:sslca)operator(])operator(,) ident(config)operator([)symbol(:sslcapath)operator(])operator(,) ident(config)operator([)symbol(:sslcipher)operator(])operator(\)) reserved(if) ident(config)operator([)symbol(:sslkey)operator(]) - constant(ConnectionAdapters)operator(::)constant(MysqlAdapter)operator(.)ident(new)operator(()ident(mysql)operator(,) ident(logger)operator(,) operator([)ident(host)operator(,) ident(username)operator(,) ident(password)operator(,) ident(database)operator(,) ident(port)operator(,) ident(socket)operator(])operator(,) ident(config)operator(\)) - reserved(end) - reserved(end) - - reserved(module) class(ConnectionAdapters) - reserved(class) class(MysqlColumn) operator(<) constant(Column) comment(#:nodoc:) - ident(private) - reserved(def) method(simplified_type)operator(()ident(field_type)operator(\)) - reserved(return) symbol(:boolean) reserved(if) constant(MysqlAdapter)operator(.)ident(emulate_booleans) operator(&&) ident(field_type)operator(.)ident(downcase)operator(.)ident(index)operator(()stringoperator(\)) - reserved(return) symbol(:string) reserved(if) ident(field_type) operator(=)operator(~) regexp - reserved(super) - reserved(end) - reserved(end) - - comment(# The MySQL adapter will work with both Ruby/MySQL, which is a Ruby-based MySQL adapter that comes bundled with Active Record, and with) - comment(# the faster C-based MySQL/Ruby adapter (available both as a gem and from http://www.tmtm.org/en/mysql/ruby/\).) - comment(#) - comment(# Options:) - comment(#) - comment(# * :host -- Defaults to localhost) - comment(# * :port -- Defaults to 3306) - comment(# * :socket -- Defaults to /tmp/mysql.sock) - comment(# * :username -- Defaults to root) - comment(# * :password -- Defaults to nothing) - comment(# * :database -- The name of the database. No default, must be provided.) - comment(# * :sslkey -- Necessary to use MySQL with an SSL connection) - comment(# * :sslcert -- Necessary to use MySQL with an SSL connection) - comment(# * :sslcapath -- Necessary to use MySQL with an SSL connection) - comment(# * :sslcipher -- Necessary to use MySQL with an SSL connection) - comment(#) - comment(# By default, the MysqlAdapter will consider all columns of type tinyint(1\)) - comment(# as boolean. If you wish to disable this emulation (which was the default) - comment(# behavior in versions 0.13.1 and earlier\) you can add the following line) - comment(# to your environment.rb file:) - comment(#) - comment(# ActiveRecord::ConnectionAdapters::MysqlAdapter.emulate_booleans = false) - reserved(class) class(MysqlAdapter) operator(<) constant(AbstractAdapter) - class_variable(@@emulate_booleans) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:emulate_booleans) - - constant(LOST_CONNECTION_ERROR_MESSAGES) operator(=) operator([) - stringoperator(,) - stringoperator(,) - stringoperator(,) - string - operator(]) - - reserved(def) method(initialize)operator(()ident(connection)operator(,) ident(logger)operator(,) ident(connection_options)operator(,) ident(config)operator(\)) - reserved(super)operator(()ident(connection)operator(,) ident(logger)operator(\)) - instance_variable(@connection_options)operator(,) instance_variable(@config) operator(=) ident(connection_options)operator(,) ident(config) - instance_variable(@null_values_in_each_hash) operator(=) constant(Mysql)operator(.)ident(const_defined?)operator(()symbol(:VERSION)operator(\)) - ident(connect) - reserved(end) - - reserved(def) method(adapter_name) comment(#:nodoc:) - string - reserved(end) - - reserved(def) method(supports_migrations?) comment(#:nodoc:) - pre_constant(true) - reserved(end) - - reserved(def) method(native_database_types) comment(#:nodoc) - operator({) - symbol(:primary_key) operator(=)operator(>) stringoperator(,) - symbol(:string) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(255) operator(})operator(,) - symbol(:text) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:integer) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(11) operator(})operator(,) - symbol(:float) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:datetime) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:timestamp) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:time) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:date) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:binary) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:boolean) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(1) operator(}) - operator(}) - reserved(end) - - - comment(# QUOTING ==================================================) - - reserved(def) method(quote)operator(()ident(value)operator(,) ident(column) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(value)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) operator(&&) ident(column) operator(&&) ident(column)operator(.)ident(type) operator(==) symbol(:binary) operator(&&) ident(column)operator(.)ident(class)operator(.)ident(respond_to?)operator(()symbol(:string_to_binary)operator(\)) - ident(s) operator(=) ident(column)operator(.)ident(class)operator(.)ident(string_to_binary)operator(()ident(value)operator(\))operator(.)ident(unpack)operator(()stringoperator(\))operator([)integer(0)operator(]) - stringcontent(')delimiter(")> - reserved(else) - reserved(super) - reserved(end) - reserved(end) - - reserved(def) method(quote_column_name)operator(()ident(name)operator(\)) comment(#:nodoc:) - stringcontent(`)delimiter(")> - reserved(end) - - reserved(def) method(quote_string)operator(()ident(string)operator(\)) comment(#:nodoc:) - instance_variable(@connection)operator(.)ident(quote)operator(()ident(string)operator(\)) - reserved(end) - - reserved(def) method(quoted_true) - string - reserved(end) - - reserved(def) method(quoted_false) - string - reserved(end) - - - comment(# CONNECTION MANAGEMENT ====================================) - - reserved(def) method(active?) - reserved(if) instance_variable(@connection)operator(.)ident(respond_to?)operator(()symbol(:stat)operator(\)) - instance_variable(@connection)operator(.)ident(stat) - reserved(else) - instance_variable(@connection)operator(.)ident(query) string - reserved(end) - - comment(# mysql-ruby doesn't raise an exception when stat fails.) - reserved(if) instance_variable(@connection)operator(.)ident(respond_to?)operator(()symbol(:errno)operator(\)) - instance_variable(@connection)operator(.)ident(errno)operator(.)ident(zero?) - reserved(else) - pre_constant(true) - reserved(end) - reserved(rescue) constant(Mysql)operator(::)constant(Error) - pre_constant(false) - reserved(end) - - reserved(def) method(reconnect!) - ident(disconnect!) - ident(connect) - reserved(end) - - reserved(def) method(disconnect!) - instance_variable(@connection)operator(.)ident(close) reserved(rescue) pre_constant(nil) - reserved(end) - - - comment(# DATABASE STATEMENTS ======================================) - - reserved(def) method(select_all)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - - reserved(def) method(select_one)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(result) operator(=) ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(result)operator(.)ident(nil?) operator(?) pre_constant(nil) operator(:) ident(result)operator(.)ident(first) - reserved(end) - - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(retries) operator(=) integer(2)operator(\)) comment(#:nodoc:) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) operator({) instance_variable(@connection)operator(.)ident(query)operator(()ident(sql)operator(\)) operator(}) - reserved(rescue) constant(ActiveRecord)operator(::)constant(StatementInvalid) operator(=)operator(>) ident(exception) - reserved(if) ident(exception)operator(.)ident(message)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(first) operator(=)operator(~) regexp - ident(raise) constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(,) string - reserved(else) - ident(raise) - reserved(end) - reserved(end) - - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(,) ident(sequence_name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(id_value) operator(||) instance_variable(@connection)operator(.)ident(insert_id) - reserved(end) - - reserved(def) method(update)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - instance_variable(@connection)operator(.)ident(affected_rows) - reserved(end) - - ident(alias_method) symbol(:delete)operator(,) symbol(:update) comment(#:nodoc:) - - - reserved(def) method(begin_db_transaction) comment(#:nodoc:) - ident(execute) string - reserved(rescue) constant(Exception) - comment(# Transactions aren't supported) - reserved(end) - - reserved(def) method(commit_db_transaction) comment(#:nodoc:) - ident(execute) string - reserved(rescue) constant(Exception) - comment(# Transactions aren't supported) - reserved(end) - - reserved(def) method(rollback_db_transaction) comment(#:nodoc:) - ident(execute) string - reserved(rescue) constant(Exception) - comment(# Transactions aren't supported) - reserved(end) - - - reserved(def) method(add_limit_offset!)operator(()ident(sql)operator(,) ident(options)operator(\)) comment(#:nodoc) - reserved(if) ident(limit) operator(=) ident(options)operator([)symbol(:limit)operator(]) - reserved(unless) ident(offset) operator(=) ident(options)operator([)symbol(:offset)operator(]) - ident(sql) operator(<<) stringdelimiter(")> - reserved(else) - ident(sql) operator(<<) stringcontent(, )inlinedelimiter(")> - reserved(end) - reserved(end) - reserved(end) - - - comment(# SCHEMA STATEMENTS ========================================) - - reserved(def) method(structure_dump) comment(#:nodoc:) - reserved(if) ident(supports_views?) - ident(sql) operator(=) string - reserved(else) - ident(sql) operator(=) string - reserved(end) - - ident(select_all)operator(()ident(sql)operator(\))operator(.)ident(inject)operator(()stringoperator(\)) reserved(do) operator(|)ident(structure)operator(,) ident(table)operator(|) - ident(table)operator(.)ident(delete)operator(()stringoperator(\)) - ident(structure) operator(+=) ident(select_one)operator(()stringdelimiter(")>operator(\))operator([)stringoperator(]) operator(+) string - reserved(end) - reserved(end) - - reserved(def) method(recreate_database)operator(()ident(name)operator(\)) comment(#:nodoc:) - ident(drop_database)operator(()ident(name)operator(\)) - ident(create_database)operator(()ident(name)operator(\)) - reserved(end) - - reserved(def) method(create_database)operator(()ident(name)operator(\)) comment(#:nodoc:) - ident(execute) stringcontent(`)delimiter(")> - reserved(end) - - reserved(def) method(drop_database)operator(()ident(name)operator(\)) comment(#:nodoc:) - ident(execute) stringcontent(`)delimiter(")> - reserved(end) - - reserved(def) method(current_database) - ident(select_one)operator(()stringoperator(\))operator([)stringoperator(]) - reserved(end) - - reserved(def) method(tables)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(tables) operator(=) operator([)operator(]) - ident(execute)operator(()stringoperator(,) ident(name)operator(\))operator(.)ident(each) operator({) operator(|)ident(field)operator(|) ident(tables) operator(<<) ident(field)operator([)integer(0)operator(]) operator(}) - ident(tables) - reserved(end) - - reserved(def) method(indexes)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\))comment(#:nodoc:) - ident(indexes) operator(=) operator([)operator(]) - ident(current_index) operator(=) pre_constant(nil) - ident(execute)operator(()stringdelimiter(")>operator(,) ident(name)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(row)operator(|) - reserved(if) ident(current_index) operator(!=) ident(row)operator([)integer(2)operator(]) - reserved(next) reserved(if) ident(row)operator([)integer(2)operator(]) operator(==) string comment(# skip the primary key) - ident(current_index) operator(=) ident(row)operator([)integer(2)operator(]) - ident(indexes) operator(<<) constant(IndexDefinition)operator(.)ident(new)operator(()ident(row)operator([)integer(0)operator(])operator(,) ident(row)operator([)integer(2)operator(])operator(,) ident(row)operator([)integer(1)operator(]) operator(==) stringoperator(,) operator([)operator(])operator(\)) - reserved(end) - - ident(indexes)operator(.)ident(last)operator(.)ident(columns) operator(<<) ident(row)operator([)integer(4)operator(]) - reserved(end) - ident(indexes) - reserved(end) - - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\))comment(#:nodoc:) - ident(sql) operator(=) stringdelimiter(")> - ident(columns) operator(=) operator([)operator(]) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\))operator(.)ident(each) operator({) operator(|)ident(field)operator(|) ident(columns) operator(<<) constant(MysqlColumn)operator(.)ident(new)operator(()ident(field)operator([)integer(0)operator(])operator(,) ident(field)operator([)integer(4)operator(])operator(,) ident(field)operator([)integer(1)operator(])operator(,) ident(field)operator([)integer(2)operator(]) operator(==) stringoperator(\)) operator(}) - ident(columns) - reserved(end) - - reserved(def) method(create_table)operator(()ident(name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - reserved(super)operator(()ident(name)operator(,) operator({)symbol(:options) operator(=)operator(>) stringoperator(})operator(.)ident(merge)operator(()ident(options)operator(\))operator(\)) - reserved(end) - - reserved(def) method(rename_table)operator(()ident(name)operator(,) ident(new_name)operator(\)) - ident(execute) stringcontent( TO )inlinedelimiter(")> - reserved(end) - - reserved(def) method(change_column_default)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(default)operator(\)) comment(#:nodoc:) - ident(current_type) operator(=) ident(select_one)operator(()stringcontent( LIKE ')inlinecontent(')delimiter(")>operator(\))operator([)stringoperator(]) - - ident(change_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(current_type)operator(,) operator({) symbol(:default) operator(=)operator(>) ident(default) operator(})operator(\)) - reserved(end) - - reserved(def) method(change_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(options)operator([)symbol(:default)operator(]) operator(||=) ident(select_one)operator(()stringcontent( LIKE ')inlinecontent(')delimiter(")>operator(\))operator([)stringoperator(]) - - ident(change_column_sql) operator(=) stringcontent( CHANGE )inlinecontent( )inlinecontent( )inlinedelimiter(")> - ident(add_column_options!)operator(()ident(change_column_sql)operator(,) ident(options)operator(\)) - ident(execute)operator(()ident(change_column_sql)operator(\)) - reserved(end) - - reserved(def) method(rename_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(new_column_name)operator(\)) comment(#:nodoc:) - ident(current_type) operator(=) ident(select_one)operator(()stringcontent( LIKE ')inlinecontent(')delimiter(")>operator(\))operator([)stringoperator(]) - ident(execute) stringcontent( CHANGE )inlinecontent( )inlinecontent( )inlinedelimiter(")> - reserved(end) - - - ident(private) - reserved(def) method(connect) - ident(encoding) operator(=) instance_variable(@config)operator([)symbol(:encoding)operator(]) - reserved(if) ident(encoding) - instance_variable(@connection)operator(.)ident(options)operator(()constant(Mysql)operator(::)constant(SET_CHARSET_NAME)operator(,) ident(encoding)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - instance_variable(@connection)operator(.)ident(real_connect)operator(()operator(*)instance_variable(@connection_options)operator(\)) - ident(execute)operator(()stringcontent(')delimiter(")>operator(\)) reserved(if) ident(encoding) - reserved(end) - - reserved(def) method(select)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - instance_variable(@connection)operator(.)ident(query_with_result) operator(=) pre_constant(true) - ident(result) operator(=) ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(rows) operator(=) operator([)operator(]) - reserved(if) instance_variable(@null_values_in_each_hash) - ident(result)operator(.)ident(each_hash) operator({) operator(|)ident(row)operator(|) ident(rows) operator(<<) ident(row) operator(}) - reserved(else) - ident(all_fields) operator(=) ident(result)operator(.)ident(fetch_fields)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) operator({) operator(|)ident(fields)operator(,) ident(f)operator(|) ident(fields)operator([)ident(f)operator(.)ident(name)operator(]) operator(=) pre_constant(nil)operator(;) ident(fields) operator(}) - ident(result)operator(.)ident(each_hash) operator({) operator(|)ident(row)operator(|) ident(rows) operator(<<) ident(all_fields)operator(.)ident(dup)operator(.)ident(update)operator(()ident(row)operator(\)) operator(}) - reserved(end) - ident(result)operator(.)ident(free) - ident(rows) - reserved(end) - - reserved(def) method(supports_views?) - ident(version)operator([)integer(0)operator(]) operator(>)operator(=) integer(5) - reserved(end) - - reserved(def) method(version) - instance_variable(@version) operator(||=) instance_variable(@connection)operator(.)ident(server_info)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(flatten)operator(.)ident(map) operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(to_i) operator(}) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(class) class(Base) - comment(# Establishes a connection to the database that's used by all Active Record objects) - reserved(def) pre_constant(self)operator(.)method(openbase_connection)operator(()ident(config)operator(\)) comment(# :nodoc:) - ident(require_library_or_gem) string reserved(unless) pre_constant(self)operator(.)ident(class)operator(.)ident(const_defined?)operator(()symbol(:OpenBase)operator(\)) - - ident(config) operator(=) ident(config)operator(.)ident(symbolize_keys) - ident(host) operator(=) ident(config)operator([)symbol(:host)operator(]) - ident(username) operator(=) ident(config)operator([)symbol(:username)operator(])operator(.)ident(to_s) - ident(password) operator(=) ident(config)operator([)symbol(:password)operator(])operator(.)ident(to_s) - - - reserved(if) ident(config)operator(.)ident(has_key?)operator(()symbol(:database)operator(\)) - ident(database) operator(=) ident(config)operator([)symbol(:database)operator(]) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - ident(oba) operator(=) constant(ConnectionAdapters)operator(::)constant(OpenBaseAdapter)operator(.)ident(new)operator(() - constant(OpenBase)operator(.)ident(new)operator(()ident(database)operator(,) ident(host)operator(,) ident(username)operator(,) ident(password)operator(\))operator(,) ident(logger) - operator(\)) - - ident(oba) - reserved(end) - - reserved(end) - - reserved(module) class(ConnectionAdapters) - reserved(class) class(OpenBaseColumn) operator(<) constant(Column) comment(#:nodoc:) - ident(private) - reserved(def) method(simplified_type)operator(()ident(field_type)operator(\)) - reserved(return) symbol(:integer) reserved(if) ident(field_type)operator(.)ident(downcase) operator(=)operator(~) regexp - reserved(return) symbol(:float) reserved(if) ident(field_type)operator(.)ident(downcase) operator(==) string - reserved(return) symbol(:binary) reserved(if) ident(field_type)operator(.)ident(downcase) operator(==) string - reserved(super) - reserved(end) - reserved(end) - comment(# The OpenBase adapter works with the Ruby/Openbase driver by Tetsuya Suzuki.) - comment(# http://www.spice-of-life.net/ruby-openbase/ (needs version 0.7.3+\)) - comment(#) - comment(# Options:) - comment(#) - comment(# * :host -- Defaults to localhost) - comment(# * :username -- Defaults to nothing) - comment(# * :password -- Defaults to nothing) - comment(# * :database -- The name of the database. No default, must be provided.) - comment(#) - comment(# The OpenBase adapter will make use of OpenBase's ability to generate unique ids) - comment(# for any column with an unique index applied. Thus, if the value of a primary) - comment(# key is not specified at the time an INSERT is performed, the adapter will prefetch) - comment(# a unique id for the primary key. This prefetching is also necessary in order ) - comment(# to return the id after an insert.) - comment(#) - comment(# Caveat: Operations involving LIMIT and OFFSET do not yet work!) - comment(#) - comment(# Maintainer: derrickspell@cdmplus.com) - reserved(class) class(OpenBaseAdapter) operator(<) constant(AbstractAdapter) - reserved(def) method(adapter_name) - string - reserved(end) - - reserved(def) method(native_database_types) - operator({) - symbol(:primary_key) operator(=)operator(>) stringoperator(,) - symbol(:string) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(4096) operator(})operator(,) - symbol(:text) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:integer) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:float) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:datetime) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:timestamp) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:time) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:date) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:binary) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:boolean) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(}) - operator(}) - reserved(end) - - reserved(def) method(supports_migrations?) - pre_constant(false) - reserved(end) - - reserved(def) method(prefetch_primary_key?)operator(()ident(table_name) operator(=) pre_constant(nil)operator(\)) - pre_constant(true) - reserved(end) - - reserved(def) method(default_sequence_name)operator(()ident(table_name)operator(,) ident(primary_key)operator(\)) comment(# :nodoc:) - stringcontent( )inlinedelimiter(")> - reserved(end) - - reserved(def) method(next_sequence_value)operator(()ident(sequence_name)operator(\)) - ident(ary) operator(=) ident(sequence_name)operator(.)ident(split)operator(()stringoperator(\)) - reserved(if) operator(()operator(!)ident(ary)operator([)integer(1)operator(])operator(\)) reserved(then) - ident(ary)operator([)integer(0)operator(]) operator(=)operator(~) regexp - ident(ary)operator([)integer(0)operator(]) operator(=) global_variable($1) - reserved(end) - instance_variable(@connection)operator(.)ident(unique_row_id)operator(()ident(ary)operator([)integer(0)operator(])operator(,) ident(ary)operator([)integer(1)operator(])operator(\)) - reserved(end) - - - comment(# QUOTING ==================================================) - - reserved(def) method(quote)operator(()ident(value)operator(,) ident(column) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(value)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) operator(&&) ident(column) operator(&&) ident(column)operator(.)ident(type) operator(==) symbol(:binary) - stringcontent(')delimiter(")> - reserved(else) - reserved(super) - reserved(end) - reserved(end) - - reserved(def) method(quoted_true) - string - reserved(end) - - reserved(def) method(quoted_false) - string - reserved(end) - - - - comment(# DATABASE STATEMENTS ======================================) - - reserved(def) method(add_limit_offset!)operator(()ident(sql)operator(,) ident(options)operator(\)) comment(#:nodoc) - reserved(if) ident(limit) operator(=) ident(options)operator([)symbol(:limit)operator(]) - reserved(unless) ident(offset) operator(=) ident(options)operator([)symbol(:offset)operator(]) - ident(sql) operator(<<) stringdelimiter(")> - reserved(else) - ident(limit) operator(=) ident(limit) operator(+) ident(offset) - ident(sql) operator(<<) stringcontent( TO )inlinedelimiter(")> - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(select_all)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - - reserved(def) method(select_one)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(add_limit_offset!)operator(()ident(sql)operator(,)operator({)symbol(:limit) operator(=)operator(>) integer(1)operator(})operator(\)) - ident(results) operator(=) ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(results)operator(.)ident(first) reserved(if) ident(results) - reserved(end) - - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(,) ident(sequence_name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(update_nulls_after_insert)operator(()ident(sql)operator(,) ident(name)operator(,) ident(pk)operator(,) ident(id_value)operator(,) ident(sequence_name)operator(\)) - ident(id_value) - reserved(end) - - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) operator({) instance_variable(@connection)operator(.)ident(execute)operator(()ident(sql)operator(\)) operator(}) - reserved(end) - - reserved(def) method(update)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\))operator(.)ident(rows_affected) - reserved(end) - - ident(alias_method) symbol(:delete)operator(,) symbol(:update) comment(#:nodoc:) -comment(#=begin) - reserved(def) method(begin_db_transaction) comment(#:nodoc:) - ident(execute) string - reserved(rescue) constant(Exception) - comment(# Transactions aren't supported) - reserved(end) - - reserved(def) method(commit_db_transaction) comment(#:nodoc:) - ident(execute) string - reserved(rescue) constant(Exception) - comment(# Transactions aren't supported) - reserved(end) - - reserved(def) method(rollback_db_transaction) comment(#:nodoc:) - ident(execute) string - reserved(rescue) constant(Exception) - comment(# Transactions aren't supported) - reserved(end) -comment(#=end ) - - comment(# SCHEMA STATEMENTS ========================================) - - comment(# Return the list of all tables in the schema search path.) - reserved(def) method(tables)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(tables) operator(=) instance_variable(@connection)operator(.)ident(tables) - ident(tables)operator(.)ident(reject!) operator({) operator(|)ident(t)operator(|) regexp operator(===) ident(t) operator(}) - ident(tables) - reserved(end) - - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(sql) operator(=) string - ident(sql) operator(<<) string0 )delimiter(")> - ident(sql) operator(<<) string - ident(columns) operator(=) operator([)operator(]) - ident(select_all)operator(()ident(sql)operator(,) ident(name)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(row)operator(|) - ident(columns) operator(<<) constant(OpenBaseColumn)operator(.)ident(new)operator(()ident(row)operator([)stringoperator(])operator(,) - ident(default_value)operator(()ident(row)operator([)stringoperator(])operator(\))operator(,) - ident(sql_type_name)operator(()ident(row)operator([)stringoperator(])operator(,)ident(row)operator([)stringoperator(])operator(\))operator(,) - ident(row)operator([)stringoperator(]) - operator(\)) - comment(# breakpoint(\) if row["fieldname"] == "content") - reserved(end) - ident(columns) - reserved(end) - - reserved(def) method(indexes)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\))comment(#:nodoc:) - ident(sql) operator(=) string - ident(sql) operator(<<) string0 )delimiter(")> - ident(sql) operator(<<) string - ident(sql) operator(<<) string - ident(sql) operator(<<) string - ident(indexes) operator(=) operator([)operator(]) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(row)operator(|) - ident(indexes) operator(<<) constant(IndexDefinition)operator(.)ident(new)operator(()ident(table_name)operator(,)ident(index_name)operator(()ident(row)operator(\))operator(,)ident(row)operator([)integer(3)operator(])operator(==)integer(1)operator(,)operator([)ident(row)operator([)integer(0)operator(])operator(])operator(\)) - reserved(end) - ident(indexes) - reserved(end) - - - ident(private) - reserved(def) method(select)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(sql) operator(=) ident(translate_sql)operator(()ident(sql)operator(\)) - ident(results) operator(=) ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - - ident(date_cols) operator(=) operator([)operator(]) - ident(col_names) operator(=) operator([)operator(]) - ident(results)operator(.)ident(column_infos)operator(.)ident(each) reserved(do) operator(|)ident(info)operator(|) - ident(col_names) operator(<<) ident(info)operator(.)ident(name) - ident(date_cols) operator(<<) ident(info)operator(.)ident(name) reserved(if) ident(info)operator(.)ident(type) operator(==) string - reserved(end) - - ident(rows) operator(=) operator([)operator(]) - reserved(if) operator(() ident(results)operator(.)ident(rows_affected) operator(\)) - ident(results)operator(.)ident(each) reserved(do) operator(|)ident(row)operator(|) comment(# loop through result rows) - ident(hashed_row) operator(=) operator({)operator(}) - ident(row)operator(.)ident(each_index) reserved(do) operator(|)ident(index)operator(|) - ident(hashed_row)operator([)stringdelimiter(")>operator(]) operator(=) ident(row)operator([)ident(index)operator(]) reserved(unless) ident(col_names)operator([)ident(index)operator(]) operator(==) string - reserved(end) - ident(date_cols)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - reserved(unless) ident(hashed_row)operator([)stringdelimiter(")>operator(])operator(.)ident(nil?) reserved(or) ident(hashed_row)operator([)stringdelimiter(")>operator(])operator(.)ident(empty?) - ident(hashed_row)operator([)stringdelimiter(")>operator(]) operator(=) constant(Date)operator(.)ident(parse)operator(()ident(hashed_row)operator([)stringdelimiter(")>operator(])operator(,)pre_constant(false)operator(\))operator(.)ident(to_s) - reserved(end) - reserved(end) - ident(rows) operator(<<) ident(hashed_row) - reserved(end) - reserved(end) - ident(rows) - reserved(end) - - reserved(def) method(default_value)operator(()ident(value)operator(\)) - comment(# Boolean type values) - reserved(return) pre_constant(true) reserved(if) ident(value) operator(=)operator(~) regexp - reserved(return) pre_constant(false) reserved(if) ident(value) operator(=)operator(~) regexp - - comment(# Date / Time magic values) - reserved(return) constant(Time)operator(.)ident(now)operator(.)ident(to_s) reserved(if) ident(value) operator(=)operator(~) regexp - - comment(# Empty strings should be set to null) - reserved(return) pre_constant(nil) reserved(if) ident(value)operator(.)ident(empty?) - - comment(# Otherwise return what we got from OpenBase) - comment(# and hope for the best...) - reserved(return) ident(value) - reserved(end) - - reserved(def) method(sql_type_name)operator(()ident(type_name)operator(,) ident(length)operator(\)) - reserved(return) stringcontent(()inlinecontent(\))delimiter(")> reserved(if) operator(() ident(type_name) operator(=)operator(~) regexp operator(\)) - ident(type_name) - reserved(end) - - reserved(def) method(index_name)operator(()ident(row) operator(=) operator([)operator(])operator(\)) - ident(name) operator(=) string - ident(name) operator(<<) string reserved(if) ident(row)operator([)integer(3)operator(]) - ident(name) operator(<<) string reserved(if) ident(row)operator([)integer(4)operator(]) - ident(name) operator(<<) string - ident(name) - reserved(end) - - reserved(def) method(translate_sql)operator(()ident(sql)operator(\)) - - comment(# Change table.* to list of columns in table) - reserved(while) operator(()ident(sql) operator(=)operator(~) regexpoperator(\)) - ident(table) operator(=) global_variable($1) - ident(cols) operator(=) ident(columns)operator(()ident(table)operator(\)) - reserved(if) operator(() ident(cols)operator(.)ident(size) operator(==) integer(0) operator(\)) reserved(then) - comment(# Maybe this is a table alias) - ident(sql) operator(=)operator(~) regexp - global_variable($1) operator(=)operator(~) regexpcontent([)char(\\s)content(|,])delimiter(/)> comment(# get the tablename for this alias) - ident(cols) operator(=) ident(columns)operator(()global_variable($1)operator(\)) - reserved(end) - ident(select_columns) operator(=) operator([)operator(]) - ident(cols)operator(.)ident(each) reserved(do) operator(|)ident(col)operator(|) - ident(select_columns) operator(<<) ident(table) operator(+) string operator(+) ident(col)operator(.)ident(name) - reserved(end) - ident(sql)operator(.)ident(gsub!)operator(()ident(table) operator(+) stringoperator(,)ident(select_columns)operator(.)ident(join)operator(()stringoperator(\))operator(\)) reserved(if) ident(select_columns) - reserved(end) - - comment(# Change JOIN clause to table list and WHERE condition) - reserved(while) operator(()ident(sql) operator(=)operator(~) regexpoperator(\)) - ident(sql) operator(=)operator(~) regexp - ident(join_clause) operator(=) global_variable($1) operator(+) global_variable($5) - ident(is_outer_join) operator(=) global_variable($3) - ident(join_table) operator(=) global_variable($4) - ident(join_condition) operator(=) global_variable($5) - ident(join_condition)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) reserved(if) ident(is_outer_join) - reserved(if) operator(()ident(sql) operator(=)operator(~) regexpoperator(\)) - ident(sql)operator(.)ident(gsub!)operator(()regexpoperator(,)stringcontent(\) AND)delimiter(")>operator(\)) - reserved(else) - ident(sql)operator(.)ident(gsub!)operator(()ident(join_clause)operator(,)stringcontent( WHERE )inlinedelimiter(")>operator(\)) - reserved(end) - ident(sql) operator(=)operator(~) regexp - ident(from_clause) operator(=) global_variable($1) - ident(sql)operator(.)ident(gsub!)operator(()ident(from_clause)operator(,)stringcontent(, )inlinecontent( )delimiter(")>operator(\)) - ident(sql)operator(.)ident(gsub!)operator(()ident(join_clause)operator(,)stringoperator(\)) - reserved(end) - - comment(# ORDER BY _rowid if no explicit ORDER BY) - comment(# This will ensure that find(:first\) returns the first inserted row) - reserved(if) operator(()ident(sql) operator(!)operator(~) regexpoperator(\)) - reserved(if) operator(()ident(sql) operator(=)operator(~) regexpoperator(\)) - ident(sql)operator(.)ident(sub!)operator(()regexpoperator(,)stringoperator(\)) - reserved(else) - ident(sql) operator(<<) string - reserved(end) - reserved(end) - - ident(sql) - reserved(end) - - reserved(def) method(update_nulls_after_insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(,) ident(sequence_name) operator(=) pre_constant(nil)operator(\)) - ident(sql) operator(=)operator(~) regexp - ident(table) operator(=) global_variable($1) - ident(cols) operator(=) global_variable($2) - ident(values) operator(=) global_variable($3) - ident(cols) operator(=) ident(cols)operator(.)ident(split)operator(()stringoperator(\)) - ident(values)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) - ident(values)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) - ident(values) operator(=) ident(values)operator(.)ident(split)operator(()stringoperator(\)) - ident(update_cols) operator(=) operator([)operator(]) - ident(values)operator(.)ident(each_index) operator({) operator(|)ident(index)operator(|) ident(update_cols) operator(<<) ident(cols)operator([)ident(index)operator(]) reserved(if) ident(values)operator([)ident(index)operator(]) operator(=)operator(~) regexp operator(}) - ident(update_sql) operator(=) stringcontent( SET)delimiter(")> - ident(update_cols)operator(.)ident(each) operator({) operator(|)ident(col)operator(|) ident(update_sql) operator(<<) stringcontent(=NULL,)delimiter(")> reserved(unless) ident(col)operator(.)ident(empty?) operator(}) - ident(update_sql)operator(.)ident(chop!)operator(()operator(\)) - ident(update_sql) operator(<<) stringcontent(=)inlinedelimiter(")> - ident(execute)operator(()ident(update_sql)operator(,) ident(name) operator(+) stringoperator(\)) reserved(if) ident(update_cols)operator(.)ident(size) operator(>) integer(0) - reserved(end) - - reserved(end) - reserved(end) -reserved(end) -comment(# oracle_adapter.rb -- ActiveRecord adapter for Oracle 8i, 9i, 10g) -comment(#) -comment(# Original author: Graham Jenkins) -comment(#) -comment(# Current maintainer: Michael Schoen ) -comment(#) -comment(#########################################################################) -comment(#) -comment(# Implementation notes:) -comment(# 1. Redefines (safely\) a method in ActiveRecord to make it possible to) -comment(# implement an autonumbering solution for Oracle.) -comment(# 2. The OCI8 driver is patched to properly handle values for LONG and) -comment(# TIMESTAMP columns. The driver-author has indicated that a future) -comment(# release of the driver will obviate this patch.) -comment(# 3. LOB support is implemented through an after_save callback.) -comment(# 4. Oracle does not offer native LIMIT and OFFSET options; this) -comment(# functionality is mimiced through the use of nested selects.) -comment(# See http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:127412348064) -comment(#) -comment(# Do what you want with this code, at your own peril, but if any) -comment(# significant portion of my code remains then please acknowledge my) -comment(# contribution.) -comment(# portions Copyright 2005 Graham Jenkins) - -ident(require) string -ident(require) string - -reserved(begin) - ident(require_library_or_gem) string reserved(unless) pre_constant(self)operator(.)ident(class)operator(.)ident(const_defined?) symbol(:OCI8) - - reserved(module) class(ActiveRecord) - reserved(class) class(Base) - reserved(def) pre_constant(self)operator(.)method(oracle_connection)operator(()ident(config)operator(\)) comment(#:nodoc:) - comment(# Use OCI8AutoRecover instead of normal OCI8 driver.) - constant(ConnectionAdapters)operator(::)constant(OracleAdapter)operator(.)ident(new) constant(OCI8AutoRecover)operator(.)ident(new)operator(()ident(config)operator(\))operator(,) ident(logger) - reserved(end) - - comment(# for backwards-compatibility) - reserved(def) pre_constant(self)operator(.)method(oci_connection)operator(()ident(config)operator(\)) comment(#:nodoc:) - ident(config)operator([)symbol(:database)operator(]) operator(=) ident(config)operator([)symbol(:host)operator(]) - pre_constant(self)operator(.)ident(oracle_connection)operator(()ident(config)operator(\)) - reserved(end) - - comment(# Enable the id column to be bound into the sql later, by the adapter's insert method.) - comment(# This is preferable to inserting the hard-coded value here, because the insert method) - comment(# needs to know the id value explicitly.) - reserved(alias) symbol(:attributes_with_quotes_pre_oracle) symbol(:attributes_with_quotes) - reserved(def) method(attributes_with_quotes)operator(()ident(include_primary_key) operator(=) pre_constant(true)operator(\)) comment(#:nodoc:) - ident(aq) operator(=) ident(attributes_with_quotes_pre_oracle)operator(()ident(include_primary_key)operator(\)) - reserved(if) ident(connection)operator(.)ident(class) operator(==) constant(ConnectionAdapters)operator(::)constant(OracleAdapter) - ident(aq)operator([)pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(]) operator(=) string reserved(if) ident(include_primary_key) operator(&&) ident(aq)operator([)pre_constant(self)operator(.)ident(class)operator(.)ident(primary_key)operator(])operator(.)ident(nil?) - reserved(end) - ident(aq) - reserved(end) - - comment(# After setting large objects to empty, select the OCI8::LOB) - comment(# and write back the data.) - ident(after_save) symbol(:write_lobs) - reserved(def) method(write_lobs)operator(()operator(\)) comment(#:nodoc:) - reserved(if) ident(connection)operator(.)ident(is_a?)operator(()constant(ConnectionAdapters)operator(::)constant(OracleAdapter)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(columns)operator(.)ident(select) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(type) operator(==) symbol(:binary) operator(})operator(.)ident(each) operator({) operator(|)ident(c)operator(|) - ident(value) operator(=) pre_constant(self)operator([)ident(c)operator(.)ident(name)operator(]) - reserved(next) reserved(if) ident(value)operator(.)ident(nil?) operator(||) operator(()ident(value) operator(==) stringoperator(\)) - ident(lob) operator(=) ident(connection)operator(.)ident(select_one)operator(() - stringcontent( FROM )inlinecontent( WHERE )inlinecontent( = )inlinedelimiter(")>operator(,) - stringoperator(\))operator([)ident(c)operator(.)ident(name)operator(]) - ident(lob)operator(.)ident(write) ident(value) - operator(}) - reserved(end) - reserved(end) - - ident(private) symbol(:write_lobs) - reserved(end) - - - reserved(module) class(ConnectionAdapters) comment(#:nodoc:) - reserved(class) class(OracleColumn) operator(<) constant(Column) comment(#:nodoc:) - ident(attr_reader) symbol(:sql_type) - - comment(# overridden to add the concept of scale, required to differentiate) - comment(# between integer and float fields) - reserved(def) method(initialize)operator(()ident(name)operator(,) ident(default)operator(,) ident(sql_type)operator(,) ident(limit)operator(,) ident(scale)operator(,) ident(null)operator(\)) - instance_variable(@name)operator(,) instance_variable(@limit)operator(,) instance_variable(@sql_type)operator(,) instance_variable(@scale)operator(,) instance_variable(@null) operator(=) ident(name)operator(,) ident(limit)operator(,) ident(sql_type)operator(,) ident(scale)operator(,) ident(null) - - instance_variable(@type) operator(=) ident(simplified_type)operator(()ident(sql_type)operator(\)) - instance_variable(@default) operator(=) ident(type_cast)operator(()ident(default)operator(\)) - - instance_variable(@primary) operator(=) pre_constant(nil) - instance_variable(@text) operator(=) operator([)symbol(:string)operator(,) symbol(:text)operator(])operator(.)ident(include?) instance_variable(@type) - instance_variable(@number) operator(=) operator([)symbol(:float)operator(,) symbol(:integer)operator(])operator(.)ident(include?) instance_variable(@type) - reserved(end) - - reserved(def) method(type_cast)operator(()ident(value)operator(\)) - reserved(return) pre_constant(nil) reserved(if) ident(value)operator(.)ident(nil?) operator(||) ident(value) operator(=)operator(~) regexp - reserved(case) ident(type) - reserved(when) symbol(:string) reserved(then) ident(value) - reserved(when) symbol(:integer) reserved(then) reserved(defined?)operator(()ident(value)operator(.)ident(to_i)operator(\)) operator(?) ident(value)operator(.)ident(to_i) operator(:) operator(()ident(value) operator(?) integer(1) operator(:) integer(0)operator(\)) - reserved(when) symbol(:float) reserved(then) ident(value)operator(.)ident(to_f) - reserved(when) symbol(:datetime) reserved(then) ident(cast_to_date_or_time)operator(()ident(value)operator(\)) - reserved(when) symbol(:time) reserved(then) ident(cast_to_time)operator(()ident(value)operator(\)) - reserved(else) ident(value) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(simplified_type)operator(()ident(field_type)operator(\)) - reserved(case) ident(field_type) - reserved(when) regexp operator(:) symbol(:string) - reserved(when) regexp operator(:) instance_variable(@scale) operator(==) integer(0) operator(?) symbol(:integer) operator(:) symbol(:float) - reserved(when) regexp operator(:) instance_variable(@name) operator(=)operator(~) regexp operator(?) symbol(:time) operator(:) symbol(:datetime) - reserved(when) regexp operator(:) symbol(:text) - reserved(when) regexp operator(:) symbol(:binary) - reserved(end) - reserved(end) - - reserved(def) method(cast_to_date_or_time)operator(()ident(value)operator(\)) - reserved(return) ident(value) reserved(if) ident(value)operator(.)ident(is_a?) constant(Date) - reserved(return) pre_constant(nil) reserved(if) ident(value)operator(.)ident(blank?) - ident(guess_date_or_time) operator(()ident(value)operator(.)ident(is_a?) constant(Time)operator(\)) operator(?) ident(value) operator(:) ident(cast_to_time)operator(()ident(value)operator(\)) - reserved(end) - - reserved(def) method(cast_to_time)operator(()ident(value)operator(\)) - reserved(return) ident(value) reserved(if) ident(value)operator(.)ident(is_a?) constant(Time) - ident(time_array) operator(=) constant(ParseDate)operator(.)ident(parsedate) ident(value) - ident(time_array)operator([)integer(0)operator(]) operator(||=) integer(2000)operator(;) ident(time_array)operator([)integer(1)operator(]) operator(||=) integer(1)operator(;) ident(time_array)operator([)integer(2)operator(]) operator(||=) integer(1)operator(;) - constant(Time)operator(.)ident(send)operator(()constant(Base)operator(.)ident(default_timezone)operator(,) operator(*)ident(time_array)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(guess_date_or_time)operator(()ident(value)operator(\)) - operator(()ident(value)operator(.)ident(hour) operator(==) integer(0) reserved(and) ident(value)operator(.)ident(min) operator(==) integer(0) reserved(and) ident(value)operator(.)ident(sec) operator(==) integer(0)operator(\)) operator(?) - constant(Date)operator(.)ident(new)operator(()ident(value)operator(.)ident(year)operator(,) ident(value)operator(.)ident(month)operator(,) ident(value)operator(.)ident(day)operator(\)) operator(:) ident(value) - reserved(end) - reserved(end) - - - comment(# This is an Oracle/OCI adapter for the ActiveRecord persistence) - comment(# framework. It relies upon the OCI8 driver, which works with Oracle 8i) - comment(# and above. Most recent development has been on Debian Linux against) - comment(# a 10g database, ActiveRecord 1.12.1 and OCI8 0.1.13.) - comment(# See: http://rubyforge.org/projects/ruby-oci8/) - comment(#) - comment(# Usage notes:) - comment(# * Key generation assumes a "${table_name}_seq" sequence is available) - comment(# for all tables; the sequence name can be changed using) - comment(# ActiveRecord::Base.set_sequence_name. When using Migrations, these) - comment(# sequences are created automatically.) - comment(# * Oracle uses DATE or TIMESTAMP datatypes for both dates and times.) - comment(# Consequently some hacks are employed to map data back to Date or Time) - comment(# in Ruby. If the column_name ends in _time it's created as a Ruby Time.) - comment(# Else if the hours/minutes/seconds are 0, I make it a Ruby Date. Else) - comment(# it's a Ruby Time. This is a bit nasty - but if you use Duck Typing) - comment(# you'll probably not care very much. In 9i and up it's tempting to) - comment(# map DATE to Date and TIMESTAMP to Time, but too many databases use) - comment(# DATE for both. Timezones and sub-second precision on timestamps are) - comment(# not supported.) - comment(# * Default values that are functions (such as "SYSDATE"\) are not) - comment(# supported. This is a restriction of the way ActiveRecord supports) - comment(# default values.) - comment(# * Support for Oracle8 is limited by Rails' use of ANSI join syntax, which) - comment(# is supported in Oracle9i and later. You will need to use #finder_sql for) - comment(# has_and_belongs_to_many associations to run against Oracle8.) - comment(#) - comment(# Required parameters:) - comment(#) - comment(# * :username) - comment(# * :password) - comment(# * :database) - reserved(class) class(OracleAdapter) operator(<) constant(AbstractAdapter) - - reserved(def) method(adapter_name) comment(#:nodoc:) - string - reserved(end) - - reserved(def) method(supports_migrations?) comment(#:nodoc:) - pre_constant(true) - reserved(end) - - reserved(def) method(native_database_types) comment(#:nodoc) - operator({) - symbol(:primary_key) operator(=)operator(>) stringoperator(,) - symbol(:string) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(255) operator(})operator(,) - symbol(:text) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:integer) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(38) operator(})operator(,) - symbol(:float) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:datetime) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:timestamp) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:time) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:date) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:binary) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:boolean) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(1) operator(}) - operator(}) - reserved(end) - - reserved(def) method(table_alias_length) - integer(30) - reserved(end) - - comment(# QUOTING ==================================================) - comment(#) - comment(# see: abstract/quoting.rb) - - comment(# camelCase column names need to be quoted; not that anyone using Oracle) - comment(# would really do this, but handling this case means we pass the test...) - reserved(def) method(quote_column_name)operator(()ident(name)operator(\)) comment(#:nodoc:) - ident(name) operator(=)operator(~) regexp operator(?) stringchar(\\")delimiter(")> operator(:) ident(name) - reserved(end) - - reserved(def) method(quote_string)operator(()ident(string)operator(\)) comment(#:nodoc:) - ident(string)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(quote)operator(()ident(value)operator(,) ident(column) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - reserved(if) ident(column) operator(&&) ident(column)operator(.)ident(type) operator(==) symbol(:binary) - string inline_delimiter(})>content((\))delimiter(})> - reserved(else) - reserved(case) ident(value) - reserved(when) constant(String) operator(:) stringcontent(')delimiter(})> - reserved(when) constant(NilClass) operator(:) string - reserved(when) constant(TrueClass) operator(:) string - reserved(when) constant(FalseClass) operator(:) string - reserved(when) constant(Numeric) operator(:) ident(value)operator(.)ident(to_s) - reserved(when) constant(Date)operator(,) constant(Time) operator(:) stringoperator(\))inline_delimiter(})>content(')delimiter(})> - reserved(else) stringcontent(')delimiter(})> - reserved(end) - reserved(end) - reserved(end) - - - comment(# CONNECTION MANAGEMENT ====================================) - comment(#) - - comment(# Returns true if the connection is active.) - reserved(def) method(active?) - comment(# Pings the connection to check if it's still good. Note that an) - comment(# #active? method is also available, but that simply returns the ) - comment(# last known state, which isn't good enough if the connection has) - comment(# gone stale since the last use.) - instance_variable(@connection)operator(.)ident(ping) - reserved(rescue) constant(OCIException) - pre_constant(false) - reserved(end) - - comment(# Reconnects to the database.) - reserved(def) method(reconnect!) - instance_variable(@connection)operator(.)ident(reset!) - reserved(rescue) constant(OCIException) operator(=)operator(>) ident(e) - instance_variable(@logger)operator(.)ident(warn) stringcontent( automatic reconnection failed: )inlinedelimiter(")> - reserved(end) - - comment(# Disconnects from the database.) - reserved(def) method(disconnect!) - instance_variable(@connection)operator(.)ident(logoff) reserved(rescue) pre_constant(nil) - instance_variable(@connection)operator(.)ident(active) operator(=) pre_constant(false) - reserved(end) - - - comment(# DATABASE STATEMENTS ======================================) - comment(#) - comment(# see: abstract/database_statements.rb) - - reserved(def) method(select_all)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - - reserved(def) method(select_one)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(result) operator(=) ident(select_all)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(result)operator(.)ident(size) operator(>) integer(0) operator(?) ident(result)operator(.)ident(first) operator(:) pre_constant(nil) - reserved(end) - - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) operator({) instance_variable(@connection)operator(.)ident(exec) ident(sql) operator(}) - reserved(end) - - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(,) ident(sequence_name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - reserved(if) ident(pk)operator(.)ident(nil?) comment(# Who called us? What does the sql look like? No idea!) - ident(execute) ident(sql)operator(,) ident(name) - reserved(elsif) ident(id_value) comment(# Pre-assigned id) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) operator({) instance_variable(@connection)operator(.)ident(exec) ident(sql) operator(}) - reserved(else) comment(# Assume the sql contains a bind-variable for the id) - ident(id_value) operator(=) ident(select_one)operator(()stringcontent(.nextval id from dual)delimiter(")>operator(\))operator([)stringoperator(]) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) operator({) instance_variable(@connection)operator(.)ident(exec) ident(sql)operator(,) ident(id_value) operator(}) - reserved(end) - - ident(id_value) - reserved(end) - - reserved(alias) symbol(:update) symbol(:execute) comment(#:nodoc:) - reserved(alias) symbol(:delete) symbol(:execute) comment(#:nodoc:) - - reserved(def) method(begin_db_transaction) comment(#:nodoc:) - instance_variable(@connection)operator(.)ident(autocommit) operator(=) pre_constant(false) - reserved(end) - - reserved(def) method(commit_db_transaction) comment(#:nodoc:) - instance_variable(@connection)operator(.)ident(commit) - reserved(ensure) - instance_variable(@connection)operator(.)ident(autocommit) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(rollback_db_transaction) comment(#:nodoc:) - instance_variable(@connection)operator(.)ident(rollback) - reserved(ensure) - instance_variable(@connection)operator(.)ident(autocommit) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(add_limit_offset!)operator(()ident(sql)operator(,) ident(options)operator(\)) comment(#:nodoc:) - ident(offset) operator(=) ident(options)operator([)symbol(:offset)operator(]) operator(||) integer(0) - - reserved(if) ident(limit) operator(=) ident(options)operator([)symbol(:limit)operator(]) - ident(sql)operator(.)ident(replace) stringcontent(\) raw_sql_ where rownum <= )inlinecontent(\) where raw_rnum_ > )inlinedelimiter(")> - reserved(elsif) ident(offset) operator(>) integer(0) - ident(sql)operator(.)ident(replace) stringcontent(\) raw_sql_\) where raw_rnum_ > )inlinedelimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(default_sequence_name)operator(()ident(table)operator(,) ident(column)operator(\)) comment(#:nodoc:) - stringcontent(_seq)delimiter(")> - reserved(end) - - - comment(# SCHEMA STATEMENTS ========================================) - comment(#) - comment(# see: abstract/schema_statements.rb) - - reserved(def) method(current_database) comment(#:nodoc:) - ident(select_one)operator(()stringoperator(\))operator([)stringoperator(]) - reserved(end) - - reserved(def) method(tables)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(select_all)operator(()stringoperator(\))operator(.)ident(inject)operator(()operator([)operator(])operator(\)) reserved(do) operator(|) ident(tabs)operator(,) ident(t) operator(|) - ident(tabs) operator(<<) ident(t)operator(.)ident(to_a)operator(.)ident(first)operator(.)ident(last) - reserved(end) - reserved(end) - - reserved(def) method(indexes)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(result) operator(=) ident(select_all)operator(()stringoperator(,) ident(name)operator(\))string - - ident(current_index) operator(=) pre_constant(nil) - ident(indexes) operator(=) operator([)operator(]) - - ident(result)operator(.)ident(each) reserved(do) operator(|)ident(row)operator(|) - reserved(if) ident(current_index) operator(!=) ident(row)operator([)stringoperator(]) - ident(indexes) operator(<<) constant(IndexDefinition)operator(.)ident(new)operator(()ident(table_name)operator(,) ident(row)operator([)stringoperator(])operator(,) ident(row)operator([)stringoperator(]) operator(==) stringoperator(,) operator([)operator(])operator(\)) - ident(current_index) operator(=) ident(row)operator([)stringoperator(]) - reserved(end) - - ident(indexes)operator(.)ident(last)operator(.)ident(columns) operator(<<) ident(row)operator([)stringoperator(]) - reserved(end) - - ident(indexes) - reserved(end) - - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - operator(()ident(owner)operator(,) ident(table_name)operator(\)) operator(=) instance_variable(@connection)operator(.)ident(describe)operator(()ident(table_name)operator(\)) - - ident(table_cols) operator(=) string - - ident(select_all)operator(()ident(table_cols)operator(,) ident(name)operator(\))operator(.)ident(map) reserved(do) operator(|)ident(row)operator(|) - reserved(if) ident(row)operator([)stringoperator(]) - ident(row)operator([)stringoperator(])operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(row)operator([)stringoperator(])operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - constant(OracleColumn)operator(.)ident(new)operator(() - ident(oracle_downcase)operator(()ident(row)operator([)stringoperator(])operator(\))operator(,) - ident(row)operator([)stringoperator(])operator(,) - ident(row)operator([)stringoperator(])operator(,) - operator(()ident(l) operator(=) ident(row)operator([)stringoperator(])operator(\))operator(.)ident(nil?) operator(?) pre_constant(nil) operator(:) ident(l)operator(.)ident(to_i)operator(,) - operator(()ident(s) operator(=) ident(row)operator([)stringoperator(])operator(\))operator(.)ident(nil?) operator(?) pre_constant(nil) operator(:) ident(s)operator(.)ident(to_i)operator(,) - ident(row)operator([)stringoperator(]) operator(==) string - operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(create_table)operator(()ident(name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - reserved(super)operator(()ident(name)operator(,) ident(options)operator(\)) - ident(execute) stringcontent(_seq START WITH 10000)delimiter(")> reserved(unless) ident(options)operator([)symbol(:id)operator(]) operator(==) pre_constant(false) - reserved(end) - - reserved(def) method(rename_table)operator(()ident(name)operator(,) ident(new_name)operator(\)) comment(#:nodoc:) - ident(execute) stringcontent( TO )inlinedelimiter(")> - ident(execute) stringcontent(_seq TO )inlinecontent(_seq)delimiter(")> reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(drop_table)operator(()ident(name)operator(\)) comment(#:nodoc:) - reserved(super)operator(()ident(name)operator(\)) - ident(execute) stringcontent(_seq)delimiter(")> reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(remove_index)operator(()ident(table_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(execute) stringdelimiter(")> - reserved(end) - - reserved(def) method(change_column_default)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(default)operator(\)) comment(#:nodoc:) - ident(execute) stringcontent( MODIFY )inlinecontent( DEFAULT )inlinedelimiter(")> - reserved(end) - - reserved(def) method(change_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(change_column_sql) operator(=) stringcontent( MODIFY )inlinecontent( )inlinedelimiter(")> - ident(add_column_options!)operator(()ident(change_column_sql)operator(,) ident(options)operator(\)) - ident(execute)operator(()ident(change_column_sql)operator(\)) - reserved(end) - - reserved(def) method(rename_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(new_column_name)operator(\)) comment(#:nodoc:) - ident(execute) stringcontent( RENAME COLUMN )inlinecontent( to )inlinedelimiter(")> - reserved(end) - - reserved(def) method(remove_column)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) comment(#:nodoc:) - ident(execute) stringcontent( DROP COLUMN )inlinedelimiter(")> - reserved(end) - - reserved(def) method(structure_dump) comment(#:nodoc:) - ident(s) operator(=) ident(select_all)operator(()stringoperator(\))operator(.)ident(inject)operator(()stringoperator(\)) reserved(do) operator(|)ident(structure)operator(,) ident(seq)operator(|) - ident(structure) operator(<<) stringcontent(;)char(\\n)char(\\n)delimiter(")> - reserved(end) - - ident(select_all)operator(()stringoperator(\))operator(.)ident(inject)operator(()ident(s)operator(\)) reserved(do) operator(|)ident(structure)operator(,) ident(table)operator(|) - ident(ddl) operator(=) stringcontent( ()char(\\n)content( )delimiter(")> - ident(cols) operator(=) ident(select_all)operator(()stringoperator(\))operator(.)ident(map) reserved(do) operator(|)ident(row)operator(|) - ident(col) operator(=) stringoperator(])operator(.)ident(downcase)inline_delimiter(})>content( )inlineoperator(])operator(.)ident(downcase)inline_delimiter(})>delimiter(")> - reserved(if) ident(row)operator([)stringoperator(]) operator(==)string reserved(and) operator(!)ident(row)operator([)stringoperator(])operator(.)ident(nil?) - ident(col) operator(<<) stringoperator(])operator(.)ident(to_i)inline_delimiter(})>delimiter(")> - ident(col) operator(<<) stringoperator(])operator(.)ident(to_i)inline_delimiter(})>delimiter(")> reserved(if) operator(!)ident(row)operator([)stringoperator(])operator(.)ident(nil?) - ident(col) operator(<<) string - reserved(elsif) ident(row)operator([)stringoperator(])operator(.)ident(include?)operator(()stringoperator(\)) - ident(col) operator(<<) stringoperator(])operator(.)ident(to_i)inline_delimiter(})>content(\))delimiter(")> - reserved(end) - ident(col) operator(<<) stringoperator(])inline_delimiter(})>delimiter(")> reserved(if) operator(!)ident(row)operator([)stringoperator(])operator(.)ident(nil?) - ident(col) operator(<<) string reserved(if) ident(row)operator([)stringoperator(]) operator(==) string - ident(col) - reserved(end) - ident(ddl) operator(<<) ident(cols)operator(.)ident(join)operator(()stringoperator(\)) - ident(ddl) operator(<<) string - ident(structure) operator(<<) ident(ddl) - reserved(end) - reserved(end) - - reserved(def) method(structure_drop) comment(#:nodoc:) - ident(s) operator(=) ident(select_all)operator(()stringoperator(\))operator(.)ident(inject)operator(()stringoperator(\)) reserved(do) operator(|)ident(drop)operator(,) ident(seq)operator(|) - ident(drop) operator(<<) stringcontent(;)char(\\n)char(\\n)delimiter(")> - reserved(end) - - ident(select_all)operator(()stringoperator(\))operator(.)ident(inject)operator(()ident(s)operator(\)) reserved(do) operator(|)ident(drop)operator(,) ident(table)operator(|) - ident(drop) operator(<<) stringcontent( cascade constraints;)char(\\n)char(\\n)delimiter(")> - reserved(end) - reserved(end) - - - ident(private) - - reserved(def) method(select)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(cursor) operator(=) ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(cols) operator(=) ident(cursor)operator(.)ident(get_col_names)operator(.)ident(map) operator({) operator(|)ident(x)operator(|) ident(oracle_downcase)operator(()ident(x)operator(\)) operator(}) - ident(rows) operator(=) operator([)operator(]) - - reserved(while) ident(row) operator(=) ident(cursor)operator(.)ident(fetch) - ident(hash) operator(=) constant(Hash)operator(.)ident(new) - - ident(cols)operator(.)ident(each_with_index) reserved(do) operator(|)ident(col)operator(,) ident(i)operator(|) - ident(hash)operator([)ident(col)operator(]) operator(=) - reserved(case) ident(row)operator([)ident(i)operator(]) - reserved(when) constant(OCI8)operator(::)constant(LOB) - ident(name) operator(==) string operator(?) ident(row)operator([)ident(i)operator(])operator(:) ident(row)operator([)ident(i)operator(])operator(.)ident(read) - reserved(when) constant(OraDate) - operator(()ident(row)operator([)ident(i)operator(])operator(.)ident(hour) operator(==) integer(0) reserved(and) ident(row)operator([)ident(i)operator(])operator(.)ident(minute) operator(==) integer(0) reserved(and) ident(row)operator([)ident(i)operator(])operator(.)ident(second) operator(==) integer(0)operator(\)) operator(?) - ident(row)operator([)ident(i)operator(])operator(.)ident(to_date) operator(:) ident(row)operator([)ident(i)operator(])operator(.)ident(to_time) - reserved(else) ident(row)operator([)ident(i)operator(]) - reserved(end) reserved(unless) ident(col) operator(==) string - reserved(end) - - ident(rows) operator(<<) ident(hash) - reserved(end) - - ident(rows) - reserved(ensure) - ident(cursor)operator(.)ident(close) reserved(if) ident(cursor) - reserved(end) - - comment(# Oracle column names by default are case-insensitive, but treated as upcase;) - comment(# for neatness, we'll downcase within Rails. EXCEPT that folks CAN quote) - comment(# their column names when creating Oracle tables, which makes then case-sensitive.) - comment(# I don't know anybody who does this, but we'll handle the theoretical case of a) - comment(# camelCase column name. I imagine other dbs handle this different, since there's a) - comment(# unit test that's currently failing test_oci.) - reserved(def) method(oracle_downcase)operator(()ident(column_name)operator(\)) - ident(column_name) operator(=)operator(~) regexp operator(?) ident(column_name) operator(:) ident(column_name)operator(.)ident(downcase) - reserved(end) - - reserved(end) - reserved(end) - reserved(end) - - - reserved(class) class(OCI8) comment(#:nodoc:) - - comment(# This OCI8 patch may not longer be required with the upcoming) - comment(# release of version 0.2.) - reserved(class) class(Cursor) comment(#:nodoc:) - reserved(alias) symbol(:define_a_column_pre_ar) symbol(:define_a_column) - reserved(def) method(define_a_column)operator(()ident(i)operator(\)) - reserved(case) ident(do_ocicall)operator(()instance_variable(@ctx)operator(\)) operator({) instance_variable(@parms)operator([)ident(i) operator(-) integer(1)operator(])operator(.)ident(attrGet)operator(()constant(OCI_ATTR_DATA_TYPE)operator(\)) operator(}) - reserved(when) integer(8) operator(:) instance_variable(@stmt)operator(.)ident(defineByPos)operator(()ident(i)operator(,) constant(String)operator(,) integer(65535)operator(\)) comment(# Read LONG values) - reserved(when) integer(187) operator(:) instance_variable(@stmt)operator(.)ident(defineByPos)operator(()ident(i)operator(,) constant(OraDate)operator(\)) comment(# Read TIMESTAMP values) - reserved(when) integer(108) - reserved(if) instance_variable(@parms)operator([)ident(i) operator(-) integer(1)operator(])operator(.)ident(attrGet)operator(()constant(OCI_ATTR_TYPE_NAME)operator(\)) operator(==) string - instance_variable(@stmt)operator(.)ident(defineByPos)operator(()ident(i)operator(,) constant(String)operator(,) integer(65535)operator(\)) - reserved(else) - ident(raise) string - reserved(end) - reserved(else) ident(define_a_column_pre_ar) ident(i) - reserved(end) - reserved(end) - reserved(end) - - comment(# missing constant from oci8 < 0.1.14) - constant(OCI_PTYPE_UNK) operator(=) integer(0) reserved(unless) reserved(defined?)operator(()constant(OCI_PTYPE_UNK)operator(\)) - - comment(# Uses the describeAny OCI call to find the target owner and table_name) - comment(# indicated by +name+, parsing through synonynms as necessary. Returns) - comment(# an array of [owner, table_name].) - reserved(def) method(describe)operator(()ident(name)operator(\)) - instance_variable(@desc) operator(||=) class_variable(@@env)operator(.)ident(alloc)operator(()constant(OCIDescribe)operator(\)) - instance_variable(@desc)operator(.)ident(attrSet)operator(()constant(OCI_ATTR_DESC_PUBLIC)operator(,) integer(-1)operator(\)) reserved(if) constant(VERSION) operator(>)operator(=) string - instance_variable(@desc)operator(.)ident(describeAny)operator(()instance_variable(@svc)operator(,) ident(name)operator(.)ident(to_s)operator(,) constant(OCI_PTYPE_UNK)operator(\)) - ident(info) operator(=) instance_variable(@desc)operator(.)ident(attrGet)operator(()constant(OCI_ATTR_PARAM)operator(\)) - - reserved(case) ident(info)operator(.)ident(attrGet)operator(()constant(OCI_ATTR_PTYPE)operator(\)) - reserved(when) constant(OCI_PTYPE_TABLE)operator(,) constant(OCI_PTYPE_VIEW) - ident(owner) operator(=) ident(info)operator(.)ident(attrGet)operator(()constant(OCI_ATTR_OBJ_SCHEMA)operator(\)) - ident(table_name) operator(=) ident(info)operator(.)ident(attrGet)operator(()constant(OCI_ATTR_OBJ_NAME)operator(\)) - operator([)ident(owner)operator(,) ident(table_name)operator(]) - reserved(when) constant(OCI_PTYPE_SYN) - ident(schema) operator(=) ident(info)operator(.)ident(attrGet)operator(()constant(OCI_ATTR_SCHEMA_NAME)operator(\)) - ident(name) operator(=) ident(info)operator(.)ident(attrGet)operator(()constant(OCI_ATTR_NAME)operator(\)) - ident(describe)operator(()ident(schema) operator(+) string operator(+) ident(name)operator(\)) - reserved(end) - reserved(end) - - reserved(end) - - - comment(# The OracleConnectionFactory factors out the code necessary to connect and) - comment(# configure an Oracle/OCI connection.) - reserved(class) class(OracleConnectionFactory) comment(#:nodoc:) - reserved(def) method(new_connection)operator(()ident(username)operator(,) ident(password)operator(,) ident(database)operator(\)) - ident(conn) operator(=) constant(OCI8)operator(.)ident(new) ident(username)operator(,) ident(password)operator(,) ident(database) - ident(conn)operator(.)ident(exec) string - ident(conn)operator(.)ident(exec) string reserved(rescue) pre_constant(nil) - ident(conn)operator(.)ident(autocommit) operator(=) pre_constant(true) - ident(conn) - reserved(end) - reserved(end) - - - comment(# The OCI8AutoRecover class enhances the OCI8 driver with auto-recover and) - comment(# reset functionality. If a call to #exec fails, and autocommit is turned on) - comment(# (ie., we're not in the middle of a longer transaction\), it will ) - comment(# automatically reconnect and try again. If autocommit is turned off,) - comment(# this would be dangerous (as the earlier part of the implied transaction) - comment(# may have failed silently if the connection died\) -- so instead the ) - comment(# connection is marked as dead, to be reconnected on it's next use.) - reserved(class) class(OCI8AutoRecover) operator(<) ident(DelegateClass)operator(()constant(OCI8)operator(\)) comment(#:nodoc:) - ident(attr_accessor) symbol(:active) - reserved(alias) symbol(:active?) symbol(:active) - - ident(cattr_accessor) symbol(:auto_retry) - reserved(class) operator(<<) class(self) - reserved(alias) symbol(:auto_retry?) symbol(:auto_retry) - reserved(end) - class_variable(@@auto_retry) operator(=) pre_constant(false) - - reserved(def) method(initialize)operator(()ident(config)operator(,) ident(factory) operator(=) constant(OracleConnectionFactory)operator(.)ident(new)operator(\)) - instance_variable(@active) operator(=) pre_constant(true) - instance_variable(@username)operator(,) instance_variable(@password)operator(,) instance_variable(@database) operator(=) ident(config)operator([)symbol(:username)operator(])operator(,) ident(config)operator([)symbol(:password)operator(])operator(,) ident(config)operator([)symbol(:database)operator(]) - instance_variable(@factory) operator(=) ident(factory) - instance_variable(@connection) operator(=) instance_variable(@factory)operator(.)ident(new_connection) instance_variable(@username)operator(,) instance_variable(@password)operator(,) instance_variable(@database) - reserved(super) instance_variable(@connection) - reserved(end) - - comment(# Checks connection, returns true if active. Note that ping actively) - comment(# checks the connection, while #active? simply returns the last) - comment(# known state.) - reserved(def) method(ping) - instance_variable(@connection)operator(.)ident(exec)operator(()stringoperator(\)) operator({) operator(|)ident(r)operator(|) pre_constant(nil) operator(}) - instance_variable(@active) operator(=) pre_constant(true) - reserved(rescue) - instance_variable(@active) operator(=) pre_constant(false) - ident(raise) - reserved(end) - - comment(# Resets connection, by logging off and creating a new connection.) - reserved(def) method(reset!) - ident(logoff) reserved(rescue) pre_constant(nil) - reserved(begin) - instance_variable(@connection) operator(=) instance_variable(@factory)operator(.)ident(new_connection) instance_variable(@username)operator(,) instance_variable(@password)operator(,) instance_variable(@database) - ident(__setobj__) instance_variable(@connection) - instance_variable(@active) operator(=) pre_constant(true) - reserved(rescue) - instance_variable(@active) operator(=) pre_constant(false) - ident(raise) - reserved(end) - reserved(end) - - comment(# ORA-00028: your session has been killed) - comment(# ORA-01012: not logged on ) - comment(# ORA-03113: end-of-file on communication channel) - comment(# ORA-03114: not connected to ORACLE) - constant(LOST_CONNECTION_ERROR_CODES) operator(=) operator([) integer(28)operator(,) integer(1012)operator(,) integer(3113)operator(,) integer(3114) operator(]) - - comment(# Adds auto-recovery functionality.) - comment(#) - comment(# See: http://www.jiubao.org/ruby-oci8/api.en.html#label-11) - reserved(def) method(exec)operator(()ident(sql)operator(,) operator(*)ident(bindvars)operator(\)) - ident(should_retry) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(auto_retry?) operator(&&) ident(autocommit?) - - reserved(begin) - instance_variable(@connection)operator(.)ident(exec)operator(()ident(sql)operator(,) operator(*)ident(bindvars)operator(\)) - reserved(rescue) constant(OCIException) operator(=)operator(>) ident(e) - ident(raise) reserved(unless) constant(LOST_CONNECTION_ERROR_CODES)operator(.)ident(include?)operator(()ident(e)operator(.)ident(code)operator(\)) - instance_variable(@active) operator(=) pre_constant(false) - ident(raise) reserved(unless) ident(should_retry) - ident(should_retry) operator(=) pre_constant(false) - ident(reset!) reserved(rescue) pre_constant(nil) - reserved(retry) - reserved(end) - reserved(end) - - reserved(end) - -reserved(rescue) constant(LoadError) - comment(# OCI8 driver is unavailable.) - reserved(module) class(ActiveRecord) comment(# :nodoc:) - reserved(class) class(Base) - reserved(def) pre_constant(self)operator(.)method(oracle_connection)operator(()ident(config)operator(\)) comment(# :nodoc:) - comment(# Set up a reasonable error message) - ident(raise) constant(LoadError)operator(,) string - reserved(end) - reserved(def) pre_constant(self)operator(.)method(oci_connection)operator(()ident(config)operator(\)) comment(# :nodoc:) - comment(# Set up a reasonable error message) - ident(raise) constant(LoadError)operator(,) string - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(class) class(Base) - comment(# Establishes a connection to the database that's used by all Active Record objects) - reserved(def) pre_constant(self)operator(.)method(postgresql_connection)operator(()ident(config)operator(\)) comment(# :nodoc:) - ident(require_library_or_gem) string reserved(unless) pre_constant(self)operator(.)ident(class)operator(.)ident(const_defined?)operator(()symbol(:PGconn)operator(\)) - - ident(config) operator(=) ident(config)operator(.)ident(symbolize_keys) - ident(host) operator(=) ident(config)operator([)symbol(:host)operator(]) - ident(port) operator(=) ident(config)operator([)symbol(:port)operator(]) operator(||) integer(5432) reserved(unless) ident(host)operator(.)ident(nil?) - ident(username) operator(=) ident(config)operator([)symbol(:username)operator(])operator(.)ident(to_s) - ident(password) operator(=) ident(config)operator([)symbol(:password)operator(])operator(.)ident(to_s) - - ident(min_messages) operator(=) ident(config)operator([)symbol(:min_messages)operator(]) - - reserved(if) ident(config)operator(.)ident(has_key?)operator(()symbol(:database)operator(\)) - ident(database) operator(=) ident(config)operator([)symbol(:database)operator(]) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - ident(pga) operator(=) constant(ConnectionAdapters)operator(::)constant(PostgreSQLAdapter)operator(.)ident(new)operator(() - constant(PGconn)operator(.)ident(connect)operator(()ident(host)operator(,) ident(port)operator(,) stringoperator(,) stringoperator(,) ident(database)operator(,) ident(username)operator(,) ident(password)operator(\))operator(,) ident(logger)operator(,) ident(config) - operator(\)) - - constant(PGconn)operator(.)ident(translate_results) operator(=) pre_constant(false) reserved(if) constant(PGconn)operator(.)ident(respond_to?) symbol(:translate_results=) - - ident(pga)operator(.)ident(schema_search_path) operator(=) ident(config)operator([)symbol(:schema_search_path)operator(]) operator(||) ident(config)operator([)symbol(:schema_order)operator(]) - - ident(pga) - reserved(end) - reserved(end) - - reserved(module) class(ConnectionAdapters) - comment(# The PostgreSQL adapter works both with the C-based (http://www.postgresql.jp/interfaces/ruby/\) and the Ruby-base) - comment(# (available both as gem and from http://rubyforge.org/frs/?group_id=234&release_id=1145\) drivers.) - comment(#) - comment(# Options:) - comment(#) - comment(# * :host -- Defaults to localhost) - comment(# * :port -- Defaults to 5432) - comment(# * :username -- Defaults to nothing) - comment(# * :password -- Defaults to nothing) - comment(# * :database -- The name of the database. No default, must be provided.) - comment(# * :schema_search_path -- An optional schema search path for the connection given as a string of comma-separated schema names. This is backward-compatible with the :schema_order option.) - comment(# * :encoding -- An optional client encoding that is using in a SET client_encoding TO call on connection.) - comment(# * :min_messages -- An optional client min messages that is using in a SET client_min_messages TO call on connection.) - reserved(class) class(PostgreSQLAdapter) operator(<) constant(AbstractAdapter) - reserved(def) method(adapter_name) - string - reserved(end) - - reserved(def) method(initialize)operator(()ident(connection)operator(,) ident(logger)operator(,) ident(config) operator(=) operator({)operator(})operator(\)) - reserved(super)operator(()ident(connection)operator(,) ident(logger)operator(\)) - instance_variable(@config) operator(=) ident(config) - ident(configure_connection) - reserved(end) - - comment(# Is this connection alive and ready for queries?) - reserved(def) method(active?) - reserved(if) instance_variable(@connection)operator(.)ident(respond_to?)operator(()symbol(:status)operator(\)) - instance_variable(@connection)operator(.)ident(status) operator(==) constant(PGconn)operator(::)constant(CONNECTION_OK) - reserved(else) - instance_variable(@connection)operator(.)ident(query) string - pre_constant(true) - reserved(end) - comment(# postgres-pr raises a NoMethodError when querying if no conn is available) - reserved(rescue) constant(PGError)operator(,) constant(NoMethodError) - pre_constant(false) - reserved(end) - - comment(# Close then reopen the connection.) - reserved(def) method(reconnect!) - comment(# TODO: postgres-pr doesn't have PGconn#reset.) - reserved(if) instance_variable(@connection)operator(.)ident(respond_to?)operator(()symbol(:reset)operator(\)) - instance_variable(@connection)operator(.)ident(reset) - ident(configure_connection) - reserved(end) - reserved(end) - - reserved(def) method(disconnect!) - comment(# Both postgres and postgres-pr respond to :close) - instance_variable(@connection)operator(.)ident(close) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(native_database_types) - operator({) - symbol(:primary_key) operator(=)operator(>) stringoperator(,) - symbol(:string) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(255) operator(})operator(,) - symbol(:text) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:integer) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:float) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:datetime) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:timestamp) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:time) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:date) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:binary) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:boolean) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(}) - operator(}) - reserved(end) - - reserved(def) method(supports_migrations?) - pre_constant(true) - reserved(end) - - reserved(def) method(table_alias_length) - integer(63) - reserved(end) - - comment(# QUOTING ==================================================) - - reserved(def) method(quote)operator(()ident(value)operator(,) ident(column) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(value)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) operator(&&) ident(column) operator(&&) ident(column)operator(.)ident(type) operator(==) symbol(:binary) - stringcontent(')delimiter(")> - reserved(else) - reserved(super) - reserved(end) - reserved(end) - - reserved(def) method(quote_column_name)operator(()ident(name)operator(\)) - stringcontent(")delimiter(\))> - reserved(end) - - - comment(# DATABASE STATEMENTS ======================================) - - reserved(def) method(select_all)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - - reserved(def) method(select_one)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(result) operator(=) ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(result)operator(.)ident(first) reserved(if) ident(result) - reserved(end) - - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(,) ident(sequence_name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(table) operator(=) ident(sql)operator(.)ident(split)operator(()stringoperator(,) integer(4)operator(\))operator([)integer(2)operator(]) - ident(id_value) operator(||) ident(last_insert_id)operator(()ident(table)operator(,) ident(sequence_name) operator(||) ident(default_sequence_name)operator(()ident(table)operator(,) ident(pk)operator(\))operator(\)) - reserved(end) - - reserved(def) method(query)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) operator({) instance_variable(@connection)operator(.)ident(query)operator(()ident(sql)operator(\)) operator(}) - reserved(end) - - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) operator({) instance_variable(@connection)operator(.)ident(exec)operator(()ident(sql)operator(\)) operator(}) - reserved(end) - - reserved(def) method(update)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\))operator(.)ident(cmdtuples) - reserved(end) - - ident(alias_method) symbol(:delete)operator(,) symbol(:update) comment(#:nodoc:) - - - reserved(def) method(begin_db_transaction) comment(#:nodoc:) - ident(execute) string - reserved(end) - - reserved(def) method(commit_db_transaction) comment(#:nodoc:) - ident(execute) string - reserved(end) - - reserved(def) method(rollback_db_transaction) comment(#:nodoc:) - ident(execute) string - reserved(end) - - - comment(# SCHEMA STATEMENTS ========================================) - - comment(# Return the list of all tables in the schema search path.) - reserved(def) method(tables)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(schemas) operator(=) ident(schema_search_path)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(map) operator({) operator(|)ident(p)operator(|) ident(quote)operator(()ident(p)operator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - ident(query)operator(()stringoperator(,) ident(name)operator(\))operator(.)ident(map) operator({) operator(|)ident(row)operator(|) ident(row)operator([)integer(0)operator(]) operator(})stringcontent(\))delimiter( - SQL)> - reserved(end) - - reserved(def) method(indexes)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(result) operator(=) ident(query)operator(()stringoperator(,) ident(name)operator(\))string - - ident(current_index) operator(=) pre_constant(nil) - ident(indexes) operator(=) operator([)operator(]) - - ident(result)operator(.)ident(each) reserved(do) operator(|)ident(row)operator(|) - reserved(if) ident(current_index) operator(!=) ident(row)operator([)integer(0)operator(]) - ident(indexes) operator(<<) constant(IndexDefinition)operator(.)ident(new)operator(()ident(table_name)operator(,) ident(row)operator([)integer(0)operator(])operator(,) ident(row)operator([)integer(1)operator(]) operator(==) stringoperator(,) operator([)operator(])operator(\)) - ident(current_index) operator(=) ident(row)operator([)integer(0)operator(]) - reserved(end) - - ident(indexes)operator(.)ident(last)operator(.)ident(columns) operator(<<) ident(row)operator([)integer(2)operator(]) - reserved(end) - - ident(indexes) - reserved(end) - - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(column_definitions)operator(()ident(table_name)operator(\))operator(.)ident(collect) reserved(do) operator(|)ident(name)operator(,) ident(type)operator(,) ident(default)operator(,) ident(notnull)operator(|) - constant(Column)operator(.)ident(new)operator(()ident(name)operator(,) ident(default_value)operator(()ident(default)operator(\))operator(,) ident(translate_field_type)operator(()ident(type)operator(\))operator(,) - ident(notnull) operator(==) stringoperator(\)) - reserved(end) - reserved(end) - - comment(# Set the schema search path to a string of comma-separated schema names.) - comment(# Names beginning with $ are quoted (e.g. $user => '$user'\)) - comment(# See http://www.postgresql.org/docs/8.0/interactive/ddl-schemas.html) - reserved(def) method(schema_search_path=)operator(()ident(schema_csv)operator(\)) comment(#:nodoc:) - reserved(if) ident(schema_csv) - ident(execute) stringdelimiter(")> - instance_variable(@schema_search_path) operator(=) pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(schema_search_path) comment(#:nodoc:) - instance_variable(@schema_search_path) operator(||=) ident(query)operator(()stringoperator(\))operator([)integer(0)operator(])operator([)integer(0)operator(]) - reserved(end) - - reserved(def) method(default_sequence_name)operator(()ident(table_name)operator(,) ident(pk) operator(=) pre_constant(nil)operator(\)) - ident(default_pk)operator(,) ident(default_seq) operator(=) ident(pk_and_sequence_for)operator(()ident(table_name)operator(\)) - ident(default_seq) operator(||) stringcontent(_)inlineinline_delimiter(})>content(_seq)delimiter(")> - reserved(end) - - comment(# Resets sequence to the max value of the table's pk if present.) - reserved(def) method(reset_pk_sequence!)operator(()ident(table)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(sequence) operator(=) pre_constant(nil)operator(\)) - reserved(unless) ident(pk) reserved(and) ident(sequence) - ident(default_pk)operator(,) ident(default_sequence) operator(=) ident(pk_and_sequence_for)operator(()ident(table)operator(\)) - ident(pk) operator(||=) ident(default_pk) - ident(sequence) operator(||=) ident(default_sequence) - reserved(end) - reserved(if) ident(pk) - reserved(if) ident(sequence) - ident(select_value) stringoperator(,) stringstringcontent(', (SELECT COALESCE(MAX()inlinecontent(\)+(SELECT increment_by FROM )inlinecontent(\), (SELECT min_value FROM )inlinecontent(\)\) FROM )inlinecontent(\), false\))delimiter( - end_sql)> - reserved(else) - instance_variable(@logger)operator(.)ident(warn) stringcontent( has primary key )inlinecontent( with no default sequence)delimiter(")> reserved(if) instance_variable(@logger) - reserved(end) - reserved(end) - reserved(end) - - comment(# Find a table's primary key and sequence.) - reserved(def) method(pk_and_sequence_for)operator(()ident(table)operator(\)) - comment(# First try looking for a sequence with a dependency on the) - comment(# given table's primary key.) - ident(result) operator(=) ident(execute)operator(()stringoperator(,) stringoperator(\))operator([)integer(0)operator(])string - - reserved(if) ident(result)operator(.)ident(nil?) reserved(or) ident(result)operator(.)ident(empty?) - comment(# If that fails, try parsing the primary key's default value.) - comment(# Support the 7.x and 8.0 nextval('foo'::text\) as well as) - comment(# the 8.1+ nextval('foo'::regclass\).) - comment(# TODO: assumes sequence is in same schema as table.) - ident(result) operator(=) ident(execute)operator(()stringoperator(,) stringoperator(\))operator([)integer(0)operator(])string - reserved(end) - comment(# check for existence of . in sequence name as in public.foo_sequence. if it does not exist, join the current namespace) - ident(result)operator(.)ident(last)operator([)stringoperator(]) operator(?) operator([)ident(result)operator(.)ident(first)operator(,) ident(result)operator(.)ident(last)operator(]) operator(:) operator([)ident(result)operator(.)ident(first)operator(,) stringcontent(.)inlinedelimiter(")>operator(]) - reserved(rescue) - pre_constant(nil) - reserved(end) - - reserved(def) method(rename_table)operator(()ident(name)operator(,) ident(new_name)operator(\)) - ident(execute) stringcontent( RENAME TO )inlinedelimiter(")> - reserved(end) - - reserved(def) method(add_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(execute)operator(()stringcontent( ADD )inlinecontent( )inlinedelimiter(")>operator(\)) - ident(execute)operator(()stringcontent( ALTER )inlinecontent( SET NOT NULL)delimiter(")>operator(\)) reserved(if) ident(options)operator([)symbol(:null)operator(]) operator(==) pre_constant(false) - ident(change_column_default)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(options)operator([)symbol(:default)operator(])operator(\)) reserved(unless) ident(options)operator([)symbol(:default)operator(])operator(.)ident(nil?) - reserved(end) - - reserved(def) method(change_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - reserved(begin) - ident(execute) stringcontent( ALTER )inlinecontent( TYPE )inlinedelimiter(")> - reserved(rescue) constant(ActiveRecord)operator(::)constant(StatementInvalid) - comment(# This is PG7, so we use a more arcane way of doing it.) - ident(begin_db_transaction) - ident(add_column)operator(()ident(table_name)operator(,) stringcontent(_ar_tmp)delimiter(")>operator(,) ident(type)operator(,) ident(options)operator(\)) - ident(execute) stringcontent( SET )inlinecontent(_ar_tmp = CAST()inlinecontent( AS )inlinecontent(\))delimiter(")> - ident(remove_column)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) - ident(rename_column)operator(()ident(table_name)operator(,) stringcontent(_ar_tmp)delimiter(")>operator(,) ident(column_name)operator(\)) - ident(commit_db_transaction) - reserved(end) - ident(change_column_default)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(options)operator([)symbol(:default)operator(])operator(\)) reserved(unless) ident(options)operator([)symbol(:default)operator(])operator(.)ident(nil?) - reserved(end) - - reserved(def) method(change_column_default)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(default)operator(\)) comment(#:nodoc:) - ident(execute) stringcontent( ALTER COLUMN )inlinecontent( SET DEFAULT ')inlinecontent(')delimiter(")> - reserved(end) - - reserved(def) method(rename_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(new_column_name)operator(\)) comment(#:nodoc:) - ident(execute) stringcontent( RENAME COLUMN )inlinecontent( TO )inlinedelimiter(")> - reserved(end) - - reserved(def) method(remove_index)operator(()ident(table_name)operator(,) ident(options)operator(\)) comment(#:nodoc:) - ident(execute) stringdelimiter(")> - reserved(end) - - ident(private) - constant(BYTEA_COLUMN_TYPE_OID) operator(=) integer(17) - constant(TIMESTAMPOID) operator(=) integer(1114) - constant(TIMESTAMPTZOID) operator(=) integer(1184) - - reserved(def) method(configure_connection) - reserved(if) instance_variable(@config)operator([)symbol(:encoding)operator(]) - ident(execute)operator(()stringcontent(')delimiter(")>operator(\)) - reserved(end) - reserved(if) instance_variable(@config)operator([)symbol(:min_messages)operator(]) - ident(execute)operator(()stringcontent(')delimiter(")>operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(last_insert_id)operator(()ident(table)operator(,) ident(sequence_name)operator(\)) - ident(Integer)operator(()ident(select_value)operator(()stringcontent('\))delimiter(")>operator(\))operator(\)) - reserved(end) - - reserved(def) method(select)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(res) operator(=) ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(results) operator(=) ident(res)operator(.)ident(result) - ident(rows) operator(=) operator([)operator(]) - reserved(if) ident(results)operator(.)ident(length) operator(>) integer(0) - ident(fields) operator(=) ident(res)operator(.)ident(fields) - ident(results)operator(.)ident(each) reserved(do) operator(|)ident(row)operator(|) - ident(hashed_row) operator(=) operator({)operator(}) - ident(row)operator(.)ident(each_index) reserved(do) operator(|)ident(cel_index)operator(|) - ident(column) operator(=) ident(row)operator([)ident(cel_index)operator(]) - - reserved(case) ident(res)operator(.)ident(type)operator(()ident(cel_index)operator(\)) - reserved(when) constant(BYTEA_COLUMN_TYPE_OID) - ident(column) operator(=) ident(unescape_bytea)operator(()ident(column)operator(\)) - reserved(when) constant(TIMESTAMPTZOID)operator(,) constant(TIMESTAMPOID) - ident(column) operator(=) ident(cast_to_time)operator(()ident(column)operator(\)) - reserved(end) - - ident(hashed_row)operator([)ident(fields)operator([)ident(cel_index)operator(])operator(]) operator(=) ident(column) - reserved(end) - ident(rows) operator(<<) ident(hashed_row) - reserved(end) - reserved(end) - reserved(return) ident(rows) - reserved(end) - - reserved(def) method(escape_bytea)operator(()ident(s)operator(\)) - reserved(if) constant(PGconn)operator(.)ident(respond_to?) symbol(:escape_bytea) - pre_constant(self)operator(.)ident(class)operator(.)ident(send)operator(()symbol(:define_method)operator(,) symbol(:escape_bytea)operator(\)) reserved(do) operator(|)ident(s)operator(|) - constant(PGconn)operator(.)ident(escape_bytea)operator(()ident(s)operator(\)) reserved(if) ident(s) - reserved(end) - reserved(else) - pre_constant(self)operator(.)ident(class)operator(.)ident(send)operator(()symbol(:define_method)operator(,) symbol(:escape_bytea)operator(\)) reserved(do) operator(|)ident(s)operator(|) - reserved(if) ident(s) - ident(result) operator(=) string - ident(s)operator(.)ident(each_byte) operator({) operator(|)ident(c)operator(|) ident(result) operator(<<) ident(sprintf)operator(()stringoperator(,) ident(c)operator(\)) operator(}) - ident(result) - reserved(end) - reserved(end) - reserved(end) - ident(escape_bytea)operator(()ident(s)operator(\)) - reserved(end) - - reserved(def) method(unescape_bytea)operator(()ident(s)operator(\)) - reserved(if) constant(PGconn)operator(.)ident(respond_to?) symbol(:unescape_bytea) - pre_constant(self)operator(.)ident(class)operator(.)ident(send)operator(()symbol(:define_method)operator(,) symbol(:unescape_bytea)operator(\)) reserved(do) operator(|)ident(s)operator(|) - constant(PGconn)operator(.)ident(unescape_bytea)operator(()ident(s)operator(\)) reserved(if) ident(s) - reserved(end) - reserved(else) - pre_constant(self)operator(.)ident(class)operator(.)ident(send)operator(()symbol(:define_method)operator(,) symbol(:unescape_bytea)operator(\)) reserved(do) operator(|)ident(s)operator(|) - reserved(if) ident(s) - ident(result) operator(=) string - ident(i)operator(,) ident(max) operator(=) integer(0)operator(,) ident(s)operator(.)ident(size) - reserved(while) ident(i) operator(<) ident(max) - ident(char) operator(=) ident(s)operator([)ident(i)operator(]) - reserved(if) ident(char) operator(==) integer(?\\\\) - reserved(if) ident(s)operator([)ident(i)operator(+)integer(1)operator(]) operator(==) integer(?\\\\) - ident(char) operator(=) integer(?\\\\) - ident(i) operator(+=) integer(1) - reserved(else) - ident(char) operator(=) ident(s)operator([)ident(i)operator(+)integer(1)operator(..)ident(i)operator(+)integer(3)operator(])operator(.)ident(oct) - ident(i) operator(+=) integer(3) - reserved(end) - reserved(end) - ident(result) operator(<<) ident(char) - ident(i) operator(+=) integer(1) - reserved(end) - ident(result) - reserved(end) - reserved(end) - reserved(end) - ident(unescape_bytea)operator(()ident(s)operator(\)) - reserved(end) - - comment(# Query a table's column names, default values, and types.) - comment(#) - comment(# The underlying query is roughly:) - comment(# SELECT column.name, column.type, default.value) - comment(# FROM column LEFT JOIN default) - comment(# ON column.table_id = default.table_id) - comment(# AND column.num = default.column_num) - comment(# WHERE column.table_id = get_table_id('table_name'\)) - comment(# AND column.num > 0) - comment(# AND NOT column.is_dropped) - comment(# ORDER BY column.num) - comment(#) - comment(# If the table name is not prefixed with a schema, the database will) - comment(# take the first match from the schema search path.) - comment(#) - comment(# Query implementation notes:) - comment(# - format_type includes the column size constraint, e.g. varchar(50\)) - comment(# - ::regclass is a function that gives the id for a table name) - reserved(def) method(column_definitions)operator(()ident(table_name)operator(\)) - ident(query) stringstring 0 AND NOT a.attisdropped - ORDER BY a.attnum)delimiter( - end_sql)> - reserved(end) - - comment(# Translate PostgreSQL-specific types into simplified SQL types.) - comment(# These are special cases; standard types are handled by) - comment(# ConnectionAdapters::Column#simplified_type.) - reserved(def) method(translate_field_type)operator(()ident(field_type)operator(\)) - comment(# Match the beginning of field_type since it may have a size constraint on the end.) - reserved(case) ident(field_type) - reserved(when) regexp reserved(then) string - reserved(when) regexp reserved(then) string - reserved(when) regexp reserved(then) string - comment(# geometric types (the line type is currently not implemented in postgresql\)) - reserved(when) regexp reserved(then) string - reserved(when) regexp reserved(then) string - reserved(else) ident(field_type) comment(# Pass through standard types.) - reserved(end) - reserved(end) - - reserved(def) method(default_value)operator(()ident(value)operator(\)) - comment(# Boolean types) - reserved(return) string reserved(if) ident(value) operator(=)operator(~) regexp - reserved(return) string reserved(if) ident(value) operator(=)operator(~) regexp - - comment(# Char/String/Bytea type values) - reserved(return) global_variable($1) reserved(if) ident(value) operator(=)operator(~) regexp - - comment(# Numeric values) - reserved(return) ident(value) reserved(if) ident(value) operator(=)operator(~) regexp - - comment(# Fixed dates / times) - reserved(return) global_variable($1) reserved(if) ident(value) operator(=)operator(~) regexp - - comment(# Anything else is blank, some user type, or some function) - comment(# and we can't know the value of that, so return nil.) - reserved(return) pre_constant(nil) - reserved(end) - - comment(# Only needed for DateTime instances) - reserved(def) method(cast_to_time)operator(()ident(value)operator(\)) - reserved(return) ident(value) reserved(unless) ident(value)operator(.)ident(class) operator(==) constant(DateTime) - ident(v) operator(=) ident(value) - ident(time_array) operator(=) operator([)ident(v)operator(.)ident(year)operator(,) ident(v)operator(.)ident(month)operator(,) ident(v)operator(.)ident(day)operator(,) ident(v)operator(.)ident(hour)operator(,) ident(v)operator(.)ident(min)operator(,) ident(v)operator(.)ident(sec)operator(]) - constant(Time)operator(.)ident(send)operator(()constant(Base)operator(.)ident(default_timezone)operator(,) operator(*)ident(time_array)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -comment(# Author: Luke Holden ) -comment(# Updated for SQLite3: Jamis Buck ) - -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(class) class(Base) - reserved(class) operator(<<) class(self) - comment(# sqlite3 adapter reuses sqlite_connection.) - reserved(def) method(sqlite3_connection)operator(()ident(config)operator(\)) comment(# :nodoc:) - ident(parse_config!)operator(()ident(config)operator(\)) - - reserved(unless) pre_constant(self)operator(.)ident(class)operator(.)ident(const_defined?)operator(()symbol(:SQLite3)operator(\)) - ident(require_library_or_gem)operator(()ident(config)operator([)symbol(:adapter)operator(])operator(\)) - reserved(end) - - ident(db) operator(=) constant(SQLite3)operator(::)constant(Database)operator(.)ident(new)operator(() - ident(config)operator([)symbol(:database)operator(])operator(,) - symbol(:results_as_hash) operator(=)operator(>) pre_constant(true)operator(,) - symbol(:type_translation) operator(=)operator(>) pre_constant(false) - operator(\)) - constant(ConnectionAdapters)operator(::)constant(SQLiteAdapter)operator(.)ident(new)operator(()ident(db)operator(,) ident(logger)operator(\)) - reserved(end) - - comment(# Establishes a connection to the database that's used by all Active Record objects) - reserved(def) method(sqlite_connection)operator(()ident(config)operator(\)) comment(# :nodoc:) - ident(parse_config!)operator(()ident(config)operator(\)) - - reserved(unless) pre_constant(self)operator(.)ident(class)operator(.)ident(const_defined?)operator(()symbol(:SQLite)operator(\)) - ident(require_library_or_gem)operator(()ident(config)operator([)symbol(:adapter)operator(])operator(\)) - - ident(db) operator(=) constant(SQLite)operator(::)constant(Database)operator(.)ident(new)operator(()ident(config)operator([)symbol(:database)operator(])operator(,) integer(0)operator(\)) - ident(db)operator(.)ident(show_datatypes) operator(=) string reserved(if) operator(!)reserved(defined?) constant(SQLite)operator(::)constant(Version) - ident(db)operator(.)ident(results_as_hash) operator(=) pre_constant(true) reserved(if) reserved(defined?) constant(SQLite)operator(::)constant(Version) - ident(db)operator(.)ident(type_translation) operator(=) pre_constant(false) - - comment(# "Downgrade" deprecated sqlite API) - reserved(if) constant(SQLite)operator(.)ident(const_defined?)operator(()symbol(:Version)operator(\)) - constant(ConnectionAdapters)operator(::)constant(SQLite2Adapter)operator(.)ident(new)operator(()ident(db)operator(,) ident(logger)operator(\)) - reserved(else) - constant(ConnectionAdapters)operator(::)constant(DeprecatedSQLiteAdapter)operator(.)ident(new)operator(()ident(db)operator(,) ident(logger)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(parse_config!)operator(()ident(config)operator(\)) - ident(config)operator([)symbol(:database)operator(]) operator(||=) ident(config)operator([)symbol(:dbfile)operator(]) - comment(# Require database.) - reserved(unless) ident(config)operator([)symbol(:database)operator(]) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - comment(# Allow database path relative to RAILS_ROOT, but only if) - comment(# the database path is not the special path that tells) - comment(# Sqlite build a database only in memory.) - reserved(if) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:RAILS_ROOT)operator(\)) operator(&&) string operator(!=) ident(config)operator([)symbol(:database)operator(]) - ident(config)operator([)symbol(:database)operator(]) operator(=) constant(File)operator(.)ident(expand_path)operator(()ident(config)operator([)symbol(:database)operator(])operator(,) constant(RAILS_ROOT)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(module) class(ConnectionAdapters) comment(#:nodoc:) - reserved(class) class(SQLiteColumn) operator(<) constant(Column) comment(#:nodoc:) - reserved(class) operator(<<) class(self) - reserved(def) method(string_to_binary)operator(()ident(value)operator(\)) - ident(value)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) operator(|)ident(b)operator(|) - reserved(case) ident(b) - reserved(when) string reserved(then) string - reserved(when) string reserved(then) string - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(binary_to_string)operator(()ident(value)operator(\)) - ident(value)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) operator(|)ident(b)operator(|) - reserved(case) ident(b) - reserved(when) string reserved(then) string - reserved(when) string reserved(then) string - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# The SQLite adapter works with both the 2.x and 3.x series of SQLite with the sqlite-ruby drivers (available both as gems and) - comment(# from http://rubyforge.org/projects/sqlite-ruby/\).) - comment(#) - comment(# Options:) - comment(#) - comment(# * :database -- Path to the database file.) - reserved(class) class(SQLiteAdapter) operator(<) constant(AbstractAdapter) - reserved(def) method(adapter_name) comment(#:nodoc:) - string - reserved(end) - - reserved(def) method(supports_migrations?) comment(#:nodoc:) - pre_constant(true) - reserved(end) - - reserved(def) method(supports_count_distinct?) comment(#:nodoc:) - pre_constant(false) - reserved(end) - - reserved(def) method(native_database_types) comment(#:nodoc:) - operator({) - symbol(:primary_key) operator(=)operator(>) stringoperator(,) - symbol(:string) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(255) operator(})operator(,) - symbol(:text) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:integer) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:float) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:datetime) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:timestamp) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:time) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:date) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:binary) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:boolean) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(}) - operator(}) - reserved(end) - - - comment(# QUOTING ==================================================) - - reserved(def) method(quote_string)operator(()ident(s)operator(\)) comment(#:nodoc:) - instance_variable(@connection)operator(.)ident(class)operator(.)ident(quote)operator(()ident(s)operator(\)) - reserved(end) - - reserved(def) method(quote_column_name)operator(()ident(name)operator(\)) comment(#:nodoc:) - stringcontent(")delimiter(\))> - reserved(end) - - - comment(# DATABASE STATEMENTS ======================================) - - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(catch_schema_changes) operator({) ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) operator({) instance_variable(@connection)operator(.)ident(execute)operator(()ident(sql)operator(\)) operator(}) operator(}) - reserved(end) - - reserved(def) method(update)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - instance_variable(@connection)operator(.)ident(changes) - reserved(end) - - reserved(def) method(delete)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(sql) operator(+=) string reserved(unless) ident(sql) operator(=)operator(~) regexp - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - instance_variable(@connection)operator(.)ident(changes) - reserved(end) - - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(,) ident(sequence_name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(id_value) operator(||) instance_variable(@connection)operator(.)ident(last_insert_row_id) - reserved(end) - - reserved(def) method(select_all)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\))operator(.)ident(map) reserved(do) operator(|)ident(row)operator(|) - ident(record) operator(=) operator({)operator(}) - ident(row)operator(.)ident(each_key) reserved(do) operator(|)ident(key)operator(|) - reserved(if) ident(key)operator(.)ident(is_a?)operator(()constant(String)operator(\)) - ident(record)operator([)ident(key)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\))operator(]) operator(=) ident(row)operator([)ident(key)operator(]) - reserved(end) - reserved(end) - ident(record) - reserved(end) - reserved(end) - - reserved(def) method(select_one)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(result) operator(=) ident(select_all)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(result)operator(.)ident(nil?) operator(?) pre_constant(nil) operator(:) ident(result)operator(.)ident(first) - reserved(end) - - - reserved(def) method(begin_db_transaction) comment(#:nodoc:) - ident(catch_schema_changes) operator({) instance_variable(@connection)operator(.)ident(transaction) operator(}) - reserved(end) - - reserved(def) method(commit_db_transaction) comment(#:nodoc:) - ident(catch_schema_changes) operator({) instance_variable(@connection)operator(.)ident(commit) operator(}) - reserved(end) - - reserved(def) method(rollback_db_transaction) comment(#:nodoc:) - ident(catch_schema_changes) operator({) instance_variable(@connection)operator(.)ident(rollback) operator(}) - reserved(end) - - - comment(# SCHEMA STATEMENTS ========================================) - - reserved(def) method(tables)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(execute)operator(()stringoperator(,) ident(name)operator(\))operator(.)ident(map) reserved(do) operator(|)ident(row)operator(|) - ident(row)operator([)integer(0)operator(]) - reserved(end) - reserved(end) - - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(table_structure)operator(()ident(table_name)operator(\))operator(.)ident(map) reserved(do) operator(|)ident(field)operator(|) - constant(SQLiteColumn)operator(.)ident(new)operator(()ident(field)operator([)stringoperator(])operator(,) ident(field)operator([)stringoperator(])operator(,) ident(field)operator([)stringoperator(])operator(,) ident(field)operator([)stringoperator(]) operator(==) stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(indexes)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(execute)operator(()stringcontent(\))delimiter(")>operator(,) ident(name)operator(\))operator(.)ident(map) reserved(do) operator(|)ident(row)operator(|) - ident(index) operator(=) constant(IndexDefinition)operator(.)ident(new)operator(()ident(table_name)operator(,) ident(row)operator([)stringoperator(])operator(\)) - ident(index)operator(.)ident(unique) operator(=) ident(row)operator([)stringoperator(]) operator(!=) string - ident(index)operator(.)ident(columns) operator(=) ident(execute)operator(()stringcontent('\))delimiter(")>operator(\))operator(.)ident(map) operator({) operator(|)ident(col)operator(|) ident(col)operator([)stringoperator(]) operator(}) - ident(index) - reserved(end) - reserved(end) - - reserved(def) method(primary_key)operator(()ident(table_name)operator(\)) comment(#:nodoc:) - ident(column) operator(=) ident(table_structure)operator(()ident(table_name)operator(\))operator(.)ident(find) operator({)operator(|)ident(field)operator(|) ident(field)operator([)stringoperator(])operator(.)ident(to_i) operator(==) integer(1)operator(}) - ident(column) operator(?) ident(column)operator([)stringoperator(]) operator(:) pre_constant(nil) - reserved(end) - - reserved(def) method(remove_index)operator(()ident(table_name)operator(,) ident(options)operator(=)operator({)operator(})operator(\)) comment(#:nodoc:) - ident(execute) stringdelimiter(")> - reserved(end) - - reserved(def) method(rename_table)operator(()ident(name)operator(,) ident(new_name)operator(\)) - ident(move_table)operator(()ident(name)operator(,) ident(new_name)operator(\)) - reserved(end) - - reserved(def) method(add_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(alter_table)operator(()ident(table_name)operator(\)) reserved(do) operator(|)ident(definition)operator(|) - ident(definition)operator(.)ident(column)operator(()ident(column_name)operator(,) ident(type)operator(,) ident(options)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(remove_column)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) comment(#:nodoc:) - ident(alter_table)operator(()ident(table_name)operator(\)) reserved(do) operator(|)ident(definition)operator(|) - ident(definition)operator(.)ident(columns)operator(.)ident(delete)operator(()ident(definition)operator([)ident(column_name)operator(])operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(change_column_default)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(default)operator(\)) comment(#:nodoc:) - ident(alter_table)operator(()ident(table_name)operator(\)) reserved(do) operator(|)ident(definition)operator(|) - ident(definition)operator([)ident(column_name)operator(])operator(.)ident(default) operator(=) ident(default) - reserved(end) - reserved(end) - - reserved(def) method(change_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(alter_table)operator(()ident(table_name)operator(\)) reserved(do) operator(|)ident(definition)operator(|) - ident(definition)operator([)ident(column_name)operator(])operator(.)ident(instance_eval) reserved(do) - pre_constant(self)operator(.)ident(type) operator(=) ident(type) - pre_constant(self)operator(.)ident(limit) operator(=) ident(options)operator([)symbol(:limit)operator(]) reserved(if) ident(options)operator([)symbol(:limit)operator(]) - pre_constant(self)operator(.)ident(default) operator(=) ident(options)operator([)symbol(:default)operator(]) reserved(if) ident(options)operator([)symbol(:default)operator(]) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(rename_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(new_column_name)operator(\)) comment(#:nodoc:) - ident(alter_table)operator(()ident(table_name)operator(,) symbol(:rename) operator(=)operator(>) operator({)ident(column_name) operator(=)operator(>) ident(new_column_name)operator(})operator(\)) - reserved(end) - - - ident(protected) - reserved(def) method(table_structure)operator(()ident(table_name)operator(\)) - ident(returning) ident(structure) operator(=) ident(execute)operator(()stringcontent(\))delimiter(")>operator(\)) reserved(do) - ident(raise) constant(ActiveRecord)operator(::)constant(StatementInvalid) reserved(if) ident(structure)operator(.)ident(empty?) - reserved(end) - reserved(end) - - reserved(def) method(alter_table)operator(()ident(table_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(altered_table_name) operator(=) stringdelimiter(")> - ident(caller) operator(=) ident(lambda) operator({)operator(|)ident(definition)operator(|) reserved(yield) ident(definition) reserved(if) ident(block_given?)operator(}) - - ident(transaction) reserved(do) - ident(move_table)operator(()ident(table_name)operator(,) ident(altered_table_name)operator(,) - ident(options)operator(.)ident(merge)operator(()symbol(:temporary) operator(=)operator(>) pre_constant(true)operator(\))operator(\)) - ident(move_table)operator(()ident(altered_table_name)operator(,) ident(table_name)operator(,) operator(&)ident(caller)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(move_table)operator(()ident(from)operator(,) ident(to)operator(,) ident(options) operator(=) operator({)operator(})operator(,) operator(&)ident(block)operator(\)) comment(#:nodoc:) - ident(copy_table)operator(()ident(from)operator(,) ident(to)operator(,) ident(options)operator(,) operator(&)ident(block)operator(\)) - ident(drop_table)operator(()ident(from)operator(\)) - reserved(end) - - reserved(def) method(copy_table)operator(()ident(from)operator(,) ident(to)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(create_table)operator(()ident(to)operator(,) ident(options)operator(\)) reserved(do) operator(|)instance_variable(@definition)operator(|) - ident(columns)operator(()ident(from)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(column)operator(|) - ident(column_name) operator(=) ident(options)operator([)symbol(:rename)operator(]) operator(?) - operator(()ident(options)operator([)symbol(:rename)operator(])operator([)ident(column)operator(.)ident(name)operator(]) operator(||) - ident(options)operator([)symbol(:rename)operator(])operator([)ident(column)operator(.)ident(name)operator(.)ident(to_sym)operator(]) operator(||) - ident(column)operator(.)ident(name)operator(\)) operator(:) ident(column)operator(.)ident(name) - - instance_variable(@definition)operator(.)ident(column)operator(()ident(column_name)operator(,) ident(column)operator(.)ident(type)operator(,) - symbol(:limit) operator(=)operator(>) ident(column)operator(.)ident(limit)operator(,) symbol(:default) operator(=)operator(>) ident(column)operator(.)ident(default)operator(,) - symbol(:null) operator(=)operator(>) ident(column)operator(.)ident(null)operator(\)) - reserved(end) - instance_variable(@definition)operator(.)ident(primary_key)operator(()ident(primary_key)operator(()ident(from)operator(\))operator(\)) - reserved(yield) instance_variable(@definition) reserved(if) ident(block_given?) - reserved(end) - - ident(copy_table_indexes)operator(()ident(from)operator(,) ident(to)operator(\)) - ident(copy_table_contents)operator(()ident(from)operator(,) ident(to)operator(,) - instance_variable(@definition)operator(.)ident(columns)operator(.)ident(map) operator({)operator(|)ident(column)operator(|) ident(column)operator(.)ident(name)operator(})operator(,) - ident(options)operator([)symbol(:rename)operator(]) operator(||) operator({)operator(})operator(\)) - reserved(end) - - reserved(def) method(copy_table_indexes)operator(()ident(from)operator(,) ident(to)operator(\)) comment(#:nodoc:) - ident(indexes)operator(()ident(from)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(index)operator(|) - ident(name) operator(=) ident(index)operator(.)ident(name) - reserved(if) ident(to) operator(==) stringdelimiter(")> - ident(name) operator(=) stringdelimiter(")> - reserved(elsif) ident(from) operator(==) stringdelimiter(")> - ident(name) operator(=) ident(name)operator([)integer(5)operator(..)integer(-1)operator(]) - reserved(end) - - ident(opts) operator(=) operator({) symbol(:name) operator(=)operator(>) ident(name) operator(}) - ident(opts)operator([)symbol(:unique)operator(]) operator(=) pre_constant(true) reserved(if) ident(index)operator(.)ident(unique) - ident(add_index)operator(()ident(to)operator(,) ident(index)operator(.)ident(columns)operator(,) ident(opts)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(copy_table_contents)operator(()ident(from)operator(,) ident(to)operator(,) ident(columns)operator(,) ident(rename) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(column_mappings) operator(=) constant(Hash)operator([)operator(*)ident(columns)operator(.)ident(map) operator({)operator(|)ident(name)operator(|) operator([)ident(name)operator(,) ident(name)operator(])operator(})operator(.)ident(flatten)operator(]) - ident(rename)operator(.)ident(inject)operator(()ident(column_mappings)operator(\)) operator({)operator(|)ident(map)operator(,) ident(a)operator(|) ident(map)operator([)ident(a)operator(.)ident(last)operator(]) operator(=) ident(a)operator(.)ident(first)operator(;) ident(map)operator(}) - - instance_variable(@connection)operator(.)ident(execute) stringdelimiter(")> reserved(do) operator(|)ident(row)operator(|) - ident(sql) operator(=) stringcontent( VALUES ()delimiter(")> - ident(sql) operator(<<) ident(columns)operator(.)ident(map) operator({)operator(|)ident(col)operator(|) ident(quote) ident(row)operator([)ident(column_mappings)operator([)ident(col)operator(])operator(])operator(}) operator(*) string - ident(sql) operator(<<) string - instance_variable(@connection)operator(.)ident(execute) ident(sql) - reserved(end) - reserved(end) - - reserved(def) method(catch_schema_changes) - reserved(return) reserved(yield) - reserved(rescue) constant(ActiveRecord)operator(::)constant(StatementInvalid) operator(=)operator(>) ident(exception) - reserved(if) ident(exception)operator(.)ident(message) operator(=)operator(~) regexp - ident(reconnect!) - reserved(retry) - reserved(else) - ident(raise) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(SQLite2Adapter) operator(<) constant(SQLiteAdapter) comment(# :nodoc:) - comment(# SQLite 2 does not support COUNT(DISTINCT\) queries:) - comment(#) - comment(# select COUNT(DISTINCT ArtistID\) from CDs; ) - comment(#) - comment(# In order to get the number of artists we execute the following statement) - comment(# ) - comment(# SELECT COUNT(ArtistID\) FROM (SELECT DISTINCT ArtistID FROM CDs\);) - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - reserved(super)operator(()ident(rewrite_count_distinct_queries)operator(()ident(sql)operator(\))operator(,) ident(name)operator(\)) - reserved(end) - - reserved(def) method(rewrite_count_distinct_queries)operator(()ident(sql)operator(\)) - reserved(if) ident(sql) operator(=)operator(~) regexp - ident(distinct_column) operator(=) global_variable($1) - ident(distinct_query) operator(=) global_variable($3) - ident(column_name) operator(=) ident(distinct_column)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last) - stringcontent(\) FROM (SELECT DISTINCT )inlinecontent( )inlinecontent(\))delimiter(")> - reserved(else) - ident(sql) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(DeprecatedSQLiteAdapter) operator(<) constant(SQLite2Adapter) comment(# :nodoc:) - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(\)) - ident(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(id_value) operator(||) instance_variable(@connection)operator(.)ident(last_insert_rowid) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -comment(# sqlserver_adapter.rb -- ActiveRecord adapter for Microsoft SQL Server) -comment(#) -comment(# Author: Joey Gibson ) -comment(# Date: 10/14/2004) -comment(#) -comment(# Modifications: DeLynn Berry ) -comment(# Date: 3/22/2005) -comment(#) -comment(# Modifications (ODBC\): Mark Imbriaco ) -comment(# Date: 6/26/2005) -comment(#) -comment(# Current maintainer: Ryan Tomayko ) -comment(#) -comment(# Modifications (Migrations\): Tom Ward ) -comment(# Date: 27/10/2005) -comment(#) - -reserved(module) class(ActiveRecord) - reserved(class) class(Base) - reserved(def) pre_constant(self)operator(.)method(sqlserver_connection)operator(()ident(config)operator(\)) comment(#:nodoc:) - ident(require_library_or_gem) string reserved(unless) pre_constant(self)operator(.)ident(class)operator(.)ident(const_defined?)operator(()symbol(:DBI)operator(\)) - - ident(config) operator(=) ident(config)operator(.)ident(symbolize_keys) - - ident(mode) operator(=) ident(config)operator([)symbol(:mode)operator(]) operator(?) ident(config)operator([)symbol(:mode)operator(])operator(.)ident(to_s)operator(.)ident(upcase) operator(:) string - ident(username) operator(=) ident(config)operator([)symbol(:username)operator(]) operator(?) ident(config)operator([)symbol(:username)operator(])operator(.)ident(to_s) operator(:) string - ident(password) operator(=) ident(config)operator([)symbol(:password)operator(]) operator(?) ident(config)operator([)symbol(:password)operator(])operator(.)ident(to_s) operator(:) string - ident(autocommit) operator(=) ident(config)operator(.)ident(key?)operator(()symbol(:autocommit)operator(\)) operator(?) ident(config)operator([)symbol(:autocommit)operator(]) operator(:) pre_constant(true) - reserved(if) ident(mode) operator(==) string - ident(raise) constant(ArgumentError)operator(,) string reserved(unless) ident(config)operator(.)ident(has_key?)operator(()symbol(:dsn)operator(\)) - ident(dsn) operator(=) ident(config)operator([)symbol(:dsn)operator(]) - ident(driver_url) operator(=) stringdelimiter(")> - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string reserved(unless) ident(config)operator(.)ident(has_key?)operator(()symbol(:database)operator(\)) - ident(database) operator(=) ident(config)operator([)symbol(:database)operator(]) - ident(host) operator(=) ident(config)operator([)symbol(:host)operator(]) operator(?) ident(config)operator([)symbol(:host)operator(])operator(.)ident(to_s) operator(:) string - ident(driver_url) operator(=) stringcontent(;Initial Catalog=)inlinecontent(;User Id=)inlinecontent(;Password=)inlinecontent(;)delimiter(")> - reserved(end) - ident(conn) operator(=) constant(DBI)operator(.)ident(connect)operator(()ident(driver_url)operator(,) ident(username)operator(,) ident(password)operator(\)) - ident(conn)operator([)stringoperator(]) operator(=) ident(autocommit) - constant(ConnectionAdapters)operator(::)constant(SQLServerAdapter)operator(.)ident(new)operator(()ident(conn)operator(,) ident(logger)operator(,) operator([)ident(driver_url)operator(,) ident(username)operator(,) ident(password)operator(])operator(\)) - reserved(end) - reserved(end) comment(# class Base) - - reserved(module) class(ConnectionAdapters) - reserved(class) class(ColumnWithIdentity) operator(<) constant(Column)comment(# :nodoc:) - ident(attr_reader) symbol(:identity)operator(,) symbol(:is_special)operator(,) symbol(:scale) - - reserved(def) method(initialize)operator(()ident(name)operator(,) ident(default)operator(,) ident(sql_type) operator(=) pre_constant(nil)operator(,) ident(is_identity) operator(=) pre_constant(false)operator(,) ident(null) operator(=) pre_constant(true)operator(,) ident(scale_value) operator(=) integer(0)operator(\)) - reserved(super)operator(()ident(name)operator(,) ident(default)operator(,) ident(sql_type)operator(,) ident(null)operator(\)) - instance_variable(@identity) operator(=) ident(is_identity) - instance_variable(@is_special) operator(=) ident(sql_type) operator(=)operator(~) regexp operator(?) pre_constant(true) operator(:) pre_constant(false) - instance_variable(@scale) operator(=) ident(scale_value) - comment(# SQL Server only supports limits on *char and float types) - instance_variable(@limit) operator(=) pre_constant(nil) reserved(unless) instance_variable(@type) operator(==) symbol(:float) reserved(or) instance_variable(@type) operator(==) symbol(:string) - reserved(end) - - reserved(def) method(simplified_type)operator(()ident(field_type)operator(\)) - reserved(case) ident(field_type) - reserved(when) regexp reserved(then) symbol(:integer) - reserved(when) regexp reserved(then) instance_variable(@scale) operator(==) integer(0) operator(?) symbol(:integer) operator(:) symbol(:float) - reserved(when) regexp reserved(then) symbol(:datetime) - reserved(when) regexp reserved(then) symbol(:timestamp) - reserved(when) regexp reserved(then) symbol(:time) - reserved(when) regexp reserved(then) symbol(:text) - reserved(when) regexp reserved(then) symbol(:binary) - reserved(when) regexp reserved(then) symbol(:string) - reserved(when) regexp reserved(then) symbol(:boolean) - reserved(when) regexp reserved(then) symbol(:string) - reserved(end) - reserved(end) - - reserved(def) method(type_cast)operator(()ident(value)operator(\)) - reserved(return) pre_constant(nil) reserved(if) ident(value)operator(.)ident(nil?) operator(||) ident(value) operator(=)operator(~) regexp - reserved(case) ident(type) - reserved(when) symbol(:string) reserved(then) ident(value) - reserved(when) symbol(:integer) reserved(then) ident(value) operator(==) pre_constant(true) operator(||) ident(value) operator(==) pre_constant(false) operator(?) ident(value) operator(==) pre_constant(true) operator(?) integer(1) operator(:) integer(0) operator(:) ident(value)operator(.)ident(to_i) - reserved(when) symbol(:float) reserved(then) ident(value)operator(.)ident(to_f) - reserved(when) symbol(:datetime) reserved(then) ident(cast_to_datetime)operator(()ident(value)operator(\)) - reserved(when) symbol(:timestamp) reserved(then) ident(cast_to_time)operator(()ident(value)operator(\)) - reserved(when) symbol(:time) reserved(then) ident(cast_to_time)operator(()ident(value)operator(\)) - reserved(when) symbol(:date) reserved(then) ident(cast_to_datetime)operator(()ident(value)operator(\)) - reserved(when) symbol(:boolean) reserved(then) ident(value) operator(==) pre_constant(true) reserved(or) operator(()ident(value) operator(=)operator(~) regexpoperator(\)) operator(==) integer(0) reserved(or) ident(value)operator(.)ident(to_s) operator(==) string - reserved(else) ident(value) - reserved(end) - reserved(end) - - reserved(def) method(cast_to_time)operator(()ident(value)operator(\)) - reserved(return) ident(value) reserved(if) ident(value)operator(.)ident(is_a?)operator(()constant(Time)operator(\)) - ident(time_array) operator(=) constant(ParseDate)operator(.)ident(parsedate)operator(()ident(value)operator(\)) - ident(time_array)operator([)integer(0)operator(]) operator(||=) integer(2000) - ident(time_array)operator([)integer(1)operator(]) operator(||=) integer(1) - ident(time_array)operator([)integer(2)operator(]) operator(||=) integer(1) - constant(Time)operator(.)ident(send)operator(()constant(Base)operator(.)ident(default_timezone)operator(,) operator(*)ident(time_array)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(cast_to_datetime)operator(()ident(value)operator(\)) - reserved(if) ident(value)operator(.)ident(is_a?)operator(()constant(Time)operator(\)) - reserved(if) ident(value)operator(.)ident(year) operator(!=) integer(0) reserved(and) ident(value)operator(.)ident(month) operator(!=) integer(0) reserved(and) ident(value)operator(.)ident(day) operator(!=) integer(0) - reserved(return) ident(value) - reserved(else) - reserved(return) constant(Time)operator(.)ident(mktime)operator(()integer(2000)operator(,) integer(1)operator(,) integer(1)operator(,) ident(value)operator(.)ident(hour)operator(,) ident(value)operator(.)ident(min)operator(,) ident(value)operator(.)ident(sec)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - reserved(end) - reserved(return) ident(cast_to_time)operator(()ident(value)operator(\)) reserved(if) ident(value)operator(.)ident(is_a?)operator(()constant(Date)operator(\)) reserved(or) ident(value)operator(.)ident(is_a?)operator(()constant(String)operator(\)) reserved(rescue) pre_constant(nil) - ident(value) - reserved(end) - - comment(# These methods will only allow the adapter to insert binary data with a length of 7K or less) - comment(# because of a SQL Server statement length policy.) - reserved(def) pre_constant(self)operator(.)method(string_to_binary)operator(()ident(value)operator(\)) - ident(value)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) - reserved(case) global_variable($1) - reserved(when) string reserved(then) string - reserved(when) string reserved(then) string - reserved(when) string reserved(then) string - reserved(when) string reserved(then) string - reserved(end) - reserved(end) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(binary_to_string)operator(()ident(value)operator(\)) - ident(value)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) - reserved(case) global_variable($1) - reserved(when) string reserved(then) string - reserved(when) string reserved(then) string - reserved(when) string reserved(then) string - reserved(when) string reserved(then) string - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# In ADO mode, this adapter will ONLY work on Windows systems, ) - comment(# since it relies on Win32OLE, which, to my knowledge, is only ) - comment(# available on Windows.) - comment(#) - comment(# This mode also relies on the ADO support in the DBI module. If you are using the) - comment(# one-click installer of Ruby, then you already have DBI installed, but) - comment(# the ADO module is *NOT* installed. You will need to get the latest) - comment(# source distribution of Ruby-DBI from http://ruby-dbi.sourceforge.net/) - comment(# unzip it, and copy the file ) - comment(# src/lib/dbd_ado/ADO.rb ) - comment(# to) - comment(# X:/Ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb ) - comment(# (you will more than likely need to create the ADO directory\).) - comment(# Once you've installed that file, you are ready to go.) - comment(#) - comment(# In ODBC mode, the adapter requires the ODBC support in the DBI module which requires) - comment(# the Ruby ODBC module. Ruby ODBC 0.996 was used in development and testing,) - comment(# and it is available at http://www.ch-werner.de/rubyodbc/) - comment(#) - comment(# Options:) - comment(#) - comment(# * :mode -- ADO or ODBC. Defaults to ADO.) - comment(# * :username -- Defaults to sa.) - comment(# * :password -- Defaults to empty string.) - comment(#) - comment(# ADO specific options:) - comment(#) - comment(# * :host -- Defaults to localhost.) - comment(# * :database -- The name of the database. No default, must be provided.) - comment(#) - comment(# ODBC specific options: ) - comment(#) - comment(# * :dsn -- Defaults to nothing.) - comment(#) - comment(# ADO code tested on Windows 2000 and higher systems,) - comment(# running ruby 1.8.2 (2004-07-29\) [i386-mswin32], and SQL Server 2000 SP3.) - comment(#) - comment(# ODBC code tested on a Fedora Core 4 system, running FreeTDS 0.63, ) - comment(# unixODBC 2.2.11, Ruby ODBC 0.996, Ruby DBI 0.0.23 and Ruby 1.8.2.) - comment(# [Linux strongmad 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 i686 i686 i386 GNU/Linux]) - reserved(class) class(SQLServerAdapter) operator(<) constant(AbstractAdapter) - - reserved(def) method(initialize)operator(()ident(connection)operator(,) ident(logger)operator(,) ident(connection_options)operator(=)pre_constant(nil)operator(\)) - reserved(super)operator(()ident(connection)operator(,) ident(logger)operator(\)) - instance_variable(@connection_options) operator(=) ident(connection_options) - reserved(end) - - reserved(def) method(native_database_types) - operator({) - symbol(:primary_key) operator(=)operator(>) stringoperator(,) - symbol(:string) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(255) operator(})operator(,) - symbol(:text) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:integer) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:float) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(8) operator(})operator(,) - symbol(:datetime) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:timestamp) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:time) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:date) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:binary) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(})operator(,) - symbol(:boolean) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(}) - operator(}) - reserved(end) - - reserved(def) method(adapter_name) - string - reserved(end) - - reserved(def) method(supports_migrations?) comment(#:nodoc:) - pre_constant(true) - reserved(end) - - comment(# CONNECTION MANAGEMENT ====================================#) - - comment(# Returns true if the connection is active.) - reserved(def) method(active?) - instance_variable(@connection)operator(.)ident(execute)operator(()stringoperator(\)) operator({) operator(}) - pre_constant(true) - reserved(rescue) constant(DBI)operator(::)constant(DatabaseError)operator(,) constant(DBI)operator(::)constant(InterfaceError) - pre_constant(false) - reserved(end) - - comment(# Reconnects to the database, returns false if no connection could be made.) - reserved(def) method(reconnect!) - ident(disconnect!) - instance_variable(@connection) operator(=) constant(DBI)operator(.)ident(connect)operator(()operator(*)instance_variable(@connection_options)operator(\)) - reserved(rescue) constant(DBI)operator(::)constant(DatabaseError) operator(=)operator(>) ident(e) - instance_variable(@logger)operator(.)ident(warn) stringcontent( reconnection failed: )inlinedelimiter(")> reserved(if) instance_variable(@logger) - pre_constant(false) - reserved(end) - - comment(# Disconnects from the database) - - reserved(def) method(disconnect!) - instance_variable(@connection)operator(.)ident(disconnect) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(select_all)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - - reserved(def) method(select_one)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(add_limit!)operator(()ident(sql)operator(,) symbol(:limit) operator(=)operator(>) integer(1)operator(\)) - ident(result) operator(=) ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(result)operator(.)ident(nil?) operator(?) pre_constant(nil) operator(:) ident(result)operator(.)ident(first) - reserved(end) - - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - reserved(return) operator([)operator(]) reserved(if) ident(table_name)operator(.)ident(blank?) - ident(table_name) operator(=) ident(table_name)operator(.)ident(to_s) reserved(if) ident(table_name)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - ident(table_name) operator(=) ident(table_name)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(-1)operator(]) reserved(unless) ident(table_name)operator(.)ident(nil?) - ident(sql) operator(=) stringcontent(', COLUMN_NAME\) as Length, COLUMNPROPERTY(OBJECT_ID(')inlinecontent('\), COLUMN_NAME, 'IsIdentity'\) as IsIdentity, NUMERIC_SCALE as Scale FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ')inlinecontent(')delimiter(")> - comment(# Comment out if you want to have the Columns select statment logged.) - comment(# Personally, I think it adds unnecessary bloat to the log. ) - comment(# If you do comment it out, make sure to un-comment the "result" line that follows) - ident(result) operator(=) ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) operator({) instance_variable(@connection)operator(.)ident(select_all)operator(()ident(sql)operator(\)) operator(}) - comment(#result = @connection.select_all(sql\)) - ident(columns) operator(=) operator([)operator(]) - ident(result)operator(.)ident(each) reserved(do) operator(|)ident(field)operator(|) - ident(default) operator(=) ident(field)operator([)symbol(:DefaultValue)operator(])operator(.)ident(to_s)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) operator(=)operator(~) regexp operator(?) pre_constant(nil) operator(:) ident(field)operator([)symbol(:DefaultValue)operator(]) - ident(type) operator(=) stringcontent(()inlinecontent(\))delimiter(")> - ident(is_identity) operator(=) ident(field)operator([)symbol(:IsIdentity)operator(]) operator(==) integer(1) - ident(is_nullable) operator(=) ident(field)operator([)symbol(:IsNullable)operator(]) operator(==) string - ident(columns) operator(<<) constant(ColumnWithIdentity)operator(.)ident(new)operator(()ident(field)operator([)symbol(:ColName)operator(])operator(,) ident(default)operator(,) ident(type)operator(,) ident(is_identity)operator(,) ident(is_nullable)operator(,) ident(field)operator([)symbol(:Scale)operator(])operator(\)) - reserved(end) - ident(columns) - reserved(end) - - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(,) ident(sequence_name) operator(=) pre_constant(nil)operator(\)) - reserved(begin) - ident(table_name) operator(=) ident(get_table_name)operator(()ident(sql)operator(\)) - ident(col) operator(=) ident(get_identity_column)operator(()ident(table_name)operator(\)) - ident(ii_enabled) operator(=) pre_constant(false) - - reserved(if) ident(col) operator(!=) pre_constant(nil) - reserved(if) ident(query_contains_identity_column)operator(()ident(sql)operator(,) ident(col)operator(\)) - reserved(begin) - ident(execute) ident(enable_identity_insert)operator(()ident(table_name)operator(,) pre_constant(true)operator(\)) - ident(ii_enabled) operator(=) pre_constant(true) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - ident(raise) constant(ActiveRecordError)operator(,) string - reserved(end) - reserved(end) - reserved(end) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) reserved(do) - instance_variable(@connection)operator(.)ident(execute)operator(()ident(sql)operator(\)) - ident(id_value) operator(||) ident(select_one)operator(()stringoperator(\))operator([)stringoperator(]) - reserved(end) - reserved(ensure) - reserved(if) ident(ii_enabled) - reserved(begin) - ident(execute) ident(enable_identity_insert)operator(()ident(table_name)operator(,) pre_constant(false)operator(\)) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - ident(raise) constant(ActiveRecordError)operator(,) string - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(sql) operator(=)operator(~) regexp - ident(insert)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(elsif) ident(sql) operator(=)operator(~) regexp - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) reserved(do) - instance_variable(@connection)operator(.)ident(execute)operator(()ident(sql)operator(\)) - ident(retVal) operator(=) ident(select_one)operator(()stringoperator(\))operator([)stringoperator(]) - reserved(end) - reserved(else) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) operator({) instance_variable(@connection)operator(.)ident(execute)operator(()ident(sql)operator(\)) operator(}) - reserved(end) - reserved(end) - - reserved(def) method(update)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - ident(alias_method) symbol(:delete)operator(,) symbol(:update) - - reserved(def) method(begin_db_transaction) - instance_variable(@connection)operator([)stringoperator(]) operator(=) pre_constant(false) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - instance_variable(@connection)operator([)stringoperator(]) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(commit_db_transaction) - instance_variable(@connection)operator(.)ident(commit) - reserved(ensure) - instance_variable(@connection)operator([)stringoperator(]) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(rollback_db_transaction) - instance_variable(@connection)operator(.)ident(rollback) - reserved(ensure) - instance_variable(@connection)operator([)stringoperator(]) operator(=) pre_constant(true) - reserved(end) - - reserved(def) method(quote)operator(()ident(value)operator(,) ident(column) operator(=) pre_constant(nil)operator(\)) - reserved(case) ident(value) - reserved(when) constant(String) - reserved(if) ident(column) operator(&&) ident(column)operator(.)ident(type) operator(==) symbol(:binary) operator(&&) ident(column)operator(.)ident(class)operator(.)ident(respond_to?)operator(()symbol(:string_to_binary)operator(\)) - stringcontent(')delimiter(")> - reserved(else) - stringcontent(')delimiter(")> - reserved(end) - reserved(when) constant(NilClass) reserved(then) string - reserved(when) constant(TrueClass) reserved(then) string - reserved(when) constant(FalseClass) reserved(then) string - reserved(when) constant(Float)operator(,) constant(Fixnum)operator(,) constant(Bignum) reserved(then) ident(value)operator(.)ident(to_s) - reserved(when) constant(Date) reserved(then) stringcontent(')delimiter(")> - reserved(when) constant(Time)operator(,) constant(DateTime) reserved(then) stringoperator(\))inline_delimiter(})>content(')delimiter(")> - reserved(else) stringcontent(')delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(quote_string)operator(()ident(string)operator(\)) - ident(string)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(quoted_true) - string - reserved(end) - - reserved(def) method(quoted_false) - string - reserved(end) - - reserved(def) method(quote_column_name)operator(()ident(name)operator(\)) - stringcontent(])delimiter(")> - reserved(end) - - reserved(def) method(add_limit_offset!)operator(()ident(sql)operator(,) ident(options)operator(\)) - reserved(if) ident(options)operator([)symbol(:limit)operator(]) reserved(and) ident(options)operator([)symbol(:offset)operator(]) - ident(total_rows) operator(=) instance_variable(@connection)operator(.)ident(select_all)operator(()stringoperator(,) stringoperator(\))inline_delimiter(})>content(\) tally)delimiter(")>operator(\))operator([)integer(0)operator(])operator([)symbol(:TotalRows)operator(])operator(.)ident(to_i) - reserved(if) operator(()ident(options)operator([)symbol(:limit)operator(]) operator(+) ident(options)operator([)symbol(:offset)operator(])operator(\)) operator(>)operator(=) ident(total_rows) - ident(options)operator([)symbol(:limit)operator(]) operator(=) operator(()ident(total_rows) operator(-) ident(options)operator([)symbol(:offset)operator(]) operator(>)operator(=) integer(0)operator(\)) operator(?) operator(()ident(total_rows) operator(-) ident(options)operator([)symbol(:offset)operator(])operator(\)) operator(:) integer(0) - reserved(end) - ident(sql)operator(.)ident(sub!)operator(()regexpoperator(,) stringcontent( * FROM (SELECT TOP )inlinecontent( )delimiter(")>operator(\)) - ident(sql) operator(<<) string - reserved(if) ident(options)operator([)symbol(:order)operator(]) - ident(options)operator([)symbol(:order)operator(]) operator(=) ident(options)operator([)symbol(:order)operator(])operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(map) reserved(do) operator(|)ident(field)operator(|) - ident(parts) operator(=) ident(field)operator(.)ident(split)operator(()stringoperator(\)) - ident(tc) operator(=) ident(parts)operator([)integer(0)operator(]) - reserved(if) ident(sql) operator(=)operator(~) regexp reserved(and) ident(tc) operator(=)operator(~) regexp comment(# if column quoting used in query) - ident(tc)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - ident(tc) operator(<<) string - reserved(end) - reserved(if) ident(sql) operator(=)operator(~) regexpcontent( AS (t)char(\\d)content(_r)char(\\d)char(\\d)content(?\))delimiter(/)> - ident(parts)operator([)integer(0)operator(]) operator(=) global_variable($1) - reserved(end) - ident(parts)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end)operator(.)ident(join)operator(()stringoperator(\)) - ident(sql) operator(<<) stringcontent(\) AS tmp2 ORDER BY )inlinedelimiter(")> - reserved(else) - ident(sql) operator(<<) string - reserved(end) - reserved(elsif) ident(sql) operator(!)operator(~) regexp - ident(sql)operator(.)ident(sub!)operator(()regexpoperator(\)) reserved(do) - stringcontent( TOP )inlinedelimiter(")> - reserved(end) reserved(unless) ident(options)operator([)symbol(:limit)operator(])operator(.)ident(nil?) - reserved(end) - reserved(end) - - reserved(def) method(recreate_database)operator(()ident(name)operator(\)) - ident(drop_database)operator(()ident(name)operator(\)) - ident(create_database)operator(()ident(name)operator(\)) - reserved(end) - - reserved(def) method(drop_database)operator(()ident(name)operator(\)) - ident(execute) stringdelimiter(")> - reserved(end) - - reserved(def) method(create_database)operator(()ident(name)operator(\)) - ident(execute) stringdelimiter(")> - reserved(end) - - reserved(def) method(current_database) - instance_variable(@connection)operator(.)ident(select_one)operator(()stringoperator(\))operator([)integer(0)operator(]) - reserved(end) - - reserved(def) method(tables)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) - ident(execute)operator(()stringoperator(,) ident(name)operator(\))operator(.)ident(inject)operator(()operator([)operator(])operator(\)) reserved(do) operator(|)ident(tables)operator(,) ident(field)operator(|) - ident(table_name) operator(=) ident(field)operator([)integer(0)operator(]) - ident(tables) operator(<<) ident(table_name) reserved(unless) ident(table_name) operator(==) string - ident(tables) - reserved(end) - reserved(end) - - reserved(def) method(indexes)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(indexes) operator(=) operator([)operator(]) - ident(execute)operator(()stringdelimiter(")>operator(,) ident(name)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(index)operator(|) - ident(unique) operator(=) ident(index)operator([)integer(1)operator(]) operator(=)operator(~) regexp - ident(primary) operator(=) ident(index)operator([)integer(1)operator(]) operator(=)operator(~) regexp - reserved(if) operator(!)ident(primary) - ident(indexes) operator(<<) constant(IndexDefinition)operator(.)ident(new)operator(()ident(table_name)operator(,) ident(index)operator([)integer(0)operator(])operator(,) ident(unique)operator(,) ident(index)operator([)integer(2)operator(])operator(.)ident(split)operator(()stringoperator(\))operator(\)) - reserved(end) - reserved(end) - ident(indexes) - reserved(end) - - reserved(def) method(rename_table)operator(()ident(name)operator(,) ident(new_name)operator(\)) - ident(execute) stringcontent(', ')inlinecontent(')delimiter(")> - reserved(end) - - reserved(def) method(remove_column)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) - ident(execute) stringcontent( DROP COLUMN )inlinedelimiter(")> - reserved(end) - - reserved(def) method(rename_column)operator(()ident(table)operator(,) ident(column)operator(,) ident(new_column_name)operator(\)) - ident(execute) stringcontent(.)inlinecontent(', ')inlinecontent(')delimiter(")> - reserved(end) - - reserved(def) method(change_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(sql_commands) operator(=) operator([)stringcontent( ALTER COLUMN )inlinecontent( )inlinedelimiter(")>operator(]) - reserved(if) ident(options)operator([)symbol(:default)operator(]) - ident(remove_default_constraint)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) - ident(sql_commands) operator(<<) stringcontent( ADD CONSTRAINT DF_)inlinecontent(_)inlinecontent( DEFAULT )inlinecontent( FOR )inlinedelimiter(")> - reserved(end) - ident(sql_commands)operator(.)ident(each) operator({)operator(|)ident(c)operator(|) - ident(execute)operator(()ident(c)operator(\)) - operator(}) - reserved(end) - - reserved(def) method(remove_column)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) - ident(remove_default_constraint)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) - ident(execute) stringcontent( DROP COLUMN )inlinedelimiter(")> - reserved(end) - - reserved(def) method(remove_default_constraint)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) - ident(defaults) operator(=) ident(select) string - ident(defaults)operator(.)ident(each) operator({)operator(|)ident(constraint)operator(|) - ident(execute) stringcontent( DROP CONSTRAINT )inlineoperator(])inline_delimiter(})>delimiter(")> - operator(}) - reserved(end) - - reserved(def) method(remove_index)operator(()ident(table_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(execute) stringcontent(.)inlinedelimiter(")> - reserved(end) - - reserved(def) method(type_to_sql)operator(()ident(type)operator(,) ident(limit) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - ident(native) operator(=) ident(native_database_types)operator([)ident(type)operator(]) - comment(# if there's no :limit in the default type definition, assume that type doesn't support limits) - ident(limit) operator(=) ident(limit) operator(||) ident(native)operator([)symbol(:limit)operator(]) - ident(column_type_sql) operator(=) ident(native)operator([)symbol(:name)operator(]) - ident(column_type_sql) operator(<<) stringcontent(\))delimiter(")> reserved(if) ident(limit) - ident(column_type_sql) - reserved(end) - - ident(private) - reserved(def) method(select)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(rows) operator(=) operator([)operator(]) - ident(repair_special_columns)operator(()ident(sql)operator(\)) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) reserved(do) - instance_variable(@connection)operator(.)ident(select_all)operator(()ident(sql)operator(\)) reserved(do) operator(|)ident(row)operator(|) - ident(record) operator(=) operator({)operator(}) - ident(row)operator(.)ident(column_names)operator(.)ident(each) reserved(do) operator(|)ident(col)operator(|) - ident(record)operator([)ident(col)operator(]) operator(=) ident(row)operator([)ident(col)operator(]) - ident(record)operator([)ident(col)operator(]) operator(=) ident(record)operator([)ident(col)operator(])operator(.)ident(to_time) reserved(if) ident(record)operator([)ident(col)operator(])operator(.)ident(is_a?) constant(DBI)operator(::)constant(Timestamp) - reserved(end) - ident(rows) operator(<<) ident(record) - reserved(end) - reserved(end) - ident(rows) - reserved(end) - - reserved(def) method(enable_identity_insert)operator(()ident(table_name)operator(,) ident(enable) operator(=) pre_constant(true)operator(\)) - reserved(if) ident(has_identity_column)operator(()ident(table_name)operator(\)) - stringcontent( )inline operator(:) stringinline_delimiter(})>delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(get_table_name)operator(()ident(sql)operator(\)) - reserved(if) ident(sql) operator(=)operator(~) regexp - global_variable($1) - reserved(elsif) ident(sql) operator(=)operator(~) regexp - global_variable($1) - reserved(else) - pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(has_identity_column)operator(()ident(table_name)operator(\)) - operator(!)ident(get_identity_column)operator(()ident(table_name)operator(\))operator(.)ident(nil?) - reserved(end) - - reserved(def) method(get_identity_column)operator(()ident(table_name)operator(\)) - instance_variable(@table_columns) operator(=) operator({)operator(}) reserved(unless) instance_variable(@table_columns) - instance_variable(@table_columns)operator([)ident(table_name)operator(]) operator(=) ident(columns)operator(()ident(table_name)operator(\)) reserved(if) instance_variable(@table_columns)operator([)ident(table_name)operator(]) operator(==) pre_constant(nil) - instance_variable(@table_columns)operator([)ident(table_name)operator(])operator(.)ident(each) reserved(do) operator(|)ident(col)operator(|) - reserved(return) ident(col)operator(.)ident(name) reserved(if) ident(col)operator(.)ident(identity) - reserved(end) - - reserved(return) pre_constant(nil) - reserved(end) - - reserved(def) method(query_contains_identity_column)operator(()ident(sql)operator(,) ident(col)operator(\)) - ident(sql) operator(=)operator(~) regexpchar(\\])delimiter(/)> - reserved(end) - - reserved(def) method(change_order_direction)operator(()ident(order)operator(\)) - ident(order)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(collect) operator({)operator(|)ident(fragment)operator(|) - reserved(case) ident(fragment) - reserved(when) regexp reserved(then) ident(fragment)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(when) regexp reserved(then) ident(fragment)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(else) constant(String)operator(.)ident(new)operator(()ident(fragment)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(join)operator(()stringoperator(\)) operator(+) string - reserved(end) - operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(get_special_columns)operator(()ident(table_name)operator(\)) - ident(special) operator(=) operator([)operator(]) - instance_variable(@table_columns) operator(||=) operator({)operator(}) - instance_variable(@table_columns)operator([)ident(table_name)operator(]) operator(||=) ident(columns)operator(()ident(table_name)operator(\)) - instance_variable(@table_columns)operator([)ident(table_name)operator(])operator(.)ident(each) reserved(do) operator(|)ident(col)operator(|) - ident(special) operator(<<) ident(col)operator(.)ident(name) reserved(if) ident(col)operator(.)ident(is_special) - reserved(end) - ident(special) - reserved(end) - - reserved(def) method(repair_special_columns)operator(()ident(sql)operator(\)) - ident(special_cols) operator(=) ident(get_special_columns)operator(()ident(get_table_name)operator(()ident(sql)operator(\))operator(\)) - reserved(for) ident(col) reserved(in) ident(special_cols)operator(.)ident(to_a) - ident(sql)operator(.)ident(gsub!)operator(()constant(Regexp)operator(.)ident(new)operator(()stringcontent( = )delimiter(")>operator(\))operator(,) stringcontent( LIKE )delimiter(")>operator(\)) - ident(sql)operator(.)ident(gsub!)operator(()regexpdelimiter(/)modifier(i)>operator(,) stringoperator(\)) - reserved(end) - ident(sql) - reserved(end) - - reserved(end) comment(#class SQLServerAdapter < AbstractAdapter) - reserved(end) comment(#module ConnectionAdapters) -reserved(end) comment(#module ActiveRecord) -comment(# sybase_adaptor.rb) -comment(# Author: John Sheets ) -comment(# Date: 01 Mar 2006) -comment(#) -comment(# Based on code from Will Sobel (http://dev.rubyonrails.org/ticket/2030\)) -comment(#) -comment(# 17 Mar 2006: Added support for migrations; fixed issues with :boolean columns.) -comment(#) - -ident(require) string - -reserved(begin) -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(class) class(Base) - comment(# Establishes a connection to the database that's used by all Active Record objects) - reserved(def) pre_constant(self)operator(.)method(sybase_connection)operator(()ident(config)operator(\)) comment(# :nodoc:) - ident(config) operator(=) ident(config)operator(.)ident(symbolize_keys) - - ident(username) operator(=) ident(config)operator([)symbol(:username)operator(]) operator(?) ident(config)operator([)symbol(:username)operator(])operator(.)ident(to_s) operator(:) string - ident(password) operator(=) ident(config)operator([)symbol(:password)operator(]) operator(?) ident(config)operator([)symbol(:password)operator(])operator(.)ident(to_s) operator(:) string - - reserved(if) ident(config)operator(.)ident(has_key?)operator(()symbol(:host)operator(\)) - ident(host) operator(=) ident(config)operator([)symbol(:host)operator(]) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - reserved(if) ident(config)operator(.)ident(has_key?)operator(()symbol(:database)operator(\)) - ident(database) operator(=) ident(config)operator([)symbol(:database)operator(]) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - constant(ConnectionAdapters)operator(::)constant(SybaseAdapter)operator(.)ident(new)operator(() - constant(SybSQL)operator(.)ident(new)operator(()operator({)string operator(=)operator(>) ident(host)operator(,) string operator(=)operator(>) ident(username)operator(,) string operator(=)operator(>) ident(password)operator(})operator(,) - constant(ConnectionAdapters)operator(::)constant(SybaseAdapterContext)operator(\))operator(,) ident(database)operator(,) ident(logger)operator(\)) - reserved(end) - reserved(end) comment(# class Base) - - reserved(module) class(ConnectionAdapters) - - comment(# ActiveRecord connection adapter for Sybase Open Client bindings) - comment(# (see http://raa.ruby-lang.org/project/sybase-ctlib\).) - comment(#) - comment(# Options:) - comment(#) - comment(# * :host -- The name of the database server. No default, must be provided.) - comment(# * :database -- The name of the database. No default, must be provided.) - comment(# * :username -- Defaults to sa.) - comment(# * :password -- Defaults to empty string.) - comment(#) - comment(# Usage Notes:) - comment(#) - comment(# * The sybase-ctlib bindings do not support the DATE SQL column type; use DATETIME instead.) - comment(# * Table and column names are limited to 30 chars in Sybase 12.5) - comment(# * :binary columns not yet supported) - comment(# * :boolean columns use the BIT SQL type, which does not allow nulls or ) - comment(# indexes. If a DEFAULT is not specified for ALTER TABLE commands, the) - comment(# column will be declared with DEFAULT 0 (false\).) - comment(#) - comment(# Migrations:) - comment(#) - comment(# The Sybase adapter supports migrations, but for ALTER TABLE commands to) - comment(# work, the database must have the database option 'select into' set to) - comment(# 'true' with sp_dboption (see below\). The sp_helpdb command lists the current) - comment(# options for all databases.) - comment(#) - comment(# 1> use mydb) - comment(# 2> go) - comment(# 1> master..sp_dboption mydb, "select into", true) - comment(# 2> go) - comment(# 1> checkpoint) - comment(# 2> go) - reserved(class) class(SybaseAdapter) operator(<) constant(AbstractAdapter) comment(# :nodoc:) - reserved(class) class(ColumnWithIdentity) operator(<) constant(Column) - ident(attr_reader) symbol(:identity)operator(,) symbol(:primary) - - reserved(def) method(initialize)operator(()ident(name)operator(,) ident(default)operator(,) ident(sql_type) operator(=) pre_constant(nil)operator(,) ident(nullable) operator(=) pre_constant(nil)operator(,) ident(identity) operator(=) pre_constant(nil)operator(,) ident(primary) operator(=) pre_constant(nil)operator(\)) - reserved(super)operator(()ident(name)operator(,) ident(default)operator(,) ident(sql_type)operator(,) ident(nullable)operator(\)) - instance_variable(@default)operator(,) instance_variable(@identity)operator(,) instance_variable(@primary) operator(=) ident(type_cast)operator(()ident(default)operator(\))operator(,) ident(identity)operator(,) ident(primary) - reserved(end) - - reserved(def) method(simplified_type)operator(()ident(field_type)operator(\)) - reserved(case) ident(field_type) - reserved(when) regexp reserved(then) symbol(:integer) - reserved(when) regexp reserved(then) symbol(:float) - reserved(when) regexp reserved(then) symbol(:text) - reserved(when) regexp reserved(then) symbol(:binary) - reserved(when) regexp reserved(then) symbol(:string) - reserved(when) regexp reserved(then) symbol(:boolean) - reserved(when) regexp reserved(then) symbol(:datetime) - reserved(else) reserved(super) - reserved(end) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(string_to_binary)operator(()ident(value)operator(\)) - stringoperator(\))operator([)integer(0)operator(])inline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(binary_to_string)operator(()ident(value)operator(\)) - comment(# FIXME: sybase-ctlib uses separate sql method for binary columns.) - ident(value) - reserved(end) - reserved(end) comment(# class ColumnWithIdentity) - - comment(# Sybase adapter) - reserved(def) method(initialize)operator(()ident(connection)operator(,) ident(database)operator(,) ident(logger) operator(=) pre_constant(nil)operator(\)) - reserved(super)operator(()ident(connection)operator(,) ident(logger)operator(\)) - ident(context) operator(=) ident(connection)operator(.)ident(context) - ident(context)operator(.)ident(init)operator(()ident(logger)operator(\)) - instance_variable(@limit) operator(=) instance_variable(@offset) operator(=) integer(0) - reserved(unless) ident(connection)operator(.)ident(sql_norow)operator(()stringdelimiter(")>operator(\)) - ident(raise) stringdelimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(native_database_types) - operator({) - symbol(:primary_key) operator(=)operator(>) stringoperator(,) - symbol(:string) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(255) operator(})operator(,) - symbol(:text) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:integer) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:float) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(8) operator(})operator(,) - symbol(:datetime) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:timestamp) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:time) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:date) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(,) - symbol(:binary) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) stringoperator(})operator(,) - symbol(:boolean) operator(=)operator(>) operator({) symbol(:name) operator(=)operator(>) string operator(}) - operator(}) - reserved(end) - - reserved(def) method(adapter_name) - string - reserved(end) - - reserved(def) method(active?) - operator(!)operator(()instance_variable(@connection)operator(.)ident(connection)operator(.)ident(nil?) operator(||) instance_variable(@connection)operator(.)ident(connection_dead?)operator(\)) - reserved(end) - - reserved(def) method(disconnect!) - instance_variable(@connection)operator(.)ident(close) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(reconnect!) - ident(raise) string - comment(# disconnect!) - comment(# connect! # Not yet implemented) - reserved(end) - - reserved(def) method(table_alias_length) - integer(30) - reserved(end) - - comment(# Check for a limit statement and parse out the limit and) - comment(# offset if specified. Remove the limit from the sql statement) - comment(# and call select.) - reserved(def) method(select_all)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - - comment(# Remove limit clause from statement. This will almost always) - comment(# contain LIMIT 1 from the caller. set the rowcount to 1 before) - comment(# calling select.) - reserved(def) method(select_one)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(result) operator(=) ident(select)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(result)operator(.)ident(nil?) operator(?) pre_constant(nil) operator(:) ident(result)operator(.)ident(first) - reserved(end) - - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(table_structure)operator(()ident(table_name)operator(\))operator(.)ident(inject)operator(()operator([)operator(])operator(\)) reserved(do) operator(|)ident(columns)operator(,) ident(column)operator(|) - ident(name)operator(,) ident(default)operator(,) ident(type)operator(,) ident(nullable)operator(,) ident(identity)operator(,) ident(primary) operator(=) ident(column) - ident(columns) operator(<<) constant(ColumnWithIdentity)operator(.)ident(new)operator(()ident(name)operator(,) ident(default)operator(,) ident(type)operator(,) ident(nullable)operator(,) ident(identity)operator(,) ident(primary)operator(\)) - ident(columns) - reserved(end) - reserved(end) - - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(,) ident(sequence_name) operator(=) pre_constant(nil)operator(\)) - reserved(begin) - ident(table_name) operator(=) ident(get_table_name)operator(()ident(sql)operator(\)) - ident(col) operator(=) ident(get_identity_column)operator(()ident(table_name)operator(\)) - ident(ii_enabled) operator(=) pre_constant(false) - - reserved(if) ident(col) operator(!=) pre_constant(nil) - reserved(if) ident(query_contains_identity_column)operator(()ident(sql)operator(,) ident(col)operator(\)) - reserved(begin) - ident(execute) ident(enable_identity_insert)operator(()ident(table_name)operator(,) pre_constant(true)operator(\)) - ident(ii_enabled) operator(=) pre_constant(true) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - ident(raise) constant(ActiveRecordError)operator(,) string - reserved(end) - reserved(end) - reserved(end) - - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) reserved(do) - ident(execute)operator(()ident(sql)operator(,) ident(name)operator(\)) - ident(ident) operator(=) ident(select_one)operator(()stringoperator(\))operator([)stringoperator(]) - ident(id_value) operator(||) ident(ident) - reserved(end) - reserved(ensure) - reserved(if) ident(ii_enabled) - reserved(begin) - ident(execute) ident(enable_identity_insert)operator(()ident(table_name)operator(,) pre_constant(false)operator(\)) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - ident(raise) constant(ActiveRecordError)operator(,) string - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) reserved(do) - instance_variable(@connection)operator(.)ident(context)operator(.)ident(reset) - instance_variable(@connection)operator(.)ident(set_rowcount)operator(()instance_variable(@limit) operator(||) integer(0)operator(\)) - instance_variable(@limit) operator(=) instance_variable(@offset) operator(=) pre_constant(nil) - instance_variable(@connection)operator(.)ident(sql_norow)operator(()ident(sql)operator(\)) - reserved(if) instance_variable(@connection)operator(.)ident(cmd_fail?) reserved(or) instance_variable(@connection)operator(.)ident(context)operator(.)ident(failed?) - ident(raise) stringcontent(: )inlinechar(\\n)content(Message: )inlinedelimiter(")> - reserved(end) - reserved(end) - comment(# Return rows affected) - instance_variable(@connection)operator(.)ident(results)operator([)integer(0)operator(])operator(.)ident(row_count) - reserved(end) - - ident(alias_method) symbol(:update)operator(,) symbol(:execute) - ident(alias_method) symbol(:delete)operator(,) symbol(:execute) - - reserved(def) method(begin_db_transaction)operator(()operator(\)) ident(execute) string reserved(end) - reserved(def) method(commit_db_transaction)operator(()operator(\)) ident(execute) string reserved(end) - reserved(def) method(rollback_db_transaction)operator(()operator(\)) ident(execute) string reserved(end) - - reserved(def) method(tables)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) - ident(tables) operator(=) operator([)operator(]) - ident(select)operator(()stringoperator(,) ident(name)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(row)operator(|) - ident(tables) operator(<<) ident(row)operator([)stringoperator(]) - reserved(end) - ident(tables) - reserved(end) - - reserved(def) method(indexes)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(indexes) operator(=) operator([)operator(]) - ident(select)operator(()stringdelimiter(")>operator(,) ident(name)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(index)operator(|) - ident(unique) operator(=) ident(index)operator([)stringoperator(]) operator(=)operator(~) regexp - ident(primary) operator(=) ident(index)operator([)stringoperator(]) operator(=)operator(~) regexp - reserved(if) operator(!)ident(primary) - ident(cols) operator(=) ident(index)operator([)stringoperator(])operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(col)operator(|) ident(col)operator(.)ident(strip!) operator(}) - ident(indexes) operator(<<) constant(IndexDefinition)operator(.)ident(new)operator(()ident(table_name)operator(,) ident(index)operator([)stringoperator(])operator(,) ident(unique)operator(,) ident(cols)operator(\)) - reserved(end) - reserved(end) - ident(indexes) - reserved(end) - - reserved(def) method(quoted_true) - string - reserved(end) - - reserved(def) method(quoted_false) - string - reserved(end) - - reserved(def) method(quote)operator(()ident(value)operator(,) ident(column) operator(=) pre_constant(nil)operator(\)) - reserved(case) ident(value) - reserved(when) constant(String) - reserved(if) ident(column) operator(&&) ident(column)operator(.)ident(type) operator(==) symbol(:binary) operator(&&) ident(column)operator(.)ident(class)operator(.)ident(respond_to?)operator(()symbol(:string_to_binary)operator(\)) - stringdelimiter(")> - reserved(elsif) ident(value) operator(=)operator(~) regexp - ident(value) - reserved(else) - stringcontent(')delimiter(")> - reserved(end) - reserved(when) constant(NilClass) reserved(then) operator(()ident(column) operator(&&) ident(column)operator(.)ident(type) operator(==) symbol(:boolean)operator(\)) operator(?) string operator(:) string - reserved(when) constant(TrueClass) reserved(then) string - reserved(when) constant(FalseClass) reserved(then) string - reserved(when) constant(Float)operator(,) constant(Fixnum)operator(,) constant(Bignum) reserved(then) ident(value)operator(.)ident(to_s) - reserved(when) constant(Date) reserved(then) stringcontent(')delimiter(")> - reserved(when) constant(Time)operator(,) constant(DateTime) reserved(then) stringoperator(\))inline_delimiter(})>content(')delimiter(")> - reserved(else) stringcontent(')delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(quote_column)operator(()ident(type)operator(,) ident(value)operator(\)) - reserved(case) ident(type) - reserved(when) symbol(:boolean) - reserved(case) ident(value) - reserved(when) constant(String) reserved(then) ident(value) operator(=)operator(~) regexp operator(?) integer(1) operator(:) integer(0) - reserved(when) pre_constant(true) reserved(then) integer(1) - reserved(when) pre_constant(false) reserved(then) integer(0) - reserved(else) ident(value)operator(.)ident(to_i) - reserved(end) - reserved(when) symbol(:integer) reserved(then) ident(value)operator(.)ident(to_i) - reserved(when) symbol(:float) reserved(then) ident(value)operator(.)ident(to_f) - reserved(when) symbol(:text)operator(,) symbol(:string)operator(,) symbol(:enum) - reserved(case) ident(value) - reserved(when) constant(String)operator(,) constant(Symbol)operator(,) constant(Fixnum)operator(,) constant(Float)operator(,) constant(Bignum)operator(,) constant(TrueClass)operator(,) constant(FalseClass) - stringcontent(')delimiter(")> - reserved(else) - stringcontent(')delimiter(")> - reserved(end) - reserved(when) symbol(:date)operator(,) symbol(:datetime)operator(,) symbol(:time) - reserved(case) ident(value) - reserved(when) constant(Time)operator(,) constant(DateTime) reserved(then) stringoperator(\))inline_delimiter(})>content(')delimiter(")> - reserved(when) constant(Date) reserved(then) stringcontent(')delimiter(")> - reserved(else) stringcontent(')delimiter(")> - reserved(end) - reserved(else) stringcontent(')delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(quote_string)operator(()ident(s)operator(\)) - ident(s)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) comment(# ' (for ruby-mode\)) - reserved(end) - - reserved(def) method(quote_column_name)operator(()ident(name)operator(\)) - stringcontent(])delimiter(")> - reserved(end) - - reserved(def) method(add_limit_offset!)operator(()ident(sql)operator(,) ident(options)operator(\)) comment(# :nodoc:) - instance_variable(@limit) operator(=) ident(options)operator([)symbol(:limit)operator(]) - instance_variable(@offset) operator(=) ident(options)operator([)symbol(:offset)operator(]) - reserved(if) operator(!)ident(normal_select?) - comment(# Use temp table to hack offset with Sybase) - ident(sql)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(elsif) ident(zero_limit?) - comment(# "SET ROWCOUNT 0" turns off limits, so we have) - comment(# to use a cheap trick.) - reserved(if) ident(sql) operator(=)operator(~) regexp - ident(sql)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(elsif) ident(sql) operator(=)operator(~) regexp - ident(sql)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(else) - ident(sql) operator(<<) string - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(supports_migrations?) comment(#:nodoc:) - pre_constant(true) - reserved(end) - - reserved(def) method(rename_table)operator(()ident(name)operator(,) ident(new_name)operator(\)) - ident(execute) stringcontent(', ')inlinecontent(')delimiter(")> - reserved(end) - - reserved(def) method(rename_column)operator(()ident(table)operator(,) ident(column)operator(,) ident(new_column_name)operator(\)) - ident(execute) stringcontent(.)inlinecontent(', ')inlinecontent(')delimiter(")> - reserved(end) - - reserved(def) method(change_column)operator(()ident(table_name)operator(,) ident(column_name)operator(,) ident(type)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) comment(#:nodoc:) - ident(sql_commands) operator(=) operator([)stringcontent( MODIFY )inlinecontent( )inlinedelimiter(")>operator(]) - reserved(if) ident(options)operator([)symbol(:default)operator(]) - ident(remove_default_constraint)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) - ident(sql_commands) operator(<<) stringcontent( ADD CONSTRAINT DF_)inlinecontent(_)inlinecontent( DEFAULT )inlinecontent( FOR )inlinedelimiter(")> - reserved(end) - ident(sql_commands)operator(.)ident(each) operator({) operator(|)ident(c)operator(|) ident(execute)operator(()ident(c)operator(\)) operator(}) - reserved(end) - - reserved(def) method(remove_column)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) - ident(remove_default_constraint)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) - ident(execute) stringcontent( DROP )inlinedelimiter(")> - reserved(end) - - reserved(def) method(remove_default_constraint)operator(()ident(table_name)operator(,) ident(column_name)operator(\)) - ident(defaults) operator(=) ident(select) string - ident(defaults)operator(.)ident(each) operator({)operator(|)ident(constraint)operator(|) - ident(execute) stringcontent( DROP CONSTRAINT )inlineoperator(])inline_delimiter(})>delimiter(")> - operator(}) - reserved(end) - - reserved(def) method(remove_index)operator(()ident(table_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(execute) stringcontent(.)inlinedelimiter(")> - reserved(end) - - reserved(def) method(add_column_options!)operator(()ident(sql)operator(,) ident(options)operator(\)) comment(#:nodoc:) - ident(sql) operator(<<) stringdelimiter(")> reserved(unless) ident(options)operator([)symbol(:default)operator(])operator(.)ident(nil?) - - reserved(if) ident(check_null_for_column?)operator(()ident(options)operator([)symbol(:column)operator(])operator(,) ident(sql)operator(\)) - ident(sql) operator(<<) operator(()ident(options)operator([)symbol(:null)operator(]) operator(==) pre_constant(false) operator(?) string operator(:) stringoperator(\)) - reserved(end) - ident(sql) - reserved(end) - - ident(private) - reserved(def) method(check_null_for_column?)operator(()ident(col)operator(,) ident(sql)operator(\)) - comment(# Sybase columns are NOT NULL by default, so explicitly set NULL) - comment(# if :null option is omitted. Disallow NULLs for boolean.) - ident(type) operator(=) ident(col)operator(.)ident(nil?) operator(?) string operator(:) ident(col)operator([)symbol(:type)operator(]) - - comment(# Ignore :null if a primary key) - reserved(return) pre_constant(false) reserved(if) ident(type) operator(=)operator(~) regexp - - comment(# Ignore :null if a :boolean or BIT column) - reserved(if) operator(()ident(sql) operator(=)operator(~) regexpoperator(\)) operator(||) ident(type) operator(==) symbol(:boolean) - comment(# If no default clause found on a boolean column, add one.) - ident(sql) operator(<<) string reserved(if) global_variable($1)operator(.)ident(nil?) - reserved(return) pre_constant(false) - reserved(end) - pre_constant(true) - reserved(end) - - comment(# Return the last value of the identity global value.) - reserved(def) method(last_insert_id) - instance_variable(@connection)operator(.)ident(sql)operator(()stringoperator(\)) - reserved(unless) instance_variable(@connection)operator(.)ident(cmd_fail?) - ident(id) operator(=) instance_variable(@connection)operator(.)ident(top_row_result)operator(.)ident(rows)operator(.)ident(first)operator(.)ident(first) - reserved(if) ident(id) - ident(id) operator(=) ident(id)operator(.)ident(to_i) - ident(id) operator(=) pre_constant(nil) reserved(if) ident(id) operator(==) integer(0) - reserved(end) - reserved(else) - ident(id) operator(=) pre_constant(nil) - reserved(end) - ident(id) - reserved(end) - - reserved(def) method(affected_rows)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) - instance_variable(@connection)operator(.)ident(sql)operator(()stringoperator(\)) - reserved(unless) instance_variable(@connection)operator(.)ident(cmd_fail?) - ident(count) operator(=) instance_variable(@connection)operator(.)ident(top_row_result)operator(.)ident(rows)operator(.)ident(first)operator(.)ident(first) - ident(count) operator(=) ident(count)operator(.)ident(to_i) reserved(if) ident(count) - reserved(else) - integer(0) - reserved(end) - reserved(end) - - reserved(def) method(normal_select?) - comment(# If limit is not set at all, we can ignore offset;) - comment(# If limit *is* set but offset is zero, use normal select) - comment(# with simple SET ROWCOUNT. Thus, only use the temp table) - comment(# if limit is set and offset > 0.) - ident(has_limit) operator(=) operator(!)instance_variable(@limit)operator(.)ident(nil?) - ident(has_offset) operator(=) operator(!)instance_variable(@offset)operator(.)ident(nil?) operator(&&) instance_variable(@offset) operator(>) integer(0) - operator(!)ident(has_limit) operator(||) operator(!)ident(has_offset) - reserved(end) - - reserved(def) method(zero_limit?) - operator(!)instance_variable(@limit)operator(.)ident(nil?) operator(&&) instance_variable(@limit) operator(==) integer(0) - reserved(end) - - comment(# Select limit number of rows starting at optional offset.) - reserved(def) method(select)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - instance_variable(@connection)operator(.)ident(context)operator(.)ident(reset) - ident(log)operator(()ident(sql)operator(,) ident(name)operator(\)) reserved(do) - reserved(if) ident(normal_select?) - comment(# If limit is not explicitly set, return all results.) - instance_variable(@logger)operator(.)ident(debug) stringinline_delimiter(})>content(\))delimiter(")> reserved(if) instance_variable(@logger) - - comment(# Run a normal select) - instance_variable(@connection)operator(.)ident(set_rowcount)operator(()instance_variable(@limit) operator(||) integer(0)operator(\)) - instance_variable(@connection)operator(.)ident(sql)operator(()ident(sql)operator(\)) - reserved(else) - comment(# Select into a temp table and prune results) - instance_variable(@logger)operator(.)ident(debug) stringcontent( or fewer rows into #artemp)delimiter(")> reserved(if) instance_variable(@logger) - instance_variable(@connection)operator(.)ident(set_rowcount)operator(()instance_variable(@limit) operator(+) operator(()instance_variable(@offset) operator(||) integer(0)operator(\))operator(\)) - instance_variable(@connection)operator(.)ident(sql_norow)operator(()ident(sql)operator(\)) comment(# Select into temp table) - instance_variable(@logger)operator(.)ident(debug) stringcontent( or fewer rows from #artemp)delimiter(")> reserved(if) instance_variable(@logger) - instance_variable(@connection)operator(.)ident(set_rowcount)operator(()instance_variable(@offset) operator(||) integer(0)operator(\)) - instance_variable(@connection)operator(.)ident(sql_norow)operator(()stringoperator(\)) comment(# Delete leading rows) - instance_variable(@connection)operator(.)ident(set_rowcount)operator(()integer(0)operator(\)) - instance_variable(@connection)operator(.)ident(sql)operator(()stringoperator(\)) comment(# Return the rest) - reserved(end) - reserved(end) - - ident(rows) operator(=) operator([)operator(]) - reserved(if) instance_variable(@connection)operator(.)ident(context)operator(.)ident(failed?) reserved(or) instance_variable(@connection)operator(.)ident(cmd_fail?) - ident(raise) constant(StatementInvalid)operator(,) stringcontent(: )inlinechar(\\n)content(Message: )inlinedelimiter(")> - reserved(else) - ident(results) operator(=) instance_variable(@connection)operator(.)ident(top_row_result) - reserved(if) ident(results) operator(&&) ident(results)operator(.)ident(rows)operator(.)ident(length) operator(>) integer(0) - ident(fields) operator(=) ident(fixup_column_names)operator(()ident(results)operator(.)ident(columns)operator(\)) - ident(results)operator(.)ident(rows)operator(.)ident(each) reserved(do) operator(|)ident(row)operator(|) - ident(hashed_row) operator(=) operator({)operator(}) - ident(row)operator(.)ident(zip)operator(()ident(fields)operator(\)) operator({) operator(|)ident(cell)operator(,) ident(column)operator(|) ident(hashed_row)operator([)ident(column)operator(]) operator(=) ident(cell) operator(}) - ident(rows) operator(<<) ident(hashed_row) - reserved(end) - reserved(end) - reserved(end) - instance_variable(@connection)operator(.)ident(sql_norow)operator(()stringoperator(\)) reserved(if) operator(!)ident(normal_select?) - instance_variable(@limit) operator(=) instance_variable(@offset) operator(=) pre_constant(nil) - reserved(return) ident(rows) - reserved(end) - - reserved(def) method(enable_identity_insert)operator(()ident(table_name)operator(,) ident(enable) operator(=) pre_constant(true)operator(\)) - reserved(if) ident(has_identity_column)operator(()ident(table_name)operator(\)) - stringcontent( )inline operator(:) stringinline_delimiter(})>delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(get_table_name)operator(()ident(sql)operator(\)) - reserved(if) ident(sql) operator(=)operator(~) regexp - global_variable($1) - reserved(elsif) ident(sql) operator(=)operator(~) regexp - global_variable($1) - reserved(else) - pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(has_identity_column)operator(()ident(table_name)operator(\)) - operator(!)ident(get_identity_column)operator(()ident(table_name)operator(\))operator(.)ident(nil?) - reserved(end) - - reserved(def) method(get_identity_column)operator(()ident(table_name)operator(\)) - instance_variable(@table_columns) operator(=) operator({)operator(}) reserved(unless) instance_variable(@table_columns) - instance_variable(@table_columns)operator([)ident(table_name)operator(]) operator(=) ident(columns)operator(()ident(table_name)operator(\)) reserved(if) instance_variable(@table_columns)operator([)ident(table_name)operator(]) operator(==) pre_constant(nil) - instance_variable(@table_columns)operator([)ident(table_name)operator(])operator(.)ident(each) reserved(do) operator(|)ident(col)operator(|) - reserved(return) ident(col)operator(.)ident(name) reserved(if) ident(col)operator(.)ident(identity) - reserved(end) - - reserved(return) pre_constant(nil) - reserved(end) - - reserved(def) method(query_contains_identity_column)operator(()ident(sql)operator(,) ident(col)operator(\)) - ident(sql) operator(=)operator(~) regexpchar(\\])delimiter(/)> - reserved(end) - - comment(# Remove trailing _ from names.) - reserved(def) method(fixup_column_names)operator(()ident(columns)operator(\)) - ident(columns)operator(.)ident(map) operator({) operator(|)ident(column)operator(|) ident(column)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) operator(}) - reserved(end) - - reserved(def) method(table_structure)operator(()ident(table_name)operator(\)) - ident(sql) operator(=) stringstring - ident(log)operator(()ident(sql)operator(,) stringoperator(\)) reserved(do) - instance_variable(@connection)operator(.)ident(set_rowcount)operator(()integer(0)operator(\)) - instance_variable(@connection)operator(.)ident(sql)operator(()ident(sql)operator(\)) - reserved(end) - reserved(if) instance_variable(@connection)operator(.)ident(context)operator(.)ident(failed?) - ident(raise) stringcontent( failed)char(\\n)content(Message: )inlinedelimiter(")> - reserved(elsif) operator(!)instance_variable(@connection)operator(.)ident(cmd_fail?) - ident(columns) operator(=) operator([)operator(]) - ident(results) operator(=) instance_variable(@connection)operator(.)ident(top_row_result) - ident(results)operator(.)ident(rows)operator(.)ident(each) reserved(do) operator(|)ident(row)operator(|) - ident(name)operator(,) ident(type)operator(,) ident(prec)operator(,) ident(scale)operator(,) ident(length)operator(,) ident(status)operator(,) ident(sysstat2)operator(,) ident(default) operator(=) ident(row) - ident(type) operator(=) ident(normalize_type)operator(()ident(type)operator(,) ident(prec)operator(,) ident(scale)operator(,) ident(length)operator(\)) - ident(default_value) operator(=) pre_constant(nil) - ident(name)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(if) ident(default) operator(=)operator(~) regexp - ident(default_value) operator(=) global_variable($1)operator(.)ident(strip) - ident(default_value) operator(=) ident(default_value)operator([)integer(1)operator(...)integer(-1)operator(]) reserved(if) ident(default_value) operator(=)operator(~) regexp - reserved(end) - ident(nullable) operator(=) operator(()ident(status) operator(&) integer(8)operator(\)) operator(==) integer(8) - ident(identity) operator(=) ident(status) operator(>)operator(=) integer(128) - ident(primary) operator(=) operator(()ident(sysstat2) operator(&) integer(8)operator(\)) operator(==) integer(8) - - ident(columns) operator(<<) operator([)ident(name)operator(,) ident(default_value)operator(,) ident(type)operator(,) ident(nullable)operator(,) ident(identity)operator(,) ident(primary)operator(]) - reserved(end) - ident(columns) - reserved(else) - pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(normalize_type)operator(()ident(field_type)operator(,) ident(prec)operator(,) ident(scale)operator(,) ident(length)operator(\)) - reserved(if) ident(field_type) operator(=)operator(~) regexp reserved(and) operator(()ident(scale)operator(.)ident(nil?) reserved(or) ident(scale) operator(==) integer(0)operator(\)) - ident(type) operator(=) string - reserved(elsif) ident(field_type) operator(=)operator(~) regexp - ident(type) operator(=) string - reserved(else) - ident(type) operator(=) ident(field_type) - reserved(end) - ident(size) operator(=) string - reserved(if) ident(prec) - ident(size) operator(=) stringcontent(\))delimiter(")> - reserved(elsif) ident(length) - ident(size) operator(=) stringcontent(\))delimiter(")> - reserved(end) - reserved(return) ident(type) operator(+) ident(size) - reserved(end) - - reserved(def) method(default_value)operator(()ident(value)operator(\)) - reserved(end) - reserved(end) comment(# class SybaseAdapter) - - reserved(class) class(SybaseAdapterContext) operator(<) constant(SybSQLContext) - constant(DEADLOCK) operator(=) integer(1205) - ident(attr_reader) symbol(:message) - - reserved(def) method(init)operator(()ident(logger) operator(=) pre_constant(nil)operator(\)) - instance_variable(@deadlocked) operator(=) pre_constant(false) - instance_variable(@failed) operator(=) pre_constant(false) - instance_variable(@logger) operator(=) ident(logger) - instance_variable(@message) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(srvmsgCB)operator(()ident(con)operator(,) ident(msg)operator(\)) - comment(# Do not log change of context messages.) - reserved(if) ident(msg)operator([)stringoperator(]) operator(==) integer(10) reserved(or) ident(msg)operator([)stringoperator(]) operator(==) integer(0) - reserved(return) pre_constant(true) - reserved(end) - - reserved(if) ident(msg)operator([)stringoperator(]) operator(==) constant(DEADLOCK) - instance_variable(@deadlocked) operator(=) pre_constant(true) - reserved(else) - instance_variable(@logger)operator(.)ident(info) string reserved(if) instance_variable(@logger) - instance_variable(@failed) operator(=) pre_constant(true) - reserved(end) - - reserved(if) instance_variable(@logger) - instance_variable(@logger)operator(.)ident(error) string - instance_variable(@logger)operator(.)ident(error) stringoperator(])inline_delimiter(})>content( Severity )inlineoperator(])inline_delimiter(})>content( State )inlineoperator(])inline_delimiter(})>content( Line )inlineoperator(])inline_delimiter(})>delimiter(")> - instance_variable(@logger)operator(.)ident(error) stringoperator(])inline_delimiter(})>delimiter(")> - instance_variable(@logger)operator(.)ident(error) stringoperator(])inline_delimiter(})>delimiter(")> - instance_variable(@logger)operator(.)ident(error) stringoperator(])inline_delimiter(})>delimiter(")> - reserved(end) - - instance_variable(@message) operator(=) ident(msg)operator([)stringoperator(]) - - pre_constant(true) - reserved(end) - - reserved(def) method(deadlocked?) - instance_variable(@deadlocked) - reserved(end) - - reserved(def) method(failed?) - instance_variable(@failed) - reserved(end) - - reserved(def) method(reset) - instance_variable(@deadlocked) operator(=) pre_constant(false) - instance_variable(@failed) operator(=) pre_constant(false) - instance_variable(@message) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(cltmsgCB)operator(()ident(con)operator(,) ident(msg)operator(\)) - reserved(return) pre_constant(true) reserved(unless) operator(() ident(msg)operator(.)ident(kind_of?)operator(()constant(Hash)operator(\)) operator(\)) - reserved(unless) operator(() ident(msg)operator([) string operator(]) operator(\)) reserved(then) - reserved(return) pre_constant(true) - reserved(end) - - reserved(if) instance_variable(@logger) - instance_variable(@logger)operator(.)ident(error) string - instance_variable(@logger)operator(.)ident(error) string operator(])inline_delimiter(})>content( ORIGIN=)inline operator(])inline_delimiter(})>content( SEVERITY=)inline operator(])inline_delimiter(})>content( NUMBER=)inline operator(])inline_delimiter(})>delimiter(")> - instance_variable(@logger)operator(.)ident(error) stringoperator(])inline_delimiter(})>delimiter(")> - instance_variable(@logger)operator(.)ident(error) stringoperator(])inline_delimiter(})>delimiter(")> - - instance_variable(@message) operator(=) ident(msg)operator([)stringoperator(]) - reserved(end) - - instance_variable(@failed) operator(=) pre_constant(true) - - comment(# Not retry , CS_CV_RETRY_FAIL( probability TimeOut \) ) - reserved(if)operator(() ident(msg)operator([) string operator(]) operator(==) string operator(\)) reserved(then) - instance_variable(@timeout_p) operator(=) pre_constant(true) - reserved(return) pre_constant(false) - reserved(end) - - reserved(return) pre_constant(true) - reserved(end) - reserved(end) comment(# class SybaseAdapterContext) - - reserved(end) comment(# module ConnectionAdapters) -reserved(end) comment(# module ActiveRecord) - - -comment(# Allow identity inserts for fixtures.) -ident(require) string -reserved(class) class(Fixtures) - reserved(alias) symbol(:original_insert_fixtures) symbol(:insert_fixtures) - - reserved(def) method(insert_fixtures) - ident(values)operator(.)ident(each) reserved(do) operator(|)ident(fixture)operator(|) - ident(allow_identity_inserts) ident(table_name)operator(,) pre_constant(true) - instance_variable(@connection)operator(.)ident(execute) stringcontent( ()inlinecontent(\) VALUES ()inlinecontent(\))delimiter(")>operator(,) string - ident(allow_identity_inserts) ident(table_name)operator(,) pre_constant(false) - reserved(end) - reserved(end) - - reserved(def) method(allow_identity_inserts)operator(()ident(table_name)operator(,) ident(enable)operator(\)) - instance_variable(@connection)operator(.)ident(execute) stringcontent( )inline operator(:) stringinline_delimiter(})>delimiter(")> reserved(rescue) pre_constant(nil) - reserved(end) -reserved(end) - -reserved(rescue) constant(LoadError) operator(=)operator(>) ident(cannot_require_sybase) - comment(# Couldn't load sybase adapter) -ident(endmodule) constant(ActiveRecord) - reserved(module) class(Associations) comment(# :nodoc:) - reserved(module) class(ClassMethods) - reserved(def) method(deprecated_collection_count_method)operator(()ident(collection_name)operator(\))comment(# :nodoc:) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent(_count(force_reload = false\) - )inlinecontent(.reload if force_reload - )inlinecontent(.size - end)delimiter( - end_eval)> - reserved(end) - - reserved(def) method(deprecated_add_association_relation)operator(()ident(association_name)operator(\))comment(# :nodoc:) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent((*items\) - )inlinecontent(.concat(items\) - end)delimiter( - end_eval)> - reserved(end) - - reserved(def) method(deprecated_remove_association_relation)operator(()ident(association_name)operator(\))comment(# :nodoc:) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent((*items\) - )inlinecontent(.delete(items\) - end)delimiter( - end_eval)> - reserved(end) - - reserved(def) method(deprecated_has_collection_method)operator(()ident(collection_name)operator(\))comment(# :nodoc:) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent(?(force_reload = false\) - !)inlinecontent((force_reload\).empty? - end)delimiter( - end_eval)> - reserved(end) - - reserved(def) method(deprecated_find_in_collection_method)operator(()ident(collection_name)operator(\))comment(# :nodoc:) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent((association_id\) - )inlinecontent(.find(association_id\) - end)delimiter( - end_eval)> - reserved(end) - - reserved(def) method(deprecated_find_all_in_collection_method)operator(()ident(collection_name)operator(\))comment(# :nodoc:) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent((runtime_conditions = nil, orderings = nil, limit = nil, joins = nil\) - )inlinecontent(.find_all(runtime_conditions, orderings, limit, joins\) - end)delimiter( - end_eval)> - reserved(end) - - reserved(def) method(deprecated_collection_create_method)operator(()ident(collection_name)operator(\))comment(# :nodoc:) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent((attributes = {}\) - )inlinecontent(.create(attributes\) - end)delimiter( - end_eval)> - reserved(end) - - reserved(def) method(deprecated_collection_build_method)operator(()ident(collection_name)operator(\))comment(# :nodoc:) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent((attributes = {}\) - )inlinecontent(.build(attributes\) - end)delimiter( - end_eval)> - reserved(end) - - reserved(def) method(deprecated_association_comparison_method)operator(()ident(association_name)operator(,) ident(association_class_name)operator(\)) comment(# :nodoc:) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent(?(comparison_object, force_reload = false\) - if comparison_object.kind_of?()inlinecontent(\) - )inlinecontent((force_reload\) == comparison_object - else - raise "Comparison object is a )inlinecontent(, should have been )char(\\#)content({comparison_object.class.name}" - end - end)delimiter( - end_eval)> - reserved(end) - - reserved(def) method(deprecated_has_association_method)operator(()ident(association_name)operator(\)) comment(# :nodoc:) - ident(module_eval) stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)stringcontent(?(force_reload = false\) - !)inlinecontent((force_reload\).nil? - end)delimiter( - end_eval)> - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(class) class(Base) - reserved(class) operator(<<) class(self) - comment(# This method is deprecated in favor of find with the :conditions option.) - comment(#) - comment(# Works like find, but the record matching +id+ must also meet the +conditions+.) - comment(# +RecordNotFound+ is raised if no record can be found matching the +id+ or meeting the condition.) - comment(# Example:) - comment(# Person.find_on_conditions 5, "first_name LIKE '%dav%' AND last_name = 'heinemeier'") - reserved(def) method(find_on_conditions)operator(()ident(ids)operator(,) ident(conditions)operator(\)) comment(# :nodoc:) - ident(find)operator(()ident(ids)operator(,) symbol(:conditions) operator(=)operator(>) ident(conditions)operator(\)) - reserved(end) - - comment(# This method is deprecated in favor of find(:first, options\).) - comment(#) - comment(# Returns the object for the first record responding to the conditions in +conditions+, ) - comment(# such as "group = 'master'". If more than one record is returned from the query, it's the first that'll) - comment(# be used to create the object. In such cases, it might be beneficial to also specify ) - comment(# +orderings+, like "income DESC, name", to control exactly which record is to be used. Example: ) - comment(# Employee.find_first "income > 50000", "income DESC, name") - reserved(def) method(find_first)operator(()ident(conditions) operator(=) pre_constant(nil)operator(,) ident(orderings) operator(=) pre_constant(nil)operator(,) ident(joins) operator(=) pre_constant(nil)operator(\)) comment(# :nodoc:) - ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) ident(conditions)operator(,) symbol(:order) operator(=)operator(>) ident(orderings)operator(,) symbol(:joins) operator(=)operator(>) ident(joins)operator(\)) - reserved(end) - - comment(# This method is deprecated in favor of find(:all, options\).) - comment(#) - comment(# Returns an array of all the objects that could be instantiated from the associated) - comment(# table in the database. The +conditions+ can be used to narrow the selection of objects (WHERE-part\),) - comment(# such as by "color = 'red'", and arrangement of the selection can be done through +orderings+ (ORDER BY-part\),) - comment(# such as by "last_name, first_name DESC". A maximum of returned objects and their offset can be specified in ) - comment(# +limit+ with either just a single integer as the limit or as an array with the first element as the limit, ) - comment(# the second as the offset. Examples:) - comment(# Project.find_all "category = 'accounts'", "last_accessed DESC", 15) - comment(# Project.find_all ["category = ?", category_name], "created ASC", [15, 20]) - reserved(def) method(find_all)operator(()ident(conditions) operator(=) pre_constant(nil)operator(,) ident(orderings) operator(=) pre_constant(nil)operator(,) ident(limit) operator(=) pre_constant(nil)operator(,) ident(joins) operator(=) pre_constant(nil)operator(\)) comment(# :nodoc:) - ident(limit)operator(,) ident(offset) operator(=) ident(limit)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) operator(?) ident(limit) operator(:) operator([) ident(limit)operator(,) pre_constant(nil) operator(]) - ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) ident(conditions)operator(,) symbol(:order) operator(=)operator(>) ident(orderings)operator(,) symbol(:joins) operator(=)operator(>) ident(joins)operator(,) symbol(:limit) operator(=)operator(>) ident(limit)operator(,) symbol(:offset) operator(=)operator(>) ident(offset)operator(\)) - reserved(end) - reserved(end) - reserved(end) -ident(endrequire) string -ident(require) string -ident(require) string - -reserved(module) class(YAML) comment(#:nodoc:) - reserved(class) class(Omap) comment(#:nodoc:) - reserved(def) method(keys)operator(;) ident(map) operator({) operator(|)ident(k)operator(,) ident(v)operator(|) ident(k) operator(}) reserved(end) - reserved(def) method(values)operator(;) ident(map) operator({) operator(|)ident(k)operator(,) ident(v)operator(|) ident(v) operator(}) reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(FixtureClassNotFound) operator(<) constant(ActiveRecord)operator(::)constant(ActiveRecordError) comment(#:nodoc:) -reserved(end) - -comment(# Fixtures are a way of organizing data that you want to test against; in short, sample data. They come in 3 flavours:) -comment(#) -comment(# 1. YAML fixtures) -comment(# 2. CSV fixtures) -comment(# 3. Single-file fixtures) -comment(#) -comment(# = YAML fixtures) -comment(#) -comment(# This type of fixture is in YAML format and the preferred default. YAML is a file format which describes data structures) -comment(# in a non-verbose, humanly-readable format. It ships with Ruby 1.8.1+.) -comment(#) -comment(# Unlike single-file fixtures, YAML fixtures are stored in a single file per model, which are placed in the directory appointed) -comment(# by Test::Unit::TestCase.fixture_path=(path\) (this is automatically configured for Rails, so you can just) -comment(# put your files in /test/fixtures/\). The fixture file ends with the .yml file extension (Rails example:) -comment(# "/test/fixtures/web_sites.yml"\). The format of a YAML fixture file looks like this:) -comment(#) -comment(# rubyonrails:) -comment(# id: 1) -comment(# name: Ruby on Rails) -comment(# url: http://www.rubyonrails.org) -comment(#) -comment(# google:) -comment(# id: 2) -comment(# name: Google) -comment(# url: http://www.google.com) -comment(#) -comment(# This YAML fixture file includes two fixtures. Each YAML fixture (ie. record\) is given a name and is followed by an) -comment(# indented list of key/value pairs in the "key: value" format. Records are separated by a blank line for your viewing) -comment(# pleasure.) -comment(#) -comment(# Note that YAML fixtures are unordered. If you want ordered fixtures, use the omap YAML type. See http://yaml.org/type/omap.html) -comment(# for the specification. You will need ordered fixtures when you have foreign key constraints on keys in the same table.) -comment(# This is commonly needed for tree structures. Example:) -comment(#) -comment(# --- !omap) -comment(# - parent:) -comment(# id: 1) -comment(# parent_id: NULL) -comment(# title: Parent) -comment(# - child:) -comment(# id: 2) -comment(# parent_id: 1) -comment(# title: Child) -comment(#) -comment(# = CSV fixtures) -comment(#) -comment(# Fixtures can also be kept in the Comma Separated Value format. Akin to YAML fixtures, CSV fixtures are stored) -comment(# in a single file, but instead end with the .csv file extension (Rails example: "/test/fixtures/web_sites.csv"\)) -comment(#) -comment(# The format of this type of fixture file is much more compact than the others, but also a little harder to read by us) -comment(# humans. The first line of the CSV file is a comma-separated list of field names. The rest of the file is then comprised) -comment(# of the actual data (1 per line\). Here's an example:) -comment(#) -comment(# id, name, url) -comment(# 1, Ruby On Rails, http://www.rubyonrails.org) -comment(# 2, Google, http://www.google.com) -comment(#) -comment(# Should you have a piece of data with a comma character in it, you can place double quotes around that value. If you) -comment(# need to use a double quote character, you must escape it with another double quote.) -comment(#) -comment(# Another unique attribute of the CSV fixture is that it has *no* fixture name like the other two formats. Instead, the) -comment(# fixture names are automatically generated by deriving the class name of the fixture file and adding an incrementing) -comment(# number to the end. In our example, the 1st fixture would be called "web_site_1" and the 2nd one would be called) -comment(# "web_site_2".) -comment(#) -comment(# Most databases and spreadsheets support exporting to CSV format, so this is a great format for you to choose if you) -comment(# have existing data somewhere already.) -comment(#) -comment(# = Single-file fixtures) -comment(#) -comment(# This type of fixtures was the original format for Active Record that has since been deprecated in favor of the YAML and CSV formats.) -comment(# Fixtures for this format are created by placing text files in a sub-directory (with the name of the model\) to the directory) -comment(# appointed by Test::Unit::TestCase.fixture_path=(path\) (this is automatically configured for Rails, so you can just) -comment(# put your files in /test/fixtures// -- like /test/fixtures/web_sites/ for the WebSite) -comment(# model\).) -comment(#) -comment(# Each text file placed in this directory represents a "record". Usually these types of fixtures are named without) -comment(# extensions, but if you are on a Windows machine, you might consider adding .txt as the extension. Here's what the) -comment(# above example might look like:) -comment(#) -comment(# web_sites/google) -comment(# web_sites/yahoo.txt) -comment(# web_sites/ruby-on-rails) -comment(#) -comment(# The file format of a standard fixture is simple. Each line is a property (or column in db speak\) and has the syntax) -comment(# of "name => value". Here's an example of the ruby-on-rails fixture above:) -comment(#) -comment(# id => 1) -comment(# name => Ruby on Rails) -comment(# url => http://www.rubyonrails.org) -comment(#) -comment(# = Using Fixtures) -comment(#) -comment(# Since fixtures are a testing construct, we use them in our unit and functional tests. There are two ways to use the) -comment(# fixtures, but first let's take a look at a sample unit test found:) -comment(#) -comment(# require 'web_site') -comment(#) -comment(# class WebSiteTest < Test::Unit::TestCase) -comment(# def test_web_site_count) -comment(# assert_equal 2, WebSite.count) -comment(# end) -comment(# end) -comment(#) -comment(# As it stands, unless we pre-load the web_site table in our database with two records, this test will fail. Here's the) -comment(# easiest way to add fixtures to the database:) -comment(#) -comment(# ...) -comment(# class WebSiteTest < Test::Unit::TestCase) -comment(# fixtures :web_sites # add more by separating the symbols with commas) -comment(# ...) -comment(#) -comment(# By adding a "fixtures" method to the test case and passing it a list of symbols (only one is shown here tho\), we trigger) -comment(# the testing environment to automatically load the appropriate fixtures into the database before each test. ) -comment(# To ensure consistent data, the environment deletes the fixtures before running the load.) -comment(#) -comment(# In addition to being available in the database, the fixtures are also loaded into a hash stored in an instance variable) -comment(# of the test case. It is named after the symbol... so, in our example, there would be a hash available called) -comment(# @web_sites. This is where the "fixture name" comes into play.) -comment(#) -comment(# On top of that, each record is automatically "found" (using Model.find(id\)\) and placed in the instance variable of its name.) -comment(# So for the YAML fixtures, we'd get @rubyonrails and @google, which could be interrogated using regular Active Record semantics:) -comment(#) -comment(# # test if the object created from the fixture data has the same attributes as the data itself) -comment(# def test_find) -comment(# assert_equal @web_sites["rubyonrails"]["name"], @rubyonrails.name) -comment(# end) -comment(#) -comment(# As seen above, the data hash created from the YAML fixtures would have @web_sites["rubyonrails"]["url"] return) -comment(# "http://www.rubyonrails.org" and @web_sites["google"]["name"] would return "Google". The same fixtures, but loaded) -comment(# from a CSV fixture file, would be accessible via @web_sites["web_site_1"]["name"] == "Ruby on Rails" and have the individual) -comment(# fixtures available as instance variables @web_site_1 and @web_site_2.) -comment(#) -comment(# If you do not wish to use instantiated fixtures (usually for performance reasons\) there are two options.) -comment(#) -comment(# - to completely disable instantiated fixtures:) -comment(# self.use_instantiated_fixtures = false) -comment(#) -comment(# - to keep the fixture instance (@web_sites\) available, but do not automatically 'find' each instance:) -comment(# self.use_instantiated_fixtures = :no_instances ) -comment(#) -comment(# Even if auto-instantiated fixtures are disabled, you can still access them) -comment(# by name via special dynamic methods. Each method has the same name as the) -comment(# model, and accepts the name of the fixture to instantiate:) -comment(#) -comment(# fixtures :web_sites) -comment(#) -comment(# def test_find) -comment(# assert_equal "Ruby on Rails", web_sites(:rubyonrails\).name) -comment(# end) -comment(#) -comment(# = Dynamic fixtures with ERb) -comment(#) -comment(# Some times you don't care about the content of the fixtures as much as you care about the volume. In these cases, you can) -comment(# mix ERb in with your YAML or CSV fixtures to create a bunch of fixtures for load testing, like:) -comment(#) -comment(# <% for i in 1..1000 %>) -comment(# fix_<%= i %>:) -comment(# id: <%= i %>) -comment(# name: guy_<%= 1 %>) -comment(# <% end %>) -comment(#) -comment(# This will create 1000 very simple YAML fixtures.) -comment(#) -comment(# Using ERb, you can also inject dynamic values into your fixtures with inserts like <%= Date.today.strftime("%Y-%m-%d"\) %>.) -comment(# This is however a feature to be used with some caution. The point of fixtures are that they're stable units of predictable) -comment(# sample data. If you feel that you need to inject dynamic values, then perhaps you should reexamine whether your application) -comment(# is properly testable. Hence, dynamic values in fixtures are to be considered a code smell.) -comment(#) -comment(# = Transactional fixtures) -comment(#) -comment(# TestCases can use begin+rollback to isolate their changes to the database instead of having to delete+insert for every test case. ) -comment(# They can also turn off auto-instantiation of fixture data since the feature is costly and often unused.) -comment(#) -comment(# class FooTest < Test::Unit::TestCase) -comment(# self.use_transactional_fixtures = true) -comment(# self.use_instantiated_fixtures = false) -comment(# ) -comment(# fixtures :foos) -comment(# ) -comment(# def test_godzilla) -comment(# assert !Foo.find(:all\).empty?) -comment(# Foo.destroy_all) -comment(# assert Foo.find(:all\).empty?) -comment(# end) -comment(# ) -comment(# def test_godzilla_aftermath) -comment(# assert !Foo.find(:all\).empty?) -comment(# end) -comment(# end) -comment(# ) -comment(# If you preload your test database with all fixture data (probably in the Rakefile task\) and use transactional fixtures, ) -comment(# then you may omit all fixtures declarations in your test cases since all the data's already there and every case rolls back its changes.) -comment(#) -comment(# In order to use instantiated fixtures with preloaded data, set +self.pre_loaded_fixtures+ to true. This will provide ) -comment(# access to fixture data for every table that has been loaded through fixtures (depending on the value of +use_instantiated_fixtures+\)) -comment(#) -comment(# When *not* to use transactional fixtures: ) -comment(# 1. You're testing whether a transaction works correctly. Nested transactions don't commit until all parent transactions commit, ) -comment(# particularly, the fixtures transaction which is begun in setup and rolled back in teardown. Thus, you won't be able to verify ) -comment(# the results of your transaction until Active Record supports nested transactions or savepoints (in progress.\) ) -comment(# 2. Your database does not support transactions. Every Active Record database supports transactions except MySQL MyISAM. ) -comment(# Use InnoDB, MaxDB, or NDB instead.) -reserved(class) class(Fixtures) operator(<) constant(YAML)operator(::)constant(Omap) - constant(DEFAULT_FILTER_RE) operator(=) regexp - - reserved(def) pre_constant(self)operator(.)method(instantiate_fixtures)operator(()ident(object)operator(,) ident(table_name)operator(,) ident(fixtures)operator(,) ident(load_instances)operator(=)pre_constant(true)operator(\)) - ident(object)operator(.)ident(instance_variable_set) stringoperator(,)stringoperator(\))inline_delimiter(})>delimiter(")>operator(,) ident(fixtures) - reserved(if) ident(load_instances) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(silence) reserved(do) - ident(fixtures)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(fixture)operator(|) - reserved(begin) - ident(object)operator(.)ident(instance_variable_set) stringdelimiter(")>operator(,) ident(fixture)operator(.)ident(find) - reserved(rescue) constant(FixtureClassNotFound) - pre_constant(nil) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(instantiate_all_loaded_fixtures)operator(()ident(object)operator(,) ident(load_instances)operator(=)pre_constant(true)operator(\)) - ident(all_loaded_fixtures)operator(.)ident(each) reserved(do) operator(|)ident(table_name)operator(,) ident(fixtures)operator(|) - constant(Fixtures)operator(.)ident(instantiate_fixtures)operator(()ident(object)operator(,) ident(table_name)operator(,) ident(fixtures)operator(,) ident(load_instances)operator(\)) - reserved(end) - reserved(end) - - ident(cattr_accessor) symbol(:all_loaded_fixtures) - pre_constant(self)operator(.)ident(all_loaded_fixtures) operator(=) operator({)operator(}) - - reserved(def) pre_constant(self)operator(.)method(create_fixtures)operator(()ident(fixtures_directory)operator(,) ident(table_names)operator(,) ident(class_names) operator(=) operator({)operator(})operator(\)) - ident(table_names) operator(=) operator([)ident(table_names)operator(])operator(.)ident(flatten)operator(.)ident(map) operator({) operator(|)ident(n)operator(|) ident(n)operator(.)ident(to_s) operator(}) - ident(connection) operator(=) ident(block_given?) operator(?) reserved(yield) operator(:) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(silence) reserved(do) - ident(fixtures_map) operator(=) operator({)operator(}) - ident(fixtures) operator(=) ident(table_names)operator(.)ident(map) reserved(do) operator(|)ident(table_name)operator(|) - ident(fixtures_map)operator([)ident(table_name)operator(]) operator(=) constant(Fixtures)operator(.)ident(new)operator(()ident(connection)operator(,) constant(File)operator(.)ident(split)operator(()ident(table_name)operator(.)ident(to_s)operator(\))operator(.)ident(last)operator(,) ident(class_names)operator([)ident(table_name)operator(.)ident(to_sym)operator(])operator(,) constant(File)operator(.)ident(join)operator(()ident(fixtures_directory)operator(,) ident(table_name)operator(.)ident(to_s)operator(\))operator(\)) - reserved(end) - ident(all_loaded_fixtures)operator(.)ident(merge!) ident(fixtures_map) - - ident(connection)operator(.)ident(transaction) reserved(do) - ident(fixtures)operator(.)ident(reverse)operator(.)ident(each) operator({) operator(|)ident(fixture)operator(|) ident(fixture)operator(.)ident(delete_existing_fixtures) operator(}) - ident(fixtures)operator(.)ident(each) operator({) operator(|)ident(fixture)operator(|) ident(fixture)operator(.)ident(insert_fixtures) operator(}) - - comment(# Cap primary key sequences to max(pk\).) - reserved(if) ident(connection)operator(.)ident(respond_to?)operator(()symbol(:reset_pk_sequence!)operator(\)) - ident(table_names)operator(.)ident(each) reserved(do) operator(|)ident(table_name)operator(|) - ident(connection)operator(.)ident(reset_pk_sequence!)operator(()ident(table_name)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(return) ident(fixtures)operator(.)ident(size) operator(>) integer(1) operator(?) ident(fixtures) operator(:) ident(fixtures)operator(.)ident(first) - reserved(end) - reserved(end) - - - ident(attr_reader) symbol(:table_name) - - reserved(def) method(initialize)operator(()ident(connection)operator(,) ident(table_name)operator(,) ident(class_name)operator(,) ident(fixture_path)operator(,) ident(file_filter) operator(=) constant(DEFAULT_FILTER_RE)operator(\)) - instance_variable(@connection)operator(,) instance_variable(@table_name)operator(,) instance_variable(@fixture_path)operator(,) instance_variable(@file_filter) operator(=) ident(connection)operator(,) ident(table_name)operator(,) ident(fixture_path)operator(,) ident(file_filter) - instance_variable(@class_name) operator(=) ident(class_name) operator(||) - operator(()constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(pluralize_table_names) operator(?) instance_variable(@table_name)operator(.)ident(singularize)operator(.)ident(camelize) operator(:) instance_variable(@table_name)operator(.)ident(camelize)operator(\)) - instance_variable(@table_name) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(+) instance_variable(@table_name) operator(+) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) - ident(read_fixture_files) - reserved(end) - - reserved(def) method(delete_existing_fixtures) - instance_variable(@connection)operator(.)ident(delete) stringdelimiter(")>operator(,) string - reserved(end) - - reserved(def) method(insert_fixtures) - ident(values)operator(.)ident(each) reserved(do) operator(|)ident(fixture)operator(|) - instance_variable(@connection)operator(.)ident(execute) stringcontent( ()inlinecontent(\) VALUES ()inlinecontent(\))delimiter(")>operator(,) string - reserved(end) - reserved(end) - - ident(private) - - reserved(def) method(read_fixture_files) - reserved(if) constant(File)operator(.)ident(file?)operator(()ident(yaml_file_path)operator(\)) - comment(# YAML fixtures) - reserved(begin) - ident(yaml_string) operator(=) string - constant(Dir)operator([)stringcontent(/**/*.yml)delimiter(")>operator(])operator(.)ident(select) operator({)operator(|)ident(f)operator(|) ident(test)operator(()integer(?f)operator(,)ident(f)operator(\)) operator(})operator(.)ident(each) reserved(do) operator(|)ident(subfixture_path)operator(|) - ident(yaml_string) operator(<<) constant(IO)operator(.)ident(read)operator(()ident(subfixture_path)operator(\)) - reserved(end) - ident(yaml_string) operator(<<) constant(IO)operator(.)ident(read)operator(()ident(yaml_file_path)operator(\)) - - reserved(if) ident(yaml) operator(=) constant(YAML)operator(::)ident(load)operator(()ident(erb_render)operator(()ident(yaml_string)operator(\))operator(\)) - ident(yaml) operator(=) ident(yaml)operator(.)ident(value) reserved(if) ident(yaml)operator(.)ident(respond_to?)operator(()symbol(:type_id)operator(\)) reserved(and) ident(yaml)operator(.)ident(respond_to?)operator(()symbol(:value)operator(\)) - ident(yaml)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(data)operator(|) - pre_constant(self)operator([)ident(name)operator(]) operator(=) constant(Fixture)operator(.)ident(new)operator(()ident(data)operator(,) instance_variable(@class_name)operator(\)) - reserved(end) - reserved(end) - reserved(rescue) constant(Exception)operator(=)operator(>)ident(boom) - ident(raise) constant(Fixture)operator(::)constant(FormatError)operator(,) stringcontent(. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html)char(\\n)content(The exact error was:)char(\\n)content( )inlinecontent(: )inlinedelimiter(")> - reserved(end) - reserved(elsif) constant(File)operator(.)ident(file?)operator(()ident(csv_file_path)operator(\)) - comment(# CSV fixtures) - ident(reader) operator(=) constant(CSV)operator(::)constant(Reader)operator(.)ident(create)operator(()ident(erb_render)operator(()constant(IO)operator(.)ident(read)operator(()ident(csv_file_path)operator(\))operator(\))operator(\)) - ident(header) operator(=) ident(reader)operator(.)ident(shift) - ident(i) operator(=) integer(0) - ident(reader)operator(.)ident(each) reserved(do) operator(|)ident(row)operator(|) - ident(data) operator(=) operator({)operator(}) - ident(row)operator(.)ident(each_with_index) operator({) operator(|)ident(cell)operator(,) ident(j)operator(|) ident(data)operator([)ident(header)operator([)ident(j)operator(])operator(.)ident(to_s)operator(.)ident(strip)operator(]) operator(=) ident(cell)operator(.)ident(to_s)operator(.)ident(strip) operator(}) - pre_constant(self)operator([)stringcontent(_)inlinedelimiter(")>operator(])operator(=) constant(Fixture)operator(.)ident(new)operator(()ident(data)operator(,) instance_variable(@class_name)operator(\)) - reserved(end) - reserved(elsif) constant(File)operator(.)ident(file?)operator(()ident(deprecated_yaml_file_path)operator(\)) - ident(raise) constant(Fixture)operator(::)constant(FormatError)operator(,) stringcontent( to )inlinedelimiter(")> - reserved(else) - comment(# Standard fixtures) - constant(Dir)operator(.)ident(entries)operator(()instance_variable(@fixture_path)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - ident(path) operator(=) constant(File)operator(.)ident(join)operator(()instance_variable(@fixture_path)operator(,) ident(file)operator(\)) - reserved(if) constant(File)operator(.)ident(file?)operator(()ident(path)operator(\)) reserved(and) ident(file) operator(!)operator(~) instance_variable(@file_filter) - pre_constant(self)operator([)ident(file)operator(]) operator(=) constant(Fixture)operator(.)ident(new)operator(()ident(path)operator(,) instance_variable(@class_name)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(yaml_file_path) - stringcontent(.yml)delimiter(")> - reserved(end) - - reserved(def) method(deprecated_yaml_file_path) - stringcontent(.yaml)delimiter(")> - reserved(end) - - reserved(def) method(csv_file_path) - instance_variable(@fixture_path) operator(+) string - reserved(end) - - reserved(def) method(yaml_fixtures_key)operator(()ident(path)operator(\)) - constant(File)operator(.)ident(basename)operator(()instance_variable(@fixture_path)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(first) - reserved(end) - - reserved(def) method(erb_render)operator(()ident(fixture_content)operator(\)) - constant(ERB)operator(.)ident(new)operator(()ident(fixture_content)operator(\))operator(.)ident(result) - reserved(end) -reserved(end) - -reserved(class) class(Fixture) comment(#:nodoc:) - ident(include) constant(Enumerable) - reserved(class) class(FixtureError) operator(<) constant(StandardError)comment(#:nodoc:) - reserved(end) - reserved(class) class(FormatError) operator(<) constant(FixtureError)comment(#:nodoc:) - reserved(end) - - reserved(def) method(initialize)operator(()ident(fixture)operator(,) ident(class_name)operator(\)) - reserved(case) ident(fixture) - reserved(when) constant(Hash)operator(,) constant(YAML)operator(::)constant(Omap) - instance_variable(@fixture) operator(=) ident(fixture) - reserved(when) constant(String) - instance_variable(@fixture) operator(=) ident(read_fixture_file)operator(()ident(fixture)operator(\)) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) stringdelimiter(")> - reserved(end) - - instance_variable(@class_name) operator(=) ident(class_name) - reserved(end) - - reserved(def) method(each) - instance_variable(@fixture)operator(.)ident(each) operator({) operator(|)ident(item)operator(|) reserved(yield) ident(item) operator(}) - reserved(end) - - reserved(def) method([])operator(()ident(key)operator(\)) - instance_variable(@fixture)operator([)ident(key)operator(]) - reserved(end) - - reserved(def) method(to_hash) - instance_variable(@fixture) - reserved(end) - - reserved(def) method(key_list) - ident(columns) operator(=) instance_variable(@fixture)operator(.)ident(keys)operator(.)ident(collect)operator({) operator(|)ident(column_name)operator(|) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(quote_column_name)operator(()ident(column_name)operator(\)) operator(}) - ident(columns)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(value_list) - instance_variable(@fixture)operator(.)ident(values)operator(.)ident(map) operator({) operator(|)ident(v)operator(|) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(quote)operator(()ident(v)operator(\))operator(.)ident(gsub)operator(()stringoperator(,) stringoperator(\))operator(.)ident(gsub)operator(()stringoperator(,) stringoperator(\)) operator(})operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(find) - ident(klass) operator(=) instance_variable(@class_name)operator(.)ident(is_a?)operator(()constant(Class)operator(\)) operator(?) instance_variable(@class_name) operator(:) constant(Object)operator(.)ident(const_get)operator(()instance_variable(@class_name)operator(\)) reserved(rescue) pre_constant(nil) - reserved(if) ident(klass) - ident(klass)operator(.)ident(find)operator(()pre_constant(self)operator([)ident(klass)operator(.)ident(primary_key)operator(])operator(\)) - reserved(else) - ident(raise) constant(FixtureClassNotFound)operator(,) stringcontent( was not found.)delimiter(")> - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(read_fixture_file)operator(()ident(fixture_file_path)operator(\)) - constant(IO)operator(.)ident(readlines)operator(()ident(fixture_file_path)operator(\))operator(.)ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(fixture)operator(,) ident(line)operator(|) - comment(# Mercifully skip empty lines.) - reserved(next) reserved(if) ident(line) operator(=)operator(~) regexp - - comment(# Use the same regular expression for attributes as Active Record.) - reserved(unless) ident(md) operator(=) regexp)char(\\s)content(*(.+\))char(\\s)content(*$)delimiter(/)>operator(.)ident(match)operator(()ident(line)operator(\)) - ident(raise) constant(FormatError)operator(,) stringcontent(: fixture format error at ')inlinecontent('. Expecting 'key => value'.)delimiter(")> - reserved(end) - ident(key)operator(,) ident(value) operator(=) ident(md)operator(.)ident(captures) - - comment(# Disallow duplicate keys to catch typos.) - ident(raise) constant(FormatError)operator(,) stringcontent(: duplicate ')inlinecontent(' in fixture.)delimiter(")> reserved(if) ident(fixture)operator([)ident(key)operator(]) - ident(fixture)operator([)ident(key)operator(]) operator(=) ident(value)operator(.)ident(strip) - ident(fixture) - reserved(end) - reserved(end) -reserved(end) - -reserved(module) class(Test) comment(#:nodoc:) - reserved(module) class(Unit) comment(#:nodoc:) - reserved(class) class(TestCase) comment(#:nodoc:) - ident(cattr_accessor) symbol(:fixture_path) - ident(class_inheritable_accessor) symbol(:fixture_table_names) - ident(class_inheritable_accessor) symbol(:fixture_class_names) - ident(class_inheritable_accessor) symbol(:use_transactional_fixtures) - ident(class_inheritable_accessor) symbol(:use_instantiated_fixtures) comment(# true, false, or :no_instances) - ident(class_inheritable_accessor) symbol(:pre_loaded_fixtures) - - pre_constant(self)operator(.)ident(fixture_table_names) operator(=) operator([)operator(]) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(false) - pre_constant(self)operator(.)ident(use_instantiated_fixtures) operator(=) pre_constant(true) - pre_constant(self)operator(.)ident(pre_loaded_fixtures) operator(=) pre_constant(false) - - pre_constant(self)operator(.)ident(fixture_class_names) operator(=) operator({)operator(}) - - class_variable(@@already_loaded_fixtures) operator(=) operator({)operator(}) - pre_constant(self)operator(.)ident(fixture_class_names) operator(=) operator({)operator(}) - - reserved(def) pre_constant(self)operator(.)method(set_fixture_class)operator(()ident(class_names) operator(=) operator({)operator(})operator(\)) - pre_constant(self)operator(.)ident(fixture_class_names) operator(=) pre_constant(self)operator(.)ident(fixture_class_names)operator(.)ident(merge)operator(()ident(class_names)operator(\)) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(fixtures)operator(()operator(*)ident(table_names)operator(\)) - ident(table_names) operator(=) ident(table_names)operator(.)ident(flatten)operator(.)ident(map) operator({) operator(|)ident(n)operator(|) ident(n)operator(.)ident(to_s) operator(}) - pre_constant(self)operator(.)ident(fixture_table_names) operator(|=) ident(table_names) - ident(require_fixture_classes)operator(()ident(table_names)operator(\)) - ident(setup_fixture_accessors)operator(()ident(table_names)operator(\)) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(require_fixture_classes)operator(()ident(table_names)operator(=)pre_constant(nil)operator(\)) - operator(()ident(table_names) operator(||) ident(fixture_table_names)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(table_name)operator(|) - ident(file_name) operator(=) ident(table_name)operator(.)ident(to_s) - ident(file_name) operator(=) ident(file_name)operator(.)ident(singularize) reserved(if) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(pluralize_table_names) - reserved(begin) - ident(require) ident(file_name) - reserved(rescue) constant(LoadError) - comment(# Let's hope the developer has included it himself) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(setup_fixture_accessors)operator(()ident(table_names)operator(=)pre_constant(nil)operator(\)) - operator(()ident(table_names) operator(||) ident(fixture_table_names)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(table_name)operator(|) - ident(table_name) operator(=) ident(table_name)operator(.)ident(to_s)operator(.)ident(tr)operator(()stringoperator(,)stringoperator(\)) - ident(define_method)operator(()ident(table_name)operator(\)) reserved(do) operator(|)ident(fixture)operator(,) operator(*)ident(optionals)operator(|) - ident(force_reload) operator(=) ident(optionals)operator(.)ident(shift) - instance_variable(@fixture_cache)operator([)ident(table_name)operator(]) operator(||=) constant(Hash)operator(.)ident(new) - instance_variable(@fixture_cache)operator([)ident(table_name)operator(])operator([)ident(fixture)operator(]) operator(=) pre_constant(nil) reserved(if) ident(force_reload) - reserved(if) instance_variable(@loaded_fixtures)operator([)ident(table_name)operator(])operator([)ident(fixture)operator(.)ident(to_s)operator(]) - instance_variable(@fixture_cache)operator([)ident(table_name)operator(])operator([)ident(fixture)operator(]) operator(||=) instance_variable(@loaded_fixtures)operator([)ident(table_name)operator(])operator([)ident(fixture)operator(.)ident(to_s)operator(])operator(.)ident(find) - reserved(else) - ident(raise) constant(StandardError)operator(,) stringcontent(' found for table ')inlinecontent(')delimiter(")> - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(uses_transaction)operator(()operator(*)ident(methods)operator(\)) - instance_variable(@uses_transaction) operator(||=) operator([)operator(]) - instance_variable(@uses_transaction)operator(.)ident(concat) ident(methods)operator(.)ident(map) operator({) operator(|)ident(m)operator(|) ident(m)operator(.)ident(to_s) operator(}) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(uses_transaction?)operator(()ident(method)operator(\)) - instance_variable(@uses_transaction) operator(&&) instance_variable(@uses_transaction)operator(.)ident(include?)operator(()ident(method)operator(.)ident(to_s)operator(\)) - reserved(end) - - reserved(def) method(use_transactional_fixtures?) - ident(use_transactional_fixtures) operator(&&) - operator(!)pre_constant(self)operator(.)ident(class)operator(.)ident(uses_transaction?)operator(()ident(method_name)operator(\)) - reserved(end) - - reserved(def) method(setup_with_fixtures) - reserved(if) ident(pre_loaded_fixtures) operator(&&) operator(!)ident(use_transactional_fixtures) - ident(raise) constant(RuntimeError)operator(,) string - reserved(end) - - instance_variable(@fixture_cache) operator(=) constant(Hash)operator(.)ident(new) - - comment(# Load fixtures once and begin transaction.) - reserved(if) ident(use_transactional_fixtures?) - reserved(if) class_variable(@@already_loaded_fixtures)operator([)pre_constant(self)operator(.)ident(class)operator(]) - instance_variable(@loaded_fixtures) operator(=) class_variable(@@already_loaded_fixtures)operator([)pre_constant(self)operator(.)ident(class)operator(]) - reserved(else) - ident(load_fixtures) - class_variable(@@already_loaded_fixtures)operator([)pre_constant(self)operator(.)ident(class)operator(]) operator(=) instance_variable(@loaded_fixtures) - reserved(end) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(lock_mutex) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(begin_db_transaction) - - comment(# Load fixtures for every test.) - reserved(else) - class_variable(@@already_loaded_fixtures)operator([)pre_constant(self)operator(.)ident(class)operator(]) operator(=) pre_constant(nil) - ident(load_fixtures) - reserved(end) - - comment(# Instantiate fixtures for every test if requested.) - ident(instantiate_fixtures) reserved(if) ident(use_instantiated_fixtures) - reserved(end) - - ident(alias_method) symbol(:setup)operator(,) symbol(:setup_with_fixtures) - - reserved(def) method(teardown_with_fixtures) - comment(# Rollback changes.) - reserved(if) ident(use_transactional_fixtures?) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(rollback_db_transaction) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(unlock_mutex) - reserved(end) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(verify_active_connections!) - reserved(end) - - ident(alias_method) symbol(:teardown)operator(,) symbol(:teardown_with_fixtures) - - reserved(def) pre_constant(self)operator(.)method(method_added)operator(()ident(method)operator(\)) - reserved(case) ident(method)operator(.)ident(to_s) - reserved(when) string - reserved(unless) ident(method_defined?)operator(()symbol(:setup_without_fixtures)operator(\)) - ident(alias_method) symbol(:setup_without_fixtures)operator(,) symbol(:setup) - ident(define_method)operator(()symbol(:setup)operator(\)) reserved(do) - ident(setup_with_fixtures) - ident(setup_without_fixtures) - reserved(end) - reserved(end) - reserved(when) string - reserved(unless) ident(method_defined?)operator(()symbol(:teardown_without_fixtures)operator(\)) - ident(alias_method) symbol(:teardown_without_fixtures)operator(,) symbol(:teardown) - ident(define_method)operator(()symbol(:teardown)operator(\)) reserved(do) - ident(teardown_without_fixtures) - ident(teardown_with_fixtures) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(load_fixtures) - instance_variable(@loaded_fixtures) operator(=) operator({)operator(}) - ident(fixtures) operator(=) constant(Fixtures)operator(.)ident(create_fixtures)operator(()ident(fixture_path)operator(,) ident(fixture_table_names)operator(,) ident(fixture_class_names)operator(\)) - reserved(unless) ident(fixtures)operator(.)ident(nil?) - reserved(if) ident(fixtures)operator(.)ident(instance_of?)operator(()constant(Fixtures)operator(\)) - instance_variable(@loaded_fixtures)operator([)ident(fixtures)operator(.)ident(table_name)operator(]) operator(=) ident(fixtures) - reserved(else) - ident(fixtures)operator(.)ident(each) operator({) operator(|)ident(f)operator(|) instance_variable(@loaded_fixtures)operator([)ident(f)operator(.)ident(table_name)operator(]) operator(=) ident(f) operator(}) - reserved(end) - reserved(end) - reserved(end) - - comment(# for pre_loaded_fixtures, only require the classes once. huge speed improvement) - class_variable(@@required_fixture_classes) operator(=) pre_constant(false) - - reserved(def) method(instantiate_fixtures) - reserved(if) ident(pre_loaded_fixtures) - ident(raise) constant(RuntimeError)operator(,) string reserved(if) constant(Fixtures)operator(.)ident(all_loaded_fixtures)operator(.)ident(empty?) - reserved(unless) class_variable(@@required_fixture_classes) - pre_constant(self)operator(.)ident(class)operator(.)ident(require_fixture_classes) constant(Fixtures)operator(.)ident(all_loaded_fixtures)operator(.)ident(keys) - class_variable(@@required_fixture_classes) operator(=) pre_constant(true) - reserved(end) - constant(Fixtures)operator(.)ident(instantiate_all_loaded_fixtures)operator(()pre_constant(self)operator(,) ident(load_instances?)operator(\)) - reserved(else) - ident(raise) constant(RuntimeError)operator(,) string reserved(if) instance_variable(@loaded_fixtures)operator(.)ident(nil?) - instance_variable(@loaded_fixtures)operator(.)ident(each) reserved(do) operator(|)ident(table_name)operator(,) ident(fixtures)operator(|) - constant(Fixtures)operator(.)ident(instantiate_fixtures)operator(()pre_constant(self)operator(,) ident(table_name)operator(,) ident(fixtures)operator(,) ident(load_instances?)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(load_instances?) - ident(use_instantiated_fixtures) operator(!=) symbol(:no_instances) - reserved(end) - reserved(end) - - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - comment(# Active Records support optimistic locking if the field lock_version is present. Each update to the) - comment(# record increments the lock_version column and the locking facilities ensure that records instantiated twice) - comment(# will let the last one saved raise a StaleObjectError if the first was also updated. Example:) - comment(#) - comment(# p1 = Person.find(1\)) - comment(# p2 = Person.find(1\)) - comment(# ) - comment(# p1.first_name = "Michael") - comment(# p1.save) - comment(# ) - comment(# p2.first_name = "should fail") - comment(# p2.save # Raises a ActiveRecord::StaleObjectError) - comment(#) - comment(# You're then responsible for dealing with the conflict by rescuing the exception and either rolling back, merging,) - comment(# or otherwise apply the business logic needed to resolve the conflict.) - comment(#) - comment(# You must ensure that your database schema defaults the lock_version column to 0.) - comment(#) - comment(# This behavior can be turned off by setting ActiveRecord::Base.lock_optimistically = false.) - comment(# To override the name of the lock_version column, invoke the set_locking_column method.) - comment(# This method uses the same syntax as set_table_name) - reserved(module) class(Locking) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:update_without_lock)operator(,) symbol(:update) - ident(alias_method) symbol(:update)operator(,) symbol(:update_with_lock) - reserved(end) - reserved(end) - - reserved(def) method(update_with_lock) comment(#:nodoc:) - reserved(return) ident(update_without_lock) reserved(unless) ident(locking_enabled?) - - ident(lock_col) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(locking_column) - ident(previous_value) operator(=) ident(send)operator(()ident(lock_col)operator(\)) - ident(send)operator(()ident(lock_col) operator(+) stringoperator(,) ident(previous_value) operator(+) integer(1)operator(\)) - - ident(affected_rows) operator(=) ident(connection)operator(.)ident(update)operator(()stringoperator(,) stringcontent( Update with optimistic locking)delimiter(")>operator(\))stringcontent( - SET )inlinecontent( - WHERE )inlinecontent( = )inlinecontent( - AND )inlinecontent( = )inlinedelimiter( - end_sql)> - - reserved(unless) ident(affected_rows) operator(==) integer(1) - ident(raise) constant(ActiveRecord)operator(::)constant(StaleObjectError)operator(,) string - reserved(end) - - reserved(return) pre_constant(true) - reserved(end) - reserved(end) - - reserved(class) class(Base) - class_variable(@@lock_optimistically) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:lock_optimistically) - - reserved(def) method(locking_enabled?) comment(#:nodoc:) - ident(lock_optimistically) operator(&&) ident(respond_to?)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(locking_column)operator(\)) - reserved(end) - - reserved(class) operator(<<) class(self) - reserved(def) method(set_locking_column)operator(()ident(value) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - ident(define_attr_method) symbol(:locking_column)operator(,) ident(value)operator(,) operator(&)ident(block) - reserved(end) - - reserved(def) method(locking_column) comment(#:nodoc:) - ident(reset_locking_column) - reserved(end) - - reserved(def) method(reset_locking_column) comment(#:nodoc:) - ident(default) operator(=) string - ident(set_locking_column)operator(()ident(default)operator(\)) - ident(default) - reserved(end) - reserved(end) - - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(class) class(IrreversibleMigration) operator(<) constant(ActiveRecordError)comment(#:nodoc:) - reserved(end) - - reserved(class) class(DuplicateMigrationVersionError) operator(<) constant(ActiveRecordError)comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(version)operator(\)) - reserved(super)operator(()stringdelimiter(")>operator(\)) - reserved(end) - reserved(end) - - comment(# Migrations can manage the evolution of a schema used by several physical databases. It's a solution) - comment(# to the common problem of adding a field to make a new feature work in your local database, but being unsure of how to) - comment(# push that change to other developers and to the production server. With migrations, you can describe the transformations) - comment(# in self-contained classes that can be checked into version control systems and executed against another database that) - comment(# might be one, two, or five versions behind.) - comment(#) - comment(# Example of a simple migration:) - comment(#) - comment(# class AddSsl < ActiveRecord::Migration) - comment(# def self.up) - comment(# add_column :accounts, :ssl_enabled, :boolean, :default => 1) - comment(# end) - comment(#) - comment(# def self.down) - comment(# remove_column :accounts, :ssl_enabled) - comment(# end) - comment(# end) - comment(#) - comment(# This migration will add a boolean flag to the accounts table and remove it again, if you're backing out of the migration.) - comment(# It shows how all migrations have two class methods +up+ and +down+ that describes the transformations required to implement) - comment(# or remove the migration. These methods can consist of both the migration specific methods, like add_column and remove_column,) - comment(# but may also contain regular Ruby code for generating data needed for the transformations.) - comment(#) - comment(# Example of a more complex migration that also needs to initialize data:) - comment(#) - comment(# class AddSystemSettings < ActiveRecord::Migration) - comment(# def self.up) - comment(# create_table :system_settings do |t|) - comment(# t.column :name, :string) - comment(# t.column :label, :string) - comment(# t.column :value, :text) - comment(# t.column :type, :string) - comment(# t.column :position, :integer) - comment(# end) - comment(#) - comment(# SystemSetting.create :name => "notice", :label => "Use notice?", :value => 1) - comment(# end) - comment(#) - comment(# def self.down) - comment(# drop_table :system_settings) - comment(# end) - comment(# end) - comment(#) - comment(# This migration first adds the system_settings table, then creates the very first row in it using the Active Record model) - comment(# that relies on the table. It also uses the more advanced create_table syntax where you can specify a complete table schema) - comment(# in one block call.) - comment(#) - comment(# == Available transformations) - comment(#) - comment(# * create_table(name, options\) Creates a table called +name+ and makes the table object available to a block) - comment(# that can then add columns to it, following the same format as add_column. See example above. The options hash is for) - comment(# fragments like "DEFAULT CHARSET=UTF-8" that are appended to the create table definition.) - comment(# * drop_table(name\): Drops the table called +name+.) - comment(# * rename_table(old_name, new_name\): Renames the table called +old_name+ to +new_name+.) - comment(# * add_column(table_name, column_name, type, options\): Adds a new column to the table called +table_name+) - comment(# named +column_name+ specified to be one of the following types:) - comment(# :string, :text, :integer, :float, :datetime, :timestamp, :time, :date, :binary, :boolean. A default value can be specified) - comment(# by passing an +options+ hash like { :default => 11 }.) - comment(# * rename_column(table_name, column_name, new_column_name\): Renames a column but keeps the type and content.) - comment(# * change_column(table_name, column_name, type, options\): Changes the column to a different type using the same) - comment(# parameters as add_column.) - comment(# * remove_column(table_name, column_name\): Removes the column named +column_name+ from the table called +table_name+.) - comment(# * add_index(table_name, column_names, index_type, index_name\): Add a new index with the name of the column, or +index_name+ (if specified\) on the column(s\). Specify an optional +index_type+ (e.g. UNIQUE\).) - comment(# * remove_index(table_name, index_name\): Remove the index specified by +index_name+.) - comment(#) - comment(# == Irreversible transformations) - comment(#) - comment(# Some transformations are destructive in a manner that cannot be reversed. Migrations of that kind should raise) - comment(# an IrreversibleMigration exception in their +down+ method.) - comment(#) - comment(# == Running migrations from within Rails) - comment(#) - comment(# The Rails package has several tools to help create and apply migrations.) - comment(#) - comment(# To generate a new migration, use script/generate migration MyNewMigration) - comment(# where MyNewMigration is the name of your migration. The generator will) - comment(# create a file nnn_my_new_migration.rb in the db/migrate/) - comment(# directory, where nnn is the next largest migration number.) - comment(# You may then edit the self.up and self.down methods of) - comment(# n MyNewMigration.) - comment(#) - comment(# To run migrations against the currently configured database, use) - comment(# rake migrate. This will update the database by running all of the) - comment(# pending migrations, creating the schema_info table if missing.) - comment(#) - comment(# To roll the database back to a previous migration version, use) - comment(# rake migrate VERSION=X where X is the version to which) - comment(# you wish to downgrade. If any of the migrations throw an) - comment(# IrreversibleMigration exception, that step will fail and you'll) - comment(# have some manual work to do.) - comment(#) - comment(# == Database support) - comment(#) - comment(# Migrations are currently supported in MySQL, PostgreSQL, SQLite,) - comment(# SQL Server, Sybase, and Oracle (all supported databases except DB2\).) - comment(#) - comment(# == More examples) - comment(#) - comment(# Not all migrations change the schema. Some just fix the data:) - comment(#) - comment(# class RemoveEmptyTags < ActiveRecord::Migration) - comment(# def self.up) - comment(# Tag.find(:all\).each { |tag| tag.destroy if tag.pages.empty? }) - comment(# end) - comment(#) - comment(# def self.down) - comment(# # not much we can do to restore deleted data) - comment(# raise IrreversibleMigration) - comment(# end) - comment(# end) - comment(#) - comment(# Others remove columns when they migrate up instead of down:) - comment(#) - comment(# class RemoveUnnecessaryItemAttributes < ActiveRecord::Migration) - comment(# def self.up) - comment(# remove_column :items, :incomplete_items_count) - comment(# remove_column :items, :completed_items_count) - comment(# end) - comment(#) - comment(# def self.down) - comment(# add_column :items, :incomplete_items_count) - comment(# add_column :items, :completed_items_count) - comment(# end) - comment(# end) - comment(#) - comment(# And sometimes you need to do something in SQL not abstracted directly by migrations:) - comment(#) - comment(# class MakeJoinUnique < ActiveRecord::Migration) - comment(# def self.up) - comment(# execute "ALTER TABLE `pages_linked_pages` ADD UNIQUE `page_id_linked_page_id` (`page_id`,`linked_page_id`\)") - comment(# end) - comment(#) - comment(# def self.down) - comment(# execute "ALTER TABLE `pages_linked_pages` DROP INDEX `page_id_linked_page_id`") - comment(# end) - comment(# end) - comment(#) - comment(# == Using a model after changing its table) - comment(#) - comment(# Sometimes you'll want to add a column in a migration and populate it immediately after. In that case, you'll need) - comment(# to make a call to Base#reset_column_information in order to ensure that the model has the latest column data from) - comment(# after the new column was added. Example:) - comment(#) - comment(# class AddPeopleSalary < ActiveRecord::Migration) - comment(# def self.up) - comment(# add_column :people, :salary, :integer) - comment(# Person.reset_column_information) - comment(# Person.find(:all\).each do |p|) - comment(# p.salary = SalaryCalculator.compute(p\)) - comment(# end) - comment(# end) - comment(# end) - comment(#) - comment(# == Controlling verbosity) - comment(#) - comment(# By default, migrations will describe the actions they are taking, writing) - comment(# them to the console as they happen, along with benchmarks describing how) - comment(# long each step took.) - comment(#) - comment(# You can quiet them down by setting ActiveRecord::Migration.verbose = false.) - comment(#) - comment(# You can also insert your own messages and benchmarks by using the #say_with_time) - comment(# method:) - comment(#) - comment(# def self.up) - comment(# ...) - comment(# say_with_time "Updating salaries..." do) - comment(# Person.find(:all\).each do |p|) - comment(# p.salary = SalaryCalculator.compute(p\)) - comment(# end) - comment(# end) - comment(# ...) - comment(# end) - comment(#) - comment(# The phrase "Updating salaries..." would then be printed, along with the) - comment(# benchmark for the block when the block completes.) - reserved(class) class(Migration) - class_variable(@@verbose) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:verbose) - - reserved(class) operator(<<) class(self) - reserved(def) method(up_using_benchmarks) comment(#:nodoc:) - ident(migrate)operator(()symbol(:up)operator(\)) - reserved(end) - - reserved(def) method(down_using_benchmarks) comment(#:nodoc:) - ident(migrate)operator(()symbol(:down)operator(\)) - reserved(end) - - comment(# Execute this migration in the named direction) - reserved(def) method(migrate)operator(()ident(direction)operator(\)) - reserved(return) reserved(unless) ident(respond_to?)operator(()ident(direction)operator(\)) - - reserved(case) ident(direction) - reserved(when) symbol(:up) reserved(then) ident(announce) string - reserved(when) symbol(:down) reserved(then) ident(announce) string - reserved(end) - - ident(result) operator(=) pre_constant(nil) - ident(time) operator(=) constant(Benchmark)operator(.)ident(measure) operator({) ident(result) operator(=) ident(send)operator(()stringdelimiter(")>operator(\)) operator(}) - - reserved(case) ident(direction) - reserved(when) symbol(:up) reserved(then) ident(announce) string operator(%) ident(time)operator(.)ident(real)operator(;) ident(write) - reserved(when) symbol(:down) reserved(then) ident(announce) string operator(%) ident(time)operator(.)ident(real)operator(;) ident(write) - reserved(end) - - ident(result) - reserved(end) - - comment(# Because the method added may do an alias_method, it can be invoked) - comment(# recursively. We use @ignore_new_methods as a guard to indicate whether) - comment(# it is safe for the call to proceed.) - reserved(def) method(singleton_method_added)operator(()ident(sym)operator(\)) comment(#:nodoc:) - reserved(return) reserved(if) instance_variable(@ignore_new_methods) - - reserved(begin) - instance_variable(@ignore_new_methods) operator(=) pre_constant(true) - - reserved(case) ident(sym) - reserved(when) symbol(:up)operator(,) symbol(:down) - ident(klass) operator(=) operator(()reserved(class) operator(<<) class(self)operator(;) pre_constant(self)operator(;) reserved(end)operator(\)) - ident(klass)operator(.)ident(send)operator(()symbol(:alias_method)operator(,) stringdelimiter(")>operator(,) ident(sym)operator(\)) - ident(klass)operator(.)ident(send)operator(()symbol(:alias_method)operator(,) ident(sym)operator(,) stringcontent(_using_benchmarks)delimiter(")>operator(\)) - reserved(end) - reserved(ensure) - instance_variable(@ignore_new_methods) operator(=) pre_constant(false) - reserved(end) - reserved(end) - - reserved(def) method(write)operator(()ident(text)operator(=)stringoperator(\)) - ident(puts)operator(()ident(text)operator(\)) reserved(if) ident(verbose) - reserved(end) - - reserved(def) method(announce)operator(()ident(message)operator(\)) - ident(text) operator(=) stringcontent(: )inlinedelimiter(")> - ident(length) operator(=) operator([)integer(0)operator(,) integer(75) operator(-) ident(text)operator(.)ident(length)operator(])operator(.)ident(max) - ident(write) string operator(%) operator([)ident(text)operator(,) string operator(*) ident(length)operator(]) - reserved(end) - - reserved(def) method(say)operator(()ident(message)operator(,) ident(subitem)operator(=)pre_constant(false)operator(\)) - ident(write) string)delimiter(")> operator(:) stringinline_delimiter(})>content( )inlinedelimiter(")> - reserved(end) - - reserved(def) method(say_with_time)operator(()ident(message)operator(\)) - ident(say)operator(()ident(message)operator(\)) - ident(result) operator(=) pre_constant(nil) - ident(time) operator(=) constant(Benchmark)operator(.)ident(measure) operator({) ident(result) operator(=) reserved(yield) operator(}) - ident(say) string operator(%) ident(time)operator(.)ident(real)operator(,) symbol(:subitem) - ident(result) - reserved(end) - - reserved(def) method(suppress_messages) - ident(save) operator(=) ident(verbose) - pre_constant(self)operator(.)ident(verbose) operator(=) pre_constant(false) - reserved(yield) - reserved(ensure) - pre_constant(self)operator(.)ident(verbose) operator(=) ident(save) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(method)operator(,) operator(*)ident(arguments)operator(,) operator(&)ident(block)operator(\)) - ident(say_with_time) stringcontent(()inlineoperator(\))inline_delimiter(})>content(\))delimiter(")> reserved(do) - ident(arguments)operator([)integer(0)operator(]) operator(=) constant(Migrator)operator(.)ident(proper_table_name)operator(()ident(arguments)operator(.)ident(first)operator(\)) reserved(unless) ident(arguments)operator(.)ident(empty?) operator(||) ident(method) operator(==) symbol(:execute) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(send)operator(()ident(method)operator(,) operator(*)ident(arguments)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(Migrator)comment(#:nodoc:) - reserved(class) operator(<<) class(self) - reserved(def) method(migrate)operator(()ident(migrations_path)operator(,) ident(target_version) operator(=) pre_constant(nil)operator(\)) - constant(Base)operator(.)ident(connection)operator(.)ident(initialize_schema_information) - - reserved(case) - reserved(when) ident(target_version)operator(.)ident(nil?)operator(,) ident(current_version) operator(<) ident(target_version) - ident(up)operator(()ident(migrations_path)operator(,) ident(target_version)operator(\)) - reserved(when) ident(current_version) operator(>) ident(target_version) - ident(down)operator(()ident(migrations_path)operator(,) ident(target_version)operator(\)) - reserved(when) ident(current_version) operator(==) ident(target_version) - reserved(return) comment(# You're on the right version) - reserved(end) - reserved(end) - - reserved(def) method(up)operator(()ident(migrations_path)operator(,) ident(target_version) operator(=) pre_constant(nil)operator(\)) - pre_constant(self)operator(.)ident(new)operator(()symbol(:up)operator(,) ident(migrations_path)operator(,) ident(target_version)operator(\))operator(.)ident(migrate) - reserved(end) - - reserved(def) method(down)operator(()ident(migrations_path)operator(,) ident(target_version) operator(=) pre_constant(nil)operator(\)) - pre_constant(self)operator(.)ident(new)operator(()symbol(:down)operator(,) ident(migrations_path)operator(,) ident(target_version)operator(\))operator(.)ident(migrate) - reserved(end) - - reserved(def) method(schema_info_table_name) - constant(Base)operator(.)ident(table_name_prefix) operator(+) string operator(+) constant(Base)operator(.)ident(table_name_suffix) - reserved(end) - - reserved(def) method(current_version) - operator(()constant(Base)operator(.)ident(connection)operator(.)ident(select_one)operator(()stringdelimiter(")>operator(\)) operator(||) operator({)string operator(=)operator(>) integer(0)operator(})operator(\))operator([)stringoperator(])operator(.)ident(to_i) - reserved(end) - - reserved(def) method(proper_table_name)operator(()ident(name)operator(\)) - comment(# Use the ActiveRecord objects own table_name, or pre/suffix from ActiveRecord::Base if name is a symbol/string) - ident(name)operator(.)ident(table_name) reserved(rescue) stringinlineinlinedelimiter(")> - reserved(end) - - reserved(end) - - reserved(def) method(initialize)operator(()ident(direction)operator(,) ident(migrations_path)operator(,) ident(target_version) operator(=) pre_constant(nil)operator(\)) - ident(raise) constant(StandardError)operator(.)ident(new)operator(()stringoperator(\)) reserved(unless) constant(Base)operator(.)ident(connection)operator(.)ident(supports_migrations?) - instance_variable(@direction)operator(,) instance_variable(@migrations_path)operator(,) instance_variable(@target_version) operator(=) ident(direction)operator(,) ident(migrations_path)operator(,) ident(target_version) - constant(Base)operator(.)ident(connection)operator(.)ident(initialize_schema_information) - reserved(end) - - reserved(def) method(current_version) - pre_constant(self)operator(.)ident(class)operator(.)ident(current_version) - reserved(end) - - reserved(def) method(migrate) - ident(migration_classes)operator(.)ident(each) reserved(do) operator(|)operator(()ident(version)operator(,) ident(migration_class)operator(\))operator(|) - constant(Base)operator(.)ident(logger)operator(.)ident(info)operator(()stringdelimiter(")>operator(\)) reserved(and) reserved(break) reserved(if) ident(reached_target_version?)operator(()ident(version)operator(\)) - reserved(next) reserved(if) ident(irrelevant_migration?)operator(()ident(version)operator(\)) - - constant(Base)operator(.)ident(logger)operator(.)ident(info) stringcontent( ()inlinecontent(\))delimiter(")> - ident(migration_class)operator(.)ident(migrate)operator(()instance_variable(@direction)operator(\)) - ident(set_schema_version)operator(()ident(version)operator(\)) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(migration_classes) - ident(migrations) operator(=) ident(migration_files)operator(.)ident(inject)operator(()operator([)operator(])operator(\)) reserved(do) operator(|)ident(migrations)operator(,) ident(migration_file)operator(|) - ident(load)operator(()ident(migration_file)operator(\)) - ident(version)operator(,) ident(name) operator(=) ident(migration_version_and_name)operator(()ident(migration_file)operator(\)) - ident(assert_unique_migration_version)operator(()ident(migrations)operator(,) ident(version)operator(.)ident(to_i)operator(\)) - ident(migrations) operator(<<) operator([) ident(version)operator(.)ident(to_i)operator(,) ident(migration_class)operator(()ident(name)operator(\)) operator(]) - reserved(end) - - ident(down?) operator(?) ident(migrations)operator(.)ident(sort)operator(.)ident(reverse) operator(:) ident(migrations)operator(.)ident(sort) - reserved(end) - - reserved(def) method(assert_unique_migration_version)operator(()ident(migrations)operator(,) ident(version)operator(\)) - reserved(if) operator(!)ident(migrations)operator(.)ident(empty?) operator(&&) ident(migrations)operator(.)ident(transpose)operator(.)ident(first)operator(.)ident(include?)operator(()ident(version)operator(\)) - ident(raise) constant(DuplicateMigrationVersionError)operator(.)ident(new)operator(()ident(version)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(migration_files) - ident(files) operator(=) constant(Dir)operator([)stringcontent(/[0-9]*_*.rb)delimiter(")>operator(])operator(.)ident(sort_by) reserved(do) operator(|)ident(f)operator(|) - ident(migration_version_and_name)operator(()ident(f)operator(\))operator(.)ident(first)operator(.)ident(to_i) - reserved(end) - ident(down?) operator(?) ident(files)operator(.)ident(reverse) operator(:) ident(files) - reserved(end) - - reserved(def) method(migration_class)operator(()ident(migration_name)operator(\)) - ident(migration_name)operator(.)ident(camelize)operator(.)ident(constantize) - reserved(end) - - reserved(def) method(migration_version_and_name)operator(()ident(migration_file)operator(\)) - reserved(return) operator(*)ident(migration_file)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(first) - reserved(end) - - reserved(def) method(set_schema_version)operator(()ident(version)operator(\)) - constant(Base)operator(.)ident(connection)operator(.)ident(update)operator(()stringcontent( SET version = )inlinedelimiter(")>operator(\)) - reserved(end) - - reserved(def) method(up?) - instance_variable(@direction) operator(==) symbol(:up) - reserved(end) - - reserved(def) method(down?) - instance_variable(@direction) operator(==) symbol(:down) - reserved(end) - - reserved(def) method(reached_target_version?)operator(()ident(version)operator(\)) - operator(()ident(up?) operator(&&) ident(version)operator(.)ident(to_i) operator(-) integer(1) operator(==) instance_variable(@target_version)operator(\)) operator(||) operator(()ident(down?) operator(&&) ident(version)operator(.)ident(to_i) operator(==) instance_variable(@target_version)operator(\)) - reserved(end) - - reserved(def) method(irrelevant_migration?)operator(()ident(version)operator(\)) - operator(()ident(up?) operator(&&) ident(version)operator(.)ident(to_i) operator(<=) ident(current_version)operator(\)) operator(||) operator(()ident(down?) operator(&&) ident(version)operator(.)ident(to_i) operator(>) ident(current_version)operator(\)) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(module) class(Observing) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - reserved(module) class(ClassMethods) - comment(# Activates the observers assigned. Examples:) - comment(#) - comment(# # Calls PersonObserver.instance) - comment(# ActiveRecord::Base.observers = :person_observer) - comment(#) - comment(# # Calls Cacher.instance and GarbageCollector.instance ) - comment(# ActiveRecord::Base.observers = :cacher, :garbage_collector) - comment(#) - comment(# # Same as above, just using explicit class references) - comment(# ActiveRecord::Base.observers = Cacher, GarbageCollector) - reserved(def) method(observers=)operator(()operator(*)ident(observers)operator(\)) - ident(observers) operator(=) operator([) ident(observers) operator(])operator(.)ident(flatten)operator(.)ident(each) reserved(do) operator(|)ident(observer)operator(|) - ident(observer)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) operator(?) - ident(observer)operator(.)ident(to_s)operator(.)ident(camelize)operator(.)ident(constantize)operator(.)ident(instance) operator(:) - ident(observer)operator(.)ident(instance) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# Observer classes respond to lifecycle callbacks to implement trigger-like) - comment(# behavior outside the original class. This is a great way to reduce the) - comment(# clutter that normally comes when the model class is burdened with) - comment(# functionality that doesn't pertain to the core responsibility of the) - comment(# class. Example:) - comment(#) - comment(# class CommentObserver < ActiveRecord::Observer) - comment(# def after_save(comment\)) - comment(# Notifications.deliver_comment("admin@do.com", "New comment was posted", comment\)) - comment(# end) - comment(# end) - comment(#) - comment(# This Observer sends an email when a Comment#save is finished.) - comment(#) - comment(# class ContactObserver < ActiveRecord::Observer) - comment(# def after_create(contact\)) - comment(# contact.logger.info('New contact added!'\)) - comment(# end) - comment(#) - comment(# def after_destroy(contact\)) - comment(# contact.logger.warn("Contact with an id of #{contact.id} was destroyed!"\)) - comment(# end) - comment(# end) - comment(#) - comment(# This Observer uses logger to log when specific callbacks are triggered.) - comment(#) - comment(# == Observing a class that can't be inferred) - comment(#) - comment(# Observers will by default be mapped to the class with which they share a name. So CommentObserver will) - comment(# be tied to observing Comment, ProductManagerObserver to ProductManager, and so on. If you want to name your observer) - comment(# differently than the class you're interested in observing, you can use the Observer.observe class method:) - comment(#) - comment(# class AuditObserver < ActiveRecord::Observer) - comment(# observe Account) - comment(#) - comment(# def after_update(account\)) - comment(# AuditTrail.new(account, "UPDATED"\)) - comment(# end) - comment(# end) - comment(#) - comment(# If the audit observer needs to watch more than one kind of object, this can be specified with multiple arguments:) - comment(#) - comment(# class AuditObserver < ActiveRecord::Observer) - comment(# observe Account, Balance) - comment(#) - comment(# def after_update(record\)) - comment(# AuditTrail.new(record, "UPDATED"\)) - comment(# end) - comment(# end) - comment(#) - comment(# The AuditObserver will now act on both updates to Account and Balance by treating them both as records.) - comment(#) - comment(# == Available callback methods) - comment(#) - comment(# The observer can implement callback methods for each of the methods described in the Callbacks module.) - comment(#) - comment(# == Storing Observers in Rails) - comment(# ) - comment(# If you're using Active Record within Rails, observer classes are usually stored in app/models with the) - comment(# naming convention of app/models/audit_observer.rb.) - comment(#) - comment(# == Configuration) - comment(# ) - comment(# In order to activate an observer, list it in the config.active_record.observers configuration setting in your) - comment(# config/environment.rb file.) - comment(#) - comment(# config.active_record.observers = :comment_observer, :signup_observer) - comment(#) - comment(# Observers will not be invoked unless you define these in your application configuration.) - comment(#) - reserved(class) class(Observer) - ident(include) constant(Singleton) - - comment(# Observer subclasses should be reloaded by the dispatcher in Rails) - comment(# when Dependencies.mechanism = :load.) - ident(include) constant(Reloadable)operator(::)constant(Subclasses) - - comment(# Attaches the observer to the supplied model classes.) - reserved(def) pre_constant(self)operator(.)method(observe)operator(()operator(*)ident(models)operator(\)) - ident(define_method)operator(()symbol(:observed_class)operator(\)) operator({) ident(models) operator(}) - reserved(end) - - reserved(def) method(initialize) - ident(observed_classes) operator(=) operator([) ident(observed_class) operator(])operator(.)ident(flatten) - ident(observed_subclasses_class) operator(=) ident(observed_classes)operator(.)ident(collect) operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(send)operator(()symbol(:subclasses)operator(\)) operator(})operator(.)ident(flatten!) - operator(()ident(observed_classes) operator(+) ident(observed_subclasses_class)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(klass)operator(|) - ident(klass)operator(.)ident(add_observer)operator(()pre_constant(self)operator(\)) - ident(klass)operator(.)ident(send)operator(()symbol(:define_method)operator(,) symbol(:after_find)operator(\)) reserved(unless) ident(klass)operator(.)ident(respond_to?)operator(()symbol(:after_find)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(update)operator(()ident(callback_method)operator(,) ident(object)operator(\)) comment(#:nodoc:) - ident(send)operator(()ident(callback_method)operator(,) ident(object)operator(\)) reserved(if) ident(respond_to?)operator(()ident(callback_method)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(observed_class) - reserved(if) pre_constant(self)operator(.)ident(class)operator(.)ident(respond_to?) string - pre_constant(self)operator(.)ident(class)operator(.)ident(observed_class) - reserved(else) - constant(Object)operator(.)ident(const_get)operator(()ident(infer_observed_class_name)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(infer_observed_class_name) - pre_constant(self)operator(.)ident(class)operator(.)ident(name)operator(.)ident(scan)operator(()regexpoperator(\))operator([)integer(0)operator(])operator([)integer(0)operator(]) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(class) class(QueryCache) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(connection)operator(\)) - instance_variable(@connection) operator(=) ident(connection) - instance_variable(@query_cache) operator(=) operator({)operator(}) - reserved(end) - - reserved(def) method(clear_query_cache) - instance_variable(@query_cache) operator(=) operator({)operator(}) - reserved(end) - - reserved(def) method(select_all)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - operator(()instance_variable(@query_cache)operator([)ident(sql)operator(]) operator(||=) instance_variable(@connection)operator(.)ident(select_all)operator(()ident(sql)operator(,) ident(name)operator(\))operator(\))operator(.)ident(dup) - reserved(end) - - reserved(def) method(select_one)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - instance_variable(@query_cache)operator([)ident(sql)operator(]) operator(||=) instance_variable(@connection)operator(.)ident(select_one)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - instance_variable(@query_cache)operator([)stringdelimiter(")>operator(]) operator(||=) instance_variable(@connection)operator(.)ident(columns)operator(()ident(table_name)operator(,) ident(name)operator(\)) - reserved(end) - - reserved(def) method(insert)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(,) ident(pk) operator(=) pre_constant(nil)operator(,) ident(id_value) operator(=) pre_constant(nil)operator(\)) - ident(clear_query_cache) - instance_variable(@connection)operator(.)ident(insert)operator(()ident(sql)operator(,) ident(name)operator(,) ident(pk)operator(,) ident(id_value)operator(\)) - reserved(end) - - reserved(def) method(update)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(clear_query_cache) - instance_variable(@connection)operator(.)ident(update)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - - reserved(def) method(delete)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - ident(clear_query_cache) - instance_variable(@connection)operator(.)ident(delete)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(method_missing)operator(()ident(method)operator(,) operator(*)ident(arguments)operator(,) operator(&)ident(proc)operator(\)) - instance_variable(@connection)operator(.)ident(send)operator(()ident(method)operator(,) operator(*)ident(arguments)operator(,) operator(&)ident(proc)operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(Base) - comment(# Set the connection for the class with caching on) - reserved(class) operator(<<) class(self) - ident(alias_method) symbol(:connection_without_query_cache=)operator(,) symbol(:connection=) - - reserved(def) method(connection=)operator(()ident(spec)operator(\)) - reserved(if) ident(spec)operator(.)ident(is_a?)operator(()constant(ConnectionSpecification)operator(\)) reserved(and) ident(spec)operator(.)ident(config)operator([)symbol(:query_cache)operator(]) - ident(spec) operator(=) constant(QueryCache)operator(.)ident(new)operator(()pre_constant(self)operator(.)ident(send)operator(()ident(spec)operator(.)ident(adapter_method)operator(,) ident(spec)operator(.)ident(config)operator(\))operator(\)) - reserved(end) - pre_constant(self)operator(.)ident(connection_without_query_cache) operator(=) ident(spec) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(AbstractAdapter) comment(#:nodoc:) - comment(# Stub method to be able to treat the connection the same whether the query cache has been turned on or not) - reserved(def) method(clear_query_cache) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(Reflection) comment(# :nodoc:) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - comment(# Reflection allows you to interrogate Active Record classes and objects about their associations and aggregations.) - comment(# This information can, for example, be used in a form builder that took an Active Record object and created input) - comment(# fields for all of the attributes depending on their type and displayed the associations to other objects.) - comment(#) - comment(# You can find the interface for the AggregateReflection and AssociationReflection classes in the abstract MacroReflection class.) - reserved(module) class(ClassMethods) - reserved(def) method(create_reflection)operator(()ident(macro)operator(,) ident(name)operator(,) ident(options)operator(,) ident(active_record)operator(\)) - reserved(case) ident(macro) - reserved(when) symbol(:has_many)operator(,) symbol(:belongs_to)operator(,) symbol(:has_one)operator(,) symbol(:has_and_belongs_to_many) - ident(reflection) operator(=) constant(AssociationReflection)operator(.)ident(new)operator(()ident(macro)operator(,) ident(name)operator(,) ident(options)operator(,) ident(active_record)operator(\)) - reserved(when) symbol(:composed_of) - ident(reflection) operator(=) constant(AggregateReflection)operator(.)ident(new)operator(()ident(macro)operator(,) ident(name)operator(,) ident(options)operator(,) ident(active_record)operator(\)) - reserved(end) - ident(write_inheritable_hash) symbol(:reflections)operator(,) ident(name) operator(=)operator(>) ident(reflection) - ident(reflection) - reserved(end) - - reserved(def) method(reflections) - ident(read_inheritable_attribute)operator(()symbol(:reflections)operator(\)) reserved(or) ident(write_inheritable_attribute)operator(()symbol(:reflections)operator(,) operator({)operator(})operator(\)) - reserved(end) - - comment(# Returns an array of AggregateReflection objects for all the aggregations in the class.) - reserved(def) method(reflect_on_all_aggregations) - ident(reflections)operator(.)ident(values)operator(.)ident(select) operator({) operator(|)ident(reflection)operator(|) ident(reflection)operator(.)ident(is_a?)operator(()constant(AggregateReflection)operator(\)) operator(}) - reserved(end) - - comment(# Returns the AggregateReflection object for the named +aggregation+ (use the symbol\). Example:) - comment(# Account.reflect_on_aggregation(:balance\) # returns the balance AggregateReflection) - reserved(def) method(reflect_on_aggregation)operator(()ident(aggregation)operator(\)) - ident(reflections)operator([)ident(aggregation)operator(])operator(.)ident(is_a?)operator(()constant(AggregateReflection)operator(\)) operator(?) ident(reflections)operator([)ident(aggregation)operator(]) operator(:) pre_constant(nil) - reserved(end) - - comment(# Returns an array of AssociationReflection objects for all the aggregations in the class. If you only want to reflect on a) - comment(# certain association type, pass in the symbol (:has_many, :has_one, :belongs_to\) for that as the first parameter. Example:) - comment(# Account.reflect_on_all_associations # returns an array of all associations) - comment(# Account.reflect_on_all_associations(:has_many\) # returns an array of all has_many associations) - reserved(def) method(reflect_on_all_associations)operator(()ident(macro) operator(=) pre_constant(nil)operator(\)) - ident(association_reflections) operator(=) ident(reflections)operator(.)ident(values)operator(.)ident(select) operator({) operator(|)ident(reflection)operator(|) ident(reflection)operator(.)ident(is_a?)operator(()constant(AssociationReflection)operator(\)) operator(}) - ident(macro) operator(?) ident(association_reflections)operator(.)ident(select) operator({) operator(|)ident(reflection)operator(|) ident(reflection)operator(.)ident(macro) operator(==) ident(macro) operator(}) operator(:) ident(association_reflections) - reserved(end) - - comment(# Returns the AssociationReflection object for the named +aggregation+ (use the symbol\). Example:) - comment(# Account.reflect_on_association(:owner\) # returns the owner AssociationReflection) - comment(# Invoice.reflect_on_association(:line_items\).macro # returns :has_many) - reserved(def) method(reflect_on_association)operator(()ident(association)operator(\)) - ident(reflections)operator([)ident(association)operator(])operator(.)ident(is_a?)operator(()constant(AssociationReflection)operator(\)) operator(?) ident(reflections)operator([)ident(association)operator(]) operator(:) pre_constant(nil) - reserved(end) - reserved(end) - - - comment(# Abstract base class for AggregateReflection and AssociationReflection that describes the interface available for both of) - comment(# those classes. Objects of AggregateReflection and AssociationReflection are returned by the Reflection::ClassMethods.) - reserved(class) class(MacroReflection) - ident(attr_reader) symbol(:active_record) - reserved(def) method(initialize)operator(()ident(macro)operator(,) ident(name)operator(,) ident(options)operator(,) ident(active_record)operator(\)) - instance_variable(@macro)operator(,) instance_variable(@name)operator(,) instance_variable(@options)operator(,) instance_variable(@active_record) operator(=) ident(macro)operator(,) ident(name)operator(,) ident(options)operator(,) ident(active_record) - reserved(end) - - comment(# Returns the name of the macro, so it would return :balance for "composed_of :balance, :class_name => 'Money'" or) - comment(# :clients for "has_many :clients".) - reserved(def) method(name) - instance_variable(@name) - reserved(end) - - comment(# Returns the name of the macro, so it would return :composed_of for) - comment(# "composed_of :balance, :class_name => 'Money'" or :has_many for "has_many :clients".) - reserved(def) method(macro) - instance_variable(@macro) - reserved(end) - - comment(# Returns the hash of options used for the macro, so it would return { :class_name => "Money" } for) - comment(# "composed_of :balance, :class_name => 'Money'" or {} for "has_many :clients".) - reserved(def) method(options) - instance_variable(@options) - reserved(end) - - comment(# Returns the class for the macro, so "composed_of :balance, :class_name => 'Money'" would return the Money class and) - comment(# "has_many :clients" would return the Client class.) - reserved(def) method(klass)operator(()operator(\)) reserved(end) - - reserved(def) method(class_name) - instance_variable(@class_name) operator(||=) ident(name_to_class_name)operator(()ident(name)operator(.)ident(id2name)operator(\)) - reserved(end) - - reserved(def) method(==)operator(()ident(other_aggregation)operator(\)) - ident(name) operator(==) ident(other_aggregation)operator(.)ident(name) operator(&&) ident(other_aggregation)operator(.)ident(options) operator(&&) ident(active_record) operator(==) ident(other_aggregation)operator(.)ident(active_record) - reserved(end) - reserved(end) - - - comment(# Holds all the meta-data about an aggregation as it was specified in the Active Record class.) - reserved(class) class(AggregateReflection) operator(<) constant(MacroReflection) comment(#:nodoc:) - reserved(def) method(klass) - instance_variable(@klass) operator(||=) constant(Object)operator(.)ident(const_get)operator(()ident(options)operator([)symbol(:class_name)operator(]) operator(||) ident(class_name)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(name_to_class_name)operator(()ident(name)operator(\)) - ident(name)operator(.)ident(capitalize)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(s)operator(|) global_variable($1)operator(.)ident(capitalize) operator(}) - reserved(end) - reserved(end) - - comment(# Holds all the meta-data about an association as it was specified in the Active Record class.) - reserved(class) class(AssociationReflection) operator(<) constant(MacroReflection) comment(#:nodoc:) - reserved(def) method(klass) - instance_variable(@klass) operator(||=) ident(active_record)operator(.)ident(send)operator(()symbol(:compute_type)operator(,) ident(class_name)operator(\)) - reserved(end) - - reserved(def) method(table_name) - instance_variable(@table_name) operator(||=) ident(klass)operator(.)ident(table_name) - reserved(end) - - reserved(def) method(primary_key_name) - reserved(return) instance_variable(@primary_key_name) reserved(if) instance_variable(@primary_key_name) - reserved(case) - reserved(when) ident(macro) operator(==) symbol(:belongs_to) - instance_variable(@primary_key_name) operator(=) ident(options)operator([)symbol(:foreign_key)operator(]) operator(||) ident(class_name)operator(.)ident(foreign_key) - reserved(when) ident(options)operator([)symbol(:as)operator(]) - instance_variable(@primary_key_name) operator(=) ident(options)operator([)symbol(:foreign_key)operator(]) operator(||) stringcontent(_id)delimiter(")> - reserved(else) - instance_variable(@primary_key_name) operator(=) ident(options)operator([)symbol(:foreign_key)operator(]) operator(||) ident(active_record)operator(.)ident(name)operator(.)ident(foreign_key) - reserved(end) - reserved(end) - - reserved(def) method(association_foreign_key) - instance_variable(@association_foreign_key) operator(||=) instance_variable(@options)operator([)symbol(:association_foreign_key)operator(]) operator(||) ident(class_name)operator(.)ident(foreign_key) - reserved(end) - - reserved(def) method(counter_cache_column) - reserved(if) ident(options)operator([)symbol(:counter_cache)operator(]) operator(==) pre_constant(true) - stringcontent(_count)delimiter(")> - reserved(elsif) ident(options)operator([)symbol(:counter_cache)operator(]) - ident(options)operator([)symbol(:counter_cache)operator(]) - reserved(end) - reserved(end) - - reserved(def) method(through_reflection) - instance_variable(@through_reflection) operator(||=) ident(options)operator([)symbol(:through)operator(]) operator(?) ident(active_record)operator(.)ident(reflect_on_association)operator(()ident(options)operator([)symbol(:through)operator(])operator(\)) operator(:) pre_constant(false) - reserved(end) - - comment(# Gets an array of possible :through source reflection names) - comment(#) - comment(# [singularized, pluralized]) - reserved(def) method(source_reflection_names) - instance_variable(@source_reflection_names) operator(||=) operator(()ident(options)operator([)symbol(:source)operator(]) operator(?) operator([)ident(options)operator([)symbol(:source)operator(])operator(]) operator(:) operator([)ident(name)operator(.)ident(to_s)operator(.)ident(singularize)operator(,) ident(name)operator(])operator(\))operator(.)ident(collect) operator({) operator(|)ident(n)operator(|) ident(n)operator(.)ident(to_sym) operator(}) - reserved(end) - - comment(# Gets the source of the through reflection. It checks both a singularized and pluralized form for :belongs_to or :has_many.) - comment(# (The :tags association on Tagging below\)) - comment(# ) - comment(# class Post) - comment(# has_many :tags, :through => :taggings) - comment(# end) - comment(#) - reserved(def) method(source_reflection) - reserved(return) pre_constant(nil) reserved(unless) ident(through_reflection) - instance_variable(@source_reflection) operator(||=) ident(source_reflection_names)operator(.)ident(collect) operator({) operator(|)ident(name)operator(|) ident(through_reflection)operator(.)ident(klass)operator(.)ident(reflect_on_association)operator(()ident(name)operator(\)) operator(})operator(.)ident(compact)operator(.)ident(first) - reserved(end) - - reserved(def) method(check_validity!) - reserved(if) ident(options)operator([)symbol(:through)operator(]) - reserved(if) ident(through_reflection)operator(.)ident(nil?) - ident(raise) constant(HasManyThroughAssociationNotFoundError)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(if) ident(source_reflection)operator(.)ident(nil?) - ident(raise) constant(HasManyThroughSourceAssociationNotFoundError)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(if) ident(source_reflection)operator(.)ident(options)operator([)symbol(:polymorphic)operator(]) - ident(raise) constant(HasManyThroughAssociationPolymorphicError)operator(.)ident(new)operator(()ident(class_name)operator(,) pre_constant(self)operator(,) ident(source_reflection)operator(\)) - reserved(end) - - reserved(unless) operator([)symbol(:belongs_to)operator(,) symbol(:has_many)operator(])operator(.)ident(include?)operator(()ident(source_reflection)operator(.)ident(macro)operator(\)) operator(&&) ident(source_reflection)operator(.)ident(options)operator([)symbol(:through)operator(])operator(.)ident(nil?) - ident(raise) constant(HasManyThroughSourceAssociationMacroError)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - ident(private) - reserved(def) method(name_to_class_name)operator(()ident(name)operator(\)) - reserved(if) ident(name) operator(=)operator(~) regexp - ident(name) - reserved(else) - reserved(if) ident(options)operator([)symbol(:class_name)operator(]) - ident(options)operator([)symbol(:class_name)operator(]) - reserved(elsif) ident(through_reflection) comment(# get the class_name of the belongs_to association of the through reflection) - ident(source_reflection)operator(.)ident(class_name) - reserved(else) - ident(class_name) operator(=) ident(name)operator(.)ident(to_s)operator(.)ident(camelize) - ident(class_name) operator(=) ident(class_name)operator(.)ident(singularize) reserved(if) operator([) symbol(:has_many)operator(,) symbol(:has_and_belongs_to_many) operator(])operator(.)ident(include?)operator(()ident(macro)operator(\)) - ident(class_name) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - comment(# Allows programmers to programmatically define a schema in a portable) - comment(# DSL. This means you can define tables, indexes, etc. without using SQL) - comment(# directly, so your applications can more easily support multiple) - comment(# databases.) - comment(#) - comment(# Usage:) - comment(#) - comment(# ActiveRecord::Schema.define do) - comment(# create_table :authors do |t|) - comment(# t.column :name, :string, :null => false) - comment(# end) - comment(#) - comment(# add_index :authors, :name, :unique) - comment(#) - comment(# create_table :posts do |t|) - comment(# t.column :author_id, :integer, :null => false) - comment(# t.column :subject, :string) - comment(# t.column :body, :text) - comment(# t.column :private, :boolean, :default => false) - comment(# end) - comment(#) - comment(# add_index :posts, :author_id) - comment(# end) - comment(#) - comment(# ActiveRecord::Schema is only supported by database adapters that also) - comment(# support migrations, the two features being very similar.) - reserved(class) class(Schema) operator(<) constant(Migration) - ident(private_class_method) symbol(:new) - - comment(# Eval the given block. All methods available to the current connection) - comment(# adapter are available within the block, so you can easily use the) - comment(# database definition DSL to build up your schema (#create_table,) - comment(# #add_index, etc.\).) - comment(#) - comment(# The +info+ hash is optional, and if given is used to define metadata) - comment(# about the current schema (like the schema's version\):) - comment(#) - comment(# ActiveRecord::Schema.define(:version => 15\) do) - comment(# ...) - comment(# end) - reserved(def) pre_constant(self)operator(.)method(define)operator(()ident(info)operator(=)operator({)operator(})operator(,) operator(&)ident(block)operator(\)) - ident(instance_eval)operator(()operator(&)ident(block)operator(\)) - - reserved(unless) ident(info)operator(.)ident(empty?) - ident(initialize_schema_information) - ident(cols) operator(=) ident(columns)operator(()stringoperator(\)) - - ident(info) operator(=) ident(info)operator(.)ident(map) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) - ident(v) operator(=) constant(Base)operator(.)ident(connection)operator(.)ident(quote)operator(()ident(v)operator(,) ident(cols)operator(.)ident(detect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name) operator(==) ident(k)operator(.)ident(to_s) operator(})operator(\)) - stringcontent( = )inlinedelimiter(")> - reserved(end) - - constant(Base)operator(.)ident(connection)operator(.)ident(update) stringcontent( SET )inlineoperator(\))inline_delimiter(})>delimiter(")> - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - comment(# This class is used to dump the database schema for some connection to some) - comment(# output format (i.e., ActiveRecord::Schema\).) - reserved(class) class(SchemaDumper) comment(#:nodoc:) - ident(private_class_method) symbol(:new) - - comment(# A list of tables which should not be dumped to the schema. ) - comment(# Acceptable values are strings as well as regexp.) - comment(# This setting is only used if ActiveRecord::Base.schema_format == :ruby) - ident(cattr_accessor) symbol(:ignore_tables) - class_variable(@@ignore_tables) operator(=) operator([)operator(]) - - reserved(def) pre_constant(self)operator(.)method(dump)operator(()ident(connection)operator(=)constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(,) ident(stream)operator(=)pre_constant(STDOUT)operator(\)) - ident(new)operator(()ident(connection)operator(\))operator(.)ident(dump)operator(()ident(stream)operator(\)) - ident(stream) - reserved(end) - - reserved(def) method(dump)operator(()ident(stream)operator(\)) - ident(header)operator(()ident(stream)operator(\)) - ident(tables)operator(()ident(stream)operator(\)) - ident(trailer)operator(()ident(stream)operator(\)) - ident(stream) - reserved(end) - - ident(private) - - reserved(def) method(initialize)operator(()ident(connection)operator(\)) - instance_variable(@connection) operator(=) ident(connection) - instance_variable(@types) operator(=) instance_variable(@connection)operator(.)ident(native_database_types) - instance_variable(@info) operator(=) instance_variable(@connection)operator(.)ident(select_one)operator(()stringoperator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(header)operator(()ident(stream)operator(\)) - ident(define_params) operator(=) instance_variable(@info) operator(?) string )inlineoperator(])inline_delimiter(})>delimiter(")> operator(:) string - - ident(stream)operator(.)ident(puts) stringstringcontent(\) do -)delimiter( -HEADER)> - reserved(end) - - reserved(def) method(trailer)operator(()ident(stream)operator(\)) - ident(stream)operator(.)ident(puts) string - reserved(end) - - reserved(def) method(tables)operator(()ident(stream)operator(\)) - instance_variable(@connection)operator(.)ident(tables)operator(.)ident(sort)operator(.)ident(each) reserved(do) operator(|)ident(tbl)operator(|) - reserved(next) reserved(if) operator([)stringoperator(,) ident(ignore_tables)operator(])operator(.)ident(flatten)operator(.)ident(any?) reserved(do) operator(|)ident(ignored)operator(|) - reserved(case) ident(ignored) - reserved(when) constant(String)operator(:) ident(tbl) operator(==) ident(ignored) - reserved(when) constant(Regexp)operator(:) ident(tbl) operator(=)operator(~) ident(ignored) - reserved(else) - ident(raise) constant(StandardError)operator(,) string - reserved(end) - reserved(end) - ident(table)operator(()ident(tbl)operator(,) ident(stream)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(table)operator(()ident(table)operator(,) ident(stream)operator(\)) - ident(columns) operator(=) instance_variable(@connection)operator(.)ident(columns)operator(()ident(table)operator(\)) - reserved(begin) - ident(tbl) operator(=) constant(StringIO)operator(.)ident(new) - - reserved(if) instance_variable(@connection)operator(.)ident(respond_to?)operator(()symbol(:pk_and_sequence_for)operator(\)) - ident(pk)operator(,) ident(pk_seq) operator(=) instance_variable(@connection)operator(.)ident(pk_and_sequence_for)operator(()ident(table)operator(\)) - reserved(end) - ident(pk) operator(||=) string - - ident(tbl)operator(.)ident(print) stringdelimiter(")> - reserved(if) ident(columns)operator(.)ident(detect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name) operator(==) ident(pk) operator(}) - reserved(if) ident(pk) operator(!=) string - ident(tbl)operator(.)ident(print) string ")inlinecontent(")delimiter(\))> - reserved(end) - reserved(else) - ident(tbl)operator(.)ident(print) string false)delimiter(")> - reserved(end) - ident(tbl)operator(.)ident(print) string true)delimiter(")> - ident(tbl)operator(.)ident(puts) string - - ident(columns)operator(.)ident(each) reserved(do) operator(|)ident(column)operator(|) - ident(raise) constant(StandardError)operator(,) stringcontent(' for column ')inlinecontent(')delimiter(")> reserved(if) instance_variable(@types)operator([)ident(column)operator(.)ident(type)operator(])operator(.)ident(nil?) - reserved(next) reserved(if) ident(column)operator(.)ident(name) operator(==) ident(pk) - ident(tbl)operator(.)ident(print) stringcontent(, )inlinedelimiter(")> - ident(tbl)operator(.)ident(print) string )inlinedelimiter(")> reserved(if) ident(column)operator(.)ident(limit) operator(!=) instance_variable(@types)operator([)ident(column)operator(.)ident(type)operator(])operator([)symbol(:limit)operator(]) - ident(tbl)operator(.)ident(print) string )inlinedelimiter(")> reserved(if) operator(!)ident(column)operator(.)ident(default)operator(.)ident(nil?) - ident(tbl)operator(.)ident(print) string false)delimiter(")> reserved(if) operator(!)ident(column)operator(.)ident(null) - ident(tbl)operator(.)ident(puts) - reserved(end) - - ident(tbl)operator(.)ident(puts) string - ident(tbl)operator(.)ident(puts) - - ident(indexes)operator(()ident(table)operator(,) ident(tbl)operator(\)) - - ident(tbl)operator(.)ident(rewind) - ident(stream)operator(.)ident(print) ident(tbl)operator(.)ident(read) - reserved(rescue) operator(=)operator(>) ident(e) - ident(stream)operator(.)ident(puts) stringcontent( because of following )inlinedelimiter(")> - ident(stream)operator(.)ident(puts) stringdelimiter(")> - ident(stream)operator(.)ident(puts) - reserved(end) - - ident(stream) - reserved(end) - - reserved(def) method(indexes)operator(()ident(table)operator(,) ident(stream)operator(\)) - ident(indexes) operator(=) instance_variable(@connection)operator(.)ident(indexes)operator(()ident(table)operator(\)) - ident(indexes)operator(.)ident(each) reserved(do) operator(|)ident(index)operator(|) - ident(stream)operator(.)ident(print) stringcontent(, )inlinecontent(, :name => )inlinedelimiter(")> - ident(stream)operator(.)ident(print) string true)delimiter(")> reserved(if) ident(index)operator(.)ident(unique) - ident(stream)operator(.)ident(puts) - reserved(end) - ident(stream)operator(.)ident(puts) reserved(unless) ident(indexes)operator(.)ident(empty?) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - comment(# Active Records will automatically record creation and/or update timestamps of database objects) - comment(# if fields of the names created_at/created_on or updated_at/updated_on are present. This module is) - comment(# automatically included, so you don't need to do that manually.) - comment(#) - comment(# This behavior can be turned off by setting ActiveRecord::Base.record_timestamps = false.) - comment(# This behavior by default uses local time, but can use UTC by setting ActiveRecord::Base.default_timezone = :utc) - reserved(module) class(Timestamp) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(# :nodoc:) - reserved(super) - - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:create_without_timestamps)operator(,) symbol(:create) - ident(alias_method) symbol(:create)operator(,) symbol(:create_with_timestamps) - - ident(alias_method) symbol(:update_without_timestamps)operator(,) symbol(:update) - ident(alias_method) symbol(:update)operator(,) symbol(:update_with_timestamps) - reserved(end) - reserved(end) - - reserved(def) method(create_with_timestamps) comment(#:nodoc:) - reserved(if) ident(record_timestamps) - ident(t) operator(=) operator(() pre_constant(self)operator(.)ident(class)operator(.)ident(default_timezone) operator(==) symbol(:utc) operator(?) constant(Time)operator(.)ident(now)operator(.)ident(utc) operator(:) constant(Time)operator(.)ident(now) operator(\)) - ident(write_attribute)operator(()stringoperator(,) ident(t)operator(\)) reserved(if) ident(respond_to?)operator(()symbol(:created_at)operator(\)) operator(&&) ident(created_at)operator(.)ident(nil?) - ident(write_attribute)operator(()stringoperator(,) ident(t)operator(\)) reserved(if) ident(respond_to?)operator(()symbol(:created_on)operator(\)) operator(&&) ident(created_on)operator(.)ident(nil?) - - ident(write_attribute)operator(()stringoperator(,) ident(t)operator(\)) reserved(if) ident(respond_to?)operator(()symbol(:updated_at)operator(\)) - ident(write_attribute)operator(()stringoperator(,) ident(t)operator(\)) reserved(if) ident(respond_to?)operator(()symbol(:updated_on)operator(\)) - reserved(end) - ident(create_without_timestamps) - reserved(end) - - reserved(def) method(update_with_timestamps) comment(#:nodoc:) - reserved(if) ident(record_timestamps) - ident(t) operator(=) operator(() pre_constant(self)operator(.)ident(class)operator(.)ident(default_timezone) operator(==) symbol(:utc) operator(?) constant(Time)operator(.)ident(now)operator(.)ident(utc) operator(:) constant(Time)operator(.)ident(now) operator(\)) - ident(write_attribute)operator(()stringoperator(,) ident(t)operator(\)) reserved(if) ident(respond_to?)operator(()symbol(:updated_at)operator(\)) - ident(write_attribute)operator(()stringoperator(,) ident(t)operator(\)) reserved(if) ident(respond_to?)operator(()symbol(:updated_on)operator(\)) - reserved(end) - ident(update_without_timestamps) - reserved(end) - reserved(end) - - reserved(class) class(Base) - comment(# Records the creation date and possibly time in created_on (date only\) or created_at (date and time\) and the update date and possibly) - comment(# time in updated_on and updated_at. This only happens if the object responds to either of these messages, which they will do automatically) - comment(# if the table has columns of either of these names. This feature is turned on by default.) - class_variable(@@record_timestamps) operator(=) pre_constant(true) - ident(cattr_accessor) symbol(:record_timestamps) - - comment(# deprecated: use ActiveRecord::Base.default_timezone instead.) - class_variable(@@timestamps_gmt) operator(=) pre_constant(false) - reserved(def) pre_constant(self)operator(.)method(timestamps_gmt=)operator(() ident(gmt) operator(\)) comment(#:nodoc:) - ident(warn) string - pre_constant(self)operator(.)ident(default_timezone) operator(=) operator(() ident(gmt) operator(?) symbol(:utc) operator(:) symbol(:local) operator(\)) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(timestamps_gmt) comment(#:nodoc:) - ident(warn) string - pre_constant(self)operator(.)ident(default_timezone) operator(==) symbol(:utc) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -constant(Transaction)operator(::)constant(Simple)operator(.)ident(send)operator(()symbol(:remove_method)operator(,) symbol(:transaction)operator(\)) -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(module) class(Transactions) comment(# :nodoc:) - constant(TRANSACTION_MUTEX) operator(=) constant(Mutex)operator(.)ident(new) - - reserved(class) class(TransactionError) operator(<) constant(ActiveRecordError) comment(# :nodoc:) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:destroy_without_transactions)operator(,) symbol(:destroy) - ident(alias_method) symbol(:destroy)operator(,) symbol(:destroy_with_transactions) - - ident(alias_method) symbol(:save_without_transactions)operator(,) symbol(:save) - ident(alias_method) symbol(:save)operator(,) symbol(:save_with_transactions) - reserved(end) - reserved(end) - - comment(# Transactions are protective blocks where SQL statements are only permanent if they can all succeed as one atomic action. ) - comment(# The classic example is a transfer between two accounts where you can only have a deposit if the withdrawal succeeded and) - comment(# vice versa. Transactions enforce the integrity of the database and guard the data against program errors or database break-downs.) - comment(# So basically you should use transaction blocks whenever you have a number of statements that must be executed together or) - comment(# not at all. Example:) - comment(#) - comment(# transaction do) - comment(# david.withdrawal(100\)) - comment(# mary.deposit(100\)) - comment(# end) - comment(#) - comment(# This example will only take money from David and give to Mary if neither +withdrawal+ nor +deposit+ raises an exception.) - comment(# Exceptions will force a ROLLBACK that returns the database to the state before the transaction was begun. Be aware, though,) - comment(# that the objects by default will _not_ have their instance data returned to their pre-transactional state.) - comment(#) - comment(# == Transactions are not distributed across database connections) - comment(#) - comment(# A transaction acts on a single database connection. If you have) - comment(# multiple class-specific databases, the transaction will not protect) - comment(# interaction among them. One workaround is to begin a transaction) - comment(# on each class whose models you alter:) - comment(#) - comment(# Student.transaction do) - comment(# Course.transaction do) - comment(# course.enroll(student\)) - comment(# student.units += course.units) - comment(# end) - comment(# end) - comment(#) - comment(# This is a poor solution, but full distributed transactions are beyond) - comment(# the scope of Active Record.) - comment(#) - comment(# == Save and destroy are automatically wrapped in a transaction) - comment(#) - comment(# Both Base#save and Base#destroy come wrapped in a transaction that ensures that whatever you do in validations or callbacks) - comment(# will happen under the protected cover of a transaction. So you can use validations to check for values that the transaction) - comment(# depend on or you can raise exceptions in the callbacks to rollback.) - comment(#) - comment(# == Object-level transactions) - comment(#) - comment(# You can enable object-level transactions for Active Record objects, though. You do this by naming each of the Active Records) - comment(# that you want to enable object-level transactions for, like this:) - comment(#) - comment(# Account.transaction(david, mary\) do) - comment(# david.withdrawal(100\)) - comment(# mary.deposit(100\)) - comment(# end) - comment(#) - comment(# If the transaction fails, David and Mary will be returned to their pre-transactional state. No money will have changed hands in) - comment(# neither object nor database.) - comment(#) - comment(# == Exception handling) - comment(#) - comment(# Also have in mind that exceptions thrown within a transaction block will be propagated (after triggering the ROLLBACK\), so you) - comment(# should be ready to catch those in your application code.) - comment(#) - comment(# Tribute: Object-level transactions are implemented by Transaction::Simple by Austin Ziegler.) - reserved(module) class(ClassMethods) - reserved(def) method(transaction)operator(()operator(*)ident(objects)operator(,) operator(&)ident(block)operator(\)) - ident(previous_handler) operator(=) ident(trap)operator(()stringoperator(\)) operator({) ident(raise) constant(TransactionError)operator(,) string operator(}) - ident(lock_mutex) - - reserved(begin) - ident(objects)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(o)operator(.)ident(extend)operator(()constant(Transaction)operator(::)constant(Simple)operator(\)) operator(}) - ident(objects)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(o)operator(.)ident(start_transaction) operator(}) - - ident(result) operator(=) ident(connection)operator(.)ident(transaction)operator(()constant(Thread)operator(.)ident(current)operator([)stringoperator(])operator(,) operator(&)ident(block)operator(\)) - - ident(objects)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(o)operator(.)ident(commit_transaction) operator(}) - reserved(return) ident(result) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(object_transaction_rollback) - ident(objects)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(o)operator(.)ident(abort_transaction) operator(}) - ident(raise) - reserved(ensure) - ident(unlock_mutex) - ident(trap)operator(()stringoperator(,) ident(previous_handler)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(lock_mutex)comment(#:nodoc:) - constant(Thread)operator(.)ident(current)operator([)stringoperator(]) operator(||=) integer(0) - constant(TRANSACTION_MUTEX)operator(.)ident(lock) reserved(if) constant(Thread)operator(.)ident(current)operator([)stringoperator(]) operator(==) integer(0) - constant(Thread)operator(.)ident(current)operator([)stringoperator(]) operator(=) operator(()constant(Thread)operator(.)ident(current)operator([)stringoperator(]) operator(==) integer(0)operator(\)) - constant(Thread)operator(.)ident(current)operator([)stringoperator(]) operator(+=) integer(1) - reserved(end) - - reserved(def) method(unlock_mutex)comment(#:nodoc:) - constant(Thread)operator(.)ident(current)operator([)stringoperator(]) operator(-=) integer(1) - constant(TRANSACTION_MUTEX)operator(.)ident(unlock) reserved(if) constant(Thread)operator(.)ident(current)operator([)stringoperator(]) operator(==) integer(0) - reserved(end) - reserved(end) - - reserved(def) method(transaction)operator(()operator(*)ident(objects)operator(,) operator(&)ident(block)operator(\)) - pre_constant(self)operator(.)ident(class)operator(.)ident(transaction)operator(()operator(*)ident(objects)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(destroy_with_transactions) comment(#:nodoc:) - ident(transaction) operator({) ident(destroy_without_transactions) operator(}) - reserved(end) - - reserved(def) method(save_with_transactions)operator(()ident(perform_validation) operator(=) pre_constant(true)operator(\)) comment(#:nodoc:) - ident(transaction) operator({) ident(save_without_transactions)operator(()ident(perform_validation)operator(\)) operator(}) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - comment(# Raised by save! and create! when the record is invalid. Use the) - comment(# record method to retrieve the record which did not validate.) - comment(# begin) - comment(# complex_operation_that_calls_save!_internally) - comment(# rescue ActiveRecord::RecordInvalid => invalid) - comment(# puts invalid.record.errors) - comment(# end) - reserved(class) class(RecordInvalid) operator(<) constant(ActiveRecordError) comment(#:nodoc:) - ident(attr_reader) symbol(:record) - reserved(def) method(initialize)operator(()ident(record)operator(\)) - instance_variable(@record) operator(=) ident(record) - reserved(super)operator(()stringoperator(\))inline_delimiter(})>delimiter(")>operator(\)) - reserved(end) - reserved(end) - - comment(# Active Record validation is reported to and from this object, which is used by Base#save to) - comment(# determine whether the object in a valid state to be saved. See usage example in Validations.) - reserved(class) class(Errors) - ident(include) constant(Enumerable) - - reserved(def) method(initialize)operator(()ident(base)operator(\)) comment(# :nodoc:) - instance_variable(@base)operator(,) instance_variable(@errors) operator(=) ident(base)operator(,) operator({)operator(}) - reserved(end) - - class_variable(@@default_error_messages) operator(=) operator({) - symbol(:inclusion) operator(=)operator(>) stringoperator(,) - symbol(:exclusion) operator(=)operator(>) stringoperator(,) - symbol(:invalid) operator(=)operator(>) stringoperator(,) - symbol(:confirmation) operator(=)operator(>) stringoperator(,) - symbol(:accepted) operator(=)operator(>) stringoperator(,) - symbol(:empty) operator(=)operator(>) stringoperator(,) - symbol(:blank) operator(=)operator(>) stringoperator(,) - symbol(:too_long) operator(=)operator(>) stringoperator(,) - symbol(:too_short) operator(=)operator(>) stringoperator(,) - symbol(:wrong_length) operator(=)operator(>) stringoperator(,) - symbol(:taken) operator(=)operator(>) stringoperator(,) - symbol(:not_a_number) operator(=)operator(>) string - operator(}) - - comment(# Holds a hash with all the default error messages, such that they can be replaced by your own copy or localizations.) - ident(cattr_accessor) symbol(:default_error_messages) - - - comment(# Adds an error to the base object instead of any particular attribute. This is used) - comment(# to report errors that don't tie to any specific attribute, but rather to the object) - comment(# as a whole. These error messages don't get prepended with any field name when iterating) - comment(# with each_full, so they should be complete sentences.) - reserved(def) method(add_to_base)operator(()ident(msg)operator(\)) - ident(add)operator(()symbol(:base)operator(,) ident(msg)operator(\)) - reserved(end) - - comment(# Adds an error message (+msg+\) to the +attribute+, which will be returned on a call to on(attribute\)) - comment(# for the same attribute and ensure that this error object returns false when asked if empty?. More than one) - comment(# error can be added to the same +attribute+ in which case an array will be returned on a call to on(attribute\).) - comment(# If no +msg+ is supplied, "invalid" is assumed.) - reserved(def) method(add)operator(()ident(attribute)operator(,) ident(msg) operator(=) class_variable(@@default_error_messages)operator([)symbol(:invalid)operator(])operator(\)) - instance_variable(@errors)operator([)ident(attribute)operator(.)ident(to_s)operator(]) operator(=) operator([)operator(]) reserved(if) instance_variable(@errors)operator([)ident(attribute)operator(.)ident(to_s)operator(])operator(.)ident(nil?) - instance_variable(@errors)operator([)ident(attribute)operator(.)ident(to_s)operator(]) operator(<<) ident(msg) - reserved(end) - - comment(# Will add an error message to each of the attributes in +attributes+ that is empty.) - reserved(def) method(add_on_empty)operator(()ident(attributes)operator(,) ident(msg) operator(=) class_variable(@@default_error_messages)operator([)symbol(:empty)operator(])operator(\)) - reserved(for) ident(attr) reserved(in) operator([)ident(attributes)operator(])operator(.)ident(flatten) - ident(value) operator(=) instance_variable(@base)operator(.)ident(respond_to?)operator(()ident(attr)operator(.)ident(to_s)operator(\)) operator(?) instance_variable(@base)operator(.)ident(send)operator(()ident(attr)operator(.)ident(to_s)operator(\)) operator(:) instance_variable(@base)operator([)ident(attr)operator(.)ident(to_s)operator(]) - ident(is_empty) operator(=) ident(value)operator(.)ident(respond_to?)operator(()stringoperator(\)) operator(?) ident(value)operator(.)ident(empty?) operator(:) pre_constant(false) - ident(add)operator(()ident(attr)operator(,) ident(msg)operator(\)) reserved(unless) operator(!)ident(value)operator(.)ident(nil?) operator(&&) operator(!)ident(is_empty) - reserved(end) - reserved(end) - - comment(# Will add an error message to each of the attributes in +attributes+ that is blank (using Object#blank?\).) - reserved(def) method(add_on_blank)operator(()ident(attributes)operator(,) ident(msg) operator(=) class_variable(@@default_error_messages)operator([)symbol(:blank)operator(])operator(\)) - reserved(for) ident(attr) reserved(in) operator([)ident(attributes)operator(])operator(.)ident(flatten) - ident(value) operator(=) instance_variable(@base)operator(.)ident(respond_to?)operator(()ident(attr)operator(.)ident(to_s)operator(\)) operator(?) instance_variable(@base)operator(.)ident(send)operator(()ident(attr)operator(.)ident(to_s)operator(\)) operator(:) instance_variable(@base)operator([)ident(attr)operator(.)ident(to_s)operator(]) - ident(add)operator(()ident(attr)operator(,) ident(msg)operator(\)) reserved(if) ident(value)operator(.)ident(blank?) - reserved(end) - reserved(end) - - comment(# Will add an error message to each of the attributes in +attributes+ that has a length outside of the passed boundary +range+.) - comment(# If the length is above the boundary, the too_long_msg message will be used. If below, the too_short_msg.) - reserved(def) method(add_on_boundary_breaking)operator(()ident(attributes)operator(,) ident(range)operator(,) ident(too_long_msg) operator(=) class_variable(@@default_error_messages)operator([)symbol(:too_long)operator(])operator(,) ident(too_short_msg) operator(=) class_variable(@@default_error_messages)operator([)symbol(:too_short)operator(])operator(\)) - reserved(for) ident(attr) reserved(in) operator([)ident(attributes)operator(])operator(.)ident(flatten) - ident(value) operator(=) instance_variable(@base)operator(.)ident(respond_to?)operator(()ident(attr)operator(.)ident(to_s)operator(\)) operator(?) instance_variable(@base)operator(.)ident(send)operator(()ident(attr)operator(.)ident(to_s)operator(\)) operator(:) instance_variable(@base)operator([)ident(attr)operator(.)ident(to_s)operator(]) - ident(add)operator(()ident(attr)operator(,) ident(too_short_msg) operator(%) ident(range)operator(.)ident(begin)operator(\)) reserved(if) ident(value) operator(&&) ident(value)operator(.)ident(length) operator(<) ident(range)operator(.)ident(begin) - ident(add)operator(()ident(attr)operator(,) ident(too_long_msg) operator(%) ident(range)operator(.)ident(end)operator(\)) reserved(if) ident(value) operator(&&) ident(value)operator(.)ident(length) operator(>) ident(range)operator(.)ident(end) - reserved(end) - reserved(end) - - reserved(alias) symbol(:add_on_boundry_breaking) symbol(:add_on_boundary_breaking) - - comment(# Returns true if the specified +attribute+ has errors associated with it.) - reserved(def) method(invalid?)operator(()ident(attribute)operator(\)) - operator(!)instance_variable(@errors)operator([)ident(attribute)operator(.)ident(to_s)operator(])operator(.)ident(nil?) - reserved(end) - - comment(# * Returns nil, if no errors are associated with the specified +attribute+.) - comment(# * Returns the error message, if one error is associated with the specified +attribute+.) - comment(# * Returns an array of error messages, if more than one error is associated with the specified +attribute+.) - reserved(def) method(on)operator(()ident(attribute)operator(\)) - reserved(if) instance_variable(@errors)operator([)ident(attribute)operator(.)ident(to_s)operator(])operator(.)ident(nil?) - pre_constant(nil) - reserved(elsif) instance_variable(@errors)operator([)ident(attribute)operator(.)ident(to_s)operator(])operator(.)ident(length) operator(==) integer(1) - instance_variable(@errors)operator([)ident(attribute)operator(.)ident(to_s)operator(])operator(.)ident(first) - reserved(else) - instance_variable(@errors)operator([)ident(attribute)operator(.)ident(to_s)operator(]) - reserved(end) - reserved(end) - - reserved(alias) symbol(:[]) symbol(:on) - - comment(# Returns errors assigned to base object through add_to_base according to the normal rules of on(attribute\).) - reserved(def) method(on_base) - ident(on)operator(()symbol(:base)operator(\)) - reserved(end) - - comment(# Yields each attribute and associated message per error added.) - reserved(def) method(each) - instance_variable(@errors)operator(.)ident(each_key) operator({) operator(|)ident(attr)operator(|) instance_variable(@errors)operator([)ident(attr)operator(])operator(.)ident(each) operator({) operator(|)ident(msg)operator(|) reserved(yield) ident(attr)operator(,) ident(msg) operator(}) operator(}) - reserved(end) - - comment(# Yields each full error message added. So Person.errors.add("first_name", "can't be empty"\) will be returned) - comment(# through iteration as "First name can't be empty".) - reserved(def) method(each_full) - ident(full_messages)operator(.)ident(each) operator({) operator(|)ident(msg)operator(|) reserved(yield) ident(msg) operator(}) - reserved(end) - - comment(# Returns all the full error messages in an array.) - reserved(def) method(full_messages) - ident(full_messages) operator(=) operator([)operator(]) - - instance_variable(@errors)operator(.)ident(each_key) reserved(do) operator(|)ident(attr)operator(|) - instance_variable(@errors)operator([)ident(attr)operator(])operator(.)ident(each) reserved(do) operator(|)ident(msg)operator(|) - reserved(next) reserved(if) ident(msg)operator(.)ident(nil?) - - reserved(if) ident(attr) operator(==) string - ident(full_messages) operator(<<) ident(msg) - reserved(else) - ident(full_messages) operator(<<) instance_variable(@base)operator(.)ident(class)operator(.)ident(human_attribute_name)operator(()ident(attr)operator(\)) operator(+) string operator(+) ident(msg) - reserved(end) - reserved(end) - reserved(end) - - reserved(return) ident(full_messages) - reserved(end) - - comment(# Returns true if no errors have been added.) - reserved(def) method(empty?) - reserved(return) instance_variable(@errors)operator(.)ident(empty?) - reserved(end) - - comment(# Removes all the errors that have been added.) - reserved(def) method(clear) - instance_variable(@errors) operator(=) operator({)operator(}) - reserved(end) - - comment(# Returns the total number of errors added. Two errors added to the same attribute will be counted as such) - comment(# with this as well.) - reserved(def) method(size) - ident(error_count) operator(=) integer(0) - instance_variable(@errors)operator(.)ident(each_value) operator({) operator(|)ident(attribute)operator(|) ident(error_count) operator(+=) ident(attribute)operator(.)ident(length) operator(}) - ident(error_count) - reserved(end) - - ident(alias_method) symbol(:count)operator(,) symbol(:size) - ident(alias_method) symbol(:length)operator(,) symbol(:size) - reserved(end) - - - comment(# Active Records implement validation by overwriting Base#validate (or the variations, +validate_on_create+ and) - comment(# +validate_on_update+\). Each of these methods can inspect the state of the object, which usually means ensuring) - comment(# that a number of attributes have a certain value (such as not empty, within a given range, matching a certain regular expression\).) - comment(#) - comment(# Example:) - comment(#) - comment(# class Person < ActiveRecord::Base) - comment(# protected) - comment(# def validate) - comment(# errors.add_on_empty %w( first_name last_name \)) - comment(# errors.add("phone_number", "has invalid format"\) unless phone_number =~ /[0-9]*/) - comment(# end) - comment(#) - comment(# def validate_on_create # is only run the first time a new object is saved) - comment(# unless valid_discount?(membership_discount\)) - comment(# errors.add("membership_discount", "has expired"\)) - comment(# end) - comment(# end) - comment(#) - comment(# def validate_on_update) - comment(# errors.add_to_base("No changes have occurred"\) if unchanged_attributes?) - comment(# end) - comment(# end) - comment(#) - comment(# person = Person.new("first_name" => "David", "phone_number" => "what?"\)) - comment(# person.save # => false (and doesn't do the save\)) - comment(# person.errors.empty? # => false) - comment(# person.errors.count # => 2) - comment(# person.errors.on "last_name" # => "can't be empty") - comment(# person.errors.on "phone_number" # => "has invalid format") - comment(# person.errors.each_full { |msg| puts msg }) - comment(# # => "Last name can't be empty\\n" +) - comment(# "Phone number has invalid format") - comment(#) - comment(# person.attributes = { "last_name" => "Heinemeier", "phone_number" => "555-555" }) - comment(# person.save # => true (and person is now saved in the database\)) - comment(#) - comment(# An +Errors+ object is automatically created for every Active Record.) - comment(#) - comment(# Please do have a look at ActiveRecord::Validations::ClassMethods for a higher level of validations.) - reserved(module) class(Validations) - constant(VALIDATIONS) operator(=) string - - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(# :nodoc:) - reserved(super) - ident(base)operator(.)ident(extend) constant(ClassMethods) - ident(base)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:save_without_validation)operator(,) symbol(:save) - ident(alias_method) symbol(:save)operator(,) symbol(:save_with_validation) - - ident(alias_method) symbol(:save_without_validation!)operator(,) symbol(:save!) - ident(alias_method) symbol(:save!)operator(,) symbol(:save_with_validation!) - - ident(alias_method) symbol(:update_attribute_without_validation_skipping)operator(,) symbol(:update_attribute) - ident(alias_method) symbol(:update_attribute)operator(,) symbol(:update_attribute_with_validation_skipping) - reserved(end) - reserved(end) - - comment(# All of the following validations are defined in the class scope of the model that you're interested in validating.) - comment(# They offer a more declarative way of specifying when the model is valid and when it is not. It is recommended to use) - comment(# these over the low-level calls to validate and validate_on_create when possible.) - reserved(module) class(ClassMethods) - constant(DEFAULT_VALIDATION_OPTIONS) operator(=) operator({) - symbol(:on) operator(=)operator(>) symbol(:save)operator(,) - symbol(:allow_nil) operator(=)operator(>) pre_constant(false)operator(,) - symbol(:message) operator(=)operator(>) pre_constant(nil) - operator(})operator(.)ident(freeze) - - constant(ALL_RANGE_OPTIONS) operator(=) operator([) symbol(:is)operator(,) symbol(:within)operator(,) symbol(:in)operator(,) symbol(:minimum)operator(,) symbol(:maximum) operator(])operator(.)ident(freeze) - - reserved(def) method(validate)operator(()operator(*)ident(methods)operator(,) operator(&)ident(block)operator(\)) - ident(methods) operator(<<) ident(block) reserved(if) ident(block_given?) - ident(write_inheritable_set)operator(()symbol(:validate)operator(,) ident(methods)operator(\)) - reserved(end) - - reserved(def) method(validate_on_create)operator(()operator(*)ident(methods)operator(,) operator(&)ident(block)operator(\)) - ident(methods) operator(<<) ident(block) reserved(if) ident(block_given?) - ident(write_inheritable_set)operator(()symbol(:validate_on_create)operator(,) ident(methods)operator(\)) - reserved(end) - - reserved(def) method(validate_on_update)operator(()operator(*)ident(methods)operator(,) operator(&)ident(block)operator(\)) - ident(methods) operator(<<) ident(block) reserved(if) ident(block_given?) - ident(write_inheritable_set)operator(()symbol(:validate_on_update)operator(,) ident(methods)operator(\)) - reserved(end) - - reserved(def) method(condition_block?)operator(()ident(condition)operator(\)) - ident(condition)operator(.)ident(respond_to?)operator(()stringoperator(\)) operator(&&) operator(()ident(condition)operator(.)ident(arity) operator(==) integer(1) operator(||) ident(condition)operator(.)ident(arity) operator(==) integer(-1)operator(\)) - reserved(end) - - comment(# Determine from the given condition (whether a block, procedure, method or string\)) - comment(# whether or not to validate the record. See #validates_each.) - reserved(def) method(evaluate_condition)operator(()ident(condition)operator(,) ident(record)operator(\)) - reserved(case) ident(condition) - reserved(when) constant(Symbol)operator(:) ident(record)operator(.)ident(send)operator(()ident(condition)operator(\)) - reserved(when) constant(String)operator(:) ident(eval)operator(()ident(condition)operator(,) ident(binding)operator(\)) - reserved(else) - reserved(if) ident(condition_block?)operator(()ident(condition)operator(\)) - ident(condition)operator(.)ident(call)operator(()ident(record)operator(\)) - reserved(else) - ident(raise)operator(() - constant(ActiveRecordError)operator(,) - string operator(+) - string - operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Validates each attribute against a block.) - comment(#) - comment(# class Person < ActiveRecord::Base) - comment(# validates_each :first_name, :last_name do |record, attr, value|) - comment(# record.errors.add attr, 'starts with z.' if value[0] == ?z) - comment(# end) - comment(# end) - comment(#) - comment(# Options:) - comment(# * on - Specifies when this validation is active (default is :save, other options :create, :update\)) - comment(# * allow_nil - Skip validation if attribute is nil.) - comment(# * if - Specifies a method, proc or string to call to determine if the validation should) - comment(# occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }\). The) - comment(# method, proc or string should return or evaluate to a true or false value.) - reserved(def) method(validates_each)operator(()operator(*)ident(attrs)operator(\)) - ident(options) operator(=) ident(attrs)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(attrs)operator(.)ident(pop)operator(.)ident(symbolize_keys) operator(:) operator({)operator(}) - ident(attrs) operator(=) ident(attrs)operator(.)ident(flatten) - - comment(# Declare the validation.) - ident(send)operator(()ident(validation_method)operator(()ident(options)operator([)symbol(:on)operator(]) operator(||) symbol(:save)operator(\))operator(\)) reserved(do) operator(|)ident(record)operator(|) - comment(# Don't validate when there is an :if condition and that condition is false) - reserved(unless) ident(options)operator([)symbol(:if)operator(]) operator(&&) operator(!)ident(evaluate_condition)operator(()ident(options)operator([)symbol(:if)operator(])operator(,) ident(record)operator(\)) - ident(attrs)operator(.)ident(each) reserved(do) operator(|)ident(attr)operator(|) - ident(value) operator(=) ident(record)operator(.)ident(send)operator(()ident(attr)operator(\)) - reserved(next) reserved(if) ident(value)operator(.)ident(nil?) operator(&&) ident(options)operator([)symbol(:allow_nil)operator(]) - reserved(yield) ident(record)operator(,) ident(attr)operator(,) ident(value) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# Encapsulates the pattern of wanting to validate a password or email address field with a confirmation. Example:) - comment(#) - comment(# Model:) - comment(# class Person < ActiveRecord::Base) - comment(# validates_confirmation_of :user_name, :password) - comment(# validates_confirmation_of :email_address, :message => "should match confirmation") - comment(# end) - comment(#) - comment(# View:) - comment(# <%= password_field "person", "password" %>) - comment(# <%= password_field "person", "password_confirmation" %>) - comment(#) - comment(# The person has to already have a password attribute (a column in the people table\), but the password_confirmation is virtual.) - comment(# It exists only as an in-memory variable for validating the password. This check is performed only if password_confirmation) - comment(# is not nil and by default on save.) - comment(#) - comment(# Configuration options:) - comment(# * message - A custom error message (default is: "doesn't match confirmation"\)) - comment(# * on - Specifies when this validation is active (default is :save, other options :create, :update\)) - comment(# * if - Specifies a method, proc or string to call to determine if the validation should) - comment(# occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }\). The) - comment(# method, proc or string should return or evaluate to a true or false value.) - reserved(def) method(validates_confirmation_of)operator(()operator(*)ident(attr_names)operator(\)) - ident(configuration) operator(=) operator({) symbol(:message) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:confirmation)operator(])operator(,) symbol(:on) operator(=)operator(>) symbol(:save) operator(}) - ident(configuration)operator(.)ident(update)operator(()ident(attr_names)operator(.)ident(pop)operator(\)) reserved(if) ident(attr_names)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - ident(attr_accessor) operator(*)operator(()ident(attr_names)operator(.)ident(map) operator({) operator(|)ident(n)operator(|) stringcontent(_confirmation)delimiter(")> operator(})operator(\)) - - ident(validates_each)operator(()ident(attr_names)operator(,) ident(configuration)operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr_name)operator(,) ident(value)operator(|) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr_name)operator(,) ident(configuration)operator([)symbol(:message)operator(])operator(\)) reserved(unless) ident(record)operator(.)ident(send)operator(()stringcontent(_confirmation)delimiter(")>operator(\))operator(.)ident(nil?) reserved(or) ident(value) operator(==) ident(record)operator(.)ident(send)operator(()stringcontent(_confirmation)delimiter(")>operator(\)) - reserved(end) - reserved(end) - - comment(# Encapsulates the pattern of wanting to validate the acceptance of a terms of service check box (or similar agreement\). Example:) - comment(#) - comment(# class Person < ActiveRecord::Base) - comment(# validates_acceptance_of :terms_of_service) - comment(# validates_acceptance_of :eula, :message => "must be abided") - comment(# end) - comment(#) - comment(# The terms_of_service attribute is entirely virtual. No database column is needed. This check is performed only if) - comment(# terms_of_service is not nil and by default on save.) - comment(#) - comment(# Configuration options:) - comment(# * message - A custom error message (default is: "must be accepted"\)) - comment(# * on - Specifies when this validation is active (default is :save, other options :create, :update\)) - comment(# * accept - Specifies value that is considered accepted. The default value is a string "1", which) - comment(# makes it easy to relate to an HTML checkbox.) - comment(# * if - Specifies a method, proc or string to call to determine if the validation should) - comment(# occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }\). The) - comment(# method, proc or string should return or evaluate to a true or false value.) - reserved(def) method(validates_acceptance_of)operator(()operator(*)ident(attr_names)operator(\)) - ident(configuration) operator(=) operator({) symbol(:message) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:accepted)operator(])operator(,) symbol(:on) operator(=)operator(>) symbol(:save)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(true)operator(,) symbol(:accept) operator(=)operator(>) string operator(}) - ident(configuration)operator(.)ident(update)operator(()ident(attr_names)operator(.)ident(pop)operator(\)) reserved(if) ident(attr_names)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - ident(attr_accessor) operator(*)ident(attr_names) - - ident(validates_each)operator(()ident(attr_names)operator(,)ident(configuration)operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr_name)operator(,) ident(value)operator(|) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr_name)operator(,) ident(configuration)operator([)symbol(:message)operator(])operator(\)) reserved(unless) ident(value) operator(==) ident(configuration)operator([)symbol(:accept)operator(]) - reserved(end) - reserved(end) - - comment(# Validates that the specified attributes are not blank (as defined by Object#blank?\). Happens by default on save. Example:) - comment(#) - comment(# class Person < ActiveRecord::Base) - comment(# validates_presence_of :first_name) - comment(# end) - comment(#) - comment(# The first_name attribute must be in the object and it cannot be blank.) - comment(# ) - comment(# Configuration options:) - comment(# * message - A custom error message (default is: "can't be blank"\)) - comment(# * on - Specifies when this validation is active (default is :save, other options :create, :update\)) - comment(# * if - Specifies a method, proc or string to call to determine if the validation should) - comment(# occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }\). The) - comment(# method, proc or string should return or evaluate to a true or false value.) - comment(#) - comment(# === Warning) - comment(# Validate the presence of the foreign key, not the instance variable itself.) - comment(# Do this:) - comment(# validate_presence_of :invoice_id) - comment(#) - comment(# Not this:) - comment(# validate_presence_of :invoice) - comment(#) - comment(# If you validate the presence of the associated object, you will get) - comment(# failures on saves when both the parent object and the child object are) - comment(# new.) - reserved(def) method(validates_presence_of)operator(()operator(*)ident(attr_names)operator(\)) - ident(configuration) operator(=) operator({) symbol(:message) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:blank)operator(])operator(,) symbol(:on) operator(=)operator(>) symbol(:save) operator(}) - ident(configuration)operator(.)ident(update)operator(()ident(attr_names)operator(.)ident(pop)operator(\)) reserved(if) ident(attr_names)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - comment(# can't use validates_each here, because it cannot cope with nonexistent attributes,) - comment(# while errors.add_on_empty can) - ident(attr_names)operator(.)ident(each) reserved(do) operator(|)ident(attr_name)operator(|) - ident(send)operator(()ident(validation_method)operator(()ident(configuration)operator([)symbol(:on)operator(])operator(\))operator(\)) reserved(do) operator(|)ident(record)operator(|) - reserved(unless) ident(configuration)operator([)symbol(:if)operator(]) reserved(and) reserved(not) ident(evaluate_condition)operator(()ident(configuration)operator([)symbol(:if)operator(])operator(,) ident(record)operator(\)) - ident(record)operator(.)ident(errors)operator(.)ident(add_on_blank)operator(()ident(attr_name)operator(,)ident(configuration)operator([)symbol(:message)operator(])operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - comment(# Validates that the specified attribute matches the length restrictions supplied. Only one option can be used at a time:) - comment(#) - comment(# class Person < ActiveRecord::Base) - comment(# validates_length_of :first_name, :maximum=>30) - comment(# validates_length_of :last_name, :maximum=>30, :message=>"less than %d if you don't mind") - comment(# validates_length_of :fax, :in => 7..32, :allow_nil => true) - comment(# validates_length_of :user_name, :within => 6..20, :too_long => "pick a shorter name", :too_short => "pick a longer name") - comment(# validates_length_of :fav_bra_size, :minimum=>1, :too_short=>"please enter at least %d character") - comment(# validates_length_of :smurf_leader, :is=>4, :message=>"papa is spelled with %d characters... don't play me.") - comment(# end) - comment(#) - comment(# Configuration options:) - comment(# * minimum - The minimum size of the attribute) - comment(# * maximum - The maximum size of the attribute) - comment(# * is - The exact size of the attribute) - comment(# * within - A range specifying the minimum and maximum size of the attribute) - comment(# * in - A synonym(or alias\) for :within) - comment(# * allow_nil - Attribute may be nil; skip validation.) - comment(#) - comment(# * too_long - The error message if the attribute goes over the maximum (default is: "is too long (maximum is %d characters\)"\)) - comment(# * too_short - The error message if the attribute goes under the minimum (default is: "is too short (min is %d characters\)"\)) - comment(# * wrong_length - The error message if using the :is method and the attribute is the wrong size (default is: "is the wrong length (should be %d characters\)"\)) - comment(# * message - The error message to use for a :minimum, :maximum, or :is violation. An alias of the appropriate too_long/too_short/wrong_length message) - comment(# * on - Specifies when this validation is active (default is :save, other options :create, :update\)) - comment(# * if - Specifies a method, proc or string to call to determine if the validation should) - comment(# occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }\). The) - comment(# method, proc or string should return or evaluate to a true or false value.) - reserved(def) method(validates_length_of)operator(()operator(*)ident(attrs)operator(\)) - comment(# Merge given options with defaults.) - ident(options) operator(=) operator({) - symbol(:too_long) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:too_long)operator(])operator(,) - symbol(:too_short) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:too_short)operator(])operator(,) - symbol(:wrong_length) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:wrong_length)operator(]) - operator(})operator(.)ident(merge)operator(()constant(DEFAULT_VALIDATION_OPTIONS)operator(\)) - ident(options)operator(.)ident(update)operator(()ident(attrs)operator(.)ident(pop)operator(.)ident(symbolize_keys)operator(\)) reserved(if) ident(attrs)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - comment(# Ensure that one and only one range option is specified.) - ident(range_options) operator(=) constant(ALL_RANGE_OPTIONS) operator(&) ident(options)operator(.)ident(keys) - reserved(case) ident(range_options)operator(.)ident(size) - reserved(when) integer(0) - ident(raise) constant(ArgumentError)operator(,) string - reserved(when) integer(1) - comment(# Valid number of options; do nothing.) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - comment(# Get range option and value.) - ident(option) operator(=) ident(range_options)operator(.)ident(first) - ident(option_value) operator(=) ident(options)operator([)ident(range_options)operator(.)ident(first)operator(]) - - reserved(case) ident(option) - reserved(when) symbol(:within)operator(,) symbol(:in) - ident(raise) constant(ArgumentError)operator(,) stringcontent( must be a Range)delimiter(")> reserved(unless) ident(option_value)operator(.)ident(is_a?)operator(()constant(Range)operator(\)) - - ident(too_short) operator(=) ident(options)operator([)symbol(:too_short)operator(]) operator(%) ident(option_value)operator(.)ident(begin) - ident(too_long) operator(=) ident(options)operator([)symbol(:too_long)operator(]) operator(%) ident(option_value)operator(.)ident(end) - - ident(validates_each)operator(()ident(attrs)operator(,) ident(options)operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr)operator(,) ident(value)operator(|) - reserved(if) ident(value)operator(.)ident(nil?) reserved(or) ident(value)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(size) operator(<) ident(option_value)operator(.)ident(begin) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr)operator(,) ident(too_short)operator(\)) - reserved(elsif) ident(value)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(size) operator(>) ident(option_value)operator(.)ident(end) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr)operator(,) ident(too_long)operator(\)) - reserved(end) - reserved(end) - reserved(when) symbol(:is)operator(,) symbol(:minimum)operator(,) symbol(:maximum) - ident(raise) constant(ArgumentError)operator(,) stringcontent( must be a nonnegative Integer)delimiter(")> reserved(unless) ident(option_value)operator(.)ident(is_a?)operator(()constant(Integer)operator(\)) reserved(and) ident(option_value) operator(>)operator(=) integer(0) - - comment(# Declare different validations per option.) - ident(validity_checks) operator(=) operator({) symbol(:is) operator(=)operator(>) stringoperator(,) symbol(:minimum) operator(=)operator(>) string=)delimiter(")>operator(,) symbol(:maximum) operator(=)operator(>) string operator(}) - ident(message_options) operator(=) operator({) symbol(:is) operator(=)operator(>) symbol(:wrong_length)operator(,) symbol(:minimum) operator(=)operator(>) symbol(:too_short)operator(,) symbol(:maximum) operator(=)operator(>) symbol(:too_long) operator(}) - - ident(message) operator(=) operator(()ident(options)operator([)symbol(:message)operator(]) operator(||) ident(options)operator([)ident(message_options)operator([)ident(option)operator(])operator(])operator(\)) operator(%) ident(option_value) - - ident(validates_each)operator(()ident(attrs)operator(,) ident(options)operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr)operator(,) ident(value)operator(|) - reserved(if) ident(value)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr)operator(,) ident(message)operator(\)) reserved(unless) operator(!)ident(value)operator(.)ident(nil?) reserved(and) ident(value)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(size)operator(.)ident(method)operator(()ident(validity_checks)operator([)ident(option)operator(])operator(\))operator([)ident(option_value)operator(]) - reserved(else) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr)operator(,) ident(message)operator(\)) reserved(unless) operator(!)ident(value)operator(.)ident(nil?) reserved(and) ident(value)operator(.)ident(size)operator(.)ident(method)operator(()ident(validity_checks)operator([)ident(option)operator(])operator(\))operator([)ident(option_value)operator(]) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - ident(alias_method) symbol(:validates_size_of)operator(,) symbol(:validates_length_of) - - - comment(# Validates whether the value of the specified attributes are unique across the system. Useful for making sure that only one user) - comment(# can be named "davidhh".) - comment(#) - comment(# class Person < ActiveRecord::Base) - comment(# validates_uniqueness_of :user_name, :scope => :account_id) - comment(# end) - comment(#) - comment(# It can also validate whether the value of the specified attributes are unique based on multiple scope parameters. For example,) - comment(# making sure that a teacher can only be on the schedule once per semester for a particular class. ) - comment(#) - comment(# class TeacherSchedule < ActiveRecord::Base) - comment(# validates_uniqueness_of :teacher_id, :scope => [:semester_id, :class_id] ) - comment(# end) - comment(#) - comment(# When the record is created, a check is performed to make sure that no record exists in the database with the given value for the specified) - comment(# attribute (that maps to a column\). When the record is updated, the same check is made but disregarding the record itself.) - comment(#) - comment(# Configuration options:) - comment(# * message - Specifies a custom error message (default is: "has already been taken"\)) - comment(# * scope - One or more columns by which to limit the scope of the uniquness constraint.) - comment(# * if - Specifies a method, proc or string to call to determine if the validation should) - comment(# occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }\). The) - comment(# method, proc or string should return or evaluate to a true or false value.) - - reserved(def) method(validates_uniqueness_of)operator(()operator(*)ident(attr_names)operator(\)) - ident(configuration) operator(=) operator({) symbol(:message) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:taken)operator(]) operator(}) - ident(configuration)operator(.)ident(update)operator(()ident(attr_names)operator(.)ident(pop)operator(\)) reserved(if) ident(attr_names)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - ident(validates_each)operator(()ident(attr_names)operator(,)ident(configuration)operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr_name)operator(,) ident(value)operator(|) - ident(condition_sql) operator(=) stringcontent(.)inlinecontent( )inlinedelimiter(")> - ident(condition_params) operator(=) operator([)ident(value)operator(]) - reserved(if) ident(scope) operator(=) ident(configuration)operator([)symbol(:scope)operator(]) - ident(Array)operator(()ident(scope)operator(\))operator(.)ident(map) reserved(do) operator(|)ident(scope_item)operator(|) - ident(scope_value) operator(=) ident(record)operator(.)ident(send)operator(()ident(scope_item)operator(\)) - ident(condition_sql) operator(<<) stringcontent(.)inlinecontent( )inlinedelimiter(")> - ident(condition_params) operator(<<) ident(scope_value) - reserved(end) - reserved(end) - reserved(unless) ident(record)operator(.)ident(new_record?) - ident(condition_sql) operator(<<) stringcontent(.)inlinecontent( <> ?)delimiter(")> - ident(condition_params) operator(<<) ident(record)operator(.)ident(send)operator(()symbol(:id)operator(\)) - reserved(end) - reserved(if) ident(record)operator(.)ident(class)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)ident(condition_sql)operator(,) operator(*)ident(condition_params)operator(])operator(\)) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr_name)operator(,) ident(configuration)operator([)symbol(:message)operator(])operator(\)) - reserved(end) - reserved(end) - reserved(end) - - comment(# Validates whether the value of the specified attribute is of the correct form by matching it against the regular expression) - comment(# provided.) - comment(#) - comment(# class Person < ActiveRecord::Base) - comment(# validates_format_of :email, :with => /^([^@\\s]+\)@((?:[-a-z0-9]+\\.\)+[a-z]{2,}\)$/i, :on => :create) - comment(# end) - comment(#) - comment(# A regular expression must be provided or else an exception will be raised.) - comment(#) - comment(# Configuration options:) - comment(# * message - A custom error message (default is: "is invalid"\)) - comment(# * with - The regular expression used to validate the format with (note: must be supplied!\)) - comment(# * on Specifies when this validation is active (default is :save, other options :create, :update\)) - comment(# * if - Specifies a method, proc or string to call to determine if the validation should) - comment(# occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }\). The) - comment(# method, proc or string should return or evaluate to a true or false value.) - reserved(def) method(validates_format_of)operator(()operator(*)ident(attr_names)operator(\)) - ident(configuration) operator(=) operator({) symbol(:message) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:invalid)operator(])operator(,) symbol(:on) operator(=)operator(>) symbol(:save)operator(,) symbol(:with) operator(=)operator(>) pre_constant(nil) operator(}) - ident(configuration)operator(.)ident(update)operator(()ident(attr_names)operator(.)ident(pop)operator(\)) reserved(if) ident(attr_names)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - ident(raise)operator(()constant(ArgumentError)operator(,) stringoperator(\)) reserved(unless) ident(configuration)operator([)symbol(:with)operator(])operator(.)ident(is_a?)operator(()constant(Regexp)operator(\)) - - ident(validates_each)operator(()ident(attr_names)operator(,) ident(configuration)operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr_name)operator(,) ident(value)operator(|) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr_name)operator(,) ident(configuration)operator([)symbol(:message)operator(])operator(\)) reserved(unless) ident(value)operator(.)ident(to_s) operator(=)operator(~) ident(configuration)operator([)symbol(:with)operator(]) - reserved(end) - reserved(end) - - comment(# Validates whether the value of the specified attribute is available in a particular enumerable object.) - comment(#) - comment(# class Person < ActiveRecord::Base) - comment(# validates_inclusion_of :gender, :in=>%w( m f \), :message=>"woah! what are you then!??!!") - comment(# validates_inclusion_of :age, :in=>0..99) - comment(# end) - comment(#) - comment(# Configuration options:) - comment(# * in - An enumerable object of available items) - comment(# * message - Specifies a customer error message (default is: "is not included in the list"\)) - comment(# * allow_nil - If set to true, skips this validation if the attribute is null (default is: false\)) - comment(# * if - Specifies a method, proc or string to call to determine if the validation should) - comment(# occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }\). The) - comment(# method, proc or string should return or evaluate to a true or false value.) - reserved(def) method(validates_inclusion_of)operator(()operator(*)ident(attr_names)operator(\)) - ident(configuration) operator(=) operator({) symbol(:message) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:inclusion)operator(])operator(,) symbol(:on) operator(=)operator(>) symbol(:save) operator(}) - ident(configuration)operator(.)ident(update)operator(()ident(attr_names)operator(.)ident(pop)operator(\)) reserved(if) ident(attr_names)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - ident(enum) operator(=) ident(configuration)operator([)symbol(:in)operator(]) operator(||) ident(configuration)operator([)symbol(:within)operator(]) - - ident(raise)operator(()constant(ArgumentError)operator(,) stringoperator(\)) reserved(unless) ident(enum)operator(.)ident(respond_to?)operator(()stringoperator(\)) - - ident(validates_each)operator(()ident(attr_names)operator(,) ident(configuration)operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr_name)operator(,) ident(value)operator(|) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr_name)operator(,) ident(configuration)operator([)symbol(:message)operator(])operator(\)) reserved(unless) ident(enum)operator(.)ident(include?)operator(()ident(value)operator(\)) - reserved(end) - reserved(end) - - comment(# Validates that the value of the specified attribute is not in a particular enumerable object.) - comment(#) - comment(# class Person < ActiveRecord::Base) - comment(# validates_exclusion_of :username, :in => %w( admin superuser \), :message => "You don't belong here") - comment(# validates_exclusion_of :age, :in => 30..60, :message => "This site is only for under 30 and over 60") - comment(# end) - comment(#) - comment(# Configuration options:) - comment(# * in - An enumerable object of items that the value shouldn't be part of) - comment(# * message - Specifies a customer error message (default is: "is reserved"\)) - comment(# * allow_nil - If set to true, skips this validation if the attribute is null (default is: false\)) - comment(# * if - Specifies a method, proc or string to call to determine if the validation should) - comment(# occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }\). The) - comment(# method, proc or string should return or evaluate to a true or false value.) - reserved(def) method(validates_exclusion_of)operator(()operator(*)ident(attr_names)operator(\)) - ident(configuration) operator(=) operator({) symbol(:message) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:exclusion)operator(])operator(,) symbol(:on) operator(=)operator(>) symbol(:save) operator(}) - ident(configuration)operator(.)ident(update)operator(()ident(attr_names)operator(.)ident(pop)operator(\)) reserved(if) ident(attr_names)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - ident(enum) operator(=) ident(configuration)operator([)symbol(:in)operator(]) operator(||) ident(configuration)operator([)symbol(:within)operator(]) - - ident(raise)operator(()constant(ArgumentError)operator(,) stringoperator(\)) reserved(unless) ident(enum)operator(.)ident(respond_to?)operator(()stringoperator(\)) - - ident(validates_each)operator(()ident(attr_names)operator(,) ident(configuration)operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr_name)operator(,) ident(value)operator(|) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr_name)operator(,) ident(configuration)operator([)symbol(:message)operator(])operator(\)) reserved(if) ident(enum)operator(.)ident(include?)operator(()ident(value)operator(\)) - reserved(end) - reserved(end) - - comment(# Validates whether the associated object or objects are all valid themselves. Works with any kind of association.) - comment(#) - comment(# class Book < ActiveRecord::Base) - comment(# has_many :pages) - comment(# belongs_to :library) - comment(#) - comment(# validates_associated :pages, :library) - comment(# end) - comment(#) - comment(# Warning: If, after the above definition, you then wrote:) - comment(#) - comment(# class Page < ActiveRecord::Base) - comment(# belongs_to :book) - comment(#) - comment(# validates_associated :book) - comment(# end) - comment(#) - comment(# ...this would specify a circular dependency and cause infinite recursion.) - comment(#) - comment(# NOTE: This validation will not fail if the association hasn't been assigned. If you want to ensure that the association) - comment(# is both present and guaranteed to be valid, you also need to use validates_presence_of.) - comment(#) - comment(# Configuration options:) - comment(# * on Specifies when this validation is active (default is :save, other options :create, :update\)) - comment(# * if - Specifies a method, proc or string to call to determine if the validation should) - comment(# occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }\). The) - comment(# method, proc or string should return or evaluate to a true or false value.) - reserved(def) method(validates_associated)operator(()operator(*)ident(attr_names)operator(\)) - ident(configuration) operator(=) operator({) symbol(:message) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:invalid)operator(])operator(,) symbol(:on) operator(=)operator(>) symbol(:save) operator(}) - ident(configuration)operator(.)ident(update)operator(()ident(attr_names)operator(.)ident(pop)operator(\)) reserved(if) ident(attr_names)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - ident(validates_each)operator(()ident(attr_names)operator(,) ident(configuration)operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr_name)operator(,) ident(value)operator(|) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr_name)operator(,) ident(configuration)operator([)symbol(:message)operator(])operator(\)) reserved(unless) - operator(()ident(value)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) operator(?) ident(value) operator(:) operator([)ident(value)operator(])operator(\))operator(.)ident(all?) operator({) operator(|)ident(r)operator(|) ident(r)operator(.)ident(nil?) reserved(or) ident(r)operator(.)ident(valid?) operator(}) - reserved(end) - reserved(end) - - comment(# Validates whether the value of the specified attribute is numeric by trying to convert it to) - comment(# a float with Kernel.Float (if integer is false\) or applying it to the regular expression) - comment(# /^[\\+\\-]?\\d+$/ (if integer is set to true\).) - comment(#) - comment(# class Person < ActiveRecord::Base) - comment(# validates_numericality_of :value, :on => :create) - comment(# end) - comment(#) - comment(# Configuration options:) - comment(# * message - A custom error message (default is: "is not a number"\)) - comment(# * on Specifies when this validation is active (default is :save, other options :create, :update\)) - comment(# * only_integer Specifies whether the value has to be an integer, e.g. an integral value (default is false\)) - comment(# * allow_nil Skip validation if attribute is nil (default is false\). Notice that for fixnum and float columns empty strings are converted to nil) - comment(# * if - Specifies a method, proc or string to call to determine if the validation should) - comment(# occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }\). The) - comment(# method, proc or string should return or evaluate to a true or false value.) - reserved(def) method(validates_numericality_of)operator(()operator(*)ident(attr_names)operator(\)) - ident(configuration) operator(=) operator({) symbol(:message) operator(=)operator(>) constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:not_a_number)operator(])operator(,) symbol(:on) operator(=)operator(>) symbol(:save)operator(,) - symbol(:only_integer) operator(=)operator(>) pre_constant(false)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(false) operator(}) - ident(configuration)operator(.)ident(update)operator(()ident(attr_names)operator(.)ident(pop)operator(\)) reserved(if) ident(attr_names)operator(.)ident(last)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - - reserved(if) ident(configuration)operator([)symbol(:only_integer)operator(]) - ident(validates_each)operator(()ident(attr_names)operator(,)ident(configuration)operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr_name)operator(,)ident(value)operator(|) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr_name)operator(,) ident(configuration)operator([)symbol(:message)operator(])operator(\)) reserved(unless) ident(record)operator(.)ident(send)operator(()stringcontent(_before_type_cast)delimiter(")>operator(\))operator(.)ident(to_s) operator(=)operator(~) regexp - reserved(end) - reserved(else) - ident(validates_each)operator(()ident(attr_names)operator(,)ident(configuration)operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr_name)operator(,)ident(value)operator(|) - reserved(next) reserved(if) ident(configuration)operator([)symbol(:allow_nil)operator(]) reserved(and) ident(record)operator(.)ident(send)operator(()stringcontent(_before_type_cast)delimiter(")>operator(\))operator(.)ident(nil?) - reserved(begin) - constant(Kernel)operator(.)ident(Float)operator(()ident(record)operator(.)ident(send)operator(()stringcontent(_before_type_cast)delimiter(")>operator(\))operator(.)ident(to_s)operator(\)) - reserved(rescue) constant(ArgumentError)operator(,) constant(TypeError) - ident(record)operator(.)ident(errors)operator(.)ident(add)operator(()ident(attr_name)operator(,) ident(configuration)operator([)symbol(:message)operator(])operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - - comment(# Creates an object just like Base.create but calls save! instead of save) - comment(# so an exception is raised if the record is invalid.) - reserved(def) method(create!)operator(()ident(attributes) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(attributes)operator(.)ident(is_a?)operator(()constant(Array)operator(\)) - ident(attributes)operator(.)ident(collect) operator({) operator(|)ident(attr)operator(|) ident(create!)operator(()ident(attr)operator(\)) operator(}) - reserved(else) - ident(attributes)operator(.)ident(reverse_merge!)operator(()ident(scope)operator(()symbol(:create)operator(\))operator(\)) reserved(if) ident(scoped?)operator(()symbol(:create)operator(\)) - - ident(object) operator(=) ident(new)operator(()ident(attributes)operator(\)) - ident(object)operator(.)ident(save!) - ident(object) - reserved(end) - reserved(end) - - - ident(private) - reserved(def) method(write_inheritable_set)operator(()ident(key)operator(,) ident(methods)operator(\)) - ident(existing_methods) operator(=) ident(read_inheritable_attribute)operator(()ident(key)operator(\)) operator(||) operator([)operator(]) - ident(write_inheritable_attribute)operator(()ident(key)operator(,) ident(methods) operator(|) ident(existing_methods)operator(\)) - reserved(end) - - reserved(def) method(validation_method)operator(()ident(on)operator(\)) - reserved(case) ident(on) - reserved(when) symbol(:save) reserved(then) symbol(:validate) - reserved(when) symbol(:create) reserved(then) symbol(:validate_on_create) - reserved(when) symbol(:update) reserved(then) symbol(:validate_on_update) - reserved(end) - reserved(end) - reserved(end) - - comment(# The validation process on save can be skipped by passing false. The regular Base#save method is) - comment(# replaced with this when the validations module is mixed in, which it is by default.) - reserved(def) method(save_with_validation)operator(()ident(perform_validation) operator(=) pre_constant(true)operator(\)) - reserved(if) ident(perform_validation) operator(&&) ident(valid?) operator(||) operator(!)ident(perform_validation) - ident(save_without_validation) - reserved(else) - pre_constant(false) - reserved(end) - reserved(end) - - comment(# Attempts to save the record just like Base#save but will raise a RecordInvalid exception instead of returning false) - comment(# if the record is not valid.) - reserved(def) method(save_with_validation!) - reserved(if) ident(valid?) - ident(save_without_validation!) - reserved(else) - ident(raise) constant(RecordInvalid)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - reserved(end) - reserved(end) - - comment(# Updates a single attribute and saves the record without going through the normal validation procedure.) - comment(# This is especially useful for boolean flags on existing records. The regular +update_attribute+ method) - comment(# in Base is replaced with this when the validations module is mixed in, which it is by default.) - reserved(def) method(update_attribute_with_validation_skipping)operator(()ident(name)operator(,) ident(value)operator(\)) - ident(send)operator(()ident(name)operator(.)ident(to_s) operator(+) stringoperator(,) ident(value)operator(\)) - ident(save)operator(()pre_constant(false)operator(\)) - reserved(end) - - comment(# Runs validate and validate_on_create or validate_on_update and returns true if no errors were added otherwise false.) - reserved(def) method(valid?) - ident(errors)operator(.)ident(clear) - - ident(run_validations)operator(()symbol(:validate)operator(\)) - ident(validate) - - reserved(if) ident(new_record?) - ident(run_validations)operator(()symbol(:validate_on_create)operator(\)) - ident(validate_on_create) - reserved(else) - ident(run_validations)operator(()symbol(:validate_on_update)operator(\)) - ident(validate_on_update) - reserved(end) - - ident(errors)operator(.)ident(empty?) - reserved(end) - - comment(# Returns the Errors object that holds all information about attribute error messages.) - reserved(def) method(errors) - instance_variable(@errors) operator(||=) constant(Errors)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - reserved(end) - - ident(protected) - comment(# Overwrite this method for validation checks on all saves and use Errors.add(field, msg\) for invalid attributes.) - reserved(def) method(validate) comment(#:doc:) - reserved(end) - - comment(# Overwrite this method for validation checks used only on creation.) - reserved(def) method(validate_on_create) comment(#:doc:) - reserved(end) - - comment(# Overwrite this method for validation checks used only on updates.) - reserved(def) method(validate_on_update) comment(# :doc:) - reserved(end) - - ident(private) - reserved(def) method(run_validations)operator(()ident(validation_method)operator(\)) - ident(validations) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(read_inheritable_attribute)operator(()ident(validation_method)operator(.)ident(to_sym)operator(\)) - reserved(if) ident(validations)operator(.)ident(nil?) reserved(then) reserved(return) reserved(end) - ident(validations)operator(.)ident(each) reserved(do) operator(|)ident(validation)operator(|) - reserved(if) ident(validation)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - pre_constant(self)operator(.)ident(send)operator(()ident(validation)operator(\)) - reserved(elsif) ident(validation)operator(.)ident(is_a?)operator(()constant(String)operator(\)) - ident(eval)operator(()ident(validation)operator(,) ident(binding)operator(\)) - reserved(elsif) ident(validation_block?)operator(()ident(validation)operator(\)) - ident(validation)operator(.)ident(call)operator(()pre_constant(self)operator(\)) - reserved(elsif) ident(validation_class?)operator(()ident(validation)operator(,) ident(validation_method)operator(\)) - ident(validation)operator(.)ident(send)operator(()ident(validation_method)operator(,) pre_constant(self)operator(\)) - reserved(else) - ident(raise)operator(() - constant(ActiveRecordError)operator(,) - string operator(+) - string - operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(validation_block?)operator(()ident(validation)operator(\)) - ident(validation)operator(.)ident(respond_to?)operator(()stringoperator(\)) operator(&&) operator(()ident(validation)operator(.)ident(arity) operator(==) integer(1) operator(||) ident(validation)operator(.)ident(arity) operator(==) integer(-1)operator(\)) - reserved(end) - - reserved(def) method(validation_class?)operator(()ident(validation)operator(,) ident(validation_method)operator(\)) - ident(validation)operator(.)ident(respond_to?)operator(()ident(validation_method)operator(\)) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(DB2) - reserved(module) class(DB2Util) - ident(include) constant(DB2CLI) - - reserved(def) method(free)operator(()operator(\)) ident(SQLFreeHandle)operator(()instance_variable(@handle_type)operator(,) instance_variable(@handle)operator(\))operator(;) reserved(end) - reserved(def) method(handle)operator(()operator(\)) instance_variable(@handle)operator(;) reserved(end) - - reserved(def) method(check_rc)operator(()ident(rc)operator(\)) - reserved(if) operator(!)operator([)constant(SQL_SUCCESS)operator(,) constant(SQL_SUCCESS_WITH_INFO)operator(,) constant(SQL_NO_DATA_FOUND)operator(])operator(.)ident(include?)operator(()ident(rc)operator(\)) - ident(rec) operator(=) integer(1) - ident(msg) operator(=) string - ident(loop) reserved(do) - ident(a) operator(=) ident(SQLGetDiagRec)operator(()instance_variable(@handle_type)operator(,) instance_variable(@handle)operator(,) ident(rec)operator(,) integer(500)operator(\)) - reserved(break) reserved(if) ident(a)operator([)integer(0)operator(]) operator(!=) constant(SQL_SUCCESS) - ident(msg) operator(<<) ident(a)operator([)integer(3)operator(]) reserved(if) operator(!)ident(a)operator([)integer(3)operator(])operator(.)ident(nil?) reserved(and) ident(a)operator([)integer(3)operator(]) operator(!=) string comment(# Create message.) - ident(rec) operator(+=) integer(1) - reserved(end) - ident(raise) stringdelimiter(")> - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(Environment) - ident(include) constant(DB2Util) - - reserved(def) method(initialize) - instance_variable(@handle_type) operator(=) constant(SQL_HANDLE_ENV) - ident(rc)operator(,) instance_variable(@handle) operator(=) ident(SQLAllocHandle)operator(()instance_variable(@handle_type)operator(,) constant(SQL_NULL_HANDLE)operator(\)) - ident(check_rc)operator(()ident(rc)operator(\)) - reserved(end) - - reserved(def) method(data_sources)operator(()ident(buffer_length) operator(=) integer(1024)operator(\)) - ident(retval) operator(=) operator([)operator(]) - ident(max_buffer_length) operator(=) ident(buffer_length) - - ident(a) operator(=) ident(SQLDataSources)operator(()instance_variable(@handle)operator(,) constant(SQL_FETCH_FIRST)operator(,) constant(SQL_MAX_DSN_LENGTH) operator(+) integer(1)operator(,) ident(buffer_length)operator(\)) - ident(retval) operator(<<) operator([)ident(a)operator([)integer(1)operator(])operator(,) ident(a)operator([)integer(3)operator(])operator(]) - ident(max_buffer_length) operator(=) operator([)ident(max_buffer_length)operator(,) ident(a)operator([)integer(4)operator(])operator(])operator(.)ident(max) - - ident(loop) reserved(do) - ident(a) operator(=) ident(SQLDataSources)operator(()instance_variable(@handle)operator(,) constant(SQL_FETCH_NEXT)operator(,) constant(SQL_MAX_DSN_LENGTH) operator(+) integer(1)operator(,) ident(buffer_length)operator(\)) - reserved(break) reserved(if) ident(a)operator([)integer(0)operator(]) operator(==) constant(SQL_NO_DATA_FOUND) - - ident(retval) operator(<<) operator([)ident(a)operator([)integer(1)operator(])operator(,) ident(a)operator([)integer(3)operator(])operator(]) - ident(max_buffer_length) operator(=) operator([)ident(max_buffer_length)operator(,) ident(a)operator([)integer(4)operator(])operator(])operator(.)ident(max) - reserved(end) - - reserved(if) ident(max_buffer_length) operator(>) ident(buffer_length) - ident(get_data_sources)operator(()ident(max_buffer_length)operator(\)) - reserved(else) - ident(retval) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(Connection) - ident(include) constant(DB2Util) - - reserved(def) method(initialize)operator(()ident(environment)operator(\)) - instance_variable(@env) operator(=) ident(environment) - instance_variable(@handle_type) operator(=) constant(SQL_HANDLE_DBC) - ident(rc)operator(,) instance_variable(@handle) operator(=) ident(SQLAllocHandle)operator(()instance_variable(@handle_type)operator(,) instance_variable(@env)operator(.)ident(handle)operator(\)) - ident(check_rc)operator(()ident(rc)operator(\)) - reserved(end) - - reserved(def) method(connect)operator(()ident(server_name)operator(,) ident(user_name) operator(=) stringoperator(,) ident(auth) operator(=) stringoperator(\)) - ident(check_rc)operator(()ident(SQLConnect)operator(()instance_variable(@handle)operator(,) ident(server_name)operator(,) ident(user_name)operator(.)ident(to_s)operator(,) ident(auth)operator(.)ident(to_s)operator(\))operator(\)) - reserved(end) - - reserved(def) method(set_connect_attr)operator(()ident(attr)operator(,) ident(value)operator(\)) - ident(value) operator(+=) string reserved(if) ident(value)operator(.)ident(class) operator(==) constant(String) - ident(check_rc)operator(()ident(SQLSetConnectAttr)operator(()instance_variable(@handle)operator(,) ident(attr)operator(,) ident(value)operator(\))operator(\)) - reserved(end) - - reserved(def) method(set_auto_commit_on) - ident(set_connect_attr)operator(()constant(SQL_ATTR_AUTOCOMMIT)operator(,) constant(SQL_AUTOCOMMIT_ON)operator(\)) - reserved(end) - - reserved(def) method(set_auto_commit_off) - ident(set_connect_attr)operator(()constant(SQL_ATTR_AUTOCOMMIT)operator(,) constant(SQL_AUTOCOMMIT_OFF)operator(\)) - reserved(end) - - reserved(def) method(disconnect) - ident(check_rc)operator(()ident(SQLDisconnect)operator(()instance_variable(@handle)operator(\))operator(\)) - reserved(end) - - reserved(def) method(rollback) - ident(check_rc)operator(()ident(SQLEndTran)operator(()instance_variable(@handle_type)operator(,) instance_variable(@handle)operator(,) constant(SQL_ROLLBACK)operator(\))operator(\)) - reserved(end) - - reserved(def) method(commit) - ident(check_rc)operator(()ident(SQLEndTran)operator(()instance_variable(@handle_type)operator(,) instance_variable(@handle)operator(,) constant(SQL_COMMIT)operator(\))operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(Statement) - ident(include) constant(DB2Util) - - reserved(def) method(initialize)operator(()ident(connection)operator(\)) - instance_variable(@conn) operator(=) ident(connection) - instance_variable(@handle_type) operator(=) constant(SQL_HANDLE_STMT) - instance_variable(@parms) operator(=) operator([)operator(]) comment(#yun) - instance_variable(@sql) operator(=) string comment(#yun) - instance_variable(@numParms) operator(=) integer(0) comment(#yun) - instance_variable(@prepared) operator(=) pre_constant(false) comment(#yun) - instance_variable(@parmArray) operator(=) operator([)operator(]) comment(#yun. attributes of the parameter markers) - ident(rc)operator(,) instance_variable(@handle) operator(=) ident(SQLAllocHandle)operator(()instance_variable(@handle_type)operator(,) instance_variable(@conn)operator(.)ident(handle)operator(\)) - ident(check_rc)operator(()ident(rc)operator(\)) - reserved(end) - - reserved(def) method(columns)operator(()ident(table_name)operator(,) ident(schema_name) operator(=) stringoperator(\)) - ident(check_rc)operator(()ident(SQLColumns)operator(()instance_variable(@handle)operator(,) stringoperator(,) ident(schema_name)operator(.)ident(upcase)operator(,) ident(table_name)operator(.)ident(upcase)operator(,) stringoperator(\))operator(\)) - ident(fetch_all) - reserved(end) - - reserved(def) method(tables)operator(()ident(schema_name) operator(=) stringoperator(\)) - ident(check_rc)operator(()ident(SQLTables)operator(()instance_variable(@handle)operator(,) stringoperator(,) ident(schema_name)operator(.)ident(upcase)operator(,) stringoperator(,) stringoperator(\))operator(\)) - ident(fetch_all) - reserved(end) - - reserved(def) method(indexes)operator(()ident(table_name)operator(,) ident(schema_name) operator(=) stringoperator(\)) - ident(check_rc)operator(()ident(SQLStatistics)operator(()instance_variable(@handle)operator(,) stringoperator(,) ident(schema_name)operator(.)ident(upcase)operator(,) ident(table_name)operator(.)ident(upcase)operator(,) constant(SQL_INDEX_ALL)operator(,) constant(SQL_ENSURE)operator(\))operator(\)) - ident(fetch_all) - reserved(end) - - reserved(def) method(prepare)operator(()ident(sql)operator(\)) - instance_variable(@sql) operator(=) ident(sql) - ident(check_rc)operator(()ident(SQLPrepare)operator(()instance_variable(@handle)operator(,) ident(sql)operator(\))operator(\)) - ident(rc)operator(,) instance_variable(@numParms) operator(=) ident(SQLNumParams)operator(()instance_variable(@handle)operator(\)) comment(#number of question marks) - ident(check_rc)operator(()ident(rc)operator(\)) - comment(#--------------------------------------------------------------------------) - comment(# parameter attributes are stored in instance variable @parmArray so that) - comment(# they are available when execute method is called.) - comment(#--------------------------------------------------------------------------) - reserved(if) instance_variable(@numParms) operator(>) integer(0) comment(# get parameter marker attributes) - integer(1)operator(.)ident(upto)operator(()instance_variable(@numParms)operator(\)) reserved(do) operator(|)ident(i)operator(|) comment(# parameter number starts from 1) - ident(rc)operator(,) ident(type)operator(,) ident(size)operator(,) ident(decimalDigits) operator(=) ident(SQLDescribeParam)operator(()instance_variable(@handle)operator(,) ident(i)operator(\)) - ident(check_rc)operator(()ident(rc)operator(\)) - instance_variable(@parmArray) operator(<<) constant(Parameter)operator(.)ident(new)operator(()ident(type)operator(,) ident(size)operator(,) ident(decimalDigits)operator(\)) - reserved(end) - reserved(end) - instance_variable(@prepared) operator(=) pre_constant(true) - pre_constant(self) - reserved(end) - - reserved(def) method(execute)operator(()operator(*)ident(parms)operator(\)) - ident(raise) string reserved(if) instance_variable(@prepared) operator(==) pre_constant(false) - - reserved(if) ident(parms)operator(.)ident(size) operator(==) integer(1) reserved(and) ident(parms)operator([)integer(0)operator(])operator(.)ident(class) operator(==) constant(Array) - ident(parms) operator(=) ident(parms)operator([)integer(0)operator(]) - reserved(end) - - reserved(if) instance_variable(@numParms) operator(!=) ident(parms)operator(.)ident(size) - ident(raise) string - reserved(end) - - reserved(if) instance_variable(@numParms) operator(>) integer(0) comment(#need to bind parameters) - comment(#--------------------------------------------------------------------) - comment(#calling bindParms may not be safe. Look comment below.) - comment(#--------------------------------------------------------------------) - comment(#bindParms(parms\)) - - ident(valueArray) operator(=) operator([)operator(]) - integer(1)operator(.)ident(upto)operator(()instance_variable(@numParms)operator(\)) reserved(do) operator(|)ident(i)operator(|) comment(# parameter number starts from 1) - ident(type) operator(=) instance_variable(@parmArray)operator([)ident(i) operator(-) integer(1)operator(])operator(.)ident(class) - ident(size) operator(=) instance_variable(@parmArray)operator([)ident(i) operator(-) integer(1)operator(])operator(.)ident(size) - ident(decimalDigits) operator(=) instance_variable(@parmArray)operator([)ident(i) operator(-) integer(1)operator(])operator(.)ident(decimalDigits) - - reserved(if) ident(parms)operator([)ident(i) operator(-) integer(1)operator(])operator(.)ident(class) operator(==) constant(String) - ident(valueArray) operator(<<) ident(parms)operator([)ident(i) operator(-) integer(1)operator(]) - reserved(else) - ident(valueArray) operator(<<) ident(parms)operator([)ident(i) operator(-) integer(1)operator(])operator(.)ident(to_s) - reserved(end) - - ident(rc) operator(=) ident(SQLBindParameter)operator(()instance_variable(@handle)operator(,) ident(i)operator(,) ident(type)operator(,) ident(size)operator(,) ident(decimalDigits)operator(,) ident(valueArray)operator([)ident(i) operator(-) integer(1)operator(])operator(\)) - ident(check_rc)operator(()ident(rc)operator(\)) - reserved(end) - reserved(end) - - ident(check_rc)operator(()ident(SQLExecute)operator(()instance_variable(@handle)operator(\))operator(\)) - - reserved(if) instance_variable(@numParms) operator(!=) integer(0) - ident(check_rc)operator(()ident(SQLFreeStmt)operator(()instance_variable(@handle)operator(,) constant(SQL_RESET_PARAMS)operator(\))operator(\)) comment(# Reset parameters) - reserved(end) - - pre_constant(self) - reserved(end) - - comment(#-------------------------------------------------------------------------------) - comment(# The last argument(value\) to SQLBindParameter is a deferred argument, that is,) - comment(# it should be available when SQLExecute is called. Even though "value" is) - comment(# local to bindParms method, it seems that it is available when SQLExecute) - comment(# is called. I am not sure whether it would still work if garbage collection) - comment(# is done between bindParms call and SQLExecute call inside the execute method) - comment(# above.) - comment(#-------------------------------------------------------------------------------) - reserved(def) method(bindParms)operator(()ident(parms)operator(\)) comment(# This is the real thing. It uses SQLBindParms) - integer(1)operator(.)ident(upto)operator(()instance_variable(@numParms)operator(\)) reserved(do) operator(|)ident(i)operator(|) comment(# parameter number starts from 1) - ident(rc)operator(,) ident(dataType)operator(,) ident(parmSize)operator(,) ident(decimalDigits) operator(=) ident(SQLDescribeParam)operator(()instance_variable(@handle)operator(,) ident(i)operator(\)) - ident(check_rc)operator(()ident(rc)operator(\)) - reserved(if) ident(parms)operator([)ident(i) operator(-) integer(1)operator(])operator(.)ident(class) operator(==) constant(String) - ident(value) operator(=) ident(parms)operator([)ident(i) operator(-) integer(1)operator(]) - reserved(else) - ident(value) operator(=) ident(parms)operator([)ident(i) operator(-) integer(1)operator(])operator(.)ident(to_s) - reserved(end) - ident(rc) operator(=) ident(SQLBindParameter)operator(()instance_variable(@handle)operator(,) ident(i)operator(,) ident(dataType)operator(,) ident(parmSize)operator(,) ident(decimalDigits)operator(,) ident(value)operator(\)) - ident(check_rc)operator(()ident(rc)operator(\)) - reserved(end) - reserved(end) - - comment(#------------------------------------------------------------------------------) - comment(# bind method does not use DB2's SQLBindParams, but replaces "?" in the) - comment(# SQL statement with the value before passing the SQL statement to DB2.) - comment(# It is not efficient and can handle only strings since it puts everything in) - comment(# quotes.) - comment(#------------------------------------------------------------------------------) - reserved(def) method(bind)operator(()ident(sql)operator(,) ident(args)operator(\)) comment(#does not use SQLBindParams) - ident(arg_index) operator(=) integer(0) - ident(result) operator(=) string - ident(tokens)operator(()ident(sql)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(part)operator(|) - reserved(case) ident(part) - reserved(when) string - ident(result) operator(<<) string operator(+) operator(()ident(args)operator([)ident(arg_index)operator(])operator(\)) operator(+) string comment(#put it into quotes) - ident(arg_index) operator(+=) integer(1) - reserved(when) string - ident(result) operator(<<) string - reserved(else) - ident(result) operator(<<) ident(part) - reserved(end) - reserved(end) - reserved(if) ident(arg_index) operator(<) ident(args)operator(.)ident(size) - ident(raise) string - reserved(elsif) ident(arg_index) operator(>) ident(args)operator(.)ident(size) - ident(raise) string - reserved(end) - ident(result) - reserved(end) - - comment(## Break the sql string into parts.) - comment(#) - comment(# This is NOT a full lexer for SQL. It just breaks up the SQL) - comment(# string enough so that question marks, double question marks and) - comment(# quoted strings are separated. This is used when binding) - comment(# arguments to "?" in the SQL string. Note: comments are not) - comment(# handled.) - comment(#) - reserved(def) method(tokens)operator(()ident(sql)operator(\)) - ident(toks) operator(=) ident(sql)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(toks)operator(.)ident(collect) operator({) operator(|)ident(t)operator(|) ident(t)operator([)integer(0)operator(]) operator(}) - reserved(end) - - reserved(def) method(exec_direct)operator(()ident(sql)operator(\)) - ident(check_rc)operator(()ident(SQLExecDirect)operator(()instance_variable(@handle)operator(,) ident(sql)operator(\))operator(\)) - pre_constant(self) - reserved(end) - - reserved(def) method(set_cursor_name)operator(()ident(name)operator(\)) - ident(check_rc)operator(()ident(SQLSetCursorName)operator(()instance_variable(@handle)operator(,) ident(name)operator(\))operator(\)) - pre_constant(self) - reserved(end) - - reserved(def) method(get_cursor_name) - ident(rc)operator(,) ident(name) operator(=) ident(SQLGetCursorName)operator(()instance_variable(@handle)operator(\)) - ident(check_rc)operator(()ident(rc)operator(\)) - ident(name) - reserved(end) - - reserved(def) method(row_count) - ident(rc)operator(,) ident(rowcount) operator(=) ident(SQLRowCount)operator(()instance_variable(@handle)operator(\)) - ident(check_rc)operator(()ident(rc)operator(\)) - ident(rowcount) - reserved(end) - - reserved(def) method(num_result_cols) - ident(rc)operator(,) ident(cols) operator(=) ident(SQLNumResultCols)operator(()instance_variable(@handle)operator(\)) - ident(check_rc)operator(()ident(rc)operator(\)) - ident(cols) - reserved(end) - - reserved(def) method(fetch_all) - reserved(if) ident(block_given?) - reserved(while) ident(row) operator(=) ident(fetch) reserved(do) - reserved(yield) ident(row) - reserved(end) - reserved(else) - ident(res) operator(=) operator([)operator(]) - reserved(while) ident(row) operator(=) ident(fetch) reserved(do) - ident(res) operator(<<) ident(row) - reserved(end) - ident(res) - reserved(end) - reserved(end) - - reserved(def) method(fetch) - ident(cols) operator(=) ident(get_col_desc) - ident(rc) operator(=) ident(SQLFetch)operator(()instance_variable(@handle)operator(\)) - reserved(if) ident(rc) operator(==) constant(SQL_NO_DATA_FOUND) - ident(SQLFreeStmt)operator(()instance_variable(@handle)operator(,) constant(SQL_CLOSE)operator(\)) comment(# Close cursor) - ident(SQLFreeStmt)operator(()instance_variable(@handle)operator(,) constant(SQL_RESET_PARAMS)operator(\)) comment(# Reset parameters) - reserved(return) pre_constant(nil) - reserved(end) - ident(raise) string reserved(unless) ident(rc) operator(==) constant(SQL_SUCCESS) - - ident(retval) operator(=) operator([)operator(]) - ident(cols)operator(.)ident(each_with_index) reserved(do) operator(|)ident(c)operator(,) ident(i)operator(|) - ident(rc)operator(,) ident(content) operator(=) ident(SQLGetData)operator(()instance_variable(@handle)operator(,) ident(i) operator(+) integer(1)operator(,) ident(c)operator([)integer(1)operator(])operator(,) ident(c)operator([)integer(2)operator(]) operator(+) integer(1)operator(\)) comment(#yun added 1 to c[2]) - ident(retval) operator(<<) ident(adjust_content)operator(()ident(content)operator(\)) - reserved(end) - ident(retval) - reserved(end) - - reserved(def) method(fetch_as_hash) - ident(cols) operator(=) ident(get_col_desc) - ident(rc) operator(=) ident(SQLFetch)operator(()instance_variable(@handle)operator(\)) - reserved(if) ident(rc) operator(==) constant(SQL_NO_DATA_FOUND) - ident(SQLFreeStmt)operator(()instance_variable(@handle)operator(,) constant(SQL_CLOSE)operator(\)) comment(# Close cursor) - ident(SQLFreeStmt)operator(()instance_variable(@handle)operator(,) constant(SQL_RESET_PARAMS)operator(\)) comment(# Reset parameters) - reserved(return) pre_constant(nil) - reserved(end) - ident(raise) string reserved(unless) ident(rc) operator(==) constant(SQL_SUCCESS) - - ident(retval) operator(=) operator({)operator(}) - ident(cols)operator(.)ident(each_with_index) reserved(do) operator(|)ident(c)operator(,) ident(i)operator(|) - ident(rc)operator(,) ident(content) operator(=) ident(SQLGetData)operator(()instance_variable(@handle)operator(,) ident(i) operator(+) integer(1)operator(,) ident(c)operator([)integer(1)operator(])operator(,) ident(c)operator([)integer(2)operator(]) operator(+) integer(1)operator(\)) comment(#yun added 1 to c[2]) - ident(retval)operator([)ident(c)operator([)integer(0)operator(])operator(]) operator(=) ident(adjust_content)operator(()ident(content)operator(\)) - reserved(end) - ident(retval) - reserved(end) - - reserved(def) method(get_col_desc) - ident(rc)operator(,) ident(nr_cols) operator(=) ident(SQLNumResultCols)operator(()instance_variable(@handle)operator(\)) - ident(cols) operator(=) operator(()integer(1)operator(..)ident(nr_cols)operator(\))operator(.)ident(collect) reserved(do) operator(|)ident(c)operator(|) - ident(rc)operator(,) ident(name)operator(,) ident(bl)operator(,) ident(type)operator(,) ident(col_sz) operator(=) ident(SQLDescribeCol)operator(()instance_variable(@handle)operator(,) ident(c)operator(,) integer(1024)operator(\)) - operator([)ident(name)operator(.)ident(downcase)operator(,) ident(type)operator(,) ident(col_sz)operator(]) - reserved(end) - reserved(end) - - reserved(def) method(adjust_content)operator(()ident(c)operator(\)) - reserved(case) ident(c)operator(.)ident(class)operator(.)ident(to_s) - reserved(when) string - reserved(return) pre_constant(nil) - reserved(when) string - string operator(%) operator([)ident(c)operator(.)ident(hour)operator(,) ident(c)operator(.)ident(minute)operator(,) ident(c)operator(.)ident(second)operator(]) - reserved(when) string - string operator(%) operator([)ident(c)operator(.)ident(year)operator(,) ident(c)operator(.)ident(month)operator(,) ident(c)operator(.)ident(day)operator(]) - reserved(when) string - string operator(%) operator([)ident(c)operator(.)ident(year)operator(,) ident(c)operator(.)ident(month)operator(,) ident(c)operator(.)ident(day)operator(,) ident(c)operator(.)ident(hour)operator(,) ident(c)operator(.)ident(minute)operator(,) ident(c)operator(.)ident(second)operator(]) - reserved(else) - reserved(return) ident(c) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(Parameter) - ident(attr_reader) symbol(:type)operator(,) symbol(:size)operator(,) symbol(:decimalDigits) - reserved(def) method(initialize)operator(()ident(type)operator(,) ident(size)operator(,) ident(decimalDigits)operator(\)) - instance_variable(@type)operator(,) instance_variable(@size)operator(,) instance_variable(@decimalDigits) operator(=) ident(type)operator(,) ident(size)operator(,) ident(decimalDigits) - reserved(end) - reserved(end) -reserved(end) -comment(# $Id: mysql.rb,v 1.24 2005/02/12 11:37:15 tommy Exp $) -comment(#) -comment(# Copyright (C\) 2003-2005 TOMITA Masahiro) -comment(# tommy@tmtm.org) -comment(#) - -reserved(class) class(Mysql) - - constant(VERSION) operator(=) string - - ident(require) string - ident(require) string - - constant(MAX_PACKET_LENGTH) operator(=) integer(256)operator(*)integer(256)operator(*)integer(256)operator(-)integer(1) - constant(MAX_ALLOWED_PACKET) operator(=) integer(1024)operator(*)integer(1024)operator(*)integer(1024) - - constant(MYSQL_UNIX_ADDR) operator(=) string - constant(MYSQL_PORT) operator(=) integer(3306) - constant(PROTOCOL_VERSION) operator(=) integer(10) - - comment(# Command) - constant(COM_SLEEP) operator(=) integer(0) - constant(COM_QUIT) operator(=) integer(1) - constant(COM_INIT_DB) operator(=) integer(2) - constant(COM_QUERY) operator(=) integer(3) - constant(COM_FIELD_LIST) operator(=) integer(4) - constant(COM_CREATE_DB) operator(=) integer(5) - constant(COM_DROP_DB) operator(=) integer(6) - constant(COM_REFRESH) operator(=) integer(7) - constant(COM_SHUTDOWN) operator(=) integer(8) - constant(COM_STATISTICS) operator(=) integer(9) - constant(COM_PROCESS_INFO) operator(=) integer(10) - constant(COM_CONNECT) operator(=) integer(11) - constant(COM_PROCESS_KILL) operator(=) integer(12) - constant(COM_DEBUG) operator(=) integer(13) - constant(COM_PING) operator(=) integer(14) - constant(COM_TIME) operator(=) integer(15) - constant(COM_DELAYED_INSERT) operator(=) integer(16) - constant(COM_CHANGE_USER) operator(=) integer(17) - constant(COM_BINLOG_DUMP) operator(=) integer(18) - constant(COM_TABLE_DUMP) operator(=) integer(19) - constant(COM_CONNECT_OUT) operator(=) integer(20) - constant(COM_REGISTER_SLAVE) operator(=) integer(21) - - comment(# Client flag) - constant(CLIENT_LONG_PASSWORD) operator(=) integer(1) - constant(CLIENT_FOUND_ROWS) operator(=) integer(1) operator(<<) integer(1) - constant(CLIENT_LONG_FLAG) operator(=) integer(1) operator(<<) integer(2) - constant(CLIENT_CONNECT_WITH_DB)operator(=) integer(1) operator(<<) integer(3) - constant(CLIENT_NO_SCHEMA) operator(=) integer(1) operator(<<) integer(4) - constant(CLIENT_COMPRESS) operator(=) integer(1) operator(<<) integer(5) - constant(CLIENT_ODBC) operator(=) integer(1) operator(<<) integer(6) - constant(CLIENT_LOCAL_FILES) operator(=) integer(1) operator(<<) integer(7) - constant(CLIENT_IGNORE_SPACE) operator(=) integer(1) operator(<<) integer(8) - constant(CLIENT_PROTOCOL_41) operator(=) integer(1) operator(<<) integer(9) - constant(CLIENT_INTERACTIVE) operator(=) integer(1) operator(<<) integer(10) - constant(CLIENT_SSL) operator(=) integer(1) operator(<<) integer(11) - constant(CLIENT_IGNORE_SIGPIPE) operator(=) integer(1) operator(<<) integer(12) - constant(CLIENT_TRANSACTIONS) operator(=) integer(1) operator(<<) integer(13) - constant(CLIENT_RESERVED) operator(=) integer(1) operator(<<) integer(14) - constant(CLIENT_SECURE_CONNECTION) operator(=) integer(1) operator(<<) integer(15) - constant(CLIENT_CAPABILITIES) operator(=) constant(CLIENT_LONG_PASSWORD)operator(|)constant(CLIENT_LONG_FLAG)operator(|)constant(CLIENT_TRANSACTIONS) - constant(PROTO_AUTH41) operator(=) constant(CLIENT_PROTOCOL_41) operator(|) constant(CLIENT_SECURE_CONNECTION) - - comment(# Connection Option) - constant(OPT_CONNECT_TIMEOUT) operator(=) integer(0) - constant(OPT_COMPRESS) operator(=) integer(1) - constant(OPT_NAMED_PIPE) operator(=) integer(2) - constant(INIT_COMMAND) operator(=) integer(3) - constant(READ_DEFAULT_FILE) operator(=) integer(4) - constant(READ_DEFAULT_GROUP) operator(=) integer(5) - constant(SET_CHARSET_DIR) operator(=) integer(6) - constant(SET_CHARSET_NAME) operator(=) integer(7) - constant(OPT_LOCAL_INFILE) operator(=) integer(8) - - comment(# Server Status) - constant(SERVER_STATUS_IN_TRANS) operator(=) integer(1) - constant(SERVER_STATUS_AUTOCOMMIT) operator(=) integer(2) - - comment(# Refresh parameter) - constant(REFRESH_GRANT) operator(=) integer(1) - constant(REFRESH_LOG) operator(=) integer(2) - constant(REFRESH_TABLES) operator(=) integer(4) - constant(REFRESH_HOSTS) operator(=) integer(8) - constant(REFRESH_STATUS) operator(=) integer(16) - constant(REFRESH_THREADS) operator(=) integer(32) - constant(REFRESH_SLAVE) operator(=) integer(64) - constant(REFRESH_MASTER) operator(=) integer(128) - - reserved(def) method(initialize)operator(()operator(*)ident(args)operator(\)) - instance_variable(@client_flag) operator(=) integer(0) - instance_variable(@max_allowed_packet) operator(=) constant(MAX_ALLOWED_PACKET) - instance_variable(@query_with_result) operator(=) pre_constant(true) - instance_variable(@status) operator(=) symbol(:STATUS_READY) - reserved(if) ident(args)operator([)integer(0)operator(]) operator(!=) symbol(:INIT) reserved(then) - ident(real_connect)operator(()operator(*)ident(args)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(real_connect)operator(()ident(host)operator(=)pre_constant(nil)operator(,) ident(user)operator(=)pre_constant(nil)operator(,) ident(passwd)operator(=)pre_constant(nil)operator(,) ident(db)operator(=)pre_constant(nil)operator(,) ident(port)operator(=)pre_constant(nil)operator(,) ident(socket)operator(=)pre_constant(nil)operator(,) ident(flag)operator(=)pre_constant(nil)operator(\)) - instance_variable(@server_status) operator(=) constant(SERVER_STATUS_AUTOCOMMIT) - reserved(if) operator(()ident(host) operator(==) pre_constant(nil) reserved(or) ident(host) operator(==) stringoperator(\)) reserved(and) reserved(defined?) constant(UNIXSocket) reserved(then) - ident(unix_socket) operator(=) ident(socket) operator(||) pre_constant(ENV)operator([)stringoperator(]) operator(||) constant(MYSQL_UNIX_ADDR) - ident(sock) operator(=) constant(UNIXSocket)operator(::)ident(new)operator(()ident(unix_socket)operator(\)) - instance_variable(@host_info) operator(=) constant(Error)operator(::)ident(err)operator(()constant(Error)operator(::)constant(CR_LOCALHOST_CONNECTION)operator(\)) - instance_variable(@unix_socket) operator(=) ident(unix_socket) - reserved(else) - ident(sock) operator(=) constant(TCPSocket)operator(::)ident(new)operator(()ident(host)operator(,) ident(port)operator(||)pre_constant(ENV)operator([)stringoperator(])operator(||)operator(()constant(Socket)operator(::)ident(getservbyname)operator(()stringoperator(,)stringoperator(\)) reserved(rescue) constant(MYSQL_PORT)operator(\))operator(\)) - instance_variable(@host_info) operator(=) ident(sprintf) constant(Error)operator(::)ident(err)operator(()constant(Error)operator(::)constant(CR_TCP_CONNECTION)operator(\))operator(,) ident(host) - reserved(end) - instance_variable(@host) operator(=) ident(host) operator(?) ident(host)operator(.)ident(dup) operator(:) pre_constant(nil) - ident(sock)operator(.)ident(setsockopt) constant(Socket)operator(::)constant(SOL_SOCKET)operator(,) constant(Socket)operator(::)constant(SO_KEEPALIVE)operator(,) pre_constant(true) - instance_variable(@net) operator(=) constant(Net)operator(::)ident(new) ident(sock) - - ident(a) operator(=) ident(read) - instance_variable(@protocol_version) operator(=) ident(a)operator(.)ident(slice!)operator(()integer(0)operator(\)) - instance_variable(@server_version)operator(,) ident(a) operator(=) ident(a)operator(.)ident(split)operator(()regexpoperator(,)integer(2)operator(\)) - instance_variable(@thread_id)operator(,) instance_variable(@scramble_buff) operator(=) ident(a)operator(.)ident(slice!)operator(()integer(0)operator(,)integer(13)operator(\))operator(.)ident(unpack)operator(()stringoperator(\)) - reserved(if) ident(a)operator(.)ident(size) operator(>)operator(=) integer(2) reserved(then) - instance_variable(@server_capabilities)operator(,) operator(=) ident(a)operator(.)ident(slice!)operator(()integer(0)operator(,)integer(2)operator(\))operator(.)ident(unpack)operator(()stringoperator(\)) - reserved(end) - reserved(if) ident(a)operator(.)ident(size) operator(>)operator(=) integer(16) reserved(then) - instance_variable(@server_language)operator(,) instance_variable(@server_status) operator(=) ident(a)operator(.)ident(slice!)operator(()integer(0)operator(,)integer(3)operator(\))operator(.)ident(unpack)operator(()stringoperator(\)) - reserved(end) - - ident(flag) operator(=) integer(0) reserved(if) ident(flag) operator(==) pre_constant(nil) - ident(flag) operator(|=) instance_variable(@client_flag) operator(|) constant(CLIENT_CAPABILITIES) - ident(flag) operator(|=) constant(CLIENT_CONNECT_WITH_DB) reserved(if) ident(db) - - instance_variable(@pre_411) operator(=) operator(()integer(0) operator(==) instance_variable(@server_capabilities) operator(&) constant(PROTO_AUTH41)operator(\)) - reserved(if) instance_variable(@pre_411) - ident(data) operator(=) constant(Net)operator(::)ident(int2str)operator(()ident(flag)operator(\))operator(+)constant(Net)operator(::)ident(int3str)operator(()instance_variable(@max_allowed_packet)operator(\))operator(+) - operator(()ident(user)operator(||)stringoperator(\))operator(+)stringoperator(+) - ident(scramble)operator(()ident(passwd)operator(,) instance_variable(@scramble_buff)operator(,) instance_variable(@protocol_version)operator(==)integer(9)operator(\)) - reserved(else) - ident(dummy)operator(,) instance_variable(@salt2) operator(=) ident(a)operator(.)ident(unpack)operator(()stringoperator(\)) - instance_variable(@scramble_buff) operator(+=) instance_variable(@salt2) - ident(flag) operator(|=) constant(PROTO_AUTH41) - ident(data) operator(=) constant(Net)operator(::)ident(int4str)operator(()ident(flag)operator(\)) operator(+) constant(Net)operator(::)ident(int4str)operator(()instance_variable(@max_allowed_packet)operator(\)) operator(+) - operator(()operator([)integer(8)operator(]) operator(+) constant(Array)operator(.)ident(new)operator(()integer(23)operator(,) integer(0)operator(\))operator(\))operator(.)ident(pack)operator(()stringoperator(\)) operator(+) operator(()ident(user)operator(||)stringoperator(\))operator(+)stringoperator(+) - ident(scramble41)operator(()ident(passwd)operator(,) instance_variable(@scramble_buff)operator(\)) - reserved(end) - - reserved(if) ident(db) reserved(and) instance_variable(@server_capabilities) operator(&) constant(CLIENT_CONNECT_WITH_DB) operator(!=) integer(0) - ident(data) operator(<<) string reserved(if) instance_variable(@pre_411) - ident(data) operator(<<) ident(db) - instance_variable(@db) operator(=) ident(db)operator(.)ident(dup) - reserved(end) - ident(write) ident(data) - ident(read) - constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) constant(Mysql)operator(.)ident(finalizer)operator(()instance_variable(@net)operator(\))operator(\)) - pre_constant(self) - reserved(end) - reserved(alias) symbol(:connect) symbol(:real_connect) - - reserved(def) method(escape_string)operator(()ident(str)operator(\)) - constant(Mysql)operator(::)ident(escape_string) ident(str) - reserved(end) - reserved(alias) symbol(:quote) symbol(:escape_string) - - reserved(def) method(get_client_info)operator(()operator(\)) - constant(VERSION) - reserved(end) - reserved(alias) symbol(:client_info) symbol(:get_client_info) - - reserved(def) method(options)operator(()ident(option)operator(,) ident(arg)operator(=)pre_constant(nil)operator(\)) - reserved(if) ident(option) operator(==) constant(OPT_LOCAL_INFILE) reserved(then) - reserved(if) ident(arg) operator(==) pre_constant(false) reserved(or) ident(arg) operator(==) integer(0) reserved(then) - instance_variable(@client_flag) operator(&=) operator(~)constant(CLIENT_LOCAL_FILES) - reserved(else) - instance_variable(@client_flag) operator(|=) constant(CLIENT_LOCAL_FILES) - reserved(end) - reserved(else) - ident(raise) string - reserved(end) - reserved(end) - - reserved(def) method(real_query)operator(()ident(query)operator(\)) - ident(command) constant(COM_QUERY)operator(,) ident(query)operator(,) pre_constant(true) - ident(read_query_result) - pre_constant(self) - reserved(end) - - reserved(def) method(use_result)operator(()operator(\)) - reserved(if) instance_variable(@status) operator(!=) symbol(:STATUS_GET_RESULT) reserved(then) - ident(error) constant(Error)operator(::)constant(CR_COMMANDS_OUT_OF_SYNC) - reserved(end) - ident(res) operator(=) constant(Result)operator(::)ident(new) pre_constant(self)operator(,) instance_variable(@fields)operator(,) instance_variable(@field_count) - instance_variable(@status) operator(=) symbol(:STATUS_USE_RESULT) - ident(res) - reserved(end) - - reserved(def) method(store_result)operator(()operator(\)) - reserved(if) instance_variable(@status) operator(!=) symbol(:STATUS_GET_RESULT) reserved(then) - ident(error) constant(Error)operator(::)constant(CR_COMMANDS_OUT_OF_SYNC) - reserved(end) - instance_variable(@status) operator(=) symbol(:STATUS_READY) - ident(data) operator(=) ident(read_rows) instance_variable(@field_count) - ident(res) operator(=) constant(Result)operator(::)ident(new) pre_constant(self)operator(,) instance_variable(@fields)operator(,) instance_variable(@field_count)operator(,) ident(data) - instance_variable(@fields) operator(=) pre_constant(nil) - instance_variable(@affected_rows) operator(=) ident(data)operator(.)ident(length) - ident(res) - reserved(end) - - reserved(def) method(change_user)operator(()ident(user)operator(=)stringoperator(,) ident(passwd)operator(=)stringoperator(,) ident(db)operator(=)stringoperator(\)) - reserved(if) instance_variable(@pre_411) - ident(data) operator(=) ident(user)operator(+)stringoperator(+)ident(scramble)operator(()ident(passwd)operator(,) instance_variable(@scramble_buff)operator(,) instance_variable(@protocol_version)operator(==)integer(9)operator(\))operator(+)stringoperator(+)ident(db) - reserved(else) - ident(data) operator(=) ident(user)operator(+)stringoperator(+)ident(scramble41)operator(()ident(passwd)operator(,) instance_variable(@scramble_buff)operator(\))operator(+)ident(db) - reserved(end) - ident(command) constant(COM_CHANGE_USER)operator(,) ident(data) - instance_variable(@user) operator(=) ident(user) - instance_variable(@passwd) operator(=) ident(passwd) - instance_variable(@db) operator(=) ident(db) - reserved(end) - - reserved(def) method(character_set_name)operator(()operator(\)) - ident(raise) string - reserved(end) - - reserved(def) method(close)operator(()operator(\)) - instance_variable(@status) operator(=) symbol(:STATUS_READY) - ident(command) constant(COM_QUIT)operator(,) pre_constant(nil)operator(,) pre_constant(true) - instance_variable(@net)operator(.)ident(close) - pre_constant(self) - reserved(end) - - reserved(def) method(create_db)operator(()ident(db)operator(\)) - ident(command) constant(COM_CREATE_DB)operator(,) ident(db) - pre_constant(self) - reserved(end) - - reserved(def) method(drop_db)operator(()ident(db)operator(\)) - ident(command) constant(COM_DROP_DB)operator(,) ident(db) - pre_constant(self) - reserved(end) - - reserved(def) method(dump_debug_info)operator(()operator(\)) - ident(command) constant(COM_DEBUG) - pre_constant(self) - reserved(end) - - reserved(def) method(get_host_info)operator(()operator(\)) - instance_variable(@host_info) - reserved(end) - reserved(alias) symbol(:host_info) symbol(:get_host_info) - - reserved(def) method(get_proto_info)operator(()operator(\)) - instance_variable(@protocol_version) - reserved(end) - reserved(alias) symbol(:proto_info) symbol(:get_proto_info) - - reserved(def) method(get_server_info)operator(()operator(\)) - instance_variable(@server_version) - reserved(end) - reserved(alias) symbol(:server_info) symbol(:get_server_info) - - reserved(def) method(kill)operator(()ident(id)operator(\)) - ident(command) constant(COM_PROCESS_KILL)operator(,) constant(Net)operator(::)ident(int4str)operator(()ident(id)operator(\)) - pre_constant(self) - reserved(end) - - reserved(def) method(list_dbs)operator(()ident(db)operator(=)pre_constant(nil)operator(\)) - ident(real_query) stringdelimiter(")> - instance_variable(@status) operator(=) symbol(:STATUS_READY) - ident(read_rows)operator(()integer(1)operator(\))operator(.)ident(flatten) - reserved(end) - - reserved(def) method(list_fields)operator(()ident(table)operator(,) ident(field)operator(=)pre_constant(nil)operator(\)) - ident(command) constant(COM_FIELD_LIST)operator(,) stringchar(\\0)inlinedelimiter(")>operator(,) pre_constant(true) - reserved(if) instance_variable(@pre_411) - ident(f) operator(=) ident(read_rows) integer(6) - reserved(else) - ident(f) operator(=) ident(read_rows) integer(7) - reserved(end) - ident(fields) operator(=) ident(unpack_fields)operator(()ident(f)operator(,) instance_variable(@server_capabilities) operator(&) constant(CLIENT_LONG_FLAG) operator(!=) integer(0)operator(\)) - ident(res) operator(=) constant(Result)operator(::)ident(new) pre_constant(self)operator(,) ident(fields)operator(,) ident(f)operator(.)ident(length) - ident(res)operator(.)ident(eof) operator(=) pre_constant(true) - ident(res) - reserved(end) - - reserved(def) method(list_processes)operator(()operator(\)) - ident(data) operator(=) ident(command) constant(COM_PROCESS_INFO) - instance_variable(@field_count) operator(=) ident(get_length) ident(data) - reserved(if) instance_variable(@pre_411) - ident(fields) operator(=) ident(read_rows) integer(5) - reserved(else) - ident(fields) operator(=) ident(read_rows) integer(7) - reserved(end) - instance_variable(@fields) operator(=) ident(unpack_fields)operator(()ident(fields)operator(,) instance_variable(@server_capabilities) operator(&) constant(CLIENT_LONG_FLAG) operator(!=) integer(0)operator(\)) - instance_variable(@status) operator(=) symbol(:STATUS_GET_RESULT) - ident(store_result) - reserved(end) - - reserved(def) method(list_tables)operator(()ident(table)operator(=)pre_constant(nil)operator(\)) - ident(real_query) stringdelimiter(")> - instance_variable(@status) operator(=) symbol(:STATUS_READY) - ident(read_rows)operator(()integer(1)operator(\))operator(.)ident(flatten) - reserved(end) - - reserved(def) method(ping)operator(()operator(\)) - ident(command) constant(COM_PING) - pre_constant(self) - reserved(end) - - reserved(def) method(query)operator(()ident(query)operator(\)) - ident(real_query) ident(query) - reserved(if) reserved(not) instance_variable(@query_with_result) reserved(then) - reserved(return) pre_constant(self) - reserved(end) - reserved(if) instance_variable(@field_count) operator(==) integer(0) reserved(then) - reserved(return) pre_constant(nil) - reserved(end) - ident(store_result) - reserved(end) - - reserved(def) method(refresh)operator(()ident(r)operator(\)) - ident(command) constant(COM_REFRESH)operator(,) ident(r)operator(.)ident(chr) - pre_constant(self) - reserved(end) - - reserved(def) method(reload)operator(()operator(\)) - ident(refresh) constant(REFRESH_GRANT) - pre_constant(self) - reserved(end) - - reserved(def) method(select_db)operator(()ident(db)operator(\)) - ident(command) constant(COM_INIT_DB)operator(,) ident(db) - instance_variable(@db) operator(=) ident(db) - pre_constant(self) - reserved(end) - - reserved(def) method(shutdown)operator(()operator(\)) - ident(command) constant(COM_SHUTDOWN) - pre_constant(self) - reserved(end) - - reserved(def) method(stat)operator(()operator(\)) - ident(command) constant(COM_STATISTICS) - reserved(end) - - ident(attr_reader) symbol(:info)operator(,) symbol(:insert_id)operator(,) symbol(:affected_rows)operator(,) symbol(:field_count)operator(,) symbol(:thread_id) - ident(attr_accessor) symbol(:query_with_result)operator(,) symbol(:status) - - reserved(def) method(read_one_row)operator(()ident(field_count)operator(\)) - ident(data) operator(=) ident(read) - reserved(if) ident(data)operator([)integer(0)operator(]) operator(==) integer(254) reserved(and) ident(data)operator(.)ident(length) operator(==) integer(1) comment(## EOF) - reserved(return) - reserved(elsif) ident(data)operator([)integer(0)operator(]) operator(==) integer(254) reserved(and) ident(data)operator(.)ident(length) operator(==) integer(5) - reserved(return) - reserved(end) - ident(rec) operator(=) operator([)operator(]) - ident(field_count)operator(.)ident(times) reserved(do) - ident(len) operator(=) ident(get_length) ident(data) - reserved(if) ident(len) operator(==) pre_constant(nil) reserved(then) - ident(rec) operator(<<) ident(len) - reserved(else) - ident(rec) operator(<<) ident(data)operator(.)ident(slice!)operator(()integer(0)operator(,)ident(len)operator(\)) - reserved(end) - reserved(end) - ident(rec) - reserved(end) - - reserved(def) method(skip_result)operator(()operator(\)) - reserved(if) instance_variable(@status) operator(==) symbol(:STATUS_USE_RESULT) reserved(then) - ident(loop) reserved(do) - ident(data) operator(=) ident(read) - reserved(break) reserved(if) ident(data)operator([)integer(0)operator(]) operator(==) integer(254) reserved(and) ident(data)operator(.)ident(length) operator(==) integer(1) - reserved(end) - instance_variable(@status) operator(=) symbol(:STATUS_READY) - reserved(end) - reserved(end) - - reserved(def) method(inspect)operator(()operator(\)) - stringcontent(>)delimiter(")> - reserved(end) - - ident(private) - - reserved(def) method(read_query_result)operator(()operator(\)) - ident(data) operator(=) ident(read) - instance_variable(@field_count) operator(=) ident(get_length)operator(()ident(data)operator(\)) - reserved(if) instance_variable(@field_count) operator(==) pre_constant(nil) reserved(then) comment(# LOAD DATA LOCAL INFILE) - constant(File)operator(::)ident(open)operator(()ident(data)operator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(write) ident(f)operator(.)ident(read) - reserved(end) - ident(write) string comment(# mark EOF) - ident(data) operator(=) ident(read) - instance_variable(@field_count) operator(=) ident(get_length)operator(()ident(data)operator(\)) - reserved(end) - reserved(if) instance_variable(@field_count) operator(==) integer(0) reserved(then) - instance_variable(@affected_rows) operator(=) ident(get_length)operator(()ident(data)operator(,) pre_constant(true)operator(\)) - instance_variable(@insert_id) operator(=) ident(get_length)operator(()ident(data)operator(,) pre_constant(true)operator(\)) - reserved(if) instance_variable(@server_capabilities) operator(&) constant(CLIENT_TRANSACTIONS) operator(!=) integer(0) reserved(then) - ident(a) operator(=) ident(data)operator(.)ident(slice!)operator(()integer(0)operator(,)integer(2)operator(\)) - instance_variable(@server_status) operator(=) ident(a)operator([)integer(0)operator(])operator(+)ident(a)operator([)integer(1)operator(])operator(*)integer(256) - reserved(end) - reserved(if) ident(data)operator(.)ident(size) operator(>) integer(0) reserved(and) ident(get_length)operator(()ident(data)operator(\)) reserved(then) - instance_variable(@info) operator(=) ident(data) - reserved(end) - reserved(else) - instance_variable(@extra_info) operator(=) ident(get_length)operator(()ident(data)operator(,) pre_constant(true)operator(\)) - reserved(if) instance_variable(@pre_411) - ident(fields) operator(=) ident(read_rows)operator(()integer(5)operator(\)) - reserved(else) - ident(fields) operator(=) ident(read_rows)operator(()integer(7)operator(\)) - reserved(end) - instance_variable(@fields) operator(=) ident(unpack_fields)operator(()ident(fields)operator(,) instance_variable(@server_capabilities) operator(&) constant(CLIENT_LONG_FLAG) operator(!=) integer(0)operator(\)) - instance_variable(@status) operator(=) symbol(:STATUS_GET_RESULT) - reserved(end) - pre_constant(self) - reserved(end) - - reserved(def) method(unpack_fields)operator(()ident(data)operator(,) ident(long_flag_protocol)operator(\)) - ident(ret) operator(=) operator([)operator(]) - ident(data)operator(.)ident(each) reserved(do) operator(|)ident(f)operator(|) - reserved(if) instance_variable(@pre_411) - ident(table) operator(=) ident(org_table) operator(=) ident(f)operator([)integer(0)operator(]) - ident(name) operator(=) ident(f)operator([)integer(1)operator(]) - ident(length) operator(=) ident(f)operator([)integer(2)operator(])operator([)integer(0)operator(])operator(+)ident(f)operator([)integer(2)operator(])operator([)integer(1)operator(])operator(*)integer(256)operator(+)ident(f)operator([)integer(2)operator(])operator([)integer(2)operator(])operator(*)integer(256)operator(*)integer(256) - ident(type) operator(=) ident(f)operator([)integer(3)operator(])operator([)integer(0)operator(]) - reserved(if) ident(long_flag_protocol) reserved(then) - ident(flags) operator(=) ident(f)operator([)integer(4)operator(])operator([)integer(0)operator(])operator(+)ident(f)operator([)integer(4)operator(])operator([)integer(1)operator(])operator(*)integer(256) - ident(decimals) operator(=) ident(f)operator([)integer(4)operator(])operator([)integer(2)operator(]) - reserved(else) - ident(flags) operator(=) ident(f)operator([)integer(4)operator(])operator([)integer(0)operator(]) - ident(decimals) operator(=) ident(f)operator([)integer(4)operator(])operator([)integer(1)operator(]) - reserved(end) - ident(def_value) operator(=) ident(f)operator([)integer(5)operator(]) - ident(max_length) operator(=) integer(0) - reserved(else) - ident(catalog) operator(=) ident(f)operator([)integer(0)operator(]) - ident(db) operator(=) ident(f)operator([)integer(1)operator(]) - ident(table) operator(=) ident(f)operator([)integer(2)operator(]) - ident(org_table) operator(=) ident(f)operator([)integer(3)operator(]) - ident(name) operator(=) ident(f)operator([)integer(4)operator(]) - ident(org_name) operator(=) ident(f)operator([)integer(5)operator(]) - ident(length) operator(=) ident(f)operator([)integer(6)operator(])operator([)integer(2)operator(])operator(+)ident(f)operator([)integer(6)operator(])operator([)integer(3)operator(])operator(*)integer(256)operator(+)ident(f)operator([)integer(6)operator(])operator([)integer(4)operator(])operator(*)integer(256)operator(*)integer(256) - ident(type) operator(=) ident(f)operator([)integer(6)operator(])operator([)integer(6)operator(]) - ident(flags) operator(=) ident(f)operator([)integer(6)operator(])operator([)integer(7)operator(])operator(+)ident(f)operator([)integer(6)operator(])operator([)integer(8)operator(])operator(*)integer(256) - ident(decimals) operator(=) ident(f)operator([)integer(6)operator(])operator([)integer(9)operator(]) - ident(def_value) operator(=) string - ident(max_length) operator(=) integer(0) - reserved(end) - ident(ret) operator(<<) constant(Field)operator(::)ident(new)operator(()ident(table)operator(,) ident(org_table)operator(,) ident(name)operator(,) ident(length)operator(,) ident(type)operator(,) ident(flags)operator(,) ident(decimals)operator(,) ident(def_value)operator(,) ident(max_length)operator(\)) - reserved(end) - ident(ret) - reserved(end) - - reserved(def) method(read_rows)operator(()ident(field_count)operator(\)) - ident(ret) operator(=) operator([)operator(]) - reserved(while) ident(rec) operator(=) ident(read_one_row)operator(()ident(field_count)operator(\)) reserved(do) - ident(ret) operator(<<) ident(rec) - reserved(end) - ident(ret) - reserved(end) - - reserved(def) method(get_length)operator(()ident(data)operator(,) ident(longlong)operator(=)pre_constant(nil)operator(\)) - reserved(return) reserved(if) ident(data)operator(.)ident(length) operator(==) integer(0) - ident(c) operator(=) ident(data)operator(.)ident(slice!)operator(()integer(0)operator(\)) - reserved(case) ident(c) - reserved(when) integer(251) - reserved(return) pre_constant(nil) - reserved(when) integer(252) - ident(a) operator(=) ident(data)operator(.)ident(slice!)operator(()integer(0)operator(,)integer(2)operator(\)) - reserved(return) ident(a)operator([)integer(0)operator(])operator(+)ident(a)operator([)integer(1)operator(])operator(*)integer(256) - reserved(when) integer(253) - ident(a) operator(=) ident(data)operator(.)ident(slice!)operator(()integer(0)operator(,)integer(3)operator(\)) - reserved(return) ident(a)operator([)integer(0)operator(])operator(+)ident(a)operator([)integer(1)operator(])operator(*)integer(256)operator(+)ident(a)operator([)integer(2)operator(])operator(*)integer(256)operator(**)integer(2) - reserved(when) integer(254) - ident(a) operator(=) ident(data)operator(.)ident(slice!)operator(()integer(0)operator(,)integer(8)operator(\)) - reserved(if) ident(longlong) reserved(then) - reserved(return) ident(a)operator([)integer(0)operator(])operator(+)ident(a)operator([)integer(1)operator(])operator(*)integer(256)operator(+)ident(a)operator([)integer(2)operator(])operator(*)integer(256)operator(**)integer(2)operator(+)ident(a)operator([)integer(3)operator(])operator(*)integer(256)operator(**)integer(3)operator(+) - ident(a)operator([)integer(4)operator(])operator(*)integer(256)operator(**)integer(4)operator(+)ident(a)operator([)integer(5)operator(])operator(*)integer(256)operator(**)integer(5)operator(+)ident(a)operator([)integer(6)operator(])operator(*)integer(256)operator(**)integer(6)operator(+)ident(a)operator([)integer(7)operator(])operator(*)integer(256)operator(**)integer(7) - reserved(else) - reserved(return) ident(a)operator([)integer(0)operator(])operator(+)ident(a)operator([)integer(1)operator(])operator(*)integer(256)operator(+)ident(a)operator([)integer(2)operator(])operator(*)integer(256)operator(**)integer(2)operator(+)ident(a)operator([)integer(3)operator(])operator(*)integer(256)operator(**)integer(3) - reserved(end) - reserved(else) - ident(c) - reserved(end) - reserved(end) - - reserved(def) method(command)operator(()ident(cmd)operator(,) ident(arg)operator(=)pre_constant(nil)operator(,) ident(skip_check)operator(=)pre_constant(nil)operator(\)) - reserved(unless) instance_variable(@net) reserved(then) - ident(error) constant(Error)operator(::)constant(CR_SERVER_GONE_ERROR) - reserved(end) - reserved(if) instance_variable(@status) operator(!=) symbol(:STATUS_READY) reserved(then) - ident(error) constant(Error)operator(::)constant(CR_COMMANDS_OUT_OF_SYNC) - reserved(end) - instance_variable(@net)operator(.)ident(clear) - ident(write) ident(cmd)operator(.)ident(chr)operator(+)operator(()ident(arg)operator(||)stringoperator(\)) - ident(read) reserved(unless) ident(skip_check) - reserved(end) - - reserved(def) method(read)operator(()operator(\)) - reserved(unless) instance_variable(@net) reserved(then) - ident(error) constant(Error)operator(::)constant(CR_SERVER_GONE_ERROR) - reserved(end) - ident(a) operator(=) instance_variable(@net)operator(.)ident(read) - reserved(if) ident(a)operator([)integer(0)operator(]) operator(==) integer(255) reserved(then) - reserved(if) ident(a)operator(.)ident(length) operator(>) integer(3) reserved(then) - instance_variable(@errno) operator(=) ident(a)operator([)integer(1)operator(])operator(+)ident(a)operator([)integer(2)operator(])operator(*)integer(256) - instance_variable(@error) operator(=) ident(a)operator([)integer(3) operator(..) integer(-1)operator(]) - reserved(else) - instance_variable(@errno) operator(=) constant(Error)operator(::)constant(CR_UNKNOWN_ERROR) - instance_variable(@error) operator(=) constant(Error)operator(::)ident(err) instance_variable(@errno) - reserved(end) - ident(raise) constant(Error)operator(::)ident(new)operator(()instance_variable(@errno)operator(,) instance_variable(@error)operator(\)) - reserved(end) - ident(a) - reserved(end) - - reserved(def) method(write)operator(()ident(arg)operator(\)) - reserved(unless) instance_variable(@net) reserved(then) - ident(error) constant(Error)operator(::)constant(CR_SERVER_GONE_ERROR) - reserved(end) - instance_variable(@net)operator(.)ident(write) ident(arg) - reserved(end) - - reserved(def) method(hash_password)operator(()ident(password)operator(\)) - ident(nr) operator(=) integer(1345345333) - ident(add) operator(=) integer(7) - ident(nr2) operator(=) integer(0x12345671) - ident(password)operator(.)ident(each_byte) reserved(do) operator(|)ident(i)operator(|) - reserved(next) reserved(if) ident(i) operator(==) integer(0x20) reserved(or) ident(i) operator(==) integer(9) - ident(nr) operator(^=) operator(()operator(()operator(()ident(nr) operator(&) integer(63)operator(\)) operator(+) ident(add)operator(\)) operator(*) ident(i)operator(\)) operator(+) operator(()ident(nr) operator(<<) integer(8)operator(\)) - ident(nr2) operator(+=) operator(()ident(nr2) operator(<<) integer(8)operator(\)) operator(^) ident(nr) - ident(add) operator(+=) ident(i) - reserved(end) - operator([)ident(nr) operator(&) operator(()operator(()integer(1) operator(<<) integer(31)operator(\)) operator(-) integer(1)operator(\))operator(,) ident(nr2) operator(&) operator(()operator(()integer(1) operator(<<) integer(31)operator(\)) operator(-) integer(1)operator(\))operator(]) - reserved(end) - - reserved(def) method(scramble)operator(()ident(password)operator(,) ident(message)operator(,) ident(old_ver)operator(\)) - reserved(return) string reserved(if) ident(password) operator(==) pre_constant(nil) reserved(or) ident(password) operator(==) string - ident(raise) string reserved(if) ident(old_ver) - ident(hash_pass) operator(=) ident(hash_password) ident(password) - ident(hash_message) operator(=) ident(hash_password) ident(message) - ident(rnd) operator(=) constant(Random)operator(::)ident(new) ident(hash_pass)operator([)integer(0)operator(]) operator(^) ident(hash_message)operator([)integer(0)operator(])operator(,) ident(hash_pass)operator([)integer(1)operator(]) operator(^) ident(hash_message)operator([)integer(1)operator(]) - ident(to) operator(=) operator([)operator(]) - integer(1)operator(.)ident(upto)operator(()ident(message)operator(.)ident(length)operator(\)) reserved(do) - ident(to) operator(<<) operator(()operator(()ident(rnd)operator(.)ident(rnd)operator(*)integer(31)operator(\))operator(+)integer(64)operator(\))operator(.)ident(floor) - reserved(end) - ident(extra) operator(=) operator(()ident(rnd)operator(.)ident(rnd)operator(*)integer(31)operator(\))operator(.)ident(floor) - ident(to)operator(.)ident(map!) reserved(do) operator(|)ident(t)operator(|) operator(()ident(t) operator(^) ident(extra)operator(\))operator(.)ident(chr) reserved(end) - ident(to)operator(.)ident(join) - reserved(end) - - reserved(def) method(scramble41)operator(()ident(password)operator(,) ident(message)operator(\)) - reserved(return) integer(0x00)operator(.)ident(chr) reserved(if) ident(password)operator(.)ident(nil?) reserved(or) ident(password)operator(.)ident(empty?) - ident(buf) operator(=) operator([)integer(0x14)operator(]) - ident(s1) operator(=) constant(Digest)operator(::)constant(SHA1)operator(.)ident(new)operator(()ident(password)operator(\))operator(.)ident(digest) - ident(s2) operator(=) constant(Digest)operator(::)constant(SHA1)operator(.)ident(new)operator(()ident(s1)operator(\))operator(.)ident(digest) - ident(x) operator(=) constant(Digest)operator(::)constant(SHA1)operator(.)ident(new)operator(()ident(message) operator(+) ident(s2)operator(\))operator(.)ident(digest) - operator(()integer(0)operator(..)ident(s1)operator(.)ident(length) operator(-) integer(1)operator(\))operator(.)ident(each) operator({)operator(|)ident(i)operator(|) ident(buf)operator(.)ident(push)operator(()ident(s1)operator([)ident(i)operator(]) operator(^) ident(x)operator([)ident(i)operator(])operator(\))operator(}) - ident(buf)operator(.)ident(pack)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(error)operator(()ident(errno)operator(\)) - instance_variable(@errno) operator(=) ident(errno) - instance_variable(@error) operator(=) constant(Error)operator(::)ident(err) ident(errno) - ident(raise) constant(Error)operator(::)ident(new)operator(()instance_variable(@errno)operator(,) instance_variable(@error)operator(\)) - reserved(end) - - reserved(class) class(Result) - reserved(def) method(initialize)operator(()ident(mysql)operator(,) ident(fields)operator(,) ident(field_count)operator(,) ident(data)operator(=)pre_constant(nil)operator(\)) - instance_variable(@handle) operator(=) ident(mysql) - instance_variable(@fields) operator(=) ident(fields) - instance_variable(@field_count) operator(=) ident(field_count) - instance_variable(@data) operator(=) ident(data) - instance_variable(@current_field) operator(=) integer(0) - instance_variable(@current_row) operator(=) integer(0) - instance_variable(@eof) operator(=) pre_constant(false) - instance_variable(@row_count) operator(=) integer(0) - reserved(end) - ident(attr_accessor) symbol(:eof) - - reserved(def) method(data_seek)operator(()ident(n)operator(\)) - instance_variable(@current_row) operator(=) ident(n) - reserved(end) - - reserved(def) method(fetch_field)operator(()operator(\)) - reserved(return) reserved(if) instance_variable(@current_field) operator(>)operator(=) instance_variable(@field_count) - ident(f) operator(=) instance_variable(@fields)operator([)instance_variable(@current_field)operator(]) - instance_variable(@current_field) operator(+=) integer(1) - ident(f) - reserved(end) - - reserved(def) method(fetch_fields)operator(()operator(\)) - instance_variable(@fields) - reserved(end) - - reserved(def) method(fetch_field_direct)operator(()ident(n)operator(\)) - instance_variable(@fields)operator([)ident(n)operator(]) - reserved(end) - - reserved(def) method(fetch_lengths)operator(()operator(\)) - instance_variable(@data) operator(?) instance_variable(@data)operator([)instance_variable(@current_row)operator(])operator(.)ident(map)operator({)operator(|)ident(i)operator(|) ident(i) operator(?) ident(i)operator(.)ident(length) operator(:) integer(0)operator(}) operator(:) instance_variable(@lengths) - reserved(end) - - reserved(def) method(fetch_row)operator(()operator(\)) - reserved(if) instance_variable(@data) reserved(then) - reserved(if) instance_variable(@current_row) operator(>)operator(=) instance_variable(@data)operator(.)ident(length) reserved(then) - instance_variable(@handle)operator(.)ident(status) operator(=) symbol(:STATUS_READY) - reserved(return) - reserved(end) - ident(ret) operator(=) instance_variable(@data)operator([)instance_variable(@current_row)operator(]) - instance_variable(@current_row) operator(+=) integer(1) - reserved(else) - reserved(return) reserved(if) instance_variable(@eof) - ident(ret) operator(=) instance_variable(@handle)operator(.)ident(read_one_row) instance_variable(@field_count) - reserved(if) ident(ret) operator(==) pre_constant(nil) reserved(then) - instance_variable(@eof) operator(=) pre_constant(true) - reserved(return) - reserved(end) - instance_variable(@lengths) operator(=) ident(ret)operator(.)ident(map)operator({)operator(|)ident(i)operator(|) ident(i) operator(?) ident(i)operator(.)ident(length) operator(:) integer(0)operator(}) - instance_variable(@row_count) operator(+=) integer(1) - reserved(end) - ident(ret) - reserved(end) - - reserved(def) method(fetch_hash)operator(()ident(with_table)operator(=)pre_constant(nil)operator(\)) - ident(row) operator(=) ident(fetch_row) - reserved(return) reserved(if) ident(row) operator(==) pre_constant(nil) - ident(hash) operator(=) operator({)operator(}) - instance_variable(@fields)operator(.)ident(each_index) reserved(do) operator(|)ident(i)operator(|) - ident(f) operator(=) ident(with_table) operator(?) instance_variable(@fields)operator([)ident(i)operator(])operator(.)ident(table)operator(+)stringoperator(+)instance_variable(@fields)operator([)ident(i)operator(])operator(.)ident(name) operator(:) instance_variable(@fields)operator([)ident(i)operator(])operator(.)ident(name) - ident(hash)operator([)ident(f)operator(]) operator(=) ident(row)operator([)ident(i)operator(]) - reserved(end) - ident(hash) - reserved(end) - - reserved(def) method(field_seek)operator(()ident(n)operator(\)) - instance_variable(@current_field) operator(=) ident(n) - reserved(end) - - reserved(def) method(field_tell)operator(()operator(\)) - instance_variable(@current_field) - reserved(end) - - reserved(def) method(free)operator(()operator(\)) - instance_variable(@handle)operator(.)ident(skip_result) - instance_variable(@handle) operator(=) instance_variable(@fields) operator(=) instance_variable(@data) operator(=) pre_constant(nil) - reserved(end) - - reserved(def) method(num_fields)operator(()operator(\)) - instance_variable(@field_count) - reserved(end) - - reserved(def) method(num_rows)operator(()operator(\)) - instance_variable(@data) operator(?) instance_variable(@data)operator(.)ident(length) operator(:) instance_variable(@row_count) - reserved(end) - - reserved(def) method(row_seek)operator(()ident(n)operator(\)) - instance_variable(@current_row) operator(=) ident(n) - reserved(end) - - reserved(def) method(row_tell)operator(()operator(\)) - instance_variable(@current_row) - reserved(end) - - reserved(def) method(each)operator(()operator(\)) - reserved(while) ident(row) operator(=) ident(fetch_row) reserved(do) - reserved(yield) ident(row) - reserved(end) - reserved(end) - - reserved(def) method(each_hash)operator(()ident(with_table)operator(=)pre_constant(nil)operator(\)) - reserved(while) ident(hash) operator(=) ident(fetch_hash)operator(()ident(with_table)operator(\)) reserved(do) - reserved(yield) ident(hash) - reserved(end) - reserved(end) - - reserved(def) method(inspect)operator(()operator(\)) - stringcontent(>)delimiter(")> - reserved(end) - - reserved(end) - - reserved(class) class(Field) - comment(# Field type) - constant(TYPE_DECIMAL) operator(=) integer(0) - constant(TYPE_TINY) operator(=) integer(1) - constant(TYPE_SHORT) operator(=) integer(2) - constant(TYPE_LONG) operator(=) integer(3) - constant(TYPE_FLOAT) operator(=) integer(4) - constant(TYPE_DOUBLE) operator(=) integer(5) - constant(TYPE_NULL) operator(=) integer(6) - constant(TYPE_TIMESTAMP) operator(=) integer(7) - constant(TYPE_LONGLONG) operator(=) integer(8) - constant(TYPE_INT24) operator(=) integer(9) - constant(TYPE_DATE) operator(=) integer(10) - constant(TYPE_TIME) operator(=) integer(11) - constant(TYPE_DATETIME) operator(=) integer(12) - constant(TYPE_YEAR) operator(=) integer(13) - constant(TYPE_NEWDATE) operator(=) integer(14) - constant(TYPE_ENUM) operator(=) integer(247) - constant(TYPE_SET) operator(=) integer(248) - constant(TYPE_TINY_BLOB) operator(=) integer(249) - constant(TYPE_MEDIUM_BLOB) operator(=) integer(250) - constant(TYPE_LONG_BLOB) operator(=) integer(251) - constant(TYPE_BLOB) operator(=) integer(252) - constant(TYPE_VAR_STRING) operator(=) integer(253) - constant(TYPE_STRING) operator(=) integer(254) - constant(TYPE_GEOMETRY) operator(=) integer(255) - constant(TYPE_CHAR) operator(=) constant(TYPE_TINY) - constant(TYPE_INTERVAL) operator(=) constant(TYPE_ENUM) - - comment(# Flag) - constant(NOT_NULL_FLAG) operator(=) integer(1) - constant(PRI_KEY_FLAG) operator(=) integer(2) - constant(UNIQUE_KEY_FLAG) operator(=) integer(4) - constant(MULTIPLE_KEY_FLAG) operator(=) integer(8) - constant(BLOB_FLAG) operator(=) integer(16) - constant(UNSIGNED_FLAG) operator(=) integer(32) - constant(ZEROFILL_FLAG) operator(=) integer(64) - constant(BINARY_FLAG) operator(=) integer(128) - constant(ENUM_FLAG) operator(=) integer(256) - constant(AUTO_INCREMENT_FLAG) operator(=) integer(512) - constant(TIMESTAMP_FLAG) operator(=) integer(1024) - constant(SET_FLAG) operator(=) integer(2048) - constant(NUM_FLAG) operator(=) integer(32768) - constant(PART_KEY_FLAG) operator(=) integer(16384) - constant(GROUP_FLAG) operator(=) integer(32768) - constant(UNIQUE_FLAG) operator(=) integer(65536) - - reserved(def) method(initialize)operator(()ident(table)operator(,) ident(org_table)operator(,) ident(name)operator(,) ident(length)operator(,) ident(type)operator(,) ident(flags)operator(,) ident(decimals)operator(,) ident(def_value)operator(,) ident(max_length)operator(\)) - instance_variable(@table) operator(=) ident(table) - instance_variable(@org_table) operator(=) ident(org_table) - instance_variable(@name) operator(=) ident(name) - instance_variable(@length) operator(=) ident(length) - instance_variable(@type) operator(=) ident(type) - instance_variable(@flags) operator(=) ident(flags) - instance_variable(@decimals) operator(=) ident(decimals) - instance_variable(@def) operator(=) ident(def_value) - instance_variable(@max_length) operator(=) ident(max_length) - reserved(if) operator(()ident(type) operator(<=) constant(TYPE_INT24) reserved(and) operator(()ident(type) operator(!=) constant(TYPE_TIMESTAMP) reserved(or) ident(length) operator(==) integer(14) reserved(or) ident(length) operator(==) integer(8)operator(\))operator(\)) reserved(or) ident(type) operator(==) constant(TYPE_YEAR) reserved(then) - instance_variable(@flags) operator(|=) constant(NUM_FLAG) - reserved(end) - reserved(end) - ident(attr_reader) symbol(:table)operator(,) symbol(:org_table)operator(,) symbol(:name)operator(,) symbol(:length)operator(,) symbol(:type)operator(,) symbol(:flags)operator(,) symbol(:decimals)operator(,) symbol(:def)operator(,) symbol(:max_length) - - reserved(def) method(inspect)operator(()operator(\)) - stringcontent(:)inlinecontent(>)delimiter(")> - reserved(end) - reserved(end) - - reserved(class) class(Error) operator(<) constant(StandardError) - comment(# Server Error) - constant(ER_HASHCHK) operator(=) integer(1000) - constant(ER_NISAMCHK) operator(=) integer(1001) - constant(ER_NO) operator(=) integer(1002) - constant(ER_YES) operator(=) integer(1003) - constant(ER_CANT_CREATE_FILE) operator(=) integer(1004) - constant(ER_CANT_CREATE_TABLE) operator(=) integer(1005) - constant(ER_CANT_CREATE_DB) operator(=) integer(1006) - constant(ER_DB_CREATE_EXISTS) operator(=) integer(1007) - constant(ER_DB_DROP_EXISTS) operator(=) integer(1008) - constant(ER_DB_DROP_DELETE) operator(=) integer(1009) - constant(ER_DB_DROP_RMDIR) operator(=) integer(1010) - constant(ER_CANT_DELETE_FILE) operator(=) integer(1011) - constant(ER_CANT_FIND_SYSTEM_REC) operator(=) integer(1012) - constant(ER_CANT_GET_STAT) operator(=) integer(1013) - constant(ER_CANT_GET_WD) operator(=) integer(1014) - constant(ER_CANT_LOCK) operator(=) integer(1015) - constant(ER_CANT_OPEN_FILE) operator(=) integer(1016) - constant(ER_FILE_NOT_FOUND) operator(=) integer(1017) - constant(ER_CANT_READ_DIR) operator(=) integer(1018) - constant(ER_CANT_SET_WD) operator(=) integer(1019) - constant(ER_CHECKREAD) operator(=) integer(1020) - constant(ER_DISK_FULL) operator(=) integer(1021) - constant(ER_DUP_KEY) operator(=) integer(1022) - constant(ER_ERROR_ON_CLOSE) operator(=) integer(1023) - constant(ER_ERROR_ON_READ) operator(=) integer(1024) - constant(ER_ERROR_ON_RENAME) operator(=) integer(1025) - constant(ER_ERROR_ON_WRITE) operator(=) integer(1026) - constant(ER_FILE_USED) operator(=) integer(1027) - constant(ER_FILSORT_ABORT) operator(=) integer(1028) - constant(ER_FORM_NOT_FOUND) operator(=) integer(1029) - constant(ER_GET_ERRNO) operator(=) integer(1030) - constant(ER_ILLEGAL_HA) operator(=) integer(1031) - constant(ER_KEY_NOT_FOUND) operator(=) integer(1032) - constant(ER_NOT_FORM_FILE) operator(=) integer(1033) - constant(ER_NOT_KEYFILE) operator(=) integer(1034) - constant(ER_OLD_KEYFILE) operator(=) integer(1035) - constant(ER_OPEN_AS_READONLY) operator(=) integer(1036) - constant(ER_OUTOFMEMORY) operator(=) integer(1037) - constant(ER_OUT_OF_SORTMEMORY) operator(=) integer(1038) - constant(ER_UNEXPECTED_EOF) operator(=) integer(1039) - constant(ER_CON_COUNT_ERROR) operator(=) integer(1040) - constant(ER_OUT_OF_RESOURCES) operator(=) integer(1041) - constant(ER_BAD_HOST_ERROR) operator(=) integer(1042) - constant(ER_HANDSHAKE_ERROR) operator(=) integer(1043) - constant(ER_DBACCESS_DENIED_ERROR) operator(=) integer(1044) - constant(ER_ACCESS_DENIED_ERROR) operator(=) integer(1045) - constant(ER_NO_DB_ERROR) operator(=) integer(1046) - constant(ER_UNKNOWN_COM_ERROR) operator(=) integer(1047) - constant(ER_BAD_NULL_ERROR) operator(=) integer(1048) - constant(ER_BAD_DB_ERROR) operator(=) integer(1049) - constant(ER_TABLE_EXISTS_ERROR) operator(=) integer(1050) - constant(ER_BAD_TABLE_ERROR) operator(=) integer(1051) - constant(ER_NON_UNIQ_ERROR) operator(=) integer(1052) - constant(ER_SERVER_SHUTDOWN) operator(=) integer(1053) - constant(ER_BAD_FIELD_ERROR) operator(=) integer(1054) - constant(ER_WRONG_FIELD_WITH_GROUP) operator(=) integer(1055) - constant(ER_WRONG_GROUP_FIELD) operator(=) integer(1056) - constant(ER_WRONG_SUM_SELECT) operator(=) integer(1057) - constant(ER_WRONG_VALUE_COUNT) operator(=) integer(1058) - constant(ER_TOO_LONG_IDENT) operator(=) integer(1059) - constant(ER_DUP_FIELDNAME) operator(=) integer(1060) - constant(ER_DUP_KEYNAME) operator(=) integer(1061) - constant(ER_DUP_ENTRY) operator(=) integer(1062) - constant(ER_WRONG_FIELD_SPEC) operator(=) integer(1063) - constant(ER_PARSE_ERROR) operator(=) integer(1064) - constant(ER_EMPTY_QUERY) operator(=) integer(1065) - constant(ER_NONUNIQ_TABLE) operator(=) integer(1066) - constant(ER_INVALID_DEFAULT) operator(=) integer(1067) - constant(ER_MULTIPLE_PRI_KEY) operator(=) integer(1068) - constant(ER_TOO_MANY_KEYS) operator(=) integer(1069) - constant(ER_TOO_MANY_KEY_PARTS) operator(=) integer(1070) - constant(ER_TOO_LONG_KEY) operator(=) integer(1071) - constant(ER_KEY_COLUMN_DOES_NOT_EXITS) operator(=) integer(1072) - constant(ER_BLOB_USED_AS_KEY) operator(=) integer(1073) - constant(ER_TOO_BIG_FIELDLENGTH) operator(=) integer(1074) - constant(ER_WRONG_AUTO_KEY) operator(=) integer(1075) - constant(ER_READY) operator(=) integer(1076) - constant(ER_NORMAL_SHUTDOWN) operator(=) integer(1077) - constant(ER_GOT_SIGNAL) operator(=) integer(1078) - constant(ER_SHUTDOWN_COMPLETE) operator(=) integer(1079) - constant(ER_FORCING_CLOSE) operator(=) integer(1080) - constant(ER_IPSOCK_ERROR) operator(=) integer(1081) - constant(ER_NO_SUCH_INDEX) operator(=) integer(1082) - constant(ER_WRONG_FIELD_TERMINATORS) operator(=) integer(1083) - constant(ER_BLOBS_AND_NO_TERMINATED) operator(=) integer(1084) - constant(ER_TEXTFILE_NOT_READABLE) operator(=) integer(1085) - constant(ER_FILE_EXISTS_ERROR) operator(=) integer(1086) - constant(ER_LOAD_INFO) operator(=) integer(1087) - constant(ER_ALTER_INFO) operator(=) integer(1088) - constant(ER_WRONG_SUB_KEY) operator(=) integer(1089) - constant(ER_CANT_REMOVE_ALL_FIELDS) operator(=) integer(1090) - constant(ER_CANT_DROP_FIELD_OR_KEY) operator(=) integer(1091) - constant(ER_INSERT_INFO) operator(=) integer(1092) - constant(ER_INSERT_TABLE_USED) operator(=) integer(1093) - constant(ER_NO_SUCH_THREAD) operator(=) integer(1094) - constant(ER_KILL_DENIED_ERROR) operator(=) integer(1095) - constant(ER_NO_TABLES_USED) operator(=) integer(1096) - constant(ER_TOO_BIG_SET) operator(=) integer(1097) - constant(ER_NO_UNIQUE_LOGFILE) operator(=) integer(1098) - constant(ER_TABLE_NOT_LOCKED_FOR_WRITE) operator(=) integer(1099) - constant(ER_TABLE_NOT_LOCKED) operator(=) integer(1100) - constant(ER_BLOB_CANT_HAVE_DEFAULT) operator(=) integer(1101) - constant(ER_WRONG_DB_NAME) operator(=) integer(1102) - constant(ER_WRONG_TABLE_NAME) operator(=) integer(1103) - constant(ER_TOO_BIG_SELECT) operator(=) integer(1104) - constant(ER_UNKNOWN_ERROR) operator(=) integer(1105) - constant(ER_UNKNOWN_PROCEDURE) operator(=) integer(1106) - constant(ER_WRONG_PARAMCOUNT_TO_PROCEDURE) operator(=) integer(1107) - constant(ER_WRONG_PARAMETERS_TO_PROCEDURE) operator(=) integer(1108) - constant(ER_UNKNOWN_TABLE) operator(=) integer(1109) - constant(ER_FIELD_SPECIFIED_TWICE) operator(=) integer(1110) - constant(ER_INVALID_GROUP_FUNC_USE) operator(=) integer(1111) - constant(ER_UNSUPPORTED_EXTENSION) operator(=) integer(1112) - constant(ER_TABLE_MUST_HAVE_COLUMNS) operator(=) integer(1113) - constant(ER_RECORD_FILE_FULL) operator(=) integer(1114) - constant(ER_UNKNOWN_CHARACTER_SET) operator(=) integer(1115) - constant(ER_TOO_MANY_TABLES) operator(=) integer(1116) - constant(ER_TOO_MANY_FIELDS) operator(=) integer(1117) - constant(ER_TOO_BIG_ROWSIZE) operator(=) integer(1118) - constant(ER_STACK_OVERRUN) operator(=) integer(1119) - constant(ER_WRONG_OUTER_JOIN) operator(=) integer(1120) - constant(ER_NULL_COLUMN_IN_INDEX) operator(=) integer(1121) - constant(ER_CANT_FIND_UDF) operator(=) integer(1122) - constant(ER_CANT_INITIALIZE_UDF) operator(=) integer(1123) - constant(ER_UDF_NO_PATHS) operator(=) integer(1124) - constant(ER_UDF_EXISTS) operator(=) integer(1125) - constant(ER_CANT_OPEN_LIBRARY) operator(=) integer(1126) - constant(ER_CANT_FIND_DL_ENTRY) operator(=) integer(1127) - constant(ER_FUNCTION_NOT_DEFINED) operator(=) integer(1128) - constant(ER_HOST_IS_BLOCKED) operator(=) integer(1129) - constant(ER_HOST_NOT_PRIVILEGED) operator(=) integer(1130) - constant(ER_PASSWORD_ANONYMOUS_USER) operator(=) integer(1131) - constant(ER_PASSWORD_NOT_ALLOWED) operator(=) integer(1132) - constant(ER_PASSWORD_NO_MATCH) operator(=) integer(1133) - constant(ER_UPDATE_INFO) operator(=) integer(1134) - constant(ER_CANT_CREATE_THREAD) operator(=) integer(1135) - constant(ER_WRONG_VALUE_COUNT_ON_ROW) operator(=) integer(1136) - constant(ER_CANT_REOPEN_TABLE) operator(=) integer(1137) - constant(ER_INVALID_USE_OF_NULL) operator(=) integer(1138) - constant(ER_REGEXP_ERROR) operator(=) integer(1139) - constant(ER_MIX_OF_GROUP_FUNC_AND_FIELDS) operator(=) integer(1140) - constant(ER_NONEXISTING_GRANT) operator(=) integer(1141) - constant(ER_TABLEACCESS_DENIED_ERROR) operator(=) integer(1142) - constant(ER_COLUMNACCESS_DENIED_ERROR) operator(=) integer(1143) - constant(ER_ILLEGAL_GRANT_FOR_TABLE) operator(=) integer(1144) - constant(ER_GRANT_WRONG_HOST_OR_USER) operator(=) integer(1145) - constant(ER_NO_SUCH_TABLE) operator(=) integer(1146) - constant(ER_NONEXISTING_TABLE_GRANT) operator(=) integer(1147) - constant(ER_NOT_ALLOWED_COMMAND) operator(=) integer(1148) - constant(ER_SYNTAX_ERROR) operator(=) integer(1149) - constant(ER_DELAYED_CANT_CHANGE_LOCK) operator(=) integer(1150) - constant(ER_TOO_MANY_DELAYED_THREADS) operator(=) integer(1151) - constant(ER_ABORTING_CONNECTION) operator(=) integer(1152) - constant(ER_NET_PACKET_TOO_LARGE) operator(=) integer(1153) - constant(ER_NET_READ_ERROR_FROM_PIPE) operator(=) integer(1154) - constant(ER_NET_FCNTL_ERROR) operator(=) integer(1155) - constant(ER_NET_PACKETS_OUT_OF_ORDER) operator(=) integer(1156) - constant(ER_NET_UNCOMPRESS_ERROR) operator(=) integer(1157) - constant(ER_NET_READ_ERROR) operator(=) integer(1158) - constant(ER_NET_READ_INTERRUPTED) operator(=) integer(1159) - constant(ER_NET_ERROR_ON_WRITE) operator(=) integer(1160) - constant(ER_NET_WRITE_INTERRUPTED) operator(=) integer(1161) - constant(ER_TOO_LONG_STRING) operator(=) integer(1162) - constant(ER_TABLE_CANT_HANDLE_BLOB) operator(=) integer(1163) - constant(ER_TABLE_CANT_HANDLE_AUTO_INCREMENT) operator(=) integer(1164) - constant(ER_DELAYED_INSERT_TABLE_LOCKED) operator(=) integer(1165) - constant(ER_WRONG_COLUMN_NAME) operator(=) integer(1166) - constant(ER_WRONG_KEY_COLUMN) operator(=) integer(1167) - constant(ER_WRONG_MRG_TABLE) operator(=) integer(1168) - constant(ER_DUP_UNIQUE) operator(=) integer(1169) - constant(ER_BLOB_KEY_WITHOUT_LENGTH) operator(=) integer(1170) - constant(ER_PRIMARY_CANT_HAVE_NULL) operator(=) integer(1171) - constant(ER_TOO_MANY_ROWS) operator(=) integer(1172) - constant(ER_REQUIRES_PRIMARY_KEY) operator(=) integer(1173) - constant(ER_NO_RAID_COMPILED) operator(=) integer(1174) - constant(ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE) operator(=) integer(1175) - constant(ER_KEY_DOES_NOT_EXITS) operator(=) integer(1176) - constant(ER_CHECK_NO_SUCH_TABLE) operator(=) integer(1177) - constant(ER_CHECK_NOT_IMPLEMENTED) operator(=) integer(1178) - constant(ER_CANT_DO_THIS_DURING_AN_TRANSACTION) operator(=) integer(1179) - constant(ER_ERROR_DURING_COMMIT) operator(=) integer(1180) - constant(ER_ERROR_DURING_ROLLBACK) operator(=) integer(1181) - constant(ER_ERROR_DURING_FLUSH_LOGS) operator(=) integer(1182) - constant(ER_ERROR_DURING_CHECKPOINT) operator(=) integer(1183) - constant(ER_NEW_ABORTING_CONNECTION) operator(=) integer(1184) - constant(ER_DUMP_NOT_IMPLEMENTED) operator(=) integer(1185) - constant(ER_FLUSH_MASTER_BINLOG_CLOSED) operator(=) integer(1186) - constant(ER_INDEX_REBUILD) operator(=) integer(1187) - constant(ER_MASTER) operator(=) integer(1188) - constant(ER_MASTER_NET_READ) operator(=) integer(1189) - constant(ER_MASTER_NET_WRITE) operator(=) integer(1190) - constant(ER_FT_MATCHING_KEY_NOT_FOUND) operator(=) integer(1191) - constant(ER_LOCK_OR_ACTIVE_TRANSACTION) operator(=) integer(1192) - constant(ER_UNKNOWN_SYSTEM_VARIABLE) operator(=) integer(1193) - constant(ER_CRASHED_ON_USAGE) operator(=) integer(1194) - constant(ER_CRASHED_ON_REPAIR) operator(=) integer(1195) - constant(ER_WARNING_NOT_COMPLETE_ROLLBACK) operator(=) integer(1196) - constant(ER_TRANS_CACHE_FULL) operator(=) integer(1197) - constant(ER_SLAVE_MUST_STOP) operator(=) integer(1198) - constant(ER_SLAVE_NOT_RUNNING) operator(=) integer(1199) - constant(ER_BAD_SLAVE) operator(=) integer(1200) - constant(ER_MASTER_INFO) operator(=) integer(1201) - constant(ER_SLAVE_THREAD) operator(=) integer(1202) - constant(ER_TOO_MANY_USER_CONNECTIONS) operator(=) integer(1203) - constant(ER_SET_CONSTANTS_ONLY) operator(=) integer(1204) - constant(ER_LOCK_WAIT_TIMEOUT) operator(=) integer(1205) - constant(ER_LOCK_TABLE_FULL) operator(=) integer(1206) - constant(ER_READ_ONLY_TRANSACTION) operator(=) integer(1207) - constant(ER_DROP_DB_WITH_READ_LOCK) operator(=) integer(1208) - constant(ER_CREATE_DB_WITH_READ_LOCK) operator(=) integer(1209) - constant(ER_WRONG_ARGUMENTS) operator(=) integer(1210) - constant(ER_NO_PERMISSION_TO_CREATE_USER) operator(=) integer(1211) - constant(ER_UNION_TABLES_IN_DIFFERENT_DIR) operator(=) integer(1212) - constant(ER_LOCK_DEADLOCK) operator(=) integer(1213) - constant(ER_TABLE_CANT_HANDLE_FULLTEXT) operator(=) integer(1214) - constant(ER_CANNOT_ADD_FOREIGN) operator(=) integer(1215) - constant(ER_NO_REFERENCED_ROW) operator(=) integer(1216) - constant(ER_ROW_IS_REFERENCED) operator(=) integer(1217) - constant(ER_CONNECT_TO_MASTER) operator(=) integer(1218) - constant(ER_QUERY_ON_MASTER) operator(=) integer(1219) - constant(ER_ERROR_WHEN_EXECUTING_COMMAND) operator(=) integer(1220) - constant(ER_WRONG_USAGE) operator(=) integer(1221) - constant(ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT) operator(=) integer(1222) - constant(ER_CANT_UPDATE_WITH_READLOCK) operator(=) integer(1223) - constant(ER_MIXING_NOT_ALLOWED) operator(=) integer(1224) - constant(ER_DUP_ARGUMENT) operator(=) integer(1225) - constant(ER_USER_LIMIT_REACHED) operator(=) integer(1226) - constant(ER_SPECIFIC_ACCESS_DENIED_ERROR) operator(=) integer(1227) - constant(ER_LOCAL_VARIABLE) operator(=) integer(1228) - constant(ER_GLOBAL_VARIABLE) operator(=) integer(1229) - constant(ER_NO_DEFAULT) operator(=) integer(1230) - constant(ER_WRONG_VALUE_FOR_VAR) operator(=) integer(1231) - constant(ER_WRONG_TYPE_FOR_VAR) operator(=) integer(1232) - constant(ER_VAR_CANT_BE_READ) operator(=) integer(1233) - constant(ER_CANT_USE_OPTION_HERE) operator(=) integer(1234) - constant(ER_NOT_SUPPORTED_YET) operator(=) integer(1235) - constant(ER_MASTER_FATAL_ERROR_READING_BINLOG) operator(=) integer(1236) - constant(ER_SLAVE_IGNORED_TABLE) operator(=) integer(1237) - constant(ER_ERROR_MESSAGES) operator(=) integer(238) - - comment(# Client Error) - constant(CR_MIN_ERROR) operator(=) integer(2000) - constant(CR_MAX_ERROR) operator(=) integer(2999) - constant(CR_UNKNOWN_ERROR) operator(=) integer(2000) - constant(CR_SOCKET_CREATE_ERROR) operator(=) integer(2001) - constant(CR_CONNECTION_ERROR) operator(=) integer(2002) - constant(CR_CONN_HOST_ERROR) operator(=) integer(2003) - constant(CR_IPSOCK_ERROR) operator(=) integer(2004) - constant(CR_UNKNOWN_HOST) operator(=) integer(2005) - constant(CR_SERVER_GONE_ERROR) operator(=) integer(2006) - constant(CR_VERSION_ERROR) operator(=) integer(2007) - constant(CR_OUT_OF_MEMORY) operator(=) integer(2008) - constant(CR_WRONG_HOST_INFO) operator(=) integer(2009) - constant(CR_LOCALHOST_CONNECTION) operator(=) integer(2010) - constant(CR_TCP_CONNECTION) operator(=) integer(2011) - constant(CR_SERVER_HANDSHAKE_ERR) operator(=) integer(2012) - constant(CR_SERVER_LOST) operator(=) integer(2013) - constant(CR_COMMANDS_OUT_OF_SYNC) operator(=) integer(2014) - constant(CR_NAMEDPIPE_CONNECTION) operator(=) integer(2015) - constant(CR_NAMEDPIPEWAIT_ERROR) operator(=) integer(2016) - constant(CR_NAMEDPIPEOPEN_ERROR) operator(=) integer(2017) - constant(CR_NAMEDPIPESETSTATE_ERROR) operator(=) integer(2018) - constant(CR_CANT_READ_CHARSET) operator(=) integer(2019) - constant(CR_NET_PACKET_TOO_LARGE) operator(=) integer(2020) - constant(CR_EMBEDDED_CONNECTION) operator(=) integer(2021) - constant(CR_PROBE_SLAVE_STATUS) operator(=) integer(2022) - constant(CR_PROBE_SLAVE_HOSTS) operator(=) integer(2023) - constant(CR_PROBE_SLAVE_CONNECT) operator(=) integer(2024) - constant(CR_PROBE_MASTER_CONNECT) operator(=) integer(2025) - constant(CR_SSL_CONNECTION_ERROR) operator(=) integer(2026) - constant(CR_MALFORMED_PACKET) operator(=) integer(2027) - - constant(CLIENT_ERRORS) operator(=) operator([) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - stringoperator(,) - string - operator(]) - - reserved(def) method(initialize)operator(()ident(errno)operator(,) ident(error)operator(\)) - instance_variable(@errno) operator(=) ident(errno) - instance_variable(@error) operator(=) ident(error) - reserved(super) ident(error) - reserved(end) - ident(attr_reader) symbol(:errno)operator(,) symbol(:error) - - reserved(def) constant(Error)operator(::)method(err)operator(()ident(errno)operator(\)) - constant(CLIENT_ERRORS)operator([)ident(errno) operator(-) constant(Error)operator(::)constant(CR_MIN_ERROR)operator(]) - reserved(end) - reserved(end) - - reserved(class) class(Net) - reserved(def) method(initialize)operator(()ident(sock)operator(\)) - instance_variable(@sock) operator(=) ident(sock) - instance_variable(@pkt_nr) operator(=) integer(0) - reserved(end) - - reserved(def) method(clear)operator(()operator(\)) - instance_variable(@pkt_nr) operator(=) integer(0) - reserved(end) - - reserved(def) method(read)operator(()operator(\)) - ident(buf) operator(=) operator([)operator(]) - ident(len) operator(=) pre_constant(nil) - instance_variable(@sock)operator(.)ident(sync) operator(=) pre_constant(false) - reserved(while) ident(len) operator(==) pre_constant(nil) reserved(or) ident(len) operator(==) constant(MAX_PACKET_LENGTH) reserved(do) - ident(a) operator(=) instance_variable(@sock)operator(.)ident(read)operator(()integer(4)operator(\)) - ident(len) operator(=) ident(a)operator([)integer(0)operator(])operator(+)ident(a)operator([)integer(1)operator(])operator(*)integer(256)operator(+)ident(a)operator([)integer(2)operator(])operator(*)integer(256)operator(*)integer(256) - ident(pkt_nr) operator(=) ident(a)operator([)integer(3)operator(]) - reserved(if) instance_variable(@pkt_nr) operator(!=) ident(pkt_nr) reserved(then) - ident(raise) stringcontent(<>)inlinedelimiter(")> - reserved(end) - instance_variable(@pkt_nr) operator(=) instance_variable(@pkt_nr) operator(+) integer(1) operator(&) integer(0xff) - ident(buf) operator(<<) instance_variable(@sock)operator(.)ident(read)operator(()ident(len)operator(\)) - reserved(end) - instance_variable(@sock)operator(.)ident(sync) operator(=) pre_constant(true) - ident(buf)operator(.)ident(join) - reserved(rescue) - ident(errno) operator(=) constant(Error)operator(::)constant(CR_SERVER_LOST) - ident(raise) constant(Error)operator(::)ident(new)operator(()ident(errno)operator(,) constant(Error)operator(::)ident(err)operator(()ident(errno)operator(\))operator(\)) - reserved(end) - - reserved(def) method(write)operator(()ident(data)operator(\)) - reserved(if) ident(data)operator(.)ident(is_a?) constant(Array) reserved(then) - ident(data) operator(=) ident(data)operator(.)ident(join) - reserved(end) - instance_variable(@sock)operator(.)ident(sync) operator(=) pre_constant(false) - ident(ptr) operator(=) integer(0) - reserved(while) ident(data)operator(.)ident(length) operator(>)operator(=) constant(MAX_PACKET_LENGTH) reserved(do) - instance_variable(@sock)operator(.)ident(write) constant(Net)operator(::)ident(int3str)operator(()constant(MAX_PACKET_LENGTH)operator(\))operator(+)instance_variable(@pkt_nr)operator(.)ident(chr)operator(+)ident(data)operator([)ident(ptr)operator(,) constant(MAX_PACKET_LENGTH)operator(]) - instance_variable(@pkt_nr) operator(=) instance_variable(@pkt_nr) operator(+) integer(1) operator(&) integer(0xff) - ident(ptr) operator(+=) constant(MAX_PACKET_LENGTH) - reserved(end) - instance_variable(@sock)operator(.)ident(write) constant(Net)operator(::)ident(int3str)operator(()ident(data)operator(.)ident(length)operator(-)ident(ptr)operator(\))operator(+)instance_variable(@pkt_nr)operator(.)ident(chr)operator(+)ident(data)operator([)ident(ptr) operator(..) integer(-1)operator(]) - instance_variable(@pkt_nr) operator(=) instance_variable(@pkt_nr) operator(+) integer(1) operator(&) integer(0xff) - instance_variable(@sock)operator(.)ident(sync) operator(=) pre_constant(true) - instance_variable(@sock)operator(.)ident(flush) - reserved(rescue) - ident(errno) operator(=) constant(Error)operator(::)constant(CR_SERVER_LOST) - ident(raise) constant(Error)operator(::)ident(new)operator(()ident(errno)operator(,) constant(Error)operator(::)ident(err)operator(()ident(errno)operator(\))operator(\)) - reserved(end) - - reserved(def) method(close)operator(()operator(\)) - instance_variable(@sock)operator(.)ident(close) - reserved(end) - - reserved(def) constant(Net)operator(::)method(int2str)operator(()ident(n)operator(\)) - operator([)ident(n)operator(])operator(.)ident(pack)operator(()stringoperator(\)) - reserved(end) - - reserved(def) constant(Net)operator(::)method(int3str)operator(()ident(n)operator(\)) - operator([)ident(n)operator(%)integer(256)operator(,) ident(n)operator(>>)integer(8)operator(])operator(.)ident(pack)operator(()stringoperator(\)) - reserved(end) - - reserved(def) constant(Net)operator(::)method(int4str)operator(()ident(n)operator(\)) - operator([)ident(n)operator(])operator(.)ident(pack)operator(()stringoperator(\)) - reserved(end) - - reserved(end) - - reserved(class) class(Random) - reserved(def) method(initialize)operator(()ident(seed1)operator(,) ident(seed2)operator(\)) - instance_variable(@max_value) operator(=) integer(0x3FFFFFFF) - instance_variable(@seed1) operator(=) ident(seed1) operator(%) instance_variable(@max_value) - instance_variable(@seed2) operator(=) ident(seed2) operator(%) instance_variable(@max_value) - reserved(end) - - reserved(def) method(rnd)operator(()operator(\)) - instance_variable(@seed1) operator(=) operator(()instance_variable(@seed1)operator(*)integer(3)operator(+)instance_variable(@seed2)operator(\)) operator(%) instance_variable(@max_value) - instance_variable(@seed2) operator(=) operator(()instance_variable(@seed1)operator(+)instance_variable(@seed2)operator(+)integer(33)operator(\)) operator(%) instance_variable(@max_value) - instance_variable(@seed1)operator(.)ident(to_f) operator(/) instance_variable(@max_value) - reserved(end) - reserved(end) - -reserved(end) - -reserved(class) operator(<<) class(Mysql) - reserved(def) method(init)operator(()operator(\)) - constant(Mysql)operator(::)ident(new) symbol(:INIT) - reserved(end) - - reserved(def) method(real_connect)operator(()operator(*)ident(args)operator(\)) - constant(Mysql)operator(::)ident(new)operator(()operator(*)ident(args)operator(\)) - reserved(end) - reserved(alias) symbol(:connect) symbol(:real_connect) - - reserved(def) method(finalizer)operator(()ident(net)operator(\)) - ident(proc) operator({) - ident(net)operator(.)ident(clear) - ident(net)operator(.)ident(write) constant(Mysql)operator(::)constant(COM_QUIT)operator(.)ident(chr) - operator(}) - reserved(end) - - reserved(def) method(escape_string)operator(()ident(str)operator(\)) - ident(str)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) - reserved(case) global_variable($1) - reserved(when) string reserved(then) string - reserved(when) string reserved(then) string - reserved(when) string reserved(then) string - reserved(when) string reserved(then) string - reserved(else) stringoperator(+)global_variable($1) - reserved(end) - reserved(end) - reserved(end) - reserved(alias) symbol(:quote) symbol(:escape_string) - - reserved(def) method(get_client_info)operator(()operator(\)) - constant(Mysql)operator(::)constant(VERSION) - reserved(end) - reserved(alias) symbol(:client_info) symbol(:get_client_info) - - reserved(def) method(debug)operator(()ident(str)operator(\)) - ident(raise) string - reserved(end) -reserved(end) - -comment(#) -comment(# for compatibility) -comment(#) - -constant(MysqlRes) operator(=) constant(Mysql)operator(::)constant(Result) -constant(MysqlField) operator(=) constant(Mysql)operator(::)constant(Field) -constant(MysqlError) operator(=) constant(Mysql)operator(::)constant(Error) -comment(# :title: Transaction::Simple -- Active Object Transaction Support for Ruby) -comment(# :main: Transaction::Simple) -comment(#) -comment(# == Licence) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining a) -comment(# copy of this software and associated documentation files (the "Software"\),) -comment(# to deal in the Software without restriction, including without limitation) -comment(# the rights to use, copy, modify, merge, publish, distribute, sublicense,) -comment(# and/or sell copies of the Software, and to permit persons to whom the) -comment(# Software is furnished to do so, subject to the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be included in) -comment(# all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR) -comment(# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,) -comment(# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL) -comment(# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER) -comment(# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING) -comment(# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER) -comment(# DEALINGS IN THE SOFTWARE.) -comment(#--) -comment(# Transaction::Simple) -comment(# Simple object transaction support for Ruby) -comment(# Version 1.3.0) -comment(#) -comment(# Copyright (c\) 2003 - 2005 Austin Ziegler) -comment(#) -comment(# $Id: simple.rb,v 1.5 2005/05/05 16:16:49 austin Exp $) -comment(#++) - comment(# The "Transaction" namespace can be used for additional transaction) - comment(# support objects and modules.) -reserved(module) class(Transaction) - comment(# A standard exception for transaction errors.) - reserved(class) class(TransactionError) operator(<) constant(StandardError)operator(;) reserved(end) - comment(# The TransactionAborted exception is used to indicate when a) - comment(# transaction has been aborted in the block form.) - reserved(class) class(TransactionAborted) operator(<) constant(Exception)operator(;) reserved(end) - comment(# The TransactionCommitted exception is used to indicate when a) - comment(# transaction has been committed in the block form.) - reserved(class) class(TransactionCommitted) operator(<) constant(Exception)operator(;) reserved(end) - - ident(te) operator(=) string - - constant(Messages) operator(=) operator({) - symbol(:bad_debug_object) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:unique_names) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:no_transaction_open) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:cannot_rewind_no_transaction) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:cannot_rewind_named_transaction) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:cannot_rewind_transaction_before_block) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:cannot_abort_no_transaction) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:cannot_abort_transaction_before_block) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:cannot_abort_named_transaction) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:cannot_commit_no_transaction) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:cannot_commit_transaction_before_block) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:cannot_commit_named_transaction) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:cannot_start_empty_block_transaction) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - symbol(:cannot_obtain_transaction_lock) operator(=)operator(>) - ident(te) operator(%) stringoperator(,) - operator(}) - - comment(# = Transaction::Simple for Ruby) - comment(# Simple object transaction support for Ruby) - comment(#) - comment(# == Introduction) - comment(# Transaction::Simple provides a generic way to add active transaction) - comment(# support to objects. The transaction methods added by this module will) - comment(# work with most objects, excluding those that cannot be) - comment(# Marshaled (bindings, procedure objects, IO instances, or) - comment(# singleton objects\).) - comment(#) - comment(# The transactions supported by Transaction::Simple are not backed) - comment(# transactions; they are not associated with any sort of data store.) - comment(# They are "live" transactions occurring in memory and in the object) - comment(# itself. This is to allow "test" changes to be made to an object) - comment(# before making the changes permanent.) - comment(#) - comment(# Transaction::Simple can handle an "infinite" number of transaction) - comment(# levels (limited only by memory\). If I open two transactions, commit) - comment(# the second, but abort the first, the object will revert to the) - comment(# original version.) - comment(# ) - comment(# Transaction::Simple supports "named" transactions, so that multiple) - comment(# levels of transactions can be committed, aborted, or rewound by) - comment(# referring to the appropriate name of the transaction. Names may be any) - comment(# object *except* +nil+. As with Hash keys, String names will be) - comment(# duplicated and frozen before using.) - comment(#) - comment(# Copyright:: Copyright © 2003 - 2005 by Austin Ziegler) - comment(# Version:: 1.3.0) - comment(# Licence:: MIT-Style) - comment(#) - comment(# Thanks to David Black for help with the initial concept that led to) - comment(# this library.) - comment(#) - comment(# == Usage) - comment(# include 'transaction/simple') - comment(#) - comment(# v = "Hello, you." # -> "Hello, you.") - comment(# v.extend(Transaction::Simple\) # -> "Hello, you.") - comment(#) - comment(# v.start_transaction # -> ... (a Marshal string\)) - comment(# v.transaction_open? # -> true) - comment(# v.gsub!(/you/, "world"\) # -> "Hello, world.") - comment(#) - comment(# v.rewind_transaction # -> "Hello, you.") - comment(# v.transaction_open? # -> true) - comment(#) - comment(# v.gsub!(/you/, "HAL"\) # -> "Hello, HAL.") - comment(# v.abort_transaction # -> "Hello, you.") - comment(# v.transaction_open? # -> false) - comment(#) - comment(# v.start_transaction # -> ... (a Marshal string\)) - comment(# v.start_transaction # -> ... (a Marshal string\)) - comment(#) - comment(# v.transaction_open? # -> true) - comment(# v.gsub!(/you/, "HAL"\) # -> "Hello, HAL.") - comment(#) - comment(# v.commit_transaction # -> "Hello, HAL.") - comment(# v.transaction_open? # -> true) - comment(# v.abort_transaction # -> "Hello, you.") - comment(# v.transaction_open? # -> false) - comment(#) - comment(# == Named Transaction Usage) - comment(# v = "Hello, you." # -> "Hello, you.") - comment(# v.extend(Transaction::Simple\) # -> "Hello, you.") - comment(# ) - comment(# v.start_transaction(:first\) # -> ... (a Marshal string\)) - comment(# v.transaction_open? # -> true) - comment(# v.transaction_open?(:first\) # -> true) - comment(# v.transaction_open?(:second\) # -> false) - comment(# v.gsub!(/you/, "world"\) # -> "Hello, world.") - comment(# ) - comment(# v.start_transaction(:second\) # -> ... (a Marshal string\)) - comment(# v.gsub!(/world/, "HAL"\) # -> "Hello, HAL.") - comment(# v.rewind_transaction(:first\) # -> "Hello, you.") - comment(# v.transaction_open? # -> true) - comment(# v.transaction_open?(:first\) # -> true) - comment(# v.transaction_open?(:second\) # -> false) - comment(# ) - comment(# v.gsub!(/you/, "world"\) # -> "Hello, world.") - comment(# v.start_transaction(:second\) # -> ... (a Marshal string\)) - comment(# v.gsub!(/world/, "HAL"\) # -> "Hello, HAL.") - comment(# v.transaction_name # -> :second) - comment(# v.abort_transaction(:first\) # -> "Hello, you.") - comment(# v.transaction_open? # -> false) - comment(# ) - comment(# v.start_transaction(:first\) # -> ... (a Marshal string\)) - comment(# v.gsub!(/you/, "world"\) # -> "Hello, world.") - comment(# v.start_transaction(:second\) # -> ... (a Marshal string\)) - comment(# v.gsub!(/world/, "HAL"\) # -> "Hello, HAL.") - comment(# ) - comment(# v.commit_transaction(:first\) # -> "Hello, HAL.") - comment(# v.transaction_open? # -> false) - comment(#) - comment(# == Block Usage) - comment(# v = "Hello, you." # -> "Hello, you.") - comment(# Transaction::Simple.start(v\) do |tv|) - comment(# # v has been extended with Transaction::Simple and an unnamed) - comment(# # transaction has been started.) - comment(# tv.transaction_open? # -> true) - comment(# tv.gsub!(/you/, "world"\) # -> "Hello, world.") - comment(#) - comment(# tv.rewind_transaction # -> "Hello, you.") - comment(# tv.transaction_open? # -> true) - comment(#) - comment(# tv.gsub!(/you/, "HAL"\) # -> "Hello, HAL.") - comment(# # The following breaks out of the transaction block after) - comment(# # aborting the transaction.) - comment(# tv.abort_transaction # -> "Hello, you.") - comment(# end) - comment(# # v still has Transaction::Simple applied from here on out.) - comment(# v.transaction_open? # -> false) - comment(#) - comment(# Transaction::Simple.start(v\) do |tv|) - comment(# tv.start_transaction # -> ... (a Marshal string\)) - comment(#) - comment(# tv.transaction_open? # -> true) - comment(# tv.gsub!(/you/, "HAL"\) # -> "Hello, HAL.") - comment(#) - comment(# # If #commit_transaction were called without having started a) - comment(# # second transaction, then it would break out of the transaction) - comment(# # block after committing the transaction.) - comment(# tv.commit_transaction # -> "Hello, HAL.") - comment(# tv.transaction_open? # -> true) - comment(# tv.abort_transaction # -> "Hello, you.") - comment(# end) - comment(# v.transaction_open? # -> false) - comment(#) - comment(# == Named Transaction Usage) - comment(# v = "Hello, you." # -> "Hello, you.") - comment(# v.extend(Transaction::Simple\) # -> "Hello, you.") - comment(# ) - comment(# v.start_transaction(:first\) # -> ... (a Marshal string\)) - comment(# v.transaction_open? # -> true) - comment(# v.transaction_open?(:first\) # -> true) - comment(# v.transaction_open?(:second\) # -> false) - comment(# v.gsub!(/you/, "world"\) # -> "Hello, world.") - comment(# ) - comment(# v.start_transaction(:second\) # -> ... (a Marshal string\)) - comment(# v.gsub!(/world/, "HAL"\) # -> "Hello, HAL.") - comment(# v.rewind_transaction(:first\) # -> "Hello, you.") - comment(# v.transaction_open? # -> true) - comment(# v.transaction_open?(:first\) # -> true) - comment(# v.transaction_open?(:second\) # -> false) - comment(# ) - comment(# v.gsub!(/you/, "world"\) # -> "Hello, world.") - comment(# v.start_transaction(:second\) # -> ... (a Marshal string\)) - comment(# v.gsub!(/world/, "HAL"\) # -> "Hello, HAL.") - comment(# v.transaction_name # -> :second) - comment(# v.abort_transaction(:first\) # -> "Hello, you.") - comment(# v.transaction_open? # -> false) - comment(# ) - comment(# v.start_transaction(:first\) # -> ... (a Marshal string\)) - comment(# v.gsub!(/you/, "world"\) # -> "Hello, world.") - comment(# v.start_transaction(:second\) # -> ... (a Marshal string\)) - comment(# v.gsub!(/world/, "HAL"\) # -> "Hello, HAL.") - comment(# ) - comment(# v.commit_transaction(:first\) # -> "Hello, HAL.") - comment(# v.transaction_open? # -> false) - comment(#) - comment(# == Thread Safety) - comment(# Threadsafe version of Transaction::Simple and) - comment(# Transaction::Simple::Group exist; these are loaded from) - comment(# 'transaction/simple/threadsafe' and) - comment(# 'transaction/simple/threadsafe/group', respectively, and are) - comment(# represented in Ruby code as Transaction::Simple::ThreadSafe and) - comment(# Transaction::Simple::ThreadSafe::Group, respectively.) - comment(#) - comment(# == Contraindications) - comment(# While Transaction::Simple is very useful, it has some severe) - comment(# limitations that must be understood. Transaction::Simple:) - comment(#) - comment(# * uses Marshal. Thus, any object which cannot be Marshaled) - comment(# cannot use Transaction::Simple. In my experience, this affects) - comment(# singleton objects more often than any other object. It may be that) - comment(# Ruby 2.0 will solve this problem.) - comment(# * does not manage resources. Resources external to the object and its) - comment(# instance variables are not managed at all. However, all instance) - comment(# variables and objects "belonging" to those instance variables are) - comment(# managed. If there are object reference counts to be handled,) - comment(# Transaction::Simple will probably cause problems.) - comment(# * is not inherently thread-safe. In the ACID ("atomic, consistent,) - comment(# isolated, durable"\) test, Transaction::Simple provides CD, but it is) - comment(# up to the user of Transaction::Simple to provide isolation and) - comment(# atomicity. Transactions should be considered "critical sections" in) - comment(# multi-threaded applications. If thread safety and atomicity is) - comment(# absolutely required, use Transaction::Simple::ThreadSafe, which uses) - comment(# a Mutex object to synchronize the accesses on the object during the) - comment(# transaction operations.) - comment(# * does not necessarily maintain Object#__id__ values on rewind or) - comment(# abort. This may change for future versions that will be Ruby 1.8 or) - comment(# better *only*. Certain objects that support #replace will maintain) - comment(# Object#__id__.) - comment(# * Can be a memory hog if you use many levels of transactions on many) - comment(# objects.) - comment(#) - reserved(module) class(Simple) - constant(TRANSACTION_SIMPLE_VERSION) operator(=) string - - comment(# Sets the Transaction::Simple debug object. It must respond to #<<.) - comment(# Sets the transaction debug object. Debugging will be performed) - comment(# automatically if there's a debug object. The generic transaction) - comment(# error class.) - reserved(def) pre_constant(self)operator(.)method(debug_io=)operator(()ident(io)operator(\)) - reserved(if) ident(io)operator(.)ident(nil?) - instance_variable(@tdi) operator(=) pre_constant(nil) - instance_variable(@debugging) operator(=) pre_constant(false) - reserved(else) - reserved(unless) ident(io)operator(.)ident(respond_to?)operator(()symbol(:<<)operator(\)) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:bad_debug_object)operator(]) - reserved(end) - instance_variable(@tdi) operator(=) ident(io) - instance_variable(@debugging) operator(=) pre_constant(true) - reserved(end) - reserved(end) - - comment(# Returns +true+ if we are debugging.) - reserved(def) pre_constant(self)operator(.)method(debugging?) - instance_variable(@debugging) - reserved(end) - - comment(# Returns the Transaction::Simple debug object. It must respond to) - comment(# #<<.) - reserved(def) pre_constant(self)operator(.)method(debug_io) - instance_variable(@tdi) operator(||=) string - instance_variable(@tdi) - reserved(end) - - comment(# If +name+ is +nil+ (default\), then returns +true+ if there is) - comment(# currently a transaction open.) - comment(#) - comment(# If +name+ is specified, then returns +true+ if there is currently a) - comment(# transaction that responds to +name+ open.) - reserved(def) method(transaction_open?)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) - reserved(if) ident(name)operator(.)ident(nil?) - reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - constant(Transaction)operator(::)constant(Simple)operator(.)ident(debug_io) operator(<<) string operator(<<) - string operator(:) stringinline_delimiter(})>content(])char(\\n)delimiter(")> - reserved(end) - reserved(return) operator(()reserved(not) instance_variable(@__transaction_checkpoint__)operator(.)ident(nil?)operator(\)) - reserved(else) - reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - constant(Transaction)operator(::)constant(Simple)operator(.)ident(debug_io) operator(<<) stringcontent(\) )delimiter(")> operator(<<) - string operator(:) stringinline_delimiter(})>content(])char(\\n)delimiter(")> - reserved(end) - reserved(return) operator(()operator(()reserved(not) instance_variable(@__transaction_checkpoint__)operator(.)ident(nil?)operator(\)) reserved(and) instance_variable(@__transaction_names__)operator(.)ident(include?)operator(()ident(name)operator(\))operator(\)) - reserved(end) - reserved(end) - - comment(# Returns the current name of the transaction. Transactions not) - comment(# explicitly named are named +nil+.) - reserved(def) method(transaction_name) - reserved(if) instance_variable(@__transaction_checkpoint__)operator(.)ident(nil?) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:no_transaction_open)operator(]) - reserved(end) - reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - constant(Transaction)operator(::)constant(Simple)operator(.)ident(debug_io) operator(<<) string operator(*) instance_variable(@__transaction_level__)inline_delimiter(})>content( )delimiter(")> operator(<<) - stringchar(\\n)delimiter(")> - reserved(end) - reserved(if) instance_variable(@__transaction_names__)operator([)integer(-1)operator(])operator(.)ident(kind_of?)operator(()constant(String)operator(\)) - instance_variable(@__transaction_names__)operator([)integer(-1)operator(])operator(.)ident(dup) - reserved(else) - instance_variable(@__transaction_names__)operator([)integer(-1)operator(]) - reserved(end) - reserved(end) - - comment(# Starts a transaction. Stores the current object state. If a) - comment(# transaction name is specified, the transaction will be named.) - comment(# Transaction names must be unique. Transaction names of +nil+ will be) - comment(# treated as unnamed transactions.) - reserved(def) method(start_transaction)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) - instance_variable(@__transaction_level__) operator(||=) integer(0) - instance_variable(@__transaction_names__) operator(||=) operator([)operator(]) - - reserved(if) ident(name)operator(.)ident(nil?) - instance_variable(@__transaction_names__) operator(<<) pre_constant(nil) - ident(ss) operator(=) string reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - reserved(else) - reserved(if) instance_variable(@__transaction_names__)operator(.)ident(include?)operator(()ident(name)operator(\)) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:unique_names)operator(]) - reserved(end) - ident(name) operator(=) ident(name)operator(.)ident(dup)operator(.)ident(freeze) reserved(if) ident(name)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) - instance_variable(@__transaction_names__) operator(<<) ident(name) - ident(ss) operator(=) stringcontent(\))delimiter(")> reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - reserved(end) - - instance_variable(@__transaction_level__) operator(+=) integer(1) - - reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - constant(Transaction)operator(::)constant(Simple)operator(.)ident(debug_io) operator(<<) string)delimiter(')> operator(*) instance_variable(@__transaction_level__)inline_delimiter(})>content( )delimiter(")> operator(<<) - stringchar(\\n)delimiter(")> - reserved(end) - - instance_variable(@__transaction_checkpoint__) operator(=) constant(Marshal)operator(.)ident(dump)operator(()pre_constant(self)operator(\)) - reserved(end) - - comment(# Rewinds the transaction. If +name+ is specified, then the) - comment(# intervening transactions will be aborted and the named transaction) - comment(# will be rewound. Otherwise, only the current transaction is rewound.) - reserved(def) method(rewind_transaction)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) - reserved(if) instance_variable(@__transaction_checkpoint__)operator(.)ident(nil?) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:cannot_rewind_no_transaction)operator(]) - reserved(end) - - comment(# Check to see if we are trying to rewind a transaction that is) - comment(# outside of the current transaction block.) - reserved(if) instance_variable(@__transaction_block__) reserved(and) ident(name) - ident(nix) operator(=) instance_variable(@__transaction_names__)operator(.)ident(index)operator(()ident(name)operator(\)) operator(+) integer(1) - reserved(if) ident(nix) operator(<) instance_variable(@__transaction_block__) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:cannot_rewind_transaction_before_block)operator(]) - reserved(end) - reserved(end) - - reserved(if) ident(name)operator(.)ident(nil?) - ident(__rewind_this_transaction) - ident(ss) operator(=) string reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - reserved(else) - reserved(unless) instance_variable(@__transaction_names__)operator(.)ident(include?)operator(()ident(name)operator(\)) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:cannot_rewind_named_transaction)operator(]) operator(%) ident(name)operator(.)ident(inspect) - reserved(end) - ident(ss) operator(=) stringcontent(\))delimiter(")> reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - - reserved(while) instance_variable(@__transaction_names__)operator([)integer(-1)operator(]) operator(!=) ident(name) - instance_variable(@__transaction_checkpoint__) operator(=) ident(__rewind_this_transaction) - reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - constant(Transaction)operator(::)constant(Simple)operator(.)ident(debug_io) operator(<<) string operator(*) instance_variable(@__transaction_level__)inline_delimiter(})>content( )delimiter(")> operator(<<) - stringchar(\\n)delimiter(")> - reserved(end) - instance_variable(@__transaction_level__) operator(-=) integer(1) - instance_variable(@__transaction_names__)operator(.)ident(pop) - reserved(end) - ident(__rewind_this_transaction) - reserved(end) - reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - constant(Transaction)operator(::)constant(Simple)operator(.)ident(debug_io) operator(<<) string operator(*) instance_variable(@__transaction_level__)inline_delimiter(})>content( )delimiter(")> operator(<<) - stringchar(\\n)delimiter(")> - reserved(end) - pre_constant(self) - reserved(end) - - comment(# Aborts the transaction. Resets the object state to what it was) - comment(# before the transaction was started and closes the transaction. If) - comment(# +name+ is specified, then the intervening transactions and the named) - comment(# transaction will be aborted. Otherwise, only the current transaction) - comment(# is aborted.) - comment(#) - comment(# If the current or named transaction has been started by a block) - comment(# (Transaction::Simple.start\), then the execution of the block will be) - comment(# halted with +break+ +self+.) - reserved(def) method(abort_transaction)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) - reserved(if) instance_variable(@__transaction_checkpoint__)operator(.)ident(nil?) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:cannot_abort_no_transaction)operator(]) - reserved(end) - - comment(# Check to see if we are trying to abort a transaction that is) - comment(# outside of the current transaction block. Otherwise, raise) - comment(# TransactionAborted if they are the same.) - reserved(if) instance_variable(@__transaction_block__) reserved(and) ident(name) - ident(nix) operator(=) instance_variable(@__transaction_names__)operator(.)ident(index)operator(()ident(name)operator(\)) operator(+) integer(1) - reserved(if) ident(nix) operator(<) instance_variable(@__transaction_block__) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:cannot_abort_transaction_before_block)operator(]) - reserved(end) - - ident(raise) constant(TransactionAborted) reserved(if) instance_variable(@__transaction_block__) operator(==) ident(nix) - reserved(end) - - ident(raise) constant(TransactionAborted) reserved(if) instance_variable(@__transaction_block__) operator(==) instance_variable(@__transaction_level__) - - reserved(if) ident(name)operator(.)ident(nil?) - ident(__abort_transaction)operator(()ident(name)operator(\)) - reserved(else) - reserved(unless) instance_variable(@__transaction_names__)operator(.)ident(include?)operator(()ident(name)operator(\)) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:cannot_abort_named_transaction)operator(]) operator(%) ident(name)operator(.)ident(inspect) - reserved(end) - ident(__abort_transaction)operator(()ident(name)operator(\)) reserved(while) instance_variable(@__transaction_names__)operator(.)ident(include?)operator(()ident(name)operator(\)) - reserved(end) - pre_constant(self) - reserved(end) - - comment(# If +name+ is +nil+ (default\), the current transaction level is) - comment(# closed out and the changes are committed.) - comment(#) - comment(# If +name+ is specified and +name+ is in the list of named) - comment(# transactions, then all transactions are closed and committed until) - comment(# the named transaction is reached.) - reserved(def) method(commit_transaction)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) - reserved(if) instance_variable(@__transaction_checkpoint__)operator(.)ident(nil?) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:cannot_commit_no_transaction)operator(]) - reserved(end) - instance_variable(@__transaction_block__) operator(||=) pre_constant(nil) - - comment(# Check to see if we are trying to commit a transaction that is) - comment(# outside of the current transaction block. Otherwise, raise) - comment(# TransactionCommitted if they are the same.) - reserved(if) instance_variable(@__transaction_block__) reserved(and) ident(name) - ident(nix) operator(=) instance_variable(@__transaction_names__)operator(.)ident(index)operator(()ident(name)operator(\)) operator(+) integer(1) - reserved(if) ident(nix) operator(<) instance_variable(@__transaction_block__) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:cannot_commit_transaction_before_block)operator(]) - reserved(end) - - ident(raise) constant(TransactionCommitted) reserved(if) instance_variable(@__transaction_block__) operator(==) ident(nix) - reserved(end) - - ident(raise) constant(TransactionCommitted) reserved(if) instance_variable(@__transaction_block__) operator(==) instance_variable(@__transaction_level__) - - reserved(if) ident(name)operator(.)ident(nil?) - ident(ss) operator(=) string reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - ident(__commit_transaction) - reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - constant(Transaction)operator(::)constant(Simple)operator(.)ident(debug_io) operator(<<) string operator(*) instance_variable(@__transaction_level__)inline_delimiter(})>content( )delimiter(")> operator(<<) - stringchar(\\n)delimiter(")> - reserved(end) - reserved(else) - reserved(unless) instance_variable(@__transaction_names__)operator(.)ident(include?)operator(()ident(name)operator(\)) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:cannot_commit_named_transaction)operator(]) operator(%) ident(name)operator(.)ident(inspect) - reserved(end) - ident(ss) operator(=) stringcontent(\))delimiter(")> reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - - reserved(while) instance_variable(@__transaction_names__)operator([)integer(-1)operator(]) operator(!=) ident(name) - reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - constant(Transaction)operator(::)constant(Simple)operator(.)ident(debug_io) operator(<<) string operator(*) instance_variable(@__transaction_level__)inline_delimiter(})>content( )delimiter(")> operator(<<) - stringchar(\\n)delimiter(")> - reserved(end) - ident(__commit_transaction) - reserved(end) - reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - constant(Transaction)operator(::)constant(Simple)operator(.)ident(debug_io) operator(<<) string operator(*) instance_variable(@__transaction_level__)inline_delimiter(})>content( )delimiter(")> operator(<<) - stringchar(\\n)delimiter(")> - reserved(end) - ident(__commit_transaction) - reserved(end) - - pre_constant(self) - reserved(end) - - comment(# Alternative method for calling the transaction methods. An optional) - comment(# name can be specified for named transaction support.) - comment(#) - comment(# #transaction(:start\):: #start_transaction) - comment(# #transaction(:rewind\):: #rewind_transaction) - comment(# #transaction(:abort\):: #abort_transaction) - comment(# #transaction(:commit\):: #commit_transaction) - comment(# #transaction(:name\):: #transaction_name) - comment(# #transaction:: #transaction_open?) - reserved(def) method(transaction)operator(()ident(action) operator(=) pre_constant(nil)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - reserved(case) ident(action) - reserved(when) symbol(:start) - ident(start_transaction)operator(()ident(name)operator(\)) - reserved(when) symbol(:rewind) - ident(rewind_transaction)operator(()ident(name)operator(\)) - reserved(when) symbol(:abort) - ident(abort_transaction)operator(()ident(name)operator(\)) - reserved(when) symbol(:commit) - ident(commit_transaction)operator(()ident(name)operator(\)) - reserved(when) symbol(:name) - ident(transaction_name) - reserved(when) pre_constant(nil) - ident(transaction_open?)operator(()ident(name)operator(\)) - reserved(end) - reserved(end) - - comment(# Allows specific variables to be excluded from transaction support.) - comment(# Must be done after extending the object but before starting the) - comment(# first transaction on the object.) - comment(#) - comment(# vv.transaction_exclusions << "@io") - reserved(def) method(transaction_exclusions) - instance_variable(@transaction_exclusions) operator(||=) operator([)operator(]) - reserved(end) - - reserved(class) operator(<<) class(self) - reserved(def) method(__common_start)operator(()ident(name)operator(,) ident(vars)operator(,) operator(&)ident(block)operator(\)) - reserved(if) ident(vars)operator(.)ident(empty?) - ident(raise) constant(TransactionError)operator(,) constant(Messages)operator([)symbol(:cannot_start_empty_block_transaction)operator(]) - reserved(end) - - reserved(if) ident(block) - reserved(begin) - ident(vlevel) operator(=) operator({)operator(}) - - ident(vars)operator(.)ident(each) reserved(do) operator(|)ident(vv)operator(|) - ident(vv)operator(.)ident(extend)operator(()constant(Transaction)operator(::)constant(Simple)operator(\)) - ident(vv)operator(.)ident(start_transaction)operator(()ident(name)operator(\)) - ident(vlevel)operator([)ident(vv)operator(.)ident(__id__)operator(]) operator(=) ident(vv)operator(.)ident(instance_variable_get)operator(()symbol(:@__transaction_level__)operator(\)) - ident(vv)operator(.)ident(instance_variable_set)operator(()symbol(:@__transaction_block__)operator(,) ident(vlevel)operator([)ident(vv)operator(.)ident(__id__)operator(])operator(\)) - reserved(end) - - reserved(yield)operator(()operator(*)ident(vars)operator(\)) - reserved(rescue) constant(TransactionAborted) - ident(vars)operator(.)ident(each) reserved(do) operator(|)ident(vv)operator(|) - reserved(if) ident(name)operator(.)ident(nil?) reserved(and) ident(vv)operator(.)ident(transaction_open?) - ident(loop) reserved(do) - ident(tlevel) operator(=) ident(vv)operator(.)ident(instance_variable_get)operator(()symbol(:@__transaction_level__)operator(\)) operator(||) integer(-1) - ident(vv)operator(.)ident(instance_variable_set)operator(()symbol(:@__transaction_block__)operator(,) integer(-1)operator(\)) - reserved(break) reserved(if) ident(tlevel) operator(<) ident(vlevel)operator([)ident(vv)operator(.)ident(__id__)operator(]) - ident(vv)operator(.)ident(abort_transaction) reserved(if) ident(vv)operator(.)ident(transaction_open?) - reserved(end) - reserved(elsif) ident(vv)operator(.)ident(transaction_open?)operator(()ident(name)operator(\)) - ident(vv)operator(.)ident(instance_variable_set)operator(()symbol(:@__transaction_block__)operator(,) integer(-1)operator(\)) - ident(vv)operator(.)ident(abort_transaction)operator(()ident(name)operator(\)) - reserved(end) - reserved(end) - reserved(rescue) constant(TransactionCommitted) - pre_constant(nil) - reserved(ensure) - ident(vars)operator(.)ident(each) reserved(do) operator(|)ident(vv)operator(|) - reserved(if) ident(name)operator(.)ident(nil?) reserved(and) ident(vv)operator(.)ident(transaction_open?) - ident(loop) reserved(do) - ident(tlevel) operator(=) ident(vv)operator(.)ident(instance_variable_get)operator(()symbol(:@__transaction_level__)operator(\)) operator(||) integer(-1) - reserved(break) reserved(if) ident(tlevel) operator(<) ident(vlevel)operator([)ident(vv)operator(.)ident(__id__)operator(]) - ident(vv)operator(.)ident(instance_variable_set)operator(()symbol(:@__transaction_block__)operator(,) integer(-1)operator(\)) - ident(vv)operator(.)ident(commit_transaction) reserved(if) ident(vv)operator(.)ident(transaction_open?) - reserved(end) - reserved(elsif) ident(vv)operator(.)ident(transaction_open?)operator(()ident(name)operator(\)) - ident(vv)operator(.)ident(instance_variable_set)operator(()symbol(:@__transaction_block__)operator(,) integer(-1)operator(\)) - ident(vv)operator(.)ident(commit_transaction)operator(()ident(name)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(else) - ident(vars)operator(.)ident(each) reserved(do) operator(|)ident(vv)operator(|) - ident(vv)operator(.)ident(extend)operator(()constant(Transaction)operator(::)constant(Simple)operator(\)) - ident(vv)operator(.)ident(start_transaction)operator(()ident(name)operator(\)) - reserved(end) - reserved(end) - reserved(end) - ident(private) symbol(:__common_start) - - reserved(def) method(start_named)operator(()ident(name)operator(,) operator(*)ident(vars)operator(,) operator(&)ident(block)operator(\)) - ident(__common_start)operator(()ident(name)operator(,) ident(vars)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(start)operator(()operator(*)ident(vars)operator(,) operator(&)ident(block)operator(\)) - ident(__common_start)operator(()pre_constant(nil)operator(,) ident(vars)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(__abort_transaction)operator(()ident(name) operator(=) pre_constant(nil)operator(\)) comment(#:nodoc:) - instance_variable(@__transaction_checkpoint__) operator(=) ident(__rewind_this_transaction) - - reserved(if) ident(name)operator(.)ident(nil?) - ident(ss) operator(=) string reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - reserved(else) - ident(ss) operator(=) stringcontent(\))delimiter(")> reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - reserved(end) - - reserved(if) constant(Transaction)operator(::)constant(Simple)operator(.)ident(debugging?) - constant(Transaction)operator(::)constant(Simple)operator(.)ident(debug_io) operator(<<) string operator(*) instance_variable(@__transaction_level__)inline_delimiter(})>content( )delimiter(")> operator(<<) - stringchar(\\n)delimiter(")> - reserved(end) - instance_variable(@__transaction_level__) operator(-=) integer(1) - instance_variable(@__transaction_names__)operator(.)ident(pop) - reserved(if) instance_variable(@__transaction_level__) operator(<) integer(1) - instance_variable(@__transaction_level__) operator(=) integer(0) - instance_variable(@__transaction_names__) operator(=) operator([)operator(]) - reserved(end) - reserved(end) - - constant(TRANSACTION_CHECKPOINT) operator(=) string comment(#:nodoc:) - constant(SKIP_TRANSACTION_VARS) operator(=) operator([)constant(TRANSACTION_CHECKPOINT)operator(,) stringoperator(]) comment(#:nodoc:) - - reserved(def) method(__rewind_this_transaction) comment(#:nodoc:) - ident(rr) operator(=) constant(Marshal)operator(.)ident(restore)operator(()instance_variable(@__transaction_checkpoint__)operator(\)) - - reserved(begin) - pre_constant(self)operator(.)ident(replace)operator(()ident(rr)operator(\)) reserved(if) ident(respond_to?)operator(()symbol(:replace)operator(\)) - reserved(rescue) - pre_constant(nil) - reserved(end) - - ident(rr)operator(.)ident(instance_variables)operator(.)ident(each) reserved(do) operator(|)ident(vv)operator(|) - reserved(next) reserved(if) constant(SKIP_TRANSACTION_VARS)operator(.)ident(include?)operator(()ident(vv)operator(\)) - reserved(next) reserved(if) pre_constant(self)operator(.)ident(transaction_exclusions)operator(.)ident(include?)operator(()ident(vv)operator(\)) - reserved(if) ident(respond_to?)operator(()symbol(:instance_variable_get)operator(\)) - ident(instance_variable_set)operator(()ident(vv)operator(,) ident(rr)operator(.)ident(instance_variable_get)operator(()ident(vv)operator(\))operator(\)) - reserved(else) - ident(instance_eval)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - ident(new_ivar) operator(=) ident(instance_variables) operator(-) ident(rr)operator(.)ident(instance_variables) operator(-) constant(SKIP_TRANSACTION_VARS) - ident(new_ivar)operator(.)ident(each) reserved(do) operator(|)ident(vv)operator(|) - reserved(if) ident(respond_to?)operator(()symbol(:instance_variable_set)operator(\)) - ident(instance_variable_set)operator(()ident(vv)operator(,) pre_constant(nil)operator(\)) - reserved(else) - ident(instance_eval)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(if) ident(respond_to?)operator(()symbol(:instance_variable_get)operator(\)) - ident(rr)operator(.)ident(instance_variable_get)operator(()constant(TRANSACTION_CHECKPOINT)operator(\)) - reserved(else) - ident(rr)operator(.)ident(instance_eval)operator(()constant(TRANSACTION_CHECKPOINT)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(__commit_transaction) comment(#:nodoc:) - reserved(if) ident(respond_to?)operator(()symbol(:instance_variable_get)operator(\)) - instance_variable(@__transaction_checkpoint__) operator(=) constant(Marshal)operator(.)ident(restore)operator(()instance_variable(@__transaction_checkpoint__)operator(\))operator(.)ident(instance_variable_get)operator(()constant(TRANSACTION_CHECKPOINT)operator(\)) - reserved(else) - instance_variable(@__transaction_checkpoint__) operator(=) constant(Marshal)operator(.)ident(restore)operator(()instance_variable(@__transaction_checkpoint__)operator(\))operator(.)ident(instance_eval)operator(()constant(TRANSACTION_CHECKPOINT)operator(\)) - reserved(end) - - instance_variable(@__transaction_level__) operator(-=) integer(1) - instance_variable(@__transaction_names__)operator(.)ident(pop) - - reserved(if) instance_variable(@__transaction_level__) operator(<) integer(1) - instance_variable(@__transaction_level__) operator(=) integer(0) - instance_variable(@__transaction_names__) operator(=) operator([)operator(]) - reserved(end) - reserved(end) - - ident(private) symbol(:__abort_transaction) - ident(private) symbol(:__rewind_this_transaction) - ident(private) symbol(:__commit_transaction) - reserved(end) -reserved(end) -reserved(module) class(ActiveRecord) - reserved(module) class(VERSION) comment(#:nodoc:) - constant(MAJOR) operator(=) integer(1) - constant(MINOR) operator(=) integer(14) - constant(TINY) operator(=) integer(4) - - constant(STRING) operator(=) operator([)constant(MAJOR)operator(,) constant(MINOR)operator(,) constant(TINY)operator(])operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActiveRecord) - reserved(module) class(Wrappings) comment(#:nodoc:) - reserved(class) class(YamlWrapper) operator(<) constant(AbstractWrapper) comment(#:nodoc:) - reserved(def) method(wrap)operator(()ident(attribute)operator(\)) ident(attribute)operator(.)ident(to_yaml) reserved(end) - reserved(def) method(unwrap)operator(()ident(attribute)operator(\)) constant(YAML)operator(::)ident(load)operator(()ident(attribute)operator(\)) reserved(end) - reserved(end) - - reserved(module) class(ClassMethods) comment(#:nodoc:) - comment(# Wraps the attribute in Yaml encoding) - reserved(def) method(wrap_in_yaml)operator(()operator(*)ident(attributes)operator(\)) ident(wrap_with)operator(()constant(YamlWrapper)operator(,) ident(attributes)operator(\)) reserved(end) - reserved(end) - reserved(end) -ident(endmodule) constant(ActiveRecord) - comment(# A plugin framework for wrapping attribute values before they go in and unwrapping them after they go out of the database.) - comment(# This was intended primarily for YAML wrapping of arrays and hashes, but this behavior is now native in the Base class.) - comment(# So for now this framework is laying dormant until a need pops up.) - reserved(module) class(Wrappings) comment(#:nodoc:) - reserved(module) class(ClassMethods) comment(#:nodoc:) - reserved(def) method(wrap_with)operator(()ident(wrapper)operator(,) operator(*)ident(attributes)operator(\)) - operator([) ident(attributes) operator(])operator(.)ident(flat)operator(.)ident(each) operator({) operator(|)ident(attribute)operator(|) ident(wrapper)operator(.)ident(wrap)operator(()ident(attribute)operator(\)) operator(}) - reserved(end) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - reserved(class) class(AbstractWrapper) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(wrap)operator(()ident(attribute)operator(,) ident(record_binding)operator(\)) comment(#:nodoc:) - stringoperator(.)ident(each) reserved(do) operator(|)ident(callback)operator(|) - ident(eval) stringcontent( )inlinecontent(.new(')inlinecontent('\))delimiter(")>operator(,) ident(record_binding) - reserved(end) - reserved(end) - - reserved(def) method(initialize)operator(()ident(attribute)operator(\)) comment(#:nodoc:) - instance_variable(@attribute) operator(=) ident(attribute) - reserved(end) - - reserved(def) method(save_wrapped_attribute)operator(()ident(record)operator(\)) comment(#:nodoc:) - reserved(if) ident(record)operator(.)ident(attribute_present?)operator(()instance_variable(@attribute)operator(\)) - ident(record)operator(.)ident(send)operator(() - stringoperator(,) - instance_variable(@attribute)operator(,) - ident(wrap)operator(()ident(record)operator(.)ident(send)operator(()stringoperator(,) instance_variable(@attribute)operator(\))operator(\)) - operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(load_wrapped_attribute)operator(()ident(record)operator(\)) comment(#:nodoc:) - reserved(if) ident(record)operator(.)ident(attribute_present?)operator(()instance_variable(@attribute)operator(\)) - ident(record)operator(.)ident(send)operator(() - stringoperator(,) - instance_variable(@attribute)operator(,) - ident(unwrap)operator(()ident(record)operator(.)ident(send)operator(()stringoperator(,) instance_variable(@attribute)operator(\))operator(\)) - operator(\)) - reserved(end) - reserved(end) - - ident(alias_method) symbol(:before_save)operator(,) symbol(:save_wrapped_attribute) comment(#:nodoc:) - ident(alias_method) symbol(:after_save)operator(,) symbol(:load_wrapped_attribute) comment(#:nodoc:) - ident(alias_method) symbol(:after_initialize)operator(,) symbol(:after_save) comment(#:nodoc:) - - comment(# Overwrite to implement the logic that'll take the regular attribute and wrap it.) - reserved(def) method(wrap)operator(()ident(attribute)operator(\)) reserved(end) - - comment(# Overwrite to implement the logic that'll take the wrapped attribute and unwrap it.) - reserved(def) method(unwrap)operator(()ident(attribute)operator(\)) reserved(end) - reserved(end) - reserved(end) -reserved(end) -comment(#--) -comment(# Copyright (c\) 2004 David Heinemeier Hansson) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#++) - -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(\)) reserved(unless) - global_variable($:)operator(.)ident(include?)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(\)) operator(||) global_variable($:)operator(.)ident(include?)operator(()constant(File)operator(.)ident(expand_path)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(\))operator(\)) - -reserved(unless) reserved(defined?)operator(()constant(ActiveSupport)operator(\)) - reserved(begin) - global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - ident(require) string - reserved(rescue) constant(LoadError) - ident(require) string - ident(require_gem) string - reserved(end) -reserved(end) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(class_eval) reserved(do) - ident(include) constant(ActiveRecord)operator(::)constant(Validations) - ident(include) constant(ActiveRecord)operator(::)constant(Locking) - ident(include) constant(ActiveRecord)operator(::)constant(Callbacks) - ident(include) constant(ActiveRecord)operator(::)constant(Observing) - ident(include) constant(ActiveRecord)operator(::)constant(Timestamp) - ident(include) constant(ActiveRecord)operator(::)constant(Associations) - ident(include) constant(ActiveRecord)operator(::)constant(Aggregations) - ident(include) constant(ActiveRecord)operator(::)constant(Transactions) - ident(include) constant(ActiveRecord)operator(::)constant(Reflection) - ident(include) constant(ActiveRecord)operator(::)constant(Acts)operator(::)constant(Tree) - ident(include) constant(ActiveRecord)operator(::)constant(Acts)operator(::)constant(List) - ident(include) constant(ActiveRecord)operator(::)constant(Acts)operator(::)constant(NestedSet) - ident(include) constant(ActiveRecord)operator(::)constant(Calculations) -reserved(end) - -reserved(unless) reserved(defined?)operator(()constant(RAILS_CONNECTION_ADAPTERS)operator(\)) - constant(RAILS_CONNECTION_ADAPTERS) operator(=) string -reserved(end) - -constant(RAILS_CONNECTION_ADAPTERS)operator(.)ident(each) reserved(do) operator(|)ident(adapter)operator(|) - ident(require) string operator(+) ident(adapter) operator(+) string -reserved(end) - -ident(require) string -ident(require) string -comment(# The filename begins with "aaa" to ensure this is the first test.) -ident(require) string - -reserved(class) class(AAACreateTablesTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(false) - - reserved(def) method(setup) - instance_variable(@base_path) operator(=) stringcontent(/fixtures/db_definitions)delimiter(")> - reserved(end) - - reserved(def) method(test_drop_and_create_main_tables) - ident(recreate) constant(ActiveRecord)operator(::)constant(Base) - ident(assert) pre_constant(true) - reserved(end) - - reserved(def) method(test_load_schema) - ident(eval)operator(()constant(File)operator(.)ident(read)operator(()stringcontent(/fixtures/db_definitions/schema.rb)delimiter(")>operator(\))operator(\)) - ident(assert) pre_constant(true) - reserved(end) - - reserved(def) method(test_drop_and_create_courses_table) - ident(recreate) constant(Course)operator(,) string - ident(assert) pre_constant(true) - reserved(end) - - ident(private) - reserved(def) method(recreate)operator(()ident(base)operator(,) ident(suffix) operator(=) pre_constant(nil)operator(\)) - ident(connection) operator(=) ident(base)operator(.)ident(connection) - ident(adapter_name) operator(=) ident(connection)operator(.)ident(adapter_name)operator(.)ident(downcase) operator(+) ident(suffix)operator(.)ident(to_s) - ident(execute_sql_file) stringcontent(/)inlinecontent(.drop.sql)delimiter(")>operator(,) ident(connection) - ident(execute_sql_file) stringcontent(/)inlinecontent(.sql)delimiter(")>operator(,) ident(connection) - reserved(end) - - reserved(def) method(execute_sql_file)operator(()ident(path)operator(,) ident(connection)operator(\)) - comment(# OpenBase has a different format for sql files) - reserved(if) ident(current_adapter?)operator(()symbol(:OpenBaseAdapter)operator(\)) reserved(then) - constant(File)operator(.)ident(read)operator(()ident(path)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each_with_index) reserved(do) operator(|)ident(sql)operator(,) ident(i)operator(|) - reserved(begin) - comment(# OpenBase does not support comments embedded in sql) - ident(connection)operator(.)ident(execute)operator(()ident(sql)operator(,)stringdelimiter(")>operator(\)) reserved(unless) ident(sql)operator(.)ident(blank?) - reserved(rescue) constant(ActiveRecord)operator(::)constant(StatementInvalid) - comment(#$stderr.puts "warning: #{$!}") - reserved(end) - reserved(end) - reserved(else) - constant(File)operator(.)ident(read)operator(()ident(path)operator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each_with_index) reserved(do) operator(|)ident(sql)operator(,) ident(i)operator(|) - reserved(begin) - ident(connection)operator(.)ident(execute)operator(()stringchar(\\n)inlinechar(\\n)delimiter(")>operator(\)) reserved(unless) ident(sql)operator(.)ident(blank?) - reserved(rescue) constant(ActiveRecord)operator(::)constant(StatementInvalid) - comment(#$stderr.puts "warning: #{$!}") - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -constant(QUOTED_TYPE) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(quote_column_name)operator(()stringoperator(\)) reserved(unless) constant(Object)operator(.)ident(const_defined?)operator(()symbol(:QUOTED_TYPE)operator(\)) - -reserved(class) class(Test::Unit::TestCase) comment(#:nodoc:) - pre_constant(self)operator(.)ident(fixture_path) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - pre_constant(self)operator(.)ident(use_instantiated_fixtures) operator(=) pre_constant(false) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) operator(()pre_constant(ENV)operator([)stringoperator(]) operator(!=) stringoperator(\)) - - reserved(def) method(create_fixtures)operator(()operator(*)ident(table_names)operator(,) operator(&)ident(block)operator(\)) - constant(Fixtures)operator(.)ident(create_fixtures)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) ident(table_names)operator(,) operator({)operator(})operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(assert_date_from_db)operator(()ident(expected)operator(,) ident(actual)operator(,) ident(message) operator(=) pre_constant(nil)operator(\)) - comment(# SQL Server doesn't have a separate column type just for dates, ) - comment(# so the time is in the string and incorrectly formatted) - reserved(if) ident(current_adapter?)operator(()symbol(:SQLServerAdapter)operator(\)) - ident(assert_equal) ident(expected)operator(.)ident(strftime)operator(()stringoperator(\))operator(,) ident(actual)operator(.)ident(strftime)operator(()stringoperator(\)) - reserved(elsif) ident(current_adapter?)operator(()symbol(:SybaseAdapter)operator(\)) - ident(assert_equal) ident(expected)operator(.)ident(to_s)operator(,) ident(actual)operator(.)ident(to_date)operator(.)ident(to_s)operator(,) ident(message) - reserved(else) - ident(assert_equal) ident(expected)operator(.)ident(to_s)operator(,) ident(actual)operator(.)ident(to_s)operator(,) ident(message) - reserved(end) - reserved(end) - - reserved(def) method(assert_queries)operator(()ident(num) operator(=) integer(1)operator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(class)operator(.)ident(class_eval) reserved(do) - pre_constant(self)operator(.)ident(query_count) operator(=) integer(0) - ident(alias_method) symbol(:execute)operator(,) symbol(:execute_with_query_counting) - reserved(end) - reserved(yield) - reserved(ensure) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(class)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:execute)operator(,) symbol(:execute_without_query_counting) - reserved(end) - ident(assert_equal) ident(num)operator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(query_count)operator(,) stringcontent( instead of )inlinecontent( queries were executed.)delimiter(")> - reserved(end) - - reserved(def) method(assert_no_queries)operator(()operator(&)ident(block)operator(\)) - ident(assert_queries)operator(()integer(0)operator(,) operator(&)ident(block)operator(\)) - reserved(end) -reserved(end) - -reserved(def) method(current_adapter?)operator(()ident(type)operator(\)) - constant(ActiveRecord)operator(::)constant(ConnectionAdapters)operator(.)ident(const_defined?)operator(()ident(type)operator(\)) operator(&&) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(instance_of?)operator(()constant(ActiveRecord)operator(::)constant(ConnectionAdapters)operator(.)ident(const_get)operator(()ident(type)operator(\))operator(\)) -reserved(end) - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(class)operator(.)ident(class_eval) reserved(do) - ident(cattr_accessor) symbol(:query_count) - ident(alias_method) symbol(:execute_without_query_counting)operator(,) symbol(:execute) - reserved(def) method(execute_with_query_counting)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) - pre_constant(self)operator(.)ident(query_count) operator(+=) integer(1) - ident(execute_without_query_counting)operator(()ident(sql)operator(,) ident(name)operator(\)) - reserved(end) -reserved(end) - -comment(#ActiveRecord::Base.logger = Logger.new(STDOUT\)) -comment(#ActiveRecord::Base.colorize_logging = false) -ident(require) string - -reserved(class) class(ActiveSchemaTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - constant(ActiveRecord)operator(::)constant(ConnectionAdapters)operator(::)constant(MysqlAdapter)operator(.)ident(class_eval) reserved(do) - ident(alias_method) symbol(:real_execute)operator(,) symbol(:execute) - reserved(def) method(execute)operator(()ident(sql)operator(,) ident(name) operator(=) pre_constant(nil)operator(\)) reserved(return) ident(sql) reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(teardown) - constant(ActiveRecord)operator(::)constant(ConnectionAdapters)operator(::)constant(MysqlAdapter)operator(.)ident(send)operator(()symbol(:alias_method)operator(,) symbol(:execute)operator(,) symbol(:real_execute)operator(\)) - reserved(end) - - reserved(def) method(test_drop_table) - ident(assert_equal) stringoperator(,) ident(drop_table)operator(()symbol(:people)operator(\)) - reserved(end) - - reserved(def) method(test_add_column) - ident(assert_equal) stringoperator(,) ident(add_column)operator(()symbol(:people)operator(,) symbol(:last_name)operator(,) symbol(:string)operator(\)) - reserved(end) - - reserved(def) method(test_add_column_with_limit) - ident(assert_equal) stringoperator(,) ident(add_column)operator(()symbol(:people)operator(,) symbol(:key)operator(,) symbol(:string)operator(,) symbol(:limit) operator(=)operator(>) integer(32)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(method_missing)operator(()ident(method_symbol)operator(,) operator(*)ident(arguments)operator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(send)operator(()ident(method_symbol)operator(,) operator(*)ident(arguments)operator(\)) - reserved(end) -ident(endrequire) string - -reserved(class) class(AdapterTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(setup) - instance_variable(@connection) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection) - reserved(end) - - reserved(def) method(test_tables) - reserved(if) instance_variable(@connection)operator(.)ident(respond_to?)operator(()symbol(:tables)operator(\)) - ident(tables) operator(=) instance_variable(@connection)operator(.)ident(tables) - ident(assert) ident(tables)operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(tables)operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(tables)operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(tables)operator(.)ident(include?)operator(()stringoperator(\)) - reserved(else) - ident(warn) stringcontent( does not respond to #tables)delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(test_indexes) - ident(idx_name) operator(=) string - - reserved(if) instance_variable(@connection)operator(.)ident(respond_to?)operator(()symbol(:indexes)operator(\)) - ident(indexes) operator(=) instance_variable(@connection)operator(.)ident(indexes)operator(()stringoperator(\)) - ident(assert) ident(indexes)operator(.)ident(empty?) - - instance_variable(@connection)operator(.)ident(add_index) symbol(:accounts)operator(,) symbol(:firm_id)operator(,) symbol(:name) operator(=)operator(>) ident(idx_name) - ident(indexes) operator(=) instance_variable(@connection)operator(.)ident(indexes)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(indexes)operator(.)ident(first)operator(.)ident(table) - comment(# OpenBase does not have the concept of a named index) - comment(# Indexes are merely properties of columns.) - ident(assert_equal) ident(idx_name)operator(,) ident(indexes)operator(.)ident(first)operator(.)ident(name) reserved(unless) ident(current_adapter?)operator(()symbol(:OpenBaseAdapter)operator(\)) - ident(assert) operator(!)ident(indexes)operator(.)ident(first)operator(.)ident(unique) - ident(assert_equal) operator([)stringoperator(])operator(,) ident(indexes)operator(.)ident(first)operator(.)ident(columns) - reserved(else) - ident(warn) stringcontent( does not respond to #indexes)delimiter(")> - reserved(end) - - reserved(ensure) - instance_variable(@connection)operator(.)ident(remove_index)operator(()symbol(:accounts)operator(,) symbol(:name) operator(=)operator(>) ident(idx_name)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(test_current_database) - reserved(if) instance_variable(@connection)operator(.)ident(respond_to?)operator(()symbol(:current_database)operator(\)) - ident(assert_equal) pre_constant(ENV)operator([)stringoperator(]) operator(||) stringoperator(,) instance_variable(@connection)operator(.)ident(current_database) - reserved(end) - reserved(end) - - reserved(def) method(test_table_alias) - reserved(def) instance_variable(@connection)operator(.)method(test_table_alias_length)operator(()operator(\)) integer(10)operator(;) reserved(end) - reserved(class) operator(<<) instance_variable(@connection) - ident(alias_method) symbol(:old_table_alias_length)operator(,) symbol(:table_alias_length) - ident(alias_method) symbol(:table_alias_length)operator(,) symbol(:test_table_alias_length) - reserved(end) - - ident(assert_equal) stringoperator(,) instance_variable(@connection)operator(.)ident(table_alias_for)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@connection)operator(.)ident(table_alias_for)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) instance_variable(@connection)operator(.)ident(table_alias_for)operator(()stringoperator(\)) - - reserved(class) operator(<<) instance_variable(@connection) - ident(alias_method) symbol(:table_alias_length)operator(,) symbol(:old_table_alias_length) - reserved(end) - reserved(end) - - comment(# test resetting sequences in odd tables in postgreSQL) - reserved(if) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(respond_to?)operator(()symbol(:reset_pk_sequence!)operator(\)) - ident(require) string - ident(require) string - reserved(def) method(test_reset_empty_table_with_custom_pk) - constant(Movie)operator(.)ident(delete_all) - constant(Movie)operator(.)ident(connection)operator(.)ident(reset_pk_sequence!) string - ident(assert_equal) integer(1)operator(,) constant(Movie)operator(.)ident(create)operator(()symbol(:name) operator(=)operator(>) stringoperator(\))operator(.)ident(id) - reserved(end) - - reserved(def) method(test_reset_table_with_non_integer_pk) - constant(Subscriber)operator(.)ident(delete_all) - constant(Subscriber)operator(.)ident(connection)operator(.)ident(reset_pk_sequence!) string - - ident(sub) operator(=) constant(Subscriber)operator(.)ident(new)operator(()symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(sub)operator(.)ident(id) operator(=) string - ident(assert_nothing_raised) operator({) ident(sub)operator(.)ident(save!) operator(}) - reserved(end) - reserved(end) - -reserved(end) -ident(require) string -ident(require) string - -reserved(class) class(AggregationsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:customers) - - reserved(def) method(test_find_single_value_object) - ident(assert_equal) integer(50)operator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(balance)operator(.)ident(amount) - ident(assert_kind_of) constant(Money)operator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(balance) - ident(assert_equal) integer(300)operator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(balance)operator(.)ident(exchange_to)operator(()stringoperator(\))operator(.)ident(amount) - reserved(end) - - reserved(def) method(test_find_multiple_value_object) - ident(assert_equal) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(address_street)operator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(address)operator(.)ident(street) - ident(assert)operator(() - ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(address)operator(.)ident(close_to?)operator(()constant(Address)operator(.)ident(new)operator(()stringoperator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(address_city)operator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(address_country)operator(\))operator(\)) - operator(\)) - reserved(end) - - reserved(def) method(test_change_single_value_object) - ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(balance) operator(=) constant(Money)operator(.)ident(new)operator(()integer(100)operator(\)) - ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(save) - ident(assert_equal) integer(100)operator(,) constant(Customer)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(balance)operator(.)ident(amount) - reserved(end) - - reserved(def) method(test_immutable_value_objects) - ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(balance) operator(=) constant(Money)operator(.)ident(new)operator(()integer(100)operator(\)) - ident(assert_raises)operator(()constant(TypeError)operator(\)) operator({) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(balance)operator(.)ident(instance_eval) operator({) instance_variable(@amount) operator(=) integer(20) operator(}) operator(}) - reserved(end) - - reserved(def) method(test_inferred_mapping) - ident(assert_equal) stringoperator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(gps_location)operator(.)ident(latitude) - ident(assert_equal) stringoperator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(gps_location)operator(.)ident(longitude) - - ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(gps_location) operator(=) constant(GpsLocation)operator(.)ident(new)operator(()stringoperator(\)) - - ident(assert_equal) stringoperator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(gps_location)operator(.)ident(latitude) - ident(assert_equal) stringoperator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(gps_location)operator(.)ident(longitude) - - ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(save) - - ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(reload) - - ident(assert_equal) stringoperator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(gps_location)operator(.)ident(latitude) - ident(assert_equal) stringoperator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(gps_location)operator(.)ident(longitude) - reserved(end) - - reserved(def) method(test_reloaded_instance_refreshes_aggregations) - ident(assert_equal) stringoperator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(gps_location)operator(.)ident(latitude) - ident(assert_equal) stringoperator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(gps_location)operator(.)ident(longitude) - - constant(Customer)operator(.)ident(update_all)operator(()stringoperator(\)) - ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(reload) - ident(assert_equal) stringoperator(,) ident(customers)operator(()symbol(:david)operator(\))operator([)stringoperator(]) - - ident(assert_equal) constant(GpsLocation)operator(.)ident(new)operator(()stringoperator(\))operator(,) ident(customers)operator(()symbol(:david)operator(\))operator(.)ident(gps_location) - reserved(end) - - reserved(def) method(test_gps_equality) - ident(assert) constant(GpsLocation)operator(.)ident(new)operator(()stringoperator(\)) operator(==) constant(GpsLocation)operator(.)ident(new)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_gps_inequality) - ident(assert) constant(GpsLocation)operator(.)ident(new)operator(()stringoperator(\)) operator(!=) constant(GpsLocation)operator(.)ident(new)operator(()stringoperator(\)) - reserved(end) -reserved(end) -ident(require) string -ident(require) stringcontent(/../lib/active_record/schema)delimiter(")> - -reserved(if) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(supports_migrations?) - - reserved(class) class(ActiveRecordSchemaTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(false) - - reserved(def) method(setup) - instance_variable(@connection) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection) - reserved(end) - - reserved(def) method(teardown) - instance_variable(@connection)operator(.)ident(drop_table) symbol(:fruits) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(test_schema_define) - constant(ActiveRecord)operator(::)constant(Schema)operator(.)ident(define)operator(()symbol(:version) operator(=)operator(>) integer(7)operator(\)) reserved(do) - ident(create_table) symbol(:fruits) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:color)operator(,) symbol(:string) - ident(t)operator(.)ident(column) symbol(:fruit_size)operator(,) symbol(:string) comment(# NOTE: "size" is reserved in Oracle) - ident(t)operator(.)ident(column) symbol(:texture)operator(,) symbol(:string) - ident(t)operator(.)ident(column) symbol(:flavor)operator(,) symbol(:string) - reserved(end) - reserved(end) - - ident(assert_nothing_raised) operator({) instance_variable(@connection)operator(.)ident(select_all) string operator(}) - ident(assert_nothing_raised) operator({) instance_variable(@connection)operator(.)ident(select_all) string operator(}) - ident(assert_equal) integer(7)operator(,) instance_variable(@connection)operator(.)ident(select_one)operator(()stringoperator(\))operator([)stringoperator(])operator(.)ident(to_i) - reserved(end) - reserved(end) - -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(AssociationCallbacksTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:posts)operator(,) symbol(:authors)operator(,) symbol(:projects)operator(,) symbol(:developers) - - reserved(def) method(setup) - instance_variable(@david) operator(=) ident(authors)operator(()symbol(:david)operator(\)) - instance_variable(@thinking) operator(=) ident(posts)operator(()symbol(:thinking)operator(\)) - instance_variable(@authorless) operator(=) ident(posts)operator(()symbol(:authorless)operator(\)) - ident(assert) instance_variable(@david)operator(.)ident(post_log)operator(.)ident(empty?) - reserved(end) - - reserved(def) method(test_adding_macro_callbacks) - instance_variable(@david)operator(.)ident(posts_with_callbacks) operator(<<) instance_variable(@thinking) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(])operator(,) instance_variable(@david)operator(.)ident(post_log) - instance_variable(@david)operator(.)ident(posts_with_callbacks) operator(<<) instance_variable(@thinking) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) - stringdelimiter(")>operator(])operator(,) instance_variable(@david)operator(.)ident(post_log) - reserved(end) - - reserved(def) method(test_adding_with_proc_callbacks) - instance_variable(@david)operator(.)ident(posts_with_proc_callbacks) operator(<<) instance_variable(@thinking) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(])operator(,) instance_variable(@david)operator(.)ident(post_log) - instance_variable(@david)operator(.)ident(posts_with_proc_callbacks) operator(<<) instance_variable(@thinking) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) - stringdelimiter(")>operator(])operator(,) instance_variable(@david)operator(.)ident(post_log) - reserved(end) - - reserved(def) method(test_removing_with_macro_callbacks) - ident(first_post)operator(,) ident(second_post) operator(=) instance_variable(@david)operator(.)ident(posts_with_callbacks)operator([)integer(0)operator(,) integer(2)operator(]) - instance_variable(@david)operator(.)ident(posts_with_callbacks)operator(.)ident(delete)operator(()ident(first_post)operator(\)) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(])operator(,) instance_variable(@david)operator(.)ident(post_log) - instance_variable(@david)operator(.)ident(posts_with_callbacks)operator(.)ident(delete)operator(()ident(second_post)operator(\)) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) - stringdelimiter(")>operator(])operator(,) instance_variable(@david)operator(.)ident(post_log) - reserved(end) - - reserved(def) method(test_removing_with_proc_callbacks) - ident(first_post)operator(,) ident(second_post) operator(=) instance_variable(@david)operator(.)ident(posts_with_callbacks)operator([)integer(0)operator(,) integer(2)operator(]) - instance_variable(@david)operator(.)ident(posts_with_proc_callbacks)operator(.)ident(delete)operator(()ident(first_post)operator(\)) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(])operator(,) instance_variable(@david)operator(.)ident(post_log) - instance_variable(@david)operator(.)ident(posts_with_proc_callbacks)operator(.)ident(delete)operator(()ident(second_post)operator(\)) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) - stringdelimiter(")>operator(])operator(,) instance_variable(@david)operator(.)ident(post_log) - reserved(end) - - reserved(def) method(test_multiple_callbacks) - instance_variable(@david)operator(.)ident(posts_with_multiple_callbacks) operator(<<) instance_variable(@thinking) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) - stringdelimiter(")>operator(])operator(,) instance_variable(@david)operator(.)ident(post_log) - instance_variable(@david)operator(.)ident(posts_with_multiple_callbacks) operator(<<) instance_variable(@thinking) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) - stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) - stringdelimiter(")>operator(,) stringdelimiter(")>operator(])operator(,) instance_variable(@david)operator(.)ident(post_log) - reserved(end) - - reserved(def) method(test_has_and_belongs_to_many_add_callback) - ident(david) operator(=) ident(developers)operator(()symbol(:david)operator(\)) - ident(ar) operator(=) ident(projects)operator(()symbol(:active_record)operator(\)) - ident(assert) ident(ar)operator(.)ident(developers_log)operator(.)ident(empty?) - ident(ar)operator(.)ident(developers_with_callbacks) operator(<<) ident(david) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(])operator(,) ident(ar)operator(.)ident(developers_log) - ident(ar)operator(.)ident(developers_with_callbacks) operator(<<) ident(david) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) - stringdelimiter(")>operator(])operator(,) ident(ar)operator(.)ident(developers_log) - reserved(end) - - reserved(def) method(test_has_and_belongs_to_many_remove_callback) - ident(david) operator(=) ident(developers)operator(()symbol(:david)operator(\)) - ident(jamis) operator(=) ident(developers)operator(()symbol(:jamis)operator(\)) - ident(activerecord) operator(=) ident(projects)operator(()symbol(:active_record)operator(\)) - ident(assert) ident(activerecord)operator(.)ident(developers_log)operator(.)ident(empty?) - ident(activerecord)operator(.)ident(developers_with_callbacks)operator(.)ident(delete)operator(()ident(david)operator(\)) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(])operator(,) ident(activerecord)operator(.)ident(developers_log) - - ident(activerecord)operator(.)ident(developers_with_callbacks)operator(.)ident(delete)operator(()ident(jamis)operator(\)) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) - stringdelimiter(")>operator(])operator(,) ident(activerecord)operator(.)ident(developers_log) - reserved(end) - - reserved(def) method(test_has_and_belongs_to_many_remove_callback_on_clear) - ident(activerecord) operator(=) ident(projects)operator(()symbol(:active_record)operator(\)) - ident(assert) ident(activerecord)operator(.)ident(developers_log)operator(.)ident(empty?) - reserved(if) ident(activerecord)operator(.)ident(developers_with_callbacks)operator(.)ident(size) operator(==) integer(0) - ident(activerecord)operator(.)ident(developers) operator(<<) ident(developers)operator(()symbol(:david)operator(\)) - ident(activerecord)operator(.)ident(developers) operator(<<) ident(developers)operator(()symbol(:jamis)operator(\)) - ident(activerecord)operator(.)ident(reload) - ident(assert) ident(activerecord)operator(.)ident(developers_with_callbacks)operator(.)ident(size) operator(==) integer(2) - reserved(end) - ident(log_array) operator(=) ident(activerecord)operator(.)ident(developers_with_callbacks)operator(.)ident(collect) operator({)operator(|)ident(d)operator(|) operator([)stringdelimiter(")>operator(,)stringdelimiter(")>operator(])operator(})operator(.)ident(flatten)operator(.)ident(sort) - ident(assert) ident(activerecord)operator(.)ident(developers_with_callbacks)operator(.)ident(clear) - ident(assert_equal) ident(log_array)operator(,) ident(activerecord)operator(.)ident(developers_log)operator(.)ident(sort) - reserved(end) - - reserved(def) method(test_dont_add_if_before_callback_raises_exception) - ident(assert) operator(!)instance_variable(@david)operator(.)ident(unchangable_posts)operator(.)ident(include?)operator(()instance_variable(@authorless)operator(\)) - reserved(begin) - instance_variable(@david)operator(.)ident(unchangable_posts) operator(<<) instance_variable(@authorless) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - reserved(end) - ident(assert) instance_variable(@david)operator(.)ident(post_log)operator(.)ident(empty?) - ident(assert) operator(!)instance_variable(@david)operator(.)ident(unchangable_posts)operator(.)ident(include?)operator(()instance_variable(@authorless)operator(\)) - instance_variable(@david)operator(.)ident(reload) - ident(assert) operator(!)instance_variable(@david)operator(.)ident(unchangable_posts)operator(.)ident(include?)operator(()instance_variable(@authorless)operator(\)) - reserved(end) - - reserved(def) method(test_push_with_attributes) - ident(david) operator(=) ident(developers)operator(()symbol(:david)operator(\)) - ident(activerecord) operator(=) ident(projects)operator(()symbol(:active_record)operator(\)) - ident(assert) ident(activerecord)operator(.)ident(developers_log)operator(.)ident(empty?) - ident(activerecord)operator(.)ident(developers_with_callbacks)operator(.)ident(push_with_attributes)operator(()ident(david)operator(,) operator({)operator(})operator(\)) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(])operator(,) ident(activerecord)operator(.)ident(developers_log) - ident(activerecord)operator(.)ident(developers_with_callbacks)operator(.)ident(push_with_attributes)operator(()ident(david)operator(,) operator({)operator(})operator(\)) - ident(assert_equal) operator([)stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) stringdelimiter(")>operator(,) - stringdelimiter(")>operator(])operator(,) ident(activerecord)operator(.)ident(developers_log) - reserved(end) -reserved(end) - -ident(require) string -ident(require) string - -reserved(class) class(AssociationInheritanceReloadTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:companies) - - reserved(def) method(test_set_attributes) - ident(assert_equal) operator([)stringoperator(])operator(,) constant(Firm)operator(.)ident(read_inheritable_attribute)operator(()stringoperator(\))operator(,) string - comment(# ActiveRecord::Base.reset_column_information_and_inheritable_attributes_for_all_subclasses) - ident(remove_subclass_of)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(\)) - ident(load) string - ident(assert_equal) operator([)stringoperator(])operator(,) constant(Firm)operator(.)ident(read_inheritable_attribute)operator(()stringoperator(\))operator(,) string - reserved(end) -ident(endrequire) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(CascadedEagerLoadingTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:authors)operator(,) symbol(:mixins)operator(,) symbol(:companies)operator(,) symbol(:posts)operator(,) symbol(:categorizations)operator(,) symbol(:topics) - - reserved(def) method(test_eager_association_loading_with_cascaded_two_levels) - ident(authors) operator(=) constant(Author)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include)operator(=)operator(>)operator({)symbol(:posts)operator(=)operator(>)symbol(:comments)operator(})operator(,) symbol(:order)operator(=)operator(>)stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(authors)operator(.)ident(size) - ident(assert_equal) integer(5)operator(,) ident(authors)operator([)integer(0)operator(])operator(.)ident(posts)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(authors)operator([)integer(1)operator(])operator(.)ident(posts)operator(.)ident(size) - ident(assert_equal) integer(9)operator(,) ident(authors)operator([)integer(0)operator(])operator(.)ident(posts)operator(.)ident(collect)operator({)operator(|)ident(post)operator(|) ident(post)operator(.)ident(comments)operator(.)ident(size) operator(})operator(.)ident(inject)operator(()integer(0)operator(\))operator({)operator(|)ident(sum)operator(,)ident(i)operator(|) ident(sum)operator(+)ident(i)operator(}) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_cascaded_two_levels_and_one_level) - ident(authors) operator(=) constant(Author)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include)operator(=)operator(>)operator([)operator({)symbol(:posts)operator(=)operator(>)symbol(:comments)operator(})operator(,) symbol(:categorizations)operator(])operator(,) symbol(:order)operator(=)operator(>)stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(authors)operator(.)ident(size) - ident(assert_equal) integer(5)operator(,) ident(authors)operator([)integer(0)operator(])operator(.)ident(posts)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(authors)operator([)integer(1)operator(])operator(.)ident(posts)operator(.)ident(size) - ident(assert_equal) integer(9)operator(,) ident(authors)operator([)integer(0)operator(])operator(.)ident(posts)operator(.)ident(collect)operator({)operator(|)ident(post)operator(|) ident(post)operator(.)ident(comments)operator(.)ident(size) operator(})operator(.)ident(inject)operator(()integer(0)operator(\))operator({)operator(|)ident(sum)operator(,)ident(i)operator(|) ident(sum)operator(+)ident(i)operator(}) - ident(assert_equal) integer(1)operator(,) ident(authors)operator([)integer(0)operator(])operator(.)ident(categorizations)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(authors)operator([)integer(1)operator(])operator(.)ident(categorizations)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_cascaded_two_levels_with_two_has_many_associations) - ident(authors) operator(=) constant(Author)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include)operator(=)operator(>)operator({)symbol(:posts)operator(=)operator(>)operator([)symbol(:comments)operator(,) symbol(:categorizations)operator(])operator(})operator(,) symbol(:order)operator(=)operator(>)stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(authors)operator(.)ident(size) - ident(assert_equal) integer(5)operator(,) ident(authors)operator([)integer(0)operator(])operator(.)ident(posts)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(authors)operator([)integer(1)operator(])operator(.)ident(posts)operator(.)ident(size) - ident(assert_equal) integer(9)operator(,) ident(authors)operator([)integer(0)operator(])operator(.)ident(posts)operator(.)ident(collect)operator({)operator(|)ident(post)operator(|) ident(post)operator(.)ident(comments)operator(.)ident(size) operator(})operator(.)ident(inject)operator(()integer(0)operator(\))operator({)operator(|)ident(sum)operator(,)ident(i)operator(|) ident(sum)operator(+)ident(i)operator(}) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_cascaded_two_levels_and_self_table_reference) - ident(authors) operator(=) constant(Author)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include)operator(=)operator(>)operator({)symbol(:posts)operator(=)operator(>)operator([)symbol(:comments)operator(,) symbol(:author)operator(])operator(})operator(,) symbol(:order)operator(=)operator(>)stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(authors)operator(.)ident(size) - ident(assert_equal) integer(5)operator(,) ident(authors)operator([)integer(0)operator(])operator(.)ident(posts)operator(.)ident(size) - ident(assert_equal) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(name)operator(,) ident(authors)operator([)integer(0)operator(])operator(.)ident(name) - ident(assert_equal) operator([)ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(name)operator(])operator(,) ident(authors)operator([)integer(0)operator(])operator(.)ident(posts)operator(.)ident(collect)operator({)operator(|)ident(post)operator(|) ident(post)operator(.)ident(author)operator(.)ident(name)operator(})operator(.)ident(uniq) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_cascaded_two_levels_with_condition) - ident(authors) operator(=) constant(Author)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include)operator(=)operator(>)operator({)symbol(:posts)operator(=)operator(>)symbol(:comments)operator(})operator(,) symbol(:conditions)operator(=)operator(>)stringoperator(,) symbol(:order)operator(=)operator(>)stringoperator(\)) - ident(assert_equal) integer(1)operator(,) ident(authors)operator(.)ident(size) - ident(assert_equal) integer(5)operator(,) ident(authors)operator([)integer(0)operator(])operator(.)ident(posts)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_acts_as_tree) - ident(roots) operator(=) constant(TreeMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include)operator(=)operator(>)stringoperator(,) symbol(:conditions)operator(=)operator(>)stringoperator(,) symbol(:order)operator(=)operator(>)stringoperator(\)) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(])operator(,) ident(roots) - ident(assert_no_queries) reserved(do) - ident(assert_equal) integer(2)operator(,) ident(roots)operator([)integer(0)operator(])operator(.)ident(children)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(roots)operator([)integer(1)operator(])operator(.)ident(children)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(roots)operator([)integer(2)operator(])operator(.)ident(children)operator(.)ident(size) - reserved(end) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_cascaded_three_levels_by_ping_pong) - ident(firms) operator(=) constant(Firm)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include)operator(=)operator(>)operator({)symbol(:account)operator(=)operator(>)operator({)symbol(:firm)operator(=)operator(>)symbol(:account)operator(})operator(})operator(,) symbol(:order)operator(=)operator(>)stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(firms)operator(.)ident(size) - ident(assert_equal) ident(firms)operator(.)ident(first)operator(.)ident(account)operator(,) ident(firms)operator(.)ident(first)operator(.)ident(account)operator(.)ident(firm)operator(.)ident(account) - ident(assert_equal) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account)operator(,) ident(assert_no_queries) operator({) ident(firms)operator(.)ident(first)operator(.)ident(account)operator(.)ident(firm)operator(.)ident(account) operator(}) - ident(assert_equal) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account)operator(.)ident(firm)operator(.)ident(account)operator(,) ident(assert_no_queries) operator({) ident(firms)operator(.)ident(first)operator(.)ident(account)operator(.)ident(firm)operator(.)ident(account) operator(}) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_has_many_sti) - ident(topics) operator(=) constant(Topic)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:replies)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)ident(topics)operator(()symbol(:first)operator(\))operator(,) ident(topics)operator(()symbol(:second)operator(\))operator(])operator(,) ident(topics) - ident(assert_no_queries) reserved(do) - ident(assert_equal) integer(1)operator(,) ident(topics)operator([)integer(0)operator(])operator(.)ident(replies)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(topics)operator([)integer(1)operator(])operator(.)ident(replies)operator(.)ident(size) - reserved(end) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_belongs_to_sti) - ident(replies) operator(=) constant(Reply)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:topic)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)ident(topics)operator(()symbol(:second)operator(\))operator(])operator(,) ident(replies) - ident(assert_equal) ident(topics)operator(()symbol(:first)operator(\))operator(,) ident(assert_no_queries) operator({) ident(replies)operator(.)ident(first)operator(.)ident(topic) operator(}) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_multiple_stis_and_order) - ident(author) operator(=) constant(Author)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:include) operator(=)operator(>) operator({) symbol(:posts) operator(=)operator(>) operator([) symbol(:special_comments) operator(,) symbol(:very_special_comment) operator(]) operator(})operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(authors)operator(()symbol(:david)operator(\))operator(,) ident(author) - ident(assert_no_queries) reserved(do) - ident(author)operator(.)ident(posts)operator(.)ident(first)operator(.)ident(special_comments) - ident(author)operator(.)ident(posts)operator(.)ident(first)operator(.)ident(very_special_comment) - reserved(end) - reserved(end) - - reserved(def) method(test_eager_association_loading_of_stis_with_multiple_references) - ident(authors) operator(=) constant(Author)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator({) symbol(:posts) operator(=)operator(>) operator({) symbol(:special_comments) operator(=)operator(>) operator({) symbol(:post) operator(=)operator(>) operator([) symbol(:special_comments)operator(,) symbol(:very_special_comment) operator(]) operator(}) operator(}) operator(})operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)ident(authors)operator(()symbol(:david)operator(\))operator(])operator(,) ident(authors) - ident(assert_no_queries) reserved(do) - ident(authors)operator(.)ident(first)operator(.)ident(posts)operator(.)ident(first)operator(.)ident(special_comments)operator(.)ident(first)operator(.)ident(post)operator(.)ident(special_comments) - ident(authors)operator(.)ident(first)operator(.)ident(posts)operator(.)ident(first)operator(.)ident(special_comments)operator(.)ident(first)operator(.)ident(post)operator(.)ident(very_special_comment) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(AssociationsExtensionsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:projects)operator(,) symbol(:developers)operator(,) symbol(:developers_projects)operator(,) symbol(:comments)operator(,) symbol(:posts) - - reserved(def) method(test_extension_on_has_many) - ident(assert_equal) ident(comments)operator(()symbol(:more_greetings)operator(\))operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(comments)operator(.)ident(find_most_recent) - reserved(end) - - reserved(def) method(test_extension_on_habtm) - ident(assert_equal) ident(projects)operator(()symbol(:action_controller)operator(\))operator(,) ident(developers)operator(()symbol(:david)operator(\))operator(.)ident(projects)operator(.)ident(find_most_recent) - reserved(end) - - reserved(def) method(test_named_extension_on_habtm) - ident(assert_equal) ident(projects)operator(()symbol(:action_controller)operator(\))operator(,) ident(developers)operator(()symbol(:david)operator(\))operator(.)ident(projects_extended_by_name)operator(.)ident(find_most_recent) - reserved(end) - - reserved(def) method(test_marshalling_extensions) - ident(david) operator(=) ident(developers)operator(()symbol(:david)operator(\)) - ident(assert_equal) ident(projects)operator(()symbol(:action_controller)operator(\))operator(,) ident(david)operator(.)ident(projects)operator(.)ident(find_most_recent) - - ident(david) operator(=) constant(Marshal)operator(.)ident(load)operator(()constant(Marshal)operator(.)ident(dump)operator(()ident(david)operator(\))operator(\)) - ident(assert_equal) ident(projects)operator(()symbol(:action_controller)operator(\))operator(,) ident(david)operator(.)ident(projects)operator(.)ident(find_most_recent) - reserved(end) - - reserved(def) method(test_marshalling_named_extensions) - ident(david) operator(=) ident(developers)operator(()symbol(:david)operator(\)) - ident(assert_equal) ident(projects)operator(()symbol(:action_controller)operator(\))operator(,) ident(david)operator(.)ident(projects_extended_by_name)operator(.)ident(find_most_recent) - - ident(david) operator(=) constant(Marshal)operator(.)ident(load)operator(()constant(Marshal)operator(.)ident(dump)operator(()ident(david)operator(\))operator(\)) - ident(assert_equal) ident(projects)operator(()symbol(:action_controller)operator(\))operator(,) ident(david)operator(.)ident(projects_extended_by_name)operator(.)ident(find_most_recent) - reserved(end) -ident(endrequire) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(EagerAssociationTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:posts)operator(,) symbol(:comments)operator(,) symbol(:authors)operator(,) symbol(:categories)operator(,) symbol(:categories_posts)operator(,) - symbol(:companies)operator(,) symbol(:accounts)operator(,) symbol(:tags)operator(,) symbol(:people)operator(,) symbol(:readers) - - reserved(def) method(test_loading_with_one_association) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:comments)operator(\)) - ident(post) operator(=) ident(posts)operator(.)ident(find) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(id) operator(==) integer(1) operator(}) - ident(assert_equal) integer(2)operator(,) ident(post)operator(.)ident(comments)operator(.)ident(size) - ident(assert) ident(post)operator(.)ident(comments)operator(.)ident(include?)operator(()ident(comments)operator(()symbol(:greetings)operator(\))operator(\)) - - ident(post) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:include) operator(=)operator(>) symbol(:comments)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(post)operator(.)ident(comments)operator(.)ident(size) - ident(assert) ident(post)operator(.)ident(comments)operator(.)ident(include?)operator(()ident(comments)operator(()symbol(:greetings)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_loading_conditions_with_or) - ident(posts) operator(=) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(posts)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:comments)operator(,) symbol(:conditions) operator(=)operator(>) stringcontent( = 'SpecialComment')delimiter(")>operator(\)) - ident(assert_nil) ident(posts)operator(.)ident(detect) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(author_id) operator(!=) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(id) operator(})operator(,) - string - reserved(end) - - reserved(def) method(test_with_ordering) - ident(list) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:comments)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - operator([)symbol(:eager_other)operator(,) symbol(:sti_habtm)operator(,) symbol(:sti_post_and_comments)operator(,) symbol(:sti_comments)operator(,) - symbol(:authorless)operator(,) symbol(:thinking)operator(,) symbol(:welcome) - operator(])operator(.)ident(each_with_index) reserved(do) operator(|)ident(post)operator(,) ident(index)operator(|) - ident(assert_equal) ident(posts)operator(()ident(post)operator(\))operator(,) ident(list)operator([)ident(index)operator(]) - reserved(end) - reserved(end) - - reserved(def) method(test_loading_with_multiple_associations) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:comments)operator(,) symbol(:author)operator(,) symbol(:categories) operator(])operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(posts)operator(.)ident(first)operator(.)ident(comments)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(posts)operator(.)ident(first)operator(.)ident(categories)operator(.)ident(size) - ident(assert) ident(posts)operator(.)ident(first)operator(.)ident(comments)operator(.)ident(include?)operator(()ident(comments)operator(()symbol(:greetings)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_loading_from_an_association) - ident(posts) operator(=) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(posts)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:comments)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(posts)operator(.)ident(first)operator(.)ident(comments)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_loading_with_no_associations) - ident(assert_nil) constant(Post)operator(.)ident(find)operator(()ident(posts)operator(()symbol(:authorless)operator(\))operator(.)ident(id)operator(,) symbol(:include) operator(=)operator(>) symbol(:author)operator(\))operator(.)ident(author) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_belongs_to) - ident(comments) operator(=) constant(Comment)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:post)operator(\)) - ident(assert_equal) integer(10)operator(,) ident(comments)operator(.)ident(length) - ident(titles) operator(=) ident(comments)operator(.)ident(map) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(post)operator(.)ident(title) operator(}) - ident(assert) ident(titles)operator(.)ident(include?)operator(()ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(title)operator(\)) - ident(assert) ident(titles)operator(.)ident(include?)operator(()ident(posts)operator(()symbol(:sti_post_and_comments)operator(\))operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_belongs_to_and_limit) - ident(comments) operator(=) constant(Comment)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:post)operator(,) symbol(:limit) operator(=)operator(>) integer(5)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(5)operator(,) ident(comments)operator(.)ident(length) - ident(assert_equal) operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(5)operator(,)integer(6)operator(])operator(,) ident(comments)operator(.)ident(collect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(id) operator(}) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_belongs_to_and_limit_and_conditions) - ident(comments) operator(=) constant(Comment)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:post)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(3)operator(,) ident(comments)operator(.)ident(length) - ident(assert_equal) operator([)integer(5)operator(,)integer(6)operator(,)integer(7)operator(])operator(,) ident(comments)operator(.)ident(collect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(id) operator(}) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_belongs_to_and_limit_and_offset) - ident(comments) operator(=) constant(Comment)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:post)operator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:offset) operator(=)operator(>) integer(2)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(3)operator(,) ident(comments)operator(.)ident(length) - ident(assert_equal) operator([)integer(3)operator(,)integer(5)operator(,)integer(6)operator(])operator(,) ident(comments)operator(.)ident(collect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(id) operator(}) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_belongs_to_and_limit_and_offset_and_conditions) - ident(comments) operator(=) constant(Comment)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:post)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:offset) operator(=)operator(>) integer(1)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(3)operator(,) ident(comments)operator(.)ident(length) - ident(assert_equal) operator([)integer(6)operator(,)integer(7)operator(,)integer(8)operator(])operator(,) ident(comments)operator(.)ident(collect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(id) operator(}) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_belongs_to_and_limit_and_offset_and_conditions_array) - ident(comments) operator(=) constant(Comment)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:post)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,)integer(4)operator(])operator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:offset) operator(=)operator(>) integer(1)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(3)operator(,) ident(comments)operator(.)ident(length) - ident(assert_equal) operator([)integer(6)operator(,)integer(7)operator(,)integer(8)operator(])operator(,) ident(comments)operator(.)ident(collect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(id) operator(}) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_belongs_to_and_limit_and_multiple_associations) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator([)symbol(:author)operator(,) symbol(:very_special_comment)operator(])operator(,) symbol(:limit) operator(=)operator(>) integer(1)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(1)operator(,) ident(posts)operator(.)ident(length) - ident(assert_equal) operator([)integer(1)operator(])operator(,) ident(posts)operator(.)ident(collect) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(id) operator(}) - reserved(end) - - reserved(def) method(test_eager_association_loading_with_belongs_to_and_limit_and_offset_and_multiple_associations) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator([)symbol(:author)operator(,) symbol(:very_special_comment)operator(])operator(,) symbol(:limit) operator(=)operator(>) integer(1)operator(,) symbol(:offset) operator(=)operator(>) integer(1)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(1)operator(,) ident(posts)operator(.)ident(length) - ident(assert_equal) operator([)integer(2)operator(])operator(,) ident(posts)operator(.)ident(collect) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(id) operator(}) - reserved(end) - - reserved(def) method(test_eager_with_has_many_through) - ident(posts_with_comments) operator(=) ident(people)operator(()symbol(:michael)operator(\))operator(.)ident(posts)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:comments) operator(\)) - ident(posts_with_author) operator(=) ident(people)operator(()symbol(:michael)operator(\))operator(.)ident(posts)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:author) operator(\)) - ident(posts_with_comments_and_author) operator(=) ident(people)operator(()symbol(:michael)operator(\))operator(.)ident(posts)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:comments)operator(,) symbol(:author) operator(])operator(\)) - ident(assert_equal) integer(2)operator(,) ident(posts_with_comments)operator(.)ident(inject)operator(()integer(0)operator(\)) operator({) operator(|)ident(sum)operator(,) ident(post)operator(|) ident(sum) operator(+=) ident(post)operator(.)ident(comments)operator(.)ident(size) operator(}) - ident(assert_equal) ident(authors)operator(()symbol(:david)operator(\))operator(,) ident(assert_no_queries) operator({) ident(posts_with_author)operator(.)ident(first)operator(.)ident(author) operator(}) - ident(assert_equal) ident(authors)operator(()symbol(:david)operator(\))operator(,) ident(assert_no_queries) operator({) ident(posts_with_comments_and_author)operator(.)ident(first)operator(.)ident(author) operator(}) - reserved(end) - - reserved(def) method(test_eager_with_has_many_and_limit) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:author)operator(,) symbol(:comments) operator(])operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(posts)operator(.)ident(size) - ident(assert_equal) integer(3)operator(,) ident(posts)operator(.)ident(inject)operator(()integer(0)operator(\)) operator({) operator(|)ident(sum)operator(,) ident(post)operator(|) ident(sum) operator(+=) ident(post)operator(.)ident(comments)operator(.)ident(size) operator(}) - reserved(end) - - reserved(def) method(test_eager_with_has_many_and_limit_and_conditions) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:author)operator(,) symbol(:comments) operator(])operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(posts)operator(.)ident(size) - ident(assert_equal) operator([)integer(4)operator(,)integer(5)operator(])operator(,) ident(posts)operator(.)ident(collect) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(id) operator(}) - reserved(end) - - reserved(def) method(test_eager_with_has_many_and_limit_and_conditions_array) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:author)operator(,) symbol(:comments) operator(])operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(,) symbol(:conditions) operator(=)operator(>) operator([) stringoperator(,) string operator(])operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(posts)operator(.)ident(size) - ident(assert_equal) operator([)integer(4)operator(,)integer(5)operator(])operator(,) ident(posts)operator(.)ident(collect) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(id) operator(}) - reserved(end) - - reserved(def) method(test_eager_with_has_many_and_limit_and_conditions_array_on_the_eagers) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:author)operator(,) symbol(:comments) operator(])operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(,) symbol(:conditions) operator(=)operator(>) operator([) stringoperator(,) string operator(])operator(\)) - ident(assert_equal) integer(2)operator(,) ident(posts)operator(.)ident(size) - - ident(count) operator(=) constant(Post)operator(.)ident(count)operator(()symbol(:include) operator(=)operator(>) operator([) symbol(:author)operator(,) symbol(:comments) operator(])operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(,) symbol(:conditions) operator(=)operator(>) operator([) stringoperator(,) string operator(])operator(\)) - ident(assert_equal) ident(count)operator(,) ident(posts)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_eager_with_has_many_and_limit_ond_high_offset) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:author)operator(,) symbol(:comments) operator(])operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(,) symbol(:offset) operator(=)operator(>) integer(10)operator(,) symbol(:conditions) operator(=)operator(>) operator([) stringoperator(,) string operator(])operator(\)) - ident(assert_equal) integer(0)operator(,) ident(posts)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_count_eager_with_has_many_and_limit_ond_high_offset) - ident(posts) operator(=) constant(Post)operator(.)ident(count)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:author)operator(,) symbol(:comments) operator(])operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(,) symbol(:offset) operator(=)operator(>) integer(10)operator(,) symbol(:conditions) operator(=)operator(>) operator([) stringoperator(,) string operator(])operator(\)) - ident(assert_equal) integer(0)operator(,) ident(posts) - reserved(end) - - reserved(def) method(test_eager_with_has_many_and_limit_with_no_results) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:author)operator(,) symbol(:comments) operator(])operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(0)operator(,) ident(posts)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_eager_with_has_and_belongs_to_many_and_limit) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:categories)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(posts)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(posts)operator([)integer(0)operator(])operator(.)ident(categories)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(posts)operator([)integer(1)operator(])operator(.)ident(categories)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(posts)operator([)integer(2)operator(])operator(.)ident(categories)operator(.)ident(size) - ident(assert) ident(posts)operator([)integer(0)operator(])operator(.)ident(categories)operator(.)ident(include?)operator(()ident(categories)operator(()symbol(:technology)operator(\))operator(\)) - ident(assert) ident(posts)operator([)integer(1)operator(])operator(.)ident(categories)operator(.)ident(include?)operator(()ident(categories)operator(()symbol(:general)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_eager_with_has_many_and_limit_and_conditions_on_the_eagers) - ident(posts) operator(=) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(posts)operator(.)ident(find)operator(()symbol(:all)operator(,) - symbol(:include) operator(=)operator(>) symbol(:comments)operator(,) - symbol(:conditions) operator(=)operator(>) stringcontent(= 'SpecialComment')delimiter(")>operator(,) - symbol(:limit) operator(=)operator(>) integer(2) - operator(\)) - ident(assert_equal) integer(2)operator(,) ident(posts)operator(.)ident(size) - - ident(count) operator(=) constant(Post)operator(.)ident(count)operator(() - symbol(:include) operator(=)operator(>) operator([) symbol(:comments)operator(,) symbol(:author) operator(])operator(,) - symbol(:conditions) operator(=)operator(>) stringcontent(= 'SpecialComment'\))delimiter(")>operator(,) - symbol(:limit) operator(=)operator(>) integer(2) - operator(\)) - ident(assert_equal) ident(count)operator(,) ident(posts)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_eager_with_has_many_and_limit_and_scoped_conditions_on_the_eagers) - ident(posts) operator(=) pre_constant(nil) - constant(Post)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) - symbol(:include) operator(=)operator(>) symbol(:comments)operator(,) - symbol(:conditions) operator(=)operator(>) stringcontent(= 'SpecialComment')delimiter(")> - operator(})operator(\)) reserved(do) - ident(posts) operator(=) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(posts)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(posts)operator(.)ident(size) - reserved(end) - - constant(Post)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) - symbol(:include) operator(=)operator(>) operator([) symbol(:comments)operator(,) symbol(:author) operator(])operator(,) - symbol(:conditions) operator(=)operator(>) stringcontent(= 'SpecialComment'\))delimiter(")> - operator(})operator(\)) reserved(do) - ident(count) operator(=) constant(Post)operator(.)ident(count)operator(()symbol(:limit) operator(=)operator(>) integer(2)operator(\)) - ident(assert_equal) ident(count)operator(,) ident(posts)operator(.)ident(size) - reserved(end) - reserved(end) - - reserved(def) method(test_eager_with_has_many_and_limit_and_scoped_and_explicit_conditions_on_the_eagers) - constant(Post)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(posts) operator(=) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(posts)operator(.)ident(find)operator(()symbol(:all)operator(,) - symbol(:include) operator(=)operator(>) symbol(:comments)operator(,) - symbol(:conditions) operator(=)operator(>) stringcontent(= 'SpecialComment')delimiter(")>operator(,) - symbol(:limit) operator(=)operator(>) integer(2) - operator(\)) - ident(assert_equal) integer(2)operator(,) ident(posts)operator(.)ident(size) - - ident(count) operator(=) constant(Post)operator(.)ident(count)operator(() - symbol(:include) operator(=)operator(>) operator([) symbol(:comments)operator(,) symbol(:author) operator(])operator(,) - symbol(:conditions) operator(=)operator(>) stringcontent(= 'SpecialComment'\))delimiter(")>operator(,) - symbol(:limit) operator(=)operator(>) integer(2) - operator(\)) - ident(assert_equal) ident(count)operator(,) ident(posts)operator(.)ident(size) - reserved(end) - reserved(end) - reserved(def) method(test_eager_association_loading_with_habtm) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:categories)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(posts)operator([)integer(0)operator(])operator(.)ident(categories)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(posts)operator([)integer(1)operator(])operator(.)ident(categories)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(posts)operator([)integer(2)operator(])operator(.)ident(categories)operator(.)ident(size) - ident(assert) ident(posts)operator([)integer(0)operator(])operator(.)ident(categories)operator(.)ident(include?)operator(()ident(categories)operator(()symbol(:technology)operator(\))operator(\)) - ident(assert) ident(posts)operator([)integer(1)operator(])operator(.)ident(categories)operator(.)ident(include?)operator(()ident(categories)operator(()symbol(:general)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_eager_with_inheritance) - ident(posts) operator(=) constant(SpecialPost)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:comments) operator(])operator(\)) - reserved(end) - - reserved(def) method(test_eager_has_one_with_association_inheritance) - ident(post) operator(=) constant(Post)operator(.)ident(find)operator(()integer(4)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:very_special_comment) operator(])operator(\)) - ident(assert_equal) stringoperator(,) ident(post)operator(.)ident(very_special_comment)operator(.)ident(class)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_eager_has_many_with_association_inheritance) - ident(post) operator(=) constant(Post)operator(.)ident(find)operator(()integer(4)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:special_comments) operator(])operator(\)) - ident(post)operator(.)ident(special_comments)operator(.)ident(each) reserved(do) operator(|)ident(special_comment)operator(|) - ident(assert_equal) stringoperator(,) ident(special_comment)operator(.)ident(class)operator(.)ident(to_s) - reserved(end) - reserved(end) - - reserved(def) method(test_eager_habtm_with_association_inheritance) - ident(post) operator(=) constant(Post)operator(.)ident(find)operator(()integer(6)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:special_categories) operator(])operator(\)) - ident(assert_equal) integer(1)operator(,) ident(post)operator(.)ident(special_categories)operator(.)ident(size) - ident(post)operator(.)ident(special_categories)operator(.)ident(each) reserved(do) operator(|)ident(special_category)operator(|) - ident(assert_equal) stringoperator(,) ident(special_category)operator(.)ident(class)operator(.)ident(to_s) - reserved(end) - reserved(end) - - reserved(def) method(test_eager_with_has_one_dependent_does_not_destroy_dependent) - ident(assert_not_nil) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account) - ident(f) operator(=) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:include) operator(=)operator(>) symbol(:account)operator(,) - symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_not_nil) ident(f)operator(.)ident(account) - ident(assert_equal) ident(companies)operator(()symbol(:first_firm)operator(,) symbol(:reload)operator(\))operator(.)ident(account)operator(,) ident(f)operator(.)ident(account) - reserved(end) - - reserved(def) method(test_eager_with_invalid_association_reference) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(ConfigurationError)operator(,) string :monkeys)delimiter(")>operator(\)) operator({) - ident(post) operator(=) constant(Post)operator(.)ident(find)operator(()integer(6)operator(,) symbol(:include)operator(=)operator(>) symbol(:monkeys) operator(\)) - operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(ConfigurationError)operator(,) string :monkeys)delimiter(")>operator(\)) operator({) - ident(post) operator(=) constant(Post)operator(.)ident(find)operator(()integer(6)operator(,) symbol(:include)operator(=)operator(>)operator([) symbol(:monkeys) operator(])operator(\)) - operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(ConfigurationError)operator(,) string :monkeys)delimiter(")>operator(\)) operator({) - ident(post) operator(=) constant(Post)operator(.)ident(find)operator(()integer(6)operator(,) symbol(:include)operator(=)operator(>)operator([) string operator(])operator(\)) - operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(ConfigurationError)operator(,) string :monkeys, :elephants)delimiter(")>operator(\)) operator({) - ident(post) operator(=) constant(Post)operator(.)ident(find)operator(()integer(6)operator(,) symbol(:include)operator(=)operator(>)operator([) symbol(:monkeys)operator(,) symbol(:elephants) operator(])operator(\)) - operator(}) - reserved(end) - - reserved(def) method(find_all_ordered)operator(()ident(className)operator(,) ident(include)operator(=)pre_constant(nil)operator(\)) - ident(className)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order)operator(=)operator(>)stringcontent(.)inlinedelimiter(")>operator(,) symbol(:include)operator(=)operator(>)ident(include)operator(\)) - reserved(end) - - reserved(def) method(test_eager_with_multiple_associations_with_same_table_has_many_and_habtm) - comment(# Eager includes of has many and habtm associations aren't necessarily sorted in the same way) - reserved(def) method(assert_equal_after_sort)operator(()ident(item1)operator(,) ident(item2)operator(,) ident(item3) operator(=) pre_constant(nil)operator(\)) - ident(assert_equal)operator(()ident(item1)operator(.)ident(sort)operator({)operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(id) operator(<=>) ident(b)operator(.)ident(id)operator(})operator(,) ident(item2)operator(.)ident(sort)operator({)operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(id) operator(<=>) ident(b)operator(.)ident(id)operator(})operator(\)) - ident(assert_equal)operator(()ident(item3)operator(.)ident(sort)operator({)operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(id) operator(<=>) ident(b)operator(.)ident(id)operator(})operator(,) ident(item2)operator(.)ident(sort)operator({)operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(id) operator(<=>) ident(b)operator(.)ident(id)operator(})operator(\)) reserved(if) ident(item3) - reserved(end) - comment(# Test regular association, association with conditions, association with) - comment(# STI, and association with conditions assured not to be true) - ident(post_types) operator(=) operator([)symbol(:posts)operator(,) symbol(:hello_posts)operator(,) symbol(:special_posts)operator(,) symbol(:nonexistent_posts)operator(]) - comment(# test both has_many and has_and_belongs_to_many) - operator([)constant(Author)operator(,) constant(Category)operator(])operator(.)ident(each) reserved(do) operator(|)ident(className)operator(|) - ident(d1) operator(=) ident(find_all_ordered)operator(()ident(className)operator(\)) - comment(# test including all post types at once) - ident(d2) operator(=) ident(find_all_ordered)operator(()ident(className)operator(,) ident(post_types)operator(\)) - ident(d1)operator(.)ident(each_index) reserved(do) operator(|)ident(i)operator(|) - ident(assert_equal)operator(()ident(d1)operator([)ident(i)operator(])operator(,) ident(d2)operator([)ident(i)operator(])operator(\)) - ident(assert_equal_after_sort)operator(()ident(d1)operator([)ident(i)operator(])operator(.)ident(posts)operator(,) ident(d2)operator([)ident(i)operator(])operator(.)ident(posts)operator(\)) - ident(post_types)operator([)integer(1)operator(..)integer(-1)operator(])operator(.)ident(each) reserved(do) operator(|)ident(post_type)operator(|) - comment(# test including post_types together) - ident(d3) operator(=) ident(find_all_ordered)operator(()ident(className)operator(,) operator([)symbol(:posts)operator(,) ident(post_type)operator(])operator(\)) - ident(assert_equal)operator(()ident(d1)operator([)ident(i)operator(])operator(,) ident(d3)operator([)ident(i)operator(])operator(\)) - ident(assert_equal_after_sort)operator(()ident(d1)operator([)ident(i)operator(])operator(.)ident(posts)operator(,) ident(d3)operator([)ident(i)operator(])operator(.)ident(posts)operator(\)) - ident(assert_equal_after_sort)operator(()ident(d1)operator([)ident(i)operator(])operator(.)ident(send)operator(()ident(post_type)operator(\))operator(,) ident(d2)operator([)ident(i)operator(])operator(.)ident(send)operator(()ident(post_type)operator(\))operator(,) ident(d3)operator([)ident(i)operator(])operator(.)ident(send)operator(()ident(post_type)operator(\))operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_eager_with_multiple_associations_with_same_table_has_one) - ident(d1) operator(=) ident(find_all_ordered)operator(()constant(Firm)operator(\)) - ident(d2) operator(=) ident(find_all_ordered)operator(()constant(Firm)operator(,) symbol(:account)operator(\)) - ident(d1)operator(.)ident(each_index) reserved(do) operator(|)ident(i)operator(|) - ident(assert_equal)operator(()ident(d1)operator([)ident(i)operator(])operator(,) ident(d2)operator([)ident(i)operator(])operator(\)) - ident(assert_equal)operator(()ident(d1)operator([)ident(i)operator(])operator(.)ident(account)operator(,) ident(d2)operator([)ident(i)operator(])operator(.)ident(account)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_eager_with_multiple_associations_with_same_table_belongs_to) - ident(firm_types) operator(=) operator([)symbol(:firm)operator(,) symbol(:firm_with_basic_id)operator(,) symbol(:firm_with_other_name)operator(,) symbol(:firm_with_condition)operator(]) - ident(d1) operator(=) ident(find_all_ordered)operator(()constant(Client)operator(\)) - ident(d2) operator(=) ident(find_all_ordered)operator(()constant(Client)operator(,) ident(firm_types)operator(\)) - ident(d1)operator(.)ident(each_index) reserved(do) operator(|)ident(i)operator(|) - ident(assert_equal)operator(()ident(d1)operator([)ident(i)operator(])operator(,) ident(d2)operator([)ident(i)operator(])operator(\)) - ident(firm_types)operator(.)ident(each) operator({) operator(|)ident(type)operator(|) ident(assert_equal)operator(()ident(d1)operator([)ident(i)operator(])operator(.)ident(send)operator(()ident(type)operator(\))operator(,) ident(d2)operator([)ident(i)operator(])operator(.)ident(send)operator(()ident(type)operator(\))operator(\)) operator(}) - reserved(end) - reserved(end) - reserved(def) method(test_eager_with_valid_association_as_string_not_symbol) - ident(assert_nothing_raised) operator({) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) stringoperator(\)) operator(}) - reserved(end) - - reserved(def) method(test_preconfigured_includes_with_belongs_to) - ident(author) operator(=) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(author_with_posts) - ident(assert_equal) integer(5)operator(,) ident(author)operator(.)ident(posts)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_preconfigured_includes_with_has_one) - ident(comment) operator(=) ident(posts)operator(()symbol(:sti_comments)operator(\))operator(.)ident(very_special_comment_with_post) - ident(assert_equal) ident(posts)operator(()symbol(:sti_comments)operator(\))operator(,) ident(comment)operator(.)ident(post) - reserved(end) - - reserved(def) method(test_preconfigured_includes_with_has_many) - ident(posts) operator(=) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(posts_with_comments) - ident(one) operator(=) ident(posts)operator(.)ident(detect) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(id) operator(==) integer(1) operator(}) - ident(assert_equal) integer(5)operator(,) ident(posts)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(one)operator(.)ident(comments)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_preconfigured_includes_with_habtm) - ident(posts) operator(=) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(posts_with_categories) - ident(one) operator(=) ident(posts)operator(.)ident(detect) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(id) operator(==) integer(1) operator(}) - ident(assert_equal) integer(5)operator(,) ident(posts)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(one)operator(.)ident(categories)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_preconfigured_includes_with_has_many_and_habtm) - ident(posts) operator(=) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(posts_with_comments_and_categories) - ident(one) operator(=) ident(posts)operator(.)ident(detect) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(id) operator(==) integer(1) operator(}) - ident(assert_equal) integer(5)operator(,) ident(posts)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(one)operator(.)ident(comments)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(one)operator(.)ident(categories)operator(.)ident(size) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(AssociationsJoinModelTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(false) - ident(fixtures) symbol(:posts)operator(,) symbol(:authors)operator(,) symbol(:categories)operator(,) symbol(:categorizations)operator(,) symbol(:comments)operator(,) symbol(:tags)operator(,) symbol(:taggings)operator(,) symbol(:author_favorites) - - reserved(def) method(test_has_many) - ident(assert_equal) ident(categories)operator(()symbol(:general)operator(\))operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(categories)operator(.)ident(first) - reserved(end) - - reserved(def) method(test_has_many_inherited) - ident(assert_equal) ident(categories)operator(()symbol(:sti_test)operator(\))operator(,) ident(authors)operator(()symbol(:mary)operator(\))operator(.)ident(categories)operator(.)ident(first) - reserved(end) - - reserved(def) method(test_inherited_has_many) - ident(assert_equal) ident(authors)operator(()symbol(:mary)operator(\))operator(,) ident(categories)operator(()symbol(:sti_test)operator(\))operator(.)ident(authors)operator(.)ident(first) - reserved(end) - - reserved(def) method(test_polymorphic_has_many) - ident(assert_equal) ident(taggings)operator(()symbol(:welcome_general)operator(\))operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(first) - reserved(end) - - reserved(def) method(test_polymorphic_has_one) - ident(assert_equal) ident(taggings)operator(()symbol(:welcome_general)operator(\))operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tagging) - reserved(end) - - reserved(def) method(test_polymorphic_belongs_to) - ident(assert_equal) ident(posts)operator(()symbol(:welcome)operator(\))operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(first)operator(.)ident(taggable) - reserved(end) - - reserved(def) method(test_polymorphic_has_many_going_through_join_model) - ident(assert_equal) ident(tags)operator(()symbol(:general)operator(\))operator(,) ident(tag) operator(=) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tags)operator(.)ident(first) - ident(assert_no_queries) reserved(do) - ident(tag)operator(.)ident(tagging) - reserved(end) - reserved(end) - - reserved(def) method(test_count_polymorphic_has_many) - ident(assert_equal) integer(1)operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(count) - ident(assert_equal) integer(1)operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tags)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_polymorphic_has_many_going_through_join_model_with_find) - ident(assert_equal) ident(tags)operator(()symbol(:general)operator(\))operator(,) ident(tag) operator(=) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tags)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(assert_no_queries) reserved(do) - ident(tag)operator(.)ident(tagging) - reserved(end) - reserved(end) - - reserved(def) method(test_polymorphic_has_many_going_through_join_model_with_include_on_source_reflection) - ident(assert_equal) ident(tags)operator(()symbol(:general)operator(\))operator(,) ident(tag) operator(=) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(funky_tags)operator(.)ident(first) - ident(assert_no_queries) reserved(do) - ident(tag)operator(.)ident(tagging) - reserved(end) - reserved(end) - - reserved(def) method(test_polymorphic_has_many_going_through_join_model_with_include_on_source_reflection_with_find) - ident(assert_equal) ident(tags)operator(()symbol(:general)operator(\))operator(,) ident(tag) operator(=) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(funky_tags)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(assert_no_queries) reserved(do) - ident(tag)operator(.)ident(tagging) - reserved(end) - reserved(end) - - reserved(def) method(test_polymorphic_has_many_going_through_join_model_with_disabled_include) - ident(assert_equal) ident(tags)operator(()symbol(:general)operator(\))operator(,) ident(tag) operator(=) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tags)operator(.)ident(add_joins_and_select)operator(.)ident(first) - ident(assert_queries) integer(1) reserved(do) - ident(tag)operator(.)ident(tagging) - reserved(end) - reserved(end) - - reserved(def) method(test_polymorphic_has_many_going_through_join_model_with_custom_select_and_joins) - ident(assert_equal) ident(tags)operator(()symbol(:general)operator(\))operator(,) ident(tag) operator(=) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tags)operator(.)ident(add_joins_and_select)operator(.)ident(first) - ident(tag)operator(.)ident(author_id) - reserved(end) - - reserved(def) method(test_polymorphic_has_many_going_through_join_model_with_custom_foreign_key) - ident(assert_equal) ident(tags)operator(()symbol(:misc)operator(\))operator(,) ident(taggings)operator(()symbol(:welcome_general)operator(\))operator(.)ident(super_tag) - ident(assert_equal) ident(tags)operator(()symbol(:misc)operator(\))operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(super_tags)operator(.)ident(first) - reserved(end) - - reserved(def) method(test_polymorphic_has_many_create_model_with_inheritance_and_custom_base_class) - ident(post) operator(=) constant(SubStiPost)operator(.)ident(create) symbol(:title) operator(=)operator(>) stringoperator(,) symbol(:body) operator(=)operator(>) string - ident(assert_instance_of) constant(SubStiPost)operator(,) ident(post) - - ident(tagging) operator(=) ident(tags)operator(()symbol(:misc)operator(\))operator(.)ident(taggings)operator(.)ident(create)operator(()symbol(:taggable) operator(=)operator(>) ident(post)operator(\)) - ident(assert_equal) stringoperator(,) ident(tagging)operator(.)ident(taggable_type) - reserved(end) - - reserved(def) method(test_polymorphic_has_many_going_through_join_model_with_inheritance) - ident(assert_equal) ident(tags)operator(()symbol(:general)operator(\))operator(,) ident(posts)operator(()symbol(:thinking)operator(\))operator(.)ident(tags)operator(.)ident(first) - reserved(end) - - reserved(def) method(test_polymorphic_has_many_going_through_join_model_with_inheritance_with_custom_class_name) - ident(assert_equal) ident(tags)operator(()symbol(:general)operator(\))operator(,) ident(posts)operator(()symbol(:thinking)operator(\))operator(.)ident(funky_tags)operator(.)ident(first) - reserved(end) - - reserved(def) method(test_polymorphic_has_many_create_model_with_inheritance) - ident(post) operator(=) ident(posts)operator(()symbol(:thinking)operator(\)) - ident(assert_instance_of) constant(SpecialPost)operator(,) ident(post) - - ident(tagging) operator(=) ident(tags)operator(()symbol(:misc)operator(\))operator(.)ident(taggings)operator(.)ident(create)operator(()symbol(:taggable) operator(=)operator(>) ident(post)operator(\)) - ident(assert_equal) stringoperator(,) ident(tagging)operator(.)ident(taggable_type) - reserved(end) - - reserved(def) method(test_polymorphic_has_one_create_model_with_inheritance) - ident(tagging) operator(=) ident(tags)operator(()symbol(:misc)operator(\))operator(.)ident(create_tagging)operator(()symbol(:taggable) operator(=)operator(>) ident(posts)operator(()symbol(:thinking)operator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(tagging)operator(.)ident(taggable_type) - reserved(end) - - reserved(def) method(test_set_polymorphic_has_many) - ident(tagging) operator(=) ident(tags)operator(()symbol(:misc)operator(\))operator(.)ident(taggings)operator(.)ident(create) - ident(posts)operator(()symbol(:thinking)operator(\))operator(.)ident(taggings) operator(<<) ident(tagging) - ident(assert_equal) stringoperator(,) ident(tagging)operator(.)ident(taggable_type) - reserved(end) - - reserved(def) method(test_set_polymorphic_has_one) - ident(tagging) operator(=) ident(tags)operator(()symbol(:misc)operator(\))operator(.)ident(taggings)operator(.)ident(create) - ident(posts)operator(()symbol(:thinking)operator(\))operator(.)ident(tagging) operator(=) ident(tagging) - ident(assert_equal) stringoperator(,) ident(tagging)operator(.)ident(taggable_type) - reserved(end) - - reserved(def) method(test_create_polymorphic_has_many_with_scope) - ident(old_count) operator(=) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(count) - ident(tagging) operator(=) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(create)operator(()symbol(:tag) operator(=)operator(>) ident(tags)operator(()symbol(:misc)operator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(tagging)operator(.)ident(taggable_type) - ident(assert_equal) ident(old_count)operator(+)integer(1)operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_create_polymorphic_has_one_with_scope) - ident(old_count) operator(=) constant(Tagging)operator(.)ident(count) - ident(tagging) operator(=) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tagging)operator(.)ident(create)operator(()symbol(:tag) operator(=)operator(>) ident(tags)operator(()symbol(:misc)operator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(tagging)operator(.)ident(taggable_type) - ident(assert_equal) ident(old_count)operator(+)integer(1)operator(,) constant(Tagging)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_delete_polymorphic_has_many_with_delete_all) - ident(assert_equal) integer(1)operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(count) - ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(first)operator(.)ident(update_attribute) symbol(:taggable_type)operator(,) string - ident(post) operator(=) ident(find_post_with_dependency)operator(()integer(1)operator(,) symbol(:has_many)operator(,) symbol(:taggings)operator(,) symbol(:delete_all)operator(\)) - - ident(old_count) operator(=) constant(Tagging)operator(.)ident(count) - ident(post)operator(.)ident(destroy) - ident(assert_equal) ident(old_count)operator(-)integer(1)operator(,) constant(Tagging)operator(.)ident(count) - ident(assert_equal) integer(0)operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_delete_polymorphic_has_many_with_destroy) - ident(assert_equal) integer(1)operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(count) - ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(first)operator(.)ident(update_attribute) symbol(:taggable_type)operator(,) string - ident(post) operator(=) ident(find_post_with_dependency)operator(()integer(1)operator(,) symbol(:has_many)operator(,) symbol(:taggings)operator(,) symbol(:destroy)operator(\)) - - ident(old_count) operator(=) constant(Tagging)operator(.)ident(count) - ident(post)operator(.)ident(destroy) - ident(assert_equal) ident(old_count)operator(-)integer(1)operator(,) constant(Tagging)operator(.)ident(count) - ident(assert_equal) integer(0)operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_delete_polymorphic_has_many_with_nullify) - ident(assert_equal) integer(1)operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(count) - ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(first)operator(.)ident(update_attribute) symbol(:taggable_type)operator(,) string - ident(post) operator(=) ident(find_post_with_dependency)operator(()integer(1)operator(,) symbol(:has_many)operator(,) symbol(:taggings)operator(,) symbol(:nullify)operator(\)) - - ident(old_count) operator(=) constant(Tagging)operator(.)ident(count) - ident(post)operator(.)ident(destroy) - ident(assert_equal) ident(old_count)operator(,) constant(Tagging)operator(.)ident(count) - ident(assert_equal) integer(0)operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_delete_polymorphic_has_one_with_destroy) - ident(assert) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tagging) - ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tagging)operator(.)ident(update_attribute) symbol(:taggable_type)operator(,) string - ident(post) operator(=) ident(find_post_with_dependency)operator(()integer(1)operator(,) symbol(:has_one)operator(,) symbol(:tagging)operator(,) symbol(:destroy)operator(\)) - - ident(old_count) operator(=) constant(Tagging)operator(.)ident(count) - ident(post)operator(.)ident(destroy) - ident(assert_equal) ident(old_count)operator(-)integer(1)operator(,) constant(Tagging)operator(.)ident(count) - ident(assert_nil) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tagging)operator(()pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_delete_polymorphic_has_one_with_nullify) - ident(assert) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tagging) - ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tagging)operator(.)ident(update_attribute) symbol(:taggable_type)operator(,) string - ident(post) operator(=) ident(find_post_with_dependency)operator(()integer(1)operator(,) symbol(:has_one)operator(,) symbol(:tagging)operator(,) symbol(:nullify)operator(\)) - - ident(old_count) operator(=) constant(Tagging)operator(.)ident(count) - ident(post)operator(.)ident(destroy) - ident(assert_equal) ident(old_count)operator(,) constant(Tagging)operator(.)ident(count) - ident(assert_nil) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(tagging)operator(()pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_has_many_with_piggyback) - ident(assert_equal) stringoperator(,) ident(categories)operator(()symbol(:sti_test)operator(\))operator(.)ident(authors)operator(.)ident(first)operator(.)ident(post_id)operator(.)ident(to_s) - reserved(end) - - reserved(def) method(test_include_has_many_through) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(posts_with_authors) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:authors)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(posts)operator(.)ident(length)operator(,) ident(posts_with_authors)operator(.)ident(length) - ident(posts)operator(.)ident(length)operator(.)ident(times) reserved(do) operator(|)ident(i)operator(|) - ident(assert_equal) ident(posts)operator([)ident(i)operator(])operator(.)ident(authors)operator(.)ident(length)operator(,) ident(assert_no_queries) operator({) ident(posts_with_authors)operator([)ident(i)operator(])operator(.)ident(authors)operator(.)ident(length) operator(}) - reserved(end) - reserved(end) - - reserved(def) method(test_include_polymorphic_has_one) - ident(post) operator(=) constant(Post)operator(.)ident(find_by_id)operator(()ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(id)operator(,) symbol(:include) operator(=)operator(>) symbol(:tagging)operator(\)) - ident(tagging) operator(=) ident(taggings)operator(()symbol(:welcome_general)operator(\)) - ident(assert_no_queries) reserved(do) - ident(assert_equal) ident(tagging)operator(,) ident(post)operator(.)ident(tagging) - reserved(end) - reserved(end) - - reserved(def) method(test_include_polymorphic_has_many_through) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(posts_with_tags) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:tags)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(posts)operator(.)ident(length)operator(,) ident(posts_with_tags)operator(.)ident(length) - ident(posts)operator(.)ident(length)operator(.)ident(times) reserved(do) operator(|)ident(i)operator(|) - ident(assert_equal) ident(posts)operator([)ident(i)operator(])operator(.)ident(tags)operator(.)ident(length)operator(,) ident(assert_no_queries) operator({) ident(posts_with_tags)operator([)ident(i)operator(])operator(.)ident(tags)operator(.)ident(length) operator(}) - reserved(end) - reserved(end) - - reserved(def) method(test_include_polymorphic_has_many) - ident(posts) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(posts_with_taggings) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:taggings)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(posts)operator(.)ident(length)operator(,) ident(posts_with_taggings)operator(.)ident(length) - ident(posts)operator(.)ident(length)operator(.)ident(times) reserved(do) operator(|)ident(i)operator(|) - ident(assert_equal) ident(posts)operator([)ident(i)operator(])operator(.)ident(taggings)operator(.)ident(length)operator(,) ident(assert_no_queries) operator({) ident(posts_with_taggings)operator([)ident(i)operator(])operator(.)ident(taggings)operator(.)ident(length) operator(}) - reserved(end) - reserved(end) - - reserved(def) method(test_has_many_find_all) - ident(assert_equal) operator([)ident(categories)operator(()symbol(:general)operator(\))operator(])operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(categories)operator(.)ident(find)operator(()symbol(:all)operator(\)) - reserved(end) - - reserved(def) method(test_has_many_find_first) - ident(assert_equal) ident(categories)operator(()symbol(:general)operator(\))operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(categories)operator(.)ident(find)operator(()symbol(:first)operator(\)) - reserved(end) - - reserved(def) method(test_has_many_find_conditions) - ident(assert_equal) ident(categories)operator(()symbol(:general)operator(\))operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(categories)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) pre_constant(nil)operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(categories)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_has_many_class_methods_called_by_method_missing) - ident(assert_equal) ident(categories)operator(()symbol(:general)operator(\))operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(categories)operator(.)ident(find_all_by_name)operator(()stringoperator(\))operator(.)ident(first) -comment(# assert_equal nil, authors(:david\).categories.find_by_name('Technology'\)) - reserved(end) - - reserved(def) method(test_has_many_going_through_join_model_with_custom_foreign_key) - ident(assert_equal) operator([)operator(])operator(,) ident(posts)operator(()symbol(:thinking)operator(\))operator(.)ident(authors) - ident(assert_equal) operator([)ident(authors)operator(()symbol(:mary)operator(\))operator(])operator(,) ident(posts)operator(()symbol(:authorless)operator(\))operator(.)ident(authors) - reserved(end) - - reserved(def) method(test_belongs_to_polymorphic_with_counter_cache) - ident(assert_equal) integer(0)operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator([)symbol(:taggings_count)operator(]) - ident(tagging) operator(=) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(taggings)operator(.)ident(create)operator(()symbol(:tag) operator(=)operator(>) ident(tags)operator(()symbol(:general)operator(\))operator(\)) - ident(assert_equal) integer(1)operator(,) ident(posts)operator(()symbol(:welcome)operator(,) symbol(:reload)operator(\))operator([)symbol(:taggings_count)operator(]) - ident(tagging)operator(.)ident(destroy) - ident(assert) ident(posts)operator(()symbol(:welcome)operator(,) symbol(:reload)operator(\))operator([)symbol(:taggings_count)operator(])operator(.)ident(zero?) - reserved(end) - - reserved(def) method(test_unavailable_through_reflection) - ident(assert_raises) operator(()constant(ActiveRecord)operator(::)constant(HasManyThroughAssociationNotFoundError)operator(\)) operator({) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(nothings) operator(}) - reserved(end) - - reserved(def) method(test_has_many_through_join_model_with_conditions) - ident(assert_equal) operator([)operator(])operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(invalid_taggings) - ident(assert_equal) operator([)operator(])operator(,) ident(posts)operator(()symbol(:welcome)operator(\))operator(.)ident(invalid_tags) - reserved(end) - - reserved(def) method(test_has_many_polymorphic) - ident(assert_raises) constant(ActiveRecord)operator(::)constant(HasManyThroughAssociationPolymorphicError) reserved(do) - ident(assert_equal) operator([)ident(posts)operator(()symbol(:welcome)operator(\))operator(,) ident(posts)operator(()symbol(:thinking)operator(\))operator(])operator(,) ident(tags)operator(()symbol(:general)operator(\))operator(.)ident(taggables) - reserved(end) - ident(assert_raises) constant(ActiveRecord)operator(::)constant(EagerLoadPolymorphicError) reserved(do) - ident(assert_equal) operator([)ident(posts)operator(()symbol(:welcome)operator(\))operator(,) ident(posts)operator(()symbol(:thinking)operator(\))operator(])operator(,) ident(tags)operator(()symbol(:general)operator(\))operator(.)ident(taggings)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) symbol(:taggable)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_has_many_through_has_many_find_all) - ident(assert_equal) ident(comments)operator(()symbol(:greetings)operator(\))operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(comments)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\))operator(.)ident(first) - reserved(end) - - reserved(def) method(test_has_many_through_has_many_find_all_with_custom_class) - ident(assert_equal) ident(comments)operator(()symbol(:greetings)operator(\))operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(funky_comments)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\))operator(.)ident(first) - reserved(end) - - reserved(def) method(test_has_many_through_has_many_find_first) - ident(assert_equal) ident(comments)operator(()symbol(:greetings)operator(\))operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(comments)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_has_many_through_has_many_find_conditions) - ident(assert_equal) ident(comments)operator(()symbol(:does_it_hurt)operator(\))operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(comments)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_has_many_through_has_many_find_by_id) - ident(assert_equal) ident(comments)operator(()symbol(:more_greetings)operator(\))operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(comments)operator(.)ident(find)operator(()integer(2)operator(\)) - reserved(end) - - reserved(def) method(test_has_many_through_polymorphic_has_one) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(HasManyThroughSourceAssociationMacroError)operator(\)) operator({) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(tagging) operator(}) - reserved(end) - - reserved(def) method(test_has_many_through_polymorphic_has_many) - ident(assert_equal) operator([)ident(taggings)operator(()symbol(:welcome_general)operator(\))operator(,) ident(taggings)operator(()symbol(:thinking_general)operator(\))operator(])operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(taggings)operator(.)ident(uniq)operator(.)ident(sort_by) operator({) operator(|)ident(t)operator(|) ident(t)operator(.)ident(id) operator(}) - reserved(end) - - reserved(def) method(test_include_has_many_through_polymorphic_has_many) - ident(author) operator(=) constant(Author)operator(.)ident(find_by_id)operator(()ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(id)operator(,) symbol(:include) operator(=)operator(>) symbol(:taggings)operator(\)) - ident(expected_taggings) operator(=) operator([)ident(taggings)operator(()symbol(:welcome_general)operator(\))operator(,) ident(taggings)operator(()symbol(:thinking_general)operator(\))operator(]) - ident(assert_no_queries) reserved(do) - ident(assert_equal) ident(expected_taggings)operator(,) ident(author)operator(.)ident(taggings)operator(.)ident(uniq)operator(.)ident(sort_by) operator({) operator(|)ident(t)operator(|) ident(t)operator(.)ident(id) operator(}) - reserved(end) - reserved(end) - - reserved(def) method(test_has_many_through_has_many_through) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(HasManyThroughSourceAssociationMacroError)operator(\)) operator({) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(tags) operator(}) - reserved(end) - - reserved(def) method(test_has_many_through_habtm) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(HasManyThroughSourceAssociationMacroError)operator(\)) operator({) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(post_categories) operator(}) - reserved(end) - - reserved(def) method(test_eager_load_has_many_through_has_many) - ident(author) operator(=) constant(Author)operator(.)ident(find) symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(,) symbol(:include) operator(=)operator(>) symbol(:comments)operator(,) symbol(:order) operator(=)operator(>) string - constant(SpecialComment)operator(.)ident(new)operator(;) constant(VerySpecialComment)operator(.)ident(new) - ident(assert_no_queries) reserved(do) - ident(assert_equal) operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(,)integer(9)operator(,)integer(10)operator(])operator(,) ident(author)operator(.)ident(comments)operator(.)ident(collect)operator(()operator(&)symbol(:id)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_eager_belongs_to_and_has_one_not_singularized) - ident(assert_nothing_raised) reserved(do) - constant(Author)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:include) operator(=)operator(>) symbol(:author_address)operator(\)) - constant(AuthorAddress)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:include) operator(=)operator(>) symbol(:author)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_self_referential_has_many_through) - ident(assert_equal) operator([)ident(authors)operator(()symbol(:mary)operator(\))operator(])operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(favorite_authors) - ident(assert_equal) operator([)operator(])operator(,) ident(authors)operator(()symbol(:mary)operator(\))operator(.)ident(favorite_authors) - reserved(end) - - reserved(def) method(test_add_to_self_referential_has_many_through) - ident(new_author) operator(=) constant(Author)operator(.)ident(create)operator(()symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(author_favorites)operator(.)ident(create) symbol(:favorite_author) operator(=)operator(>) ident(new_author) - ident(assert_equal) ident(new_author)operator(,) ident(authors)operator(()symbol(:david)operator(\))operator(.)ident(reload)operator(.)ident(favorite_authors)operator(.)ident(first) - reserved(end) - - reserved(def) method(test_has_many_through_uses_correct_attributes) - ident(assert_nil) ident(posts)operator(()symbol(:thinking)operator(\))operator(.)ident(tags)operator(.)ident(find_by_name)operator(()stringoperator(\))operator(.)ident(attributes)operator([)stringoperator(]) - reserved(end) - - ident(private) - comment(# create dynamic Post models to allow different dependency options) - reserved(def) method(find_post_with_dependency)operator(()ident(post_id)operator(,) ident(association)operator(,) ident(association_name)operator(,) ident(dependency)operator(\)) - ident(class_name) operator(=) stringinlinedelimiter(")> - constant(Post)operator(.)ident(find)operator(()ident(post_id)operator(\))operator(.)ident(update_attribute) symbol(:type)operator(,) ident(class_name) - ident(klass) operator(=) constant(Object)operator(.)ident(const_set)operator(()ident(class_name)operator(,) constant(Class)operator(.)ident(new)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(\))operator(\)) - ident(klass)operator(.)ident(set_table_name) string - ident(klass)operator(.)ident(send)operator(()ident(association)operator(,) ident(association_name)operator(,) symbol(:as) operator(=)operator(>) symbol(:taggable)operator(,) symbol(:dependent) operator(=)operator(>) ident(dependency)operator(\)) - ident(klass)operator(.)ident(find)operator(()ident(post_id)operator(\)) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -comment(# Can't declare new classes in test case methods, so tests before that) -ident(bad_collection_keys) operator(=) pre_constant(false) -reserved(begin) - reserved(class) class(Car) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) ident(has_many) symbol(:wheels)operator(,) symbol(:name) operator(=)operator(>) stringoperator(;) reserved(end) -reserved(rescue) constant(ArgumentError) - ident(bad_collection_keys) operator(=) pre_constant(true) -reserved(end) -ident(raise) string reserved(unless) ident(bad_collection_keys) - - -reserved(class) class(AssociationsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:accounts)operator(,) symbol(:companies)operator(,) symbol(:developers)operator(,) symbol(:projects)operator(,) symbol(:developers_projects)operator(,) - symbol(:computers) - - reserved(def) method(test_force_reload) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(save) - ident(firm)operator(.)ident(clients)operator(.)ident(each) operator({)operator(|)ident(c)operator(|)operator(}) comment(# forcing to load all clients) - ident(assert) ident(firm)operator(.)ident(clients)operator(.)ident(empty?)operator(,) string - ident(assert) operator(!)ident(firm)operator(.)ident(has_clients?)operator(,) string - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(size)operator(,) string - - ident(client) operator(=) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(firm)operator(.)ident(id)operator(\)) - ident(client)operator(.)ident(save) - - ident(assert) ident(firm)operator(.)ident(clients)operator(.)ident(empty?)operator(,) string - ident(assert) operator(!)ident(firm)operator(.)ident(has_clients?)operator(,) string - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(size)operator(,) string - - ident(assert) operator(!)ident(firm)operator(.)ident(clients)operator(()pre_constant(true)operator(\))operator(.)ident(empty?)operator(,) string - ident(assert_equal) integer(1)operator(,) ident(firm)operator(.)ident(clients)operator(()pre_constant(true)operator(\))operator(.)ident(size)operator(,) string - reserved(end) - - reserved(def) method(test_storing_in_pstore) - ident(require) string - ident(store_filename) operator(=) constant(File)operator(.)ident(join)operator(()constant(Dir)operator(.)ident(tmpdir)operator(,) stringoperator(\)) - constant(File)operator(.)ident(delete)operator(()ident(store_filename)operator(\)) reserved(if) constant(File)operator(.)ident(exists?)operator(()ident(store_filename)operator(\)) - ident(require) string - ident(apple) operator(=) constant(Firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(natural) operator(=) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(apple)operator(.)ident(clients) operator(<<) ident(natural) - - ident(db) operator(=) constant(PStore)operator(.)ident(new)operator(()ident(store_filename)operator(\)) - ident(db)operator(.)ident(transaction) reserved(do) - ident(db)operator([)stringoperator(]) operator(=) ident(apple) - reserved(end) - - ident(db) operator(=) constant(PStore)operator(.)ident(new)operator(()ident(store_filename)operator(\)) - ident(db)operator(.)ident(transaction) reserved(do) - ident(assert_equal) stringoperator(,) ident(db)operator([)stringoperator(])operator(.)ident(clients)operator(.)ident(first)operator(.)ident(name) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(HasOneAssociationsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:accounts)operator(,) symbol(:companies)operator(,) symbol(:developers)operator(,) symbol(:projects)operator(,) symbol(:developers_projects) - - reserved(def) method(test_has_one) - ident(assert_equal) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account)operator(,) constant(Account)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) constant(Account)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(credit_limit)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account)operator(.)ident(credit_limit) - reserved(end) - - reserved(def) method(test_proxy_assignment) - ident(company) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\)) - ident(assert_nothing_raised) operator({) ident(company)operator(.)ident(account) operator(=) ident(company)operator(.)ident(account) operator(}) - reserved(end) - - reserved(def) method(test_triple_equality) - ident(assert) constant(Account) operator(===) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account) - ident(assert) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account) operator(===) constant(Account) - reserved(end) - - reserved(def) method(test_type_mismatch) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(\)) operator({) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account) operator(=) integer(1) operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(\)) operator({) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account) operator(=) constant(Project)operator(.)ident(find)operator(()integer(1)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_natural_assignment) - ident(apple) operator(=) constant(Firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(citibank) operator(=) constant(Account)operator(.)ident(create)operator(()string operator(=)operator(>) integer(10)operator(\)) - ident(apple)operator(.)ident(account) operator(=) ident(citibank) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(citibank)operator(.)ident(firm_id) - reserved(end) - - reserved(def) method(test_natural_assignment_to_nil) - ident(old_account_id) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account)operator(.)ident(id) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account) operator(=) pre_constant(nil) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(save) - ident(assert_nil) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account) - comment(# account is dependent, therefore is destroyed when reference to owner is lost) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) constant(Account)operator(.)ident(find)operator(()ident(old_account_id)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_assignment_without_replacement) - ident(apple) operator(=) constant(Firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(citibank) operator(=) constant(Account)operator(.)ident(create)operator(()string operator(=)operator(>) integer(10)operator(\)) - ident(apple)operator(.)ident(account) operator(=) ident(citibank) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(citibank)operator(.)ident(firm_id) - - ident(hsbc) operator(=) ident(apple)operator(.)ident(build_account)operator(()operator({) symbol(:credit_limit) operator(=)operator(>) integer(20)operator(})operator(,) pre_constant(false)operator(\)) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(hsbc)operator(.)ident(firm_id) - ident(hsbc)operator(.)ident(save) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(citibank)operator(.)ident(firm_id) - - ident(nykredit) operator(=) ident(apple)operator(.)ident(create_account)operator(()operator({) symbol(:credit_limit) operator(=)operator(>) integer(30)operator(})operator(,) pre_constant(false)operator(\)) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(nykredit)operator(.)ident(firm_id) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(citibank)operator(.)ident(firm_id) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(hsbc)operator(.)ident(firm_id) - reserved(end) - - reserved(def) method(test_assignment_without_replacement_on_create) - ident(apple) operator(=) constant(Firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(citibank) operator(=) constant(Account)operator(.)ident(create)operator(()string operator(=)operator(>) integer(10)operator(\)) - ident(apple)operator(.)ident(account) operator(=) ident(citibank) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(citibank)operator(.)ident(firm_id) - - ident(hsbc) operator(=) ident(apple)operator(.)ident(create_account)operator(()operator({)symbol(:credit_limit) operator(=)operator(>) integer(10)operator(})operator(,) pre_constant(false)operator(\)) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(hsbc)operator(.)ident(firm_id) - ident(hsbc)operator(.)ident(save) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(citibank)operator(.)ident(firm_id) - reserved(end) - - reserved(def) method(test_dependence) - ident(num_accounts) operator(=) constant(Account)operator(.)ident(count) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) operator(!)ident(firm)operator(.)ident(account)operator(.)ident(nil?) - ident(firm)operator(.)ident(destroy) - ident(assert_equal) ident(num_accounts) operator(-) integer(1)operator(,) constant(Account)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_succesful_build_association) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(save) - - ident(account) operator(=) ident(firm)operator(.)ident(build_account)operator(()string operator(=)operator(>) integer(1000)operator(\)) - ident(assert) ident(account)operator(.)ident(save) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - reserved(end) - - reserved(def) method(test_failing_build_association) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(save) - - ident(account) operator(=) ident(firm)operator(.)ident(build_account) - ident(assert) operator(!)ident(account)operator(.)ident(save) - ident(assert_equal) stringoperator(,) ident(account)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_build_association_twice_without_saving_affects_nothing) - ident(count_of_account) operator(=) constant(Account)operator(.)ident(count) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(account1) operator(=) ident(firm)operator(.)ident(build_account)operator(()string operator(=)operator(>) integer(1000)operator(\)) - ident(account2) operator(=) ident(firm)operator(.)ident(build_account)operator(()string operator(=)operator(>) integer(2000)operator(\)) - - ident(assert_equal) ident(count_of_account)operator(,) constant(Account)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_create_association) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(save) - ident(assert_equal) ident(firm)operator(.)ident(create_account)operator(()string operator(=)operator(>) integer(1000)operator(\))operator(,) ident(firm)operator(.)ident(account) - reserved(end) - - reserved(def) method(test_build) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(save) - - ident(firm)operator(.)ident(account) operator(=) ident(account) operator(=) constant(Account)operator(.)ident(new)operator(()string operator(=)operator(>) integer(1000)operator(\)) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - ident(assert) ident(account)operator(.)ident(save) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - reserved(end) - - reserved(def) method(test_build_before_child_saved) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\)) - - ident(account) operator(=) ident(firm)operator(.)ident(account)operator(.)ident(build)operator(()string operator(=)operator(>) integer(1000)operator(\)) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - ident(assert) ident(account)operator(.)ident(new_record?) - ident(assert) ident(firm)operator(.)ident(save) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - ident(assert) operator(!)ident(account)operator(.)ident(new_record?) - reserved(end) - - reserved(def) method(test_build_before_either_saved) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - - ident(firm)operator(.)ident(account) operator(=) ident(account) operator(=) constant(Account)operator(.)ident(new)operator(()string operator(=)operator(>) integer(1000)operator(\)) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - ident(assert) ident(account)operator(.)ident(new_record?) - ident(assert) ident(firm)operator(.)ident(save) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - ident(assert) operator(!)ident(account)operator(.)ident(new_record?) - reserved(end) - - reserved(def) method(test_failing_build_association) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(save) - - ident(firm)operator(.)ident(account) operator(=) ident(account) operator(=) constant(Account)operator(.)ident(new) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - ident(assert) operator(!)ident(account)operator(.)ident(save) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - ident(assert_equal) stringoperator(,) ident(account)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_create) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(save) - ident(firm)operator(.)ident(account) operator(=) ident(account) operator(=) constant(Account)operator(.)ident(create)operator(()string operator(=)operator(>) integer(1000)operator(\)) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - reserved(end) - - reserved(def) method(test_create_before_save) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(account) operator(=) ident(account) operator(=) constant(Account)operator(.)ident(create)operator(()string operator(=)operator(>) integer(1000)operator(\)) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - reserved(end) - - reserved(def) method(test_dependence_with_missing_association) - constant(Account)operator(.)ident(destroy_all) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) ident(firm)operator(.)ident(account)operator(.)ident(nil?) - ident(firm)operator(.)ident(destroy) - reserved(end) - - reserved(def) method(test_assignment_before_parent_saved) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(account) operator(=) ident(a) operator(=) constant(Account)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) ident(firm)operator(.)ident(new_record?) - ident(assert_equal) ident(a)operator(,) ident(firm)operator(.)ident(account) - ident(assert) ident(firm)operator(.)ident(save) - ident(assert_equal) ident(a)operator(,) ident(firm)operator(.)ident(account) - ident(assert_equal) ident(a)operator(,) ident(firm)operator(.)ident(account)operator(()pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_assignment_before_child_saved) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(firm)operator(.)ident(account) operator(=) ident(a) operator(=) constant(Account)operator(.)ident(new)operator(()string operator(=)operator(>) integer(1000)operator(\)) - ident(assert) operator(!)ident(a)operator(.)ident(new_record?) - ident(assert_equal) ident(a)operator(,) ident(firm)operator(.)ident(account) - ident(assert_equal) ident(a)operator(,) ident(firm)operator(.)ident(account) - ident(assert_equal) ident(a)operator(,) ident(firm)operator(.)ident(account)operator(()pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_assignment_before_either_saved) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(account) operator(=) ident(a) operator(=) constant(Account)operator(.)ident(new)operator(()string operator(=)operator(>) integer(1000)operator(\)) - ident(assert) ident(firm)operator(.)ident(new_record?) - ident(assert) ident(a)operator(.)ident(new_record?) - ident(assert_equal) ident(a)operator(,) ident(firm)operator(.)ident(account) - ident(assert) ident(firm)operator(.)ident(save) - ident(assert) operator(!)ident(firm)operator(.)ident(new_record?) - ident(assert) operator(!)ident(a)operator(.)ident(new_record?) - ident(assert_equal) ident(a)operator(,) ident(firm)operator(.)ident(account) - ident(assert_equal) ident(a)operator(,) ident(firm)operator(.)ident(account)operator(()pre_constant(true)operator(\)) - reserved(end) -reserved(end) - - -reserved(class) class(HasManyAssociationsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:accounts)operator(,) symbol(:companies)operator(,) symbol(:developers)operator(,) symbol(:projects)operator(,) - symbol(:developers_projects)operator(,) symbol(:topics) - - reserved(def) method(setup) - constant(Client)operator(.)ident(destroyed_client_ids)operator(.)ident(clear) - reserved(end) - - reserved(def) method(force_signal37_to_load_all_clients_of_firm) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(each) operator({)operator(|)ident(f)operator(|) operator(}) - reserved(end) - - reserved(def) method(test_counting) - ident(assert_equal) integer(2)operator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_finding) - ident(assert_equal) integer(2)operator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients)operator(.)ident(length) - reserved(end) - - reserved(def) method(test_find_many_with_merged_options) - ident(assert_equal) integer(1)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(limited_clients)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(limited_clients)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(limited_clients)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:limit) operator(=)operator(>) pre_constant(nil)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_triple_equality) - ident(assert) operator(!)operator(()constant(Array) operator(===) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients)operator(\)) - ident(assert) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients) operator(===) constant(Array) - reserved(end) - - reserved(def) method(test_finding_default_orders) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients)operator(.)ident(first)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_finding_with_different_class_name_and_order) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients_sorted_desc)operator(.)ident(first)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_finding_with_foreign_key) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(first)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_finding_with_condition) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients_like_ms)operator(.)ident(first)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_finding_using_sql) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(first_client) operator(=) ident(firm)operator(.)ident(clients_using_sql)operator(.)ident(first) - ident(assert_not_nil) ident(first_client) - ident(assert_equal) stringoperator(,) ident(first_client)operator(.)ident(name) - ident(assert_equal) integer(1)operator(,) ident(firm)operator(.)ident(clients_using_sql)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients_using_sql)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_counting_using_sql) - ident(assert_equal) integer(1)operator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients_using_counter_sql)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients_using_zero_counter_sql)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_counting_non_existant_items_using_sql) - ident(assert_equal) integer(0)operator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(no_clients_using_counter_sql)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_belongs_to_sanity) - ident(c) operator(=) constant(Client)operator(.)ident(new) - ident(assert_nil) ident(c)operator(.)ident(firm) - - reserved(if) ident(c)operator(.)ident(firm) - ident(assert) pre_constant(false)operator(,) string - reserved(end) - - reserved(unless) ident(c)operator(.)ident(firm) - reserved(else) - ident(assert) pre_constant(false)operator(,) string - reserved(end) - reserved(end) - - reserved(def) method(test_find_ids) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\)) - - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) ident(firm)operator(.)ident(clients)operator(.)ident(find) operator(}) - - ident(client) operator(=) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(assert_kind_of) constant(Client)operator(,) ident(client) - - ident(client_ary) operator(=) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()operator([)integer(2)operator(])operator(\)) - ident(assert_kind_of) constant(Array)operator(,) ident(client_ary) - ident(assert_equal) ident(client)operator(,) ident(client_ary)operator(.)ident(first) - - ident(client_ary) operator(=) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()integer(2)operator(,) integer(3)operator(\)) - ident(assert_kind_of) constant(Array)operator(,) ident(client_ary) - ident(assert_equal) integer(2)operator(,) ident(client_ary)operator(.)ident(size) - ident(assert_equal) ident(client)operator(,) ident(client_ary)operator(.)ident(first) - - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()integer(2)operator(,) integer(99)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_find_all) - ident(firm) operator(=) constant(Firm)operator(.)ident(find_first) - ident(assert_equal) ident(firm)operator(.)ident(clients)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find_all) - ident(assert_equal) integer(2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringcontent( = 'Client')delimiter(")>operator(\))operator(.)ident(length) - ident(assert_equal) integer(1)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\))operator(.)ident(length) - reserved(end) - - reserved(def) method(test_find_all_sanitized) - ident(firm) operator(=) constant(Firm)operator(.)ident(find_first) - ident(assert_equal) ident(firm)operator(.)ident(clients)operator(.)ident(find_all)operator(()stringoperator(\))operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find_all)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) - ident(summit) operator(=) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(summit)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_equal) ident(summit)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(])operator(\)) - reserved(end) - - reserved(def) method(test_find_first) - ident(firm) operator(=) constant(Firm)operator(.)ident(find_first) - ident(client2) operator(=) constant(Client)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(assert_equal) ident(firm)operator(.)ident(clients)operator(.)ident(first)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find_first) - ident(assert_equal) ident(client2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find_first)operator(()stringcontent( = 'Client')delimiter(")>operator(\)) - ident(assert_equal) ident(client2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringcontent( = 'Client')delimiter(")>operator(\)) - reserved(end) - - reserved(def) method(test_find_first_sanitized) - ident(firm) operator(=) constant(Firm)operator(.)ident(find_first) - ident(client2) operator(=) constant(Client)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(assert_equal) ident(client2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find_first)operator(()operator([)stringcontent( = ?)delimiter(")>operator(,) stringoperator(])operator(\)) - ident(assert_equal) ident(client2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringcontent( = ?)delimiter(")>operator(,) stringoperator(])operator(\)) - ident(assert_equal) ident(client2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringcontent( = :type)delimiter(")>operator(,) operator({) symbol(:type) operator(=)operator(>) string operator(})operator(])operator(\)) - reserved(end) - - reserved(def) method(test_find_in_collection) - ident(assert_equal) constant(Client)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(name)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(name) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients)operator(.)ident(find)operator(()integer(6)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_find_grouped) - ident(all_clients_of_firm1) operator(=) constant(Client)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(grouped_clients_of_firm1) operator(=) constant(Client)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:group) operator(=)operator(>) stringoperator(,) symbol(:select) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(all_clients_of_firm1)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(grouped_clients_of_firm1)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_adding) - ident(force_signal37_to_load_all_clients_of_firm) - ident(natural) operator(=) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm) operator(<<) ident(natural) - ident(assert_equal) integer(2)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(size) comment(# checking via the collection) - ident(assert_equal) integer(2)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) comment(# checking using the db) - ident(assert_equal) ident(natural)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(last) - reserved(end) - - reserved(def) method(test_adding_a_mismatch_class) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(\)) operator({) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm) operator(<<) pre_constant(nil) operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(\)) operator({) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm) operator(<<) integer(1) operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(\)) operator({) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm) operator(<<) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_adding_a_collection) - ident(force_signal37_to_load_all_clients_of_firm) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(concat)operator(()operator([)constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\))operator(,) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\))operator(])operator(\)) - ident(assert_equal) integer(3)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(assert_equal) integer(3)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_adding_before_save) - ident(no_of_firms) operator(=) constant(Firm)operator(.)ident(count) - ident(no_of_clients) operator(=) constant(Client)operator(.)ident(count) - ident(new_firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(new_firm)operator(.)ident(clients_of_firm)operator(.)ident(push) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(new_firm)operator(.)ident(clients_of_firm) operator(<<) operator(()ident(c) operator(=) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\))operator(\)) - ident(assert) ident(new_firm)operator(.)ident(new_record?) - ident(assert) ident(c)operator(.)ident(new_record?) - ident(assert_equal) integer(2)operator(,) ident(new_firm)operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(assert_equal) ident(no_of_firms)operator(,) constant(Firm)operator(.)ident(count) comment(# Firm was not saved to database.) - ident(assert_equal) ident(no_of_clients)operator(,) constant(Client)operator(.)ident(count) comment(# Clients were not saved to database.) - ident(assert) ident(new_firm)operator(.)ident(save) - ident(assert) operator(!)ident(new_firm)operator(.)ident(new_record?) - ident(assert) operator(!)ident(c)operator(.)ident(new_record?) - ident(assert_equal) ident(new_firm)operator(,) ident(c)operator(.)ident(firm) - ident(assert_equal) ident(no_of_firms)operator(+)integer(1)operator(,) constant(Firm)operator(.)ident(count) comment(# Firm was saved to database.) - ident(assert_equal) ident(no_of_clients)operator(+)integer(2)operator(,) constant(Client)operator(.)ident(count) comment(# Clients were saved to database.) - ident(assert_equal) integer(2)operator(,) ident(new_firm)operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(new_firm)operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_invalid_adding) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) operator(!)operator(()ident(firm)operator(.)ident(clients_of_firm) operator(<<) ident(c) operator(=) constant(Client)operator(.)ident(new)operator(\)) - ident(assert) ident(c)operator(.)ident(new_record?) - ident(assert) operator(!)ident(firm)operator(.)ident(valid?) - ident(assert) operator(!)ident(firm)operator(.)ident(save) - ident(assert) ident(c)operator(.)ident(new_record?) - reserved(end) - - reserved(def) method(test_invalid_adding_before_save) - ident(no_of_firms) operator(=) constant(Firm)operator(.)ident(count) - ident(no_of_clients) operator(=) constant(Client)operator(.)ident(count) - ident(new_firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(new_firm)operator(.)ident(clients_of_firm)operator(.)ident(concat)operator(()operator([)ident(c) operator(=) constant(Client)operator(.)ident(new)operator(,) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\))operator(])operator(\)) - ident(assert) ident(c)operator(.)ident(new_record?) - ident(assert) operator(!)ident(c)operator(.)ident(valid?) - ident(assert) operator(!)ident(new_firm)operator(.)ident(valid?) - ident(assert) operator(!)ident(new_firm)operator(.)ident(save) - ident(assert) ident(c)operator(.)ident(new_record?) - ident(assert) ident(new_firm)operator(.)ident(new_record?) - reserved(end) - - reserved(def) method(test_build) - ident(new_client) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(build)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(new_client)operator(.)ident(name) - ident(assert) ident(new_client)operator(.)ident(new_record?) - ident(assert_equal) ident(new_client)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(last) - ident(assert) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(save) - ident(assert) operator(!)ident(new_client)operator(.)ident(new_record?) - ident(assert_equal) integer(2)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_build_many) - ident(new_clients) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(build)operator(()operator([)operator({)string operator(=)operator(>) stringoperator(})operator(,) operator({)string operator(=)operator(>) stringoperator(})operator(])operator(\)) - ident(assert_equal) integer(2)operator(,) ident(new_clients)operator(.)ident(size) - - ident(assert) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(save) - ident(assert_equal) integer(3)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_invalid_build) - ident(new_client) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(build) - ident(assert) ident(new_client)operator(.)ident(new_record?) - ident(assert) operator(!)ident(new_client)operator(.)ident(valid?) - ident(assert_equal) ident(new_client)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(last) - ident(assert) operator(!)ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(save) - ident(assert) ident(new_client)operator(.)ident(new_record?) - ident(assert_equal) integer(1)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_create) - ident(force_signal37_to_load_all_clients_of_firm) - ident(new_client) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(new_client)operator(.)ident(new_record?) - ident(assert_equal) ident(new_client)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(last) - ident(assert_equal) ident(new_client)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(last) - reserved(end) - - reserved(def) method(test_create_many) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(create)operator(()operator([)operator({)string operator(=)operator(>) stringoperator(})operator(,) operator({)string operator(=)operator(>) stringoperator(})operator(])operator(\)) - ident(assert_equal) integer(3)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_find_or_create) - ident(number_of_clients) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients)operator(.)ident(size) - ident(the_client) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients)operator(.)ident(find_or_create_by_name)operator(()stringoperator(\)) - ident(assert_equal) ident(number_of_clients) operator(+) integer(1)operator(,) ident(companies)operator(()symbol(:first_firm)operator(,) symbol(:refresh)operator(\))operator(.)ident(clients)operator(.)ident(size) - ident(assert_equal) ident(the_client)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients)operator(.)ident(find_or_create_by_name)operator(()stringoperator(\)) - ident(assert_equal) ident(number_of_clients) operator(+) integer(1)operator(,) ident(companies)operator(()symbol(:first_firm)operator(,) symbol(:refresh)operator(\))operator(.)ident(clients)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_deleting) - ident(force_signal37_to_load_all_clients_of_firm) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(delete)operator(()ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(first)operator(\)) - ident(assert_equal) integer(0)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_deleting_before_save) - ident(new_firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(new_client) operator(=) ident(new_firm)operator(.)ident(clients_of_firm)operator(.)ident(build)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(1)operator(,) ident(new_firm)operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(new_firm)operator(.)ident(clients_of_firm)operator(.)ident(delete)operator(()ident(new_client)operator(\)) - ident(assert_equal) integer(0)operator(,) ident(new_firm)operator(.)ident(clients_of_firm)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_deleting_a_collection) - ident(force_signal37_to_load_all_clients_of_firm) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(delete)operator(()operator([)ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator([)integer(0)operator(])operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator([)integer(1)operator(])operator(])operator(\)) - ident(assert_equal) integer(0)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_delete_all) - ident(force_signal37_to_load_all_clients_of_firm) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(delete_all) - ident(assert_equal) integer(0)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_delete_all_with_not_yet_loaded_association_collection) - ident(force_signal37_to_load_all_clients_of_firm) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(reset) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(delete_all) - ident(assert_equal) integer(0)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_clearing_an_association_collection) - ident(firm) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\)) - ident(client_id) operator(=) ident(firm)operator(.)ident(clients_of_firm)operator(.)ident(first)operator(.)ident(id) - ident(assert_equal) integer(1)operator(,) ident(firm)operator(.)ident(clients_of_firm)operator(.)ident(size) - - ident(firm)operator(.)ident(clients_of_firm)operator(.)ident(clear) - - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - ident(assert_equal) operator([)operator(])operator(,) constant(Client)operator(.)ident(destroyed_client_ids)operator([)ident(firm)operator(.)ident(id)operator(]) - - comment(# Should not be destroyed since the association is not dependent.) - ident(assert_nothing_raised) reserved(do) - ident(assert) constant(Client)operator(.)ident(find)operator(()ident(client_id)operator(\))operator(.)ident(firm)operator(.)ident(nil?) - reserved(end) - reserved(end) - - reserved(def) method(test_clearing_a_dependent_association_collection) - ident(firm) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\)) - ident(client_id) operator(=) ident(firm)operator(.)ident(dependent_clients_of_firm)operator(.)ident(first)operator(.)ident(id) - ident(assert_equal) integer(1)operator(,) ident(firm)operator(.)ident(dependent_clients_of_firm)operator(.)ident(size) - - comment(# :dependent means destroy is called on each client) - ident(firm)operator(.)ident(dependent_clients_of_firm)operator(.)ident(clear) - - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(dependent_clients_of_firm)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(dependent_clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - ident(assert_equal) operator([)ident(client_id)operator(])operator(,) constant(Client)operator(.)ident(destroyed_client_ids)operator([)ident(firm)operator(.)ident(id)operator(]) - - comment(# Should be destroyed since the association is dependent.) - ident(assert) constant(Client)operator(.)ident(find_by_id)operator(()ident(client_id)operator(\))operator(.)ident(nil?) - reserved(end) - - reserved(def) method(test_clearing_an_exclusively_dependent_association_collection) - ident(firm) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\)) - ident(client_id) operator(=) ident(firm)operator(.)ident(exclusively_dependent_clients_of_firm)operator(.)ident(first)operator(.)ident(id) - ident(assert_equal) integer(1)operator(,) ident(firm)operator(.)ident(exclusively_dependent_clients_of_firm)operator(.)ident(size) - - ident(assert_equal) operator([)operator(])operator(,) constant(Client)operator(.)ident(destroyed_client_ids)operator([)ident(firm)operator(.)ident(id)operator(]) - - comment(# :exclusively_dependent means each client is deleted directly from) - comment(# the database without looping through them calling destroy.) - ident(firm)operator(.)ident(exclusively_dependent_clients_of_firm)operator(.)ident(clear) - - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(exclusively_dependent_clients_of_firm)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(exclusively_dependent_clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - ident(assert_equal) operator([)integer(3)operator(])operator(,) constant(Client)operator(.)ident(destroyed_client_ids)operator([)ident(firm)operator(.)ident(id)operator(]) - - comment(# Should be destroyed since the association is exclusively dependent.) - ident(assert) constant(Client)operator(.)ident(find_by_id)operator(()ident(client_id)operator(\))operator(.)ident(nil?) - reserved(end) - - reserved(def) method(test_clearing_without_initial_access) - ident(firm) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\)) - - ident(firm)operator(.)ident(clients_of_firm)operator(.)ident(clear) - - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_deleting_a_item_which_is_not_in_the_collection) - ident(force_signal37_to_load_all_clients_of_firm) - ident(summit) operator(=) constant(Client)operator(.)ident(find_first)operator(()stringoperator(\)) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(delete)operator(()ident(summit)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(summit)operator(.)ident(client_of) - reserved(end) - - reserved(def) method(test_deleting_type_mismatch) - ident(david) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(david)operator(.)ident(projects)operator(.)ident(reload) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(\)) operator({) ident(david)operator(.)ident(projects)operator(.)ident(delete)operator(()integer(1)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_deleting_self_type_mismatch) - ident(david) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(david)operator(.)ident(projects)operator(.)ident(reload) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(\)) operator({) ident(david)operator(.)ident(projects)operator(.)ident(delete)operator(()constant(Project)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(developers)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_destroy_all) - ident(force_signal37_to_load_all_clients_of_firm) - ident(assert) operator(!)ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(empty?)operator(,) string - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(destroy_all) - ident(assert) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(.)ident(empty?)operator(,) string - ident(assert) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(empty?)operator(,) string - reserved(end) - - reserved(def) method(test_dependence) - ident(firm) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(size) - ident(firm)operator(.)ident(destroy) - ident(assert) constant(Client)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringdelimiter(")>operator(\))operator(.)ident(empty?) - reserved(end) - - reserved(def) method(test_destroy_dependent_when_deleted_from_association) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(size) - - ident(client) operator(=) ident(firm)operator(.)ident(clients)operator(.)ident(first) - ident(firm)operator(.)ident(clients)operator(.)ident(delete)operator(()ident(client)operator(\)) - - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) constant(Client)operator(.)ident(find)operator(()ident(client)operator(.)ident(id)operator(\)) operator(}) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()ident(client)operator(.)ident(id)operator(\)) operator(}) - ident(assert_equal) integer(1)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_three_levels_of_dependence) - ident(topic) operator(=) constant(Topic)operator(.)ident(create) string operator(=)operator(>) string - ident(reply) operator(=) ident(topic)operator(.)ident(replies)operator(.)ident(create) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - ident(silly_reply) operator(=) ident(reply)operator(.)ident(replies)operator(.)ident(create) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - - ident(assert_nothing_raised) operator({) ident(topic)operator(.)ident(destroy) operator(}) - reserved(end) - - ident(uses_transaction) symbol(:test_dependence_with_transaction_support_on_failure) - reserved(def) method(test_dependence_with_transaction_support_on_failure) - ident(firm) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\)) - ident(clients) operator(=) ident(firm)operator(.)ident(clients) - ident(assert_equal) integer(2)operator(,) ident(clients)operator(.)ident(length) - ident(clients)operator(.)ident(last)operator(.)ident(instance_eval) operator({) reserved(def) method(before_destroy)operator(()operator(\)) ident(raise) string reserved(end) operator(}) - - ident(firm)operator(.)ident(destroy) reserved(rescue) string - - ident(assert_equal) integer(2)operator(,) constant(Client)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringdelimiter(")>operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_dependence_on_account) - ident(num_accounts) operator(=) constant(Account)operator(.)ident(count) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(destroy) - ident(assert_equal) ident(num_accounts) operator(-) integer(1)operator(,) constant(Account)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_depends_and_nullify) - ident(num_accounts) operator(=) constant(Account)operator(.)ident(count) - ident(num_companies) operator(=) constant(Company)operator(.)ident(count) - - ident(core) operator(=) ident(companies)operator(()symbol(:rails_core)operator(\)) - ident(assert_equal) ident(accounts)operator(()symbol(:rails_core_account)operator(\))operator(,) ident(core)operator(.)ident(account) - ident(assert_equal) operator([)ident(companies)operator(()symbol(:leetsoft)operator(\))operator(,) ident(companies)operator(()symbol(:jadedpixel)operator(\))operator(])operator(,) ident(core)operator(.)ident(companies) - ident(core)operator(.)ident(destroy) - ident(assert_nil) ident(accounts)operator(()symbol(:rails_core_account)operator(\))operator(.)ident(reload)operator(.)ident(firm_id) - ident(assert_nil) ident(companies)operator(()symbol(:leetsoft)operator(\))operator(.)ident(reload)operator(.)ident(client_of) - ident(assert_nil) ident(companies)operator(()symbol(:jadedpixel)operator(\))operator(.)ident(reload)operator(.)ident(client_of) - - - ident(assert_equal) ident(num_accounts)operator(,) constant(Account)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_included_in_collection) - ident(assert) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients)operator(.)ident(include?)operator(()constant(Client)operator(.)ident(find)operator(()integer(2)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_adding_array_and_collection) - ident(assert_nothing_raised) operator({) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(clients) operator(+) constant(Firm)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(last)operator(.)ident(clients) operator(}) - reserved(end) - - reserved(def) method(test_find_all_without_conditions) - ident(firm) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(length) - reserved(end) - - reserved(def) method(test_replace_with_less) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(firm)operator(.)ident(clients) operator(=) operator([)ident(companies)operator(()symbol(:first_client)operator(\))operator(]) - ident(assert) ident(firm)operator(.)ident(save)operator(,) string - ident(firm)operator(.)ident(reload) - ident(assert_equal) integer(1)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(length) - reserved(end) - - - reserved(def) method(test_replace_with_new) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(new_client) operator(=) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(clients) operator(=) operator([)ident(companies)operator(()symbol(:second_client)operator(\))operator(,)ident(new_client)operator(]) - ident(firm)operator(.)ident(save) - ident(firm)operator(.)ident(reload) - ident(assert_equal) integer(2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(length) - ident(assert) operator(!)ident(firm)operator(.)ident(clients)operator(.)ident(include?)operator(()symbol(:first_client)operator(\)) - reserved(end) - - reserved(def) method(test_replace_on_new_object) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(clients) operator(=) operator([)ident(companies)operator(()symbol(:second_client)operator(\))operator(,) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\))operator(]) - ident(assert) ident(firm)operator(.)ident(save) - ident(firm)operator(.)ident(reload) - ident(assert_equal) integer(2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(length) - ident(assert) ident(firm)operator(.)ident(clients)operator(.)ident(include?)operator(()constant(Client)operator(.)ident(find_by_name)operator(()stringoperator(\))operator(\)) - reserved(end) - - reserved(def) method(test_assign_ids) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(client_ids) operator(=) operator([)ident(companies)operator(()symbol(:first_client)operator(\))operator(.)ident(id)operator(,) ident(companies)operator(()symbol(:second_client)operator(\))operator(.)ident(id)operator(]) - ident(firm)operator(.)ident(save) - ident(firm)operator(.)ident(reload) - ident(assert_equal) integer(2)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(length) - ident(assert) ident(firm)operator(.)ident(clients)operator(.)ident(include?)operator(()ident(companies)operator(()symbol(:second_client)operator(\))operator(\)) - reserved(end) -reserved(end) - -reserved(class) class(BelongsToAssociationsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:accounts)operator(,) symbol(:companies)operator(,) symbol(:developers)operator(,) symbol(:projects)operator(,) symbol(:topics)operator(,) - symbol(:developers_projects)operator(,) symbol(:computers)operator(,) symbol(:authors)operator(,) symbol(:posts) - - reserved(def) method(test_belongs_to) - constant(Client)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm)operator(.)ident(name) - ident(assert_equal) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(name)operator(,) constant(Client)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm)operator(.)ident(name) - ident(assert) operator(!)constant(Client)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm)operator(.)ident(nil?)operator(,) string - reserved(end) - - reserved(def) method(test_proxy_assignment) - ident(account) operator(=) constant(Account)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_nothing_raised) operator({) ident(account)operator(.)ident(firm) operator(=) ident(account)operator(.)ident(firm) operator(}) - reserved(end) - - reserved(def) method(test_triple_equality) - ident(assert) constant(Client)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm) operator(===) constant(Firm) - ident(assert) constant(Firm) operator(===) constant(Client)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm) - reserved(end) - - reserved(def) method(test_type_mismatch) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(\)) operator({) constant(Account)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(firm) operator(=) integer(1) operator(}) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(\)) operator({) constant(Account)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(firm) operator(=) constant(Project)operator(.)ident(find)operator(()integer(1)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_natural_assignment) - ident(apple) operator(=) constant(Firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(citibank) operator(=) constant(Account)operator(.)ident(create)operator(()string operator(=)operator(>) integer(10)operator(\)) - ident(citibank)operator(.)ident(firm) operator(=) ident(apple) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(citibank)operator(.)ident(firm_id) - reserved(end) - - reserved(def) method(test_creating_the_belonging_object) - ident(citibank) operator(=) constant(Account)operator(.)ident(create)operator(()string operator(=)operator(>) integer(10)operator(\)) - ident(apple) operator(=) ident(citibank)operator(.)ident(create_firm)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(apple)operator(,) ident(citibank)operator(.)ident(firm) - ident(citibank)operator(.)ident(save) - ident(citibank)operator(.)ident(reload) - ident(assert_equal) ident(apple)operator(,) ident(citibank)operator(.)ident(firm) - reserved(end) - - reserved(def) method(test_building_the_belonging_object) - ident(citibank) operator(=) constant(Account)operator(.)ident(create)operator(()string operator(=)operator(>) integer(10)operator(\)) - ident(apple) operator(=) ident(citibank)operator(.)ident(build_firm)operator(()string operator(=)operator(>) stringoperator(\)) - ident(citibank)operator(.)ident(save) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(citibank)operator(.)ident(firm_id) - reserved(end) - - reserved(def) method(test_natural_assignment_to_nil) - ident(client) operator(=) constant(Client)operator(.)ident(find)operator(()integer(3)operator(\)) - ident(client)operator(.)ident(firm) operator(=) pre_constant(nil) - ident(client)operator(.)ident(save) - ident(assert_nil) ident(client)operator(.)ident(firm)operator(()pre_constant(true)operator(\)) - ident(assert_nil) ident(client)operator(.)ident(client_of) - reserved(end) - - reserved(def) method(test_with_different_class_name) - ident(assert_equal) constant(Company)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(name)operator(,) constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm_with_other_name)operator(.)ident(name) - ident(assert_not_nil) constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm_with_other_name)operator(,) string - reserved(end) - - reserved(def) method(test_with_condition) - ident(assert_equal) constant(Company)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(name)operator(,) constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm_with_condition)operator(.)ident(name) - ident(assert_not_nil) constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm_with_condition)operator(,) string - reserved(end) - - reserved(def) method(test_belongs_to_counter) - ident(debate) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(0)operator(,) ident(debate)operator(.)ident(send)operator(()symbol(:read_attribute)operator(,) stringoperator(\))operator(,) string - - ident(trash) operator(=) ident(debate)operator(.)ident(replies)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(1)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(debate)operator(.)ident(id)operator(\))operator(.)ident(send)operator(()symbol(:read_attribute)operator(,) stringoperator(\))operator(,) string - - ident(trash)operator(.)ident(destroy) - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(debate)operator(.)ident(id)operator(\))operator(.)ident(send)operator(()symbol(:read_attribute)operator(,) stringoperator(\))operator(,) string - reserved(end) - - reserved(def) method(test_belongs_to_counter_with_reassigning) - ident(t1) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(t2) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(r1) operator(=) constant(Reply)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(r1)operator(.)ident(topic) operator(=) ident(t1) - - ident(assert) ident(r1)operator(.)ident(save) - ident(assert_equal) integer(1)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(t1)operator(.)ident(id)operator(\))operator(.)ident(replies)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(t2)operator(.)ident(id)operator(\))operator(.)ident(replies)operator(.)ident(size) - - ident(r1)operator(.)ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()ident(t2)operator(.)ident(id)operator(\)) - - ident(assert) ident(r1)operator(.)ident(save) - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(t1)operator(.)ident(id)operator(\))operator(.)ident(replies)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(t2)operator(.)ident(id)operator(\))operator(.)ident(replies)operator(.)ident(size) - - ident(r1)operator(.)ident(topic) operator(=) pre_constant(nil) - - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(t1)operator(.)ident(id)operator(\))operator(.)ident(replies)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(t2)operator(.)ident(id)operator(\))operator(.)ident(replies)operator(.)ident(size) - - ident(r1)operator(.)ident(topic) operator(=) ident(t1) - - ident(assert_equal) integer(1)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(t1)operator(.)ident(id)operator(\))operator(.)ident(replies)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(t2)operator(.)ident(id)operator(\))operator(.)ident(replies)operator(.)ident(size) - - ident(r1)operator(.)ident(destroy) - - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(t1)operator(.)ident(id)operator(\))operator(.)ident(replies)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(t2)operator(.)ident(id)operator(\))operator(.)ident(replies)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_assignment_before_parent_saved) - ident(client) operator(=) constant(Client)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(apple) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(client)operator(.)ident(firm) operator(=) ident(apple) - ident(assert_equal) ident(apple)operator(,) ident(client)operator(.)ident(firm) - ident(assert) ident(apple)operator(.)ident(new_record?) - ident(assert) ident(client)operator(.)ident(save) - ident(assert) ident(apple)operator(.)ident(save) - ident(assert) operator(!)ident(apple)operator(.)ident(new_record?) - ident(assert_equal) ident(apple)operator(,) ident(client)operator(.)ident(firm) - ident(assert_equal) ident(apple)operator(,) ident(client)operator(.)ident(firm)operator(()pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_assignment_before_child_saved) - ident(final_cut) operator(=) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(final_cut)operator(.)ident(firm) operator(=) ident(firm) - ident(assert) ident(final_cut)operator(.)ident(new_record?) - ident(assert) ident(final_cut)operator(.)ident(save) - ident(assert) operator(!)ident(final_cut)operator(.)ident(new_record?) - ident(assert) operator(!)ident(firm)operator(.)ident(new_record?) - ident(assert_equal) ident(firm)operator(,) ident(final_cut)operator(.)ident(firm) - ident(assert_equal) ident(firm)operator(,) ident(final_cut)operator(.)ident(firm)operator(()pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_assignment_before_either_saved) - ident(final_cut) operator(=) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(apple) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(final_cut)operator(.)ident(firm) operator(=) ident(apple) - ident(assert) ident(final_cut)operator(.)ident(new_record?) - ident(assert) ident(apple)operator(.)ident(new_record?) - ident(assert) ident(final_cut)operator(.)ident(save) - ident(assert) operator(!)ident(final_cut)operator(.)ident(new_record?) - ident(assert) operator(!)ident(apple)operator(.)ident(new_record?) - ident(assert_equal) ident(apple)operator(,) ident(final_cut)operator(.)ident(firm) - ident(assert_equal) ident(apple)operator(,) ident(final_cut)operator(.)ident(firm)operator(()pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_new_record_with_foreign_key_but_no_object) - ident(c) operator(=) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) integer(1)operator(\)) - ident(assert_equal) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(,) ident(c)operator(.)ident(firm_with_basic_id) - reserved(end) - - reserved(def) method(test_forgetting_the_load_when_foreign_key_enters_late) - ident(c) operator(=) constant(Client)operator(.)ident(new) - ident(assert_nil) ident(c)operator(.)ident(firm_with_basic_id) - - ident(c)operator(.)ident(firm_id) operator(=) integer(1) - ident(assert_equal) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(,) ident(c)operator(.)ident(firm_with_basic_id) - reserved(end) - - reserved(def) method(test_field_name_same_as_foreign_key) - ident(computer) operator(=) constant(Computer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_not_nil) ident(computer)operator(.)ident(developer)operator(,) string comment(# ') - reserved(end) - - reserved(def) method(test_counter_cache) - ident(topic) operator(=) constant(Topic)operator(.)ident(create) symbol(:title) operator(=)operator(>) string - ident(assert_equal) integer(0)operator(,) ident(topic)operator([)symbol(:replies_count)operator(]) - - ident(reply) operator(=) constant(Reply)operator(.)ident(create)operator(()symbol(:title) operator(=)operator(>) stringoperator(,) symbol(:content) operator(=)operator(>) stringoperator(\)) - ident(reply)operator(.)ident(topic) operator(=) ident(topic) - - ident(assert_equal) integer(1)operator(,) ident(topic)operator(.)ident(reload)operator([)symbol(:replies_count)operator(]) - ident(assert_equal) integer(1)operator(,) ident(topic)operator(.)ident(replies)operator(.)ident(size) - - ident(topic)operator([)symbol(:replies_count)operator(]) operator(=) integer(15) - ident(assert_equal) integer(15)operator(,) ident(topic)operator(.)ident(replies)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_custom_counter_cache) - ident(reply) operator(=) constant(Reply)operator(.)ident(create)operator(()symbol(:title) operator(=)operator(>) stringoperator(,) symbol(:content) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(0)operator(,) ident(reply)operator([)symbol(:replies_count)operator(]) - - ident(silly) operator(=) constant(SillyReply)operator(.)ident(create)operator(()symbol(:title) operator(=)operator(>) stringoperator(,) symbol(:content) operator(=)operator(>) stringoperator(\)) - ident(silly)operator(.)ident(reply) operator(=) ident(reply) - - ident(assert_equal) integer(1)operator(,) ident(reply)operator(.)ident(reload)operator([)symbol(:replies_count)operator(]) - ident(assert_equal) integer(1)operator(,) ident(reply)operator(.)ident(replies)operator(.)ident(size) - - ident(reply)operator([)symbol(:replies_count)operator(]) operator(=) integer(17) - ident(assert_equal) integer(17)operator(,) ident(reply)operator(.)ident(replies)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_store_two_association_with_one_save) - ident(num_orders) operator(=) constant(Order)operator(.)ident(count) - ident(num_customers) operator(=) constant(Customer)operator(.)ident(count) - ident(order) operator(=) constant(Order)operator(.)ident(new) - - ident(customer1) operator(=) ident(order)operator(.)ident(billing) operator(=) constant(Customer)operator(.)ident(new) - ident(customer2) operator(=) ident(order)operator(.)ident(shipping) operator(=) constant(Customer)operator(.)ident(new) - ident(assert) ident(order)operator(.)ident(save) - ident(assert_equal) ident(customer1)operator(,) ident(order)operator(.)ident(billing) - ident(assert_equal) ident(customer2)operator(,) ident(order)operator(.)ident(shipping) - - ident(order)operator(.)ident(reload) - - ident(assert_equal) ident(customer1)operator(,) ident(order)operator(.)ident(billing) - ident(assert_equal) ident(customer2)operator(,) ident(order)operator(.)ident(shipping) - - ident(assert_equal) ident(num_orders) integer(+1)operator(,) constant(Order)operator(.)ident(count) - ident(assert_equal) ident(num_customers) integer(+2)operator(,) constant(Customer)operator(.)ident(count) - reserved(end) - - - reserved(def) method(test_store_association_in_two_relations_with_one_save) - ident(num_orders) operator(=) constant(Order)operator(.)ident(count) - ident(num_customers) operator(=) constant(Customer)operator(.)ident(count) - ident(order) operator(=) constant(Order)operator(.)ident(new) - - ident(customer) operator(=) ident(order)operator(.)ident(billing) operator(=) ident(order)operator(.)ident(shipping) operator(=) constant(Customer)operator(.)ident(new) - ident(assert) ident(order)operator(.)ident(save) - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(billing) - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(shipping) - - ident(order)operator(.)ident(reload) - - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(billing) - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(shipping) - - ident(assert_equal) ident(num_orders) integer(+1)operator(,) constant(Order)operator(.)ident(count) - ident(assert_equal) ident(num_customers) integer(+1)operator(,) constant(Customer)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_store_association_in_two_relations_with_one_save_in_existing_object) - ident(num_orders) operator(=) constant(Order)operator(.)ident(count) - ident(num_customers) operator(=) constant(Customer)operator(.)ident(count) - ident(order) operator(=) constant(Order)operator(.)ident(create) - - ident(customer) operator(=) ident(order)operator(.)ident(billing) operator(=) ident(order)operator(.)ident(shipping) operator(=) constant(Customer)operator(.)ident(new) - ident(assert) ident(order)operator(.)ident(save) - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(billing) - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(shipping) - - ident(order)operator(.)ident(reload) - - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(billing) - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(shipping) - - ident(assert_equal) ident(num_orders) integer(+1)operator(,) constant(Order)operator(.)ident(count) - ident(assert_equal) ident(num_customers) integer(+1)operator(,) constant(Customer)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_store_association_in_two_relations_with_one_save_in_existing_object_with_values) - ident(num_orders) operator(=) constant(Order)operator(.)ident(count) - ident(num_customers) operator(=) constant(Customer)operator(.)ident(count) - ident(order) operator(=) constant(Order)operator(.)ident(create) - - ident(customer) operator(=) ident(order)operator(.)ident(billing) operator(=) ident(order)operator(.)ident(shipping) operator(=) constant(Customer)operator(.)ident(new) - ident(assert) ident(order)operator(.)ident(save) - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(billing) - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(shipping) - - ident(order)operator(.)ident(reload) - - ident(customer) operator(=) ident(order)operator(.)ident(billing) operator(=) ident(order)operator(.)ident(shipping) operator(=) constant(Customer)operator(.)ident(new) - - ident(assert) ident(order)operator(.)ident(save) - ident(order)operator(.)ident(reload) - - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(billing) - ident(assert_equal) ident(customer)operator(,) ident(order)operator(.)ident(shipping) - - ident(assert_equal) ident(num_orders) integer(+1)operator(,) constant(Order)operator(.)ident(count) - ident(assert_equal) ident(num_customers) integer(+2)operator(,) constant(Customer)operator(.)ident(count) - reserved(end) - - - reserved(def) method(test_association_assignment_sticks) - ident(post) operator(=) constant(Post)operator(.)ident(find)operator(()symbol(:first)operator(\)) - - ident(author1)operator(,) ident(author2) operator(=) constant(Author)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(\)) - ident(assert_not_nil) ident(author1) - ident(assert_not_nil) ident(author2) - - comment(# make sure the association is loaded) - ident(post)operator(.)ident(author) - - comment(# set the association by id, directly) - ident(post)operator(.)ident(author_id) operator(=) ident(author2)operator(.)ident(id) - - comment(# save and reload) - ident(post)operator(.)ident(save!) - ident(post)operator(.)ident(reload) - - comment(# the author id of the post should be the id we set) - ident(assert_equal) ident(post)operator(.)ident(author_id)operator(,) ident(author2)operator(.)ident(id) - reserved(end) - -reserved(end) - - -reserved(class) class(ProjectWithAfterCreateHook) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_table_name) string - ident(has_and_belongs_to_many) symbol(:developers)operator(,) - symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:join_table) operator(=)operator(>) stringoperator(,) - symbol(:foreign_key) operator(=)operator(>) stringoperator(,) - symbol(:association_foreign_key) operator(=)operator(>) string - - ident(after_create) symbol(:add_david) - - reserved(def) method(add_david) - ident(david) operator(=) constant(DeveloperForProjectWithAfterCreateHook)operator(.)ident(find_by_name)operator(()stringoperator(\)) - ident(david)operator(.)ident(projects) operator(<<) pre_constant(self) - reserved(end) -reserved(end) - -reserved(class) class(DeveloperForProjectWithAfterCreateHook) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_table_name) string - ident(has_and_belongs_to_many) symbol(:projects)operator(,) - symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:join_table) operator(=)operator(>) stringoperator(,) - symbol(:association_foreign_key) operator(=)operator(>) stringoperator(,) - symbol(:foreign_key) operator(=)operator(>) string -reserved(end) - - -reserved(class) class(HasAndBelongsToManyAssociationsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:accounts)operator(,) symbol(:companies)operator(,) symbol(:categories)operator(,) symbol(:posts)operator(,) symbol(:categories_posts)operator(,) symbol(:developers)operator(,) symbol(:projects)operator(,) symbol(:developers_projects) - - reserved(def) method(test_has_and_belongs_to_many) - ident(david) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - - ident(assert) operator(!)ident(david)operator(.)ident(projects)operator(.)ident(empty?) - ident(assert_equal) integer(2)operator(,) ident(david)operator(.)ident(projects)operator(.)ident(size) - - ident(active_record) operator(=) constant(Project)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) operator(!)ident(active_record)operator(.)ident(developers)operator(.)ident(empty?) - ident(assert_equal) integer(3)operator(,) ident(active_record)operator(.)ident(developers)operator(.)ident(size) - ident(assert) ident(active_record)operator(.)ident(developers)operator(.)ident(include?)operator(()ident(david)operator(\)) - reserved(end) - - reserved(def) method(test_triple_equality) - ident(assert) operator(!)operator(()constant(Array) operator(===) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(projects)operator(\)) - ident(assert) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(projects) operator(===) constant(Array) - reserved(end) - - reserved(def) method(test_adding_single) - ident(jamis) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(jamis)operator(.)ident(projects)operator(.)ident(reload) comment(# causing the collection to load ) - ident(action_controller) operator(=) constant(Project)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(jamis)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(action_controller)operator(.)ident(developers)operator(.)ident(size) - - ident(jamis)operator(.)ident(projects) operator(<<) ident(action_controller) - - ident(assert_equal) integer(2)operator(,) ident(jamis)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(jamis)operator(.)ident(projects)operator(()pre_constant(true)operator(\))operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(action_controller)operator(.)ident(developers)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_adding_type_mismatch) - ident(jamis) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(\)) operator({) ident(jamis)operator(.)ident(projects) operator(<<) pre_constant(nil) operator(}) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(AssociationTypeMismatch)operator(\)) operator({) ident(jamis)operator(.)ident(projects) operator(<<) integer(1) operator(}) - reserved(end) - - reserved(def) method(test_adding_from_the_project) - ident(jamis) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(action_controller) operator(=) constant(Project)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(action_controller)operator(.)ident(developers)operator(.)ident(reload) - ident(assert_equal) integer(1)operator(,) ident(jamis)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(action_controller)operator(.)ident(developers)operator(.)ident(size) - - ident(action_controller)operator(.)ident(developers) operator(<<) ident(jamis) - - ident(assert_equal) integer(2)operator(,) ident(jamis)operator(.)ident(projects)operator(()pre_constant(true)operator(\))operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(action_controller)operator(.)ident(developers)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(action_controller)operator(.)ident(developers)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_adding_from_the_project_fixed_timestamp) - ident(jamis) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(action_controller) operator(=) constant(Project)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(action_controller)operator(.)ident(developers)operator(.)ident(reload) - ident(assert_equal) integer(1)operator(,) ident(jamis)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(action_controller)operator(.)ident(developers)operator(.)ident(size) - ident(updated_at) operator(=) ident(jamis)operator(.)ident(updated_at) - - ident(action_controller)operator(.)ident(developers) operator(<<) ident(jamis) - - ident(assert_equal) ident(updated_at)operator(,) ident(jamis)operator(.)ident(updated_at) - ident(assert_equal) integer(2)operator(,) ident(jamis)operator(.)ident(projects)operator(()pre_constant(true)operator(\))operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(action_controller)operator(.)ident(developers)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(action_controller)operator(.)ident(developers)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_adding_multiple) - ident(aredridel) operator(=) constant(Developer)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(aredridel)operator(.)ident(save) - ident(aredridel)operator(.)ident(projects)operator(.)ident(reload) - ident(aredridel)operator(.)ident(projects)operator(.)ident(push)operator(()constant(Project)operator(.)ident(find)operator(()integer(1)operator(\))operator(,) constant(Project)operator(.)ident(find)operator(()integer(2)operator(\))operator(\)) - ident(assert_equal) integer(2)operator(,) ident(aredridel)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(aredridel)operator(.)ident(projects)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_adding_a_collection) - ident(aredridel) operator(=) constant(Developer)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(aredridel)operator(.)ident(save) - ident(aredridel)operator(.)ident(projects)operator(.)ident(reload) - ident(aredridel)operator(.)ident(projects)operator(.)ident(concat)operator(()operator([)constant(Project)operator(.)ident(find)operator(()integer(1)operator(\))operator(,) constant(Project)operator(.)ident(find)operator(()integer(2)operator(\))operator(])operator(\)) - ident(assert_equal) integer(2)operator(,) ident(aredridel)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(aredridel)operator(.)ident(projects)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_adding_uses_default_values_on_join_table) - ident(ac) operator(=) ident(projects)operator(()symbol(:action_controller)operator(\)) - ident(assert) operator(!)ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects)operator(.)ident(include?)operator(()ident(ac)operator(\)) - ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects) operator(<<) ident(ac) - - ident(assert) ident(developers)operator(()symbol(:jamis)operator(,) symbol(:reload)operator(\))operator(.)ident(projects)operator(.)ident(include?)operator(()ident(ac)operator(\)) - ident(project) operator(=) ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects)operator(.)ident(detect) operator({) operator(|)ident(p)operator(|) ident(p) operator(==) ident(ac) operator(}) - ident(assert_equal) integer(1)operator(,) ident(project)operator(.)ident(access_level)operator(.)ident(to_i) - reserved(end) - - reserved(def) method(test_adding_uses_explicit_values_on_join_table) - ident(ac) operator(=) ident(projects)operator(()symbol(:action_controller)operator(\)) - ident(assert) operator(!)ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects)operator(.)ident(include?)operator(()ident(ac)operator(\)) - ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects)operator(.)ident(push_with_attributes)operator(()ident(ac)operator(,) symbol(:access_level) operator(=)operator(>) integer(3)operator(\)) - - ident(assert) ident(developers)operator(()symbol(:jamis)operator(,) symbol(:reload)operator(\))operator(.)ident(projects)operator(.)ident(include?)operator(()ident(ac)operator(\)) - ident(project) operator(=) ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects)operator(.)ident(detect) operator({) operator(|)ident(p)operator(|) ident(p) operator(==) ident(ac) operator(}) - ident(assert_equal) integer(3)operator(,) ident(project)operator(.)ident(access_level)operator(.)ident(to_i) - reserved(end) - - reserved(def) method(test_hatbm_attribute_access_and_respond_to) - ident(project) operator(=) ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects)operator([)integer(0)operator(]) - ident(assert) ident(project)operator(.)ident(has_attribute?)operator(()stringoperator(\)) - ident(assert) ident(project)operator(.)ident(has_attribute?)operator(()stringoperator(\)) - ident(assert) ident(project)operator(.)ident(has_attribute?)operator(()stringoperator(\)) - ident(assert) ident(project)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(project)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(project)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(project)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(project)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(project)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(project)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(project)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(project)operator(.)ident(respond_to?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_habtm_adding_before_save) - ident(no_of_devels) operator(=) constant(Developer)operator(.)ident(count) - ident(no_of_projects) operator(=) constant(Project)operator(.)ident(count) - ident(aredridel) operator(=) constant(Developer)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(aredridel)operator(.)ident(projects)operator(.)ident(concat)operator(()operator([)constant(Project)operator(.)ident(find)operator(()integer(1)operator(\))operator(,) ident(p) operator(=) constant(Project)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\))operator(])operator(\)) - ident(assert) ident(aredridel)operator(.)ident(new_record?) - ident(assert) ident(p)operator(.)ident(new_record?) - ident(assert) ident(aredridel)operator(.)ident(save) - ident(assert) operator(!)ident(aredridel)operator(.)ident(new_record?) - ident(assert_equal) ident(no_of_devels)operator(+)integer(1)operator(,) constant(Developer)operator(.)ident(count) - ident(assert_equal) ident(no_of_projects)operator(+)integer(1)operator(,) constant(Project)operator(.)ident(count) - ident(assert_equal) integer(2)operator(,) ident(aredridel)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(aredridel)operator(.)ident(projects)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_habtm_adding_before_save_with_join_attributes) - ident(no_of_devels) operator(=) constant(Developer)operator(.)ident(count) - ident(no_of_projects) operator(=) constant(Project)operator(.)ident(count) - ident(now) operator(=) constant(Date)operator(.)ident(today) - ident(ken) operator(=) constant(Developer)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(ken)operator(.)ident(projects)operator(.)ident(push_with_attributes)operator(() constant(Project)operator(.)ident(find)operator(()integer(1)operator(\))operator(,) symbol(:joined_on) operator(=)operator(>) ident(now) operator(\)) - ident(p) operator(=) constant(Project)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(ken)operator(.)ident(projects)operator(.)ident(push_with_attributes)operator(() ident(p)operator(,) symbol(:joined_on) operator(=)operator(>) ident(now) operator(\)) - ident(assert) ident(ken)operator(.)ident(new_record?) - ident(assert) ident(p)operator(.)ident(new_record?) - ident(assert) ident(ken)operator(.)ident(save) - ident(assert) operator(!)ident(ken)operator(.)ident(new_record?) - ident(assert_equal) ident(no_of_devels)operator(+)integer(1)operator(,) constant(Developer)operator(.)ident(count) - ident(assert_equal) ident(no_of_projects)operator(+)integer(1)operator(,) constant(Project)operator(.)ident(count) - ident(assert_equal) integer(2)operator(,) ident(ken)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(ken)operator(.)ident(projects)operator(()pre_constant(true)operator(\))operator(.)ident(size) - - ident(kenReloaded) operator(=) constant(Developer)operator(.)ident(find_by_name) string - ident(kenReloaded)operator(.)ident(projects)operator(.)ident(each) operator({)operator(|)ident(prj)operator(|) ident(assert_date_from_db)operator(()ident(now)operator(,) ident(prj)operator(.)ident(joined_on)operator(\))operator(}) - reserved(end) - - reserved(def) method(test_habtm_saving_multiple_relationships) - ident(new_project) operator(=) constant(Project)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(amount_of_developers) operator(=) integer(4) - ident(developers) operator(=) operator(()integer(0)operator(..)ident(amount_of_developers)operator(\))operator(.)ident(collect) operator({)operator(|)ident(i)operator(|) constant(Developer)operator(.)ident(create)operator(()symbol(:name) operator(=)operator(>) stringdelimiter(")>operator(\)) operator(}) - - ident(new_project)operator(.)ident(developer_ids) operator(=) operator([)ident(developers)operator([)integer(0)operator(])operator(.)ident(id)operator(,) ident(developers)operator([)integer(1)operator(])operator(.)ident(id)operator(]) - ident(new_project)operator(.)ident(developers_with_callback_ids) operator(=) operator([)ident(developers)operator([)integer(2)operator(])operator(.)ident(id)operator(,) ident(developers)operator([)integer(3)operator(])operator(.)ident(id)operator(]) - ident(assert) ident(new_project)operator(.)ident(save) - - ident(new_project)operator(.)ident(reload) - ident(assert_equal) ident(amount_of_developers)operator(,) ident(new_project)operator(.)ident(developers)operator(.)ident(size) - ident(amount_of_developers)operator(.)ident(times) reserved(do) operator(|)ident(i)operator(|) - ident(assert_equal) ident(developers)operator([)ident(i)operator(])operator(.)ident(name)operator(,) ident(new_project)operator(.)ident(developers)operator([)ident(i)operator(])operator(.)ident(name) - reserved(end) - reserved(end) - - reserved(def) method(test_build) - ident(devel) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(proj) operator(=) ident(devel)operator(.)ident(projects)operator(.)ident(build)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(devel)operator(.)ident(projects)operator(.)ident(last)operator(,) ident(proj) - ident(assert) ident(proj)operator(.)ident(new_record?) - ident(devel)operator(.)ident(save) - ident(assert) operator(!)ident(proj)operator(.)ident(new_record?) - ident(assert_equal) ident(devel)operator(.)ident(projects)operator(.)ident(last)operator(,) ident(proj) - reserved(end) - - reserved(def) method(test_create) - ident(devel) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(proj) operator(=) ident(devel)operator(.)ident(projects)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(devel)operator(.)ident(projects)operator(.)ident(last)operator(,) ident(proj) - ident(assert) operator(!)ident(proj)operator(.)ident(new_record?) - reserved(end) - - reserved(def) method(test_uniq_after_the_fact) - ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects) operator(<<) ident(projects)operator(()symbol(:active_record)operator(\)) - ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects) operator(<<) ident(projects)operator(()symbol(:active_record)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects)operator(.)ident(uniq)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_uniq_before_the_fact) - ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers) operator(<<) ident(developers)operator(()symbol(:jamis)operator(\)) - ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers) operator(<<) ident(developers)operator(()symbol(:david)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(projects)operator(()symbol(:active_record)operator(,) symbol(:reload)operator(\))operator(.)ident(developers)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_deleting) - ident(david) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(active_record) operator(=) constant(Project)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(david)operator(.)ident(projects)operator(.)ident(reload) - ident(assert_equal) integer(2)operator(,) ident(david)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(3)operator(,) ident(active_record)operator(.)ident(developers)operator(.)ident(size) - - ident(david)operator(.)ident(projects)operator(.)ident(delete)operator(()ident(active_record)operator(\)) - - ident(assert_equal) integer(1)operator(,) ident(david)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(david)operator(.)ident(projects)operator(()pre_constant(true)operator(\))operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) ident(active_record)operator(.)ident(developers)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_deleting_array) - ident(david) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(david)operator(.)ident(projects)operator(.)ident(reload) - ident(david)operator(.)ident(projects)operator(.)ident(delete)operator(()constant(Project)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(\)) - ident(assert_equal) integer(0)operator(,) ident(david)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(david)operator(.)ident(projects)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_deleting_with_sql) - ident(david) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(active_record) operator(=) constant(Project)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(active_record)operator(.)ident(developers)operator(.)ident(reload) - ident(assert_equal) integer(3)operator(,) ident(active_record)operator(.)ident(developers_by_sql)operator(.)ident(size) - - ident(active_record)operator(.)ident(developers_by_sql)operator(.)ident(delete)operator(()ident(david)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(active_record)operator(.)ident(developers_by_sql)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_deleting_array_with_sql) - ident(active_record) operator(=) constant(Project)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(active_record)operator(.)ident(developers)operator(.)ident(reload) - ident(assert_equal) integer(3)operator(,) ident(active_record)operator(.)ident(developers_by_sql)operator(.)ident(size) - - ident(active_record)operator(.)ident(developers_by_sql)operator(.)ident(delete)operator(()constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(\)) - ident(assert_equal) integer(0)operator(,) ident(active_record)operator(.)ident(developers_by_sql)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_deleting_all) - ident(david) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(david)operator(.)ident(projects)operator(.)ident(reload) - ident(david)operator(.)ident(projects)operator(.)ident(clear) - ident(assert_equal) integer(0)operator(,) ident(david)operator(.)ident(projects)operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) ident(david)operator(.)ident(projects)operator(()pre_constant(true)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_removing_associations_on_destroy) - ident(david) operator(=) constant(DeveloperWithBeforeDestroyRaise)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) operator(!)ident(david)operator(.)ident(projects)operator(.)ident(empty?) - ident(assert_nothing_raised) operator({) ident(david)operator(.)ident(destroy) operator(}) - ident(assert) ident(david)operator(.)ident(projects)operator(.)ident(empty?) - ident(assert) constant(DeveloperWithBeforeDestroyRaise)operator(.)ident(connection)operator(.)ident(select_all)operator(()stringoperator(\))operator(.)ident(empty?) - reserved(end) - - reserved(def) method(test_additional_columns_from_join_table) - ident(assert_date_from_db) constant(Date)operator(.)ident(new)operator(()integer(2004)operator(,) integer(10)operator(,) integer(10)operator(\))operator(,) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(projects)operator(.)ident(first)operator(.)ident(joined_on) - reserved(end) - - reserved(def) method(test_destroy_all) - ident(david) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(david)operator(.)ident(projects)operator(.)ident(reload) - ident(assert) operator(!)ident(david)operator(.)ident(projects)operator(.)ident(empty?) - ident(david)operator(.)ident(projects)operator(.)ident(destroy_all) - ident(assert) ident(david)operator(.)ident(projects)operator(.)ident(empty?) - ident(assert) ident(david)operator(.)ident(projects)operator(()pre_constant(true)operator(\))operator(.)ident(empty?) - reserved(end) - - reserved(def) method(test_rich_association) - ident(jamis) operator(=) ident(developers)operator(()symbol(:jamis)operator(\)) - ident(jamis)operator(.)ident(projects)operator(.)ident(push_with_attributes)operator(()ident(projects)operator(()symbol(:action_controller)operator(\))operator(,) symbol(:joined_on) operator(=)operator(>) constant(Date)operator(.)ident(today)operator(\)) - - ident(assert_date_from_db) constant(Date)operator(.)ident(today)operator(,) ident(jamis)operator(.)ident(projects)operator(.)ident(select) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(name) operator(==) ident(projects)operator(()symbol(:action_controller)operator(\))operator(.)ident(name) operator(})operator(.)ident(first)operator(.)ident(joined_on) - ident(assert_date_from_db) constant(Date)operator(.)ident(today)operator(,) ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(projects)operator(.)ident(select) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(name) operator(==) ident(projects)operator(()symbol(:action_controller)operator(\))operator(.)ident(name) operator(})operator(.)ident(first)operator(.)ident(joined_on) - reserved(end) - - reserved(def) method(test_associations_with_conditions) - ident(assert_equal) integer(3)operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers_named_david)operator(.)ident(size) - - ident(assert_equal) ident(developers)operator(()symbol(:david)operator(\))operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers_named_david)operator(.)ident(find)operator(()ident(developers)operator(()symbol(:david)operator(\))operator(.)ident(id)operator(\)) - ident(assert_equal) ident(developers)operator(()symbol(:david)operator(\))operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(salaried_developers)operator(.)ident(find)operator(()ident(developers)operator(()symbol(:david)operator(\))operator(.)ident(id)operator(\)) - - ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers_named_david)operator(.)ident(clear) - ident(assert_equal) integer(2)operator(,) ident(projects)operator(()symbol(:active_record)operator(,) symbol(:reload)operator(\))operator(.)ident(developers)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_find_in_association) - comment(# Using sql) - ident(assert_equal) ident(developers)operator(()symbol(:david)operator(\))operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers)operator(.)ident(find)operator(()ident(developers)operator(()symbol(:david)operator(\))operator(.)ident(id)operator(\))operator(,) string - - comment(# Using ruby) - ident(active_record) operator(=) ident(projects)operator(()symbol(:active_record)operator(\)) - ident(active_record)operator(.)ident(developers)operator(.)ident(reload) - ident(assert_equal) ident(developers)operator(()symbol(:david)operator(\))operator(,) ident(active_record)operator(.)ident(developers)operator(.)ident(find)operator(()ident(developers)operator(()symbol(:david)operator(\))operator(.)ident(id)operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_find_in_association_with_custom_finder_sql) - ident(assert_equal) ident(developers)operator(()symbol(:david)operator(\))operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers_with_finder_sql)operator(.)ident(find)operator(()ident(developers)operator(()symbol(:david)operator(\))operator(.)ident(id)operator(\))operator(,) string - - ident(active_record) operator(=) ident(projects)operator(()symbol(:active_record)operator(\)) - ident(active_record)operator(.)ident(developers_with_finder_sql)operator(.)ident(reload) - ident(assert_equal) ident(developers)operator(()symbol(:david)operator(\))operator(,) ident(active_record)operator(.)ident(developers_with_finder_sql)operator(.)ident(find)operator(()ident(developers)operator(()symbol(:david)operator(\))operator(.)ident(id)operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_find_in_association_with_custom_finder_sql_and_string_id) - ident(assert_equal) ident(developers)operator(()symbol(:david)operator(\))operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers_with_finder_sql)operator(.)ident(find)operator(()ident(developers)operator(()symbol(:david)operator(\))operator(.)ident(id)operator(.)ident(to_s)operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_find_with_merged_options) - ident(assert_equal) integer(1)operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(limited_developers)operator(.)ident(size) - ident(assert_equal) integer(1)operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(limited_developers)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(size) - ident(assert_equal) integer(3)operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(limited_developers)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:limit) operator(=)operator(>) pre_constant(nil)operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_new_with_values_in_collection) - ident(jamis) operator(=) constant(DeveloperForProjectWithAfterCreateHook)operator(.)ident(find_by_name)operator(()stringoperator(\)) - ident(david) operator(=) constant(DeveloperForProjectWithAfterCreateHook)operator(.)ident(find_by_name)operator(()stringoperator(\)) - ident(project) operator(=) constant(ProjectWithAfterCreateHook)operator(.)ident(new)operator(()symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(project)operator(.)ident(developers) operator(<<) ident(jamis) - ident(project)operator(.)ident(save!) - ident(project)operator(.)ident(reload) - - ident(assert) ident(project)operator(.)ident(developers)operator(.)ident(include?)operator(()ident(jamis)operator(\)) - ident(assert) ident(project)operator(.)ident(developers)operator(.)ident(include?)operator(()ident(david)operator(\)) - reserved(end) - - reserved(def) method(test_find_in_association_with_options) - ident(developers) operator(=) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers)operator(.)ident(find)operator(()symbol(:all)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(developers)operator(.)ident(size) - - ident(assert_equal) ident(developers)operator(()symbol(:poor_jamis)operator(\))operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(developers)operator(()symbol(:jamis)operator(\))operator(,) ident(projects)operator(()symbol(:active_record)operator(\))operator(.)ident(developers)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_replace_with_less) - ident(david) operator(=) ident(developers)operator(()symbol(:david)operator(\)) - ident(david)operator(.)ident(projects) operator(=) operator([)ident(projects)operator(()symbol(:action_controller)operator(\))operator(]) - ident(assert) ident(david)operator(.)ident(save) - ident(assert_equal) integer(1)operator(,) ident(david)operator(.)ident(projects)operator(.)ident(length) - reserved(end) - - reserved(def) method(test_replace_with_new) - ident(david) operator(=) ident(developers)operator(()symbol(:david)operator(\)) - ident(david)operator(.)ident(projects) operator(=) operator([)ident(projects)operator(()symbol(:action_controller)operator(\))operator(,) constant(Project)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\))operator(]) - ident(david)operator(.)ident(save) - ident(assert_equal) integer(2)operator(,) ident(david)operator(.)ident(projects)operator(.)ident(length) - ident(assert) operator(!)ident(david)operator(.)ident(projects)operator(.)ident(include?)operator(()ident(projects)operator(()symbol(:active_record)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_replace_on_new_object) - ident(new_developer) operator(=) constant(Developer)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(new_developer)operator(.)ident(projects) operator(=) operator([)ident(projects)operator(()symbol(:action_controller)operator(\))operator(,) constant(Project)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\))operator(]) - ident(new_developer)operator(.)ident(save) - ident(assert_equal) integer(2)operator(,) ident(new_developer)operator(.)ident(projects)operator(.)ident(length) - reserved(end) - - reserved(def) method(test_consider_type) - ident(developer) operator(=) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(special_project) operator(=) constant(SpecialProject)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - - ident(other_project) operator(=) ident(developer)operator(.)ident(projects)operator(.)ident(first) - ident(developer)operator(.)ident(special_projects) operator(<<) ident(special_project) - ident(developer)operator(.)ident(reload) - - ident(assert) ident(developer)operator(.)ident(projects)operator(.)ident(include?)operator(()ident(special_project)operator(\)) - ident(assert) ident(developer)operator(.)ident(special_projects)operator(.)ident(include?)operator(()ident(special_project)operator(\)) - ident(assert) operator(!)ident(developer)operator(.)ident(special_projects)operator(.)ident(include?)operator(()ident(other_project)operator(\)) - reserved(end) - - reserved(def) method(test_update_attributes_after_push_without_duplicate_join_table_rows) - ident(developer) operator(=) constant(Developer)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(project) operator(=) constant(SpecialProject)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(developer)operator(.)ident(save) - ident(developer)operator(.)ident(projects) operator(<<) ident(project) - ident(developer)operator(.)ident(update_attribute)operator(()stringoperator(,) stringoperator(\)) - ident(assert_equal) integer(1)operator(,) constant(Developer)operator(.)ident(connection)operator(.)ident(select_value)operator(()stringoperator(\))operator(.)ident(to_i)stringcontent( - AND developer_id = )inlinedelimiter( - end_sql)> - reserved(end) - - reserved(def) method(test_updating_attributes_on_non_rich_associations) - ident(welcome) operator(=) ident(categories)operator(()symbol(:technology)operator(\))operator(.)ident(posts)operator(.)ident(first) - ident(welcome)operator(.)ident(title) operator(=) string - ident(assert) ident(welcome)operator(.)ident(save!) - reserved(end) - - reserved(def) method(test_updating_attributes_on_rich_associations) - ident(david) operator(=) ident(projects)operator(()symbol(:action_controller)operator(\))operator(.)ident(developers)operator(.)ident(first) - ident(david)operator(.)ident(name) operator(=) string - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(ReadOnlyRecord)operator(\)) operator({) ident(david)operator(.)ident(save!) operator(}) - reserved(end) - - - reserved(def) method(test_updating_attributes_on_rich_associations_with_limited_find) - ident(david) operator(=) ident(projects)operator(()symbol(:action_controller)operator(\))operator(.)ident(developers)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:select) operator(=)operator(>) stringoperator(\))operator(.)ident(first) - ident(david)operator(.)ident(name) operator(=) string - ident(assert) ident(david)operator(.)ident(save!) - reserved(end) - - reserved(def) method(test_join_table_alias) - ident(assert_equal) integer(3)operator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:include) operator(=)operator(>) operator({)symbol(:projects) operator(=)operator(>) symbol(:developers)operator(})operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\))operator(.)ident(size) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(Category) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) reserved(end) -reserved(class) class(Smarts) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) reserved(end) -reserved(class) class(CreditCard) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) reserved(end) -reserved(class) class(MasterCreditCard) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) reserved(end) -reserved(class) class(Post) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) reserved(end) -reserved(class) class(Computer) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) reserved(end) -reserved(class) class(NonExistentTable) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) reserved(end) -reserved(class) class(TestOracleDefault) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) reserved(end) - -reserved(class) class(LoosePerson) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(attr_protected) symbol(:credit_rating)operator(,) symbol(:administrator) - pre_constant(self)operator(.)ident(abstract_class) operator(=) pre_constant(true) -reserved(end) - -reserved(class) class(LooseDescendant) operator(<) constant(LoosePerson) - ident(attr_protected) symbol(:phone_number) -reserved(end) - -reserved(class) class(TightPerson) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(attr_accessible) symbol(:name)operator(,) symbol(:address) -reserved(end) - -reserved(class) class(TightDescendant) operator(<) constant(TightPerson) - ident(attr_accessible) symbol(:phone_number) -reserved(end) - -reserved(class) class(Booleantest) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) reserved(end) - -reserved(class) class(Task) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(attr_protected) symbol(:starting) -reserved(end) - -reserved(class) class(BasicsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:topics)operator(,) symbol(:companies)operator(,) symbol(:developers)operator(,) symbol(:projects)operator(,) symbol(:computers) - - reserved(def) method(test_table_exists) - ident(assert) operator(!)constant(NonExistentTable)operator(.)ident(table_exists?) - ident(assert) constant(Topic)operator(.)ident(table_exists?) - reserved(end) - - reserved(def) method(test_set_attributes) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(topic)operator(.)ident(attributes) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(}) - ident(topic)operator(.)ident(save) - ident(assert_equal)operator(()stringoperator(,) ident(topic)operator(.)ident(title)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(topic)operator(.)ident(author_name)operator(\)) - ident(assert_equal)operator(()ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(author_email_address)operator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(author_email_address)operator(\)) - reserved(end) - - reserved(def) method(test_integers_as_nil) - ident(test) operator(=) constant(AutoId)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_nil) constant(AutoId)operator(.)ident(find)operator(()ident(test)operator(.)ident(id)operator(\))operator(.)ident(value) - reserved(end) - - reserved(def) method(test_set_attributes_with_block) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(title) operator(=) string - ident(t)operator(.)ident(author_name) operator(=) string - reserved(end) - - ident(assert_equal)operator(()stringoperator(,) ident(topic)operator(.)ident(title)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(topic)operator(.)ident(author_name)operator(\)) - reserved(end) - - reserved(def) method(test_respond_to?) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) ident(topic)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(topic)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(topic)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(topic)operator(.)ident(respond_to?)operator(()symbol(:title)operator(\)) - ident(assert) ident(topic)operator(.)ident(respond_to?)operator(()symbol(:title?)operator(\)) - ident(assert) ident(topic)operator(.)ident(respond_to?)operator(()symbol(:title=)operator(\)) - ident(assert) ident(topic)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(topic)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) operator(!)ident(topic)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) operator(!)ident(topic)operator(.)ident(respond_to?)operator(()symbol(:nothingness)operator(\)) - reserved(end) - - reserved(def) method(test_array_content) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(content) operator(=) string - ident(topic)operator(.)ident(save) - - ident(assert_equal)operator(()stringoperator(,) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\))operator(.)ident(content)operator(\)) - reserved(end) - - reserved(def) method(test_hash_content) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(content) operator(=) operator({) string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) integer(2) operator(}) - ident(topic)operator(.)ident(save) - - ident(assert_equal) integer(2)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\))operator(.)ident(content)operator([)stringoperator(]) - - ident(topic)operator(.)ident(content)operator([)stringoperator(]) operator(=) integer(3) - ident(topic)operator(.)ident(save) - - ident(assert_equal) integer(3)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\))operator(.)ident(content)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_update_array_content) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(content) operator(=) string - - ident(topic)operator(.)ident(content)operator(.)ident(push) string - ident(assert_equal)operator(()stringoperator(,) ident(topic)operator(.)ident(content)operator(\)) - - ident(topic)operator(.)ident(save) - - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\)) - ident(topic)operator(.)ident(content) operator(<<) string - ident(assert_equal)operator(()stringoperator(,) ident(topic)operator(.)ident(content)operator(\)) - reserved(end) - - reserved(def) method(test_case_sensitive_attributes_hash) - comment(# DB2 is not case-sensitive) - reserved(return) pre_constant(true) reserved(if) ident(current_adapter?)operator(()symbol(:DB2Adapter)operator(\)) - - ident(assert_equal) instance_variable(@loaded_fixtures)operator([)stringoperator(])operator([)stringoperator(])operator(.)ident(to_hash)operator(,) constant(Computer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(attributes) - reserved(end) - - reserved(def) method(test_create) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(title) operator(=) string - ident(topic)operator(.)ident(save) - ident(topic_reloaded) operator(=) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(topic_reloaded)operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_save!) - ident(topic) operator(=) constant(Topic)operator(.)ident(new)operator(()symbol(:title) operator(=)operator(>) stringoperator(\)) - ident(assert) ident(topic)operator(.)ident(save!) - reserved(end) - - reserved(def) method(test_hashes_not_mangled) - ident(new_topic) operator(=) operator({) symbol(:title) operator(=)operator(>) string operator(}) - ident(new_topic_values) operator(=) operator({) symbol(:title) operator(=)operator(>) string operator(}) - - ident(topic) operator(=) constant(Topic)operator(.)ident(new)operator(()ident(new_topic)operator(\)) - ident(assert_equal) ident(new_topic)operator([)symbol(:title)operator(])operator(,) ident(topic)operator(.)ident(title) - - ident(topic)operator(.)ident(attributes)operator(=) ident(new_topic_values) - ident(assert_equal) ident(new_topic_values)operator([)symbol(:title)operator(])operator(,) ident(topic)operator(.)ident(title) - reserved(end) - - reserved(def) method(test_create_many) - ident(topics) operator(=) constant(Topic)operator(.)ident(create)operator(()operator([) operator({) string operator(=)operator(>) string operator(})operator(,) operator({) string operator(=)operator(>) string operator(})operator(])operator(\)) - ident(assert_equal) integer(2)operator(,) ident(topics)operator(.)ident(size) - ident(assert_equal) stringoperator(,) ident(topics)operator(.)ident(first)operator(.)ident(title) - reserved(end) - - reserved(def) method(test_create_columns_not_equal_attributes) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(title) operator(=) string - ident(topic)operator(.)ident(send) symbol(:write_attribute)operator(,) stringoperator(,) string - ident(assert_nothing_raised) operator({) ident(topic)operator(.)ident(save) operator(}) - reserved(end) - - reserved(def) method(test_create_through_factory) - ident(topic) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(topicReloaded) operator(=) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\)) - ident(assert_equal)operator(()ident(topic)operator(,) ident(topicReloaded)operator(\)) - reserved(end) - - reserved(def) method(test_update) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(title) operator(=) string - ident(topic)operator(.)ident(written_on) operator(=) string - ident(topic)operator(.)ident(save) - ident(topicReloaded) operator(=) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(topicReloaded)operator(.)ident(title)operator(\)) - - ident(topicReloaded)operator(.)ident(title) operator(=) string - ident(topicReloaded)operator(.)ident(save) - - ident(topicReloadedAgain) operator(=) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\)) - - ident(assert_equal)operator(()stringoperator(,) ident(topicReloadedAgain)operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_update_columns_not_equal_attributes) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(title) operator(=) string - ident(topic)operator(.)ident(save) - - ident(topicReloaded) operator(=) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\)) - ident(topicReloaded)operator(.)ident(title) operator(=) string - ident(topicReloaded)operator(.)ident(send) symbol(:write_attribute)operator(,) stringoperator(,) string - ident(assert_nothing_raised) operator({) ident(topicReloaded)operator(.)ident(save) operator(}) - reserved(end) - - reserved(def) method(test_write_attribute) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(send)operator(()symbol(:write_attribute)operator(,) symbol(:title)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(topic)operator(.)ident(title) - - ident(topic)operator(.)ident(send)operator(()symbol(:write_attribute)operator(,) stringoperator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(topic)operator(.)ident(title) - reserved(end) - - reserved(def) method(test_read_attribute) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(title) operator(=) string - ident(assert_equal) stringoperator(,) ident(topic)operator(.)ident(send)operator(()symbol(:read_attribute)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(topic)operator([)stringoperator(]) - - ident(assert_equal) stringoperator(,) ident(topic)operator(.)ident(send)operator(()symbol(:read_attribute)operator(,) symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(topic)operator([)symbol(:title)operator(]) - reserved(end) - - reserved(def) method(test_read_attribute_when_false) - ident(topic) operator(=) ident(topics)operator(()symbol(:first)operator(\)) - ident(topic)operator(.)ident(approved) operator(=) pre_constant(false) - ident(assert) operator(!)ident(topic)operator(.)ident(approved?)operator(,) string - ident(topic)operator(.)ident(approved) operator(=) string - ident(assert) operator(!)ident(topic)operator(.)ident(approved?)operator(,) string - reserved(end) - - reserved(def) method(test_read_attribute_when_true) - ident(topic) operator(=) ident(topics)operator(()symbol(:first)operator(\)) - ident(topic)operator(.)ident(approved) operator(=) pre_constant(true) - ident(assert) ident(topic)operator(.)ident(approved?)operator(,) string - ident(topic)operator(.)ident(approved) operator(=) string - ident(assert) ident(topic)operator(.)ident(approved?)operator(,) string - reserved(end) - - reserved(def) method(test_read_write_boolean_attribute) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - comment(# puts "") - comment(# puts "New Topic") - comment(# puts topic.inspect) - ident(topic)operator(.)ident(approved) operator(=) string - comment(# puts "Expecting false") - comment(# puts topic.inspect) - ident(assert) operator(!)ident(topic)operator(.)ident(approved?)operator(,) string - ident(topic)operator(.)ident(approved) operator(=) string - comment(# puts "Expecting false") - comment(# puts topic.inspect) - ident(assert) operator(!)ident(topic)operator(.)ident(approved?)operator(,) string - ident(topic)operator(.)ident(approved) operator(=) string - comment(# puts "Expecting true") - comment(# puts topic.inspect) - ident(assert) ident(topic)operator(.)ident(approved?)operator(,) string - ident(topic)operator(.)ident(approved) operator(=) string - comment(# puts "Expecting true") - comment(# puts topic.inspect) - ident(assert) ident(topic)operator(.)ident(approved?)operator(,) string - comment(# puts "") - reserved(end) - - reserved(def) method(test_reader_generation) - constant(Topic)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(title) - constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name) - constant(Client)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name) - reserved(if) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(generate_read_methods) - ident(assert_readers)operator(()constant(Topic)operator(,) stringoperator(\)) - ident(assert_readers)operator(()constant(Firm)operator(,) stringoperator(\)) - ident(assert_readers)operator(()constant(Client)operator(,) stringoperator(\)) - reserved(else) - operator([)constant(Topic)operator(,) constant(Firm)operator(,) constant(Client)operator(])operator(.)ident(each) operator({)operator(|)ident(klass)operator(|) ident(assert_equal) ident(klass)operator(.)ident(read_methods)operator(,) operator({)operator(})operator(}) - reserved(end) - reserved(end) - - reserved(def) method(test_reader_for_invalid_column_names) - comment(# column names which aren't legal ruby ids) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(topic)operator(.)ident(send)operator(()symbol(:define_read_method)operator(,) stringoperator(.)ident(to_sym)operator(,) stringoperator(,) pre_constant(nil)operator(\)) - ident(assert) operator(!)constant(Topic)operator(.)ident(read_methods)operator(.)ident(include?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_non_attribute_access_and_assignment) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(assert) operator(!)ident(topic)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert_raises)operator(()constant(NoMethodError)operator(\)) operator({) ident(topic)operator(.)ident(mumbo) operator(}) - ident(assert_raises)operator(()constant(NoMethodError)operator(\)) operator({) ident(topic)operator(.)ident(mumbo) operator(=) integer(5) operator(}) - reserved(end) - - reserved(def) method(test_preserving_date_objects) - comment(# SQL Server doesn't have a separate column type just for dates, so all are returned as time) - reserved(return) pre_constant(true) reserved(if) ident(current_adapter?)operator(()symbol(:SQLServerAdapter)operator(\)) - - reserved(if) ident(current_adapter?)operator(()symbol(:SybaseAdapter)operator(\)) - comment(# Sybase ctlib does not (yet?\) support the date type; use datetime instead.) - ident(assert_kind_of)operator(() - constant(Time)operator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(last_read)operator(,) - string - operator(\)) - reserved(else) - ident(assert_kind_of)operator(() - constant(Date)operator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(last_read)operator(,) - string - operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_preserving_time_objects) - ident(assert_kind_of)operator(() - constant(Time)operator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(bonus_time)operator(,) - string - operator(\)) - - ident(assert_kind_of)operator(() - constant(Time)operator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(written_on)operator(,) - string - operator(\)) - reserved(end) - - reserved(def) method(test_destroy) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(title) operator(=) string - ident(topic)operator(.)ident(written_on) operator(=) string - ident(topic)operator(.)ident(save) - ident(topic)operator(.)ident(destroy) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_destroy_returns_self) - ident(topic) operator(=) constant(Topic)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(topic)operator(.)ident(save) - ident(assert_equal) ident(topic)operator(,) ident(topic)operator(.)ident(destroy)operator(,) string - reserved(end) - - reserved(def) method(test_record_not_found_exception) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) ident(topicReloaded) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(99999)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_initialize_with_attributes) - ident(topic) operator(=) constant(Topic)operator(.)ident(new)operator(()operator({) - string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - operator(})operator(\)) - - ident(assert_equal)operator(()stringoperator(,) ident(topic)operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_initialize_with_invalid_attribute) - reserved(begin) - ident(topic) operator(=) constant(Topic)operator(.)ident(new)operator(()operator({) string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(})operator(\)) - reserved(rescue) constant(ActiveRecord)operator(::)constant(MultiparameterAssignmentErrors) operator(=)operator(>) ident(ex) - ident(assert_equal)operator(()integer(1)operator(,) ident(ex)operator(.)ident(errors)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(ex)operator(.)ident(errors)operator([)integer(0)operator(])operator(.)ident(attribute)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_load) - ident(topics) operator(=) constant(Topic)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal)operator(()integer(2)operator(,) ident(topics)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(title)operator(,) ident(topics)operator(.)ident(first)operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_load_with_condition) - ident(topics) operator(=) constant(Topic)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - - ident(assert_equal)operator(()integer(1)operator(,) ident(topics)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()ident(topics)operator(()symbol(:second)operator(\))operator(.)ident(title)operator(,) ident(topics)operator(.)ident(first)operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_table_name_guesses) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(table_name) - - ident(assert_equal) stringoperator(,) constant(Category)operator(.)ident(table_name) - ident(assert_equal) stringoperator(,) constant(Smarts)operator(.)ident(table_name) - ident(assert_equal) stringoperator(,) constant(CreditCard)operator(.)ident(table_name) - ident(assert_equal) stringoperator(,) constant(MasterCreditCard)operator(.)ident(table_name) - - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(pluralize_table_names) operator(=) pre_constant(false) - operator([)constant(Category)operator(,) constant(Smarts)operator(,) constant(CreditCard)operator(,) constant(MasterCreditCard)operator(])operator(.)ident(each)operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(reset_table_name)operator(}) - ident(assert_equal) stringoperator(,) constant(Category)operator(.)ident(table_name) - ident(assert_equal) stringoperator(,) constant(Smarts)operator(.)ident(table_name) - ident(assert_equal) stringoperator(,) constant(CreditCard)operator(.)ident(table_name) - ident(assert_equal) stringoperator(,) constant(MasterCreditCard)operator(.)ident(table_name) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(pluralize_table_names) operator(=) pre_constant(true) - operator([)constant(Category)operator(,) constant(Smarts)operator(,) constant(CreditCard)operator(,) constant(MasterCreditCard)operator(])operator(.)ident(each)operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(reset_table_name)operator(}) - - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(Category)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(Category)operator(.)ident(table_name) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - constant(Category)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(Category)operator(.)ident(table_name) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(Category)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(Category)operator(.)ident(table_name) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - constant(Category)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(Category)operator(.)ident(table_name) - - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(pluralize_table_names) operator(=) pre_constant(false) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(Category)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(Category)operator(.)ident(table_name) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - constant(Category)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(Category)operator(.)ident(table_name) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(Category)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(Category)operator(.)ident(table_name) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - constant(Category)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(Category)operator(.)ident(table_name) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(pluralize_table_names) operator(=) pre_constant(true) - operator([)constant(Category)operator(,) constant(Smarts)operator(,) constant(CreditCard)operator(,) constant(MasterCreditCard)operator(])operator(.)ident(each)operator({)operator(|)ident(c)operator(|) ident(c)operator(.)ident(reset_table_name)operator(}) - reserved(end) - - reserved(def) method(test_destroy_all) - ident(assert_equal) integer(2)operator(,) constant(Topic)operator(.)ident(count) - - constant(Topic)operator(.)ident(destroy_all) string - ident(assert_equal) integer(1)operator(,) constant(Topic)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_destroy_many) - ident(assert_equal) integer(3)operator(,) constant(Client)operator(.)ident(count) - constant(Client)operator(.)ident(destroy)operator(()operator([)integer(2)operator(,) integer(3)operator(])operator(\)) - ident(assert_equal) integer(1)operator(,) constant(Client)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_delete_many) - constant(Topic)operator(.)ident(delete)operator(()operator([)integer(1)operator(,) integer(2)operator(])operator(\)) - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_boolean_attributes) - ident(assert) operator(!) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(approved?) - ident(assert) constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(approved?) - reserved(end) - - reserved(def) method(test_increment_counter) - constant(Topic)operator(.)ident(increment_counter)operator(()stringoperator(,) integer(1)operator(\)) - ident(assert_equal) integer(1)operator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(replies_count) - - constant(Topic)operator(.)ident(increment_counter)operator(()stringoperator(,) integer(1)operator(\)) - ident(assert_equal) integer(2)operator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(replies_count) - reserved(end) - - reserved(def) method(test_decrement_counter) - constant(Topic)operator(.)ident(decrement_counter)operator(()stringoperator(,) integer(2)operator(\)) - ident(assert_equal) integer(1)operator(,) constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(replies_count) - - constant(Topic)operator(.)ident(decrement_counter)operator(()stringoperator(,) integer(2)operator(\)) - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(replies_count) - reserved(end) - - reserved(def) method(test_update_all) - comment(# The ADO library doesn't support the number of affected rows) - reserved(return) pre_constant(true) reserved(if) ident(current_adapter?)operator(()symbol(:SQLServerAdapter)operator(\)) - - ident(assert_equal) integer(2)operator(,) constant(Topic)operator(.)ident(update_all)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(content) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(content) - ident(assert_equal) integer(2)operator(,) constant(Topic)operator(.)ident(update_all)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(content) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(content) - reserved(end) - - reserved(def) method(test_update_many) - ident(topic_data) operator(=) operator({) integer(1) operator(=)operator(>) operator({) string operator(=)operator(>) string operator(})operator(,) integer(2) operator(=)operator(>) operator({) string operator(=)operator(>) string operator(}) operator(}) - ident(updated) operator(=) constant(Topic)operator(.)ident(update)operator(()ident(topic_data)operator(.)ident(keys)operator(,) ident(topic_data)operator(.)ident(values)operator(\)) - - ident(assert_equal) integer(2)operator(,) ident(updated)operator(.)ident(size) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(content) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(content) - reserved(end) - - reserved(def) method(test_delete_all) - comment(# The ADO library doesn't support the number of affected rows) - reserved(return) pre_constant(true) reserved(if) ident(current_adapter?)operator(()symbol(:SQLServerAdapter)operator(\)) - - ident(assert_equal) integer(2)operator(,) constant(Topic)operator(.)ident(delete_all) - reserved(end) - - reserved(def) method(test_update_by_condition) - constant(Topic)operator(.)ident(update_all) stringoperator(,) operator([)stringoperator(,) pre_constant(true)operator(]) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(content) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(content) - reserved(end) - - reserved(def) method(test_attribute_present) - ident(t) operator(=) constant(Topic)operator(.)ident(new) - ident(t)operator(.)ident(title) operator(=) string - ident(t)operator(.)ident(written_on) operator(=) constant(Time)operator(.)ident(now) - ident(assert) ident(t)operator(.)ident(attribute_present?)operator(()stringoperator(\)) - ident(assert) ident(t)operator(.)ident(attribute_present?)operator(()stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(attribute_present?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_attribute_keys_on_new_instance) - ident(t) operator(=) constant(Topic)operator(.)ident(new) - ident(assert_equal) pre_constant(nil)operator(,) ident(t)operator(.)ident(title)operator(,) string - ident(assert_raise)operator(()constant(NoMethodError)operator(\)) operator({) ident(t)operator(.)ident(title2) operator(}) - reserved(end) - - reserved(def) method(test_class_name) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(class_name)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(class_name)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(class_name)operator(()stringoperator(\)) - - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(pluralize_table_names) operator(=) pre_constant(false) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(class_name)operator(() string operator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(pluralize_table_names) operator(=) pre_constant(true) - - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(class_name)operator(() string operator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(class_name)operator(() string operator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(class_name)operator(() string operator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(class_name)operator(() string operator(\)) - reserved(end) - - reserved(def) method(test_null_fields) - ident(assert_nil) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(parent_id) - ident(assert_nil) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\))operator(.)ident(parent_id) - reserved(end) - - reserved(def) method(test_default_values) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(assert) ident(topic)operator(.)ident(approved?) - ident(assert_nil) ident(topic)operator(.)ident(written_on) - ident(assert_nil) ident(topic)operator(.)ident(bonus_time) - ident(assert_nil) ident(topic)operator(.)ident(last_read) - - ident(topic)operator(.)ident(save) - - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\)) - ident(assert) ident(topic)operator(.)ident(approved?) - ident(assert_nil) ident(topic)operator(.)ident(last_read) - - comment(# Oracle has some funky default handling, so it requires a bit of ) - comment(# extra testing. See ticket #2788.) - reserved(if) ident(current_adapter?)operator(()symbol(:OracleAdapter)operator(\)) - ident(test) operator(=) constant(TestOracleDefault)operator(.)ident(new) - ident(assert_equal) stringoperator(,) ident(test)operator(.)ident(test_char) - ident(assert_equal) stringoperator(,) ident(test)operator(.)ident(test_string) - ident(assert_equal) integer(3)operator(,) ident(test)operator(.)ident(test_int) - reserved(end) - reserved(end) - - reserved(def) method(test_utc_as_time_zone) - comment(# Oracle and SQLServer do not have a TIME datatype.) - reserved(return) pre_constant(true) reserved(if) ident(current_adapter?)operator(()symbol(:SQLServerAdapter)operator(\)) operator(||) ident(current_adapter?)operator(()symbol(:OracleAdapter)operator(\)) - - constant(Topic)operator(.)ident(default_timezone) operator(=) symbol(:utc) - ident(attributes) operator(=) operator({) string operator(=)operator(>) string operator(}) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(topic)operator(.)ident(attributes) operator(=) ident(attributes) - ident(assert_equal) constant(Time)operator(.)ident(utc)operator(()integer(2000)operator(,) integer(1)operator(,) integer(1)operator(,) integer(5)operator(,) integer(42)operator(,) integer(0)operator(\))operator(,) ident(topic)operator(.)ident(bonus_time) - constant(Topic)operator(.)ident(default_timezone) operator(=) symbol(:local) - reserved(end) - - reserved(def) method(test_default_values_on_empty_strings) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(approved) operator(=) pre_constant(nil) - ident(topic)operator(.)ident(last_read) operator(=) pre_constant(nil) - - ident(topic)operator(.)ident(save) - - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\)) - ident(assert_nil) ident(topic)operator(.)ident(last_read) - - comment(# Sybase adapter does not allow nulls in boolean columns) - reserved(if) ident(current_adapter?)operator(()symbol(:SybaseAdapter)operator(\)) - ident(assert) ident(topic)operator(.)ident(approved) operator(==) pre_constant(false) - reserved(else) - ident(assert_nil) ident(topic)operator(.)ident(approved) - reserved(end) - reserved(end) - - reserved(def) method(test_equality) - ident(assert_equal) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(,) constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(topic) - reserved(end) - - reserved(def) method(test_equality_of_new_records) - ident(assert_not_equal) constant(Topic)operator(.)ident(new)operator(,) constant(Topic)operator(.)ident(new) - reserved(end) - - reserved(def) method(test_hashing) - ident(assert_equal) operator([) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) operator(])operator(,) operator([) constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(topic) operator(]) operator(&) operator([) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) operator(]) - reserved(end) - - reserved(def) method(test_destroy_new_record) - ident(client) operator(=) constant(Client)operator(.)ident(new) - ident(client)operator(.)ident(destroy) - ident(assert) ident(client)operator(.)ident(frozen?) - reserved(end) - - reserved(def) method(test_destroy_record_with_associations) - ident(client) operator(=) constant(Client)operator(.)ident(find)operator(()integer(3)operator(\)) - ident(client)operator(.)ident(destroy) - ident(assert) ident(client)operator(.)ident(frozen?) - ident(assert_kind_of) constant(Firm)operator(,) ident(client)operator(.)ident(firm) - ident(assert_raises)operator(()constant(TypeError)operator(\)) operator({) ident(client)operator(.)ident(name) operator(=) string operator(}) - reserved(end) - - reserved(def) method(test_update_attribute) - ident(assert) operator(!)constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(approved?) - constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(update_attribute)operator(()stringoperator(,) pre_constant(true)operator(\)) - ident(assert) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(approved?) - - constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(update_attribute)operator(()symbol(:approved)operator(,) pre_constant(false)operator(\)) - ident(assert) operator(!)constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(approved?) - reserved(end) - - reserved(def) method(test_mass_assignment_protection) - ident(firm) operator(=) constant(Firm)operator(.)ident(new) - ident(firm)operator(.)ident(attributes) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) integer(5) operator(}) - ident(assert_equal) integer(1)operator(,) ident(firm)operator(.)ident(rating) - reserved(end) - - reserved(def) method(test_customized_primary_key_remains_protected) - ident(subscriber) operator(=) constant(Subscriber)operator(.)ident(new)operator(()symbol(:nick) operator(=)operator(>) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(assert_nil) ident(subscriber)operator(.)ident(id) - - ident(keyboard) operator(=) constant(Keyboard)operator(.)ident(new)operator(()symbol(:key_number) operator(=)operator(>) integer(9)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(assert_nil) ident(keyboard)operator(.)ident(id) - reserved(end) - - reserved(def) method(test_customized_primary_key_remains_protected_when_refered_to_as_id) - ident(subscriber) operator(=) constant(Subscriber)operator(.)ident(new)operator(()symbol(:id) operator(=)operator(>) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(assert_nil) ident(subscriber)operator(.)ident(id) - - ident(keyboard) operator(=) constant(Keyboard)operator(.)ident(new)operator(()symbol(:id) operator(=)operator(>) integer(9)operator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(assert_nil) ident(keyboard)operator(.)ident(id) - reserved(end) - - reserved(def) method(test_mass_assignment_protection_on_defaults) - ident(firm) operator(=) constant(Firm)operator(.)ident(new) - ident(firm)operator(.)ident(attributes) operator(=) operator({) string operator(=)operator(>) integer(5)operator(,) string operator(=)operator(>) string operator(}) - ident(assert_nil) ident(firm)operator(.)ident(id) - ident(assert_equal) stringoperator(,) ident(firm)operator([)symbol(:type)operator(]) - reserved(end) - - reserved(def) method(test_mass_assignment_accessible) - ident(reply) operator(=) constant(Reply)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) pre_constant(true)operator(\)) - ident(reply)operator(.)ident(save) - - ident(assert) ident(reply)operator(.)ident(approved?) - - ident(reply)operator(.)ident(approved) operator(=) pre_constant(false) - ident(reply)operator(.)ident(save) - - ident(assert) operator(!)ident(reply)operator(.)ident(approved?) - reserved(end) - - reserved(def) method(test_mass_assignment_protection_inheritance) - ident(assert_nil) constant(LoosePerson)operator(.)ident(accessible_attributes) - ident(assert_equal) operator([) symbol(:credit_rating)operator(,) symbol(:administrator) operator(])operator(,) constant(LoosePerson)operator(.)ident(protected_attributes) - - ident(assert_nil) constant(LooseDescendant)operator(.)ident(accessible_attributes) - ident(assert_equal) operator([) symbol(:credit_rating)operator(,) symbol(:administrator)operator(,) symbol(:phone_number) operator(])operator(,) constant(LooseDescendant)operator(.)ident(protected_attributes) - - ident(assert_nil) constant(TightPerson)operator(.)ident(protected_attributes) - ident(assert_equal) operator([) symbol(:name)operator(,) symbol(:address) operator(])operator(,) constant(TightPerson)operator(.)ident(accessible_attributes) - - ident(assert_nil) constant(TightDescendant)operator(.)ident(protected_attributes) - ident(assert_equal) operator([) symbol(:name)operator(,) symbol(:address)operator(,) symbol(:phone_number) operator(])operator(,) constant(TightDescendant)operator(.)ident(accessible_attributes) - reserved(end) - - reserved(def) method(test_multiparameter_attributes_on_date) - ident(attributes) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(}) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(topic)operator(.)ident(attributes) operator(=) ident(attributes) - comment(# note that extra #to_date call allows test to pass for Oracle, which ) - comment(# treats dates/times the same) - ident(assert_date_from_db) constant(Date)operator(.)ident(new)operator(()integer(2004)operator(,) integer(6)operator(,) integer(24)operator(\))operator(,) ident(topic)operator(.)ident(last_read)operator(.)ident(to_date) - reserved(end) - - reserved(def) method(test_multiparameter_attributes_on_date_with_empty_date) - ident(attributes) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(}) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(topic)operator(.)ident(attributes) operator(=) ident(attributes) - comment(# note that extra #to_date call allows test to pass for Oracle, which ) - comment(# treats dates/times the same) - ident(assert_date_from_db) constant(Date)operator(.)ident(new)operator(()integer(2004)operator(,) integer(6)operator(,) integer(1)operator(\))operator(,) ident(topic)operator(.)ident(last_read)operator(.)ident(to_date) - reserved(end) - - reserved(def) method(test_multiparameter_attributes_on_date_with_all_empty) - ident(attributes) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(}) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(topic)operator(.)ident(attributes) operator(=) ident(attributes) - ident(assert_nil) ident(topic)operator(.)ident(last_read) - reserved(end) - - reserved(def) method(test_multiparameter_attributes_on_time) - ident(attributes) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - operator(}) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(topic)operator(.)ident(attributes) operator(=) ident(attributes) - ident(assert_equal) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(6)operator(,) integer(24)operator(,) integer(16)operator(,) integer(24)operator(,) integer(0)operator(\))operator(,) ident(topic)operator(.)ident(written_on) - reserved(end) - - reserved(def) method(test_multiparameter_attributes_on_time_with_empty_seconds) - ident(attributes) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - operator(}) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(topic)operator(.)ident(attributes) operator(=) ident(attributes) - ident(assert_equal) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(6)operator(,) integer(24)operator(,) integer(16)operator(,) integer(24)operator(,) integer(0)operator(\))operator(,) ident(topic)operator(.)ident(written_on) - reserved(end) - - reserved(def) method(test_multiparameter_mass_assignment_protector) - ident(task) operator(=) constant(Task)operator(.)ident(new) - ident(time) operator(=) constant(Time)operator(.)ident(mktime)operator(()integer(2000)operator(,) integer(1)operator(,) integer(1)operator(,) integer(1)operator(\)) - ident(task)operator(.)ident(starting) operator(=) ident(time) - ident(attributes) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(}) - ident(task)operator(.)ident(attributes) operator(=) ident(attributes) - ident(assert_equal) ident(time)operator(,) ident(task)operator(.)ident(starting) - reserved(end) - - reserved(def) method(test_multiparameter_assignment_of_aggregation) - ident(customer) operator(=) constant(Customer)operator(.)ident(new) - ident(address) operator(=) constant(Address)operator(.)ident(new)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) - ident(attributes) operator(=) operator({) string operator(=)operator(>) ident(address)operator(.)ident(street)operator(,) string operator(=)operator(>) ident(address)operator(.)ident(city)operator(,) string operator(=)operator(>) ident(address)operator(.)ident(country) operator(}) - ident(customer)operator(.)ident(attributes) operator(=) ident(attributes) - ident(assert_equal) ident(address)operator(,) ident(customer)operator(.)ident(address) - reserved(end) - - reserved(def) method(test_attributes_on_dummy_time) - comment(# Oracle and SQL Server do not have a TIME datatype.) - reserved(return) pre_constant(true) reserved(if) ident(current_adapter?)operator(()symbol(:SQLServerAdapter)operator(\)) operator(||) ident(current_adapter?)operator(()symbol(:OracleAdapter)operator(\)) - - ident(attributes) operator(=) operator({) - string operator(=)operator(>) string - operator(}) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(topic)operator(.)ident(attributes) operator(=) ident(attributes) - ident(assert_equal) constant(Time)operator(.)ident(local)operator(()integer(2000)operator(,) integer(1)operator(,) integer(1)operator(,) integer(5)operator(,) integer(42)operator(,) integer(0)operator(\))operator(,) ident(topic)operator(.)ident(bonus_time) - reserved(end) - - reserved(def) method(test_boolean) - ident(b_false) operator(=) constant(Booleantest)operator(.)ident(create)operator(()operator({) string operator(=)operator(>) pre_constant(false) operator(})operator(\)) - ident(false_id) operator(=) ident(b_false)operator(.)ident(id) - ident(b_true) operator(=) constant(Booleantest)operator(.)ident(create)operator(()operator({) string operator(=)operator(>) pre_constant(true) operator(})operator(\)) - ident(true_id) operator(=) ident(b_true)operator(.)ident(id) - - ident(b_false) operator(=) constant(Booleantest)operator(.)ident(find)operator(()ident(false_id)operator(\)) - ident(assert) operator(!)ident(b_false)operator(.)ident(value?) - ident(b_true) operator(=) constant(Booleantest)operator(.)ident(find)operator(()ident(true_id)operator(\)) - ident(assert) ident(b_true)operator(.)ident(value?) - reserved(end) - - reserved(def) method(test_boolean_cast_from_string) - ident(b_false) operator(=) constant(Booleantest)operator(.)ident(create)operator(()operator({) string operator(=)operator(>) string operator(})operator(\)) - ident(false_id) operator(=) ident(b_false)operator(.)ident(id) - ident(b_true) operator(=) constant(Booleantest)operator(.)ident(create)operator(()operator({) string operator(=)operator(>) string operator(})operator(\)) - ident(true_id) operator(=) ident(b_true)operator(.)ident(id) - - ident(b_false) operator(=) constant(Booleantest)operator(.)ident(find)operator(()ident(false_id)operator(\)) - ident(assert) operator(!)ident(b_false)operator(.)ident(value?) - ident(b_true) operator(=) constant(Booleantest)operator(.)ident(find)operator(()ident(true_id)operator(\)) - ident(assert) ident(b_true)operator(.)ident(value?) - reserved(end) - - reserved(def) method(test_clone) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(cloned_topic) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(cloned_topic) operator(=) ident(topic)operator(.)ident(clone) operator(}) - ident(assert_equal) ident(topic)operator(.)ident(title)operator(,) ident(cloned_topic)operator(.)ident(title) - ident(assert) ident(cloned_topic)operator(.)ident(new_record?) - - comment(# test if the attributes have been cloned) - ident(topic)operator(.)ident(title) operator(=) string - ident(cloned_topic)operator(.)ident(title) operator(=) string - ident(assert_equal) stringoperator(,) ident(topic)operator(.)ident(title) - ident(assert_equal) stringoperator(,) ident(cloned_topic)operator(.)ident(title) - - comment(# test if the attribute values have been cloned) - ident(topic)operator(.)ident(title) operator(=) operator({)string operator(=)operator(>) stringoperator(}) - ident(cloned_topic) operator(=) ident(topic)operator(.)ident(clone) - ident(cloned_topic)operator(.)ident(title)operator([)stringoperator(]) operator(=) string - ident(assert_equal) stringoperator(,) ident(topic)operator(.)ident(title)operator([)stringoperator(]) - - ident(cloned_topic)operator(.)ident(save) - ident(assert) operator(!)ident(cloned_topic)operator(.)ident(new_record?) - ident(assert) ident(cloned_topic)operator(.)ident(id) operator(!=) ident(topic)operator(.)ident(id) - reserved(end) - - reserved(def) method(test_clone_with_aggregate_of_same_name_as_attribute) - ident(dev) operator(=) constant(DeveloperWithAggregate)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_kind_of) constant(DeveloperSalary)operator(,) ident(dev)operator(.)ident(salary) - - ident(clone) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(clone) operator(=) ident(dev)operator(.)ident(clone) operator(}) - ident(assert_kind_of) constant(DeveloperSalary)operator(,) ident(clone)operator(.)ident(salary) - ident(assert_equal) ident(dev)operator(.)ident(salary)operator(.)ident(amount)operator(,) ident(clone)operator(.)ident(salary)operator(.)ident(amount) - ident(assert) ident(clone)operator(.)ident(new_record?) - - comment(# test if the attributes have been cloned) - ident(original_amount) operator(=) ident(clone)operator(.)ident(salary)operator(.)ident(amount) - ident(dev)operator(.)ident(salary)operator(.)ident(amount) operator(=) integer(1) - ident(assert_equal) ident(original_amount)operator(,) ident(clone)operator(.)ident(salary)operator(.)ident(amount) - - ident(assert) ident(clone)operator(.)ident(save) - ident(assert) operator(!)ident(clone)operator(.)ident(new_record?) - ident(assert) ident(clone)operator(.)ident(id) operator(!=) ident(dev)operator(.)ident(id) - reserved(end) - - reserved(def) method(test_clone_preserves_subtype) - ident(clone) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(clone) operator(=) constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(clone) operator(}) - ident(assert_kind_of) constant(Client)operator(,) ident(clone) - reserved(end) - - reserved(def) method(test_bignum) - ident(company) operator(=) constant(Company)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(company)operator(.)ident(rating) operator(=) integer(2147483647) - ident(company)operator(.)ident(save) - ident(company) operator(=) constant(Company)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) integer(2147483647)operator(,) ident(company)operator(.)ident(rating) - reserved(end) - - comment(# TODO: extend defaults tests to other databases!) - reserved(if) ident(current_adapter?)operator(()symbol(:PostgreSQLAdapter)operator(\)) - reserved(def) method(test_default) - ident(default) operator(=) constant(Default)operator(.)ident(new) - - comment(# fixed dates / times) - ident(assert_equal) constant(Date)operator(.)ident(new)operator(()integer(2004)operator(,) integer(1)operator(,) integer(1)operator(\))operator(,) ident(default)operator(.)ident(fixed_date) - ident(assert_equal) constant(Time)operator(.)ident(local)operator(()integer(2004)operator(,) integer(1)operator(,)integer(1)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(,)integer(0)operator(\))operator(,) ident(default)operator(.)ident(fixed_time) - - comment(# char types) - ident(assert_equal) stringoperator(,) ident(default)operator(.)ident(char1) - ident(assert_equal) stringoperator(,) ident(default)operator(.)ident(char2) - ident(assert_equal) stringoperator(,) ident(default)operator(.)ident(char3) - reserved(end) - - reserved(class) class(Geometric) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) reserved(end) - reserved(def) method(test_geometric_content) - - comment(# accepted format notes:) - comment(# (\)'s aren't required) - comment(# values can be a mix of float or integer) - - ident(g) operator(=) constant(Geometric)operator(.)ident(new)operator(() - symbol(:a_point) operator(=)operator(>) stringoperator(,) - comment(#:a_line => '((2.0, 3\), (5.5, 7.0\)\)' # line type is currently unsupported in postgresql) - symbol(:a_line_segment) operator(=)operator(>) stringoperator(,) - symbol(:a_box) operator(=)operator(>) stringoperator(,) - symbol(:a_path) operator(=)operator(>) stringoperator(,) comment(# [ ] is an open path) - symbol(:a_polygon) operator(=)operator(>) stringoperator(,) - symbol(:a_circle) operator(=)operator(>) string)delimiter(')> - operator(\)) - - ident(assert) ident(g)operator(.)ident(save) - - comment(# Reload and check that we have all the geometric attributes.) - ident(h) operator(=) constant(Geometric)operator(.)ident(find)operator(()ident(g)operator(.)ident(id)operator(\)) - - ident(assert_equal) stringoperator(,) ident(h)operator(.)ident(a_point) - ident(assert_equal) stringoperator(,) ident(h)operator(.)ident(a_line_segment) - ident(assert_equal) stringoperator(,) ident(h)operator(.)ident(a_box) comment(# reordered to store upper right corner then bottom left corner) - ident(assert_equal) stringoperator(,) ident(h)operator(.)ident(a_path) - ident(assert_equal) stringoperator(,) ident(h)operator(.)ident(a_polygon) - ident(assert_equal) string)delimiter(')>operator(,) ident(h)operator(.)ident(a_circle) - - comment(# use a geometric function to test for an open path) - ident(objs) operator(=) constant(Geometric)operator(.)ident(find_by_sql) operator([)stringoperator(,) ident(g)operator(.)ident(id)operator(]) - ident(assert_equal) ident(objs)operator([)integer(0)operator(])operator(.)ident(isopen)operator(,) string - - comment(# test alternate formats when defining the geometric types) - - ident(g) operator(=) constant(Geometric)operator(.)ident(new)operator(() - symbol(:a_point) operator(=)operator(>) stringoperator(,) - comment(#:a_line => '((2.0, 3\), (5.5, 7.0\)\)' # line type is currently unsupported in postgresql) - symbol(:a_line_segment) operator(=)operator(>) stringoperator(,) - symbol(:a_box) operator(=)operator(>) stringoperator(,) - symbol(:a_path) operator(=)operator(>) stringoperator(,) comment(# ( \) is a closed path) - symbol(:a_polygon) operator(=)operator(>) stringoperator(,) - symbol(:a_circle) operator(=)operator(>) string - operator(\)) - - ident(assert) ident(g)operator(.)ident(save) - - comment(# Reload and check that we have all the geometric attributes.) - ident(h) operator(=) constant(Geometric)operator(.)ident(find)operator(()ident(g)operator(.)ident(id)operator(\)) - - ident(assert_equal) stringoperator(,) ident(h)operator(.)ident(a_point) - ident(assert_equal) stringoperator(,) ident(h)operator(.)ident(a_line_segment) - ident(assert_equal) stringoperator(,) ident(h)operator(.)ident(a_box) comment(# reordered to store upper right corner then bottom left corner) - ident(assert_equal) stringoperator(,) ident(h)operator(.)ident(a_path) - ident(assert_equal) stringoperator(,) ident(h)operator(.)ident(a_polygon) - ident(assert_equal) string)delimiter(')>operator(,) ident(h)operator(.)ident(a_circle) - - comment(# use a geometric function to test for an closed path) - ident(objs) operator(=) constant(Geometric)operator(.)ident(find_by_sql) operator([)stringoperator(,) ident(g)operator(.)ident(id)operator(]) - ident(assert_equal) ident(objs)operator([)integer(0)operator(])operator(.)ident(isclosed)operator(,) string - reserved(end) - reserved(end) - - reserved(def) method(test_auto_id) - ident(auto) operator(=) constant(AutoId)operator(.)ident(new) - ident(auto)operator(.)ident(save) - ident(assert) operator(()ident(auto)operator(.)ident(id) operator(>) integer(0)operator(\)) - reserved(end) - - reserved(def) method(quote_column_name)operator(()ident(name)operator(\)) - stringcontent(>)delimiter(")> - reserved(end) - - reserved(def) method(test_quote_keys) - ident(ar) operator(=) constant(AutoId)operator(.)ident(new) - ident(source) operator(=) operator({)string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(}) - ident(actual) operator(=) ident(ar)operator(.)ident(send)operator(()symbol(:quote_columns)operator(,) pre_constant(self)operator(,) ident(source)operator(\)) - ident(inverted) operator(=) ident(actual)operator(.)ident(invert) - ident(assert_equal)operator(()string)delimiter(")>operator(,) ident(inverted)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()string)delimiter(")>operator(,) ident(inverted)operator([)stringoperator(])operator(\)) - reserved(end) - - reserved(def) method(test_sql_injection_via_find) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) reserved(do) - constant(Topic)operator(.)ident(find)operator(()string 0)delimiter(")>operator(\)) - reserved(end) - - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) reserved(do) - constant(Topic)operator(.)ident(find)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_column_name_properly_quoted) - ident(col_record) operator(=) constant(ColumnName)operator(.)ident(new) - ident(col_record)operator(.)ident(references) operator(=) integer(40) - ident(assert) ident(col_record)operator(.)ident(save) - ident(col_record)operator(.)ident(references) operator(=) integer(41) - ident(assert) ident(col_record)operator(.)ident(save) - ident(assert_not_nil) ident(c2) operator(=) constant(ColumnName)operator(.)ident(find)operator(()ident(col_record)operator(.)ident(id)operator(\)) - ident(assert_equal)operator(()integer(41)operator(,) ident(c2)operator(.)ident(references)operator(\)) - reserved(end) - - constant(MyObject) operator(=) constant(Struct)operator(.)ident(new) symbol(:attribute1)operator(,) symbol(:attribute2) - - reserved(def) method(test_serialized_attribute) - ident(myobj) operator(=) constant(MyObject)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) - ident(topic) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) ident(myobj)operator(\)) - constant(Topic)operator(.)ident(serialize)operator(()stringoperator(,) constant(MyObject)operator(\)) - ident(assert_equal)operator(()ident(myobj)operator(,) ident(topic)operator(.)ident(content)operator(\)) - reserved(end) - - reserved(def) method(test_serialized_attribute_with_class_constraint) - ident(myobj) operator(=) constant(MyObject)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) - ident(topic) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) ident(myobj)operator(\)) - constant(Topic)operator(.)ident(serialize)operator(()symbol(:content)operator(,) constant(Hash)operator(\)) - - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(SerializationTypeMismatch)operator(\)) operator({) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\))operator(.)ident(content) operator(}) - - ident(settings) operator(=) operator({) string operator(=)operator(>) string operator(}) - constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\))operator(.)ident(update_attribute)operator(()stringoperator(,) ident(settings)operator(\)) - ident(assert_equal)operator(()ident(settings)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\))operator(.)ident(content)operator(\)) - constant(Topic)operator(.)ident(serialize)operator(()symbol(:content)operator(\)) - reserved(end) - - reserved(def) method(test_quote) - ident(author_name) operator(=) string - ident(topic) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) ident(author_name)operator(\)) - ident(assert_equal) ident(author_name)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\))operator(.)ident(author_name) - reserved(end) - - reserved(def) method(test_class_level_destroy) - ident(should_be_destroyed_reply) operator(=) constant(Reply)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(replies) operator(<<) ident(should_be_destroyed_reply) - - constant(Topic)operator(.)ident(destroy)operator(()integer(1)operator(\)) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) operator(}) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) constant(Reply)operator(.)ident(find)operator(()ident(should_be_destroyed_reply)operator(.)ident(id)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_class_level_delete) - ident(should_be_destroyed_reply) operator(=) constant(Reply)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(replies) operator(<<) ident(should_be_destroyed_reply) - - constant(Topic)operator(.)ident(delete)operator(()integer(1)operator(\)) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) operator(}) - ident(assert_nothing_raised) operator({) constant(Reply)operator(.)ident(find)operator(()ident(should_be_destroyed_reply)operator(.)ident(id)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_increment_attribute) - ident(assert_equal) integer(0)operator(,) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(replies_count) - ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(increment!) symbol(:replies_count) - ident(assert_equal) integer(1)operator(,) ident(topics)operator(()symbol(:first)operator(,) symbol(:reload)operator(\))operator(.)ident(replies_count) - - ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(increment)operator(()symbol(:replies_count)operator(\))operator(.)ident(increment!)operator(()symbol(:replies_count)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(topics)operator(()symbol(:first)operator(,) symbol(:reload)operator(\))operator(.)ident(replies_count) - reserved(end) - - reserved(def) method(test_increment_nil_attribute) - ident(assert_nil) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(parent_id) - ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(increment!) symbol(:parent_id) - ident(assert_equal) integer(1)operator(,) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(parent_id) - reserved(end) - - reserved(def) method(test_decrement_attribute) - ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(increment)operator(()symbol(:replies_count)operator(\))operator(.)ident(increment!)operator(()symbol(:replies_count)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(replies_count) - - ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(decrement!)operator(()symbol(:replies_count)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(topics)operator(()symbol(:first)operator(,) symbol(:reload)operator(\))operator(.)ident(replies_count) - - ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(decrement)operator(()symbol(:replies_count)operator(\))operator(.)ident(decrement!)operator(()symbol(:replies_count)operator(\)) - ident(assert_equal) integer(-1)operator(,) ident(topics)operator(()symbol(:first)operator(,) symbol(:reload)operator(\))operator(.)ident(replies_count) - reserved(end) - - reserved(def) method(test_toggle_attribute) - ident(assert) operator(!)ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(approved?) - ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(toggle!)operator(()symbol(:approved)operator(\)) - ident(assert) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(approved?) - ident(topic) operator(=) ident(topics)operator(()symbol(:first)operator(\)) - ident(topic)operator(.)ident(toggle)operator(()symbol(:approved)operator(\)) - ident(assert) operator(!)ident(topic)operator(.)ident(approved?) - ident(topic)operator(.)ident(reload) - ident(assert) ident(topic)operator(.)ident(approved?) - reserved(end) - - reserved(def) method(test_reload) - ident(t1) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(t2) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(t1)operator(.)ident(title) operator(=) string - ident(t1)operator(.)ident(save) - ident(t2)operator(.)ident(reload) - ident(assert_equal) ident(t1)operator(.)ident(title)operator(,) ident(t2)operator(.)ident(title) - reserved(end) - - reserved(def) method(test_define_attr_method_with_value) - ident(k) operator(=) constant(Class)operator(.)ident(new)operator(() constant(ActiveRecord)operator(::)constant(Base) operator(\)) - ident(k)operator(.)ident(send)operator(()symbol(:define_attr_method)operator(,) symbol(:table_name)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(k)operator(.)ident(table_name) - reserved(end) - - reserved(def) method(test_define_attr_method_with_block) - ident(k) operator(=) constant(Class)operator(.)ident(new)operator(() constant(ActiveRecord)operator(::)constant(Base) operator(\)) - ident(k)operator(.)ident(send)operator(()symbol(:define_attr_method)operator(,) symbol(:primary_key)operator(\)) operator({) string operator(+) ident(original_primary_key) operator(}) - ident(assert_equal) stringoperator(,) ident(k)operator(.)ident(primary_key) - reserved(end) - - reserved(def) method(test_set_table_name_with_value) - ident(k) operator(=) constant(Class)operator(.)ident(new)operator(() constant(ActiveRecord)operator(::)constant(Base) operator(\)) - ident(k)operator(.)ident(table_name) operator(=) string - ident(assert_equal) stringoperator(,) ident(k)operator(.)ident(table_name) - ident(k)operator(.)ident(set_table_name) string - ident(assert_equal) stringoperator(,) ident(k)operator(.)ident(table_name) - reserved(end) - - reserved(def) method(test_set_table_name_with_block) - ident(k) operator(=) constant(Class)operator(.)ident(new)operator(() constant(ActiveRecord)operator(::)constant(Base) operator(\)) - ident(k)operator(.)ident(set_table_name) operator({) string operator(}) - ident(assert_equal) stringoperator(,) ident(k)operator(.)ident(table_name) - reserved(end) - - reserved(def) method(test_set_primary_key_with_value) - ident(k) operator(=) constant(Class)operator(.)ident(new)operator(() constant(ActiveRecord)operator(::)constant(Base) operator(\)) - ident(k)operator(.)ident(primary_key) operator(=) string - ident(assert_equal) stringoperator(,) ident(k)operator(.)ident(primary_key) - ident(k)operator(.)ident(set_primary_key) string - ident(assert_equal) stringoperator(,) ident(k)operator(.)ident(primary_key) - reserved(end) - - reserved(def) method(test_set_primary_key_with_block) - ident(k) operator(=) constant(Class)operator(.)ident(new)operator(() constant(ActiveRecord)operator(::)constant(Base) operator(\)) - ident(k)operator(.)ident(set_primary_key) operator({) string operator(+) ident(original_primary_key) operator(}) - ident(assert_equal) stringoperator(,) ident(k)operator(.)ident(primary_key) - reserved(end) - - reserved(def) method(test_set_inheritance_column_with_value) - ident(k) operator(=) constant(Class)operator(.)ident(new)operator(() constant(ActiveRecord)operator(::)constant(Base) operator(\)) - ident(k)operator(.)ident(inheritance_column) operator(=) string - ident(assert_equal) stringoperator(,) ident(k)operator(.)ident(inheritance_column) - ident(k)operator(.)ident(set_inheritance_column) string - ident(assert_equal) stringoperator(,) ident(k)operator(.)ident(inheritance_column) - reserved(end) - - reserved(def) method(test_set_inheritance_column_with_block) - ident(k) operator(=) constant(Class)operator(.)ident(new)operator(() constant(ActiveRecord)operator(::)constant(Base) operator(\)) - ident(k)operator(.)ident(set_inheritance_column) operator({) ident(original_inheritance_column) operator(+) string operator(}) - ident(assert_equal) stringoperator(,) ident(k)operator(.)ident(inheritance_column) - reserved(end) - - reserved(def) method(test_count_with_join) - ident(res) operator(=) constant(Post)operator(.)ident(count_by_sql) stringcontent( = 'Post')delimiter(")> - ident(res2) operator(=) pre_constant(nil) - ident(assert_nothing_raised) reserved(do) - ident(res2) operator(=) constant(Post)operator(.)ident(count)operator(()stringcontent( = 'Post')delimiter(")>operator(,) - stringoperator(\)) - reserved(end) - ident(assert_equal) ident(res)operator(,) ident(res2) - - ident(res3) operator(=) pre_constant(nil) - ident(assert_nothing_raised) reserved(do) - ident(res3) operator(=) constant(Post)operator(.)ident(count)operator(()symbol(:conditions) operator(=)operator(>) stringcontent( = 'Post')delimiter(")>operator(,) - symbol(:joins) operator(=)operator(>) stringoperator(\)) - reserved(end) - ident(assert_equal) ident(res)operator(,) ident(res3) - - ident(res4) operator(=) constant(Post)operator(.)ident(count_by_sql) stringcontent( = 'Post' AND p.id=c.post_id)delimiter(")> - ident(res5) operator(=) pre_constant(nil) - ident(assert_nothing_raised) reserved(do) - ident(res5) operator(=) constant(Post)operator(.)ident(count)operator(()symbol(:conditions) operator(=)operator(>) stringcontent( = 'Post' AND p.id=c.post_id)delimiter(")>operator(,) - symbol(:joins) operator(=)operator(>) stringoperator(,) - symbol(:select) operator(=)operator(>) stringoperator(\)) - reserved(end) - - ident(assert_equal) ident(res4)operator(,) ident(res5) - - ident(res6) operator(=) constant(Post)operator(.)ident(count_by_sql) stringcontent( = 'Post' AND p.id=c.post_id)delimiter(")> - ident(res7) operator(=) pre_constant(nil) - ident(assert_nothing_raised) reserved(do) - ident(res7) operator(=) constant(Post)operator(.)ident(count)operator(()symbol(:conditions) operator(=)operator(>) stringcontent( = 'Post' AND p.id=c.post_id)delimiter(")>operator(,) - symbol(:joins) operator(=)operator(>) stringoperator(,) - symbol(:select) operator(=)operator(>) stringoperator(,) - symbol(:distinct) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - ident(assert_equal) ident(res6)operator(,) ident(res7) - reserved(end) - - reserved(def) method(test_clear_association_cache_stored) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_kind_of) constant(Firm)operator(,) ident(firm) - - ident(firm)operator(.)ident(clear_association_cache) - ident(assert_equal) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(clients)operator(.)ident(collect)operator({) operator(|)ident(x)operator(|) ident(x)operator(.)ident(name) operator(})operator(.)ident(sort)operator(,) ident(firm)operator(.)ident(clients)operator(.)ident(collect)operator({) operator(|)ident(x)operator(|) ident(x)operator(.)ident(name) operator(})operator(.)ident(sort) - reserved(end) - - reserved(def) method(test_clear_association_cache_new_record) - ident(firm) operator(=) constant(Firm)operator(.)ident(new) - ident(client_stored) operator(=) constant(Client)operator(.)ident(find)operator(()integer(3)operator(\)) - ident(client_new) operator(=) constant(Client)operator(.)ident(new) - ident(client_new)operator(.)ident(name) operator(=) string - ident(clients) operator(=) operator([) ident(client_stored)operator(,) ident(client_new) operator(]) - - ident(firm)operator(.)ident(clients) operator(<<) ident(clients) - - ident(firm)operator(.)ident(clear_association_cache) - - ident(assert_equal) ident(firm)operator(.)ident(clients)operator(.)ident(collect)operator({) operator(|)ident(x)operator(|) ident(x)operator(.)ident(name) operator(})operator(.)ident(sort)operator(,) ident(clients)operator(.)ident(collect)operator({) operator(|)ident(x)operator(|) ident(x)operator(.)ident(name) operator(})operator(.)ident(sort) - reserved(end) - - reserved(def) method(test_interpolate_sql) - ident(assert_nothing_raised) operator({) constant(Category)operator(.)ident(new)operator(.)ident(send)operator(()symbol(:interpolate_sql)operator(,) stringoperator(\)) operator(}) - ident(assert_nothing_raised) operator({) constant(Category)operator(.)ident(new)operator(.)ident(send)operator(()symbol(:interpolate_sql)operator(,) stringoperator(\)) operator(}) - ident(assert_nothing_raised) operator({) constant(Category)operator(.)ident(new)operator(.)ident(send)operator(()symbol(:interpolate_sql)operator(,) stringoperator(\)) operator(}) - reserved(end) - - reserved(def) method(test_scoped_find_conditions) - ident(scoped_developers) operator(=) constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string 90000)delimiter(')> operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - reserved(end) - ident(assert) operator(!)ident(scoped_developers)operator(.)ident(include?)operator(()ident(developers)operator(()symbol(:david)operator(\))operator(\)) comment(# David's salary is less than 90,000) - ident(assert_equal) integer(3)operator(,) ident(scoped_developers)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_scoped_find_limit_offset) - ident(scoped_developers) operator(=) constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:offset) operator(=)operator(>) integer(2) operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) - ident(assert) operator(!)ident(scoped_developers)operator(.)ident(include?)operator(()ident(developers)operator(()symbol(:david)operator(\))operator(\)) - ident(assert) operator(!)ident(scoped_developers)operator(.)ident(include?)operator(()ident(developers)operator(()symbol(:jamis)operator(\))operator(\)) - ident(assert_equal) integer(3)operator(,) ident(scoped_developers)operator(.)ident(size) - - comment(# Test without scoped find conditions to ensure we get the whole thing) - ident(developers) operator(=) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) constant(Developer)operator(.)ident(count)operator(,) ident(developers)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_base_class) - ident(assert) constant(LoosePerson)operator(.)ident(abstract_class?) - ident(assert) operator(!)constant(LooseDescendant)operator(.)ident(abstract_class?) - ident(assert_equal) constant(LoosePerson)operator(,) constant(LoosePerson)operator(.)ident(base_class) - ident(assert_equal) constant(LooseDescendant)operator(,) constant(LooseDescendant)operator(.)ident(base_class) - ident(assert_equal) constant(TightPerson)operator(,) constant(TightPerson)operator(.)ident(base_class) - ident(assert_equal) constant(TightPerson)operator(,) constant(TightDescendant)operator(.)ident(base_class) - reserved(end) - - reserved(def) method(test_assert_queries) - ident(query) operator(=) ident(lambda) operator({) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(execute) string operator(}) - ident(assert_queries)operator(()integer(2)operator(\)) operator({) integer(2)operator(.)ident(times) operator({) ident(query)operator(.)ident(call) operator(}) operator(}) - ident(assert_queries) integer(1)operator(,) operator(&)ident(query) - ident(assert_no_queries) operator({) ident(assert) pre_constant(true) operator(}) - reserved(end) - - reserved(def) method(test_to_xml) - ident(xml) operator(=) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(to_xml)operator(()symbol(:indent) operator(=)operator(>) integer(0)operator(,) symbol(:skip_instruct) operator(=)operator(>) pre_constant(true)operator(\)) - ident(bonus_time_in_current_timezone) operator(=) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(bonus_time)operator(.)ident(xmlschema) - ident(written_on_in_current_timezone) operator(=) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(written_on)operator(.)ident(xmlschema) - ident(last_read_in_current_timezone) operator(=) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(last_read)operator(.)ident(xmlschema) - ident(assert_equal) string)delimiter(")>operator(,) ident(xml)operator(.)ident(first)operator(()integer(7)operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()stringThe First Topic)delimiter(\))>operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()stringDavid)delimiter(\))>operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()string1)delimiter(\))>operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()string0)delimiter(\))>operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()string)inlinecontent()delimiter(\))>operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()stringHave a nice day)delimiter(\))>operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()stringdavid@loudthinking.com)delimiter(\))>operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()string)delimiter(\))>operator(\)) - reserved(if) ident(current_adapter?)operator(()symbol(:SybaseAdapter)operator(\)) reserved(or) ident(current_adapter?)operator(()symbol(:SQLServerAdapter)operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()string)inlinecontent()delimiter(\))>operator(\)) - reserved(else) - ident(assert) ident(xml)operator(.)ident(include?)operator(()string2004-04-15)delimiter(\))>operator(\)) - reserved(end) - comment(# Oracle and DB2 don't have true boolean or time-only fields) - reserved(unless) ident(current_adapter?)operator(()symbol(:OracleAdapter)operator(\)) operator(||) ident(current_adapter?)operator(()symbol(:DB2Adapter)operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()stringfalse)delimiter(\))>operator(\))operator(,) string - ident(assert) ident(xml)operator(.)ident(include?)operator(()string)inlinecontent()delimiter(\))>operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_to_xml_skipping_attributes) - ident(xml) operator(=) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(to_xml)operator(()symbol(:indent) operator(=)operator(>) integer(0)operator(,) symbol(:skip_instruct) operator(=)operator(>) pre_constant(true)operator(,) symbol(:except) operator(=)operator(>) symbol(:title)operator(\)) - ident(assert_equal) string)delimiter(")>operator(,) ident(xml)operator(.)ident(first)operator(()integer(7)operator(\)) - ident(assert) operator(!)ident(xml)operator(.)ident(include?)operator(()stringThe First Topic)delimiter(\))>operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()stringDavid)delimiter(\))>operator(\)) - - ident(xml) operator(=) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(to_xml)operator(()symbol(:indent) operator(=)operator(>) integer(0)operator(,) symbol(:skip_instruct) operator(=)operator(>) pre_constant(true)operator(,) symbol(:except) operator(=)operator(>) operator([) symbol(:title)operator(,) symbol(:author_name) operator(])operator(\)) - ident(assert) operator(!)ident(xml)operator(.)ident(include?)operator(()stringThe First Topic)delimiter(\))>operator(\)) - ident(assert) operator(!)ident(xml)operator(.)ident(include?)operator(()stringDavid)delimiter(\))>operator(\)) - reserved(end) - - reserved(def) method(test_to_xml_including_has_many_association) - ident(xml) operator(=) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(to_xml)operator(()symbol(:indent) operator(=)operator(>) integer(0)operator(,) symbol(:skip_instruct) operator(=)operator(>) pre_constant(true)operator(,) symbol(:include) operator(=)operator(>) symbol(:replies)operator(\)) - ident(assert_equal) string)delimiter(")>operator(,) ident(xml)operator(.)ident(first)operator(()integer(7)operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()string)delimiter(\))>operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()stringThe Second Topic's of the day)delimiter(\))>operator(\)) - reserved(end) - - reserved(def) method(test_to_xml_including_belongs_to_association) - ident(xml) operator(=) ident(companies)operator(()symbol(:first_client)operator(\))operator(.)ident(to_xml)operator(()symbol(:indent) operator(=)operator(>) integer(0)operator(,) symbol(:skip_instruct) operator(=)operator(>) pre_constant(true)operator(,) symbol(:include) operator(=)operator(>) symbol(:firm)operator(\)) - ident(assert) operator(!)ident(xml)operator(.)ident(include?)operator(()string)delimiter(")>operator(\)) - - ident(xml) operator(=) ident(companies)operator(()symbol(:second_client)operator(\))operator(.)ident(to_xml)operator(()symbol(:indent) operator(=)operator(>) integer(0)operator(,) symbol(:skip_instruct) operator(=)operator(>) pre_constant(true)operator(,) symbol(:include) operator(=)operator(>) symbol(:firm)operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()string)delimiter(")>operator(\)) - reserved(end) - - reserved(def) method(test_to_xml_including_multiple_associations) - ident(xml) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(to_xml)operator(()symbol(:indent) operator(=)operator(>) integer(0)operator(,) symbol(:skip_instruct) operator(=)operator(>) pre_constant(true)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:clients)operator(,) symbol(:account) operator(])operator(\)) - ident(assert_equal) string)delimiter(")>operator(,) ident(xml)operator(.)ident(first)operator(()integer(6)operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()string)delimiter(\))>operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()string)delimiter(\))>operator(\)) - reserved(end) - - reserved(def) method(test_to_xml_including_multiple_associations_with_options) - ident(xml) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(to_xml)operator(() - symbol(:indent) operator(=)operator(>) integer(0)operator(,) symbol(:skip_instruct) operator(=)operator(>) pre_constant(true)operator(,) - symbol(:include) operator(=)operator(>) operator({) symbol(:clients) operator(=)operator(>) operator({) symbol(:only) operator(=)operator(>) symbol(:name) operator(}) operator(}) - operator(\)) - - ident(assert_equal) string)delimiter(")>operator(,) ident(xml)operator(.)ident(first)operator(()integer(6)operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()stringSummit)delimiter(\))>operator(\)) - ident(assert) ident(xml)operator(.)ident(include?)operator(()string)delimiter(\))>operator(\)) - reserved(end) - - reserved(def) method(test_except_attributes) - ident(assert_equal)operator(() - stringoperator(,) - ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(attributes)operator(()symbol(:except) operator(=)operator(>) symbol(:title)operator(\))operator(.)ident(keys) - operator(\)) - - ident(assert_equal)operator(() - stringoperator(,) - ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(attributes)operator(()symbol(:except) operator(=)operator(>) operator([) symbol(:title)operator(,) symbol(:id)operator(,) symbol(:type)operator(,) symbol(:approved)operator(,) symbol(:author_name) operator(])operator(\))operator(.)ident(keys) - operator(\)) - reserved(end) - - reserved(def) method(test_include_attributes) - ident(assert_equal)operator(()stringoperator(,) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(attributes)operator(()symbol(:only) operator(=)operator(>) symbol(:title)operator(\))operator(.)ident(keys)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(attributes)operator(()symbol(:only) operator(=)operator(>) operator([) symbol(:title)operator(,) symbol(:id)operator(,) symbol(:type)operator(,) symbol(:approved)operator(,) symbol(:author_name) operator(])operator(\))operator(.)ident(keys)operator(\)) - reserved(end) - - reserved(def) method(test_type_name_with_module_should_handle_beginning) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(send)operator(()symbol(:type_name_with_module)operator(,) stringoperator(\)) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(send)operator(()symbol(:type_name_with_module)operator(,) stringoperator(\)) - reserved(end) - - comment(# FIXME: this test ought to run, but it needs to run sandboxed so that it) - comment(# doesn't b0rk the current test environment by undefing everything.) - comment(#) - comment(#def test_dev_mode_memory_leak) - comment(# counts = []) - comment(# 2.times do) - comment(# require_dependency 'fixtures/company') - comment(# Firm.find(:first\)) - comment(# Dependencies.clear) - comment(# ActiveRecord::Base.reset_subclasses) - comment(# Dependencies.remove_subclasses_for(ActiveRecord::Base\)) - comment(#) - comment(# GC.start) - comment(# ) - comment(# count = 0) - comment(# ObjectSpace.each_object(Proc\) { count += 1 }) - comment(# counts << count) - comment(# end) - comment(# assert counts.last <= counts.first,) - comment(# "expected last count (#{counts.last}\) to be <= first count (#{counts.first}\)") - comment(#end) - - ident(private) - reserved(def) method(assert_readers)operator(()ident(model)operator(,) ident(exceptions)operator(\)) - ident(expected_readers) operator(=) constant(Set)operator(.)ident(new)operator(()ident(model)operator(.)ident(column_names) operator(-) operator(()ident(model)operator(.)ident(serialized_attributes)operator(.)ident(keys) operator(+) operator([)stringoperator(])operator(\))operator(\)) - ident(expected_readers) operator(+=) ident(expected_readers)operator(.)ident(map) operator({) operator(|)ident(col)operator(|) stringcontent(?)delimiter(")> operator(}) - ident(expected_readers) operator(-=) ident(exceptions) - ident(assert_equal) ident(expected_readers)operator(,) ident(model)operator(.)ident(read_methods) - reserved(end) -reserved(end) -ident(require) string -ident(require) string - -reserved(class) class(BinaryTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - constant(BINARY_FIXTURE_PATH) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - - reserved(def) method(setup) - constant(Binary)operator(.)ident(connection)operator(.)ident(execute) string - instance_variable(@data) operator(=) constant(File)operator(.)ident(read)operator(()constant(BINARY_FIXTURE_PATH)operator(\))operator(.)ident(freeze) - reserved(end) - - reserved(def) method(test_truth) - ident(assert) pre_constant(true) - reserved(end) - - comment(# Without using prepared statements, it makes no sense to test) - comment(# BLOB data with SQL Server, because the length of a statement is) - comment(# limited to 8KB.) - comment(#) - comment(# Without using prepared statements, it makes no sense to test) - comment(# BLOB data with DB2 or Firebird, because the length of a statement) - comment(# is limited to 32KB.) - reserved(unless) stringoperator(.)ident(include?) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(adapter_name) - reserved(def) method(test_load_save) - ident(bin) operator(=) constant(Binary)operator(.)ident(new) - ident(bin)operator(.)ident(data) operator(=) instance_variable(@data) - - ident(assert) instance_variable(@data) operator(==) ident(bin)operator(.)ident(data)operator(,) string - - ident(bin)operator(.)ident(save) - ident(assert) instance_variable(@data) operator(==) ident(bin)operator(.)ident(data)operator(,) string - - ident(db_bin) operator(=) constant(Binary)operator(.)ident(find)operator(()ident(bin)operator(.)ident(id)operator(\)) - ident(assert) instance_variable(@data) operator(==) ident(db_bin)operator(.)ident(data)operator(,) string - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -constant(Company)operator(.)ident(has_many) symbol(:accounts) - -reserved(class) class(CalculationsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:companies)operator(,) symbol(:accounts)operator(,) symbol(:topics) - - reserved(def) method(test_should_sum_field) - ident(assert_equal) integer(265)operator(,) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(\)) - reserved(end) - - reserved(def) method(test_should_average_field) - ident(value) operator(=) constant(Account)operator(.)ident(average)operator(()symbol(:credit_limit)operator(\)) - ident(assert_equal) integer(53)operator(,) ident(value) - ident(assert_kind_of) constant(Float)operator(,) ident(value) - reserved(end) - - reserved(def) method(test_should_get_maximum_of_field) - ident(assert_equal) integer(60)operator(,) constant(Account)operator(.)ident(maximum)operator(()symbol(:credit_limit)operator(\)) - reserved(end) - - reserved(def) method(test_should_get_minimum_of_field) - ident(assert_equal) integer(50)operator(,) constant(Account)operator(.)ident(minimum)operator(()symbol(:credit_limit)operator(\)) - reserved(end) - - reserved(def) method(test_should_group_by_field) - ident(c) operator(=) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:group) operator(=)operator(>) symbol(:firm_id)operator(\)) - operator([)integer(1)operator(,)integer(6)operator(,)integer(2)operator(])operator(.)ident(each) operator({) operator(|)ident(firm_id)operator(|) ident(assert) ident(c)operator(.)ident(keys)operator(.)ident(include?)operator(()ident(firm_id)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_should_group_by_summed_field) - ident(c) operator(=) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:group) operator(=)operator(>) symbol(:firm_id)operator(\)) - ident(assert_equal) integer(50)operator(,) ident(c)operator([)integer(1)operator(]) - ident(assert_equal) integer(105)operator(,) ident(c)operator([)integer(6)operator(]) - ident(assert_equal) integer(60)operator(,) ident(c)operator([)integer(2)operator(]) - reserved(end) - - reserved(def) method(test_should_order_by_grouped_field) - ident(c) operator(=) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:group) operator(=)operator(>) symbol(:firm_id)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)integer(1)operator(,) integer(2)operator(,) integer(6)operator(])operator(,) ident(c)operator(.)ident(keys)operator(.)ident(compact) - reserved(end) - - reserved(def) method(test_should_order_by_calculation) - ident(c) operator(=) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:group) operator(=)operator(>) symbol(:firm_id)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) operator([)integer(105)operator(,) integer(60)operator(,) integer(50)operator(,) integer(50)operator(])operator(,) ident(c)operator(.)ident(keys)operator(.)ident(collect) operator({) operator(|)ident(k)operator(|) ident(c)operator([)ident(k)operator(]) operator(}) - ident(assert_equal) operator([)integer(6)operator(,) integer(2)operator(,) integer(1)operator(])operator(,) ident(c)operator(.)ident(keys)operator(.)ident(compact) - reserved(end) - - reserved(def) method(test_should_limit_calculation) - ident(c) operator(=) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) - symbol(:group) operator(=)operator(>) symbol(:firm_id)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(\)) - ident(assert_equal) operator([)integer(1)operator(,) integer(2)operator(])operator(,) ident(c)operator(.)ident(keys)operator(.)ident(compact) - reserved(end) - - reserved(def) method(test_should_limit_calculation_with_offset) - ident(c) operator(=) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) - symbol(:group) operator(=)operator(>) symbol(:firm_id)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(,) symbol(:offset) operator(=)operator(>) integer(1)operator(\)) - ident(assert_equal) operator([)integer(2)operator(,) integer(6)operator(])operator(,) ident(c)operator(.)ident(keys)operator(.)ident(compact) - reserved(end) - - reserved(def) method(test_should_group_by_summed_field_having_condition) - ident(c) operator(=) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:group) operator(=)operator(>) symbol(:firm_id)operator(,) - symbol(:having) operator(=)operator(>) string 50)delimiter(')>operator(\)) - ident(assert_nil) ident(c)operator([)integer(1)operator(]) - ident(assert_equal) integer(105)operator(,) ident(c)operator([)integer(6)operator(]) - ident(assert_equal) integer(60)operator(,) ident(c)operator([)integer(2)operator(]) - reserved(end) - - reserved(def) method(test_should_group_by_summed_association) - ident(c) operator(=) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:group) operator(=)operator(>) symbol(:firm)operator(\)) - ident(assert_equal) integer(50)operator(,) ident(c)operator([)ident(companies)operator(()symbol(:first_firm)operator(\))operator(]) - ident(assert_equal) integer(105)operator(,) ident(c)operator([)ident(companies)operator(()symbol(:rails_core)operator(\))operator(]) - ident(assert_equal) integer(60)operator(,) ident(c)operator([)ident(companies)operator(()symbol(:first_client)operator(\))operator(]) - reserved(end) - - reserved(def) method(test_should_sum_field_with_conditions) - ident(assert_equal) integer(105)operator(,) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_should_group_by_summed_field_with_conditions) - ident(c) operator(=) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:conditions) operator(=)operator(>) string 1)delimiter(')>operator(,) - symbol(:group) operator(=)operator(>) symbol(:firm_id)operator(\)) - ident(assert_nil) ident(c)operator([)integer(1)operator(]) - ident(assert_equal) integer(105)operator(,) ident(c)operator([)integer(6)operator(]) - ident(assert_equal) integer(60)operator(,) ident(c)operator([)integer(2)operator(]) - reserved(end) - - reserved(def) method(test_should_group_by_summed_field_with_conditions_and_having) - ident(c) operator(=) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:conditions) operator(=)operator(>) string 1)delimiter(')>operator(,) - symbol(:group) operator(=)operator(>) symbol(:firm_id)operator(,) - symbol(:having) operator(=)operator(>) string 60)delimiter(')>operator(\)) - ident(assert_nil) ident(c)operator([)integer(1)operator(]) - ident(assert_equal) integer(105)operator(,) ident(c)operator([)integer(6)operator(]) - ident(assert_nil) ident(c)operator([)integer(2)operator(]) - reserved(end) - - reserved(def) method(test_should_group_by_fields_with_table_alias) - ident(c) operator(=) constant(Account)operator(.)ident(sum)operator(()symbol(:credit_limit)operator(,) symbol(:group) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(50)operator(,) ident(c)operator([)integer(1)operator(]) - ident(assert_equal) integer(105)operator(,) ident(c)operator([)integer(6)operator(]) - ident(assert_equal) integer(60)operator(,) ident(c)operator([)integer(2)operator(]) - reserved(end) - - reserved(def) method(test_should_calculate_with_invalid_field) - ident(assert_equal) integer(5)operator(,) constant(Account)operator(.)ident(calculate)operator(()symbol(:count)operator(,) stringoperator(\)) - ident(assert_equal) integer(5)operator(,) constant(Account)operator(.)ident(calculate)operator(()symbol(:count)operator(,) symbol(:all)operator(\)) - reserved(end) - - reserved(def) method(test_should_calculate_grouped_with_invalid_field) - ident(c) operator(=) constant(Account)operator(.)ident(count)operator(()symbol(:all)operator(,) symbol(:group) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(1)operator(,) ident(c)operator([)integer(1)operator(]) - ident(assert_equal) integer(2)operator(,) ident(c)operator([)integer(6)operator(]) - ident(assert_equal) integer(1)operator(,) ident(c)operator([)integer(2)operator(]) - reserved(end) - - reserved(def) method(test_should_calculate_grouped_association_with_invalid_field) - ident(c) operator(=) constant(Account)operator(.)ident(count)operator(()symbol(:all)operator(,) symbol(:group) operator(=)operator(>) symbol(:firm)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(c)operator([)ident(companies)operator(()symbol(:first_firm)operator(\))operator(]) - ident(assert_equal) integer(2)operator(,) ident(c)operator([)ident(companies)operator(()symbol(:rails_core)operator(\))operator(]) - ident(assert_equal) integer(1)operator(,) ident(c)operator([)ident(companies)operator(()symbol(:first_client)operator(\))operator(]) - reserved(end) - - reserved(def) method(test_should_calculate_grouped_by_function) - ident(c) operator(=) constant(Company)operator(.)ident(count)operator(()symbol(:all)operator(,) symbol(:group) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(c)operator([)pre_constant(nil)operator(]) - ident(assert_equal) integer(1)operator(,) ident(c)operator([)stringoperator(]) - ident(assert_equal) integer(3)operator(,) ident(c)operator([)stringoperator(]) - ident(assert_equal) integer(2)operator(,) ident(c)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_should_calculate_grouped_by_function_with_table_alias) - ident(c) operator(=) constant(Company)operator(.)ident(count)operator(()symbol(:all)operator(,) symbol(:group) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(c)operator([)pre_constant(nil)operator(]) - ident(assert_equal) integer(1)operator(,) ident(c)operator([)stringoperator(]) - ident(assert_equal) integer(3)operator(,) ident(c)operator([)stringoperator(]) - ident(assert_equal) integer(2)operator(,) ident(c)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_should_sum_scoped_field) - ident(assert_equal) integer(15)operator(,) ident(companies)operator(()symbol(:rails_core)operator(\))operator(.)ident(companies)operator(.)ident(sum)operator(()symbol(:id)operator(\)) - reserved(end) - - reserved(def) method(test_should_sum_scoped_field_with_conditions) - ident(assert_equal) integer(8)operator(,) ident(companies)operator(()symbol(:rails_core)operator(\))operator(.)ident(companies)operator(.)ident(sum)operator(()symbol(:id)operator(,) symbol(:conditions) operator(=)operator(>) string 7)delimiter(')>operator(\)) - reserved(end) - - reserved(def) method(test_should_group_by_scoped_field) - ident(c) operator(=) ident(companies)operator(()symbol(:rails_core)operator(\))operator(.)ident(companies)operator(.)ident(sum)operator(()symbol(:id)operator(,) symbol(:group) operator(=)operator(>) symbol(:name)operator(\)) - ident(assert_equal) integer(7)operator(,) ident(c)operator([)stringoperator(]) - ident(assert_equal) integer(8)operator(,) ident(c)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_should_group_by_summed_field_with_conditions_and_having) - ident(c) operator(=) ident(companies)operator(()symbol(:rails_core)operator(\))operator(.)ident(companies)operator(.)ident(sum)operator(()symbol(:id)operator(,) symbol(:group) operator(=)operator(>) symbol(:name)operator(,) - symbol(:having) operator(=)operator(>) string 7)delimiter(')>operator(\)) - ident(assert_nil) ident(c)operator([)stringoperator(]) - ident(assert_equal) integer(8)operator(,) ident(c)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_should_reject_invalid_options) - ident(assert_nothing_raised) reserved(do) - operator([)symbol(:count)operator(,) symbol(:sum)operator(])operator(.)ident(each) reserved(do) operator(|)ident(func)operator(|) - comment(# empty options are valid) - constant(Company)operator(.)ident(send)operator(()symbol(:validate_calculation_options)operator(,) ident(func)operator(\)) - comment(# these options are valid for all calculations) - operator([)symbol(:select)operator(,) symbol(:conditions)operator(,) symbol(:joins)operator(,) symbol(:order)operator(,) symbol(:group)operator(,) symbol(:having)operator(,) symbol(:distinct)operator(])operator(.)ident(each) reserved(do) operator(|)ident(opt)operator(|) - constant(Company)operator(.)ident(send)operator(()symbol(:validate_calculation_options)operator(,) ident(func)operator(,) ident(opt) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - reserved(end) - - comment(# :include is only valid on :count) - constant(Company)operator(.)ident(send)operator(()symbol(:validate_calculation_options)operator(,) symbol(:count)operator(,) symbol(:include) operator(=)operator(>) pre_constant(true)operator(\)) - reserved(end) - - ident(assert_raises)operator(()constant(ArgumentError)operator(\)) operator({) constant(Company)operator(.)ident(send)operator(()symbol(:validate_calculation_options)operator(,) symbol(:sum)operator(,) symbol(:include) operator(=)operator(>) symbol(:posts)operator(\)) operator(}) - ident(assert_raises)operator(()constant(ArgumentError)operator(\)) operator({) constant(Company)operator(.)ident(send)operator(()symbol(:validate_calculation_options)operator(,) symbol(:sum)operator(,) symbol(:foo) operator(=)operator(>) symbol(:bar)operator(\)) operator(}) - ident(assert_raises)operator(()constant(ArgumentError)operator(\)) operator({) constant(Company)operator(.)ident(send)operator(()symbol(:validate_calculation_options)operator(,) symbol(:count)operator(,) symbol(:foo) operator(=)operator(>) symbol(:bar)operator(\)) operator(}) - reserved(end) -reserved(end) -ident(require) string - -reserved(class) class(CallbackDeveloper) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_table_name) string - - reserved(class) operator(<<) class(self) - reserved(def) method(callback_string)operator(()ident(callback_method)operator(\)) - stringcontent(, :string])delimiter(")> - reserved(end) - - reserved(def) method(callback_proc)operator(()ident(callback_method)operator(\)) - constant(Proc)operator(.)ident(new) operator({) operator(|)ident(model)operator(|) ident(model)operator(.)ident(history) operator(<<) operator([)ident(callback_method)operator(,) symbol(:proc)operator(]) operator(}) - reserved(end) - - reserved(def) method(define_callback_method)operator(()ident(callback_method)operator(\)) - ident(define_method)operator(()stringcontent(_method)delimiter(")>operator(\)) reserved(do) operator(|)ident(model)operator(|) - ident(model)operator(.)ident(history) operator(<<) operator([)ident(callback_method)operator(,) symbol(:method)operator(]) - reserved(end) - reserved(end) - - reserved(def) method(callback_object)operator(()ident(callback_method)operator(\)) - ident(klass) operator(=) constant(Class)operator(.)ident(new) - ident(klass)operator(.)ident(send)operator(()symbol(:define_method)operator(,) ident(callback_method)operator(\)) reserved(do) operator(|)ident(model)operator(|) - ident(model)operator(.)ident(history) operator(<<) operator([)ident(callback_method)operator(,) symbol(:object)operator(]) - reserved(end) - ident(klass)operator(.)ident(new) - reserved(end) - reserved(end) - - constant(ActiveRecord)operator(::)constant(Callbacks)operator(::)constant(CALLBACKS)operator(.)ident(each) reserved(do) operator(|)ident(callback_method)operator(|) - ident(callback_method_sym) operator(=) ident(callback_method)operator(.)ident(to_sym) - ident(define_callback_method)operator(()ident(callback_method_sym)operator(\)) - ident(send)operator(()ident(callback_method)operator(,) ident(callback_method_sym)operator(\)) - ident(send)operator(()ident(callback_method)operator(,) ident(callback_string)operator(()ident(callback_method_sym)operator(\))operator(\)) - ident(send)operator(()ident(callback_method)operator(,) ident(callback_proc)operator(()ident(callback_method_sym)operator(\))operator(\)) - ident(send)operator(()ident(callback_method)operator(,) ident(callback_object)operator(()ident(callback_method_sym)operator(\))operator(\)) - ident(send)operator(()ident(callback_method)operator(\)) operator({) operator(|)ident(model)operator(|) ident(model)operator(.)ident(history) operator(<<) operator([)ident(callback_method_sym)operator(,) symbol(:block)operator(]) operator(}) - reserved(end) - - reserved(def) method(history) - instance_variable(@history) operator(||=) operator([)operator(]) - reserved(end) - - comment(# after_initialize and after_find are invoked only if instance methods have been defined.) - reserved(def) method(after_initialize) - reserved(end) - - reserved(def) method(after_find) - reserved(end) -reserved(end) - -reserved(class) class(RecursiveCallbackDeveloper) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_table_name) string - - ident(before_save) symbol(:on_before_save) - ident(after_save) symbol(:on_after_save) - - ident(attr_reader) symbol(:on_before_save_called)operator(,) symbol(:on_after_save_called) - - reserved(def) method(on_before_save) - instance_variable(@on_before_save_called) operator(||=) integer(0) - instance_variable(@on_before_save_called) operator(+=) integer(1) - ident(save) reserved(unless) instance_variable(@on_before_save_called) operator(>) integer(1) - reserved(end) - - reserved(def) method(on_after_save) - instance_variable(@on_after_save_called) operator(||=) integer(0) - instance_variable(@on_after_save_called) operator(+=) integer(1) - ident(save) reserved(unless) instance_variable(@on_after_save_called) operator(>) integer(1) - reserved(end) -reserved(end) - -reserved(class) class(ImmutableDeveloper) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_table_name) string - - ident(validates_inclusion_of) symbol(:salary)operator(,) symbol(:in) operator(=)operator(>) integer(50000)operator(..)integer(200000) - - ident(before_save) symbol(:cancel) - ident(before_destroy) symbol(:cancel) - - reserved(def) method(cancelled?) - instance_variable(@cancelled) operator(==) pre_constant(true) - reserved(end) - - ident(private) - reserved(def) method(cancel) - instance_variable(@cancelled) operator(=) pre_constant(true) - pre_constant(false) - reserved(end) -reserved(end) - -reserved(class) class(ImmutableMethodDeveloper) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_table_name) string - - ident(validates_inclusion_of) symbol(:salary)operator(,) symbol(:in) operator(=)operator(>) integer(50000)operator(..)integer(200000) - - reserved(def) method(cancelled?) - instance_variable(@cancelled) operator(==) pre_constant(true) - reserved(end) - - reserved(def) method(before_save) - instance_variable(@cancelled) operator(=) pre_constant(true) - pre_constant(false) - reserved(end) - - reserved(def) method(before_destroy) - instance_variable(@cancelled) operator(=) pre_constant(true) - pre_constant(false) - reserved(end) -reserved(end) - -reserved(class) class(CallbacksTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:developers) - - reserved(def) method(test_initialize) - ident(david) operator(=) constant(CallbackDeveloper)operator(.)ident(new) - ident(assert_equal) operator([) - operator([) symbol(:after_initialize)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:block) operator(])operator(,) - operator(])operator(,) ident(david)operator(.)ident(history) - reserved(end) - - reserved(def) method(test_find) - ident(david) operator(=) constant(CallbackDeveloper)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) operator([) - operator([) symbol(:after_find)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:block) operator(])operator(,) - operator(])operator(,) ident(david)operator(.)ident(history) - reserved(end) - - reserved(def) method(test_new_valid?) - ident(david) operator(=) constant(CallbackDeveloper)operator(.)ident(new) - ident(david)operator(.)ident(valid?) - ident(assert_equal) operator([) - operator([) symbol(:after_initialize)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_validation_on_create)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_validation_on_create)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_validation_on_create)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_validation_on_create)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_validation_on_create)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_validation_on_create)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_validation_on_create)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_validation_on_create)operator(,) symbol(:block) operator(]) - operator(])operator(,) ident(david)operator(.)ident(history) - reserved(end) - - reserved(def) method(test_existing_valid?) - ident(david) operator(=) constant(CallbackDeveloper)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(david)operator(.)ident(valid?) - ident(assert_equal) operator([) - operator([) symbol(:after_find)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_validation_on_update)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_validation_on_update)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_validation_on_update)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_validation_on_update)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_validation_on_update)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_validation_on_update)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_validation_on_update)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_validation_on_update)operator(,) symbol(:block) operator(]) - operator(])operator(,) ident(david)operator(.)ident(history) - reserved(end) - - reserved(def) method(test_create) - ident(david) operator(=) constant(CallbackDeveloper)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) integer(1000000)operator(\)) - ident(assert_equal) operator([) - operator([) symbol(:after_initialize)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_validation_on_create)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_validation_on_create)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_validation_on_create)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_validation_on_create)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_validation_on_create)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_validation_on_create)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_validation_on_create)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_validation_on_create)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_save)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_save)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_save)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_save)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_create)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_create)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_create)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_create)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_create)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_create)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_create)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_create)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_save)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_save)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_save)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_save)operator(,) symbol(:block) operator(]) - operator(])operator(,) ident(david)operator(.)ident(history) - reserved(end) - - reserved(def) method(test_save) - ident(david) operator(=) constant(CallbackDeveloper)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(david)operator(.)ident(save) - ident(assert_equal) operator([) - operator([) symbol(:after_find)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_validation_on_update)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_validation_on_update)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_validation_on_update)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_validation_on_update)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_validation)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_validation_on_update)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_validation_on_update)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_validation_on_update)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_validation_on_update)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_save)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_save)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_save)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_save)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_update)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_update)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_update)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_update)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_update)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_update)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_update)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_update)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_save)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_save)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_save)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_save)operator(,) symbol(:block) operator(]) - operator(])operator(,) ident(david)operator(.)ident(history) - reserved(end) - - reserved(def) method(test_destroy) - ident(david) operator(=) constant(CallbackDeveloper)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(david)operator(.)ident(destroy) - ident(assert_equal) operator([) - operator([) symbol(:after_find)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_destroy)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_destroy)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_destroy)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_destroy)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_destroy)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_destroy)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_destroy)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_destroy)operator(,) symbol(:block) operator(]) - operator(])operator(,) ident(david)operator(.)ident(history) - reserved(end) - - reserved(def) method(test_delete) - ident(david) operator(=) constant(CallbackDeveloper)operator(.)ident(find)operator(()integer(1)operator(\)) - constant(CallbackDeveloper)operator(.)ident(delete)operator(()ident(david)operator(.)ident(id)operator(\)) - ident(assert_equal) operator([) - operator([) symbol(:after_find)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:block) operator(])operator(,) - operator(])operator(,) ident(david)operator(.)ident(history) - reserved(end) - - reserved(def) method(test_before_save_returning_false) - ident(david) operator(=) constant(ImmutableDeveloper)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) ident(david)operator(.)ident(valid?) - ident(assert) operator(!)ident(david)operator(.)ident(save) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotSaved)operator(\)) operator({) ident(david)operator(.)ident(save!) operator(}) - - ident(david) operator(=) constant(ImmutableDeveloper)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(david)operator(.)ident(salary) operator(=) integer(10_000_000) - ident(assert) operator(!)ident(david)operator(.)ident(valid?) - ident(assert) operator(!)ident(david)operator(.)ident(save) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordInvalid)operator(\)) operator({) ident(david)operator(.)ident(save!) operator(}) - reserved(end) - - reserved(def) method(test_before_destroy_returning_false) - ident(david) operator(=) constant(ImmutableDeveloper)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) operator(!)ident(david)operator(.)ident(destroy) - ident(assert_not_nil) constant(ImmutableDeveloper)operator(.)ident(find_by_id)operator(()integer(1)operator(\)) - reserved(end) - - reserved(def) method(test_zzz_callback_returning_false) comment(# must be run last since we modify CallbackDeveloper) - ident(david) operator(=) constant(CallbackDeveloper)operator(.)ident(find)operator(()integer(1)operator(\)) - constant(CallbackDeveloper)operator(.)ident(before_validation) ident(proc) operator({) operator(|)ident(model)operator(|) ident(model)operator(.)ident(history) operator(<<) operator([)symbol(:before_validation)operator(,) symbol(:returning_false)operator(])operator(;) reserved(return) pre_constant(false) operator(}) - constant(CallbackDeveloper)operator(.)ident(before_validation) ident(proc) operator({) operator(|)ident(model)operator(|) ident(model)operator(.)ident(history) operator(<<) operator([)symbol(:before_validation)operator(,) symbol(:should_never_get_here)operator(]) operator(}) - ident(david)operator(.)ident(save) - ident(assert_equal) operator([) - operator([) symbol(:after_find)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_find)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:after_initialize)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:string) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:proc) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:object) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:block) operator(])operator(,) - operator([) symbol(:before_validation)operator(,) symbol(:returning_false) operator(]) - operator(])operator(,) ident(david)operator(.)ident(history) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(A) - ident(include) constant(ClassInheritableAttributes) -reserved(end) - -reserved(class) class(B) operator(<) constant(A) - ident(write_inheritable_array) stringoperator(,) operator([) symbol(:one)operator(,) symbol(:two) operator(]) -reserved(end) - -reserved(class) class(C) operator(<) constant(A) - ident(write_inheritable_array) stringoperator(,) operator([) symbol(:three) operator(]) -reserved(end) - -reserved(class) class(D) operator(<) constant(B) - ident(write_inheritable_array) stringoperator(,) operator([) symbol(:four) operator(]) -reserved(end) - - -reserved(class) class(ClassInheritableAttributesTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(test_first_level) - ident(assert_equal) operator([) symbol(:one)operator(,) symbol(:two) operator(])operator(,) constant(B)operator(.)ident(read_inheritable_attribute)operator(()stringoperator(\)) - ident(assert_equal) operator([) symbol(:three) operator(])operator(,) constant(C)operator(.)ident(read_inheritable_attribute)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_second_level) - ident(assert_equal) operator([) symbol(:one)operator(,) symbol(:two)operator(,) symbol(:four) operator(])operator(,) constant(D)operator(.)ident(read_inheritable_attribute)operator(()stringoperator(\)) - ident(assert_equal) operator([) symbol(:one)operator(,) symbol(:two) operator(])operator(,) constant(B)operator(.)ident(read_inheritable_attribute)operator(()stringoperator(\)) - reserved(end) -reserved(end) -ident(require) string -ident(require) string - -reserved(class) class(TestColumnAlias) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:topics) - - constant(QUERY) operator(=) reserved(if) string operator(==) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(adapter_name) - string - reserved(else) - string - reserved(end) - - reserved(def) method(test_column_alias) - ident(records) operator(=) constant(Topic)operator(.)ident(connection)operator(.)ident(select_all)operator(()constant(QUERY)operator(\)) - ident(assert_equal) stringoperator(,) ident(records)operator([)integer(0)operator(])operator(.)ident(keys)operator([)integer(0)operator(]) - reserved(end) -reserved(end) -ident(print) string -ident(require_dependency) string -ident(require) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()stringoperator(\)) - -ident(db1) operator(=) string -ident(db2) operator(=) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:host) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db1) -operator(\)) - -constant(Course)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:host) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db2) -operator(\)) -ident(print) string -ident(require_dependency) string -ident(require) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()stringoperator(\)) - -ident(db1) operator(=) string -ident(db2) operator(=) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:host) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db1) -operator(\)) - -constant(Course)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:host) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db2) -operator(\)) -ident(print) string -ident(require_dependency) string -ident(require) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()stringoperator(\)) - -ident(db1) operator(=) string -ident(db2) operator(=) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:encoding) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db1) -operator(\)) - -constant(Course)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db2) -operator(\)) -ident(print) string -ident(require_dependency) string -ident(require) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()stringoperator(\)) - -ident(db1) operator(=) string -ident(db2) operator(=) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db1) -operator(\)) - -constant(Course)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db2) -operator(\)) -ident(print) string -ident(require_dependency) string -ident(require) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new) pre_constant(STDOUT) -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger)operator(.)ident(level) operator(=) constant(Logger)operator(::)constant(WARN) - -comment(# Set these to your database connection strings) -ident(db) operator(=) pre_constant(ENV)operator([)stringoperator(]) operator(||) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db) -operator(\)) - -constant(Course)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db) -operator(\)) -ident(print) string -ident(require_dependency) string -ident(require) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()stringoperator(\)) - -ident(db1) operator(=) string -ident(db2) operator(=) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db1)operator(,) - symbol(:min_messages) operator(=)operator(>) string -operator(\)) - -constant(Course)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db2)operator(,) - symbol(:min_messages) operator(=)operator(>) string -operator(\)) -ident(print) string -ident(require_dependency) string -ident(require) string -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()stringoperator(\)) - -reserved(class) class(SqliteError) operator(<) constant(StandardError) -reserved(end) - -constant(BASE_DIR) operator(=) constant(File)operator(.)ident(expand_path)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -ident(sqlite_test_db) operator(=) stringcontent(/fixture_database.sqlite)delimiter(")> -ident(sqlite_test_db2) operator(=) stringcontent(/fixture_database_2.sqlite)delimiter(")> - -reserved(def) method(make_connection)operator(()ident(clazz)operator(,) ident(db_file)operator(,) ident(db_definitions_file)operator(\)) - reserved(unless) constant(File)operator(.)ident(exist?)operator(()ident(db_file)operator(\)) - ident(puts) stringcontent(. Rebuilding it.)delimiter(")> - ident(sqlite_command) operator(=) stringcontent( "create table a (a integer\); drop table a;")delimiter(})> - ident(puts) stringcontent(')delimiter(")> - ident(raise) constant(SqliteError)operator(.)ident(new)operator(()stringoperator(\)) reserved(unless) ident(system)operator(()ident(sqlite_command)operator(\)) - ident(clazz)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db_file)operator(\)) - ident(script) operator(=) constant(File)operator(.)ident(read)operator(()stringcontent(/db_definitions/)inlinedelimiter(")>operator(\)) - comment(# SQLite-Ruby has problems with semi-colon separated commands, so split and execute one at a time) - ident(script)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each) reserved(do) - operator(|)ident(command)operator(|) - ident(clazz)operator(.)ident(connection)operator(.)ident(execute)operator(()ident(command)operator(\)) reserved(unless) ident(command)operator(.)ident(strip)operator(.)ident(empty?) - reserved(end) - reserved(else) - ident(clazz)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db_file)operator(\)) - reserved(end) -reserved(end) - -ident(make_connection)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(,) ident(sqlite_test_db)operator(,) stringoperator(\)) -ident(make_connection)operator(()constant(Course)operator(,) ident(sqlite_test_db2)operator(,) stringoperator(\)) -ident(load)operator(()constant(File)operator(.)ident(join)operator(()constant(BASE_DIR)operator(,) stringoperator(,) stringoperator(\))operator(\)) -ident(print) string -ident(require_dependency) string -ident(require) string -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()stringoperator(\)) - -reserved(class) class(SqliteError) operator(<) constant(StandardError) -reserved(end) - -constant(BASE_DIR) operator(=) constant(File)operator(.)ident(expand_path)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) -ident(sqlite_test_db) operator(=) stringcontent(/fixture_database.sqlite3)delimiter(")> -ident(sqlite_test_db2) operator(=) stringcontent(/fixture_database_2.sqlite3)delimiter(")> - -reserved(def) method(make_connection)operator(()ident(clazz)operator(,) ident(db_file)operator(,) ident(db_definitions_file)operator(\)) - reserved(unless) constant(File)operator(.)ident(exist?)operator(()ident(db_file)operator(\)) - ident(puts) stringcontent(. Rebuilding it.)delimiter(")> - ident(sqlite_command) operator(=) stringcontent( "create table a (a integer\); drop table a;")delimiter(})> - ident(puts) stringcontent(')delimiter(")> - ident(raise) constant(SqliteError)operator(.)ident(new)operator(()stringoperator(\)) reserved(unless) ident(system)operator(()ident(sqlite_command)operator(\)) - ident(clazz)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db_file)operator(\)) - ident(script) operator(=) constant(File)operator(.)ident(read)operator(()stringcontent(/db_definitions/)inlinedelimiter(")>operator(\)) - comment(# SQLite-Ruby has problems with semi-colon separated commands, so split and execute one at a time) - ident(script)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each) reserved(do) - operator(|)ident(command)operator(|) - ident(clazz)operator(.)ident(connection)operator(.)ident(execute)operator(()ident(command)operator(\)) reserved(unless) ident(command)operator(.)ident(strip)operator(.)ident(empty?) - reserved(end) - reserved(else) - ident(clazz)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db_file)operator(\)) - reserved(end) -reserved(end) - -ident(make_connection)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(,) ident(sqlite_test_db)operator(,) stringoperator(\)) -ident(make_connection)operator(()constant(Course)operator(,) ident(sqlite_test_db2)operator(,) stringoperator(\)) -ident(load)operator(()constant(File)operator(.)ident(join)operator(()constant(BASE_DIR)operator(,) stringoperator(,) stringoperator(\))operator(\)) -ident(print) string -ident(require_dependency) string -ident(require) string -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()stringoperator(\)) - -reserved(class) class(SqliteError) operator(<) constant(StandardError) -reserved(end) - -reserved(def) method(make_connection)operator(()ident(clazz)operator(,) ident(db_definitions_file)operator(\)) - ident(clazz)operator(.)ident(establish_connection)operator(()symbol(:adapter) operator(=)operator(>) stringoperator(,) symbol(:database) operator(=)operator(>) stringoperator(\)) - constant(File)operator(.)ident(read)operator(()stringcontent(/../../fixtures/db_definitions/)inlinedelimiter(")>operator(\))operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(command)operator(|) - ident(clazz)operator(.)ident(connection)operator(.)ident(execute)operator(()ident(command)operator(\)) reserved(unless) ident(command)operator(.)ident(strip)operator(.)ident(empty?) - reserved(end) -reserved(end) - -ident(make_connection)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(,) stringoperator(\)) -ident(make_connection)operator(()constant(Course)operator(,) stringoperator(\)) - ident(load)operator(()stringcontent(/../../fixtures/db_definitions/schema.rb)delimiter(")>operator(\))operator(\)) -ident(print) string -ident(require_dependency) string -ident(require) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()stringoperator(\)) - -ident(db1) operator(=) string -ident(db2) operator(=) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:host) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db1) -operator(\)) - -constant(Course)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:host) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db2) -operator(\)) -ident(print) string -ident(require_dependency) string -ident(require) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()stringoperator(\)) - -ident(dsn1) operator(=) string -ident(dsn2) operator(=) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:mode) operator(=)operator(>) stringoperator(,) - symbol(:host) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:dsn) operator(=)operator(>) ident(dsn1) -operator(\)) - -constant(Course)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:mode) operator(=)operator(>) stringoperator(,) - symbol(:host) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:dsn) operator(=)operator(>) ident(dsn2) -operator(\)) -ident(print) string -ident(require_dependency) string -ident(require) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()stringoperator(\)) - -ident(db1) operator(=) string -ident(db2) operator(=) string - -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:host) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db1) -operator(\)) - -constant(Course)operator(.)ident(establish_connection)operator(() - symbol(:adapter) operator(=)operator(>) stringoperator(,) - symbol(:host) operator(=)operator(>) stringoperator(,) - symbol(:username) operator(=)operator(>) stringoperator(,) - symbol(:password) operator(=)operator(>) stringoperator(,) - symbol(:database) operator(=)operator(>) ident(db2) -operator(\)) -ident(require) string - -reserved(class) class(CopyTableTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:companies)operator(,) symbol(:comments) - - reserved(def) method(setup) - instance_variable(@connection) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection) - reserved(class) operator(<<) instance_variable(@connection) - ident(public) symbol(:copy_table)operator(,) symbol(:table_structure)operator(,) symbol(:indexes) - reserved(end) - reserved(end) - - reserved(def) method(test_copy_table)operator(()ident(from) operator(=) stringoperator(,) ident(to) operator(=) stringoperator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(assert_nothing_raised) operator({)ident(copy_table)operator(()ident(from)operator(,) ident(to)operator(,) ident(options)operator(\))operator(}) - ident(assert_equal) ident(row_count)operator(()ident(from)operator(\))operator(,) ident(row_count)operator(()ident(to)operator(\)) - - reserved(if) ident(block_given?) - reserved(yield) ident(from)operator(,) ident(to)operator(,) ident(options) - reserved(else) - ident(assert_equal) ident(column_names)operator(()ident(from)operator(\))operator(,) ident(column_names)operator(()ident(to)operator(\)) - reserved(end) - - instance_variable(@connection)operator(.)ident(drop_table)operator(()ident(to)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(test_copy_table_renaming_column) - ident(test_copy_table)operator(()stringoperator(,) stringoperator(,) - symbol(:rename) operator(=)operator(>) operator({)string operator(=)operator(>) stringoperator(})operator(\)) reserved(do) operator(|)ident(from)operator(,) ident(to)operator(,) ident(options)operator(|) - ident(assert_equal) ident(column_values)operator(()ident(from)operator(,) stringoperator(\))operator(.)ident(compact)operator(.)ident(sort)operator(,) - ident(column_values)operator(()ident(to)operator(,) stringoperator(\))operator(.)ident(compact)operator(.)ident(sort) - reserved(end) - reserved(end) - - reserved(def) method(test_copy_table_with_index) - ident(test_copy_table)operator(()stringoperator(,) stringoperator(\)) reserved(do) - instance_variable(@connection)operator(.)ident(add_index)operator(()stringoperator(,) operator([)stringoperator(,) stringoperator(])operator(\)) - ident(test_copy_table)operator(()stringoperator(,) stringoperator(\)) reserved(do) - ident(assert_equal) ident(table_indexes_without_name)operator(()stringoperator(\))operator(,) - ident(table_indexes_without_name)operator(()stringoperator(\)) - reserved(end) - reserved(end) - reserved(end) - -ident(protected) - reserved(def) method(copy_table)operator(()ident(from)operator(,) ident(to)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - instance_variable(@connection)operator(.)ident(copy_table)operator(()ident(from)operator(,) ident(to)operator(,) operator({)symbol(:temporary) operator(=)operator(>) pre_constant(true)operator(})operator(.)ident(merge)operator(()ident(options)operator(\))operator(\)) - reserved(end) - - reserved(def) method(column_names)operator(()ident(table)operator(\)) - instance_variable(@connection)operator(.)ident(table_structure)operator(()ident(table)operator(\))operator(.)ident(map) operator({)operator(|)ident(column)operator(|) ident(column)operator([)stringoperator(])operator(}) - reserved(end) - - reserved(def) method(column_values)operator(()ident(table)operator(,) ident(column)operator(\)) - instance_variable(@connection)operator(.)ident(select_all)operator(()stringcontent( FROM )inlinedelimiter(")>operator(\))operator(.)ident(map) operator({)operator(|)ident(row)operator(|) ident(row)operator([)ident(column)operator(])operator(}) - reserved(end) - - reserved(def) method(table_indexes_without_name)operator(()ident(table)operator(\)) - instance_variable(@connection)operator(.)ident(indexes)operator(()stringoperator(\))operator(.)ident(delete)operator(()symbol(:name)operator(\)) - reserved(end) - - reserved(def) method(row_count)operator(()ident(table)operator(\)) - instance_variable(@connection)operator(.)ident(select_one)operator(()stringdelimiter(")>operator(\))operator([)stringoperator(]) - reserved(end) -reserved(end) -ident(require) string -ident(require) string - -reserved(class) class(DefaultTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(test_default_timestamp) - ident(default) operator(=) constant(Default)operator(.)ident(new) - ident(assert_instance_of)operator(()constant(Time)operator(,) ident(default)operator(.)ident(default_timestamp)operator(\)) - ident(assert_equal)operator(()symbol(:datetime)operator(,) ident(default)operator(.)ident(column_for_attribute)operator(()symbol(:default_timestamp)operator(\))operator(.)ident(type)operator(\)) - - comment(# Variance should be small; increase if required -- e.g., if test db is on) - comment(# remote host and clocks aren't synchronized.) - ident(t1) operator(=) constant(Time)operator(.)ident(new) - ident(accepted_variance) operator(=) float(1.0) - ident(assert_in_delta)operator(()ident(t1)operator(.)ident(to_f)operator(,) ident(default)operator(.)ident(default_timestamp)operator(.)ident(to_f)operator(,) ident(accepted_variance)operator(\)) - reserved(end) -reserved(end) -ident(require) string -ident(require) string - -reserved(class) class(DefaultsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(if) stringoperator(.)ident(include?) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(adapter_name) - reserved(def) method(test_default_integers) - ident(default) operator(=) constant(Default)operator(.)ident(new) - ident(assert_instance_of)operator(()constant(Fixnum)operator(,) ident(default)operator(.)ident(positive_integer)operator(\)) - ident(assert_equal)operator(()ident(default)operator(.)ident(positive_integer)operator(,) integer(1)operator(\)) - ident(assert_instance_of)operator(()constant(Fixnum)operator(,) ident(default)operator(.)ident(negative_integer)operator(\)) - ident(assert_equal)operator(()ident(default)operator(.)ident(negative_integer)operator(,) integer(-1)operator(\)) - reserved(end) - reserved(else) - reserved(def) method(test_dummy) - ident(assert) pre_constant(true) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -comment(# Can't declare new classes in test case methods, so tests before that) -ident(bad_collection_keys) operator(=) pre_constant(false) -reserved(begin) - reserved(class) class(Car) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) ident(has_many) symbol(:wheels)operator(,) symbol(:name) operator(=)operator(>) stringoperator(;) reserved(end) -reserved(rescue) constant(ArgumentError) - ident(bad_collection_keys) operator(=) pre_constant(true) -reserved(end) -ident(raise) string reserved(unless) ident(bad_collection_keys) - - -reserved(class) class(DeprecatedAssociationsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:accounts)operator(,) symbol(:companies)operator(,) symbol(:developers)operator(,) symbol(:projects)operator(,) symbol(:topics)operator(,) - symbol(:developers_projects) - - reserved(def) method(test_has_many_find) - ident(assert_equal) integer(2)operator(,) constant(Firm)operator(.)ident(find_first)operator(.)ident(clients)operator(.)ident(length) - reserved(end) - - reserved(def) method(test_has_many_orders) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(find_first)operator(.)ident(clients)operator(.)ident(first)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_has_many_class_name) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(find_first)operator(.)ident(clients_sorted_desc)operator(.)ident(first)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_has_many_foreign_key) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(find_first)operator(.)ident(clients_of_firm)operator(.)ident(first)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_has_many_conditions) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(find_first)operator(.)ident(clients_like_ms)operator(.)ident(first)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_has_many_sql) - ident(firm) operator(=) constant(Firm)operator(.)ident(find_first) - ident(assert_equal) stringoperator(,) ident(firm)operator(.)ident(clients_using_sql)operator(.)ident(first)operator(.)ident(name) - ident(assert_equal) integer(1)operator(,) ident(firm)operator(.)ident(clients_using_sql_count) - ident(assert_equal) integer(1)operator(,) constant(Firm)operator(.)ident(find_first)operator(.)ident(clients_using_sql_count) - reserved(end) - - reserved(def) method(test_has_many_counter_sql) - ident(assert_equal) integer(1)operator(,) constant(Firm)operator(.)ident(find_first)operator(.)ident(clients_using_counter_sql_count) - reserved(end) - - reserved(def) method(test_has_many_queries) - ident(assert) constant(Firm)operator(.)ident(find_first)operator(.)ident(has_clients?) - ident(firm) operator(=) constant(Firm)operator(.)ident(find_first) - ident(assert_equal) integer(2)operator(,) ident(firm)operator(.)ident(clients_count) comment(# tests using class count) - ident(firm)operator(.)ident(clients) - ident(assert) ident(firm)operator(.)ident(has_clients?) - ident(assert_equal) integer(2)operator(,) ident(firm)operator(.)ident(clients_count) comment(# tests using collection length) - reserved(end) - - reserved(def) method(test_has_many_dependence) - ident(assert_equal) integer(3)operator(,) constant(Client)operator(.)ident(find_all)operator(.)ident(length) - constant(Firm)operator(.)ident(find_first)operator(.)ident(destroy) - ident(assert_equal) integer(1)operator(,) constant(Client)operator(.)ident(find_all)operator(.)ident(length) - reserved(end) - - ident(uses_transaction) symbol(:test_has_many_dependence_with_transaction_support_on_failure) - reserved(def) method(test_has_many_dependence_with_transaction_support_on_failure) - ident(assert_equal) integer(3)operator(,) constant(Client)operator(.)ident(find_all)operator(.)ident(length) - - ident(firm) operator(=) constant(Firm)operator(.)ident(find_first) - ident(clients) operator(=) ident(firm)operator(.)ident(clients) - ident(clients)operator(.)ident(last)operator(.)ident(instance_eval) operator({) reserved(def) method(before_destroy)operator(()operator(\)) ident(raise) string reserved(end) operator(}) - - ident(firm)operator(.)ident(destroy) reserved(rescue) string - - ident(assert_equal) integer(3)operator(,) constant(Client)operator(.)ident(find_all)operator(.)ident(length) - reserved(end) - - reserved(def) method(test_has_one_dependence) - ident(num_accounts) operator(=) constant(Account)operator(.)ident(count) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) ident(firm)operator(.)ident(has_account?) - ident(firm)operator(.)ident(destroy) - ident(assert_equal) ident(num_accounts) operator(-) integer(1)operator(,) constant(Account)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_has_one_dependence_with_missing_association) - constant(Account)operator(.)ident(destroy_all) - ident(firm) operator(=) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) operator(!)ident(firm)operator(.)ident(has_account?) - ident(firm)operator(.)ident(destroy) - reserved(end) - - reserved(def) method(test_belongs_to) - ident(assert_equal) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(name)operator(,) constant(Client)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm)operator(.)ident(name) - ident(assert) constant(Client)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(has_firm?)operator(,) string - comment(# assert !Company.find(1\).has_firm?, "37signals shouldn't have a firm") - reserved(end) - - reserved(def) method(test_belongs_to_with_different_class_name) - ident(assert_equal) constant(Company)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(name)operator(,) constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm_with_other_name)operator(.)ident(name) - ident(assert) constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(has_firm_with_other_name?)operator(,) string - reserved(end) - - reserved(def) method(test_belongs_to_with_condition) - ident(assert_equal) constant(Company)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(name)operator(,) constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm_with_condition)operator(.)ident(name) - ident(assert) constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(has_firm_with_condition?)operator(,) string - reserved(end) - - reserved(def) method(test_belongs_to_equality) - ident(assert) constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm?)operator(()constant(Company)operator(.)ident(find)operator(()integer(1)operator(\))operator(\))operator(,) string - ident(assert_raises)operator(()constant(RuntimeError)operator(\)) operator({) operator(!)constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(.)ident(firm?)operator(()constant(Company)operator(.)ident(find)operator(()integer(3)operator(\))operator(\)) operator(}) comment(# "Summit shouldn't have itself as firm") - reserved(end) - - reserved(def) method(test_has_one) - ident(assert) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account?)operator(()constant(Account)operator(.)ident(find)operator(()integer(1)operator(\))operator(\)) - ident(assert_equal) constant(Account)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(credit_limit)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account)operator(.)ident(credit_limit) - ident(assert) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(has_account?)operator(,) string - ident(assert) constant(Account)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(firm?)operator(()ident(companies)operator(()symbol(:first_firm)operator(\))operator(\))operator(,) string - ident(assert) constant(Account)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(has_firm?)operator(,) string - - ident(assert) operator(!)constant(Account)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(has_firm?)operator(,) string - ident(assert) operator(!)constant(Account)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(firm?)operator(()ident(companies)operator(()symbol(:first_firm)operator(\))operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_has_many_dependence_on_account) - ident(num_accounts) operator(=) constant(Account)operator(.)ident(count) - ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(destroy) - ident(assert_equal) ident(num_accounts) operator(-) integer(1)operator(,) constant(Account)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_find_in) - ident(assert_equal) constant(Client)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(name)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(find_in_clients)operator(()integer(2)operator(\))operator(.)ident(name) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(find_in_clients)operator(()integer(6)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_force_reload) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(save) - ident(firm)operator(.)ident(clients)operator(.)ident(each) operator({)operator(|)ident(c)operator(|)operator(}) comment(# forcing to load all clients) - ident(assert) ident(firm)operator(.)ident(clients)operator(.)ident(empty?)operator(,) string - ident(assert) operator(!)ident(firm)operator(.)ident(has_clients?)operator(,) string - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(clients_count)operator(,) string - - ident(client) operator(=) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(firm)operator(.)ident(id)operator(\)) - ident(client)operator(.)ident(save) - - ident(assert) ident(firm)operator(.)ident(clients)operator(.)ident(empty?)operator(,) string - ident(assert) operator(!)ident(firm)operator(.)ident(has_clients?)operator(,) string - ident(assert_equal) integer(0)operator(,) ident(firm)operator(.)ident(clients_count)operator(,) string - - ident(assert) operator(!)ident(firm)operator(.)ident(clients)operator(()pre_constant(true)operator(\))operator(.)ident(empty?)operator(,) string - ident(assert) ident(firm)operator(.)ident(has_clients?)operator(()pre_constant(true)operator(\))operator(,) string - ident(assert_equal) integer(1)operator(,) ident(firm)operator(.)ident(clients_count)operator(()pre_constant(true)operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_included_in_collection) - ident(assert) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients)operator(.)ident(include?)operator(()constant(Client)operator(.)ident(find)operator(()integer(2)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_build_to_collection) - ident(assert_equal) integer(1)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm_count) - ident(new_client) operator(=) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(build_to_clients_of_firm)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) stringoperator(,) ident(new_client)operator(.)ident(name) - ident(assert) ident(new_client)operator(.)ident(save) - - ident(assert) ident(new_client)operator(.)ident(firm?)operator(()ident(companies)operator(()symbol(:first_firm)operator(\))operator(\)) - ident(assert_equal) integer(2)operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm_count)operator(()pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(test_create_in_collection) - ident(assert_equal) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(create_in_clients_of_firm)operator(()string operator(=)operator(>) stringoperator(\))operator(,) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(clients_of_firm)operator(()pre_constant(true)operator(\))operator(.)ident(last) - reserved(end) - - reserved(def) method(test_has_and_belongs_to_many) - ident(david) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) ident(david)operator(.)ident(has_projects?) - ident(assert_equal) integer(2)operator(,) ident(david)operator(.)ident(projects_count) - - ident(active_record) operator(=) constant(Project)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) ident(active_record)operator(.)ident(has_developers?) - ident(assert_equal) integer(3)operator(,) ident(active_record)operator(.)ident(developers_count) - ident(assert) ident(active_record)operator(.)ident(developers)operator(.)ident(include?)operator(()ident(david)operator(\)) - reserved(end) - - reserved(def) method(test_has_and_belongs_to_many_removing) - ident(david) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(active_record) operator(=) constant(Project)operator(.)ident(find)operator(()integer(1)operator(\)) - - ident(david)operator(.)ident(remove_projects)operator(()ident(active_record)operator(\)) - - ident(assert_equal) integer(1)operator(,) ident(david)operator(.)ident(projects_count) - ident(assert_equal) integer(2)operator(,) ident(active_record)operator(.)ident(developers_count) - reserved(end) - - reserved(def) method(test_has_and_belongs_to_many_zero) - ident(david) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(david)operator(.)ident(remove_projects)operator(()constant(Project)operator(.)ident(find_all)operator(\)) - - ident(assert_equal) integer(0)operator(,) ident(david)operator(.)ident(projects_count) - ident(assert) operator(!)ident(david)operator(.)ident(has_projects?) - reserved(end) - - reserved(def) method(test_has_and_belongs_to_many_adding) - ident(jamis) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(action_controller) operator(=) constant(Project)operator(.)ident(find)operator(()integer(2)operator(\)) - - ident(jamis)operator(.)ident(add_projects)operator(()ident(action_controller)operator(\)) - - ident(assert_equal) integer(2)operator(,) ident(jamis)operator(.)ident(projects_count) - ident(assert_equal) integer(2)operator(,) ident(action_controller)operator(.)ident(developers_count) - reserved(end) - - reserved(def) method(test_has_and_belongs_to_many_adding_from_the_project) - ident(jamis) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(action_controller) operator(=) constant(Project)operator(.)ident(find)operator(()integer(2)operator(\)) - - ident(action_controller)operator(.)ident(add_developers)operator(()ident(jamis)operator(\)) - - ident(assert_equal) integer(2)operator(,) ident(jamis)operator(.)ident(projects_count) - ident(assert_equal) integer(2)operator(,) ident(action_controller)operator(.)ident(developers_count) - reserved(end) - - reserved(def) method(test_has_and_belongs_to_many_adding_a_collection) - ident(aredridel) operator(=) constant(Developer)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(aredridel)operator(.)ident(save) - - ident(aredridel)operator(.)ident(add_projects)operator(()operator([) constant(Project)operator(.)ident(find)operator(()integer(1)operator(\))operator(,) constant(Project)operator(.)ident(find)operator(()integer(2)operator(\)) operator(])operator(\)) - ident(assert_equal) integer(2)operator(,) ident(aredridel)operator(.)ident(projects_count) - reserved(end) - - reserved(def) method(test_belongs_to_counter) - ident(topic) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(0)operator(,) ident(topic)operator(.)ident(send)operator(()symbol(:read_attribute)operator(,) stringoperator(\))operator(,) string - - ident(reply) operator(=) ident(topic)operator(.)ident(create_in_replies)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(1)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\))operator(.)ident(send)operator(()symbol(:read_attribute)operator(,) stringoperator(\))operator(,) string - - ident(reply)operator(.)ident(destroy) - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(find)operator(()ident(topic)operator(.)ident(id)operator(\))operator(.)ident(send)operator(()symbol(:read_attribute)operator(,) stringoperator(\))operator(,) string - reserved(end) - - reserved(def) method(test_natural_assignment_of_has_one) - ident(apple) operator(=) constant(Firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(citibank) operator(=) constant(Account)operator(.)ident(create)operator(()string operator(=)operator(>) integer(10)operator(\)) - ident(apple)operator(.)ident(account) operator(=) ident(citibank) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(citibank)operator(.)ident(firm_id) - reserved(end) - - reserved(def) method(test_natural_assignment_of_belongs_to) - ident(apple) operator(=) constant(Firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(citibank) operator(=) constant(Account)operator(.)ident(create)operator(()string operator(=)operator(>) integer(10)operator(\)) - ident(citibank)operator(.)ident(firm) operator(=) ident(apple) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(citibank)operator(.)ident(firm_id) - reserved(end) - - reserved(def) method(test_natural_assignment_of_has_many) - ident(apple) operator(=) constant(Firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(natural) operator(=) constant(Client)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(apple)operator(.)ident(clients) operator(<<) ident(natural) - ident(assert_equal) ident(apple)operator(.)ident(id)operator(,) ident(natural)operator(.)ident(firm_id) - ident(assert_equal) constant(Client)operator(.)ident(find)operator(()ident(natural)operator(.)ident(id)operator(\))operator(,) constant(Firm)operator(.)ident(find)operator(()ident(apple)operator(.)ident(id)operator(\))operator(.)ident(clients)operator(.)ident(find)operator(()ident(natural)operator(.)ident(id)operator(\)) - ident(apple)operator(.)ident(clients)operator(.)ident(delete) ident(natural) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) - constant(Firm)operator(.)ident(find)operator(()ident(apple)operator(.)ident(id)operator(\))operator(.)ident(clients)operator(.)ident(find)operator(()ident(natural)operator(.)ident(id)operator(\)) - operator(}) - reserved(end) - - reserved(def) method(test_natural_adding_of_has_and_belongs_to_many) - ident(rails) operator(=) constant(Project)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(ap) operator(=) constant(Project)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(john) operator(=) constant(Developer)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(mike) operator(=) constant(Developer)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(rails)operator(.)ident(developers) operator(<<) ident(john) - ident(rails)operator(.)ident(developers) operator(<<) ident(mike) - - ident(assert_equal) constant(Developer)operator(.)ident(find)operator(()ident(john)operator(.)ident(id)operator(\))operator(,) constant(Project)operator(.)ident(find)operator(()ident(rails)operator(.)ident(id)operator(\))operator(.)ident(developers)operator(.)ident(find)operator(()ident(john)operator(.)ident(id)operator(\)) - ident(assert_equal) constant(Developer)operator(.)ident(find)operator(()ident(mike)operator(.)ident(id)operator(\))operator(,) constant(Project)operator(.)ident(find)operator(()ident(rails)operator(.)ident(id)operator(\))operator(.)ident(developers)operator(.)ident(find)operator(()ident(mike)operator(.)ident(id)operator(\)) - ident(assert_equal) constant(Project)operator(.)ident(find)operator(()ident(rails)operator(.)ident(id)operator(\))operator(,) constant(Developer)operator(.)ident(find)operator(()ident(mike)operator(.)ident(id)operator(\))operator(.)ident(projects)operator(.)ident(find)operator(()ident(rails)operator(.)ident(id)operator(\)) - ident(assert_equal) constant(Project)operator(.)ident(find)operator(()ident(rails)operator(.)ident(id)operator(\))operator(,) constant(Developer)operator(.)ident(find)operator(()ident(john)operator(.)ident(id)operator(\))operator(.)ident(projects)operator(.)ident(find)operator(()ident(rails)operator(.)ident(id)operator(\)) - ident(ap)operator(.)ident(developers) operator(<<) ident(john) - ident(assert_equal) constant(Developer)operator(.)ident(find)operator(()ident(john)operator(.)ident(id)operator(\))operator(,) constant(Project)operator(.)ident(find)operator(()ident(ap)operator(.)ident(id)operator(\))operator(.)ident(developers)operator(.)ident(find)operator(()ident(john)operator(.)ident(id)operator(\)) - ident(assert_equal) constant(Project)operator(.)ident(find)operator(()ident(ap)operator(.)ident(id)operator(\))operator(,) constant(Developer)operator(.)ident(find)operator(()ident(john)operator(.)ident(id)operator(\))operator(.)ident(projects)operator(.)ident(find)operator(()ident(ap)operator(.)ident(id)operator(\)) - - ident(ap)operator(.)ident(developers)operator(.)ident(delete) ident(john) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) - constant(Project)operator(.)ident(find)operator(()ident(ap)operator(.)ident(id)operator(\))operator(.)ident(developers)operator(.)ident(find)operator(()ident(john)operator(.)ident(id)operator(\)) - operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) - constant(Developer)operator(.)ident(find)operator(()ident(john)operator(.)ident(id)operator(\))operator(.)ident(projects)operator(.)ident(find)operator(()ident(ap)operator(.)ident(id)operator(\)) - operator(}) - reserved(end) - - reserved(def) method(test_storing_in_pstore) - ident(require) string - ident(require) string - ident(apple) operator(=) constant(Firm)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(natural) operator(=) constant(Client)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(apple)operator(.)ident(clients) operator(<<) ident(natural) - - ident(db) operator(=) constant(PStore)operator(.)ident(new)operator(()constant(File)operator(.)ident(join)operator(()constant(Dir)operator(.)ident(tmpdir)operator(,) stringoperator(\))operator(\)) - ident(db)operator(.)ident(transaction) reserved(do) - ident(db)operator([)stringoperator(]) operator(=) ident(apple) - reserved(end) - - ident(db) operator(=) constant(PStore)operator(.)ident(new)operator(()constant(File)operator(.)ident(join)operator(()constant(Dir)operator(.)ident(tmpdir)operator(,) stringoperator(\))operator(\)) - ident(db)operator(.)ident(transaction) reserved(do) - ident(assert_equal) stringoperator(,) ident(db)operator([)stringoperator(])operator(.)ident(clients)operator(.)ident(first)operator(.)ident(name) - reserved(end) - reserved(end) - - reserved(def) method(test_has_many_find_all) - ident(assert_equal) integer(2)operator(,) constant(Firm)operator(.)ident(find_first)operator(.)ident(find_all_in_clients)operator(()stringcontent( = 'Client')delimiter(")>operator(\))operator(.)ident(length) - ident(assert_equal) integer(1)operator(,) constant(Firm)operator(.)ident(find_first)operator(.)ident(find_all_in_clients)operator(()stringoperator(\))operator(.)ident(length) - reserved(end) - - reserved(def) method(test_has_one) - ident(assert) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(account?)operator(()constant(Account)operator(.)ident(find)operator(()integer(1)operator(\))operator(\)) - ident(assert) ident(companies)operator(()symbol(:first_firm)operator(\))operator(.)ident(has_account?)operator(,) string - ident(assert) constant(Account)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(firm?)operator(()ident(companies)operator(()symbol(:first_firm)operator(\))operator(\))operator(,) string - ident(assert) constant(Account)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(has_firm?)operator(,) string - - ident(assert) operator(!)constant(Account)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(has_firm?)operator(,) string - ident(assert) operator(!)constant(Account)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(firm?)operator(()ident(companies)operator(()symbol(:first_firm)operator(\))operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_has_one_build) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(firm)operator(.)ident(save) - - ident(account) operator(=) ident(firm)operator(.)ident(build_account)operator(()string operator(=)operator(>) integer(1000)operator(\)) - ident(assert) ident(account)operator(.)ident(save) - ident(assert_equal) ident(account)operator(,) ident(firm)operator(.)ident(account) - reserved(end) - - reserved(def) method(test_has_one_failing_build_association) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(save) - - ident(account) operator(=) ident(firm)operator(.)ident(build_account) - ident(assert) operator(!)ident(account)operator(.)ident(save) - ident(assert_equal) stringoperator(,) ident(account)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_has_one_create) - ident(firm) operator(=) constant(Firm)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(firm)operator(.)ident(save) - ident(assert_equal) ident(firm)operator(.)ident(create_account)operator(()string operator(=)operator(>) integer(1000)operator(\))operator(,) ident(firm)operator(.)ident(account) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(DeprecatedFinderTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:companies)operator(,) symbol(:topics)operator(,) symbol(:entrants)operator(,) symbol(:developers) - - reserved(def) method(test_find_all_with_limit) - ident(entrants) operator(=) constant(Entrant)operator(.)ident(find_all) pre_constant(nil)operator(,) stringoperator(,) integer(2) - - ident(assert_equal)operator(()integer(2)operator(,) ident(entrants)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()ident(entrants)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(,) ident(entrants)operator(.)ident(first)operator(.)ident(name)operator(\)) - reserved(end) - - reserved(def) method(test_find_all_with_prepared_limit_and_offset) - ident(entrants) operator(=) constant(Entrant)operator(.)ident(find_all) pre_constant(nil)operator(,) stringoperator(,) operator([)integer(2)operator(,) integer(1)operator(]) - - ident(assert_equal)operator(()integer(2)operator(,) ident(entrants)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()ident(entrants)operator(()symbol(:second)operator(\))operator(.)ident(name)operator(,) ident(entrants)operator(.)ident(first)operator(.)ident(name)operator(\)) - reserved(end) - - reserved(def) method(test_find_first) - ident(first) operator(=) constant(Topic)operator(.)ident(find_first) string - ident(assert_equal)operator(()ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(title)operator(,) ident(first)operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_find_first_failing) - ident(first) operator(=) constant(Topic)operator(.)ident(find_first) string - ident(assert_nil)operator(()ident(first)operator(\)) - reserved(end) - - reserved(def) method(test_deprecated_find_on_conditions) - ident(assert) constant(Topic)operator(.)ident(find_on_conditions)operator(()integer(1)operator(,) operator([)stringoperator(,) pre_constant(false)operator(])operator(\)) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) constant(Topic)operator(.)ident(find_on_conditions)operator(()integer(1)operator(,) operator([)stringoperator(,) pre_constant(true)operator(])operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_condition_interpolation) - ident(assert_kind_of) constant(Firm)operator(,) constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_kind_of) constant(Time)operator(,) constant(Topic)operator(.)ident(find_first)operator(()operator([)stringoperator(,) integer(1)operator(])operator(\))operator(.)ident(written_on) - reserved(end) - - reserved(def) method(test_bind_variables) - ident(assert_kind_of) constant(Firm)operator(,) constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_kind_of) constant(Time)operator(,) constant(Topic)operator(.)ident(find_first)operator(()operator([)stringoperator(,) integer(1)operator(])operator(\))operator(.)ident(written_on) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(PreparedStatementInvalid)operator(\)) operator({) - constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) integer(2)operator(])operator(\)) - operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(PreparedStatementInvalid)operator(\)) operator({) - constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(])operator(\)) - operator(}) - reserved(end) - - reserved(def) method(test_bind_variables_with_quotes) - constant(Company)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) - reserved(end) - - reserved(def) method(test_named_bind_variables_with_quotes) - constant(Company)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) operator({)symbol(:name) operator(=)operator(>) stringoperator(})operator(])operator(\)) - reserved(end) - - reserved(def) method(test_named_bind_variables) - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) symbol(:a) operator(=)operator(>) integer(1)operator(\)) comment(# ' ruby-mode) - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) symbol(:a) operator(=)operator(>) integer(1)operator(\)) comment(# ' ruby-mode) - - ident(assert_kind_of) constant(Firm)operator(,) constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find_first)operator(()operator([)stringoperator(,) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(])operator(\)) - ident(assert_kind_of) constant(Time)operator(,) constant(Topic)operator(.)ident(find_first)operator(()operator([)stringoperator(,) operator({) symbol(:id) operator(=)operator(>) integer(1) operator(})operator(])operator(\))operator(.)ident(written_on) - reserved(end) - - reserved(def) method(test_count) - ident(assert_equal)operator(()integer(0)operator(,) constant(Entrant)operator(.)ident(count)operator(()string 3)delimiter(")>operator(\))operator(\)) - ident(assert_equal)operator(()integer(1)operator(,) constant(Entrant)operator(.)ident(count)operator(()operator([)string ?)delimiter(")>operator(,) integer(2)operator(])operator(\))operator(\)) - ident(assert_equal)operator(()integer(2)operator(,) constant(Entrant)operator(.)ident(count)operator(()operator([)string ?)delimiter(")>operator(,) integer(1)operator(])operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_count_by_sql) - ident(assert_equal)operator(()integer(0)operator(,) constant(Entrant)operator(.)ident(count_by_sql)operator(()string 3)delimiter(")>operator(\))operator(\)) - ident(assert_equal)operator(()integer(1)operator(,) constant(Entrant)operator(.)ident(count_by_sql)operator(()operator([)string ?)delimiter(")>operator(,) integer(2)operator(])operator(\))operator(\)) - ident(assert_equal)operator(()integer(2)operator(,) constant(Entrant)operator(.)ident(count_by_sql)operator(()operator([)string ?)delimiter(")>operator(,) integer(1)operator(])operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_find_all_with_limit) - ident(first_five_developers) operator(=) constant(Developer)operator(.)ident(find_all) pre_constant(nil)operator(,) stringoperator(,) integer(5) - ident(assert_equal) integer(5)operator(,) ident(first_five_developers)operator(.)ident(length) - ident(assert_equal) stringoperator(,) ident(first_five_developers)operator(.)ident(first)operator(.)ident(name) - ident(assert_equal) stringoperator(,) ident(first_five_developers)operator(.)ident(last)operator(.)ident(name) - - ident(no_developers) operator(=) constant(Developer)operator(.)ident(find_all) pre_constant(nil)operator(,) stringoperator(,) integer(0) - ident(assert_equal) integer(0)operator(,) ident(no_developers)operator(.)ident(length) - - ident(assert_equal) ident(first_five_developers)operator(,) constant(Developer)operator(.)ident(find_all)operator(()pre_constant(nil)operator(,) stringoperator(,) operator([)integer(5)operator(])operator(\)) - ident(assert_equal) ident(no_developers)operator(,) constant(Developer)operator(.)ident(find_all)operator(()pre_constant(nil)operator(,) stringoperator(,) operator([)integer(0)operator(])operator(\)) - reserved(end) - - reserved(def) method(test_find_all_with_limit_and_offset) - ident(first_three_developers) operator(=) constant(Developer)operator(.)ident(find_all) pre_constant(nil)operator(,) stringoperator(,) operator([)integer(3)operator(,) integer(0)operator(]) - ident(second_three_developers) operator(=) constant(Developer)operator(.)ident(find_all) pre_constant(nil)operator(,) stringoperator(,) operator([)integer(3)operator(,) integer(3)operator(]) - ident(last_two_developers) operator(=) constant(Developer)operator(.)ident(find_all) pre_constant(nil)operator(,) stringoperator(,) operator([)integer(2)operator(,) integer(8)operator(]) - - ident(assert_equal) integer(3)operator(,) ident(first_three_developers)operator(.)ident(length) - ident(assert_equal) integer(3)operator(,) ident(second_three_developers)operator(.)ident(length) - ident(assert_equal) integer(2)operator(,) ident(last_two_developers)operator(.)ident(length) - - ident(assert_equal) stringoperator(,) ident(first_three_developers)operator(.)ident(first)operator(.)ident(name) - ident(assert_equal) stringoperator(,) ident(second_three_developers)operator(.)ident(first)operator(.)ident(name) - ident(assert_equal) stringoperator(,) ident(last_two_developers)operator(.)ident(first)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_find_all_by_one_attribute_with_options) - ident(topics) operator(=) constant(Topic)operator(.)ident(find_all_by_content)operator(()stringoperator(,) stringoperator(\)) - ident(assert) ident(topics)operator(()symbol(:first)operator(\))operator(,) ident(topics)operator(.)ident(last) - - ident(topics) operator(=) constant(Topic)operator(.)ident(find_all_by_content)operator(()stringoperator(,) stringoperator(\)) - ident(assert) ident(topics)operator(()symbol(:first)operator(\))operator(,) ident(topics)operator(.)ident(first) - reserved(end) - - ident(protected) - reserved(def) method(bind)operator(()ident(statement)operator(,) operator(*)ident(vars)operator(\)) - reserved(if) ident(vars)operator(.)ident(first)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(send)operator(()symbol(:replace_named_bind_variables)operator(,) ident(statement)operator(,) ident(vars)operator(.)ident(first)operator(\)) - reserved(else) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(send)operator(()symbol(:replace_bind_variables)operator(,) ident(statement)operator(,) ident(vars)operator(\)) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(FinderTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:companies)operator(,) symbol(:topics)operator(,) symbol(:entrants)operator(,) symbol(:developers)operator(,) symbol(:developers_projects)operator(,) symbol(:posts)operator(,) symbol(:accounts) - - reserved(def) method(test_find) - ident(assert_equal)operator(()ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(title)operator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_exists) - ident(assert) operator(()constant(Topic)operator(.)ident(exists?)operator(()integer(1)operator(\))operator(\)) - ident(assert) operator(!)operator(()constant(Topic)operator(.)ident(exists?)operator(()integer(45)operator(\))operator(\)) - ident(assert) operator(!)operator(()constant(Topic)operator(.)ident(exists?)operator(()stringoperator(\))operator(\)) - ident(assert) operator(!)operator(()constant(Topic)operator(.)ident(exists?)operator(()operator([)integer(1)operator(,)integer(2)operator(])operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_find_by_array_of_one_id) - ident(assert_kind_of)operator(()constant(Array)operator(,) constant(Topic)operator(.)ident(find)operator(()operator([) integer(1) operator(])operator(\))operator(\)) - ident(assert_equal)operator(()integer(1)operator(,) constant(Topic)operator(.)ident(find)operator(()operator([) integer(1) operator(])operator(\))operator(.)ident(length)operator(\)) - reserved(end) - - reserved(def) method(test_find_by_ids) - ident(assert_equal)operator(()integer(2)operator(,) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(,) integer(2)operator(\))operator(.)ident(length)operator(\)) - ident(assert_equal)operator(()ident(topics)operator(()symbol(:second)operator(\))operator(.)ident(title)operator(,) constant(Topic)operator(.)ident(find)operator(()operator([) integer(2) operator(])operator(\))operator(.)ident(first)operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_find_an_empty_array) - ident(assert_equal) operator([)operator(])operator(,) constant(Topic)operator(.)ident(find)operator(()operator([)operator(])operator(\)) - reserved(end) - - reserved(def) method(test_find_by_ids_missing_one) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) - constant(Topic)operator(.)ident(find)operator(()integer(1)operator(,) integer(2)operator(,) integer(45)operator(\)) - operator(}) - reserved(end) - - reserved(def) method(test_find_all_with_limit) - ident(entrants) operator(=) constant(Entrant)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(\)) - - ident(assert_equal)operator(()integer(2)operator(,) ident(entrants)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()ident(entrants)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(,) ident(entrants)operator(.)ident(first)operator(.)ident(name)operator(\)) - reserved(end) - - reserved(def) method(test_find_all_with_prepared_limit_and_offset) - ident(entrants) operator(=) constant(Entrant)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(,) symbol(:offset) operator(=)operator(>) integer(1)operator(\)) - - ident(assert_equal)operator(()integer(2)operator(,) ident(entrants)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()ident(entrants)operator(()symbol(:second)operator(\))operator(.)ident(name)operator(,) ident(entrants)operator(.)ident(first)operator(.)ident(name)operator(\)) - - ident(entrants) operator(=) constant(Entrant)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(,) symbol(:offset) operator(=)operator(>) integer(2)operator(\)) - ident(assert_equal)operator(()integer(1)operator(,) ident(entrants)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()ident(entrants)operator(()symbol(:third)operator(\))operator(.)ident(name)operator(,) ident(entrants)operator(.)ident(first)operator(.)ident(name)operator(\)) - reserved(end) - - reserved(def) method(test_find_all_with_limit_and_offset_and_multiple_orderings) - ident(developers) operator(=) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:offset) operator(=)operator(>) integer(1)operator(\)) - ident(assert_equal) operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(developers)operator(.)ident(collect) operator({)operator(|)ident(d)operator(|) ident(d)operator(.)ident(name)operator(}) - reserved(end) - - reserved(def) method(test_find_with_limit_and_condition) - ident(developers) operator(=) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:offset) operator(=)operator(>)integer(7)operator(\)) - ident(assert_equal)operator(()integer(1)operator(,) ident(developers)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(developers)operator(.)ident(first)operator(.)ident(name)operator(\)) - reserved(end) - - reserved(def) method(test_find_with_entire_select_statement) - ident(topics) operator(=) constant(Topic)operator(.)ident(find_by_sql) string - - ident(assert_equal)operator(()integer(1)operator(,) ident(topics)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()ident(topics)operator(()symbol(:second)operator(\))operator(.)ident(title)operator(,) ident(topics)operator(.)ident(first)operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_find_with_prepared_select_statement) - ident(topics) operator(=) constant(Topic)operator(.)ident(find_by_sql) operator([)stringoperator(,) stringoperator(]) - - ident(assert_equal)operator(()integer(1)operator(,) ident(topics)operator(.)ident(size)operator(\)) - ident(assert_equal)operator(()ident(topics)operator(()symbol(:second)operator(\))operator(.)ident(title)operator(,) ident(topics)operator(.)ident(first)operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_find_first) - ident(first) operator(=) constant(Topic)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal)operator(()ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(title)operator(,) ident(first)operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_find_first_failing) - ident(first) operator(=) constant(Topic)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_nil)operator(()ident(first)operator(\)) - reserved(end) - - reserved(def) method(test_unexisting_record_exception_handling) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) - constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(parent) - operator(}) - - constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(topic) - reserved(end) - - reserved(def) method(test_find_only_some_columns) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(,) symbol(:select) operator(=)operator(>) stringoperator(\)) - ident(assert_raises)operator(()constant(NoMethodError)operator(\)) operator({) ident(topic)operator(.)ident(title) operator(}) - ident(assert_equal) stringoperator(,) ident(topic)operator(.)ident(author_name) - ident(assert) operator(!)ident(topic)operator(.)ident(attribute_present?)operator(()stringoperator(\)) - ident(assert) operator(!)ident(topic)operator(.)ident(respond_to?)operator(()stringoperator(\)) - ident(assert) ident(topic)operator(.)ident(attribute_present?)operator(()stringoperator(\)) - ident(assert) ident(topic)operator(.)ident(respond_to?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_find_on_conditions) - ident(assert) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) pre_constant(false)operator(])operator(\)) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) pre_constant(true)operator(])operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_condition_interpolation) - ident(assert_kind_of) constant(Firm)operator(,) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_kind_of) constant(Time)operator(,) constant(Topic)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) integer(1)operator(])operator(\))operator(.)ident(written_on) - reserved(end) - - reserved(def) method(test_bind_variables) - ident(assert_kind_of) constant(Firm)operator(,) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert_kind_of) constant(Time)operator(,) constant(Topic)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) integer(1)operator(])operator(\))operator(.)ident(written_on) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(PreparedStatementInvalid)operator(\)) operator({) - constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) integer(2)operator(])operator(\)) - operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(PreparedStatementInvalid)operator(\)) operator({) - constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(])operator(\)) - operator(}) - reserved(end) - - reserved(def) method(test_bind_variables_with_quotes) - constant(Company)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - reserved(end) - - reserved(def) method(test_named_bind_variables_with_quotes) - constant(Company)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) operator({)symbol(:name) operator(=)operator(>) stringoperator(})operator(])operator(\)) - reserved(end) - - reserved(def) method(test_bind_arity) - ident(assert_nothing_raised) operator({) ident(bind) string operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(PreparedStatementInvalid)operator(\)) operator({) ident(bind) stringoperator(,) integer(1) operator(}) - - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(PreparedStatementInvalid)operator(\)) operator({) ident(bind) string operator(}) - ident(assert_nothing_raised) operator({) ident(bind) stringoperator(,) integer(1) operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(PreparedStatementInvalid)operator(\)) operator({) ident(bind) stringoperator(,) integer(1)operator(,) integer(1) operator(}) - reserved(end) - - reserved(def) method(test_named_bind_variables) - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) symbol(:a) operator(=)operator(>) integer(1)operator(\)) comment(# ' ruby-mode) - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) symbol(:a) operator(=)operator(>) integer(1)operator(\)) comment(# ' ruby-mode) - - ident(assert_kind_of) constant(Firm)operator(,) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(])operator(\)) - ident(assert_nil) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) operator({) symbol(:name) operator(=)operator(>) string operator(})operator(])operator(\)) - ident(assert_kind_of) constant(Time)operator(,) constant(Topic)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) operator({) symbol(:id) operator(=)operator(>) integer(1) operator(})operator(])operator(\))operator(.)ident(written_on) - reserved(end) - - reserved(def) method(test_bind_enumerable) - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(])operator(\)) - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) stringoperator(\)) - - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) symbol(:a) operator(=)operator(>) operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(])operator(\)) - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) symbol(:a) operator(=)operator(>) stringoperator(\)) comment(# ') - - ident(require) string - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) constant(Set)operator(.)ident(new)operator(()operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(])operator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) constant(Set)operator(.)ident(new)operator(()stringoperator(\))operator(\)) - - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) symbol(:a) operator(=)operator(>) constant(Set)operator(.)ident(new)operator(()operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(])operator(\))operator(\)) - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) symbol(:a) operator(=)operator(>) constant(Set)operator(.)ident(new)operator(()stringoperator(\))operator(\)) comment(# ') - reserved(end) - - reserved(def) method(test_bind_string) - ident(assert_equal) stringoperator(,) ident(bind)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_string_sanitation) - ident(assert_not_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(sanitize)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(sanitize)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_count) - ident(assert_equal)operator(()integer(0)operator(,) constant(Entrant)operator(.)ident(count)operator(()string 3)delimiter(")>operator(\))operator(\)) - ident(assert_equal)operator(()integer(1)operator(,) constant(Entrant)operator(.)ident(count)operator(()operator([)string ?)delimiter(")>operator(,) integer(2)operator(])operator(\))operator(\)) - ident(assert_equal)operator(()integer(2)operator(,) constant(Entrant)operator(.)ident(count)operator(()operator([)string ?)delimiter(")>operator(,) integer(1)operator(])operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_count_by_sql) - ident(assert_equal)operator(()integer(0)operator(,) constant(Entrant)operator(.)ident(count_by_sql)operator(()string 3)delimiter(")>operator(\))operator(\)) - ident(assert_equal)operator(()integer(1)operator(,) constant(Entrant)operator(.)ident(count_by_sql)operator(()operator([)string ?)delimiter(")>operator(,) integer(2)operator(])operator(\))operator(\)) - ident(assert_equal)operator(()integer(2)operator(,) constant(Entrant)operator(.)ident(count_by_sql)operator(()operator([)string ?)delimiter(")>operator(,) integer(1)operator(])operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_find_by_one_attribute) - ident(assert_equal) ident(topics)operator(()symbol(:first)operator(\))operator(,) constant(Topic)operator(.)ident(find_by_title)operator(()stringoperator(\)) - ident(assert_nil) constant(Topic)operator(.)ident(find_by_title)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_find_by_one_attribute_with_order_option) - ident(assert_equal) ident(accounts)operator(()symbol(:signals37)operator(\))operator(,) constant(Account)operator(.)ident(find_by_credit_limit)operator(()integer(50)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(accounts)operator(()symbol(:rails_core_account)operator(\))operator(,) constant(Account)operator(.)ident(find_by_credit_limit)operator(()integer(50)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_find_by_one_attribute_with_conditions) - ident(assert_equal) ident(accounts)operator(()symbol(:rails_core_account)operator(\))operator(,) constant(Account)operator(.)ident(find_by_credit_limit)operator(()integer(50)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) integer(6)operator(])operator(\)) - reserved(end) - - reserved(def) method(test_find_by_one_attribute_with_several_options) - ident(assert_equal) ident(accounts)operator(()symbol(:unknown)operator(\))operator(,) constant(Account)operator(.)ident(find_by_credit_limit)operator(()integer(50)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) integer(3)operator(])operator(\)) - reserved(end) - - reserved(def) method(test_find_by_one_missing_attribute) - ident(assert_raises)operator(()constant(NoMethodError)operator(\)) operator({) constant(Topic)operator(.)ident(find_by_undertitle)operator(()stringoperator(\)) operator(}) - reserved(end) - - reserved(def) method(test_find_by_two_attributes) - ident(assert_equal) ident(topics)operator(()symbol(:first)operator(\))operator(,) constant(Topic)operator(.)ident(find_by_title_and_author_name)operator(()stringoperator(,) stringoperator(\)) - ident(assert_nil) constant(Topic)operator(.)ident(find_by_title_and_author_name)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_find_all_by_one_attribute) - ident(topics) operator(=) constant(Topic)operator(.)ident(find_all_by_content)operator(()stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(topics)operator(.)ident(size) - ident(assert) ident(topics)operator(.)ident(include?)operator(()ident(topics)operator(()symbol(:first)operator(\))operator(\)) - - ident(assert_equal) operator([)operator(])operator(,) constant(Topic)operator(.)ident(find_all_by_title)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_find_all_by_one_attribute_with_options) - ident(topics) operator(=) constant(Topic)operator(.)ident(find_all_by_content)operator(()stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert) ident(topics)operator(()symbol(:first)operator(\))operator(,) ident(topics)operator(.)ident(last) - - ident(topics) operator(=) constant(Topic)operator(.)ident(find_all_by_content)operator(()stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert) ident(topics)operator(()symbol(:first)operator(\))operator(,) ident(topics)operator(.)ident(first) - reserved(end) - - reserved(def) method(test_find_all_by_array_attribute) - ident(assert_equal) integer(2)operator(,) constant(Topic)operator(.)ident(find_all_by_title)operator(()operator([)stringoperator(,) stringoperator(])operator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_find_all_by_boolean_attribute) - ident(topics) operator(=) constant(Topic)operator(.)ident(find_all_by_approved)operator(()pre_constant(false)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(topics)operator(.)ident(size) - ident(assert) ident(topics)operator(.)ident(include?)operator(()ident(topics)operator(()symbol(:first)operator(\))operator(\)) - - ident(topics) operator(=) constant(Topic)operator(.)ident(find_all_by_approved)operator(()pre_constant(true)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(topics)operator(.)ident(size) - ident(assert) ident(topics)operator(.)ident(include?)operator(()ident(topics)operator(()symbol(:second)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_find_by_nil_attribute) - ident(topic) operator(=) constant(Topic)operator(.)ident(find_by_last_read) pre_constant(nil) - ident(assert_not_nil) ident(topic) - ident(assert_nil) ident(topic)operator(.)ident(last_read) - reserved(end) - - reserved(def) method(test_find_all_by_nil_attribute) - ident(topics) operator(=) constant(Topic)operator(.)ident(find_all_by_last_read) pre_constant(nil) - ident(assert_equal) integer(1)operator(,) ident(topics)operator(.)ident(size) - ident(assert_nil) ident(topics)operator([)integer(0)operator(])operator(.)ident(last_read) - reserved(end) - - reserved(def) method(test_find_by_nil_and_not_nil_attributes) - ident(topic) operator(=) constant(Topic)operator(.)ident(find_by_last_read_and_author_name) pre_constant(nil)operator(,) string - ident(assert_equal) stringoperator(,) ident(topic)operator(.)ident(author_name) - reserved(end) - - reserved(def) method(test_find_all_by_nil_and_not_nil_attributes) - ident(topics) operator(=) constant(Topic)operator(.)ident(find_all_by_last_read_and_author_name) pre_constant(nil)operator(,) string - ident(assert_equal) integer(1)operator(,) ident(topics)operator(.)ident(size) - ident(assert_equal) stringoperator(,) ident(topics)operator([)integer(0)operator(])operator(.)ident(author_name) - reserved(end) - - reserved(def) method(test_find_or_create_from_one_attribute) - ident(number_of_companies) operator(=) constant(Company)operator(.)ident(count) - ident(sig38) operator(=) constant(Company)operator(.)ident(find_or_create_by_name)operator(()stringoperator(\)) - ident(assert_equal) ident(number_of_companies) operator(+) integer(1)operator(,) constant(Company)operator(.)ident(count) - ident(assert_equal) ident(sig38)operator(,) constant(Company)operator(.)ident(find_or_create_by_name)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_find_or_create_from_two_attributes) - ident(number_of_topics) operator(=) constant(Topic)operator(.)ident(count) - ident(another) operator(=) constant(Topic)operator(.)ident(find_or_create_by_title_and_author_name)operator(()stringoperator(,)stringoperator(\)) - ident(assert_equal) ident(number_of_topics) operator(+) integer(1)operator(,) constant(Topic)operator(.)ident(count) - ident(assert_equal) ident(another)operator(,) constant(Topic)operator(.)ident(find_or_create_by_title_and_author_name)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(test_find_with_bad_sql) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(\)) operator({) constant(Topic)operator(.)ident(find_by_sql) string operator(}) - reserved(end) - - reserved(def) method(test_find_with_invalid_params) - ident(assert_raises)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(find) symbol(:first)operator(,) symbol(:join) operator(=)operator(>) string operator(}) - ident(assert_raises)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(find) symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:join) operator(=)operator(>) string operator(}) - reserved(end) - - reserved(def) method(test_find_all_with_limit) - ident(first_five_developers) operator(=) constant(Developer)operator(.)ident(find) symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(5) - ident(assert_equal) integer(5)operator(,) ident(first_five_developers)operator(.)ident(length) - ident(assert_equal) stringoperator(,) ident(first_five_developers)operator(.)ident(first)operator(.)ident(name) - ident(assert_equal) stringoperator(,) ident(first_five_developers)operator(.)ident(last)operator(.)ident(name) - - ident(no_developers) operator(=) constant(Developer)operator(.)ident(find) symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(0) - ident(assert_equal) integer(0)operator(,) ident(no_developers)operator(.)ident(length) - reserved(end) - - reserved(def) method(test_find_all_with_limit_and_offset) - ident(first_three_developers) operator(=) constant(Developer)operator(.)ident(find) symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:offset) operator(=)operator(>) integer(0) - ident(second_three_developers) operator(=) constant(Developer)operator(.)ident(find) symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:offset) operator(=)operator(>) integer(3) - ident(last_two_developers) operator(=) constant(Developer)operator(.)ident(find) symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(2)operator(,) symbol(:offset) operator(=)operator(>) integer(8) - - ident(assert_equal) integer(3)operator(,) ident(first_three_developers)operator(.)ident(length) - ident(assert_equal) integer(3)operator(,) ident(second_three_developers)operator(.)ident(length) - ident(assert_equal) integer(2)operator(,) ident(last_two_developers)operator(.)ident(length) - - ident(assert_equal) stringoperator(,) ident(first_three_developers)operator(.)ident(first)operator(.)ident(name) - ident(assert_equal) stringoperator(,) ident(second_three_developers)operator(.)ident(first)operator(.)ident(name) - ident(assert_equal) stringoperator(,) ident(last_two_developers)operator(.)ident(first)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_find_all_with_limit_and_offset_and_multiple_order_clauses) - ident(first_three_posts) operator(=) constant(Post)operator(.)ident(find) symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:offset) operator(=)operator(>) integer(0) - ident(second_three_posts) operator(=) constant(Post)operator(.)ident(find) symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:offset) operator(=)operator(>) integer(3) - ident(last_posts) operator(=) constant(Post)operator(.)ident(find) symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(3)operator(,) symbol(:offset) operator(=)operator(>) integer(6) - - ident(assert_equal) operator([)operator([)integer(0)operator(,)integer(3)operator(])operator(,)operator([)integer(1)operator(,)integer(1)operator(])operator(,)operator([)integer(1)operator(,)integer(2)operator(])operator(])operator(,) ident(first_three_posts)operator(.)ident(map) operator({) operator(|)ident(p)operator(|) operator([)ident(p)operator(.)ident(author_id)operator(,) ident(p)operator(.)ident(id)operator(]) operator(}) - ident(assert_equal) operator([)operator([)integer(1)operator(,)integer(4)operator(])operator(,)operator([)integer(1)operator(,)integer(5)operator(])operator(,)operator([)integer(1)operator(,)integer(6)operator(])operator(])operator(,) ident(second_three_posts)operator(.)ident(map) operator({) operator(|)ident(p)operator(|) operator([)ident(p)operator(.)ident(author_id)operator(,) ident(p)operator(.)ident(id)operator(]) operator(}) - ident(assert_equal) operator([)operator([)integer(2)operator(,)integer(7)operator(])operator(])operator(,) ident(last_posts)operator(.)ident(map) operator({) operator(|)ident(p)operator(|) operator([)ident(p)operator(.)ident(author_id)operator(,) ident(p)operator(.)ident(id)operator(]) operator(}) - reserved(end) - - reserved(def) method(test_find_all_with_join) - ident(developers_on_project_one) operator(=) constant(Developer)operator(.)ident(find)operator(() - symbol(:all)operator(,) - symbol(:joins) operator(=)operator(>) stringoperator(,) - symbol(:conditions) operator(=)operator(>) string - operator(\)) - ident(assert_equal) integer(3)operator(,) ident(developers_on_project_one)operator(.)ident(length) - ident(developer_names) operator(=) ident(developers_on_project_one)operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - ident(assert) ident(developer_names)operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(developer_names)operator(.)ident(include?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_find_by_id_with_conditions_with_or) - ident(assert_nothing_raised) reserved(do) - constant(Post)operator(.)ident(find)operator(()operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(])operator(,) - symbol(:conditions) operator(=)operator(>) stringcontent( = 'Post')delimiter(")>operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_select_value) - ident(assert_equal) stringoperator(,) constant(Company)operator(.)ident(connection)operator(.)ident(select_value)operator(()stringoperator(\)) - ident(assert_nil) constant(Company)operator(.)ident(connection)operator(.)ident(select_value)operator(()stringoperator(\)) - comment(# make sure we didn't break count...) - ident(assert_equal) integer(0)operator(,) constant(Company)operator(.)ident(count_by_sql)operator(()stringoperator(\)) - ident(assert_equal) integer(1)operator(,) constant(Company)operator(.)ident(count_by_sql)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_select_values) - ident(assert_equal) operator([)stringoperator(,)stringoperator(,)stringoperator(,)stringoperator(,)stringoperator(,)stringoperator(,)stringoperator(,)stringoperator(])operator(,) constant(Company)operator(.)ident(connection)operator(.)ident(select_values)operator(()stringoperator(\))operator(.)ident(map!) operator({) operator(|)ident(i)operator(|) ident(i)operator(.)ident(to_s) operator(}) - ident(assert_equal) operator([)stringoperator(,)stringoperator(,)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(,) constant(Company)operator(.)ident(connection)operator(.)ident(select_values)operator(()stringoperator(\)) - reserved(end) - - ident(protected) - reserved(def) method(bind)operator(()ident(statement)operator(,) operator(*)ident(vars)operator(\)) - reserved(if) ident(vars)operator(.)ident(first)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(send)operator(()symbol(:replace_named_bind_variables)operator(,) ident(statement)operator(,) ident(vars)operator(.)ident(first)operator(\)) - reserved(else) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(send)operator(()symbol(:replace_bind_variables)operator(,) ident(statement)operator(,) ident(vars)operator(\)) - reserved(end) - reserved(end) -reserved(end) -reserved(class) class(Author) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_many) symbol(:posts) - ident(has_many) symbol(:posts_with_comments)operator(,) symbol(:include) operator(=)operator(>) symbol(:comments)operator(,) symbol(:class_name) operator(=)operator(>) string - ident(has_many) symbol(:posts_with_categories)operator(,) symbol(:include) operator(=)operator(>) symbol(:categories)operator(,) symbol(:class_name) operator(=)operator(>) string - ident(has_many) symbol(:posts_with_comments_and_categories)operator(,) symbol(:include) operator(=)operator(>) operator([) symbol(:comments)operator(,) symbol(:categories) operator(])operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:class_name) operator(=)operator(>) string - ident(has_many) symbol(:comments)operator(,) symbol(:through) operator(=)operator(>) symbol(:posts) - ident(has_many) symbol(:funky_comments)operator(,) symbol(:through) operator(=)operator(>) symbol(:posts)operator(,) symbol(:source) operator(=)operator(>) symbol(:comments) - - ident(has_many) symbol(:special_posts)operator(,) symbol(:class_name) operator(=)operator(>) string - ident(has_many) symbol(:hello_posts)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:conditions)operator(=)operator(>)string - ident(has_many) symbol(:nonexistent_posts)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:conditions)operator(=)operator(>)string - ident(has_many) symbol(:posts_with_callbacks)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:before_add) operator(=)operator(>) symbol(:log_before_adding)operator(,) - symbol(:after_add) operator(=)operator(>) symbol(:log_after_adding)operator(,) - symbol(:before_remove) operator(=)operator(>) symbol(:log_before_removing)operator(,) - symbol(:after_remove) operator(=)operator(>) symbol(:log_after_removing) - ident(has_many) symbol(:posts_with_proc_callbacks)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:before_add) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(o)operator(,) ident(r)operator(|) ident(o)operator(.)ident(post_log) operator(<<) stringdelimiter(")>operator(})operator(,) - symbol(:after_add) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(o)operator(,) ident(r)operator(|) ident(o)operator(.)ident(post_log) operator(<<) stringdelimiter(")>operator(})operator(,) - symbol(:before_remove) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(o)operator(,) ident(r)operator(|) ident(o)operator(.)ident(post_log) operator(<<) stringdelimiter(")>operator(})operator(,) - symbol(:after_remove) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(o)operator(,) ident(r)operator(|) ident(o)operator(.)ident(post_log) operator(<<) stringdelimiter(")>operator(}) - ident(has_many) symbol(:posts_with_multiple_callbacks)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:before_add) operator(=)operator(>) operator([)symbol(:log_before_adding)operator(,) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(o)operator(,) ident(r)operator(|) ident(o)operator(.)ident(post_log) operator(<<) stringdelimiter(")>operator(})operator(])operator(,) - symbol(:after_add) operator(=)operator(>) operator([)symbol(:log_after_adding)operator(,) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(o)operator(,) ident(r)operator(|) ident(o)operator(.)ident(post_log) operator(<<) stringdelimiter(")>operator(})operator(]) - ident(has_many) symbol(:unchangable_posts)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:before_add) operator(=)operator(>) symbol(:raise_exception)operator(,) symbol(:after_add) operator(=)operator(>) symbol(:log_after_adding) - - ident(has_many) symbol(:categorizations) - ident(has_many) symbol(:categories)operator(,) symbol(:through) operator(=)operator(>) symbol(:categorizations) - - ident(has_many) symbol(:nothings)operator(,) symbol(:through) operator(=)operator(>) symbol(:kateggorisatons)operator(,) symbol(:class_name) operator(=)operator(>) string - - ident(has_many) symbol(:author_favorites) - ident(has_many) symbol(:favorite_authors)operator(,) symbol(:through) operator(=)operator(>) symbol(:author_favorites)operator(,) symbol(:order) operator(=)operator(>) string - - ident(has_many) symbol(:tagging)operator(,) symbol(:through) operator(=)operator(>) symbol(:posts) comment(# through polymorphic has_one) - ident(has_many) symbol(:taggings)operator(,) symbol(:through) operator(=)operator(>) symbol(:posts)operator(,) symbol(:source) operator(=)operator(>) symbol(:taggings) comment(# through polymorphic has_many) - ident(has_many) symbol(:tags)operator(,) symbol(:through) operator(=)operator(>) symbol(:posts) comment(# through has_many :through) - ident(has_many) symbol(:post_categories)operator(,) symbol(:through) operator(=)operator(>) symbol(:posts)operator(,) symbol(:source) operator(=)operator(>) symbol(:categories) - - ident(belongs_to) symbol(:author_address) - - ident(attr_accessor) symbol(:post_log) - - reserved(def) method(after_initialize) - instance_variable(@post_log) operator(=) operator([)operator(]) - reserved(end) - - ident(private) - reserved(def) method(log_before_adding)operator(()ident(object)operator(\)) - instance_variable(@post_log) operator(<<) stringdelimiter(")> - reserved(end) - - reserved(def) method(log_after_adding)operator(()ident(object)operator(\)) - instance_variable(@post_log) operator(<<) stringdelimiter(")> - reserved(end) - - reserved(def) method(log_before_removing)operator(()ident(object)operator(\)) - instance_variable(@post_log) operator(<<) stringdelimiter(")> - reserved(end) - - reserved(def) method(log_after_removing)operator(()ident(object)operator(\)) - instance_variable(@post_log) operator(<<) stringdelimiter(")> - reserved(end) - - reserved(def) method(raise_exception)operator(()ident(object)operator(\)) - ident(raise) constant(Exception)operator(.)ident(new)operator(()stringoperator(\)) - reserved(end) -reserved(end) - -reserved(class) class(AuthorAddress) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_one) symbol(:author) -reserved(end) - -reserved(class) class(AuthorFavorite) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:author) - ident(belongs_to) symbol(:favorite_author)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:foreign_key) operator(=)operator(>) string -ident(endclass) constant(AutoId) operator(<) constant(ActiveRecord)operator(::)constant(Base) - reserved(def) pre_constant(self)operator(.)method(table_name) operator(()operator(\)) string reserved(end) - reserved(def) pre_constant(self)operator(.)method(primary_key) operator(()operator(\)) string reserved(end) -reserved(end) -reserved(class) class(Binary) operator(<) constant(ActiveRecord)operator(::)constant(Base) -ident(endclass) constant(Categorization) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:post) - ident(belongs_to) symbol(:category) - ident(belongs_to) symbol(:author) -ident(endclass) constant(Category) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_and_belongs_to_many) symbol(:posts) - ident(has_and_belongs_to_many) symbol(:special_posts)operator(,) symbol(:class_name) operator(=)operator(>) string - ident(has_and_belongs_to_many) symbol(:hello_posts)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:conditions) operator(=)operator(>) string - ident(has_and_belongs_to_many) symbol(:nonexistent_posts)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:conditions)operator(=)operator(>)string - - reserved(def) pre_constant(self)operator(.)method(what_are_you) - string - reserved(end) - - ident(has_many) symbol(:categorizations) - ident(has_many) symbol(:authors)operator(,) symbol(:through) operator(=)operator(>) symbol(:categorizations)operator(,) symbol(:select) operator(=)operator(>) string -reserved(end) - -reserved(class) class(SpecialCategory) operator(<) constant(Category) - - reserved(def) pre_constant(self)operator(.)method(what_are_you) - string - reserved(end) - -reserved(end) -reserved(class) class(ColumnName) operator(<) constant(ActiveRecord)operator(::)constant(Base) - reserved(def) pre_constant(self)operator(.)method(table_name) operator(()operator(\)) string reserved(end) -ident(endclass) constant(Comment) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:post) - - reserved(def) pre_constant(self)operator(.)method(what_are_you) - string - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(search_by_type)operator(()ident(q)operator(\)) - pre_constant(self)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringcontent( = ?)delimiter(")>operator(,) ident(q)operator(])operator(\)) - reserved(end) -reserved(end) - -reserved(class) class(SpecialComment) operator(<) constant(Comment) - reserved(def) pre_constant(self)operator(.)method(what_are_you) - string - reserved(end) -reserved(end) - -reserved(class) class(VerySpecialComment) operator(<) constant(Comment) - reserved(def) pre_constant(self)operator(.)method(what_are_you) - string - reserved(end) -ident(endclass) constant(Company) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(attr_protected) symbol(:rating) - ident(set_sequence_name) symbol(:companies_nonstd_seq) - - ident(validates_presence_of) symbol(:name) - - ident(has_one) symbol(:dummy_account)operator(,) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:class_name) operator(=)operator(>) string -reserved(end) - - -reserved(class) class(Firm) operator(<) constant(Company) - ident(has_many) symbol(:clients)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:dependent) operator(=)operator(>) symbol(:destroy)operator(,) symbol(:counter_sql) operator(=)operator(>) - string operator(+) - stringcontent( = 'Client' OR )inlinecontent( = 'SpecialClient' OR )inlinecontent( = 'VerySpecialClient' \))delimiter(")> - ident(has_many) symbol(:clients_sorted_desc)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) string - ident(has_many) symbol(:clients_of_firm)operator(,) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) string - ident(has_many) symbol(:dependent_clients_of_firm)operator(,) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:dependent) operator(=)operator(>) symbol(:destroy) - ident(has_many) symbol(:exclusively_dependent_clients_of_firm)operator(,) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:dependent) operator(=)operator(>) symbol(:delete_all) - ident(has_many) symbol(:limited_clients)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(1) - ident(has_many) symbol(:clients_like_ms)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) string - ident(has_many) symbol(:clients_using_sql)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:finder_sql) operator(=)operator(>) string - ident(has_many) symbol(:clients_using_counter_sql)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:finder_sql) operator(=)operator(>) stringoperator(,) - symbol(:counter_sql) operator(=)operator(>) string - ident(has_many) symbol(:clients_using_zero_counter_sql)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:finder_sql) operator(=)operator(>) stringoperator(,) - symbol(:counter_sql) operator(=)operator(>) string - ident(has_many) symbol(:no_clients_using_counter_sql)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:finder_sql) operator(=)operator(>) stringoperator(,) - symbol(:counter_sql) operator(=)operator(>) string - - ident(has_one) symbol(:account)operator(,) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:dependent) operator(=)operator(>) symbol(:destroy) -reserved(end) - -reserved(class) class(DependentFirm) operator(<) constant(Company) - ident(has_one) symbol(:account)operator(,) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:dependent) operator(=)operator(>) symbol(:nullify) - ident(has_many) symbol(:companies)operator(,) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:dependent) operator(=)operator(>) symbol(:nullify) -reserved(end) - - -reserved(class) class(Client) operator(<) constant(Company) - ident(belongs_to) symbol(:firm)operator(,) symbol(:foreign_key) operator(=)operator(>) string - ident(belongs_to) symbol(:firm_with_basic_id)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:foreign_key) operator(=)operator(>) string - ident(belongs_to) symbol(:firm_with_other_name)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:foreign_key) operator(=)operator(>) string - ident(belongs_to) symbol(:firm_with_condition)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) integer(1)operator(]) - - comment(# Record destruction so we can test whether firm.clients.clear has) - comment(# is calling client.destroy, deleting from the database, or setting) - comment(# foreign keys to NULL.) - reserved(def) pre_constant(self)operator(.)method(destroyed_client_ids) - instance_variable(@destroyed_client_ids) operator(||=) constant(Hash)operator(.)ident(new) operator({) operator(|)ident(h)operator(,)ident(k)operator(|) ident(h)operator([)ident(k)operator(]) operator(=) operator([)operator(]) operator(}) - reserved(end) - - ident(before_destroy) reserved(do) operator(|)ident(client)operator(|) - reserved(if) ident(client)operator(.)ident(firm) - constant(Client)operator(.)ident(destroyed_client_ids)operator([)ident(client)operator(.)ident(firm)operator(.)ident(id)operator(]) operator(<<) ident(client)operator(.)ident(id) - reserved(end) - pre_constant(true) - reserved(end) - - comment(# Used to test that read and question methods are not generated for these attributes) - reserved(def) method(ruby_type) - ident(read_attribute) symbol(:ruby_type) - reserved(end) - - reserved(def) method(rating?) - ident(query_attribute) symbol(:rating) - reserved(end) -reserved(end) - - -reserved(class) class(SpecialClient) operator(<) constant(Client) -reserved(end) - -reserved(class) class(VerySpecialClient) operator(<) constant(SpecialClient) -reserved(end) - -reserved(class) class(Account) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:firm) - - ident(protected) - reserved(def) method(validate) - ident(errors)operator(.)ident(add_on_empty) string - reserved(end) -ident(endmodule) constant(MyApplication) - reserved(module) class(Business) - reserved(class) class(Company) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(attr_protected) symbol(:rating) - reserved(end) - - reserved(class) class(Firm) operator(<) constant(Company) - ident(has_many) symbol(:clients)operator(,) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:dependent) operator(=)operator(>) symbol(:destroy) - ident(has_many) symbol(:clients_sorted_desc)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) string - ident(has_many) symbol(:clients_of_firm)operator(,) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) string - ident(has_many) symbol(:clients_like_ms)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) string - ident(has_many) symbol(:clients_using_sql)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:finder_sql) operator(=)operator(>) string - - ident(has_one) symbol(:account)operator(,) symbol(:dependent) operator(=)operator(>) symbol(:destroy) - reserved(end) - - reserved(class) class(Client) operator(<) constant(Company) - ident(belongs_to) symbol(:firm)operator(,) symbol(:foreign_key) operator(=)operator(>) string - ident(belongs_to) symbol(:firm_with_other_name)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:foreign_key) operator(=)operator(>) string - reserved(end) - - reserved(class) class(Developer) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_and_belongs_to_many) symbol(:projects) - - ident(protected) - reserved(def) method(validate) - ident(errors)operator(.)ident(add_on_boundary_breaking)operator(()stringoperator(,) integer(3)operator(..)integer(20)operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(Project) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_and_belongs_to_many) symbol(:developers) - reserved(end) - - reserved(end) - - reserved(module) class(Billing) - reserved(class) class(Firm) operator(<) constant(ActiveRecord)operator(::)constant(Base) - pre_constant(self)operator(.)ident(table_name) operator(=) string - reserved(end) - - reserved(module) class(Nested) - reserved(class) class(Firm) operator(<) constant(ActiveRecord)operator(::)constant(Base) - pre_constant(self)operator(.)ident(table_name) operator(=) string - reserved(end) - reserved(end) - - reserved(class) class(Account) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:firm)operator(,) symbol(:class_name) operator(=)operator(>) string - ident(belongs_to) symbol(:qualified_billing_firm)operator(,) symbol(:class_name) operator(=)operator(>) string - ident(belongs_to) symbol(:unqualified_billing_firm)operator(,) symbol(:class_name) operator(=)operator(>) string - ident(belongs_to) symbol(:nested_qualified_billing_firm)operator(,) symbol(:class_name) operator(=)operator(>) string - ident(belongs_to) symbol(:nested_unqualified_billing_firm)operator(,) symbol(:class_name) operator(=)operator(>) string - - ident(protected) - reserved(def) method(validate) - ident(errors)operator(.)ident(add_on_empty) string - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(class) class(Computer) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:developer)operator(,) symbol(:foreign_key)operator(=)operator(>)string -reserved(end) -reserved(class) class(Course) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_many) symbol(:entrants) -reserved(end) -reserved(class) class(Customer) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(composed_of) symbol(:address)operator(,) symbol(:mapping) operator(=)operator(>) operator([) stringoperator(,) stringoperator(,) string operator(]) - ident(composed_of) symbol(:balance)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:mapping) operator(=)operator(>) string - ident(composed_of) symbol(:gps_location) -reserved(end) - -reserved(class) class(Address) - ident(attr_reader) symbol(:street)operator(,) symbol(:city)operator(,) symbol(:country) - - reserved(def) method(initialize)operator(()ident(street)operator(,) ident(city)operator(,) ident(country)operator(\)) - instance_variable(@street)operator(,) instance_variable(@city)operator(,) instance_variable(@country) operator(=) ident(street)operator(,) ident(city)operator(,) ident(country) - reserved(end) - - reserved(def) method(close_to?)operator(()ident(other_address)operator(\)) - ident(city) operator(==) ident(other_address)operator(.)ident(city) operator(&&) ident(country) operator(==) ident(other_address)operator(.)ident(country) - reserved(end) - - reserved(def) method(==)operator(()ident(other)operator(\)) - ident(other)operator(.)ident(is_a?)operator(()pre_constant(self)operator(.)ident(class)operator(\)) operator(&&) ident(other)operator(.)ident(street) operator(==) ident(street) operator(&&) ident(other)operator(.)ident(city) operator(==) ident(city) operator(&&) ident(other)operator(.)ident(country) operator(==) ident(country) - reserved(end) -reserved(end) - -reserved(class) class(Money) - ident(attr_reader) symbol(:amount)operator(,) symbol(:currency) - - constant(EXCHANGE_RATES) operator(=) operator({) string operator(=)operator(>) integer(6)operator(,) string operator(=)operator(>) float(0.6) operator(}) - - reserved(def) method(initialize)operator(()ident(amount)operator(,) ident(currency) operator(=) stringoperator(\)) - instance_variable(@amount)operator(,) instance_variable(@currency) operator(=) ident(amount)operator(,) ident(currency) - reserved(end) - - reserved(def) method(exchange_to)operator(()ident(other_currency)operator(\)) - constant(Money)operator(.)ident(new)operator(()operator(()ident(amount) operator(*) constant(EXCHANGE_RATES)operator([)stringcontent(_TO_)inlinedelimiter(")>operator(])operator(\))operator(.)ident(floor)operator(,) ident(other_currency)operator(\)) - reserved(end) -reserved(end) - -reserved(class) class(GpsLocation) - ident(attr_reader) symbol(:gps_location) - - reserved(def) method(initialize)operator(()ident(gps_location)operator(\)) - instance_variable(@gps_location) operator(=) ident(gps_location) - reserved(end) - - reserved(def) method(latitude) - ident(gps_location)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(first) - reserved(end) - - reserved(def) method(longitude) - ident(gps_location)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last) - reserved(end) - - reserved(def) method(==)operator(()ident(other)operator(\)) - pre_constant(self)operator(.)ident(latitude) operator(==) ident(other)operator(.)ident(latitude) operator(&&) pre_constant(self)operator(.)ident(longitude) operator(==) ident(other)operator(.)ident(longitude) - reserved(end) -ident(endActiveRecord)operator(::)constant(Schema)operator(.)ident(define) reserved(do) - - ident(create_table) symbol(:taggings)operator(,) symbol(:force) operator(=)operator(>) pre_constant(true) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:tag_id)operator(,) symbol(:integer) - ident(t)operator(.)ident(column) symbol(:super_tag_id)operator(,) symbol(:integer) - ident(t)operator(.)ident(column) symbol(:taggable_type)operator(,) symbol(:string) - ident(t)operator(.)ident(column) symbol(:taggable_id)operator(,) symbol(:integer) - reserved(end) - - ident(create_table) symbol(:tags)operator(,) symbol(:force) operator(=)operator(>) pre_constant(true) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:name)operator(,) symbol(:string) - ident(t)operator(.)ident(column) symbol(:taggings_count)operator(,) symbol(:integer)operator(,) symbol(:default) operator(=)operator(>) integer(0) - reserved(end) - - ident(create_table) symbol(:categorizations)operator(,) symbol(:force) operator(=)operator(>) pre_constant(true) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:category_id)operator(,) symbol(:integer) - ident(t)operator(.)ident(column) symbol(:post_id)operator(,) symbol(:integer) - ident(t)operator(.)ident(column) symbol(:author_id)operator(,) symbol(:integer) - reserved(end) - - ident(add_column) symbol(:posts)operator(,) symbol(:taggings_count)operator(,) symbol(:integer)operator(,) symbol(:default) operator(=)operator(>) integer(0) - ident(add_column) symbol(:authors)operator(,) symbol(:author_address_id)operator(,) symbol(:integer) - - ident(create_table) symbol(:author_addresses)operator(,) symbol(:force) operator(=)operator(>) pre_constant(true) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:author_address_id)operator(,) symbol(:integer) - reserved(end) - - ident(create_table) symbol(:author_favorites)operator(,) symbol(:force) operator(=)operator(>) pre_constant(true) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:author_id)operator(,) symbol(:integer) - ident(t)operator(.)ident(column) symbol(:favorite_author_id)operator(,) symbol(:integer) - reserved(end) -ident(endclass) constant(Default) operator(<) constant(ActiveRecord)operator(::)constant(Base) -reserved(end) -reserved(module) class(DeveloperProjectsAssociationExtension) - reserved(def) method(find_most_recent) - ident(find)operator(()symbol(:first)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) -reserved(end) - -reserved(class) class(Developer) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_and_belongs_to_many) symbol(:projects) reserved(do) - reserved(def) method(find_most_recent) - ident(find)operator(()symbol(:first)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) - reserved(end) - - ident(has_and_belongs_to_many) symbol(:projects_extended_by_name)operator(,) - symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:join_table) operator(=)operator(>) stringoperator(,) - symbol(:association_foreign_key) operator(=)operator(>) stringoperator(,) - symbol(:extend) operator(=)operator(>) constant(DeveloperProjectsAssociationExtension) - - ident(has_and_belongs_to_many) symbol(:special_projects)operator(,) symbol(:join_table) operator(=)operator(>) stringoperator(,) symbol(:association_foreign_key) operator(=)operator(>) string - - ident(validates_inclusion_of) symbol(:salary)operator(,) symbol(:in) operator(=)operator(>) integer(50000)operator(..)integer(200000) - ident(validates_length_of) symbol(:name)operator(,) symbol(:within) operator(=)operator(>) integer(3)operator(..)integer(20) -reserved(end) - -constant(DeveloperSalary) operator(=) constant(Struct)operator(.)ident(new)operator(()symbol(:amount)operator(\)) -reserved(class) class(DeveloperWithAggregate) operator(<) constant(ActiveRecord)operator(::)constant(Base) - pre_constant(self)operator(.)ident(table_name) operator(=) string - ident(composed_of) symbol(:salary)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:mapping) operator(=)operator(>) operator([)stringoperator(]) -reserved(end) - -reserved(class) class(DeveloperWithBeforeDestroyRaise) operator(<) constant(ActiveRecord)operator(::)constant(Base) - pre_constant(self)operator(.)ident(table_name) operator(=) string - ident(has_and_belongs_to_many) symbol(:projects)operator(,) symbol(:join_table) operator(=)operator(>) stringoperator(,) symbol(:foreign_key) operator(=)operator(>) string - ident(before_destroy) symbol(:raise_if_projects_empty!) - - reserved(def) method(raise_if_projects_empty!) - ident(raise) reserved(if) ident(projects)operator(.)ident(empty?) - reserved(end) -reserved(end) -reserved(class) class(Entrant) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:course) -reserved(end) -reserved(class) class(Joke) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_table_name) string -reserved(end) -reserved(class) class(Joke) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_table_name) string -ident(endclass) constant(Keyboard) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_primary_key) string -reserved(end) -reserved(class) class(LegacyThing) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_locking_column) symbol(:version) -reserved(end) -reserved(class) class(PeopleHaveLastNames) operator(<) constant(ActiveRecord)operator(::)constant(Migration) - reserved(def) pre_constant(self)operator(.)method(up) - ident(add_column) stringoperator(,) stringoperator(,) symbol(:string) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(down) - ident(remove_column) stringoperator(,) string - reserved(end) -ident(endclass) constant(WeNeedReminders) operator(<) constant(ActiveRecord)operator(::)constant(Migration) - reserved(def) pre_constant(self)operator(.)method(up) - ident(create_table)operator(()stringoperator(\)) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:content)operator(,) symbol(:text) - ident(t)operator(.)ident(column) symbol(:remind_at)operator(,) symbol(:datetime) - reserved(end) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(down) - ident(drop_table) string - reserved(end) -ident(endclass) constant(InnocentJointable) operator(<) constant(ActiveRecord)operator(::)constant(Migration) - reserved(def) pre_constant(self)operator(.)method(up) - ident(create_table)operator(()stringoperator(,) symbol(:id) operator(=)operator(>) pre_constant(false)operator(\)) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:reminder_id)operator(,) symbol(:integer) - ident(t)operator(.)ident(column) symbol(:person_id)operator(,) symbol(:integer) - reserved(end) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(down) - ident(drop_table) string - reserved(end) -ident(endclass) constant(PeopleHaveLastNames) operator(<) constant(ActiveRecord)operator(::)constant(Migration) - reserved(def) pre_constant(self)operator(.)method(up) - ident(add_column) stringoperator(,) stringoperator(,) symbol(:string) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(down) - ident(remove_column) stringoperator(,) string - reserved(end) -ident(endclass) constant(WeNeedReminders) operator(<) constant(ActiveRecord)operator(::)constant(Migration) - reserved(def) pre_constant(self)operator(.)method(up) - ident(create_table)operator(()stringoperator(\)) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:content)operator(,) symbol(:text) - ident(t)operator(.)ident(column) symbol(:remind_at)operator(,) symbol(:datetime) - reserved(end) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(down) - ident(drop_table) string - reserved(end) -ident(endclass) constant(Foo) operator(<) constant(ActiveRecord)operator(::)constant(Migration) - reserved(def) pre_constant(self)operator(.)method(up) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(down) - reserved(end) -ident(endclass) constant(InnocentJointable) operator(<) constant(ActiveRecord)operator(::)constant(Migration) - reserved(def) pre_constant(self)operator(.)method(up) - ident(create_table)operator(()stringoperator(,) symbol(:id) operator(=)operator(>) pre_constant(false)operator(\)) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:reminder_id)operator(,) symbol(:integer) - ident(t)operator(.)ident(column) symbol(:person_id)operator(,) symbol(:integer) - reserved(end) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(down) - ident(drop_table) string - reserved(end) -ident(endclass) constant(Mixin) operator(<) constant(ActiveRecord)operator(::)constant(Base) - -reserved(end) - -reserved(class) class(TreeMixin) operator(<) constant(Mixin) - ident(acts_as_tree) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) string -reserved(end) - -reserved(class) class(TreeMixinWithoutOrder) operator(<) constant(Mixin) - ident(acts_as_tree) symbol(:foreign_key) operator(=)operator(>) string -reserved(end) - -reserved(class) class(ListMixin) operator(<) constant(Mixin) - ident(acts_as_list) symbol(:column) operator(=)operator(>) stringoperator(,) symbol(:scope) operator(=)operator(>) symbol(:parent) - - reserved(def) pre_constant(self)operator(.)method(table_name)operator(()operator(\)) string reserved(end) -reserved(end) - -reserved(class) class(ListMixinSub1) operator(<) constant(ListMixin) -reserved(end) - -reserved(class) class(ListMixinSub2) operator(<) constant(ListMixin) -reserved(end) - - -reserved(class) class(ListWithStringScopeMixin) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(acts_as_list) symbol(:column) operator(=)operator(>) stringoperator(,) symbol(:scope) operator(=)operator(>) string - - reserved(def) pre_constant(self)operator(.)method(table_name)operator(()operator(\)) string reserved(end) -reserved(end) - -reserved(class) class(NestedSet) operator(<) constant(Mixin) - ident(acts_as_nested_set) symbol(:scope) operator(=)operator(>) string - - reserved(def) pre_constant(self)operator(.)method(table_name)operator(()operator(\)) string reserved(end) -reserved(end) - -reserved(class) class(NestedSetWithStringScope) operator(<) constant(Mixin) - ident(acts_as_nested_set) symbol(:scope) operator(=)operator(>) string - - reserved(def) pre_constant(self)operator(.)method(table_name)operator(()operator(\)) string reserved(end) -reserved(end) - -reserved(class) class(NestedSetWithSymbolScope) operator(<) constant(Mixin) - ident(acts_as_nested_set) symbol(:scope) operator(=)operator(>) symbol(:root) - - reserved(def) pre_constant(self)operator(.)method(table_name)operator(()operator(\)) string reserved(end) -reserved(end) -reserved(class) class(Movie) operator(<) constant(ActiveRecord)operator(::)constant(Base) - reserved(def) pre_constant(self)operator(.)method(primary_key) - string - reserved(end) -reserved(end) -reserved(class) class(Order) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:billing)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:foreign_key) operator(=)operator(>) string - ident(belongs_to) symbol(:shipping)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:foreign_key) operator(=)operator(>) string -reserved(end) -reserved(class) class(Person) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_many) symbol(:readers) - ident(has_many) symbol(:posts)operator(,) symbol(:through) operator(=)operator(>) symbol(:readers) -reserved(end) -reserved(class) class(Post) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:author) reserved(do) - reserved(def) method(greeting) - string - reserved(end) - reserved(end) - - ident(belongs_to) symbol(:author_with_posts)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:include) operator(=)operator(>) symbol(:posts) - - ident(has_many) symbol(:comments)operator(,) symbol(:order) operator(=)operator(>) string reserved(do) - reserved(def) method(find_most_recent) - ident(find)operator(()symbol(:first)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) - reserved(end) - - ident(has_one) symbol(:very_special_comment) - ident(has_one) symbol(:very_special_comment_with_post)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:include) operator(=)operator(>) symbol(:post) - ident(has_many) symbol(:special_comments) - - ident(has_and_belongs_to_many) symbol(:categories) - ident(has_and_belongs_to_many) symbol(:special_categories)operator(,) symbol(:join_table) operator(=)operator(>) stringoperator(,) symbol(:association_foreign_key) operator(=)operator(>) string - - ident(has_many) symbol(:taggings)operator(,) symbol(:as) operator(=)operator(>) symbol(:taggable) - ident(has_many) symbol(:tags)operator(,) symbol(:through) operator(=)operator(>) symbol(:taggings)operator(,) symbol(:include) operator(=)operator(>) symbol(:tagging) reserved(do) - reserved(def) method(add_joins_and_select) - ident(find) symbol(:all)operator(,) symbol(:select) operator(=)operator(>) stringoperator(,) symbol(:include) operator(=)operator(>) pre_constant(false)operator(,) - symbol(:joins) operator(=)operator(>) string - reserved(end) - reserved(end) - - ident(has_many) symbol(:funky_tags)operator(,) symbol(:through) operator(=)operator(>) symbol(:taggings)operator(,) symbol(:source) operator(=)operator(>) symbol(:tag) - ident(has_many) symbol(:super_tags)operator(,) symbol(:through) operator(=)operator(>) symbol(:taggings) - ident(has_one) symbol(:tagging)operator(,) symbol(:as) operator(=)operator(>) symbol(:taggable) - - ident(has_many) symbol(:invalid_taggings)operator(,) symbol(:as) operator(=)operator(>) symbol(:taggable)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:conditions) operator(=)operator(>) string - ident(has_many) symbol(:invalid_tags)operator(,) symbol(:through) operator(=)operator(>) symbol(:invalid_taggings)operator(,) symbol(:source) operator(=)operator(>) symbol(:tag) - - ident(has_many) symbol(:categorizations)operator(,) symbol(:foreign_key) operator(=)operator(>) symbol(:category_id) - ident(has_many) symbol(:authors)operator(,) symbol(:through) operator(=)operator(>) symbol(:categorizations) - - ident(has_many) symbol(:readers) - ident(has_many) symbol(:people)operator(,) symbol(:through) operator(=)operator(>) symbol(:readers) - - reserved(def) pre_constant(self)operator(.)method(what_are_you) - string - reserved(end) -reserved(end) - -reserved(class) class(SpecialPost) operator(<) constant(Post)operator(;) reserved(end)operator(;) - -reserved(class) class(StiPost) operator(<) constant(Post) - pre_constant(self)operator(.)ident(abstract_class) operator(=) pre_constant(true) - ident(has_one) symbol(:special_comment)operator(,) symbol(:class_name) operator(=)operator(>) string -reserved(end) - -reserved(class) class(SubStiPost) operator(<) constant(StiPost) -reserved(end) -reserved(class) class(Project) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_and_belongs_to_many) symbol(:developers)operator(,) symbol(:uniq) operator(=)operator(>) pre_constant(true) - ident(has_and_belongs_to_many) symbol(:limited_developers)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(1) - ident(has_and_belongs_to_many) symbol(:developers_named_david)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:uniq) operator(=)operator(>) pre_constant(true) - ident(has_and_belongs_to_many) symbol(:salaried_developers)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:conditions) operator(=)operator(>) string 0)delimiter(")> - ident(has_and_belongs_to_many) symbol(:developers_with_finder_sql)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:finder_sql) operator(=)operator(>) string - ident(has_and_belongs_to_many) symbol(:developers_by_sql)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:delete_sql) operator(=)operator(>) string - ident(has_and_belongs_to_many) symbol(:developers_with_callbacks)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:before_add) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(o)operator(,) ident(r)operator(|) ident(o)operator(.)ident(developers_log) operator(<<) stringdelimiter(")>operator(})operator(,) - symbol(:after_add) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(o)operator(,) ident(r)operator(|) ident(o)operator(.)ident(developers_log) operator(<<) stringdelimiter(")>operator(})operator(,) - symbol(:before_remove) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(o)operator(,) ident(r)operator(|) ident(o)operator(.)ident(developers_log) operator(<<) stringdelimiter(")>operator(})operator(,) - symbol(:after_remove) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({)operator(|)ident(o)operator(,) ident(r)operator(|) ident(o)operator(.)ident(developers_log) operator(<<) stringdelimiter(")>operator(}) - - ident(attr_accessor) symbol(:developers_log) - - reserved(def) method(after_initialize) - instance_variable(@developers_log) operator(=) operator([)operator(]) - reserved(end) - -reserved(end) - -reserved(class) class(SpecialProject) operator(<) constant(Project) - reserved(def) method(hello_world) - string - reserved(end) -reserved(end) -reserved(class) class(Reader) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:post) - ident(belongs_to) symbol(:person) -reserved(end) -ident(require) string - -reserved(class) class(Reply) operator(<) constant(Topic) - ident(belongs_to) symbol(:topic)operator(,) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:counter_cache) operator(=)operator(>) pre_constant(true) - ident(has_many) symbol(:replies)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:dependent) operator(=)operator(>) symbol(:destroy)operator(,) symbol(:foreign_key) operator(=)operator(>) string - - ident(validate) symbol(:errors_on_empty_content) - ident(validate_on_create) symbol(:title_is_wrong_create) - - ident(attr_accessible) symbol(:title)operator(,) symbol(:author_name)operator(,) symbol(:author_email_address)operator(,) symbol(:written_on)operator(,) symbol(:content)operator(,) symbol(:last_read) - - reserved(def) method(validate) - ident(errors)operator(.)ident(add)operator(()stringoperator(,) stringoperator(\)) reserved(unless) ident(attribute_present?) string - reserved(end) - - reserved(def) method(errors_on_empty_content) - ident(errors)operator(.)ident(add)operator(()stringoperator(,) stringoperator(\)) reserved(unless) ident(attribute_present?) string - reserved(end) - - reserved(def) method(validate_on_create) - reserved(if) ident(attribute_present?)operator(()stringoperator(\)) operator(&&) ident(attribute_present?)operator(()stringoperator(\)) operator(&&) ident(content) operator(==) string - ident(errors)operator(.)ident(add)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(title_is_wrong_create) - ident(errors)operator(.)ident(add)operator(()stringoperator(,) stringoperator(\)) reserved(if) ident(attribute_present?)operator(()stringoperator(\)) operator(&&) ident(title) operator(==) string - reserved(end) - - reserved(def) method(validate_on_update) - ident(errors)operator(.)ident(add)operator(()stringoperator(,) stringoperator(\)) reserved(if) ident(attribute_present?)operator(()stringoperator(\)) operator(&&) ident(title) operator(==) string - reserved(end) -reserved(end) - -reserved(class) class(SillyReply) operator(<) constant(Reply) - ident(belongs_to) symbol(:reply)operator(,) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:counter_cache) operator(=)operator(>) symbol(:replies_count) -reserved(end) -comment(# used for OracleSynonymTest, see test/synonym_test_oci.rb) -comment(#) -reserved(class) class(Subject) operator(<) constant(ActiveRecord)operator(::)constant(Base) -reserved(end) -reserved(class) class(Subscriber) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(set_primary_key) string -reserved(end) - -reserved(class) class(SpecialSubscriber) operator(<) constant(Subscriber) -reserved(end) -reserved(class) class(Tag) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_many) symbol(:taggings) - ident(has_many) symbol(:taggables)operator(,) symbol(:through) operator(=)operator(>) symbol(:taggings) - ident(has_one) symbol(:tagging) -ident(endclass) constant(Tagging) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(belongs_to) symbol(:tag)operator(,) symbol(:include) operator(=)operator(>) symbol(:tagging) - ident(belongs_to) symbol(:super_tag)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:foreign_key) operator(=)operator(>) string - ident(belongs_to) symbol(:invalid_tag)operator(,) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:foreign_key) operator(=)operator(>) string - ident(belongs_to) symbol(:taggable)operator(,) symbol(:polymorphic) operator(=)operator(>) pre_constant(true)operator(,) symbol(:counter_cache) operator(=)operator(>) pre_constant(true) -ident(endclass) constant(Task) operator(<) constant(ActiveRecord)operator(::)constant(Base) - -reserved(end) -reserved(class) class(Topic) operator(<) constant(ActiveRecord)operator(::)constant(Base) - ident(has_many) symbol(:replies)operator(,) symbol(:dependent) operator(=)operator(>) symbol(:destroy)operator(,) symbol(:foreign_key) operator(=)operator(>) string - ident(serialize) symbol(:content) - - ident(before_create) symbol(:default_written_on) - ident(before_destroy) symbol(:destroy_children) - - reserved(def) method(parent) - constant(Topic)operator(.)ident(find)operator(()ident(parent_id)operator(\)) - reserved(end) - - ident(protected) - reserved(def) method(default_written_on) - pre_constant(self)operator(.)ident(written_on) operator(=) constant(Time)operator(.)ident(now) reserved(unless) ident(attribute_present?)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(destroy_children) - pre_constant(self)operator(.)ident(class)operator(.)ident(delete_all) stringdelimiter(")> - reserved(end) -ident(endrequire) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(FixturesTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_instantiated_fixtures) operator(=) pre_constant(true) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(false) - - ident(fixtures) symbol(:topics)operator(,) symbol(:developers)operator(,) symbol(:accounts)operator(,) symbol(:tasks)operator(,) symbol(:categories)operator(,) symbol(:funny_jokes) - - constant(FIXTURES) operator(=) string - constant(MATCH_ATTRIBUTE_NAME) operator(=) regexp - - reserved(def) method(test_clean_fixtures) - constant(FIXTURES)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(|) - ident(fixtures) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(fixtures) operator(=) ident(create_fixtures)operator(()ident(name)operator(\)) operator(}) - ident(assert_kind_of)operator(()constant(Fixtures)operator(,) ident(fixtures)operator(\)) - ident(fixtures)operator(.)ident(each) operator({) operator(|)ident(name)operator(,) ident(fixture)operator(|) - ident(fixture)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) - ident(assert_match)operator(()constant(MATCH_ATTRIBUTE_NAME)operator(,) ident(key)operator(\)) - operator(}) - operator(}) - reserved(end) - reserved(end) - - reserved(def) method(test_multiple_clean_fixtures) - ident(fixtures_array) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(fixtures_array) operator(=) ident(create_fixtures)operator(()operator(*)constant(FIXTURES)operator(\)) operator(}) - ident(assert_kind_of)operator(()constant(Array)operator(,) ident(fixtures_array)operator(\)) - ident(fixtures_array)operator(.)ident(each) operator({) operator(|)ident(fixtures)operator(|) ident(assert_kind_of)operator(()constant(Fixtures)operator(,) ident(fixtures)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_attributes) - ident(topics) operator(=) ident(create_fixtures)operator(()stringoperator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(topics)operator([)stringoperator(])operator([)stringoperator(])operator(\)) - ident(assert_nil)operator(()ident(topics)operator([)stringoperator(])operator([)stringoperator(])operator(\)) - reserved(end) - - reserved(def) method(test_inserts) - ident(topics) operator(=) ident(create_fixtures)operator(()stringoperator(\)) - ident(firstRow) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(select_one)operator(()stringoperator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(firstRow)operator([)stringoperator(])operator(\)) - - ident(secondRow) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(select_one)operator(()stringoperator(\)) - ident(assert_nil)operator(()ident(secondRow)operator([)stringoperator(])operator(\)) - reserved(end) - - reserved(if) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(supports_migrations?) - reserved(def) method(test_inserts_with_pre_and_suffix) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(create_table) symbol(:prefix_topics_suffix) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:title)operator(,) symbol(:string) - ident(t)operator(.)ident(column) symbol(:author_name)operator(,) symbol(:string) - ident(t)operator(.)ident(column) symbol(:author_email_address)operator(,) symbol(:string) - ident(t)operator(.)ident(column) symbol(:written_on)operator(,) symbol(:datetime) - ident(t)operator(.)ident(column) symbol(:bonus_time)operator(,) symbol(:time) - ident(t)operator(.)ident(column) symbol(:last_read)operator(,) symbol(:date) - ident(t)operator(.)ident(column) symbol(:content)operator(,) symbol(:string) - ident(t)operator(.)ident(column) symbol(:approved)operator(,) symbol(:boolean)operator(,) symbol(:default) operator(=)operator(>) pre_constant(true) - ident(t)operator(.)ident(column) symbol(:replies_count)operator(,) symbol(:integer)operator(,) symbol(:default) operator(=)operator(>) integer(0) - ident(t)operator(.)ident(column) symbol(:parent_id)operator(,) symbol(:integer) - ident(t)operator(.)ident(column) symbol(:type)operator(,) symbol(:string)operator(,) symbol(:limit) operator(=)operator(>) integer(50) - reserved(end) - - comment(# Store existing prefix/suffix) - ident(old_prefix) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) - ident(old_suffix) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) - - comment(# Set a prefix/suffix we can test against) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - - ident(topics) operator(=) ident(create_fixtures)operator(()stringoperator(\)) - - ident(firstRow) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(select_one)operator(()stringoperator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(firstRow)operator([)stringoperator(])operator(\)) - - ident(secondRow) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(select_one)operator(()stringoperator(\)) - ident(assert_nil)operator(()ident(secondRow)operator([)stringoperator(])operator(\)) - reserved(ensure) - comment(# Restore prefix/suffix to its previous values) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) ident(old_prefix) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) ident(old_suffix) - - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(drop_table) symbol(:prefix_topics_suffix) reserved(rescue) pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(test_insert_with_datetime) - ident(topics) operator(=) ident(create_fixtures)operator(()stringoperator(\)) - ident(first) operator(=) constant(Task)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) ident(first) - reserved(end) - - - reserved(def) method(test_bad_format) - ident(path) operator(=) constant(File)operator(.)ident(join)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(,) stringoperator(,) stringoperator(\)) - constant(Dir)operator(.)ident(entries)operator(()ident(path)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - reserved(next) reserved(unless) constant(File)operator(.)ident(file?)operator(()ident(file)operator(\)) reserved(and) ident(file) operator(!)operator(~) constant(Fixtures)operator(::)constant(DEFAULT_FILTER_RE) - ident(assert_raise)operator(()constant(Fixture)operator(::)constant(FormatError)operator(\)) operator({) - constant(Fixture)operator(.)ident(new)operator(()ident(bad_fixtures_path)operator(,) ident(file)operator(\)) - operator(}) - reserved(end) - reserved(end) - - reserved(def) method(test_deprecated_yaml_extension) - ident(assert_raise)operator(()constant(Fixture)operator(::)constant(FormatError)operator(\)) operator({) - constant(Fixtures)operator(.)ident(new)operator(()pre_constant(nil)operator(,) stringoperator(,) stringoperator(,) constant(File)operator(.)ident(join)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(,) stringoperator(\))operator(\)) - operator(}) - reserved(end) - - reserved(def) method(test_logger_level_invariant) - ident(level) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger)operator(.)ident(level) - ident(create_fixtures)operator(()stringoperator(\)) - ident(assert_equal) ident(level)operator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger)operator(.)ident(level) - reserved(end) - - reserved(def) method(test_instantiation) - ident(topics) operator(=) ident(create_fixtures)operator(()stringoperator(\)) - ident(assert_kind_of) constant(Topic)operator(,) ident(topics)operator([)stringoperator(])operator(.)ident(find) - reserved(end) - - reserved(def) method(test_complete_instantiation) - ident(assert_equal) integer(2)operator(,) instance_variable(@topics)operator(.)ident(size) - ident(assert_equal) stringoperator(,) instance_variable(@first)operator(.)ident(title) - reserved(end) - - reserved(def) method(test_fixtures_from_root_yml_with_instantiation) - comment(# assert_equal 2, @accounts.size) - ident(assert_equal) integer(50)operator(,) instance_variable(@unknown)operator(.)ident(credit_limit) - reserved(end) - - reserved(def) method(test_erb_in_fixtures) - ident(assert_equal) integer(11)operator(,) instance_variable(@developers)operator(.)ident(size) - ident(assert_equal) stringoperator(,) instance_variable(@dev_5)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_empty_yaml_fixture) - ident(assert_not_nil) constant(Fixtures)operator(.)ident(new)operator(() constant(Account)operator(.)ident(connection)operator(,) stringoperator(,) stringoperator(,) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - reserved(end) - - reserved(def) method(test_empty_yaml_fixture_with_a_comment_in_it) - ident(assert_not_nil) constant(Fixtures)operator(.)ident(new)operator(() constant(Account)operator(.)ident(connection)operator(,) stringoperator(,) stringoperator(,) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - reserved(end) - - reserved(def) method(test_dirty_dirty_yaml_file) - ident(assert_raises)operator(()constant(Fixture)operator(::)constant(FormatError)operator(\)) reserved(do) - constant(Fixtures)operator(.)ident(new)operator(() constant(Account)operator(.)ident(connection)operator(,) stringoperator(,) stringoperator(,) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_empty_csv_fixtures) - ident(assert_not_nil) constant(Fixtures)operator(.)ident(new)operator(() constant(Account)operator(.)ident(connection)operator(,) stringoperator(,) stringoperator(,) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - reserved(end) - - reserved(def) method(test_omap_fixtures) - ident(assert_nothing_raised) reserved(do) - ident(fixtures) operator(=) constant(Fixtures)operator(.)ident(new)operator(()constant(Account)operator(.)ident(connection)operator(,) stringoperator(,) stringoperator(,) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - - ident(i) operator(=) integer(0) - ident(fixtures)operator(.)ident(each) reserved(do) operator(|)ident(name)operator(,) ident(fixture)operator(|) - ident(assert_equal) stringdelimiter(")>operator(,) ident(name) - ident(assert_equal) stringdelimiter(")>operator(,) ident(fixture)operator([)stringoperator(]) - ident(i) operator(+=) integer(1) - reserved(end) - reserved(end) - reserved(end) - - - reserved(def) method(test_yml_file_in_subdirectory) - ident(assert_equal)operator(()ident(categories)operator(()symbol(:sub_special_1)operator(\))operator(.)ident(name)operator(,) stringoperator(\)) - ident(assert_equal)operator(()ident(categories)operator(()symbol(:sub_special_1)operator(\))operator(.)ident(class)operator(,) constant(SpecialCategory)operator(\)) - reserved(end) - - reserved(def) method(test_subsubdir_file_with_arbitrary_name) - ident(assert_equal)operator(()ident(categories)operator(()symbol(:sub_special_3)operator(\))operator(.)ident(name)operator(,) stringoperator(\)) - ident(assert_equal)operator(()ident(categories)operator(()symbol(:sub_special_3)operator(\))operator(.)ident(class)operator(,) constant(SpecialCategory)operator(\)) - reserved(end) - - -reserved(end) - -reserved(if) constant(Account)operator(.)ident(connection)operator(.)ident(respond_to?)operator(()symbol(:reset_pk_sequence!)operator(\)) - reserved(class) class(FixturesResetPkSequenceTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:accounts) - ident(fixtures) symbol(:companies) - - reserved(def) method(setup) - instance_variable(@instances) operator(=) operator([)constant(Account)operator(.)ident(new)operator(()symbol(:credit_limit) operator(=)operator(>) integer(50)operator(\))operator(,) constant(Company)operator(.)ident(new)operator(()symbol(:name) operator(=)operator(>) stringoperator(\))operator(]) - reserved(end) - - reserved(def) method(test_resets_to_min_pk_with_specified_pk_and_sequence) - instance_variable(@instances)operator(.)ident(each) reserved(do) operator(|)ident(instance)operator(|) - ident(model) operator(=) ident(instance)operator(.)ident(class) - ident(model)operator(.)ident(delete_all) - ident(model)operator(.)ident(connection)operator(.)ident(reset_pk_sequence!)operator(()ident(model)operator(.)ident(table_name)operator(,) ident(model)operator(.)ident(primary_key)operator(,) ident(model)operator(.)ident(sequence_name)operator(\)) - - ident(instance)operator(.)ident(save!) - ident(assert_equal) integer(1)operator(,) ident(instance)operator(.)ident(id)operator(,) stringcontent( failed.)delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(test_resets_to_min_pk_with_default_pk_and_sequence) - instance_variable(@instances)operator(.)ident(each) reserved(do) operator(|)ident(instance)operator(|) - ident(model) operator(=) ident(instance)operator(.)ident(class) - ident(model)operator(.)ident(delete_all) - ident(model)operator(.)ident(connection)operator(.)ident(reset_pk_sequence!)operator(()ident(model)operator(.)ident(table_name)operator(\)) - - ident(instance)operator(.)ident(save!) - ident(assert_equal) integer(1)operator(,) ident(instance)operator(.)ident(id)operator(,) stringcontent( failed.)delimiter(")> - reserved(end) - reserved(end) - - reserved(def) method(test_create_fixtures_resets_sequences) - instance_variable(@instances)operator(.)ident(each) reserved(do) operator(|)ident(instance)operator(|) - ident(max_id) operator(=) ident(create_fixtures)operator(()ident(instance)operator(.)ident(class)operator(.)ident(table_name)operator(\))operator(.)ident(inject)operator(()integer(0)operator(\)) reserved(do) operator(|)ident(max_id)operator(,) operator(()ident(name)operator(,) ident(fixture)operator(\))operator(|) - ident(fixture_id) operator(=) ident(fixture)operator([)stringoperator(])operator(.)ident(to_i) - ident(fixture_id) operator(>) ident(max_id) operator(?) ident(fixture_id) operator(:) ident(max_id) - reserved(end) - - comment(# Clone the last fixture to check that it gets the next greatest id.) - ident(instance)operator(.)ident(save!) - ident(assert_equal) ident(max_id) operator(+) integer(1)operator(,) ident(instance)operator(.)ident(id)operator(,) stringcontent( failed.)delimiter(")> - reserved(end) - reserved(end) - reserved(end) -reserved(end) - - -reserved(class) class(FixturesWithoutInstantiationTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_instantiated_fixtures) operator(=) pre_constant(false) - ident(fixtures) symbol(:topics)operator(,) symbol(:developers)operator(,) symbol(:accounts) - - reserved(def) method(test_without_complete_instantiation) - ident(assert_nil) instance_variable(@first) - ident(assert_nil) instance_variable(@topics) - ident(assert_nil) instance_variable(@developers) - ident(assert_nil) instance_variable(@accounts) - reserved(end) - - reserved(def) method(test_fixtures_from_root_yml_without_instantiation) - ident(assert_nil) instance_variable(@unknown) - reserved(end) - - reserved(def) method(test_accessor_methods) - ident(assert_equal) stringoperator(,) ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(title) - ident(assert_equal) stringoperator(,) ident(developers)operator(()symbol(:jamis)operator(\))operator(.)ident(name) - ident(assert_equal) integer(50)operator(,) ident(accounts)operator(()symbol(:signals37)operator(\))operator(.)ident(credit_limit) - reserved(end) -reserved(end) - - -reserved(class) class(FixturesWithoutInstanceInstantiationTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_instantiated_fixtures) operator(=) pre_constant(true) - pre_constant(self)operator(.)ident(use_instantiated_fixtures) operator(=) symbol(:no_instances) - - ident(fixtures) symbol(:topics)operator(,) symbol(:developers)operator(,) symbol(:accounts) - - reserved(def) method(test_without_instance_instantiation) - ident(assert_nil) instance_variable(@first) - ident(assert_not_nil) instance_variable(@topics) - ident(assert_not_nil) instance_variable(@developers) - ident(assert_not_nil) instance_variable(@accounts) - reserved(end) -reserved(end) - - -reserved(class) class(TransactionalFixturesTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_instantiated_fixtures) operator(=) pre_constant(true) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(true) - - ident(fixtures) symbol(:topics) - - reserved(def) method(test_destroy) - ident(assert_not_nil) instance_variable(@first) - instance_variable(@first)operator(.)ident(destroy) - reserved(end) - - reserved(def) method(test_destroy_just_kidding) - ident(assert_not_nil) instance_variable(@first) - reserved(end) -reserved(end) - - -reserved(class) class(MultipleFixturesTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:topics) - ident(fixtures) symbol(:developers)operator(,) symbol(:accounts) - - reserved(def) method(test_fixture_table_names) - ident(assert_equal) stringoperator(,) ident(fixture_table_names) - reserved(end) -reserved(end) - - -reserved(class) class(OverlappingFixturesTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:topics)operator(,) symbol(:developers) - ident(fixtures) symbol(:developers)operator(,) symbol(:accounts) - - reserved(def) method(test_fixture_table_names) - ident(assert_equal) stringoperator(,) ident(fixture_table_names) - reserved(end) -reserved(end) - - -reserved(class) class(ForeignKeyFixturesTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:fk_test_has_pk)operator(,) symbol(:fk_test_has_fk) - - comment(# if foreign keys are implemented and fixtures) - comment(# are not deleted in reverse order then this test) - comment(# case will raise StatementInvalid) - - reserved(def) method(test_number1) - ident(assert) pre_constant(true) - reserved(end) - - reserved(def) method(test_number2) - ident(assert) pre_constant(true) - reserved(end) -reserved(end) - -reserved(class) class(SetTableNameFixturesTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(set_fixture_class) symbol(:funny_jokes) operator(=)operator(>) string - ident(fixtures) symbol(:funny_jokes) - - reserved(def) method(test_table_method) - ident(assert_kind_of) constant(Joke)operator(,) ident(funny_jokes)operator(()symbol(:a_joke)operator(\)) - reserved(end) -reserved(end) - -reserved(class) class(InvalidTableNameFixturesTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:funny_jokes) - - reserved(def) method(test_raises_error) - ident(assert_raises) constant(FixtureClassNotFound) reserved(do) - ident(funny_jokes)operator(()symbol(:a_joke)operator(\)) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(InheritanceTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:companies)operator(,) symbol(:projects)operator(,) symbol(:subscribers) - - reserved(def) method(test_a_bad_type_column) - comment(#SQLServer need to turn Identity Insert On before manually inserting into the Identity column) - reserved(if) ident(current_adapter?)operator(()symbol(:SQLServerAdapter)operator(\)) operator(||) ident(current_adapter?)operator(()symbol(:SybaseAdapter)operator(\)) - constant(Company)operator(.)ident(connection)operator(.)ident(execute) string - reserved(end) - constant(Company)operator(.)ident(connection)operator(.)ident(insert) stringcontent(, name\) VALUES(100, 'bad_class!', 'Not happening'\))delimiter(")> - - comment(#We then need to turn it back Off before continuing.) - reserved(if) ident(current_adapter?)operator(()symbol(:SQLServerAdapter)operator(\)) operator(||) ident(current_adapter?)operator(()symbol(:SybaseAdapter)operator(\)) - constant(Company)operator(.)ident(connection)operator(.)ident(execute) string - reserved(end) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(SubclassNotFound)operator(\)) operator({) constant(Company)operator(.)ident(find)operator(()integer(100)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_inheritance_find) - ident(assert) constant(Company)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(kind_of?)operator(()constant(Firm)operator(\))operator(,) string - ident(assert) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(kind_of?)operator(()constant(Firm)operator(\))operator(,) string - ident(assert) constant(Company)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(kind_of?)operator(()constant(Client)operator(\))operator(,) string - ident(assert) constant(Client)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(kind_of?)operator(()constant(Client)operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_alt_inheritance_find) - ident(switch_to_alt_inheritance_column) - ident(test_inheritance_find) - reserved(end) - - reserved(def) method(test_inheritance_find_all) - ident(companies) operator(=) constant(Company)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert) ident(companies)operator([)integer(0)operator(])operator(.)ident(kind_of?)operator(()constant(Firm)operator(\))operator(,) string - ident(assert) ident(companies)operator([)integer(1)operator(])operator(.)ident(kind_of?)operator(()constant(Client)operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_alt_inheritance_find_all) - ident(switch_to_alt_inheritance_column) - ident(test_inheritance_find_all) - reserved(end) - - reserved(def) method(test_inheritance_save) - ident(firm) operator(=) constant(Firm)operator(.)ident(new) - ident(firm)operator(.)ident(name) operator(=) string - ident(firm)operator(.)ident(save) - - ident(next_angle) operator(=) constant(Company)operator(.)ident(find)operator(()ident(firm)operator(.)ident(id)operator(\)) - ident(assert) ident(next_angle)operator(.)ident(kind_of?)operator(()constant(Firm)operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_alt_inheritance_save) - ident(switch_to_alt_inheritance_column) - ident(test_inheritance_save) - reserved(end) - - reserved(def) method(test_inheritance_condition) - ident(assert_equal) integer(8)operator(,) constant(Company)operator(.)ident(count) - ident(assert_equal) integer(2)operator(,) constant(Firm)operator(.)ident(count) - ident(assert_equal) integer(3)operator(,) constant(Client)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_alt_inheritance_condition) - ident(switch_to_alt_inheritance_column) - ident(test_inheritance_condition) - reserved(end) - - reserved(def) method(test_finding_incorrect_type_data) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) constant(Firm)operator(.)ident(find)operator(()integer(2)operator(\)) operator(}) - ident(assert_nothing_raised) operator({) constant(Firm)operator(.)ident(find)operator(()integer(1)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_alt_finding_incorrect_type_data) - ident(switch_to_alt_inheritance_column) - ident(test_finding_incorrect_type_data) - reserved(end) - - reserved(def) method(test_update_all_within_inheritance) - constant(Client)operator(.)ident(update_all) string - ident(assert_equal) stringoperator(,) constant(Client)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(first)operator(.)ident(name) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(first)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_alt_update_all_within_inheritance) - ident(switch_to_alt_inheritance_column) - ident(test_update_all_within_inheritance) - reserved(end) - - reserved(def) method(test_destroy_all_within_inheritance) - constant(Client)operator(.)ident(destroy_all) - ident(assert_equal) integer(0)operator(,) constant(Client)operator(.)ident(count) - ident(assert_equal) integer(2)operator(,) constant(Firm)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_alt_destroy_all_within_inheritance) - ident(switch_to_alt_inheritance_column) - ident(test_destroy_all_within_inheritance) - reserved(end) - - reserved(def) method(test_find_first_within_inheritance) - ident(assert_kind_of) constant(Firm)operator(,) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_kind_of) constant(Firm)operator(,) constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_nil) constant(Client)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_alt_find_first_within_inheritance) - ident(switch_to_alt_inheritance_column) - ident(test_find_first_within_inheritance) - reserved(end) - - reserved(def) method(test_complex_inheritance) - ident(very_special_client) operator(=) constant(VerySpecialClient)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(very_special_client)operator(,) constant(VerySpecialClient)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(very_special_client)operator(,) constant(SpecialClient)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(very_special_client)operator(,) constant(Company)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) ident(very_special_client)operator(,) constant(Client)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - ident(assert_equal) integer(1)operator(,) constant(Client)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\))operator(.)ident(size) - ident(assert_equal) ident(very_special_client)operator(,) constant(Client)operator(.)ident(find)operator(()ident(very_special_client)operator(.)ident(id)operator(\)) - reserved(end) - - reserved(def) method(test_alt_complex_inheritance) - ident(switch_to_alt_inheritance_column) - ident(test_complex_inheritance) - reserved(end) - - reserved(def) method(test_inheritance_without_mapping) - ident(assert_kind_of) constant(SpecialSubscriber)operator(,) constant(SpecialSubscriber)operator(.)ident(find)operator(()stringoperator(\)) - ident(assert_nothing_raised) operator({) ident(s) operator(=) constant(SpecialSubscriber)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\))operator(;) ident(s)operator(.)ident(id) operator(=) stringoperator(;) ident(s)operator(.)ident(save) operator(}) - reserved(end) - - ident(private) - reserved(def) method(switch_to_alt_inheritance_column) - comment(# we don't want misleading test results, so get rid of the values in the type column) - constant(Company)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(c)operator(|) - ident(c)operator([)stringoperator(]) operator(=) pre_constant(nil) - ident(c)operator(.)ident(save) - reserved(end) - - reserved(def) constant(Company)operator(.)method(inheritance_column)operator(()operator(\)) string reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(Topic)operator(;) reserved(def) method(after_find)operator(()operator(\)) reserved(end) reserved(end) -reserved(class) class(Developer)operator(;) reserved(def) method(after_find)operator(()operator(\)) reserved(end) reserved(end) -reserved(class) class(SpecialDeveloper) operator(<) constant(Developer)operator(;) reserved(end) - -reserved(class) class(TopicManualObserver) - ident(include) constant(Singleton) - - ident(attr_reader) symbol(:action)operator(,) symbol(:object)operator(,) symbol(:callbacks) - - reserved(def) method(initialize) - constant(Topic)operator(.)ident(add_observer)operator(()pre_constant(self)operator(\)) - instance_variable(@callbacks) operator(=) operator([)operator(]) - reserved(end) - - reserved(def) method(update)operator(()ident(callback_method)operator(,) ident(object)operator(\)) - instance_variable(@callbacks) operator(<<) operator({) string operator(=)operator(>) ident(callback_method)operator(,) string operator(=)operator(>) ident(object) operator(}) - reserved(end) - - reserved(def) method(has_been_notified?) - operator(!)instance_variable(@callbacks)operator(.)ident(empty?) - reserved(end) -reserved(end) - -reserved(class) class(TopicaObserver) operator(<) constant(ActiveRecord)operator(::)constant(Observer) - reserved(def) pre_constant(self)operator(.)method(observed_class)operator(()operator(\)) constant(Topic) reserved(end) - - ident(attr_reader) symbol(:topic) - - reserved(def) method(after_find)operator(()ident(topic)operator(\)) - instance_variable(@topic) operator(=) ident(topic) - reserved(end) -reserved(end) - -reserved(class) class(TopicObserver) operator(<) constant(ActiveRecord)operator(::)constant(Observer) - ident(attr_reader) symbol(:topic) - - reserved(def) method(after_find)operator(()ident(topic)operator(\)) - instance_variable(@topic) operator(=) ident(topic) - reserved(end) -reserved(end) - -reserved(class) class(MultiObserver) operator(<) constant(ActiveRecord)operator(::)constant(Observer) - ident(attr_reader) symbol(:record) - - reserved(def) pre_constant(self)operator(.)method(observed_class)operator(()operator(\)) operator([) constant(Topic)operator(,) constant(Developer) operator(]) reserved(end) - - reserved(def) method(after_find)operator(()ident(record)operator(\)) - instance_variable(@record) operator(=) ident(record) - reserved(end) - -reserved(end) - -reserved(class) class(LifecycleTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:topics)operator(,) symbol(:developers) - - reserved(def) method(test_before_destroy) - ident(assert_equal) integer(2)operator(,) constant(Topic)operator(.)ident(count) - constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(destroy) - ident(assert_equal) integer(0)operator(,) constant(Topic)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_after_save) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(observers) operator(=) symbol(:topic_manual_observer) - - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(topic)operator(.)ident(title) operator(=) string - ident(topic)operator(.)ident(save) - - ident(assert) constant(TopicManualObserver)operator(.)ident(instance)operator(.)ident(has_been_notified?) - ident(assert_equal) symbol(:after_save)operator(,) constant(TopicManualObserver)operator(.)ident(instance)operator(.)ident(callbacks)operator(.)ident(last)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_observer_update_on_save) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(observers) operator(=) constant(TopicManualObserver) - - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) constant(TopicManualObserver)operator(.)ident(instance)operator(.)ident(has_been_notified?) - ident(assert_equal) symbol(:after_find)operator(,) constant(TopicManualObserver)operator(.)ident(instance)operator(.)ident(callbacks)operator(.)ident(first)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_auto_observer) - ident(topic_observer) operator(=) constant(TopicaObserver)operator(.)ident(instance) - - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) ident(topic_observer)operator(.)ident(topic)operator(.)ident(title)operator(,) ident(topic)operator(.)ident(title) - reserved(end) - - reserved(def) method(test_infered_auto_observer) - ident(topic_observer) operator(=) constant(TopicObserver)operator(.)ident(instance) - - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) ident(topic_observer)operator(.)ident(topic)operator(.)ident(title)operator(,) ident(topic)operator(.)ident(title) - reserved(end) - - reserved(def) method(test_observing_two_classes) - ident(multi_observer) operator(=) constant(MultiObserver)operator(.)ident(instance) - - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) ident(multi_observer)operator(.)ident(record)operator(.)ident(title)operator(,) ident(topic)operator(.)ident(title) - - ident(developer) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) ident(multi_observer)operator(.)ident(record)operator(.)ident(name)operator(,) ident(developer)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_observing_subclasses) - ident(multi_observer) operator(=) constant(MultiObserver)operator(.)ident(instance) - - ident(developer) operator(=) constant(SpecialDeveloper)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) ident(multi_observer)operator(.)ident(record)operator(.)ident(name)operator(,) ident(developer)operator(.)ident(name) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(LockingTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:people)operator(,) symbol(:legacy_things) - - reserved(def) method(test_lock_existing) - ident(p1) operator(=) constant(Person)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(p2) operator(=) constant(Person)operator(.)ident(find)operator(()integer(1)operator(\)) - - ident(p1)operator(.)ident(first_name) operator(=) string - ident(p1)operator(.)ident(save) - - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(StaleObjectError)operator(\)) operator({) - ident(p2)operator(.)ident(first_name) operator(=) string - ident(p2)operator(.)ident(save) - operator(}) - reserved(end) - - reserved(def) method(test_lock_new) - ident(p1) operator(=) constant(Person)operator(.)ident(create)operator(()operator({) stringoperator(=)operator(>)stringoperator(})operator(\)) - ident(p2) operator(=) constant(Person)operator(.)ident(find)operator(()ident(p1)operator(.)ident(id)operator(\)) - ident(assert_equal) ident(p1)operator(.)ident(id)operator(,) ident(p2)operator(.)ident(id) - ident(p1)operator(.)ident(first_name) operator(=) string - ident(p1)operator(.)ident(save) - - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(StaleObjectError)operator(\)) operator({) - ident(p2)operator(.)ident(first_name) operator(=) string - ident(p2)operator(.)ident(save) - operator(}) - reserved(end) - - reserved(def) method(test_lock_column_name_existing) - ident(t1) operator(=) constant(LegacyThing)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(t2) operator(=) constant(LegacyThing)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(t1)operator(.)ident(tps_report_number) operator(=) integer(400) - ident(t1)operator(.)ident(save) - - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(StaleObjectError)operator(\)) operator({) - ident(t2)operator(.)ident(tps_report_number) operator(=) integer(300) - ident(t2)operator(.)ident(save) - operator(}) - reserved(end) - -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(MethodScopingTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:developers)operator(,) symbol(:projects)operator(,) symbol(:comments)operator(,) symbol(:posts) - - reserved(def) method(test_set_conditions) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal) stringoperator(,) constant(Developer)operator(.)ident(send)operator(()symbol(:current_scoped_methods)operator(\))operator([)symbol(:find)operator(])operator([)symbol(:conditions)operator(]) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_find) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_nothing_raised) operator({) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) operator(}) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_find_first) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal) constant(Developer)operator(.)ident(find)operator(()integer(10)operator(\))operator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_find_combines_conditions) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal) ident(developers)operator(()symbol(:poor_jamis)operator(\))operator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_find_sanitizes_conditions) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) integer(9000)operator(]) operator(})operator(\)) reserved(do) - ident(assert_equal) ident(developers)operator(()symbol(:poor_jamis)operator(\))operator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_find_combines_and_sanitizes_conditions) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) integer(9000)operator(]) operator(})operator(\)) reserved(do) - ident(assert_equal) ident(developers)operator(()symbol(:poor_jamis)operator(\))operator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_find_all) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal) operator([)ident(developers)operator(()symbol(:david)operator(\))operator(])operator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_count) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal) integer(1)operator(,) constant(Developer)operator(.)ident(count) - reserved(end) - - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal) integer(8)operator(,) constant(Developer)operator(.)ident(count) - ident(assert_equal) integer(1)operator(,) constant(Developer)operator(.)ident(count)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_find_include) - comment(# with the include, will retrieve only developers for the given project) - ident(scoped_developers) operator(=) constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:include) operator(=)operator(>) symbol(:projects) operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(\)) - reserved(end) - ident(assert) ident(scoped_developers)operator(.)ident(include?)operator(()ident(developers)operator(()symbol(:david)operator(\))operator(\)) - ident(assert) operator(!)ident(scoped_developers)operator(.)ident(include?)operator(()ident(developers)operator(()symbol(:jamis)operator(\))operator(\)) - ident(assert_equal) integer(1)operator(,) ident(scoped_developers)operator(.)ident(size) - reserved(end) - - reserved(def) method(test_scoped_count_include) - comment(# with the include, will retrieve only developers for the given project) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:include) operator(=)operator(>) symbol(:projects) operator(})operator(\)) reserved(do) - ident(assert_equal) integer(1)operator(,) constant(Developer)operator(.)ident(count)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_create) - ident(new_comment) operator(=) pre_constant(nil) - - constant(VerySpecialComment)operator(.)ident(with_scope)operator(()symbol(:create) operator(=)operator(>) operator({) symbol(:post_id) operator(=)operator(>) integer(1) operator(})operator(\)) reserved(do) - ident(assert_equal)operator(()operator({) symbol(:post_id) operator(=)operator(>) integer(1) operator(})operator(,) constant(VerySpecialComment)operator(.)ident(send)operator(()symbol(:current_scoped_methods)operator(\))operator([)symbol(:create)operator(])operator(\)) - ident(new_comment) operator(=) constant(VerySpecialComment)operator(.)ident(create) symbol(:body) operator(=)operator(>) string - reserved(end) - - ident(assert) constant(Post)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(comments)operator(.)ident(include?)operator(()ident(new_comment)operator(\)) - reserved(end) - - reserved(def) method(test_immutable_scope) - ident(options) operator(=) operator({) symbol(:conditions) operator(=)operator(>) string operator(}) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) ident(options)operator(\)) reserved(do) - ident(assert_equal) stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - ident(options)operator([)symbol(:conditions)operator(]) operator(=) string - ident(assert_equal) stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - reserved(end) - - ident(scope) operator(=) operator({) symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(}) - constant(Developer)operator(.)ident(with_scope)operator(()ident(scope)operator(\)) reserved(do) - ident(assert_equal) stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - ident(scope)operator([)symbol(:find)operator(])operator([)symbol(:conditions)operator(]) operator(=) string - ident(assert_equal) stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - reserved(end) - reserved(end) - - reserved(def) method(test_scoped_with_duck_typing) - ident(scoping) operator(=) constant(Struct)operator(.)ident(new)operator(()symbol(:method_scoping)operator(\))operator(.)ident(new)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(]) operator(})operator(\)) - constant(Developer)operator(.)ident(with_scope)operator(()ident(scoping)operator(\)) reserved(do) - ident(assert_equal) stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - reserved(end) - reserved(end) - - reserved(def) method(test_ensure_that_method_scoping_is_correctly_restored) - ident(scoped_methods) operator(=) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\)) - - reserved(begin) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(raise) string - reserved(end) - reserved(rescue) - reserved(end) - ident(assert_equal) ident(scoped_methods)operator(,) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\)) - reserved(end) -reserved(end) - -reserved(class) class(NestedScopingTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:developers)operator(,) symbol(:projects)operator(,) symbol(:comments)operator(,) symbol(:posts) - - reserved(def) method(test_merge_options) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:limit) operator(=)operator(>) integer(10) operator(})operator(\)) reserved(do) - ident(merged_option) operator(=) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\))operator([)symbol(:find)operator(]) - ident(assert_equal)operator(()operator({) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(10) operator(})operator(,) ident(merged_option)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_replace_options) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_exclusive_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal)operator(()operator({)symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(})operator(,) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\))operator(\)) - ident(assert_equal)operator(()operator({)symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(})operator(,) constant(Developer)operator(.)ident(send)operator(()symbol(:scoped_methods)operator(\))operator([)integer(-1)operator(])operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_append_conditions) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(appended_condition) operator(=) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\))operator([)symbol(:find)operator(])operator([)symbol(:conditions)operator(]) - ident(assert_equal)operator(()stringoperator(,) ident(appended_condition)operator(\)) - ident(assert_equal)operator(()integer(1)operator(,) constant(Developer)operator(.)ident(count)operator(\)) - reserved(end) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal)operator(()integer(0)operator(,) constant(Developer)operator(.)ident(count)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_merge_and_append_options) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(10) operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(merged_option) operator(=) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\))operator([)symbol(:find)operator(]) - ident(assert_equal)operator(()operator({) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:limit) operator(=)operator(>) integer(10) operator(})operator(,) ident(merged_option)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_nested_scoped_find) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_exclusive_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_nothing_raised) operator({) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) operator(}) - ident(assert_equal)operator(()stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(\)) - reserved(end) - ident(assert_equal)operator(()stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_nested_scoped_find_include) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:include) operator(=)operator(>) symbol(:projects) operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_nothing_raised) operator({) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) operator(}) - ident(assert_equal)operator(()stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_nested_scoped_find_merged_include) - comment(# :include's remain unique and don't "double up" when merging) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:include) operator(=)operator(>) symbol(:projects)operator(,) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:include) operator(=)operator(>) symbol(:projects) operator(})operator(\)) reserved(do) - ident(assert_equal) integer(1)operator(,) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\))operator([)symbol(:find)operator(])operator([)symbol(:include)operator(])operator(.)ident(length) - ident(assert_equal)operator(()stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(\)) - reserved(end) - reserved(end) - - comment(# the nested scope doesn't remove the first :include) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:include) operator(=)operator(>) symbol(:projects)operator(,) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:include) operator(=)operator(>) operator([)operator(]) operator(})operator(\)) reserved(do) - ident(assert_equal) integer(1)operator(,) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\))operator([)symbol(:find)operator(])operator([)symbol(:include)operator(])operator(.)ident(length) - ident(assert_equal)operator(()stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(\)) - reserved(end) - reserved(end) - - comment(# mixing array and symbol include's will merge correctly) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:include) operator(=)operator(>) operator([)symbol(:projects)operator(])operator(,) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:include) operator(=)operator(>) symbol(:projects) operator(})operator(\)) reserved(do) - ident(assert_equal) integer(1)operator(,) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\))operator([)symbol(:find)operator(])operator([)symbol(:include)operator(])operator(.)ident(length) - ident(assert_equal)operator(()stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_nested_scoped_find_replace_include) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:include) operator(=)operator(>) symbol(:projects) operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_exclusive_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:include) operator(=)operator(>) operator([)operator(]) operator(})operator(\)) reserved(do) - ident(assert_equal) integer(0)operator(,) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\))operator([)symbol(:find)operator(])operator([)symbol(:include)operator(])operator(.)ident(length) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_three_level_nested_exclusive_scoped_find) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal)operator(()stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(\)) - - constant(Developer)operator(.)ident(with_exclusive_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal)operator(()stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(\)) - - constant(Developer)operator(.)ident(with_exclusive_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal)operator(()pre_constant(nil)operator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(\)) - reserved(end) - - comment(# ensure that scoping is restored) - ident(assert_equal)operator(()stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(\)) - reserved(end) - - comment(# ensure that scoping is restored) - ident(assert_equal)operator(()stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_merged_scoped_find) - ident(poor_jamis) operator(=) ident(developers)operator(()symbol(:poor_jamis)operator(\)) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:offset) operator(=)operator(>) integer(1) operator(})operator(\)) reserved(do) - ident(assert_equal)operator(()ident(poor_jamis)operator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\))operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_merged_scoped_find_sanitizes_conditions) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(]) operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) integer(9000)operator(]) operator(})operator(\)) reserved(do) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(RecordNotFound)operator(\)) operator({) ident(developers)operator(()symbol(:poor_jamis)operator(\)) operator(}) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_nested_scoped_find_combines_and_sanitizes_conditions) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(]) operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_exclusive_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) integer(9000)operator(]) operator(})operator(\)) reserved(do) - ident(assert_equal) ident(developers)operator(()symbol(:poor_jamis)operator(\))operator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(assert_equal) ident(developers)operator(()symbol(:poor_jamis)operator(\))operator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(])operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_merged_scoped_find_combines_and_sanitizes_conditions) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) operator([)stringoperator(,) stringoperator(]) operator(})operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) operator([)string ?)delimiter(')>operator(,) integer(9000)operator(]) operator(})operator(\)) reserved(do) - ident(assert_equal) stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_immutable_nested_scope) - ident(options1) operator(=) operator({) symbol(:conditions) operator(=)operator(>) string operator(}) - ident(options2) operator(=) operator({) symbol(:conditions) operator(=)operator(>) string operator(}) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) ident(options1)operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_exclusive_scope)operator(()symbol(:find) operator(=)operator(>) ident(options2)operator(\)) reserved(do) - ident(assert_equal) stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - ident(options1)operator([)symbol(:conditions)operator(]) operator(=) ident(options2)operator([)symbol(:conditions)operator(]) operator(=) pre_constant(nil) - ident(assert_equal) stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_immutable_merged_scope) - ident(options1) operator(=) operator({) symbol(:conditions) operator(=)operator(>) string operator(}) - ident(options2) operator(=) operator({) symbol(:conditions) operator(=)operator(>) string 10000)delimiter(")> operator(}) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) ident(options1)operator(\)) reserved(do) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) ident(options2)operator(\)) reserved(do) - ident(assert_equal) stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - ident(options1)operator([)symbol(:conditions)operator(]) operator(=) ident(options2)operator([)symbol(:conditions)operator(]) operator(=) pre_constant(nil) - ident(assert_equal) stringoperator(,) constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(map) operator({) operator(|)ident(d)operator(|) ident(d)operator(.)ident(name) operator(}) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_ensure_that_method_scoping_is_correctly_restored) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(scoped_methods) operator(=) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\)) - reserved(begin) - constant(Developer)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(raise) string - reserved(end) - reserved(rescue) - reserved(end) - ident(assert_equal) ident(scoped_methods)operator(,) constant(Developer)operator(.)ident(instance_eval)operator(()stringoperator(\)) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(HasManyScopingTest)operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:comments)operator(,) symbol(:posts) - - reserved(def) method(setup) - instance_variable(@welcome) operator(=) constant(Post)operator(.)ident(find)operator(()integer(1)operator(\)) - reserved(end) - - reserved(def) method(test_forwarding_of_static_methods) - ident(assert_equal) stringoperator(,) constant(Comment)operator(.)ident(what_are_you) - ident(assert_equal) stringoperator(,) instance_variable(@welcome)operator(.)ident(comments)operator(.)ident(what_are_you) - reserved(end) - - reserved(def) method(test_forwarding_to_scoped) - ident(assert_equal) integer(4)operator(,) constant(Comment)operator(.)ident(search_by_type)operator(()stringoperator(\))operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) instance_variable(@welcome)operator(.)ident(comments)operator(.)ident(search_by_type)operator(()stringoperator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_forwarding_to_dynamic_finders) - ident(assert_equal) integer(4)operator(,) constant(Comment)operator(.)ident(find_all_by_type)operator(()stringoperator(\))operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) instance_variable(@welcome)operator(.)ident(comments)operator(.)ident(find_all_by_type)operator(()stringoperator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_nested_scope) - constant(Comment)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal) stringoperator(,) instance_variable(@welcome)operator(.)ident(comments)operator(.)ident(what_are_you) - reserved(end) - reserved(end) -reserved(end) - - -reserved(class) class(HasAndBelongsToManyScopingTest)operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:posts)operator(,) symbol(:categories)operator(,) symbol(:categories_posts) - - reserved(def) method(setup) - instance_variable(@welcome) operator(=) constant(Post)operator(.)ident(find)operator(()integer(1)operator(\)) - reserved(end) - - reserved(def) method(test_forwarding_of_static_methods) - ident(assert_equal) stringoperator(,) constant(Category)operator(.)ident(what_are_you) - ident(assert_equal) stringoperator(,) instance_variable(@welcome)operator(.)ident(categories)operator(.)ident(what_are_you) - reserved(end) - - reserved(def) method(test_forwarding_to_dynamic_finders) - ident(assert_equal) integer(4)operator(,) constant(Category)operator(.)ident(find_all_by_type)operator(()stringoperator(\))operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) instance_variable(@welcome)operator(.)ident(categories)operator(.)ident(find_all_by_type)operator(()stringoperator(\))operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) instance_variable(@welcome)operator(.)ident(categories)operator(.)ident(find_all_by_type)operator(()stringoperator(\))operator(.)ident(size) - reserved(end) - - reserved(def) method(test_nested_scope) - constant(Category)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert_equal) stringoperator(,) instance_variable(@welcome)operator(.)ident(comments)operator(.)ident(what_are_you) - reserved(end) - reserved(end) -reserved(end) - - -comment(=begin -# We disabled the scoping for has_one and belongs_to as we can't think of a proper use case - - -class BelongsToScopingTest< Test::Unit::TestCase - fixtures :comments, :posts - - def setup - @greetings = Comment.find(1\) - end - - def test_forwarding_of_static_method - assert_equal 'a post...', Post.what_are_you - assert_equal 'a post...', @greetings.post.what_are_you - end - - def test_forwarding_to_dynamic_finders - assert_equal 4, Post.find_all_by_type('Post'\).size - assert_equal 1, @greetings.post.find_all_by_type('Post'\).size - end - -end - - -class HasOneScopingTest< Test::Unit::TestCase - fixtures :comments, :posts - - def setup - @sti_comments = Post.find(4\) - end - - def test_forwarding_of_static_methods - assert_equal 'a comment...', Comment.what_are_you - assert_equal 'a very special comment...', @sti_comments.very_special_comment.what_are_you - end - - def test_forwarding_to_dynamic_finders - assert_equal 1, Comment.find_all_by_type('VerySpecialComment'\).size - assert_equal 1, @sti_comments.very_special_comment.find_all_by_type('VerySpecialComment'\).size - assert_equal 0, @sti_comments.very_special_comment.find_all_by_type('Comment'\).size - end - -end - -=end) -ident(require) string -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(if) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(supports_migrations?) - reserved(class) class(Reminder) operator(<) constant(ActiveRecord)operator(::)constant(Base)operator(;) reserved(end) - - reserved(class) class(ActiveRecord::Migration) - reserved(class) operator(<<)class(self) - ident(attr_accessor) symbol(:message_count) - reserved(def) method(puts)operator(()ident(text)operator(=)stringoperator(\)) - pre_constant(self)operator(.)ident(message_count) operator(||=) integer(0) - pre_constant(self)operator(.)ident(message_count) operator(+=) integer(1) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(MigrationTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(false) - - reserved(def) method(setup) - constant(ActiveRecord)operator(::)constant(Migration)operator(.)ident(verbose) operator(=) pre_constant(true) - constant(PeopleHaveLastNames)operator(.)ident(message_count) operator(=) integer(0) - reserved(end) - - reserved(def) method(teardown) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(initialize_schema_information) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(update) stringcontent( SET version = 0)delimiter(")> - - constant(Reminder)operator(.)ident(connection)operator(.)ident(drop_table)operator(()stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Reminder)operator(.)ident(connection)operator(.)ident(drop_table)operator(()stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Reminder)operator(.)ident(connection)operator(.)ident(drop_table)operator(()stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Reminder)operator(.)ident(reset_column_information) - - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,) stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,) stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,) stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,) stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,) stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,) stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,) stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,) stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,) stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Person)operator(.)ident(reset_column_information) - reserved(end) - - reserved(def) method(test_add_index) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:string) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:boolean) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:string) - - ident(assert_nothing_raised) operator({) constant(Person)operator(.)ident(connection)operator(.)ident(add_index)operator(()stringoperator(,) stringoperator(\)) operator(}) - ident(assert_nothing_raised) operator({) constant(Person)operator(.)ident(connection)operator(.)ident(remove_index)operator(()stringoperator(,) stringoperator(\)) operator(}) - - ident(assert_nothing_raised) operator({) constant(Person)operator(.)ident(connection)operator(.)ident(add_index)operator(()stringoperator(,) operator([)stringoperator(,) stringoperator(])operator(\)) operator(}) - ident(assert_nothing_raised) operator({) constant(Person)operator(.)ident(connection)operator(.)ident(remove_index)operator(()stringoperator(,) stringoperator(\)) operator(}) - - comment(# quoting) - ident(assert_nothing_raised) operator({) constant(Person)operator(.)ident(connection)operator(.)ident(add_index)operator(()stringoperator(,) operator([)stringoperator(])operator(,) symbol(:name) operator(=)operator(>) stringoperator(,) symbol(:unique) operator(=)operator(>) pre_constant(true)operator(\)) operator(}) - ident(assert_nothing_raised) operator({) constant(Person)operator(.)ident(connection)operator(.)ident(remove_index)operator(()stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) operator(}) - - comment(# Sybase adapter does not support indexes on :boolean columns) - reserved(unless) ident(current_adapter?)operator(()symbol(:SybaseAdapter)operator(\)) - ident(assert_nothing_raised) operator({) constant(Person)operator(.)ident(connection)operator(.)ident(add_index)operator(()stringoperator(,) stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) operator(}) - ident(assert_nothing_raised) operator({) constant(Person)operator(.)ident(connection)operator(.)ident(remove_index)operator(()stringoperator(,) symbol(:name) operator(=)operator(>) stringoperator(\)) operator(}) - reserved(end) - reserved(end) - - reserved(def) method(test_create_table_adds_id) - constant(Person)operator(.)ident(connection)operator(.)ident(create_table) symbol(:testings) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:foo)operator(,) symbol(:string) - reserved(end) - - ident(assert_equal) stringoperator(,) - constant(Person)operator(.)ident(connection)operator(.)ident(columns)operator(()symbol(:testings)operator(\))operator(.)ident(map) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name) operator(})operator(.)ident(sort) - reserved(ensure) - constant(Person)operator(.)ident(connection)operator(.)ident(drop_table) symbol(:testings) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(test_create_table_with_not_null_column) - constant(Person)operator(.)ident(connection)operator(.)ident(create_table) symbol(:testings) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:foo)operator(,) symbol(:string)operator(,) symbol(:null) operator(=)operator(>) pre_constant(false) - reserved(end) - - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(\)) reserved(do) - constant(Person)operator(.)ident(connection)operator(.)ident(execute) string - reserved(end) - reserved(ensure) - constant(Person)operator(.)ident(connection)operator(.)ident(drop_table) symbol(:testings) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(test_create_table_with_defaults) - constant(Person)operator(.)ident(connection)operator(.)ident(create_table) symbol(:testings) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:one)operator(,) symbol(:string)operator(,) symbol(:default) operator(=)operator(>) string - ident(t)operator(.)ident(column) symbol(:two)operator(,) symbol(:boolean)operator(,) symbol(:default) operator(=)operator(>) pre_constant(true) - ident(t)operator(.)ident(column) symbol(:three)operator(,) symbol(:boolean)operator(,) symbol(:default) operator(=)operator(>) pre_constant(false) - ident(t)operator(.)ident(column) symbol(:four)operator(,) symbol(:integer)operator(,) symbol(:default) operator(=)operator(>) integer(1) - reserved(end) - - ident(columns) operator(=) constant(Person)operator(.)ident(connection)operator(.)ident(columns)operator(()symbol(:testings)operator(\)) - ident(one) operator(=) ident(columns)operator(.)ident(detect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name) operator(==) string operator(}) - ident(two) operator(=) ident(columns)operator(.)ident(detect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name) operator(==) string operator(}) - ident(three) operator(=) ident(columns)operator(.)ident(detect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name) operator(==) string operator(}) - ident(four) operator(=) ident(columns)operator(.)ident(detect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name) operator(==) string operator(}) - - ident(assert_equal) stringoperator(,) ident(one)operator(.)ident(default) - reserved(if) ident(current_adapter?)operator(()symbol(:OracleAdapter)operator(\)) - comment(# Oracle doesn't support native booleans) - ident(assert_equal) pre_constant(true)operator(,) ident(two)operator(.)ident(default) operator(==) integer(1) - ident(assert_equal) pre_constant(false)operator(,) ident(three)operator(.)ident(default) operator(!=) integer(0) - reserved(else) - ident(assert_equal) pre_constant(true)operator(,) ident(two)operator(.)ident(default) - ident(assert_equal) pre_constant(false)operator(,) ident(three)operator(.)ident(default) - reserved(end) - ident(assert_equal) integer(1)operator(,) ident(four)operator(.)ident(default) - - reserved(ensure) - constant(Person)operator(.)ident(connection)operator(.)ident(drop_table) symbol(:testings) reserved(rescue) pre_constant(nil) - reserved(end) - - comment(# SQL Server and Sybase will not allow you to add a NOT NULL column) - comment(# to a table without specifying a default value, so the) - comment(# following test must be skipped ) - reserved(unless) ident(current_adapter?)operator(()symbol(:SQLServerAdapter)operator(\)) operator(||) ident(current_adapter?)operator(()symbol(:SybaseAdapter)operator(\)) - reserved(def) method(test_add_column_not_null_without_default) - constant(Person)operator(.)ident(connection)operator(.)ident(create_table) symbol(:testings) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:foo)operator(,) symbol(:string) - reserved(end) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) symbol(:testings)operator(,) symbol(:bar)operator(,) symbol(:string)operator(,) symbol(:null) operator(=)operator(>) pre_constant(false) - - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(\)) reserved(do) - constant(Person)operator(.)ident(connection)operator(.)ident(execute) string - reserved(end) - reserved(ensure) - constant(Person)operator(.)ident(connection)operator(.)ident(drop_table) symbol(:testings) reserved(rescue) pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(test_add_column_not_null_with_default) - constant(Person)operator(.)ident(connection)operator(.)ident(create_table) symbol(:testings) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:foo)operator(,) symbol(:string) - reserved(end) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) symbol(:testings)operator(,) symbol(:bar)operator(,) symbol(:string)operator(,) symbol(:null) operator(=)operator(>) pre_constant(false)operator(,) symbol(:default) operator(=)operator(>) string - - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(\)) reserved(do) - constant(Person)operator(.)ident(connection)operator(.)ident(execute) string - reserved(end) - reserved(ensure) - constant(Person)operator(.)ident(connection)operator(.)ident(drop_table) symbol(:testings) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(test_native_types) - constant(Person)operator(.)ident(delete_all) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:string) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:text) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:integer) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:float) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:datetime) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:date) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:boolean) - ident(assert_nothing_raised) operator({) constant(Person)operator(.)ident(create) symbol(:first_name) operator(=)operator(>) stringoperator(,) symbol(:last_name) operator(=)operator(>) stringoperator(,) symbol(:bio) operator(=)operator(>) stringoperator(,) symbol(:age) operator(=)operator(>) integer(18)operator(,) symbol(:height) operator(=)operator(>) float(1.78)operator(,) symbol(:birthday) operator(=)operator(>) integer(18)operator(.)ident(years)operator(.)ident(ago)operator(,) symbol(:favorite_day) operator(=)operator(>) integer(10)operator(.)ident(days)operator(.)ident(ago)operator(,) symbol(:male) operator(=)operator(>) pre_constant(true) operator(}) - ident(bob) operator(=) constant(Person)operator(.)ident(find)operator(()symbol(:first)operator(\)) - - ident(assert_equal) ident(bob)operator(.)ident(first_name)operator(,) string - ident(assert_equal) ident(bob)operator(.)ident(last_name)operator(,) string - ident(assert_equal) ident(bob)operator(.)ident(bio)operator(,) string - ident(assert_equal) ident(bob)operator(.)ident(age)operator(,) integer(18) - ident(assert_equal) ident(bob)operator(.)ident(male?)operator(,) pre_constant(true) - - ident(assert_equal) constant(String)operator(,) ident(bob)operator(.)ident(first_name)operator(.)ident(class) - ident(assert_equal) constant(String)operator(,) ident(bob)operator(.)ident(last_name)operator(.)ident(class) - ident(assert_equal) constant(String)operator(,) ident(bob)operator(.)ident(bio)operator(.)ident(class) - ident(assert_equal) constant(Fixnum)operator(,) ident(bob)operator(.)ident(age)operator(.)ident(class) - ident(assert_equal) constant(Time)operator(,) ident(bob)operator(.)ident(birthday)operator(.)ident(class) - - reserved(if) ident(current_adapter?)operator(()symbol(:SQLServerAdapter)operator(\)) operator(||) ident(current_adapter?)operator(()symbol(:OracleAdapter)operator(\)) operator(||) ident(current_adapter?)operator(()symbol(:SybaseAdapter)operator(\)) - comment(# SQL Server, Sybase, and Oracle don't differentiate between date/time) - ident(assert_equal) constant(Time)operator(,) ident(bob)operator(.)ident(favorite_day)operator(.)ident(class) - reserved(else) - ident(assert_equal) constant(Date)operator(,) ident(bob)operator(.)ident(favorite_day)operator(.)ident(class) - reserved(end) - - ident(assert_equal) constant(TrueClass)operator(,) ident(bob)operator(.)ident(male?)operator(.)ident(class) - reserved(end) - - reserved(def) method(test_add_remove_single_field_using_string_arguments) - ident(assert) operator(!)constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - - constant(ActiveRecord)operator(::)constant(Migration)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:string) - - constant(Person)operator(.)ident(reset_column_information) - ident(assert) constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - - constant(ActiveRecord)operator(::)constant(Migration)operator(.)ident(remove_column) stringoperator(,) string - - constant(Person)operator(.)ident(reset_column_information) - ident(assert) operator(!)constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - reserved(end) - - reserved(def) method(test_add_remove_single_field_using_symbol_arguments) - ident(assert) operator(!)constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - - constant(ActiveRecord)operator(::)constant(Migration)operator(.)ident(add_column) symbol(:people)operator(,) symbol(:last_name)operator(,) symbol(:string) - - constant(Person)operator(.)ident(reset_column_information) - ident(assert) constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - - constant(ActiveRecord)operator(::)constant(Migration)operator(.)ident(remove_column) symbol(:people)operator(,) symbol(:last_name) - - constant(Person)operator(.)ident(reset_column_information) - ident(assert) operator(!)constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - reserved(end) - - reserved(def) method(test_add_rename) - constant(Person)operator(.)ident(delete_all) - - reserved(begin) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:string) - constant(Person)operator(.)ident(create) symbol(:girlfriend) operator(=)operator(>) string - - constant(Person)operator(.)ident(connection)operator(.)ident(rename_column) stringoperator(,) stringoperator(,) string - - constant(Person)operator(.)ident(reset_column_information) - ident(bob) operator(=) constant(Person)operator(.)ident(find)operator(()symbol(:first)operator(\)) - - ident(assert_equal) stringoperator(,) ident(bob)operator(.)ident(exgirlfriend) - reserved(ensure) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,) stringoperator(\)) reserved(rescue) pre_constant(nil) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,) stringoperator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(end) - - reserved(def) method(test_rename_column_using_symbol_arguments) - reserved(begin) - constant(Person)operator(.)ident(connection)operator(.)ident(rename_column) symbol(:people)operator(,) symbol(:first_name)operator(,) symbol(:nick_name) - constant(Person)operator(.)ident(reset_column_information) - ident(assert) constant(Person)operator(.)ident(column_names)operator(.)ident(include?)operator(()stringoperator(\)) - reserved(ensure) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,)stringoperator(\)) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column)operator(()stringoperator(,)stringoperator(,) symbol(:string)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_rename_column) - reserved(begin) - constant(Person)operator(.)ident(connection)operator(.)ident(rename_column) stringoperator(,) stringoperator(,) string - constant(Person)operator(.)ident(reset_column_information) - ident(assert) constant(Person)operator(.)ident(column_names)operator(.)ident(include?)operator(()stringoperator(\)) - reserved(ensure) - constant(Person)operator(.)ident(connection)operator(.)ident(remove_column)operator(()stringoperator(,)stringoperator(\)) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column)operator(()stringoperator(,)stringoperator(,) symbol(:string)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_rename_table) - reserved(begin) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(create_table) symbol(:octopuses) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) symbol(:url)operator(,) symbol(:string) - reserved(end) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(rename_table) symbol(:octopuses)operator(,) symbol(:octopi) - - ident(assert_nothing_raised) reserved(do) - reserved(if) ident(current_adapter?)operator(()symbol(:OracleAdapter)operator(\)) - comment(# Oracle requires the explicit sequence value for the pk) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(execute) string - reserved(else) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(execute) string - reserved(end) - reserved(end) - - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(select_value)operator(()stringoperator(\)) - - reserved(ensure) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(drop_table) symbol(:octopuses) reserved(rescue) pre_constant(nil) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(drop_table) symbol(:octopi) reserved(rescue) pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(test_change_column) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:integer) - ident(old_columns) operator(=) constant(Person)operator(.)ident(connection)operator(.)ident(columns)operator(()constant(Person)operator(.)ident(table_name)operator(,) stringcontent( Columns)delimiter(")>operator(\)) - ident(assert) ident(old_columns)operator(.)ident(find) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name) operator(==) string reserved(and) ident(c)operator(.)ident(type) operator(==) symbol(:integer) operator(}) - - ident(assert_nothing_raised) operator({) constant(Person)operator(.)ident(connection)operator(.)ident(change_column) stringoperator(,) stringoperator(,) symbol(:string) operator(}) - - ident(new_columns) operator(=) constant(Person)operator(.)ident(connection)operator(.)ident(columns)operator(()constant(Person)operator(.)ident(table_name)operator(,) stringcontent( Columns)delimiter(")>operator(\)) - ident(assert_nil) ident(new_columns)operator(.)ident(find) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name) operator(==) string reserved(and) ident(c)operator(.)ident(type) operator(==) symbol(:integer) operator(}) - ident(assert) ident(new_columns)operator(.)ident(find) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name) operator(==) string reserved(and) ident(c)operator(.)ident(type) operator(==) symbol(:string) operator(}) - reserved(end) - - reserved(def) method(test_change_column_with_new_default) - constant(Person)operator(.)ident(connection)operator(.)ident(add_column) stringoperator(,) stringoperator(,) symbol(:boolean)operator(,) symbol(:default) operator(=)operator(>) integer(1) - constant(Person)operator(.)ident(reset_column_information) - ident(assert) constant(Person)operator(.)ident(new)operator(.)ident(administrator?) - - ident(assert_nothing_raised) operator({) constant(Person)operator(.)ident(connection)operator(.)ident(change_column) stringoperator(,) stringoperator(,) symbol(:boolean)operator(,) symbol(:default) operator(=)operator(>) integer(0) operator(}) - constant(Person)operator(.)ident(reset_column_information) - ident(assert) operator(!)constant(Person)operator(.)ident(new)operator(.)ident(administrator?) - reserved(end) - - reserved(def) method(test_add_table) - ident(assert) operator(!)constant(Reminder)operator(.)ident(table_exists?) - - constant(WeNeedReminders)operator(.)ident(up) - - ident(assert) constant(Reminder)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) constant(Time)operator(.)ident(now)operator(\)) - ident(assert_equal) stringoperator(,) constant(Reminder)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(content) - - constant(WeNeedReminders)operator(.)ident(down) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(\)) operator({) constant(Reminder)operator(.)ident(find)operator(()symbol(:first)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_migrator) - ident(assert) operator(!)constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - ident(assert) operator(!)constant(Reminder)operator(.)ident(table_exists?) - - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(up)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - - ident(assert_equal) integer(3)operator(,) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(current_version) - constant(Person)operator(.)ident(reset_column_information) - ident(assert) constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - ident(assert) constant(Reminder)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) constant(Time)operator(.)ident(now)operator(\)) - ident(assert_equal) stringoperator(,) constant(Reminder)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(content) - - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(down)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - - ident(assert_equal) integer(0)operator(,) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(current_version) - constant(Person)operator(.)ident(reset_column_information) - ident(assert) operator(!)constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(\)) operator({) constant(Reminder)operator(.)ident(find)operator(()symbol(:first)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_migrator_one_up) - ident(assert) operator(!)constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - ident(assert) operator(!)constant(Reminder)operator(.)ident(table_exists?) - - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(up)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) integer(1)operator(\)) - - constant(Person)operator(.)ident(reset_column_information) - ident(assert) constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - ident(assert) operator(!)constant(Reminder)operator(.)ident(table_exists?) - - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(up)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) integer(2)operator(\)) - - ident(assert) constant(Reminder)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) constant(Time)operator(.)ident(now)operator(\)) - ident(assert_equal) stringoperator(,) constant(Reminder)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(content) - reserved(end) - - reserved(def) method(test_migrator_one_down) - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(up)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(down)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) integer(1)operator(\)) - - constant(Person)operator(.)ident(reset_column_information) - ident(assert) constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - ident(assert) operator(!)constant(Reminder)operator(.)ident(table_exists?) - reserved(end) - - reserved(def) method(test_migrator_one_up_one_down) - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(up)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) integer(1)operator(\)) - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(down)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) integer(0)operator(\)) - - ident(assert) operator(!)constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - ident(assert) operator(!)constant(Reminder)operator(.)ident(table_exists?) - reserved(end) - - reserved(def) method(test_migrator_verbosity) - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(up)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) integer(1)operator(\)) - ident(assert) constant(PeopleHaveLastNames)operator(.)ident(message_count) operator(>) integer(0) - constant(PeopleHaveLastNames)operator(.)ident(message_count) operator(=) integer(0) - - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(down)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) integer(0)operator(\)) - ident(assert) constant(PeopleHaveLastNames)operator(.)ident(message_count) operator(>) integer(0) - constant(PeopleHaveLastNames)operator(.)ident(message_count) operator(=) integer(0) - reserved(end) - - reserved(def) method(test_migrator_verbosity_off) - constant(PeopleHaveLastNames)operator(.)ident(verbose) operator(=) pre_constant(false) - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(up)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) integer(1)operator(\)) - ident(assert) constant(PeopleHaveLastNames)operator(.)ident(message_count)operator(.)ident(zero?) - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(down)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) integer(0)operator(\)) - ident(assert) constant(PeopleHaveLastNames)operator(.)ident(message_count)operator(.)ident(zero?) - reserved(end) - - reserved(def) method(test_migrator_going_down_due_to_version_target) - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(up)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) integer(1)operator(\)) - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(migrate)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) integer(0)operator(\)) - - ident(assert) operator(!)constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - ident(assert) operator(!)constant(Reminder)operator(.)ident(table_exists?) - - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(migrate)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - - constant(Person)operator(.)ident(reset_column_information) - ident(assert) constant(Person)operator(.)ident(column_methods_hash)operator(.)ident(include?)operator(()symbol(:last_name)operator(\)) - ident(assert) constant(Reminder)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) constant(Time)operator(.)ident(now)operator(\)) - ident(assert_equal) stringoperator(,) constant(Reminder)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(content) - reserved(end) - - reserved(def) method(test_schema_info_table_name) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - constant(Reminder)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(schema_info_table_name) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - constant(Reminder)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(schema_info_table_name) - reserved(ensure) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - reserved(end) - - reserved(def) method(test_proper_table_name) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(proper_table_name)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(proper_table_name)operator(()symbol(:table)operator(\)) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(proper_table_name)operator(()constant(Reminder)operator(\)) - constant(Reminder)operator(.)ident(reset_table_name) - ident(assert_equal) constant(Reminder)operator(.)ident(table_name)operator(,) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(proper_table_name)operator(()constant(Reminder)operator(\)) - - comment(# Use the model's own prefix/suffix if a model is given) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - constant(Reminder)operator(.)ident(table_name_prefix) operator(=) string - constant(Reminder)operator(.)ident(table_name_suffix) operator(=) string - constant(Reminder)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(proper_table_name)operator(()constant(Reminder)operator(\)) - constant(Reminder)operator(.)ident(table_name_prefix) operator(=) string - constant(Reminder)operator(.)ident(table_name_suffix) operator(=) string - constant(Reminder)operator(.)ident(reset_table_name) - - comment(# Use AR::Base's prefix/suffix if string or symbol is given ) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - constant(Reminder)operator(.)ident(reset_table_name) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(proper_table_name)operator(()stringoperator(\)) - ident(assert_equal) stringoperator(,) constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(proper_table_name)operator(()symbol(:table)operator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - constant(Reminder)operator(.)ident(reset_table_name) - reserved(end) - - reserved(def) method(test_add_drop_table_with_prefix_and_suffix) - ident(assert) operator(!)constant(Reminder)operator(.)ident(table_exists?) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - constant(Reminder)operator(.)ident(reset_table_name) - constant(Reminder)operator(.)ident(reset_sequence_name) - constant(WeNeedReminders)operator(.)ident(up) - ident(assert) constant(Reminder)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) constant(Time)operator(.)ident(now)operator(\)) - ident(assert_equal) stringoperator(,) constant(Reminder)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(content) - - constant(WeNeedReminders)operator(.)ident(down) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(\)) operator({) constant(Reminder)operator(.)ident(find)operator(()symbol(:first)operator(\)) operator(}) - reserved(ensure) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_prefix) operator(=) string - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(table_name_suffix) operator(=) string - constant(Reminder)operator(.)ident(reset_table_name) - constant(Reminder)operator(.)ident(reset_sequence_name) - reserved(end) - - reserved(def) method(test_create_table_with_binary_column) - constant(Person)operator(.)ident(connection)operator(.)ident(drop_table) symbol(:binary_testings) reserved(rescue) pre_constant(nil) - - ident(assert_nothing_raised) operator({) - constant(Person)operator(.)ident(connection)operator(.)ident(create_table) symbol(:binary_testings) reserved(do) operator(|)ident(t)operator(|) - ident(t)operator(.)ident(column) stringoperator(,) symbol(:binary)operator(,) symbol(:default) operator(=)operator(>) stringoperator(,) symbol(:null) operator(=)operator(>) pre_constant(false) - reserved(end) - operator(}) - - ident(columns) operator(=) constant(Person)operator(.)ident(connection)operator(.)ident(columns)operator(()symbol(:binary_testings)operator(\)) - ident(data_column) operator(=) ident(columns)operator(.)ident(detect) operator({) operator(|)ident(c)operator(|) ident(c)operator(.)ident(name) operator(==) string operator(}) - - reserved(if) ident(current_adapter?)operator(()symbol(:OracleAdapter)operator(\)) - ident(assert_equal) stringoperator(,) ident(data_column)operator(.)ident(default) - reserved(else) - ident(assert_equal) stringoperator(,) ident(data_column)operator(.)ident(default) - reserved(end) - - constant(Person)operator(.)ident(connection)operator(.)ident(drop_table) symbol(:binary_testings) reserved(rescue) pre_constant(nil) - reserved(end) - - reserved(def) method(test_migrator_with_duplicates) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(DuplicateMigrationVersionError)operator(\)) reserved(do) - constant(ActiveRecord)operator(::)constant(Migrator)operator(.)ident(migrate)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(,) pre_constant(nil)operator(\)) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(MixinNestedSetTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:mixins) - - reserved(def) method(test_mixing_in_methods) - ident(ns) operator(=) constant(NestedSet)operator(.)ident(new) - ident(assert)operator(() ident(ns)operator(.)ident(respond_to?)operator(() symbol(:all_children) operator(\)) operator(\)) - ident(assert_equal)operator(() ident(ns)operator(.)ident(scope_condition)operator(,) string operator(\)) - - ident(check_method_mixins) ident(ns) - reserved(end) - - reserved(def) method(test_string_scope) - ident(ns) operator(=) constant(NestedSetWithStringScope)operator(.)ident(new) - - ident(ns)operator(.)ident(root_id) operator(=) integer(1) - ident(assert_equal)operator(() ident(ns)operator(.)ident(scope_condition)operator(,) string operator(\)) - ident(ns)operator(.)ident(root_id) operator(=) integer(42) - ident(assert_equal)operator(() ident(ns)operator(.)ident(scope_condition)operator(,) string operator(\)) - ident(check_method_mixins) ident(ns) - reserved(end) - - reserved(def) method(test_symbol_scope) - ident(ns) operator(=) constant(NestedSetWithSymbolScope)operator(.)ident(new) - ident(ns)operator(.)ident(root_id) operator(=) integer(1) - ident(assert_equal)operator(() ident(ns)operator(.)ident(scope_condition)operator(,) string operator(\)) - ident(ns)operator(.)ident(root_id) operator(=) integer(42) - ident(assert_equal)operator(() ident(ns)operator(.)ident(scope_condition)operator(,) string operator(\)) - ident(check_method_mixins) ident(ns) - reserved(end) - - reserved(def) method(check_method_mixins)operator(() ident(obj) operator(\)) - operator([)symbol(:scope_condition)operator(,) symbol(:left_col_name)operator(,) symbol(:right_col_name)operator(,) symbol(:parent_column)operator(,) symbol(:root?)operator(,) symbol(:add_child)operator(,) - symbol(:children_count)operator(,) symbol(:full_set)operator(,) symbol(:all_children)operator(,) symbol(:direct_children)operator(])operator(.)ident(each) operator({) operator(|)ident(symbol)operator(|) ident(assert)operator(() ident(obj)operator(.)ident(respond_to?)operator(()ident(symbol)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(set)operator(() ident(id) operator(\)) - constant(NestedSet)operator(.)ident(find)operator(() integer(3000) operator(+) ident(id) operator(\)) - reserved(end) - - reserved(def) method(test_adding_children) - ident(assert)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(unknown?) operator(\)) - ident(assert)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(unknown?) operator(\)) - ident(set)operator(()integer(1)operator(\))operator(.)ident(add_child) ident(set)operator(()integer(2)operator(\)) - - comment(# Did we maintain adding the parent_ids?) - ident(assert)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(root?) operator(\)) - ident(assert)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(child?) operator(\)) - ident(assert)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(parent_id) operator(==) ident(set)operator(()integer(1)operator(\))operator(.)ident(id) operator(\)) - - comment(# Check boundies) - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(lft)operator(,) integer(1) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(lft)operator(,) integer(2) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(rgt)operator(,) integer(3) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(rgt)operator(,) integer(4) operator(\)) - - comment(# Check children cound) - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(children_count)operator(,) integer(1) operator(\)) - - ident(set)operator(()integer(1)operator(\))operator(.)ident(add_child) ident(set)operator(()integer(3)operator(\)) - - comment(#check boundries) - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(lft)operator(,) integer(1) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(lft)operator(,) integer(2) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(rgt)operator(,) integer(3) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(3)operator(\))operator(.)ident(lft)operator(,) integer(4) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(3)operator(\))operator(.)ident(rgt)operator(,) integer(5) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(rgt)operator(,) integer(6) operator(\)) - - comment(# How is the count looking?) - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(children_count)operator(,) integer(2) operator(\)) - - ident(set)operator(()integer(2)operator(\))operator(.)ident(add_child) ident(set)operator(()integer(4)operator(\)) - - comment(# boundries) - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(lft)operator(,) integer(1) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(lft)operator(,) integer(2) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(4)operator(\))operator(.)ident(lft)operator(,) integer(3) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(4)operator(\))operator(.)ident(rgt)operator(,) integer(4) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(rgt)operator(,) integer(5) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(3)operator(\))operator(.)ident(lft)operator(,) integer(6) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(3)operator(\))operator(.)ident(rgt)operator(,) integer(7) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(rgt)operator(,) integer(8) operator(\)) - - comment(# Children count) - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(children_count)operator(,) integer(3) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(children_count)operator(,) integer(1) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(3)operator(\))operator(.)ident(children_count)operator(,) integer(0) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(4)operator(\))operator(.)ident(children_count)operator(,) integer(0) operator(\)) - - ident(set)operator(()integer(2)operator(\))operator(.)ident(add_child) ident(set)operator(()integer(5)operator(\)) - ident(set)operator(()integer(4)operator(\))operator(.)ident(add_child) ident(set)operator(()integer(6)operator(\)) - - ident(assert_equal)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(children_count)operator(,) integer(3) operator(\)) - - - comment(# Children accessors) - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(full_set)operator(.)ident(length)operator(,) integer(6) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(2)operator(\))operator(.)ident(full_set)operator(.)ident(length)operator(,) integer(4) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(4)operator(\))operator(.)ident(full_set)operator(.)ident(length)operator(,) integer(2) operator(\)) - - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(all_children)operator(.)ident(length)operator(,) integer(5) operator(\)) - ident(assert_equal)operator(() ident(set)operator(()integer(6)operator(\))operator(.)ident(all_children)operator(.)ident(length)operator(,) integer(0) operator(\)) - - ident(assert_equal)operator(() ident(set)operator(()integer(1)operator(\))operator(.)ident(direct_children)operator(.)ident(length)operator(,) integer(2) operator(\)) - - reserved(end) - - reserved(def) method(test_snipping_tree) - ident(big_tree) operator(=) constant(NestedSetWithStringScope)operator(.)ident(find)operator(() integer(4001) operator(\)) - - comment(# Make sure we have the right one) - ident(assert_equal)operator(() integer(3)operator(,) ident(big_tree)operator(.)ident(direct_children)operator(.)ident(length) operator(\)) - ident(assert_equal)operator(() integer(10)operator(,) ident(big_tree)operator(.)ident(full_set)operator(.)ident(length) operator(\)) - - constant(NestedSetWithStringScope)operator(.)ident(find)operator(() integer(4005) operator(\))operator(.)ident(destroy) - - ident(big_tree) operator(=) constant(NestedSetWithStringScope)operator(.)ident(find)operator(() integer(4001) operator(\)) - - ident(assert_equal)operator(() integer(7)operator(,) ident(big_tree)operator(.)ident(full_set)operator(.)ident(length) operator(\)) - ident(assert_equal)operator(() integer(2)operator(,) ident(big_tree)operator(.)ident(direct_children)operator(.)ident(length) operator(\)) - - ident(assert_equal)operator(() integer(1)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4001)operator(\))operator(.)ident(lft) operator(\)) - ident(assert_equal)operator(() integer(2)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4002)operator(\))operator(.)ident(lft) operator(\)) - ident(assert_equal)operator(() integer(3)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4003)operator(\))operator(.)ident(lft) operator(\)) - ident(assert_equal)operator(() integer(4)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4003)operator(\))operator(.)ident(rgt) operator(\)) - ident(assert_equal)operator(() integer(5)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4004)operator(\))operator(.)ident(lft) operator(\)) - ident(assert_equal)operator(() integer(6)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4004)operator(\))operator(.)ident(rgt) operator(\)) - ident(assert_equal)operator(() integer(7)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4002)operator(\))operator(.)ident(rgt) operator(\)) - ident(assert_equal)operator(() integer(8)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4008)operator(\))operator(.)ident(lft) operator(\)) - ident(assert_equal)operator(() integer(9)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4009)operator(\))operator(.)ident(lft) operator(\)) - ident(assert_equal)operator(()integer(10)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4009)operator(\))operator(.)ident(rgt) operator(\)) - ident(assert_equal)operator(()integer(11)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4010)operator(\))operator(.)ident(lft) operator(\)) - ident(assert_equal)operator(()integer(12)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4010)operator(\))operator(.)ident(rgt) operator(\)) - ident(assert_equal)operator(()integer(13)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4008)operator(\))operator(.)ident(rgt) operator(\)) - ident(assert_equal)operator(()integer(14)operator(,) constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4001)operator(\))operator(.)ident(rgt) operator(\)) - reserved(end) - - reserved(def) method(test_deleting_root) - constant(NestedSetWithStringScope)operator(.)ident(find)operator(()integer(4001)operator(\))operator(.)ident(destroy) - - ident(assert)operator(() constant(NestedSetWithStringScope)operator(.)ident(count) operator(==) integer(0) operator(\)) - reserved(end) - - reserved(def) method(test_common_usage) - ident(mixins)operator(()symbol(:set_1)operator(\))operator(.)ident(add_child)operator(() ident(mixins)operator(()symbol(:set_2)operator(\)) operator(\)) - ident(assert_equal)operator(() integer(1)operator(,) ident(mixins)operator(()symbol(:set_1)operator(\))operator(.)ident(direct_children)operator(.)ident(length) operator(\)) - - ident(mixins)operator(()symbol(:set_2)operator(\))operator(.)ident(add_child)operator(() ident(mixins)operator(()symbol(:set_3)operator(\)) operator(\)) - ident(assert_equal)operator(() integer(1)operator(,) ident(mixins)operator(()symbol(:set_1)operator(\))operator(.)ident(direct_children)operator(.)ident(length) operator(\)) - - comment(# Local cache is now out of date!) - comment(# Problem: the update_alls update all objects up the tree) - ident(mixins)operator(()symbol(:set_1)operator(\))operator(.)ident(reload) - ident(assert_equal)operator(() integer(2)operator(,) ident(mixins)operator(()symbol(:set_1)operator(\))operator(.)ident(all_children)operator(.)ident(length) operator(\)) - - ident(assert_equal)operator(() integer(1)operator(,) ident(mixins)operator(()symbol(:set_1)operator(\))operator(.)ident(lft) operator(\)) - ident(assert_equal)operator(() integer(2)operator(,) ident(mixins)operator(()symbol(:set_2)operator(\))operator(.)ident(lft) operator(\)) - ident(assert_equal)operator(() integer(3)operator(,) ident(mixins)operator(()symbol(:set_3)operator(\))operator(.)ident(lft) operator(\)) - ident(assert_equal)operator(() integer(4)operator(,) ident(mixins)operator(()symbol(:set_3)operator(\))operator(.)ident(rgt) operator(\)) - ident(assert_equal)operator(() integer(5)operator(,) ident(mixins)operator(()symbol(:set_2)operator(\))operator(.)ident(rgt) operator(\)) - ident(assert_equal)operator(() integer(6)operator(,) ident(mixins)operator(()symbol(:set_1)operator(\))operator(.)ident(rgt) operator(\)) - - ident(assert)operator(() ident(mixins)operator(()symbol(:set_1)operator(\))operator(.)ident(root?) operator(\)) - - reserved(begin) - ident(mixins)operator(()symbol(:set_4)operator(\))operator(.)ident(add_child)operator(() ident(mixins)operator(()symbol(:set_1)operator(\)) operator(\)) - ident(fail) - reserved(rescue) - reserved(end) - - ident(assert_equal)operator(() integer(2)operator(,) ident(mixins)operator(()symbol(:set_1)operator(\))operator(.)ident(all_children)operator(.)ident(length) operator(\)) - - ident(mixins)operator(()symbol(:set_1)operator(\))operator(.)ident(add_child) ident(mixins)operator(()symbol(:set_4)operator(\)) - - ident(assert_equal)operator(() integer(3)operator(,) ident(mixins)operator(()symbol(:set_1)operator(\))operator(.)ident(all_children)operator(.)ident(length) operator(\)) - - - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(ListTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:mixins) - - reserved(def) method(test_reordering) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_2)operator(\))operator(.)ident(move_lower) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_2)operator(\))operator(.)ident(move_higher) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_1)operator(\))operator(.)ident(move_to_bottom) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_4)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_1)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_1)operator(\))operator(.)ident(move_to_top) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - - ident(mixins)operator(()symbol(:list_2)operator(\))operator(.)ident(move_to_bottom) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_4)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_2)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_4)operator(\))operator(.)ident(move_to_top) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_4)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_2)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - reserved(end) - - reserved(def) method(test_move_to_bottom_with_next_to_last_item) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_3)operator(\))operator(.)ident(move_to_bottom) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_4)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_3)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_next_prev) - ident(assert_equal) ident(mixins)operator(()symbol(:list_2)operator(\))operator(,) ident(mixins)operator(()symbol(:list_1)operator(\))operator(.)ident(lower_item) - ident(assert_nil) ident(mixins)operator(()symbol(:list_1)operator(\))operator(.)ident(higher_item) - ident(assert_equal) ident(mixins)operator(()symbol(:list_3)operator(\))operator(,) ident(mixins)operator(()symbol(:list_4)operator(\))operator(.)ident(higher_item) - ident(assert_nil) ident(mixins)operator(()symbol(:list_4)operator(\))operator(.)ident(lower_item) - reserved(end) - - - reserved(def) method(test_injection) - ident(item) operator(=) constant(ListMixin)operator(.)ident(new)operator(()stringoperator(=)operator(>)integer(1)operator(\)) - ident(assert_equal) stringoperator(,) ident(item)operator(.)ident(scope_condition) - ident(assert_equal) stringoperator(,) ident(item)operator(.)ident(position_column) - reserved(end) - - reserved(def) method(test_insert) - ident(new) operator(=) constant(ListMixin)operator(.)ident(create)operator(()stringoperator(=)operator(>)integer(20)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(new)operator(.)ident(pos) - ident(assert) ident(new)operator(.)ident(first?) - ident(assert) ident(new)operator(.)ident(last?) - - ident(new) operator(=) constant(ListMixin)operator(.)ident(create)operator(()stringoperator(=)operator(>)integer(20)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(new)operator(.)ident(pos) - ident(assert) operator(!)ident(new)operator(.)ident(first?) - ident(assert) ident(new)operator(.)ident(last?) - - ident(new) operator(=) constant(ListMixin)operator(.)ident(create)operator(()stringoperator(=)operator(>)integer(20)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(new)operator(.)ident(pos) - ident(assert) operator(!)ident(new)operator(.)ident(first?) - ident(assert) ident(new)operator(.)ident(last?) - - ident(new) operator(=) constant(ListMixin)operator(.)ident(create)operator(()stringoperator(=)operator(>)integer(0)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(new)operator(.)ident(pos) - ident(assert) ident(new)operator(.)ident(first?) - ident(assert) ident(new)operator(.)ident(last?) - reserved(end) - - reserved(def) method(test_insert_at) - ident(new) operator(=) constant(ListMixin)operator(.)ident(create)operator(()string operator(=)operator(>) integer(20)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(new)operator(.)ident(pos) - - ident(new) operator(=) constant(ListMixin)operator(.)ident(create)operator(()string operator(=)operator(>) integer(20)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(new)operator(.)ident(pos) - - ident(new) operator(=) constant(ListMixin)operator(.)ident(create)operator(()string operator(=)operator(>) integer(20)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(new)operator(.)ident(pos) - - ident(new4) operator(=) constant(ListMixin)operator(.)ident(create)operator(()string operator(=)operator(>) integer(20)operator(\)) - ident(assert_equal) integer(4)operator(,) ident(new4)operator(.)ident(pos) - - ident(new4)operator(.)ident(insert_at)operator(()integer(3)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(new4)operator(.)ident(pos) - - ident(new)operator(.)ident(reload) - ident(assert_equal) integer(4)operator(,) ident(new)operator(.)ident(pos) - - ident(new)operator(.)ident(insert_at)operator(()integer(2)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(new)operator(.)ident(pos) - - ident(new4)operator(.)ident(reload) - ident(assert_equal) integer(4)operator(,) ident(new4)operator(.)ident(pos) - - ident(new5) operator(=) constant(ListMixin)operator(.)ident(create)operator(()string operator(=)operator(>) integer(20)operator(\)) - ident(assert_equal) integer(5)operator(,) ident(new5)operator(.)ident(pos) - - ident(new5)operator(.)ident(insert_at)operator(()integer(1)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(new5)operator(.)ident(pos) - - ident(new4)operator(.)ident(reload) - ident(assert_equal) integer(5)operator(,) ident(new4)operator(.)ident(pos) - reserved(end) - - reserved(def) method(test_delete_middle) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_2)operator(\))operator(.)ident(destroy) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_1)operator(,) symbol(:reload)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_3)operator(,) symbol(:reload)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_4)operator(,) symbol(:reload)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(assert_equal) integer(1)operator(,) ident(mixins)operator(()symbol(:list_1)operator(\))operator(.)ident(pos) - ident(assert_equal) integer(2)operator(,) ident(mixins)operator(()symbol(:list_3)operator(\))operator(.)ident(pos) - ident(assert_equal) integer(3)operator(,) ident(mixins)operator(()symbol(:list_4)operator(\))operator(.)ident(pos) - - ident(mixins)operator(()symbol(:list_1)operator(\))operator(.)ident(destroy) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_3)operator(,) symbol(:reload)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_4)operator(,) symbol(:reload)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(assert_equal) integer(1)operator(,) ident(mixins)operator(()symbol(:list_3)operator(\))operator(.)ident(pos) - ident(assert_equal) integer(2)operator(,) ident(mixins)operator(()symbol(:list_4)operator(\))operator(.)ident(pos) - - reserved(end) - - reserved(def) method(test_with_string_based_scope) - ident(new) operator(=) constant(ListWithStringScopeMixin)operator(.)ident(create)operator(()stringoperator(=)operator(>)integer(500)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(new)operator(.)ident(pos) - ident(assert) ident(new)operator(.)ident(first?) - ident(assert) ident(new)operator(.)ident(last?) - reserved(end) - - reserved(def) method(test_nil_scope) - ident(new1)operator(,) ident(new2)operator(,) ident(new3) operator(=) constant(ListMixin)operator(.)ident(create)operator(,) constant(ListMixin)operator(.)ident(create)operator(,) constant(ListMixin)operator(.)ident(create) - ident(new2)operator(.)ident(move_higher) - ident(assert_equal) operator([)ident(new2)operator(,) ident(new1)operator(,) ident(new3)operator(])operator(,) constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) - -reserved(end) - -reserved(class) class(TreeTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:mixins) - - reserved(def) method(test_has_child) - ident(assert_equal) pre_constant(true)operator(,) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(has_children?) - ident(assert_equal) pre_constant(true)operator(,) ident(mixins)operator(()symbol(:tree_2)operator(\))operator(.)ident(has_children?) - ident(assert_equal) pre_constant(false)operator(,) ident(mixins)operator(()symbol(:tree_3)operator(\))operator(.)ident(has_children?) - ident(assert_equal) pre_constant(false)operator(,) ident(mixins)operator(()symbol(:tree_4)operator(\))operator(.)ident(has_children?) - reserved(end) - - reserved(def) method(test_children) - ident(assert_equal) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(children)operator(,) operator([)ident(mixins)operator(()symbol(:tree_2)operator(\))operator(,) ident(mixins)operator(()symbol(:tree_4)operator(\))operator(]) - ident(assert_equal) ident(mixins)operator(()symbol(:tree_2)operator(\))operator(.)ident(children)operator(,) operator([)ident(mixins)operator(()symbol(:tree_3)operator(\))operator(]) - ident(assert_equal) ident(mixins)operator(()symbol(:tree_3)operator(\))operator(.)ident(children)operator(,) operator([)operator(]) - ident(assert_equal) ident(mixins)operator(()symbol(:tree_4)operator(\))operator(.)ident(children)operator(,) operator([)operator(]) - reserved(end) - - reserved(def) method(test_has_parent) - ident(assert_equal) pre_constant(false)operator(,) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(has_parent?) - ident(assert_equal) pre_constant(true)operator(,) ident(mixins)operator(()symbol(:tree_2)operator(\))operator(.)ident(has_parent?) - ident(assert_equal) pre_constant(true)operator(,) ident(mixins)operator(()symbol(:tree_3)operator(\))operator(.)ident(has_parent?) - ident(assert_equal) pre_constant(true)operator(,) ident(mixins)operator(()symbol(:tree_4)operator(\))operator(.)ident(has_parent?) - reserved(end) - - reserved(def) method(test_parent) - ident(assert_equal) ident(mixins)operator(()symbol(:tree_2)operator(\))operator(.)ident(parent)operator(,) ident(mixins)operator(()symbol(:tree_1)operator(\)) - ident(assert_equal) ident(mixins)operator(()symbol(:tree_2)operator(\))operator(.)ident(parent)operator(,) ident(mixins)operator(()symbol(:tree_4)operator(\))operator(.)ident(parent) - ident(assert_nil) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(parent) - reserved(end) - - reserved(def) method(test_delete) - ident(assert_equal) integer(6)operator(,) constant(TreeMixin)operator(.)ident(count) - ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(destroy) - ident(assert_equal) integer(2)operator(,) constant(TreeMixin)operator(.)ident(count) - ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(.)ident(destroy) - ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(.)ident(destroy) - ident(assert_equal) integer(0)operator(,) constant(TreeMixin)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_insert) - instance_variable(@extra) operator(=) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(children)operator(.)ident(create) - - ident(assert) instance_variable(@extra) - - ident(assert_equal) instance_variable(@extra)operator(.)ident(parent)operator(,) ident(mixins)operator(()symbol(:tree_1)operator(\)) - - ident(assert_equal) integer(3)operator(,) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(children)operator(.)ident(size) - ident(assert) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(children)operator(.)ident(include?)operator(()instance_variable(@extra)operator(\)) - ident(assert) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(children)operator(.)ident(include?)operator(()ident(mixins)operator(()symbol(:tree_2)operator(\))operator(\)) - ident(assert) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(children)operator(.)ident(include?)operator(()ident(mixins)operator(()symbol(:tree_4)operator(\))operator(\)) - reserved(end) - - reserved(def) method(test_ancestors) - ident(assert_equal) operator([)operator(])operator(,) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(ancestors) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_1)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree_2)operator(\))operator(.)ident(ancestors) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_2)operator(\))operator(,) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree_3)operator(\))operator(.)ident(ancestors) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_1)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree_4)operator(\))operator(.)ident(ancestors) - ident(assert_equal) operator([)operator(])operator(,) ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(.)ident(ancestors) - ident(assert_equal) operator([)operator(])operator(,) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(.)ident(ancestors) - reserved(end) - - reserved(def) method(test_root) - ident(assert_equal) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) constant(TreeMixin)operator(.)ident(root) - ident(assert_equal) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(root) - ident(assert_equal) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree_2)operator(\))operator(.)ident(root) - ident(assert_equal) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree_3)operator(\))operator(.)ident(root) - ident(assert_equal) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree_4)operator(\))operator(.)ident(root) - ident(assert_equal) ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(.)ident(root) - ident(assert_equal) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(.)ident(root) - reserved(end) - - reserved(def) method(test_roots) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(])operator(,) constant(TreeMixin)operator(.)ident(roots) - reserved(end) - - reserved(def) method(test_siblings) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(siblings) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_4)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree_2)operator(\))operator(.)ident(siblings) - ident(assert_equal) operator([)operator(])operator(,) ident(mixins)operator(()symbol(:tree_3)operator(\))operator(.)ident(siblings) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_2)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree_4)operator(\))operator(.)ident(siblings) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(.)ident(siblings) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(.)ident(siblings) - reserved(end) - - reserved(def) method(test_self_and_siblings) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(self_and_siblings) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_2)operator(\))operator(,) ident(mixins)operator(()symbol(:tree_4)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree_2)operator(\))operator(.)ident(self_and_siblings) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_3)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree_3)operator(\))operator(.)ident(self_and_siblings) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_2)operator(\))operator(,) ident(mixins)operator(()symbol(:tree_4)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree_4)operator(\))operator(.)ident(self_and_siblings) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(.)ident(self_and_siblings) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:tree_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree2_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(])operator(,) ident(mixins)operator(()symbol(:tree3_1)operator(\))operator(.)ident(self_and_siblings) - reserved(end) -reserved(end) - -reserved(class) class(TreeTestWithoutOrder) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:mixins) - - reserved(def) method(test_root) - ident(assert) operator([)ident(mixins)operator(()symbol(:tree_without_order_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree_without_order_2)operator(\))operator(])operator(.)ident(include?)operator(()constant(TreeMixinWithoutOrder)operator(.)ident(root)operator(\)) - reserved(end) - - reserved(def) method(test_roots) - ident(assert_equal) operator([)operator(])operator(,) operator([)ident(mixins)operator(()symbol(:tree_without_order_1)operator(\))operator(,) ident(mixins)operator(()symbol(:tree_without_order_2)operator(\))operator(]) operator(-) constant(TreeMixinWithoutOrder)operator(.)ident(roots) - reserved(end) -reserved(end) - -reserved(class) class(TouchTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:mixins) - - reserved(def) method(test_update) - ident(stamped) operator(=) constant(Mixin)operator(.)ident(new) - - ident(assert_nil) ident(stamped)operator(.)ident(updated_at) - ident(assert_nil) ident(stamped)operator(.)ident(created_at) - ident(stamped)operator(.)ident(save) - ident(assert_not_nil) ident(stamped)operator(.)ident(updated_at) - ident(assert_not_nil) ident(stamped)operator(.)ident(created_at) - reserved(end) - - reserved(def) method(test_create) - instance_variable(@obj) operator(=) constant(Mixin)operator(.)ident(create) - ident(assert_not_nil) instance_variable(@obj)operator(.)ident(updated_at) - ident(assert_not_nil) instance_variable(@obj)operator(.)ident(created_at) - reserved(end) - - reserved(def) method(test_many_updates) - ident(stamped) operator(=) constant(Mixin)operator(.)ident(new) - - ident(assert_nil) ident(stamped)operator(.)ident(updated_at) - ident(assert_nil) ident(stamped)operator(.)ident(created_at) - ident(stamped)operator(.)ident(save) - ident(assert_not_nil) ident(stamped)operator(.)ident(created_at) - ident(assert_not_nil) ident(stamped)operator(.)ident(updated_at) - - ident(old_updated_at) operator(=) ident(stamped)operator(.)ident(updated_at) - - ident(sleep) integer(1) - ident(stamped)operator(.)ident(save) - ident(assert_not_equal) ident(stamped)operator(.)ident(created_at)operator(,) ident(stamped)operator(.)ident(updated_at) - ident(assert_not_equal) ident(old_updated_at)operator(,) ident(stamped)operator(.)ident(updated_at) - - reserved(end) - - reserved(def) method(test_create_turned_off) - constant(Mixin)operator(.)ident(record_timestamps) operator(=) pre_constant(false) - - ident(assert_nil) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(updated_at) - ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(save) - ident(assert_nil) ident(mixins)operator(()symbol(:tree_1)operator(\))operator(.)ident(updated_at) - - constant(Mixin)operator(.)ident(record_timestamps) operator(=) pre_constant(true) - reserved(end) - -reserved(end) - - -reserved(class) class(ListSubTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:mixins) - - reserved(def) method(test_reordering) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(.)ident(move_lower) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(.)ident(move_higher) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(.)ident(move_to_bottom) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(.)ident(move_to_top) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(.)ident(move_to_bottom) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(.)ident(move_to_top) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - reserved(end) - - reserved(def) method(test_move_to_bottom_with_next_to_last_item) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(.)ident(move_to_bottom) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - reserved(end) - - reserved(def) method(test_next_prev) - ident(assert_equal) ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(,) ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(.)ident(lower_item) - ident(assert_nil) ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(.)ident(higher_item) - ident(assert_equal) ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(,) ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(.)ident(higher_item) - ident(assert_nil) ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(.)ident(lower_item) - reserved(end) - - - reserved(def) method(test_injection) - ident(item) operator(=) constant(ListMixin)operator(.)ident(new)operator(()stringoperator(=)operator(>)integer(1)operator(\)) - ident(assert_equal) stringoperator(,) ident(item)operator(.)ident(scope_condition) - ident(assert_equal) stringoperator(,) ident(item)operator(.)ident(position_column) - reserved(end) - - - reserved(def) method(test_insert_at) - ident(new) operator(=) constant(ListMixin)operator(.)ident(create)operator(()string operator(=)operator(>) integer(20)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(new)operator(.)ident(pos) - - ident(new) operator(=) constant(ListMixinSub1)operator(.)ident(create)operator(()string operator(=)operator(>) integer(20)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(new)operator(.)ident(pos) - - ident(new) operator(=) constant(ListMixinSub2)operator(.)ident(create)operator(()string operator(=)operator(>) integer(20)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(new)operator(.)ident(pos) - - ident(new4) operator(=) constant(ListMixin)operator(.)ident(create)operator(()string operator(=)operator(>) integer(20)operator(\)) - ident(assert_equal) integer(4)operator(,) ident(new4)operator(.)ident(pos) - - ident(new4)operator(.)ident(insert_at)operator(()integer(3)operator(\)) - ident(assert_equal) integer(3)operator(,) ident(new4)operator(.)ident(pos) - - ident(new)operator(.)ident(reload) - ident(assert_equal) integer(4)operator(,) ident(new)operator(.)ident(pos) - - ident(new)operator(.)ident(insert_at)operator(()integer(2)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(new)operator(.)ident(pos) - - ident(new4)operator(.)ident(reload) - ident(assert_equal) integer(4)operator(,) ident(new4)operator(.)ident(pos) - - ident(new5) operator(=) constant(ListMixinSub1)operator(.)ident(create)operator(()string operator(=)operator(>) integer(20)operator(\)) - ident(assert_equal) integer(5)operator(,) ident(new5)operator(.)ident(pos) - - ident(new5)operator(.)ident(insert_at)operator(()integer(1)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(new5)operator(.)ident(pos) - - ident(new4)operator(.)ident(reload) - ident(assert_equal) integer(5)operator(,) ident(new4)operator(.)ident(pos) - reserved(end) - - reserved(def) method(test_delete_middle) - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(mixins)operator(()symbol(:list_sub_2)operator(\))operator(.)ident(destroy) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_1)operator(,) symbol(:reload)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_3)operator(,) symbol(:reload)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_4)operator(,) symbol(:reload)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(assert_equal) integer(1)operator(,) ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(.)ident(pos) - ident(assert_equal) integer(2)operator(,) ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(.)ident(pos) - ident(assert_equal) integer(3)operator(,) ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(.)ident(pos) - - ident(mixins)operator(()symbol(:list_sub_1)operator(\))operator(.)ident(destroy) - - ident(assert_equal) operator([)ident(mixins)operator(()symbol(:list_sub_3)operator(,) symbol(:reload)operator(\))operator(,) - ident(mixins)operator(()symbol(:list_sub_4)operator(,) symbol(:reload)operator(\))operator(])operator(,) - constant(ListMixin)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:conditions) operator(=)operator(>) stringoperator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - - ident(assert_equal) integer(1)operator(,) ident(mixins)operator(()symbol(:list_sub_3)operator(\))operator(.)ident(pos) - ident(assert_equal) integer(2)operator(,) ident(mixins)operator(()symbol(:list_sub_4)operator(\))operator(.)ident(pos) - - reserved(end) - -reserved(end) - -ident(require) string -ident(require) string - -reserved(class) class(ModulesTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:accounts)operator(,) symbol(:companies)operator(,) symbol(:projects)operator(,) symbol(:developers) - - reserved(def) method(test_module_spanning_associations) - ident(assert) constant(MyApplication)operator(::)constant(Business)operator(::)constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\))operator(.)ident(has_clients?)operator(,) string - ident(firm) operator(=) constant(MyApplication)operator(::)constant(Business)operator(::)constant(Firm)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(assert_nil) ident(firm)operator(.)ident(class)operator(.)ident(table_name)operator(.)ident(match)operator(()stringoperator(\))operator(,) string - ident(assert_equal) integer(2)operator(,) ident(firm)operator(.)ident(clients_count)operator(,) string - reserved(end) - - reserved(def) method(test_module_spanning_has_and_belongs_to_many_associations) - ident(project) operator(=) constant(MyApplication)operator(::)constant(Business)operator(::)constant(Project)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(project)operator(.)ident(developers) operator(<<) constant(MyApplication)operator(::)constant(Business)operator(::)constant(Developer)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) stringoperator(,) ident(project)operator(.)ident(developers)operator(.)ident(last)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_associations_spanning_cross_modules) - ident(account) operator(=) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Account)operator(.)ident(find)operator(()symbol(:first)operator(,) symbol(:order) operator(=)operator(>) stringoperator(\)) - ident(assert_kind_of) constant(MyApplication)operator(::)constant(Business)operator(::)constant(Firm)operator(,) ident(account)operator(.)ident(firm) - ident(assert_kind_of) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Firm)operator(,) ident(account)operator(.)ident(qualified_billing_firm) - ident(assert_kind_of) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Firm)operator(,) ident(account)operator(.)ident(unqualified_billing_firm) - ident(assert_kind_of) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Nested)operator(::)constant(Firm)operator(,) ident(account)operator(.)ident(nested_qualified_billing_firm) - ident(assert_kind_of) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Nested)operator(::)constant(Firm)operator(,) ident(account)operator(.)ident(nested_unqualified_billing_firm) - reserved(end) -reserved(end) -ident(require) string -ident(require) string - -comment(# So we can test whether Course.connection survives a reload.) -ident(require_dependency) string - -reserved(class) class(MultipleDbTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(false) - - reserved(def) method(setup) - instance_variable(@courses) operator(=) ident(create_fixtures)operator(()stringoperator(\)) operator({) constant(Course)operator(.)ident(retrieve_connection) operator(}) - instance_variable(@entrants) operator(=) ident(create_fixtures)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(test_connected) - ident(assert_not_nil) constant(Entrant)operator(.)ident(connection) - ident(assert_not_nil) constant(Course)operator(.)ident(connection) - reserved(end) - - reserved(def) method(test_proper_connection) - ident(assert_not_equal)operator(()constant(Entrant)operator(.)ident(connection)operator(,) constant(Course)operator(.)ident(connection)operator(\)) - ident(assert_equal)operator(()constant(Entrant)operator(.)ident(connection)operator(,) constant(Entrant)operator(.)ident(retrieve_connection)operator(\)) - ident(assert_equal)operator(()constant(Course)operator(.)ident(connection)operator(,) constant(Course)operator(.)ident(retrieve_connection)operator(\)) - ident(assert_equal)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(,) constant(Entrant)operator(.)ident(connection)operator(\)) - reserved(end) - - reserved(def) method(test_find) - ident(c1) operator(=) constant(Course)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) stringoperator(,) ident(c1)operator(.)ident(name) - ident(c2) operator(=) constant(Course)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(assert_equal) stringoperator(,) ident(c2)operator(.)ident(name) - ident(e1) operator(=) constant(Entrant)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) stringoperator(,) ident(e1)operator(.)ident(name) - ident(e2) operator(=) constant(Entrant)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(assert_equal) stringoperator(,) ident(e2)operator(.)ident(name) - ident(e3) operator(=) constant(Entrant)operator(.)ident(find)operator(()integer(3)operator(\)) - ident(assert_equal) stringoperator(,) ident(e3)operator(.)ident(name) - reserved(end) - - reserved(def) method(test_associations) - ident(c1) operator(=) constant(Course)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) integer(2)operator(,) ident(c1)operator(.)ident(entrants_count) - ident(e1) operator(=) constant(Entrant)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) ident(e1)operator(.)ident(course)operator(.)ident(id)operator(,) ident(c1)operator(.)ident(id) - ident(c2) operator(=) constant(Course)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(c2)operator(.)ident(entrants_count) - ident(e3) operator(=) constant(Entrant)operator(.)ident(find)operator(()integer(3)operator(\)) - ident(assert_equal) ident(e3)operator(.)ident(course)operator(.)ident(id)operator(,) ident(c2)operator(.)ident(id) - reserved(end) - - reserved(def) method(test_course_connection_should_survive_dependency_reload) - ident(assert) constant(Course)operator(.)ident(connection) - - constant(Dependencies)operator(.)ident(clear) - constant(Object)operator(.)ident(send)operator(()symbol(:remove_const)operator(,) symbol(:Course)operator(\)) - ident(require_dependency) string - - ident(assert) constant(Course)operator(.)ident(connection) - reserved(end) -reserved(end) -ident(require) stringcontent(/abstract_unit)delimiter(")> -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(PrimaryKeysTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:topics)operator(,) symbol(:subscribers)operator(,) symbol(:movies) - - reserved(def) method(test_integer_key) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal)operator(()ident(topics)operator(()symbol(:first)operator(\))operator(.)ident(author_name)operator(,) ident(topic)operator(.)ident(author_name)operator(\)) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\)) - ident(assert_equal)operator(()ident(topics)operator(()symbol(:second)operator(\))operator(.)ident(author_name)operator(,) ident(topic)operator(.)ident(author_name)operator(\)) - - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(topic)operator(.)ident(title) operator(=) string - ident(assert_equal)operator(()pre_constant(nil)operator(,) ident(topic)operator(.)ident(id)operator(\)) - ident(assert_nothing_raised) operator({) ident(topic)operator(.)ident(save!) operator(}) - ident(id) operator(=) ident(topic)operator(.)ident(id) - - ident(topicReloaded) operator(=) constant(Topic)operator(.)ident(find)operator(()ident(id)operator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(topicReloaded)operator(.)ident(title)operator(\)) - reserved(end) - - reserved(def) method(test_customized_primary_key_auto_assigns_on_save) - constant(Keyboard)operator(.)ident(delete_all) - ident(keyboard) operator(=) constant(Keyboard)operator(.)ident(new)operator(()symbol(:name) operator(=)operator(>) stringoperator(\)) - ident(assert_nothing_raised) operator({) ident(keyboard)operator(.)ident(save!) operator(}) - ident(assert_equal) ident(keyboard)operator(.)ident(id)operator(,) constant(Keyboard)operator(.)ident(find_by_name)operator(()stringoperator(\))operator(.)ident(id) - reserved(end) - - reserved(def) method(test_customized_primary_key_can_be_get_before_saving) - ident(keyboard) operator(=) constant(Keyboard)operator(.)ident(new) - ident(assert_nil) ident(keyboard)operator(.)ident(id) - ident(assert_nothing_raised) operator({) ident(assert_nil) ident(keyboard)operator(.)ident(key_number) operator(}) - reserved(end) - - reserved(def) method(test_customized_string_primary_key_settable_before_save) - ident(subscriber) operator(=) constant(Subscriber)operator(.)ident(new) - ident(assert_nothing_raised) operator({) ident(subscriber)operator(.)ident(id) operator(=) string operator(}) - ident(assert_equal) stringoperator(,) ident(subscriber)operator(.)ident(id) - ident(assert_equal) stringoperator(,) ident(subscriber)operator(.)ident(nick) - reserved(end) - - reserved(def) method(test_string_key) - ident(subscriber) operator(=) constant(Subscriber)operator(.)ident(find)operator(()ident(subscribers)operator(()symbol(:first)operator(\))operator(.)ident(nick)operator(\)) - ident(assert_equal)operator(()ident(subscribers)operator(()symbol(:first)operator(\))operator(.)ident(name)operator(,) ident(subscriber)operator(.)ident(name)operator(\)) - ident(subscriber) operator(=) constant(Subscriber)operator(.)ident(find)operator(()ident(subscribers)operator(()symbol(:second)operator(\))operator(.)ident(nick)operator(\)) - ident(assert_equal)operator(()ident(subscribers)operator(()symbol(:second)operator(\))operator(.)ident(name)operator(,) ident(subscriber)operator(.)ident(name)operator(\)) - - ident(subscriber) operator(=) constant(Subscriber)operator(.)ident(new) - ident(subscriber)operator(.)ident(id) operator(=) string - ident(assert_equal)operator(()stringoperator(,) ident(subscriber)operator(.)ident(id)operator(\)) - ident(subscriber)operator(.)ident(name) operator(=) string - ident(assert_nothing_raised) operator({) ident(subscriber)operator(.)ident(save!) operator(}) - ident(assert_equal)operator(()stringoperator(,) ident(subscriber)operator(.)ident(id)operator(\)) - - ident(subscriberReloaded) operator(=) constant(Subscriber)operator(.)ident(find)operator(()stringoperator(\)) - ident(assert_equal)operator(()stringoperator(,) ident(subscriberReloaded)operator(.)ident(name)operator(\)) - reserved(end) - - reserved(def) method(test_find_with_more_than_one_string_key) - ident(assert_equal) integer(2)operator(,) constant(Subscriber)operator(.)ident(find)operator(()ident(subscribers)operator(()symbol(:first)operator(\))operator(.)ident(nick)operator(,) ident(subscribers)operator(()symbol(:second)operator(\))operator(.)ident(nick)operator(\))operator(.)ident(length) - reserved(end) - - reserved(def) method(test_primary_key_prefix) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(primary_key_prefix_type) operator(=) symbol(:table_name) - constant(Topic)operator(.)ident(reset_primary_key) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(primary_key) - - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(primary_key_prefix_type) operator(=) symbol(:table_name_with_underscore) - constant(Topic)operator(.)ident(reset_primary_key) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(primary_key) - - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(primary_key_prefix_type) operator(=) pre_constant(nil) - constant(Topic)operator(.)ident(reset_primary_key) - ident(assert_equal) stringoperator(,) constant(Topic)operator(.)ident(primary_key) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -comment(# Dummy class methods to test implicit association scoping.) -reserved(def) constant(Comment)operator(.)method(foo)operator(()operator(\)) ident(find) symbol(:first) reserved(end) -reserved(def) constant(Project)operator(.)method(foo)operator(()operator(\)) ident(find) symbol(:first) reserved(end) - - -reserved(class) class(ReadOnlyTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:posts)operator(,) symbol(:comments)operator(,) symbol(:developers)operator(,) symbol(:projects)operator(,) symbol(:developers_projects) - - reserved(def) method(test_cant_save_readonly_record) - ident(dev) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) operator(!)ident(dev)operator(.)ident(readonly?) - - ident(dev)operator(.)ident(readonly!) - ident(assert) ident(dev)operator(.)ident(readonly?) - - ident(assert_nothing_raised) reserved(do) - ident(dev)operator(.)ident(name) operator(=) string - ident(assert) operator(!)ident(dev)operator(.)ident(save) - ident(dev)operator(.)ident(name) operator(=) string - reserved(end) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(ReadOnlyRecord)operator(\)) operator({) ident(dev)operator(.)ident(save) operator(}) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(ReadOnlyRecord)operator(\)) operator({) ident(dev)operator(.)ident(save!) operator(}) - reserved(end) - - - reserved(def) method(test_find_with_readonly_option) - constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(each) operator({) operator(|)ident(d)operator(|) ident(assert) operator(!)ident(d)operator(.)ident(readonly?) operator(}) - constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(false)operator(\))operator(.)ident(each) operator({) operator(|)ident(d)operator(|) ident(assert) operator(!)ident(d)operator(.)ident(readonly?) operator(}) - constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(true)operator(\))operator(.)ident(each) operator({) operator(|)ident(d)operator(|) ident(assert) ident(d)operator(.)ident(readonly?) operator(}) - reserved(end) - - - reserved(def) method(test_find_with_joins_option_implies_readonly) - comment(# Blank joins don't count.) - constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:joins) operator(=)operator(>) stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(d)operator(|) ident(assert) operator(!)ident(d)operator(.)ident(readonly?) operator(}) - constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:joins) operator(=)operator(>) stringoperator(,) symbol(:readonly) operator(=)operator(>) pre_constant(false)operator(\))operator(.)ident(each) operator({) operator(|)ident(d)operator(|) ident(assert) operator(!)ident(d)operator(.)ident(readonly?) operator(}) - - comment(# Others do.) - constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:joins) operator(=)operator(>) stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(d)operator(|) ident(assert) ident(d)operator(.)ident(readonly?) operator(}) - constant(Developer)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:joins) operator(=)operator(>) stringoperator(,) symbol(:readonly) operator(=)operator(>) pre_constant(false)operator(\))operator(.)ident(each) operator({) operator(|)ident(d)operator(|) ident(assert) operator(!)ident(d)operator(.)ident(readonly?) operator(}) - reserved(end) - - - reserved(def) method(test_habtm_find_readonly) - ident(dev) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) operator(!)ident(dev)operator(.)ident(projects)operator(.)ident(empty?) - ident(assert) ident(dev)operator(.)ident(projects)operator(.)ident(all?)operator(()operator(&)symbol(:readonly?)operator(\)) - ident(assert) ident(dev)operator(.)ident(projects)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(all?)operator(()operator(&)symbol(:readonly?)operator(\)) - ident(assert) ident(dev)operator(.)ident(projects)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(true)operator(\))operator(.)ident(all?)operator(()operator(&)symbol(:readonly?)operator(\)) - reserved(end) - - reserved(def) method(test_has_many_find_readonly) - ident(post) operator(=) constant(Post)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert) operator(!)ident(post)operator(.)ident(comments)operator(.)ident(empty?) - ident(assert) operator(!)ident(post)operator(.)ident(comments)operator(.)ident(any?)operator(()operator(&)symbol(:readonly?)operator(\)) - ident(assert) operator(!)ident(post)operator(.)ident(comments)operator(.)ident(find)operator(()symbol(:all)operator(\))operator(.)ident(any?)operator(()operator(&)symbol(:readonly?)operator(\)) - ident(assert) ident(post)operator(.)ident(comments)operator(.)ident(find)operator(()symbol(:all)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(true)operator(\))operator(.)ident(all?)operator(()operator(&)symbol(:readonly?)operator(\)) - reserved(end) - - reserved(def) method(test_has_many_with_through_is_not_implicitly_marked_readonly) - ident(assert) ident(people) operator(=) constant(Post)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(people) - ident(assert) operator(!)ident(people)operator(.)ident(any?)operator(()operator(&)symbol(:readonly?)operator(\)) - reserved(end) - - reserved(def) method(test_readonly_scoping) - constant(Post)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:conditions) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert) operator(!)constant(Post)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(readonly?) - ident(assert) constant(Post)operator(.)ident(find)operator(()integer(1)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(true)operator(\))operator(.)ident(readonly?) - ident(assert) operator(!)constant(Post)operator(.)ident(find)operator(()integer(1)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(false)operator(\))operator(.)ident(readonly?) - reserved(end) - - constant(Post)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:joins) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert) operator(!)constant(Post)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(readonly?) - ident(assert) constant(Post)operator(.)ident(find)operator(()integer(1)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(true)operator(\))operator(.)ident(readonly?) - ident(assert) operator(!)constant(Post)operator(.)ident(find)operator(()integer(1)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(false)operator(\))operator(.)ident(readonly?) - reserved(end) - - comment(# Oracle barfs on this because the join includes unqualified and) - comment(# conflicting column names) - reserved(unless) ident(current_adapter?)operator(()symbol(:OracleAdapter)operator(\)) - constant(Post)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:joins) operator(=)operator(>) string operator(})operator(\)) reserved(do) - ident(assert) constant(Post)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(readonly?) - ident(assert) constant(Post)operator(.)ident(find)operator(()integer(1)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(true)operator(\))operator(.)ident(readonly?) - ident(assert) operator(!)constant(Post)operator(.)ident(find)operator(()integer(1)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(false)operator(\))operator(.)ident(readonly?) - reserved(end) - reserved(end) - - constant(Post)operator(.)ident(with_scope)operator(()symbol(:find) operator(=)operator(>) operator({) symbol(:readonly) operator(=)operator(>) pre_constant(true) operator(})operator(\)) reserved(do) - ident(assert) constant(Post)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(readonly?) - ident(assert) constant(Post)operator(.)ident(find)operator(()integer(1)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(true)operator(\))operator(.)ident(readonly?) - ident(assert) operator(!)constant(Post)operator(.)ident(find)operator(()integer(1)operator(,) symbol(:readonly) operator(=)operator(>) pre_constant(false)operator(\))operator(.)ident(readonly?) - reserved(end) - reserved(end) - - reserved(def) method(test_association_collection_method_missing_scoping_not_readonly) - ident(assert) operator(!)constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(projects)operator(.)ident(foo)operator(.)ident(readonly?) - ident(assert) operator(!)constant(Post)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(comments)operator(.)ident(foo)operator(.)ident(readonly?) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(ReflectionTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:topics)operator(,) symbol(:customers)operator(,) symbol(:companies)operator(,) symbol(:subscribers) - - reserved(def) method(setup) - instance_variable(@first) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\)) - reserved(end) - - reserved(def) method(test_column_null_not_null) - ident(subscriber) operator(=) constant(Subscriber)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(assert) ident(subscriber)operator(.)ident(column_for_attribute)operator(()stringoperator(\))operator(.)ident(null) - ident(assert) operator(!)ident(subscriber)operator(.)ident(column_for_attribute)operator(()stringoperator(\))operator(.)ident(null) - reserved(end) - - reserved(def) method(test_read_attribute_names) - ident(assert_equal)operator(() - stringoperator(.)ident(sort)operator(,) - instance_variable(@first)operator(.)ident(attribute_names) - operator(\)) - reserved(end) - - reserved(def) method(test_columns) - ident(assert_equal) integer(12)operator(,) constant(Topic)operator(.)ident(columns)operator(.)ident(length) - reserved(end) - - reserved(def) method(test_columns_are_returned_in_the_order_they_were_declared) - ident(column_names) operator(=) constant(Topic)operator(.)ident(columns)operator(.)ident(map) operator({) operator(|)ident(column)operator(|) ident(column)operator(.)ident(name) operator(}) - ident(assert_equal) stringoperator(,) ident(column_names) - reserved(end) - - reserved(def) method(test_content_columns) - ident(content_columns) operator(=) constant(Topic)operator(.)ident(content_columns) - ident(content_column_names) operator(=) ident(content_columns)operator(.)ident(map) operator({)operator(|)ident(column)operator(|) ident(column)operator(.)ident(name)operator(}) - ident(assert_equal) integer(8)operator(,) ident(content_columns)operator(.)ident(length) - ident(assert_equal) stringoperator(.)ident(sort)operator(,) ident(content_column_names)operator(.)ident(sort) - reserved(end) - - reserved(def) method(test_column_string_type_and_limit) - ident(assert_equal) symbol(:string)operator(,) instance_variable(@first)operator(.)ident(column_for_attribute)operator(()stringoperator(\))operator(.)ident(type) - ident(assert_equal) integer(255)operator(,) instance_variable(@first)operator(.)ident(column_for_attribute)operator(()stringoperator(\))operator(.)ident(limit) - reserved(end) - - reserved(def) method(test_human_name_for_column) - ident(assert_equal) stringoperator(,) instance_variable(@first)operator(.)ident(column_for_attribute)operator(()stringoperator(\))operator(.)ident(human_name) - reserved(end) - - reserved(def) method(test_integer_columns) - ident(assert_equal) symbol(:integer)operator(,) instance_variable(@first)operator(.)ident(column_for_attribute)operator(()stringoperator(\))operator(.)ident(type) - reserved(end) - - reserved(def) method(test_aggregation_reflection) - ident(reflection_for_address) operator(=) constant(ActiveRecord)operator(::)constant(Reflection)operator(::)constant(AggregateReflection)operator(.)ident(new)operator(() - symbol(:composed_of)operator(,) symbol(:address)operator(,) operator({) symbol(:mapping) operator(=)operator(>) operator([) stringoperator(,) stringoperator(,) string operator(]) operator(})operator(,) constant(Customer) - operator(\)) - - ident(reflection_for_balance) operator(=) constant(ActiveRecord)operator(::)constant(Reflection)operator(::)constant(AggregateReflection)operator(.)ident(new)operator(() - symbol(:composed_of)operator(,) symbol(:balance)operator(,) operator({) symbol(:class_name) operator(=)operator(>) stringoperator(,) symbol(:mapping) operator(=)operator(>) string operator(})operator(,) constant(Customer) - operator(\)) - - ident(reflection_for_gps_location) operator(=) constant(ActiveRecord)operator(::)constant(Reflection)operator(::)constant(AggregateReflection)operator(.)ident(new)operator(() - symbol(:composed_of)operator(,) symbol(:gps_location)operator(,) operator({) operator(})operator(,) constant(Customer) - operator(\)) - - ident(assert) constant(Customer)operator(.)ident(reflect_on_all_aggregations)operator(.)ident(include?)operator(()ident(reflection_for_gps_location)operator(\)) - ident(assert) constant(Customer)operator(.)ident(reflect_on_all_aggregations)operator(.)ident(include?)operator(()ident(reflection_for_balance)operator(\)) - ident(assert) constant(Customer)operator(.)ident(reflect_on_all_aggregations)operator(.)ident(include?)operator(()ident(reflection_for_address)operator(\)) - - ident(assert_equal) ident(reflection_for_address)operator(,) constant(Customer)operator(.)ident(reflect_on_aggregation)operator(()symbol(:address)operator(\)) - - ident(assert_equal) constant(Address)operator(,) constant(Customer)operator(.)ident(reflect_on_aggregation)operator(()symbol(:address)operator(\))operator(.)ident(klass) - - ident(assert_equal) constant(Money)operator(,) constant(Customer)operator(.)ident(reflect_on_aggregation)operator(()symbol(:balance)operator(\))operator(.)ident(klass) - reserved(end) - - reserved(def) method(test_has_many_reflection) - ident(reflection_for_clients) operator(=) constant(ActiveRecord)operator(::)constant(Reflection)operator(::)constant(AssociationReflection)operator(.)ident(new)operator(()symbol(:has_many)operator(,) symbol(:clients)operator(,) operator({) symbol(:order) operator(=)operator(>) stringoperator(,) symbol(:dependent) operator(=)operator(>) symbol(:destroy) operator(})operator(,) constant(Firm)operator(\)) - - ident(assert_equal) ident(reflection_for_clients)operator(,) constant(Firm)operator(.)ident(reflect_on_association)operator(()symbol(:clients)operator(\)) - - ident(assert_equal) constant(Client)operator(,) constant(Firm)operator(.)ident(reflect_on_association)operator(()symbol(:clients)operator(\))operator(.)ident(klass) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(reflect_on_association)operator(()symbol(:clients)operator(\))operator(.)ident(table_name) - - ident(assert_equal) constant(Client)operator(,) constant(Firm)operator(.)ident(reflect_on_association)operator(()symbol(:clients_of_firm)operator(\))operator(.)ident(klass) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(reflect_on_association)operator(()symbol(:clients_of_firm)operator(\))operator(.)ident(table_name) - reserved(end) - - reserved(def) method(test_has_one_reflection) - ident(reflection_for_account) operator(=) constant(ActiveRecord)operator(::)constant(Reflection)operator(::)constant(AssociationReflection)operator(.)ident(new)operator(()symbol(:has_one)operator(,) symbol(:account)operator(,) operator({) symbol(:foreign_key) operator(=)operator(>) stringoperator(,) symbol(:dependent) operator(=)operator(>) symbol(:destroy) operator(})operator(,) constant(Firm)operator(\)) - ident(assert_equal) ident(reflection_for_account)operator(,) constant(Firm)operator(.)ident(reflect_on_association)operator(()symbol(:account)operator(\)) - - ident(assert_equal) constant(Account)operator(,) constant(Firm)operator(.)ident(reflect_on_association)operator(()symbol(:account)operator(\))operator(.)ident(klass) - ident(assert_equal) stringoperator(,) constant(Firm)operator(.)ident(reflect_on_association)operator(()symbol(:account)operator(\))operator(.)ident(table_name) - reserved(end) - - reserved(def) method(test_association_reflection_in_modules) - ident(assert_reflection) constant(MyApplication)operator(::)constant(Business)operator(::)constant(Firm)operator(,) - symbol(:clients_of_firm)operator(,) - symbol(:klass) operator(=)operator(>) constant(MyApplication)operator(::)constant(Business)operator(::)constant(Client)operator(,) - symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:table_name) operator(=)operator(>) string - - ident(assert_reflection) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Account)operator(,) - symbol(:firm)operator(,) - symbol(:klass) operator(=)operator(>) constant(MyApplication)operator(::)constant(Business)operator(::)constant(Firm)operator(,) - symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:table_name) operator(=)operator(>) string - - ident(assert_reflection) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Account)operator(,) - symbol(:qualified_billing_firm)operator(,) - symbol(:klass) operator(=)operator(>) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Firm)operator(,) - symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:table_name) operator(=)operator(>) string - - ident(assert_reflection) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Account)operator(,) - symbol(:unqualified_billing_firm)operator(,) - symbol(:klass) operator(=)operator(>) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Firm)operator(,) - symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:table_name) operator(=)operator(>) string - - ident(assert_reflection) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Account)operator(,) - symbol(:nested_qualified_billing_firm)operator(,) - symbol(:klass) operator(=)operator(>) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Nested)operator(::)constant(Firm)operator(,) - symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:table_name) operator(=)operator(>) string - - ident(assert_reflection) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Account)operator(,) - symbol(:nested_unqualified_billing_firm)operator(,) - symbol(:klass) operator(=)operator(>) constant(MyApplication)operator(::)constant(Billing)operator(::)constant(Nested)operator(::)constant(Firm)operator(,) - symbol(:class_name) operator(=)operator(>) stringoperator(,) - symbol(:table_name) operator(=)operator(>) string - reserved(end) - - reserved(def) method(test_reflection_of_all_associations) - ident(assert_equal) integer(13)operator(,) constant(Firm)operator(.)ident(reflect_on_all_associations)operator(.)ident(size) - ident(assert_equal) integer(11)operator(,) constant(Firm)operator(.)ident(reflect_on_all_associations)operator(()symbol(:has_many)operator(\))operator(.)ident(size) - ident(assert_equal) integer(2)operator(,) constant(Firm)operator(.)ident(reflect_on_all_associations)operator(()symbol(:has_one)operator(\))operator(.)ident(size) - ident(assert_equal) integer(0)operator(,) constant(Firm)operator(.)ident(reflect_on_all_associations)operator(()symbol(:belongs_to)operator(\))operator(.)ident(size) - reserved(end) - - ident(private) - reserved(def) method(assert_reflection)operator(()ident(klass)operator(,) ident(association)operator(,) ident(options)operator(\)) - ident(assert) ident(reflection) operator(=) ident(klass)operator(.)ident(reflect_on_association)operator(()ident(association)operator(\)) - ident(options)operator(.)ident(each) reserved(do) operator(|)ident(method)operator(,) ident(value)operator(|) - ident(assert_equal)operator(()ident(value)operator(,) ident(reflection)operator(.)ident(send)operator(()ident(method)operator(\))operator(\)) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) stringcontent(/../lib/active_record/schema_dumper)delimiter(")> -ident(require) string - -reserved(if) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(.)ident(respond_to?)operator(()symbol(:tables)operator(\)) - - reserved(class) class(SchemaDumperTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - reserved(def) method(test_schema_dump) - ident(stream) operator(=) constant(StringIO)operator(.)ident(new) - constant(ActiveRecord)operator(::)constant(SchemaDumper)operator(.)ident(dump)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(,) ident(stream)operator(\)) - ident(output) operator(=) ident(stream)operator(.)ident(string) - - ident(assert_match) regexpoperator(,) ident(output) - ident(assert_match) regexpoperator(,) ident(output) - ident(assert_no_match) regexpoperator(,) ident(output) - reserved(end) - - reserved(def) method(test_schema_dump_includes_not_null_columns) - ident(stream) operator(=) constant(StringIO)operator(.)ident(new) - - constant(ActiveRecord)operator(::)constant(SchemaDumper)operator(.)ident(ignore_tables) operator(=) operator([)regexpoperator(]) - constant(ActiveRecord)operator(::)constant(SchemaDumper)operator(.)ident(dump)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(,) ident(stream)operator(\)) - ident(output) operator(=) ident(stream)operator(.)ident(string) - ident(assert_match) regexp false)delimiter(})>operator(,) ident(output) - reserved(end) - - reserved(def) method(test_schema_dump_with_string_ignored_table) - ident(stream) operator(=) constant(StringIO)operator(.)ident(new) - - constant(ActiveRecord)operator(::)constant(SchemaDumper)operator(.)ident(ignore_tables) operator(=) operator([)stringoperator(]) - constant(ActiveRecord)operator(::)constant(SchemaDumper)operator(.)ident(dump)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(,) ident(stream)operator(\)) - ident(output) operator(=) ident(stream)operator(.)ident(string) - ident(assert_no_match) regexpoperator(,) ident(output) - ident(assert_match) regexpoperator(,) ident(output) - ident(assert_no_match) regexpoperator(,) ident(output) - reserved(end) - - - reserved(def) method(test_schema_dump_with_regexp_ignored_table) - ident(stream) operator(=) constant(StringIO)operator(.)ident(new) - - constant(ActiveRecord)operator(::)constant(SchemaDumper)operator(.)ident(ignore_tables) operator(=) operator([)regexpoperator(]) - constant(ActiveRecord)operator(::)constant(SchemaDumper)operator(.)ident(dump)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(,) ident(stream)operator(\)) - ident(output) operator(=) ident(stream)operator(.)ident(string) - ident(assert_no_match) regexpoperator(,) ident(output) - ident(assert_match) regexpoperator(,) ident(output) - ident(assert_no_match) regexpoperator(,) ident(output) - reserved(end) - - - reserved(def) method(test_schema_dump_illegal_ignored_table_value) - ident(stream) operator(=) constant(StringIO)operator(.)ident(new) - constant(ActiveRecord)operator(::)constant(SchemaDumper)operator(.)ident(ignore_tables) operator(=) operator([)integer(5)operator(]) - ident(assert_raise)operator(()constant(StandardError)operator(\)) reserved(do) - constant(ActiveRecord)operator(::)constant(SchemaDumper)operator(.)ident(dump)operator(()constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(,) ident(stream)operator(\)) - reserved(end) - reserved(end) - reserved(end) - -reserved(end) -ident(require) string - -reserved(class) class(SchemaTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(false) - - constant(SCHEMA_NAME) operator(=) string - constant(TABLE_NAME) operator(=) string - constant(COLUMNS) operator(=) operator([) - stringoperator(,) - stringoperator(,) - string - operator(]) - - reserved(def) method(setup) - instance_variable(@connection) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection) - instance_variable(@connection)operator(.)ident(execute) stringcontent( CREATE TABLE )inlinecontent( ()inlineoperator(\))inline_delimiter(})>content(\))delimiter(")> - reserved(end) - - reserved(def) method(teardown) - instance_variable(@connection)operator(.)ident(execute) stringcontent( CASCADE)delimiter(")> - reserved(end) - - reserved(def) method(test_with_schema_prefixed_table_name) - ident(assert_nothing_raised) reserved(do) - ident(assert_equal) constant(COLUMNS)operator(,) ident(columns)operator(()stringcontent(.)inlinedelimiter(")>operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(test_with_schema_search_path) - ident(assert_nothing_raised) reserved(do) - ident(with_schema_search_path)operator(()constant(SCHEMA_NAME)operator(\)) reserved(do) - ident(assert_equal) constant(COLUMNS)operator(,) ident(columns)operator(()constant(TABLE_NAME)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_raise_on_unquoted_schema_name) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(\)) reserved(do) - ident(with_schema_search_path) string - reserved(end) - reserved(end) - - reserved(def) method(test_without_schema_search_path) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(StatementInvalid)operator(\)) operator({) ident(columns)operator(()constant(TABLE_NAME)operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_ignore_nil_schema_search_path) - ident(assert_nothing_raised) operator({) ident(with_schema_search_path) pre_constant(nil) operator(}) - reserved(end) - - ident(private) - reserved(def) method(columns)operator(()ident(table_name)operator(\)) - instance_variable(@connection)operator(.)ident(send)operator(()symbol(:column_definitions)operator(,) ident(table_name)operator(\))operator(.)ident(map) reserved(do) operator(|)ident(name)operator(,) ident(type)operator(,) ident(default)operator(|) - stringcontent( )inlinedelimiter(")> operator(+) operator(()ident(default) operator(?) stringdelimiter(")> operator(:) stringoperator(\)) - reserved(end) - reserved(end) - - reserved(def) method(with_schema_search_path)operator(()ident(schema_search_path)operator(\)) - instance_variable(@connection)operator(.)ident(schema_search_path) operator(=) ident(schema_search_path) - reserved(yield) reserved(if) ident(block_given?) - reserved(ensure) - instance_variable(@connection)operator(.)ident(schema_search_path) operator(=) string - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -comment(# confirm that synonyms work just like tables; in this case) -comment(# the "subjects" table in Oracle (defined in oci.sql\) is just) -comment(# a synonym to the "topics" table) - -reserved(class) class(TestOracleSynonym) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - - reserved(def) method(test_oracle_synonym) - ident(topic) operator(=) constant(Topic)operator(.)ident(new) - ident(subject) operator(=) constant(Subject)operator(.)ident(new) - ident(assert_equal)operator(()ident(topic)operator(.)ident(attributes)operator(,) ident(subject)operator(.)ident(attributes)operator(\)) - reserved(end) - -reserved(end) -ident(require) string -ident(require) string - -reserved(class) class(ThreadedConnectionsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(false) - - ident(fixtures) symbol(:topics) - - reserved(def) method(setup) - instance_variable(@connection) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(remove_connection) - instance_variable(@connections) operator(=) operator([)operator(]) - instance_variable(@allow_concurrency) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(allow_concurrency) - reserved(end) - - reserved(def) method(teardown) - comment(# clear the connection cache) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(send)operator(()symbol(:clear_all_cached_connections!)operator(\)) - comment(# set allow_concurrency to saved value) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(allow_concurrency) operator(=) instance_variable(@allow_concurrency) - comment(# reestablish old connection) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(()instance_variable(@connection)operator(\)) - reserved(end) - - reserved(def) method(gather_connections)operator(()ident(use_threaded_connections)operator(\)) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(allow_concurrency) operator(=) ident(use_threaded_connections) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(()instance_variable(@connection)operator(\)) - - integer(5)operator(.)ident(times) reserved(do) - constant(Thread)operator(.)ident(new) reserved(do) - constant(Topic)operator(.)ident(find) symbol(:first) - instance_variable(@connections) operator(<<) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(active_connections)operator(.)ident(values)operator(.)ident(first) - reserved(end)operator(.)ident(join) - reserved(end) - reserved(end) - - reserved(def) method(test_threaded_connections) - ident(gather_connections)operator(()pre_constant(true)operator(\)) - ident(assert_equal) instance_variable(@connections)operator(.)ident(uniq)operator(.)ident(length)operator(,) integer(5) - reserved(end) - - reserved(def) method(test_unthreaded_connections) - ident(gather_connections)operator(()pre_constant(false)operator(\)) - ident(assert_equal) instance_variable(@connections)operator(.)ident(uniq)operator(.)ident(length)operator(,) integer(1) - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(TransactionTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(false) - - ident(fixtures) symbol(:topics)operator(,) symbol(:developers) - - reserved(def) method(setup) - comment(# sqlite does not seem to return these in the right order, so we sort them) - comment(# explicitly for sqlite's sake. sqlite3 does fine.) - instance_variable(@first)operator(,) instance_variable(@second) operator(=) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(,) integer(2)operator(\))operator(.)ident(sort_by) operator({) operator(|)ident(t)operator(|) ident(t)operator(.)ident(id) operator(}) - reserved(end) - - reserved(def) method(test_successful) - constant(Topic)operator(.)ident(transaction) reserved(do) - instance_variable(@first)operator(.)ident(approved) operator(=) pre_constant(true) - instance_variable(@second)operator(.)ident(approved) operator(=) pre_constant(false) - instance_variable(@first)operator(.)ident(save) - instance_variable(@second)operator(.)ident(save) - reserved(end) - - ident(assert) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(approved?)operator(,) string - ident(assert) operator(!)constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(approved?)operator(,) string - reserved(end) - - reserved(def) method(transaction_with_return) - constant(Topic)operator(.)ident(transaction) reserved(do) - instance_variable(@first)operator(.)ident(approved) operator(=) pre_constant(true) - instance_variable(@second)operator(.)ident(approved) operator(=) pre_constant(false) - instance_variable(@first)operator(.)ident(save) - instance_variable(@second)operator(.)ident(save) - reserved(return) - reserved(end) - reserved(end) - - reserved(def) method(test_successful_with_return) - reserved(class) operator(<<) class(Topic)operator(.)ident(connection) - reserved(alias) symbol(:real_commit_db_transaction) symbol(:commit_db_transaction) - reserved(def) method(commit_db_transaction) - global_variable($committed) operator(=) pre_constant(true) - ident(real_commit_db_transaction) - reserved(end) - reserved(end) - - global_variable($committed) operator(=) pre_constant(false) - ident(transaction_with_return) - ident(assert) global_variable($committed) - - ident(assert) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(approved?)operator(,) string - ident(assert) operator(!)constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(approved?)operator(,) string - reserved(ensure) - reserved(class) operator(<<) class(Topic)operator(.)ident(connection) - reserved(alias) symbol(:commit_db_transaction) symbol(:real_commit_db_transaction) reserved(rescue) pre_constant(nil) - reserved(end) - reserved(end) - - reserved(def) method(test_successful_with_instance_method) - instance_variable(@first)operator(.)ident(transaction) reserved(do) - instance_variable(@first)operator(.)ident(approved) operator(=) pre_constant(true) - instance_variable(@second)operator(.)ident(approved) operator(=) pre_constant(false) - instance_variable(@first)operator(.)ident(save) - instance_variable(@second)operator(.)ident(save) - reserved(end) - - ident(assert) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(approved?)operator(,) string - ident(assert) operator(!)constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(approved?)operator(,) string - reserved(end) - - reserved(def) method(test_failing_on_exception) - reserved(begin) - constant(Topic)operator(.)ident(transaction) reserved(do) - instance_variable(@first)operator(.)ident(approved) operator(=) pre_constant(true) - instance_variable(@second)operator(.)ident(approved) operator(=) pre_constant(false) - instance_variable(@first)operator(.)ident(save) - instance_variable(@second)operator(.)ident(save) - ident(raise) string - reserved(end) - reserved(rescue) - comment(# caught it) - reserved(end) - - ident(assert) instance_variable(@first)operator(.)ident(approved?)operator(,) string - ident(assert) operator(!)instance_variable(@second)operator(.)ident(approved?)operator(,) string - - ident(assert) operator(!)constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(approved?)operator(,) string - ident(assert) constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(approved?)operator(,) string - reserved(end) - - reserved(def) method(test_failing_with_object_rollback) - ident(assert) operator(!)instance_variable(@first)operator(.)ident(approved?)operator(,) string - - reserved(begin) - constant(Topic)operator(.)ident(transaction)operator(()instance_variable(@first)operator(,) instance_variable(@second)operator(\)) reserved(do) - instance_variable(@first)operator(.)ident(approved) operator(=) pre_constant(true) - instance_variable(@second)operator(.)ident(approved) operator(=) pre_constant(false) - instance_variable(@first)operator(.)ident(save) - instance_variable(@second)operator(.)ident(save) - ident(raise) string - reserved(end) - reserved(rescue) - comment(# caught it) - reserved(end) - - ident(assert) operator(!)instance_variable(@first)operator(.)ident(approved?)operator(,) string - ident(assert) instance_variable(@second)operator(.)ident(approved?)operator(,) string - reserved(end) - - reserved(def) method(test_callback_rollback_in_save) - ident(add_exception_raising_after_save_callback_to_topic) - - reserved(begin) - instance_variable(@first)operator(.)ident(approved) operator(=) pre_constant(true) - instance_variable(@first)operator(.)ident(save) - ident(flunk) - reserved(rescue) operator(=)operator(>) ident(e) - ident(assert_equal) stringoperator(,) ident(e)operator(.)ident(message) - ident(assert) operator(!)constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(approved?) - reserved(ensure) - ident(remove_exception_raising_after_save_callback_to_topic) - reserved(end) - reserved(end) - - reserved(def) method(test_nested_explicit_transactions) - constant(Topic)operator(.)ident(transaction) reserved(do) - constant(Topic)operator(.)ident(transaction) reserved(do) - instance_variable(@first)operator(.)ident(approved) operator(=) pre_constant(true) - instance_variable(@second)operator(.)ident(approved) operator(=) pre_constant(false) - instance_variable(@first)operator(.)ident(save) - instance_variable(@second)operator(.)ident(save) - reserved(end) - reserved(end) - - ident(assert) constant(Topic)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(approved?)operator(,) string - ident(assert) operator(!)constant(Topic)operator(.)ident(find)operator(()integer(2)operator(\))operator(.)ident(approved?)operator(,) string - reserved(end) - - comment(# This will cause transactions to overlap and fail unless they are) - comment(# performed on separate database connections.) - reserved(def) method(test_transaction_per_thread) - ident(assert_nothing_raised) reserved(do) - ident(threads) operator(=) operator(()integer(1)operator(..)integer(20)operator(\))operator(.)ident(map) reserved(do) - constant(Thread)operator(.)ident(new) reserved(do) - constant(Topic)operator(.)ident(transaction) reserved(do) - ident(topic) operator(=) constant(Topic)operator(.)ident(find)operator(()symbol(:first)operator(\)) - ident(topic)operator(.)ident(approved) operator(=) operator(!)ident(topic)operator(.)ident(approved?) - ident(topic)operator(.)ident(save!) - ident(topic)operator(.)ident(approved) operator(=) operator(!)ident(topic)operator(.)ident(approved?) - ident(topic)operator(.)ident(save!) - reserved(end) - reserved(end) - reserved(end) - - ident(threads)operator(.)ident(each) operator({) operator(|)ident(t)operator(|) ident(t)operator(.)ident(join) operator(}) - reserved(end) - reserved(end) - - comment(# Test for dirty reads among simultaneous transactions.) - reserved(def) method(test_transaction_isolation__read_committed) - comment(# Should be invariant.) - ident(original_salary) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(salary) - ident(temporary_salary) operator(=) integer(200000) - - ident(assert_nothing_raised) reserved(do) - ident(threads) operator(=) operator(()integer(1)operator(..)integer(20)operator(\))operator(.)ident(map) reserved(do) - constant(Thread)operator(.)ident(new) reserved(do) - constant(Developer)operator(.)ident(transaction) reserved(do) - comment(# Expect original salary.) - ident(dev) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) ident(original_salary)operator(,) ident(dev)operator(.)ident(salary) - - ident(dev)operator(.)ident(salary) operator(=) ident(temporary_salary) - ident(dev)operator(.)ident(save!) - - comment(# Expect temporary salary.) - ident(dev) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) ident(temporary_salary)operator(,) ident(dev)operator(.)ident(salary) - - ident(dev)operator(.)ident(salary) operator(=) ident(original_salary) - ident(dev)operator(.)ident(save!) - - comment(# Expect original salary.) - ident(dev) operator(=) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\)) - ident(assert_equal) ident(original_salary)operator(,) ident(dev)operator(.)ident(salary) - reserved(end) - reserved(end) - reserved(end) - - comment(# Keep our eyes peeled.) - ident(threads) operator(<<) constant(Thread)operator(.)ident(new) reserved(do) - integer(10)operator(.)ident(times) reserved(do) - ident(sleep) float(0.05) - constant(Developer)operator(.)ident(transaction) reserved(do) - comment(# Always expect original salary.) - ident(assert_equal) ident(original_salary)operator(,) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(salary) - reserved(end) - reserved(end) - reserved(end) - - ident(threads)operator(.)ident(each) operator({) operator(|)ident(t)operator(|) ident(t)operator(.)ident(join) operator(}) - reserved(end) - - ident(assert_equal) ident(original_salary)operator(,) constant(Developer)operator(.)ident(find)operator(()integer(1)operator(\))operator(.)ident(salary) - reserved(end) - - - ident(private) - reserved(def) method(add_exception_raising_after_save_callback_to_topic) - constant(Topic)operator(.)ident(class_eval) operator({) reserved(def) method(after_save)operator(()operator(\)) ident(raise) string reserved(end) operator(}) - reserved(end) - - reserved(def) method(remove_exception_raising_after_save_callback_to_topic) - constant(Topic)operator(.)ident(class_eval) operator({) ident(remove_method) symbol(:after_save) operator(}) - reserved(end) -reserved(end) -ident(require) string - -reserved(class) class(TestRecord) operator(<) constant(ActiveRecord)operator(::)constant(Base) -reserved(end) - -reserved(class) class(TestUnconnectedAdaptor) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) pre_constant(false) - - reserved(def) method(setup) - instance_variable(@underlying) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection) - instance_variable(@specification) operator(=) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(remove_connection) - reserved(end) - - reserved(def) method(teardown) - instance_variable(@underlying) operator(=) pre_constant(nil) - constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(()instance_variable(@specification)operator(\)) - reserved(end) - - reserved(def) method(test_connection_no_longer_established) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(ConnectionNotEstablished)operator(\)) reserved(do) - constant(TestRecord)operator(.)ident(find)operator(()integer(1)operator(\)) - reserved(end) - - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(ConnectionNotEstablished)operator(\)) reserved(do) - constant(TestRecord)operator(.)ident(new)operator(.)ident(save) - reserved(end) - reserved(end) - - reserved(def) method(test_underlying_adapter_no_longer_active) - ident(assert) operator(!)instance_variable(@underlying)operator(.)ident(active?)operator(,) string - reserved(end) -reserved(end) -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -comment(# The following methods in Topic are used in test_conditional_validation_*) -reserved(class) class(Topic) - reserved(def) method(condition_is_true) - reserved(return) pre_constant(true) - reserved(end) - - reserved(def) method(condition_is_true_but_its_not) - reserved(return) pre_constant(false) - reserved(end) -reserved(end) - -reserved(class) class(ValidationsTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - ident(fixtures) symbol(:topics)operator(,) symbol(:developers) - - reserved(def) method(setup) - constant(Topic)operator(.)ident(write_inheritable_attribute)operator(()symbol(:validate)operator(,) pre_constant(nil)operator(\)) - constant(Topic)operator(.)ident(write_inheritable_attribute)operator(()symbol(:validate_on_create)operator(,) pre_constant(nil)operator(\)) - constant(Topic)operator(.)ident(write_inheritable_attribute)operator(()symbol(:validate_on_update)operator(,) pre_constant(nil)operator(\)) - reserved(end) - - reserved(def) method(test_single_field_validation) - ident(r) operator(=) constant(Reply)operator(.)ident(new) - ident(r)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(r)operator(.)ident(save)operator(,) string - - ident(r)operator(.)ident(content) operator(=) string - ident(assert) ident(r)operator(.)ident(save)operator(,) string - reserved(end) - - reserved(def) method(test_single_attr_validation_and_error_msg) - ident(r) operator(=) constant(Reply)operator(.)ident(new) - ident(r)operator(.)ident(title) operator(=) string - ident(r)operator(.)ident(save) - ident(assert) ident(r)operator(.)ident(errors)operator(.)ident(invalid?)operator(()stringoperator(\))operator(,) string - ident(assert_equal) stringoperator(,) ident(r)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\))operator(,) string - ident(assert_equal) integer(1)operator(,) ident(r)operator(.)ident(errors)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_double_attr_validation_and_error_msg) - ident(r) operator(=) constant(Reply)operator(.)ident(new) - ident(assert) operator(!)ident(r)operator(.)ident(save) - - ident(assert) ident(r)operator(.)ident(errors)operator(.)ident(invalid?)operator(()stringoperator(\))operator(,) string - ident(assert_equal) stringoperator(,) ident(r)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\))operator(,) string - - ident(assert) ident(r)operator(.)ident(errors)operator(.)ident(invalid?)operator(()stringoperator(\))operator(,) string - ident(assert_equal) stringoperator(,) ident(r)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\))operator(,) string - - ident(assert_equal) integer(2)operator(,) ident(r)operator(.)ident(errors)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_error_on_create) - ident(r) operator(=) constant(Reply)operator(.)ident(new) - ident(r)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(r)operator(.)ident(save) - ident(assert) ident(r)operator(.)ident(errors)operator(.)ident(invalid?)operator(()stringoperator(\))operator(,) string - ident(assert_equal) stringoperator(,) ident(r)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\))operator(,) string - reserved(end) - - reserved(def) method(test_error_on_update) - ident(r) operator(=) constant(Reply)operator(.)ident(new) - ident(r)operator(.)ident(title) operator(=) string - ident(r)operator(.)ident(content) operator(=) string - ident(assert) ident(r)operator(.)ident(save)operator(,) string - - ident(r)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(r)operator(.)ident(save)operator(,) string - - ident(assert) ident(r)operator(.)ident(errors)operator(.)ident(invalid?)operator(()stringoperator(\))operator(,) string - ident(assert_equal) stringoperator(,) ident(r)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\))operator(,) string - reserved(end) - - reserved(def) method(test_invalid_record_exception) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordInvalid)operator(\)) operator({) constant(Reply)operator(.)ident(create!) operator(}) - ident(assert_raises)operator(()constant(ActiveRecord)operator(::)constant(RecordInvalid)operator(\)) operator({) constant(Reply)operator(.)ident(new)operator(.)ident(save!) operator(}) - - reserved(begin) - ident(r) operator(=) constant(Reply)operator(.)ident(new) - ident(r)operator(.)ident(save!) - ident(flunk) - reserved(rescue) constant(ActiveRecord)operator(::)constant(RecordInvalid) operator(=)operator(>) ident(invalid) - ident(assert_equal) ident(r)operator(,) ident(invalid)operator(.)ident(record) - reserved(end) - reserved(end) - - reserved(def) method(test_single_error_per_attr_iteration) - ident(r) operator(=) constant(Reply)operator(.)ident(new) - ident(r)operator(.)ident(save) - - ident(errors) operator(=) operator([)operator(]) - ident(r)operator(.)ident(errors)operator(.)ident(each) operator({) operator(|)ident(attr)operator(,) ident(msg)operator(|) ident(errors) operator(<<) operator([)ident(attr)operator(,) ident(msg)operator(]) operator(}) - - ident(assert) ident(errors)operator(.)ident(include?)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) - ident(assert) ident(errors)operator(.)ident(include?)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) - reserved(end) - - reserved(def) method(test_multiple_errors_per_attr_iteration_with_full_error_composition) - ident(r) operator(=) constant(Reply)operator(.)ident(new) - ident(r)operator(.)ident(title) operator(=) string - ident(r)operator(.)ident(content) operator(=) string - ident(r)operator(.)ident(save) - - ident(errors) operator(=) operator([)operator(]) - ident(r)operator(.)ident(errors)operator(.)ident(each_full) operator({) operator(|)ident(error)operator(|) ident(errors) operator(<<) ident(error) operator(}) - - ident(assert_equal) stringoperator(,) ident(errors)operator([)integer(0)operator(]) - ident(assert_equal) stringoperator(,) ident(errors)operator([)integer(1)operator(]) - ident(assert_equal) integer(2)operator(,) ident(r)operator(.)ident(errors)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_errors_on_base) - ident(r) operator(=) constant(Reply)operator(.)ident(new) - ident(r)operator(.)ident(content) operator(=) string - ident(r)operator(.)ident(save) - ident(r)operator(.)ident(errors)operator(.)ident(add_to_base) string - - ident(errors) operator(=) operator([)operator(]) - ident(r)operator(.)ident(errors)operator(.)ident(each_full) operator({) operator(|)ident(error)operator(|) ident(errors) operator(<<) ident(error) operator(}) - - ident(assert_equal) stringoperator(,) ident(r)operator(.)ident(errors)operator(.)ident(on_base) - - ident(assert) ident(errors)operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert) ident(errors)operator(.)ident(include?)operator(()stringoperator(\)) - ident(assert_equal) integer(2)operator(,) ident(r)operator(.)ident(errors)operator(.)ident(count) - reserved(end) - - reserved(def) method(test_create_without_validation) - ident(reply) operator(=) constant(Reply)operator(.)ident(new) - ident(assert) operator(!)ident(reply)operator(.)ident(save) - ident(assert) ident(reply)operator(.)ident(save)operator(()pre_constant(false)operator(\)) - reserved(end) - - reserved(def) method(test_validates_each) - ident(perform) operator(=) pre_constant(true) - ident(hits) operator(=) integer(0) - constant(Topic)operator(.)ident(validates_each)operator(()symbol(:title)operator(,) symbol(:content)operator(,) operator([)symbol(:title)operator(,) symbol(:content)operator(])operator(\)) reserved(do) operator(|)ident(record)operator(,) ident(attr)operator(|) - reserved(if) ident(perform) - ident(record)operator(.)ident(errors)operator(.)ident(add) ident(attr)operator(,) string - ident(hits) operator(+=) integer(1) - reserved(end) - reserved(end) - ident(t) operator(=) constant(Topic)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert_equal) integer(4)operator(,) ident(hits) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:content)operator(\)) - reserved(ensure) - ident(perform) operator(=) pre_constant(false) - reserved(end) - - reserved(def) method(test_errors_on_boundary_breaking) - ident(developer) operator(=) constant(Developer)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(developer)operator(.)ident(save) - ident(assert_equal) stringoperator(,) ident(developer)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\)) - - ident(developer)operator(.)ident(name) operator(=) string - ident(assert) operator(!)ident(developer)operator(.)ident(save) - ident(assert_equal) stringoperator(,) ident(developer)operator(.)ident(errors)operator(.)ident(on)operator(()stringoperator(\)) - - ident(developer)operator(.)ident(name) operator(=) string - ident(assert) ident(developer)operator(.)ident(save) - reserved(end) - - reserved(def) method(test_title_confirmation_no_confirm) - constant(Topic)operator(.)ident(validates_confirmation_of)operator(()symbol(:title)operator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(save) - reserved(end) - - reserved(def) method(test_title_confirmation) - constant(Topic)operator(.)ident(validates_confirmation_of)operator(()symbol(:title)operator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,)string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(save) - - ident(t)operator(.)ident(title_confirmation) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - reserved(end) - - reserved(def) method(test_terms_of_service_agreement_no_acceptance) - constant(Topic)operator(.)ident(validates_acceptance_of)operator(()symbol(:terms_of_service)operator(,) symbol(:on) operator(=)operator(>) symbol(:create)operator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(save) - reserved(end) - - reserved(def) method(test_terms_of_service_agreement) - constant(Topic)operator(.)ident(validates_acceptance_of)operator(()symbol(:terms_of_service)operator(,) symbol(:on) operator(=)operator(>) symbol(:create)operator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,)string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:terms_of_service)operator(\)) - - ident(t)operator(.)ident(terms_of_service) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - reserved(end) - - - reserved(def) method(test_eula) - constant(Topic)operator(.)ident(validates_acceptance_of)operator(()symbol(:eula)operator(,) symbol(:message) operator(=)operator(>) stringoperator(,) symbol(:on) operator(=)operator(>) symbol(:create)operator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,)string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:eula)operator(\)) - - ident(t)operator(.)ident(eula) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - reserved(end) - - reserved(def) method(test_terms_of_service_agreement_with_accept_value) - constant(Topic)operator(.)ident(validates_acceptance_of)operator(()symbol(:terms_of_service)operator(,) symbol(:on) operator(=)operator(>) symbol(:create)operator(,) symbol(:accept) operator(=)operator(>) stringoperator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:terms_of_service)operator(\)) - - ident(t)operator(.)ident(terms_of_service) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - reserved(end) - - reserved(def) method(test_validate_presences) - constant(Topic)operator(.)ident(validates_presence_of)operator(()symbol(:title)operator(,) symbol(:content)operator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(create) - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:content)operator(\)) - - ident(t)operator(.)ident(title) operator(=) string - ident(t)operator(.)ident(content) operator(=) string - - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:content)operator(\)) - - ident(t)operator(.)ident(content) operator(=) string - - ident(assert) ident(t)operator(.)ident(save) - reserved(end) - - reserved(def) method(test_validate_uniqueness) - constant(Topic)operator(.)ident(validates_uniqueness_of)operator(()symbol(:title)operator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(save)operator(,) string - - ident(t)operator(.)ident(content) operator(=) string - ident(assert) ident(t)operator(.)ident(save)operator(,) string - - ident(t2) operator(=) constant(Topic)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t2)operator(.)ident(valid?)operator(,) string - ident(assert) operator(!)ident(t2)operator(.)ident(save)operator(,) string - ident(assert_equal) stringoperator(,) ident(t2)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - - ident(t2)operator(.)ident(title) operator(=) string - ident(assert) ident(t2)operator(.)ident(save)operator(,) string - reserved(end) - - reserved(def) method(test_validate_uniqueness_with_scope) - constant(Reply)operator(.)ident(validates_uniqueness_of)operator(()symbol(:content)operator(,) symbol(:scope) operator(=)operator(>) stringoperator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - - ident(r1) operator(=) ident(t)operator(.)ident(replies)operator(.)ident(create) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - ident(assert) ident(r1)operator(.)ident(valid?)operator(,) string - - ident(r2) operator(=) ident(t)operator(.)ident(replies)operator(.)ident(create) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - ident(assert) operator(!)ident(r2)operator(.)ident(valid?)operator(,) string - - ident(r2)operator(.)ident(content) operator(=) string - ident(assert) ident(r2)operator(.)ident(save)operator(,) string - - ident(t2) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(r3) operator(=) ident(t2)operator(.)ident(replies)operator(.)ident(create) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - ident(assert) ident(r3)operator(.)ident(valid?)operator(,) string - reserved(end) - - reserved(def) method(test_validate_uniqueness_with_scope_array) - constant(Reply)operator(.)ident(validates_uniqueness_of)operator(()symbol(:author_name)operator(,) symbol(:scope) operator(=)operator(>) operator([)symbol(:author_email_address)operator(,) symbol(:parent_id)operator(])operator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - - ident(r1) operator(=) ident(t)operator(.)ident(replies)operator(.)ident(create) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - ident(assert) ident(r1)operator(.)ident(valid?)operator(,) string - - ident(r2) operator(=) ident(t)operator(.)ident(replies)operator(.)ident(create) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - ident(assert) operator(!)ident(r2)operator(.)ident(valid?)operator(,) string - - ident(r2)operator(.)ident(author_email_address) operator(=) string - ident(assert) ident(r2)operator(.)ident(save)operator(,) string - - ident(r3) operator(=) ident(t)operator(.)ident(replies)operator(.)ident(create) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - ident(assert) operator(!)ident(r3)operator(.)ident(valid?)operator(,) string - - ident(r3)operator(.)ident(author_name) operator(=) string - ident(assert) ident(r3)operator(.)ident(save)operator(,) string - - ident(r3)operator(.)ident(author_name) operator(=) string - ident(assert) operator(!)ident(r3)operator(.)ident(save)operator(,) string - reserved(end) - - reserved(def) method(test_validate_format) - constant(Topic)operator(.)ident(validates_format_of)operator(()symbol(:title)operator(,) symbol(:content)operator(,) symbol(:with) operator(=)operator(>) regexpoperator(,) symbol(:message) operator(=)operator(>) stringoperator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?)operator(,) string - ident(assert) operator(!)ident(t)operator(.)ident(save)operator(,) string - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_nil) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:content)operator(\)) - - ident(t)operator(.)ident(title) operator(=) string - - ident(assert) ident(t)operator(.)ident(save) - ident(assert_nil) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_format_of)operator(()symbol(:title)operator(,) symbol(:content)operator(\)) operator(}) - reserved(end) - - comment(# testing ticket #3142) - reserved(def) method(test_validate_format_numeric) - constant(Topic)operator(.)ident(validates_format_of)operator(()symbol(:title)operator(,) symbol(:content)operator(,) symbol(:with) operator(=)operator(>) regexpoperator(,) symbol(:message) operator(=)operator(>) stringoperator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?)operator(,) string - ident(assert) operator(!)ident(t)operator(.)ident(save)operator(,) string - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_nil) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:content)operator(\)) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?)operator(,) string - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?)operator(,) string - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?)operator(,) string - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?)operator(,) string - - ident(t)operator(.)ident(title) operator(=) string - - ident(assert) ident(t)operator(.)ident(save) - ident(assert_nil) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - reserved(end) - - reserved(def) method(test_validates_inclusion_of) - constant(Topic)operator(.)ident(validates_inclusion_of)operator(() symbol(:title)operator(,) symbol(:in) operator(=)operator(>) string operator(\)) - - ident(assert) operator(!)constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(.)ident(valid?) - ident(assert) operator(!)constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(.)ident(valid?) - ident(assert) operator(!)constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) pre_constant(nil)operator(,) string operator(=)operator(>) stringoperator(\))operator(.)ident(valid?) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_inclusion_of)operator(() symbol(:title)operator(,) symbol(:in) operator(=)operator(>) pre_constant(nil) operator(\)) operator(}) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_inclusion_of)operator(() symbol(:title)operator(,) symbol(:in) operator(=)operator(>) integer(0)operator(\)) operator(}) - - ident(assert_nothing_raised)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_inclusion_of)operator(() symbol(:title)operator(,) symbol(:in) operator(=)operator(>) string operator(\)) operator(}) - ident(assert_nothing_raised)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_inclusion_of)operator(() symbol(:title)operator(,) symbol(:in) operator(=)operator(>) operator({)operator(}) operator(\)) operator(}) - ident(assert_nothing_raised)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_inclusion_of)operator(() symbol(:title)operator(,) symbol(:in) operator(=)operator(>) operator([)operator(]) operator(\)) operator(}) - reserved(end) - - reserved(def) method(test_validates_inclusion_of_with_allow_nil) - constant(Topic)operator(.)ident(validates_inclusion_of)operator(() symbol(:title)operator(,) symbol(:in) operator(=)operator(>) stringoperator(,) symbol(:allow_nil)operator(=)operator(>)pre_constant(true) operator(\)) - - ident(assert) operator(!)constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(.)ident(valid?) - ident(assert) operator(!)constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(.)ident(valid?) - ident(assert) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) pre_constant(nil)operator(,) string operator(=)operator(>) stringoperator(\))operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_numericality_with_allow_nil_and_getter_method) - constant(Developer)operator(.)ident(validates_numericality_of)operator(() symbol(:salary)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(true)operator(\)) - ident(developer) operator(=) constant(Developer)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) pre_constant(nil)operator(\)) - ident(developer)operator(.)ident(instance_eval)operator(()stringoperator(\)) - ident(assert) ident(developer)operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_validates_exclusion_of) - constant(Topic)operator(.)ident(validates_exclusion_of)operator(() symbol(:title)operator(,) symbol(:in) operator(=)operator(>) string operator(\)) - - ident(assert) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(.)ident(valid?) - ident(assert) operator(!)constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\))operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_validates_length_of_using_minimum) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:minimum) operator(=)operator(>) integer(5) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - - ident(t)operator(.)ident(title) operator(=) pre_constant(nil) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_optionally_validates_length_of_using_minimum) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:minimum) operator(=)operator(>) integer(5)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(true) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) pre_constant(nil) - ident(assert) ident(t)operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_validates_length_of_using_maximum) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:maximum) operator(=)operator(>) integer(5) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) pre_constant(nil) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_optionally_validates_length_of_using_maximum) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:maximum) operator(=)operator(>) integer(5)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(true) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) pre_constant(nil) - ident(assert) ident(t)operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_validates_length_of_using_within) - constant(Topic)operator(.)ident(validates_length_of)operator(()symbol(:title)operator(,) symbol(:content)operator(,) symbol(:within) operator(=)operator(>) integer(3)operator(..)integer(5)operator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:content)operator(\)) - - ident(t)operator(.)ident(title) operator(=) pre_constant(nil) - ident(t)operator(.)ident(content) operator(=) pre_constant(nil) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:content)operator(\)) - - ident(t)operator(.)ident(title) operator(=) string - ident(t)operator(.)ident(content) operator(=) string - ident(assert) ident(t)operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_optionally_validates_length_of_using_within) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:content)operator(,) symbol(:within) operator(=)operator(>) integer(3)operator(..)integer(5)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(true) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) pre_constant(nil) - ident(assert) ident(t)operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_optionally_validates_length_of_using_within_on_create) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:content)operator(,) symbol(:within) operator(=)operator(>) integer(5)operator(..)integer(10)operator(,) symbol(:on) operator(=)operator(>) symbol(:create)operator(,) symbol(:too_long) operator(=)operator(>) string - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)symbol(:title)operator(]) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - - ident(t)operator(.)ident(content) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - - ident(t)operator(.)ident(content) operator(=) ident(t)operator(.)ident(title) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - reserved(end) - - reserved(def) method(test_optionally_validates_length_of_using_within_on_update) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:content)operator(,) symbol(:within) operator(=)operator(>) integer(5)operator(..)integer(10)operator(,) symbol(:on) operator(=)operator(>) symbol(:update)operator(,) symbol(:too_short) operator(=)operator(>) string - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)symbol(:title)operator(]) - - ident(t)operator(.)ident(title) operator(=) string - ident(t)operator(.)ident(content) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:content)operator(\)) - - ident(t)operator(.)ident(content) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - reserved(end) - - reserved(def) method(test_validates_length_of_using_is) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:is) operator(=)operator(>) integer(5) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) pre_constant(nil) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_optionally_validates_length_of_using_is) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:is) operator(=)operator(>) integer(5)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(true) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) pre_constant(nil) - ident(assert) ident(t)operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_validates_length_of_using_bignum) - ident(bigmin) operator(=) integer(2) operator(**) integer(30) - ident(bigmax) operator(=) integer(2) operator(**) integer(32) - ident(bigrange) operator(=) ident(bigmin)operator(...)ident(bigmax) - ident(assert_nothing_raised) reserved(do) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:is) operator(=)operator(>) ident(bigmin) operator(+) integer(5) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:within) operator(=)operator(>) ident(bigrange) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:in) operator(=)operator(>) ident(bigrange) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:minimum) operator(=)operator(>) ident(bigmin) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:maximum) operator(=)operator(>) ident(bigmax) - reserved(end) - reserved(end) - - reserved(def) method(test_validates_length_with_globaly_modified_error_message) - constant(ActiveRecord)operator(::)constant(Errors)operator(.)ident(default_error_messages)operator([)symbol(:too_short)operator(]) operator(=) string - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:minimum) operator(=)operator(>) integer(10) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()symbol(:title) operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_validates_size_of_association) - ident(assert_nothing_raised) operator({) constant(Topic)operator(.)ident(validates_size_of) symbol(:replies)operator(,) symbol(:minimum) operator(=)operator(>) integer(1) operator(}) - ident(t) operator(=) constant(Topic)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:replies)operator(\)) - ident(t)operator(.)ident(replies)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_validates_length_of_nasty_params) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_length_of)operator(()symbol(:title)operator(,) symbol(:minimum)operator(=)operator(>)integer(6)operator(,) symbol(:maximum)operator(=)operator(>)integer(9)operator(\)) operator(}) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_length_of)operator(()symbol(:title)operator(,) symbol(:within)operator(=)operator(>)integer(6)operator(,) symbol(:maximum)operator(=)operator(>)integer(9)operator(\)) operator(}) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_length_of)operator(()symbol(:title)operator(,) symbol(:within)operator(=)operator(>)integer(6)operator(,) symbol(:minimum)operator(=)operator(>)integer(9)operator(\)) operator(}) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_length_of)operator(()symbol(:title)operator(,) symbol(:within)operator(=)operator(>)integer(6)operator(,) symbol(:is)operator(=)operator(>)integer(9)operator(\)) operator(}) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_length_of)operator(()symbol(:title)operator(,) symbol(:minimum)operator(=)operator(>)stringoperator(\)) operator(}) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_length_of)operator(()symbol(:title)operator(,) symbol(:maximum)operator(=)operator(>)stringoperator(\)) operator(}) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_length_of)operator(()symbol(:title)operator(,) symbol(:within)operator(=)operator(>)stringoperator(\)) operator(}) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Topic)operator(.)ident(validates_length_of)operator(()symbol(:title)operator(,) symbol(:is)operator(=)operator(>)stringoperator(\)) operator(}) - reserved(end) - - reserved(def) method(test_validates_length_of_custom_errors_for_minimum_with_message) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:minimum)operator(=)operator(>)integer(5)operator(,) symbol(:message)operator(=)operator(>)string operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_validates_length_of_custom_errors_for_minimum_with_too_short) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:minimum)operator(=)operator(>)integer(5)operator(,) symbol(:too_short)operator(=)operator(>)string operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_validates_length_of_custom_errors_for_maximum_with_message) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:maximum)operator(=)operator(>)integer(5)operator(,) symbol(:message)operator(=)operator(>)string operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_validates_length_of_custom_errors_for_maximum_with_too_long) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:maximum)operator(=)operator(>)integer(5)operator(,) symbol(:too_long)operator(=)operator(>)string operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_validates_length_of_custom_errors_for_is_with_message) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:is)operator(=)operator(>)integer(5)operator(,) symbol(:message)operator(=)operator(>)string operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_validates_length_of_custom_errors_for_is_with_wrong_length) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:is)operator(=)operator(>)integer(5)operator(,) symbol(:wrong_length)operator(=)operator(>)string operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(kcode_scope)operator(()ident(kcode)operator(\)) - ident(orig_kcode) operator(=) global_variable($KCODE) - global_variable($KCODE) operator(=) ident(kcode) - reserved(begin) - reserved(yield) - reserved(ensure) - global_variable($KCODE) operator(=) ident(orig_kcode) - reserved(end) - reserved(end) - - reserved(def) method(test_validates_length_of_using_minimum_utf8) - ident(kcode_scope)operator(()stringoperator(\)) reserved(do) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:minimum) operator(=)operator(>) integer(5) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - reserved(end) - - reserved(def) method(test_validates_length_of_using_maximum_utf8) - ident(kcode_scope)operator(()stringoperator(\)) reserved(do) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:maximum) operator(=)operator(>) integer(5) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - reserved(end) - - reserved(def) method(test_validates_length_of_using_within_utf8) - ident(kcode_scope)operator(()stringoperator(\)) reserved(do) - constant(Topic)operator(.)ident(validates_length_of)operator(()symbol(:title)operator(,) symbol(:content)operator(,) symbol(:within) operator(=)operator(>) integer(3)operator(..)integer(5)operator(\)) - - ident(t) operator(=) constant(Topic)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:content)operator(\)) - ident(t)operator(.)ident(title) operator(=) string - ident(t)operator(.)ident(content) operator(=) string - ident(assert) ident(t)operator(.)ident(valid?) - reserved(end) - reserved(end) - - reserved(def) method(test_optionally_validates_length_of_using_within_utf8) - ident(kcode_scope)operator(()stringoperator(\)) reserved(do) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:content)operator(,) symbol(:within) operator(=)operator(>) integer(3)operator(..)integer(5)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(true) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) pre_constant(nil) - ident(assert) ident(t)operator(.)ident(valid?) - reserved(end) - reserved(end) - - reserved(def) method(test_optionally_validates_length_of_using_within_on_create_utf8) - ident(kcode_scope)operator(()stringoperator(\)) reserved(do) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:content)operator(,) symbol(:within) operator(=)operator(>) integer(5)operator(..)integer(10)operator(,) symbol(:on) operator(=)operator(>) symbol(:create)operator(,) symbol(:too_long) operator(=)operator(>) string - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)symbol(:title)operator(]) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - - ident(t)operator(.)ident(content) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - - ident(t)operator(.)ident(content) operator(=) ident(t)operator(.)ident(title) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - reserved(end) - reserved(end) - - reserved(def) method(test_optionally_validates_length_of_using_within_on_update_utf8) - ident(kcode_scope)operator(()stringoperator(\)) reserved(do) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:content)operator(,) symbol(:within) operator(=)operator(>) integer(5)operator(..)integer(10)operator(,) symbol(:on) operator(=)operator(>) symbol(:update)operator(,) symbol(:too_short) operator(=)operator(>) string - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)symbol(:title)operator(]) - - ident(t)operator(.)ident(title) operator(=) string - ident(t)operator(.)ident(content) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:content)operator(\)) - - ident(t)operator(.)ident(content) operator(=) string - ident(assert) ident(t)operator(.)ident(save) - reserved(end) - reserved(end) - - reserved(def) method(test_validates_length_of_using_is_utf8) - ident(kcode_scope)operator(()stringoperator(\)) reserved(do) - constant(Topic)operator(.)ident(validates_length_of) symbol(:title)operator(,) symbol(:is) operator(=)operator(>) integer(5) - - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - - ident(t)operator(.)ident(title) operator(=) string - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - reserved(end) - - reserved(def) method(test_validates_size_of_association_utf8) - ident(kcode_scope)operator(()stringoperator(\)) reserved(do) - ident(assert_nothing_raised) operator({) constant(Topic)operator(.)ident(validates_size_of) symbol(:replies)operator(,) symbol(:minimum) operator(=)operator(>) integer(1) operator(}) - ident(t) operator(=) constant(Topic)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(save) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:replies)operator(\)) - ident(t)operator(.)ident(replies)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - reserved(end) - reserved(end) - - reserved(def) method(test_validates_associated_many) - constant(Topic)operator(.)ident(validates_associated)operator(() symbol(:replies) operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(t)operator(.)ident(replies) operator(<<) operator([)ident(r) operator(=) constant(Reply)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\))operator(,) ident(r2) operator(=) constant(Reply)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\))operator(]) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:replies)operator(\)) - ident(assert_equal) integer(1)operator(,) ident(r)operator(.)ident(errors)operator(.)ident(count) comment(# make sure all associated objects have been validated) - ident(assert_equal) integer(1)operator(,) ident(r2)operator(.)ident(errors)operator(.)ident(count) - ident(r)operator(.)ident(content) operator(=) ident(r2)operator(.)ident(content) operator(=) string - ident(assert) ident(t)operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_validates_associated_one) - constant(Reply)operator(.)ident(validates_associated)operator(() symbol(:topic) operator(\)) - constant(Topic)operator(.)ident(validates_presence_of)operator(() symbol(:content) operator(\)) - ident(r) operator(=) constant(Reply)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(r)operator(.)ident(topic) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(r)operator(.)ident(valid?) - ident(assert) ident(r)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:topic)operator(\)) - ident(r)operator(.)ident(topic)operator(.)ident(content) operator(=) string - ident(assert) ident(r)operator(.)ident(valid?) - reserved(end) - - reserved(def) method(test_validate_block) - constant(Topic)operator(.)ident(validate) operator({) operator(|)ident(topic)operator(|) ident(topic)operator(.)ident(errors)operator(.)ident(add)operator(()stringoperator(,) stringoperator(\)) operator(}) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_invalid_validator) - constant(Topic)operator(.)ident(validate) integer(3) - ident(assert_raise)operator(()constant(ActiveRecord)operator(::)constant(ActiveRecordError)operator(\)) operator({) ident(t) operator(=) constant(Topic)operator(.)ident(create) operator(}) - reserved(end) - - reserved(def) method(test_throw_away_typing) - ident(d) operator(=) constant(Developer)operator(.)ident(create) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string - ident(assert) operator(!)ident(d)operator(.)ident(valid?) - ident(assert_equal) integer(100)operator(,) ident(d)operator(.)ident(salary) - ident(assert_equal) stringoperator(,) ident(d)operator(.)ident(salary_before_type_cast) - reserved(end) - - reserved(def) method(test_validates_acceptance_of_with_custom_error_using_quotes) - constant(Developer)operator(.)ident(validates_acceptance_of) symbol(:salary)operator(,) symbol(:message)operator(=)operator(>) string - ident(d) operator(=) constant(Developer)operator(.)ident(new) - ident(d)operator(.)ident(salary) operator(=) string - ident(assert) operator(!)ident(d)operator(.)ident(valid?) - ident(assert_equal) ident(d)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:salary)operator(\))operator(.)ident(first)operator(,) string - reserved(end) - - reserved(def) method(test_validates_confirmation_of_with_custom_error_using_quotes) - constant(Developer)operator(.)ident(validates_confirmation_of) symbol(:name)operator(,) symbol(:message)operator(=)operator(>) string - ident(d) operator(=) constant(Developer)operator(.)ident(new) - ident(d)operator(.)ident(name) operator(=) string - ident(d)operator(.)ident(name_confirmation) operator(=) string - ident(assert) operator(!)ident(d)operator(.)ident(valid?) - ident(assert_equal) ident(d)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:name)operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_validates_format_of_with_custom_error_using_quotes) - constant(Developer)operator(.)ident(validates_format_of) symbol(:name)operator(,) symbol(:with) operator(=)operator(>) regexpoperator(,) symbol(:message)operator(=)operator(>) string - ident(d) operator(=) constant(Developer)operator(.)ident(new) - ident(d)operator(.)ident(name) operator(=) string - ident(assert) operator(!)ident(d)operator(.)ident(valid?) - ident(assert_equal) ident(d)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:name)operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_validates_inclusion_of_with_custom_error_using_quotes) - constant(Developer)operator(.)ident(validates_inclusion_of) symbol(:salary)operator(,) symbol(:in) operator(=)operator(>) integer(1000)operator(..)integer(80000)operator(,) symbol(:message)operator(=)operator(>) string - ident(d) operator(=) constant(Developer)operator(.)ident(new) - ident(d)operator(.)ident(salary) operator(=) string - ident(assert) operator(!)ident(d)operator(.)ident(valid?) - ident(assert_equal) ident(d)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:salary)operator(\))operator(.)ident(first)operator(,) string - reserved(end) - - reserved(def) method(test_validates_length_of_with_custom_too_long_using_quotes) - constant(Developer)operator(.)ident(validates_length_of) symbol(:name)operator(,) symbol(:maximum) operator(=)operator(>) integer(4)operator(,) symbol(:too_long)operator(=)operator(>) string - ident(d) operator(=) constant(Developer)operator(.)ident(new) - ident(d)operator(.)ident(name) operator(=) string - ident(assert) operator(!)ident(d)operator(.)ident(valid?) - ident(assert_equal) ident(d)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:name)operator(\))operator(.)ident(first)operator(,) string - reserved(end) - - reserved(def) method(test_validates_length_of_with_custom_too_short_using_quotes) - constant(Developer)operator(.)ident(validates_length_of) symbol(:name)operator(,) symbol(:minimum) operator(=)operator(>) integer(4)operator(,) symbol(:too_short)operator(=)operator(>) string - ident(d) operator(=) constant(Developer)operator(.)ident(new) - ident(d)operator(.)ident(name) operator(=) string - ident(assert) operator(!)ident(d)operator(.)ident(valid?) - ident(assert_equal) ident(d)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:name)operator(\))operator(.)ident(first)operator(,) string - reserved(end) - - reserved(def) method(test_validates_length_of_with_custom_message_using_quotes) - constant(Developer)operator(.)ident(validates_length_of) symbol(:name)operator(,) symbol(:minimum) operator(=)operator(>) integer(4)operator(,) symbol(:message)operator(=)operator(>) string - ident(d) operator(=) constant(Developer)operator(.)ident(new) - ident(d)operator(.)ident(name) operator(=) string - ident(assert) operator(!)ident(d)operator(.)ident(valid?) - ident(assert_equal) ident(d)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:name)operator(\))operator(.)ident(first)operator(,) string - reserved(end) - - reserved(def) method(test_validates_presence_of_with_custom_message_using_quotes) - constant(Developer)operator(.)ident(validates_presence_of) symbol(:non_existent)operator(,) symbol(:message)operator(=)operator(>) string - ident(d) operator(=) constant(Developer)operator(.)ident(new) - ident(d)operator(.)ident(name) operator(=) string - ident(assert) operator(!)ident(d)operator(.)ident(valid?) - ident(assert_equal) ident(d)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:non_existent)operator(\))operator(,) string - reserved(end) - - reserved(def) method(test_validates_uniqueness_of_with_custom_message_using_quotes) - constant(Developer)operator(.)ident(validates_uniqueness_of) symbol(:name)operator(,) symbol(:message)operator(=)operator(>) string - ident(d) operator(=) constant(Developer)operator(.)ident(new) - ident(d)operator(.)ident(name) operator(=) string - ident(assert) operator(!)ident(d)operator(.)ident(valid?) - ident(assert_equal) ident(d)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:name)operator(\))operator(.)ident(first)operator(,) string - reserved(end) - - reserved(def) method(test_validates_associated_with_custom_message_using_quotes) - constant(Reply)operator(.)ident(validates_associated) symbol(:topic)operator(,) symbol(:message)operator(=)operator(>) string - constant(Topic)operator(.)ident(validates_presence_of) symbol(:content) - ident(r) operator(=) constant(Reply)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(r)operator(.)ident(topic) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(r)operator(.)ident(valid?) - ident(assert_equal) ident(r)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:topic)operator(\))operator(.)ident(first)operator(,) string - reserved(end) - - reserved(def) method(test_conditional_validation_using_method_true) - comment(# When the method returns true) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:maximum)operator(=)operator(>)integer(5)operator(,) symbol(:too_long)operator(=)operator(>)stringoperator(,) symbol(:if) operator(=)operator(>) symbol(:condition_is_true) operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_conditional_validation_using_method_false) - comment(# When the method returns false) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:maximum)operator(=)operator(>)integer(5)operator(,) symbol(:too_long)operator(=)operator(>)stringoperator(,) symbol(:if) operator(=)operator(>) symbol(:condition_is_true_but_its_not) operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - ident(assert) operator(!)ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - reserved(end) - - reserved(def) method(test_conditional_validation_using_string_true) - comment(# When the evaluated string returns true) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:maximum)operator(=)operator(>)integer(5)operator(,) symbol(:too_long)operator(=)operator(>)stringoperator(,) symbol(:if) operator(=)operator(>) string operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_conditional_validation_using_string_false) - comment(# When the evaluated string returns false) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:maximum)operator(=)operator(>)integer(5)operator(,) symbol(:too_long)operator(=)operator(>)stringoperator(,) symbol(:if) operator(=)operator(>) stringoperator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - ident(assert) operator(!)ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - reserved(end) - - reserved(def) method(test_conditional_validation_using_block_true) - comment(# When the block returns true) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:maximum)operator(=)operator(>)integer(5)operator(,) symbol(:too_long)operator(=)operator(>)stringoperator(,) - symbol(:if) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(r)operator(|) ident(r)operator(.)ident(content)operator(.)ident(size) operator(>) integer(4) operator(}) operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(t)operator(.)ident(valid?) - ident(assert) ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - ident(assert_equal) stringoperator(,) ident(t)operator(.)ident(errors)operator([)stringoperator(]) - reserved(end) - - reserved(def) method(test_conditional_validation_using_block_false) - comment(# When the block returns false) - constant(Topic)operator(.)ident(validates_length_of)operator(() symbol(:title)operator(,) symbol(:maximum)operator(=)operator(>)integer(5)operator(,) symbol(:too_long)operator(=)operator(>)stringoperator(,) - symbol(:if) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(r)operator(|) ident(r)operator(.)ident(title) operator(!=) stringoperator(}) operator(\)) - ident(t) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) ident(t)operator(.)ident(valid?) - ident(assert) operator(!)ident(t)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:title)operator(\)) - reserved(end) - - reserved(def) method(test_validates_associated_missing) - constant(Reply)operator(.)ident(validates_presence_of)operator(()symbol(:topic)operator(\)) - ident(r) operator(=) constant(Reply)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(\)) - ident(assert) operator(!)ident(r)operator(.)ident(valid?) - ident(assert) ident(r)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:topic)operator(\)) - - ident(r)operator(.)ident(topic) operator(=) constant(Topic)operator(.)ident(find) symbol(:first) - ident(assert) ident(r)operator(.)ident(valid?) - reserved(end) -reserved(end) - - -reserved(class) class(ValidatesNumericalityTest) - pre_constant(NIL) operator(=) operator([)pre_constant(nil)operator(,) stringoperator(,) stringoperator(,) stringoperator(]) - constant(FLOAT_STRINGS) operator(=) string - constant(INTEGER_STRINGS) operator(=) string - constant(FLOATS) operator(=) operator([)float(0.0)operator(,) float(10.0)operator(,) float(10.5)operator(,) float(-10.5)operator(,) float(-0.0001)operator(]) operator(+) constant(FLOAT_STRINGS) - constant(INTEGERS) operator(=) operator([)integer(0)operator(,) integer(10)operator(,) integer(-10)operator(]) operator(+) constant(INTEGER_STRINGS) - constant(JUNK) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) - - reserved(def) method(setup) - constant(Topic)operator(.)ident(write_inheritable_attribute)operator(()symbol(:validate)operator(,) pre_constant(nil)operator(\)) - constant(Topic)operator(.)ident(write_inheritable_attribute)operator(()symbol(:validate_on_create)operator(,) pre_constant(nil)operator(\)) - constant(Topic)operator(.)ident(write_inheritable_attribute)operator(()symbol(:validate_on_update)operator(,) pre_constant(nil)operator(\)) - reserved(end) - - reserved(def) method(test_default_validates_numericality_of) - constant(Topic)operator(.)ident(validates_numericality_of) symbol(:approved) - - ident(invalid!)operator(()pre_constant(NIL) operator(+) constant(JUNK)operator(\)) - ident(valid!)operator(()constant(FLOATS) operator(+) constant(INTEGERS)operator(\)) - reserved(end) - - reserved(def) method(test_validates_numericality_of_with_nil_allowed) - constant(Topic)operator(.)ident(validates_numericality_of) symbol(:approved)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(true) - - ident(invalid!)operator(()constant(JUNK)operator(\)) - ident(valid!)operator(()pre_constant(NIL) operator(+) constant(FLOATS) operator(+) constant(INTEGERS)operator(\)) - reserved(end) - - reserved(def) method(test_validates_numericality_of_with_integer_only) - constant(Topic)operator(.)ident(validates_numericality_of) symbol(:approved)operator(,) symbol(:only_integer) operator(=)operator(>) pre_constant(true) - - ident(invalid!)operator(()pre_constant(NIL) operator(+) constant(JUNK) operator(+) constant(FLOATS)operator(\)) - ident(valid!)operator(()constant(INTEGERS)operator(\)) - reserved(end) - - reserved(def) method(test_validates_numericality_of_with_integer_only_and_nil_allowed) - constant(Topic)operator(.)ident(validates_numericality_of) symbol(:approved)operator(,) symbol(:only_integer) operator(=)operator(>) pre_constant(true)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(true) - - ident(invalid!)operator(()constant(JUNK) operator(+) constant(FLOATS)operator(\)) - ident(valid!)operator(()pre_constant(NIL) operator(+) constant(INTEGERS)operator(\)) - reserved(end) - - ident(private) - reserved(def) method(invalid!)operator(()ident(values)operator(\)) - ident(values)operator(.)ident(each) reserved(do) operator(|)ident(value)operator(|) - ident(topic) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(value)operator(\)) - ident(assert) operator(!)ident(topic)operator(.)ident(valid?)operator(,) stringcontent( not rejected as a number)delimiter(")> - ident(assert) ident(topic)operator(.)ident(errors)operator(.)ident(on)operator(()symbol(:approved)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(valid!)operator(()ident(values)operator(\)) - ident(values)operator(.)ident(each) reserved(do) operator(|)ident(value)operator(|) - ident(topic) operator(=) constant(Topic)operator(.)ident(create)operator(()string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) ident(value)operator(\)) - ident(assert) ident(topic)operator(.)ident(valid?)operator(,) stringcontent( not accepted as a number)delimiter(")> - reserved(end) - reserved(end) -reserved(end) -reserved(begin) - ident(require) string -reserved(rescue) constant(LoadError) - reserved(class) class(Continuation) comment(# :nodoc: # for RDoc) - reserved(end) - reserved(def) constant(Continuation)operator(.)method(create)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) comment(# :nodoc:) - ident(cc) operator(=) pre_constant(nil)operator(;) ident(result) operator(=) ident(callcc) operator({)operator(|)ident(c)operator(|) ident(cc) operator(=) ident(c)operator(;) ident(block)operator(.)ident(call)operator(()ident(cc)operator(\)) reserved(if) ident(block) reserved(and) ident(args)operator(.)ident(empty?)operator(}) - ident(result) operator(||=) ident(args) - reserved(return) operator(*)operator([)ident(cc)operator(,) operator(*)ident(result)operator(]) - reserved(end) -reserved(end) - -reserved(class) class(Binding)operator(;) reserved(end) comment(# for RDoc) -comment(# This method returns the binding of the method that called your) -comment(# method. It will raise an Exception when you're not inside a method.) -comment(#) -comment(# It's used like this:) -comment(# def inc_counter(amount = 1\)) -comment(# Binding.of_caller do |binding|) -comment(# # Create a lambda that will increase the variable 'counter') -comment(# # in the caller of this method when called.) -comment(# inc = eval("lambda { |arg| counter += arg }", binding\)) -comment(# # We can refer to amount from inside this block safely.) -comment(# inc.call(amount\)) -comment(# end) -comment(# # No other statements can go here. Put them inside the block.) -comment(# end) -comment(# counter = 0) -comment(# 2.times { inc_counter }) -comment(# counter # => 2) -comment(#) -comment(# Binding.of_caller must be the last statement in the method.) -comment(# This means that you will have to put everything you want to) -comment(# do after the call to Binding.of_caller into the block of it.) -comment(# This should be no problem however, because Ruby has closures.) -comment(# If you don't do this an Exception will be raised. Because of) -comment(# the way that Binding.of_caller is implemented it has to be) -comment(# done this way.) -reserved(def) constant(Binding)operator(.)method(of_caller)operator(()operator(&)ident(block)operator(\)) - ident(old_critical) operator(=) constant(Thread)operator(.)ident(critical) - constant(Thread)operator(.)ident(critical) operator(=) pre_constant(true) - ident(count) operator(=) integer(0) - ident(cc)operator(,) ident(result)operator(,) ident(error)operator(,) ident(extra_data) operator(=) constant(Continuation)operator(.)ident(create)operator(()pre_constant(nil)operator(,) pre_constant(nil)operator(\)) - ident(error)operator(.)ident(call) reserved(if) ident(error) - - ident(tracer) operator(=) ident(lambda) reserved(do) operator(|*)ident(args)operator(|) - ident(type)operator(,) ident(context)operator(,) ident(extra_data) operator(=) ident(args)operator([)integer(0)operator(])operator(,) ident(args)operator([)integer(4)operator(])operator(,) ident(args) - reserved(if) ident(type) operator(==) string - ident(count) operator(+=) integer(1) - comment(# First this method and then calling one will return --) - comment(# the trace event of the second event gets the context) - comment(# of the method which called the method that called this) - comment(# method.) - reserved(if) ident(count) operator(==) integer(2) - comment(# It would be nice if we could restore the trace_func) - comment(# that was set before we swapped in our own one, but) - comment(# this is impossible without overloading set_trace_func) - comment(# in current Ruby.) - ident(set_trace_func)operator(()pre_constant(nil)operator(\)) - ident(cc)operator(.)ident(call)operator(()ident(eval)operator(()stringoperator(,) ident(context)operator(\))operator(,) pre_constant(nil)operator(,) ident(extra_data)operator(\)) - reserved(end) - reserved(elsif) ident(type) operator(==) string reserved(then) - pre_constant(nil) - reserved(elsif) ident(type) operator(==) string reserved(and) ident(extra_data)operator([)integer(3)operator(]) operator(==) symbol(:set_trace_func) reserved(then) - pre_constant(nil) - reserved(else) - ident(set_trace_func)operator(()pre_constant(nil)operator(\)) - ident(error_msg) operator(=) string operator(+) - string - ident(cc)operator(.)ident(call)operator(()pre_constant(nil)operator(,) ident(lambda) operator({) ident(raise)operator(()constant(ArgumentError)operator(,) ident(error_msg)operator(\)) operator(})operator(,) pre_constant(nil)operator(\)) - reserved(end) - reserved(end) - - reserved(unless) ident(result) - ident(set_trace_func)operator(()ident(tracer)operator(\)) - reserved(return) pre_constant(nil) - reserved(else) - constant(Thread)operator(.)ident(critical) operator(=) ident(old_critical) - reserved(case) ident(block)operator(.)ident(arity) - reserved(when) integer(1) reserved(then) reserved(yield)operator(()ident(result)operator(\)) - reserved(else) reserved(yield)operator(()ident(result)operator(,) ident(extra_data)operator(\)) - reserved(end) - reserved(end) -reserved(end) -comment(# The Breakpoint library provides the convenience of) -comment(# being able to inspect and modify state, diagnose) -comment(# bugs all via IRB by simply setting breakpoints in) -comment(# your applications by the call of a method.) -comment(#) -comment(# This library was written and is supported by me,) -comment(# Florian Gross. I can be reached at flgr@ccan.de) -comment(# and enjoy getting feedback about my libraries.) -comment(#) -comment(# The whole library (including breakpoint_client.rb) -comment(# and binding_of_caller.rb\) is licensed under the) -comment(# same license that Ruby uses. (Which is currently) -comment(# either the GNU General Public License or a custom) -comment(# one that allows for commercial usage.\) If you for) -comment(# some good reason need to use this under another) -comment(# license please contact me.) - -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string reserved(unless) reserved(defined?) constant(Binding)operator(.)ident(of_caller) -ident(require) string -ident(require) string - -reserved(module) class(Breakpoint) - ident(id) operator(=) string - constant(Version) operator(=) ident(id)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(2)operator(])operator(.)ident(to_i) - - ident(extend) pre_constant(self) - - comment(# This will pop up an interactive ruby session at a) - comment(# pre-defined break point in a Ruby application. In) - comment(# this session you can examine the environment of) - comment(# the break point.) - comment(#) - comment(# You can get a list of variables in the context using) - comment(# local_variables via +local_variables+. You can then) - comment(# examine their values by typing their names.) - comment(#) - comment(# You can have a look at the call stack via +caller+.) - comment(#) - comment(# The source code around the location where the breakpoint) - comment(# was executed can be examined via +source_lines+. Its) - comment(# argument specifies how much lines of context to display.) - comment(# The default amount of context is 5 lines. Note that) - comment(# the call to +source_lines+ can raise an exception when) - comment(# it isn't able to read in the source code.) - comment(#) - comment(# breakpoints can also return a value. They will execute) - comment(# a supplied block for getting a default return value.) - comment(# A custom value can be returned from the session by doing) - comment(# +throw(:debug_return, value\)+.) - comment(#) - comment(# You can also give names to break points which will be) - comment(# used in the message that is displayed upon execution ) - comment(# of them.) - comment(#) - comment(# Here's a sample of how breakpoints should be placed:) - comment(#) - comment(# class Person) - comment(# def initialize(name, age\)) - comment(# @name, @age = name, age) - comment(# breakpoint("Person#initialize"\)) - comment(# end) - comment(#) - comment(# attr_reader :age) - comment(# def name) - comment(# breakpoint("Person#name"\) { @name }) - comment(# end) - comment(# end) - comment(#) - comment(# person = Person.new("Random Person", 23\)) - comment(# puts "Name: #{person.name}") - comment(#) - comment(# And here is a sample debug session:) - comment(#) - comment(# Executing break point "Person#initialize" at file.rb:4 in `initialize') - comment(# irb(#\):001:0> local_variables) - comment(# => ["name", "age", "_", "__"]) - comment(# irb(#\):002:0> [name, age]) - comment(# => ["Random Person", 23]) - comment(# irb(#\):003:0> [@name, @age]) - comment(# => ["Random Person", 23]) - comment(# irb(#\):004:0> self) - comment(# => #) - comment(# irb(#\):005:0> @age += 1; self) - comment(# => #) - comment(# irb(#\):006:0> exit) - comment(# Executing break point "Person#name" at file.rb:9 in `name') - comment(# irb(#\):001:0> throw(:debug_return, "Overriden name"\)) - comment(# Name: Overriden name) - comment(#) - comment(# Breakpoint sessions will automatically have a few) - comment(# convenience methods available. See Breakpoint::CommandBundle) - comment(# for a list of them.) - comment(#) - comment(# Breakpoints can also be used remotely over sockets.) - comment(# This is implemented by running part of the IRB session) - comment(# in the application and part of it in a special client.) - comment(# You have to call Breakpoint.activate_drb to enable) - comment(# support for remote breakpoints and then run) - comment(# breakpoint_client.rb which is distributed with this) - comment(# library. See the documentation of Breakpoint.activate_drb) - comment(# for details.) - reserved(def) method(breakpoint)operator(()ident(id) operator(=) pre_constant(nil)operator(,) ident(context) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - ident(callstack) operator(=) ident(caller) - ident(callstack)operator(.)ident(slice!)operator(()integer(0)operator(,) integer(3)operator(\)) reserved(if) ident(callstack)operator(.)ident(first)operator([)stringoperator(]) - ident(file)operator(,) ident(line)operator(,) ident(method) operator(=) operator(*)ident(callstack)operator(.)ident(first)operator(.)ident(match)operator(()regexpoperator(\))operator(.)ident(captures) - - ident(message) operator(=) string operator(+) operator(()ident(id) operator(?) stringcontent( )delimiter(")> operator(:) stringoperator(\)) operator(+) - stringcontent(:)inlinedelimiter(")> operator(+) operator(()ident(method) operator(?) stringcontent(')delimiter(")> operator(:) stringoperator(\)) - - reserved(if) ident(context) reserved(then) - reserved(return) ident(handle_breakpoint)operator(()ident(context)operator(,) ident(message)operator(,) ident(file)operator(,) ident(line)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - constant(Binding)operator(.)ident(of_caller) reserved(do) operator(|)ident(binding_context)operator(|) - ident(handle_breakpoint)operator(()ident(binding_context)operator(,) ident(message)operator(,) ident(file)operator(,) ident(line)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - - reserved(module) class(CommandBundle) comment(#:nodoc:) - comment(# Proxy to a Breakpoint client. Lets you directly execute code) - comment(# in the context of the client.) - reserved(class) class(Client) comment(#:nodoc:) - reserved(def) method(initialize)operator(()ident(eval_handler)operator(\)) comment(# :nodoc:) - ident(eval_handler)operator(.)ident(untaint) - instance_variable(@eval_handler) operator(=) ident(eval_handler) - reserved(end) - - ident(instance_methods)operator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - reserved(next) reserved(if) ident(method)operator([)regexpoperator(]) - ident(undef_method) ident(method) - reserved(end) - - comment(# Executes the specified code at the client.) - reserved(def) method(eval)operator(()ident(code)operator(\)) - instance_variable(@eval_handler)operator(.)ident(call)operator(()ident(code)operator(\)) - reserved(end) - - comment(# Will execute the specified statement at the client.) - reserved(def) method(method_missing)operator(()ident(method)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(if) ident(args)operator(.)ident(empty?) reserved(and) reserved(not) ident(block) - ident(result) operator(=) ident(eval) stringdelimiter(")> - reserved(else) - comment(# This is a bit ugly. The alternative would be using an) - comment(# eval context instead of an eval handler for executing) - comment(# the code at the client. The problem with that approach) - comment(# is that we would have to handle special expressions) - comment(# like "self", "nil" or constants ourself which is hard.) - ident(remote) operator(=) ident(eval) stringcontent((*args, &block\) )nesting_delimiter(})content( - def result.call_with_block(*args, &block\) - call(block, *args\) - end - result - )delimiter(})> - ident(remote)operator(.)ident(call_with_block)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(return) ident(result) - reserved(end) - reserved(end) - - comment(# Returns the source code surrounding the location where the) - comment(# breakpoint was issued.) - reserved(def) method(source_lines)operator(()ident(context) operator(=) integer(5)operator(,) ident(return_line_numbers) operator(=) pre_constant(false)operator(\)) - ident(lines) operator(=) constant(File)operator(.)ident(readlines)operator(()instance_variable(@__bp_file)operator(\))operator(.)ident(map) operator({) operator(|)ident(line)operator(|) ident(line)operator(.)ident(chomp) operator(}) - - ident(break_line) operator(=) instance_variable(@__bp_line) - ident(start_line) operator(=) operator([)ident(break_line) operator(-) ident(context)operator(,) integer(1)operator(])operator(.)ident(max) - ident(end_line) operator(=) ident(break_line) operator(+) ident(context) - - ident(result) operator(=) ident(lines)operator([)operator(()ident(start_line) operator(-) integer(1)operator(\)) operator(..) operator(()ident(end_line) operator(-) integer(1)operator(\))operator(]) - - reserved(if) ident(return_line_numbers) reserved(then) - reserved(return) operator([)ident(start_line)operator(,) ident(break_line)operator(,) ident(result)operator(]) - reserved(else) - reserved(return) ident(result) - reserved(end) - reserved(end) - - comment(# Lets an object that will forward method calls to the breakpoint) - comment(# client. This is useful for outputting longer things at the client) - comment(# and so on. You can for example do these things:) - comment(#) - comment(# client.puts "Hello" # outputs "Hello" at client console) - comment(# # outputs "Hello" into the file temp.txt at the client) - comment(# client.File.open("temp.txt", "w"\) { |f| f.puts "Hello" } ) - reserved(def) method(client)operator(()operator(\)) - reserved(if) constant(Breakpoint)operator(.)ident(use_drb?) reserved(then) - ident(sleep)operator(()float(0.5)operator(\)) reserved(until) constant(Breakpoint)operator(.)ident(drb_service)operator(.)ident(eval_handler) - constant(Client)operator(.)ident(new)operator(()constant(Breakpoint)operator(.)ident(drb_service)operator(.)ident(eval_handler)operator(\)) - reserved(else) - constant(Client)operator(.)ident(new)operator(()ident(lambda) operator({) operator(|)ident(code)operator(|) ident(eval)operator(()ident(code)operator(,) pre_constant(TOPLEVEL_BINDING)operator(\)) operator(})operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(handle_breakpoint)operator(()ident(context)operator(,) ident(message)operator(,) ident(file) operator(=) stringoperator(,) ident(line) operator(=) stringoperator(,) operator(&)ident(block)operator(\)) comment(# :nodoc:) - ident(catch)operator(()symbol(:debug_return)operator(\)) reserved(do) operator(|)ident(value)operator(|) - ident(eval)operator(()stringcontent( - @__bp_line = )inlinecontent( - extend Breakpoint::CommandBundle - extend DRbUndumped if self - )delimiter(})>operator(,) ident(context)operator(\)) reserved(rescue) pre_constant(nil) - - reserved(if) reserved(not) ident(use_drb?) reserved(then) - ident(puts) ident(message) - constant(IRB)operator(.)ident(start)operator(()pre_constant(nil)operator(,) constant(IRB)operator(::)constant(WorkSpace)operator(.)ident(new)operator(()ident(context)operator(\))operator(\)) - reserved(else) - instance_variable(@drb_service)operator(.)ident(add_breakpoint)operator(()ident(context)operator(,) ident(message)operator(\)) - reserved(end) - - ident(block)operator(.)ident(call) reserved(if) ident(block) - reserved(end) - reserved(end) - - comment(# These exceptions will be raised on failed asserts) - comment(# if Breakpoint.asserts_cause_exceptions is set to) - comment(# true.) - reserved(class) class(FailedAssertError) operator(<) constant(RuntimeError) comment(#:nodoc:) - reserved(end) - - comment(# This asserts that the block evaluates to true.) - comment(# If it doesn't evaluate to true a breakpoint will) - comment(# automatically be created at that execution point.) - comment(#) - comment(# You can disable assert checking in production) - comment(# code by setting Breakpoint.optimize_asserts to) - comment(# true. (It will still be enabled when Ruby is run) - comment(# via the -d argument.\)) - comment(#) - comment(# Example:) - comment(# person_name = "Foobar") - comment(# assert { not person_name.nil? }) - comment(#) - comment(# Note: If you want to use this method from an) - comment(# unit test, you will have to call it by its full) - comment(# name, Breakpoint.assert.) - reserved(def) method(assert)operator(()ident(context) operator(=) pre_constant(nil)operator(,) operator(&)ident(condition)operator(\)) - reserved(return) reserved(if) constant(Breakpoint)operator(.)ident(optimize_asserts) reserved(and) reserved(not) global_variable($DEBUG) - reserved(return) reserved(if) reserved(yield) - - ident(callstack) operator(=) ident(caller) - ident(callstack)operator(.)ident(slice!)operator(()integer(0)operator(,) integer(3)operator(\)) reserved(if) ident(callstack)operator(.)ident(first)operator([)stringoperator(]) - ident(file)operator(,) ident(line)operator(,) ident(method) operator(=) operator(*)ident(callstack)operator(.)ident(first)operator(.)ident(match)operator(()regexpoperator(\))operator(.)ident(captures) - - ident(message) operator(=) stringcontent(:)inlineinlinecontent(')delimiter(")> reserved(if) ident(method)inline_delimiter(})>content(.)delimiter(")> - - reserved(if) constant(Breakpoint)operator(.)ident(asserts_cause_exceptions) reserved(and) reserved(not) global_variable($DEBUG) reserved(then) - ident(raise)operator(()constant(Breakpoint)operator(::)constant(FailedAssertError)operator(,) ident(message)operator(\)) - reserved(end) - - ident(message) operator(+=) string - - reserved(if) ident(context) reserved(then) - reserved(return) ident(handle_breakpoint)operator(()ident(context)operator(,) ident(message)operator(,) ident(file)operator(,) ident(line)operator(\)) - reserved(end) - - constant(Binding)operator(.)ident(of_caller) reserved(do) operator(|)ident(context)operator(|) - ident(handle_breakpoint)operator(()ident(context)operator(,) ident(message)operator(,) ident(file)operator(,) ident(line)operator(\)) - reserved(end) - reserved(end) - - comment(# Whether asserts should be ignored if not in debug mode.) - comment(# Debug mode can be enabled by running ruby with the -d) - comment(# switch or by setting $DEBUG to true.) - ident(attr_accessor) symbol(:optimize_asserts) - pre_constant(self)operator(.)ident(optimize_asserts) operator(=) pre_constant(false) - - comment(# Whether an Exception should be raised on failed asserts) - comment(# in non-$DEBUG code or not. By default this is disabled.) - ident(attr_accessor) symbol(:asserts_cause_exceptions) - pre_constant(self)operator(.)ident(asserts_cause_exceptions) operator(=) pre_constant(false) - instance_variable(@use_drb) operator(=) pre_constant(false) - - ident(attr_reader) symbol(:drb_service) comment(# :nodoc:) - - reserved(class) class(DRbService) comment(# :nodoc:) - ident(include) constant(DRbUndumped) - - reserved(def) method(initialize) - instance_variable(@handler) operator(=) instance_variable(@eval_handler) operator(=) instance_variable(@collision_handler) operator(=) pre_constant(nil) - - constant(IRB)operator(.)ident(instance_eval) operator({) instance_variable(@CONF)operator([)symbol(:RC)operator(]) operator(=) pre_constant(true) operator(}) - constant(IRB)operator(.)ident(run_config) - reserved(end) - - reserved(def) method(collision) - ident(sleep)operator(()float(0.5)operator(\)) reserved(until) instance_variable(@collision_handler) - - instance_variable(@collision_handler)operator(.)ident(untaint) - - instance_variable(@collision_handler)operator(.)ident(call) - reserved(end) - - reserved(def) method(ping)operator(()operator(\)) reserved(end) - - reserved(def) method(add_breakpoint)operator(()ident(context)operator(,) ident(message)operator(\)) - ident(workspace) operator(=) constant(IRB)operator(::)constant(WorkSpace)operator(.)ident(new)operator(()ident(context)operator(\)) - ident(workspace)operator(.)ident(extend)operator(()constant(DRbUndumped)operator(\)) - - ident(sleep)operator(()float(0.5)operator(\)) reserved(until) instance_variable(@handler) - - instance_variable(@handler)operator(.)ident(untaint) - instance_variable(@handler)operator(.)ident(call)operator(()ident(workspace)operator(,) ident(message)operator(\)) - reserved(end) - - ident(attr_accessor) symbol(:handler)operator(,) symbol(:eval_handler)operator(,) symbol(:collision_handler) - reserved(end) - - comment(# Will run Breakpoint in DRb mode. This will spawn a server) - comment(# that can be attached to via the breakpoint-client command) - comment(# whenever a breakpoint is executed. This is useful when you) - comment(# are debugging CGI applications or other applications where) - comment(# you can't access debug sessions via the standard input and) - comment(# output of your application.) - comment(#) - comment(# You can specify an URI where the DRb server will run at.) - comment(# This way you can specify the port the server runs on. The) - comment(# default URI is druby://localhost:42531.) - comment(#) - comment(# Please note that breakpoints will be skipped silently in) - comment(# case the DRb server can not spawned. (This can happen if) - comment(# the port is already used by another instance of your) - comment(# application on CGI or another application.\)) - comment(#) - comment(# Also note that by default this will only allow access) - comment(# from localhost. You can however specify a list of) - comment(# allowed hosts or nil (to allow access from everywhere\).) - comment(# But that will still not protect you from somebody) - comment(# reading the data as it goes through the net.) - comment(#) - comment(# A good approach for getting security and remote access) - comment(# is setting up an SSH tunnel between the DRb service) - comment(# and the client. This is usually done like this:) - comment(#) - comment(# $ ssh -L20000:127.0.0.1:20000 -R10000:127.0.0.1:10000 example.com) - comment(# (This will connect port 20000 at the client side to port) - comment(# 20000 at the server side, and port 10000 at the server) - comment(# side to port 10000 at the client side.\)) - comment(#) - comment(# After that do this on the server side: (the code being debugged\)) - comment(# Breakpoint.activate_drb("druby://127.0.0.1:20000", "localhost"\)) - comment(#) - comment(# And at the client side:) - comment(# ruby breakpoint_client.rb -c druby://127.0.0.1:10000 -s druby://127.0.0.1:20000) - comment(#) - comment(# Running through such a SSH proxy will also let you use ) - comment(# breakpoint.rb in case you are behind a firewall.) - comment(#) - comment(# Detailed information about running DRb through firewalls is) - comment(# available at http://www.rubygarden.org/ruby?DrbTutorial) - reserved(def) method(activate_drb)operator(()ident(uri) operator(=) pre_constant(nil)operator(,) ident(allowed_hosts) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) - ident(ignore_collisions) operator(=) pre_constant(false)operator(\)) - - reserved(return) pre_constant(false) reserved(if) instance_variable(@use_drb) - - ident(uri) operator(||=) string - - reserved(if) ident(allowed_hosts) reserved(then) - ident(acl) operator(=) operator([)stringoperator(,) stringoperator(]) - - ident(Array)operator(()ident(allowed_hosts)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(host)operator(|) - ident(acl) operator(+=) operator([)stringoperator(,) ident(host)operator(]) - reserved(end) - - constant(DRb)operator(.)ident(install_acl)operator(()constant(ACL)operator(.)ident(new)operator(()ident(acl)operator(\))operator(\)) - reserved(end) - - instance_variable(@use_drb) operator(=) pre_constant(true) - instance_variable(@drb_service) operator(=) constant(DRbService)operator(.)ident(new) - ident(did_collision) operator(=) pre_constant(false) - reserved(begin) - instance_variable(@service) operator(=) constant(DRb)operator(.)ident(start_service)operator(()ident(uri)operator(,) instance_variable(@drb_service)operator(\)) - reserved(rescue) constant(Errno)operator(::)constant(EADDRINUSE) - reserved(if) ident(ignore_collisions) reserved(then) - pre_constant(nil) - reserved(else) - comment(# The port is already occupied by another) - comment(# Breakpoint service. We will try to tell) - comment(# the old service that we want its port.) - comment(# It will then forward that request to the) - comment(# user and retry.) - reserved(unless) ident(did_collision) reserved(then) - constant(DRbObject)operator(.)ident(new)operator(()pre_constant(nil)operator(,) ident(uri)operator(\))operator(.)ident(collision) - ident(did_collision) operator(=) pre_constant(true) - reserved(end) - ident(sleep)operator(()integer(10)operator(\)) - reserved(retry) - reserved(end) - reserved(end) - - reserved(return) pre_constant(true) - reserved(end) - - comment(# Deactivates a running Breakpoint service.) - reserved(def) method(deactivate_drb) - instance_variable(@service)operator(.)ident(stop_service) reserved(unless) instance_variable(@service)operator(.)ident(nil?) - instance_variable(@service) operator(=) pre_constant(nil) - instance_variable(@use_drb) operator(=) pre_constant(false) - instance_variable(@drb_service) operator(=) pre_constant(nil) - reserved(end) - - comment(# Returns true when Breakpoints are used over DRb.) - comment(# Breakpoint.activate_drb causes this to be true.) - reserved(def) method(use_drb?) - instance_variable(@use_drb) operator(==) pre_constant(true) - reserved(end) -reserved(end) - -reserved(module) class(IRB) comment(#:nodoc:) - reserved(class) operator(<<) class(self)operator(;) ident(remove_method) symbol(:start)operator(;) reserved(end) - reserved(def) pre_constant(self)operator(.)method(start)operator(()ident(ap_path) operator(=) pre_constant(nil)operator(,) ident(main_context) operator(=) pre_constant(nil)operator(,) ident(workspace) operator(=) pre_constant(nil)operator(\)) - global_variable($0) operator(=) constant(File)operator(::)ident(basename)operator(()ident(ap_path)operator(,) stringoperator(\)) reserved(if) ident(ap_path) - - comment(# suppress some warnings about redefined constants) - ident(old_verbose)operator(,) global_variable($VERBOSE) operator(=) global_variable($VERBOSE)operator(,) pre_constant(nil) - constant(IRB)operator(.)ident(setup)operator(()ident(ap_path)operator(\)) - global_variable($VERBOSE) operator(=) ident(old_verbose) - - reserved(if) instance_variable(@CONF)operator([)symbol(:SCRIPT)operator(]) reserved(then) - ident(irb) operator(=) constant(Irb)operator(.)ident(new)operator(()ident(main_context)operator(,) instance_variable(@CONF)operator([)symbol(:SCRIPT)operator(])operator(\)) - reserved(else) - ident(irb) operator(=) constant(Irb)operator(.)ident(new)operator(()ident(main_context)operator(\)) - reserved(end) - - reserved(if) ident(workspace) reserved(then) - ident(irb)operator(.)ident(context)operator(.)ident(workspace) operator(=) ident(workspace) - reserved(end) - - instance_variable(@CONF)operator([)symbol(:IRB_RC)operator(])operator(.)ident(call)operator(()ident(irb)operator(.)ident(context)operator(\)) reserved(if) instance_variable(@CONF)operator([)symbol(:IRB_RC)operator(]) - instance_variable(@CONF)operator([)symbol(:MAIN_CONTEXT)operator(]) operator(=) ident(irb)operator(.)ident(context) - - ident(old_sigint) operator(=) ident(trap)operator(()stringoperator(\)) reserved(do) - reserved(begin) - ident(irb)operator(.)ident(signal_handle) - reserved(rescue) constant(RubyLex)operator(::)constant(TerminateLineInput) - comment(# ignored) - reserved(end) - reserved(end) - - ident(catch)operator(()symbol(:IRB_EXIT)operator(\)) reserved(do) - ident(irb)operator(.)ident(eval_input) - reserved(end) - reserved(ensure) - ident(trap)operator(()stringoperator(,) ident(old_sigint)operator(\)) - reserved(end) - - reserved(class) operator(<<) class(self) - reserved(alias) symbol(:old_CurrentContext) symbol(:CurrentContext) - ident(remove_method) symbol(:CurrentContext) - reserved(end) - reserved(def) constant(IRB)operator(.)method(CurrentContext) - reserved(if) ident(old_CurrentContext)operator(.)ident(nil?) reserved(and) constant(Breakpoint)operator(.)ident(use_drb?) reserved(then) - ident(result) operator(=) constant(Object)operator(.)ident(new) - reserved(def) ident(result)operator(.)method(last_value)operator(;) reserved(end) - reserved(return) ident(result) - reserved(else) - ident(old_CurrentContext) - reserved(end) - reserved(end) - reserved(def) constant(IRB)operator(.)method(parse_opts)operator(()operator(\)) reserved(end) - - reserved(class) class(Context) comment(#:nodoc:) - reserved(alias) symbol(:old_evaluate) symbol(:evaluate) - reserved(def) method(evaluate)operator(()ident(line)operator(,) ident(line_no)operator(\)) - reserved(if) ident(line)operator(.)ident(chomp) operator(==) string reserved(then) - ident(exit) - reserved(else) - ident(old_evaluate)operator(()ident(line)operator(,) ident(line_no)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(class) class(WorkSpace) comment(#:nodoc:) - reserved(alias) symbol(:old_evaluate) symbol(:evaluate) - - reserved(def) method(evaluate)operator(()operator(*)ident(args)operator(\)) - reserved(if) constant(Breakpoint)operator(.)ident(use_drb?) reserved(then) - ident(result) operator(=) ident(old_evaluate)operator(()operator(*)ident(args)operator(\)) - reserved(if) ident(args)operator([)integer(0)operator(]) operator(!=) symbol(:no_proxy) reserved(and) - reserved(not) operator([)pre_constant(true)operator(,) pre_constant(false)operator(,) pre_constant(nil)operator(])operator(.)ident(include?)operator(()ident(result)operator(\)) - reserved(then) - ident(result)operator(.)ident(extend)operator(()constant(DRbUndumped)operator(\)) reserved(rescue) pre_constant(nil) - reserved(end) - reserved(return) ident(result) - reserved(else) - ident(old_evaluate)operator(()operator(*)ident(args)operator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(module) class(InputCompletor) comment(#:nodoc:) - reserved(def) pre_constant(self)operator(.)method(eval)operator(()ident(code)operator(,) ident(context)operator(,) operator(*)ident(more)operator(\)) - comment(# Big hack, this assumes that InputCompletor) - comment(# will only call eval(\) when it wants code) - comment(# to be executed in the IRB context.) - constant(IRB)operator(.)ident(conf)operator([)symbol(:MAIN_CONTEXT)operator(])operator(.)ident(workspace)operator(.)ident(evaluate)operator(()symbol(:no_proxy)operator(,) ident(code)operator(,) operator(*)ident(more)operator(\)) - reserved(end) - reserved(end) -reserved(end) - -reserved(module) class(DRb) comment(# :nodoc:) - reserved(class) class(DRbObject) comment(#:nodoc:) - reserved(undef) symbol(:inspect) reserved(if) ident(method_defined?)operator(()symbol(:inspect)operator(\)) - reserved(undef) symbol(:clone) reserved(if) ident(method_defined?)operator(()symbol(:clone)operator(\)) - reserved(end) -reserved(end) - -comment(# See Breakpoint.breakpoint) -reserved(def) method(breakpoint)operator(()ident(id) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - constant(Binding)operator(.)ident(of_caller) reserved(do) operator(|)ident(context)operator(|) - constant(Breakpoint)operator(.)ident(breakpoint)operator(()ident(id)operator(,) ident(context)operator(,) operator(&)ident(block)operator(\)) - reserved(end) -reserved(end) - -comment(# See Breakpoint.assert) -reserved(def) method(assert)operator(()operator(&)ident(block)operator(\)) - constant(Binding)operator(.)ident(of_caller) reserved(do) operator(|)ident(context)operator(|) - constant(Breakpoint)operator(.)ident(assert)operator(()ident(context)operator(,) operator(&)ident(block)operator(\)) - reserved(end) -reserved(end) -reserved(module) class(ActiveSupport) - reserved(module) class(CachingTools) comment(#:nodoc:) - - comment(# Provide shortcuts to simply the creation of nested default hashes. This) - comment(# pattern is useful, common practice, and unsightly when done manually.) - reserved(module) class(HashCaching) - comment(# Dynamically create a nested hash structure used to cache calls to +method_name+) - comment(# The cache method is named +#{method_name}_cache+ unless :as => :alternate_name) - comment(# is given.) - comment(#) - comment(# The hash structure is created using nested Hash.new. For example:) - comment(# ) - comment(# def slow_method(a, b\) a ** b end) - comment(# ) - comment(# can be cached using hash_cache :slow_method, which will define the method) - comment(# slow_method_cache. We can then find the result of a ** b using:) - comment(# ) - comment(# slow_method_cache[a][b]) - comment(# ) - comment(# The hash structure returned by slow_method_cache would look like this:) - comment(# ) - comment(# Hash.new do |as, a|) - comment(# as[a] = Hash.new do |bs, b|) - comment(# bs[b] = slow_method(a, b\)) - comment(# end) - comment(# end) - comment(# ) - comment(# The generated code is actually compressed onto a single line to maintain) - comment(# sensible backtrace signatures.) - comment(#) - reserved(def) method(hash_cache)operator(()ident(method_name)operator(,) ident(options) operator(=) operator({)operator(})operator(\)) - ident(selector) operator(=) ident(options)operator([)symbol(:as)operator(]) operator(||) stringcontent(_cache)delimiter(")> - ident(method) operator(=) pre_constant(self)operator(.)ident(instance_method)operator(()ident(method_name)operator(\)) - - ident(args) operator(=) operator([)operator(]) - ident(code) operator(=) stringcontent((\); @)inlinecontent( ||= )delimiter(")> - - operator(()integer(1)operator(..)ident(method)operator(.)ident(arity)operator(\))operator(.)ident(each) reserved(do) operator(|)ident(n)operator(|) - ident(args) operator(<<) stringdelimiter(")> - ident(code) operator(<<) stringcontent(, v)inlinecontent(| h)inlinecontent([v)inlinecontent(] = )delimiter(")> - reserved(end) - - comment(# Add the method call with arguments, followed by closing braces and end.) - ident(code) operator(<<) stringcontent(()inlineinline_delimiter(})>content(\) )inline operator(*) ident(method)operator(.)ident(arity)inline_delimiter(})>content( end)delimiter(")> - - comment(# Extract the line number information from the caller. Exceptions arising) - comment(# in the generated code should point to the +hash_cache :...+ line.) - reserved(if) ident(caller)operator([)integer(0)operator(]) operator(&&) regexp operator(=)operator(~) ident(caller)operator([)integer(0)operator(]) - ident(file)operator(,) ident(line_number) operator(=) global_variable($1)operator(,) global_variable($2)operator(.)ident(to_i) - reserved(else) comment(# We can't give good trackback info; fallback to this line:) - ident(file)operator(,) ident(line_number) operator(=) pre_constant(__FILE__)operator(,) pre_constant(__LINE__) - reserved(end) - - comment(# We use eval rather than building proc's because it allows us to avoid) - comment(# linking the Hash's to this method's binding. Experience has shown that) - comment(# doing so can cause obtuse memory leaks.) - ident(class_eval) ident(code)operator(,) ident(file)operator(,) ident(line_number) - reserved(end) - reserved(end) - - reserved(end) -reserved(end) -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(Logger) comment(#:nodoc:) - ident(cattr_accessor) symbol(:silencer) - pre_constant(self)operator(.)ident(silencer) operator(=) pre_constant(true) - - comment(# Silences the logger for the duration of the block.) - reserved(def) method(silence)operator(()ident(temporary_level) operator(=) constant(Logger)operator(::)constant(ERROR)operator(\)) - reserved(if) ident(silencer) - reserved(begin) - ident(old_logger_level)operator(,) pre_constant(self)operator(.)ident(level) operator(=) ident(level)operator(,) ident(temporary_level) - reserved(yield) pre_constant(self) - reserved(ensure) - pre_constant(self)operator(.)ident(level) operator(=) ident(old_logger_level) - reserved(end) - reserved(else) - reserved(yield) pre_constant(self) - reserved(end) - reserved(end) - - ident(private) - reserved(alias) method(old_format_message) method(format_message) - - comment(# Ruby 1.8.3 transposed the msg and progname arguments to format_message.) - comment(# We can't test RUBY_VERSION because some distributions don't keep Ruby) - comment(# and its standard library in sync, leading to installations of Ruby 1.8.2) - comment(# with Logger from 1.8.3 and vice versa.) - reserved(if) ident(method_defined?)operator(()symbol(:formatter=)operator(\)) - reserved(def) method(format_message)operator(()ident(severity)operator(,) ident(timestamp)operator(,) ident(progname)operator(,) ident(msg)operator(\)) - stringchar(\\n)delimiter(")> - reserved(end) - reserved(else) - reserved(def) method(format_message)operator(()ident(severity)operator(,) ident(timestamp)operator(,) ident(msg)operator(,) ident(progname)operator(\)) - stringchar(\\n)delimiter(")> - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Array) comment(#:nodoc:) - reserved(module) class(Conversions) - comment(# Converts the array to comma-seperated sentence where the last element is joined by the connector word. Options:) - comment(# * :connector: The word used to join the last element in arrays with more than two elements (default: "and"\)) - comment(# * :skip_last_comma: Set to true to return "a, b, and c" instead of "a, b and c".) - reserved(def) method(to_sentence)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(options)operator(.)ident(assert_valid_keys)operator(()symbol(:connector)operator(,) symbol(:skip_last_comma)operator(\)) - ident(options)operator(.)ident(reverse_merge!) symbol(:connector) operator(=)operator(>) stringoperator(,) symbol(:skip_last_comma) operator(=)operator(>) pre_constant(false) - - reserved(case) ident(length) - reserved(when) integer(0) - string - reserved(when) integer(1) - pre_constant(self)operator([)integer(0)operator(]) - reserved(when) integer(2) - stringcontent( )inlinecontent( )inlinedelimiter(")> - reserved(else) - stringoperator(\))inline_delimiter(})>inline operator(:) stringinline_delimiter(})>content( )inlinecontent( )inlinedelimiter(")> - reserved(end) - reserved(end) - - comment(# When an array is given to url_for, it is converted to a slash separated string.) - reserved(def) method(to_param) - ident(join) string - reserved(end) - - reserved(def) method(to_xml)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(raise) string reserved(unless) ident(all?) operator({) operator(|)ident(e)operator(|) ident(e)operator(.)ident(respond_to?) symbol(:to_xml) operator(}) - - ident(options)operator([)symbol(:root)operator(]) operator(||=) ident(all?) operator({) operator(|)ident(e)operator(|) ident(e)operator(.)ident(is_a?)operator(()ident(first)operator(.)ident(class)operator(\)) operator(&&) ident(first)operator(.)ident(class)operator(.)ident(to_s) operator(!=) string operator(}) operator(?) ident(first)operator(.)ident(class)operator(.)ident(to_s)operator(.)ident(underscore)operator(.)ident(pluralize) operator(:) string - ident(options)operator([)symbol(:children)operator(]) operator(||=) ident(options)operator([)symbol(:root)operator(])operator(.)ident(singularize) - ident(options)operator([)symbol(:indent)operator(]) operator(||=) integer(2) - ident(options)operator([)symbol(:builder)operator(]) operator(||=) constant(Builder)operator(::)constant(XmlMarkup)operator(.)ident(new)operator(()symbol(:indent) operator(=)operator(>) ident(options)operator([)symbol(:indent)operator(])operator(\)) - - ident(root) operator(=) ident(options)operator(.)ident(delete)operator(()symbol(:root)operator(\)) - ident(children) operator(=) ident(options)operator(.)ident(delete)operator(()symbol(:children)operator(\)) - - ident(options)operator([)symbol(:builder)operator(])operator(.)ident(instruct!) reserved(unless) ident(options)operator(.)ident(delete)operator(()symbol(:skip_instruct)operator(\)) - ident(options)operator([)symbol(:builder)operator(])operator(.)ident(tag!)operator(()ident(root)operator(.)ident(to_s)operator(.)ident(dasherize)operator(\)) operator({) ident(each) operator({) operator(|)ident(e)operator(|) ident(e)operator(.)ident(to_xml)operator(()ident(options)operator(.)ident(merge)operator(()operator({) symbol(:skip_instruct) operator(=)operator(>) pre_constant(true)operator(,) symbol(:root) operator(=)operator(>) ident(children) operator(})operator(\))operator(\)) operator(}) operator(}) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(Array) comment(#:nodoc:) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Array)operator(::)constant(Conversions) - - comment(# Iterate over an array in groups of a certain size, padding any remaining ) - comment(# slots with specified value (nil by default\).) - comment(# ) - comment(# E.g.) - comment(# ) - comment(# %w(1 2 3 4 5 6 7\).in_groups_of(3\) {|g| p g}) - comment(# ["1", "2", "3"]) - comment(# ["4", "5", "6"]) - comment(# ["7", nil, nil]) - reserved(def) method(in_groups_of)operator(()ident(number)operator(,) ident(fill_with) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) - ident(require) string - ident(collection) operator(=) ident(dup) - ident(collection) operator(<<) ident(fill_with) reserved(until) ident(collection)operator(.)ident(size)operator(.)ident(modulo)operator(()ident(number)operator(\))operator(.)ident(zero?) - ident(collection)operator(.)ident(each_slice)operator(()ident(number)operator(,) operator(&)ident(block)operator(\)) - reserved(end) -reserved(end) -reserved(class) class(Object) comment(#:nodoc:) - comment(# "", " ", nil, [], and {} are blank) - reserved(def) method(blank?) - reserved(if) ident(respond_to?)operator(()symbol(:empty?)operator(\)) operator(&&) ident(respond_to?)operator(()symbol(:strip)operator(\)) - ident(empty?) reserved(or) ident(strip)operator(.)ident(empty?) - reserved(elsif) ident(respond_to?)operator(()symbol(:empty?)operator(\)) - ident(empty?) - reserved(else) - operator(!)pre_constant(self) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(NilClass) comment(#:nodoc:) - reserved(def) method(blank?) - pre_constant(true) - reserved(end) -reserved(end) - -reserved(class) class(FalseClass) comment(#:nodoc:) - reserved(def) method(blank?) - pre_constant(true) - reserved(end) -reserved(end) - -reserved(class) class(TrueClass) comment(#:nodoc:) - reserved(def) method(blank?) - pre_constant(false) - reserved(end) -reserved(end) - -reserved(class) class(Array) comment(#:nodoc:) - ident(alias_method) symbol(:blank?)operator(,) symbol(:empty?) -reserved(end) - -reserved(class) class(Hash) comment(#:nodoc:) - ident(alias_method) symbol(:blank?)operator(,) symbol(:empty?) -reserved(end) - -reserved(class) class(String) comment(#:nodoc:) - reserved(def) method(blank?) - ident(empty?) operator(||) ident(strip)operator(.)ident(empty?) - reserved(end) -reserved(end) - -reserved(class) class(Numeric) comment(#:nodoc:) - reserved(def) method(blank?) - pre_constant(false) - reserved(end) -ident(endmodule) constant(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(CGI) comment(#:nodoc:) - reserved(module) class(EscapeSkippingSlashes) comment(#:nodoc:) - reserved(def) method(escape_skipping_slashes)operator(()ident(str)operator(\)) - ident(str) operator(=) ident(str)operator(.)ident(join)operator(()stringoperator(\)) reserved(if) ident(str)operator(.)ident(respond_to?) symbol(:join) - ident(str)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) - stringoperator(\))operator(.)ident(first)operator(.)ident(upcase)inline_delimiter(})>delimiter(")> - reserved(end)operator(.)ident(tr)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(CGI) comment(#:nodoc:) - ident(extend)operator(()constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(CGI)operator(::)constant(EscapeSkippingSlashes)operator(\)) -reserved(end) -comment(# Extends the class object with class and instance accessors for class attributes,) -comment(# just like the native attr* accessors for instance attributes.) -reserved(class) class(Class) comment(# :nodoc:) - reserved(def) method(cattr_reader)operator(()operator(*)ident(syms)operator(\)) - ident(syms)operator(.)ident(flatten)operator(.)ident(each) reserved(do) operator(|)ident(sym)operator(|) - ident(class_eval)operator(()stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)operator(\))stringcontent( - @@)inlinecontent( = nil - end - - def self.)inlinecontent( - @@)inlinecontent( - end - - def )inlinecontent( - @@)inlinecontent( - end)delimiter( - EOS)> - reserved(end) - reserved(end) - - reserved(def) method(cattr_writer)operator(()operator(*)ident(syms)operator(\)) - ident(syms)operator(.)ident(flatten)operator(.)ident(each) reserved(do) operator(|)ident(sym)operator(|) - ident(class_eval)operator(()stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)operator(\))stringcontent( - @@)inlinecontent( = nil - end - - def self.)inlinecontent(=(obj\) - @@)inlinecontent( = obj - end - - def )inlinecontent(=(obj\) - @@)inlinecontent( = obj - end)delimiter( - EOS)> - reserved(end) - reserved(end) - - reserved(def) method(cattr_accessor)operator(()operator(*)ident(syms)operator(\)) - ident(cattr_reader)operator(()operator(*)ident(syms)operator(\)) - ident(cattr_writer)operator(()operator(*)ident(syms)operator(\)) - reserved(end) -reserved(end) -comment(# Retain for backward compatibility. Methods are now included in Class.) -reserved(module) class(ClassInheritableAttributes) comment(# :nodoc:) -reserved(end) - -comment(# Allows attributes to be shared within an inheritance hierarchy, but where each descendant gets a copy of) -comment(# their parents' attributes, instead of just a pointer to the same. This means that the child can add elements) -comment(# to, for example, an array without those additions being shared with either their parent, siblings, or) -comment(# children, which is unlike the regular class-level attributes that are shared across the entire hierarchy.) -reserved(class) class(Class) comment(# :nodoc:) - reserved(def) method(class_inheritable_reader)operator(()operator(*)ident(syms)operator(\)) - ident(syms)operator(.)ident(each) reserved(do) operator(|)ident(sym)operator(|) - ident(class_eval) stringstringcontent( - read_inheritable_attribute(:)inlinecontent(\) - end - - def )inlinecontent( - self.class.)inlinecontent( - end)delimiter( - EOS)> - reserved(end) - reserved(end) - - reserved(def) method(class_inheritable_writer)operator(()operator(*)ident(syms)operator(\)) - ident(syms)operator(.)ident(each) reserved(do) operator(|)ident(sym)operator(|) - ident(class_eval) stringstringcontent(=(obj\) - write_inheritable_attribute(:)inlinecontent(, obj\) - end - - def )inlinecontent(=(obj\) - self.class.)inlinecontent( = obj - end)delimiter( - EOS)> - reserved(end) - reserved(end) - - reserved(def) method(class_inheritable_array_writer)operator(()operator(*)ident(syms)operator(\)) - ident(syms)operator(.)ident(each) reserved(do) operator(|)ident(sym)operator(|) - ident(class_eval) stringstringcontent(=(obj\) - write_inheritable_array(:)inlinecontent(, obj\) - end - - def )inlinecontent(=(obj\) - self.class.)inlinecontent( = obj - end)delimiter( - EOS)> - reserved(end) - reserved(end) - - reserved(def) method(class_inheritable_hash_writer)operator(()operator(*)ident(syms)operator(\)) - ident(syms)operator(.)ident(each) reserved(do) operator(|)ident(sym)operator(|) - ident(class_eval) stringstringcontent(=(obj\) - write_inheritable_hash(:)inlinecontent(, obj\) - end - - def )inlinecontent(=(obj\) - self.class.)inlinecontent( = obj - end)delimiter( - EOS)> - reserved(end) - reserved(end) - - reserved(def) method(class_inheritable_accessor)operator(()operator(*)ident(syms)operator(\)) - ident(class_inheritable_reader)operator(()operator(*)ident(syms)operator(\)) - ident(class_inheritable_writer)operator(()operator(*)ident(syms)operator(\)) - reserved(end) - - reserved(def) method(class_inheritable_array)operator(()operator(*)ident(syms)operator(\)) - ident(class_inheritable_reader)operator(()operator(*)ident(syms)operator(\)) - ident(class_inheritable_array_writer)operator(()operator(*)ident(syms)operator(\)) - reserved(end) - - reserved(def) method(class_inheritable_hash)operator(()operator(*)ident(syms)operator(\)) - ident(class_inheritable_reader)operator(()operator(*)ident(syms)operator(\)) - ident(class_inheritable_hash_writer)operator(()operator(*)ident(syms)operator(\)) - reserved(end) - - reserved(def) method(inheritable_attributes) - instance_variable(@inheritable_attributes) operator(||=) operator({)operator(}) - reserved(end) - - reserved(def) method(write_inheritable_attribute)operator(()ident(key)operator(,) ident(value)operator(\)) - ident(inheritable_attributes)operator([)ident(key)operator(]) operator(=) ident(value) - reserved(end) - - reserved(def) method(write_inheritable_array)operator(()ident(key)operator(,) ident(elements)operator(\)) - ident(write_inheritable_attribute)operator(()ident(key)operator(,) operator([)operator(])operator(\)) reserved(if) ident(read_inheritable_attribute)operator(()ident(key)operator(\))operator(.)ident(nil?) - ident(write_inheritable_attribute)operator(()ident(key)operator(,) ident(read_inheritable_attribute)operator(()ident(key)operator(\)) operator(+) ident(elements)operator(\)) - reserved(end) - - reserved(def) method(write_inheritable_hash)operator(()ident(key)operator(,) ident(hash)operator(\)) - ident(write_inheritable_attribute)operator(()ident(key)operator(,) operator({)operator(})operator(\)) reserved(if) ident(read_inheritable_attribute)operator(()ident(key)operator(\))operator(.)ident(nil?) - ident(write_inheritable_attribute)operator(()ident(key)operator(,) ident(read_inheritable_attribute)operator(()ident(key)operator(\))operator(.)ident(merge)operator(()ident(hash)operator(\))operator(\)) - reserved(end) - - reserved(def) method(read_inheritable_attribute)operator(()ident(key)operator(\)) - ident(inheritable_attributes)operator([)ident(key)operator(]) - reserved(end) - - reserved(def) method(reset_inheritable_attributes) - ident(inheritable_attributes)operator(.)ident(clear) - reserved(end) - - ident(private) - reserved(def) method(inherited_with_inheritable_attributes)operator(()ident(child)operator(\)) - ident(inherited_without_inheritable_attributes)operator(()ident(child)operator(\)) reserved(if) ident(respond_to?)operator(()symbol(:inherited_without_inheritable_attributes)operator(\)) - ident(child)operator(.)ident(instance_variable_set)operator(()stringoperator(,) ident(inheritable_attributes)operator(.)ident(dup)operator(\)) - reserved(end) - - reserved(alias) method(inherited_without_inheritable_attributes) method(inherited) - reserved(alias) method(inherited) method(inherited_with_inheritable_attributes) -reserved(end) -reserved(class) class(Class) comment(#:nodoc:) - reserved(def) method(remove_subclasses) - constant(Object)operator(.)ident(remove_subclasses_of)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(subclasses) - constant(Object)operator(.)ident(subclasses_of)operator(()pre_constant(self)operator(\))operator(.)ident(map) operator({) operator(|)ident(o)operator(|) ident(o)operator(.)ident(to_s) operator(}) - reserved(end) - - reserved(def) method(remove_class)operator(()operator(*)ident(klasses)operator(\)) - ident(klasses)operator(.)ident(flatten)operator(.)ident(each) reserved(do) operator(|)ident(klass)operator(|) - comment(# Skip this class if there is nothing bound to this name) - reserved(next) reserved(unless) reserved(defined?)operator(()ident(klass)operator(.)ident(name)operator(\)) - - ident(basename) operator(=) ident(klass)operator(.)ident(to_s)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(last) - ident(parent) operator(=) ident(klass)operator(.)ident(parent) - - comment(# Skip this class if it does not match the current one bound to this name) - reserved(next) reserved(unless) ident(parent)operator(.)ident(const_defined?)operator(()ident(basename)operator(\)) operator(&&) ident(klass) operator(=) ident(parent)operator(.)ident(const_get)operator(()ident(basename)operator(\)) - - ident(parent)operator(.)ident(send) symbol(:remove_const)operator(,) ident(basename) reserved(unless) ident(parent) operator(==) ident(klass) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringreserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Date) comment(#:nodoc:) - comment(# Getting dates in different convenient string representations and other objects) - reserved(module) class(Conversions) - constant(DATE_FORMATS) operator(=) operator({) - symbol(:short) operator(=)operator(>) stringoperator(,) - symbol(:long) operator(=)operator(>) string - operator(}) - - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(klass)operator(\)) comment(#:nodoc:) - ident(klass)operator(.)ident(send)operator(()symbol(:alias_method)operator(,) symbol(:to_default_s)operator(,) symbol(:to_s)operator(\)) - ident(klass)operator(.)ident(send)operator(()symbol(:alias_method)operator(,) symbol(:to_s)operator(,) symbol(:to_formatted_s)operator(\)) - reserved(end) - - reserved(def) method(to_formatted_s)operator(()ident(format) operator(=) symbol(:default)operator(\)) - constant(DATE_FORMATS)operator([)ident(format)operator(]) operator(?) ident(strftime)operator(()constant(DATE_FORMATS)operator([)ident(format)operator(])operator(\))operator(.)ident(strip) operator(:) ident(to_default_s) - reserved(end) - - comment(# To be able to keep Dates and Times interchangeable on conversions) - reserved(def) method(to_date) - pre_constant(self) - reserved(end) - - reserved(def) method(to_time)operator(()ident(form) operator(=) symbol(:local)operator(\)) - operator(::)constant(Time)operator(.)ident(send)operator(()ident(form)operator(,) ident(year)operator(,) ident(month)operator(,) ident(day)operator(\)) - reserved(end) - - reserved(alias) symbol(:xmlschema) symbol(:to_s) - reserved(end) - reserved(end) - reserved(end) -ident(endrequire) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(Date)comment(#:nodoc:) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Date)operator(::)constant(Conversions) -reserved(end) -reserved(module) class(Enumerable) comment(#:nodoc:) - reserved(def) method(first_match) - ident(match) operator(=) pre_constant(nil) - ident(each) reserved(do) operator(|)ident(items)operator(|) - reserved(break) reserved(if) ident(match) operator(=) reserved(yield)operator(()ident(items)operator(\)) - reserved(end) - ident(match) - reserved(end) - - comment(# Collect an enumerable into sets, grouped by the result of a block. Useful,) - comment(# for example, for grouping records by date.) - comment(#) - comment(# e.g. ) - comment(#) - comment(# latest_transcripts.group_by(&:day\).each do |day, transcripts| ) - comment(# p "#{day} -> #{transcripts.map(&:class\) * ', '}") - comment(# end) - comment(# "2006-03-01 -> Transcript") - comment(# "2006-02-28 -> Transcript") - comment(# "2006-02-27 -> Transcript, Transcript") - comment(# "2006-02-26 -> Transcript, Transcript") - comment(# "2006-02-25 -> Transcript") - comment(# "2006-02-24 -> Transcript, Transcript") - comment(# "2006-02-23 -> Transcript") - reserved(def) method(group_by) - ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(groups)operator(,) ident(element)operator(|) - operator(()ident(groups)operator([)reserved(yield)operator(()ident(element)operator(\))operator(]) operator(||=) operator([)operator(])operator(\)) operator(<<) ident(element) - ident(groups) - reserved(end) - reserved(end) -reserved(end) -reserved(class) class(Exception) comment(# :nodoc:) - reserved(def) method(clean_message) - constant(Pathname)operator(.)ident(clean_within) ident(message) - reserved(end) - - constant(TraceSubstitutions) operator(=) operator([)operator(]) - constant(FrameworkRegexp) operator(=) regexp - - reserved(def) method(clean_backtrace) - ident(backtrace)operator(.)ident(collect) reserved(do) operator(|)ident(line)operator(|) - constant(Pathname)operator(.)ident(clean_within)operator(()constant(TraceSubstitutions)operator(.)ident(inject)operator(()ident(line)operator(\)) reserved(do) operator(|)ident(line)operator(,) operator(()ident(regexp)operator(,) ident(sub)operator(\))operator(|) - ident(line)operator(.)ident(gsub) ident(regexp)operator(,) ident(sub) - reserved(end)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(application_backtrace) - ident(before_application_frame) operator(=) pre_constant(true) - - ident(trace) operator(=) ident(clean_backtrace)operator(.)ident(reject) reserved(do) operator(|)ident(line)operator(|) - ident(non_app_frame) operator(=) operator(()ident(line) operator(=)operator(~) constant(FrameworkRegexp)operator(\)) - ident(before_application_frame) operator(=) pre_constant(false) reserved(unless) ident(non_app_frame) - ident(non_app_frame) operator(&&) operator(!) ident(before_application_frame) - reserved(end) - - comment(# If we didn't find any application frames, return an empty app trace.) - ident(before_application_frame) operator(?) operator([)operator(]) operator(:) ident(trace) - reserved(end) - - reserved(def) method(framework_backtrace) - ident(clean_backtrace)operator(.)ident(select) operator({)operator(|)ident(line)operator(|) ident(line) operator(=)operator(~) constant(FrameworkRegexp)operator(}) - reserved(end) -ident(endmodule) constant(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Hash) comment(#:nodoc:) - reserved(module) class(Conversions) - constant(XML_TYPE_NAMES) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) string - operator(}) - - constant(XML_FORMATTING) operator(=) operator({) - string operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(date)operator(|) ident(date)operator(.)ident(to_s)operator(()symbol(:db)operator(\)) operator(})operator(,) - string operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(time)operator(|) ident(time)operator(.)ident(xmlschema) operator(}) - operator(}) - - reserved(def) method(to_xml)operator(()ident(options) operator(=) operator({)operator(})operator(\)) - ident(options)operator([)symbol(:indent)operator(]) operator(||=) integer(2) - ident(options)operator(.)ident(reverse_merge!)operator(()operator({) symbol(:builder) operator(=)operator(>) constant(Builder)operator(::)constant(XmlMarkup)operator(.)ident(new)operator(()symbol(:indent) operator(=)operator(>) ident(options)operator([)symbol(:indent)operator(])operator(\))operator(,) symbol(:root) operator(=)operator(>) string operator(})operator(\)) - ident(options)operator([)symbol(:builder)operator(])operator(.)ident(instruct!) reserved(unless) ident(options)operator(.)ident(delete)operator(()symbol(:skip_instruct)operator(\)) - - ident(options)operator([)symbol(:builder)operator(])operator(.)ident(__send__)operator(()ident(options)operator([)symbol(:root)operator(])operator(.)ident(to_s)operator(.)ident(dasherize)operator(\)) reserved(do) - ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(case) ident(value) - reserved(when) operator(::)constant(Hash) - ident(value)operator(.)ident(to_xml)operator(()ident(options)operator(.)ident(merge)operator(()operator({) symbol(:root) operator(=)operator(>) ident(key)operator(,) symbol(:skip_instruct) operator(=)operator(>) pre_constant(true) operator(})operator(\))operator(\)) - reserved(when) operator(::)constant(Array) - ident(value)operator(.)ident(to_xml)operator(()ident(options)operator(.)ident(merge)operator(()operator({) symbol(:root) operator(=)operator(>) ident(key)operator(,) symbol(:children) operator(=)operator(>) ident(key)operator(.)ident(to_s)operator(.)ident(singularize)operator(,) symbol(:skip_instruct) operator(=)operator(>) pre_constant(true)operator(})operator(\))operator(\)) - reserved(else) - ident(type_name) operator(=) constant(XML_TYPE_NAMES)operator([)ident(value)operator(.)ident(class)operator(.)ident(to_s)operator(]) - - ident(options)operator([)symbol(:builder)operator(])operator(.)ident(tag!)operator(()ident(key)operator(.)ident(to_s)operator(.)ident(dasherize)operator(,) - constant(XML_FORMATTING)operator([)ident(type_name)operator(]) operator(?) constant(XML_FORMATTING)operator([)ident(type_name)operator(])operator(.)ident(call)operator(()ident(value)operator(\)) operator(:) ident(value)operator(,) - ident(options)operator([)symbol(:skip_types)operator(]) operator(||) ident(value)operator(.)ident(nil?) operator(||) ident(type_name)operator(.)ident(nil?) operator(?) operator({) operator(}) operator(:) operator({) symbol(:type) operator(=)operator(>) ident(type_name) operator(}) - operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Hash) comment(#:nodoc:) - reserved(module) class(Diff) - reserved(def) method(diff)operator(()ident(h2)operator(\)) - pre_constant(self)operator(.)ident(dup)operator(.)ident(delete_if) operator({) operator(|)ident(k)operator(,) ident(v)operator(|) ident(h2)operator([)ident(k)operator(]) operator(==) ident(v) operator(})operator(.)ident(merge)operator(()ident(h2)operator(.)ident(dup)operator(.)ident(delete_if) operator({) operator(|)ident(k)operator(,) ident(v)operator(|) pre_constant(self)operator(.)ident(has_key?)operator(()ident(k)operator(\)) operator(})operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -comment(# this class has dubious semantics and we only have it so that) -comment(# people can write params[:key] instead of params['key']) - -reserved(class) class(HashWithIndifferentAccess) operator(<) constant(Hash) - reserved(def) method(initialize)operator(()ident(constructor) operator(=) operator({)operator(})operator(\)) - reserved(if) ident(constructor)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - reserved(super)operator(()operator(\)) - ident(update)operator(()ident(constructor)operator(\)) - reserved(else) - reserved(super)operator(()ident(constructor)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(default)operator(()ident(key)operator(\)) - pre_constant(self)operator([)ident(key)operator(.)ident(to_s)operator(]) reserved(if) ident(key)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - reserved(end) - - ident(alias_method) symbol(:regular_writer)operator(,) symbol(:[]=) reserved(unless) ident(method_defined?)operator(()symbol(:regular_writer)operator(\)) - ident(alias_method) symbol(:regular_update)operator(,) symbol(:update) reserved(unless) ident(method_defined?)operator(()symbol(:regular_update)operator(\)) - - reserved(def) method([]=)operator(()ident(key)operator(,) ident(value)operator(\)) - ident(regular_writer)operator(()ident(convert_key)operator(()ident(key)operator(\))operator(,) ident(convert_value)operator(()ident(value)operator(\))operator(\)) - reserved(end) - - reserved(def) method(update)operator(()ident(other_hash)operator(\)) - ident(other_hash)operator(.)ident(each_pair) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) ident(regular_writer)operator(()ident(convert_key)operator(()ident(key)operator(\))operator(,) ident(convert_value)operator(()ident(value)operator(\))operator(\)) operator(}) - pre_constant(self) - reserved(end) - - ident(alias_method) symbol(:merge!)operator(,) symbol(:update) - - reserved(def) method(key?)operator(()ident(key)operator(\)) - reserved(super)operator(()ident(convert_key)operator(()ident(key)operator(\))operator(\)) - reserved(end) - - ident(alias_method) symbol(:include?)operator(,) symbol(:key?) - ident(alias_method) symbol(:has_key?)operator(,) symbol(:key?) - ident(alias_method) symbol(:member?)operator(,) symbol(:key?) - - reserved(def) method(fetch)operator(()ident(key)operator(,) operator(*)ident(extras)operator(\)) - reserved(super)operator(()ident(convert_key)operator(()ident(key)operator(\))operator(,) operator(*)ident(extras)operator(\)) - reserved(end) - - reserved(def) method(values_at)operator(()operator(*)ident(indices)operator(\)) - ident(indices)operator(.)ident(collect) operator({)operator(|)ident(key)operator(|) pre_constant(self)operator([)ident(convert_key)operator(()ident(key)operator(\))operator(])operator(}) - reserved(end) - - reserved(def) method(dup) - constant(HashWithIndifferentAccess)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(merge)operator(()ident(hash)operator(\)) - pre_constant(self)operator(.)ident(dup)operator(.)ident(update)operator(()ident(hash)operator(\)) - reserved(end) - - reserved(def) method(delete)operator(()ident(key)operator(\)) - reserved(super)operator(()ident(convert_key)operator(()ident(key)operator(\))operator(\)) - reserved(end) - - ident(protected) - reserved(def) method(convert_key)operator(()ident(key)operator(\)) - ident(key)operator(.)ident(kind_of?)operator(()constant(Symbol)operator(\)) operator(?) ident(key)operator(.)ident(to_s) operator(:) ident(key) - reserved(end) - reserved(def) method(convert_value)operator(()ident(value)operator(\)) - ident(value)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(?) ident(value)operator(.)ident(with_indifferent_access) operator(:) ident(value) - reserved(end) -reserved(end) - -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Hash) comment(#:nodoc:) - reserved(module) class(IndifferentAccess) comment(#:nodoc:) - reserved(def) method(with_indifferent_access) - constant(HashWithIndifferentAccess)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Hash) comment(#:nodoc:) - reserved(module) class(Keys) - comment(# Return a new hash with all keys converted to strings.) - reserved(def) method(stringify_keys) - ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(options)operator(,) operator(()ident(key)operator(,) ident(value)operator(\))operator(|) - ident(options)operator([)ident(key)operator(.)ident(to_s)operator(]) operator(=) ident(value) - ident(options) - reserved(end) - reserved(end) - - comment(# Destructively convert all keys to strings.) - reserved(def) method(stringify_keys!) - ident(keys)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(|) - reserved(unless) ident(key)operator(.)ident(class)operator(.)ident(to_s) operator(==) string comment(# weird hack to make the tests run when string_ext_test.rb is also running) - pre_constant(self)operator([)ident(key)operator(.)ident(to_s)operator(]) operator(=) pre_constant(self)operator([)ident(key)operator(]) - ident(delete)operator(()ident(key)operator(\)) - reserved(end) - reserved(end) - pre_constant(self) - reserved(end) - - comment(# Return a new hash with all keys converted to symbols.) - reserved(def) method(symbolize_keys) - ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(options)operator(,) operator(()ident(key)operator(,) ident(value)operator(\))operator(|) - ident(options)operator([)ident(key)operator(.)ident(to_sym)operator(]) operator(=) ident(value) - ident(options) - reserved(end) - reserved(end) - - comment(# Destructively convert all keys to symbols.) - reserved(def) method(symbolize_keys!) - ident(keys)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(|) - reserved(unless) ident(key)operator(.)ident(is_a?)operator(()constant(Symbol)operator(\)) - pre_constant(self)operator([)ident(key)operator(.)ident(to_sym)operator(]) operator(=) pre_constant(self)operator([)ident(key)operator(]) - ident(delete)operator(()ident(key)operator(\)) - reserved(end) - reserved(end) - pre_constant(self) - reserved(end) - - ident(alias_method) symbol(:to_options)operator(,) symbol(:symbolize_keys) - ident(alias_method) symbol(:to_options!)operator(,) symbol(:symbolize_keys!) - - reserved(def) method(assert_valid_keys)operator(()operator(*)ident(valid_keys)operator(\)) - ident(unknown_keys) operator(=) ident(keys) operator(-) operator([)ident(valid_keys)operator(])operator(.)ident(flatten) - ident(raise)operator(()constant(ArgumentError)operator(,) stringoperator(\))inline_delimiter(})>delimiter(")>operator(\)) reserved(unless) ident(unknown_keys)operator(.)ident(empty?) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Hash) comment(#:nodoc:) - comment(# Allows for reverse merging where its the keys in the calling hash that wins over those in the other_hash.) - comment(# This is particularly useful for initializing an incoming option hash with default values:) - comment(#) - comment(# def setup(options = {}\)) - comment(# options.reverse_merge! :size => 25, :velocity => 10) - comment(# end) - comment(#) - comment(# The default :size and :velocity is only set if the +options+ passed in doesn't already have those keys set.) - reserved(module) class(ReverseMerge) - reserved(def) method(reverse_merge)operator(()ident(other_hash)operator(\)) - ident(other_hash)operator(.)ident(merge)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(reverse_merge!)operator(()ident(other_hash)operator(\)) - ident(replace)operator(()ident(reverse_merge)operator(()ident(other_hash)operator(\))operator(\)) - reserved(end) - - ident(alias_method) symbol(:reverse_update)operator(,) symbol(:reverse_merge) - reserved(end) - reserved(end) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(Hash) comment(#:nodoc:) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Hash)operator(::)constant(Keys) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Hash)operator(::)constant(IndifferentAccess) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Hash)operator(::)constant(ReverseMerge) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Hash)operator(::)constant(Conversions) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Hash)operator(::)constant(Diff) -reserved(end) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Integer) comment(#:nodoc:) - comment(# For checking if a fixnum is even or odd. ) - comment(# * 1.even? # => false) - comment(# * 1.odd? # => true) - comment(# * 2.even? # => true) - comment(# * 2.odd? # => false) - reserved(module) class(EvenOdd) - reserved(def) method(multiple_of?)operator(()ident(number)operator(\)) - pre_constant(self) operator(%) ident(number) operator(==) integer(0) - reserved(end) - - reserved(def) method(even?) - ident(multiple_of?) integer(2) - reserved(end) - - reserved(def) method(odd?) - operator(!)ident(even?) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string reserved(unless) reserved(defined?) constant(Inflector) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Integer) comment(#:nodoc:) - reserved(module) class(Inflections) - comment(# 1.ordinalize # => "1st") - comment(# 3.ordinalize # => "3rd") - comment(# 10.ordinalize # => "10th") - reserved(def) method(ordinalize) - constant(Inflector)operator(.)ident(ordinalize)operator(()pre_constant(self)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(Integer) comment(#:nodoc:) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Integer)operator(::)constant(EvenOdd) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Integer)operator(::)constant(Inflections) -reserved(end) -reserved(class) class(Object) - comment(# Makes backticks behave (somewhat more\) similarly on all platforms.) - comment(# On win32 `nonexistent_command` raises Errno::ENOENT; on Unix, the) - comment(# spawned shell prints a message to stderr and sets $?. We emulate) - comment(# Unix on the former but not the latter.) - reserved(def) method(`)operator(()ident(command)operator(\)) comment(#:nodoc:) - reserved(super) - reserved(rescue) constant(Errno)operator(::)constant(ENOENT) operator(=)operator(>) ident(e) - pre_constant(STDERR)operator(.)ident(puts) stringdelimiter(")> - reserved(end) -ident(endmodule) constant(Kernel) - comment(# Turns the current script into a daemon process that detaches from the console.) - comment(# It can be shut down with a TERM signal.) - reserved(def) method(daemonize) - ident(exit) reserved(if) ident(fork) comment(# Parent exits, child continues.) - constant(Process)operator(.)ident(setsid) comment(# Become session leader.) - ident(exit) reserved(if) ident(fork) comment(# Zap session leader. See [1].) - constant(Dir)operator(.)ident(chdir) string comment(# Release old working directory.) - constant(File)operator(.)ident(umask) integer(0000) comment(# Ensure sensible umask. Adjust as needed.) - pre_constant(STDIN)operator(.)ident(reopen) string comment(# Free file descriptors and) - pre_constant(STDOUT)operator(.)ident(reopen) stringoperator(,) string comment(# point them somewhere sensible.) - pre_constant(STDERR)operator(.)ident(reopen) pre_constant(STDOUT) comment(# STDOUT/ERR should better go to a logfile.) - ident(trap)operator(()stringoperator(\)) operator({) ident(exit) operator(}) - reserved(end) -ident(endmodule) constant(Kernel) - comment(# Sets $VERBOSE to nil for the duration of the block and back to its original value afterwards.) - comment(#) - comment(# silence_warnings do) - comment(# value = noisy_call # no warning voiced) - comment(# end) - comment(#) - comment(# noisy_call # warning voiced) - reserved(def) method(silence_warnings) - ident(old_verbose)operator(,) global_variable($VERBOSE) operator(=) global_variable($VERBOSE)operator(,) pre_constant(nil) - reserved(yield) - reserved(ensure) - global_variable($VERBOSE) operator(=) ident(old_verbose) - reserved(end) - - comment(# Sets $VERBOSE to true for the duration of the block and back to its original value afterwards.) - reserved(def) method(enable_warnings) - ident(old_verbose)operator(,) global_variable($VERBOSE) operator(=) global_variable($VERBOSE)operator(,) pre_constant(true) - reserved(yield) - reserved(ensure) - global_variable($VERBOSE) operator(=) ident(old_verbose) - reserved(end) - - comment(# For compatibility) - reserved(def) method(silence_stderr) comment(#:nodoc:) - ident(silence_stream)operator(()pre_constant(STDERR)operator(\)) operator({) reserved(yield) operator(}) - reserved(end) - - comment(# Silences any stream for the duration of the block.) - comment(#) - comment(# silence_stream(STDOUT\) do) - comment(# puts 'This will never be seen') - comment(# end) - comment(#) - comment(# puts 'But this will') - reserved(def) method(silence_stream)operator(()ident(stream)operator(\)) - ident(old_stream) operator(=) ident(stream)operator(.)ident(dup) - ident(stream)operator(.)ident(reopen)operator(()pre_constant(RUBY_PLATFORM) operator(=)operator(~) regexp operator(?) string operator(:) stringoperator(\)) - ident(stream)operator(.)ident(sync) operator(=) pre_constant(true) - reserved(yield) - reserved(ensure) - ident(stream)operator(.)ident(reopen)operator(()ident(old_stream)operator(\)) - reserved(end) - - reserved(def) method(suppress)operator(()operator(*)ident(exception_classes)operator(\)) - reserved(begin) reserved(yield) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(e) - ident(raise) reserved(unless) ident(exception_classes)operator(.)ident(any?) operator({) operator(|)ident(cls)operator(|) ident(e)operator(.)ident(kind_of?)operator(()ident(cls)operator(\)) operator(}) - reserved(end) - reserved(end) -ident(endmodule) constant(Kernel) - comment(# Require a library with fallback to RubyGems. Warnings during library) - comment(# loading are silenced to increase signal/noise for application warnings.) - reserved(def) method(require_library_or_gem)operator(()ident(library_name)operator(\)) - ident(silence_warnings) reserved(do) - reserved(begin) - ident(require) ident(library_name) - reserved(rescue) constant(LoadError) operator(=)operator(>) ident(cannot_require) - comment(# 1. Requiring the module is unsuccessful, maybe it's a gem and nobody required rubygems yet. Try.) - reserved(begin) - ident(require) string - reserved(rescue) constant(LoadError) operator(=)operator(>) ident(rubygems_not_installed) - ident(raise) ident(cannot_require) - reserved(end) - comment(# 2. Rubygems is installed and loaded. Try to load the library again) - reserved(begin) - ident(require) ident(library_name) - reserved(rescue) constant(LoadError) operator(=)operator(>) ident(gem_not_installed) - ident(raise) ident(cannot_require) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -reserved(class) class(MissingSourceFile) operator(<) constant(LoadError) comment(#:nodoc:) - ident(attr_reader) symbol(:path) - reserved(def) method(initialize)operator(()ident(message)operator(,) ident(path)operator(\)) - reserved(super)operator(()ident(message)operator(\)) - instance_variable(@path) operator(=) ident(path) - reserved(end) - - reserved(def) method(is_missing?)operator(()ident(path)operator(\)) - ident(path)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) operator(==) pre_constant(self)operator(.)ident(path)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) pre_constant(self)operator(.)method(from_message)operator(()ident(message)operator(\)) - constant(REGEXPS)operator(.)ident(each) reserved(do) operator(|)ident(regexp)operator(,) ident(capture)operator(|) - ident(match) operator(=) ident(regexp)operator(.)ident(match)operator(()ident(message)operator(\)) - reserved(return) constant(MissingSourceFile)operator(.)ident(new)operator(()ident(message)operator(,) ident(match)operator([)ident(capture)operator(])operator(\)) reserved(unless) ident(match)operator(.)ident(nil?) - reserved(end) - pre_constant(nil) - reserved(end) - - constant(REGEXPS) operator(=) operator([) - operator([)regexpoperator(,) integer(1)operator(])operator(,) - operator([)regexpoperator(,) integer(2)operator(])operator(,) - operator([)regexpoperator(,) integer(1)operator(]) - operator(]) -reserved(end) - -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(LoadErrorExtensions) comment(#:nodoc:) - reserved(module) class(LoadErrorClassMethods) comment(#:nodoc:) - reserved(def) method(new)operator(()operator(*)ident(args)operator(\)) - operator(()pre_constant(self) operator(==) constant(LoadError) operator(&&) constant(MissingSourceFile)operator(.)ident(from_message)operator(()ident(args)operator(.)ident(first)operator(\))operator(\)) operator(||) reserved(super) - reserved(end) - reserved(end) - operator(::)constant(LoadError)operator(.)ident(extend)operator(()constant(LoadErrorClassMethods)operator(\)) - reserved(end) - reserved(end) -reserved(end) -comment(# Adds the 'around_level' method to Logger.) - -reserved(class) class(Logger) - reserved(def) pre_constant(self)operator(.)method(define_around_helper)operator(()ident(level)operator(\)) - ident(module_eval) stringstringcontent((before_message, after_message, &block\) - self.)inlinecontent((before_message\) - return_value = block.call(self\) - self.)inlinecontent((after_message\) - return return_value - end)delimiter( - end_eval)> - reserved(end) - operator([)symbol(:debug)operator(,) symbol(:info)operator(,) symbol(:error)operator(,) symbol(:fatal)operator(])operator(.)ident(each) operator({)operator(|)ident(level)operator(|) ident(define_around_helper)operator(()ident(level)operator(\)) operator(}) - -reserved(end)comment(# Extends the module object with module and instance accessors for class attributes, ) -comment(# just like the native attr* accessors for instance attributes.) -reserved(class) class(Module) comment(# :nodoc:) - reserved(def) method(mattr_reader)operator(()operator(*)ident(syms)operator(\)) - ident(syms)operator(.)ident(each) reserved(do) operator(|)ident(sym)operator(|) - ident(class_eval)operator(()stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)operator(\))stringcontent( - @@)inlinecontent( = nil - end - - def self.)inlinecontent( - @@)inlinecontent( - end - - def )inlinecontent( - @@)inlinecontent( - end)delimiter( - EOS)> - reserved(end) - reserved(end) - - reserved(def) method(mattr_writer)operator(()operator(*)ident(syms)operator(\)) - ident(syms)operator(.)ident(each) reserved(do) operator(|)ident(sym)operator(|) - ident(class_eval)operator(()stringoperator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)operator(\))stringcontent( - @@)inlinecontent( = nil - end - - def self.)inlinecontent(=(obj\) - @@)inlinecontent( = obj - end - - def )inlinecontent(=(obj\) - @@)inlinecontent( = obj - end)delimiter( - EOS)> - reserved(end) - reserved(end) - - reserved(def) method(mattr_accessor)operator(()operator(*)ident(syms)operator(\)) - ident(mattr_reader)operator(()operator(*)ident(syms)operator(\)) - ident(mattr_writer)operator(()operator(*)ident(syms)operator(\)) - reserved(end) -reserved(end) -reserved(class) class(Module) - reserved(def) method(delegate)operator(()operator(*)ident(methods)operator(\)) - ident(options) operator(=) ident(methods)operator(.)ident(pop) - reserved(unless) ident(options)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) operator(&&) ident(to) operator(=) ident(options)operator([)symbol(:to)operator(]) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - ident(methods)operator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - ident(module_eval)operator(()stringoperator(,) stringoperator(,) integer(1)operator(\))stringcontent((*args, &block\) - )inlinecontent(.__send__()inlinecontent(, *args, &block\) - end)delimiter( - EOS)> - reserved(end) - reserved(end) -ident(endclass) constant(Module) - reserved(def) method(included_in_classes) - ident(classes) operator(=) operator([)operator(]) - constant(ObjectSpace)operator(.)ident(each_object)operator(()constant(Class)operator(\)) operator({) operator(|)ident(k)operator(|) ident(classes) operator(<<) ident(k) reserved(if) ident(k)operator(.)ident(included_modules)operator(.)ident(include?)operator(()pre_constant(self)operator(\)) operator(}) - - ident(classes)operator(.)ident(reverse)operator(.)ident(inject)operator(()operator([)operator(])operator(\)) reserved(do) operator(|)ident(unique_classes)operator(,) ident(klass)operator(|) - ident(unique_classes) operator(<<) ident(klass) reserved(unless) ident(unique_classes)operator(.)ident(collect) operator({) operator(|)ident(k)operator(|) ident(k)operator(.)ident(to_s) operator(})operator(.)ident(include?)operator(()ident(klass)operator(.)ident(to_s)operator(\)) - ident(unique_classes) - reserved(end) - reserved(end) -ident(endclass) constant(Module) - comment(# Return the module which contains this one; if this is a root module, such as) - comment(# +::MyModule+, then Object is returned.) - reserved(def) method(parent) - ident(parent_name) operator(=) ident(name)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(0)operator(..)integer(-2)operator(]) operator(*) string - ident(parent_name)operator(.)ident(empty?) operator(?) constant(Object) operator(:) ident(parent_name)operator(.)ident(constantize) - reserved(end) - - comment(# Return all the parents of this module, ordered from nested outwards. The) - comment(# receiver is not contained within the result.) - reserved(def) method(parents) - ident(parents) operator(=) operator([)operator(]) - ident(parts) operator(=) ident(name)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(0)operator(..)integer(-2)operator(]) - reserved(until) ident(parts)operator(.)ident(empty?) - ident(parents) operator(<<) operator(()ident(parts) operator(*) stringoperator(\))operator(.)ident(constantize) - ident(parts)operator(.)ident(pop) - reserved(end) - ident(parents) operator(<<) constant(Object) reserved(unless) ident(parents)operator(.)ident(include?) constant(Object) - ident(parents) - reserved(end) -reserved(end) -reserved(class) class(Module) - reserved(def) method(as_load_path) - reserved(if) pre_constant(self) operator(==) constant(Object) operator(||) pre_constant(self) operator(==) constant(Kernel) - string - reserved(elsif) ident(is_a?) constant(Class) - ident(parent) operator(==) pre_constant(self) operator(?) string operator(:) ident(parent)operator(.)ident(as_load_path) - reserved(else) - ident(name)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(collect) reserved(do) operator(|)ident(word)operator(|) - ident(word)operator(.)ident(underscore) - reserved(end) operator(*) string - reserved(end) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Numeric) comment(#:nodoc:) - comment(# Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes) - reserved(module) class(Bytes) - reserved(def) method(bytes) - pre_constant(self) - reserved(end) - reserved(alias) symbol(:byte) symbol(:bytes) - - reserved(def) method(kilobytes) - pre_constant(self) operator(*) integer(1024) - reserved(end) - reserved(alias) symbol(:kilobyte) symbol(:kilobytes) - - reserved(def) method(megabytes) - pre_constant(self) operator(*) integer(1024)operator(.)ident(kilobytes) - reserved(end) - reserved(alias) symbol(:megabyte) symbol(:megabytes) - - reserved(def) method(gigabytes) - pre_constant(self) operator(*) integer(1024)operator(.)ident(megabytes) - reserved(end) - reserved(alias) symbol(:gigabyte) symbol(:gigabytes) - - reserved(def) method(terabytes) - pre_constant(self) operator(*) integer(1024)operator(.)ident(gigabytes) - reserved(end) - reserved(alias) symbol(:terabyte) symbol(:terabytes) - - reserved(def) method(petabytes) - pre_constant(self) operator(*) integer(1024)operator(.)ident(terabytes) - reserved(end) - reserved(alias) symbol(:petabyte) symbol(:petabytes) - - reserved(def) method(exabytes) - pre_constant(self) operator(*) integer(1024)operator(.)ident(petabytes) - reserved(end) - reserved(alias) symbol(:exabyte) symbol(:exabytes) - - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Numeric) comment(#:nodoc:) - comment(# Enables the use of time calculations and declarations, like 45.minutes + 2.hours + 4.years.) - comment(#) - comment(# If you need precise date calculations that doesn't just treat months as 30 days, then have) - comment(# a look at Time#advance.) - comment(# ) - comment(# Some of these methods are approximations, Ruby's core ) - comment(# Date[http://stdlib.rubyonrails.org/libdoc/date/rdoc/index.html] and ) - comment(# Time[http://stdlib.rubyonrails.org/libdoc/time/rdoc/index.html] should be used for precision) - comment(# date and time arithmetic) - reserved(module) class(Time) - reserved(def) method(seconds) - pre_constant(self) - reserved(end) - reserved(alias) symbol(:second) symbol(:seconds) - - reserved(def) method(minutes) - pre_constant(self) operator(*) integer(60) - reserved(end) - reserved(alias) symbol(:minute) symbol(:minutes) - - reserved(def) method(hours) - pre_constant(self) operator(*) integer(60)operator(.)ident(minutes) - reserved(end) - reserved(alias) symbol(:hour) symbol(:hours) - - reserved(def) method(days) - pre_constant(self) operator(*) integer(24)operator(.)ident(hours) - reserved(end) - reserved(alias) symbol(:day) symbol(:days) - - reserved(def) method(weeks) - pre_constant(self) operator(*) integer(7)operator(.)ident(days) - reserved(end) - reserved(alias) symbol(:week) symbol(:weeks) - - reserved(def) method(fortnights) - pre_constant(self) operator(*) integer(2)operator(.)ident(weeks) - reserved(end) - reserved(alias) symbol(:fortnight) symbol(:fortnights) - - reserved(def) method(months) - pre_constant(self) operator(*) integer(30)operator(.)ident(days) - reserved(end) - reserved(alias) symbol(:month) symbol(:months) - - reserved(def) method(years) - operator(()pre_constant(self) operator(*) float(365.25)operator(.)ident(days)operator(\))operator(.)ident(to_i) - reserved(end) - reserved(alias) symbol(:year) symbol(:years) - - comment(# Reads best without arguments: 10.minutes.ago) - reserved(def) method(ago)operator(()ident(time) operator(=) operator(::)constant(Time)operator(.)ident(now)operator(\)) - ident(time) operator(-) pre_constant(self) - reserved(end) - - comment(# Reads best with argument: 10.minutes.until(time\)) - reserved(alias) symbol(:until) symbol(:ago) - - comment(# Reads best with argument: 10.minutes.since(time\)) - reserved(def) method(since)operator(()ident(time) operator(=) operator(::)constant(Time)operator(.)ident(now)operator(\)) - ident(time) operator(+) pre_constant(self) - reserved(end) - - comment(# Reads best without arguments: 10.minutes.from_now) - reserved(alias) symbol(:from_now) symbol(:since) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(Numeric) comment(#:nodoc:) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Numeric)operator(::)constant(Time) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Numeric)operator(::)constant(Bytes) -reserved(end) -reserved(class) class(Object) comment(#:nodoc:) - reserved(def) method(remove_subclasses_of)operator(()operator(*)ident(superclasses)operator(\)) - constant(Class)operator(.)ident(remove_class)operator(()operator(*)ident(subclasses_of)operator(()operator(*)ident(superclasses)operator(\))operator(\)) - reserved(end) - - reserved(def) method(subclasses_of)operator(()operator(*)ident(superclasses)operator(\)) - ident(subclasses) operator(=) operator([)operator(]) - constant(ObjectSpace)operator(.)ident(each_object)operator(()constant(Class)operator(\)) reserved(do) operator(|)ident(k)operator(|) - reserved(next) reserved(if) comment(# Exclude this class if) - operator(()ident(k)operator(.)ident(ancestors) operator(&) ident(superclasses)operator(\))operator(.)ident(empty?) operator(||) comment(# It's not a subclass of our supers) - ident(superclasses)operator(.)ident(include?)operator(()ident(k)operator(\)) operator(||) comment(# It *is* one of the supers) - ident(eval)operator(()stringcontent(\))delimiter(")>operator(\)) operator(||) comment(# It's not defined.) - ident(eval)operator(()stringdelimiter(")>operator(\))operator(.)ident(object_id) operator(!=) ident(k)operator(.)ident(object_id) - ident(subclasses) operator(<<) ident(k) - reserved(end) - ident(subclasses) - reserved(end) - - reserved(def) method(extended_by) - ident(ancestors) operator(=) reserved(class) operator(<<) class(self)operator(;) ident(ancestors) reserved(end) - ident(ancestors)operator(.)ident(select) operator({) operator(|)ident(mod)operator(|) ident(mod)operator(.)ident(class) operator(==) constant(Module) operator(}) operator(-) operator([) constant(Object)operator(,) constant(Kernel) operator(]) - reserved(end) - - reserved(def) method(copy_instance_variables_from)operator(()ident(object)operator(,) ident(exclude) operator(=) operator([)operator(])operator(\)) - ident(exclude) operator(+=) ident(object)operator(.)ident(protected_instance_variables) reserved(if) ident(object)operator(.)ident(respond_to?) symbol(:protected_instance_variables) - - ident(instance_variables) operator(=) ident(object)operator(.)ident(instance_variables) operator(-) ident(exclude)operator(.)ident(map) operator({) operator(|)ident(name)operator(|) ident(name)operator(.)ident(to_s) operator(}) - ident(instance_variables)operator(.)ident(each) operator({) operator(|)ident(name)operator(|) ident(instance_variable_set)operator(()ident(name)operator(,) ident(object)operator(.)ident(instance_variable_get)operator(()ident(name)operator(\))operator(\)) operator(}) - reserved(end) - - reserved(def) method(extend_with_included_modules_from)operator(()ident(object)operator(\)) - ident(object)operator(.)ident(extended_by)operator(.)ident(each) operator({) operator(|)ident(mod)operator(|) ident(extend) ident(mod) operator(}) - reserved(end) - - reserved(def) method(instance_values) - ident(instance_variables)operator(.)ident(inject)operator(()operator({)operator(})operator(\)) reserved(do) operator(|)ident(values)operator(,) ident(name)operator(|) - ident(values)operator([)ident(name)operator([)integer(1)operator(..)integer(-1)operator(])operator(]) operator(=) ident(instance_variable_get)operator(()ident(name)operator(\)) - ident(values) - reserved(end) - reserved(end) - - reserved(unless) reserved(defined?) ident(instance_exec) comment(# 1.9) - reserved(def) method(instance_exec)operator(()operator(*)ident(arguments)operator(,) operator(&)ident(block)operator(\)) - ident(block)operator(.)ident(bind)operator(()pre_constant(self)operator(\))operator([)operator(*)ident(arguments)operator(]) - reserved(end) - reserved(end) -reserved(end) -reserved(class) class(Object) comment(#:nodoc:) - comment(# A Ruby-ized realization of the K combinator, courtesy of Mikael Brockman.) - comment(#) - comment(# def foo) - comment(# returning values = [] do) - comment(# values << 'bar') - comment(# values << 'baz') - comment(# end) - comment(# end) - comment(#) - comment(# foo # => ['bar', 'baz']) - comment(#) - comment(# def foo) - comment(# returning [] do |values|) - comment(# values << 'bar') - comment(# values << 'baz') - comment(# end) - comment(# end) - comment(#) - comment(# foo # => ['bar', 'baz']) - comment(#) - reserved(def) method(returning)operator(()ident(value)operator(\)) - reserved(yield)operator(()ident(value)operator(\)) - ident(value) - reserved(end) - - reserved(def) method(with_options)operator(()ident(options)operator(\)) - reserved(yield) constant(ActiveSupport)operator(::)constant(OptionMerger)operator(.)ident(new)operator(()pre_constant(self)operator(,) ident(options)operator(\)) - reserved(end) - - reserved(def) method(to_json) - constant(ActiveSupport)operator(::)constant(JSON)operator(.)ident(encode)operator(()pre_constant(self)operator(\)) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringreserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Pathname) comment(#:nodoc:) - reserved(module) class(CleanWithin) - comment(# Clean the paths contained in the provided string.) - reserved(def) method(clean_within)operator(()ident(string)operator(\)) - ident(string)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) operator(|)ident(path)operator(|) - ident(new)operator(()ident(path)operator(\))operator(.)ident(cleanpath) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(Pathname)comment(#:nodoc:) - ident(extend) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Pathname)operator(::)constant(CleanWithin) -reserved(end) - -reserved(class) class(Proc) comment(#:nodoc:) - reserved(def) method(bind)operator(()ident(object)operator(\)) - ident(block)operator(,) ident(time) operator(=) pre_constant(self)operator(,) constant(Time)operator(.)ident(now) - operator(()reserved(class) operator(<<) class(object)operator(;) pre_constant(self) reserved(end)operator(\))operator(.)ident(class_eval) reserved(do) - ident(method_name) operator(=) stringcontent(_)inlinedelimiter(")> - ident(define_method)operator(()ident(method_name)operator(,) operator(&)ident(block)operator(\)) - ident(method) operator(=) ident(instance_method)operator(()ident(method_name)operator(\)) - ident(remove_method)operator(()ident(method_name)operator(\)) - ident(method) - reserved(end)operator(.)ident(bind)operator(()ident(object)operator(\)) - reserved(end) -reserved(end) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Range) comment(#:nodoc:) - comment(# Getting dates in different convenient string representations and other objects) - reserved(module) class(Conversions) - constant(DATE_FORMATS) operator(=) operator({) - symbol(:db) operator(=)operator(>) constant(Proc)operator(.)ident(new) operator({) operator(|)ident(start)operator(,) ident(stop)operator(|) stringcontent(' AND ')inlinecontent(')delimiter(")> operator(}) - operator(}) - - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(klass)operator(\)) comment(#:nodoc:) - ident(klass)operator(.)ident(send)operator(()symbol(:alias_method)operator(,) symbol(:to_default_s)operator(,) symbol(:to_s)operator(\)) - ident(klass)operator(.)ident(send)operator(()symbol(:alias_method)operator(,) symbol(:to_s)operator(,) symbol(:to_formatted_s)operator(\)) - reserved(end) - - reserved(def) method(to_formatted_s)operator(()ident(format) operator(=) symbol(:default)operator(\)) - constant(DATE_FORMATS)operator([)ident(format)operator(]) operator(?) constant(DATE_FORMATS)operator([)ident(format)operator(])operator(.)ident(call)operator(()ident(first)operator(,) ident(last)operator(\)) operator(:) ident(to_default_s) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(Range) comment(#:nodoc:) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Range)operator(::)constant(Conversions) -reserved(end) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(String) comment(#:nodoc:) - comment(# Makes it easier to access parts of a string, such as specific characters and substrings.) - reserved(module) class(Access) - comment(# Returns the character at the +position+ treating the string as an array (where 0 is the first character\).) - comment(#) - comment(# Examples: ) - comment(# "hello".at(0\) # => "h") - comment(# "hello".at(4\) # => "o") - comment(# "hello".at(10\) # => nil) - reserved(def) method(at)operator(()ident(position)operator(\)) - pre_constant(self)operator([)ident(position)operator(,) integer(1)operator(]) - reserved(end) - - comment(# Returns the remaining of the string from the +position+ treating the string as an array (where 0 is the first character\).) - comment(#) - comment(# Examples: ) - comment(# "hello".from(0\) # => "hello") - comment(# "hello".from(2\) # => "llo") - comment(# "hello".from(10\) # => nil) - reserved(def) method(from)operator(()ident(position)operator(\)) - pre_constant(self)operator([)ident(position)operator(..)integer(-1)operator(]) - reserved(end) - - comment(# Returns the beginning of the string up to the +position+ treating the string as an array (where 0 is the first character\).) - comment(#) - comment(# Examples: ) - comment(# "hello".to(0\) # => "h") - comment(# "hello".to(2\) # => "hel") - comment(# "hello".to(10\) # => "hello") - reserved(def) method(to)operator(()ident(position)operator(\)) - pre_constant(self)operator([)integer(0)operator(..)ident(position)operator(]) - reserved(end) - - comment(# Returns the first character of the string or the first +limit+ characters.) - comment(#) - comment(# Examples: ) - comment(# "hello".first # => "h") - comment(# "hello".first(2\) # => "he") - comment(# "hello".first(10\) # => "hello") - reserved(def) method(first)operator(()ident(limit) operator(=) integer(1)operator(\)) - pre_constant(self)operator([)integer(0)operator(..)operator(()ident(limit) operator(-) integer(1)operator(\))operator(]) - reserved(end) - - comment(# Returns the last character of the string or the last +limit+ characters.) - comment(#) - comment(# Examples: ) - comment(# "hello".last # => "o") - comment(# "hello".last(2\) # => "lo") - comment(# "hello".last(10\) # => "hello") - reserved(def) method(last)operator(()ident(limit) operator(=) integer(1)operator(\)) - pre_constant(self)operator([)operator(()operator(-)ident(limit)operator(\))operator(..)integer(-1)operator(]) operator(||) pre_constant(self) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(String) comment(#:nodoc:) - comment(# Converting strings to other objects) - reserved(module) class(Conversions) - comment(# Form can be either :utc (default\) or :local.) - reserved(def) method(to_time)operator(()ident(form) operator(=) symbol(:utc)operator(\)) - operator(::)constant(Time)operator(.)ident(send)operator(()ident(form)operator(,) operator(*)constant(ParseDate)operator(.)ident(parsedate)operator(()pre_constant(self)operator(\))operator(\)) - reserved(end) - - reserved(def) method(to_date) - operator(::)constant(Date)operator(.)ident(new)operator(()operator(*)constant(ParseDate)operator(.)ident(parsedate)operator(()pre_constant(self)operator(\))operator([)integer(0)operator(..)integer(2)operator(])operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -ident(endrequire) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string reserved(unless) reserved(defined?) constant(Inflector) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(String) comment(#:nodoc:) - comment(# Makes it possible to do "posts".singularize that returns "post" and "MegaCoolClass".underscore that returns "mega_cool_class".) - reserved(module) class(Inflections) - reserved(def) method(pluralize) - constant(Inflector)operator(.)ident(pluralize)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(singularize) - constant(Inflector)operator(.)ident(singularize)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(camelize)operator(()ident(first_letter) operator(=) symbol(:upper)operator(\)) - reserved(case) ident(first_letter) - reserved(when) symbol(:upper) reserved(then) constant(Inflector)operator(.)ident(camelize)operator(()pre_constant(self)operator(,) pre_constant(true)operator(\)) - reserved(when) symbol(:lower) reserved(then) constant(Inflector)operator(.)ident(camelize)operator(()pre_constant(self)operator(,) pre_constant(false)operator(\)) - reserved(end) - reserved(end) - ident(alias_method) symbol(:camelcase)operator(,) symbol(:camelize) - - reserved(def) method(titleize) - constant(Inflector)operator(.)ident(titleize)operator(()pre_constant(self)operator(\)) - reserved(end) - ident(alias_method) symbol(:titlecase)operator(,) symbol(:titleize) - - reserved(def) method(underscore) - constant(Inflector)operator(.)ident(underscore)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(dasherize) - constant(Inflector)operator(.)ident(dasherize)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(demodulize) - constant(Inflector)operator(.)ident(demodulize)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(tableize) - constant(Inflector)operator(.)ident(tableize)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(classify) - constant(Inflector)operator(.)ident(classify)operator(()pre_constant(self)operator(\)) - reserved(end) - - comment(# Capitalizes the first word and turns underscores into spaces and strips _id, so "employee_salary" becomes "Employee salary" ) - comment(# and "author_id" becomes "Author".) - reserved(def) method(humanize) - constant(Inflector)operator(.)ident(humanize)operator(()pre_constant(self)operator(\)) - reserved(end) - - reserved(def) method(foreign_key)operator(()ident(separate_class_name_and_id_with_underscore) operator(=) pre_constant(true)operator(\)) - constant(Inflector)operator(.)ident(foreign_key)operator(()pre_constant(self)operator(,) ident(separate_class_name_and_id_with_underscore)operator(\)) - reserved(end) - - reserved(def) method(constantize) - constant(Inflector)operator(.)ident(constantize)operator(()pre_constant(self)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string - -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(String) comment(#:nodoc:) - comment(# Custom string iterators) - reserved(module) class(Iterators) - comment(# Yields a single-character string for each character in the string.) - comment(# When $KCODE = 'UTF8', multi-byte characters are yielded appropriately.) - reserved(def) method(each_char) - ident(scanner)operator(,) ident(char) operator(=) constant(StringScanner)operator(.)ident(new)operator(()pre_constant(self)operator(\))operator(,) regexp - ident(loop) operator({) reserved(yield)operator(()ident(scanner)operator(.)ident(scan)operator(()ident(char)operator(\)) operator(||) reserved(break)operator(\)) operator(}) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(String) comment(#:nodoc:) - comment(# Additional string tests.) - reserved(module) class(StartsEndsWith) - comment(# Does the string start with the specified +prefix+?) - reserved(def) method(starts_with?)operator(()ident(prefix)operator(\)) - ident(prefix) operator(=) ident(prefix)operator(.)ident(to_s) - pre_constant(self)operator([)integer(0)operator(,) ident(prefix)operator(.)ident(length)operator(]) operator(==) ident(prefix) - reserved(end) - - comment(# Does the string end with the specified +suffix+?) - reserved(def) method(ends_with?)operator(()ident(suffix)operator(\)) - ident(suffix) operator(=) ident(suffix)operator(.)ident(to_s) - pre_constant(self)operator([)operator(-)ident(suffix)operator(.)ident(length)operator(,) ident(suffix)operator(.)ident(length)operator(]) operator(==) ident(suffix) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(String) comment(#:nodoc:) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(String)operator(::)constant(Access) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(String)operator(::)constant(Conversions) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(String)operator(::)constant(Inflections) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(String)operator(::)constant(StartsEndsWith) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(String)operator(::)constant(Iterators) -reserved(end) -reserved(class) class(Symbol) - comment(# Turns the symbol into a simple proc, which is especially useful for enumerations. Examples:) - comment(#) - comment(# # The same as people.collect { |p| p.name }) - comment(# people.collect(&:name\)) - comment(#) - comment(# # The same as people.select { |p| p.manager? }.collect { |p| p.salary }) - comment(# people.select(&:manager?\).collect(&:salary\)) - reserved(def) method(to_proc) - constant(Proc)operator(.)ident(new) operator({) operator(|)ident(obj)operator(,) operator(*)ident(args)operator(|) ident(obj)operator(.)ident(send)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(\)) operator(}) - reserved(end) -reserved(end) -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Time) comment(#:nodoc:) - comment(# Enables the use of time calculations within Time itself) - reserved(module) class(Calculations) - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(base)operator(\)) comment(#:nodoc:) - reserved(super) - ident(base)operator(.)ident(extend)operator(()constant(ClassMethods)operator(\)) - reserved(end) - - reserved(module) class(ClassMethods) - comment(# Return the number of days in the given month. If a year is given,) - comment(# February will return the correct number of days for leap years.) - comment(# Otherwise, this method will always report February as having 28) - comment(# days.) - reserved(def) method(days_in_month)operator(()ident(month)operator(,) ident(year)operator(=)pre_constant(nil)operator(\)) - reserved(if) ident(month) operator(==) integer(2) - operator(!)ident(year)operator(.)ident(nil?) operator(&&) operator(()ident(year) operator(%) integer(4) operator(==) integer(0)operator(\)) operator(&&) operator(()operator(()ident(year) operator(%) integer(100) operator(!=) integer(0)operator(\)) operator(||) operator(()ident(year) operator(%) integer(400) operator(==) integer(0)operator(\))operator(\)) operator(?) integer(29) operator(:) integer(28) - reserved(elsif) ident(month) operator(<=) integer(7) - ident(month) operator(%) integer(2) operator(==) integer(0) operator(?) integer(30) operator(:) integer(31) - reserved(else) - ident(month) operator(%) integer(2) operator(==) integer(0) operator(?) integer(31) operator(:) integer(30) - reserved(end) - reserved(end) - reserved(end) - - comment(# Seconds since midnight: Time.now.seconds_since_midnight) - reserved(def) method(seconds_since_midnight) - pre_constant(self)operator(.)ident(hour)operator(.)ident(hours) operator(+) pre_constant(self)operator(.)ident(min)operator(.)ident(minutes) operator(+) pre_constant(self)operator(.)ident(sec) operator(+) operator(()pre_constant(self)operator(.)ident(usec)operator(/)float(1.0e+6)operator(\)) - reserved(end) - - comment(# Returns a new Time where one or more of the elements have been changed according to the +options+ parameter. The time options) - comment(# (hour, minute, sec, usec\) reset cascadingly, so if only the hour is passed, then minute, sec, and usec is set to 0. If the hour and ) - comment(# minute is passed, then sec and usec is set to 0.) - reserved(def) method(change)operator(()ident(options)operator(\)) - operator(::)constant(Time)operator(.)ident(send)operator(() - pre_constant(self)operator(.)ident(utc?) operator(?) symbol(:utc) operator(:) symbol(:local)operator(,) - ident(options)operator([)symbol(:year)operator(]) operator(||) pre_constant(self)operator(.)ident(year)operator(,) - ident(options)operator([)symbol(:month)operator(]) operator(||) pre_constant(self)operator(.)ident(month)operator(,) - ident(options)operator([)symbol(:mday)operator(]) operator(||) pre_constant(self)operator(.)ident(mday)operator(,) - ident(options)operator([)symbol(:hour)operator(]) operator(||) pre_constant(self)operator(.)ident(hour)operator(,) - ident(options)operator([)symbol(:min)operator(]) operator(||) operator(()ident(options)operator([)symbol(:hour)operator(]) operator(?) integer(0) operator(:) pre_constant(self)operator(.)ident(min)operator(\))operator(,) - ident(options)operator([)symbol(:sec)operator(]) operator(||) operator(()operator(()ident(options)operator([)symbol(:hour)operator(]) operator(||) ident(options)operator([)symbol(:min)operator(])operator(\)) operator(?) integer(0) operator(:) pre_constant(self)operator(.)ident(sec)operator(\))operator(,) - ident(options)operator([)symbol(:usec)operator(]) operator(||) operator(()operator(()ident(options)operator([)symbol(:hour)operator(]) operator(||) ident(options)operator([)symbol(:min)operator(]) operator(||) ident(options)operator([)symbol(:sec)operator(])operator(\)) operator(?) integer(0) operator(:) pre_constant(self)operator(.)ident(usec)operator(\)) - operator(\)) - reserved(end) - - comment(# Uses Date to provide precise Time calculations for years, months, and days. The +options+ parameter takes a hash with ) - comment(# any of these keys: :months, :days, :years.) - reserved(def) method(advance)operator(()ident(options)operator(\)) - ident(d) operator(=) operator(::)constant(Date)operator(.)ident(new)operator(()ident(year) operator(+) operator(()ident(options)operator(.)ident(delete)operator(()symbol(:years)operator(\)) operator(||) integer(0)operator(\))operator(,) ident(month)operator(,) ident(day)operator(\)) - ident(d) operator(=) ident(d) operator(>>) ident(options)operator(.)ident(delete)operator(()symbol(:months)operator(\)) reserved(if) ident(options)operator([)symbol(:months)operator(]) - ident(d) operator(=) ident(d) operator(+) ident(options)operator(.)ident(delete)operator(()symbol(:days)operator(\)) reserved(if) ident(options)operator([)symbol(:days)operator(]) - ident(change)operator(()ident(options)operator(.)ident(merge)operator(()symbol(:year) operator(=)operator(>) ident(d)operator(.)ident(year)operator(,) symbol(:month) operator(=)operator(>) ident(d)operator(.)ident(month)operator(,) symbol(:mday) operator(=)operator(>) ident(d)operator(.)ident(day)operator(\))operator(\)) - reserved(end) - - comment(# Returns a new Time representing the time a number of seconds ago, this is basically a wrapper around the Numeric extension) - comment(# Do not use this method in combination with x.months, use months_ago instead!) - reserved(def) method(ago)operator(()ident(seconds)operator(\)) - ident(seconds)operator(.)ident(until)operator(()pre_constant(self)operator(\)) - reserved(end) - - comment(# Returns a new Time representing the time a number of seconds since the instance time, this is basically a wrapper around ) - comment(#the Numeric extension. Do not use this method in combination with x.months, use months_since instead!) - reserved(def) method(since)operator(()ident(seconds)operator(\)) - ident(seconds)operator(.)ident(since)operator(()pre_constant(self)operator(\)) - reserved(end) - reserved(alias) symbol(:in) symbol(:since) - - comment(# Returns a new Time representing the time a number of specified months ago) - reserved(def) method(months_ago)operator(()ident(months)operator(\)) - ident(months_since)operator(()operator(-)ident(months)operator(\)) - reserved(end) - - reserved(def) method(months_since)operator(()ident(months)operator(\)) - ident(year)operator(,) ident(month)operator(,) ident(mday) operator(=) pre_constant(self)operator(.)ident(year)operator(,) pre_constant(self)operator(.)ident(month)operator(,) pre_constant(self)operator(.)ident(mday) - - ident(month) operator(+=) ident(months) - - comment(# in case months is negative) - reserved(while) ident(month) operator(<) integer(1) - ident(month) operator(+=) integer(12) - ident(year) operator(-=) integer(1) - reserved(end) - - comment(# in case months is positive) - reserved(while) ident(month) operator(>) integer(12) - ident(month) operator(-=) integer(12) - ident(year) operator(+=) integer(1) - reserved(end) - - ident(max) operator(=) operator(::)constant(Time)operator(.)ident(days_in_month)operator(()ident(month)operator(,) ident(year)operator(\)) - ident(mday) operator(=) ident(max) reserved(if) ident(mday) operator(>) ident(max) - - ident(change)operator(()symbol(:year) operator(=)operator(>) ident(year)operator(,) symbol(:month) operator(=)operator(>) ident(month)operator(,) symbol(:mday) operator(=)operator(>) ident(mday)operator(\)) - reserved(end) - - comment(# Returns a new Time representing the time a number of specified years ago) - reserved(def) method(years_ago)operator(()ident(years)operator(\)) - ident(change)operator(()symbol(:year) operator(=)operator(>) pre_constant(self)operator(.)ident(year) operator(-) ident(years)operator(\)) - reserved(end) - - reserved(def) method(years_since)operator(()ident(years)operator(\)) - ident(change)operator(()symbol(:year) operator(=)operator(>) pre_constant(self)operator(.)ident(year) operator(+) ident(years)operator(\)) - reserved(end) - - comment(# Short-hand for years_ago(1\)) - reserved(def) method(last_year) - ident(years_ago)operator(()integer(1)operator(\)) - reserved(end) - - comment(# Short-hand for years_since(1\)) - reserved(def) method(next_year) - ident(years_since)operator(()integer(1)operator(\)) - reserved(end) - - - comment(# Short-hand for months_ago(1\)) - reserved(def) method(last_month) - ident(months_ago)operator(()integer(1)operator(\)) - reserved(end) - - comment(# Short-hand for months_since(1\)) - reserved(def) method(next_month) - ident(months_since)operator(()integer(1)operator(\)) - reserved(end) - - comment(# Returns a new Time representing the "start" of this week (Monday, 0:00\)) - reserved(def) method(beginning_of_week) - ident(days_to_monday) operator(=) pre_constant(self)operator(.)ident(wday!)operator(=)integer(0) operator(?) pre_constant(self)operator(.)ident(wday)operator(-)integer(1) operator(:) integer(6) - operator(()pre_constant(self) operator(-) ident(days_to_monday)operator(.)ident(days)operator(\))operator(.)ident(midnight) - reserved(end) - reserved(alias) symbol(:monday) symbol(:beginning_of_week) - reserved(alias) symbol(:at_beginning_of_week) symbol(:beginning_of_week) - - comment(# Returns a new Time representing the start of the given day in next week (default is Monday\).) - reserved(def) method(next_week)operator(()ident(day) operator(=) symbol(:monday)operator(\)) - ident(days_into_week) operator(=) operator({) symbol(:monday) operator(=)operator(>) integer(0)operator(,) symbol(:tuesday) operator(=)operator(>) integer(1)operator(,) symbol(:wednesday) operator(=)operator(>) integer(2)operator(,) symbol(:thursday) operator(=)operator(>) integer(3)operator(,) symbol(:friday) operator(=)operator(>) integer(4)operator(,) symbol(:saturday) operator(=)operator(>) integer(5)operator(,) symbol(:sunday) operator(=)operator(>) integer(6)operator(}) - ident(since)operator(()integer(1)operator(.)ident(week)operator(\))operator(.)ident(beginning_of_week)operator(.)ident(since)operator(()ident(days_into_week)operator([)ident(day)operator(])operator(.)ident(day)operator(\))operator(.)ident(change)operator(()symbol(:hour) operator(=)operator(>) integer(0)operator(\)) - reserved(end) - - comment(# Returns a new Time representing the start of the day (0:00\)) - reserved(def) method(beginning_of_day) - operator(()pre_constant(self) operator(-) pre_constant(self)operator(.)ident(seconds_since_midnight)operator(\))operator(.)ident(change)operator(()symbol(:usec) operator(=)operator(>) integer(0)operator(\)) - reserved(end) - reserved(alias) symbol(:midnight) symbol(:beginning_of_day) - reserved(alias) symbol(:at_midnight) symbol(:beginning_of_day) - reserved(alias) symbol(:at_beginning_of_day) symbol(:beginning_of_day) - - comment(# Returns a new Time representing the start of the month (1st of the month, 0:00\)) - reserved(def) method(beginning_of_month) - comment(#self - ((self.mday-1\).days + self.seconds_since_midnight\)) - ident(change)operator(()symbol(:mday) operator(=)operator(>) integer(1)operator(,)symbol(:hour) operator(=)operator(>) integer(0)operator(,) symbol(:min) operator(=)operator(>) integer(0)operator(,) symbol(:sec) operator(=)operator(>) integer(0)operator(,) symbol(:usec) operator(=)operator(>) integer(0)operator(\)) - reserved(end) - reserved(alias) symbol(:at_beginning_of_month) symbol(:beginning_of_month) - - comment(# Returns a new Time representing the end of the month (last day of the month, 0:00\)) - reserved(def) method(end_of_month) - comment(#self - ((self.mday-1\).days + self.seconds_since_midnight\)) - ident(last_day) operator(=) operator(::)constant(Time)operator(.)ident(days_in_month)operator(() pre_constant(self)operator(.)ident(month)operator(,) pre_constant(self)operator(.)ident(year) operator(\)) - ident(change)operator(()symbol(:mday) operator(=)operator(>) ident(last_day)operator(,)symbol(:hour) operator(=)operator(>) integer(0)operator(,) symbol(:min) operator(=)operator(>) integer(0)operator(,) symbol(:sec) operator(=)operator(>) integer(0)operator(,) symbol(:usec) operator(=)operator(>) integer(0)operator(\)) - reserved(end) - reserved(alias) symbol(:at_end_of_month) symbol(:end_of_month) - - comment(# Returns a new Time representing the start of the quarter (1st of january, april, july, october, 0:00\)) - reserved(def) method(beginning_of_quarter) - ident(beginning_of_month)operator(.)ident(change)operator(()symbol(:month) operator(=)operator(>) operator([)integer(10)operator(,) integer(7)operator(,) integer(4)operator(,) integer(1)operator(])operator(.)ident(detect) operator({) operator(|)ident(m)operator(|) ident(m) operator(<=) pre_constant(self)operator(.)ident(month) operator(})operator(\)) - reserved(end) - reserved(alias) symbol(:at_beginning_of_quarter) symbol(:beginning_of_quarter) - - comment(# Returns a new Time representing the start of the year (1st of january, 0:00\)) - reserved(def) method(beginning_of_year) - ident(change)operator(()symbol(:month) operator(=)operator(>) integer(1)operator(,)symbol(:mday) operator(=)operator(>) integer(1)operator(,)symbol(:hour) operator(=)operator(>) integer(0)operator(,) symbol(:min) operator(=)operator(>) integer(0)operator(,) symbol(:sec) operator(=)operator(>) integer(0)operator(,) symbol(:usec) operator(=)operator(>) integer(0)operator(\)) - reserved(end) - reserved(alias) symbol(:at_beginning_of_year) symbol(:beginning_of_year) - - comment(# Convenience method which returns a new Time representing the time 1 day ago) - reserved(def) method(yesterday) - pre_constant(self)operator(.)ident(ago)operator(()integer(1)operator(.)ident(day)operator(\)) - reserved(end) - - comment(# Convenience method which returns a new Time representing the time 1 day since the instance time) - reserved(def) method(tomorrow) - pre_constant(self)operator(.)ident(since)operator(()integer(1)operator(.)ident(day)operator(\)) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) string -ident(require) string - -reserved(module) class(ActiveSupport) comment(#:nodoc:) - reserved(module) class(CoreExtensions) comment(#:nodoc:) - reserved(module) class(Time) comment(#:nodoc:) - comment(# Getting times in different convenient string representations and other objects) - reserved(module) class(Conversions) - constant(DATE_FORMATS) operator(=) operator({) - symbol(:db) operator(=)operator(>) stringoperator(,) - symbol(:short) operator(=)operator(>) stringoperator(,) - symbol(:long) operator(=)operator(>) stringoperator(,) - symbol(:rfc822) operator(=)operator(>) string - operator(}) - - reserved(def) pre_constant(self)operator(.)method(append_features)operator(()ident(klass)operator(\)) - reserved(super) - ident(klass)operator(.)ident(send)operator(()symbol(:alias_method)operator(,) symbol(:to_default_s)operator(,) symbol(:to_s)operator(\)) - ident(klass)operator(.)ident(send)operator(()symbol(:alias_method)operator(,) symbol(:to_s)operator(,) symbol(:to_formatted_s)operator(\)) - reserved(end) - - reserved(def) method(to_formatted_s)operator(()ident(format) operator(=) symbol(:default)operator(\)) - constant(DATE_FORMATS)operator([)ident(format)operator(]) operator(?) ident(strftime)operator(()constant(DATE_FORMATS)operator([)ident(format)operator(])operator(\))operator(.)ident(strip) operator(:) ident(to_default_s) - reserved(end) - - reserved(def) method(to_date) - operator(::)constant(Date)operator(.)ident(new)operator(()ident(year)operator(,) ident(month)operator(,) ident(day)operator(\)) - reserved(end) - - comment(# To be able to keep Dates and Times interchangeable on conversions) - reserved(def) method(to_time) - pre_constant(self) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(class) class(Time)comment(#:nodoc:) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Time)operator(::)constant(Calculations) - ident(include) constant(ActiveSupport)operator(::)constant(CoreExtensions)operator(::)constant(Time)operator(::)constant(Conversions) -reserved(end) -constant(Dir)operator([)constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(])operator(.)ident(each) operator({) operator(|)ident(file)operator(|) ident(require)operator(()ident(file)operator(\)) operator(}) -ident(require) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string - -reserved(module) class(Dependencies) comment(#:nodoc:) - ident(extend) pre_constant(self) - - comment(# Should we turn on Ruby warnings on the first load of dependent files?) - ident(mattr_accessor) symbol(:warnings_on_first_load) - pre_constant(self)operator(.)ident(warnings_on_first_load) operator(=) pre_constant(false) - - comment(# All files ever loaded.) - ident(mattr_accessor) symbol(:history) - pre_constant(self)operator(.)ident(history) operator(=) constant(Set)operator(.)ident(new) - - comment(# All files currently loaded.) - ident(mattr_accessor) symbol(:loaded) - pre_constant(self)operator(.)ident(loaded) operator(=) constant(Set)operator(.)ident(new) - - comment(# Should we load files or require them?) - ident(mattr_accessor) symbol(:mechanism) - pre_constant(self)operator(.)ident(mechanism) operator(=) symbol(:load) - - reserved(def) method(load?) - ident(mechanism) operator(==) symbol(:load) - reserved(end) - - reserved(def) method(depend_on)operator(()ident(file_name)operator(,) ident(swallow_load_errors) operator(=) pre_constant(false)operator(\)) - ident(require_or_load)operator(()ident(file_name)operator(\)) - reserved(rescue) constant(LoadError) - ident(raise) reserved(unless) ident(swallow_load_errors) - reserved(end) - - reserved(def) method(associate_with)operator(()ident(file_name)operator(\)) - ident(depend_on)operator(()ident(file_name)operator(,) pre_constant(true)operator(\)) - reserved(end) - - reserved(def) method(clear) - ident(loaded)operator(.)ident(clear) - reserved(end) - - reserved(def) method(require_or_load)operator(()ident(file_name)operator(\)) - ident(file_name) operator(=) global_variable($1) reserved(if) ident(file_name) operator(=)operator(~) regexp - reserved(return) reserved(if) ident(loaded)operator(.)ident(include?)operator(()ident(file_name)operator(\)) - - comment(# Record that we've seen this file *before* loading it to avoid an) - comment(# infinite loop with mutual dependencies.) - ident(loaded) operator(<<) ident(file_name) - - reserved(if) ident(load?) - reserved(begin) - comment(# Enable warnings iff this file has not been loaded before and) - comment(# warnings_on_first_load is set.) - reserved(if) operator(!)ident(warnings_on_first_load) reserved(or) ident(history)operator(.)ident(include?)operator(()ident(file_name)operator(\)) - ident(load) stringcontent(.rb)delimiter(")> - reserved(else) - ident(enable_warnings) operator({) ident(load) stringcontent(.rb)delimiter(")> operator(}) - reserved(end) - reserved(rescue) - ident(loaded)operator(.)ident(delete) ident(file_name) - ident(raise) - reserved(end) - reserved(else) - ident(require) ident(file_name) - reserved(end) - - comment(# Record history *after* loading so first load gets warnings.) - ident(history) operator(<<) ident(file_name) - reserved(end) - - reserved(class) class(LoadingModule) - comment(# Old style environment.rb referenced this method directly. Please note, it doesn't) - comment(# actualy *do* anything any more.) - reserved(def) pre_constant(self)operator(.)method(root)operator(()operator(*)ident(args)operator(\)) - reserved(if) reserved(defined?)operator(()constant(RAILS_DEFAULT_LOGGER)operator(\)) - constant(RAILS_DEFAULT_LOGGER)operator(.)ident(warn) string - constant(RAILS_DEFAULT_LOGGER)operator(.)ident(warn) string - reserved(end) - reserved(end) - reserved(end) -reserved(end) - -constant(Object)operator(.)ident(send)operator(()symbol(:define_method)operator(,) symbol(:require_or_load)operator(\)) operator({) operator(|)ident(file_name)operator(|) constant(Dependencies)operator(.)ident(require_or_load)operator(()ident(file_name)operator(\)) operator(}) reserved(unless) constant(Object)operator(.)ident(respond_to?)operator(()symbol(:require_or_load)operator(\)) -constant(Object)operator(.)ident(send)operator(()symbol(:define_method)operator(,) symbol(:require_dependency)operator(\)) operator({) operator(|)ident(file_name)operator(|) constant(Dependencies)operator(.)ident(depend_on)operator(()ident(file_name)operator(\)) operator(}) reserved(unless) constant(Object)operator(.)ident(respond_to?)operator(()symbol(:require_dependency)operator(\)) -constant(Object)operator(.)ident(send)operator(()symbol(:define_method)operator(,) symbol(:require_association)operator(\)) operator({) operator(|)ident(file_name)operator(|) constant(Dependencies)operator(.)ident(associate_with)operator(()ident(file_name)operator(\)) operator(}) reserved(unless) constant(Object)operator(.)ident(respond_to?)operator(()symbol(:require_association)operator(\)) - -reserved(class) class(Module) comment(#:nodoc:) - comment(# Rename the original handler so we can chain it to the new one) - reserved(alias) symbol(:rails_original_const_missing) symbol(:const_missing) - - comment(# Use const_missing to autoload associations so we don't have to) - comment(# require_association when using single-table inheritance.) - reserved(def) method(const_missing)operator(()ident(class_id)operator(\)) - ident(file_name) operator(=) ident(class_id)operator(.)ident(to_s)operator(.)ident(demodulize)operator(.)ident(underscore) - ident(file_path) operator(=) ident(as_load_path)operator(.)ident(empty?) operator(?) ident(file_name) operator(:) stringcontent(/)inlinedelimiter(")> - reserved(begin) - ident(require_dependency)operator(()ident(file_path)operator(\)) - ident(brief_name) operator(=) pre_constant(self) operator(==) constant(Object) operator(?) string operator(:) stringcontent(::)delimiter(")> - ident(raise) constant(NameError)operator(.)ident(new)operator(()stringinlinedelimiter(")>operator(\)) reserved(unless) ident(const_defined?)operator(()ident(class_id)operator(\)) - reserved(return) ident(const_get)operator(()ident(class_id)operator(\)) - reserved(rescue) constant(MissingSourceFile) operator(=)operator(>) ident(e) - comment(# Re-raise the error if it does not concern the file we were trying to load.) - ident(raise) reserved(unless) ident(e)operator(.)ident(is_missing?) ident(file_path) - - comment(# Look for a directory in the load path that we ought to load.) - reserved(if) global_variable($LOAD_PATH)operator(.)ident(any?) operator({) operator(|)ident(base)operator(|) constant(File)operator(.)ident(directory?) stringcontent(/)inlinedelimiter(")> operator(}) - ident(mod) operator(=) constant(Module)operator(.)ident(new) - ident(const_set) ident(class_id)operator(,) ident(mod) comment(# Create the new module) - reserved(return) ident(mod) - reserved(end) - - comment(# Attempt to access the name from the parent, unless we don't have a valid) - comment(# parent, or the constant is already defined in the parent. If the latter) - comment(# is the case, then we are being queried via self::class_id, and we should) - comment(# avoid returning the constant from the parent if possible.) - reserved(if) ident(parent) operator(&&) ident(parent) operator(!=) pre_constant(self) operator(&&) operator(!) ident(parents)operator(.)ident(any?) operator({) operator(|)ident(p)operator(|) ident(p)operator(.)ident(const_defined?)operator(()ident(class_id)operator(\)) operator(}) - ident(suppress)operator(()constant(NameError)operator(\)) reserved(do) - reserved(return) ident(parent)operator(.)ident(send)operator(()symbol(:const_missing)operator(,) ident(class_id)operator(\)) - reserved(end) - reserved(end) - - ident(raise) constant(NameError)operator(.)ident(new)operator(()stringdelimiter(")>operator(\))operator(.)ident(copy_blame!)operator(()ident(e)operator(\)) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(Class) - reserved(def) method(const_missing)operator(()ident(class_id)operator(\)) - reserved(if) operator([)constant(Object)operator(,) constant(Kernel)operator(])operator(.)ident(include?)operator(()pre_constant(self)operator(\)) operator(||) ident(parent) operator(==) pre_constant(self) - reserved(super) - reserved(else) - ident(parent)operator(.)ident(send) symbol(:const_missing)operator(,) ident(class_id) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(Object) comment(#:nodoc:) - reserved(def) method(load)operator(()ident(file)operator(,) operator(*)ident(extras)operator(\)) - reserved(super)operator(()ident(file)operator(,) operator(*)ident(extras)operator(\)) - reserved(rescue) constant(Object) operator(=)operator(>) ident(exception) - ident(exception)operator(.)ident(blame_file!) ident(file) - ident(raise) - reserved(end) - - reserved(def) method(require)operator(()ident(file)operator(,) operator(*)ident(extras)operator(\)) - reserved(super)operator(()ident(file)operator(,) operator(*)ident(extras)operator(\)) - reserved(rescue) constant(Object) operator(=)operator(>) ident(exception) - ident(exception)operator(.)ident(blame_file!) ident(file) - ident(raise) - reserved(end) -reserved(end) - -comment(# Add file-blaming to exceptions) -reserved(class) class(Exception) comment(#:nodoc:) - reserved(def) method(blame_file!)operator(()ident(file)operator(\)) - operator(()instance_variable(@blamed_files) operator(||=) operator([)operator(])operator(\))operator(.)ident(unshift) ident(file) - reserved(end) - - reserved(def) method(blamed_files) - instance_variable(@blamed_files) operator(||=) operator([)operator(]) - reserved(end) - - reserved(def) method(describe_blame) - reserved(return) pre_constant(nil) reserved(if) ident(blamed_files)operator(.)ident(empty?) - stringinline_delimiter(})>delimiter(")> - reserved(end) - - reserved(def) method(copy_blame!)operator(()ident(exc)operator(\)) - instance_variable(@blamed_files) operator(=) ident(exc)operator(.)ident(blamed_files)operator(.)ident(clone) - pre_constant(self) - reserved(end) -ident(endInflector)operator(.)ident(inflections) reserved(do) operator(|)ident(inflect)operator(|) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(plural)operator(()regexpoperator(,) stringoperator(\)) - - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(singular)operator(()regexpoperator(,) stringoperator(\)) - - ident(inflect)operator(.)ident(irregular)operator(()stringoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(irregular)operator(()stringoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(irregular)operator(()stringoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(irregular)operator(()stringoperator(,) stringoperator(\)) - ident(inflect)operator(.)ident(irregular)operator(()stringoperator(,) stringoperator(\)) - - ident(inflect)operator(.)ident(uncountable)operator(()stringoperator(\)) -reserved(end) -ident(require) string - -comment(# The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without,) -comment(# and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept) -comment(# in inflections.rb.) -reserved(module) class(Inflector) - comment(# A singleton instance of this class is yielded by Inflector.inflections, which can then be used to specify additional) - comment(# inflection rules. Examples:) - comment(#) - comment(# Inflector.inflections do |inflect|) - comment(# inflect.plural /^(ox\)$/i, '\\1\\2en') - comment(# inflect.singular /^(ox\)en/i, '\\1') - comment(#) - comment(# inflect.irregular 'octopus', 'octopi') - comment(#) - comment(# inflect.uncountable "equipment") - comment(# end) - comment(#) - comment(# New rules are added at the top. So in the example above, the irregular rule for octopus will now be the first of the) - comment(# pluralization and singularization rules that is runs. This guarantees that your rules run before any of the rules that may) - comment(# already have been loaded.) - reserved(class) class(Inflections) - ident(include) constant(Singleton) - - ident(attr_reader) symbol(:plurals)operator(,) symbol(:singulars)operator(,) symbol(:uncountables) - - reserved(def) method(initialize) - instance_variable(@plurals)operator(,) instance_variable(@singulars)operator(,) instance_variable(@uncountables) operator(=) operator([)operator(])operator(,) operator([)operator(])operator(,) operator([)operator(]) - reserved(end) - - comment(# Specifies a new pluralization rule and its replacement. The rule can either be a string or a regular expression. ) - comment(# The replacement should always be a string that may include references to the matched data from the rule.) - reserved(def) method(plural)operator(()ident(rule)operator(,) ident(replacement)operator(\)) - instance_variable(@plurals)operator(.)ident(insert)operator(()integer(0)operator(,) operator([)ident(rule)operator(,) ident(replacement)operator(])operator(\)) - reserved(end) - - comment(# Specifies a new singularization rule and its replacement. The rule can either be a string or a regular expression. ) - comment(# The replacement should always be a string that may include references to the matched data from the rule.) - reserved(def) method(singular)operator(()ident(rule)operator(,) ident(replacement)operator(\)) - instance_variable(@singulars)operator(.)ident(insert)operator(()integer(0)operator(,) operator([)ident(rule)operator(,) ident(replacement)operator(])operator(\)) - reserved(end) - - comment(# Specifies a new irregular that applies to both pluralization and singularization at the same time. This can only be used) - comment(# for strings, not regular expressions. You simply pass the irregular in singular and plural form.) - comment(# ) - comment(# Examples:) - comment(# irregular 'octopus', 'octopi') - comment(# irregular 'person', 'people') - reserved(def) method(irregular)operator(()ident(singular)operator(,) ident(plural)operator(\)) - ident(plural)operator(()constant(Regexp)operator(.)ident(new)operator(()stringcontent(\))inlinecontent($)delimiter(")>operator(,) stringoperator(\))operator(,) string operator(+) ident(plural)operator([)integer(1)operator(..)integer(-1)operator(])operator(\)) - ident(singular)operator(()constant(Regexp)operator(.)ident(new)operator(()stringcontent(\))inlinecontent($)delimiter(")>operator(,) stringoperator(\))operator(,) string operator(+) ident(singular)operator([)integer(1)operator(..)integer(-1)operator(])operator(\)) - reserved(end) - - comment(# Add uncountable words that shouldn't be attempted inflected.) - comment(# ) - comment(# Examples:) - comment(# uncountable "money") - comment(# uncountable "money", "information") - comment(# uncountable %w( money information rice \)) - reserved(def) method(uncountable)operator(()operator(*)ident(words)operator(\)) - operator(()instance_variable(@uncountables) operator(<<) ident(words)operator(\))operator(.)ident(flatten!) - reserved(end) - - comment(# Clears the loaded inflections within a given scope (default is :all\). Give the scope as a symbol of the inflection type,) - comment(# the options are: :plurals, :singulars, :uncountables) - comment(#) - comment(# Examples:) - comment(# clear :all) - comment(# clear :plurals) - reserved(def) method(clear)operator(()ident(scope) operator(=) symbol(:all)operator(\)) - reserved(case) ident(scope) - reserved(when) symbol(:all) - instance_variable(@plurals)operator(,) instance_variable(@singulars)operator(,) instance_variable(@uncountables) operator(=) operator([)operator(])operator(,) operator([)operator(])operator(,) operator([)operator(]) - reserved(else) - ident(instance_variable_set) stringdelimiter(")>operator(,) operator([)operator(]) - reserved(end) - reserved(end) - reserved(end) - - ident(extend) pre_constant(self) - - reserved(def) method(inflections) - reserved(if) ident(block_given?) - reserved(yield) constant(Inflections)operator(.)ident(instance) - reserved(else) - constant(Inflections)operator(.)ident(instance) - reserved(end) - reserved(end) - - reserved(def) method(pluralize)operator(()ident(word)operator(\)) - ident(result) operator(=) ident(word)operator(.)ident(to_s)operator(.)ident(dup) - - reserved(if) ident(inflections)operator(.)ident(uncountables)operator(.)ident(include?)operator(()ident(result)operator(.)ident(downcase)operator(\)) - ident(result) - reserved(else) - ident(inflections)operator(.)ident(plurals)operator(.)ident(each) operator({) operator(|)operator(()ident(rule)operator(,) ident(replacement)operator(\))operator(|) reserved(break) reserved(if) ident(result)operator(.)ident(gsub!)operator(()ident(rule)operator(,) ident(replacement)operator(\)) operator(}) - ident(result) - reserved(end) - reserved(end) - - reserved(def) method(singularize)operator(()ident(word)operator(\)) - ident(result) operator(=) ident(word)operator(.)ident(to_s)operator(.)ident(dup) - - reserved(if) ident(inflections)operator(.)ident(uncountables)operator(.)ident(include?)operator(()ident(result)operator(.)ident(downcase)operator(\)) - ident(result) - reserved(else) - ident(inflections)operator(.)ident(singulars)operator(.)ident(each) operator({) operator(|)operator(()ident(rule)operator(,) ident(replacement)operator(\))operator(|) reserved(break) reserved(if) ident(result)operator(.)ident(gsub!)operator(()ident(rule)operator(,) ident(replacement)operator(\)) operator(}) - ident(result) - reserved(end) - reserved(end) - - reserved(def) method(camelize)operator(()ident(lower_case_and_underscored_word)operator(,) ident(first_letter_in_uppercase) operator(=) pre_constant(true)operator(\)) - reserved(if) ident(first_letter_in_uppercase) - ident(lower_case_and_underscored_word)operator(.)ident(to_s)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) string operator(+) global_variable($1)operator(.)ident(upcase) operator(})operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) global_variable($2)operator(.)ident(upcase) operator(}) - reserved(else) - ident(lower_case_and_underscored_word)operator(.)ident(first) operator(+) ident(camelize)operator(()ident(lower_case_and_underscored_word)operator(\))operator([)integer(1)operator(..)integer(-1)operator(]) - reserved(end) - reserved(end) - - reserved(def) method(titleize)operator(()ident(word)operator(\)) - ident(humanize)operator(()ident(underscore)operator(()ident(word)operator(\))operator(\))operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) global_variable($1)operator(.)ident(capitalize) operator(}) - reserved(end) - - reserved(def) method(underscore)operator(()ident(camel_cased_word)operator(\)) - ident(camel_cased_word)operator(.)ident(to_s)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.) - ident(gsub)operator(()regexpoperator(,)stringoperator(\))operator(.) - ident(gsub)operator(()regexpoperator(,)stringoperator(\))operator(.) - ident(tr)operator(()stringoperator(,) stringoperator(\))operator(.) - ident(downcase) - reserved(end) - - reserved(def) method(dasherize)operator(()ident(underscored_word)operator(\)) - ident(underscored_word)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(humanize)operator(()ident(lower_case_and_underscored_word)operator(\)) - ident(lower_case_and_underscored_word)operator(.)ident(to_s)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(capitalize) - reserved(end) - - reserved(def) method(demodulize)operator(()ident(class_name_in_module)operator(\)) - ident(class_name_in_module)operator(.)ident(to_s)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(tableize)operator(()ident(class_name)operator(\)) - ident(pluralize)operator(()ident(underscore)operator(()ident(class_name)operator(\))operator(\)) - reserved(end) - - reserved(def) method(classify)operator(()ident(table_name)operator(\)) - ident(camelize)operator(()ident(singularize)operator(()ident(table_name)operator(\))operator(\)) - reserved(end) - - reserved(def) method(foreign_key)operator(()ident(class_name)operator(,) ident(separate_class_name_and_id_with_underscore) operator(=) pre_constant(true)operator(\)) - ident(underscore)operator(()ident(demodulize)operator(()ident(class_name)operator(\))operator(\)) operator(+) operator(()ident(separate_class_name_and_id_with_underscore) operator(?) string operator(:) stringoperator(\)) - reserved(end) - - reserved(def) method(constantize)operator(()ident(camel_cased_word)operator(\)) - ident(raise) constant(NameError)operator(,) stringcontent( is not a valid constant name!)delimiter(")> reserved(unless) - regexp operator(=)operator(~) ident(camel_cased_word) - - ident(camel_cased_word) operator(=) stringdelimiter(")> reserved(unless) global_variable($1) - constant(Object)operator(.)ident(module_eval)operator(()ident(camel_cased_word)operator(,) pre_constant(__FILE__)operator(,) pre_constant(__LINE__)operator(\)) - reserved(end) - - reserved(def) method(ordinalize)operator(()ident(number)operator(\)) - reserved(if) operator(()integer(11)operator(..)integer(13)operator(\))operator(.)ident(include?)operator(()ident(number)operator(.)ident(to_i) operator(%) integer(100)operator(\)) - stringcontent(th)delimiter(")> - reserved(else) - reserved(case) ident(number)operator(.)ident(to_i) operator(%) integer(10) - reserved(when) integer(1)operator(:) stringcontent(st)delimiter(")> - reserved(when) integer(2)operator(:) stringcontent(nd)delimiter(")> - reserved(when) integer(3)operator(:) stringcontent(rd)delimiter(")> - reserved(else) stringcontent(th)delimiter(")> - reserved(end) - reserved(end) - reserved(end) -reserved(end) - -ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -reserved(module) class(ActiveSupport) - reserved(module) class(JSON) comment(#:nodoc:) - reserved(module) class(Encoders) comment(#:nodoc:) - ident(define_encoder) constant(Object) reserved(do) operator(|)ident(object)operator(|) - ident(object)operator(.)ident(instance_values)operator(.)ident(to_json) - reserved(end) - - ident(define_encoder) constant(TrueClass) reserved(do) - string - reserved(end) - - ident(define_encoder) constant(FalseClass) reserved(do) - string - reserved(end) - - ident(define_encoder) constant(NilClass) reserved(do) - string - reserved(end) - - ident(define_encoder) constant(String) reserved(do) operator(|)ident(string)operator(|) - ident(returning) ident(value) operator(=) string reserved(do) - ident(string)operator(.)ident(each_char) reserved(do) operator(|)ident(char)operator(|) - ident(value) operator(<<) reserved(case) - reserved(when) ident(char) operator(==) stringoperator(:) string - reserved(when) ident(char) operator(==) stringoperator(:) string - reserved(when) ident(char) operator(==) stringoperator(:) string - reserved(when) ident(char) operator(==) stringoperator(:) string - reserved(when) ident(char) operator(==) stringoperator(:) string - reserved(when) ident(char) operator(==) stringoperator(:) string - reserved(when) ident(char) operator(==) stringoperator(:) string - reserved(when) ident(char)operator(.)ident(length) operator(>) integer(1)operator(:) string operator(%) ident(char)operator(.)ident(unpack)operator(()stringoperator(\))operator(.)ident(first)inline_delimiter(})>delimiter(")> - reserved(else)operator(;) ident(char) - reserved(end) - reserved(end) - ident(value) operator(<<) string - reserved(end) - reserved(end) - - ident(define_encoder) constant(Numeric) reserved(do) operator(|)ident(numeric)operator(|) - ident(numeric)operator(.)ident(to_s) - reserved(end) - - ident(define_encoder) constant(Symbol) reserved(do) operator(|)ident(symbol)operator(|) - ident(symbol)operator(.)ident(to_s)operator(.)ident(to_json) - reserved(end) - - ident(define_encoder) constant(Enumerable) reserved(do) operator(|)ident(enumerable)operator(|) - stringinline_delimiter(})>content(])delimiter(")> - reserved(end) - - ident(define_encoder) constant(Hash) reserved(do) operator(|)ident(hash)operator(|) - ident(returning) ident(result) operator(=) string reserved(do) - ident(result) operator(<<) ident(hash)operator(.)ident(map) reserved(do) operator(|)ident(pair)operator(|) - ident(pair)operator(.)ident(map) operator({) operator(|)ident(value)operator(|) ident(value)operator(.)ident(to_json) operator(}) operator(*) string - reserved(end) operator(*) string - ident(result) operator(<<) string - reserved(end) - reserved(end) - - ident(define_encoder) constant(Regexp) reserved(do) operator(|)ident(regexp)operator(|) - ident(regexp)operator(.)ident(inspect) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveSupport) - reserved(module) class(JSON) comment(#:nodoc:) - reserved(module) class(Encoders) - ident(mattr_accessor) symbol(:encoders) - class_variable(@@encoders) operator(=) operator({)operator(}) - - reserved(class) operator(<<) class(self) - reserved(def) method(define_encoder)operator(()ident(klass)operator(,) operator(&)ident(block)operator(\)) - ident(encoders)operator([)ident(klass)operator(]) operator(=) ident(block) - reserved(end) - - reserved(def) method([])operator(()ident(klass)operator(\)) - ident(klass)operator(.)ident(ancestors)operator(.)ident(each) reserved(do) operator(|)ident(k)operator(|) - ident(encoder) operator(=) ident(encoders)operator([)ident(k)operator(]) - reserved(return) ident(encoder) reserved(if) ident(encoder) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - reserved(end) -reserved(end) - -constant(Dir)operator([)constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(])operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - ident(require) ident(file)operator([)integer(0)operator(..)integer(-4)operator(]) -reserved(end) -ident(require) string - -reserved(module) class(ActiveSupport) - reserved(module) class(JSON) comment(#:nodoc:) - reserved(class) class(CircularReferenceError) operator(<) constant(StandardError) comment(#:nodoc:) - reserved(end) - comment(# returns the literal string as its JSON encoded form. Useful for passing javascript variables into functions.) - comment(#) - comment(# page.call 'Element.show', ActiveSupport::JSON::Variable.new("$$(#items li\)"\)) - reserved(class) class(Variable) operator(<) constant(String) comment(#:nodoc:) - reserved(def) method(to_json) - pre_constant(self) - reserved(end) - reserved(end) - - reserved(class) operator(<<) class(self) - constant(REFERENCE_STACK_VARIABLE) operator(=) symbol(:json_reference_stack) - - reserved(def) method(encode)operator(()ident(value)operator(\)) - ident(raise_on_circular_reference)operator(()ident(value)operator(\)) reserved(do) - constant(Encoders)operator([)ident(value)operator(.)ident(class)operator(])operator(.)ident(call)operator(()ident(value)operator(\)) - reserved(end) - reserved(end) - - ident(protected) - reserved(def) method(raise_on_circular_reference)operator(()ident(value)operator(\)) - ident(stack) operator(=) constant(Thread)operator(.)ident(current)operator([)constant(REFERENCE_STACK_VARIABLE)operator(]) operator(||=) operator([)operator(]) - ident(raise) constant(CircularReferenceError)operator(,) string reserved(if) - ident(stack)operator(.)ident(include?) ident(value) - ident(stack) operator(<<) ident(value) - reserved(yield) - reserved(ensure) - ident(stack)operator(.)ident(pop) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(module) class(ActiveSupport) - reserved(class) class(OptionMerger) comment(#:nodoc:) - ident(instance_methods)operator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - ident(undef_method)operator(()ident(method)operator(\)) reserved(if) ident(method) operator(!)operator(~) regexp - reserved(end) - - reserved(def) method(initialize)operator(()ident(context)operator(,) ident(options)operator(\)) - instance_variable(@context)operator(,) instance_variable(@options) operator(=) ident(context)operator(,) ident(options) - reserved(end) - - ident(private) - reserved(def) method(method_missing)operator(()ident(method)operator(,) operator(*)ident(arguments)operator(,) operator(&)ident(block)operator(\)) - ident(merge_argument_options!) ident(arguments) - instance_variable(@context)operator(.)ident(send)operator(()ident(method)operator(,) operator(*)ident(arguments)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - reserved(def) method(merge_argument_options!)operator(()ident(arguments)operator(\)) - ident(arguments) operator(<<) reserved(if) ident(arguments)operator(.)ident(last)operator(.)ident(respond_to?) symbol(:merge!) - ident(arguments)operator(.)ident(pop)operator(.)ident(dup)operator(.)ident(merge!)operator(()instance_variable(@options)operator(\)) - reserved(else) - instance_variable(@options)operator(.)ident(dup) - reserved(end) - reserved(end) - reserved(end) -reserved(end) -reserved(class) class(OrderedHash) operator(<) constant(Array) comment(#:nodoc:) - reserved(def) method([]=)operator(()ident(key)operator(,) ident(value)operator(\)) - reserved(if) ident(pair) operator(=) ident(find_pair)operator(()ident(key)operator(\)) - ident(pair)operator(.)ident(pop) - ident(pair) operator(<<) ident(value) - reserved(else) - pre_constant(self) operator(<<) operator([)ident(key)operator(,) ident(value)operator(]) - reserved(end) - reserved(end) - - reserved(def) method([])operator(()ident(key)operator(\)) - ident(pair) operator(=) ident(find_pair)operator(()ident(key)operator(\)) - ident(pair) operator(?) ident(pair)operator(.)ident(last) operator(:) pre_constant(nil) - reserved(end) - - reserved(def) method(keys) - pre_constant(self)operator(.)ident(collect) operator({) operator(|)ident(i)operator(|) ident(i)operator(.)ident(first) operator(}) - reserved(end) - - ident(private) - reserved(def) method(find_pair)operator(()ident(key)operator(\)) - pre_constant(self)operator(.)ident(each) operator({) operator(|)ident(i)operator(|) reserved(return) ident(i) reserved(if) ident(i)operator(.)ident(first) operator(==) ident(key) operator(}) - reserved(return) pre_constant(false) - reserved(end) -reserved(end) - -reserved(class) class(OrderedOptions) operator(<) constant(OrderedHash) comment(#:nodoc:) - reserved(def) method([]=)operator(()ident(key)operator(,) ident(value)operator(\)) - reserved(super)operator(()ident(key)operator(.)ident(to_sym)operator(,) ident(value)operator(\)) - reserved(end) - - reserved(def) method([])operator(()ident(key)operator(\)) - reserved(super)operator(()ident(key)operator(.)ident(to_sym)operator(\)) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) - reserved(if) ident(name)operator(.)ident(to_s) operator(=)operator(~) regexp - pre_constant(self)operator([)global_variable($1)operator(.)ident(to_sym)operator(]) operator(=) ident(args)operator(.)ident(first) - reserved(else) - pre_constant(self)operator([)ident(name)operator(]) - reserved(end) - reserved(end) -reserved(end)comment(# Classes that include this module will automatically be reloaded) -comment(# by the Rails dispatcher when Dependencies.mechanism = :load.) -reserved(module) class(Reloadable) - reserved(class) operator(<<) class(self) - reserved(def) method(included)operator(()ident(base)operator(\)) comment(#nodoc:) - ident(raise) constant(TypeError)operator(,) string reserved(unless) ident(base)operator(.)ident(is_a?) constant(Class) - - reserved(unless) ident(base)operator(.)ident(respond_to?)operator(()symbol(:reloadable?)operator(\)) - reserved(class) operator(<<) class(base) - ident(define_method)operator(()symbol(:reloadable?)operator(\)) operator({) pre_constant(true) operator(}) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(reloadable_classes) - ident(included_in_classes)operator(.)ident(select) operator({) operator(|)ident(klass)operator(|) ident(klass)operator(.)ident(reloadable?) operator(}) - reserved(end) - reserved(end) - - comment(# Captures the common pattern where a base class should not be reloaded,) - comment(# but its subclasses should be.) - reserved(module) class(Subclasses) - reserved(def) pre_constant(self)operator(.)method(included)operator(()ident(base)operator(\)) comment(#nodoc:) - ident(base)operator(.)ident(send) symbol(:include)operator(,) constant(Reloadable) - operator(()reserved(class) operator(<<) class(base)operator(;) pre_constant(self)operator(;) reserved(end)operator(\))operator(.)ident(send)operator(()symbol(:define_method)operator(,) symbol(:reloadable?)operator(\)) reserved(do) - ident(base) operator(!=) pre_constant(self) - reserved(end) - reserved(end) - reserved(end) -reserved(end)comment(# A value object representing a time zone. A time zone is simply a named) -comment(# offset (in seconds\) from GMT. Note that two time zone objects are only) -comment(# equivalent if they have both the same offset, and the same name.) -comment(#) -comment(# A TimeZone instance may be used to convert a Time value to the corresponding) -comment(# time zone.) -comment(#) -comment(# The class also includes #all, which returns a list of all TimeZone objects.) -reserved(class) class(TimeZone) - ident(include) constant(Comparable) - - ident(attr_reader) symbol(:name)operator(,) symbol(:utc_offset) - - comment(# Create a new TimeZone object with the given name and offset. The offset is) - comment(# the number of seconds that this time zone is offset from UTC (GMT\). Seconds) - comment(# were chosen as the offset unit because that is the unit that Ruby uses) - comment(# to represent time zone offsets (see Time#utc_offset\).) - reserved(def) method(initialize)operator(()ident(name)operator(,) ident(utc_offset)operator(\)) - instance_variable(@name) operator(=) ident(name) - instance_variable(@utc_offset) operator(=) ident(utc_offset) - reserved(end) - - comment(# Returns the offset of this time zone as a formatted string, of the) - comment(# format "+HH:MM". If the offset is zero, this returns the empty) - comment(# string. If +colon+ is false, a colon will not be inserted into the) - comment(# result.) - reserved(def) method(formatted_offset)operator(() ident(colon)operator(=)pre_constant(true) operator(\)) - reserved(return) string reserved(if) ident(utc_offset) operator(==) integer(0) - ident(sign) operator(=) operator(()ident(utc_offset) operator(<) integer(0) operator(?) integer(-1) operator(:) integer(1)operator(\)) - ident(hours) operator(=) ident(utc_offset)operator(.)ident(abs) operator(/) integer(3600) - ident(minutes) operator(=) operator(()ident(utc_offset)operator(.)ident(abs) operator(%) integer(3600)operator(\)) operator(/) integer(60) - string operator(%) operator([) ident(hours) operator(*) ident(sign)operator(,) ident(colon) operator(?) string operator(:) stringoperator(,) ident(minutes) operator(]) - reserved(end) - - comment(# Compute and return the current time, in the time zone represented by) - comment(# +self+.) - reserved(def) method(now) - ident(adjust)operator(()constant(Time)operator(.)ident(now)operator(\)) - reserved(end) - - comment(# Return the current date in this time zone.) - reserved(def) method(today) - ident(now)operator(.)ident(to_date) - reserved(end) - - comment(# Adjust the given time to the time zone represented by +self+.) - reserved(def) method(adjust)operator(()ident(time)operator(\)) - ident(time) operator(=) ident(time)operator(.)ident(to_time) - ident(time) operator(+) ident(utc_offset) operator(-) ident(time)operator(.)ident(utc_offset) - reserved(end) - - comment(# Reinterprets the given time value as a time in the current time) - comment(# zone, and then adjusts it to return the corresponding time in the) - comment(# local time zone.) - reserved(def) method(unadjust)operator(()ident(time)operator(\)) - ident(time) operator(=) constant(Time)operator(.)ident(local)operator(()operator(*)ident(time)operator(.)ident(to_time)operator(.)ident(to_a)operator(\)) - ident(time) operator(-) ident(utc_offset) operator(+) ident(time)operator(.)ident(utc_offset) - reserved(end) - - comment(# Compare this time zone to the parameter. The two are comapred first on) - comment(# their offsets, and then by name.) - reserved(def) method(<=>)operator(()ident(zone)operator(\)) - ident(result) operator(=) operator(()ident(utc_offset) operator(<=>) ident(zone)operator(.)ident(utc_offset)operator(\)) - ident(result) operator(=) operator(()ident(name) operator(<=>) ident(zone)operator(.)ident(name)operator(\)) reserved(if) ident(result) operator(==) integer(0) - ident(result) - reserved(end) - - comment(# Returns a textual representation of this time zone.) - reserved(def) method(to_s) - stringcontent(\) )inlinedelimiter(")> - reserved(end) - - class_variable(@@zones) operator(=) pre_constant(nil) - - reserved(class) operator(<<) class(self) - comment(# Create a new TimeZone instance with the given name and offset.) - reserved(def) method(create)operator(()ident(name)operator(,) ident(offset)operator(\)) - ident(zone) operator(=) ident(allocate) - ident(zone)operator(.)ident(send) symbol(:initialize)operator(,) ident(name)operator(,) ident(offset) - ident(zone) - reserved(end) - - comment(# Return a TimeZone instance with the given name, or +nil+ if no) - comment(# such TimeZone instance exists. (This exists to support the use of) - comment(# this class with the #composed_of macro.\)) - reserved(def) method(new)operator(()ident(name)operator(\)) - pre_constant(self)operator([)ident(name)operator(]) - reserved(end) - - comment(# Return an array of all TimeZone objects. There are multiple TimeZone) - comment(# objects per time zone, in many cases, to make it easier for users to) - comment(# find their own time zone.) - reserved(def) method(all) - reserved(unless) class_variable(@@zones) - class_variable(@@zones) operator(=) operator([)operator(]) - operator([)operator([)integer(-43_200)operator(,) string operator(])operator(,) - operator([)integer(-39_600)operator(,) stringoperator(,) string operator(])operator(,) - operator([)integer(-36_000)operator(,) string operator(])operator(,) - operator([)integer(-32_400)operator(,) string operator(])operator(,) - operator([)integer(-28_800)operator(,) stringoperator(,) string operator(])operator(,) - operator([)integer(-25_200)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) string operator(])operator(,) - operator([)integer(-21_600)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([)integer(-18_000)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) string operator(])operator(,) - operator([)integer(-14_400)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([)integer(-12_600)operator(,) string operator(])operator(,) - operator([)integer(-10_800)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) integer(-7_200)operator(,) string operator(])operator(,) - operator([) integer(-3_600)operator(,) stringoperator(,) string operator(])operator(,) - operator([) integer(0)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - string operator(])operator(,) - operator([) integer(3_600)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - string operator(])operator(,) - operator([) integer(7_200)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) integer(10_800)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) string operator(])operator(,) - operator([) integer(12_600)operator(,) string operator(])operator(,) - operator([) integer(14_400)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) integer(16_200)operator(,) string operator(])operator(,) - operator([) integer(18_000)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) integer(19_800)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) integer(20_700)operator(,) string operator(])operator(,) - operator([) integer(21_600)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - string operator(])operator(,) - operator([) integer(23_400)operator(,) string operator(])operator(,) - operator([) integer(25_200)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) integer(28_800)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - string operator(])operator(,) - operator([) integer(32_400)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) integer(34_200)operator(,) stringoperator(,) string operator(])operator(,) - operator([) integer(36_000)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) integer(39_600)operator(,) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) integer(43_200)operator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - string operator(])operator(,) - operator([) integer(46_800)operator(,) string operator(])operator(])operator(.) - ident(each) reserved(do) operator(|)ident(offset)operator(,) operator(*)ident(places)operator(|) - ident(places)operator(.)ident(each) operator({) operator(|)ident(place)operator(|) class_variable(@@zones) operator(<<) ident(create)operator(()ident(place)operator(,) ident(offset)operator(\))operator(.)ident(freeze) operator(}) - reserved(end) - class_variable(@@zones)operator(.)ident(sort!) - reserved(end) - class_variable(@@zones) - reserved(end) - - comment(# Locate a specific time zone object. If the argument is a string, it) - comment(# is interpreted to mean the name of the timezone to locate. If it is a) - comment(# numeric value it is either the hour offset, or the second offset, of the) - comment(# timezone to find. (The first one with that offset will be returned.\)) - comment(# Returns +nil+ if no such time zone is known to the system.) - reserved(def) method([])operator(()ident(arg)operator(\)) - reserved(case) ident(arg) - reserved(when) constant(String) - ident(all)operator(.)ident(find) operator({) operator(|)ident(z)operator(|) ident(z)operator(.)ident(name) operator(==) ident(arg) operator(}) - reserved(when) constant(Numeric) - ident(arg) operator(*=) integer(3600) reserved(if) ident(arg)operator(.)ident(abs) operator(<=) integer(13) - ident(all)operator(.)ident(find) operator({) operator(|)ident(z)operator(|) ident(z)operator(.)ident(utc_offset) operator(==) ident(arg)operator(.)ident(to_i) operator(}) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) stringdelimiter(")> - reserved(end) - reserved(end) - - comment(# A regular expression that matches the names of all time zones in) - comment(# the USA.) - constant(US_ZONES) operator(=) regexp - - comment(# A convenience method for returning a collection of TimeZone objects) - comment(# for time zones in the USA.) - reserved(def) method(us_zones) - ident(all)operator(.)ident(find_all) operator({) operator(|)ident(z)operator(|) ident(z)operator(.)ident(name) operator(=)operator(~) constant(US_ZONES) operator(}) - reserved(end) - reserved(end) -reserved(end) -doctype(#!/usr/bin/env ruby) -comment(#--) -comment(# Copyright 2004 by Jim Weirich (jim@weirichhouse.org\).) -comment(# All rights reserved.) - -comment(# Permission is granted for use, copying, modification, distribution,) -comment(# and distribution of modified versions of this work as long as the) -comment(# above copyright notice is included.) -comment(#++) - -reserved(module) class(Builder) comment(#:nodoc:) - - comment(# BlankSlate provides an abstract base class with no predefined) - comment(# methods (except for \\_\\_send__ and \\_\\_id__\).) - comment(# BlankSlate is useful as a base class when writing classes that) - comment(# depend upon method_missing (e.g. dynamic proxies\).) - reserved(class) class(BlankSlate) comment(#:nodoc:) - reserved(class) operator(<<) class(self) - reserved(def) method(hide)operator(()ident(name)operator(\)) - ident(undef_method) ident(name) reserved(if) - ident(instance_methods)operator(.)ident(include?)operator(()ident(name)operator(.)ident(to_s)operator(\)) reserved(and) - ident(name) operator(!)operator(~) regexp - reserved(end) - reserved(end) - - ident(instance_methods)operator(.)ident(each) operator({) operator(|)ident(m)operator(|) ident(hide)operator(()ident(m)operator(\)) operator(}) - reserved(end) -reserved(end) - -comment(# Since Ruby is very dynamic, methods added to the ancestors of) -comment(# BlankSlate after BlankSlate is defined will show up in the) -comment(# list of available BlankSlate methods. We handle this by defining a hook in the Object and Kernel classes that will hide any defined ) -reserved(module) class(Kernel) comment(#:nodoc:) - reserved(class) operator(<<) class(self) - ident(alias_method) symbol(:blank_slate_method_added)operator(,) symbol(:method_added) - reserved(def) method(method_added)operator(()ident(name)operator(\)) - ident(blank_slate_method_added)operator(()ident(name)operator(\)) - reserved(return) reserved(if) pre_constant(self) operator(!=) constant(Kernel) - constant(Builder)operator(::)constant(BlankSlate)operator(.)ident(hide)operator(()ident(name)operator(\)) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(Object) comment(#:nodoc:) - reserved(class) operator(<<) class(self) - ident(alias_method) symbol(:blank_slate_method_added)operator(,) symbol(:method_added) - reserved(def) method(method_added)operator(()ident(name)operator(\)) - ident(blank_slate_method_added)operator(()ident(name)operator(\)) - reserved(return) reserved(if) pre_constant(self) operator(!=) constant(Object) - constant(Builder)operator(::)constant(BlankSlate)operator(.)ident(hide)operator(()ident(name)operator(\)) - reserved(end) - reserved(end) -reserved(end) -doctype(#!/usr/bin/env ruby) - -ident(require) string - -reserved(module) class(Builder) comment(#:nodoc:) - - comment(# Generic error for builder) - reserved(class) class(IllegalBlockError) operator(<) constant(RuntimeError) comment(#:nodoc:) - reserved(end) - - comment(# XmlBase is a base class for building XML builders. See) - comment(# Builder::XmlMarkup and Builder::XmlEvents for examples.) - reserved(class) class(XmlBase) operator(<) constant(BlankSlate) comment(#:nodoc:) - - comment(# Create an XML markup builder.) - comment(#) - comment(# out:: Object receiving the markup.1 +out+ must respond to) - comment(# <<.) - comment(# indent:: Number of spaces used for indentation (0 implies no) - comment(# indentation and no line breaks\).) - comment(# initial:: Level of initial indentation.) - comment(#) - reserved(def) method(initialize)operator(()ident(indent)operator(=)integer(0)operator(,) ident(initial)operator(=)integer(0)operator(\)) - instance_variable(@indent) operator(=) ident(indent) - instance_variable(@level) operator(=) ident(initial) - reserved(end) - - comment(# Create a tag named +sym+. Other than the first argument which) - comment(# is the tag name, the arguements are the same as the tags) - comment(# implemented via method_missing.) - reserved(def) method(tag!)operator(()ident(sym)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - pre_constant(self)operator(.)ident(__send__)operator(()ident(sym)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(end) - - comment(# Create XML markup based on the name of the method. This method) - comment(# is never invoked directly, but is called for each markup method) - comment(# in the markup block.) - reserved(def) method(method_missing)operator(()ident(sym)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(text) operator(=) pre_constant(nil) - ident(attrs) operator(=) pre_constant(nil) - ident(sym) operator(=) stringcontent(:)inlinedelimiter(")> reserved(if) ident(args)operator(.)ident(first)operator(.)ident(kind_of?)operator(()constant(Symbol)operator(\)) - ident(args)operator(.)ident(each) reserved(do) operator(|)ident(arg)operator(|) - reserved(case) ident(arg) - reserved(when) constant(Hash) - ident(attrs) operator(||=) operator({)operator(}) - ident(attrs)operator(.)ident(merge!)operator(()ident(arg)operator(\)) - reserved(else) - ident(text) operator(||=) string - ident(text) operator(<<) ident(arg)operator(.)ident(to_s) - reserved(end) - reserved(end) - reserved(if) ident(block) - reserved(unless) ident(text)operator(.)ident(nil?) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - ident(_capture_outer_self)operator(()ident(block)operator(\)) reserved(if) instance_variable(@self)operator(.)ident(nil?) - ident(_indent) - ident(_start_tag)operator(()ident(sym)operator(,) ident(attrs)operator(\)) - ident(_newline) - ident(_nested_structures)operator(()ident(block)operator(\)) - ident(_indent) - ident(_end_tag)operator(()ident(sym)operator(\)) - ident(_newline) - reserved(elsif) ident(text)operator(.)ident(nil?) - ident(_indent) - ident(_start_tag)operator(()ident(sym)operator(,) ident(attrs)operator(,) pre_constant(true)operator(\)) - ident(_newline) - reserved(else) - ident(_indent) - ident(_start_tag)operator(()ident(sym)operator(,) ident(attrs)operator(\)) - ident(text!) ident(text) - ident(_end_tag)operator(()ident(sym)operator(\)) - ident(_newline) - reserved(end) - instance_variable(@target) - reserved(end) - - comment(# Append text to the output target. Escape any markup. May be) - comment(# used within the markup brackets as:) - comment(#) - comment(# builder.p { br; text! "HI" } #=>


    HI

    ) - reserved(def) method(text!)operator(()ident(text)operator(\)) - ident(_text)operator(()ident(_escape)operator(()ident(text)operator(\))operator(\)) - reserved(end) - - comment(# Append text to the output target without escaping any markup.) - comment(# May be used within the markup brackets as:) - comment(#) - comment(# builder.p { |x| x << "
    HI" } #=>


    HI

    ) - comment(#) - comment(# This is useful when using non-builder enabled software that) - comment(# generates strings. Just insert the string directly into the) - comment(# builder without changing the inserted markup.) - comment(#) - comment(# It is also useful for stacking builder objects. Builders only) - comment(# use << to append to the target, so by supporting this) - comment(# method/operation builders can use other builders as their) - comment(# targets.) - reserved(def) method(<<)operator(()ident(text)operator(\)) - ident(_text)operator(()ident(text)operator(\)) - reserved(end) - - comment(# For some reason, nil? is sent to the XmlMarkup object. If nil?) - comment(# is not defined and method_missing is invoked, some strange kind) - comment(# of recursion happens. Since nil? won't ever be an XML tag, it) - comment(# is pretty safe to define it here. (Note: this is an example of) - comment(# cargo cult programming,) - comment(# cf. http://fishbowl.pastiche.org/2004/10/13/cargo_cult_programming\).) - reserved(def) method(nil?) - pre_constant(false) - reserved(end) - - ident(private) - - reserved(def) method(_escape)operator(()ident(text)operator(\)) - ident(text)operator(.) - ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.) - ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.) - ident(gsub)operator(()regexp)delimiter(})>operator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(_capture_outer_self)operator(()ident(block)operator(\)) - instance_variable(@self) operator(=) ident(eval)operator(()stringoperator(,) ident(block)operator(\)) - reserved(end) - - reserved(def) method(_newline) - reserved(return) reserved(if) instance_variable(@indent) operator(==) integer(0) - ident(text!) string - reserved(end) - - reserved(def) method(_indent) - reserved(return) reserved(if) instance_variable(@indent) operator(==) integer(0) operator(||) instance_variable(@level) operator(==) integer(0) - ident(text!)operator(()string operator(*) operator(()instance_variable(@level) operator(*) instance_variable(@indent)operator(\))operator(\)) - reserved(end) - - reserved(def) method(_nested_structures)operator(()ident(block)operator(\)) - instance_variable(@level) operator(+=) integer(1) - ident(block)operator(.)ident(call)operator(()pre_constant(self)operator(\)) - reserved(ensure) - instance_variable(@level) operator(-=) integer(1) - reserved(end) - reserved(end) -reserved(end) -doctype(#!/usr/bin/env ruby) - -comment(#--) -comment(# Copyright 2004 by Jim Weirich (jim@weirichhouse.org\).) -comment(# All rights reserved.) - -comment(# Permission is granted for use, copying, modification, distribution,) -comment(# and distribution of modified versions of this work as long as the) -comment(# above copyright notice is included.) -comment(#++) - -ident(require) string - -reserved(module) class(Builder) - - comment(# Create a series of SAX-like XML events (e.g. start_tag, end_tag\)) - comment(# from the markup code. XmlEvent objects are used in a way similar) - comment(# to XmlMarkup objects, except that a series of events are generated) - comment(# and passed to a handler rather than generating character-based) - comment(# markup.) - comment(#) - comment(# Usage:) - comment(# xe = Builder::XmlEvents.new(hander\)) - comment(# xe.title("HI"\) # Sends start_tag/end_tag/text messages to the handler.) - comment(#) - comment(# Indentation may also be selected by providing value for the) - comment(# indentation size and initial indentation level.) - comment(#) - comment(# xe = Builder::XmlEvents.new(handler, indent_size, initial_indent_level\)) - comment(#) - comment(# == XML Event Handler) - comment(#) - comment(# The handler object must expect the following events.) - comment(#) - comment(# [start_tag(tag, attrs\)]) - comment(# Announces that a new tag has been found. +tag+ is the name of) - comment(# the tag and +attrs+ is a hash of attributes for the tag.) - comment(#) - comment(# [end_tag(tag\)]) - comment(# Announces that an end tag for +tag+ has been found.) - comment(#) - comment(# [text(text\)]) - comment(# Announces that a string of characters (+text+\) has been found.) - comment(# A series of characters may be broken up into more than one) - comment(# +text+ call, so the client cannot assume that a single) - comment(# callback contains all the text data.) - comment(#) - reserved(class) class(XmlEvents) operator(<) constant(XmlMarkup) comment(#:nodoc:) - reserved(def) method(text!)operator(()ident(text)operator(\)) - instance_variable(@target)operator(.)ident(text)operator(()ident(text)operator(\)) - reserved(end) - - reserved(def) method(_start_tag)operator(()ident(sym)operator(,) ident(attrs)operator(,) ident(end_too)operator(=)pre_constant(false)operator(\)) - instance_variable(@target)operator(.)ident(start_tag)operator(()ident(sym)operator(,) ident(attrs)operator(\)) - ident(_end_tag)operator(()ident(sym)operator(\)) reserved(if) ident(end_too) - reserved(end) - - reserved(def) method(_end_tag)operator(()ident(sym)operator(\)) - instance_variable(@target)operator(.)ident(end_tag)operator(()ident(sym)operator(\)) - reserved(end) - reserved(end) - -reserved(end) -doctype(#!/usr/bin/env ruby) -comment(#--) -comment(# Copyright 2004 by Jim Weirich (jim@weirichhouse.org\).) -comment(# All rights reserved.) - -comment(# Permission is granted for use, copying, modification, distribution,) -comment(# and distribution of modified versions of this work as long as the) -comment(# above copyright notice is included.) -comment(#++) - -comment(# Provide a flexible and easy to use Builder for creating XML markup.) -comment(# See XmlBuilder for usage details.) - -ident(require) string - -reserved(module) class(Builder) - - comment(# Create XML markup easily. All (well, almost all\) methods sent to) - comment(# an XmlMarkup object will be translated to the equivalent XML) - comment(# markup. Any method with a block will be treated as an XML markup) - comment(# tag with nested markup in the block.) - comment(#) - comment(# Examples will demonstrate this easier than words. In the) - comment(# following, +xm+ is an +XmlMarkup+ object.) - comment(#) - comment(# xm.em("emphasized"\) # => emphasized) - comment(# xm.em { xmm.b("emp & bold"\) } # => emph & bold) - comment(# xm.a("A Link", "href"=>"http://onestepback.org"\)) - comment(# # => A Link) - comment(# xm.div { br } # =>

    ) - comment(# xm.target("name"=>"compile", "option"=>"fast"\)) - comment(# # => ) - comment(# # NOTE: order of attributes is not specified.) - comment(#) - comment(# xm.instruct! # ) - comment(# xm.html { # ) - comment(# xm.head { # ) - comment(# xm.title("History"\) # History) - comment(# } # ) - comment(# xm.body { # ) - comment(# xm.comment! "HI" # ) - comment(# xm.h1("Header"\) #

    Header

    ) - comment(# xm.p("paragraph"\) #

    paragraph

    ) - comment(# } # ) - comment(# } # ) - comment(#) - comment(# == Notes:) - comment(#) - comment(# * The order that attributes are inserted in markup tags is) - comment(# undefined. ) - comment(#) - comment(# * Sometimes you wish to insert text without enclosing tags. Use) - comment(# the text! method to accomplish this.) - comment(#) - comment(# Example:) - comment(#) - comment(# xm.div { #
    ) - comment(# xm.text! "line"; xm.br # line
    ) - comment(# xm.text! "another line"; xmbr # another line
    ) - comment(# } #
    ) - comment(#) - comment(# * The special XML characters <, >, and & are converted to <,) - comment(# > and & automatically. Use the << operation to) - comment(# insert text without modification.) - comment(#) - comment(# * Sometimes tags use special characters not allowed in ruby) - comment(# identifiers. Use the tag! method to handle these) - comment(# cases.) - comment(#) - comment(# Example:) - comment(#) - comment(# xml.tag!("SOAP:Envelope"\) { ... }) - comment(#) - comment(# will produce ...) - comment(#) - comment(# ... ") - comment(#) - comment(# tag! will also take text and attribute arguments (after) - comment(# the tag name\) like normal markup methods. (But see the next) - comment(# bullet item for a better way to handle XML namespaces\).) - comment(# ) - comment(# * Direct support for XML namespaces is now available. If the) - comment(# first argument to a tag call is a symbol, it will be joined to) - comment(# the tag to produce a namespace:tag combination. It is easier to) - comment(# show this than describe it.) - comment(#) - comment(# xml.SOAP :Envelope do ... end) - comment(#) - comment(# Just put a space before the colon in a namespace to produce the) - comment(# right form for builder (e.g. "SOAP:Envelope" =>) - comment(# "xml.SOAP :Envelope"\)) - comment(#) - comment(# * XmlMarkup builds the markup in any object (called a _target_\)) - comment(# that accepts the << method. If no target is given,) - comment(# then XmlMarkup defaults to a string target.) - comment(# ) - comment(# Examples:) - comment(#) - comment(# xm = Builder::XmlMarkup.new) - comment(# result = xm.title("yada"\)) - comment(# # result is a string containing the markup.) - comment(#) - comment(# buffer = "") - comment(# xm = Builder::XmlMarkup.new(buffer\)) - comment(# # The markup is appended to buffer (using <<\)) - comment(#) - comment(# xm = Builder::XmlMarkup.new(STDOUT\)) - comment(# # The markup is written to STDOUT (using <<\)) - comment(#) - comment(# xm = Builder::XmlMarkup.new) - comment(# x2 = Builder::XmlMarkup.new(:target=>xm\)) - comment(# # Markup written to +x2+ will be send to +xm+.) - comment(# ) - comment(# * Indentation is enabled by providing the number of spaces to) - comment(# indent for each level as a second argument to XmlBuilder.new.) - comment(# Initial indentation may be specified using a third parameter.) - comment(#) - comment(# Example:) - comment(#) - comment(# xm = Builder.new(:ident=>2\)) - comment(# # xm will produce nicely formatted and indented XML.) - comment(# ) - comment(# xm = Builder.new(:indent=>2, :margin=>4\)) - comment(# # xm will produce nicely formatted and indented XML with 2) - comment(# # spaces per indent and an over all indentation level of 4.) - comment(#) - comment(# builder = Builder::XmlMarkup.new(:target=>$stdout, :indent=>2\)) - comment(# builder.name { |b| b.first("Jim"\); b.last("Weirich\) }) - comment(# # prints:) - comment(# # ) - comment(# # Jim) - comment(# # Weirich) - comment(# # ) - comment(#) - comment(# * The instance_eval implementation which forces self to refer to) - comment(# the message receiver as self is now obsolete. We now use normal) - comment(# block calls to execute the markup block. This means that all) - comment(# markup methods must now be explicitly send to the xml builder.) - comment(# For instance, instead of) - comment(#) - comment(# xml.div { strong("text"\) }) - comment(#) - comment(# you need to write:) - comment(#) - comment(# xml.div { xml.strong("text"\) }) - comment(#) - comment(# Although more verbose, the subtle change in semantics within the) - comment(# block was found to be prone to error. To make this change a) - comment(# little less cumbersome, the markup block now gets the markup) - comment(# object sent as an argument, allowing you to use a shorter alias) - comment(# within the block.) - comment(#) - comment(# For example:) - comment(#) - comment(# xml_builder = Builder::XmlMarkup.new) - comment(# xml_builder.div { |xml|) - comment(# xml.stong("text"\)) - comment(# }) - comment(#) - reserved(class) class(XmlMarkup) operator(<) constant(XmlBase) - - comment(# Create an XML markup builder. Parameters are specified by an) - comment(# option hash.) - comment(#) - comment(# :target=>target_object::) - comment(# Object receiving the markup. +out+ must respond to the) - comment(# << operator. The default is a plain string target.) - comment(# :indent=>indentation::) - comment(# Number of spaces used for indentation. The default is no) - comment(# indentation and no line breaks.) - comment(# :margin=>initial_indentation_level::) - comment(# Amount of initial indentation (specified in levels, not) - comment(# spaces\).) - comment(# ) - reserved(def) method(initialize)operator(()ident(options)operator(=)operator({)operator(})operator(\)) - ident(indent) operator(=) ident(options)operator([)symbol(:indent)operator(]) operator(||) integer(0) - ident(margin) operator(=) ident(options)operator([)symbol(:margin)operator(]) operator(||) integer(0) - reserved(super)operator(()ident(indent)operator(,) ident(margin)operator(\)) - instance_variable(@target) operator(=) ident(options)operator([)symbol(:target)operator(]) operator(||) string - reserved(end) - - comment(# Return the target of the builder.) - reserved(def) method(target!) - instance_variable(@target) - reserved(end) - - reserved(def) method(comment!)operator(()ident(comment_text)operator(\)) - ident(_ensure_no_block) ident(block_given?) - ident(_special)operator(()stringoperator(,) string)delimiter(")>operator(,) ident(comment_text)operator(,) pre_constant(nil)operator(\)) - reserved(end) - - comment(# Insert an XML declaration into the XML markup.) - comment(#) - comment(# For example:) - comment(#) - comment(# xml.declare! :ELEMENT, :blah, "yada") - comment(# # => ) - reserved(def) method(declare!)operator(()ident(inst)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(_indent) - instance_variable(@target) operator(<<) stringdelimiter(")> - ident(args)operator(.)ident(each) reserved(do) operator(|)ident(arg)operator(|) - reserved(case) ident(arg) - reserved(when) constant(String) - instance_variable(@target) operator(<<) stringcontent(")delimiter(})> - reserved(when) constant(Symbol) - instance_variable(@target) operator(<<) stringdelimiter(")> - reserved(end) - reserved(end) - reserved(if) ident(block_given?) - instance_variable(@target) operator(<<) string - ident(_newline) - ident(_nested_structures)operator(()ident(block)operator(\)) - instance_variable(@target) operator(<<) string - reserved(end) - instance_variable(@target) operator(<<) string)delimiter(")> - ident(_newline) - reserved(end) - - comment(# Insert a processing instruction into the XML markup. E.g.) - comment(#) - comment(# For example:) - comment(#) - comment(# xml.instruct!) - comment(# #=> ) - comment(# xml.instruct! :aaa, :bbb=>"ccc") - comment(# #=> ) - comment(#) - reserved(def) method(instruct!)operator(()ident(directive_tag)operator(=)symbol(:xml)operator(,) ident(attrs)operator(=)operator({)operator(})operator(\)) - ident(_ensure_no_block) ident(block_given?) - reserved(if) ident(directive_tag) operator(==) symbol(:xml) - ident(a) operator(=) operator({) symbol(:version)operator(=)operator(>)stringoperator(,) symbol(:encoding)operator(=)operator(>)string operator(}) - ident(attrs) operator(=) ident(a)operator(.)ident(merge) ident(attrs) - reserved(end) - ident(_special)operator(() - stringdelimiter(")>operator(,) - string)delimiter(")>operator(,) - pre_constant(nil)operator(,) - ident(attrs)operator(,) - operator([)symbol(:version)operator(,) symbol(:encoding)operator(,) symbol(:standalone)operator(])operator(\)) - reserved(end) - - comment(# Surrounds the given text with a CDATA tag) - comment(#) - comment(# For example:) - comment(#) - comment(# xml.cdata! "blah blah blah") - comment(# # => ) - reserved(def) method(cdata!)operator(()ident(text)operator(\)) - ident(_ensure_no_block) ident(block_given?) - ident(_special)operator(()stringoperator(,) string)delimiter(")>operator(,) ident(text)operator(,) pre_constant(nil)operator(\)) - reserved(end) - - ident(private) - - comment(# NOTE: All private methods of a builder object are prefixed when) - comment(# a "_" character to avoid possible conflict with XML tag names.) - - comment(# Insert text directly in to the builder's target.) - reserved(def) method(_text)operator(()ident(text)operator(\)) - instance_variable(@target) operator(<<) ident(text) - reserved(end) - - comment(# Insert special instruction. ) - reserved(def) method(_special)operator(()ident(open)operator(,) ident(close)operator(,) ident(data)operator(=)pre_constant(nil)operator(,) ident(attrs)operator(=)pre_constant(nil)operator(,) ident(order)operator(=)operator([)operator(])operator(\)) - ident(_indent) - instance_variable(@target) operator(<<) ident(open) - instance_variable(@target) operator(<<) ident(data) reserved(if) ident(data) - ident(_insert_attributes)operator(()ident(attrs)operator(,) ident(order)operator(\)) reserved(if) ident(attrs) - instance_variable(@target) operator(<<) ident(close) - ident(_newline) - reserved(end) - - comment(# Start an XML tag. If end_too is true, then the start) - comment(# tag is also the end tag (e.g.
    ) - reserved(def) method(_start_tag)operator(()ident(sym)operator(,) ident(attrs)operator(,) ident(end_too)operator(=)pre_constant(false)operator(\)) - instance_variable(@target) operator(<<) stringdelimiter(")> - ident(_insert_attributes)operator(()ident(attrs)operator(\)) - instance_variable(@target) operator(<<) string reserved(if) ident(end_too) - instance_variable(@target) operator(<<) string)delimiter(")> - reserved(end) - - comment(# Insert an ending tag.) - reserved(def) method(_end_tag)operator(()ident(sym)operator(\)) - instance_variable(@target) operator(<<) stringcontent(>)delimiter(")> - reserved(end) - - comment(# Insert the attributes (given in the hash\).) - reserved(def) method(_insert_attributes)operator(()ident(attrs)operator(,) ident(order)operator(=)operator([)operator(])operator(\)) - reserved(return) reserved(if) ident(attrs)operator(.)ident(nil?) - ident(order)operator(.)ident(each) reserved(do) operator(|)ident(k)operator(|) - ident(v) operator(=) ident(attrs)operator([)ident(k)operator(]) - instance_variable(@target) operator(<<) stringcontent(=")inlinecontent(")delimiter(})> reserved(if) ident(v) - reserved(end) - ident(attrs)operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,) ident(v)operator(|) - instance_variable(@target) operator(<<) stringcontent(=")inlinecontent(")delimiter(})> reserved(unless) ident(order)operator(.)ident(member?)operator(()ident(k)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(_ensure_no_block)operator(()ident(got_block)operator(\)) - reserved(if) ident(got_block) - ident(fail) constant(IllegalBlockError)operator(,) - string - reserved(end) - reserved(end) - - reserved(end) - -reserved(end) -doctype(#!/usr/bin/env ruby) - -comment(#--) -comment(# Copyright 2004 by Jim Weirich (jim@weirichhouse.org\).) -comment(# All rights reserved.) - -comment(# Permission is granted for use, copying, modification, distribution,) -comment(# and distribution of modified versions of this work as long as the) -comment(# above copyright notice is included.) -comment(#++) - -ident(require) string -ident(require) string -reserved(module) class(ActiveSupport) - reserved(module) class(VERSION) comment(#:nodoc:) - constant(MAJOR) operator(=) integer(1) - constant(MINOR) operator(=) integer(3) - constant(TINY) operator(=) integer(1) - - constant(STRING) operator(=) operator([)constant(MAJOR)operator(,) constant(MINOR)operator(,) constant(TINY)operator(])operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) -reserved(end) -comment(# Extensions to nil which allow for more helpful error messages for ) -comment(# people who are new to rails.) -comment(#) -comment(# The aim is to ensure that when users pass nil to methods where that isn't) -comment(# appropriate, instead of NoMethodError and the name of some method used) -comment(# by the framework users will see a message explaining what type of object ) -comment(# was expected.) - -reserved(class) class(NilClass) - constant(WHINERS) operator(=) operator([) operator(::)constant(ActiveRecord)operator(::)constant(Base)operator(,) operator(::)constant(Array) operator(]) - - class_variable(@@method_class_map) operator(=) constant(Hash)operator(.)ident(new) - - constant(WHINERS)operator(.)ident(each) reserved(do) operator(|)ident(klass)operator(|) - ident(methods) operator(=) ident(klass)operator(.)ident(public_instance_methods) operator(-) ident(public_instance_methods) - ident(methods)operator(.)ident(each) reserved(do) operator(|)ident(method)operator(|) - class_variable(@@method_class_map)operator([)ident(method)operator(.)ident(to_sym)operator(]) operator(=) ident(klass) - reserved(end) - reserved(end) - - reserved(def) method(id) - ident(raise) constant(RuntimeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - - ident(private) - reserved(def) method(method_missing)operator(()ident(method)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(raise_nil_warning_for) class_variable(@@method_class_map)operator([)ident(method)operator(])operator(,) ident(method)operator(,) ident(caller) - reserved(end) - - reserved(def) method(raise_nil_warning_for)operator(()ident(klass) operator(=) pre_constant(nil)operator(,) ident(selector) operator(=) pre_constant(nil)operator(,) ident(with_caller) operator(=) pre_constant(nil)operator(\)) - ident(message) operator(=) string - ident(message) operator(<<) stringcontent(.)delimiter(")> reserved(if) ident(klass) - ident(message) operator(<<) stringdelimiter(")> reserved(if) ident(selector) - - ident(raise) constant(NoMethodError)operator(,) ident(message)operator(,) ident(with_caller) operator(||) ident(caller) - reserved(end) -reserved(end) - -comment(#--) -comment(# Copyright (c\) 2005 David Heinemeier Hansson) -comment(#) -comment(# Permission is hereby granted, free of charge, to any person obtaining) -comment(# a copy of this software and associated documentation files (the) -comment(# "Software"\), to deal in the Software without restriction, including) -comment(# without limitation the rights to use, copy, modify, merge, publish,) -comment(# distribute, sublicense, and/or sell copies of the Software, and to) -comment(# permit persons to whom the Software is furnished to do so, subject to) -comment(# the following conditions:) -comment(#) -comment(# The above copyright notice and this permission notice shall be) -comment(# included in all copies or substantial portions of the Software.) -comment(#) -comment(# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,) -comment(# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF) -comment(# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND) -comment(# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE) -comment(# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION) -comment(# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION) -comment(# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.) -comment(#++) - -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\))operator(\)) -global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) stringoperator(\)) - -ident(require) string - -ident(require) string - -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -ident(require) string -ident(require) string - -ident(require) string - -ident(require) string \ No newline at end of file diff --git a/test/scanners/ruby/rails.in.rb b/test/scanners/ruby/rails.in.rb deleted file mode 100644 index 587b56d..0000000 --- a/test/scanners/ruby/rails.in.rb +++ /dev/null @@ -1,74259 +0,0 @@ -require 'rbconfig' -require 'find' -require 'ftools' - -include Config - -# this was adapted from rdoc's install.rb by way of Log4r - -$sitedir = CONFIG["sitelibdir"] -unless $sitedir - version = CONFIG["MAJOR"] + "." + CONFIG["MINOR"] - $libdir = File.join(CONFIG["libdir"], "ruby", version) - $sitedir = $:.find {|x| x =~ /site_ruby/ } - if !$sitedir - $sitedir = File.join($libdir, "site_ruby") - elsif $sitedir !~ Regexp.quote(version) - $sitedir = File.join($sitedir, version) - end -end - -# the acual gruntwork -Dir.chdir("lib") - -Find.find("action_mailer", "action_mailer.rb") { |f| - if f[-3..-1] == ".rb" - File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true) - else - File::makedirs(File.join($sitedir, *f.split(/\//))) - end -} -module ActionMailer - module AdvAttrAccessor #:nodoc: - def self.append_features(base) - super - base.extend(ClassMethods) - end - - module ClassMethods #:nodoc: - def adv_attr_accessor(*names) - names.each do |name| - ivar = "@#{name}" - - define_method("#{name}=") do |value| - instance_variable_set(ivar, value) - end - - define_method(name) do |*parameters| - raise ArgumentError, "expected 0 or 1 parameters" unless parameters.length <= 1 - if parameters.empty? - if instance_variables.include?(ivar) - instance_variable_get(ivar) - end - else - instance_variable_set(ivar, parameters.first) - end - end - end - end - end - end -end -require 'action_mailer/adv_attr_accessor' -require 'action_mailer/part' -require 'action_mailer/part_container' -require 'action_mailer/utils' -require 'tmail/net' - -module ActionMailer #:nodoc: - # ActionMailer allows you to send email from your application using a mailer model and views. - # - # = Mailer Models - # To use ActionMailer, you need to create a mailer model. - # - # $ script/generate mailer Notifier - # - # The generated model inherits from ActionMailer::Base. Emails are defined by creating methods within the model which are then - # used to set variables to be used in the mail template, to change options on the mail, or - # to add attachments. - # - # Examples: - # - # class Notifier < ActionMailer::Base - # def signup_notification(recipient) - # recipients recipient.email_address_with_name - # from "system@example.com" - # subject "New account information" - # body "account" => recipient - # end - # end - # - # Mailer methods have the following configuration methods available. - # - # * recipients - Takes one or more email addresses. These addresses are where your email will be delivered to. Sets the To: header. - # * subject - The subject of your email. Sets the Subject: header. - # * from - Who the email you are sending is from. Sets the From: header. - # * cc - Takes one or more email addresses. These addresses will receive a carbon copy of your email. Sets the Cc: header. - # * bcc - Takes one or more email address. These addresses will receive a blind carbon copy of your email. Sets the Bcc header. - # * sent_on - The date on which the message was sent. If not set, the header wil be set by the delivery agent. - # * content_type - Specify the content type of the message. Defaults to text/plain. - # * headers - Specify additional headers to be set for the message, e.g. headers 'X-Mail-Count' => 107370. - # - # The body method has special behavior. It takes a hash which generates an instance variable - # named after each key in the hash containing the value that that key points to. - # - # So, for example, body "account" => recipient would result - # in an instance variable @account with the value of recipient being accessible in the - # view. - # - # = Mailer Views - # Like ActionController, each mailer class has a corresponding view directory - # in which each method of the class looks for a template with its name. - # To define a template to be used with a mailing, create an .rhtml file with the same name as the method - # in your mailer model. For example, in the mailer defined above, the template at - # app/views/notifier/signup_notification.rhtml would be used to generate the email. - # - # Variables defined in the model are accessible as instance variables in the view. - # - # Emails by default are sent in plain text, so a sample view for our model example might look like this: - # - # Hi <%= @account.name %>, - # Thanks for joining our service! Please check back often. - # - # = Sending Mail - # Once a mailer action and template are defined, you can deliver your message or create it and save it - # for delivery later: - # - # Notifier.deliver_signup_notification(david) # sends the email - # mail = Notifier.create_signup_notification(david) # => a tmail object - # Notifier.deliver(mail) - # - # You never instantiate your mailer class. Rather, your delivery instance - # methods are automatically wrapped in class methods that start with the word - # deliver_ followed by the name of the mailer method that you would - # like to deliver. The signup_notification method defined above is - # delivered by invoking Notifier.deliver_signup_notification. - # - # = HTML Email - # To send mail as HTML, make sure your view (the .rhtml file) generates HTML and - # set the content type to html. - # - # class MyMailer < ActionMailer::Base - # def signup_notification(recipient) - # recipients recipient.email_address_with_name - # subject "New account information" - # body "account" => recipient - # from "system@example.com" - # content_type "text/html" # Here's where the magic happens - # end - # end - # - # = Multipart Email - # You can explicitly specify multipart messages: - # - # class ApplicationMailer < ActionMailer::Base - # def signup_notification(recipient) - # recipients recipient.email_address_with_name - # subject "New account information" - # from "system@example.com" - # - # part :content_type => "text/html", - # :body => render_message("signup-as-html", :account => recipient) - # - # part "text/plain" do |p| - # p.body = render_message("signup-as-plain", :account => recipient) - # p.transfer_encoding = "base64" - # end - # end - # end - # - # Multipart messages can also be used implicitly because ActionMailer will automatically - # detect and use multipart templates, where each template is named after the name of the action, followed - # by the content type. Each such detected template will be added as separate part to the message. - # - # For example, if the following templates existed: - # * signup_notification.text.plain.rhtml - # * signup_notification.text.html.rhtml - # * signup_notification.text.xml.rxml - # * signup_notification.text.x-yaml.rhtml - # - # Each would be rendered and added as a separate part to the message, - # with the corresponding content type. The same body hash is passed to - # each template. - # - # = Attachments - # Attachments can be added by using the +attachment+ method. - # - # Example: - # - # class ApplicationMailer < ActionMailer::Base - # # attachments - # def signup_notification(recipient) - # recipients recipient.email_address_with_name - # subject "New account information" - # from "system@example.com" - # - # attachment :content_type => "image/jpeg", - # :body => File.read("an-image.jpg") - # - # attachment "application/pdf" do |a| - # a.body = generate_your_pdf_here() - # end - # end - # end - # - # = Configuration options - # - # These options are specified on the class level, like ActionMailer::Base.template_root = "/my/templates" - # - # * template_root - template root determines the base from which template references will be made. - # - # * logger - the logger is used for generating information on the mailing run if available. - # Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers. - # - # * server_settings - Allows detailed configuration of the server: - # * :address Allows you to use a remote mail server. Just change it from its default "localhost" setting. - # * :port On the off chance that your mail server doesn't run on port 25, you can change it. - # * :domain If you need to specify a HELO domain, you can do it here. - # * :user_name If your mail server requires authentication, set the username in this setting. - # * :password If your mail server requires authentication, set the password in this setting. - # * :authentication If your mail server requires authentication, you need to specify the authentication type here. - # This is a symbol and one of :plain, :login, :cram_md5 - # - # * raise_delivery_errors - whether or not errors should be raised if the email fails to be delivered. - # - # * delivery_method - Defines a delivery method. Possible values are :smtp (default), :sendmail, and :test. - # Sendmail is assumed to be present at "/usr/sbin/sendmail". - # - # * perform_deliveries - Determines whether deliver_* methods are actually carried out. By default they are, - # but this can be turned off to help functional testing. - # - # * deliveries - Keeps an array of all the emails sent out through the Action Mailer with delivery_method :test. Most useful - # for unit and functional testing. - # - # * default_charset - The default charset used for the body and to encode the subject. Defaults to UTF-8. You can also - # pick a different charset from inside a method with @charset. - # * default_content_type - The default content type used for the main part of the message. Defaults to "text/plain". You - # can also pick a different content type from inside a method with @content_type. - # * default_mime_version - The default mime version used for the message. Defaults to nil. You - # can also pick a different value from inside a method with @mime_version. When multipart messages are in - # use, @mime_version will be set to "1.0" if it is not set inside a method. - # * default_implicit_parts_order - When a message is built implicitly (i.e. multiple parts are assembled from templates - # which specify the content type in their filenames) this variable controls how the parts are ordered. Defaults to - # ["text/html", "text/enriched", "text/plain"]. Items that appear first in the array have higher priority in the mail client - # and appear last in the mime encoded message. You can also pick a different order from inside a method with - # @implicit_parts_order. - class Base - include AdvAttrAccessor, PartContainer - - # Action Mailer subclasses should be reloaded by the dispatcher in Rails - # when Dependencies.mechanism = :load. - include Reloadable::Subclasses - - private_class_method :new #:nodoc: - - class_inheritable_accessor :template_root - cattr_accessor :logger - - @@server_settings = { - :address => "localhost", - :port => 25, - :domain => 'localhost.localdomain', - :user_name => nil, - :password => nil, - :authentication => nil - } - cattr_accessor :server_settings - - @@raise_delivery_errors = true - cattr_accessor :raise_delivery_errors - - @@delivery_method = :smtp - cattr_accessor :delivery_method - - @@perform_deliveries = true - cattr_accessor :perform_deliveries - - @@deliveries = [] - cattr_accessor :deliveries - - @@default_charset = "utf-8" - cattr_accessor :default_charset - - @@default_content_type = "text/plain" - cattr_accessor :default_content_type - - @@default_mime_version = nil - cattr_accessor :default_mime_version - - @@default_implicit_parts_order = [ "text/html", "text/enriched", "text/plain" ] - cattr_accessor :default_implicit_parts_order - - # Specify the BCC addresses for the message - adv_attr_accessor :bcc - - # Define the body of the message. This is either a Hash (in which case it - # specifies the variables to pass to the template when it is rendered), - # or a string, in which case it specifies the actual text of the message. - adv_attr_accessor :body - - # Specify the CC addresses for the message. - adv_attr_accessor :cc - - # Specify the charset to use for the message. This defaults to the - # +default_charset+ specified for ActionMailer::Base. - adv_attr_accessor :charset - - # Specify the content type for the message. This defaults to text/plain - # in most cases, but can be automatically set in some situations. - adv_attr_accessor :content_type - - # Specify the from address for the message. - adv_attr_accessor :from - - # Specify additional headers to be added to the message. - adv_attr_accessor :headers - - # Specify the order in which parts should be sorted, based on content-type. - # This defaults to the value for the +default_implicit_parts_order+. - adv_attr_accessor :implicit_parts_order - - # Override the mailer name, which defaults to an inflected version of the - # mailer's class name. If you want to use a template in a non-standard - # location, you can use this to specify that location. - adv_attr_accessor :mailer_name - - # Defaults to "1.0", but may be explicitly given if needed. - adv_attr_accessor :mime_version - - # The recipient addresses for the message, either as a string (for a single - # address) or an array (for multiple addresses). - adv_attr_accessor :recipients - - # The date on which the message was sent. If not set (the default), the - # header will be set by the delivery agent. - adv_attr_accessor :sent_on - - # Specify the subject of the message. - adv_attr_accessor :subject - - # Specify the template name to use for current message. This is the "base" - # template name, without the extension or directory, and may be used to - # have multiple mailer methods share the same template. - adv_attr_accessor :template - - # The mail object instance referenced by this mailer. - attr_reader :mail - - class << self - def method_missing(method_symbol, *parameters)#:nodoc: - case method_symbol.id2name - when /^create_([_a-z]\w*)/ then new($1, *parameters).mail - when /^deliver_([_a-z]\w*)/ then new($1, *parameters).deliver! - when "new" then nil - else super - end - end - - # Receives a raw email, parses it into an email object, decodes it, - # instantiates a new mailer, and passes the email object to the mailer - # object's #receive method. If you want your mailer to be able to - # process incoming messages, you'll need to implement a #receive - # method that accepts the email object as a parameter: - # - # class MyMailer < ActionMailer::Base - # def receive(mail) - # ... - # end - # end - def receive(raw_email) - logger.info "Received mail:\n #{raw_email}" unless logger.nil? - mail = TMail::Mail.parse(raw_email) - mail.base64_decode - new.receive(mail) - end - - # Deliver the given mail object directly. This can be used to deliver - # a preconstructed mail object, like: - # - # email = MyMailer.create_some_mail(parameters) - # email.set_some_obscure_header "frobnicate" - # MyMailer.deliver(email) - def deliver(mail) - new.deliver!(mail) - end - end - - # Instantiate a new mailer object. If +method_name+ is not +nil+, the mailer - # will be initialized according to the named method. If not, the mailer will - # remain uninitialized (useful when you only need to invoke the "receive" - # method, for instance). - def initialize(method_name=nil, *parameters) #:nodoc: - create!(method_name, *parameters) if method_name - end - - # Initialize the mailer via the given +method_name+. The body will be - # rendered and a new TMail::Mail object created. - def create!(method_name, *parameters) #:nodoc: - initialize_defaults(method_name) - send(method_name, *parameters) - - # If an explicit, textual body has not been set, we check assumptions. - unless String === @body - # First, we look to see if there are any likely templates that match, - # which include the content-type in their file name (i.e., - # "the_template_file.text.html.rhtml", etc.). Only do this if parts - # have not already been specified manually. - if @parts.empty? - templates = Dir.glob("#{template_path}/#{@template}.*") - templates.each do |path| - # TODO: don't hardcode rhtml|rxml - basename = File.basename(path) - next unless md = /^([^\.]+)\.([^\.]+\.[^\+]+)\.(rhtml|rxml)$/.match(basename) - template_name = basename - content_type = md.captures[1].gsub('.', '/') - @parts << Part.new(:content_type => content_type, - :disposition => "inline", :charset => charset, - :body => render_message(template_name, @body)) - end - unless @parts.empty? - @content_type = "multipart/alternative" - @parts = sort_parts(@parts, @implicit_parts_order) - end - end - - # Then, if there were such templates, we check to see if we ought to - # also render a "normal" template (without the content type). If a - # normal template exists (or if there were no implicit parts) we render - # it. - template_exists = @parts.empty? - template_exists ||= Dir.glob("#{template_path}/#{@template}.*").any? { |i| File.basename(i).split(".").length == 2 } - @body = render_message(@template, @body) if template_exists - - # Finally, if there are other message parts and a textual body exists, - # we shift it onto the front of the parts and set the body to nil (so - # that create_mail doesn't try to render it in addition to the parts). - if !@parts.empty? && String === @body - @parts.unshift Part.new(:charset => charset, :body => @body) - @body = nil - end - end - - # If this is a multipart e-mail add the mime_version if it is not - # already set. - @mime_version ||= "1.0" if !@parts.empty? - - # build the mail object itself - @mail = create_mail - end - - # Delivers a TMail::Mail object. By default, it delivers the cached mail - # object (from the #create! method). If no cached mail object exists, and - # no alternate has been given as the parameter, this will fail. - def deliver!(mail = @mail) - raise "no mail object available for delivery!" unless mail - logger.info "Sent mail:\n #{mail.encoded}" unless logger.nil? - - begin - send("perform_delivery_#{delivery_method}", mail) if perform_deliveries - rescue Object => e - raise e if raise_delivery_errors - end - - return mail - end - - private - # Set up the default values for the various instance variables of this - # mailer. Subclasses may override this method to provide different - # defaults. - def initialize_defaults(method_name) - @charset ||= @@default_charset.dup - @content_type ||= @@default_content_type.dup - @implicit_parts_order ||= @@default_implicit_parts_order.dup - @template ||= method_name - @mailer_name ||= Inflector.underscore(self.class.name) - @parts ||= [] - @headers ||= {} - @body ||= {} - @mime_version = @@default_mime_version.dup if @@default_mime_version - end - - def render_message(method_name, body) - render :file => method_name, :body => body - end - - def render(opts) - body = opts.delete(:body) - initialize_template_class(body).render(opts) - end - - def template_path - "#{template_root}/#{mailer_name}" - end - - def initialize_template_class(assigns) - ActionView::Base.new(template_path, assigns, self) - end - - def sort_parts(parts, order = []) - order = order.collect { |s| s.downcase } - - parts = parts.sort do |a, b| - a_ct = a.content_type.downcase - b_ct = b.content_type.downcase - - a_in = order.include? a_ct - b_in = order.include? b_ct - - s = case - when a_in && b_in - order.index(a_ct) <=> order.index(b_ct) - when a_in - -1 - when b_in - 1 - else - a_ct <=> b_ct - end - - # reverse the ordering because parts that come last are displayed - # first in mail clients - (s * -1) - end - - parts - end - - def create_mail - m = TMail::Mail.new - - m.subject, = quote_any_if_necessary(charset, subject) - m.to, m.from = quote_any_address_if_necessary(charset, recipients, from) - m.bcc = quote_address_if_necessary(bcc, charset) unless bcc.nil? - m.cc = quote_address_if_necessary(cc, charset) unless cc.nil? - - m.mime_version = mime_version unless mime_version.nil? - m.date = sent_on.to_time rescue sent_on if sent_on - headers.each { |k, v| m[k] = v } - - real_content_type, ctype_attrs = parse_content_type - - if @parts.empty? - m.set_content_type(real_content_type, nil, ctype_attrs) - m.body = Utils.normalize_new_lines(body) - else - if String === body - part = TMail::Mail.new - part.body = Utils.normalize_new_lines(body) - part.set_content_type(real_content_type, nil, ctype_attrs) - part.set_content_disposition "inline" - m.parts << part - end - - @parts.each do |p| - part = (TMail::Mail === p ? p : p.to_mail(self)) - m.parts << part - end - - if real_content_type =~ /multipart/ - ctype_attrs.delete "charset" - m.set_content_type(real_content_type, nil, ctype_attrs) - end - end - - @mail = m - end - - def perform_delivery_smtp(mail) - destinations = mail.destinations - mail.ready_to_send - - Net::SMTP.start(server_settings[:address], server_settings[:port], server_settings[:domain], - server_settings[:user_name], server_settings[:password], server_settings[:authentication]) do |smtp| - smtp.sendmail(mail.encoded, mail.from, destinations) - end - end - - def perform_delivery_sendmail(mail) - IO.popen("/usr/sbin/sendmail -i -t","w+") do |sm| - sm.print(mail.encoded.gsub(/\r/, '')) - sm.flush - end - end - - def perform_delivery_test(mail) - deliveries << mail - end - end -end -module ActionMailer - module Helpers #:nodoc: - def self.append_features(base) #:nodoc: - super - - # Initialize the base module to aggregate its helpers. - base.class_inheritable_accessor :master_helper_module - base.master_helper_module = Module.new - - # Extend base with class methods to declare helpers. - base.extend(ClassMethods) - - base.class_eval do - # Wrap inherited to create a new master helper module for subclasses. - class << self - alias_method :inherited_without_helper, :inherited - alias_method :inherited, :inherited_with_helper - end - - # Wrap initialize_template_class to extend new template class - # instances with the master helper module. - alias_method :initialize_template_class_without_helper, :initialize_template_class - alias_method :initialize_template_class, :initialize_template_class_with_helper - end - end - - module ClassMethods - # Makes all the (instance) methods in the helper module available to templates rendered through this controller. - # See ActionView::Helpers (link:classes/ActionView/Helpers.html) for more about making your own helper modules - # available to the templates. - def add_template_helper(helper_module) #:nodoc: - master_helper_module.module_eval "include #{helper_module}" - end - - # Declare a helper: - # helper :foo - # requires 'foo_helper' and includes FooHelper in the template class. - # helper FooHelper - # includes FooHelper in the template class. - # helper { def foo() "#{bar} is the very best" end } - # evaluates the block in the template class, adding method #foo. - # helper(:three, BlindHelper) { def mice() 'mice' end } - # does all three. - def helper(*args, &block) - args.flatten.each do |arg| - case arg - when Module - add_template_helper(arg) - when String, Symbol - file_name = arg.to_s.underscore + '_helper' - class_name = file_name.camelize - - begin - require_dependency(file_name) - rescue LoadError => load_error - requiree = / -- (.*?)(\.rb)?$/.match(load_error).to_a[1] - msg = (requiree == file_name) ? "Missing helper file helpers/#{file_name}.rb" : "Can't load file: #{requiree}" - raise LoadError.new(msg).copy_blame!(load_error) - end - - add_template_helper(class_name.constantize) - else - raise ArgumentError, 'helper expects String, Symbol, or Module argument' - end - end - - # Evaluate block in template class if given. - master_helper_module.module_eval(&block) if block_given? - end - - # Declare a controller method as a helper. For example, - # helper_method :link_to - # def link_to(name, options) ... end - # makes the link_to controller method available in the view. - def helper_method(*methods) - methods.flatten.each do |method| - master_helper_module.module_eval <<-end_eval - def #{method}(*args, &block) - controller.send(%(#{method}), *args, &block) - end - end_eval - end - end - - # Declare a controller attribute as a helper. For example, - # helper_attr :name - # attr_accessor :name - # makes the name and name= controller methods available in the view. - # The is a convenience wrapper for helper_method. - def helper_attr(*attrs) - attrs.flatten.each { |attr| helper_method(attr, "#{attr}=") } - end - - private - def inherited_with_helper(child) - inherited_without_helper(child) - begin - child.master_helper_module = Module.new - child.master_helper_module.send :include, master_helper_module - child.helper child.name.underscore - rescue MissingSourceFile => e - raise unless e.is_missing?("helpers/#{child.name.underscore}_helper") - end - end - end - - private - # Extend the template class instance with our controller's helper module. - def initialize_template_class_with_helper(assigns) - returning(template = initialize_template_class_without_helper(assigns)) do - template.extend self.class.master_helper_module - end - end - end -endrequire 'text/format' - -module MailHelper - # Uses Text::Format to take the text and format it, indented two spaces for - # each line, and wrapped at 72 columns. - def block_format(text) - formatted = text.split(/\n\r\n/).collect { |paragraph| - Text::Format.new( - :columns => 72, :first_indent => 2, :body_indent => 2, :text => paragraph - ).format - }.join("\n") - - # Make list points stand on their own line - formatted.gsub!(/[ ]*([*]+) ([^*]*)/) { |s| " #{$1} #{$2.strip}\n" } - formatted.gsub!(/[ ]*([#]+) ([^#]*)/) { |s| " #{$1} #{$2.strip}\n" } - - formatted - end -end -require 'action_mailer/adv_attr_accessor' -require 'action_mailer/part_container' -require 'action_mailer/utils' - -module ActionMailer - # Represents a subpart of an email message. It shares many similar - # attributes of ActionMailer::Base. Although you can create parts manually - # and add them to the #parts list of the mailer, it is easier - # to use the helper methods in ActionMailer::PartContainer. - class Part - include ActionMailer::AdvAttrAccessor - include ActionMailer::PartContainer - - # Represents the body of the part, as a string. This should not be a - # Hash (like ActionMailer::Base), but if you want a template to be rendered - # into the body of a subpart you can do it with the mailer's #render method - # and assign the result here. - adv_attr_accessor :body - - # Specify the charset for this subpart. By default, it will be the charset - # of the containing part or mailer. - adv_attr_accessor :charset - - # The content disposition of this part, typically either "inline" or - # "attachment". - adv_attr_accessor :content_disposition - - # The content type of the part. - adv_attr_accessor :content_type - - # The filename to use for this subpart (usually for attachments). - adv_attr_accessor :filename - - # Accessor for specifying additional headers to include with this part. - adv_attr_accessor :headers - - # The transfer encoding to use for this subpart, like "base64" or - # "quoted-printable". - adv_attr_accessor :transfer_encoding - - # Create a new part from the given +params+ hash. The valid params keys - # correspond to the accessors. - def initialize(params) - @content_type = params[:content_type] - @content_disposition = params[:disposition] || "inline" - @charset = params[:charset] - @body = params[:body] - @filename = params[:filename] - @transfer_encoding = params[:transfer_encoding] || "quoted-printable" - @headers = params[:headers] || {} - @parts = [] - end - - # Convert the part to a mail object which can be included in the parts - # list of another mail object. - def to_mail(defaults) - part = TMail::Mail.new - - real_content_type, ctype_attrs = parse_content_type(defaults) - - if @parts.empty? - part.content_transfer_encoding = transfer_encoding || "quoted-printable" - case (transfer_encoding || "").downcase - when "base64" then - part.body = TMail::Base64.folding_encode(body) - when "quoted-printable" - part.body = [Utils.normalize_new_lines(body)].pack("M*") - else - part.body = body - end - - # Always set the content_type after setting the body and or parts! - # Also don't set filename and name when there is none (like in - # non-attachment parts) - if content_disposition == "attachment" - ctype_attrs.delete "charset" - part.set_content_type(real_content_type, nil, - squish("name" => filename).merge(ctype_attrs)) - part.set_content_disposition(content_disposition, - squish("filename" => filename).merge(ctype_attrs)) - else - part.set_content_type(real_content_type, nil, ctype_attrs) - part.set_content_disposition(content_disposition) - end - else - if String === body - part = TMail::Mail.new - part.body = body - part.set_content_type(real_content_type, nil, ctype_attrs) - part.set_content_disposition "inline" - m.parts << part - end - - @parts.each do |p| - prt = (TMail::Mail === p ? p : p.to_mail(defaults)) - part.parts << prt - end - - part.set_content_type(real_content_type, nil, ctype_attrs) if real_content_type =~ /multipart/ - end - - headers.each { |k,v| part[k] = v } - - part - end - - private - - def squish(values={}) - values.delete_if { |k,v| v.nil? } - end - end -end -module ActionMailer - # Accessors and helpers that ActionMailer::Base and ActionMailer::Part have - # in common. Using these helpers you can easily add subparts or attachments - # to your message: - # - # def my_mail_message(...) - # ... - # part "text/plain" do |p| - # p.body "hello, world" - # p.transfer_encoding "base64" - # end - # - # attachment "image/jpg" do |a| - # a.body = File.read("hello.jpg") - # a.filename = "hello.jpg" - # end - # end - module PartContainer - # The list of subparts of this container - attr_reader :parts - - # Add a part to a multipart message, with the given content-type. The - # part itself is yielded to the block so that other properties (charset, - # body, headers, etc.) can be set on it. - def part(params) - params = {:content_type => params} if String === params - part = Part.new(params) - yield part if block_given? - @parts << part - end - - # Add an attachment to a multipart message. This is simply a part with the - # content-disposition set to "attachment". - def attachment(params, &block) - params = { :content_type => params } if String === params - params = { :disposition => "attachment", - :transfer_encoding => "base64" }.merge(params) - part(params, &block) - end - - private - - def parse_content_type(defaults=nil) - return [defaults && defaults.content_type, {}] if content_type.blank? - ctype, *attrs = content_type.split(/;\s*/) - attrs = attrs.inject({}) { |h,s| k,v = s.split(/=/, 2); h[k] = v; h } - [ctype, {"charset" => charset || defaults && defaults.charset}.merge(attrs)] - end - - end -end -module ActionMailer - module Quoting #:nodoc: - # Convert the given text into quoted printable format, with an instruction - # that the text be eventually interpreted in the given charset. - def quoted_printable(text, charset) - text = text.gsub( /[^a-z ]/i ) { quoted_printable_encode($&) }. - gsub( / /, "_" ) - "=?#{charset}?Q?#{text}?=" - end - - # Convert the given character to quoted printable format, taking into - # account multi-byte characters (if executing with $KCODE="u", for instance) - def quoted_printable_encode(character) - result = "" - character.each_byte { |b| result << "=%02x" % b } - result - end - - # A quick-and-dirty regexp for determining whether a string contains any - # characters that need escaping. - if !defined?(CHARS_NEEDING_QUOTING) - CHARS_NEEDING_QUOTING = /[\000-\011\013\014\016-\037\177-\377]/ - end - - # Quote the given text if it contains any "illegal" characters - def quote_if_necessary(text, charset) - (text =~ CHARS_NEEDING_QUOTING) ? - quoted_printable(text, charset) : - text - end - - # Quote any of the given strings if they contain any "illegal" characters - def quote_any_if_necessary(charset, *args) - args.map { |v| quote_if_necessary(v, charset) } - end - - # Quote the given address if it needs to be. The address may be a - # regular email address, or it can be a phrase followed by an address in - # brackets. The phrase is the only part that will be quoted, and only if - # it needs to be. This allows extended characters to be used in the - # "to", "from", "cc", and "bcc" headers. - def quote_address_if_necessary(address, charset) - if Array === address - address.map { |a| quote_address_if_necessary(a, charset) } - elsif address =~ /^(\S.*)\s+(<.*>)$/ - address = $2 - phrase = quote_if_necessary($1.gsub(/^['"](.*)['"]$/, '\1'), charset) - "\"#{phrase}\" #{address}" - else - address - end - end - - # Quote any of the given addresses, if they need to be. - def quote_any_address_if_necessary(charset, *args) - args.map { |v| quote_address_if_necessary(v, charset) } - end - end -end -module ActionMailer - module Utils #:nodoc: - def normalize_new_lines(text) - text.to_s.gsub(/\r\n?/, "\n") - end - module_function :normalize_new_lines - end -end -#-- -# Text::Format for Ruby -# Version 0.63 -# -# Copyright (c) 2002 - 2003 Austin Ziegler -# -# $Id: format.rb,v 1.1.1.1 2004/10/14 11:59:57 webster132 Exp $ -# -# ========================================================================== -# Revision History :: -# YYYY.MM.DD Change ID Developer -# Description -# -------------------------------------------------------------------------- -# 2002.10.18 Austin Ziegler -# Fixed a minor problem with tabs not being counted. Changed -# abbreviations from Hash to Array to better suit Ruby's -# capabilities. Fixed problems with the way that Array arguments -# are handled in calls to the major object types, excepting in -# Text::Format#expand and Text::Format#unexpand (these will -# probably need to be fixed). -# 2002.10.30 Austin Ziegler -# Fixed the ordering of the <=> for binary tests. Fixed -# Text::Format#expand and Text::Format#unexpand to handle array -# arguments better. -# 2003.01.24 Austin Ziegler -# Fixed a problem with Text::Format::RIGHT_FILL handling where a -# single word is larger than #columns. Removed Comparable -# capabilities (<=> doesn't make sense; == does). Added Symbol -# equivalents for the Hash initialization. Hash initialization has -# been modified so that values are set as follows (Symbols are -# highest priority; strings are middle; defaults are lowest): -# @columns = arg[:columns] || arg['columns'] || @columns -# Added #hard_margins, #split_rules, #hyphenator, and #split_words. -# 2003.02.07 Austin Ziegler -# Fixed the installer for proper case-sensitive handling. -# 2003.03.28 Austin Ziegler -# Added the ability for a hyphenator to receive the formatter -# object. Fixed a bug for strings matching /\A\s*\Z/ failing -# entirely. Fixed a test case failing under 1.6.8. -# 2003.04.04 Austin Ziegler -# Handle the case of hyphenators returning nil for first/rest. -# 2003.09.17 Austin Ziegler -# Fixed a problem where #paragraphs(" ") was raising -# NoMethodError. -# -# ========================================================================== -#++ - -module Text #:nodoc: - # Text::Format for Ruby is copyright 2002 - 2005 by Austin Ziegler. It - # is available under Ruby's licence, the Perl Artistic licence, or the - # GNU GPL version 2 (or at your option, any later version). As a - # special exception, for use with official Rails (provided by the - # rubyonrails.org development team) and any project created with - # official Rails, the following alternative MIT-style licence may be - # used: - # - # == Text::Format Licence for Rails and Rails Applications - # Permission is hereby granted, free of charge, to any person - # obtaining a copy of this software and associated documentation files - # (the "Software"), to deal in the Software without restriction, - # including without limitation the rights to use, copy, modify, merge, - # publish, distribute, sublicense, and/or sell copies of the Software, - # and to permit persons to whom the Software is furnished to do so, - # subject to the following conditions: - # - # * The names of its contributors may not be used to endorse or - # promote products derived from this software without specific prior - # written permission. - # - # The above copyright notice and this permission notice shall be - # included in all copies or substantial portions of the Software. - # - # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - # SOFTWARE. - class Format - VERSION = '0.63' - - # Local abbreviations. More can be added with Text::Format.abbreviations - ABBREV = [ 'Mr', 'Mrs', 'Ms', 'Jr', 'Sr' ] - - # Formatting values - LEFT_ALIGN = 0 - RIGHT_ALIGN = 1 - RIGHT_FILL = 2 - JUSTIFY = 3 - - # Word split modes (only applies when #hard_margins is true). - SPLIT_FIXED = 1 - SPLIT_CONTINUATION = 2 - SPLIT_HYPHENATION = 4 - SPLIT_CONTINUATION_FIXED = SPLIT_CONTINUATION | SPLIT_FIXED - SPLIT_HYPHENATION_FIXED = SPLIT_HYPHENATION | SPLIT_FIXED - SPLIT_HYPHENATION_CONTINUATION = SPLIT_HYPHENATION | SPLIT_CONTINUATION - SPLIT_ALL = SPLIT_HYPHENATION | SPLIT_CONTINUATION | SPLIT_FIXED - - # Words forcibly split by Text::Format will be stored as split words. - # This class represents a word forcibly split. - class SplitWord - # The word that was split. - attr_reader :word - # The first part of the word that was split. - attr_reader :first - # The remainder of the word that was split. - attr_reader :rest - - def initialize(word, first, rest) #:nodoc: - @word = word - @first = first - @rest = rest - end - end - - private - LEQ_RE = /[.?!]['"]?$/ - - def brk_re(i) #:nodoc: - %r/((?:\S+\s+){#{i}})(.+)/ - end - - def posint(p) #:nodoc: - p.to_i.abs - end - - public - # Compares two Text::Format objects. All settings of the objects are - # compared *except* #hyphenator. Generated results (e.g., #split_words) - # are not compared, either. - def ==(o) - (@text == o.text) && - (@columns == o.columns) && - (@left_margin == o.left_margin) && - (@right_margin == o.right_margin) && - (@hard_margins == o.hard_margins) && - (@split_rules == o.split_rules) && - (@first_indent == o.first_indent) && - (@body_indent == o.body_indent) && - (@tag_text == o.tag_text) && - (@tabstop == o.tabstop) && - (@format_style == o.format_style) && - (@extra_space == o.extra_space) && - (@tag_paragraph == o.tag_paragraph) && - (@nobreak == o.nobreak) && - (@abbreviations == o.abbreviations) && - (@nobreak_regex == o.nobreak_regex) - end - - # The text to be manipulated. Note that value is optional, but if the - # formatting functions are called without values, this text is what will - # be formatted. - # - # *Default*:: [] - # Used in:: All methods - attr_accessor :text - - # The total width of the format area. The margins, indentation, and text - # are formatted into this space. - # - # COLUMNS - # <--------------------------------------------------------------> - # <-----------><------><---------------------------><------------> - # left margin indent text is formatted into here right margin - # - # *Default*:: 72 - # Used in:: #format, #paragraphs, - # #center - attr_reader :columns - - # The total width of the format area. The margins, indentation, and text - # are formatted into this space. The value provided is silently - # converted to a positive integer. - # - # COLUMNS - # <--------------------------------------------------------------> - # <-----------><------><---------------------------><------------> - # left margin indent text is formatted into here right margin - # - # *Default*:: 72 - # Used in:: #format, #paragraphs, - # #center - def columns=(c) - @columns = posint(c) - end - - # The number of spaces used for the left margin. - # - # columns - # <--------------------------------------------------------------> - # <-----------><------><---------------------------><------------> - # LEFT MARGIN indent text is formatted into here right margin - # - # *Default*:: 0 - # Used in:: #format, #paragraphs, - # #center - attr_reader :left_margin - - # The number of spaces used for the left margin. The value provided is - # silently converted to a positive integer value. - # - # columns - # <--------------------------------------------------------------> - # <-----------><------><---------------------------><------------> - # LEFT MARGIN indent text is formatted into here right margin - # - # *Default*:: 0 - # Used in:: #format, #paragraphs, - # #center - def left_margin=(left) - @left_margin = posint(left) - end - - # The number of spaces used for the right margin. - # - # columns - # <--------------------------------------------------------------> - # <-----------><------><---------------------------><------------> - # left margin indent text is formatted into here RIGHT MARGIN - # - # *Default*:: 0 - # Used in:: #format, #paragraphs, - # #center - attr_reader :right_margin - - # The number of spaces used for the right margin. The value provided is - # silently converted to a positive integer value. - # - # columns - # <--------------------------------------------------------------> - # <-----------><------><---------------------------><------------> - # left margin indent text is formatted into here RIGHT MARGIN - # - # *Default*:: 0 - # Used in:: #format, #paragraphs, - # #center - def right_margin=(r) - @right_margin = posint(r) - end - - # The number of spaces to indent the first line of a paragraph. - # - # columns - # <--------------------------------------------------------------> - # <-----------><------><---------------------------><------------> - # left margin INDENT text is formatted into here right margin - # - # *Default*:: 4 - # Used in:: #format, #paragraphs - attr_reader :first_indent - - # The number of spaces to indent the first line of a paragraph. The - # value provided is silently converted to a positive integer value. - # - # columns - # <--------------------------------------------------------------> - # <-----------><------><---------------------------><------------> - # left margin INDENT text is formatted into here right margin - # - # *Default*:: 4 - # Used in:: #format, #paragraphs - def first_indent=(f) - @first_indent = posint(f) - end - - # The number of spaces to indent all lines after the first line of a - # paragraph. - # - # columns - # <--------------------------------------------------------------> - # <-----------><------><---------------------------><------------> - # left margin INDENT text is formatted into here right margin - # - # *Default*:: 0 - # Used in:: #format, #paragraphs - attr_reader :body_indent - - # The number of spaces to indent all lines after the first line of - # a paragraph. The value provided is silently converted to a - # positive integer value. - # - # columns - # <--------------------------------------------------------------> - # <-----------><------><---------------------------><------------> - # left margin INDENT text is formatted into here right margin - # - # *Default*:: 0 - # Used in:: #format, #paragraphs - def body_indent=(b) - @body_indent = posint(b) - end - - # Normally, words larger than the format area will be placed on a line - # by themselves. Setting this to +true+ will force words larger than the - # format area to be split into one or more "words" each at most the size - # of the format area. The first line and the original word will be - # placed into #split_words. Note that this will cause the - # output to look *similar* to a #format_style of JUSTIFY. (Lines will be - # filled as much as possible.) - # - # *Default*:: +false+ - # Used in:: #format, #paragraphs - attr_accessor :hard_margins - - # An array of words split during formatting if #hard_margins is set to - # +true+. - # #split_words << Text::Format::SplitWord.new(word, first, rest) - attr_reader :split_words - - # The object responsible for hyphenating. It must respond to - # #hyphenate_to(word, size) or #hyphenate_to(word, size, formatter) and - # return an array of the word split into two parts; if there is a - # hyphenation mark to be applied, responsibility belongs to the - # hyphenator object. The size is the MAXIMUM size permitted, including - # any hyphenation marks. If the #hyphenate_to method has an arity of 3, - # the formatter will be provided to the method. This allows the - # hyphenator to make decisions about the hyphenation based on the - # formatting rules. - # - # *Default*:: +nil+ - # Used in:: #format, #paragraphs - attr_reader :hyphenator - - # The object responsible for hyphenating. It must respond to - # #hyphenate_to(word, size) and return an array of the word hyphenated - # into two parts. The size is the MAXIMUM size permitted, including any - # hyphenation marks. - # - # *Default*:: +nil+ - # Used in:: #format, #paragraphs - def hyphenator=(h) - raise ArgumentError, "#{h.inspect} is not a valid hyphenator." unless h.respond_to?(:hyphenate_to) - arity = h.method(:hyphenate_to).arity - raise ArgumentError, "#{h.inspect} must have exactly two or three arguments." unless [2, 3].include?(arity) - @hyphenator = h - @hyphenator_arity = arity - end - - # Specifies the split mode; used only when #hard_margins is set to - # +true+. Allowable values are: - # [+SPLIT_FIXED+] The word will be split at the number of - # characters needed, with no marking at all. - # repre - # senta - # ion - # [+SPLIT_CONTINUATION+] The word will be split at the number of - # characters needed, with a C-style continuation - # character. If a word is the only item on a - # line and it cannot be split into an - # appropriate size, SPLIT_FIXED will be used. - # repr\ - # esen\ - # tati\ - # on - # [+SPLIT_HYPHENATION+] The word will be split according to the - # hyphenator specified in #hyphenator. If there - # is no #hyphenator specified, works like - # SPLIT_CONTINUATION. The example is using - # TeX::Hyphen. If a word is the only item on a - # line and it cannot be split into an - # appropriate size, SPLIT_CONTINUATION mode will - # be used. - # rep- - # re- - # sen- - # ta- - # tion - # - # *Default*:: Text::Format::SPLIT_FIXED - # Used in:: #format, #paragraphs - attr_reader :split_rules - - # Specifies the split mode; used only when #hard_margins is set to - # +true+. Allowable values are: - # [+SPLIT_FIXED+] The word will be split at the number of - # characters needed, with no marking at all. - # repre - # senta - # ion - # [+SPLIT_CONTINUATION+] The word will be split at the number of - # characters needed, with a C-style continuation - # character. - # repr\ - # esen\ - # tati\ - # on - # [+SPLIT_HYPHENATION+] The word will be split according to the - # hyphenator specified in #hyphenator. If there - # is no #hyphenator specified, works like - # SPLIT_CONTINUATION. The example is using - # TeX::Hyphen as the #hyphenator. - # rep- - # re- - # sen- - # ta- - # tion - # - # These values can be bitwise ORed together (e.g., SPLIT_FIXED | - # SPLIT_CONTINUATION) to provide fallback split methods. In the - # example given, an attempt will be made to split the word using the - # rules of SPLIT_CONTINUATION; if there is not enough room, the word - # will be split with the rules of SPLIT_FIXED. These combinations are - # also available as the following values: - # * +SPLIT_CONTINUATION_FIXED+ - # * +SPLIT_HYPHENATION_FIXED+ - # * +SPLIT_HYPHENATION_CONTINUATION+ - # * +SPLIT_ALL+ - # - # *Default*:: Text::Format::SPLIT_FIXED - # Used in:: #format, #paragraphs - def split_rules=(s) - raise ArgumentError, "Invalid value provided for split_rules." if ((s < SPLIT_FIXED) || (s > SPLIT_ALL)) - @split_rules = s - end - - # Indicates whether sentence terminators should be followed by a single - # space (+false+), or two spaces (+true+). - # - # *Default*:: +false+ - # Used in:: #format, #paragraphs - attr_accessor :extra_space - - # Defines the current abbreviations as an array. This is only used if - # extra_space is turned on. - # - # If one is abbreviating "President" as "Pres." (abbreviations = - # ["Pres"]), then the results of formatting will be as illustrated in - # the table below: - # - # extra_space | include? | !include? - # true | Pres. Lincoln | Pres. Lincoln - # false | Pres. Lincoln | Pres. Lincoln - # - # *Default*:: {} - # Used in:: #format, #paragraphs - attr_accessor :abbreviations - - # Indicates whether the formatting of paragraphs should be done with - # tagged paragraphs. Useful only with #tag_text. - # - # *Default*:: +false+ - # Used in:: #format, #paragraphs - attr_accessor :tag_paragraph - - # The array of text to be placed before each paragraph when - # #tag_paragraph is +true+. When #format() is called, - # only the first element of the array is used. When #paragraphs - # is called, then each entry in the array will be used once, with - # corresponding paragraphs. If the tag elements are exhausted before the - # text is exhausted, then the remaining paragraphs will not be tagged. - # Regardless of indentation settings, a blank line will be inserted - # between all paragraphs when #tag_paragraph is +true+. - # - # *Default*:: [] - # Used in:: #format, #paragraphs - attr_accessor :tag_text - - # Indicates whether or not the non-breaking space feature should be - # used. - # - # *Default*:: +false+ - # Used in:: #format, #paragraphs - attr_accessor :nobreak - - # A hash which holds the regular expressions on which spaces should not - # be broken. The hash is set up such that the key is the first word and - # the value is the second word. - # - # For example, if +nobreak_regex+ contains the following hash: - # - # { '^Mrs?\.$' => '\S+$', '^\S+$' => '^(?:S|J)r\.$'} - # - # Then "Mr. Jones", "Mrs. Jones", and "Jones Jr." would not be broken. - # If this simple matching algorithm indicates that there should not be a - # break at the current end of line, then a backtrack is done until there - # are two words on which line breaking is permitted. If two such words - # are not found, then the end of the line will be broken *regardless*. - # If there is a single word on the current line, then no backtrack is - # done and the word is stuck on the end. - # - # *Default*:: {} - # Used in:: #format, #paragraphs - attr_accessor :nobreak_regex - - # Indicates the number of spaces that a single tab represents. - # - # *Default*:: 8 - # Used in:: #expand, #unexpand, - # #paragraphs - attr_reader :tabstop - - # Indicates the number of spaces that a single tab represents. - # - # *Default*:: 8 - # Used in:: #expand, #unexpand, - # #paragraphs - def tabstop=(t) - @tabstop = posint(t) - end - - # Specifies the format style. Allowable values are: - # [+LEFT_ALIGN+] Left justified, ragged right. - # |A paragraph that is| - # |left aligned.| - # [+RIGHT_ALIGN+] Right justified, ragged left. - # |A paragraph that is| - # | right aligned.| - # [+RIGHT_FILL+] Left justified, right ragged, filled to width by - # spaces. (Essentially the same as +LEFT_ALIGN+ except - # that lines are padded on the right.) - # |A paragraph that is| - # |left aligned. | - # [+JUSTIFY+] Fully justified, words filled to width by spaces, - # except the last line. - # |A paragraph that| - # |is justified.| - # - # *Default*:: Text::Format::LEFT_ALIGN - # Used in:: #format, #paragraphs - attr_reader :format_style - - # Specifies the format style. Allowable values are: - # [+LEFT_ALIGN+] Left justified, ragged right. - # |A paragraph that is| - # |left aligned.| - # [+RIGHT_ALIGN+] Right justified, ragged left. - # |A paragraph that is| - # | right aligned.| - # [+RIGHT_FILL+] Left justified, right ragged, filled to width by - # spaces. (Essentially the same as +LEFT_ALIGN+ except - # that lines are padded on the right.) - # |A paragraph that is| - # |left aligned. | - # [+JUSTIFY+] Fully justified, words filled to width by spaces. - # |A paragraph that| - # |is justified.| - # - # *Default*:: Text::Format::LEFT_ALIGN - # Used in:: #format, #paragraphs - def format_style=(fs) - raise ArgumentError, "Invalid value provided for format_style." if ((fs < LEFT_ALIGN) || (fs > JUSTIFY)) - @format_style = fs - end - - # Indicates that the format style is left alignment. - # - # *Default*:: +true+ - # Used in:: #format, #paragraphs - def left_align? - return @format_style == LEFT_ALIGN - end - - # Indicates that the format style is right alignment. - # - # *Default*:: +false+ - # Used in:: #format, #paragraphs - def right_align? - return @format_style == RIGHT_ALIGN - end - - # Indicates that the format style is right fill. - # - # *Default*:: +false+ - # Used in:: #format, #paragraphs - def right_fill? - return @format_style == RIGHT_FILL - end - - # Indicates that the format style is full justification. - # - # *Default*:: +false+ - # Used in:: #format, #paragraphs - def justify? - return @format_style == JUSTIFY - end - - # The default implementation of #hyphenate_to implements - # SPLIT_CONTINUATION. - def hyphenate_to(word, size) - [word[0 .. (size - 2)] + "\\", word[(size - 1) .. -1]] - end - - private - def __do_split_word(word, size) #:nodoc: - [word[0 .. (size - 1)], word[size .. -1]] - end - - def __format(to_wrap) #:nodoc: - words = to_wrap.split(/\s+/).compact - words.shift if words[0].nil? or words[0].empty? - to_wrap = [] - - abbrev = false - width = @columns - @first_indent - @left_margin - @right_margin - indent_str = ' ' * @first_indent - first_line = true - line = words.shift - abbrev = __is_abbrev(line) unless line.nil? || line.empty? - - while w = words.shift - if (w.size + line.size < (width - 1)) || - ((line !~ LEQ_RE || abbrev) && (w.size + line.size < width)) - line << " " if (line =~ LEQ_RE) && (not abbrev) - line << " #{w}" - else - line, w = __do_break(line, w) if @nobreak - line, w = __do_hyphenate(line, w, width) if @hard_margins - if w.index(/\s+/) - w, *w2 = w.split(/\s+/) - words.unshift(w2) - words.flatten! - end - to_wrap << __make_line(line, indent_str, width, w.nil?) unless line.nil? - if first_line - first_line = false - width = @columns - @body_indent - @left_margin - @right_margin - indent_str = ' ' * @body_indent - end - line = w - end - - abbrev = __is_abbrev(w) unless w.nil? - end - - loop do - break if line.nil? or line.empty? - line, w = __do_hyphenate(line, w, width) if @hard_margins - to_wrap << __make_line(line, indent_str, width, w.nil?) - line = w - end - - if (@tag_paragraph && (to_wrap.size > 0)) then - clr = %r{`(\w+)'}.match([caller(1)].flatten[0])[1] - clr = "" if clr.nil? - - if ((not @tag_text[0].nil?) && (@tag_cur.size < 1) && - (clr != "__paragraphs")) then - @tag_cur = @tag_text[0] - end - - fchar = /(\S)/.match(to_wrap[0])[1] - white = to_wrap[0].index(fchar) - if ((white - @left_margin - 1) > @tag_cur.size) then - white = @tag_cur.size + @left_margin - to_wrap[0].gsub!(/^ {#{white}}/, "#{' ' * @left_margin}#{@tag_cur}") - else - to_wrap.unshift("#{' ' * @left_margin}#{@tag_cur}\n") - end - end - to_wrap.join('') - end - - # format lines in text into paragraphs with each element of @wrap a - # paragraph; uses Text::Format.format for the formatting - def __paragraphs(to_wrap) #:nodoc: - if ((@first_indent == @body_indent) || @tag_paragraph) then - p_end = "\n" - else - p_end = '' - end - - cnt = 0 - ret = [] - to_wrap.each do |tw| - @tag_cur = @tag_text[cnt] if @tag_paragraph - @tag_cur = '' if @tag_cur.nil? - line = __format(tw) - ret << "#{line}#{p_end}" if (not line.nil?) && (line.size > 0) - cnt += 1 - end - - ret[-1].chomp! unless ret.empty? - ret.join('') - end - - # center text using spaces on left side to pad it out empty lines - # are preserved - def __center(to_center) #:nodoc: - tabs = 0 - width = @columns - @left_margin - @right_margin - centered = [] - to_center.each do |tc| - s = tc.strip - tabs = s.count("\t") - tabs = 0 if tabs.nil? - ct = ((width - s.size - (tabs * @tabstop) + tabs) / 2) - ct = (width - @left_margin - @right_margin) - ct - centered << "#{s.rjust(ct)}\n" - end - centered.join('') - end - - # expand tabs to spaces should be similar to Text::Tabs::expand - def __expand(to_expand) #:nodoc: - expanded = [] - to_expand.split("\n").each { |te| expanded << te.gsub(/\t/, ' ' * @tabstop) } - expanded.join('') - end - - def __unexpand(to_unexpand) #:nodoc: - unexpanded = [] - to_unexpand.split("\n").each { |tu| unexpanded << tu.gsub(/ {#{@tabstop}}/, "\t") } - unexpanded.join('') - end - - def __is_abbrev(word) #:nodoc: - # remove period if there is one. - w = word.gsub(/\.$/, '') unless word.nil? - return true if (!@extra_space || ABBREV.include?(w) || @abbreviations.include?(w)) - false - end - - def __make_line(line, indent, width, last = false) #:nodoc: - lmargin = " " * @left_margin - fill = " " * (width - line.size) if right_fill? && (line.size <= width) - - if (justify? && ((not line.nil?) && (not line.empty?)) && line =~ /\S+\s+\S+/ && !last) - spaces = width - line.size - words = line.split(/(\s+)/) - ws = spaces / (words.size / 2) - spaces = spaces % (words.size / 2) if ws > 0 - words.reverse.each do |rw| - next if (rw =~ /^\S/) - rw.sub!(/^/, " " * ws) - next unless (spaces > 0) - rw.sub!(/^/, " ") - spaces -= 1 - end - line = words.join('') - end - line = "#{lmargin}#{indent}#{line}#{fill}\n" unless line.nil? - if right_align? && (not line.nil?) - line.sub(/^/, " " * (@columns - @right_margin - (line.size - 1))) - else - line - end - end - - def __do_hyphenate(line, next_line, width) #:nodoc: - rline = line.dup rescue line - rnext = next_line.dup rescue next_line - loop do - if rline.size == width - break - elsif rline.size > width - words = rline.strip.split(/\s+/) - word = words[-1].dup - size = width - rline.size + word.size - if (size <= 0) - words[-1] = nil - rline = words.join(' ').strip - rnext = "#{word} #{rnext}".strip - next - end - - first = rest = nil - - if ((@split_rules & SPLIT_HYPHENATION) != 0) - if @hyphenator_arity == 2 - first, rest = @hyphenator.hyphenate_to(word, size) - else - first, rest = @hyphenator.hyphenate_to(word, size, self) - end - end - - if ((@split_rules & SPLIT_CONTINUATION) != 0) and first.nil? - first, rest = self.hyphenate_to(word, size) - end - - if ((@split_rules & SPLIT_FIXED) != 0) and first.nil? - first.nil? or @split_rules == SPLIT_FIXED - first, rest = __do_split_word(word, size) - end - - if first.nil? - words[-1] = nil - rest = word - else - words[-1] = first - @split_words << SplitWord.new(word, first, rest) - end - rline = words.join(' ').strip - rnext = "#{rest} #{rnext}".strip - break - else - break if rnext.nil? or rnext.empty? or rline.nil? or rline.empty? - words = rnext.split(/\s+/) - word = words.shift - size = width - rline.size - 1 - - if (size <= 0) - rnext = "#{word} #{words.join(' ')}".strip - break - end - - first = rest = nil - - if ((@split_rules & SPLIT_HYPHENATION) != 0) - if @hyphenator_arity == 2 - first, rest = @hyphenator.hyphenate_to(word, size) - else - first, rest = @hyphenator.hyphenate_to(word, size, self) - end - end - - first, rest = self.hyphenate_to(word, size) if ((@split_rules & SPLIT_CONTINUATION) != 0) and first.nil? - - first, rest = __do_split_word(word, size) if ((@split_rules & SPLIT_FIXED) != 0) and first.nil? - - if (rline.size + (first ? first.size : 0)) < width - @split_words << SplitWord.new(word, first, rest) - rline = "#{rline} #{first}".strip - rnext = "#{rest} #{words.join(' ')}".strip - end - break - end - end - [rline, rnext] - end - - def __do_break(line, next_line) #:nodoc: - no_brk = false - words = [] - words = line.split(/\s+/) unless line.nil? - last_word = words[-1] - - @nobreak_regex.each { |k, v| no_brk = ((last_word =~ /#{k}/) and (next_line =~ /#{v}/)) } - - if no_brk && words.size > 1 - i = words.size - while i > 0 - no_brk = false - @nobreak_regex.each { |k, v| no_brk = ((words[i + 1] =~ /#{k}/) && (words[i] =~ /#{v}/)) } - i -= 1 - break if not no_brk - end - if i > 0 - l = brk_re(i).match(line) - line.sub!(brk_re(i), l[1]) - next_line = "#{l[2]} #{next_line}" - line.sub!(/\s+$/, '') - end - end - [line, next_line] - end - - def __create(arg = nil, &block) #:nodoc: - # Format::Text.new(text-to-wrap) - @text = arg unless arg.nil? - # Defaults - @columns = 72 - @tabstop = 8 - @first_indent = 4 - @body_indent = 0 - @format_style = LEFT_ALIGN - @left_margin = 0 - @right_margin = 0 - @extra_space = false - @text = Array.new if @text.nil? - @tag_paragraph = false - @tag_text = Array.new - @tag_cur = "" - @abbreviations = Array.new - @nobreak = false - @nobreak_regex = Hash.new - @split_words = Array.new - @hard_margins = false - @split_rules = SPLIT_FIXED - @hyphenator = self - @hyphenator_arity = self.method(:hyphenate_to).arity - - instance_eval(&block) unless block.nil? - end - - public - # Formats text into a nice paragraph format. The text is separated - # into words and then reassembled a word at a time using the settings - # of this Format object. If a word is larger than the number of - # columns available for formatting, then that word will appear on the - # line by itself. - # - # If +to_wrap+ is +nil+, then the value of #text will be - # worked on. - def format(to_wrap = nil) - to_wrap = @text if to_wrap.nil? - if to_wrap.class == Array - __format(to_wrap[0]) - else - __format(to_wrap) - end - end - - # Considers each element of text (provided or internal) as a paragraph. - # If #first_indent is the same as #body_indent, then - # paragraphs will be separated by a single empty line in the result; - # otherwise, the paragraphs will follow immediately after each other. - # Uses #format to do the heavy lifting. - def paragraphs(to_wrap = nil) - to_wrap = @text if to_wrap.nil? - __paragraphs([to_wrap].flatten) - end - - # Centers the text, preserving empty lines and tabs. - def center(to_center = nil) - to_center = @text if to_center.nil? - __center([to_center].flatten) - end - - # Replaces all tab characters in the text with #tabstop spaces. - def expand(to_expand = nil) - to_expand = @text if to_expand.nil? - if to_expand.class == Array - to_expand.collect { |te| __expand(te) } - else - __expand(to_expand) - end - end - - # Replaces all occurrences of #tabstop consecutive spaces - # with a tab character. - def unexpand(to_unexpand = nil) - to_unexpand = @text if to_unexpand.nil? - if to_unexpand.class == Array - to_unexpand.collect { |te| v << __unexpand(te) } - else - __unexpand(to_unexpand) - end - end - - # This constructor takes advantage of a technique for Ruby object - # construction introduced by Andy Hunt and Dave Thomas (see reference), - # where optional values are set using commands in a block. - # - # Text::Format.new { - # columns = 72 - # left_margin = 0 - # right_margin = 0 - # first_indent = 4 - # body_indent = 0 - # format_style = Text::Format::LEFT_ALIGN - # extra_space = false - # abbreviations = {} - # tag_paragraph = false - # tag_text = [] - # nobreak = false - # nobreak_regex = {} - # tabstop = 8 - # text = nil - # } - # - # As shown above, +arg+ is optional. If +arg+ is specified and is a - # +String+, then arg is used as the default value of #text. - # Alternately, an existing Text::Format object can be used or a Hash can - # be used. With all forms, a block can be specified. - # - # *Reference*:: "Object Construction and Blocks" - # - # - def initialize(arg = nil, &block) - case arg - when Text::Format - __create(arg.text) do - @columns = arg.columns - @tabstop = arg.tabstop - @first_indent = arg.first_indent - @body_indent = arg.body_indent - @format_style = arg.format_style - @left_margin = arg.left_margin - @right_margin = arg.right_margin - @extra_space = arg.extra_space - @tag_paragraph = arg.tag_paragraph - @tag_text = arg.tag_text - @abbreviations = arg.abbreviations - @nobreak = arg.nobreak - @nobreak_regex = arg.nobreak_regex - @text = arg.text - @hard_margins = arg.hard_margins - @split_words = arg.split_words - @split_rules = arg.split_rules - @hyphenator = arg.hyphenator - end - instance_eval(&block) unless block.nil? - when Hash - __create do - @columns = arg[:columns] || arg['columns'] || @columns - @tabstop = arg[:tabstop] || arg['tabstop'] || @tabstop - @first_indent = arg[:first_indent] || arg['first_indent'] || @first_indent - @body_indent = arg[:body_indent] || arg['body_indent'] || @body_indent - @format_style = arg[:format_style] || arg['format_style'] || @format_style - @left_margin = arg[:left_margin] || arg['left_margin'] || @left_margin - @right_margin = arg[:right_margin] || arg['right_margin'] || @right_margin - @extra_space = arg[:extra_space] || arg['extra_space'] || @extra_space - @text = arg[:text] || arg['text'] || @text - @tag_paragraph = arg[:tag_paragraph] || arg['tag_paragraph'] || @tag_paragraph - @tag_text = arg[:tag_text] || arg['tag_text'] || @tag_text - @abbreviations = arg[:abbreviations] || arg['abbreviations'] || @abbreviations - @nobreak = arg[:nobreak] || arg['nobreak'] || @nobreak - @nobreak_regex = arg[:nobreak_regex] || arg['nobreak_regex'] || @nobreak_regex - @hard_margins = arg[:hard_margins] || arg['hard_margins'] || @hard_margins - @split_rules = arg[:split_rules] || arg['split_rules'] || @split_rules - @hyphenator = arg[:hyphenator] || arg['hyphenator'] || @hyphenator - end - instance_eval(&block) unless block.nil? - when String - __create(arg, &block) - when NilClass - __create(&block) - else - raise TypeError - end - end - end -end - -if __FILE__ == $0 - require 'test/unit' - - class TestText__Format < Test::Unit::TestCase #:nodoc: - attr_accessor :format_o - - GETTYSBURG = <<-'EOS' - Four score and seven years ago our fathers brought forth on this - continent a new nation, conceived in liberty and dedicated to the - proposition that all men are created equal. Now we are engaged in - a great civil war, testing whether that nation or any nation so - conceived and so dedicated can long endure. We are met on a great - battlefield of that war. We have come to dedicate a portion of - that field as a final resting-place for those who here gave their - lives that that nation might live. It is altogether fitting and - proper that we should do this. But in a larger sense, we cannot - dedicate, we cannot consecrate, we cannot hallow this ground. - The brave men, living and dead who struggled here have consecrated - it far above our poor power to add or detract. The world will - little note nor long remember what we say here, but it can never - forget what they did here. It is for us the living rather to be - dedicated here to the unfinished work which they who fought here - have thus far so nobly advanced. It is rather for us to be here - dedicated to the great task remaining before us--that from these - honored dead we take increased devotion to that cause for which - they gave the last full measure of devotion--that we here highly - resolve that these dead shall not have died in vain, that this - nation under God shall have a new birth of freedom, and that - government of the people, by the people, for the people shall - not perish from the earth. - - -- Pres. Abraham Lincoln, 19 November 1863 - EOS - - FIVE_COL = "Four \nscore\nand s\neven \nyears\nago o\nur fa\nthers\nbroug\nht fo\nrth o\nn thi\ns con\ntinen\nt a n\new na\ntion,\nconce\nived \nin li\nberty\nand d\nedica\nted t\no the\npropo\nsitio\nn tha\nt all\nmen a\nre cr\neated\nequal\n. Now\nwe ar\ne eng\naged \nin a \ngreat\ncivil\nwar, \ntesti\nng wh\nether\nthat \nnatio\nn or \nany n\nation\nso co\nnceiv\ned an\nd so \ndedic\nated \ncan l\nong e\nndure\n. We \nare m\net on\na gre\nat ba\nttlef\nield \nof th\nat wa\nr. We\nhave \ncome \nto de\ndicat\ne a p\nortio\nn of \nthat \nfield\nas a \nfinal\nresti\nng-pl\nace f\nor th\nose w\nho he\nre ga\nve th\neir l\nives \nthat \nthat \nnatio\nn mig\nht li\nve. I\nt is \naltog\nether\nfitti\nng an\nd pro\nper t\nhat w\ne sho\nuld d\no thi\ns. Bu\nt in \na lar\nger s\nense,\nwe ca\nnnot \ndedic\nate, \nwe ca\nnnot \nconse\ncrate\n, we \ncanno\nt hal\nlow t\nhis g\nround\n. The\nbrave\nmen, \nlivin\ng and\ndead \nwho s\ntrugg\nled h\nere h\nave c\nonsec\nrated\nit fa\nr abo\nve ou\nr poo\nr pow\ner to\nadd o\nr det\nract.\nThe w\norld \nwill \nlittl\ne not\ne nor\nlong \nremem\nber w\nhat w\ne say\nhere,\nbut i\nt can\nnever\nforge\nt wha\nt the\ny did\nhere.\nIt is\nfor u\ns the\nlivin\ng rat\nher t\no be \ndedic\nated \nhere \nto th\ne unf\ninish\ned wo\nrk wh\nich t\nhey w\nho fo\nught \nhere \nhave \nthus \nfar s\no nob\nly ad\nvance\nd. It\nis ra\nther \nfor u\ns to \nbe he\nre de\ndicat\ned to\nthe g\nreat \ntask \nremai\nning \nbefor\ne us-\n-that\nfrom \nthese\nhonor\ned de\nad we\ntake \nincre\nased \ndevot\nion t\no tha\nt cau\nse fo\nr whi\nch th\ney ga\nve th\ne las\nt ful\nl mea\nsure \nof de\nvotio\nn--th\nat we\nhere \nhighl\ny res\nolve \nthat \nthese\ndead \nshall\nnot h\nave d\nied i\nn vai\nn, th\nat th\nis na\ntion \nunder\nGod s\nhall \nhave \na new\nbirth\nof fr\needom\n, and\nthat \ngover\nnment\nof th\ne peo\nple, \nby th\ne peo\nple, \nfor t\nhe pe\nople \nshall\nnot p\nerish\nfrom \nthe e\narth.\n-- Pr\nes. A\nbraha\nm Lin\ncoln,\n19 No\nvembe\nr 186\n3 \n" - - FIVE_CNT = "Four \nscore\nand \nseven\nyears\nago \nour \nfath\\\ners \nbrou\\\nght \nforth\non t\\\nhis \ncont\\\ninent\na new\nnati\\\non, \nconc\\\neived\nin l\\\niber\\\nty a\\\nnd d\\\nedic\\\nated \nto t\\\nhe p\\\nropo\\\nsiti\\\non t\\\nhat \nall \nmen \nare \ncrea\\\nted \nequa\\\nl. N\\\now we\nare \nenga\\\nged \nin a \ngreat\ncivil\nwar, \ntest\\\ning \nwhet\\\nher \nthat \nnati\\\non or\nany \nnati\\\non so\nconc\\\neived\nand \nso d\\\nedic\\\nated \ncan \nlong \nendu\\\nre. \nWe a\\\nre m\\\net on\na gr\\\neat \nbatt\\\nlefi\\\neld \nof t\\\nhat \nwar. \nWe h\\\nave \ncome \nto d\\\nedic\\\nate a\nport\\\nion \nof t\\\nhat \nfield\nas a \nfinal\nrest\\\ning-\\\nplace\nfor \nthose\nwho \nhere \ngave \ntheir\nlives\nthat \nthat \nnati\\\non m\\\night \nlive.\nIt is\nalto\\\ngeth\\\ner f\\\nitti\\\nng a\\\nnd p\\\nroper\nthat \nwe s\\\nhould\ndo t\\\nhis. \nBut \nin a \nlarg\\\ner s\\\nense,\nwe c\\\nannot\ndedi\\\ncate,\nwe c\\\nannot\ncons\\\necra\\\nte, \nwe c\\\nannot\nhall\\\now t\\\nhis \ngrou\\\nnd. \nThe \nbrave\nmen, \nlivi\\\nng a\\\nnd d\\\nead \nwho \nstru\\\nggled\nhere \nhave \ncons\\\necra\\\nted \nit f\\\nar a\\\nbove \nour \npoor \npower\nto a\\\ndd or\ndetr\\\nact. \nThe \nworld\nwill \nlitt\\\nle n\\\note \nnor \nlong \nreme\\\nmber \nwhat \nwe s\\\nay h\\\nere, \nbut \nit c\\\nan n\\\never \nforg\\\net w\\\nhat \nthey \ndid \nhere.\nIt is\nfor \nus t\\\nhe l\\\niving\nrath\\\ner to\nbe d\\\nedic\\\nated \nhere \nto t\\\nhe u\\\nnfin\\\nished\nwork \nwhich\nthey \nwho \nfoug\\\nht h\\\nere \nhave \nthus \nfar \nso n\\\nobly \nadva\\\nnced.\nIt is\nrath\\\ner f\\\nor us\nto be\nhere \ndedi\\\ncated\nto t\\\nhe g\\\nreat \ntask \nrema\\\nining\nbefo\\\nre u\\\ns--t\\\nhat \nfrom \nthese\nhono\\\nred \ndead \nwe t\\\nake \nincr\\\neased\ndevo\\\ntion \nto t\\\nhat \ncause\nfor \nwhich\nthey \ngave \nthe \nlast \nfull \nmeas\\\nure \nof d\\\nevot\\\nion-\\\n-that\nwe h\\\nere \nhigh\\\nly r\\\nesol\\\nve t\\\nhat \nthese\ndead \nshall\nnot \nhave \ndied \nin v\\\nain, \nthat \nthis \nnati\\\non u\\\nnder \nGod \nshall\nhave \na new\nbirth\nof f\\\nreed\\\nom, \nand \nthat \ngove\\\nrnme\\\nnt of\nthe \npeop\\\nle, \nby t\\\nhe p\\\neopl\\\ne, f\\\nor t\\\nhe p\\\neople\nshall\nnot \nperi\\\nsh f\\\nrom \nthe \neart\\\nh. --\nPres.\nAbra\\\nham \nLinc\\\noln, \n19 N\\\novem\\\nber \n1863 \n" - - # Tests both abbreviations and abbreviations= - def test_abbreviations - abbr = [" Pres. Abraham Lincoln\n", " Pres. Abraham Lincoln\n"] - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal([], @format_o.abbreviations) - assert_nothing_raised { @format_o.abbreviations = [ 'foo', 'bar' ] } - assert_equal([ 'foo', 'bar' ], @format_o.abbreviations) - assert_equal(abbr[0], @format_o.format(abbr[0])) - assert_nothing_raised { @format_o.extra_space = true } - assert_equal(abbr[1], @format_o.format(abbr[0])) - assert_nothing_raised { @format_o.abbreviations = [ "Pres" ] } - assert_equal([ "Pres" ], @format_o.abbreviations) - assert_equal(abbr[0], @format_o.format(abbr[0])) - assert_nothing_raised { @format_o.extra_space = false } - assert_equal(abbr[0], @format_o.format(abbr[0])) - end - - # Tests both body_indent and body_indent= - def test_body_indent - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal(0, @format_o.body_indent) - assert_nothing_raised { @format_o.body_indent = 7 } - assert_equal(7, @format_o.body_indent) - assert_nothing_raised { @format_o.body_indent = -3 } - assert_equal(3, @format_o.body_indent) - assert_nothing_raised { @format_o.body_indent = "9" } - assert_equal(9, @format_o.body_indent) - assert_nothing_raised { @format_o.body_indent = "-2" } - assert_equal(2, @format_o.body_indent) - assert_match(/^ [^ ]/, @format_o.format(GETTYSBURG).split("\n")[1]) - end - - # Tests both columns and columns= - def test_columns - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal(72, @format_o.columns) - assert_nothing_raised { @format_o.columns = 7 } - assert_equal(7, @format_o.columns) - assert_nothing_raised { @format_o.columns = -3 } - assert_equal(3, @format_o.columns) - assert_nothing_raised { @format_o.columns = "9" } - assert_equal(9, @format_o.columns) - assert_nothing_raised { @format_o.columns = "-2" } - assert_equal(2, @format_o.columns) - assert_nothing_raised { @format_o.columns = 40 } - assert_equal(40, @format_o.columns) - assert_match(/this continent$/, - @format_o.format(GETTYSBURG).split("\n")[1]) - end - - # Tests both extra_space and extra_space= - def test_extra_space - assert_nothing_raised { @format_o = Text::Format.new } - assert(!@format_o.extra_space) - assert_nothing_raised { @format_o.extra_space = true } - assert(@format_o.extra_space) - # The behaviour of extra_space is tested in test_abbreviations. There - # is no need to reproduce it here. - end - - # Tests both first_indent and first_indent= - def test_first_indent - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal(4, @format_o.first_indent) - assert_nothing_raised { @format_o.first_indent = 7 } - assert_equal(7, @format_o.first_indent) - assert_nothing_raised { @format_o.first_indent = -3 } - assert_equal(3, @format_o.first_indent) - assert_nothing_raised { @format_o.first_indent = "9" } - assert_equal(9, @format_o.first_indent) - assert_nothing_raised { @format_o.first_indent = "-2" } - assert_equal(2, @format_o.first_indent) - assert_match(/^ [^ ]/, @format_o.format(GETTYSBURG).split("\n")[0]) - end - - def test_format_style - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal(Text::Format::LEFT_ALIGN, @format_o.format_style) - assert_match(/^November 1863$/, - @format_o.format(GETTYSBURG).split("\n")[-1]) - assert_nothing_raised { - @format_o.format_style = Text::Format::RIGHT_ALIGN - } - assert_equal(Text::Format::RIGHT_ALIGN, @format_o.format_style) - assert_match(/^ +November 1863$/, - @format_o.format(GETTYSBURG).split("\n")[-1]) - assert_nothing_raised { - @format_o.format_style = Text::Format::RIGHT_FILL - } - assert_equal(Text::Format::RIGHT_FILL, @format_o.format_style) - assert_match(/^November 1863 +$/, - @format_o.format(GETTYSBURG).split("\n")[-1]) - assert_nothing_raised { @format_o.format_style = Text::Format::JUSTIFY } - assert_equal(Text::Format::JUSTIFY, @format_o.format_style) - assert_match(/^of freedom, and that government of the people, by the people, for the$/, - @format_o.format(GETTYSBURG).split("\n")[-3]) - assert_raises(ArgumentError) { @format_o.format_style = 33 } - end - - def test_tag_paragraph - assert_nothing_raised { @format_o = Text::Format.new } - assert(!@format_o.tag_paragraph) - assert_nothing_raised { @format_o.tag_paragraph = true } - assert(@format_o.tag_paragraph) - assert_not_equal(@format_o.paragraphs([GETTYSBURG, GETTYSBURG]), - Text::Format.new.paragraphs([GETTYSBURG, GETTYSBURG])) - end - - def test_tag_text - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal([], @format_o.tag_text) - assert_equal(@format_o.format(GETTYSBURG), - Text::Format.new.format(GETTYSBURG)) - assert_nothing_raised { - @format_o.tag_paragraph = true - @format_o.tag_text = ["Gettysburg Address", "---"] - } - assert_not_equal(@format_o.format(GETTYSBURG), - Text::Format.new.format(GETTYSBURG)) - assert_not_equal(@format_o.paragraphs([GETTYSBURG, GETTYSBURG]), - Text::Format.new.paragraphs([GETTYSBURG, GETTYSBURG])) - assert_not_equal(@format_o.paragraphs([GETTYSBURG, GETTYSBURG, - GETTYSBURG]), - Text::Format.new.paragraphs([GETTYSBURG, GETTYSBURG, - GETTYSBURG])) - end - - def test_justify? - assert_nothing_raised { @format_o = Text::Format.new } - assert(!@format_o.justify?) - assert_nothing_raised { - @format_o.format_style = Text::Format::RIGHT_ALIGN - } - assert(!@format_o.justify?) - assert_nothing_raised { - @format_o.format_style = Text::Format::RIGHT_FILL - } - assert(!@format_o.justify?) - assert_nothing_raised { - @format_o.format_style = Text::Format::JUSTIFY - } - assert(@format_o.justify?) - # The format testing is done in test_format_style - end - - def test_left_align? - assert_nothing_raised { @format_o = Text::Format.new } - assert(@format_o.left_align?) - assert_nothing_raised { - @format_o.format_style = Text::Format::RIGHT_ALIGN - } - assert(!@format_o.left_align?) - assert_nothing_raised { - @format_o.format_style = Text::Format::RIGHT_FILL - } - assert(!@format_o.left_align?) - assert_nothing_raised { @format_o.format_style = Text::Format::JUSTIFY } - assert(!@format_o.left_align?) - # The format testing is done in test_format_style - end - - def test_left_margin - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal(0, @format_o.left_margin) - assert_nothing_raised { @format_o.left_margin = -3 } - assert_equal(3, @format_o.left_margin) - assert_nothing_raised { @format_o.left_margin = "9" } - assert_equal(9, @format_o.left_margin) - assert_nothing_raised { @format_o.left_margin = "-2" } - assert_equal(2, @format_o.left_margin) - assert_nothing_raised { @format_o.left_margin = 7 } - assert_equal(7, @format_o.left_margin) - assert_nothing_raised { - ft = @format_o.format(GETTYSBURG).split("\n") - assert_match(/^ {11}Four score/, ft[0]) - assert_match(/^ {7}November/, ft[-1]) - } - end - - def test_hard_margins - assert_nothing_raised { @format_o = Text::Format.new } - assert(!@format_o.hard_margins) - assert_nothing_raised { - @format_o.hard_margins = true - @format_o.columns = 5 - @format_o.first_indent = 0 - @format_o.format_style = Text::Format::RIGHT_FILL - } - assert(@format_o.hard_margins) - assert_equal(FIVE_COL, @format_o.format(GETTYSBURG)) - assert_nothing_raised { - @format_o.split_rules |= Text::Format::SPLIT_CONTINUATION - assert_equal(Text::Format::SPLIT_CONTINUATION_FIXED, - @format_o.split_rules) - } - assert_equal(FIVE_CNT, @format_o.format(GETTYSBURG)) - end - - # Tests both nobreak and nobreak_regex, since one is only useful - # with the other. - def test_nobreak - assert_nothing_raised { @format_o = Text::Format.new } - assert(!@format_o.nobreak) - assert(@format_o.nobreak_regex.empty?) - assert_nothing_raised { - @format_o.nobreak = true - @format_o.nobreak_regex = { '^this$' => '^continent$' } - @format_o.columns = 77 - } - assert(@format_o.nobreak) - assert_equal({ '^this$' => '^continent$' }, @format_o.nobreak_regex) - assert_match(/^this continent/, - @format_o.format(GETTYSBURG).split("\n")[1]) - end - - def test_right_align? - assert_nothing_raised { @format_o = Text::Format.new } - assert(!@format_o.right_align?) - assert_nothing_raised { - @format_o.format_style = Text::Format::RIGHT_ALIGN - } - assert(@format_o.right_align?) - assert_nothing_raised { - @format_o.format_style = Text::Format::RIGHT_FILL - } - assert(!@format_o.right_align?) - assert_nothing_raised { @format_o.format_style = Text::Format::JUSTIFY } - assert(!@format_o.right_align?) - # The format testing is done in test_format_style - end - - def test_right_fill? - assert_nothing_raised { @format_o = Text::Format.new } - assert(!@format_o.right_fill?) - assert_nothing_raised { - @format_o.format_style = Text::Format::RIGHT_ALIGN - } - assert(!@format_o.right_fill?) - assert_nothing_raised { - @format_o.format_style = Text::Format::RIGHT_FILL - } - assert(@format_o.right_fill?) - assert_nothing_raised { - @format_o.format_style = Text::Format::JUSTIFY - } - assert(!@format_o.right_fill?) - # The format testing is done in test_format_style - end - - def test_right_margin - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal(0, @format_o.right_margin) - assert_nothing_raised { @format_o.right_margin = -3 } - assert_equal(3, @format_o.right_margin) - assert_nothing_raised { @format_o.right_margin = "9" } - assert_equal(9, @format_o.right_margin) - assert_nothing_raised { @format_o.right_margin = "-2" } - assert_equal(2, @format_o.right_margin) - assert_nothing_raised { @format_o.right_margin = 7 } - assert_equal(7, @format_o.right_margin) - assert_nothing_raised { - ft = @format_o.format(GETTYSBURG).split("\n") - assert_match(/^ {4}Four score.*forth on$/, ft[0]) - assert_match(/^November/, ft[-1]) - } - end - - def test_tabstop - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal(8, @format_o.tabstop) - assert_nothing_raised { @format_o.tabstop = 7 } - assert_equal(7, @format_o.tabstop) - assert_nothing_raised { @format_o.tabstop = -3 } - assert_equal(3, @format_o.tabstop) - assert_nothing_raised { @format_o.tabstop = "9" } - assert_equal(9, @format_o.tabstop) - assert_nothing_raised { @format_o.tabstop = "-2" } - assert_equal(2, @format_o.tabstop) - end - - def test_text - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal([], @format_o.text) - assert_nothing_raised { @format_o.text = "Test Text" } - assert_equal("Test Text", @format_o.text) - assert_nothing_raised { @format_o.text = ["Line 1", "Line 2"] } - assert_equal(["Line 1", "Line 2"], @format_o.text) - end - - def test_s_new - # new(NilClass) { block } - assert_nothing_raised do - @format_o = Text::Format.new { - self.text = "Test 1, 2, 3" - } - end - assert_equal("Test 1, 2, 3", @format_o.text) - - # new(Hash Symbols) - assert_nothing_raised { @format_o = Text::Format.new(:columns => 72) } - assert_equal(72, @format_o.columns) - - # new(Hash String) - assert_nothing_raised { @format_o = Text::Format.new('columns' => 72) } - assert_equal(72, @format_o.columns) - - # new(Hash) { block } - assert_nothing_raised do - @format_o = Text::Format.new('columns' => 80) { - self.text = "Test 4, 5, 6" - } - end - assert_equal("Test 4, 5, 6", @format_o.text) - assert_equal(80, @format_o.columns) - - # new(Text::Format) - assert_nothing_raised do - fo = Text::Format.new(@format_o) - assert(fo == @format_o) - end - - # new(Text::Format) { block } - assert_nothing_raised do - fo = Text::Format.new(@format_o) { self.columns = 79 } - assert(fo != @format_o) - end - - # new(String) - assert_nothing_raised { @format_o = Text::Format.new("Test A, B, C") } - assert_equal("Test A, B, C", @format_o.text) - - # new(String) { block } - assert_nothing_raised do - @format_o = Text::Format.new("Test X, Y, Z") { self.columns = -5 } - end - assert_equal("Test X, Y, Z", @format_o.text) - assert_equal(5, @format_o.columns) - end - - def test_center - assert_nothing_raised { @format_o = Text::Format.new } - assert_nothing_raised do - ct = @format_o.center(GETTYSBURG.split("\n")).split("\n") - assert_match(/^ Four score and seven years ago our fathers brought forth on this/, ct[0]) - assert_match(/^ not perish from the earth./, ct[-3]) - end - end - - def test_expand - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal(" ", @format_o.expand("\t ")) - assert_nothing_raised { @format_o.tabstop = 4 } - assert_equal(" ", @format_o.expand("\t ")) - end - - def test_unexpand - assert_nothing_raised { @format_o = Text::Format.new } - assert_equal("\t ", @format_o.unexpand(" ")) - assert_nothing_raised { @format_o.tabstop = 4 } - assert_equal("\t ", @format_o.unexpand(" ")) - end - - def test_space_only - assert_equal("", Text::Format.new.format(" ")) - assert_equal("", Text::Format.new.format("\n")) - assert_equal("", Text::Format.new.format(" ")) - assert_equal("", Text::Format.new.format(" \n")) - assert_equal("", Text::Format.new.paragraphs("\n")) - assert_equal("", Text::Format.new.paragraphs(" ")) - assert_equal("", Text::Format.new.paragraphs(" ")) - assert_equal("", Text::Format.new.paragraphs(" \n")) - assert_equal("", Text::Format.new.paragraphs(["\n"])) - assert_equal("", Text::Format.new.paragraphs([" "])) - assert_equal("", Text::Format.new.paragraphs([" "])) - assert_equal("", Text::Format.new.paragraphs([" \n"])) - end - - def test_splendiferous - h = nil - test = "This is a splendiferous test" - assert_nothing_raised { @format_o = Text::Format.new(:columns => 6, :left_margin => 0, :indent => 0, :first_indent => 0) } - assert_match(/^splendiferous$/, @format_o.format(test)) - assert_nothing_raised { @format_o.hard_margins = true } - assert_match(/^lendif$/, @format_o.format(test)) - assert_nothing_raised { h = Object.new } - assert_nothing_raised do - @format_o.split_rules = Text::Format::SPLIT_HYPHENATION - class << h #:nodoc: - def hyphenate_to(word, size) - return ["", word] if size < 2 - [word[0 ... size], word[size .. -1]] - end - end - @format_o.hyphenator = h - end - assert_match(/^iferou$/, @format_o.format(test)) - assert_nothing_raised { h = Object.new } - assert_nothing_raised do - class << h #:nodoc: - def hyphenate_to(word, size, formatter) - return ["", word] if word.size < formatter.columns - [word[0 ... size], word[size .. -1]] - end - end - @format_o.hyphenator = h - end - assert_match(/^ferous$/, @format_o.format(test)) - end - end -end -# -# address.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -require 'tmail/encode' -require 'tmail/parser' - - -module TMail - - class Address - - include TextUtils - - def Address.parse( str ) - Parser.parse :ADDRESS, str - end - - def address_group? - false - end - - def initialize( local, domain ) - if domain - domain.each do |s| - raise SyntaxError, 'empty word in domain' if s.empty? - end - end - @local = local - @domain = domain - @name = nil - @routes = [] - end - - attr_reader :name - - def name=( str ) - @name = str - @name = nil if str and str.empty? - end - - alias phrase name - alias phrase= name= - - attr_reader :routes - - def inspect - "#<#{self.class} #{address()}>" - end - - def local - return nil unless @local - return '""' if @local.size == 1 and @local[0].empty? - @local.map {|i| quote_atom(i) }.join('.') - end - - def domain - return nil unless @domain - join_domain(@domain) - end - - def spec - s = self.local - d = self.domain - if s and d - s + '@' + d - else - s - end - end - - alias address spec - - - def ==( other ) - other.respond_to? :spec and self.spec == other.spec - end - - alias eql? == - - def hash - @local.hash ^ @domain.hash - end - - def dup - obj = self.class.new(@local.dup, @domain.dup) - obj.name = @name.dup if @name - obj.routes.replace @routes - obj - end - - include StrategyInterface - - def accept( strategy, dummy1 = nil, dummy2 = nil ) - unless @local - strategy.meta '<>' # empty return-path - return - end - - spec_p = (not @name and @routes.empty?) - if @name - strategy.phrase @name - strategy.space - end - tmp = spec_p ? '' : '<' - unless @routes.empty? - tmp << @routes.map {|i| '@' + i }.join(',') << ':' - end - tmp << self.spec - tmp << '>' unless spec_p - strategy.meta tmp - strategy.lwsp '' - end - - end - - - class AddressGroup - - include Enumerable - - def address_group? - true - end - - def initialize( name, addrs ) - @name = name - @addresses = addrs - end - - attr_reader :name - - def ==( other ) - other.respond_to? :to_a and @addresses == other.to_a - end - - alias eql? == - - def hash - map {|i| i.hash }.hash - end - - def []( idx ) - @addresses[idx] - end - - def size - @addresses.size - end - - def empty? - @addresses.empty? - end - - def each( &block ) - @addresses.each(&block) - end - - def to_a - @addresses.dup - end - - alias to_ary to_a - - def include?( a ) - @addresses.include? a - end - - def flatten - set = [] - @addresses.each do |a| - if a.respond_to? :flatten - set.concat a.flatten - else - set.push a - end - end - set - end - - def each_address( &block ) - flatten.each(&block) - end - - def add( a ) - @addresses.push a - end - - alias push add - - def delete( a ) - @addresses.delete a - end - - include StrategyInterface - - def accept( strategy, dummy1 = nil, dummy2 = nil ) - strategy.phrase @name - strategy.meta ':' - strategy.space - first = true - each do |mbox| - if first - first = false - else - strategy.meta ',' - end - strategy.space - mbox.accept strategy - end - strategy.meta ';' - strategy.lwsp '' - end - - end - -end # module TMail -require 'stringio' - -module TMail - class Attachment < StringIO - attr_accessor :original_filename, :content_type - end - - class Mail - def has_attachments? - multipart? && parts.any? { |part| attachment?(part) } - end - - def attachment?(part) - (part['content-disposition'] && part['content-disposition'].disposition == "attachment") || - part.header['content-type'].main_type != "text" - end - - def attachments - if multipart? - parts.collect { |part| - if attachment?(part) - content = part.body # unquoted automatically by TMail#body - file_name = (part['content-location'] && - part['content-location'].body) || - part.sub_header("content-type", "name") || - part.sub_header("content-disposition", "filename") - - next if file_name.blank? || content.blank? - - attachment = Attachment.new(content) - attachment.original_filename = file_name.strip - attachment.content_type = part.content_type - attachment - end - }.compact - end - end - end -end -# -# base64.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -module TMail - - module Base64 - - module_function - - def rb_folding_encode( str, eol = "\n", limit = 60 ) - [str].pack('m') - end - - def rb_encode( str ) - [str].pack('m').tr( "\r\n", '' ) - end - - def rb_decode( str, strict = false ) - str.unpack('m') - end - - begin - require 'tmail/base64.so' - alias folding_encode c_folding_encode - alias encode c_encode - alias decode c_decode - class << self - alias folding_encode c_folding_encode - alias encode c_encode - alias decode c_decode - end - rescue LoadError - alias folding_encode rb_folding_encode - alias encode rb_encode - alias decode rb_decode - class << self - alias folding_encode rb_folding_encode - alias encode rb_encode - alias decode rb_decode - end - end - - end - -end -# -# config.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -module TMail - - class Config - - def initialize( strict ) - @strict_parse = strict - @strict_base64decode = strict - end - - def strict_parse? - @strict_parse - end - - attr_writer :strict_parse - - def strict_base64decode? - @strict_base64decode - end - - attr_writer :strict_base64decode - - def new_body_port( mail ) - StringPort.new - end - - alias new_preamble_port new_body_port - alias new_part_port new_body_port - - end - - DEFAULT_CONFIG = Config.new(false) - DEFAULT_STRICT_CONFIG = Config.new(true) - - def Config.to_config( arg ) - return DEFAULT_STRICT_CONFIG if arg == true - return DEFAULT_CONFIG if arg == false - arg or DEFAULT_CONFIG - end - -end -# -# encode.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -require 'nkf' -require 'tmail/base64.rb' -require 'tmail/stringio' -require 'tmail/utils' - - -module TMail - - module StrategyInterface - - def create_dest( obj ) - case obj - when nil - StringOutput.new - when String - StringOutput.new(obj) - when IO, StringOutput - obj - else - raise TypeError, 'cannot handle this type of object for dest' - end - end - module_function :create_dest - - def encoded( eol = "\r\n", charset = 'j', dest = nil ) - accept_strategy Encoder, eol, charset, dest - end - - def decoded( eol = "\n", charset = 'e', dest = nil ) - accept_strategy Decoder, eol, charset, dest - end - - alias to_s decoded - - def accept_strategy( klass, eol, charset, dest = nil ) - dest ||= '' - accept klass.new(create_dest(dest), charset, eol) - dest - end - - end - - - ### - ### MIME B encoding decoder - ### - - class Decoder - - include TextUtils - - encoded = '=\?(?:iso-2022-jp|euc-jp|shift_jis)\?[QB]\?[a-z0-9+/=]+\?=' - ENCODED_WORDS = /#{encoded}(?:\s+#{encoded})*/i - - OUTPUT_ENCODING = { - 'EUC' => 'e', - 'SJIS' => 's', - } - - def self.decode( str, encoding = nil ) - encoding ||= (OUTPUT_ENCODING[$KCODE] || 'j') - opt = '-m' + encoding - str.gsub(ENCODED_WORDS) {|s| NKF.nkf(opt, s) } - end - - def initialize( dest, encoding = nil, eol = "\n" ) - @f = StrategyInterface.create_dest(dest) - @encoding = (/\A[ejs]/ === encoding) ? encoding[0,1] : nil - @eol = eol - end - - def decode( str ) - self.class.decode(str, @encoding) - end - private :decode - - def terminate - end - - def header_line( str ) - @f << decode(str) - end - - def header_name( nm ) - @f << nm << ': ' - end - - def header_body( str ) - @f << decode(str) - end - - def space - @f << ' ' - end - - alias spc space - - def lwsp( str ) - @f << str - end - - def meta( str ) - @f << str - end - - def text( str ) - @f << decode(str) - end - - def phrase( str ) - @f << quote_phrase(decode(str)) - end - - def kv_pair( k, v ) - @f << k << '=' << v - end - - def puts( str = nil ) - @f << str if str - @f << @eol - end - - def write( str ) - @f << str - end - - end - - - ### - ### MIME B-encoding encoder - ### - - # - # FIXME: This class can handle only (euc-jp/shift_jis -> iso-2022-jp). - # - class Encoder - - include TextUtils - - BENCODE_DEBUG = false unless defined?(BENCODE_DEBUG) - - def Encoder.encode( str ) - e = new() - e.header_body str - e.terminate - e.dest.string - end - - SPACER = "\t" - MAX_LINE_LEN = 70 - - OPTIONS = { - 'EUC' => '-Ej -m0', - 'SJIS' => '-Sj -m0', - 'UTF8' => nil, # FIXME - 'NONE' => nil - } - - def initialize( dest = nil, encoding = nil, eol = "\r\n", limit = nil ) - @f = StrategyInterface.create_dest(dest) - @opt = OPTIONS[$KCODE] - @eol = eol - reset - end - - def normalize_encoding( str ) - if @opt - then NKF.nkf(@opt, str) - else str - end - end - - def reset - @text = '' - @lwsp = '' - @curlen = 0 - end - - def terminate - add_lwsp '' - reset - end - - def dest - @f - end - - def puts( str = nil ) - @f << str if str - @f << @eol - end - - def write( str ) - @f << str - end - - # - # add - # - - def header_line( line ) - scanadd line - end - - def header_name( name ) - add_text name.split(/-/).map {|i| i.capitalize }.join('-') - add_text ':' - add_lwsp ' ' - end - - def header_body( str ) - scanadd normalize_encoding(str) - end - - def space - add_lwsp ' ' - end - - alias spc space - - def lwsp( str ) - add_lwsp str.sub(/[\r\n]+[^\r\n]*\z/, '') - end - - def meta( str ) - add_text str - end - - def text( str ) - scanadd normalize_encoding(str) - end - - def phrase( str ) - str = normalize_encoding(str) - if CONTROL_CHAR === str - scanadd str - else - add_text quote_phrase(str) - end - end - - # FIXME: implement line folding - # - def kv_pair( k, v ) - return if v.nil? - v = normalize_encoding(v) - if token_safe?(v) - add_text k + '=' + v - elsif not CONTROL_CHAR === v - add_text k + '=' + quote_token(v) - else - # apply RFC2231 encoding - kv = k + '*=' + "iso-2022-jp'ja'" + encode_value(v) - add_text kv - end - end - - def encode_value( str ) - str.gsub(TOKEN_UNSAFE) {|s| '%%%02x' % s[0] } - end - - private - - def scanadd( str, force = false ) - types = '' - strs = [] - - until str.empty? - if m = /\A[^\e\t\r\n ]+/.match(str) - types << (force ? 'j' : 'a') - strs.push m[0] - - elsif m = /\A[\t\r\n ]+/.match(str) - types << 's' - strs.push m[0] - - elsif m = /\A\e../.match(str) - esc = m[0] - str = m.post_match - if esc != "\e(B" and m = /\A[^\e]+/.match(str) - types << 'j' - strs.push m[0] - end - - else - raise 'TMail FATAL: encoder scan fail' - end - (str = m.post_match) unless m.nil? - end - - do_encode types, strs - end - - def do_encode( types, strs ) - # - # result : (A|E)(S(A|E))* - # E : W(SW)* - # W : (J|A)+ but must contain J # (J|A)*J(J|A)* - # A : <> - # J : <> - # S : <> - # - # An encoding unit is `E'. - # Input (parameter `types') is (J|A)(J|A|S)*(J|A) - # - if BENCODE_DEBUG - puts - puts '-- do_encode ------------' - puts types.split(//).join(' ') - p strs - end - - e = /[ja]*j[ja]*(?:s[ja]*j[ja]*)*/ - - while m = e.match(types) - pre = m.pre_match - concat_A_S pre, strs[0, pre.size] unless pre.empty? - concat_E m[0], strs[m.begin(0) ... m.end(0)] - types = m.post_match - strs.slice! 0, m.end(0) - end - concat_A_S types, strs - end - - def concat_A_S( types, strs ) - i = 0 - types.each_byte do |t| - case t - when ?a then add_text strs[i] - when ?s then add_lwsp strs[i] - else - raise "TMail FATAL: unknown flag: #{t.chr}" - end - i += 1 - end - end - - METHOD_ID = { - ?j => :extract_J, - ?e => :extract_E, - ?a => :extract_A, - ?s => :extract_S - } - - def concat_E( types, strs ) - if BENCODE_DEBUG - puts '---- concat_E' - puts "types=#{types.split(//).join(' ')}" - puts "strs =#{strs.inspect}" - end - - flush() unless @text.empty? - - chunk = '' - strs.each_with_index do |s,i| - mid = METHOD_ID[types[i]] - until s.empty? - unless c = __send__(mid, chunk.size, s) - add_with_encode chunk unless chunk.empty? - flush - chunk = '' - fold - c = __send__(mid, 0, s) - raise 'TMail FATAL: extract fail' unless c - end - chunk << c - end - end - add_with_encode chunk unless chunk.empty? - end - - def extract_J( chunksize, str ) - size = max_bytes(chunksize, str.size) - 6 - size = (size % 2 == 0) ? (size) : (size - 1) - return nil if size <= 0 - "\e$B#{str.slice!(0, size)}\e(B" - end - - def extract_A( chunksize, str ) - size = max_bytes(chunksize, str.size) - return nil if size <= 0 - str.slice!(0, size) - end - - alias extract_S extract_A - - def max_bytes( chunksize, ssize ) - (restsize() - '=?iso-2022-jp?B??='.size) / 4 * 3 - chunksize - end - - # - # free length buffer - # - - def add_text( str ) - @text << str - # puts '---- text -------------------------------------' - # puts "+ #{str.inspect}" - # puts "txt >>>#{@text.inspect}<<<" - end - - def add_with_encode( str ) - @text << "=?iso-2022-jp?B?#{Base64.encode(str)}?=" - end - - def add_lwsp( lwsp ) - # puts '---- lwsp -------------------------------------' - # puts "+ #{lwsp.inspect}" - fold if restsize() <= 0 - flush - @lwsp = lwsp - end - - def flush - # puts '---- flush ----' - # puts "spc >>>#{@lwsp.inspect}<<<" - # puts "txt >>>#{@text.inspect}<<<" - @f << @lwsp << @text - @curlen += (@lwsp.size + @text.size) - @text = '' - @lwsp = '' - end - - def fold - # puts '---- fold ----' - @f << @eol - @curlen = 0 - @lwsp = SPACER - end - - def restsize - MAX_LINE_LEN - (@curlen + @lwsp.size + @text.size) - end - - end - -end # module TMail -# -# facade.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -require 'tmail/utils' - - -module TMail - - class Mail - - def header_string( name, default = nil ) - h = @header[name.downcase] or return default - h.to_s - end - - ### - ### attributes - ### - - include TextUtils - - def set_string_array_attr( key, strs ) - strs.flatten! - if strs.empty? - @header.delete key.downcase - else - store key, strs.join(', ') - end - strs - end - private :set_string_array_attr - - def set_string_attr( key, str ) - if str - store key, str - else - @header.delete key.downcase - end - str - end - private :set_string_attr - - def set_addrfield( name, arg ) - if arg - h = HeaderField.internal_new(name, @config) - h.addrs.replace [arg].flatten - @header[name] = h - else - @header.delete name - end - arg - end - private :set_addrfield - - def addrs2specs( addrs ) - return nil unless addrs - list = addrs.map {|addr| - if addr.address_group? - then addr.map {|a| a.spec } - else addr.spec - end - }.flatten - return nil if list.empty? - list - end - private :addrs2specs - - - # - # date time - # - - def date( default = nil ) - if h = @header['date'] - h.date - else - default - end - end - - def date=( time ) - if time - store 'Date', time2str(time) - else - @header.delete 'date' - end - time - end - - def strftime( fmt, default = nil ) - if t = date - t.strftime(fmt) - else - default - end - end - - - # - # destination - # - - def to_addrs( default = nil ) - if h = @header['to'] - h.addrs - else - default - end - end - - def cc_addrs( default = nil ) - if h = @header['cc'] - h.addrs - else - default - end - end - - def bcc_addrs( default = nil ) - if h = @header['bcc'] - h.addrs - else - default - end - end - - def to_addrs=( arg ) - set_addrfield 'to', arg - end - - def cc_addrs=( arg ) - set_addrfield 'cc', arg - end - - def bcc_addrs=( arg ) - set_addrfield 'bcc', arg - end - - def to( default = nil ) - addrs2specs(to_addrs(nil)) || default - end - - def cc( default = nil ) - addrs2specs(cc_addrs(nil)) || default - end - - def bcc( default = nil ) - addrs2specs(bcc_addrs(nil)) || default - end - - def to=( *strs ) - set_string_array_attr 'To', strs - end - - def cc=( *strs ) - set_string_array_attr 'Cc', strs - end - - def bcc=( *strs ) - set_string_array_attr 'Bcc', strs - end - - - # - # originator - # - - def from_addrs( default = nil ) - if h = @header['from'] - h.addrs - else - default - end - end - - def from_addrs=( arg ) - set_addrfield 'from', arg - end - - def from( default = nil ) - addrs2specs(from_addrs(nil)) || default - end - - def from=( *strs ) - set_string_array_attr 'From', strs - end - - def friendly_from( default = nil ) - h = @header['from'] - a, = h.addrs - return default unless a - return a.phrase if a.phrase - return h.comments.join(' ') unless h.comments.empty? - a.spec - end - - - def reply_to_addrs( default = nil ) - if h = @header['reply-to'] - h.addrs - else - default - end - end - - def reply_to_addrs=( arg ) - set_addrfield 'reply-to', arg - end - - def reply_to( default = nil ) - addrs2specs(reply_to_addrs(nil)) || default - end - - def reply_to=( *strs ) - set_string_array_attr 'Reply-To', strs - end - - - def sender_addr( default = nil ) - f = @header['sender'] or return default - f.addr or return default - end - - def sender_addr=( addr ) - if addr - h = HeaderField.internal_new('sender', @config) - h.addr = addr - @header['sender'] = h - else - @header.delete 'sender' - end - addr - end - - def sender( default ) - f = @header['sender'] or return default - a = f.addr or return default - a.spec - end - - def sender=( str ) - set_string_attr 'Sender', str - end - - - # - # subject - # - - def subject( default = nil ) - if h = @header['subject'] - h.body - else - default - end - end - alias quoted_subject subject - - def subject=( str ) - set_string_attr 'Subject', str - end - - - # - # identity & threading - # - - def message_id( default = nil ) - if h = @header['message-id'] - h.id || default - else - default - end - end - - def message_id=( str ) - set_string_attr 'Message-Id', str - end - - def in_reply_to( default = nil ) - if h = @header['in-reply-to'] - h.ids - else - default - end - end - - def in_reply_to=( *idstrs ) - set_string_array_attr 'In-Reply-To', idstrs - end - - def references( default = nil ) - if h = @header['references'] - h.refs - else - default - end - end - - def references=( *strs ) - set_string_array_attr 'References', strs - end - - - # - # MIME headers - # - - def mime_version( default = nil ) - if h = @header['mime-version'] - h.version || default - else - default - end - end - - def mime_version=( m, opt = nil ) - if opt - if h = @header['mime-version'] - h.major = m - h.minor = opt - else - store 'Mime-Version', "#{m}.#{opt}" - end - else - store 'Mime-Version', m - end - m - end - - - def content_type( default = nil ) - if h = @header['content-type'] - h.content_type || default - else - default - end - end - - def main_type( default = nil ) - if h = @header['content-type'] - h.main_type || default - else - default - end - end - - def sub_type( default = nil ) - if h = @header['content-type'] - h.sub_type || default - else - default - end - end - - def set_content_type( str, sub = nil, param = nil ) - if sub - main, sub = str, sub - else - main, sub = str.split(%r, 2) - raise ArgumentError, "sub type missing: #{str.inspect}" unless sub - end - if h = @header['content-type'] - h.main_type = main - h.sub_type = sub - h.params.clear - else - store 'Content-Type', "#{main}/#{sub}" - end - @header['content-type'].params.replace param if param - - str - end - - alias content_type= set_content_type - - def type_param( name, default = nil ) - if h = @header['content-type'] - h[name] || default - else - default - end - end - - def charset( default = nil ) - if h = @header['content-type'] - h['charset'] or default - else - default - end - end - - def charset=( str ) - if str - if h = @header[ 'content-type' ] - h['charset'] = str - else - store 'Content-Type', "text/plain; charset=#{str}" - end - end - str - end - - - def transfer_encoding( default = nil ) - if h = @header['content-transfer-encoding'] - h.encoding || default - else - default - end - end - - def transfer_encoding=( str ) - set_string_attr 'Content-Transfer-Encoding', str - end - - alias encoding transfer_encoding - alias encoding= transfer_encoding= - alias content_transfer_encoding transfer_encoding - alias content_transfer_encoding= transfer_encoding= - - - def disposition( default = nil ) - if h = @header['content-disposition'] - h.disposition || default - else - default - end - end - - alias content_disposition disposition - - def set_disposition( str, params = nil ) - if h = @header['content-disposition'] - h.disposition = str - h.params.clear - else - store('Content-Disposition', str) - h = @header['content-disposition'] - end - h.params.replace params if params - end - - alias disposition= set_disposition - alias set_content_disposition set_disposition - alias content_disposition= set_disposition - - def disposition_param( name, default = nil ) - if h = @header['content-disposition'] - h[name] || default - else - default - end - end - - ### - ### utils - ### - - def create_reply - mail = TMail::Mail.parse('') - mail.subject = 'Re: ' + subject('').sub(/\A(?:\[[^\]]+\])?(?:\s*Re:)*\s*/i, '') - mail.to_addrs = reply_addresses([]) - mail.in_reply_to = [message_id(nil)].compact - mail.references = references([]) + [message_id(nil)].compact - mail.mime_version = '1.0' - mail - end - - - def base64_encode - store 'Content-Transfer-Encoding', 'Base64' - self.body = Base64.folding_encode(self.body) - end - - def base64_decode - if /base64/i === self.transfer_encoding('') - store 'Content-Transfer-Encoding', '8bit' - self.body = Base64.decode(self.body, @config.strict_base64decode?) - end - end - - - def destinations( default = nil ) - ret = [] - %w( to cc bcc ).each do |nm| - if h = @header[nm] - h.addrs.each {|i| ret.push i.address } - end - end - ret.empty? ? default : ret - end - - def each_destination( &block ) - destinations([]).each do |i| - if Address === i - yield i - else - i.each(&block) - end - end - end - - alias each_dest each_destination - - - def reply_addresses( default = nil ) - reply_to_addrs(nil) or from_addrs(nil) or default - end - - def error_reply_addresses( default = nil ) - if s = sender(nil) - [s] - else - from_addrs(default) - end - end - - - def multipart? - main_type('').downcase == 'multipart' - end - - end # class Mail - -end # module TMail -# -# header.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -require 'tmail/encode' -require 'tmail/address' -require 'tmail/parser' -require 'tmail/config' -require 'tmail/utils' - - -module TMail - - class HeaderField - - include TextUtils - - class << self - - alias newobj new - - def new( name, body, conf = DEFAULT_CONFIG ) - klass = FNAME_TO_CLASS[name.downcase] || UnstructuredHeader - klass.newobj body, conf - end - - def new_from_port( port, name, conf = DEFAULT_CONFIG ) - re = Regep.new('\A(' + Regexp.quote(name) + '):', 'i') - str = nil - port.ropen {|f| - f.each do |line| - if m = re.match(line) then str = m.post_match.strip - elsif str and /\A[\t ]/ === line then str << ' ' << line.strip - elsif /\A-*\s*\z/ === line then break - elsif str then break - end - end - } - new(name, str, Config.to_config(conf)) - end - - def internal_new( name, conf ) - FNAME_TO_CLASS[name].newobj('', conf, true) - end - - end # class << self - - def initialize( body, conf, intern = false ) - @body = body - @config = conf - - @illegal = false - @parsed = false - if intern - @parsed = true - parse_init - end - end - - def inspect - "#<#{self.class} #{@body.inspect}>" - end - - def illegal? - @illegal - end - - def empty? - ensure_parsed - return true if @illegal - isempty? - end - - private - - def ensure_parsed - return if @parsed - @parsed = true - parse - end - - # defabstract parse - # end - - def clear_parse_status - @parsed = false - @illegal = false - end - - public - - def body - ensure_parsed - v = Decoder.new(s = '') - do_accept v - v.terminate - s - end - - def body=( str ) - @body = str - clear_parse_status - end - - include StrategyInterface - - def accept( strategy, dummy1 = nil, dummy2 = nil ) - ensure_parsed - do_accept strategy - strategy.terminate - end - - # abstract do_accept - - end - - - class UnstructuredHeader < HeaderField - - def body - ensure_parsed - @body - end - - def body=( arg ) - ensure_parsed - @body = arg - end - - private - - def parse_init - end - - def parse - @body = Decoder.decode(@body.gsub(/\n|\r\n|\r/, '')) - end - - def isempty? - not @body - end - - def do_accept( strategy ) - strategy.text @body - end - - end - - - class StructuredHeader < HeaderField - - def comments - ensure_parsed - @comments - end - - private - - def parse - save = nil - - begin - parse_init - do_parse - rescue SyntaxError - if not save and mime_encoded? @body - save = @body - @body = Decoder.decode(save) - retry - elsif save - @body = save - end - - @illegal = true - raise if @config.strict_parse? - end - end - - def parse_init - @comments = [] - init - end - - def do_parse - obj = Parser.parse(self.class::PARSE_TYPE, @body, @comments) - set obj if obj - end - - end - - - class DateTimeHeader < StructuredHeader - - PARSE_TYPE = :DATETIME - - def date - ensure_parsed - @date - end - - def date=( arg ) - ensure_parsed - @date = arg - end - - private - - def init - @date = nil - end - - def set( t ) - @date = t - end - - def isempty? - not @date - end - - def do_accept( strategy ) - strategy.meta time2str(@date) - end - - end - - - class AddressHeader < StructuredHeader - - PARSE_TYPE = :MADDRESS - - def addrs - ensure_parsed - @addrs - end - - private - - def init - @addrs = [] - end - - def set( a ) - @addrs = a - end - - def isempty? - @addrs.empty? - end - - def do_accept( strategy ) - first = true - @addrs.each do |a| - if first - first = false - else - strategy.meta ',' - strategy.space - end - a.accept strategy - end - - @comments.each do |c| - strategy.space - strategy.meta '(' - strategy.text c - strategy.meta ')' - end - end - - end - - - class ReturnPathHeader < AddressHeader - - PARSE_TYPE = :RETPATH - - def addr - addrs()[0] - end - - def spec - a = addr() or return nil - a.spec - end - - def routes - a = addr() or return nil - a.routes - end - - private - - def do_accept( strategy ) - a = addr() - - strategy.meta '<' - unless a.routes.empty? - strategy.meta a.routes.map {|i| '@' + i }.join(',') - strategy.meta ':' - end - spec = a.spec - strategy.meta spec if spec - strategy.meta '>' - end - - end - - - class SingleAddressHeader < AddressHeader - - def addr - addrs()[0] - end - - private - - def do_accept( strategy ) - a = addr() - a.accept strategy - @comments.each do |c| - strategy.space - strategy.meta '(' - strategy.text c - strategy.meta ')' - end - end - - end - - - class MessageIdHeader < StructuredHeader - - def id - ensure_parsed - @id - end - - def id=( arg ) - ensure_parsed - @id = arg - end - - private - - def init - @id = nil - end - - def isempty? - not @id - end - - def do_parse - @id = @body.slice(MESSAGE_ID) or - raise SyntaxError, "wrong Message-ID format: #{@body}" - end - - def do_accept( strategy ) - strategy.meta @id - end - - end - - - class ReferencesHeader < StructuredHeader - - def refs - ensure_parsed - @refs - end - - def each_id - self.refs.each do |i| - yield i if MESSAGE_ID === i - end - end - - def ids - ensure_parsed - @ids - end - - def each_phrase - self.refs.each do |i| - yield i unless MESSAGE_ID === i - end - end - - def phrases - ret = [] - each_phrase {|i| ret.push i } - ret - end - - private - - def init - @refs = [] - @ids = [] - end - - def isempty? - @ids.empty? - end - - def do_parse - str = @body - while m = MESSAGE_ID.match(str) - pre = m.pre_match.strip - @refs.push pre unless pre.empty? - @refs.push s = m[0] - @ids.push s - str = m.post_match - end - str = str.strip - @refs.push str unless str.empty? - end - - def do_accept( strategy ) - first = true - @ids.each do |i| - if first - first = false - else - strategy.space - end - strategy.meta i - end - end - - end - - - class ReceivedHeader < StructuredHeader - - PARSE_TYPE = :RECEIVED - - def from - ensure_parsed - @from - end - - def from=( arg ) - ensure_parsed - @from = arg - end - - def by - ensure_parsed - @by - end - - def by=( arg ) - ensure_parsed - @by = arg - end - - def via - ensure_parsed - @via - end - - def via=( arg ) - ensure_parsed - @via = arg - end - - def with - ensure_parsed - @with - end - - def id - ensure_parsed - @id - end - - def id=( arg ) - ensure_parsed - @id = arg - end - - def _for - ensure_parsed - @_for - end - - def _for=( arg ) - ensure_parsed - @_for = arg - end - - def date - ensure_parsed - @date - end - - def date=( arg ) - ensure_parsed - @date = arg - end - - private - - def init - @from = @by = @via = @with = @id = @_for = nil - @with = [] - @date = nil - end - - def set( args ) - @from, @by, @via, @with, @id, @_for, @date = *args - end - - def isempty? - @with.empty? and not (@from or @by or @via or @id or @_for or @date) - end - - def do_accept( strategy ) - list = [] - list.push 'from ' + @from if @from - list.push 'by ' + @by if @by - list.push 'via ' + @via if @via - @with.each do |i| - list.push 'with ' + i - end - list.push 'id ' + @id if @id - list.push 'for <' + @_for + '>' if @_for - - first = true - list.each do |i| - strategy.space unless first - strategy.meta i - first = false - end - if @date - strategy.meta ';' - strategy.space - strategy.meta time2str(@date) - end - end - - end - - - class KeywordsHeader < StructuredHeader - - PARSE_TYPE = :KEYWORDS - - def keys - ensure_parsed - @keys - end - - private - - def init - @keys = [] - end - - def set( a ) - @keys = a - end - - def isempty? - @keys.empty? - end - - def do_accept( strategy ) - first = true - @keys.each do |i| - if first - first = false - else - strategy.meta ',' - end - strategy.meta i - end - end - - end - - - class EncryptedHeader < StructuredHeader - - PARSE_TYPE = :ENCRYPTED - - def encrypter - ensure_parsed - @encrypter - end - - def encrypter=( arg ) - ensure_parsed - @encrypter = arg - end - - def keyword - ensure_parsed - @keyword - end - - def keyword=( arg ) - ensure_parsed - @keyword = arg - end - - private - - def init - @encrypter = nil - @keyword = nil - end - - def set( args ) - @encrypter, @keyword = args - end - - def isempty? - not (@encrypter or @keyword) - end - - def do_accept( strategy ) - if @key - strategy.meta @encrypter + ',' - strategy.space - strategy.meta @keyword - else - strategy.meta @encrypter - end - end - - end - - - class MimeVersionHeader < StructuredHeader - - PARSE_TYPE = :MIMEVERSION - - def major - ensure_parsed - @major - end - - def major=( arg ) - ensure_parsed - @major = arg - end - - def minor - ensure_parsed - @minor - end - - def minor=( arg ) - ensure_parsed - @minor = arg - end - - def version - sprintf('%d.%d', major, minor) - end - - private - - def init - @major = nil - @minor = nil - end - - def set( args ) - @major, @minor = *args - end - - def isempty? - not (@major or @minor) - end - - def do_accept( strategy ) - strategy.meta sprintf('%d.%d', @major, @minor) - end - - end - - - class ContentTypeHeader < StructuredHeader - - PARSE_TYPE = :CTYPE - - def main_type - ensure_parsed - @main - end - - def main_type=( arg ) - ensure_parsed - @main = arg.downcase - end - - def sub_type - ensure_parsed - @sub - end - - def sub_type=( arg ) - ensure_parsed - @sub = arg.downcase - end - - def content_type - ensure_parsed - @sub ? sprintf('%s/%s', @main, @sub) : @main - end - - def params - ensure_parsed - @params - end - - def []( key ) - ensure_parsed - @params and @params[key] - end - - def []=( key, val ) - ensure_parsed - (@params ||= {})[key] = val - end - - private - - def init - @main = @sub = @params = nil - end - - def set( args ) - @main, @sub, @params = *args - end - - def isempty? - not (@main or @sub) - end - - def do_accept( strategy ) - if @sub - strategy.meta sprintf('%s/%s', @main, @sub) - else - strategy.meta @main - end - @params.each do |k,v| - if v - strategy.meta ';' - strategy.space - strategy.kv_pair k, v - end - end - end - - end - - - class ContentTransferEncodingHeader < StructuredHeader - - PARSE_TYPE = :CENCODING - - def encoding - ensure_parsed - @encoding - end - - def encoding=( arg ) - ensure_parsed - @encoding = arg - end - - private - - def init - @encoding = nil - end - - def set( s ) - @encoding = s - end - - def isempty? - not @encoding - end - - def do_accept( strategy ) - strategy.meta @encoding.capitalize - end - - end - - - class ContentDispositionHeader < StructuredHeader - - PARSE_TYPE = :CDISPOSITION - - def disposition - ensure_parsed - @disposition - end - - def disposition=( str ) - ensure_parsed - @disposition = str.downcase - end - - def params - ensure_parsed - @params - end - - def []( key ) - ensure_parsed - @params and @params[key] - end - - def []=( key, val ) - ensure_parsed - (@params ||= {})[key] = val - end - - private - - def init - @disposition = @params = nil - end - - def set( args ) - @disposition, @params = *args - end - - def isempty? - not @disposition and (not @params or @params.empty?) - end - - def do_accept( strategy ) - strategy.meta @disposition - @params.each do |k,v| - strategy.meta ';' - strategy.space - strategy.kv_pair k, v - end - end - - end - - - class HeaderField # redefine - - FNAME_TO_CLASS = { - 'date' => DateTimeHeader, - 'resent-date' => DateTimeHeader, - 'to' => AddressHeader, - 'cc' => AddressHeader, - 'bcc' => AddressHeader, - 'from' => AddressHeader, - 'reply-to' => AddressHeader, - 'resent-to' => AddressHeader, - 'resent-cc' => AddressHeader, - 'resent-bcc' => AddressHeader, - 'resent-from' => AddressHeader, - 'resent-reply-to' => AddressHeader, - 'sender' => SingleAddressHeader, - 'resent-sender' => SingleAddressHeader, - 'return-path' => ReturnPathHeader, - 'message-id' => MessageIdHeader, - 'resent-message-id' => MessageIdHeader, - 'in-reply-to' => ReferencesHeader, - 'received' => ReceivedHeader, - 'references' => ReferencesHeader, - 'keywords' => KeywordsHeader, - 'encrypted' => EncryptedHeader, - 'mime-version' => MimeVersionHeader, - 'content-type' => ContentTypeHeader, - 'content-transfer-encoding' => ContentTransferEncodingHeader, - 'content-disposition' => ContentDispositionHeader, - 'content-id' => MessageIdHeader, - 'subject' => UnstructuredHeader, - 'comments' => UnstructuredHeader, - 'content-description' => UnstructuredHeader - } - - end - -end # module TMail -# -# info.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -module TMail - - Version = '0.10.7' - Copyright = 'Copyright (c) 1998-2002 Minero Aoki' - -end -require 'tmail/mailbox' -# -# mail.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -require 'tmail/facade' -require 'tmail/encode' -require 'tmail/header' -require 'tmail/port' -require 'tmail/config' -require 'tmail/utils' -require 'tmail/attachments' -require 'tmail/quoting' -require 'socket' - - -module TMail - - class Mail - - class << self - def load( fname ) - new(FilePort.new(fname)) - end - - alias load_from load - alias loadfrom load - - def parse( str ) - new(StringPort.new(str)) - end - end - - def initialize( port = nil, conf = DEFAULT_CONFIG ) - @port = port || StringPort.new - @config = Config.to_config(conf) - - @header = {} - @body_port = nil - @body_parsed = false - @epilogue = '' - @parts = [] - - @port.ropen {|f| - parse_header f - parse_body f unless @port.reproducible? - } - end - - attr_reader :port - - def inspect - "\#<#{self.class} port=#{@port.inspect} bodyport=#{@body_port.inspect}>" - end - - # - # to_s interfaces - # - - public - - include StrategyInterface - - def write_back( eol = "\n", charset = 'e' ) - parse_body - @port.wopen {|stream| encoded eol, charset, stream } - end - - def accept( strategy ) - with_multipart_encoding(strategy) { - ordered_each do |name, field| - next if field.empty? - strategy.header_name canonical(name) - field.accept strategy - strategy.puts - end - strategy.puts - body_port().ropen {|r| - strategy.write r.read - } - } - end - - private - - def canonical( name ) - name.split(/-/).map {|s| s.capitalize }.join('-') - end - - def with_multipart_encoding( strategy ) - if parts().empty? # DO NOT USE @parts - yield - - else - bound = ::TMail.new_boundary - if @header.key? 'content-type' - @header['content-type'].params['boundary'] = bound - else - store 'Content-Type', % - end - - yield - - parts().each do |tm| - strategy.puts - strategy.puts '--' + bound - tm.accept strategy - end - strategy.puts - strategy.puts '--' + bound + '--' - strategy.write epilogue() - end - end - - ### - ### header - ### - - public - - ALLOW_MULTIPLE = { - 'received' => true, - 'resent-date' => true, - 'resent-from' => true, - 'resent-sender' => true, - 'resent-to' => true, - 'resent-cc' => true, - 'resent-bcc' => true, - 'resent-message-id' => true, - 'comments' => true, - 'keywords' => true - } - USE_ARRAY = ALLOW_MULTIPLE - - def header - @header.dup - end - - def []( key ) - @header[key.downcase] - end - - def sub_header(key, param) - (hdr = self[key]) ? hdr[param] : nil - end - - alias fetch [] - - def []=( key, val ) - dkey = key.downcase - - if val.nil? - @header.delete dkey - return nil - end - - case val - when String - header = new_hf(key, val) - when HeaderField - ; - when Array - ALLOW_MULTIPLE.include? dkey or - raise ArgumentError, "#{key}: Header must not be multiple" - @header[dkey] = val - return val - else - header = new_hf(key, val.to_s) - end - if ALLOW_MULTIPLE.include? dkey - (@header[dkey] ||= []).push header - else - @header[dkey] = header - end - - val - end - - alias store []= - - def each_header - @header.each do |key, val| - [val].flatten.each {|v| yield key, v } - end - end - - alias each_pair each_header - - def each_header_name( &block ) - @header.each_key(&block) - end - - alias each_key each_header_name - - def each_field( &block ) - @header.values.flatten.each(&block) - end - - alias each_value each_field - - FIELD_ORDER = %w( - return-path received - resent-date resent-from resent-sender resent-to - resent-cc resent-bcc resent-message-id - date from sender reply-to to cc bcc - message-id in-reply-to references - subject comments keywords - mime-version content-type content-transfer-encoding - content-disposition content-description - ) - - def ordered_each - list = @header.keys - FIELD_ORDER.each do |name| - if list.delete(name) - [@header[name]].flatten.each {|v| yield name, v } - end - end - list.each do |name| - [@header[name]].flatten.each {|v| yield name, v } - end - end - - def clear - @header.clear - end - - def delete( key ) - @header.delete key.downcase - end - - def delete_if - @header.delete_if do |key,val| - if Array === val - val.delete_if {|v| yield key, v } - val.empty? - else - yield key, val - end - end - end - - def keys - @header.keys - end - - def key?( key ) - @header.key? key.downcase - end - - def values_at( *args ) - args.map {|k| @header[k.downcase] }.flatten - end - - alias indexes values_at - alias indices values_at - - private - - def parse_header( f ) - name = field = nil - unixfrom = nil - - while line = f.gets - case line - when /\A[ \t]/ # continue from prev line - raise SyntaxError, 'mail is began by space' unless field - field << ' ' << line.strip - - when /\A([^\: \t]+):\s*/ # new header line - add_hf name, field if field - name = $1 - field = $' #.strip - - when /\A\-*\s*\z/ # end of header - add_hf name, field if field - name = field = nil - break - - when /\AFrom (\S+)/ - unixfrom = $1 - - when /^charset=.*/ - - else - raise SyntaxError, "wrong mail header: '#{line.inspect}'" - end - end - add_hf name, field if name - - if unixfrom - add_hf 'Return-Path', "<#{unixfrom}>" unless @header['return-path'] - end - end - - def add_hf( name, field ) - key = name.downcase - field = new_hf(name, field) - - if ALLOW_MULTIPLE.include? key - (@header[key] ||= []).push field - else - @header[key] = field - end - end - - def new_hf( name, field ) - HeaderField.new(name, field, @config) - end - - ### - ### body - ### - - public - - def body_port - parse_body - @body_port - end - - def each( &block ) - body_port().ropen {|f| f.each(&block) } - end - - def quoted_body - parse_body - @body_port.ropen {|f| - return f.read - } - end - - def body=( str ) - parse_body - @body_port.wopen {|f| f.write str } - str - end - - alias preamble body - alias preamble= body= - - def epilogue - parse_body - @epilogue.dup - end - - def epilogue=( str ) - parse_body - @epilogue = str - str - end - - def parts - parse_body - @parts - end - - def each_part( &block ) - parts().each(&block) - end - - private - - def parse_body( f = nil ) - return if @body_parsed - if f - parse_body_0 f - else - @port.ropen {|f| - skip_header f - parse_body_0 f - } - end - @body_parsed = true - end - - def skip_header( f ) - while line = f.gets - return if /\A[\r\n]*\z/ === line - end - end - - def parse_body_0( f ) - if multipart? - read_multipart f - else - @body_port = @config.new_body_port(self) - @body_port.wopen {|w| - w.write f.read - } - end - end - - def read_multipart( src ) - bound = @header['content-type'].params['boundary'] - is_sep = /\A--#{Regexp.quote bound}(?:--)?[ \t]*(?:\n|\r\n|\r)/ - lastbound = "--#{bound}--" - - ports = [ @config.new_preamble_port(self) ] - begin - f = ports.last.wopen - while line = src.gets - if is_sep === line - f.close - break if line.strip == lastbound - ports.push @config.new_part_port(self) - f = ports.last.wopen - else - f << line - end - end - @epilogue = (src.read || '') - ensure - f.close if f and not f.closed? - end - - @body_port = ports.shift - @parts = ports.map {|p| self.class.new(p, @config) } - end - - end # class Mail - -end # module TMail -# -# mailbox.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -require 'tmail/port' -require 'socket' -require 'mutex_m' - - -unless [].respond_to?(:sort_by) -module Enumerable#:nodoc: - def sort_by - map {|i| [yield(i), i] }.sort {|a,b| a.first <=> b.first }.map {|i| i[1] } - end -end -end - - -module TMail - - class MhMailbox - - PORT_CLASS = MhPort - - def initialize( dir ) - edir = File.expand_path(dir) - raise ArgumentError, "not directory: #{dir}"\ - unless FileTest.directory? edir - @dirname = edir - @last_file = nil - @last_atime = nil - end - - def directory - @dirname - end - - alias dirname directory - - attr_accessor :last_atime - - def inspect - "#<#{self.class} #{@dirname}>" - end - - def close - end - - def new_port - PORT_CLASS.new(next_file_name()) - end - - def each_port - mail_files().each do |path| - yield PORT_CLASS.new(path) - end - @last_atime = Time.now - end - - alias each each_port - - def reverse_each_port - mail_files().reverse_each do |path| - yield PORT_CLASS.new(path) - end - @last_atime = Time.now - end - - alias reverse_each reverse_each_port - - # old #each_mail returns Port - #def each_mail - # each_port do |port| - # yield Mail.new(port) - # end - #end - - def each_new_port( mtime = nil, &block ) - mtime ||= @last_atime - return each_port(&block) unless mtime - return unless File.mtime(@dirname) >= mtime - - mail_files().each do |path| - yield PORT_CLASS.new(path) if File.mtime(path) > mtime - end - @last_atime = Time.now - end - - private - - def mail_files - Dir.entries(@dirname)\ - .select {|s| /\A\d+\z/ === s }\ - .map {|s| s.to_i }\ - .sort\ - .map {|i| "#{@dirname}/#{i}" }\ - .select {|path| FileTest.file? path } - end - - def next_file_name - unless n = @last_file - n = 0 - Dir.entries(@dirname)\ - .select {|s| /\A\d+\z/ === s }\ - .map {|s| s.to_i }.sort\ - .each do |i| - next unless FileTest.file? "#{@dirname}/#{i}" - n = i - end - end - begin - n += 1 - end while FileTest.exist? "#{@dirname}/#{n}" - @last_file = n - - "#{@dirname}/#{n}" - end - - end # MhMailbox - - MhLoader = MhMailbox - - - class UNIXMbox - - def UNIXMbox.lock( fname ) - begin - f = File.open(fname) - f.flock File::LOCK_EX - yield f - ensure - f.flock File::LOCK_UN - f.close if f and not f.closed? - end - end - - class << self - alias newobj new - end - - def UNIXMbox.new( fname, tmpdir = nil, readonly = false ) - tmpdir = ENV['TEMP'] || ENV['TMP'] || '/tmp' - newobj(fname, "#{tmpdir}/ruby_tmail_#{$$}_#{rand()}", readonly, false) - end - - def UNIXMbox.static_new( fname, dir, readonly = false ) - newobj(fname, dir, readonly, true) - end - - def initialize( fname, mhdir, readonly, static ) - @filename = fname - @readonly = readonly - @closed = false - - Dir.mkdir mhdir - @real = MhMailbox.new(mhdir) - @finalizer = UNIXMbox.mkfinal(@real, @filename, !@readonly, !static) - ObjectSpace.define_finalizer self, @finalizer - end - - def UNIXMbox.mkfinal( mh, mboxfile, writeback_p, cleanup_p ) - lambda { - if writeback_p - lock(mboxfile) {|f| - mh.each_port do |port| - f.puts create_from_line(port) - port.ropen {|r| - f.puts r.read - } - end - } - end - if cleanup_p - Dir.foreach(mh.dirname) do |fname| - next if /\A\.\.?\z/ === fname - File.unlink "#{mh.dirname}/#{fname}" - end - Dir.rmdir mh.dirname - end - } - end - - # make _From line - def UNIXMbox.create_from_line( port ) - sprintf 'From %s %s', - fromaddr(), TextUtils.time2str(File.mtime(port.filename)) - end - - def UNIXMbox.fromaddr - h = HeaderField.new_from_port(port, 'Return-Path') || - HeaderField.new_from_port(port, 'From') or return 'nobody' - a = h.addrs[0] or return 'nobody' - a.spec - end - private_class_method :fromaddr - - def close - return if @closed - - ObjectSpace.undefine_finalizer self - @finalizer.call - @finalizer = nil - @real = nil - @closed = true - @updated = nil - end - - def each_port( &block ) - close_check - update - @real.each_port(&block) - end - - alias each each_port - - def reverse_each_port( &block ) - close_check - update - @real.reverse_each_port(&block) - end - - alias reverse_each reverse_each_port - - # old #each_mail returns Port - #def each_mail( &block ) - # each_port do |port| - # yield Mail.new(port) - # end - #end - - def each_new_port( mtime = nil ) - close_check - update - @real.each_new_port(mtime) {|p| yield p } - end - - def new_port - close_check - @real.new_port - end - - private - - def close_check - @closed and raise ArgumentError, 'accessing already closed mbox' - end - - def update - return if FileTest.zero?(@filename) - return if @updated and File.mtime(@filename) < @updated - w = nil - port = nil - time = nil - UNIXMbox.lock(@filename) {|f| - begin - f.each do |line| - if /\AFrom / === line - w.close if w - File.utime time, time, port.filename if time - - port = @real.new_port - w = port.wopen - time = fromline2time(line) - else - w.print line if w - end - end - ensure - if w and not w.closed? - w.close - File.utime time, time, port.filename if time - end - end - f.truncate(0) unless @readonly - @updated = Time.now - } - end - - def fromline2time( line ) - m = /\AFrom \S+ \w+ (\w+) (\d+) (\d+):(\d+):(\d+) (\d+)/.match(line) \ - or return nil - Time.local(m[6].to_i, m[1], m[2].to_i, m[3].to_i, m[4].to_i, m[5].to_i) - end - - end # UNIXMbox - - MboxLoader = UNIXMbox - - - class Maildir - - extend Mutex_m - - PORT_CLASS = MaildirPort - - @seq = 0 - def Maildir.unique_number - synchronize { - @seq += 1 - return @seq - } - end - - def initialize( dir = nil ) - @dirname = dir || ENV['MAILDIR'] - raise ArgumentError, "not directory: #{@dirname}"\ - unless FileTest.directory? @dirname - @new = "#{@dirname}/new" - @tmp = "#{@dirname}/tmp" - @cur = "#{@dirname}/cur" - end - - def directory - @dirname - end - - def inspect - "#<#{self.class} #{@dirname}>" - end - - def close - end - - def each_port - mail_files(@cur).each do |path| - yield PORT_CLASS.new(path) - end - end - - alias each each_port - - def reverse_each_port - mail_files(@cur).reverse_each do |path| - yield PORT_CLASS.new(path) - end - end - - alias reverse_each reverse_each_port - - def new_port - fname = nil - tmpfname = nil - newfname = nil - - begin - fname = "#{Time.now.to_i}.#{$$}_#{Maildir.unique_number}.#{Socket.gethostname}" - - tmpfname = "#{@tmp}/#{fname}" - newfname = "#{@new}/#{fname}" - end while FileTest.exist? tmpfname - - if block_given? - File.open(tmpfname, 'w') {|f| yield f } - File.rename tmpfname, newfname - PORT_CLASS.new(newfname) - else - File.open(tmpfname, 'w') {|f| f.write "\n\n" } - PORT_CLASS.new(tmpfname) - end - end - - def each_new_port - mail_files(@new).each do |path| - dest = @cur + '/' + File.basename(path) - File.rename path, dest - yield PORT_CLASS.new(dest) - end - - check_tmp - end - - TOO_OLD = 60 * 60 * 36 # 36 hour - - def check_tmp - old = Time.now.to_i - TOO_OLD - - each_filename(@tmp) do |full, fname| - if FileTest.file? full and - File.stat(full).mtime.to_i < old - File.unlink full - end - end - end - - private - - def mail_files( dir ) - Dir.entries(dir)\ - .select {|s| s[0] != ?. }\ - .sort_by {|s| s.slice(/\A\d+/).to_i }\ - .map {|s| "#{dir}/#{s}" }\ - .select {|path| FileTest.file? path } - end - - def each_filename( dir ) - Dir.foreach(dir) do |fname| - path = "#{dir}/#{fname}" - if fname[0] != ?. and FileTest.file? path - yield path, fname - end - end - end - - end # Maildir - - MaildirLoader = Maildir - -end # module TMail -require 'tmail/mailbox' -# -# net.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -require 'nkf' - - -module TMail - - class Mail - - def send_to( smtp ) - do_send_to(smtp) do - ready_to_send - end - end - - def send_text_to( smtp ) - do_send_to(smtp) do - ready_to_send - mime_encode - end - end - - def do_send_to( smtp ) - from = from_address or raise ArgumentError, 'no from address' - (dests = destinations).empty? and raise ArgumentError, 'no receipient' - yield - send_to_0 smtp, from, dests - end - private :do_send_to - - def send_to_0( smtp, from, to ) - smtp.ready(from, to) do |f| - encoded "\r\n", 'j', f, '' - end - end - - def ready_to_send - delete_no_send_fields - add_message_id - add_date - end - - NOSEND_FIELDS = %w( - received - bcc - ) - - def delete_no_send_fields - NOSEND_FIELDS.each do |nm| - delete nm - end - delete_if {|n,v| v.empty? } - end - - def add_message_id( fqdn = nil ) - self.message_id = ::TMail::new_message_id(fqdn) - end - - def add_date - self.date = Time.now - end - - def mime_encode - if parts.empty? - mime_encode_singlepart - else - mime_encode_multipart true - end - end - - def mime_encode_singlepart - self.mime_version = '1.0' - b = body - if NKF.guess(b) != NKF::BINARY - mime_encode_text b - else - mime_encode_binary b - end - end - - def mime_encode_text( body ) - self.body = NKF.nkf('-j -m0', body) - self.set_content_type 'text', 'plain', {'charset' => 'iso-2022-jp'} - self.encoding = '7bit' - end - - def mime_encode_binary( body ) - self.body = [body].pack('m') - self.set_content_type 'application', 'octet-stream' - self.encoding = 'Base64' - end - - def mime_encode_multipart( top = true ) - self.mime_version = '1.0' if top - self.set_content_type 'multipart', 'mixed' - e = encoding(nil) - if e and not /\A(?:7bit|8bit|binary)\z/i === e - raise ArgumentError, - 'using C.T.Encoding with multipart mail is not permitted' - end - end - - def create_empty_mail - self.class.new(StringPort.new(''), @config) - end - - def create_reply - setup_reply create_empty_mail() - end - - def setup_reply( m ) - if tmp = reply_addresses(nil) - m.to_addrs = tmp - end - - mid = message_id(nil) - tmp = references(nil) || [] - tmp.push mid if mid - m.in_reply_to = [mid] if mid - m.references = tmp unless tmp.empty? - m.subject = 'Re: ' + subject('').sub(/\A(?:\s*re:)+/i, '') - - m - end - - def create_forward - setup_forward create_empty_mail() - end - - def setup_forward( mail ) - m = Mail.new(StringPort.new('')) - m.body = decoded - m.set_content_type 'message', 'rfc822' - m.encoding = encoding('7bit') - mail.parts.push m - end - - end - - - class DeleteFields - - NOSEND_FIELDS = %w( - received - bcc - ) - - def initialize( nosend = nil, delempty = true ) - @no_send_fields = nosend || NOSEND_FIELDS.dup - @delete_empty_fields = delempty - end - - attr :no_send_fields - attr :delete_empty_fields, true - - def exec( mail ) - @no_send_fields.each do |nm| - delete nm - end - delete_if {|n,v| v.empty? } if @delete_empty_fields - end - - end - - - class AddMessageId - - def initialize( fqdn = nil ) - @fqdn = fqdn - end - - attr :fqdn, true - - def exec( mail ) - mail.message_id = ::TMail::new_msgid(@fqdn) - end - - end - - - class AddDate - - def exec( mail ) - mail.date = Time.now - end - - end - - - class MimeEncodeAuto - - def initialize( s = nil, m = nil ) - @singlepart_composer = s || MimeEncodeSingle.new - @multipart_composer = m || MimeEncodeMulti.new - end - - attr :singlepart_composer - attr :multipart_composer - - def exec( mail ) - if mail._builtin_multipart? - then @multipart_composer - else @singlepart_composer end.exec mail - end - - end - - - class MimeEncodeSingle - - def exec( mail ) - mail.mime_version = '1.0' - b = mail.body - if NKF.guess(b) != NKF::BINARY - on_text b - else - on_binary b - end - end - - def on_text( body ) - mail.body = NKF.nkf('-j -m0', body) - mail.set_content_type 'text', 'plain', {'charset' => 'iso-2022-jp'} - mail.encoding = '7bit' - end - - def on_binary( body ) - mail.body = [body].pack('m') - mail.set_content_type 'application', 'octet-stream' - mail.encoding = 'Base64' - end - - end - - - class MimeEncodeMulti - - def exec( mail, top = true ) - mail.mime_version = '1.0' if top - mail.set_content_type 'multipart', 'mixed' - e = encoding(nil) - if e and not /\A(?:7bit|8bit|binary)\z/i === e - raise ArgumentError, - 'using C.T.Encoding with multipart mail is not permitted' - end - mail.parts.each do |m| - exec m, false if m._builtin_multipart? - end - end - - end - -end # module TMail -# -# obsolete.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -module TMail - - # mail.rb - class Mail - alias include? key? - alias has_key? key? - - def values - ret = [] - each_field {|v| ret.push v } - ret - end - - def value?( val ) - HeaderField === val or return false - - [ @header[val.name.downcase] ].flatten.include? val - end - - alias has_value? value? - end - - - # facade.rb - class Mail - def from_addr( default = nil ) - addr, = from_addrs(nil) - addr || default - end - - def from_address( default = nil ) - if a = from_addr(nil) - a.spec - else - default - end - end - - alias from_address= from_addrs= - - def from_phrase( default = nil ) - if a = from_addr(nil) - a.phrase - else - default - end - end - - alias msgid message_id - alias msgid= message_id= - - alias each_dest each_destination - end - - - # address.rb - class Address - alias route routes - alias addr spec - - def spec=( str ) - @local, @domain = str.split(/@/,2).map {|s| s.split(/\./) } - end - - alias addr= spec= - alias address= spec= - end - - - # mbox.rb - class MhMailbox - alias new_mail new_port - alias each_mail each_port - alias each_newmail each_new_port - end - class UNIXMbox - alias new_mail new_port - alias each_mail each_port - alias each_newmail each_new_port - end - class Maildir - alias new_mail new_port - alias each_mail each_port - alias each_newmail each_new_port - end - - - # utils.rb - extend TextUtils - - class << self - alias msgid? message_id? - alias boundary new_boundary - alias msgid new_message_id - alias new_msgid new_message_id - end - - def Mail.boundary - ::TMail.new_boundary - end - - def Mail.msgid - ::TMail.new_message_id - end - -end # module TMail -# -# DO NOT MODIFY!!!! -# This file is automatically generated by racc 1.4.3 -# from racc grammer file "parser.y". -# -# -# parser.rb: generated by racc (runtime embedded) -# - -###### racc/parser.rb - -unless $".index 'racc/parser.rb' -$".push 'racc/parser.rb' - -self.class.module_eval <<'..end /home/aamine/lib/ruby/racc/parser.rb modeval..idb76f2e220d', '/home/aamine/lib/ruby/racc/parser.rb', 1 -# -# parser.rb -# -# Copyright (c) 1999-2003 Minero Aoki -# -# This program is free software. -# You can distribute/modify this program under the same terms of ruby. -# -# As a special exception, when this code is copied by Racc -# into a Racc output file, you may use that output file -# without restriction. -# -# $Id: parser.rb,v 1.1.1.1 2004/10/14 11:59:58 webster132 Exp $ -# - -unless defined? NotImplementedError - NotImplementedError = NotImplementError -end - - -module Racc - class ParseError < StandardError; end -end -unless defined?(::ParseError) - ParseError = Racc::ParseError -end - - -module Racc - - unless defined? Racc_No_Extentions - Racc_No_Extentions = false - end - - class Parser - - Racc_Runtime_Version = '1.4.3' - Racc_Runtime_Revision = '$Revision: 1.1.1.1 $'.split(/\s+/)[1] - - Racc_Runtime_Core_Version_R = '1.4.3' - Racc_Runtime_Core_Revision_R = '$Revision: 1.1.1.1 $'.split(/\s+/)[1] - begin - require 'racc/cparse' - # Racc_Runtime_Core_Version_C = (defined in extention) - Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split(/\s+/)[2] - unless new.respond_to?(:_racc_do_parse_c, true) - raise LoadError, 'old cparse.so' - end - if Racc_No_Extentions - raise LoadError, 'selecting ruby version of racc runtime core' - end - - Racc_Main_Parsing_Routine = :_racc_do_parse_c - Racc_YY_Parse_Method = :_racc_yyparse_c - Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C - Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_C - Racc_Runtime_Type = 'c' - rescue LoadError - Racc_Main_Parsing_Routine = :_racc_do_parse_rb - Racc_YY_Parse_Method = :_racc_yyparse_rb - Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R - Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_R - Racc_Runtime_Type = 'ruby' - end - - def self.racc_runtime_type - Racc_Runtime_Type - end - - private - - def _racc_setup - @yydebug = false unless self.class::Racc_debug_parser - @yydebug = false unless defined? @yydebug - if @yydebug - @racc_debug_out = $stderr unless defined? @racc_debug_out - @racc_debug_out ||= $stderr - end - arg = self.class::Racc_arg - arg[13] = true if arg.size < 14 - arg - end - - def _racc_init_sysvars - @racc_state = [0] - @racc_tstack = [] - @racc_vstack = [] - - @racc_t = nil - @racc_val = nil - - @racc_read_next = true - - @racc_user_yyerror = false - @racc_error_status = 0 - end - - - ### - ### do_parse - ### - - def do_parse - __send__ Racc_Main_Parsing_Routine, _racc_setup(), false - end - - def next_token - raise NotImplementedError, "#{self.class}\#next_token is not defined" - end - - def _racc_do_parse_rb( arg, in_debug ) - action_table, action_check, action_default, action_pointer, - goto_table, goto_check, goto_default, goto_pointer, - nt_base, reduce_table, token_table, shift_n, - reduce_n, use_result, * = arg - - _racc_init_sysvars - tok = act = i = nil - nerr = 0 - - catch(:racc_end_parse) { - while true - if i = action_pointer[@racc_state[-1]] - if @racc_read_next - if @racc_t != 0 # not EOF - tok, @racc_val = next_token() - unless tok # EOF - @racc_t = 0 - else - @racc_t = (token_table[tok] or 1) # error token - end - racc_read_token(@racc_t, tok, @racc_val) if @yydebug - @racc_read_next = false - end - end - i += @racc_t - if i >= 0 and - act = action_table[i] and - action_check[i] == @racc_state[-1] - ; - else - act = action_default[@racc_state[-1]] - end - else - act = action_default[@racc_state[-1]] - end - while act = _racc_evalact(act, arg) - end - end - } - end - - - ### - ### yyparse - ### - - def yyparse( recv, mid ) - __send__ Racc_YY_Parse_Method, recv, mid, _racc_setup(), true - end - - def _racc_yyparse_rb( recv, mid, arg, c_debug ) - action_table, action_check, action_default, action_pointer, - goto_table, goto_check, goto_default, goto_pointer, - nt_base, reduce_table, token_table, shift_n, - reduce_n, use_result, * = arg - - _racc_init_sysvars - tok = nil - act = nil - i = nil - nerr = 0 - - - catch(:racc_end_parse) { - until i = action_pointer[@racc_state[-1]] - while act = _racc_evalact(action_default[@racc_state[-1]], arg) - end - end - - recv.__send__(mid) do |tok, val| -# $stderr.puts "rd: tok=#{tok}, val=#{val}" - unless tok - @racc_t = 0 - else - @racc_t = (token_table[tok] or 1) # error token - end - @racc_val = val - @racc_read_next = false - - i += @racc_t - if i >= 0 and - act = action_table[i] and - action_check[i] == @racc_state[-1] - ; -# $stderr.puts "01: act=#{act}" - else - act = action_default[@racc_state[-1]] -# $stderr.puts "02: act=#{act}" -# $stderr.puts "curstate=#{@racc_state[-1]}" - end - - while act = _racc_evalact(act, arg) - end - - while not (i = action_pointer[@racc_state[-1]]) or - not @racc_read_next or - @racc_t == 0 # $ - if i and i += @racc_t and - i >= 0 and - act = action_table[i] and - action_check[i] == @racc_state[-1] - ; -# $stderr.puts "03: act=#{act}" - else -# $stderr.puts "04: act=#{act}" - act = action_default[@racc_state[-1]] - end - - while act = _racc_evalact(act, arg) - end - end - end - } - end - - - ### - ### common - ### - - def _racc_evalact( act, arg ) -# $stderr.puts "ea: act=#{act}" - action_table, action_check, action_default, action_pointer, - goto_table, goto_check, goto_default, goto_pointer, - nt_base, reduce_table, token_table, shift_n, - reduce_n, use_result, * = arg -nerr = 0 # tmp - - if act > 0 and act < shift_n - # - # shift - # - - if @racc_error_status > 0 - @racc_error_status -= 1 unless @racc_t == 1 # error token - end - - @racc_vstack.push @racc_val - @racc_state.push act - @racc_read_next = true - - if @yydebug - @racc_tstack.push @racc_t - racc_shift @racc_t, @racc_tstack, @racc_vstack - end - - elsif act < 0 and act > -reduce_n - # - # reduce - # - - code = catch(:racc_jump) { - @racc_state.push _racc_do_reduce(arg, act) - false - } - if code - case code - when 1 # yyerror - @racc_user_yyerror = true # user_yyerror - return -reduce_n - when 2 # yyaccept - return shift_n - else - raise RuntimeError, '[Racc Bug] unknown jump code' - end - end - - elsif act == shift_n - # - # accept - # - - racc_accept if @yydebug - throw :racc_end_parse, @racc_vstack[0] - - elsif act == -reduce_n - # - # error - # - - case @racc_error_status - when 0 - unless arg[21] # user_yyerror - nerr += 1 - on_error @racc_t, @racc_val, @racc_vstack - end - when 3 - if @racc_t == 0 # is $ - throw :racc_end_parse, nil - end - @racc_read_next = true - end - @racc_user_yyerror = false - @racc_error_status = 3 - - while true - if i = action_pointer[@racc_state[-1]] - i += 1 # error token - if i >= 0 and - (act = action_table[i]) and - action_check[i] == @racc_state[-1] - break - end - end - - throw :racc_end_parse, nil if @racc_state.size < 2 - @racc_state.pop - @racc_vstack.pop - if @yydebug - @racc_tstack.pop - racc_e_pop @racc_state, @racc_tstack, @racc_vstack - end - end - - return act - - else - raise RuntimeError, "[Racc Bug] unknown action #{act.inspect}" - end - - racc_next_state(@racc_state[-1], @racc_state) if @yydebug - - nil - end - - def _racc_do_reduce( arg, act ) - action_table, action_check, action_default, action_pointer, - goto_table, goto_check, goto_default, goto_pointer, - nt_base, reduce_table, token_table, shift_n, - reduce_n, use_result, * = arg - state = @racc_state - vstack = @racc_vstack - tstack = @racc_tstack - - i = act * -3 - len = reduce_table[i] - reduce_to = reduce_table[i+1] - method_id = reduce_table[i+2] - void_array = [] - - tmp_t = tstack[-len, len] if @yydebug - tmp_v = vstack[-len, len] - tstack[-len, len] = void_array if @yydebug - vstack[-len, len] = void_array - state[-len, len] = void_array - - # tstack must be updated AFTER method call - if use_result - vstack.push __send__(method_id, tmp_v, vstack, tmp_v[0]) - else - vstack.push __send__(method_id, tmp_v, vstack) - end - tstack.push reduce_to - - racc_reduce(tmp_t, reduce_to, tstack, vstack) if @yydebug - - k1 = reduce_to - nt_base - if i = goto_pointer[k1] - i += state[-1] - if i >= 0 and (curstate = goto_table[i]) and goto_check[i] == k1 - return curstate - end - end - goto_default[k1] - end - - def on_error( t, val, vstack ) - raise ParseError, sprintf("\nparse error on value %s (%s)", - val.inspect, token_to_str(t) || '?') - end - - def yyerror - throw :racc_jump, 1 - end - - def yyaccept - throw :racc_jump, 2 - end - - def yyerrok - @racc_error_status = 0 - end - - - # for debugging output - - def racc_read_token( t, tok, val ) - @racc_debug_out.print 'read ' - @racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') ' - @racc_debug_out.puts val.inspect - @racc_debug_out.puts - end - - def racc_shift( tok, tstack, vstack ) - @racc_debug_out.puts "shift #{racc_token2str tok}" - racc_print_stacks tstack, vstack - @racc_debug_out.puts - end - - def racc_reduce( toks, sim, tstack, vstack ) - out = @racc_debug_out - out.print 'reduce ' - if toks.empty? - out.print ' ' - else - toks.each {|t| out.print ' ', racc_token2str(t) } - end - out.puts " --> #{racc_token2str(sim)}" - - racc_print_stacks tstack, vstack - @racc_debug_out.puts - end - - def racc_accept - @racc_debug_out.puts 'accept' - @racc_debug_out.puts - end - - def racc_e_pop( state, tstack, vstack ) - @racc_debug_out.puts 'error recovering mode: pop token' - racc_print_states state - racc_print_stacks tstack, vstack - @racc_debug_out.puts - end - - def racc_next_state( curstate, state ) - @racc_debug_out.puts "goto #{curstate}" - racc_print_states state - @racc_debug_out.puts - end - - def racc_print_stacks( t, v ) - out = @racc_debug_out - out.print ' [' - t.each_index do |i| - out.print ' (', racc_token2str(t[i]), ' ', v[i].inspect, ')' - end - out.puts ' ]' - end - - def racc_print_states( s ) - out = @racc_debug_out - out.print ' [' - s.each {|st| out.print ' ', st } - out.puts ' ]' - end - - def racc_token2str( tok ) - self.class::Racc_token_to_s_table[tok] or - raise RuntimeError, "[Racc Bug] can't convert token #{tok} to string" - end - - def token_to_str( t ) - self.class::Racc_token_to_s_table[t] - end - - end - -end -..end /home/aamine/lib/ruby/racc/parser.rb modeval..idb76f2e220d -end # end of racc/parser.rb - - -# -# parser.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -require 'tmail/scanner' -require 'tmail/utils' - - -module TMail - - class Parser < Racc::Parser - -module_eval <<'..end parser.y modeval..id43721faf1c', 'parser.y', 331 - - include TextUtils - - def self.parse( ident, str, cmt = nil ) - new.parse(ident, str, cmt) - end - - MAILP_DEBUG = false - - def initialize - self.debug = MAILP_DEBUG - end - - def debug=( flag ) - @yydebug = flag && Racc_debug_parser - @scanner_debug = flag - end - - def debug - @yydebug - end - - def parse( ident, str, comments = nil ) - @scanner = Scanner.new(str, ident, comments) - @scanner.debug = @scanner_debug - @first = [ident, ident] - result = yyparse(self, :parse_in) - comments.map! {|c| to_kcode(c) } if comments - result - end - - private - - def parse_in( &block ) - yield @first - @scanner.scan(&block) - end - - def on_error( t, val, vstack ) - raise SyntaxError, "parse error on token #{racc_token2str t}" - end - -..end parser.y modeval..id43721faf1c - -##### racc 1.4.3 generates ### - -racc_reduce_table = [ - 0, 0, :racc_error, - 2, 35, :_reduce_1, - 2, 35, :_reduce_2, - 2, 35, :_reduce_3, - 2, 35, :_reduce_4, - 2, 35, :_reduce_5, - 2, 35, :_reduce_6, - 2, 35, :_reduce_7, - 2, 35, :_reduce_8, - 2, 35, :_reduce_9, - 2, 35, :_reduce_10, - 2, 35, :_reduce_11, - 2, 35, :_reduce_12, - 6, 36, :_reduce_13, - 0, 48, :_reduce_none, - 2, 48, :_reduce_none, - 3, 49, :_reduce_16, - 5, 49, :_reduce_17, - 1, 50, :_reduce_18, - 7, 37, :_reduce_19, - 0, 51, :_reduce_none, - 2, 51, :_reduce_21, - 0, 52, :_reduce_none, - 2, 52, :_reduce_23, - 1, 58, :_reduce_24, - 3, 58, :_reduce_25, - 2, 58, :_reduce_26, - 0, 53, :_reduce_none, - 2, 53, :_reduce_28, - 0, 54, :_reduce_29, - 3, 54, :_reduce_30, - 0, 55, :_reduce_none, - 2, 55, :_reduce_32, - 2, 55, :_reduce_33, - 0, 56, :_reduce_none, - 2, 56, :_reduce_35, - 1, 61, :_reduce_36, - 1, 61, :_reduce_37, - 0, 57, :_reduce_none, - 2, 57, :_reduce_39, - 1, 38, :_reduce_none, - 1, 38, :_reduce_none, - 3, 38, :_reduce_none, - 1, 46, :_reduce_none, - 1, 46, :_reduce_none, - 1, 46, :_reduce_none, - 1, 39, :_reduce_none, - 2, 39, :_reduce_47, - 1, 64, :_reduce_48, - 3, 64, :_reduce_49, - 1, 68, :_reduce_none, - 1, 68, :_reduce_none, - 1, 69, :_reduce_52, - 3, 69, :_reduce_53, - 1, 47, :_reduce_none, - 1, 47, :_reduce_none, - 2, 47, :_reduce_56, - 2, 67, :_reduce_none, - 3, 65, :_reduce_58, - 2, 65, :_reduce_59, - 1, 70, :_reduce_60, - 2, 70, :_reduce_61, - 4, 62, :_reduce_62, - 3, 62, :_reduce_63, - 2, 72, :_reduce_none, - 2, 73, :_reduce_65, - 4, 73, :_reduce_66, - 3, 63, :_reduce_67, - 1, 63, :_reduce_68, - 1, 74, :_reduce_none, - 2, 74, :_reduce_70, - 1, 71, :_reduce_71, - 3, 71, :_reduce_72, - 1, 59, :_reduce_73, - 3, 59, :_reduce_74, - 1, 76, :_reduce_75, - 2, 76, :_reduce_76, - 1, 75, :_reduce_none, - 1, 75, :_reduce_none, - 1, 75, :_reduce_none, - 1, 77, :_reduce_none, - 1, 77, :_reduce_none, - 1, 77, :_reduce_none, - 1, 66, :_reduce_none, - 2, 66, :_reduce_none, - 3, 60, :_reduce_85, - 1, 40, :_reduce_86, - 3, 40, :_reduce_87, - 1, 79, :_reduce_none, - 2, 79, :_reduce_89, - 1, 41, :_reduce_90, - 2, 41, :_reduce_91, - 3, 42, :_reduce_92, - 5, 43, :_reduce_93, - 3, 43, :_reduce_94, - 0, 80, :_reduce_95, - 5, 80, :_reduce_96, - 1, 82, :_reduce_none, - 1, 82, :_reduce_none, - 1, 44, :_reduce_99, - 3, 45, :_reduce_100, - 0, 81, :_reduce_none, - 1, 81, :_reduce_none, - 1, 78, :_reduce_none, - 1, 78, :_reduce_none, - 1, 78, :_reduce_none, - 1, 78, :_reduce_none, - 1, 78, :_reduce_none, - 1, 78, :_reduce_none, - 1, 78, :_reduce_none ] - -racc_reduce_n = 110 - -racc_shift_n = 168 - -racc_action_table = [ - -70, -69, 23, 25, 146, 147, 29, 31, 105, 106, - 16, 17, 20, 22, 136, 27, -70, -69, 32, 101, - -70, -69, 154, 100, 113, 115, -70, -69, -70, 109, - 75, 23, 25, 101, 155, 29, 31, 142, 143, 16, - 17, 20, 22, 107, 27, 23, 25, 32, 98, 29, - 31, 96, 94, 16, 17, 20, 22, 78, 27, 23, - 25, 32, 112, 29, 31, 74, 91, 16, 17, 20, - 22, 88, 117, 92, 81, 32, 23, 25, 80, 123, - 29, 31, 100, 125, 16, 17, 20, 22, 126, 23, - 25, 109, 32, 29, 31, 91, 128, 16, 17, 20, - 22, 129, 27, 23, 25, 32, 101, 29, 31, 101, - 130, 16, 17, 20, 22, 79, 52, 23, 25, 32, - 78, 29, 31, 133, 78, 16, 17, 20, 22, 77, - 23, 25, 75, 32, 29, 31, 65, 62, 16, 17, - 20, 22, 139, 23, 25, 101, 32, 29, 31, 60, - 100, 16, 17, 20, 22, 44, 27, 101, 148, 32, - 23, 25, 120, 149, 29, 31, 152, 153, 16, 17, - 20, 22, 42, 27, 157, 159, 32, 23, 25, 120, - 40, 29, 31, 15, 164, 16, 17, 20, 22, 40, - 27, 23, 25, 32, 68, 29, 31, 166, 167, 16, - 17, 20, 22, nil, 27, 23, 25, 32, nil, 29, - 31, 74, nil, 16, 17, 20, 22, nil, 23, 25, - nil, 32, 29, 31, nil, nil, 16, 17, 20, 22, - nil, 23, 25, nil, 32, 29, 31, nil, nil, 16, - 17, 20, 22, nil, 23, 25, nil, 32, 29, 31, - nil, nil, 16, 17, 20, 22, nil, 23, 25, nil, - 32, 29, 31, nil, nil, 16, 17, 20, 22, nil, - 27, 23, 25, 32, nil, 29, 31, nil, nil, 16, - 17, 20, 22, nil, 23, 25, nil, 32, 29, 31, - nil, nil, 16, 17, 20, 22, nil, 23, 25, nil, - 32, 29, 31, nil, nil, 16, 17, 20, 22, nil, - 84, 25, nil, 32, 29, 31, nil, 87, 16, 17, - 20, 22, 4, 6, 7, 8, 9, 10, 11, 12, - 13, 1, 2, 3, 84, 25, nil, nil, 29, 31, - nil, 87, 16, 17, 20, 22, 84, 25, nil, nil, - 29, 31, nil, 87, 16, 17, 20, 22, 84, 25, - nil, nil, 29, 31, nil, 87, 16, 17, 20, 22, - 84, 25, nil, nil, 29, 31, nil, 87, 16, 17, - 20, 22, 84, 25, nil, nil, 29, 31, nil, 87, - 16, 17, 20, 22, 84, 25, nil, nil, 29, 31, - nil, 87, 16, 17, 20, 22 ] - -racc_action_check = [ - 75, 28, 68, 68, 136, 136, 68, 68, 72, 72, - 68, 68, 68, 68, 126, 68, 75, 28, 68, 67, - 75, 28, 143, 66, 86, 86, 75, 28, 75, 75, - 28, 3, 3, 86, 143, 3, 3, 134, 134, 3, - 3, 3, 3, 73, 3, 152, 152, 3, 62, 152, - 152, 60, 56, 152, 152, 152, 152, 51, 152, 52, - 52, 152, 80, 52, 52, 52, 50, 52, 52, 52, - 52, 45, 89, 52, 42, 52, 71, 71, 41, 96, - 71, 71, 97, 98, 71, 71, 71, 71, 100, 7, - 7, 101, 71, 7, 7, 102, 104, 7, 7, 7, - 7, 105, 7, 8, 8, 7, 108, 8, 8, 111, - 112, 8, 8, 8, 8, 40, 8, 9, 9, 8, - 36, 9, 9, 117, 121, 9, 9, 9, 9, 33, - 10, 10, 70, 9, 10, 10, 13, 12, 10, 10, - 10, 10, 130, 2, 2, 131, 10, 2, 2, 11, - 135, 2, 2, 2, 2, 6, 2, 138, 139, 2, - 90, 90, 90, 140, 90, 90, 141, 142, 90, 90, - 90, 90, 5, 90, 148, 151, 90, 127, 127, 127, - 4, 127, 127, 1, 157, 127, 127, 127, 127, 159, - 127, 26, 26, 127, 26, 26, 26, 163, 164, 26, - 26, 26, 26, nil, 26, 27, 27, 26, nil, 27, - 27, 27, nil, 27, 27, 27, 27, nil, 155, 155, - nil, 27, 155, 155, nil, nil, 155, 155, 155, 155, - nil, 122, 122, nil, 155, 122, 122, nil, nil, 122, - 122, 122, 122, nil, 76, 76, nil, 122, 76, 76, - nil, nil, 76, 76, 76, 76, nil, 38, 38, nil, - 76, 38, 38, nil, nil, 38, 38, 38, 38, nil, - 38, 55, 55, 38, nil, 55, 55, nil, nil, 55, - 55, 55, 55, nil, 94, 94, nil, 55, 94, 94, - nil, nil, 94, 94, 94, 94, nil, 59, 59, nil, - 94, 59, 59, nil, nil, 59, 59, 59, 59, nil, - 114, 114, nil, 59, 114, 114, nil, 114, 114, 114, - 114, 114, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 77, nil, nil, 77, 77, - nil, 77, 77, 77, 77, 77, 44, 44, nil, nil, - 44, 44, nil, 44, 44, 44, 44, 44, 113, 113, - nil, nil, 113, 113, nil, 113, 113, 113, 113, 113, - 88, 88, nil, nil, 88, 88, nil, 88, 88, 88, - 88, 88, 74, 74, nil, nil, 74, 74, nil, 74, - 74, 74, 74, 74, 129, 129, nil, nil, 129, 129, - nil, 129, 129, 129, 129, 129 ] - -racc_action_pointer = [ - 320, 152, 129, 17, 165, 172, 137, 75, 89, 103, - 116, 135, 106, 105, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, 177, 191, 1, nil, - nil, nil, nil, 109, nil, nil, 94, nil, 243, nil, - 99, 64, 74, nil, 332, 52, nil, nil, nil, nil, - 50, 31, 45, nil, nil, 257, 36, nil, nil, 283, - 22, nil, 16, nil, nil, nil, -3, -10, -12, nil, - 103, 62, -8, 15, 368, 0, 230, 320, nil, nil, - 47, nil, nil, nil, nil, nil, 4, nil, 356, 50, - 146, nil, nil, nil, 270, nil, 65, 56, 52, nil, - 57, 62, 79, nil, 68, 81, nil, nil, 77, nil, - nil, 80, 96, 344, 296, nil, nil, 108, nil, nil, - nil, 98, 217, nil, nil, nil, -19, 163, nil, 380, - 128, 116, nil, nil, 14, 124, -26, nil, 128, 141, - 148, 141, 152, 7, nil, nil, nil, nil, 160, nil, - nil, 149, 31, nil, nil, 204, nil, 167, nil, 174, - nil, nil, nil, 169, 184, nil, nil, nil ] - -racc_action_default = [ - -110, -110, -110, -110, -14, -110, -20, -110, -110, -110, - -110, -110, -110, -110, -10, -95, -106, -107, -77, -44, - -108, -11, -109, -79, -43, -103, -110, -110, -60, -104, - -55, -105, -78, -68, -54, -71, -45, -12, -110, -1, - -110, -110, -110, -2, -110, -22, -51, -48, -50, -3, - -40, -41, -110, -46, -4, -86, -5, -88, -6, -90, - -110, -7, -95, -8, -9, -99, -101, -61, -59, -56, - -69, -110, -110, -110, -110, -75, -110, -110, -57, -15, - -110, 168, -73, -80, -82, -21, -24, -81, -110, -27, - -110, -83, -47, -89, -110, -91, -110, -101, -110, -100, - -102, -75, -58, -52, -110, -110, -64, -63, -65, -76, - -72, -67, -110, -110, -110, -26, -23, -110, -29, -49, - -84, -42, -87, -92, -94, -95, -110, -110, -62, -110, - -110, -25, -74, -28, -31, -101, -110, -53, -66, -110, - -110, -34, -110, -110, -93, -96, -98, -97, -110, -18, - -13, -38, -110, -30, -33, -110, -32, -16, -19, -14, - -35, -36, -37, -110, -110, -39, -85, -17 ] - -racc_goto_table = [ - 39, 67, 70, 73, 24, 37, 69, 66, 36, 38, - 57, 59, 55, 67, 108, 83, 90, 111, 69, 99, - 85, 49, 53, 76, 158, 134, 141, 70, 73, 151, - 118, 89, 45, 156, 160, 150, 140, 21, 14, 19, - 119, 102, 64, 63, 61, 83, 70, 104, 83, 58, - 124, 132, 56, 131, 97, 54, 93, 43, 5, 83, - 95, 145, 76, nil, 116, 76, nil, nil, 127, 138, - 103, nil, nil, nil, 38, nil, nil, 110, nil, nil, - nil, nil, nil, nil, 83, 83, nil, nil, 144, nil, - nil, nil, nil, nil, nil, 57, 121, 122, nil, nil, - 83, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 135, nil, nil, - nil, nil, nil, 93, nil, nil, nil, 70, 162, 137, - 70, 163, 161, 38, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 165 ] - -racc_goto_check = [ - 2, 37, 37, 29, 13, 13, 28, 46, 31, 36, - 41, 41, 45, 37, 25, 44, 32, 25, 28, 47, - 24, 4, 4, 42, 23, 20, 21, 37, 29, 22, - 19, 18, 17, 26, 27, 16, 15, 12, 11, 33, - 34, 35, 10, 9, 8, 44, 37, 29, 44, 7, - 47, 43, 6, 25, 46, 5, 41, 3, 1, 44, - 41, 48, 42, nil, 24, 42, nil, nil, 32, 25, - 13, nil, nil, nil, 36, nil, nil, 41, nil, nil, - nil, nil, nil, nil, 44, 44, nil, nil, 47, nil, - nil, nil, nil, nil, nil, 41, 31, 45, nil, nil, - 44, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 46, nil, nil, - nil, nil, nil, 41, nil, nil, nil, 37, 29, 13, - 37, 29, 28, 36, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 2 ] - -racc_goto_pointer = [ - nil, 58, -4, 51, 14, 47, 43, 39, 33, 31, - 29, 37, 35, 2, nil, -94, -105, 26, -14, -59, - -93, -108, -112, -127, -24, -60, -110, -118, -20, -24, - nil, 6, -34, 37, -50, -27, 6, -25, nil, nil, - nil, 1, -5, -63, -29, 3, -8, -47, -75 ] - -racc_goto_default = [ - nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, 48, 41, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 86, nil, nil, 30, 34, - 50, 51, nil, 46, 47, nil, 26, 28, 71, 72, - 33, 35, 114, 82, 18, nil, nil, nil, nil ] - -racc_token_table = { - false => 0, - Object.new => 1, - :DATETIME => 2, - :RECEIVED => 3, - :MADDRESS => 4, - :RETPATH => 5, - :KEYWORDS => 6, - :ENCRYPTED => 7, - :MIMEVERSION => 8, - :CTYPE => 9, - :CENCODING => 10, - :CDISPOSITION => 11, - :ADDRESS => 12, - :MAILBOX => 13, - :DIGIT => 14, - :ATOM => 15, - "," => 16, - ":" => 17, - :FROM => 18, - :BY => 19, - "@" => 20, - :DOMLIT => 21, - :VIA => 22, - :WITH => 23, - :ID => 24, - :FOR => 25, - ";" => 26, - "<" => 27, - ">" => 28, - "." => 29, - :QUOTED => 30, - :TOKEN => 31, - "/" => 32, - "=" => 33 } - -racc_use_result_var = false - -racc_nt_base = 34 - -Racc_arg = [ - racc_action_table, - racc_action_check, - racc_action_default, - racc_action_pointer, - racc_goto_table, - racc_goto_check, - racc_goto_default, - racc_goto_pointer, - racc_nt_base, - racc_reduce_table, - racc_token_table, - racc_shift_n, - racc_reduce_n, - racc_use_result_var ] - -Racc_token_to_s_table = [ -'$end', -'error', -'DATETIME', -'RECEIVED', -'MADDRESS', -'RETPATH', -'KEYWORDS', -'ENCRYPTED', -'MIMEVERSION', -'CTYPE', -'CENCODING', -'CDISPOSITION', -'ADDRESS', -'MAILBOX', -'DIGIT', -'ATOM', -'","', -'":"', -'FROM', -'BY', -'"@"', -'DOMLIT', -'VIA', -'WITH', -'ID', -'FOR', -'";"', -'"<"', -'">"', -'"."', -'QUOTED', -'TOKEN', -'"/"', -'"="', -'$start', -'content', -'datetime', -'received', -'addrs_TOP', -'retpath', -'keys', -'enc', -'version', -'ctype', -'cencode', -'cdisp', -'addr_TOP', -'mbox', -'day', -'hour', -'zone', -'from', -'by', -'via', -'with', -'id', -'for', -'received_datetime', -'received_domain', -'domain', -'msgid', -'received_addrspec', -'routeaddr', -'spec', -'addrs', -'group_bare', -'commas', -'group', -'addr', -'mboxes', -'addr_phrase', -'local_head', -'routes', -'at_domains', -'local', -'word', -'dots', -'domword', -'atom', -'phrase', -'params', -'opt_semicolon', -'value'] - -Racc_debug_parser = false - -##### racc system variables end ##### - - # reduce 0 omitted - -module_eval <<'.,.,', 'parser.y', 16 - def _reduce_1( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 17 - def _reduce_2( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 18 - def _reduce_3( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 19 - def _reduce_4( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 20 - def _reduce_5( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 21 - def _reduce_6( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 22 - def _reduce_7( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 23 - def _reduce_8( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 24 - def _reduce_9( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 25 - def _reduce_10( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 26 - def _reduce_11( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 27 - def _reduce_12( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 33 - def _reduce_13( val, _values) - t = Time.gm(val[3].to_i, val[2], val[1].to_i, 0, 0, 0) - (t + val[4] - val[5]).localtime - end -.,., - - # reduce 14 omitted - - # reduce 15 omitted - -module_eval <<'.,.,', 'parser.y', 42 - def _reduce_16( val, _values) - (val[0].to_i * 60 * 60) + - (val[2].to_i * 60) - end -.,., - -module_eval <<'.,.,', 'parser.y', 47 - def _reduce_17( val, _values) - (val[0].to_i * 60 * 60) + - (val[2].to_i * 60) + - (val[4].to_i) - end -.,., - -module_eval <<'.,.,', 'parser.y', 54 - def _reduce_18( val, _values) - timezone_string_to_unixtime(val[0]) - end -.,., - -module_eval <<'.,.,', 'parser.y', 59 - def _reduce_19( val, _values) - val - end -.,., - - # reduce 20 omitted - -module_eval <<'.,.,', 'parser.y', 65 - def _reduce_21( val, _values) - val[1] - end -.,., - - # reduce 22 omitted - -module_eval <<'.,.,', 'parser.y', 71 - def _reduce_23( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 77 - def _reduce_24( val, _values) - join_domain(val[0]) - end -.,., - -module_eval <<'.,.,', 'parser.y', 81 - def _reduce_25( val, _values) - join_domain(val[2]) - end -.,., - -module_eval <<'.,.,', 'parser.y', 85 - def _reduce_26( val, _values) - join_domain(val[0]) - end -.,., - - # reduce 27 omitted - -module_eval <<'.,.,', 'parser.y', 91 - def _reduce_28( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 96 - def _reduce_29( val, _values) - [] - end -.,., - -module_eval <<'.,.,', 'parser.y', 100 - def _reduce_30( val, _values) - val[0].push val[2] - val[0] - end -.,., - - # reduce 31 omitted - -module_eval <<'.,.,', 'parser.y', 107 - def _reduce_32( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 111 - def _reduce_33( val, _values) - val[1] - end -.,., - - # reduce 34 omitted - -module_eval <<'.,.,', 'parser.y', 117 - def _reduce_35( val, _values) - val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 123 - def _reduce_36( val, _values) - val[0].spec - end -.,., - -module_eval <<'.,.,', 'parser.y', 127 - def _reduce_37( val, _values) - val[0].spec - end -.,., - - # reduce 38 omitted - -module_eval <<'.,.,', 'parser.y', 134 - def _reduce_39( val, _values) - val[1] - end -.,., - - # reduce 40 omitted - - # reduce 41 omitted - - # reduce 42 omitted - - # reduce 43 omitted - - # reduce 44 omitted - - # reduce 45 omitted - - # reduce 46 omitted - -module_eval <<'.,.,', 'parser.y', 146 - def _reduce_47( val, _values) - [ Address.new(nil, nil) ] - end -.,., - -module_eval <<'.,.,', 'parser.y', 148 - def _reduce_48( val, _values) - val - end -.,., - -module_eval <<'.,.,', 'parser.y', 149 - def _reduce_49( val, _values) - val[0].push val[2]; val[0] - end -.,., - - # reduce 50 omitted - - # reduce 51 omitted - -module_eval <<'.,.,', 'parser.y', 156 - def _reduce_52( val, _values) - val - end -.,., - -module_eval <<'.,.,', 'parser.y', 160 - def _reduce_53( val, _values) - val[0].push val[2] - val[0] - end -.,., - - # reduce 54 omitted - - # reduce 55 omitted - -module_eval <<'.,.,', 'parser.y', 168 - def _reduce_56( val, _values) - val[1].phrase = Decoder.decode(val[0]) - val[1] - end -.,., - - # reduce 57 omitted - -module_eval <<'.,.,', 'parser.y', 176 - def _reduce_58( val, _values) - AddressGroup.new(val[0], val[2]) - end -.,., - -module_eval <<'.,.,', 'parser.y', 178 - def _reduce_59( val, _values) - AddressGroup.new(val[0], []) - end -.,., - -module_eval <<'.,.,', 'parser.y', 181 - def _reduce_60( val, _values) - val[0].join('.') - end -.,., - -module_eval <<'.,.,', 'parser.y', 182 - def _reduce_61( val, _values) - val[0] << ' ' << val[1].join('.') - end -.,., - -module_eval <<'.,.,', 'parser.y', 186 - def _reduce_62( val, _values) - val[2].routes.replace val[1] - val[2] - end -.,., - -module_eval <<'.,.,', 'parser.y', 191 - def _reduce_63( val, _values) - val[1] - end -.,., - - # reduce 64 omitted - -module_eval <<'.,.,', 'parser.y', 196 - def _reduce_65( val, _values) - [ val[1].join('.') ] - end -.,., - -module_eval <<'.,.,', 'parser.y', 197 - def _reduce_66( val, _values) - val[0].push val[3].join('.'); val[0] - end -.,., - -module_eval <<'.,.,', 'parser.y', 199 - def _reduce_67( val, _values) - Address.new( val[0], val[2] ) - end -.,., - -module_eval <<'.,.,', 'parser.y', 200 - def _reduce_68( val, _values) - Address.new( val[0], nil ) - end -.,., - - # reduce 69 omitted - -module_eval <<'.,.,', 'parser.y', 203 - def _reduce_70( val, _values) - val[0].push ''; val[0] - end -.,., - -module_eval <<'.,.,', 'parser.y', 206 - def _reduce_71( val, _values) - val - end -.,., - -module_eval <<'.,.,', 'parser.y', 209 - def _reduce_72( val, _values) - val[1].times do - val[0].push '' - end - val[0].push val[2] - val[0] - end -.,., - -module_eval <<'.,.,', 'parser.y', 217 - def _reduce_73( val, _values) - val - end -.,., - -module_eval <<'.,.,', 'parser.y', 220 - def _reduce_74( val, _values) - val[1].times do - val[0].push '' - end - val[0].push val[2] - val[0] - end -.,., - -module_eval <<'.,.,', 'parser.y', 227 - def _reduce_75( val, _values) - 0 - end -.,., - -module_eval <<'.,.,', 'parser.y', 228 - def _reduce_76( val, _values) - 1 - end -.,., - - # reduce 77 omitted - - # reduce 78 omitted - - # reduce 79 omitted - - # reduce 80 omitted - - # reduce 81 omitted - - # reduce 82 omitted - - # reduce 83 omitted - - # reduce 84 omitted - -module_eval <<'.,.,', 'parser.y', 243 - def _reduce_85( val, _values) - val[1] = val[1].spec - val.join('') - end -.,., - -module_eval <<'.,.,', 'parser.y', 247 - def _reduce_86( val, _values) - val - end -.,., - -module_eval <<'.,.,', 'parser.y', 248 - def _reduce_87( val, _values) - val[0].push val[2]; val[0] - end -.,., - - # reduce 88 omitted - -module_eval <<'.,.,', 'parser.y', 251 - def _reduce_89( val, _values) - val[0] << ' ' << val[1] - end -.,., - -module_eval <<'.,.,', 'parser.y', 255 - def _reduce_90( val, _values) - val.push nil - val - end -.,., - -module_eval <<'.,.,', 'parser.y', 260 - def _reduce_91( val, _values) - val - end -.,., - -module_eval <<'.,.,', 'parser.y', 265 - def _reduce_92( val, _values) - [ val[0].to_i, val[2].to_i ] - end -.,., - -module_eval <<'.,.,', 'parser.y', 270 - def _reduce_93( val, _values) - [ val[0].downcase, val[2].downcase, decode_params(val[3]) ] - end -.,., - -module_eval <<'.,.,', 'parser.y', 274 - def _reduce_94( val, _values) - [ val[0].downcase, nil, decode_params(val[1]) ] - end -.,., - -module_eval <<'.,.,', 'parser.y', 279 - def _reduce_95( val, _values) - {} - end -.,., - -module_eval <<'.,.,', 'parser.y', 283 - def _reduce_96( val, _values) - val[0][ val[2].downcase ] = val[4] - val[0] - end -.,., - - # reduce 97 omitted - - # reduce 98 omitted - -module_eval <<'.,.,', 'parser.y', 292 - def _reduce_99( val, _values) - val[0].downcase - end -.,., - -module_eval <<'.,.,', 'parser.y', 297 - def _reduce_100( val, _values) - [ val[0].downcase, decode_params(val[1]) ] - end -.,., - - # reduce 101 omitted - - # reduce 102 omitted - - # reduce 103 omitted - - # reduce 104 omitted - - # reduce 105 omitted - - # reduce 106 omitted - - # reduce 107 omitted - - # reduce 108 omitted - - # reduce 109 omitted - - def _reduce_none( val, _values) - val[0] - end - - end # class Parser - -end # module TMail -# -# port.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -require 'tmail/stringio' - - -module TMail - - class Port - def reproducible? - false - end - end - - - ### - ### FilePort - ### - - class FilePort < Port - - def initialize( fname ) - @filename = File.expand_path(fname) - super() - end - - attr_reader :filename - - alias ident filename - - def ==( other ) - other.respond_to?(:filename) and @filename == other.filename - end - - alias eql? == - - def hash - @filename.hash - end - - def inspect - "#<#{self.class}:#{@filename}>" - end - - def reproducible? - true - end - - def size - File.size @filename - end - - - def ropen( &block ) - File.open(@filename, &block) - end - - def wopen( &block ) - File.open(@filename, 'w', &block) - end - - def aopen( &block ) - File.open(@filename, 'a', &block) - end - - - def read_all - ropen {|f| - return f.read - } - end - - - def remove - File.unlink @filename - end - - def move_to( port ) - begin - File.link @filename, port.filename - rescue Errno::EXDEV - copy_to port - end - File.unlink @filename - end - - alias mv move_to - - def copy_to( port ) - if FilePort === port - copy_file @filename, port.filename - else - File.open(@filename) {|r| - port.wopen {|w| - while s = r.sysread(4096) - w.write << s - end - } } - end - end - - alias cp copy_to - - private - - # from fileutils.rb - def copy_file( src, dest ) - st = r = w = nil - - File.open(src, 'rb') {|r| - File.open(dest, 'wb') {|w| - st = r.stat - begin - while true - w.write r.sysread(st.blksize) - end - rescue EOFError - end - } } - end - - end - - - module MailFlags - - def seen=( b ) - set_status 'S', b - end - - def seen? - get_status 'S' - end - - def replied=( b ) - set_status 'R', b - end - - def replied? - get_status 'R' - end - - def flagged=( b ) - set_status 'F', b - end - - def flagged? - get_status 'F' - end - - private - - def procinfostr( str, tag, true_p ) - a = str.upcase.split(//) - a.push true_p ? tag : nil - a.delete tag unless true_p - a.compact.sort.join('').squeeze - end - - end - - - class MhPort < FilePort - - include MailFlags - - private - - def set_status( tag, flag ) - begin - tmpfile = @filename + '.tmailtmp.' + $$.to_s - File.open(tmpfile, 'w') {|f| - write_status f, tag, flag - } - File.unlink @filename - File.link tmpfile, @filename - ensure - File.unlink tmpfile - end - end - - def write_status( f, tag, flag ) - stat = '' - File.open(@filename) {|r| - while line = r.gets - if line.strip.empty? - break - elsif m = /\AX-TMail-Status:/i.match(line) - stat = m.post_match.strip - else - f.print line - end - end - - s = procinfostr(stat, tag, flag) - f.puts 'X-TMail-Status: ' + s unless s.empty? - f.puts - - while s = r.read(2048) - f.write s - end - } - end - - def get_status( tag ) - File.foreach(@filename) {|line| - return false if line.strip.empty? - if m = /\AX-TMail-Status:/i.match(line) - return m.post_match.strip.include?(tag[0]) - end - } - false - end - - end - - - class MaildirPort < FilePort - - def move_to_new - new = replace_dir(@filename, 'new') - File.rename @filename, new - @filename = new - end - - def move_to_cur - new = replace_dir(@filename, 'cur') - File.rename @filename, new - @filename = new - end - - def replace_dir( path, dir ) - "#{File.dirname File.dirname(path)}/#{dir}/#{File.basename path}" - end - private :replace_dir - - - include MailFlags - - private - - MAIL_FILE = /\A(\d+\.[\d_]+\.[^:]+)(?:\:(\d),(\w+)?)?\z/ - - def set_status( tag, flag ) - if m = MAIL_FILE.match(File.basename(@filename)) - s, uniq, type, info, = m.to_a - return if type and type != '2' # do not change anything - newname = File.dirname(@filename) + '/' + - uniq + ':2,' + procinfostr(info.to_s, tag, flag) - else - newname = @filename + ':2,' + tag - end - - File.link @filename, newname - File.unlink @filename - @filename = newname - end - - def get_status( tag ) - m = MAIL_FILE.match(File.basename(@filename)) or return false - m[2] == '2' and m[3].to_s.include?(tag[0]) - end - - end - - - ### - ### StringPort - ### - - class StringPort < Port - - def initialize( str = '' ) - @buffer = str - super() - end - - def string - @buffer - end - - def to_s - @buffer.dup - end - - alias read_all to_s - - def size - @buffer.size - end - - def ==( other ) - StringPort === other and @buffer.equal? other.string - end - - alias eql? == - - def hash - @buffer.object_id.hash - end - - def inspect - "#<#{self.class}:id=#{sprintf '0x%x', @buffer.object_id}>" - end - - def reproducible? - true - end - - def ropen( &block ) - @buffer or raise Errno::ENOENT, "#{inspect} is already removed" - StringInput.open(@buffer, &block) - end - - def wopen( &block ) - @buffer = '' - StringOutput.new(@buffer, &block) - end - - def aopen( &block ) - @buffer ||= '' - StringOutput.new(@buffer, &block) - end - - def remove - @buffer = nil - end - - alias rm remove - - def copy_to( port ) - port.wopen {|f| - f.write @buffer - } - end - - alias cp copy_to - - def move_to( port ) - if StringPort === port - str = @buffer - port.instance_eval { @buffer = str } - else - copy_to port - end - remove - end - - end - -end # module TMail -module TMail - class Mail - def subject(to_charset = 'utf-8') - Unquoter.unquote_and_convert_to(quoted_subject, to_charset) - end - - def unquoted_body(to_charset = 'utf-8') - from_charset = sub_header("content-type", "charset") - case (content_transfer_encoding || "7bit").downcase - when "quoted-printable" - Unquoter.unquote_quoted_printable_and_convert_to(quoted_body, - to_charset, from_charset, true) - when "base64" - Unquoter.unquote_base64_and_convert_to(quoted_body, to_charset, - from_charset) - when "7bit", "8bit" - Unquoter.convert_to(quoted_body, to_charset, from_charset) - when "binary" - quoted_body - else - quoted_body - end - end - - def body(to_charset = 'utf-8', &block) - attachment_presenter = block || Proc.new { |file_name| "Attachment: #{file_name}\n" } - - if multipart? - parts.collect { |part| - header = part["content-type"] - - if part.multipart? - part.body(to_charset, &attachment_presenter) - elsif header.nil? - "" - elsif !attachment?(part) - part.unquoted_body(to_charset) - else - attachment_presenter.call(header["name"] || "(unnamed)") - end - }.join - else - unquoted_body(to_charset) - end - end - end - - class Unquoter - class << self - def unquote_and_convert_to(text, to_charset, from_charset = "iso-8859-1", preserve_underscores=false) - return "" if text.nil? - if text =~ /^=\?(.*?)\?(.)\?(.*)\?=$/ - from_charset = $1 - quoting_method = $2 - text = $3 - case quoting_method.upcase - when "Q" then - unquote_quoted_printable_and_convert_to(text, to_charset, from_charset, preserve_underscores) - when "B" then - unquote_base64_and_convert_to(text, to_charset, from_charset) - else - raise "unknown quoting method #{quoting_method.inspect}" - end - else - convert_to(text, to_charset, from_charset) - end - end - - def unquote_quoted_printable_and_convert_to(text, to, from, preserve_underscores=false) - text = text.gsub(/_/, " ") unless preserve_underscores - convert_to(text.unpack("M*").first, to, from) - end - - def unquote_base64_and_convert_to(text, to, from) - convert_to(Base64.decode(text).first, to, from) - end - - begin - require 'iconv' - def convert_to(text, to, from) - return text unless to && from - text ? Iconv.iconv(to, from, text).first : "" - rescue Iconv::IllegalSequence, Errno::EINVAL - # the 'from' parameter specifies a charset other than what the text - # actually is...not much we can do in this case but just return the - # unconverted text. - # - # Ditto if either parameter represents an unknown charset, like - # X-UNKNOWN. - text - end - rescue LoadError - # Not providing quoting support - def convert_to(text, to, from) - warn "Action Mailer: iconv not loaded; ignoring conversion from #{from} to #{to} (#{__FILE__}:#{__LINE__})" - text - end - end - end - end -end - -if __FILE__ == $0 - require 'test/unit' - - class TC_Unquoter < Test::Unit::TestCase - def test_unquote_quoted_printable - a ="=?ISO-8859-1?Q?[166417]_Bekr=E6ftelse_fra_Rejsefeber?=" - b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') - assert_equal "[166417] Bekr\303\246ftelse fra Rejsefeber", b - end - - def test_unquote_base64 - a ="=?ISO-8859-1?B?WzE2NjQxN10gQmVrcuZmdGVsc2UgZnJhIFJlanNlZmViZXI=?=" - b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') - assert_equal "[166417] Bekr\303\246ftelse fra Rejsefeber", b - end - - def test_unquote_without_charset - a ="[166417]_Bekr=E6ftelse_fra_Rejsefeber" - b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') - assert_equal "[166417]_Bekr=E6ftelse_fra_Rejsefeber", b - end - end -end -# -# scanner.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -require 'tmail/utils' - -module TMail - require 'tmail/scanner_r.rb' - begin - raise LoadError, 'Turn off Ruby extention by user choice' if ENV['NORUBYEXT'] - require 'tmail/scanner_c.so' - Scanner = Scanner_C - rescue LoadError - Scanner = Scanner_R - end -end -# -# scanner_r.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -require 'tmail/config' - - -module TMail - - class Scanner_R - - Version = '0.10.7' - Version.freeze - - MIME_HEADERS = { - :CTYPE => true, - :CENCODING => true, - :CDISPOSITION => true - } - - alnum = 'a-zA-Z0-9' - atomsyms = %q[ _#!$%&`'*+-{|}~^@/=? ].strip - tokensyms = %q[ _#!$%&`'*+-{|}~^@. ].strip - - atomchars = alnum + Regexp.quote(atomsyms) - tokenchars = alnum + Regexp.quote(tokensyms) - iso2022str = '\e(?!\(B)..(?:[^\e]+|\e(?!\(B)..)*\e\(B' - - eucstr = '(?:[\xa1-\xfe][\xa1-\xfe])+' - sjisstr = '(?:[\x81-\x9f\xe0-\xef][\x40-\x7e\x80-\xfc])+' - utf8str = '(?:[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf])+' - - quoted_with_iso2022 = /\A(?:[^\\\e"]+|#{iso2022str})+/n - domlit_with_iso2022 = /\A(?:[^\\\e\]]+|#{iso2022str})+/n - comment_with_iso2022 = /\A(?:[^\\\e()]+|#{iso2022str})+/n - - quoted_without_iso2022 = /\A[^\\"]+/n - domlit_without_iso2022 = /\A[^\\\]]+/n - comment_without_iso2022 = /\A[^\\()]+/n - - PATTERN_TABLE = {} - PATTERN_TABLE['EUC'] = - [ - /\A(?:[#{atomchars}]+|#{iso2022str}|#{eucstr})+/n, - /\A(?:[#{tokenchars}]+|#{iso2022str}|#{eucstr})+/n, - quoted_with_iso2022, - domlit_with_iso2022, - comment_with_iso2022 - ] - PATTERN_TABLE['SJIS'] = - [ - /\A(?:[#{atomchars}]+|#{iso2022str}|#{sjisstr})+/n, - /\A(?:[#{tokenchars}]+|#{iso2022str}|#{sjisstr})+/n, - quoted_with_iso2022, - domlit_with_iso2022, - comment_with_iso2022 - ] - PATTERN_TABLE['UTF8'] = - [ - /\A(?:[#{atomchars}]+|#{utf8str})+/n, - /\A(?:[#{tokenchars}]+|#{utf8str})+/n, - quoted_without_iso2022, - domlit_without_iso2022, - comment_without_iso2022 - ] - PATTERN_TABLE['NONE'] = - [ - /\A[#{atomchars}]+/n, - /\A[#{tokenchars}]+/n, - quoted_without_iso2022, - domlit_without_iso2022, - comment_without_iso2022 - ] - - - def initialize( str, scantype, comments ) - init_scanner str - @comments = comments || [] - @debug = false - - # fix scanner mode - @received = (scantype == :RECEIVED) - @is_mime_header = MIME_HEADERS[scantype] - - atom, token, @quoted_re, @domlit_re, @comment_re = PATTERN_TABLE[$KCODE] - @word_re = (MIME_HEADERS[scantype] ? token : atom) - end - - attr_accessor :debug - - def scan( &block ) - if @debug - scan_main do |arr| - s, v = arr - printf "%7d %-10s %s\n", - rest_size(), - s.respond_to?(:id2name) ? s.id2name : s.inspect, - v.inspect - yield arr - end - else - scan_main(&block) - end - end - - private - - RECV_TOKEN = { - 'from' => :FROM, - 'by' => :BY, - 'via' => :VIA, - 'with' => :WITH, - 'id' => :ID, - 'for' => :FOR - } - - def scan_main - until eof? - if skip(/\A[\n\r\t ]+/n) # LWSP - break if eof? - end - - if s = readstr(@word_re) - if @is_mime_header - yield :TOKEN, s - else - # atom - if /\A\d+\z/ === s - yield :DIGIT, s - elsif @received - yield RECV_TOKEN[s.downcase] || :ATOM, s - else - yield :ATOM, s - end - end - - elsif skip(/\A"/) - yield :QUOTED, scan_quoted_word() - - elsif skip(/\A\[/) - yield :DOMLIT, scan_domain_literal() - - elsif skip(/\A\(/) - @comments.push scan_comment() - - else - c = readchar() - yield c, c - end - end - - yield false, '$' - end - - def scan_quoted_word - scan_qstr(@quoted_re, /\A"/, 'quoted-word') - end - - def scan_domain_literal - '[' + scan_qstr(@domlit_re, /\A\]/, 'domain-literal') + ']' - end - - def scan_qstr( pattern, terminal, type ) - result = '' - until eof? - if s = readstr(pattern) then result << s - elsif skip(terminal) then return result - elsif skip(/\A\\/) then result << readchar() - else - raise "TMail FATAL: not match in #{type}" - end - end - scan_error! "found unterminated #{type}" - end - - def scan_comment - result = '' - nest = 1 - content = @comment_re - - until eof? - if s = readstr(content) then result << s - elsif skip(/\A\)/) then nest -= 1 - return result if nest == 0 - result << ')' - elsif skip(/\A\(/) then nest += 1 - result << '(' - elsif skip(/\A\\/) then result << readchar() - else - raise 'TMail FATAL: not match in comment' - end - end - scan_error! 'found unterminated comment' - end - - # string scanner - - def init_scanner( str ) - @src = str - end - - def eof? - @src.empty? - end - - def rest_size - @src.size - end - - def readstr( re ) - if m = re.match(@src) - @src = m.post_match - m[0] - else - nil - end - end - - def readchar - readstr(/\A./) - end - - def skip( re ) - if m = re.match(@src) - @src = m.post_match - true - else - false - end - end - - def scan_error!( msg ) - raise SyntaxError, msg - end - - end - -end # module TMail -# -# stringio.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -class StringInput#:nodoc: - - include Enumerable - - class << self - - def new( str ) - if block_given? - begin - f = super - yield f - ensure - f.close if f - end - else - super - end - end - - alias open new - - end - - def initialize( str ) - @src = str - @pos = 0 - @closed = false - @lineno = 0 - end - - attr_reader :lineno - - def string - @src - end - - def inspect - "#<#{self.class}:#{@closed ? 'closed' : 'open'},src=#{@src[0,30].inspect}>" - end - - def close - stream_check! - @pos = nil - @closed = true - end - - def closed? - @closed - end - - def pos - stream_check! - [@pos, @src.size].min - end - - alias tell pos - - def seek( offset, whence = IO::SEEK_SET ) - stream_check! - case whence - when IO::SEEK_SET - @pos = offset - when IO::SEEK_CUR - @pos += offset - when IO::SEEK_END - @pos = @src.size - offset - else - raise ArgumentError, "unknown seek flag: #{whence}" - end - @pos = 0 if @pos < 0 - @pos = [@pos, @src.size + 1].min - offset - end - - def rewind - stream_check! - @pos = 0 - end - - def eof? - stream_check! - @pos > @src.size - end - - def each( &block ) - stream_check! - begin - @src.each(&block) - ensure - @pos = 0 - end - end - - def gets - stream_check! - if idx = @src.index(?\n, @pos) - idx += 1 # "\n".size - line = @src[ @pos ... idx ] - @pos = idx - @pos += 1 if @pos == @src.size - else - line = @src[ @pos .. -1 ] - @pos = @src.size + 1 - end - @lineno += 1 - - line - end - - def getc - stream_check! - ch = @src[@pos] - @pos += 1 - @pos += 1 if @pos == @src.size - ch - end - - def read( len = nil ) - stream_check! - return read_all unless len - str = @src[@pos, len] - @pos += len - @pos += 1 if @pos == @src.size - str - end - - alias sysread read - - def read_all - stream_check! - return nil if eof? - rest = @src[@pos ... @src.size] - @pos = @src.size + 1 - rest - end - - def stream_check! - @closed and raise IOError, 'closed stream' - end - -end - - -class StringOutput#:nodoc: - - class << self - - def new( str = '' ) - if block_given? - begin - f = super - yield f - ensure - f.close if f - end - else - super - end - end - - alias open new - - end - - def initialize( str = '' ) - @dest = str - @closed = false - end - - def close - @closed = true - end - - def closed? - @closed - end - - def string - @dest - end - - alias value string - alias to_str string - - def size - @dest.size - end - - alias pos size - - def inspect - "#<#{self.class}:#{@dest ? 'open' : 'closed'},#{id}>" - end - - def print( *args ) - stream_check! - raise ArgumentError, 'wrong # of argument (0 for >1)' if args.empty? - args.each do |s| - raise ArgumentError, 'nil not allowed' if s.nil? - @dest << s.to_s - end - nil - end - - def puts( *args ) - stream_check! - args.each do |str| - @dest << (s = str.to_s) - @dest << "\n" unless s[-1] == ?\n - end - @dest << "\n" if args.empty? - nil - end - - def putc( ch ) - stream_check! - @dest << ch.chr - nil - end - - def printf( *args ) - stream_check! - @dest << sprintf(*args) - nil - end - - def write( str ) - stream_check! - s = str.to_s - @dest << s - s.size - end - - alias syswrite write - - def <<( str ) - stream_check! - @dest << str.to_s - self - end - - private - - def stream_check! - @closed and raise IOError, 'closed stream' - end - -end -require 'tmail' -# -# utils.rb -# -#-- -# Copyright (c) 1998-2003 Minero Aoki -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ - -module TMail - - class SyntaxError < StandardError; end - - - def TMail.new_boundary - 'mimepart_' + random_tag - end - - def TMail.new_message_id( fqdn = nil ) - fqdn ||= ::Socket.gethostname - "<#{random_tag()}@#{fqdn}.tmail>" - end - - def TMail.random_tag - @uniq += 1 - t = Time.now - sprintf('%x%x_%x%x%d%x', - t.to_i, t.tv_usec, - $$, Thread.current.object_id, @uniq, rand(255)) - end - private_class_method :random_tag - - @uniq = 0 - - - module TextUtils - - aspecial = '()<>[]:;.\\,"' - tspecial = '()<>[];:\\,"/?=' - lwsp = " \t\r\n" - control = '\x00-\x1f\x7f-\xff' - - ATOM_UNSAFE = /[#{Regexp.quote aspecial}#{control}#{lwsp}]/n - PHRASE_UNSAFE = /[#{Regexp.quote aspecial}#{control}]/n - TOKEN_UNSAFE = /[#{Regexp.quote tspecial}#{control}#{lwsp}]/n - CONTROL_CHAR = /[#{control}]/n - - def atom_safe?( str ) - not ATOM_UNSAFE === str - end - - def quote_atom( str ) - (ATOM_UNSAFE === str) ? dquote(str) : str - end - - def quote_phrase( str ) - (PHRASE_UNSAFE === str) ? dquote(str) : str - end - - def token_safe?( str ) - not TOKEN_UNSAFE === str - end - - def quote_token( str ) - (TOKEN_UNSAFE === str) ? dquote(str) : str - end - - def dquote( str ) - '"' + str.gsub(/["\\]/n) {|s| '\\' + s } + '"' - end - private :dquote - - - def join_domain( arr ) - arr.map {|i| - if /\A\[.*\]\z/ === i - i - else - quote_atom(i) - end - }.join('.') - end - - - ZONESTR_TABLE = { - 'jst' => 9 * 60, - 'eet' => 2 * 60, - 'bst' => 1 * 60, - 'met' => 1 * 60, - 'gmt' => 0, - 'utc' => 0, - 'ut' => 0, - 'nst' => -(3 * 60 + 30), - 'ast' => -4 * 60, - 'edt' => -4 * 60, - 'est' => -5 * 60, - 'cdt' => -5 * 60, - 'cst' => -6 * 60, - 'mdt' => -6 * 60, - 'mst' => -7 * 60, - 'pdt' => -7 * 60, - 'pst' => -8 * 60, - 'a' => -1 * 60, - 'b' => -2 * 60, - 'c' => -3 * 60, - 'd' => -4 * 60, - 'e' => -5 * 60, - 'f' => -6 * 60, - 'g' => -7 * 60, - 'h' => -8 * 60, - 'i' => -9 * 60, - # j not use - 'k' => -10 * 60, - 'l' => -11 * 60, - 'm' => -12 * 60, - 'n' => 1 * 60, - 'o' => 2 * 60, - 'p' => 3 * 60, - 'q' => 4 * 60, - 'r' => 5 * 60, - 's' => 6 * 60, - 't' => 7 * 60, - 'u' => 8 * 60, - 'v' => 9 * 60, - 'w' => 10 * 60, - 'x' => 11 * 60, - 'y' => 12 * 60, - 'z' => 0 * 60 - } - - def timezone_string_to_unixtime( str ) - if m = /([\+\-])(\d\d?)(\d\d)/.match(str) - sec = (m[2].to_i * 60 + m[3].to_i) * 60 - m[1] == '-' ? -sec : sec - else - min = ZONESTR_TABLE[str.downcase] or - raise SyntaxError, "wrong timezone format '#{str}'" - min * 60 - end - end - - - WDAY = %w( Sun Mon Tue Wed Thu Fri Sat TMailBUG ) - MONTH = %w( TMailBUG Jan Feb Mar Apr May Jun - Jul Aug Sep Oct Nov Dec TMailBUG ) - - def time2str( tm ) - # [ruby-list:7928] - gmt = Time.at(tm.to_i) - gmt.gmtime - offset = tm.to_i - Time.local(*gmt.to_a[0,6].reverse).to_i - - # DO NOT USE strftime: setlocale() breaks it - sprintf '%s, %s %s %d %02d:%02d:%02d %+.2d%.2d', - WDAY[tm.wday], tm.mday, MONTH[tm.month], - tm.year, tm.hour, tm.min, tm.sec, - *(offset / 60).divmod(60) - end - - - MESSAGE_ID = /<[^\@>]+\@[^>\@]+>/ - - def message_id?( str ) - MESSAGE_ID === str - end - - - MIME_ENCODED = /=\?[^\s?=]+\?[QB]\?[^\s?=]+\?=/i - - def mime_encoded?( str ) - MIME_ENCODED === str - end - - - def decode_params( hash ) - new = Hash.new - encoded = nil - hash.each do |key, value| - if m = /\*(?:(\d+)\*)?\z/.match(key) - ((encoded ||= {})[m.pre_match] ||= [])[(m[1] || 0).to_i] = value - else - new[key] = to_kcode(value) - end - end - if encoded - encoded.each do |key, strings| - new[key] = decode_RFC2231(strings.join('')) - end - end - - new - end - - NKF_FLAGS = { - 'EUC' => '-e -m', - 'SJIS' => '-s -m' - } - - def to_kcode( str ) - flag = NKF_FLAGS[$KCODE] or return str - NKF.nkf(flag, str) - end - - RFC2231_ENCODED = /\A(?:iso-2022-jp|euc-jp|shift_jis|us-ascii)?'[a-z]*'/in - - def decode_RFC2231( str ) - m = RFC2231_ENCODED.match(str) or return str - begin - NKF.nkf(NKF_FLAGS[$KCODE], - m.post_match.gsub(/%[\da-f]{2}/in) {|s| s[1,2].hex.chr }) - rescue - m.post_match.gsub(/%[\da-f]{2}/in, "") - end - end - - end - -end -require 'tmail/info' -require 'tmail/mail' -require 'tmail/mailbox' -module ActionMailer - module VERSION #:nodoc: - MAJOR = 1 - MINOR = 2 - TINY = 5 - - STRING = [MAJOR, MINOR, TINY].join('.') - end -end -#-- -# Copyright (c) 2004 David Heinemeier Hansson -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#++ - -begin - require 'action_controller' -rescue LoadError - begin - require File.dirname(__FILE__) + '/../../actionpack/lib/action_controller' - rescue LoadError - require 'rubygems' - require_gem 'actionpack', '>= 1.9.1' - end -end - -$:.unshift(File.dirname(__FILE__) + "/action_mailer/vendor/") - -require 'action_mailer/base' -require 'action_mailer/helpers' -require 'action_mailer/mail_helper' -require 'action_mailer/quoting' -require 'tmail' -require 'net/smtp' - -ActionMailer::Base.class_eval do - include ActionMailer::Quoting - include ActionMailer::Helpers - - helper MailHelper -end - -silence_warnings { TMail::Encoder.const_set("MAX_LINE_LEN", 200) }module TestHelper - def test_format(text) - "#{text}" - end -end -$:.unshift(File.dirname(__FILE__) + "/../lib/") -$:.unshift File.dirname(__FILE__) + "/fixtures/helpers" - -require 'test/unit' -require 'action_mailer' - -module MailerHelper - def person_name - "Mr. Joe Person" - end -end - -class HelperMailer < ActionMailer::Base - helper MailerHelper - helper :test - - def use_helper(recipient) - recipients recipient - subject "using helpers" - from "tester@example.com" - end - - def use_test_helper(recipient) - recipients recipient - subject "using helpers" - from "tester@example.com" - self.body = { :text => "emphasize me!" } - end - - def use_mail_helper(recipient) - recipients recipient - subject "using mailing helpers" - from "tester@example.com" - self.body = { :text => - "But soft! What light through yonder window breaks? It is the east, " + - "and Juliet is the sun. Arise, fair sun, and kill the envious moon, " + - "which is sick and pale with grief that thou, her maid, art far more " + - "fair than she. Be not her maid, for she is envious! Her vestal " + - "livery is but sick and green, and none but fools do wear it. Cast " + - "it off!" - } - end - - def use_helper_method(recipient) - recipients recipient - subject "using helpers" - from "tester@example.com" - self.body = { :text => "emphasize me!" } - end - - private - - def name_of_the_mailer_class - self.class.name - end - helper_method :name_of_the_mailer_class -end - -HelperMailer.template_root = File.dirname(__FILE__) + "/fixtures" - -class MailerHelperTest < Test::Unit::TestCase - def new_mail( charset="utf-8" ) - mail = TMail::Mail.new - mail.set_content_type "text", "plain", { "charset" => charset } if charset - mail - end - - def setup - ActionMailer::Base.delivery_method = :test - ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] - - @recipient = 'test@localhost' - end - - def test_use_helper - mail = HelperMailer.create_use_helper(@recipient) - assert_match %r{Mr. Joe Person}, mail.encoded - end - - def test_use_test_helper - mail = HelperMailer.create_use_test_helper(@recipient) - assert_match %r{emphasize me!}, mail.encoded - end - - def test_use_helper_method - mail = HelperMailer.create_use_helper_method(@recipient) - assert_match %r{HelperMailer}, mail.encoded - end - - def test_use_mail_helper - mail = HelperMailer.create_use_mail_helper(@recipient) - assert_match %r{ But soft!}, mail.encoded - assert_match %r{east, and\n Juliet}, mail.encoded - end -end - -$:.unshift(File.dirname(__FILE__) + "/../lib/") - -require 'test/unit' -require 'action_mailer' - -class RenderMailer < ActionMailer::Base - def inline_template(recipient) - recipients recipient - subject "using helpers" - from "tester@example.com" - body render(:inline => "Hello, <%= @world %>", :body => { :world => "Earth" }) - end - - def file_template(recipient) - recipients recipient - subject "using helpers" - from "tester@example.com" - body render(:file => "signed_up", :body => { :recipient => recipient }) - end - - def initialize_defaults(method_name) - super - mailer_name "test_mailer" - end -end - -RenderMailer.template_root = File.dirname(__FILE__) + "/fixtures" - -class RenderHelperTest < Test::Unit::TestCase - def setup - ActionMailer::Base.delivery_method = :test - ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] - - @recipient = 'test@localhost' - end - - def test_inline_template - mail = RenderMailer.create_inline_template(@recipient) - assert_equal "Hello, Earth", mail.body.strip - end - - def test_file_template - mail = RenderMailer.create_file_template(@recipient) - assert_equal "Hello there, \n\nMr. test@localhost", mail.body.strip - end -end - -$:.unshift(File.dirname(__FILE__) + "/../lib/") - -require 'test/unit' -require 'action_mailer' - -class MockSMTP - def self.deliveries - @@deliveries - end - - def initialize - @@deliveries = [] - end - - def sendmail(mail, from, to) - @@deliveries << [mail, from, to] - end -end - -class Net::SMTP - def self.start(*args) - yield MockSMTP.new - end -end - -class FunkyPathMailer < ActionMailer::Base - self.template_root = "#{File.dirname(__FILE__)}/fixtures/path.with.dots" - - def multipart_with_template_path_with_dots(recipient) - recipients recipient - subject "Have a lovely picture" - from "Chad Fowler " - attachment :content_type => "image/jpeg", - :body => "not really a jpeg, we're only testing, after all" - end - - def template_path - "#{File.dirname(__FILE__)}/fixtures/path.with.dots" - end -end - -class TestMailer < ActionMailer::Base - - def signed_up(recipient) - @recipients = recipient - @subject = "[Signed up] Welcome #{recipient}" - @from = "system@loudthinking.com" - @sent_on = Time.local(2004, 12, 12) - @body["recipient"] = recipient - end - - def cancelled_account(recipient) - self.recipients = recipient - self.subject = "[Cancelled] Goodbye #{recipient}" - self.from = "system@loudthinking.com" - self.sent_on = Time.local(2004, 12, 12) - self.body = "Goodbye, Mr. #{recipient}" - end - - def cc_bcc(recipient) - recipients recipient - subject "testing bcc/cc" - from "system@loudthinking.com" - sent_on Time.local(2004, 12, 12) - cc "nobody@loudthinking.com" - bcc "root@loudthinking.com" - body "Nothing to see here." - end - - def iso_charset(recipient) - @recipients = recipient - @subject = "testing isø charsets" - @from = "system@loudthinking.com" - @sent_on = Time.local 2004, 12, 12 - @cc = "nobody@loudthinking.com" - @bcc = "root@loudthinking.com" - @body = "Nothing to see here." - @charset = "iso-8859-1" - end - - def unencoded_subject(recipient) - @recipients = recipient - @subject = "testing unencoded subject" - @from = "system@loudthinking.com" - @sent_on = Time.local 2004, 12, 12 - @cc = "nobody@loudthinking.com" - @bcc = "root@loudthinking.com" - @body = "Nothing to see here." - end - - def extended_headers(recipient) - @recipients = recipient - @subject = "testing extended headers" - @from = "Grytøyr " - @sent_on = Time.local 2004, 12, 12 - @cc = "Grytøyr " - @bcc = "Grytøyr " - @body = "Nothing to see here." - @charset = "iso-8859-1" - end - - def utf8_body(recipient) - @recipients = recipient - @subject = "testing utf-8 body" - @from = "Foo áëô îü " - @sent_on = Time.local 2004, 12, 12 - @cc = "Foo áëô îü " - @bcc = "Foo áëô îü " - @body = "åœö blah" - @charset = "utf-8" - end - - def multipart_with_mime_version(recipient) - recipients recipient - subject "multipart with mime_version" - from "test@example.com" - sent_on Time.local(2004, 12, 12) - mime_version "1.1" - content_type "multipart/alternative" - - part "text/plain" do |p| - p.body = "blah" - end - - part "text/html" do |p| - p.body = "blah" - end - end - - def multipart_with_utf8_subject(recipient) - recipients recipient - subject "Foo áëô îü" - from "test@example.com" - charset "utf-8" - - part "text/plain" do |p| - p.body = "blah" - end - - part "text/html" do |p| - p.body = "blah" - end - end - - def explicitly_multipart_example(recipient, ct=nil) - recipients recipient - subject "multipart example" - from "test@example.com" - sent_on Time.local(2004, 12, 12) - body "plain text default" - content_type ct if ct - - part "text/html" do |p| - p.charset = "iso-8859-1" - p.body = "blah" - end - - attachment :content_type => "image/jpeg", :filename => "foo.jpg", - :body => "123456789" - end - - def implicitly_multipart_example(recipient, cs = nil, order = nil) - @recipients = recipient - @subject = "multipart example" - @from = "test@example.com" - @sent_on = Time.local 2004, 12, 12 - @body = { "recipient" => recipient } - @charset = cs if cs - @implicit_parts_order = order if order - end - - def implicitly_multipart_with_utf8 - recipients "no.one@nowhere.test" - subject "Foo áëô îü" - from "some.one@somewhere.test" - template "implicitly_multipart_example" - body ({ "recipient" => "no.one@nowhere.test" }) - end - - def html_mail(recipient) - recipients recipient - subject "html mail" - from "test@example.com" - body "Emphasize this" - content_type "text/html" - end - - def html_mail_with_underscores(recipient) - subject "html mail with underscores" - body %{_Google} - end - - def custom_template(recipient) - recipients recipient - subject "[Signed up] Welcome #{recipient}" - from "system@loudthinking.com" - sent_on Time.local(2004, 12, 12) - template "signed_up" - - body["recipient"] = recipient - end - - def various_newlines(recipient) - recipients recipient - subject "various newlines" - from "test@example.com" - body "line #1\nline #2\rline #3\r\nline #4\r\r" + - "line #5\n\nline#6\r\n\r\nline #7" - end - - def various_newlines_multipart(recipient) - recipients recipient - subject "various newlines multipart" - from "test@example.com" - content_type "multipart/alternative" - part :content_type => "text/plain", :body => "line #1\nline #2\rline #3\r\nline #4\r\r" - part :content_type => "text/html", :body => "

    line #1

    \n

    line #2

    \r

    line #3

    \r\n

    line #4

    \r\r" - end - - def nested_multipart(recipient) - recipients recipient - subject "nested multipart" - from "test@example.com" - content_type "multipart/mixed" - part :content_type => "multipart/alternative", :content_disposition => "inline" do |p| - p.part :content_type => "text/plain", :body => "test text\nline #2" - p.part :content_type => "text/html", :body => "test HTML
    \nline #2" - end - attachment :content_type => "application/octet-stream",:filename => "test.txt", :body => "test abcdefghijklmnopqstuvwxyz" - end - - def attachment_with_custom_header(recipient) - recipients recipient - subject "custom header in attachment" - from "test@example.com" - content_type "multipart/related" - part :content_type => "text/html", :body => 'yo' - attachment :content_type => "image/jpeg",:filename => "test.jpeg", :body => "i am not a real picture", :headers => { 'Content-ID' => '' } - end - - def unnamed_attachment(recipient) - recipients recipient - subject "nested multipart" - from "test@example.com" - content_type "multipart/mixed" - part :content_type => "text/plain", :body => "hullo" - attachment :content_type => "application/octet-stream", :body => "test abcdefghijklmnopqstuvwxyz" - end - - def headers_with_nonalpha_chars(recipient) - recipients recipient - subject "nonalpha chars" - from "One: Two " - cc "Three: Four " - bcc "Five: Six " - body "testing" - end - - def custom_content_type_attributes - recipients "no.one@nowhere.test" - subject "custom content types" - from "some.one@somewhere.test" - content_type "text/plain; format=flowed" - body "testing" - end - - class < charset } - end - mail - end - - def setup - ActionMailer::Base.delivery_method = :test - ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] - - @recipient = 'test@localhost' - end - - def test_nested_parts - created = nil - assert_nothing_raised { created = TestMailer.create_nested_multipart(@recipient)} - assert_equal 2,created.parts.size - assert_equal 2,created.parts.first.parts.size - - assert_equal "multipart/mixed", created.content_type - assert_equal "multipart/alternative", created.parts.first.content_type - assert_equal "text/plain", created.parts.first.parts.first.content_type - assert_equal "text/html", created.parts.first.parts[1].content_type - assert_equal "application/octet-stream", created.parts[1].content_type - end - - def test_attachment_with_custom_header - created = nil - assert_nothing_raised { created = TestMailer.create_attachment_with_custom_header(@recipient)} - assert_equal "", created.parts[1].header['content-id'].to_s - end - - def test_signed_up - expected = new_mail - expected.to = @recipient - expected.subject = "[Signed up] Welcome #{@recipient}" - expected.body = "Hello there, \n\nMr. #{@recipient}" - expected.from = "system@loudthinking.com" - expected.date = Time.local(2004, 12, 12) - expected.mime_version = nil - - created = nil - assert_nothing_raised { created = TestMailer.create_signed_up(@recipient) } - assert_not_nil created - assert_equal expected.encoded, created.encoded - - assert_nothing_raised { TestMailer.deliver_signed_up(@recipient) } - assert_not_nil ActionMailer::Base.deliveries.first - assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded - end - - def test_custom_template - expected = new_mail - expected.to = @recipient - expected.subject = "[Signed up] Welcome #{@recipient}" - expected.body = "Hello there, \n\nMr. #{@recipient}" - expected.from = "system@loudthinking.com" - expected.date = Time.local(2004, 12, 12) - - created = nil - assert_nothing_raised { created = TestMailer.create_custom_template(@recipient) } - assert_not_nil created - assert_equal expected.encoded, created.encoded - end - - def test_cancelled_account - expected = new_mail - expected.to = @recipient - expected.subject = "[Cancelled] Goodbye #{@recipient}" - expected.body = "Goodbye, Mr. #{@recipient}" - expected.from = "system@loudthinking.com" - expected.date = Time.local(2004, 12, 12) - - created = nil - assert_nothing_raised { created = TestMailer.create_cancelled_account(@recipient) } - assert_not_nil created - assert_equal expected.encoded, created.encoded - - assert_nothing_raised { TestMailer.deliver_cancelled_account(@recipient) } - assert_not_nil ActionMailer::Base.deliveries.first - assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded - end - - def test_cc_bcc - expected = new_mail - expected.to = @recipient - expected.subject = "testing bcc/cc" - expected.body = "Nothing to see here." - expected.from = "system@loudthinking.com" - expected.cc = "nobody@loudthinking.com" - expected.bcc = "root@loudthinking.com" - expected.date = Time.local 2004, 12, 12 - - created = nil - assert_nothing_raised do - created = TestMailer.create_cc_bcc @recipient - end - assert_not_nil created - assert_equal expected.encoded, created.encoded - - assert_nothing_raised do - TestMailer.deliver_cc_bcc @recipient - end - - assert_not_nil ActionMailer::Base.deliveries.first - assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded - end - - def test_iso_charset - expected = new_mail( "iso-8859-1" ) - expected.to = @recipient - expected.subject = encode "testing isø charsets", "iso-8859-1" - expected.body = "Nothing to see here." - expected.from = "system@loudthinking.com" - expected.cc = "nobody@loudthinking.com" - expected.bcc = "root@loudthinking.com" - expected.date = Time.local 2004, 12, 12 - - created = nil - assert_nothing_raised do - created = TestMailer.create_iso_charset @recipient - end - assert_not_nil created - assert_equal expected.encoded, created.encoded - - assert_nothing_raised do - TestMailer.deliver_iso_charset @recipient - end - - assert_not_nil ActionMailer::Base.deliveries.first - assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded - end - - def test_unencoded_subject - expected = new_mail - expected.to = @recipient - expected.subject = "testing unencoded subject" - expected.body = "Nothing to see here." - expected.from = "system@loudthinking.com" - expected.cc = "nobody@loudthinking.com" - expected.bcc = "root@loudthinking.com" - expected.date = Time.local 2004, 12, 12 - - created = nil - assert_nothing_raised do - created = TestMailer.create_unencoded_subject @recipient - end - assert_not_nil created - assert_equal expected.encoded, created.encoded - - assert_nothing_raised do - TestMailer.deliver_unencoded_subject @recipient - end - - assert_not_nil ActionMailer::Base.deliveries.first - assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded - end - - def test_instances_are_nil - assert_nil ActionMailer::Base.new - assert_nil TestMailer.new - end - - def test_deliveries_array - assert_not_nil ActionMailer::Base.deliveries - assert_equal 0, ActionMailer::Base.deliveries.size - TestMailer.deliver_signed_up(@recipient) - assert_equal 1, ActionMailer::Base.deliveries.size - assert_not_nil ActionMailer::Base.deliveries.first - end - - def test_perform_deliveries_flag - ActionMailer::Base.perform_deliveries = false - TestMailer.deliver_signed_up(@recipient) - assert_equal 0, ActionMailer::Base.deliveries.size - ActionMailer::Base.perform_deliveries = true - TestMailer.deliver_signed_up(@recipient) - assert_equal 1, ActionMailer::Base.deliveries.size - end - - def test_unquote_quoted_printable_subject - msg = <" - - expected = new_mail "iso-8859-1" - expected.to = quote_address_if_necessary @recipient, "iso-8859-1" - expected.subject = "testing extended headers" - expected.body = "Nothing to see here." - expected.from = quote_address_if_necessary "Grytøyr ", "iso-8859-1" - expected.cc = quote_address_if_necessary "Grytøyr ", "iso-8859-1" - expected.bcc = quote_address_if_necessary "Grytøyr ", "iso-8859-1" - expected.date = Time.local 2004, 12, 12 - - created = nil - assert_nothing_raised do - created = TestMailer.create_extended_headers @recipient - end - - assert_not_nil created - assert_equal expected.encoded, created.encoded - - assert_nothing_raised do - TestMailer.deliver_extended_headers @recipient - end - - assert_not_nil ActionMailer::Base.deliveries.first - assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded - end - - def test_utf8_body_is_not_quoted - @recipient = "Foo áëô îü " - expected = new_mail "utf-8" - expected.to = quote_address_if_necessary @recipient, "utf-8" - expected.subject = "testing utf-8 body" - expected.body = "åœö blah" - expected.from = quote_address_if_necessary @recipient, "utf-8" - expected.cc = quote_address_if_necessary @recipient, "utf-8" - expected.bcc = quote_address_if_necessary @recipient, "utf-8" - expected.date = Time.local 2004, 12, 12 - - created = TestMailer.create_utf8_body @recipient - assert_match(/åœö blah/, created.encoded) - end - - def test_multiple_utf8_recipients - @recipient = ["\"Foo áëô îü\" ", "\"Example Recipient\" "] - expected = new_mail "utf-8" - expected.to = quote_address_if_necessary @recipient, "utf-8" - expected.subject = "testing utf-8 body" - expected.body = "åœö blah" - expected.from = quote_address_if_necessary @recipient.first, "utf-8" - expected.cc = quote_address_if_necessary @recipient, "utf-8" - expected.bcc = quote_address_if_necessary @recipient, "utf-8" - expected.date = Time.local 2004, 12, 12 - - created = TestMailer.create_utf8_body @recipient - assert_match(/\nFrom: =\?utf-8\?Q\?Foo_.*?\?= \r/, created.encoded) - assert_match(/\nTo: =\?utf-8\?Q\?Foo_.*?\?= , Example Recipient _Google}, mail.body - end - - def test_various_newlines - mail = TestMailer.create_various_newlines(@recipient) - assert_equal("line #1\nline #2\nline #3\nline #4\n\n" + - "line #5\n\nline#6\n\nline #7", mail.body) - end - - def test_various_newlines_multipart - mail = TestMailer.create_various_newlines_multipart(@recipient) - assert_equal "line #1\nline #2\nline #3\nline #4\n\n", mail.parts[0].body - assert_equal "

    line #1

    \n

    line #2

    \n

    line #3

    \n

    line #4

    \n\n", mail.parts[1].body - end - - def test_headers_removed_on_smtp_delivery - ActionMailer::Base.delivery_method = :smtp - TestMailer.deliver_cc_bcc(@recipient) - assert MockSMTP.deliveries[0][2].include?("root@loudthinking.com") - assert MockSMTP.deliveries[0][2].include?("nobody@loudthinking.com") - assert MockSMTP.deliveries[0][2].include?(@recipient) - assert_match %r{^Cc: nobody@loudthinking.com}, MockSMTP.deliveries[0][0] - assert_match %r{^To: #{@recipient}}, MockSMTP.deliveries[0][0] - assert_no_match %r{^Bcc: root@loudthinking.com}, MockSMTP.deliveries[0][0] - end - - def test_recursive_multipart_processing - fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email7") - mail = TMail::Mail.parse(fixture) - assert_equal "This is the first part.\n\nAttachment: test.rb\nAttachment: test.pdf\n\n\nAttachment: smime.p7s\n", mail.body - end - - def test_decode_encoded_attachment_filename - fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email8") - mail = TMail::Mail.parse(fixture) - attachment = mail.attachments.last - assert_equal "01QuienTeDijat.Pitbull.mp3", attachment.original_filename - end - - def test_wrong_mail_header - fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email9") - assert_raise(TMail::SyntaxError) { TMail::Mail.parse(fixture) } - end - - def test_decode_message_with_unknown_charset - fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email10") - mail = TMail::Mail.parse(fixture) - assert_nothing_raised { mail.body } - end - - def test_decode_message_with_unquoted_atchar_in_header - fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email11") - mail = TMail::Mail.parse(fixture) - assert_not_nil mail.from - end - - def test_empty_header_values_omitted - result = TestMailer.create_unnamed_attachment(@recipient).encoded - assert_match %r{Content-Type: application/octet-stream[^;]}, result - assert_match %r{Content-Disposition: attachment[^;]}, result - end - - def test_headers_with_nonalpha_chars - mail = TestMailer.create_headers_with_nonalpha_chars(@recipient) - assert !mail.from_addrs.empty? - assert !mail.cc_addrs.empty? - assert !mail.bcc_addrs.empty? - assert_match(/:/, mail.from_addrs.to_s) - assert_match(/:/, mail.cc_addrs.to_s) - assert_match(/:/, mail.bcc_addrs.to_s) - end - - def test_deliver_with_mail_object - mail = TestMailer.create_headers_with_nonalpha_chars(@recipient) - assert_nothing_raised { TestMailer.deliver(mail) } - assert_equal 1, TestMailer.deliveries.length - end - - def test_multipart_with_template_path_with_dots - mail = FunkyPathMailer.create_multipart_with_template_path_with_dots(@recipient) - assert_equal 2, mail.parts.length - end - - def test_custom_content_type_attributes - mail = TestMailer.create_custom_content_type_attributes - assert_match %r{format=flowed}, mail['content-type'].to_s - assert_match %r{charset=utf-8}, mail['content-type'].to_s - end -end - -class InheritableTemplateRootTest < Test::Unit::TestCase - def test_attr - expected = "#{File.dirname(__FILE__)}/fixtures/path.with.dots" - assert_equal expected, FunkyPathMailer.template_root - - sub = Class.new(FunkyPathMailer) - sub.template_root = 'test/path' - - assert_equal 'test/path', sub.template_root - assert_equal expected, FunkyPathMailer.template_root - end -end -$:.unshift(File.dirname(__FILE__) + "/../lib/") -$:.unshift(File.dirname(__FILE__) + "/../lib/action_mailer/vendor") - -require 'test/unit' -require 'tmail' -require 'tempfile' - -class QuotingTest < Test::Unit::TestCase - def test_quote_multibyte_chars - original = "\303\246 \303\270 and \303\245" - - result = execute_in_sandbox(<<-CODE) - $:.unshift(File.dirname(__FILE__) + "/../lib/") - $KCODE = 'u' - require 'jcode' - require 'action_mailer/quoting' - include ActionMailer::Quoting - quoted_printable(#{original.inspect}, "UTF-8") - CODE - - unquoted = TMail::Unquoter.unquote_and_convert_to(result, nil) - assert_equal unquoted, original - end - - private - - # This whole thing *could* be much simpler, but I don't think Tempfile, - # popen and others exist on all platforms (like Windows). - def execute_in_sandbox(code) - test_name = "#{File.dirname(__FILE__)}/am-quoting-test.#{$$}.rb" - res_name = "#{File.dirname(__FILE__)}/am-quoting-test.#{$$}.out" - - File.open(test_name, "w+") do |file| - file.write(<<-CODE) - block = Proc.new do - #{code} - end - puts block.call - CODE - end - - system("ruby #{test_name} > #{res_name}") or raise "could not run test in sandbox" - File.read(res_name) - ensure - File.delete(test_name) rescue nil - File.delete(res_name) rescue nil - end -end -$:.unshift(File.dirname(__FILE__) + "/../lib/") -$:.unshift File.dirname(__FILE__) + "/fixtures/helpers" - -require 'test/unit' -require 'action_mailer' - -class TMailMailTest < Test::Unit::TestCase - def test_body - m = TMail::Mail.new - expected = 'something_with_underscores' - m.encoding = 'quoted-printable' - quoted_body = [expected].pack('*M') - m.body = quoted_body - assert_equal "something_with_underscores=\n", m.quoted_body - assert_equal expected, m.body - end -end -$:.unshift(File.dirname(__FILE__) + "/../lib") - -require "action_controller" -require "action_controller/test_process" - -Person = Struct.new("Person", :id, :name, :email_address, :phone_number) - -class AddressBookService - attr_reader :people - - def initialize() @people = [] end - def create_person(data) people.unshift(Person.new(next_person_id, data["name"], data["email_address"], data["phone_number"])) end - def find_person(topic_id) people.select { |person| person.id == person.to_i }.first end - def next_person_id() people.first.id + 1 end -end - -class AddressBookController < ActionController::Base - layout "address_book/layout" - - before_filter :initialize_session_storage - - # Could also have used a proc - # before_filter proc { |c| c.instance_variable_set("@address_book", c.session["address_book"] ||= AddressBookService.new) } - - def index - @title = "Address Book" - @people = @address_book.people - end - - def person - @person = @address_book.find_person(@params["id"]) - end - - def create_person - @address_book.create_person(@params["person"]) - redirect_to :action => "index" - end - - private - def initialize_session_storage - @address_book = @session["address_book"] ||= AddressBookService.new - end -end - -ActionController::Base.template_root = File.dirname(__FILE__) -# ActionController::Base.logger = Logger.new("debug.log") # Remove first comment to turn on logging in current dir - -begin - AddressBookController.process_cgi(CGI.new) if $0 == __FILE__ -rescue => e - CGI.new.out { "#{e.class}: #{e.message}" } -end$:.unshift(File.dirname(__FILE__) + "/../lib") - -require "action_controller" -require 'action_controller/test_process' - -Person = Struct.new("Person", :name, :address, :age) - -class BenchmarkController < ActionController::Base - def message - render_text "hello world" - end - - def list - @people = [ Person.new("David"), Person.new("Mary") ] - render_template "hello: <% for person in @people %>Name: <%= person.name %><% end %>" - end - - def form_helper - @person = Person.new "david", "hyacintvej", 24 - render_template( - "<% person = Person.new 'Mary', 'hyacintvej', 22 %> " + - "change the name <%= text_field 'person', 'name' %> and <%= text_field 'person', 'address' %> and <%= text_field 'person', 'age' %>" - ) - end -end - -#ActionController::Base.template_root = File.dirname(__FILE__) - -require "benchmark" - -RUNS = ARGV[0] ? ARGV[0].to_i : 50 - -require "profile" if ARGV[1] - -runtime = Benchmark.measure { - RUNS.times { BenchmarkController.process_test(ActionController::TestRequest.new({ "action" => "list" })) } -} - -puts "List: #{RUNS / runtime.real}" - - -runtime = Benchmark.measure { - RUNS.times { BenchmarkController.process_test(ActionController::TestRequest.new({ "action" => "message" })) } -} - -puts "Message: #{RUNS / runtime.real}" - -runtime = Benchmark.measure { - RUNS.times { BenchmarkController.process_test(ActionController::TestRequest.new({ "action" => "form_helper" })) } -} - -puts "Form helper: #{RUNS / runtime.real}" -require 'rbconfig' -require 'find' -require 'ftools' - -include Config - -# this was adapted from rdoc's install.rb by ways of Log4r - -$sitedir = CONFIG["sitelibdir"] -unless $sitedir - version = CONFIG["MAJOR"] + "." + CONFIG["MINOR"] - $libdir = File.join(CONFIG["libdir"], "ruby", version) - $sitedir = $:.find {|x| x =~ /site_ruby/ } - if !$sitedir - $sitedir = File.join($libdir, "site_ruby") - elsif $sitedir !~ Regexp.quote(version) - $sitedir = File.join($sitedir, version) - end -end - -# the acual gruntwork -Dir.chdir("lib") - -Find.find("action_controller", "action_controller.rb", "action_view", "action_view.rb") { |f| - if f[-3..-1] == ".rb" - File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true) - else - File::makedirs(File.join($sitedir, *f.split(/\//))) - end -}require 'test/unit' -require 'test/unit/assertions' -require 'rexml/document' -require File.dirname(__FILE__) + "/vendor/html-scanner/html/document" - -module Test #:nodoc: - module Unit #:nodoc: - # In addition to these specific assertions, you also have easy access to various collections that the regular test/unit assertions - # can be used against. These collections are: - # - # * assigns: Instance variables assigned in the action that are available for the view. - # * session: Objects being saved in the session. - # * flash: The flash objects currently in the session. - # * cookies: Cookies being sent to the user on this request. - # - # These collections can be used just like any other hash: - # - # assert_not_nil assigns(:person) # makes sure that a @person instance variable was set - # assert_equal "Dave", cookies[:name] # makes sure that a cookie called :name was set as "Dave" - # assert flash.empty? # makes sure that there's nothing in the flash - # - # For historic reasons, the assigns hash uses string-based keys. So assigns[:person] won't work, but assigns["person"] will. To - # appease our yearning for symbols, though, an alternative accessor has been deviced using a method call instead of index referencing. - # So assigns(:person) will work just like assigns["person"], but again, assigns[:person] will not work. - # - # On top of the collections, you have the complete url that a given action redirected to available in redirect_to_url. - # - # For redirects within the same controller, you can even call follow_redirect and the redirect will be followed, triggering another - # action call which can then be asserted against. - # - # == Manipulating the request collections - # - # The collections described above link to the response, so you can test if what the actions were expected to do happened. But - # sometimes you also want to manipulate these collections in the incoming request. This is really only relevant for sessions - # and cookies, though. For sessions, you just do: - # - # @request.session[:key] = "value" - # - # For cookies, you need to manually create the cookie, like this: - # - # @request.cookies["key"] = CGI::Cookie.new("key", "value") - # - # == Testing named routes - # - # If you're using named routes, they can be easily tested using the original named routes methods straight in the test case. - # Example: - # - # assert_redirected_to page_url(:title => 'foo') - module Assertions - # Asserts that the response is one of the following types: - # - # * :success: Status code was 200 - # * :redirect: Status code was in the 300-399 range - # * :missing: Status code was 404 - # * :error: Status code was in the 500-599 range - # - # You can also pass an explicit status code number as the type, like assert_response(501) - def assert_response(type, message = nil) - clean_backtrace do - if [ :success, :missing, :redirect, :error ].include?(type) && @response.send("#{type}?") - assert_block("") { true } # to count the assertion - elsif type.is_a?(Fixnum) && @response.response_code == type - assert_block("") { true } # to count the assertion - else - assert_block(build_message(message, "Expected response to be a , but was ", type, @response.response_code)) { false } - end - end - end - - # Assert that the redirection options passed in match those of the redirect called in the latest action. This match can be partial, - # such that assert_redirected_to(:controller => "weblog") will also match the redirection of - # redirect_to(:controller => "weblog", :action => "show") and so on. - def assert_redirected_to(options = {}, message=nil) - clean_backtrace do - assert_response(:redirect, message) - - if options.is_a?(String) - msg = build_message(message, "expected a redirect to , found one to ", options, @response.redirect_url) - url_regexp = %r{^(\w+://.*?(/|$|\?))(.*)$} - eurl, epath, url, path = [options, @response.redirect_url].collect do |url| - u, p = (url_regexp =~ url) ? [$1, $3] : [nil, url] - [u, (p[0..0] == '/') ? p : '/' + p] - end.flatten - - assert_equal(eurl, url, msg) if eurl && url - assert_equal(epath, path, msg) if epath && path - else - @response_diff = options.diff(@response.redirected_to) if options.is_a?(Hash) && @response.redirected_to.is_a?(Hash) - msg = build_message(message, "response is not a redirection to all of the options supplied (redirection is )#{', difference: ' if @response_diff}", - @response.redirected_to || @response.redirect_url, @response_diff) - - assert_block(msg) do - if options.is_a?(Symbol) - @response.redirected_to == options - else - options.keys.all? do |k| - if k == :controller then options[k] == ActionController::Routing.controller_relative_to(@response.redirected_to[k], @controller.class.controller_path) - else options[k] == (@response.redirected_to[k].respond_to?(:to_param) ? @response.redirected_to[k].to_param : @response.redirected_to[k] unless @response.redirected_to[k].nil?) - end - end - end - end - end - end - end - - # Asserts that the request was rendered with the appropriate template file. - def assert_template(expected = nil, message=nil) - clean_backtrace do - rendered = expected ? @response.rendered_file(!expected.include?('/')) : @response.rendered_file - msg = build_message(message, "expecting but rendering with ", expected, rendered) - assert_block(msg) do - if expected.nil? - !@response.rendered_with_file? - else - expected == rendered - end - end - end - end - - # Asserts that the routing of the given path was handled correctly and that the parsed options match. - def assert_recognizes(expected_options, path, extras={}, message=nil) - clean_backtrace do - path = "/#{path}" unless path[0..0] == '/' - # Load routes.rb if it hasn't been loaded. - ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty? - - # Assume given controller - request = ActionController::TestRequest.new({}, {}, nil) - request.path = path - ActionController::Routing::Routes.recognize!(request) - - expected_options = expected_options.clone - extras.each_key { |key| expected_options.delete key } unless extras.nil? - - expected_options.stringify_keys! - msg = build_message(message, "The recognized options did not match ", - request.path_parameters, expected_options) - assert_block(msg) { request.path_parameters == expected_options } - end - end - - # Asserts that the provided options can be used to generate the provided path. - def assert_generates(expected_path, options, defaults={}, extras = {}, message=nil) - clean_backtrace do - expected_path = "/#{expected_path}" unless expected_path[0] == ?/ - # Load routes.rb if it hasn't been loaded. - ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty? - - generated_path, extra_keys = ActionController::Routing::Routes.generate(options, extras) - found_extras = options.reject {|k, v| ! extra_keys.include? k} - - msg = build_message(message, "found extras , not ", found_extras, extras) - assert_block(msg) { found_extras == extras } - - msg = build_message(message, "The generated path did not match ", generated_path, - expected_path) - assert_block(msg) { expected_path == generated_path } - end - end - - # Asserts that path and options match both ways; in other words, the URL generated from - # options is the same as path, and also that the options recognized from path are the same as options - def assert_routing(path, options, defaults={}, extras={}, message=nil) - assert_recognizes(options, path, extras, message) - - controller, default_controller = options[:controller], defaults[:controller] - if controller && controller.include?(?/) && default_controller && default_controller.include?(?/) - options[:controller] = "/#{controller}" - end - - assert_generates(path, options, defaults, extras, message) - end - - # Asserts that there is a tag/node/element in the body of the response - # that meets all of the given conditions. The +conditions+ parameter must - # be a hash of any of the following keys (all are optional): - # - # * :tag: the node type must match the corresponding value - # * :attributes: a hash. The node's attributes must match the - # corresponding values in the hash. - # * :parent: a hash. The node's parent must match the - # corresponding hash. - # * :child: a hash. At least one of the node's immediate children - # must meet the criteria described by the hash. - # * :ancestor: a hash. At least one of the node's ancestors must - # meet the criteria described by the hash. - # * :descendant: a hash. At least one of the node's descendants - # must meet the criteria described by the hash. - # * :sibling: a hash. At least one of the node's siblings must - # meet the criteria described by the hash. - # * :after: a hash. The node must be after any sibling meeting - # the criteria described by the hash, and at least one sibling must match. - # * :before: a hash. The node must be before any sibling meeting - # the criteria described by the hash, and at least one sibling must match. - # * :children: a hash, for counting children of a node. Accepts - # the keys: - # * :count: either a number or a range which must equal (or - # include) the number of children that match. - # * :less_than: the number of matching children must be less - # than this number. - # * :greater_than: the number of matching children must be - # greater than this number. - # * :only: another hash consisting of the keys to use - # to match on the children, and only matching children will be - # counted. - # * :content: the textual content of the node must match the - # given value. This will not match HTML tags in the body of a - # tag--only text. - # - # Conditions are matched using the following algorithm: - # - # * if the condition is a string, it must be a substring of the value. - # * if the condition is a regexp, it must match the value. - # * if the condition is a number, the value must match number.to_s. - # * if the condition is +true+, the value must not be +nil+. - # * if the condition is +false+ or +nil+, the value must be +nil+. - # - # Usage: - # - # # assert that there is a "span" tag - # assert_tag :tag => "span" - # - # # assert that there is a "span" tag with id="x" - # assert_tag :tag => "span", :attributes => { :id => "x" } - # - # # assert that there is a "span" tag using the short-hand - # assert_tag :span - # - # # assert that there is a "span" tag with id="x" using the short-hand - # assert_tag :span, :attributes => { :id => "x" } - # - # # assert that there is a "span" inside of a "div" - # assert_tag :tag => "span", :parent => { :tag => "div" } - # - # # assert that there is a "span" somewhere inside a table - # assert_tag :tag => "span", :ancestor => { :tag => "table" } - # - # # assert that there is a "span" with at least one "em" child - # assert_tag :tag => "span", :child => { :tag => "em" } - # - # # assert that there is a "span" containing a (possibly nested) - # # "strong" tag. - # assert_tag :tag => "span", :descendant => { :tag => "strong" } - # - # # assert that there is a "span" containing between 2 and 4 "em" tags - # # as immediate children - # assert_tag :tag => "span", - # :children => { :count => 2..4, :only => { :tag => "em" } } - # - # # get funky: assert that there is a "div", with an "ul" ancestor - # # and an "li" parent (with "class" = "enum"), and containing a - # # "span" descendant that contains text matching /hello world/ - # assert_tag :tag => "div", - # :ancestor => { :tag => "ul" }, - # :parent => { :tag => "li", - # :attributes => { :class => "enum" } }, - # :descendant => { :tag => "span", - # :child => /hello world/ } - # - # Please noteYou must explicitly - # close all of your tags to use these assertions.
    - def assert_tag(*opts) - clean_backtrace do - opts = opts.size > 1 ? opts.last.merge({ :tag => opts.first.to_s }) : opts.first - tag = find_tag(opts) - assert tag, "expected tag, but no tag found matching #{opts.inspect} in:\n#{@response.body.inspect}" - end - end - - # Identical to #assert_tag, but asserts that a matching tag does _not_ - # exist. (See #assert_tag for a full discussion of the syntax.) - def assert_no_tag(*opts) - clean_backtrace do - opts = opts.size > 1 ? opts.last.merge({ :tag => opts.first.to_s }) : opts.first - tag = find_tag(opts) - assert !tag, "expected no tag, but found tag matching #{opts.inspect} in:\n#{@response.body.inspect}" - end - end - - # test 2 html strings to be equivalent, i.e. identical up to reordering of attributes - def assert_dom_equal(expected, actual, message="") - clean_backtrace do - expected_dom = HTML::Document.new(expected).root - actual_dom = HTML::Document.new(actual).root - full_message = build_message(message, " expected to be == to\n.", expected_dom.to_s, actual_dom.to_s) - assert_block(full_message) { expected_dom == actual_dom } - end - end - - # negated form of +assert_dom_equivalent+ - def assert_dom_not_equal(expected, actual, message="") - clean_backtrace do - expected_dom = HTML::Document.new(expected).root - actual_dom = HTML::Document.new(actual).root - full_message = build_message(message, " expected to be != to\n.", expected_dom.to_s, actual_dom.to_s) - assert_block(full_message) { expected_dom != actual_dom } - end - end - - # ensures that the passed record is valid by active record standards. returns the error messages if not - def assert_valid(record) - clean_backtrace do - assert record.valid?, record.errors.full_messages.join("\n") - end - end - - def clean_backtrace(&block) - yield - rescue AssertionFailedError => e - path = File.expand_path(__FILE__) - raise AssertionFailedError, e.message, e.backtrace.reject { |line| File.expand_path(line) =~ /#{path}/ } - end - end - end -end -require 'action_controller/mime_type' -require 'action_controller/request' -require 'action_controller/response' -require 'action_controller/routing' -require 'action_controller/code_generation' -require 'action_controller/url_rewriter' -require 'drb' -require 'set' - -module ActionController #:nodoc: - class ActionControllerError < StandardError #:nodoc: - end - class SessionRestoreError < ActionControllerError #:nodoc: - end - class MissingTemplate < ActionControllerError #:nodoc: - end - class RoutingError < ActionControllerError #:nodoc: - attr_reader :failures - def initialize(message, failures=[]) - super(message) - @failures = failures - end - end - class UnknownController < ActionControllerError #:nodoc: - end - class UnknownAction < ActionControllerError #:nodoc: - end - class MissingFile < ActionControllerError #:nodoc: - end - class SessionOverflowError < ActionControllerError #:nodoc: - DEFAULT_MESSAGE = 'Your session data is larger than the data column in which it is to be stored. You must increase the size of your data column if you intend to store large data.' - - def initialize(message = nil) - super(message || DEFAULT_MESSAGE) - end - end - class DoubleRenderError < ActionControllerError #:nodoc: - DEFAULT_MESSAGE = "Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and only once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like \"redirect_to(...) and return\". Finally, note that to cause a before filter to halt execution of the rest of the filter chain, the filter must return false, explicitly, so \"render(...) and return false\"." - - def initialize(message = nil) - super(message || DEFAULT_MESSAGE) - end - end - class RedirectBackError < ActionControllerError #:nodoc: - DEFAULT_MESSAGE = 'No HTTP_REFERER was set in the request to this action, so redirect_to :back could not be called successfully. If this is a test, make sure to specify @request.env["HTTP_REFERER"].' - - def initialize(message = nil) - super(message || DEFAULT_MESSAGE) - end - end - - # Action Controllers are the core of a web request in Rails. They are made up of one or more actions that are executed - # on request and then either render a template or redirect to another action. An action is defined as a public method - # on the controller, which will automatically be made accessible to the web-server through Rails Routes. - # - # A sample controller could look like this: - # - # class GuestBookController < ActionController::Base - # def index - # @entries = Entry.find(:all) - # end - # - # def sign - # Entry.create(params[:entry]) - # redirect_to :action => "index" - # end - # end - # - # Actions, by default, render a template in the app/views directory corresponding to the name of the controller and action - # after executing code in the action. For example, the +index+ action of the +GuestBookController+ would render the - # template app/views/guestbook/index.rhtml by default after populating the @entries instance variable. - # - # Unlike index, the sign action will not render a template. After performing its main purpose (creating a - # new entry in the guest book), it initiates a redirect instead. This redirect works by returning an external - # "302 Moved" HTTP response that takes the user to the index action. - # - # The index and sign represent the two basic action archetypes used in Action Controllers. Get-and-show and do-and-redirect. - # Most actions are variations of these themes. - # - # == Requests - # - # Requests are processed by the Action Controller framework by extracting the value of the "action" key in the request parameters. - # This value should hold the name of the action to be performed. Once the action has been identified, the remaining - # request parameters, the session (if one is available), and the full request with all the http headers are made available to - # the action through instance variables. Then the action is performed. - # - # The full request object is available with the request accessor and is primarily used to query for http headers. These queries - # are made by accessing the environment hash, like this: - # - # def server_ip - # location = request.env["SERVER_ADDR"] - # render :text => "This server hosted at #{location}" - # end - # - # == Parameters - # - # All request parameters, whether they come from a GET or POST request, or from the URL, are available through the params method - # which returns a hash. For example, an action that was performed through /weblog/list?category=All&limit=5 will include - # { "category" => "All", "limit" => 5 } in params. - # - # It's also possible to construct multi-dimensional parameter hashes by specifying keys using brackets, such as: - # - # - # - # - # A request stemming from a form holding these inputs will include { "post" => { "name" => "david", "address" => "hyacintvej" } }. - # If the address input had been named "post[address][street]", the params would have included - # { "post" => { "address" => { "street" => "hyacintvej" } } }. There's no limit to the depth of the nesting. - # - # == Sessions - # - # Sessions allows you to store objects in between requests. This is useful for objects that are not yet ready to be persisted, - # such as a Signup object constructed in a multi-paged process, or objects that don't change much and are needed all the time, such - # as a User object for a system that requires login. The session should not be used, however, as a cache for objects where it's likely - # they could be changed unknowingly. It's usually too much work to keep it all synchronized -- something databases already excel at. - # - # You can place objects in the session by using the session method, which accesses a hash: - # - # session[:person] = Person.authenticate(user_name, password) - # - # And retrieved again through the same hash: - # - # Hello #{session[:person]} - # - # For removing objects from the session, you can either assign a single key to nil, like session[:person] = nil, or you can - # remove the entire session with reset_session. - # - # By default, sessions are stored on the file system in RAILS_ROOT/tmp/sessions. Any object can be placed in the session - # (as long as it can be Marshalled). But remember that 1000 active sessions each storing a 50kb object could lead to a 50MB store on the filesystem. - # In other words, think carefully about size and caching before resorting to the use of the session on the filesystem. - # - # An alternative to storing sessions on disk is to use ActiveRecordStore to store sessions in your database, which can solve problems - # caused by storing sessions in the file system and may speed up your application. To use ActiveRecordStore, uncomment the line: - # - # config.action_controller.session_store = :active_record_store - # - # in your environment.rb and run rake db:sessions:create. - # - # == Responses - # - # Each action results in a response, which holds the headers and document to be sent to the user's browser. The actual response - # object is generated automatically through the use of renders and redirects and requires no user intervention. - # - # == Renders - # - # Action Controller sends content to the user by using one of five rendering methods. The most versatile and common is the rendering - # of a template. Included in the Action Pack is the Action View, which enables rendering of ERb templates. It's automatically configured. - # The controller passes objects to the view by assigning instance variables: - # - # def show - # @post = Post.find(params[:id]) - # end - # - # Which are then automatically available to the view: - # - # Title: <%= @post.title %> - # - # You don't have to rely on the automated rendering. Especially actions that could result in the rendering of different templates will use - # the manual rendering methods: - # - # def search - # @results = Search.find(params[:query]) - # case @results - # when 0 then render :action => "no_results" - # when 1 then render :action => "show" - # when 2..10 then render :action => "show_many" - # end - # end - # - # Read more about writing ERb and Builder templates in link:classes/ActionView/Base.html. - # - # == Redirects - # - # Redirects are used to move from one action to another. For example, after a create action, which stores a blog entry to a database, - # we might like to show the user the new entry. Because we're following good DRY principles (Don't Repeat Yourself), we're going to reuse (and redirect to) - # a show action that we'll assume has already been created. The code might look like this: - # - # def create - # @entry = Entry.new(params[:entry]) - # if @entry.save - # # The entry was saved correctly, redirect to show - # redirect_to :action => 'show', :id => @entry.id - # else - # # things didn't go so well, do something else - # end - # end - # - # In this case, after saving our new entry to the database, the user is redirected to the show method which is then executed. - # - # == Calling multiple redirects or renders - # - # An action should conclude with a single render or redirect. Attempting to try to do either again will result in a DoubleRenderError: - # - # def do_something - # redirect_to :action => "elsewhere" - # render :action => "overthere" # raises DoubleRenderError - # end - # - # If you need to redirect on the condition of something, then be sure to add "and return" to halt execution. - # - # def do_something - # redirect_to(:action => "elsewhere") and return if monkeys.nil? - # render :action => "overthere" # won't be called unless monkeys is nil - # end - # - class Base - DEFAULT_RENDER_STATUS_CODE = "200 OK" - - include Reloadable::Subclasses - - # Determines whether the view has access to controller internals @request, @response, @session, and @template. - # By default, it does. - @@view_controller_internals = true - cattr_accessor :view_controller_internals - - # Protected instance variable cache - @@protected_variables_cache = nil - cattr_accessor :protected_variables_cache - - # Prepends all the URL-generating helpers from AssetHelper. This makes it possible to easily move javascripts, stylesheets, - # and images to a dedicated asset server away from the main web server. Example: - # ActionController::Base.asset_host = "http://assets.example.com" - @@asset_host = "" - cattr_accessor :asset_host - - # All requests are considered local by default, so everyone will be exposed to detailed debugging screens on errors. - # When the application is ready to go public, this should be set to false, and the protected method local_request? - # should instead be implemented in the controller to determine when debugging screens should be shown. - @@consider_all_requests_local = true - cattr_accessor :consider_all_requests_local - - # Enable or disable the collection of failure information for RoutingErrors. - # This information can be extremely useful when tweaking custom routes, but is - # pointless once routes have been tested and verified. - @@debug_routes = true - cattr_accessor :debug_routes - - # Controls whether the application is thread-safe, so multi-threaded servers like WEBrick know whether to apply a mutex - # around the performance of each action. Action Pack and Active Record are by default thread-safe, but many applications - # may not be. Turned off by default. - @@allow_concurrency = false - cattr_accessor :allow_concurrency - - # Modern REST web services often need to submit complex data to the web application. - # The param_parsers hash lets you register handlers wich will process the http body and add parameters to the - # params hash. These handlers are invoked for post and put requests. - # - # By default application/xml is enabled. A XmlSimple class with the same param name as the root will be instanciated - # in the params. This allows XML requests to mask themselves as regular form submissions, so you can have one - # action serve both regular forms and web service requests. - # - # Example of doing your own parser for a custom content type: - # - # ActionController::Base.param_parsers[Mime::Type.lookup('application/atom+xml')] = Proc.new do |data| - # node = REXML::Document.new(post) - # { node.root.name => node.root } - # end - # - # Note: Up until release 1.1 of Rails, Action Controller would default to using XmlSimple configured to discard the - # root node for such requests. The new default is to keep the root, such that "David" results - # in params[:r][:name] for "David" instead of params[:name]. To get the old behavior, you can - # re-register XmlSimple as application/xml handler ike this: - # - # ActionController::Base.param_parsers[Mime::XML] = - # Proc.new { |data| XmlSimple.xml_in(data, 'ForceArray' => false) } - # - # A YAML parser is also available and can be turned on with: - # - # ActionController::Base.param_parsers[Mime::YAML] = :yaml - @@param_parsers = { Mime::XML => :xml_simple } - cattr_accessor :param_parsers - - # Template root determines the base from which template references will be made. So a call to render("test/template") - # will be converted to "#{template_root}/test/template.rhtml". - class_inheritable_accessor :template_root - - # The logger is used for generating information on the action run-time (including benchmarking) if available. - # Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers. - cattr_accessor :logger - - # Determines which template class should be used by ActionController. - cattr_accessor :template_class - - # Turn on +ignore_missing_templates+ if you want to unit test actions without making the associated templates. - cattr_accessor :ignore_missing_templates - - # Holds the request object that's primarily used to get environment variables through access like - # request.env["REQUEST_URI"]. - attr_accessor :request - - # Holds a hash of all the GET, POST, and Url parameters passed to the action. Accessed like params["post_id"] - # to get the post_id. No type casts are made, so all values are returned as strings. - attr_accessor :params - - # Holds the response object that's primarily used to set additional HTTP headers through access like - # response.headers["Cache-Control"] = "no-cache". Can also be used to access the final body HTML after a template - # has been rendered through response.body -- useful for after_filters that wants to manipulate the output, - # such as a OutputCompressionFilter. - attr_accessor :response - - # Holds a hash of objects in the session. Accessed like session[:person] to get the object tied to the "person" - # key. The session will hold any type of object as values, but the key should be a string or symbol. - attr_accessor :session - - # Holds a hash of header names and values. Accessed like headers["Cache-Control"] to get the value of the Cache-Control - # directive. Values should always be specified as strings. - attr_accessor :headers - - # Holds the hash of variables that are passed on to the template class to be made available to the view. This hash - # is generated by taking a snapshot of all the instance variables in the current scope just before a template is rendered. - attr_accessor :assigns - - # Returns the name of the action this controller is processing. - attr_accessor :action_name - - class << self - # Factory for the standard create, process loop where the controller is discarded after processing. - def process(request, response) #:nodoc: - new.process(request, response) - end - - # Converts the class name from something like "OneModule::TwoModule::NeatController" to "NeatController". - def controller_class_name - @controller_class_name ||= name.demodulize - end - - # Converts the class name from something like "OneModule::TwoModule::NeatController" to "neat". - def controller_name - @controller_name ||= controller_class_name.sub(/Controller$/, '').underscore - end - - # Converts the class name from something like "OneModule::TwoModule::NeatController" to "one_module/two_module/neat". - def controller_path - @controller_path ||= name.gsub(/Controller$/, '').underscore - end - - # Return an array containing the names of public methods that have been marked hidden from the action processor. - # By default, all methods defined in ActionController::Base and included modules are hidden. - # More methods can be hidden using hide_actions. - def hidden_actions - write_inheritable_attribute(:hidden_actions, ActionController::Base.public_instance_methods) unless read_inheritable_attribute(:hidden_actions) - read_inheritable_attribute(:hidden_actions) - end - - # Hide each of the given methods from being callable as actions. - def hide_action(*names) - write_inheritable_attribute(:hidden_actions, hidden_actions | names.collect { |n| n.to_s }) - end - - # Replace sensitive paramater data from the request log. - # Filters paramaters that have any of the arguments as a substring. - # Looks in all subhashes of the param hash for keys to filter. - # If a block is given, each key and value of the paramater hash and all - # subhashes is passed to it, the value or key - # can be replaced using String#replace or similar method. - # - # Examples: - # filter_parameter_logging - # => Does nothing, just slows the logging process down - # - # filter_parameter_logging :password - # => replaces the value to all keys matching /password/i with "[FILTERED]" - # - # filter_parameter_logging :foo, "bar" - # => replaces the value to all keys matching /foo|bar/i with "[FILTERED]" - # - # filter_parameter_logging { |k,v| v.reverse! if k =~ /secret/i } - # => reverses the value to all keys matching /secret/i - # - # filter_parameter_logging(:foo, "bar") { |k,v| v.reverse! if k =~ /secret/i } - # => reverses the value to all keys matching /secret/i, and - # replaces the value to all keys matching /foo|bar/i with "[FILTERED]" - def filter_parameter_logging(*filter_words, &block) - parameter_filter = Regexp.new(filter_words.collect{ |s| s.to_s }.join('|'), true) if filter_words.length > 0 - - define_method(:filter_parameters) do |unfiltered_parameters| - filtered_parameters = {} - - unfiltered_parameters.each do |key, value| - if key =~ parameter_filter - filtered_parameters[key] = '[FILTERED]' - elsif value.is_a?(Hash) - filtered_parameters[key] = filter_parameters(value) - elsif block_given? - key, value = key.dup, value.dup - yield key, value - filtered_parameters[key] = value - else - filtered_parameters[key] = value - end - end - - filtered_parameters - end - end - end - - public - # Extracts the action_name from the request parameters and performs that action. - def process(request, response, method = :perform_action, *arguments) #:nodoc: - initialize_template_class(response) - assign_shortcuts(request, response) - initialize_current_url - assign_names - forget_variables_added_to_assigns - - log_processing - send(method, *arguments) - - response - ensure - process_cleanup - end - - # Returns a URL that has been rewritten according to the options hash and the defined Routes. - # (For doing a complete redirect, use redirect_to). - #   - # url_for is used to: - #   - # All keys given to url_for are forwarded to the Route module, save for the following: - # * :anchor -- specifies the anchor name to be appended to the path. For example, - # url_for :controller => 'posts', :action => 'show', :id => 10, :anchor => 'comments' - # will produce "/posts/show/10#comments". - # * :only_path -- if true, returns the absolute URL (omitting the protocol, host name, and port) - # * :trailing_slash -- if true, adds a trailing slash, as in "/archive/2005/". Note that this - # is currently not recommended since it breaks caching. - # * :host -- overrides the default (current) host if provided - # * :protocol -- overrides the default (current) protocol if provided - # - # The URL is generated from the remaining keys in the hash. A URL contains two key parts: the and a query string. - # Routes composes a query string as the key/value pairs not included in the . - # - # The default Routes setup supports a typical Rails path of "controller/action/id" where action and id are optional, with - # action defaulting to 'index' when not given. Here are some typical url_for statements and their corresponding URLs: - #   - # url_for :controller => 'posts', :action => 'recent' # => 'proto://host.com/posts/recent' - # url_for :controller => 'posts', :action => 'index' # => 'proto://host.com/posts' - # url_for :controller => 'posts', :action => 'show', :id => 10 # => 'proto://host.com/posts/show/10' - # - # When generating a new URL, missing values may be filled in from the current request's parameters. For example, - # url_for :action => 'some_action' will retain the current controller, as expected. This behavior extends to - # other parameters, including :controller, :id, and any other parameters that are placed into a Route's - # path. - #   - # The URL helpers such as url_for have a limited form of memory: when generating a new URL, they can look for - # missing values in the current request's parameters. Routes attempts to guess when a value should and should not be - # taken from the defaults. There are a few simple rules on how this is performed: - # - # * If the controller name begins with a slash, no defaults are used: url_for :controller => '/home' - # * If the controller changes, the action will default to index unless provided - # - # The final rule is applied while the URL is being generated and is best illustrated by an example. Let us consider the - # route given by map.connect 'people/:last/:first/:action', :action => 'bio', :controller => 'people'. - # - # Suppose that the current URL is "people/hh/david/contacts". Let's consider a few different cases of URLs which are generated - # from this page. - # - # * url_for :action => 'bio' -- During the generation of this URL, default values will be used for the first and - # last components, and the action shall change. The generated URL will be, "people/hh/david/bio". - # * url_for :first => 'davids-little-brother' This generates the URL 'people/hh/davids-little-brother' -- note - # that this URL leaves out the assumed action of 'bio'. - # - # However, you might ask why the action from the current request, 'contacts', isn't carried over into the new URL. The - # answer has to do with the order in which the parameters appear in the generated path. In a nutshell, since the - # value that appears in the slot for :first is not equal to default value for :first we stop using - # defaults. On it's own, this rule can account for much of the typical Rails URL behavior. - #   - # Although a convienence, defaults can occasionaly get in your way. In some cases a default persists longer than desired. - # The default may be cleared by adding :name => nil to url_for's options. - # This is often required when writing form helpers, since the defaults in play may vary greatly depending upon where the - # helper is used from. The following line will redirect to PostController's default action, regardless of the page it is - # displayed on: - # - # url_for :controller => 'posts', :action => nil - # - # If you explicitly want to create a URL that's almost the same as the current URL, you can do so using the - # :overwrite_params options. Say for your posts you have different views for showing and printing them. - # Then, in the show view, you get the URL for the print view like this - # - # url_for :overwrite_params => { :action => 'print' } - # - # This takes the current URL as is and only exchanges the action. In contrast, url_for :action => 'print' - # would have slashed-off the path components after the changed action. - def url_for(options = {}, *parameters_for_method_reference) #:doc: - case options - when String then options - when Symbol then send(options, *parameters_for_method_reference) - when Hash then @url.rewrite(rewrite_options(options)) - end - end - - # Converts the class name from something like "OneModule::TwoModule::NeatController" to "NeatController". - def controller_class_name - self.class.controller_class_name - end - - # Converts the class name from something like "OneModule::TwoModule::NeatController" to "neat". - def controller_name - self.class.controller_name - end - - def session_enabled? - request.session_options[:disabled] != false - end - - protected - # Renders the content that will be returned to the browser as the response body. - # - # === Rendering an action - # - # Action rendering is the most common form and the type used automatically by Action Controller when nothing else is - # specified. By default, actions are rendered within the current layout (if one exists). - # - # # Renders the template for the action "goal" within the current controller - # render :action => "goal" - # - # # Renders the template for the action "short_goal" within the current controller, - # # but without the current active layout - # render :action => "short_goal", :layout => false - # - # # Renders the template for the action "long_goal" within the current controller, - # # but with a custom layout - # render :action => "long_goal", :layout => "spectacular" - # - # _Deprecation_ _notice_: This used to have the signatures render_action("action", status = 200), - # render_without_layout("controller/action", status = 200), and - # render_with_layout("controller/action", status = 200, layout). - # - # === Rendering partials - # - # Partial rendering is most commonly used together with Ajax calls that only update one or a few elements on a page - # without reloading. Rendering of partials from the controller makes it possible to use the same partial template in - # both the full-page rendering (by calling it from within the template) and when sub-page updates happen (from the - # controller action responding to Ajax calls). By default, the current layout is not used. - # - # # Renders the partial located at app/views/controller/_win.r(html|xml) - # render :partial => "win" - # - # # Renders the partial with a status code of 500 (internal error) - # render :partial => "broken", :status => 500 - # - # # Renders the same partial but also makes a local variable available to it - # render :partial => "win", :locals => { :name => "david" } - # - # # Renders a collection of the same partial by making each element of @wins available through - # # the local variable "win" as it builds the complete response - # render :partial => "win", :collection => @wins - # - # # Renders the same collection of partials, but also renders the win_divider partial in between - # # each win partial. - # render :partial => "win", :collection => @wins, :spacer_template => "win_divider" - # - # _Deprecation_ _notice_: This used to have the signatures - # render_partial(partial_path = default_template_name, object = nil, local_assigns = {}) and - # render_partial_collection(partial_name, collection, partial_spacer_template = nil, local_assigns = {}). - # - # === Rendering a template - # - # Template rendering works just like action rendering except that it takes a path relative to the template root. - # The current layout is automatically applied. - # - # # Renders the template located in [TEMPLATE_ROOT]/weblog/show.r(html|xml) (in Rails, app/views/weblog/show.rhtml) - # render :template => "weblog/show" - # - # === Rendering a file - # - # File rendering works just like action rendering except that it takes a filesystem path. By default, the path - # is assumed to be absolute, and the current layout is not applied. - # - # # Renders the template located at the absolute filesystem path - # render :file => "/path/to/some/template.rhtml" - # render :file => "c:/path/to/some/template.rhtml" - # - # # Renders a template within the current layout, and with a 404 status code - # render :file => "/path/to/some/template.rhtml", :layout => true, :status => 404 - # render :file => "c:/path/to/some/template.rhtml", :layout => true, :status => 404 - # - # # Renders a template relative to the template root and chooses the proper file extension - # render :file => "some/template", :use_full_path => true - # - # _Deprecation_ _notice_: This used to have the signature render_file(path, status = 200) - # - # === Rendering text - # - # Rendering of text is usually used for tests or for rendering prepared content, such as a cache. By default, text - # rendering is not done within the active layout. - # - # # Renders the clear text "hello world" with status code 200 - # render :text => "hello world!" - # - # # Renders the clear text "Explosion!" with status code 500 - # render :text => "Explosion!", :status => 500 - # - # # Renders the clear text "Hi there!" within the current active layout (if one exists) - # render :text => "Explosion!", :layout => true - # - # # Renders the clear text "Hi there!" within the layout - # # placed in "app/views/layouts/special.r(html|xml)" - # render :text => "Explosion!", :layout => "special" - # - # _Deprecation_ _notice_: This used to have the signature render_text("text", status = 200) - # - # === Rendering an inline template - # - # Rendering of an inline template works as a cross between text and action rendering where the source for the template - # is supplied inline, like text, but its interpreted with ERb or Builder, like action. By default, ERb is used for rendering - # and the current layout is not used. - # - # # Renders "hello, hello, hello, again" - # render :inline => "<%= 'hello, ' * 3 + 'again' %>" - # - # # Renders "

    Good seeing you!

    " using Builder - # render :inline => "xml.p { 'Good seeing you!' }", :type => :rxml - # - # # Renders "hello david" - # render :inline => "<%= 'hello ' + name %>", :locals => { :name => "david" } - # - # _Deprecation_ _notice_: This used to have the signature render_template(template, status = 200, type = :rhtml) - # - # === Rendering inline JavaScriptGenerator page updates - # - # In addition to rendering JavaScriptGenerator page updates with Ajax in RJS templates (see ActionView::Base for details), - # you can also pass the :update parameter to +render+, along with a block, to render page updates inline. - # - # render :update do |page| - # page.replace_html 'user_list', :partial => 'user', :collection => @users - # page.visual_effect :highlight, 'user_list' - # end - # - # === Rendering nothing - # - # Rendering nothing is often convenient in combination with Ajax calls that perform their effect client-side or - # when you just want to communicate a status code. Due to a bug in Safari, nothing actually means a single space. - # - # # Renders an empty response with status code 200 - # render :nothing => true - # - # # Renders an empty response with status code 401 (access denied) - # render :nothing => true, :status => 401 - def render(options = nil, deprecated_status = nil, &block) #:doc: - raise DoubleRenderError, "Can only render or redirect once per action" if performed? - - # Backwards compatibility - unless options.is_a?(Hash) - if options == :update - options = {:update => true} - else - return render_file(options || default_template_name, deprecated_status, true) - end - end - - if content_type = options[:content_type] - headers["Content-Type"] = content_type - end - - if text = options[:text] - render_text(text, options[:status]) - - else - if file = options[:file] - render_file(file, options[:status], options[:use_full_path], options[:locals] || {}) - - elsif template = options[:template] - render_file(template, options[:status], true) - - elsif inline = options[:inline] - render_template(inline, options[:status], options[:type], options[:locals] || {}) - - elsif action_name = options[:action] - render_action(action_name, options[:status], options[:layout]) - - elsif xml = options[:xml] - render_xml(xml, options[:status]) - - elsif partial = options[:partial] - partial = default_template_name if partial == true - if collection = options[:collection] - render_partial_collection(partial, collection, options[:spacer_template], options[:locals], options[:status]) - else - render_partial(partial, ActionView::Base::ObjectWrapper.new(options[:object]), options[:locals], options[:status]) - end - - elsif options[:update] - add_variables_to_assigns - @template.send :evaluate_assigns - - generator = ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.new(@template, &block) - render_javascript(generator.to_s) - - elsif options[:nothing] - # Safari doesn't pass the headers of the return if the response is zero length - render_text(" ", options[:status]) - - else - render_file(default_template_name, options[:status], true) - - end - end - end - - # Renders according to the same rules as render, but returns the result in a string instead - # of sending it as the response body to the browser. - def render_to_string(options = nil, &block) #:doc: - result = render(options, &block) - - erase_render_results - forget_variables_added_to_assigns - reset_variables_added_to_assigns - - result - end - - def render_action(action_name, status = nil, with_layout = true) #:nodoc: - template = default_template_name(action_name.to_s) - if with_layout && !template_exempt_from_layout?(template) - render_with_layout(template, status) - else - render_without_layout(template, status) - end - end - - def render_file(template_path, status = nil, use_full_path = false, locals = {}) #:nodoc: - add_variables_to_assigns - assert_existence_of_template_file(template_path) if use_full_path - logger.info("Rendering #{template_path}" + (status ? " (#{status})" : '')) if logger - render_text(@template.render_file(template_path, use_full_path, locals), status) - end - - def render_template(template, status = nil, type = :rhtml, local_assigns = {}) #:nodoc: - add_variables_to_assigns - render_text(@template.render_template(type, template, nil, local_assigns), status) - end - - def render_text(text = nil, status = nil) #:nodoc: - @performed_render = true - @response.headers['Status'] = (status || DEFAULT_RENDER_STATUS_CODE).to_s - @response.body = text - end - - def render_javascript(javascript, status = nil) #:nodoc: - @response.headers['Content-Type'] = 'text/javascript; charset=UTF-8' - render_text(javascript, status) - end - - def render_xml(xml, status = nil) #:nodoc: - @response.headers['Content-Type'] = 'application/xml' - render_text(xml, status) - end - - def render_nothing(status = nil) #:nodoc: - render_text(' ', status) - end - - def render_partial(partial_path = default_template_name, object = nil, local_assigns = nil, status = nil) #:nodoc: - add_variables_to_assigns - render_text(@template.render_partial(partial_path, object, local_assigns), status) - end - - def render_partial_collection(partial_name, collection, partial_spacer_template = nil, local_assigns = nil, status = nil) #:nodoc: - add_variables_to_assigns - render_text(@template.render_partial_collection(partial_name, collection, partial_spacer_template, local_assigns), status) - end - - def render_with_layout(template_name = default_template_name, status = nil, layout = nil) #:nodoc: - render_with_a_layout(template_name, status, layout) - end - - def render_without_layout(template_name = default_template_name, status = nil) #:nodoc: - render_with_no_layout(template_name, status) - end - - - # Clears the rendered results, allowing for another render to be performed. - def erase_render_results #:nodoc: - @response.body = nil - @performed_render = false - end - - # Clears the redirected results from the headers, resets the status to 200 and returns - # the URL that was used to redirect or nil if there was no redirected URL - # Note that +redirect_to+ will change the body of the response to indicate a redirection. - # The response body is not reset here, see +erase_render_results+ - def erase_redirect_results #:nodoc: - @performed_redirect = false - response.redirected_to = nil - response.redirected_to_method_params = nil - response.headers['Status'] = DEFAULT_RENDER_STATUS_CODE - response.headers.delete('location') - end - - # Erase both render and redirect results - def erase_results #:nodoc: - erase_render_results - erase_redirect_results - end - - def rewrite_options(options) #:nodoc: - if defaults = default_url_options(options) - defaults.merge(options) - else - options - end - end - - # Overwrite to implement a number of default options that all url_for-based methods will use. The default options should come in - # the form of a hash, just like the one you would use for url_for directly. Example: - # - # def default_url_options(options) - # { :project => @project.active? ? @project.url_name : "unknown" } - # end - # - # As you can infer from the example, this is mostly useful for situations where you want to centralize dynamic decisions about the - # urls as they stem from the business domain. Please note that any individual url_for call can always override the defaults set - # by this method. - def default_url_options(options) #:doc: - end - - # Redirects the browser to the target specified in +options+. This parameter can take one of three forms: - # - # * Hash: The URL will be generated by calling url_for with the +options+. - # * String starting with protocol:// (like http://): Is passed straight through as the target for redirection. - # * String not containing a protocol: The current protocol and host is prepended to the string. - # * :back: Back to the page that issued the request. Useful for forms that are triggered from multiple places. - # Short-hand for redirect_to(request.env["HTTP_REFERER"]) - # - # Examples: - # redirect_to :action => "show", :id => 5 - # redirect_to "http://www.rubyonrails.org" - # redirect_to "/images/screenshot.jpg" - # redirect_to :back - # - # The redirection happens as a "302 Moved" header. - # - # When using redirect_to :back, if there is no referrer, - # RedirectBackError will be raised. You may specify some fallback - # behavior for this case by rescueing RedirectBackError. - def redirect_to(options = {}, *parameters_for_method_reference) #:doc: - case options - when %r{^\w+://.*} - raise DoubleRenderError if performed? - logger.info("Redirected to #{options}") if logger - response.redirect(options) - response.redirected_to = options - @performed_redirect = true - - when String - redirect_to(request.protocol + request.host_with_port + options) - - when :back - request.env["HTTP_REFERER"] ? redirect_to(request.env["HTTP_REFERER"]) : raise(RedirectBackError) - - else - if parameters_for_method_reference.empty? - redirect_to(url_for(options)) - response.redirected_to = options - else - redirect_to(url_for(options, *parameters_for_method_reference)) - response.redirected_to, response.redirected_to_method_params = options, parameters_for_method_reference - end - end - end - - # Sets a HTTP 1.1 Cache-Control header. Defaults to issuing a "private" instruction, so that - # intermediate caches shouldn't cache the response. - # - # Examples: - # expires_in 20.minutes - # expires_in 3.hours, :private => false - # expires in 3.hours, 'max-stale' => 5.hours, :private => nil, :public => true - # - # This method will overwrite an existing Cache-Control header. - # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities. - def expires_in(seconds, options = {}) #:doc: - cache_options = { 'max-age' => seconds, 'private' => true }.symbolize_keys.merge!(options.symbolize_keys) - cache_options.delete_if { |k,v| v.nil? or v == false } - cache_control = cache_options.map{ |k,v| v == true ? k.to_s : "#{k.to_s}=#{v.to_s}"} - @response.headers["Cache-Control"] = cache_control.join(', ') - end - - # Sets a HTTP 1.1 Cache-Control header of "no-cache" so no caching should occur by the browser or - # intermediate caches (like caching proxy servers). - def expires_now #:doc: - @response.headers["Cache-Control"] = "no-cache" - end - - # Resets the session by clearing out all the objects stored within and initializing a new session object. - def reset_session #:doc: - @request.reset_session - @session = @request.session - @response.session = @session - end - - private - def self.view_class - @view_class ||= - # create a new class based on the default template class and include helper methods - returning Class.new(ActionView::Base) do |view_class| - view_class.send(:include, master_helper_module) - end - end - - def self.view_root - @view_root ||= template_root - end - - def initialize_template_class(response) - raise "You must assign a template class through ActionController.template_class= before processing a request" unless @@template_class - - response.template = self.class.view_class.new(self.class.view_root, {}, self) - response.redirected_to = nil - @performed_render = @performed_redirect = false - end - - def assign_shortcuts(request, response) - @request, @params, @cookies = request, request.parameters, request.cookies - - @response = response - @response.session = request.session - - @session = @response.session - @template = @response.template - @assigns = @response.template.assigns - - @headers = @response.headers - end - - def initialize_current_url - @url = UrlRewriter.new(@request, @params.clone()) - end - - def log_processing - if logger - logger.info "\n\nProcessing #{controller_class_name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]" - logger.info " Session ID: #{@session.session_id}" if @session and @session.respond_to?(:session_id) - logger.info " Parameters: #{respond_to?(:filter_parameters) ? filter_parameters(@params).inspect : @params.inspect}" - end - end - - def perform_action - if self.class.action_methods.include?(action_name) || self.class.action_methods.include?('method_missing') - send(action_name) - render unless performed? - elsif template_exists? && template_public? - render - else - raise UnknownAction, "No action responded to #{action_name}", caller - end - end - - def performed? - @performed_render || @performed_redirect - end - - def assign_names - @action_name = (params['action'] || 'index') - end - - def action_methods - self.class.action_methods - end - - def self.action_methods - @action_methods ||= Set.new(public_instance_methods - hidden_actions) - end - - def add_variables_to_assigns - unless @variables_added - add_instance_variables_to_assigns - add_class_variables_to_assigns if view_controller_internals - @variables_added = true - end - end - - def forget_variables_added_to_assigns - @variables_added = nil - end - - def reset_variables_added_to_assigns - @template.instance_variable_set("@assigns_added", nil) - end - - def add_instance_variables_to_assigns - @@protected_variables_cache ||= protected_instance_variables.inject({}) { |h, k| h[k] = true; h } - instance_variables.each do |var| - next if @@protected_variables_cache.include?(var) - @assigns[var[1..-1]] = instance_variable_get(var) - end - end - - def add_class_variables_to_assigns - %w( template_root logger template_class ignore_missing_templates ).each do |cvar| - @assigns[cvar] = self.send(cvar) - end - end - - def protected_instance_variables - if view_controller_internals - [ "@assigns", "@performed_redirect", "@performed_render" ] - else - [ "@assigns", "@performed_redirect", "@performed_render", "@request", "@response", "@session", "@cookies", "@template", "@request_origin", "@parent_controller" ] - end - end - - def request_origin - # this *needs* to be cached! - # otherwise you'd get different results if calling it more than once - @request_origin ||= "#{@request.remote_ip} at #{Time.now.to_s(:db)}" - end - - def complete_request_uri - "#{@request.protocol}#{@request.host}#{@request.request_uri}" - end - - def close_session - @session.close unless @session.nil? || Hash === @session - end - - def template_exists?(template_name = default_template_name) - @template.file_exists?(template_name) - end - - def template_public?(template_name = default_template_name) - @template.file_public?(template_name) - end - - def template_exempt_from_layout?(template_name = default_template_name) - template_name =~ /\.rjs$/ || (@template.pick_template_extension(template_name) == :rjs rescue false) - end - - def assert_existence_of_template_file(template_name) - unless template_exists?(template_name) || ignore_missing_templates - full_template_path = @template.send(:full_template_path, template_name, 'rhtml') - template_type = (template_name =~ /layouts/i) ? 'layout' : 'template' - raise(MissingTemplate, "Missing #{template_type} #{full_template_path}") - end - end - - def default_template_name(action_name = self.action_name) - if action_name - action_name = action_name.to_s - if action_name.include?('/') && template_path_includes_controller?(action_name) - action_name = strip_out_controller(action_name) - end - end - "#{self.class.controller_path}/#{action_name}" - end - - def strip_out_controller(path) - path.split('/', 2).last - end - - def template_path_includes_controller?(path) - self.class.controller_path.split('/')[-1] == path.split('/')[0] - end - - def process_cleanup - close_session - end - end -end -require 'benchmark' - -module ActionController #:nodoc: - # The benchmarking module times the performance of actions and reports to the logger. If the Active Record - # package has been included, a separate timing section for database calls will be added as well. - module Benchmarking #:nodoc: - def self.included(base) - base.extend(ClassMethods) - - base.class_eval do - alias_method :perform_action_without_benchmark, :perform_action - alias_method :perform_action, :perform_action_with_benchmark - - alias_method :render_without_benchmark, :render - alias_method :render, :render_with_benchmark - end - end - - module ClassMethods - # Log and benchmark the workings of a single block and silence whatever logging that may have happened inside it - # (unless use_silence is set to false). - # - # The benchmark is only recorded if the current level of the logger matches the log_level, which makes it - # easy to include benchmarking statements in production software that will remain inexpensive because the benchmark - # will only be conducted if the log level is low enough. - def benchmark(title, log_level = Logger::DEBUG, use_silence = true) - if logger && logger.level == log_level - result = nil - seconds = Benchmark.realtime { result = use_silence ? silence { yield } : yield } - logger.add(log_level, "#{title} (#{'%.5f' % seconds})") - result - else - yield - end - end - - # Silences the logger for the duration of the block. - def silence - old_logger_level, logger.level = logger.level, Logger::ERROR if logger - yield - ensure - logger.level = old_logger_level if logger - end - end - - def render_with_benchmark(options = nil, deprecated_status = nil, &block) - unless logger - render_without_benchmark(options, deprecated_status, &block) - else - db_runtime = ActiveRecord::Base.connection.reset_runtime if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected? - - render_output = nil - @rendering_runtime = Benchmark::measure{ render_output = render_without_benchmark(options, deprecated_status, &block) }.real - - if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected? - @db_rt_before_render = db_runtime - @db_rt_after_render = ActiveRecord::Base.connection.reset_runtime - @rendering_runtime -= @db_rt_after_render - end - - render_output - end - end - - def perform_action_with_benchmark - unless logger - perform_action_without_benchmark - else - runtime = [Benchmark::measure{ perform_action_without_benchmark }.real, 0.0001].max - log_message = "Completed in #{sprintf("%.5f", runtime)} (#{(1 / runtime).floor} reqs/sec)" - log_message << rendering_runtime(runtime) if @rendering_runtime - log_message << active_record_runtime(runtime) if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected? - log_message << " | #{headers["Status"]}" - log_message << " [#{complete_request_uri rescue "unknown"}]" - logger.info(log_message) - end - end - - private - def rendering_runtime(runtime) - " | Rendering: #{sprintf("%.5f", @rendering_runtime)} (#{sprintf("%d", (@rendering_runtime * 100) / runtime)}%)" - end - - def active_record_runtime(runtime) - db_runtime = ActiveRecord::Base.connection.reset_runtime - db_runtime += @db_rt_before_render if @db_rt_before_render - db_runtime += @db_rt_after_render if @db_rt_after_render - db_percentage = (db_runtime * 100) / runtime - " | DB: #{sprintf("%.5f", db_runtime)} (#{sprintf("%d", db_percentage)}%)" - end - end -end -require 'fileutils' - -module ActionController #:nodoc: - # Caching is a cheap way of speeding up slow applications by keeping the result of calculations, renderings, and database calls - # around for subsequent requests. Action Controller affords you three approaches in varying levels of granularity: Page, Action, Fragment. - # - # You can read more about each approach and the sweeping assistance by clicking the modules below. - # - # Note: To turn off all caching and sweeping, set Base.perform_caching = false. - module Caching - def self.included(base) #:nodoc: - base.send(:include, Pages, Actions, Fragments, Sweeping) - - base.class_eval do - @@perform_caching = true - cattr_accessor :perform_caching - end - end - - # Page caching is an approach to caching where the entire action output of is stored as a HTML file that the web server - # can serve without going through the Action Pack. This can be as much as 100 times faster than going through the process of dynamically - # generating the content. Unfortunately, this incredible speed-up is only available to stateless pages where all visitors - # are treated the same. Content management systems -- including weblogs and wikis -- have many pages that are a great fit - # for this approach, but account-based systems where people log in and manipulate their own data are often less likely candidates. - # - # Specifying which actions to cache is done through the caches class method: - # - # class WeblogController < ActionController::Base - # caches_page :show, :new - # end - # - # This will generate cache files such as weblog/show/5 and weblog/new, which match the URLs used to trigger the dynamic - # generation. This is how the web server is able pick up a cache file when it exists and otherwise let the request pass on to - # the Action Pack to generate it. - # - # Expiration of the cache is handled by deleting the cached file, which results in a lazy regeneration approach where the cache - # is not restored before another hit is made against it. The API for doing so mimics the options from url_for and friends: - # - # class WeblogController < ActionController::Base - # def update - # List.update(params[:list][:id], params[:list]) - # expire_page :action => "show", :id => params[:list][:id] - # redirect_to :action => "show", :id => params[:list][:id] - # end - # end - # - # Additionally, you can expire caches using Sweepers that act on changes in the model to determine when a cache is supposed to be - # expired. - # - # == Setting the cache directory - # - # The cache directory should be the document root for the web server and is set using Base.page_cache_directory = "/document/root". - # For Rails, this directory has already been set to RAILS_ROOT + "/public". - # - # == Setting the cache extension - # - # By default, the cache extension is .html, which makes it easy for the cached files to be picked up by the web server. If you want - # something else, like .php or .shtml, just set Base.page_cache_extension. - module Pages - def self.included(base) #:nodoc: - base.extend(ClassMethods) - base.class_eval do - @@page_cache_directory = defined?(RAILS_ROOT) ? "#{RAILS_ROOT}/public" : "" - cattr_accessor :page_cache_directory - - @@page_cache_extension = '.html' - cattr_accessor :page_cache_extension - end - end - - module ClassMethods - # Expires the page that was cached with the +path+ as a key. Example: - # expire_page "/lists/show" - def expire_page(path) - return unless perform_caching - - benchmark "Expired page: #{page_cache_file(path)}" do - File.delete(page_cache_path(path)) if File.exists?(page_cache_path(path)) - end - end - - # Manually cache the +content+ in the key determined by +path+. Example: - # cache_page "I'm the cached content", "/lists/show" - def cache_page(content, path) - return unless perform_caching - - benchmark "Cached page: #{page_cache_file(path)}" do - FileUtils.makedirs(File.dirname(page_cache_path(path))) - File.open(page_cache_path(path), "wb+") { |f| f.write(content) } - end - end - - # Caches the +actions+ using the page-caching approach that'll store the cache in a path within the page_cache_directory that - # matches the triggering url. - def caches_page(*actions) - return unless perform_caching - actions.each do |action| - class_eval "after_filter { |c| c.cache_page if c.action_name == '#{action}' }" - end - end - - private - def page_cache_file(path) - name = ((path.empty? || path == "/") ? "/index" : URI.unescape(path)) - name << page_cache_extension unless (name.split('/').last || name).include? '.' - return name - end - - def page_cache_path(path) - page_cache_directory + page_cache_file(path) - end - end - - # Expires the page that was cached with the +options+ as a key. Example: - # expire_page :controller => "lists", :action => "show" - def expire_page(options = {}) - return unless perform_caching - if options[:action].is_a?(Array) - options[:action].dup.each do |action| - self.class.expire_page(url_for(options.merge({ :only_path => true, :skip_relative_url_root => true, :action => action }))) - end - else - self.class.expire_page(url_for(options.merge({ :only_path => true, :skip_relative_url_root => true }))) - end - end - - # Manually cache the +content+ in the key determined by +options+. If no content is provided, the contents of @response.body is used - # If no options are provided, the current +options+ for this action is used. Example: - # cache_page "I'm the cached content", :controller => "lists", :action => "show" - def cache_page(content = nil, options = {}) - return unless perform_caching && caching_allowed - self.class.cache_page(content || @response.body, url_for(options.merge({ :only_path => true, :skip_relative_url_root => true }))) - end - - private - def caching_allowed - !@request.post? && @response.headers['Status'] && @response.headers['Status'].to_i < 400 - end - end - - # Action caching is similar to page caching by the fact that the entire output of the response is cached, but unlike page caching, - # every request still goes through the Action Pack. The key benefit of this is that filters are run before the cache is served, which - # allows for authentication and other restrictions on whether someone is allowed to see the cache. Example: - # - # class ListsController < ApplicationController - # before_filter :authenticate, :except => :public - # caches_page :public - # caches_action :show, :feed - # end - # - # In this example, the public action doesn't require authentication, so it's possible to use the faster page caching method. But both the - # show and feed action are to be shielded behind the authenticate filter, so we need to implement those as action caches. - # - # Action caching internally uses the fragment caching and an around filter to do the job. The fragment cache is named according to both - # the current host and the path. So a page that is accessed at http://david.somewhere.com/lists/show/1 will result in a fragment named - # "david.somewhere.com/lists/show/1". This allows the cacher to differentiate between "david.somewhere.com/lists/" and - # "jamis.somewhere.com/lists/" -- which is a helpful way of assisting the subdomain-as-account-key pattern. - module Actions - def self.append_features(base) #:nodoc: - super - base.extend(ClassMethods) - base.send(:attr_accessor, :rendered_action_cache) - end - - module ClassMethods #:nodoc: - def caches_action(*actions) - return unless perform_caching - around_filter(ActionCacheFilter.new(*actions)) - end - end - - def expire_action(options = {}) - return unless perform_caching - if options[:action].is_a?(Array) - options[:action].dup.each do |action| - expire_fragment(url_for(options.merge({ :action => action })).split("://").last) - end - else - expire_fragment(url_for(options).split("://").last) - end - end - - class ActionCacheFilter #:nodoc: - def initialize(*actions) - @actions = actions - end - - def before(controller) - return unless @actions.include?(controller.action_name.intern) - if cache = controller.read_fragment(controller.url_for.split("://").last) - controller.rendered_action_cache = true - controller.send(:render_text, cache) - false - end - end - - def after(controller) - return if !@actions.include?(controller.action_name.intern) || controller.rendered_action_cache - controller.write_fragment(controller.url_for.split("://").last, controller.response.body) - end - end - end - - # Fragment caching is used for caching various blocks within templates without caching the entire action as a whole. This is useful when - # certain elements of an action change frequently or depend on complicated state while other parts rarely change or can be shared amongst multiple - # parties. The caching is doing using the cache helper available in the Action View. A template with caching might look something like: - # - # Hello <%= @name %> - # <% cache do %> - # All the topics in the system: - # <%= render_collection_of_partials "topic", Topic.find_all %> - # <% end %> - # - # This cache will bind to the name of action that called it. So you would be able to invalidate it using - # expire_fragment(:controller => "topics", :action => "list") -- if that was the controller/action used. This is not too helpful - # if you need to cache multiple fragments per action or if the action itself is cached using caches_action. So instead we should - # qualify the name of the action used with something like: - # - # <% cache(:action => "list", :action_suffix => "all_topics") do %> - # - # That would result in a name such as "/topics/list/all_topics", which wouldn't conflict with any action cache and neither with another - # fragment using a different suffix. Note that the URL doesn't have to really exist or be callable. We're just using the url_for system - # to generate unique cache names that we can refer to later for expirations. The expiration call for this example would be - # expire_fragment(:controller => "topics", :action => "list", :action_suffix => "all_topics"). - # - # == Fragment stores - # - # In order to use the fragment caching, you need to designate where the caches should be stored. This is done by assigning a fragment store - # of which there are four different kinds: - # - # * FileStore: Keeps the fragments on disk in the +cache_path+, which works well for all types of environments and shares the fragments for - # all the web server processes running off the same application directory. - # * MemoryStore: Keeps the fragments in memory, which is fine for WEBrick and for FCGI (if you don't care that each FCGI process holds its - # own fragment store). It's not suitable for CGI as the process is thrown away at the end of each request. It can potentially also take - # up a lot of memory since each process keeps all the caches in memory. - # * DRbStore: Keeps the fragments in the memory of a separate, shared DRb process. This works for all environments and only keeps one cache - # around for all processes, but requires that you run and manage a separate DRb process. - # * MemCacheStore: Works like DRbStore, but uses Danga's MemCache instead. - # Requires the ruby-memcache library: gem install ruby-memcache. - # - # Configuration examples (MemoryStore is the default): - # - # ActionController::Base.fragment_cache_store = :memory_store - # ActionController::Base.fragment_cache_store = :file_store, "/path/to/cache/directory" - # ActionController::Base.fragment_cache_store = :drb_store, "druby://localhost:9192" - # ActionController::Base.fragment_cache_store = :mem_cache_store, "localhost" - # ActionController::Base.fragment_cache_store = MyOwnStore.new("parameter") - module Fragments - def self.append_features(base) #:nodoc: - super - base.class_eval do - @@fragment_cache_store = MemoryStore.new - cattr_reader :fragment_cache_store - - def self.fragment_cache_store=(store_option) - store, *parameters = *([ store_option ].flatten) - @@fragment_cache_store = if store.is_a?(Symbol) - store_class_name = (store == :drb_store ? "DRbStore" : store.to_s.camelize) - store_class = ActionController::Caching::Fragments.const_get(store_class_name) - store_class.new(*parameters) - else - store - end - end - end - end - - def fragment_cache_key(name) - name.is_a?(Hash) ? url_for(name).split("://").last : name - end - - # Called by CacheHelper#cache - def cache_erb_fragment(block, name = {}, options = nil) - unless perform_caching then block.call; return end - - buffer = eval("_erbout", block.binding) - - if cache = read_fragment(name, options) - buffer.concat(cache) - else - pos = buffer.length - block.call - write_fragment(name, buffer[pos..-1], options) - end - end - - def write_fragment(name, content, options = nil) - return unless perform_caching - - key = fragment_cache_key(name) - self.class.benchmark "Cached fragment: #{key}" do - fragment_cache_store.write(key, content, options) - end - content - end - - def read_fragment(name, options = nil) - return unless perform_caching - - key = fragment_cache_key(name) - self.class.benchmark "Fragment read: #{key}" do - fragment_cache_store.read(key, options) - end - end - - # Name can take one of three forms: - # * String: This would normally take the form of a path like "pages/45/notes" - # * Hash: Is treated as an implicit call to url_for, like { :controller => "pages", :action => "notes", :id => 45 } - # * Regexp: Will destroy all the matched fragments, example: %r{pages/\d*/notes} Ensure you do not specify start and finish in the regex (^$) because the actual filename matched looks like ./cache/filename/path.cache - def expire_fragment(name, options = nil) - return unless perform_caching - - key = fragment_cache_key(name) - - if key.is_a?(Regexp) - self.class.benchmark "Expired fragments matching: #{key.source}" do - fragment_cache_store.delete_matched(key, options) - end - else - self.class.benchmark "Expired fragment: #{key}" do - fragment_cache_store.delete(key, options) - end - end - end - - # Deprecated -- just call expire_fragment with a regular expression - def expire_matched_fragments(matcher = /.*/, options = nil) #:nodoc: - expire_fragment(matcher, options) - end - - - class UnthreadedMemoryStore #:nodoc: - def initialize #:nodoc: - @data = {} - end - - def read(name, options=nil) #:nodoc: - @data[name] - end - - def write(name, value, options=nil) #:nodoc: - @data[name] = value - end - - def delete(name, options=nil) #:nodoc: - @data.delete(name) - end - - def delete_matched(matcher, options=nil) #:nodoc: - @data.delete_if { |k,v| k =~ matcher } - end - end - - module ThreadSafety #:nodoc: - def read(name, options=nil) #:nodoc: - @mutex.synchronize { super } - end - - def write(name, value, options=nil) #:nodoc: - @mutex.synchronize { super } - end - - def delete(name, options=nil) #:nodoc: - @mutex.synchronize { super } - end - - def delete_matched(matcher, options=nil) #:nodoc: - @mutex.synchronize { super } - end - end - - class MemoryStore < UnthreadedMemoryStore #:nodoc: - def initialize #:nodoc: - super - if ActionController::Base.allow_concurrency - @mutex = Mutex.new - MemoryStore.send(:include, ThreadSafety) - end - end - end - - class DRbStore < MemoryStore #:nodoc: - attr_reader :address - - def initialize(address = 'druby://localhost:9192') - super() - @address = address - @data = DRbObject.new(nil, address) - end - end - - class MemCacheStore < MemoryStore #:nodoc: - attr_reader :addresses - - def initialize(*addresses) - super() - addresses = addresses.flatten - addresses = ["localhost"] if addresses.empty? - @addresses = addresses - @data = MemCache.new(*addresses) - end - end - - class UnthreadedFileStore #:nodoc: - attr_reader :cache_path - - def initialize(cache_path) - @cache_path = cache_path - end - - def write(name, value, options = nil) #:nodoc: - ensure_cache_path(File.dirname(real_file_path(name))) - File.open(real_file_path(name), "wb+") { |f| f.write(value) } - rescue => e - Base.logger.error "Couldn't create cache directory: #{name} (#{e.message})" if Base.logger - end - - def read(name, options = nil) #:nodoc: - File.open(real_file_path(name), 'rb') { |f| f.read } rescue nil - end - - def delete(name, options) #:nodoc: - File.delete(real_file_path(name)) - rescue SystemCallError => e - # If there's no cache, then there's nothing to complain about - end - - def delete_matched(matcher, options) #:nodoc: - search_dir(@cache_path) do |f| - if f =~ matcher - begin - File.delete(f) - rescue Object => e - # If there's no cache, then there's nothing to complain about - end - end - end - end - - private - def real_file_path(name) - '%s/%s.cache' % [@cache_path, name.gsub('?', '.').gsub(':', '.')] - end - - def ensure_cache_path(path) - FileUtils.makedirs(path) unless File.exists?(path) - end - - def search_dir(dir, &callback) - Dir.foreach(dir) do |d| - next if d == "." || d == ".." - name = File.join(dir, d) - if File.directory?(name) - search_dir(name, &callback) - else - callback.call name - end - end - end - end - - class FileStore < UnthreadedFileStore #:nodoc: - def initialize(cache_path) - super(cache_path) - if ActionController::Base.allow_concurrency - @mutex = Mutex.new - FileStore.send(:include, ThreadSafety) - end - end - end - end - - # Sweepers are the terminators of the caching world and responsible for expiring caches when model objects change. - # They do this by being half-observers, half-filters and implementing callbacks for both roles. A Sweeper example: - # - # class ListSweeper < ActionController::Caching::Sweeper - # observe List, Item - # - # def after_save(record) - # list = record.is_a?(List) ? record : record.list - # expire_page(:controller => "lists", :action => %w( show public feed ), :id => list.id) - # expire_action(:controller => "lists", :action => "all") - # list.shares.each { |share| expire_page(:controller => "lists", :action => "show", :id => share.url_key) } - # end - # end - # - # The sweeper is assigned in the controllers that wish to have its job performed using the cache_sweeper class method: - # - # class ListsController < ApplicationController - # caches_action :index, :show, :public, :feed - # cache_sweeper :list_sweeper, :only => [ :edit, :destroy, :share ] - # end - # - # In the example above, four actions are cached and three actions are responsible for expiring those caches. - module Sweeping - def self.append_features(base) #:nodoc: - super - base.extend(ClassMethods) - end - - module ClassMethods #:nodoc: - def cache_sweeper(*sweepers) - return unless perform_caching - configuration = sweepers.last.is_a?(Hash) ? sweepers.pop : {} - sweepers.each do |sweeper| - observer(sweeper) - - sweeper_instance = Object.const_get(Inflector.classify(sweeper)).instance - - if sweeper_instance.is_a?(Sweeper) - around_filter(sweeper_instance, :only => configuration[:only]) - else - after_filter(sweeper_instance, :only => configuration[:only]) - end - end - end - end - end - - if defined?(ActiveRecord) and defined?(ActiveRecord::Observer) - class Sweeper < ActiveRecord::Observer #:nodoc: - attr_accessor :controller - - # ActiveRecord::Observer will mark this class as reloadable even though it should not be. - # However, subclasses of ActionController::Caching::Sweeper should be Reloadable - include Reloadable::Subclasses - - def before(controller) - self.controller = controller - callback(:before) - end - - def after(controller) - callback(:after) - # Clean up, so that the controller can be collected after this request - self.controller = nil - end - - private - def callback(timing) - controller_callback_method_name = "#{timing}_#{controller.controller_name.underscore}" - action_callback_method_name = "#{controller_callback_method_name}_#{controller.action_name}" - - send(controller_callback_method_name) if respond_to?(controller_callback_method_name) - send(action_callback_method_name) if respond_to?(action_callback_method_name) - end - - def method_missing(method, *arguments) - return if @controller.nil? - @controller.send(method, *arguments) - end - end - end - end -end -require 'cgi' -require 'cgi/session' -require 'cgi/session/pstore' -require 'action_controller/cgi_ext/cgi_methods' - -# Wrapper around the CGIMethods that have been secluded to allow testing without -# an instantiated CGI object -class CGI #:nodoc: - class << self - alias :escapeHTML_fail_on_nil :escapeHTML - - def escapeHTML(string) - escapeHTML_fail_on_nil(string) unless string.nil? - end - end - - # Returns a parameter hash including values from both the request (POST/GET) - # and the query string with the latter taking precedence. - def parameters - request_parameters.update(query_parameters) - end - - def query_parameters - CGIMethods.parse_query_parameters(query_string) - end - - def request_parameters - CGIMethods.parse_request_parameters(params, env_table) - end - - def redirect(where) - header({ - "Status" => "302 Moved", - "location" => "#{where}" - }) - end - - def session(parameters = nil) - parameters = {} if parameters.nil? - parameters['database_manager'] = CGI::Session::PStore - CGI::Session.new(self, parameters) - end -end -require 'cgi' -require 'action_controller/vendor/xml_simple' -require 'action_controller/vendor/xml_node' - -# Static methods for parsing the query and request parameters that can be used in -# a CGI extension class or testing in isolation. -class CGIMethods #:nodoc: - public - # Returns a hash with the pairs from the query string. The implicit hash construction that is done in - # parse_request_params is not done here. - def CGIMethods.parse_query_parameters(query_string) - parsed_params = {} - - query_string.split(/[&;]/).each { |p| - # Ignore repeated delimiters. - next if p.empty? - - k, v = p.split('=',2) - v = nil if (v && v.empty?) - - k = CGI.unescape(k) if k - v = CGI.unescape(v) if v - - unless k.include?(?[) - parsed_params[k] = v - else - keys = split_key(k) - last_key = keys.pop - last_key = keys.pop if (use_array = last_key.empty?) - parent = keys.inject(parsed_params) {|h, k| h[k] ||= {}} - - if use_array then (parent[last_key] ||= []) << v - else parent[last_key] = v - end - end - } - - parsed_params - end - - # Returns the request (POST/GET) parameters in a parsed form where pairs such as "customer[address][street]" / - # "Somewhere cool!" are translated into a full hash hierarchy, like - # { "customer" => { "address" => { "street" => "Somewhere cool!" } } } - def CGIMethods.parse_request_parameters(params) - parsed_params = {} - - for key, value in params - value = [value] if key =~ /.*\[\]$/ - unless key.include?('[') - # much faster to test for the most common case first (GET) - # and avoid the call to build_deep_hash - parsed_params[key] = get_typed_value(value[0]) - else - build_deep_hash(get_typed_value(value[0]), parsed_params, get_levels(key)) - end - end - - parsed_params - end - - def self.parse_formatted_request_parameters(mime_type, raw_post_data) - params = case strategy = ActionController::Base.param_parsers[mime_type] - when Proc - strategy.call(raw_post_data) - when :xml_simple - raw_post_data.blank? ? nil : - typecast_xml_value(XmlSimple.xml_in(raw_post_data, - 'forcearray' => false, - 'forcecontent' => true, - 'keeproot' => true, - 'contentkey' => '__content__')) - when :yaml - YAML.load(raw_post_data) - when :xml_node - node = XmlNode.from_xml(raw_post_data) - { node.node_name => node } - end - - dasherize_keys(params || {}) - rescue Object => e - { "exception" => "#{e.message} (#{e.class})", "backtrace" => e.backtrace, - "raw_post_data" => raw_post_data, "format" => mime_type } - end - - def self.typecast_xml_value(value) - case value - when Hash - if value.has_key?("__content__") - content = translate_xml_entities(value["__content__"]) - case value["type"] - when "integer" then content.to_i - when "boolean" then content == "true" - when "datetime" then Time.parse(content) - when "date" then Date.parse(content) - else content - end - else - value.empty? ? nil : value.inject({}) do |h,(k,v)| - h[k] = typecast_xml_value(v) - h - end - end - when Array - value.map! { |i| typecast_xml_value(i) } - case value.length - when 0 then nil - when 1 then value.first - else value - end - else - raise "can't typecast #{value.inspect}" - end - end - - private - - def self.translate_xml_entities(value) - value.gsub(/</, "<"). - gsub(/>/, ">"). - gsub(/"/, '"'). - gsub(/'/, "'"). - gsub(/&/, "&") - end - - def self.dasherize_keys(params) - case params.class.to_s - when "Hash" - params.inject({}) do |h,(k,v)| - h[k.to_s.tr("-", "_")] = dasherize_keys(v) - h - end - when "Array" - params.map { |v| dasherize_keys(v) } - else - params - end - end - - # Splits the given key into several pieces. Example keys are 'name', 'person[name]', - # 'person[name][first]', and 'people[]'. In each instance, an Array instance is returned. - # 'person[name][first]' produces ['person', 'name', 'first']; 'people[]' produces ['people', ''] - def CGIMethods.split_key(key) - if /^([^\[]+)((?:\[[^\]]*\])+)$/ =~ key - keys = [$1] - - keys.concat($2[1..-2].split('][')) - keys << '' if key[-2..-1] == '[]' # Have to add it since split will drop empty strings - - keys - else - [key] - end - end - - def CGIMethods.get_typed_value(value) - # test most frequent case first - if value.is_a?(String) - value - elsif value.respond_to?(:content_type) && ! value.content_type.blank? - # Uploaded file - unless value.respond_to?(:full_original_filename) - class << value - alias_method :full_original_filename, :original_filename - - # Take the basename of the upload's original filename. - # This handles the full Windows paths given by Internet Explorer - # (and perhaps other broken user agents) without affecting - # those which give the lone filename. - # The Windows regexp is adapted from Perl's File::Basename. - def original_filename - if md = /^(?:.*[:\\\/])?(.*)/m.match(full_original_filename) - md.captures.first - else - File.basename full_original_filename - end - end - end - end - - # Return the same value after overriding original_filename. - value - - elsif value.respond_to?(:read) - # Value as part of a multipart request - value.read - elsif value.class == Array - value.collect { |v| CGIMethods.get_typed_value(v) } - else - # other value (neither string nor a multipart request) - value.to_s - end - end - - PARAMS_HASH_RE = /^([^\[]+)(\[.*\])?(.)?.*$/ - def CGIMethods.get_levels(key) - all, main, bracketed, trailing = PARAMS_HASH_RE.match(key).to_a - if main.nil? - [] - elsif trailing - [key] - elsif bracketed - [main] + bracketed.slice(1...-1).split('][') - else - [main] - end - end - - def CGIMethods.build_deep_hash(value, hash, levels) - if levels.length == 0 - value - elsif hash.nil? - { levels.first => CGIMethods.build_deep_hash(value, nil, levels[1..-1]) } - else - hash.update({ levels.first => CGIMethods.build_deep_hash(value, hash[levels.first], levels[1..-1]) }) - end - end -end -CGI.module_eval { remove_const "Cookie" } - -class CGI #:nodoc: - # This is a cookie class that fixes the performance problems with the default one that ships with 1.8.1 and below. - # It replaces the inheritance on SimpleDelegator with DelegateClass(Array) following the suggestion from Matz on - # http://groups.google.com/groups?th=e3a4e68ba042f842&seekm=c3sioe%241qvm%241%40news.cybercity.dk#link14 - class Cookie < DelegateClass(Array) - # Create a new CGI::Cookie object. - # - # The contents of the cookie can be specified as a +name+ and one - # or more +value+ arguments. Alternatively, the contents can - # be specified as a single hash argument. The possible keywords of - # this hash are as follows: - # - # name:: the name of the cookie. Required. - # value:: the cookie's value or list of values. - # path:: the path for which this cookie applies. Defaults to the - # base directory of the CGI script. - # domain:: the domain for which this cookie applies. - # expires:: the time at which this cookie expires, as a +Time+ object. - # secure:: whether this cookie is a secure cookie or not (default to - # false). Secure cookies are only transmitted to HTTPS - # servers. - # - # These keywords correspond to attributes of the cookie object. - def initialize(name = '', *value) - if name.kind_of?(String) - @name = name - @value = Array(value) - @domain = nil - @expires = nil - @secure = false - @path = nil - else - @name = name['name'] - @value = Array(name['value']) - @domain = name['domain'] - @expires = name['expires'] - @secure = name['secure'] || false - @path = name['path'] - end - - unless @name - raise ArgumentError, "`name' required" - end - - # simple support for IE - unless @path - %r|^(.*/)|.match(ENV['SCRIPT_NAME']) - @path = ($1 or '') - end - - super(@value) - end - - def __setobj__(obj) - @_dc_obj = obj - end - - attr_accessor("name", "value", "path", "domain", "expires") - attr_reader("secure") - - # Set whether the Cookie is a secure cookie or not. - # - # +val+ must be a boolean. - def secure=(val) - @secure = val if val == true or val == false - @secure - end - - # Convert the Cookie to its string representation. - def to_s - buf = "" - buf << @name << '=' - - if @value.kind_of?(String) - buf << CGI::escape(@value) - else - buf << @value.collect{|v| CGI::escape(v) }.join("&") - end - - if @domain - buf << '; domain=' << @domain - end - - if @path - buf << '; path=' << @path - end - - if @expires - buf << '; expires=' << CGI::rfc1123_date(@expires) - end - - if @secure == true - buf << '; secure' - end - - buf - end - - # Parse a raw cookie string into a hash of cookie-name=>Cookie - # pairs. - # - # cookies = CGI::Cookie::parse("raw_cookie_string") - # # { "name1" => cookie1, "name2" => cookie2, ... } - # - def self.parse(raw_cookie) - cookies = Hash.new([]) - - if raw_cookie - raw_cookie.split(/; ?/).each do |pairs| - name, values = pairs.split('=',2) - next unless name and values - name = CGI::unescape(name) - values = values.split('&').collect!{|v| CGI::unescape(v) } - unless cookies.has_key?(name) - cookies[name] = new(name, *values) - end - end - end - - cookies - end - end # class Cookie -end -class CGI #:nodoc: - # Add @request.env['RAW_POST_DATA'] for the vegans. - module QueryExtension - # Initialize the data from the query. - # - # Handles multipart forms (in particular, forms that involve file uploads). - # Reads query parameters in the @params field, and cookies into @cookies. - def initialize_query() - @cookies = CGI::Cookie::parse(env_table['HTTP_COOKIE'] || env_table['COOKIE']) - - #fix some strange request environments - if method = env_table['REQUEST_METHOD'] - method = method.to_s.downcase.intern - else - method = :get - end - - if method == :post && (boundary = multipart_form_boundary) - @multipart = true - @params = read_multipart(boundary, Integer(env_table['CONTENT_LENGTH'])) - else - @multipart = false - @params = CGI::parse(read_query_params(method) || "") - end - end - - private - unless defined?(MULTIPART_FORM_BOUNDARY_RE) - MULTIPART_FORM_BOUNDARY_RE = %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)\"?|n #" - end - - def multipart_form_boundary - MULTIPART_FORM_BOUNDARY_RE.match(env_table['CONTENT_TYPE']).to_a.pop - end - - if defined? MOD_RUBY - def read_params_from_query - Apache::request.args || '' - end - else - def read_params_from_query - # fixes CGI querystring parsing for lighttpd - env_qs = env_table['QUERY_STRING'] - if env_qs.blank? && !(uri = env_table['REQUEST_URI']).blank? - uri.split('?', 2)[1] || '' - else - env_qs - end - end - end - - def read_params_from_post - stdinput.binmode if stdinput.respond_to?(:binmode) - content = stdinput.read(Integer(env_table['CONTENT_LENGTH'])) || '' - # fix for Safari Ajax postings that always append \000 - content.chop! if content[-1] == 0 - content.gsub! /&_=$/, '' - env_table['RAW_POST_DATA'] = content.freeze - end - - def read_query_params(method) - case method - when :get - read_params_from_query - when :post, :put - read_params_from_post - when :cmd - read_from_cmdline - else # when :head, :delete, :options - read_params_from_query - end - end - end # module QueryExtension -end -require 'action_controller/cgi_ext/cgi_ext' -require 'action_controller/cgi_ext/cookie_performance_fix' -require 'action_controller/cgi_ext/raw_post_data_fix' - -module ActionController #:nodoc: - class Base - # Process a request extracted from an CGI object and return a response. Pass false as session_options to disable - # sessions (large performance increase if sessions are not needed). The session_options are the same as for CGI::Session: - # - # * :database_manager - standard options are CGI::Session::FileStore, CGI::Session::MemoryStore, and CGI::Session::PStore - # (default). Additionally, there is CGI::Session::DRbStore and CGI::Session::ActiveRecordStore. Read more about these in - # lib/action_controller/session. - # * :session_key - the parameter name used for the session id. Defaults to '_session_id'. - # * :session_id - the session id to use. If not provided, then it is retrieved from the +session_key+ parameter - # of the request, or automatically generated for a new session. - # * :new_session - if true, force creation of a new session. If not set, a new session is only created if none currently - # exists. If false, a new session is never created, and if none currently exists and the +session_id+ option is not set, - # an ArgumentError is raised. - # * :session_expires - the time the current session expires, as a +Time+ object. If not set, the session will continue - # indefinitely. - # * :session_domain - the hostname domain for which this session is valid. If not set, defaults to the hostname of the - # server. - # * :session_secure - if +true+, this session will only work over HTTPS. - # * :session_path - the path for which this session applies. Defaults to the directory of the CGI script. - def self.process_cgi(cgi = CGI.new, session_options = {}) - new.process_cgi(cgi, session_options) - end - - def process_cgi(cgi, session_options = {}) #:nodoc: - process(CgiRequest.new(cgi, session_options), CgiResponse.new(cgi)).out - end - end - - class CgiRequest < AbstractRequest #:nodoc: - attr_accessor :cgi, :session_options - - DEFAULT_SESSION_OPTIONS = { - :database_manager => CGI::Session::PStore, - :prefix => "ruby_sess.", - :session_path => "/" - } unless const_defined?(:DEFAULT_SESSION_OPTIONS) - - def initialize(cgi, session_options = {}) - @cgi = cgi - @session_options = session_options - @env = @cgi.send(:env_table) - super() - end - - def query_string - if (qs = @cgi.query_string) && !qs.empty? - qs - elsif uri = @env['REQUEST_URI'] - parts = uri.split('?') - parts.shift - parts.join('?') - else - @env['QUERY_STRING'] || '' - end - end - - def query_parameters - (qs = self.query_string).empty? ? {} : CGIMethods.parse_query_parameters(qs) - end - - def request_parameters - @request_parameters ||= - if ActionController::Base.param_parsers.has_key?(content_type) - CGIMethods.parse_formatted_request_parameters(content_type, @env['RAW_POST_DATA']) - else - CGIMethods.parse_request_parameters(@cgi.params) - end - end - - def cookies - @cgi.cookies.freeze - end - - def host_with_port - if forwarded = env["HTTP_X_FORWARDED_HOST"] - forwarded.split(/,\s?/).last - elsif http_host = env['HTTP_HOST'] - http_host - elsif server_name = env['SERVER_NAME'] - server_name - else - "#{env['SERVER_ADDR']}:#{env['SERVER_PORT']}" - end - end - - def host - host_with_port[/^[^:]+/] - end - - def port - if host_with_port =~ /:(\d+)$/ - $1.to_i - else - standard_port - end - end - - def session - unless @session - if @session_options == false - @session = Hash.new - else - stale_session_check! do - if session_options_with_string_keys['new_session'] == true - @session = new_session - else - @session = CGI::Session.new(@cgi, session_options_with_string_keys) - end - @session['__valid_session'] - end - end - end - @session - end - - def reset_session - @session.delete if CGI::Session === @session - @session = new_session - end - - def method_missing(method_id, *arguments) - @cgi.send(method_id, *arguments) rescue super - end - - private - # Delete an old session if it exists then create a new one. - def new_session - if @session_options == false - Hash.new - else - CGI::Session.new(@cgi, session_options_with_string_keys.merge("new_session" => false)).delete rescue nil - CGI::Session.new(@cgi, session_options_with_string_keys.merge("new_session" => true)) - end - end - - def stale_session_check! - yield - rescue ArgumentError => argument_error - if argument_error.message =~ %r{undefined class/module (\w+)} - begin - Module.const_missing($1) - rescue LoadError, NameError => const_error - raise ActionController::SessionRestoreError, < e - # lost connection to the FCGI process -- ignore the output, then - end - end - - private - def convert_content_type!(headers) - if header = headers.delete("Content-Type") - headers["type"] = header - end - if header = headers.delete("Content-type") - headers["type"] = header - end - if header = headers.delete("content-type") - headers["type"] = header - end - end - end -end -module ActionController - module CodeGeneration #:nodoc: - class GenerationError < StandardError #:nodoc: - end - - class Source #:nodoc: - attr_reader :lines, :indentation_level - IndentationString = ' ' - def initialize - @lines, @indentation_level = [], 0 - end - def line(line) - @lines << (IndentationString * @indentation_level + line) - end - alias :<< :line - - def indent - @indentation_level += 1 - yield - ensure - @indentation_level -= 1 - end - - def to_s() lines.join("\n") end - end - - class CodeGenerator #:nodoc: - attr_accessor :source, :locals - def initialize(source = nil) - @locals = [] - @source = source || Source.new - end - - BeginKeywords = %w(if unless begin until while def).collect {|kw| kw.to_sym} - ResumeKeywords = %w(elsif else rescue).collect {|kw| kw.to_sym} - Keywords = BeginKeywords + ResumeKeywords - - def method_missing(keyword, *text) - if Keywords.include? keyword - if ResumeKeywords.include? keyword - raise GenerationError, "Can only resume with #{keyword} immediately after an end" unless source.lines.last =~ /^\s*end\s*$/ - source.lines.pop # Remove the 'end' - end - - line "#{keyword} #{text.join ' '}" - begin source.indent { yield(self.dup) } - ensure line 'end' - end - else - super(keyword, *text) - end - end - - def line(*args) self.source.line(*args) end - alias :<< :line - def indent(*args, &block) source(*args, &block) end - def to_s() source.to_s end - - def share_locals_with(other) - other.locals = self.locals = (other.locals | locals) - end - - FieldsToDuplicate = [:locals] - def dup - copy = self.class.new(source) - self.class::FieldsToDuplicate.each do |sym| - value = self.send(sym) - value = value.dup unless value.nil? || value.is_a?(Numeric) - copy.send("#{sym}=", value) - end - return copy - end - end - - class RecognitionGenerator < CodeGenerator #:nodoc: - Attributes = [:after, :before, :current, :results, :constants, :depth, :move_ahead, :finish_statement] - attr_accessor(*Attributes) - FieldsToDuplicate = CodeGenerator::FieldsToDuplicate + Attributes - - def initialize(*args) - super(*args) - @after, @before = [], [] - @current = nil - @results, @constants = {}, {} - @depth = 0 - @move_ahead = nil - @finish_statement = Proc.new {|hash_expr| hash_expr} - end - - def if_next_matches(string, &block) - test = Routing.test_condition(next_segment(true), string) - self.if(test, &block) - end - - def move_forward(places = 1) - dup = self.dup - dup.depth += 1 - dup.move_ahead = places - yield dup - end - - def next_segment(assign_inline = false, default = nil) - if locals.include?(segment_name) - code = segment_name - else - code = "#{segment_name} = #{path_name}[#{index_name}]" - if assign_inline - code = "(#{code})" - else - line(code) - code = segment_name - end - - locals << segment_name - end - code = "(#{code} || #{default.inspect})" if default - - return code.to_s - end - - def segment_name() "segment#{depth}".to_sym end - def path_name() :path end - def index_name - move_ahead, @move_ahead = @move_ahead, nil - move_ahead ? "index += #{move_ahead}" : 'index' - end - - def continue - dup = self.dup - dup.before << dup.current - dup.current = dup.after.shift - dup.go - end - - def go - if current then current.write_recognition(self) - else self.finish - end - end - - def result(key, expression, delay = false) - unless delay - line "#{key}_value = #{expression}" - expression = "#{key}_value" - end - results[key] = expression - end - def constant_result(key, object) - constants[key] = object - end - - def finish(ensure_traversal_finished = true) - pairs = [] - (results.keys + constants.keys).uniq.each do |key| - pairs << "#{key.to_s.inspect} => #{results[key] ? results[key] : constants[key].inspect}" - end - hash_expr = "{#{pairs.join(', ')}}" - - statement = finish_statement.call(hash_expr) - if ensure_traversal_finished then self.if("! #{next_segment(true)}") {|gp| gp << statement} - else self << statement - end - end - end - - class GenerationGenerator < CodeGenerator #:nodoc: - Attributes = [:after, :before, :current, :segments] - attr_accessor(*Attributes) - FieldsToDuplicate = CodeGenerator::FieldsToDuplicate + Attributes - - def initialize(*args) - super(*args) - @after, @before = [], [] - @current = nil - @segments = [] - end - - def hash_name() 'hash' end - def local_name(key) "#{key}_value" end - - def hash_value(key, assign = true, default = nil) - if locals.include?(local_name(key)) then code = local_name(key) - else - code = "hash[#{key.to_sym.inspect}]" - if assign - code = "(#{local_name(key)} = #{code})" - locals << local_name(key) - end - end - code = "(#{code} || (#{default.inspect}))" if default - return code - end - - def expire_for_keys(*keys) - return if keys.empty? - conds = keys.collect {|key| "expire_on[#{key.to_sym.inspect}]"} - line "not_expired, #{hash_name} = false, options if not_expired && #{conds.join(' && ')}" - end - - def add_segment(*segments) - d = dup - d.segments.concat segments - yield d - end - - def go - if current then current.write_generation(self) - else self.finish - end - end - - def continue - d = dup - d.before << d.current - d.current = d.after.shift - d.go - end - - def finish - line %("/#{segments.join('/')}") - end - - def check_conditions(conditions) - tests = [] - generator = nil - conditions.each do |key, condition| - tests << (generator || self).hash_value(key, true) if condition.is_a? Regexp - tests << Routing.test_condition((generator || self).hash_value(key, false), condition) - generator = self.dup unless generator - end - return tests.join(' && ') - end - end - end -end -module ActionController #:nodoc: - # Components allow you to call other actions for their rendered response while executing another action. You can either delegate - # the entire response rendering or you can mix a partial response in with your other content. - # - # class WeblogController < ActionController::Base - # # Performs a method and then lets hello_world output its render - # def delegate_action - # do_other_stuff_before_hello_world - # render_component :controller => "greeter", :action => "hello_world", :params => { :person => "david" } - # end - # end - # - # class GreeterController < ActionController::Base - # def hello_world - # render :text => "#{params[:person]} says, Hello World!" - # end - # end - # - # The same can be done in a view to do a partial rendering: - # - # Let's see a greeting: - # <%= render_component :controller => "greeter", :action => "hello_world" %> - # - # It is also possible to specify the controller as a class constant, bypassing the inflector - # code to compute the controller class at runtime: - # - # <%= render_component :controller => GreeterController, :action => "hello_world" %> - # - # == When to use components - # - # Components should be used with care. They're significantly slower than simply splitting reusable parts into partials and - # conceptually more complicated. Don't use components as a way of separating concerns inside a single application. Instead, - # reserve components to those rare cases where you truly have reusable view and controller elements that can be employed - # across many applications at once. - # - # So to repeat: Components are a special-purpose approach that can often be replaced with better use of partials and filters. - module Components - def self.included(base) #:nodoc: - base.send :include, InstanceMethods - base.extend(ClassMethods) - - base.helper do - def render_component(options) - @controller.send(:render_component_as_string, options) - end - end - - # If this controller was instantiated to process a component request, - # +parent_controller+ points to the instantiator of this controller. - base.send :attr_accessor, :parent_controller - - base.class_eval do - alias_method :process_cleanup_without_components, :process_cleanup - alias_method :process_cleanup, :process_cleanup_with_components - - alias_method :set_session_options_without_components, :set_session_options - alias_method :set_session_options, :set_session_options_with_components - - alias_method :flash_without_components, :flash - alias_method :flash, :flash_with_components - - alias_method :component_request?, :parent_controller - end - end - - module ClassMethods - # Track parent controller to identify component requests - def process_with_components(request, response, parent_controller = nil) #:nodoc: - controller = new - controller.parent_controller = parent_controller - controller.process(request, response) - end - - # Set the template root to be one directory behind the root dir of the controller. Examples: - # /code/weblog/components/admin/users_controller.rb with Admin::UsersController - # will use /code/weblog/components as template root - # and find templates in /code/weblog/components/admin/users/ - # - # /code/weblog/components/admin/parties/users_controller.rb with Admin::Parties::UsersController - # will also use /code/weblog/components as template root - # and find templates in /code/weblog/components/admin/parties/users/ - def uses_component_template_root - path_of_calling_controller = File.dirname(caller[0].split(/:\d+:/).first) - path_of_controller_root = path_of_calling_controller.sub(/#{controller_path.split("/")[0..-2]}$/, "") # " (for ruby-mode) - - self.template_root = path_of_controller_root - end - end - - module InstanceMethods - # Extracts the action_name from the request parameters and performs that action. - def process_with_components(request, response, method = :perform_action, *arguments) #:nodoc: - flash.discard if component_request? - process_without_components(request, response, method, *arguments) - end - - protected - # Renders the component specified as the response for the current method - def render_component(options) #:doc: - component_logging(options) do - render_text(component_response(options, true).body, response.headers["Status"]) - end - end - - # Returns the component response as a string - def render_component_as_string(options) #:doc: - component_logging(options) do - response = component_response(options, false) - - if redirected = response.redirected_to - render_component_as_string(redirected) - else - response.body - end - end - end - - def flash_with_components(refresh = false) #:nodoc: - if @flash.nil? || refresh - @flash = - if @parent_controller - @parent_controller.flash - else - flash_without_components - end - end - - @flash - end - - private - def component_response(options, reuse_response) - klass = component_class(options) - request = request_for_component(klass.controller_name, options) - response = reuse_response ? @response : @response.dup - - klass.process_with_components(request, response, self) - end - - # determine the controller class for the component request - def component_class(options) - if controller = options[:controller] - controller.is_a?(Class) ? controller : "#{controller.camelize}Controller".constantize - else - self.class - end - end - - # Create a new request object based on the current request. - # The new request inherits the session from the current request, - # bypassing any session options set for the component controller's class - def request_for_component(controller_name, options) - request = @request.dup - request.session = @request.session - - request.instance_variable_set( - :@parameters, - (options[:params] || {}).with_indifferent_access.update( - "controller" => controller_name, "action" => options[:action], "id" => options[:id] - ) - ) - - request - end - - def component_logging(options) - if logger - logger.info "Start rendering component (#{options.inspect}): " - result = yield - logger.info "\n\nEnd of component rendering" - result - else - yield - end - end - - def set_session_options_with_components(request) - set_session_options_without_components(request) unless component_request? - end - - def process_cleanup_with_components - process_cleanup_without_components unless component_request? - end - end - end -end -module ActionController #:nodoc: - # Cookies are read and written through ActionController#cookies. The cookies being read are what were received along with the request, - # the cookies being written are what will be sent out with the response. Cookies are read by value (so you won't get the cookie object - # itself back -- just the value it holds). Examples for writing: - # - # cookies[:user_name] = "david" # => Will set a simple session cookie - # cookies[:login] = { :value => "XJ-122", :expires => Time.now + 360} # => Will set a cookie that expires in 1 hour - # - # Examples for reading: - # - # cookies[:user_name] # => "david" - # cookies.size # => 2 - # - # Example for deleting: - # - # cookies.delete :user_name - # - # All the option symbols for setting cookies are: - # - # * value - the cookie's value or list of values (as an array). - # * path - the path for which this cookie applies. Defaults to the root of the application. - # * domain - the domain for which this cookie applies. - # * expires - the time at which this cookie expires, as a +Time+ object. - # * secure - whether this cookie is a secure cookie or not (default to false). - # Secure cookies are only transmitted to HTTPS servers. - module Cookies - protected - # Returns the cookie container, which operates as described above. - def cookies - CookieJar.new(self) - end - - # Deprecated cookie writer method - def cookie(*options) - @response.headers["cookie"] << CGI::Cookie.new(*options) - end - end - - class CookieJar < Hash #:nodoc: - def initialize(controller) - @controller, @cookies = controller, controller.instance_variable_get("@cookies") - super() - update(@cookies) - end - - # Returns the value of the cookie by +name+ -- or nil if no such cookie exists. You set new cookies using either the cookie method - # or cookies[]= (for simple name/value cookies without options). - def [](name) - @cookies[name.to_s].value.first if @cookies[name.to_s] && @cookies[name.to_s].respond_to?(:value) - end - - def []=(name, options) - if options.is_a?(Hash) - options = options.inject({}) { |options, pair| options[pair.first.to_s] = pair.last; options } - options["name"] = name.to_s - else - options = { "name" => name.to_s, "value" => options } - end - - set_cookie(options) - end - - # Removes the cookie on the client machine by setting the value to an empty string - # and setting its expiration date into the past - def delete(name) - set_cookie("name" => name.to_s, "value" => "", "expires" => Time.at(0)) - end - - private - def set_cookie(options) #:doc: - options["path"] = "/" unless options["path"] - cookie = CGI::Cookie.new(options) - @controller.logger.info "Cookie set: #{cookie}" unless @controller.logger.nil? - @controller.response.headers["cookie"] << cookie - end - end -end -module ActionController #:nodoc: - module Dependencies #:nodoc: - def self.append_features(base) - super - base.extend(ClassMethods) - end - - # Dependencies control what classes are needed for the controller to run its course. This is an alternative to doing explicit - # +require+ statements that bring a number of benefits. It's more succinct, communicates what type of dependency we're talking about, - # can trigger special behavior (as in the case of +observer+), and enables Rails to be clever about reloading in cached environments - # like FCGI. Example: - # - # class ApplicationController < ActionController::Base - # model :account, :company, :person, :project, :category - # helper :access_control - # service :notifications, :billings - # observer :project_change_observer - # end - # - # Please note that a controller like ApplicationController will automatically attempt to require_dependency on a model of its - # singuralized name and a helper of its name. If nothing is found, no error is raised. This is especially useful for concrete - # controllers like PostController: - # - # class PostController < ApplicationController - # # model :post (already required) - # # helper :post (already required) - # end - # - # Also note, that if the models follow the pattern of just 1 class per file in the form of MyClass => my_class.rb, then these - # classes don't have to be required as Active Support will auto-require them. - module ClassMethods #:nodoc: - # Specifies a variable number of models that this controller depends on. Models are normally Active Record classes or a similar - # backend for modelling entity classes. - def model(*models) - require_dependencies(:model, models) - depend_on(:model, models) - end - - # Specifies a variable number of services that this controller depends on. Services are normally singletons or factories, like - # Action Mailer service or a Payment Gateway service. - def service(*services) - require_dependencies(:service, services) - depend_on(:service, services) - end - - # Specifies a variable number of observers that are to govern when this controller is handling actions. The observers will - # automatically have .instance called on them to make them active on assignment. - def observer(*observers) - require_dependencies(:observer, observers) - depend_on(:observer, observers) - instantiate_observers(observers) - end - - # Returns an array of symbols that specify the dependencies on a given layer. For the example at the top, calling - # ApplicationController.dependencies_on(:model) would return [:account, :company, :person, :project, :category] - def dependencies_on(layer) - read_inheritable_attribute("#{layer}_dependencies") - end - - def depend_on(layer, dependencies) #:nodoc: - write_inheritable_array("#{layer}_dependencies", dependencies) - end - - private - def instantiate_observers(observers) - observers.flatten.each { |observer| Object.const_get(Inflector.classify(observer.to_s)).instance } - end - - def require_dependencies(layer, dependencies) - dependencies.flatten.each do |dependency| - begin - require_dependency(dependency.to_s) - rescue LoadError => e - raise LoadError.new("Missing #{layer} #{dependency}.rb").copy_blame!(e) - rescue Object => exception - exception.blame_file! "=> #{layer} #{dependency}.rb" - raise - end - end - end - end - end -end -require 'test/unit' -require 'test/unit/assertions' -require 'rexml/document' - -module Test #:nodoc: - module Unit #:nodoc: - module Assertions - def assert_success(message=nil) #:nodoc: - assert_response(:success, message) - end - - def assert_redirect(message=nil) #:nodoc: - assert_response(:redirect, message) - end - - def assert_rendered_file(expected=nil, message=nil) #:nodoc: - assert_template(expected, message) - end - - # ensure that the session has an object with the specified name - def assert_session_has(key=nil, message=nil) #:nodoc: - msg = build_message(message, " is not in the session ", key, @response.session) - assert_block(msg) { @response.has_session_object?(key) } - end - - # ensure that the session has no object with the specified name - def assert_session_has_no(key=nil, message=nil) #:nodoc: - msg = build_message(message, " is in the session ", key, @response.session) - assert_block(msg) { !@response.has_session_object?(key) } - end - - def assert_session_equal(expected = nil, key = nil, message = nil) #:nodoc: - msg = build_message(message, " expected in session['?'] but was ", expected, key, @response.session[key]) - assert_block(msg) { expected == @response.session[key] } - end - - # -- cookie assertions --------------------------------------------------- - - def assert_no_cookie(key = nil, message = nil) #:nodoc: - actual = @response.cookies[key] - msg = build_message(message, " not expected in cookies['?']", actual, key) - assert_block(msg) { actual.nil? or actual.empty? } - end - - def assert_cookie_equal(expected = nil, key = nil, message = nil) #:nodoc: - actual = @response.cookies[key] - actual = actual.first if actual - msg = build_message(message, " expected in cookies['?'] but was ", expected, key, actual) - assert_block(msg) { expected == actual } - end - - # -- flash assertions --------------------------------------------------- - - # ensure that the flash has an object with the specified name - def assert_flash_has(key=nil, message=nil) #:nodoc: - msg = build_message(message, " is not in the flash ", key, @response.flash) - assert_block(msg) { @response.has_flash_object?(key) } - end - - # ensure that the flash has no object with the specified name - def assert_flash_has_no(key=nil, message=nil) #:nodoc: - msg = build_message(message, " is in the flash ", key, @response.flash) - assert_block(msg) { !@response.has_flash_object?(key) } - end - - # ensure the flash exists - def assert_flash_exists(message=nil) #:nodoc: - msg = build_message(message, "the flash does not exist ", @response.session['flash'] ) - assert_block(msg) { @response.has_flash? } - end - - # ensure the flash does not exist - def assert_flash_not_exists(message=nil) #:nodoc: - msg = build_message(message, "the flash exists ", @response.flash) - assert_block(msg) { !@response.has_flash? } - end - - # ensure the flash is empty but existent - def assert_flash_empty(message=nil) #:nodoc: - msg = build_message(message, "the flash is not empty ", @response.flash) - assert_block(msg) { !@response.has_flash_with_contents? } - end - - # ensure the flash is not empty - def assert_flash_not_empty(message=nil) #:nodoc: - msg = build_message(message, "the flash is empty") - assert_block(msg) { @response.has_flash_with_contents? } - end - - def assert_flash_equal(expected = nil, key = nil, message = nil) #:nodoc: - msg = build_message(message, " expected in flash['?'] but was ", expected, key, @response.flash[key]) - assert_block(msg) { expected == @response.flash[key] } - end - - - # ensure our redirection url is an exact match - def assert_redirect_url(url=nil, message=nil) #:nodoc: - assert_redirect(message) - msg = build_message(message, " is not the redirected location ", url, @response.redirect_url) - assert_block(msg) { @response.redirect_url == url } - end - - # ensure our redirection url matches a pattern - def assert_redirect_url_match(pattern=nil, message=nil) #:nodoc: - assert_redirect(message) - msg = build_message(message, " was not found in the location: ", pattern, @response.redirect_url) - assert_block(msg) { @response.redirect_url_match?(pattern) } - end - - - # -- template assertions ------------------------------------------------ - - # ensure that a template object with the given name exists - def assert_template_has(key=nil, message=nil) #:nodoc: - msg = build_message(message, " is not a template object", key ) - assert_block(msg) { @response.has_template_object?(key) } - end - - # ensure that a template object with the given name does not exist - def assert_template_has_no(key=nil,message=nil) #:nodoc: - msg = build_message(message, " is a template object ", key, @response.template_objects[key]) - assert_block(msg) { !@response.has_template_object?(key) } - end - - # ensures that the object assigned to the template on +key+ is equal to +expected+ object. - def assert_template_equal(expected = nil, key = nil, message = nil) #:nodoc: - msg = build_message(message, " expected in assigns['?'] but was ", expected, key, @response.template.assigns[key.to_s]) - assert_block(msg) { expected == @response.template.assigns[key.to_s] } - end - alias_method :assert_assigned_equal, :assert_template_equal - - # Asserts that the template returns the +expected+ string or array based on the XPath +expression+. - # This will only work if the template rendered a valid XML document. - def assert_template_xpath_match(expression=nil, expected=nil, message=nil) #:nodoc: - xml, matches = REXML::Document.new(@response.body), [] - xml.elements.each(expression) { |e| matches << e.text } - if matches.empty? then - msg = build_message(message, " not found in document", expression) - flunk(msg) - return - elsif matches.length < 2 then - matches = matches.first - end - - msg = build_message(message, " found , not ", expression, matches, expected) - assert_block(msg) { matches == expected } - end - - # Assert the template object with the given name is an Active Record descendant and is valid. - def assert_valid_record(key = nil, message = nil) #:nodoc: - record = find_record_in_template(key) - msg = build_message(message, "Active Record is invalid )", record.errors.full_messages) - assert_block(msg) { record.valid? } - end - - # Assert the template object with the given name is an Active Record descendant and is invalid. - def assert_invalid_record(key = nil, message = nil) #:nodoc: - record = find_record_in_template(key) - msg = build_message(message, "Active Record is valid)") - assert_block(msg) { !record.valid? } - end - - # Assert the template object with the given name is an Active Record descendant and the specified column(s) are valid. - def assert_valid_column_on_record(key = nil, columns = "", message = nil) #:nodoc: - record = find_record_in_template(key) - record.send(:validate) - - cols = glue_columns(columns) - cols.delete_if { |col| !record.errors.invalid?(col) } - msg = build_message(message, "Active Record has invalid columns )", cols.join(",") ) - assert_block(msg) { cols.empty? } - end - - # Assert the template object with the given name is an Active Record descendant and the specified column(s) are invalid. - def assert_invalid_column_on_record(key = nil, columns = "", message = nil) #:nodoc: - record = find_record_in_template(key) - record.send(:validate) - - cols = glue_columns(columns) - cols.delete_if { |col| record.errors.invalid?(col) } - msg = build_message(message, "Active Record has valid columns )", cols.join(",") ) - assert_block(msg) { cols.empty? } - end - - private - def glue_columns(columns) - cols = [] - cols << columns if columns.class == String - cols += columns if columns.class == Array - cols - end - - def find_record_in_template(key = nil) - assert_template_has(key) - record = @response.template_objects[key] - - assert_not_nil(record) - assert_kind_of ActiveRecord::Base, record - - return record - end - end - end -endmodule ActionController - class Base - protected - # Deprecated in favor of calling redirect_to directly with the path. - def redirect_to_path(path) #:nodoc: - redirect_to(path) - end - - # Deprecated in favor of calling redirect_to directly with the url. If the resource has moved permanently, it's possible to pass - # true as the second parameter and the browser will get "301 Moved Permanently" instead of "302 Found". This can also be done through - # just setting the headers["Status"] to "301 Moved Permanently" before using the redirect_to. - def redirect_to_url(url, permanently = false) #:nodoc: - headers["Status"] = "301 Moved Permanently" if permanently - redirect_to(url) - end - end -end -module ActionController - class AbstractRequest - # Determine whether the body of a HTTP call is URL-encoded (default) - # or matches one of the registered param_parsers. - # - # For backward compatibility, the post format is extracted from the - # X-Post-Data-Format HTTP header if present. - def post_format - case content_type.to_s - when 'application/xml' - :xml - when 'application/x-yaml' - :yaml - else - :url_encoded - end - end - - # Is this a POST request formatted as XML or YAML? - def formatted_post? - post? && (post_format == :yaml || post_format == :xml) - end - - # Is this a POST request formatted as XML? - def xml_post? - post? && post_format == :xml - end - - # Is this a POST request formatted as YAML? - def yaml_post? - post? && post_format == :yaml - end - end -end -module ActionController #:nodoc: - module Filters #:nodoc: - def self.included(base) - base.extend(ClassMethods) - base.send(:include, ActionController::Filters::InstanceMethods) - end - - # Filters enable controllers to run shared pre and post processing code for its actions. These filters can be used to do - # authentication, caching, or auditing before the intended action is performed. Or to do localization or output - # compression after the action has been performed. - # - # Filters have access to the request, response, and all the instance variables set by other filters in the chain - # or by the action (in the case of after filters). Additionally, it's possible for a pre-processing before_filter - # to halt the processing before the intended action is processed by returning false or performing a redirect or render. - # This is especially useful for filters like authentication where you're not interested in allowing the action to be - # performed if the proper credentials are not in order. - # - # == Filter inheritance - # - # Controller inheritance hierarchies share filters downwards, but subclasses can also add new filters without - # affecting the superclass. For example: - # - # class BankController < ActionController::Base - # before_filter :audit - # - # private - # def audit - # # record the action and parameters in an audit log - # end - # end - # - # class VaultController < BankController - # before_filter :verify_credentials - # - # private - # def verify_credentials - # # make sure the user is allowed into the vault - # end - # end - # - # Now any actions performed on the BankController will have the audit method called before. On the VaultController, - # first the audit method is called, then the verify_credentials method. If the audit method returns false, then - # verify_credentials and the intended action are never called. - # - # == Filter types - # - # A filter can take one of three forms: method reference (symbol), external class, or inline method (proc). The first - # is the most common and works by referencing a protected or private method somewhere in the inheritance hierarchy of - # the controller by use of a symbol. In the bank example above, both BankController and VaultController use this form. - # - # Using an external class makes for more easily reused generic filters, such as output compression. External filter classes - # are implemented by having a static +filter+ method on any class and then passing this class to the filter method. Example: - # - # class OutputCompressionFilter - # def self.filter(controller) - # controller.response.body = compress(controller.response.body) - # end - # end - # - # class NewspaperController < ActionController::Base - # after_filter OutputCompressionFilter - # end - # - # The filter method is passed the controller instance and is hence granted access to all aspects of the controller and can - # manipulate them as it sees fit. - # - # The inline method (using a proc) can be used to quickly do something small that doesn't require a lot of explanation. - # Or just as a quick test. It works like this: - # - # class WeblogController < ActionController::Base - # before_filter { |controller| false if controller.params["stop_action"] } - # end - # - # As you can see, the block expects to be passed the controller after it has assigned the request to the internal variables. - # This means that the block has access to both the request and response objects complete with convenience methods for params, - # session, template, and assigns. Note: The inline method doesn't strictly have to be a block; any object that responds to call - # and returns 1 or -1 on arity will do (such as a Proc or an Method object). - # - # == Filter chain ordering - # - # Using before_filter and after_filter appends the specified filters to the existing chain. That's usually - # just fine, but some times you care more about the order in which the filters are executed. When that's the case, you - # can use prepend_before_filter and prepend_after_filter. Filters added by these methods will be put at the - # beginning of their respective chain and executed before the rest. For example: - # - # class ShoppingController - # before_filter :verify_open_shop - # - # class CheckoutController - # prepend_before_filter :ensure_items_in_cart, :ensure_items_in_stock - # - # The filter chain for the CheckoutController is now :ensure_items_in_cart, :ensure_items_in_stock, - # :verify_open_shop. So if either of the ensure filters return false, we'll never get around to see if the shop - # is open or not. - # - # You may pass multiple filter arguments of each type as well as a filter block. - # If a block is given, it is treated as the last argument. - # - # == Around filters - # - # In addition to the individual before and after filters, it's also possible to specify that a single object should handle - # both the before and after call. That's especially useful when you need to keep state active between the before and after, - # such as the example of a benchmark filter below: - # - # class WeblogController < ActionController::Base - # around_filter BenchmarkingFilter.new - # - # # Before this action is performed, BenchmarkingFilter#before(controller) is executed - # def index - # end - # # After this action has been performed, BenchmarkingFilter#after(controller) is executed - # end - # - # class BenchmarkingFilter - # def initialize - # @runtime - # end - # - # def before - # start_timer - # end - # - # def after - # stop_timer - # report_result - # end - # end - # - # == Filter chain skipping - # - # Some times its convenient to specify a filter chain in a superclass that'll hold true for the majority of the - # subclasses, but not necessarily all of them. The subclasses that behave in exception can then specify which filters - # they would like to be relieved of. Examples - # - # class ApplicationController < ActionController::Base - # before_filter :authenticate - # end - # - # class WeblogController < ApplicationController - # # will run the :authenticate filter - # end - # - # class SignupController < ApplicationController - # # will not run the :authenticate filter - # skip_before_filter :authenticate - # end - # - # == Filter conditions - # - # Filters can be limited to run for only specific actions. This can be expressed either by listing the actions to - # exclude or the actions to include when executing the filter. Available conditions are +:only+ or +:except+, both - # of which accept an arbitrary number of method references. For example: - # - # class Journal < ActionController::Base - # # only require authentication if the current action is edit or delete - # before_filter :authorize, :only => [ :edit, :delete ] - # - # private - # def authorize - # # redirect to login unless authenticated - # end - # end - # - # When setting conditions on inline method (proc) filters the condition must come first and be placed in parentheses. - # - # class UserPreferences < ActionController::Base - # before_filter(:except => :new) { # some proc ... } - # # ... - # end - # - module ClassMethods - # The passed filters will be appended to the array of filters that's run _before_ actions - # on this controller are performed. - def append_before_filter(*filters, &block) - conditions = extract_conditions!(filters) - filters << block if block_given? - add_action_conditions(filters, conditions) - append_filter_to_chain('before', filters) - end - - # The passed filters will be prepended to the array of filters that's run _before_ actions - # on this controller are performed. - def prepend_before_filter(*filters, &block) - conditions = extract_conditions!(filters) - filters << block if block_given? - add_action_conditions(filters, conditions) - prepend_filter_to_chain('before', filters) - end - - # Short-hand for append_before_filter since that's the most common of the two. - alias :before_filter :append_before_filter - - # The passed filters will be appended to the array of filters that's run _after_ actions - # on this controller are performed. - def append_after_filter(*filters, &block) - conditions = extract_conditions!(filters) - filters << block if block_given? - add_action_conditions(filters, conditions) - append_filter_to_chain('after', filters) - end - - # The passed filters will be prepended to the array of filters that's run _after_ actions - # on this controller are performed. - def prepend_after_filter(*filters, &block) - conditions = extract_conditions!(filters) - filters << block if block_given? - add_action_conditions(filters, conditions) - prepend_filter_to_chain("after", filters) - end - - # Short-hand for append_after_filter since that's the most common of the two. - alias :after_filter :append_after_filter - - # The passed filters will have their +before+ method appended to the array of filters that's run both before actions - # on this controller are performed and have their +after+ method prepended to the after actions. The filter objects must all - # respond to both +before+ and +after+. So if you do append_around_filter A.new, B.new, the callstack will look like: - # - # B#before - # A#before - # A#after - # B#after - def append_around_filter(*filters) - conditions = extract_conditions!(filters) - for filter in filters.flatten - ensure_filter_responds_to_before_and_after(filter) - append_before_filter(conditions || {}) { |c| filter.before(c) } - prepend_after_filter(conditions || {}) { |c| filter.after(c) } - end - end - - # The passed filters will have their +before+ method prepended to the array of filters that's run both before actions - # on this controller are performed and have their +after+ method appended to the after actions. The filter objects must all - # respond to both +before+ and +after+. So if you do prepend_around_filter A.new, B.new, the callstack will look like: - # - # A#before - # B#before - # B#after - # A#after - def prepend_around_filter(*filters) - for filter in filters.flatten - ensure_filter_responds_to_before_and_after(filter) - prepend_before_filter { |c| filter.before(c) } - append_after_filter { |c| filter.after(c) } - end - end - - # Short-hand for append_around_filter since that's the most common of the two. - alias :around_filter :append_around_filter - - # Removes the specified filters from the +before+ filter chain. Note that this only works for skipping method-reference - # filters, not procs. This is especially useful for managing the chain in inheritance hierarchies where only one out - # of many sub-controllers need a different hierarchy. - # - # You can control the actions to skip the filter for with the :only and :except options, - # just like when you apply the filters. - def skip_before_filter(*filters) - if conditions = extract_conditions!(filters) - remove_contradicting_conditions!(filters, conditions) - conditions[:only], conditions[:except] = conditions[:except], conditions[:only] - add_action_conditions(filters, conditions) - else - for filter in filters.flatten - write_inheritable_attribute("before_filters", read_inheritable_attribute("before_filters") - [ filter ]) - end - end - end - - # Removes the specified filters from the +after+ filter chain. Note that this only works for skipping method-reference - # filters, not procs. This is especially useful for managing the chain in inheritance hierarchies where only one out - # of many sub-controllers need a different hierarchy. - # - # You can control the actions to skip the filter for with the :only and :except options, - # just like when you apply the filters. - def skip_after_filter(*filters) - if conditions = extract_conditions!(filters) - remove_contradicting_conditions!(filters, conditions) - conditions[:only], conditions[:except] = conditions[:except], conditions[:only] - add_action_conditions(filters, conditions) - else - for filter in filters.flatten - write_inheritable_attribute("after_filters", read_inheritable_attribute("after_filters") - [ filter ]) - end - end - end - - # Returns all the before filters for this class and all its ancestors. - def before_filters #:nodoc: - @before_filters ||= read_inheritable_attribute("before_filters") || [] - end - - # Returns all the after filters for this class and all its ancestors. - def after_filters #:nodoc: - @after_filters ||= read_inheritable_attribute("after_filters") || [] - end - - # Returns a mapping between filters and the actions that may run them. - def included_actions #:nodoc: - @included_actions ||= read_inheritable_attribute("included_actions") || {} - end - - # Returns a mapping between filters and actions that may not run them. - def excluded_actions #:nodoc: - @excluded_actions ||= read_inheritable_attribute("excluded_actions") || {} - end - - private - def append_filter_to_chain(condition, filters) - write_inheritable_array("#{condition}_filters", filters) - end - - def prepend_filter_to_chain(condition, filters) - old_filters = read_inheritable_attribute("#{condition}_filters") || [] - write_inheritable_attribute("#{condition}_filters", filters + old_filters) - end - - def ensure_filter_responds_to_before_and_after(filter) - unless filter.respond_to?(:before) && filter.respond_to?(:after) - raise ActionControllerError, "Filter object must respond to both before and after" - end - end - - def extract_conditions!(filters) - return nil unless filters.last.is_a? Hash - filters.pop - end - - def add_action_conditions(filters, conditions) - return unless conditions - included, excluded = conditions[:only], conditions[:except] - write_inheritable_hash('included_actions', condition_hash(filters, included)) && return if included - write_inheritable_hash('excluded_actions', condition_hash(filters, excluded)) if excluded - end - - def condition_hash(filters, *actions) - filters.inject({}) {|hash, filter| hash.merge(filter => actions.flatten.map {|action| action.to_s})} - end - - def remove_contradicting_conditions!(filters, conditions) - return unless conditions[:only] - filters.each do |filter| - next unless included_actions_for_filter = (read_inheritable_attribute('included_actions') || {})[filter] - [*conditions[:only]].each do |conditional_action| - conditional_action = conditional_action.to_s - included_actions_for_filter.delete(conditional_action) if included_actions_for_filter.include?(conditional_action) - end - end - end - end - - module InstanceMethods # :nodoc: - def self.included(base) - base.class_eval do - alias_method :perform_action_without_filters, :perform_action - alias_method :perform_action, :perform_action_with_filters - - alias_method :process_without_filters, :process - alias_method :process, :process_with_filters - - alias_method :process_cleanup_without_filters, :process_cleanup - alias_method :process_cleanup, :process_cleanup_with_filters - end - end - - def perform_action_with_filters - before_action_result = before_action - - unless before_action_result == false || performed? - perform_action_without_filters - after_action - end - - @before_filter_chain_aborted = (before_action_result == false) - end - - def process_with_filters(request, response, method = :perform_action, *arguments) #:nodoc: - @before_filter_chain_aborted = false - process_without_filters(request, response, method, *arguments) - end - - # Calls all the defined before-filter filters, which are added by using "before_filter :method". - # If any of the filters return false, no more filters will be executed and the action is aborted. - def before_action #:doc: - call_filters(self.class.before_filters) - end - - # Calls all the defined after-filter filters, which are added by using "after_filter :method". - # If any of the filters return false, no more filters will be executed. - def after_action #:doc: - call_filters(self.class.after_filters) - end - - private - def call_filters(filters) - filters.each do |filter| - next if action_exempted?(filter) - - filter_result = case - when filter.is_a?(Symbol) - self.send(filter) - when filter_block?(filter) - filter.call(self) - when filter_class?(filter) - filter.filter(self) - else - raise( - ActionControllerError, - 'Filters need to be either a symbol, proc/method, or class implementing a static filter method' - ) - end - - if filter_result == false - logger.info "Filter chain halted as [#{filter}] returned false" if logger - return false - end - end - end - - def filter_block?(filter) - filter.respond_to?('call') && (filter.arity == 1 || filter.arity == -1) - end - - def filter_class?(filter) - filter.respond_to?('filter') - end - - def action_exempted?(filter) - case - when ia = self.class.included_actions[filter] - !ia.include?(action_name) - when ea = self.class.excluded_actions[filter] - ea.include?(action_name) - end - end - - def process_cleanup_with_filters - if @before_filter_chain_aborted - close_session - else - process_cleanup_without_filters - end - end - end - end -end -module ActionController #:nodoc: - # The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed - # to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create action - # that sets flash[:notice] = "Successfully created" before redirecting to a display action that can then expose - # the flash to its template. Actually, that exposure is automatically done. Example: - # - # class WeblogController < ActionController::Base - # def create - # # save post - # flash[:notice] = "Successfully created post" - # redirect_to :action => "display", :params => { :id => post.id } - # end - # - # def display - # # doesn't need to assign the flash notice to the template, that's done automatically - # end - # end - # - # display.rhtml - # <% if @flash[:notice] %>
    <%= @flash[:notice] %>
    <% end %> - # - # This example just places a string in the flash, but you can put any object in there. And of course, you can put as many - # as you like at a time too. Just remember: They'll be gone by the time the next action has been performed. - # - # See docs on the FlashHash class for more details about the flash. - module Flash - def self.included(base) - base.send :include, InstanceMethods - - base.class_eval do - alias_method :assign_shortcuts_without_flash, :assign_shortcuts - alias_method :assign_shortcuts, :assign_shortcuts_with_flash - - alias_method :process_cleanup_without_flash, :process_cleanup - alias_method :process_cleanup, :process_cleanup_with_flash - end - end - - - class FlashNow #:nodoc: - def initialize(flash) - @flash = flash - end - - def []=(k, v) - @flash[k] = v - @flash.discard(k) - v - end - - def [](k) - @flash[k] - end - end - - class FlashHash < Hash - def initialize #:nodoc: - super - @used = {} - end - - def []=(k, v) #:nodoc: - keep(k) - super - end - - def update(h) #:nodoc: - h.keys.each{ |k| discard(k) } - super - end - - alias :merge! :update - - def replace(h) #:nodoc: - @used = {} - super - end - - # Sets a flash that will not be available to the next action, only to the current. - # - # flash.now[:message] = "Hello current action" - # - # This method enables you to use the flash as a central messaging system in your app. - # When you need to pass an object to the next action, you use the standard flash assign ([]=). - # When you need to pass an object to the current action, you use now, and your object will - # vanish when the current action is done. - # - # Entries set via now are accessed the same way as standard entries: flash['my-key']. - def now - FlashNow.new self - end - - # Keeps either the entire current flash or a specific flash entry available for the next action: - # - # flash.keep # keeps the entire flash - # flash.keep(:notice) # keeps only the "notice" entry, the rest of the flash is discarded - def keep(k=nil) - use(k, false) - end - - # Marks the entire flash or a single flash entry to be discarded by the end of the current action - # - # flash.keep # keep entire flash available for the next action - # flash.discard(:warning) # discard the "warning" entry (it'll still be available for the current action) - def discard(k=nil) - use(k) - end - - # Mark for removal entries that were kept, and delete unkept ones. - # - # This method is called automatically by filters, so you generally don't need to care about it. - def sweep #:nodoc: - keys.each do |k| - unless @used[k] - use(k) - else - delete(k) - @used.delete(k) - end - end - (@used.keys - keys).each{|k| @used.delete k } # clean up after keys that could have been left over by calling reject! or shift on the flash - end - - private - # Used internally by the keep and discard methods - # use() # marks the entire flash as used - # use('msg') # marks the "msg" entry as used - # use(nil, false) # marks the entire flash as unused (keeps it around for one more action) - # use('msg', false) # marks the "msg" entry as unused (keeps it around for one more action) - def use(k=nil, v=true) - unless k.nil? - @used[k] = v - else - keys.each{|key| use key, v } - end - end - end - - module InstanceMethods #:nodoc: - def assign_shortcuts_with_flash(request, response) #:nodoc: - assign_shortcuts_without_flash(request, response) - flash(:refresh) - end - - def process_cleanup_with_flash - flash.sweep if @session - process_cleanup_without_flash - end - - protected - # Access the contents of the flash. Use flash["notice"] to read a notice you put there or - # flash["notice"] = "hello" to put a new one. - # Note that if sessions are disabled only flash.now will work. - def flash(refresh = false) #:doc: - if @flash.nil? || refresh - @flash = - if @session.is_a?(Hash) - # @session is a Hash, if sessions are disabled - # we don't put the flash in the session in this case - FlashHash.new - else - # otherwise, @session is a CGI::Session or a TestSession - # so make sure it gets retrieved from/saved to session storage after request processing - @session["flash"] ||= FlashHash.new - end - end - - @flash - end - - # deprecated. use flash.keep instead - def keep_flash #:doc: - warn 'keep_flash is deprecated; use flash.keep instead.' - flash.keep - end - end - end -endmodule ActionController #:nodoc: - module Helpers #:nodoc: - def self.append_features(base) - super - - # Initialize the base module to aggregate its helpers. - base.class_inheritable_accessor :master_helper_module - base.master_helper_module = Module.new - - # Extend base with class methods to declare helpers. - base.extend(ClassMethods) - - base.class_eval do - # Wrap inherited to create a new master helper module for subclasses. - class << self - alias_method :inherited_without_helper, :inherited - alias_method :inherited, :inherited_with_helper - end - end - end - - # The template helpers serve to relieve the templates from including the same inline code again and again. It's a - # set of standardized methods for working with forms (FormHelper), dates (DateHelper), texts (TextHelper), and - # Active Records (ActiveRecordHelper) that's available to all templates by default. - # - # It's also really easy to make your own helpers and it's much encouraged to keep the template files free - # from complicated logic. It's even encouraged to bundle common compositions of methods from other helpers - # (often the common helpers) as they're used by the specific application. - # - # module MyHelper - # def hello_world() "hello world" end - # end - # - # MyHelper can now be included in a controller, like this: - # - # class MyController < ActionController::Base - # helper :my_helper - # end - # - # ...and, same as above, used in any template rendered from MyController, like this: - # - # Let's hear what the helper has to say: <%= hello_world %> - module ClassMethods - # Makes all the (instance) methods in the helper module available to templates rendered through this controller. - # See ActionView::Helpers (link:classes/ActionView/Helpers.html) for more about making your own helper modules - # available to the templates. - def add_template_helper(helper_module) #:nodoc: - master_helper_module.send(:include, helper_module) - end - - # Declare a helper: - # helper :foo - # requires 'foo_helper' and includes FooHelper in the template class. - # helper FooHelper - # includes FooHelper in the template class. - # helper { def foo() "#{bar} is the very best" end } - # evaluates the block in the template class, adding method #foo. - # helper(:three, BlindHelper) { def mice() 'mice' end } - # does all three. - def helper(*args, &block) - args.flatten.each do |arg| - case arg - when Module - add_template_helper(arg) - when String, Symbol - file_name = arg.to_s.underscore + '_helper' - class_name = file_name.camelize - - begin - require_dependency(file_name) - rescue LoadError => load_error - requiree = / -- (.*?)(\.rb)?$/.match(load_error).to_a[1] - msg = (requiree == file_name) ? "Missing helper file helpers/#{file_name}.rb" : "Can't load file: #{requiree}" - raise LoadError.new(msg).copy_blame!(load_error) - end - - add_template_helper(class_name.constantize) - else - raise ArgumentError, 'helper expects String, Symbol, or Module argument' - end - end - - # Evaluate block in template class if given. - master_helper_module.module_eval(&block) if block_given? - end - - # Declare a controller method as a helper. For example, - # helper_method :link_to - # def link_to(name, options) ... end - # makes the link_to controller method available in the view. - def helper_method(*methods) - methods.flatten.each do |method| - master_helper_module.module_eval <<-end_eval - def #{method}(*args, &block) - controller.send(%(#{method}), *args, &block) - end - end_eval - end - end - - # Declare a controller attribute as a helper. For example, - # helper_attr :name - # attr_accessor :name - # makes the name and name= controller methods available in the view. - # The is a convenience wrapper for helper_method. - def helper_attr(*attrs) - attrs.flatten.each { |attr| helper_method(attr, "#{attr}=") } - end - - private - def default_helper_module! - module_name = name.sub(/Controller$|$/, 'Helper') - module_path = module_name.split('::').map { |m| m.underscore }.join('/') - require_dependency module_path - helper module_name.constantize - rescue LoadError - logger.debug("#{name}: missing default helper path #{module_path}") if logger - rescue NameError - logger.debug("#{name}: missing default helper module #{module_name}") if logger - end - - def inherited_with_helper(child) - inherited_without_helper(child) - begin - child.master_helper_module = Module.new - child.master_helper_module.send :include, master_helper_module - child.send :default_helper_module! - rescue MissingSourceFile => e - raise unless e.is_missing?("helpers/#{child.controller_path}_helper") - end - end - end - end -end -require 'dispatcher' -require 'stringio' -require 'uri' - -module ActionController - module Integration #:nodoc: - # An integration Session instance represents a set of requests and responses - # performed sequentially by some virtual user. Becase you can instantiate - # multiple sessions and run them side-by-side, you can also mimic (to some - # limited extent) multiple simultaneous users interacting with your system. - # - # Typically, you will instantiate a new session using IntegrationTest#open_session, - # rather than instantiating Integration::Session directly. - class Session - include Test::Unit::Assertions - include ActionController::TestProcess - - # The integer HTTP status code of the last request. - attr_reader :status - - # The status message that accompanied the status code of the last request. - attr_reader :status_message - - # The URI of the last request. - attr_reader :path - - # The hostname used in the last request. - attr_accessor :host - - # The remote_addr used in the last request. - attr_accessor :remote_addr - - # The Accept header to send. - attr_accessor :accept - - # A map of the cookies returned by the last response, and which will be - # sent with the next request. - attr_reader :cookies - - # A map of the headers returned by the last response. - attr_reader :headers - - # A reference to the controller instance used by the last request. - attr_reader :controller - - # A reference to the request instance used by the last request. - attr_reader :request - - # A reference to the response instance used by the last request. - attr_reader :response - - # Create an initialize a new Session instance. - def initialize - reset! - end - - # Resets the instance. This can be used to reset the state information - # in an existing session instance, so it can be used from a clean-slate - # condition. - # - # session.reset! - def reset! - @status = @path = @headers = nil - @result = @status_message = nil - @https = false - @cookies = {} - @controller = @request = @response = nil - - self.host = "www.example.com" - self.remote_addr = "127.0.0.1" - self.accept = "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" - - unless @named_routes_configured - # install the named routes in this session instance. - klass = class< "XMLHttpRequest") - post(path, parameters, headers) - end - - # Returns the URL for the given options, according to the rules specified - # in the application's routes. - def url_for(options) - controller ? controller.url_for(options) : generic_url_rewriter.rewrite(options) - end - - private - - class MockCGI < CGI #:nodoc: - attr_accessor :stdinput, :stdoutput, :env_table - - def initialize(env, input=nil) - self.env_table = env - self.stdinput = StringIO.new(input || "") - self.stdoutput = StringIO.new - - super() - end - end - - # Tailors the session based on the given URI, setting the HTTPS value - # and the hostname. - def interpret_uri(path) - location = URI.parse(path) - https! URI::HTTPS === location if location.scheme - host! location.host if location.host - location.query ? "#{location.path}?#{location.query}" : location.path - end - - # Performs the actual request. - def process(method, path, parameters=nil, headers=nil) - data = requestify(parameters) - path = interpret_uri(path) if path =~ %r{://} - path = "/#{path}" unless path[0] == ?/ - @path = path - env = {} - - if method == :get - env["QUERY_STRING"] = data - data = nil - end - - env.update( - "REQUEST_METHOD" => method.to_s.upcase, - "REQUEST_URI" => path, - "HTTP_HOST" => host, - "REMOTE_ADDR" => remote_addr, - "SERVER_PORT" => (https? ? "443" : "80"), - "CONTENT_TYPE" => "application/x-www-form-urlencoded", - "CONTENT_LENGTH" => data ? data.length.to_s : nil, - "HTTP_COOKIE" => encode_cookies, - "HTTPS" => https? ? "on" : "off", - "HTTP_ACCEPT" => accept - ) - - (headers || {}).each do |key, value| - key = key.to_s.upcase.gsub(/-/, "_") - key = "HTTP_#{key}" unless env.has_key?(key) || env =~ /^X|HTTP/ - env[key] = value - end - - unless ActionController::Base.respond_to?(:clear_last_instantiation!) - ActionController::Base.send(:include, ControllerCapture) - end - - ActionController::Base.clear_last_instantiation! - - cgi = MockCGI.new(env, data) - Dispatcher.dispatch(cgi, ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, cgi.stdoutput) - @result = cgi.stdoutput.string - - @controller = ActionController::Base.last_instantiation - @request = @controller.request - @response = @controller.response - - # Decorate the response with the standard behavior of the TestResponse - # so that things like assert_response can be used in integration - # tests. - @response.extend(TestResponseBehavior) - - parse_result - return status - end - - # Parses the result of the response and extracts the various values, - # like cookies, status, headers, etc. - def parse_result - headers, result_body = @result.split(/\r\n\r\n/, 2) - - @headers = Hash.new { |h,k| h[k] = [] } - headers.each_line do |line| - key, value = line.strip.split(/:\s*/, 2) - @headers[key.downcase] << value - end - - (@headers['set-cookie'] || [] ).each do |string| - name, value = string.match(/^(.*?)=(.*?);/)[1,2] - @cookies[name] = value - end - - @status, @status_message = @headers["status"].first.split(/ /) - @status = @status.to_i - end - - # Encode the cookies hash in a format suitable for passing to a - # request. - def encode_cookies - cookies.inject("") do |string, (name, value)| - string << "#{name}=#{value}; " - end - end - - # Get a temporarly URL writer object - def generic_url_rewriter - cgi = MockCGI.new('REQUEST_METHOD' => "GET", - 'QUERY_STRING' => "", - "REQUEST_URI" => "/", - "HTTP_HOST" => host, - "SERVER_PORT" => https? ? "443" : "80", - "HTTPS" => https? ? "on" : "off") - ActionController::UrlRewriter.new(ActionController::CgiRequest.new(cgi), {}) - end - - def name_with_prefix(prefix, name) - prefix ? "#{prefix}[#{name}]" : name.to_s - end - - # Convert the given parameters to a request string. The parameters may - # be a string, +nil+, or a Hash. - def requestify(parameters, prefix=nil) - if Hash === parameters - return nil if parameters.empty? - parameters.map { |k,v| requestify(v, name_with_prefix(prefix, k)) }.join("&") - elsif Array === parameters - parameters.map { |v| requestify(v, name_with_prefix(prefix, "")) }.join("&") - elsif prefix.nil? - parameters - else - "#{CGI.escape(prefix)}=#{CGI.escape(parameters.to_s)}" - end - end - - end - - # A module used to extend ActionController::Base, so that integration tests - # can capture the controller used to satisfy a request. - module ControllerCapture #:nodoc: - def self.included(base) - base.extend(ClassMethods) - base.class_eval do - class < people(:jamis).username, - # :password => people(:jamis).password - # follow_redirect! - # assert_equal 200, status - # assert_equal "/home", path - # end - # end - # - # However, you can also have multiple session instances open per test, and - # even extend those instances with assertions and methods to create a very - # powerful testing DSL that is specific for your application. You can even - # reference any named routes you happen to have defined! - # - # require "#{File.dirname(__FILE__)}/test_helper" - # - # class AdvancedTest < ActionController::IntegrationTest - # fixtures :people, :rooms - # - # def test_login_and_speak - # jamis, david = login(:jamis), login(:david) - # room = rooms(:office) - # - # jamis.enter(room) - # jamis.speak(room, "anybody home?") - # - # david.enter(room) - # david.speak(room, "hello!") - # end - # - # private - # - # module CustomAssertions - # def enter(room) - # # reference a named route, for maximum internal consistency! - # get(room_url(:id => room.id)) - # assert(...) - # ... - # end - # - # def speak(room, message) - # xml_http_request "/say/#{room.id}", :message => message - # assert(...) - # ... - # end - # end - # - # def login(who) - # open_session do |sess| - # sess.extend(CustomAssertions) - # who = people(who) - # sess.post "/login", :username => who.username, - # :password => who.password - # assert(...) - # end - # end - # end - class IntegrationTest < Test::Unit::TestCase - # Work around a bug in test/unit caused by the default test being named - # as a symbol (:default_test), which causes regex test filters - # (like "ruby test.rb -n /foo/") to fail because =~ doesn't work on - # symbols. - def initialize(name) #:nodoc: - super(name.to_s) - end - - # Work around test/unit's requirement that every subclass of TestCase have - # at least one test method. Note that this implementation extends to all - # subclasses, as well, so subclasses of IntegrationTest may also exist - # without any test methods. - def run(*args) #:nodoc: - return if @method_name == "default_test" - super - end - - # Because of how use_instantiated_fixtures and use_transactional_fixtures - # are defined, we need to treat them as special cases. Otherwise, users - # would potentially have to set their values for both Test::Unit::TestCase - # ActionController::IntegrationTest, since by the time the value is set on - # TestCase, IntegrationTest has already been defined and cannot inherit - # changes to those variables. So, we make those two attributes copy-on-write. - - class << self - def use_transactional_fixtures=(flag) #:nodoc: - @_use_transactional_fixtures = true - @use_transactional_fixtures = flag - end - - def use_instantiated_fixtures=(flag) #:nodoc: - @_use_instantiated_fixtures = true - @use_instantiated_fixtures = flag - end - - def use_transactional_fixtures #:nodoc: - @_use_transactional_fixtures ? - @use_transactional_fixtures : - superclass.use_transactional_fixtures - end - - def use_instantiated_fixtures #:nodoc: - @_use_instantiated_fixtures ? - @use_instantiated_fixtures : - superclass.use_instantiated_fixtures - end - end - - # Reset the current session. This is useful for testing multiple sessions - # in a single test case. - def reset! - @integration_session = open_session - end - - %w(get post cookies assigns xml_http_request).each do |method| - define_method(method) do |*args| - reset! unless @integration_session - returning @integration_session.send(method, *args) do - copy_session_variables! - end - end - end - - # Open a new session instance. If a block is given, the new session is - # yielded to the block before being returned. - # - # session = open_session do |sess| - # sess.extend(CustomAssertions) - # end - # - # By default, a single session is automatically created for you, but you - # can use this method to open multiple sessions that ought to be tested - # simultaneously. - def open_session - session = Integration::Session.new - - # delegate the fixture accessors back to the test instance - extras = Module.new { attr_accessor :delegate, :test_result } - self.class.fixture_table_names.each do |table_name| - name = table_name.tr(".", "_") - next unless respond_to?(name) - extras.send(:define_method, name) { |*args| delegate.send(name, *args) } - end - - # delegate add_assertion to the test case - extras.send(:define_method, :add_assertion) { test_result.add_assertion } - session.extend(extras) - session.delegate = self - session.test_result = @_result - - yield session if block_given? - session - end - - # Copy the instance variables from the current session instance into the - # test instance. - def copy_session_variables! #:nodoc: - return unless @integration_session - %w(controller response request).each do |var| - instance_variable_set("@#{var}", @integration_session.send(var)) - end - end - - # Delegate unhandled messages to the current session instance. - def method_missing(sym, *args, &block) - reset! unless @integration_session - returning @integration_session.send(sym, *args, &block) do - copy_session_variables! - end - end - end -end -module ActionController #:nodoc: - module Layout #:nodoc: - def self.included(base) - base.extend(ClassMethods) - base.class_eval do - alias_method :render_with_no_layout, :render - alias_method :render, :render_with_a_layout - - class << self - alias_method :inherited_without_layout, :inherited - alias_method :inherited, :inherited_with_layout - end - end - end - - # Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in - # repeated setups. The inclusion pattern has pages that look like this: - # - # <%= render "shared/header" %> - # Hello World - # <%= render "shared/footer" %> - # - # This approach is a decent way of keeping common structures isolated from the changing content, but it's verbose - # and if you ever want to change the structure of these two includes, you'll have to change all the templates. - # - # With layouts, you can flip it around and have the common structure know where to insert changing content. This means - # that the header and footer are only mentioned in one place, like this: - # - # - # <%= yield %> - # - # - # And then you have content pages that look like this: - # - # hello world - # - # Not a word about common structures. At rendering time, the content page is computed and then inserted in the layout, - # like this: - # - # - # hello world - # - # - # == Accessing shared variables - # - # Layouts have access to variables specified in the content pages and vice versa. This allows you to have layouts with - # references that won't materialize before rendering time: - # - #

    <%= @page_title %>

    - # <%= yield %> - # - # ...and content pages that fulfill these references _at_ rendering time: - # - # <% @page_title = "Welcome" %> - # Off-world colonies offers you a chance to start a new life - # - # The result after rendering is: - # - #

    Welcome

    - # Off-world colonies offers you a chance to start a new life - # - # == Automatic layout assignment - # - # If there is a template in app/views/layouts/ with the same name as the current controller then it will be automatically - # set as that controller's layout unless explicitly told otherwise. Say you have a WeblogController, for example. If a template named - # app/views/layouts/weblog.rhtml or app/views/layouts/weblog.rxml exists then it will be automatically set as - # the layout for your WeblogController. You can create a layout with the name application.rhtml or application.rxml - # and this will be set as the default controller if there is no layout with the same name as the current controller and there is - # no layout explicitly assigned with the +layout+ method. Nested controllers use the same folder structure for automatic layout. - # assignment. So an Admin::WeblogController will look for a template named app/views/layouts/admin/weblog.rhtml. - # Setting a layout explicitly will always override the automatic behaviour for the controller where the layout is set. - # Explicitly setting the layout in a parent class, though, will not override the child class's layout assignement if the child - # class has a layout with the same name. - # - # == Inheritance for layouts - # - # Layouts are shared downwards in the inheritance hierarchy, but not upwards. Examples: - # - # class BankController < ActionController::Base - # layout "bank_standard" - # - # class InformationController < BankController - # - # class VaultController < BankController - # layout :access_level_layout - # - # class EmployeeController < BankController - # layout nil - # - # The InformationController uses "bank_standard" inherited from the BankController, the VaultController overwrites - # and picks the layout dynamically, and the EmployeeController doesn't want to use a layout at all. - # - # == Types of layouts - # - # Layouts are basically just regular templates, but the name of this template needs not be specified statically. Sometimes - # you want to alternate layouts depending on runtime information, such as whether someone is logged in or not. This can - # be done either by specifying a method reference as a symbol or using an inline method (as a proc). - # - # The method reference is the preferred approach to variable layouts and is used like this: - # - # class WeblogController < ActionController::Base - # layout :writers_and_readers - # - # def index - # # fetching posts - # end - # - # private - # def writers_and_readers - # logged_in? ? "writer_layout" : "reader_layout" - # end - # - # Now when a new request for the index action is processed, the layout will vary depending on whether the person accessing - # is logged in or not. - # - # If you want to use an inline method, such as a proc, do something like this: - # - # class WeblogController < ActionController::Base - # layout proc{ |controller| controller.logged_in? ? "writer_layout" : "reader_layout" } - # - # Of course, the most common way of specifying a layout is still just as a plain template name: - # - # class WeblogController < ActionController::Base - # layout "weblog_standard" - # - # If no directory is specified for the template name, the template will by default by looked for in +app/views/layouts/+. - # - # == Conditional layouts - # - # If you have a layout that by default is applied to all the actions of a controller, you still have the option of rendering - # a given action or set of actions without a layout, or restricting a layout to only a single action or a set of actions. The - # :only and :except options can be passed to the layout call. For example: - # - # class WeblogController < ActionController::Base - # layout "weblog_standard", :except => :rss - # - # # ... - # - # end - # - # This will assign "weblog_standard" as the WeblogController's layout except for the +rss+ action, which will not wrap a layout - # around the rendered view. - # - # Both the :only and :except condition can accept an arbitrary number of method references, so - # #:except => [ :rss, :text_only ] is valid, as is :except => :rss. - # - # == Using a different layout in the action render call - # - # If most of your actions use the same layout, it makes perfect sense to define a controller-wide layout as described above. - # Some times you'll have exceptions, though, where one action wants to use a different layout than the rest of the controller. - # This is possible using the render method. It's just a bit more manual work as you'll have to supply fully - # qualified template and layout names as this example shows: - # - # class WeblogController < ActionController::Base - # def help - # render :action => "help/index", :layout => "help" - # end - # end - # - # As you can see, you pass the template as the first parameter, the status code as the second ("200" is OK), and the layout - # as the third. - # - # NOTE: The old notation for rendering the view from a layout was to expose the magic @content_for_layout instance - # variable. The preferred notation now is to use yield, as documented above. - module ClassMethods - # If a layout is specified, all rendered actions will have their result rendered - # when the layoutyield's. This layout can itself depend on instance variables assigned during action - # performance and have access to them as any normal template would. - def layout(template_name, conditions = {}) - add_layout_conditions(conditions) - write_inheritable_attribute "layout", template_name - end - - def layout_conditions #:nodoc: - @layout_conditions ||= read_inheritable_attribute("layout_conditions") - end - - def default_layout #:nodoc: - @default_layout ||= read_inheritable_attribute("layout") - end - - private - def inherited_with_layout(child) - inherited_without_layout(child) - child.send :include, Reloadable - layout_match = child.name.underscore.sub(/_controller$/, '').sub(/^controllers\//, '') - child.layout(layout_match) unless layout_list.grep(%r{layouts/#{layout_match}\.[a-z][0-9a-z]*$}).empty? - end - - def layout_list - Dir.glob("#{template_root}/layouts/**/*") - end - - def add_layout_conditions(conditions) - write_inheritable_hash "layout_conditions", normalize_conditions(conditions) - end - - def normalize_conditions(conditions) - conditions.inject({}) {|hash, (key, value)| hash.merge(key => [value].flatten.map {|action| action.to_s})} - end - - def layout_directory_exists_cache - @@layout_directory_exists_cache ||= Hash.new do |h, dirname| - h[dirname] = File.directory? dirname - end - end - end - - # Returns the name of the active layout. If the layout was specified as a method reference (through a symbol), this method - # is called and the return value is used. Likewise if the layout was specified as an inline method (through a proc or method - # object). If the layout was defined without a directory, layouts is assumed. So layout "weblog/standard" will return - # weblog/standard, but layout "standard" will return layouts/standard. - def active_layout(passed_layout = nil) - layout = passed_layout || self.class.default_layout - - active_layout = case layout - when String then layout - when Symbol then send(layout) - when Proc then layout.call(self) - end - - # Explicitly passed layout names with slashes are looked up relative to the template root, - # but auto-discovered layouts derived from a nested controller will contain a slash, though be relative - # to the 'layouts' directory so we have to check the file system to infer which case the layout name came from. - if active_layout - if active_layout.include?('/') && ! layout_directory?(active_layout) - active_layout - else - "layouts/#{active_layout}" - end - end - end - - def render_with_a_layout(options = nil, deprecated_status = nil, deprecated_layout = nil, &block) #:nodoc: - template_with_options = options.is_a?(Hash) - - if apply_layout?(template_with_options, options) && (layout = pick_layout(template_with_options, options, deprecated_layout)) - options = options.merge :layout => false if template_with_options - logger.info("Rendering #{options} within #{layout}") if logger - - if template_with_options - content_for_layout = render_with_no_layout(options, &block) - deprecated_status = options[:status] || deprecated_status - else - content_for_layout = render_with_no_layout(options, deprecated_status, &block) - end - - erase_render_results - add_variables_to_assigns - @template.instance_variable_set("@content_for_layout", content_for_layout) - render_text(@template.render_file(layout, true), deprecated_status) - else - render_with_no_layout(options, deprecated_status, &block) - end - end - - private - - def apply_layout?(template_with_options, options) - return false if options == :update - template_with_options ? candidate_for_layout?(options) : !template_exempt_from_layout? - end - - def candidate_for_layout?(options) - (options.has_key?(:layout) && options[:layout] != false) || - options.values_at(:text, :xml, :file, :inline, :partial, :nothing).compact.empty? && - !template_exempt_from_layout?(default_template_name(options[:action] || options[:template])) - end - - def pick_layout(template_with_options, options, deprecated_layout) - if deprecated_layout - deprecated_layout - elsif template_with_options - case layout = options[:layout] - when FalseClass - nil - when NilClass, TrueClass - active_layout if action_has_layout? - else - active_layout(layout) - end - else - active_layout if action_has_layout? - end - end - - def action_has_layout? - if conditions = self.class.layout_conditions - case - when only = conditions[:only] - only.include?(action_name) - when except = conditions[:except] - !except.include?(action_name) - else - true - end - else - true - end - end - - # Does a layout directory for this class exist? - # we cache this info in a class level hash - def layout_directory?(layout_name) - template_path = File.join(self.class.view_root, 'layouts', layout_name) - dirname = File.dirname(template_path) - self.class.send(:layout_directory_exists_cache)[dirname] - end - end -end -module ActionController - # Macros are class-level calls that add pre-defined actions to the controller based on the parameters passed in. - # Currently, they're used to bridge the JavaScript macros, like autocompletion and in-place editing, with the controller - # backing. - module Macros - module AutoComplete #:nodoc: - def self.append_features(base) #:nodoc: - super - base.extend(ClassMethods) - end - - # Example: - # - # # Controller - # class BlogController < ApplicationController - # auto_complete_for :post, :title - # end - # - # # View - # <%= text_field_with_auto_complete :post, title %> - # - # By default, auto_complete_for limits the results to 10 entries, - # and sorts by the given field. - # - # auto_complete_for takes a third parameter, an options hash to - # the find method used to search for the records: - # - # auto_complete_for :post, :title, :limit => 15, :order => 'created_at DESC' - # - # For help on defining text input fields with autocompletion, - # see ActionView::Helpers::JavaScriptHelper. - # - # For more examples, see script.aculo.us: - # * http://script.aculo.us/demos/ajax/autocompleter - # * http://script.aculo.us/demos/ajax/autocompleter_customized - module ClassMethods - def auto_complete_for(object, method, options = {}) - define_method("auto_complete_for_#{object}_#{method}") do - find_options = { - :conditions => [ "LOWER(#{method}) LIKE ?", '%' + params[object][method].downcase + '%' ], - :order => "#{method} ASC", - :limit => 10 }.merge!(options) - - @items = object.to_s.camelize.constantize.find(:all, find_options) - - render :inline => "<%= auto_complete_result @items, '#{method}' %>" - end - end - end - end - end -endmodule ActionController - module Macros - module InPlaceEditing #:nodoc: - def self.append_features(base) #:nodoc: - super - base.extend(ClassMethods) - end - - # Example: - # - # # Controller - # class BlogController < ApplicationController - # in_place_edit_for :post, :title - # end - # - # # View - # <%= in_place_editor_field :post, 'title' %> - # - # For help on defining an in place editor in the browser, - # see ActionView::Helpers::JavaScriptHelper. - module ClassMethods - def in_place_edit_for(object, attribute, options = {}) - define_method("set_#{object}_#{attribute}") do - @item = object.to_s.camelize.constantize.find(params[:id]) - @item.update_attribute(attribute, params[:value]) - render :text => @item.send(attribute) - end - end - end - end - end -end -module ActionController #:nodoc: - module MimeResponds #:nodoc: - def self.included(base) - base.send(:include, ActionController::MimeResponds::InstanceMethods) - end - - module InstanceMethods - # Without web-service support, an action which collects the data for displaying a list of people - # might look something like this: - # - # def list - # @people = Person.find(:all) - # end - # - # Here's the same action, with web-service support baked in: - # - # def list - # @people = Person.find(:all) - # - # respond_to do |wants| - # wants.html - # wants.xml { render :xml => @people.to_xml } - # end - # end - # - # What that says is, "if the client wants HTML in response to this action, just respond as we - # would have before, but if the client wants XML, return them the list of people in XML format." - # (Rails determines the desired response format from the HTTP Accept header submitted by the client.) - # - # Supposing you have an action that adds a new person, optionally creating their company - # (by name) if it does not already exist, without web-services, it might look like this: - # - # def add - # @company = Company.find_or_create_by_name(params[:company][:name]) - # @person = @company.people.create(params[:person]) - # - # redirect_to(person_list_url) - # end - # - # Here's the same action, with web-service support baked in: - # - # def add - # company = params[:person].delete(:company) - # @company = Company.find_or_create_by_name(company[:name]) - # @person = @company.people.create(params[:person]) - # - # respond_to do |wants| - # wants.html { redirect_to(person_list_url) } - # wants.js - # wants.xml { render :xml => @person.to_xml(:include => @company) } - # end - # end - # - # If the client wants HTML, we just redirect them back to the person list. If they want Javascript - # (wants.js), then it is an RJS request and we render the RJS template associated with this action. - # Lastly, if the client wants XML, we render the created person as XML, but with a twist: we also - # include the person’s company in the rendered XML, so you get something like this: - # - # - # ... - # ... - # - # ... - # ... - # ... - # - # - # - # Note, however, the extra bit at the top of that action: - # - # company = params[:person].delete(:company) - # @company = Company.find_or_create_by_name(company[:name]) - # - # This is because the incoming XML document (if a web-service request is in process) can only contain a - # single root-node. So, we have to rearrange things so that the request looks like this (url-encoded): - # - # person[name]=...&person[company][name]=...&... - # - # And, like this (xml-encoded): - # - # - # ... - # - # ... - # - # - # - # In other words, we make the request so that it operates on a single entity—a person. Then, in the action, - # we extract the company data from the request, find or create the company, and then create the new person - # with the remaining data. - # - # Note that you can define your own XML parameter parser which would allow you to describe multiple entities - # in a single request (i.e., by wrapping them all in a single root note), but if you just go with the flow - # and accept Rails' defaults, life will be much easier. - # - # If you need to use a MIME type which isn't supported by default, you can register your own handlers in - # environment.rb as follows. - # - # Mime::Type.register "image/jpg", :jpg - # - def respond_to(*types, &block) - raise ArgumentError, "respond_to takes either types or a block, never bot" unless types.any? ^ block - block ||= lambda { |responder| types.each { |type| responder.send(type) } } - responder = Responder.new(block.binding) - block.call(responder) - responder.respond - end - end - - class Responder #:nodoc: - DEFAULT_BLOCKS = { - :html => 'Proc.new { render }', - :js => 'Proc.new { render :action => "#{action_name}.rjs" }', - :xml => 'Proc.new { render :action => "#{action_name}.rxml" }' - } - - def initialize(block_binding) - @block_binding = block_binding - @mime_type_priority = eval("request.accepts", block_binding) - @order = [] - @responses = {} - end - - def custom(mime_type, &block) - mime_type = mime_type.is_a?(Mime::Type) ? mime_type : Mime::Type.lookup(mime_type.to_s) - - @order << mime_type - - if block_given? - @responses[mime_type] = block - else - @responses[mime_type] = eval(DEFAULT_BLOCKS[mime_type.to_sym], @block_binding) - end - end - - for mime_type in %w( all html js xml rss atom yaml ) - eval <<-EOT - def #{mime_type}(&block) - custom(Mime::#{mime_type.upcase}, &block) - end - EOT - end - - def any(*args, &block) - args.each { |type| send(type, &block) } - end - - def respond - for priority in @mime_type_priority - if priority == Mime::ALL - @responses[@order.first].call - return - else - if priority === @order - @responses[priority].call - return # mime type match found, be happy and return - end - end - end - - if @order.include?(Mime::ALL) - @responses[Mime::ALL].call - else - eval 'render(:nothing => true, :status => "406 Not Acceptable")', @block_binding - end - end - end - end -end -module Mime - class Type #:nodoc: - # A simple helper class used in parsing the accept header - class AcceptItem #:nodoc: - attr_accessor :order, :name, :q - - def initialize(order, name, q=nil) - @order = order - @name = name.strip - q ||= 0.0 if @name == "*/*" # default "*/*" to end of list - @q = ((q || 1.0).to_f * 100).to_i - end - - def to_s - @name - end - - def <=>(item) - result = item.q <=> q - result = order <=> item.order if result == 0 - result - end - - def ==(item) - name == (item.respond_to?(:name) ? item.name : item) - end - end - - class << self - def lookup(string) - LOOKUP[string] - end - - def parse(accept_header) - # keep track of creation order to keep the subsequent sort stable - index = 0 - list = accept_header.split(/,/). - map! { |i| AcceptItem.new(index += 1, *i.split(/;\s*q=/)) }.sort! - - # Take care of the broken text/xml entry by renaming or deleting it - - text_xml = list.index("text/xml") - app_xml = list.index("application/xml") - - if text_xml && app_xml - # set the q value to the max of the two - list[app_xml].q = [list[text_xml].q, list[app_xml].q].max - - # make sure app_xml is ahead of text_xml in the list - if app_xml > text_xml - list[app_xml], list[text_xml] = list[text_xml], list[app_xml] - app_xml, text_xml = text_xml, app_xml - end - - # delete text_xml from the list - list.delete_at(text_xml) - - elsif text_xml - list[text_xml].name = "application/xml" - end - - # Look for more specific xml-based types and sort them ahead of app/xml - - if app_xml - idx = app_xml - app_xml_type = list[app_xml] - - while(idx < list.length) - type = list[idx] - break if type.q < app_xml_type.q - if type.name =~ /\+xml$/ - list[app_xml], list[idx] = list[idx], list[app_xml] - app_xml = idx - end - idx += 1 - end - end - - list.map! { |i| Mime::Type.lookup(i.name) }.uniq! - list - end - end - - def initialize(string, symbol = nil, synonyms = []) - @symbol, @synonyms = symbol, synonyms - @string = string - end - - def to_s - @string - end - - def to_str - to_s - end - - def to_sym - @symbol || @string.to_sym - end - - def ===(list) - if list.is_a?(Array) - (@synonyms + [ self ]).any? { |synonym| list.include?(synonym) } - else - super - end - end - - def ==(mime_type) - (@synonyms + [ self ]).any? { |synonym| synonym.to_s == mime_type.to_s } if mime_type - end - end - - ALL = Type.new "*/*", :all - HTML = Type.new "text/html", :html, %w( application/xhtml+xml ) - JS = Type.new "text/javascript", :js, %w( application/javascript application/x-javascript ) - XML = Type.new "application/xml", :xml, %w( text/xml application/x-xml ) - RSS = Type.new "application/rss+xml", :rss - ATOM = Type.new "application/atom+xml", :atom - YAML = Type.new "application/x-yaml", :yaml, %w( text/yaml ) - - LOOKUP = Hash.new { |h, k| h[k] = Type.new(k) } - - LOOKUP["*/*"] = ALL - - LOOKUP["text/html"] = HTML - LOOKUP["application/xhtml+xml"] = HTML - - LOOKUP["application/xml"] = XML - LOOKUP["text/xml"] = XML - LOOKUP["application/x-xml"] = XML - - LOOKUP["text/javascript"] = JS - LOOKUP["application/javascript"] = JS - LOOKUP["application/x-javascript"] = JS - - LOOKUP["text/yaml"] = YAML - LOOKUP["application/x-yaml"] = YAML - - LOOKUP["application/rss+xml"] = RSS - LOOKUP["application/atom+xml"] = ATOM -endmodule ActionController - # === Action Pack pagination for Active Record collections - # - # The Pagination module aids in the process of paging large collections of - # Active Record objects. It offers macro-style automatic fetching of your - # model for multiple views, or explicit fetching for single actions. And if - # the magic isn't flexible enough for your needs, you can create your own - # paginators with a minimal amount of code. - # - # The Pagination module can handle as much or as little as you wish. In the - # controller, have it automatically query your model for pagination; or, - # if you prefer, create Paginator objects yourself. - # - # Pagination is included automatically for all controllers. - # - # For help rendering pagination links, see - # ActionView::Helpers::PaginationHelper. - # - # ==== Automatic pagination for every action in a controller - # - # class PersonController < ApplicationController - # model :person - # - # paginate :people, :order => 'last_name, first_name', - # :per_page => 20 - # - # # ... - # end - # - # Each action in this controller now has access to a @people - # instance variable, which is an ordered collection of model objects for the - # current page (at most 20, sorted by last name and first name), and a - # @person_pages Paginator instance. The current page is determined - # by the params[:page] variable. - # - # ==== Pagination for a single action - # - # def list - # @person_pages, @people = - # paginate :people, :order => 'last_name, first_name' - # end - # - # Like the previous example, but explicitly creates @person_pages - # and @people for a single action, and uses the default of 10 items - # per page. - # - # ==== Custom/"classic" pagination - # - # def list - # @person_pages = Paginator.new self, Person.count, 10, params[:page] - # @people = Person.find :all, :order => 'last_name, first_name', - # :limit => @person_pages.items_per_page, - # :offset => @person_pages.current.offset - # end - # - # Explicitly creates the paginator from the previous example and uses - # Paginator#to_sql to retrieve @people from the model. - # - module Pagination - unless const_defined?(:OPTIONS) - # A hash holding options for controllers using macro-style pagination - OPTIONS = Hash.new - - # The default options for pagination - DEFAULT_OPTIONS = { - :class_name => nil, - :singular_name => nil, - :per_page => 10, - :conditions => nil, - :order_by => nil, - :order => nil, - :join => nil, - :joins => nil, - :count => nil, - :include => nil, - :select => nil, - :parameter => 'page' - } - end - - def self.included(base) #:nodoc: - super - base.extend(ClassMethods) - end - - def self.validate_options!(collection_id, options, in_action) #:nodoc: - options.merge!(DEFAULT_OPTIONS) {|key, old, new| old} - - valid_options = DEFAULT_OPTIONS.keys - valid_options << :actions unless in_action - - unknown_option_keys = options.keys - valid_options - raise ActionController::ActionControllerError, - "Unknown options: #{unknown_option_keys.join(', ')}" unless - unknown_option_keys.empty? - - options[:singular_name] ||= Inflector.singularize(collection_id.to_s) - options[:class_name] ||= Inflector.camelize(options[:singular_name]) - end - - # Returns a paginator and a collection of Active Record model instances - # for the paginator's current page. This is designed to be used in a - # single action; to automatically paginate multiple actions, consider - # ClassMethods#paginate. - # - # +options+ are: - # :singular_name:: the singular name to use, if it can't be inferred by - # singularizing the collection name - # :class_name:: the class name to use, if it can't be inferred by - # camelizing the singular name - # :per_page:: the maximum number of items to include in a - # single page. Defaults to 10 - # :conditions:: optional conditions passed to Model.find(:all, *params) and - # Model.count - # :order:: optional order parameter passed to Model.find(:all, *params) - # :order_by:: (deprecated, used :order) optional order parameter passed to Model.find(:all, *params) - # :joins:: optional joins parameter passed to Model.find(:all, *params) - # and Model.count - # :join:: (deprecated, used :joins or :include) optional join parameter passed to Model.find(:all, *params) - # and Model.count - # :include:: optional eager loading parameter passed to Model.find(:all, *params) - # and Model.count - # :select:: :select parameter passed to Model.find(:all, *params) - # - # :count:: parameter passed as :select option to Model.count(*params) - # - def paginate(collection_id, options={}) - Pagination.validate_options!(collection_id, options, true) - paginator_and_collection_for(collection_id, options) - end - - # These methods become class methods on any controller - module ClassMethods - # Creates a +before_filter+ which automatically paginates an Active - # Record model for all actions in a controller (or certain actions if - # specified with the :actions option). - # - # +options+ are the same as PaginationHelper#paginate, with the addition - # of: - # :actions:: an array of actions for which the pagination is - # active. Defaults to +nil+ (i.e., every action) - def paginate(collection_id, options={}) - Pagination.validate_options!(collection_id, options, false) - module_eval do - before_filter :create_paginators_and_retrieve_collections - OPTIONS[self] ||= Hash.new - OPTIONS[self][collection_id] = options - end - end - end - - def create_paginators_and_retrieve_collections #:nodoc: - Pagination::OPTIONS[self.class].each do |collection_id, options| - next unless options[:actions].include? action_name if - options[:actions] - - paginator, collection = - paginator_and_collection_for(collection_id, options) - - paginator_name = "@#{options[:singular_name]}_pages" - self.instance_variable_set(paginator_name, paginator) - - collection_name = "@#{collection_id.to_s}" - self.instance_variable_set(collection_name, collection) - end - end - - # Returns the total number of items in the collection to be paginated for - # the +model+ and given +conditions+. Override this method to implement a - # custom counter. - def count_collection_for_pagination(model, options) - model.count(:conditions => options[:conditions], - :joins => options[:join] || options[:joins], - :include => options[:include], - :select => options[:count]) - end - - # Returns a collection of items for the given +model+ and +options[conditions]+, - # ordered by +options[order]+, for the current page in the given +paginator+. - # Override this method to implement a custom finder. - def find_collection_for_pagination(model, options, paginator) - model.find(:all, :conditions => options[:conditions], - :order => options[:order_by] || options[:order], - :joins => options[:join] || options[:joins], :include => options[:include], - :select => options[:select], :limit => options[:per_page], - :offset => paginator.current.offset) - end - - protected :create_paginators_and_retrieve_collections, - :count_collection_for_pagination, - :find_collection_for_pagination - - def paginator_and_collection_for(collection_id, options) #:nodoc: - klass = options[:class_name].constantize - page = @params[options[:parameter]] - count = count_collection_for_pagination(klass, options) - paginator = Paginator.new(self, count, options[:per_page], page) - collection = find_collection_for_pagination(klass, options, paginator) - - return paginator, collection - end - - private :paginator_and_collection_for - - # A class representing a paginator for an Active Record collection. - class Paginator - include Enumerable - - # Creates a new Paginator on the given +controller+ for a set of items - # of size +item_count+ and having +items_per_page+ items per page. - # Raises ArgumentError if items_per_page is out of bounds (i.e., less - # than or equal to zero). The page CGI parameter for links defaults to - # "page" and can be overridden with +page_parameter+. - def initialize(controller, item_count, items_per_page, current_page=1) - raise ArgumentError, 'must have at least one item per page' if - items_per_page <= 0 - - @controller = controller - @item_count = item_count || 0 - @items_per_page = items_per_page - @pages = {} - - self.current_page = current_page - end - attr_reader :controller, :item_count, :items_per_page - - # Sets the current page number of this paginator. If +page+ is a Page - # object, its +number+ attribute is used as the value; if the page does - # not belong to this Paginator, an ArgumentError is raised. - def current_page=(page) - if page.is_a? Page - raise ArgumentError, 'Page/Paginator mismatch' unless - page.paginator == self - end - page = page.to_i - @current_page_number = has_page_number?(page) ? page : 1 - end - - # Returns a Page object representing this paginator's current page. - def current_page - @current_page ||= self[@current_page_number] - end - alias current :current_page - - # Returns a new Page representing the first page in this paginator. - def first_page - @first_page ||= self[1] - end - alias first :first_page - - # Returns a new Page representing the last page in this paginator. - def last_page - @last_page ||= self[page_count] - end - alias last :last_page - - # Returns the number of pages in this paginator. - def page_count - @page_count ||= @item_count.zero? ? 1 : - (q,r=@item_count.divmod(@items_per_page); r==0? q : q+1) - end - - alias length :page_count - - # Returns true if this paginator contains the page of index +number+. - def has_page_number?(number) - number >= 1 and number <= page_count - end - - # Returns a new Page representing the page with the given index - # +number+. - def [](number) - @pages[number] ||= Page.new(self, number) - end - - # Successively yields all the paginator's pages to the given block. - def each(&block) - page_count.times do |n| - yield self[n+1] - end - end - - # A class representing a single page in a paginator. - class Page - include Comparable - - # Creates a new Page for the given +paginator+ with the index - # +number+. If +number+ is not in the range of valid page numbers or - # is not a number at all, it defaults to 1. - def initialize(paginator, number) - @paginator = paginator - @number = number.to_i - @number = 1 unless @paginator.has_page_number? @number - end - attr_reader :paginator, :number - alias to_i :number - - # Compares two Page objects and returns true when they represent the - # same page (i.e., their paginators are the same and they have the - # same page number). - def ==(page) - return false if page.nil? - @paginator == page.paginator and - @number == page.number - end - - # Compares two Page objects and returns -1 if the left-hand page comes - # before the right-hand page, 0 if the pages are equal, and 1 if the - # left-hand page comes after the right-hand page. Raises ArgumentError - # if the pages do not belong to the same Paginator object. - def <=>(page) - raise ArgumentError unless @paginator == page.paginator - @number <=> page.number - end - - # Returns the item offset for the first item in this page. - def offset - @paginator.items_per_page * (@number - 1) - end - - # Returns the number of the first item displayed. - def first_item - offset + 1 - end - - # Returns the number of the last item displayed. - def last_item - [@paginator.items_per_page * @number, @paginator.item_count].min - end - - # Returns true if this page is the first page in the paginator. - def first? - self == @paginator.first - end - - # Returns true if this page is the last page in the paginator. - def last? - self == @paginator.last - end - - # Returns a new Page object representing the page just before this - # page, or nil if this is the first page. - def previous - if first? then nil else @paginator[@number - 1] end - end - - # Returns a new Page object representing the page just after this - # page, or nil if this is the last page. - def next - if last? then nil else @paginator[@number + 1] end - end - - # Returns a new Window object for this page with the specified - # +padding+. - def window(padding=2) - Window.new(self, padding) - end - - # Returns the limit/offset array for this page. - def to_sql - [@paginator.items_per_page, offset] - end - - def to_param #:nodoc: - @number.to_s - end - end - - # A class for representing ranges around a given page. - class Window - # Creates a new Window object for the given +page+ with the specified - # +padding+. - def initialize(page, padding=2) - @paginator = page.paginator - @page = page - self.padding = padding - end - attr_reader :paginator, :page - - # Sets the window's padding (the number of pages on either side of the - # window page). - def padding=(padding) - @padding = padding < 0 ? 0 : padding - # Find the beginning and end pages of the window - @first = @paginator.has_page_number?(@page.number - @padding) ? - @paginator[@page.number - @padding] : @paginator.first - @last = @paginator.has_page_number?(@page.number + @padding) ? - @paginator[@page.number + @padding] : @paginator.last - end - attr_reader :padding, :first, :last - - # Returns an array of Page objects in the current window. - def pages - (@first.number..@last.number).to_a.collect! {|n| @paginator[n]} - end - alias to_a :pages - end - end - - end -end -module ActionController - # Subclassing AbstractRequest makes these methods available to the request objects used in production and testing, - # CgiRequest and TestRequest - class AbstractRequest - cattr_accessor :relative_url_root - - # Returns the hash of environment variables for this request, - # such as { 'RAILS_ENV' => 'production' }. - attr_reader :env - - # Returns both GET and POST parameters in a single hash. - def parameters - @parameters ||= request_parameters.update(query_parameters).update(path_parameters).with_indifferent_access - end - - # Returns the HTTP request method as a lowercase symbol (:get, for example) - def method - @request_method ||= @env['REQUEST_METHOD'].downcase.to_sym - end - - # Is this a GET request? Equivalent to request.method == :get - def get? - method == :get - end - - # Is this a POST request? Equivalent to request.method == :post - def post? - method == :post - end - - # Is this a PUT request? Equivalent to request.method == :put - def put? - method == :put - end - - # Is this a DELETE request? Equivalent to request.method == :delete - def delete? - method == :delete - end - - # Is this a HEAD request? Equivalent to request.method == :head - def head? - method == :head - end - - # Determine whether the body of a HTTP call is URL-encoded (default) - # or matches one of the registered param_parsers. - # - # For backward compatibility, the post format is extracted from the - # X-Post-Data-Format HTTP header if present. - def content_type - @content_type ||= - begin - content_type = @env['CONTENT_TYPE'].to_s.downcase - - if x_post_format = @env['HTTP_X_POST_DATA_FORMAT'] - case x_post_format.to_s.downcase - when 'yaml' - content_type = 'application/x-yaml' - when 'xml' - content_type = 'application/xml' - end - end - - Mime::Type.lookup(content_type) - end - end - - # Returns the accepted MIME type for the request - def accepts - @accepts ||= - if @env['HTTP_ACCEPT'].to_s.strip.empty? - [ content_type, Mime::ALL ] - else - Mime::Type.parse(@env['HTTP_ACCEPT']) - end - end - - # Returns true if the request's "X-Requested-With" header contains - # "XMLHttpRequest". (The Prototype Javascript library sends this header with - # every Ajax request.) - def xml_http_request? - not /XMLHttpRequest/i.match(@env['HTTP_X_REQUESTED_WITH']).nil? - end - alias xhr? :xml_http_request? - - # Determine originating IP address. REMOTE_ADDR is the standard - # but will fail if the user is behind a proxy. HTTP_CLIENT_IP and/or - # HTTP_X_FORWARDED_FOR are set by proxies so check for these before - # falling back to REMOTE_ADDR. HTTP_X_FORWARDED_FOR may be a comma- - # delimited list in the case of multiple chained proxies; the first is - # the originating IP. - def remote_ip - return @env['HTTP_CLIENT_IP'] if @env.include? 'HTTP_CLIENT_IP' - - if @env.include? 'HTTP_X_FORWARDED_FOR' then - remote_ips = @env['HTTP_X_FORWARDED_FOR'].split(',').reject do |ip| - ip =~ /^unknown$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\./i - end - - return remote_ips.first.strip unless remote_ips.empty? - end - - @env['REMOTE_ADDR'] - end - - # Returns the domain part of a host, such as rubyonrails.org in "www.rubyonrails.org". You can specify - # a different tld_length, such as 2 to catch rubyonrails.co.uk in "www.rubyonrails.co.uk". - def domain(tld_length = 1) - return nil if !/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/.match(host).nil? or host.nil? - - host.split('.').last(1 + tld_length).join('.') - end - - # Returns all the subdomains as an array, so ["dev", "www"] would be returned for "dev.www.rubyonrails.org". - # You can specify a different tld_length, such as 2 to catch ["www"] instead of ["www", "rubyonrails"] - # in "www.rubyonrails.co.uk". - def subdomains(tld_length = 1) - return [] unless host - parts = host.split('.') - parts[0..-(tld_length+2)] - end - - # Receive the raw post data. - # This is useful for services such as REST, XMLRPC and SOAP - # which communicate over HTTP POST but don't use the traditional parameter format. - def raw_post - @env['RAW_POST_DATA'] - end - - # Returns the request URI correctly, taking into account the idiosyncracies - # of the various servers. - def request_uri - if uri = @env['REQUEST_URI'] - (%r{^\w+\://[^/]+(/.*|$)$} =~ uri) ? $1 : uri # Remove domain, which webrick puts into the request_uri. - else # REQUEST_URI is blank under IIS - get this from PATH_INFO and SCRIPT_NAME - script_filename = @env['SCRIPT_NAME'].to_s.match(%r{[^/]+$}) - uri = @env['PATH_INFO'] - uri = uri.sub(/#{script_filename}\//, '') unless script_filename.nil? - unless (env_qs = @env['QUERY_STRING']).nil? || env_qs.empty? - uri << '?' << env_qs - end - uri - end - end - - # Return 'https://' if this is an SSL request and 'http://' otherwise. - def protocol - ssl? ? 'https://' : 'http://' - end - - # Is this an SSL request? - def ssl? - @env['HTTPS'] == 'on' || @env['HTTP_X_FORWARDED_PROTO'] == 'https' - end - - # Returns the interpreted path to requested resource after all the installation directory of this application was taken into account - def path - path = (uri = request_uri) ? uri.split('?').first : '' - - # Cut off the path to the installation directory if given - root = relative_url_root - path[0, root.length] = '' if root - path || '' - end - - # Returns the path minus the web server relative installation directory. - # This can be set with the environment variable RAILS_RELATIVE_URL_ROOT. - # It can be automatically extracted for Apache setups. If the server is not - # Apache, this method returns an empty string. - def relative_url_root - @@relative_url_root ||= case - when @env["RAILS_RELATIVE_URL_ROOT"] - @env["RAILS_RELATIVE_URL_ROOT"] - when server_software == 'apache' - @env["SCRIPT_NAME"].to_s.sub(/\/dispatch\.(fcgi|rb|cgi)$/, '') - else - '' - end - end - - # Returns the port number of this request as an integer. - def port - @port_as_int ||= @env['SERVER_PORT'].to_i - end - - # Returns the standard port number for this request's protocol - def standard_port - case protocol - when 'https://' then 443 - else 80 - end - end - - # Returns a port suffix like ":8080" if the port number of this request - # is not the default HTTP port 80 or HTTPS port 443. - def port_string - (port == standard_port) ? '' : ":#{port}" - end - - # Returns a host:port string for this request, such as example.com or - # example.com:8080. - def host_with_port - host + port_string - end - - def path_parameters=(parameters) #:nodoc: - @path_parameters = parameters - @symbolized_path_parameters = @parameters = nil - end - - # The same as path_parameters with explicitly symbolized keys - def symbolized_path_parameters - @symbolized_path_parameters ||= path_parameters.symbolize_keys - end - - # Returns a hash with the parameters used to form the path of the request - # - # Example: - # - # {:action => 'my_action', :controller => 'my_controller'} - def path_parameters - @path_parameters ||= {} - end - - # Returns the lowercase name of the HTTP server software. - def server_software - (@env['SERVER_SOFTWARE'] && /^([a-zA-Z]+)/ =~ @env['SERVER_SOFTWARE']) ? $1.downcase : nil - end - - #-- - # Must be implemented in the concrete request - #++ - def query_parameters #:nodoc: - end - - def request_parameters #:nodoc: - end - - # Returns the host for this request, such as example.com. - def host - end - - def cookies #:nodoc: - end - - def session #:nodoc: - end - - def session=(session) #:nodoc: - @session = session - end - - def reset_session #:nodoc: - end - end -end -module ActionController #:nodoc: - # Actions that fail to perform as expected throw exceptions. These exceptions can either be rescued for the public view - # (with a nice user-friendly explanation) or for the developers view (with tons of debugging information). The developers view - # is already implemented by the Action Controller, but the public view should be tailored to your specific application. So too - # could the decision on whether something is a public or a developer request. - # - # You can tailor the rescuing behavior and appearance by overwriting the following two stub methods. - module Rescue - def self.append_features(base) #:nodoc: - super - base.extend(ClassMethods) - base.class_eval do - alias_method :perform_action_without_rescue, :perform_action - alias_method :perform_action, :perform_action_with_rescue - end - end - - module ClassMethods #:nodoc: - def process_with_exception(request, response, exception) - new.process(request, response, :rescue_action, exception) - end - end - - protected - # Exception handler called when the performance of an action raises an exception. - def rescue_action(exception) - log_error(exception) if logger - erase_results if performed? - - if consider_all_requests_local || local_request? - rescue_action_locally(exception) - else - rescue_action_in_public(exception) - end - end - - # Overwrite to implement custom logging of errors. By default logs as fatal. - def log_error(exception) #:doc: - if ActionView::TemplateError === exception - logger.fatal(exception.to_s) - else - logger.fatal( - "\n\n#{exception.class} (#{exception.message}):\n " + - clean_backtrace(exception).join("\n ") + - "\n\n" - ) - end - end - - # Overwrite to implement public exception handling (for requests answering false to local_request?). - def rescue_action_in_public(exception) #:doc: - case exception - when RoutingError, UnknownAction then - render_text(IO.read(File.join(RAILS_ROOT, 'public', '404.html')), "404 Not Found") - else render_text "

    Application error (Rails)

    " - end - end - - # Overwrite to expand the meaning of a local request in order to show local rescues on other occurrences than - # the remote IP being 127.0.0.1. For example, this could include the IP of the developer machine when debugging - # remotely. - def local_request? #:doc: - [@request.remote_addr, @request.remote_ip] == ["127.0.0.1"] * 2 - end - - # Renders a detailed diagnostics screen on action exceptions. - def rescue_action_locally(exception) - add_variables_to_assigns - @template.instance_variable_set("@exception", exception) - @template.instance_variable_set("@rescues_path", File.dirname(__FILE__) + "/templates/rescues/") - @template.send(:assign_variables_from_controller) - - @template.instance_variable_set("@contents", @template.render_file(template_path_for_local_rescue(exception), false)) - - @headers["Content-Type"] = "text/html" - render_file(rescues_path("layout"), response_code_for_rescue(exception)) - end - - private - def perform_action_with_rescue #:nodoc: - begin - perform_action_without_rescue - rescue Object => exception - if defined?(Breakpoint) && @params["BP-RETRY"] - msg = exception.backtrace.first - if md = /^(.+?):(\d+)(?::in `(.+)')?$/.match(msg) then - origin_file, origin_line = md[1], md[2].to_i - - set_trace_func(lambda do |type, file, line, method, context, klass| - if file == origin_file and line == origin_line then - set_trace_func(nil) - @params["BP-RETRY"] = false - - callstack = caller - callstack.slice!(0) if callstack.first["rescue.rb"] - file, line, method = *callstack.first.match(/^(.+?):(\d+)(?::in `(.*?)')?/).captures - - message = "Exception at #{file}:#{line}#{" in `#{method}'" if method}." # `´ ( for ruby-mode) - - Breakpoint.handle_breakpoint(context, message, file, line) - end - end) - - retry - end - end - - rescue_action(exception) - end - end - - def rescues_path(template_name) - File.dirname(__FILE__) + "/templates/rescues/#{template_name}.rhtml" - end - - def template_path_for_local_rescue(exception) - rescues_path( - case exception - when MissingTemplate then "missing_template" - when RoutingError then "routing_error" - when UnknownAction then "unknown_action" - when ActionView::TemplateError then "template_error" - else "diagnostics" - end - ) - end - - def response_code_for_rescue(exception) - case exception - when UnknownAction, RoutingError then "404 Page Not Found" - else "500 Internal Error" - end - end - - def clean_backtrace(exception) - exception.backtrace.collect { |line| Object.const_defined?(:RAILS_ROOT) ? line.gsub(RAILS_ROOT, "") : line } - end - end -end -module ActionController - class AbstractResponse #:nodoc: - DEFAULT_HEADERS = { "Cache-Control" => "no-cache" } - attr_accessor :body, :headers, :session, :cookies, :assigns, :template, :redirected_to, :redirected_to_method_params - - def initialize - @body, @headers, @session, @assigns = "", DEFAULT_HEADERS.merge("cookie" => []), [], [] - end - - def redirect(to_url, permanently = false) - @headers["Status"] = "302 Found" unless @headers["Status"] == "301 Moved Permanently" - @headers["location"] = to_url - - @body = "You are being redirected." - end - end -endmodule ActionController - module Routing #:nodoc: - class << self - def expiry_hash(options, recall) - k = v = nil - expire_on = {} - options.each {|k, v| expire_on[k] = ((rcv = recall[k]) && (rcv != v))} - expire_on - end - - def extract_parameter_value(parameter) #:nodoc: - CGI.escape((parameter.respond_to?(:to_param) ? parameter.to_param : parameter).to_s) - end - def controller_relative_to(controller, previous) - if controller.nil? then previous - elsif controller[0] == ?/ then controller[1..-1] - elsif %r{^(.*)/} =~ previous then "#{$1}/#{controller}" - else controller - end - end - - def treat_hash(hash, keys_to_delete = []) - k = v = nil - hash.each do |k, v| - if v then hash[k] = (v.respond_to? :to_param) ? v.to_param.to_s : v.to_s - else - hash.delete k - keys_to_delete << k - end - end - hash - end - - def test_condition(expression, condition) - case condition - when String then "(#{expression} == #{condition.inspect})" - when Regexp then - condition = Regexp.new("^#{condition.source}$") unless /^\^.*\$$/ =~ condition.source - "(#{condition.inspect} =~ #{expression})" - when Array then - conds = condition.collect do |condition| - cond = test_condition(expression, condition) - (cond[0, 1] == '(' && cond[-1, 1] == ')') ? cond : "(#{cond})" - end - "(#{conds.join(' || ')})" - when true then expression - when nil then "! #{expression}" - else - raise ArgumentError, "Valid criteria are strings, regular expressions, true, or nil" - end - end - end - - class Component #:nodoc: - def dynamic?() false end - def optional?() false end - - def key() nil end - - def self.new(string, *args) - return super(string, *args) unless self == Component - case string - when ':controller' then ControllerComponent.new(:controller, *args) - when /^:(\w+)$/ then DynamicComponent.new($1, *args) - when /^\*(\w+)$/ then PathComponent.new($1, *args) - else StaticComponent.new(string, *args) - end - end - end - - class StaticComponent < Component #:nodoc: - attr_reader :value - - def initialize(value) - @value = value - end - - def write_recognition(g) - g.if_next_matches(value) do |gp| - gp.move_forward {|gpp| gpp.continue} - end - end - - def write_generation(g) - g.add_segment(value) {|gp| gp.continue } - end - end - - class DynamicComponent < Component #:nodoc: - attr_reader :key, :default - attr_accessor :condition - - def dynamic?() true end - def optional?() @optional end - - def default=(default) - @optional = true - @default = default - end - - def initialize(key, options = {}) - @key = key.to_sym - @optional = false - default, @condition = options[:default], options[:condition] - self.default = default if options.key?(:default) - end - - def default_check(g) - presence = "#{g.hash_value(key, !! default)}" - if default - "!(#{presence} && #{g.hash_value(key, false)} != #{default.to_s.inspect})" - else - "! #{presence}" - end - end - - def write_generation(g) - wrote_dropout = write_dropout_generation(g) - write_continue_generation(g, wrote_dropout) - end - - def write_dropout_generation(g) - return false unless optional? && g.after.all? {|c| c.optional?} - - check = [default_check(g)] - gp = g.dup # Use another generator to write the conditions after the first && - # We do this to ensure that the generator will not assume x_value is set. It will - # not be set if it follows a false condition -- for example, false && (x = 2) - - check += gp.after.map {|c| c.default_check gp} - gp.if(check.join(' && ')) { gp.finish } # If this condition is met, we stop here - true - end - - def write_continue_generation(g, use_else) - test = Routing.test_condition(g.hash_value(key, true, default), condition || true) - check = (use_else && condition.nil? && default) ? [:else] : [use_else ? :elsif : :if, test] - - g.send(*check) do |gp| - gp.expire_for_keys(key) unless gp.after.empty? - add_segments_to(gp) {|gpp| gpp.continue} - end - end - - def add_segments_to(g) - g.add_segment(%(\#{CGI.escape(#{g.hash_value(key, true, default)})})) {|gp| yield gp} - end - - def recognition_check(g) - test_type = [true, nil].include?(condition) ? :presence : :constraint - - prefix = condition.is_a?(Regexp) ? "#{g.next_segment(true)} && " : '' - check = prefix + Routing.test_condition(g.next_segment(true), condition || true) - - g.if(check) {|gp| yield gp, test_type} - end - - def write_recognition(g) - test_type = nil - recognition_check(g) do |gp, test_type| - assign_result(gp) {|gpp| gpp.continue} - end - - if optional? && g.after.all? {|c| c.optional?} - call = (test_type == :presence) ? [:else] : [:elsif, "! #{g.next_segment(true)}"] - - g.send(*call) do |gp| - assign_default(gp) - gp.after.each {|c| c.assign_default(gp)} - gp.finish(false) - end - end - end - - def assign_result(g, with_default = false) - g.result key, "CGI.unescape(#{g.next_segment(true, with_default ? default : nil)})" - g.move_forward {|gp| yield gp} - end - - def assign_default(g) - g.constant_result key, default unless default.nil? - end - end - - class ControllerComponent < DynamicComponent #:nodoc: - def key() :controller end - - def add_segments_to(g) - g.add_segment(%(\#{#{g.hash_value(key, true, default)}})) {|gp| yield gp} - end - - def recognition_check(g) - g << "controller_result = ::ActionController::Routing::ControllerComponent.traverse_to_controller(#{g.path_name}, #{g.index_name})" - g.if('controller_result') do |gp| - gp << 'controller_value, segments_to_controller = controller_result' - if condition - gp << "controller_path = #{gp.path_name}[#{gp.index_name},segments_to_controller].join('/')" - gp.if(Routing.test_condition("controller_path", condition)) do |gpp| - gpp.move_forward('segments_to_controller') {|gppp| yield gppp, :constraint} - end - else - gp.move_forward('segments_to_controller') {|gpp| yield gpp, :constraint} - end - end - end - - def assign_result(g) - g.result key, 'controller_value' - yield g - end - - def assign_default(g) - ControllerComponent.assign_controller(g, default) - end - - class << self - def assign_controller(g, controller) - expr = "::#{controller.split('/').collect {|c| c.camelize}.join('::')}Controller" - g.result :controller, expr, true - end - - def traverse_to_controller(segments, start_at = 0) - mod = ::Object - length = segments.length - index = start_at - mod_name = controller_name = segment = nil - while index < length - return nil unless /\A[A-Za-z][A-Za-z\d_]*\Z/ =~ (segment = segments[index]) - index += 1 - - mod_name = segment.camelize - controller_name = "#{mod_name}Controller" - path_suffix = File.join(segments[start_at..(index - 1)]) - next_mod = nil - - # If the controller is already present, or if we load it, return it. - if mod.const_defined?(controller_name) || attempt_load(mod, controller_name, path_suffix + "_controller") == :defined - controller = mod.const_get(controller_name) - return nil unless controller.is_a?(Class) && controller.ancestors.include?(ActionController::Base) # it's not really a controller? - return [controller, (index - start_at)] - end - - # No controller? Look for the module - if mod.const_defined? mod_name - next_mod = mod.send(:const_get, mod_name) - next_mod = nil unless next_mod.is_a?(Module) - else - # Try to load a file that defines the module we want. - case attempt_load(mod, mod_name, path_suffix) - when :defined then next_mod = mod.const_get mod_name - when :dir then # We didn't find a file, but there's a dir. - next_mod = Module.new # So create a module for the directory - mod.send :const_set, mod_name, next_mod - else - return nil - end - end - mod = next_mod - - return nil unless mod && mod.is_a?(Module) - end - nil - end - - protected - def safe_load_paths #:nodoc: - if defined?(RAILS_ROOT) - $LOAD_PATH.select do |base| - base = File.expand_path(base) - extended_root = File.expand_path(RAILS_ROOT) - # Exclude all paths that are not nested within app, lib, or components. - base.match(/\A#{Regexp.escape(extended_root)}\/*(app|lib|components)\/[a-z]/) || base =~ %r{rails-[\d.]+/builtin} - end - else - $LOAD_PATH - end - end - - def attempt_load(mod, const_name, path) - has_dir = false - safe_load_paths.each do |load_path| - full_path = File.join(load_path, path) - file_path = full_path + '.rb' - if File.file?(file_path) # Found a .rb file? Load it up - require_dependency(file_path) - return :defined if mod.const_defined? const_name - else - has_dir ||= File.directory?(full_path) - end - end - return (has_dir ? :dir : nil) - end - end - end - - class PathComponent < DynamicComponent #:nodoc: - def optional?() true end - def default() [] end - def condition() nil end - - def default=(value) - raise RoutingError, "All path components have an implicit default of []" unless value == [] - end - - def write_generation(g) - raise RoutingError, 'Path components must occur last' unless g.after.empty? - g.if("#{g.hash_value(key, true)} && ! #{g.hash_value(key, true)}.empty?") do - g << "#{g.hash_value(key, true)} = #{g.hash_value(key, true)}.join('/') unless #{g.hash_value(key, true)}.is_a?(String)" - g.add_segment("\#{CGI.escape_skipping_slashes(#{g.hash_value(key, true)})}") {|gp| gp.finish } - end - g.else { g.finish } - end - - def write_recognition(g) - raise RoutingError, "Path components must occur last" unless g.after.empty? - - start = g.index_name - start = "(#{start})" unless /^\w+$/ =~ start - - value_expr = "#{g.path_name}[#{start}..-1] || []" - g.result key, "ActionController::Routing::PathComponent::Result.new_escaped(#{value_expr})" - g.finish(false) - end - - class Result < ::Array #:nodoc: - def to_s() join '/' end - def self.new_escaped(strings) - new strings.collect {|str| CGI.unescape str} - end - end - end - - class Route #:nodoc: - attr_accessor :components, :known - attr_reader :path, :options, :keys, :defaults - - def initialize(path, options = {}) - @path, @options = path, options - - initialize_components path - defaults, conditions = initialize_hashes options.dup - @defaults = defaults.dup - configure_components(defaults, conditions) - add_default_requirements - initialize_keys - end - - def inspect - "<#{self.class} #{path.inspect}, #{options.inspect[1..-1]}>" - end - - def write_generation(generator = CodeGeneration::GenerationGenerator.new) - generator.before, generator.current, generator.after = [], components.first, (components[1..-1] || []) - - if known.empty? then generator.go - else - # Alter the conditions to allow :action => 'index' to also catch :action => nil - altered_known = known.collect do |k, v| - if k == :action && v== 'index' then [k, [nil, 'index']] - else [k, v] - end - end - generator.if(generator.check_conditions(altered_known)) {|gp| gp.go } - end - - generator - end - - def write_recognition(generator = CodeGeneration::RecognitionGenerator.new) - g = generator.dup - g.share_locals_with generator - g.before, g.current, g.after = [], components.first, (components[1..-1] || []) - - known.each do |key, value| - if key == :controller then ControllerComponent.assign_controller(g, value) - else g.constant_result(key, value) - end - end - - g.go - - generator - end - - def initialize_keys - @keys = (components.collect {|c| c.key} + known.keys).compact - @keys.freeze - end - - def extra_keys(options) - options.keys - @keys - end - - def matches_controller?(controller) - if known[:controller] then known[:controller] == controller - else - c = components.find {|c| c.key == :controller} - return false unless c - return c.condition.nil? || eval(Routing.test_condition('controller', c.condition)) - end - end - - protected - def initialize_components(path) - path = path.split('/') if path.is_a? String - path.shift if path.first.blank? - self.components = path.collect {|str| Component.new str} - end - - def initialize_hashes(options) - path_keys = components.collect {|c| c.key }.compact - self.known = {} - defaults = options.delete(:defaults) || {} - conditions = options.delete(:require) || {} - conditions.update(options.delete(:requirements) || {}) - - options.each do |k, v| - if path_keys.include?(k) then (v.is_a?(Regexp) ? conditions : defaults)[k] = v - else known[k] = v - end - end - [defaults, conditions] - end - - def configure_components(defaults, conditions) - components.each do |component| - if defaults.key?(component.key) then component.default = defaults[component.key] - elsif component.key == :action then component.default = 'index' - elsif component.key == :id then component.default = nil - end - - component.condition = conditions[component.key] if conditions.key?(component.key) - end - end - - def add_default_requirements - component_keys = components.collect {|c| c.key} - known[:action] ||= 'index' unless component_keys.include? :action - end - end - - class RouteSet #:nodoc: - attr_reader :routes, :categories, :controller_to_selector - def initialize - @routes = [] - @generation_methods = Hash.new(:generate_default_path) - end - - def generate(options, request_or_recall_hash = {}) - recall = request_or_recall_hash.is_a?(Hash) ? request_or_recall_hash : request_or_recall_hash.symbolized_path_parameters - use_recall = true - - controller = options[:controller] - options[:action] ||= 'index' if controller - recall_controller = recall[:controller] - if (recall_controller && recall_controller.include?(?/)) || (controller && controller.include?(?/)) - recall = {} if controller && controller[0] == ?/ - options[:controller] = Routing.controller_relative_to(controller, recall_controller) - end - options = recall.dup if options.empty? # XXX move to url_rewriter? - - keys_to_delete = [] - Routing.treat_hash(options, keys_to_delete) - - merged = recall.merge(options) - keys_to_delete.each {|key| merged.delete key} - expire_on = Routing.expiry_hash(options, recall) - - generate_path(merged, options, expire_on) - end - - def generate_path(merged, options, expire_on) - send @generation_methods[merged[:controller]], merged, options, expire_on - end - def generate_default_path(*args) - write_generation - generate_default_path(*args) - end - - def write_generation - method_sources = [] - @generation_methods = Hash.new(:generate_default_path) - categorize_routes.each do |controller, routes| - next unless routes.length < @routes.length - - ivar = controller.gsub('/', '__') - method_name = "generate_path_for_#{ivar}".to_sym - instance_variable_set "@#{ivar}", routes - code = generation_code_for(ivar, method_name).to_s - method_sources << code - - filename = "generated_code/routing/generation_for_controller_#{controller}.rb" - eval(code, nil, filename) - - @generation_methods[controller.to_s] = method_name - @generation_methods[controller.to_sym] = method_name - end - - code = generation_code_for('routes', 'generate_default_path').to_s - eval(code, nil, 'generated_code/routing/generation.rb') - - return (method_sources << code) - end - - def recognize(request) - string_path = request.path - string_path.chomp! if string_path[0] == ?/ - path = string_path.split '/' - path.shift - - hash = recognize_path(path) - return recognition_failed(request) unless hash && hash['controller'] - - controller = hash['controller'] - hash['controller'] = controller.controller_path - request.path_parameters = hash - controller.new - end - alias :recognize! :recognize - - def recognition_failed(request) - raise ActionController::RoutingError, "Recognition failed for #{request.path.inspect}" - end - - def write_recognition - g = generator = CodeGeneration::RecognitionGenerator.new - g.finish_statement = Proc.new {|hash_expr| "return #{hash_expr}"} - - g.def "self.recognize_path(path)" do - each do |route| - g << 'index = 0' - route.write_recognition(g) - end - end - - eval g.to_s, nil, 'generated/routing/recognition.rb' - return g.to_s - end - - def generation_code_for(ivar = 'routes', method_name = nil) - routes = instance_variable_get('@' + ivar) - key_ivar = "@keys_for_#{ivar}" - instance_variable_set(key_ivar, routes.collect {|route| route.keys}) - - g = generator = CodeGeneration::GenerationGenerator.new - g.def "self.#{method_name}(merged, options, expire_on)" do - g << 'unused_count = options.length + 1' - g << "unused_keys = keys = options.keys" - g << 'path = nil' - - routes.each_with_index do |route, index| - g << "new_unused_keys = keys - #{key_ivar}[#{index}]" - g << 'new_path = (' - g.source.indent do - if index.zero? - g << "new_unused_count = new_unused_keys.length" - g << "hash = merged; not_expired = true" - route.write_generation(g.dup) - else - g.if "(new_unused_count = new_unused_keys.length) < unused_count" do |gp| - gp << "hash = merged; not_expired = true" - route.write_generation(gp) - end - end - end - g.source.lines.last << ' )' # Add the closing brace to the end line - g.if 'new_path' do - g << 'return new_path, [] if new_unused_count.zero?' - g << 'path = new_path; unused_keys = new_unused_keys; unused_count = new_unused_count' - end - end - - g << "raise RoutingError, \"No url can be generated for the hash \#{options.inspect}\" unless path" - g << "return path, unused_keys" - end - - return g - end - - def categorize_routes - @categorized_routes = by_controller = Hash.new(self) - - known_controllers.each do |name| - set = by_controller[name] = [] - each do |route| - set << route if route.matches_controller? name - end - end - - @categorized_routes - end - - def known_controllers - @routes.inject([]) do |known, route| - if (controller = route.known[:controller]) - if controller.is_a?(Regexp) - known << controller.source.scan(%r{[\w\d/]+}).select {|word| controller =~ word} - else known << controller - end - end - known - end.uniq - end - - def reload - NamedRoutes.clear - - if defined?(RAILS_ROOT) then load(File.join(RAILS_ROOT, 'config', 'routes.rb')) - else connect(':controller/:action/:id', :action => 'index', :id => nil) - end - - NamedRoutes.install - end - - def connect(*args) - new_route = Route.new(*args) - @routes << new_route - return new_route - end - - def draw - old_routes = @routes - @routes = [] - - begin yield self - rescue - @routes = old_routes - raise - end - write_generation - write_recognition - end - - def empty?() @routes.empty? end - - def each(&block) @routes.each(&block) end - - # Defines a new named route with the provided name and arguments. - # This method need only be used when you wish to use a name that a RouteSet instance - # method exists for, such as categories. - # - # For example, map.categories '/categories', :controller => 'categories' will not work - # due to RouteSet#categories. - def named_route(name, path, hash = {}) - route = connect(path, hash) - NamedRoutes.name_route(route, name) - route - end - - def method_missing(name, *args) - (1..2).include?(args.length) ? named_route(name, *args) : super(name, *args) - end - - def extra_keys(options, recall = {}) - generate(options.dup, recall).last - end - end - - module NamedRoutes #:nodoc: - Helpers = [] - class << self - def clear() Helpers.clear end - - def hash_access_name(name) - "hash_for_#{name}_url" - end - - def url_helper_name(name) - "#{name}_url" - end - - def known_hash_for_route(route) - hash = route.known.symbolize_keys - route.defaults.each do |key, value| - hash[key.to_sym] ||= value if value - end - hash[:controller] = "/#{hash[:controller]}" - - hash - end - - def define_hash_access_method(route, name) - hash = known_hash_for_route(route) - define_method(hash_access_name(name)) do |*args| - args.first ? hash.merge(args.first) : hash - end - end - - def name_route(route, name) - define_hash_access_method(route, name) - - module_eval(%{def #{url_helper_name name}(options = {}) - url_for(#{hash_access_name(name)}.merge(options)) - end}, "generated/routing/named_routes/#{name}.rb") - - protected url_helper_name(name), hash_access_name(name) - - Helpers << url_helper_name(name).to_sym - Helpers << hash_access_name(name).to_sym - Helpers.uniq! - end - - def install(cls = ActionController::Base) - cls.send :include, self - if cls.respond_to? :helper_method - Helpers.each do |helper_name| - cls.send :helper_method, helper_name - end - end - end - end - end - - Routes = RouteSet.new - end -end -module ActionController - module Scaffolding # :nodoc: - def self.append_features(base) - super - base.extend(ClassMethods) - end - - # Scaffolding is a way to quickly put an Active Record class online by providing a series of standardized actions - # for listing, showing, creating, updating, and destroying objects of the class. These standardized actions come - # with both controller logic and default templates that through introspection already know which fields to display - # and which input types to use. Example: - # - # class WeblogController < ActionController::Base - # scaffold :entry - # end - # - # This tiny piece of code will add all of the following methods to the controller: - # - # class WeblogController < ActionController::Base - # verify :method => :post, :only => [ :destroy, :create, :update ], - # :redirect_to => { :action => :list } - # - # def index - # list - # end - # - # def list - # @entries = Entry.find_all - # render_scaffold "list" - # end - # - # def show - # @entry = Entry.find(params[:id]) - # render_scaffold - # end - # - # def destroy - # Entry.find(params[:id]).destroy - # redirect_to :action => "list" - # end - # - # def new - # @entry = Entry.new - # render_scaffold - # end - # - # def create - # @entry = Entry.new(params[:entry]) - # if @entry.save - # flash[:notice] = "Entry was successfully created" - # redirect_to :action => "list" - # else - # render_scaffold('new') - # end - # end - # - # def edit - # @entry = Entry.find(params[:id]) - # render_scaffold - # end - # - # def update - # @entry = Entry.find(params[:id]) - # @entry.attributes = params[:entry] - # - # if @entry.save - # flash[:notice] = "Entry was successfully updated" - # redirect_to :action => "show", :id => @entry - # else - # render_scaffold('edit') - # end - # end - # end - # - # The render_scaffold method will first check to see if you've made your own template (like "weblog/show.rhtml" for - # the show action) and if not, then render the generic template for that action. This gives you the possibility of using the - # scaffold while you're building your specific application. Start out with a totally generic setup, then replace one template - # and one action at a time while relying on the rest of the scaffolded templates and actions. - module ClassMethods - # Adds a swath of generic CRUD actions to the controller. The +model_id+ is automatically converted into a class name unless - # one is specifically provide through options[:class_name]. So scaffold :post would use Post as the class - # and @post/@posts for the instance variables. - # - # It's possible to use more than one scaffold in a single controller by specifying options[:suffix] = true. This will - # make scaffold :post, :suffix => true use method names like list_post, show_post, and create_post - # instead of just list, show, and post. If suffix is used, then no index method is added. - def scaffold(model_id, options = {}) - options.assert_valid_keys(:class_name, :suffix) - - singular_name = model_id.to_s - class_name = options[:class_name] || singular_name.camelize - plural_name = singular_name.pluralize - suffix = options[:suffix] ? "_#{singular_name}" : "" - - unless options[:suffix] - module_eval <<-"end_eval", __FILE__, __LINE__ - def index - list - end - end_eval - end - - module_eval <<-"end_eval", __FILE__, __LINE__ - - verify :method => :post, :only => [ :destroy#{suffix}, :create#{suffix}, :update#{suffix} ], - :redirect_to => { :action => :list#{suffix} } - - - def list#{suffix} - @#{singular_name}_pages, @#{plural_name} = paginate :#{plural_name}, :per_page => 10 - render#{suffix}_scaffold "list#{suffix}" - end - - def show#{suffix} - @#{singular_name} = #{class_name}.find(params[:id]) - render#{suffix}_scaffold - end - - def destroy#{suffix} - #{class_name}.find(params[:id]).destroy - redirect_to :action => "list#{suffix}" - end - - def new#{suffix} - @#{singular_name} = #{class_name}.new - render#{suffix}_scaffold - end - - def create#{suffix} - @#{singular_name} = #{class_name}.new(params[:#{singular_name}]) - if @#{singular_name}.save - flash[:notice] = "#{class_name} was successfully created" - redirect_to :action => "list#{suffix}" - else - render#{suffix}_scaffold('new') - end - end - - def edit#{suffix} - @#{singular_name} = #{class_name}.find(params[:id]) - render#{suffix}_scaffold - end - - def update#{suffix} - @#{singular_name} = #{class_name}.find(params[:id]) - @#{singular_name}.attributes = params[:#{singular_name}] - - if @#{singular_name}.save - flash[:notice] = "#{class_name} was successfully updated" - redirect_to :action => "show#{suffix}", :id => @#{singular_name} - else - render#{suffix}_scaffold('edit') - end - end - - private - def render#{suffix}_scaffold(action=nil) - action ||= caller_method_name(caller) - # logger.info ("testing template:" + "\#{self.class.controller_path}/\#{action}") if logger - - if template_exists?("\#{self.class.controller_path}/\#{action}") - render_action(action) - else - @scaffold_class = #{class_name} - @scaffold_singular_name, @scaffold_plural_name = "#{singular_name}", "#{plural_name}" - @scaffold_suffix = "#{suffix}" - add_instance_variables_to_assigns - - @template.instance_variable_set("@content_for_layout", @template.render_file(scaffold_path(action.sub(/#{suffix}$/, "")), false)) - - if !active_layout.nil? - render_file(active_layout, nil, true) - else - render_file(scaffold_path("layout")) - end - end - end - - def scaffold_path(template_name) - File.dirname(__FILE__) + "/templates/scaffolds/" + template_name + ".rhtml" - end - - def caller_method_name(caller) - caller.first.scan(/`(.*)'/).first.first # ' ruby-mode - end - end_eval - end - end - end -end -require 'cgi' -require 'cgi/session' -require 'digest/md5' -require 'base64' - -class CGI - class Session - # Return this session's underlying Session instance. Useful for the DB-backed session stores. - def model - @dbman.model if @dbman - end - - - # A session store backed by an Active Record class. A default class is - # provided, but any object duck-typing to an Active Record +Session+ class - # with text +session_id+ and +data+ attributes is sufficient. - # - # The default assumes a +sessions+ tables with columns: - # +id+ (numeric primary key), - # +session_id+ (text, or longtext if your session data exceeds 65K), and - # +data+ (text or longtext; careful if your session data exceeds 65KB). - # The +session_id+ column should always be indexed for speedy lookups. - # Session data is marshaled to the +data+ column in Base64 format. - # If the data you write is larger than the column's size limit, - # ActionController::SessionOverflowError will be raised. - # - # You may configure the table name, primary key, and data column. - # For example, at the end of config/environment.rb: - # CGI::Session::ActiveRecordStore::Session.table_name = 'legacy_session_table' - # CGI::Session::ActiveRecordStore::Session.primary_key = 'session_id' - # CGI::Session::ActiveRecordStore::Session.data_column_name = 'legacy_session_data' - # Note that setting the primary key to the session_id frees you from - # having a separate id column if you don't want it. However, you must - # set session.model.id = session.session_id by hand! A before_filter - # on ApplicationController is a good place. - # - # Since the default class is a simple Active Record, you get timestamps - # for free if you add +created_at+ and +updated_at+ datetime columns to - # the +sessions+ table, making periodic session expiration a snap. - # - # You may provide your own session class implementation, whether a - # feature-packed Active Record or a bare-metal high-performance SQL - # store, by setting - # +CGI::Session::ActiveRecordStore.session_class = MySessionClass+ - # You must implement these methods: - # self.find_by_session_id(session_id) - # initialize(hash_of_session_id_and_data) - # attr_reader :session_id - # attr_accessor :data - # save - # destroy - # - # The example SqlBypass class is a generic SQL session store. You may - # use it as a basis for high-performance database-specific stores. - class ActiveRecordStore - # The default Active Record class. - class Session < ActiveRecord::Base - # Customizable data column name. Defaults to 'data'. - cattr_accessor :data_column_name - self.data_column_name = 'data' - - before_save :marshal_data! - before_save :raise_on_session_data_overflow! - - class << self - # Don't try to reload ARStore::Session in dev mode. - def reloadable? #:nodoc: - false - end - - def data_column_size_limit - @data_column_size_limit ||= columns_hash[@@data_column_name].limit - end - - # Hook to set up sessid compatibility. - def find_by_session_id(session_id) - setup_sessid_compatibility! - find_by_session_id(session_id) - end - - def marshal(data) Base64.encode64(Marshal.dump(data)) if data end - def unmarshal(data) Marshal.load(Base64.decode64(data)) if data end - - def create_table! - connection.execute <<-end_sql - CREATE TABLE #{table_name} ( - id INTEGER PRIMARY KEY, - #{connection.quote_column_name('session_id')} TEXT UNIQUE, - #{connection.quote_column_name(@@data_column_name)} TEXT(255) - ) - end_sql - end - - def drop_table! - connection.execute "DROP TABLE #{table_name}" - end - - private - # Compatibility with tables using sessid instead of session_id. - def setup_sessid_compatibility! - # Reset column info since it may be stale. - reset_column_information - if columns_hash['sessid'] - def self.find_by_session_id(*args) - find_by_sessid(*args) - end - - define_method(:session_id) { sessid } - define_method(:session_id=) { |session_id| self.sessid = session_id } - else - def self.find_by_session_id(session_id) - find :first, :conditions => ["session_id #{attribute_condition(session_id)}", session_id] - end - end - end - end - - # Lazy-unmarshal session state. - def data - @data ||= self.class.unmarshal(read_attribute(@@data_column_name)) || {} - end - - # Has the session been loaded yet? - def loaded? - !! @data - end - - private - attr_writer :data - - def marshal_data! - return false if !loaded? - write_attribute(@@data_column_name, self.class.marshal(self.data)) - end - - # Ensures that the data about to be stored in the database is not - # larger than the data storage column. Raises - # ActionController::SessionOverflowError. - def raise_on_session_data_overflow! - return false if !loaded? - limit = self.class.data_column_size_limit - if loaded? and limit and read_attribute(@@data_column_name).size > limit - raise ActionController::SessionOverflowError - end - end - end - - # A barebones session store which duck-types with the default session - # store but bypasses Active Record and issues SQL directly. This is - # an example session model class meant as a basis for your own classes. - # - # The database connection, table name, and session id and data columns - # are configurable class attributes. Marshaling and unmarshaling - # are implemented as class methods that you may override. By default, - # marshaling data is +Base64.encode64(Marshal.dump(data))+ and - # unmarshaling data is +Marshal.load(Base64.decode64(data))+. - # - # This marshaling behavior is intended to store the widest range of - # binary session data in a +text+ column. For higher performance, - # store in a +blob+ column instead and forgo the Base64 encoding. - class SqlBypass - # Use the ActiveRecord::Base.connection by default. - cattr_accessor :connection - - # The table name defaults to 'sessions'. - cattr_accessor :table_name - @@table_name = 'sessions' - - # The session id field defaults to 'session_id'. - cattr_accessor :session_id_column - @@session_id_column = 'session_id' - - # The data field defaults to 'data'. - cattr_accessor :data_column - @@data_column = 'data' - - class << self - - def connection - @@connection ||= ActiveRecord::Base.connection - end - - # Look up a session by id and unmarshal its data if found. - def find_by_session_id(session_id) - if record = @@connection.select_one("SELECT * FROM #{@@table_name} WHERE #{@@session_id_column}=#{@@connection.quote(session_id)}") - new(:session_id => session_id, :marshaled_data => record['data']) - end - end - - def marshal(data) Base64.encode64(Marshal.dump(data)) if data end - def unmarshal(data) Marshal.load(Base64.decode64(data)) if data end - - def create_table! - @@connection.execute <<-end_sql - CREATE TABLE #{table_name} ( - id INTEGER PRIMARY KEY, - #{@@connection.quote_column_name(session_id_column)} TEXT UNIQUE, - #{@@connection.quote_column_name(data_column)} TEXT - ) - end_sql - end - - def drop_table! - @@connection.execute "DROP TABLE #{table_name}" - end - end - - attr_reader :session_id - attr_writer :data - - # Look for normal and marshaled data, self.find_by_session_id's way of - # telling us to postpone unmarshaling until the data is requested. - # We need to handle a normal data attribute in case of a new record. - def initialize(attributes) - @session_id, @data, @marshaled_data = attributes[:session_id], attributes[:data], attributes[:marshaled_data] - @new_record = @marshaled_data.nil? - end - - def new_record? - @new_record - end - - # Lazy-unmarshal session state. - def data - unless @data - if @marshaled_data - @data, @marshaled_data = self.class.unmarshal(@marshaled_data) || {}, nil - else - @data = {} - end - end - @data - end - - def loaded? - !! @data - end - - def save - return false if !loaded? - marshaled_data = self.class.marshal(data) - - if @new_record - @new_record = false - @@connection.update <<-end_sql, 'Create session' - INSERT INTO #{@@table_name} ( - #{@@connection.quote_column_name(@@session_id_column)}, - #{@@connection.quote_column_name(@@data_column)} ) - VALUES ( - #{@@connection.quote(session_id)}, - #{@@connection.quote(marshaled_data)} ) - end_sql - else - @@connection.update <<-end_sql, 'Update session' - UPDATE #{@@table_name} - SET #{@@connection.quote_column_name(@@data_column)}=#{@@connection.quote(marshaled_data)} - WHERE #{@@connection.quote_column_name(@@session_id_column)}=#{@@connection.quote(session_id)} - end_sql - end - end - - def destroy - unless @new_record - @@connection.delete <<-end_sql, 'Destroy session' - DELETE FROM #{@@table_name} - WHERE #{@@connection.quote_column_name(@@session_id_column)}=#{@@connection.quote(session_id)} - end_sql - end - end - end - - - # The class used for session storage. Defaults to - # CGI::Session::ActiveRecordStore::Session. - cattr_accessor :session_class - self.session_class = Session - - # Find or instantiate a session given a CGI::Session. - def initialize(session, option = nil) - session_id = session.session_id - unless @session = ActiveRecord::Base.silence { @@session_class.find_by_session_id(session_id) } - unless session.new_session - raise CGI::Session::NoSession, 'uninitialized session' - end - @session = @@session_class.new(:session_id => session_id, :data => {}) - # session saving can be lazy again, because of improved component implementation - # therefore next line gets commented out: - # @session.save - end - end - - # Access the underlying session model. - def model - @session - end - - # Restore session state. The session model handles unmarshaling. - def restore - if @session - @session.data - end - end - - # Save session store. - def update - if @session - ActiveRecord::Base.silence { @session.save } - end - end - - # Save and close the session store. - def close - if @session - update - @session = nil - end - end - - # Delete and close the session store. - def delete - if @session - ActiveRecord::Base.silence { @session.destroy } - @session = nil - end - end - - protected - def logger - ActionController::Base.logger rescue nil - end - end - end -end -#!/usr/local/bin/ruby -w - -# This is a really simple session storage daemon, basically just a hash, -# which is enabled for DRb access. - -require 'drb' - -session_hash = Hash.new -session_hash.instance_eval { @mutex = Mutex.new } - -class <:only and - # :except clauses to restrict the subset, otherwise options - # apply to all actions on this controller. - # - # The session options are inheritable, as well, so if you specify them in - # a parent controller, they apply to controllers that extend the parent. - # - # Usage: - # - # # turn off session management for all actions. - # session :off - # - # # turn off session management for all actions _except_ foo and bar. - # session :off, :except => %w(foo bar) - # - # # turn off session management for only the foo and bar actions. - # session :off, :only => %w(foo bar) - # - # # the session will only work over HTTPS, but only for the foo action - # session :only => :foo, :session_secure => true - # - # # the session will only be disabled for 'foo', and only if it is - # # requested as a web service - # session :off, :only => :foo, - # :if => Proc.new { |req| req.parameters[:ws] } - # - # All session options described for ActionController::Base.process_cgi - # are valid arguments. - def session(*args) - options = Hash === args.last ? args.pop : {} - - options[:disabled] = true if !args.empty? - options[:only] = [*options[:only]].map { |o| o.to_s } if options[:only] - options[:except] = [*options[:except]].map { |o| o.to_s } if options[:except] - if options[:only] && options[:except] - raise ArgumentError, "only one of either :only or :except are allowed" - end - - write_inheritable_array("session_options", [options]) - end - - def cached_session_options #:nodoc: - @session_options ||= read_inheritable_attribute("session_options") || [] - end - - def session_options_for(request, action) #:nodoc: - if (session_options = cached_session_options).empty? - {} - else - options = {} - - action = action.to_s - session_options.each do |opts| - next if opts[:if] && !opts[:if].call(request) - if opts[:only] && opts[:only].include?(action) - options.merge!(opts) - elsif opts[:except] && !opts[:except].include?(action) - options.merge!(opts) - elsif !opts[:only] && !opts[:except] - options.merge!(opts) - end - end - - if options.empty? then options - else - options.delete :only - options.delete :except - options.delete :if - options[:disabled] ? false : options - end - end - end - end - - def process_with_session_management_support(request, response, method = :perform_action, *arguments) #:nodoc: - set_session_options(request) - process_without_session_management_support(request, response, method, *arguments) - end - - private - def set_session_options(request) - request.session_options = self.class.session_options_for(request, request.parameters["action"] || "index") - end - - def process_cleanup_with_session_management_support - process_cleanup_without_session_management_support - clear_persistent_model_associations - end - - # Clear cached associations in session data so they don't overflow - # the database field. Only applies to ActiveRecordStore since there - # is not a standard way to iterate over session data. - def clear_persistent_model_associations #:doc: - if defined?(@session) && @session.instance_variables.include?('@data') - session_data = @session.instance_variable_get('@data') - - if session_data && session_data.respond_to?(:each_value) - session_data.each_value do |obj| - obj.clear_association_cache if obj.respond_to?(:clear_association_cache) - end - end - end - end - end -end -module ActionController #:nodoc: - # Methods for sending files and streams to the browser instead of rendering. - module Streaming - DEFAULT_SEND_FILE_OPTIONS = { - :type => 'application/octet-stream'.freeze, - :disposition => 'attachment'.freeze, - :stream => true, - :buffer_size => 4096 - }.freeze - - protected - # Sends the file by streaming it 4096 bytes at a time. This way the - # whole file doesn't need to be read into memory at once. This makes - # it feasible to send even large files. - # - # Be careful to sanitize the path parameter if it coming from a web - # page. send_file(params[:path]) allows a malicious user to - # download any file on your server. - # - # Options: - # * :filename - suggests a filename for the browser to use. - # Defaults to File.basename(path). - # * :type - specifies an HTTP content type. - # Defaults to 'application/octet-stream'. - # * :disposition - specifies whether the file will be shown inline or downloaded. - # Valid values are 'inline' and 'attachment' (default). - # * :stream - whether to send the file to the user agent as it is read (true) - # or to read the entire file before sending (false). Defaults to true. - # * :buffer_size - specifies size (in bytes) of the buffer used to stream the file. - # Defaults to 4096. - # * :status - specifies the status code to send with the response. Defaults to '200 OK'. - # - # The default Content-Type and Content-Disposition headers are - # set to download arbitrary binary files in as many browsers as - # possible. IE versions 4, 5, 5.5, and 6 are all known to have - # a variety of quirks (especially when downloading over SSL). - # - # Simple download: - # send_file '/path/to.zip' - # - # Show a JPEG in the browser: - # send_file '/path/to.jpeg', :type => 'image/jpeg', :disposition => 'inline' - # - # Show a 404 page in the browser: - # send_file '/path/to/404.html, :type => 'text/html; charset=utf-8', :status => 404 - # - # Read about the other Content-* HTTP headers if you'd like to - # provide the user with more information (such as Content-Description). - # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11 - # - # Also be aware that the document may be cached by proxies and browsers. - # The Pragma and Cache-Control headers declare how the file may be cached - # by intermediaries. They default to require clients to validate with - # the server before releasing cached responses. See - # http://www.mnot.net/cache_docs/ for an overview of web caching and - # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 - # for the Cache-Control header spec. - def send_file(path, options = {}) #:doc: - raise MissingFile, "Cannot read file #{path}" unless File.file?(path) and File.readable?(path) - - options[:length] ||= File.size(path) - options[:filename] ||= File.basename(path) - send_file_headers! options - - @performed_render = false - - if options[:stream] - render :status => options[:status], :text => Proc.new { |response, output| - logger.info "Streaming file #{path}" unless logger.nil? - len = options[:buffer_size] || 4096 - File.open(path, 'rb') do |file| - if output.respond_to?(:syswrite) - begin - while true - output.syswrite(file.sysread(len)) - end - rescue EOFError - end - else - while buf = file.read(len) - output.write(buf) - end - end - end - } - else - logger.info "Sending file #{path}" unless logger.nil? - File.open(path, 'rb') { |file| render :status => options[:status], :text => file.read } - end - end - - # Send binary data to the user as a file download. May set content type, apparent file name, - # and specify whether to show data inline or download as an attachment. - # - # Options: - # * :filename - Suggests a filename for the browser to use. - # * :type - specifies an HTTP content type. - # Defaults to 'application/octet-stream'. - # * :disposition - specifies whether the file will be shown inline or downloaded. - # * :status - specifies the status code to send with the response. Defaults to '200 OK'. - # Valid values are 'inline' and 'attachment' (default). - # - # Generic data download: - # send_data buffer - # - # Download a dynamically-generated tarball: - # send_data generate_tgz('dir'), :filename => 'dir.tgz' - # - # Display an image Active Record in the browser: - # send_data image.data, :type => image.content_type, :disposition => 'inline' - # - # See +send_file+ for more information on HTTP Content-* headers and caching. - def send_data(data, options = {}) #:doc: - logger.info "Sending data #{options[:filename]}" unless logger.nil? - send_file_headers! options.merge(:length => data.size) - @performed_render = false - render :status => options[:status], :text => data - end - - private - def send_file_headers!(options) - options.update(DEFAULT_SEND_FILE_OPTIONS.merge(options)) - [:length, :type, :disposition].each do |arg| - raise ArgumentError, ":#{arg} option required" if options[arg].nil? - end - - disposition = options[:disposition].dup || 'attachment' - - disposition <<= %(; filename="#{options[:filename]}") if options[:filename] - - @headers.update( - 'Content-Length' => options[:length], - 'Content-Type' => options[:type].strip, # fixes a problem with extra '\r' with some browsers - 'Content-Disposition' => disposition, - 'Content-Transfer-Encoding' => 'binary' - ) - - # Fix a problem with IE 6.0 on opening downloaded files: - # If Cache-Control: no-cache is set (which Rails does by default), - # IE removes the file it just downloaded from its cache immediately - # after it displays the "open/save" dialog, which means that if you - # hit "open" the file isn't there anymore when the application that - # is called for handling the download is run, so let's workaround that - @headers['Cache-Control'] = 'private' if @headers['Cache-Control'] == 'no-cache' - end - end -end -require File.dirname(__FILE__) + '/assertions' -require File.dirname(__FILE__) + '/deprecated_assertions' - -module ActionController #:nodoc: - class Base - # Process a test request called with a +TestRequest+ object. - def self.process_test(request) - new.process_test(request) - end - - def process_test(request) #:nodoc: - process(request, TestResponse.new) - end - - def process_with_test(*args) - returning process_without_test(*args) do - add_variables_to_assigns - end - end - - alias_method :process_without_test, :process - alias_method :process, :process_with_test - end - - class TestRequest < AbstractRequest #:nodoc: - attr_accessor :cookies, :session_options - attr_accessor :query_parameters, :request_parameters, :path, :session, :env - attr_accessor :host - - def initialize(query_parameters = nil, request_parameters = nil, session = nil) - @query_parameters = query_parameters || {} - @request_parameters = request_parameters || {} - @session = session || TestSession.new - - initialize_containers - initialize_default_values - - super() - end - - def reset_session - @session = {} - end - - def raw_post - if raw_post = env['RAW_POST_DATA'] - raw_post - else - params = self.request_parameters.dup - %w(controller action only_path).each do |k| - params.delete(k) - params.delete(k.to_sym) - end - - params.map { |k,v| [ CGI.escape(k.to_s), CGI.escape(v.to_s) ].join('=') }.sort.join('&') - end - end - - def port=(number) - @env["SERVER_PORT"] = number.to_i - @port_as_int = nil - end - - def action=(action_name) - @query_parameters.update({ "action" => action_name }) - @parameters = nil - end - - # Used to check AbstractRequest's request_uri functionality. - # Disables the use of @path and @request_uri so superclass can handle those. - def set_REQUEST_URI(value) - @env["REQUEST_URI"] = value - @request_uri = nil - @path = nil - end - - def request_uri=(uri) - @request_uri = uri - @path = uri.split("?").first - end - - def remote_addr=(addr) - @env['REMOTE_ADDR'] = addr - end - - def remote_addr - @env['REMOTE_ADDR'] - end - - def request_uri - @request_uri || super() - end - - def path - @path || super() - end - - def assign_parameters(controller_path, action, parameters) - parameters = parameters.symbolize_keys.merge(:controller => controller_path, :action => action) - extra_keys = ActionController::Routing::Routes.extra_keys(parameters) - non_path_parameters = get? ? query_parameters : request_parameters - parameters.each do |key, value| - if value.is_a? Fixnum - value = value.to_s - elsif value.is_a? Array - value = ActionController::Routing::PathComponent::Result.new(value) - end - - if extra_keys.include?(key.to_sym) - non_path_parameters[key] = value - else - path_parameters[key.to_s] = value - end - end - end - - def recycle! - self.request_parameters = {} - self.query_parameters = {} - self.path_parameters = {} - @request_method, @accepts, @content_type = nil, nil, nil - end - - private - def initialize_containers - @env, @cookies = {}, {} - end - - def initialize_default_values - @host = "test.host" - @request_uri = "/" - self.remote_addr = "0.0.0.0" - @env["SERVER_PORT"] = 80 - @env['REQUEST_METHOD'] = "GET" - end - end - - # A refactoring of TestResponse to allow the same behavior to be applied - # to the "real" CgiResponse class in integration tests. - module TestResponseBehavior #:nodoc: - # the response code of the request - def response_code - headers['Status'][0,3].to_i rescue 0 - end - - # returns a String to ensure compatibility with Net::HTTPResponse - def code - headers['Status'].to_s.split(' ')[0] - end - - def message - headers['Status'].to_s.split(' ',2)[1] - end - - # was the response successful? - def success? - response_code == 200 - end - - # was the URL not found? - def missing? - response_code == 404 - end - - # were we redirected? - def redirect? - (300..399).include?(response_code) - end - - # was there a server-side error? - def error? - (500..599).include?(response_code) - end - - alias_method :server_error?, :error? - - # returns the redirection location or nil - def redirect_url - redirect? ? headers['location'] : nil - end - - # does the redirect location match this regexp pattern? - def redirect_url_match?( pattern ) - return false if redirect_url.nil? - p = Regexp.new(pattern) if pattern.class == String - p = pattern if pattern.class == Regexp - return false if p.nil? - p.match(redirect_url) != nil - end - - # returns the template path of the file which was used to - # render this response (or nil) - def rendered_file(with_controller=false) - unless template.first_render.nil? - unless with_controller - template.first_render - else - template.first_render.split('/').last || template.first_render - end - end - end - - # was this template rendered by a file? - def rendered_with_file? - !rendered_file.nil? - end - - # a shortcut to the flash (or an empty hash if no flash.. hey! that rhymes!) - def flash - session['flash'] || {} - end - - # do we have a flash? - def has_flash? - !session['flash'].empty? - end - - # do we have a flash that has contents? - def has_flash_with_contents? - !flash.empty? - end - - # does the specified flash object exist? - def has_flash_object?(name=nil) - !flash[name].nil? - end - - # does the specified object exist in the session? - def has_session_object?(name=nil) - !session[name].nil? - end - - # a shortcut to the template.assigns - def template_objects - template.assigns || {} - end - - # does the specified template object exist? - def has_template_object?(name=nil) - !template_objects[name].nil? - end - - # Returns the response cookies, converted to a Hash of (name => CGI::Cookie) pairs - # Example: - # - # assert_equal ['AuthorOfNewPage'], r.cookies['author'].value - def cookies - headers['cookie'].inject({}) { |hash, cookie| hash[cookie.name] = cookie; hash } - end - - # Returns binary content (downloadable file), converted to a String - def binary_content - raise "Response body is not a Proc: #{body.inspect}" unless body.kind_of?(Proc) - require 'stringio' - - sio = StringIO.new - - begin - $stdout = sio - body.call - ensure - $stdout = STDOUT - end - - sio.rewind - sio.read - end - end - - class TestResponse < AbstractResponse #:nodoc: - include TestResponseBehavior - end - - class TestSession #:nodoc: - def initialize(attributes = {}) - @attributes = attributes - end - - def [](key) - @attributes[key] - end - - def []=(key, value) - @attributes[key] = value - end - - def session_id - "" - end - - def update() end - def close() end - def delete() @attributes = {} end - end - - # Essentially generates a modified Tempfile object similar to the object - # you'd get from the standard library CGI module in a multipart - # request. This means you can use an ActionController::TestUploadedFile - # object in the params of a test request in order to simulate - # a file upload. - # - # Usage example, within a functional test: - # post :change_avatar, :avatar => ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + '/files/spongebob.png', 'image/png') - class TestUploadedFile - # The filename, *not* including the path, of the "uploaded" file - attr_reader :original_filename - - # The content type of the "uploaded" file - attr_reader :content_type - - def initialize(path, content_type = 'text/plain') - raise "file does not exist" unless File.exist?(path) - @content_type = content_type - @original_filename = path.sub(/^.*#{File::SEPARATOR}([^#{File::SEPARATOR}]+)$/) { $1 } - @tempfile = Tempfile.new(@original_filename) - FileUtils.copy_file(path, @tempfile.path) - end - - def path #:nodoc: - @tempfile.path - end - - alias local_path path - - def method_missing(method_name, *args, &block) #:nodoc: - @tempfile.send(method_name, *args, &block) - end - end - - module TestProcess - def self.included(base) - # execute the request simulating a specific http method and set/volley the response - %w( get post put delete head ).each do |method| - base.class_eval <<-EOV, __FILE__, __LINE__ - def #{method}(action, parameters = nil, session = nil, flash = nil) - @request.env['REQUEST_METHOD'] = "#{method.upcase}" if @request - process(action, parameters, session, flash) - end - EOV - end - end - - # execute the request and set/volley the response - def process(action, parameters = nil, session = nil, flash = nil) - # Sanity check for required instance variables so we can give an - # understandable error message. - %w(controller request response).each do |iv_name| - raise "@#{iv_name} is nil: make sure you set it in your test's setup method." if instance_variable_get("@#{iv_name}").nil? - end - - @request.recycle! - - @html_document = nil - @request.env['REQUEST_METHOD'] ||= "GET" - @request.action = action.to_s - - parameters ||= {} - @request.assign_parameters(@controller.class.controller_path, action.to_s, parameters) - - @request.session = ActionController::TestSession.new(session) unless session.nil? - @request.session["flash"] = ActionController::Flash::FlashHash.new.update(flash) if flash - build_request_uri(action, parameters) - @controller.process(@request, @response) - end - - def xml_http_request(request_method, action, parameters = nil, session = nil, flash = nil) - @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' - @request.env['HTTP_ACCEPT'] = 'text/javascript, text/html, application/xml, text/xml, */*' - returning self.send(request_method, action, parameters, session, flash) do - @request.env.delete 'HTTP_X_REQUESTED_WITH' - @request.env.delete 'HTTP_ACCEPT' - end - end - alias xhr :xml_http_request - - def follow_redirect - if @response.redirected_to[:controller] - raise "Can't follow redirects outside of current controller (#{@response.redirected_to[:controller]})" - end - - get(@response.redirected_to.delete(:action), @response.redirected_to.stringify_keys) - end - - def assigns(key = nil) - if key.nil? - @response.template.assigns - else - @response.template.assigns[key.to_s] - end - end - - def session - @response.session - end - - def flash - @response.flash - end - - def cookies - @response.cookies - end - - def redirect_to_url - @response.redirect_url - end - - def build_request_uri(action, parameters) - unless @request.env['REQUEST_URI'] - options = @controller.send(:rewrite_options, parameters) - options.update(:only_path => true, :action => action) - - url = ActionController::UrlRewriter.new(@request, parameters) - @request.set_REQUEST_URI(url.rewrite(options)) - end - end - - def html_document - @html_document ||= HTML::Document.new(@response.body) - end - - def find_tag(conditions) - html_document.find(conditions) - end - - def find_all_tag(conditions) - html_document.find_all(conditions) - end - - def method_missing(selector, *args) - return @controller.send(selector, *args) if ActionController::Routing::NamedRoutes::Helpers.include?(selector) - return super - end - - # Shortcut for ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + path, type). Example: - # post :change_avatar, :avatar => fixture_file_upload('/files/spongebob.png', 'image/png') - def fixture_file_upload(path, mime_type = nil) - ActionController::TestUploadedFile.new( - Test::Unit::TestCase.respond_to?(:fixture_path) ? Test::Unit::TestCase.fixture_path + path : path, - mime_type - ) - end - - # A helper to make it easier to test different route configurations. - # This method temporarily replaces ActionController::Routing::Routes - # with a new RouteSet instance. - # - # The new instance is yielded to the passed block. Typically the block - # will create some routes using map.draw { map.connect ... }: - # - # with_routing do |set| - # set.draw { set.connect ':controller/:id/:action' } - # assert_equal( - # ['/content/10/show', {}], - # set.generate(:controller => 'content', :id => 10, :action => 'show') - # ) - # end - # - def with_routing - real_routes = ActionController::Routing::Routes - ActionController::Routing.send :remove_const, :Routes - - temporary_routes = ActionController::Routing::RouteSet.new - ActionController::Routing.send :const_set, :Routes, temporary_routes - - yield temporary_routes - ensure - if ActionController::Routing.const_defined? :Routes - ActionController::Routing.send(:remove_const, :Routes) - end - ActionController::Routing.const_set(:Routes, real_routes) if real_routes - end - end -end - -module Test - module Unit - class TestCase #:nodoc: - include ActionController::TestProcess - end - end -end -module ActionController - # Rewrites URLs for Base.redirect_to and Base.url_for in the controller. - - class UrlRewriter #:nodoc: - RESERVED_OPTIONS = [:anchor, :params, :only_path, :host, :protocol, :trailing_slash, :skip_relative_url_root] - def initialize(request, parameters) - @request, @parameters = request, parameters - end - - def rewrite(options = {}) - rewrite_url(rewrite_path(options), options) - end - - def to_str - "#{@request.protocol}, #{@request.host_with_port}, #{@request.path}, #{@parameters[:controller]}, #{@parameters[:action]}, #{@request.parameters.inspect}" - end - - alias_method :to_s, :to_str - - private - def rewrite_url(path, options) - rewritten_url = "" - unless options[:only_path] - rewritten_url << (options[:protocol] || @request.protocol) - rewritten_url << (options[:host] || @request.host_with_port) - end - - rewritten_url << @request.relative_url_root.to_s unless options[:skip_relative_url_root] - rewritten_url << path - rewritten_url << '/' if options[:trailing_slash] - rewritten_url << "##{options[:anchor]}" if options[:anchor] - - rewritten_url - end - - def rewrite_path(options) - options = options.symbolize_keys - options.update(options[:params].symbolize_keys) if options[:params] - if (overwrite = options.delete(:overwrite_params)) - options.update(@parameters.symbolize_keys) - options.update(overwrite) - end - RESERVED_OPTIONS.each {|k| options.delete k} - path, extra_keys = Routing::Routes.generate(options.dup, @request) # Warning: Routes will mutate and violate the options hash - - path << build_query_string(options, extra_keys) unless extra_keys.empty? - - path - end - - # Returns a query string with escaped keys and values from the passed hash. If the passed hash contains an "id" it'll - # be added as a path element instead of a regular parameter pair. - def build_query_string(hash, only_keys = nil) - elements = [] - query_string = "" - - only_keys ||= hash.keys - - only_keys.each do |key| - value = hash[key] - key = CGI.escape key.to_s - if value.class == Array - key << '[]' - else - value = [ value ] - end - value.each { |val| elements << "#{key}=#{Routing.extract_parameter_value(val)}" } - end - - query_string << ("?" + elements.join("&")) unless elements.empty? - query_string - end - end -end -require File.dirname(__FILE__) + '/tokenizer' -require File.dirname(__FILE__) + '/node' - -module HTML #:nodoc: - - # A top-level HTMl document. You give it a body of text, and it will parse that - # text into a tree of nodes. - class Document #:nodoc: - - # The root of the parsed document. - attr_reader :root - - # Create a new Document from the given text. - def initialize(text, strict=false, xml=false) - tokenizer = Tokenizer.new(text) - @root = Node.new(nil) - node_stack = [ @root ] - while token = tokenizer.next - node = Node.parse(node_stack.last, tokenizer.line, tokenizer.position, token) - - node_stack.last.children << node unless node.tag? && node.closing == :close - if node.tag? - if node_stack.length > 1 && node.closing == :close - if node_stack.last.name == node.name - node_stack.pop - else - open_start = node_stack.last.position - 20 - open_start = 0 if open_start < 0 - close_start = node.position - 20 - close_start = 0 if close_start < 0 - msg = < hash } unless Hash === hash - hash = keys_to_symbols(hash) - hash.each do |k,v| - case k - when :tag, :content then - # keys are valid, and require no further processing - when :attributes then - hash[k] = keys_to_strings(v) - when :parent, :child, :ancestor, :descendant, :sibling, :before, - :after - hash[k] = Conditions.new(v) - when :children - hash[k] = v = keys_to_symbols(v) - v.each do |k,v2| - case k - when :count, :greater_than, :less_than - # keys are valid, and require no further processing - when :only - v[k] = Conditions.new(v2) - else - raise "illegal key #{k.inspect} => #{v2.inspect}" - end - end - else - raise "illegal key #{k.inspect} => #{v.inspect}" - end - end - update hash - end - - private - - def keys_to_strings(hash) - hash.keys.inject({}) do |h,k| - h[k.to_s] = hash[k] - h - end - end - - def keys_to_symbols(hash) - hash.keys.inject({}) do |h,k| - raise "illegal key #{k.inspect}" unless k.respond_to?(:to_sym) - h[k.to_sym] = hash[k] - h - end - end - end - - # The base class of all nodes, textual and otherwise, in an HTML document. - class Node #:nodoc: - # The array of children of this node. Not all nodes have children. - attr_reader :children - - # The parent node of this node. All nodes have a parent, except for the - # root node. - attr_reader :parent - - # The line number of the input where this node was begun - attr_reader :line - - # The byte position in the input where this node was begun - attr_reader :position - - # Create a new node as a child of the given parent. - def initialize(parent, line=0, pos=0) - @parent = parent - @children = [] - @line, @position = line, pos - end - - # Return a textual representation of the node. - def to_s - s = "" - @children.each { |child| s << child.to_s } - s - end - - # Return false (subclasses must override this to provide specific matching - # behavior.) +conditions+ may be of any type. - def match(conditions) - false - end - - # Search the children of this node for the first node for which #find - # returns non +nil+. Returns the result of the #find call that succeeded. - def find(conditions) - conditions = validate_conditions(conditions) - - @children.each do |child| - node = child.find(conditions) - return node if node - end - nil - end - - # Search for all nodes that match the given conditions, and return them - # as an array. - def find_all(conditions) - conditions = validate_conditions(conditions) - - matches = [] - matches << self if match(conditions) - @children.each do |child| - matches.concat child.find_all(conditions) - end - matches - end - - # Returns +false+. Subclasses may override this if they define a kind of - # tag. - def tag? - false - end - - def validate_conditions(conditions) - Conditions === conditions ? conditions : Conditions.new(conditions) - end - - def ==(node) - return false unless self.class == node.class && children.size == node.children.size - - equivalent = true - - children.size.times do |i| - equivalent &&= children[i] == node.children[i] - end - - equivalent - end - - class </) - return CDATA.new(parent, line, pos, scanner.pre_match) - end - - closing = ( scanner.scan(/\//) ? :close : nil ) - return Text.new(parent, line, pos, content) unless name = scanner.scan(/[\w:]+/) - name.downcase! - - unless closing - scanner.skip(/\s*/) - attributes = {} - while attr = scanner.scan(/[-\w:]+/) - value = true - if scanner.scan(/\s*=\s*/) - if delim = scanner.scan(/['"]/) - value = "" - while text = scanner.scan(/[^#{delim}\\]+|./) - case text - when "\\" then - value << text - value << scanner.getch - when delim - break - else value << text - end - end - else - value = scanner.scan(/[^\s>\/]+/) - end - end - attributes[attr.downcase] = value - scanner.skip(/\s*/) - end - - closing = ( scanner.scan(/\//) ? :self : nil ) - end - - unless scanner.scan(/\s*>/) - if strict - raise "expected > (got #{scanner.rest.inspect} for #{content}, #{attributes.inspect})" - else - # throw away all text until we find what we're looking for - scanner.skip_until(/>/) or scanner.terminate - end - end - - Tag.new(parent, line, pos, name, attributes, closing) - end - end - end - end - - # A node that represents text, rather than markup. - class Text < Node #:nodoc: - - attr_reader :content - - # Creates a new text node as a child of the given parent, with the given - # content. - def initialize(parent, line, pos, content) - super(parent, line, pos) - @content = content - end - - # Returns the content of this node. - def to_s - @content - end - - # Returns +self+ if this node meets the given conditions. Text nodes support - # conditions of the following kinds: - # - # * if +conditions+ is a string, it must be a substring of the node's - # content - # * if +conditions+ is a regular expression, it must match the node's - # content - # * if +conditions+ is a hash, it must contain a :content key that - # is either a string or a regexp, and which is interpreted as described - # above. - def find(conditions) - match(conditions) && self - end - - # Returns non-+nil+ if this node meets the given conditions, or +nil+ - # otherwise. See the discussion of #find for the valid conditions. - def match(conditions) - case conditions - when String - @content.index(conditions) - when Regexp - @content =~ conditions - when Hash - conditions = validate_conditions(conditions) - - # Text nodes only have :content, :parent, :ancestor - unless (conditions.keys - [:content, :parent, :ancestor]).empty? - return false - end - - match(conditions[:content]) - else - nil - end - end - - def ==(node) - return false unless super - content == node.content - end - end - - # A CDATA node is simply a text node with a specialized way of displaying - # itself. - class CDATA < Text #:nodoc: - def to_s - "" - end - end - - # A Tag is any node that represents markup. It may be an opening tag, a - # closing tag, or a self-closing tag. It has a name, and may have a hash of - # attributes. - class Tag < Node #:nodoc: - - # Either +nil+, :close, or :self - attr_reader :closing - - # Either +nil+, or a hash of attributes for this node. - attr_reader :attributes - - # The name of this tag. - attr_reader :name - - # Create a new node as a child of the given parent, using the given content - # to describe the node. It will be parsed and the node name, attributes and - # closing status extracted. - def initialize(parent, line, pos, name, attributes, closing) - super(parent, line, pos) - @name = name - @attributes = attributes - @closing = closing - end - - # A convenience for obtaining an attribute of the node. Returns +nil+ if - # the node has no attributes. - def [](attr) - @attributes ? @attributes[attr] : nil - end - - # Returns non-+nil+ if this tag can contain child nodes. - def childless?(xml = false) - return false if xml && @closing.nil? - !@closing.nil? || - @name =~ /^(img|br|hr|link|meta|area|base|basefont| - col|frame|input|isindex|param)$/ox - end - - # Returns a textual representation of the node - def to_s - if @closing == :close - "" - else - s = "<#{@name}" - @attributes.each do |k,v| - s << " #{k}" - s << "='#{v.gsub(/'/,"\\\\'")}'" if String === v - end - s << " /" if @closing == :self - s << ">" - @children.each { |child| s << child.to_s } - s << "" if @closing != :self && !@children.empty? - s - end - end - - # If either the node or any of its children meet the given conditions, the - # matching node is returned. Otherwise, +nil+ is returned. (See the - # description of the valid conditions in the +match+ method.) - def find(conditions) - match(conditions) && self || super - end - - # Returns +true+, indicating that this node represents an HTML tag. - def tag? - true - end - - # Returns +true+ if the node meets any of the given conditions. The - # +conditions+ parameter must be a hash of any of the following keys - # (all are optional): - # - # * :tag: the node name must match the corresponding value - # * :attributes: a hash. The node's values must match the - # corresponding values in the hash. - # * :parent: a hash. The node's parent must match the - # corresponding hash. - # * :child: a hash. At least one of the node's immediate children - # must meet the criteria described by the hash. - # * :ancestor: a hash. At least one of the node's ancestors must - # meet the criteria described by the hash. - # * :descendant: a hash. At least one of the node's descendants - # must meet the criteria described by the hash. - # * :sibling: a hash. At least one of the node's siblings must - # meet the criteria described by the hash. - # * :after: a hash. The node must be after any sibling meeting - # the criteria described by the hash, and at least one sibling must match. - # * :before: a hash. The node must be before any sibling meeting - # the criteria described by the hash, and at least one sibling must match. - # * :children: a hash, for counting children of a node. Accepts the - # keys: - # ** :count: either a number or a range which must equal (or - # include) the number of children that match. - # ** :less_than: the number of matching children must be less than - # this number. - # ** :greater_than: the number of matching children must be - # greater than this number. - # ** :only: another hash consisting of the keys to use - # to match on the children, and only matching children will be - # counted. - # - # Conditions are matched using the following algorithm: - # - # * if the condition is a string, it must be a substring of the value. - # * if the condition is a regexp, it must match the value. - # * if the condition is a number, the value must match number.to_s. - # * if the condition is +true+, the value must not be +nil+. - # * if the condition is +false+ or +nil+, the value must be +nil+. - # - # Usage: - # - # # test if the node is a "span" tag - # node.match :tag => "span" - # - # # test if the node's parent is a "div" - # node.match :parent => { :tag => "div" } - # - # # test if any of the node's ancestors are "table" tags - # node.match :ancestor => { :tag => "table" } - # - # # test if any of the node's immediate children are "em" tags - # node.match :child => { :tag => "em" } - # - # # test if any of the node's descendants are "strong" tags - # node.match :descendant => { :tag => "strong" } - # - # # test if the node has between 2 and 4 span tags as immediate children - # node.match :children => { :count => 2..4, :only => { :tag => "span" } } - # - # # get funky: test to see if the node is a "div", has a "ul" ancestor - # # and an "li" parent (with "class" = "enum"), and whether or not it has - # # a "span" descendant that contains # text matching /hello world/: - # node.match :tag => "div", - # :ancestor => { :tag => "ul" }, - # :parent => { :tag => "li", - # :attributes => { :class => "enum" } }, - # :descendant => { :tag => "span", - # :child => /hello world/ } - def match(conditions) - conditions = validate_conditions(conditions) - - # check content of child nodes - if conditions[:content] - if children.empty? - return false unless match_condition("", conditions[:content]) - else - return false unless children.find { |child| child.match(conditions[:content]) } - end - end - - # test the name - return false unless match_condition(@name, conditions[:tag]) if conditions[:tag] - - # test attributes - (conditions[:attributes] || {}).each do |key, value| - return false unless match_condition(self[key], value) - end - - # test parent - return false unless parent.match(conditions[:parent]) if conditions[:parent] - - # test children - return false unless children.find { |child| child.match(conditions[:child]) } if conditions[:child] - - # test ancestors - if conditions[:ancestor] - return false unless catch :found do - p = self - throw :found, true if p.match(conditions[:ancestor]) while p = p.parent - end - end - - # test descendants - if conditions[:descendant] - return false unless children.find do |child| - # test the child - child.match(conditions[:descendant]) || - # test the child's descendants - child.match(:descendant => conditions[:descendant]) - end - end - - # count children - if opts = conditions[:children] - matches = children.select do |c| - c.match(/./) or - (c.kind_of?(HTML::Tag) and (c.closing == :self or ! c.childless?)) - end - - matches = matches.select { |c| c.match(opts[:only]) } if opts[:only] - opts.each do |key, value| - next if key == :only - case key - when :count - if Integer === value - return false if matches.length != value - else - return false unless value.include?(matches.length) - end - when :less_than - return false unless matches.length < value - when :greater_than - return false unless matches.length > value - else raise "unknown count condition #{key}" - end - end - end - - # test siblings - if conditions[:sibling] || conditions[:before] || conditions[:after] - siblings = parent ? parent.children : [] - self_index = siblings.index(self) - - if conditions[:sibling] - return false unless siblings.detect do |s| - s != self && s.match(conditions[:sibling]) - end - end - - if conditions[:before] - return false unless siblings[self_index+1..-1].detect do |s| - s != self && s.match(conditions[:before]) - end - end - - if conditions[:after] - return false unless siblings[0,self_index].detect do |s| - s != self && s.match(conditions[:after]) - end - end - end - - true - end - - def ==(node) - return false unless super - return false unless closing == node.closing && self.name == node.name - attributes == node.attributes - end - - private - # Match the given value to the given condition. - def match_condition(value, condition) - case condition - when String - value && value == condition - when Regexp - value && value.match(condition) - when Numeric - value == condition.to_s - when true - !value.nil? - when false, nil - value.nil? - else - false - end - end - end -end -require 'strscan' - -module HTML #:nodoc: - - # A simple HTML tokenizer. It simply breaks a stream of text into tokens, where each - # token is a string. Each string represents either "text", or an HTML element. - # - # This currently assumes valid XHTML, which means no free < or > characters. - # - # Usage: - # - # tokenizer = HTML::Tokenizer.new(text) - # while token = tokenizer.next - # p token - # end - class Tokenizer #:nodoc: - - # The current (byte) position in the text - attr_reader :position - - # The current line number - attr_reader :line - - # Create a new Tokenizer for the given text. - def initialize(text) - @scanner = StringScanner.new(text) - @position = 0 - @line = 0 - @current_line = 1 - end - - # Return the next token in the sequence, or +nil+ if there are no more tokens in - # the stream. - def next - return nil if @scanner.eos? - @position = @scanner.pos - @line = @current_line - if @scanner.check(/<\S/) - update_current_line(scan_tag) - else - update_current_line(scan_text) - end - end - - private - - # Treat the text at the current position as a tag, and scan it. Supports - # comments, doctype tags, and regular tags, and ignores less-than and - # greater-than characters within quoted strings. - def scan_tag - tag = @scanner.getch - if @scanner.scan(/!--/) # comment - tag << @scanner.matched - tag << (@scanner.scan_until(/--\s*>/) || @scanner.scan_until(/\Z/)) - elsif @scanner.scan(/!\[CDATA\[/) - tag << @scanner.matched - tag << @scanner.scan_until(/\]\]>/) - elsif @scanner.scan(/!/) # doctype - tag << @scanner.matched - tag << consume_quoted_regions - else - tag << consume_quoted_regions - end - tag - end - - # Scan all text up to the next < character and return it. - def scan_text - "#{@scanner.getch}#{@scanner.scan(/[^<]*/)}" - end - - # Counts the number of newlines in the text and updates the current line - # accordingly. - def update_current_line(text) - text.scan(/\r?\n/) { @current_line += 1 } - end - - # Skips over quoted strings, so that less-than and greater-than characters - # within the strings are ignored. - def consume_quoted_regions - text = "" - loop do - match = @scanner.scan_until(/['"<>]/) or break - - delim = @scanner.matched - if delim == "<" - match = match.chop - @scanner.pos -= 1 - end - - text << match - break if delim == "<" || delim == ">" - - # consume the quoted region - while match = @scanner.scan_until(/[\\#{delim}]/) - text << match - break if @scanner.matched == delim - text << @scanner.getch # skip the escaped character - end - end - text - end - end - -end -module HTML #:nodoc: - module Version #:nodoc: - - MAJOR = 0 - MINOR = 5 - TINY = 3 - - STRING = [ MAJOR, MINOR, TINY ].join(".") - - end -end -require 'rexml/document' - -# SimpleXML like xml parser. Written by leon breet from the ruby on rails Mailing list -class XmlNode #:nodoc: - attr :node - - def initialize(node, options = {}) - @node = node - @children = {} - @raise_errors = options[:raise_errors] - end - - def self.from_xml(xml_or_io) - document = REXML::Document.new(xml_or_io) - if document.root - XmlNode.new(document.root) - else - XmlNode.new(document) - end - end - - def node_encoding - @node.encoding - end - - def node_name - @node.name - end - - def node_value - @node.text - end - - def node_value=(value) - @node.text = value - end - - def xpath(expr) - matches = nil - REXML::XPath.each(@node, expr) do |element| - matches ||= XmlNodeList.new - matches << (@children[element] ||= XmlNode.new(element)) - end - matches - end - - def method_missing(name, *args) - name = name.to_s - nodes = nil - @node.each_element(name) do |element| - nodes ||= XmlNodeList.new - nodes << (@children[element] ||= XmlNode.new(element)) - end - nodes - end - - def <<(node) - if node.is_a? REXML::Node - child = node - elsif node.respond_to? :node - child = node.node - end - @node.add_element child - @children[child] ||= XmlNode.new(child) - end - - def [](name) - @node.attributes[name.to_s] - end - - def []=(name, value) - @node.attributes[name.to_s] = value - end - - def to_s - @node.to_s - end - - def to_i - to_s.to_i - end -end - -class XmlNodeList < Array #:nodoc: - def [](i) - i.is_a?(String) ? super(0)[i] : super(i) - end - - def []=(i, value) - i.is_a?(String) ? self[0][i] = value : super(i, value) - end - - def method_missing(name, *args) - name = name.to_s - self[0].__send__(name, *args) - end -end# = XmlSimple -# -# Author:: Maik Schmidt -# Copyright:: Copyright (c) 2003 Maik Schmidt -# License:: Distributes under the same terms as Ruby. -# -require 'rexml/document' - -# Easy API to maintain XML (especially configuration files). -class XmlSimple #:nodoc: - include REXML - - @@VERSION = '1.0.2' - - # A simple cache for XML documents that were already transformed - # by xml_in. - class Cache #:nodoc: - # Creates and initializes a new Cache object. - def initialize - @mem_share_cache = {} - @mem_copy_cache = {} - end - - # Saves a data structure into a file. - # - # data:: - # Data structure to be saved. - # filename:: - # Name of the file belonging to the data structure. - def save_storable(data, filename) - cache_file = get_cache_filename(filename) - File.open(cache_file, "w+") { |f| Marshal.dump(data, f) } - end - - # Restores a data structure from a file. If restoring the data - # structure failed for any reason, nil will be returned. - # - # filename:: - # Name of the file belonging to the data structure. - def restore_storable(filename) - cache_file = get_cache_filename(filename) - return nil unless File::exist?(cache_file) - return nil unless File::mtime(cache_file).to_i > File::mtime(filename).to_i - data = nil - File.open(cache_file) { |f| data = Marshal.load(f) } - data - end - - # Saves a data structure in a shared memory cache. - # - # data:: - # Data structure to be saved. - # filename:: - # Name of the file belonging to the data structure. - def save_mem_share(data, filename) - @mem_share_cache[filename] = [Time::now.to_i, data] - end - - # Restores a data structure from a shared memory cache. You - # should consider these elements as "read only". If restoring - # the data structure failed for any reason, nil will be - # returned. - # - # filename:: - # Name of the file belonging to the data structure. - def restore_mem_share(filename) - get_from_memory_cache(filename, @mem_share_cache) - end - - # Copies a data structure to a memory cache. - # - # data:: - # Data structure to be copied. - # filename:: - # Name of the file belonging to the data structure. - def save_mem_copy(data, filename) - @mem_share_cache[filename] = [Time::now.to_i, Marshal.dump(data)] - end - - # Restores a data structure from a memory cache. If restoring - # the data structure failed for any reason, nil will be - # returned. - # - # filename:: - # Name of the file belonging to the data structure. - def restore_mem_copy(filename) - data = get_from_memory_cache(filename, @mem_share_cache) - data = Marshal.load(data) unless data.nil? - data - end - - private - - # Returns the "cache filename" belonging to a filename, i.e. - # the extension '.xml' in the original filename will be replaced - # by '.stor'. If filename does not have this extension, '.stor' - # will be appended. - # - # filename:: - # Filename to get "cache filename" for. - def get_cache_filename(filename) - filename.sub(/(\.xml)?$/, '.stor') - end - - # Returns a cache entry from a memory cache belonging to a - # certain filename. If no entry could be found for any reason, - # nil will be returned. - # - # filename:: - # Name of the file the cache entry belongs to. - # cache:: - # Memory cache to get entry from. - def get_from_memory_cache(filename, cache) - return nil unless cache[filename] - return nil unless cache[filename][0] > File::mtime(filename).to_i - return cache[filename][1] - end - end - - # Create a "global" cache. - @@cache = Cache.new - - # Creates and intializes a new XmlSimple object. - # - # defaults:: - # Default values for options. - def initialize(defaults = nil) - unless defaults.nil? || defaults.instance_of?(Hash) - raise ArgumentError, "Options have to be a Hash." - end - @default_options = normalize_option_names(defaults, KNOWN_OPTIONS['in'] & KNOWN_OPTIONS['out']) - @options = Hash.new - @_var_values = nil - end - - # Converts an XML document in the same way as the Perl module XML::Simple. - # - # string:: - # XML source. Could be one of the following: - # - # - nil: Tries to load and parse '.xml'. - # - filename: Tries to load and parse filename. - # - IO object: Reads from object until EOF is detected and parses result. - # - XML string: Parses string. - # - # options:: - # Options to be used. - def xml_in(string = nil, options = nil) - handle_options('in', options) - - # If no XML string or filename was supplied look for scriptname.xml. - if string.nil? - string = File::basename($0) - string.sub!(/\.[^.]+$/, '') - string += '.xml' - - directory = File::dirname($0) - @options['searchpath'].unshift(directory) unless directory.nil? - end - - if string.instance_of?(String) - if string =~ /<.*?>/m - @doc = parse(string) - elsif string == '-' - @doc = parse($stdin.readlines.to_s) - else - filename = find_xml_file(string, @options['searchpath']) - - if @options.has_key?('cache') - @options['cache'].each { |scheme| - case(scheme) - when 'storable' - content = @@cache.restore_storable(filename) - when 'mem_share' - content = @@cache.restore_mem_share(filename) - when 'mem_copy' - content = @@cache.restore_mem_copy(filename) - else - raise ArgumentError, "Unsupported caching scheme: <#{scheme}>." - end - return content if content - } - end - - @doc = load_xml_file(filename) - end - elsif string.kind_of?(IO) - @doc = parse(string.readlines.to_s) - else - raise ArgumentError, "Could not parse object of type: <#{string.type}>." - end - - result = collapse(@doc.root) - result = @options['keeproot'] ? merge({}, @doc.root.name, result) : result - put_into_cache(result, filename) - result - end - - # This is the functional version of the instance method xml_in. - def XmlSimple.xml_in(string = nil, options = nil) - xml_simple = XmlSimple.new - xml_simple.xml_in(string, options) - end - - # Converts a data structure into an XML document. - # - # ref:: - # Reference to data structure to be converted into XML. - # options:: - # Options to be used. - def xml_out(ref, options = nil) - handle_options('out', options) - if ref.instance_of?(Array) - ref = { @options['anonymoustag'] => ref } - end - - if @options['keeproot'] - keys = ref.keys - if keys.size == 1 - ref = ref[keys[0]] - @options['rootname'] = keys[0] - end - elsif @options['rootname'] == '' - if ref.instance_of?(Hash) - refsave = ref - ref = {} - refsave.each { |key, value| - if !scalar(value) - ref[key] = value - else - ref[key] = [ value.to_s ] - end - } - end - end - - @ancestors = [] - xml = value_to_xml(ref, @options['rootname'], '') - @ancestors = nil - - if @options['xmldeclaration'] - xml = @options['xmldeclaration'] + "\n" + xml - end - - if @options.has_key?('outputfile') - if @options['outputfile'].kind_of?(IO) - return @options['outputfile'].write(xml) - else - File.open(@options['outputfile'], "w") { |file| file.write(xml) } - end - end - xml - end - - # This is the functional version of the instance method xml_out. - def XmlSimple.xml_out(hash, options = nil) - xml_simple = XmlSimple.new - xml_simple.xml_out(hash, options) - end - - private - - # Declare options that are valid for xml_in and xml_out. - KNOWN_OPTIONS = { - 'in' => %w( - keyattr keeproot forcecontent contentkey noattr - searchpath forcearray suppressempty anonymoustag - cache grouptags normalisespace normalizespace - variables varattr - ), - 'out' => %w( - keyattr keeproot contentkey noattr rootname - xmldeclaration outputfile noescape suppressempty - anonymoustag indent grouptags noindent - ) - } - - # Define some reasonable defaults. - DEF_KEY_ATTRIBUTES = [] - DEF_ROOT_NAME = 'opt' - DEF_CONTENT_KEY = 'content' - DEF_XML_DECLARATION = "" - DEF_ANONYMOUS_TAG = 'anon' - DEF_FORCE_ARRAY = true - DEF_INDENTATION = ' ' - - # Normalizes option names in a hash, i.e., turns all - # characters to lower case and removes all underscores. - # Additionally, this method checks, if an unknown option - # was used and raises an according exception. - # - # options:: - # Hash to be normalized. - # known_options:: - # List of known options. - def normalize_option_names(options, known_options) - return nil if options.nil? - result = Hash.new - options.each { |key, value| - lkey = key.downcase - lkey.gsub!(/_/, '') - if !known_options.member?(lkey) - raise ArgumentError, "Unrecognised option: #{lkey}." - end - result[lkey] = value - } - result - end - - # Merges a set of options with the default options. - # - # direction:: - # 'in': If options should be handled for xml_in. - # 'out': If options should be handled for xml_out. - # options:: - # Options to be merged with the default options. - def handle_options(direction, options) - @options = options || Hash.new - - raise ArgumentError, "Options must be a Hash!" unless @options.instance_of?(Hash) - - unless KNOWN_OPTIONS.has_key?(direction) - raise ArgumentError, "Unknown direction: <#{direction}>." - end - - known_options = KNOWN_OPTIONS[direction] - @options = normalize_option_names(@options, known_options) - - unless @default_options.nil? - known_options.each { |option| - unless @options.has_key?(option) - if @default_options.has_key?(option) - @options[option] = @default_options[option] - end - end - } - end - - unless @options.has_key?('noattr') - @options['noattr'] = false - end - - if @options.has_key?('rootname') - @options['rootname'] = '' if @options['rootname'].nil? - else - @options['rootname'] = DEF_ROOT_NAME - end - - if @options.has_key?('xmldeclaration') && @options['xmldeclaration'] == true - @options['xmldeclaration'] = DEF_XML_DECLARATION - end - - if @options.has_key?('contentkey') - if @options['contentkey'] =~ /^-(.*)$/ - @options['contentkey'] = $1 - @options['collapseagain'] = true - end - else - @options['contentkey'] = DEF_CONTENT_KEY - end - - unless @options.has_key?('normalisespace') - @options['normalisespace'] = @options['normalizespace'] - end - @options['normalisespace'] = 0 if @options['normalisespace'].nil? - - if @options.has_key?('searchpath') - unless @options['searchpath'].instance_of?(Array) - @options['searchpath'] = [ @options['searchpath'] ] - end - else - @options['searchpath'] = [] - end - - if @options.has_key?('cache') && scalar(@options['cache']) - @options['cache'] = [ @options['cache'] ] - end - - @options['anonymoustag'] = DEF_ANONYMOUS_TAG unless @options.has_key?('anonymoustag') - - if !@options.has_key?('indent') || @options['indent'].nil? - @options['indent'] = DEF_INDENTATION - end - - @options['indent'] = '' if @options.has_key?('noindent') - - # Special cleanup for 'keyattr' which could be an array or - # a hash or left to default to array. - if @options.has_key?('keyattr') - if !scalar(@options['keyattr']) - # Convert keyattr => { elem => '+attr' } - # to keyattr => { elem => ['attr', '+'] } - if @options['keyattr'].instance_of?(Hash) - @options['keyattr'].each { |key, value| - if value =~ /^([-+])?(.*)$/ - @options['keyattr'][key] = [$2, $1 ? $1 : ''] - end - } - elsif !@options['keyattr'].instance_of?(Array) - raise ArgumentError, "'keyattr' must be String, Hash, or Array!" - end - else - @options['keyattr'] = [ @options['keyattr'] ] - end - else - @options['keyattr'] = DEF_KEY_ATTRIBUTES - end - - if @options.has_key?('forcearray') - if @options['forcearray'].instance_of?(Regexp) - @options['forcearray'] = [ @options['forcearray'] ] - end - - if @options['forcearray'].instance_of?(Array) - force_list = @options['forcearray'] - unless force_list.empty? - @options['forcearray'] = {} - force_list.each { |tag| - if tag.instance_of?(Regexp) - unless @options['forcearray']['_regex'].instance_of?(Array) - @options['forcearray']['_regex'] = [] - end - @options['forcearray']['_regex'] << tag - else - @options['forcearray'][tag] = true - end - } - else - @options['forcearray'] = false - end - else - @options['forcearray'] = @options['forcearray'] ? true : false - end - else - @options['forcearray'] = DEF_FORCE_ARRAY - end - - if @options.has_key?('grouptags') && !@options['grouptags'].instance_of?(Hash) - raise ArgumentError, "Illegal value for 'GroupTags' option - expected a Hash." - end - - if @options.has_key?('variables') && !@options['variables'].instance_of?(Hash) - raise ArgumentError, "Illegal value for 'Variables' option - expected a Hash." - end - - if @options.has_key?('variables') - @_var_values = @options['variables'] - elsif @options.has_key?('varattr') - @_var_values = {} - end - end - - # Actually converts an XML document element into a data structure. - # - # element:: - # The document element to be collapsed. - def collapse(element) - result = @options['noattr'] ? {} : get_attributes(element) - - if @options['normalisespace'] == 2 - result.each { |k, v| result[k] = normalise_space(v) } - end - - if element.has_elements? - element.each_element { |child| - value = collapse(child) - if empty(value) && (element.attributes.empty? || @options['noattr']) - next if @options.has_key?('suppressempty') && @options['suppressempty'] == true - end - result = merge(result, child.name, value) - } - if has_mixed_content?(element) - # normalisespace? - content = element.texts.map { |x| x.to_s } - content = content[0] if content.size == 1 - result[@options['contentkey']] = content - end - elsif element.has_text? # i.e. it has only text. - return collapse_text_node(result, element) - end - - # Turn Arrays into Hashes if key fields present. - count = fold_arrays(result) - - # Disintermediate grouped tags. - if @options.has_key?('grouptags') - result.each { |key, value| - next unless (value.instance_of?(Hash) && (value.size == 1)) - child_key, child_value = value.to_a[0] - if @options['grouptags'][key] == child_key - result[key] = child_value - end - } - end - - # Fold Hases containing a single anonymous Array up into just the Array. - if count == 1 - anonymoustag = @options['anonymoustag'] - if result.has_key?(anonymoustag) && result[anonymoustag].instance_of?(Array) - return result[anonymoustag] - end - end - - if result.empty? && @options.has_key?('suppressempty') - return @options['suppressempty'] == '' ? '' : nil - end - - result - end - - # Collapses a text node and merges it with an existing Hash, if - # possible. - # Thanks to Curtis Schofield for reporting a subtle bug. - # - # hash:: - # Hash to merge text node value with, if possible. - # element:: - # Text node to be collapsed. - def collapse_text_node(hash, element) - value = node_to_text(element) - if empty(value) && !element.has_attributes? - return {} - end - - if element.has_attributes? && !@options['noattr'] - return merge(hash, @options['contentkey'], value) - else - if @options['forcecontent'] - return merge(hash, @options['contentkey'], value) - else - return value - end - end - end - - # Folds all arrays in a Hash. - # - # hash:: - # Hash to be folded. - def fold_arrays(hash) - fold_amount = 0 - keyattr = @options['keyattr'] - if (keyattr.instance_of?(Array) || keyattr.instance_of?(Hash)) - hash.each { |key, value| - if value.instance_of?(Array) - if keyattr.instance_of?(Array) - hash[key] = fold_array(value) - else - hash[key] = fold_array_by_name(key, value) - end - fold_amount += 1 - end - } - end - fold_amount - end - - # Folds an Array to a Hash, if possible. Folding happens - # according to the content of keyattr, which has to be - # an array. - # - # array:: - # Array to be folded. - def fold_array(array) - hash = Hash.new - array.each { |x| - return array unless x.instance_of?(Hash) - key_matched = false - @options['keyattr'].each { |key| - if x.has_key?(key) - key_matched = true - value = x[key] - return array if value.instance_of?(Hash) || value.instance_of?(Array) - value = normalise_space(value) if @options['normalisespace'] == 1 - x.delete(key) - hash[value] = x - break - end - } - return array unless key_matched - } - hash = collapse_content(hash) if @options['collapseagain'] - hash - end - - # Folds an Array to a Hash, if possible. Folding happens - # according to the content of keyattr, which has to be - # a Hash. - # - # name:: - # Name of the attribute to be folded upon. - # array:: - # Array to be folded. - def fold_array_by_name(name, array) - return array unless @options['keyattr'].has_key?(name) - key, flag = @options['keyattr'][name] - - hash = Hash.new - array.each { |x| - if x.instance_of?(Hash) && x.has_key?(key) - value = x[key] - return array if value.instance_of?(Hash) || value.instance_of?(Array) - value = normalise_space(value) if @options['normalisespace'] == 1 - hash[value] = x - hash[value]["-#{key}"] = hash[value][key] if flag == '-' - hash[value].delete(key) unless flag == '+' - else - $stderr.puts("Warning: <#{name}> element has no '#{key}' attribute.") - return array - end - } - hash = collapse_content(hash) if @options['collapseagain'] - hash - end - - # Tries to collapse a Hash even more ;-) - # - # hash:: - # Hash to be collapsed again. - def collapse_content(hash) - content_key = @options['contentkey'] - hash.each_value { |value| - return hash unless value.instance_of?(Hash) && value.size == 1 && value.has_key?(content_key) - hash.each_key { |key| hash[key] = hash[key][content_key] } - } - hash - end - - # Adds a new key/value pair to an existing Hash. If the key to be added - # does already exist and the existing value associated with key is not - # an Array, it will be converted into an Array. Then the new value is - # appended to that Array. - # - # hash:: - # Hash to add key/value pair to. - # key:: - # Key to be added. - # value:: - # Value to be associated with key. - def merge(hash, key, value) - if value.instance_of?(String) - value = normalise_space(value) if @options['normalisespace'] == 2 - - # do variable substitutions - unless @_var_values.nil? || @_var_values.empty? - value.gsub!(/\$\{(\w+)\}/) { |x| get_var($1) } - end - - # look for variable definitions - if @options.has_key?('varattr') - varattr = @options['varattr'] - if hash.has_key?(varattr) - set_var(hash[varattr], value) - end - end - end - if hash.has_key?(key) - if hash[key].instance_of?(Array) - hash[key] << value - else - hash[key] = [ hash[key], value ] - end - elsif value.instance_of?(Array) # Handle anonymous arrays. - hash[key] = [ value ] - else - if force_array?(key) - hash[key] = [ value ] - else - hash[key] = value - end - end - hash - end - - # Checks, if the 'forcearray' option has to be used for - # a certain key. - def force_array?(key) - return false if key == @options['contentkey'] - return true if @options['forcearray'] == true - forcearray = @options['forcearray'] - if forcearray.instance_of?(Hash) - return true if forcearray.has_key?(key) - return false unless forcearray.has_key?('_regex') - forcearray['_regex'].each { |x| return true if key =~ x } - end - return false - end - - # Converts the attributes array of a document node into a Hash. - # Returns an empty Hash, if node has no attributes. - # - # node:: - # Document node to extract attributes from. - def get_attributes(node) - attributes = {} - node.attributes.each { |n,v| attributes[n] = v } - attributes - end - - # Determines, if a document element has mixed content. - # - # element:: - # Document element to be checked. - def has_mixed_content?(element) - if element.has_text? && element.has_elements? - return true if element.texts.join('') !~ /^\s*$/s - end - false - end - - # Called when a variable definition is encountered in the XML. - # A variable definition looks like - # value - # where attrname matches the varattr setting. - def set_var(name, value) - @_var_values[name] = value - end - - # Called during variable substitution to get the value for the - # named variable. - def get_var(name) - if @_var_values.has_key?(name) - return @_var_values[name] - else - return "${#{name}}" - end - end - - # Recurses through a data structure building up and returning an - # XML representation of that structure as a string. - # - # ref:: - # Reference to the data structure to be encoded. - # name:: - # The XML tag name to be used for this item. - # indent:: - # A string of spaces for use as the current indent level. - def value_to_xml(ref, name, indent) - named = !name.nil? && name != '' - nl = @options.has_key?('noindent') ? '' : "\n" - - if !scalar(ref) - if @ancestors.member?(ref) - raise ArgumentError, "Circular data structures not supported!" - end - @ancestors << ref - else - if named - return [indent, '<', name, '>', @options['noescape'] ? ref.to_s : escape_value(ref.to_s), '', nl].join('') - else - return ref.to_s + nl - end - end - - # Unfold hash to array if possible. - if ref.instance_of?(Hash) && !ref.empty? && !@options['keyattr'].empty? && indent != '' - ref = hash_to_array(name, ref) - end - - result = [] - if ref.instance_of?(Hash) - # Reintermediate grouped values if applicable. - if @options.has_key?('grouptags') - ref.each { |key, value| - if @options['grouptags'].has_key?(key) - ref[key] = { @options['grouptags'][key] => value } - end - } - end - - nested = [] - text_content = nil - if named - result << indent << '<' << name - end - - if !ref.empty? - ref.each { |key, value| - next if !key.nil? && key[0, 1] == '-' - if value.nil? - unless @options.has_key?('suppressempty') && @options['suppressempty'].nil? - raise ArgumentError, "Use of uninitialized value!" - end - value = {} - end - - if !scalar(value) || @options['noattr'] - nested << value_to_xml(value, key, indent + @options['indent']) - else - value = value.to_s - value = escape_value(value) unless @options['noescape'] - if key == @options['contentkey'] - text_content = value - else - result << ' ' << key << '="' << value << '"' - end - end - } - else - text_content = '' - end - - if !nested.empty? || !text_content.nil? - if named - result << '>' - if !text_content.nil? - result << text_content - nested[0].sub!(/^\s+/, '') if !nested.empty? - else - result << nl - end - if !nested.empty? - result << nested << indent - end - result << '' << nl - else - result << nested - end - else - result << ' />' << nl - end - elsif ref.instance_of?(Array) - ref.each { |value| - if scalar(value) - result << indent << '<' << name << '>' - result << (@options['noescape'] ? value.to_s : escape_value(value.to_s)) - result << '' << nl - elsif value.instance_of?(Hash) - result << value_to_xml(value, name, indent) - else - result << indent << '<' << name << '>' << nl - result << value_to_xml(value, @options['anonymoustag'], indent + @options['indent']) - result << indent << '' << nl - end - } - else - # Probably, this is obsolete. - raise ArgumentError, "Can't encode a value of type: #{ref.type}." - end - @ancestors.pop if !scalar(ref) - result.join('') - end - - # Checks, if a certain value is a "scalar" value. Whatever - # that will be in Ruby ... ;-) - # - # value:: - # Value to be checked. - def scalar(value) - return false if value.instance_of?(Hash) || value.instance_of?(Array) - return true - end - - # Attempts to unfold a hash of hashes into an array of hashes. Returns - # a reference to th array on success or the original hash, if unfolding - # is not possible. - # - # parent:: - # - # hashref:: - # Reference to the hash to be unfolded. - def hash_to_array(parent, hashref) - arrayref = [] - hashref.each { |key, value| - return hashref unless value.instance_of?(Hash) - - if @options['keyattr'].instance_of?(Hash) - return hashref unless @options['keyattr'].has_key?(parent) - arrayref << { @options['keyattr'][parent][0] => key }.update(value) - else - arrayref << { @options['keyattr'][0] => key }.update(value) - end - } - arrayref - end - - # Replaces XML markup characters by their external entities. - # - # data:: - # The string to be escaped. - def escape_value(data) - return data if data.nil? || data == '' - result = data.dup - result.gsub!('&', '&') - result.gsub!('<', '<') - result.gsub!('>', '>') - result.gsub!('"', '"') - result.gsub!("'", ''') - result - end - - # Removes leading and trailing whitespace and sequences of - # whitespaces from a string. - # - # text:: - # String to be normalised. - def normalise_space(text) - text.sub!(/^\s+/, '') - text.sub!(/\s+$/, '') - text.gsub!(/\s\s+/, ' ') - text - end - - # Checks, if an object is nil, an empty String or an empty Hash. - # Thanks to Norbert Gawor for a bugfix. - # - # value:: - # Value to be checked for emptyness. - def empty(value) - case value - when Hash - return value.empty? - when String - return value !~ /\S/m - else - return value.nil? - end - end - - # Converts a document node into a String. - # If the node could not be converted into a String - # for any reason, default will be returned. - # - # node:: - # Document node to be converted. - # default:: - # Value to be returned, if node could not be converted. - def node_to_text(node, default = nil) - if node.instance_of?(Element) - return node.texts.join('') - elsif node.instance_of?(Attribute) - return node.value.nil? ? default : node.value.strip - elsif node.instance_of?(Text) - return node.to_s.strip - else - return default - end - end - - # Parses an XML string and returns the according document. - # - # xml_string:: - # XML string to be parsed. - # - # The following exception may be raised: - # - # REXML::ParseException:: - # If the specified file is not wellformed. - def parse(xml_string) - Document.new(xml_string) - end - - # Searches in a list of paths for a certain file. Returns - # the full path to the file, if it could be found. Otherwise, - # an exception will be raised. - # - # filename:: - # Name of the file to search for. - # searchpath:: - # List of paths to search in. - def find_xml_file(file, searchpath) - filename = File::basename(file) - - if filename != file - return file if File::file?(file) - else - searchpath.each { |path| - full_path = File::join(path, filename) - return full_path if File::file?(full_path) - } - end - - if searchpath.empty? - return file if File::file?(file) - raise ArgumentError, "File does not exist: #{file}." - end - raise ArgumentError, "Could not find <#{filename}> in <#{searchpath.join(':')}>" - end - - # Loads and parses an XML configuration file. - # - # filename:: - # Name of the configuration file to be loaded. - # - # The following exceptions may be raised: - # - # Errno::ENOENT:: - # If the specified file does not exist. - # REXML::ParseException:: - # If the specified file is not wellformed. - def load_xml_file(filename) - parse(File.readlines(filename).to_s) - end - - # Caches the data belonging to a certain file. - # - # data:: - # Data to be cached. - # filename:: - # Name of file the data was read from. - def put_into_cache(data, filename) - if @options.has_key?('cache') - @options['cache'].each { |scheme| - case(scheme) - when 'storable' - @@cache.save_storable(data, filename) - when 'mem_share' - @@cache.save_mem_share(data, filename) - when 'mem_copy' - @@cache.save_mem_copy(data, filename) - else - raise ArgumentError, "Unsupported caching scheme: <#{scheme}>." - end - } - end - end -end - -# vim:sw=2 -module ActionController #:nodoc: - module Verification #:nodoc: - def self.append_features(base) #:nodoc: - super - base.extend(ClassMethods) - end - - # This module provides a class-level method for specifying that certain - # actions are guarded against being called without certain prerequisites - # being met. This is essentially a special kind of before_filter. - # - # An action may be guarded against being invoked without certain request - # parameters being set, or without certain session values existing. - # - # When a verification is violated, values may be inserted into the flash, and - # a specified redirection is triggered. - # - # Usage: - # - # class GlobalController < ActionController::Base - # # prevent the #update_settings action from being invoked unless - # # the 'admin_privileges' request parameter exists. - # verify :params => "admin_privileges", :only => :update_post, - # :redirect_to => { :action => "settings" } - # - # # disallow a post from being updated if there was no information - # # submitted with the post, and if there is no active post in the - # # session, and if there is no "note" key in the flash. - # verify :params => "post", :session => "post", "flash" => "note", - # :only => :update_post, - # :add_flash => { "alert" => "Failed to create your message" }, - # :redirect_to => :category_url - # - module ClassMethods - # Verify the given actions so that if certain prerequisites are not met, - # the user is redirected to a different action. The +options+ parameter - # is a hash consisting of the following key/value pairs: - # - # * :params: a single key or an array of keys that must - # be in the params hash in order for the action(s) to be safely - # called. - # * :session: a single key or an array of keys that must - # be in the @session in order for the action(s) to be safely called. - # * :flash: a single key or an array of keys that must - # be in the flash in order for the action(s) to be safely called. - # * :method: a single key or an array of keys--any one of which - # must match the current request method in order for the action(s) to - # be safely called. (The key should be a symbol: :get or - # :post, for example.) - # * :xhr: true/false option to ensure that the request is coming - # from an Ajax call or not. - # * :add_flash: a hash of name/value pairs that should be merged - # into the session's flash if the prerequisites cannot be satisfied. - # * :redirect_to: the redirection parameters to be used when - # redirecting if the prerequisites cannot be satisfied. - # * :render: the render parameters to be used when - # the prerequisites cannot be satisfied. - # * :only: only apply this verification to the actions specified - # in the associated array (may also be a single value). - # * :except: do not apply this verification to the actions - # specified in the associated array (may also be a single value). - def verify(options={}) - filter_opts = { :only => options[:only], :except => options[:except] } - before_filter(filter_opts) do |c| - c.send :verify_action, options - end - end - end - - def verify_action(options) #:nodoc: - prereqs_invalid = - [*options[:params] ].find { |v| @params[v].nil? } || - [*options[:session]].find { |v| @session[v].nil? } || - [*options[:flash] ].find { |v| flash[v].nil? } - - if !prereqs_invalid && options[:method] - prereqs_invalid ||= - [*options[:method]].all? { |v| @request.method != v.to_sym } - end - - prereqs_invalid ||= (request.xhr? != options[:xhr]) unless options[:xhr].nil? - - if prereqs_invalid - flash.update(options[:add_flash]) if options[:add_flash] - unless performed? - render(options[:render]) if options[:render] - redirect_to(options[:redirect_to]) if options[:redirect_to] - end - return false - end - - true - end - private :verify_action - end -end -#-- -# Copyright (c) 2004 David Heinemeier Hansson -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#++ - -$:.unshift(File.dirname(__FILE__)) unless - $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) - -unless defined?(ActiveSupport) - begin - $:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib") - require 'active_support' - rescue LoadError - require 'rubygems' - require_gem 'activesupport' - end -end - -require 'action_controller/base' -require 'action_controller/deprecated_redirects' -require 'action_controller/request' -require 'action_controller/deprecated_request_methods' -require 'action_controller/rescue' -require 'action_controller/benchmarking' -require 'action_controller/flash' -require 'action_controller/filters' -require 'action_controller/layout' -require 'action_controller/dependencies' -require 'action_controller/mime_responds' -require 'action_controller/pagination' -require 'action_controller/scaffolding' -require 'action_controller/helpers' -require 'action_controller/cookies' -require 'action_controller/cgi_process' -require 'action_controller/caching' -require 'action_controller/verification' -require 'action_controller/streaming' -require 'action_controller/session_management' -require 'action_controller/components' -require 'action_controller/macros/auto_complete' -require 'action_controller/macros/in_place_editing' - -require 'action_view' -ActionController::Base.template_class = ActionView::Base - -ActionController::Base.class_eval do - include ActionController::Flash - include ActionController::Filters - include ActionController::Layout - include ActionController::Benchmarking - include ActionController::Rescue - include ActionController::Dependencies - include ActionController::MimeResponds - include ActionController::Pagination - include ActionController::Scaffolding - include ActionController::Helpers - include ActionController::Cookies - include ActionController::Caching - include ActionController::Verification - include ActionController::Streaming - include ActionController::SessionManagement - include ActionController::Components - include ActionController::Macros::AutoComplete - include ActionController::Macros::InPlaceEditing -end -module ActionPack #:nodoc: - module VERSION #:nodoc: - MAJOR = 1 - MINOR = 12 - TINY = 5 - - STRING = [MAJOR, MINOR, TINY].join('.') - end -end -#-- -# Copyright (c) 2004 David Heinemeier Hansson -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#++ - -require 'action_pack/version' -require 'erb' - -module ActionView #:nodoc: - - class ActionViewError < StandardError #:nodoc: - end - - # Action View templates can be written in three ways. If the template file has a +.rhtml+ extension then it uses a mixture of ERb - # (included in Ruby) and HTML. If the template file has a +.rxml+ extension then Jim Weirich's Builder::XmlMarkup library is used. - # If the template file has a +.rjs+ extension then it will use ActionView::Helpers::PrototypeHelper::JavaScriptGenerator. - # - # = ERb - # - # You trigger ERb by using embeddings such as <% %>, <% -%>, and <%= %>. The <%= %> tag set is used when you want output. Consider the - # following loop for names: - # - # Names of all the people - # <% for person in @people %> - # Name: <%= person.name %>
    - # <% end %> - # - # The loop is setup in regular embedding tags <% %> and the name is written using the output embedding tag <%= %>. Note that this - # is not just a usage suggestion. Regular output functions like print or puts won't work with ERb templates. So this would be wrong: - # - # Hi, Mr. <% puts "Frodo" %> - # - # If you absolutely must write from within a function, you can use the TextHelper#concat - # - # <%- and -%> suppress leading and trailing whitespace, including the trailing newline, and can be used interchangeably with <% and %>. - # - # == Using sub templates - # - # Using sub templates allows you to sidestep tedious replication and extract common display structures in shared templates. The - # classic example is the use of a header and footer (even though the Action Pack-way would be to use Layouts): - # - # <%= render "shared/header" %> - # Something really specific and terrific - # <%= render "shared/footer" %> - # - # As you see, we use the output embeddings for the render methods. The render call itself will just return a string holding the - # result of the rendering. The output embedding writes it to the current template. - # - # But you don't have to restrict yourself to static includes. Templates can share variables amongst themselves by using instance - # variables defined using the regular embedding tags. Like this: - # - # <% @page_title = "A Wonderful Hello" %> - # <%= render "shared/header" %> - # - # Now the header can pick up on the @page_title variable and use it for outputting a title tag: - # - # <%= @page_title %> - # - # == Passing local variables to sub templates - # - # You can pass local variables to sub templates by using a hash with the variable names as keys and the objects as values: - # - # <%= render "shared/header", { "headline" => "Welcome", "person" => person } %> - # - # These can now be accessed in shared/header with: - # - # Headline: <%= headline %> - # First name: <%= person.first_name %> - # - # == Template caching - # - # By default, Rails will compile each template to a method in order to render it. When you alter a template, Rails will - # check the file's modification time and recompile it. - # - # == Builder - # - # Builder templates are a more programmatic alternative to ERb. They are especially useful for generating XML content. An +XmlMarkup+ object - # named +xml+ is automatically made available to templates with a +.rxml+ extension. - # - # Here are some basic examples: - # - # xml.em("emphasized") # => emphasized - # xml.em { xml.b("emp & bold") } # => emph & bold - # xml.a("A Link", "href"=>"http://onestepback.org") # => A Link - # xml.target("name"=>"compile", "option"=>"fast") # => - # # NOTE: order of attributes is not specified. - # - # Any method with a block will be treated as an XML markup tag with nested markup in the block. For example, the following: - # - # xml.div { - # xml.h1(@person.name) - # xml.p(@person.bio) - # } - # - # would produce something like: - # - #
    - #

    David Heinemeier Hansson

    - #

    A product of Danish Design during the Winter of '79...

    - #
    - # - # A full-length RSS example actually used on Basecamp: - # - # xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do - # xml.channel do - # xml.title(@feed_title) - # xml.link(@url) - # xml.description "Basecamp: Recent items" - # xml.language "en-us" - # xml.ttl "40" - # - # for item in @recent_items - # xml.item do - # xml.title(item_title(item)) - # xml.description(item_description(item)) if item_description(item) - # xml.pubDate(item_pubDate(item)) - # xml.guid(@person.firm.account.url + @recent_items.url(item)) - # xml.link(@person.firm.account.url + @recent_items.url(item)) - # - # xml.tag!("dc:creator", item.author_name) if item_has_creator?(item) - # end - # end - # end - # end - # - # More builder documentation can be found at http://builder.rubyforge.org. - # - # == JavaScriptGenerator - # - # JavaScriptGenerator templates end in +.rjs+. Unlike conventional templates which are used to - # render the results of an action, these templates generate instructions on how to modify an already rendered page. This makes it easy to - # modify multiple elements on your page in one declarative Ajax response. Actions with these templates are called in the background with Ajax - # and make updates to the page where the request originated from. - # - # An instance of the JavaScriptGenerator object named +page+ is automatically made available to your template, which is implicitly wrapped in an ActionView::Helpers::PrototypeHelper#update_page block. - # - # When an .rjs action is called with +link_to_remote+, the generated JavaScript is automatically evaluated. Example: - # - # link_to_remote :url => {:action => 'delete'} - # - # The subsequently rendered +delete.rjs+ might look like: - # - # page.replace_html 'sidebar', :partial => 'sidebar' - # page.remove "person-#{@person.id}" - # page.visual_effect :highlight, 'user-list' - # - # This refreshes the sidebar, removes a person element and highlights the user list. - # - # See the ActionView::Helpers::PrototypeHelper::JavaScriptGenerator documentation for more details. - class Base - include ERB::Util - - attr_reader :first_render - attr_accessor :base_path, :assigns, :template_extension - attr_accessor :controller - - attr_reader :logger, :params, :request, :response, :session, :headers, :flash - - # Specify trim mode for the ERB compiler. Defaults to '-'. - # See ERB documentation for suitable values. - @@erb_trim_mode = '-' - cattr_accessor :erb_trim_mode - - # Specify whether file modification times should be checked to see if a template needs recompilation - @@cache_template_loading = false - cattr_accessor :cache_template_loading - - # Specify whether file extension lookup should be cached. - # Should be +false+ for development environments. Defaults to +true+. - @@cache_template_extensions = true - cattr_accessor :cache_template_extensions - - # Specify whether local_assigns should be able to use string keys. - # Defaults to +true+. String keys are deprecated and will be removed - # shortly. - @@local_assigns_support_string_keys = true - cattr_accessor :local_assigns_support_string_keys - - # Specify whether RJS responses should be wrapped in a try/catch block - # that alert()s the caught exception (and then re-raises it). - @@debug_rjs = false - cattr_accessor :debug_rjs - - @@template_handlers = HashWithIndifferentAccess.new - - module CompiledTemplates #:nodoc: - # holds compiled template code - end - include CompiledTemplates - - # maps inline templates to their method names - @@method_names = {} - # map method names to their compile time - @@compile_time = {} - # map method names to the names passed in local assigns so far - @@template_args = {} - # count the number of inline templates - @@inline_template_count = 0 - # maps template paths without extension to their file extension returned by pick_template_extension. - # if for a given path, path.ext1 and path.ext2 exist on the file system, the order of extensions - # used by pick_template_extension determines whether ext1 or ext2 will be stored - @@cached_template_extension = {} - - class ObjectWrapper < Struct.new(:value) #:nodoc: - end - - def self.load_helpers(helper_dir)#:nodoc: - Dir.foreach(helper_dir) do |helper_file| - next unless helper_file =~ /^([a-z][a-z_]*_helper).rb$/ - require File.join(helper_dir, $1) - helper_module_name = $1.camelize - class_eval("include ActionView::Helpers::#{helper_module_name}") if Helpers.const_defined?(helper_module_name) - end - end - - # Register a class that knows how to handle template files with the given - # extension. This can be used to implement new template types. - # The constructor for the class must take the ActiveView::Base instance - # as a parameter, and the class must implement a #render method that - # takes the contents of the template to render as well as the Hash of - # local assigns available to the template. The #render method ought to - # return the rendered template as a string. - def self.register_template_handler(extension, klass) - @@template_handlers[extension] = klass - end - - def initialize(base_path = nil, assigns_for_first_render = {}, controller = nil)#:nodoc: - @base_path, @assigns = base_path, assigns_for_first_render - @assigns_added = nil - @controller = controller - @logger = controller && controller.logger - end - - # Renders the template present at template_path. If use_full_path is set to true, - # it's relative to the template_root, otherwise it's absolute. The hash in local_assigns - # is made available as local variables. - def render_file(template_path, use_full_path = true, local_assigns = {}) #:nodoc: - @first_render ||= template_path - - if use_full_path - template_path_without_extension, template_extension = path_and_extension(template_path) - - if template_extension - template_file_name = full_template_path(template_path_without_extension, template_extension) - else - template_extension = pick_template_extension(template_path).to_s - template_file_name = full_template_path(template_path, template_extension) - end - else - template_file_name = template_path - template_extension = template_path.split('.').last - end - - template_source = nil # Don't read the source until we know that it is required - - begin - render_template(template_extension, template_source, template_file_name, local_assigns) - rescue Exception => e - if TemplateError === e - e.sub_template_of(template_file_name) - raise e - else - raise TemplateError.new(@base_path, template_file_name, @assigns, template_source, e) - end - end - end - - # Renders the template present at template_path (relative to the template_root). - # The hash in local_assigns is made available as local variables. - def render(options = {}, old_local_assigns = {}, &block) #:nodoc: - if options.is_a?(String) - render_file(options, true, old_local_assigns) - elsif options == :update - update_page(&block) - elsif options.is_a?(Hash) - options[:locals] ||= {} - options[:use_full_path] = options[:use_full_path].nil? ? true : options[:use_full_path] - - if options[:file] - render_file(options[:file], options[:use_full_path], options[:locals]) - elsif options[:partial] && options[:collection] - render_partial_collection(options[:partial], options[:collection], options[:spacer_template], options[:locals]) - elsif options[:partial] - render_partial(options[:partial], ActionView::Base::ObjectWrapper.new(options[:object]), options[:locals]) - elsif options[:inline] - render_template(options[:type] || :rhtml, options[:inline], nil, options[:locals] || {}) - end - end - end - - # Renders the +template+ which is given as a string as either rhtml or rxml depending on template_extension. - # The hash in local_assigns is made available as local variables. - def render_template(template_extension, template, file_path = nil, local_assigns = {}) #:nodoc: - if handler = @@template_handlers[template_extension] - template ||= read_template_file(file_path, template_extension) # Make sure that a lazyily-read template is loaded. - delegate_render(handler, template, local_assigns) - else - compile_and_render_template(template_extension, template, file_path, local_assigns) - end - end - - # Render the provided template with the given local assigns. If the template has not been rendered with the provided - # local assigns yet, or if the template has been updated on disk, then the template will be compiled to a method. - # - - # Either, but not both, of template and file_path may be nil. If file_path is given, the template - # will only be read if it has to be compiled. - # - def compile_and_render_template(extension, template = nil, file_path = nil, local_assigns = {}) #:nodoc: - # compile the given template, if necessary - if compile_template?(template, file_path, local_assigns) - template ||= read_template_file(file_path, extension) - compile_template(extension, template, file_path, local_assigns) - end - - # Get the method name for this template and run it - method_name = @@method_names[file_path || template] - evaluate_assigns - - local_assigns = local_assigns.symbolize_keys if @@local_assigns_support_string_keys - - send(method_name, local_assigns) do |*name| - instance_variable_get "@content_for_#{name.first || 'layout'}" - end - end - - def pick_template_extension(template_path)#:nodoc: - if @@cache_template_extensions - @@cached_template_extension[template_path] ||= find_template_extension_for(template_path) - else - find_template_extension_for(template_path) - end - end - - def delegate_template_exists?(template_path)#:nodoc: - @@template_handlers.find { |k,| template_exists?(template_path, k) } - end - - def erb_template_exists?(template_path)#:nodoc: - template_exists?(template_path, :rhtml) - end - - def builder_template_exists?(template_path)#:nodoc: - template_exists?(template_path, :rxml) - end - - def javascript_template_exists?(template_path)#:nodoc: - template_exists?(template_path, :rjs) - end - - def file_exists?(template_path)#:nodoc: - template_file_name, template_file_extension = path_and_extension(template_path) - - if template_file_extension - template_exists?(template_file_name, template_file_extension) - else - cached_template_extension(template_path) || - %w(erb builder javascript delegate).any? do |template_type| - send("#{template_type}_template_exists?", template_path) - end - end - end - - # Returns true is the file may be rendered implicitly. - def file_public?(template_path)#:nodoc: - template_path.split('/').last[0,1] != '_' - end - - private - def full_template_path(template_path, extension) - "#{@base_path}/#{template_path}.#{extension}" - end - - def template_exists?(template_path, extension) - file_path = full_template_path(template_path, extension) - @@method_names.has_key?(file_path) || FileTest.exists?(file_path) - end - - def path_and_extension(template_path) - template_path_without_extension = template_path.sub(/\.(\w+)$/, '') - [ template_path_without_extension, $1 ] - end - - def cached_template_extension(template_path) - @@cache_template_extensions && @@cached_template_extension[template_path] - end - - def find_template_extension_for(template_path) - if match = delegate_template_exists?(template_path) - match.first.to_sym - elsif erb_template_exists?(template_path): :rhtml - elsif builder_template_exists?(template_path): :rxml - elsif javascript_template_exists?(template_path): :rjs - else - raise ActionViewError, "No rhtml, rxml, rjs or delegate template found for #{template_path}" - end - end - - # This method reads a template file. - def read_template_file(template_path, extension) - File.read(template_path) - end - - def evaluate_assigns - unless @assigns_added - assign_variables_from_controller - @assigns_added = true - end - end - - def delegate_render(handler, template, local_assigns) - handler.new(self).render(template, local_assigns) - end - - def assign_variables_from_controller - @assigns.each { |key, value| instance_variable_set("@#{key}", value) } - end - - - # Return true if the given template was compiled for a superset of the keys in local_assigns - def supports_local_assigns?(render_symbol, local_assigns) - local_assigns.empty? || - ((args = @@template_args[render_symbol]) && local_assigns.all? { |k,_| args.has_key?(k) }) - end - - # Check whether compilation is necessary. - # Compile if the inline template or file has not been compiled yet. - # Or if local_assigns has a new key, which isn't supported by the compiled code yet. - # Or if the file has changed on disk and checking file mods hasn't been disabled. - def compile_template?(template, file_name, local_assigns) - method_key = file_name || template - render_symbol = @@method_names[method_key] - - if @@compile_time[render_symbol] && supports_local_assigns?(render_symbol, local_assigns) - if file_name && !@@cache_template_loading - @@compile_time[render_symbol] < File.mtime(file_name) || (File.symlink?(file_name) ? - @@compile_time[render_symbol] < File.lstat(file_name).mtime : false) - end - else - true - end - end - - # Create source code for given template - def create_template_source(extension, template, render_symbol, locals) - if template_requires_setup?(extension) - body = case extension.to_sym - when :rxml - "xml = Builder::XmlMarkup.new(:indent => 2)\n" + - "@controller.headers['Content-Type'] ||= 'application/xml'\n" + - template - when :rjs - "@controller.headers['Content-Type'] ||= 'text/javascript'\n" + - "update_page do |page|\n#{template}\nend" - end - else - body = ERB.new(template, nil, @@erb_trim_mode).src - end - - @@template_args[render_symbol] ||= {} - locals_keys = @@template_args[render_symbol].keys | locals - @@template_args[render_symbol] = locals_keys.inject({}) { |h, k| h[k] = true; h } - - locals_code = "" - locals_keys.each do |key| - locals_code << "#{key} = local_assigns[:#{key}] if local_assigns.has_key?(:#{key})\n" - end - - "def #{render_symbol}(local_assigns)\n#{locals_code}#{body}\nend" - end - - def template_requires_setup?(extension) - templates_requiring_setup.include? extension.to_s - end - - def templates_requiring_setup - %w(rxml rjs) - end - - def assign_method_name(extension, template, file_name) - method_name = '_run_' - method_name << "#{extension}_" if extension - - if file_name - file_path = File.expand_path(file_name) - base_path = File.expand_path(@base_path) - - i = file_path.index(base_path) - l = base_path.length - - method_name_file_part = i ? file_path[i+l+1,file_path.length-l-1] : file_path.clone - method_name_file_part.sub!(/\.r(html|xml|js)$/,'') - method_name_file_part.tr!('/:-', '_') - method_name_file_part.gsub!(/[^a-zA-Z0-9_]/){|s| s[0].to_s} - - method_name += method_name_file_part - else - @@inline_template_count += 1 - method_name << @@inline_template_count.to_s - end - - @@method_names[file_name || template] = method_name.intern - end - - def compile_template(extension, template, file_name, local_assigns) - method_key = file_name || template - - render_symbol = @@method_names[method_key] || assign_method_name(extension, template, file_name) - render_source = create_template_source(extension, template, render_symbol, local_assigns.keys) - - line_offset = @@template_args[render_symbol].size - if extension - case extension.to_sym - when :rxml, :rjs - line_offset += 2 - end - end - - begin - unless file_name.blank? - CompiledTemplates.module_eval(render_source, file_name, -line_offset) - else - CompiledTemplates.module_eval(render_source, 'compiled-template', -line_offset) - end - rescue Object => e - if logger - logger.debug "ERROR: compiling #{render_symbol} RAISED #{e}" - logger.debug "Function body: #{render_source}" - logger.debug "Backtrace: #{e.backtrace.join("\n")}" - end - - raise TemplateError.new(@base_path, method_key, @assigns, template, e) - end - - @@compile_time[render_symbol] = Time.now - # logger.debug "Compiled template #{method_key}\n ==> #{render_symbol}" if logger - end - end -end - -require 'action_view/template_error' - -module ActionView - - # CompiledTemplates modules hold methods that have been compiled. - # Templates are compiled into these methods so that they do not need to be - # re-read and re-parsed each request. - # - # Each template may be compiled into one or more methods. Each method accepts a given - # set of parameters which is used to implement local assigns passing. - # - # To use a compiled template module, create a new instance and include it into the class - # in which you want the template to be rendered. - class CompiledTemplates < Module #:nodoc: - attr_reader :method_names - - def initialize - @method_names = Hash.new do |hash, key| - hash[key] = "__compiled_method_#{(hash.length + 1)}" - end - @mtimes = {} - end - - # Return the full key for the given identifier and argument names - def full_key(identifier, arg_names) - [identifier, arg_names] - end - - # Return the selector for this method or nil if it has not been compiled - def selector(identifier, arg_names) - key = full_key(identifier, arg_names) - method_names.key?(key) ? method_names[key] : nil - end - alias :compiled? :selector - - # Return the time at which the method for the given identifier and argument names was compiled. - def mtime(identifier, arg_names) - @mtimes[full_key(identifier, arg_names)] - end - - # Compile the provided source code for the given argument names and with the given initial line number. - # The identifier should be unique to this source. - # - # The file_name, if provided will appear in backtraces. If not provded, the file_name defaults - # to the identifier. - # - # This method will return the selector for the compiled version of this method. - def compile_source(identifier, arg_names, source, initial_line_number = 0, file_name = nil) - file_name ||= identifier - name = method_names[full_key(identifier, arg_names)] - arg_desc = arg_names.empty? ? '' : "(#{arg_names * ', '})" - fake_file_name = "#{file_name}#{arg_desc}" # Include the arguments for this version (for now) - - method_def = wrap_source(name, arg_names, source) - - begin - module_eval(method_def, fake_file_name, initial_line_number) - @mtimes[full_key(identifier, arg_names)] = Time.now - rescue Object => e - e.blame_file! identifier - raise - end - name - end - - # Wrap the provided source in a def ... end block. - def wrap_source(name, arg_names, source) - "def #{name}(#{arg_names * ', '})\n#{source}\nend" - end - end -end -require 'cgi' -require File.dirname(__FILE__) + '/form_helper' - -module ActionView - class Base - @@field_error_proc = Proc.new{ |html_tag, instance| "
    #{html_tag}
    " } - cattr_accessor :field_error_proc - end - - module Helpers - # The Active Record Helper makes it easier to create forms for records kept in instance variables. The most far-reaching is the form - # method that creates a complete form for all the basic content types of the record (not associations or aggregations, though). This - # is a great of making the record quickly available for editing, but likely to prove lackluster for a complicated real-world form. - # In that case, it's better to use the input method and the specialized form methods in link:classes/ActionView/Helpers/FormHelper.html - module ActiveRecordHelper - # Returns a default input tag for the type of object returned by the method. Example - # (title is a VARCHAR column and holds "Hello World"): - # input("post", "title") => - # - def input(record_name, method, options = {}) - InstanceTag.new(record_name, method, self).to_tag(options) - end - - # Returns an entire form with input tags and everything for a specified Active Record object. Example - # (post is a new record that has a title using VARCHAR and a body using TEXT): - # form("post") => - #
    - #

    - #
    - # - #

    - #

    - #
    - # - #

    - # - #
    - # - # It's possible to specialize the form builder by using a different action name and by supplying another - # block renderer. Example (entry is a new record that has a message attribute using VARCHAR): - # - # form("entry", :action => "sign", :input_block => - # Proc.new { |record, column| "#{column.human_name}: #{input(record, column.name)}
    " }) => - # - #
    - # Message: - #
    - # - #
    - # - # It's also possible to add additional content to the form by giving it a block, such as: - # - # form("entry", :action => "sign") do |form| - # form << content_tag("b", "Department") - # form << collection_select("department", "id", @departments, "id", "name") - # end - def form(record_name, options = {}) - record = instance_variable_get("@#{record_name}") - - options = options.symbolize_keys - options[:action] ||= record.new_record? ? "create" : "update" - action = url_for(:action => options[:action], :id => record) - - submit_value = options[:submit_value] || options[:action].gsub(/[^\w]/, '').capitalize - - contents = '' - contents << hidden_field(record_name, :id) unless record.new_record? - contents << all_input_tags(record, record_name, options) - yield contents if block_given? - contents << submit_tag(submit_value) - - content_tag('form', contents, :action => action, :method => 'post', :enctype => options[:multipart] ? 'multipart/form-data': nil) - end - - # Returns a string containing the error message attached to the +method+ on the +object+, if one exists. - # This error message is wrapped in a DIV tag, which can be specialized to include both a +prepend_text+ and +append_text+ - # to properly introduce the error and a +css_class+ to style it accordingly. Examples (post has an error message - # "can't be empty" on the title attribute): - # - # <%= error_message_on "post", "title" %> => - #
    can't be empty
    - # - # <%= error_message_on "post", "title", "Title simply ", " (or it won't work)", "inputError" %> => - #
    Title simply can't be empty (or it won't work)
    - def error_message_on(object, method, prepend_text = "", append_text = "", css_class = "formError") - if errors = instance_variable_get("@#{object}").errors.on(method) - content_tag("div", "#{prepend_text}#{errors.is_a?(Array) ? errors.first : errors}#{append_text}", :class => css_class) - end - end - - # Returns a string with a div containing all the error messages for the object located as an instance variable by the name - # of object_name. This div can be tailored by the following options: - # - # * header_tag - Used for the header of the error div (default: h2) - # * id - The id of the error div (default: errorExplanation) - # * class - The class of the error div (default: errorExplanation) - # - # NOTE: This is a pre-packaged presentation of the errors with embedded strings and a certain HTML structure. If what - # you need is significantly different from the default presentation, it makes plenty of sense to access the object.errors - # instance yourself and set it up. View the source of this method to see how easy it is. - def error_messages_for(object_name, options = {}) - options = options.symbolize_keys - object = instance_variable_get("@#{object_name}") - if object && !object.errors.empty? - content_tag("div", - content_tag( - options[:header_tag] || "h2", - "#{pluralize(object.errors.count, "error")} prohibited this #{object_name.to_s.gsub("_", " ")} from being saved" - ) + - content_tag("p", "There were problems with the following fields:") + - content_tag("ul", object.errors.full_messages.collect { |msg| content_tag("li", msg) }), - "id" => options[:id] || "errorExplanation", "class" => options[:class] || "errorExplanation" - ) - else - "" - end - end - - private - def all_input_tags(record, record_name, options) - input_block = options[:input_block] || default_input_block - record.class.content_columns.collect{ |column| input_block.call(record_name, column) }.join("\n") - end - - def default_input_block - Proc.new { |record, column| %(


    #{input(record, column.name)}

    ) } - end - end - - class InstanceTag #:nodoc: - def to_tag(options = {}) - case column_type - when :string - field_type = @method_name.include?("password") ? "password" : "text" - to_input_field_tag(field_type, options) - when :text - to_text_area_tag(options) - when :integer, :float - to_input_field_tag("text", options) - when :date - to_date_select_tag(options) - when :datetime, :timestamp - to_datetime_select_tag(options) - when :boolean - to_boolean_select_tag(options) - end - end - - alias_method :tag_without_error_wrapping, :tag - def tag(name, options) - if object.respond_to?("errors") && object.errors.respond_to?("on") - error_wrapping(tag_without_error_wrapping(name, options), object.errors.on(@method_name)) - else - tag_without_error_wrapping(name, options) - end - end - - alias_method :content_tag_without_error_wrapping, :content_tag - def content_tag(name, value, options) - if object.respond_to?("errors") && object.errors.respond_to?("on") - error_wrapping(content_tag_without_error_wrapping(name, value, options), object.errors.on(@method_name)) - else - content_tag_without_error_wrapping(name, value, options) - end - end - - alias_method :to_date_select_tag_without_error_wrapping, :to_date_select_tag - def to_date_select_tag(options = {}) - if object.respond_to?("errors") && object.errors.respond_to?("on") - error_wrapping(to_date_select_tag_without_error_wrapping(options), object.errors.on(@method_name)) - else - to_date_select_tag_without_error_wrapping(options) - end - end - - alias_method :to_datetime_select_tag_without_error_wrapping, :to_datetime_select_tag - def to_datetime_select_tag(options = {}) - if object.respond_to?("errors") && object.errors.respond_to?("on") - error_wrapping(to_datetime_select_tag_without_error_wrapping(options), object.errors.on(@method_name)) - else - to_datetime_select_tag_without_error_wrapping(options) - end - end - - def error_wrapping(html_tag, has_error) - has_error ? Base.field_error_proc.call(html_tag, self) : html_tag - end - - def error_message - object.errors.on(@method_name) - end - - def column_type - object.send("column_for_attribute", @method_name).type - end - end - end -end -require 'cgi' -require File.dirname(__FILE__) + '/url_helper' -require File.dirname(__FILE__) + '/tag_helper' - -module ActionView - module Helpers - # Provides methods for linking a HTML page together with other assets, such as javascripts, stylesheets, and feeds. - module AssetTagHelper - # Returns a link tag that browsers and news readers can use to auto-detect a RSS or ATOM feed for this page. The +type+ can - # either be :rss (default) or :atom and the +options+ follow the url_for style of declaring a link target. - # - # Examples: - # auto_discovery_link_tag # => - # - # auto_discovery_link_tag(:atom) # => - # - # auto_discovery_link_tag(:rss, {:action => "feed"}) # => - # - # auto_discovery_link_tag(:rss, {:action => "feed"}, {:title => "My RSS"}) # => - # - def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {}) - tag( - "link", - "rel" => tag_options[:rel] || "alternate", - "type" => tag_options[:type] || "application/#{type}+xml", - "title" => tag_options[:title] || type.to_s.upcase, - "href" => url_options.is_a?(Hash) ? url_for(url_options.merge(:only_path => false)) : url_options - ) - end - - # Returns path to a javascript asset. Example: - # - # javascript_path "xmlhr" # => /javascripts/xmlhr.js - def javascript_path(source) - compute_public_path(source, 'javascripts', 'js') - end - - JAVASCRIPT_DEFAULT_SOURCES = ['prototype', 'effects', 'dragdrop', 'controls'] unless const_defined?(:JAVASCRIPT_DEFAULT_SOURCES) - @@javascript_default_sources = JAVASCRIPT_DEFAULT_SOURCES.dup - - # Returns a script include tag per source given as argument. Examples: - # - # javascript_include_tag "xmlhr" # => - # - # - # javascript_include_tag "common.javascript", "/elsewhere/cools" # => - # - # - # - # javascript_include_tag :defaults # => - # - # - # ... - # *see below - # - # If there's an application.js file in your public/javascripts directory, - # javascript_include_tag :defaults will automatically include it. This file - # facilitates the inclusion of small snippets of JavaScript code, along the lines of - # controllers/application.rb and helpers/application_helper.rb. - def javascript_include_tag(*sources) - options = sources.last.is_a?(Hash) ? sources.pop.stringify_keys : { } - - if sources.include?(:defaults) - sources = sources[0..(sources.index(:defaults))] + - @@javascript_default_sources.dup + - sources[(sources.index(:defaults) + 1)..sources.length] - - sources.delete(:defaults) - sources << "application" if defined?(RAILS_ROOT) && File.exists?("#{RAILS_ROOT}/public/javascripts/application.js") - end - - sources.collect { |source| - source = javascript_path(source) - content_tag("script", "", { "type" => "text/javascript", "src" => source }.merge(options)) - }.join("\n") - end - - # Register one or more additional JavaScript files to be included when - # - # javascript_include_tag :defaults - # - # is called. This method is intended to be called only from plugin initialization - # to register extra .js files the plugin installed in public/javascripts. - def self.register_javascript_include_default(*sources) - @@javascript_default_sources.concat(sources) - end - - def self.reset_javascript_include_default #:nodoc: - @@javascript_default_sources = JAVASCRIPT_DEFAULT_SOURCES.dup - end - - # Returns path to a stylesheet asset. Example: - # - # stylesheet_path "style" # => /stylesheets/style.css - def stylesheet_path(source) - compute_public_path(source, 'stylesheets', 'css') - end - - # Returns a css link tag per source given as argument. Examples: - # - # stylesheet_link_tag "style" # => - # - # - # stylesheet_link_tag "style", :media => "all" # => - # - # - # stylesheet_link_tag "random.styles", "/css/stylish" # => - # - # - def stylesheet_link_tag(*sources) - options = sources.last.is_a?(Hash) ? sources.pop.stringify_keys : { } - sources.collect { |source| - source = stylesheet_path(source) - tag("link", { "rel" => "Stylesheet", "type" => "text/css", "media" => "screen", "href" => source }.merge(options)) - }.join("\n") - end - - # Returns path to an image asset. Example: - # - # The +src+ can be supplied as a... - # * full path, like "/my_images/image.gif" - # * file name, like "rss.gif", that gets expanded to "/images/rss.gif" - # * file name without extension, like "logo", that gets expanded to "/images/logo.png" - def image_path(source) - compute_public_path(source, 'images', 'png') - end - - # Returns an image tag converting the +options+ into html options on the tag, but with these special cases: - # - # * :alt - If no alt text is given, the file name part of the +src+ is used (capitalized and without the extension) - # * :size - Supplied as "XxY", so "30x45" becomes width="30" and height="45" - # - # The +src+ can be supplied as a... - # * full path, like "/my_images/image.gif" - # * file name, like "rss.gif", that gets expanded to "/images/rss.gif" - # * file name without extension, like "logo", that gets expanded to "/images/logo.png" - def image_tag(source, options = {}) - options.symbolize_keys! - - options[:src] = image_path(source) - options[:alt] ||= File.basename(options[:src], '.*').split('.').first.capitalize - - if options[:size] - options[:width], options[:height] = options[:size].split("x") - options.delete :size - end - - tag("img", options) - end - - private - def compute_public_path(source, dir, ext) - source = "/#{dir}/#{source}" unless source.first == "/" || source.include?(":") - source << ".#{ext}" unless source.split("/").last.include?(".") - source << '?' + rails_asset_id(source) if defined?(RAILS_ROOT) && %r{^[-a-z]+://} !~ source - source = "#{@controller.request.relative_url_root}#{source}" unless %r{^[-a-z]+://} =~ source - source = ActionController::Base.asset_host + source unless source.include?(":") - source - end - - def rails_asset_id(source) - ENV["RAILS_ASSET_ID"] || - File.mtime("#{RAILS_ROOT}/public/#{source}").to_i.to_s rescue "" - end - end - end -end -require 'benchmark' - -module ActionView - module Helpers - module BenchmarkHelper - # Measures the execution time of a block in a template and reports the result to the log. Example: - # - # <% benchmark "Notes section" do %> - # <%= expensive_notes_operation %> - # <% end %> - # - # Will add something like "Notes section (0.34523)" to the log. - # - # You may give an optional logger level as the second argument - # (:debug, :info, :warn, :error). The default is :info. - def benchmark(message = "Benchmarking", level = :info) - if @logger - real = Benchmark.realtime { yield } - @logger.send level, "#{message} (#{'%.5f' % real})" - end - end - end - end -end -module ActionView - module Helpers - # See ActionController::Caching::Fragments for usage instructions. - module CacheHelper - def cache(name = {}, &block) - @controller.cache_erb_fragment(block, name) - end - end - end -end -module ActionView - module Helpers - # Capture lets you extract parts of code which - # can be used in other points of the template or even layout file. - # - # == Capturing a block into an instance variable - # - # <% @script = capture do %> - # [some html...] - # <% end %> - # - # == Add javascript to header using content_for - # - # content_for("name") is a wrapper for capture which will - # make the fragment available by name to a yielding layout or template. - # - # layout.rhtml: - # - # - # - # layout with js - # - # - # - # <%= yield %> - # - # - # - # view.rhtml - # - # This page shows an alert box! - # - # <% content_for("script") do %> - # alert('hello world') - # <% end %> - # - # Normal view text - module CaptureHelper - # Capture allows you to extract a part of the template into an - # instance variable. You can use this instance variable anywhere - # in your templates and even in your layout. - # - # Example of capture being used in a .rhtml page: - # - # <% @greeting = capture do %> - # Welcome To my shiny new web page! - # <% end %> - # - # Example of capture being used in a .rxml page: - # - # @greeting = capture do - # 'Welcome To my shiny new web page!' - # end - def capture(*args, &block) - # execute the block - begin - buffer = eval("_erbout", block.binding) - rescue - buffer = nil - end - - if buffer.nil? - capture_block(*args, &block) - else - capture_erb_with_buffer(buffer, *args, &block) - end - end - - # Calling content_for stores the block of markup for later use. - # Subsequently, you can make calls to it by name with yield - # in another template or in the layout. - # - # Example: - # - # <% content_for("header") do %> - # alert('hello world') - # <% end %> - # - # You can use yield :header anywhere in your templates. - # - # <%= yield :header %> - # - # NOTE: Beware that content_for is ignored in caches. So you shouldn't use it - # for elements that are going to be fragment cached. - # - # The deprecated way of accessing a content_for block was to use a instance variable - # named @@content_for_#{name_of_the_content_block}@. So <%= content_for('footer') %> - # would be avaiable as <%= @content_for_footer %>. The preferred notation now is - # <%= yield :footer %>. - def content_for(name, &block) - eval "@content_for_#{name} = (@content_for_#{name} || '') + capture(&block)" - end - - private - def capture_block(*args, &block) - block.call(*args) - end - - def capture_erb(*args, &block) - buffer = eval("_erbout", block.binding) - capture_erb_with_buffer(buffer, *args, &block) - end - - def capture_erb_with_buffer(buffer, *args, &block) - pos = buffer.length - block.call(*args) - - # extract the block - data = buffer[pos..-1] - - # replace it in the original with empty string - buffer[pos..-1] = '' - - data - end - - def erb_content_for(name, &block) - eval "@content_for_#{name} = (@content_for_#{name} || '') + capture_erb(&block)" - end - - def block_content_for(name, &block) - eval "@content_for_#{name} = (@content_for_#{name} || '') + capture_block(&block)" - end - end - end -end -require "date" - -module ActionView - module Helpers - # The Date Helper primarily creates select/option tags for different kinds of dates and date elements. All of the select-type methods - # share a number of common options that are as follows: - # - # * :prefix - overwrites the default prefix of "date" used for the select names. So specifying "birthday" would give - # birthday[month] instead of date[month] if passed to the select_month method. - # * :include_blank - set to true if it should be possible to set an empty date. - # * :discard_type - set to true if you want to discard the type part of the select name. If set to true, the select_month - # method would use simply "date" (which can be overwritten using :prefix) instead of "date[month]". - module DateHelper - DEFAULT_PREFIX = 'date' unless const_defined?('DEFAULT_PREFIX') - - # Reports the approximate distance in time between two Time objects or integers. - # For example, if the distance is 47 minutes, it'll return - # "about 1 hour". See the source for the complete wording list. - # - # Integers are interpreted as seconds. So, - # distance_of_time_in_words(50) returns "less than a minute". - # - # Set include_seconds to true if you want more detailed approximations if distance < 1 minute - def distance_of_time_in_words(from_time, to_time = 0, include_seconds = false) - from_time = from_time.to_time if from_time.respond_to?(:to_time) - to_time = to_time.to_time if to_time.respond_to?(:to_time) - distance_in_minutes = (((to_time - from_time).abs)/60).round - distance_in_seconds = ((to_time - from_time).abs).round - - case distance_in_minutes - when 0..1 - return (distance_in_minutes==0) ? 'less than a minute' : '1 minute' unless include_seconds - case distance_in_seconds - when 0..5 then 'less than 5 seconds' - when 6..10 then 'less than 10 seconds' - when 11..20 then 'less than 20 seconds' - when 21..40 then 'half a minute' - when 41..59 then 'less than a minute' - else '1 minute' - end - - when 2..45 then "#{distance_in_minutes} minutes" - when 46..90 then 'about 1 hour' - when 90..1440 then "about #{(distance_in_minutes.to_f / 60.0).round} hours" - when 1441..2880 then '1 day' - else "#{(distance_in_minutes / 1440).round} days" - end - end - - # Like distance_of_time_in_words, but where to_time is fixed to Time.now. - def time_ago_in_words(from_time, include_seconds = false) - distance_of_time_in_words(from_time, Time.now, include_seconds) - end - - alias_method :distance_of_time_in_words_to_now, :time_ago_in_words - - # Returns a set of select tags (one for year, month, and day) pre-selected for accessing a specified date-based attribute (identified by - # +method+) on an object assigned to the template (identified by +object+). It's possible to tailor the selects through the +options+ hash, - # which accepts all the keys that each of the individual select builders do (like :use_month_numbers for select_month) as well as a range of - # discard options. The discard options are :discard_year, :discard_month and :discard_day. Set to true, they'll - # drop the respective select. Discarding the month select will also automatically discard the day select. It's also possible to explicitly - # set the order of the tags using the :order option with an array of symbols :year, :month and :day in - # the desired order. Symbols may be omitted and the respective select is not included. - # - # Passing :disabled => true as part of the +options+ will make elements inaccessible for change. - # - # NOTE: Discarded selects will default to 1. So if no month select is available, January will be assumed. - # - # Examples: - # - # date_select("post", "written_on") - # date_select("post", "written_on", :start_year => 1995) - # date_select("post", "written_on", :start_year => 1995, :use_month_numbers => true, - # :discard_day => true, :include_blank => true) - # date_select("post", "written_on", :order => [:day, :month, :year]) - # date_select("user", "birthday", :order => [:month, :day]) - # - # The selects are prepared for multi-parameter assignment to an Active Record object. - def date_select(object_name, method, options = {}) - InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_date_select_tag(options) - end - - # Returns a set of select tags (one for year, month, day, hour, and minute) pre-selected for accessing a specified datetime-based - # attribute (identified by +method+) on an object assigned to the template (identified by +object+). Examples: - # - # datetime_select("post", "written_on") - # datetime_select("post", "written_on", :start_year => 1995) - # - # The selects are prepared for multi-parameter assignment to an Active Record object. - def datetime_select(object_name, method, options = {}) - InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_datetime_select_tag(options) - end - - # Returns a set of html select-tags (one for year, month, and day) pre-selected with the +date+. - def select_date(date = Date.today, options = {}) - select_year(date, options) + select_month(date, options) + select_day(date, options) - end - - # Returns a set of html select-tags (one for year, month, day, hour, and minute) pre-selected with the +datetime+. - def select_datetime(datetime = Time.now, options = {}) - select_year(datetime, options) + select_month(datetime, options) + select_day(datetime, options) + - select_hour(datetime, options) + select_minute(datetime, options) - end - - # Returns a set of html select-tags (one for hour and minute) - def select_time(datetime = Time.now, options = {}) - h = select_hour(datetime, options) + select_minute(datetime, options) + (options[:include_seconds] ? select_second(datetime, options) : '') - end - - # Returns a select tag with options for each of the seconds 0 through 59 with the current second selected. - # The second can also be substituted for a second number. - # Override the field name using the :field_name option, 'second' by default. - def select_second(datetime, options = {}) - second_options = [] - - 0.upto(59) do |second| - second_options << ((datetime && (datetime.kind_of?(Fixnum) ? datetime : datetime.sec) == second) ? - %(\n) : - %(\n) - ) - end - - select_html(options[:field_name] || 'second', second_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled]) - end - - # Returns a select tag with options for each of the minutes 0 through 59 with the current minute selected. - # Also can return a select tag with options by minute_step from 0 through 59 with the 00 minute selected - # The minute can also be substituted for a minute number. - # Override the field name using the :field_name option, 'minute' by default. - def select_minute(datetime, options = {}) - minute_options = [] - - 0.step(59, options[:minute_step] || 1) do |minute| - minute_options << ((datetime && (datetime.kind_of?(Fixnum) ? datetime : datetime.min) == minute) ? - %(\n) : - %(\n) - ) - end - - select_html(options[:field_name] || 'minute', minute_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled]) - end - - # Returns a select tag with options for each of the hours 0 through 23 with the current hour selected. - # The hour can also be substituted for a hour number. - # Override the field name using the :field_name option, 'hour' by default. - def select_hour(datetime, options = {}) - hour_options = [] - - 0.upto(23) do |hour| - hour_options << ((datetime && (datetime.kind_of?(Fixnum) ? datetime : datetime.hour) == hour) ? - %(\n) : - %(\n) - ) - end - - select_html(options[:field_name] || 'hour', hour_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled]) - end - - # Returns a select tag with options for each of the days 1 through 31 with the current day selected. - # The date can also be substituted for a hour number. - # Override the field name using the :field_name option, 'day' by default. - def select_day(date, options = {}) - day_options = [] - - 1.upto(31) do |day| - day_options << ((date && (date.kind_of?(Fixnum) ? date : date.day) == day) ? - %(\n) : - %(\n) - ) - end - - select_html(options[:field_name] || 'day', day_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled]) - end - - # Returns a select tag with options for each of the months January through December with the current month selected. - # The month names are presented as keys (what's shown to the user) and the month numbers (1-12) are used as values - # (what's submitted to the server). It's also possible to use month numbers for the presentation instead of names -- - # set the :use_month_numbers key in +options+ to true for this to happen. If you want both numbers and names, - # set the :add_month_numbers key in +options+ to true. Examples: - # - # select_month(Date.today) # Will use keys like "January", "March" - # select_month(Date.today, :use_month_numbers => true) # Will use keys like "1", "3" - # select_month(Date.today, :add_month_numbers => true) # Will use keys like "1 - January", "3 - March" - # - # Override the field name using the :field_name option, 'month' by default. - # - # If you would prefer to show month names as abbreviations, set the - # :use_short_month key in +options+ to true. - def select_month(date, options = {}) - month_options = [] - month_names = options[:use_short_month] ? Date::ABBR_MONTHNAMES : Date::MONTHNAMES - - 1.upto(12) do |month_number| - month_name = if options[:use_month_numbers] - month_number - elsif options[:add_month_numbers] - month_number.to_s + ' - ' + month_names[month_number] - else - month_names[month_number] - end - - month_options << ((date && (date.kind_of?(Fixnum) ? date : date.month) == month_number) ? - %(\n) : - %(\n) - ) - end - - select_html(options[:field_name] || 'month', month_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled]) - end - - # Returns a select tag with options for each of the five years on each side of the current, which is selected. The five year radius - # can be changed using the :start_year and :end_year keys in the +options+. Both ascending and descending year - # lists are supported by making :start_year less than or greater than :end_year. The date can also be - # substituted for a year given as a number. Example: - # - # select_year(Date.today, :start_year => 1992, :end_year => 2007) # ascending year values - # select_year(Date.today, :start_year => 2005, :end_year => 1900) # descending year values - # - # Override the field name using the :field_name option, 'year' by default. - def select_year(date, options = {}) - year_options = [] - y = date ? (date.kind_of?(Fixnum) ? (y = (date == 0) ? Date.today.year : date) : date.year) : Date.today.year - - start_year, end_year = (options[:start_year] || y-5), (options[:end_year] || y+5) - step_val = start_year < end_year ? 1 : -1 - - start_year.step(end_year, step_val) do |year| - year_options << ((date && (date.kind_of?(Fixnum) ? date : date.year) == year) ? - %(\n) : - %(\n) - ) - end - - select_html(options[:field_name] || 'year', year_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled]) - end - - private - def select_html(type, options, prefix = nil, include_blank = false, discard_type = false, disabled = false) - select_html = %(\n" - end - - def leading_zero_on_single_digits(number) - number > 9 ? number : "0#{number}" - end - end - - class InstanceTag #:nodoc: - include DateHelper - - def to_date_select_tag(options = {}) - defaults = { :discard_type => true } - options = defaults.merge(options) - options_with_prefix = Proc.new { |position| options.merge(:prefix => "#{@object_name}[#{@method_name}(#{position}i)]") } - date = options[:include_blank] ? (value || 0) : (value || Date.today) - - date_select = '' - options[:order] = [:month, :year, :day] if options[:month_before_year] # For backwards compatibility - options[:order] ||= [:year, :month, :day] - - position = {:year => 1, :month => 2, :day => 3} - - discard = {} - discard[:year] = true if options[:discard_year] - discard[:month] = true if options[:discard_month] - discard[:day] = true if options[:discard_day] or options[:discard_month] - - options[:order].each do |param| - date_select << self.send("select_#{param}", date, options_with_prefix.call(position[param])) unless discard[param] - end - - date_select - end - - def to_datetime_select_tag(options = {}) - defaults = { :discard_type => true } - options = defaults.merge(options) - options_with_prefix = Proc.new { |position| options.merge(:prefix => "#{@object_name}[#{@method_name}(#{position}i)]") } - datetime = options[:include_blank] ? (value || nil) : (value || Time.now) - - datetime_select = select_year(datetime, options_with_prefix.call(1)) - datetime_select << select_month(datetime, options_with_prefix.call(2)) unless options[:discard_month] - datetime_select << select_day(datetime, options_with_prefix.call(3)) unless options[:discard_day] || options[:discard_month] - datetime_select << ' — ' + select_hour(datetime, options_with_prefix.call(4)) unless options[:discard_hour] - datetime_select << ' : ' + select_minute(datetime, options_with_prefix.call(5)) unless options[:discard_minute] || options[:discard_hour] - - datetime_select - end - end - - class FormBuilder - def date_select(method, options = {}) - @template.date_select(@object_name, method, options.merge(:object => @object)) - end - - def datetime_select(method, options = {}) - @template.datetime_select(@object_name, method, options.merge(:object => @object)) - end - end - end -end -module ActionView - module Helpers - # Provides a set of methods for making it easier to locate problems. - module DebugHelper - # Returns a
    -tag set with the +object+ dumped by YAML. Very readable way to inspect an object.
    -      def debug(object)
    -        begin
    -          Marshal::dump(object)
    -          "
    #{h(object.to_yaml).gsub("  ", "  ")}
    " - rescue Object => e - # Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback - "#{h(object.inspect)}" - end - end - end - end -endrequire 'cgi' -require File.dirname(__FILE__) + '/date_helper' -require File.dirname(__FILE__) + '/tag_helper' - -module ActionView - module Helpers - # Provides a set of methods for working with forms and especially forms related to objects assigned to the template. - # The following is an example of a complete form for a person object that works for both creates and updates built - # with all the form helpers. The @person object was assigned by an action on the controller: - #
    - # Name: - # <%= text_field "person", "name", "size" => 20 %> - # - # Password: - # <%= password_field "person", "password", "maxsize" => 20 %> - # - # Single?: - # <%= check_box "person", "single" %> - # - # Description: - # <%= text_area "person", "description", "cols" => 20 %> - # - # - #
    - # - # ...is compiled to: - # - #
    - # Name: - # - # - # Password: - # - # - # Single?: - # - # - # Description: - # - # - # - #
    - # - # If the object name contains square brackets the id for the object will be inserted. Example: - # - # <%= text_field "person[]", "name" %> - # - # ...becomes: - # - # - # - # If the helper is being used to generate a repetitive sequence of similar form elements, for example in a partial - # used by render_collection_of_partials, the "index" option may come in handy. Example: - # - # <%= text_field "person", "name", "index" => 1 %> - # - # becomes - # - # - # - # There's also methods for helping to build form tags in link:classes/ActionView/Helpers/FormOptionsHelper.html, - # link:classes/ActionView/Helpers/DateHelper.html, and link:classes/ActionView/Helpers/ActiveRecordHelper.html - module FormHelper - # Creates a form and a scope around a specific model object, which is then used as a base for questioning about - # values for the fields. Examples: - # - # <% form_for :person, @person, :url => { :action => "update" } do |f| %> - # First name: <%= f.text_field :first_name %> - # Last name : <%= f.text_field :last_name %> - # Biography : <%= f.text_area :biography %> - # Admin? : <%= f.check_box :admin %> - # <% end %> - # - # Worth noting is that the form_for tag is called in a ERb evaluation block, not a ERb output block. So that's <% %>, - # not <%= %>. Also worth noting is that the form_for yields a form_builder object, in this example as f, which emulates - # the API for the stand-alone FormHelper methods, but without the object name. So instead of text_field :person, :name, - # you get away with f.text_field :name. - # - # That in itself is a modest increase in comfort. The big news is that form_for allows us to more easily escape the instance - # variable convention, so while the stand-alone approach would require text_field :person, :name, :object => person - # to work with local variables instead of instance ones, the form_for calls remain the same. You simply declare once with - # :person, person and all subsequent field calls save :person and :object => person. - # - # Also note that form_for doesn't create an exclusive scope. It's still possible to use both the stand-alone FormHelper methods - # and methods from FormTagHelper. Example: - # - # <% form_for :person, @person, :url => { :action => "update" } do |f| %> - # First name: <%= f.text_field :first_name %> - # Last name : <%= f.text_field :last_name %> - # Biography : <%= text_area :person, :biography %> - # Admin? : <%= check_box_tag "person[admin]", @person.company.admin? %> - # <% end %> - # - # Note: This also works for the methods in FormOptionHelper and DateHelper that are designed to work with an object as base. - # Like collection_select and datetime_select. - # - # Html attributes for the form tag can be given as :html => {...}. Example: - # - # <% form_for :person, @person, :html => {:id => 'person_form'} do |f| %> - # ... - # <% end %> - # - # You can also build forms using a customized FormBuilder class. Subclass FormBuilder and override or define some more helpers, - # then use your custom builder like so: - # - # <% form_for :person, @person, :url => { :action => "update" }, :builder => LabellingFormBuilder do |f| %> - # <%= f.text_field :first_name %> - # <%= f.text_field :last_name %> - # <%= text_area :person, :biography %> - # <%= check_box_tag "person[admin]", @person.company.admin? %> - # <% end %> - # - # In many cases you will want to wrap the above in another helper, such as: - # - # def labelled_form_for(name, object, options, &proc) - # form_for(name, object, options.merge(:builder => LabellingFormBuiler), &proc) - # end - # - def form_for(object_name, *args, &proc) - raise ArgumentError, "Missing block" unless block_given? - options = args.last.is_a?(Hash) ? args.pop : {} - concat(form_tag(options.delete(:url) || {}, options.delete(:html) || {}), proc.binding) - fields_for(object_name, *(args << options), &proc) - concat('', proc.binding) - end - - # Creates a scope around a specific model object like form_for, but doesn't create the form tags themselves. This makes - # fields_for suitable for specifying additional model objects in the same form. Example: - # - # <% form_for :person, @person, :url => { :action => "update" } do |person_form| %> - # First name: <%= person_form.text_field :first_name %> - # Last name : <%= person_form.text_field :last_name %> - # - # <% fields_for :permission, @person.permission do |permission_fields| %> - # Admin? : <%= permission_fields.check_box :admin %> - # <% end %> - # <% end %> - # - # Note: This also works for the methods in FormOptionHelper and DateHelper that are designed to work with an object as base. - # Like collection_select and datetime_select. - def fields_for(object_name, *args, &proc) - raise ArgumentError, "Missing block" unless block_given? - options = args.last.is_a?(Hash) ? args.pop : {} - object = args.first - yield((options[:builder] || FormBuilder).new(object_name, object, self, options, proc)) - end - - # Returns an input tag of the "text" type tailored for accessing a specified attribute (identified by +method+) on an object - # assigned to the template (identified by +object+). Additional options on the input tag can be passed as a - # hash with +options+. - # - # Examples (call, result): - # text_field("post", "title", "size" => 20) - # - def text_field(object_name, method, options = {}) - InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_input_field_tag("text", options) - end - - # Works just like text_field, but returns an input tag of the "password" type instead. - def password_field(object_name, method, options = {}) - InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_input_field_tag("password", options) - end - - # Works just like text_field, but returns an input tag of the "hidden" type instead. - def hidden_field(object_name, method, options = {}) - InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_input_field_tag("hidden", options) - end - - # Works just like text_field, but returns an input tag of the "file" type instead, which won't have a default value. - def file_field(object_name, method, options = {}) - InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_input_field_tag("file", options) - end - - # Returns a textarea opening and closing tag set tailored for accessing a specified attribute (identified by +method+) - # on an object assigned to the template (identified by +object+). Additional options on the input tag can be passed as a - # hash with +options+. - # - # Example (call, result): - # text_area("post", "body", "cols" => 20, "rows" => 40) - # - def text_area(object_name, method, options = {}) - InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_text_area_tag(options) - end - - # Returns a checkbox tag tailored for accessing a specified attribute (identified by +method+) on an object - # assigned to the template (identified by +object+). It's intended that +method+ returns an integer and if that - # integer is above zero, then the checkbox is checked. Additional options on the input tag can be passed as a - # hash with +options+. The +checked_value+ defaults to 1 while the default +unchecked_value+ - # is set to 0 which is convenient for boolean values. Usually unchecked checkboxes don't post anything. - # We work around this problem by adding a hidden value with the same name as the checkbox. - # - # Example (call, result). Imagine that @post.validated? returns 1: - # check_box("post", "validated") - # - # - # - # Example (call, result). Imagine that @puppy.gooddog returns no: - # check_box("puppy", "gooddog", {}, "yes", "no") - # - # - def check_box(object_name, method, options = {}, checked_value = "1", unchecked_value = "0") - InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_check_box_tag(options, checked_value, unchecked_value) - end - - # Returns a radio button tag for accessing a specified attribute (identified by +method+) on an object - # assigned to the template (identified by +object+). If the current value of +method+ is +tag_value+ the - # radio button will be checked. Additional options on the input tag can be passed as a - # hash with +options+. - # Example (call, result). Imagine that @post.category returns "rails": - # radio_button("post", "category", "rails") - # radio_button("post", "category", "java") - # - # - # - def radio_button(object_name, method, tag_value, options = {}) - InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_radio_button_tag(tag_value, options) - end - end - - class InstanceTag #:nodoc: - include Helpers::TagHelper - - attr_reader :method_name, :object_name - - DEFAULT_FIELD_OPTIONS = { "size" => 30 }.freeze unless const_defined?(:DEFAULT_FIELD_OPTIONS) - DEFAULT_RADIO_OPTIONS = { }.freeze unless const_defined?(:DEFAULT_RADIO_OPTIONS) - DEFAULT_TEXT_AREA_OPTIONS = { "cols" => 40, "rows" => 20 }.freeze unless const_defined?(:DEFAULT_TEXT_AREA_OPTIONS) - DEFAULT_DATE_OPTIONS = { :discard_type => true }.freeze unless const_defined?(:DEFAULT_DATE_OPTIONS) - - def initialize(object_name, method_name, template_object, local_binding = nil, object = nil) - @object_name, @method_name = object_name.to_s.dup, method_name.to_s.dup - @template_object, @local_binding = template_object, local_binding - @object = object - if @object_name.sub!(/\[\]$/,"") - @auto_index = @template_object.instance_variable_get("@#{Regexp.last_match.pre_match}").id_before_type_cast - end - end - - def to_input_field_tag(field_type, options = {}) - options = options.stringify_keys - options["size"] ||= options["maxlength"] || DEFAULT_FIELD_OPTIONS["size"] - options = DEFAULT_FIELD_OPTIONS.merge(options) - if field_type == "hidden" - options.delete("size") - end - options["type"] = field_type - options["value"] ||= value_before_type_cast unless field_type == "file" - add_default_name_and_id(options) - tag("input", options) - end - - def to_radio_button_tag(tag_value, options = {}) - options = DEFAULT_RADIO_OPTIONS.merge(options.stringify_keys) - options["type"] = "radio" - options["value"] = tag_value - options["checked"] = "checked" if value.to_s == tag_value.to_s - pretty_tag_value = tag_value.to_s.gsub(/\s/, "_").gsub(/\W/, "").downcase - options["id"] = @auto_index ? - "#{@object_name}_#{@auto_index}_#{@method_name}_#{pretty_tag_value}" : - "#{@object_name}_#{@method_name}_#{pretty_tag_value}" - add_default_name_and_id(options) - tag("input", options) - end - - def to_text_area_tag(options = {}) - options = DEFAULT_TEXT_AREA_OPTIONS.merge(options.stringify_keys) - add_default_name_and_id(options) - content_tag("textarea", html_escape(options.delete('value') || value_before_type_cast), options) - end - - def to_check_box_tag(options = {}, checked_value = "1", unchecked_value = "0") - options = options.stringify_keys - options["type"] = "checkbox" - options["value"] = checked_value - checked = case value - when TrueClass, FalseClass - value - when NilClass - false - when Integer - value != 0 - when String - value == checked_value - else - value.to_i != 0 - end - if checked || options["checked"] == "checked" - options["checked"] = "checked" - else - options.delete("checked") - end - add_default_name_and_id(options) - tag("input", options) << tag("input", "name" => options["name"], "type" => "hidden", "value" => unchecked_value) - end - - def to_date_tag() - defaults = DEFAULT_DATE_OPTIONS.dup - date = value || Date.today - options = Proc.new { |position| defaults.merge(:prefix => "#{@object_name}[#{@method_name}(#{position}i)]") } - html_day_select(date, options.call(3)) + - html_month_select(date, options.call(2)) + - html_year_select(date, options.call(1)) - end - - def to_boolean_select_tag(options = {}) - options = options.stringify_keys - add_default_name_and_id(options) - tag_text = "" - end - - def to_content_tag(tag_name, options = {}) - content_tag(tag_name, value, options) - end - - def object - @object || @template_object.instance_variable_get("@#{@object_name}") - end - - def value - unless object.nil? - object.send(@method_name) - end - end - - def value_before_type_cast - unless object.nil? - object.respond_to?(@method_name + "_before_type_cast") ? - object.send(@method_name + "_before_type_cast") : - object.send(@method_name) - end - end - - private - def add_default_name_and_id(options) - if options.has_key?("index") - options["name"] ||= tag_name_with_index(options["index"]) - options["id"] ||= tag_id_with_index(options["index"]) - options.delete("index") - elsif @auto_index - options["name"] ||= tag_name_with_index(@auto_index) - options["id"] ||= tag_id_with_index(@auto_index) - else - options["name"] ||= tag_name - options["id"] ||= tag_id - end - end - - def tag_name - "#{@object_name}[#{@method_name}]" - end - - def tag_name_with_index(index) - "#{@object_name}[#{index}][#{@method_name}]" - end - - def tag_id - "#{@object_name}_#{@method_name}" - end - - def tag_id_with_index(index) - "#{@object_name}_#{index}_#{@method_name}" - end - end - - class FormBuilder #:nodoc: - # The methods which wrap a form helper call. - class_inheritable_accessor :field_helpers - self.field_helpers = (FormHelper.instance_methods - ['form_for']) - - attr_accessor :object_name, :object - - def initialize(object_name, object, template, options, proc) - @object_name, @object, @template, @options, @proc = object_name, object, template, options, proc - end - - (field_helpers - %w(check_box radio_button)).each do |selector| - src = <<-end_src - def #{selector}(method, options = {}) - @template.send(#{selector.inspect}, @object_name, method, options.merge(:object => @object)) - end - end_src - class_eval src, __FILE__, __LINE__ - end - - def check_box(method, options = {}, checked_value = "1", unchecked_value = "0") - @template.check_box(@object_name, method, options.merge(:object => @object), checked_value, unchecked_value) - end - - def radio_button(method, tag_value, options = {}) - @template.radio_button(@object_name, method, tag_value, options.merge(:object => @object)) - end - end - end -end -require 'cgi' -require 'erb' -require File.dirname(__FILE__) + '/form_helper' - -module ActionView - module Helpers - # Provides a number of methods for turning different kinds of containers into a set of option tags. - # == Options - # The collection_select, country_select, select, - # and time_zone_select methods take an options parameter, - # a hash. - # - # * :include_blank - set to true if the first option element of the select element is a blank. Useful if there is not a default value required for the select element. For example, - # - # select("post", "category", Post::CATEGORIES, {:include_blank => true}) - # - # could become: - # - # - # - # * :prompt - set to true or a prompt string. When the select element doesn't have a value yet, this prepends an option with a generic prompt -- "Please select" -- or the given prompt string. - # - # Another common case is a select tag for an belongs_to-associated object. For example, - # - # select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] }) - # - # could become: - # - # - module FormOptionsHelper - include ERB::Util - - # Create a select tag and a series of contained option tags for the provided object and method. - # The option currently held by the object will be selected, provided that the object is available. - # See options_for_select for the required format of the choices parameter. - # - # Example with @post.person_id => 1: - # select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] }, { :include_blank => true }) - # - # could become: - # - # - # - # This can be used to provide a default set of options in the standard way: before rendering the create form, a - # new model instance is assigned the default options and bound to @model_name. Usually this model is not saved - # to the database. Instead, a second model object is created when the create request is received. - # This allows the user to submit a form page more than once with the expected results of creating multiple records. - # In addition, this allows a single partial to be used to generate form inputs for both edit and create forms. - # - # By default, post.person_id is the selected option. Specify :selected => value to use a different selection - # or :selected => nil to leave all options unselected. - def select(object, method, choices, options = {}, html_options = {}) - InstanceTag.new(object, method, self, nil, options.delete(:object)).to_select_tag(choices, options, html_options) - end - - # Return select and option tags for the given object and method using options_from_collection_for_select to generate the list of option tags. - def collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {}) - InstanceTag.new(object, method, self, nil, options.delete(:object)).to_collection_select_tag(collection, value_method, text_method, options, html_options) - end - - # Return select and option tags for the given object and method, using country_options_for_select to generate the list of option tags. - def country_select(object, method, priority_countries = nil, options = {}, html_options = {}) - InstanceTag.new(object, method, self, nil, options.delete(:object)).to_country_select_tag(priority_countries, options, html_options) - end - - # Return select and option tags for the given object and method, using - # #time_zone_options_for_select to generate the list of option tags. - # - # In addition to the :include_blank option documented above, - # this method also supports a :model option, which defaults - # to TimeZone. This may be used by users to specify a different time - # zone model object. (See #time_zone_options_for_select for more - # information.) - def time_zone_select(object, method, priority_zones = nil, options = {}, html_options = {}) - InstanceTag.new(object, method, self, nil, options.delete(:object)).to_time_zone_select_tag(priority_zones, options, html_options) - end - - # Accepts a container (hash, array, enumerable, your type) and returns a string of option tags. Given a container - # where the elements respond to first and last (such as a two-element array), the "lasts" serve as option values and - # the "firsts" as option text. Hashes are turned into this form automatically, so the keys become "firsts" and values - # become lasts. If +selected+ is specified, the matching "last" or element will get the selected option-tag. +Selected+ - # may also be an array of values to be selected when using a multiple select. - # - # Examples (call, result): - # options_for_select([["Dollar", "$"], ["Kroner", "DKK"]]) - # \n - # - # options_for_select([ "VISA", "MasterCard" ], "MasterCard") - # \n - # - # options_for_select({ "Basic" => "$20", "Plus" => "$40" }, "$40") - # \n - # - # options_for_select([ "VISA", "MasterCard", "Discover" ], ["VISA", "Discover"]) - # \n\n - # - # NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag. - def options_for_select(container, selected = nil) - container = container.to_a if Hash === container - - options_for_select = container.inject([]) do |options, element| - if !element.is_a?(String) and element.respond_to?(:first) and element.respond_to?(:last) - is_selected = ( (selected.respond_to?(:include?) ? selected.include?(element.last) : element.last == selected) ) - is_selected = ( (selected.respond_to?(:include?) && !selected.is_a?(String) ? selected.include?(element.last) : element.last == selected) ) - if is_selected - options << "" - else - options << "" - end - else - is_selected = ( (selected.respond_to?(:include?) ? selected.include?(element) : element == selected) ) - is_selected = ( (selected.respond_to?(:include?) && !selected.is_a?(String) ? selected.include?(element) : element == selected) ) - options << ((is_selected) ? "" : "") - end - end - - options_for_select.join("\n") - end - - # Returns a string of option tags that have been compiled by iterating over the +collection+ and assigning the - # the result of a call to the +value_method+ as the option value and the +text_method+ as the option text. - # If +selected_value+ is specified, the element returning a match on +value_method+ will get the selected option tag. - # - # Example (call, result). Imagine a loop iterating over each +person+ in @project.people to generate an input tag: - # options_from_collection_for_select(@project.people, "id", "name") - # - # - # NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag. - def options_from_collection_for_select(collection, value_method, text_method, selected_value = nil) - options_for_select( - collection.inject([]) { |options, object| options << [ object.send(text_method), object.send(value_method) ] }, - selected_value - ) - end - - # Returns a string of option tags, like options_from_collection_for_select, but surrounds them with tags. - # - # An array of group objects are passed. Each group should return an array of options when calling group_method - # Each group should return its name when calling group_label_method. - # - # html_option_groups_from_collection(@continents, "countries", "continent_name", "country_id", "country_name", @selected_country.id) - # - # Could become: - # - # - # - # ... - # - # - # - # - # - # ... - # - # - # with objects of the following classes: - # class Continent - # def initialize(p_name, p_countries) @continent_name = p_name; @countries = p_countries; end - # def continent_name() @continent_name; end - # def countries() @countries; end - # end - # class Country - # def initialize(id, name) @id = id; @name = name end - # def country_id() @id; end - # def country_name() @name; end - # end - # - # NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag. - def option_groups_from_collection_for_select(collection, group_method, group_label_method, - option_key_method, option_value_method, selected_key = nil) - collection.inject("") do |options_for_select, group| - group_label_string = eval("group.#{group_label_method}") - options_for_select += "" - options_for_select += options_from_collection_for_select(eval("group.#{group_method}"), option_key_method, option_value_method, selected_key) - options_for_select += '' - end - end - - # Returns a string of option tags for pretty much any country in the world. Supply a country name as +selected+ to - # have it marked as the selected option tag. You can also supply an array of countries as +priority_countries+, so - # that they will be listed above the rest of the (long) list. - # - # NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag. - def country_options_for_select(selected = nil, priority_countries = nil) - country_options = "" - - if priority_countries - country_options += options_for_select(priority_countries, selected) - country_options += "\n" - end - - if priority_countries && priority_countries.include?(selected) - country_options += options_for_select(COUNTRIES - priority_countries, selected) - else - country_options += options_for_select(COUNTRIES, selected) - end - - return country_options - end - - # Returns a string of option tags for pretty much any time zone in the - # world. Supply a TimeZone name as +selected+ to have it marked as the - # selected option tag. You can also supply an array of TimeZone objects - # as +priority_zones+, so that they will be listed above the rest of the - # (long) list. (You can use TimeZone.us_zones as a convenience for - # obtaining a list of the US time zones.) - # - # The +selected+ parameter must be either +nil+, or a string that names - # a TimeZone. - # - # By default, +model+ is the TimeZone constant (which can be obtained - # in ActiveRecord as a value object). The only requirement is that the - # +model+ parameter be an object that responds to #all, and returns - # an array of objects that represent time zones. - # - # NOTE: Only the option tags are returned, you have to wrap this call in - # a regular HTML select tag. - def time_zone_options_for_select(selected = nil, priority_zones = nil, model = TimeZone) - zone_options = "" - - zones = model.all - convert_zones = lambda { |list| list.map { |z| [ z.to_s, z.name ] } } - - if priority_zones - zone_options += options_for_select(convert_zones[priority_zones], selected) - zone_options += "\n" - - zones = zones.reject { |z| priority_zones.include?( z ) } - end - - zone_options += options_for_select(convert_zones[zones], selected) - zone_options - end - - private - # All the countries included in the country_options output. - COUNTRIES = [ "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", - "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia", - "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", - "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", - "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", - "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cambodia", - "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", - "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", - "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", - "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", - "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", - "El Salvador", "England", "Equatorial Guinea", "Eritrea", "Espana", "Estonia", - "Ethiopia", "Falkland Islands", "Faroe Islands", "Fiji", "Finland", "France", - "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", - "Georgia", "Germany", "Ghana", "Gibraltar", "Great Britain", "Greece", "Greenland", - "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", - "Haiti", "Heard and Mc Donald Islands", "Honduras", "Hong Kong", "Hungary", "Iceland", - "India", "Indonesia", "Ireland", "Israel", "Italy", "Iran", "Iraq", "Jamaica", "Japan", "Jordan", - "Kazakhstan", "Kenya", "Kiribati", "Korea, Republic of", "Korea (South)", "Kuwait", - "Kyrgyzstan", "Lao People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", - "Liberia", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia", - "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", - "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", - "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", - "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", - "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", - "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Ireland", - "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", - "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", - "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russia", "Rwanda", - "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", - "Samoa (Independent)", "San Marino", "Sao Tome and Principe", "Saudi Arabia", - "Scotland", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", - "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", - "South Georgia and the South Sandwich Islands", "South Korea", "Spain", "Sri Lanka", - "St. Helena", "St. Pierre and Miquelon", "Suriname", "Svalbard and Jan Mayen Islands", - "Swaziland", "Sweden", "Switzerland", "Taiwan", "Tajikistan", "Tanzania", "Thailand", - "Togo", "Tokelau", "Tonga", "Trinidad", "Trinidad and Tobago", "Tunisia", "Turkey", - "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", - "United Arab Emirates", "United Kingdom", "United States", - "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", - "Vatican City State (Holy See)", "Venezuela", "Viet Nam", "Virgin Islands (British)", - "Virgin Islands (U.S.)", "Wales", "Wallis and Futuna Islands", "Western Sahara", - "Yemen", "Zambia", "Zimbabwe" ] unless const_defined?("COUNTRIES") - end - - class InstanceTag #:nodoc: - include FormOptionsHelper - - def to_select_tag(choices, options, html_options) - html_options = html_options.stringify_keys - add_default_name_and_id(html_options) - selected_value = options.has_key?(:selected) ? options[:selected] : value - content_tag("select", add_options(options_for_select(choices, selected_value), options, value), html_options) - end - - def to_collection_select_tag(collection, value_method, text_method, options, html_options) - html_options = html_options.stringify_keys - add_default_name_and_id(html_options) - content_tag( - "select", add_options(options_from_collection_for_select(collection, value_method, text_method, value), options, value), html_options - ) - end - - def to_country_select_tag(priority_countries, options, html_options) - html_options = html_options.stringify_keys - add_default_name_and_id(html_options) - content_tag("select", add_options(country_options_for_select(value, priority_countries), options, value), html_options) - end - - def to_time_zone_select_tag(priority_zones, options, html_options) - html_options = html_options.stringify_keys - add_default_name_and_id(html_options) - content_tag("select", - add_options( - time_zone_options_for_select(value, priority_zones, options[:model] || TimeZone), - options, value - ), html_options - ) - end - - private - def add_options(option_tags, options, value = nil) - option_tags = "\n" + option_tags if options[:include_blank] - - if value.blank? && options[:prompt] - ("\n") + option_tags - else - option_tags - end - end - end - - class FormBuilder - def select(method, choices, options = {}, html_options = {}) - @template.select(@object_name, method, choices, options.merge(:object => @object), html_options) - end - - def collection_select(method, collection, value_method, text_method, options = {}, html_options = {}) - @template.collection_select(@object_name, method, collection, value_method, text_method, options.merge(:object => @object), html_options) - end - - def country_select(method, priority_countries = nil, options = {}, html_options = {}) - @template.country_select(@object_name, method, priority_countries, options.merge(:object => @object), html_options) - end - - def time_zone_select(method, priority_zones = nil, options = {}, html_options = {}) - @template.time_zone_select(@object_name, method, priority_zones, options.merge(:object => @object), html_options) - end - end - end -end -require 'cgi' -require File.dirname(__FILE__) + '/tag_helper' - -module ActionView - module Helpers - # Provides a number of methods for creating form tags that doesn't rely on conventions with an object assigned to the template like - # FormHelper does. With the FormTagHelper, you provide the names and values yourself. - # - # NOTE: The html options disabled, readonly, and multiple can all be treated as booleans. So specifying :disabled => true - # will give disabled="disabled". - module FormTagHelper - # Starts a form tag that points the action to an url configured with url_for_options just like - # ActionController::Base#url_for. The method for the form defaults to POST. - # - # Options: - # * :multipart - If set to true, the enctype is set to "multipart/form-data". - # * :method - The method to use when submitting the form, usually either "get" or "post". - def form_tag(url_for_options = {}, options = {}, *parameters_for_url, &proc) - html_options = { "method" => "post" }.merge(options.stringify_keys) - html_options["enctype"] = "multipart/form-data" if html_options.delete("multipart") - html_options["action"] = url_for(url_for_options, *parameters_for_url) - tag :form, html_options, true - end - - alias_method :start_form_tag, :form_tag - - # Outputs "" - def end_form_tag - "" - end - - # Creates a dropdown selection box, or if the :multiple option is set to true, a multiple - # choice selection box. - # - # Helpers::FormOptions can be used to create common select boxes such as countries, time zones, or - # associated records. - # - # option_tags is a string containing the option tags for the select box: - # # Outputs - # select_tag "people", "" - # - # Options: - # * :multiple - If set to true the selection will allow multiple choices. - def select_tag(name, option_tags = nil, options = {}) - content_tag :select, option_tags, { "name" => name, "id" => name }.update(options.stringify_keys) - end - - # Creates a standard text field. - # - # Options: - # * :disabled - If set to true, the user will not be able to use this input. - # * :size - The number of visible characters that will fit in the input. - # * :maxlength - The maximum number of characters that the browser will allow the user to enter. - # - # A hash of standard HTML options for the tag. - def text_field_tag(name, value = nil, options = {}) - tag :input, { "type" => "text", "name" => name, "id" => name, "value" => value }.update(options.stringify_keys) - end - - # Creates a hidden field. - # - # Takes the same options as text_field_tag - def hidden_field_tag(name, value = nil, options = {}) - text_field_tag(name, value, options.stringify_keys.update("type" => "hidden")) - end - - # Creates a file upload field. - # - # If you are using file uploads then you will also need to set the multipart option for the form: - # <%= form_tag { :action => "post" }, { :multipart => true } %> - # <%= file_field_tag "file" %> - # <%= submit_tag %> - # <%= end_form_tag %> - # - # The specified URL will then be passed a File object containing the selected file, or if the field - # was left blank, a StringIO object. - def file_field_tag(name, options = {}) - text_field_tag(name, nil, options.update("type" => "file")) - end - - # Creates a password field. - # - # Takes the same options as text_field_tag - def password_field_tag(name = "password", value = nil, options = {}) - text_field_tag(name, value, options.update("type" => "password")) - end - - # Creates a text input area. - # - # Options: - # * :size - A string specifying the dimensions of the textarea. - # # Outputs - # <%= text_area_tag "body", nil, :size => "25x10" %> - def text_area_tag(name, content = nil, options = {}) - options.stringify_keys! - - if size = options.delete("size") - options["cols"], options["rows"] = size.split("x") - end - - content_tag :textarea, content, { "name" => name, "id" => name }.update(options.stringify_keys) - end - - # Creates a check box. - def check_box_tag(name, value = "1", checked = false, options = {}) - html_options = { "type" => "checkbox", "name" => name, "id" => name, "value" => value }.update(options.stringify_keys) - html_options["checked"] = "checked" if checked - tag :input, html_options - end - - # Creates a radio button. - def radio_button_tag(name, value, checked = false, options = {}) - html_options = { "type" => "radio", "name" => name, "id" => name, "value" => value }.update(options.stringify_keys) - html_options["checked"] = "checked" if checked - tag :input, html_options - end - - # Creates a submit button with the text value as the caption. If options contains a pair with the key of "disable_with", - # then the value will be used to rename a disabled version of the submit button. - def submit_tag(value = "Save changes", options = {}) - options.stringify_keys! - - if disable_with = options.delete("disable_with") - options["onclick"] = "this.disabled=true;this.value='#{disable_with}';this.form.submit();#{options["onclick"]}" - end - - tag :input, { "type" => "submit", "name" => "commit", "value" => value }.update(options.stringify_keys) - end - - # Displays an image which when clicked will submit the form. - # - # source is passed to AssetTagHelper#image_path - def image_submit_tag(source, options = {}) - tag :input, { "type" => "image", "src" => image_path(source) }.update(options.stringify_keys) - end - end - end -end -require File.dirname(__FILE__) + '/tag_helper' - -module ActionView - module Helpers - # Provides a set of helpers for creating JavaScript macros that rely on and often bundle methods from JavaScriptHelper into - # larger units. These macros also rely on counterparts in the controller that provide them with their backing. The in-place - # editing relies on ActionController::Base.in_place_edit_for and the autocompletion relies on - # ActionController::Base.auto_complete_for. - module JavaScriptMacrosHelper - # Makes an HTML element specified by the DOM ID +field_id+ become an in-place - # editor of a property. - # - # A form is automatically created and displayed when the user clicks the element, - # something like this: - #
    - # - # - # cancel - #
    - # - # The form is serialized and sent to the server using an AJAX call, the action on - # the server should process the value and return the updated value in the body of - # the reponse. The element will automatically be updated with the changed value - # (as returned from the server). - # - # Required +options+ are: - # :url:: Specifies the url where the updated value should - # be sent after the user presses "ok". - # - # - # Addtional +options+ are: - # :rows:: Number of rows (more than 1 will use a TEXTAREA) - # :cols:: Number of characters the text input should span (works for both INPUT and TEXTAREA) - # :size:: Synonym for :cols when using a single line text input. - # :cancel_text:: The text on the cancel link. (default: "cancel") - # :save_text:: The text on the save link. (default: "ok") - # :loading_text:: The text to display when submitting to the server (default: "Saving...") - # :external_control:: The id of an external control used to enter edit mode. - # :load_text_url:: URL where initial value of editor (content) is retrieved. - # :options:: Pass through options to the AJAX call (see prototype's Ajax.Updater) - # :with:: JavaScript snippet that should return what is to be sent - # in the AJAX call, +form+ is an implicit parameter - # :script:: Instructs the in-place editor to evaluate the remote JavaScript response (default: false) - def in_place_editor(field_id, options = {}) - function = "new Ajax.InPlaceEditor(" - function << "'#{field_id}', " - function << "'#{url_for(options[:url])}'" - - js_options = {} - js_options['cancelText'] = %('#{options[:cancel_text]}') if options[:cancel_text] - js_options['okText'] = %('#{options[:save_text]}') if options[:save_text] - js_options['loadingText'] = %('#{options[:loading_text]}') if options[:loading_text] - js_options['rows'] = options[:rows] if options[:rows] - js_options['cols'] = options[:cols] if options[:cols] - js_options['size'] = options[:size] if options[:size] - js_options['externalControl'] = "'#{options[:external_control]}'" if options[:external_control] - js_options['loadTextURL'] = "'#{url_for(options[:load_text_url])}'" if options[:load_text_url] - js_options['ajaxOptions'] = options[:options] if options[:options] - js_options['evalScripts'] = options[:script] if options[:script] - js_options['callback'] = "function(form) { return #{options[:with]} }" if options[:with] - function << (', ' + options_for_javascript(js_options)) unless js_options.empty? - - function << ')' - - javascript_tag(function) - end - - # Renders the value of the specified object and method with in-place editing capabilities. - # - # See the RDoc on ActionController::InPlaceEditing to learn more about this. - def in_place_editor_field(object, method, tag_options = {}, in_place_editor_options = {}) - tag = ::ActionView::Helpers::InstanceTag.new(object, method, self) - tag_options = {:tag => "span", :id => "#{object}_#{method}_#{tag.object.id}_in_place_editor", :class => "in_place_editor_field"}.merge!(tag_options) - in_place_editor_options[:url] = in_place_editor_options[:url] || url_for({ :action => "set_#{object}_#{method}", :id => tag.object.id }) - tag.to_content_tag(tag_options.delete(:tag), tag_options) + - in_place_editor(tag_options[:id], in_place_editor_options) - end - - # Adds AJAX autocomplete functionality to the text input field with the - # DOM ID specified by +field_id+. - # - # This function expects that the called action returns a HTML
      list, - # or nothing if no entries should be displayed for autocompletion. - # - # You'll probably want to turn the browser's built-in autocompletion off, - # so be sure to include a autocomplete="off" attribute with your text - # input field. - # - # The autocompleter object is assigned to a Javascript variable named field_id_auto_completer. - # This object is useful if you for example want to trigger the auto-complete suggestions through - # other means than user input (for that specific case, call the activate method on that object). - # - # Required +options+ are: - # :url:: URL to call for autocompletion results - # in url_for format. - # - # Addtional +options+ are: - # :update:: Specifies the DOM ID of the element whose - # innerHTML should be updated with the autocomplete - # entries returned by the AJAX request. - # Defaults to field_id + '_auto_complete' - # :with:: A JavaScript expression specifying the - # parameters for the XMLHttpRequest. This defaults - # to 'fieldname=value'. - # :frequency:: Determines the time to wait after the last keystroke - # for the AJAX request to be initiated. - # :indicator:: Specifies the DOM ID of an element which will be - # displayed while autocomplete is running. - # :tokens:: A string or an array of strings containing - # separator tokens for tokenized incremental - # autocompletion. Example: :tokens => ',' would - # allow multiple autocompletion entries, separated - # by commas. - # :min_chars:: The minimum number of characters that should be - # in the input field before an Ajax call is made - # to the server. - # :on_hide:: A Javascript expression that is called when the - # autocompletion div is hidden. The expression - # should take two variables: element and update. - # Element is a DOM element for the field, update - # is a DOM element for the div from which the - # innerHTML is replaced. - # :on_show:: Like on_hide, only now the expression is called - # then the div is shown. - # :after_update_element:: A Javascript expression that is called when the - # user has selected one of the proposed values. - # The expression should take two variables: element and value. - # Element is a DOM element for the field, value - # is the value selected by the user. - # :select:: Pick the class of the element from which the value for - # insertion should be extracted. If this is not specified, - # the entire element is used. - def auto_complete_field(field_id, options = {}) - function = "var #{field_id}_auto_completer = new Ajax.Autocompleter(" - function << "'#{field_id}', " - function << "'" + (options[:update] || "#{field_id}_auto_complete") + "', " - function << "'#{url_for(options[:url])}'" - - js_options = {} - js_options[:tokens] = array_or_string_for_javascript(options[:tokens]) if options[:tokens] - js_options[:callback] = "function(element, value) { return #{options[:with]} }" if options[:with] - js_options[:indicator] = "'#{options[:indicator]}'" if options[:indicator] - js_options[:select] = "'#{options[:select]}'" if options[:select] - js_options[:frequency] = "#{options[:frequency]}" if options[:frequency] - - { :after_update_element => :afterUpdateElement, - :on_show => :onShow, :on_hide => :onHide, :min_chars => :minChars }.each do |k,v| - js_options[v] = options[k] if options[k] - end - - function << (', ' + options_for_javascript(js_options) + ')') - - javascript_tag(function) - end - - # Use this method in your view to generate a return for the AJAX autocomplete requests. - # - # Example action: - # - # def auto_complete_for_item_title - # @items = Item.find(:all, - # :conditions => [ 'LOWER(description) LIKE ?', - # '%' + request.raw_post.downcase + '%' ]) - # render :inline => '<%= auto_complete_result(@items, 'description') %>' - # end - # - # The auto_complete_result can of course also be called from a view belonging to the - # auto_complete action if you need to decorate it further. - def auto_complete_result(entries, field, phrase = nil) - return unless entries - items = entries.map { |entry| content_tag("li", phrase ? highlight(entry[field], phrase) : h(entry[field])) } - content_tag("ul", items.uniq) - end - - # Wrapper for text_field with added AJAX autocompletion functionality. - # - # In your controller, you'll need to define an action called - # auto_complete_for_object_method to respond the AJAX calls, - # - # See the RDoc on ActionController::AutoComplete to learn more about this. - def text_field_with_auto_complete(object, method, tag_options = {}, completion_options = {}) - (completion_options[:skip_style] ? "" : auto_complete_stylesheet) + - text_field(object, method, tag_options) + - content_tag("div", "", :id => "#{object}_#{method}_auto_complete", :class => "auto_complete") + - auto_complete_field("#{object}_#{method}", { :url => { :action => "auto_complete_for_#{object}_#{method}" } }.update(completion_options)) - end - - private - def auto_complete_stylesheet - content_tag("style", <<-EOT - div.auto_complete { - width: 350px; - background: #fff; - } - div.auto_complete ul { - border:1px solid #888; - margin:0; - padding:0; - width:100%; - list-style-type:none; - } - div.auto_complete ul li { - margin:0; - padding:3px; - } - div.auto_complete ul li.selected { - background-color: #ffb; - } - div.auto_complete ul strong.highlight { - color: #800; - margin:0; - padding:0; - } - EOT - ) - end - - end - end -end -require File.dirname(__FILE__) + '/tag_helper' - -module ActionView - module Helpers - # Provides functionality for working with JavaScript in your views. - # - # == Ajax, controls and visual effects - # - # * For information on using Ajax, see - # ActionView::Helpers::PrototypeHelper. - # * For information on using controls and visual effects, see - # ActionView::Helpers::ScriptaculousHelper. - # - # == Including the JavaScript libraries into your pages - # - # Rails includes the Prototype JavaScript framework and the Scriptaculous - # JavaScript controls and visual effects library. If you wish to use - # these libraries and their helpers (ActionView::Helpers::PrototypeHelper - # and ActionView::Helpers::ScriptaculousHelper), you must do one of the - # following: - # - # * Use <%= javascript_include_tag :defaults %> in the HEAD - # section of your page (recommended): This function will return - # references to the JavaScript files created by the +rails+ command in - # your public/javascripts directory. Using it is recommended as - # the browser can then cache the libraries instead of fetching all the - # functions anew on every request. - # * Use <%= javascript_include_tag 'prototype' %>: As above, but - # will only include the Prototype core library, which means you are able - # to use all basic AJAX functionality. For the Scriptaculous-based - # JavaScript helpers, like visual effects, autocompletion, drag and drop - # and so on, you should use the method described above. - # * Use <%= define_javascript_functions %>: this will copy all the - # JavaScript support functions within a single script block. Not - # recommended. - # - # For documentation on +javascript_include_tag+ see - # ActionView::Helpers::AssetTagHelper. - module JavaScriptHelper - unless const_defined? :JAVASCRIPT_PATH - JAVASCRIPT_PATH = File.join(File.dirname(__FILE__), 'javascripts') - end - - # Returns a link that'll trigger a JavaScript +function+ using the - # onclick handler and return false after the fact. - # - # Examples: - # link_to_function "Greeting", "alert('Hello world!')" - # link_to_function(image_tag("delete"), "if confirm('Really?'){ do_delete(); }") - def link_to_function(name, function, html_options = {}) - html_options.symbolize_keys! - content_tag( - "a", name, - html_options.merge({ - :href => html_options[:href] || "#", - :onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function}; return false;" - }) - ) - end - - # Returns a link that'll trigger a JavaScript +function+ using the - # onclick handler. - # - # Examples: - # button_to_function "Greeting", "alert('Hello world!')" - # button_to_function "Delete", "if confirm('Really?'){ do_delete(); }") - def button_to_function(name, function, html_options = {}) - html_options.symbolize_keys! - tag(:input, html_options.merge({ - :type => "button", :value => name, - :onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function};" - })) - end - - # Includes the Action Pack JavaScript libraries inside a single ' - end - - # Escape carrier returns and single and double quotes for JavaScript segments. - def escape_javascript(javascript) - (javascript || '').gsub(/\r\n|\n|\r/, "\\n").gsub(/["']/) { |m| "\\#{m}" } - end - - # Returns a JavaScript tag with the +content+ inside. Example: - # javascript_tag "alert('All is good')" # => - def javascript_tag(content) - content_tag("script", javascript_cdata_section(content), :type => "text/javascript") - end - - def javascript_cdata_section(content) #:nodoc: - "\n//#{cdata_section("\n#{content}\n//")}\n" - end - - protected - def options_for_javascript(options) - '{' + options.map {|k, v| "#{k}:#{v}"}.sort.join(', ') + '}' - end - - def array_or_string_for_javascript(option) - js_option = if option.kind_of?(Array) - "['#{option.join('\',\'')}']" - elsif !option.nil? - "'#{option}'" - end - js_option - end - end - - JavascriptHelper = JavaScriptHelper unless const_defined? :JavascriptHelper - end -end -module ActionView - module Helpers - # Provides methods for converting a number into a formatted string that currently represents - # one of the following forms: phone number, percentage, money, or precision level. - module NumberHelper - - # Formats a +number+ into a US phone number string. The +options+ can be a hash used to customize the format of the output. - # The area code can be surrounded by parentheses by setting +:area_code+ to true; default is false - # The delimiter can be set using +:delimiter+; default is "-" - # Examples: - # number_to_phone(1235551234) => 123-555-1234 - # number_to_phone(1235551234, {:area_code => true}) => (123) 555-1234 - # number_to_phone(1235551234, {:delimiter => " "}) => 123 555 1234 - # number_to_phone(1235551234, {:area_code => true, :extension => 555}) => (123) 555-1234 x 555 - def number_to_phone(number, options = {}) - options = options.stringify_keys - area_code = options.delete("area_code") { false } - delimiter = options.delete("delimiter") { "-" } - extension = options.delete("extension") { "" } - begin - str = area_code == true ? number.to_s.gsub(/([0-9]{3})([0-9]{3})([0-9]{4})/,"(\\1) \\2#{delimiter}\\3") : number.to_s.gsub(/([0-9]{3})([0-9]{3})([0-9]{4})/,"\\1#{delimiter}\\2#{delimiter}\\3") - extension.to_s.strip.empty? ? str : "#{str} x #{extension.to_s.strip}" - rescue - number - end - end - - # Formats a +number+ into a currency string. The +options+ hash can be used to customize the format of the output. - # The +number+ can contain a level of precision using the +precision+ key; default is 2 - # The currency type can be set using the +unit+ key; default is "$" - # The unit separator can be set using the +separator+ key; default is "." - # The delimiter can be set using the +delimiter+ key; default is "," - # Examples: - # number_to_currency(1234567890.50) => $1,234,567,890.50 - # number_to_currency(1234567890.506) => $1,234,567,890.51 - # number_to_currency(1234567890.50, {:unit => "£", :separator => ",", :delimiter => ""}) => £1234567890,50 - def number_to_currency(number, options = {}) - options = options.stringify_keys - precision, unit, separator, delimiter = options.delete("precision") { 2 }, options.delete("unit") { "$" }, options.delete("separator") { "." }, options.delete("delimiter") { "," } - separator = "" unless precision > 0 - begin - parts = number_with_precision(number, precision).split('.') - unit + number_with_delimiter(parts[0], delimiter) + separator + parts[1].to_s - rescue - number - end - end - - # Formats a +number+ as into a percentage string. The +options+ hash can be used to customize the format of the output. - # The +number+ can contain a level of precision using the +precision+ key; default is 3 - # The unit separator can be set using the +separator+ key; default is "." - # Examples: - # number_to_percentage(100) => 100.000% - # number_to_percentage(100, {:precision => 0}) => 100% - # number_to_percentage(302.0574, {:precision => 2}) => 302.06% - def number_to_percentage(number, options = {}) - options = options.stringify_keys - precision, separator = options.delete("precision") { 3 }, options.delete("separator") { "." } - begin - number = number_with_precision(number, precision) - parts = number.split('.') - if parts.at(1).nil? - parts[0] + "%" - else - parts[0] + separator + parts[1].to_s + "%" - end - rescue - number - end - end - - # Formats a +number+ with a +delimiter+. - # Example: - # number_with_delimiter(12345678) => 12,345,678 - def number_with_delimiter(number, delimiter=",") - number.to_s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{delimiter}") - end - - # Returns a formatted-for-humans file size. - # - # Examples: - # human_size(123) => 123 Bytes - # human_size(1234) => 1.2 KB - # human_size(12345) => 12.1 KB - # human_size(1234567) => 1.2 MB - # human_size(1234567890) => 1.1 GB - def number_to_human_size(size) - case - when size < 1.kilobyte: '%d Bytes' % size - when size < 1.megabyte: '%.1f KB' % (size / 1.0.kilobyte) - when size < 1.gigabyte: '%.1f MB' % (size / 1.0.megabyte) - when size < 1.terabyte: '%.1f GB' % (size / 1.0.gigabyte) - else '%.1f TB' % (size / 1.0.terabyte) - end.sub('.0', '') - rescue - nil - end - - alias_method :human_size, :number_to_human_size # deprecated alias - - # Formats a +number+ with a level of +precision+. - # Example: - # number_with_precision(111.2345) => 111.235 - def number_with_precision(number, precision=3) - sprintf("%01.#{precision}f", number) - end - end - end -end -module ActionView - module Helpers - # Provides methods for linking to ActionController::Pagination objects. - # - # You can also build your links manually, like in this example: - # - # <%= link_to "Previous page", { :page => paginator.current.previous } if paginator.current.previous %> - # - # <%= link_to "Next page", { :page => paginator.current.next } if paginator.current.next %> - module PaginationHelper - unless const_defined?(:DEFAULT_OPTIONS) - DEFAULT_OPTIONS = { - :name => :page, - :window_size => 2, - :always_show_anchors => true, - :link_to_current_page => false, - :params => {} - } - end - - # Creates a basic HTML link bar for the given +paginator+. - # +html_options+ are passed to +link_to+. - # - # +options+ are: - # :name:: the routing name for this paginator - # (defaults to +page+) - # :window_size:: the number of pages to show around - # the current page (defaults to +2+) - # :always_show_anchors:: whether or not the first and last - # pages should always be shown - # (defaults to +true+) - # :link_to_current_page:: whether or not the current page - # should be linked to (defaults to - # +false+) - # :params:: any additional routing parameters - # for page URLs - def pagination_links(paginator, options={}, html_options={}) - name = options[:name] || DEFAULT_OPTIONS[:name] - params = (options[:params] || DEFAULT_OPTIONS[:params]).clone - - pagination_links_each(paginator, options) do |n| - params[name] = n - link_to(n.to_s, params, html_options) - end - end - - # Iterate through the pages of a given +paginator+, invoking a - # block for each page number that needs to be rendered as a link. - def pagination_links_each(paginator, options) - options = DEFAULT_OPTIONS.merge(options) - link_to_current_page = options[:link_to_current_page] - always_show_anchors = options[:always_show_anchors] - - current_page = paginator.current_page - window_pages = current_page.window(options[:window_size]).pages - return if window_pages.length <= 1 unless link_to_current_page - - first, last = paginator.first, paginator.last - - html = '' - if always_show_anchors and not (wp_first = window_pages[0]).first? - html << yield(first.number) - html << ' ... ' if wp_first.number - first.number > 1 - html << ' ' - end - - window_pages.each do |page| - if current_page == page && !link_to_current_page - html << page.number.to_s - else - html << yield(page.number) - end - html << ' ' - end - - if always_show_anchors and not (wp_last = window_pages[-1]).last? - html << ' ... ' if last.number - wp_last.number > 1 - html << yield(last.number) - end - - html - end - - end # PaginationHelper - end # Helpers -end # ActionView -require File.dirname(__FILE__) + '/javascript_helper' -require 'set' - -module ActionView - module Helpers - # Provides a set of helpers for calling Prototype JavaScript functions, - # including functionality to call remote methods using - # Ajax[http://www.adaptivepath.com/publications/essays/archives/000385.php]. - # This means that you can call actions in your controllers without - # reloading the page, but still update certain parts of it using - # injections into the DOM. The common use case is having a form that adds - # a new element to a list without reloading the page. - # - # To be able to use these helpers, you must include the Prototype - # JavaScript framework in your pages. See the documentation for - # ActionView::Helpers::JavaScriptHelper for more information on including - # the necessary JavaScript. - # - # See link_to_remote for documentation of options common to all Ajax - # helpers. - # - # See also ActionView::Helpers::ScriptaculousHelper for helpers which work - # with the Scriptaculous controls and visual effects library. - # - # See JavaScriptGenerator for information on updating multiple elements - # on the page in an Ajax response. - module PrototypeHelper - unless const_defined? :CALLBACKS - CALLBACKS = Set.new([ :uninitialized, :loading, :loaded, - :interactive, :complete, :failure, :success ] + - (100..599).to_a) - AJAX_OPTIONS = Set.new([ :before, :after, :condition, :url, - :asynchronous, :method, :insertion, :position, - :form, :with, :update, :script ]).merge(CALLBACKS) - end - - # Returns a link to a remote action defined by options[:url] - # (using the url_for format) that's called in the background using - # XMLHttpRequest. The result of that request can then be inserted into a - # DOM object whose id can be specified with options[:update]. - # Usually, the result would be a partial prepared by the controller with - # either render_partial or render_partial_collection. - # - # Examples: - # link_to_remote "Delete this post", :update => "posts", - # :url => { :action => "destroy", :id => post.id } - # link_to_remote(image_tag("refresh"), :update => "emails", - # :url => { :action => "list_emails" }) - # - # You can also specify a hash for options[:update] to allow for - # easy redirection of output to an other DOM element if a server-side - # error occurs: - # - # Example: - # link_to_remote "Delete this post", - # :url => { :action => "destroy", :id => post.id }, - # :update => { :success => "posts", :failure => "error" } - # - # Optionally, you can use the options[:position] parameter to - # influence how the target DOM element is updated. It must be one of - # :before, :top, :bottom, or :after. - # - # By default, these remote requests are processed asynchronous during - # which various JavaScript callbacks can be triggered (for progress - # indicators and the likes). All callbacks get access to the - # request object, which holds the underlying XMLHttpRequest. - # - # To access the server response, use request.responseText, to - # find out the HTTP status, use request.status. - # - # Example: - # link_to_remote word, - # :url => { :action => "undo", :n => word_counter }, - # :complete => "undoRequestCompleted(request)" - # - # The callbacks that may be specified are (in order): - # - # :loading:: Called when the remote document is being - # loaded with data by the browser. - # :loaded:: Called when the browser has finished loading - # the remote document. - # :interactive:: Called when the user can interact with the - # remote document, even though it has not - # finished loading. - # :success:: Called when the XMLHttpRequest is completed, - # and the HTTP status code is in the 2XX range. - # :failure:: Called when the XMLHttpRequest is completed, - # and the HTTP status code is not in the 2XX - # range. - # :complete:: Called when the XMLHttpRequest is complete - # (fires after success/failure if they are - # present). - # - # You can further refine :success and :failure by - # adding additional callbacks for specific status codes. - # - # Example: - # link_to_remote word, - # :url => { :action => "action" }, - # 404 => "alert('Not found...? Wrong URL...?')", - # :failure => "alert('HTTP Error ' + request.status + '!')" - # - # A status code callback overrides the success/failure handlers if - # present. - # - # If you for some reason or another need synchronous processing (that'll - # block the browser while the request is happening), you can specify - # options[:type] = :synchronous. - # - # You can customize further browser side call logic by passing in - # JavaScript code snippets via some optional parameters. In their order - # of use these are: - # - # :confirm:: Adds confirmation dialog. - # :condition:: Perform remote request conditionally - # by this expression. Use this to - # describe browser-side conditions when - # request should not be initiated. - # :before:: Called before request is initiated. - # :after:: Called immediately after request was - # initiated and before :loading. - # :submit:: Specifies the DOM element ID that's used - # as the parent of the form elements. By - # default this is the current form, but - # it could just as well be the ID of a - # table row or any other DOM element. - def link_to_remote(name, options = {}, html_options = {}) - link_to_function(name, remote_function(options), html_options) - end - - # Periodically calls the specified url (options[:url]) every - # options[:frequency] seconds (default is 10). Usually used to - # update a specified div (options[:update]) with the results - # of the remote call. The options for specifying the target with :url - # and defining callbacks is the same as link_to_remote. - def periodically_call_remote(options = {}) - frequency = options[:frequency] || 10 # every ten seconds by default - code = "new PeriodicalExecuter(function() {#{remote_function(options)}}, #{frequency})" - javascript_tag(code) - end - - # Returns a form tag that will submit using XMLHttpRequest in the - # background instead of the regular reloading POST arrangement. Even - # though it's using JavaScript to serialize the form elements, the form - # submission will work just like a regular submission as viewed by the - # receiving side (all elements available in params). The options for - # specifying the target with :url and defining callbacks is the same as - # link_to_remote. - # - # A "fall-through" target for browsers that doesn't do JavaScript can be - # specified with the :action/:method options on :html. - # - # Example: - # form_remote_tag :html => { :action => - # url_for(:controller => "some", :action => "place") } - # - # The Hash passed to the :html key is equivalent to the options (2nd) - # argument in the FormTagHelper.form_tag method. - # - # By default the fall-through action is the same as the one specified in - # the :url (and the default method is :post). - def form_remote_tag(options = {}) - options[:form] = true - - options[:html] ||= {} - options[:html][:onsubmit] = "#{remote_function(options)}; return false;" - options[:html][:action] = options[:html][:action] || url_for(options[:url]) - options[:html][:method] = options[:html][:method] || "post" - - tag("form", options[:html], true) - end - - # Works like form_remote_tag, but uses form_for semantics. - def remote_form_for(object_name, *args, &proc) - options = args.last.is_a?(Hash) ? args.pop : {} - concat(form_remote_tag(options), proc.binding) - fields_for(object_name, *(args << options), &proc) - concat('', proc.binding) - end - alias_method :form_remote_for, :remote_form_for - - # Returns a button input tag that will submit form using XMLHttpRequest - # in the background instead of regular reloading POST arrangement. - # options argument is the same as in form_remote_tag. - def submit_to_remote(name, value, options = {}) - options[:with] ||= 'Form.serialize(this.form)' - - options[:html] ||= {} - options[:html][:type] = 'button' - options[:html][:onclick] = "#{remote_function(options)}; return false;" - options[:html][:name] = name - options[:html][:value] = value - - tag("input", options[:html], false) - end - - # Returns a JavaScript function (or expression) that'll update a DOM - # element according to the options passed. - # - # * :content: The content to use for updating. Can be left out - # if using block, see example. - # * :action: Valid options are :update (assumed by default), - # :empty, :remove - # * :position If the :action is :update, you can optionally - # specify one of the following positions: :before, :top, :bottom, - # :after. - # - # Examples: - # <%= javascript_tag(update_element_function("products", - # :position => :bottom, :content => "

      New product!

      ")) %> - # - # <% replacement_function = update_element_function("products") do %> - #

      Product 1

      - #

      Product 2

      - # <% end %> - # <%= javascript_tag(replacement_function) %> - # - # This method can also be used in combination with remote method call - # where the result is evaluated afterwards to cause multiple updates on - # a page. Example: - # - # # Calling view - # <%= form_remote_tag :url => { :action => "buy" }, - # :complete => evaluate_remote_response %> - # all the inputs here... - # - # # Controller action - # def buy - # @product = Product.find(1) - # end - # - # # Returning view - # <%= update_element_function( - # "cart", :action => :update, :position => :bottom, - # :content => "

      New Product: #{@product.name}

      ")) %> - # <% update_element_function("status", :binding => binding) do %> - # You've bought a new product! - # <% end %> - # - # Notice how the second call doesn't need to be in an ERb output block - # since it uses a block and passes in the binding to render directly. - # This trick will however only work in ERb (not Builder or other - # template forms). - # - # See also JavaScriptGenerator and update_page. - def update_element_function(element_id, options = {}, &block) - content = escape_javascript(options[:content] || '') - content = escape_javascript(capture(&block)) if block - - javascript_function = case (options[:action] || :update) - when :update - if options[:position] - "new Insertion.#{options[:position].to_s.camelize}('#{element_id}','#{content}')" - else - "$('#{element_id}').innerHTML = '#{content}'" - end - - when :empty - "$('#{element_id}').innerHTML = ''" - - when :remove - "Element.remove('#{element_id}')" - - else - raise ArgumentError, "Invalid action, choose one of :update, :remove, :empty" - end - - javascript_function << ";\n" - options[:binding] ? concat(javascript_function, options[:binding]) : javascript_function - end - - # Returns 'eval(request.responseText)' which is the JavaScript function - # that form_remote_tag can call in :complete to evaluate a multiple - # update return document using update_element_function calls. - def evaluate_remote_response - "eval(request.responseText)" - end - - # Returns the JavaScript needed for a remote function. - # Takes the same arguments as link_to_remote. - # - # Example: - # - def remote_function(options) - javascript_options = options_for_ajax(options) - - update = '' - if options[:update] and options[:update].is_a?Hash - update = [] - update << "success:'#{options[:update][:success]}'" if options[:update][:success] - update << "failure:'#{options[:update][:failure]}'" if options[:update][:failure] - update = '{' + update.join(',') + '}' - elsif options[:update] - update << "'#{options[:update]}'" - end - - function = update.empty? ? - "new Ajax.Request(" : - "new Ajax.Updater(#{update}, " - - url_options = options[:url] - url_options = url_options.merge(:escape => false) if url_options.is_a? Hash - function << "'#{url_for(url_options)}'" - function << ", #{javascript_options})" - - function = "#{options[:before]}; #{function}" if options[:before] - function = "#{function}; #{options[:after]}" if options[:after] - function = "if (#{options[:condition]}) { #{function}; }" if options[:condition] - function = "if (confirm('#{escape_javascript(options[:confirm])}')) { #{function}; }" if options[:confirm] - - return function - end - - # Observes the field with the DOM ID specified by +field_id+ and makes - # an Ajax call when its contents have changed. - # - # Required +options+ are either of: - # :url:: +url_for+-style options for the action to call - # when the field has changed. - # :function:: Instead of making a remote call to a URL, you - # can specify a function to be called instead. - # - # Additional options are: - # :frequency:: The frequency (in seconds) at which changes to - # this field will be detected. Not setting this - # option at all or to a value equal to or less than - # zero will use event based observation instead of - # time based observation. - # :update:: Specifies the DOM ID of the element whose - # innerHTML should be updated with the - # XMLHttpRequest response text. - # :with:: A JavaScript expression specifying the - # parameters for the XMLHttpRequest. This defaults - # to 'value', which in the evaluated context - # refers to the new field value. If you specify a - # string without a "=", it'll be extended to mean - # the form key that the value should be assigned to. - # So :with => "term" gives "'term'=value". If a "=" is - # present, no extension will happen. - # :on:: Specifies which event handler to observe. By default, - # it's set to "changed" for text fields and areas and - # "click" for radio buttons and checkboxes. With this, - # you can specify it instead to be "blur" or "focus" or - # any other event. - # - # Additionally, you may specify any of the options documented in - # link_to_remote. - def observe_field(field_id, options = {}) - if options[:frequency] && options[:frequency] > 0 - build_observer('Form.Element.Observer', field_id, options) - else - build_observer('Form.Element.EventObserver', field_id, options) - end - end - - # Like +observe_field+, but operates on an entire form identified by the - # DOM ID +form_id+. +options+ are the same as +observe_field+, except - # the default value of the :with option evaluates to the - # serialized (request string) value of the form. - def observe_form(form_id, options = {}) - if options[:frequency] - build_observer('Form.Observer', form_id, options) - else - build_observer('Form.EventObserver', form_id, options) - end - end - - # All the methods were moved to GeneratorMethods so that - # #include_helpers_from_context has nothing to overwrite. - class JavaScriptGenerator #:nodoc: - def initialize(context, &block) #:nodoc: - @context, @lines = context, [] - include_helpers_from_context - @context.instance_exec(self, &block) - end - - private - def include_helpers_from_context - @context.extended_by.each do |mod| - extend mod unless mod.name =~ /^ActionView::Helpers/ - end - extend GeneratorMethods - end - - # JavaScriptGenerator generates blocks of JavaScript code that allow you - # to change the content and presentation of multiple DOM elements. Use - # this in your Ajax response bodies, either in a - # - # mail_to "me@domain.com", "My email", :encode => "hex" # => - # My email - # - # You can also specify the cc address, bcc address, subject, and body parts of the message header to create a complex e-mail using the - # corresponding +cc+, +bcc+, +subject+, and +body+ html_options keys. Each of these options are URI escaped and then appended to - # the email_address before being output. Be aware that javascript keywords will not be escaped and may break this feature - # when encoding with javascript. - # Examples: - # mail_to "me@domain.com", "My email", :cc => "ccaddress@domain.com", :bcc => "bccaddress@domain.com", :subject => "This is an example email", :body => "This is the body of the message." # => - # My email - def mail_to(email_address, name = nil, html_options = {}) - html_options = html_options.stringify_keys - encode = html_options.delete("encode") - cc, bcc, subject, body = html_options.delete("cc"), html_options.delete("bcc"), html_options.delete("subject"), html_options.delete("body") - - string = '' - extras = '' - extras << "cc=#{CGI.escape(cc).gsub("+", "%20")}&" unless cc.nil? - extras << "bcc=#{CGI.escape(bcc).gsub("+", "%20")}&" unless bcc.nil? - extras << "body=#{CGI.escape(body).gsub("+", "%20")}&" unless body.nil? - extras << "subject=#{CGI.escape(subject).gsub("+", "%20")}&" unless subject.nil? - extras = "?" << extras.gsub!(/&?$/,"") unless extras.empty? - - email_address_obfuscated = email_address.dup - email_address_obfuscated.gsub!(/@/, html_options.delete("replace_at")) if html_options.has_key?("replace_at") - email_address_obfuscated.gsub!(/\./, html_options.delete("replace_dot")) if html_options.has_key?("replace_dot") - - if encode == 'javascript' - tmp = "document.write('#{content_tag("a", name || email_address, html_options.merge({ "href" => "mailto:"+email_address.to_s+extras }))}');" - for i in 0...tmp.length - string << sprintf("%%%x",tmp[i]) - end - "" - elsif encode == 'hex' - for i in 0...email_address.length - if email_address[i,1] =~ /\w/ - string << sprintf("%%%x",email_address[i]) - else - string << email_address[i,1] - end - end - content_tag "a", name || email_address_obfuscated, html_options.merge({ "href" => "mailto:#{string}#{extras}" }) - else - content_tag "a", name || email_address_obfuscated, html_options.merge({ "href" => "mailto:#{email_address}#{extras}" }) - end - end - - # Returns true if the current page uri is generated by the options passed (in url_for format). - def current_page?(options) - CGI.escapeHTML(url_for(options)) == @controller.request.request_uri - end - - private - def convert_options_to_javascript!(html_options) - confirm, popup, post = html_options.delete("confirm"), html_options.delete("popup"), html_options.delete("post") - - html_options["onclick"] = case - when popup && post - raise ActionView::ActionViewError, "You can't use :popup and :post in the same link" - when confirm && popup - "if (#{confirm_javascript_function(confirm)}) { #{popup_javascript_function(popup)} };return false;" - when confirm && post - "if (#{confirm_javascript_function(confirm)}) { #{post_javascript_function} };return false;" - when confirm - "return #{confirm_javascript_function(confirm)};" - when post - "#{post_javascript_function}return false;" - when popup - popup_javascript_function(popup) + 'return false;' - else - html_options["onclick"] - end - end - - def confirm_javascript_function(confirm) - "confirm('#{escape_javascript(confirm)}')" - end - - def popup_javascript_function(popup) - popup.is_a?(Array) ? "window.open(this.href,'#{popup.first}','#{popup.last}');" : "window.open(this.href);" - end - - def post_javascript_function - "var f = document.createElement('form'); this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href; f.submit();" - end - - # Processes the _html_options_ hash, converting the boolean - # attributes from true/false form into the form required by - # HTML/XHTML. (An attribute is considered to be boolean if - # its name is listed in the given _bool_attrs_ array.) - # - # More specifically, for each boolean attribute in _html_options_ - # given as: - # - # "attr" => bool_value - # - # if the associated _bool_value_ evaluates to true, it is - # replaced with the attribute's name; otherwise the attribute is - # removed from the _html_options_ hash. (See the XHTML 1.0 spec, - # section 4.5 "Attribute Minimization" for more: - # http://www.w3.org/TR/xhtml1/#h-4.5) - # - # Returns the updated _html_options_ hash, which is also modified - # in place. - # - # Example: - # - # convert_boolean_attributes!( html_options, - # %w( checked disabled readonly ) ) - def convert_boolean_attributes!(html_options, bool_attrs) - bool_attrs.each { |x| html_options[x] = x if html_options.delete(x) } - html_options - end - end - end -end -module ActionView - # There's also a convenience method for rendering sub templates within the current controller that depends on a single object - # (we call this kind of sub templates for partials). It relies on the fact that partials should follow the naming convention of being - # prefixed with an underscore -- as to separate them from regular templates that could be rendered on their own. - # - # In a template for Advertiser#account: - # - # <%= render :partial => "account" %> - # - # This would render "advertiser/_account.rhtml" and pass the instance variable @account in as a local variable +account+ to - # the template for display. - # - # In another template for Advertiser#buy, we could have: - # - # <%= render :partial => "account", :locals => { :account => @buyer } %> - # - # <% for ad in @advertisements %> - # <%= render :partial => "ad", :locals => { :ad => ad } %> - # <% end %> - # - # This would first render "advertiser/_account.rhtml" with @buyer passed in as the local variable +account+, then render - # "advertiser/_ad.rhtml" and pass the local variable +ad+ to the template for display. - # - # == Rendering a collection of partials - # - # The example of partial use describes a familiar pattern where a template needs to iterate over an array and render a sub - # template for each of the elements. This pattern has been implemented as a single method that accepts an array and renders - # a partial by the same name as the elements contained within. So the three-lined example in "Using partials" can be rewritten - # with a single line: - # - # <%= render :partial => "ad", :collection => @advertisements %> - # - # This will render "advertiser/_ad.rhtml" and pass the local variable +ad+ to the template for display. An iteration counter - # will automatically be made available to the template with a name of the form +partial_name_counter+. In the case of the - # example above, the template would be fed +ad_counter+. - # - # NOTE: Due to backwards compatibility concerns, the collection can't be one of hashes. Normally you'd also just keep domain objects, - # like Active Records, in there. - # - # == Rendering shared partials - # - # Two controllers can share a set of partials and render them like this: - # - # <%= render :partial => "advertisement/ad", :locals => { :ad => @advertisement } %> - # - # This will render the partial "advertisement/_ad.rhtml" regardless of which controller this is being called from. - module Partials - # Deprecated, use render :partial - def render_partial(partial_path, local_assigns = nil, deprecated_local_assigns = nil) #:nodoc: - path, partial_name = partial_pieces(partial_path) - object = extracting_object(partial_name, local_assigns, deprecated_local_assigns) - local_assigns = extract_local_assigns(local_assigns, deprecated_local_assigns) - local_assigns = local_assigns ? local_assigns.clone : {} - add_counter_to_local_assigns!(partial_name, local_assigns) - add_object_to_local_assigns!(partial_name, local_assigns, object) - - if logger - ActionController::Base.benchmark("Rendered #{path}/_#{partial_name}", Logger::DEBUG, false) do - render("#{path}/_#{partial_name}", local_assigns) - end - else - render("#{path}/_#{partial_name}", local_assigns) - end - end - - # Deprecated, use render :partial, :collection - def render_partial_collection(partial_name, collection, partial_spacer_template = nil, local_assigns = nil) #:nodoc: - collection_of_partials = Array.new - counter_name = partial_counter_name(partial_name) - local_assigns = local_assigns ? local_assigns.clone : {} - collection.each_with_index do |element, counter| - local_assigns[counter_name] = counter - collection_of_partials.push(render_partial(partial_name, element, local_assigns)) - end - - return " " if collection_of_partials.empty? - - if partial_spacer_template - spacer_path, spacer_name = partial_pieces(partial_spacer_template) - collection_of_partials.join(render("#{spacer_path}/_#{spacer_name}")) - else - collection_of_partials.join - end - end - - alias_method :render_collection_of_partials, :render_partial_collection - - private - def partial_pieces(partial_path) - if partial_path.include?('/') - return File.dirname(partial_path), File.basename(partial_path) - else - return controller.class.controller_path, partial_path - end - end - - def partial_counter_name(partial_name) - "#{partial_name.split('/').last}_counter".intern - end - - def extracting_object(partial_name, local_assigns, deprecated_local_assigns) - if local_assigns.is_a?(Hash) || local_assigns.nil? - controller.instance_variable_get("@#{partial_name}") - else - # deprecated form where object could be passed in as second parameter - local_assigns - end - end - - def extract_local_assigns(local_assigns, deprecated_local_assigns) - local_assigns.is_a?(Hash) ? local_assigns : deprecated_local_assigns - end - - def add_counter_to_local_assigns!(partial_name, local_assigns) - counter_name = partial_counter_name(partial_name) - local_assigns[counter_name] = 1 unless local_assigns.has_key?(counter_name) - end - - def add_object_to_local_assigns!(partial_name, local_assigns, object) - local_assigns[partial_name.intern] ||= - if object.is_a?(ActionView::Base::ObjectWrapper) - object.value - else - object - end || controller.instance_variable_get("@#{partial_name}") - end - end -end -module ActionView - # The TemplateError exception is raised when the compilation of the template fails. This exception then gathers a - # bunch of intimate details and uses it to report a very precise exception message. - class TemplateError < ActionViewError #:nodoc: - SOURCE_CODE_RADIUS = 3 - - attr_reader :original_exception - - def initialize(base_path, file_name, assigns, source, original_exception) - @base_path, @assigns, @source, @original_exception = - base_path, assigns, source, original_exception - @file_name = file_name - end - - def message - original_exception.message - end - - def sub_template_message - if @sub_templates - "Trace of template inclusion: " + - @sub_templates.collect { |template| strip_base_path(template) }.join(", ") - else - "" - end - end - - def source_extract(indention = 0) - source_code = IO.readlines(@file_name) - - start_on_line = [ line_number - SOURCE_CODE_RADIUS - 1, 0 ].max - end_on_line = [ line_number + SOURCE_CODE_RADIUS - 1, source_code.length].min - - line_counter = start_on_line - extract = source_code[start_on_line..end_on_line].collect do |line| - line_counter += 1 - "#{' ' * indention}#{line_counter}: " + line - end - - extract.join - end - - def sub_template_of(file_name) - @sub_templates ||= [] - @sub_templates << file_name - end - - def line_number - if file_name - regexp = /#{Regexp.escape File.basename(file_name)}:(\d+)/ - [@original_exception.message, @original_exception.clean_backtrace].flatten.each do |line| - return $1.to_i if regexp =~ line - end - end - 0 - end - - def file_name - stripped = strip_base_path(@file_name) - stripped[0] == ?/ ? stripped[1..-1] : stripped - end - - def to_s - "\n\n#{self.class} (#{message}) on line ##{line_number} of #{file_name}:\n" + - source_extract + "\n " + - original_exception.clean_backtrace.join("\n ") + - "\n\n" - end - - def backtrace - [ - "On line ##{line_number} of #{file_name}\n\n#{source_extract(4)}\n " + - original_exception.clean_backtrace.join("\n ") - ] - end - - private - def strip_base_path(file_name) - file_name = File.expand_path(file_name).gsub(/^#{Regexp.escape File.expand_path(RAILS_ROOT)}/, '') - file_name.gsub(@base_path, "") - end - end -end - -Exception::TraceSubstitutions << [/:in\s+`_run_(html|xml).*'\s*$/, ''] if defined?(Exception::TraceSubstitutions) -Exception::TraceSubstitutions << [%r{^\s*#{Regexp.escape RAILS_ROOT}}, '#{RAILS_ROOT}'] if defined?(RAILS_ROOT) -#-- -# Copyright (c) 2004 David Heinemeier Hansson -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#++ - -$:.unshift(File.dirname(__FILE__) + "/action_view/vendor") -require 'action_view/base' -require 'action_view/partials' - -ActionView::Base.class_eval do - include ActionView::Partials -end - -ActionView::Base.load_helpers(File.dirname(__FILE__) + "/action_view/helpers/") -$:.unshift(File.dirname(__FILE__) + '/../lib') -$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib/active_support') -$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers') - -require 'yaml' -require 'test/unit' -require 'action_controller' -require 'breakpoint' - -require 'action_controller/test_process' - -ActionController::Base.logger = nil -ActionController::Base.ignore_missing_templates = false -ActionController::Routing::Routes.reload rescue nilrequire File.dirname(__FILE__) + '/abstract_unit' - -# Define the essentials -class ActiveRecordTestConnector - cattr_accessor :able_to_connect - cattr_accessor :connected - - # Set our defaults - self.connected = false - self.able_to_connect = true -end - -# Try to grab AR -begin - PATH_TO_AR = File.dirname(__FILE__) + '/../../activerecord' - require "#{PATH_TO_AR}/lib/active_record" unless Object.const_defined?(:ActiveRecord) - require "#{PATH_TO_AR}/lib/active_record/fixtures" unless Object.const_defined?(:Fixtures) -rescue Object => e - $stderr.puts "\nSkipping ActiveRecord assertion tests: #{e}" - ActiveRecordTestConnector.able_to_connect = false -end - -# Define the rest of the connector -class ActiveRecordTestConnector - def self.setup - unless self.connected || !self.able_to_connect - setup_connection - load_schema - self.connected = true - end - rescue Object => e - $stderr.puts "\nSkipping ActiveRecord assertion tests: #{e}" - #$stderr.puts " #{e.backtrace.join("\n ")}\n" - self.able_to_connect = false - end - - private - - def self.setup_connection - if Object.const_defined?(:ActiveRecord) - - begin - ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :dbfile => ':memory:') - ActiveRecord::Base.connection - rescue Object - $stderr.puts 'SQLite 3 unavailable; falling to SQLite 2.' - ActiveRecord::Base.establish_connection(:adapter => 'sqlite', :dbfile => ':memory:') - ActiveRecord::Base.connection - end - - Object.send(:const_set, :QUOTED_TYPE, ActiveRecord::Base.connection.quote_column_name('type')) unless Object.const_defined?(:QUOTED_TYPE) - else - raise "Couldn't locate ActiveRecord." - end - end - - # Load actionpack sqlite tables - def self.load_schema - File.read(File.dirname(__FILE__) + "/fixtures/db_definitions/sqlite.sql").split(';').each do |sql| - ActiveRecord::Base.connection.execute(sql) unless sql.blank? - end - end -end - -# Test case for inheiritance -class ActiveRecordTestCase < Test::Unit::TestCase - # Set our fixture path - self.fixture_path = "#{File.dirname(__FILE__)}/fixtures/" - - def setup - abort_tests unless ActiveRecordTestConnector.connected = true - end - - # Default so Test::Unit::TestCase doesn't complain - def test_truth - end - - private - - # If things go wrong, we don't want to run our test cases. We'll just define them to test nothing. - def abort_tests - self.class.public_instance_methods.grep(/^test./).each do |method| - self.class.class_eval { define_method(method.to_sym){} } - end - end -end - -ActiveRecordTestConnector.setuprequire "#{File.dirname(__FILE__)}/../active_record_unit" -require 'fixtures/company' - -class ActiveRecordAssertionsController < ActionController::Base - self.template_root = "#{File.dirname(__FILE__)}/../fixtures/" - - # fail with 1 bad column - def nasty_columns_1 - @company = Company.new - @company.name = "B" - @company.rating = 2 - render :inline => "snicker...." - end - - # fail with 2 bad columns - def nasty_columns_2 - @company = Company.new - @company.name = "" - @company.rating = 2 - render :inline => "double snicker...." - end - - # this will pass validation - def good_company - @company = Company.new - @company.name = "A" - @company.rating = 69 - render :inline => "Goodness Gracious!" - end - - # this will fail validation - def bad_company - @company = Company.new - render :inline => "Who's Bad?" - end - - # the safety dance...... - def rescue_action(e) raise; end -end - -class ActiveRecordAssertionsControllerTest < ActiveRecordTestCase - fixtures :companies - - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @controller = ActiveRecordAssertionsController.new - super - end - - # test for 1 bad apple column - def test_some_invalid_columns - process :nasty_columns_1 - assert_success - assert_invalid_record 'company' - assert_invalid_column_on_record 'company', 'rating' - assert_valid_column_on_record 'company', 'name' - assert_valid_column_on_record 'company', %w(name id) - end - - # test for 2 bad apples columns - def test_all_invalid_columns - process :nasty_columns_2 - assert_success - assert_invalid_record 'company' - assert_invalid_column_on_record 'company', 'rating' - assert_invalid_column_on_record 'company', 'name' - assert_invalid_column_on_record 'company', %w(name rating) - end - - # ensure we have no problems with an ActiveRecord - def test_valid_record - process :good_company - assert_success - assert_valid_record 'company' - end - - # ensure we have problems with an ActiveRecord - def test_invalid_record - process :bad_company - assert_success - assert_invalid_record 'company' - end -end# Unfurl the safety net. -path_to_ar = File.dirname(__FILE__) + '/../../../activerecord' -if Object.const_defined?(:ActiveRecord) or File.exist?(path_to_ar) - begin - -# These tests exercise CGI::Session::ActiveRecordStore, so you're going to -# need AR in a sibling directory to AP and have SQLite installed. - -unless Object.const_defined?(:ActiveRecord) - require File.join(path_to_ar, 'lib', 'active_record') -end - -require File.dirname(__FILE__) + '/../abstract_unit' -require 'action_controller/session/active_record_store' - -#ActiveRecord::Base.logger = Logger.new($stdout) -begin - CGI::Session::ActiveRecordStore::Session.establish_connection(:adapter => 'sqlite3', :database => ':memory:') - CGI::Session::ActiveRecordStore::Session.connection -rescue Object - $stderr.puts 'SQLite 3 unavailable; falling back to SQLite 2.' - begin - CGI::Session::ActiveRecordStore::Session.establish_connection(:adapter => 'sqlite', :database => ':memory:') - CGI::Session::ActiveRecordStore::Session.connection - rescue Object - $stderr.puts 'SQLite 2 unavailable; skipping ActiveRecordStore test suite.' - raise SystemExit - end -end - - -module CommonActiveRecordStoreTests - def test_basics - s = session_class.new(:session_id => '1234', :data => { 'foo' => 'bar' }) - assert_equal 'bar', s.data['foo'] - assert s.save - assert_equal 'bar', s.data['foo'] - - assert_not_nil t = session_class.find_by_session_id('1234') - assert_not_nil t.data - assert_equal 'bar', t.data['foo'] - end - - def test_reload_same_session - @new_session.update - reloaded = CGI::Session.new(CGI.new, 'session_id' => @new_session.session_id, 'database_manager' => CGI::Session::ActiveRecordStore) - assert_equal 'bar', reloaded['foo'] - end - - def test_tolerates_close_close - assert_nothing_raised do - @new_session.close - @new_session.close - end - end -end - -class ActiveRecordStoreTest < Test::Unit::TestCase - include CommonActiveRecordStoreTests - - def session_class - CGI::Session::ActiveRecordStore::Session - end - - def session_id_column - "session_id" - end - - def setup - session_class.create_table! - - ENV['REQUEST_METHOD'] = 'GET' - CGI::Session::ActiveRecordStore.session_class = session_class - - @cgi = CGI.new - @new_session = CGI::Session.new(@cgi, 'database_manager' => CGI::Session::ActiveRecordStore, 'new_session' => true) - @new_session['foo'] = 'bar' - end - -# this test only applies for eager sesssion saving -# def test_another_instance -# @another = CGI::Session.new(@cgi, 'session_id' => @new_session.session_id, 'database_manager' => CGI::Session::ActiveRecordStore) -# assert_equal @new_session.session_id, @another.session_id -# end - - def test_model_attribute - assert_kind_of CGI::Session::ActiveRecordStore::Session, @new_session.model - assert_equal({ 'foo' => 'bar' }, @new_session.model.data) - end - - def test_save_unloaded_session - c = session_class.connection - bogus_class = c.quote(Base64.encode64("\004\010o:\vBlammo\000")) - c.insert("INSERT INTO #{session_class.table_name} ('#{session_id_column}', 'data') VALUES ('abcdefghijklmnop', #{bogus_class})") - - sess = session_class.find_by_session_id('abcdefghijklmnop') - assert_not_nil sess - assert !sess.loaded? - - # because the session is not loaded, the save should be a no-op. If it - # isn't, this'll try and unmarshall the bogus class, and should get an error. - assert_nothing_raised { sess.save } - end - - def teardown - session_class.drop_table! - end -end - -class ColumnLimitTest < Test::Unit::TestCase - def setup - @session_class = CGI::Session::ActiveRecordStore::Session - @session_class.create_table! - end - - def teardown - @session_class.drop_table! - end - - def test_protection_from_data_larger_than_column - # Can't test this unless there is a limit - return unless limit = @session_class.data_column_size_limit - too_big = ':(' * limit - s = @session_class.new(:session_id => '666', :data => {'foo' => too_big}) - s.data - assert_raise(ActionController::SessionOverflowError) { s.save } - end -end - -class DeprecatedActiveRecordStoreTest < ActiveRecordStoreTest - def session_id_column - "sessid" - end - - def setup - session_class.connection.execute 'create table old_sessions (id integer primary key, sessid text unique, data text)' - session_class.table_name = 'old_sessions' - session_class.send :setup_sessid_compatibility! - - ENV['REQUEST_METHOD'] = 'GET' - CGI::Session::ActiveRecordStore.session_class = session_class - - @new_session = CGI::Session.new(CGI.new, 'database_manager' => CGI::Session::ActiveRecordStore, 'new_session' => true) - @new_session['foo'] = 'bar' - end - - def teardown - session_class.connection.execute 'drop table old_sessions' - session_class.table_name = 'sessions' - end -end - -class SqlBypassActiveRecordStoreTest < ActiveRecordStoreTest - def session_class - unless @session_class - @session_class = CGI::Session::ActiveRecordStore::SqlBypass - @session_class.connection = CGI::Session::ActiveRecordStore::Session.connection - end - @session_class - end - - def test_model_attribute - assert_kind_of CGI::Session::ActiveRecordStore::SqlBypass, @new_session.model - assert_equal({ 'foo' => 'bar' }, @new_session.model.data) - end -end - - -# End of safety net. - rescue Object => e - $stderr.puts "Skipping CGI::Session::ActiveRecordStore tests: #{e}" - #$stderr.puts " #{e.backtrace.join("\n ")}" - end -end -require File.dirname(__FILE__) + '/../active_record_unit' - -require 'fixtures/topic' -require 'fixtures/reply' -require 'fixtures/developer' -require 'fixtures/project' - -class PaginationTest < ActiveRecordTestCase - fixtures :topics, :replies, :developers, :projects, :developers_projects - - class PaginationController < ActionController::Base - self.template_root = "#{File.dirname(__FILE__)}/../fixtures/" - - def simple_paginate - @topic_pages, @topics = paginate(:topics) - render :nothing => true - end - - def paginate_with_per_page - @topic_pages, @topics = paginate(:topics, :per_page => 1) - render :nothing => true - end - - def paginate_with_order - @topic_pages, @topics = paginate(:topics, :order => 'created_at asc') - render :nothing => true - end - - def paginate_with_order_by - @topic_pages, @topics = paginate(:topics, :order_by => 'created_at asc') - render :nothing => true - end - - def paginate_with_include_and_order - @topic_pages, @topics = paginate(:topics, :include => :replies, :order => 'replies.created_at asc, topics.created_at asc') - render :nothing => true - end - - def paginate_with_conditions - @topic_pages, @topics = paginate(:topics, :conditions => ["created_at > ?", 30.minutes.ago]) - render :nothing => true - end - - def paginate_with_class_name - @developer_pages, @developers = paginate(:developers, :class_name => "DeVeLoPeR") - render :nothing => true - end - - def paginate_with_singular_name - @developer_pages, @developers = paginate() - render :nothing => true - end - - def paginate_with_joins - @developer_pages, @developers = paginate(:developers, - :joins => 'LEFT JOIN developers_projects ON developers.id = developers_projects.developer_id', - :conditions => 'project_id=1') - render :nothing => true - end - - def paginate_with_join - @developer_pages, @developers = paginate(:developers, - :join => 'LEFT JOIN developers_projects ON developers.id = developers_projects.developer_id', - :conditions => 'project_id=1') - render :nothing => true - end - - def paginate_with_join_and_count - @developer_pages, @developers = paginate(:developers, - :join => 'd LEFT JOIN developers_projects ON d.id = developers_projects.developer_id', - :conditions => 'project_id=1', - :count => "d.id") - render :nothing => true - end - - def rescue_errors(e) raise e end - - def rescue_action(e) raise end - - end - - def setup - @controller = PaginationController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - super - end - - # Single Action Pagination Tests - - def test_simple_paginate - get :simple_paginate - assert_equal 1, assigns(:topic_pages).page_count - assert_equal 3, assigns(:topics).size - end - - def test_paginate_with_per_page - get :paginate_with_per_page - assert_equal 1, assigns(:topics).size - assert_equal 3, assigns(:topic_pages).page_count - end - - def test_paginate_with_order - get :paginate_with_order - expected = [topics(:futurama), - topics(:harvey_birdman), - topics(:rails)] - assert_equal expected, assigns(:topics) - assert_equal 1, assigns(:topic_pages).page_count - end - - def test_paginate_with_order_by - get :paginate_with_order - expected = assigns(:topics) - get :paginate_with_order_by - assert_equal expected, assigns(:topics) - assert_equal 1, assigns(:topic_pages).page_count - end - - def test_paginate_with_conditions - get :paginate_with_conditions - expected = [topics(:rails)] - assert_equal expected, assigns(:topics) - assert_equal 1, assigns(:topic_pages).page_count - end - - def test_paginate_with_class_name - get :paginate_with_class_name - - assert assigns(:developers).size > 0 - assert_equal DeVeLoPeR, assigns(:developers).first.class - end - - def test_paginate_with_joins - get :paginate_with_joins - assert_equal 2, assigns(:developers).size - developer_names = assigns(:developers).map { |d| d.name } - assert developer_names.include?('David') - assert developer_names.include?('Jamis') - end - - def test_paginate_with_join_and_conditions - get :paginate_with_joins - expected = assigns(:developers) - get :paginate_with_join - assert_equal expected, assigns(:developers) - end - - def test_paginate_with_join_and_count - get :paginate_with_joins - expected = assigns(:developers) - get :paginate_with_join_and_count - assert_equal expected, assigns(:developers) - end - - def test_paginate_with_include_and_order - get :paginate_with_include_and_order - expected = Topic.find(:all, :include => 'replies', :order => 'replies.created_at asc, topics.created_at asc', :limit => 10) - assert_equal expected, assigns(:topics) - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -# a controller class to facilitate the tests -class ActionPackAssertionsController < ActionController::Base - - # this does absolutely nothing - def nothing() render_text ""; end - - # a standard template - def hello_world() render "test/hello_world"; end - - # a standard template - def hello_xml_world() render "test/hello_xml_world"; end - - # a redirect to an internal location - def redirect_internal() redirect_to "/nothing"; end - - def redirect_to_action() redirect_to :action => "flash_me", :id => 1, :params => { "panda" => "fun" }; end - - def redirect_to_controller() redirect_to :controller => "elsewhere", :action => "flash_me"; end - - def redirect_to_path() redirect_to '/some/path' end - - def redirect_to_named_route() redirect_to route_one_url end - - # a redirect to an external location - def redirect_external() redirect_to_url "http://www.rubyonrails.org"; end - - # a 404 - def response404() render_text "", "404 AWOL"; end - - # a 500 - def response500() render_text "", "500 Sorry"; end - - # a fictional 599 - def response599() render_text "", "599 Whoah!"; end - - # putting stuff in the flash - def flash_me - flash['hello'] = 'my name is inigo montoya...' - render_text "Inconceivable!" - end - - # we have a flash, but nothing is in it - def flash_me_naked - flash.clear - render_text "wow!" - end - - # assign some template instance variables - def assign_this - @howdy = "ho" - render :inline => "Mr. Henke" - end - - def render_based_on_parameters - render_text "Mr. #{@params["name"]}" - end - - def render_url - render_text "
      #{url_for(:action => 'flash_me', :only_path => true)}
      " - end - - # puts something in the session - def session_stuffing - session['xmas'] = 'turkey' - render_text "ho ho ho" - end - - # raises exception on get requests - def raise_on_get - raise "get" if @request.get? - render_text "request method: #{@request.env['REQUEST_METHOD']}" - end - - # raises exception on post requests - def raise_on_post - raise "post" if @request.post? - render_text "request method: #{@request.env['REQUEST_METHOD']}" - end - - def get_valid_record - @record = Class.new do - def valid? - true - end - - def errors - Class.new do - def full_messages; []; end - end.new - end - - end.new - - render :nothing => true - end - - - def get_invalid_record - @record = Class.new do - - def valid? - false - end - - def errors - Class.new do - def full_messages; ['...stuff...']; end - end.new - end - end.new - - render :nothing => true - end - - # 911 - def rescue_action(e) raise; end -end - -module Admin - class InnerModuleController < ActionController::Base - def redirect_to_absolute_controller - redirect_to :controller => '/content' - end - def redirect_to_fellow_controller - redirect_to :controller => 'user' - end - end -end - -# --------------------------------------------------------------------------- - - -# tell the controller where to find its templates but start from parent -# directory of test_request_response to simulate the behaviour of a -# production environment -ActionPackAssertionsController.template_root = File.dirname(__FILE__) + "/../fixtures/" - - -# a test case to exercise the new capabilities TestRequest & TestResponse -class ActionPackAssertionsControllerTest < Test::Unit::TestCase - # let's get this party started - def setup - @controller = ActionPackAssertionsController.new - @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new - end - - # -- assertion-based testing ------------------------------------------------ - - def test_assert_tag_and_url_for - get :render_url - assert_tag :content => "/action_pack_assertions/flash_me" - end - - # test the session assertion to make sure something is there. - def test_assert_session_has - process :session_stuffing - assert_session_has 'xmas' - assert_session_has_no 'halloween' - end - - # test the get method, make sure the request really was a get - def test_get - assert_raise(RuntimeError) { get :raise_on_get } - get :raise_on_post - assert_equal @response.body, 'request method: GET' - end - - # test the get method, make sure the request really was a get - def test_post - assert_raise(RuntimeError) { post :raise_on_post } - post :raise_on_get - assert_equal @response.body, 'request method: POST' - end - -# the following test fails because the request_method is now cached on the request instance -# test the get/post switch within one test action -# def test_get_post_switch -# post :raise_on_get -# assert_equal @response.body, 'request method: POST' -# get :raise_on_post -# assert_equal @response.body, 'request method: GET' -# post :raise_on_get -# assert_equal @response.body, 'request method: POST' -# get :raise_on_post -# assert_equal @response.body, 'request method: GET' -# end - - # test the assertion of goodies in the template - def test_assert_template_has - process :assign_this - assert_template_has 'howdy' - end - - # test the assertion for goodies that shouldn't exist in the template - def test_assert_template_has_no - process :nothing - assert_template_has_no 'maple syrup' - assert_template_has_no 'howdy' - end - - # test the redirection assertions - def test_assert_redirect - process :redirect_internal - assert_redirect - end - - # test the redirect url string - def test_assert_redirect_url - process :redirect_external - assert_redirect_url 'http://www.rubyonrails.org' - end - - # test the redirection pattern matching on a string - def test_assert_redirect_url_match_string - process :redirect_external - assert_redirect_url_match 'rails.org' - end - - # test the redirection pattern matching on a pattern - def test_assert_redirect_url_match_pattern - process :redirect_external - assert_redirect_url_match /ruby/ - end - - # test the redirection to a named route - def test_assert_redirect_to_named_route - process :redirect_to_named_route - assert_raise(Test::Unit::AssertionFailedError) do - assert_redirected_to 'http://test.host/route_two' - end - end - - # test the flash-based assertions with something is in the flash - def test_flash_assertions_full - process :flash_me - assert @response.has_flash_with_contents? - assert_flash_exists - assert_flash_not_empty - assert_flash_has 'hello' - assert_flash_has_no 'stds' - end - - # test the flash-based assertions with no flash at all - def test_flash_assertions_negative - process :nothing - assert_flash_empty - assert_flash_has_no 'hello' - assert_flash_has_no 'qwerty' - end - - # test the assert_rendered_file - def test_assert_rendered_file - process :hello_world - assert_rendered_file 'test/hello_world' - assert_rendered_file 'hello_world' - end - - # test the assert_success assertion - def test_assert_success - process :nothing - assert_success - assert_rendered_file - end - - # -- standard request/response object testing -------------------------------- - - # ensure our session is working properly - def test_session_objects - process :session_stuffing - assert @response.has_session_object?('xmas') - assert_session_equal 'turkey', 'xmas' - assert !@response.has_session_object?('easter') - end - - # make sure that the template objects exist - def test_template_objects_alive - process :assign_this - assert !@response.has_template_object?('hi') - assert @response.has_template_object?('howdy') - end - - # make sure we don't have template objects when we shouldn't - def test_template_object_missing - process :nothing - assert_nil @response.template_objects['howdy'] - end - - def test_assigned_equal - process :assign_this - assert_assigned_equal "ho", :howdy - end - - # check the empty flashing - def test_flash_me_naked - process :flash_me_naked - assert !@response.has_flash? - assert !@response.has_flash_with_contents? - end - - # check if we have flash objects - def test_flash_haves - process :flash_me - assert @response.has_flash? - assert @response.has_flash_with_contents? - assert @response.has_flash_object?('hello') - end - - # ensure we don't have flash objects - def test_flash_have_nots - process :nothing - assert !@response.has_flash? - assert !@response.has_flash_with_contents? - assert_nil @response.flash['hello'] - end - - # examine that the flash objects are what we expect - def test_flash_equals - process :flash_me - assert_flash_equal 'my name is inigo montoya...', 'hello' - end - - - # check if we were rendered by a file-based template? - def test_rendered_action - process :nothing - assert !@response.rendered_with_file? - - process :hello_world - assert @response.rendered_with_file? - assert 'hello_world', @response.rendered_file - end - - # check the redirection location - def test_redirection_location - process :redirect_internal - assert_equal 'http://test.host/nothing', @response.redirect_url - - process :redirect_external - assert_equal 'http://www.rubyonrails.org', @response.redirect_url - - process :nothing - assert_nil @response.redirect_url - end - - - # check server errors - def test_server_error_response_code - process :response500 - assert @response.server_error? - - process :response599 - assert @response.server_error? - - process :response404 - assert !@response.server_error? - end - - # check a 404 response code - def test_missing_response_code - process :response404 - assert @response.missing? - end - - # check to see if our redirection matches a pattern - def test_redirect_url_match - process :redirect_external - assert @response.redirect? - assert @response.redirect_url_match?("rubyonrails") - assert @response.redirect_url_match?(/rubyonrails/) - assert !@response.redirect_url_match?("phpoffrails") - assert !@response.redirect_url_match?(/perloffrails/) - end - - # check for a redirection - def test_redirection - process :redirect_internal - assert @response.redirect? - - process :redirect_external - assert @response.redirect? - - process :nothing - assert !@response.redirect? - end - - # check a successful response code - def test_successful_response_code - process :nothing - assert @response.success? - end - - # a basic check to make sure we have a TestResponse object - def test_has_response - process :nothing - assert_kind_of ActionController::TestResponse, @response - end - - def test_render_based_on_parameters - process :render_based_on_parameters, "name" => "David" - assert_equal "Mr. David", @response.body - end - - def test_assert_template_xpath_match_no_matches - process :hello_xml_world - assert_raises Test::Unit::AssertionFailedError do - assert_template_xpath_match('/no/such/node/in/document') - end - end - - def test_simple_one_element_xpath_match - process :hello_xml_world - assert_template_xpath_match('//title', "Hello World") - end - - def test_array_of_elements_in_xpath_match - process :hello_xml_world - assert_template_xpath_match('//p', %w( abes monks wiseguys )) - end - - def test_follow_redirect - process :redirect_to_action - assert_redirected_to :action => "flash_me" - - follow_redirect - assert_equal 1, @request.parameters["id"].to_i - - assert "Inconceivable!", @response.body - end - - def test_follow_redirect_outside_current_action - process :redirect_to_controller - assert_redirected_to :controller => "elsewhere", :action => "flash_me" - - assert_raises(RuntimeError, "Can't follow redirects outside of current controller (elsewhere)") { follow_redirect } - end - - def test_redirected_to_url_leadling_slash - process :redirect_to_path - assert_redirected_to '/some/path' - end - def test_redirected_to_url_no_leadling_slash - process :redirect_to_path - assert_redirected_to 'some/path' - end - def test_redirected_to_url_full_url - process :redirect_to_path - assert_redirected_to 'http://test.host/some/path' - end - - def test_redirected_to_with_nested_controller - @controller = Admin::InnerModuleController.new - get :redirect_to_absolute_controller - assert_redirected_to :controller => 'content' - - get :redirect_to_fellow_controller - assert_redirected_to :controller => 'admin/user' - end - - def test_assert_valid - get :get_valid_record - assert_valid assigns('record') - end - - def test_assert_valid_failing - get :get_invalid_record - - begin - assert_valid assigns('record') - assert false - rescue Test::Unit::AssertionFailedError => e - end - end -end - -class ActionPackHeaderTest < Test::Unit::TestCase - def setup - @controller = ActionPackAssertionsController.new - @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new - end - - def test_rendering_xml_sets_content_type - process :hello_xml_world - assert_equal('application/xml', @controller.headers['Content-Type']) - end - - def test_rendering_xml_respects_content_type - @response.headers['Content-Type'] = 'application/pdf' - process :hello_xml_world - assert_equal('application/pdf', @controller.headers['Content-Type']) - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class Address - - def Address.count(conditions = nil, join = nil) - nil - end - - def Address.find_all(arg1, arg2, arg3, arg4) - [] - end - - def self.find(*args) - [] - end -end - -class AddressesTestController < ActionController::Base - - scaffold :address - - def self.controller_name; "addresses"; end - def self.controller_path; "addresses"; end - -end - -AddressesTestController.template_root = File.dirname(__FILE__) + "/../fixtures/" - -class AddressesTest < Test::Unit::TestCase - def setup - @controller = AddressesTestController.new - - # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get - # a more accurate simulation of what happens in "real life". - @controller.logger = Logger.new(nil) - - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - - @request.host = "www.nextangle.com" - end - - def test_list - get :list - assert_equal "We only need to get this far!", @response.body.chomp - end - - -end -require File.dirname(__FILE__) + '/../abstract_unit' -require 'test/unit' -require 'pp' # require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late - -# Provide some controller to run the tests on. -module Submodule - class ContainedEmptyController < ActionController::Base - end - class ContainedNonEmptyController < ActionController::Base - def public_action - end - - hide_action :hidden_action - def hidden_action - end - - def another_hidden_action - end - hide_action :another_hidden_action - end - class SubclassedController < ContainedNonEmptyController - hide_action :public_action # Hiding it here should not affect the superclass. - end -end -class EmptyController < ActionController::Base - include ActionController::Caching -end -class NonEmptyController < ActionController::Base - def public_action - end - - hide_action :hidden_action - def hidden_action - end -end - -class ControllerClassTests < Test::Unit::TestCase - def test_controller_path - assert_equal 'empty', EmptyController.controller_path - assert_equal 'submodule/contained_empty', Submodule::ContainedEmptyController.controller_path - end - def test_controller_name - assert_equal 'empty', EmptyController.controller_name - assert_equal 'contained_empty', Submodule::ContainedEmptyController.controller_name - end -end - -class ControllerInstanceTests < Test::Unit::TestCase - def setup - @empty = EmptyController.new - @contained = Submodule::ContainedEmptyController.new - @empty_controllers = [@empty, @contained, Submodule::SubclassedController.new] - - @non_empty_controllers = [NonEmptyController.new, - Submodule::ContainedNonEmptyController.new] - end - - def test_action_methods - @empty_controllers.each do |c| - assert_equal Set.new, c.send(:action_methods), "#{c.class.controller_path} should be empty!" - end - @non_empty_controllers.each do |c| - assert_equal Set.new('public_action'), c.send(:action_methods), "#{c.class.controller_path} should not be empty!" - end - end -end -require File.dirname(__FILE__) + '/../abstract_unit' -require 'test/unit' - -# Provide some static controllers. -class BenchmarkedController < ActionController::Base - def public_action - render :nothing => true - end - - def rescue_action(e) - raise e - end -end - -class BenchmarkTest < Test::Unit::TestCase - class MockLogger - def method_missing(*args) - end - end - - def setup - @controller = BenchmarkedController.new - # benchmark doesn't do anything unless a logger is set - @controller.logger = MockLogger.new - @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new - @request.host = "test.actioncontroller.i" - end - - def test_with_http_1_0_request - @request.host = nil - assert_nothing_raised { get :public_action } - end -end -require 'fileutils' -require File.dirname(__FILE__) + '/../abstract_unit' - -class TestLogDevice < Logger::LogDevice - attr :last_message, true - - def initialize - @last_message=String.new - end - - def write(message) - @last_message << message - end - - def clear - @last_message = String.new - end -end - -#setup our really sophisticated logger -TestLog = TestLogDevice.new -RAILS_DEFAULT_LOGGER = Logger.new(TestLog) -ActionController::Base.logger = RAILS_DEFAULT_LOGGER - -def use_store - #generate a random key to ensure the cache is always in a different location - RANDOM_KEY = rand(99999999).to_s - FILE_STORE_PATH = File.dirname(__FILE__) + '/../temp/' + RANDOM_KEY - ActionController::Base.perform_caching = true - ActionController::Base.fragment_cache_store = :file_store, FILE_STORE_PATH -end - -class TestController < ActionController::Base - caches_action :render_to_cache, :index - - def render_to_cache - render_text "Render Cached" - end - alias :index :render_to_cache -end - -class FileStoreTest < Test::Unit::TestCase - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @controller = TestController.new - @request.host = "hostname.com" - end - - def teardown - FileUtils.rm_rf(FILE_STORE_PATH) - end - - def test_render_cached - assert_fragment_cached { get :render_to_cache } - assert_fragment_hit { get :render_to_cache } - end - - - private - def assert_fragment_cached - yield - assert(TestLog.last_message.include?("Cached fragment:"), "--ERROR-- FileStore write failed ----") - assert(!TestLog.last_message.include?("Couldn't create cache directory:"), "--ERROR-- FileStore create directory failed ----") - TestLog.clear - end - - def assert_fragment_hit - yield - assert(TestLog.last_message.include?("Fragment read:"), "--ERROR-- Fragment not found in FileStore ----") - assert(!TestLog.last_message.include?("Cached fragment:"), "--ERROR-- Did cache ----") - TestLog.clear - end -endrequire File.dirname(__FILE__) + '/../abstract_unit' - -class CaptureController < ActionController::Base - def self.controller_name; "test"; end - def self.controller_path; "test"; end - - def content_for - render :layout => "talk_from_action" - end - - def erb_content_for - render :layout => "talk_from_action" - end - - def block_content_for - render :layout => "talk_from_action" - end - - def non_erb_block_content_for - render :layout => "talk_from_action" - end - - def rescue_action(e) raise end -end - -CaptureController.template_root = File.dirname(__FILE__) + "/../fixtures/" - -class CaptureTest < Test::Unit::TestCase - def setup - @controller = CaptureController.new - - # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get - # a more accurate simulation of what happens in "real life". - @controller.logger = Logger.new(nil) - - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - - @request.host = "www.nextangle.com" - end - - def test_simple_capture - get :capturing - assert_equal "Dreamy days", @response.body.strip - end - - def test_content_for - get :content_for - assert_equal expected_content_for_output, @response.body - end - - def test_erb_content_for - get :content_for - assert_equal expected_content_for_output, @response.body - end - - def test_block_content_for - get :block_content_for - assert_equal expected_content_for_output, @response.body - end - - def test_non_erb_block_content_for - get :non_erb_block_content_for - assert_equal expected_content_for_output, @response.body - end - - def test_update_element_with_capture - get :update_element_with_capture - assert_equal( - "" + - "\n\n$('status').innerHTML = '\\n You bought something!\\n';", - @response.body.strip - ) - end - - private - def expected_content_for_output - "Putting stuff in the title!\n\nGreat stuff!" - end -end -require File.dirname(__FILE__) + '/../abstract_unit' -require 'action_controller/cgi_process' -require 'action_controller/cgi_ext/cgi_ext' - - -require 'stringio' - -class CGITest < Test::Unit::TestCase - def setup - @query_string = "action=create_customer&full_name=David%20Heinemeier%20Hansson&customerId=1" - @query_string_with_nil = "action=create_customer&full_name=" - @query_string_with_array = "action=create_customer&selected[]=1&selected[]=2&selected[]=3" - @query_string_with_amps = "action=create_customer&name=Don%27t+%26+Does" - @query_string_with_multiple_of_same_name = - "action=update_order&full_name=Lau%20Taarnskov&products=4&products=2&products=3" - @query_string_with_many_equal = "action=create_customer&full_name=abc=def=ghi" - @query_string_without_equal = "action" - @query_string_with_many_ampersands = - "&action=create_customer&&&full_name=David%20Heinemeier%20Hansson" - end - - def test_query_string - assert_equal( - { "action" => "create_customer", "full_name" => "David Heinemeier Hansson", "customerId" => "1"}, - CGIMethods.parse_query_parameters(@query_string) - ) - end - - def test_deep_query_string - assert_equal({'x' => {'y' => {'z' => '10'}}}, CGIMethods.parse_query_parameters('x[y][z]=10')) - end - - def test_deep_query_string_with_array - assert_equal({'x' => {'y' => {'z' => ['10']}}}, CGIMethods.parse_query_parameters('x[y][z][]=10')) - assert_equal({'x' => {'y' => {'z' => ['10', '5']}}}, CGIMethods.parse_query_parameters('x[y][z][]=10&x[y][z][]=5')) - end - - def test_query_string_with_nil - assert_equal( - { "action" => "create_customer", "full_name" => nil}, - CGIMethods.parse_query_parameters(@query_string_with_nil) - ) - end - - def test_query_string_with_array - assert_equal( - { "action" => "create_customer", "selected" => ["1", "2", "3"]}, - CGIMethods.parse_query_parameters(@query_string_with_array) - ) - end - - def test_query_string_with_amps - assert_equal( - { "action" => "create_customer", "name" => "Don't & Does"}, - CGIMethods.parse_query_parameters(@query_string_with_amps) - ) - end - - def test_query_string_with_many_equal - assert_equal( - { "action" => "create_customer", "full_name" => "abc=def=ghi"}, - CGIMethods.parse_query_parameters(@query_string_with_many_equal) - ) - end - - def test_query_string_without_equal - assert_equal( - { "action" => nil }, - CGIMethods.parse_query_parameters(@query_string_without_equal) - ) - end - - def test_query_string_with_many_ampersands - assert_equal( - { "action" => "create_customer", "full_name" => "David Heinemeier Hansson"}, - CGIMethods.parse_query_parameters(@query_string_with_many_ampersands) - ) - end - - def test_parse_params - input = { - "customers[boston][first][name]" => [ "David" ], - "customers[boston][first][url]" => [ "http://David" ], - "customers[boston][second][name]" => [ "Allan" ], - "customers[boston][second][url]" => [ "http://Allan" ], - "something_else" => [ "blah" ], - "something_nil" => [ nil ], - "something_empty" => [ "" ], - "products[first]" => [ "Apple Computer" ], - "products[second]" => [ "Pc" ] - } - - expected_output = { - "customers" => { - "boston" => { - "first" => { - "name" => "David", - "url" => "http://David" - }, - "second" => { - "name" => "Allan", - "url" => "http://Allan" - } - } - }, - "something_else" => "blah", - "something_empty" => "", - "something_nil" => "", - "products" => { - "first" => "Apple Computer", - "second" => "Pc" - } - } - - assert_equal expected_output, CGIMethods.parse_request_parameters(input) - end - - def test_parse_params_from_multipart_upload - mockup = Struct.new(:content_type, :original_filename) - file = mockup.new('img/jpeg', 'foo.jpg') - ie_file = mockup.new('img/jpeg', 'c:\\Documents and Settings\\foo\\Desktop\\bar.jpg') - - input = { - "something" => [ StringIO.new("") ], - "array_of_stringios" => [[ StringIO.new("One"), StringIO.new("Two") ]], - "mixed_types_array" => [[ StringIO.new("Three"), "NotStringIO" ]], - "mixed_types_as_checkboxes[strings][nested]" => [[ file, "String", StringIO.new("StringIO")]], - "ie_mixed_types_as_checkboxes[strings][nested]" => [[ ie_file, "String", StringIO.new("StringIO")]], - "products[string]" => [ StringIO.new("Apple Computer") ], - "products[file]" => [ file ], - "ie_products[string]" => [ StringIO.new("Microsoft") ], - "ie_products[file]" => [ ie_file ] - } - - expected_output = { - "something" => "", - "array_of_stringios" => ["One", "Two"], - "mixed_types_array" => [ "Three", "NotStringIO" ], - "mixed_types_as_checkboxes" => { - "strings" => { - "nested" => [ file, "String", "StringIO" ] - }, - }, - "ie_mixed_types_as_checkboxes" => { - "strings" => { - "nested" => [ ie_file, "String", "StringIO" ] - }, - }, - "products" => { - "string" => "Apple Computer", - "file" => file - }, - "ie_products" => { - "string" => "Microsoft", - "file" => ie_file - } - } - - params = CGIMethods.parse_request_parameters(input) - assert_equal expected_output, params - - # Lone filenames are preserved. - assert_equal 'foo.jpg', params['mixed_types_as_checkboxes']['strings']['nested'].first.original_filename - assert_equal 'foo.jpg', params['products']['file'].original_filename - - # But full Windows paths are reduced to their basename. - assert_equal 'bar.jpg', params['ie_mixed_types_as_checkboxes']['strings']['nested'].first.original_filename - assert_equal 'bar.jpg', params['ie_products']['file'].original_filename - end - - def test_parse_params_with_file - input = { - "customers[boston][first][name]" => [ "David" ], - "something_else" => [ "blah" ], - "logo" => [ File.new(File.dirname(__FILE__) + "/cgi_test.rb").path ] - } - - expected_output = { - "customers" => { - "boston" => { - "first" => { - "name" => "David" - } - } - }, - "something_else" => "blah", - "logo" => File.new(File.dirname(__FILE__) + "/cgi_test.rb").path, - } - - assert_equal expected_output, CGIMethods.parse_request_parameters(input) - end - - def test_parse_params_with_array - input = { "selected[]" => [ "1", "2", "3" ] } - - expected_output = { "selected" => [ "1", "2", "3" ] } - - assert_equal expected_output, CGIMethods.parse_request_parameters(input) - end - - def test_parse_params_with_non_alphanumeric_name - input = { "a/b[c]" => %w(d) } - expected = { "a/b" => { "c" => "d" }} - assert_equal expected, CGIMethods.parse_request_parameters(input) - end - - def test_parse_params_with_single_brackets_in_middle - input = { "a/b[c]d" => %w(e) } - expected = { "a/b[c]d" => "e" } - assert_equal expected, CGIMethods.parse_request_parameters(input) - end - - def test_parse_params_with_separated_brackets - input = { "a/b@[c]d[e]" => %w(f) } - expected = { "a/b@" => { "c]d[e" => "f" }} - assert_equal expected, CGIMethods.parse_request_parameters(input) - end - - def test_parse_params_with_separated_brackets_and_array - input = { "a/b@[c]d[e][]" => %w(f) } - expected = { "a/b@" => { "c]d[e" => ["f"] }} - assert_equal expected , CGIMethods.parse_request_parameters(input) - end - - def test_parse_params_with_unmatched_brackets_and_array - input = { "a/b@[c][d[e][]" => %w(f) } - expected = { "a/b@" => { "c" => { "d[e" => ["f"] }}} - assert_equal expected, CGIMethods.parse_request_parameters(input) - end -end - -class MultipartCGITest < Test::Unit::TestCase - FIXTURE_PATH = File.dirname(__FILE__) + '/../fixtures/multipart' - - def setup - ENV['REQUEST_METHOD'] = 'POST' - ENV['CONTENT_LENGTH'] = '0' - ENV['CONTENT_TYPE'] = 'multipart/form-data, boundary=AaB03x' - end - - def test_single_parameter - params = process('single_parameter') - assert_equal({ 'foo' => 'bar' }, params) - end - - def test_text_file - params = process('text_file') - assert_equal %w(file foo), params.keys.sort - assert_equal 'bar', params['foo'] - - file = params['file'] - assert_kind_of StringIO, file - assert_equal 'file.txt', file.original_filename - assert_equal "text/plain\r", file.content_type - assert_equal 'contents', file.read - end - - def test_large_text_file - params = process('large_text_file') - assert_equal %w(file foo), params.keys.sort - assert_equal 'bar', params['foo'] - - file = params['file'] - assert_kind_of Tempfile, file - assert_equal 'file.txt', file.original_filename - assert_equal "text/plain\r", file.content_type - assert ('a' * 20480) == file.read - end - - def test_binary_file - params = process('binary_file') - assert_equal %w(file flowers foo), params.keys.sort - assert_equal 'bar', params['foo'] - - file = params['file'] - assert_kind_of StringIO, file - assert_equal 'file.txt', file.original_filename - assert_equal "text/plain\r", file.content_type - assert_equal 'contents', file.read - - file = params['flowers'] - assert_kind_of StringIO, file - assert_equal 'flowers.jpg', file.original_filename - assert_equal "image/jpeg\r", file.content_type - assert_equal 19512, file.size - #assert_equal File.read(File.dirname(__FILE__) + '/../../../activerecord/test/fixtures/flowers.jpg'), file.read - end - - def test_mixed_files - params = process('mixed_files') - assert_equal %w(files foo), params.keys.sort - assert_equal 'bar', params['foo'] - - # Ruby CGI doesn't handle multipart/mixed for us. - assert_kind_of StringIO, params['files'] - assert_equal 19756, params['files'].size - end - - private - def process(name) - old_stdin = $stdin - File.open(File.join(FIXTURE_PATH, name), 'rb') do |file| - ENV['CONTENT_LENGTH'] = file.stat.size.to_s - $stdin = file - CGIMethods.parse_request_parameters CGI.new.params - end - ensure - $stdin = old_stdin - end -end - - -class CGIRequestTest < Test::Unit::TestCase - def setup - @request_hash = {"HTTP_MAX_FORWARDS"=>"10", "SERVER_NAME"=>"glu.ttono.us:8007", "FCGI_ROLE"=>"RESPONDER", "HTTP_X_FORWARDED_HOST"=>"glu.ttono.us", "HTTP_ACCEPT_ENCODING"=>"gzip, deflate", "HTTP_USER_AGENT"=>"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.5.1 (KHTML, like Gecko) Safari/312.3.1", "PATH_INFO"=>"", "HTTP_ACCEPT_LANGUAGE"=>"en", "HTTP_HOST"=>"glu.ttono.us:8007", "SERVER_PROTOCOL"=>"HTTP/1.1", "REDIRECT_URI"=>"/dispatch.fcgi", "SCRIPT_NAME"=>"/dispatch.fcgi", "SERVER_ADDR"=>"207.7.108.53", "REMOTE_ADDR"=>"207.7.108.53", "SERVER_SOFTWARE"=>"lighttpd/1.4.5", "HTTP_COOKIE"=>"_session_id=c84ace84796670c052c6ceb2451fb0f2; is_admin=yes", "HTTP_X_FORWARDED_SERVER"=>"glu.ttono.us", "REQUEST_URI"=>"/admin", "DOCUMENT_ROOT"=>"/home/kevinc/sites/typo/public", "SERVER_PORT"=>"8007", "QUERY_STRING"=>"", "REMOTE_PORT"=>"63137", "GATEWAY_INTERFACE"=>"CGI/1.1", "HTTP_X_FORWARDED_FOR"=>"65.88.180.234", "HTTP_ACCEPT"=>"*/*", "SCRIPT_FILENAME"=>"/home/kevinc/sites/typo/public/dispatch.fcgi", "REDIRECT_STATUS"=>"200", "REQUEST_METHOD"=>"GET"} - # cookie as returned by some Nokia phone browsers (no space after semicolon separator) - @alt_cookie_fmt_request_hash = {"HTTP_COOKIE"=>"_session_id=c84ace84796670c052c6ceb2451fb0f2;is_admin=yes"} - @fake_cgi = Struct.new(:env_table).new(@request_hash) - @request = ActionController::CgiRequest.new(@fake_cgi) - end - - def test_proxy_request - assert_equal 'glu.ttono.us', @request.host_with_port - end - - def test_http_host - @request_hash.delete "HTTP_X_FORWARDED_HOST" - @request_hash['HTTP_HOST'] = "rubyonrails.org:8080" - assert_equal "rubyonrails.org:8080", @request.host_with_port - - @request_hash['HTTP_X_FORWARDED_HOST'] = "www.firsthost.org, www.secondhost.org" - assert_equal "www.secondhost.org", @request.host - end - - def test_http_host_with_default_port_overrides_server_port - @request_hash.delete "HTTP_X_FORWARDED_HOST" - @request_hash['HTTP_HOST'] = "rubyonrails.org" - assert_equal "rubyonrails.org", @request.host_with_port - end - - def test_host_with_port_defaults_to_server_name_if_no_host_headers - @request_hash.delete "HTTP_X_FORWARDED_HOST" - @request_hash.delete "HTTP_HOST" - assert_equal "glu.ttono.us:8007", @request.host_with_port - end - - def test_host_with_port_falls_back_to_server_addr_if_necessary - @request_hash.delete "HTTP_X_FORWARDED_HOST" - @request_hash.delete "HTTP_HOST" - @request_hash.delete "SERVER_NAME" - assert_equal "207.7.108.53:8007", @request.host_with_port - end - - def test_cookie_syntax_resilience - cookies = CGI::Cookie::parse(@request_hash["HTTP_COOKIE"]); - assert_equal ["c84ace84796670c052c6ceb2451fb0f2"], cookies["_session_id"] - assert_equal ["yes"], cookies["is_admin"] - - alt_cookies = CGI::Cookie::parse(@alt_cookie_fmt_request_hash["HTTP_COOKIE"]); - assert_equal ["c84ace84796670c052c6ceb2451fb0f2"], alt_cookies["_session_id"] - assert_equal ["yes"], alt_cookies["is_admin"] - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class CallerController < ActionController::Base - def calling_from_controller - render_component(:controller => "callee", :action => "being_called") - end - - def calling_from_controller_with_params - render_component(:controller => "callee", :action => "being_called", :params => { "name" => "David" }) - end - - def calling_from_controller_with_different_status_code - render_component(:controller => "callee", :action => "blowing_up") - end - - def calling_from_template - render_template "Ring, ring: <%= render_component(:controller => 'callee', :action => 'being_called') %>" - end - - def internal_caller - render_template "Are you there? <%= render_component(:action => 'internal_callee') %>" - end - - def internal_callee - render_text "Yes, ma'am" - end - - def set_flash - render_component(:controller => "callee", :action => "set_flash") - end - - def use_flash - render_component(:controller => "callee", :action => "use_flash") - end - - def calling_redirected - render_component(:controller => "callee", :action => "redirected") - end - - def calling_redirected_as_string - render_template "<%= render_component(:controller => 'callee', :action => 'redirected') %>" - end - - def rescue_action(e) raise end -end - -class CalleeController < ActionController::Base - def being_called - render_text "#{@params["name"] || "Lady"} of the House, speaking" - end - - def blowing_up - render_text "It's game over, man, just game over, man!", "500 Internal Server Error" - end - - def set_flash - flash[:notice] = 'My stoney baby' - render :text => 'flash is set' - end - - def use_flash - render :text => flash[:notice] || 'no flash' - end - - def redirected - redirect_to :controller => "callee", :action => "being_called" - end - - def rescue_action(e) raise end -end - -class ComponentsTest < Test::Unit::TestCase - def setup - @controller = CallerController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_calling_from_controller - get :calling_from_controller - assert_equal "Lady of the House, speaking", @response.body - end - - def test_calling_from_controller_with_params - get :calling_from_controller_with_params - assert_equal "David of the House, speaking", @response.body - end - - def test_calling_from_controller_with_different_status_code - get :calling_from_controller_with_different_status_code - assert_equal 500, @response.response_code - end - - def test_calling_from_template - get :calling_from_template - assert_equal "Ring, ring: Lady of the House, speaking", @response.body - end - - def test_internal_calling - get :internal_caller - assert_equal "Are you there? Yes, ma'am", @response.body - end - - def test_flash - get :set_flash - assert_equal 'My stoney baby', flash[:notice] - get :use_flash - assert_equal 'My stoney baby', @response.body - get :use_flash - assert_equal 'no flash', @response.body - end - - def test_component_redirect_redirects - get :calling_redirected - - assert_redirected_to :action => "being_called" - end - - def test_component_multiple_redirect_redirects - test_component_redirect_redirects - test_internal_calling - end - - def test_component_as_string_redirect_renders_redirecte_action - get :calling_redirected_as_string - - assert_equal "Lady of the House, speaking", @response.body - end -endrequire File.dirname(__FILE__) + '/../abstract_unit' - -class CookieTest < Test::Unit::TestCase - class TestController < ActionController::Base - def authenticate_with_deprecated_writer - cookie "name" => "user_name", "value" => "david" - render_text "hello world" - end - - def authenticate - cookies["user_name"] = "david" - render_text "hello world" - end - - def authenticate_for_fourten_days - cookies["user_name"] = { "value" => "david", "expires" => Time.local(2005, 10, 10) } - render_text "hello world" - end - - def authenticate_for_fourten_days_with_symbols - cookies[:user_name] = { :value => "david", :expires => Time.local(2005, 10, 10) } - render_text "hello world" - end - - def set_multiple_cookies - cookies["user_name"] = { "value" => "david", "expires" => Time.local(2005, 10, 10) } - cookies["login"] = "XJ-122" - render_text "hello world" - end - - def access_frozen_cookies - @cookies["will"] = "work" - render_text "hello world" - end - - def rescue_action(e) raise end - end - - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - - @request.host = "www.nextangle.com" - end - - def test_setting_cookie_with_deprecated_writer - @request.action = "authenticate_with_deprecated_writer" - assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david") ], process_request.headers["cookie"] - end - - def test_setting_cookie - @request.action = "authenticate" - assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david") ], process_request.headers["cookie"] - end - - def test_setting_cookie_for_fourteen_days - @request.action = "authenticate_for_fourten_days" - assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david", "expires" => Time.local(2005, 10, 10)) ], process_request.headers["cookie"] - end - - def test_setting_cookie_for_fourteen_days_with_symbols - @request.action = "authenticate_for_fourten_days" - assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david", "expires" => Time.local(2005, 10, 10)) ], process_request.headers["cookie"] - end - - def test_multiple_cookies - @request.action = "set_multiple_cookies" - assert_equal 2, process_request.headers["cookie"].size - end - - def test_setting_test_cookie - @request.action = "access_frozen_cookies" - assert_nothing_raised { process_request } - end - - private - def process_request - TestController.process(@request, @response) - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class CustomHandler - def initialize( view ) - @view = view - end - - def render( template, local_assigns ) - [ template, - local_assigns, - @view ] - end -end - -class CustomHandlerTest < Test::Unit::TestCase - def setup - ActionView::Base.register_template_handler "foo", CustomHandler - ActionView::Base.register_template_handler :foo2, CustomHandler - @view = ActionView::Base.new - end - - def test_custom_render - result = @view.render_template( "foo", "hello <%= one %>", nil, :one => "two" ) - assert_equal( - [ "hello <%= one %>", { :one => "two" }, @view ], - result ) - end - - def test_custom_render2 - result = @view.render_template( "foo2", "hello <%= one %>", nil, :one => "two" ) - assert_equal( - [ "hello <%= one %>", { :one => "two" }, @view ], - result ) - end - - def test_unhandled_extension - # uses the ERb handler by default if the extension isn't recognized - result = @view.render_template( "bar", "hello <%= one %>", nil, :one => "two" ) - assert_equal "hello two", result - end -end -class << Object; alias_method :const_available?, :const_defined?; end - -class ContentController < Class.new(ActionController::Base) -end -class NotAController -end -module Admin - class << self; alias_method :const_available?, :const_defined?; end - SomeConstant = 10 - class UserController < Class.new(ActionController::Base); end - class NewsFeedController < Class.new(ActionController::Base); end -end - -ActionController::Routing::Routes.draw do |map| - map.route_one 'route_one', :controller => 'elsewhere', :action => 'flash_me' - map.connect ':controller/:action/:id' -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class FilterParamController < ActionController::Base -end - -class FilterParamTest < Test::Unit::TestCase - def setup - @controller = FilterParamController.new - end - - def test_filter_parameters - assert FilterParamController.respond_to?(:filter_parameter_logging) - assert !@controller.respond_to?(:filter_parameters) - - FilterParamController.filter_parameter_logging - assert @controller.respond_to?(:filter_parameters) - - test_hashes = [[{},{},[]], - [{'foo'=>'bar'},{'foo'=>'bar'},[]], - [{'foo'=>'bar'},{'foo'=>'bar'},%w'food'], - [{'foo'=>'bar'},{'foo'=>'[FILTERED]'},%w'foo'], - [{'foo'=>'bar', 'bar'=>'foo'},{'foo'=>'[FILTERED]', 'bar'=>'foo'},%w'foo baz'], - [{'foo'=>'bar', 'baz'=>'foo'},{'foo'=>'[FILTERED]', 'baz'=>'[FILTERED]'},%w'foo baz'], - [{'bar'=>{'foo'=>'bar','bar'=>'foo'}},{'bar'=>{'foo'=>'[FILTERED]','bar'=>'foo'}},%w'fo'], - [{'foo'=>{'foo'=>'bar','bar'=>'foo'}},{'foo'=>'[FILTERED]'},%w'f banana']] - - test_hashes.each do |before_filter, after_filter, filter_words| - FilterParamController.filter_parameter_logging(*filter_words) - assert_equal after_filter, @controller.filter_parameters(before_filter) - - filter_words.push('blah') - FilterParamController.filter_parameter_logging(*filter_words) do |key, value| - value.reverse! if key =~ /bargain/ - end - - before_filter['barg'] = {'bargain'=>'gain', 'blah'=>'bar', 'bar'=>{'bargain'=>{'blah'=>'foo'}}} - after_filter['barg'] = {'bargain'=>'niag', 'blah'=>'[FILTERED]', 'bar'=>{'bargain'=>{'blah'=>'[FILTERED]'}}} - - assert_equal after_filter, @controller.filter_parameters(before_filter) - end - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class FilterTest < Test::Unit::TestCase - class TestController < ActionController::Base - before_filter :ensure_login - after_filter :clean_up - - def show - render :inline => "ran action" - end - - private - def ensure_login - @ran_filter ||= [] - @ran_filter << "ensure_login" - end - - def clean_up - @ran_after_filter ||= [] - @ran_after_filter << "clean_up" - end - end - - class RenderingController < ActionController::Base - before_filter :render_something_else - - def show - @ran_action = true - render :inline => "ran action" - end - - private - def render_something_else - render :inline => "something else" - end - end - - class ConditionalFilterController < ActionController::Base - def show - render :inline => "ran action" - end - - def another_action - render :inline => "ran action" - end - - def show_without_filter - render :inline => "ran action without filter" - end - - private - def ensure_login - @ran_filter ||= [] - @ran_filter << "ensure_login" - end - - def clean_up_tmp - @ran_filter ||= [] - @ran_filter << "clean_up_tmp" - end - - def rescue_action(e) raise(e) end - end - - class ConditionalCollectionFilterController < ConditionalFilterController - before_filter :ensure_login, :except => [ :show_without_filter, :another_action ] - end - - class OnlyConditionSymController < ConditionalFilterController - before_filter :ensure_login, :only => :show - end - - class ExceptConditionSymController < ConditionalFilterController - before_filter :ensure_login, :except => :show_without_filter - end - - class BeforeAndAfterConditionController < ConditionalFilterController - before_filter :ensure_login, :only => :show - after_filter :clean_up_tmp, :only => :show - end - - class OnlyConditionProcController < ConditionalFilterController - before_filter(:only => :show) {|c| c.assigns["ran_proc_filter"] = true } - end - - class ExceptConditionProcController < ConditionalFilterController - before_filter(:except => :show_without_filter) {|c| c.assigns["ran_proc_filter"] = true } - end - - class ConditionalClassFilter - def self.filter(controller) controller.assigns["ran_class_filter"] = true end - end - - class OnlyConditionClassController < ConditionalFilterController - before_filter ConditionalClassFilter, :only => :show - end - - class ExceptConditionClassController < ConditionalFilterController - before_filter ConditionalClassFilter, :except => :show_without_filter - end - - class AnomolousYetValidConditionController < ConditionalFilterController - before_filter(ConditionalClassFilter, :ensure_login, Proc.new {|c| c.assigns["ran_proc_filter1"] = true }, :except => :show_without_filter) { |c| c.assigns["ran_proc_filter2"] = true} - end - - class PrependingController < TestController - prepend_before_filter :wonderful_life - # skip_before_filter :fire_flash - - private - def wonderful_life - @ran_filter ||= [] - @ran_filter << "wonderful_life" - end - end - - class ConditionalSkippingController < TestController - skip_before_filter :ensure_login, :only => [ :login ] - skip_after_filter :clean_up, :only => [ :login ] - - before_filter :find_user, :only => [ :change_password ] - - def login - render :inline => "ran action" - end - - def change_password - render :inline => "ran action" - end - - protected - def find_user - @ran_filter ||= [] - @ran_filter << "find_user" - end - end - - class ConditionalParentOfConditionalSkippingController < ConditionalFilterController - before_filter :conditional_in_parent, :only => [:show, :another_action] - after_filter :conditional_in_parent, :only => [:show, :another_action] - - private - - def conditional_in_parent - @ran_filter ||= [] - @ran_filter << 'conditional_in_parent' - end - end - - class ChildOfConditionalParentController < ConditionalParentOfConditionalSkippingController - skip_before_filter :conditional_in_parent, :only => :another_action - skip_after_filter :conditional_in_parent, :only => :another_action - end - - class ProcController < PrependingController - before_filter(proc { |c| c.assigns["ran_proc_filter"] = true }) - end - - class ImplicitProcController < PrependingController - before_filter { |c| c.assigns["ran_proc_filter"] = true } - end - - class AuditFilter - def self.filter(controller) - controller.assigns["was_audited"] = true - end - end - - class AroundFilter - def before(controller) - @execution_log = "before" - controller.class.execution_log << " before aroundfilter " if controller.respond_to? :execution_log - controller.assigns["before_ran"] = true - end - - def after(controller) - controller.assigns["execution_log"] = @execution_log + " and after" - controller.assigns["after_ran"] = true - controller.class.execution_log << " after aroundfilter " if controller.respond_to? :execution_log - end - end - - class AppendedAroundFilter - def before(controller) - controller.class.execution_log << " before appended aroundfilter " - end - - def after(controller) - controller.class.execution_log << " after appended aroundfilter " - end - end - - class AuditController < ActionController::Base - before_filter(AuditFilter) - - def show - render_text "hello" - end - end - - class BadFilterController < ActionController::Base - before_filter 2 - - def show() "show" end - - protected - def rescue_action(e) raise(e) end - end - - class AroundFilterController < PrependingController - around_filter AroundFilter.new - end - - class MixedFilterController < PrependingController - cattr_accessor :execution_log - - def initialize - @@execution_log = "" - end - - before_filter { |c| c.class.execution_log << " before procfilter " } - prepend_around_filter AroundFilter.new - - after_filter { |c| c.class.execution_log << " after procfilter " } - append_around_filter AppendedAroundFilter.new - end - - class MixedSpecializationController < ActionController::Base - class OutOfOrder < StandardError; end - - before_filter :first - before_filter :second, :only => :foo - - def foo - render_text 'foo' - end - - def bar - render_text 'bar' - end - - protected - def first - @first = true - end - - def second - raise OutOfOrder unless @first - end - end - - class DynamicDispatchController < ActionController::Base - before_filter :choose - - %w(foo bar baz).each do |action| - define_method(action) { render :text => action } - end - - private - def choose - self.action_name = params[:choose] - end - end - - def test_added_filter_to_inheritance_graph - assert_equal [ :ensure_login ], TestController.before_filters - end - - def test_base_class_in_isolation - assert_equal [ ], ActionController::Base.before_filters - end - - def test_prepending_filter - assert_equal [ :wonderful_life, :ensure_login ], PrependingController.before_filters - end - - def test_running_filters - assert_equal %w( wonderful_life ensure_login ), test_process(PrependingController).template.assigns["ran_filter"] - end - - def test_running_filters_with_proc - assert test_process(ProcController).template.assigns["ran_proc_filter"] - end - - def test_running_filters_with_implicit_proc - assert test_process(ImplicitProcController).template.assigns["ran_proc_filter"] - end - - def test_running_filters_with_class - assert test_process(AuditController).template.assigns["was_audited"] - end - - def test_running_anomolous_yet_valid_condition_filters - response = test_process(AnomolousYetValidConditionController) - assert_equal %w( ensure_login ), response.template.assigns["ran_filter"] - assert response.template.assigns["ran_class_filter"] - assert response.template.assigns["ran_proc_filter1"] - assert response.template.assigns["ran_proc_filter2"] - - response = test_process(AnomolousYetValidConditionController, "show_without_filter") - assert_equal nil, response.template.assigns["ran_filter"] - assert !response.template.assigns["ran_class_filter"] - assert !response.template.assigns["ran_proc_filter1"] - assert !response.template.assigns["ran_proc_filter2"] - end - - def test_running_collection_condition_filters - assert_equal %w( ensure_login ), test_process(ConditionalCollectionFilterController).template.assigns["ran_filter"] - assert_equal nil, test_process(ConditionalCollectionFilterController, "show_without_filter").template.assigns["ran_filter"] - assert_equal nil, test_process(ConditionalCollectionFilterController, "another_action").template.assigns["ran_filter"] - end - - def test_running_only_condition_filters - assert_equal %w( ensure_login ), test_process(OnlyConditionSymController).template.assigns["ran_filter"] - assert_equal nil, test_process(OnlyConditionSymController, "show_without_filter").template.assigns["ran_filter"] - - assert test_process(OnlyConditionProcController).template.assigns["ran_proc_filter"] - assert !test_process(OnlyConditionProcController, "show_without_filter").template.assigns["ran_proc_filter"] - - assert test_process(OnlyConditionClassController).template.assigns["ran_class_filter"] - assert !test_process(OnlyConditionClassController, "show_without_filter").template.assigns["ran_class_filter"] - end - - def test_running_except_condition_filters - assert_equal %w( ensure_login ), test_process(ExceptConditionSymController).template.assigns["ran_filter"] - assert_equal nil, test_process(ExceptConditionSymController, "show_without_filter").template.assigns["ran_filter"] - - assert test_process(ExceptConditionProcController).template.assigns["ran_proc_filter"] - assert !test_process(ExceptConditionProcController, "show_without_filter").template.assigns["ran_proc_filter"] - - assert test_process(ExceptConditionClassController).template.assigns["ran_class_filter"] - assert !test_process(ExceptConditionClassController, "show_without_filter").template.assigns["ran_class_filter"] - end - - def test_running_before_and_after_condition_filters - assert_equal %w( ensure_login clean_up_tmp), test_process(BeforeAndAfterConditionController).template.assigns["ran_filter"] - assert_equal nil, test_process(BeforeAndAfterConditionController, "show_without_filter").template.assigns["ran_filter"] - end - - def test_bad_filter - assert_raises(ActionController::ActionControllerError) { - test_process(BadFilterController) - } - end - - def test_around_filter - controller = test_process(AroundFilterController) - assert controller.template.assigns["before_ran"] - assert controller.template.assigns["after_ran"] - end - - def test_having_properties_in_around_filter - controller = test_process(AroundFilterController) - assert_equal "before and after", controller.template.assigns["execution_log"] - end - - def test_prepending_and_appending_around_filter - controller = test_process(MixedFilterController) - assert_equal " before aroundfilter before procfilter before appended aroundfilter " + - " after appended aroundfilter after aroundfilter after procfilter ", - MixedFilterController.execution_log - end - - def test_rendering_breaks_filtering_chain - response = test_process(RenderingController) - assert_equal "something else", response.body - assert !response.template.assigns["ran_action"] - end - - def test_filters_with_mixed_specialization_run_in_order - assert_nothing_raised do - response = test_process(MixedSpecializationController, 'bar') - assert_equal 'bar', response.body - end - - assert_nothing_raised do - response = test_process(MixedSpecializationController, 'foo') - assert_equal 'foo', response.body - end - end - - def test_dynamic_dispatch - %w(foo bar baz).each do |action| - request = ActionController::TestRequest.new - request.query_parameters[:choose] = action - response = DynamicDispatchController.process(request, ActionController::TestResponse.new) - assert_equal action, response.body - end - end - - def test_conditional_skipping_of_filters - assert_nil test_process(ConditionalSkippingController, "login").template.assigns["ran_filter"] - assert_equal %w( ensure_login find_user ), test_process(ConditionalSkippingController, "change_password").template.assigns["ran_filter"] - - assert_nil test_process(ConditionalSkippingController, "login").template.controller.instance_variable_get("@ran_after_filter") - assert_equal %w( clean_up ), test_process(ConditionalSkippingController, "change_password").template.controller.instance_variable_get("@ran_after_filter") - end - - def test_conditional_skipping_of_filters_when_parent_filter_is_also_conditional - assert_equal %w( conditional_in_parent conditional_in_parent ), test_process(ChildOfConditionalParentController).template.assigns['ran_filter'] - assert_nil test_process(ChildOfConditionalParentController, 'another_action').template.assigns['ran_filter'] - end - - private - def test_process(controller, action = "show") - request = ActionController::TestRequest.new - request.action = action - controller.process(request, ActionController::TestResponse.new) - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class FlashTest < Test::Unit::TestCase - class TestController < ActionController::Base - def set_flash - flash["that"] = "hello" - render :inline => "hello" - end - - def set_flash_now - flash.now["that"] = "hello" - flash.now["foo"] ||= "bar" - flash.now["foo"] ||= "err" - @flashy = flash.now["that"] - @flash_copy = {}.update flash - render :inline => "hello" - end - - def attempt_to_use_flash_now - @flash_copy = {}.update flash - @flashy = flash["that"] - render :inline => "hello" - end - - def use_flash - @flash_copy = {}.update flash - @flashy = flash["that"] - render :inline => "hello" - end - - def use_flash_and_keep_it - @flash_copy = {}.update flash - @flashy = flash["that"] - silence_warnings { keep_flash } - render :inline => "hello" - end - - def rescue_action(e) - raise unless ActionController::MissingTemplate === e - end - end - - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @controller = TestController.new - end - - def test_flash - get :set_flash - - get :use_flash - assert_equal "hello", @response.template.assigns["flash_copy"]["that"] - assert_equal "hello", @response.template.assigns["flashy"] - - get :use_flash - assert_nil @response.template.assigns["flash_copy"]["that"], "On second flash" - end - - def test_keep_flash - get :set_flash - - get :use_flash_and_keep_it - assert_equal "hello", @response.template.assigns["flash_copy"]["that"] - assert_equal "hello", @response.template.assigns["flashy"] - - get :use_flash - assert_equal "hello", @response.template.assigns["flash_copy"]["that"], "On second flash" - - get :use_flash - assert_nil @response.template.assigns["flash_copy"]["that"], "On third flash" - end - - def test_flash_now - get :set_flash_now - assert_equal "hello", @response.template.assigns["flash_copy"]["that"] - assert_equal "bar" , @response.template.assigns["flash_copy"]["foo"] - assert_equal "hello", @response.template.assigns["flashy"] - - get :attempt_to_use_flash_now - assert_nil @response.template.assigns["flash_copy"]["that"] - assert_nil @response.template.assigns["flash_copy"]["foo"] - assert_nil @response.template.assigns["flashy"] - end -endrequire File.dirname(__FILE__) + '/../abstract_unit' - -MemCache = Struct.new(:MemCache, :address) unless Object.const_defined?(:MemCache) - -class FragmentCacheStoreSettingTest < Test::Unit::TestCase - def teardown - ActionController::Base.fragment_cache_store = ActionController::Caching::Fragments::MemoryStore.new - end - - def test_file_fragment_cache_store - ActionController::Base.fragment_cache_store = :file_store, "/path/to/cache/directory" - assert_kind_of( - ActionController::Caching::Fragments::FileStore, - ActionController::Base.fragment_cache_store - ) - assert_equal "/path/to/cache/directory", ActionController::Base.fragment_cache_store.cache_path - end - - def test_drb_fragment_cache_store - ActionController::Base.fragment_cache_store = :drb_store, "druby://localhost:9192" - assert_kind_of( - ActionController::Caching::Fragments::DRbStore, - ActionController::Base.fragment_cache_store - ) - assert_equal "druby://localhost:9192", ActionController::Base.fragment_cache_store.address - end - - def test_mem_cache_fragment_cache_store - ActionController::Base.fragment_cache_store = :mem_cache_store, "localhost" - assert_kind_of( - ActionController::Caching::Fragments::MemCacheStore, - ActionController::Base.fragment_cache_store - ) - assert_equal %w(localhost), ActionController::Base.fragment_cache_store.addresses - end - - def test_object_assigned_fragment_cache_store - ActionController::Base.fragment_cache_store = ActionController::Caching::Fragments::FileStore.new("/path/to/cache/directory") - assert_kind_of( - ActionController::Caching::Fragments::FileStore, - ActionController::Base.fragment_cache_store - ) - assert_equal "/path/to/cache/directory", ActionController::Base.fragment_cache_store.cache_path - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class TestController < ActionController::Base - attr_accessor :delegate_attr - def delegate_method() end - def rescue_action(e) raise end -end - -module Fun - class GamesController < ActionController::Base - def render_hello_world - render :inline => "hello: <%= stratego %>" - end - - def rescue_action(e) raise end - end - - class PDFController < ActionController::Base - def test - render :inline => "test: <%= foobar %>" - end - - def rescue_action(e) raise end - end -end - -module LocalAbcHelper - def a() end - def b() end - def c() end -end - -class HelperTest < Test::Unit::TestCase - def setup - # Increment symbol counter. - @symbol = (@@counter ||= 'A0').succ!.dup - - # Generate new controller class. - controller_class_name = "Helper#{@symbol}Controller" - eval("class #{controller_class_name} < TestController; end") - @controller_class = self.class.const_get(controller_class_name) - - # Generate new template class and assign to controller. - template_class_name = "Test#{@symbol}View" - eval("class #{template_class_name} < ActionView::Base; end") - @template_class = self.class.const_get(template_class_name) - @controller_class.template_class = @template_class - - # Set default test helper. - self.test_helper = LocalAbcHelper - end - - def teardown - # Reset template class. - #ActionController::Base.template_class = ActionView::Base - end - - - def test_deprecated_helper - assert_equal expected_helper_methods, missing_methods - assert_nothing_raised { @controller_class.helper TestHelper } - assert_equal [], missing_methods - end - - def test_declare_helper - require 'abc_helper' - self.test_helper = AbcHelper - assert_equal expected_helper_methods, missing_methods - assert_nothing_raised { @controller_class.helper :abc } - assert_equal [], missing_methods - end - - def test_declare_missing_helper - assert_equal expected_helper_methods, missing_methods - assert_raise(MissingSourceFile) { @controller_class.helper :missing } - end - - def test_declare_missing_file_from_helper - require 'broken_helper' - rescue LoadError => e - assert_nil /\bbroken_helper\b/.match(e.to_s)[1] - end - - def test_helper_block - assert_nothing_raised { - @controller_class.helper { def block_helper_method; end } - } - assert master_helper_methods.include?('block_helper_method') - end - - def test_helper_block_include - assert_equal expected_helper_methods, missing_methods - assert_nothing_raised { - @controller_class.helper { include TestHelper } - } - assert [], missing_methods - end - - def test_helper_method - assert_nothing_raised { @controller_class.helper_method :delegate_method } - assert master_helper_methods.include?('delegate_method') - end - - def test_helper_attr - assert_nothing_raised { @controller_class.helper_attr :delegate_attr } - assert master_helper_methods.include?('delegate_attr') - assert master_helper_methods.include?('delegate_attr=') - end - - def test_helper_for_nested_controller - request = ActionController::TestRequest.new - response = ActionController::TestResponse.new - request.action = 'render_hello_world' - - assert_equal 'hello: Iz guuut!', Fun::GamesController.process(request, response).body - end - - def test_helper_for_acronym_controller - request = ActionController::TestRequest.new - response = ActionController::TestResponse.new - request.action = 'test' - - assert_equal 'test: baz', Fun::PDFController.process(request, response).body - end - - private - def expected_helper_methods - TestHelper.instance_methods - end - - def master_helper_methods - @controller_class.master_helper_module.instance_methods - end - - def missing_methods - expected_helper_methods - master_helper_methods - end - - def test_helper=(helper_module) - silence_warnings { self.class.const_set('TestHelper', helper_module) } - end -end - - -class IsolatedHelpersTest < Test::Unit::TestCase - class A < ActionController::Base - def index - render :inline => '<%= shout %>' - end - - def rescue_action(e) raise end - end - - class B < A - helper { def shout; 'B' end } - - def index - render :inline => '<%= shout %>' - end - end - - class C < A - helper { def shout; 'C' end } - - def index - render :inline => '<%= shout %>' - end - end - - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @request.action = 'index' - end - - def test_helper_in_a - assert_raise(NameError) { A.process(@request, @response) } - end - - def test_helper_in_b - assert_equal 'B', B.process(@request, @response).body - end - - def test_helper_in_c - assert_equal 'C', C.process(@request, @response).body - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -# The template_root must be set on Base and not LayoutTest so that LayoutTest's inherited method has access to -# the template_root when looking for a layout -ActionController::Base.template_root = File.dirname(__FILE__) + '/../fixtures/layout_tests/' - -class LayoutTest < ActionController::Base - def self.controller_path; 'views' end -end - -# Restore template root to be unset -ActionController::Base.template_root = nil - -class ProductController < LayoutTest -end - -class ItemController < LayoutTest -end - -class ThirdPartyTemplateLibraryController < LayoutTest -end - -module ControllerNameSpace -end - -class ControllerNameSpace::NestedController < LayoutTest -end - -class MabView - def initialize(view) - end - - def render(text, locals = {}) - text - end -end - -ActionView::Base::register_template_handler :mab, MabView - -class LayoutAutoDiscoveryTest < Test::Unit::TestCase - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - - @request.host = "www.nextangle.com" - end - - def test_application_layout_is_default_when_no_controller_match - @controller = ProductController.new - get :hello - assert_equal 'layout_test.rhtml hello.rhtml', @response.body - end - - def test_controller_name_layout_name_match - @controller = ItemController.new - get :hello - assert_equal 'item.rhtml hello.rhtml', @response.body - end - - def test_third_party_template_library_auto_discovers_layout - @controller = ThirdPartyTemplateLibraryController.new - get :hello - assert_equal 'layouts/third_party_template_library', @controller.active_layout - assert_equal 'Mab', @response.body - end - - def test_namespaced_controllers_auto_detect_layouts - @controller = ControllerNameSpace::NestedController.new - get :hello - assert_equal 'layouts/controller_name_space/nested', @controller.active_layout - assert_equal 'controller_name_space/nested.rhtml hello.rhtml', @response.body - end -endrequire File.dirname(__FILE__) + '/../abstract_unit' - -class RespondToController < ActionController::Base - layout :set_layout - - def html_xml_or_rss - respond_to do |type| - type.html { render :text => "HTML" } - type.xml { render :text => "XML" } - type.rss { render :text => "RSS" } - type.all { render :text => "Nothing" } - end - end - - def js_or_html - respond_to do |type| - type.html { render :text => "HTML" } - type.js { render :text => "JS" } - type.all { render :text => "Nothing" } - end - end - - def html_or_xml - respond_to do |type| - type.html { render :text => "HTML" } - type.xml { render :text => "XML" } - type.all { render :text => "Nothing" } - end - end - - def just_xml - respond_to do |type| - type.xml { render :text => "XML" } - end - end - - def using_defaults - respond_to do |type| - type.html - type.js - type.xml - end - end - - def using_defaults_with_type_list - respond_to(:html, :js, :xml) - end - - def made_for_content_type - respond_to do |type| - type.rss { render :text => "RSS" } - type.atom { render :text => "ATOM" } - type.all { render :text => "Nothing" } - end - end - - def custom_type_handling - respond_to do |type| - type.html { render :text => "HTML" } - type.custom("application/crazy-xml") { render :text => "Crazy XML" } - type.all { render :text => "Nothing" } - end - end - - def handle_any - respond_to do |type| - type.html { render :text => "HTML" } - type.any(:js, :xml) { render :text => "Either JS or XML" } - end - end - - def all_types_with_layout - respond_to do |type| - type.html - type.js - end - end - - def rescue_action(e) - raise - end - - protected - def set_layout - if action_name == "all_types_with_layout" - "standard" - end - end -end - -RespondToController.template_root = File.dirname(__FILE__) + "/../fixtures/" - -class MimeControllerTest < Test::Unit::TestCase - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - - @controller = RespondToController.new - @request.host = "www.example.com" - end - - def test_html - @request.env["HTTP_ACCEPT"] = "text/html" - get :js_or_html - assert_equal 'HTML', @response.body - - get :html_or_xml - assert_equal 'HTML', @response.body - - get :just_xml - assert_response 406 - end - - def test_all - @request.env["HTTP_ACCEPT"] = "*/*" - get :js_or_html - assert_equal 'HTML', @response.body # js is not part of all - - get :html_or_xml - assert_equal 'HTML', @response.body - - get :just_xml - assert_equal 'XML', @response.body - end - - def test_xml - @request.env["HTTP_ACCEPT"] = "application/xml" - get :html_xml_or_rss - assert_equal 'XML', @response.body - end - - def test_js_or_html - @request.env["HTTP_ACCEPT"] = "text/javascript, text/html" - get :js_or_html - assert_equal 'JS', @response.body - - get :html_or_xml - assert_equal 'HTML', @response.body - - get :just_xml - assert_response 406 - end - - def test_js_or_anything - @request.env["HTTP_ACCEPT"] = "text/javascript, */*" - get :js_or_html - assert_equal 'JS', @response.body - - get :html_or_xml - assert_equal 'HTML', @response.body - - get :just_xml - assert_equal 'XML', @response.body - end - - def test_using_defaults - @request.env["HTTP_ACCEPT"] = "*/*" - get :using_defaults - assert_equal 'Hello world!', @response.body - - @request.env["HTTP_ACCEPT"] = "text/javascript" - get :using_defaults - assert_equal '$("body").visualEffect("highlight");', @response.body - - @request.env["HTTP_ACCEPT"] = "application/xml" - get :using_defaults - assert_equal "

      Hello world!

      \n", @response.body - end - - def test_using_defaults_with_type_list - @request.env["HTTP_ACCEPT"] = "*/*" - get :using_defaults_with_type_list - assert_equal 'Hello world!', @response.body - - @request.env["HTTP_ACCEPT"] = "text/javascript" - get :using_defaults_with_type_list - assert_equal '$("body").visualEffect("highlight");', @response.body - - @request.env["HTTP_ACCEPT"] = "application/xml" - get :using_defaults_with_type_list - assert_equal "

      Hello world!

      \n", @response.body - end - - def test_with_content_type - @request.env["CONTENT_TYPE"] = "application/atom+xml" - get :made_for_content_type - assert_equal "ATOM", @response.body - - @request.env["CONTENT_TYPE"] = "application/rss+xml" - get :made_for_content_type - assert_equal "RSS", @response.body - end - - def test_synonyms - @request.env["HTTP_ACCEPT"] = "application/javascript" - get :js_or_html - assert_equal 'JS', @response.body - - @request.env["HTTP_ACCEPT"] = "application/x-xml" - get :html_xml_or_rss - assert_equal "XML", @response.body - end - - def test_custom_types - @request.env["HTTP_ACCEPT"] = "application/crazy-xml" - get :custom_type_handling - assert_equal 'Crazy XML', @response.body - - @request.env["HTTP_ACCEPT"] = "text/html" - get :custom_type_handling - assert_equal 'HTML', @response.body - end - - def test_xhtml_alias - @request.env["HTTP_ACCEPT"] = "application/xhtml+xml,application/xml" - get :html_or_xml - assert_equal 'HTML', @response.body - end - - def test_firefox_simulation - @request.env["HTTP_ACCEPT"] = "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" - get :html_or_xml - assert_equal 'HTML', @response.body - end - - def test_handle_any - @request.env["HTTP_ACCEPT"] = "*/*" - get :handle_any - assert_equal 'HTML', @response.body - - @request.env["HTTP_ACCEPT"] = "text/javascript" - get :handle_any - assert_equal 'Either JS or XML', @response.body - - @request.env["HTTP_ACCEPT"] = "text/xml" - get :handle_any - assert_equal 'Either JS or XML', @response.body - end - - def test_all_types_with_layout - @request.env["HTTP_ACCEPT"] = "text/javascript" - get :all_types_with_layout - assert_equal 'RJS for all_types_with_layout', @response.body - - @request.env["HTTP_ACCEPT"] = "text/html" - get :all_types_with_layout - assert_equal 'HTML for all_types_with_layout', @response.body - end - - def test_xhr - xhr :get, :js_or_html - assert_equal 'JS', @response.body - - xhr :get, :using_defaults - assert_equal '$("body").visualEffect("highlight");', @response.body - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class MimeTypeTest < Test::Unit::TestCase - Mime::PNG = Mime::Type.new("image/png") - Mime::PLAIN = Mime::Type.new("text/plain") - - def test_parse_single - Mime::LOOKUP.keys.each do |mime_type| - assert_equal [Mime::Type.lookup(mime_type)], Mime::Type.parse(mime_type) - end - end - - def test_parse_without_q - accept = "text/xml,application/xhtml+xml,text/yaml,application/xml,text/html,image/png,text/plain,*/*" - expect = [Mime::HTML, Mime::XML, Mime::YAML, Mime::PNG, Mime::PLAIN, Mime::ALL] - assert_equal expect, Mime::Type.parse(accept) - end - - def test_parse_with_q - accept = "text/xml,application/xhtml+xml,text/yaml; q=0.3,application/xml,text/html; q=0.8,image/png,text/plain; q=0.5,*/*; q=0.2" - expect = [Mime::HTML, Mime::XML, Mime::PNG, Mime::PLAIN, Mime::YAML, Mime::ALL] - assert_equal expect, Mime::Type.parse(accept) - end -endrequire File.dirname(__FILE__) + '/../abstract_unit' - -silence_warnings { Customer = Struct.new("Customer", :name) } - -module Fun - class GamesController < ActionController::Base - def hello_world - end - end -end - -module NewRenderTestHelper - def rjs_helper_method_from_module - page.visual_effect :highlight - end -end - -class NewRenderTestController < ActionController::Base - layout :determine_layout - - def self.controller_name; "test"; end - def self.controller_path; "test"; end - - def hello_world - end - - def render_hello_world - render :template => "test/hello_world" - end - - def render_hello_world_from_variable - @person = "david" - render :text => "hello #{@person}" - end - - def render_action_hello_world - render :action => "hello_world" - end - - def render_action_hello_world_as_symbol - render :action => :hello_world - end - - def render_text_hello_world - render :text => "hello world" - end - - def render_text_hello_world_with_layout - @variable_for_layout = ", I'm here!" - render :text => "hello world", :layout => true - end - - def hello_world_with_layout_false - render :layout => false - end - - def render_custom_code - render :text => "hello world", :status => "404 Moved" - end - - def render_file_with_instance_variables - @secret = 'in the sauce' - path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar.rhtml') - render :file => path - end - - def render_file_with_locals - path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_locals.rhtml') - render :file => path, :locals => {:secret => 'in the sauce'} - end - - def render_file_not_using_full_path - @secret = 'in the sauce' - render :file => 'test/render_file_with_ivar', :use_full_path => true - end - - def render_file_not_using_full_path_with_relative_path - @secret = 'in the sauce' - render :file => 'test/../test/render_file_with_ivar', :use_full_path => true - end - - def render_file_not_using_full_path_with_dot_in_path - @secret = 'in the sauce' - render :file => 'test/dot.directory/render_file_with_ivar', :use_full_path => true - end - - def render_xml_hello - @name = "David" - render :template => "test/hello" - end - - def greeting - # let's just rely on the template - end - - def layout_test - render :action => "hello_world" - end - - def layout_test_with_different_layout - render :action => "hello_world", :layout => "standard" - end - - def rendering_without_layout - render :action => "hello_world", :layout => false - end - - def layout_overriding_layout - render :action => "hello_world", :layout => "standard" - end - - def rendering_nothing_on_layout - render :nothing => true - end - - def builder_layout_test - render :action => "hello" - end - - def partials_list - @test_unchanged = 'hello' - @customers = [ Customer.new("david"), Customer.new("mary") ] - render :action => "list" - end - - def partial_only - render :partial => true - end - - def partial_only_with_layout - render :partial => "partial_only", :layout => true - end - - def partial_with_locals - render :partial => "customer", :locals => { :customer => Customer.new("david") } - end - - def partial_collection - render :partial => "customer", :collection => [ Customer.new("david"), Customer.new("mary") ] - end - - def partial_collection_with_locals - render :partial => "customer_greeting", :collection => [ Customer.new("david"), Customer.new("mary") ], :locals => { :greeting => "Bonjour" } - end - - def empty_partial_collection - render :partial => "customer", :collection => [] - end - - def partial_with_hash_object - render :partial => "hash_object", :object => {:first_name => "Sam"} - end - - def partial_with_implicit_local_assignment - @customer = Customer.new("Marcel") - render :partial => "customer" - end - - def hello_in_a_string - @customers = [ Customer.new("david"), Customer.new("mary") ] - render :text => "How's there? #{render_to_string("test/list")}" - end - - def accessing_params_in_template - render :inline => "Hello: <%= params[:name] %>" - end - - def accessing_params_in_template_with_layout - render :layout => nil, :inline => "Hello: <%= params[:name] %>" - end - - def render_with_explicit_template - render "test/hello_world" - end - - def double_render - render :text => "hello" - render :text => "world" - end - - def double_redirect - redirect_to :action => "double_render" - redirect_to :action => "double_render" - end - - def render_and_redirect - render :text => "hello" - redirect_to :action => "double_render" - end - - def rendering_with_conflicting_local_vars - @name = "David" - def @template.name() nil end - render :action => "potential_conflicts" - end - - def hello_world_from_rxml_using_action - render :action => "hello_world.rxml" - end - - def hello_world_from_rxml_using_template - render :template => "test/hello_world.rxml" - end - - helper NewRenderTestHelper - helper do - def rjs_helper_method(value) - page.visual_effect :highlight, value - end - end - - def enum_rjs_test - render :update do |page| - page.select('.product').each do |value| - page.rjs_helper_method_from_module - page.rjs_helper_method(value) - page.sortable(value, :url => { :action => "order" }) - page.draggable(value) - end - end - end - - def delete_with_js - @project_id = 4 - end - - def render_js_with_explicit_template - @project_id = 4 - render :template => 'test/delete_with_js' - end - - def render_js_with_explicit_action_template - @project_id = 4 - render :action => 'delete_with_js' - end - - def update_page - render :update do |page| - page.replace_html 'balance', '$37,000,000.00' - page.visual_effect :highlight, 'balance' - end - end - - def update_page_with_instance_variables - @money = '$37,000,000.00' - @div_id = 'balance' - render :update do |page| - page.replace_html @div_id, @money - page.visual_effect :highlight, @div_id - end - end - - def action_talk_to_layout - # Action template sets variable that's picked up by layout - end - - def render_text_with_assigns - @hello = "world" - render :text => "foo" - end - - def yield_content_for - render :action => "content_for", :layout => "yield" - end - - def rescue_action(e) raise end - - private - def determine_layout - case action_name - when "hello_world", "layout_test", "rendering_without_layout", - "rendering_nothing_on_layout", "render_text_hello_world", - "render_text_hello_world_with_layout", - "hello_world_with_layout_false", - "partial_only", "partial_only_with_layout", - "accessing_params_in_template", - "accessing_params_in_template_with_layout", - "render_with_explicit_template", - "render_js_with_explicit_template", - "render_js_with_explicit_action_template", - "delete_with_js", "update_page", "update_page_with_instance_variables" - - "layouts/standard" - when "builder_layout_test" - "layouts/builder" - when "action_talk_to_layout", "layout_overriding_layout" - "layouts/talk_from_action" - end - end -end - -NewRenderTestController.template_root = File.dirname(__FILE__) + "/../fixtures/" -Fun::GamesController.template_root = File.dirname(__FILE__) + "/../fixtures/" - -class NewRenderTest < Test::Unit::TestCase - def setup - @controller = NewRenderTestController.new - - # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get - # a more accurate simulation of what happens in "real life". - @controller.logger = Logger.new(nil) - - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - - @request.host = "www.nextangle.com" - end - - def test_simple_show - get :hello_world - assert_response :success - assert_template "test/hello_world" - assert_equal "Hello world!", @response.body - end - - def test_do_with_render - get :render_hello_world - assert_template "test/hello_world" - end - - def test_do_with_render_from_variable - get :render_hello_world_from_variable - assert_equal "hello david", @response.body - end - - def test_do_with_render_action - get :render_action_hello_world - assert_template "test/hello_world" - end - - def test_do_with_render_action_as_symbol - get :render_action_hello_world_as_symbol - assert_template "test/hello_world" - end - - def test_do_with_render_text - get :render_text_hello_world - assert_equal "hello world", @response.body - end - - def test_do_with_render_text_and_layout - get :render_text_hello_world_with_layout - assert_equal "hello world, I'm here!", @response.body - end - - def test_do_with_render_action_and_layout_false - get :hello_world_with_layout_false - assert_equal 'Hello world!', @response.body - end - - def test_do_with_render_custom_code - get :render_custom_code - assert_response :missing - end - - def test_render_file_with_instance_variables - get :render_file_with_instance_variables - assert_equal "The secret is in the sauce\n", @response.body - end - - def test_render_file_not_using_full_path - get :render_file_not_using_full_path - assert_equal "The secret is in the sauce\n", @response.body - end - - def test_render_file_not_using_full_path_with_relative_path - get :render_file_not_using_full_path_with_relative_path - assert_equal "The secret is in the sauce\n", @response.body - end - - def test_render_file_not_using_full_path_with_dot_in_path - get :render_file_not_using_full_path_with_dot_in_path - assert_equal "The secret is in the sauce\n", @response.body - end - - def test_render_file_with_locals - get :render_file_with_locals - assert_equal "The secret is in the sauce\n", @response.body - end - - def test_attempt_to_access_object_method - assert_raises(ActionController::UnknownAction, "No action responded to [clone]") { get :clone } - end - - def test_private_methods - assert_raises(ActionController::UnknownAction, "No action responded to [determine_layout]") { get :determine_layout } - end - - def test_access_to_request_in_view - view_internals_old_value = ActionController::Base.view_controller_internals - - ActionController::Base.view_controller_internals = false - ActionController::Base.protected_variables_cache = nil - - get :hello_world - assert_nil(assigns["request"]) - - ActionController::Base.view_controller_internals = true - ActionController::Base.protected_variables_cache = nil - - get :hello_world - assert_kind_of ActionController::AbstractRequest, assigns["request"] - - ActionController::Base.view_controller_internals = view_internals_old_value - ActionController::Base.protected_variables_cache = nil - end - - def test_render_xml - get :render_xml_hello - assert_equal "\n

      Hello David

      \n

      This is grand!

      \n\n", @response.body - end - - def test_enum_rjs_test - get :enum_rjs_test - assert_equal <<-EOS.strip, @response.body -$$(".product").each(function(value, index) { -new Effect.Highlight(element,{}); -new Effect.Highlight(value,{}); -Sortable.create(value, {onUpdate:function(){new Ajax.Request('/test/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize(value)})}}); -new Draggable(value, {}); -}); -EOS - end - - def test_render_xml_with_default - get :greeting - assert_equal "

      This is grand!

      \n", @response.body - end - - def test_render_rjs_with_default - get :delete_with_js - assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight(\"project-4\",{});!, @response.body - end - - def test_render_rjs_template_explicitly - get :render_js_with_explicit_template - assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight(\"project-4\",{});!, @response.body - end - - def test_rendering_rjs_action_explicitly - get :render_js_with_explicit_action_template - assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight(\"project-4\",{});!, @response.body - end - - def test_layout_rendering - get :layout_test - assert_equal "Hello world!", @response.body - end - - def test_layout_test_with_different_layout - get :layout_test_with_different_layout - assert_equal "Hello world!", @response.body - end - - def test_rendering_without_layout - get :rendering_without_layout - assert_equal "Hello world!", @response.body - end - - def test_layout_overriding_layout - get :layout_overriding_layout - assert_no_match %r{}, @response.body - end - - def test_rendering_nothing_on_layout - get :rendering_nothing_on_layout - assert_equal " ", @response.body - end - - def test_render_xml_with_layouts - get :builder_layout_test - assert_equal "<wrapper>\n<html>\n <p>Hello </p>\n<p>This is grand!</p>\n</html>\n</wrapper>\n", @response.body - end - - def test_partial_only - get :partial_only - assert_equal "only partial", @response.body - end - - def test_partial_only_with_layout - get :partial_only_with_layout - assert_equal "<html>only partial</html>", @response.body - end - - def test_render_to_string - get :hello_in_a_string - assert_equal "How's there? goodbyeHello: davidHello: marygoodbye\n", @response.body - end - - def test_nested_rendering - get :hello_world - assert_equal "Living in a nested world", Fun::GamesController.process(@request, @response).body - end - - def test_accessing_params_in_template - get :accessing_params_in_template, :name => "David" - assert_equal "Hello: David", @response.body - end - - def test_accessing_params_in_template_with_layout - get :accessing_params_in_template_with_layout, :name => "David" - assert_equal "<html>Hello: David</html>", @response.body - end - - def test_render_with_explicit_template - get :render_with_explicit_template - assert_response :success - end - - def test_double_render - assert_raises(ActionController::DoubleRenderError) { get :double_render } - end - - def test_double_redirect - assert_raises(ActionController::DoubleRenderError) { get :double_redirect } - end - - def test_render_and_redirect - assert_raises(ActionController::DoubleRenderError) { get :render_and_redirect } - end - - def test_rendering_with_conflicting_local_vars - get :rendering_with_conflicting_local_vars - assert_equal("First: David\nSecond: Stephan\nThird: David\nFourth: David\nFifth: ", @response.body) - end - - def test_action_talk_to_layout - get :action_talk_to_layout - assert_equal "<title>Talking to the layout\nAction was here!", @response.body - end - - def test_partials_list - get :partials_list - assert_equal "goodbyeHello: davidHello: marygoodbye\n", @response.body - end - - def test_partial_with_locals - get :partial_with_locals - assert_equal "Hello: david", @response.body - end - - def test_partial_collection - get :partial_collection - assert_equal "Hello: davidHello: mary", @response.body - end - - def test_partial_collection_with_locals - get :partial_collection_with_locals - assert_equal "Bonjour: davidBonjour: mary", @response.body - end - - def test_empty_partial_collection - get :empty_partial_collection - assert_equal " ", @response.body - end - - def test_partial_with_hash_object - get :partial_with_hash_object - assert_equal "Sam", @response.body - end - - def test_partial_with_implicit_local_assignment - get :partial_with_implicit_local_assignment - assert_equal "Hello: Marcel", @response.body - end - - def test_render_text_with_assigns - get :render_text_with_assigns - assert_equal "world", assigns["hello"] - end - - def test_update_page - get :update_page - assert_template nil - assert_equal 'text/javascript; charset=UTF-8', @response.headers['Content-Type'] - assert_equal 2, @response.body.split($/).length - end - - def test_update_page_with_instance_variables - get :update_page_with_instance_variables - assert_template nil - assert_equal 'text/javascript; charset=UTF-8', @response.headers['Content-Type'] - assert_match /balance/, @response.body - assert_match /\$37/, @response.body - end - - def test_yield_content_for - get :yield_content_for - assert_equal "Putting stuff in the title!\n\nGreat stuff!\n", @response.body - end - - - def test_overwritting_rendering_relative_file_with_extension - get :hello_world_from_rxml_using_template - assert_equal "\n

      Hello

      \n\n", @response.body - - get :hello_world_from_rxml_using_action - assert_equal "\n

      Hello

      \n\n", @response.body - end -end -require 'test/unit' -require 'cgi' -require 'stringio' -require File.dirname(__FILE__) + '/../../lib/action_controller/cgi_ext/raw_post_data_fix' - -class RawPostDataTest < Test::Unit::TestCase - def setup - ENV['REQUEST_METHOD'] = 'POST' - ENV['CONTENT_TYPE'] = '' - ENV['CONTENT_LENGTH'] = '0' - end - - def test_raw_post_data - process_raw "action=create_customer&full_name=David%20Heinemeier%20Hansson&customerId=1" - end - - private - def process_raw(query_string) - old_stdin = $stdin - begin - $stdin = StringIO.new(query_string.dup) - ENV['CONTENT_LENGTH'] = $stdin.size.to_s - CGI.new - assert_not_nil ENV['RAW_POST_DATA'] - assert ENV['RAW_POST_DATA'].frozen? - assert_equal query_string, ENV['RAW_POST_DATA'] - ensure - $stdin = old_stdin - end - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class RedirectController < ActionController::Base - def simple_redirect - redirect_to :action => "hello_world" - end - - def method_redirect - redirect_to :dashbord_url, 1, "hello" - end - - def host_redirect - redirect_to :action => "other_host", :only_path => false, :host => 'other.test.host' - end - - def module_redirect - redirect_to :controller => 'module_test/module_redirect', :action => "hello_world" - end - - def redirect_with_assigns - @hello = "world" - redirect_to :action => "hello_world" - end - - def redirect_to_back - redirect_to :back - end - - def rescue_errors(e) raise e end - - def rescue_action(e) raise end - - protected - def dashbord_url(id, message) - url_for :action => "dashboard", :params => { "id" => id, "message" => message } - end -end - -class RedirectTest < Test::Unit::TestCase - def setup - @controller = RedirectController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_simple_redirect - get :simple_redirect - assert_redirect_url "http://test.host/redirect/hello_world" - end - - def test_redirect_with_method_reference_and_parameters - get :method_redirect - assert_redirect_url "http://test.host/redirect/dashboard/1?message=hello" - end - - def test_simple_redirect_using_options - get :host_redirect - assert_redirected_to :action => "other_host", :only_path => false, :host => 'other.test.host' - end - - def test_redirect_error_with_pretty_diff - get :host_redirect - begin - assert_redirected_to :action => "other_host", :only_path => true - rescue Test::Unit::AssertionFailedError => err - redirection_msg, diff_msg = err.message.scan(/<\{[^\}]+\}>/).collect { |s| s[2..-3] } - assert_match %r(:only_path=>false), redirection_msg - assert_match %r(:host=>"other.test.host"), redirection_msg - assert_match %r(:action=>"other_host"), redirection_msg - assert_match %r(:only_path=>true), diff_msg - assert_match %r(:host=>"other.test.host"), diff_msg - end - end - - def test_module_redirect - get :module_redirect - assert_redirect_url "http://test.host/module_test/module_redirect/hello_world" - end - - def test_module_redirect_using_options - get :module_redirect - assert_redirected_to :controller => 'module_test/module_redirect', :action => 'hello_world' - end - - def test_redirect_with_assigns - get :redirect_with_assigns - assert_equal "world", assigns["hello"] - end - - def test_redirect_to_back - @request.env["HTTP_REFERER"] = "http://www.example.com/coming/from" - get :redirect_to_back - assert_redirect_url "http://www.example.com/coming/from" - end - - def test_redirect_to_back_with_no_referer - assert_raises(ActionController::RedirectBackError) { - @request.env["HTTP_REFERER"] = nil - get :redirect_to_back - } - end -end - -module ModuleTest - class ModuleRedirectController < ::RedirectController - def module_redirect - redirect_to :controller => '/redirect', :action => "hello_world" - end - end - - class ModuleRedirectTest < Test::Unit::TestCase - def setup - @controller = ModuleRedirectController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_simple_redirect - get :simple_redirect - assert_redirect_url "http://test.host/module_test/module_redirect/hello_world" - end - - def test_redirect_with_method_reference_and_parameters - get :method_redirect - assert_redirect_url "http://test.host/module_test/module_redirect/dashboard/1?message=hello" - end - - def test_simple_redirect_using_options - get :host_redirect - assert_redirected_to :action => "other_host", :only_path => false, :host => 'other.test.host' - end - - def test_module_redirect - get :module_redirect - assert_redirect_url "http://test.host/redirect/hello_world" - end - - def test_module_redirect_using_options - get :module_redirect - assert_redirected_to :controller => 'redirect', :action => "hello_world" - end - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -unless defined?(Customer) - Customer = Struct.new("Customer", :name) -end - -module Fun - class GamesController < ActionController::Base - def hello_world - end - end -end - - -class TestController < ActionController::Base - layout :determine_layout - - def hello_world - end - - def render_hello_world - render "test/hello_world" - end - - def render_hello_world_from_variable - @person = "david" - render_text "hello #{@person}" - end - - def render_action_hello_world - render_action "hello_world" - end - - def render_action_hello_world_with_symbol - render_action :hello_world - end - - def render_text_hello_world - render_text "hello world" - end - - def render_custom_code - render_text "hello world", "404 Moved" - end - - def render_xml_hello - @name = "David" - render "test/hello" - end - - def greeting - # let's just rely on the template - end - - def layout_test - render_action "hello_world" - end - - def builder_layout_test - render_action "hello" - end - - def partials_list - @test_unchanged = 'hello' - @customers = [ Customer.new("david"), Customer.new("mary") ] - render_action "list" - end - - def partial_only - render_partial - end - - def hello_in_a_string - @customers = [ Customer.new("david"), Customer.new("mary") ] - render_text "How's there? #{render_to_string("test/list")}" - end - - def accessing_params_in_template - render_template "Hello: <%= params[:name] %>" - end - - def accessing_local_assigns_in_inline_template - name = params[:local_name] - render :inline => "<%= 'Goodbye, ' + local_name %>", - :locals => { :local_name => name } - end - - def accessing_local_assigns_in_inline_template_with_string_keys - name = params[:local_name] - ActionView::Base.local_assigns_support_string_keys = true - render :inline => "<%= 'Goodbye, ' + local_name %>", - :locals => { "local_name" => name } - ActionView::Base.local_assigns_support_string_keys = false - end - - def render_to_string_test - @foo = render_to_string :inline => "this is a test" - end - - def rescue_action(e) raise end - - private - def determine_layout - case action_name - when "layout_test": "layouts/standard" - when "builder_layout_test": "layouts/builder" - end - end -end - -TestController.template_root = File.dirname(__FILE__) + "/../fixtures/" -Fun::GamesController.template_root = File.dirname(__FILE__) + "/../fixtures/" - -class RenderTest < Test::Unit::TestCase - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @controller = TestController.new - - @request.host = "www.nextangle.com" - end - - def test_simple_show - get :hello_world - assert_response 200 - assert_template "test/hello_world" - end - - def test_do_with_render - get :render_hello_world - assert_template "test/hello_world" - end - - def test_do_with_render_from_variable - get :render_hello_world_from_variable - assert_equal "hello david", @response.body - end - - def test_do_with_render_action - get :render_action_hello_world - assert_template "test/hello_world" - end - - def test_do_with_render_action_with_symbol - get :render_action_hello_world_with_symbol - assert_template "test/hello_world" - end - - def test_do_with_render_text - get :render_text_hello_world - assert_equal "hello world", @response.body - end - - def test_do_with_render_custom_code - get :render_custom_code - assert_response 404 - end - - def test_attempt_to_access_object_method - assert_raises(ActionController::UnknownAction, "No action responded to [clone]") { get :clone } - end - - def test_private_methods - assert_raises(ActionController::UnknownAction, "No action responded to [determine_layout]") { get :determine_layout } - end - - def test_access_to_request_in_view - view_internals_old_value = ActionController::Base.view_controller_internals - - ActionController::Base.view_controller_internals = false - ActionController::Base.protected_variables_cache = nil - - get :hello_world - assert_nil assigns["request"] - - ActionController::Base.view_controller_internals = true - ActionController::Base.protected_variables_cache = nil - - get :hello_world - assert_kind_of ActionController::AbstractRequest, assigns["request"] - - ActionController::Base.view_controller_internals = view_internals_old_value - ActionController::Base.protected_variables_cache = nil - end - - def test_render_xml - get :render_xml_hello - assert_equal "\n

      Hello David

      \n

      This is grand!

      \n\n", @response.body - end - - def test_render_xml_with_default - get :greeting - assert_equal "

      This is grand!

      \n", @response.body - end - - def test_layout_rendering - get :layout_test - assert_equal "Hello world!", @response.body - end - - def test_render_xml_with_layouts - get :builder_layout_test - assert_equal "\n\n

      Hello

      \n

      This is grand!

      \n\n
      \n", @response.body - end - - # def test_partials_list - # get :partials_list - # assert_equal "goodbyeHello: davidHello: marygoodbye\n", process_request.body - # end - - def test_partial_only - get :partial_only - assert_equal "only partial", @response.body - end - - def test_render_to_string - get :hello_in_a_string - assert_equal "How's there? goodbyeHello: davidHello: marygoodbye\n", @response.body - end - - def test_render_to_string_resets_assigns - get :render_to_string_test - assert_equal "The value of foo is: ::this is a test::\n", @response.body - end - - def test_nested_rendering - @controller = Fun::GamesController.new - get :hello_world - assert_equal "Living in a nested world", @response.body - end - - def test_accessing_params_in_template - get :accessing_params_in_template, :name => "David" - assert_equal "Hello: David", @response.body - end - - def test_accessing_local_assigns_in_inline_template - get :accessing_local_assigns_in_inline_template, :local_name => "Local David" - assert_equal "Goodbye, Local David", @response.body - end - - def test_accessing_local_assigns_in_inline_template_with_string_keys - get :accessing_local_assigns_in_inline_template_with_string_keys, :local_name => "Local David" - assert_equal "Goodbye, Local David", @response.body - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class RequestTest < Test::Unit::TestCase - def setup - @request = ActionController::TestRequest.new - end - - def test_remote_ip - assert_equal '0.0.0.0', @request.remote_ip - - @request.remote_addr = '1.2.3.4' - assert_equal '1.2.3.4', @request.remote_ip - - @request.env['HTTP_CLIENT_IP'] = '2.3.4.5' - assert_equal '2.3.4.5', @request.remote_ip - @request.env.delete 'HTTP_CLIENT_IP' - - @request.env['HTTP_X_FORWARDED_FOR'] = '3.4.5.6' - assert_equal '3.4.5.6', @request.remote_ip - - @request.env['HTTP_X_FORWARDED_FOR'] = 'unknown,3.4.5.6' - assert_equal '3.4.5.6', @request.remote_ip - - @request.env['HTTP_X_FORWARDED_FOR'] = '172.16.0.1,3.4.5.6' - assert_equal '3.4.5.6', @request.remote_ip - - @request.env['HTTP_X_FORWARDED_FOR'] = '192.168.0.1,3.4.5.6' - assert_equal '3.4.5.6', @request.remote_ip - - @request.env['HTTP_X_FORWARDED_FOR'] = '10.0.0.1,3.4.5.6' - assert_equal '3.4.5.6', @request.remote_ip - - @request.env['HTTP_X_FORWARDED_FOR'] = '127.0.0.1,3.4.5.6' - assert_equal '127.0.0.1', @request.remote_ip - - @request.env['HTTP_X_FORWARDED_FOR'] = 'unknown,192.168.0.1' - assert_equal '1.2.3.4', @request.remote_ip - @request.env.delete 'HTTP_X_FORWARDED_FOR' - end - - def test_domains - @request.host = "www.rubyonrails.org" - assert_equal "rubyonrails.org", @request.domain - - @request.host = "www.rubyonrails.co.uk" - assert_equal "rubyonrails.co.uk", @request.domain(2) - - @request.host = "192.168.1.200" - assert_nil @request.domain - - @request.host = nil - assert_nil @request.domain - end - - def test_subdomains - @request.host = "www.rubyonrails.org" - assert_equal %w( www ), @request.subdomains - - @request.host = "www.rubyonrails.co.uk" - assert_equal %w( www ), @request.subdomains(2) - - @request.host = "dev.www.rubyonrails.co.uk" - assert_equal %w( dev www ), @request.subdomains(2) - - @request.host = "foobar.foobar.com" - assert_equal %w( foobar ), @request.subdomains - - @request.host = nil - assert_equal [], @request.subdomains - end - - def test_port_string - @request.port = 80 - assert_equal "", @request.port_string - - @request.port = 8080 - assert_equal ":8080", @request.port_string - end - - def test_relative_url_root - @request.env['SCRIPT_NAME'] = "/hieraki/dispatch.cgi" - @request.env['SERVER_SOFTWARE'] = 'lighttpd/1.2.3' - assert_equal '', @request.relative_url_root, "relative_url_root should be disabled on lighttpd" - - @request.env['SERVER_SOFTWARE'] = 'apache/1.2.3 some random text' - - @request.env['SCRIPT_NAME'] = nil - assert_equal "", @request.relative_url_root - - @request.env['SCRIPT_NAME'] = "/dispatch.cgi" - assert_equal "", @request.relative_url_root - - @request.env['SCRIPT_NAME'] = "/myapp.rb" - assert_equal "", @request.relative_url_root - - @request.relative_url_root = nil - @request.env['SCRIPT_NAME'] = "/hieraki/dispatch.cgi" - assert_equal "/hieraki", @request.relative_url_root - - @request.relative_url_root = nil - @request.env['SCRIPT_NAME'] = "/collaboration/hieraki/dispatch.cgi" - assert_equal "/collaboration/hieraki", @request.relative_url_root - - # apache/scgi case - @request.relative_url_root = nil - @request.env['SCRIPT_NAME'] = "/collaboration/hieraki" - assert_equal "/collaboration/hieraki", @request.relative_url_root - - @request.relative_url_root = nil - @request.env['SCRIPT_NAME'] = "/hieraki/dispatch.cgi" - @request.env['SERVER_SOFTWARE'] = 'lighttpd/1.2.3' - @request.env['RAILS_RELATIVE_URL_ROOT'] = "/hieraki" - assert_equal "/hieraki", @request.relative_url_root - - # @env overrides path guess - @request.relative_url_root = nil - @request.env['SCRIPT_NAME'] = "/hieraki/dispatch.cgi" - @request.env['SERVER_SOFTWARE'] = 'apache/1.2.3 some random text' - @request.env['RAILS_RELATIVE_URL_ROOT'] = "/real_url" - assert_equal "/real_url", @request.relative_url_root - end - - def test_request_uri - @request.env['SERVER_SOFTWARE'] = 'Apache 42.342.3432' - - @request.relative_url_root = nil - @request.set_REQUEST_URI "http://www.rubyonrails.org/path/of/some/uri?mapped=1" - assert_equal "/path/of/some/uri?mapped=1", @request.request_uri - assert_equal "/path/of/some/uri", @request.path - - @request.relative_url_root = nil - @request.set_REQUEST_URI "http://www.rubyonrails.org/path/of/some/uri" - assert_equal "/path/of/some/uri", @request.request_uri - assert_equal "/path/of/some/uri", @request.path - - @request.relative_url_root = nil - @request.set_REQUEST_URI "/path/of/some/uri" - assert_equal "/path/of/some/uri", @request.request_uri - assert_equal "/path/of/some/uri", @request.path - - @request.relative_url_root = nil - @request.set_REQUEST_URI "/" - assert_equal "/", @request.request_uri - assert_equal "/", @request.path - - @request.relative_url_root = nil - @request.set_REQUEST_URI "/?m=b" - assert_equal "/?m=b", @request.request_uri - assert_equal "/", @request.path - - @request.relative_url_root = nil - @request.set_REQUEST_URI "/" - @request.env['SCRIPT_NAME'] = "/dispatch.cgi" - assert_equal "/", @request.request_uri - assert_equal "/", @request.path - - @request.relative_url_root = nil - @request.set_REQUEST_URI "/hieraki/" - @request.env['SCRIPT_NAME'] = "/hieraki/dispatch.cgi" - assert_equal "/hieraki/", @request.request_uri - assert_equal "/", @request.path - - @request.relative_url_root = nil - @request.set_REQUEST_URI "/collaboration/hieraki/books/edit/2" - @request.env['SCRIPT_NAME'] = "/collaboration/hieraki/dispatch.cgi" - assert_equal "/collaboration/hieraki/books/edit/2", @request.request_uri - assert_equal "/books/edit/2", @request.path - - # The following tests are for when REQUEST_URI is not supplied (as in IIS) - @request.relative_url_root = nil - @request.set_REQUEST_URI nil - @request.env['PATH_INFO'] = "/path/of/some/uri?mapped=1" - @request.env['SCRIPT_NAME'] = nil #"/path/dispatch.rb" - assert_equal "/path/of/some/uri?mapped=1", @request.request_uri - assert_equal "/path/of/some/uri", @request.path - - @request.relative_url_root = nil - @request.env['PATH_INFO'] = "/path/of/some/uri?mapped=1" - @request.env['SCRIPT_NAME'] = "/path/dispatch.rb" - assert_equal "/path/of/some/uri?mapped=1", @request.request_uri - assert_equal "/of/some/uri", @request.path - - @request.relative_url_root = nil - @request.env['PATH_INFO'] = "/path/of/some/uri" - @request.env['SCRIPT_NAME'] = nil - assert_equal "/path/of/some/uri", @request.request_uri - assert_equal "/path/of/some/uri", @request.path - - @request.relative_url_root = nil - @request.env['PATH_INFO'] = "/" - assert_equal "/", @request.request_uri - assert_equal "/", @request.path - - @request.relative_url_root = nil - @request.env['PATH_INFO'] = "/?m=b" - assert_equal "/?m=b", @request.request_uri - assert_equal "/", @request.path - - @request.relative_url_root = nil - @request.env['PATH_INFO'] = "/" - @request.env['SCRIPT_NAME'] = "/dispatch.cgi" - assert_equal "/", @request.request_uri - assert_equal "/", @request.path - - @request.relative_url_root = nil - @request.env['PATH_INFO'] = "/hieraki/" - @request.env['SCRIPT_NAME'] = "/hieraki/dispatch.cgi" - assert_equal "/hieraki/", @request.request_uri - assert_equal "/", @request.path - - # This test ensures that Rails uses REQUEST_URI over PATH_INFO - @request.relative_url_root = nil - @request.env['REQUEST_URI'] = "/some/path" - @request.env['PATH_INFO'] = "/another/path" - @request.env['SCRIPT_NAME'] = "/dispatch.cgi" - assert_equal "/some/path", @request.request_uri - assert_equal "/some/path", @request.path - end - - - def test_host_with_port - @request.host = "rubyonrails.org" - @request.port = 80 - assert_equal "rubyonrails.org", @request.host_with_port - - @request.host = "rubyonrails.org" - @request.port = 81 - assert_equal "rubyonrails.org:81", @request.host_with_port - end - - def test_server_software - assert_equal nil, @request.server_software - - @request.env['SERVER_SOFTWARE'] = 'Apache3.422' - assert_equal 'apache', @request.server_software - - @request.env['SERVER_SOFTWARE'] = 'lighttpd(1.1.4)' - assert_equal 'lighttpd', @request.server_software - end - - def test_xml_http_request - assert !@request.xml_http_request? - assert !@request.xhr? - - @request.env['HTTP_X_REQUESTED_WITH'] = "DefinitelyNotAjax1.0" - assert !@request.xml_http_request? - assert !@request.xhr? - - @request.env['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest" - assert @request.xml_http_request? - assert @request.xhr? - end - - def test_reports_ssl - assert !@request.ssl? - @request.env['HTTPS'] = 'on' - assert @request.ssl? - end - - def test_reports_ssl_when_proxied_via_lighttpd - assert !@request.ssl? - @request.env['HTTP_X_FORWARDED_PROTO'] = 'https' - assert @request.ssl? - end - -end -require File.dirname(__FILE__) + '/../abstract_unit' -require 'test/unit' -require File.dirname(__FILE__) + '/fake_controllers' -require 'stringio' - -RunTimeTests = ARGV.include? 'time' - -module ActionController::CodeGeneration - -class SourceTests < Test::Unit::TestCase - attr_accessor :source - def setup - @source = Source.new - end - - def test_initial_state - assert_equal [], source.lines - assert_equal 0, source.indentation_level - end - - def test_trivial_operations - source << "puts 'Hello World'" - assert_equal ["puts 'Hello World'"], source.lines - assert_equal "puts 'Hello World'", source.to_s - - source.line "puts 'Goodbye World'" - assert_equal ["puts 'Hello World'", "puts 'Goodbye World'"], source.lines - assert_equal "puts 'Hello World'\nputs 'Goodbye World'", source.to_s - end - - def test_indentation - source << "x = gets.to_i" - source << 'if x.odd?' - source.indent { source << "puts 'x is odd!'" } - source << 'else' - source.indent { source << "puts 'x is even!'" } - source << 'end' - - assert_equal ["x = gets.to_i", "if x.odd?", " puts 'x is odd!'", 'else', " puts 'x is even!'", 'end'], source.lines - - text = "x = gets.to_i -if x.odd? - puts 'x is odd!' -else - puts 'x is even!' -end" - - assert_equal text, source.to_s - end -end - -class CodeGeneratorTests < Test::Unit::TestCase - attr_accessor :generator - def setup - @generator = CodeGenerator.new - end - - def test_initial_state - assert_equal [], generator.source.lines - assert_equal [], generator.locals - end - - def test_trivial_operations - ["puts 'Hello World'", "puts 'Goodbye World'"].each {|l| generator << l} - assert_equal ["puts 'Hello World'", "puts 'Goodbye World'"], generator.source.lines - assert_equal "puts 'Hello World'\nputs 'Goodbye World'", generator.to_s - end - - def test_if - generator << "x = gets.to_i" - generator.if("x.odd?") { generator << "puts 'x is odd!'" } - - assert_equal "x = gets.to_i\nif x.odd?\n puts 'x is odd!'\nend", generator.to_s - end - - def test_else - test_if - generator.else { generator << "puts 'x is even!'" } - - assert_equal "x = gets.to_i\nif x.odd?\n puts 'x is odd!'\nelse \n puts 'x is even!'\nend", generator.to_s - end - - def test_dup - generator << 'x = 2' - generator.locals << :x - - g = generator.dup - assert_equal generator.source, g.source - assert_equal generator.locals, g.locals - - g << 'y = 3' - g.locals << :y - assert_equal [:x, :y], g.locals # Make sure they don't share the same array. - assert_equal [:x], generator.locals - end -end - -class RecognitionTests < Test::Unit::TestCase - attr_accessor :generator - alias :g :generator - def setup - @generator = RecognitionGenerator.new - end - - def go(components) - g.current = components.first - g.after = components[1..-1] || [] - g.go - end - - def execute(path, show = false) - path = path.split('/') if path.is_a? String - source = "index, path = 0, #{path.inspect}\n#{g.to_s}" - puts source if show - r = eval source - r ? r.symbolize_keys : nil - end - - Static = ::ActionController::Routing::StaticComponent - Dynamic = ::ActionController::Routing::DynamicComponent - Path = ::ActionController::Routing::PathComponent - Controller = ::ActionController::Routing::ControllerComponent - - def test_all_static - c = %w(hello world how are you).collect {|str| Static.new(str)} - - g.result :controller, "::ContentController", true - g.constant_result :action, 'index' - - go c - - assert_nil execute('x') - assert_nil execute('hello/world/how') - assert_nil execute('hello/world/how/are') - assert_nil execute('hello/world/how/are/you/today') - assert_equal({:controller => ::ContentController, :action => 'index'}, execute('hello/world/how/are/you')) - end - - def test_basic_dynamic - c = [Static.new("hi"), Dynamic.new(:action)] - g.result :controller, "::ContentController", true - go c - - assert_nil execute('boo') - assert_nil execute('boo/blah') - assert_nil execute('hi') - assert_nil execute('hi/dude/what') - assert_equal({:controller => ::ContentController, :action => 'dude'}, execute('hi/dude')) - end - - def test_basic_dynamic_backwards - c = [Dynamic.new(:action), Static.new("hi")] - go c - - assert_nil execute('') - assert_nil execute('boo') - assert_nil execute('boo/blah') - assert_nil execute('hi') - assert_equal({:action => 'index'}, execute('index/hi')) - assert_equal({:action => 'show'}, execute('show/hi')) - assert_nil execute('hi/dude') - end - - def test_dynamic_with_default - c = [Static.new("hi"), Dynamic.new(:action, :default => 'index')] - g.result :controller, "::ContentController", true - go c - - assert_nil execute('boo') - assert_nil execute('boo/blah') - assert_nil execute('hi/dude/what') - assert_equal({:controller => ::ContentController, :action => 'index'}, execute('hi')) - assert_equal({:controller => ::ContentController, :action => 'index'}, execute('hi/index')) - assert_equal({:controller => ::ContentController, :action => 'dude'}, execute('hi/dude')) - end - - def test_dynamic_with_string_condition - c = [Static.new("hi"), Dynamic.new(:action, :condition => 'index')] - g.result :controller, "::ContentController", true - go c - - assert_nil execute('boo') - assert_nil execute('boo/blah') - assert_nil execute('hi') - assert_nil execute('hi/dude/what') - assert_equal({:controller => ::ContentController, :action => 'index'}, execute('hi/index')) - assert_nil execute('hi/dude') - end - - def test_dynamic_with_string_condition_backwards - c = [Dynamic.new(:action, :condition => 'index'), Static.new("hi")] - g.result :controller, "::ContentController", true - go c - - assert_nil execute('boo') - assert_nil execute('boo/blah') - assert_nil execute('hi') - assert_nil execute('dude/what/hi') - assert_nil execute('index/what') - assert_equal({:controller => ::ContentController, :action => 'index'}, execute('index/hi')) - assert_nil execute('dude/hi') - end - - def test_dynamic_with_regexp_condition - c = [Static.new("hi"), Dynamic.new(:action, :condition => /^[a-z]+$/)] - g.result :controller, "::ContentController", true - go c - - assert_nil execute('boo') - assert_nil execute('boo/blah') - assert_nil execute('hi') - assert_nil execute('hi/FOXY') - assert_nil execute('hi/138708jkhdf') - assert_nil execute('hi/dkjfl8792343dfsf') - assert_nil execute('hi/dude/what') - assert_equal({:controller => ::ContentController, :action => 'index'}, execute('hi/index')) - assert_equal({:controller => ::ContentController, :action => 'dude'}, execute('hi/dude')) - end - - def test_dynamic_with_regexp_and_default - c = [Static.new("hi"), Dynamic.new(:action, :condition => /^[a-z]+$/, :default => 'index')] - g.result :controller, "::ContentController", true - go c - - assert_nil execute('boo') - assert_nil execute('boo/blah') - assert_nil execute('hi/FOXY') - assert_nil execute('hi/138708jkhdf') - assert_nil execute('hi/dkjfl8792343dfsf') - assert_equal({:controller => ::ContentController, :action => 'index'}, execute('hi')) - assert_equal({:controller => ::ContentController, :action => 'index'}, execute('hi/index')) - assert_equal({:controller => ::ContentController, :action => 'dude'}, execute('hi/dude')) - assert_nil execute('hi/dude/what') - end - - def test_path - c = [Static.new("hi"), Path.new(:file)] - g.result :controller, "::ContentController", true - g.constant_result :action, "download" - - go c - - assert_nil execute('boo') - assert_nil execute('boo/blah') - assert_equal({:controller => ::ContentController, :action => 'download', :file => []}, execute('hi')) - assert_equal({:controller => ::ContentController, :action => 'download', :file => %w(books agile_rails_dev.pdf)}, - execute('hi/books/agile_rails_dev.pdf')) - assert_equal({:controller => ::ContentController, :action => 'download', :file => ['dude']}, execute('hi/dude')) - assert_equal 'dude/what', execute('hi/dude/what')[:file].to_s - end - - def test_path_with_dynamic - c = [Dynamic.new(:action), Path.new(:file)] - g.result :controller, "::ContentController", true - - go c - - assert_nil execute('') - assert_equal({:controller => ::ContentController, :action => 'download', :file => []}, execute('download')) - assert_equal({:controller => ::ContentController, :action => 'download', :file => %w(books agile_rails_dev.pdf)}, - execute('download/books/agile_rails_dev.pdf')) - assert_equal({:controller => ::ContentController, :action => 'download', :file => ['dude']}, execute('download/dude')) - assert_equal 'dude/what', execute('hi/dude/what')[:file].to_s - end - - def test_path_with_dynamic_and_default - c = [Dynamic.new(:action, :default => 'index'), Path.new(:file)] - - go c - - assert_equal({:action => 'index', :file => []}, execute('')) - assert_equal({:action => 'index', :file => []}, execute('index')) - assert_equal({:action => 'blarg', :file => []}, execute('blarg')) - assert_equal({:action => 'index', :file => ['content']}, execute('index/content')) - assert_equal({:action => 'show', :file => ['rails_dev.pdf']}, execute('show/rails_dev.pdf')) - end - - def test_controller - c = [Static.new("hi"), Controller.new(:controller)] - g.constant_result :action, "hi" - - go c - - assert_nil execute('boo') - assert_nil execute('boo/blah') - assert_nil execute('hi/x') - assert_nil execute('hi/13870948') - assert_nil execute('hi/content/dog') - assert_nil execute('hi/admin/user/foo') - assert_equal({:controller => ::ContentController, :action => 'hi'}, execute('hi/content')) - assert_equal({:controller => ::Admin::UserController, :action => 'hi'}, execute('hi/admin/user')) - end - - def test_controller_with_regexp - c = [Static.new("hi"), Controller.new(:controller, :condition => /^admin\/.+$/)] - g.constant_result :action, "hi" - - go c - - assert_nil execute('hi') - assert_nil execute('hi/x') - assert_nil execute('hi/content') - assert_equal({:controller => ::Admin::UserController, :action => 'hi'}, execute('hi/admin/user')) - assert_equal({:controller => ::Admin::NewsFeedController, :action => 'hi'}, execute('hi/admin/news_feed')) - assert_nil execute('hi/admin/user/foo') - end - - def test_standard_route(time = ::RunTimeTests) - c = [Controller.new(:controller), Dynamic.new(:action, :default => 'index'), Dynamic.new(:id, :default => nil)] - go c - - # Make sure we get the right answers - assert_equal({:controller => ::ContentController, :action => 'index'}, execute('content')) - assert_equal({:controller => ::ContentController, :action => 'list'}, execute('content/list')) - assert_equal({:controller => ::ContentController, :action => 'show', :id => '10'}, execute('content/show/10')) - - assert_equal({:controller => ::Admin::UserController, :action => 'index'}, execute('admin/user')) - assert_equal({:controller => ::Admin::UserController, :action => 'list'}, execute('admin/user/list')) - assert_equal({:controller => ::Admin::UserController, :action => 'show', :id => 'nseckar'}, execute('admin/user/show/nseckar')) - - assert_nil execute('content/show/10/20') - assert_nil execute('food') - - if time - source = "def self.execute(path) - path = path.split('/') if path.is_a? String - index = 0 - r = #{g.to_s} - end" - eval(source) - - GC.start - n = 1000 - time = Benchmark.realtime do n.times { - execute('content') - execute('content/list') - execute('content/show/10') - - execute('admin/user') - execute('admin/user/list') - execute('admin/user/show/nseckar') - - execute('admin/user/show/nseckar/dude') - execute('admin/why/show/nseckar') - execute('content/show/10/20') - execute('food') - } end - time -= Benchmark.realtime do n.times { } end - - - puts "\n\nRecognition:" - per_url = time / (n * 10) - - puts "#{per_url * 1000} ms/url" - puts "#{1 / per_url} urls/s\n\n" - end - end - - def test_default_route - g.result :controller, "::ContentController", true - g.constant_result :action, 'index' - - go [] - - assert_nil execute('x') - assert_nil execute('hello/world/how') - assert_nil execute('hello/world/how/are') - assert_nil execute('hello/world/how/are/you/today') - assert_equal({:controller => ::ContentController, :action => 'index'}, execute([])) - end -end - -class GenerationTests < Test::Unit::TestCase - attr_accessor :generator - alias :g :generator - def setup - @generator = GenerationGenerator.new # ha! - end - - def go(components) - g.current = components.first - g.after = components[1..-1] || [] - g.go - end - - def execute(options, recall, show = false) - source = "\n -expire_on = ::ActionController::Routing.expiry_hash(options, recall) -hash = merged = recall.merge(options) -not_expired = true - -#{g.to_s}\n\n" - puts source if show - eval(source) - end - - Static = ::ActionController::Routing::StaticComponent - Dynamic = ::ActionController::Routing::DynamicComponent - Path = ::ActionController::Routing::PathComponent - Controller = ::ActionController::Routing::ControllerComponent - - def test_all_static_no_requirements - c = [Static.new("hello"), Static.new("world")] - go c - - assert_equal "/hello/world", execute({}, {}) - end - - def test_basic_dynamic - c = [Static.new("hi"), Dynamic.new(:action)] - go c - - assert_equal '/hi/index', execute({:action => 'index'}, {:action => 'index'}) - assert_equal '/hi/show', execute({:action => 'show'}, {:action => 'index'}) - assert_equal '/hi/list+people', execute({}, {:action => 'list people'}) - assert_nil execute({},{}) - end - - def test_dynamic_with_default - c = [Static.new("hi"), Dynamic.new(:action, :default => 'index')] - go c - - assert_equal '/hi', execute({:action => 'index'}, {:action => 'index'}) - assert_equal '/hi/show', execute({:action => 'show'}, {:action => 'index'}) - assert_equal '/hi/list+people', execute({}, {:action => 'list people'}) - assert_equal '/hi', execute({}, {}) - end - - def test_dynamic_with_regexp_condition - c = [Static.new("hi"), Dynamic.new(:action, :condition => /^[a-z]+$/)] - go c - - assert_equal '/hi/index', execute({:action => 'index'}, {:action => 'index'}) - assert_nil execute({:action => 'fox5'}, {:action => 'index'}) - assert_nil execute({:action => 'something_is_up'}, {:action => 'index'}) - assert_nil execute({}, {:action => 'list people'}) - assert_equal '/hi/abunchofcharacter', execute({:action => 'abunchofcharacter'}, {}) - assert_nil execute({}, {}) - end - - def test_dynamic_with_default_and_regexp_condition - c = [Static.new("hi"), Dynamic.new(:action, :default => 'index', :condition => /^[a-z]+$/)] - go c - - assert_equal '/hi', execute({:action => 'index'}, {:action => 'index'}) - assert_nil execute({:action => 'fox5'}, {:action => 'index'}) - assert_nil execute({:action => 'something_is_up'}, {:action => 'index'}) - assert_nil execute({}, {:action => 'list people'}) - assert_equal '/hi/abunchofcharacter', execute({:action => 'abunchofcharacter'}, {}) - assert_equal '/hi', execute({}, {}) - end - - def test_path - c = [Static.new("hi"), Path.new(:file)] - go c - - assert_equal '/hi', execute({:file => []}, {}) - assert_equal '/hi/books/agile_rails_dev.pdf', execute({:file => %w(books agile_rails_dev.pdf)}, {}) - assert_equal '/hi/books/development%26whatever/agile_rails_dev.pdf', execute({:file => %w(books development&whatever agile_rails_dev.pdf)}, {}) - - assert_equal '/hi', execute({:file => ''}, {}) - assert_equal '/hi/books/agile_rails_dev.pdf', execute({:file => 'books/agile_rails_dev.pdf'}, {}) - assert_equal '/hi/books/development%26whatever/agile_rails_dev.pdf', execute({:file => 'books/development&whatever/agile_rails_dev.pdf'}, {}) - end - - def test_controller - c = [Static.new("hi"), Controller.new(:controller)] - go c - - assert_nil execute({}, {}) - assert_equal '/hi/content', execute({:controller => 'content'}, {}) - assert_equal '/hi/admin/user', execute({:controller => 'admin/user'}, {}) - assert_equal '/hi/content', execute({}, {:controller => 'content'}) - assert_equal '/hi/admin/user', execute({}, {:controller => 'admin/user'}) - end - - def test_controller_with_regexp - c = [Static.new("hi"), Controller.new(:controller, :condition => /^admin\/.+$/)] - go c - - assert_nil execute({}, {}) - assert_nil execute({:controller => 'content'}, {}) - assert_equal '/hi/admin/user', execute({:controller => 'admin/user'}, {}) - assert_nil execute({}, {:controller => 'content'}) - assert_equal '/hi/admin/user', execute({}, {:controller => 'admin/user'}) - end - - def test_standard_route(time = ::RunTimeTests) - c = [Controller.new(:controller), Dynamic.new(:action, :default => 'index'), Dynamic.new(:id, :default => nil)] - go c - - # Make sure we get the right answers - assert_equal('/content', execute({:action => 'index'}, {:controller => 'content', :action => 'list'})) - assert_equal('/content/list', execute({:action => 'list'}, {:controller => 'content', :action => 'index'})) - assert_equal('/content/show/10', execute({:action => 'show', :id => '10'}, {:controller => 'content', :action => 'list'})) - - assert_equal('/admin/user', execute({:action => 'index'}, {:controller => 'admin/user', :action => 'list'})) - assert_equal('/admin/user/list', execute({:action => 'list'}, {:controller => 'admin/user', :action => 'index'})) - assert_equal('/admin/user/show/10', execute({:action => 'show', :id => '10'}, {:controller => 'admin/user', :action => 'list'})) - - if time - GC.start - n = 1000 - time = Benchmark.realtime do n.times { - execute({:action => 'index'}, {:controller => 'content', :action => 'list'}) - execute({:action => 'list'}, {:controller => 'content', :action => 'index'}) - execute({:action => 'show', :id => '10'}, {:controller => 'content', :action => 'list'}) - - execute({:action => 'index'}, {:controller => 'admin/user', :action => 'list'}) - execute({:action => 'list'}, {:controller => 'admin/user', :action => 'index'}) - execute({:action => 'show', :id => '10'}, {:controller => 'admin/user', :action => 'list'}) - } end - time -= Benchmark.realtime do n.times { } end - - puts "\n\nGeneration:" - per_url = time / (n * 6) - - puts "#{per_url * 1000} ms/url" - puts "#{1 / per_url} urls/s\n\n" - end - end - - def test_default_route - g.if(g.check_conditions(:controller => 'content', :action => 'welcome')) { go [] } - - assert_nil execute({:controller => 'foo', :action => 'welcome'}, {}) - assert_nil execute({:controller => 'content', :action => 'elcome'}, {}) - assert_nil execute({:action => 'elcome'}, {:controller => 'content'}) - - assert_equal '/', execute({:controller => 'content', :action => 'welcome'}, {}) - assert_equal '/', execute({:action => 'welcome'}, {:controller => 'content'}) - assert_equal '/', execute({:action => 'welcome', :id => '10'}, {:controller => 'content'}) - end -end - -class RouteTests < Test::Unit::TestCase - - def route(*args) - @route = ::ActionController::Routing::Route.new(*args) unless args.empty? - return @route - end - - def rec(path, show = false) - path = path.split('/') if path.is_a? String - index = 0 - source = route.write_recognition.to_s - puts "\n\n#{source}\n\n" if show - r = eval(source) - r ? r.symbolize_keys : r - end - def gen(options, recall = nil, show = false) - recall ||= options.dup - - expire_on = ::ActionController::Routing.expiry_hash(options, recall) - hash = merged = recall.merge(options) - not_expired = true - - source = route.write_generation.to_s - puts "\n\n#{source}\n\n" if show - eval(source) - - end - - def test_static - route 'hello/world', :known => 'known_value', :controller => 'content', :action => 'index' - - assert_nil rec('hello/turn') - assert_nil rec('turn/world') - assert_equal( - {:known => 'known_value', :controller => ::ContentController, :action => 'index'}, - rec('hello/world') - ) - - assert_nil gen(:known => 'foo') - assert_nil gen({}) - assert_equal '/hello/world', gen(:known => 'known_value', :controller => 'content', :action => 'index') - assert_equal '/hello/world', gen(:known => 'known_value', :extra => 'hi', :controller => 'content', :action => 'index') - assert_equal [:extra], route.extra_keys(:known => 'known_value', :extra => 'hi') - end - - def test_dynamic - route 'hello/:name', :controller => 'content', :action => 'show_person' - - assert_nil rec('hello') - assert_nil rec('foo/bar') - assert_equal({:controller => ::ContentController, :action => 'show_person', :name => 'rails'}, rec('hello/rails')) - assert_equal({:controller => ::ContentController, :action => 'show_person', :name => 'Nicholas Seckar'}, rec('hello/Nicholas+Seckar')) - - assert_nil gen(:controller => 'content', :action => 'show_dude', :name => 'rails') - assert_nil gen(:controller => 'content', :action => 'show_person') - assert_nil gen(:controller => 'admin/user', :action => 'show_person', :name => 'rails') - assert_equal '/hello/rails', gen(:controller => 'content', :action => 'show_person', :name => 'rails') - assert_equal '/hello/Nicholas+Seckar', gen(:controller => 'content', :action => 'show_person', :name => 'Nicholas Seckar') - end - - def test_typical - route ':controller/:action/:id', :action => 'index', :id => nil - assert_nil rec('hello') - assert_nil rec('foo bar') - assert_equal({:controller => ::ContentController, :action => 'index'}, rec('content')) - assert_equal({:controller => ::Admin::UserController, :action => 'index'}, rec('admin/user')) - - assert_equal({:controller => ::Admin::UserController, :action => 'index'}, rec('admin/user/index')) - assert_equal({:controller => ::Admin::UserController, :action => 'list'}, rec('admin/user/list')) - assert_equal({:controller => ::Admin::UserController, :action => 'show', :id => '10'}, rec('admin/user/show/10')) - - assert_equal({:controller => ::ContentController, :action => 'list'}, rec('content/list')) - assert_equal({:controller => ::ContentController, :action => 'show', :id => '10'}, rec('content/show/10')) - - - assert_equal '/content', gen(:controller => 'content', :action => 'index') - assert_equal '/content/list', gen(:controller => 'content', :action => 'list') - assert_equal '/content/show/10', gen(:controller => 'content', :action => 'show', :id => '10') - - assert_equal '/admin/user', gen(:controller => 'admin/user', :action => 'index') - assert_equal '/admin/user', gen(:controller => 'admin/user') - assert_equal '/admin/user', gen({:controller => 'admin/user'}, {:controller => 'content', :action => 'list', :id => '10'}) - assert_equal '/admin/user/show/10', gen(:controller => 'admin/user', :action => 'show', :id => '10') - end -end - -class RouteSetTests < Test::Unit::TestCase - attr_reader :rs - def setup - @rs = ::ActionController::Routing::RouteSet.new - @rs.draw {|m| m.connect ':controller/:action/:id' } - ::ActionController::Routing::NamedRoutes.clear - end - - def test_default_setup - assert_equal({:controller => ::ContentController, :action => 'index'}.stringify_keys, rs.recognize_path(%w(content))) - assert_equal({:controller => ::ContentController, :action => 'list'}.stringify_keys, rs.recognize_path(%w(content list))) - assert_equal({:controller => ::ContentController, :action => 'show', :id => '10'}.stringify_keys, rs.recognize_path(%w(content show 10))) - - assert_equal({:controller => ::Admin::UserController, :action => 'show', :id => '10'}.stringify_keys, rs.recognize_path(%w(admin user show 10))) - - assert_equal ['/admin/user/show/10', []], rs.generate({:controller => 'admin/user', :action => 'show', :id => 10}) - - assert_equal ['/admin/user/show', []], rs.generate({:action => 'show'}, {:controller => 'admin/user', :action => 'list', :id => '10'}) - assert_equal ['/admin/user/list/10', []], rs.generate({}, {:controller => 'admin/user', :action => 'list', :id => '10'}) - - assert_equal ['/admin/stuff', []], rs.generate({:controller => 'stuff'}, {:controller => 'admin/user', :action => 'list', :id => '10'}) - assert_equal ['/stuff', []], rs.generate({:controller => '/stuff'}, {:controller => 'admin/user', :action => 'list', :id => '10'}) - end - - def test_ignores_leading_slash - @rs.draw {|m| m.connect '/:controller/:action/:id'} - test_default_setup - end - - def test_time_recognition - n = 10000 - if RunTimeTests - GC.start - rectime = Benchmark.realtime do - n.times do - rs.recognize_path(%w(content)) - rs.recognize_path(%w(content list)) - rs.recognize_path(%w(content show 10)) - rs.recognize_path(%w(admin user)) - rs.recognize_path(%w(admin user list)) - rs.recognize_path(%w(admin user show 10)) - end - end - puts "\n\nRecognition (RouteSet):" - per_url = rectime / (n * 6) - puts "#{per_url * 1000} ms/url" - puts "#{1 / per_url} url/s\n\n" - end - end - def test_time_generation - n = 5000 - if RunTimeTests - GC.start - pairs = [ - [{:controller => 'content', :action => 'index'}, {:controller => 'content', :action => 'show'}], - [{:controller => 'content'}, {:controller => 'content', :action => 'index'}], - [{:controller => 'content', :action => 'list'}, {:controller => 'content', :action => 'index'}], - [{:controller => 'content', :action => 'show', :id => '10'}, {:controller => 'content', :action => 'list'}], - [{:controller => 'admin/user', :action => 'index'}, {:controller => 'admin/user', :action => 'show'}], - [{:controller => 'admin/user'}, {:controller => 'admin/user', :action => 'index'}], - [{:controller => 'admin/user', :action => 'list'}, {:controller => 'admin/user', :action => 'index'}], - [{:controller => 'admin/user', :action => 'show', :id => '10'}, {:controller => 'admin/user', :action => 'list'}], - ] - p = nil - gentime = Benchmark.realtime do - n.times do - pairs.each {|(a, b)| rs.generate(a, b)} - end - end - - puts "\n\nGeneration (RouteSet): (#{(n * 8)} urls)" - per_url = gentime / (n * 8) - puts "#{per_url * 1000} ms/url" - puts "#{1 / per_url} url/s\n\n" - end - end - - def test_route_with_colon_first - rs.draw do |map| - map.connect '/:controller/:action/:id', :action => 'index', :id => nil - map.connect ':url', :controller => 'tiny_url', :action => 'translate' - end - end - - def test_route_generating_string_literal_in_comparison_warning - old_stderr = $stderr - $stderr = StringIO.new - rs.draw do |map| - map.connect 'subscriptions/:action/:subscription_type', :controller => "subscriptions" - end - assert_equal "", $stderr.string - ensure - $stderr = old_stderr - end - - def test_route_with_regexp_for_controller - rs.draw do |map| - map.connect ':controller/:admintoken/:action/:id', :controller => /admin\/.+/ - map.connect ':controller/:action/:id' - end - assert_equal({:controller => ::Admin::UserController, :admintoken => "foo", :action => "index"}.stringify_keys, - rs.recognize_path(%w(admin user foo))) - assert_equal({:controller => ::ContentController, :action => "foo"}.stringify_keys, - rs.recognize_path(%w(content foo))) - assert_equal ['/admin/user/foo', []], rs.generate(:controller => "admin/user", :admintoken => "foo", :action => "index") - assert_equal ['/content/foo',[]], rs.generate(:controller => "content", :action => "foo") - end - - def test_basic_named_route - rs.home '', :controller => 'content', :action => 'list' - x = setup_for_named_route - assert_equal({:controller => '/content', :action => 'list'}, - x.new.send(:home_url)) - end - - def test_named_route_with_option - rs.page 'page/:title', :controller => 'content', :action => 'show_page' - x = setup_for_named_route - assert_equal({:controller => '/content', :action => 'show_page', :title => 'new stuff'}, - x.new.send(:page_url, :title => 'new stuff')) - end - - def test_named_route_with_default - rs.page 'page/:title', :controller => 'content', :action => 'show_page', :title => 'AboutPage' - x = setup_for_named_route - assert_equal({:controller => '/content', :action => 'show_page', :title => 'AboutPage'}, - x.new.send(:page_url)) - assert_equal({:controller => '/content', :action => 'show_page', :title => 'AboutRails'}, - x.new.send(:page_url, :title => "AboutRails")) - - end - - def setup_for_named_route - x = Class.new - x.send(:define_method, :url_for) {|x| x} - x.send :include, ::ActionController::Routing::NamedRoutes - x - end - - def test_named_route_without_hash - rs.draw do |map| - rs.normal ':controller/:action/:id' - end - end - - def test_named_route_with_regexps - rs.draw do |map| - rs.article 'page/:year/:month/:day/:title', :controller => 'page', :action => 'show', - :year => /^\d+$/, :month => /^\d+$/, :day => /^\d+$/ - rs.connect ':controller/:action/:id' - end - x = setup_for_named_route - assert_equal( - {:controller => '/page', :action => 'show', :title => 'hi'}, - x.new.send(:article_url, :title => 'hi') - ) - assert_equal( - {:controller => '/page', :action => 'show', :title => 'hi', :day => 10, :year => 2005, :month => 6}, - x.new.send(:article_url, :title => 'hi', :day => 10, :year => 2005, :month => 6) - ) - end - - def test_changing_controller - assert_equal ['/admin/stuff/show/10', []], rs.generate( - {:controller => 'stuff', :action => 'show', :id => 10}, - {:controller => 'admin/user', :action => 'index'} - ) - end - - def test_paths_escaped - rs.draw do |map| - rs.path 'file/*path', :controller => 'content', :action => 'show_file' - rs.connect ':controller/:action/:id' - end - results = rs.recognize_path %w(file hello+world how+are+you%3F) - assert results, "Recognition should have succeeded" - assert_equal ['hello world', 'how are you?'], results['path'] - - results = rs.recognize_path %w(file) - assert results, "Recognition should have succeeded" - assert_equal [], results['path'] - end - - def test_non_controllers_cannot_be_matched - rs.draw do - rs.connect ':controller/:action/:id' - end - assert_nil rs.recognize_path(%w(not_a show 10)), "Shouldn't recognize non-controllers as controllers!" - end - - def test_paths_do_not_accept_defaults - assert_raises(ActionController::RoutingError) do - rs.draw do |map| - rs.path 'file/*path', :controller => 'content', :action => 'show_file', :path => %w(fake default) - rs.connect ':controller/:action/:id' - end - end - - rs.draw do |map| - rs.path 'file/*path', :controller => 'content', :action => 'show_file', :path => [] - rs.connect ':controller/:action/:id' - end - end - - def test_backwards - rs.draw do |map| - rs.connect 'page/:id/:action', :controller => 'pages', :action => 'show' - rs.connect ':controller/:action/:id' - end - - assert_equal ['/page/20', []], rs.generate({:id => 20}, {:controller => 'pages'}) - assert_equal ['/page/20', []], rs.generate(:controller => 'pages', :id => 20, :action => 'show') - assert_equal ['/pages/boo', []], rs.generate(:controller => 'pages', :action => 'boo') - end - - def test_route_with_fixnum_default - rs.draw do |map| - rs.connect 'page/:id', :controller => 'content', :action => 'show_page', :id => 1 - rs.connect ':controller/:action/:id' - end - - assert_equal ['/page', []], rs.generate(:controller => 'content', :action => 'show_page') - assert_equal ['/page', []], rs.generate(:controller => 'content', :action => 'show_page', :id => 1) - assert_equal ['/page', []], rs.generate(:controller => 'content', :action => 'show_page', :id => '1') - assert_equal ['/page/10', []], rs.generate(:controller => 'content', :action => 'show_page', :id => 10) - - ctrl = ::ContentController - - assert_equal({'controller' => ctrl, 'action' => 'show_page', 'id' => 1}, rs.recognize_path(%w(page))) - assert_equal({'controller' => ctrl, 'action' => 'show_page', 'id' => '1'}, rs.recognize_path(%w(page 1))) - assert_equal({'controller' => ctrl, 'action' => 'show_page', 'id' => '10'}, rs.recognize_path(%w(page 10))) - end - - def test_action_expiry - assert_equal ['/content', []], rs.generate({:controller => 'content'}, {:controller => 'content', :action => 'show'}) - end - - def test_recognition_with_uppercase_controller_name - assert_equal({'controller' => ::ContentController, 'action' => 'index'}, rs.recognize_path(%w(Content))) - assert_equal({'controller' => ::ContentController, 'action' => 'list'}, rs.recognize_path(%w(Content list))) - assert_equal({'controller' => ::ContentController, 'action' => 'show', 'id' => '10'}, rs.recognize_path(%w(Content show 10))) - - assert_equal({'controller' => ::Admin::NewsFeedController, 'action' => 'index'}, rs.recognize_path(%w(Admin NewsFeed))) - assert_equal({'controller' => ::Admin::NewsFeedController, 'action' => 'index'}, rs.recognize_path(%w(Admin News_Feed))) - end - - def test_both_requirement_and_optional - rs.draw do - rs.blog('test/:year', :controller => 'post', :action => 'show', - :defaults => { :year => nil }, - :requirements => { :year => /\d{4}/ } - ) - rs.connect ':controller/:action/:id' - end - - assert_equal ['/test', []], rs.generate(:controller => 'post', :action => 'show') - assert_equal ['/test', []], rs.generate(:controller => 'post', :action => 'show', :year => nil) - - x = setup_for_named_route - assert_equal({:controller => '/post', :action => 'show'}, - x.new.send(:blog_url)) - end - - def test_set_to_nil_forgets - rs.draw do - rs.connect 'pages/:year/:month/:day', :controller => 'content', :action => 'list_pages', :month => nil, :day => nil - rs.connect ':controller/:action/:id' - end - - assert_equal ['/pages/2005', []], - rs.generate(:controller => 'content', :action => 'list_pages', :year => 2005) - assert_equal ['/pages/2005/6', []], - rs.generate(:controller => 'content', :action => 'list_pages', :year => 2005, :month => 6) - assert_equal ['/pages/2005/6/12', []], - rs.generate(:controller => 'content', :action => 'list_pages', :year => 2005, :month => 6, :day => 12) - - assert_equal ['/pages/2005/6/4', []], - rs.generate({:day => 4}, {:controller => 'content', :action => 'list_pages', :year => '2005', :month => '6', :day => '12'}) - - assert_equal ['/pages/2005/6', []], - rs.generate({:day => nil}, {:controller => 'content', :action => 'list_pages', :year => '2005', :month => '6', :day => '12'}) - - assert_equal ['/pages/2005', []], - rs.generate({:day => nil, :month => nil}, {:controller => 'content', :action => 'list_pages', :year => '2005', :month => '6', :day => '12'}) - end - - def test_url_with_no_action_specified - rs.draw do - rs.connect '', :controller => 'content' - rs.connect ':controller/:action/:id' - end - - assert_equal ['/', []], rs.generate(:controller => 'content', :action => 'index') - assert_equal ['/', []], rs.generate(:controller => 'content') - end - - def test_named_url_with_no_action_specified - rs.draw do - rs.root '', :controller => 'content' - rs.connect ':controller/:action/:id' - end - - assert_equal ['/', []], rs.generate(:controller => 'content', :action => 'index') - assert_equal ['/', []], rs.generate(:controller => 'content') - - x = setup_for_named_route - assert_equal({:controller => '/content', :action => 'index'}, - x.new.send(:root_url)) - end - - def test_url_generated_when_forgetting_action - [{:controller => 'content', :action => 'index'}, {:controller => 'content'}].each do |hash| - rs.draw do - rs.root '', hash - rs.connect ':controller/:action/:id' - end - assert_equal ['/', []], rs.generate({:action => nil}, {:controller => 'content', :action => 'hello'}) - assert_equal ['/', []], rs.generate({:controller => 'content'}) - assert_equal ['/content/hi', []], rs.generate({:controller => 'content', :action => 'hi'}) - end - end - - def test_named_route_method - rs.draw do - assert_raises(ArgumentError) { rs.categories 'categories', :controller => 'content', :action => 'categories' } - - rs.named_route :categories, 'categories', :controller => 'content', :action => 'categories' - rs.connect ':controller/:action/:id' - end - - assert_equal ['/categories', []], rs.generate(:controller => 'content', :action => 'categories') - assert_equal ['/content/hi', []], rs.generate({:controller => 'content', :action => 'hi'}) - end - - def test_named_route_helper_array - test_named_route_method - assert_equal [:categories_url, :hash_for_categories_url], ::ActionController::Routing::NamedRoutes::Helpers - end - - def test_nil_defaults - rs.draw do - rs.connect 'journal', - :controller => 'content', - :action => 'list_journal', - :date => nil, :user_id => nil - rs.connect ':controller/:action/:id' - end - - assert_equal ['/journal', []], rs.generate(:controller => 'content', :action => 'list_journal', :date => nil, :user_id => nil) - end -end - -class ControllerComponentTest < Test::Unit::TestCase - - def test_traverse_to_controller_should_not_load_arbitrary_files - load_path = $:.dup - base = File.dirname(File.dirname(File.expand_path(__FILE__))) - $: << File.join(base, 'fixtures') - Object.send :const_set, :RAILS_ROOT, File.join(base, 'fixtures/application_root') - assert_equal nil, ActionController::Routing::ControllerComponent.traverse_to_controller(%w(dont_load pretty please)) - ensure - $:[0..-1] = load_path - Object.send :remove_const, :RAILS_ROOT - end - - def test_traverse_should_not_trip_on_non_module_constants - assert_equal nil, ActionController::Routing::ControllerComponent.traverse_to_controller(%w(admin some_constant a)) - end - - # This is evil, but people do it. - def test_traverse_to_controller_should_pass_thru_classes - load_path = $:.dup - base = File.dirname(File.dirname(File.expand_path(__FILE__))) - $: << File.join(base, 'fixtures') - $: << File.join(base, 'fixtures/application_root/app/controllers') - $: << File.join(base, 'fixtures/application_root/app/models') - Object.send :const_set, :RAILS_ROOT, File.join(base, 'fixtures/application_root') - pair = ActionController::Routing::ControllerComponent.traverse_to_controller(%w(a_class_that_contains_a_controller poorly_placed)) - - # Make sure the container class was loaded properly - assert defined?(AClassThatContainsAController) - assert_kind_of Class, AClassThatContainsAController - assert_equal :you_know_it, AClassThatContainsAController.is_special? - - # Make sure the controller was too - assert_kind_of Array, pair - assert_equal 2, pair[1] - klass = pair.first - assert_kind_of Class, klass - assert_equal :decidedly_so, klass.is_evil? - assert klass.ancestors.include?(ActionController::Base) - assert defined?(AClassThatContainsAController::PoorlyPlacedController) - assert_equal klass, AClassThatContainsAController::PoorlyPlacedController - ensure - $:[0..-1] = load_path - Object.send :remove_const, :RAILS_ROOT - end - - def test_traverse_to_nested_controller - load_path = $:.dup - base = File.dirname(File.dirname(File.expand_path(__FILE__))) - $: << File.join(base, 'fixtures') - $: << File.join(base, 'fixtures/application_root/app/controllers') - Object.send :const_set, :RAILS_ROOT, File.join(base, 'fixtures/application_root') - pair = ActionController::Routing::ControllerComponent.traverse_to_controller(%w(module_that_holds_controllers nested)) - - assert_not_equal nil, pair - - # Make sure that we created a module for the dir - assert defined?(ModuleThatHoldsControllers) - assert_kind_of Module, ModuleThatHoldsControllers - - # Make sure the controller is ok - assert_kind_of Array, pair - assert_equal 2, pair[1] - klass = pair.first - assert_kind_of Class, klass - assert klass.ancestors.include?(ActionController::Base) - assert defined?(ModuleThatHoldsControllers::NestedController) - assert_equal klass, ModuleThatHoldsControllers::NestedController - ensure - $:[0..-1] = load_path - Object.send :remove_const, :RAILS_ROOT - end - -end - -end -require File.join(File.dirname(__FILE__), '..', 'abstract_unit') - - -module TestFileUtils - def file_name() File.basename(__FILE__) end - def file_path() File.expand_path(__FILE__) end - def file_data() File.open(file_path, 'rb') { |f| f.read } end -end - - -class SendFileController < ActionController::Base - include TestFileUtils - layout "layouts/standard" # to make sure layouts don't interfere - - attr_writer :options - def options() @options ||= {} end - - def file() send_file(file_path, options) end - def data() send_data(file_data, options) end - - def rescue_action(e) raise end -end - -SendFileController.template_root = File.dirname(__FILE__) + "/../fixtures/" - -class SendFileTest < Test::Unit::TestCase - include TestFileUtils - - def setup - @controller = SendFileController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_file_nostream - @controller.options = { :stream => false } - response = nil - assert_nothing_raised { response = process('file') } - assert_not_nil response - assert_kind_of String, response.body - assert_equal file_data, response.body - end - - def test_file_stream - response = nil - assert_nothing_raised { response = process('file') } - assert_not_nil response - assert_kind_of Proc, response.body - - require 'stringio' - output = StringIO.new - output.binmode - assert_nothing_raised { response.body.call(response, output) } - assert_equal file_data, output.string - end - - def test_data - response = nil - assert_nothing_raised { response = process('data') } - assert_not_nil response - - assert_kind_of String, response.body - assert_equal file_data, response.body - end - - # Test that send_file_headers! is setting the correct HTTP headers. - def test_send_file_headers! - options = { - :length => 1, - :type => 'type', - :disposition => 'disposition', - :filename => 'filename' - } - - # Do it a few times: the resulting headers should be identical - # no matter how many times you send with the same options. - # Test resolving Ticket #458. - @controller.headers = {} - @controller.send(:send_file_headers!, options) - @controller.send(:send_file_headers!, options) - @controller.send(:send_file_headers!, options) - - h = @controller.headers - assert_equal 1, h['Content-Length'] - assert_equal 'type', h['Content-Type'] - assert_equal 'disposition; filename="filename"', h['Content-Disposition'] - assert_equal 'binary', h['Content-Transfer-Encoding'] - - # test overriding Cache-Control: no-cache header to fix IE open/save dialog - @controller.headers = { 'Cache-Control' => 'no-cache' } - @controller.send(:send_file_headers!, options) - h = @controller.headers - assert_equal 'private', h['Cache-Control'] - end - - %w(file data).each do |method| - define_method "test_send_#{method}_status" do - @controller.options = { :stream => false, :status => 500 } - assert_nothing_raised { assert_not_nil process(method) } - assert_equal '500', @controller.headers['Status'] - end - - define_method "test_default_send_#{method}_status" do - @controller.options = { :stream => false } - assert_nothing_raised { assert_not_nil process(method) } - assert_equal ActionController::Base::DEFAULT_RENDER_STATUS_CODE, @controller.headers['Status'] - end - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class SessionManagementTest < Test::Unit::TestCase - class SessionOffController < ActionController::Base - session :off - - def show - render_text "done" - end - - def tell - render_text "done" - end - end - - class TestController < ActionController::Base - session :off, :only => :show - session :session_secure => true, :except => :show - session :off, :only => :conditional, - :if => Proc.new { |r| r.parameters[:ws] } - - def show - render_text "done" - end - - def tell - render_text "done" - end - - def conditional - render_text ">>>#{params[:ws]}<<<" - end - end - - class SpecializedController < SessionOffController - session :disabled => false, :only => :something - - def something - render_text "done" - end - - def another - render_text "done" - end - end - - def setup - @request, @response = ActionController::TestRequest.new, - ActionController::TestResponse.new - end - - def test_session_off_globally - @controller = SessionOffController.new - get :show - assert_equal false, @request.session_options - get :tell - assert_equal false, @request.session_options - end - - def test_session_off_conditionally - @controller = TestController.new - get :show - assert_equal false, @request.session_options - get :tell - assert_instance_of Hash, @request.session_options - assert @request.session_options[:session_secure] - end - - def test_controller_specialization_overrides_settings - @controller = SpecializedController.new - get :something - assert_instance_of Hash, @request.session_options - get :another - assert_equal false, @request.session_options - end - - def test_session_off_with_if - @controller = TestController.new - get :conditional - assert_instance_of Hash, @request.session_options - get :conditional, :ws => "ws" - assert_equal false, @request.session_options - end - - def test_session_store_setting - ActionController::Base.session_store = :drb_store - assert_equal CGI::Session::DRbStore, ActionController::Base.session_store - - if Object.const_defined?(:ActiveRecord) - ActionController::Base.session_store = :active_record_store - assert_equal CGI::Session::ActiveRecordStore, ActionController::Base.session_store - end - end -end -require File.dirname(__FILE__) + '/../abstract_unit' -require File.dirname(__FILE__) + '/fake_controllers' - -class TestTest < Test::Unit::TestCase - class TestController < ActionController::Base - def set_flash - flash["test"] = ">#{flash["test"]}<" - render :text => 'ignore me' - end - - def render_raw_post - raise Test::Unit::AssertionFailedError, "#raw_post is blank" if request.raw_post.blank? - render :text => request.raw_post - end - - def test_params - render :text => params.inspect - end - - def test_uri - render :text => request.request_uri - end - - def test_html_output - render :text => < - - -
      -
        -
      • hello
      • -
      • goodbye
      • -
      -
      -
      -
      - Name: -
      -
      - - -HTML - end - - def test_only_one_param - render :text => (params[:left] && params[:right]) ? "EEP, Both here!" : "OK" - end - - def test_remote_addr - render :text => (request.remote_addr || "not specified") - end - - def test_file_upload - render :text => params[:file].size - end - - def redirect_to_symbol - redirect_to :generate_url, :id => 5 - end - - private - - def rescue_action(e) - raise e - end - - def generate_url(opts) - url_for(opts.merge(:action => "test_uri")) - end - end - - def setup - @controller = TestController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - ActionController::Routing::Routes.reload - end - - def teardown - ActionController::Routing::Routes.reload - end - - def test_raw_post_handling - params = {:page => {:name => 'page name'}, 'some key' => 123} - get :render_raw_post, params.dup - - raw_post = params.map {|k,v| [CGI::escape(k.to_s), CGI::escape(v.to_s)].join('=')}.sort.join('&') - assert_equal raw_post, @response.body - end - - def test_process_without_flash - process :set_flash - assert_equal '><', flash['test'] - end - - def test_process_with_flash - process :set_flash, nil, nil, { "test" => "value" } - assert_equal '>value<', flash['test'] - end - - def test_process_with_request_uri_with_no_params - process :test_uri - assert_equal "/test_test/test/test_uri", @response.body - end - - def test_process_with_request_uri_with_params - process :test_uri, :id => 7 - assert_equal "/test_test/test/test_uri/7", @response.body - end - - def test_process_with_request_uri_with_params_with_explicit_uri - @request.set_REQUEST_URI "/explicit/uri" - process :test_uri, :id => 7 - assert_equal "/explicit/uri", @response.body - end - - def test_multiple_calls - process :test_only_one_param, :left => true - assert_equal "OK", @response.body - process :test_only_one_param, :right => true - assert_equal "OK", @response.body - end - - def test_assert_tag_tag - process :test_html_output - - # there is a 'form' tag - assert_tag :tag => 'form' - # there is not an 'hr' tag - assert_no_tag :tag => 'hr' - end - - def test_assert_tag_attributes - process :test_html_output - - # there is a tag with an 'id' of 'bar' - assert_tag :attributes => { :id => "bar" } - # there is no tag with a 'name' of 'baz' - assert_no_tag :attributes => { :name => "baz" } - end - - def test_assert_tag_parent - process :test_html_output - - # there is a tag with a parent 'form' tag - assert_tag :parent => { :tag => "form" } - # there is no tag with a parent of 'input' - assert_no_tag :parent => { :tag => "input" } - end - - def test_assert_tag_child - process :test_html_output - - # there is a tag with a child 'input' tag - assert_tag :child => { :tag => "input" } - # there is no tag with a child 'strong' tag - assert_no_tag :child => { :tag => "strong" } - end - - def test_assert_tag_ancestor - process :test_html_output - - # there is a 'li' tag with an ancestor having an id of 'foo' - assert_tag :ancestor => { :attributes => { :id => "foo" } }, :tag => "li" - # there is no tag of any kind with an ancestor having an href matching 'foo' - assert_no_tag :ancestor => { :attributes => { :href => /foo/ } } - end - - def test_assert_tag_descendant - process :test_html_output - - # there is a tag with a decendant 'li' tag - assert_tag :descendant => { :tag => "li" } - # there is no tag with a descendant 'html' tag - assert_no_tag :descendant => { :tag => "html" } - end - - def test_assert_tag_sibling - process :test_html_output - - # there is a tag with a sibling of class 'item' - assert_tag :sibling => { :attributes => { :class => "item" } } - # there is no tag with a sibling 'ul' tag - assert_no_tag :sibling => { :tag => "ul" } - end - - def test_assert_tag_after - process :test_html_output - - # there is a tag following a sibling 'div' tag - assert_tag :after => { :tag => "div" } - # there is no tag following a sibling tag with id 'bar' - assert_no_tag :after => { :attributes => { :id => "bar" } } - end - - def test_assert_tag_before - process :test_html_output - - # there is a tag preceeding a tag with id 'bar' - assert_tag :before => { :attributes => { :id => "bar" } } - # there is no tag preceeding a 'form' tag - assert_no_tag :before => { :tag => "form" } - end - - def test_assert_tag_children_count - process :test_html_output - - # there is a tag with 2 children - assert_tag :children => { :count => 2 } - # there is no tag with 4 children - assert_no_tag :children => { :count => 4 } - end - - def test_assert_tag_children_less_than - process :test_html_output - - # there is a tag with less than 5 children - assert_tag :children => { :less_than => 5 } - # there is no 'ul' tag with less than 2 children - assert_no_tag :children => { :less_than => 2 }, :tag => "ul" - end - - def test_assert_tag_children_greater_than - process :test_html_output - - # there is a 'body' tag with more than 1 children - assert_tag :children => { :greater_than => 1 }, :tag => "body" - # there is no tag with more than 10 children - assert_no_tag :children => { :greater_than => 10 } - end - - def test_assert_tag_children_only - process :test_html_output - - # there is a tag containing only one child with an id of 'foo' - assert_tag :children => { :count => 1, - :only => { :attributes => { :id => "foo" } } } - # there is no tag containing only one 'li' child - assert_no_tag :children => { :count => 1, :only => { :tag => "li" } } - end - - def test_assert_tag_content - process :test_html_output - - # the output contains the string "Name" - assert_tag :content => "Name" - # the output does not contain the string "test" - assert_no_tag :content => "test" - end - - def test_assert_tag_multiple - process :test_html_output - - # there is a 'div', id='bar', with an immediate child whose 'action' - # attribute matches the regexp /somewhere/. - assert_tag :tag => "div", :attributes => { :id => "bar" }, - :child => { :attributes => { :action => /somewhere/ } } - - # there is no 'div', id='foo', with a 'ul' child with more than - # 2 "li" children. - assert_no_tag :tag => "div", :attributes => { :id => "foo" }, - :child => { - :tag => "ul", - :children => { :greater_than => 2, - :only => { :tag => "li" } } } - end - - def test_assert_tag_children_without_content - process :test_html_output - - # there is a form tag with an 'input' child which is a self closing tag - assert_tag :tag => "form", - :children => { :count => 1, - :only => { :tag => "input" } } - - # the body tag has an 'a' child which in turn has an 'img' child - assert_tag :tag => "body", - :children => { :count => 1, - :only => { :tag => "a", - :children => { :count => 1, - :only => { :tag => "img" } } } } - end - - def test_assert_generates - assert_generates 'controller/action/5', :controller => 'controller', :action => 'action', :id => '5' - end - - def test_assert_routing - assert_routing 'content', :controller => 'content', :action => 'index' - end - - def test_assert_routing_in_module - assert_routing 'admin/user', :controller => 'admin/user', :action => 'index' - end - - def test_params_passing - get :test_params, :page => {:name => "Page name", :month => '4', :year => '2004', :day => '6'} - parsed_params = eval(@response.body) - assert_equal( - {'controller' => 'test_test/test', 'action' => 'test_params', - 'page' => {'name' => "Page name", 'month' => '4', 'year' => '2004', 'day' => '6'}}, - parsed_params - ) - end - - def test_id_converted_to_string - get :test_params, :id => 20, :foo => Object.new - assert_kind_of String, @request.path_parameters['id'] - end - - def test_array_path_parameter_handled_properly - with_routing do |set| - set.draw do - set.connect 'file/*path', :controller => 'test_test/test', :action => 'test_params' - set.connect ':controller/:action/:id' - end - - get :test_params, :path => ['hello', 'world'] - assert_equal ['hello', 'world'], @request.path_parameters['path'] - assert_equal 'hello/world', @request.path_parameters['path'].to_s - end - end - - def test_assert_realistic_path_parameters - get :test_params, :id => 20, :foo => Object.new - - # All elements of path_parameters should use string keys - @request.path_parameters.keys.each do |key| - assert_kind_of String, key - end - end - - def test_with_routing_places_routes_back - assert ActionController::Routing::Routes - routes_id = ActionController::Routing::Routes.object_id - - begin - with_routing { raise 'fail' } - fail 'Should not be here.' - rescue RuntimeError - end - - assert ActionController::Routing::Routes - assert_equal routes_id, ActionController::Routing::Routes.object_id - end - - def test_remote_addr - get :test_remote_addr - assert_equal "0.0.0.0", @response.body - - @request.remote_addr = "192.0.0.1" - get :test_remote_addr - assert_equal "192.0.0.1", @response.body - end - - def test_header_properly_reset_after_remote_http_request - xhr :get, :test_params - assert_nil @request.env['HTTP_X_REQUESTED_WITH'] - end - - def test_header_properly_reset_after_get_request - get :test_params - @request.recycle! - assert_nil @request.instance_variable_get("@request_method") - end - - %w(controller response request).each do |variable| - %w(get post put delete head process).each do |method| - define_method("test_#{variable}_missing_for_#{method}_raises_error") do - remove_instance_variable "@#{variable}" - begin - send(method, :test_remote_addr) - assert false, "expected RuntimeError, got nothing" - rescue RuntimeError => error - assert true - assert_match %r{@#{variable} is nil}, error.message - rescue => error - assert false, "expected RuntimeError, got #{error.class}" - end - end - end - end - - FILES_DIR = File.dirname(__FILE__) + '/../fixtures/multipart' - - def test_test_uploaded_file - filename = 'mona_lisa.jpg' - path = "#{FILES_DIR}/#{filename}" - content_type = 'image/png' - - file = ActionController::TestUploadedFile.new(path, content_type) - assert_equal filename, file.original_filename - assert_equal content_type, file.content_type - assert_equal file.path, file.local_path - assert_equal File.read(path), file.read - end - - def test_fixture_file_upload - post :test_file_upload, :file => fixture_file_upload(FILES_DIR + "/mona_lisa.jpg", "image/jpg") - assert_equal 159528, @response.body - end - - def test_test_uploaded_file_exception_when_file_doesnt_exist - assert_raise(RuntimeError) { ActionController::TestUploadedFile.new('non_existent_file') } - end - - def test_assert_redirected_to_symbol - get :redirect_to_symbol - assert_redirected_to :generate_url - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class UrlRewriterTests < Test::Unit::TestCase - def setup - @request = ActionController::TestRequest.new - @params = {} - @rewriter = ActionController::UrlRewriter.new(@request, @params) - end - - def test_simple_build_query_string - assert_query_equal '?x=1&y=2', @rewriter.send(:build_query_string, :x => '1', :y => '2') - end - def test_convert_ints_build_query_string - assert_query_equal '?x=1&y=2', @rewriter.send(:build_query_string, :x => 1, :y => 2) - end - def test_escape_spaces_build_query_string - assert_query_equal '?x=hello+world&y=goodbye+world', @rewriter.send(:build_query_string, :x => 'hello world', :y => 'goodbye world') - end - def test_expand_array_build_query_string - assert_query_equal '?x[]=1&x[]=2', @rewriter.send(:build_query_string, :x => [1, 2]) - end - - def test_escape_spaces_build_query_string_selected_keys - assert_query_equal '?x=hello+world', @rewriter.send(:build_query_string, {:x => 'hello world', :y => 'goodbye world'}, [:x]) - end - - def test_overwrite_params - @params[:controller] = 'hi' - @params[:action] = 'bye' - @params[:id] = '2' - - assert_equal '/hi/hi/2', @rewriter.rewrite(:only_path => true, :overwrite_params => {:action => 'hi'}) - u = @rewriter.rewrite(:only_path => false, :overwrite_params => {:action => 'hi'}) - assert_match %r(/hi/hi/2$), u - end - - - private - def split_query_string(str) - [str[0].chr] + str[1..-1].split(/&/).sort - end - - def assert_query_equal(q1, q2) - assert_equal(split_query_string(q1), split_query_string(q2)) - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class VerificationTest < Test::Unit::TestCase - class TestController < ActionController::Base - verify :only => :guarded_one, :params => "one", - :redirect_to => { :action => "unguarded" } - - verify :only => :guarded_two, :params => %w( one two ), - :redirect_to => { :action => "unguarded" } - - verify :only => :guarded_with_flash, :params => "one", - :add_flash => { "notice" => "prereqs failed" }, - :redirect_to => { :action => "unguarded" } - - verify :only => :guarded_in_session, :session => "one", - :redirect_to => { :action => "unguarded" } - - verify :only => [:multi_one, :multi_two], :session => %w( one two ), - :redirect_to => { :action => "unguarded" } - - verify :only => :guarded_by_method, :method => :post, - :redirect_to => { :action => "unguarded" } - - verify :only => :guarded_by_xhr, :xhr => true, - :redirect_to => { :action => "unguarded" } - - verify :only => :guarded_by_not_xhr, :xhr => false, - :redirect_to => { :action => "unguarded" } - - before_filter :unconditional_redirect, :only => :two_redirects - verify :only => :two_redirects, :method => :post, - :redirect_to => { :action => "unguarded" } - - verify :only => :must_be_post, :method => :post, :render => { :status => 500, :text => "Must be post"} - - def guarded_one - render :text => "#{@params["one"]}" - end - - def guarded_with_flash - render :text => "#{@params["one"]}" - end - - def guarded_two - render :text => "#{@params["one"]}:#{@params["two"]}" - end - - def guarded_in_session - render :text => "#{@session["one"]}" - end - - def multi_one - render :text => "#{@session["one"]}:#{@session["two"]}" - end - - def multi_two - render :text => "#{@session["two"]}:#{@session["one"]}" - end - - def guarded_by_method - render :text => "#{@request.method}" - end - - def guarded_by_xhr - render :text => "#{@request.xhr?}" - end - - def guarded_by_not_xhr - render :text => "#{@request.xhr?}" - end - - def unguarded - render :text => "#{@params["one"]}" - end - - def two_redirects - render :nothing => true - end - - def must_be_post - render :text => "Was a post!" - end - - protected - def rescue_action(e) raise end - - def unconditional_redirect - redirect_to :action => "unguarded" - end - end - - def setup - @controller = TestController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_guarded_one_with_prereqs - get :guarded_one, :one => "here" - assert_equal "here", @response.body - end - - def test_guarded_one_without_prereqs - get :guarded_one - assert_redirected_to :action => "unguarded" - end - - def test_guarded_with_flash_with_prereqs - get :guarded_with_flash, :one => "here" - assert_equal "here", @response.body - assert_flash_empty - end - - def test_guarded_with_flash_without_prereqs - get :guarded_with_flash - assert_redirected_to :action => "unguarded" - assert_flash_equal "prereqs failed", "notice" - end - - def test_guarded_two_with_prereqs - get :guarded_two, :one => "here", :two => "there" - assert_equal "here:there", @response.body - end - - def test_guarded_two_without_prereqs_one - get :guarded_two, :two => "there" - assert_redirected_to :action => "unguarded" - end - - def test_guarded_two_without_prereqs_two - get :guarded_two, :one => "here" - assert_redirected_to :action => "unguarded" - end - - def test_guarded_two_without_prereqs_both - get :guarded_two - assert_redirected_to :action => "unguarded" - end - - def test_unguarded_with_params - get :unguarded, :one => "here" - assert_equal "here", @response.body - end - - def test_unguarded_without_params - get :unguarded - assert_equal "", @response.body - end - - def test_guarded_in_session_with_prereqs - get :guarded_in_session, {}, "one" => "here" - assert_equal "here", @response.body - end - - def test_guarded_in_session_without_prereqs - get :guarded_in_session - assert_redirected_to :action => "unguarded" - end - - def test_multi_one_with_prereqs - get :multi_one, {}, "one" => "here", "two" => "there" - assert_equal "here:there", @response.body - end - - def test_multi_one_without_prereqs - get :multi_one - assert_redirected_to :action => "unguarded" - end - - def test_multi_two_with_prereqs - get :multi_two, {}, "one" => "here", "two" => "there" - assert_equal "there:here", @response.body - end - - def test_multi_two_without_prereqs - get :multi_two - assert_redirected_to :action => "unguarded" - end - - def test_guarded_by_method_with_prereqs - post :guarded_by_method - assert_equal "post", @response.body - end - - def test_guarded_by_method_without_prereqs - get :guarded_by_method - assert_redirected_to :action => "unguarded" - end - - def test_guarded_by_xhr_with_prereqs - xhr :post, :guarded_by_xhr - assert_equal "true", @response.body - end - - def test_guarded_by_xhr_without_prereqs - get :guarded_by_xhr - assert_redirected_to :action => "unguarded" - end - - def test_guarded_by_not_xhr_with_prereqs - get :guarded_by_not_xhr - assert_equal "false", @response.body - end - - def test_guarded_by_not_xhr_without_prereqs - xhr :post, :guarded_by_not_xhr - assert_redirected_to :action => "unguarded" - end - - def test_guarded_post_and_calls_render_succeeds - post :must_be_post - assert_equal "Was a post!", @response.body - end - - def test_guarded_post_and_calls_render_fails - get :must_be_post - assert_response 500 - assert_equal "Must be post", @response.body - end - - - def test_second_redirect - assert_nothing_raised { get :two_redirects } - end -end -require File.dirname(__FILE__) + '/../abstract_unit' -require 'stringio' - -class WebServiceTest < Test::Unit::TestCase - - class MockCGI < CGI #:nodoc: - attr_accessor :stdinput, :stdoutput, :env_table - - def initialize(env, data = '') - self.env_table = env - self.stdinput = StringIO.new(data) - self.stdoutput = StringIO.new - super() - end - end - - - class TestController < ActionController::Base - session :off - - def assign_parameters - if params[:full] - render :text => dump_params_keys - else - render :text => (params.keys - ['controller', 'action']).sort.join(", ") - end - end - - def dump_params_keys(hash=params) - hash.keys.sort.inject("") do |s, k| - value = hash[k] - value = Hash === value ? "(#{dump_params_keys(value)})" : "" - s << ", " unless s.empty? - s << "#{k}#{value}" - end - end - - def rescue_action(e) raise end - end - - def setup - @controller = TestController.new - ActionController::Base.param_parsers.clear - ActionController::Base.param_parsers[Mime::XML] = :xml_node - end - - def test_check_parameters - process('GET') - assert_equal '', @controller.response.body - end - - def test_post_xml - process('POST', 'application/xml', 'content...') - - assert_equal 'entry', @controller.response.body - assert @controller.params.has_key?(:entry) - assert_equal 'content...', @controller.params["entry"].summary.node_value - assert_equal 'true', @controller.params["entry"]['attributed'] - end - - def test_put_xml - process('PUT', 'application/xml', 'content...') - - assert_equal 'entry', @controller.response.body - assert @controller.params.has_key?(:entry) - assert_equal 'content...', @controller.params["entry"].summary.node_value - assert_equal 'true', @controller.params["entry"]['attributed'] - end - - def test_register_and_use_yaml - ActionController::Base.param_parsers[Mime::YAML] = Proc.new { |d| YAML.load(d) } - process('POST', 'application/x-yaml', {"entry" => "loaded from yaml"}.to_yaml) - assert_equal 'entry', @controller.response.body - assert @controller.params.has_key?(:entry) - assert_equal 'loaded from yaml', @controller.params["entry"] - end - - def test_register_and_use_yaml_as_symbol - ActionController::Base.param_parsers[Mime::YAML] = :yaml - process('POST', 'application/x-yaml', {"entry" => "loaded from yaml"}.to_yaml) - assert_equal 'entry', @controller.response.body - assert @controller.params.has_key?(:entry) - assert_equal 'loaded from yaml', @controller.params["entry"] - end - - def test_register_and_use_xml_simple - ActionController::Base.param_parsers[Mime::XML] = Proc.new { |data| XmlSimple.xml_in(data, 'ForceArray' => false) } - process('POST', 'application/xml', 'content...SimpleXml' ) - assert_equal 'summary, title', @controller.response.body - assert @controller.params.has_key?(:summary) - assert @controller.params.has_key?(:title) - assert_equal 'content...', @controller.params["summary"] - assert_equal 'SimpleXml', @controller.params["title"] - end - - def test_use_xml_ximple_with_empty_request - ActionController::Base.param_parsers[Mime::XML] = :xml_simple - assert_nothing_raised { process('POST', 'application/xml', "") } - assert_equal "", @controller.response.body - end - - def test_deprecated_request_methods - process('POST', 'application/x-yaml') - assert_equal Mime::YAML, @controller.request.content_type - assert_equal true, @controller.request.post? - assert_equal :yaml, @controller.request.post_format - assert_equal true, @controller.request.yaml_post? - assert_equal false, @controller.request.xml_post? - end - - def test_dasherized_keys_as_xml - ActionController::Base.param_parsers[Mime::XML] = :xml_simple - process('POST', 'application/xml', "\n...\n", true) - assert_equal 'action, controller, first_key(sub_key), full', @controller.response.body - assert_equal "...", @controller.params[:first_key][:sub_key] - end - - def test_typecast_as_xml - ActionController::Base.param_parsers[Mime::XML] = :xml_simple - process('POST', 'application/xml', <<-XML) - - 15 - false - true - 2005-03-17 - 2005-03-17T21:41:07Z - unparsed - 1 - hello - 1974-07-25 - - XML - params = @controller.params - assert_equal 15, params[:data][:a] - assert_equal false, params[:data][:b] - assert_equal true, params[:data][:c] - assert_equal Date.new(2005,3,17), params[:data][:d] - assert_equal Time.utc(2005,3,17,21,41,7), params[:data][:e] - assert_equal "unparsed", params[:data][:f] - assert_equal [1, "hello", Date.new(1974,7,25)], params[:data][:g] - end - - def test_entities_unescaped_as_xml_simple - ActionController::Base.param_parsers[Mime::XML] = :xml_simple - process('POST', 'application/xml', <<-XML) - <foo "bar's" & friends> - XML - assert_equal %(), @controller.params[:data] - end - - def test_dasherized_keys_as_yaml - ActionController::Base.param_parsers[Mime::YAML] = :yaml - process('POST', 'application/x-yaml', "---\nfirst-key:\n sub-key: ...\n", true) - assert_equal 'action, controller, first_key(sub_key), full', @controller.response.body - assert_equal "...", @controller.params[:first_key][:sub_key] - end - - def test_typecast_as_yaml - ActionController::Base.param_parsers[Mime::YAML] = :yaml - process('POST', 'application/x-yaml', <<-YAML) - --- - data: - a: 15 - b: false - c: true - d: 2005-03-17 - e: 2005-03-17T21:41:07Z - f: unparsed - g: - - 1 - - hello - - 1974-07-25 - YAML - params = @controller.params - assert_equal 15, params[:data][:a] - assert_equal false, params[:data][:b] - assert_equal true, params[:data][:c] - assert_equal Date.new(2005,3,17), params[:data][:d] - assert_equal Time.utc(2005,3,17,21,41,7), params[:data][:e] - assert_equal "unparsed", params[:data][:f] - assert_equal [1, "hello", Date.new(1974,7,25)], params[:data][:g] - end - - private - - def process(verb, content_type = 'application/x-www-form-urlencoded', data = '', full=false) - - cgi = MockCGI.new({ - 'REQUEST_METHOD' => verb, - 'CONTENT_TYPE' => content_type, - 'QUERY_STRING' => "action=assign_parameters&controller=webservicetest/test#{"&full=1" if full}", - "REQUEST_URI" => "/", - "HTTP_HOST" => 'testdomain.com', - "CONTENT_LENGTH" => data.size, - "SERVER_PORT" => "80", - "HTTPS" => "off"}, data) - - @controller.send(:process, ActionController::CgiRequest.new(cgi, {}), ActionController::CgiResponse.new(cgi)) - end - -end - - -class XmlNodeTest < Test::Unit::TestCase - def test_all - xn = XmlNode.from_xml(%{ - - - With O'Reilly and Adaptive Path - - - Staying at the Savoy - - - - - - - - - } - ) - assert_equal 'UTF-8', xn.node.document.encoding - assert_equal '1.0', xn.node.document.version - assert_equal 'true', xn['success'] - assert_equal 'response', xn.node_name - assert_equal 'Ajax Summit', xn.page['title'] - assert_equal '1133', xn.page['id'] - assert_equal "With O'Reilly and Adaptive Path", xn.page.description.node_value - assert_equal nil, xn.nonexistent - assert_equal "Staying at the Savoy", xn.page.notes.note.node_value.strip - assert_equal 'Technology', xn.page.tags.tag[0]['name'] - assert_equal 'Travel', xn.page.tags.tag[1][:name] - matches = xn.xpath('//@id').map{ |id| id.to_i } - assert_equal [4, 5, 1020, 1133], matches.sort - matches = xn.xpath('//tag').map{ |tag| tag['name'] } - assert_equal ['Technology', 'Travel'], matches.sort - assert_equal "Ajax Summit", xn.page['title'] - xn.page['title'] = 'Ajax Summit V2' - assert_equal "Ajax Summit V2", xn.page['title'] - assert_equal "Staying at the Savoy", xn.page.notes.note.node_value.strip - xn.page.notes.note.node_value = "Staying at the Ritz" - assert_equal "Staying at the Ritz", xn.page.notes.note.node_value.strip - assert_equal '5', xn.page.tags.tag[1][:id] - xn.page.tags.tag[1]['id'] = '7' - assert_equal '7', xn.page.tags.tag[1]['id'] - end - - - def test_small_entry - node = XmlNode.from_xml('hi') - assert_equal 'hi', node.node_value - end - -end -class AClassThatContainsAController::PoorlyPlacedController < ActionController::Base - - def self.is_evil? - :decidedly_so - end - -endclass ModuleThatHoldsControllers::NestedController < ActionController::Base - -endclass AClassThatContainsAController #often < ActiveRecord::Base - - def self.is_special? - :you_know_it - end - -endclass Company < ActiveRecord::Base - attr_protected :rating - set_sequence_name :companies_nonstd_seq - - validates_presence_of :name - def validate - errors.add('rating', 'rating should not be 2') if rating == 2 - end -endclass Developer < ActiveRecord::Base - has_and_belongs_to_many :projects -end - -class DeVeLoPeR < ActiveRecord::Base - set_table_name "developers" -end -# see routing/controller component tests - -raise Exception, "I should never be loaded"module AbcHelper - def bare_a() end - def bare_b() end - def bare_c() end -end -module Fun::GamesHelper - def stratego() "Iz guuut!" end -endmodule Fun::PDFHelper - def foobar() 'baz' end -end -class Project < ActiveRecord::Base - has_and_belongs_to_many :developers, :uniq => true -end -class Reply < ActiveRecord::Base - belongs_to :topic, :include => [:replies] - - validates_presence_of :content -end -class Topic < ActiveRecord::Base - has_many :replies, :include => [:user], :dependent => true -endrequire 'test/unit' -require File.dirname(__FILE__) + '/../../lib/action_view/helpers/date_helper' -require File.dirname(__FILE__) + '/../../lib/action_view/helpers/form_helper' -require File.dirname(__FILE__) + '/../../lib/action_view/helpers/text_helper' -require File.dirname(__FILE__) + '/../../lib/action_view/helpers/tag_helper' -require File.dirname(__FILE__) + '/../../lib/action_view/helpers/url_helper' -require File.dirname(__FILE__) + '/../../lib/action_view/helpers/form_tag_helper' -# require File.dirname(__FILE__) + '/../../lib/action_view/helpers/active_record_helper' - -class ActiveRecordHelperTest < Test::Unit::TestCase - include ActionView::Helpers::FormHelper - include ActionView::Helpers::ActiveRecordHelper - include ActionView::Helpers::TextHelper - include ActionView::Helpers::TagHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::FormTagHelper - - silence_warnings do - Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on) - Post.class_eval do - alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast) - alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast) - alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast) - end - Column = Struct.new("Column", :type, :name, :human_name) - end - - def setup - @post = Post.new - def @post.errors - Class.new { - def on(field) field == "author_name" || field == "body" end - def empty?() false end - def count() 1 end - def full_messages() [ "Author name can't be empty" ] end - }.new - end - - def @post.new_record?() true end - def @post.to_param() nil end - - def @post.column_for_attribute(attr_name) - Post.content_columns.select { |column| column.name == attr_name }.first - end - - def Post.content_columns() [ Column.new(:string, "title", "Title"), Column.new(:text, "body", "Body") ] end - - @post.title = "Hello World" - @post.author_name = "" - @post.body = "Back to the hill and over it again!" - @post.secret = 1 - @post.written_on = Date.new(2004, 6, 15) - - @controller = Object.new - def @controller.url_for(options, *parameters_for_method_reference) - options = options.symbolize_keys - - [options[:action], options[:id].to_param].compact.join('/') - end - end - - def test_generic_input_tag - assert_dom_equal( - %(), input("post", "title") - ) - end - - def test_text_area_with_errors - assert_dom_equal( - %(
      ), - text_area("post", "body") - ) - end - - def test_text_field_with_errors - assert_dom_equal( - %(
      ), - text_field("post", "author_name") - ) - end - - def test_form_with_string - assert_dom_equal( - %(


      \n


      ), - form("post") - ) - - class << @post - def new_record?() false end - def to_param() id end - def id() 1 end - end - assert_dom_equal( - %(


      \n


      ), - form("post") - ) - end - - def test_form_with_date - def Post.content_columns() [ Column.new(:date, "written_on", "Written on") ] end - - assert_dom_equal( - %(


      \n\n\n

      ), - form("post") - ) - end - - def test_form_with_datetime - def Post.content_columns() [ Column.new(:datetime, "written_on", "Written on") ] end - @post.written_on = Time.gm(2004, 6, 15, 16, 30) - - assert_dom_equal( - %(


      \n\n\n — \n : \n

      ), - form("post") - ) - end - - def test_error_for_block - assert_dom_equal %(

      1 error prohibited this post from being saved

      There were problems with the following fields:

      • Author name can't be empty
      ), error_messages_for("post") - assert_equal %(

      1 error prohibited this post from being saved

      There were problems with the following fields:

      • Author name can't be empty
      ), error_messages_for("post", :class => "errorDeathByClass", :id => "errorDeathById", :header_tag => "h1") - end - - def test_error_messages_for_handles_nil - assert_equal "", error_messages_for("notthere") - end - - def test_form_with_string_multipart - assert_dom_equal( - %(


      \n


      ), - form("post", :multipart => true) - ) - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class AssetTagHelperTest < Test::Unit::TestCase - include ActionView::Helpers::TagHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::AssetTagHelper - - def setup - @controller = Class.new do - - attr_accessor :request - - def url_for(options, *parameters_for_method_reference) - "http://www.example.com" - end - - end.new - - @request = Class.new do - def relative_url_root - "" - end - end.new - - @controller.request = @request - - ActionView::Helpers::AssetTagHelper::reset_javascript_include_default - end - - def teardown - Object.send(:remove_const, :RAILS_ROOT) if defined?(RAILS_ROOT) - ENV["RAILS_ASSET_ID"] = nil - end - - AutoDiscoveryToTag = { - %(auto_discovery_link_tag) => %(), - %(auto_discovery_link_tag(:atom)) => %(), - %(auto_discovery_link_tag(:rss, :action => "feed")) => %(), - %(auto_discovery_link_tag(:rss, "http://localhost/feed")) => %(), - %(auto_discovery_link_tag(:rss, {:action => "feed"}, {:title => "My RSS"})) => %(), - %(auto_discovery_link_tag(:rss, {}, {:title => "My RSS"})) => %(), - %(auto_discovery_link_tag(nil, {}, {:type => "text/html"})) => %(), - %(auto_discovery_link_tag(nil, {}, {:title => "No stream.. really", :type => "text/html"})) => %(), - %(auto_discovery_link_tag(:rss, {}, {:title => "My RSS", :type => "text/html"})) => %(), - %(auto_discovery_link_tag(:atom, {}, {:rel => "Not so alternate"})) => %(), - } - - JavascriptPathToTag = { - %(javascript_path("xmlhr")) => %(/javascripts/xmlhr.js), - %(javascript_path("super/xmlhr")) => %(/javascripts/super/xmlhr.js) - } - - JavascriptIncludeToTag = { - %(javascript_include_tag("xmlhr")) => %(), - %(javascript_include_tag("xmlhr", :lang => "vbscript")) => %(), - %(javascript_include_tag("common.javascript", "/elsewhere/cools")) => %(\n), - %(javascript_include_tag(:defaults)) => %(\n\n\n), - %(javascript_include_tag(:defaults, "test")) => %(\n\n\n\n), - %(javascript_include_tag("test", :defaults)) => %(\n\n\n\n) - } - - StylePathToTag = { - %(stylesheet_path("style")) => %(/stylesheets/style.css), - %(stylesheet_path('dir/file')) => %(/stylesheets/dir/file.css), - %(stylesheet_path('/dir/file')) => %(/dir/file.css) - } - - StyleLinkToTag = { - %(stylesheet_link_tag("style")) => %(), - %(stylesheet_link_tag("/dir/file")) => %(), - %(stylesheet_link_tag("dir/file")) => %(), - %(stylesheet_link_tag("style", :media => "all")) => %(), - %(stylesheet_link_tag("random.styles", "/css/stylish")) => %(\n) - } - - ImagePathToTag = { - %(image_path("xml")) => %(/images/xml.png), - } - - ImageLinkToTag = { - %(image_tag("xml")) => %(Xml), - %(image_tag("rss", :alt => "rss syndication")) => %(rss syndication), - %(image_tag("gold", :size => "45x70")) => %(Gold), - %(image_tag("symbolize", "size" => "45x70")) => %(Symbolize), - %(image_tag("http://www.rubyonrails.com/images/rails")) => %(Rails) - } - - def test_auto_discovery - AutoDiscoveryToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_javascript_path - JavascriptPathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_javascript_include - JavascriptIncludeToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_register_javascript_include_default - ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'slider' - assert_dom_equal %(\n\n\n\n), javascript_include_tag(:defaults) - ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'lib1', '/elsewhere/blub/lib2' - assert_dom_equal %(\n\n\n\n\n\n), javascript_include_tag(:defaults) - end - - def test_style_path - StylePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_style_link - StyleLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_image_path - ImagePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_image_tag - ImageLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_timebased_asset_id - Object.send(:const_set, :RAILS_ROOT, File.dirname(__FILE__) + "/../fixtures/") - expected_time = File.stat(File.expand_path(File.dirname(__FILE__) + "/../fixtures/public/images/rails.png")).mtime.to_i.to_s - assert_equal %(Rails), image_tag("rails.png") - end - - def test_skipping_asset_id_on_complete_url - Object.send(:const_set, :RAILS_ROOT, File.dirname(__FILE__) + "/../fixtures/") - assert_equal %(Rails), image_tag("http://www.example.com/rails.png") - end - - def test_preset_asset_id - Object.send(:const_set, :RAILS_ROOT, File.dirname(__FILE__) + "/../fixtures/") - ENV["RAILS_ASSET_ID"] = "4500" - assert_equal %(Rails), image_tag("rails.png") - end -end - -class AssetTagHelperNonVhostTest < Test::Unit::TestCase - include ActionView::Helpers::TagHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::AssetTagHelper - - def setup - @controller = Class.new do - - attr_accessor :request - - def url_for(options, *parameters_for_method_reference) - "http://www.example.com/calloboration/hieraki" - end - - end.new - - @request = Class.new do - def relative_url_root - "/calloboration/hieraki" - end - end.new - - @controller.request = @request - - ActionView::Helpers::AssetTagHelper::reset_javascript_include_default - end - - AutoDiscoveryToTag = { - %(auto_discovery_link_tag(:rss, :action => "feed")) => %(), - %(auto_discovery_link_tag(:atom)) => %(), - %(auto_discovery_link_tag) => %(), - } - - JavascriptPathToTag = { - %(javascript_path("xmlhr")) => %(/calloboration/hieraki/javascripts/xmlhr.js), - } - - JavascriptIncludeToTag = { - %(javascript_include_tag("xmlhr")) => %(), - %(javascript_include_tag("common.javascript", "/elsewhere/cools")) => %(\n), - %(javascript_include_tag(:defaults)) => %(\n\n\n) - } - - StylePathToTag = { - %(stylesheet_path("style")) => %(/calloboration/hieraki/stylesheets/style.css), - } - - StyleLinkToTag = { - %(stylesheet_link_tag("style")) => %(), - %(stylesheet_link_tag("random.styles", "/css/stylish")) => %(\n) - } - - ImagePathToTag = { - %(image_path("xml")) => %(/calloboration/hieraki/images/xml.png), - } - - ImageLinkToTag = { - %(image_tag("xml")) => %(Xml), - %(image_tag("rss", :alt => "rss syndication")) => %(rss syndication), - %(image_tag("gold", :size => "45x70")) => %(Gold), - %(image_tag("http://www.example.com/images/icon.gif")) => %(Icon), - %(image_tag("symbolize", "size" => "45x70")) => %(Symbolize) - } - - def test_auto_discovery - AutoDiscoveryToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_javascript_path - JavascriptPathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_javascript_include - JavascriptIncludeToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_register_javascript_include_default - ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'slider' - assert_dom_equal %(\n\n\n\n), javascript_include_tag(:defaults) - ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'lib1', '/elsewhere/blub/lib2' - assert_dom_equal %(\n\n\n\n\n\n), javascript_include_tag(:defaults) - end - - def test_style_path - StylePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_style_link - StyleLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_image_path - ImagePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - end - - def test_image_tag - ImageLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } - # Assigning a default alt tag should not cause an exception to be raised - assert_nothing_raised { image_tag('') } - end - - def test_stylesheet_with_asset_host_already_encoded - ActionController::Base.asset_host = "http://foo.example.com" - result = stylesheet_link_tag("http://bar.example.com/stylesheets/style.css") - assert_dom_equal( - %(), - result) - ensure - ActionController::Base.asset_host = "" - end - -end -require 'test/unit' -require File.dirname(__FILE__) + '/../../lib/action_view/helpers/benchmark_helper' - -class BenchmarkHelperTest < Test::Unit::TestCase - include ActionView::Helpers::BenchmarkHelper - - class MockLogger - attr_reader :logged - - def initialize - @logged = [] - end - - def method_missing(method, *args) - @logged << [method, args] - end - end - - def setup - @logger = MockLogger.new - end - - def test_without_logger_or_block - @logger = nil - assert_nothing_raised { benchmark } - end - - def test_without_block - assert_raise(LocalJumpError) { benchmark } - assert @logger.logged.empty? - end - - def test_without_logger - @logger = nil - i_was_run = false - benchmark { i_was_run = true } - assert !i_was_run - end - - def test_defaults - i_was_run = false - benchmark { i_was_run = true } - assert i_was_run - assert 1, @logger.logged.size - assert_last_logged - end - - def test_with_message - i_was_run = false - benchmark('test_run') { i_was_run = true } - assert i_was_run - assert 1, @logger.logged.size - assert_last_logged 'test_run' - end - - def test_with_message_and_level - i_was_run = false - benchmark('debug_run', :debug) { i_was_run = true } - assert i_was_run - assert 1, @logger.logged.size - assert_last_logged 'debug_run', :debug - end - - private - def assert_last_logged(message = 'Benchmarking', level = :info) - last = @logger.logged.last - assert 2, last.size - assert_equal level, last.first - assert 1, last[1].size - assert last[1][0] =~ /^#{message} \(.*\)$/ - end -end -require 'test/unit' -require File.dirname(__FILE__) + '/../../lib/action_view/helpers/date_helper' -require File.dirname(__FILE__) + "/../abstract_unit" - -class CompiledTemplateTests < Test::Unit::TestCase - - def setup - @ct = ActionView::CompiledTemplates.new - @v = Class.new - @v.send :include, @ct - @a = './test_compile_template_a.rhtml' - @b = './test_compile_template_b.rhtml' - @s = './test_compile_template_link.rhtml' - end - def teardown - [@a, @b, @s].each do |f| - `rm #{f}` if File.exist?(f) || File.symlink?(f) - end - end - attr_reader :ct, :v - - def test_name_allocation - hi_world = ct.method_names['hi world'] - hi_sexy = ct.method_names['hi sexy'] - wish_upon_a_star = ct.method_names['I love seeing decent error messages'] - - assert_equal hi_world, ct.method_names['hi world'] - assert_equal hi_sexy, ct.method_names['hi sexy'] - assert_equal wish_upon_a_star, ct.method_names['I love seeing decent error messages'] - assert_equal 3, [hi_world, hi_sexy, wish_upon_a_star].uniq.length - end - - def test_wrap_source - assert_equal( - "def aliased_assignment(value)\nself.value = value\nend", - @ct.wrap_source(:aliased_assignment, [:value], 'self.value = value') - ) - - assert_equal( - "def simple()\nnil\nend", - @ct.wrap_source(:simple, [], 'nil') - ) - end - - def test_compile_source_single_method - selector = ct.compile_source('doubling method', [:a], 'a + a') - assert_equal 2, @v.new.send(selector, 1) - assert_equal 4, @v.new.send(selector, 2) - assert_equal -4, @v.new.send(selector, -2) - assert_equal 0, @v.new.send(selector, 0) - selector - end - - def test_compile_source_two_method - sel1 = test_compile_source_single_method # compile the method in the other test - sel2 = ct.compile_source('doubling method', [:a, :b], 'a + b + a + b') - assert_not_equal sel1, sel2 - - assert_equal 2, @v.new.send(sel1, 1) - assert_equal 4, @v.new.send(sel1, 2) - - assert_equal 6, @v.new.send(sel2, 1, 2) - assert_equal 32, @v.new.send(sel2, 15, 1) - end - - def test_mtime - t1 = Time.now - test_compile_source_single_method - assert (t1..Time.now).include?(ct.mtime('doubling method', [:a])) - end - - def test_compile_time - `echo '#{@a}' > #{@a}; echo '#{@b}' > #{@b}; ln -s #{@a} #{@s}` - - v = ActionView::Base.new - v.base_path = '.' - v.cache_template_loading = false; - - sleep 1 - t = Time.now - v.compile_and_render_template(:rhtml, '', @a) - v.compile_and_render_template(:rhtml, '', @b) - v.compile_and_render_template(:rhtml, '', @s) - a_n = v.method_names[@a] - b_n = v.method_names[@b] - s_n = v.method_names[@s] - # all of the files have changed since last compile - assert v.compile_time[a_n] > t - assert v.compile_time[b_n] > t - assert v.compile_time[s_n] > t - - sleep 1 - t = Time.now - v.compile_and_render_template(:rhtml, '', @a) - v.compile_and_render_template(:rhtml, '', @b) - v.compile_and_render_template(:rhtml, '', @s) - # none of the files have changed since last compile - assert v.compile_time[a_n] < t - assert v.compile_time[b_n] < t - assert v.compile_time[s_n] < t - - `rm #{@s}; ln -s #{@b} #{@s}` - v.compile_and_render_template(:rhtml, '', @a) - v.compile_and_render_template(:rhtml, '', @b) - v.compile_and_render_template(:rhtml, '', @s) - # the symlink has changed since last compile - assert v.compile_time[a_n] < t - assert v.compile_time[b_n] < t - assert v.compile_time[s_n] > t - - sleep 1 - `touch #{@b}` - t = Time.now - v.compile_and_render_template(:rhtml, '', @a) - v.compile_and_render_template(:rhtml, '', @b) - v.compile_and_render_template(:rhtml, '', @s) - # the file at the end of the symlink has changed since last compile - # both the symlink and the file at the end of it should be recompiled - assert v.compile_time[a_n] < t - assert v.compile_time[b_n] > t - assert v.compile_time[s_n] > t - end -end - -module ActionView - class Base - def compile_time - @@compile_time - end - def method_names - @@method_names - end - end -end -require 'test/unit' -require File.dirname(__FILE__) + "/../abstract_unit" - -class DateHelperTest < Test::Unit::TestCase - include ActionView::Helpers::DateHelper - include ActionView::Helpers::FormHelper - - silence_warnings do - Post = Struct.new("Post", :written_on, :updated_at) - end - - def test_distance_in_words - from = Time.mktime(2004, 3, 6, 21, 41, 18) - - assert_equal "less than a minute", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 21, 41, 25)) - assert_equal "5 minutes", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 21, 46, 25)) - assert_equal "about 1 hour", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 22, 47, 25)) - assert_equal "about 3 hours", distance_of_time_in_words(from, Time.mktime(2004, 3, 7, 0, 41)) - assert_equal "about 4 hours", distance_of_time_in_words(from, Time.mktime(2004, 3, 7, 1, 20)) - assert_equal "2 days", distance_of_time_in_words(from, Time.mktime(2004, 3, 9, 15, 40)) - - # include seconds - assert_equal "less than a minute", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 21, 41, 19), false) - assert_equal "less than 5 seconds", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 21, 41, 19), true) - assert_equal "less than 10 seconds", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 21, 41, 28), true) - assert_equal "less than 20 seconds", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 21, 41, 38), true) - assert_equal "half a minute", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 21, 41, 48), true) - assert_equal "less than a minute", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 21, 42, 17), true) - - assert_equal "1 minute", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 21, 42, 18), true) - assert_equal "1 minute", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 21, 42, 28), true) - assert_equal "2 minutes", distance_of_time_in_words(from, Time.mktime(2004, 3, 6, 21, 42, 48), true) - - # test to < from - assert_equal "about 4 hours", distance_of_time_in_words(Time.mktime(2004, 3, 7, 1, 20), from) - assert_equal "less than 20 seconds", distance_of_time_in_words(Time.mktime(2004, 3, 6, 21, 41, 38), from, true) - - # test with integers - assert_equal "less than a minute", distance_of_time_in_words(50) - assert_equal "about 1 hour", distance_of_time_in_words(60*60) - - # more cumbersome test with integers - assert_equal "less than a minute", distance_of_time_in_words(0, 50) - assert_equal "about 1 hour", distance_of_time_in_words(60*60, 0) - - end - - def test_distance_in_words_date - start_date = Date.new 1975, 1, 31 - end_date = Date.new 1977, 4, 17 - assert_not_equal("13 minutes", - distance_of_time_in_words(start_date, end_date)) - end - - def test_select_day - expected = %(\n" - - assert_equal expected, select_day(Time.mktime(2003, 8, 16)) - assert_equal expected, select_day(16) - end - - def test_select_day_with_blank - expected = %(\n" - - assert_equal expected, select_day(Time.mktime(2003, 8, 16), :include_blank => true) - assert_equal expected, select_day(16, :include_blank => true) - end - - def test_select_day_nil_with_blank - expected = %(\n" - - assert_equal expected, select_day(nil, :include_blank => true) - end - - def test_select_month - expected = %(\n" - - assert_equal expected, select_month(Time.mktime(2003, 8, 16)) - assert_equal expected, select_month(8) - end - - def test_select_month_with_disabled - expected = %(\n" - - assert_equal expected, select_month(Time.mktime(2003, 8, 16), :disabled => true) - assert_equal expected, select_month(8, :disabled => true) - end - - def test_select_month_with_field_name_override - expected = %(\n" - - assert_equal expected, select_month(Time.mktime(2003, 8, 16), :field_name => 'mois') - assert_equal expected, select_month(8, :field_name => 'mois') - end - - def test_select_month_with_blank - expected = %(\n" - - assert_equal expected, select_month(Time.mktime(2003, 8, 16), :include_blank => true) - assert_equal expected, select_month(8, :include_blank => true) - end - - def test_select_month_nil_with_blank - expected = %(\n" - - assert_equal expected, select_month(nil, :include_blank => true) - end - - def test_select_month_with_numbers - expected = %(\n" - - assert_equal expected, select_month(Time.mktime(2003, 8, 16), :use_month_numbers => true) - assert_equal expected, select_month(8, :use_month_numbers => true) - end - - def test_select_month_with_numbers_and_names - expected = %(\n" - - assert_equal expected, select_month(Time.mktime(2003, 8, 16), :add_month_numbers => true) - assert_equal expected, select_month(8, :add_month_numbers => true) - end - - def test_select_month_with_numbers_and_names_with_abbv - expected = %(\n" - - assert_equal expected, select_month(Time.mktime(2003, 8, 16), :add_month_numbers => true, :use_short_month => true) - assert_equal expected, select_month(8, :add_month_numbers => true, :use_short_month => true) - end - - def test_select_month_with_abbv - expected = %(\n" - - assert_equal expected, select_month(Time.mktime(2003, 8, 16), :use_short_month => true) - assert_equal expected, select_month(8, :use_short_month => true) - end - - def test_select_year - expected = %(\n" - - assert_equal expected, select_year(Time.mktime(2003, 8, 16), :start_year => 2003, :end_year => 2005) - assert_equal expected, select_year(2003, :start_year => 2003, :end_year => 2005) - end - - def test_select_year_with_disabled - expected = %(\n" - - assert_equal expected, select_year(Time.mktime(2003, 8, 16), :disabled => true, :start_year => 2003, :end_year => 2005) - assert_equal expected, select_year(2003, :disabled => true, :start_year => 2003, :end_year => 2005) - end - - def test_select_year_with_field_name_override - expected = %(\n" - - assert_equal expected, select_year(Time.mktime(2003, 8, 16), :start_year => 2003, :end_year => 2005, :field_name => 'annee') - assert_equal expected, select_year(2003, :start_year => 2003, :end_year => 2005, :field_name => 'annee') - end - - def test_select_year_with_type_discarding - expected = %(\n" - - assert_equal expected, select_year( - Time.mktime(2003, 8, 16), :prefix => "date_year", :discard_type => true, :start_year => 2003, :end_year => 2005) - assert_equal expected, select_year( - 2003, :prefix => "date_year", :discard_type => true, :start_year => 2003, :end_year => 2005) - end - - def test_select_year_descending - expected = %(\n" - - assert_equal expected, select_year(Time.mktime(2005, 8, 16), :start_year => 2005, :end_year => 2003) - assert_equal expected, select_year(2005, :start_year => 2005, :end_year => 2003) - end - - def test_select_hour - expected = %(\n" - - assert_equal expected, select_hour(Time.mktime(2003, 8, 16, 8, 4, 18)) - end - - def test_select_hour_with_disabled - expected = %(\n" - - assert_equal expected, select_hour(Time.mktime(2003, 8, 16, 8, 4, 18), :disabled => true) - end - - def test_select_hour_with_field_name_override - expected = %(\n" - - assert_equal expected, select_hour(Time.mktime(2003, 8, 16, 8, 4, 18), :field_name => 'heure') - end - - def test_select_hour_with_blank - expected = %(\n" - - assert_equal expected, select_hour(Time.mktime(2003, 8, 16, 8, 4, 18), :include_blank => true) - end - - def test_select_hour_nil_with_blank - expected = %(\n" - - assert_equal expected, select_hour(nil, :include_blank => true) - end - - def test_select_minute - expected = %(\n" - - assert_equal expected, select_minute(Time.mktime(2003, 8, 16, 8, 4, 18)) - end - - def test_select_minute_with_disabled - expected = %(\n" - - assert_equal expected, select_minute(Time.mktime(2003, 8, 16, 8, 4, 18), :disabled => true) - end - - def test_select_minute_with_field_name_override - expected = %(\n" - - assert_equal expected, select_minute(Time.mktime(2003, 8, 16, 8, 4, 18), :field_name => 'minuto') - end - - def test_select_minute_with_blank - expected = %(\n" - - assert_equal expected, select_minute(Time.mktime(2003, 8, 16, 8, 4, 18), :include_blank => true) - end - - def test_select_minute_with_blank_and_step - expected = %(\n" - - assert_equal expected, select_minute(Time.mktime(2003, 8, 16, 8, 4, 18), { :include_blank => true , :minute_step => 15 }) - end - - def test_select_minute_nil_with_blank - expected = %(\n" - - assert_equal expected, select_minute(nil, :include_blank => true) - end - - def test_select_minute_nil_with_blank_and_step - expected = %(\n" - - assert_equal expected, select_minute(nil, { :include_blank => true , :minute_step => 15 }) - end - - def test_select_second - expected = %(\n" - - assert_equal expected, select_second(Time.mktime(2003, 8, 16, 8, 4, 18)) - end - - def test_select_second_with_disabled - expected = %(\n" - - assert_equal expected, select_second(Time.mktime(2003, 8, 16, 8, 4, 18), :disabled => true) - end - - def test_select_second_with_field_name_override - expected = %(\n" - - assert_equal expected, select_second(Time.mktime(2003, 8, 16, 8, 4, 18), :field_name => 'segundo') - end - - def test_select_second_with_blank - expected = %(\n" - - assert_equal expected, select_second(Time.mktime(2003, 8, 16, 8, 4, 18), :include_blank => true) - end - - def test_select_second_nil_with_blank - expected = %(\n" - - assert_equal expected, select_second(nil, :include_blank => true) - end - - def test_select_date - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_date( - Time.mktime(2003, 8, 16), :start_year => 2003, :end_year => 2005, :prefix => "date[first]" - ) - end - - def test_select_date_with_disabled - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_date(Time.mktime(2003, 8, 16), :start_year => 2003, :end_year => 2005, :prefix => "date[first]", :disabled => true) - end - - - def test_select_date_with_no_start_year - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_date( - Time.mktime(Date.today.year, 8, 16), :end_year => Date.today.year+1, :prefix => "date[first]" - ) - end - - def test_select_date_with_no_end_year - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_date( - Time.mktime(2003, 8, 16), :start_year => 2003, :prefix => "date[first]" - ) - end - - def test_select_date_with_no_start_or_end_year - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_date( - Time.mktime(Date.today.year, 8, 16), :prefix => "date[first]" - ) - end - - def test_select_time_with_seconds - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_time(Time.mktime(2003, 8, 16, 8, 4, 18), :include_seconds => true) - end - - def test_select_time_without_seconds - expected = %(\n" - - expected << %(\n" - - assert_equal expected, select_time(Time.mktime(2003, 8, 16, 8, 4, 18)) - assert_equal expected, select_time(Time.mktime(2003, 8, 16, 8, 4, 18), :include_seconds => false) - end - - def test_date_select_with_zero_value - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_date(0, :start_year => 2003, :end_year => 2005, :prefix => "date[first]") - end - - def test_date_select_within_fields_for - @post = Post.new - @post.written_on = Date.new(2004, 6, 15) - - _erbout = '' - - fields_for :post, @post do |f| - _erbout.concat f.date_select(:written_on) - end - - expected = "\n" + - "\n" + - "\n" - - assert_dom_equal(expected, _erbout) - end - - def test_datetime_select_within_fields_for - @post = Post.new - @post.updated_at = Time.local(2004, 6, 15, 16, 35) - - _erbout = '' - - fields_for :post, @post do |f| - _erbout.concat f.datetime_select(:updated_at) - end - - expected = "\n\n\n — \n : \n" - - assert_dom_equal(expected, _erbout) - end - - def test_date_select_with_zero_value_and_no_start_year - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_date(0, :end_year => Date.today.year+1, :prefix => "date[first]") - end - - def test_date_select_with_zero_value_and_no_end_year - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_date(0, :start_year => 2003, :prefix => "date[first]") - end - - def test_date_select_with_zero_value_and_no_start_and_end_year - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_date(0, :prefix => "date[first]") - end - - def test_date_select_with_nil_value_and_no_start_and_end_year - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_date(nil, :prefix => "date[first]") - end - - def test_datetime_select_with_nil_value_and_no_start_and_end_year - expected = %(\n" - - expected << %(\n" - - expected << %(\n" - - expected << %(\n" - - expected << %(\n" - - assert_equal expected, select_datetime(nil, :prefix => "date[first]") - end - -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class FormHelperTest < Test::Unit::TestCase - include ActionView::Helpers::FormHelper - include ActionView::Helpers::FormTagHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include ActionView::Helpers::TextHelper - - silence_warnings do - Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on, :cost) - Post.class_eval do - alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast) - alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast) - alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast) - end - end - - def setup - @post = Post.new - def @post.errors() Class.new{ def on(field) field == "author_name" end }.new end - - def @post.id; 123; end - def @post.id_before_type_cast; 123; end - - @post.title = "Hello World" - @post.author_name = "" - @post.body = "Back to the hill and over it again!" - @post.secret = 1 - @post.written_on = Date.new(2004, 6, 15) - - @controller = Class.new do - attr_reader :url_for_options - def url_for(options, *parameters_for_method_reference) - @url_for_options = options - "http://www.example.com" - end - end - @controller = @controller.new - end - - def test_text_field - assert_dom_equal( - '', text_field("post", "title") - ) - assert_dom_equal( - '', password_field("post", "title") - ) - assert_dom_equal( - '', password_field("person", "name") - ) - end - - def test_text_field_with_escapes - @post.title = "Hello World" - assert_dom_equal( - '', text_field("post", "title") - ) - end - - def test_text_field_with_options - expected = '' - assert_dom_equal expected, text_field("post", "title", "size" => 35) - assert_dom_equal expected, text_field("post", "title", :size => 35) - end - - def test_text_field_assuming_size - expected = '' - assert_dom_equal expected, text_field("post", "title", "maxlength" => 35) - assert_dom_equal expected, text_field("post", "title", :maxlength => 35) - end - - def test_text_field_doesnt_change_param_values - object_name = 'post[]' - expected = '' - assert_equal expected, text_field(object_name, "title") - assert_equal object_name, "post[]" - end - - def test_check_box - assert_dom_equal( - '', - check_box("post", "secret") - ) - @post.secret = 0 - assert_dom_equal( - '', - check_box("post", "secret") - ) - assert_dom_equal( - '', - check_box("post", "secret" ,{"checked"=>"checked"}) - ) - @post.secret = true - assert_dom_equal( - '', - check_box("post", "secret") - ) - end - - def test_check_box_with_explicit_checked_and_unchecked_values - @post.secret = "on" - assert_dom_equal( - '', - check_box("post", "secret", {}, "on", "off") - ) - end - - def test_radio_button - assert_dom_equal('', - radio_button("post", "title", "Hello World") - ) - assert_dom_equal('', - radio_button("post", "title", "Goodbye World") - ) - end - - def test_radio_button_is_checked_with_integers - assert_dom_equal('', - radio_button("post", "secret", "1") - ) - end - - def test_text_area - assert_dom_equal( - '', - text_area("post", "body") - ) - end - - def test_text_area_with_escapes - @post.body = "Back to the hill and over it again!" - assert_dom_equal( - '', - text_area("post", "body") - ) - end - - def test_text_area_with_alternate_value - assert_dom_equal( - '', - text_area("post", "body", :value => 'Testing alternate values.') - ) - end - - def test_date_selects - assert_dom_equal( - '', - text_area("post", "body") - ) - end - - def test_explicit_name - assert_dom_equal( - '', text_field("post", "title", "name" => "dont guess") - ) - assert_dom_equal( - '', - text_area("post", "body", "name" => "really!") - ) - assert_dom_equal( - '', - check_box("post", "secret", "name" => "i mean it") - ) - assert_dom_equal text_field("post", "title", "name" => "dont guess"), - text_field("post", "title", :name => "dont guess") - assert_dom_equal text_area("post", "body", "name" => "really!"), - text_area("post", "body", :name => "really!") - assert_dom_equal check_box("post", "secret", "name" => "i mean it"), - check_box("post", "secret", :name => "i mean it") - end - - def test_explicit_id - assert_dom_equal( - '', text_field("post", "title", "id" => "dont guess") - ) - assert_dom_equal( - '', - text_area("post", "body", "id" => "really!") - ) - assert_dom_equal( - '', - check_box("post", "secret", "id" => "i mean it") - ) - assert_dom_equal text_field("post", "title", "id" => "dont guess"), - text_field("post", "title", :id => "dont guess") - assert_dom_equal text_area("post", "body", "id" => "really!"), - text_area("post", "body", :id => "really!") - assert_dom_equal check_box("post", "secret", "id" => "i mean it"), - check_box("post", "secret", :id => "i mean it") - end - - def test_auto_index - pid = @post.id - assert_dom_equal( - "", text_field("post[]","title") - ) - assert_dom_equal( - "", - text_area("post[]", "body") - ) - assert_dom_equal( - "", - check_box("post[]", "secret") - ) - assert_dom_equal( -"", - radio_button("post[]", "title", "Hello World") - ) - assert_dom_equal("", - radio_button("post[]", "title", "Goodbye World") - ) - end - - def test_form_for - _erbout = '' - - form_for(:post, @post, :html => { :id => 'create-post' }) do |f| - _erbout.concat f.text_field(:title) - _erbout.concat f.text_area(:body) - _erbout.concat f.check_box(:secret) - end - - expected = - "
      " + - "" + - "" + - "" + - "" + - "
      " - - assert_dom_equal expected, _erbout - end - - def test_form_for_without_object - _erbout = '' - - form_for(:post, :html => { :id => 'create-post' }) do |f| - _erbout.concat f.text_field(:title) - _erbout.concat f.text_area(:body) - _erbout.concat f.check_box(:secret) - end - - expected = - "
      " + - "" + - "" + - "" + - "" + - "
      " - - assert_dom_equal expected, _erbout - end - - def test_fields_for - _erbout = '' - - fields_for(:post, @post) do |f| - _erbout.concat f.text_field(:title) - _erbout.concat f.text_area(:body) - _erbout.concat f.check_box(:secret) - end - - expected = - "" + - "" + - "" + - "" - - assert_dom_equal expected, _erbout - end - - def test_fields_for_without_object - _erbout = '' - fields_for(:post) do |f| - _erbout.concat f.text_field(:title) - _erbout.concat f.text_area(:body) - _erbout.concat f.check_box(:secret) - end - - expected = - "" + - "" + - "" + - "" - - assert_dom_equal expected, _erbout - end - - def test_form_builder_does_not_have_form_for_method - assert ! ActionView::Helpers::FormBuilder.instance_methods.include?('form_for') - end - - def test_form_for_and_fields_for - _erbout = '' - - form_for(:post, @post, :html => { :id => 'create-post' }) do |post_form| - _erbout.concat post_form.text_field(:title) - _erbout.concat post_form.text_area(:body) - - fields_for(:parent_post, @post) do |parent_fields| - _erbout.concat parent_fields.check_box(:secret) - end - end - - expected = - "
      " + - "" + - "" + - "" + - "" + - "
      " - - assert_dom_equal expected, _erbout - end - - class LabelledFormBuilder < ActionView::Helpers::FormBuilder - (field_helpers - %w(hidden_field)).each do |selector| - src = <<-END_SRC - def #{selector}(field, *args, &proc) - " " + super + "
      " - end - END_SRC - class_eval src, __FILE__, __LINE__ - end - end - - def test_form_for_with_labelled_builder - _erbout = '' - - form_for(:post, @post, :builder => LabelledFormBuilder) do |f| - _erbout.concat f.text_field(:title) - _erbout.concat f.text_area(:body) - _erbout.concat f.check_box(:secret) - end - - expected = - "
      " + - "
      " + - "
      " + - " " + - "
      " + - "
      " - - assert_dom_equal expected, _erbout - end - - # Perhaps this test should be moved to prototype helper tests. - def test_remote_form_for_with_labelled_builder - self.extend ActionView::Helpers::PrototypeHelper - _erbout = '' - - remote_form_for(:post, @post, :builder => LabelledFormBuilder) do |f| - _erbout.concat f.text_field(:title) - _erbout.concat f.text_area(:body) - _erbout.concat f.check_box(:secret) - end - - expected = - %(
      ) + - "
      " + - "
      " + - " " + - "
      " + - "
      " - - assert_dom_equal expected, _erbout - end - - def test_fields_for_with_labelled_builder - _erbout = '' - - fields_for(:post, @post, :builder => LabelledFormBuilder) do |f| - _erbout.concat f.text_field(:title) - _erbout.concat f.text_area(:body) - _erbout.concat f.check_box(:secret) - end - - expected = - "
      " + - "
      " + - " " + - "
      " - - assert_dom_equal expected, _erbout - end - - def test_form_for_with_html_options_adds_options_to_form_tag - _erbout = '' - - form_for(:post, @post, :html => {:id => 'some_form', :class => 'some_class'}) do |f| end - expected = "
      " - - assert_dom_equal expected, _erbout - end - - def test_form_for_with_string_url_option - _erbout = '' - - form_for(:post, @post, :url => 'http://www.otherdomain.com') do |f| end - - assert_equal 'http://www.otherdomain.com', @controller.url_for_options - end - - def test_form_for_with_hash_url_option - _erbout = '' - - form_for(:post, @post, :url => {:controller => 'controller', :action => 'action'}) do |f| end - - assert_equal 'controller', @controller.url_for_options[:controller] - assert_equal 'action', @controller.url_for_options[:action] - end - - def test_remote_form_for_with_html_options_adds_options_to_form_tag - self.extend ActionView::Helpers::PrototypeHelper - _erbout = '' - - remote_form_for(:post, @post, :html => {:id => 'some_form', :class => 'some_class'}) do |f| end - expected = "
      " - - assert_dom_equal expected, _erbout - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class MockTimeZone - attr_reader :name - - def initialize( name ) - @name = name - end - - def self.all - [ "A", "B", "C", "D", "E" ].map { |s| new s } - end - - def ==( z ) - z && @name == z.name - end - - def to_s - @name - end -end - -ActionView::Helpers::FormOptionsHelper::TimeZone = MockTimeZone - -class FormOptionsHelperTest < Test::Unit::TestCase - include ActionView::Helpers::FormHelper - include ActionView::Helpers::FormOptionsHelper - - silence_warnings do - Post = Struct.new('Post', :title, :author_name, :body, :secret, :written_on, :category, :origin) - Continent = Struct.new('Continent', :continent_name, :countries) - Country = Struct.new('Country', :country_id, :country_name) - Firm = Struct.new('Firm', :time_zone) - end - - def test_collection_options - @posts = [ - Post.new(" went home", "", "To a little house", "shh!"), - Post.new("Babe went home", "Babe", "To a little house", "shh!"), - Post.new("Cabe went home", "Cabe", "To a little house", "shh!") - ] - - assert_dom_equal( - "\n\n", - options_from_collection_for_select(@posts, "author_name", "title") - ) - end - - - def test_collection_options_with_preselected_value - @posts = [ - Post.new(" went home", "", "To a little house", "shh!"), - Post.new("Babe went home", "Babe", "To a little house", "shh!"), - Post.new("Cabe went home", "Cabe", "To a little house", "shh!") - ] - - assert_dom_equal( - "\n\n", - options_from_collection_for_select(@posts, "author_name", "title", "Babe") - ) - end - - def test_collection_options_with_preselected_value_array - @posts = [ - Post.new(" went home", "", "To a little house", "shh!"), - Post.new("Babe went home", "Babe", "To a little house", "shh!"), - Post.new("Cabe went home", "Cabe", "To a little house", "shh!") - ] - - assert_dom_equal( - "\n\n", - options_from_collection_for_select(@posts, "author_name", "title", [ "Babe", "Cabe" ]) - ) - end - - def test_array_options_for_select - assert_dom_equal( - "\n\n", - options_for_select([ "", "USA", "Sweden" ]) - ) - end - - def test_array_options_for_select_with_selection - assert_dom_equal( - "\n\n", - options_for_select([ "Denmark", "", "Sweden" ], "") - ) - end - - def test_array_options_for_select_with_selection_array - assert_dom_equal( - "\n\n", - options_for_select([ "Denmark", "", "Sweden" ], [ "", "Sweden" ]) - ) - end - - def test_array_options_for_string_include_in_other_string_bug_fix - assert_dom_equal( - "\n", - options_for_select([ "ruby", "rubyonrails" ], "rubyonrails") - ) - assert_dom_equal( - "\n", - options_for_select([ "ruby", "rubyonrails" ], "ruby") - ) - end - - def test_hash_options_for_select - assert_dom_equal( - "\n", - options_for_select({ "$" => "Dollar", "" => "" }) - ) - assert_dom_equal( - "\n", - options_for_select({ "$" => "Dollar", "" => "" }, "Dollar") - ) - assert_dom_equal( - "\n", - options_for_select({ "$" => "Dollar", "" => "" }, [ "Dollar", "" ]) - ) - end - - def test_ducktyped_options_for_select - quack = Struct.new(:first, :last) - assert_dom_equal( - "\n", - options_for_select([quack.new("", ""), quack.new("$", "Dollar")]) - ) - assert_dom_equal( - "\n", - options_for_select([quack.new("", ""), quack.new("$", "Dollar")], "Dollar") - ) - assert_dom_equal( - "\n", - options_for_select([quack.new("", ""), quack.new("$", "Dollar")], ["Dollar", ""]) - ) - end - - def test_html_option_groups_from_collection - @continents = [ - Continent.new("", [Country.new("", ""), Country.new("so", "Somalia")] ), - Continent.new("Europe", [Country.new("dk", "Denmark"), Country.new("ie", "Ireland")] ) - ] - - assert_dom_equal( - "\n\n", - option_groups_from_collection_for_select(@continents, "countries", "continent_name", "country_id", "country_name", "dk") - ) - end - - def test_time_zone_options_no_parms - opts = time_zone_options_for_select - assert_dom_equal "\n" + - "\n" + - "\n" + - "\n" + - "", - opts - end - - def test_time_zone_options_with_selected - opts = time_zone_options_for_select( "D" ) - assert_dom_equal "\n" + - "\n" + - "\n" + - "\n" + - "", - opts - end - - def test_time_zone_options_with_unknown_selected - opts = time_zone_options_for_select( "K" ) - assert_dom_equal "\n" + - "\n" + - "\n" + - "\n" + - "", - opts - end - - def test_time_zone_options_with_priority_zones - zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ] - opts = time_zone_options_for_select( nil, zones ) - assert_dom_equal "\n" + - "" + - "\n" + - "\n" + - "\n" + - "", - opts - end - - def test_time_zone_options_with_selected_priority_zones - zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ] - opts = time_zone_options_for_select( "E", zones ) - assert_dom_equal "\n" + - "" + - "\n" + - "\n" + - "\n" + - "", - opts - end - - def test_time_zone_options_with_unselected_priority_zones - zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ] - opts = time_zone_options_for_select( "C", zones ) - assert_dom_equal "\n" + - "" + - "\n" + - "\n" + - "\n" + - "", - opts - end - - def test_select - @post = Post.new - @post.category = "" - assert_dom_equal( - "", - select("post", "category", %w( abe hest)) - ) - end - - def test_select_under_fields_for - @post = Post.new - @post.category = "" - - _erbout = '' - - fields_for :post, @post do |f| - _erbout.concat f.select(:category, %w( abe hest)) - end - - assert_dom_equal( - "", - _erbout - ) - end - - def test_select_with_blank - @post = Post.new - @post.category = "" - assert_dom_equal( - "", - select("post", "category", %w( abe hest), :include_blank => true) - ) - end - - def test_select_with_default_prompt - @post = Post.new - @post.category = "" - assert_dom_equal( - "", - select("post", "category", %w( abe hest), :prompt => true) - ) - end - - def test_select_no_prompt_when_select_has_value - @post = Post.new - @post.category = "" - assert_dom_equal( - "", - select("post", "category", %w( abe hest), :prompt => true) - ) - end - - def test_select_with_given_prompt - @post = Post.new - @post.category = "" - assert_dom_equal( - "", - select("post", "category", %w( abe hest), :prompt => 'The prompt') - ) - end - - def test_select_with_prompt_and_blank - @post = Post.new - @post.category = "" - assert_dom_equal( - "", - select("post", "category", %w( abe hest), :prompt => true, :include_blank => true) - ) - end - - def test_select_with_selected_value - @post = Post.new - @post.category = "" - assert_dom_equal( - "", - select("post", "category", %w( abe hest ), :selected => 'abe') - ) - end - - def test_select_with_selected_nil - @post = Post.new - @post.category = "" - assert_dom_equal( - "", - select("post", "category", %w( abe hest ), :selected => nil) - ) - end - - def test_collection_select - @posts = [ - Post.new(" went home", "", "To a little house", "shh!"), - Post.new("Babe went home", "Babe", "To a little house", "shh!"), - Post.new("Cabe went home", "Cabe", "To a little house", "shh!") - ] - - @post = Post.new - @post.author_name = "Babe" - - assert_dom_equal( - "", - collection_select("post", "author_name", @posts, "author_name", "author_name") - ) - end - - def test_collection_select_under_fields_for - @posts = [ - Post.new(" went home", "", "To a little house", "shh!"), - Post.new("Babe went home", "Babe", "To a little house", "shh!"), - Post.new("Cabe went home", "Cabe", "To a little house", "shh!") - ] - - @post = Post.new - @post.author_name = "Babe" - - _erbout = '' - - fields_for :post, @post do |f| - _erbout.concat f.collection_select(:author_name, @posts, :author_name, :author_name) - end - - assert_dom_equal( - "", - _erbout - ) - end - - def test_collection_select_with_blank_and_style - @posts = [ - Post.new(" went home", "", "To a little house", "shh!"), - Post.new("Babe went home", "Babe", "To a little house", "shh!"), - Post.new("Cabe went home", "Cabe", "To a little house", "shh!") - ] - - @post = Post.new - @post.author_name = "Babe" - - assert_dom_equal( - "", - collection_select("post", "author_name", @posts, "author_name", "author_name", { :include_blank => true }, "style" => "width: 200px") - ) - end - - def test_country_select - @post = Post.new - @post.origin = "Denmark" - assert_dom_equal( - "", - country_select("post", "origin") - ) - end - - def test_time_zone_select - @firm = Firm.new("D") - html = time_zone_select( "firm", "time_zone" ) - assert_dom_equal "", - html - end - - def test_time_zone_select_under_fields_for - @firm = Firm.new("D") - - _erbout = '' - - fields_for :firm, @firm do |f| - _erbout.concat f.time_zone_select(:time_zone) - end - - assert_dom_equal( - "", - _erbout - ) - end - - def test_time_zone_select_with_blank - @firm = Firm.new("D") - html = time_zone_select("firm", "time_zone", nil, :include_blank => true) - assert_dom_equal "", - html - end - - def test_time_zone_select_with_style - @firm = Firm.new("D") - html = time_zone_select("firm", "time_zone", nil, {}, - "style" => "color: red") - assert_dom_equal "", - html - assert_dom_equal html, time_zone_select("firm", "time_zone", nil, {}, - :style => "color: red") - end - - def test_time_zone_select_with_blank_and_style - @firm = Firm.new("D") - html = time_zone_select("firm", "time_zone", nil, - { :include_blank => true }, "style" => "color: red") - assert_dom_equal "", - html - assert_dom_equal html, time_zone_select("firm", "time_zone", nil, - { :include_blank => true }, :style => "color: red") - end - - def test_time_zone_select_with_priority_zones - @firm = Firm.new("D") - zones = [ TimeZone.new("A"), TimeZone.new("D") ] - html = time_zone_select("firm", "time_zone", zones ) - assert_dom_equal "", - html - end -end -require File.dirname(__FILE__) + '/../abstract_unit' - -class FormTagHelperTest < Test::Unit::TestCase - - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include ActionView::Helpers::FormTagHelper - - def setup - @controller = Class.new do - def url_for(options, *parameters_for_method_reference) - "http://www.example.com" - end - end - @controller = @controller.new - end - - def test_check_box_tag - actual = check_box_tag "admin" - expected = %() - assert_dom_equal expected, actual - end - - def test_form_tag - actual = form_tag - expected = %(
      ) - assert_dom_equal expected, actual - end - - def test_form_tag_multipart - actual = form_tag({}, { 'multipart' => true }) - expected = %() - assert_dom_equal expected, actual - end - - def test_hidden_field_tag - actual = hidden_field_tag "id", 3 - expected = %() - assert_dom_equal expected, actual - end - - def test_password_field_tag - actual = password_field_tag - expected = %() - assert_dom_equal expected, actual - end - - def test_radio_button_tag - actual = radio_button_tag "people", "david" - expected = %() - assert_dom_equal expected, actual - end - - def test_select_tag - actual = select_tag "people", "" - expected = %() - assert_dom_equal expected, actual - end - - def test_text_area_tag_size_string - actual = text_area_tag "body", "hello world", "size" => "20x40" - expected = %() - assert_dom_equal expected, actual - end - - def test_text_area_tag_size_symbol - actual = text_area_tag "body", "hello world", :size => "20x40" - expected = %() - assert_dom_equal expected, actual - end - - def test_text_field_tag - actual = text_field_tag "title", "Hello!" - expected = %() - assert_dom_equal expected, actual - end - - def test_text_field_tag_class_string - actual = text_field_tag "title", "Hello!", "class" => "admin" - expected = %() - assert_dom_equal expected, actual - end - - def test_boolean_optios - assert_dom_equal %(), check_box_tag("admin", 1, true, 'disabled' => true, :readonly => "yes") - assert_dom_equal %(), check_box_tag("admin", 1, true, :disabled => false, :readonly => nil) - assert_dom_equal %(), select_tag("people", "", :multiple => true) - assert_dom_equal %(), select_tag("people", "", :multiple => nil) - end - - def test_stringify_symbol_keys - actual = text_field_tag "title", "Hello!", :id => "admin" - expected = %() - assert_dom_equal expected, actual - end - - def test_submit_tag - assert_dom_equal( - %(), - submit_tag("Save", :disable_with => "Saving...", :onclick => "alert('hello!')") - ) - end - - def test_pass - assert_equal 1, 1 - end -end - -require File.dirname(__FILE__) + '/../abstract_unit' - -class JavaScriptMacrosHelperTest < Test::Unit::TestCase - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::JavaScriptMacrosHelper - - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include ActionView::Helpers::TextHelper - include ActionView::Helpers::FormHelper - include ActionView::Helpers::CaptureHelper - - def setup - @controller = Class.new do - def url_for(options, *parameters_for_method_reference) - url = "http://www.example.com/" - url << options[:action].to_s if options and options[:action] - url - end - end - @controller = @controller.new - end - - - def test_auto_complete_field - assert_dom_equal %(), - auto_complete_field("some_input", :url => { :action => "autocomplete" }); - assert_dom_equal %(), - auto_complete_field("some_input", :url => { :action => "autocomplete" }, :tokens => ','); - assert_dom_equal %(), - auto_complete_field("some_input", :url => { :action => "autocomplete" }, :tokens => [',']); - assert_dom_equal %(), - auto_complete_field("some_input", :url => { :action => "autocomplete" }, :min_chars => 3); - assert_dom_equal %(), - auto_complete_field("some_input", :url => { :action => "autocomplete" }, :on_hide => "function(element, update){alert('me');}"); - assert_dom_equal %(), - auto_complete_field("some_input", :url => { :action => "autocomplete" }, :frequency => 2); - assert_dom_equal %(), - auto_complete_field("some_input", :url => { :action => "autocomplete" }, - :after_update_element => "function(element,value){alert('You have chosen: '+value)}"); - end - - def test_auto_complete_result - result = [ { :title => 'test1' }, { :title => 'test2' } ] - assert_equal %(
      • test1
      • test2
      ), - auto_complete_result(result, :title) - assert_equal %(
      • test1
      • test2
      ), - auto_complete_result(result, :title, "est") - - resultuniq = [ { :title => 'test1' }, { :title => 'test1' } ] - assert_equal %(
      • test1
      ), - auto_complete_result(resultuniq, :title, "est") - end - - def test_text_field_with_auto_complete - assert_match "